impact-nova 1.7.24 → 1.7.26

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (25) hide show
  1. package/dist/components/ui/ag-grid-react/cell-renderers/editors/input-cell-editor.js +45 -36
  2. package/dist/components/ui/ag-grid-react/cell-renderers/editors/split-cell-editor.d.ts +0 -1
  3. package/dist/components/ui/ag-grid-react/cell-renderers/editors/split-cell-editor.js +92 -75
  4. package/dist/components/ui/ag-grid-react/cell-renderers/split-cell-renderer.js +52 -41
  5. package/dist/components/ui/ag-grid-react/hooks/useStopEditingOnClickOutside.d.ts +5 -0
  6. package/dist/components/ui/alert.d.ts +1 -1
  7. package/dist/components/ui/data-table/data-table-column-list.js +119 -108
  8. package/dist/components/ui/nested-list/components/NestedListContent.d.ts +1 -0
  9. package/dist/components/ui/nested-list/components/NestedListContent.js +134 -63
  10. package/dist/components/ui/nested-list/components/SortableItem.js +65 -82
  11. package/dist/components/ui/nested-list/hooks/useNestedListDragDrop.js +176 -153
  12. package/dist/components/ui/nested-list/nested-list.js +190 -203
  13. package/dist/components/ui/select/components/Submenu.js +7 -5
  14. package/dist/components/ui/select/select.js +390 -369
  15. package/dist/i18n/defaultMessages.d.ts +3 -0
  16. package/dist/i18n/defaultMessages.js +14 -11
  17. package/dist/i18n/locales/de.js +4 -1
  18. package/dist/i18n/locales/es.js +4 -1
  19. package/dist/i18n/locales/hi.js +4 -1
  20. package/dist/i18n/locales/kn.js +4 -1
  21. package/dist/icons/assets/DraftNote.svg.js +5 -0
  22. package/dist/icons/index.d.ts +1 -0
  23. package/dist/icons/index.js +253 -251
  24. package/dist/impact-nova.css +1 -1
  25. package/package.json +1 -1
@@ -1,79 +1,79 @@
1
- import { jsxs as x, jsx as r, Fragment as pt } from "react/jsx-runtime";
2
- import { useState as K, useRef as M, useEffect as L } from "react";
3
- import * as se from "@radix-ui/react-popover";
4
- import { useVirtualizer as ht } from "@tanstack/react-virtual";
5
- import xt from "./components/LabelWithSequence.js";
6
- import gt from "./components/Submenu.js";
7
- import { LoadingSpinner as bt, Cross as vt, ChevronRight as ze, Search as yt, Info as ie } from "../../../icons/index.js";
8
- import { Checkbox as Ge } from "../checkbox.js";
9
- import { Button as St } from "../button.js";
1
+ import { jsxs as g, jsx as r, Fragment as gt } from "react/jsx-runtime";
2
+ import bt, { useState as W, useRef as F, useEffect as C } from "react";
3
+ import * as ae from "@radix-ui/react-popover";
4
+ import { useVirtualizer as vt } from "@tanstack/react-virtual";
5
+ import St from "./components/LabelWithSequence.js";
6
+ import yt from "./components/Submenu.js";
7
+ import { LoadingSpinner as wt, Cross as Vt, ChevronRight as Me, Search as Nt, Info as oe } from "../../../icons/index.js";
8
+ import { Checkbox as Fe } from "../checkbox.js";
9
+ import { Button as kt } from "../button.js";
10
10
  import { cn as w } from "../../../lib/utils.js";
