@krosoft/react 0.0.85 → 0.0.87

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 (49) hide show
  1. package/dist/AppSubTitle-DaFa30Qp.js +13 -0
  2. package/dist/{AppTitle-CJZdhpRm.js → AppTitle-COtcNGNr.js} +4 -4
  3. package/dist/AppVerticalTabs-aeKDheVe.js +829 -0
  4. package/dist/{FormDialog-CwxZPmv4.js → FormDialog-B3u7bHU_.js} +18 -18
  5. package/dist/{MetricCard-5kWhYPKJ.js → MetricCard-L5ETuqBs.js} +3 -3
  6. package/dist/{SearchInput-Dpy2amwO.js → SearchInput-BxnaShYy.js} +3 -3
  7. package/dist/{TableFilter-w9BHeObX.js → TableFilter-RzydxKBF.js} +6 -5
  8. package/dist/{TableSettings-DNkdLgCN.js → TableSettings-Bwysm3KH.js} +15 -15
  9. package/dist/{ThemeSelector-BCU1tFyR.js → ThemeSelector-mZBbr2qt.js} +3 -3
  10. package/dist/{Topbar-DifQ00kV.js → Topbar-DzFClMWt.js} +6 -5
  11. package/dist/{badge-Bw-aBz_H.js → badge-DCS7KMnM.js} +1 -1
  12. package/dist/components/core/cards/index.js +1 -1
  13. package/dist/components/core/dialogs/index.js +1 -1
  14. package/dist/components/core/filters/index.d.ts +1 -0
  15. package/dist/components/core/filters/index.d.ts.map +1 -1
  16. package/dist/components/core/filters/index.js +5 -4
  17. package/dist/components/core/index.d.ts +4 -4
  18. package/dist/components/core/index.d.ts.map +1 -1
  19. package/dist/components/core/index.js +55 -46
  20. package/dist/components/core/inputs/index.js +1 -1
  21. package/dist/components/core/layouts/AppSubTitle.d.ts +8 -0
  22. package/dist/components/core/layouts/AppSubTitle.d.ts.map +1 -0
  23. package/dist/components/core/layouts/index.d.ts +1 -0
  24. package/dist/components/core/layouts/index.d.ts.map +1 -1
  25. package/dist/components/core/layouts/index.js +5 -3
  26. package/dist/components/core/navbar/index.d.ts +2 -0
  27. package/dist/components/core/navbar/index.d.ts.map +1 -1
  28. package/dist/components/core/navbar/index.js +4 -3
  29. package/dist/components/core/table/index.js +1 -1
  30. package/dist/components/core/tabs/index.d.ts +5 -0
  31. package/dist/components/core/tabs/index.d.ts.map +1 -0
  32. package/dist/components/core/tabs/index.js +7 -0
  33. package/dist/components/core/theme/index.js +1 -1
  34. package/dist/components/index.js +109 -100
  35. package/dist/components/ui/index.js +4 -4
  36. package/dist/components/ui/scroll-area.d.ts.map +1 -1
  37. package/dist/dropdown-menu-BDcm9kW8.js +1086 -0
  38. package/dist/index-DUnCfjrC.js +2176 -0
  39. package/dist/popover-PsZp711z.js +4533 -0
  40. package/dist/select-C6w0ck7-.js +1737 -0
  41. package/dist/tooltip-CtjaR1qq.js +337 -0
  42. package/dist/types/UseDataTableResult.d.ts +1 -1
  43. package/dist/types/UseDataTableResult.d.ts.map +1 -1
  44. package/package.json +6 -5
  45. package/dist/dropdown-menu-Q_WkonPk.js +0 -1685
  46. package/dist/floating-ui.react-dom-BIcsGc3t.js +0 -1681
  47. package/dist/popover-BMvYmQOM.js +0 -5897
  48. package/dist/select-CtU681LB.js +0 -2070
  49. package/dist/tooltip-DzQngJZK.js +0 -828
