@wrdagency/blockout 0.1.3 → 0.1.4

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,42 +1,43 @@
1
- import { jsx as w, jsxs as te, Fragment as Ue } from "react/jsx-runtime";
2
- import { normalizeOption as Ft } from "../../../types/options.js";
3
- import { cn as Bt } from "../../../utils/css.js";
4
- import { noop as jt } from "../../../utils/noop.js";
5
- import { e as Wt } from "../../../CaretDown.es-eySGHzTJ.js";
6
- import * as M from "react";
7
- import { useMemo as Ce, useState as de, useRef as se, useEffect as ae, useCallback as Qe, useContext as we, createContext as _e, startTransition as Zt } from "react";
8
- import { w as $t } from "../../../SSRBase.es-BUXS72ra.js";
9
- import { g as qt } from "../../../_commonjsHelpers-C6fGbg64.js";
10
- import { BaseControl as Yt } from "../base-control/index.js";
11
- import { useBaseControlProps as zt } from "../base-control/props.js";
12
- import { C as Qt, a as Xt } from "../../../P7GR5CS5-BoOYUfSQ.js";
13
- import { a as ne, _ as oe, i as me, m as R, o as A, v as Xe, f as re, q as le, $ as Ge, Y as ie, X as D, U as Z, Z as ke, j as T, e as Q, H as Je, l as he, n as ye, ab as et, r as tt, s as Ae, t as Gt, P as nt, Q as ot, R as Jt, h as en, u as tn, ac as rt, c as nn, a0 as on, A as rn, ad as ln, ae as sn, af as an, x as Fe, ag as Ie, a6 as un, B as cn, b as Ve, a9 as dn, W as mn, K as fn, k as vn } from "../../../LMDWO4NN--KEvZePp.js";
14
- import { c as lt, b as st, f as pn, e as bn, d as hn, g as Sn } from "../../../WMYDSCNQ-Dy1O-Kdl.js";
15
- import { c as at, d as it, b as ut } from "../../../4CMBR7SL-BAGv8IL2.js";
16
- import { m as ct, o as gn, t as dt, c as mt, s as X, b as G, g as ft, e as vt, f as be, u as pt, a as Cn, p as En } from "../../../YV4JVR4I-kvospPUa.js";
17
- import { a as bt, C as On, b as ht, c as yn, d as An, e as St, u as xn, f as In } from "../../../S43UC3DV-Dn8EFLaT.js";
18
- import { t as gt } from "../../../7PRQYBBV-91wrWGjk.js";
19
- import { u as Me, a as De, S as Ct, b as wn, c as Vn, d as Pn, e as Be } from "../../../DG5U6ZEL-CVj-Czp2.js";
20
- import { u as _n } from "../../../MTZPJQMC-DyCWBG18.js";
21
- import { u as Et } from "../../../T7VMP3TM-DeRMoW8g.js";
22
- import { i as Ot } from "../../../WYCIER3C-DRn904Gy.js";
23
- import { u as yt } from "../../../5JTVDSTH-CG1NL6Fw.js";
24
- import { h as Pe } from "../../../PFRGBC2K-BEg8ahbY.js";
25
- import { u as At } from "../../../UQQRIHDV-Bu8e1bYU.js";
26
- import { u as xt } from "../../../6VRAQV3D-2rb_aClP.js";
27
- var kn = "span", Mn = {
1
+ import { jsx as w, jsxs as X, Fragment as we } from "react/jsx-runtime";
2
+ import { normalizeOption as Bt } from "../../../types/options.js";
3
+ import { cn as jt } from "../../../utils/css.js";
4
+ import { noop as Wt } from "../../../utils/noop.js";
5
+ import { e as Zt } from "../../../CaretDown.es-eySGHzTJ.js";
6
+ import * as N from "react";
7
+ import { useMemo as Ce, useState as de, useRef as se, useEffect as ae, useCallback as Xe, useContext as Pe, createContext as ke, startTransition as $t } from "react";
8
+ import { w as qt } from "../../../SSRBase.es-BUXS72ra.js";
9
+ import { g as Yt } from "../../../_commonjsHelpers-C6fGbg64.js";
10
+ import { BaseControl as zt } from "../base-control/index.js";
11
+ import { Affix as Fe } from "../base-control/affix.js";
12
+ import { useBaseControlProps as Qt } from "../base-control/props.js";
13
+ import { C as Xt, a as Gt } from "../../../P7GR5CS5-BoOYUfSQ.js";
14
+ import { a as ne, _ as oe, i as me, m as H, o as A, v as Ge, f as re, q as le, $ as Je, Y as ie, X as D, U as $, Z as Me, j as R, e as Q, H as et, l as he, n as ye, ab as tt, r as nt, s as Ae, t as Jt, P as ot, Q as rt, R as en, h as tn, u as nn, ac as lt, c as on, a0 as rn, A as ln, ad as sn, ae as an, af as un, x as Be, ag as Ie, a6 as cn, B as dn, b as Ve, a9 as mn, W as fn, K as vn, k as pn } from "../../../LMDWO4NN--KEvZePp.js";
15
+ import { c as st, b as at, f as bn, e as hn, d as Sn, g as gn } from "../../../WMYDSCNQ-Dy1O-Kdl.js";
16
+ import { c as it, d as ut, b as ct } from "../../../4CMBR7SL-BAGv8IL2.js";
17
+ import { m as dt, o as Cn, t as mt, c as ft, s as G, b as J, g as vt, e as pt, f as be, u as bt, a as En, p as On } from "../../../YV4JVR4I-kvospPUa.js";
18
+ import { a as ht, C as yn, b as St, c as An, d as xn, e as gt, u as In, f as wn } from "../../../S43UC3DV-Dn8EFLaT.js";
19
+ import { t as Ct } from "../../../7PRQYBBV-91wrWGjk.js";
20
+ import { u as Ne, a as De, S as Et, b as Pn, c as Vn, d as _n, e as je } from "../../../DG5U6ZEL-CVj-Czp2.js";
21
+ import { u as kn } from "../../../MTZPJQMC-DyCWBG18.js";
22
+ import { u as Ot } from "../../../T7VMP3TM-DeRMoW8g.js";
23
+ import { i as yt } from "../../../WYCIER3C-DRn904Gy.js";
24
+ import { u as At } from "../../../5JTVDSTH-CG1NL6Fw.js";
25
+ import { h as _e } from "../../../PFRGBC2K-BEg8ahbY.js";
26
+ import { u as xt } from "../../../UQQRIHDV-Bu8e1bYU.js";
27
+ import { u as It } from "../../../6VRAQV3D-2rb_aClP.js";
28
+ var Mn = "span", Nn = {
28
29
  top: "4,10 8,6 12,10",
29
30
  right: "6,4 10,8 6,12",
30
31
  bottom: "4,6 8,10 12,6",
31
32
  left: "10,4 6,8 10,12"
32
- }, It = ne(function(n) {
33
+ }, wt = ne(function(n) {
33
34
  var o = n, { store: e, placement: r } = o, l = oe(o, ["store", "placement"]);
34
- const a = _n();
35
+ const a = kn();
35
36
  e = e || a, me(
36
37
  e,
37
38
  process.env.NODE_ENV !== "production" && "PopoverDisclosureArrow must be wrapped in a PopoverDisclosure component."
38
39
  );
39
- const f = e.useState((s) => r || s.placement).split("-")[0], c = Mn[f], i = Ce(
40
+ const v = e.useState((s) => r || s.placement).split("-")[0], c = Nn[v], i = Ce(
40
41
  () => /* @__PURE__ */ w(
41
42
  "svg",
42
43
  {
@@ -54,7 +55,7 @@ var kn = "span", Mn = {
54
55
  ),
55
56
  [c]
56
57
  );
57
- return l = R(A({
58
+ return l = H(A({
58
59
  children: i,
59
60
  "aria-hidden": !0
60
61
  }, l), {
@@ -63,23 +64,23 @@ var kn = "span", Mn = {
63
64
  height: "1em",
64
65
  pointerEvents: "none"
65
66
  }, l.style)
66
- }), Xe(l);
67
+ }), Ge(l);
67
68
  });
68
69
  re(
69
70
  function(n) {
70
- const o = It(n);
71
- return le(kn, o);
71
+ const o = wt(n);
72
+ return le(Mn, o);
72
73
  }
73
74
  );
74
75
  function Dn(t = {}) {
75
76
  var n = t, {
76
77
  combobox: o
77
- } = n, e = Ge(n, [
78
+ } = n, e = Je(n, [
78
79
  "combobox"
79
80
  ]);
80
- const r = ct(
81
+ const r = dt(
81
82
  e.store,
82
- gn(o, [
83
+ Cn(o, [
83
84
  "value",
84
85
  "items",
85
86
  "renderedItems",
@@ -91,8 +92,8 @@ function Dn(t = {}) {
91
92
  "disclosureElement"
92
93
  ])
93
94
  );
94
- dt(e, r);
95
- const l = r.getState(), a = at(ie(Z({}, e), {
95
+ mt(e, r);
96
+ const l = r.getState(), a = it(ie($({}, e), {
96
97
  store: r,
97
98
  virtualFocus: D(
98
99
  e.virtualFocus,
@@ -115,19 +116,19 @@ function Dn(t = {}) {
115
116
  l.orientation,
116
117
  "vertical"
117
118
  )
118
- })), m = lt(ie(Z({}, e), {
119
+ })), m = st(ie($({}, e), {
119
120
  store: r,
120
121
  placement: D(
121
122
  e.placement,
122
123
  l.placement,
123
124
  "bottom-start"
124
125
  )
125
- })), f = new String(""), c = ie(Z(Z({}, a.getState()), m.getState()), {
126
+ })), v = new String(""), c = ie($($({}, a.getState()), m.getState()), {
126
127
  value: D(
127
128
  e.value,
128
129
  l.value,
129
130
  e.defaultValue,
130
- f
131
+ v
131
132
  ),
132
133
  setValueOnMove: D(
133
134
  e.setValueOnMove,
@@ -137,41 +138,41 @@ function Dn(t = {}) {
137
138
  labelElement: D(l.labelElement, null),
138
139
  selectElement: D(l.selectElement, null),
139
140
  listElement: D(l.listElement, null)
140
- }), i = mt(c, a, m, r);
141
- return X(
141
+ }), i = ft(c, a, m, r);
142
+ return G(
142
143
  i,
143
- () => G(i, ["value", "items"], (s) => {
144
- if (s.value !== f || !s.items.length) return;
145
- const v = s.items.find(
146
- (E) => !E.disabled && E.value != null
144
+ () => J(i, ["value", "items"], (s) => {
145
+ if (s.value !== v || !s.items.length) return;
146
+ const f = s.items.find(
147
+ (C) => !C.disabled && C.value != null
147
148
  );
148
- (v == null ? void 0 : v.value) != null && i.setState("value", v.value);
149
+ (f == null ? void 0 : f.value) != null && i.setState("value", f.value);
149
150
  })
150
- ), X(
151
+ ), G(
151
152
  i,
152
- () => G(i, ["mounted"], (s) => {
153
+ () => J(i, ["mounted"], (s) => {
153
154
  s.mounted || i.setState("activeId", c.activeId);
154
155
  })
155
- ), X(
156
+ ), G(
156
157
  i,
157
- () => G(i, ["mounted", "items", "value"], (s) => {
158
+ () => J(i, ["mounted", "items", "value"], (s) => {
158
159
  if (o || s.mounted) return;
159
- const v = gt(s.value), E = v[v.length - 1];
160
- if (E == null) return;
160
+ const f = Ct(s.value), C = f[f.length - 1];
161
+ if (C == null) return;
161
162
  const d = s.items.find(
162
- (p) => !p.disabled && p.value === E
163
+ (p) => !p.disabled && p.value === C
163
164
  );
164
165
  d && i.setState("activeId", d.id);
165
166
  })
166
- ), X(
167
+ ), G(
167
168
  i,
168
- () => ft(i, ["setValueOnMove", "moves"], (s) => {
169
- const { mounted: v, value: E, activeId: d } = i.getState();
170
- if (!s.setValueOnMove && v || Array.isArray(E) || !s.moves || !d) return;
169
+ () => vt(i, ["setValueOnMove", "moves"], (s) => {
170
+ const { mounted: f, value: C, activeId: d } = i.getState();
171
+ if (!s.setValueOnMove && f || Array.isArray(C) || !s.moves || !d) return;
171
172
  const p = a.item(d);
172
173
  !p || p.disabled || p.value == null || i.setState("value", p.value);
173
174
  })
174
- ), ie(Z(Z(Z({}, a), m), i), {
175
+ ), ie($($($({}, a), m), i), {
175
176
  combobox: o,
176
177
  setValue: (s) => i.setState("value", s),
177
178
  setLabelElement: (s) => i.setState("labelElement", s),
@@ -179,38 +180,38 @@ function Dn(t = {}) {
179
180
  setListElement: (s) => i.setState("listElement", s)
180
181
  });
181
182
  }
182
- function Nn(t) {
183
- const n = bt();
184
- return t = R(A({}, t), {
183
+ function Ln(t) {
184
+ const n = ht();
185
+ return t = H(A({}, t), {
185
186
  combobox: t.combobox !== void 0 ? t.combobox : n
186
- }), it(t);
187
+ }), ut(t);
187
188
  }
188
- function Ln(t, n, o) {
189
- return ke(n, [o.combobox]), be(t, o, "value", "setValue"), be(t, o, "setValueOnMove"), Object.assign(
190
- st(
191
- ut(t, n, o),
189
+ function Tn(t, n, o) {
190
+ return Me(n, [o.combobox]), be(t, o, "value", "setValue"), be(t, o, "setValueOnMove"), Object.assign(
191
+ at(
192
+ ct(t, n, o),
192
193
  n,
193
194
  o
194
195
  ),
195
196
  { combobox: o.combobox }
196
197
  );
197
198
  }
198
- function Tn(t = {}) {
199
- t = Nn(t);
200
- const [n, o] = vt(Dn, t);
201
- return Ln(n, o, t);
199
+ function Rn(t = {}) {
200
+ t = Ln(t);
201
+ const [n, o] = pt(Dn, t);
202
+ return Tn(n, o, t);
202
203
  }
203
- var Rn = "span", Kn = ne(
204
+ var Kn = "span", Hn = ne(
204
205
  function(n) {
205
206
  var o = n, { store: e } = o, r = oe(o, ["store"]);
206
- const l = Me();
207
- return e = e || l, r = It(A({ store: e }, r)), r;
207
+ const l = Ne();
208
+ return e = e || l, r = wt(A({ store: e }, r)), r;
208
209
  }
209
- ), Hn = re(function(n) {
210
- const o = Kn(n);
211
- return le(Rn, o);
212
- }), Un = "button";
213
- function Fn(t) {
210
+ ), Un = re(function(n) {
211
+ const o = Hn(n);
212
+ return le(Kn, o);
213
+ }), Fn = "button";
214
+ function Bn(t) {
214
215
  return Array.from(t.selectedOptions).map((n) => n.value);
215
216
  }
216
217
  function Oe(t, n) {
@@ -227,14 +228,14 @@ function Oe(t, n) {
227
228
  return r == null ? void 0 : r.id;
228
229
  };
229
230
  }
230
- var Bn = ne(function(n) {
231
+ var jn = ne(function(n) {
231
232
  var o = n, {
232
233
  store: e,
233
234
  name: r,
234
235
  form: l,
235
236
  required: a,
236
237
  showOnKeyDown: m = !0,
237
- moveOnKeyDown: f = !0,
238
+ moveOnKeyDown: v = !0,
238
239
  toggleOnPress: c = !0,
239
240
  toggleOnClick: i = c
240
241
  } = o, s = oe(o, [
@@ -247,50 +248,50 @@ var Bn = ne(function(n) {
247
248
  "toggleOnPress",
248
249
  "toggleOnClick"
249
250
  ]);
250
- const v = De();
251
- e = e || v, me(
251
+ const f = De();
252
+ e = e || f, me(
252
253
  e,
253
254
  process.env.NODE_ENV !== "production" && "Select must receive a `store` prop or be wrapped in a SelectProvider component."
254
255
  );
255
- const E = s.onKeyDown, d = T(m), p = T(f), h = e.useState("placement").split("-")[0], C = e.useState("value"), W = Array.isArray(C), K = Q((g) => {
256
- var O;
257
- if (E == null || E(g), g.defaultPrevented || !e) return;
258
- const { orientation: q, items: Y, activeId: J } = e.getState(), fe = q !== "horizontal", ue = q !== "vertical", k = !!((O = Y.find((Ee) => !Ee.disabled && Ee.value != null)) != null && O.rowId), pe = {
259
- ArrowUp: (k || fe) && Oe(e, e.up),
260
- ArrowRight: (k || ue) && Oe(e, e.next),
261
- ArrowDown: (k || fe) && Oe(e, e.down),
262
- ArrowLeft: (k || ue) && Oe(e, e.previous)
263
- }[g.key];
264
- pe && p(g) && (g.preventDefault(), e.move(pe()));
265
- const Se = h === "top" || h === "bottom";
256
+ const C = s.onKeyDown, d = R(m), p = R(v), O = e.useState("placement").split("-")[0], g = e.useState("value"), K = Array.isArray(g), x = Q((S) => {
257
+ var E;
258
+ if (C == null || C(S), S.defaultPrevented || !e) return;
259
+ const { orientation: q, items: Y, activeId: ee } = e.getState(), fe = q !== "horizontal", ue = q !== "vertical", M = !!((E = Y.find((Ee) => !Ee.disabled && Ee.value != null)) != null && E.rowId), pe = {
260
+ ArrowUp: (M || fe) && Oe(e, e.up),
261
+ ArrowRight: (M || ue) && Oe(e, e.next),
262
+ ArrowDown: (M || fe) && Oe(e, e.down),
263
+ ArrowLeft: (M || ue) && Oe(e, e.previous)
264
+ }[S.key];
265
+ pe && p(S) && (S.preventDefault(), e.move(pe()));
266
+ const Se = O === "top" || O === "bottom";
266
267
  ({
267
268
  ArrowDown: Se,
268
269
  ArrowUp: Se,
269
- ArrowLeft: h === "left",
270
- ArrowRight: h === "right"
271
- })[g.key] && d(g) && (g.preventDefault(), e.move(J), Je(g.currentTarget, "keyup", e.show));
270
+ ArrowLeft: O === "left",
271
+ ArrowRight: O === "right"
272
+ })[S.key] && d(S) && (S.preventDefault(), e.move(ee), et(S.currentTarget, "keyup", e.show));
272
273
  });
273
274
  s = he(
274
275
  s,
275
- (g) => /* @__PURE__ */ w(Ct, { value: e, children: g }),
276
+ (S) => /* @__PURE__ */ w(Et, { value: e, children: S }),
276
277
  [e]
277
278
  );
278
- const [$, _] = de(!1), I = se(!1);
279
+ const [Z, k] = de(!1), P = se(!1);
279
280
  ae(() => {
280
- const g = I.current;
281
- I.current = !1, !g && _(!1);
282
- }, [C]);
283
- const U = e.useState((g) => {
284
- var O;
285
- return (O = g.labelElement) == null ? void 0 : O.id;
286
- }), b = s["aria-label"], y = s["aria-labelledby"] || U, F = e.useState((g) => {
281
+ const S = P.current;
282
+ P.current = !1, !S && k(!1);
283
+ }, [g]);
284
+ const F = e.useState((S) => {
285
+ var E;
286
+ return (E = S.labelElement) == null ? void 0 : E.id;
287
+ }), b = s["aria-label"], y = s["aria-labelledby"] || F, B = e.useState((S) => {
287
288
  if (r)
288
- return g.items;
289
- }), B = Ce(() => [...new Set(F == null ? void 0 : F.map((g) => g.value).filter((g) => g != null))], [F]);
289
+ return S.items;
290
+ }), j = Ce(() => [...new Set(B == null ? void 0 : B.map((S) => S.value).filter((S) => S != null))], [B]);
290
291
  s = he(
291
292
  s,
292
- (g) => r ? /* @__PURE__ */ te(Ue, { children: [
293
- /* @__PURE__ */ te(
293
+ (S) => r ? /* @__PURE__ */ X(we, { children: [
294
+ /* @__PURE__ */ X(
294
295
  "select",
295
296
  {
296
297
  style: {
@@ -312,25 +313,25 @@ var Bn = ne(function(n) {
312
313
  form: l,
313
314
  required: a,
314
315
  disabled: s.disabled,
315
- value: C,
316
- multiple: W,
316
+ value: g,
317
+ multiple: K,
317
318
  onFocus: () => {
318
- var O;
319
- return (O = e == null ? void 0 : e.getState().selectElement) == null ? void 0 : O.focus();
319
+ var E;
320
+ return (E = e == null ? void 0 : e.getState().selectElement) == null ? void 0 : E.focus();
320
321
  },
321
- onChange: (O) => {
322
- I.current = !0, _(!0), e == null || e.setValue(
323
- W ? Fn(O.target) : O.target.value
322
+ onChange: (E) => {
323
+ P.current = !0, k(!0), e == null || e.setValue(
324
+ K ? Bn(E.target) : E.target.value
324
325
  );
325
326
  },
326
327
  children: [
327
- gt(C).map((O) => O == null || B.includes(O) ? null : /* @__PURE__ */ w("option", { value: O, children: O }, O)),
328
- B.map((O) => /* @__PURE__ */ w("option", { value: O, children: O }, O))
328
+ Ct(g).map((E) => E == null || j.includes(E) ? null : /* @__PURE__ */ w("option", { value: E, children: E }, E)),
329
+ j.map((E) => /* @__PURE__ */ w("option", { value: E, children: E }, E))
329
330
  ]
330
331
  }
331
332
  ),
332
- g
333
- ] }) : g,
333
+ S
334
+ ] }) : S,
334
335
  [
335
336
  e,
336
337
  b,
@@ -338,42 +339,42 @@ var Bn = ne(function(n) {
338
339
  r,
339
340
  l,
340
341
  a,
341
- C,
342
- W,
343
- B,
342
+ g,
343
+ K,
344
+ j,
344
345
  s.disabled
345
346
  ]
346
347
  );
347
- const S = /* @__PURE__ */ te(Ue, { children: [
348
- C,
349
- /* @__PURE__ */ w(Hn, {})
350
- ] }), P = e.useState("contentElement");
351
- return s = R(A({
348
+ const h = /* @__PURE__ */ X(we, { children: [
349
+ g,
350
+ /* @__PURE__ */ w(Un, {})
351
+ ] }), _ = e.useState("contentElement");
352
+ return s = H(A({
352
353
  role: "combobox",
353
354
  "aria-autocomplete": "none",
354
- "aria-labelledby": U,
355
- "aria-haspopup": et(P, "listbox"),
356
- "data-autofill": $ || void 0,
355
+ "aria-labelledby": F,
356
+ "aria-haspopup": tt(_, "listbox"),
357
+ "data-autofill": Z || void 0,
357
358
  "data-name": r,
358
- children: S
359
+ children: h
359
360
  }, s), {
360
361
  ref: ye(e.setSelectElement, s.ref),
361
- onKeyDown: K
362
- }), s = pn(A({ store: e, toggleOnClick: i }, s)), s = Et(A({ store: e }, s)), s;
363
- }), jn = re(function(n) {
364
- const o = Bn(n);
365
- return le(Un, o);
362
+ onKeyDown: x
363
+ }), s = bn(A({ store: e, toggleOnClick: i }, s)), s = Ot(A({ store: e }, s)), s;
364
+ }), Wn = re(function(n) {
365
+ const o = jn(n);
366
+ return le(Fn, o);
366
367
  });
367
- function Wn(t = {}) {
368
- const n = Tn(t);
369
- return /* @__PURE__ */ w(wn, { value: n, children: t.children });
368
+ function Zn(t = {}) {
369
+ const n = Rn(t);
370
+ return /* @__PURE__ */ w(Pn, { value: n, children: t.children });
370
371
  }
371
- var Zn = "div";
372
- function $n(t, n) {
372
+ var $n = "div";
373
+ function qn(t, n) {
373
374
  if (n != null)
374
375
  return t == null ? !1 : Array.isArray(t) ? t.includes(n) : t === n;
375
376
  }
376
- var qn = ne(
377
+ var Yn = ne(
377
378
  function(n) {
378
379
  var o = n, {
379
380
  store: e,
@@ -381,7 +382,7 @@ var qn = ne(
381
382
  getItem: l,
382
383
  hideOnClick: a,
383
384
  setValueOnClick: m = r != null,
384
- preventScrollOnKeyDown: f = !0,
385
+ preventScrollOnKeyDown: v = !0,
385
386
  focusOnHover: c = !0
386
387
  } = o, i = oe(o, [
387
388
  "store",
@@ -392,25 +393,25 @@ var qn = ne(
392
393
  "preventScrollOnKeyDown",
393
394
  "focusOnHover"
394
395
  ]), s;
395
- const v = Vn();
396
- e = e || v, me(
396
+ const f = Vn();
397
+ e = e || f, me(
397
398
  e,
398
399
  process.env.NODE_ENV !== "production" && "SelectItem must be wrapped in a SelectList or SelectPopover component."
399
400
  );
400
- const E = Ae(i.id), d = Gt(i), { listElement: p, multiSelectable: V, selected: h, autoFocus: C } = pt(e, {
401
+ const C = Ae(i.id), d = Jt(i), { listElement: p, multiSelectable: V, selected: O, autoFocus: g } = bt(e, {
401
402
  listElement: "listElement",
402
403
  multiSelectable(b) {
403
404
  return Array.isArray(b.value);
404
405
  },
405
406
  selected(b) {
406
- return $n(b.value, r);
407
+ return qn(b.value, r);
407
408
  },
408
409
  autoFocus(b) {
409
- return r == null || b.value == null || b.activeId !== E && (e != null && e.item(b.activeId)) ? !1 : Array.isArray(b.value) ? b.value[b.value.length - 1] === r : b.value === r;
410
+ return r == null || b.value == null || b.activeId !== C && (e != null && e.item(b.activeId)) ? !1 : Array.isArray(b.value) ? b.value[b.value.length - 1] === r : b.value === r;
410
411
  }
411
- }), W = Qe(
412
+ }), K = Xe(
412
413
  (b) => {
413
- const y = R(A({}, b), {
414
+ const y = H(A({}, b), {
414
415
  value: d ? void 0 : r,
415
416
  children: r
416
417
  });
@@ -419,46 +420,46 @@ var qn = ne(
419
420
  [d, r, l]
420
421
  );
421
422
  a = a ?? (r != null && !V);
422
- const K = i.onClick, $ = T(m), _ = T(a), I = Q((b) => {
423
- K == null || K(b), !b.defaultPrevented && (nt(b) || ot(b) || ($(b) && r != null && (e == null || e.setValue((y) => Array.isArray(y) ? y.includes(r) ? y.filter((F) => F !== r) : [...y, r] : r)), _(b) && (e == null || e.hide())));
423
+ const x = i.onClick, Z = R(m), k = R(a), P = Q((b) => {
424
+ x == null || x(b), !b.defaultPrevented && (ot(b) || rt(b) || (Z(b) && r != null && (e == null || e.setValue((y) => Array.isArray(y) ? y.includes(r) ? y.filter((B) => B !== r) : [...y, r] : r)), k(b) && (e == null || e.hide())));
424
425
  });
425
426
  i = he(
426
427
  i,
427
- (b) => /* @__PURE__ */ w(Pn.Provider, { value: h ?? !1, children: b }),
428
- [h]
429
- ), i = R(A({
430
- id: E,
431
- role: Jt(p),
432
- "aria-selected": h,
428
+ (b) => /* @__PURE__ */ w(_n.Provider, { value: O ?? !1, children: b }),
429
+ [O]
430
+ ), i = H(A({
431
+ id: C,
432
+ role: en(p),
433
+ "aria-selected": O,
433
434
  children: r
434
435
  }, i), {
435
- autoFocus: (s = i.autoFocus) != null ? s : C,
436
- onClick: I
437
- }), i = xt(A({
436
+ autoFocus: (s = i.autoFocus) != null ? s : g,
437
+ onClick: P
438
+ }), i = It(A({
438
439
  store: e,
439
- getItem: W,
440
- preventScrollOnKeyDown: f
440
+ getItem: K,
441
+ preventScrollOnKeyDown: v
441
442
  }, i));
442
- const U = T(c);
443
- return i = At(R(A({
443
+ const F = R(c);
444
+ return i = xt(H(A({
444
445
  store: e
445
446
  }, i), {
446
447
  // We have to disable focusOnHover when the popup is closed, otherwise
447
448
  // the active item will change to null (the container) when the popup is
448
449
  // closed by clicking on an item.
449
450
  focusOnHover(b) {
450
- if (!U(b)) return !1;
451
+ if (!F(b)) return !1;
451
452
  const y = e == null ? void 0 : e.getState();
452
453
  return !!(y != null && y.open);
453
454
  }
454
455
  })), i;
455
456
  }
456
- ), Yn = tt(
457
+ ), zn = nt(
457
458
  re(function(n) {
458
- const o = qn(n);
459
- return le(Zn, o);
459
+ const o = Yn(n);
460
+ return le($n, o);
460
461
  })
461
- ), zn = "div", je = _e(null), wt = ne(
462
+ ), Qn = "div", We = ke(null), Pt = ne(
462
463
  function(n) {
463
464
  var o = n, {
464
465
  store: e,
@@ -466,7 +467,7 @@ var qn = ne(
466
467
  hideOnEnter: l = !0,
467
468
  focusOnMove: a = !0,
468
469
  composite: m,
469
- alwaysVisible: f
470
+ alwaysVisible: v
470
471
  } = o, c = oe(o, [
471
472
  "store",
472
473
  "resetOnEscape",
@@ -475,102 +476,102 @@ var qn = ne(
475
476
  "composite",
476
477
  "alwaysVisible"
477
478
  ]);
478
- const i = Me();
479
+ const i = Ne();
479
480
  e = e || i, me(
480
481
  e,
481
482
  process.env.NODE_ENV !== "production" && "SelectList must receive a `store` prop or be wrapped in a SelectProvider component."
482
483
  );
483
- const s = Ae(c.id), v = e.useState("value"), E = Array.isArray(v), [d, p] = de(v), V = e.useState("mounted");
484
+ const s = Ae(c.id), f = e.useState("value"), C = Array.isArray(f), [d, p] = de(f), V = e.useState("mounted");
484
485
  ae(() => {
485
- V || p(v);
486
- }, [V, v]), r = r && !E;
487
- const h = c.onKeyDown, C = T(r), W = T(l), K = Q((k) => {
488
- h == null || h(k), !k.defaultPrevented && (k.key === "Escape" && C(k) && (e == null || e.setValue(d)), (k.key === " " || k.key === "Enter") && en(k) && W(k) && (k.preventDefault(), e == null || e.hide()));
489
- }), $ = we(Be), _ = de(), [I, U] = $ || _, b = Ce(
490
- () => [I, U],
491
- [I]
492
- ), [y, F] = de(null), B = we(je);
486
+ V || p(f);
487
+ }, [V, f]), r = r && !C;
488
+ const O = c.onKeyDown, g = R(r), K = R(l), x = Q((M) => {
489
+ O == null || O(M), !M.defaultPrevented && (M.key === "Escape" && g(M) && (e == null || e.setValue(d)), (M.key === " " || M.key === "Enter") && tn(M) && K(M) && (M.preventDefault(), e == null || e.hide()));
490
+ }), Z = Pe(je), k = de(), [P, F] = Z || k, b = Ce(
491
+ () => [P, F],
492
+ [P]
493
+ ), [y, B] = de(null), j = Pe(We);
493
494
  ae(() => {
494
- if (B)
495
- return B(e), () => B(null);
496
- }, [B, e]), c = he(
495
+ if (j)
496
+ return j(e), () => j(null);
497
+ }, [j, e]), c = he(
497
498
  c,
498
- (k) => /* @__PURE__ */ w(Ct, { value: e, children: /* @__PURE__ */ w(je.Provider, { value: F, children: /* @__PURE__ */ w(Be.Provider, { value: b, children: k }) }) }),
499
+ (M) => /* @__PURE__ */ w(Et, { value: e, children: /* @__PURE__ */ w(We.Provider, { value: B, children: /* @__PURE__ */ w(je.Provider, { value: b, children: M }) }) }),
499
500
  [e, b]
500
501
  );
501
- const S = !!e.combobox;
502
- m = m ?? (!S && y !== e);
503
- const [P, g] = tn(
502
+ const h = !!e.combobox;
503
+ m = m ?? (!h && y !== e);
504
+ const [_, S] = nn(
504
505
  m ? e.setListElement : null
505
- ), O = rt(P, "role", c.role), Y = (m || (O === "listbox" || O === "menu" || O === "tree" || O === "grid")) && E || void 0, J = Ot(V, c.hidden, f), fe = J ? R(A({}, c.style), { display: "none" }) : c.style;
506
+ ), E = lt(_, "role", c.role), Y = (m || (E === "listbox" || E === "menu" || E === "tree" || E === "grid")) && C || void 0, ee = yt(V, c.hidden, v), fe = ee ? H(A({}, c.style), { display: "none" }) : c.style;
506
507
  m && (c = A({
507
508
  role: "listbox",
508
509
  "aria-multiselectable": Y
509
510
  }, c));
510
511
  const ue = e.useState(
511
- (k) => {
512
+ (M) => {
512
513
  var ve;
513
- return I || ((ve = k.labelElement) == null ? void 0 : ve.id);
514
+ return P || ((ve = M.labelElement) == null ? void 0 : ve.id);
514
515
  }
515
516
  );
516
- return c = R(A({
517
+ return c = H(A({
517
518
  id: s,
518
519
  "aria-labelledby": ue,
519
- hidden: J
520
+ hidden: ee
520
521
  }, c), {
521
- ref: ye(g, c.ref),
522
+ ref: ye(S, c.ref),
522
523
  style: fe,
523
- onKeyDown: K
524
- }), c = yt(R(A({ store: e }, c), { composite: m })), c = Et(A({ store: e, typeahead: !S }, c)), c;
524
+ onKeyDown: x
525
+ }), c = At(H(A({ store: e }, c), { composite: m })), c = Ot(A({ store: e, typeahead: !h }, c)), c;
525
526
  }
526
- ), Qn = re(function(n) {
527
- const o = wt(n);
528
- return le(zn, o);
529
- }), Xn = "div", Gn = ne(
527
+ ), Xn = re(function(n) {
528
+ const o = Pt(n);
529
+ return le(Qn, o);
530
+ }), Gn = "div", Jn = ne(
530
531
  function(n) {
531
532
  var o = n, { store: e, alwaysVisible: r } = o, l = oe(o, ["store", "alwaysVisible"]);
532
533
  const a = De();
533
- return e = e || a, l = wt(A({ store: e, alwaysVisible: r }, l)), l = hn(A({ store: e, alwaysVisible: r }, l)), l;
534
+ return e = e || a, l = Pt(A({ store: e, alwaysVisible: r }, l)), l = Sn(A({ store: e, alwaysVisible: r }, l)), l;
534
535
  }
535
- ), Jn = bn(
536
+ ), eo = hn(
536
537
  re(function(n) {
537
- const o = Gn(n);
538
- return le(Xn, o);
538
+ const o = Jn(n);
539
+ return le(Gn, o);
539
540
  }),
540
541
  De
541
542
  );
542
- function eo({
543
+ function to({
543
544
  store: t,
544
545
  fallback: n,
545
546
  children: o
546
547
  } = {}) {
547
- const e = Me();
548
+ const e = Ne();
548
549
  t = t || e;
549
- const r = Cn(t, (l) => l != null && l.value.length ? l.value : n);
550
+ const r = En(t, (l) => l != null && l.value.length ? l.value : n);
550
551
  return o ? o(r || "") : r;
551
552
  }
552
- _e(null);
553
- _e(
553
+ ke(null);
554
+ ke(
554
555
  null
555
556
  );
556
- var to = nn(
557
- [Xt],
558
- [Qt]
559
- ), no = to.useContext, oo = rn() && ln();
560
- function ro(t = {}) {
557
+ var no = on(
558
+ [Gt],
559
+ [Xt]
560
+ ), oo = no.useContext, ro = ln() && sn();
561
+ function lo(t = {}) {
561
562
  var n = t, {
562
563
  tag: o
563
- } = n, e = Ge(n, [
564
+ } = n, e = Je(n, [
564
565
  "tag"
565
566
  ]);
566
- const r = ct(e.store, En(o, ["value", "rtl"]));
567
- dt(e, r);
567
+ const r = dt(e.store, On(o, ["value", "rtl"]));
568
+ mt(e, r);
568
569
  const l = o == null ? void 0 : o.getState(), a = r == null ? void 0 : r.getState(), m = D(
569
570
  e.activeId,
570
571
  a == null ? void 0 : a.activeId,
571
572
  e.defaultActiveId,
572
573
  null
573
- ), f = at(ie(Z({}, e), {
574
+ ), v = it(ie($({}, e), {
574
575
  activeId: m,
575
576
  includesBaseElement: D(
576
577
  e.includesBaseElement,
@@ -589,7 +590,7 @@ function ro(t = {}) {
589
590
  a == null ? void 0 : a.virtualFocus,
590
591
  !0
591
592
  )
592
- })), c = lt(ie(Z({}, e), {
593
+ })), c = st(ie($({}, e), {
593
594
  placement: D(
594
595
  e.placement,
595
596
  a == null ? void 0 : a.placement,
@@ -606,109 +607,109 @@ function ro(t = {}) {
606
607
  l == null ? void 0 : l.values,
607
608
  e.defaultSelectedValue,
608
609
  ""
609
- ), v = Array.isArray(s), E = ie(Z(Z({}, f.getState()), c.getState()), {
610
+ ), f = Array.isArray(s), C = ie($($({}, v.getState()), c.getState()), {
610
611
  value: i,
611
612
  selectedValue: s,
612
613
  resetValueOnSelect: D(
613
614
  e.resetValueOnSelect,
614
615
  a == null ? void 0 : a.resetValueOnSelect,
615
- v
616
+ f
616
617
  ),
617
618
  resetValueOnHide: D(
618
619
  e.resetValueOnHide,
619
620
  a == null ? void 0 : a.resetValueOnHide,
620
- v && !o
621
+ f && !o
621
622
  ),
622
623
  activeValue: a == null ? void 0 : a.activeValue
623
- }), d = mt(E, f, c, r);
624
- return oo && X(
624
+ }), d = ft(C, v, c, r);
625
+ return ro && G(
625
626
  d,
626
- () => G(d, ["virtualFocus"], () => {
627
+ () => J(d, ["virtualFocus"], () => {
627
628
  d.setState("virtualFocus", !1);
628
629
  })
629
- ), X(d, () => {
630
+ ), G(d, () => {
630
631
  if (o)
631
- return on(
632
- G(d, ["selectedValue"], (p) => {
632
+ return rn(
633
+ J(d, ["selectedValue"], (p) => {
633
634
  Array.isArray(p.selectedValue) && o.setValues(p.selectedValue);
634
635
  }),
635
- G(o, ["values"], (p) => {
636
+ J(o, ["values"], (p) => {
636
637
  d.setState("selectedValue", p.values);
637
638
  })
638
639
  );
639
- }), X(
640
+ }), G(
640
641
  d,
641
- () => G(d, ["resetValueOnHide", "mounted"], (p) => {
642
+ () => J(d, ["resetValueOnHide", "mounted"], (p) => {
642
643
  p.resetValueOnHide && (p.mounted || d.setState("value", i));
643
644
  })
644
- ), X(
645
+ ), G(
645
646
  d,
646
- () => G(d, ["open"], (p) => {
647
+ () => J(d, ["open"], (p) => {
647
648
  p.open || (d.setState("activeId", m), d.setState("moves", 0));
648
649
  })
649
- ), X(
650
+ ), G(
650
651
  d,
651
- () => G(d, ["moves", "activeId"], (p, V) => {
652
+ () => J(d, ["moves", "activeId"], (p, V) => {
652
653
  p.moves === V.moves && d.setState("activeValue", void 0);
653
654
  })
654
- ), X(
655
+ ), G(
655
656
  d,
656
- () => ft(d, ["moves", "renderedItems"], (p, V) => {
657
+ () => vt(d, ["moves", "renderedItems"], (p, V) => {
657
658
  if (p.moves === V.moves) return;
658
- const { activeId: h } = d.getState(), C = f.item(h);
659
- d.setState("activeValue", C == null ? void 0 : C.value);
659
+ const { activeId: O } = d.getState(), g = v.item(O);
660
+ d.setState("activeValue", g == null ? void 0 : g.value);
660
661
  })
661
- ), ie(Z(Z(Z({}, c), f), d), {
662
+ ), ie($($($({}, c), v), d), {
662
663
  tag: o,
663
664
  setValue: (p) => d.setState("value", p),
664
- resetValue: () => d.setState("value", E.value),
665
+ resetValue: () => d.setState("value", C.value),
665
666
  setSelectedValue: (p) => d.setState("selectedValue", p)
666
667
  });
667
668
  }
668
- function lo(t) {
669
- const n = no();
670
- return t = R(A({}, t), {
669
+ function so(t) {
670
+ const n = oo();
671
+ return t = H(A({}, t), {
671
672
  tag: t.tag !== void 0 ? t.tag : n
672
- }), it(t);
673
+ }), ut(t);
673
674
  }
674
- function so(t, n, o) {
675
- return ke(n, [o.tag]), be(t, o, "value", "setValue"), be(t, o, "selectedValue", "setSelectedValue"), be(t, o, "resetValueOnHide"), be(t, o, "resetValueOnSelect"), Object.assign(
676
- ut(
677
- st(t, n, o),
675
+ function ao(t, n, o) {
676
+ return Me(n, [o.tag]), be(t, o, "value", "setValue"), be(t, o, "selectedValue", "setSelectedValue"), be(t, o, "resetValueOnHide"), be(t, o, "resetValueOnSelect"), Object.assign(
677
+ ct(
678
+ at(t, n, o),
678
679
  n,
679
680
  o
680
681
  ),
681
682
  { tag: o.tag }
682
683
  );
683
684
  }
684
- function ao(t = {}) {
685
- t = lo(t);
686
- const [n, o] = vt(ro, t);
687
- return so(n, o, t);
685
+ function io(t = {}) {
686
+ t = so(t);
687
+ const [n, o] = pt(lo, t);
688
+ return ao(n, o, t);
688
689
  }
689
- var io = "input";
690
- function We(t, n, o) {
690
+ var uo = "input";
691
+ function Ze(t, n, o) {
691
692
  if (!o) return !1;
692
693
  const e = t.find((r) => !r.disabled && r.value);
693
694
  return (e == null ? void 0 : e.value) === n;
694
695
  }
695
- function Ze(t, n) {
696
- return !n || t == null ? !1 : (t = fn(t), n.length > t.length && n.toLowerCase().indexOf(t.toLowerCase()) === 0);
696
+ function $e(t, n) {
697
+ return !n || t == null ? !1 : (t = vn(t), n.length > t.length && n.toLowerCase().indexOf(t.toLowerCase()) === 0);
697
698
  }
698
- function uo(t) {
699
+ function co(t) {
699
700
  return t.type === "input";
700
701
  }
701
- function co(t) {
702
+ function mo(t) {
702
703
  return t === "inline" || t === "list" || t === "both" || t === "none";
703
704
  }
704
- function mo(t) {
705
+ function fo(t) {
705
706
  const n = t.find((o) => {
706
707
  var e;
707
708
  return o.disabled ? !1 : ((e = o.element) == null ? void 0 : e.getAttribute("role")) !== "tab";
708
709
  });
709
710
  return n == null ? void 0 : n.id;
710
711
  }
711
- var fo = ne(
712
+ var vo = ne(
712
713
  function(n) {
713
714
  var o = n, {
714
715
  store: e,
@@ -716,17 +717,17 @@ var fo = ne(
716
717
  autoSelect: l = !1,
717
718
  getAutoSelectId: a,
718
719
  setValueOnChange: m,
719
- showMinLength: f = 0,
720
+ showMinLength: v = 0,
720
721
  showOnChange: c,
721
722
  showOnMouseDown: i,
722
723
  showOnClick: s = i,
723
- showOnKeyDown: v,
724
- showOnKeyPress: E = v,
724
+ showOnKeyDown: f,
725
+ showOnKeyPress: C = f,
725
726
  blurActiveItemOnClick: d,
726
727
  setValueOnClick: p = !0,
727
728
  moveOnKeyPress: V = !0,
728
- autoComplete: h = "list"
729
- } = o, C = oe(o, [
729
+ autoComplete: O = "list"
730
+ } = o, g = oe(o, [
730
731
  "store",
731
732
  "focusable",
732
733
  "autoSelect",
@@ -743,208 +744,208 @@ var fo = ne(
743
744
  "moveOnKeyPress",
744
745
  "autoComplete"
745
746
  ]);
746
- const W = bt();
747
- e = e || W, me(
747
+ const K = ht();
748
+ e = e || K, me(
748
749
  e,
749
750
  process.env.NODE_ENV !== "production" && "Combobox must receive a `store` prop or be wrapped in a ComboboxProvider component."
750
751
  );
751
- const K = se(null), [$, _] = sn(), I = se(!1), U = se(!1), b = e.useState(
752
+ const x = se(null), [Z, k] = an(), P = se(!1), F = se(!1), b = e.useState(
752
753
  (u) => u.virtualFocus && l
753
- ), y = h === "inline" || h === "both", [F, B] = de(y);
754
- an(() => {
755
- y && B(!0);
754
+ ), y = O === "inline" || O === "both", [B, j] = de(y);
755
+ un(() => {
756
+ y && j(!0);
756
757
  }, [y]);
757
- const S = e.useState("value"), P = se();
758
- ae(() => G(e, ["selectedValue", "activeId"], (u, x) => {
759
- P.current = x.selectedValue;
758
+ const h = e.useState("value"), _ = se();
759
+ ae(() => J(e, ["selectedValue", "activeId"], (u, I) => {
760
+ _.current = I.selectedValue;
760
761
  }), []);
761
- const g = e.useState((u) => {
762
- var x;
763
- if (y && F && !(u.activeValue && Array.isArray(u.selectedValue) && (u.selectedValue.includes(u.activeValue) || (x = P.current) != null && x.includes(u.activeValue))))
762
+ const S = e.useState((u) => {
763
+ var I;
764
+ if (y && B && !(u.activeValue && Array.isArray(u.selectedValue) && (u.selectedValue.includes(u.activeValue) || (I = _.current) != null && I.includes(u.activeValue))))
764
765
  return u.activeValue;
765
- }), O = e.useState("renderedItems"), q = e.useState("open"), Y = e.useState("contentElement"), J = Ce(() => {
766
- if (!y || !F) return S;
767
- if (We(
768
- O,
769
- g,
766
+ }), E = e.useState("renderedItems"), q = e.useState("open"), Y = e.useState("contentElement"), ee = Ce(() => {
767
+ if (!y || !B) return h;
768
+ if (Ze(
769
+ E,
770
+ S,
770
771
  b
771
772
  )) {
772
- if (Ze(S, g)) {
773
- const x = (g == null ? void 0 : g.slice(S.length)) || "";
774
- return S + x;
773
+ if ($e(h, S)) {
774
+ const I = (S == null ? void 0 : S.slice(h.length)) || "";
775
+ return h + I;
775
776
  }
776
- return S;
777
+ return h;
777
778
  }
778
- return g || S;
779
- }, [y, F, O, g, b, S]);
779
+ return S || h;
780
+ }, [y, B, E, S, b, h]);
780
781
  ae(() => {
781
- const u = K.current;
782
+ const u = x.current;
782
783
  if (!u) return;
783
- const x = () => B(!0);
784
- return u.addEventListener("combobox-item-move", x), () => {
785
- u.removeEventListener("combobox-item-move", x);
784
+ const I = () => j(!0);
785
+ return u.addEventListener("combobox-item-move", I), () => {
786
+ u.removeEventListener("combobox-item-move", I);
786
787
  };
787
788
  }, []), ae(() => {
788
- if (!y || !F || !g || !We(
789
- O,
790
- g,
789
+ if (!y || !B || !S || !Ze(
790
+ E,
791
+ S,
791
792
  b
792
- ) || !Ze(S, g)) return;
793
- let x = un;
793
+ ) || !$e(h, S)) return;
794
+ let I = cn;
794
795
  return queueMicrotask(() => {
795
- const N = K.current;
796
- if (!N) return;
797
- const { start: L, end: z } = Fe(N), ee = S.length, H = g.length;
798
- Ie(N, ee, H), x = () => {
799
- if (!Pe(N)) return;
800
- const { start: ce, end: Ut } = Fe(N);
801
- ce === ee && Ut === H && Ie(N, L, z);
796
+ const L = x.current;
797
+ if (!L) return;
798
+ const { start: T, end: z } = Be(L), te = h.length, U = S.length;
799
+ Ie(L, te, U), I = () => {
800
+ if (!_e(L)) return;
801
+ const { start: ce, end: Ft } = Be(L);
802
+ ce === te && Ft === U && Ie(L, T, z);
802
803
  };
803
- }), () => x();
804
+ }), () => I();
804
805
  }, [
805
- $,
806
+ Z,
806
807
  y,
807
- F,
808
- g,
809
- O,
808
+ B,
809
+ S,
810
+ E,
810
811
  b,
811
- S
812
+ h
812
813
  ]);
813
- const fe = se(null), ue = Q(a), k = se(null);
814
+ const fe = se(null), ue = Q(a), M = se(null);
814
815
  ae(() => {
815
816
  if (!q || !Y) return;
816
- const u = cn(Y);
817
+ const u = dn(Y);
817
818
  if (!u) return;
818
819
  fe.current = u;
819
- const x = () => {
820
- I.current = !1;
821
- }, N = () => {
822
- if (!e || !I.current) return;
820
+ const I = () => {
821
+ P.current = !1;
822
+ }, L = () => {
823
+ if (!e || !P.current) return;
823
824
  const { activeId: z } = e.getState();
824
- z !== null && z !== k.current && (I.current = !1);
825
- }, L = { passive: !0, capture: !0 };
826
- return u.addEventListener("wheel", x, L), u.addEventListener("touchmove", x, L), u.addEventListener("scroll", N, L), () => {
827
- u.removeEventListener("wheel", x, !0), u.removeEventListener("touchmove", x, !0), u.removeEventListener("scroll", N, !0);
825
+ z !== null && z !== M.current && (P.current = !1);
826
+ }, T = { passive: !0, capture: !0 };
827
+ return u.addEventListener("wheel", I, T), u.addEventListener("touchmove", I, T), u.addEventListener("scroll", L, T), () => {
828
+ u.removeEventListener("wheel", I, !0), u.removeEventListener("touchmove", I, !0), u.removeEventListener("scroll", L, !0);
828
829
  };
829
830
  }, [q, Y, e]), Ve(() => {
830
- S && (U.current || (I.current = !0));
831
- }, [S]), Ve(() => {
832
- b !== "always" && q || (I.current = q);
831
+ h && (F.current || (P.current = !0));
832
+ }, [h]), Ve(() => {
833
+ b !== "always" && q || (P.current = q);
833
834
  }, [b, q]);
834
835
  const ve = e.useState("resetValueOnSelect");
835
- ke(() => {
836
- var u, x;
837
- const N = I.current;
838
- if (!e || !q || !N && !ve) return;
839
- const { baseElement: L, contentElement: z, activeId: ee } = e.getState();
840
- if (!(L && !Pe(L))) {
836
+ Me(() => {
837
+ var u, I;
838
+ const L = P.current;
839
+ if (!e || !q || !L && !ve) return;
840
+ const { baseElement: T, contentElement: z, activeId: te } = e.getState();
841
+ if (!(T && !_e(T))) {
841
842
  if (z != null && z.hasAttribute("data-placing")) {
842
- const H = new MutationObserver(_);
843
- return H.observe(z, { attributeFilter: ["data-placing"] }), () => H.disconnect();
843
+ const U = new MutationObserver(k);
844
+ return U.observe(z, { attributeFilter: ["data-placing"] }), () => U.disconnect();
844
845
  }
845
- if (b && N) {
846
- const H = ue(O), ce = H !== void 0 ? H : (u = mo(O)) != null ? u : e.first();
847
- k.current = ce, e.move(ce ?? null);
846
+ if (b && L) {
847
+ const U = ue(E), ce = U !== void 0 ? U : (u = fo(E)) != null ? u : e.first();
848
+ M.current = ce, e.move(ce ?? null);
848
849
  } else {
849
- const H = (x = e.item(ee || e.first())) == null ? void 0 : x.element;
850
- H && "scrollIntoView" in H && H.scrollIntoView({ block: "nearest", inline: "nearest" });
850
+ const U = (I = e.item(te || e.first())) == null ? void 0 : I.element;
851
+ U && "scrollIntoView" in U && U.scrollIntoView({ block: "nearest", inline: "nearest" });
851
852
  }
852
853
  }
853
854
  }, [
854
855
  e,
855
856
  q,
856
- $,
857
- S,
857
+ Z,
858
+ h,
858
859
  b,
859
860
  ve,
860
861
  ue,
861
- O
862
+ E
862
863
  ]), ae(() => {
863
864
  if (!y) return;
864
- const u = K.current;
865
+ const u = x.current;
865
866
  if (!u) return;
866
- const x = [u, Y].filter(
867
- (L) => !!L
868
- ), N = (L) => {
869
- x.every((z) => mn(L, z)) && (e == null || e.setValue(J));
867
+ const I = [u, Y].filter(
868
+ (T) => !!T
869
+ ), L = (T) => {
870
+ I.every((z) => fn(T, z)) && (e == null || e.setValue(ee));
870
871
  };
871
- for (const L of x)
872
- L.addEventListener("focusout", N);
872
+ for (const T of I)
873
+ T.addEventListener("focusout", L);
873
874
  return () => {
874
- for (const L of x)
875
- L.removeEventListener("focusout", N);
875
+ for (const T of I)
876
+ T.removeEventListener("focusout", L);
876
877
  };
877
- }, [y, Y, e, J]);
878
- const pe = (u) => u.currentTarget.value.length >= f, Se = C.onChange, Ne = T(c ?? pe), Le = T(
878
+ }, [y, Y, e, ee]);
879
+ const pe = (u) => u.currentTarget.value.length >= v, Se = g.onChange, Le = R(c ?? pe), Te = R(
879
880
  // If the combobox is combined with tags, the value will be set by the tag
880
881
  // input component.
881
882
  m ?? !e.tag
882
- ), Te = Q((u) => {
883
+ ), Re = Q((u) => {
883
884
  if (Se == null || Se(u), u.defaultPrevented || !e) return;
884
- const x = u.currentTarget, { value: N, selectionStart: L, selectionEnd: z } = x, ee = u.nativeEvent;
885
- if (I.current = !0, uo(ee) && (ee.isComposing && (I.current = !1, U.current = !0), y)) {
886
- const H = ee.inputType === "insertText" || ee.inputType === "insertCompositionText", ce = L === N.length;
887
- B(H && ce);
885
+ const I = u.currentTarget, { value: L, selectionStart: T, selectionEnd: z } = I, te = u.nativeEvent;
886
+ if (P.current = !0, co(te) && (te.isComposing && (P.current = !1, F.current = !0), y)) {
887
+ const U = te.inputType === "insertText" || te.inputType === "insertCompositionText", ce = T === L.length;
888
+ j(U && ce);
888
889
  }
889
- if (Le(u)) {
890
- const H = N === e.getState().value;
891
- e.setValue(N), queueMicrotask(() => {
892
- Ie(x, L, z);
893
- }), y && b && H && _();
890
+ if (Te(u)) {
891
+ const U = L === e.getState().value;
892
+ e.setValue(L), queueMicrotask(() => {
893
+ Ie(I, T, z);
894
+ }), y && b && U && k();
894
895
  }
895
- Ne(u) && e.show(), (!b || !I.current) && e.setActiveId(null);
896
- }), xe = C.onCompositionEnd, Ee = Q((u) => {
897
- I.current = !0, U.current = !1, xe == null || xe(u), !u.defaultPrevented && b && _();
898
- }), Re = C.onMouseDown, _t = T(
896
+ Le(u) && e.show(), (!b || !P.current) && e.setActiveId(null);
897
+ }), xe = g.onCompositionEnd, Ee = Q((u) => {
898
+ P.current = !0, F.current = !1, xe == null || xe(u), !u.defaultPrevented && b && k();
899
+ }), Ke = g.onMouseDown, kt = R(
899
900
  d ?? (() => !!(e != null && e.getState().includesBaseElement))
900
- ), kt = T(p), Mt = T(s ?? pe), Dt = Q((u) => {
901
- Re == null || Re(u), !u.defaultPrevented && (u.button || u.ctrlKey || e && (_t(u) && e.setActiveId(null), kt(u) && e.setValue(J), Mt(u) && Je(u.currentTarget, "mouseup", e.show)));
902
- }), Ke = C.onKeyDown, Nt = T(E ?? pe), Lt = Q((u) => {
903
- if (Ke == null || Ke(u), u.repeat || (I.current = !1), u.defaultPrevented || u.ctrlKey || u.altKey || u.shiftKey || u.metaKey || !e) return;
904
- const { open: x } = e.getState();
905
- x || (u.key === "ArrowUp" || u.key === "ArrowDown") && Nt(u) && (u.preventDefault(), e.show());
906
- }), He = C.onBlur, Tt = Q((u) => {
907
- I.current = !1, He == null || He(u), u.defaultPrevented;
908
- }), Rt = Ae(C.id), Kt = co(h) ? h : void 0, Ht = e.useState((u) => u.activeId === null);
909
- return C = R(A({
910
- id: Rt,
901
+ ), Mt = R(p), Nt = R(s ?? pe), Dt = Q((u) => {
902
+ Ke == null || Ke(u), !u.defaultPrevented && (u.button || u.ctrlKey || e && (kt(u) && e.setActiveId(null), Mt(u) && e.setValue(ee), Nt(u) && et(u.currentTarget, "mouseup", e.show)));
903
+ }), He = g.onKeyDown, Lt = R(C ?? pe), Tt = Q((u) => {
904
+ if (He == null || He(u), u.repeat || (P.current = !1), u.defaultPrevented || u.ctrlKey || u.altKey || u.shiftKey || u.metaKey || !e) return;
905
+ const { open: I } = e.getState();
906
+ I || (u.key === "ArrowUp" || u.key === "ArrowDown") && Lt(u) && (u.preventDefault(), e.show());
907
+ }), Ue = g.onBlur, Rt = Q((u) => {
908
+ P.current = !1, Ue == null || Ue(u), u.defaultPrevented;
909
+ }), Kt = Ae(g.id), Ht = mo(O) ? O : void 0, Ut = e.useState((u) => u.activeId === null);
910
+ return g = H(A({
911
+ id: Kt,
911
912
  role: "combobox",
912
- "aria-autocomplete": Kt,
913
- "aria-haspopup": et(Y, "listbox"),
913
+ "aria-autocomplete": Ht,
914
+ "aria-haspopup": tt(Y, "listbox"),
914
915
  "aria-expanded": q,
915
916
  "aria-controls": Y == null ? void 0 : Y.id,
916
- "data-active-item": Ht || void 0,
917
- value: J
918
- }, C), {
919
- ref: ye(K, C.ref),
920
- onChange: Te,
917
+ "data-active-item": Ut || void 0,
918
+ value: ee
919
+ }, g), {
920
+ ref: ye(x, g.ref),
921
+ onChange: Re,
921
922
  onCompositionEnd: Ee,
922
923
  onMouseDown: Dt,
923
- onKeyDown: Lt,
924
- onBlur: Tt
925
- }), C = yt(R(A({
924
+ onKeyDown: Tt,
925
+ onBlur: Rt
926
+ }), g = At(H(A({
926
927
  store: e,
927
928
  focusable: r
928
- }, C), {
929
+ }, g), {
929
930
  // Enable inline autocomplete when the user moves from the combobox input
930
931
  // to an item.
931
- moveOnKeyPress: (u) => dn(V, u) ? !1 : (y && B(!0), !0)
932
- })), C = Sn(A({ store: e }, C)), A({ autoComplete: "off" }, C);
932
+ moveOnKeyPress: (u) => mn(V, u) ? !1 : (y && j(!0), !0)
933
+ })), g = gn(A({ store: e }, g)), A({ autoComplete: "off" }, g);
933
934
  }
934
- ), vo = re(function(n) {
935
- const o = fo(n);
936
- return le(io, o);
935
+ ), po = re(function(n) {
936
+ const o = vo(n);
937
+ return le(uo, o);
937
938
  });
938
- function po(t = {}) {
939
- const n = ao(t);
940
- return /* @__PURE__ */ w(On, { value: n, children: t.children });
939
+ function bo(t = {}) {
940
+ const n = io(t);
941
+ return /* @__PURE__ */ w(yn, { value: n, children: t.children });
941
942
  }
942
- var bo = "div";
943
- function ho(t, n) {
943
+ var ho = "div";
944
+ function So(t, n) {
944
945
  if (n != null)
945
946
  return t == null ? !1 : Array.isArray(t) ? t.includes(n) : t === n;
946
947
  }
947
- function So(t) {
948
+ function go(t) {
948
949
  var n;
949
950
  return (n = {
950
951
  menu: "menuitem",
@@ -952,7 +953,7 @@ function So(t) {
952
953
  tree: "treeitem"
953
954
  }[t]) != null ? n : "option";
954
955
  }
955
- var go = ne(
956
+ var Co = ne(
956
957
  function(n) {
957
958
  var o = n, {
958
959
  store: e,
@@ -960,11 +961,11 @@ var go = ne(
960
961
  hideOnClick: l,
961
962
  setValueOnClick: a,
962
963
  selectValueOnClick: m = !0,
963
- resetValueOnSelect: f,
964
+ resetValueOnSelect: v,
964
965
  focusOnHover: c = !1,
965
966
  moveOnKeyPress: i = !0,
966
967
  getItem: s
967
- } = o, v = oe(o, [
968
+ } = o, f = oe(o, [
968
969
  "store",
969
970
  "value",
970
971
  "hideOnClick",
@@ -974,150 +975,150 @@ var go = ne(
974
975
  "focusOnHover",
975
976
  "moveOnKeyPress",
976
977
  "getItem"
977
- ]), E;
978
- const d = ht();
978
+ ]), C;
979
+ const d = St();
979
980
  e = e || d, me(
980
981
  e,
981
982
  process.env.NODE_ENV !== "production" && "ComboboxItem must be wrapped in a ComboboxList or ComboboxPopover component."
982
983
  );
983
- const { resetValueOnSelectState: p, multiSelectable: V, selected: h } = pt(e, {
984
+ const { resetValueOnSelectState: p, multiSelectable: V, selected: O } = bt(e, {
984
985
  resetValueOnSelectState: "resetValueOnSelect",
985
- multiSelectable(S) {
986
- return Array.isArray(S.selectedValue);
986
+ multiSelectable(h) {
987
+ return Array.isArray(h.selectedValue);
987
988
  },
988
- selected(S) {
989
- return ho(S.selectedValue, r);
989
+ selected(h) {
990
+ return So(h.selectedValue, r);
990
991
  }
991
- }), C = Qe(
992
- (S) => {
993
- const P = R(A({}, S), { value: r });
994
- return s ? s(P) : P;
992
+ }), g = Xe(
993
+ (h) => {
994
+ const _ = H(A({}, h), { value: r });
995
+ return s ? s(_) : _;
995
996
  },
996
997
  [r, s]
997
998
  );
998
999
  a = a ?? !V, l = l ?? (r != null && !V);
999
- const W = v.onClick, K = T(a), $ = T(m), _ = T(
1000
- (E = f ?? p) != null ? E : V
1001
- ), I = T(l), U = Q((S) => {
1002
- W == null || W(S), !S.defaultPrevented && (nt(S) || ot(S) || (r != null && ($(S) && (_(S) && (e == null || e.resetValue()), e == null || e.setSelectedValue((P) => Array.isArray(P) ? P.includes(r) ? P.filter((g) => g !== r) : [...P, r] : r)), K(S) && (e == null || e.setValue(r))), I(S) && (e == null || e.hide())));
1003
- }), b = v.onKeyDown, y = Q((S) => {
1004
- if (b == null || b(S), S.defaultPrevented) return;
1005
- const P = e == null ? void 0 : e.getState().baseElement;
1006
- if (!P || Pe(P)) return;
1007
- (S.key.length === 1 || S.key === "Backspace" || S.key === "Delete") && (queueMicrotask(() => P.focus()), vn(P) && (e == null || e.setValue(P.value)));
1000
+ const K = f.onClick, x = R(a), Z = R(m), k = R(
1001
+ (C = v ?? p) != null ? C : V
1002
+ ), P = R(l), F = Q((h) => {
1003
+ K == null || K(h), !h.defaultPrevented && (ot(h) || rt(h) || (r != null && (Z(h) && (k(h) && (e == null || e.resetValue()), e == null || e.setSelectedValue((_) => Array.isArray(_) ? _.includes(r) ? _.filter((S) => S !== r) : [..._, r] : r)), x(h) && (e == null || e.setValue(r))), P(h) && (e == null || e.hide())));
1004
+ }), b = f.onKeyDown, y = Q((h) => {
1005
+ if (b == null || b(h), h.defaultPrevented) return;
1006
+ const _ = e == null ? void 0 : e.getState().baseElement;
1007
+ if (!_ || _e(_)) return;
1008
+ (h.key.length === 1 || h.key === "Backspace" || h.key === "Delete") && (queueMicrotask(() => _.focus()), pn(_) && (e == null || e.setValue(_.value)));
1008
1009
  });
1009
- V && h != null && (v = A({
1010
- "aria-selected": h
1011
- }, v)), v = he(
1012
- v,
1013
- (S) => /* @__PURE__ */ w(yn.Provider, { value: r, children: /* @__PURE__ */ w(An.Provider, { value: h ?? !1, children: S }) }),
1014
- [r, h]
1010
+ V && O != null && (f = A({
1011
+ "aria-selected": O
1012
+ }, f)), f = he(
1013
+ f,
1014
+ (h) => /* @__PURE__ */ w(An.Provider, { value: r, children: /* @__PURE__ */ w(xn.Provider, { value: O ?? !1, children: h }) }),
1015
+ [r, O]
1015
1016
  );
1016
- const F = we(St);
1017
- v = R(A({
1018
- role: So(F),
1017
+ const B = Pe(gt);
1018
+ f = H(A({
1019
+ role: go(B),
1019
1020
  children: r
1020
- }, v), {
1021
- onClick: U,
1021
+ }, f), {
1022
+ onClick: F,
1022
1023
  onKeyDown: y
1023
1024
  });
1024
- const B = T(i);
1025
- return v = xt(R(A({
1025
+ const j = R(i);
1026
+ return f = It(H(A({
1026
1027
  store: e
1027
- }, v), {
1028
- getItem: C,
1028
+ }, f), {
1029
+ getItem: g,
1029
1030
  // Dispatch a custom event on the combobox input when moving to an item
1030
1031
  // with the keyboard so the Combobox component can enable inline
1031
1032
  // autocompletion.
1032
- moveOnKeyPress: (S) => {
1033
- if (!B(S)) return !1;
1034
- const P = new Event("combobox-item-move"), g = e == null ? void 0 : e.getState().baseElement;
1035
- return g == null || g.dispatchEvent(P), !0;
1033
+ moveOnKeyPress: (h) => {
1034
+ if (!j(h)) return !1;
1035
+ const _ = new Event("combobox-item-move"), S = e == null ? void 0 : e.getState().baseElement;
1036
+ return S == null || S.dispatchEvent(_), !0;
1036
1037
  }
1037
- })), v = At(A({ store: e, focusOnHover: c }, v)), v;
1038
+ })), f = xt(A({ store: e, focusOnHover: c }, f)), f;
1038
1039
  }
1039
- ), Co = tt(
1040
+ ), Eo = nt(
1040
1041
  re(function(n) {
1041
- const o = go(n);
1042
- return le(bo, o);
1042
+ const o = Co(n);
1043
+ return le(ho, o);
1043
1044
  })
1044
- ), Eo = "div", Oo = ne(
1045
+ ), Oo = "div", yo = ne(
1045
1046
  function(n) {
1046
1047
  var o = n, { store: e, alwaysVisible: r } = o, l = oe(o, ["store", "alwaysVisible"]);
1047
- const a = ht(!0), m = xn();
1048
+ const a = St(!0), m = In();
1048
1049
  e = e || m;
1049
- const f = !!e && e === a;
1050
+ const v = !!e && e === a;
1050
1051
  me(
1051
1052
  e,
1052
1053
  process.env.NODE_ENV !== "production" && "ComboboxList must receive a `store` prop or be wrapped in a ComboboxProvider component."
1053
1054
  );
1054
- const c = se(null), i = Ae(l.id), s = e.useState("mounted"), v = Ot(s, l.hidden, r), E = v ? R(A({}, l.style), { display: "none" }) : l.style, d = e.useState(
1055
- (_) => Array.isArray(_.selectedValue)
1056
- ), p = rt(c, "role", l.role), h = (p === "listbox" || p === "tree" || p === "grid") && d || void 0, [C, W] = de(!1), K = e.useState("contentElement");
1055
+ const c = se(null), i = Ae(l.id), s = e.useState("mounted"), f = yt(s, l.hidden, r), C = f ? H(A({}, l.style), { display: "none" }) : l.style, d = e.useState(
1056
+ (k) => Array.isArray(k.selectedValue)
1057
+ ), p = lt(c, "role", l.role), O = (p === "listbox" || p === "tree" || p === "grid") && d || void 0, [g, K] = de(!1), x = e.useState("contentElement");
1057
1058
  Ve(() => {
1058
1059
  if (!s) return;
1059
- const _ = c.current;
1060
- if (!_ || K !== _) return;
1061
- const I = () => {
1062
- W(!!_.querySelector("[role='listbox']"));
1063
- }, U = new MutationObserver(I);
1064
- return U.observe(_, {
1060
+ const k = c.current;
1061
+ if (!k || x !== k) return;
1062
+ const P = () => {
1063
+ K(!!k.querySelector("[role='listbox']"));
1064
+ }, F = new MutationObserver(P);
1065
+ return F.observe(k, {
1065
1066
  subtree: !0,
1066
1067
  childList: !0,
1067
1068
  attributeFilter: ["role"]
1068
- }), I(), () => U.disconnect();
1069
- }, [s, K]), C || (l = A({
1069
+ }), P(), () => F.disconnect();
1070
+ }, [s, x]), g || (l = A({
1070
1071
  role: "listbox",
1071
- "aria-multiselectable": h
1072
+ "aria-multiselectable": O
1072
1073
  }, l)), l = he(
1073
1074
  l,
1074
- (_) => /* @__PURE__ */ w(In, { value: e, children: /* @__PURE__ */ w(St.Provider, { value: p, children: _ }) }),
1075
+ (k) => /* @__PURE__ */ w(wn, { value: e, children: /* @__PURE__ */ w(gt.Provider, { value: p, children: k }) }),
1075
1076
  [e, p]
1076
1077
  );
1077
- const $ = i && (!a || !f) ? e.setContentElement : null;
1078
- return l = R(A({
1078
+ const Z = i && (!a || !v) ? e.setContentElement : null;
1079
+ return l = H(A({
1079
1080
  id: i,
1080
- hidden: v
1081
+ hidden: f
1081
1082
  }, l), {
1082
- ref: ye($, c, l.ref),
1083
- style: E
1084
- }), Xe(l);
1083
+ ref: ye(Z, c, l.ref),
1084
+ style: C
1085
+ }), Ge(l);
1085
1086
  }
1086
- ), yo = re(function(n) {
1087
- const o = Oo(n);
1088
- return le(Eo, o);
1087
+ ), Ao = re(function(n) {
1088
+ const o = yo(n);
1089
+ return le(Oo, o);
1089
1090
  });
1090
- const Ao = /* @__PURE__ */ new Map([
1091
+ const xo = /* @__PURE__ */ new Map([
1091
1092
  [
1092
1093
  "bold",
1093
- /* @__PURE__ */ M.createElement(M.Fragment, null, /* @__PURE__ */ M.createElement("path", { d: "M232.49,215.51,185,168a92.12,92.12,0,1,0-17,17l47.53,47.54a12,12,0,0,0,17-17ZM44,112a68,68,0,1,1,68,68A68.07,68.07,0,0,1,44,112Z" }))
1094
+ /* @__PURE__ */ N.createElement(N.Fragment, null, /* @__PURE__ */ N.createElement("path", { d: "M232.49,215.51,185,168a92.12,92.12,0,1,0-17,17l47.53,47.54a12,12,0,0,0,17-17ZM44,112a68,68,0,1,1,68,68A68.07,68.07,0,0,1,44,112Z" }))
1094
1095
  ],
1095
1096
  [
1096
1097
  "duotone",
1097
- /* @__PURE__ */ M.createElement(M.Fragment, null, /* @__PURE__ */ M.createElement("path", { d: "M192,112a80,80,0,1,1-80-80A80,80,0,0,1,192,112Z", opacity: "0.2" }), /* @__PURE__ */ M.createElement("path", { d: "M229.66,218.34,179.6,168.28a88.21,88.21,0,1,0-11.32,11.31l50.06,50.07a8,8,0,0,0,11.32-11.32ZM40,112a72,72,0,1,1,72,72A72.08,72.08,0,0,1,40,112Z" }))
1098
+ /* @__PURE__ */ N.createElement(N.Fragment, null, /* @__PURE__ */ N.createElement("path", { d: "M192,112a80,80,0,1,1-80-80A80,80,0,0,1,192,112Z", opacity: "0.2" }), /* @__PURE__ */ N.createElement("path", { d: "M229.66,218.34,179.6,168.28a88.21,88.21,0,1,0-11.32,11.31l50.06,50.07a8,8,0,0,0,11.32-11.32ZM40,112a72,72,0,1,1,72,72A72.08,72.08,0,0,1,40,112Z" }))
1098
1099
  ],
1099
1100
  [
1100
1101
  "fill",
1101
- /* @__PURE__ */ M.createElement(M.Fragment, null, /* @__PURE__ */ M.createElement("path", { d: "M168,112a56,56,0,1,1-56-56A56,56,0,0,1,168,112Zm61.66,117.66a8,8,0,0,1-11.32,0l-50.06-50.07a88,88,0,1,1,11.32-11.31l50.06,50.06A8,8,0,0,1,229.66,229.66ZM112,184a72,72,0,1,0-72-72A72.08,72.08,0,0,0,112,184Z" }))
1102
+ /* @__PURE__ */ N.createElement(N.Fragment, null, /* @__PURE__ */ N.createElement("path", { d: "M168,112a56,56,0,1,1-56-56A56,56,0,0,1,168,112Zm61.66,117.66a8,8,0,0,1-11.32,0l-50.06-50.07a88,88,0,1,1,11.32-11.31l50.06,50.06A8,8,0,0,1,229.66,229.66ZM112,184a72,72,0,1,0-72-72A72.08,72.08,0,0,0,112,184Z" }))
1102
1103
  ],
1103
1104
  [
1104
1105
  "light",
1105
- /* @__PURE__ */ M.createElement(M.Fragment, null, /* @__PURE__ */ M.createElement("path", { d: "M228.24,219.76l-51.38-51.38a86.15,86.15,0,1,0-8.48,8.48l51.38,51.38a6,6,0,0,0,8.48-8.48ZM38,112a74,74,0,1,1,74,74A74.09,74.09,0,0,1,38,112Z" }))
1106
+ /* @__PURE__ */ N.createElement(N.Fragment, null, /* @__PURE__ */ N.createElement("path", { d: "M228.24,219.76l-51.38-51.38a86.15,86.15,0,1,0-8.48,8.48l51.38,51.38a6,6,0,0,0,8.48-8.48ZM38,112a74,74,0,1,1,74,74A74.09,74.09,0,0,1,38,112Z" }))
1106
1107
  ],
1107
1108
  [
1108
1109
  "regular",
1109
- /* @__PURE__ */ M.createElement(M.Fragment, null, /* @__PURE__ */ M.createElement("path", { d: "M229.66,218.34l-50.07-50.06a88.11,88.11,0,1,0-11.31,11.31l50.06,50.07a8,8,0,0,0,11.32-11.32ZM40,112a72,72,0,1,1,72,72A72.08,72.08,0,0,1,40,112Z" }))
1110
+ /* @__PURE__ */ N.createElement(N.Fragment, null, /* @__PURE__ */ N.createElement("path", { d: "M229.66,218.34l-50.07-50.06a88.11,88.11,0,1,0-11.31,11.31l50.06,50.07a8,8,0,0,0,11.32-11.32ZM40,112a72,72,0,1,1,72,72A72.08,72.08,0,0,1,40,112Z" }))
1110
1111
  ],
1111
1112
  [
1112
1113
  "thin",
1113
- /* @__PURE__ */ M.createElement(M.Fragment, null, /* @__PURE__ */ M.createElement("path", { d: "M226.83,221.17l-52.7-52.7a84.1,84.1,0,1,0-5.66,5.66l52.7,52.7a4,4,0,0,0,5.66-5.66ZM36,112a76,76,0,1,1,76,76A76.08,76.08,0,0,1,36,112Z" }))
1114
+ /* @__PURE__ */ N.createElement(N.Fragment, null, /* @__PURE__ */ N.createElement("path", { d: "M226.83,221.17l-52.7-52.7a84.1,84.1,0,1,0-5.66,5.66l52.7,52.7a4,4,0,0,0,5.66-5.66ZM36,112a76,76,0,1,1,76,76A76.08,76.08,0,0,1,36,112Z" }))
1114
1115
  ]
1115
- ]), Vt = M.forwardRef((t, n) => /* @__PURE__ */ M.createElement($t, { ref: n, ...t, weights: Ao }));
1116
+ ]), Vt = N.forwardRef((t, n) => /* @__PURE__ */ N.createElement(qt, { ref: n, ...t, weights: xo }));
1116
1117
  Vt.displayName = "MagnifyingGlassIcon";
1117
- var ge = { exports: {} }, $e;
1118
- function xo() {
1119
- if ($e) return ge.exports;
1120
- $e = 1;
1118
+ var ge = { exports: {} }, qe;
1119
+ function Io() {
1120
+ if (qe) return ge.exports;
1121
+ qe = 1;
1121
1122
  var t = {
1122
1123
  À: "A",
1123
1124
  Á: "A",
@@ -1589,15 +1590,15 @@ function xo() {
1589
1590
  };
1590
1591
  return ge.exports = l, ge.exports.has = a, ge.exports.remove = l, ge.exports;
1591
1592
  }
1592
- var Io = xo();
1593
- const wo = /* @__PURE__ */ qt(Io);
1593
+ var wo = Io();
1594
+ const Po = /* @__PURE__ */ Yt(wo);
1594
1595
  /**
1595
1596
  * @name match-sorter
1596
1597
  * @license MIT license.
1597
1598
  * @copyright (c) 2020 Kent C. Dodds
1598
1599
  * @author Kent C. Dodds <me@kentcdodds.com> (https://kentcdodds.com)
1599
1600
  */
1600
- const j = {
1601
+ const W = {
1601
1602
  CASE_SENSITIVE_EQUAL: 7,
1602
1603
  EQUAL: 6,
1603
1604
  STARTS_WITH: 5,
@@ -1607,76 +1608,76 @@ const j = {
1607
1608
  MATCHES: 1,
1608
1609
  NO_MATCH: 0
1609
1610
  }, Vo = (t, n) => String(t.rankedValue).localeCompare(String(n.rankedValue));
1610
- function Pt(t, n, o) {
1611
+ function _t(t, n, o) {
1611
1612
  o === void 0 && (o = {});
1612
1613
  const {
1613
1614
  keys: e,
1614
- threshold: r = j.MATCHES,
1615
+ threshold: r = W.MATCHES,
1615
1616
  baseSort: l = Vo,
1616
- sorter: a = (c) => c.sort((i, s) => Mo(i, s, l))
1617
- } = o, m = t.reduce(f, []);
1617
+ sorter: a = (c) => c.sort((i, s) => No(i, s, l))
1618
+ } = o, m = t.reduce(v, []);
1618
1619
  return a(m).map((c) => {
1619
1620
  let {
1620
1621
  item: i
1621
1622
  } = c;
1622
1623
  return i;
1623
1624
  });
1624
- function f(c, i, s) {
1625
- const v = Po(i, e, n, o), {
1626
- rank: E,
1625
+ function v(c, i, s) {
1626
+ const f = _o(i, e, n, o), {
1627
+ rank: C,
1627
1628
  keyThreshold: d = r
1628
- } = v;
1629
- return E >= d && c.push({
1630
- ...v,
1629
+ } = f;
1630
+ return C >= d && c.push({
1631
+ ...f,
1631
1632
  item: i,
1632
1633
  index: s
1633
1634
  }), c;
1634
1635
  }
1635
1636
  }
1636
- Pt.rankings = j;
1637
- function Po(t, n, o, e) {
1637
+ _t.rankings = W;
1638
+ function _o(t, n, o, e) {
1638
1639
  if (!n) {
1639
1640
  const l = t;
1640
1641
  return {
1641
1642
  // ends up being duplicate of 'item' in matches but consistent
1642
1643
  rankedValue: l,
1643
- rank: qe(l, o, e),
1644
+ rank: Ye(l, o, e),
1644
1645
  keyIndex: -1,
1645
1646
  keyThreshold: e.threshold
1646
1647
  };
1647
1648
  }
1648
- return Lo(t, n).reduce((l, a, m) => {
1649
+ return To(t, n).reduce((l, a, m) => {
1649
1650
  let {
1650
- rank: f,
1651
+ rank: v,
1651
1652
  rankedValue: c,
1652
1653
  keyIndex: i,
1653
1654
  keyThreshold: s
1654
1655
  } = l, {
1655
- itemValue: v,
1656
- attributes: E
1657
- } = a, d = qe(v, o, e), p = c;
1656
+ itemValue: f,
1657
+ attributes: C
1658
+ } = a, d = Ye(f, o, e), p = c;
1658
1659
  const {
1659
1660
  minRanking: V,
1660
- maxRanking: h,
1661
- threshold: C
1662
- } = E;
1663
- return d < V && d >= j.MATCHES ? d = V : d > h && (d = h), d > f && (f = d, i = m, s = C, p = v), {
1661
+ maxRanking: O,
1662
+ threshold: g
1663
+ } = C;
1664
+ return d < V && d >= W.MATCHES ? d = V : d > O && (d = O), d > v && (v = d, i = m, s = g, p = f), {
1664
1665
  rankedValue: p,
1665
- rank: f,
1666
+ rank: v,
1666
1667
  keyIndex: i,
1667
1668
  keyThreshold: s
1668
1669
  };
1669
1670
  }, {
1670
1671
  rankedValue: t,
1671
- rank: j.NO_MATCH,
1672
+ rank: W.NO_MATCH,
1672
1673
  keyIndex: -1,
1673
1674
  keyThreshold: e.threshold
1674
1675
  });
1675
1676
  }
1676
- function qe(t, n, o) {
1677
- return t = Ye(t, o), n = Ye(n, o), n.length > t.length ? j.NO_MATCH : t === n ? j.CASE_SENSITIVE_EQUAL : (t = t.toLowerCase(), n = n.toLowerCase(), t === n ? j.EQUAL : t.startsWith(n) ? j.STARTS_WITH : t.includes(` ${n}`) ? j.WORD_STARTS_WITH : t.includes(n) ? j.CONTAINS : n.length === 1 ? j.NO_MATCH : _o(t).includes(n) ? j.ACRONYM : ko(t, n));
1677
+ function Ye(t, n, o) {
1678
+ return t = ze(t, o), n = ze(n, o), n.length > t.length ? W.NO_MATCH : t === n ? W.CASE_SENSITIVE_EQUAL : (t = t.toLowerCase(), n = n.toLowerCase(), t === n ? W.EQUAL : t.startsWith(n) ? W.STARTS_WITH : t.includes(` ${n}`) ? W.WORD_STARTS_WITH : t.includes(n) ? W.CONTAINS : n.length === 1 ? W.NO_MATCH : ko(t).includes(n) ? W.ACRONYM : Mo(t, n));
1678
1679
  }
1679
- function _o(t) {
1680
+ function ko(t) {
1680
1681
  let n = "";
1681
1682
  return t.split(" ").forEach((e) => {
1682
1683
  e.split("-").forEach((l) => {
@@ -1684,45 +1685,45 @@ function _o(t) {
1684
1685
  });
1685
1686
  }), n;
1686
1687
  }
1687
- function ko(t, n) {
1688
+ function Mo(t, n) {
1688
1689
  let o = 0, e = 0;
1689
- function r(f, c, i) {
1690
- for (let s = i, v = c.length; s < v; s++)
1691
- if (c[s] === f)
1690
+ function r(v, c, i) {
1691
+ for (let s = i, f = c.length; s < f; s++)
1692
+ if (c[s] === v)
1692
1693
  return o += 1, s + 1;
1693
1694
  return -1;
1694
1695
  }
1695
- function l(f) {
1696
- const c = 1 / f, i = o / n.length;
1697
- return j.MATCHES + i * c;
1696
+ function l(v) {
1697
+ const c = 1 / v, i = o / n.length;
1698
+ return W.MATCHES + i * c;
1698
1699
  }
1699
1700
  const a = r(n[0], t, 0);
1700
1701
  if (a < 0)
1701
- return j.NO_MATCH;
1702
+ return W.NO_MATCH;
1702
1703
  e = a;
1703
- for (let f = 1, c = n.length; f < c; f++) {
1704
- const i = n[f];
1704
+ for (let v = 1, c = n.length; v < c; v++) {
1705
+ const i = n[v];
1705
1706
  if (e = r(i, t, e), !(e > -1))
1706
- return j.NO_MATCH;
1707
+ return W.NO_MATCH;
1707
1708
  }
1708
1709
  const m = e - a;
1709
1710
  return l(m);
1710
1711
  }
1711
- function Mo(t, n, o) {
1712
+ function No(t, n, o) {
1712
1713
  const {
1713
1714
  rank: l,
1714
1715
  keyIndex: a
1715
1716
  } = t, {
1716
1717
  rank: m,
1717
- keyIndex: f
1718
+ keyIndex: v
1718
1719
  } = n;
1719
- return l === m ? a === f ? o(t, n) : a < f ? -1 : 1 : l > m ? -1 : 1;
1720
+ return l === m ? a === v ? o(t, n) : a < v ? -1 : 1 : l > m ? -1 : 1;
1720
1721
  }
1721
- function Ye(t, n) {
1722
+ function ze(t, n) {
1722
1723
  let {
1723
1724
  keepDiacritics: o
1724
1725
  } = n;
1725
- return t = `${t}`, o || (t = wo(t)), t;
1726
+ return t = `${t}`, o || (t = Po(t)), t;
1726
1727
  }
1727
1728
  function Do(t, n) {
1728
1729
  typeof n == "object" && (n = n.key);
@@ -1735,19 +1736,19 @@ function Do(t, n) {
1735
1736
  o = t[n];
1736
1737
  else {
1737
1738
  if (n.includes("."))
1738
- return No(n, t);
1739
+ return Lo(n, t);
1739
1740
  o = null;
1740
1741
  }
1741
1742
  return o == null ? [] : Array.isArray(o) ? o : [String(o)];
1742
1743
  }
1743
- function No(t, n) {
1744
+ function Lo(t, n) {
1744
1745
  const o = t.split(".");
1745
1746
  let e = [n];
1746
1747
  for (let r = 0, l = o.length; r < l; r++) {
1747
1748
  const a = o[r];
1748
1749
  let m = [];
1749
- for (let f = 0, c = e.length; f < c; f++) {
1750
- const i = e[f];
1750
+ for (let v = 0, c = e.length; v < c; v++) {
1751
+ const i = e[v];
1751
1752
  if (i != null)
1752
1753
  if (Object.hasOwnProperty.call(i, a)) {
1753
1754
  const s = i[a];
@@ -1758,75 +1759,79 @@ function No(t, n) {
1758
1759
  }
1759
1760
  return Array.isArray(e[0]) ? [].concat(...e) : e;
1760
1761
  }
1761
- function Lo(t, n) {
1762
+ function To(t, n) {
1762
1763
  const o = [];
1763
1764
  for (let e = 0, r = n.length; e < r; e++) {
1764
- const l = n[e], a = To(l), m = Do(t, l);
1765
- for (let f = 0, c = m.length; f < c; f++)
1765
+ const l = n[e], a = Ro(l), m = Do(t, l);
1766
+ for (let v = 0, c = m.length; v < c; v++)
1766
1767
  o.push({
1767
- itemValue: m[f],
1768
+ itemValue: m[v],
1768
1769
  attributes: a
1769
1770
  });
1770
1771
  }
1771
1772
  return o;
1772
1773
  }
1773
- const ze = {
1774
+ const Qe = {
1774
1775
  maxRanking: 1 / 0,
1775
1776
  minRanking: -1 / 0
1776
1777
  };
1777
- function To(t) {
1778
- return typeof t == "string" ? ze : {
1779
- ...ze,
1778
+ function Ro(t) {
1779
+ return typeof t == "string" ? Qe : {
1780
+ ...Qe,
1780
1781
  ...t
1781
1782
  };
1782
1783
  }
1783
- function ir(t) {
1784
- var V;
1785
- const { baseProps: n, controlProps: o } = zt(t, {
1784
+ function cr(t) {
1785
+ var K;
1786
+ const { baseProps: n, controlProps: o } = Qt(t, {
1786
1787
  className: "component-select-control"
1787
- }), [e, r] = de(""), {
1788
- value: l,
1789
- onChangeValue: a = jt,
1790
- options: m,
1791
- placeholder: f = "Choose an option...",
1792
- searchable: c = !1,
1793
- ...i
1794
- } = o, s = (m || []).map(Ft), v = Ce(() => Pt(s, e, {
1795
- baseSort: (h, C) => h.index < C.index ? -1 : 1,
1788
+ }), { prefix: e, suffix: r, ...l } = n, [a, m] = de(""), {
1789
+ value: v,
1790
+ onChangeValue: c = Wt,
1791
+ options: i,
1792
+ placeholder: s = "Choose an option...",
1793
+ searchable: f = !1,
1794
+ ...C
1795
+ } = o, d = (i || []).map(Bt), p = Ce(() => _t(d, a, {
1796
+ baseSort: (x, Z) => x.index < Z.index ? -1 : 1,
1796
1797
  keys: ["label", "description"]
1797
- }), [e]), E = c ? yo : Qn, d = ((V = s.find((h) => h.value === l)) == null ? void 0 : V.label) || f;
1798
+ }), [a]), V = f ? Ao : Xn, O = ((K = d.find((x) => x.value === v)) == null ? void 0 : K.label) || s;
1798
1799
  return /* @__PURE__ */ w(
1799
- po,
1800
+ bo,
1800
1801
  {
1801
1802
  resetValueOnHide: !0,
1802
- setValue: (h) => {
1803
- Zt(() => {
1804
- r(h);
1803
+ setValue: (x) => {
1804
+ $t(() => {
1805
+ m(x);
1805
1806
  });
1806
1807
  },
1807
- children: /* @__PURE__ */ w(Wn, { value: l, setValue: a, children: /* @__PURE__ */ te(Yt, { ...n, children: [
1808
- /* @__PURE__ */ te(
1809
- jn,
1808
+ children: /* @__PURE__ */ w(Zn, { value: v, setValue: c, children: /* @__PURE__ */ X(zt, { ...l, children: [
1809
+ /* @__PURE__ */ X(
1810
+ Wn,
1810
1811
  {
1811
1812
  className: "component-select-control__input",
1812
- ...i,
1813
+ ...C,
1813
1814
  children: [
1814
1815
  /* @__PURE__ */ w(
1815
1816
  "div",
1816
1817
  {
1817
- className: Bt(
1818
+ className: jt(
1818
1819
  "component-select-control__value",
1819
- d === f && "component-select-control__value--placeholder"
1820
+ O === s && "component-select-control__value--placeholder"
1820
1821
  ),
1821
- children: /* @__PURE__ */ w(eo, { fallback: f, children: () => d })
1822
+ children: /* @__PURE__ */ w(to, { fallback: s, children: () => /* @__PURE__ */ X(we, { children: [
1823
+ /* @__PURE__ */ w(Fe, { children: e }),
1824
+ /* @__PURE__ */ w("span", { className: "component-select-control__value__label", children: O }),
1825
+ /* @__PURE__ */ w(Fe, { suffix: !0, children: r })
1826
+ ] }) })
1822
1827
  }
1823
1828
  ),
1824
- /* @__PURE__ */ w("div", { className: "component-select-control__caret", children: /* @__PURE__ */ w(Wt, {}) })
1829
+ /* @__PURE__ */ w("div", { className: "component-select-control__caret", children: /* @__PURE__ */ w(Zt, {}) })
1825
1830
  ]
1826
1831
  }
1827
1832
  ),
1828
- /* @__PURE__ */ te(
1829
- Jn,
1833
+ /* @__PURE__ */ X(
1834
+ eo,
1830
1835
  {
1831
1836
  className: "component-select-control__popover",
1832
1837
  "data-colour-scheme": "invert",
@@ -1839,16 +1844,16 @@ function ir(t) {
1839
1844
  shift: -1,
1840
1845
  portal: !0,
1841
1846
  children: [
1842
- /* @__PURE__ */ te(
1847
+ /* @__PURE__ */ X(
1843
1848
  "div",
1844
1849
  {
1845
1850
  className: "component-select-control__popover__search-wrapper",
1846
- inert: !c,
1847
- hidden: !c,
1851
+ inert: !f,
1852
+ hidden: !f,
1848
1853
  children: [
1849
1854
  /* @__PURE__ */ w(Vt, { className: "component-select-control__popover__search-icon" }),
1850
1855
  /* @__PURE__ */ w(
1851
- vo,
1856
+ po,
1852
1857
  {
1853
1858
  autoSelect: !0,
1854
1859
  placeholder: "Search...",
@@ -1858,22 +1863,22 @@ function ir(t) {
1858
1863
  ]
1859
1864
  }
1860
1865
  ),
1861
- /* @__PURE__ */ w(E, { className: "component-select-control__list", children: v.map((h) => /* @__PURE__ */ te(
1862
- Yn,
1866
+ /* @__PURE__ */ w(V, { className: "component-select-control__list", children: p.map((x) => /* @__PURE__ */ X(
1867
+ zn,
1863
1868
  {
1864
- disabled: h.disabled,
1865
- value: h.value,
1869
+ disabled: x.disabled,
1870
+ value: x.value,
1866
1871
  className: "component-select-control__option",
1867
- render: /* @__PURE__ */ w(Co, {}),
1872
+ render: /* @__PURE__ */ w(Eo, {}),
1868
1873
  children: [
1869
- /* @__PURE__ */ te("div", { className: "component-select-control__option__label", children: [
1870
- h.icon,
1871
- h.label
1874
+ /* @__PURE__ */ X("div", { className: "component-select-control__option__label", children: [
1875
+ x.icon,
1876
+ x.label
1872
1877
  ] }),
1873
- h.description && /* @__PURE__ */ w("div", { className: "component-select-control__option__description", children: h.description })
1878
+ x.description && /* @__PURE__ */ w("div", { className: "component-select-control__option__description", children: x.description })
1874
1879
  ]
1875
1880
  },
1876
- h.value
1881
+ x.value
1877
1882
  )) })
1878
1883
  ]
1879
1884
  }
@@ -1883,5 +1888,5 @@ function ir(t) {
1883
1888
  );
1884
1889
  }
1885
1890
  export {
1886
- ir as SelectControl
1891
+ cr as SelectControl
1887
1892
  };