11
- import { isInvertedSelection as T, isOptionArray as V, isSelected as wt, getSequence as Vt, getLeafOptions as Nt } from "./utils/select.js";
12
- import { useFlattenOptions as kt } from "./hooks/useFlattenOptions.js";
13
- import { useSelectionModel as Pt } from "./hooks/useSelectionModel.js";
14
- import { useVisibleStats as Dt } from "./hooks/useVisibleStats.js";
15
- import { useImpactNovaI18n as At } from "../../../i18n/ImpactNovaI18nContext.js";
16
- const Ot = (Se) => {
11
+ import { isInvertedSelection as T, isOptionArray as V, isSelected as Pt, getSequence as Dt, getLeafOptions as Ot } from "./utils/select.js";
12
+ import { useFlattenOptions as At } from "./hooks/useFlattenOptions.js";
13
+ import { useSelectionModel as It } from "./hooks/useSelectionModel.js";
14
+ import { useVisibleStats as Ct } from "./hooks/useVisibleStats.js";
15
+ import { useImpactNovaI18n as Et } from "../../../i18n/ImpactNovaI18nContext.js";
16
+ const Tt = (Ve) => {
17
17
  const {
18
- options: F,
19
- value: re,
20
- defaultValue: Me,
18
+ options: R,
19
+ value: ce,
20
+ defaultValue: Re,
21
21
  onChange: u,
22
- isMulti: f,
23
- isDisabled: N,
24
- isLoading: I,
25
- isClearable: Le = !0,
26
- isSearchable: E = !0,
27
- placeholder: Fe,
22
+ isMulti: m,
23
+ isDisabled: k,
24
+ isLoading: E,
25
+ isClearable: He = !0,
26
+ isSearchable: L = !0,
27
+ placeholder: _e,
28
28
  // menuPortalTarget is kept for API compatibility but no longer used (Radix handles portalling)
29
- menuPortalTarget: Ct,
30
- autoFocus: Re,
31
- closeMenuOnSelect: He = !f,
32
- defaultMenuIsOpen: je = !1,
33
- scrollToSelectedOnOpen: we = !1,
34
- maxSelectableOptions: g,
35
- showSequence: Ve,
36
- selectionOrder: qe,
37
- label: R,
38
- isRequired: _e,
39
- error: ae,
40
- helperText: U,
41
- helperTextPosition: oe = "absolute",
42
- id: k,
43
- className: Be,
44
- parentClassName: Ke,
45
- onMenuScrollToBottom: ce,
46
- name: Ue,
47
- isSelectAllEnabled: J = !0,
29
+ menuPortalTarget: Lt,
30
+ autoFocus: je,
31
+ closeMenuOnSelect: qe = !m,
32
+ defaultMenuIsOpen: Be = !1,
33
+ scrollToSelectedOnOpen: Ne = !1,
34
+ maxSelectableOptions: b,
35
+ showSequence: ke,
36
+ selectionOrder: Ke,
37
+ label: H,
38
+ isRequired: Ue,
39
+ error: ue,
40
+ helperText: X,
41
+ helperTextPosition: de = "absolute",
42
+ id: P,
43
+ className: We,
44
+ parentClassName: Xe,
45
+ onMenuScrollToBottom: $,
46
+ name: Ye,
47
+ isSelectAllEnabled: Q = !0,
48
48
  isReadOnly: p = !1,
49
- searchPosition: $ = "menu",
50
- footerContent: Ne,
51
- onInputChange: We,
52
- getOptionLabel: ke,
53
- renderOption: Pe,
54
- onMenuOpen: Xe,
55
- onMenuClose: De,
56
- labelOrientation: ue = "top",
57
- leftContent: Ae,
58
- ignoreCase: Ye,
59
- ignoreAccents: Je,
60
- matchFrom: Qe,
61
- stringify: Ze,
62
- trim: et,
63
- filterOption: tt,
64
- enableSubMenus: y = !1,
65
- enableGroups: P = !1,
66
- fetchError: H,
67
- onRefetch: Oe,
68
- menuWidth: lt,
69
- onClearAll: Ce,
70
- onFocus: nt,
71
- onBlur: st
72
- } = Se, { t: W } = At(), de = Fe ?? W("select.placeholder"), [b, Ie] = K(je), [z, Q] = K(""), [Te, fe] = K(void 0), [d, v] = K(Me || (f ? [] : null)), [it, me] = K(null), X = -2, [D, C] = K(-1), pe = M(!1), he = M(null), xe = M(null), rt = M(null), Y = M(null), j = M(null);
73
- L(() => {
74
- re !== void 0 && v(re);
75
- }, [re]), L(() => {
76
- if (!(b && E && $ === "menu")) return;
49
+ searchPosition: z = "menu",
50
+ footerContent: Pe,
51
+ onInputChange: Je,
52
+ getOptionLabel: De,
53
+ renderOption: Oe,
54
+ onMenuOpen: Qe,
55
+ onMenuClose: Ae,
56
+ labelOrientation: fe = "top",
57
+ leftContent: Ie,
58
+ ignoreCase: Ze,
59
+ ignoreAccents: et,
60
+ matchFrom: tt,
61
+ stringify: lt,
62
+ trim: nt,
63
+ filterOption: st,
64
+ enableSubMenus: S = !1,
65
+ enableGroups: D = !1,
66
+ fetchError: _,
67
+ onRefetch: Ce,
68
+ menuWidth: it,
69
+ onClearAll: Ee,
70
+ onFocus: rt,
71
+ onBlur: at
72
+ } = Ve, { t: Y } = Et(), me = _e ?? Y("select.placeholder"), [h, Te] = W(Be), [G, Z] = W(""), [Le, pe] = W(void 0), [d, v] = W(Re || (m ? [] : null)), [ot, he] = W(null), J = -2, [O, A] = W(-1), xe = F(!1), ge = F(null), ee = F(null), ct = F(null), te = F(null), j = F(null);
73
+ C(() => {
74
+ ce !== void 0 && v(ce);
75
+ }, [ce]), C(() => {
76
+ if (!(h && L && z === "menu")) return;
77
77
  let e = !1;
78
78
  const t = () => {
79
79
  !e && j.current && j.current.focus();
@@ -83,108 +83,127 @@ const Ot = (Se) => {
83
83
  return () => {
84
84
  e = !0, clearTimeout(l);
85
85
  };
86
- }, [b, E, $]);
87
- const { flatOptions: m, isProcessing: O, totalOptionsCount: Ee, workerSelectAll: at } = kt(F, z, {
88
- ignoreCase: Ye,
89
- ignoreAccents: Je,
90
- matchFrom: Qe,
91
- stringify: Ze,
92
- trim: et,
93
- filterOption: tt,
94
- enableSubMenus: y,
95
- enableGroups: P
96
- }), S = Pt(d, f ?? !1), { stats: q, getGroupStats: ge } = Dt(
97
- m,
98
- Ee,
99
- z,
100
- S,
86
+ }, [h, L, z]);
87
+ const { flatOptions: f, isProcessing: I, totalOptionsCount: $e, workerSelectAll: ut } = At(R, G, {
88
+ ignoreCase: Ze,
89
+ ignoreAccents: et,
90
+ matchFrom: tt,
91
+ stringify: lt,
92
+ trim: nt,
93
+ filterOption: st,
94
+ enableSubMenus: S,
95
+ enableGroups: D
96
+ }), y = It(d, m ?? !1), { stats: q, getGroupStats: be } = Ct(
97
+ f,
98
+ $e,
99
+ G,
100
+ y,
101
101
  d,
102
- f ?? !1
103
- ), A = ht({
104
- count: m.length,
105
- getScrollElement: () => Y.current,
102
+ m ?? !1
103
+ ), N = vt({
104
+ count: f.length,
105
+ getScrollElement: () => te.current,
106
106
  estimateSize: () => 34,
107
107
  overscan: 5
108
108
  });
109
- L(() => {
110
- if (!b)
111
- fe(void 0), C(-1);
112
- else if (pe.current)
113
- if (pe.current = !1, E && $ === "menu" && !p)
114
- C(-1);
109
+ C(() => {
110
+ if (!h)
111
+ pe(void 0), A(-1);
112
+ else if (xe.current)
113
+ if (xe.current = !1, L && z === "menu" && !p)
114
+ A(-1);
115
115
  else {
116
- const e = !I && !O && !H && f && J && !p && m.length > 0;
117
- C(e ? X : 0);
116
+ const e = !E && !I && !_ && m && Q && !p && f.length > 0;
117
+ A(e ? J : 0);
118
118
  }
119
- }, [b]), L(() => {
120
- D !== -1 && C(0);
121
- }, [z]), L(() => {
122
- if (!b) return;
119
+ }, [h]), C(() => {
120
+ O !== -1 && A(0);
121
+ }, [G]), C(() => {
122
+ if (!h) return;
123
123
  const e = requestAnimationFrame(() => {
124
- A.measure();
124
+ N.measure();
125
125
  });
126
126
  return () => cancelAnimationFrame(e);
127
- }, [b, A]), L(() => {
128
- if (b && we && !O && m.length > 0) {
129
- const e = m.findIndex((t) => f ? S.mode === "exclude" ? !S.set.has(t.value) : S.set.has(t.value) : d?.value === t.value);
127
+ }, [h, N]), C(() => {
128
+ if (h && Ne && !I && f.length > 0) {
129
+ const e = f.findIndex((t) => m ? y.mode === "exclude" ? !y.set.has(t.value) : y.set.has(t.value) : d?.value === t.value);
130
130
  if (e !== -1) {
131
131
  const t = setTimeout(() => {
132
- A.scrollToIndex(e, { align: "center" });
132
+ N.scrollToIndex(e, { align: "center" });
133
133
  }, 50);
134
134
  return () => clearTimeout(t);
135
135
  }
136
136
  }
137
- }, [b, we, O, m.length, f, S.mode, S.set, d, A]);
138
- const _ = M(null);
139
- L(() => {
140
- if (!Y.current || !ce) return;
137
+ }, [h, Ne, I, f.length, m, y.mode, y.set, d, N]);
138
+ const B = F(null), ze = N.getVirtualItems(), ve = ze[ze.length - 1], le = bt.useCallback(() => {
139
+ E || I || B.current || $ && ($(), B.current = setTimeout(() => {
140
+ B.current = null;
141
+ }, 500));
142
+ }, [E, I, $]);
143
+ C(() => () => {
144
+ B.current && (clearTimeout(B.current), B.current = null);
145
+ }, []), C(() => {
146
+ if (!h || !te.current || !$) return;
141
147
  const e = () => {
142
- if (I || O) return;
143
- const { scrollTop: l, scrollHeight: s, clientHeight: n } = Y.current;
144
- if (s - l - n <= 10) {
145
- if (_.current) return;
146
- ce(), _.current = setTimeout(() => {
147
- _.current = null;
148
- }, 500);
149
- }
150
- }, t = Y.current;
151
- return t.addEventListener("scroll", e), !I && !O && e(), () => {
152
- t.removeEventListener("scroll", e), _.current && (clearTimeout(_.current), _.current = null);
148
+ const { scrollTop: l, scrollHeight: s, clientHeight: n } = t;
149
+ s - l - n <= 64 && le();
150
+ }, t = te.current;
151
+ return t.addEventListener("scroll", e), e(), () => {
152
+ t.removeEventListener("scroll", e);
153
153
  };
154
154
  }, [
155
- ce,
156
- m.length,
157
- b,
158
- I,
159
- O
155
+ $,
156
+ h,
157
+ le
158
+ ]), C(() => {
159
+ if (!h || !$ || !ve) return;
160
+ const e = f.length - 1;
161
+ e < 0 || ve.index < e - 1 || le();
162
+ }, [
163
+ h,
164
+ $,
165
+ f.length,
166
+ ve,
167
+ le
160
168
  ]);
161
- const Z = (e) => {
162
- if (!N)
163
- if (Ie(e), e)
164
- Xe?.();
169
+ const K = (e) => {
170
+ if (!k)
171
+ if (Te(e), e)
172
+ Qe?.();
165
173
  else {
166
- const t = d, l = f && V(d) ? d.map((s) => s.value) : void 0;
167
- De?.(t, l), Q(""), me(null);
174
+ const t = d, l = m && V(d) ? d.map((s) => s.value) : void 0;
175
+ Ae?.(t, l), Z(""), he(null);
168
176
  }
169
- }, ee = (e) => {
170
- if (!(N || p || e.isDisabled || ("children" in e || "options" in e) && e.isParentSelectable === !1))
171
- if (f) {
177
+ };
178
+ C(() => {
179
+ if (!h) return;
180
+ const e = (t) => {
181
+ const l = t.target;
182
+ l && ee.current?.contains(l) || (t.preventDefault(), t.stopPropagation());
183
+ };
184
+ return document.addEventListener("scroll", e, !0), document.addEventListener("wheel", e, { passive: !1, capture: !0 }), document.addEventListener("touchmove", e, { passive: !1, capture: !0 }), () => {
185
+ document.removeEventListener("scroll", e, !0), document.removeEventListener("wheel", e, !0), document.removeEventListener("touchmove", e, !0);
186
+ };
187
+ }, [h]);
188
+ const ne = (e) => {
189
+ if (!(k || p || e.isDisabled || ("children" in e || "options" in e) && e.isParentSelectable === !1))
190
+ if (m) {
172
191
  const l = d || [];
173
192
  if ("children" in e || "options" in e) {
174
- const n = Nt(
193
+ const n = Ot(
175
194
  e,
176
- y,
177
- P
195
+ S,
196
+ D
178
197
  ).filter((i) => !i.isDisabled);
179
198
  if (T(l)) {
180
199
  const i = l.excludedValues, a = n.every(
181
- (h) => !i.includes(h.value)
200
+ (x) => !i.includes(x.value)
182
201
  );
183
202
  let c = [...i];
184
- a ? n.forEach((h) => {
185
- c.includes(h.value) || c.push(h.value);
203
+ a ? n.forEach((x) => {
204
+ c.includes(x.value) || c.push(x.value);
186
205
  }) : c = c.filter(
187
- (h) => !n.some((le) => le.value === h)
206
+ (x) => !n.some((ie) => ie.value === x)
188
207
  );
189
208
  const o = {
190
209
  isAllSelected: !0,
@@ -196,14 +215,14 @@ const Ot = (Se) => {
196
215
  });
197
216
  } else if (V(l)) {
198
217
  const i = l, a = n.every(
199
- (o) => i.some((h) => h.value === o.value)
218
+ (o) => i.some((x) => x.value === o.value)
200
219
  );
201
220
  let c = [...i];
202
221
  if (a ? c = c.filter(
203
- (o) => !n.some((h) => h.value === o.value)
222
+ (o) => !n.some((x) => x.value === o.value)
204
223
  ) : n.forEach((o) => {
205
- c.some((h) => h.value === o.value) || c.push(o);
206
- }), g && c.length > g)
224
+ c.some((x) => x.value === o.value) || c.push(o);
225
+ }), b && c.length > b)
207
226
  return;
208
227
  v(c), u && u(c, {
209
228
  action: "select-option",
@@ -223,12 +242,12 @@ const Ot = (Se) => {
223
242
  option: e
224
243
  });
225
244
  } else if (V(l)) {
226
- const s = l, n = f ? S.mode === "exclude" ? !S.set.has(e.value) : S.set.has(e.value) : d?.value === e.value;
245
+ const s = l, n = m ? y.mode === "exclude" ? !y.set.has(e.value) : y.set.has(e.value) : d?.value === e.value;
227
246
  let i = [];
228
247
  if (n)
229
248
  i = s.filter((a) => a.value !== e.value);
230
249
  else {
231
- if (g && l.length >= g)
250
+ if (b && l.length >= b)
232
251
  return;
233
252
  i = [...s, e];
234
253
  }
@@ -241,24 +260,24 @@ const Ot = (Se) => {
241
260
  v(e), u && u(e, {
242
261
  action: "select-option",
243
262
  option: e
244
- }), He && (Ie(!1), De?.(e, void 0), Q(""));
245
- }, be = async () => {
246
- if (!(!f || N || p)) {
247
- if (F.length > 3e3) {
263
+ }), qe && (Te(!1), Ae?.(e, void 0), Z(""));
264
+ }, Se = async () => {
265
+ if (!(!m || k || p)) {
266
+ if (R.length > 3e3) {
248
267
  try {
249
- const e = await at(
268
+ const e = await ut(
250
269
  d,
251
270
  T(d),
252
- g
271
+ b
253
272
  );
254
273
  v(e), u && u(e, { action: "select-option" });
255
274
  } catch {
256
275
  }
257
276
  return;
258
277
  }
259
- if (z) {
278
+ if (G) {
260
279
  let e = !1;
261
- for (const l of m)
280
+ for (const l of f)
262
281
  if (!l.isGroup && !l.isSubmenuParent && !l.isDisabled) {
263
282
  e = !0;
264
283
  break;
@@ -270,13 +289,13 @@ const Ot = (Se) => {
270
289
  const l = t.excludedValues, { totalVisible: s, selectedVisible: n } = q, i = s > 0 && s === n;
271
290
  let a = [...l];
272
291
  if (i)
273
- for (const o of m)
292
+ for (const o of f)
274
293
  !o.isGroup && !o.isSubmenuParent && !o.isDisabled && (a.includes(o.value) || a.push(o.value));
275
294
  else {
276
295
  const o = /* @__PURE__ */ new Set();
277
- for (const h of m)
278
- !h.isGroup && !h.isSubmenuParent && !h.isDisabled && o.add(h.value);
279
- a = a.filter((h) => !o.has(h));
296
+ for (const x of f)
297
+ !x.isGroup && !x.isSubmenuParent && !x.isDisabled && o.add(x.value);
298
+ a = a.filter((x) => !o.has(x));
280
299
  }
281
300
  const c = {
282
301
  isAllSelected: !0,
@@ -288,20 +307,20 @@ const Ot = (Se) => {
288
307
  let a = [...l];
289
308
  if (i) {
290
309
  const c = /* @__PURE__ */ new Set();
291
- for (const o of m)
310
+ for (const o of f)
292
311
  !o.isGroup && !o.isSubmenuParent && !o.isDisabled && c.add(o.value);
293
312
  a = a.filter((o) => !c.has(o.value));
294
313
  } else {
295
314
  const c = new Set(a.map((o) => o.value));
296
- for (const o of m)
315
+ for (const o of f)
297
316
  !o.isGroup && !o.isSubmenuParent && !o.isDisabled && (c.has(o.value) || (a.push(o), c.add(o.value)));
298
317
  }
299
- if (g && a.length > g)
318
+ if (b && a.length > b)
300
319
  return;
301
320
  v(a), u && u(a, { action: "select-option" });
302
321
  }
303
- } else if (g) {
304
- const e = d, { totalVisible: t } = q, l = V(e) ? e.length : 0, s = Math.min(t, g);
322
+ } else if (b) {
323
+ const e = d, { totalVisible: t } = q, l = V(e) ? e.length : 0, s = Math.min(t, b);
305
324
  if (V(e) && l >= s && l > 0) {
306
325
  const n = e.filter((i) => i.isDisabled);
307
326
  v(n), u && u(n, {
@@ -312,8 +331,8 @@ const Ot = (Se) => {
312
331
  (a) => a.isDisabled
313
332
  );
314
333
  let i = n.length;
315
- for (const a of m)
316
- if (!a.isGroup && !a.isSubmenuParent && !a.isDisabled && (n.push(a), i++, i >= g))
334
+ for (const a of f)
335
+ if (!a.isGroup && !a.isSubmenuParent && !a.isDisabled && (n.push(a), i++, i >= b))
317
336
  break;
318
337
  v(n), u && u(n, {
319
338
  action: "select-option"
@@ -321,7 +340,7 @@ const Ot = (Se) => {
321
340
  }
322
341
  } else {
323
342
  const e = d, t = T(e) && e.excludedValues.length === 0;
324
- if (Se.enableInvertedSelection)
343
+ if (Ve.enableInvertedSelection)
325
344
  if (t) {
326
345
  const l = V(e) ? e.filter((s) => s.isDisabled) : [];
327
346
  v(l), u && u(l, {
@@ -330,7 +349,7 @@ const Ot = (Se) => {
330
349
  } else {
331
350
  const s = {
332
351
  isAllSelected: !0,
333
- excludedValues: m.filter(
352
+ excludedValues: f.filter(
334
353
  (n) => n.isDisabled && (V(e) ? !e.some((i) => i.value === n.value) : !0)
335
354
  ).map((n) => n.value)
336
355
  };
@@ -345,7 +364,7 @@ const Ot = (Se) => {
345
364
  });
346
365
  } else {
347
366
  const n = V(e) ? e.filter((i) => i.isDisabled) : [];
348
- for (const i of m)
367
+ for (const i of f)
349
368
  !i.isGroup && !i.isSubmenuParent && !i.isDisabled && n.push(i);
350
369
  v(n), u && u(n, {
351
370
  action: "select-option"
@@ -354,28 +373,28 @@ const Ot = (Se) => {
354
373
  }
355
374
  }
356
375
  }
357
- }, ot = (e) => {
376
+ }, dt = (e) => {
358
377
  if (e.stopPropagation(), !p)
359
- if (f) {
378
+ if (m) {
360
379
  const t = [], l = (n) => {
361
380
  for (const i of n) {
362
- if (P && "options" in i) {
381
+ if (D && "options" in i) {
363
382
  l(
364
383
  i.options
365
384
  );
366
385
  continue;
367
386
  }
368
- if (y && "children" in i && Array.isArray(i.children)) {
387
+ if (S && "children" in i && Array.isArray(i.children)) {
369
388
  l(i.children);
370
389
  continue;
371
390
  }
372
391
  const a = i;
373
- a.isDisabled && (S.mode === "exclude" ? !S.set.has(a.value) : S.set.has(a.value)) && t.push(a);
392
+ a.isDisabled && (y.mode === "exclude" ? !y.set.has(a.value) : y.set.has(a.value)) && t.push(a);
374
393
  }
375
394
  };
376
- l(F);
395
+ l(R);
377
396
  const s = t;
378
- v(s), u && u(s, { action: "clear" }), Ce?.();
397
+ v(s), u && u(s, { action: "clear" }), Ee?.();
379
398
  } else {
380
399
  const t = d;
381
400
  if (t) {
@@ -383,13 +402,13 @@ const Ot = (Se) => {
383
402
  const n = (i) => {
384
403
  for (const a of i) {
385
404
  if (s) return;
386
- if (P && "options" in a) {
405
+ if (D && "options" in a) {
387
406
  if (n(
388
407
  a.options
389
408
  ), s) return;
390
409
  continue;
391
410
  }
392
- if (y && "children" in a && Array.isArray(a.children)) {
411
+ if (S && "children" in a && Array.isArray(a.children)) {
393
412
  if (n(
394
413
  a.children
395
414
  ), s) return;
@@ -402,200 +421,200 @@ const Ot = (Se) => {
402
421
  }
403
422
  }
404
423
  };
405
- if (n(F), s?.isDisabled)
424
+ if (n(R), s?.isDisabled)
406
425
  return;
407
426
  }
408
427
  const l = null;
409
- v(l), u && u(l, { action: "clear" }), Ce?.();
428
+ v(l), u && u(l, { action: "clear" }), Ee?.();
410
429
  }
411
- }, ct = (e) => Vt(
430
+ }, ft = (e) => Dt(
412
431
  e,
413
- Ve ?? !1,
414
- f ?? !1,
415
- qe,
432
+ ke ?? !1,
433
+ m ?? !1,
434
+ Ke,
416
435
  d
417
- ), te = (e) => ke ? ke(e) : e.label, $e = () => {
436
+ ), se = (e) => De ? De(e) : e.label, Ge = () => {
418
437
  const e = [];
419
- return !I && !O && !H && f && J && !p && m.length > 0 && e.push(X), m.forEach((l, s) => {
420
- !l.isGroup && !(y && l.isSubmenuParent) && !l.isDisabled && e.push(s);
438
+ return !E && !I && !_ && m && Q && !p && f.length > 0 && e.push(J), f.forEach((l, s) => {
439
+ !l.isGroup && !(S && l.isSubmenuParent) && !l.isDisabled && e.push(s);
421
440
  }), e;
422
- }, ut = (e) => {
423
- if (N || p) return;
424
- if (!b) {
425
- (e.key === "Enter" || e.key === " " || e.key === "ArrowDown" || e.key === "ArrowUp") && (e.preventDefault(), pe.current = !0, Z(!0));
441
+ }, mt = (e) => {
442
+ if (k || p) return;
443
+ if (!h) {
444
+ (e.key === "Enter" || e.key === " " || e.key === "ArrowDown" || e.key === "ArrowUp") && (e.preventDefault(), xe.current = !0, K(!0));
426
445
  return;
427
446
  }
428
- if (E && $ === "menu" && !p && j.current) {
447
+ if (L && z === "menu" && !p && j.current) {
429
448
  document.activeElement !== j.current && j.current.focus();
430
449
  return;
431
450
  }
432
- const t = $e();
451
+ const t = Ge();
433
452
  if (t.length === 0) return;
434
- const l = t.indexOf(D);
453
+ const l = t.indexOf(O);
435
454
  if (e.key === "ArrowDown") {
436
455
  e.preventDefault();
437
456
  const s = l < t.length - 1 ? l + 1 : 0, n = t[s];
438
- C(n), n >= 0 && A.scrollToIndex(n, { align: "auto" });
457
+ A(n), n >= 0 && N.scrollToIndex(n, { align: "auto" });
439
458
  } else if (e.key === "ArrowUp") {
440
459
  e.preventDefault();
441
460
  const s = l > 0 ? l - 1 : t.length - 1, n = t[s];
442
- C(n), n >= 0 && A.scrollToIndex(n, { align: "auto" });
461
+ A(n), n >= 0 && N.scrollToIndex(n, { align: "auto" });
443
462
  } else if (e.key === "Enter" || e.key === " ") {
444
- if (e.preventDefault(), D === X)
445
- be();
446
- else if (D >= 0 && D < m.length) {
447
- const s = m[D];
448
- s.isDisabled || ee(s);
463
+ if (e.preventDefault(), O === J)
464
+ Se();
465
+ else if (O >= 0 && O < f.length) {
466
+ const s = f[O];
467
+ s.isDisabled || ne(s);
449
468
  }
450
469
  } else if (e.key === "Escape")
451
- e.preventDefault(), Z(!1), he.current?.focus();
470
+ e.preventDefault(), K(!1), ge.current?.focus();
452
471
  else if (e.key === "Home")
453
- e.preventDefault(), t.length > 0 && (C(t[0]), t[0] >= 0 && A.scrollToIndex(t[0], { align: "auto" }));
472
+ e.preventDefault(), t.length > 0 && (A(t[0]), t[0] >= 0 && N.scrollToIndex(t[0], { align: "auto" }));
454
473
  else if (e.key === "End" && (e.preventDefault(), t.length > 0)) {
455
474
  const s = t[t.length - 1];
456
- C(s), s >= 0 && A.scrollToIndex(s, { align: "auto" });
475
+ A(s), s >= 0 && N.scrollToIndex(s, { align: "auto" });
457
476
  }
458
- }, dt = (e) => {
459
- const t = $e();
477
+ }, pt = (e) => {
478
+ const t = Ge();
460
479
  if (t.length === 0) return;
461
- const l = t.indexOf(D);
480
+ const l = t.indexOf(O);
462
481
  if (e.key === "ArrowDown") {
463
482
  e.preventDefault();
464
483
  const s = l < t.length - 1 ? l + 1 : 0, n = t[s];
465
- C(n), n >= 0 && A.scrollToIndex(n, { align: "auto" });
484
+ A(n), n >= 0 && N.scrollToIndex(n, { align: "auto" });
466
485
  } else if (e.key === "ArrowUp") {
467
486
  e.preventDefault();
468
487
  const s = l > 0 ? l - 1 : t.length - 1, n = t[s];
469
- C(n), n >= 0 && A.scrollToIndex(n, { align: "auto" });
488
+ A(n), n >= 0 && N.scrollToIndex(n, { align: "auto" });
470
489
  } else if (e.key === "Enter") {
471
- if (e.preventDefault(), D === X)
472
- be();
473
- else if (D >= 0 && D < m.length) {
474
- const s = m[D];
475
- s.isDisabled || ee(s);
490
+ if (e.preventDefault(), O === J)
491
+ Se();
492
+ else if (O >= 0 && O < f.length) {
493
+ const s = f[O];
494
+ s.isDisabled || ne(s);
476
495
  }
477
- } else e.key === "Escape" && (e.preventDefault(), Z(!1), he.current?.focus());
478
- }, ft = () => {
479
- if (f) {
496
+ } else e.key === "Escape" && (e.preventDefault(), K(!1), ge.current?.focus());
497
+ }, ht = () => {
498
+ if (m) {
480
499
  const e = d || [];
481
500
  let t = 0;
482
- return T(e) ? t = Ee - e.excludedValues.length : V(e) && (t = e.length), t === 0 ? null : t === 1 && V(e) ? /* @__PURE__ */ r("span", { className: w("text-[14px] font-medium truncate min-w-0 block", N ? "text-disabled-foreground" : "text-[#1f2b4d]"), children: te(e[0]) }) : /* @__PURE__ */ r("span", { className: w("text-[14px] font-medium truncate min-w-0 block", N ? "text-disabled-foreground" : "text-[#1f2b4d]"), children: W("select.selectedCount", { count: t }) });
501
+ return T(e) ? t = $e - e.excludedValues.length : V(e) && (t = e.length), t === 0 ? null : t === 1 && V(e) ? /* @__PURE__ */ r("span", { className: w("text-[14px] font-medium truncate min-w-0 block", k ? "text-disabled-foreground" : "text-[#1f2b4d]"), children: se(e[0]) }) : /* @__PURE__ */ r("span", { className: w("text-[14px] font-medium truncate min-w-0 block", k ? "text-disabled-foreground" : "text-[#1f2b4d]"), children: Y("select.selectedCount", { count: t }) });
483
502
  } else {
484
503
  const e = d;
485
- return e ? /* @__PURE__ */ r("span", { className: w("text-[14px] font-medium truncate min-w-0 block", N ? "text-disabled-foreground" : "text-[#1f2b4d]"), children: te(e) }) : null;
504
+ return e ? /* @__PURE__ */ r("span", { className: w("text-[14px] font-medium truncate min-w-0 block", k ? "text-disabled-foreground" : "text-[#1f2b4d]"), children: se(e) }) : null;
486
505
  }
487
506
  };
488
- return /* @__PURE__ */ x(
507
+ return /* @__PURE__ */ g(
489
508
  "div",
490
509
  {
491
510
  className: w(
492
511
  "flex gap-[6px]",
493
- ue === "left" ? "w-fit flex-row items-center" : "w-full flex-col",
494
- Ke
512
+ fe === "left" ? "w-fit flex-row items-center" : "w-full flex-col",
513
+ Xe
495
514
  ),
496
- "data-testid": `select-${k || "default"}`,
515
+ "data-testid": `select-${P || "default"}`,
497
516
  "data-component": "select",
498
517
  children: [
499
- R && /* @__PURE__ */ x(
518
+ H && /* @__PURE__ */ g(
500
519
  "label",
501
520
  {
502
521
  className: w(
503
522
  "text-[12px] font-medium text-[#60697d] leading-[18px]",
504
- ue === "left" ? "shrink-0" : ""
523
+ fe === "left" ? "shrink-0" : ""
505
524
  ),
506
525
  children: [
507
- R,
526
+ H,
508
527
  " ",
509
- _e && /* @__PURE__ */ r("span", { className: "text-[red]", children: "*" })
528
+ Ue && /* @__PURE__ */ r("span", { className: "text-[red]", children: "*" })
510
529
  ]
511
530
  }
512
531
  ),
513
- /* @__PURE__ */ x(
532
+ /* @__PURE__ */ g(
514
533
  "div",
515
534
  {
516
535
  className: w(
517
- ue === "left" ? "min-w-0 flex-1" : "w-full min-w-0",
518
- U && oe === "absolute" && "relative"
536
+ fe === "left" ? "min-w-0 flex-1" : "w-full min-w-0",
537
+ X && de === "absolute" && "relative"
519
538
  ),
520
539
  children: [
521
- /* @__PURE__ */ x(se.Root, { open: b, onOpenChange: Z, children: [
522
- /* @__PURE__ */ r(se.Trigger, { asChild: !0, children: /* @__PURE__ */ r(
540
+ /* @__PURE__ */ g(ae.Root, { open: h, onOpenChange: K, children: [
541
+ /* @__PURE__ */ r(ae.Trigger, { asChild: !0, children: /* @__PURE__ */ r(
523
542
  "div",
524
543
  {
525
- ref: he,
544
+ ref: ge,
526
545
  className: w(
527
546
  "relative h-[32px] w-full cursor-pointer rounded-[8px] border border-solid px-3 py-1 text-left shadow-sm sm:text-sm transition-all flex items-center overflow-hidden",
528
- ae ? "border-[#e15554] focus-visible:ring-[#e15554]" : "border-[#c3c8d4] hover:border-gray-400 focus-visible:border-indigo-500 focus-visible:ring-1 focus-visible:ring-indigo-500",
529
- N ? "bg-[#f2f4fb] cursor-not-allowed opacity-75" : "",
547
+ ue ? "border-[#e15554] focus-visible:ring-[#e15554]" : "border-[#c3c8d4] hover:border-gray-400 focus-visible:border-indigo-500 focus-visible:ring-1 focus-visible:ring-indigo-500",
548
+ k ? "bg-[#f2f4fb] cursor-not-allowed opacity-75" : "",
530
549
  p ? "cursor-default bg-[#f2f4fb]" : "",
531
- b ? "ring-1 ring-indigo-500 border-indigo-500" : "",
532
- !N && !p && "bg-white",
533
- Be
550
+ h ? "ring-1 ring-indigo-500 border-indigo-500" : "",
551
+ !k && !p && "bg-white",
552
+ We
534
553
  ),
535
- id: k,
536
- tabIndex: N ? -1 : 0,
537
- onFocus: nt,
538
- onBlur: st,
554
+ id: P,
555
+ tabIndex: k ? -1 : 0,
556
+ onFocus: rt,
557
+ onBlur: at,
539
558
  role: "combobox",
540
- "aria-expanded": b,
559
+ "aria-expanded": h,
541
560
  "aria-haspopup": "listbox",
542
- "aria-label": R ? String(R) : de,
561
+ "aria-label": H ? String(H) : me,
543
562
  "data-component": "select-trigger",
544
- "data-disabled": N || void 0,
545
- "data-state": b ? "open" : "closed",
546
- onKeyDown: ut,
547
- children: /* @__PURE__ */ x("div", { className: "flex items-center justify-between w-full min-w-0 max-w-full", children: [
548
- Ae && /* @__PURE__ */ r("div", { className: "flex items-center text-gray-500 shrink-0", children: Ae }),
549
- /* @__PURE__ */ x(
563
+ "data-disabled": k || void 0,
564
+ "data-state": h ? "open" : "closed",
565
+ onKeyDown: mt,
566
+ children: /* @__PURE__ */ g("div", { className: "flex items-center justify-between w-full min-w-0 max-w-full", children: [
567
+ Ie && /* @__PURE__ */ r("div", { className: "flex items-center text-gray-500 shrink-0", children: Ie }),
568
+ /* @__PURE__ */ g(
550
569
  "div",
551
570
  {
552
571
  className: "flex-1 flex items-center overflow-hidden min-w-0 max-w-full",
553
- "data-testid": `select-value-${k || "default"}`,
572
+ "data-testid": `select-value-${P || "default"}`,
554
573
  children: [
555
- ft() || /* @__PURE__ */ r(
574
+ ht() || /* @__PURE__ */ r(
556
575
  "span",
557
576
  {
558
577
  className: "text-[#b4bac7] font-normal text-[14px] truncate min-w-0 block",
559
- "data-testid": `select-placeholder-${k || "default"}`,
578
+ "data-testid": `select-placeholder-${P || "default"}`,
560
579
  "data-has-value": !1,
561
- children: de
580
+ children: me
562
581
  }
563
582
  ),
564
- E && b && $ === "trigger" && !p && /* @__PURE__ */ r(
583
+ L && h && z === "trigger" && !p && /* @__PURE__ */ r(
565
584
  "input",
566
585
  {
567
- ref: rt,
586
+ ref: ct,
568
587
  type: "text",
569
588
  className: "flex-1 min-w-[50px] border-none p-0 focus:ring-0 text-sm outline-none h-full",
570
- value: z,
571
- onChange: (e) => Q(e.target.value),
589
+ value: G,
590
+ onChange: (e) => Z(e.target.value),
572
591
  onClick: (e) => e.stopPropagation(),
573
- autoFocus: Re,
574
- name: Ue || void 0
592
+ autoFocus: je,
593
+ name: Ye || void 0
575
594
  }
576
595
  )
577
596
  ]
578
597
  }
579
598
  ),
580
- /* @__PURE__ */ r("div", { className: "flex items-center gap-1 text-gray-400 shrink-0", children: !b && (I || O) ? /* @__PURE__ */ r(bt, { size: "14px" }) : /* @__PURE__ */ x(pt, { children: [
581
- Le && !p && !N && (f && (T(
599
+ /* @__PURE__ */ r("div", { className: "flex items-center gap-1 text-gray-400 shrink-0", children: !h && (E || I) ? /* @__PURE__ */ r(wt, { size: "14px" }) : /* @__PURE__ */ g(gt, { children: [
600
+ He && !p && !k && (m && (T(
582
601
  d
583
- ) && d.isAllSelected || V(d) && d.length > 0) || !f && d) && /* @__PURE__ */ r(
602
+ ) && d.isAllSelected || V(d) && d.length > 0) || !m && d) && /* @__PURE__ */ r(
584
603
  "div",
585
604
  {
586
605
  role: "button",
587
- onClick: ot,
606
+ onClick: dt,
588
607
  className: "hover:text-gray-600 p-0.5",
589
- children: /* @__PURE__ */ r(vt, { size: "11px", color: "#758490" })
608
+ children: /* @__PURE__ */ r(Vt, { size: "11px", color: "#758490" })
590
609
  }
591
610
  ),
592
611
  /* @__PURE__ */ r(
593
- ze,
612
+ Me,
594
613
  {
595
614
  size: "16px",
596
615
  className: w(
597
616
  "transition-transform duration-200",
598
- b ? "-rotate-90" : "rotate-90"
617
+ h ? "-rotate-90" : "rotate-90"
599
618
  )
600
619
  }
601
620
  )
@@ -603,105 +622,107 @@ const Ot = (Se) => {
603
622
  ] })
604
623
  }
605
624
  ) }),
606
- /* @__PURE__ */ r(se.Portal, { children: /* @__PURE__ */ x(
607
- se.Content,
625
+ /* @__PURE__ */ r(ae.Portal, { children: /* @__PURE__ */ g(
626
+ ae.Content,
608
627
  {
609
- ref: xe,
628
+ ref: ee,
610
629
  side: "bottom",
611
630
  sideOffset: 4,
612
631
  align: "start",
613
632
  avoidCollisions: !0,
614
633
  collisionPadding: 8,
615
634
  onOpenAutoFocus: (e) => e.preventDefault(),
635
+ onInteractOutside: () => K(!1),
636
+ onFocusOutside: () => K(!1),
616
637
  onWheel: (e) => e.stopPropagation(),
617
638
  style: {
618
- width: lt || "var(--radix-popover-trigger-width)",
639
+ width: it || "var(--radix-popover-trigger-width)",
619
640
  maxHeight: "var(--radix-popover-content-available-height)",
620
- minHeight: Te ? `${Te}px` : void 0
641
+ minHeight: Le ? `${Le}px` : void 0
621
642
  },
622
643
  className: w(
623
644
  "z-50 overflow-hidden rounded-[12px] text-base shadow-[0px_1px_6px_0px_rgba(26,39,124,0.14)] focus:outline-none sm:text-sm flex flex-col border-none pointer-events-auto",
624
645
  p ? "bg-[#f5f5f5]" : "bg-white"
625
646
  ),
626
- "data-testid": `select-menu-${k || "default"}`,
647
+ "data-testid": `select-menu-${P || "default"}`,
627
648
  "data-component": "select-menu",
628
649
  children: [
629
- /* @__PURE__ */ x(
650
+ /* @__PURE__ */ g(
630
651
  "div",
631
652
  {
632
653
  className: w(
633
654
  "flex flex-col z-10 sticky top-0 px-[6px] pt-[8px]",
634
655
  p ? "bg-[#f5f5f5]" : "bg-white",
635
- !H && (E && $ === "menu" && !p || f && J && !p && m.length > 0) ? "border-b border-solid border-gray-100" : ""
656
+ !_ && (L && z === "menu" && !p || m && Q && !p && f.length > 0) ? "border-b border-solid border-gray-100" : ""
636
657
  ),
637
658
  children: [
638
- E && $ === "menu" && !p && !H && /* @__PURE__ */ r(
659
+ L && z === "menu" && !p && !_ && /* @__PURE__ */ r(
639
660
  "div",
640
661
  {
641
662
  className: "p-0",
642
- "data-testid": `select-search-container-${k || "default"}`,
643
- children: /* @__PURE__ */ x("div", { className: "relative", children: [
644
- /* @__PURE__ */ r("div", { className: "absolute inset-y-0 left-[12px] flex items-center pointer-events-none", children: /* @__PURE__ */ r(yt, { size: "14px", color: "#AFAFAF" }) }),
663
+ "data-testid": `select-search-container-${P || "default"}`,
664
+ children: /* @__PURE__ */ g("div", { className: "relative", children: [
665
+ /* @__PURE__ */ r("div", { className: "absolute inset-y-0 left-[12px] flex items-center pointer-events-none", children: /* @__PURE__ */ r(Nt, { size: "14px", color: "#AFAFAF" }) }),
645
666
  /* @__PURE__ */ r(
646
667
  "input",
647
668
  {
648
669
  ref: j,
649
670
  type: "text",
650
671
  className: "block w-full pl-[34px] pr-4 h-[35px] border-none border-b border-primary text-sm outline-none focus-visible:ring-1 focus-visible:ring-indigo-500 focus-visible:rounded-md",
651
- placeholder: W("select.searchHere"),
652
- value: z,
653
- onKeyDown: dt,
672
+ placeholder: Y("select.searchHere"),
673
+ value: G,
674
+ onKeyDown: pt,
654
675
  onChange: (e) => {
655
676
  const t = e.target.value;
656
- z === "" && t !== "" ? xe.current && fe(xe.current.offsetHeight) : t === "" && fe(void 0), Q(t), We?.(t);
677
+ G === "" && t !== "" ? ee.current && pe(ee.current.offsetHeight) : t === "" && pe(void 0), Z(t), Je?.(t);
657
678
  },
658
679
  onClick: (e) => e.stopPropagation(),
659
- "data-testid": `select-search-input-${k || "default"}`
680
+ "data-testid": `select-search-input-${P || "default"}`
660
681
  }
661
682
  )
662
683
  ] })
663
684
  }
664
685
  ),
665
- !I && !O && !H && f && J && !p && m.length > 0 && /* @__PURE__ */ r(
686
+ !E && !I && !_ && m && Q && !p && f.length > 0 && /* @__PURE__ */ r(
666
687
  "div",
667
688
  {
668
689
  className: "pb-1",
669
- "data-testid": `select-select-all-container-${k || "default"}`,
690
+ "data-testid": `select-select-all-container-${P || "default"}`,
670
691
  children: /* @__PURE__ */ r(
671
692
  "div",
672
693
  {
673
694
  className: w(
674
695
  "flex items-center justify-between cursor-pointer rounded-md hover:bg-gray-100 transition-colors py-[6px] px-3 w-full",
675
- D === X && "ring-2 ring-inset ring-primary bg-[#edf0ff]"
696
+ O === J && "ring-2 ring-inset ring-primary bg-[#edf0ff]"
676
697
  ),
677
- onClick: be,
698
+ onClick: Se,
678
699
  role: "option",
679
700
  "aria-selected": !1,
680
- "data-testid": `select-select-all-button-${k || "default"}`,
681
- children: /* @__PURE__ */ x("div", { className: "flex items-center flex-1", children: [
701
+ "data-testid": `select-select-all-button-${P || "default"}`,
702
+ children: /* @__PURE__ */ g("div", { className: "flex items-center flex-1", children: [
682
703
  /* @__PURE__ */ r("div", { className: "pointer-events-none flex", children: /* @__PURE__ */ r(
683
- Ge,
704
+ Fe,
684
705
  {
685
706
  checked: (() => {
686
707
  const { totalVisible: e, selectedVisible: t } = q;
687
708
  if (e === 0) return !1;
688
- const l = g ? Math.min(e, g) : e;
709
+ const l = b ? Math.min(e, b) : e;
689
710
  return t > 0 && t < l ? "indeterminate" : t >= l;
690
711
  })(),
691
- disabled: N || p,
712
+ disabled: k || p,
692
713
  onChange: () => {
693
714
  },
694
- "data-testid": `select-select-all-checkbox-${k || "default"}`
715
+ "data-testid": `select-select-all-checkbox-${P || "default"}`
695
716
  }
696
717
  ) }),
697
718
  /* @__PURE__ */ r(
698
719
  "span",
699
720
  {
700
721
  className: "text-sm font-medium text-gray-700",
701
- "data-testid": `select-select-all-label-${k || "default"}`,
722
+ "data-testid": `select-select-all-label-${P || "default"}`,
702
723
  children: (() => {
703
- const { totalVisible: e, selectedVisible: t } = q, l = g ? Math.min(e, g) : e, s = e > 0 && t >= l;
704
- return W(s ? "select.unselectAll" : "select.selectAll");
724
+ const { totalVisible: e, selectedVisible: t } = q, l = b ? Math.min(e, b) : e, s = e > 0 && t >= l;
725
+ return Y(s ? "select.unselectAll" : "select.selectAll");
705
726
  })()
706
727
  }
707
728
  )
@@ -716,32 +737,32 @@ const Ot = (Se) => {
716
737
  /* @__PURE__ */ r(
717
738
  "div",
718
739
  {
719
- ref: Y,
740
+ ref: te,
720
741
  role: "listbox",
721
- "aria-label": R ? String(R) : de,
742
+ "aria-label": H ? String(H) : me,
722
743
  className: "flex-1 overflow-auto py-1 px-[6px]",
723
744
  style: {
724
745
  maxHeight: "297px",
725
746
  overscrollBehavior: "contain"
726
747
  },
727
748
  onWheel: (e) => e.stopPropagation(),
728
- children: H ? /* @__PURE__ */ x("div", { className: "flex flex-col items-center justify-center py-8 px-4 text-center", children: [
749
+ children: _ ? /* @__PURE__ */ g("div", { className: "flex flex-col items-center justify-center py-8 px-4 text-center", children: [
729
750
  /* @__PURE__ */ r("p", { className: "text-sm text-gray-500 font-medium mb-3", children: "Something went wrong" }),
730
- Oe && /* @__PURE__ */ r(
731
- St,
751
+ Ce && /* @__PURE__ */ r(
752
+ kt,
732
753
  {
733
754
  size: "sm",
734
755
  variant: "outline",
735
- onClick: () => Oe(),
756
+ onClick: () => Ce(),
736
757
  children: "Refetch"
737
758
  }
738
759
  )
739
- ] }) : m.length === 0 && !I && !O ? /* @__PURE__ */ r("div", { className: "flex items-center justify-center py-8 text-sm text-gray-500", children: "No options found" }) : I || O ? /* @__PURE__ */ r("div", { className: "px-1 py-1 space-y-1", children: Array.from({ length: 6 }).map((e, t) => /* @__PURE__ */ x(
760
+ ] }) : f.length === 0 && !E && !I ? /* @__PURE__ */ r("div", { className: "flex items-center justify-center py-8 text-sm text-gray-500", children: "No options found" }) : E || I ? /* @__PURE__ */ r("div", { className: "px-1 py-1 space-y-1", children: Array.from({ length: 6 }).map((e, t) => /* @__PURE__ */ g(
740
761
  "div",
741
762
  {
742
763
  className: "flex items-center gap-2 px-3 py-2 animate-pulse",
743
764
  children: [
744
- f && /* @__PURE__ */ r("div", { className: "w-4 h-4 bg-gray-200 rounded shrink-0" }),
765
+ m && /* @__PURE__ */ r("div", { className: "w-4 h-4 bg-gray-200 rounded shrink-0" }),
745
766
  /* @__PURE__ */ r("div", { className: "h-4 bg-gray-200 rounded w-full" })
746
767
  ]
747
768
  },
@@ -750,25 +771,25 @@ const Ot = (Se) => {
750
771
  "div",
751
772
  {
752
773
  style: {
753
- height: `${A.getTotalSize()}px`,
774
+ height: `${N.getTotalSize()}px`,
754
775
  width: "100%",
755
776
  position: "relative"
756
777
  },
757
- children: A.getVirtualItems().map((e) => {
758
- const t = m[e.index], l = f ? S.mode === "exclude" ? !S.set.has(t.value) : S.set.has(t.value) : d?.value === t.value, s = d || [], n = f && g ? T(s) ? !1 : V(s) && s.length >= g : !1, i = t.isDisabled || n && !l && !(P && t.isGroup) && !(y && t.isSubmenuParent), a = P && t.isGroup || y && t.isSubmenuParent ? ge(t.original) : void 0, c = a?.selected || 0, o = a?.total || 0, h = c > 0 && c < o, le = t.isParentSelectable !== !1, ve = k || "default", ne = String(t.value || ""), ye = te(
778
+ children: N.getVirtualItems().map((e) => {
779
+ const t = f[e.index], l = m ? y.mode === "exclude" ? !y.set.has(t.value) : y.set.has(t.value) : d?.value === t.value, s = d || [], n = m && b ? T(s) ? !1 : V(s) && s.length >= b : !1, i = t.isDisabled || n && !l && !(D && t.isGroup) && !(S && t.isSubmenuParent), a = D && t.isGroup || S && t.isSubmenuParent ? be(t.original) : void 0, c = a?.selected || 0, o = a?.total || 0, x = c > 0 && c < o, ie = t.isParentSelectable !== !1, ye = P || "default", re = String(t.value || ""), we = se(
759
780
  t
760
- ), mt = typeof ye == "string" ? ye : ne;
761
- return /* @__PURE__ */ x(
781
+ ), xt = typeof we == "string" ? we : re;
782
+ return /* @__PURE__ */ g(
762
783
  "div",
763
784
  {
764
785
  "data-index": e.index,
765
- ref: A.measureElement,
786
+ ref: N.measureElement,
766
787
  className: "absolute left-0 w-full pb-[2px]",
767
788
  style: {
768
789
  transform: `translateY(${e.start}px)`,
769
790
  width: "100%"
770
791
  },
771
- "data-testid": `select-option-wrapper-${ve}-${ne}`,
792
+ "data-testid": `select-option-wrapper-${ye}-${re}`,
772
793
  children: [
773
794
  /* @__PURE__ */ r(
774
795
  "div",
@@ -776,31 +797,31 @@ const Ot = (Se) => {
776
797
  className: w(
777
798
  "cursor-default select-none py-[6px] px-3 flex items-center justify-between transition-colors rounded-md",
778
799
  i ? "opacity-50 cursor-not-allowed bg-[#f5f5f5]" : p ? "cursor-default" : "hover:bg-gray-100 cursor-pointer",
779
- l && !i && !(P && t.isGroup) && !(y && t.isSubmenuParent) ? "bg-[#edf0ff] text-[#1f2b4d]" : "text-[#1f2b4d]",
780
- D === e.index && !i && "ring-2 ring-inset ring-primary bg-[#edf0ff]"
800
+ l && !i && !(D && t.isGroup) && !(S && t.isSubmenuParent) ? "bg-[#edf0ff] text-[#1f2b4d]" : "text-[#1f2b4d]",
801
+ O === e.index && !i && "ring-2 ring-inset ring-primary bg-[#edf0ff]"
781
802
  ),
782
803
  style: {
783
804
  paddingLeft: `${t.depth * 16 + 12}px`
784
805
  },
785
806
  onClick: () => {
786
- i || (P && t.isGroup || y && t.isSubmenuParent) && !le || ee(t);
807
+ i || (D && t.isGroup || S && t.isSubmenuParent) && !ie || ne(t);
787
808
  },
788
- onMouseEnter: (G) => {
789
- if (y && t.isSubmenuParent) {
790
- me(t.value);
791
- const B = G.currentTarget.getBoundingClientRect();
792
- t.rect = B;
809
+ onMouseEnter: (M) => {
810
+ if (S && t.isSubmenuParent) {
811
+ he(t.value);
812
+ const U = M.currentTarget.getBoundingClientRect();
813
+ t.rect = U;
793
814
  } else
794
- me(null);
815
+ he(null);
795
816
  },
796
- "data-testid": `select-option-${ve}-${ne}`,
817
+ "data-testid": `select-option-${ye}-${re}`,
797
818
  "data-state": l ? "checked" : "unchecked",
798
819
  "data-disabled": i || void 0,
799
820
  "data-component": "select-option",
800
821
  role: "option",
801
822
  "aria-selected": l,
802
823
  "aria-disabled": i || void 0,
803
- children: Pe ? Pe(
824
+ children: Oe ? Oe(
804
825
  {
805
826
  onClick: () => {
806
827
  },
@@ -809,43 +830,43 @@ const Ot = (Se) => {
809
830
  disabled: i
810
831
  },
811
832
  t
812
- ) : /* @__PURE__ */ x("div", { className: "flex items-center flex-1 overflow-hidden", children: [
813
- f && (P && t.isGroup || y && t.isSubmenuParent ? le : !0) && /* @__PURE__ */ r(
814
- Ge,
833
+ ) : /* @__PURE__ */ g("div", { className: "flex items-center flex-1 overflow-hidden", children: [
834
+ m && (D && t.isGroup || S && t.isSubmenuParent ? ie : !0) && /* @__PURE__ */ r(
835
+ Fe,
815
836
  {
816
- checked: h ? "indeterminate" : l,
837
+ checked: x ? "indeterminate" : l,
817
838
  disabled: i || p,
818
839
  onChange: () => {
819
840
  }
820
841
  }
821
842
  ),
822
- Ve && !(P && t.isGroup) && !(y && t.isSubmenuParent) ? /* @__PURE__ */ r(
823
- xt,
843
+ ke && !(D && t.isGroup) && !(S && t.isSubmenuParent) ? /* @__PURE__ */ r(
844
+ St,
824
845
  {
825
- label: te(
846
+ label: se(
826
847
  t
827
848
  ),
828
- sequence: ct(t)
849
+ sequence: ft(t)
829
850
  }
830
- ) : /* @__PURE__ */ x("div", { className: "flex items-center gap-2 overflow-hidden w-full", children: [
851
+ ) : /* @__PURE__ */ g("div", { className: "flex items-center gap-2 overflow-hidden w-full", children: [
831
852
  /* @__PURE__ */ r(
832
853
  "span",
833
854
  {
834
855
  className: w(
835
856
  "block truncate",
836
- P && t.isGroup ? "text-xs font-semibold text-gray-400 uppercase tracking-wider" : l && !(y && t.isSubmenuParent) ? "font-medium" : "font-normal",
837
- !(P && t.isGroup) && "text-[14px]"
857
+ D && t.isGroup ? "text-xs font-semibold text-gray-400 uppercase tracking-wider" : l && !(S && t.isSubmenuParent) ? "font-medium" : "font-normal",
858
+ !(D && t.isGroup) && "text-[14px]"
838
859
  ),
839
- "data-testid": `select-option-label-${ve}-${ne}`,
860
+ "data-testid": `select-option-label-${ye}-${re}`,
840
861
  "data-state": l ? "checked" : "unchecked",
841
- title: mt,
842
- children: ye
862
+ title: xt,
863
+ children: we
843
864
  }
844
865
  ),
845
- (P && t.isGroup || y && t.isSubmenuParent) && c > 0 && /* @__PURE__ */ r("span", { className: "inline-flex items-center justify-center px-1.5 py-0.5 rounded-full text-xs font-medium bg-indigo-100 text-indigo-800", children: c })
866
+ (D && t.isGroup || S && t.isSubmenuParent) && c > 0 && /* @__PURE__ */ r("span", { className: "inline-flex items-center justify-center px-1.5 py-0.5 rounded-full text-xs font-medium bg-indigo-100 text-indigo-800", children: c })
846
867
  ] }),
847
- y && t.isSubmenuParent && /* @__PURE__ */ r(
848
- ze,
868
+ S && t.isSubmenuParent && /* @__PURE__ */ r(
869
+ Me,
849
870
  {
850
871
  size: "12px",
851
872
  className: "text-gray-400"
@@ -854,20 +875,20 @@ const Ot = (Se) => {
854
875
  ] })
855
876
  }
856
877
  ),
857
- y && it === t.value && t.isSubmenuParent && t.rect && /* @__PURE__ */ r(
858
- gt,
878
+ S && ot === t.value && t.isSubmenuParent && t.rect && /* @__PURE__ */ r(
879
+ yt,
859
880
  {
860
881
  parentOption: t,
861
- isMulti: !!f,
882
+ isMulti: !!m,
862
883
  isReadOnly: !!p,
863
- isSelected: (G) => wt(G, d, !!f),
864
- getIndeterminateState: (G) => {
865
- const B = ge(G);
866
- return B ? B.selected > 0 && B.selected < B.total : !1;
884
+ isSelected: (M) => Pt(M, d, !!m),
885
+ getIndeterminateState: (M) => {
886
+ const U = be(M);
887
+ return U ? U.selected > 0 && U.selected < U.total : !1;
867
888
  },
868
- getSelectedCount: (G) => ge(G)?.selected || 0,
869
- handleSelect: ee,
870
- id: k
889
+ getSelectedCount: (M) => be(M)?.selected || 0,
890
+ handleSelect: ne,
891
+ id: P
871
892
  }
872
893
  )
873
894
  ]
@@ -879,47 +900,47 @@ const Ot = (Se) => {
879
900
  )
880
901
  }
881
902
  ),
882
- (Ne || g || F.length > 5e3) && /* @__PURE__ */ r("div", { className: "px-3 py-[10px] border-t border-solid border-gray-100 z-10 sticky bottom-0 bg-white", children: g ? /* @__PURE__ */ x("div", { className: "flex items-center gap-2 text-gray-500 px-2", children: [
883
- /* @__PURE__ */ r(ie, { size: "12px", className: "text-gray-400" }),
884
- /* @__PURE__ */ x("span", { className: "text-xs font-medium leading-4 text-[#60697d]", children: [
903
+ (Pe || b || R.length > 5e3) && /* @__PURE__ */ r("div", { className: "px-3 py-[10px] border-t border-solid border-gray-100 z-10 sticky bottom-0 bg-white", children: b ? /* @__PURE__ */ g("div", { className: "flex items-center gap-2 text-gray-500 px-2", children: [
904
+ /* @__PURE__ */ r(oe, { size: "12px", className: "text-gray-400" }),
905
+ /* @__PURE__ */ g("span", { className: "text-xs font-medium leading-4 text-[#60697d]", children: [
885
906
  "Maximum ",
886
- g,
907
+ b,
887
908
  " selections"
888
909
  ] })
889
- ] }) : F.length > 5e3 ? /* @__PURE__ */ x("div", { className: "flex items-center gap-2 text-gray-500 px-2", children: [
890
- /* @__PURE__ */ r(ie, { size: "12px", className: "text-gray-400" }),
910
+ ] }) : R.length > 5e3 ? /* @__PURE__ */ g("div", { className: "flex items-center gap-2 text-gray-500 px-2", children: [
911
+ /* @__PURE__ */ r(oe, { size: "12px", className: "text-gray-400" }),
891
912
  /* @__PURE__ */ r("span", { className: "text-xs font-medium leading-4 text-[#60697d]", children: "Large dataset detected. Operations might be slower." })
892
- ] }) : Ne })
913
+ ] }) : Pe })
893
914
  ]
894
915
  }
895
916
  ) })
896
917
  ] }),
897
- U && oe === "absolute" && /* @__PURE__ */ x(
918
+ X && de === "absolute" && /* @__PURE__ */ g(
898
919
  "p",
899
920
  {
900
921
  className: w(
901
922
  "absolute left-0 top-full z-10 mt-1 flex min-w-0 max-w-full items-center gap-1 text-[12px] font-medium leading-[18px]",
902
- ae ? "text-[#e15554]" : "text-gray-500"
923
+ ue ? "text-[#e15554]" : "text-gray-500"
903
924
  ),
904
925
  children: [
905
- /* @__PURE__ */ r(ie, { size: "xs", className: "shrink-0" }),
906
- /* @__PURE__ */ r("span", { className: "min-w-0", children: U })
926
+ /* @__PURE__ */ r(oe, { size: "xs", className: "shrink-0" }),
927
+ /* @__PURE__ */ r("span", { className: "min-w-0", children: X })
907
928
  ]
908
929
  }
909
930
  )
910
931
  ]
911
932
  }
912
933
  ),
913
- U && oe === "flow" && /* @__PURE__ */ x(
934
+ X && de === "flow" && /* @__PURE__ */ g(
914
935
  "p",
915
936
  {
916
937
  className: w(
917
938
  "text-[12px] font-medium leading-[18px] mt-1 flex items-center gap-1",
918
- ae ? "text-[#e15554]" : "text-gray-500"
939
+ ue ? "text-[#e15554]" : "text-gray-500"
919
940
  ),
920
941
  children: [
921
- /* @__PURE__ */ r(ie, { size: "xs" }),
922
- U
942
+ /* @__PURE__ */ r(oe, { size: "xs" }),
943
+ X
923
944
  ]
924
945
  }
925
946
  )
@@ -927,7 +948,7 @@ const Ot = (Se) => {
927
948
  }
928
949
  );
929
950
  };
930
- Ot.displayName = "Select";
951
+ Tt.displayName = "Select";
931
952
  export {
932
- Ot as default
953
+ Tt as default
933
954
  };