@keycloak/keycloak-ui-shared 25.0.2 → 25.0.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,18 +1,18 @@
1
- import { jsxs as v, jsx as t, Fragment as Y } from "react/jsx-runtime";
2
- import { AlertGroup as tt, Alert as nt, AlertVariant as re, AlertActionCloseButton as rt, Page as lt, Modal as Pe, ModalVariant as at, Button as R, TextContent as it, Text as ae, TextVariants as st, Spinner as ot, FormHelperText as ue, HelperText as he, HelperTextItem as me, Popover as ct, Icon as ie, FormGroup as Ve, NumberInput as dt, ValidatedOptions as M, InputGroup as pe, InputGroupItem as se, TextInput as Q, Select as X, MenuToggle as W, MenuToggleStatus as fe, SelectList as Z, SelectOption as ge, TextInputGroup as Me, TextInputGroupMain as Ne, ChipGroup as qe, Chip as Be, TextInputGroupUtilities as Le, Switch as ut, TextArea as _e, Title as ht, Card as mt, CardHeader as pt, CardTitle as ft, CardBody as gt, Grid as yt, GridItem as xe, PageSection as vt, JumpLinks as bt, JumpLinksItem as Ct, ButtonVariant as we, Checkbox as It, Radio as kt, MenuFooter as xt, Dropdown as wt, DropdownList as At, DropdownItem as Ae, Brand as Tt, Avatar as St } from "@patternfly/react-core";
3
- import { createContext as ye, useContext as ve, useState as T, useCallback as He, useEffect as be, useMemo as P, useRef as ee, forwardRef as Ot, useId as Ft, Fragment as Ue, Children as $e } from "react";
1
+ import { jsxs as b, jsx as t, Fragment as Y } from "react/jsx-runtime";
2
+ import { AlertGroup as tt, Alert as nt, AlertVariant as re, AlertActionCloseButton as rt, Page as at, Modal as De, ModalVariant as lt, Button as P, TextContent as it, Text as le, TextVariants as st, Spinner as ot, FormHelperText as ue, HelperText as he, HelperTextItem as me, Popover as ct, Icon as ie, FormGroup as Ve, NumberInput as dt, ValidatedOptions as M, InputGroup as pe, InputGroupItem as se, TextInput as Q, Select as X, MenuToggle as K, MenuToggleStatus as fe, SelectList as Z, SelectOption as ge, TextInputGroup as Me, TextInputGroupMain as Ne, ChipGroup as Le, Chip as qe, TextInputGroupUtilities as Be, Switch as ut, TextArea as _e, Title as ht, Card as mt, CardHeader as pt, CardTitle as ft, CardBody as gt, Grid as yt, GridItem as xe, PageSection as vt, JumpLinks as bt, JumpLinksItem as Ct, ButtonVariant as we, Checkbox as It, Radio as kt, MenuFooter as xt, Dropdown as wt, DropdownList as At, DropdownItem as Ae, Brand as Tt, Avatar as St } from "@patternfly/react-core";
3
+ import { createContext as ye, useContext as ve, useState as S, useCallback as He, useEffect as be, useMemo as D, useRef as ee, forwardRef as Ot, useId as Ft, Fragment as Ue, Children as $e } from "react";
4
4
  import { useTranslation as Ce } from "react-i18next";
5
- import Et from "keycloak-js";
6
- import { ExclamationCircleIcon as Rt, HelpIcon as Te, EyeIcon as Dt, EyeSlashIcon as Pt, TimesIcon as Ge, CubeIcon as Vt, PaypalIcon as Mt, InstagramIcon as Nt, BitbucketIcon as qt, MicrosoftIcon as Bt, TwitterIcon as Lt, StackOverflowIcon as _t, OpenshiftIcon as Ht, LinkedinIcon as Ut, GoogleIcon as $t, GitlabIcon as Gt, FacebookSquareIcon as Wt, GithubIcon as Kt, MinusCircleIcon as jt, PlusCircleIcon as zt, EllipsisVIcon as Jt } from "@patternfly/react-icons";
5
+ import Rt from "keycloak-js";
6
+ import { ExclamationCircleIcon as Et, HelpIcon as Te, EyeIcon as Pt, EyeSlashIcon as Dt, TimesIcon as Ge, CubeIcon as Vt, PaypalIcon as Mt, InstagramIcon as Nt, BitbucketIcon as Lt, MicrosoftIcon as qt, TwitterIcon as Bt, StackOverflowIcon as _t, OpenshiftIcon as Ht, LinkedinIcon as Ut, GoogleIcon as $t, GitlabIcon as Gt, FacebookSquareIcon as Kt, GithubIcon as Wt, MinusCircleIcon as jt, PlusCircleIcon as zt, EllipsisVIcon as Jt } from "@patternfly/react-icons";
7
7
  import { useFormContext as te, Controller as U, useController as Ie, FormProvider as Yt, useWatch as Qt } from "react-hook-form";
8
8
  import { get as G } from "lodash-es";
9
- import { PageHeader as Xt, PageHeaderTools as Zt, PageHeaderToolsGroup as en, PageHeaderToolsItem as le } from "@patternfly/react-core/deprecated";
9
+ import { PageHeader as Xt, PageHeaderTools as Zt, PageHeaderToolsGroup as en, PageHeaderToolsItem as ae } from "@patternfly/react-core/deprecated";
10
10
  import j from "@patternfly/react-styles/css/components/Avatar/avatar";
11
11
  import { css as tn } from "@patternfly/react-styles";
