@spear-ai/spectral 1.3.56 → 1.3.58

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.
package/dist/Select.js CHANGED
@@ -1,11 +1,11 @@
1
1
  "use client";
2
2
  import "./styles/main.css";
3
- import { jsx as s, jsxs as F, Fragment as ce } from "react/jsx-runtime";
3
+ import { jsx as n, jsxs as B, Fragment as ae } from "react/jsx-runtime";
4
4
  import "./Icons/AnnotationsIcon.js";
5
5
  import "./Icons/CalendarIcon.js";
6
6
  import "./Icons/CheckCircleIcon.js";
7
7
  import "./Icons/CheckSquareIcon.js";
8
- import { CheckmarkIcon as dt } from "./Icons/CheckmarkIcon.js";
8
+ import { CheckmarkIcon as at } from "./Icons/CheckmarkIcon.js";
9
9
  import { ChevronDownIcon as xe } from "./Icons/ChevronDownIcon.js";
10
10
  import "./Icons/ChevronUpIcon.js";
11
11
  import "./Icons/ClockIcon.js";
@@ -28,7 +28,7 @@ import "./Icons/LabelIcon.js";
28
28
  import "./Icons/LassoIcon.js";
29
29
  import "./Icons/LineToolIcon.js";
30
30
  import "./Icons/LiveViewIcon.js";
31
- import { LoaderIcon as ut } from "./Icons/LoaderIcon.js";
31
+ import { LoaderIcon as lt } from "./Icons/LoaderIcon.js";
32
32
  import "./Icons/LocationIcon.js";
33
33
  import "./Icons/LogoutIcon.js";
34
34
  import "./Icons/MetadataIcon.js";
@@ -47,398 +47,351 @@ import "./Icons/WarningIcon.js";
47
47
  import "./Icons/ZoomAllIcon.js";
48
48
  import "./Icons/ZoomXIcon.js";
49
49
  import "./Icons/ZoomYIcon.js";
