@pismo/marola 1.0.0-beta.12 → 1.0.0-beta.14

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.
@@ -1,30 +1,30 @@
1
1
  import '../../assets/Autocomplete.css';
2
- import { jsxs as He, jsx as T } from "react/jsx-runtime";
2
+ import { jsxs as Fe, jsx as $ } from "react/jsx-runtime";
3
3
  import * as g from "react";
4
- import { useId as pt, useState as Fe } from "react";
5
- import { c as Z } from "../../clsx-DB4S2d7J.js";
6
- import { Icon as qe } from "../Icon/Icon.js";
4
+ import { useId as pt, useState as qe } from "react";
5
+ import { c as ee } from "../../clsx-DB4S2d7J.js";
6
+ import { Icon as Be } from "../Icon/Icon.js";
7
7
  import { s as P, I as gt } from "../../Input.module-ZTRZRcNt.js";
8
- import { Typography as Be } from "../Typography/Typography.js";
9
- import { b as Ke, s as ht } from "../../useSlotProps-kRhf7Gil.js";
8
+ import { Typography as Ke } from "../Typography/Typography.js";
9
+ import { b as Ue, s as ht } from "../../useSlotProps-kRhf7Gil.js";
10
10
  import { u as mt } from "../../useId-BW-oWmul.js";
11
- import { u as Te } from "../../useControlled-CCMYYdCM.js";
12
- import { u as he } from "../../useEventCallback-BAQJJ3ye.js";
11
+ import { u as $e } from "../../useControlled-CCMYYdCM.js";
12
+ import { u as me } from "../../useEventCallback-BAQJJ3ye.js";
13
13
  const bt = (u) => {
14
14
  const b = g.useRef({});
15
15
  return g.useEffect(() => {
16
16
  b.current = u;
17
17
  }), b.current;
18
18
  };