12
- import './main.css';const We = ye(void 0), rr = () => ve(We), nn = ({ children: e }) => {
13
- const [n, r] = T([]), l = (s) => {
12
+ import './main.css';const Ke = ye(void 0), ar = () => ve(Ke), nn = ({ children: e }) => {
13
+ const [n, r] = S([]), a = (s) => {
14
14
  r((c) => c.filter((o) => o.id !== s));
15
- }, a = (s, c = re.success, o) => {
15
+ }, l = (s, c = re.success, o) => {
16
16
  r([
17
17
  {
18
18
  id: Math.random() * 100,
@@ -23,10 +23,10 @@ import './main.css';const We = ye(void 0), rr = () => ve(We), nn = ({ children:
23
23
  ...n
24
24
  ]);
25
25
  }, i = (s) => {
26
- a(s, re.danger);
26
+ l(s, re.danger);
27
27
  };
28
- return /* @__PURE__ */ v(We.Provider, { value: { addAlert: a, addError: i }, children: [
29
- /* @__PURE__ */ t(tt, { isToast: !0, "data-testid": "alerts", children: n.map(({ id: s, variant: c, message: o, description: d }) => /* @__PURE__ */ t(
28
+ return /* @__PURE__ */ b(Ke.Provider, { value: { addAlert: l, addError: i }, children: [
29
+ /* @__PURE__ */ t(tt, { isToast: !0, "data-testid": "alerts", children: n.map(({ id: s, variant: c, message: o, description: m }) => /* @__PURE__ */ t(
30
30
  nt,
31
31
  {
32
32
  isLiveRegion: !0,
@@ -37,44 +37,44 @@ import './main.css';const We = ye(void 0), rr = () => ve(We), nn = ({ children:
37
37
  rt,
38
38
  {
39
39
  title: o,
40
- onClose: () => l(s)
40
+ onClose: () => a(s)
41
41
  }
42
42
  ),
43
43
  timeout: !0,
44
- onTimeout: () => l(s),
45
- children: d && /* @__PURE__ */ t("p", { children: d })
44
+ onTimeout: () => a(s),
45
+ children: m && /* @__PURE__ */ t("p", { children: m })
46
46
  },
47
47
  s
48
48
  )) }),
49
49
  e
50
50
  ] });
51
51
  }, rn = (e) => {
52
- const { t: n } = Ce(), r = e.error, l = ln(r);
53
- function a() {
52
+ const { t: n } = Ce(), r = e.error, a = an(r);
53
+ function l() {
54
54
  location.href = location.origin + location.pathname;
55
55
  }
56
- return /* @__PURE__ */ t(lt, { children: /* @__PURE__ */ t(
57
- Pe,
56
+ return /* @__PURE__ */ t(at, { children: /* @__PURE__ */ t(
57
+ De,
58
58
  {
59
- variant: at.small,
59
+ variant: lt.small,
60
60
  title: n("somethingWentWrong"),
61
61
  titleIconVariant: "danger",
62
62
  showClose: !1,
63
63
  isOpen: !0,
64
64
  actions: [
65
- /* @__PURE__ */ t(R, { variant: "primary", onClick: a, children: n("tryAgain") }, "tryAgain")
65
+ /* @__PURE__ */ t(P, { variant: "primary", onClick: l, children: n("tryAgain") }, "tryAgain")
66
66
  ],
67
- children: /* @__PURE__ */ v(it, { children: [
68
- /* @__PURE__ */ t(ae, { children: n("somethingWentWrongDescription") }),
69
- l && /* @__PURE__ */ t(ae, { component: st.small, children: l })
67
+ children: /* @__PURE__ */ b(it, { children: [
68
+ /* @__PURE__ */ t(le, { children: n("somethingWentWrongDescription") }),
69
+ a && /* @__PURE__ */ t(le, { component: st.small, children: a })
70
70
  ] })
71
71
  }
72
72
  ) });
73
73
  };
74
- function ln(e) {
74
+ function an(e) {
75
75
  return typeof e == "string" ? e : e instanceof Error ? e.message : null;
76
76
  }
77
- function an(e, n) {
77
+ function ln(e, n) {
78
78
  const r = ye(n);
79
79
  return r.displayName = e, r;
80
80
  }
@@ -90,42 +90,42 @@ function on(e) {
90
90
  );
91
91
  }
92
92
  function cn(e, n, r) {
93
- const [l, a] = T(
93
+ const [a, l] = S(
94
94
  () => e.getItem(n) ?? r
95
95
  ), i = He((s) => {
96
- a(s), e.setItem(n, s);
96
+ l(s), e.setItem(n, s);
97
97
  }, []);
98
98
  return be(() => {
99
- a(e.getItem(n) ?? r), window.addEventListener("storage", s);
99
+ l(e.getItem(n) ?? r), window.addEventListener("storage", s);
100
100
  function s(c) {
101
- c.storageArea === e && (c.key === null || c.key === n) && a(c.newValue ?? r);
101
+ c.storageArea === e && (c.key === null || c.key === n) && l(c.newValue ?? r);
102
102
  }
103
103
  return () => window.removeEventListener("storage", s);
104
- }, [e, n]), [l, i];
104
+ }, [e, n]), [a, i];
105
105
  }
106
106
  function dn(e, n, r) {
107
- const l = P(
107
+ const a = D(
108
108
  () => JSON.stringify(r),
109
109
  [r]
110
- ), [a, i] = cn(
110
+ ), [l, i] = cn(
111
111
  e,
112
112
  n,
113
- l
114
- ), s = P(() => JSON.parse(a), [a]), c = He(
113
+ a
114
+ ), s = D(() => JSON.parse(l), [l]), c = He(
115
115
  (o) => i(JSON.stringify(o)),
116
116
  []
117
117
  );
118
118
  return [s, c];
119
119
  }
120
- const Ke = an(
120
+ const We = ln(
121
121
  "HelpContext",
122
122
  void 0
123
- ), un = () => on(Ke), hn = ({ children: e }) => {
123
+ ), un = () => on(We), hn = ({ children: e }) => {
124
124
  const [n, r] = dn(localStorage, "helpEnabled", !0);
125
- function l() {
125
+ function a() {
126
126
  r(!n);
127
127
  }
128
- return /* @__PURE__ */ t(Ke.Provider, { value: { enabled: n, toggleHelp: l }, children: e });
128
+ return /* @__PURE__ */ t(We.Provider, { value: { enabled: n, toggleHelp: a }, children: e });
129
129
  }, mn = () => ye(void 0);
130
130
  let oe;
131
131
  const lr = () => {
@@ -135,13 +135,13 @@ const lr = () => {
135
135
  "no environment provider in the hierarchy make sure to add the provider"
136
136
  );
137
137
  return e;
138
- }, ar = ({
138
+ }, ir = ({
139
139
  environment: e,
140
140
  children: n
141
141
  }) => {
142
142
  oe = mn();
143
- const r = ee(!1), [l, a] = T(!1), [i, s] = T(), c = P(() => {
144
- const o = new Et({
143
+ const r = ee(!1), [a, l] = S(!1), [i, s] = S(), c = D(() => {
144
+ const o = new Rt({
145
145
  url: e.serverBaseUrl,
146
146
  realm: e.realm,
147
147
  clientId: e.clientId
@@ -155,10 +155,10 @@ const lr = () => {
155
155
  onLoad: "check-sso",
156
156
  pkceMethod: "S256",
157
157
  responseMode: "query"
158
- }).then(() => a(!0)).catch((d) => s(d)), r.current = !0;
159
- }, [c]), i ? /* @__PURE__ */ t(rn, { error: i }) : l ? /* @__PURE__ */ t(oe.Provider, { value: { environment: e, keycloak: c }, children: /* @__PURE__ */ t(nn, { children: /* @__PURE__ */ t(hn, { children: n }) }) }) : /* @__PURE__ */ t(ot, {});
158
+ }).then(() => l(!0)).catch((m) => s(m)), r.current = !0;
159
+ }, [c]), i ? /* @__PURE__ */ t(rn, { error: i }) : a ? /* @__PURE__ */ t(oe.Provider, { value: { environment: e, keycloak: c }, children: /* @__PURE__ */ t(nn, { children: /* @__PURE__ */ t(hn, { children: n }) }) }) : /* @__PURE__ */ t(ot, {});
160
160
  };
161
- function ir() {
161
+ function sr() {
162
162
  const n = document.getElementById("environment")?.textContent;
163
163
  if (typeof n != "string")
164
164
  throw new Error("Environment variables not found in the document.");
@@ -168,76 +168,76 @@ function ir() {
168
168
  throw new Error("Unable to parse environment variables as JSON.");
169
169
  }
170
170
  }
171
- const sr = ({
171
+ const or = ({
172
172
  modalTitle: e,
173
173
  continueLabel: n,
174
174
  cancelLabel: r,
175
- buttonTitle: l,
176
- isDisabled: a,
175
+ buttonTitle: a,
176
+ isDisabled: l,
177
177
  buttonVariant: i,
178
178
  buttonTestRole: s,
179
179
  onContinue: c,
180
- component: o = R,
181
- children: d,
182
- ...m
180
+ component: o = P,
181
+ children: m,
182
+ ...f
183
183
  }) => {
184
- const [y, h] = T(!1);
185
- return /* @__PURE__ */ v(Y, { children: [
184
+ const [h, d] = S(!1);
185
+ return /* @__PURE__ */ b(Y, { children: [
186
186
  /* @__PURE__ */ t(
187
187
  o,
188
188
  {
189
189
  variant: i,
190
- onClick: () => h(!0),
191
- isDisabled: a,
190
+ onClick: () => d(!0),
191
+ isDisabled: l,
192
192
  "data-testrole": s,
193
- children: l
193
+ children: a
194
194
  }
195
195
  ),
196
196
  /* @__PURE__ */ t(
197
- Pe,
197
+ De,
198
198
  {
199
199
  variant: "small",
200
- ...m,
200
+ ...f,
201
201
  title: e,
202
- isOpen: y,
203
- onClose: () => h(!1),
202
+ isOpen: h,
203
+ onClose: () => d(!1),
204
204
  actions: [
205
205
  /* @__PURE__ */ t(
206
- R,
206
+ P,
207
207
  {
208
208
  id: "modal-confirm",
209
209
  variant: "primary",
210
210
  onClick: () => {
211
- h(!1), c();
211
+ d(!1), c();
212
212
  },
213
213
  children: n
214
214
  },
215
215
  "confirm"
216
216
  ),
217
217
  /* @__PURE__ */ t(
218
- R,
218
+ P,
219
219
  {
220
220
  id: "modal-cancel",
221
221
  variant: "secondary",
222
- onClick: () => h(!1),
222
+ onClick: () => d(!1),
223
223
  children: r
224
224
  },
225
225
  "cancel"
226
226
  )
227
227
  ],
228
- children: d
228
+ children: m
229
229
  }
230
230
  )
231
231
  ] });
232
- }, je = ({ message: e, ...n }) => /* @__PURE__ */ t(ue, { ...n, children: /* @__PURE__ */ t(he, { children: /* @__PURE__ */ t(me, { icon: /* @__PURE__ */ t(Rt, {}), variant: "error", children: e }) }) }), ze = ({
232
+ }, je = ({ message: e, ...n }) => /* @__PURE__ */ t(ue, { ...n, children: /* @__PURE__ */ t(he, { children: /* @__PURE__ */ t(me, { icon: /* @__PURE__ */ t(Et, {}), variant: "error", children: e }) }) }), ze = ({
233
233
  helpText: e,
234
234
  fieldLabelId: n,
235
235
  noVerticalAlign: r = !0,
236
- unWrap: l = !1
236
+ unWrap: a = !1
237
237
  }) => {
238
- const { enabled: a } = un();
239
- return a ? /* @__PURE__ */ t(ct, { bodyContent: e, children: /* @__PURE__ */ v(Y, { children: [
240
- !l && /* @__PURE__ */ t(
238
+ const { enabled: l } = un();
239
+ return l ? /* @__PURE__ */ t(ct, { bodyContent: e, children: /* @__PURE__ */ b(Y, { children: [
240
+ !a && /* @__PURE__ */ t(
241
241
  "button",
242
242
  {
243
243
  "data-testid": `help-label-${n}`,
@@ -247,16 +247,21 @@ const sr = ({
247
247
  children: /* @__PURE__ */ t(ie, { isInline: r, children: /* @__PURE__ */ t(Te, {}) })
248
248
  }
249
249
  ),
250
- l && /* @__PURE__ */ t(ie, { isInline: r, children: /* @__PURE__ */ t(Te, {}) })
250
+ a && /* @__PURE__ */ t(ie, { isInline: r, children: /* @__PURE__ */ t(Te, {}) })
251
251
  ] }) }) : null;
252
- }, _ = ({
252
+ };
253
+ function pn(e) {
254
+ if (!(typeof e > "u" || e instanceof RegExp))
255
+ return typeof e == "object" ? e.value : e;
256
+ }
257
+ const _ = ({
253
258
  name: e,
254
259
  label: n,
255
260
  labelIcon: r,
256
- error: l,
257
- children: a,
261
+ error: a,
262
+ children: l,
258
263
  ...i
259
- }) => /* @__PURE__ */ v(
264
+ }) => /* @__PURE__ */ b(
260
265
  Ve,
261
266
  {
262
267
  label: n || e,
@@ -264,16 +269,16 @@ const sr = ({
264
269
  labelIcon: r ? /* @__PURE__ */ t(ze, { helpText: r, fieldLabelId: e }) : void 0,
265
270
  ...i,
266
271
  children: [
267
- a,
268
- l && /* @__PURE__ */ t(je, { "data-testid": `${e}-helper`, message: l.message })
272
+ l,
273
+ a && /* @__PURE__ */ t(je, { "data-testid": `${e}-helper`, message: a.message })
269
274
  ]
270
275
  }
271
- ), or = ({
276
+ ), cr = ({
272
277
  name: e,
273
278
  label: n,
274
279
  controller: r,
275
- labelIcon: l,
276
- ...a
280
+ labelIcon: a,
281
+ ...l
277
282
  }) => {
278
283
  const {
279
284
  control: i,
@@ -286,7 +291,7 @@ const sr = ({
286
291
  label: n,
287
292
  isRequired: r.rules?.required === !0,
288
293
  error: s[e],
289
- labelIcon: l,
294
+ labelIcon: a,
290
295
  children: /* @__PURE__ */ t(
291
296
  U,
292
297
  {
@@ -294,22 +299,24 @@ const sr = ({
294
299
  name: e,
295
300
  control: i,
296
301
  render: ({ field: c }) => {
297
- const o = !!r.rules?.required, d = r.rules?.min, m = c.value === 0 ? r.defaultValue : c.value, y = (h) => c.onChange(d ? Math.max(h, Number(d)) : h);
302
+ const o = !!r.rules?.required, m = pn(r.rules?.min), f = c.value ?? r.defaultValue, h = (d) => c.onChange(
303
+ m !== void 0 ? Math.max(d, Number(m)) : d
304
+ );
298
305
  return /* @__PURE__ */ t(
299
306
  dt,
300
307
  {
301
- ...a,
308
+ ...l,
302
309
  id: e,
303
- value: m,
310
+ value: f,
304
311
  validated: s[e] ? M.error : M.default,
305
312
  required: o,
306
- min: Number(d),
313
+ min: Number(m),
307
314
  max: Number(r.rules?.max),
308
- onPlus: () => y(m + 1),
309
- onMinus: () => y(m - 1),
310
- onChange: (h) => {
311
- const u = Number(h.currentTarget.value);
312
- y(isNaN(u) ? r.defaultValue : u);
315
+ onPlus: () => h(f + 1),
316
+ onMinus: () => h(f - 1),
317
+ onChange: (d) => {
318
+ const u = Number(d.currentTarget.value);
319
+ h(isNaN(u) ? r.defaultValue : u);
313
320
  }
314
321
  }
315
322
  );
@@ -318,53 +325,53 @@ const sr = ({
318
325
  )
319
326
  }
320
327
  );
321
- }, pn = ({
328
+ }, fn = ({
322
329
  hasReveal: e = !0,
323
330
  innerRef: n,
324
331
  ...r
325
332
  }) => {
326
- const { t: l } = Ce(), [a, i] = T(!0);
327
- return /* @__PURE__ */ v(pe, { children: [
333
+ const { t: a } = Ce(), [l, i] = S(!0);
334
+ return /* @__PURE__ */ b(pe, { children: [
328
335
  /* @__PURE__ */ t(se, { isFill: !0, children: /* @__PURE__ */ t(
329
336
  Q,
330
337
  {
331
338
  ...r,
332
- type: a ? "password" : "text",
339
+ type: l ? "password" : "text",
333
340
  ref: n
334
341
  }
335
342
  ) }),
336
343
  e && /* @__PURE__ */ t(
337
- R,
344
+ P,
338
345
  {
339
346
  variant: "control",
340
- "aria-label": l("showPassword"),
341
- onClick: () => i(!a),
342
- children: a ? /* @__PURE__ */ t(Dt, {}) : /* @__PURE__ */ t(Pt, {})
347
+ "aria-label": a("showPassword"),
348
+ onClick: () => i(!l),
349
+ children: l ? /* @__PURE__ */ t(Pt, {}) : /* @__PURE__ */ t(Dt, {})
343
350
  }
344
351
  )
345
352
  ] });
346
353
  }, Je = Ot(
347
- (e, n) => /* @__PURE__ */ t(pn, { ...e, innerRef: n })
354
+ (e, n) => /* @__PURE__ */ t(fn, { ...e, innerRef: n })
348
355
  );
349
356
  Je.displayName = "PasswordInput";
350
- const cr = (e) => {
351
- const { labelIcon: n, ...r } = e, l = !!e.rules?.required, a = e.defaultValue ?? "", { field: i, fieldState: s } = Ie({
357
+ const dr = (e) => {
358
+ const { labelIcon: n, ...r } = e, a = !!e.rules?.required, l = e.defaultValue ?? "", { field: i, fieldState: s } = Ie({
352
359
  ...e,
353
- defaultValue: a
360
+ defaultValue: l
354
361
  });
355
- return /* @__PURE__ */ v(
362
+ return /* @__PURE__ */ b(
356
363
  _,
357
364
  {
358
365
  name: e.name,
359
366
  label: e.label,
360
367
  labelIcon: n,
361
- isRequired: l,
368
+ isRequired: a,
362
369
  error: s.error,
363
370
  children: [
364
371
  /* @__PURE__ */ t(
365
372
  Je,
366
373
  {
367
- isRequired: l,
374
+ isRequired: a,
368
375
  id: e.name,
369
376
  "data-testid": e.name,
370
377
  validated: s.error ? M.error : M.default,
@@ -377,104 +384,104 @@ const cr = (e) => {
377
384
  ]
378
385
  }
379
386
  );
380
- }, fn = ({
387
+ }, gn = ({
381
388
  id: e,
382
389
  name: n,
383
390
  label: r,
384
- options: l,
385
- controller: a,
391
+ options: a,
392
+ controller: l,
386
393
  labelIcon: i,
387
394
  ...s
388
395
  }) => {
389
396
  const {
390
397
  control: c,
391
398
  formState: { errors: o }
392
- } = te(), [d, m] = T(!1);
399
+ } = te(), [m, f] = S(!1);
393
400
  return /* @__PURE__ */ t(
394
401
  _,
395
402
  {
396
403
  name: n,
397
404
  label: r,
398
- isRequired: !!a.rules?.required,
405
+ isRequired: !!l.rules?.required,
399
406
  error: G(o, n),
400
407
  labelIcon: i,
401
408
  children: /* @__PURE__ */ t(
402
409
  U,
403
410
  {
404
- ...a,
411
+ ...l,
405
412
  name: n,
406
413
  control: c,
407
- render: ({ field: { onChange: y, value: h } }) => /* @__PURE__ */ t(
414
+ render: ({ field: { onChange: h, value: d } }) => /* @__PURE__ */ t(
408
415
  X,
409
416
  {
410
417
  ...s,
411
- onClick: () => m(!d),
412
- onOpenChange: () => m(!1),
413
- selected: $(l) ? l.filter(
414
- (u) => Array.isArray(h) ? h.includes(u.key) : h === u.key
415
- ).map((u) => u.value) : h,
418
+ onClick: () => f(!m),
419
+ onOpenChange: () => f(!1),
420
+ selected: $(a) ? a.filter(
421
+ (u) => Array.isArray(d) ? d.includes(u.key) : d === u.key
422
+ ).map((u) => u.value) : d,
416
423
  toggle: (u) => /* @__PURE__ */ t(
417
- W,
424
+ K,
418
425
  {
419
426
  id: e || n.slice(n.lastIndexOf(".") + 1),
420
427
  ref: u,
421
- onClick: () => m(!d),
422
- isExpanded: d,
428
+ onClick: () => f(!m),
429
+ isExpanded: m,
423
430
  isFullWidth: !0,
424
431
  status: G(o, n) ? fe.danger : void 0,
425
432
  "aria-label": "toggle",
426
- children: $(l) ? l.find(
427
- (x) => x.key === (Array.isArray(h) ? h[0] : h)
428
- )?.value : h
433
+ children: $(a) ? a.find(
434
+ (k) => k.key === (Array.isArray(d) ? d[0] : d)
435
+ )?.value : d
429
436
  }
430
437
  ),
431
- onSelect: (u, x) => {
432
- const g = x?.toString();
433
- y(Array.isArray(h) ? [g] : g), m(!1);
438
+ onSelect: (u, k) => {
439
+ const x = k?.toString();
440
+ h(Array.isArray(d) ? [x] : x), f(!1);
434
441
  },
435
- isOpen: d,
436
- children: /* @__PURE__ */ t(Z, { children: l.map((u) => /* @__PURE__ */ t(ge, { value: B(u), children: ke(u) ? u : u.value }, B(u))) })
442
+ isOpen: m,
443
+ children: /* @__PURE__ */ t(Z, { children: a.map((u) => /* @__PURE__ */ t(ge, { value: q(u), children: ke(u) ? u : u.value }, q(u))) })
437
444
  }
438
445
  )
439
446
  }
440
447
  )
441
448
  }
442
449
  );
443
- }, z = (e) => ke(e) ? e : e.value, gn = ({
450
+ }, z = (e) => ke(e) ? e : e.value, yn = ({
444
451
  id: e,
445
452
  name: n,
446
453
  label: r,
447
- options: l,
448
- controller: a,
454
+ options: a,
455
+ controller: l,
449
456
  labelIcon: i,
450
457
  placeholderText: s,
451
458
  onFilter: c,
452
459
  variant: o,
453
- ...d
460
+ ...m
454
461
  }) => {
455
462
  const {
456
- control: m,
457
- formState: { errors: y }
458
- } = te(), [h, u] = T(!1), [x, g] = T(""), [f, w] = T(0), D = ee(), C = l.filter(
459
- (p) => z(p).toLowerCase().startsWith(x.toLowerCase())
460
- ), b = P(
461
- () => C.map((p, I) => /* @__PURE__ */ t(
463
+ control: f,
464
+ formState: { errors: h }
465
+ } = te(), [d, u] = S(!1), [k, x] = S(""), [g, y] = S(0), O = ee(), v = a.filter(
466
+ (p) => z(p).toLowerCase().startsWith(k.toLowerCase())
467
+ ), C = D(
468
+ () => v.map((p, I) => /* @__PURE__ */ t(
462
469
  ge,
463
470
  {
464
- value: B(p),
465
- isFocused: f === I,
471
+ value: q(p),
472
+ isFocused: g === I,
466
473
  children: z(p)
467
474
  },
468
- B(p)
475
+ q(p)
469
476
  )),
470
- [f, C]
471
- ), q = (p, I) => {
472
- const A = C[f];
477
+ [g, v]
478
+ ), L = (p, I) => {
479
+ const A = v[g];
473
480
  switch (u(!0), p.key) {
474
481
  case "Enter": {
475
- p.preventDefault(), o !== H.typeaheadMulti ? g(z(A)) : g(""), I.onChange(
476
- Array.isArray(I.value) ? [...I.value, B(A)] : B(A)
477
- ), u(!1), w(0);
482
+ p.preventDefault(), o !== H.typeaheadMulti ? x(z(A)) : x(""), I.onChange(
483
+ Array.isArray(I.value) ? [...I.value, q(A)] : q(A)
484
+ ), u(!1), y(0);
478
485
  break;
479
486
  }
480
487
  case "Tab":
@@ -489,8 +496,8 @@ const cr = (e) => {
489
496
  case "ArrowUp":
490
497
  case "ArrowDown": {
491
498
  p.preventDefault();
492
- let k = 0;
493
- p.key === "ArrowUp" && (f === 0 ? k = l.length - 1 : k = f - 1), p.key === "ArrowDown" && (f === l.length - 1 ? k = 0 : k = f + 1), w(k);
499
+ let w = 0;
500
+ p.key === "ArrowUp" && (g === 0 ? w = a.length - 1 : w = g - 1), p.key === "ArrowDown" && (g === a.length - 1 ? w = 0 : w = g + 1), y(w);
494
501
  break;
495
502
  }
496
503
  }
@@ -500,76 +507,76 @@ const cr = (e) => {
500
507
  {
501
508
  name: n,
502
509
  label: r,
503
- isRequired: !!a.rules?.required,
504
- error: G(y, n),
510
+ isRequired: !!l.rules?.required,
511
+ error: G(h, n),
505
512
  labelIcon: i,
506
513
  children: /* @__PURE__ */ t(
507
514
  U,
508
515
  {
509
- ...a,
516
+ ...l,
510
517
  name: n,
511
- control: m,
518
+ control: f,
512
519
  render: ({ field: p }) => /* @__PURE__ */ t(
513
520
  X,
514
521
  {
515
- ...d,
516
- onClick: () => u(!h),
522
+ ...m,
523
+ onClick: () => u(!d),
517
524
  onOpenChange: () => u(!1),
518
- selected: $(l) ? l.filter(
525
+ selected: $(a) ? a.filter(
519
526
  (I) => Array.isArray(p.value) ? p.value.includes(I.key) : p.value === I.key
520
527
  ).map((I) => I.value) : p.value,
521
528
  toggle: (I) => /* @__PURE__ */ t(
522
- W,
529
+ K,
523
530
  {
524
531
  ref: I,
525
532
  id: e || n.slice(n.lastIndexOf(".") + 1),
526
533
  variant: "typeahead",
527
- onClick: () => u(!h),
528
- isExpanded: h,
534
+ onClick: () => u(!d),
535
+ isExpanded: d,
529
536
  isFullWidth: !0,
530
- status: G(y, n) ? fe.danger : void 0,
531
- children: /* @__PURE__ */ v(Me, { isPlain: !0, children: [
537
+ status: G(h, n) ? fe.danger : void 0,
538
+ children: /* @__PURE__ */ b(Me, { isPlain: !0, children: [
532
539
  /* @__PURE__ */ t(
533
540
  Ne,
534
541
  {
535
542
  placeholder: s,
536
- value: o === H.typeahead && p.value ? $(l) ? l.find(
543
+ value: o === H.typeahead && p.value ? $(a) ? a.find(
537
544
  (A) => A.key === (Array.isArray(p.value) ? p.value[0] : p.value)
538
- )?.value : p.value : x,
539
- onClick: () => u(!h),
540
- onChange: (A, k) => {
541
- g(k), c?.(k);
545
+ )?.value : p.value : k,
546
+ onClick: () => u(!d),
547
+ onChange: (A, w) => {
548
+ x(w), c?.(w);
542
549
  },
543
- onKeyDown: (A) => q(A, p),
550
+ onKeyDown: (A) => L(A, p),
544
551
  autoComplete: "off",
545
- innerRef: D,
552
+ innerRef: O,
546
553
  role: "combobox",
547
- isExpanded: h,
554
+ isExpanded: d,
548
555
  "aria-controls": "select-typeahead-listbox",
549
- children: o === H.typeaheadMulti && Array.isArray(p.value) && /* @__PURE__ */ t(qe, { "aria-label": "Current selections", children: p.value.map(
550
- (A, k) => /* @__PURE__ */ t(
551
- Be,
556
+ children: o === H.typeaheadMulti && Array.isArray(p.value) && /* @__PURE__ */ t(Le, { "aria-label": "Current selections", children: p.value.map(
557
+ (A, w) => /* @__PURE__ */ t(
558
+ qe,
552
559
  {
553
- onClick: (S) => {
554
- S.stopPropagation(), p.onChange(
560
+ onClick: (T) => {
561
+ T.stopPropagation(), p.onChange(
555
562
  p.value.filter(
556
- (O) => O !== B(A)
563
+ (F) => F !== q(A)
557
564
  )
558
565
  );
559
566
  },
560
- children: $(l) ? l.find((S) => A === S.key)?.value : z(A)
567
+ children: $(a) ? a.find((T) => A === T.key)?.value : z(A)
561
568
  },
562
- k
569
+ w
563
570
  )
564
571
  ) })
565
572
  }
566
573
  ),
567
- /* @__PURE__ */ t(Le, { children: !!x && /* @__PURE__ */ t(
568
- R,
574
+ /* @__PURE__ */ t(Be, { children: !!k && /* @__PURE__ */ t(
575
+ P,
569
576
  {
570
577
  variant: "plain",
571
578
  onClick: () => {
572
- p.onChange(void 0), g(""), D?.current?.focus();
579
+ p.onChange(void 0), x(""), O?.current?.focus();
573
580
  },
574
581
  "aria-label": "Clear input value",
575
582
  children: /* @__PURE__ */ t(Ge, { "aria-hidden": !0 })
@@ -580,13 +587,13 @@ const cr = (e) => {
580
587
  ),
581
588
  onSelect: (I, A) => {
582
589
  I?.stopPropagation();
583
- const k = A?.toString();
584
- o === H.typeaheadMulti && Array.isArray(p.value) ? p.value.includes(k) ? p.onChange(
585
- p.value.filter((S) => S !== k)
586
- ) : p.onChange([...p.value, k]) : (p.onChange(Array.isArray(p.value) ? [k] : k), u(!1));
590
+ const w = A?.toString();
591
+ o === H.typeaheadMulti && Array.isArray(p.value) ? p.value.includes(w) ? p.onChange(
592
+ p.value.filter((T) => T !== w)
593
+ ) : p.onChange([...p.value, w]) : (p.onChange(Array.isArray(p.value) ? [w] : w), u(!1));
587
594
  },
588
- isOpen: h,
589
- children: /* @__PURE__ */ t(Z, { children: b })
595
+ isOpen: d,
596
+ children: /* @__PURE__ */ t(Z, { children: C })
590
597
  }
591
598
  )
592
599
  }
@@ -595,42 +602,42 @@ const cr = (e) => {
595
602
  );
596
603
  };
597
604
  var H = /* @__PURE__ */ ((e) => (e.single = "single", e.typeahead = "typeahead", e.typeaheadMulti = "typeaheadMulti", e))(H || {});
598
- const $ = (e) => typeof e[0] != "string", ke = (e) => typeof e == "string", B = (e) => ke(e) ? e : e.key, yn = ({
605
+ const $ = (e) => typeof e[0] != "string", ke = (e) => typeof e == "string", q = (e) => ke(e) ? e : e.key, vn = ({
599
606
  variant: e = "single",
600
607
  ...n
601
- }) => e === "single" ? /* @__PURE__ */ t(fn, { ...n }) : /* @__PURE__ */ t(gn, { ...n, variant: e }), dr = ({
608
+ }) => e === "single" ? /* @__PURE__ */ t(gn, { ...n }) : /* @__PURE__ */ t(yn, { ...n, variant: e }), ur = ({
602
609
  labelOn: e,
603
610
  stringify: n,
604
611
  defaultValue: r,
605
- labelIcon: l,
606
- ...a
612
+ labelIcon: a,
613
+ ...l
607
614
  }) => {
608
615
  const s = r ?? (n ? "false" : !1), { control: c } = te();
609
616
  return /* @__PURE__ */ t(
610
617
  _,
611
618
  {
612
619
  hasNoPaddingTop: !0,
613
- name: a.name,
614
- isRequired: a.rules?.required === !0,
615
- label: a.label,
616
- labelIcon: l,
620
+ name: l.name,
621
+ isRequired: l.rules?.required === !0,
622
+ label: l.label,
623
+ labelIcon: a,
617
624
  children: /* @__PURE__ */ t(
618
625
  U,
619
626
  {
620
627
  control: c,
621
- name: a.name,
628
+ name: l.name,
622
629
  defaultValue: s,
623
- render: ({ field: { onChange: o, value: d } }) => /* @__PURE__ */ t(
630
+ render: ({ field: { onChange: o, value: m } }) => /* @__PURE__ */ t(
624
631
  ut,
625
632
  {
626
- ...a,
627
- id: a.name,
628
- "data-testid": a.name,
633
+ ...l,
634
+ id: l.name,
635
+ "data-testid": l.name,
629
636
  label: e,
630
- isChecked: n ? d === "true" : d,
631
- onChange: (m, y) => {
632
- const h = n ? y.toString() : y;
633
- a.onChange?.(m, y), o(h);
637
+ isChecked: n ? m === "true" : m,
638
+ onChange: (f, h) => {
639
+ const d = n ? h.toString() : h;
640
+ l.onChange?.(f, h), o(d);
634
641
  }
635
642
  }
636
643
  )
@@ -638,8 +645,8 @@ const $ = (e) => typeof e[0] != "string", ke = (e) => typeof e == "string", B =
638
645
  )
639
646
  }
640
647
  );
641
- }, ur = (e) => {
642
- const n = !!e.rules?.required, r = e.defaultValue ?? "", { field: l, fieldState: a } = Ie({
648
+ }, hr = (e) => {
649
+ const n = !!e.rules?.required, r = e.defaultValue ?? "", { field: a, fieldState: l } = Ie({
643
650
  ...e,
644
651
  defaultValue: r
645
652
  });
@@ -650,60 +657,60 @@ const $ = (e) => typeof e[0] != "string", ke = (e) => typeof e == "string", B =
650
657
  label: e.label,
651
658
  labelIcon: e.labelIcon,
652
659
  name: e.name,
653
- error: a.error,
660
+ error: l.error,
654
661
  children: /* @__PURE__ */ t(
655
662
  _e,
656
663
  {
657
664
  isRequired: n,
658
665
  id: e.name,
659
666
  "data-testid": e.name,
660
- validated: a.error ? M.error : M.default,
667
+ validated: l.error ? M.error : M.default,
661
668
  isDisabled: e.isDisabled,
662
- ...l
669
+ ...a
663
670
  }
664
671
  )
665
672
  }
666
673
  );
667
- }, hr = (e) => {
668
- const { labelIcon: n, ...r } = e, l = !!e.rules?.required, a = e.defaultValue ?? "", { field: i, fieldState: s } = Ie({
674
+ }, mr = (e) => {
675
+ const { labelIcon: n, helperText: r, ...a } = e, l = !!e.rules?.required, i = e.defaultValue ?? "", { field: s, fieldState: c } = Ie({
669
676
  ...e,
670
- defaultValue: a
677
+ defaultValue: i
671
678
  });
672
- return /* @__PURE__ */ v(
679
+ return /* @__PURE__ */ b(
673
680
  _,
674
681
  {
675
682
  name: e.name,
676
683
  label: e.label,
677
684
  labelIcon: n,
678
685
  isRequired: l,
679
- error: s.error,
686
+ error: c.error,
680
687
  children: [
681
688
  /* @__PURE__ */ t(
682
689
  Q,
683
690
  {
684
691
  isRequired: l,
685
692
  id: e.name,
686
- "data-testid": e.name,
687
- validated: s.error ? M.error : M.default,
693
+ "data-testid": e["data-testid"] || e.name,
694
+ validated: c.error ? M.error : M.default,
688
695
  isDisabled: e.isDisabled,
689
- ...r,
690
- ...i
696
+ ...a,
697
+ ...s
691
698
  }
692
699
  ),
693
- e.helperText && /* @__PURE__ */ t(ue, { children: /* @__PURE__ */ t(he, { children: /* @__PURE__ */ t(me, { children: e.helperText }) }) })
700
+ r && /* @__PURE__ */ t(ue, { children: /* @__PURE__ */ t(he, { children: /* @__PURE__ */ t(me, { children: r }) }) })
694
701
  ]
695
702
  }
696
703
  );
697
- }, vn = _e, mr = ({ icon: e }) => {
698
- const n = bn(e);
704
+ }, bn = _e, pr = ({ icon: e }) => {
705
+ const n = Cn(e);
699
706
  return /* @__PURE__ */ t(ie, { size: "lg", children: /* @__PURE__ */ t(n, { alt: e }) });
700
707
  };
701
- function bn(e) {
708
+ function Cn(e) {
702
709
  switch (e) {
703
710
  case "github":
704
- return Kt;
705
- case "facebook":
706
711
  return Wt;
712
+ case "facebook":
713
+ return Kt;
707
714
  case "gitlab":
708
715
  return Gt;
709
716
  case "google":
@@ -717,11 +724,11 @@ function bn(e) {
717
724
  case "stackoverflow":
718
725
  return _t;
719
726
  case "twitter":
720
- return Lt;
721
- case "microsoft":
722
727
  return Bt;
723
- case "bitbucket":
728
+ case "microsoft":
724
729
  return qt;
730
+ case "bitbucket":
731
+ return Lt;
725
732
  case "instagram":
726
733
  return Nt;
727
734
  case "paypal":
@@ -730,76 +737,76 @@ function bn(e) {
730
737
  return Vt;
731
738
  }
732
739
  }
733
- const Cn = "_title_180i0_2", In = {
734
- title: Cn
740
+ const In = "_title_180i0_2", kn = {
741
+ title: In
735
742
  }, Ye = ({
736
743
  id: e,
737
744
  title: n,
738
745
  headingLevel: r = "h1",
739
- size: l = "xl",
740
- ...a
746
+ size: a = "xl",
747
+ ...l
741
748
  }) => /* @__PURE__ */ t(
742
749
  ht,
743
750
  {
744
751
  headingLevel: r,
745
- size: l,
746
- className: In.title,
752
+ size: a,
753
+ className: kn.title,
747
754
  id: e,
748
755
  tabIndex: 0,
749
- ...a,
756
+ ...l,
750
757
  children: n
751
758
  }
752
- ), kn = ({
759
+ ), xn = ({
753
760
  title: e,
754
761
  children: n,
755
762
  scrollId: r,
756
- className: l
763
+ className: a
757
764
  }) => {
758
- const a = Ft();
759
- return /* @__PURE__ */ v(mt, { id: a, className: l, isFlat: !0, children: [
765
+ const l = Ft();
766
+ return /* @__PURE__ */ b(mt, { id: l, className: a, isFlat: !0, children: [
760
767
  /* @__PURE__ */ t(pt, { className: "kc-form-panel__header", children: /* @__PURE__ */ t(ft, { tabIndex: 0, children: /* @__PURE__ */ t(Ye, { id: r, title: e }) }) }),
761
768
  /* @__PURE__ */ t(gt, { className: "kc-form-panel__body", children: n })
762
769
  ] });
763
- }, xn = (e) => {
764
- const { title: n, children: r, scrollId: l, ...a } = e;
765
- return /* @__PURE__ */ t("section", { ...a, style: { marginTop: "var(--pf-v5-global--spacer--lg)" }, children: /* @__PURE__ */ v(Y, { children: [
766
- /* @__PURE__ */ t(Ye, { id: l, title: n }),
770
+ }, wn = (e) => {
771
+ const { title: n, children: r, scrollId: a, ...l } = e;
772
+ return /* @__PURE__ */ t("section", { ...l, style: { marginTop: "var(--pf-v5-global--spacer--lg)" }, children: /* @__PURE__ */ b(Y, { children: [
773
+ /* @__PURE__ */ t(Ye, { id: a, title: n }),
767
774
  r
768
775
  ] }) });
769
- }, wn = "_panel_1cdve_1", An = "_sticky_1cdve_5", Se = {
770
- panel: wn,
771
- sticky: An
772
- }, Tn = "kc-main-content-page-container", Oe = (e) => e.replace(/\s+/g, "-"), Sn = ({
776
+ }, An = "_panel_1cdve_1", Tn = "_sticky_1cdve_5", Se = {
777
+ panel: An,
778
+ sticky: Tn
779
+ }, Sn = "kc-main-content-page-container", Oe = (e) => e.replace(/\s+/g, "-"), On = ({
773
780
  label: e,
774
781
  sections: n,
775
782
  borders: r = !1,
776
- ...l
783
+ ...a
777
784
  }) => {
778
- const a = P(
785
+ const l = D(
779
786
  () => n.filter(({ isHidden: i }) => !i),
780
787
  [n]
781
788
  );
782
- return /* @__PURE__ */ v(yt, { hasGutter: !0, ...l, children: [
783
- /* @__PURE__ */ t(xe, { md: 8, sm: 12, children: a.map(({ title: i, panel: s }) => {
789
+ return /* @__PURE__ */ b(yt, { hasGutter: !0, ...a, children: [
790
+ /* @__PURE__ */ t(xe, { md: 8, sm: 12, children: l.map(({ title: i, panel: s }) => {
784
791
  const c = Oe(i.toLowerCase());
785
792
  return /* @__PURE__ */ t(Ue, { children: r ? /* @__PURE__ */ t(
786
- kn,
793
+ xn,
787
794
  {
788
795
  scrollId: c,
789
796
  title: i,
790
797
  className: Se.panel,
791
798
  children: s
792
799
  }
793
- ) : /* @__PURE__ */ t(xn, { scrollId: c, title: i, children: s }) }, i);
800
+ ) : /* @__PURE__ */ t(wn, { scrollId: c, title: i, children: s }) }, i);
794
801
  }) }),
795
802
  /* @__PURE__ */ t(xe, { md: 4, sm: 12, order: { default: "-1", md: "1" }, children: /* @__PURE__ */ t(vt, { className: Se.sticky, children: /* @__PURE__ */ t(
796
803
  bt,
797
804
  {
798
805
  isVertical: !0,
799
- scrollableSelector: `#${Tn}`,
806
+ scrollableSelector: `#${Sn}`,
800
807
  label: e,
801
808
  offset: 100,
802
- children: a.map(({ title: i }) => {
809
+ children: l.map(({ title: i }) => {
803
810
  const s = Oe(i.toLowerCase());
804
811
  return (
805
812
  // note that JumpLinks currently does not work with spaces in the href
@@ -817,23 +824,23 @@ const Cn = "_title_180i0_2", In = {
817
824
  }
818
825
  ) }) })
819
826
  ] });
820
- }, On = (e, n, r) => (e.isValid || r) && (e.isDirty || n) && !e.isLoading && !e.isValidating && !e.isSubmitting, pr = ({
827
+ }, Fn = (e, n, r) => (e.isValid || r) && (e.isDirty || n) && !e.isLoading && !e.isValidating && !e.isSubmitting, fr = ({
821
828
  formState: e,
822
829
  isDisabled: n = !1,
823
830
  allowInvalid: r = !1,
824
- allowNonDirty: l = !1,
825
- children: a,
831
+ allowNonDirty: a = !1,
832
+ children: l,
826
833
  ...i
827
834
  }) => /* @__PURE__ */ t(
828
- R,
835
+ P,
829
836
  {
830
837
  variant: "primary",
831
- isDisabled: e && !On(e, l, r) || n,
838
+ isDisabled: e && !Fn(e, a, r) || n,
832
839
  ...i,
833
840
  type: "submit",
834
- children: a
841
+ children: l
835
842
  }
836
- ), Fn = (e) => {
843
+ ), Rn = (e) => {
837
844
  try {
838
845
  return new Intl.DisplayNames([e], { type: "language" }).of(e);
839
846
  } catch {
@@ -843,40 +850,40 @@ const Cn = "_title_180i0_2", In = {
843
850
  t: e,
844
851
  form: n,
845
852
  supportedLocales: r,
846
- currentLocale: l
853
+ currentLocale: a
847
854
  }) => {
848
- const a = P(
855
+ const l = D(
849
856
  () => r.map((i) => ({
850
857
  key: i,
851
- value: e(`locale_${i}`, Fn(i) ?? i)
852
- })).sort((i, s) => i.value.localeCompare(s.value, l)),
853
- [r, l, e]
858
+ value: e(`locale_${i}`, Rn(i) ?? i)
859
+ })).sort((i, s) => i.value.localeCompare(s.value, a)),
860
+ [r, a, e]
854
861
  );
855
- return a.length ? /* @__PURE__ */ t(Yt, { ...n, children: /* @__PURE__ */ t(
856
- yn,
862
+ return l.length ? /* @__PURE__ */ t(Yt, { ...n, children: /* @__PURE__ */ t(
863
+ vn,
857
864
  {
858
865
  "data-testid": "locale-select",
859
866
  name: "attributes.locale",
860
867
  label: e("selectALocale"),
861
868
  controller: { defaultValue: "" },
862
- options: a,
863
- variant: a.length >= 10 ? "typeahead" : "single"
869
+ options: l,
870
+ variant: l.length >= 10 ? "typeahead" : "single"
864
871
  }
865
872
  ) }) : null;
866
- }, Qe = (e) => e?.includes("${"), Xe = (e) => e.substring(2, e.length - 1), L = (e, n, r) => (Qe(n) ? e(Xe(n)) : n) || r, ce = (e, n) => L(e, n.displayName, n.name), Rn = ["username", "firstName", "lastName", "email"], Ze = (e) => e && Rn.includes(e), N = (e) => `${Ze(e) ? "" : "attributes."}${e?.replaceAll(
867
- ".",
868
- "🍺"
869
- )}`, fr = (e) => e.replaceAll(".", "🍺"), gr = (e) => e.replaceAll("🍺", ".");
870
- function yr(e, n, r) {
871
- (e.responseData.errors !== void 0 ? e.responseData.errors : [e.responseData]).forEach((l) => {
872
- const a = Object.assign(
873
+ }, Qe = (e) => e?.includes("${"), Xe = (e) => e.substring(2, e.length - 1), B = (e, n, r, a) => {
874
+ const l = n || r, i = Qe(l) ? Xe(l) : l, s = a ? `${a}.${i}` : i;
875
+ return e(s || "");
876
+ }, ce = (e, n) => B(e, n.displayName, n.name), Pn = ["username", "firstName", "lastName", "email"], Ze = (e) => e && Pn.includes(e), N = (e) => `${Ze(e) ? "" : "attributes."}${e?.replaceAll(".", "🍺")}`, gr = (e) => e.replaceAll(".", "🍺"), yr = (e) => e.replaceAll("🍺", ".");
877
+ function vr(e, n, r) {
878
+ (e.responseData.errors !== void 0 ? e.responseData.errors : [e.responseData]).forEach((a) => {
879
+ const l = Object.assign(
873
880
  {},
874
- l.params?.map((i) => r(Qe(i.toString()) ? Xe(i) : i))
881
+ a.params?.map((i) => r(Qe(i.toString()) ? Xe(i) : i))
875
882
  );
876
- n(N(l.field), {
877
- message: r(l.errorMessage, {
878
- ...a,
879
- defaultValue: l.errorMessage || l.field
883
+ n(N(a.field), {
884
+ message: r(a.errorMessage, {
885
+ ...l,
886
+ defaultValue: a.errorMessage || a.field
880
887
  }),
881
888
  type: "server"
882
889
  });
@@ -891,7 +898,7 @@ function ne({
891
898
  function Dn(e) {
892
899
  return e && "length" in e && "min" in e.length && typeof e.length.min == "number" ? e.length.min > 0 : !1;
893
900
  }
894
- function vr(e) {
901
+ function br(e) {
895
902
  if (typeof e != "object" || e === null || !("responseData" in e))
896
903
  return !1;
897
904
  const { responseData: n } = e;
@@ -900,20 +907,20 @@ function vr(e) {
900
907
  function Fe(e) {
901
908
  return !(typeof e != "object" || e === null || !("field" in e) || typeof e.field != "string" || !("errorMessage" in e) || typeof e.errorMessage != "string");
902
909
  }
903
- const K = ({
910
+ const W = ({
904
911
  t: e,
905
912
  form: n,
906
913
  attribute: r,
907
- renderer: l,
908
- children: a
914
+ renderer: a,
915
+ children: l
909
916
  }) => {
910
- const i = L(
917
+ const i = B(
911
918
  e,
912
919
  r.annotations?.inputHelperTextBefore
913
920
  ), {
914
921
  formState: { errors: s }
915
- } = n, c = l?.(r), o = G(s, N(r.name));
916
- return /* @__PURE__ */ v(
922
+ } = n, c = a?.(r), o = G(s, N(r.name));
923
+ return /* @__PURE__ */ b(
917
924
  Ve,
918
925
  {
919
926
  label: ce(e, r) || "",
@@ -921,10 +928,10 @@ const K = ({
921
928
  isRequired: ne(r),
922
929
  labelIcon: i ? /* @__PURE__ */ t(ze, { helpText: i, fieldLabelId: r.name }) : void 0,
923
930
  children: [
924
- c ? /* @__PURE__ */ v(pe, { children: [
925
- a,
931
+ c ? /* @__PURE__ */ b(pe, { children: [
932
+ l,
926
933
  c
927
- ] }) : a,
934
+ ] }) : l,
928
935
  o && /* @__PURE__ */ t(
929
936
  je,
930
937
  {
@@ -936,14 +943,14 @@ const K = ({
936
943
  },
937
944
  r.name
938
945
  );
939
- }, Pn = ({
946
+ }, Vn = ({
940
947
  t: e,
941
948
  form: n,
942
949
  attribute: r,
943
- renderer: l,
944
- ...a
945
- }) => /* @__PURE__ */ t(K, { t: e, form: n, attribute: r, renderer: l, children: /* @__PURE__ */ t(
946
- Vn,
950
+ renderer: a,
951
+ ...l
952
+ }) => /* @__PURE__ */ t(W, { t: e, form: n, attribute: r, renderer: a, children: /* @__PURE__ */ t(
953
+ Mn,
947
954
  {
948
955
  t: e,
949
956
  form: n,
@@ -952,57 +959,57 @@ const K = ({
952
959
  addButtonLabel: e("addMultivaluedLabel", {
953
960
  fieldLabel: ce(e, r)
954
961
  }),
955
- ...a
962
+ ...l
956
963
  }
957
- ) }), Vn = ({
964
+ ) }), Mn = ({
958
965
  t: e,
959
966
  name: n,
960
967
  inputType: r,
961
- form: l,
962
- addButtonLabel: a,
968
+ form: a,
969
+ addButtonLabel: l,
963
970
  isDisabled: i = !1,
964
971
  defaultValue: s,
965
972
  id: c,
966
973
  ...o
967
974
  }) => {
968
- const { register: d, setValue: m, control: y } = l, h = Qt({
975
+ const { register: m, setValue: f, control: h } = a, d = Qt({
969
976
  name: n,
970
- control: y,
977
+ control: h,
971
978
  defaultValue: s || ""
972
- }), u = P(() => Array.isArray(h) && h.length !== 0 ? h : s || [""], [h]), x = (C) => {
973
- w([...u.slice(0, C), ...u.slice(C + 1)]);
974
- }, g = () => {
975
- w([...u, ""]);
976
- }, f = (C, b) => {
977
- w([...u.slice(0, C), b, ...u.slice(C + 1)]);
978
- }, w = (C) => {
979
- const b = C.flatMap((q) => q);
980
- m(n, b, {
979
+ }), u = D(() => Array.isArray(d) && d.length !== 0 ? d : s || [""], [d]), k = (v) => {
980
+ y([...u.slice(0, v), ...u.slice(v + 1)]);
981
+ }, x = () => {
982
+ y([...u, ""]);
983
+ }, g = (v, C) => {
984
+ y([...u.slice(0, v), C, ...u.slice(v + 1)]);
985
+ }, y = (v) => {
986
+ const C = v.flatMap((L) => L);
987
+ f(n, C, {
981
988
  shouldDirty: !0
982
989
  });
983
- }, D = r.startsWith("html") ? r.substring(6) : "text";
990
+ }, O = r.startsWith("html") ? r.substring(6) : "text";
984
991
  return be(() => {
985
- d(n);
986
- }, [d]), /* @__PURE__ */ t("div", { id: c, children: u.map((C, b) => /* @__PURE__ */ v(Ue, { children: [
987
- /* @__PURE__ */ v(pe, { children: [
992
+ m(n);
993
+ }, [m]), /* @__PURE__ */ t("div", { id: c, children: u.map((v, C) => /* @__PURE__ */ b(Ue, { children: [
994
+ /* @__PURE__ */ b(pe, { children: [
988
995
  /* @__PURE__ */ t(se, { isFill: !0, children: /* @__PURE__ */ t(
989
996
  Q,
990
997
  {
991
- "data-testid": n + b,
992
- onChange: (q, p) => f(b, p),
993
- name: `${n}.${b}.value`,
994
- value: C,
998
+ "data-testid": n + C,
999
+ onChange: (L, p) => g(C, p),
1000
+ name: `${n}.${C}.value`,
1001
+ value: v,
995
1002
  isDisabled: i,
996
- type: D,
1003
+ type: O,
997
1004
  ...o
998
1005
  }
999
1006
  ) }),
1000
1007
  /* @__PURE__ */ t(se, { children: /* @__PURE__ */ t(
1001
- R,
1008
+ P,
1002
1009
  {
1003
- "data-testid": "remove" + b,
1010
+ "data-testid": "remove" + C,
1004
1011
  variant: we.link,
1005
- onClick: () => x(b),
1012
+ onClick: () => k(C),
1006
1013
  tabIndex: -1,
1007
1014
  "aria-label": e("remove"),
1008
1015
  isDisabled: u.length === 1 || i,
@@ -1010,136 +1017,136 @@ const K = ({
1010
1017
  }
1011
1018
  ) })
1012
1019
  ] }),
1013
- b === u.length - 1 && /* @__PURE__ */ v(
1014
- R,
1020
+ C === u.length - 1 && /* @__PURE__ */ b(
1021
+ P,
1015
1022
  {
1016
1023
  variant: we.link,
1017
- onClick: g,
1024
+ onClick: x,
1018
1025
  tabIndex: -1,
1019
1026
  "aria-label": e("add"),
1020
1027
  "data-testid": "addValue",
1021
- isDisabled: !C || i,
1028
+ isDisabled: !v || i,
1022
1029
  children: [
1023
1030
  /* @__PURE__ */ t(zt, {}),
1024
1031
  " ",
1025
- e(a || "add")
1032
+ e(l || "add")
1026
1033
  ]
1027
1034
  }
1028
1035
  )
1029
- ] }, b)) });
1030
- }, Ee = (e) => {
1031
- const { form: n, inputType: r, attribute: l } = e, a = ne(l), i = r.startsWith("multiselect"), s = i ? It : kt, c = l.validators?.options?.options || [], o = l.annotations?.inputOptionLabels || {};
1032
- return /* @__PURE__ */ t(K, { ...e, children: /* @__PURE__ */ t(
1036
+ ] }, C)) });
1037
+ }, Re = (e) => {
1038
+ const { form: n, inputType: r, attribute: a } = e, l = ne(a), i = r.startsWith("multiselect"), s = i ? It : kt, c = a.validators?.options?.options || [], o = a.annotations?.inputOptionLabels || {}, m = a.annotations?.inputOptionLabelsI18nPrefix;
1039
+ return /* @__PURE__ */ t(W, { ...e, children: /* @__PURE__ */ t(
1033
1040
  U,
1034
1041
  {
1035
- name: N(l.name),
1042
+ name: N(a.name),
1036
1043
  control: n.control,
1037
1044
  defaultValue: "",
1038
- render: ({ field: d }) => /* @__PURE__ */ t(Y, { children: c.map((m) => /* @__PURE__ */ t(
1045
+ render: ({ field: f }) => /* @__PURE__ */ t(Y, { children: c.map((h) => /* @__PURE__ */ t(
1039
1046
  s,
1040
1047
  {
1041
- id: m,
1042
- "data-testid": m,
1043
- label: L(e.t, o[m], m),
1044
- value: m,
1045
- isChecked: d.value.includes(m),
1048
+ id: h,
1049
+ "data-testid": h,
1050
+ label: B(e.t, o[h], h, m),
1051
+ value: h,
1052
+ isChecked: f.value.includes(h),
1046
1053
  onChange: () => {
1047
- i ? d.value.includes(m) ? d.onChange(
1048
- d.value.filter((y) => y !== m)
1049
- ) : d.onChange([...d.value, m]) : d.onChange([m]);
1054
+ i ? f.value.includes(h) ? f.onChange(
1055
+ f.value.filter((d) => d !== h)
1056
+ ) : f.onChange([...f.value, h]) : f.onChange([h]);
1050
1057
  },
1051
- readOnly: l.readOnly,
1052
- isRequired: a
1058
+ readOnly: a.readOnly,
1059
+ isRequired: l
1053
1060
  },
1054
- m
1061
+ h
1055
1062
  )) })
1056
1063
  }
1057
1064
  ) });
1058
- }, Mn = ({
1065
+ }, Nn = ({
1059
1066
  toggleId: e,
1060
1067
  onToggle: n,
1061
1068
  onSelect: r,
1062
- selections: l,
1063
- isOpen: a,
1069
+ selections: a,
1070
+ isOpen: l,
1064
1071
  menuAppendTo: i,
1065
1072
  direction: s,
1066
1073
  width: c,
1067
1074
  maxHeight: o,
1068
- toggleIcon: d,
1069
- className: m,
1070
- children: y,
1071
- ...h
1075
+ toggleIcon: m,
1076
+ className: f,
1077
+ children: h,
1078
+ ...d
1072
1079
  }) => {
1073
- const [u, x] = T(!1), g = ee(), f = () => {
1074
- x(!u), n(!u);
1075
- }, w = () => i === "parent" && g.current?.parentElement || "inline", D = $e.toArray(
1076
- y
1080
+ const [u, k] = S(!1), x = ee(), g = () => {
1081
+ k(!u), n(!u);
1082
+ }, y = () => i === "parent" && x.current?.parentElement || "inline", O = $e.toArray(
1083
+ h
1077
1084
  );
1078
1085
  return /* @__PURE__ */ t(
1079
1086
  X,
1080
1087
  {
1081
- ref: g,
1088
+ ref: x,
1082
1089
  maxMenuHeight: J(o),
1083
1090
  isScrollable: !0,
1084
1091
  popperProps: {
1085
- appendTo: w(),
1092
+ appendTo: y(),
1086
1093
  direction: s,
1087
1094
  width: J(c)
1088
1095
  },
1089
- ...h,
1090
- onClick: f,
1091
- onOpenChange: () => x(!1),
1092
- selected: l,
1093
- onSelect: (C, b) => {
1094
- r?.(b || ""), f();
1096
+ ...d,
1097
+ onClick: g,
1098
+ onOpenChange: (v) => k(v),
1099
+ selected: a,
1100
+ onSelect: (v, C) => {
1101
+ r?.(C || ""), g();
1095
1102
  },
1096
- toggle: (C) => /* @__PURE__ */ t(
1097
- W,
1103
+ toggle: (v) => /* @__PURE__ */ t(
1104
+ K,
1098
1105
  {
1099
1106
  id: e,
1100
- ref: C,
1101
- className: m,
1102
- onClick: f,
1103
- isExpanded: a,
1104
- "aria-label": h["aria-label"],
1105
- icon: d,
1107
+ ref: v,
1108
+ className: f,
1109
+ onClick: g,
1110
+ isExpanded: l,
1111
+ "aria-label": d["aria-label"],
1112
+ icon: m,
1106
1113
  isFullWidth: !0,
1107
- children: D.find((b) => b.props.value === l)?.props.children || l || h["aria-label"]
1114
+ children: O.find((C) => C.props.value === a)?.props.children || a || d["aria-label"]
1108
1115
  }
1109
1116
  ),
1110
- isOpen: a,
1111
- children: /* @__PURE__ */ t(Z, { children: y })
1117
+ isOpen: l,
1118
+ children: /* @__PURE__ */ t(Z, { children: h })
1112
1119
  }
1113
1120
  );
1114
- }, Nn = ({
1121
+ }, Ln = ({
1115
1122
  toggleId: e,
1116
1123
  onSelect: n,
1117
1124
  onToggle: r,
1118
- onFilter: l,
1119
- variant: a,
1125
+ onFilter: a,
1126
+ variant: l,
1120
1127
  validated: i,
1121
1128
  placeholderText: s,
1122
1129
  maxHeight: c,
1123
1130
  width: o,
1124
- toggleIcon: d,
1125
- direction: m,
1126
- selections: y,
1127
- typeAheadAriaLabel: h,
1131
+ toggleIcon: m,
1132
+ direction: f,
1133
+ selections: h,
1134
+ typeAheadAriaLabel: d,
1128
1135
  chipGroupComponent: u,
1129
- chipGroupProps: x,
1130
- footer: g,
1131
- children: f,
1132
- ...w
1136
+ chipGroupProps: k,
1137
+ footer: x,
1138
+ children: g,
1139
+ ...y
1133
1140
  }) => {
1134
- const [D, C] = T(""), [b, q] = T(0), p = ee(), I = $e.toArray(
1135
- f
1141
+ const [O, v] = S(""), [C, L] = S(0), p = ee(), I = $e.toArray(
1142
+ g
1136
1143
  ), A = () => {
1137
- r?.(!w.isOpen);
1138
- }, k = (S) => {
1139
- const O = I[b];
1140
- switch (r?.(!0), S.key) {
1144
+ r?.(!y.isOpen);
1145
+ }, w = (T) => {
1146
+ const F = I[C];
1147
+ switch (r?.(!0), T.key) {
1141
1148
  case "Enter": {
1142
- S.preventDefault(), a !== V.typeaheadMulti ? C(O.props.value) : C(""), n?.(O.props.value), r?.(!1), q(0);
1149
+ T.preventDefault(), l !== V.typeaheadMulti ? v(F.props.value) : v(""), n?.(F.props.value), r?.(!1), L(0);
1143
1150
  break;
1144
1151
  }
1145
1152
  case "Escape": {
@@ -1147,73 +1154,73 @@ const K = ({
1147
1154
  break;
1148
1155
  }
1149
1156
  case "Backspace": {
1150
- a === V.typeahead && n?.("");
1157
+ l === V.typeahead && n?.("");
1151
1158
  break;
1152
1159
  }
1153
1160
  case "ArrowUp":
1154
1161
  case "ArrowDown": {
1155
- S.preventDefault();
1156
- let F = 0;
1157
- S.key === "ArrowUp" && (b === 0 ? F = I.length - 1 : F = b - 1), S.key === "ArrowDown" && (b === I.length - 1 ? F = 0 : F = b + 1), q(F);
1162
+ T.preventDefault();
1163
+ let R = 0;
1164
+ T.key === "ArrowUp" && (C === 0 ? R = I.length - 1 : R = C - 1), T.key === "ArrowDown" && (C === I.length - 1 ? R = 0 : R = C + 1), L(R);
1158
1165
  break;
1159
1166
  }
1160
1167
  }
1161
1168
  };
1162
- return /* @__PURE__ */ v(
1169
+ return /* @__PURE__ */ b(
1163
1170
  X,
1164
1171
  {
1165
- ...w,
1172
+ ...y,
1166
1173
  onClick: A,
1167
- onOpenChange: () => r?.(!1),
1168
- onSelect: (S, O) => n?.(O || ""),
1174
+ onOpenChange: (T) => r?.(T),
1175
+ onSelect: (T, F) => n?.(F || ""),
1169
1176
  maxMenuHeight: J(c),
1170
- popperProps: { direction: m, width: J(o) },
1171
- toggle: (S) => /* @__PURE__ */ t(
1172
- W,
1177
+ popperProps: { direction: f, width: J(o) },
1178
+ toggle: (T) => /* @__PURE__ */ t(
1179
+ K,
1173
1180
  {
1174
- ref: S,
1181
+ ref: T,
1175
1182
  id: e,
1176
1183
  variant: "typeahead",
1177
1184
  onClick: () => r?.(!0),
1178
- icon: d,
1179
- isExpanded: w.isOpen,
1185
+ icon: m,
1186
+ isExpanded: y.isOpen,
1180
1187
  isFullWidth: !0,
1181
1188
  status: i === "error" ? fe.danger : void 0,
1182
- children: /* @__PURE__ */ v(Me, { isPlain: !0, children: [
1189
+ children: /* @__PURE__ */ b(Me, { isPlain: !0, children: [
1183
1190
  /* @__PURE__ */ t(
1184
1191
  Ne,
1185
1192
  {
1186
1193
  placeholder: s,
1187
- value: a === V.typeahead && y ? y : D,
1194
+ value: l === V.typeahead && h ? h : O,
1188
1195
  onClick: A,
1189
- onChange: (O, F) => {
1190
- C(F), l?.(F);
1196
+ onChange: (F, R) => {
1197
+ v(R), a?.(R);
1191
1198
  },
1192
- onKeyDown: (O) => k(O),
1199
+ onKeyDown: (F) => w(F),
1193
1200
  autoComplete: "off",
1194
1201
  innerRef: p,
1195
1202
  role: "combobox",
1196
- isExpanded: w.isOpen,
1203
+ isExpanded: y.isOpen,
1197
1204
  "aria-controls": "select-typeahead-listbox",
1198
- "aria-label": h,
1199
- children: a === V.typeaheadMulti && Array.isArray(y) && (u || /* @__PURE__ */ t(qe, { ...x, children: y.map((O, F) => /* @__PURE__ */ t(
1200
- Be,
1205
+ "aria-label": d,
1206
+ children: l === V.typeaheadMulti && Array.isArray(h) && (u || /* @__PURE__ */ t(Le, { ...k, children: h.map((F, R) => /* @__PURE__ */ t(
1207
+ qe,
1201
1208
  {
1202
1209
  onClick: (et) => {
1203
- et.stopPropagation(), n?.(O);
1210
+ et.stopPropagation(), n?.(F);
1204
1211
  },
1205
- children: O
1212
+ children: F
1206
1213
  },
1207
- F
1214
+ R
1208
1215
  )) }))
1209
1216
  }
1210
1217
  ),
1211
- /* @__PURE__ */ t(Le, { children: !!D && /* @__PURE__ */ t(
1212
- R,
1218
+ /* @__PURE__ */ t(Be, { children: !!O && /* @__PURE__ */ t(
1219
+ P,
1213
1220
  {
1214
1221
  variant: "plain",
1215
1222
  onClick: () => {
1216
- n?.(""), C(""), l?.(""), p?.current?.focus();
1223
+ n?.(""), v(""), a?.(""), p?.current?.focus();
1217
1224
  },
1218
1225
  "aria-label": "Clear input value",
1219
1226
  children: /* @__PURE__ */ t(Ge, { "aria-hidden": !0 })
@@ -1223,8 +1230,8 @@ const K = ({
1223
1230
  }
1224
1231
  ),
1225
1232
  children: [
1226
- /* @__PURE__ */ t(Z, { children: f }),
1227
- g && /* @__PURE__ */ t(xt, { children: g })
1233
+ /* @__PURE__ */ t(Z, { children: g }),
1234
+ x && /* @__PURE__ */ t(xt, { children: x })
1228
1235
  ]
1229
1236
  }
1230
1237
  );
@@ -1233,51 +1240,51 @@ var V = /* @__PURE__ */ ((e) => (e.single = "single", e.typeahead = "typeahead",
1233
1240
  const J = (e) => typeof e == "number" ? e + "px" : e, qn = ({
1234
1241
  variant: e = "single",
1235
1242
  ...n
1236
- }) => e === "single" ? /* @__PURE__ */ t(Mn, { ...n }) : /* @__PURE__ */ t(Nn, { ...n, variant: e }), Re = (e) => {
1237
- const { t: n, form: r, inputType: l, attribute: a } = e, [i, s] = T(!1), [c, o] = T(""), d = l === "multiselect", m = (g, f) => {
1238
- d ? f.value.includes(g) ? f.onChange(f.value.filter((w) => w !== g)) : Array.isArray(f.value) ? f.onChange([...f.value, g]) : f.onChange([g]) : f.onChange(g === f.value ? "" : g);
1239
- }, y = a.validators?.options?.options || [], h = a.annotations?.inputOptionLabels || {}, u = (g) => L(e.t, h[g], g), x = (g) => y.filter(
1240
- (f) => u(f).toLowerCase().includes(c.toLowerCase())
1241
- ).map((f) => /* @__PURE__ */ t(
1243
+ }) => e === "single" ? /* @__PURE__ */ t(Nn, { ...n }) : /* @__PURE__ */ t(Ln, { ...n, variant: e }), Ee = (e) => {
1244
+ const { t: n, form: r, inputType: a, attribute: l } = e, [i, s] = S(!1), [c, o] = S(""), m = a === "multiselect", f = (g, y) => {
1245
+ m ? y.value.includes(g) ? y.onChange(y.value.filter((O) => O !== g)) : Array.isArray(y.value) ? y.onChange([...y.value, g]) : y.onChange([g]) : y.onChange(g === y.value ? "" : g);
1246
+ }, h = l.validators?.options?.options || [], d = l.annotations?.inputOptionLabels || {}, u = l.annotations?.inputOptionLabelsI18nPrefix, k = (g) => B(e.t, d[g], g, u), x = (g) => h.filter(
1247
+ (y) => k(y).toLowerCase().includes(c.toLowerCase())
1248
+ ).map((y) => /* @__PURE__ */ t(
1242
1249
  ge,
1243
1250
  {
1244
- selected: g === f,
1245
- value: f,
1246
- children: u(f)
1251
+ selected: g === y,
1252
+ value: y,
1253
+ children: k(y)
1247
1254
  },
1248
- f
1255
+ y
1249
1256
  ));
1250
- return /* @__PURE__ */ t(K, { ...e, children: /* @__PURE__ */ t(
1257
+ return /* @__PURE__ */ t(W, { ...e, children: /* @__PURE__ */ t(
1251
1258
  U,
1252
1259
  {
1253
- name: N(a.name),
1260
+ name: N(l.name),
1254
1261
  defaultValue: "",
1255
1262
  control: r.control,
1256
1263
  render: ({ field: g }) => /* @__PURE__ */ t(
1257
1264
  qn,
1258
1265
  {
1259
- toggleId: a.name,
1260
- onToggle: (f) => s(f),
1261
- onClear: () => m("", g),
1262
- onSelect: (f) => {
1263
- const w = f.toString();
1264
- m(w, g), Array.isArray(g.value) || s(!1);
1266
+ toggleId: l.name,
1267
+ onToggle: (y) => s(y),
1268
+ onClear: () => f("", g),
1269
+ onSelect: (y) => {
1270
+ const O = y.toString();
1271
+ f(O, g), Array.isArray(g.value) || s(!1);
1265
1272
  },
1266
- selections: d && Array.isArray(g.value) ? g.value : u(g.value),
1267
- variant: d ? V.typeaheadMulti : y.length >= 10 ? V.typeahead : V.single,
1273
+ selections: m && Array.isArray(g.value) ? g.value : k(g.value),
1274
+ variant: m ? V.typeaheadMulti : h.length >= 10 ? V.typeahead : V.single,
1268
1275
  "aria-label": n("selectOne"),
1269
1276
  isOpen: i,
1270
- isDisabled: a.readOnly,
1271
- onFilter: (f) => (o(f), x(g.value)),
1277
+ isDisabled: l.readOnly,
1278
+ onFilter: (y) => (o(y), x(g.value)),
1272
1279
  children: x(g.value)
1273
1280
  }
1274
1281
  )
1275
1282
  }
1276
1283
  ) });
1277
1284
  }, Bn = (e) => {
1278
- const { form: n, attribute: r } = e, l = ne(r);
1279
- return /* @__PURE__ */ t(K, { ...e, children: /* @__PURE__ */ t(
1280
- vn,
1285
+ const { form: n, attribute: r } = e, a = ne(r);
1286
+ return /* @__PURE__ */ t(W, { ...e, children: /* @__PURE__ */ t(
1287
+ bn,
1281
1288
  {
1282
1289
  id: r.name,
1283
1290
  "data-testid": r.name,
@@ -1285,33 +1292,35 @@ const J = (e) => typeof e == "number" ? e + "px" : e, qn = ({
1285
1292
  cols: r.annotations?.inputTypeCols,
1286
1293
  rows: r.annotations?.inputTypeRows,
1287
1294
  readOnly: r.readOnly,
1288
- isRequired: l
1295
+ isRequired: a
1289
1296
  }
1290
1297
  ) });
1291
1298
  }, E = (e) => {
1292
- const { form: n, inputType: r, attribute: l } = e, a = ne(l), i = r.startsWith("html") ? r.substring(6) : "text";
1293
- return /* @__PURE__ */ t(K, { ...e, children: /* @__PURE__ */ t(
1299
+ const { form: n, inputType: r, attribute: a } = e, l = ne(a), i = r.startsWith("html") ? r.substring(6) : "text";
1300
+ return /* @__PURE__ */ t(W, { ...e, children: /* @__PURE__ */ t(
1294
1301
  Q,
1295
1302
  {
1296
- id: l.name,
1297
- "data-testid": l.name,
1303
+ id: a.name,
1304
+ "data-testid": a.name,
1298
1305
  type: i,
1299
- placeholder: L(
1306
+ placeholder: B(
1300
1307
  e.t,
1301
- l.annotations?.inputTypePlaceholder
1308
+ a.annotations?.inputTypePlaceholder,
1309
+ a.name,
1310
+ a.annotations?.inputOptionLabelsI18nPrefix
1302
1311
  ),
1303
- readOnly: l.readOnly,
1304
- isRequired: a,
1305
- ...n.register(N(l.name))
1312
+ readOnly: a.readOnly,
1313
+ isRequired: l,
1314
+ ...n.register(N(a.name))
1306
1315
  }
1307
1316
  ) });
1308
1317
  }, de = {
1309
1318
  text: E,
1310
1319
  textarea: Bn,
1311
- select: Re,
1312
- "select-radiobuttons": Ee,
1313
- multiselect: Re,
1314
- "multiselect-checkboxes": Ee,
1320
+ select: Ee,
1321
+ "select-radiobuttons": Re,
1322
+ multiselect: Ee,
1323
+ "multiselect-checkboxes": Re,
1315
1324
  "html5-email": E,
1316
1325
  "html5-tel": E,
1317
1326
  "html5-url": E,
@@ -1321,28 +1330,28 @@ const J = (e) => typeof e == "number" ? e + "px" : e, qn = ({
1321
1330
  "html5-date": E,
1322
1331
  "html5-month": E,
1323
1332
  "html5-time": E,
1324
- "multi-input": Pn
1325
- }, br = ({
1333
+ "multi-input": Vn
1334
+ }, Cr = ({
1326
1335
  t: e,
1327
1336
  form: n,
1328
1337
  userProfileMetadata: r,
1329
- supportedLocales: l,
1330
- currentLocale: a,
1338
+ supportedLocales: a,
1339
+ currentLocale: l,
1331
1340
  hideReadOnly: i = !1,
1332
1341
  renderer: s
1333
1342
  }) => {
1334
- const c = P(() => {
1343
+ const c = D(() => {
1335
1344
  if (!r.attributes)
1336
1345
  return [];
1337
- const o = i ? r.attributes.filter(({ readOnly: d }) => !d) : r.attributes;
1346
+ const o = i ? r.attributes.filter(({ readOnly: m }) => !m) : r.attributes;
1338
1347
  return [
1339
1348
  // Insert an empty group for attributes without a group.
1340
1349
  { name: void 0 },
1341
1350
  ...r.groups ?? []
1342
- ].map((d) => ({
1343
- group: d,
1351
+ ].map((m) => ({
1352
+ group: m,
1344
1353
  attributes: o.filter(
1345
- (m) => m.group === d.name
1354
+ (f) => f.group === m.name
1346
1355
  )
1347
1356
  }));
1348
1357
  }, [
@@ -1351,46 +1360,46 @@ const J = (e) => typeof e == "number" ? e + "px" : e, qn = ({
1351
1360
  r.attributes
1352
1361
  ]);
1353
1362
  return c.length === 0 ? null : /* @__PURE__ */ t(
1354
- Sn,
1363
+ On,
1355
1364
  {
1356
1365
  label: e("jumpToSection"),
1357
- sections: c.filter((o) => o.attributes.length > 0).map(({ group: o, attributes: d }) => ({
1358
- title: L(e, o.displayHeader, o.name) || e("general"),
1359
- panel: /* @__PURE__ */ v("div", { className: "pf-v5-c-form", children: [
1360
- o.displayDescription && /* @__PURE__ */ t(ae, { className: "pf-v5-u-pb-lg", children: L(e, o.displayDescription, "") }),
1361
- d.map((m) => /* @__PURE__ */ t(
1362
- Ln,
1366
+ sections: c.filter((o) => o.attributes.length > 0).map(({ group: o, attributes: m }) => ({
1367
+ title: B(e, o.displayHeader, o.name) || e("general"),
1368
+ panel: /* @__PURE__ */ b("div", { className: "pf-v5-c-form", children: [
1369
+ o.displayDescription && /* @__PURE__ */ t(le, { className: "pf-v5-u-pb-lg", children: B(e, o.displayDescription, "") }),
1370
+ m.map((f) => /* @__PURE__ */ t(
1371
+ _n,
1363
1372
  {
1364
1373
  t: e,
1365
1374
  form: n,
1366
- supportedLocales: l,
1367
- currentLocale: a,
1375
+ supportedLocales: a,
1376
+ currentLocale: l,
1368
1377
  renderer: s,
1369
- attribute: m
1378
+ attribute: f
1370
1379
  },
1371
- m.name
1380
+ f.name
1372
1381
  ))
1373
1382
  ] })
1374
1383
  }))
1375
1384
  }
1376
1385
  );
1377
- }, Ln = ({
1386
+ }, _n = ({
1378
1387
  t: e,
1379
1388
  form: n,
1380
1389
  renderer: r,
1381
- supportedLocales: l,
1382
- currentLocale: a,
1390
+ supportedLocales: a,
1391
+ currentLocale: l,
1383
1392
  attribute: i
1384
1393
  }) => {
1385
1394
  const s = n.watch(
1386
1395
  N(i.name)
1387
- ), c = P(() => Hn(i), [i]), o = i.multivalued || $n(s) && i.annotations?.inputType === void 0 ? de["multi-input"] : de[c];
1396
+ ), c = D(() => Un(i), [i]), o = i.multivalued || Gn(s) && i.annotations?.inputType === void 0 ? de["multi-input"] : de[c];
1388
1397
  return i.name === "locale" ? /* @__PURE__ */ t(
1389
1398
  En,
1390
1399
  {
1391
1400
  form: n,
1392
- supportedLocales: l,
1393
- currentLocale: a,
1401
+ supportedLocales: a,
1402
+ currentLocale: l,
1394
1403
  t: e,
1395
1404
  attribute: i
1396
1405
  }
@@ -1404,18 +1413,18 @@ const J = (e) => typeof e == "number" ? e + "px" : e, qn = ({
1404
1413
  renderer: r
1405
1414
  }
1406
1415
  );
1407
- }, _n = "text";
1408
- function Hn(e) {
1416
+ }, Hn = "text";
1417
+ function Un(e) {
1409
1418
  if (Ze(e.name))
1410
1419
  return "text";
1411
1420
  const n = e.annotations?.inputType;
1412
- return Un(n) ? n : _n;
1421
+ return $n(n) ? n : Hn;
1413
1422
  }
1414
- const Un = (e) => typeof e == "string" && e in de, $n = (e) => Array.isArray(e) && e.length > 1, Gn = ({
1423
+ const $n = (e) => typeof e == "string" && e in de, Gn = (e) => Array.isArray(e) && e.length > 1, Kn = ({
1415
1424
  className: e = "",
1416
1425
  border: n,
1417
1426
  size: r = "md"
1418
- }) => /* @__PURE__ */ v(
1427
+ }) => /* @__PURE__ */ b(
1419
1428
  "svg",
1420
1429
  {
1421
1430
  className: tn(
@@ -1471,7 +1480,7 @@ const Un = (e) => typeof e == "string" && e in de, $n = (e) => Array.isArray(e)
1471
1480
  ) })
1472
1481
  }
1473
1482
  ),
1474
- /* @__PURE__ */ t("g", { style: { filter: 'url("#a")' }, children: /* @__PURE__ */ v("g", { transform: "translate(5.04 6.88)", children: [
1483
+ /* @__PURE__ */ t("g", { style: { filter: 'url("#a")' }, children: /* @__PURE__ */ b("g", { transform: "translate(5.04 6.88)", children: [
1475
1484
  /* @__PURE__ */ t(
1476
1485
  "path",
1477
1486
  {
@@ -1531,32 +1540,33 @@ const Un = (e) => typeof e == "string" && e in de, $n = (e) => Array.isArray(e)
1531
1540
  ] }) })
1532
1541
  ]
1533
1542
  }
1534
- ), De = ({
1543
+ ), Pe = ({
1535
1544
  isKebab: e = !1,
1536
1545
  title: n,
1537
1546
  dropDownItems: r,
1538
- ...l
1547
+ ...a
1539
1548
  }) => {
1540
- const [a, i] = T(!1);
1549
+ const [l, i] = S(!1);
1541
1550
  return /* @__PURE__ */ t(
1542
1551
  wt,
1543
1552
  {
1544
- ...l,
1553
+ ...a,
1545
1554
  popperProps: {
1546
1555
  position: "right"
1547
1556
  },
1557
+ onOpenChange: (s) => i(s),
1548
1558
  toggle: (s) => /* @__PURE__ */ t(
1549
- W,
1559
+ K,
1550
1560
  {
1551
- "data-testid": `${l["data-testid"]}-toggle`,
1561
+ "data-testid": `${a["data-testid"]}-toggle`,
1552
1562
  ref: s,
1553
- onClick: () => i(!a),
1554
- isExpanded: a,
1563
+ onClick: () => i(!l),
1564
+ isExpanded: l,
1555
1565
  variant: e ? "plain" : "default",
1556
1566
  children: e ? /* @__PURE__ */ t(Jt, {}) : n
1557
1567
  }
1558
1568
  ),
1559
- isOpen: a,
1569
+ isOpen: l,
1560
1570
  children: /* @__PURE__ */ t(At, { children: r })
1561
1571
  }
1562
1572
  );
@@ -1564,122 +1574,122 @@ const Un = (e) => typeof e == "string" && e in de, $n = (e) => Array.isArray(e)
1564
1574
  function Wn(e, n) {
1565
1575
  if (!e)
1566
1576
  return n("unknownUser");
1567
- const r = e.given_name, l = e.family_name, a = e.preferred_username;
1568
- return r && l ? n("fullName", { givenName: r, familyName: l }) : r || l || a || n("unknownUser");
1577
+ const r = e.given_name, a = e.family_name, l = e.preferred_username;
1578
+ return r && a ? n("fullName", { givenName: r, familyName: a }) : r || a || l || n("unknownUser");
1569
1579
  }
1570
- const Cr = ({
1580
+ const Ir = ({
1571
1581
  keycloak: e,
1572
1582
  brand: { href: n, ...r },
1573
- avatar: l,
1583
+ avatar: a,
1574
1584
  features: {
1575
- hasLogout: a = !0,
1585
+ hasLogout: l = !0,
1576
1586
  hasManageAccount: i = !0,
1577
1587
  hasUsername: s = !0
1578
1588
  } = {},
1579
1589
  kebabDropdownItems: c,
1580
1590
  dropdownItems: o = [],
1581
- toolbarItems: d,
1582
- ...m
1591
+ toolbarItems: m,
1592
+ ...f
1583
1593
  }) => {
1584
- const { t: y } = Ce(), h = [];
1585
- i && h.push(
1594
+ const { t: h } = Ce(), d = [];
1595
+ i && d.push(
1586
1596
  /* @__PURE__ */ t(
1587
1597
  Ae,
1588
1598
  {
1589
1599
  onClick: () => e.accountManagement(),
1590
- children: y("manageAccount")
1600
+ children: h("manageAccount")
1591
1601
  },
1592
1602
  "manageAccount"
1593
1603
  )
1594
- ), a && h.push(
1595
- /* @__PURE__ */ t(Ae, { onClick: () => e.logout(), children: y("signOut") }, "signOut")
1604
+ ), l && d.push(
1605
+ /* @__PURE__ */ t(Ae, { onClick: () => e.logout(), children: h("signOut") }, "signOut")
1596
1606
  );
1597
1607
  const u = e.idTokenParsed?.picture;
1598
1608
  return /* @__PURE__ */ t(
1599
1609
  Xt,
1600
1610
  {
1601
- ...m,
1611
+ ...f,
1602
1612
  logo: /* @__PURE__ */ t(Tt, { ...r }),
1603
1613
  logoProps: { href: n },
1604
- headerTools: /* @__PURE__ */ v(Zt, { children: [
1605
- /* @__PURE__ */ v(en, { children: [
1614
+ headerTools: /* @__PURE__ */ b(Zt, { children: [
1615
+ /* @__PURE__ */ b(en, { children: [
1606
1616
  /* @__PURE__ */ t(
1607
- le,
1617
+ ae,
1608
1618
  {
1609
1619
  visibility: {
1610
1620
  md: "hidden"
1611
1621
  },
1612
1622
  children: /* @__PURE__ */ t(
1613
- De,
1623
+ Pe,
1614
1624
  {
1615
1625
  "data-testid": "options-kebab",
1616
1626
  isKebab: !0,
1617
1627
  dropDownItems: [
1618
1628
  ...c || o,
1619
- h
1629
+ d
1620
1630
  ]
1621
1631
  }
1622
1632
  )
1623
1633
  }
1624
1634
  ),
1625
- /* @__PURE__ */ t(le, { children: d }),
1635
+ /* @__PURE__ */ t(ae, { children: m }),
1626
1636
  /* @__PURE__ */ t(
1627
- le,
1637
+ ae,
1628
1638
  {
1629
1639
  visibility: {
1630
1640
  default: "hidden",
1631
1641
  md: "visible"
1632
1642
  },
1633
1643
  children: /* @__PURE__ */ t(
1634
- De,
1644
+ Pe,
1635
1645
  {
1636
1646
  "data-testid": "options",
1637
- dropDownItems: [...o, h],
1638
- title: s ? Wn(e.idTokenParsed, y) : void 0
1647
+ dropDownItems: [...o, d],
1648
+ title: s ? Wn(e.idTokenParsed, h) : void 0
1639
1649
  }
1640
1650
  )
1641
1651
  }
1642
1652
  )
1643
1653
  ] }),
1644
- u || l?.src ? /* @__PURE__ */ t(St, { src: u, alt: y("avatar"), ...l }) : /* @__PURE__ */ t(Gn, { ...l })
1654
+ u || a?.src ? /* @__PURE__ */ t(St, { src: u, alt: h("avatar"), ...a }) : /* @__PURE__ */ t(Kn, { ...a })
1645
1655
  ] })
1646
1656
  }
1647
1657
  );
1648
1658
  };
1649
1659
  export {
1650
1660
  nn as AlertProvider,
1651
- sr as ContinueCancelModal,
1661
+ or as ContinueCancelModal,
1652
1662
  rn as ErrorPage,
1653
1663
  je as FormErrorText,
1654
- kn as FormPanel,
1655
- pr as FormSubmitButton,
1664
+ xn as FormPanel,
1665
+ fr as FormSubmitButton,
1656
1666
  hn as Help,
1657
1667
  ze as HelpItem,
1658
- mr as IconMapper,
1659
- Cr as KeycloakMasthead,
1660
- ar as KeycloakProvider,
1668
+ pr as IconMapper,
1669
+ Ir as KeycloakMasthead,
1670
+ ir as KeycloakProvider,
1661
1671
  qn as KeycloakSelect,
1662
- vn as KeycloakTextArea,
1663
- or as NumberControl,
1664
- cr as PasswordControl,
1672
+ bn as KeycloakTextArea,
1673
+ cr as NumberControl,
1674
+ dr as PasswordControl,
1665
1675
  Je as PasswordInput,
1666
- Sn as ScrollForm,
1667
- yn as SelectControl,
1676
+ On as ScrollForm,
1677
+ vn as SelectControl,
1668
1678
  H as SelectVariant,
1669
- dr as SwitchControl,
1670
- ur as TextAreaControl,
1671
- hr as TextControl,
1672
- br as UserProfileFields,
1673
- fr as beerify,
1674
- an as createNamedContext,
1675
- gr as debeerify,
1676
- ir as getInjectedEnvironment,
1679
+ ur as SwitchControl,
1680
+ hr as TextAreaControl,
1681
+ mr as TextControl,
1682
+ Cr as UserProfileFields,
1683
+ gr as beerify,
1684
+ ln as createNamedContext,
1685
+ yr as debeerify,
1686
+ sr as getInjectedEnvironment,
1677
1687
  sn as isDefined,
1678
- vr as isUserProfileError,
1679
- L as label,
1680
- Tn as mainPageContentId,
1681
- yr as setUserProfileServerError,
1682
- rr as useAlerts,
1688
+ br as isUserProfileError,
1689
+ B as label,
1690
+ Sn as mainPageContentId,
1691
+ vr as setUserProfileServerError,
1692
+ ar as useAlerts,
1683
1693
  lr as useEnvironment,
1684
1694
  un as useHelp,
1685
1695
  on as useRequiredContext,