@@ -0,0 +1,1737 @@
1
+ import { jsx as v, jsxs as re, Fragment as Ge } from "react/jsx-runtime";
2
+ import { c as q } from "./index-gWiv5-6R.js";
3
+ import * as a from "react";
4
+ import ne, { useState as fn } from "react";
5
+ import * as st from "react-dom";
6
+ import pn from "react-dom";
7
+ import { m as ut, a as dt, u as B, o as G, h as M, l as We, A as mn, i as A, e as Ye, d as ft, D as vn, C as hn, f as Ze, g as gn, V as Sn, j as yn, k as pt } from "./index-DUnCfjrC.js";
8
+ import { c as mt } from "./createLucideIcon-CRdjzt2A.js";
9
+ function wn(e) {
10
+ const t = a.useRef({ value: e, previous: e });
11
+ return a.useMemo(() => (t.current.value !== e && (t.current.previous = t.current.value, t.current.value = e), t.current.previous), [e]);
12
+ }
13
+ /**
14
+ * @license lucide-react v1.16.0 - ISC
15
+ *
16
+ * This source code is licensed under the ISC license.
17
+ * See the LICENSE file in the root directory of this source tree.
18
+ */
19
+ const Cn = [["path", { d: "M20 6 9 17l-5-5", key: "1gmf2c" }]], bn = mt("check", Cn);
20
+ /**
21
+ * @license lucide-react v1.16.0 - ISC
22
+ *
23
+ * This source code is licensed under the ISC license.
24
+ * See the LICENSE file in the root directory of this source tree.
25
+ */
26
+ const En = [["path", { d: "m18 15-6-6-6 6", key: "153udz" }]], xn = mt("chevron-up", En);
27
+ // @__NO_SIDE_EFFECTS__
28
+ function qe(e) {
29
+ const t = /* @__PURE__ */ Rn(e), n = a.forwardRef((r, o) => {
30
+ const { children: l, ...s } = r, c = a.Children.toArray(l), u = c.find(In);
31
+ if (u) {
32
+ const d = u.props.children, S = c.map((h) => h === u ? a.Children.count(d) > 1 ? a.Children.only(null) : a.isValidElement(d) ? d.props.children : null : h);
33
+ return /* @__PURE__ */ v(t, { ...s, ref: o, children: a.isValidElement(d) ? a.cloneElement(d, void 0, S) : null });
34
+ }
35
+ return /* @__PURE__ */ v(t, { ...s, ref: o, children: l });
36
+ });
37
+ return n.displayName = `${e}.Slot`, n;
38
+ }
39
+ // @__NO_SIDE_EFFECTS__
40
+ function Rn(e) {
41
+ const t = a.forwardRef((n, r) => {
42
+ const { children: o, ...l } = n;
43
+ if (a.isValidElement(o)) {
44
+ const s = Pn(o), c = Nn(l, o.props);
45
+ return o.type !== a.Fragment && (c.ref = r ? ut(r, s) : s), a.cloneElement(o, c);
46
+ }
47
+ return a.Children.count(o) > 1 ? a.Children.only(null) : null;
48
+ });
49
+ return t.displayName = `${e}.SlotClone`, t;
50
+ }
51
+ var Tn = Symbol("radix.slottable");
52
+ function In(e) {
53
+ return a.isValidElement(e) && typeof e.type == "function" && "__radixId" in e.type && e.type.__radixId === Tn;
54
+ }
55
+ function Nn(e, t) {
56
+ const n = { ...t };
57
+ for (const r in t) {
58
+ const o = e[r], l = t[r];
59
+ /^on[A-Z]/.test(r) ? o && l ? n[r] = (...c) => {
60
+ const u = l(...c);
61
+ return o(...c), u;
62
+ } : o && (n[r] = o) : r === "style" ? n[r] = { ...o, ...l } : r === "className" && (n[r] = [o, l].filter(Boolean).join(" "));
63
+ }
64
+ return { ...e, ...n };
65
+ }
66
+ function Pn(e) {
67
+ var r, o;
68
+ let t = (r = Object.getOwnPropertyDescriptor(e.props, "ref")) == null ? void 0 : r.get, n = t && "isReactWarning" in t && t.isReactWarning;
69
+ return n ? e.ref : (t = (o = Object.getOwnPropertyDescriptor(e, "ref")) == null ? void 0 : o.get, n = t && "isReactWarning" in t && t.isReactWarning, n ? e.props.ref : e.props.ref || e.ref);
70
+ }
71
+ function _n(e) {
72
+ const t = e + "CollectionProvider", [n, r] = dt(t), [o, l] = n(
73
+ t,
74
+ { collectionRef: { current: null }, itemMap: /* @__PURE__ */ new Map() }
75
+ ), s = (i) => {
76
+ const { scope: p, children: g } = i, f = ne.useRef(null), m = ne.useRef(/* @__PURE__ */ new Map()).current;
77
+ return /* @__PURE__ */ v(o, { scope: p, itemMap: m, collectionRef: f, children: g });
78
+ };
79
+ s.displayName = t;
80
+ const c = e + "CollectionSlot", u = /* @__PURE__ */ qe(c), d = ne.forwardRef(
81
+ (i, p) => {
82
+ const { scope: g, children: f } = i, m = l(c, g), b = B(p, m.collectionRef);
83
+ return /* @__PURE__ */ v(u, { ref: b, children: f });
84
+ }
85
+ );
86
+ d.displayName = c;
87
+ const S = e + "CollectionItemSlot", h = "data-radix-collection-item", y = /* @__PURE__ */ qe(S), w = ne.forwardRef(
88
+ (i, p) => {
89
+ const { scope: g, children: f, ...m } = i, b = ne.useRef(null), x = B(p, b), _ = l(S, g);
90
+ return ne.useEffect(() => (_.itemMap.set(b, { ref: b, ...m }), () => void _.itemMap.delete(b))), /* @__PURE__ */ v(y, { [h]: "", ref: x, children: f });
91
+ }
92
+ );
93
+ w.displayName = S;
94
+ function E(i) {
95
+ const p = l(e + "CollectionConsumer", i);
96
+ return ne.useCallback(() => {
97
+ const f = p.collectionRef.current;
98
+ if (!f) return [];
99
+ const m = Array.from(f.querySelectorAll(`[${h}]`));
100
+ return Array.from(p.itemMap.values()).sort(
101
+ (_, R) => m.indexOf(_.ref.current) - m.indexOf(R.ref.current)
102
+ );
103
+ }, [p.collectionRef, p.itemMap]);
104
+ }
105
+ return [
106
+ { Provider: s, Slot: d, ItemSlot: w },
107
+ E,
108
+ r
109
+ ];
110
+ }
111
+ var An = "Portal", vt = a.forwardRef((e, t) => {
112
+ var c;
113
+ const { container: n, ...r } = e, [o, l] = a.useState(!1);
114
+ G(() => l(!0), []);
115
+ const s = n || o && ((c = globalThis == null ? void 0 : globalThis.document) == null ? void 0 : c.body);
116
+ return s ? pn.createPortal(/* @__PURE__ */ v(M.div, { ...r, ref: t }), s) : null;
117
+ });
118
+ vt.displayName = An;
119
+ function Qe(e, [t, n]) {
120
+ return Math.min(n, Math.max(t, e));
121
+ }
122
+ var Mn = a.createContext(void 0);
123
+ function On(e) {
124
+ const t = a.useContext(Mn);
125
+ return e || t || "ltr";
126
+ }
127
+ var Oe = 0;
128
+ function kn() {
129
+ a.useEffect(() => {
130
+ const e = document.querySelectorAll("[data-radix-focus-guard]");
131
+ return document.body.insertAdjacentElement("afterbegin", e[0] ?? Je()), document.body.insertAdjacentElement("beforeend", e[1] ?? Je()), Oe++, () => {
132
+ Oe === 1 && document.querySelectorAll("[data-radix-focus-guard]").forEach((t) => t.remove()), Oe--;
133
+ };
134
+ }, []);
135
+ }
136
+ function Je() {
137
+ const e = document.createElement("span");
138
+ return e.setAttribute("data-radix-focus-guard", ""), e.tabIndex = 0, e.style.outline = "none", e.style.opacity = "0", e.style.position = "fixed", e.style.pointerEvents = "none", e;
139
+ }
140
+ var ke = "focusScope.autoFocusOnMount", Le = "focusScope.autoFocusOnUnmount", et = { bubbles: !1, cancelable: !0 }, Ln = "FocusScope", ht = a.forwardRef((e, t) => {
141
+ const {
142
+ loop: n = !1,
143
+ trapped: r = !1,
144
+ onMountAutoFocus: o,
145
+ onUnmountAutoFocus: l,
146
+ ...s
147
+ } = e, [c, u] = a.useState(null), d = We(o), S = We(l), h = a.useRef(null), y = B(t, (i) => u(i)), w = a.useRef({
148
+ paused: !1,
149
+ pause() {
150
+ this.paused = !0;
151
+ },
152
+ resume() {
153
+ this.paused = !1;
154
+ }
155
+ }).current;
156
+ a.useEffect(() => {
157
+ if (r) {
158
+ let i = function(m) {
159
+ if (w.paused || !c) return;
160
+ const b = m.target;
161
+ c.contains(b) ? h.current = b : Z(h.current, { select: !0 });
162
+ }, p = function(m) {
163
+ if (w.paused || !c) return;
164
+ const b = m.relatedTarget;
165
+ b !== null && (c.contains(b) || Z(h.current, { select: !0 }));
166
+ }, g = function(m) {
167
+ if (document.activeElement === document.body)
168
+ for (const x of m)
169
+ x.removedNodes.length > 0 && Z(c);
170
+ };
171
+ document.addEventListener("focusin", i), document.addEventListener("focusout", p);
172
+ const f = new MutationObserver(g);
173
+ return c && f.observe(c, { childList: !0, subtree: !0 }), () => {
174
+ document.removeEventListener("focusin", i), document.removeEventListener("focusout", p), f.disconnect();
175
+ };
176
+ }
177
+ }, [r, c, w.paused]), a.useEffect(() => {
178
+ if (c) {
179
+ nt.add(w);
180
+ const i = document.activeElement;
181
+ if (!c.contains(i)) {
182
+ const g = new CustomEvent(ke, et);
183
+ c.addEventListener(ke, d), c.dispatchEvent(g), g.defaultPrevented || (Dn(Hn(gt(c)), { select: !0 }), document.activeElement === i && Z(c));
184
+ }
185
+ return () => {
186
+ c.removeEventListener(ke, d), setTimeout(() => {
187
+ const g = new CustomEvent(Le, et);
188
+ c.addEventListener(Le, S), c.dispatchEvent(g), g.defaultPrevented || Z(i ?? document.body, { select: !0 }), c.removeEventListener(Le, S), nt.remove(w);
189
+ }, 0);
190
+ };
191
+ }
192
+ }, [c, d, S, w]);
193
+ const E = a.useCallback(
194
+ (i) => {
195
+ if (!n && !r || w.paused) return;
196
+ const p = i.key === "Tab" && !i.altKey && !i.ctrlKey && !i.metaKey, g = document.activeElement;
197
+ if (p && g) {
198
+ const f = i.currentTarget, [m, b] = Bn(f);
199
+ m && b ? !i.shiftKey && g === b ? (i.preventDefault(), n && Z(m, { select: !0 })) : i.shiftKey && g === m && (i.preventDefault(), n && Z(b, { select: !0 })) : g === f && i.preventDefault();
200
+ }
201
+ },
202
+ [n, r, w.paused]
203
+ );
204
+ return /* @__PURE__ */ v(M.div, { tabIndex: -1, ...s, ref: y, onKeyDown: E });
205
+ });
206
+ ht.displayName = Ln;
207
+ function Dn(e, { select: t = !1 } = {}) {
208
+ const n = document.activeElement;
209
+ for (const r of e)
210
+ if (Z(r, { select: t }), document.activeElement !== n) return;
211
+ }
212
+ function Bn(e) {
213
+ const t = gt(e), n = tt(t, e), r = tt(t.reverse(), e);
214
+ return [n, r];
215
+ }
216
+ function gt(e) {
217
+ const t = [], n = document.createTreeWalker(e, NodeFilter.SHOW_ELEMENT, {
218
+ acceptNode: (r) => {
219
+ const o = r.tagName === "INPUT" && r.type === "hidden";
220
+ return r.disabled || r.hidden || o ? NodeFilter.FILTER_SKIP : r.tabIndex >= 0 ? NodeFilter.FILTER_ACCEPT : NodeFilter.FILTER_SKIP;
221
+ }
222
+ });
223
+ for (; n.nextNode(); ) t.push(n.currentNode);
224
+ return t;
225
+ }
226
+ function tt(e, t) {
227
+ for (const n of e)
228
+ if (!Vn(n, { upTo: t })) return n;
229
+ }
230
+ function Vn(e, { upTo: t }) {
231
+ if (getComputedStyle(e).visibility === "hidden") return !0;
232
+ for (; e; ) {
233
+ if (t !== void 0 && e === t) return !1;
234
+ if (getComputedStyle(e).display === "none") return !0;
235
+ e = e.parentElement;
236
+ }
237
+ return !1;
238
+ }
239
+ function Fn(e) {
240
+ return e instanceof HTMLInputElement && "select" in e;
241
+ }
242
+ function Z(e, { select: t = !1 } = {}) {
243
+ if (e && e.focus) {
244
+ const n = document.activeElement;
245
+ e.focus({ preventScroll: !0 }), e !== n && Fn(e) && t && e.select();
246
+ }
247
+ }
248
+ var nt = Wn();
249
+ function Wn() {
250
+ let e = [];
251
+ return {
252
+ add(t) {
253
+ const n = e[0];
254
+ t !== n && (n == null || n.pause()), e = rt(e, t), e.unshift(t);
255
+ },
256
+ remove(t) {
257
+ var n;
258
+ e = rt(e, t), (n = e[0]) == null || n.resume();
259
+ }
260
+ };
261
+ }
262
+ function rt(e, t) {
263
+ const n = [...e], r = n.indexOf(t);
264
+ return r !== -1 && n.splice(r, 1), n;
265
+ }
266
+ function Hn(e) {
267
+ return e.filter((t) => t.tagName !== "A");
268
+ }
269
+ // @__NO_SIDE_EFFECTS__
270
+ function Un(e) {
271
+ const t = /* @__PURE__ */ Kn(e), n = a.forwardRef((r, o) => {
272
+ const { children: l, ...s } = r, c = a.Children.toArray(l), u = c.find($n);
273
+ if (u) {
274
+ const d = u.props.children, S = c.map((h) => h === u ? a.Children.count(d) > 1 ? a.Children.only(null) : a.isValidElement(d) ? d.props.children : null : h);
275
+ return /* @__PURE__ */ v(t, { ...s, ref: o, children: a.isValidElement(d) ? a.cloneElement(d, void 0, S) : null });
276
+ }
277
+ return /* @__PURE__ */ v(t, { ...s, ref: o, children: l });
278
+ });
279
+ return n.displayName = `${e}.Slot`, n;
280
+ }
281
+ // @__NO_SIDE_EFFECTS__
282
+ function Kn(e) {
283
+ const t = a.forwardRef((n, r) => {
284
+ const { children: o, ...l } = n;
285
+ if (a.isValidElement(o)) {
286
+ const s = Gn(o), c = zn(l, o.props);
287
+ return o.type !== a.Fragment && (c.ref = r ? ut(r, s) : s), a.cloneElement(o, c);
288
+ }
289
+ return a.Children.count(o) > 1 ? a.Children.only(null) : null;
290
+ });
291
+ return t.displayName = `${e}.SlotClone`, t;
292
+ }
293
+ var jn = Symbol("radix.slottable");
294
+ function $n(e) {
295
+ return a.isValidElement(e) && typeof e.type == "function" && "__radixId" in e.type && e.type.__radixId === jn;
296
+ }
297
+ function zn(e, t) {
298
+ const n = { ...t };
299
+ for (const r in t) {
300
+ const o = e[r], l = t[r];
301
+ /^on[A-Z]/.test(r) ? o && l ? n[r] = (...c) => {
302
+ const u = l(...c);
303
+ return o(...c), u;
304
+ } : o && (n[r] = o) : r === "style" ? n[r] = { ...o, ...l } : r === "className" && (n[r] = [o, l].filter(Boolean).join(" "));
305
+ }
306
+ return { ...e, ...n };
307
+ }
308
+ function Gn(e) {
309
+ var r, o;
310
+ let t = (r = Object.getOwnPropertyDescriptor(e.props, "ref")) == null ? void 0 : r.get, n = t && "isReactWarning" in t && t.isReactWarning;
311
+ return n ? e.ref : (t = (o = Object.getOwnPropertyDescriptor(e, "ref")) == null ? void 0 : o.get, n = t && "isReactWarning" in t && t.isReactWarning, n ? e.props.ref : e.props.ref || e.ref);
312
+ }
313
+ var Yn = function(e) {
314
+ if (typeof document > "u")
315
+ return null;
316
+ var t = Array.isArray(e) ? e[0] : e;
317
+ return t.ownerDocument.body;
318
+ }, ie = /* @__PURE__ */ new WeakMap(), he = /* @__PURE__ */ new WeakMap(), ge = {}, De = 0, St = function(e) {
319
+ return e && (e.host || St(e.parentNode));
320
+ }, Xn = function(e, t) {
321
+ return t.map(function(n) {
322
+ if (e.contains(n))
323
+ return n;
324
+ var r = St(n);
325
+ return r && e.contains(r) ? r : (console.error("aria-hidden", n, "in not contained inside", e, ". Doing nothing"), null);
326
+ }).filter(function(n) {
327
+ return !!n;
328
+ });
329
+ }, Zn = function(e, t, n, r) {
330
+ var o = Xn(t, Array.isArray(e) ? e : [e]);
331
+ ge[n] || (ge[n] = /* @__PURE__ */ new WeakMap());
332
+ var l = ge[n], s = [], c = /* @__PURE__ */ new Set(), u = new Set(o), d = function(h) {
333
+ !h || c.has(h) || (c.add(h), d(h.parentNode));
334
+ };
335
+ o.forEach(d);
336
+ var S = function(h) {
337
+ !h || u.has(h) || Array.prototype.forEach.call(h.children, function(y) {
338
+ if (c.has(y))
339
+ S(y);
340
+ else
341
+ try {
342
+ var w = y.getAttribute(r), E = w !== null && w !== "false", i = (ie.get(y) || 0) + 1, p = (l.get(y) || 0) + 1;
343
+ ie.set(y, i), l.set(y, p), s.push(y), i === 1 && E && he.set(y, !0), p === 1 && y.setAttribute(n, "true"), E || y.setAttribute(r, "true");
344
+ } catch (g) {
345
+ console.error("aria-hidden: cannot operate on ", y, g);
346
+ }
347
+ });
348
+ };
349
+ return S(t), c.clear(), De++, function() {
350
+ s.forEach(function(h) {
351
+ var y = ie.get(h) - 1, w = l.get(h) - 1;
352
+ ie.set(h, y), l.set(h, w), y || (he.has(h) || h.removeAttribute(r), he.delete(h)), w || h.removeAttribute(n);
353
+ }), De--, De || (ie = /* @__PURE__ */ new WeakMap(), ie = /* @__PURE__ */ new WeakMap(), he = /* @__PURE__ */ new WeakMap(), ge = {});
354
+ };
355
+ }, qn = function(e, t, n) {
356
+ n === void 0 && (n = "data-aria-hidden");
357
+ var r = Array.from(Array.isArray(e) ? e : [e]), o = Yn(e);
358
+ return o ? (r.push.apply(r, Array.from(o.querySelectorAll("[aria-live], script"))), Zn(r, o, n, "aria-hidden")) : function() {
359
+ return null;
360
+ };
361
+ }, U = function() {
362
+ return U = Object.assign || function(t) {
363
+ for (var n, r = 1, o = arguments.length; r < o; r++) {
364
+ n = arguments[r];
365
+ for (var l in n) Object.prototype.hasOwnProperty.call(n, l) && (t[l] = n[l]);
366
+ }
367
+ return t;
368
+ }, U.apply(this, arguments);
369
+ };
370
+ function yt(e, t) {
371
+ var n = {};
372
+ for (var r in e) Object.prototype.hasOwnProperty.call(e, r) && t.indexOf(r) < 0 && (n[r] = e[r]);
373
+ if (e != null && typeof Object.getOwnPropertySymbols == "function")
374
+ for (var o = 0, r = Object.getOwnPropertySymbols(e); o < r.length; o++)
375
+ t.indexOf(r[o]) < 0 && Object.prototype.propertyIsEnumerable.call(e, r[o]) && (n[r[o]] = e[r[o]]);
376
+ return n;
377
+ }
378
+ function Qn(e, t, n) {
379
+ if (n || arguments.length === 2) for (var r = 0, o = t.length, l; r < o; r++)
380
+ (l || !(r in t)) && (l || (l = Array.prototype.slice.call(t, 0, r)), l[r] = t[r]);
381
+ return e.concat(l || Array.prototype.slice.call(t));
382
+ }
383
+ var we = "right-scroll-bar-position", Ce = "width-before-scroll-bar", Jn = "with-scroll-bars-hidden", er = "--removed-body-scroll-bar-size";
384
+ function Be(e, t) {
385
+ return typeof e == "function" ? e(t) : e && (e.current = t), e;
386
+ }
387
+ function tr(e, t) {
388
+ var n = fn(function() {
389
+ return {
390
+ // value
391
+ value: e,
392
+ // last callback
393
+ callback: t,
394
+ // "memoized" public interface
395
+ facade: {
396
+ get current() {
397
+ return n.value;
398
+ },
399
+ set current(r) {
400
+ var o = n.value;
401
+ o !== r && (n.value = r, n.callback(r, o));
402
+ }
403
+ }
404
+ };
405
+ })[0];
406
+ return n.callback = t, n.facade;
407
+ }
408
+ var nr = typeof window < "u" ? a.useLayoutEffect : a.useEffect, ot = /* @__PURE__ */ new WeakMap();
409
+ function rr(e, t) {
410
+ var n = tr(null, function(r) {
411
+ return e.forEach(function(o) {
412
+ return Be(o, r);
413
+ });
414
+ });
415
+ return nr(function() {
416
+ var r = ot.get(n);
417
+ if (r) {
418
+ var o = new Set(r), l = new Set(e), s = n.current;
419
+ o.forEach(function(c) {
420
+ l.has(c) || Be(c, null);
421
+ }), l.forEach(function(c) {
422
+ o.has(c) || Be(c, s);
423
+ });
424
+ }
425
+ ot.set(n, e);
426
+ }, [e]), n;
427
+ }
428
+ function or(e) {
429
+ return e;
430
+ }
431
+ function ar(e, t) {
432
+ t === void 0 && (t = or);
433
+ var n = [], r = !1, o = {
434
+ read: function() {
435
+ if (r)
436
+ throw new Error("Sidecar: could not `read` from an `assigned` medium. `read` could be used only with `useMedium`.");
437
+ return n.length ? n[n.length - 1] : e;
438
+ },
439
+ useMedium: function(l) {
440
+ var s = t(l, r);
441
+ return n.push(s), function() {
442
+ n = n.filter(function(c) {
443
+ return c !== s;
444
+ });
445
+ };
446
+ },
447
+ assignSyncMedium: function(l) {
448
+ for (r = !0; n.length; ) {
449
+ var s = n;
450
+ n = [], s.forEach(l);
451
+ }
452
+ n = {
453
+ push: function(c) {
454
+ return l(c);
455
+ },
456
+ filter: function() {
457
+ return n;
458
+ }
459
+ };
460
+ },
461
+ assignMedium: function(l) {
462
+ r = !0;
463
+ var s = [];
464
+ if (n.length) {
465
+ var c = n;
466
+ n = [], c.forEach(l), s = n;
467
+ }
468
+ var u = function() {
469
+ var S = s;
470
+ s = [], S.forEach(l);
471
+ }, d = function() {
472
+ return Promise.resolve().then(u);
473
+ };
474
+ d(), n = {
475
+ push: function(S) {
476
+ s.push(S), d();
477
+ },
478
+ filter: function(S) {
479
+ return s = s.filter(S), n;
480
+ }
481
+ };
482
+ }
483
+ };
484
+ return o;
485
+ }
486
+ function cr(e) {
487
+ e === void 0 && (e = {});
488
+ var t = ar(null);
489
+ return t.options = U({ async: !0, ssr: !1 }, e), t;
490
+ }
491
+ var wt = function(e) {
492
+ var t = e.sideCar, n = yt(e, ["sideCar"]);
493
+ if (!t)
494
+ throw new Error("Sidecar: please provide `sideCar` property to import the right car");
495
+ var r = t.read();
496
+ if (!r)
497
+ throw new Error("Sidecar medium not found");
498
+ return a.createElement(r, U({}, n));
499
+ };
500
+ wt.isSideCarExport = !0;
501
+ function ir(e, t) {
502
+ return e.useMedium(t), wt;
503
+ }
504
+ var Ct = cr(), Ve = function() {
505
+ }, Ee = a.forwardRef(function(e, t) {
506
+ var n = a.useRef(null), r = a.useState({
507
+ onScrollCapture: Ve,
508
+ onWheelCapture: Ve,
509
+ onTouchMoveCapture: Ve
510
+ }), o = r[0], l = r[1], s = e.forwardProps, c = e.children, u = e.className, d = e.removeScrollBar, S = e.enabled, h = e.shards, y = e.sideCar, w = e.noRelative, E = e.noIsolation, i = e.inert, p = e.allowPinchZoom, g = e.as, f = g === void 0 ? "div" : g, m = e.gapMode, b = yt(e, ["forwardProps", "children", "className", "removeScrollBar", "enabled", "shards", "sideCar", "noRelative", "noIsolation", "inert", "allowPinchZoom", "as", "gapMode"]), x = y, _ = rr([n, t]), R = U(U({}, b), o);
511
+ return a.createElement(
512
+ a.Fragment,
513
+ null,
514
+ S && a.createElement(x, { sideCar: Ct, removeScrollBar: d, shards: h, noRelative: w, noIsolation: E, inert: i, setCallbacks: l, allowPinchZoom: !!p, lockRef: n, gapMode: m }),
515
+ s ? a.cloneElement(a.Children.only(c), U(U({}, R), { ref: _ })) : a.createElement(f, U({}, R, { className: u, ref: _ }), c)
516
+ );
517
+ });
518
+ Ee.defaultProps = {
519
+ enabled: !0,
520
+ removeScrollBar: !0,
521
+ inert: !1
522
+ };
523
+ Ee.classNames = {
524
+ fullWidth: Ce,
525
+ zeroRight: we
526
+ };
527
+ var lr = function() {
528
+ if (typeof __webpack_nonce__ < "u")
529
+ return __webpack_nonce__;
530
+ };
531
+ function sr() {
532
+ if (!document)
533
+ return null;
534
+ var e = document.createElement("style");
535
+ e.type = "text/css";
536
+ var t = lr();
537
+ return t && e.setAttribute("nonce", t), e;
538
+ }
539
+ function ur(e, t) {
540
+ e.styleSheet ? e.styleSheet.cssText = t : e.appendChild(document.createTextNode(t));
541
+ }
542
+ function dr(e) {
543
+ var t = document.head || document.getElementsByTagName("head")[0];
544
+ t.appendChild(e);
545
+ }
546
+ var fr = function() {
547
+ var e = 0, t = null;
548
+ return {
549
+ add: function(n) {
550
+ e == 0 && (t = sr()) && (ur(t, n), dr(t)), e++;
551
+ },
552
+ remove: function() {
553
+ e--, !e && t && (t.parentNode && t.parentNode.removeChild(t), t = null);
554
+ }
555
+ };
556
+ }, pr = function() {
557
+ var e = fr();
558
+ return function(t, n) {
559
+ a.useEffect(function() {
560
+ return e.add(t), function() {
561
+ e.remove();
562
+ };
563
+ }, [t && n]);
564
+ };
565
+ }, bt = function() {
566
+ var e = pr(), t = function(n) {
567
+ var r = n.styles, o = n.dynamic;
568
+ return e(r, o), null;
569
+ };
570
+ return t;
571
+ }, mr = {
572
+ left: 0,
573
+ top: 0,
574
+ right: 0,
575
+ gap: 0
576
+ }, Fe = function(e) {
577
+ return parseInt(e || "", 10) || 0;
578
+ }, vr = function(e) {
579
+ var t = window.getComputedStyle(document.body), n = t[e === "padding" ? "paddingLeft" : "marginLeft"], r = t[e === "padding" ? "paddingTop" : "marginTop"], o = t[e === "padding" ? "paddingRight" : "marginRight"];
580
+ return [Fe(n), Fe(r), Fe(o)];
581
+ }, hr = function(e) {
582
+ if (e === void 0 && (e = "margin"), typeof window > "u")
583
+ return mr;
584
+ var t = vr(e), n = document.documentElement.clientWidth, r = window.innerWidth;
585
+ return {
586
+ left: t[0],
587
+ top: t[1],
588
+ right: t[2],
589
+ gap: Math.max(0, r - n + t[2] - t[0])
590
+ };
591
+ }, gr = bt(), ue = "data-scroll-locked", Sr = function(e, t, n, r) {
592
+ var o = e.left, l = e.top, s = e.right, c = e.gap;
593
+ return n === void 0 && (n = "margin"), `
594
+ .`.concat(Jn, ` {
595
+ overflow: hidden `).concat(r, `;
596
+ padding-right: `).concat(c, "px ").concat(r, `;
597
+ }
598
+ body[`).concat(ue, `] {
599
+ overflow: hidden `).concat(r, `;
600
+ overscroll-behavior: contain;
601
+ `).concat([
602
+ t && "position: relative ".concat(r, ";"),
603
+ n === "margin" && `
604
+ padding-left: `.concat(o, `px;
605
+ padding-top: `).concat(l, `px;
606
+ padding-right: `).concat(s, `px;
607
+ margin-left:0;
608
+ margin-top:0;
609
+ margin-right: `).concat(c, "px ").concat(r, `;
610
+ `),
611
+ n === "padding" && "padding-right: ".concat(c, "px ").concat(r, ";")
612
+ ].filter(Boolean).join(""), `
613
+ }
614
+
615
+ .`).concat(we, ` {
616
+ right: `).concat(c, "px ").concat(r, `;
617
+ }
618
+
619
+ .`).concat(Ce, ` {
620
+ margin-right: `).concat(c, "px ").concat(r, `;
621
+ }
622
+
623
+ .`).concat(we, " .").concat(we, ` {
624
+ right: 0 `).concat(r, `;
625
+ }
626
+
627
+ .`).concat(Ce, " .").concat(Ce, ` {
628
+ margin-right: 0 `).concat(r, `;
629
+ }
630
+
631
+ body[`).concat(ue, `] {
632
+ `).concat(er, ": ").concat(c, `px;
633
+ }
634
+ `);
635
+ }, at = function() {
636
+ var e = parseInt(document.body.getAttribute(ue) || "0", 10);
637
+ return isFinite(e) ? e : 0;
638
+ }, yr = function() {
639
+ a.useEffect(function() {
640
+ return document.body.setAttribute(ue, (at() + 1).toString()), function() {
641
+ var e = at() - 1;
642
+ e <= 0 ? document.body.removeAttribute(ue) : document.body.setAttribute(ue, e.toString());
643
+ };
644
+ }, []);
645
+ }, wr = function(e) {
646
+ var t = e.noRelative, n = e.noImportant, r = e.gapMode, o = r === void 0 ? "margin" : r;
647
+ yr();
648
+ var l = a.useMemo(function() {
649
+ return hr(o);
650
+ }, [o]);
651
+ return a.createElement(gr, { styles: Sr(l, !t, o, n ? "" : "!important") });
652
+ }, He = !1;
653
+ if (typeof window < "u")
654
+ try {
655
+ var Se = Object.defineProperty({}, "passive", {
656
+ get: function() {
657
+ return He = !0, !0;
658
+ }
659
+ });
660
+ window.addEventListener("test", Se, Se), window.removeEventListener("test", Se, Se);
661
+ } catch {
662
+ He = !1;
663
+ }
664
+ var le = He ? { passive: !1 } : !1, Cr = function(e) {
665
+ return e.tagName === "TEXTAREA";
666
+ }, Et = function(e, t) {
667
+ if (!(e instanceof Element))
668
+ return !1;
669
+ var n = window.getComputedStyle(e);
670
+ return (
671
+ // not-not-scrollable
672
+ n[t] !== "hidden" && // contains scroll inside self
673
+ !(n.overflowY === n.overflowX && !Cr(e) && n[t] === "visible")
674
+ );
675
+ }, br = function(e) {
676
+ return Et(e, "overflowY");
677
+ }, Er = function(e) {
678
+ return Et(e, "overflowX");
679
+ }, ct = function(e, t) {
680
+ var n = t.ownerDocument, r = t;
681
+ do {
682
+ typeof ShadowRoot < "u" && r instanceof ShadowRoot && (r = r.host);
683
+ var o = xt(e, r);
684
+ if (o) {
685
+ var l = Rt(e, r), s = l[1], c = l[2];
686
+ if (s > c)
687
+ return !0;
688
+ }
689
+ r = r.parentNode;
690
+ } while (r && r !== n.body);
691
+ return !1;
692
+ }, xr = function(e) {
693
+ var t = e.scrollTop, n = e.scrollHeight, r = e.clientHeight;
694
+ return [
695
+ t,
696
+ n,
697
+ r
698
+ ];
699
+ }, Rr = function(e) {
700
+ var t = e.scrollLeft, n = e.scrollWidth, r = e.clientWidth;
701
+ return [
702
+ t,
703
+ n,
704
+ r
705
+ ];
706
+ }, xt = function(e, t) {
707
+ return e === "v" ? br(t) : Er(t);
708
+ }, Rt = function(e, t) {
709
+ return e === "v" ? xr(t) : Rr(t);
710
+ }, Tr = function(e, t) {
711
+ return e === "h" && t === "rtl" ? -1 : 1;
712
+ }, Ir = function(e, t, n, r, o) {
713
+ var l = Tr(e, window.getComputedStyle(t).direction), s = l * r, c = n.target, u = t.contains(c), d = !1, S = s > 0, h = 0, y = 0;
714
+ do {
715
+ if (!c)
716
+ break;
717
+ var w = Rt(e, c), E = w[0], i = w[1], p = w[2], g = i - p - l * E;
718
+ (E || g) && xt(e, c) && (h += g, y += E);
719
+ var f = c.parentNode;
720
+ c = f && f.nodeType === Node.DOCUMENT_FRAGMENT_NODE ? f.host : f;
721
+ } while (
722
+ // portaled content
723
+ !u && c !== document.body || // self content
724
+ u && (t.contains(c) || t === c)
725
+ );
726
+ return (S && Math.abs(h) < 1 || !S && Math.abs(y) < 1) && (d = !0), d;
727
+ }, ye = function(e) {
728
+ return "changedTouches" in e ? [e.changedTouches[0].clientX, e.changedTouches[0].clientY] : [0, 0];
729
+ }, it = function(e) {
730
+ return [e.deltaX, e.deltaY];
731
+ }, lt = function(e) {
732
+ return e && "current" in e ? e.current : e;
733
+ }, Nr = function(e, t) {
734
+ return e[0] === t[0] && e[1] === t[1];
735
+ }, Pr = function(e) {
736
+ return `
737
+ .block-interactivity-`.concat(e, ` {pointer-events: none;}
738
+ .allow-interactivity-`).concat(e, ` {pointer-events: all;}
739
+ `);
740
+ }, _r = 0, se = [];
741
+ function Ar(e) {
742
+ var t = a.useRef([]), n = a.useRef([0, 0]), r = a.useRef(), o = a.useState(_r++)[0], l = a.useState(bt)[0], s = a.useRef(e);
743
+ a.useEffect(function() {
744
+ s.current = e;
745
+ }, [e]), a.useEffect(function() {
746
+ if (e.inert) {
747
+ document.body.classList.add("block-interactivity-".concat(o));
748
+ var i = Qn([e.lockRef.current], (e.shards || []).map(lt), !0).filter(Boolean);
749
+ return i.forEach(function(p) {
750
+ return p.classList.add("allow-interactivity-".concat(o));
751
+ }), function() {
752
+ document.body.classList.remove("block-interactivity-".concat(o)), i.forEach(function(p) {
753
+ return p.classList.remove("allow-interactivity-".concat(o));
754
+ });
755
+ };
756
+ }
757
+ }, [e.inert, e.lockRef.current, e.shards]);
758
+ var c = a.useCallback(function(i, p) {
759
+ if ("touches" in i && i.touches.length === 2 || i.type === "wheel" && i.ctrlKey)
760
+ return !s.current.allowPinchZoom;
761
+ var g = ye(i), f = n.current, m = "deltaX" in i ? i.deltaX : f[0] - g[0], b = "deltaY" in i ? i.deltaY : f[1] - g[1], x, _ = i.target, R = Math.abs(m) > Math.abs(b) ? "h" : "v";
762
+ if ("touches" in i && R === "h" && _.type === "range")
763
+ return !1;
764
+ var L = window.getSelection(), V = L && L.anchorNode, K = V ? V === _ || V.contains(_) : !1;
765
+ if (K)
766
+ return !1;
767
+ var O = ct(R, _);
768
+ if (!O)
769
+ return !0;
770
+ if (O ? x = R : (x = R === "v" ? "h" : "v", O = ct(R, _)), !O)
771
+ return !1;
772
+ if (!r.current && "changedTouches" in i && (m || b) && (r.current = x), !x)
773
+ return !0;
774
+ var F = r.current || x;
775
+ return Ir(F, p, i, F === "h" ? m : b);
776
+ }, []), u = a.useCallback(function(i) {
777
+ var p = i;
778
+ if (!(!se.length || se[se.length - 1] !== l)) {
779
+ var g = "deltaY" in p ? it(p) : ye(p), f = t.current.filter(function(x) {
780
+ return x.name === p.type && (x.target === p.target || p.target === x.shadowParent) && Nr(x.delta, g);
781
+ })[0];
782
+ if (f && f.should) {
783
+ p.cancelable && p.preventDefault();
784
+ return;
785
+ }
786
+ if (!f) {
787
+ var m = (s.current.shards || []).map(lt).filter(Boolean).filter(function(x) {
788
+ return x.contains(p.target);
789
+ }), b = m.length > 0 ? c(p, m[0]) : !s.current.noIsolation;
790
+ b && p.cancelable && p.preventDefault();
791
+ }
792
+ }
793
+ }, []), d = a.useCallback(function(i, p, g, f) {
794
+ var m = { name: i, delta: p, target: g, should: f, shadowParent: Mr(g) };
795
+ t.current.push(m), setTimeout(function() {
796
+ t.current = t.current.filter(function(b) {
797
+ return b !== m;
798
+ });
799
+ }, 1);
800
+ }, []), S = a.useCallback(function(i) {
801
+ n.current = ye(i), r.current = void 0;
802
+ }, []), h = a.useCallback(function(i) {
803
+ d(i.type, it(i), i.target, c(i, e.lockRef.current));
804
+ }, []), y = a.useCallback(function(i) {
805
+ d(i.type, ye(i), i.target, c(i, e.lockRef.current));
806
+ }, []);
807
+ a.useEffect(function() {
808
+ return se.push(l), e.setCallbacks({
809
+ onScrollCapture: h,
810
+ onWheelCapture: h,
811
+ onTouchMoveCapture: y
812
+ }), document.addEventListener("wheel", u, le), document.addEventListener("touchmove", u, le), document.addEventListener("touchstart", S, le), function() {
813
+ se = se.filter(function(i) {
814
+ return i !== l;
815
+ }), document.removeEventListener("wheel", u, le), document.removeEventListener("touchmove", u, le), document.removeEventListener("touchstart", S, le);
816
+ };
817
+ }, []);
818
+ var w = e.removeScrollBar, E = e.inert;
819
+ return a.createElement(
820
+ a.Fragment,
821
+ null,
822
+ E ? a.createElement(l, { styles: Pr(o) }) : null,
823
+ w ? a.createElement(wr, { noRelative: e.noRelative, gapMode: e.gapMode }) : null
824
+ );
825
+ }
826
+ function Mr(e) {
827
+ for (var t = null; e !== null; )
828
+ e instanceof ShadowRoot && (t = e.host, e = e.host), e = e.parentNode;
829
+ return t;
830
+ }
831
+ const Or = ir(Ct, Ar);
832
+ var Tt = a.forwardRef(function(e, t) {
833
+ return a.createElement(Ee, U({}, e, { ref: t, sideCar: Or }));
834
+ });
835
+ Tt.classNames = Ee.classNames;
836
+ var kr = [" ", "Enter", "ArrowUp", "ArrowDown"], Lr = [" ", "Enter"], oe = "Select", [xe, Re, Dr] = _n(oe), [de] = dt(oe, [
837
+ Dr,
838
+ ft
839
+ ]), Te = ft(), [Br, Q] = de(oe), [Vr, Fr] = de(oe), It = (e) => {
840
+ const {
841
+ __scopeSelect: t,
842
+ children: n,
843
+ open: r,
844
+ defaultOpen: o,
845
+ onOpenChange: l,
846
+ value: s,
847
+ defaultValue: c,
848
+ onValueChange: u,
849
+ dir: d,
850
+ name: S,
851
+ autoComplete: h,
852
+ disabled: y,
853
+ required: w,
854
+ form: E
855
+ } = e, i = Te(t), [p, g] = a.useState(null), [f, m] = a.useState(null), [b, x] = a.useState(!1), _ = On(d), [R, L] = Ze({
856
+ prop: r,
857
+ defaultProp: o ?? !1,
858
+ onChange: l,
859
+ caller: oe
860
+ }), [V, K] = Ze({
861
+ prop: s,
862
+ defaultProp: c,
863
+ onChange: u,
864
+ caller: oe
865
+ }), O = a.useRef(null), F = p ? E || !!p.closest("form") : !0, [Y, j] = a.useState(/* @__PURE__ */ new Set()), $ = Array.from(Y).map((k) => k.props.value).join(";");
866
+ return /* @__PURE__ */ v(gn, { ...i, children: /* @__PURE__ */ re(
867
+ Br,
868
+ {
869
+ required: w,
870
+ scope: t,
871
+ trigger: p,
872
+ onTriggerChange: g,
873
+ valueNode: f,
874
+ onValueNodeChange: m,
875
+ valueNodeHasChildren: b,
876
+ onValueNodeHasChildrenChange: x,
877
+ contentId: Ye(),
878
+ value: V,
879
+ onValueChange: K,
880
+ open: R,
881
+ onOpenChange: L,
882
+ dir: _,
883
+ triggerPointerDownPosRef: O,
884
+ disabled: y,
885
+ children: [
886
+ /* @__PURE__ */ v(xe.Provider, { scope: t, children: /* @__PURE__ */ v(
887
+ Vr,
888
+ {
889
+ scope: e.__scopeSelect,
890
+ onNativeOptionAdd: a.useCallback((k) => {
891
+ j((H) => new Set(H).add(k));
892
+ }, []),
893
+ onNativeOptionRemove: a.useCallback((k) => {
894
+ j((H) => {
895
+ const z = new Set(H);
896
+ return z.delete(k), z;
897
+ });
898
+ }, []),
899
+ children: n
900
+ }
901
+ ) }),
902
+ F ? /* @__PURE__ */ re(
903
+ Qt,
904
+ {
905
+ "aria-hidden": !0,
906
+ required: w,
907
+ tabIndex: -1,
908
+ name: S,
909
+ autoComplete: h,
910
+ value: V,
911
+ onChange: (k) => K(k.target.value),
912
+ disabled: y,
913
+ form: E,
914
+ children: [
915
+ V === void 0 ? /* @__PURE__ */ v("option", { value: "" }) : null,
916
+ Array.from(Y)
917
+ ]
918
+ },
919
+ $
920
+ ) : null
921
+ ]
922
+ }
923
+ ) });
924
+ };
925
+ It.displayName = oe;
926
+ var Nt = "SelectTrigger", Pt = a.forwardRef(
927
+ (e, t) => {
928
+ const { __scopeSelect: n, disabled: r = !1, ...o } = e, l = Te(n), s = Q(Nt, n), c = s.disabled || r, u = B(t, s.onTriggerChange), d = Re(n), S = a.useRef("touch"), [h, y, w] = en((i) => {
929
+ const p = d().filter((m) => !m.disabled), g = p.find((m) => m.value === s.value), f = tn(p, i, g);
930
+ f !== void 0 && s.onValueChange(f.value);
931
+ }), E = (i) => {
932
+ c || (s.onOpenChange(!0), w()), i && (s.triggerPointerDownPosRef.current = {
933
+ x: Math.round(i.pageX),
934
+ y: Math.round(i.pageY)
935
+ });
936
+ };
937
+ return /* @__PURE__ */ v(mn, { asChild: !0, ...l, children: /* @__PURE__ */ v(
938
+ M.button,
939
+ {
940
+ type: "button",
941
+ role: "combobox",
942
+ "aria-controls": s.contentId,
943
+ "aria-expanded": s.open,
944
+ "aria-required": s.required,
945
+ "aria-autocomplete": "none",
946
+ dir: s.dir,
947
+ "data-state": s.open ? "open" : "closed",
948
+ disabled: c,
949
+ "data-disabled": c ? "" : void 0,
950
+ "data-placeholder": Jt(s.value) ? "" : void 0,
951
+ ...o,
952
+ ref: u,
953
+ onClick: A(o.onClick, (i) => {
954
+ i.currentTarget.focus(), S.current !== "mouse" && E(i);
955
+ }),
956
+ onPointerDown: A(o.onPointerDown, (i) => {
957
+ S.current = i.pointerType;
958
+ const p = i.target;
959
+ p.hasPointerCapture(i.pointerId) && p.releasePointerCapture(i.pointerId), i.button === 0 && i.ctrlKey === !1 && i.pointerType === "mouse" && (E(i), i.preventDefault());
960
+ }),
961
+ onKeyDown: A(o.onKeyDown, (i) => {
962
+ const p = h.current !== "";
963
+ !(i.ctrlKey || i.altKey || i.metaKey) && i.key.length === 1 && y(i.key), !(p && i.key === " ") && kr.includes(i.key) && (E(), i.preventDefault());
964
+ })
965
+ }
966
+ ) });
967
+ }
968
+ );
969
+ Pt.displayName = Nt;
970
+ var _t = "SelectValue", At = a.forwardRef(
971
+ (e, t) => {
972
+ const { __scopeSelect: n, className: r, style: o, children: l, placeholder: s = "", ...c } = e, u = Q(_t, n), { onValueNodeHasChildrenChange: d } = u, S = l !== void 0, h = B(t, u.onValueNodeChange);
973
+ return G(() => {
974
+ d(S);
975
+ }, [d, S]), /* @__PURE__ */ v(
976
+ M.span,
977
+ {
978
+ ...c,
979
+ ref: h,
980
+ style: { pointerEvents: "none" },
981
+ children: Jt(u.value) ? /* @__PURE__ */ v(Ge, { children: s }) : l
982
+ }
983
+ );
984
+ }
985
+ );
986
+ At.displayName = _t;
987
+ var Wr = "SelectIcon", Mt = a.forwardRef(
988
+ (e, t) => {
989
+ const { __scopeSelect: n, children: r, ...o } = e;
990
+ return /* @__PURE__ */ v(M.span, { "aria-hidden": !0, ...o, ref: t, children: r || "▼" });
991
+ }
992
+ );
993
+ Mt.displayName = Wr;
994
+ var Hr = "SelectPortal", Ot = (e) => /* @__PURE__ */ v(vt, { asChild: !0, ...e });
995
+ Ot.displayName = Hr;
996
+ var ae = "SelectContent", kt = a.forwardRef(
997
+ (e, t) => {
998
+ const n = Q(ae, e.__scopeSelect), [r, o] = a.useState();
999
+ if (G(() => {
1000
+ o(new DocumentFragment());
1001
+ }, []), !n.open) {
1002
+ const l = r;
1003
+ return l ? st.createPortal(
1004
+ /* @__PURE__ */ v(Lt, { scope: e.__scopeSelect, children: /* @__PURE__ */ v(xe.Slot, { scope: e.__scopeSelect, children: /* @__PURE__ */ v("div", { children: e.children }) }) }),
1005
+ l
1006
+ ) : null;
1007
+ }
1008
+ return /* @__PURE__ */ v(Dt, { ...e, ref: t });
1009
+ }
1010
+ );
1011
+ kt.displayName = ae;
1012
+ var W = 10, [Lt, J] = de(ae), Ur = "SelectContentImpl", Kr = /* @__PURE__ */ Un("SelectContent.RemoveScroll"), Dt = a.forwardRef(
1013
+ (e, t) => {
1014
+ const {
1015
+ __scopeSelect: n,
1016
+ position: r = "item-aligned",
1017
+ onCloseAutoFocus: o,
1018
+ onEscapeKeyDown: l,
1019
+ onPointerDownOutside: s,
1020
+ //
1021
+ // PopperContent props
1022
+ side: c,
1023
+ sideOffset: u,
1024
+ align: d,
1025
+ alignOffset: S,
1026
+ arrowPadding: h,
1027
+ collisionBoundary: y,
1028
+ collisionPadding: w,
1029
+ sticky: E,
1030
+ hideWhenDetached: i,
1031
+ avoidCollisions: p,
1032
+ //
1033
+ ...g
1034
+ } = e, f = Q(ae, n), [m, b] = a.useState(null), [x, _] = a.useState(null), R = B(t, (C) => b(C)), [L, V] = a.useState(null), [K, O] = a.useState(
1035
+ null
1036
+ ), F = Re(n), [Y, j] = a.useState(!1), $ = a.useRef(!1);
1037
+ a.useEffect(() => {
1038
+ if (m) return qn(m);
1039
+ }, [m]), kn();
1040
+ const k = a.useCallback(
1041
+ (C) => {
1042
+ const [P, ...D] = F().map((I) => I.ref.current), [N] = D.slice(-1), T = document.activeElement;
1043
+ for (const I of C)
1044
+ if (I === T || (I == null || I.scrollIntoView({ block: "nearest" }), I === P && x && (x.scrollTop = 0), I === N && x && (x.scrollTop = x.scrollHeight), I == null || I.focus(), document.activeElement !== T)) return;
1045
+ },
1046
+ [F, x]
1047
+ ), H = a.useCallback(
1048
+ () => k([L, m]),
1049
+ [k, L, m]
1050
+ );
1051
+ a.useEffect(() => {
1052
+ Y && H();
1053
+ }, [Y, H]);
1054
+ const { onOpenChange: z, triggerPointerDownPosRef: X } = f;
1055
+ a.useEffect(() => {
1056
+ if (m) {
1057
+ let C = { x: 0, y: 0 };
1058
+ const P = (N) => {
1059
+ var T, I;
1060
+ C = {
1061
+ x: Math.abs(Math.round(N.pageX) - (((T = X.current) == null ? void 0 : T.x) ?? 0)),
1062
+ y: Math.abs(Math.round(N.pageY) - (((I = X.current) == null ? void 0 : I.y) ?? 0))
1063
+ };
1064
+ }, D = (N) => {
1065
+ C.x <= 10 && C.y <= 10 ? N.preventDefault() : m.contains(N.target) || z(!1), document.removeEventListener("pointermove", P), X.current = null;
1066
+ };
1067
+ return X.current !== null && (document.addEventListener("pointermove", P), document.addEventListener("pointerup", D, { capture: !0, once: !0 })), () => {
1068
+ document.removeEventListener("pointermove", P), document.removeEventListener("pointerup", D, { capture: !0 });
1069
+ };
1070
+ }
1071
+ }, [m, z, X]), a.useEffect(() => {
1072
+ const C = () => z(!1);
1073
+ return window.addEventListener("blur", C), window.addEventListener("resize", C), () => {
1074
+ window.removeEventListener("blur", C), window.removeEventListener("resize", C);
1075
+ };
1076
+ }, [z]);
1077
+ const [Ie, me] = en((C) => {
1078
+ const P = F().filter((T) => !T.disabled), D = P.find((T) => T.ref.current === document.activeElement), N = tn(P, C, D);
1079
+ N && setTimeout(() => N.ref.current.focus());
1080
+ }), Ne = a.useCallback(
1081
+ (C, P, D) => {
1082
+ const N = !$.current && !D;
1083
+ (f.value !== void 0 && f.value === P || N) && (V(C), N && ($.current = !0));
1084
+ },
1085
+ [f.value]
1086
+ ), Pe = a.useCallback(() => m == null ? void 0 : m.focus(), [m]), ce = a.useCallback(
1087
+ (C, P, D) => {
1088
+ const N = !$.current && !D;
1089
+ (f.value !== void 0 && f.value === P || N) && O(C);
1090
+ },
1091
+ [f.value]
1092
+ ), ve = r === "popper" ? Ue : Bt, fe = ve === Ue ? {
1093
+ side: c,
1094
+ sideOffset: u,
1095
+ align: d,
1096
+ alignOffset: S,
1097
+ arrowPadding: h,
1098
+ collisionBoundary: y,
1099
+ collisionPadding: w,
1100
+ sticky: E,
1101
+ hideWhenDetached: i,
1102
+ avoidCollisions: p
1103
+ } : {};
1104
+ return /* @__PURE__ */ v(
1105
+ Lt,
1106
+ {
1107
+ scope: n,
1108
+ content: m,
1109
+ viewport: x,
1110
+ onViewportChange: _,
1111
+ itemRefCallback: Ne,
1112
+ selectedItem: L,
1113
+ onItemLeave: Pe,
1114
+ itemTextRefCallback: ce,
1115
+ focusSelectedItem: H,
1116
+ selectedItemText: K,
1117
+ position: r,
1118
+ isPositioned: Y,
1119
+ searchRef: Ie,
1120
+ children: /* @__PURE__ */ v(Tt, { as: Kr, allowPinchZoom: !0, children: /* @__PURE__ */ v(
1121
+ ht,
1122
+ {
1123
+ asChild: !0,
1124
+ trapped: f.open,
1125
+ onMountAutoFocus: (C) => {
1126
+ C.preventDefault();
1127
+ },
1128
+ onUnmountAutoFocus: A(o, (C) => {
1129
+ var P;
1130
+ (P = f.trigger) == null || P.focus({ preventScroll: !0 }), C.preventDefault();
1131
+ }),
1132
+ children: /* @__PURE__ */ v(
1133
+ vn,
1134
+ {
1135
+ asChild: !0,
1136
+ disableOutsidePointerEvents: !0,
1137
+ onEscapeKeyDown: l,
1138
+ onPointerDownOutside: s,
1139
+ onFocusOutside: (C) => C.preventDefault(),
1140
+ onDismiss: () => f.onOpenChange(!1),
1141
+ children: /* @__PURE__ */ v(
1142
+ ve,
1143
+ {
1144
+ role: "listbox",
1145
+ id: f.contentId,
1146
+ "data-state": f.open ? "open" : "closed",
1147
+ dir: f.dir,
1148
+ onContextMenu: (C) => C.preventDefault(),
1149
+ ...g,
1150
+ ...fe,
1151
+ onPlaced: () => j(!0),
1152
+ ref: R,
1153
+ style: {
1154
+ // flex layout so we can place the scroll buttons properly
1155
+ display: "flex",
1156
+ flexDirection: "column",
1157
+ // reset the outline by default as the content MAY get focused
1158
+ outline: "none",
1159
+ ...g.style
1160
+ },
1161
+ onKeyDown: A(g.onKeyDown, (C) => {
1162
+ const P = C.ctrlKey || C.altKey || C.metaKey;
1163
+ if (C.key === "Tab" && C.preventDefault(), !P && C.key.length === 1 && me(C.key), ["ArrowUp", "ArrowDown", "Home", "End"].includes(C.key)) {
1164
+ let N = F().filter((T) => !T.disabled).map((T) => T.ref.current);
1165
+ if (["ArrowUp", "End"].includes(C.key) && (N = N.slice().reverse()), ["ArrowUp", "ArrowDown"].includes(C.key)) {
1166
+ const T = C.target, I = N.indexOf(T);
1167
+ N = N.slice(I + 1);
1168
+ }
1169
+ setTimeout(() => k(N)), C.preventDefault();
1170
+ }
1171
+ })
1172
+ }
1173
+ )
1174
+ }
1175
+ )
1176
+ }
1177
+ ) })
1178
+ }
1179
+ );
1180
+ }
1181
+ );
1182
+ Dt.displayName = Ur;
1183
+ var jr = "SelectItemAlignedPosition", Bt = a.forwardRef((e, t) => {
1184
+ const { __scopeSelect: n, onPlaced: r, ...o } = e, l = Q(ae, n), s = J(ae, n), [c, u] = a.useState(null), [d, S] = a.useState(null), h = B(t, (R) => S(R)), y = Re(n), w = a.useRef(!1), E = a.useRef(!0), { viewport: i, selectedItem: p, selectedItemText: g, focusSelectedItem: f } = s, m = a.useCallback(() => {
1185
+ if (l.trigger && l.valueNode && c && d && i && p && g) {
1186
+ const R = l.trigger.getBoundingClientRect(), L = d.getBoundingClientRect(), V = l.valueNode.getBoundingClientRect(), K = g.getBoundingClientRect();
1187
+ if (l.dir !== "rtl") {
1188
+ const T = K.left - L.left, I = V.left - T, ee = R.left - I, te = R.width + ee, _e = Math.max(te, L.width), Ae = window.innerWidth - W, Me = Qe(I, [
1189
+ W,
1190
+ // Prevents the content from going off the starting edge of the
1191
+ // viewport. It may still go off the ending edge, but this can be
1192
+ // controlled by the user since they may want to manage overflow in a
1193
+ // specific way.
1194
+ // https://github.com/radix-ui/primitives/issues/2049
1195
+ Math.max(W, Ae - _e)
1196
+ ]);
1197
+ c.style.minWidth = te + "px", c.style.left = Me + "px";
1198
+ } else {
1199
+ const T = L.right - K.right, I = window.innerWidth - V.right - T, ee = window.innerWidth - R.right - I, te = R.width + ee, _e = Math.max(te, L.width), Ae = window.innerWidth - W, Me = Qe(I, [
1200
+ W,
1201
+ Math.max(W, Ae - _e)
1202
+ ]);
1203
+ c.style.minWidth = te + "px", c.style.right = Me + "px";
1204
+ }
1205
+ const O = y(), F = window.innerHeight - W * 2, Y = i.scrollHeight, j = window.getComputedStyle(d), $ = parseInt(j.borderTopWidth, 10), k = parseInt(j.paddingTop, 10), H = parseInt(j.borderBottomWidth, 10), z = parseInt(j.paddingBottom, 10), X = $ + k + Y + z + H, Ie = Math.min(p.offsetHeight * 5, X), me = window.getComputedStyle(i), Ne = parseInt(me.paddingTop, 10), Pe = parseInt(me.paddingBottom, 10), ce = R.top + R.height / 2 - W, ve = F - ce, fe = p.offsetHeight / 2, C = p.offsetTop + fe, P = $ + k + C, D = X - P;
1206
+ if (P <= ce) {
1207
+ const T = O.length > 0 && p === O[O.length - 1].ref.current;
1208
+ c.style.bottom = "0px";
1209
+ const I = d.clientHeight - i.offsetTop - i.offsetHeight, ee = Math.max(
1210
+ ve,
1211
+ fe + // viewport might have padding bottom, include it to avoid a scrollable viewport
1212
+ (T ? Pe : 0) + I + H
1213
+ ), te = P + ee;
1214
+ c.style.height = te + "px";
1215
+ } else {
1216
+ const T = O.length > 0 && p === O[0].ref.current;
1217
+ c.style.top = "0px";
1218
+ const ee = Math.max(
1219
+ ce,
1220
+ $ + i.offsetTop + // viewport might have padding top, include it to avoid a scrollable viewport
1221
+ (T ? Ne : 0) + fe
1222
+ ) + D;
1223
+ c.style.height = ee + "px", i.scrollTop = P - ce + i.offsetTop;
1224
+ }
1225
+ c.style.margin = `${W}px 0`, c.style.minHeight = Ie + "px", c.style.maxHeight = F + "px", r == null || r(), requestAnimationFrame(() => w.current = !0);
1226
+ }
1227
+ }, [
1228
+ y,
1229
+ l.trigger,
1230
+ l.valueNode,
1231
+ c,
1232
+ d,
1233
+ i,
1234
+ p,
1235
+ g,
1236
+ l.dir,
1237
+ r
1238
+ ]);
1239
+ G(() => m(), [m]);
1240
+ const [b, x] = a.useState();
1241
+ G(() => {
1242
+ d && x(window.getComputedStyle(d).zIndex);
1243
+ }, [d]);
1244
+ const _ = a.useCallback(
1245
+ (R) => {
1246
+ R && E.current === !0 && (m(), f == null || f(), E.current = !1);
1247
+ },
1248
+ [m, f]
1249
+ );
1250
+ return /* @__PURE__ */ v(
1251
+ zr,
1252
+ {
1253
+ scope: n,
1254
+ contentWrapper: c,
1255
+ shouldExpandOnScrollRef: w,
1256
+ onScrollButtonChange: _,
1257
+ children: /* @__PURE__ */ v(
1258
+ "div",
1259
+ {
1260
+ ref: u,
1261
+ style: {
1262
+ display: "flex",
1263
+ flexDirection: "column",
1264
+ position: "fixed",
1265
+ zIndex: b
1266
+ },
1267
+ children: /* @__PURE__ */ v(
1268
+ M.div,
1269
+ {
1270
+ ...o,
1271
+ ref: h,
1272
+ style: {
1273
+ // When we get the height of the content, it includes borders. If we were to set
1274
+ // the height without having `boxSizing: 'border-box'` it would be too big.
1275
+ boxSizing: "border-box",
1276
+ // We need to ensure the content doesn't get taller than the wrapper
1277
+ maxHeight: "100%",
1278
+ ...o.style
1279
+ }
1280
+ }
1281
+ )
1282
+ }
1283
+ )
1284
+ }
1285
+ );
1286
+ });
1287
+ Bt.displayName = jr;
1288
+ var $r = "SelectPopperPosition", Ue = a.forwardRef((e, t) => {
1289
+ const {
1290
+ __scopeSelect: n,
1291
+ align: r = "start",
1292
+ collisionPadding: o = W,
1293
+ ...l
1294
+ } = e, s = Te(n);
1295
+ return /* @__PURE__ */ v(
1296
+ hn,
1297
+ {
1298
+ ...s,
1299
+ ...l,
1300
+ ref: t,
1301
+ align: r,
1302
+ collisionPadding: o,
1303
+ style: {
1304
+ // Ensure border-box for floating-ui calculations
1305
+ boxSizing: "border-box",
1306
+ ...l.style,
1307
+ "--radix-select-content-transform-origin": "var(--radix-popper-transform-origin)",
1308
+ "--radix-select-content-available-width": "var(--radix-popper-available-width)",
1309
+ "--radix-select-content-available-height": "var(--radix-popper-available-height)",
1310
+ "--radix-select-trigger-width": "var(--radix-popper-anchor-width)",
1311
+ "--radix-select-trigger-height": "var(--radix-popper-anchor-height)"
1312
+ }
1313
+ }
1314
+ );
1315
+ });
1316
+ Ue.displayName = $r;
1317
+ var [zr, Xe] = de(ae, {}), Ke = "SelectViewport", Vt = a.forwardRef(
1318
+ (e, t) => {
1319
+ const { __scopeSelect: n, nonce: r, ...o } = e, l = J(Ke, n), s = Xe(Ke, n), c = B(t, l.onViewportChange), u = a.useRef(0);
1320
+ return /* @__PURE__ */ re(Ge, { children: [
1321
+ /* @__PURE__ */ v(
1322
+ "style",
1323
+ {
1324
+ dangerouslySetInnerHTML: {
1325
+ __html: "[data-radix-select-viewport]{scrollbar-width:none;-ms-overflow-style:none;-webkit-overflow-scrolling:touch;}[data-radix-select-viewport]::-webkit-scrollbar{display:none}"
1326
+ },
1327
+ nonce: r
1328
+ }
1329
+ ),
1330
+ /* @__PURE__ */ v(xe.Slot, { scope: n, children: /* @__PURE__ */ v(
1331
+ M.div,
1332
+ {
1333
+ "data-radix-select-viewport": "",
1334
+ role: "presentation",
1335
+ ...o,
1336
+ ref: c,
1337
+ style: {
1338
+ // we use position: 'relative' here on the `viewport` so that when we call
1339
+ // `selectedItem.offsetTop` in calculations, the offset is relative to the viewport
1340
+ // (independent of the scrollUpButton).
1341
+ position: "relative",
1342
+ flex: 1,
1343
+ // Viewport should only be scrollable in the vertical direction.
1344
+ // This won't work in vertical writing modes, so we'll need to
1345
+ // revisit this if/when that is supported
1346
+ // https://developer.chrome.com/blog/vertical-form-controls
1347
+ overflow: "hidden auto",
1348
+ ...o.style
1349
+ },
1350
+ onScroll: A(o.onScroll, (d) => {
1351
+ const S = d.currentTarget, { contentWrapper: h, shouldExpandOnScrollRef: y } = s;
1352
+ if (y != null && y.current && h) {
1353
+ const w = Math.abs(u.current - S.scrollTop);
1354
+ if (w > 0) {
1355
+ const E = window.innerHeight - W * 2, i = parseFloat(h.style.minHeight), p = parseFloat(h.style.height), g = Math.max(i, p);
1356
+ if (g < E) {
1357
+ const f = g + w, m = Math.min(E, f), b = f - m;
1358
+ h.style.height = m + "px", h.style.bottom === "0px" && (S.scrollTop = b > 0 ? b : 0, h.style.justifyContent = "flex-end");
1359
+ }
1360
+ }
1361
+ }
1362
+ u.current = S.scrollTop;
1363
+ })
1364
+ }
1365
+ ) })
1366
+ ] });
1367
+ }
1368
+ );
1369
+ Vt.displayName = Ke;
1370
+ var Ft = "SelectGroup", [Gr, Yr] = de(Ft), Wt = a.forwardRef(
1371
+ (e, t) => {
1372
+ const { __scopeSelect: n, ...r } = e, o = Ye();
1373
+ return /* @__PURE__ */ v(Gr, { scope: n, id: o, children: /* @__PURE__ */ v(M.div, { role: "group", "aria-labelledby": o, ...r, ref: t }) });
1374
+ }
1375
+ );
1376
+ Wt.displayName = Ft;
1377
+ var Ht = "SelectLabel", Ut = a.forwardRef(
1378
+ (e, t) => {
1379
+ const { __scopeSelect: n, ...r } = e, o = Yr(Ht, n);
1380
+ return /* @__PURE__ */ v(M.div, { id: o.id, ...r, ref: t });
1381
+ }
1382
+ );
1383
+ Ut.displayName = Ht;
1384
+ var be = "SelectItem", [Xr, Kt] = de(be), jt = a.forwardRef(
1385
+ (e, t) => {
1386
+ const {
1387
+ __scopeSelect: n,
1388
+ value: r,
1389
+ disabled: o = !1,
1390
+ textValue: l,
1391
+ ...s
1392
+ } = e, c = Q(be, n), u = J(be, n), d = c.value === r, [S, h] = a.useState(l ?? ""), [y, w] = a.useState(!1), E = B(
1393
+ t,
1394
+ (f) => {
1395
+ var m;
1396
+ return (m = u.itemRefCallback) == null ? void 0 : m.call(u, f, r, o);
1397
+ }
1398
+ ), i = Ye(), p = a.useRef("touch"), g = () => {
1399
+ o || (c.onValueChange(r), c.onOpenChange(!1));
1400
+ };
1401
+ if (r === "")
1402
+ throw new Error(
1403
+ "A <Select.Item /> must have a value prop that is not an empty string. This is because the Select value can be set to an empty string to clear the selection and show the placeholder."
1404
+ );
1405
+ return /* @__PURE__ */ v(
1406
+ Xr,
1407
+ {
1408
+ scope: n,
1409
+ value: r,
1410
+ disabled: o,
1411
+ textId: i,
1412
+ isSelected: d,
1413
+ onItemTextChange: a.useCallback((f) => {
1414
+ h((m) => m || ((f == null ? void 0 : f.textContent) ?? "").trim());
1415
+ }, []),
1416
+ children: /* @__PURE__ */ v(
1417
+ xe.ItemSlot,
1418
+ {
1419
+ scope: n,
1420
+ value: r,
1421
+ disabled: o,
1422
+ textValue: S,
1423
+ children: /* @__PURE__ */ v(
1424
+ M.div,
1425
+ {
1426
+ role: "option",
1427
+ "aria-labelledby": i,
1428
+ "data-highlighted": y ? "" : void 0,
1429
+ "aria-selected": d && y,
1430
+ "data-state": d ? "checked" : "unchecked",
1431
+ "aria-disabled": o || void 0,
1432
+ "data-disabled": o ? "" : void 0,
1433
+ tabIndex: o ? void 0 : -1,
1434
+ ...s,
1435
+ ref: E,
1436
+ onFocus: A(s.onFocus, () => w(!0)),
1437
+ onBlur: A(s.onBlur, () => w(!1)),
1438
+ onClick: A(s.onClick, () => {
1439
+ p.current !== "mouse" && g();
1440
+ }),
1441
+ onPointerUp: A(s.onPointerUp, () => {
1442
+ p.current === "mouse" && g();
1443
+ }),
1444
+ onPointerDown: A(s.onPointerDown, (f) => {
1445
+ p.current = f.pointerType;
1446
+ }),
1447
+ onPointerMove: A(s.onPointerMove, (f) => {
1448
+ var m;
1449
+ p.current = f.pointerType, o ? (m = u.onItemLeave) == null || m.call(u) : p.current === "mouse" && f.currentTarget.focus({ preventScroll: !0 });
1450
+ }),
1451
+ onPointerLeave: A(s.onPointerLeave, (f) => {
1452
+ var m;
1453
+ f.currentTarget === document.activeElement && ((m = u.onItemLeave) == null || m.call(u));
1454
+ }),
1455
+ onKeyDown: A(s.onKeyDown, (f) => {
1456
+ var b;
1457
+ ((b = u.searchRef) == null ? void 0 : b.current) !== "" && f.key === " " || (Lr.includes(f.key) && g(), f.key === " " && f.preventDefault());
1458
+ })
1459
+ }
1460
+ )
1461
+ }
1462
+ )
1463
+ }
1464
+ );
1465
+ }
1466
+ );
1467
+ jt.displayName = be;
1468
+ var pe = "SelectItemText", $t = a.forwardRef(
1469
+ (e, t) => {
1470
+ const { __scopeSelect: n, className: r, style: o, ...l } = e, s = Q(pe, n), c = J(pe, n), u = Kt(pe, n), d = Fr(pe, n), [S, h] = a.useState(null), y = B(
1471
+ t,
1472
+ (g) => h(g),
1473
+ u.onItemTextChange,
1474
+ (g) => {
1475
+ var f;
1476
+ return (f = c.itemTextRefCallback) == null ? void 0 : f.call(c, g, u.value, u.disabled);
1477
+ }
1478
+ ), w = S == null ? void 0 : S.textContent, E = a.useMemo(
1479
+ () => /* @__PURE__ */ v("option", { value: u.value, disabled: u.disabled, children: w }, u.value),
1480
+ [u.disabled, u.value, w]
1481
+ ), { onNativeOptionAdd: i, onNativeOptionRemove: p } = d;
1482
+ return G(() => (i(E), () => p(E)), [i, p, E]), /* @__PURE__ */ re(Ge, { children: [
1483
+ /* @__PURE__ */ v(M.span, { id: u.textId, ...l, ref: y }),
1484
+ u.isSelected && s.valueNode && !s.valueNodeHasChildren ? st.createPortal(l.children, s.valueNode) : null
1485
+ ] });
1486
+ }
1487
+ );
1488
+ $t.displayName = pe;
1489
+ var zt = "SelectItemIndicator", Gt = a.forwardRef(
1490
+ (e, t) => {
1491
+ const { __scopeSelect: n, ...r } = e;
1492
+ return Kt(zt, n).isSelected ? /* @__PURE__ */ v(M.span, { "aria-hidden": !0, ...r, ref: t }) : null;
1493
+ }
1494
+ );
1495
+ Gt.displayName = zt;
1496
+ var je = "SelectScrollUpButton", Yt = a.forwardRef((e, t) => {
1497
+ const n = J(je, e.__scopeSelect), r = Xe(je, e.__scopeSelect), [o, l] = a.useState(!1), s = B(t, r.onScrollButtonChange);
1498
+ return G(() => {
1499
+ if (n.viewport && n.isPositioned) {
1500
+ let c = function() {
1501
+ const d = u.scrollTop > 0;
1502
+ l(d);
1503
+ };
1504
+ const u = n.viewport;
1505
+ return c(), u.addEventListener("scroll", c), () => u.removeEventListener("scroll", c);
1506
+ }
1507
+ }, [n.viewport, n.isPositioned]), o ? /* @__PURE__ */ v(
1508
+ Zt,
1509
+ {
1510
+ ...e,
1511
+ ref: s,
1512
+ onAutoScroll: () => {
1513
+ const { viewport: c, selectedItem: u } = n;
1514
+ c && u && (c.scrollTop = c.scrollTop - u.offsetHeight);
1515
+ }
1516
+ }
1517
+ ) : null;
1518
+ });
1519
+ Yt.displayName = je;
1520
+ var $e = "SelectScrollDownButton", Xt = a.forwardRef((e, t) => {
1521
+ const n = J($e, e.__scopeSelect), r = Xe($e, e.__scopeSelect), [o, l] = a.useState(!1), s = B(t, r.onScrollButtonChange);
1522
+ return G(() => {
1523
+ if (n.viewport && n.isPositioned) {
1524
+ let c = function() {
1525
+ const d = u.scrollHeight - u.clientHeight, S = Math.ceil(u.scrollTop) < d;
1526
+ l(S);
1527
+ };
1528
+ const u = n.viewport;
1529
+ return c(), u.addEventListener("scroll", c), () => u.removeEventListener("scroll", c);
1530
+ }
1531
+ }, [n.viewport, n.isPositioned]), o ? /* @__PURE__ */ v(
1532
+ Zt,
1533
+ {
1534
+ ...e,
1535
+ ref: s,
1536
+ onAutoScroll: () => {
1537
+ const { viewport: c, selectedItem: u } = n;
1538
+ c && u && (c.scrollTop = c.scrollTop + u.offsetHeight);
1539
+ }
1540
+ }
1541
+ ) : null;
1542
+ });
1543
+ Xt.displayName = $e;
1544
+ var Zt = a.forwardRef((e, t) => {
1545
+ const { __scopeSelect: n, onAutoScroll: r, ...o } = e, l = J("SelectScrollButton", n), s = a.useRef(null), c = Re(n), u = a.useCallback(() => {
1546
+ s.current !== null && (window.clearInterval(s.current), s.current = null);
1547
+ }, []);
1548
+ return a.useEffect(() => () => u(), [u]), G(() => {
1549
+ var S;
1550
+ const d = c().find((h) => h.ref.current === document.activeElement);
1551
+ (S = d == null ? void 0 : d.ref.current) == null || S.scrollIntoView({ block: "nearest" });
1552
+ }, [c]), /* @__PURE__ */ v(
1553
+ M.div,
1554
+ {
1555
+ "aria-hidden": !0,
1556
+ ...o,
1557
+ ref: t,
1558
+ style: { flexShrink: 0, ...o.style },
1559
+ onPointerDown: A(o.onPointerDown, () => {
1560
+ s.current === null && (s.current = window.setInterval(r, 50));
1561
+ }),
1562
+ onPointerMove: A(o.onPointerMove, () => {
1563
+ var d;
1564
+ (d = l.onItemLeave) == null || d.call(l), s.current === null && (s.current = window.setInterval(r, 50));
1565
+ }),
1566
+ onPointerLeave: A(o.onPointerLeave, () => {
1567
+ u();
1568
+ })
1569
+ }
1570
+ );
1571
+ }), Zr = "SelectSeparator", qt = a.forwardRef(
1572
+ (e, t) => {
1573
+ const { __scopeSelect: n, ...r } = e;
1574
+ return /* @__PURE__ */ v(M.div, { "aria-hidden": !0, ...r, ref: t });
1575
+ }
1576
+ );
1577
+ qt.displayName = Zr;
1578
+ var ze = "SelectArrow", qr = a.forwardRef(
1579
+ (e, t) => {
1580
+ const { __scopeSelect: n, ...r } = e, o = Te(n), l = Q(ze, n), s = J(ze, n);
1581
+ return l.open && s.position === "popper" ? /* @__PURE__ */ v(yn, { ...o, ...r, ref: t }) : null;
1582
+ }
1583
+ );
1584
+ qr.displayName = ze;
1585
+ var Qr = "SelectBubbleInput", Qt = a.forwardRef(
1586
+ ({ __scopeSelect: e, value: t, ...n }, r) => {
1587
+ const o = a.useRef(null), l = B(r, o), s = wn(t);
1588
+ return a.useEffect(() => {
1589
+ const c = o.current;
1590
+ if (!c) return;
1591
+ const u = window.HTMLSelectElement.prototype, S = Object.getOwnPropertyDescriptor(
1592
+ u,
1593
+ "value"
1594
+ ).set;
1595
+ if (s !== t && S) {
1596
+ const h = new Event("change", { bubbles: !0 });
1597
+ S.call(c, t), c.dispatchEvent(h);
1598
+ }
1599
+ }, [s, t]), /* @__PURE__ */ v(
1600
+ M.select,
1601
+ {
1602
+ ...n,
1603
+ style: { ...Sn, ...n.style },
1604
+ ref: l,
1605
+ defaultValue: t
1606
+ }
1607
+ );
1608
+ }
1609
+ );
1610
+ Qt.displayName = Qr;
1611
+ function Jt(e) {
1612
+ return e === "" || e === void 0;
1613
+ }
1614
+ function en(e) {
1615
+ const t = We(e), n = a.useRef(""), r = a.useRef(0), o = a.useCallback(
1616
+ (s) => {
1617
+ const c = n.current + s;
1618
+ t(c), (function u(d) {
1619
+ n.current = d, window.clearTimeout(r.current), d !== "" && (r.current = window.setTimeout(() => u(""), 1e3));
1620
+ })(c);
1621
+ },
1622
+ [t]
1623
+ ), l = a.useCallback(() => {
1624
+ n.current = "", window.clearTimeout(r.current);
1625
+ }, []);
1626
+ return a.useEffect(() => () => window.clearTimeout(r.current), []), [n, o, l];
1627
+ }
1628
+ function tn(e, t, n) {
1629
+ const o = t.length > 1 && Array.from(t).every((d) => d === t[0]) ? t[0] : t, l = n ? e.indexOf(n) : -1;
1630
+ let s = Jr(e, Math.max(l, 0));
1631
+ o.length === 1 && (s = s.filter((d) => d !== n));
1632
+ const u = s.find(
1633
+ (d) => d.textValue.toLowerCase().startsWith(o.toLowerCase())
1634
+ );
1635
+ return u !== n ? u : void 0;
1636
+ }
1637
+ function Jr(e, t) {
1638
+ return e.map((n, r) => e[(t + r) % e.length]);
1639
+ }
1640
+ var eo = It, nn = Pt, to = At, no = Mt, ro = Ot, rn = kt, oo = Vt, ao = Wt, on = Ut, an = jt, co = $t, io = Gt, cn = Yt, ln = Xt, sn = qt;
1641
+ const wo = eo, Co = ao, bo = to, lo = a.forwardRef(
1642
+ ({ className: e, children: t, ...n }, r) => /* @__PURE__ */ re(
1643
+ nn,
1644
+ {
1645
+ ref: r,
1646
+ className: q(
1647
+ "flex h-10 w-full items-center justify-between rounded-md border border-input bg-background px-3 py-2 text-sm ring-offset-background placeholder:text-muted-foreground focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50 [&>span]:line-clamp-1",
1648
+ e
1649
+ ),
1650
+ ...n,
1651
+ children: [
1652
+ t,
1653
+ /* @__PURE__ */ v(no, { asChild: !0, children: /* @__PURE__ */ v(pt, { className: "size-4 opacity-50" }) })
1654
+ ]
1655
+ }
1656
+ )
1657
+ );
1658
+ lo.displayName = nn.displayName;
1659
+ const un = a.forwardRef(({ className: e, ...t }, n) => /* @__PURE__ */ v(cn, { ref: n, className: q("flex cursor-default items-center justify-center py-1", e), ...t, children: /* @__PURE__ */ v(xn, { className: "size-4" }) }));
1660
+ un.displayName = cn.displayName;
1661
+ const dn = a.forwardRef(({ className: e, ...t }, n) => /* @__PURE__ */ v(ln, { ref: n, className: q("flex cursor-default items-center justify-center py-1", e), ...t, children: /* @__PURE__ */ v(pt, { className: "size-4" }) }));
1662
+ dn.displayName = ln.displayName;
1663
+ const so = a.forwardRef(
1664
+ ({ className: e, children: t, position: n = "popper", ...r }, o) => /* @__PURE__ */ v(ro, { children: /* @__PURE__ */ re(
1665
+ rn,
1666
+ {
1667
+ ref: o,
1668
+ className: q(
1669
+ "relative z-[100] max-h-96 min-w-[8rem] overflow-hidden rounded-md border bg-popover text-popover-foreground shadow-md data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-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",
1670
+ n === "popper" && "data-[side=bottom]:translate-y-1 data-[side=left]:-translate-x-1 data-[side=right]:translate-x-1 data-[side=top]:-translate-y-1",
1671
+ e
1672
+ ),
1673
+ position: n,
1674
+ ...r,
1675
+ children: [
1676
+ /* @__PURE__ */ v(un, {}),
1677
+ /* @__PURE__ */ v(
1678
+ oo,
1679
+ {
1680
+ className: q("p-1", n === "popper" && "h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)]"),
1681
+ children: t
1682
+ }
1683
+ ),
1684
+ /* @__PURE__ */ v(dn, {})
1685
+ ]
1686
+ }
1687
+ ) })
1688
+ );
1689
+ so.displayName = rn.displayName;
1690
+ const uo = a.forwardRef(
1691
+ ({ className: e, ...t }, n) => /* @__PURE__ */ v(on, { ref: n, className: q("py-1.5 pl-8 pr-2 text-sm font-semibold", e), ...t })
1692
+ );
1693
+ uo.displayName = on.displayName;
1694
+ const fo = a.forwardRef(
1695
+ ({ className: e, children: t, ...n }, r) => /* @__PURE__ */ re(
1696
+ an,
1697
+ {
1698
+ ref: r,
1699
+ className: q(
1700
+ "relative flex w-full cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",
1701
+ e
1702
+ ),
1703
+ ...n,
1704
+ children: [
1705
+ /* @__PURE__ */ v("span", { className: "absolute left-2 flex h-3.5 w-3.5 items-center justify-center", children: /* @__PURE__ */ v(io, { children: /* @__PURE__ */ v(bn, { className: "size-4" }) }) }),
1706
+ /* @__PURE__ */ v(co, { children: t })
1707
+ ]
1708
+ }
1709
+ )
1710
+ );
1711
+ fo.displayName = an.displayName;
1712
+ const po = a.forwardRef(
1713
+ ({ className: e, ...t }, n) => /* @__PURE__ */ v(sn, { ref: n, className: q("-mx-1 my-1 h-px bg-muted", e), ...t })
1714
+ );
1715
+ po.displayName = sn.displayName;
1716
+ export {
1717
+ bn as C,
1718
+ ht as F,
1719
+ vt as P,
1720
+ Tt as R,
1721
+ wo as S,
1722
+ so as a,
1723
+ Co as b,
1724
+ fo as c,
1725
+ uo as d,
1726
+ dn as e,
1727
+ un as f,
1728
+ po as g,
1729
+ lo as h,
1730
+ bo as i,
1731
+ _n as j,
1732
+ kn as k,
1733
+ qn as l,
1734
+ Qe as m,
1735
+ wn as n,
1736
+ On as u
1737
+ };