19
- function Ue(u) {
19
+ function je(u) {
20
20
  return typeof u.normalize < "u" ? u.normalize("NFD").replace(/[\u0300-\u036f]/g, "") : u;
21
21
  }
22
22
  function xt(u = {}) {
23
23
  const {
24
24
  ignoreAccents: b = !0,
25
25
  ignoreCase: h = !0,
26
- limit: $,
27
- matchFrom: A = "any",
26
+ limit: A,
27
+ matchFrom: D = "any",
28
28
  stringify: H,
29
29
  trim: V = !1
30
30
  } = u;
@@ -33,21 +33,21 @@ function xt(u = {}) {
33
33
  getOptionLabel: m
34
34
  }) => {
35
35
  let I = V ? F.trim() : F;
36
- h && (I = I.toLowerCase()), b && (I = Ue(I));
37
- const U = I ? M.filter((Y) => {
36
+ h && (I = I.toLowerCase()), b && (I = je(I));
37
+ const q = I ? M.filter((Y) => {
38
38
  let _ = (H || m)(Y);
39
- return h && (_ = _.toLowerCase()), b && (_ = Ue(_)), A === "start" ? _.indexOf(I) === 0 : _.indexOf(I) > -1;
39
+ return h && (_ = _.toLowerCase()), b && (_ = je(_)), D === "start" ? _.indexOf(I) === 0 : _.indexOf(I) > -1;
40
40
  }) : M;
41
- return typeof $ == "number" ? U.slice(0, $) : U;
41
+ return typeof A == "number" ? q.slice(0, A) : q;
42
42
  };
43
43
  }
44
- function me(u, b) {
44
+ function be(u, b) {
45
45
  for (let h = 0; h < u.length; h += 1)
46
46
  if (b(u[h]))
47
47
  return h;
48
48
  return -1;
49
49
  }
50
- const yt = xt(), je = 5, Ot = (u) => {
50
+ const yt = xt(), ze = 5, Ot = (u) => {
51
51
  var b;
52
52
  return u.current !== null && ((b = u.current.parentElement) == null ? void 0 : b.contains(document.activeElement));
53
53
  };
@@ -57,47 +57,47 @@ function It(u) {
57
57
  unstable_isActiveElementInListbox: b = Ot,
58
58
  // eslint-disable-next-line @typescript-eslint/naming-convention
59
59
  unstable_classNamePrefix: h = "Mui",
60
- autoComplete: $ = !1,
61
- autoHighlight: A = !1,
60
+ autoComplete: A = !1,
61
+ autoHighlight: D = !1,
62
62
  autoSelect: H = !1,
63
63
  blurOnSelect: V = !1,
64
64
  clearOnBlur: M = !u.freeSolo,
65
65
  clearOnEscape: F = !1,
66
66
  componentName: m = "useAutocomplete",
67
67
  defaultValue: I = u.multiple ? [] : null,
68
- disableClearable: U = !1,
68
+ disableClearable: q = !1,
69
69
  disableCloseOnSelect: Y = !1,
70
70
  disabled: _,
71
- disabledItemsFocusable: be = !1,
72
- disableListWrap: ee = !1,
73
- filterOptions: xe = yt,
74
- filterSelectedOptions: te = !1,
71
+ disabledItemsFocusable: xe = !1,
72
+ disableListWrap: te = !1,
73
+ filterOptions: ye = yt,
74
+ filterSelectedOptions: ne = !1,
75
75
  freeSolo: R = !1,
76
- getOptionDisabled: q,
77
- getOptionKey: ne,
76
+ getOptionDisabled: U,
77
+ getOptionKey: W,
78
78
  getOptionLabel: re = (t) => {
79
79
  var e;
80
80
  return (e = t.label) != null ? e : t;
81
81
  },
82
82
  groupBy: j,
83
83
  handleHomeEndKeys: oe = !u.freeSolo,
84
- id: ye,
84
+ id: Oe,
85
85
  includeInputInList: se = !1,
86
- inputValue: Oe,
87
- isOptionEqualToValue: D = (t, e) => t === e,
86
+ inputValue: Ie,
87
+ isOptionEqualToValue: E = (t, e) => t === e,
88
88
  multiple: i = !1,
89
- onChange: W,
90
- onClose: ie,
89
+ onChange: ie,
90
+ onClose: X,
91
91
  onHighlightChange: le,
92
- onInputChange: E,
93
- onOpen: c,
94
- open: v,
95
- openOnFocus: Je = !1,
96
- options: Ie,
97
- readOnly: X = !1,
92
+ onInputChange: v,
93
+ onOpen: ae,
94
+ open: c,
95
+ openOnFocus: T = !1,
96
+ options: _e,
97
+ readOnly: G = !1,
98
98
  selectOnFocus: Ye = !u.freeSolo,
99
99
  value: We
100
- } = u, k = mt(ye);
100
+ } = u, k = mt(Oe);
101
101
  let y = re;
102
102
  y = (t) => {
103
103
  const e = re(t);
@@ -110,16 +110,16 @@ function It(u) {
110
110
  }
111
111
  return e;
112
112
  };
113
- const _e = g.useRef(!1), we = g.useRef(!0), d = g.useRef(null), N = g.useRef(null), [ae, Xe] = g.useState(null), [S, ke] = g.useState(-1), $e = A ? 0 : -1, x = g.useRef($e), [r, Ge] = Te({
113
+ const we = g.useRef(!1), ke = g.useRef(!0), d = g.useRef(null), N = g.useRef(null), [ue, Xe] = g.useState(null), [S, Ne] = g.useState(-1), Ae = D ? 0 : -1, x = g.useRef(Ae), [r, Ge] = $e({
114
114
  controlled: We,
115
115
  default: I,
116
116
  name: m
117
- }), [a, ue] = Te({
118
- controlled: Oe,
117
+ }), [a, ce] = $e({
118
+ controlled: Ie,
119
119
  default: "",
120
120
  name: m,
121
121
  state: "inputValue"
122
- }), [ce, Ae] = g.useState(!1), fe = g.useCallback((t, e) => {
122
+ }), [fe, De] = g.useState(!1), de = g.useCallback((t, e) => {
123
123
  if (!(i ? r.length < e.length : e !== null) && !M)
124
124
  return;
125
125
  let o;
@@ -131,18 +131,18 @@ function It(u) {
131
131
  const s = y(e);
132
132
  o = typeof s == "string" ? s : "";
133
133
  }
134
- a !== o && (ue(o), E && E(t, o, "reset"));
135
- }, [y, a, i, E, ue, M, r]), [z, De] = Te({
136
- controlled: v,
134
+ a !== o && (ce(o), v && v(t, o, "reset"));
135
+ }, [y, a, i, v, ce, M, r]), [z, Ee] = $e({
136
+ controlled: c,
137
137
  default: !1,
138
138
  name: m,
139
139
  state: "open"
140
- }), [Qe, Ee] = g.useState(!0), ve = !i && r != null && a === y(r), w = z && !X, f = w ? xe(
141
- Ie.filter((t) => !(te && (i ? r : [r]).some((e) => e !== null && D(t, e)))),
140
+ }), [Qe, ve] = g.useState(!0), Ce = !i && r != null && a === y(r), w = z && !G, f = w ? ye(
141
+ _e.filter((t) => !(ne && (i ? r : [r]).some((e) => e !== null && E(t, e)))),
142
142
  // we use the empty string to manipulate `filterOptions` to not filter any options
143
143
  // i.e. the filter predicate always returns true
144
144
  {
145
- inputValue: ve && Qe ? "" : a,
145
+ inputValue: Ce && Qe ? "" : a,
146
146
  getOptionLabel: y
147
147
  }
148
148
  ) : [], C = bt({
@@ -152,33 +152,33 @@ function It(u) {
152
152
  });
153
153
  g.useEffect(() => {
154
154
  const t = r !== C.value;
155
- ce && !t || R && !t || fe(null, r);
156
- }, [r, fe, ce, C.value, R]);
157
- const Ne = z && f.length > 0 && !X;
158
- if (process.env.NODE_ENV !== "production" && r !== null && !R && Ie.length > 0) {
159
- const t = (i ? r : [r]).filter((e) => !Ie.some((n) => D(n, e)));
155
+ fe && !t || R && !t || de(null, r);
156
+ }, [r, de, fe, C.value, R]);
157
+ const Se = z && f.length > 0 && !G;
158
+ if (process.env.NODE_ENV !== "production" && r !== null && !R && _e.length > 0) {
159
+ const t = (i ? r : [r]).filter((e) => !_e.some((n) => E(n, e)));
160
160
  t.length > 0 && console.warn([`MUI: The value provided to ${m} is invalid.`, `None of the options match with \`${t.length > 1 ? JSON.stringify(t) : JSON.stringify(t[0])}\`.`, "You can use the `isOptionEqualToValue` prop to customize the equality test."].join(`
161
161
  `));
162
162
  }
163
- const de = he((t) => {
164
- t === -1 ? d.current.focus() : ae.querySelector(`[data-tag-index="${t}"]`).focus();
163
+ const pe = me((t) => {
164
+ t === -1 ? d.current.focus() : ue.querySelector(`[data-tag-index="${t}"]`).focus();
165
165
  });
166
166
  g.useEffect(() => {
167
- i && S > r.length - 1 && (ke(-1), de(-1));
168
- }, [r, i, S, de]);
167
+ i && S > r.length - 1 && (Ne(-1), pe(-1));
168
+ }, [r, i, S, pe]);
169
169
  function Ze(t, e) {
170
170
  if (!N.current || t < 0 || t >= f.length)
171
171
  return -1;
172
172
  let n = t;
173
173
  for (; ; ) {
174
- const o = N.current.querySelector(`[data-option-index="${n}"]`), s = be ? !1 : !o || o.disabled || o.getAttribute("aria-disabled") === "true";
174
+ const o = N.current.querySelector(`[data-option-index="${n}"]`), s = xe ? !1 : !o || o.disabled || o.getAttribute("aria-disabled") === "true";
175
175
  if (o && o.hasAttribute("tabindex") && !s)
176
176
  return n;
177
177
  if (e === "next" ? n = (n + 1) % f.length : n = (n - 1 + f.length) % f.length, n === t)
178
178
  return -1;
179
179
  }
180
180
  }
181
- const B = he(({
181
+ const B = me(({
182
182
  event: t,
183
183
  index: e,
184
184
  reason: n = "auto"
@@ -196,10 +196,10 @@ function It(u) {
196
196
  }
197
197
  const l = N.current.querySelector(`[data-option-index="${e}"]`);
198
198
  if (l && (l.classList.add(`${h}-focused`), n === "keyboard" && l.classList.add(`${h}-focusVisible`), s.scrollHeight > s.clientHeight && n !== "mouse" && n !== "touch")) {
199
- const p = l, O = s.clientHeight + s.scrollTop, ge = p.offsetTop + p.offsetHeight;
200
- ge > O ? s.scrollTop = ge - s.clientHeight : p.offsetTop - p.offsetHeight * (j ? 1.3 : 0) < s.scrollTop && (s.scrollTop = p.offsetTop - p.offsetHeight * (j ? 1.3 : 0));
199
+ const p = l, O = s.clientHeight + s.scrollTop, he = p.offsetTop + p.offsetHeight;
200
+ he > O ? s.scrollTop = he - s.clientHeight : p.offsetTop - p.offsetHeight * (j ? 1.3 : 0) < s.scrollTop && (s.scrollTop = p.offsetTop - p.offsetHeight * (j ? 1.3 : 0));
201
201
  }
202
- }), L = he(({
202
+ }), L = me(({
203
203
  event: t,
204
204
  diff: e,
205
205
  direction: n = "next",
@@ -210,19 +210,19 @@ function It(u) {
210
210
  const l = Ze((() => {
211
211
  const p = f.length - 1;
212
212
  if (e === "reset")
213
- return $e;
213
+ return Ae;
214
214
  if (e === "start")
215
215
  return 0;
216
216
  if (e === "end")
217
217
  return p;
218
218
  const O = x.current + e;
219
- return O < 0 ? O === -1 && se ? -1 : ee && x.current !== -1 || Math.abs(e) > 1 ? 0 : p : O > p ? O === p + 1 && se ? -1 : ee || Math.abs(e) > 1 ? p : 0 : O;
219
+ return O < 0 ? O === -1 && se ? -1 : te && x.current !== -1 || Math.abs(e) > 1 ? 0 : p : O > p ? O === p + 1 && se ? -1 : te || Math.abs(e) > 1 ? p : 0 : O;
220
220
  })(), n);
221
221
  if (B({
222
222
  index: l,
223
223
  reason: o,
224
224
  event: t
225
- }), $ && e !== "reset")
225
+ }), A && e !== "reset")
226
226
  if (l === -1)
227
227
  d.current.value = a;
228
228
  else {
@@ -237,10 +237,10 @@ function It(u) {
237
237
  if (x.current !== -1 && C.filteredOptions && C.filteredOptions.length !== f.length && C.inputValue === a && (i ? r.length === C.value.length && C.value.every((e, n) => y(r[n]) === y(e)) : t(C.value, r))) {
238
238
  const e = C.filteredOptions[x.current];
239
239
  if (e)
240
- return me(f, (n) => y(n) === y(e));
240
+ return be(f, (n) => y(n) === y(e));
241
241
  }
242
242
  return -1;
243
- }, Se = g.useCallback(() => {
243
+ }, Pe = g.useCallback(() => {
244
244
  if (!w)
245
245
  return;
246
246
  const t = et();
@@ -258,9 +258,9 @@ function It(u) {
258
258
  if (N.current) {
259
259
  if (e != null) {
260
260
  const n = f[x.current];
261
- if (i && n && me(r, (s) => D(n, s)) !== -1)
261
+ if (i && n && be(r, (s) => E(n, s)) !== -1)
262
262
  return;
263
- const o = me(f, (s) => D(s, e));
263
+ const o = be(f, (s) => E(s, e));
264
264
  o === -1 ? L({
265
265
  diff: "reset"
266
266
  }) : B({
@@ -284,47 +284,47 @@ function It(u) {
284
284
  // Don't sync the highlighted index with the value when multiple
285
285
  // eslint-disable-next-line react-hooks/exhaustive-deps
286
286
  i ? !1 : r,
287
- te,
287
+ ne,
288
288
  L,
289
289
  B,
290
290
  w,
291
291
  a,
292
292
  i
293
- ]), tt = he((t) => {
294
- ht(N, t), t && Se();
293
+ ]), tt = me((t) => {
294
+ ht(N, t), t && Pe();
295
295
  });
296
296
  process.env.NODE_ENV !== "production" && g.useEffect(() => {
297
297
  (!d.current || d.current.nodeName !== "INPUT") && (d.current && d.current.nodeName === "TEXTAREA" ? console.warn([`A textarea element was provided to ${m} where input was expected.`, "This is not a supported scenario but it may work under certain conditions.", "A textarea keyboard navigation may conflict with Autocomplete controls (for example enter and arrow keys).", "Make sure to test keyboard navigation and add custom event handlers if necessary."].join(`
298
298
  `)) : console.error([`MUI: Unable to find the input element. It was resolved to ${d.current} while an HTMLInputElement was expected.`, `Instead, ${m} expects an input element.`, "", m === "useAutocomplete" ? "Make sure you have bound getInputProps correctly and that the normal ref/effect resolutions order is guaranteed." : "Make sure you have customized the input component correctly."].join(`
299
299
  `)));
300
300
  }, [m]), g.useEffect(() => {
301
- Se();
302
- }, [Se]);
301
+ Pe();
302
+ }, [Pe]);
303
303
  const K = (t) => {
304
- z || (De(!0), Ee(!0), c && c(t));
305
- }, G = (t, e) => {
306
- z && (De(!1), ie && ie(t, e));
304
+ z || (Ee(!0), ve(!0), ae && ae(t));
305
+ }, Q = (t, e) => {
306
+ z && (Ee(!1), X && X(t, e));
307
307
  }, J = (t, e, n, o) => {
308
308
  if (i) {
309
309
  if (r.length === e.length && r.every((s, l) => s === e[l]))
310
310
  return;
311
311
  } else if (r === e)
312
312
  return;
313
- W && W(t, e, n, o), Ge(e);
314
- }, pe = g.useRef(!1), Q = (t, e, n = "selectOption", o = "options") => {
313
+ ie && ie(t, e, n, o), Ge(e);
314
+ }, ge = g.useRef(!1), Z = (t, e, n = "selectOption", o = "options") => {
315
315
  let s = n, l = e;
316
316
  if (i) {
317
317
  if (l = Array.isArray(r) ? r.slice() : [], process.env.NODE_ENV !== "production") {
318
- const O = l.filter((ge) => D(e, ge));
318
+ const O = l.filter((he) => E(e, he));
319
319
  O.length > 1 && console.error([`MUI: The \`isOptionEqualToValue\` method of ${m} does not handle the arguments correctly.`, `The component expects a single value to match a given option but found ${O.length} matches.`].join(`
320
320
  `));
321
321
  }
322
- const p = me(l, (O) => D(e, O));
322
+ const p = be(l, (O) => E(e, O));
323
323
  p === -1 ? l.push(e) : o !== "freeSolo" && (l.splice(p, 1), s = "removeOption");
324
324
  }
325
- fe(t, l), J(t, l, s, {
325
+ de(t, l), J(t, l, s, {
326
326
  option: e
327
- }), !Y && (!t || !t.ctrlKey && !t.metaKey) && G(t, s), (V === !0 || V === "touch" && pe.current || V === "mouse" && !pe.current) && d.current.blur();
327
+ }), !Y && (!t || !t.ctrlKey && !t.metaKey) && Q(t, s), (V === !0 || V === "touch" && ge.current || V === "mouse" && !ge.current) && d.current.blur();
328
328
  };
329
329
  function nt(t, e) {
330
330
  if (t === -1)
@@ -333,23 +333,23 @@ function It(u) {
333
333
  for (; ; ) {
334
334
  if (e === "next" && n === r.length || e === "previous" && n === -1)
335
335
  return -1;
336
- const o = ae.querySelector(`[data-tag-index="${n}"]`);
336
+ const o = ue.querySelector(`[data-tag-index="${n}"]`);
337
337
  if (!o || !o.hasAttribute("tabindex") || o.disabled || o.getAttribute("aria-disabled") === "true")
338
338
  n += e === "next" ? 1 : -1;
339
339
  else
340
340
  return n;
341
341
  }
342
342
  }
343
- const Ce = (t, e) => {
343
+ const Le = (t, e) => {
344
344
  if (!i)
345
345
  return;
346
- a === "" && G(t, "toggleInput");
346
+ a === "" && Q(t, "toggleInput");
347
347
  let n = S;
348
- S === -1 ? a === "" && e === "previous" && (n = r.length - 1) : (n += e === "next" ? 1 : -1, n < 0 && (n = 0), n === r.length && (n = -1)), n = nt(n, e), ke(n), de(n);
349
- }, Le = (t) => {
350
- _e.current = !0, ue(""), E && E(t, "", "clear"), J(t, i ? [] : null, "clear");
348
+ S === -1 ? a === "" && e === "previous" && (n = r.length - 1) : (n += e === "next" ? 1 : -1, n < 0 && (n = 0), n === r.length && (n = -1)), n = nt(n, e), Ne(n), pe(n);
349
+ }, Ve = (t) => {
350
+ we.current = !0, ce(""), v && v(t, "", "clear"), J(t, i ? [] : null, "clear");
351
351
  }, rt = (t) => (e) => {
352
- if (t.onKeyDown && t.onKeyDown(e), !e.defaultMuiPrevented && (S !== -1 && ["ArrowLeft", "ArrowRight"].indexOf(e.key) === -1 && (ke(-1), de(-1)), e.which !== 229))
352
+ if (t.onKeyDown && t.onKeyDown(e), !e.defaultMuiPrevented && (S !== -1 && ["ArrowLeft", "ArrowRight"].indexOf(e.key) === -1 && (Ne(-1), pe(-1)), e.which !== 229))
353
353
  switch (e.key) {
354
354
  case "Home":
355
355
  w && oe && (e.preventDefault(), L({
@@ -369,7 +369,7 @@ function It(u) {
369
369
  break;
370
370
  case "PageUp":
371
371
  e.preventDefault(), L({
372
- diff: -je,
372
+ diff: -ze,
373
373
  direction: "previous",
374
374
  reason: "keyboard",
375
375
  event: e
@@ -377,7 +377,7 @@ function It(u) {
377
377
  break;
378
378
  case "PageDown":
379
379
  e.preventDefault(), L({
380
- diff: je,
380
+ diff: ze,
381
381
  direction: "next",
382
382
  reason: "keyboard",
383
383
  event: e
@@ -400,25 +400,25 @@ function It(u) {
400
400
  }), K(e);
401
401
  break;
402
402
  case "ArrowLeft":
403
- Ce(e, "previous");
403
+ Le(e, "previous");
404
404
  break;
405
405
  case "ArrowRight":
406
- Ce(e, "next");
406
+ Le(e, "next");
407
407
  break;
408
408
  case "Enter":
409
409
  if (x.current !== -1 && w) {
410
- const n = f[x.current], o = q ? q(n) : !1;
410
+ const n = f[x.current], o = U ? U(n) : !1;
411
411
  if (e.preventDefault(), o)
412
412
  return;
413
- Q(e, n, "selectOption"), $ && d.current.setSelectionRange(d.current.value.length, d.current.value.length);
413
+ Z(e, n, "selectOption"), A && d.current.setSelectionRange(d.current.value.length, d.current.value.length);
414
414
  } else
415
- R && a !== "" && ve === !1 && (i && e.preventDefault(), Q(e, a, "createOption", "freeSolo"));
415
+ R && a !== "" && Ce === !1 && (i && e.preventDefault(), Z(e, a, "createOption", "freeSolo"));
416
416
  break;
417
417
  case "Escape":
418
- w ? (e.preventDefault(), e.stopPropagation(), G(e, "escape")) : F && (a !== "" || i && r.length > 0) && (e.preventDefault(), e.stopPropagation(), Le(e));
418
+ w ? (e.preventDefault(), e.stopPropagation(), Q(e, "escape")) : F && (a !== "" || i && r.length > 0) && (e.preventDefault(), e.stopPropagation(), Ve(e));
419
419
  break;
420
420
  case "Backspace":
421
- if (i && !X && a === "" && r.length > 0) {
421
+ if (i && !G && a === "" && r.length > 0) {
422
422
  const n = S === -1 ? r.length - 1 : S, o = r.slice();
423
423
  o.splice(n, 1), J(e, o, "removeOption", {
424
424
  option: r[n]
@@ -426,7 +426,7 @@ function It(u) {
426
426
  }
427
427
  break;
428
428
  case "Delete":
429
- if (i && !X && a === "" && r.length > 0 && S !== -1) {
429
+ if (i && !G && a === "" && r.length > 0 && S !== -1) {
430
430
  const n = S, o = r.slice();
431
431
  o.splice(n, 1), J(e, o, "removeOption", {
432
432
  option: r[n]
@@ -435,16 +435,16 @@ function It(u) {
435
435
  break;
436
436
  }
437
437
  }, ot = (t) => {
438
- Ae(!0), Je && !_e.current && K(t);
439
- }, Ve = (t) => {
438
+ De(!0), T && !we.current && K(t);
439
+ }, Me = (t) => {
440
440
  if (b(N)) {
441
441
  d.current.focus();
442
442
  return;
443
443
  }
444
- Ae(!1), we.current = !0, _e.current = !1, H && x.current !== -1 && w ? Q(t, f[x.current], "blur") : H && R && a !== "" ? Q(t, a, "blur", "freeSolo") : M && fe(t, r), G(t, "blur");
444
+ De(!1), ke.current = !0, we.current = !1, H && x.current !== -1 && w ? Z(t, f[x.current], "blur") : H && R && a !== "" ? Z(t, a, "blur", "freeSolo") : M && de(t, r), Q(t, "blur");
445
445
  }, st = (t) => {
446
446
  const e = t.target.value;
447
- a !== e && (ue(e), Ee(!1), E && E(t, e, "input")), e === "" ? !U && !i && J(t, null, "clear") : K(t);
447
+ a !== e && (ce(e), ve(!1), v && v(t, e, "input")), e === "" ? !q && !i && J(t, null, "clear") : K(t);
448
448
  }, it = (t) => {
449
449
  const e = Number(t.currentTarget.getAttribute("data-option-index"));
450
450
  x.current !== e && B({
@@ -457,31 +457,31 @@ function It(u) {
457
457
  event: t,
458
458
  index: Number(t.currentTarget.getAttribute("data-option-index")),
459
459
  reason: "touch"
460
- }), pe.current = !0;
460
+ }), ge.current = !0;
461
461
  }, at = (t) => {
462
462
  const e = Number(t.currentTarget.getAttribute("data-option-index"));
463
- Q(t, f[e], "selectOption"), pe.current = !1;
463
+ Z(t, f[e], "selectOption"), ge.current = !1;
464
464
  }, ut = (t) => (e) => {
465
465
  const n = r.slice();
466
466
  n.splice(t, 1), J(e, n, "removeOption", {
467
467
  option: r[t]
468
468
  });
469
- }, Me = (t) => {
470
- z ? G(t, "toggleInput") : K(t);
469
+ }, Re = (t) => {
470
+ z ? Q(t, "toggleInput") : K(t);
471
471
  }, ct = (t) => {
472
472
  t.currentTarget.contains(t.target) && t.target.getAttribute("id") !== k && t.preventDefault();
473
473
  }, ft = (t) => {
474
- t.currentTarget.contains(t.target) && (d.current.focus(), Ye && we.current && d.current.selectionEnd - d.current.selectionStart === 0 && d.current.select(), we.current = !1);
474
+ t.currentTarget.contains(t.target) && (d.current.focus(), Ye && ke.current && d.current.selectionEnd - d.current.selectionStart === 0 && d.current.select(), ke.current = !1);
475
475
  }, dt = (t) => {
476
- !_ && (a === "" || !z) && Me(t);
476
+ !_ && (a === "" || !z) && Re(t);
477
477
  };
478
- let Pe = R && a.length > 0;
479
- Pe = Pe || (i ? r.length > 0 : r !== null);
480
- let Re = f;
478
+ let Te = R && a.length > 0;
479
+ Te = Te || (i ? r.length > 0 : r !== null);
480
+ let He = f;
481
481
  if (j) {
482
482
  const t = /* @__PURE__ */ new Map();
483
483
  let e = !1;
484
- Re = f.reduce((n, o, s) => {
484
+ He = f.reduce((n, o, s) => {
485
485
  const l = j(o);
486
486
  return n.length > 0 && n[n.length - 1].group === l ? n[n.length - 1].options.push(o) : (process.env.NODE_ENV !== "production" && (t.get(l) && !e && (console.warn(`MUI: The options provided combined with the \`groupBy\` method of ${m} returns duplicated headers.`, "You can solve the issue by sorting the options with the output of `groupBy`."), e = !0), t.set(l, !0)), n.push({
487
487
  key: s,
@@ -491,9 +491,9 @@ function It(u) {
491
491
  })), n;
492
492
  }, []);
493
493
  }
494
- return _ && ce && Ve(), {
495
- getRootProps: (t = {}) => Ke({
496
- "aria-owns": Ne ? `${k}-listbox` : null
494
+ return _ && fe && Me(), {
495
+ getRootProps: (t = {}) => Ue({
496
+ "aria-owns": Se ? `${k}-listbox` : null
497
497
  }, t, {
498
498
  onKeyDown: rt(t),
499
499
  onMouseDown: ct,
@@ -506,16 +506,16 @@ function It(u) {
506
506
  getInputProps: () => ({
507
507
  id: k,
508
508
  value: a,
509
- onBlur: Ve,
509
+ onBlur: Me,
510
510
  onFocus: ot,
511
511
  onChange: st,
512
512
  onMouseDown: dt,
513
513
  // if open then this is handled imperatively so don't let react override
514
514
  // only have an opinion about this when closed
515
515
  "aria-activedescendant": w ? "" : null,
516
- "aria-autocomplete": $ ? "both" : "list",
517
- "aria-controls": Ne ? `${k}-listbox` : void 0,
518
- "aria-expanded": Ne,
516
+ "aria-autocomplete": A ? "both" : "list",
517
+ "aria-controls": Se ? `${k}-listbox` : void 0,
518
+ "aria-expanded": Se,
519
519
  // Disable browser's suggestion that might overlap with the popup.
520
520
  // Handle autocomplete but not autofill.
521
521
  autoComplete: "off",
@@ -528,20 +528,20 @@ function It(u) {
528
528
  getClearProps: () => ({
529
529
  tabIndex: -1,
530
530
  type: "button",
531
- onClick: Le
531
+ onClick: Ve
532
532
  }),
533
533
  getPopupIndicatorProps: () => ({
534
534
  tabIndex: -1,
535
535
  type: "button",
536
- onClick: Me
536
+ onClick: Re
537
537
  }),
538
538
  getTagProps: ({
539
539
  index: t
540
- }) => Ke({
540
+ }) => Ue({
541
541
  key: t,
542
542
  "data-tag-index": t,
543
543
  tabIndex: -1
544
- }, !X && {
544
+ }, !G && {
545
545
  onDelete: ut(t)
546
546
  }),
547
547
  getListboxProps: () => ({
@@ -558,9 +558,9 @@ function It(u) {
558
558
  option: e
559
559
  }) => {
560
560
  var n;
561
- const o = (i ? r : [r]).some((l) => l != null && D(e, l)), s = q ? q(e) : !1;
561
+ const o = (i ? r : [r]).some((l) => l != null && E(e, l)), s = U ? U(e) : !1;
562
562
  return {
563
- key: (n = ne == null ? void 0 : ne(e)) != null ? n : y(e),
563
+ key: (n = W == null ? void 0 : W(e)) != null ? n : y(e),
564
564
  tabIndex: -1,
565
565
  role: "option",
566
566
  id: `${k}-option-${t}`,
@@ -575,17 +575,17 @@ function It(u) {
575
575
  id: k,
576
576
  inputValue: a,
577
577
  value: r,
578
- dirty: Pe,
579
- expanded: w && ae,
578
+ dirty: Te,
579
+ expanded: w && ue,
580
580
  popupOpen: w,
581
- focused: ce || S !== -1,
582
- anchorEl: ae,
581
+ focused: fe || S !== -1,
582
+ anchorEl: ue,
583
583
  setAnchorEl: Xe,
584
584
  focusedTag: S,
585
- groupedOptions: Re
585
+ groupedOptions: He
586
586
  };
587
587
  }
588
- const _t = "_autocomplete_1mx2f_1", ze = {
588
+ const _t = "_autocomplete_1mx2f_1", Je = {
589
589
  autocomplete: _t,
590
590
  "autocomplete__dropdown-list": "_autocomplete__dropdown-list_1mx2f_4",
591
591
  "autocomplete__dropdown-item": "_autocomplete__dropdown-item_1mx2f_9"
@@ -593,92 +593,93 @@ const _t = "_autocomplete_1mx2f_1", ze = {
593
593
  label: u,
594
594
  type: b,
595
595
  options: h,
596
- infoMessage: $,
597
- errorMessage: A,
596
+ infoMessage: A,
597
+ errorMessage: D,
598
598
  leftIcon: H,
599
599
  rightIcon: V,
600
600
  id: M,
601
601
  disabled: F,
602
602
  maxLength: m,
603
603
  onChange: I,
604
- classNameLabel: U,
605
- classNameInput: Y,
606
- classNameErrorMessage: _,
607
- classNameInfoMessage: be,
608
- "data-testid-label": ee,
609
- "data-testid-input": xe,
610
- "data-testid-infoMessage": te,
611
- "data-testid-errorMessage": R,
612
- ...q
604
+ onInputChange: q,
605
+ classNameLabel: Y,
606
+ classNameInput: _,
607
+ classNameErrorMessage: xe,
608
+ classNameInfoMessage: te,
609
+ "data-testid-label": ye,
610
+ "data-testid-input": ne,
611
+ "data-testid-infoMessage": R,
612
+ "data-testid-errorMessage": U,
613
+ ...W
613
614
  }) => {
614
- const ne = pt(), re = M || `input_${ne}`;
615
- Object.assign(q, { "data-testid": xe });
616
- const [j, oe] = Fe(), [ye, se] = Fe(""), { getRootProps: Oe, getInputProps: D, getOptionProps: i, groupedOptions: W, getListboxProps: ie, focused: le, getInputLabelProps: E } = It({
617
- id: re,
615
+ const re = pt(), j = M || `input_${re}`;
616
+ Object.assign(W, { "data-testid": ne });
617
+ const [oe, Oe] = qe(), [se, Ie] = qe(""), { getRootProps: E, getInputProps: i, getOptionProps: ie, groupedOptions: X, getListboxProps: le, focused: v, getInputLabelProps: ae } = It({
618
+ id: j,
618
619
  options: h,
619
620
  getOptionLabel: (c) => typeof c == "string" ? c : c == null ? void 0 : c.label,
620
- value: j,
621
- inputValue: ye,
622
- onChange: (c, v) => {
623
- I && I(c, v), oe(v);
621
+ value: oe,
622
+ inputValue: se,
623
+ onChange: (c, T) => {
624
+ I && I(c, T), Oe(T);
624
625
  },
625
- onInputChange: (c, v) => {
626
- se(v);
626
+ onInputChange: (c, T) => {
627
+ q && q(c, T), Ie(T);
627
628
  }
628
629
  });
629
- return /* @__PURE__ */ He("div", { className: "autocomplete", children: [
630
- u && /* @__PURE__ */ T(
631
- Be,
630
+ return /* @__PURE__ */ Fe("div", { className: "autocomplete", children: [
631
+ u && /* @__PURE__ */ $(
632
+ Ke,
632
633
  {
633
634
  element: "label",
634
- elementProps: { ...E() },
635
- className: Z(P.input__label, U),
636
- "data-testid": ee,
635
+ elementProps: { ...ae() },
636
+ className: ee(P.input__label, Y),
637
+ "data-testid": ye,
637
638
  children: u
638
639
  }
639
640
  ),
640
- /* @__PURE__ */ T("div", { ...Oe(), className: le ? "Mui-focused" : "", children: /* @__PURE__ */ T(
641
+ /* @__PURE__ */ $("div", { ...E(), className: v ? "Mui-focused" : "", children: /* @__PURE__ */ $(
641
642
  gt,
642
643
  {
643
644
  disabled: F,
644
- error: !!A,
645
+ error: !!D,
645
646
  "aria-label": u,
646
647
  slotProps: {
647
648
  root: (c) => ({
648
- className: Z(P["input__input-el-wrapper"], {
649
+ className: ee(P["input__input-el-wrapper"], {
649
650
  [P["input--disabled"]]: c.disabled,
650
651
  [P["input--focused"]]: c.focused,
651
652
  [P["input--error"]]: c.error
652
653
  })
653
654
  }),
654
655
  input: {
655
- ...D(),
656
- className: Z(P["input__input-el"], Y),
656
+ ...i(),
657
+ className: ee(P["input__input-el"], _),
657
658
  maxLength: m,
658
- ...q
659
+ ...W
659
660
  }
660
661
  },
661
- startAdornment: H && /* @__PURE__ */ T("span", { className: P["input__left-icon"], children: H }),
662
- endAdornment: b === "search" ? /* @__PURE__ */ T("span", { className: P["input__right-icon"], children: /* @__PURE__ */ T(qe, { color: "var(--accent)", icon: "magnifying-glass" }) }) : V && /* @__PURE__ */ T("span", { className: P["input__right-icon"], children: V })
662
+ startAdornment: H && /* @__PURE__ */ $("span", { className: P["input__left-icon"], children: H }),
663
+ endAdornment: b === "search" ? /* @__PURE__ */ $("span", { className: P["input__right-icon"], children: /* @__PURE__ */ $(Be, { color: "var(--accent)", icon: "magnifying-glass" }) }) : V && /* @__PURE__ */ $("span", { className: P["input__right-icon"], children: V })
663
664
  }
664
665
  ) }),
665
- W.length > 0 && !F && /* @__PURE__ */ T("ul", { ...ie(), className: ze["autocomplete__dropdown-list"], children: W.map((c, v) => /* @__PURE__ */ T(
666
+ X.length > 0 && !F && /* @__PURE__ */ $("ul", { ...le(), className: Je["autocomplete__dropdown-list"], children: X.map((c, T) => /* @__PURE__ */ $(
666
667
  "li",
667
668
  {
668
- tabIndex: v,
669
- className: ze["autocomplete__dropdown-item"],
670
- ...i({ option: c, index: v }),
669
+ tabIndex: T,
670
+ className: Je["autocomplete__dropdown-item"],
671
+ ...ie({ option: c, index: T }),
671
672
  children: typeof c == "string" ? c : c == null ? void 0 : c.label
672
673
  }
673
674
  )) }),
674
- (A || $) && /* @__PURE__ */ He(
675
- Be,
675
+ (D || A) && /* @__PURE__ */ Fe(
676
+ Ke,
676
677
  {
677
- className: A ? Z(P["input__error-message"], _) : Z(P["input__info-message"], be),
678
- "data-testid": A ? R : te,
678
+ className: D ? ee(P["input__error-message"], xe) : ee(P["input__info-message"], te),
679
+ "data-testid": D ? U : R,
679
680
  children: [
680
- /* @__PURE__ */ T(qe, { icon: "circle-exclamation" }),
681
- A || $
681
+ /* @__PURE__ */ $(Be, { icon: "circle-exclamation" }),
682
+ D || A
682
683
  ]
683
684
  }
684
685
  )