@reportportal/ui-kit 0.0.1-alpha.208 → 0.0.1-alpha.209

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,796 +1,851 @@
1
- import { jsx as s, jsxs as j, Fragment as me } from "react/jsx-runtime";
2
- import { useState as ie, useRef as Ne, useEffect as ke, useCallback as V, forwardRef as $e } from "react";
3
- import { c as X } from "./bind-06a7ff84.js";
4
- import { Scrollbars as Ae } from "rc-scrollbars";
5
- import { B as Pe } from "./bubblesLoader-f3ffa240.js";
1
+ import { jsx as r, jsxs as P, Fragment as he } from "react/jsx-runtime";
2
+ import { useState as ne, useRef as Me, useEffect as ke, useCallback as Q, forwardRef as Pe, useLayoutEffect as $e, useMemo as Le } from "react";
3
+ import { c as Z } from "./bind-06a7ff84.js";
4
+ import { Scrollbars as Oe } from "rc-scrollbars";
5
+ import { B as Te } from "./bubblesLoader-f3ffa240.js";
6
6
  import { B as je } from "./button-7ab874f3.js";
7
- import { S as Oe } from "./plus-199fb2a8.js";
8
- import { i as be } from "./isEmpty-ccacb5ff.js";
9
- import de from "downshift";
10
- import { useFloating as Ie, autoUpdate as Ce, size as We } from "@floating-ui/react";
11
- import { F as He } from "./fieldText-1749da7a.js";
12
- import { S as Se } from "./dropdown-0260bb66.js";
13
- import { S as Le } from "./close-4d480ef7.js";
14
- import { S as Te } from "./clear-53660571.js";
7
+ import { S as He } from "./plus-199fb2a8.js";
8
+ import { i as Ee } from "./isEmpty-ccacb5ff.js";
9
+ import { createPortal as We } from "react-dom";
10
+ import pe from "downshift";
11
+ import { useFloating as Re, autoUpdate as Ae, flip as Ye, size as Ke } from "@floating-ui/react";
12
+ import { F as Xe } from "./fieldText-1749da7a.js";
13
+ import { S as De } from "./dropdown-0260bb66.js";
14
+ import { S as Ge } from "./close-4d480ef7.js";
15
+ import { S as Je } from "./clear-53660571.js";
15
16
  import "./openEye-950159cb.js";
16
17
  import "./baseIconButton-251479f7.js";
17
18
  import "./spinLoader-c4a53718.js";
18
19
  import "./maxValueDisplay-9be01a75.js";
19
20
  import "./fieldLabel.js";
