@incodetech/web 0.0.0-dev-20260317-5e90a15 → 0.0.0-dev-20260317-737b25e

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.
@@ -33,6 +33,10 @@
33
33
  margin-inline: auto;
34
34
  }
35
35
 
36
+ .IncodeEkybFooter {
37
+ margin-top: var(--spacing-24, var(--spacing-24, 24px));
38
+ }
39
+
36
40
  @media (min-width: 768px) {
37
41
  .IncodePageContainer.IncodeEkybPage {
38
42
  margin-top: var(--spacing-0, var(--spacing-none, 0px));
@@ -55,7 +59,6 @@
55
59
  .IncodeEkybPage .IncodeEkybForm {
56
60
  min-height: var(--spacing-0, var(--spacing-none, 0px));
57
61
  padding-bottom: var(--spacing-8, var(--spacing-8, 8px));
58
- flex: 1;
59
62
  overflow-y: auto;
60
63
  }
61
64
 
@@ -0,0 +1,348 @@
1
+ import { b as v, u as o, I as X, a as J, B as Q } from "./button-Ca1tRSTI.js";
2
+ import { SUPPORTED_COUNTRIES as M, DEV_ONLY_COUNTRIES as Z, computeEkybDisplayErrors as x, createEkybManager as ee } from "@incodetech/core/ekyb";
3
+ import { T as q, y as V, A as P, d as te, q as S, k as oe } from "./vendor-preact-BXf0bkEs.js";
4
+ import "./uiConfig-Z6RT23Sl.js";
5
+ import "@incodetech/core";
6
+ import { u as re, A as se } from "./addressAutocomplete-DetZGxBZ.js";
7
+ import { P as ne } from "./page-BVHG3h0V.js";
8
+ import { t as K, F as ae, V as A } from "./formField-FeX9N4c8.js";
9
+ import { r as ue } from "./incodeModule-aE-LkKwM.js";
10
+ import { D as G } from "./dropdownComposed-B5ZuQS8C.js";
11
+ import { I as _ } from "./inputComposed-BHi-MSpP.js";
12
+ function ce(t) {
13
+ return [...t.toUpperCase()].map((r) => String.fromCodePoint(127462 + r.charCodeAt(0) - 65)).join("");
14
+ }
15
+ const le = {
16
+ BR: "Brazil",
17
+ CM: "Cameroon",
18
+ CN: "China",
19
+ FR: "France",
20
+ DE: "Germany",
21
+ IL: "Israel",
22
+ IT: "Italy",
23
+ KE: "Kenya",
24
+ MX: "Mexico",
25
+ NG: "Nigeria",
26
+ ES: "Spain",
27
+ GB: "United Kingdom",
28
+ US: "USA"
29
+ };
30
+ function ie(t) {
31
+ const r = le[t] ?? t;
32
+ return { value: t, label: `${ce(t)} ${r}` };
33
+ }
34
+ function me() {
35
+ if (typeof window > "u") return !1;
36
+ const { hostname: t } = window.location;
37
+ return t === "localhost" || t.includes("stage") || t.includes("demo");
38
+ }
39
+ const de = ({
40
+ value: t,
41
+ onChange: r
42
+ }) => {
43
+ const { t: u } = v(), s = q(() => (me() ? [...M, ...Z] : [...M]).map(ie).sort((c, d) => c.label.localeCompare(d.label)), []);
44
+ return /* @__PURE__ */ o("div", { className: "IncodeEkybCountrySelector", children: /* @__PURE__ */ o(
45
+ G,
46
+ {
47
+ id: "ekyb-country",
48
+ label: u("ekyb.country"),
49
+ value: t,
50
+ options: s,
51
+ onChange: r,
52
+ "data-testid": "ekyb-country-selector"
53
+ }
54
+ ) });
55
+ }, B = ({
56
+ field: t,
57
+ value: r,
58
+ error: u,
59
+ errorParams: s,
60
+ country: i,
61
+ onChange: c,
62
+ onBlur: d
63
+ }) => {
64
+ const { t: b } = v(), l = !t.required, h = b(t.label);
65
+ if (t.type === "dropdown") {
66
+ const m = l ? `${h} (${b("common.optional")})` : h, n = t.name === "state" ? b("ekyb.selectState") : void 0;
67
+ return /* @__PURE__ */ o(
68
+ G,
69
+ {
70
+ id: `ekyb-${t.name}`,
71
+ label: m,
72
+ placeholder: n,
73
+ value: r,
74
+ options: (t.options ?? []).map((p) => ({
75
+ ...p,
76
+ label: b(p.label)
77
+ })),
78
+ error: K(b, u, s),
79
+ searchable: !0,
80
+ onChange: (p) => c(t.name, p),
81
+ onBlur: d ? () => d(t.name) : void 0,
82
+ "data-testid": `ekyb-field-${t.name}`
83
+ }
84
+ );
85
+ }
86
+ return /* @__PURE__ */ o(
87
+ ae,
88
+ {
89
+ name: t.name,
90
+ label: t.label,
91
+ value: r,
92
+ error: u,
93
+ errorParams: s,
94
+ required: t.required,
95
+ optional: l,
96
+ onChange: c,
97
+ onBlur: d
98
+ }
99
+ );
100
+ }, be = ({
101
+ ubos: t,
102
+ errors: r,
103
+ errorParams: u,
104
+ canAddUbo: s,
105
+ onSetField: i,
106
+ onBlur: c,
107
+ onAdd: d,
108
+ onRemove: b
109
+ }) => {
110
+ const { t: l } = v(), h = (m) => K(l, r[m], u[m]);
111
+ return t.length === 0 ? null : /* @__PURE__ */ o("div", { className: "IncodeEkybUbos", children: [
112
+ t.map((m, n) => {
113
+ const p = n === 0 ? l("ekyb.uboName") : l("ekyb.uboNameWithNumber", { number: n + 1 }), f = n === 0 ? l("ekyb.uboSurname") : l("ekyb.uboSurnameWithNumber", { number: n + 1 }), N = n === 0;
114
+ return /* @__PURE__ */ o("div", { className: "IncodeEkybUboEntry", children: [
115
+ /* @__PURE__ */ o(
116
+ _,
117
+ {
118
+ id: `ubo-${n}-name`,
119
+ label: p,
120
+ name: `ubo-${n}-name`,
121
+ value: m.name,
122
+ error: h(`ubo-${n}-name`),
123
+ onInput: (I) => i(n, "name", I.target.value),
124
+ onBlur: c ? () => c(`ubo-${n}-name`) : void 0,
125
+ "data-testid": `ekyb-ubo-${n}-name`
126
+ }
127
+ ),
128
+ /* @__PURE__ */ o(
129
+ _,
130
+ {
131
+ id: `ubo-${n}-surname`,
132
+ label: f,
133
+ name: `ubo-${n}-surname`,
134
+ value: m.surname,
135
+ error: h(`ubo-${n}-surname`),
136
+ onInput: (I) => i(
137
+ n,
138
+ "surname",
139
+ I.target.value
140
+ ),
141
+ onBlur: c ? () => c(`ubo-${n}-surname`) : void 0,
142
+ "data-testid": `ekyb-ubo-${n}-surname`
143
+ }
144
+ ),
145
+ !N && /* @__PURE__ */ o(
146
+ "button",
147
+ {
148
+ className: "IncodeEkybRemoveUbo",
149
+ onClick: () => b(n),
150
+ type: "button",
151
+ children: l("common.remove")
152
+ }
153
+ )
154
+ ] }, m.id);
155
+ }),
156
+ s && /* @__PURE__ */ o(
157
+ "button",
158
+ {
159
+ className: "IncodeEkybAddUbo",
160
+ onClick: d,
161
+ type: "button",
162
+ "data-testid": "ekyb-add-ubo",
163
+ children: l("ekyb.addAnotherUbo")
164
+ }
165
+ )
166
+ ] });
167
+ }, pe = ({ config: t, onFinish: r }) => {
168
+ const { t: u } = v(), [s, i] = J(() => ee({ config: t }));
169
+ return V(() => {
170
+ (s.status === "finished" || s.status === "closed") && r?.();
171
+ }, [s.status, r]), s.status === "finished" || s.status === "closed" ? null : s.status === "loading" ? /* @__PURE__ */ o(
172
+ A,
173
+ {
174
+ status: "submitting",
175
+ submittingTitle: u("common.loading")
176
+ }
177
+ ) : s.status === "submitting" ? /* @__PURE__ */ o(A, { status: "submitting" }) : s.status === "success" ? /* @__PURE__ */ o(A, { status: "success" }) : s.status === "error" ? /* @__PURE__ */ o(A, { status: "failure", onRetry: () => i.retry() }) : s.status === "form" ? /* @__PURE__ */ o(he, { state: s, manager: i }) : null;
178
+ }, O = /* @__PURE__ */ new Set([
179
+ "street",
180
+ "houseNo",
181
+ "addressLine2",
182
+ "city",
183
+ "state",
184
+ "postalCode"
185
+ ]), ye = ["street", "city", "state", "postalCode", "houseNo"], he = ({ state: t, manager: r }) => {
186
+ const {
187
+ country: u,
188
+ fields: s,
189
+ values: i,
190
+ errors: c,
191
+ isValid: d,
192
+ ubos: b,
193
+ canAddUbo: l,
194
+ addressSuggestions: h,
195
+ submitAttempted: m
196
+ } = t, { t: n } = v(), p = P(null), f = P(null), N = P(void 0), I = re(p, s.length), [w, T] = te({}), y = S((e) => {
197
+ T((a) => a[e] ? a : { ...a, [e]: !0 });
198
+ }, []), { displayErrors: E, errorParams: F } = q(
199
+ () => x(
200
+ c,
201
+ w,
202
+ m,
203
+ u,
204
+ s
205
+ ),
206
+ [c, w, m, u, s]
207
+ ), $ = S(
208
+ (e) => y(e),
209
+ [y]
210
+ ), U = S(
211
+ (e, a) => {
212
+ y(e), r.setField(e, a);
213
+ },
214
+ [r, y]
215
+ ), Y = S(
216
+ (e, a, k) => {
217
+ y(`ubo-${e}-${a}`), r.setUboField(e, a, k);
218
+ },
219
+ [r, y]
220
+ ), j = S(
221
+ (e) => {
222
+ for (const a of ye) y(a);
223
+ r.selectAddress(e);
224
+ },
225
+ [r, y]
226
+ ), W = S(
227
+ (e) => {
228
+ r.removeUbo(e), T((a) => {
229
+ const k = {};
230
+ for (const [C, R] of Object.entries(a)) {
231
+ const D = C.match(/^ubo-(\d+)-(name|surname)$/);
232
+ if (!D) {
233
+ k[C] = R;
234
+ continue;
235
+ }
236
+ const g = Number(D[1]);
237
+ if (g === e) continue;
238
+ const H = g > e ? g - 1 : g;
239
+ k[`ubo-${H}-${D[2]}`] = R;
240
+ }
241
+ return k;
242
+ });
243
+ },
244
+ [r]
245
+ );
246
+ V(() => {
247
+ const e = E.postalCode, a = N.current;
248
+ if (N.current = e, !e || a === e)
249
+ return;
250
+ const k = requestAnimationFrame(() => {
251
+ const C = f.current;
252
+ if (!C) return;
253
+ (C.querySelector("#postalCode-error") ?? C).scrollIntoView({
254
+ behavior: "smooth",
255
+ block: "nearest"
256
+ });
257
+ });
258
+ return () => cancelAnimationFrame(k);
259
+ }, [E.postalCode]);
260
+ const z = s.filter((e) => !O.has(e.name)), L = s.filter((e) => O.has(e.name));
261
+ return /* @__PURE__ */ o(ne, { className: `IncodeEkybPage${I ? " IncodeEkybPageScrollable" : ""}`, title: n("ekyb.title"), children: [
262
+ /* @__PURE__ */ o("div", { ref: p, className: "IncodeEkybForm", children: [
263
+ /* @__PURE__ */ o(
264
+ de,
265
+ {
266
+ value: u,
267
+ onChange: (e) => r.setCountry(e)
268
+ }
269
+ ),
270
+ z.map((e) => /* @__PURE__ */ o(
271
+ B,
272
+ {
273
+ field: e,
274
+ value: i[e.name] ?? "",
275
+ error: E[e.name],
276
+ errorParams: F[e.name],
277
+ country: u,
278
+ onChange: U,
279
+ onBlur: $
280
+ },
281
+ e.name
282
+ )),
283
+ /* @__PURE__ */ o(
284
+ be,
285
+ {
286
+ ubos: b,
287
+ errors: E,
288
+ errorParams: F,
289
+ canAddUbo: l,
290
+ onSetField: Y,
291
+ onBlur: $,
292
+ onAdd: () => r.addUbo(),
293
+ onRemove: W
294
+ }
295
+ ),
296
+ L.length > 0 && /* @__PURE__ */ o(oe, { children: [
297
+ /* @__PURE__ */ o("h3", { className: "IncodeEkybSectionHeader", children: n("ekyb.addressDetails") }),
298
+ L.map((e) => e.name === "street" ? /* @__PURE__ */ o(
299
+ se,
300
+ {
301
+ label: e.label,
302
+ value: i.street ?? "",
303
+ error: E.street,
304
+ errorParams: F.street,
305
+ suggestions: h,
306
+ optional: !e.required,
307
+ onChange: (a) => U("street", a),
308
+ onSearch: (a) => r.searchAddress(a),
309
+ onSelect: j,
310
+ onBlur: () => $("street")
311
+ },
312
+ e.name
313
+ ) : /* @__PURE__ */ o(
314
+ "div",
315
+ {
316
+ ref: e.name === "postalCode" ? f : void 0,
317
+ children: /* @__PURE__ */ o(
318
+ B,
319
+ {
320
+ field: e,
321
+ value: i[e.name] ?? "",
322
+ error: E[e.name],
323
+ errorParams: F[e.name],
324
+ country: u,
325
+ onChange: U,
326
+ onBlur: $
327
+ }
328
+ )
329
+ },
330
+ e.name
331
+ ))
332
+ ] })
333
+ ] }),
334
+ /* @__PURE__ */ o("div", { className: "IncodeEkybFooter", children: /* @__PURE__ */ o(
335
+ Q,
336
+ {
337
+ onClick: () => r.submit(),
338
+ disabled: !d,
339
+ "data-testid": "ekyb-submit",
340
+ children: n("ekyb.continue")
341
+ }
342
+ ) })
343
+ ] });
344
+ }, ke = ({ config: t, onFinish: r }) => /* @__PURE__ */ o(X, { children: t ? /* @__PURE__ */ o(pe, { config: t, onFinish: r }) : null });
345
+ ue(ke, "incode-ekyb");
346
+ export {
347
+ ke as EkybModule
348
+ };
@@ -30,6 +30,14 @@
30
30
  margin-bottom: var(--spacing-0, var(--spacing-none, 0px));
31
31
  }
32
32
 
33
+ .IncodeEkycFooter {
34
+ margin-top: var(--spacing-24, var(--spacing-24, 24px));
35
+ align-items: center;
36
+ gap: var(--spacing-12, var(--spacing-12, 12px));
37
+ flex-direction: column;
38
+ display: flex;
39
+ }
40
+
33
41
  @media (min-width: 768px) {
34
42
  .IncodePageContainer.IncodeEkycPage {
35
43
  height: 100dvh;
@@ -52,7 +60,6 @@
52
60
  .IncodeEkycPage .IncodeEkycForm {
53
61
  min-height: var(--spacing-0, var(--spacing-none, 0px));
54
62
  padding-bottom: var(--spacing-8, var(--spacing-8, 8px));
55
- flex: 1;
56
63
  overflow-y: auto;
57
64
  }
58
65
 
@@ -0,0 +1,282 @@
1
+ import { u as r, I as O, b as q, a as Y, B as L } from "./button-Ca1tRSTI.js";
2
+ import { computeEkycDisplayErrors as G, createEkycManager as j } from "@incodetech/core/ekyc";
3
+ import { y as $, A as F, d as z, q as v, T as J } from "./vendor-preact-BXf0bkEs.js";
4
+ import "./uiConfig-Z6RT23Sl.js";
5
+ import "@incodetech/core";
6
+ import { u as Q, A as U } from "./addressAutocomplete-DetZGxBZ.js";
7
+ import { V as k, t as W, F as X } from "./formField-FeX9N4c8.js";
8
+ import { D as Z } from "./dateInputComposed-CvFmQpJ0.js";
9
+ import { D as f } from "./dropdownComposed-B5ZuQS8C.js";
10
+ import { P as ee } from "./page-BVHG3h0V.js";
11
+ import { r as re } from "./incodeModule-aE-LkKwM.js";
12
+ import { P as te } from "./phoneInputComposed-CwtJKvGh.js";
13
+ const oe = ({ config: p, onFinish: n }) => {
14
+ const { t: l } = q(), [a, m] = Y(() => j({ config: p }));
15
+ return $(() => {
16
+ (a.status === "finished" || a.status === "closed") && n?.();
17
+ }, [a.status, n]), a.status === "finished" || a.status === "closed" ? null : a.status === "loading" ? /* @__PURE__ */ r(
18
+ k,
19
+ {
20
+ status: "submitting",
21
+ submittingTitle: l("common.loading")
22
+ }
23
+ ) : a.status === "submitting" ? /* @__PURE__ */ r(k, { status: "submitting" }) : a.status === "success" ? /* @__PURE__ */ r(k, { status: "success" }) : a.status === "error" ? /* @__PURE__ */ r(
24
+ k,
25
+ {
26
+ status: "failure",
27
+ onRetry: () => m.retry(),
28
+ onSkip: () => m.skip()
29
+ }
30
+ ) : a.status === "misconfigured" ? /* @__PURE__ */ r(
31
+ k,
32
+ {
33
+ status: "failure",
34
+ failureTitle: l("verification.noFormFields"),
35
+ onSkip: () => m.close(),
36
+ skipLabel: l("common.close")
37
+ }
38
+ ) : a.status === "form" ? /* @__PURE__ */ r(se, { state: a, manager: m }) : null;
39
+ }, ae = [
40
+ "street",
41
+ "city",
42
+ "state",
43
+ "postalCode",
44
+ "houseNo"
45
+ ], se = ({ state: p, manager: n }) => {
46
+ const {
47
+ fields: l,
48
+ values: a,
49
+ errors: m,
50
+ isValid: T,
51
+ addressSuggestions: V,
52
+ prefilled: w,
53
+ hideEmail: K,
54
+ fieldsCountry: C,
55
+ submitError: g,
56
+ submitAttempted: P
57
+ } = p, { t: s } = q(), N = F(null), A = F(null), R = F(void 0), M = Q(N, l.length), [D, x] = z({}), h = v((e) => {
58
+ x((t) => t[e] ? t : { ...t, [e]: !0 });
59
+ }, []), { displayErrors: S, errorParams: I } = J(
60
+ () => G(
61
+ m,
62
+ D,
63
+ P,
64
+ C,
65
+ l
66
+ ),
67
+ [m, D, P, C, l]
68
+ ), y = v(
69
+ (e) => h(e),
70
+ [h]
71
+ ), b = v(
72
+ (e, t) => {
73
+ h(e), n.setField(e, t);
74
+ },
75
+ [n, h]
76
+ ), _ = v(
77
+ (e) => {
78
+ for (const t of ae) h(t);
79
+ n.selectAddress(e);
80
+ },
81
+ [n, h]
82
+ );
83
+ $(() => {
84
+ const e = S.postalCode, t = R.current;
85
+ if (R.current = e, !e || t === e)
86
+ return;
87
+ const i = requestAnimationFrame(() => {
88
+ const c = A.current;
89
+ if (!c) return;
90
+ (c.querySelector("#postalCode-error") ?? c).scrollIntoView({
91
+ behavior: "smooth",
92
+ block: "nearest"
93
+ });
94
+ });
95
+ return () => cancelAnimationFrame(i);
96
+ }, [S.postalCode]);
97
+ const E = (e, t) => W(s, t, I[e]);
98
+ let B;
99
+ return /* @__PURE__ */ r(ee, { className: `IncodeEkycPage${M ? " IncodeEkycPageScrollable" : ""}`, title: s("verification.title"), children: [
100
+ /* @__PURE__ */ r("div", { ref: N, className: "IncodeEkycForm", children: l.map((e) => {
101
+ if (e.name === "email" && K) return null;
102
+ let t = null;
103
+ e.section && e.section !== B && (B = e.section, t = /* @__PURE__ */ r("h3", { className: "IncodeEkycSectionHeader", children: s({
104
+ address: "verification.labels.addressDetailsSection",
105
+ driverLicense: "verification.labels.dlDetailsSection"
106
+ }[e.section] ?? e.section) }));
107
+ const i = e.readonly || w[e.name], c = a[e.name] ?? "", u = S[e.name];
108
+ if (e.name === "street" && e.section === "address")
109
+ return /* @__PURE__ */ r("div", { children: [
110
+ t,
111
+ /* @__PURE__ */ r(
112
+ U,
113
+ {
114
+ label: e.label,
115
+ value: c,
116
+ error: u,
117
+ errorParams: I[e.name],
118
+ suggestions: V,
119
+ readonly: i,
120
+ optional: !e.required,
121
+ onChange: (o) => b("street", o),
122
+ onSearch: (o) => n.searchAddress(o),
123
+ onSelect: _,
124
+ onBlur: () => y("street")
125
+ }
126
+ )
127
+ ] }, e.name);
128
+ if (e.type === "dropdown") {
129
+ const o = s(e.label);
130
+ return /* @__PURE__ */ r("div", { children: [
131
+ t,
132
+ /* @__PURE__ */ r(
133
+ f,
134
+ {
135
+ id: `ekyc-${e.name}`,
136
+ label: o,
137
+ placeholder: e.placeholder ? s(e.placeholder) : void 0,
138
+ value: c,
139
+ options: (e.options ?? []).map((d) => ({
140
+ ...d,
141
+ label: s(d.label)
142
+ })),
143
+ error: E(e.name, u),
144
+ disabled: i,
145
+ searchable: !0,
146
+ onChange: (d) => b(e.name, d),
147
+ onBlur: () => y(e.name),
148
+ "data-testid": `ekyc-field-${e.name}`
149
+ }
150
+ )
151
+ ] }, e.name);
152
+ }
153
+ if (e.type === "date") {
154
+ const o = s(e.label);
155
+ return /* @__PURE__ */ r("div", { children: [
156
+ t,
157
+ /* @__PURE__ */ r(
158
+ Z,
159
+ {
160
+ id: `ekyc-${e.name}`,
161
+ label: o,
162
+ value: c,
163
+ error: E(e.name, u),
164
+ disabled: i,
165
+ onInput: (d) => {
166
+ const H = d.target;
167
+ b(e.name, H.value);
168
+ },
169
+ onBlur: () => y(e.name),
170
+ "data-testid": `ekyc-field-${e.name}`
171
+ }
172
+ )
173
+ ] }, e.name);
174
+ }
175
+ if (e.type === "phone") {
176
+ const o = s(e.label);
177
+ return /* @__PURE__ */ r("div", { children: [
178
+ t,
179
+ /* @__PURE__ */ r(
180
+ te,
181
+ {
182
+ id: `ekyc-${e.name}`,
183
+ label: o,
184
+ countryCode: C,
185
+ value: c,
186
+ placeholder: e.placeholder,
187
+ error: E(e.name, u),
188
+ disabled: i,
189
+ disableCountrySelector: e.disableCountrySelector,
190
+ required: e.required,
191
+ onChange: (d) => b(e.name, d),
192
+ onBlur: () => y(e.name),
193
+ "data-testid": `ekyc-field-${e.name}`
194
+ }
195
+ )
196
+ ] }, e.name);
197
+ }
198
+ return e.type === "radio" ? /* @__PURE__ */ r("div", { children: [
199
+ t,
200
+ /* @__PURE__ */ r("div", { className: "IncodeEkycRadioGroup", children: [
201
+ /* @__PURE__ */ r("label", { className: "IncodeEkycRadioLabel", children: s(e.label) }),
202
+ /* @__PURE__ */ r("div", { className: "IncodeEkycRadioOptions", children: e.options?.map((o) => /* @__PURE__ */ r(
203
+ "label",
204
+ {
205
+ className: "IncodeEkycRadioOption",
206
+ children: [
207
+ /* @__PURE__ */ r(
208
+ "input",
209
+ {
210
+ type: "radio",
211
+ name: e.name,
212
+ checked: c === o.value,
213
+ value: o.value,
214
+ onChange: () => b(e.name, o.value),
215
+ onBlur: () => y(e.name),
216
+ disabled: i
217
+ }
218
+ ),
219
+ /* @__PURE__ */ r("span", { children: s(o.label) })
220
+ ]
221
+ },
222
+ o.value
223
+ )) }),
224
+ u && /* @__PURE__ */ r("span", { className: "IncodeEkycFieldError", children: E(e.name, u) })
225
+ ] })
226
+ ] }, e.name) : /* @__PURE__ */ r(
227
+ "div",
228
+ {
229
+ ref: e.name === "postalCode" ? A : void 0,
230
+ children: [
231
+ t,
232
+ /* @__PURE__ */ r(
233
+ X,
234
+ {
235
+ name: e.name,
236
+ label: e.label,
237
+ value: c,
238
+ error: u,
239
+ errorParams: I[e.name],
240
+ type: e.type,
241
+ placeholder: e.placeholder,
242
+ placeholderParams: e.placeholderParams,
243
+ required: e.required,
244
+ optional: e.optional,
245
+ readonly: i,
246
+ maxLength: e.maxLength,
247
+ onChange: b,
248
+ onBlur: y
249
+ }
250
+ )
251
+ ]
252
+ },
253
+ e.name
254
+ );
255
+ }) }),
256
+ /* @__PURE__ */ r("div", { className: "IncodeEkycFooter", children: [
257
+ g && /* @__PURE__ */ r("p", { className: "IncodeEkycSubmitError", children: s(g) }),
258
+ /* @__PURE__ */ r(
259
+ L,
260
+ {
261
+ onClick: () => n.submit(),
262
+ disabled: !T,
263
+ "data-testid": "ekyc-submit",
264
+ children: s("common.continue")
265
+ }
266
+ ),
267
+ g === "verification.errors.countryNotSupported" && /* @__PURE__ */ r(
268
+ L,
269
+ {
270
+ variant: "link",
271
+ onClick: () => n.skip(),
272
+ "data-testid": "ekyc-skip",
273
+ children: s("verification.labels.skip")
274
+ }
275
+ )
276
+ ] })
277
+ ] });
278
+ }, ne = ({ config: p, onFinish: n }) => /* @__PURE__ */ r(O, { children: p ? /* @__PURE__ */ r(oe, { config: p, onFinish: n }) : null });
279
+ re(ne, "incode-ekyc");
280
+ export {
281
+ ne as EkycModule
282
+ };
@@ -2000,8 +2000,8 @@ const Pe = () => import("../id/id.es.js").then((e) => e.Id), ke = {
2000
2000
  (e) => e.GovernmentValidation
2001
2001
  ),
2002
2002
  GEOLOCATION: () => import("../geolocation/geolocation.es.js").then((e) => e.Geolocation),
2003
- EXTERNAL_VERIFICATION: () => import("../ekycModule-CQsPzNhO.js").then((e) => e.EkycModule),
2004
- EKYB: () => import("../ekybModule-DUoTzXAx.js").then((e) => e.EkybModule),
2003
+ EXTERNAL_VERIFICATION: () => import("../ekycModule-CFcYtlo_.js").then((e) => e.EkycModule),
2004
+ EKYB: () => import("../ekybModule-FeVB4y3_.js").then((e) => e.EkybModule),
2005
2005
  DOCUMENT_CAPTURE: () => import("../documentCapture-PdKA2frR.js").then(
2006
2006
  (e) => e.DocumentCapture
2007
2007
  ),
@@ -5416,6 +5416,14 @@
5416
5416
  margin-bottom: var(--spacing-0, var(--spacing-none, 0px));
5417
5417
  }
5418
5418
 
5419
+ .IncodeEkycFooter {
5420
+ margin-top: var(--spacing-24, var(--spacing-24, 24px));
5421
+ align-items: center;
5422
+ gap: var(--spacing-12, var(--spacing-12, 12px));
5423
+ flex-direction: column;
5424
+ display: flex;
5425
+ }
5426
+
5419
5427
  @media (min-width: 768px) {
5420
5428
  .IncodePageContainer.IncodeEkycPage {
5421
5429
  height: 100dvh;
@@ -5438,7 +5446,6 @@
5438
5446
  .IncodeEkycPage .IncodeEkycForm {
5439
5447
  min-height: var(--spacing-0, var(--spacing-none, 0px));
5440
5448
  padding-bottom: var(--spacing-8, var(--spacing-8, 8px));
5441
- flex: 1;
5442
5449
  overflow-y: auto;
5443
5450
  }
5444
5451
 
@@ -5747,6 +5754,10 @@
5747
5754
  margin-inline: auto;
5748
5755
  }
5749
5756
 
5757
+ .IncodeEkybFooter {
5758
+ margin-top: var(--spacing-24, var(--spacing-24, 24px));
5759
+ }
5760
+
5750
5761
  @media (min-width: 768px) {
5751
5762
  .IncodePageContainer.IncodeEkybPage {
5752
5763
  margin-top: var(--spacing-0, var(--spacing-none, 0px));
@@ -5769,7 +5780,6 @@
5769
5780
  .IncodeEkybPage .IncodeEkybForm {
5770
5781
  min-height: var(--spacing-0, var(--spacing-none, 0px));
5771
5782
  padding-bottom: var(--spacing-8, var(--spacing-8, 8px));
5772
- flex: 1;
5773
5783
  overflow-y: auto;
5774
5784
  }
5775
5785
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@incodetech/web",
3
- "version": "0.0.0-dev-20260317-5e90a15",
3
+ "version": "0.0.0-dev-20260317-737b25e",
4
4
  "type": "module",
5
5
  "main": "./dist/index.es.js",
6
6
  "types": "./dist/types/index.d.ts",
@@ -119,7 +119,7 @@
119
119
  "preact-custom-element": "^4.6.0",
120
120
  "qrcode": "^1.5.4",
121
121
  "tailwindcss": "^4.1.17",
122
- "@incodetech/core": "0.0.0-dev-20260317-5e90a15"
122
+ "@incodetech/core": "0.0.0-dev-20260317-737b25e"
123
123
  },
124
124
  "devDependencies": {
125
125
  "@microsoft/api-extractor": "^7.53.3",
@@ -1,302 +0,0 @@
1
- import { b as C, u as r, I as D, a as M, S as L, B as T } from "./button-Ca1tRSTI.js";
2
- import { SUPPORTED_COUNTRIES as f, DEV_ONLY_COUNTRIES as B, createEkybManager as O } from "@incodetech/core/ekyb";
3
- import { T as _, y as A, A as F, k as q } from "./vendor-preact-BXf0bkEs.js";
4
- import "./uiConfig-Z6RT23Sl.js";
5
- import "@incodetech/core";
6
- import { u as V, A as G } from "./addressAutocomplete-DetZGxBZ.js";
7
- import { P as K } from "./page-BVHG3h0V.js";
8
- import { t as P, F as z, V as I } from "./formField-FeX9N4c8.js";
9
- import { r as W } from "./incodeModule-aE-LkKwM.js";
10
- import { D as R } from "./dropdownComposed-B5ZuQS8C.js";
11
- import { I as g } from "./inputComposed-BHi-MSpP.js";
12
- function Y(e) {
13
- return [...e.toUpperCase()].map((o) => String.fromCodePoint(127462 + o.charCodeAt(0) - 65)).join("");
14
- }
15
- const j = {
16
- BR: "Brazil",
17
- CM: "Cameroon",
18
- CN: "China",
19
- FR: "France",
20
- DE: "Germany",
21
- IL: "Israel",
22
- IT: "Italy",
23
- KE: "Kenya",
24
- MX: "Mexico",
25
- NG: "Nigeria",
26
- ES: "Spain",
27
- GB: "United Kingdom",
28
- US: "USA"
29
- };
30
- function H(e) {
31
- const o = j[e] ?? e;
32
- return { value: e, label: `${Y(e)} ${o}` };
33
- }
34
- function X() {
35
- if (typeof window > "u") return !1;
36
- const { hostname: e } = window.location;
37
- return e === "localhost" || e.includes("stage") || e.includes("demo");
38
- }
39
- const J = ({
40
- value: e,
41
- onChange: o
42
- }) => {
43
- const { t: u } = C(), n = _(() => (X() ? [...f, ...B] : [...f]).map(H).sort((l, c) => l.label.localeCompare(c.label)), []);
44
- return /* @__PURE__ */ r("div", { className: "IncodeEkybCountrySelector", children: /* @__PURE__ */ r(
45
- R,
46
- {
47
- id: "ekyb-country",
48
- label: u("ekyb.country"),
49
- value: e,
50
- options: n,
51
- onChange: o,
52
- "data-testid": "ekyb-country-selector"
53
- }
54
- ) });
55
- }, U = ({
56
- field: e,
57
- value: o,
58
- error: u,
59
- errorParams: n,
60
- country: m,
61
- onChange: l,
62
- onBlur: c
63
- }) => {
64
- const { t: b } = C(), i = !e.required, y = b(e.label);
65
- if (e.type === "dropdown") {
66
- const d = i ? `${y} (${b("common.optional")})` : y, s = e.name === "state" ? b("ekyb.selectState") : void 0;
67
- return /* @__PURE__ */ r(
68
- R,
69
- {
70
- id: `ekyb-${e.name}`,
71
- label: d,
72
- placeholder: s,
73
- value: o,
74
- options: (e.options ?? []).map((p) => ({
75
- ...p,
76
- label: b(p.label)
77
- })),
78
- error: P(b, u, n),
79
- searchable: !0,
80
- onChange: (p) => l(e.name, p),
81
- onBlur: c ? () => c(e.name) : void 0,
82
- "data-testid": `ekyb-field-${e.name}`
83
- }
84
- );
85
- }
86
- return /* @__PURE__ */ r(
87
- z,
88
- {
89
- name: e.name,
90
- label: e.label,
91
- value: o,
92
- error: u,
93
- errorParams: n,
94
- required: e.required,
95
- optional: i,
96
- onChange: l,
97
- onBlur: c
98
- }
99
- );
100
- }, Q = ({
101
- ubos: e,
102
- errors: o,
103
- errorParams: u,
104
- canAddUbo: n,
105
- onSetField: m,
106
- onBlur: l,
107
- onAdd: c,
108
- onRemove: b
109
- }) => {
110
- const { t: i } = C(), y = (d) => P(i, o[d], u[d]);
111
- return e.length === 0 ? null : /* @__PURE__ */ r("div", { className: "IncodeEkybUbos", children: [
112
- e.map((d, s) => {
113
- const p = s === 0 ? i("ekyb.uboName") : i("ekyb.uboNameWithNumber", { number: s + 1 }), E = s === 0 ? i("ekyb.uboSurname") : i("ekyb.uboSurnameWithNumber", { number: s + 1 }), v = s === 0;
114
- return /* @__PURE__ */ r("div", { className: "IncodeEkybUboEntry", children: [
115
- /* @__PURE__ */ r(
116
- g,
117
- {
118
- id: `ubo-${s}-name`,
119
- label: p,
120
- name: `ubo-${s}-name`,
121
- value: d.name,
122
- error: y(`ubo-${s}-name`),
123
- onInput: (k) => m(s, "name", k.target.value),
124
- onBlur: l ? () => l(`ubo-${s}-name`) : void 0,
125
- "data-testid": `ekyb-ubo-${s}-name`
126
- }
127
- ),
128
- /* @__PURE__ */ r(
129
- g,
130
- {
131
- id: `ubo-${s}-surname`,
132
- label: E,
133
- name: `ubo-${s}-surname`,
134
- value: d.surname,
135
- error: y(`ubo-${s}-surname`),
136
- onInput: (k) => m(
137
- s,
138
- "surname",
139
- k.target.value
140
- ),
141
- onBlur: l ? () => l(`ubo-${s}-surname`) : void 0,
142
- "data-testid": `ekyb-ubo-${s}-surname`
143
- }
144
- ),
145
- !v && /* @__PURE__ */ r(
146
- "button",
147
- {
148
- className: "IncodeEkybRemoveUbo",
149
- onClick: () => b(s),
150
- type: "button",
151
- children: i("common.remove")
152
- }
153
- )
154
- ] }, d.id);
155
- }),
156
- n && /* @__PURE__ */ r(
157
- "button",
158
- {
159
- className: "IncodeEkybAddUbo",
160
- onClick: c,
161
- type: "button",
162
- "data-testid": "ekyb-add-ubo",
163
- children: i("ekyb.addAnotherUbo")
164
- }
165
- )
166
- ] });
167
- }, Z = ({ config: e, onFinish: o }) => {
168
- const { t: u } = C(), [n, m] = M(() => O({ config: e }));
169
- return A(() => {
170
- (n.status === "finished" || n.status === "closed") && o?.();
171
- }, [n.status, o]), n.status === "finished" || n.status === "closed" ? null : n.status === "loading" ? /* @__PURE__ */ r(
172
- I,
173
- {
174
- status: "submitting",
175
- submittingTitle: u("common.loading")
176
- }
177
- ) : n.status === "submitting" ? /* @__PURE__ */ r(I, { status: "submitting" }) : n.status === "success" ? /* @__PURE__ */ r(I, { status: "success" }) : n.status === "error" ? /* @__PURE__ */ r(I, { status: "failure", onRetry: () => m.retry() }) : n.status === "form" ? /* @__PURE__ */ r(x, { state: n, manager: m }) : null;
178
- }, $ = /* @__PURE__ */ new Set([
179
- "street",
180
- "houseNo",
181
- "addressLine2",
182
- "city",
183
- "state",
184
- "postalCode"
185
- ]), x = ({ state: e, manager: o }) => {
186
- const {
187
- country: u,
188
- fields: n,
189
- values: m,
190
- displayErrors: l,
191
- errorParams: c,
192
- isValid: b,
193
- ubos: i,
194
- canAddUbo: y,
195
- addressSuggestions: d
196
- } = e, { t: s } = C(), p = F(null), E = F(null), v = F(void 0), k = V(p, n.length);
197
- A(() => {
198
- const t = l.postalCode, a = v.current;
199
- if (v.current = t, !t || a === t)
200
- return;
201
- const h = requestAnimationFrame(() => {
202
- const S = E.current;
203
- if (!S) return;
204
- (S.querySelector("#postalCode-error") ?? S).scrollIntoView({
205
- behavior: "smooth",
206
- block: "nearest"
207
- });
208
- });
209
- return () => cancelAnimationFrame(h);
210
- }, [l.postalCode]);
211
- const w = n.filter((t) => !$.has(t.name)), N = n.filter((t) => $.has(t.name));
212
- return /* @__PURE__ */ r(K, { className: `IncodeEkybPage${k ? " IncodeEkybPageScrollable" : ""}`, title: s("ekyb.title"), children: [
213
- /* @__PURE__ */ r("div", { ref: p, className: "IncodeEkybForm", children: [
214
- /* @__PURE__ */ r(
215
- J,
216
- {
217
- value: u,
218
- onChange: (t) => o.setCountry(t)
219
- }
220
- ),
221
- w.map((t) => /* @__PURE__ */ r(
222
- U,
223
- {
224
- field: t,
225
- value: m[t.name] ?? "",
226
- error: l[t.name],
227
- errorParams: c[t.name],
228
- country: u,
229
- onChange: (a, h) => o.setField(a, h),
230
- onBlur: (a) => o.blurField(a)
231
- },
232
- t.name
233
- )),
234
- /* @__PURE__ */ r(
235
- Q,
236
- {
237
- ubos: i,
238
- errors: l,
239
- errorParams: c,
240
- canAddUbo: y,
241
- onSetField: (t, a, h) => o.setUboField(t, a, h),
242
- onBlur: (t) => o.blurField(t),
243
- onAdd: () => o.addUbo(),
244
- onRemove: (t) => o.removeUbo(t)
245
- }
246
- ),
247
- N.length > 0 && /* @__PURE__ */ r(q, { children: [
248
- /* @__PURE__ */ r("h3", { className: "IncodeEkybSectionHeader", children: s("ekyb.addressDetails") }),
249
- N.map((t) => t.name === "street" ? /* @__PURE__ */ r(
250
- G,
251
- {
252
- label: t.label,
253
- value: m.street ?? "",
254
- error: l.street,
255
- errorParams: c.street,
256
- suggestions: d,
257
- optional: !t.required,
258
- onChange: (a) => o.setField("street", a),
259
- onSearch: (a) => o.searchAddress(a),
260
- onSelect: (a) => o.selectAddress(a),
261
- onBlur: () => o.blurField("street")
262
- },
263
- t.name
264
- ) : /* @__PURE__ */ r(
265
- "div",
266
- {
267
- ref: t.name === "postalCode" ? E : void 0,
268
- children: /* @__PURE__ */ r(
269
- U,
270
- {
271
- field: t,
272
- value: m[t.name] ?? "",
273
- error: l[t.name],
274
- errorParams: c[t.name],
275
- country: u,
276
- onChange: (a, h) => o.setField(a, h),
277
- onBlur: (a) => o.blurField(a)
278
- }
279
- )
280
- },
281
- t.name
282
- ))
283
- ] })
284
- ] }),
285
- /* @__PURE__ */ r("div", { className: "IncodeEkybFooter", children: [
286
- /* @__PURE__ */ r(L, { size: 32 }),
287
- /* @__PURE__ */ r(
288
- T,
289
- {
290
- onClick: () => o.submit(),
291
- disabled: !b,
292
- "data-testid": "ekyb-submit",
293
- children: s("ekyb.continue")
294
- }
295
- )
296
- ] })
297
- ] });
298
- }, ee = ({ config: e, onFinish: o }) => /* @__PURE__ */ r(D, { children: e ? /* @__PURE__ */ r(Z, { config: e, onFinish: o }) : null });
299
- W(ee, "incode-ekyb");
300
- export {
301
- ee as EkybModule
302
- };
@@ -1,243 +0,0 @@
1
- import { u as r, I as q, b as S, a as D, S as V, B as w } from "./button-Ca1tRSTI.js";
2
- import { createEkycManager as M } from "@incodetech/core/ekyc";
3
- import { y as g, A as v } from "./vendor-preact-BXf0bkEs.js";
4
- import "./uiConfig-Z6RT23Sl.js";
5
- import "@incodetech/core";
6
- import { u as x, A as T } from "./addressAutocomplete-DetZGxBZ.js";
7
- import { V as b, t as H, F as K } from "./formField-FeX9N4c8.js";
8
- import { D as O } from "./dateInputComposed-CvFmQpJ0.js";
9
- import { D as z } from "./dropdownComposed-B5ZuQS8C.js";
10
- import { P as G } from "./page-BVHG3h0V.js";
11
- import { r as j } from "./incodeModule-aE-LkKwM.js";
12
- import { P as J } from "./phoneInputComposed-CwtJKvGh.js";
13
- const Q = ({ config: m, onFinish: o }) => {
14
- const { t: p } = S(), [a, i] = D(() => M({ config: m }));
15
- return g(() => {
16
- (a.status === "finished" || a.status === "closed") && o?.();
17
- }, [a.status, o]), a.status === "finished" || a.status === "closed" ? null : a.status === "loading" ? /* @__PURE__ */ r(
18
- b,
19
- {
20
- status: "submitting",
21
- submittingTitle: p("common.loading")
22
- }
23
- ) : a.status === "submitting" ? /* @__PURE__ */ r(b, { status: "submitting" }) : a.status === "success" ? /* @__PURE__ */ r(b, { status: "success" }) : a.status === "error" ? /* @__PURE__ */ r(
24
- b,
25
- {
26
- status: "failure",
27
- onRetry: () => i.retry(),
28
- onSkip: () => i.skip()
29
- }
30
- ) : a.status === "misconfigured" ? /* @__PURE__ */ r(
31
- b,
32
- {
33
- status: "failure",
34
- failureTitle: p("verification.noFormFields"),
35
- onSkip: () => i.close(),
36
- skipLabel: p("common.close")
37
- }
38
- ) : a.status === "form" ? /* @__PURE__ */ r(U, { state: a, manager: i }) : null;
39
- }, U = ({ state: m, manager: o }) => {
40
- const {
41
- fields: p,
42
- values: a,
43
- displayErrors: i,
44
- errorParams: y,
45
- isValid: P,
46
- addressSuggestions: N,
47
- prefilled: R,
48
- hideEmail: A,
49
- fieldsCountry: B,
50
- submitError: k
51
- } = m, { t: s } = S(), E = v(null), C = v(null), F = v(void 0), L = x(E, p.length);
52
- g(() => {
53
- const e = i.postalCode, n = F.current;
54
- if (F.current = e, !e || n === e)
55
- return;
56
- const u = requestAnimationFrame(() => {
57
- const l = C.current;
58
- if (!l) return;
59
- (l.querySelector("#postalCode-error") ?? l).scrollIntoView({
60
- behavior: "smooth",
61
- block: "nearest"
62
- });
63
- });
64
- return () => cancelAnimationFrame(u);
65
- }, [i.postalCode]);
66
- const h = (e, n) => H(s, n, y[e]);
67
- let I;
68
- return /* @__PURE__ */ r(G, { className: `IncodeEkycPage${L ? " IncodeEkycPageScrollable" : ""}`, title: s("verification.title"), children: [
69
- /* @__PURE__ */ r("div", { ref: E, className: "IncodeEkycForm", children: p.map((e) => {
70
- if (e.name === "email" && A) return null;
71
- let n = null;
72
- e.section && e.section !== I && (I = e.section, n = /* @__PURE__ */ r("h3", { className: "IncodeEkycSectionHeader", children: s({
73
- address: "verification.labels.addressDetailsSection",
74
- driverLicense: "verification.labels.dlDetailsSection"
75
- }[e.section] ?? e.section) }));
76
- const u = e.readonly || R[e.name], l = a[e.name] ?? "", d = i[e.name];
77
- if (e.name === "street" && e.section === "address")
78
- return /* @__PURE__ */ r("div", { children: [
79
- n,
80
- /* @__PURE__ */ r(
81
- T,
82
- {
83
- label: e.label,
84
- value: l,
85
- error: d,
86
- errorParams: y[e.name],
87
- suggestions: N,
88
- readonly: u,
89
- optional: !e.required,
90
- onChange: (t) => o.setField("street", t),
91
- onSearch: (t) => o.searchAddress(t),
92
- onSelect: (t) => o.selectAddress(t),
93
- onBlur: () => o.blurField("street")
94
- }
95
- )
96
- ] }, e.name);
97
- if (e.type === "dropdown") {
98
- const t = s(e.label);
99
- return /* @__PURE__ */ r("div", { children: [
100
- n,
101
- /* @__PURE__ */ r(
102
- z,
103
- {
104
- id: `ekyc-${e.name}`,
105
- label: t,
106
- placeholder: e.placeholder ? s(e.placeholder) : void 0,
107
- value: l,
108
- options: (e.options ?? []).map((c) => ({
109
- ...c,
110
- label: s(c.label)
111
- })),
112
- error: h(e.name, d),
113
- disabled: u,
114
- searchable: !0,
115
- onChange: (c) => o.setField(e.name, c),
116
- onBlur: () => o.blurField(e.name),
117
- "data-testid": `ekyc-field-${e.name}`
118
- }
119
- )
120
- ] }, e.name);
121
- }
122
- if (e.type === "date") {
123
- const t = s(e.label);
124
- return /* @__PURE__ */ r("div", { children: [
125
- n,
126
- /* @__PURE__ */ r(
127
- O,
128
- {
129
- id: `ekyc-${e.name}`,
130
- label: t,
131
- value: l,
132
- error: h(e.name, d),
133
- disabled: u,
134
- onInput: (c) => {
135
- const $ = c.target;
136
- o.setField(e.name, $.value);
137
- },
138
- onBlur: () => o.blurField(e.name),
139
- "data-testid": `ekyc-field-${e.name}`
140
- }
141
- )
142
- ] }, e.name);
143
- }
144
- if (e.type === "phone") {
145
- const t = s(e.label);
146
- return /* @__PURE__ */ r("div", { children: [
147
- n,
148
- /* @__PURE__ */ r(
149
- J,
150
- {
151
- id: `ekyc-${e.name}`,
152
- label: t,
153
- countryCode: B,
154
- value: l,
155
- placeholder: e.placeholder,
156
- error: h(e.name, d),
157
- disabled: u,
158
- disableCountrySelector: e.disableCountrySelector,
159
- required: e.required,
160
- onChange: (c) => o.setField(e.name, c),
161
- onBlur: () => o.blurField(e.name),
162
- "data-testid": `ekyc-field-${e.name}`
163
- }
164
- )
165
- ] }, e.name);
166
- }
167
- return e.type === "radio" ? /* @__PURE__ */ r("div", { children: [
168
- n,
169
- /* @__PURE__ */ r("div", { className: "IncodeEkycRadioGroup", children: [
170
- /* @__PURE__ */ r("label", { className: "IncodeEkycRadioLabel", children: s(e.label) }),
171
- /* @__PURE__ */ r("div", { className: "IncodeEkycRadioOptions", children: e.options?.map((t) => /* @__PURE__ */ r(
172
- "label",
173
- {
174
- className: "IncodeEkycRadioOption",
175
- children: [
176
- /* @__PURE__ */ r(
177
- "input",
178
- {
179
- type: "radio",
180
- name: e.name,
181
- checked: l === t.value,
182
- value: t.value,
183
- onChange: () => o.setField(e.name, t.value),
184
- onBlur: () => o.blurField(e.name),
185
- disabled: u
186
- }
187
- ),
188
- /* @__PURE__ */ r("span", { children: s(t.label) })
189
- ]
190
- },
191
- t.value
192
- )) }),
193
- d && /* @__PURE__ */ r("span", { className: "IncodeEkycFieldError", children: h(e.name, d) })
194
- ] })
195
- ] }, e.name) : /* @__PURE__ */ r(
196
- "div",
197
- {
198
- ref: e.name === "postalCode" ? C : void 0,
199
- children: [
200
- n,
201
- /* @__PURE__ */ r(
202
- K,
203
- {
204
- name: e.name,
205
- label: e.label,
206
- value: l,
207
- error: d,
208
- errorParams: y[e.name],
209
- type: e.type,
210
- placeholder: e.placeholder,
211
- placeholderParams: e.placeholderParams,
212
- required: e.required,
213
- optional: e.optional,
214
- readonly: u,
215
- maxLength: e.maxLength,
216
- onChange: (t, c) => o.setField(t, c),
217
- onBlur: (t) => o.blurField(t)
218
- }
219
- )
220
- ]
221
- },
222
- e.name
223
- );
224
- }) }),
225
- /* @__PURE__ */ r("div", { className: "IncodeEkycFooter", children: [
226
- /* @__PURE__ */ r(V, { size: 32 }),
227
- k && /* @__PURE__ */ r("p", { className: "IncodeEkycSubmitError", children: s(k) }),
228
- /* @__PURE__ */ r(
229
- w,
230
- {
231
- onClick: () => o.submit(),
232
- disabled: !P,
233
- "data-testid": "ekyc-submit",
234
- children: s("common.continue")
235
- }
236
- )
237
- ] })
238
- ] });
239
- }, W = ({ config: m, onFinish: o }) => /* @__PURE__ */ r(q, { children: m ? /* @__PURE__ */ r(Q, { config: m, onFinish: o }) : null });
240
- j(W, "incode-ekyc");
241
- export {
242
- W as EkycModule
243
- };