50
- import { Label as pt } from "./Label.js";
51
- import * as o from "react";
52
- import ee, { forwardRef as mt } from "react";
53
- import * as Ae from "react-dom";
54
- import { c as De, b as U, f as ye, a as _e, u as Pe, P as k, d as O, g as $, i as ft, D as ht } from "./index-DfFzqLW6.js";
55
- import { h as gt, u as vt, R as St, F as Ct } from "./index-BDYruyoU.js";
56
- import { c as Le, R as wt, a as xt, C as yt, A as It } from "./index-C18a1qz_.js";
57
- import { V as bt } from "./index-CFeaEsew.js";
58
- import { useFormFieldId as Tt, useFormFieldState as Rt, getAriaProps as Nt, getErrorMessageId as Pt, groupOptions as Et, getFormFieldCSSProperties as _t, getStateClasses as Mt, getTriggerClasses as Ot, ErrorMessage as At, LoadingState as Dt, EmptyState as Lt, getOptionClasses as kt } from "./utils/formFieldUtils.js";
59
- import { c as ue } from "./twUtils-CRiPKpXj.js";
60
- function Me(t, [n, e]) {
61
- return Math.min(e, Math.max(n, t));
50
+ import { Label as ct } from "./Label.js";
51
+ import * as t from "react";
52
+ import { forwardRef as dt } from "react";
53
+ import * as Me from "react-dom";
54
+ import { d as Re, c as pt, b as Ne, a as Y, P as L, e as _, u as q, h as ut, g as mt } from "./index-CA7haECj.js";
55
+ import { u as ft, c as ht, a as gt } from "./index-CbXx14YO.js";
56
+ import { D as vt } from "./index-cCg4yNa8.js";
57
+ import { h as St, u as wt, R as xt, F as Ct } from "./index-DUK1rxhf.js";
58
+ import { c as Oe, R as yt, a as It, C as bt, A as Tt } from "./index-FeGk8zep.js";
59
+ import { V as Nt } from "./index-Cfyte2YO.js";
60
+ import { useFormFieldId as Pt, useFormFieldState as Rt, getAriaProps as Et, getErrorMessageId as _t, groupOptions as Mt, getFormFieldCSSProperties as Ot, getStateClasses as At, getTriggerClasses as Dt, ErrorMessage as Lt, LoadingState as kt, EmptyState as Vt, getOptionClasses as Bt } from "./utils/formFieldUtils.js";
61
+ import { c as de } from "./twUtils-CRiPKpXj.js";
62
+ function Ee(r, [a, e]) {
63
+ return Math.min(e, Math.max(a, r));
62
64
  }
63
- function Vt(t) {
64
- const n = t + "CollectionProvider", [e, d] = De(n), [c, p] = e(
65
- n,
66
- { collectionRef: { current: null }, itemMap: /* @__PURE__ */ new Map() }
67
- ), r = (a) => {
68
- const { scope: f, children: v } = a, u = ee.useRef(null), g = ee.useRef(/* @__PURE__ */ new Map()).current;
69
- return /* @__PURE__ */ s(c, { scope: f, itemMap: g, collectionRef: u, children: v });
70
- };
71
- r.displayName = n;
72
- const i = t + "CollectionSlot", l = ye(i), m = ee.forwardRef(
73
- (a, f) => {
74
- const { scope: v, children: u } = a, g = p(i, v), P = U(f, g.collectionRef);
75
- return /* @__PURE__ */ s(l, { ref: P, children: u });
76
- }
77
- );
78
- m.displayName = i;
79
- const S = t + "CollectionItemSlot", C = "data-radix-collection-item", b = ye(S), x = ee.forwardRef(
80
- (a, f) => {
81
- const { scope: v, children: u, ...g } = a, P = ee.useRef(null), E = U(f, P), V = p(S, v);
82
- return ee.useEffect(() => (V.itemMap.set(P, { ref: P, ...g }), () => void V.itemMap.delete(P))), /* @__PURE__ */ s(b, { [C]: "", ref: E, children: u });
83
- }
84
- );
85
- x.displayName = S;
86
- function w(a) {
87
- const f = p(t + "CollectionConsumer", a);
88
- return ee.useCallback(() => {
89
- const u = f.collectionRef.current;
90
- if (!u) return [];
91
- const g = Array.from(u.querySelectorAll(`[${C}]`));
92
- return Array.from(f.itemMap.values()).sort(
93
- (V, T) => g.indexOf(V.ref.current) - g.indexOf(T.ref.current)
94
- );
95
- }, [f.collectionRef, f.itemMap]);
96
- }
97
- return [
98
- { Provider: r, Slot: m, ItemSlot: x },
99
- w,
100
- d
101
- ];
102
- }
103
- var Bt = o.createContext(void 0);
104
- function Ht(t) {
105
- const n = o.useContext(Bt);
106
- return t || n || "ltr";
107
- }
108
- function Ft(t) {
109
- const n = o.useRef({ value: t, previous: t });
110
- return o.useMemo(() => (n.current.value !== t && (n.current.previous = n.current.value, n.current.value = t), n.current.previous), [t]);
111
- }
112
- var Ut = [" ", "Enter", "ArrowUp", "ArrowDown"], Wt = [" ", "Enter"], te = "Select", [me, fe, Kt] = Vt(te), [re] = De(te, [
113
- Kt,
114
- Le
115
- ]), he = Le(), [zt, X] = re(te), [Gt, jt] = re(te), ke = (t) => {
65
+ var Ht = [" ", "Enter", "ArrowUp", "ArrowDown"], Ft = [" ", "Enter"], ee = "Select", [ue, me, Ut] = ht(ee), [ne] = pt(ee, [
66
+ Ut,
67
+ Oe
68
+ ]), fe = Oe(), [Wt, $] = ne(ee), [Kt, zt] = ne(ee), Ae = (r) => {
116
69
  const {
117
- __scopeSelect: n,
70
+ __scopeSelect: a,
118
71
  children: e,
119
- open: d,
120
- defaultOpen: c,
72
+ open: c,
73
+ defaultOpen: l,
121
74
  onOpenChange: p,
122
- value: r,
123
- defaultValue: i,
124
- onValueChange: l,
75
+ value: o,
76
+ defaultValue: s,
77
+ onValueChange: i,
125
78
  dir: m,
126
- name: S,
127
- autoComplete: C,
128
- disabled: b,
129
- required: x,
130
- form: w
131
- } = t, a = he(n), [f, v] = o.useState(null), [u, g] = o.useState(null), [P, E] = o.useState(!1), V = Ht(m), [T, A] = _e({
132
- prop: d,
133
- defaultProp: c ?? !1,
79
+ name: v,
80
+ autoComplete: w,
81
+ disabled: T,
82
+ required: I,
83
+ form: C
84
+ } = r, d = fe(a), [h, S] = t.useState(null), [u, g] = t.useState(null), [z, M] = t.useState(!1), Z = ft(m), [P, O] = Re({
85
+ prop: c,
86
+ defaultProp: l ?? !1,
134
87
  onChange: p,
135
- caller: te
136
- }), [W, q] = _e({
137
- prop: r,
138
- defaultProp: i,
139
- onChange: l,
140
- caller: te
141
- }), B = o.useRef(null), K = f ? w || !!f.closest("form") : !0, [z, H] = o.useState(/* @__PURE__ */ new Set()), G = Array.from(z).map((M) => M.props.value).join(";");
142
- return /* @__PURE__ */ s(wt, { ...a, children: /* @__PURE__ */ F(
143
- zt,
88
+ caller: ee
89
+ }), [H, G] = Re({
90
+ prop: o,
91
+ defaultProp: s,
92
+ onChange: i,
93
+ caller: ee
94
+ }), k = t.useRef(null), F = h ? C || !!h.closest("form") : !0, [U, V] = t.useState(/* @__PURE__ */ new Set()), W = Array.from(U).map((E) => E.props.value).join(";");
95
+ return /* @__PURE__ */ n(yt, { ...d, children: /* @__PURE__ */ B(
96
+ Wt,
144
97
  {
145
- required: x,
146
- scope: n,
147
- trigger: f,
148
- onTriggerChange: v,
98
+ required: I,
99
+ scope: a,
100
+ trigger: h,
101
+ onTriggerChange: S,
149
102
  valueNode: u,
150
103
  onValueNodeChange: g,
151
- valueNodeHasChildren: P,
152
- onValueNodeHasChildrenChange: E,
153
- contentId: Pe(),
154
- value: W,
155
- onValueChange: q,
156
- open: T,
157
- onOpenChange: A,
158
- dir: V,
159
- triggerPointerDownPosRef: B,
160
- disabled: b,
104
+ valueNodeHasChildren: z,
105
+ onValueNodeHasChildrenChange: M,
106
+ contentId: Ne(),
107
+ value: H,
108
+ onValueChange: G,
109
+ open: P,
110
+ onOpenChange: O,
111
+ dir: Z,
112
+ triggerPointerDownPosRef: k,
113
+ disabled: T,
161
114
  children: [
162
- /* @__PURE__ */ s(me.Provider, { scope: n, children: /* @__PURE__ */ s(
163
- Gt,
115
+ /* @__PURE__ */ n(ue.Provider, { scope: a, children: /* @__PURE__ */ n(
116
+ Kt,
164
117
  {
165
- scope: t.__scopeSelect,
166
- onNativeOptionAdd: o.useCallback((M) => {
167
- H((R) => new Set(R).add(M));
118
+ scope: r.__scopeSelect,
119
+ onNativeOptionAdd: t.useCallback((E) => {
120
+ V((b) => new Set(b).add(E));
168
121
  }, []),
169
- onNativeOptionRemove: o.useCallback((M) => {
170
- H((R) => {
171
- const D = new Set(R);
172
- return D.delete(M), D;
122
+ onNativeOptionRemove: t.useCallback((E) => {
123
+ V((b) => {
124
+ const A = new Set(b);
125
+ return A.delete(E), A;
173
126
  });
174
127
  }, []),
175
128
  children: e
176
129
  }
177
130
  ) }),
178
- K ? /* @__PURE__ */ F(
179
- it,
131
+ F ? /* @__PURE__ */ B(
132
+ nt,
180
133
  {
181
134
  "aria-hidden": !0,
182
- required: x,
135
+ required: I,
183
136
  tabIndex: -1,
184
- name: S,
185
- autoComplete: C,
186
- value: W,
187
- onChange: (M) => q(M.target.value),
188
- disabled: b,
189
- form: w,
137
+ name: v,
138
+ autoComplete: w,
139
+ value: H,
140
+ onChange: (E) => G(E.target.value),
141
+ disabled: T,
142
+ form: C,
190
143
  children: [
191
- W === void 0 ? /* @__PURE__ */ s("option", { value: "" }) : null,
192
- Array.from(z)
144
+ H === void 0 ? /* @__PURE__ */ n("option", { value: "" }) : null,
145
+ Array.from(U)
193
146
  ]
194
147
  },
195
- G
148
+ W
196
149
  ) : null
197
150
  ]
198
151
  }
199
152
  ) });
200
153
  };
201
- ke.displayName = te;
202
- var Ve = "SelectTrigger", Be = o.forwardRef(
203
- (t, n) => {
204
- const { __scopeSelect: e, disabled: d = !1, ...c } = t, p = he(e), r = X(Ve, e), i = r.disabled || d, l = U(n, r.onTriggerChange), m = fe(e), S = o.useRef("touch"), [C, b, x] = ct((a) => {
205
- const f = m().filter((g) => !g.disabled), v = f.find((g) => g.value === r.value), u = at(f, a, v);
206
- u !== void 0 && r.onValueChange(u.value);
207
- }), w = (a) => {
208
- i || (r.onOpenChange(!0), x()), a && (r.triggerPointerDownPosRef.current = {
209
- x: Math.round(a.pageX),
210
- y: Math.round(a.pageY)
154
+ Ae.displayName = ee;
155
+ var De = "SelectTrigger", Le = t.forwardRef(
156
+ (r, a) => {
157
+ const { __scopeSelect: e, disabled: c = !1, ...l } = r, p = fe(e), o = $(De, e), s = o.disabled || c, i = Y(a, o.onTriggerChange), m = me(e), v = t.useRef("touch"), [w, T, I] = st((d) => {
158
+ const h = m().filter((g) => !g.disabled), S = h.find((g) => g.value === o.value), u = it(h, d, S);
159
+ u !== void 0 && o.onValueChange(u.value);
160
+ }), C = (d) => {
161
+ s || (o.onOpenChange(!0), I()), d && (o.triggerPointerDownPosRef.current = {
162
+ x: Math.round(d.pageX),
163
+ y: Math.round(d.pageY)
211
164
  });
212
165
  };
213
- return /* @__PURE__ */ s(xt, { asChild: !0, ...p, children: /* @__PURE__ */ s(
214
- k.button,
166
+ return /* @__PURE__ */ n(It, { asChild: !0, ...p, children: /* @__PURE__ */ n(
167
+ L.button,
215
168
  {
216
169
  type: "button",
217
170
  role: "combobox",
218
- "aria-controls": r.contentId,
219
- "aria-expanded": r.open,
220
- "aria-required": r.required,
171
+ "aria-controls": o.contentId,
172
+ "aria-expanded": o.open,
173
+ "aria-required": o.required,
221
174
  "aria-autocomplete": "none",
222
- dir: r.dir,
223
- "data-state": r.open ? "open" : "closed",
224
- disabled: i,
225
- "data-disabled": i ? "" : void 0,
226
- "data-placeholder": lt(r.value) ? "" : void 0,
227
- ...c,
228
- ref: l,
229
- onClick: O(c.onClick, (a) => {
230
- a.currentTarget.focus(), S.current !== "mouse" && w(a);
175
+ dir: o.dir,
176
+ "data-state": o.open ? "open" : "closed",
177
+ disabled: s,
178
+ "data-disabled": s ? "" : void 0,
179
+ "data-placeholder": rt(o.value) ? "" : void 0,
180
+ ...l,
181
+ ref: i,
182
+ onClick: _(l.onClick, (d) => {
183
+ d.currentTarget.focus(), v.current !== "mouse" && C(d);
231
184
  }),
232
- onPointerDown: O(c.onPointerDown, (a) => {
233
- S.current = a.pointerType;
234
- const f = a.target;
235
- f.hasPointerCapture(a.pointerId) && f.releasePointerCapture(a.pointerId), a.button === 0 && a.ctrlKey === !1 && a.pointerType === "mouse" && (w(a), a.preventDefault());
185
+ onPointerDown: _(l.onPointerDown, (d) => {
186
+ v.current = d.pointerType;
187
+ const h = d.target;
188
+ h.hasPointerCapture(d.pointerId) && h.releasePointerCapture(d.pointerId), d.button === 0 && d.ctrlKey === !1 && d.pointerType === "mouse" && (C(d), d.preventDefault());
236
189
  }),
237
- onKeyDown: O(c.onKeyDown, (a) => {
238
- const f = C.current !== "";
239
- !(a.ctrlKey || a.altKey || a.metaKey) && a.key.length === 1 && b(a.key), !(f && a.key === " ") && Ut.includes(a.key) && (w(), a.preventDefault());
190
+ onKeyDown: _(l.onKeyDown, (d) => {
191
+ const h = w.current !== "";
192
+ !(d.ctrlKey || d.altKey || d.metaKey) && d.key.length === 1 && T(d.key), !(h && d.key === " ") && Ht.includes(d.key) && (C(), d.preventDefault());
240
193
  })
241
194
  }
242
195
  ) });
243
196
  }
244
197
  );
245
- Be.displayName = Ve;
246
- var He = "SelectValue", Fe = o.forwardRef(
247
- (t, n) => {
248
- const { __scopeSelect: e, className: d, style: c, children: p, placeholder: r = "", ...i } = t, l = X(He, e), { onValueNodeHasChildrenChange: m } = l, S = p !== void 0, C = U(n, l.onValueNodeChange);
249
- return $(() => {
250
- m(S);
251
- }, [m, S]), /* @__PURE__ */ s(
252
- k.span,
198
+ Le.displayName = De;
199
+ var ke = "SelectValue", Ve = t.forwardRef(
200
+ (r, a) => {
201
+ const { __scopeSelect: e, className: c, style: l, children: p, placeholder: o = "", ...s } = r, i = $(ke, e), { onValueNodeHasChildrenChange: m } = i, v = p !== void 0, w = Y(a, i.onValueNodeChange);
202
+ return q(() => {
203
+ m(v);
204
+ }, [m, v]), /* @__PURE__ */ n(
205
+ L.span,
253
206
  {
254
- ...i,
255
- ref: C,
207
+ ...s,
208
+ ref: w,
256
209
  style: { pointerEvents: "none" },
257
- children: lt(l.value) ? /* @__PURE__ */ s(ce, { children: r }) : p
210
+ children: rt(i.value) ? /* @__PURE__ */ n(ae, { children: o }) : p
258
211
  }
259
212
  );
260
213
  }
261
214
  );
262
- Fe.displayName = He;
263
- var qt = "SelectIcon", Ue = o.forwardRef(
264
- (t, n) => {
265
- const { __scopeSelect: e, children: d, ...c } = t;
266
- return /* @__PURE__ */ s(k.span, { "aria-hidden": !0, ...c, ref: n, children: d || "▼" });
215
+ Ve.displayName = ke;
216
+ var Gt = "SelectIcon", Be = t.forwardRef(
217
+ (r, a) => {
218
+ const { __scopeSelect: e, children: c, ...l } = r;
219
+ return /* @__PURE__ */ n(L.span, { "aria-hidden": !0, ...l, ref: a, children: c || "▼" });
267
220
  }
268
221
  );
269
- Ue.displayName = qt;
270
- var oe = "SelectContent", We = o.forwardRef(
271
- (t, n) => {
272
- const e = X(oe, t.__scopeSelect), [d, c] = o.useState();
273
- if ($(() => {
274
- c(new DocumentFragment());
222
+ Be.displayName = Gt;
223
+ var te = "SelectContent", He = t.forwardRef(
224
+ (r, a) => {
225
+ const e = $(te, r.__scopeSelect), [c, l] = t.useState();
226
+ if (q(() => {
227
+ l(new DocumentFragment());
275
228
  }, []), !e.open) {
276
- const p = d;
277
- return p ? Ae.createPortal(
278
- /* @__PURE__ */ s(Ke, { scope: t.__scopeSelect, children: /* @__PURE__ */ s(me.Slot, { scope: t.__scopeSelect, children: /* @__PURE__ */ s("div", { children: t.children }) }) }),
229
+ const p = c;
230
+ return p ? Me.createPortal(
231
+ /* @__PURE__ */ n(Fe, { scope: r.__scopeSelect, children: /* @__PURE__ */ n(ue.Slot, { scope: r.__scopeSelect, children: /* @__PURE__ */ n("div", { children: r.children }) }) }),
279
232
  p
280
233
  ) : null;
281
234
  }
282
- return /* @__PURE__ */ s(ze, { ...t, ref: n });
235
+ return /* @__PURE__ */ n(Ue, { ...r, ref: a });
283
236
  }
284
237
  );
285
- We.displayName = oe;
286
- var j = 10, [Ke, Z] = re(oe), Yt = "SelectContentImpl", $t = ye("SelectContent.RemoveScroll"), ze = o.forwardRef(
287
- (t, n) => {
238
+ He.displayName = te;
239
+ var K = 10, [Fe, X] = ne(te), jt = "SelectContentImpl", Yt = mt("SelectContent.RemoveScroll"), Ue = t.forwardRef(
240
+ (r, a) => {
288
241
  const {
289
242
  __scopeSelect: e,
290
- position: d = "item-aligned",
291
- onCloseAutoFocus: c,
243
+ position: c = "item-aligned",
244
+ onCloseAutoFocus: l,
292
245
  onEscapeKeyDown: p,
293
- onPointerDownOutside: r,
246
+ onPointerDownOutside: o,
294
247
  //
295
248
  // PopperContent props
296
- side: i,
297
- sideOffset: l,
249
+ side: s,
250
+ sideOffset: i,
298
251
  align: m,
299
- alignOffset: S,
300
- arrowPadding: C,
301
- collisionBoundary: b,
302
- collisionPadding: x,
303
- sticky: w,
304
- hideWhenDetached: a,
305
- avoidCollisions: f,
252
+ alignOffset: v,
253
+ arrowPadding: w,
254
+ collisionBoundary: T,
255
+ collisionPadding: I,
256
+ sticky: C,
257
+ hideWhenDetached: d,
258
+ avoidCollisions: h,
306
259
  //
307
- ...v
308
- } = t, u = X(oe, e), [g, P] = o.useState(null), [E, V] = o.useState(null), T = U(n, (h) => P(h)), [A, W] = o.useState(null), [q, B] = o.useState(
260
+ ...S
261
+ } = r, u = $(te, e), [g, z] = t.useState(null), [M, Z] = t.useState(null), P = Y(a, (f) => z(f)), [O, H] = t.useState(null), [G, k] = t.useState(
309
262
  null
310
- ), K = fe(e), [z, H] = o.useState(!1), G = o.useRef(!1);
311
- o.useEffect(() => {
312
- if (g) return gt(g);
313
- }, [g]), vt();
314
- const M = o.useCallback(
315
- (h) => {
316
- const [N, ...L] = K().map((_) => _.ref.current), [y] = L.slice(-1), I = document.activeElement;
317
- for (const _ of h)
318
- if (_ === I || (_?.scrollIntoView({ block: "nearest" }), _ === N && E && (E.scrollTop = 0), _ === y && E && (E.scrollTop = E.scrollHeight), _?.focus(), document.activeElement !== I)) return;
263
+ ), F = me(e), [U, V] = t.useState(!1), W = t.useRef(!1);
264
+ t.useEffect(() => {
265
+ if (g) return St(g);
266
+ }, [g]), wt();
267
+ const E = t.useCallback(
268
+ (f) => {
269
+ const [N, ...D] = F().map((R) => R.ref.current), [x] = D.slice(-1), y = document.activeElement;
270
+ for (const R of f)
271
+ if (R === y || (R?.scrollIntoView({ block: "nearest" }), R === N && M && (M.scrollTop = 0), R === x && M && (M.scrollTop = M.scrollHeight), R?.focus(), document.activeElement !== y)) return;
319
272
  },
320
- [K, E]
321
- ), R = o.useCallback(
322
- () => M([A, g]),
323
- [M, A, g]
273
+ [F, M]
274
+ ), b = t.useCallback(
275
+ () => E([O, g]),
276
+ [E, O, g]
324
277
  );
325
- o.useEffect(() => {
326
- z && R();
327
- }, [z, R]);
328
- const { onOpenChange: D, triggerPointerDownPosRef: Y } = u;
329
- o.useEffect(() => {
278
+ t.useEffect(() => {
279
+ U && b();
280
+ }, [U, b]);
281
+ const { onOpenChange: A, triggerPointerDownPosRef: j } = u;
282
+ t.useEffect(() => {
330
283
  if (g) {
331
- let h = { x: 0, y: 0 };
332
- const N = (y) => {
333
- h = {
334
- x: Math.abs(Math.round(y.pageX) - (Y.current?.x ?? 0)),
335
- y: Math.abs(Math.round(y.pageY) - (Y.current?.y ?? 0))
284
+ let f = { x: 0, y: 0 };
285
+ const N = (x) => {
286
+ f = {
287
+ x: Math.abs(Math.round(x.pageX) - (j.current?.x ?? 0)),
288
+ y: Math.abs(Math.round(x.pageY) - (j.current?.y ?? 0))
336
289
  };
337
- }, L = (y) => {
338
- h.x <= 10 && h.y <= 10 ? y.preventDefault() : g.contains(y.target) || D(!1), document.removeEventListener("pointermove", N), Y.current = null;
290
+ }, D = (x) => {
291
+ f.x <= 10 && f.y <= 10 ? x.preventDefault() : g.contains(x.target) || A(!1), document.removeEventListener("pointermove", N), j.current = null;
339
292
  };
340
- return Y.current !== null && (document.addEventListener("pointermove", N), document.addEventListener("pointerup", L, { capture: !0, once: !0 })), () => {
341
- document.removeEventListener("pointermove", N), document.removeEventListener("pointerup", L, { capture: !0 });
293
+ return j.current !== null && (document.addEventListener("pointermove", N), document.addEventListener("pointerup", D, { capture: !0, once: !0 })), () => {
294
+ document.removeEventListener("pointermove", N), document.removeEventListener("pointerup", D, { capture: !0 });
342
295
  };
343
296
  }
344
- }, [g, D, Y]), o.useEffect(() => {
345
- const h = () => D(!1);
346
- return window.addEventListener("blur", h), window.addEventListener("resize", h), () => {
347
- window.removeEventListener("blur", h), window.removeEventListener("resize", h);
297
+ }, [g, A, j]), t.useEffect(() => {
298
+ const f = () => A(!1);
299
+ return window.addEventListener("blur", f), window.addEventListener("resize", f), () => {
300
+ window.removeEventListener("blur", f), window.removeEventListener("resize", f);
348
301
  };
349
- }, [D]);
350
- const [se, ae] = ct((h) => {
351
- const N = K().filter((I) => !I.disabled), L = N.find((I) => I.ref.current === document.activeElement), y = at(N, h, L);
352
- y && setTimeout(() => y.ref.current.focus());
353
- }), ge = o.useCallback(
354
- (h, N, L) => {
355
- const y = !G.current && !L;
356
- (u.value !== void 0 && u.value === N || y) && (W(h), y && (G.current = !0));
302
+ }, [A]);
303
+ const [re, le] = st((f) => {
304
+ const N = F().filter((y) => !y.disabled), D = N.find((y) => y.ref.current === document.activeElement), x = it(N, f, D);
305
+ x && setTimeout(() => x.ref.current.focus());
306
+ }), he = t.useCallback(
307
+ (f, N, D) => {
308
+ const x = !W.current && !D;
309
+ (u.value !== void 0 && u.value === N || x) && (H(f), x && (W.current = !0));
357
310
  },
358
311
  [u.value]
359
- ), ve = o.useCallback(() => g?.focus(), [g]), ne = o.useCallback(
360
- (h, N, L) => {
361
- const y = !G.current && !L;
362
- (u.value !== void 0 && u.value === N || y) && B(h);
312
+ ), ge = t.useCallback(() => g?.focus(), [g]), oe = t.useCallback(
313
+ (f, N, D) => {
314
+ const x = !W.current && !D;
315
+ (u.value !== void 0 && u.value === N || x) && k(f);
363
316
  },
364
317
  [u.value]
365
- ), de = d === "popper" ? Ie : Ge, ie = de === Ie ? {
366
- side: i,
367
- sideOffset: l,
318
+ ), ce = c === "popper" ? Ce : We, se = ce === Ce ? {
319
+ side: s,
320
+ sideOffset: i,
368
321
  align: m,
369
- alignOffset: S,
370
- arrowPadding: C,
371
- collisionBoundary: b,
372
- collisionPadding: x,
373
- sticky: w,
374
- hideWhenDetached: a,
375
- avoidCollisions: f
322
+ alignOffset: v,
323
+ arrowPadding: w,
324
+ collisionBoundary: T,
325
+ collisionPadding: I,
326
+ sticky: C,
327
+ hideWhenDetached: d,
328
+ avoidCollisions: h
376
329
  } : {};
377
- return /* @__PURE__ */ s(
378
- Ke,
330
+ return /* @__PURE__ */ n(
331
+ Fe,
379
332
  {
380
333
  scope: e,
381
334
  content: g,
382
- viewport: E,
383
- onViewportChange: V,
384
- itemRefCallback: ge,
385
- selectedItem: A,
386
- onItemLeave: ve,
387
- itemTextRefCallback: ne,
388
- focusSelectedItem: R,
389
- selectedItemText: q,
390
- position: d,
391
- isPositioned: z,
392
- searchRef: se,
393
- children: /* @__PURE__ */ s(St, { as: $t, allowPinchZoom: !0, children: /* @__PURE__ */ s(
335
+ viewport: M,
336
+ onViewportChange: Z,
337
+ itemRefCallback: he,
338
+ selectedItem: O,
339
+ onItemLeave: ge,
340
+ itemTextRefCallback: oe,
341
+ focusSelectedItem: b,
342
+ selectedItemText: G,
343
+ position: c,
344
+ isPositioned: U,
345
+ searchRef: re,
346
+ children: /* @__PURE__ */ n(xt, { as: Yt, allowPinchZoom: !0, children: /* @__PURE__ */ n(
394
347
  Ct,
395
348
  {
396
349
  asChild: !0,
397
350
  trapped: u.open,
398
- onMountAutoFocus: (h) => {
399
- h.preventDefault();
351
+ onMountAutoFocus: (f) => {
352
+ f.preventDefault();
400
353
  },
401
- onUnmountAutoFocus: O(c, (h) => {
402
- u.trigger?.focus({ preventScroll: !0 }), h.preventDefault();
354
+ onUnmountAutoFocus: _(l, (f) => {
355
+ u.trigger?.focus({ preventScroll: !0 }), f.preventDefault();
403
356
  }),
404
- children: /* @__PURE__ */ s(
405
- ht,
357
+ children: /* @__PURE__ */ n(
358
+ vt,
406
359
  {
407
360
  asChild: !0,
408
361
  disableOutsidePointerEvents: !0,
409
362
  onEscapeKeyDown: p,
410
- onPointerDownOutside: r,
411
- onFocusOutside: (h) => h.preventDefault(),
363
+ onPointerDownOutside: o,
364
+ onFocusOutside: (f) => f.preventDefault(),
412
365
  onDismiss: () => u.onOpenChange(!1),
413
- children: /* @__PURE__ */ s(
414
- de,
366
+ children: /* @__PURE__ */ n(
367
+ ce,
415
368
  {
416
369
  role: "listbox",
417
370
  id: u.contentId,
418
371
  "data-state": u.open ? "open" : "closed",
419
372
  dir: u.dir,
420
- onContextMenu: (h) => h.preventDefault(),
421
- ...v,
422
- ...ie,
423
- onPlaced: () => H(!0),
424
- ref: T,
373
+ onContextMenu: (f) => f.preventDefault(),
374
+ ...S,
375
+ ...se,
376
+ onPlaced: () => V(!0),
377
+ ref: P,
425
378
  style: {
426
379
  // flex layout so we can place the scroll buttons properly
427
380
  display: "flex",
428
381
  flexDirection: "column",
429
382
  // reset the outline by default as the content MAY get focused
430
383
  outline: "none",
431
- ...v.style
384
+ ...S.style
432
385
  },
433
- onKeyDown: O(v.onKeyDown, (h) => {
434
- const N = h.ctrlKey || h.altKey || h.metaKey;
435
- if (h.key === "Tab" && h.preventDefault(), !N && h.key.length === 1 && ae(h.key), ["ArrowUp", "ArrowDown", "Home", "End"].includes(h.key)) {
436
- let y = K().filter((I) => !I.disabled).map((I) => I.ref.current);
437
- if (["ArrowUp", "End"].includes(h.key) && (y = y.slice().reverse()), ["ArrowUp", "ArrowDown"].includes(h.key)) {
438
- const I = h.target, _ = y.indexOf(I);
439
- y = y.slice(_ + 1);
386
+ onKeyDown: _(S.onKeyDown, (f) => {
387
+ const N = f.ctrlKey || f.altKey || f.metaKey;
388
+ if (f.key === "Tab" && f.preventDefault(), !N && f.key.length === 1 && le(f.key), ["ArrowUp", "ArrowDown", "Home", "End"].includes(f.key)) {
389
+ let x = F().filter((y) => !y.disabled).map((y) => y.ref.current);
390
+ if (["ArrowUp", "End"].includes(f.key) && (x = x.slice().reverse()), ["ArrowUp", "ArrowDown"].includes(f.key)) {
391
+ const y = f.target, R = x.indexOf(y);
392
+ x = x.slice(R + 1);
440
393
  }
441
- setTimeout(() => M(y)), h.preventDefault();
394
+ setTimeout(() => E(x)), f.preventDefault();
442
395
  }
443
396
  })
444
397
  }
@@ -451,103 +404,103 @@ var j = 10, [Ke, Z] = re(oe), Yt = "SelectContentImpl", $t = ye("SelectContent.R
451
404
  );
452
405
  }
453
406
  );
454
- ze.displayName = Yt;
455
- var Xt = "SelectItemAlignedPosition", Ge = o.forwardRef((t, n) => {
456
- const { __scopeSelect: e, onPlaced: d, ...c } = t, p = X(oe, e), r = Z(oe, e), [i, l] = o.useState(null), [m, S] = o.useState(null), C = U(n, (T) => S(T)), b = fe(e), x = o.useRef(!1), w = o.useRef(!0), { viewport: a, selectedItem: f, selectedItemText: v, focusSelectedItem: u } = r, g = o.useCallback(() => {
457
- if (p.trigger && p.valueNode && i && m && a && f && v) {
458
- const T = p.trigger.getBoundingClientRect(), A = m.getBoundingClientRect(), W = p.valueNode.getBoundingClientRect(), q = v.getBoundingClientRect();
407
+ Ue.displayName = jt;
408
+ var qt = "SelectItemAlignedPosition", We = t.forwardRef((r, a) => {
409
+ const { __scopeSelect: e, onPlaced: c, ...l } = r, p = $(te, e), o = X(te, e), [s, i] = t.useState(null), [m, v] = t.useState(null), w = Y(a, (P) => v(P)), T = me(e), I = t.useRef(!1), C = t.useRef(!0), { viewport: d, selectedItem: h, selectedItemText: S, focusSelectedItem: u } = o, g = t.useCallback(() => {
410
+ if (p.trigger && p.valueNode && s && m && d && h && S) {
411
+ const P = p.trigger.getBoundingClientRect(), O = m.getBoundingClientRect(), H = p.valueNode.getBoundingClientRect(), G = S.getBoundingClientRect();
459
412
  if (p.dir !== "rtl") {
460
- const I = q.left - A.left, _ = W.left - I, J = T.left - _, Q = T.width + J, Se = Math.max(Q, A.width), Ce = window.innerWidth - j, we = Me(_, [
461
- j,
413
+ const y = G.left - O.left, R = H.left - y, J = P.left - R, Q = P.width + J, ve = Math.max(Q, O.width), Se = window.innerWidth - K, we = Ee(R, [
414
+ K,
462
415
  // Prevents the content from going off the starting edge of the
463
416
  // viewport. It may still go off the ending edge, but this can be
464
417
  // controlled by the user since they may want to manage overflow in a
465
418
  // specific way.
466
419
  // https://github.com/radix-ui/primitives/issues/2049
467
- Math.max(j, Ce - Se)
420
+ Math.max(K, Se - ve)
468
421
  ]);
469
- i.style.minWidth = Q + "px", i.style.left = we + "px";
422
+ s.style.minWidth = Q + "px", s.style.left = we + "px";
470
423
  } else {
471
- const I = A.right - q.right, _ = window.innerWidth - W.right - I, J = window.innerWidth - T.right - _, Q = T.width + J, Se = Math.max(Q, A.width), Ce = window.innerWidth - j, we = Me(_, [
472
- j,
473
- Math.max(j, Ce - Se)
424
+ const y = O.right - G.right, R = window.innerWidth - H.right - y, J = window.innerWidth - P.right - R, Q = P.width + J, ve = Math.max(Q, O.width), Se = window.innerWidth - K, we = Ee(R, [
425
+ K,
426
+ Math.max(K, Se - ve)
474
427
  ]);
475
- i.style.minWidth = Q + "px", i.style.right = we + "px";
428
+ s.style.minWidth = Q + "px", s.style.right = we + "px";
476
429
  }
477
- const B = b(), K = window.innerHeight - j * 2, z = a.scrollHeight, H = window.getComputedStyle(m), G = parseInt(H.borderTopWidth, 10), M = parseInt(H.paddingTop, 10), R = parseInt(H.borderBottomWidth, 10), D = parseInt(H.paddingBottom, 10), Y = G + M + z + D + R, se = Math.min(f.offsetHeight * 5, Y), ae = window.getComputedStyle(a), ge = parseInt(ae.paddingTop, 10), ve = parseInt(ae.paddingBottom, 10), ne = T.top + T.height / 2 - j, de = K - ne, ie = f.offsetHeight / 2, h = f.offsetTop + ie, N = G + M + h, L = Y - N;
478
- if (N <= ne) {
479
- const I = B.length > 0 && f === B[B.length - 1].ref.current;
480
- i.style.bottom = "0px";
481
- const _ = m.clientHeight - a.offsetTop - a.offsetHeight, J = Math.max(
482
- de,
483
- ie + // viewport might have padding bottom, include it to avoid a scrollable viewport
484
- (I ? ve : 0) + _ + R
430
+ const k = T(), F = window.innerHeight - K * 2, U = d.scrollHeight, V = window.getComputedStyle(m), W = parseInt(V.borderTopWidth, 10), E = parseInt(V.paddingTop, 10), b = parseInt(V.borderBottomWidth, 10), A = parseInt(V.paddingBottom, 10), j = W + E + U + A + b, re = Math.min(h.offsetHeight * 5, j), le = window.getComputedStyle(d), he = parseInt(le.paddingTop, 10), ge = parseInt(le.paddingBottom, 10), oe = P.top + P.height / 2 - K, ce = F - oe, se = h.offsetHeight / 2, f = h.offsetTop + se, N = W + E + f, D = j - N;
431
+ if (N <= oe) {
432
+ const y = k.length > 0 && h === k[k.length - 1].ref.current;
433
+ s.style.bottom = "0px";
434
+ const R = m.clientHeight - d.offsetTop - d.offsetHeight, J = Math.max(
435
+ ce,
436
+ se + // viewport might have padding bottom, include it to avoid a scrollable viewport
437
+ (y ? ge : 0) + R + b
485
438
  ), Q = N + J;
486
- i.style.height = Q + "px";
439
+ s.style.height = Q + "px";
487
440
  } else {
488
- const I = B.length > 0 && f === B[0].ref.current;
489
- i.style.top = "0px";
441
+ const y = k.length > 0 && h === k[0].ref.current;
442
+ s.style.top = "0px";
490
443
  const J = Math.max(
491
- ne,
492
- G + a.offsetTop + // viewport might have padding top, include it to avoid a scrollable viewport
493
- (I ? ge : 0) + ie
494
- ) + L;
495
- i.style.height = J + "px", a.scrollTop = N - ne + a.offsetTop;
444
+ oe,
445
+ W + d.offsetTop + // viewport might have padding top, include it to avoid a scrollable viewport
446
+ (y ? he : 0) + se
447
+ ) + D;
448
+ s.style.height = J + "px", d.scrollTop = N - oe + d.offsetTop;
496
449
  }
497
- i.style.margin = `${j}px 0`, i.style.minHeight = se + "px", i.style.maxHeight = K + "px", d?.(), requestAnimationFrame(() => x.current = !0);
450
+ s.style.margin = `${K}px 0`, s.style.minHeight = re + "px", s.style.maxHeight = F + "px", c?.(), requestAnimationFrame(() => I.current = !0);
498
451
  }
499
452
  }, [
500
- b,
453
+ T,
501
454
  p.trigger,
502
455
  p.valueNode,
503
- i,
456
+ s,
504
457
  m,
505
- a,
506
- f,
507
- v,
458
+ d,
459
+ h,
460
+ S,
508
461
  p.dir,
509
- d
462
+ c
510
463
  ]);
511
- $(() => g(), [g]);
512
- const [P, E] = o.useState();
513
- $(() => {
514
- m && E(window.getComputedStyle(m).zIndex);
464
+ q(() => g(), [g]);
465
+ const [z, M] = t.useState();
466
+ q(() => {
467
+ m && M(window.getComputedStyle(m).zIndex);
515
468
  }, [m]);
516
- const V = o.useCallback(
517
- (T) => {
518
- T && w.current === !0 && (g(), u?.(), w.current = !1);
469
+ const Z = t.useCallback(
470
+ (P) => {
471
+ P && C.current === !0 && (g(), u?.(), C.current = !1);
519
472
  },
520
473
  [g, u]
521
474
  );
522
- return /* @__PURE__ */ s(
523
- Jt,
475
+ return /* @__PURE__ */ n(
476
+ Xt,
524
477
  {
525
478
  scope: e,
526
- contentWrapper: i,
527
- shouldExpandOnScrollRef: x,
528
- onScrollButtonChange: V,
529
- children: /* @__PURE__ */ s(
479
+ contentWrapper: s,
480
+ shouldExpandOnScrollRef: I,
481
+ onScrollButtonChange: Z,
482
+ children: /* @__PURE__ */ n(
530
483
  "div",
531
484
  {
532
- ref: l,
485
+ ref: i,
533
486
  style: {
534
487
  display: "flex",
535
488
  flexDirection: "column",
536
489
  position: "fixed",
537
- zIndex: P
490
+ zIndex: z
538
491
  },
539
- children: /* @__PURE__ */ s(
540
- k.div,
492
+ children: /* @__PURE__ */ n(
493
+ L.div,
541
494
  {
542
- ...c,
543
- ref: C,
495
+ ...l,
496
+ ref: w,
544
497
  style: {
545
498
  // When we get the height of the content, it includes borders. If we were to set
546
499
  // the height without having `boxSizing: 'border-box'` it would be too big.
547
500
  boxSizing: "border-box",
548
501
  // We need to ensure the content doesn't get taller than the wrapper
549
502
  maxHeight: "100%",
550
- ...c.style
503
+ ...l.style
551
504
  }
552
505
  }
553
506
  )
@@ -556,22 +509,22 @@ var Xt = "SelectItemAlignedPosition", Ge = o.forwardRef((t, n) => {
556
509
  }
557
510
  );
558
511
  });
559
- Ge.displayName = Xt;
560
- var Zt = "SelectPopperPosition", Ie = o.forwardRef((t, n) => {
512
+ We.displayName = qt;
513
+ var $t = "SelectPopperPosition", Ce = t.forwardRef((r, a) => {
561
514
  const {
562
515
  __scopeSelect: e,
563
- align: d = "start",
564
- collisionPadding: c = j,
516
+ align: c = "start",
517
+ collisionPadding: l = K,
565
518
  ...p
566
- } = t, r = he(e);
567
- return /* @__PURE__ */ s(
568
- yt,
519
+ } = r, o = fe(e);
520
+ return /* @__PURE__ */ n(
521
+ bt,
569
522
  {
570
- ...r,
523
+ ...o,
571
524
  ...p,
572
- ref: n,
573
- align: d,
574
- collisionPadding: c,
525
+ ref: a,
526
+ align: c,
527
+ collisionPadding: l,
575
528
  style: {
576
529
  // Ensure border-box for floating-ui calculations
577
530
  boxSizing: "border-box",
@@ -585,27 +538,27 @@ var Zt = "SelectPopperPosition", Ie = o.forwardRef((t, n) => {
585
538
  }
586
539
  );
587
540
  });
588
- Ie.displayName = Zt;
589
- var [Jt, Ee] = re(oe, {}), be = "SelectViewport", je = o.forwardRef(
590
- (t, n) => {
591
- const { __scopeSelect: e, nonce: d, ...c } = t, p = Z(be, e), r = Ee(be, e), i = U(n, p.onViewportChange), l = o.useRef(0);
592
- return /* @__PURE__ */ F(ce, { children: [
593
- /* @__PURE__ */ s(
541
+ Ce.displayName = $t;
542
+ var [Xt, Pe] = ne(te, {}), ye = "SelectViewport", Ke = t.forwardRef(
543
+ (r, a) => {
544
+ const { __scopeSelect: e, nonce: c, ...l } = r, p = X(ye, e), o = Pe(ye, e), s = Y(a, p.onViewportChange), i = t.useRef(0);
545
+ return /* @__PURE__ */ B(ae, { children: [
546
+ /* @__PURE__ */ n(
594
547
  "style",
595
548
  {
596
549
  dangerouslySetInnerHTML: {
597
550
  __html: "[data-radix-select-viewport]{scrollbar-width:none;-ms-overflow-style:none;-webkit-overflow-scrolling:touch;}[data-radix-select-viewport]::-webkit-scrollbar{display:none}"
598
551
  },
599
- nonce: d
552
+ nonce: c
600
553
  }
601
554
  ),
602
- /* @__PURE__ */ s(me.Slot, { scope: e, children: /* @__PURE__ */ s(
603
- k.div,
555
+ /* @__PURE__ */ n(ue.Slot, { scope: e, children: /* @__PURE__ */ n(
556
+ L.div,
604
557
  {
605
558
  "data-radix-select-viewport": "",
606
559
  role: "presentation",
607
- ...c,
608
- ref: i,
560
+ ...l,
561
+ ref: s,
609
562
  style: {
610
563
  // we use position: 'relative' here on the `viewport` so that when we call
611
564
  // `selectedItem.offsetTop` in calculations, the offset is relative to the viewport
@@ -617,110 +570,110 @@ var [Jt, Ee] = re(oe, {}), be = "SelectViewport", je = o.forwardRef(
617
570
  // revisit this if/when that is supported
618
571
  // https://developer.chrome.com/blog/vertical-form-controls
619
572
  overflow: "hidden auto",
620
- ...c.style
573
+ ...l.style
621
574
  },
622
- onScroll: O(c.onScroll, (m) => {
623
- const S = m.currentTarget, { contentWrapper: C, shouldExpandOnScrollRef: b } = r;
624
- if (b?.current && C) {
625
- const x = Math.abs(l.current - S.scrollTop);
626
- if (x > 0) {
627
- const w = window.innerHeight - j * 2, a = parseFloat(C.style.minHeight), f = parseFloat(C.style.height), v = Math.max(a, f);
628
- if (v < w) {
629
- const u = v + x, g = Math.min(w, u), P = u - g;
630
- C.style.height = g + "px", C.style.bottom === "0px" && (S.scrollTop = P > 0 ? P : 0, C.style.justifyContent = "flex-end");
575
+ onScroll: _(l.onScroll, (m) => {
576
+ const v = m.currentTarget, { contentWrapper: w, shouldExpandOnScrollRef: T } = o;
577
+ if (T?.current && w) {
578
+ const I = Math.abs(i.current - v.scrollTop);
579
+ if (I > 0) {
580
+ const C = window.innerHeight - K * 2, d = parseFloat(w.style.minHeight), h = parseFloat(w.style.height), S = Math.max(d, h);
581
+ if (S < C) {
582
+ const u = S + I, g = Math.min(C, u), z = u - g;
583
+ w.style.height = g + "px", w.style.bottom === "0px" && (v.scrollTop = z > 0 ? z : 0, w.style.justifyContent = "flex-end");
631
584
  }
632
585
  }
633
586
  }
634
- l.current = S.scrollTop;
587
+ i.current = v.scrollTop;
635
588
  })
636
589
  }
637
590
  ) })
638
591
  ] });
639
592
  }
640
593
  );
641
- je.displayName = be;
642
- var qe = "SelectGroup", [Qt, eo] = re(qe), Ye = o.forwardRef(
643
- (t, n) => {
644
- const { __scopeSelect: e, ...d } = t, c = Pe();
645
- return /* @__PURE__ */ s(Qt, { scope: e, id: c, children: /* @__PURE__ */ s(k.div, { role: "group", "aria-labelledby": c, ...d, ref: n }) });
594
+ Ke.displayName = ye;
595
+ var ze = "SelectGroup", [Zt, Jt] = ne(ze), Ge = t.forwardRef(
596
+ (r, a) => {
597
+ const { __scopeSelect: e, ...c } = r, l = Ne();
598
+ return /* @__PURE__ */ n(Zt, { scope: e, id: l, children: /* @__PURE__ */ n(L.div, { role: "group", "aria-labelledby": l, ...c, ref: a }) });
646
599
  }
647
600
  );
648
- Ye.displayName = qe;
649
- var $e = "SelectLabel", Xe = o.forwardRef(
650
- (t, n) => {
651
- const { __scopeSelect: e, ...d } = t, c = eo($e, e);
652
- return /* @__PURE__ */ s(k.div, { id: c.id, ...d, ref: n });
601
+ Ge.displayName = ze;
602
+ var je = "SelectLabel", Ye = t.forwardRef(
603
+ (r, a) => {
604
+ const { __scopeSelect: e, ...c } = r, l = Jt(je, e);
605
+ return /* @__PURE__ */ n(L.div, { id: l.id, ...c, ref: a });
653
606
  }
654
607
  );
655
- Xe.displayName = $e;
656
- var pe = "SelectItem", [to, Ze] = re(pe), Je = o.forwardRef(
657
- (t, n) => {
608
+ Ye.displayName = je;
609
+ var pe = "SelectItem", [Qt, qe] = ne(pe), $e = t.forwardRef(
610
+ (r, a) => {
658
611
  const {
659
612
  __scopeSelect: e,
660
- value: d,
661
- disabled: c = !1,
613
+ value: c,
614
+ disabled: l = !1,
662
615
  textValue: p,
663
- ...r
664
- } = t, i = X(pe, e), l = Z(pe, e), m = i.value === d, [S, C] = o.useState(p ?? ""), [b, x] = o.useState(!1), w = U(
665
- n,
666
- (u) => l.itemRefCallback?.(u, d, c)
667
- ), a = Pe(), f = o.useRef("touch"), v = () => {
668
- c || (i.onValueChange(d), i.onOpenChange(!1));
616
+ ...o
617
+ } = r, s = $(pe, e), i = X(pe, e), m = s.value === c, [v, w] = t.useState(p ?? ""), [T, I] = t.useState(!1), C = Y(
618
+ a,
619
+ (u) => i.itemRefCallback?.(u, c, l)
620
+ ), d = Ne(), h = t.useRef("touch"), S = () => {
621
+ l || (s.onValueChange(c), s.onOpenChange(!1));
669
622
  };
670
- if (d === "")
623
+ if (c === "")
671
624
  throw new Error(
672
625
  "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."
673
626
  );
674
- return /* @__PURE__ */ s(
675
- to,
627
+ return /* @__PURE__ */ n(
628
+ Qt,
676
629
  {
677
630
  scope: e,
678
- value: d,
679
- disabled: c,
680
- textId: a,
631
+ value: c,
632
+ disabled: l,
633
+ textId: d,
681
634
  isSelected: m,
682
- onItemTextChange: o.useCallback((u) => {
683
- C((g) => g || (u?.textContent ?? "").trim());
635
+ onItemTextChange: t.useCallback((u) => {
636
+ w((g) => g || (u?.textContent ?? "").trim());
684
637
  }, []),
685
- children: /* @__PURE__ */ s(
686
- me.ItemSlot,
638
+ children: /* @__PURE__ */ n(
639
+ ue.ItemSlot,
687
640
  {
688
641
  scope: e,
689
- value: d,
690
- disabled: c,
691
- textValue: S,
692
- children: /* @__PURE__ */ s(
693
- k.div,
642
+ value: c,
643
+ disabled: l,
644
+ textValue: v,
645
+ children: /* @__PURE__ */ n(
646
+ L.div,
694
647
  {
695
648
  role: "option",
696
- "aria-labelledby": a,
697
- "data-highlighted": b ? "" : void 0,
698
- "aria-selected": m && b,
649
+ "aria-labelledby": d,
650
+ "data-highlighted": T ? "" : void 0,
651
+ "aria-selected": m && T,
699
652
  "data-state": m ? "checked" : "unchecked",
700
- "aria-disabled": c || void 0,
701
- "data-disabled": c ? "" : void 0,
702
- tabIndex: c ? void 0 : -1,
703
- ...r,
704
- ref: w,
705
- onFocus: O(r.onFocus, () => x(!0)),
706
- onBlur: O(r.onBlur, () => x(!1)),
707
- onClick: O(r.onClick, () => {
708
- f.current !== "mouse" && v();
653
+ "aria-disabled": l || void 0,
654
+ "data-disabled": l ? "" : void 0,
655
+ tabIndex: l ? void 0 : -1,
656
+ ...o,
657
+ ref: C,
658
+ onFocus: _(o.onFocus, () => I(!0)),
659
+ onBlur: _(o.onBlur, () => I(!1)),
660
+ onClick: _(o.onClick, () => {
661
+ h.current !== "mouse" && S();
709
662
  }),
710
- onPointerUp: O(r.onPointerUp, () => {
711
- f.current === "mouse" && v();
663
+ onPointerUp: _(o.onPointerUp, () => {
664
+ h.current === "mouse" && S();
712
665
  }),
713
- onPointerDown: O(r.onPointerDown, (u) => {
714
- f.current = u.pointerType;
666
+ onPointerDown: _(o.onPointerDown, (u) => {
667
+ h.current = u.pointerType;
715
668
  }),
716
- onPointerMove: O(r.onPointerMove, (u) => {
717
- f.current = u.pointerType, c ? l.onItemLeave?.() : f.current === "mouse" && u.currentTarget.focus({ preventScroll: !0 });
669
+ onPointerMove: _(o.onPointerMove, (u) => {
670
+ h.current = u.pointerType, l ? i.onItemLeave?.() : h.current === "mouse" && u.currentTarget.focus({ preventScroll: !0 });
718
671
  }),
719
- onPointerLeave: O(r.onPointerLeave, (u) => {
720
- u.currentTarget === document.activeElement && l.onItemLeave?.();
672
+ onPointerLeave: _(o.onPointerLeave, (u) => {
673
+ u.currentTarget === document.activeElement && i.onItemLeave?.();
721
674
  }),
722
- onKeyDown: O(r.onKeyDown, (u) => {
723
- l.searchRef?.current !== "" && u.key === " " || (Wt.includes(u.key) && v(), u.key === " " && u.preventDefault());
675
+ onKeyDown: _(o.onKeyDown, (u) => {
676
+ i.searchRef?.current !== "" && u.key === " " || (Ft.includes(u.key) && S(), u.key === " " && u.preventDefault());
724
677
  })
725
678
  }
726
679
  )
@@ -730,262 +683,262 @@ var pe = "SelectItem", [to, Ze] = re(pe), Je = o.forwardRef(
730
683
  );
731
684
  }
732
685
  );
733
- Je.displayName = pe;
734
- var le = "SelectItemText", Qe = o.forwardRef(
735
- (t, n) => {
736
- const { __scopeSelect: e, className: d, style: c, ...p } = t, r = X(le, e), i = Z(le, e), l = Ze(le, e), m = jt(le, e), [S, C] = o.useState(null), b = U(
737
- n,
738
- (v) => C(v),
739
- l.onItemTextChange,
740
- (v) => i.itemTextRefCallback?.(v, l.value, l.disabled)
741
- ), x = S?.textContent, w = o.useMemo(
742
- () => /* @__PURE__ */ s("option", { value: l.value, disabled: l.disabled, children: x }, l.value),
743
- [l.disabled, l.value, x]
744
- ), { onNativeOptionAdd: a, onNativeOptionRemove: f } = m;
745
- return $(() => (a(w), () => f(w)), [a, f, w]), /* @__PURE__ */ F(ce, { children: [
746
- /* @__PURE__ */ s(k.span, { id: l.textId, ...p, ref: b }),
747
- l.isSelected && r.valueNode && !r.valueNodeHasChildren ? Ae.createPortal(p.children, r.valueNode) : null
686
+ $e.displayName = pe;
687
+ var ie = "SelectItemText", Xe = t.forwardRef(
688
+ (r, a) => {
689
+ const { __scopeSelect: e, className: c, style: l, ...p } = r, o = $(ie, e), s = X(ie, e), i = qe(ie, e), m = zt(ie, e), [v, w] = t.useState(null), T = Y(
690
+ a,
691
+ (S) => w(S),
692
+ i.onItemTextChange,
693
+ (S) => s.itemTextRefCallback?.(S, i.value, i.disabled)
694
+ ), I = v?.textContent, C = t.useMemo(
695
+ () => /* @__PURE__ */ n("option", { value: i.value, disabled: i.disabled, children: I }, i.value),
696
+ [i.disabled, i.value, I]
697
+ ), { onNativeOptionAdd: d, onNativeOptionRemove: h } = m;
698
+ return q(() => (d(C), () => h(C)), [d, h, C]), /* @__PURE__ */ B(ae, { children: [
699
+ /* @__PURE__ */ n(L.span, { id: i.textId, ...p, ref: T }),
700
+ i.isSelected && o.valueNode && !o.valueNodeHasChildren ? Me.createPortal(p.children, o.valueNode) : null
748
701
  ] });
749
702
  }
750
703
  );
751
- Qe.displayName = le;
752
- var et = "SelectItemIndicator", tt = o.forwardRef(
753
- (t, n) => {
754
- const { __scopeSelect: e, ...d } = t;
755
- return Ze(et, e).isSelected ? /* @__PURE__ */ s(k.span, { "aria-hidden": !0, ...d, ref: n }) : null;
704
+ Xe.displayName = ie;
705
+ var Ze = "SelectItemIndicator", Je = t.forwardRef(
706
+ (r, a) => {
707
+ const { __scopeSelect: e, ...c } = r;
708
+ return qe(Ze, e).isSelected ? /* @__PURE__ */ n(L.span, { "aria-hidden": !0, ...c, ref: a }) : null;
756
709
  }
757
710
  );
758
- tt.displayName = et;
759
- var Te = "SelectScrollUpButton", ot = o.forwardRef((t, n) => {
760
- const e = Z(Te, t.__scopeSelect), d = Ee(Te, t.__scopeSelect), [c, p] = o.useState(!1), r = U(n, d.onScrollButtonChange);
761
- return $(() => {
711
+ Je.displayName = Ze;
712
+ var Ie = "SelectScrollUpButton", Qe = t.forwardRef((r, a) => {
713
+ const e = X(Ie, r.__scopeSelect), c = Pe(Ie, r.__scopeSelect), [l, p] = t.useState(!1), o = Y(a, c.onScrollButtonChange);
714
+ return q(() => {
762
715
  if (e.viewport && e.isPositioned) {
763
- let i = function() {
764
- const m = l.scrollTop > 0;
716
+ let s = function() {
717
+ const m = i.scrollTop > 0;
765
718
  p(m);
766
719
  };
767
- const l = e.viewport;
768
- return i(), l.addEventListener("scroll", i), () => l.removeEventListener("scroll", i);
720
+ const i = e.viewport;
721
+ return s(), i.addEventListener("scroll", s), () => i.removeEventListener("scroll", s);
769
722
  }
770
- }, [e.viewport, e.isPositioned]), c ? /* @__PURE__ */ s(
771
- rt,
723
+ }, [e.viewport, e.isPositioned]), l ? /* @__PURE__ */ n(
724
+ tt,
772
725
  {
773
- ...t,
774
- ref: r,
726
+ ...r,
727
+ ref: o,
775
728
  onAutoScroll: () => {
776
- const { viewport: i, selectedItem: l } = e;
777
- i && l && (i.scrollTop = i.scrollTop - l.offsetHeight);
729
+ const { viewport: s, selectedItem: i } = e;
730
+ s && i && (s.scrollTop = s.scrollTop - i.offsetHeight);
778
731
  }
779
732
  }
780
733
  ) : null;
781
734
  });
782
- ot.displayName = Te;
783
- var Re = "SelectScrollDownButton", nt = o.forwardRef((t, n) => {
784
- const e = Z(Re, t.__scopeSelect), d = Ee(Re, t.__scopeSelect), [c, p] = o.useState(!1), r = U(n, d.onScrollButtonChange);
785
- return $(() => {
735
+ Qe.displayName = Ie;
736
+ var be = "SelectScrollDownButton", et = t.forwardRef((r, a) => {
737
+ const e = X(be, r.__scopeSelect), c = Pe(be, r.__scopeSelect), [l, p] = t.useState(!1), o = Y(a, c.onScrollButtonChange);
738
+ return q(() => {
786
739
  if (e.viewport && e.isPositioned) {
787
- let i = function() {
788
- const m = l.scrollHeight - l.clientHeight, S = Math.ceil(l.scrollTop) < m;
789
- p(S);
740
+ let s = function() {
741
+ const m = i.scrollHeight - i.clientHeight, v = Math.ceil(i.scrollTop) < m;
742
+ p(v);
790
743
  };
791
- const l = e.viewport;
792
- return i(), l.addEventListener("scroll", i), () => l.removeEventListener("scroll", i);
744
+ const i = e.viewport;
745
+ return s(), i.addEventListener("scroll", s), () => i.removeEventListener("scroll", s);
793
746
  }
794
- }, [e.viewport, e.isPositioned]), c ? /* @__PURE__ */ s(
795
- rt,
747
+ }, [e.viewport, e.isPositioned]), l ? /* @__PURE__ */ n(
748
+ tt,
796
749
  {
797
- ...t,
798
- ref: r,
750
+ ...r,
751
+ ref: o,
799
752
  onAutoScroll: () => {
800
- const { viewport: i, selectedItem: l } = e;
801
- i && l && (i.scrollTop = i.scrollTop + l.offsetHeight);
753
+ const { viewport: s, selectedItem: i } = e;
754
+ s && i && (s.scrollTop = s.scrollTop + i.offsetHeight);
802
755
  }
803
756
  }
804
757
  ) : null;
805
758
  });
806
- nt.displayName = Re;
807
- var rt = o.forwardRef((t, n) => {
808
- const { __scopeSelect: e, onAutoScroll: d, ...c } = t, p = Z("SelectScrollButton", e), r = o.useRef(null), i = fe(e), l = o.useCallback(() => {
809
- r.current !== null && (window.clearInterval(r.current), r.current = null);
759
+ et.displayName = be;
760
+ var tt = t.forwardRef((r, a) => {
761
+ const { __scopeSelect: e, onAutoScroll: c, ...l } = r, p = X("SelectScrollButton", e), o = t.useRef(null), s = me(e), i = t.useCallback(() => {
762
+ o.current !== null && (window.clearInterval(o.current), o.current = null);
810
763
  }, []);
811
- return o.useEffect(() => () => l(), [l]), $(() => {
812
- i().find((S) => S.ref.current === document.activeElement)?.ref.current?.scrollIntoView({ block: "nearest" });
813
- }, [i]), /* @__PURE__ */ s(
814
- k.div,
764
+ return t.useEffect(() => () => i(), [i]), q(() => {
765
+ s().find((v) => v.ref.current === document.activeElement)?.ref.current?.scrollIntoView({ block: "nearest" });
766
+ }, [s]), /* @__PURE__ */ n(
767
+ L.div,
815
768
  {
816
769
  "aria-hidden": !0,
817
- ...c,
818
- ref: n,
819
- style: { flexShrink: 0, ...c.style },
820
- onPointerDown: O(c.onPointerDown, () => {
821
- r.current === null && (r.current = window.setInterval(d, 50));
770
+ ...l,
771
+ ref: a,
772
+ style: { flexShrink: 0, ...l.style },
773
+ onPointerDown: _(l.onPointerDown, () => {
774
+ o.current === null && (o.current = window.setInterval(c, 50));
822
775
  }),
823
- onPointerMove: O(c.onPointerMove, () => {
824
- p.onItemLeave?.(), r.current === null && (r.current = window.setInterval(d, 50));
776
+ onPointerMove: _(l.onPointerMove, () => {
777
+ p.onItemLeave?.(), o.current === null && (o.current = window.setInterval(c, 50));
825
778
  }),
826
- onPointerLeave: O(c.onPointerLeave, () => {
827
- l();
779
+ onPointerLeave: _(l.onPointerLeave, () => {
780
+ i();
828
781
  })
829
782
  }
830
783
  );
831
- }), oo = "SelectSeparator", st = o.forwardRef(
832
- (t, n) => {
833
- const { __scopeSelect: e, ...d } = t;
834
- return /* @__PURE__ */ s(k.div, { "aria-hidden": !0, ...d, ref: n });
784
+ }), eo = "SelectSeparator", ot = t.forwardRef(
785
+ (r, a) => {
786
+ const { __scopeSelect: e, ...c } = r;
787
+ return /* @__PURE__ */ n(L.div, { "aria-hidden": !0, ...c, ref: a });
835
788
  }
836
789
  );
837
- st.displayName = oo;
838
- var Ne = "SelectArrow", no = o.forwardRef(
839
- (t, n) => {
840
- const { __scopeSelect: e, ...d } = t, c = he(e), p = X(Ne, e), r = Z(Ne, e);
841
- return p.open && r.position === "popper" ? /* @__PURE__ */ s(It, { ...c, ...d, ref: n }) : null;
790
+ ot.displayName = eo;
791
+ var Te = "SelectArrow", to = t.forwardRef(
792
+ (r, a) => {
793
+ const { __scopeSelect: e, ...c } = r, l = fe(e), p = $(Te, e), o = X(Te, e);
794
+ return p.open && o.position === "popper" ? /* @__PURE__ */ n(Tt, { ...l, ...c, ref: a }) : null;
842
795
  }
843
796
  );
844
- no.displayName = Ne;
845
- var ro = "SelectBubbleInput", it = o.forwardRef(
846
- ({ __scopeSelect: t, value: n, ...e }, d) => {
847
- const c = o.useRef(null), p = U(d, c), r = Ft(n);
848
- return o.useEffect(() => {
849
- const i = c.current;
850
- if (!i) return;
851
- const l = window.HTMLSelectElement.prototype, S = Object.getOwnPropertyDescriptor(
852
- l,
797
+ to.displayName = Te;
798
+ var oo = "SelectBubbleInput", nt = t.forwardRef(
799
+ ({ __scopeSelect: r, value: a, ...e }, c) => {
800
+ const l = t.useRef(null), p = Y(c, l), o = gt(a);
801
+ return t.useEffect(() => {
802
+ const s = l.current;
803
+ if (!s) return;
804
+ const i = window.HTMLSelectElement.prototype, v = Object.getOwnPropertyDescriptor(
805
+ i,
853
806
  "value"
854
807
  ).set;
855
- if (r !== n && S) {
856
- const C = new Event("change", { bubbles: !0 });
857
- S.call(i, n), i.dispatchEvent(C);
808
+ if (o !== a && v) {
809
+ const w = new Event("change", { bubbles: !0 });
810
+ v.call(s, a), s.dispatchEvent(w);
858
811
  }
859
- }, [r, n]), /* @__PURE__ */ s(
860
- k.select,
812
+ }, [o, a]), /* @__PURE__ */ n(
813
+ L.select,
861
814
  {
862
815
  ...e,
863
- style: { ...bt, ...e.style },
816
+ style: { ...Nt, ...e.style },
864
817
  ref: p,
865
- defaultValue: n
818
+ defaultValue: a
866
819
  }
867
820
  );
868
821
  }
869
822
  );
870
- it.displayName = ro;
871
- function lt(t) {
872
- return t === "" || t === void 0;
823
+ nt.displayName = oo;
824
+ function rt(r) {
825
+ return r === "" || r === void 0;
873
826
  }
874
- function ct(t) {
875
- const n = ft(t), e = o.useRef(""), d = o.useRef(0), c = o.useCallback(
876
- (r) => {
877
- const i = e.current + r;
878
- n(i), (function l(m) {
879
- e.current = m, window.clearTimeout(d.current), m !== "" && (d.current = window.setTimeout(() => l(""), 1e3));
880
- })(i);
827
+ function st(r) {
828
+ const a = ut(r), e = t.useRef(""), c = t.useRef(0), l = t.useCallback(
829
+ (o) => {
830
+ const s = e.current + o;
831
+ a(s), (function i(m) {
832
+ e.current = m, window.clearTimeout(c.current), m !== "" && (c.current = window.setTimeout(() => i(""), 1e3));
833
+ })(s);
881
834
  },
882
- [n]
883
- ), p = o.useCallback(() => {
884
- e.current = "", window.clearTimeout(d.current);
835
+ [a]
836
+ ), p = t.useCallback(() => {
837
+ e.current = "", window.clearTimeout(c.current);
885
838
  }, []);
886
- return o.useEffect(() => () => window.clearTimeout(d.current), []), [e, c, p];
839
+ return t.useEffect(() => () => window.clearTimeout(c.current), []), [e, l, p];
887
840
  }
888
- function at(t, n, e) {
889
- const c = n.length > 1 && Array.from(n).every((m) => m === n[0]) ? n[0] : n, p = e ? t.indexOf(e) : -1;
890
- let r = so(t, Math.max(p, 0));
891
- c.length === 1 && (r = r.filter((m) => m !== e));
892
- const l = r.find(
893
- (m) => m.textValue.toLowerCase().startsWith(c.toLowerCase())
841
+ function it(r, a, e) {
842
+ const l = a.length > 1 && Array.from(a).every((m) => m === a[0]) ? a[0] : a, p = e ? r.indexOf(e) : -1;
843
+ let o = no(r, Math.max(p, 0));
844
+ l.length === 1 && (o = o.filter((m) => m !== e));
845
+ const i = o.find(
846
+ (m) => m.textValue.toLowerCase().startsWith(l.toLowerCase())
894
847
  );
895
- return l !== e ? l : void 0;
848
+ return i !== e ? i : void 0;
896
849
  }
897
- function so(t, n) {
898
- return t.map((e, d) => t[(n + d) % t.length]);
850
+ function no(r, a) {
851
+ return r.map((e, c) => r[(a + c) % r.length]);
899
852
  }
900
- var io = ke, lo = Be, co = Fe, ao = Ue, uo = We, po = je, mo = Ye, fo = Xe, ho = Je, go = Qe, vo = tt, So = ot, Co = nt, Oe = st;
901
- const wo = mt(
853
+ var ro = Ae, so = Le, io = Ve, ao = Be, lo = He, co = Ke, po = Ge, uo = Ye, mo = $e, fo = Xe, ho = Je, go = Qe, vo = et, _e = ot;
854
+ const So = dt(
902
855
  ({
903
- align: t = "start",
904
- alignOffset: n = 0,
856
+ align: r = "start",
857
+ alignOffset: a = 0,
905
858
  className: e,
906
- collisionPadding: d = 10,
907
- defaultValue: c,
859
+ collisionPadding: c = 10,
860
+ defaultValue: l,
908
861
  emptyMessage: p = "No options found",
909
- errorMessage: r,
910
- id: i,
911
- label: l,
862
+ errorMessage: o,
863
+ id: s,
864
+ label: i,
912
865
  loadingMessage: m = "Loading…",
913
- name: S,
914
- onChange: C,
915
- options: b = [],
916
- placeholder: x = "Select an option",
917
- position: w = "popper",
918
- side: a = "bottom",
919
- sideOffset: f = 4,
920
- state: v = "default",
866
+ name: v,
867
+ onChange: w,
868
+ options: T = [],
869
+ placeholder: I = "Select an option",
870
+ position: C = "popper",
871
+ side: d = "bottom",
872
+ sideOffset: h = 4,
873
+ state: S = "default",
921
874
  value: u,
922
875
  "aria-label": g,
923
- "aria-describedby": P,
924
- ...E
925
- }, V) => {
926
- const T = Tt(i, S), A = Pt(T), { isDisabled: W, isLoading: q, isInvalid: B } = Rt(E.disabled, v), K = Nt(v, B, A, P), { groups: z, ungrouped: H } = Et(b), G = () => {
927
- if (q)
928
- return /* @__PURE__ */ s(Dt, { message: m });
929
- if (b.length === 0)
930
- return /* @__PURE__ */ s(Lt, { message: p });
931
- const M = (R) => {
932
- const D = u === R.value;
933
- return /* @__PURE__ */ F(
934
- ho,
876
+ "aria-describedby": z,
877
+ ...M
878
+ }, Z) => {
879
+ const P = Pt(s, v), O = _t(P), { isDisabled: H, isLoading: G, isInvalid: k } = Rt(M.disabled, S), F = Et(S, k, O, z), { groups: U, ungrouped: V } = Mt(T), W = () => {
880
+ if (G)
881
+ return /* @__PURE__ */ n(kt, { message: m });
882
+ if (T.length === 0)
883
+ return /* @__PURE__ */ n(Vt, { message: p });
884
+ const E = (b) => {
885
+ const A = u === b.value;
886
+ return /* @__PURE__ */ B(
887
+ mo,
935
888
  {
936
- value: R.value,
937
- disabled: R.disabled,
938
- className: ue(
939
- kt(D, !1, R.disabled),
889
+ value: b.value,
890
+ disabled: b.disabled,
891
+ className: de(
892
+ Bt(A, !1, b.disabled),
940
893
  "relative flex w-full cursor-pointer items-center"
941
894
  ),
942
895
  children: [
943
- /* @__PURE__ */ s(go, { className: "block truncate", children: R.label }),
944
- /* @__PURE__ */ s(vo, { asChild: !0, children: /* @__PURE__ */ s("span", { className: "absolute right-2 flex h-4 w-4 items-center justify-center", children: /* @__PURE__ */ s(dt, { size: 16 }) }) })
896
+ /* @__PURE__ */ n(fo, { className: "block truncate", children: b.label }),
897
+ /* @__PURE__ */ n(ho, { asChild: !0, children: /* @__PURE__ */ n("span", { className: "absolute right-2 flex h-4 w-4 items-center justify-center", children: /* @__PURE__ */ n(at, { size: 16 }) }) })
945
898
  ]
946
899
  },
947
- R.value
900
+ b.value
948
901
  );
949
902
  };
950
- return /* @__PURE__ */ F(ce, { children: [
951
- H.length > 0 && /* @__PURE__ */ F(ce, { children: [
952
- H.map(M),
953
- Object.keys(z).length > 0 && /* @__PURE__ */ s(Oe, { className: "bg-border-secondary -mx-1 my-1 h-px" })
903
+ return /* @__PURE__ */ B(ae, { children: [
904
+ V.length > 0 && /* @__PURE__ */ B(ae, { children: [
905
+ V.map(E),
906
+ Object.keys(U).length > 0 && /* @__PURE__ */ n(_e, { className: "bg-border-secondary -mx-1 my-1 h-px" })
954
907
  ] }),
955
- Object.entries(z).map(([R, D], Y) => /* @__PURE__ */ F(mo, { children: [
956
- Y > 0 && /* @__PURE__ */ s(Oe, { className: "bg-border-secondary -mx-1 my-1 h-px" }),
957
- /* @__PURE__ */ s(fo, { className: "text-text-primary px-2 py-1.5 text-base font-semibold", children: R }),
958
- D.map((se) => M(se))
959
- ] }, R))
908
+ Object.entries(U).map(([b, A], j) => /* @__PURE__ */ B(po, { children: [
909
+ j > 0 && /* @__PURE__ */ n(_e, { className: "bg-border-secondary -mx-1 my-1 h-px" }),
910
+ /* @__PURE__ */ n(uo, { className: "text-text-primary px-2 py-1.5 text-base font-semibold", children: b }),
911
+ A.map((re) => E(re))
912
+ ] }, b))
960
913
  ] });
961
914
  };
962
- return /* @__PURE__ */ F("div", { className: "w-full", "data-testid": "select-root", children: [
963
- l && /* @__PURE__ */ s(pt, { htmlFor: T, className: ue("text-text-primary mb-4 block", W && "text-text-secondary"), children: l }),
964
- /* @__PURE__ */ F(
965
- io,
915
+ return /* @__PURE__ */ B("div", { className: "w-full", "data-testid": "select-root", children: [
916
+ i && /* @__PURE__ */ n(ct, { htmlFor: P, className: de("text-text-primary mb-4 block", H && "text-text-secondary"), children: i }),
917
+ /* @__PURE__ */ B(
918
+ ro,
966
919
  {
967
920
  value: u,
968
- defaultValue: c,
969
- onValueChange: C,
970
- disabled: W,
971
- name: S,
972
- required: E.required,
921
+ defaultValue: l,
922
+ onValueChange: w,
923
+ disabled: H,
924
+ name: v,
925
+ required: M.required,
973
926
  children: [
974
- /* @__PURE__ */ s(
975
- lo,
927
+ /* @__PURE__ */ n(
928
+ so,
976
929
  {
977
- ref: V,
978
- id: T,
979
- className: ue(Ot(v, !1), Mt(v), e),
980
- "aria-label": g || l,
981
- "data-state": v,
982
- style: _t(),
983
- ...K,
984
- ...E,
930
+ ref: Z,
931
+ id: P,
932
+ className: de(Dt(S, !1), At(S), e),
933
+ "aria-label": g || i,
934
+ "data-state": S,
935
+ style: Ot(),
936
+ ...F,
937
+ ...M,
985
938
  asChild: !0,
986
- children: /* @__PURE__ */ F("button", { type: "button", children: [
987
- /* @__PURE__ */ s(co, { placeholder: x, className: "block truncate" }),
988
- /* @__PURE__ */ s(ao, { asChild: !0, children: /* @__PURE__ */ s("div", { className: "flex items-center", children: q ? /* @__PURE__ */ s(ut, { size: 20 }) : /* @__PURE__ */ s(
939
+ children: /* @__PURE__ */ B("button", { type: "button", children: [
940
+ /* @__PURE__ */ n(io, { placeholder: I, className: "block truncate" }),
941
+ /* @__PURE__ */ n(ao, { asChild: !0, children: /* @__PURE__ */ n("div", { className: "flex items-center", children: G ? /* @__PURE__ */ n(lt, { size: 20 }) : /* @__PURE__ */ n(
989
942
  xe,
990
943
  {
991
944
  className: "transition-transform duration-200 data-[state=open]:rotate-180",
@@ -995,20 +948,20 @@ const wo = mt(
995
948
  ] })
996
949
  }
997
950
  ),
998
- /* @__PURE__ */ s(
999
- uo,
951
+ /* @__PURE__ */ n(
952
+ lo,
1000
953
  {
1001
- position: w,
1002
- side: a,
1003
- align: t,
1004
- sideOffset: f,
1005
- alignOffset: n,
1006
- collisionPadding: d,
954
+ position: C,
955
+ side: d,
956
+ align: r,
957
+ sideOffset: h,
958
+ alignOffset: a,
959
+ collisionPadding: c,
1007
960
  asChild: !0,
1008
- children: /* @__PURE__ */ F(
961
+ children: /* @__PURE__ */ B(
1009
962
  "div",
1010
963
  {
1011
- className: ue(
964
+ className: de(
1012
965
  "border-input-border bg-input-bg z-50 rounded-lg border shadow-md",
1013
966
  "data-[state=open]:animate-in data-[state=closed]:animate-out",
1014
967
  "data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0",
@@ -1025,9 +978,9 @@ const wo = mt(
1025
978
  maxHeight: "var(--radix-select-content-available-height)"
1026
979
  },
1027
980
  children: [
1028
- /* @__PURE__ */ s(So, { className: "flex cursor-default items-center justify-center py-1", children: /* @__PURE__ */ s(xe, { className: "rotate-180", size: 18 }) }),
1029
- /* @__PURE__ */ s(po, { asChild: !0, children: /* @__PURE__ */ s("div", { className: "max-h-96 p-1", style: { position: "relative", overflow: "hidden auto" }, children: G() }) }),
1030
- /* @__PURE__ */ s(Co, { className: "flex cursor-default items-center justify-center py-1", children: /* @__PURE__ */ s(xe, { size: 18 }) })
981
+ /* @__PURE__ */ n(go, { className: "flex cursor-default items-center justify-center py-1", children: /* @__PURE__ */ n(xe, { className: "rotate-180", size: 18 }) }),
982
+ /* @__PURE__ */ n(co, { asChild: !0, children: /* @__PURE__ */ n("div", { className: "max-h-96 p-1", style: { position: "relative", overflow: "hidden auto" }, children: W() }) }),
983
+ /* @__PURE__ */ n(vo, { className: "flex cursor-default items-center justify-center py-1", children: /* @__PURE__ */ n(xe, { size: 18 }) })
1031
984
  ]
1032
985
  }
1033
986
  )
@@ -1036,11 +989,11 @@ const wo = mt(
1036
989
  ]
1037
990
  }
1038
991
  ),
1039
- B && r && /* @__PURE__ */ s(At, { id: A, message: r })
992
+ k && o && /* @__PURE__ */ n(Lt, { id: O, message: o })
1040
993
  ] });
1041
994
  }
1042
995
  );
1043
- wo.displayName = "Select";
996
+ So.displayName = "Select";
1044
997
  export {
1045
- wo as Select
998
+ So as Select
1046
999
  };