@strapi/ui-primitives 1.7.4 → 1.7.5

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/index.js CHANGED
@@ -1,32 +1,32 @@
1
1
  import { jsx as d, jsxs as Ne, Fragment as Ae } from "react/jsx-runtime";
2
- import * as l from "react";
3
- import { composeEventHandlers as E } from "@radix-ui/primitive";
2
+ import * as r from "react";
3
+ import { composeEventHandlers as T } from "@radix-ui/primitive";
4
4
  import { useComposedRefs as _ } from "@radix-ui/react-compose-refs";
5
5
  import { createContextScope as Qe, createContext as et } from "@radix-ui/react-context";
6
6
  import { DismissableLayer as tt } from "@radix-ui/react-dismissable-layer";
7
- import { useId as oe } from "@radix-ui/react-id";
8
- import * as re from "@radix-ui/react-popper";
9
- import { createPopperScope as ot } from "@radix-ui/react-popper";
10
- import { Portal as nt } from "@radix-ui/react-portal";
7
+ import { useFocusGuards as ot } from "@radix-ui/react-focus-guards";
8
+ import { FocusScope as nt } from "@radix-ui/react-focus-scope";
9
+ import { useId as ne } from "@radix-ui/react-id";
10
+ import * as le from "@radix-ui/react-popper";
11
+ import { createPopperScope as rt } from "@radix-ui/react-popper";
12
+ import { Portal as lt } from "@radix-ui/react-portal";
11
13
  import { Primitive as N } from "@radix-ui/react-primitive";
12
14
  import { useControllableState as ie } from "@radix-ui/react-use-controllable-state";
13
- import { useLayoutEffect as B } from "@radix-ui/react-use-layout-effect";
14
- import { hideOthers as rt } from "aria-hidden";
15
+ import { useLayoutEffect as H } from "@radix-ui/react-use-layout-effect";
16
+ import { hideOthers as st } from "aria-hidden";
15
17
  import * as _e from "react-dom";
16
- import { RemoveScroll as lt } from "react-remove-scroll";
18
+ import { RemoveScroll as ct } from "react-remove-scroll";
17
19
  import { Slot as Ie } from "@radix-ui/react-slot";
18
20
  import { clamp as Ze } from "@radix-ui/number";
19
- import { createCollection as Pt } from "@radix-ui/react-collection";
20
- import { useDirection as Vt } from "@radix-ui/react-direction";
21
- import { useFocusGuards as Rt } from "@radix-ui/react-focus-guards";
22
- import { FocusScope as Nt } from "@radix-ui/react-focus-scope";
21
+ import { createCollection as Rt } from "@radix-ui/react-collection";
22
+ import { useDirection as Nt } from "@radix-ui/react-direction";
23
23
  import { useCallbackRef as At } from "@radix-ui/react-use-callback-ref";
24
24
  import { useCallbackRef as Rn } from "@radix-ui/react-use-callback-ref";
25
25
  import { usePrevious as _t } from "@radix-ui/react-use-previous";
26
26
  import { VisuallyHidden as Mt } from "@radix-ui/react-visually-hidden";
27
27
  let ye = /* @__PURE__ */ new Map();
