@incodetech/web 0.0.0-dev-20260302-ad37d43 → 0.0.0-dev-20260302-e38ab90
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.
- package/dist/{Trans-Bdg0o_Cr.js → Trans-BHurUlNG.js} +3 -3
- package/dist/authentication/authentication.es.js +5 -5
- package/dist/base.css +41 -1
- package/dist/{baseTutorial-BgA1dpRi.js → baseTutorial-Bbadb04i.js} +5 -5
- package/dist/{chevronDown-C5Kn1woB.js → chevronDown-CIyU9-x9.js} +1 -1
- package/dist/countries-DDCxQhGs.js +3206 -0
- package/dist/curp-validation/curp-validation.es.js +182 -797
- package/dist/curp-validation/styles.css +4 -1
- package/dist/dateInputComposed-BwjWmZFc.js +172 -0
- package/dist/{documentUpload-h5GfSa2m.js → documentUpload-BnXvLmkL.js} +4 -4
- package/dist/dropdownComposed-vWK3dHjS.js +461 -0
- package/dist/ekyb/styles.css +107 -0
- package/dist/ekybModule-Dm04An2k.js +243 -0
- package/dist/ekyc/styles.css +274 -0
- package/dist/ekycModule-DQO4I6h1.js +451 -0
- package/dist/email/email.es.js +4 -4
- package/dist/{errorIcon-BT7Rf4z7.js → errorIcon-hyIEsKoP.js} +1 -1
- package/dist/{faceMatch-DL5ICOMJ.js → faceMatch-CTYWaJ2M.js} +4 -4
- package/dist/flow/flow.es.js +191 -161
- package/dist/flow/styles.css +536 -1
- package/dist/geolocation/geolocation.es.js +5 -5
- package/dist/governmentValidation/governmentValidation.es.js +8 -8
- package/dist/id/id.es.js +7 -7
- package/dist/{incodeComponent-BUltqUSz.js → incodeComponent-DSqGVqSo.js} +3 -3
- package/dist/{incodeModule-BwGymwZT.js → incodeModule-_kfNnq5z.js} +1 -1
- package/dist/index.es.js +2 -2
- package/dist/{otpInput-B7TR21xE.js → otpInput-Bx16y6dR.js} +2 -2
- package/dist/phone/phone.es.js +133 -3332
- package/dist/{processing-B7fzlPZl.js → processing-BuaxyhmY.js} +3 -3
- package/dist/selfie/selfie.es.js +6 -6
- package/dist/{setup-CFo1IZlN.js → setup-B6jZts5S.js} +2 -2
- package/dist/{spinner-BiENeSCl.js → spinner-Ogo-u91P.js} +2 -2
- package/dist/{successIcon-CTA9p_2h.js → successIcon-Ci24t3I5.js} +1 -1
- package/dist/{tutorial-DGo0fw3f.js → tutorial-637lvO4s.js} +7 -7
- package/dist/types/ekyb/styles.d.ts +1 -0
- package/dist/types/ekyc/styles.d.ts +1 -0
- package/dist/{uiConfig-BG6lJ_HG.js → uiConfig-CbMyDWix.js} +1 -1
- package/dist/{useTranslation-Cm51-Wm-.js → useTranslation-B1jrtqlW.js} +1 -1
- package/dist/{vendor-preact-CM6KQyKc.js → vendor-preact-BDue3y7V.js} +1 -0
- package/dist/verificationResult-BMHBsZ8s.js +106 -0
- package/package.json +17 -3
|
@@ -1,926 +1,311 @@
|
|
|
1
|
-
import { u as e,
|
|
2
|
-
import { mexicanStates as
|
|
3
|
-
import {
|
|
1
|
+
import { u as e, S as c, B as h, r as S, a as N } from "../incodeModule-_kfNnq5z.js";
|
|
2
|
+
import { mexicanStates as G, createCurpValidationManager as R } from "@incodetech/core/curp-validation";
|
|
3
|
+
import { k as y } from "../vendor-preact-BDue3y7V.js";
|
|
4
4
|
import "@incodetech/core";
|
|
5
5
|
import "../instance-B-q0ZREN.js";
|
|
6
|
-
import { u as
|
|
7
|
-
import { I as
|
|
8
|
-
import { E as
|
|
9
|
-
import { S as
|
|
10
|
-
import { S as
|
|
11
|
-
import { C as
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
"aria-labelledby": l,
|
|
24
|
-
class: t,
|
|
25
|
-
children: [
|
|
26
|
-
/* @__PURE__ */ e("title", { id: l, children: "Calendar icon" }),
|
|
27
|
-
/* @__PURE__ */ e(
|
|
28
|
-
"path",
|
|
29
|
-
{
|
|
30
|
-
fillRule: "evenodd",
|
|
31
|
-
clipRule: "evenodd",
|
|
32
|
-
d: "M7.50244 10.1563C7.50244 9.74204 7.83823 9.40625 8.25244 9.40625H16.7485C17.1627 9.40625 17.4985 9.74204 17.4985 10.1563C17.4985 10.5705 17.1627 10.9063 16.7485 10.9063H8.25244C7.83823 10.9063 7.50244 10.5705 7.50244 10.1563Z",
|
|
33
|
-
fill: "currentColor"
|
|
34
|
-
}
|
|
35
|
-
),
|
|
36
|
-
/* @__PURE__ */ e(
|
|
37
|
-
"path",
|
|
38
|
-
{
|
|
39
|
-
fillRule: "evenodd",
|
|
40
|
-
clipRule: "evenodd",
|
|
41
|
-
d: "M16.1406 2.25C16.5548 2.25 16.8906 2.58579 16.8906 3V5.96174C16.8906 6.37595 16.5548 6.71174 16.1406 6.71174C15.7264 6.71174 15.3906 6.37595 15.3906 5.96174V3C15.3906 2.58579 15.7264 2.25 16.1406 2.25Z",
|
|
42
|
-
fill: "currentColor"
|
|
43
|
-
}
|
|
44
|
-
),
|
|
45
|
-
/* @__PURE__ */ e(
|
|
46
|
-
"path",
|
|
47
|
-
{
|
|
48
|
-
fillRule: "evenodd",
|
|
49
|
-
clipRule: "evenodd",
|
|
50
|
-
d: "M8.86816 2.25C9.28238 2.25 9.61816 2.58579 9.61816 3V5.96174C9.61816 6.37595 9.28238 6.71174 8.86816 6.71174C8.45395 6.71174 8.11816 6.37595 8.11816 5.96174V3C8.11816 2.58579 8.45395 2.25 8.86816 2.25Z",
|
|
51
|
-
fill: "currentColor"
|
|
52
|
-
}
|
|
53
|
-
),
|
|
54
|
-
/* @__PURE__ */ e(
|
|
55
|
-
"path",
|
|
56
|
-
{
|
|
57
|
-
fillRule: "evenodd",
|
|
58
|
-
clipRule: "evenodd",
|
|
59
|
-
d: "M5.0392 4.95256C5.95822 4.07897 7.23731 3.67188 8.69414 3.67188H16.3145C17.7746 3.67188 19.0544 4.07865 19.9721 4.95323C20.8955 5.83327 21.3546 7.094 21.3504 8.60132C21.3504 8.6011 21.3504 8.60154 21.3504 8.60132V16.8137C21.3504 18.3212 20.8891 19.5831 19.9657 20.4646C19.0476 21.341 17.768 21.7504 16.3067 21.7504H8.69414C7.23281 21.7504 5.95209 21.3322 5.03394 20.4423C4.11207 19.5488 3.65039 18.2716 3.65039 16.7456V8.59984C3.65039 7.09167 4.11438 5.83167 5.0392 4.95256ZM6.07265 6.03976C5.51149 6.57317 5.15039 7.40215 5.15039 8.59984V16.7456C5.15039 17.9683 5.5138 18.8185 6.0779 19.3652C6.64573 19.9156 7.51189 20.2504 8.69414 20.2504H16.3067C17.4968 20.2504 18.364 19.9198 18.93 19.3796C19.4906 18.8445 19.8504 18.013 19.8504 16.8137V8.59984V8.59768C19.8539 7.39945 19.4958 6.57144 18.9372 6.03908C18.3728 5.50115 17.5058 5.17187 16.3145 5.17187H8.69414C7.50739 5.17187 6.6396 5.50083 6.07265 6.03976Z",
|
|
60
|
-
fill: "currentColor"
|
|
61
|
-
}
|
|
62
|
-
)
|
|
63
|
-
]
|
|
64
|
-
}
|
|
65
|
-
);
|
|
66
|
-
}, Se = ({
|
|
67
|
-
width: t = 14,
|
|
68
|
-
height: l = 14,
|
|
69
|
-
class: i
|
|
70
|
-
}) => /* @__PURE__ */ e(
|
|
71
|
-
"svg",
|
|
72
|
-
{
|
|
73
|
-
width: t,
|
|
74
|
-
height: l,
|
|
75
|
-
viewBox: "0 0 14 14",
|
|
76
|
-
fill: "none",
|
|
77
|
-
xmlns: "http://www.w3.org/2000/svg",
|
|
78
|
-
class: `IncodeCloseIcon ${i || ""}`,
|
|
79
|
-
"aria-hidden": "true",
|
|
80
|
-
children: /* @__PURE__ */ e(
|
|
81
|
-
"path",
|
|
82
|
-
{
|
|
83
|
-
fillRule: "evenodd",
|
|
84
|
-
clipRule: "evenodd",
|
|
85
|
-
d: "M1.61595 0.355755C1.26799 0.00779831 0.70414 0.00779831 0.356183 0.355755C0.00822556 0.703713 0.00822556 1.26756 0.356183 1.61552L5.74046 6.9998L0.356183 12.3841C0.00825542 12.732 0.00831515 13.2959 0.356183 13.6438C0.70414 13.9918 1.26799 13.9918 1.61595 13.6438L7.00023 8.25956L12.3845 13.6438C12.7325 13.9918 13.2963 13.9918 13.6443 13.6438C13.9922 13.2959 13.9922 12.732 13.6443 12.3841L8.25999 6.9998L13.6443 1.61552C13.9922 1.26756 13.9922 0.703713 13.6443 0.355755C13.2963 0.0078879 12.7324 0.00782818 12.3845 0.355755L7.00023 5.74003L1.61595 0.355755Z",
|
|
86
|
-
fill: "var(--icon-neutral-800)"
|
|
87
|
-
}
|
|
88
|
-
)
|
|
89
|
-
}
|
|
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;
|
|
126
|
-
return /* @__PURE__ */ e(
|
|
127
|
-
"input",
|
|
128
|
-
{
|
|
129
|
-
...n,
|
|
130
|
-
ref: l,
|
|
131
|
-
type: o,
|
|
132
|
-
class: E("IncodeInput", i)
|
|
133
|
-
}
|
|
134
|
-
);
|
|
135
|
-
}), M = _(
|
|
136
|
-
({
|
|
137
|
-
id: t,
|
|
138
|
-
label: l,
|
|
139
|
-
"aria-label": i,
|
|
140
|
-
type: o,
|
|
141
|
-
error: n,
|
|
142
|
-
showErrorIcon: h,
|
|
143
|
-
helper: r,
|
|
144
|
-
showHelperIcon: I,
|
|
145
|
-
closeButton: c,
|
|
146
|
-
required: C,
|
|
147
|
-
suppressMessages: g = !1,
|
|
148
|
-
class: f,
|
|
149
|
-
value: d,
|
|
150
|
-
...v
|
|
151
|
-
}, y) => {
|
|
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(
|
|
155
|
-
"label",
|
|
156
|
-
{
|
|
157
|
-
class: "IncodeInputComposedLabel",
|
|
158
|
-
htmlFor: t,
|
|
159
|
-
"data-testid": `${t}-label`,
|
|
160
|
-
children: l
|
|
161
|
-
}
|
|
162
|
-
),
|
|
163
|
-
/* @__PURE__ */ e("div", { class: "IncodeInputComposedWrapper", children: [
|
|
164
|
-
/* @__PURE__ */ e(
|
|
165
|
-
He,
|
|
166
|
-
{
|
|
167
|
-
id: t,
|
|
168
|
-
type: o,
|
|
169
|
-
...v,
|
|
170
|
-
ref: y,
|
|
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
|
|
178
|
-
}
|
|
179
|
-
),
|
|
180
|
-
c?.show && /* @__PURE__ */ e(
|
|
181
|
-
"button",
|
|
182
|
-
{
|
|
183
|
-
type: "button",
|
|
184
|
-
"aria-label": "Clear",
|
|
185
|
-
class: "IncodeInputComposedClearButton",
|
|
186
|
-
onClick: c.onClose,
|
|
187
|
-
"data-testid": `${t}-clear`,
|
|
188
|
-
children: /* @__PURE__ */ e(Se, {})
|
|
189
|
-
}
|
|
190
|
-
)
|
|
191
|
-
] }),
|
|
192
|
-
!g && n && /* @__PURE__ */ e(
|
|
193
|
-
"div",
|
|
194
|
-
{
|
|
195
|
-
class: "IncodeInputComposedErrorWrapper",
|
|
196
|
-
"data-testid": `${t}-error-wrapper`,
|
|
197
|
-
children: [
|
|
198
|
-
h && /* @__PURE__ */ e("div", { class: "IncodeInputComposedIconWrapper", children: /* @__PURE__ */ e(Z, { size: 17 }) }),
|
|
199
|
-
/* @__PURE__ */ e("p", { id: k, class: "IncodeInputComposedError", children: n })
|
|
200
|
-
]
|
|
201
|
-
}
|
|
202
|
-
),
|
|
203
|
-
!g && r && !n && /* @__PURE__ */ e(
|
|
204
|
-
"div",
|
|
205
|
-
{
|
|
206
|
-
class: "IncodeInputComposedHelperWrapper",
|
|
207
|
-
"data-testid": `${t}-helper-wrapper`,
|
|
208
|
-
children: [
|
|
209
|
-
I && /* @__PURE__ */ e("div", { class: "IncodeInputComposedIconWrapper", children: /* @__PURE__ */ e(K, { size: 17 }) }),
|
|
210
|
-
/* @__PURE__ */ e("p", { id: L, class: "IncodeInputComposedHelper", children: r })
|
|
211
|
-
]
|
|
212
|
-
}
|
|
213
|
-
)
|
|
214
|
-
] });
|
|
215
|
-
}
|
|
216
|
-
), Te = ({
|
|
217
|
-
curp: t,
|
|
218
|
-
isValid: l,
|
|
219
|
-
onCurpChange: i,
|
|
220
|
-
onVerify: o,
|
|
221
|
-
onSwitchToGenerate: n,
|
|
222
|
-
disabled: h = !1,
|
|
223
|
-
placeholder: r,
|
|
224
|
-
continueLabel: I,
|
|
225
|
-
dontHaveLabel: c
|
|
6
|
+
import { u as I } from "../useTranslation-B1jrtqlW.js";
|
|
7
|
+
import { I as U, P as p } from "../incodeComponent-DSqGVqSo.js";
|
|
8
|
+
import { E as D } from "../errorIcon-hyIEsKoP.js";
|
|
9
|
+
import { S as k } from "../successIcon-Ci24t3I5.js";
|
|
10
|
+
import { S as E } from "../spinner-Ogo-u91P.js";
|
|
11
|
+
import { I as C, D as P } from "../dropdownComposed-vWK3dHjS.js";
|
|
12
|
+
import { D as F } from "../dateInputComposed-BwjWmZFc.js";
|
|
13
|
+
const T = ({
|
|
14
|
+
curp: s,
|
|
15
|
+
isValid: d,
|
|
16
|
+
onCurpChange: o,
|
|
17
|
+
onVerify: r,
|
|
18
|
+
onSwitchToGenerate: t,
|
|
19
|
+
disabled: l = !1,
|
|
20
|
+
placeholder: a,
|
|
21
|
+
continueLabel: m,
|
|
22
|
+
dontHaveLabel: n
|
|
226
23
|
}) => {
|
|
227
|
-
const { t:
|
|
24
|
+
const { t: u } = I(), f = a ?? u("curp.placeholder.curp") ?? "CURP", g = m ?? u("curp.continue") ?? "Continue", i = n ?? u("curp.dontHave") ?? "I don't have my CURP", b = u("curp.placeholder.curp") ?? "CURP";
|
|
228
25
|
return /* @__PURE__ */ e("div", { class: "IncodeCurpValidation IncodeCurpInput", children: [
|
|
229
26
|
/* @__PURE__ */ e(
|
|
230
|
-
|
|
27
|
+
C,
|
|
231
28
|
{
|
|
232
29
|
id: "curp-input",
|
|
233
30
|
label: "",
|
|
234
|
-
value:
|
|
235
|
-
onInput: (
|
|
236
|
-
const
|
|
237
|
-
|
|
31
|
+
value: s,
|
|
32
|
+
onInput: (V) => {
|
|
33
|
+
const L = V.target;
|
|
34
|
+
o(L.value.toUpperCase());
|
|
238
35
|
},
|
|
239
|
-
placeholder:
|
|
240
|
-
disabled:
|
|
36
|
+
placeholder: f,
|
|
37
|
+
disabled: l,
|
|
241
38
|
maxLength: 18,
|
|
242
|
-
"aria-label":
|
|
39
|
+
"aria-label": b
|
|
243
40
|
}
|
|
244
41
|
),
|
|
245
|
-
/* @__PURE__ */ e(
|
|
42
|
+
/* @__PURE__ */ e(c, {}),
|
|
246
43
|
/* @__PURE__ */ e(
|
|
247
|
-
|
|
44
|
+
h,
|
|
248
45
|
{
|
|
249
46
|
type: "button",
|
|
250
|
-
onClick:
|
|
251
|
-
disabled: !
|
|
47
|
+
onClick: r,
|
|
48
|
+
disabled: !d || l,
|
|
252
49
|
"data-testid": "curp-verify",
|
|
253
|
-
children:
|
|
50
|
+
children: g
|
|
254
51
|
}
|
|
255
52
|
),
|
|
256
53
|
/* @__PURE__ */ e(
|
|
257
|
-
|
|
54
|
+
h,
|
|
258
55
|
{
|
|
259
56
|
type: "button",
|
|
260
|
-
onClick:
|
|
261
|
-
disabled:
|
|
57
|
+
onClick: t,
|
|
58
|
+
disabled: l,
|
|
262
59
|
"data-testid": "curp-switch-to-generate",
|
|
263
60
|
class: "IncodeCurpInputDontHaveButton",
|
|
264
|
-
children:
|
|
61
|
+
children: i
|
|
265
62
|
}
|
|
266
63
|
)
|
|
267
64
|
] });
|
|
268
|
-
},
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
max: h,
|
|
276
|
-
placeholder: r = "mm/dd/yyyy",
|
|
277
|
-
error: I,
|
|
278
|
-
showErrorIcon: c,
|
|
279
|
-
helper: C,
|
|
280
|
-
showHelperIcon: g,
|
|
281
|
-
suppressMessages: f = !1,
|
|
282
|
-
disabled: d,
|
|
283
|
-
required: v,
|
|
284
|
-
class: y,
|
|
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)
|
|
295
|
-
try {
|
|
296
|
-
s.showPicker();
|
|
297
|
-
} catch {
|
|
298
|
-
s.click();
|
|
299
|
-
}
|
|
300
|
-
else
|
|
301
|
-
s.click();
|
|
302
|
-
};
|
|
303
|
-
return /* @__PURE__ */ e("div", { class: E("IncodeDateInputComposed", y), children: [
|
|
304
|
-
l && /* @__PURE__ */ e(
|
|
305
|
-
"label",
|
|
306
|
-
{
|
|
307
|
-
class: "IncodeDateInputComposedLabel",
|
|
308
|
-
htmlFor: t,
|
|
309
|
-
"data-testid": `${t}-label`,
|
|
310
|
-
children: [
|
|
311
|
-
l,
|
|
312
|
-
v && /* @__PURE__ */ e("span", { class: "IncodeDateInputComposedRequired", children: " *" })
|
|
313
|
-
]
|
|
314
|
-
}
|
|
315
|
-
),
|
|
316
|
-
/* @__PURE__ */ e("div", { class: "IncodeDateInputComposedWrapper", children: [
|
|
317
|
-
/* @__PURE__ */ e(
|
|
318
|
-
"input",
|
|
319
|
-
{
|
|
320
|
-
ref: ee,
|
|
321
|
-
id: t,
|
|
322
|
-
type: "date",
|
|
323
|
-
class: "IncodeDateInputComposedInput",
|
|
324
|
-
value: i,
|
|
325
|
-
onInput: o,
|
|
326
|
-
min: n,
|
|
327
|
-
max: h,
|
|
328
|
-
placeholder: r,
|
|
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
|
|
337
|
-
}
|
|
338
|
-
),
|
|
339
|
-
/* @__PURE__ */ e(
|
|
340
|
-
"button",
|
|
341
|
-
{
|
|
342
|
-
type: "button",
|
|
343
|
-
class: "IncodeDateInputComposedIconButton",
|
|
344
|
-
onClick: B,
|
|
345
|
-
onTouchEnd: B,
|
|
346
|
-
disabled: d,
|
|
347
|
-
"aria-label": l ?? "Date",
|
|
348
|
-
tabIndex: -1,
|
|
349
|
-
children: /* @__PURE__ */ e("span", { class: "IncodeDateInputComposedIcon", children: /* @__PURE__ */ e(Ve, {}) })
|
|
350
|
-
}
|
|
351
|
-
)
|
|
352
|
-
] }),
|
|
353
|
-
!f && I && /* @__PURE__ */ e(
|
|
354
|
-
"div",
|
|
355
|
-
{
|
|
356
|
-
class: "IncodeDateInputComposedErrorWrapper",
|
|
357
|
-
"data-testid": `${t}-error-wrapper`,
|
|
358
|
-
children: [
|
|
359
|
-
c && /* @__PURE__ */ e("div", { class: "IncodeDateInputComposedIconWrapper", children: /* @__PURE__ */ e(Z, { size: 17 }) }),
|
|
360
|
-
/* @__PURE__ */ e("p", { id: T, class: "IncodeDateInputComposedError", children: I })
|
|
361
|
-
]
|
|
362
|
-
}
|
|
363
|
-
),
|
|
364
|
-
!f && C && !I && /* @__PURE__ */ e(
|
|
365
|
-
"div",
|
|
366
|
-
{
|
|
367
|
-
class: "IncodeDateInputComposedHelperWrapper",
|
|
368
|
-
"data-testid": `${t}-helper-wrapper`,
|
|
369
|
-
children: [
|
|
370
|
-
g && /* @__PURE__ */ e("div", { class: "IncodeDateInputComposedIconWrapper", children: /* @__PURE__ */ e(K, { size: 17 }) }),
|
|
371
|
-
/* @__PURE__ */ e("p", { id: W, class: "IncodeDateInputComposedHelper", children: C })
|
|
372
|
-
]
|
|
373
|
-
}
|
|
374
|
-
)
|
|
375
|
-
] });
|
|
376
|
-
}
|
|
377
|
-
);
|
|
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,
|
|
386
|
-
error: r,
|
|
387
|
-
helper: I,
|
|
388
|
-
showErrorIcon: c,
|
|
389
|
-
showHelperIcon: C,
|
|
390
|
-
suppressMessages: g = !1,
|
|
391
|
-
disabled: f = !1,
|
|
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
|
|
405
|
-
}) => {
|
|
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
|
-
}
|
|
508
|
-
};
|
|
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(
|
|
541
|
-
"div",
|
|
542
|
-
{
|
|
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
|
|
65
|
+
}, w = ({
|
|
66
|
+
form: s,
|
|
67
|
+
isValid: d,
|
|
68
|
+
onFormChange: o,
|
|
69
|
+
onGenerate: r,
|
|
70
|
+
disabled: t = !1,
|
|
71
|
+
labels: l
|
|
687
72
|
}) => {
|
|
688
|
-
const { t:
|
|
689
|
-
firstName:
|
|
690
|
-
firstLast:
|
|
691
|
-
secondLast:
|
|
692
|
-
gender:
|
|
693
|
-
genderPlaceholder:
|
|
694
|
-
male:
|
|
695
|
-
female:
|
|
696
|
-
other:
|
|
697
|
-
dob:
|
|
698
|
-
birthState:
|
|
699
|
-
statePlaceholder:
|
|
700
|
-
generate:
|
|
701
|
-
}, ...
|
|
702
|
-
const
|
|
703
|
-
|
|
704
|
-
},
|
|
705
|
-
{ value: "H", label:
|
|
706
|
-
{ value: "M", label:
|
|
707
|
-
{ value: "X", label:
|
|
708
|
-
],
|
|
709
|
-
value:
|
|
710
|
-
label:
|
|
73
|
+
const { t: a } = I(), n = { ...{
|
|
74
|
+
firstName: a("curp.labels.firstName") ?? "Your First name",
|
|
75
|
+
firstLast: a("curp.labels.firstLast") ?? "Your First last name",
|
|
76
|
+
secondLast: a("curp.labels.secondLast") ?? "Your Second last name",
|
|
77
|
+
gender: a("curp.labels.genderV2") ?? "Gender",
|
|
78
|
+
genderPlaceholder: a("curp.placeholder.gender") ?? "Choose gender",
|
|
79
|
+
male: a("curp.labels.maleV2") ?? "Male",
|
|
80
|
+
female: a("curp.labels.femaleV2") ?? "Female",
|
|
81
|
+
other: a("curp.labels.other") ?? "Other",
|
|
82
|
+
dob: a("curp.labels.dob") ?? "Date of birth",
|
|
83
|
+
birthState: a("curp.labels.birthState") ?? "State of birth",
|
|
84
|
+
statePlaceholder: a("curp.placeholder.state") ?? "Select state",
|
|
85
|
+
generate: a("curp.generateCta") ?? "Generate CURP"
|
|
86
|
+
}, ...l }, u = (i) => (b) => {
|
|
87
|
+
const v = b.target;
|
|
88
|
+
o({ [i]: v.value });
|
|
89
|
+
}, f = [
|
|
90
|
+
{ value: "H", label: n.male },
|
|
91
|
+
{ value: "M", label: n.female },
|
|
92
|
+
{ value: "X", label: n.other }
|
|
93
|
+
], g = G.map((i) => ({
|
|
94
|
+
value: i.value,
|
|
95
|
+
label: i.label
|
|
711
96
|
}));
|
|
712
97
|
return /* @__PURE__ */ e("div", { class: "IncodeCurpValidation IncodeGenerateCurpForm", children: [
|
|
713
98
|
/* @__PURE__ */ e(
|
|
714
|
-
|
|
99
|
+
C,
|
|
715
100
|
{
|
|
716
101
|
id: "curp-first-name",
|
|
717
|
-
label:
|
|
718
|
-
value:
|
|
719
|
-
onInput:
|
|
720
|
-
placeholder:
|
|
721
|
-
disabled:
|
|
102
|
+
label: n.firstName,
|
|
103
|
+
value: s.name,
|
|
104
|
+
onInput: u("name"),
|
|
105
|
+
placeholder: n.firstName,
|
|
106
|
+
disabled: t,
|
|
722
107
|
autoComplete: "given-name"
|
|
723
108
|
}
|
|
724
109
|
),
|
|
725
110
|
/* @__PURE__ */ e(
|
|
726
|
-
|
|
111
|
+
C,
|
|
727
112
|
{
|
|
728
113
|
id: "curp-first-last",
|
|
729
|
-
label:
|
|
730
|
-
value:
|
|
731
|
-
onInput:
|
|
732
|
-
placeholder:
|
|
733
|
-
disabled:
|
|
114
|
+
label: n.firstLast,
|
|
115
|
+
value: s.firstLastName,
|
|
116
|
+
onInput: u("firstLastName"),
|
|
117
|
+
placeholder: n.firstLast,
|
|
118
|
+
disabled: t
|
|
734
119
|
}
|
|
735
120
|
),
|
|
736
121
|
/* @__PURE__ */ e(
|
|
737
|
-
|
|
122
|
+
C,
|
|
738
123
|
{
|
|
739
124
|
id: "curp-second-last",
|
|
740
|
-
label:
|
|
741
|
-
value:
|
|
742
|
-
onInput:
|
|
743
|
-
placeholder:
|
|
744
|
-
disabled:
|
|
125
|
+
label: n.secondLast,
|
|
126
|
+
value: s.secondLastName,
|
|
127
|
+
onInput: u("secondLastName"),
|
|
128
|
+
placeholder: n.secondLast,
|
|
129
|
+
disabled: t
|
|
745
130
|
}
|
|
746
131
|
),
|
|
747
132
|
/* @__PURE__ */ e(
|
|
748
|
-
|
|
133
|
+
P,
|
|
749
134
|
{
|
|
750
135
|
id: "curp-gender",
|
|
751
|
-
label:
|
|
752
|
-
placeholder:
|
|
753
|
-
value:
|
|
754
|
-
options:
|
|
755
|
-
disabled:
|
|
756
|
-
onChange: (
|
|
136
|
+
label: n.gender,
|
|
137
|
+
placeholder: n.genderPlaceholder,
|
|
138
|
+
value: s.gender,
|
|
139
|
+
options: f,
|
|
140
|
+
disabled: t,
|
|
141
|
+
onChange: (i) => o({ gender: i }),
|
|
757
142
|
"data-testid": "curp-gender"
|
|
758
143
|
}
|
|
759
144
|
),
|
|
760
145
|
/* @__PURE__ */ e(
|
|
761
|
-
|
|
146
|
+
F,
|
|
762
147
|
{
|
|
763
148
|
id: "curp-birth-date",
|
|
764
|
-
label:
|
|
765
|
-
value:
|
|
766
|
-
onInput:
|
|
149
|
+
label: n.dob,
|
|
150
|
+
value: s.birthDate,
|
|
151
|
+
onInput: u("birthDate"),
|
|
767
152
|
max: (/* @__PURE__ */ new Date()).toISOString().split("T")[0],
|
|
768
|
-
placeholder:
|
|
769
|
-
disabled:
|
|
153
|
+
placeholder: a("curp.placeholder.dob") ?? "mm/dd/yyyy",
|
|
154
|
+
disabled: t,
|
|
770
155
|
"data-testid": "curp-birth-date"
|
|
771
156
|
}
|
|
772
157
|
),
|
|
773
158
|
/* @__PURE__ */ e(
|
|
774
|
-
|
|
159
|
+
P,
|
|
775
160
|
{
|
|
776
161
|
id: "curp-birth-state",
|
|
777
|
-
label:
|
|
778
|
-
placeholder:
|
|
779
|
-
value:
|
|
780
|
-
options:
|
|
781
|
-
disabled:
|
|
782
|
-
onChange: (
|
|
162
|
+
label: n.birthState,
|
|
163
|
+
placeholder: n.statePlaceholder,
|
|
164
|
+
value: s.birthState,
|
|
165
|
+
options: g,
|
|
166
|
+
disabled: t,
|
|
167
|
+
onChange: (i) => o({ birthState: i }),
|
|
783
168
|
"data-testid": "curp-birth-state",
|
|
784
169
|
searchable: !0
|
|
785
170
|
}
|
|
786
171
|
),
|
|
787
|
-
/* @__PURE__ */ e(
|
|
172
|
+
/* @__PURE__ */ e(c, { size: 16 }),
|
|
788
173
|
/* @__PURE__ */ e(
|
|
789
|
-
|
|
174
|
+
h,
|
|
790
175
|
{
|
|
791
176
|
type: "button",
|
|
792
|
-
onClick:
|
|
793
|
-
disabled: !
|
|
177
|
+
onClick: r,
|
|
178
|
+
disabled: !d || t,
|
|
794
179
|
"data-testid": "curp-generate",
|
|
795
|
-
children:
|
|
180
|
+
children: n.generate
|
|
796
181
|
}
|
|
797
182
|
)
|
|
798
183
|
] });
|
|
799
|
-
},
|
|
800
|
-
config:
|
|
801
|
-
onFinish:
|
|
802
|
-
onError:
|
|
184
|
+
}, H = ({
|
|
185
|
+
config: s,
|
|
186
|
+
onFinish: d,
|
|
187
|
+
onError: o
|
|
803
188
|
}) => {
|
|
804
|
-
const { t:
|
|
805
|
-
if (!
|
|
189
|
+
const { t: r } = I(), [t, l] = N(() => {
|
|
190
|
+
if (!s)
|
|
806
191
|
throw new Error("CURP validation config is required");
|
|
807
|
-
return
|
|
192
|
+
return R({ config: s });
|
|
808
193
|
});
|
|
809
|
-
if (
|
|
810
|
-
const
|
|
811
|
-
return /* @__PURE__ */ e(
|
|
194
|
+
if (t.status === "idle" || t.status === "loading" || t.status === "verifying" || t.status === "generating") {
|
|
195
|
+
const a = t.status === "generating" ? r("curp.status.generating") ?? "Generating..." : r("curp.status.verifying") ?? "Verifying...";
|
|
196
|
+
return /* @__PURE__ */ e(p, { className: "IncodeCurpValidationPage", children: /* @__PURE__ */ e("div", { class: "IncodeCurpValidation IncodeCurpLoading", children: /* @__PURE__ */ e(E, { title: a, fullScreen: !1 }) }) });
|
|
812
197
|
}
|
|
813
|
-
if (
|
|
198
|
+
if (t.status === "enterCurp")
|
|
814
199
|
return /* @__PURE__ */ e(
|
|
815
|
-
|
|
200
|
+
p,
|
|
816
201
|
{
|
|
817
202
|
className: "IncodeCurpValidationPage",
|
|
818
|
-
title:
|
|
203
|
+
title: r("curp.enterCurp") ?? "Enter your CURP",
|
|
819
204
|
children: /* @__PURE__ */ e(
|
|
820
|
-
|
|
205
|
+
T,
|
|
821
206
|
{
|
|
822
|
-
curp:
|
|
823
|
-
isValid:
|
|
824
|
-
onCurpChange: (
|
|
825
|
-
onVerify: () =>
|
|
826
|
-
onSwitchToGenerate: () =>
|
|
827
|
-
placeholder:
|
|
828
|
-
continueLabel:
|
|
829
|
-
dontHaveLabel:
|
|
207
|
+
curp: t.curp,
|
|
208
|
+
isValid: t.isValid,
|
|
209
|
+
onCurpChange: (a) => l.setCurp(a),
|
|
210
|
+
onVerify: () => l.verify(),
|
|
211
|
+
onSwitchToGenerate: () => l.switchToGenerate(),
|
|
212
|
+
placeholder: r("curp.placeholder.curp") ?? "CURP",
|
|
213
|
+
continueLabel: r("curp.continue") ?? "Continue",
|
|
214
|
+
dontHaveLabel: r("curp.dontHave") ?? "I don't have my CURP"
|
|
830
215
|
}
|
|
831
216
|
)
|
|
832
217
|
}
|
|
833
218
|
);
|
|
834
|
-
if (
|
|
219
|
+
if (t.status === "generateCurp")
|
|
835
220
|
return /* @__PURE__ */ e(
|
|
836
|
-
|
|
221
|
+
p,
|
|
837
222
|
{
|
|
838
223
|
className: "IncodeCurpValidationPage",
|
|
839
|
-
title:
|
|
224
|
+
title: r("curp.generate") ?? "Generate your CURP",
|
|
840
225
|
children: /* @__PURE__ */ e(
|
|
841
|
-
|
|
226
|
+
w,
|
|
842
227
|
{
|
|
843
|
-
form:
|
|
844
|
-
isValid:
|
|
845
|
-
onFormChange: (
|
|
846
|
-
onGenerate: () =>
|
|
228
|
+
form: t.form,
|
|
229
|
+
isValid: t.isValid,
|
|
230
|
+
onFormChange: (a) => l.setGenerateForm(a),
|
|
231
|
+
onGenerate: () => l.generate()
|
|
847
232
|
}
|
|
848
233
|
)
|
|
849
234
|
}
|
|
850
235
|
);
|
|
851
|
-
if (
|
|
236
|
+
if (t.status === "confirmCurp")
|
|
852
237
|
return /* @__PURE__ */ e(
|
|
853
|
-
|
|
238
|
+
p,
|
|
854
239
|
{
|
|
855
240
|
className: "IncodeCurpValidationPage",
|
|
856
|
-
title:
|
|
241
|
+
title: r("curp.status.confirm") ?? "Confirm your CURP",
|
|
857
242
|
children: /* @__PURE__ */ e("div", { class: "IncodeCurpValidation IncodeCurpConfirm", children: [
|
|
858
243
|
/* @__PURE__ */ e(
|
|
859
244
|
"input",
|
|
860
245
|
{
|
|
861
246
|
type: "text",
|
|
862
247
|
class: "IncodeCurpConfirmInput",
|
|
863
|
-
value:
|
|
248
|
+
value: t.curp,
|
|
864
249
|
readOnly: !0,
|
|
865
|
-
"aria-label":
|
|
250
|
+
"aria-label": r("curp.status.generatedCurp") ?? "Generated CURP"
|
|
866
251
|
}
|
|
867
252
|
),
|
|
868
|
-
/* @__PURE__ */ e(
|
|
253
|
+
/* @__PURE__ */ e(c, {}),
|
|
869
254
|
/* @__PURE__ */ e(
|
|
870
|
-
|
|
255
|
+
h,
|
|
871
256
|
{
|
|
872
257
|
type: "button",
|
|
873
|
-
onClick: () =>
|
|
258
|
+
onClick: () => l.confirmGenerated(),
|
|
874
259
|
"data-testid": "curp-confirm",
|
|
875
|
-
children:
|
|
260
|
+
children: r("curp.continue") ?? "Continue"
|
|
876
261
|
}
|
|
877
262
|
)
|
|
878
263
|
] })
|
|
879
264
|
}
|
|
880
265
|
);
|
|
881
|
-
if (
|
|
882
|
-
return /* @__PURE__ */ e(
|
|
883
|
-
/* @__PURE__ */ e(
|
|
884
|
-
/* @__PURE__ */ e(
|
|
885
|
-
/* @__PURE__ */ e("h2", { class: "IncodeCurpSuccessTitle", children:
|
|
266
|
+
if (t.status === "success")
|
|
267
|
+
return /* @__PURE__ */ e(p, { className: "IncodeCurpValidationPage", children: /* @__PURE__ */ e("div", { class: "IncodeCurpValidation IncodeCurpSuccess", children: [
|
|
268
|
+
/* @__PURE__ */ e(k, { size: 32 }),
|
|
269
|
+
/* @__PURE__ */ e(c, { size: 16 }),
|
|
270
|
+
/* @__PURE__ */ e("h2", { class: "IncodeCurpSuccessTitle", children: r("curp.status.verified") ?? "Verified" })
|
|
886
271
|
] }) });
|
|
887
|
-
if (
|
|
888
|
-
const
|
|
889
|
-
return /* @__PURE__ */ e(
|
|
890
|
-
/* @__PURE__ */ e(
|
|
891
|
-
/* @__PURE__ */ e(
|
|
892
|
-
/* @__PURE__ */ e(
|
|
893
|
-
/* @__PURE__ */ e("h2", { class: "IncodeCurpFailureTitle", children:
|
|
894
|
-
|
|
895
|
-
/* @__PURE__ */ e(
|
|
896
|
-
/* @__PURE__ */ e("p", { class: "IncodeCurpFailureHint", children:
|
|
272
|
+
if (t.status === "failure" || t.status === "generateError") {
|
|
273
|
+
const a = t.retriesLeft > 0, m = t.status === "failure" ? r("curp.status.notVerified") ?? "Not verified" : r("curp.status.couldntGenerate") ?? "Couldn't generate CURP";
|
|
274
|
+
return /* @__PURE__ */ e(p, { className: "IncodeCurpValidationPage", children: /* @__PURE__ */ e("div", { class: "IncodeCurpValidation IncodeCurpFailure", children: [
|
|
275
|
+
/* @__PURE__ */ e(c, {}),
|
|
276
|
+
/* @__PURE__ */ e(D, { size: 32 }),
|
|
277
|
+
/* @__PURE__ */ e(c, { size: 16 }),
|
|
278
|
+
/* @__PURE__ */ e("h2", { class: "IncodeCurpFailureTitle", children: m }),
|
|
279
|
+
t.status === "generateError" && a && /* @__PURE__ */ e(y, { children: [
|
|
280
|
+
/* @__PURE__ */ e(c, { size: 12 }),
|
|
281
|
+
/* @__PURE__ */ e("p", { class: "IncodeCurpFailureHint", children: r("curp.status.checkInfo") ?? "Please check your information" })
|
|
897
282
|
] }),
|
|
898
|
-
/* @__PURE__ */ e(
|
|
899
|
-
|
|
900
|
-
|
|
283
|
+
/* @__PURE__ */ e(c, {}),
|
|
284
|
+
a && /* @__PURE__ */ e(y, { children: /* @__PURE__ */ e(
|
|
285
|
+
h,
|
|
901
286
|
{
|
|
902
287
|
type: "button",
|
|
903
|
-
onClick: () =>
|
|
288
|
+
onClick: () => l.retry(),
|
|
904
289
|
"data-testid": "curp-retry",
|
|
905
|
-
children:
|
|
290
|
+
children: t.status === "failure" ? r("curp.status.tryAgain") ?? "Try again" : r("curp.status.edit") ?? "Edit information"
|
|
906
291
|
}
|
|
907
292
|
) })
|
|
908
293
|
] }) });
|
|
909
294
|
}
|
|
910
|
-
return
|
|
911
|
-
},
|
|
912
|
-
config:
|
|
913
|
-
onFinish:
|
|
914
|
-
onError:
|
|
915
|
-
}) => /* @__PURE__ */ e(
|
|
916
|
-
|
|
295
|
+
return t.status === "finished" ? (d?.(), null) : (t.status === "closed" && o?.(void 0), null);
|
|
296
|
+
}, z = ({
|
|
297
|
+
config: s,
|
|
298
|
+
onFinish: d,
|
|
299
|
+
onError: o
|
|
300
|
+
}) => /* @__PURE__ */ e(U, { children: s ? /* @__PURE__ */ e(
|
|
301
|
+
H,
|
|
917
302
|
{
|
|
918
|
-
config:
|
|
919
|
-
onFinish:
|
|
920
|
-
onError:
|
|
303
|
+
config: s,
|
|
304
|
+
onFinish: d,
|
|
305
|
+
onError: o
|
|
921
306
|
}
|
|
922
307
|
) : null });
|
|
923
|
-
|
|
308
|
+
S(z, "incode-curp-validation");
|
|
924
309
|
export {
|
|
925
|
-
|
|
310
|
+
z as CurpValidation
|
|
926
311
|
};
|