20
- const Ke = "_disabled_1rpph_43", Ye = "_input_1rpph_107", Xe = {
21
+ const Qe = "_disabled_1rpph_43", Ze = "_input_1rpph_107", qe = {
21
22
  "selected-item": "_selected-item_1rpph_16",
22
23
  "validation-error": "_validation-error_1rpph_35",
23
24
  "highlight-un-stored-item": "_highlight-un-stored-item_1rpph_40",
24
- disabled: Ke,
25
+ disabled: Qe,
25
26
  "mobile-disabled": "_mobile-disabled_1rpph_48",
26
27
  "selected-item-text": "_selected-item-text_1rpph_54",
27
28
  "single-line": "_single-line_1rpph_58",
28
29
  "cross-icon": "_cross-icon_1rpph_64",
29
- input: Ye
30
- }, ce = X.bind(Xe), Ge = (t) => t.scrollWidth > t.clientWidth, Je = ({
30
+ input: Ze
31
+ }, me = Z.bind(qe), Ue = (t) => t.scrollWidth > t.clientWidth, Ve = ({
31
32
  item: t,
32
33
  onRemoveItem: e,
33
- disabled: c = !1,
34
- mobileDisabled: r = !1,
34
+ disabled: n = !1,
35
+ mobileDisabled: s = !1,
35
36
  parseValueToString: o,
36
- error: d = !1,
37
+ error: i = !1,
37
38
  editItem: h,
38
- editable: p = !1,
39
- getAdditionalCreationCondition: g = () => !0,
40
- storedOption: v = !0,
41
- highlightUnStoredItem: m = !1,
42
- variant: C = "light",
39
+ editable: u = !1,
40
+ getAdditionalCreationCondition: x = () => !0,
41
+ storedOption: y = !0,
42
+ highlightUnStoredItem: f = !1,
43
+ variant: z = "light",
43
44
  getItemName: k,
44
- singleLine: u = !1,
45
+ singleLine: m = !1,
45
46
  className: R,
46
- textClassName: M
47
+ textClassName: A
47
48
  }) => {
48
- const [w, b] = ie(!1), [B, S] = ie(""), [i, a] = ie(!1), n = Ne(null), f = () => {
49
- !c && p && !v && (S((k == null ? void 0 : k(t)) || (o == null ? void 0 : o(t)) || ""), b(!0));
50
- }, l = (F) => {
51
- S(F.target.value);
52
- }, y = (F) => {
53
- const H = g(B);
54
- F.key === "Enter" && H && (h(t, B), b(!1), S(""));
55
- }, D = () => {
56
- b(!1), S("");
57
- }, W = (F) => {
58
- F.stopPropagation(), e(t);
59
- }, L = (o == null ? void 0 : o(t)) || "";
49
+ const [g, w] = ne(!1), [D, C] = ne(""), [d, a] = ne(!1), l = Me(null), p = () => {
50
+ !n && u && !y && (C((k == null ? void 0 : k(t)) || (o == null ? void 0 : o(t)) || ""), w(!0));
51
+ }, c = (B) => {
52
+ C(B.target.value);
53
+ }, v = (B) => {
54
+ const H = x(D);
55
+ B.key === "Enter" && H && (h(t, D), w(!1), C(""));
56
+ }, F = () => {
57
+ w(!1), C("");
58
+ }, $ = (B) => {
59
+ B.stopPropagation(), e(t);
60
+ }, j = (o == null ? void 0 : o(t)) || "";
60
61
  ke(() => {
61
- if (n.current && u) {
62
- const F = () => {
63
- n.current && a(Ge(n.current));
62
+ if (l.current && m) {
63
+ const B = () => {
64
+ l.current && a(Ue(l.current));
64
65
  };
65
- if (F(), typeof ResizeObserver < "u") {
66
- const H = new ResizeObserver(F);
67
- return H.observe(n.current), () => H.disconnect();
66
+ if (B(), typeof ResizeObserver < "u") {
67
+ const H = new ResizeObserver(B);
68
+ return H.observe(l.current), () => H.disconnect();
68
69
  }
69
70
  } else
70
71
  a(!1);
71
- }, [L, u]);
72
- const te = ce(
72
+ }, [j, m]);
73
+ const ee = me(
73
74
  "selected-item-text",
74
75
  {
75
- "single-line": u
76
+ "single-line": m
76
77
  },
77
- M
78
- ), G = ce(
78
+ A
79
+ ), O = me(
79
80
  "selected-item",
80
- C,
81
+ z,
81
82
  {
82
- [`validation-${d}`]: d,
83
- disabled: c,
84
- "mobile-disabled": r,
85
- "highlight-un-stored-item": m && !v
83
+ [`validation-${i}`]: i,
84
+ disabled: n,
85
+ "mobile-disabled": s,
86
+ "highlight-un-stored-item": f && !y
86
87
  },
87
88
  R
88
89
  );
89
- return w ? /* @__PURE__ */ s(
90
+ return g ? /* @__PURE__ */ r(
90
91
  "input",
91
92
  {
92
93
  autoFocus: !0,
93
- value: B,
94
- onChange: l,
95
- onKeyDown: y,
96
- onBlur: D,
97
- className: ce("input")
94
+ value: D,
95
+ onChange: c,
96
+ onKeyDown: v,
97
+ onBlur: F,
98
+ className: me("input")
98
99
  }
99
- ) : /* @__PURE__ */ j("div", { className: G, onClick: f, children: [
100
- /* @__PURE__ */ s(
100
+ ) : /* @__PURE__ */ P("div", { className: O, onClick: p, children: [
101
+ /* @__PURE__ */ r(
101
102
  "span",
102
103
  {
103
- ref: n,
104
- className: te,
105
- title: u && i ? L : void 0,
106
- children: L
104
+ ref: l,
105
+ className: ee,
106
+ title: m && d ? j : void 0,
107
+ children: j
107
108
  }
108
109
  ),
109
- !c && /* @__PURE__ */ s(
110
+ !n && /* @__PURE__ */ r(
110
111
  "button",
111
112
  {
112
113
  type: "button",
113
- className: ce("cross-icon", {
114
- [`validation-${d}`]: d,
115
- "mobile-disabled": r,
116
- disabled: c
114
+ className: me("cross-icon", {
115
+ [`validation-${i}`]: i,
116
+ "mobile-disabled": s,
117
+ disabled: n
117
118
  }),
118
- onClick: W,
119
- children: /* @__PURE__ */ s(Le, {})
119
+ onClick: $,
120
+ children: /* @__PURE__ */ r(Ge, {})
120
121
  }
121
122
  )
122
123
  ] });
123
- }, Qe = ({
124
+ }, et = ({
124
125
  items: t = [],
125
126
  parseValueToString: e,
126
- getItemValidationErrorType: c,
127
- storedItemsMap: r = {},
127
+ getItemValidationErrorType: n,
128
+ storedItemsMap: s = {},
128
129
  highlightUnStoredItem: o = !1,
129
- renderCustomSelectedItem: d,
130
+ renderCustomSelectedItem: i,
130
131
  selectedItemSingleLine: h,
131
- selectedItemClassName: p,
132
- selectedItemTextClassName: g,
133
- ...v
134
- }) => t.map((m) => d ? d(m) : /* @__PURE__ */ s(
135
- Je,
132
+ selectedItemClassName: u,
133
+ selectedItemTextClassName: x,
134
+ ...y
135
+ }) => t.map((f) => i ? i(f) : /* @__PURE__ */ r(
136
+ Ve,
136
137
  {
137
138
  parseValueToString: e,
138
- error: (c == null ? void 0 : c(m)) || "",
139
- item: m,
140
- storedOption: !!r[e(m)],
139
+ error: (n == null ? void 0 : n(f)) || "",
140
+ item: f,
141
+ storedOption: !!s[e(f)],
141
142
  highlightUnStoredItem: o,
142
143
  singleLine: h,
143
- className: p,
144
- textClassName: g,
145
- ...v
144
+ className: u,
145
+ textClassName: x,
146
+ ...y
146
147
  },
147
- e == null ? void 0 : e(m)
148
- )), Ze = "_prompt_1xfmd_16", qe = {
149
- prompt: Ze
150
- }, Ue = X.bind(qe), Ve = ({ children: t = null }) => /* @__PURE__ */ s("div", { className: Ue("prompt"), children: t }), et = "_item_zw4ux_16", tt = "_divider_zw4ux_24", st = "_active_zw4ux_49", ot = "_value_zw4ux_55", nt = "_tag_zw4ux_69", rt = "_disabled_zw4ux_80", lt = {
151
- item: et,
152
- divider: tt,
148
+ e == null ? void 0 : e(f)
149
+ )), tt = "_prompt_1xfmd_16", ot = {
150
+ prompt: tt
151
+ }, st = Z.bind(ot), nt = ({ children: t = null }) => /* @__PURE__ */ r("div", { className: st("prompt"), children: t }), rt = "_item_zw4ux_16", lt = "_divider_zw4ux_24", ct = "_active_zw4ux_49", it = "_value_zw4ux_55", at = "_tag_zw4ux_69", dt = "_disabled_zw4ux_80", ut = {
152
+ item: rt,
153
+ divider: lt,
153
154
  "new-item": "_new-item_zw4ux_31",
154
- active: st,
155
- value: ot,
155
+ active: ct,
156
+ value: it,
156
157
  "key-variant": "_key-variant_zw4ux_66",
157
- tag: nt,
158
+ tag: at,
158
159
  "button-active": "_button-active_zw4ux_80",
159
- disabled: rt,
160
+ disabled: dt,
160
161
  "value-variant": "_value-variant_zw4ux_100"
161
- }, ee = X.bind(lt), ge = ({
162
+ }, V = Z.bind(ut), Se = ({
162
163
  isActive: t = !1,
163
164
  isSelected: e = !1,
164
- isNew: c = !1,
165
- children: r = null,
165
+ isNew: n = !1,
166
+ children: s = null,
166
167
  disabled: o = !1,
167
- optionVariant: d = "",
168
+ optionVariant: i = "",
168
169
  newItemButtonText: h = "",
169
- ...p
170
+ ...u
170
171
  }) => {
171
- const g = () => h || (d === "key-variant" ? "New key" : "New value");
172
- return c ? /* @__PURE__ */ j(me, { children: [
173
- /* @__PURE__ */ s("div", { className: ee("divider") }),
174
- /* @__PURE__ */ j(
172
+ const x = () => h || (i === "key-variant" ? "New key" : "New value");
173
+ return n ? /* @__PURE__ */ P(he, { children: [
174
+ /* @__PURE__ */ r("div", { className: V("divider") }),
175
+ /* @__PURE__ */ P(
175
176
  "li",
176
177
  {
177
- className: ee("new-item", d, {
178
+ className: V("new-item", i, {
178
179
  active: t,
179
180
  selected: e,
180
181
  disabled: o
181
182
  }),
182
- ...p,
183
+ ...u,
183
184
  children: [
184
- /* @__PURE__ */ s("span", { className: ee("value"), children: r }),
185
- /* @__PURE__ */ s(
185
+ /* @__PURE__ */ r("span", { className: V("value"), children: s }),
186
+ /* @__PURE__ */ r(
186
187
  je,
187
188
  {
188
- ...!o && p,
189
- className: ee({ "button-active": t }),
190
- icon: /* @__PURE__ */ s(Oe, {}),
189
+ ...!o && u,
190
+ className: V({ "button-active": t }),
191
+ icon: /* @__PURE__ */ r(He, {}),
191
192
  variant: "text",
192
- children: g()
193
+ children: x()
193
194
  }
194
195
  )
195
196
  ]
196
197
  }
197
198
  )
198
- ] }) : /* @__PURE__ */ s(
199
+ ] }) : /* @__PURE__ */ r(
199
200
  "li",
200
201
  {
201
- className: ee("item", d, {
202
+ className: V("item", i, {
202
203
  active: t,
203
204
  selected: e,
204
205
  disabled: o
205
206
  }),
206
- ...o ? {} : p,
207
- children: /* @__PURE__ */ s("span", { className: ee("label", "tag"), children: r })
207
+ ...o ? {} : u,
208
+ children: /* @__PURE__ */ r("span", { className: V("label", "tag"), children: s })
208
209
  }
209
210
  );
210
- }, ct = "_container_12uzd_16", at = {
211
- container: ct,
211
+ }, mt = "_container_12uzd_16", ft = {
212
+ container: mt,
212
213
  "empty-list-message": "_empty-list-message_12uzd_20",
213
214
  "limitation-item": "_limitation-item_12uzd_28"
214
- }, ae = X.bind(at), it = (t) => {
215
+ }, fe = Z.bind(ft), pt = (t) => {
215
216
  const {
216
217
  options: e,
217
- async: c,
218
- inputValue: r,
218
+ async: n,
219
+ inputValue: s,
219
220
  loading: o,
220
- createWithoutConfirmation: d,
221
+ createWithoutConfirmation: i,
221
222
  customEmptyListMessage: h,
222
- customNoMatchesMessage: p,
223
- optionVariant: g,
224
- newItemButtonText: v,
225
- renderOption: m,
226
- getUniqKey: C,
223
+ customNoMatchesMessage: u,
224
+ optionVariant: x,
225
+ newItemButtonText: y,
226
+ renderOption: f,
227
+ getUniqKey: z,
227
228
  getItemProps: k,
228
- parseValueToString: u,
229
+ parseValueToString: m,
229
230
  limitationText: R = "Too many results. Type to search",
230
- optionsLimit: M = 0
231
- } = t, w = V(() => (e || []).filter((l) => u(l).toUpperCase().indexOf((r.toUpperCase() || "").trim()) > -1), [r, e, u]), b = V(
232
- (l, y, D = !1) => m ? m(l, y, D, k) : /* @__PURE__ */ s(
233
- ge,
231
+ optionsLimit: A = 0
232
+ } = t, g = Q(() => (e || []).filter((c) => m(c).toUpperCase().indexOf((s.toUpperCase() || "").trim()) > -1), [s, e, m]), w = Q(
233
+ (c, v, F = !1) => f ? f(c, v, F, k) : /* @__PURE__ */ r(
234
+ Se,
234
235
  {
235
- optionVariant: g,
236
- ...k({ item: l, index: y }),
237
- isNew: D,
238
- newItemButtonText: v,
239
- children: u(l)
236
+ optionVariant: x,
237
+ ...k({ item: c, index: v }),
238
+ isNew: F,
239
+ newItemButtonText: y,
240
+ children: m(c)
240
241
  },
241
- (C == null ? void 0 : C(l)) || u(l)
242
+ (z == null ? void 0 : z(c)) || m(c)
242
243
  ),
243
- [k, C, v, g, u, m]
244
- ), B = V(
245
- (l) => l.length ? l.map((y, D) => b(y, D)) : "",
246
- [b]
247
- ), S = V(
248
- (l) => {
249
- const y = l.length;
250
- return /* @__PURE__ */ s("div", { className: ae({ container: !y }), children: /* @__PURE__ */ s(
251
- ge,
244
+ [k, z, y, x, m, f]
245
+ ), D = Q(
246
+ (c) => c.length ? c.map((v, F) => w(v, F)) : "",
247
+ [w]
248
+ ), C = Q(
249
+ (c) => {
250
+ const v = c.length;
251
+ return /* @__PURE__ */ r("div", { className: fe({ container: !v }), children: /* @__PURE__ */ r(
252
+ Se,
252
253
  {
253
- optionVariant: g,
254
+ optionVariant: x,
254
255
  isNew: !0,
255
- newItemButtonText: v,
256
- ...k({ item: r, index: y }),
257
- children: u(r)
256
+ newItemButtonText: y,
257
+ ...k({ item: s, index: v }),
258
+ children: m(s)
258
259
  },
259
- u(r)
260
+ m(s)
260
261
  ) });
261
262
  },
262
- [k, r, v, g, u]
263
- ), i = V(
264
- (l) => o ? /* @__PURE__ */ j(me, { children: [
265
- /* @__PURE__ */ s(Ve, { children: /* @__PURE__ */ s(Pe, {}) }),
266
- !d && S(l)
263
+ [k, s, y, x, m]
264
+ ), d = Q(
265
+ (c) => o ? /* @__PURE__ */ P(he, { children: [
266
+ /* @__PURE__ */ r(nt, { children: /* @__PURE__ */ r(Te, {}) }),
267
+ !i && C(c)
267
268
  ] }) : "",
268
- [d, o, S]
269
- ), a = V(() => {
270
- const l = (e == null ? void 0 : e.length) === 0 ? h || "No available options" : p || "No matches found";
271
- return /* @__PURE__ */ s("div", { className: ae("empty-list-message"), children: l });
272
- }, [h, p, e == null ? void 0 : e.length]), n = c ? e : w(), f = i(e);
273
- return f || /* @__PURE__ */ j("div", { className: ae({ container: e.length }), children: [
274
- /* @__PURE__ */ j(Ae, { autoHeight: !0, autoHeightMax: 216, hideTracksWhenNotNeeded: !0, children: [
275
- be(n) ? a() : B(n),
276
- (n == null ? void 0 : n.length) > M && M > 0 && R ? /* @__PURE__ */ s("li", { className: ae("limitation-item"), "aria-hidden": "true", children: R }) : null
269
+ [i, o, C]
270
+ ), a = Q(() => {
271
+ const c = (e == null ? void 0 : e.length) === 0 ? h || "No available options" : u || "No matches found";
272
+ return /* @__PURE__ */ r("div", { className: fe("empty-list-message"), children: c });
273
+ }, [h, u, e == null ? void 0 : e.length]), l = n ? e : g(), p = d(e);
274
+ return p || /* @__PURE__ */ P("div", { className: fe({ container: e.length }), children: [
275
+ /* @__PURE__ */ P(Oe, { autoHeight: !0, autoHeightMax: 216, hideTracksWhenNotNeeded: !0, children: [
276
+ Ee(l) ? a() : D(l),
277
+ (l == null ? void 0 : l.length) > A && A > 0 && R ? /* @__PURE__ */ r("li", { className: fe("limitation-item"), "aria-hidden": "true", children: R }) : null
277
278
  ] }),
278
- !d && S(n)
279
+ !i && C(l)
279
280
  ] });
280
- }, dt = "_menu_f64z5_16", ut = "_opened_f64z5_34", mt = "_dark_f64z5_37", ft = {
281
- menu: dt,
282
- opened: ut,
283
- dark: mt
284
- }, pt = X.bind(ft), _t = (t, e) => !t || t <= e.trim().length, Ee = $e(
281
+ }, _t = "_menu_f64z5_16", ht = "_opened_f64z5_34", wt = "_dark_f64z5_37", vt = {
282
+ menu: _t,
283
+ opened: ht,
284
+ dark: wt
285
+ }, bt = Z.bind(vt), yt = (t, e) => !t || t <= e.trim().length, Fe = Pe(
285
286
  ({
286
287
  isOpen: t = !1,
287
288
  style: e = {},
288
- minLength: c = 1,
289
- isDropdownMode: r,
289
+ minLength: n = 1,
290
+ isDropdownMode: s,
290
291
  inputValue: o = "",
291
- className: d = "",
292
+ className: i = "",
292
293
  ...h
293
- }, p) => /* @__PURE__ */ s(
294
+ }, u) => /* @__PURE__ */ r(
294
295
  "ul",
295
296
  {
296
- ref: p,
297
- className: pt(
297
+ ref: u,
298
+ className: bt(
298
299
  "menu",
299
- { opened: t && (r || _t(c, o)) },
300
- d
300
+ { opened: t && (s || yt(n, o)) },
301
+ i
301
302
  ),
302
303
  style: e,
303
- children: /* @__PURE__ */ s(it, { inputValue: o, ...h })
304
+ children: /* @__PURE__ */ r(pt, { inputValue: o, ...h })
304
305
  }
305
306
  )
306
- ), ye = (t, e) => typeof t == "string" ? t : e ? String(t[e(t)]) : "", ue = (t, e) => {
307
- var r;
308
- return t === e ? !0 : !!(t && e && typeof t == "object" && typeof e == "object" && Object.keys(t).length === Object.keys(e).length && ((r = Object.entries(t)) != null && r.every(([o, d]) => ue(d, e[o]))));
309
- }, ht = (t, e, c) => typeof t == "string" ? t === e : c ? (() => {
310
- const r = c(t);
311
- return t[r] === e[r];
312
- })() : !1, bt = ({
307
+ ), ze = (t, e) => typeof t == "string" ? t : e ? String(t[e(t)]) : "", _e = (t, e) => {
308
+ var s;
309
+ return t === e ? !0 : !!(t && e && typeof t == "object" && typeof e == "object" && Object.keys(t).length === Object.keys(e).length && ((s = Object.entries(t)) != null && s.every(([o, i]) => _e(i, e[o]))));
310
+ }, gt = (t, e, n) => typeof t == "string" ? t === e : n ? (() => {
311
+ const s = n(t);
312
+ return t[s] === e[s];
313
+ })() : !1, xt = ({
313
314
  options: t = [],
314
315
  onChange: e,
315
- selectedItems: c = [],
316
- handleUnStoredItemCb: r = null,
316
+ selectedItems: n = [],
317
+ handleUnStoredItemCb: s = null,
317
318
  existingItemsMap: o = {},
318
- children: d,
319
- customizeNewSelectedValue: h = (m) => m,
320
- getOptionUniqKey: p,
321
- getOptionUniqKeyValue: g,
322
- ...v
319
+ children: i,
320
+ customizeNewSelectedValue: h = (f) => f,
321
+ getOptionUniqKey: u,
322
+ getOptionUniqKeyValue: x,
323
+ ...y
323
324
  }) => {
324
- const [m, C] = ie(o), k = (i, a) => {
325
- const n = {
326
- ...m
325
+ const [f, z] = ne(o), k = (d, a) => {
326
+ const l = {
327
+ ...f
327
328
  };
328
- i.forEach((f) => {
329
- if (t.find((l) => ht(l, f, p))) {
330
- const l = ye(f, p);
331
- n[l] = !0;
329
+ d.forEach((p) => {
330
+ if (t.find((c) => gt(c, p, u))) {
331
+ const c = ze(p, u);
332
+ l[c] = !0;
332
333
  }
333
- }), C(n), a(n);
334
- }, u = (i, a) => {
335
- const n = ye(i, p);
336
- if (n in m) {
337
- const f = { ...m };
338
- delete f[n], C(f), a(f);
334
+ }), z(l), a(l);
335
+ }, m = (d, a) => {
336
+ const l = ze(d, u);
337
+ if (l in f) {
338
+ const p = { ...f };
339
+ delete p[l], z(p), a(p);
339
340
  } else
340
- a(m);
341
- }, R = (i, a) => {
342
- const n = h(i), f = Array.isArray(n) ? n : [n], y = [...c.filter((W) => f.indexOf(W) < 0), ...f];
343
- e == null || e(y, a), k(f, (W) => r == null ? void 0 : r(y, W));
344
- }, M = (i, a) => {
345
- const n = c.indexOf(i), f = [...c];
346
- f.splice(n, 1, a), e == null || e(f, null);
347
- }, w = (i, a) => {
348
- const n = c.filter((l) => !ue(l, i));
349
- e == null || e(n, a), u(i, (l) => r == null ? void 0 : r(n, l));
350
- }, b = (i, a) => {
351
- i && R(i, a);
352
- }, B = (i) => ({
353
- removeItem: w,
354
- editItem: M,
341
+ a(f);
342
+ }, R = (d, a) => {
343
+ const l = h(d), p = Array.isArray(l) ? l : [l], v = [...n.filter(($) => p.indexOf($) < 0), ...p];
344
+ e == null || e(v, a), k(p, ($) => s == null ? void 0 : s(v, $));
345
+ }, A = (d, a) => {
346
+ const l = n.indexOf(d), p = [...n];
347
+ p.splice(l, 1, a), e == null || e(p, null);
348
+ }, g = (d, a) => {
349
+ const l = n.filter((c) => !_e(c, d));
350
+ e == null || e(l, a), m(d, (c) => s == null ? void 0 : s(l, c));
351
+ }, w = (d, a) => {
352
+ d && R(d, a);
353
+ }, D = (d) => ({
354
+ removeItem: g,
355
+ editItem: A,
355
356
  handleChange: e,
356
- getOptionUniqKeyValue: g,
357
- storedItemsMap: m,
358
- ...i
357
+ getOptionUniqKeyValue: x,
358
+ storedItemsMap: f,
359
+ ...d
359
360
  });
360
- return /* @__PURE__ */ s(
361
- de,
361
+ return /* @__PURE__ */ r(
362
+ pe,
362
363
  {
363
- ...v,
364
- stateReducer: (i, a) => {
364
+ ...y,
365
+ stateReducer: (d, a) => {
365
366
  switch (a.type) {
366
- case de.stateChangeTypes.keyDownEnter:
367
- case de.stateChangeTypes.clickItem:
367
+ case pe.stateChangeTypes.keyDownEnter:
368
+ case pe.stateChangeTypes.clickItem:
368
369
  return {
369
370
  ...a,
370
- highlightedIndex: i.highlightedIndex,
371
+ highlightedIndex: d.highlightedIndex,
371
372
  inputValue: ""
372
373
  };
373
374
  default:
374
375
  return a;
375
376
  }
376
377
  },
377
- onChange: b,
378
+ onChange: w,
378
379
  selectedItem: null,
379
- children: (i) => d == null ? void 0 : d(B(i))
380
+ children: (d) => i == null ? void 0 : i(D(d))
380
381
  }
381
382
  );
382
- }, ze = "Enter", vt = "Tab", wt = "_autocomplete_1so4a_16", gt = "_disabled_1so4a_32", yt = "_error_1so4a_35", xt = "_touched_1so4a_35", Nt = "_input_1so4a_77", kt = {
383
- autocomplete: wt,
383
+ }, Be = "Enter", Nt = "Tab", It = "_autocomplete_1so4a_16", kt = "_disabled_1so4a_32", Et = "_error_1so4a_35", St = "_touched_1so4a_35", zt = "_input_1so4a_77", Ct = {
384
+ autocomplete: It,
384
385
  "autocomplete-wrapper": "_autocomplete-wrapper_1so4a_28",
385
- disabled: gt,
386
- error: yt,
387
- touched: xt,
386
+ disabled: kt,
387
+ error: Et,
388
+ touched: St,
388
389
  "clear-icon": "_clear-icon_1so4a_46",
389
390
  "clear-icon--disabled": "_clear-icon--disabled_1so4a_56",
390
391
  "autocomplete-input": "_autocomplete-input_1so4a_60",
391
392
  "single-line-mode": "_single-line-mode_1so4a_68",
392
393
  "mobile-disabled": "_mobile-disabled_1so4a_72",
393
- input: Nt,
394
+ input: zt,
394
395
  "type-number": "_type-number_1so4a_101",
395
396
  "error-text": "_error-text_1so4a_112",
396
397
  "dropdown-button": "_dropdown-button_1so4a_121",
397
398
  "icon-reversed": "_icon-reversed_1so4a_129"
398
- }, Y = X.bind(kt), Gt = (t) => {
399
+ }, J = Z.bind(Ct), oo = (t) => {
399
400
  const {
400
401
  options: e = [],
401
- loading: c = !1,
402
- onStateChange: r = () => {
402
+ loading: n = !1,
403
+ onStateChange: s = () => {
403
404
  },
404
405
  value: o = [],
405
- placeholder: d = "",
406
+ placeholder: i = "",
406
407
  error: h = "",
407
- touched: p = !1,
408
- creatable: g = !1,
409
- editable: v = !1,
410
- onChange: m = () => {
408
+ touched: u = !1,
409
+ creatable: x = !1,
410
+ editable: y = !1,
411
+ onChange: f = () => {
411
412
  },
412
- onFocus: C = () => {
413
+ onFocus: z = () => {
413
414
  },
414
415
  onBlur: k = () => {
415
416
  },
416
- disabled: u = !1,
417
+ disabled: m = !1,
417
418
  isDropdownMode: R = !1,
418
- mobileDisabled: M = !1,
419
- inputProps: w = {},
420
- parseValueToString: b = (_) => _ == null ? "" : String(_),
421
- maxLength: B = null,
422
- async: S = !1,
423
- customClass: i = "",
419
+ mobileDisabled: A = !1,
420
+ inputProps: g = {},
421
+ parseValueToString: w = (_) => _ == null ? "" : String(_),
422
+ maxLength: D = null,
423
+ async: C = !1,
424
+ customClass: d = "",
424
425
  createWithoutConfirmation: a = !1,
425
- getItemValidationErrorType: n = null,
426
- clearItemsError: f = () => {
426
+ getItemValidationErrorType: l = null,
427
+ clearItemsError: p = () => {
427
428
  },
428
- getAdditionalCreationCondition: l = () => !0,
429
- highlightUnStoredItem: y = !1,
430
- parseInputValueFn: D = null,
431
- handleUnStoredItemCb: W = null,
432
- dataAutomationId: L = "",
433
- existingItemsMap: te = {},
434
- customizeNewSelectedValue: G = (_) => _,
435
- renderCustomSelectedItem: F,
429
+ getAdditionalCreationCondition: c = () => !0,
430
+ highlightUnStoredItem: v = !1,
431
+ parseInputValueFn: F = null,
432
+ handleUnStoredItemCb: $ = null,
433
+ dataAutomationId: j = "",
434
+ existingItemsMap: ee = {},
435
+ customizeNewSelectedValue: O = (_) => _,
436
+ renderCustomSelectedItem: B,
436
437
  useFixedPositioning: H,
437
- newItemButtonText: fe = "",
438
- menuClassName: E = "",
439
- selectedItemSingleLine: O,
440
- selectedItemClassName: J,
441
- selectedItemTextClassName: T,
442
- ...Q
443
- } = t, { refs: $, floatingStyles: se } = Ie({
438
+ newItemButtonText: we = "",
439
+ menuClassName: re = "",
440
+ selectedItemSingleLine: le,
441
+ selectedItemClassName: ve,
442
+ selectedItemTextClassName: te,
443
+ ...be
444
+ } = t, { refs: ce, floatingStyles: ye } = Re({
444
445
  placement: "bottom-start",
445
446
  strategy: H ? "fixed" : "absolute",
446
- whileElementsMounted: Ce
447
- }), pe = o.length === 0 && !u ? d : "", oe = Ne(null);
447
+ whileElementsMounted: Ae
448
+ }), ge = o.length === 0 && !m ? i : "", b = Me(null);
448
449
  ke(() => {
449
- f();
450
- }, [f, o]);
451
- const Z = (_, I) => {
452
- m(_, I);
453
- }, ne = (_, I, z) => ({ item: x, index: N, ...A }) => _({
454
- item: x,
455
- index: N,
456
- isSelected: z.some((K) => ue(K, x)),
457
- ...A,
458
- isActive: I === N
459
- }), _e = ({
450
+ p();
451
+ }, [p, o]);
452
+ const T = (_, I) => {
453
+ f(_, I);
454
+ }, q = (_, I, E) => ({ item: N, index: G, ...W }) => _({
455
+ item: N,
456
+ index: G,
457
+ isSelected: E.some((Y) => _e(Y, N)),
458
+ ...W,
459
+ isActive: I === G
460
+ }), K = ({
460
461
  event: _,
461
462
  removeItem: I,
462
- inputValue: z
463
+ inputValue: E
463
464
  }) => {
464
- _.key === "Backspace" && !z && o.length && I(o[o.length - 1], null);
465
- }, re = ({
465
+ _.key === "Backspace" && !E && o.length && I(o[o.length - 1], null);
466
+ }, X = ({
466
467
  inputValue: _,
467
468
  selectItem: I,
468
- clearSelection: z
469
+ clearSelection: E
469
470
  }) => {
470
- if (D) {
471
- const x = D(_);
472
- (x.length ? x : [_]).forEach((A) => I(A)), z();
471
+ if (F) {
472
+ const N = F(_);
473
+ (N.length ? N : [_]).forEach((W) => I(W)), E();
473
474
  } else
474
- I(_), z();
475
- }, q = (_) => (I) => {
476
- _(I, null), oe.current && oe.current.focus();
477
- }, he = e.filter((_) => o.every((I) => !ue(I, _)));
478
- return /* @__PURE__ */ s(
479
- bt,
475
+ I(_), E();
476
+ }, L = (_) => (I) => {
477
+ _(I, null), b.current && b.current.focus();
478
+ }, oe = e.filter((_) => o.every((I) => !_e(I, _)));
479
+ return /* @__PURE__ */ r(
480
+ xt,
480
481
  {
481
- onChange: Z,
482
- itemToString: b,
482
+ onChange: T,
483
+ itemToString: w,
483
484
  selectedItems: o,
484
- onStateChange: r,
485
+ onStateChange: s,
485
486
  options: e,
486
- existingItemsMap: te,
487
- handleUnStoredItemCb: W,
488
- customizeNewSelectedValue: G,
487
+ existingItemsMap: ee,
488
+ handleUnStoredItemCb: $,
489
+ customizeNewSelectedValue: O,
489
490
  children: ({
490
491
  getInputProps: _,
491
492
  getItemProps: I,
492
- isOpen: z,
493
- inputValue: x = "",
494
- highlightedIndex: N,
495
- removeItem: A,
496
- editItem: K,
497
- openMenu: le,
498
- selectItem: U,
499
- clearSelection: ve,
500
- toggleMenu: Re,
501
- storedItemsMap: Me,
502
- getRootProps: Be
493
+ isOpen: E,
494
+ inputValue: N = "",
495
+ highlightedIndex: G,
496
+ removeItem: W,
497
+ editItem: Y,
498
+ openMenu: xe,
499
+ selectItem: ie,
500
+ clearSelection: Ne,
501
+ toggleMenu: ae,
502
+ storedItemsMap: Ie,
503
+ getRootProps: de
503
504
  }) => {
504
- const we = Be(void 0, { suppressRefError: !0 }), De = {
505
- ...we,
506
- ref: (P) => ($.setReference(P), we.ref(P))
507
- }, Fe = x ?? "";
508
- return /* @__PURE__ */ j("div", { ...De, className: Y("autocomplete-wrapper"), children: [
509
- /* @__PURE__ */ j(me, { children: [
510
- /* @__PURE__ */ j(
505
+ const M = de(void 0, { suppressRefError: !0 }), U = {
506
+ ...M,
507
+ ref: (S) => (ce.setReference(S), M.ref(S))
508
+ }, se = N ?? "";
509
+ return /* @__PURE__ */ P("div", { ...U, className: J("autocomplete-wrapper"), children: [
510
+ /* @__PURE__ */ P(he, { children: [
511
+ /* @__PURE__ */ P(
511
512
  "div",
512
513
  {
513
- className: Y("autocomplete", i, {
514
- "mobile-disabled": M,
514
+ className: J("autocomplete", d, {
515
+ "mobile-disabled": A,
515
516
  error: h,
516
- touched: p,
517
- disabled: u
517
+ touched: u,
518
+ disabled: m
518
519
  }),
519
520
  children: [
520
- /* @__PURE__ */ j(
521
+ /* @__PURE__ */ P(
521
522
  "div",
522
523
  {
523
- className: Y("autocomplete-input", {
524
- "mobile-disabled": M,
525
- "single-line-mode": O
524
+ className: J("autocomplete-input", {
525
+ "mobile-disabled": A,
526
+ "single-line-mode": le
526
527
  }),
527
528
  children: [
528
- /* @__PURE__ */ s(
529
- Qe,
529
+ /* @__PURE__ */ r(
530
+ et,
530
531
  {
531
532
  items: o,
532
- onRemoveItem: q(A),
533
- disabled: u,
534
- mobileDisabled: M,
535
- parseValueToString: b,
536
- getItemValidationErrorType: n,
537
- renderCustomSelectedItem: F,
538
- editItem: K,
539
- editable: v,
540
- getAdditionalCreationCondition: l,
541
- storedItemsMap: Me,
542
- highlightUnStoredItem: y,
543
- selectedItemSingleLine: O,
544
- selectedItemClassName: J,
545
- selectedItemTextClassName: T
533
+ onRemoveItem: L(W),
534
+ disabled: m,
535
+ mobileDisabled: A,
536
+ parseValueToString: w,
537
+ getItemValidationErrorType: l,
538
+ renderCustomSelectedItem: B,
539
+ editItem: Y,
540
+ editable: y,
541
+ getAdditionalCreationCondition: c,
542
+ storedItemsMap: Ie,
543
+ highlightUnStoredItem: v,
544
+ selectedItemSingleLine: le,
545
+ selectedItemClassName: ve,
546
+ selectedItemTextClassName: te
546
547
  }
547
548
  ),
548
- /* @__PURE__ */ s(
549
+ /* @__PURE__ */ r(
549
550
  "input",
550
551
  {
551
552
  ..._({
552
- ref: oe,
553
- placeholder: pe,
554
- maxLength: B,
553
+ ref: b,
554
+ placeholder: ge,
555
+ maxLength: D,
555
556
  onFocus: () => {
556
- R && le(), C();
557
+ R && xe(), z();
557
558
  },
558
- onKeyDown: (P) => {
559
- P.key === ze && x && g && l(x) && re({
560
- inputValue: x,
561
- selectItem: U,
562
- clearSelection: ve
563
- }), _e({ event: P, removeItem: A, inputValue: x });
559
+ onKeyDown: (S) => {
560
+ S.key === Be && N && x && c(N) && X({
561
+ inputValue: N,
562
+ selectItem: ie,
563
+ clearSelection: Ne
564
+ }), K({ event: S, removeItem: W, inputValue: N });
564
565
  },
565
566
  onBlur: () => {
566
- k(), x && g && l(x) && re({
567
- inputValue: x,
568
- selectItem: U,
569
- clearSelection: ve
567
+ k(), N && x && c(N) && X({
568
+ inputValue: N,
569
+ selectItem: ie,
570
+ clearSelection: Ne
570
571
  });
571
572
  },
572
- disabled: u,
573
- ...w
573
+ disabled: m,
574
+ ...g
574
575
  }),
575
- className: Y("input", { disabled: u }, w.className),
576
- "data-automation-id": L
576
+ className: J("input", { disabled: m }, g.className),
577
+ "data-automation-id": j
577
578
  }
578
579
  )
579
580
  ]
580
581
  }
581
582
  ),
582
- (w == null ? void 0 : w.clearable) && !be(o) && /* @__PURE__ */ s(
583
+ (g == null ? void 0 : g.clearable) && !Ee(o) && /* @__PURE__ */ r(
583
584
  "button",
584
585
  {
585
586
  type: "button",
586
- className: Y("clear-icon", { "clear-icon--disabled": u }),
587
+ className: J("clear-icon", { "clear-icon--disabled": m }),
587
588
  onClick: () => {
588
- var P;
589
- return !u && ((P = w == null ? void 0 : w.onClear) == null ? void 0 : P.call(w));
589
+ var S;
590
+ return !m && ((S = g == null ? void 0 : g.onClear) == null ? void 0 : S.call(g));
590
591
  },
591
- onMouseDown: (P) => P.preventDefault(),
592
- children: /* @__PURE__ */ s(Te, {})
592
+ onMouseDown: (S) => S.preventDefault(),
593
+ children: /* @__PURE__ */ r(Je, {})
593
594
  }
594
595
  ),
595
- R && /* @__PURE__ */ s(
596
+ R && /* @__PURE__ */ r(
596
597
  "button",
597
598
  {
598
599
  type: "button",
599
- className: Y("dropdown-button", { "icon-reversed": z }),
600
- onClick: () => Re(),
600
+ className: J("dropdown-button", { "icon-reversed": E }),
601
+ onClick: () => ae(),
601
602
  "aria-label": "Toggle dropdown",
602
- "aria-expanded": z,
603
- children: /* @__PURE__ */ s(Se, {})
603
+ "aria-expanded": E,
604
+ children: /* @__PURE__ */ r(De, {})
604
605
  }
605
606
  )
606
607
  ]
607
608
  }
608
609
  ),
609
- h && p && /* @__PURE__ */ s("span", { className: Y("error-text"), children: h })
610
+ h && u && /* @__PURE__ */ r("span", { className: J("error-text"), children: h })
610
611
  ] }),
611
- /* @__PURE__ */ s(
612
- Ee,
612
+ /* @__PURE__ */ r(
613
+ Fe,
613
614
  {
614
- isOpen: z,
615
- loading: c,
616
- async: S,
617
- ref: $.setFloating,
618
- newItemButtonText: fe,
615
+ isOpen: E,
616
+ loading: n,
617
+ async: C,
618
+ ref: ce.setFloating,
619
+ newItemButtonText: we,
619
620
  isDropdownMode: R,
620
- style: se,
621
- inputValue: Fe.trim(),
622
- getItemProps: ne(I, N, o),
623
- parseValueToString: b,
621
+ style: ye,
622
+ inputValue: se.trim(),
623
+ getItemProps: q(I, G, o),
624
+ parseValueToString: w,
624
625
  createWithoutConfirmation: a,
625
- options: he,
626
- className: E,
627
- ...Q
626
+ options: oe,
627
+ className: re,
628
+ ...be
628
629
  }
629
630
  )
630
631
  ] });
631
632
  }
632
633
  }
633
634
  );
634
- }, It = {
635
+ }, Mt = ({ skip: t }) => {
636
+ $e(() => {
637
+ if (t)
638
+ return;
639
+ let e = window.scrollY, n = !0;
640
+ const s = 300, o = () => {
641
+ if (!n)
642
+ return;
643
+ window.scrollY !== e && window.scrollTo(0, e);
644
+ }, i = (u) => {
645
+ n && (u.preventDefault(), u.stopImmediatePropagation(), o());
646
+ };
647
+ e = window.scrollY, window.addEventListener("scroll", i, { passive: !1, capture: !0 }), requestAnimationFrame(() => {
648
+ e = window.scrollY, o();
649
+ });
650
+ const h = setTimeout(() => {
651
+ n = !1;
652
+ }, s);
653
+ return () => {
654
+ clearTimeout(h), window.removeEventListener("scroll", i, { capture: !0 });
655
+ };
656
+ }, [t]);
657
+ }, Rt = ({ skip: t, reference: e }) => {
658
+ ke(() => {
659
+ if (t)
660
+ return;
661
+ const n = () => {
662
+ const s = e.current;
663
+ s instanceof HTMLElement && s.blur();
664
+ };
665
+ return window.addEventListener("resize", n), () => {
666
+ window.removeEventListener("resize", n);
667
+ };
668
+ }, [t, e]);
669
+ }, At = {
635
670
  "input-wrapper": "_input-wrapper_d9vma_1",
636
671
  "dropdown-button": "_dropdown-button_d9vma_6",
637
672
  "icon-reversed": "_icon-reversed_d9vma_14"
638
- }, xe = X.bind(It), Ct = 0, Jt = (t) => {
673
+ }, Ce = Z.bind(At), Dt = 0, Ft = Ye({
674
+ fallbackPlacements: ["bottom-start", "top-start", "bottom", "top"],
675
+ boundary: document == null ? void 0 : document.documentElement,
676
+ rootBoundary: "viewport"
677
+ }), Bt = Ke({
678
+ apply({ rects: t, elements: e }) {
679
+ Object.assign(e.floating.style, {
680
+ width: `${t.reference.width}px`
681
+ });
682
+ }
683
+ }), so = (t) => {
639
684
  const {
640
685
  options: e = [],
641
- value: c,
642
- placeholder: r = "",
686
+ value: n,
687
+ placeholder: s = "",
643
688
  onChange: o = () => {
644
689
  },
645
- onFocus: d = () => {
690
+ onFocus: i = () => {
646
691
  },
647
692
  onBlur: h = () => {
648
693
  },
649
- disabled: p = !1,
650
- inputProps: g = {},
651
- parseValueToString: v = (E) => E === null ? "" : String(E),
652
- minLength: m = 1,
653
- skipOptionCreation: C = !1,
694
+ disabled: u = !1,
695
+ inputProps: x = {},
696
+ parseValueToString: y = (b) => b === null ? "" : String(b),
697
+ minLength: f = 1,
698
+ skipOptionCreation: z = !1,
654
699
  maxLength: k = null,
655
- optionVariant: u = "",
700
+ optionVariant: m = "",
656
701
  isRequired: R = !1,
657
- error: M = "",
658
- touched: w = !1,
659
- setTouch: b = () => {
702
+ error: A = "",
703
+ touched: g = !1,
704
+ setTouch: w = () => {
660
705
  },
661
- createWithoutConfirmation: B = !1,
662
- menuClassName: S = "",
663
- icon: i,
706
+ createWithoutConfirmation: D = !1,
707
+ menuClassName: C = "",
708
+ icon: d,
664
709
  isDropdownMode: a = !1,
665
- isOptionUnique: n,
666
- refFunction: f,
667
- stateReducer: l,
668
- onStateChange: y,
669
- useFixedPositioning: D,
670
- dropdownMatchInputWidth: W = !1,
671
- newItemButtonText: L = "",
672
- ...te
673
- } = t, { refs: G, floatingStyles: F } = Ie({
710
+ isOptionUnique: l,
711
+ refFunction: p,
712
+ stateReducer: c,
713
+ onStateChange: v,
714
+ useFixedPositioning: F,
715
+ dropdownMatchInputWidth: $ = !1,
716
+ withMenuFlip: j = !1,
717
+ newItemButtonText: ee = "",
718
+ menuPortalRoot: O,
719
+ ...B
720
+ } = t, [H, we] = ne(!1), re = !H || !O, le = O || F ? "fixed" : "absolute", ve = Le(
721
+ () => [
722
+ ...j ? [Ft] : [],
723
+ ...$ ? [Bt] : []
724
+ ],
725
+ [j, $]
726
+ ), { refs: te, floatingStyles: be } = Re({
674
727
  placement: "bottom-start",
675
- strategy: D ? "fixed" : "absolute",
676
- whileElementsMounted: Ce,
677
- middleware: W ? [
678
- We({
679
- apply({ rects: E, elements: O }) {
680
- Object.assign(O.floating.style, {
681
- width: `${E.reference.width}px`
682
- });
683
- }
684
- })
685
- ] : []
686
- }), H = (E, O, J) => ({ item: T, index: Q, ...$ }) => E({
687
- item: T,
688
- index: Q,
689
- isSelected: J !== null && J === T,
690
- ...$,
691
- isActive: O === Q
692
- }), fe = (E, O) => {
693
- E.key === vt && (E.preventDefault(), O(e.length));
694
- };
695
- return /* @__PURE__ */ s(
696
- de,
728
+ whileElementsMounted: Ae,
729
+ strategy: le,
730
+ middleware: ve
731
+ });
732
+ Mt({ skip: re }), Rt({ skip: re, reference: te.reference });
733
+ const ce = (b, T, q) => ({ item: K, index: X, ...L }) => b({
734
+ item: K,
735
+ index: X,
736
+ isSelected: q !== null && q === K,
737
+ ...L,
738
+ isActive: T === X
739
+ }), ye = (b, T) => {
740
+ b.key === Nt && (b.preventDefault(), T(e.length));
741
+ }, ge = Q(
742
+ (b, ...T) => {
743
+ (b == null ? void 0 : b.isOpen) !== void 0 && we(b.isOpen), v == null || v(b, ...T);
744
+ },
745
+ [v]
746
+ );
747
+ return /* @__PURE__ */ r(
748
+ pe,
697
749
  {
698
750
  onChange: o,
699
- itemToString: v,
700
- selectedItem: c,
701
- onStateChange: y,
702
- defaultHighlightedIndex: Ct,
703
- stateReducer: l,
751
+ itemToString: y,
752
+ selectedItem: n,
753
+ onStateChange: ge,
754
+ defaultHighlightedIndex: Dt,
755
+ stateReducer: c,
704
756
  children: ({
705
- getInputProps: E,
706
- getItemProps: O,
707
- setHighlightedIndex: J,
708
- toggleMenu: T,
709
- openMenu: Q,
710
- isOpen: $,
711
- inputValue: se,
712
- highlightedIndex: pe,
713
- getRootProps: oe,
714
- selectItem: Z
757
+ getInputProps: b,
758
+ getItemProps: T,
759
+ setHighlightedIndex: q,
760
+ toggleMenu: K,
761
+ openMenu: X,
762
+ isOpen: L,
763
+ inputValue: oe,
764
+ highlightedIndex: _,
765
+ getRootProps: I,
766
+ selectItem: E
715
767
  }) => {
716
- const ne = oe(void 0, { suppressRefError: !0 }), _e = {
717
- ...ne,
718
- ref: (N) => (G.setReference(N), ne.ref(N))
719
- }, re = se ?? "", { onClear: q, clearable: he, ..._ } = g, z = he && c !== null, x = (...N) => {
720
- Z(null), q == null || q(...N);
721
- };
722
- return /* @__PURE__ */ s(me, { children: /* @__PURE__ */ j("div", { className: xe("input-wrapper"), ..._e, children: [
723
- /* @__PURE__ */ s(
724
- He,
725
- {
726
- ...E({
727
- placeholder: p ? "" : r,
728
- maxLength: k || void 0,
729
- onFocus: () => {
730
- a && !$ && (Q(), b == null || b(!0)), d();
731
- },
732
- ref: f,
733
- onKeyDown: (N) => {
734
- N.key === ze && N.preventDefault(), se && $ && fe(N, J);
735
- },
736
- onBlur: (N) => {
737
- const A = re.trim(), K = !be(A), le = K ? e.find((U) => v(U) === A) : void 0;
738
- Z(le || (!C && B && K ? A : null)), h(N), n == null || n(
739
- K ? !e.some((U) => v(U) === A) : null
740
- ), a && $ && T(), b == null || b(!0);
741
- },
742
- disabled: p,
743
- defaultWidth: !1,
744
- isRequired: R,
745
- touched: w,
746
- error: M,
747
- ..._,
748
- clearable: z,
749
- onClear: z ? x : q,
750
- endIcon: a && !i ? /* @__PURE__ */ s(
751
- "button",
752
- {
753
- type: "button",
754
- className: xe("dropdown-button", { "icon-reversed": $ }),
755
- onClick: () => T(),
756
- "aria-label": "Toggle dropdown",
757
- "aria-expanded": $,
758
- children: /* @__PURE__ */ s(Se, {})
759
- }
760
- ) : i,
761
- minLength: a ? 0 : m
762
- })
763
- }
764
- ),
765
- /* @__PURE__ */ s(
766
- Ee,
767
- {
768
- isOpen: $,
769
- isDropdownMode: a,
770
- style: F,
771
- ref: G.setFloating,
772
- minLength: m,
773
- inputValue: (se || "").trim(),
774
- getItemProps: H(O, pe, c),
775
- parseValueToString: v,
776
- optionVariant: u,
777
- createWithoutConfirmation: B,
778
- className: S,
779
- options: e,
780
- newItemButtonText: L,
781
- ...te
782
- }
783
- )
784
- ] }) });
768
+ const N = I(void 0, { suppressRefError: !0 }), G = {
769
+ ...N,
770
+ ref: (M) => (te.setReference(M), N.ref(M))
771
+ }, W = oe ?? "", { onClear: Y, clearable: xe, ...ie } = x, ae = xe && n !== null, Ie = (...M) => {
772
+ E(null), Y == null || Y(...M);
773
+ }, de = /* @__PURE__ */ r(
774
+ Fe,
775
+ {
776
+ isOpen: L,
777
+ isDropdownMode: a,
778
+ style: be,
779
+ ref: te.setFloating,
780
+ minLength: f,
781
+ inputValue: (oe || "").trim(),
782
+ getItemProps: ce(T, _, n),
783
+ parseValueToString: y,
784
+ optionVariant: m,
785
+ createWithoutConfirmation: D,
786
+ className: C,
787
+ options: e,
788
+ newItemButtonText: ee,
789
+ ...B
790
+ }
791
+ );
792
+ return /* @__PURE__ */ P(he, { children: [
793
+ /* @__PURE__ */ P("div", { className: Ce("input-wrapper"), ...G, children: [
794
+ /* @__PURE__ */ r(
795
+ Xe,
796
+ {
797
+ ...b({
798
+ placeholder: u ? "" : s,
799
+ maxLength: k || void 0,
800
+ onFocus: () => {
801
+ a && !L && (X(), w == null || w(!0)), i();
802
+ },
803
+ ref: p,
804
+ onKeyDown: (M) => {
805
+ M.key === Be && M.preventDefault(), oe && L && ye(M, q);
806
+ },
807
+ onBlur: (M) => {
808
+ const U = W.trim(), se = !Ee(U), S = se ? e.find((ue) => y(ue) === U) : void 0;
809
+ E(S || (!z && D && se ? U : null)), h(M), l == null || l(
810
+ se ? !e.some((ue) => y(ue) === U) : null
811
+ ), a && L && K(), w == null || w(!0);
812
+ },
813
+ disabled: u,
814
+ defaultWidth: !1,
815
+ isRequired: R,
816
+ touched: g,
817
+ error: A,
818
+ ...ie,
819
+ clearable: ae,
820
+ onClear: ae ? Ie : Y,
821
+ endIcon: a && !d ? /* @__PURE__ */ r(
822
+ "button",
823
+ {
824
+ type: "button",
825
+ className: Ce("dropdown-button", { "icon-reversed": L }),
826
+ onClick: () => K(),
827
+ "aria-label": "Toggle dropdown",
828
+ "aria-expanded": L,
829
+ children: /* @__PURE__ */ r(De, {})
830
+ }
831
+ ) : d,
832
+ minLength: a ? 0 : f
833
+ })
834
+ }
835
+ ),
836
+ !O && de
837
+ ] }),
838
+ O && We(de, O)
839
+ ] });
785
840
  }
786
841
  }
787
842
  );
788
843
  };
789
844
  export {
790
- Ee as AutocompleteMenu,
791
- ge as AutocompleteOption,
792
- it as AutocompleteOptions,
793
- Ve as AutocompletePrompt,
794
- Gt as MultipleAutocomplete,
795
- Jt as SingleAutocomplete
845
+ Fe as AutocompleteMenu,
846
+ Se as AutocompleteOption,
847
+ pt as AutocompleteOptions,
848
+ nt as AutocompletePrompt,
849
+ oo as MultipleAutocomplete,
850
+ so as SingleAutocomplete
796
851
  };