@incodetech/web 0.0.0-dev-20260223-3222aae → 0.0.0-dev-20260223-4e681c2

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,16 +1,16 @@
1
- import { u as e, c as $, S as L, B as E, r as j, a as Y } from "../incodeModule-DPTWfWvu.js";
2
- import { mexicanStates as q, createCurpValidationManager as K } from "@incodetech/core/curp-validation";
3
- import { g as X, D as G, A as U, d as z, y as W, k as F } from "../vendor-preact-CjD4WiuC.js";
1
+ import { u as e, c as E, S, B as N, r as be, a as ge } from "../incodeModule-DPTWfWvu.js";
2
+ import { mexicanStates as we, createCurpValidationManager as De } from "@incodetech/core/curp-validation";
3
+ import { g as ye, D as _, A as V, d as O, y as A, k as ce } from "../vendor-preact-CjD4WiuC.js";
4
4
  import "@incodetech/core";
5
5
  import "../instance-B-q0ZREN.js";
6
- import { u as B } from "../useTranslation-CD9ZxEvP.js";
7
- import { I as J, P as R } from "../incodeComponent-3T8Qyjnt.js";
8
- import { E as x } from "../errorIcon-DjGwgLyL.js";
9
- import { S as T } from "../successIcon-DV200b2L.js";
10
- import { S as Q } from "../spinner-C-EwvA9l.js";
11
- import { C as _ } from "../chevronDown-CU4P7j2Z.js";
12
- const ee = ({ class: n }) => {
13
- const o = X();
6
+ import { u as J } from "../useTranslation-CD9ZxEvP.js";
7
+ import { I as ke, P as H } from "../incodeComponent-3T8Qyjnt.js";
8
+ import { E as Z } from "../errorIcon-DjGwgLyL.js";
9
+ import { S as K } from "../successIcon-DV200b2L.js";
10
+ import { S as Le } from "../spinner-C-EwvA9l.js";
11
+ import { C as Re } from "../chevronDown-CU4P7j2Z.js";
12
+ const Ve = ({ class: t }) => {
13
+ const l = ye();
14
14
  return /* @__PURE__ */ e(
15
15
  "svg",
16
16
  {
@@ -20,10 +20,10 @@ const ee = ({ class: n }) => {
20
20
  fill: "none",
21
21
  xmlns: "http://www.w3.org/2000/svg",
22
22
  role: "img",
23
- "aria-labelledby": o,
24
- class: n,
23
+ "aria-labelledby": l,
24
+ class: t,
25
25
  children: [
26
- /* @__PURE__ */ e("title", { id: o, children: "Calendar icon" }),
26
+ /* @__PURE__ */ e("title", { id: l, children: "Calendar icon" }),
27
27
  /* @__PURE__ */ e(
28
28
  "path",
29
29
  {
@@ -63,19 +63,19 @@ const ee = ({ class: n }) => {
63
63
  ]
64
64
  }
65
65
  );
66
- }, te = ({
67
- width: n = 14,
68
- height: o = 14,
69
- class: s
66
+ }, Se = ({
67
+ width: t = 14,
68
+ height: l = 14,
69
+ class: i
70
70
  }) => /* @__PURE__ */ e(
71
71
  "svg",
72
72
  {
73
- width: n,
74
- height: o,
73
+ width: t,
74
+ height: l,
75
75
  viewBox: "0 0 14 14",
76
76
  fill: "none",
77
77
  xmlns: "http://www.w3.org/2000/svg",
78
- class: `IncodeCloseIcon ${s || ""}`,
78
+ class: `IncodeCloseIcon ${i || ""}`,
79
79
  "aria-hidden": "true",
80
80
  children: /* @__PURE__ */ e(
81
81
  "path",
@@ -87,195 +87,229 @@ const ee = ({ class: n }) => {
87
87
  }
88
88
  )
89
89
  }
90
- ), ne = G((n, o) => {
91
- const { class: s, type: a = "text", ...t } = n;
90
+ ), Pe = ({ size: t = 20 }) => /* @__PURE__ */ e(
91
+ "svg",
92
+ {
93
+ xmlns: "http://www.w3.org/2000/svg",
94
+ width: t,
95
+ height: t,
96
+ viewBox: "0 0 20 20",
97
+ fill: "none",
98
+ class: "IncodeSearchIcon",
99
+ "aria-hidden": "true",
100
+ children: [
101
+ /* @__PURE__ */ e("title", { children: "Search" }),
102
+ /* @__PURE__ */ e(
103
+ "path",
104
+ {
105
+ d: "M9 17C13.4183 17 17 13.4183 17 9C17 4.58172 13.4183 1 9 1C4.58172 1 1 4.58172 1 9C1 13.4183 4.58172 17 9 17Z",
106
+ stroke: "var(--icon-neutral-300)",
107
+ "stroke-width": "2",
108
+ "stroke-linecap": "round",
109
+ "stroke-linejoin": "round"
110
+ }
111
+ ),
112
+ /* @__PURE__ */ e(
113
+ "path",
114
+ {
115
+ d: "M19 19L14.65 14.65",
116
+ stroke: "var(--icon-neutral-300)",
117
+ "stroke-width": "2",
118
+ "stroke-linecap": "round",
119
+ "stroke-linejoin": "round"
120
+ }
121
+ )
122
+ ]
123
+ }
124
+ ), He = _((t, l) => {
125
+ const { class: i, type: o = "text", ...n } = t;
92
126
  return /* @__PURE__ */ e(
93
127
  "input",
94
128
  {
95
- ...t,
96
- ref: o,
97
- type: a,
98
- class: $("IncodeInput", s)
129
+ ...n,
130
+ ref: l,
131
+ type: o,
132
+ class: E("IncodeInput", i)
99
133
  }
100
134
  );
101
- }), N = G(
135
+ }), M = _(
102
136
  ({
103
- id: n,
104
- label: o,
105
- "aria-label": s,
106
- type: a,
107
- error: t,
108
- showErrorIcon: d,
137
+ id: t,
138
+ label: l,
139
+ "aria-label": i,
140
+ type: o,
141
+ error: n,
142
+ showErrorIcon: h,
109
143
  helper: r,
110
- showHelperIcon: C,
111
- closeButton: l,
112
- required: u,
113
- suppressMessages: m = !1,
144
+ showHelperIcon: I,
145
+ closeButton: c,
146
+ required: C,
147
+ suppressMessages: g = !1,
114
148
  class: f,
115
- value: c,
116
- ...b
149
+ value: d,
150
+ ...v
117
151
  }, y) => {
118
- const i = `${n}-helper`, h = `${n}-error`, I = m ? "" : [r ? i : null, t ? h : null].filter(Boolean).join(" ");
119
- return /* @__PURE__ */ e("div", { class: $("IncodeInputComposed", f), children: [
120
- o && /* @__PURE__ */ e(
152
+ const L = `${t}-helper`, k = `${t}-error`, R = g ? "" : [r ? L : null, n ? k : null].filter(Boolean).join(" ");
153
+ return /* @__PURE__ */ e("div", { class: E("IncodeInputComposed", f), children: [
154
+ l && /* @__PURE__ */ e(
121
155
  "label",
122
156
  {
123
157
  class: "IncodeInputComposedLabel",
124
- htmlFor: n,
125
- "data-testid": `${n}-label`,
126
- children: o
158
+ htmlFor: t,
159
+ "data-testid": `${t}-label`,
160
+ children: l
127
161
  }
128
162
  ),
129
163
  /* @__PURE__ */ e("div", { class: "IncodeInputComposedWrapper", children: [
130
164
  /* @__PURE__ */ e(
131
- ne,
165
+ He,
132
166
  {
133
- id: n,
134
- type: a,
135
- ...b,
167
+ id: t,
168
+ type: o,
169
+ ...v,
136
170
  ref: y,
137
- required: u,
138
- "data-has-value": !!(c && String(c).length > 0),
139
- ...!o && s ? { "aria-label": s } : {},
140
- "aria-describedby": I || void 0,
141
- "aria-required": u ? "true" : void 0,
142
- "aria-invalid": t ? "true" : void 0,
143
- value: c
171
+ required: C,
172
+ "data-has-value": !!(d && String(d).length > 0),
173
+ ...!l && i ? { "aria-label": i } : {},
174
+ "aria-describedby": R || void 0,
175
+ "aria-required": C ? "true" : void 0,
176
+ "aria-invalid": n ? "true" : void 0,
177
+ value: d
144
178
  }
145
179
  ),
146
- l?.show && /* @__PURE__ */ e(
180
+ c?.show && /* @__PURE__ */ e(
147
181
  "button",
148
182
  {
149
183
  type: "button",
150
184
  "aria-label": "Clear",
151
185
  class: "IncodeInputComposedClearButton",
152
- onClick: l.onClose,
153
- "data-testid": `${n}-clear`,
154
- children: /* @__PURE__ */ e(te, {})
186
+ onClick: c.onClose,
187
+ "data-testid": `${t}-clear`,
188
+ children: /* @__PURE__ */ e(Se, {})
155
189
  }
156
190
  )
157
191
  ] }),
158
- !m && t && /* @__PURE__ */ e(
192
+ !g && n && /* @__PURE__ */ e(
159
193
  "div",
160
194
  {
161
195
  class: "IncodeInputComposedErrorWrapper",
162
- "data-testid": `${n}-error-wrapper`,
196
+ "data-testid": `${t}-error-wrapper`,
163
197
  children: [
164
- d && /* @__PURE__ */ e("div", { class: "IncodeInputComposedIconWrapper", children: /* @__PURE__ */ e(x, { size: 17 }) }),
165
- /* @__PURE__ */ e("p", { id: h, class: "IncodeInputComposedError", children: t })
198
+ h && /* @__PURE__ */ e("div", { class: "IncodeInputComposedIconWrapper", children: /* @__PURE__ */ e(Z, { size: 17 }) }),
199
+ /* @__PURE__ */ e("p", { id: k, class: "IncodeInputComposedError", children: n })
166
200
  ]
167
201
  }
168
202
  ),
169
- !m && r && !t && /* @__PURE__ */ e(
203
+ !g && r && !n && /* @__PURE__ */ e(
170
204
  "div",
171
205
  {
172
206
  class: "IncodeInputComposedHelperWrapper",
173
- "data-testid": `${n}-helper-wrapper`,
207
+ "data-testid": `${t}-helper-wrapper`,
174
208
  children: [
175
- C && /* @__PURE__ */ e("div", { class: "IncodeInputComposedIconWrapper", children: /* @__PURE__ */ e(T, { size: 17 }) }),
176
- /* @__PURE__ */ e("p", { id: i, class: "IncodeInputComposedHelper", children: r })
209
+ I && /* @__PURE__ */ e("div", { class: "IncodeInputComposedIconWrapper", children: /* @__PURE__ */ e(K, { size: 17 }) }),
210
+ /* @__PURE__ */ e("p", { id: L, class: "IncodeInputComposedHelper", children: r })
177
211
  ]
178
212
  }
179
213
  )
180
214
  ] });
181
215
  }
182
- ), re = ({
183
- curp: n,
184
- isValid: o,
185
- onCurpChange: s,
186
- onVerify: a,
187
- onSwitchToGenerate: t,
188
- disabled: d = !1,
216
+ ), Te = ({
217
+ curp: t,
218
+ isValid: l,
219
+ onCurpChange: i,
220
+ onVerify: o,
221
+ onSwitchToGenerate: n,
222
+ disabled: h = !1,
189
223
  placeholder: r,
190
- continueLabel: C,
191
- dontHaveLabel: l
224
+ continueLabel: I,
225
+ dontHaveLabel: c
192
226
  }) => {
193
- const { t: u } = B(), m = r ?? u("curp.placeholder.curp") ?? "CURP", f = C ?? u("curp.continue") ?? "Continue", c = l ?? u("curp.dontHave") ?? "I don't have my CURP", b = u("curp.placeholder.curp") ?? "CURP";
227
+ const { t: C } = J(), g = r ?? C("curp.placeholder.curp") ?? "CURP", f = I ?? C("curp.continue") ?? "Continue", d = c ?? C("curp.dontHave") ?? "I don't have my CURP", v = C("curp.placeholder.curp") ?? "CURP";
194
228
  return /* @__PURE__ */ e("div", { class: "IncodeCurpValidation IncodeCurpInput", children: [
195
229
  /* @__PURE__ */ e(
196
- N,
230
+ M,
197
231
  {
198
232
  id: "curp-input",
199
233
  label: "",
200
- value: n,
201
- onInput: (i) => {
202
- const h = i.target;
203
- s(h.value.toUpperCase());
234
+ value: t,
235
+ onInput: (L) => {
236
+ const k = L.target;
237
+ i(k.value.toUpperCase());
204
238
  },
205
- placeholder: m,
206
- disabled: d,
239
+ placeholder: g,
240
+ disabled: h,
207
241
  maxLength: 18,
208
- "aria-label": b
242
+ "aria-label": v
209
243
  }
210
244
  ),
211
- /* @__PURE__ */ e(L, {}),
245
+ /* @__PURE__ */ e(S, {}),
212
246
  /* @__PURE__ */ e(
213
- E,
247
+ N,
214
248
  {
215
249
  type: "button",
216
- onClick: a,
217
- disabled: !o || d,
250
+ onClick: o,
251
+ disabled: !l || h,
218
252
  "data-testid": "curp-verify",
219
253
  children: f
220
254
  }
221
255
  ),
222
256
  /* @__PURE__ */ e(
223
- E,
257
+ N,
224
258
  {
225
259
  type: "button",
226
- onClick: t,
227
- disabled: d,
260
+ onClick: n,
261
+ disabled: h,
228
262
  "data-testid": "curp-switch-to-generate",
229
263
  class: "IncodeCurpInputDontHaveButton",
230
- children: c
264
+ children: d
231
265
  }
232
266
  )
233
267
  ] });
234
- }, M = G(
268
+ }, de = _(
235
269
  ({
236
- id: n,
237
- label: o,
238
- value: s,
239
- onInput: a,
240
- min: t,
241
- max: d,
270
+ id: t,
271
+ label: l,
272
+ value: i,
273
+ onInput: o,
274
+ min: n,
275
+ max: h,
242
276
  placeholder: r = "mm/dd/yyyy",
243
- error: C,
244
- showErrorIcon: l,
245
- helper: u,
246
- showHelperIcon: m,
277
+ error: I,
278
+ showErrorIcon: c,
279
+ helper: C,
280
+ showHelperIcon: g,
247
281
  suppressMessages: f = !1,
248
- disabled: c,
249
- required: b,
282
+ disabled: d,
283
+ required: v,
250
284
  class: y,
251
- "data-testid": i,
252
- ...h
253
- }, I) => {
254
- const g = U(null), V = `${n}-helper`, P = `${n}-error`, k = f ? "" : [u ? V : null, C ? P : null].filter(Boolean).join(" "), H = (w) => {
255
- g.current = w, typeof I == "function" ? I(w) : I && (I.current = w);
256
- }, S = (w) => {
257
- w.preventDefault();
258
- const D = g.current;
259
- if (!(!D || c))
260
- if (D.focus(), "showPicker" in HTMLInputElement.prototype)
285
+ "data-testid": L,
286
+ ...k
287
+ }, R) => {
288
+ const F = V(null), W = `${t}-helper`, T = `${t}-error`, $ = f ? "" : [C ? W : null, I ? T : null].filter(Boolean).join(" "), ee = (P) => {
289
+ F.current = P, typeof R == "function" ? R(P) : R && (R.current = P);
290
+ }, B = (P) => {
291
+ P.preventDefault();
292
+ const s = F.current;
293
+ if (!(!s || d))
294
+ if (s.focus(), "showPicker" in HTMLInputElement.prototype)
261
295
  try {
262
- D.showPicker();
296
+ s.showPicker();
263
297
  } catch {
264
- D.click();
298
+ s.click();
265
299
  }
266
300
  else
267
- D.click();
301
+ s.click();
268
302
  };
269
- return /* @__PURE__ */ e("div", { class: $("IncodeDateInputComposed", y), children: [
270
- o && /* @__PURE__ */ e(
303
+ return /* @__PURE__ */ e("div", { class: E("IncodeDateInputComposed", y), children: [
304
+ l && /* @__PURE__ */ e(
271
305
  "label",
272
306
  {
273
307
  class: "IncodeDateInputComposedLabel",
274
- htmlFor: n,
275
- "data-testid": `${n}-label`,
308
+ htmlFor: t,
309
+ "data-testid": `${t}-label`,
276
310
  children: [
277
- o,
278
- b && /* @__PURE__ */ e("span", { class: "IncodeDateInputComposedRequired", children: " *" })
311
+ l,
312
+ v && /* @__PURE__ */ e("span", { class: "IncodeDateInputComposedRequired", children: " *" })
279
313
  ]
280
314
  }
281
315
  ),
@@ -283,23 +317,23 @@ const ee = ({ class: n }) => {
283
317
  /* @__PURE__ */ e(
284
318
  "input",
285
319
  {
286
- ref: H,
287
- id: n,
320
+ ref: ee,
321
+ id: t,
288
322
  type: "date",
289
323
  class: "IncodeDateInputComposedInput",
290
- value: s,
291
- onInput: a,
292
- min: t,
293
- max: d,
324
+ value: i,
325
+ onInput: o,
326
+ min: n,
327
+ max: h,
294
328
  placeholder: r,
295
- disabled: c,
296
- required: b,
297
- "data-has-value": !!s,
298
- "data-testid": i,
299
- "aria-describedby": k || void 0,
300
- "aria-required": b ? "true" : void 0,
301
- "aria-invalid": C ? "true" : void 0,
302
- ...h
329
+ disabled: d,
330
+ required: v,
331
+ "data-has-value": !!i,
332
+ "data-testid": L,
333
+ "aria-describedby": $ || void 0,
334
+ "aria-required": v ? "true" : void 0,
335
+ "aria-invalid": I ? "true" : void 0,
336
+ ...k
303
337
  }
304
338
  ),
305
339
  /* @__PURE__ */ e(
@@ -307,200 +341,351 @@ const ee = ({ class: n }) => {
307
341
  {
308
342
  type: "button",
309
343
  class: "IncodeDateInputComposedIconButton",
310
- onClick: S,
311
- onTouchEnd: S,
312
- disabled: c,
313
- "aria-label": o ?? "Date",
344
+ onClick: B,
345
+ onTouchEnd: B,
346
+ disabled: d,
347
+ "aria-label": l ?? "Date",
314
348
  tabIndex: -1,
315
- children: /* @__PURE__ */ e("span", { class: "IncodeDateInputComposedIcon", children: /* @__PURE__ */ e(ee, {}) })
349
+ children: /* @__PURE__ */ e("span", { class: "IncodeDateInputComposedIcon", children: /* @__PURE__ */ e(Ve, {}) })
316
350
  }
317
351
  )
318
352
  ] }),
319
- !f && C && /* @__PURE__ */ e(
353
+ !f && I && /* @__PURE__ */ e(
320
354
  "div",
321
355
  {
322
356
  class: "IncodeDateInputComposedErrorWrapper",
323
- "data-testid": `${n}-error-wrapper`,
357
+ "data-testid": `${t}-error-wrapper`,
324
358
  children: [
325
- l && /* @__PURE__ */ e("div", { class: "IncodeDateInputComposedIconWrapper", children: /* @__PURE__ */ e(x, { size: 17 }) }),
326
- /* @__PURE__ */ e("p", { id: P, class: "IncodeDateInputComposedError", children: C })
359
+ c && /* @__PURE__ */ e("div", { class: "IncodeDateInputComposedIconWrapper", children: /* @__PURE__ */ e(Z, { size: 17 }) }),
360
+ /* @__PURE__ */ e("p", { id: T, class: "IncodeDateInputComposedError", children: I })
327
361
  ]
328
362
  }
329
363
  ),
330
- !f && u && !C && /* @__PURE__ */ e(
364
+ !f && C && !I && /* @__PURE__ */ e(
331
365
  "div",
332
366
  {
333
367
  class: "IncodeDateInputComposedHelperWrapper",
334
- "data-testid": `${n}-helper-wrapper`,
368
+ "data-testid": `${t}-helper-wrapper`,
335
369
  children: [
336
- m && /* @__PURE__ */ e("div", { class: "IncodeDateInputComposedIconWrapper", children: /* @__PURE__ */ e(T, { size: 17 }) }),
337
- /* @__PURE__ */ e("p", { id: V, class: "IncodeDateInputComposedHelper", children: u })
370
+ g && /* @__PURE__ */ e("div", { class: "IncodeDateInputComposedIconWrapper", children: /* @__PURE__ */ e(K, { size: 17 }) }),
371
+ /* @__PURE__ */ e("p", { id: W, class: "IncodeDateInputComposedHelper", children: C })
338
372
  ]
339
373
  }
340
374
  )
341
375
  ] });
342
376
  }
343
377
  );
344
- M.displayName = "DateInputComposed";
345
- const O = ({
346
- id: n,
347
- label: o,
348
- placeholder: s = "Choose an option",
349
- value: a,
350
- options: t,
351
- onChange: d,
378
+ de.displayName = "DateInputComposed";
379
+ const ie = ({
380
+ id: t,
381
+ label: l,
382
+ placeholder: i = "Choose an option",
383
+ value: o,
384
+ options: n,
385
+ onChange: h,
352
386
  error: r,
353
- helper: C,
354
- showErrorIcon: l,
355
- showHelperIcon: u,
356
- suppressMessages: m = !1,
387
+ helper: I,
388
+ showErrorIcon: c,
389
+ showHelperIcon: C,
390
+ suppressMessages: g = !1,
357
391
  disabled: f = !1,
358
- required: c,
359
- class: b,
360
- "data-testid": y
392
+ required: d,
393
+ searchable: v = !1,
394
+ searchPlaceholder: y = "Search...",
395
+ noResultsText: L = "No results found",
396
+ name: k,
397
+ tabIndex: R,
398
+ onKeyDown: F,
399
+ onBlur: W,
400
+ renderSelectedLabel: T,
401
+ siblingElement: $,
402
+ enterKeyHint: ee,
403
+ class: B,
404
+ "data-testid": P
361
405
  }) => {
362
- const [i, h] = z(!1), [I, g] = z(-1), V = U(null), P = U(null), k = t.find((p) => p.value === a), H = `${n}-helper`, S = `${n}-error`, w = m ? "" : [C ? H : null, r ? S : null].filter(Boolean).join(" ");
363
- W(() => {
364
- const p = (v) => {
365
- V.current && !V.current.contains(v.target) && h(!1);
366
- };
367
- return i && document.addEventListener("mousedown", p), () => document.removeEventListener("mousedown", p);
368
- }, [i]), W(() => {
369
- i || g(-1);
370
- }, [i]), W(() => {
371
- i && I >= 0 && P.current && P.current.children[I]?.scrollIntoView({ block: "nearest" });
372
- }, [I, i]);
373
- const D = (p) => {
374
- if (!f)
375
- switch (p.key) {
376
- case "ArrowDown":
377
- p.preventDefault(), i ? g(
378
- (v) => v < t.length - 1 ? v + 1 : v
379
- ) : (h(!0), g(0));
380
- break;
381
- case "ArrowUp":
382
- p.preventDefault(), i ? g((v) => v > 0 ? v - 1 : v) : (h(!0), g(t.length - 1));
383
- break;
384
- case "Enter":
385
- case " ":
386
- p.preventDefault(), i && I >= 0 && t[I] ? (d(t[I].value), h(!1)) : i || (h(!0), g(0));
387
- break;
388
- case "Escape":
389
- p.preventDefault(), h(!1);
390
- break;
391
- case "Tab":
392
- h(!1);
393
- break;
394
- }
395
- }, Z = (p) => {
396
- d(p), h(!1);
406
+ const [s, w] = O(!1), [ue, te] = O(!1), [m, p] = O(-1), [j, ne] = O(""), re = V(null), U = V(null), ae = V(null), q = V([]), Y = V(null), Q = V(""), x = V(), z = n.find((a) => a.value === o), b = v && j ? n.filter(
407
+ (a) => a.label.toLowerCase().includes(j.toLowerCase())
408
+ ) : n, X = `${t}-label`, oe = `${t}-listbox`, le = `${t}-helper`, se = `${t}-error`, pe = g ? "" : [I ? le : null, r ? se : null].filter(Boolean).join(" ");
409
+ A(() => {
410
+ if (!s) return;
411
+ const a = requestAnimationFrame(() => {
412
+ v && Y.current && Y.current.focus(), requestAnimationFrame(() => {
413
+ ae.current?.scrollIntoView({
414
+ behavior: "smooth",
415
+ block: "nearest",
416
+ inline: "nearest"
417
+ });
418
+ });
419
+ });
420
+ return () => cancelAnimationFrame(a);
421
+ }, [s, v]), A(() => {
422
+ s || (p(-1), ne(""));
423
+ }, [s]), A(() => {
424
+ m >= 0 && q.current[m] && q.current[m]?.scrollIntoView({
425
+ block: "nearest",
426
+ inline: "nearest"
427
+ });
428
+ }, [m]), A(() => () => {
429
+ x.current && clearTimeout(x.current);
430
+ }, []);
431
+ const he = () => {
432
+ f || w((a) => !a);
433
+ }, G = (a) => {
434
+ h(a), w(!1), p(-1), U.current?.focus();
435
+ }, Ce = () => {
436
+ te(!0);
437
+ }, Ie = (a) => {
438
+ te(!1), re.current?.contains(a.relatedTarget) || (w(!1), W?.());
439
+ }, fe = (a) => {
440
+ if (f) return;
441
+ F?.(a);
442
+ const { key: D } = a;
443
+ if (D.length === 1 && /^[a-zA-Z0-9]$/.test(D)) {
444
+ a.preventDefault(), x.current && clearTimeout(x.current), Q.current += D.toLowerCase();
445
+ const u = b.findIndex(
446
+ (ve) => ve.label.toLowerCase().startsWith(Q.current)
447
+ );
448
+ u !== -1 && (s || w(!0), p(u)), x.current = setTimeout(() => {
449
+ Q.current = "";
450
+ }, 500);
451
+ return;
452
+ }
453
+ switch (D) {
454
+ case "ArrowDown":
455
+ a.preventDefault(), s ? p(
456
+ (u) => u < b.length - 1 ? u + 1 : u
457
+ ) : (w(!0), p(0));
458
+ break;
459
+ case "ArrowUp":
460
+ a.preventDefault(), s ? p((u) => u > 0 ? u - 1 : u) : (w(!0), p(b.length - 1));
461
+ break;
462
+ case "Home":
463
+ a.preventDefault(), s && p(0);
464
+ break;
465
+ case "End":
466
+ a.preventDefault(), s && p(b.length - 1);
467
+ break;
468
+ case "Enter":
469
+ a.preventDefault(), s && m >= 0 && b[m] ? G(b[m].value) : s || w(!0);
470
+ break;
471
+ case " ":
472
+ a.preventDefault(), s && m >= 0 && b[m] ? G(b[m].value) : s || (w(!0), p(0));
473
+ break;
474
+ case "Escape":
475
+ a.preventDefault(), s && (w(!1), p(-1), U.current?.focus());
476
+ break;
477
+ case "Tab":
478
+ s && (w(!1), p(-1));
479
+ break;
480
+ }
481
+ }, me = (a) => {
482
+ const { key: D } = a;
483
+ switch (D) {
484
+ case "ArrowDown":
485
+ a.preventDefault(), p(
486
+ (u) => u < b.length - 1 ? u + 1 : u
487
+ );
488
+ break;
489
+ case "ArrowUp":
490
+ a.preventDefault(), p((u) => u > 0 ? u - 1 : u);
491
+ break;
492
+ case "Home":
493
+ a.preventDefault(), p(0);
494
+ break;
495
+ case "End":
496
+ a.preventDefault(), p(b.length - 1);
497
+ break;
498
+ case "Enter":
499
+ a.preventDefault(), m >= 0 && b[m] && G(b[m].value);
500
+ break;
501
+ case "Escape":
502
+ a.preventDefault(), w(!1), p(-1), U.current?.focus();
503
+ break;
504
+ case "Tab":
505
+ w(!1), p(-1);
506
+ break;
507
+ }
397
508
  };
398
- return /* @__PURE__ */ e("div", { class: $("IncodeDropdownComposed", b), ref: V, children: [
399
- o && /* @__PURE__ */ e(
400
- "label",
401
- {
402
- class: "IncodeDropdownComposedLabel",
403
- htmlFor: n,
404
- "data-testid": `${n}-label`,
405
- children: [
406
- o,
407
- c && /* @__PURE__ */ e("span", { class: "IncodeDropdownComposedRequired", children: " *" })
408
- ]
409
- }
410
- ),
411
- /* @__PURE__ */ e("div", { class: "IncodeDropdownComposedWrapper", children: [
412
- /* @__PURE__ */ e(
413
- "button",
414
- {
415
- type: "button",
416
- id: n,
417
- class: "IncodeDropdownComposedTrigger",
418
- onClick: () => !f && h((p) => !p),
419
- onKeyDown: D,
420
- disabled: f,
421
- "aria-haspopup": "listbox",
422
- "aria-expanded": i ? "true" : "false",
423
- "aria-label": o ?? s,
424
- "aria-describedby": w || void 0,
425
- "aria-required": c ? "true" : void 0,
426
- "aria-invalid": r ? "true" : void 0,
427
- "data-testid": y,
428
- children: [
429
- /* @__PURE__ */ e(
430
- "span",
431
- {
432
- class: k ? "IncodeDropdownComposedTriggerText" : "IncodeDropdownComposedTriggerPlaceholder",
433
- children: k ? k.label : s
434
- }
435
- ),
436
- /* @__PURE__ */ e(
437
- "span",
438
- {
439
- class: "IncodeDropdownComposedTriggerIcon",
440
- "aria-hidden": "true",
441
- "data-open": i,
442
- children: /* @__PURE__ */ e(_, {})
443
- }
444
- )
445
- ]
446
- }
447
- ),
448
- i && /* @__PURE__ */ e(
449
- "div",
450
- {
451
- ref: P,
452
- class: "IncodeDropdownComposedList",
453
- role: "listbox",
454
- "aria-label": o ?? s,
455
- children: t.map((p, v) => /* @__PURE__ */ e(
509
+ return /* @__PURE__ */ e(
510
+ "div",
511
+ {
512
+ class: E("IncodeDropdownComposed", B),
513
+ ref: re,
514
+ onBlur: Ie,
515
+ children: [
516
+ k && /* @__PURE__ */ e(
517
+ "input",
518
+ {
519
+ type: "hidden",
520
+ name: k,
521
+ value: o || "",
522
+ disabled: f,
523
+ required: d
524
+ }
525
+ ),
526
+ l && /* @__PURE__ */ e(
527
+ "label",
528
+ {
529
+ class: "IncodeDropdownComposedLabel",
530
+ id: X,
531
+ htmlFor: t,
532
+ "data-testid": `${t}-label`,
533
+ children: [
534
+ l,
535
+ d && /* @__PURE__ */ e("span", { class: "IncodeDropdownComposedRequired", children: " *" })
536
+ ]
537
+ }
538
+ ),
539
+ /* @__PURE__ */ e("div", { class: "IncodeDropdownComposedWrapper", children: [
540
+ /* @__PURE__ */ e(
456
541
  "div",
457
542
  {
458
- role: "option",
459
- "aria-selected": a === p.value ? "true" : "false",
460
- class: "IncodeDropdownComposedOption",
461
- "data-highlighted": I === v,
462
- onClick: () => Z(p.value),
463
- onMouseDown: (A) => A.preventDefault(),
464
- onMouseEnter: () => g(v),
465
- children: p.label
466
- },
467
- p.value
468
- ))
469
- }
470
- )
471
- ] }),
472
- !m && r && /* @__PURE__ */ e(
473
- "div",
474
- {
475
- class: "IncodeDropdownComposedErrorWrapper",
476
- "data-testid": `${n}-error-wrapper`,
477
- children: [
478
- l && /* @__PURE__ */ e("div", { class: "IncodeDropdownComposedIconWrapper", children: /* @__PURE__ */ e(x, { size: 17 }) }),
479
- /* @__PURE__ */ e("p", { id: S, class: "IncodeDropdownComposedError", children: r })
480
- ]
481
- }
482
- ),
483
- !m && C && !r && /* @__PURE__ */ e(
484
- "div",
485
- {
486
- class: "IncodeDropdownComposedHelperWrapper",
487
- "data-testid": `${n}-helper-wrapper`,
488
- children: [
489
- u && /* @__PURE__ */ e("div", { class: "IncodeDropdownComposedIconWrapper", children: /* @__PURE__ */ e(T, { size: 17 }) }),
490
- /* @__PURE__ */ e("p", { id: H, class: "IncodeDropdownComposedHelper", children: C })
491
- ]
492
- }
493
- )
494
- ] });
495
- }, ae = ({
496
- form: n,
497
- isValid: o,
498
- onFormChange: s,
499
- onGenerate: a,
500
- disabled: t = !1,
501
- labels: d
543
+ class: E("IncodeDropdownComposedTriggerRow", {
544
+ IncodeDropdownComposedTriggerRowWithSibling: !!$
545
+ }),
546
+ children: [
547
+ /* @__PURE__ */ e(
548
+ "button",
549
+ {
550
+ ref: U,
551
+ type: "button",
552
+ id: t,
553
+ class: "IncodeDropdownComposedTrigger",
554
+ onClick: he,
555
+ onFocus: Ce,
556
+ onKeyDown: fe,
557
+ tabIndex: f ? -1 : R ?? 0,
558
+ disabled: f,
559
+ "aria-haspopup": "listbox",
560
+ "aria-expanded": s ? "true" : "false",
561
+ "aria-disabled": f ? "true" : void 0,
562
+ "aria-labelledby": l ? X : void 0,
563
+ "aria-label": l ? void 0 : i,
564
+ "aria-controls": s ? oe : void 0,
565
+ "aria-activedescendant": s && m >= 0 ? `${t}-option-${m}` : void 0,
566
+ "aria-invalid": r ? "true" : void 0,
567
+ "aria-required": d ? "true" : void 0,
568
+ "aria-describedby": pe || void 0,
569
+ "data-error": r ? "true" : void 0,
570
+ "data-focused": ue || s ? "true" : void 0,
571
+ "data-testid": P,
572
+ children: [
573
+ /* @__PURE__ */ e(
574
+ "span",
575
+ {
576
+ class: z ? "IncodeDropdownComposedTriggerText" : "IncodeDropdownComposedTriggerPlaceholder",
577
+ children: z ? T ? T(z) : z.label : i
578
+ }
579
+ ),
580
+ /* @__PURE__ */ e(
581
+ "span",
582
+ {
583
+ class: "IncodeDropdownComposedTriggerIcon",
584
+ "aria-hidden": "true",
585
+ "data-open": s,
586
+ children: /* @__PURE__ */ e(Re, {})
587
+ }
588
+ )
589
+ ]
590
+ }
591
+ ),
592
+ $ && /* @__PURE__ */ e("div", { class: "IncodeDropdownComposedSibling", children: $ })
593
+ ]
594
+ }
595
+ ),
596
+ s && /* @__PURE__ */ e(
597
+ "div",
598
+ {
599
+ ref: ae,
600
+ id: oe,
601
+ class: "IncodeDropdownComposedList",
602
+ role: "listbox",
603
+ "aria-labelledby": l ? X : void 0,
604
+ "aria-label": l ? void 0 : i,
605
+ "data-error": r ? "true" : void 0,
606
+ children: [
607
+ v && /* @__PURE__ */ e("div", { class: "IncodeDropdownComposedSearchWrapper", children: /* @__PURE__ */ e("div", { class: "IncodeDropdownComposedSearchInner", children: [
608
+ /* @__PURE__ */ e(
609
+ "input",
610
+ {
611
+ ref: Y,
612
+ type: "text",
613
+ class: "IncodeDropdownComposedSearchInput",
614
+ value: j,
615
+ onInput: (a) => {
616
+ ne(a.target.value), p(0);
617
+ },
618
+ onKeyDown: me,
619
+ placeholder: y,
620
+ "aria-label": y,
621
+ autocomplete: "off"
622
+ }
623
+ ),
624
+ /* @__PURE__ */ e(
625
+ "span",
626
+ {
627
+ class: "IncodeDropdownComposedSearchIcon",
628
+ "aria-hidden": "true",
629
+ children: /* @__PURE__ */ e(Pe, { size: 20 })
630
+ }
631
+ )
632
+ ] }) }),
633
+ /* @__PURE__ */ e("div", { class: "IncodeDropdownComposedOptionsScroll", children: b.length === 0 ? /* @__PURE__ */ e("div", { class: "IncodeDropdownComposedNoResults", children: L }) : b.map((a, D) => /* @__PURE__ */ e(
634
+ "div",
635
+ {
636
+ id: `${t}-option-${D}`,
637
+ role: "option",
638
+ "aria-selected": o === a.value ? "true" : "false",
639
+ class: "IncodeDropdownComposedOption",
640
+ "data-highlighted": m === D,
641
+ ref: (u) => {
642
+ q.current[D] = u;
643
+ },
644
+ onClick: () => G(a.value),
645
+ onMouseDown: (u) => u.preventDefault(),
646
+ onMouseEnter: () => p(D),
647
+ children: a.label
648
+ },
649
+ a.value
650
+ )) })
651
+ ]
652
+ }
653
+ )
654
+ ] }),
655
+ !g && r && /* @__PURE__ */ e(
656
+ "div",
657
+ {
658
+ class: "IncodeDropdownComposedErrorWrapper",
659
+ "data-testid": `${t}-error-wrapper`,
660
+ children: [
661
+ c && /* @__PURE__ */ e("div", { class: "IncodeDropdownComposedIconWrapper", children: /* @__PURE__ */ e(Z, { size: 17 }) }),
662
+ /* @__PURE__ */ e("p", { id: se, class: "IncodeDropdownComposedError", children: r })
663
+ ]
664
+ }
665
+ ),
666
+ !g && I && !r && /* @__PURE__ */ e(
667
+ "div",
668
+ {
669
+ class: "IncodeDropdownComposedHelperWrapper",
670
+ "data-testid": `${t}-helper-wrapper`,
671
+ children: [
672
+ C && /* @__PURE__ */ e("div", { class: "IncodeDropdownComposedIconWrapper", children: /* @__PURE__ */ e(K, { size: 17 }) }),
673
+ /* @__PURE__ */ e("p", { id: le, class: "IncodeDropdownComposedHelper", children: I })
674
+ ]
675
+ }
676
+ )
677
+ ]
678
+ }
679
+ );
680
+ }, $e = ({
681
+ form: t,
682
+ isValid: l,
683
+ onFormChange: i,
684
+ onGenerate: o,
685
+ disabled: n = !1,
686
+ labels: h
502
687
  }) => {
503
- const { t: r } = B(), l = { ...{
688
+ const { t: r } = J(), c = { ...{
504
689
  firstName: r("curp.labels.firstName") ?? "Your First name",
505
690
  firstLast: r("curp.labels.firstLast") ?? "Your First last name",
506
691
  secondLast: r("curp.labels.secondLast") ?? "Your Second last name",
@@ -513,227 +698,229 @@ const O = ({
513
698
  birthState: r("curp.labels.birthState") ?? "State of birth",
514
699
  statePlaceholder: r("curp.placeholder.state") ?? "Select state",
515
700
  generate: r("curp.generateCta") ?? "Generate CURP"
516
- }, ...d }, u = (c) => (b) => {
517
- const y = b.target;
518
- s({ [c]: y.value });
519
- }, m = [
520
- { value: "H", label: l.male },
521
- { value: "M", label: l.female },
522
- { value: "X", label: l.other }
523
- ], f = q.map((c) => ({
524
- value: c.value,
525
- label: c.label
701
+ }, ...h }, C = (d) => (v) => {
702
+ const y = v.target;
703
+ i({ [d]: y.value });
704
+ }, g = [
705
+ { value: "H", label: c.male },
706
+ { value: "M", label: c.female },
707
+ { value: "X", label: c.other }
708
+ ], f = we.map((d) => ({
709
+ value: d.value,
710
+ label: d.label
526
711
  }));
527
712
  return /* @__PURE__ */ e("div", { class: "IncodeCurpValidation IncodeGenerateCurpForm", children: [
528
713
  /* @__PURE__ */ e(
529
- N,
714
+ M,
530
715
  {
531
716
  id: "curp-first-name",
532
- label: l.firstName,
533
- value: n.name,
534
- onInput: u("name"),
535
- placeholder: l.firstName,
536
- disabled: t,
717
+ label: c.firstName,
718
+ value: t.name,
719
+ onInput: C("name"),
720
+ placeholder: c.firstName,
721
+ disabled: n,
537
722
  autoComplete: "given-name"
538
723
  }
539
724
  ),
540
725
  /* @__PURE__ */ e(
541
- N,
726
+ M,
542
727
  {
543
728
  id: "curp-first-last",
544
- label: l.firstLast,
545
- value: n.firstLastName,
546
- onInput: u("firstLastName"),
547
- placeholder: l.firstLast,
548
- disabled: t
729
+ label: c.firstLast,
730
+ value: t.firstLastName,
731
+ onInput: C("firstLastName"),
732
+ placeholder: c.firstLast,
733
+ disabled: n
549
734
  }
550
735
  ),
551
736
  /* @__PURE__ */ e(
552
- N,
737
+ M,
553
738
  {
554
739
  id: "curp-second-last",
555
- label: l.secondLast,
556
- value: n.secondLastName,
557
- onInput: u("secondLastName"),
558
- placeholder: l.secondLast,
559
- disabled: t
740
+ label: c.secondLast,
741
+ value: t.secondLastName,
742
+ onInput: C("secondLastName"),
743
+ placeholder: c.secondLast,
744
+ disabled: n
560
745
  }
561
746
  ),
562
747
  /* @__PURE__ */ e(
563
- O,
748
+ ie,
564
749
  {
565
750
  id: "curp-gender",
566
- label: l.gender,
567
- placeholder: l.genderPlaceholder,
568
- value: n.gender,
569
- options: m,
570
- disabled: t,
571
- onChange: (c) => s({ gender: c }),
751
+ label: c.gender,
752
+ placeholder: c.genderPlaceholder,
753
+ value: t.gender,
754
+ options: g,
755
+ disabled: n,
756
+ onChange: (d) => i({ gender: d }),
572
757
  "data-testid": "curp-gender"
573
758
  }
574
759
  ),
575
760
  /* @__PURE__ */ e(
576
- M,
761
+ de,
577
762
  {
578
763
  id: "curp-birth-date",
579
- label: l.dob,
580
- value: n.birthDate,
581
- onInput: u("birthDate"),
764
+ label: c.dob,
765
+ value: t.birthDate,
766
+ onInput: C("birthDate"),
582
767
  max: (/* @__PURE__ */ new Date()).toISOString().split("T")[0],
583
768
  placeholder: r("curp.placeholder.dob") ?? "mm/dd/yyyy",
584
- disabled: t,
769
+ disabled: n,
585
770
  "data-testid": "curp-birth-date"
586
771
  }
587
772
  ),
588
773
  /* @__PURE__ */ e(
589
- O,
774
+ ie,
590
775
  {
591
776
  id: "curp-birth-state",
592
- label: l.birthState,
593
- placeholder: l.statePlaceholder,
594
- value: n.birthState,
777
+ label: c.birthState,
778
+ placeholder: c.statePlaceholder,
779
+ value: t.birthState,
595
780
  options: f,
596
- disabled: t,
597
- onChange: (c) => s({ birthState: c }),
598
- "data-testid": "curp-birth-state"
781
+ disabled: n,
782
+ onChange: (d) => i({ birthState: d }),
783
+ "data-testid": "curp-birth-state",
784
+ searchable: !0
599
785
  }
600
786
  ),
787
+ /* @__PURE__ */ e(S, { size: 16 }),
601
788
  /* @__PURE__ */ e(
602
- E,
789
+ N,
603
790
  {
604
791
  type: "button",
605
- onClick: a,
606
- disabled: !o || t,
792
+ onClick: o,
793
+ disabled: !l || n,
607
794
  "data-testid": "curp-generate",
608
- children: l.generate
795
+ children: c.generate
609
796
  }
610
797
  )
611
798
  ] });
612
- }, oe = ({
613
- config: n,
614
- onFinish: o,
615
- onError: s
799
+ }, xe = ({
800
+ config: t,
801
+ onFinish: l,
802
+ onError: i
616
803
  }) => {
617
- const { t: a } = B(), [t, d] = Y(() => {
618
- if (!n)
804
+ const { t: o } = J(), [n, h] = ge(() => {
805
+ if (!t)
619
806
  throw new Error("CURP validation config is required");
620
- return K({ config: n });
807
+ return De({ config: t });
621
808
  });
622
- if (t.status === "idle" || t.status === "loading" || t.status === "verifying" || t.status === "generating") {
623
- const r = t.status === "generating" ? a("curp.status.generating") ?? "Generating..." : a("curp.status.verifying") ?? "Verifying...";
624
- return /* @__PURE__ */ e(R, { className: "IncodeCurpValidationPage", children: /* @__PURE__ */ e("div", { class: "IncodeCurpValidation IncodeCurpLoading", children: /* @__PURE__ */ e(Q, { title: r, fullScreen: !1 }) }) });
809
+ if (n.status === "idle" || n.status === "loading" || n.status === "verifying" || n.status === "generating") {
810
+ const r = n.status === "generating" ? o("curp.status.generating") ?? "Generating..." : o("curp.status.verifying") ?? "Verifying...";
811
+ return /* @__PURE__ */ e(H, { className: "IncodeCurpValidationPage", children: /* @__PURE__ */ e("div", { class: "IncodeCurpValidation IncodeCurpLoading", children: /* @__PURE__ */ e(Le, { title: r, fullScreen: !1 }) }) });
625
812
  }
626
- if (t.status === "enterCurp")
813
+ if (n.status === "enterCurp")
627
814
  return /* @__PURE__ */ e(
628
- R,
815
+ H,
629
816
  {
630
817
  className: "IncodeCurpValidationPage",
631
- title: a("curp.enterCurp") ?? "Enter your CURP",
818
+ title: o("curp.enterCurp") ?? "Enter your CURP",
632
819
  children: /* @__PURE__ */ e(
633
- re,
820
+ Te,
634
821
  {
635
- curp: t.curp,
636
- isValid: t.isValid,
637
- onCurpChange: (r) => d.setCurp(r),
638
- onVerify: () => d.verify(),
639
- onSwitchToGenerate: () => d.switchToGenerate(),
640
- placeholder: a("curp.placeholder.curp") ?? "CURP",
641
- continueLabel: a("curp.continue") ?? "Continue",
642
- dontHaveLabel: a("curp.dontHave") ?? "I don't have my CURP"
822
+ curp: n.curp,
823
+ isValid: n.isValid,
824
+ onCurpChange: (r) => h.setCurp(r),
825
+ onVerify: () => h.verify(),
826
+ onSwitchToGenerate: () => h.switchToGenerate(),
827
+ placeholder: o("curp.placeholder.curp") ?? "CURP",
828
+ continueLabel: o("curp.continue") ?? "Continue",
829
+ dontHaveLabel: o("curp.dontHave") ?? "I don't have my CURP"
643
830
  }
644
831
  )
645
832
  }
646
833
  );
647
- if (t.status === "generateCurp")
834
+ if (n.status === "generateCurp")
648
835
  return /* @__PURE__ */ e(
649
- R,
836
+ H,
650
837
  {
651
838
  className: "IncodeCurpValidationPage",
652
- title: a("curp.generate") ?? "Generate your CURP",
839
+ title: o("curp.generate") ?? "Generate your CURP",
653
840
  children: /* @__PURE__ */ e(
654
- ae,
841
+ $e,
655
842
  {
656
- form: t.form,
657
- isValid: t.isValid,
658
- onFormChange: (r) => d.setGenerateForm(r),
659
- onGenerate: () => d.generate()
843
+ form: n.form,
844
+ isValid: n.isValid,
845
+ onFormChange: (r) => h.setGenerateForm(r),
846
+ onGenerate: () => h.generate()
660
847
  }
661
848
  )
662
849
  }
663
850
  );
664
- if (t.status === "confirmCurp")
851
+ if (n.status === "confirmCurp")
665
852
  return /* @__PURE__ */ e(
666
- R,
853
+ H,
667
854
  {
668
855
  className: "IncodeCurpValidationPage",
669
- title: a("curp.status.confirm") ?? "Confirm your CURP",
856
+ title: o("curp.status.confirm") ?? "Confirm your CURP",
670
857
  children: /* @__PURE__ */ e("div", { class: "IncodeCurpValidation IncodeCurpConfirm", children: [
671
858
  /* @__PURE__ */ e(
672
859
  "input",
673
860
  {
674
861
  type: "text",
675
862
  class: "IncodeCurpConfirmInput",
676
- value: t.curp,
863
+ value: n.curp,
677
864
  readOnly: !0,
678
- "aria-label": a("curp.status.generatedCurp") ?? "Generated CURP"
865
+ "aria-label": o("curp.status.generatedCurp") ?? "Generated CURP"
679
866
  }
680
867
  ),
681
- /* @__PURE__ */ e(L, {}),
868
+ /* @__PURE__ */ e(S, {}),
682
869
  /* @__PURE__ */ e(
683
- E,
870
+ N,
684
871
  {
685
872
  type: "button",
686
- onClick: () => d.confirmGenerated(),
873
+ onClick: () => h.confirmGenerated(),
687
874
  "data-testid": "curp-confirm",
688
- children: a("curp.continue") ?? "Continue"
875
+ children: o("curp.continue") ?? "Continue"
689
876
  }
690
877
  )
691
878
  ] })
692
879
  }
693
880
  );
694
- if (t.status === "success")
695
- return /* @__PURE__ */ e(R, { className: "IncodeCurpValidationPage", children: /* @__PURE__ */ e("div", { class: "IncodeCurpValidation IncodeCurpSuccess", children: [
696
- /* @__PURE__ */ e(T, { size: 32 }),
697
- /* @__PURE__ */ e(L, { size: 16 }),
698
- /* @__PURE__ */ e("h2", { class: "IncodeCurpSuccessTitle", children: a("curp.status.verified") ?? "Verified" })
881
+ if (n.status === "success")
882
+ return /* @__PURE__ */ e(H, { className: "IncodeCurpValidationPage", children: /* @__PURE__ */ e("div", { class: "IncodeCurpValidation IncodeCurpSuccess", children: [
883
+ /* @__PURE__ */ e(K, { size: 32 }),
884
+ /* @__PURE__ */ e(S, { size: 16 }),
885
+ /* @__PURE__ */ e("h2", { class: "IncodeCurpSuccessTitle", children: o("curp.status.verified") ?? "Verified" })
699
886
  ] }) });
700
- if (t.status === "failure" || t.status === "generateError") {
701
- const r = t.retriesLeft > 0, C = t.status === "failure" ? a("curp.status.notVerified") ?? "Not verified" : a("curp.status.couldntGenerate") ?? "Couldn't generate CURP";
702
- return /* @__PURE__ */ e(R, { className: "IncodeCurpValidationPage", children: /* @__PURE__ */ e("div", { class: "IncodeCurpValidation IncodeCurpFailure", children: [
703
- /* @__PURE__ */ e(L, {}),
704
- /* @__PURE__ */ e(x, { size: 32 }),
705
- /* @__PURE__ */ e(L, { size: 16 }),
706
- /* @__PURE__ */ e("h2", { class: "IncodeCurpFailureTitle", children: C }),
707
- t.status === "generateError" && r && /* @__PURE__ */ e(F, { children: [
708
- /* @__PURE__ */ e(L, { size: 12 }),
709
- /* @__PURE__ */ e("p", { class: "IncodeCurpFailureHint", children: a("curp.status.checkInfo") ?? "Please check your information" })
887
+ if (n.status === "failure" || n.status === "generateError") {
888
+ const r = n.retriesLeft > 0, I = n.status === "failure" ? o("curp.status.notVerified") ?? "Not verified" : o("curp.status.couldntGenerate") ?? "Couldn't generate CURP";
889
+ return /* @__PURE__ */ e(H, { className: "IncodeCurpValidationPage", children: /* @__PURE__ */ e("div", { class: "IncodeCurpValidation IncodeCurpFailure", children: [
890
+ /* @__PURE__ */ e(S, {}),
891
+ /* @__PURE__ */ e(Z, { size: 32 }),
892
+ /* @__PURE__ */ e(S, { size: 16 }),
893
+ /* @__PURE__ */ e("h2", { class: "IncodeCurpFailureTitle", children: I }),
894
+ n.status === "generateError" && r && /* @__PURE__ */ e(ce, { children: [
895
+ /* @__PURE__ */ e(S, { size: 12 }),
896
+ /* @__PURE__ */ e("p", { class: "IncodeCurpFailureHint", children: o("curp.status.checkInfo") ?? "Please check your information" })
710
897
  ] }),
711
- /* @__PURE__ */ e(L, {}),
712
- r && /* @__PURE__ */ e(F, { children: /* @__PURE__ */ e(
713
- E,
898
+ /* @__PURE__ */ e(S, {}),
899
+ r && /* @__PURE__ */ e(ce, { children: /* @__PURE__ */ e(
900
+ N,
714
901
  {
715
902
  type: "button",
716
- onClick: () => d.retry(),
903
+ onClick: () => h.retry(),
717
904
  "data-testid": "curp-retry",
718
- children: t.status === "failure" ? a("curp.status.tryAgain") ?? "Try again" : a("curp.status.edit") ?? "Edit information"
905
+ children: n.status === "failure" ? o("curp.status.tryAgain") ?? "Try again" : o("curp.status.edit") ?? "Edit information"
719
906
  }
720
907
  ) })
721
908
  ] }) });
722
909
  }
723
- return t.status === "finished" ? (o?.(), null) : (t.status === "closed" && s?.(void 0), null);
724
- }, le = ({
725
- config: n,
726
- onFinish: o,
727
- onError: s
728
- }) => /* @__PURE__ */ e(J, { children: n ? /* @__PURE__ */ e(
729
- oe,
910
+ return n.status === "finished" ? (l?.(), null) : (n.status === "closed" && i?.(void 0), null);
911
+ }, Ee = ({
912
+ config: t,
913
+ onFinish: l,
914
+ onError: i
915
+ }) => /* @__PURE__ */ e(ke, { children: t ? /* @__PURE__ */ e(
916
+ xe,
730
917
  {
731
- config: n,
732
- onFinish: o,
733
- onError: s
918
+ config: t,
919
+ onFinish: l,
920
+ onError: i
734
921
  }
735
922
  ) : null });
736
- j(le, "incode-curp-validation");
923
+ be(Ee, "incode-curp-validation");
737
924
  export {
738
- le as CurpValidation
925
+ Ee as CurpValidation
739
926
  };