@strapi/ui-primitives 1.7.0-alpha.4 → 1.7.0

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