28
28
  function Ot(n, s) {
29
- let e = n + (s ? Object.entries(s).sort((o, r) => o[0] < r[0] ? -1 : 1).join() : "");
29
+ let e = n + (s ? Object.entries(s).sort((o, l) => o[0] < l[0] ? -1 : 1).join() : "");
30
30
  if (ye.has(e))
31
31
  return ye.get(e);
32
32
  let t = new Intl.Collator(n, s);
@@ -48,9 +48,9 @@ function Me(n, s) {
48
48
  if (o.length === 0)
49
49
  return !0;
50
50
  t = t.normalize("NFC"), o = o.normalize("NFC");
51
- let r = 0, i = o.length;
52
- for (; r + i <= t.length; r++) {
53
- let c = t.slice(r, r + i);
51
+ let l = 0, i = o.length;
52
+ for (; l + i <= t.length; l++) {
53
+ let c = t.slice(l, l + i);
54
54
  if (e.compare(o, c) === 0)
55
55
  return !0;
56
56
  }
@@ -59,101 +59,101 @@ function Me(n, s) {
59
59
  };
60
60
  }
61
61
  const Dt = (n) => {
62
- const s = l.useRef();
63
- return l.useEffect(() => {
62
+ const s = r.useRef();
63
+ return r.useEffect(() => {
64
64
  s.current = n;
65
65
  }), s.current;
66
66
  };
67
67
  function kt(n) {
68
- const s = `${n}CollectionProvider`, [e, t] = Qe(s), [o, r] = e(s, {
68
+ const s = `${n}CollectionProvider`, [e, t] = Qe(s), [o, l] = e(s, {
69
69
  collectionRef: { current: null },
70
70
  itemMap: /* @__PURE__ */ new Map(),
71
71
  listeners: /* @__PURE__ */ new Set()
72
72
  }), i = (u) => {
73
- const { scope: p, children: g } = u, C = l.useRef(null), v = l.useRef(/* @__PURE__ */ new Map()).current, x = l.useRef(/* @__PURE__ */ new Set()).current;
74
- return /* @__PURE__ */ d(o, { scope: p, itemMap: v, collectionRef: C, listeners: x, children: g });
73
+ const { scope: m, children: S } = u, x = r.useRef(null), C = r.useRef(/* @__PURE__ */ new Map()).current, h = r.useRef(/* @__PURE__ */ new Set()).current;
74
+ return /* @__PURE__ */ d(o, { scope: m, itemMap: C, collectionRef: x, listeners: h, children: S });
75
75
  };
76
76
  i.displayName = s;
77
- const c = `${n}CollectionSlot`, a = l.forwardRef((u, p) => {
78
- const { scope: g, children: C } = u, v = r(c, g), x = _(p, v.collectionRef);
79
- return /* @__PURE__ */ d(Ie, { ref: x, children: C });
77
+ const c = `${n}CollectionSlot`, a = r.forwardRef((u, m) => {
78
+ const { scope: S, children: x } = u, C = l(c, S), h = _(m, C.collectionRef);
79
+ return /* @__PURE__ */ d(Ie, { ref: h, children: x });
80
80
  });
81
81
  a.displayName = c;
82
- const m = `${n}CollectionItemSlot`, f = "data-radix-collection-item", S = l.forwardRef((u, p) => {
83
- const { scope: g, children: C, ...v } = u, x = l.useRef(null), w = _(p, x), A = r(m, g);
84
- return l.useEffect(() => {
85
- const T = Array.from(A.itemMap.values());
86
- return A.itemMap.set(x, { ref: x, ...v }), A.listeners.forEach((M) => M(Array.from(A.itemMap.values()), T)), () => {
82
+ const g = `${n}CollectionItemSlot`, f = "data-radix-collection-item", v = r.forwardRef((u, m) => {
83
+ const { scope: S, children: x, ...C } = u, h = r.useRef(null), w = _(m, h), A = l(g, S);
84
+ return r.useEffect(() => {
85
+ const V = Array.from(A.itemMap.values());
86
+ return A.itemMap.set(h, { ref: h, ...C }), A.listeners.forEach((M) => M(Array.from(A.itemMap.values()), V)), () => {
87
87
  const M = Array.from(A.itemMap.values());
88
- A.itemMap.delete(x), A.listeners.forEach((P) => P(Array.from(A.itemMap.values()), M));
88
+ A.itemMap.delete(h), A.listeners.forEach((E) => E(Array.from(A.itemMap.values()), M));
89
89
  };
90
- }), /* @__PURE__ */ d(Ie, { [f]: "", ref: w, children: C });
90
+ }), /* @__PURE__ */ d(Ie, { [f]: "", ref: w, children: x });
91
91
  });
92
- S.displayName = m;
93
- function h(u) {
94
- const p = r(`${n}CollectionConsumer`, u), g = l.useCallback(() => {
95
- const v = p.collectionRef.current;
96
- if (!v)
92
+ v.displayName = g;
93
+ function p(u) {
94
+ const m = l(`${n}CollectionConsumer`, u), S = r.useCallback(() => {
95
+ const C = m.collectionRef.current;
96
+ if (!C)
97
97
  return [];
98
- const x = Array.from(v.querySelectorAll(`[${f}]`));
99
- return Array.from(p.itemMap.values()).sort(
100
- (T, M) => x.indexOf(T.ref.current) - x.indexOf(M.ref.current)
98
+ const h = Array.from(C.querySelectorAll(`[${f}]`));
99
+ return Array.from(m.itemMap.values()).sort(
100
+ (V, M) => h.indexOf(V.ref.current) - h.indexOf(M.ref.current)
101
101
  );
102
- }, [p.collectionRef, p.itemMap]), C = l.useCallback(
103
- (v) => (p.listeners.add(v), () => p.listeners.delete(v)),
104
- [p.listeners]
102
+ }, [m.collectionRef, m.itemMap]), x = r.useCallback(
103
+ (C) => (m.listeners.add(C), () => m.listeners.delete(C)),
104
+ [m.listeners]
105
105
  );
106
- return { getItems: g, subscribe: C };
106
+ return { getItems: S, subscribe: x };
107
107
  }
108
108
  return [
109
- { Provider: i, Slot: a, ItemSlot: S },
110
- h,
109
+ { Provider: i, Slot: a, ItemSlot: v },
110
+ p,
111
111
  t
112
112
  ];
113
113
  }
114
- const Ft = [" ", "Enter", "ArrowUp", "ArrowDown"], Lt = ["Enter"], Je = (n) => !!(n.length === 1 && n.match(/\S| /)), st = "Combobox", [pe, me] = kt(st), [Bt, j] = et(st), Ht = ({ children: n }) => /* @__PURE__ */ d(re.Root, { children: /* @__PURE__ */ d(pe.Provider, { scope: void 0, children: n }) }), $t = (n) => {
114
+ const Ft = [" ", "Enter", "ArrowUp", "ArrowDown"], Lt = ["Enter"], Je = (n) => !!(n.length === 1 && n.match(/\S| /)), it = "Combobox", [pe, xe] = kt(it), [Bt, Y] = et(it), Ht = ({ children: n }) => /* @__PURE__ */ d(le.Root, { children: /* @__PURE__ */ d(pe.Provider, { scope: void 0, children: n }) }), $t = (n) => {
115
115
  const {
116
116
  allowCustomValue: s = !1,
117
117
  autocomplete: e = "none",
118
118
  children: t,
119
119
  open: o,
120
- defaultOpen: r,
120
+ defaultOpen: l,
121
121
  onOpenChange: i,
122
122
  value: c,
123
123
  defaultValue: a,
124
- onValueChange: m,
124
+ onValueChange: g,
125
125
  disabled: f,
126
- required: S = !1,
127
- locale: h = "en-EN",
126
+ required: v = !1,
127
+ locale: p = "en-EN",
128
128
  onTextValueChange: u,
129
- textValue: p,
130
- defaultTextValue: g,
131
- filterValue: C,
132
- defaultFilterValue: v,
133
- onFilterValueChange: x
134
- } = n, [w, A] = l.useState(null), [T, M] = l.useState(null), [P, k] = l.useState(null), [H, z] = l.useState(null), [$ = !1, O] = ie({
129
+ textValue: m,
130
+ defaultTextValue: S,
131
+ filterValue: x,
132
+ defaultFilterValue: C,
133
+ onFilterValueChange: h
134
+ } = n, [w, A] = r.useState(null), [V, M] = r.useState(null), [E, k] = r.useState(null), [$, G] = r.useState(null), [F = !1, O] = ie({
135
135
  prop: o,
136
- defaultProp: r,
136
+ defaultProp: l,
137
137
  onChange: i
138
- }), [F, L] = ie({
138
+ }), [L, B] = ie({
139
139
  prop: c,
140
140
  defaultProp: a,
141
- onChange: m
141
+ onChange: g
142
142
  }), [U, K] = ie({
143
- prop: p,
144
- defaultProp: g,
143
+ prop: m,
144
+ defaultProp: S,
145
145
  onChange: u
146
- }), [q, X] = ie({
147
- prop: C,
148
- defaultProp: v,
149
- onChange: x
150
- }), W = oe(), ue = l.useCallback(
151
- (le, se) => {
152
- const de = se.map((y) => y.ref.current), [Z, ...ce] = de, [Q] = ce.slice(-1), b = H;
153
- for (const y of le) {
146
+ }), [X, Z] = ie({
147
+ prop: x,
148
+ defaultProp: C,
149
+ onChange: h
150
+ }), W = ne(), ue = r.useCallback(
151
+ (z, se) => {
152
+ const de = se.map((y) => y.ref.current), [J, ...ce] = de, [ee] = ce.slice(-1), b = $;
153
+ for (const y of z) {
154
154
  if (y === b)
155
155
  return;
156
- if (y?.scrollIntoView({ block: "nearest" }), y === Z && T && (T.scrollTop = 0), y === Q && T && (T.scrollTop = T.scrollHeight), z(y), e === "both") {
156
+ if (y?.scrollIntoView({ block: "nearest" }), y === J && V && (V.scrollTop = 0), y === ee && V && (V.scrollTop = V.scrollHeight), G(y), e === "both") {
157
157
  const D = se.find((I) => I.ref.current === y);
158
158
  D && K(D.textValue);
159
159
  }
@@ -161,58 +161,70 @@ const Ft = [" ", "Enter", "ArrowUp", "ArrowDown"], Lt = ["Enter"], Je = (n) => !
161
161
  return;
162
162
  }
163
163
  },
164
- [e, K, T, H]
164
+ [e, K, V, $]
165
165
  );
166
- return l.useEffect(() => {
167
- e !== "both" && z(null);
168
- }, [U, e]), l.useEffect(() => {
169
- if (P && w)
170
- return rt([P, w]);
171
- }, [P, w]), /* @__PURE__ */ d(Ht, { children: /* @__PURE__ */ d(
166
+ return r.useEffect(() => {
167
+ e !== "both" && G(null);
168
+ }, [U, e]), r.useEffect(() => {
169
+ if (E && w)
170
+ return st([E, w]);
171
+ }, [E, w]), /* @__PURE__ */ d(Ht, { children: /* @__PURE__ */ d(
172
172
  Bt,
173
173
  {
174
174
  allowCustomValue: s,
175
175
  autocomplete: e,
176
- required: S,
176
+ required: v,
177
177
  trigger: w,
178
178
  onTriggerChange: A,
179
179
  contentId: W,
180
- value: F,
181
- onValueChange: L,
182
- open: $,
180
+ value: L,
181
+ onValueChange: B,
182
+ open: F,
183
183
  onOpenChange: O,
184
184
  disabled: f,
185
- locale: h,
185
+ locale: p,
186
186
  focusFirst: ue,
187
187
  textValue: U,
188
188
  onTextValueChange: K,
189
189
  onViewportChange: M,
190
190
  onContentChange: k,
191
- visuallyFocussedItem: H,
192
- filterValue: q,
193
- onFilterValueChange: X,
194
- onVisuallyFocussedItemChange: z,
195
- children: t
191
+ visuallyFocussedItem: $,
192
+ filterValue: X,
193
+ onFilterValueChange: Z,
194
+ onVisuallyFocussedItemChange: G,
195
+ children: /* @__PURE__ */ d(
196
+ nt,
197
+ {
198
+ trapped: F,
199
+ onMountAutoFocus: (z) => {
200
+ z.preventDefault();
201
+ },
202
+ onUnmountAutoFocus: (z) => {
203
+ w?.focus({ preventScroll: !0 }), document.getSelection()?.empty(), z.preventDefault();
204
+ },
205
+ children: t
206
+ }
207
+ )
196
208
  }
197
209
  ) });
198
- }, Ut = "ComboboxTrigger", Kt = l.forwardRef((n, s) => {
199
- const { ...e } = n, t = j(Ut);
200
- return /* @__PURE__ */ d(re.Anchor, { asChild: !0, children: /* @__PURE__ */ d("div", { ref: s, "data-disabled": t.disabled ? "" : void 0, ...e }) });
201
- }), ct = "ComboboxInput", Wt = l.forwardRef((n, s) => {
202
- const e = j(ct), t = l.useRef(null), { getItems: o } = me(void 0), { startsWith: r } = Me(e.locale, { sensitivity: "base" }), i = e.disabled, c = _(t, s, e.onTriggerChange), a = () => {
210
+ }, Ut = "ComboboxTrigger", Kt = r.forwardRef((n, s) => {
211
+ const { ...e } = n, t = Y(Ut);
212
+ return /* @__PURE__ */ d(le.Anchor, { asChild: !0, children: /* @__PURE__ */ d("div", { ref: s, "data-disabled": t.disabled ? "" : void 0, ...e }) });
213
+ }), at = "ComboboxInput", Wt = r.forwardRef((n, s) => {
214
+ const e = Y(at), t = r.useRef(null), { getItems: o } = xe(void 0), { startsWith: l } = Me(e.locale, { sensitivity: "base" }), i = e.disabled, c = _(t, s, e.onTriggerChange), a = () => {
203
215
  i || e.onOpenChange(!0);
204
- }, m = Dt(e.filterValue);
205
- return B(() => {
216
+ }, g = Dt(e.filterValue);
217
+ return H(() => {
206
218
  const f = setTimeout(() => {
207
219
  if (e.textValue === "" || e.textValue === void 0 || e.filterValue === "" || e.filterValue === void 0)
208
220
  return;
209
- const S = o().find(
210
- (u) => u.type === "option" && r(u.textValue, e.textValue)
211
- ), h = vo(m ?? "", e.filterValue);
212
- S && !e.visuallyFocussedItem && h === e.filterValue.length && t.current.setSelectionRange(e.filterValue.length, e.textValue.length);
221
+ const v = o().find(
222
+ (u) => u.type === "option" && l(u.textValue, e.textValue)
223
+ ), p = vo(g ?? "", e.filterValue);
224
+ v && !e.visuallyFocussedItem && p === e.filterValue.length && t.current.setSelectionRange(e.filterValue.length, e.textValue.length);
213
225
  });
214
226
  return () => clearTimeout(f);
215
- }, [e.textValue, e.filterValue, r, e.visuallyFocussedItem, o, m]), /* @__PURE__ */ d(
227
+ }, [e.textValue, e.filterValue, l, e.visuallyFocussedItem, o, g]), /* @__PURE__ */ d(
216
228
  "input",
217
229
  {
218
230
  type: "text",
@@ -230,135 +242,140 @@ const Ft = [" ", "Enter", "ArrowUp", "ArrowDown"], Lt = ["Enter"], Je = (n) => !
230
242
  value: e.textValue ?? "",
231
243
  ...n,
232
244
  ref: c,
233
- onClick: E(n.onClick, (f) => {
245
+ onClick: T(n.onClick, (f) => {
234
246
  f.currentTarget.focus();
235
247
  }),
236
- onPointerDown: E(n.onPointerDown, (f) => {
248
+ onPointerDown: T(n.onPointerDown, (f) => {
237
249
  f.button === 0 && f.ctrlKey === !1 && (a(), f.currentTarget.focus());
238
250
  }),
239
- onKeyDown: E(n.onKeyDown, (f) => {
251
+ onKeyDown: T(n.onKeyDown, (f) => {
240
252
  if (["ArrowUp", "ArrowDown", "Home", "End"].includes(f.key))
241
253
  setTimeout(() => {
242
- let h = o().filter((u) => !u.disabled).map((u) => u.ref.current);
243
- if (["ArrowUp", "End"].includes(f.key) && (h = h.slice().reverse()), ["ArrowUp", "ArrowDown"].includes(f.key)) {
254
+ let p = o().filter((u) => !u.disabled).map((u) => u.ref.current);
255
+ if (["ArrowUp", "End"].includes(f.key) && (p = p.slice().reverse()), ["ArrowUp", "ArrowDown"].includes(f.key)) {
244
256
  const u = e.visuallyFocussedItem ?? f.target;
245
- let p = h.indexOf(u);
246
- p === h.length - 1 && (p = -1), h = h.slice(p + 1);
257
+ let m = p.indexOf(u);
258
+ m === p.length - 1 && (m = -1), p = p.slice(m + 1);
247
259
  }
248
- if (["ArrowDown"].includes(f.key) && e.autocomplete === "both" && h.length > 1) {
249
- const [u, ...p] = h, g = o().find((C) => C.ref.current === u).textValue;
250
- e.textValue === g && (h = p);
260
+ if (["ArrowDown"].includes(f.key) && e.autocomplete === "both" && p.length > 1) {
261
+ const [u, ...m] = p, S = o().find((x) => x.ref.current === u).textValue;
262
+ e.textValue === S && (p = m);
251
263
  }
252
- e.focusFirst(h, o());
264
+ e.focusFirst(p, o());
253
265
  }), f.preventDefault();
254
266
  else if (["Escape"].includes(f.key))
255
267
  e.open ? e.onOpenChange(!1) : (e.onValueChange(void 0), e.onTextValueChange("")), f.preventDefault();
256
268
  else if (Lt.includes(f.key)) {
257
269
  if (e.visuallyFocussedItem) {
258
- const S = o().find((h) => h.ref.current === e.visuallyFocussedItem);
259
- S && (e.onValueChange(S.value), e.onTextValueChange(S.textValue), e.autocomplete === "both" && e.onFilterValueChange(S.textValue), S.ref.current?.click());
270
+ const v = o().find((p) => p.ref.current === e.visuallyFocussedItem);
271
+ v && (e.onValueChange(v.value), e.onTextValueChange(v.textValue), e.autocomplete === "both" && e.onFilterValueChange(v.textValue), v.ref.current?.click());
260
272
  } else {
261
- const S = o().find(
262
- (h) => h.type === "option" && !h.disabled && h.textValue === e.textValue
273
+ const v = o().find(
274
+ (p) => p.type === "option" && !p.disabled && p.textValue === e.textValue
263
275
  );
264
- S && (e.onValueChange(S.value), e.onTextValueChange(S.textValue), e.autocomplete === "both" && e.onFilterValueChange(S.textValue), S.ref.current?.click());
276
+ v && (e.onValueChange(v.value), e.onTextValueChange(v.textValue), e.autocomplete === "both" && e.onFilterValueChange(v.textValue), v.ref.current?.click());
265
277
  }
266
278
  e.onOpenChange(!1), f.preventDefault();
267
279
  } else
268
280
  e.onVisuallyFocussedItemChange(null);
269
281
  }),
270
- onChange: E(n.onChange, (f) => {
282
+ onChange: T(n.onChange, (f) => {
271
283
  e.onTextValueChange(f.currentTarget.value), e.autocomplete === "both" && e.onFilterValueChange(f.currentTarget.value);
272
284
  }),
273
- onKeyUp: E(n.onKeyUp, (f) => {
285
+ onKeyUp: T(n.onKeyUp, (f) => {
274
286
  !e.open && (Je(f.key) || ["ArrowUp", "ArrowDown", "Home", "End", "Backspace"].includes(f.key)) && a(), setTimeout(() => {
275
287
  if (e.autocomplete === "both" && Je(f.key) && e.filterValue !== void 0) {
276
- const S = e.filterValue, h = o().find((u) => r(u.textValue, S));
277
- h && e.onTextValueChange(h.textValue);
288
+ const v = e.filterValue, p = o().find((u) => l(u.textValue, v));
289
+ p && e.onTextValueChange(p.textValue);
278
290
  }
279
291
  });
292
+ }),
293
+ onBlur: T(n.onBlur, () => {
294
+ e.onVisuallyFocussedItemChange(null);
295
+ const [f] = o().filter(
296
+ (p) => p.textValue === e.textValue && p.type === "option"
297
+ );
298
+ if (e.allowCustomValue) {
299
+ f && (e.onValueChange(f.value), e.autocomplete === "both" && e.onFilterValueChange(f.textValue));
300
+ return;
301
+ }
302
+ const [v] = o().filter((p) => p.value === e.value && p.type === "option");
303
+ f ? e.onValueChange(f.value) : v && e.textValue !== "" ? (e.onTextValueChange(v.textValue), e.autocomplete === "both" && e.onFilterValueChange(v.textValue)) : (e.onValueChange(void 0), e.onTextValueChange(""));
280
304
  })
281
305
  }
282
306
  );
283
- }), zt = l.forwardRef((n, s) => {
284
- const { children: e, ...t } = n, o = j(ct), r = o.disabled, i = () => {
285
- r || (o.onOpenChange(!0), o.trigger?.focus());
307
+ }), zt = r.forwardRef((n, s) => {
308
+ const { children: e, ...t } = n, o = Y(at), l = o.disabled, i = () => {
309
+ l || (o.onOpenChange(!0), o.trigger?.focus());
286
310
  };
287
311
  return /* @__PURE__ */ d(
288
312
  N.button,
289
313
  {
290
314
  "aria-hidden": !0,
291
315
  type: "button",
292
- "aria-disabled": r,
316
+ "aria-disabled": l,
293
317
  "aria-controls": o.contentId,
294
318
  "aria-expanded": o.open,
295
- disabled: r,
296
- "data-disabled": r ? "" : void 0,
319
+ disabled: l,
320
+ "data-disabled": l ? "" : void 0,
297
321
  ...t,
298
322
  tabIndex: -1,
299
323
  ref: s,
300
- onClick: E(t.onClick, () => {
324
+ onClick: T(t.onClick, () => {
301
325
  o.trigger?.focus();
302
326
  }),
303
- onPointerDown: E(t.onPointerDown, (c) => {
327
+ onPointerDown: T(t.onPointerDown, (c) => {
304
328
  c.button === 0 && c.ctrlKey === !1 && (i(), c.preventDefault());
305
329
  }),
306
- onKeyDown: E(t.onKeyDown, (c) => {
330
+ onKeyDown: T(t.onKeyDown, (c) => {
307
331
  Ft.includes(c.key) && (i(), c.preventDefault());
308
332
  }),
309
333
  children: e || "▼"
310
334
  }
311
335
  );
312
- }), Gt = "ComboboxPortal", it = (n) => /* @__PURE__ */ d(nt, { asChild: !0, ...n });
313
- it.displayName = Gt;
314
- const at = "ComboboxContent", jt = l.forwardRef((n, s) => {
315
- const e = j(at), [t, o] = l.useState();
316
- if (B(() => {
336
+ }), Gt = "ComboboxPortal", ut = (n) => /* @__PURE__ */ d(lt, { asChild: !0, ...n });
337
+ ut.displayName = Gt;
338
+ const dt = "ComboboxContent", jt = r.forwardRef((n, s) => {
339
+ const e = Y(dt), [t, o] = r.useState();
340
+ if (H(() => {
317
341
  o(new DocumentFragment());
318
342
  }, []), !e.open) {
319
- const r = t;
320
- return r ? _e.createPortal(
343
+ const l = t;
344
+ return l ? _e.createPortal(
321
345
  /* @__PURE__ */ d(pe.Slot, { scope: void 0, children: /* @__PURE__ */ d("div", { children: n.children }) }),
322
- r
346
+ l
323
347
  ) : null;
324
348
  }
325
349
  return /* @__PURE__ */ d(qt, { ...n, ref: s });
326
- }), Yt = 10, qt = l.forwardRef(
350
+ }), Yt = 10, qt = r.forwardRef(
327
351
  (n, s) => {
328
- const { onEscapeKeyDown: e, onPointerDownOutside: t, ...o } = n, r = j(at), i = _(s, (g) => r.onContentChange(g)), { onOpenChange: c, onValueChange: a, onFilterValueChange: m, onTextValueChange: f, textValue: S, value: h } = r, { getItems: u } = me(void 0), p = l.useCallback(() => {
329
- r.onVisuallyFocussedItemChange(null);
330
- const [g] = u().filter((v) => v.textValue === S && v.type === "option");
331
- if (r.allowCustomValue) {
332
- g && (a(g.value), r.autocomplete === "both" && m(g.textValue));
333
- return;
334
- }
335
- const [C] = u().filter((v) => v.value === h && v.type === "option");
336
- g ? a(g.value) : C && S !== "" ? (f(C.textValue), r.autocomplete === "both" && m(C.textValue)) : (a(void 0), f(""));
337
- }, [r, u, m, f, a, S, h]);
338
- return l.useEffect(() => {
339
- const g = () => {
340
- p(), c(!1);
352
+ const { onEscapeKeyDown: e, onPointerDownOutside: t, ...o } = n, l = Y(dt), i = _(s, (a) => l.onContentChange(a)), { onOpenChange: c } = l;
353
+ return ot(), r.useEffect(() => {
354
+ const a = () => {
355
+ c(!1);
341
356
  };
342
- return window.addEventListener("blur", g), window.addEventListener("resize", g), () => {
343
- window.removeEventListener("blur", g), window.removeEventListener("resize", g);
357
+ return window.addEventListener("blur", a), window.addEventListener("resize", a), () => {
358
+ window.removeEventListener("blur", a), window.removeEventListener("resize", a);
344
359
  };
345
- }, [p, c]), /* @__PURE__ */ d(lt, { allowPinchZoom: !0, children: /* @__PURE__ */ d(
360
+ }, [c]), /* @__PURE__ */ d(ct, { allowPinchZoom: !0, children: /* @__PURE__ */ d(
346
361
  tt,
347
362
  {
348
363
  asChild: !0,
349
364
  onEscapeKeyDown: e,
350
365
  onPointerDownOutside: t,
351
- onFocusOutside: (g) => g.preventDefault(),
366
+ onFocusOutside: (a) => {
367
+ a.preventDefault();
368
+ },
352
369
  onDismiss: () => {
353
- r.onOpenChange(!1), r.trigger?.focus({ preventScroll: !0 }), p();
370
+ l.onOpenChange(!1), l.trigger?.focus({ preventScroll: !0 });
354
371
  },
355
372
  children: /* @__PURE__ */ d(
356
373
  Xt,
357
374
  {
358
375
  role: "listbox",
359
- id: r.contentId,
360
- "data-state": r.open ? "open" : "closed",
361
- onContextMenu: (g) => g.preventDefault(),
376
+ id: l.contentId,
377
+ "data-state": l.open ? "open" : "closed",
378
+ onContextMenu: (a) => a.preventDefault(),
362
379
  ...o,
363
380
  ref: i,
364
381
  style: {
@@ -374,11 +391,11 @@ const at = "ComboboxContent", jt = l.forwardRef((n, s) => {
374
391
  }
375
392
  ) });
376
393
  }
377
- ), Xt = l.forwardRef(
394
+ ), Xt = r.forwardRef(
378
395
  (n, s) => {
379
396
  const { align: e = "start", collisionPadding: t = Yt, ...o } = n;
380
397
  return /* @__PURE__ */ d(
381
- re.Content,
398
+ le.Content,
382
399
  {
383
400
  ...o,
384
401
  ref: s,
@@ -397,8 +414,8 @@ const at = "ComboboxContent", jt = l.forwardRef((n, s) => {
397
414
  }
398
415
  );
399
416
  }
400
- ), Zt = "ComboboxViewport", Jt = l.forwardRef((n, s) => {
401
- const e = j(Zt), t = _(s, e.onViewportChange);
417
+ ), Zt = "ComboboxViewport", Jt = r.forwardRef((n, s) => {
418
+ const e = Y(Zt), t = _(s, e.onViewportChange);
402
419
  return /* @__PURE__ */ Ne(Ae, { children: [
403
420
  /* @__PURE__ */ d(
404
421
  "style",
@@ -427,71 +444,71 @@ const at = "ComboboxContent", jt = l.forwardRef((n, s) => {
427
444
  }
428
445
  ) })
429
446
  ] });
430
- }), ut = "ComboboxItem", [Qt, dt] = et(ut), ft = l.forwardRef((n, s) => {
431
- const { value: e, disabled: t = !1, textValue: o, ...r } = n, i = l.useRef(null), c = _(s, i), { getItems: a } = me(void 0), {
432
- onTextValueChange: m,
447
+ }), ft = "ComboboxItem", [Qt, pt] = et(ft), mt = r.forwardRef((n, s) => {
448
+ const { value: e, disabled: t = !1, textValue: o, ...l } = n, i = r.useRef(null), c = _(s, i), { getItems: a } = xe(void 0), {
449
+ onTextValueChange: g,
433
450
  textValue: f,
434
- visuallyFocussedItem: S,
435
- ...h
436
- } = j(ut), u = oe(), [p, g] = l.useState(o ?? ""), C = l.useMemo(() => S === a().find((M) => M.ref.current === i.current)?.ref.current, [a, S]), v = h.value === e, x = () => {
437
- t || (h.onValueChange(e), m(p), h.onOpenChange(!1), h.autocomplete === "both" && h.onFilterValueChange(p), h.trigger?.focus({ preventScroll: !0 }));
438
- }, { startsWith: w } = Me(h.locale, { sensitivity: "base" }), A = l.useCallback((M) => {
439
- g((P) => P || (M?.textContent ?? "").trim());
451
+ visuallyFocussedItem: v,
452
+ ...p
453
+ } = Y(ft), u = ne(), [m, S] = r.useState(o ?? ""), x = r.useMemo(() => v === a().find((M) => M.ref.current === i.current)?.ref.current, [a, v]), C = p.value === e, h = () => {
454
+ t || (p.onValueChange(e), g(m), p.onOpenChange(!1), p.autocomplete === "both" && p.onFilterValueChange(m), p.trigger?.focus({ preventScroll: !0 }));
455
+ }, { startsWith: w } = Me(p.locale, { sensitivity: "base" }), A = r.useCallback((M) => {
456
+ S((E) => E || (M?.textContent ?? "").trim());
440
457
  }, []);
441
- l.useEffect(() => {
442
- v && f === void 0 && p !== "" && m(p);
443
- }, [p, v, f, m]);
444
- const T = oe();
445
- return h.autocomplete === "list" && p && f && !w(p, f) || h.autocomplete === "both" && p && h.filterValue && !w(p, h.filterValue) ? null : /* @__PURE__ */ d(Qt, { textId: u, onTextValueChange: A, isSelected: v, children: /* @__PURE__ */ d(pe.ItemSlot, { scope: void 0, value: e, textValue: p, disabled: t, type: "option", children: /* @__PURE__ */ d(
458
+ r.useEffect(() => {
459
+ C && f === void 0 && m !== "" && g(m);
460
+ }, [m, C, f, g]);
461
+ const V = ne();
462
+ return p.autocomplete === "list" && m && f && !w(m, f) || p.autocomplete === "both" && m && p.filterValue && !w(m, p.filterValue) ? null : /* @__PURE__ */ d(Qt, { textId: u, onTextValueChange: A, isSelected: C, children: /* @__PURE__ */ d(pe.ItemSlot, { scope: void 0, value: e, textValue: m, disabled: t, type: "option", children: /* @__PURE__ */ d(
446
463
  N.div,
447
464
  {
448
465
  role: "option",
449
466
  "aria-labelledby": u,
450
- "data-highlighted": C ? "" : void 0,
451
- "aria-selected": v && C,
452
- "data-state": v ? "checked" : "unchecked",
467
+ "data-highlighted": x ? "" : void 0,
468
+ "aria-selected": C && x,
469
+ "data-state": C ? "checked" : "unchecked",
453
470
  "aria-disabled": t || void 0,
454
471
  "data-disabled": t ? "" : void 0,
455
472
  tabIndex: t ? void 0 : -1,
456
- ...r,
457
- id: T,
473
+ ...l,
474
+ id: V,
458
475
  ref: c,
459
- onPointerUp: E(r.onPointerUp, x)
476
+ onPointerUp: T(l.onPointerUp, h)
460
477
  }
461
478
  ) }) });
462
- }), eo = "ComboboxItemText", to = l.forwardRef((n, s) => {
463
- const { className: e, style: t, ...o } = n, r = dt(eo), i = _(s, r.onTextValueChange);
464
- return /* @__PURE__ */ d(N.span, { id: r.textId, ...o, ref: i });
465
- }), oo = "ComboboxItemIndicator", no = l.forwardRef((n, s) => {
466
- const { isSelected: e } = dt(oo);
479
+ }), eo = "ComboboxItemText", to = r.forwardRef((n, s) => {
480
+ const { className: e, style: t, ...o } = n, l = pt(eo), i = _(s, l.onTextValueChange);
481
+ return /* @__PURE__ */ d(N.span, { id: l.textId, ...o, ref: i });
482
+ }), oo = "ComboboxItemIndicator", no = r.forwardRef((n, s) => {
483
+ const { isSelected: e } = pt(oo);
467
484
  return e ? /* @__PURE__ */ d(N.span, { "aria-hidden": !0, ...n, ref: s }) : null;
468
- }), pt = "ComboboxNoValueFound", ro = l.forwardRef((n, s) => {
469
- const { textValue: e = "", locale: t } = j(pt), [o, r] = l.useState([]), { subscribe: i } = me(void 0), { startsWith: c } = Me(t, { sensitivity: "base" });
470
- return l.useEffect(() => {
471
- const a = i((m) => {
472
- r(m);
485
+ }), ht = "ComboboxNoValueFound", ro = r.forwardRef((n, s) => {
486
+ const { textValue: e = "", locale: t } = Y(ht), [o, l] = r.useState([]), { subscribe: i } = xe(void 0), { startsWith: c } = Me(t, { sensitivity: "base" });
487
+ return r.useEffect(() => {
488
+ const a = i((g) => {
489
+ l(g);
473
490
  });
474
491
  return () => {
475
492
  a();
476
493
  };
477
494
  }, [i]), o.some((a) => c(a.textValue, e)) ? null : /* @__PURE__ */ d(N.div, { ...n, ref: s });
478
- }), lo = l.forwardRef((n, s) => {
479
- const { disabled: e = !1, ...t } = n, o = j(pt), { textValue: r, visuallyFocussedItem: i } = o, { getItems: c, subscribe: a } = me(void 0), m = l.useRef(null), [f, S] = l.useState(!1), h = _(s, m), u = l.useMemo(() => i === c().find((C) => C.ref.current === m.current)?.ref.current, [c, i]), p = oe(), g = () => {
480
- !e && r && (o.onValueChange(r), o.onTextValueChange(r), o.onOpenChange(!1), o.autocomplete === "both" && o.onFilterValueChange(r), o.trigger?.focus({ preventScroll: !0 }));
495
+ }), lo = r.forwardRef((n, s) => {
496
+ const { disabled: e = !1, ...t } = n, o = Y(ht), { textValue: l, visuallyFocussedItem: i } = o, { getItems: c, subscribe: a } = xe(void 0), g = r.useRef(null), [f, v] = r.useState(!1), p = _(s, g), u = r.useMemo(() => i === c().find((x) => x.ref.current === g.current)?.ref.current, [c, i]), m = ne(), S = () => {
497
+ !e && l && (o.onValueChange(l), o.onTextValueChange(l), o.onOpenChange(!1), o.autocomplete === "both" && o.onFilterValueChange(l), o.trigger?.focus({ preventScroll: !0 }));
481
498
  };
482
- return B(() => {
483
- const C = a((v) => {
484
- S(!v.some((x) => x.textValue === r && x.type !== "create"));
499
+ return H(() => {
500
+ const x = a((C) => {
501
+ v(!C.some((h) => h.textValue === l && h.type !== "create"));
485
502
  });
486
- return () => {
487
- C();
503
+ return c().length === 0 && v(!0), () => {
504
+ x();
488
505
  };
489
- }, [r, a]), !r || !f ? null : /* @__PURE__ */ d(
506
+ }, [l, a, c]), !l || !f ? null : /* @__PURE__ */ d(
490
507
  pe.ItemSlot,
491
508
  {
492
509
  scope: void 0,
493
- value: r ?? "",
494
- textValue: r ?? "",
510
+ value: l ?? "",
511
+ textValue: l ?? "",
495
512
  disabled: e,
496
513
  type: "create",
497
514
  children: /* @__PURE__ */ d(
@@ -503,14 +520,14 @@ const at = "ComboboxContent", jt = l.forwardRef((n, s) => {
503
520
  "data-disabled": e ? "" : void 0,
504
521
  "data-highlighted": u ? "" : void 0,
505
522
  ...t,
506
- id: p,
507
- ref: h,
508
- onPointerUp: E(t.onPointerUp, g)
523
+ id: m,
524
+ ref: p,
525
+ onPointerUp: T(t.onPointerUp, S)
509
526
  }
510
527
  )
511
528
  }
512
529
  );
513
- }), so = $t, co = Kt, io = Wt, ao = zt, uo = it, fo = jt, po = Jt, mo = ft, ho = to, go = no, xo = ro, Co = lo;
530
+ }), so = $t, co = Kt, io = Wt, ao = zt, uo = ut, fo = jt, po = Jt, mo = mt, ho = to, go = no, xo = ro, Co = lo;
514
531
  function vo(n, s) {
515
532
  const e = Math.min(n.length, s.length);
516
533
  for (let t = 0; t < e; t++)
@@ -520,7 +537,7 @@ function vo(n, s) {
520
537
  }
521
538
  const Tn = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
522
539
  __proto__: null,
523
- ComboboxItem: ft,
540
+ ComboboxItem: mt,
524
541
  Content: fo,
525
542
  CreateItem: Co,
526
543
  Icon: ao,
@@ -533,67 +550,67 @@ const Tn = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
533
550
  TextInput: io,
534
551
  Trigger: co,
535
552
  Viewport: po
536
- }, Symbol.toStringTag, { value: "Module" })), So = [" ", "Enter", "ArrowUp", "ArrowDown"], bo = [" ", "Enter"], he = "Select", [Ce, ge, wo] = Pt(he), [ae, yo] = Qe(he, [
553
+ }, Symbol.toStringTag, { value: "Module" })), So = [" ", "Enter", "ArrowUp", "ArrowDown"], bo = [" ", "Enter"], me = "Select", [Ce, he, wo] = Rt(me), [ae, yo] = Qe(me, [
537
554
  wo,
538
- ot
539
- ]), ve = ot(), [Io, Y] = ae(he), [To, Eo] = ae(he), Oe = (n) => {
555
+ rt
556
+ ]), ve = rt(), [Io, q] = ae(me), [To, Vo] = ae(me), Oe = (n) => {
540
557
  const {
541
558
  __scopeSelect: s,
542
559
  children: e,
543
560
  open: t,
544
561
  defaultOpen: o,
545
- onOpenChange: r,
562
+ onOpenChange: l,
546
563
  value: i,
547
564
  defaultValue: c,
548
565
  onValueChange: a,
549
- dir: m,
566
+ dir: g,
550
567
  // name,
551
568
  // autoComplete,
552
569
  disabled: f,
553
- required: S,
554
- multi: h = !1
555
- } = n, u = ve(s), [p, g] = l.useState(null), [C, v] = l.useState(null), [x, w] = l.useState(!1), A = Vt(m), [T = !1, M] = ie({
570
+ required: v,
571
+ multi: p = !1
572
+ } = n, u = ve(s), [m, S] = r.useState(null), [x, C] = r.useState(null), [h, w] = r.useState(!1), A = Nt(g), [V = !1, M] = ie({
556
573
  prop: t,
557
574
  defaultProp: o,
558
- onChange: r
559
- }), [P, k] = ie({
575
+ onChange: l
576
+ }), [E, k] = ie({
560
577
  prop: i,
561
578
  defaultProp: c,
562
579
  onChange(O) {
563
580
  a && (Array.isArray(O), a(O));
564
581
  }
565
- }), H = l.useRef(null), [z, $] = l.useState(/* @__PURE__ */ new Set());
566
- return /* @__PURE__ */ d(re.Root, { ...u, children: /* @__PURE__ */ d(
582
+ }), $ = r.useRef(null), [G, F] = r.useState(/* @__PURE__ */ new Set());
583
+ return /* @__PURE__ */ d(le.Root, { ...u, children: /* @__PURE__ */ d(
567
584
  Io,
568
585
  {
569
- required: S,
586
+ required: v,
570
587
  scope: s,
571
- trigger: p,
572
- onTriggerChange: g,
573
- valueNode: C,
574
- onValueNodeChange: v,
575
- valueNodeHasChildren: x,
588
+ trigger: m,
589
+ onTriggerChange: S,
590
+ valueNode: x,
591
+ onValueNodeChange: C,
592
+ valueNodeHasChildren: h,
576
593
  onValueNodeHasChildrenChange: w,
577
- contentId: oe(),
578
- value: P,
594
+ contentId: ne(),
595
+ value: E,
579
596
  onValueChange: k,
580
- open: T,
597
+ open: V,
581
598
  onOpenChange: M,
582
599
  dir: A,
583
- triggerPointerDownPosRef: H,
600
+ triggerPointerDownPosRef: $,
584
601
  disabled: f,
585
- multi: h,
602
+ multi: p,
586
603
  children: /* @__PURE__ */ d(Ce.Provider, { scope: s, children: /* @__PURE__ */ d(
587
604
  To,
588
605
  {
589
606
  scope: n.__scopeSelect,
590
- onNativeOptionAdd: l.useCallback((O) => {
591
- $((F) => new Set(F).add(O));
607
+ onNativeOptionAdd: r.useCallback((O) => {
608
+ F((L) => new Set(L).add(O));
592
609
  }, []),
593
- onNativeOptionRemove: l.useCallback((O) => {
594
- $((F) => {
595
- const L = new Set(F);
596
- return L.delete(O), L;
610
+ onNativeOptionRemove: r.useCallback((O) => {
611
+ F((L) => {
612
+ const B = new Set(L);
613
+ return B.delete(O), B;
597
614
  });
598
615
  }, []),
599
616
  children: e
@@ -602,157 +619,157 @@ const Tn = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
602
619
  }
603
620
  ) });
604
621
  };
605
- Oe.displayName = he;
606
- const mt = "SelectTrigger", De = l.forwardRef(
622
+ Oe.displayName = me;
623
+ const gt = "SelectTrigger", De = r.forwardRef(
607
624
  (n, s) => {
608
- const { __scopeSelect: e, ...t } = n, o = ve(e), r = Y(mt, e), i = r.disabled, c = _(s, r.onTriggerChange), a = ge(e), [m, f, S] = It((u) => {
609
- const p = a().filter((v) => !v.disabled), g = p.find((v) => v.value === r.value), C = Tt(p, u, g);
610
- if (C !== void 0 && !Array.isArray(C.value)) {
611
- const v = r.multi ? [C.value] : C.value;
612
- r.onValueChange(v);
625
+ const { __scopeSelect: e, ...t } = n, o = ve(e), l = q(gt, e), i = l.disabled, c = _(s, l.onTriggerChange), a = he(e), [g, f, v] = Vt((u) => {
626
+ const m = a().filter((C) => !C.disabled), S = m.find((C) => C.value === l.value), x = Et(m, u, S);
627
+ if (x !== void 0 && !Array.isArray(x.value)) {
628
+ const C = l.multi ? [x.value] : x.value;
629
+ l.onValueChange(C);
613
630
  }
614
- }), h = () => {
615
- i || (r.onOpenChange(!0), S());
631
+ }), p = () => {
632
+ i || (l.onOpenChange(!0), v());
616
633
  };
617
- return /* @__PURE__ */ d(re.Anchor, { asChild: !0, ...o, children: /* @__PURE__ */ d(
634
+ return /* @__PURE__ */ d(le.Anchor, { asChild: !0, ...o, children: /* @__PURE__ */ d(
618
635
  N.div,
619
636
  {
620
637
  role: "combobox",
621
- "aria-controls": r.contentId,
622
- "aria-expanded": r.open,
623
- "aria-required": r.required,
638
+ "aria-controls": l.contentId,
639
+ "aria-expanded": l.open,
640
+ "aria-required": l.required,
624
641
  "aria-autocomplete": "none",
625
- dir: r.dir,
626
- "data-state": r.open ? "open" : "closed",
642
+ dir: l.dir,
643
+ "data-state": l.open ? "open" : "closed",
627
644
  "data-disabled": i ? "" : void 0,
628
- "data-placeholder": r.value === void 0 ? "" : void 0,
645
+ "data-placeholder": l.value === void 0 ? "" : void 0,
629
646
  tabIndex: i ? void 0 : 0,
630
647
  ...t,
631
648
  ref: c,
632
- onClick: E(t.onClick, (u) => {
649
+ onClick: T(t.onClick, (u) => {
633
650
  u.currentTarget.focus();
634
651
  }),
635
- onPointerDown: E(t.onPointerDown, (u) => {
636
- const p = u.target;
637
- p.hasPointerCapture(u.pointerId) && p.releasePointerCapture(u.pointerId), (p.closest("button") ?? p.closest("div")) === u.currentTarget && u.button === 0 && u.ctrlKey === !1 && (h(), r.triggerPointerDownPosRef.current = {
652
+ onPointerDown: T(t.onPointerDown, (u) => {
653
+ const m = u.target;
654
+ m.hasPointerCapture(u.pointerId) && m.releasePointerCapture(u.pointerId), (m.closest("button") ?? m.closest("div")) === u.currentTarget && u.button === 0 && u.ctrlKey === !1 && (p(), l.triggerPointerDownPosRef.current = {
638
655
  x: Math.round(u.pageX),
639
656
  y: Math.round(u.pageY)
640
657
  }, u.preventDefault());
641
658
  }),
642
- onKeyDown: E(t.onKeyDown, (u) => {
643
- const p = m.current !== "", g = u.ctrlKey || u.altKey || u.metaKey, C = u.target;
644
- (C.closest("button") ?? C.closest("div")) === u.currentTarget && (!g && u.key.length === 1 && f(u.key), !(p && u.key === " ") && So.includes(u.key) && (h(), u.preventDefault()));
659
+ onKeyDown: T(t.onKeyDown, (u) => {
660
+ const m = g.current !== "", S = u.ctrlKey || u.altKey || u.metaKey, x = u.target;
661
+ (x.closest("button") ?? x.closest("div")) === u.currentTarget && (!S && u.key.length === 1 && f(u.key), !(m && u.key === " ") && So.includes(u.key) && (p(), u.preventDefault()));
645
662
  })
646
663
  }
647
664
  ) });
648
665
  }
649
666
  );
650
- De.displayName = mt;
651
- const ht = "SelectValue", ke = l.forwardRef(
667
+ De.displayName = gt;
668
+ const xt = "SelectValue", ke = r.forwardRef(
652
669
  (n, s) => {
653
- const { __scopeSelect: e, children: t, placeholder: o, ...r } = n, i = Y(ht, e), { onValueNodeHasChildrenChange: c } = i, a = t !== void 0, m = _(s, i.onValueNodeChange), [f, S] = l.useState([]), h = ge(e);
654
- B(() => {
670
+ const { __scopeSelect: e, children: t, placeholder: o, ...l } = n, i = q(xt, e), { onValueNodeHasChildrenChange: c } = i, a = t !== void 0, g = _(s, i.onValueNodeChange), [f, v] = r.useState([]), p = he(e);
671
+ H(() => {
655
672
  c(a);
656
- }, [c, a]), l.useLayoutEffect(() => {
673
+ }, [c, a]), r.useLayoutEffect(() => {
657
674
  if (Array.isArray(i.value) && f.length !== i.value.length) {
658
- const p = setTimeout(() => {
659
- const g = h().filter(
660
- (C) => Array.isArray(C.value) ? !1 : i.value?.includes(C.value)
675
+ const m = setTimeout(() => {
676
+ const S = p().filter(
677
+ (x) => Array.isArray(x.value) ? !1 : i.value?.includes(x.value)
661
678
  );
662
- S(g);
679
+ v(S);
663
680
  });
664
681
  return () => {
665
- clearTimeout(p);
682
+ clearTimeout(m);
666
683
  };
667
684
  }
668
- }, [i.value, h, f]);
685
+ }, [i.value, p, f]);
669
686
  let u;
670
687
  if ((i.value === void 0 || i.value.length === 0) && o !== void 0)
671
688
  u = /* @__PURE__ */ d("span", { children: o });
672
689
  else if (typeof t == "function")
673
690
  if (Array.isArray(i.value)) {
674
- const p = i.value.map((g) => {
675
- const C = f.find((v) => v.value === g);
676
- return C ? t({ value: g, textValue: C?.textValue }) : null;
691
+ const m = i.value.map((S) => {
692
+ const x = f.find((C) => C.value === S);
693
+ return x ? t({ value: S, textValue: x?.textValue }) : null;
677
694
  });
678
- u = p.every((g) => g === null) ? o : p;
695
+ u = m.every((S) => S === null) ? o : m;
679
696
  } else
680
697
  u = t(i.value);
681
698
  else
682
699
  u = t;
683
- return /* @__PURE__ */ d(N.span, { ...r, ref: m, children: u || null });
700
+ return /* @__PURE__ */ d(N.span, { ...l, ref: g, children: u || null });
684
701
  }
685
702
  );
686
- ke.displayName = ht;
687
- const Po = "SelectIcon", Fe = l.forwardRef(
703
+ ke.displayName = xt;
704
+ const Eo = "SelectIcon", Fe = r.forwardRef(
688
705
  (n, s) => {
689
706
  const { __scopeSelect: e, children: t, ...o } = n;
690
707
  return /* @__PURE__ */ d(N.span, { "aria-hidden": !0, ...o, ref: s, children: t || "▼" });
691
708
  }
692
709
  );
693
- Fe.displayName = Po;
694
- const Vo = "SelectPortal", Le = (n) => /* @__PURE__ */ d(nt, { asChild: !0, ...n });
695
- Le.displayName = Vo;
696
- const ne = "SelectContent", Be = l.forwardRef(
710
+ Fe.displayName = Eo;
711
+ const Po = "SelectPortal", Le = (n) => /* @__PURE__ */ d(lt, { asChild: !0, ...n });
712
+ Le.displayName = Po;
713
+ const re = "SelectContent", Be = r.forwardRef(
697
714
  (n, s) => {
698
- const e = Y(ne, n.__scopeSelect), [t, o] = l.useState();
699
- if (B(() => {
715
+ const e = q(re, n.__scopeSelect), [t, o] = r.useState();
716
+ if (H(() => {
700
717
  o(new DocumentFragment());
701
718
  }, []), !e.open) {
702
- const r = t;
703
- return r ? _e.createPortal(
704
- /* @__PURE__ */ d(gt, { scope: n.__scopeSelect, children: /* @__PURE__ */ d(Ce.Slot, { scope: n.__scopeSelect, children: /* @__PURE__ */ d("div", { children: n.children }) }) }),
705
- r
719
+ const l = t;
720
+ return l ? _e.createPortal(
721
+ /* @__PURE__ */ d(Ct, { scope: n.__scopeSelect, children: /* @__PURE__ */ d(Ce.Slot, { scope: n.__scopeSelect, children: /* @__PURE__ */ d("div", { children: n.children }) }) }),
722
+ l
706
723
  ) : null;
707
724
  }
708
- return /* @__PURE__ */ d(xt, { ...n, ref: s });
725
+ return /* @__PURE__ */ d(vt, { ...n, ref: s });
709
726
  }
710
727
  );
711
- Be.displayName = ne;
712
- const G = 10, [gt, J] = ae(ne), Ro = "SelectContentImpl", xt = l.forwardRef(
728
+ Be.displayName = re;
729
+ const j = 10, [Ct, Q] = ae(re), Ro = "SelectContentImpl", vt = r.forwardRef(
713
730
  (n, s) => {
714
731
  const {
715
732
  __scopeSelect: e,
716
733
  position: t = "item-aligned",
717
734
  onCloseAutoFocus: o,
718
- onEscapeKeyDown: r,
735
+ onEscapeKeyDown: l,
719
736
  onPointerDownOutside: i,
720
737
  //
721
738
  // PopperContent props
722
739
  side: c,
723
740
  sideOffset: a,
724
- align: m,
741
+ align: g,
725
742
  alignOffset: f,
726
- arrowPadding: S,
727
- collisionBoundary: h,
743
+ arrowPadding: v,
744
+ collisionBoundary: p,
728
745
  collisionPadding: u,
729
- sticky: p,
730
- hideWhenDetached: g,
731
- avoidCollisions: C,
746
+ sticky: m,
747
+ hideWhenDetached: S,
748
+ avoidCollisions: x,
732
749
  //
733
- ...v
734
- } = n, x = Y(ne, e), [w, A] = l.useState(null), [T, M] = l.useState(null), P = _(s, (b) => A(b)), [k, H] = l.useState(null), [z, $] = l.useState(null), O = ge(e), [F, L] = l.useState(!1), U = l.useRef(!1);
735
- l.useEffect(() => {
750
+ ...C
751
+ } = n, h = q(re, e), [w, A] = r.useState(null), [V, M] = r.useState(null), E = _(s, (b) => A(b)), [k, $] = r.useState(null), [G, F] = r.useState(null), O = he(e), [L, B] = r.useState(!1), U = r.useRef(!1);
752
+ r.useEffect(() => {
736
753
  if (w)
737
- return rt(w);
738
- }, [w]), Rt();
739
- const K = l.useCallback(
754
+ return st(w);
755
+ }, [w]), ot();
756
+ const K = r.useCallback(
740
757
  (b) => {
741
- const [y, ...D] = O().map((R) => R.ref.current), [I] = D.slice(-1), V = document.activeElement;
758
+ const [y, ...D] = O().map((R) => R.ref.current), [I] = D.slice(-1), P = document.activeElement;
742
759
  for (const R of b)
743
- if (R === V || (R?.scrollIntoView({ block: "nearest" }), R === y && T && (T.scrollTop = 0), R === I && T && (T.scrollTop = T.scrollHeight), R?.focus(), document.activeElement !== V))
760
+ if (R === P || (R?.scrollIntoView({ block: "nearest" }), R === y && V && (V.scrollTop = 0), R === I && V && (V.scrollTop = V.scrollHeight), R?.focus(), document.activeElement !== P))
744
761
  return;
745
762
  },
746
- [O, T]
747
- ), q = l.useCallback(
763
+ [O, V]
764
+ ), X = r.useCallback(
748
765
  () => K([k, w]),
749
766
  [K, k, w]
750
767
  );
751
- l.useEffect(() => {
752
- F && q();
753
- }, [F, q]);
754
- const { onOpenChange: X, triggerPointerDownPosRef: W } = x;
755
- l.useEffect(() => {
768
+ r.useEffect(() => {
769
+ L && X();
770
+ }, [L, X]);
771
+ const { onOpenChange: Z, triggerPointerDownPosRef: W } = h;
772
+ r.useEffect(() => {
756
773
  if (w) {
757
774
  let b = { x: 0, y: 0 };
758
775
  const y = (I) => {
@@ -761,108 +778,108 @@ const G = 10, [gt, J] = ae(ne), Ro = "SelectContentImpl", xt = l.forwardRef(
761
778
  y: Math.abs(Math.round(I.pageY) - (W.current?.y ?? 0))
762
779
  };
763
780
  }, D = (I) => {
764
- b.x <= 10 && b.y <= 10 ? I.preventDefault() : w.contains(I.target) || X(!1), document.removeEventListener("pointermove", y), W.current = null;
781
+ b.x <= 10 && b.y <= 10 ? I.preventDefault() : w.contains(I.target) || Z(!1), document.removeEventListener("pointermove", y), W.current = null;
765
782
  };
766
783
  return W.current !== null && (document.addEventListener("pointermove", y), document.addEventListener("pointerup", D, { capture: !0, once: !0 })), () => {
767
784
  document.removeEventListener("pointermove", y), document.removeEventListener("pointerup", D, { capture: !0 });
768
785
  };
769
786
  }
770
- }, [w, X, W]), l.useEffect(() => {
771
- const b = () => X(!1);
787
+ }, [w, Z, W]), r.useEffect(() => {
788
+ const b = () => Z(!1);
772
789
  return window.addEventListener("blur", b), window.addEventListener("resize", b), () => {
773
790
  window.removeEventListener("blur", b), window.removeEventListener("resize", b);
774
791
  };
775
- }, [X]);
776
- const [ue, le] = It((b) => {
777
- const y = O().filter((V) => !V.disabled), D = y.find((V) => V.ref.current === document.activeElement), I = Tt(y, b, D);
792
+ }, [Z]);
793
+ const [ue, z] = Vt((b) => {
794
+ const y = O().filter((P) => !P.disabled), D = y.find((P) => P.ref.current === document.activeElement), I = Et(y, b, D);
778
795
  I && setTimeout(() => I.ref.current.focus());
779
- }), se = l.useCallback(
796
+ }), se = r.useCallback(
780
797
  (b, y, D) => {
781
798
  const I = !U.current && !D;
782
- (x.value !== void 0 && x.value === y || I) && (H(b), I && (U.current = !0));
799
+ (h.value !== void 0 && h.value === y || I) && ($(b), I && (U.current = !0));
783
800
  },
784
- [x.value]
785
- ), de = l.useCallback(() => w?.focus(), [w]), Z = l.useCallback(
801
+ [h.value]
802
+ ), de = r.useCallback(() => w?.focus(), [w]), J = r.useCallback(
786
803
  (b, y, D) => {
787
804
  const I = !U.current && !D;
788
- (x.value !== void 0 && (Array.isArray(y) ? y.every((R) => x.value?.includes(R)) : x.value === y) || I) && $(b);
805
+ (h.value !== void 0 && (Array.isArray(y) ? y.every((R) => h.value?.includes(R)) : h.value === y) || I) && F(b);
789
806
  },
790
- [x.value]
791
- ), ce = t === "popper" ? Te : Ct, Q = ce === Te ? {
807
+ [h.value]
808
+ ), ce = t === "popper" ? Te : St, ee = ce === Te ? {
792
809
  side: c,
793
810
  sideOffset: a,
794
- align: m,
811
+ align: g,
795
812
  alignOffset: f,
796
- arrowPadding: S,
797
- collisionBoundary: h,
813
+ arrowPadding: v,
814
+ collisionBoundary: p,
798
815
  collisionPadding: u,
799
- sticky: p,
800
- hideWhenDetached: g,
801
- avoidCollisions: C
816
+ sticky: m,
817
+ hideWhenDetached: S,
818
+ avoidCollisions: x
802
819
  } : {};
803
820
  return /* @__PURE__ */ d(
804
- gt,
821
+ Ct,
805
822
  {
806
823
  scope: e,
807
824
  content: w,
808
- viewport: T,
825
+ viewport: V,
809
826
  onViewportChange: M,
810
827
  itemRefCallback: se,
811
828
  selectedItem: k,
812
829
  onItemLeave: de,
813
- itemTextRefCallback: Z,
814
- focusSelectedItem: q,
815
- selectedItemText: z,
830
+ itemTextRefCallback: J,
831
+ focusSelectedItem: X,
832
+ selectedItemText: G,
816
833
  position: t,
817
- isPositioned: F,
834
+ isPositioned: L,
818
835
  searchRef: ue,
819
- children: /* @__PURE__ */ d(lt, { as: Ie, allowPinchZoom: !0, children: /* @__PURE__ */ d(
820
- Nt,
836
+ children: /* @__PURE__ */ d(ct, { as: Ie, allowPinchZoom: !0, children: /* @__PURE__ */ d(
837
+ nt,
821
838
  {
822
839
  asChild: !0,
823
- trapped: x.open,
840
+ trapped: h.open,
824
841
  onMountAutoFocus: (b) => {
825
842
  b.preventDefault();
826
843
  },
827
- onUnmountAutoFocus: E(o, (b) => {
828
- x.trigger?.focus({ preventScroll: !0 }), document.getSelection()?.empty(), b.preventDefault();
844
+ onUnmountAutoFocus: T(o, (b) => {
845
+ h.trigger?.focus({ preventScroll: !0 }), document.getSelection()?.empty(), b.preventDefault();
829
846
  }),
830
847
  children: /* @__PURE__ */ d(
831
848
  tt,
832
849
  {
833
850
  asChild: !0,
834
851
  disableOutsidePointerEvents: !0,
835
- onEscapeKeyDown: r,
852
+ onEscapeKeyDown: l,
836
853
  onPointerDownOutside: i,
837
854
  onFocusOutside: (b) => b.preventDefault(),
838
- onDismiss: () => x.onOpenChange(!1),
855
+ onDismiss: () => h.onOpenChange(!1),
839
856
  children: /* @__PURE__ */ d(
840
857
  ce,
841
858
  {
842
859
  role: "listbox",
843
- id: x.contentId,
844
- "data-state": x.open ? "open" : "closed",
845
- "aria-multiselectable": x.multi ? "true" : void 0,
846
- dir: x.dir,
860
+ id: h.contentId,
861
+ "data-state": h.open ? "open" : "closed",
862
+ "aria-multiselectable": h.multi ? "true" : void 0,
863
+ dir: h.dir,
847
864
  onContextMenu: (b) => b.preventDefault(),
848
- ...v,
849
- ...Q,
850
- onPlaced: () => L(!0),
851
- ref: P,
865
+ ...C,
866
+ ...ee,
867
+ onPlaced: () => B(!0),
868
+ ref: E,
852
869
  style: {
853
870
  // flex layout so we can place the scroll buttons properly
854
871
  display: "flex",
855
872
  flexDirection: "column",
856
873
  // reset the outline by default as the content MAY get focused
857
874
  outline: "none",
858
- ...v.style
875
+ ...C.style
859
876
  },
860
- onKeyDown: E(v.onKeyDown, (b) => {
877
+ onKeyDown: T(C.onKeyDown, (b) => {
861
878
  const y = b.ctrlKey || b.altKey || b.metaKey;
862
- if (b.key === "Tab" && b.preventDefault(), !y && b.key.length === 1 && le(b.key), ["ArrowUp", "ArrowDown", "Home", "End"].includes(b.key)) {
863
- let I = O().filter((V) => !V.disabled).map((V) => V.ref.current);
879
+ if (b.key === "Tab" && b.preventDefault(), !y && b.key.length === 1 && z(b.key), ["ArrowUp", "ArrowDown", "Home", "End"].includes(b.key)) {
880
+ let I = O().filter((P) => !P.disabled).map((P) => P.ref.current);
864
881
  if (["ArrowUp", "End"].includes(b.key) && (I = I.slice().reverse()), ["ArrowUp", "ArrowDown"].includes(b.key)) {
865
- const V = b.target, R = I.indexOf(V);
882
+ const P = b.target, R = I.indexOf(P);
866
883
  I = I.slice(R + 1);
867
884
  }
868
885
  setTimeout(() => K(I)), b.preventDefault();
@@ -878,63 +895,63 @@ const G = 10, [gt, J] = ae(ne), Ro = "SelectContentImpl", xt = l.forwardRef(
878
895
  );
879
896
  }
880
897
  );
881
- xt.displayName = Ro;
882
- const No = "SelectItemAlignedPosition", Ct = l.forwardRef(
898
+ vt.displayName = Ro;
899
+ const No = "SelectItemAlignedPosition", St = r.forwardRef(
883
900
  (n, s) => {
884
- const { __scopeSelect: e, onPlaced: t, ...o } = n, r = Y(ne, e), i = J(ne, e), [c, a] = l.useState(null), [m, f] = l.useState(null), S = _(s, (P) => f(P)), h = ge(e), u = l.useRef(!1), p = l.useRef(!0), { viewport: g, selectedItem: C, selectedItemText: v, focusSelectedItem: x } = i, w = l.useCallback(() => {
885
- if (r.trigger && r.valueNode && c && m && g && C && v) {
886
- const P = r.trigger.getBoundingClientRect(), k = m.getBoundingClientRect(), H = r.valueNode.getBoundingClientRect(), z = v.getBoundingClientRect();
887
- if (r.dir !== "rtl") {
888
- const V = z.left - k.left, R = H.left - V, ee = P.left - R, te = P.width + ee, Se = Math.max(te, k.width), be = window.innerWidth - G, we = Ze(R, [G, be - Se]);
889
- c.style.minWidth = `${te}px`, c.style.left = `${we}px`;
901
+ const { __scopeSelect: e, onPlaced: t, ...o } = n, l = q(re, e), i = Q(re, e), [c, a] = r.useState(null), [g, f] = r.useState(null), v = _(s, (E) => f(E)), p = he(e), u = r.useRef(!1), m = r.useRef(!0), { viewport: S, selectedItem: x, selectedItemText: C, focusSelectedItem: h } = i, w = r.useCallback(() => {
902
+ if (l.trigger && l.valueNode && c && g && S && x && C) {
903
+ const E = l.trigger.getBoundingClientRect(), k = g.getBoundingClientRect(), $ = l.valueNode.getBoundingClientRect(), G = C.getBoundingClientRect();
904
+ if (l.dir !== "rtl") {
905
+ const P = G.left - k.left, R = $.left - P, te = E.left - R, oe = E.width + te, Se = Math.max(oe, k.width), be = window.innerWidth - j, we = Ze(R, [j, be - Se]);
906
+ c.style.minWidth = `${oe}px`, c.style.left = `${we}px`;
890
907
  } else {
891
- const V = k.right - z.right, R = window.innerWidth - H.right - V, ee = window.innerWidth - P.right - R, te = P.width + ee, Se = Math.max(te, k.width), be = window.innerWidth - G, we = Ze(R, [G, be - Se]);
892
- c.style.minWidth = `${te}px`, c.style.right = `${we}px`;
908
+ const P = k.right - G.right, R = window.innerWidth - $.right - P, te = window.innerWidth - E.right - R, oe = E.width + te, Se = Math.max(oe, k.width), be = window.innerWidth - j, we = Ze(R, [j, be - Se]);
909
+ c.style.minWidth = `${oe}px`, c.style.right = `${we}px`;
893
910
  }
894
- const $ = h(), O = window.innerHeight - G * 2, F = g.scrollHeight, L = window.getComputedStyle(m), U = parseInt(L.borderTopWidth, 10), K = parseInt(L.paddingTop, 10), q = parseInt(L.borderBottomWidth, 10), X = parseInt(L.paddingBottom, 10), W = U + K + F + X + q, ue = Math.min(C.offsetHeight * 5, W), le = window.getComputedStyle(g), se = parseInt(le.paddingTop, 10), de = parseInt(le.paddingBottom, 10), Z = P.top + P.height / 2 - G, ce = O - Z, Q = C.offsetHeight / 2, b = C.offsetTop + Q, y = U + K + b, D = W - y;
895
- if (y <= Z) {
896
- const V = C === $[$.length - 1].ref.current;
911
+ const F = p(), O = window.innerHeight - j * 2, L = S.scrollHeight, B = window.getComputedStyle(g), U = parseInt(B.borderTopWidth, 10), K = parseInt(B.paddingTop, 10), X = parseInt(B.borderBottomWidth, 10), Z = parseInt(B.paddingBottom, 10), W = U + K + L + Z + X, ue = Math.min(x.offsetHeight * 5, W), z = window.getComputedStyle(S), se = parseInt(z.paddingTop, 10), de = parseInt(z.paddingBottom, 10), J = E.top + E.height / 2 - j, ce = O - J, ee = x.offsetHeight / 2, b = x.offsetTop + ee, y = U + K + b, D = W - y;
912
+ if (y <= J) {
913
+ const P = x === F[F.length - 1].ref.current;
897
914
  c.style.bottom = "0px";
898
- const R = m.clientHeight - g.offsetTop - g.offsetHeight, ee = Math.max(
915
+ const R = g.clientHeight - S.offsetTop - S.offsetHeight, te = Math.max(
899
916
  ce,
900
- Q + // viewport might have padding bottom, include it to avoid a scrollable viewport
901
- (V ? de : 0) + R + q
902
- ), te = y + ee;
903
- c.style.height = `${te}px`;
917
+ ee + // viewport might have padding bottom, include it to avoid a scrollable viewport
918
+ (P ? de : 0) + R + X
919
+ ), oe = y + te;
920
+ c.style.height = `${oe}px`;
904
921
  } else {
905
- const V = C === $[0].ref.current;
922
+ const P = x === F[0].ref.current;
906
923
  c.style.top = "0px";
907
- const ee = Math.max(
908
- Z,
909
- U + g.offsetTop + // viewport might have padding top, include it to avoid a scrollable viewport
910
- (V ? se : 0) + Q
924
+ const te = Math.max(
925
+ J,
926
+ U + S.offsetTop + // viewport might have padding top, include it to avoid a scrollable viewport
927
+ (P ? se : 0) + ee
911
928
  ) + D;
912
- c.style.height = `${ee}px`, g.scrollTop = y - Z + g.offsetTop;
929
+ c.style.height = `${te}px`, S.scrollTop = y - J + S.offsetTop;
913
930
  }
914
- c.style.margin = `${G}px 0`, c.style.minHeight = `${ue}px`, c.style.maxHeight = `${O}px`, t?.(), requestAnimationFrame(() => u.current = !0);
931
+ c.style.margin = `${j}px 0`, c.style.minHeight = `${ue}px`, c.style.maxHeight = `${O}px`, t?.(), requestAnimationFrame(() => u.current = !0);
915
932
  }
916
933
  }, [
917
- h,
918
- r.trigger,
919
- r.valueNode,
934
+ p,
935
+ l.trigger,
936
+ l.valueNode,
920
937
  c,
921
- m,
922
938
  g,
939
+ S,
940
+ x,
923
941
  C,
924
- v,
925
- r.dir,
942
+ l.dir,
926
943
  t
927
944
  ]);
928
- B(() => w(), [w]);
929
- const [A, T] = l.useState();
930
- B(() => {
931
- m && T(window.getComputedStyle(m).zIndex);
932
- }, [m]);
933
- const M = l.useCallback(
934
- (P) => {
935
- P && p.current === !0 && (w(), x?.(), p.current = !1);
945
+ H(() => w(), [w]);
946
+ const [A, V] = r.useState();
947
+ H(() => {
948
+ g && V(window.getComputedStyle(g).zIndex);
949
+ }, [g]);
950
+ const M = r.useCallback(
951
+ (E) => {
952
+ E && m.current === !0 && (w(), h?.(), m.current = !1);
936
953
  },
937
- [w, x]
954
+ [w, h]
938
955
  );
939
956
  return /* @__PURE__ */ d(
940
957
  _o,
@@ -957,7 +974,7 @@ const No = "SelectItemAlignedPosition", Ct = l.forwardRef(
957
974
  N.div,
958
975
  {
959
976
  ...o,
960
- ref: S,
977
+ ref: v,
961
978
  style: {
962
979
  // When we get the height of the content, it includes borders. If we were to set
963
980
  // the height without having `boxSizing: 'border-box'` it would be too big.
@@ -974,22 +991,22 @@ const No = "SelectItemAlignedPosition", Ct = l.forwardRef(
974
991
  );
975
992
  }
976
993
  );
977
- Ct.displayName = No;
978
- const Ao = "SelectPopperPosition", Te = l.forwardRef(
994
+ St.displayName = No;
995
+ const Ao = "SelectPopperPosition", Te = r.forwardRef(
979
996
  (n, s) => {
980
- const { __scopeSelect: e, align: t = "start", collisionPadding: o = G, ...r } = n, i = ve(e);
997
+ const { __scopeSelect: e, align: t = "start", collisionPadding: o = j, ...l } = n, i = ve(e);
981
998
  return /* @__PURE__ */ d(
982
- re.Content,
999
+ le.Content,
983
1000
  {
984
1001
  ...i,
985
- ...r,
1002
+ ...l,
986
1003
  ref: s,
987
1004
  align: t,
988
1005
  collisionPadding: o,
989
1006
  style: {
990
1007
  // Ensure border-box for floating-ui calculations
991
1008
  boxSizing: "border-box",
992
- ...r.style,
1009
+ ...l.style,
993
1010
  "--radix-select-content-transform-origin": "var(--radix-popper-transform-origin)",
994
1011
  "--radix-select-content-available-width": "var(--radix-popper-available-width)",
995
1012
  "--radix-select-content-available-height": "var(--radix-popper-available-height)",
@@ -1002,11 +1019,11 @@ const Ao = "SelectPopperPosition", Te = l.forwardRef(
1002
1019
  );
1003
1020
  Te.displayName = Ao;
1004
1021
  const [_o, He] = ae(
1005
- ne,
1022
+ re,
1006
1023
  {}
1007
- ), Ee = "SelectViewport", $e = l.forwardRef(
1024
+ ), Ve = "SelectViewport", $e = r.forwardRef(
1008
1025
  (n, s) => {
1009
- const { __scopeSelect: e, ...t } = n, o = J(Ee, e), r = He(Ee, e), i = _(s, o.onViewportChange), c = l.useRef(0);
1026
+ const { __scopeSelect: e, ...t } = n, o = Q(Ve, e), l = He(Ve, e), i = _(s, o.onViewportChange), c = r.useRef(0);
1010
1027
  return /* @__PURE__ */ Ne(Ae, { children: [
1011
1028
  /* @__PURE__ */ d(
1012
1029
  "style",
@@ -1032,49 +1049,49 @@ const [_o, He] = ae(
1032
1049
  overflow: "auto",
1033
1050
  ...t.style
1034
1051
  },
1035
- onScroll: E(t.onScroll, (a) => {
1036
- const m = a.currentTarget, { contentWrapper: f, shouldExpandOnScrollRef: S } = r;
1037
- if (S?.current && f) {
1038
- const h = Math.abs(c.current - m.scrollTop);
1039
- if (h > 0) {
1040
- const u = window.innerHeight - G * 2, p = parseFloat(f.style.minHeight), g = parseFloat(f.style.height), C = Math.max(p, g);
1041
- if (C < u) {
1042
- const v = C + h, x = Math.min(u, v), w = v - x;
1043
- f.style.height = `${x}px`, f.style.bottom === "0px" && (m.scrollTop = w > 0 ? w : 0, f.style.justifyContent = "flex-end");
1052
+ onScroll: T(t.onScroll, (a) => {
1053
+ const g = a.currentTarget, { contentWrapper: f, shouldExpandOnScrollRef: v } = l;
1054
+ if (v?.current && f) {
1055
+ const p = Math.abs(c.current - g.scrollTop);
1056
+ if (p > 0) {
1057
+ const u = window.innerHeight - j * 2, m = parseFloat(f.style.minHeight), S = parseFloat(f.style.height), x = Math.max(m, S);
1058
+ if (x < u) {
1059
+ const C = x + p, h = Math.min(u, C), w = C - h;
1060
+ f.style.height = `${h}px`, f.style.bottom === "0px" && (g.scrollTop = w > 0 ? w : 0, f.style.justifyContent = "flex-end");
1044
1061
  }
1045
1062
  }
1046
1063
  }
1047
- c.current = m.scrollTop;
1064
+ c.current = g.scrollTop;
1048
1065
  })
1049
1066
  }
1050
1067
  ) })
1051
1068
  ] });
1052
1069
  }
1053
1070
  );
1054
- $e.displayName = Ee;
1055
- const vt = "SelectGroup", [Mo, Oo] = ae(vt), Ue = l.forwardRef(
1071
+ $e.displayName = Ve;
1072
+ const bt = "SelectGroup", [Mo, Oo] = ae(bt), Ue = r.forwardRef(
1056
1073
  (n, s) => {
1057
- const { __scopeSelect: e, ...t } = n, o = oe();
1074
+ const { __scopeSelect: e, ...t } = n, o = ne();
1058
1075
  return /* @__PURE__ */ d(Mo, { scope: e, id: o, children: /* @__PURE__ */ d(N.div, { role: "group", "aria-labelledby": o, ...t, ref: s }) });
1059
1076
  }
1060
1077
  );
1061
- Ue.displayName = vt;
1062
- const St = "SelectLabel", Ke = l.forwardRef(
1078
+ Ue.displayName = bt;
1079
+ const wt = "SelectLabel", Ke = r.forwardRef(
1063
1080
  (n, s) => {
1064
- const { __scopeSelect: e, ...t } = n, o = Oo(St, e);
1081
+ const { __scopeSelect: e, ...t } = n, o = Oo(wt, e);
1065
1082
  return /* @__PURE__ */ d(N.div, { id: o.id, ...t, ref: s });
1066
1083
  }
1067
1084
  );
1068
- Ke.displayName = St;
1069
- const xe = "SelectItem", [Do, bt] = ae(xe), We = l.forwardRef(
1085
+ Ke.displayName = wt;
1086
+ const ge = "SelectItem", [Do, yt] = ae(ge), We = r.forwardRef(
1070
1087
  (n, s) => {
1071
- const { __scopeSelect: e, value: t, disabled: o = !1, textValue: r, ...i } = n, c = Y(xe, e), a = J(xe, e), m = typeof t == "string" ? Array.isArray(c.value) ? c.value.includes(t) : c.value === t : t.every((x) => c.value?.includes(x)), f = Array.isArray(c.value) && Array.isArray(t) && t.some((x) => c.value?.includes(x)), [S, h] = l.useState(r ?? ""), [u, p] = l.useState(!1), g = _(
1088
+ const { __scopeSelect: e, value: t, disabled: o = !1, textValue: l, ...i } = n, c = q(ge, e), a = Q(ge, e), g = typeof t == "string" ? Array.isArray(c.value) ? c.value.includes(t) : c.value === t : t.every((h) => c.value?.includes(h)), f = Array.isArray(c.value) && Array.isArray(t) && t.some((h) => c.value?.includes(h)), [v, p] = r.useState(l ?? ""), [u, m] = r.useState(!1), S = _(
1072
1089
  s,
1073
- (x) => a.itemRefCallback?.(x, t, o)
1074
- ), C = oe(), v = () => {
1090
+ (h) => a.itemRefCallback?.(h, t, o)
1091
+ ), x = ne(), C = () => {
1075
1092
  if (!o) {
1076
- let x = c.multi && typeof t == "string" ? [t] : t;
1077
- f && !m ? c.onValueChange(x) : Array.isArray(c.value) && (x = Et(t, c.value)), c.onValueChange(x), c.multi || c.onOpenChange(!1);
1093
+ let h = c.multi && typeof t == "string" ? [t] : t;
1094
+ f && !g ? c.onValueChange(h) : Array.isArray(c.value) && (h = Pt(t, c.value)), c.onValueChange(h), c.multi || c.onOpenChange(!1);
1078
1095
  }
1079
1096
  };
1080
1097
  if (!c.multi && Array.isArray(t))
@@ -1085,37 +1102,37 @@ const xe = "SelectItem", [Do, bt] = ae(xe), We = l.forwardRef(
1085
1102
  scope: e,
1086
1103
  value: t,
1087
1104
  disabled: o,
1088
- textId: C,
1089
- isSelected: m,
1105
+ textId: x,
1106
+ isSelected: g,
1090
1107
  isIntermediate: f,
1091
- onItemTextChange: l.useCallback((x) => {
1092
- h((w) => w || (x?.textContent ?? "").trim());
1108
+ onItemTextChange: r.useCallback((h) => {
1109
+ p((w) => w || (h?.textContent ?? "").trim());
1093
1110
  }, []),
1094
- children: /* @__PURE__ */ d(Ce.ItemSlot, { scope: e, value: t, disabled: o, textValue: S, children: /* @__PURE__ */ d(
1111
+ children: /* @__PURE__ */ d(Ce.ItemSlot, { scope: e, value: t, disabled: o, textValue: v, children: /* @__PURE__ */ d(
1095
1112
  N.div,
1096
1113
  {
1097
1114
  role: "option",
1098
- "aria-labelledby": C,
1115
+ "aria-labelledby": x,
1099
1116
  "data-highlighted": u ? "" : void 0,
1100
- "aria-selected": c.multi ? void 0 : m && u,
1101
- "aria-checked": c.multi ? m : void 0,
1102
- "data-state": m ? "checked" : "unchecked",
1117
+ "aria-selected": c.multi ? void 0 : g && u,
1118
+ "aria-checked": c.multi ? g : void 0,
1119
+ "data-state": g ? "checked" : "unchecked",
1103
1120
  "aria-disabled": o || void 0,
1104
1121
  "data-disabled": o ? "" : void 0,
1105
1122
  tabIndex: o ? void 0 : -1,
1106
1123
  ...i,
1107
- ref: g,
1108
- onFocus: E(i.onFocus, () => p(!0)),
1109
- onBlur: E(i.onBlur, () => p(!1)),
1110
- onPointerUp: E(i.onPointerUp, v),
1111
- onPointerMove: E(i.onPointerMove, (x) => {
1112
- o ? a.onItemLeave?.() : x.currentTarget.focus({ preventScroll: !0 });
1124
+ ref: S,
1125
+ onFocus: T(i.onFocus, () => m(!0)),
1126
+ onBlur: T(i.onBlur, () => m(!1)),
1127
+ onPointerUp: T(i.onPointerUp, C),
1128
+ onPointerMove: T(i.onPointerMove, (h) => {
1129
+ o ? a.onItemLeave?.() : h.currentTarget.focus({ preventScroll: !0 });
1113
1130
  }),
1114
- onPointerLeave: E(i.onPointerLeave, (x) => {
1115
- x.currentTarget === document.activeElement && a.onItemLeave?.();
1131
+ onPointerLeave: T(i.onPointerLeave, (h) => {
1132
+ h.currentTarget === document.activeElement && a.onItemLeave?.();
1116
1133
  }),
1117
- onKeyDown: E(i.onKeyDown, (x) => {
1118
- a.searchRef?.current !== "" && x.key === " " || (bo.includes(x.key) && v(), x.key === " " && x.preventDefault());
1134
+ onKeyDown: T(i.onKeyDown, (h) => {
1135
+ a.searchRef?.current !== "" && h.key === " " || (bo.includes(h.key) && C(), h.key === " " && h.preventDefault());
1119
1136
  })
1120
1137
  }
1121
1138
  ) })
@@ -1123,15 +1140,15 @@ const xe = "SelectItem", [Do, bt] = ae(xe), We = l.forwardRef(
1123
1140
  );
1124
1141
  }
1125
1142
  );
1126
- We.displayName = xe;
1127
- const fe = "SelectItemText", ze = l.forwardRef(
1143
+ We.displayName = ge;
1144
+ const fe = "SelectItemText", ze = r.forwardRef(
1128
1145
  (n, s) => {
1129
- const { __scopeSelect: e, className: t, style: o, ...r } = n, i = Y(fe, e), c = J(fe, e), a = bt(fe, e), m = Eo(fe, e), [f, S] = l.useState(null), h = _(
1146
+ const { __scopeSelect: e, className: t, style: o, ...l } = n, i = q(fe, e), c = Q(fe, e), a = yt(fe, e), g = Vo(fe, e), [f, v] = r.useState(null), p = _(
1130
1147
  s,
1131
- (v) => S(v),
1148
+ (C) => v(C),
1132
1149
  a.onItemTextChange,
1133
- (v) => c.itemTextRefCallback?.(v, a.value, a.disabled)
1134
- ), u = f?.textContent, p = l.useMemo(
1150
+ (C) => c.itemTextRefCallback?.(C, a.value, a.disabled)
1151
+ ), u = f?.textContent, m = r.useMemo(
1135
1152
  () => /* @__PURE__ */ d(
1136
1153
  "option",
1137
1154
  {
@@ -1142,37 +1159,37 @@ const fe = "SelectItemText", ze = l.forwardRef(
1142
1159
  Array.isArray(a.value) ? a.value.join(";") : a.value
1143
1160
  ),
1144
1161
  [a.disabled, a.value, u]
1145
- ), { onNativeOptionAdd: g, onNativeOptionRemove: C } = m;
1146
- return B(() => (g(p), () => C(p)), [g, C, p]), /* @__PURE__ */ Ne(Ae, { children: [
1147
- /* @__PURE__ */ d(N.span, { id: a.textId, ...r, ref: h }),
1148
- a.isSelected && i.valueNode && !i.valueNodeHasChildren ? _e.createPortal(r.children, i.valueNode) : null
1162
+ ), { onNativeOptionAdd: S, onNativeOptionRemove: x } = g;
1163
+ return H(() => (S(m), () => x(m)), [S, x, m]), /* @__PURE__ */ Ne(Ae, { children: [
1164
+ /* @__PURE__ */ d(N.span, { id: a.textId, ...l, ref: p }),
1165
+ a.isSelected && i.valueNode && !i.valueNodeHasChildren ? _e.createPortal(l.children, i.valueNode) : null
1149
1166
  ] });
1150
1167
  }
1151
1168
  );
1152
1169
  ze.displayName = fe;
1153
- const wt = "SelectItemIndicator", Ge = l.forwardRef(
1170
+ const It = "SelectItemIndicator", Ge = r.forwardRef(
1154
1171
  (n, s) => {
1155
- const { __scopeSelect: e, children: t, ...o } = n, r = bt(wt, e);
1172
+ const { __scopeSelect: e, children: t, ...o } = n, l = yt(It, e);
1156
1173
  return typeof t == "function" ? /* @__PURE__ */ d(N.span, { "aria-hidden": !0, ...o, ref: s, children: t({
1157
- isSelected: r.isSelected,
1158
- isIntermediate: r.isIntermediate
1159
- }) }) : r.isSelected ? /* @__PURE__ */ d(N.span, { "aria-hidden": !0, ...o, ref: s, children: t }) : null;
1174
+ isSelected: l.isSelected,
1175
+ isIntermediate: l.isIntermediate
1176
+ }) }) : l.isSelected ? /* @__PURE__ */ d(N.span, { "aria-hidden": !0, ...o, ref: s, children: t }) : null;
1160
1177
  }
1161
1178
  );
1162
- Ge.displayName = wt;
1163
- const Pe = "SelectScrollUpButton", je = l.forwardRef(
1179
+ Ge.displayName = It;
1180
+ const Ee = "SelectScrollUpButton", je = r.forwardRef(
1164
1181
  (n, s) => {
1165
- const e = J(Pe, n.__scopeSelect), t = He(Pe, n.__scopeSelect), [o, r] = l.useState(!1), i = _(s, t.onScrollButtonChange);
1166
- return B(() => {
1182
+ const e = Q(Ee, n.__scopeSelect), t = He(Ee, n.__scopeSelect), [o, l] = r.useState(!1), i = _(s, t.onScrollButtonChange);
1183
+ return H(() => {
1167
1184
  if (e.viewport && e.isPositioned) {
1168
1185
  const c = e.viewport, a = () => {
1169
- const m = c.scrollTop > 0;
1170
- r(m);
1186
+ const g = c.scrollTop > 0;
1187
+ l(g);
1171
1188
  };
1172
1189
  return a(), c.addEventListener("scroll", a), () => c.removeEventListener("scroll", a);
1173
1190
  }
1174
1191
  }, [e.viewport, e.isPositioned]), o ? /* @__PURE__ */ d(
1175
- yt,
1192
+ Tt,
1176
1193
  {
1177
1194
  ...n,
1178
1195
  ref: i,
@@ -1184,20 +1201,20 @@ const Pe = "SelectScrollUpButton", je = l.forwardRef(
1184
1201
  ) : null;
1185
1202
  }
1186
1203
  );
1187
- je.displayName = Pe;
1188
- const Ve = "SelectScrollDownButton", Ye = l.forwardRef(
1204
+ je.displayName = Ee;
1205
+ const Pe = "SelectScrollDownButton", Ye = r.forwardRef(
1189
1206
  (n, s) => {
1190
- const e = J(Ve, n.__scopeSelect), t = He(Ve, n.__scopeSelect), [o, r] = l.useState(!1), i = _(s, t.onScrollButtonChange);
1191
- return B(() => {
1207
+ const e = Q(Pe, n.__scopeSelect), t = He(Pe, n.__scopeSelect), [o, l] = r.useState(!1), i = _(s, t.onScrollButtonChange);
1208
+ return H(() => {
1192
1209
  if (e.viewport && e.isPositioned) {
1193
1210
  const c = e.viewport, a = () => {
1194
- const m = c.scrollHeight - c.clientHeight, f = Math.ceil(c.scrollTop) < m;
1195
- r(f);
1211
+ const g = c.scrollHeight - c.clientHeight, f = Math.ceil(c.scrollTop) < g;
1212
+ l(f);
1196
1213
  };
1197
1214
  return a(), c.addEventListener("scroll", a), () => c.removeEventListener("scroll", a);
1198
1215
  }
1199
1216
  }, [e.viewport, e.isPositioned]), o ? /* @__PURE__ */ d(
1200
- yt,
1217
+ Tt,
1201
1218
  {
1202
1219
  ...n,
1203
1220
  ref: i,
@@ -1209,13 +1226,13 @@ const Ve = "SelectScrollDownButton", Ye = l.forwardRef(
1209
1226
  ) : null;
1210
1227
  }
1211
1228
  );
1212
- Ye.displayName = Ve;
1213
- const yt = l.forwardRef(
1229
+ Ye.displayName = Pe;
1230
+ const Tt = r.forwardRef(
1214
1231
  (n, s) => {
1215
- const { __scopeSelect: e, onAutoScroll: t, ...o } = n, r = J("SelectScrollButton", e), i = l.useRef(null), c = ge(e), a = l.useCallback(() => {
1232
+ const { __scopeSelect: e, onAutoScroll: t, ...o } = n, l = Q("SelectScrollButton", e), i = r.useRef(null), c = he(e), a = r.useCallback(() => {
1216
1233
  i.current !== null && (window.clearInterval(i.current), i.current = null);
1217
1234
  }, []);
1218
- return l.useEffect(() => () => a(), [a]), B(() => {
1235
+ return r.useEffect(() => () => a(), [a]), H(() => {
1219
1236
  c().find((f) => f.ref.current === document.activeElement)?.ref.current?.scrollIntoView({ block: "nearest" });
1220
1237
  }, [c]), /* @__PURE__ */ d(
1221
1238
  N.div,
@@ -1224,37 +1241,37 @@ const yt = l.forwardRef(
1224
1241
  ...o,
1225
1242
  ref: s,
1226
1243
  style: { flexShrink: 0, ...o.style },
1227
- onPointerMove: E(o.onPointerMove, () => {
1228
- r.onItemLeave?.(), i.current === null && (i.current = window.setInterval(t, 50));
1244
+ onPointerMove: T(o.onPointerMove, () => {
1245
+ l.onItemLeave?.(), i.current === null && (i.current = window.setInterval(t, 50));
1229
1246
  }),
1230
- onPointerLeave: E(o.onPointerLeave, () => {
1247
+ onPointerLeave: T(o.onPointerLeave, () => {
1231
1248
  a();
1232
1249
  })
1233
1250
  }
1234
1251
  );
1235
1252
  }
1236
- ), ko = "SelectSeparator", qe = l.forwardRef(
1253
+ ), ko = "SelectSeparator", qe = r.forwardRef(
1237
1254
  (n, s) => {
1238
1255
  const { __scopeSelect: e, ...t } = n;
1239
1256
  return /* @__PURE__ */ d(N.div, { "aria-hidden": !0, ...t, ref: s });
1240
1257
  }
1241
1258
  );
1242
1259
  qe.displayName = ko;
1243
- const Re = "SelectArrow", Xe = l.forwardRef(
1260
+ const Re = "SelectArrow", Xe = r.forwardRef(
1244
1261
  (n, s) => {
1245
- const { __scopeSelect: e, ...t } = n, o = ve(e), r = Y(Re, e), i = J(Re, e);
1246
- return r.open && i.position === "popper" ? /* @__PURE__ */ d(re.Arrow, { ...o, ...t, ref: s }) : null;
1262
+ const { __scopeSelect: e, ...t } = n, o = ve(e), l = q(Re, e), i = Q(Re, e);
1263
+ return l.open && i.position === "popper" ? /* @__PURE__ */ d(le.Arrow, { ...o, ...t, ref: s }) : null;
1247
1264
  }
1248
1265
  );
1249
1266
  Xe.displayName = Re;
1250
- const Fo = "BubbleSelect", Lo = l.forwardRef(
1267
+ const Fo = "BubbleSelect", Lo = r.forwardRef(
1251
1268
  (n, s) => {
1252
- const { value: e, ...t } = n, o = l.useRef(null), r = _(s, o), i = _t(e), c = Y(Fo, void 0);
1253
- l.useEffect(() => {
1254
- const m = o.current, f = window.HTMLSelectElement.prototype, h = Object.getOwnPropertyDescriptor(f, "value").set;
1255
- if (i !== e && h) {
1269
+ const { value: e, ...t } = n, o = r.useRef(null), l = _(s, o), i = _t(e), c = q(Fo, void 0);
1270
+ r.useEffect(() => {
1271
+ const g = o.current, f = window.HTMLSelectElement.prototype, p = Object.getOwnPropertyDescriptor(f, "value").set;
1272
+ if (i !== e && p) {
1256
1273
  const u = new Event("change", { bubbles: !0 });
1257
- h.call(m, e), m.dispatchEvent(u);
1274
+ p.call(g, e), g.dispatchEvent(u);
1258
1275
  }
1259
1276
  }, [i, e]);
1260
1277
  let a = e;
@@ -1263,43 +1280,43 @@ const Fo = "BubbleSelect", Lo = l.forwardRef(
1263
1280
  {
1264
1281
  ...t,
1265
1282
  multiple: c.multi ? !0 : void 0,
1266
- ref: r,
1283
+ ref: l,
1267
1284
  defaultValue: a
1268
1285
  }
1269
1286
  ) });
1270
1287
  }
1271
1288
  );
1272
1289
  Lo.displayName = "BubbleSelect";
1273
- function It(n) {
1274
- const s = At(n), e = l.useRef(""), t = l.useRef(0), o = l.useCallback(
1290
+ function Vt(n) {
1291
+ const s = At(n), e = r.useRef(""), t = r.useRef(0), o = r.useCallback(
1275
1292
  (i) => {
1276
1293
  const c = e.current + i;
1277
- s(c), function a(m) {
1278
- e.current = m, window.clearTimeout(t.current), m !== "" && (t.current = window.setTimeout(() => a(""), 1e3));
1294
+ s(c), function a(g) {
1295
+ e.current = g, window.clearTimeout(t.current), g !== "" && (t.current = window.setTimeout(() => a(""), 1e3));
1279
1296
  }(c);
1280
1297
  },
1281
1298
  [s]
1282
- ), r = l.useCallback(() => {
1299
+ ), l = r.useCallback(() => {
1283
1300
  e.current = "", window.clearTimeout(t.current);
1284
1301
  }, []);
1285
- return l.useEffect(() => () => window.clearTimeout(t.current), []), [e, o, r];
1302
+ return r.useEffect(() => () => window.clearTimeout(t.current), []), [e, o, l];
1286
1303
  }
1287
- function Tt(n, s, e) {
1288
- const o = s.length > 1 && Array.from(s).every((m) => m === s[0]) ? s[0] : s, r = e ? n.indexOf(e) : -1;
1289
- let i = Bo(n, Math.max(r, 0));
1290
- o.length === 1 && (i = i.filter((m) => m !== e));
1291
- const a = i.find((m) => m.textValue.toLowerCase().startsWith(o.toLowerCase()));
1304
+ function Et(n, s, e) {
1305
+ const o = s.length > 1 && Array.from(s).every((g) => g === s[0]) ? s[0] : s, l = e ? n.indexOf(e) : -1;
1306
+ let i = Bo(n, Math.max(l, 0));
1307
+ o.length === 1 && (i = i.filter((g) => g !== e));
1308
+ const a = i.find((g) => g.textValue.toLowerCase().startsWith(o.toLowerCase()));
1292
1309
  return a !== e ? a : void 0;
1293
1310
  }
1294
1311
  function Bo(n, s) {
1295
1312
  return n.map((e, t) => n[(s + t) % n.length]);
1296
1313
  }
1297
- const Et = (n, s = []) => {
1314
+ const Pt = (n, s = []) => {
1298
1315
  if (Array.isArray(n))
1299
- return n.reduce((t, o) => Et(o, t), s);
1316
+ return n.reduce((t, o) => Pt(o, t), s);
1300
1317
  const e = s.indexOf(n);
1301
1318
  return e === -1 ? [...s, n] : [...s.slice(0, e), ...s.slice(e + 1)];
1302
- }, Ho = Oe, $o = De, Uo = ke, Ko = Fe, Wo = Le, zo = Be, Go = $e, jo = Ue, Yo = Ke, qo = We, Xo = ze, Zo = Ge, Jo = je, Qo = Ye, en = qe, tn = Xe, En = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
1319
+ }, Ho = Oe, $o = De, Uo = ke, Ko = Fe, Wo = Le, zo = Be, Go = $e, jo = Ue, Yo = Ke, qo = We, Xo = ze, Zo = Ge, Jo = je, Qo = Ye, en = qe, tn = Xe, Vn = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
1303
1320
  __proto__: null,
1304
1321
  Arrow: tn,
1305
1322
  Content: zo,
@@ -1337,6 +1354,6 @@ const Et = (n, s = []) => {
1337
1354
  }, Symbol.toStringTag, { value: "Module" }));
1338
1355
  export {
1339
1356
  Tn as Combobox,
1340
- En as Select,
1357
+ Vn as Select,
1341
1358
  Rn as useCallbackRef
1342
1359
  };