@vpdev2/metakyc 1.0.0 → 1.0.1
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/components/CreateApplicantForm.d.ts.map +1 -1
- package/dist/index.cjs +7 -7
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +169 -166
- package/dist/index.js.map +1 -1
- package/dist/styles.css +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -2225,12 +2225,12 @@ function Vr(e) {
|
|
|
2225
2225
|
]);
|
|
2226
2226
|
if (i(M), (z = j == null ? void 0 : j.questionnaireResults) != null && z.length && M) {
|
|
2227
2227
|
const K = /* @__PURE__ */ new Map();
|
|
2228
|
-
for (const
|
|
2229
|
-
|
|
2230
|
-
const ee = {}, E = M.questionGroups.flatMap((
|
|
2231
|
-
for (const
|
|
2232
|
-
const $ =
|
|
2233
|
-
K.has($) && (ee[
|
|
2228
|
+
for (const g of j.questionnaireResults)
|
|
2229
|
+
g.question && ((Q = g.answers) != null && Q.length) && K.set(g.question.trim().toLowerCase(), g.answers);
|
|
2230
|
+
const ee = {}, E = M.questionGroups.flatMap((g) => g.questions ?? []);
|
|
2231
|
+
for (const g of E) {
|
|
2232
|
+
const $ = g.text.trim().toLowerCase();
|
|
2233
|
+
K.has($) && (ee[g.id] = K.get($));
|
|
2234
2234
|
}
|
|
2235
2235
|
c(ee);
|
|
2236
2236
|
}
|
|
@@ -2501,12 +2501,12 @@ function Jr(e) {
|
|
|
2501
2501
|
]);
|
|
2502
2502
|
if (i(j), (M = K == null ? void 0 : K.riskScoringResults) != null && M.length) {
|
|
2503
2503
|
const ee = K.riskScoringResults[0], E = {};
|
|
2504
|
-
for (const
|
|
2505
|
-
if (
|
|
2504
|
+
for (const g of ee.riskCriteriaResults ?? [])
|
|
2505
|
+
if (g.riskCriteriaId != null && g.answer != null && g.answer !== "") {
|
|
2506
2506
|
const $ = [...new Set(
|
|
2507
|
-
|
|
2507
|
+
g.answer.split(",").map((V) => V.trim()).filter((V) => V !== "")
|
|
2508
2508
|
)];
|
|
2509
|
-
$.length > 0 && (E[
|
|
2509
|
+
$.length > 0 && (E[g.riskCriteriaId] = $);
|
|
2510
2510
|
}
|
|
2511
2511
|
c(E);
|
|
2512
2512
|
}
|
|
@@ -2975,7 +2975,7 @@ const Et = 280, en = ({
|
|
|
2975
2975
|
window.removeEventListener("scroll", F, !0), window.removeEventListener("resize", F);
|
|
2976
2976
|
};
|
|
2977
2977
|
}, [p, j]);
|
|
2978
|
-
const
|
|
2978
|
+
const g = a.filter(
|
|
2979
2979
|
(F) => F.label.toLowerCase().includes(P.toLowerCase())
|
|
2980
2980
|
), $ = (F) => {
|
|
2981
2981
|
y || n(t.includes(F) ? t.filter((U) => U !== F) : [...t, F]);
|
|
@@ -3034,7 +3034,7 @@ const Et = 280, en = ({
|
|
|
3034
3034
|
}
|
|
3035
3035
|
}
|
|
3036
3036
|
) }),
|
|
3037
|
-
/* @__PURE__ */ r("ul", { style: { listStyle: "none", margin: 0, padding: "4px 0", maxHeight: "192px", overflowY: "auto" }, children:
|
|
3037
|
+
/* @__PURE__ */ r("ul", { style: { listStyle: "none", margin: 0, padding: "4px 0", maxHeight: "192px", overflowY: "auto" }, children: g.length === 0 ? /* @__PURE__ */ r("li", { style: { padding: "8px 12px", fontSize: "13px", color: Y }, children: "No results" }) : g.map((F) => {
|
|
3038
3038
|
const U = t.includes(F.value);
|
|
3039
3039
|
return /* @__PURE__ */ s(
|
|
3040
3040
|
"li",
|
|
@@ -3217,7 +3217,7 @@ const Et = 280, en = ({
|
|
|
3217
3217
|
primaryLight: te("--metakyc-primary-light", "#eff6ff"),
|
|
3218
3218
|
hoverBg: te("--metakyc-surface", ye)
|
|
3219
3219
|
});
|
|
3220
|
-
}, []), K = de(null), ee = de(null), E = de(null),
|
|
3220
|
+
}, []), K = de(null), ee = de(null), E = de(null), g = de(null), $ = ae(() => {
|
|
3221
3221
|
if (!ee.current) return null;
|
|
3222
3222
|
const I = ee.current.getBoundingClientRect(), ye = window.innerHeight - I.bottom < Ft && I.top > Ft;
|
|
3223
3223
|
return {
|
|
@@ -3252,9 +3252,9 @@ const Et = 280, en = ({
|
|
|
3252
3252
|
window.removeEventListener("scroll", I, !0), window.removeEventListener("resize", I);
|
|
3253
3253
|
};
|
|
3254
3254
|
}, [v, $]), ge(() => {
|
|
3255
|
-
v &&
|
|
3255
|
+
v && g.current && setTimeout(() => {
|
|
3256
3256
|
var I;
|
|
3257
|
-
return (I =
|
|
3257
|
+
return (I = g.current) == null ? void 0 : I.focus();
|
|
3258
3258
|
}, 0);
|
|
3259
3259
|
}, [v]);
|
|
3260
3260
|
const J = a.filter(
|
|
@@ -3283,7 +3283,7 @@ const Et = 280, en = ({
|
|
|
3283
3283
|
/* @__PURE__ */ r("div", { style: { padding: "8px", borderBottom: `1px solid ${ue}` }, children: /* @__PURE__ */ r(
|
|
3284
3284
|
"input",
|
|
3285
3285
|
{
|
|
3286
|
-
ref:
|
|
3286
|
+
ref: g,
|
|
3287
3287
|
type: "text",
|
|
3288
3288
|
value: T,
|
|
3289
3289
|
onChange: (I) => w(I.target.value),
|
|
@@ -3435,12 +3435,12 @@ const rn = ({
|
|
|
3435
3435
|
const [x, P] = k(!1), [v, A] = k(null), T = de(null), w = ae((E) => {
|
|
3436
3436
|
if (!E) return;
|
|
3437
3437
|
A(null);
|
|
3438
|
-
const
|
|
3439
|
-
if (o &&
|
|
3438
|
+
const g = Array.from(E);
|
|
3439
|
+
if (o && g.filter((V) => V.size > o).length > 0) {
|
|
3440
3440
|
A(`File exceeds the maximum size of ${xt(o)}`);
|
|
3441
3441
|
return;
|
|
3442
3442
|
}
|
|
3443
|
-
d == null || d(i ? [...y, ...
|
|
3443
|
+
d == null || d(i ? [...y, ...g] : [g[0]]);
|
|
3444
3444
|
}, [o, i, d, y]), N = ae((E) => {
|
|
3445
3445
|
E.preventDefault(), E.stopPropagation(), P(!0);
|
|
3446
3446
|
}, []), z = ae((E) => {
|
|
@@ -3452,8 +3452,8 @@ const rn = ({
|
|
|
3452
3452
|
(E = T.current) == null || E.click();
|
|
3453
3453
|
}, j = (E) => {
|
|
3454
3454
|
A(null);
|
|
3455
|
-
const
|
|
3456
|
-
d == null || d(
|
|
3455
|
+
const g = y.filter(($, V) => V !== E);
|
|
3456
|
+
d == null || d(g);
|
|
3457
3457
|
}, K = n || v, ee = y.length > 0;
|
|
3458
3458
|
return /* @__PURE__ */ s("div", { className: Ae("metakyc-file-upload", p), style: { width: "100%" }, children: [
|
|
3459
3459
|
e && /* @__PURE__ */ s("div", { style: { marginBottom: "8px" }, children: [
|
|
@@ -3559,7 +3559,7 @@ const rn = ({
|
|
|
3559
3559
|
]
|
|
3560
3560
|
}
|
|
3561
3561
|
),
|
|
3562
|
-
ee && /* @__PURE__ */ r("div", { style: { marginTop: "12px", display: "flex", flexDirection: "column", gap: "8px" }, children: y.map((E,
|
|
3562
|
+
ee && /* @__PURE__ */ r("div", { style: { marginTop: "12px", display: "flex", flexDirection: "column", gap: "8px" }, children: y.map((E, g) => {
|
|
3563
3563
|
const $ = tn(E), V = $ === "image", G = V ? URL.createObjectURL(E) : null;
|
|
3564
3564
|
return /* @__PURE__ */ s(
|
|
3565
3565
|
"div",
|
|
@@ -3626,7 +3626,7 @@ const rn = ({
|
|
|
3626
3626
|
{
|
|
3627
3627
|
type: "button",
|
|
3628
3628
|
onClick: (_) => {
|
|
3629
|
-
_.stopPropagation(), j(
|
|
3629
|
+
_.stopPropagation(), j(g);
|
|
3630
3630
|
},
|
|
3631
3631
|
style: {
|
|
3632
3632
|
display: "flex",
|
|
@@ -3657,7 +3657,7 @@ const rn = ({
|
|
|
3657
3657
|
)
|
|
3658
3658
|
]
|
|
3659
3659
|
},
|
|
3660
|
-
`${E.name}-${
|
|
3660
|
+
`${E.name}-${g}`
|
|
3661
3661
|
);
|
|
3662
3662
|
}) }),
|
|
3663
3663
|
K && /* @__PURE__ */ r("p", { style: { fontSize: "13px", color: "var(--metakyc-danger, #ef4444)", marginTop: "6px" }, children: K })
|
|
@@ -3894,18 +3894,18 @@ const yn = ({
|
|
|
3894
3894
|
const w = De(
|
|
3895
3895
|
() => a ? mn(a.questionGroups) : [],
|
|
3896
3896
|
[a]
|
|
3897
|
-
), N = A === w.length - 1, z = w[A] ?? [], Q = ae((E,
|
|
3898
|
-
x(($) => ({ ...$, [E]:
|
|
3897
|
+
), N = A === w.length - 1, z = w[A] ?? [], Q = ae((E, g) => {
|
|
3898
|
+
x(($) => ({ ...$, [E]: g })), v(($) => {
|
|
3899
3899
|
const V = { ...$ };
|
|
3900
3900
|
return delete V[E], V;
|
|
3901
3901
|
});
|
|
3902
3902
|
}, []), M = ae(() => {
|
|
3903
3903
|
const E = {};
|
|
3904
|
-
for (const { question:
|
|
3905
|
-
const $ = pn(
|
|
3906
|
-
$ && (E[
|
|
3904
|
+
for (const { question: g } of z) {
|
|
3905
|
+
const $ = pn(g, p[g.id] ?? []);
|
|
3906
|
+
$ && (E[g.id] = $);
|
|
3907
3907
|
}
|
|
3908
|
-
return v((
|
|
3908
|
+
return v((g) => ({ ...g, ...E })), Object.keys(E).length === 0;
|
|
3909
3909
|
}, [z, p]), j = () => {
|
|
3910
3910
|
M() && T((E) => E + 1);
|
|
3911
3911
|
}, K = () => {
|
|
@@ -3918,12 +3918,12 @@ const yn = ({
|
|
|
3918
3918
|
questionId: V.id,
|
|
3919
3919
|
values: p[V.id] ?? []
|
|
3920
3920
|
}))
|
|
3921
|
-
),
|
|
3921
|
+
), g = {
|
|
3922
3922
|
applicantId: e,
|
|
3923
3923
|
questionnarieId: a.id,
|
|
3924
3924
|
questionResults: E
|
|
3925
3925
|
};
|
|
3926
|
-
await y(
|
|
3926
|
+
await y(g), t == null || t();
|
|
3927
3927
|
} catch (E) {
|
|
3928
3928
|
console.error("Questionnaire submit error:", E);
|
|
3929
3929
|
}
|
|
@@ -3942,17 +3942,17 @@ const yn = ({
|
|
|
3942
3942
|
" of ",
|
|
3943
3943
|
w.length
|
|
3944
3944
|
] }),
|
|
3945
|
-
/* @__PURE__ */ r("div", { className: "flex items-center gap-1.5", children: w.map((E,
|
|
3945
|
+
/* @__PURE__ */ r("div", { className: "flex items-center gap-1.5", children: w.map((E, g) => /* @__PURE__ */ r(
|
|
3946
3946
|
"div",
|
|
3947
3947
|
{
|
|
3948
3948
|
className: "rounded-full transition-all duration-200",
|
|
3949
3949
|
style: {
|
|
3950
3950
|
height: "6px",
|
|
3951
|
-
width:
|
|
3952
|
-
backgroundColor:
|
|
3951
|
+
width: g === A ? "20px" : "6px",
|
|
3952
|
+
backgroundColor: g <= A ? "var(--metakyc-primary, #2563eb)" : "var(--metakyc-border, #e5e7eb)"
|
|
3953
3953
|
}
|
|
3954
3954
|
},
|
|
3955
|
-
|
|
3955
|
+
g
|
|
3956
3956
|
)) })
|
|
3957
3957
|
] })
|
|
3958
3958
|
] }),
|
|
@@ -3962,7 +3962,7 @@ const yn = ({
|
|
|
3962
3962
|
question: E,
|
|
3963
3963
|
value: p[E.id] ?? [],
|
|
3964
3964
|
error: P[E.id],
|
|
3965
|
-
onChange: (
|
|
3965
|
+
onChange: (g) => Q(E.id, g)
|
|
3966
3966
|
},
|
|
3967
3967
|
E.id
|
|
3968
3968
|
)) }),
|
|
@@ -4128,19 +4128,19 @@ const gn = ({
|
|
|
4128
4128
|
() => a ? fn(a.uploadDocumentFiles) : [],
|
|
4129
4129
|
[a]
|
|
4130
4130
|
), z = N[v] ?? [], Q = v === N.length - 1, M = N.length, j = ae(() => {
|
|
4131
|
-
const
|
|
4131
|
+
const g = {};
|
|
4132
4132
|
for (const $ of z)
|
|
4133
|
-
$.isRequired && (y[$.id] || []).length === 0 && (
|
|
4134
|
-
return w(
|
|
4133
|
+
$.isRequired && (y[$.id] || []).length === 0 && (g[$.id] = `${$.displayName} is required`);
|
|
4134
|
+
return w(g), Object.keys(g).length === 0;
|
|
4135
4135
|
}, [z, y]), K = () => {
|
|
4136
|
-
j() && (A((
|
|
4136
|
+
j() && (A((g) => g + 1), w({}));
|
|
4137
4137
|
}, ee = () => {
|
|
4138
|
-
v > 0 ? (A((
|
|
4138
|
+
v > 0 ? (A((g) => g - 1), w({})) : n == null || n();
|
|
4139
4139
|
}, E = async () => {
|
|
4140
4140
|
if (!(!j() || !a)) {
|
|
4141
4141
|
P(null);
|
|
4142
4142
|
try {
|
|
4143
|
-
const
|
|
4143
|
+
const g = await Promise.all(
|
|
4144
4144
|
a.uploadDocumentFiles.map(async (V) => {
|
|
4145
4145
|
const G = y[V.id] || [], _ = await Promise.all(
|
|
4146
4146
|
G.map(async (J) => ({
|
|
@@ -4156,11 +4156,11 @@ const gn = ({
|
|
|
4156
4156
|
), $ = {
|
|
4157
4157
|
applicantId: e,
|
|
4158
4158
|
uploadDocumentId: a.id,
|
|
4159
|
-
uploadDocumentResults:
|
|
4159
|
+
uploadDocumentResults: g
|
|
4160
4160
|
};
|
|
4161
4161
|
await d($), t == null || t();
|
|
4162
|
-
} catch (
|
|
4163
|
-
P((
|
|
4162
|
+
} catch (g) {
|
|
4163
|
+
P((g == null ? void 0 : g.message) || "Failed to submit documents. Please try again.");
|
|
4164
4164
|
}
|
|
4165
4165
|
}
|
|
4166
4166
|
};
|
|
@@ -4215,7 +4215,7 @@ const gn = ({
|
|
|
4215
4215
|
" of ",
|
|
4216
4216
|
M
|
|
4217
4217
|
] }),
|
|
4218
|
-
/* @__PURE__ */ r("div", { style: { display: "flex", alignItems: "center", gap: "6px" }, children: N.map((
|
|
4218
|
+
/* @__PURE__ */ r("div", { style: { display: "flex", alignItems: "center", gap: "6px" }, children: N.map((g, $) => /* @__PURE__ */ r(
|
|
4219
4219
|
"div",
|
|
4220
4220
|
{
|
|
4221
4221
|
style: {
|
|
@@ -4266,25 +4266,25 @@ const gn = ({
|
|
|
4266
4266
|
lineHeight: 1.5
|
|
4267
4267
|
}, children: a.description })
|
|
4268
4268
|
] }),
|
|
4269
|
-
/* @__PURE__ */ r(ne, { children: /* @__PURE__ */ r("div", { style: { display: "flex", flexDirection: "column", gap: "24px" }, children: z.map((
|
|
4269
|
+
/* @__PURE__ */ r(ne, { children: /* @__PURE__ */ r("div", { style: { display: "flex", flexDirection: "column", gap: "24px" }, children: z.map((g) => /* @__PURE__ */ r(
|
|
4270
4270
|
rn,
|
|
4271
4271
|
{
|
|
4272
|
-
label:
|
|
4273
|
-
subtitle:
|
|
4274
|
-
accept:
|
|
4275
|
-
multiple:
|
|
4276
|
-
maxSize:
|
|
4277
|
-
required:
|
|
4278
|
-
error: T[
|
|
4279
|
-
value: y[
|
|
4272
|
+
label: g.displayName,
|
|
4273
|
+
subtitle: g.subtitle,
|
|
4274
|
+
accept: g.allowedTypes,
|
|
4275
|
+
multiple: g.multipleFile,
|
|
4276
|
+
maxSize: g.maxEachFileSizeByte,
|
|
4277
|
+
required: g.isRequired,
|
|
4278
|
+
error: T[g.id],
|
|
4279
|
+
value: y[g.id] || [],
|
|
4280
4280
|
onChange: ($) => {
|
|
4281
4281
|
P(null), w((V) => {
|
|
4282
4282
|
const G = { ...V };
|
|
4283
|
-
return delete G[
|
|
4284
|
-
}), p((V) => ({ ...V, [
|
|
4283
|
+
return delete G[g.id], G;
|
|
4284
|
+
}), p((V) => ({ ...V, [g.id]: $ }));
|
|
4285
4285
|
}
|
|
4286
4286
|
},
|
|
4287
|
-
|
|
4287
|
+
g.id
|
|
4288
4288
|
)) }) }),
|
|
4289
4289
|
x && /* @__PURE__ */ s("div", { style: {
|
|
4290
4290
|
margin: "0 24px",
|
|
@@ -4469,7 +4469,7 @@ const Nn = ({
|
|
|
4469
4469
|
J && (G[_.id] = J);
|
|
4470
4470
|
}
|
|
4471
4471
|
return T((_) => ({ ..._, ...G })), Object.keys(G).length === 0;
|
|
4472
|
-
}, [K, P]),
|
|
4472
|
+
}, [K, P]), g = () => {
|
|
4473
4473
|
E() && N((G) => G + 1);
|
|
4474
4474
|
}, $ = () => {
|
|
4475
4475
|
w > 0 ? N((G) => G - 1) : n == null || n();
|
|
@@ -4548,7 +4548,7 @@ const Nn = ({
|
|
|
4548
4548
|
Z,
|
|
4549
4549
|
{
|
|
4550
4550
|
type: "button",
|
|
4551
|
-
onClick:
|
|
4551
|
+
onClick: g,
|
|
4552
4552
|
style: { display: "flex", alignItems: "center", gap: "4px" },
|
|
4553
4553
|
children: [
|
|
4554
4554
|
"Next",
|
|
@@ -4831,7 +4831,7 @@ const En = ({
|
|
|
4831
4831
|
onComplete: t,
|
|
4832
4832
|
onBack: n
|
|
4833
4833
|
}) => {
|
|
4834
|
-
const { appropriatenessTestService: a } = Te(), [i, o] = k(null), [c, d] = k(!0), [y, p] = k(!1), [x, P] = k(null), [v, A] = k({}), [T, w] = k(0), [N, z] = k(!1), [Q, M] = k(!1), [j, K] = k(0), [ee, E] = k(0), [
|
|
4834
|
+
const { appropriatenessTestService: a } = Te(), [i, o] = k(null), [c, d] = k(!0), [y, p] = k(!1), [x, P] = k(null), [v, A] = k({}), [T, w] = k(0), [N, z] = k(!1), [Q, M] = k(!1), [j, K] = k(0), [ee, E] = k(0), [g, $] = k(null);
|
|
4835
4835
|
ge(() => {
|
|
4836
4836
|
(async () => {
|
|
4837
4837
|
try {
|
|
@@ -4952,7 +4952,7 @@ const En = ({
|
|
|
4952
4952
|
}, children: /* @__PURE__ */ r("p", { style: { fontSize: "13px", color: "var(--metakyc-danger, #ef4444)", margin: 0 }, children: x }) })
|
|
4953
4953
|
] }) })
|
|
4954
4954
|
] });
|
|
4955
|
-
if (
|
|
4955
|
+
if (g) {
|
|
4956
4956
|
const B = () => {
|
|
4957
4957
|
$(null), se(), P(null);
|
|
4958
4958
|
};
|
|
@@ -4972,8 +4972,8 @@ const En = ({
|
|
|
4972
4972
|
display: "flex",
|
|
4973
4973
|
alignItems: "center",
|
|
4974
4974
|
justifyContent: "center",
|
|
4975
|
-
backgroundColor:
|
|
4976
|
-
}, children:
|
|
4975
|
+
backgroundColor: g.success ? "color-mix(in srgb, var(--metakyc-success, #10b981) 12%, transparent)" : "color-mix(in srgb, var(--metakyc-danger, #ef4444) 10%, transparent)"
|
|
4976
|
+
}, children: g.success ? /* @__PURE__ */ s("svg", { width: "36", height: "36", viewBox: "0 0 24 24", fill: "none", stroke: "var(--metakyc-success, #10b981)", strokeWidth: "2.5", strokeLinecap: "round", strokeLinejoin: "round", children: [
|
|
4977
4977
|
/* @__PURE__ */ r("path", { d: "M22 11.08V12a10 10 0 1 1-5.93-9.14" }),
|
|
4978
4978
|
/* @__PURE__ */ r("polyline", { points: "22 4 12 14.01 9 11.01" })
|
|
4979
4979
|
] }) : /* @__PURE__ */ s("svg", { width: "36", height: "36", viewBox: "0 0 24 24", fill: "none", stroke: "var(--metakyc-danger, #ef4444)", strokeWidth: "2.5", strokeLinecap: "round", strokeLinejoin: "round", children: [
|
|
@@ -4984,9 +4984,9 @@ const En = ({
|
|
|
4984
4984
|
/* @__PURE__ */ r("h2", { style: {
|
|
4985
4985
|
fontSize: "20px",
|
|
4986
4986
|
fontWeight: 700,
|
|
4987
|
-
color:
|
|
4987
|
+
color: g.success ? "var(--metakyc-success, #10b981)" : "var(--metakyc-danger, #ef4444)",
|
|
4988
4988
|
margin: 0
|
|
4989
|
-
}, children:
|
|
4989
|
+
}, children: g.success ? "Test Passed" : "Test Failed" }),
|
|
4990
4990
|
/* @__PURE__ */ r("p", { style: {
|
|
4991
4991
|
fontSize: "14px",
|
|
4992
4992
|
color: "var(--metakyc-text-secondary, #6b7280)",
|
|
@@ -4994,8 +4994,8 @@ const En = ({
|
|
|
4994
4994
|
lineHeight: 1.6,
|
|
4995
4995
|
maxWidth: "400px",
|
|
4996
4996
|
whiteSpace: "pre-line"
|
|
4997
|
-
}, children:
|
|
4998
|
-
!
|
|
4997
|
+
}, children: g.message }),
|
|
4998
|
+
!g.success && Y > 0 && /* @__PURE__ */ r("div", { style: {
|
|
4999
4999
|
marginTop: "4px",
|
|
5000
5000
|
padding: "10px 20px",
|
|
5001
5001
|
borderRadius: "10px",
|
|
@@ -5012,7 +5012,7 @@ const En = ({
|
|
|
5012
5012
|
Y !== 1 ? "s" : "",
|
|
5013
5013
|
" remaining"
|
|
5014
5014
|
] }) }),
|
|
5015
|
-
!
|
|
5015
|
+
!g.success && Y <= 0 && /* @__PURE__ */ r("div", { style: {
|
|
5016
5016
|
marginTop: "4px",
|
|
5017
5017
|
padding: "10px 20px",
|
|
5018
5018
|
borderRadius: "10px",
|
|
@@ -5024,7 +5024,7 @@ const En = ({
|
|
|
5024
5024
|
margin: 0
|
|
5025
5025
|
}, children: "No attempts remaining. Please contact support for assistance." }) })
|
|
5026
5026
|
] }) }),
|
|
5027
|
-
/* @__PURE__ */ r(Ce, { children: /* @__PURE__ */ r("div", { style: { display: "flex", justifyContent: "center", width: "100%", gap: "12px" }, children:
|
|
5027
|
+
/* @__PURE__ */ r(Ce, { children: /* @__PURE__ */ r("div", { style: { display: "flex", justifyContent: "center", width: "100%", gap: "12px" }, children: g.success ? /* @__PURE__ */ r(Z, { type: "button", onClick: () => t == null ? void 0 : t(), children: "Continue" }) : /* @__PURE__ */ s(lt, { children: [
|
|
5028
5028
|
Y > 0 && j <= 0 && /* @__PURE__ */ r(Z, { type: "button", onClick: B, children: "Retake Test" }),
|
|
5029
5029
|
Y > 0 && j > 0 && /* @__PURE__ */ r(Z, { type: "button", onClick: B, children: "OK" }),
|
|
5030
5030
|
Y <= 0 && n && /* @__PURE__ */ r(Z, { type: "button", variant: "outline", onClick: n, children: "Back" })
|
|
@@ -5413,7 +5413,7 @@ const En = ({
|
|
|
5413
5413
|
onBack: n
|
|
5414
5414
|
}) => {
|
|
5415
5415
|
var Ze, je, it, Ye;
|
|
5416
|
-
const { applicantService: a, baseInformationService: i, identityService: o, config: c, currentTheme: d } = Te(), { identityData: y, provider: p, token: x, isLoading: P, error: v, requestIdentity: A, restartIdentity: T } = Gr(e), [w, N] = k(null), [z, Q] = k(null), [M, j] = k([]), [K, ee] = k([]), [E,
|
|
5416
|
+
const { applicantService: a, baseInformationService: i, identityService: o, config: c, currentTheme: d } = Te(), { identityData: y, provider: p, token: x, isLoading: P, error: v, requestIdentity: A, restartIdentity: T } = Gr(e), [w, N] = k(null), [z, Q] = k(null), [M, j] = k([]), [K, ee] = k([]), [E, g] = k(!0), [$, V] = k(!1), [G, _] = k(null), [J, se] = k(!1), Y = we.useRef(!1), [ve, ue] = k({}), [me, ke] = k({}), F = d != null && d.reviewPageFields && d.reviewPageFields.length > 0 ? d.reviewPageFields[0] : null, U = !!(d != null && d.reviewPageDisabled), B = de(!1);
|
|
5417
5417
|
B.current = U;
|
|
5418
5418
|
const H = Gt({
|
|
5419
5419
|
defaultValues: {
|
|
@@ -5428,7 +5428,7 @@ const En = ({
|
|
|
5428
5428
|
});
|
|
5429
5429
|
ge(() => {
|
|
5430
5430
|
if (U) {
|
|
5431
|
-
Y.current || (Y.current = !0, A().then(() => V(!0)).catch((O) => console.error("[Identity] Auto-request failed:", O)).finally(() =>
|
|
5431
|
+
Y.current || (Y.current = !0, A().then(() => V(!0)).catch((O) => console.error("[Identity] Auto-request failed:", O)).finally(() => g(!1)));
|
|
5432
5432
|
return;
|
|
5433
5433
|
}
|
|
5434
5434
|
(async () => {
|
|
@@ -5486,7 +5486,7 @@ const En = ({
|
|
|
5486
5486
|
} catch (O) {
|
|
5487
5487
|
console.error("Error loading applicant data:", O);
|
|
5488
5488
|
} finally {
|
|
5489
|
-
|
|
5489
|
+
g(!1);
|
|
5490
5490
|
}
|
|
5491
5491
|
})();
|
|
5492
5492
|
}, [e]), ge(() => {
|
|
@@ -5787,7 +5787,10 @@ const En = ({
|
|
|
5787
5787
|
n && /* @__PURE__ */ r(Ce, { children: /* @__PURE__ */ r(Z, { variant: "outline", onClick: n, children: "Back" }) })
|
|
5788
5788
|
] });
|
|
5789
5789
|
}
|
|
5790
|
-
const ye = /* @__PURE__ */ new Set(["country", "nationality", "taxCountry", "countryOfBirth", "mobileCountryCode", "otherNationality"]), oe = (h = 4) =>
|
|
5790
|
+
const ye = /* @__PURE__ */ new Set(["country", "nationality", "taxCountry", "countryOfBirth", "mobileCountryCode", "otherNationality"]), oe = (h = 4) => {
|
|
5791
|
+
const O = Math.min(4, Math.max(1, Number(h) || 4));
|
|
5792
|
+
return { gridColumn: `span ${O} / span ${O}` };
|
|
5793
|
+
}, Ne = (h, O) => {
|
|
5791
5794
|
if (!O && O !== 0) return "—";
|
|
5792
5795
|
if (ye.has(h) && h !== "mobileCountryCode") {
|
|
5793
5796
|
const q = M.find((W) => W.value === O);
|
|
@@ -5894,9 +5897,9 @@ const En = ({
|
|
|
5894
5897
|
] }) : h, _e = (h, O) => {
|
|
5895
5898
|
const q = `cf-${O}`, W = h.paramName ?? "", X = me[W];
|
|
5896
5899
|
if (h.customType === "br")
|
|
5897
|
-
return /* @__PURE__ */ r("div", {
|
|
5900
|
+
return /* @__PURE__ */ r("div", { style: { ...oe(h.colSpan), minHeight: "0.5rem" } }, q);
|
|
5898
5901
|
if (h.customType === "paragraph")
|
|
5899
|
-
return /* @__PURE__ */ r("div", {
|
|
5902
|
+
return /* @__PURE__ */ r("div", { style: oe(h.colSpan), children: /* @__PURE__ */ r(
|
|
5900
5903
|
"div",
|
|
5901
5904
|
{
|
|
5902
5905
|
className: "text-sm",
|
|
@@ -5908,13 +5911,13 @@ const En = ({
|
|
|
5908
5911
|
return /* @__PURE__ */ r(
|
|
5909
5912
|
"div",
|
|
5910
5913
|
{
|
|
5911
|
-
|
|
5914
|
+
style: oe(h.colSpan),
|
|
5912
5915
|
dangerouslySetInnerHTML: { __html: h.label || "" }
|
|
5913
5916
|
},
|
|
5914
5917
|
q
|
|
5915
5918
|
);
|
|
5916
5919
|
if (h.customType === "link")
|
|
5917
|
-
return /* @__PURE__ */ r("div", {
|
|
5920
|
+
return /* @__PURE__ */ r("div", { style: oe(h.colSpan), children: Re(
|
|
5918
5921
|
/* @__PURE__ */ r(
|
|
5919
5922
|
"a",
|
|
5920
5923
|
{
|
|
@@ -5930,7 +5933,7 @@ const En = ({
|
|
|
5930
5933
|
) }, q);
|
|
5931
5934
|
if (h.customType === "checkbox" || h.customType === "link_checkbox") {
|
|
5932
5935
|
const m = X === "true" || X === !0;
|
|
5933
|
-
return /* @__PURE__ */ r("div", {
|
|
5936
|
+
return /* @__PURE__ */ r("div", { style: oe(h.colSpan), children: Re(
|
|
5934
5937
|
/* @__PURE__ */ s("label", { style: { display: "flex", alignItems: "flex-start", gap: 8, cursor: "pointer" }, children: [
|
|
5935
5938
|
/* @__PURE__ */ r(
|
|
5936
5939
|
"input",
|
|
@@ -5962,7 +5965,7 @@ const En = ({
|
|
|
5962
5965
|
[W]: m.includes(L) ? m.filter((l) => l !== L) : [...m, L]
|
|
5963
5966
|
}));
|
|
5964
5967
|
};
|
|
5965
|
-
return /* @__PURE__ */ r("div", {
|
|
5968
|
+
return /* @__PURE__ */ r("div", { style: oe(h.colSpan), children: Re(
|
|
5966
5969
|
/* @__PURE__ */ s("div", { className: "space-y-1.5", children: [
|
|
5967
5970
|
h.label && /* @__PURE__ */ r("p", { className: "text-sm font-medium", style: { color: "var(--metakyc-text-primary, #111827)" }, children: h.displayText || h.label }),
|
|
5968
5971
|
(h.options || []).map((L) => /* @__PURE__ */ s("label", { style: { display: "flex", alignItems: "flex-start", gap: 8, cursor: "pointer" }, children: [
|
|
@@ -5981,7 +5984,7 @@ const En = ({
|
|
|
5981
5984
|
h.helpText
|
|
5982
5985
|
) }, q);
|
|
5983
5986
|
}
|
|
5984
|
-
return h.customType === "radio_group" ? /* @__PURE__ */ r("div", {
|
|
5987
|
+
return h.customType === "radio_group" ? /* @__PURE__ */ r("div", { style: oe(h.colSpan), children: Re(
|
|
5985
5988
|
/* @__PURE__ */ s("div", { className: "space-y-1.5", children: [
|
|
5986
5989
|
h.label && /* @__PURE__ */ r("p", { className: "text-sm font-medium", style: { color: "var(--metakyc-text-primary, #111827)" }, children: h.displayText || h.label }),
|
|
5987
5990
|
(h.options || []).map((m) => /* @__PURE__ */ s("label", { style: { display: "flex", alignItems: "flex-start", gap: 8, cursor: "pointer" }, children: [
|
|
@@ -6000,7 +6003,7 @@ const En = ({
|
|
|
6000
6003
|
] }, m.value))
|
|
6001
6004
|
] }),
|
|
6002
6005
|
h.helpText
|
|
6003
|
-
) }, q) : /* @__PURE__ */ r("div", {
|
|
6006
|
+
) }, q) : /* @__PURE__ */ r("div", { style: oe(h.colSpan), children: Re(
|
|
6004
6007
|
/* @__PURE__ */ r(
|
|
6005
6008
|
xe,
|
|
6006
6009
|
{
|
|
@@ -6014,7 +6017,7 @@ const En = ({
|
|
|
6014
6017
|
}, at = (h, O) => {
|
|
6015
6018
|
if (h.isCustom) return _e(h, O);
|
|
6016
6019
|
const q = h.name ?? "", W = nt[q], X = h.displayText || (W == null ? void 0 : W.label) || q, m = ve[q] ?? "", R = q === "mobileCountryCode", L = !!(W != null && W.countriesType) && !R;
|
|
6017
|
-
return h.editable ? R ? /* @__PURE__ */ r("div", {
|
|
6020
|
+
return h.editable ? R ? /* @__PURE__ */ r("div", { style: oe(h.colSpan ?? 2), children: Re(
|
|
6018
6021
|
/* @__PURE__ */ r(
|
|
6019
6022
|
qe,
|
|
6020
6023
|
{
|
|
@@ -6025,7 +6028,7 @@ const En = ({
|
|
|
6025
6028
|
}
|
|
6026
6029
|
),
|
|
6027
6030
|
h.helpText
|
|
6028
|
-
) }, `epc-${O}`) : L ? /* @__PURE__ */ r("div", {
|
|
6031
|
+
) }, `epc-${O}`) : L ? /* @__PURE__ */ r("div", { style: oe(h.colSpan ?? 2), children: Re(
|
|
6029
6032
|
/* @__PURE__ */ r(
|
|
6030
6033
|
qe,
|
|
6031
6034
|
{
|
|
@@ -6036,7 +6039,7 @@ const En = ({
|
|
|
6036
6039
|
}
|
|
6037
6040
|
),
|
|
6038
6041
|
h.helpText
|
|
6039
|
-
) }, `ec-${O}`) : /* @__PURE__ */ r("div", {
|
|
6042
|
+
) }, `ec-${O}`) : /* @__PURE__ */ r("div", { style: oe(h.colSpan ?? 2), children: Re(
|
|
6040
6043
|
/* @__PURE__ */ r(
|
|
6041
6044
|
xe,
|
|
6042
6045
|
{
|
|
@@ -6047,7 +6050,7 @@ const En = ({
|
|
|
6047
6050
|
}
|
|
6048
6051
|
),
|
|
6049
6052
|
h.helpText
|
|
6050
|
-
) }, `ei-${O}`) : /* @__PURE__ */ r("div", {
|
|
6053
|
+
) }, `ei-${O}`) : /* @__PURE__ */ r("div", { style: oe(h.colSpan ?? 2), children: Re(
|
|
6051
6054
|
/* @__PURE__ */ s(lt, { children: [
|
|
6052
6055
|
/* @__PURE__ */ r("label", { className: "block text-sm font-medium mb-0.5", style: { color: "var(--metakyc-text-secondary, #6b7280)" }, children: X }),
|
|
6053
6056
|
/* @__PURE__ */ r("p", { className: "text-sm", style: { color: "var(--metakyc-text-primary, #111827)", minHeight: "1.5rem" }, children: Ne(q, m) })
|
|
@@ -6064,7 +6067,7 @@ const En = ({
|
|
|
6064
6067
|
/* @__PURE__ */ r("h2", { className: "text-lg font-bold", style: { color: "var(--metakyc-text-primary, #111827)" }, children: h }),
|
|
6065
6068
|
/* @__PURE__ */ r("p", { className: "mt-1 text-sm", style: { color: "var(--metakyc-text-secondary, #6b7280)" }, children: O })
|
|
6066
6069
|
] }),
|
|
6067
|
-
/* @__PURE__ */ r(ne, { children: /* @__PURE__ */ r("div", {
|
|
6070
|
+
/* @__PURE__ */ r(ne, { children: /* @__PURE__ */ r("div", { style: { display: "grid", gridTemplateColumns: "repeat(4, minmax(0, 1fr))", gap: "1rem" }, children: F.fields.map((q, W) => at(q, W)) }) }),
|
|
6068
6071
|
/* @__PURE__ */ s(Ce, { className: "flex justify-between", children: [
|
|
6069
6072
|
n && /* @__PURE__ */ r(Z, { type: "button", variant: "outline", onClick: n, children: "Back" }),
|
|
6070
6073
|
/* @__PURE__ */ r(Z, { type: "submit", isLoading: P, children: "Confirm and Start Verification" })
|
|
@@ -6478,20 +6481,20 @@ const pt = {
|
|
|
6478
6481
|
if (f) for (const D of f) l.add(D);
|
|
6479
6482
|
if (N)
|
|
6480
6483
|
for (const D of N)
|
|
6481
|
-
for (const
|
|
6482
|
-
!
|
|
6484
|
+
for (const b of D.fields)
|
|
6485
|
+
!b.isCustom && b.name && b.required && l.add(b.name);
|
|
6483
6486
|
return Array.from(l);
|
|
6484
6487
|
}, [c == null ? void 0 : c.applicantFormRequiredFields, N]), Q = De(() => {
|
|
6485
6488
|
var D;
|
|
6486
6489
|
if (N) {
|
|
6487
|
-
const
|
|
6490
|
+
const b = N.flatMap((S) => S.fields).filter((S) => !S.isCustom && S.name).map((S) => S.name), C = new Set(b);
|
|
6488
6491
|
for (const S of ft) C.add(S);
|
|
6489
6492
|
return Array.from(C);
|
|
6490
6493
|
}
|
|
6491
6494
|
let l;
|
|
6492
6495
|
(D = i.applicantForm) != null && D.visibleFields ? l = i.applicantForm.visibleFields : c != null && c.applicantFormVisibleFields && c.applicantFormVisibleFields.length > 0 ? l = c.applicantFormVisibleFields : l = cr;
|
|
6493
6496
|
const f = new Set(l);
|
|
6494
|
-
for (const
|
|
6497
|
+
for (const b of ft) f.add(b);
|
|
6495
6498
|
return Array.from(f);
|
|
6496
6499
|
}, [(u = i.applicantForm) == null ? void 0 : u.visibleFields, c == null ? void 0 : c.applicantFormVisibleFields, N]), M = /* @__PURE__ */ new Set([
|
|
6497
6500
|
"country",
|
|
@@ -6504,32 +6507,32 @@ const pt = {
|
|
|
6504
6507
|
var f, D;
|
|
6505
6508
|
const l = /* @__PURE__ */ new Set();
|
|
6506
6509
|
if (N)
|
|
6507
|
-
for (const
|
|
6508
|
-
for (const C of
|
|
6510
|
+
for (const b of N)
|
|
6511
|
+
for (const C of b.fields)
|
|
6509
6512
|
!C.isCustom && C.name && M.has(C.name) && l.add(C.countriesType ?? ((f = nt[C.name]) == null ? void 0 : f.countriesType));
|
|
6510
6513
|
else
|
|
6511
|
-
for (const
|
|
6512
|
-
M.has(
|
|
6514
|
+
for (const b of Q)
|
|
6515
|
+
M.has(b) && l.add((D = nt[b]) == null ? void 0 : D.countriesType);
|
|
6513
6516
|
return l.size === 0 && l.add(void 0), Array.from(l);
|
|
6514
|
-
}, [Q, N]), [K, ee] = k({}), [E,
|
|
6517
|
+
}, [Q, N]), [K, ee] = k({}), [E, g] = k(!0), $ = de(/* @__PURE__ */ new Set()), V = de(/* @__PURE__ */ new Set());
|
|
6515
6518
|
ge(() => {
|
|
6516
6519
|
if (!c) return;
|
|
6517
|
-
const l = j.filter((
|
|
6518
|
-
const C =
|
|
6520
|
+
const l = j.filter((b) => {
|
|
6521
|
+
const C = b != null ? String(b) : "all";
|
|
6519
6522
|
return !V.current.has(C) && !$.current.has(C);
|
|
6520
6523
|
});
|
|
6521
6524
|
if (l.length === 0) {
|
|
6522
6525
|
j.every((C) => {
|
|
6523
6526
|
const S = C != null ? String(C) : "all";
|
|
6524
6527
|
return V.current.has(S);
|
|
6525
|
-
}) &&
|
|
6528
|
+
}) && g(!1);
|
|
6526
6529
|
return;
|
|
6527
6530
|
}
|
|
6528
|
-
|
|
6529
|
-
const f = l.map((
|
|
6530
|
-
f.forEach((
|
|
6531
|
+
g(!0);
|
|
6532
|
+
const f = l.map((b) => b != null ? String(b) : "all");
|
|
6533
|
+
f.forEach((b) => $.current.add(b)), (async () => {
|
|
6531
6534
|
try {
|
|
6532
|
-
const
|
|
6535
|
+
const b = await Promise.all(
|
|
6533
6536
|
l.map(async (C) => {
|
|
6534
6537
|
const S = C != null ? String(C) : "all", pe = await o.getCountries("", i.locale || "en", C), ie = C === 40, be = /* @__PURE__ */ new Set(), Pe = pe.map((le) => ie && le.countryCode ? {
|
|
6535
6538
|
value: le.countryCode,
|
|
@@ -6538,21 +6541,21 @@ const pt = {
|
|
|
6538
6541
|
return V.current.add(S), $.current.delete(S), [S, Pe];
|
|
6539
6542
|
})
|
|
6540
6543
|
);
|
|
6541
|
-
ee((C) => ({ ...C, ...Object.fromEntries(
|
|
6542
|
-
} catch (
|
|
6543
|
-
f.forEach((C) => $.current.delete(C)), console.error("Failed to load countries:",
|
|
6544
|
+
ee((C) => ({ ...C, ...Object.fromEntries(b) }));
|
|
6545
|
+
} catch (b) {
|
|
6546
|
+
f.forEach((C) => $.current.delete(C)), console.error("Failed to load countries:", b);
|
|
6544
6547
|
} finally {
|
|
6545
6548
|
j.every((C) => {
|
|
6546
6549
|
const S = C != null ? String(C) : "all";
|
|
6547
6550
|
return V.current.has(S);
|
|
6548
|
-
}) &&
|
|
6551
|
+
}) && g(!1);
|
|
6549
6552
|
}
|
|
6550
6553
|
})();
|
|
6551
6554
|
}, [j, c]);
|
|
6552
6555
|
const G = (l, f) => {
|
|
6553
6556
|
var C;
|
|
6554
|
-
const D = f ?? ((C = nt[l]) == null ? void 0 : C.countriesType),
|
|
6555
|
-
return K[
|
|
6557
|
+
const D = f ?? ((C = nt[l]) == null ? void 0 : C.countriesType), b = D != null ? String(D) : "all";
|
|
6558
|
+
return K[b] || [];
|
|
6556
6559
|
}, _ = {
|
|
6557
6560
|
firstName: 1,
|
|
6558
6561
|
lastName: 1,
|
|
@@ -6612,17 +6615,17 @@ const pt = {
|
|
|
6612
6615
|
), [me, ke] = k({ ...ue }), [F, U] = k(0), [B, H] = k({}), [fe, I] = k(null), [te, ye] = k(!1), oe = (l, f) => ve((D) => ({ ...D, [l]: f })), Ne = (l, f) => ke((D) => ({ ...D, [l]: f })), $e = (l) => !l.conditionalOn || me[l.conditionalOn] === "true", Re = N && F < N.length - 1 ? F + 1 : -1, _e = N && F > 0 ? F - 1 : -1, at = (l) => {
|
|
6613
6616
|
var D;
|
|
6614
6617
|
const f = {};
|
|
6615
|
-
for (const
|
|
6616
|
-
if (
|
|
6617
|
-
if (
|
|
6618
|
-
if (
|
|
6619
|
-
const C = me[
|
|
6620
|
-
|
|
6618
|
+
for (const b of l.fields)
|
|
6619
|
+
if (b.isCustom) {
|
|
6620
|
+
if (b.customType === "paragraph" || b.customType === "html" || b.customType === "br" || b.customType === "link") continue;
|
|
6621
|
+
if (b.required && b.paramName) {
|
|
6622
|
+
const C = me[b.paramName], S = b.displayText || b.label || b.paramName;
|
|
6623
|
+
b.customType === "checkbox" || b.customType === "link_checkbox" ? C !== "true" && (f[b.paramName] = `${S} is required.`) : (!C || C.trim() === "") && (f[b.paramName] = `${S} is required.`);
|
|
6621
6624
|
}
|
|
6622
|
-
} else if (
|
|
6623
|
-
const C =
|
|
6625
|
+
} else if (b.name) {
|
|
6626
|
+
const C = b.name;
|
|
6624
6627
|
if (z.includes(C) && ot(Y[C])) {
|
|
6625
|
-
const S =
|
|
6628
|
+
const S = b.displayText || ((D = nt[C]) == null ? void 0 : D.label) || C;
|
|
6626
6629
|
f[C] = `${S} is required.`;
|
|
6627
6630
|
}
|
|
6628
6631
|
}
|
|
@@ -6700,8 +6703,8 @@ const pt = {
|
|
|
6700
6703
|
for (const [C, S] of Object.entries(ue))
|
|
6701
6704
|
!D.has(C) && S && f.push({ paramName: C, value: S });
|
|
6702
6705
|
f.length > 0 && (l.applicantAdditionalDatas = f);
|
|
6703
|
-
const
|
|
6704
|
-
n(
|
|
6706
|
+
const b = await d(l);
|
|
6707
|
+
n(b.applicantId);
|
|
6705
6708
|
} catch (l) {
|
|
6706
6709
|
console.error("Error creating applicant:", l), I(l.message || "Failed to create applicant");
|
|
6707
6710
|
} finally {
|
|
@@ -6712,12 +6715,12 @@ const pt = {
|
|
|
6712
6715
|
l.preventDefault();
|
|
6713
6716
|
for (const D of z)
|
|
6714
6717
|
if (ot(Y[D])) {
|
|
6715
|
-
const
|
|
6716
|
-
I(`${
|
|
6718
|
+
const b = ((f = nt[D]) == null ? void 0 : f.label) || D;
|
|
6719
|
+
I(`${b} is required.`);
|
|
6717
6720
|
return;
|
|
6718
6721
|
}
|
|
6719
6722
|
await je();
|
|
6720
|
-
}, Ye = (l, f, D,
|
|
6723
|
+
}, Ye = (l, f, D, b, C) => {
|
|
6721
6724
|
var Nt;
|
|
6722
6725
|
const S = nt[l];
|
|
6723
6726
|
if (!S) return null;
|
|
@@ -6725,7 +6728,7 @@ const pt = {
|
|
|
6725
6728
|
switch (S.type) {
|
|
6726
6729
|
case "select":
|
|
6727
6730
|
if (l === "country" || l === "nationality" || l === "taxCountry" || l === "countryOfBirth" || l === "mobileCountryCode") {
|
|
6728
|
-
const Ie = G(l,
|
|
6731
|
+
const Ie = G(l, b);
|
|
6729
6732
|
return /* @__PURE__ */ r(
|
|
6730
6733
|
qe,
|
|
6731
6734
|
{
|
|
@@ -6779,7 +6782,7 @@ const pt = {
|
|
|
6779
6782
|
return null;
|
|
6780
6783
|
case "multiselect":
|
|
6781
6784
|
if (l === "otherNationality") {
|
|
6782
|
-
const Ie = G(l,
|
|
6785
|
+
const Ie = G(l, b);
|
|
6783
6786
|
return /* @__PURE__ */ r(
|
|
6784
6787
|
en,
|
|
6785
6788
|
{
|
|
@@ -6911,7 +6914,7 @@ const pt = {
|
|
|
6911
6914
|
) }, `custom-${f}`);
|
|
6912
6915
|
}
|
|
6913
6916
|
if (!l.paramName) return null;
|
|
6914
|
-
const
|
|
6917
|
+
const b = B[l.paramName], C = l.displayText || l.label || l.paramName;
|
|
6915
6918
|
if (l.customType === "checkbox")
|
|
6916
6919
|
return /* @__PURE__ */ s("div", { className: "flex flex-col gap-1", children: [
|
|
6917
6920
|
/* @__PURE__ */ s(
|
|
@@ -6944,7 +6947,7 @@ const pt = {
|
|
|
6944
6947
|
]
|
|
6945
6948
|
}
|
|
6946
6949
|
),
|
|
6947
|
-
|
|
6950
|
+
b && /* @__PURE__ */ r("p", { className: "text-red-500 text-xs mt-0.5", children: b })
|
|
6948
6951
|
] }, `custom-${f}`);
|
|
6949
6952
|
if (l.customType === "link_checkbox")
|
|
6950
6953
|
return /* @__PURE__ */ s("div", { className: "flex flex-col gap-1", children: [
|
|
@@ -6991,7 +6994,7 @@ const pt = {
|
|
|
6991
6994
|
]
|
|
6992
6995
|
}
|
|
6993
6996
|
),
|
|
6994
|
-
|
|
6997
|
+
b && /* @__PURE__ */ r("p", { className: "text-red-500 text-xs mt-0.5", children: b })
|
|
6995
6998
|
] }, `custom-${f}`);
|
|
6996
6999
|
if (l.customType === "group_checkbox") {
|
|
6997
7000
|
const S = (me[l.paramName] || "").split(",").filter(Boolean);
|
|
@@ -7045,7 +7048,7 @@ const pt = {
|
|
|
7045
7048
|
pe.value
|
|
7046
7049
|
);
|
|
7047
7050
|
}) }),
|
|
7048
|
-
|
|
7051
|
+
b && /* @__PURE__ */ r("p", { className: "text-red-500 text-xs", children: b })
|
|
7049
7052
|
] }, `custom-${f}`);
|
|
7050
7053
|
}
|
|
7051
7054
|
return l.customType === "radio_group" ? /* @__PURE__ */ s("div", { className: "flex flex-col gap-1.5", children: [
|
|
@@ -7089,7 +7092,7 @@ const pt = {
|
|
|
7089
7092
|
},
|
|
7090
7093
|
S.value
|
|
7091
7094
|
)) }),
|
|
7092
|
-
|
|
7095
|
+
b && /* @__PURE__ */ r("p", { className: "text-red-500 text-xs", children: b })
|
|
7093
7096
|
] }, `custom-${f}`) : /* @__PURE__ */ r(
|
|
7094
7097
|
xe,
|
|
7095
7098
|
{
|
|
@@ -7099,7 +7102,7 @@ const pt = {
|
|
|
7099
7102
|
value: me[l.paramName] || "",
|
|
7100
7103
|
onChange: (S) => Ne(l.paramName, S.target.value),
|
|
7101
7104
|
required: l.required,
|
|
7102
|
-
error:
|
|
7105
|
+
error: b
|
|
7103
7106
|
},
|
|
7104
7107
|
`custom-${f}`
|
|
7105
7108
|
);
|
|
@@ -7117,7 +7120,7 @@ const pt = {
|
|
|
7117
7120
|
{
|
|
7118
7121
|
type: "checkbox",
|
|
7119
7122
|
checked: D,
|
|
7120
|
-
onChange: (
|
|
7123
|
+
onChange: (b) => Ne(l.conditionalOn, b.target.checked ? "true" : "false"),
|
|
7121
7124
|
className: "metakyc-option-input",
|
|
7122
7125
|
style: pt
|
|
7123
7126
|
}
|
|
@@ -7133,9 +7136,9 @@ const pt = {
|
|
|
7133
7136
|
]
|
|
7134
7137
|
}
|
|
7135
7138
|
) }),
|
|
7136
|
-
D && /* @__PURE__ */ r("div", {
|
|
7137
|
-
const S =
|
|
7138
|
-
return /* @__PURE__ */ r("div", {
|
|
7139
|
+
D && /* @__PURE__ */ r("div", { style: { display: "grid", gridTemplateColumns: "repeat(4, minmax(0, 1fr))", gap: "1rem" }, children: l.fields.map((b, C) => {
|
|
7140
|
+
const S = Math.min(4, Math.max(1, Number(b.colSpan) || 4)), pe = b.isCustom ? `custom-${C}-${b.paramName}` : `builtin-${b.name}-${C}`;
|
|
7141
|
+
return /* @__PURE__ */ r("div", { style: { gridColumn: `span ${S} / span ${S}` }, children: /* @__PURE__ */ r(Lt, { helpText: b.helpText, children: b.isCustom ? h(b, C) : Ye(b.name, pe, b.displayText, b.countriesType, b.labelMode) }) }, pe);
|
|
7139
7142
|
}) })
|
|
7140
7143
|
] });
|
|
7141
7144
|
};
|
|
@@ -7145,7 +7148,7 @@ const pt = {
|
|
|
7145
7148
|
/* @__PURE__ */ r("p", { className: "text-center mt-4", style: { color: "var(--metakyc-text-secondary, #6b7280)", fontSize: "0.875rem" }, children: "Loading form…" })
|
|
7146
7149
|
] }) }) });
|
|
7147
7150
|
if (N) {
|
|
7148
|
-
const l = N[F] ?? N[0], f = _e === -1, D = Re === -1,
|
|
7151
|
+
const l = N[F] ?? N[0], f = _e === -1, D = Re === -1, b = N.length, C = $e(l), S = Object.values(B);
|
|
7149
7152
|
return /* @__PURE__ */ r("div", { className: "metakyc-sdk", children: /* @__PURE__ */ s(re, { children: [
|
|
7150
7153
|
/* @__PURE__ */ r(Se, { children: /* @__PURE__ */ r(mt, { title: (c == null ? void 0 : c.title) || "Create Applicant" }) }),
|
|
7151
7154
|
/* @__PURE__ */ s(ne, { children: [
|
|
@@ -7183,7 +7186,7 @@ const pt = {
|
|
|
7183
7186
|
] }),
|
|
7184
7187
|
S.map((pe, ie) => /* @__PURE__ */ r("p", { className: "text-red-600 text-sm", children: pe }, ie))
|
|
7185
7188
|
] }),
|
|
7186
|
-
|
|
7189
|
+
b > 1 && /* @__PURE__ */ s("div", { className: "flex items-center gap-2 mb-4", children: [
|
|
7187
7190
|
N.map((pe, ie) => /* @__PURE__ */ r(
|
|
7188
7191
|
"div",
|
|
7189
7192
|
{
|
|
@@ -7195,7 +7198,7 @@ const pt = {
|
|
|
7195
7198
|
/* @__PURE__ */ s("span", { className: "text-xs text-gray-400 flex-shrink-0", children: [
|
|
7196
7199
|
F + 1,
|
|
7197
7200
|
" / ",
|
|
7198
|
-
|
|
7201
|
+
b
|
|
7199
7202
|
] })
|
|
7200
7203
|
] }),
|
|
7201
7204
|
O(l)
|
|
@@ -7236,7 +7239,7 @@ const pt = {
|
|
|
7236
7239
|
" ",
|
|
7237
7240
|
fe
|
|
7238
7241
|
] }) }),
|
|
7239
|
-
/* @__PURE__ */ r("div", {
|
|
7242
|
+
/* @__PURE__ */ r("div", { style: { display: "grid", gridTemplateColumns: "repeat(4, minmax(0, 1fr))", gap: "1rem" }, children: Q.map((l) => /* @__PURE__ */ r("div", { style: { gridColumn: "span 4 / span 4" }, children: Ye(l) }, l)) })
|
|
7240
7243
|
] }),
|
|
7241
7244
|
/* @__PURE__ */ s(Ce, { className: "flex justify-between", children: [
|
|
7242
7245
|
a && /* @__PURE__ */ r(Z, { type: "button", variant: "outline", onClick: a, disabled: te || y, children: "Cancel" }),
|
|
@@ -7289,12 +7292,12 @@ const Xn = ({
|
|
|
7289
7292
|
for (const u of z)
|
|
7290
7293
|
Q.has(u) && m.add((L = st[u]) == null ? void 0 : L.countriesType);
|
|
7291
7294
|
return m.size === 0 && m.add(void 0), Array.from(m);
|
|
7292
|
-
}, [z, w]), [j, K] = k({}), [ee, E] = k(!0),
|
|
7295
|
+
}, [z, w]), [j, K] = k({}), [ee, E] = k(!0), g = de(/* @__PURE__ */ new Set()), $ = de(/* @__PURE__ */ new Set());
|
|
7293
7296
|
ge(() => {
|
|
7294
7297
|
if (!c) return;
|
|
7295
7298
|
const m = M.filter((u) => {
|
|
7296
7299
|
const l = u != null ? String(u) : "all";
|
|
7297
|
-
return !$.current.has(l) && !
|
|
7300
|
+
return !$.current.has(l) && !g.current.has(l);
|
|
7298
7301
|
});
|
|
7299
7302
|
if (m.length === 0) {
|
|
7300
7303
|
M.every((l) => $.current.has(l != null ? String(l) : "all")) && E(!1);
|
|
@@ -7302,17 +7305,17 @@ const Xn = ({
|
|
|
7302
7305
|
}
|
|
7303
7306
|
E(!0);
|
|
7304
7307
|
const R = m.map((u) => u != null ? String(u) : "all");
|
|
7305
|
-
R.forEach((u) =>
|
|
7308
|
+
R.forEach((u) => g.current.add(u)), (async () => {
|
|
7306
7309
|
try {
|
|
7307
7310
|
const u = await Promise.all(
|
|
7308
7311
|
m.map(async (l) => {
|
|
7309
|
-
const f = l != null ? String(l) : "all", D = await o.getCountries("", i.locale || "en", l),
|
|
7310
|
-
return $.current.add(f),
|
|
7312
|
+
const f = l != null ? String(l) : "all", D = await o.getCountries("", i.locale || "en", l), b = /* @__PURE__ */ new Set(), C = D.map((S) => ({ value: S.abbreviation3 || S.abbreviation, label: S.name })).filter((S) => !S.value || b.has(S.value) ? !1 : (b.add(S.value), !0));
|
|
7313
|
+
return $.current.add(f), g.current.delete(f), [f, C];
|
|
7311
7314
|
})
|
|
7312
7315
|
);
|
|
7313
7316
|
K((l) => ({ ...l, ...Object.fromEntries(u) }));
|
|
7314
7317
|
} catch (u) {
|
|
7315
|
-
R.forEach((l) =>
|
|
7318
|
+
R.forEach((l) => g.current.delete(l)), console.error("Failed to load countries:", u);
|
|
7316
7319
|
} finally {
|
|
7317
7320
|
M.every((l) => $.current.has(l != null ? String(l) : "all")) && E(!1);
|
|
7318
7321
|
}
|
|
@@ -7454,11 +7457,11 @@ const Xn = ({
|
|
|
7454
7457
|
if (ye(f))
|
|
7455
7458
|
for (const D of f.fields) {
|
|
7456
7459
|
if (!D.isCustom || !D.paramName || D.customType === "paragraph" || D.customType === "html" || D.customType === "br" || D.customType === "link") continue;
|
|
7457
|
-
const
|
|
7460
|
+
const b = Y[D.paramName] ?? "";
|
|
7458
7461
|
let C;
|
|
7459
7462
|
if (D.customType === "checkbox" || D.customType === "link_checkbox")
|
|
7460
|
-
C =
|
|
7461
|
-
else if (C =
|
|
7463
|
+
C = b === "true" ? "yes" : "no";
|
|
7464
|
+
else if (C = b, !C && !D.required) continue;
|
|
7462
7465
|
u.push({ paramName: D.paramName, value: C });
|
|
7463
7466
|
}
|
|
7464
7467
|
}
|
|
@@ -7483,7 +7486,7 @@ const Xn = ({
|
|
|
7483
7486
|
}, Ze = (m, R, L, u, l) => {
|
|
7484
7487
|
const f = st[m];
|
|
7485
7488
|
if (!f) return null;
|
|
7486
|
-
const D = N.includes(m),
|
|
7489
|
+
const D = N.includes(m), b = ke[m], C = L || f.label, S = m in _, pe = R ?? m, ie = l ? l !== "placeholder" : T, be = ie ? C : void 0, Pe = ie ? "..." : C;
|
|
7487
7490
|
switch (f.type) {
|
|
7488
7491
|
case "select":
|
|
7489
7492
|
if (m === "countryResidence" || m === "addressCountry") {
|
|
@@ -7498,7 +7501,7 @@ const Xn = ({
|
|
|
7498
7501
|
options: [{ value: "", label: `Select ${Pe.toLowerCase()}` }, ...le],
|
|
7499
7502
|
disabled: ee,
|
|
7500
7503
|
readOnly: S,
|
|
7501
|
-
error:
|
|
7504
|
+
error: b
|
|
7502
7505
|
},
|
|
7503
7506
|
pe
|
|
7504
7507
|
);
|
|
@@ -7515,7 +7518,7 @@ const Xn = ({
|
|
|
7515
7518
|
value: J[m] || "",
|
|
7516
7519
|
onChange: (le) => I(m, le.target.value),
|
|
7517
7520
|
readOnly: S,
|
|
7518
|
-
error:
|
|
7521
|
+
error: b
|
|
7519
7522
|
},
|
|
7520
7523
|
pe
|
|
7521
7524
|
);
|
|
@@ -7530,7 +7533,7 @@ const Xn = ({
|
|
|
7530
7533
|
value: J[m] || "",
|
|
7531
7534
|
onChange: (le) => I(m, le.target.value),
|
|
7532
7535
|
readOnly: S,
|
|
7533
|
-
error:
|
|
7536
|
+
error: b
|
|
7534
7537
|
},
|
|
7535
7538
|
pe
|
|
7536
7539
|
);
|
|
@@ -7545,7 +7548,7 @@ const Xn = ({
|
|
|
7545
7548
|
value: J[m] || "",
|
|
7546
7549
|
onChange: (le) => I(m, le.target.value),
|
|
7547
7550
|
readOnly: S,
|
|
7548
|
-
error:
|
|
7551
|
+
error: b
|
|
7549
7552
|
},
|
|
7550
7553
|
pe
|
|
7551
7554
|
);
|
|
@@ -7560,7 +7563,7 @@ const Xn = ({
|
|
|
7560
7563
|
value: J[m] || "",
|
|
7561
7564
|
onChange: (le) => I(m, le.target.value),
|
|
7562
7565
|
readOnly: S,
|
|
7563
|
-
error:
|
|
7566
|
+
error: b
|
|
7564
7567
|
},
|
|
7565
7568
|
pe
|
|
7566
7569
|
);
|
|
@@ -7637,9 +7640,9 @@ const Xn = ({
|
|
|
7637
7640
|
),
|
|
7638
7641
|
/* @__PURE__ */ r("span", { style: { fontSize: "14px", fontWeight: 500 }, children: m.conditionalOn })
|
|
7639
7642
|
] }),
|
|
7640
|
-
R && /* @__PURE__ */ r("div", {
|
|
7641
|
-
const l =
|
|
7642
|
-
return /* @__PURE__ */ r("div", {
|
|
7643
|
+
R && /* @__PURE__ */ r("div", { style: { display: "grid", gridTemplateColumns: "repeat(4, minmax(0, 1fr))", gap: "1rem" }, children: m.fields.map((L, u) => {
|
|
7644
|
+
const l = Math.min(4, Math.max(1, Number(L.colSpan) || 4)), f = L.isCustom ? `custom-${u}-${L.paramName}` : `builtin-${L.name}-${u}`;
|
|
7645
|
+
return /* @__PURE__ */ r("div", { style: { gridColumn: `span ${l} / span ${l}` }, children: L.isCustom ? je(L, u) : Ze(L.name, f, L.displayText, L.countriesType, L.labelMode) }, f);
|
|
7643
7646
|
}) })
|
|
7644
7647
|
] });
|
|
7645
7648
|
};
|
|
@@ -7663,16 +7666,16 @@ const Xn = ({
|
|
|
7663
7666
|
" ",
|
|
7664
7667
|
U
|
|
7665
7668
|
] }),
|
|
7666
|
-
f.map((D,
|
|
7669
|
+
f.map((D, b) => /* @__PURE__ */ r("p", { className: "text-red-600 text-sm", children: D }, b))
|
|
7667
7670
|
] }),
|
|
7668
7671
|
u > 1 && /* @__PURE__ */ s("div", { className: "flex items-center gap-2 mb-4", children: [
|
|
7669
|
-
w.map((D,
|
|
7672
|
+
w.map((D, b) => /* @__PURE__ */ r(
|
|
7670
7673
|
"div",
|
|
7671
7674
|
{
|
|
7672
|
-
className: `h-1.5 rounded-full transition-all ${
|
|
7673
|
-
style:
|
|
7675
|
+
className: `h-1.5 rounded-full transition-all ${b === ue ? "flex-1" : "w-8"}`,
|
|
7676
|
+
style: b === ue ? { backgroundColor: "var(--metakyc-primary, #2563eb)" } : b < ue ? { backgroundColor: "var(--metakyc-primary-light, #93c5fd)", opacity: 0.7 } : { backgroundColor: "#e5e7eb" }
|
|
7674
7677
|
},
|
|
7675
|
-
|
|
7678
|
+
b
|
|
7676
7679
|
)),
|
|
7677
7680
|
/* @__PURE__ */ s("span", { className: "text-xs text-gray-400 flex-shrink-0", children: [
|
|
7678
7681
|
ue + 1,
|
|
@@ -7710,7 +7713,7 @@ const Xn = ({
|
|
|
7710
7713
|
" ",
|
|
7711
7714
|
U
|
|
7712
7715
|
] }) }),
|
|
7713
|
-
/* @__PURE__ */ r("div", {
|
|
7716
|
+
/* @__PURE__ */ r("div", { style: { display: "grid", gridTemplateColumns: "repeat(4, minmax(0, 1fr))", gap: "1rem" }, children: z.map((m) => /* @__PURE__ */ r("div", { style: { gridColumn: "span 4 / span 4" }, children: Ze(m) }, m)) })
|
|
7714
7717
|
] }),
|
|
7715
7718
|
/* @__PURE__ */ s(Ce, { className: "flex justify-between", children: [
|
|
7716
7719
|
a && /* @__PURE__ */ r(Z, { type: "button", variant: "outline", onClick: a, disabled: H || y, children: "Cancel" }),
|
|
@@ -7826,7 +7829,7 @@ const Xn = ({
|
|
|
7826
7829
|
return "";
|
|
7827
7830
|
}
|
|
7828
7831
|
}, M = () => {
|
|
7829
|
-
const K = d.filter((V) => V.visibility !== !1), ee = K.findIndex((V) => V.order === c.order), E = ee >= 0 ? ee + 1 : 1,
|
|
7832
|
+
const K = d.filter((V) => V.visibility !== !1), ee = K.findIndex((V) => V.order === c.order), E = ee >= 0 ? ee + 1 : 1, g = K.length, $ = g > 1 ? ee / (g - 1) * 100 : 100;
|
|
7830
7833
|
return /* @__PURE__ */ s("div", { style: { marginBottom: "24px" }, children: [
|
|
7831
7834
|
/* @__PURE__ */ s("div", { style: { display: "flex", alignItems: "flex-start", justifyContent: "space-between", marginBottom: "16px" }, children: [
|
|
7832
7835
|
/* @__PURE__ */ r(mt, {}),
|
|
@@ -7834,7 +7837,7 @@ const Xn = ({
|
|
|
7834
7837
|
"Step ",
|
|
7835
7838
|
E,
|
|
7836
7839
|
" of ",
|
|
7837
|
-
|
|
7840
|
+
g
|
|
7838
7841
|
] })
|
|
7839
7842
|
] }),
|
|
7840
7843
|
/* @__PURE__ */ r("div", { style: { marginBottom: "16px" }, children: /* @__PURE__ */ r("div", { style: {
|