@vpdev2/metakyc-sdk 1.0.9 → 1.0.11
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/steps/OverviewStep.d.ts.map +1 -1
- package/dist/index.cjs +4 -4
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +90 -89
- package/dist/index.js.map +1 -1
- package/dist/styles.css +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -1777,7 +1777,7 @@ class Ut {
|
|
|
1777
1777
|
}
|
|
1778
1778
|
const Ue = tt(null), Or = ({ config: t, children: e }) => {
|
|
1779
1779
|
const [r, s] = N(null), a = ie.useRef(!1), i = ie.useRef(!1), l = Re(() => {
|
|
1780
|
-
const d = new vt(t), u = new xt(d), y = new wt(d), x = new kt(d), g = new Nt(d), b = new St(d), m = new Ct(d), f = new At(d), k = new Et(d), h = new It(d),
|
|
1780
|
+
const d = new vt(t), u = new xt(d), y = new wt(d), x = new kt(d), g = new Nt(d), b = new St(d), m = new Ct(d), f = new At(d), k = new Et(d), h = new It(d), E = new Mt(d), v = new Ut();
|
|
1781
1781
|
return {
|
|
1782
1782
|
httpClient: d,
|
|
1783
1783
|
applicantService: u,
|
|
@@ -1789,7 +1789,7 @@ const Ue = tt(null), Or = ({ config: t, children: e }) => {
|
|
|
1789
1789
|
identityService: f,
|
|
1790
1790
|
baseInformationService: k,
|
|
1791
1791
|
investorCategorizationService: h,
|
|
1792
|
-
themeService:
|
|
1792
|
+
themeService: E,
|
|
1793
1793
|
themeManager: v
|
|
1794
1794
|
};
|
|
1795
1795
|
}, [t]), c = Re(() => ({
|
|
@@ -2007,7 +2007,7 @@ function Gt(t) {
|
|
|
2007
2007
|
i(!1);
|
|
2008
2008
|
}
|
|
2009
2009
|
}
|
|
2010
|
-
}, []), h = Me.useMemo(() => r != null && r.stepInfoList ? [...r.stepInfoList].sort((v, S) => v.order - S.order) : [], [r == null ? void 0 : r.stepInfoList]),
|
|
2010
|
+
}, []), h = Me.useMemo(() => r != null && r.stepInfoList ? [...r.stepInfoList].sort((v, S) => v.order - S.order) : [], [r == null ? void 0 : r.stepInfoList]), E = Me.useMemo(() => r ? r.nextWorkflowKey && r.nextWorkflowKey !== r.workFlowKey : !1, [r]);
|
|
2011
2011
|
return {
|
|
2012
2012
|
progress: r,
|
|
2013
2013
|
applicantId: u,
|
|
@@ -2017,7 +2017,7 @@ function Gt(t) {
|
|
|
2017
2017
|
workflowResult: (r == null ? void 0 : r.workflowResult) || null,
|
|
2018
2018
|
workflowKey: r == null ? void 0 : r.workFlowKey,
|
|
2019
2019
|
nextWorkflowKey: r == null ? void 0 : r.nextWorkflowKey,
|
|
2020
|
-
hasWorkflowChanged:
|
|
2020
|
+
hasWorkflowChanged: E,
|
|
2021
2021
|
isLoading: a,
|
|
2022
2022
|
error: l,
|
|
2023
2023
|
isComplete: (r == null ? void 0 : r.status) === le.Finished,
|
|
@@ -2638,13 +2638,13 @@ const nr = ({
|
|
|
2638
2638
|
}) => {
|
|
2639
2639
|
const [d, u] = N(!1), y = H(null), x = (h) => {
|
|
2640
2640
|
if (!h) return;
|
|
2641
|
-
const
|
|
2642
|
-
if (a &&
|
|
2641
|
+
const E = Array.from(h);
|
|
2642
|
+
if (a && E.filter((S) => S.size > a).length > 0) {
|
|
2643
2643
|
const S = Ie(a);
|
|
2644
2644
|
alert(`Some files exceed the maximum size of ${S}`);
|
|
2645
2645
|
return;
|
|
2646
2646
|
}
|
|
2647
|
-
i == null || i(s ? [...l, ...
|
|
2647
|
+
i == null || i(s ? [...l, ...E] : [E[0]]);
|
|
2648
2648
|
}, g = (h) => {
|
|
2649
2649
|
h.preventDefault(), u(!0);
|
|
2650
2650
|
}, b = () => {
|
|
@@ -2655,8 +2655,8 @@ const nr = ({
|
|
|
2655
2655
|
var h;
|
|
2656
2656
|
(h = y.current) == null || h.click();
|
|
2657
2657
|
}, k = (h) => {
|
|
2658
|
-
const
|
|
2659
|
-
i == null || i(
|
|
2658
|
+
const E = l.filter((v, S) => S !== h);
|
|
2659
|
+
i == null || i(E);
|
|
2660
2660
|
};
|
|
2661
2661
|
return /* @__PURE__ */ o("div", { className: te("w-full", c), children: [
|
|
2662
2662
|
t && /* @__PURE__ */ n("label", { className: "block text-sm font-medium text-gray-700 dark:text-gray-300 mb-1", children: t }),
|
|
@@ -2715,7 +2715,7 @@ const nr = ({
|
|
|
2715
2715
|
]
|
|
2716
2716
|
}
|
|
2717
2717
|
),
|
|
2718
|
-
l.length > 0 && /* @__PURE__ */ n("div", { className: "mt-3 space-y-2", children: l.map((h,
|
|
2718
|
+
l.length > 0 && /* @__PURE__ */ n("div", { className: "mt-3 space-y-2", children: l.map((h, E) => /* @__PURE__ */ o(
|
|
2719
2719
|
"div",
|
|
2720
2720
|
{
|
|
2721
2721
|
className: "flex items-center justify-between px-3 py-2 bg-gray-50 dark:bg-gray-700 rounded-lg",
|
|
@@ -2749,7 +2749,7 @@ const nr = ({
|
|
|
2749
2749
|
{
|
|
2750
2750
|
type: "button",
|
|
2751
2751
|
onClick: (v) => {
|
|
2752
|
-
v.stopPropagation(), k(
|
|
2752
|
+
v.stopPropagation(), k(E);
|
|
2753
2753
|
},
|
|
2754
2754
|
className: "ml-2 text-danger-500 hover:text-danger-700 focus:outline-none",
|
|
2755
2755
|
children: /* @__PURE__ */ n("svg", { className: "h-5 w-5", fill: "currentColor", viewBox: "0 0 20 20", children: /* @__PURE__ */ n(
|
|
@@ -2764,7 +2764,7 @@ const nr = ({
|
|
|
2764
2764
|
)
|
|
2765
2765
|
]
|
|
2766
2766
|
},
|
|
2767
|
-
|
|
2767
|
+
E
|
|
2768
2768
|
)) }),
|
|
2769
2769
|
e && /* @__PURE__ */ n("p", { className: "mt-1 text-sm text-danger-500", children: e })
|
|
2770
2770
|
] });
|
|
@@ -3077,11 +3077,11 @@ const Vr = ue.any(), xr = ({
|
|
|
3077
3077
|
try {
|
|
3078
3078
|
console.log("Form submitted with data:", m);
|
|
3079
3079
|
const f = s.questionGroups.flatMap(
|
|
3080
|
-
(h,
|
|
3080
|
+
(h, E) => h.questions.map((v, S) => {
|
|
3081
3081
|
var I, P, C;
|
|
3082
3082
|
return {
|
|
3083
3083
|
questionId: v.id,
|
|
3084
|
-
values: ((C = (P = (I = m.questionResults) == null ? void 0 : I[
|
|
3084
|
+
values: ((C = (P = (I = m.questionResults) == null ? void 0 : I[E]) == null ? void 0 : P[S]) == null ? void 0 : C.values) || []
|
|
3085
3085
|
};
|
|
3086
3086
|
})
|
|
3087
3087
|
);
|
|
@@ -3118,7 +3118,7 @@ const Vr = ue.any(), xr = ({
|
|
|
3118
3118
|
control: y,
|
|
3119
3119
|
name: `questionResults.${f}.${h}.values.0`,
|
|
3120
3120
|
render: ({ field: S }) => {
|
|
3121
|
-
var I, P, C,
|
|
3121
|
+
var I, P, C, A;
|
|
3122
3122
|
return /* @__PURE__ */ n(
|
|
3123
3123
|
X,
|
|
3124
3124
|
{
|
|
@@ -3127,7 +3127,7 @@ const Vr = ue.any(), xr = ({
|
|
|
3127
3127
|
onBlur: S.onBlur,
|
|
3128
3128
|
name: S.name,
|
|
3129
3129
|
placeholder: "Enter your answer...",
|
|
3130
|
-
error: (
|
|
3130
|
+
error: (A = (C = (P = (I = g.questionResults) == null ? void 0 : I[f]) == null ? void 0 : P[h]) == null ? void 0 : C.values) == null ? void 0 : A.message
|
|
3131
3131
|
}
|
|
3132
3132
|
);
|
|
3133
3133
|
}
|
|
@@ -3139,7 +3139,7 @@ const Vr = ue.any(), xr = ({
|
|
|
3139
3139
|
control: y,
|
|
3140
3140
|
name: `questionResults.${f}.${h}.values.0`,
|
|
3141
3141
|
render: ({ field: S }) => {
|
|
3142
|
-
var I, P, C,
|
|
3142
|
+
var I, P, C, A;
|
|
3143
3143
|
return /* @__PURE__ */ n(
|
|
3144
3144
|
ye,
|
|
3145
3145
|
{
|
|
@@ -3152,7 +3152,7 @@ const Vr = ue.any(), xr = ({
|
|
|
3152
3152
|
label: M
|
|
3153
3153
|
})),
|
|
3154
3154
|
placeholder: "Select an option...",
|
|
3155
|
-
error: (
|
|
3155
|
+
error: (A = (C = (P = (I = g.questionResults) == null ? void 0 : I[f]) == null ? void 0 : P[h]) == null ? void 0 : C.values) == null ? void 0 : A.message
|
|
3156
3156
|
}
|
|
3157
3157
|
);
|
|
3158
3158
|
}
|
|
@@ -3175,8 +3175,8 @@ const Vr = ue.any(), xr = ({
|
|
|
3175
3175
|
{
|
|
3176
3176
|
type: "checkbox",
|
|
3177
3177
|
checked: Array.isArray(S) && S.includes(P),
|
|
3178
|
-
onChange: (
|
|
3179
|
-
const M = Array.isArray(S) ? S : [], B =
|
|
3178
|
+
onChange: (A) => {
|
|
3179
|
+
const M = Array.isArray(S) ? S : [], B = A.target.checked ? [...M, P] : M.filter((Q) => Q !== P);
|
|
3180
3180
|
I(B);
|
|
3181
3181
|
},
|
|
3182
3182
|
className: "h-4 w-4 text-primary-500 rounded border-gray-300 focus:ring-primary-500"
|
|
@@ -3279,17 +3279,18 @@ const Vr = ue.any(), xr = ({
|
|
|
3279
3279
|
s.description && /* @__PURE__ */ n("p", { className: "text-gray-600 dark:text-gray-400 mt-1", children: s.description })
|
|
3280
3280
|
] }),
|
|
3281
3281
|
/* @__PURE__ */ o(T, { className: "space-y-6", children: [
|
|
3282
|
-
s.steps && s.steps.length > 0 ? /* @__PURE__ */ n("div", { className: "space-y-
|
|
3282
|
+
s.steps && s.steps.length > 0 ? /* @__PURE__ */ n("div", { className: "metakyc-overview-steps space-y-3", children: s.steps.sort((u, y) => u.order - y.order).map((u) => /* @__PURE__ */ o(
|
|
3283
3283
|
"div",
|
|
3284
3284
|
{
|
|
3285
|
-
className: "
|
|
3286
|
-
|
|
3287
|
-
|
|
3288
|
-
/* @__PURE__ */
|
|
3289
|
-
|
|
3290
|
-
|
|
3285
|
+
className: "metakyc-overview-step-item flex items-start p-4 rounded-lg bg-gray-50 dark:bg-gray-800",
|
|
3286
|
+
style: { border: "none" },
|
|
3287
|
+
children: [
|
|
3288
|
+
/* @__PURE__ */ n("div", { className: "metakyc-step-icon flex-shrink-0", children: /* @__PURE__ */ n("div", { className: "w-8 h-8 rounded-full bg-green-500 text-white flex items-center justify-center font-medium text-sm", children: "✓" }) }),
|
|
3289
|
+
/* @__PURE__ */ o("div", { className: "metakyc-step-content ml-4 flex-1", style: { borderTop: "none", borderBottom: "none" }, children: [
|
|
3290
|
+
/* @__PURE__ */ n("h3", { className: "metakyc-step-title text-lg font-semibold text-gray-900 dark:text-white", style: { borderTop: "none" }, children: u.title }),
|
|
3291
|
+
u.description && /* @__PURE__ */ n("p", { className: "metakyc-step-description text-sm text-gray-600 dark:text-gray-400 mt-1", children: u.description })
|
|
3291
3292
|
] })
|
|
3292
|
-
]
|
|
3293
|
+
]
|
|
3293
3294
|
},
|
|
3294
3295
|
u.order
|
|
3295
3296
|
)) }) : /* @__PURE__ */ n("div", { className: "text-center py-8", children: /* @__PURE__ */ n("p", { className: "text-gray-600 dark:text-gray-400", children: "Loading overview data..." }) }),
|
|
@@ -3329,21 +3330,21 @@ const Vr = ue.any(), xr = ({
|
|
|
3329
3330
|
if (s)
|
|
3330
3331
|
try {
|
|
3331
3332
|
console.log("Risk scoring form submitted:", h), console.log("Criteria metadata:", s);
|
|
3332
|
-
const
|
|
3333
|
-
const P = S.values || [], C = Array.isArray(P) ? P.filter((
|
|
3333
|
+
const E = h.criteriaValueInputs.map((S, I) => {
|
|
3334
|
+
const P = S.values || [], C = Array.isArray(P) ? P.filter((A) => A && A.trim()) : P && P.toString().trim() ? [P.toString()] : [];
|
|
3334
3335
|
return C.length === 0 ? null : {
|
|
3335
3336
|
riskCriteriaId: s[I].id,
|
|
3336
3337
|
values: C
|
|
3337
3338
|
};
|
|
3338
3339
|
}).filter((S) => S !== null);
|
|
3339
|
-
console.log("Risk scoring criteriaValueInputs to submit:",
|
|
3340
|
+
console.log("Risk scoring criteriaValueInputs to submit:", E);
|
|
3340
3341
|
const v = {
|
|
3341
3342
|
applicantId: t,
|
|
3342
|
-
criteriaValueInputs:
|
|
3343
|
+
criteriaValueInputs: E
|
|
3343
3344
|
};
|
|
3344
3345
|
console.log("Final risk scoring input:", v), await c(v), console.log("Risk scoring submitted successfully!"), e == null || e();
|
|
3345
|
-
} catch (
|
|
3346
|
-
throw console.error("Error submitting risk scoring:",
|
|
3346
|
+
} catch (E) {
|
|
3347
|
+
throw console.error("Error submitting risk scoring:", E), E;
|
|
3347
3348
|
}
|
|
3348
3349
|
}, k = (h) => h.builtInType === 1 ? "country" : !h.defaultValues || h.defaultValues.length === 0 ? "text" : h.multipleValue ? "checkbox" : "radio";
|
|
3349
3350
|
return a ? /* @__PURE__ */ n(L, { children: /* @__PURE__ */ o(T, { children: [
|
|
@@ -3360,7 +3361,7 @@ const Vr = ue.any(), xr = ({
|
|
|
3360
3361
|
/* @__PURE__ */ n("h2", { className: "text-2xl font-bold", children: "Risk Assessment" }),
|
|
3361
3362
|
/* @__PURE__ */ n("p", { className: "text-gray-600 dark:text-gray-400 mt-1", children: "Please answer the following questions for risk evaluation" })
|
|
3362
3363
|
] }),
|
|
3363
|
-
/* @__PURE__ */ n(T, { className: "space-y-8", children: s.map((h,
|
|
3364
|
+
/* @__PURE__ */ n(T, { className: "space-y-8", children: s.map((h, E) => {
|
|
3364
3365
|
var S, I, P;
|
|
3365
3366
|
const v = k(h);
|
|
3366
3367
|
return /* @__PURE__ */ o("div", { className: "space-y-2", children: [
|
|
@@ -3373,9 +3374,9 @@ const Vr = ue.any(), xr = ({
|
|
|
3373
3374
|
J,
|
|
3374
3375
|
{
|
|
3375
3376
|
control: g,
|
|
3376
|
-
name: `criteriaValueInputs.${
|
|
3377
|
+
name: `criteriaValueInputs.${E}.values.0`,
|
|
3377
3378
|
render: ({ field: C }) => {
|
|
3378
|
-
var
|
|
3379
|
+
var A, M, B;
|
|
3379
3380
|
return /* @__PURE__ */ n(
|
|
3380
3381
|
X,
|
|
3381
3382
|
{
|
|
@@ -3383,7 +3384,7 @@ const Vr = ue.any(), xr = ({
|
|
|
3383
3384
|
value: C.value || "",
|
|
3384
3385
|
type: h.valueDataType === Pe.DigitOnly ? "number" : "text",
|
|
3385
3386
|
placeholder: "Enter your answer...",
|
|
3386
|
-
error: (B = (M = (
|
|
3387
|
+
error: (B = (M = (A = m.criteriaValueInputs) == null ? void 0 : A[E]) == null ? void 0 : M.values) == null ? void 0 : B.message,
|
|
3387
3388
|
onKeyDown: (Q) => {
|
|
3388
3389
|
h.valueDataType === Pe.DigitOnly && ["e", "E", "+", "-", "."].includes(Q.key) && Q.preventDefault();
|
|
3389
3390
|
}
|
|
@@ -3398,19 +3399,19 @@ const Vr = ue.any(), xr = ({
|
|
|
3398
3399
|
J,
|
|
3399
3400
|
{
|
|
3400
3401
|
control: g,
|
|
3401
|
-
name: `criteriaValueInputs.${
|
|
3402
|
-
render: ({ field: { value: C, onChange:
|
|
3402
|
+
name: `criteriaValueInputs.${E}.values.0`,
|
|
3403
|
+
render: ({ field: { value: C, onChange: A } }) => /* @__PURE__ */ n("div", { className: "space-y-2", children: h.defaultValues.map((M, B) => /* @__PURE__ */ o("label", { className: "flex items-center space-x-2 cursor-pointer", children: [
|
|
3403
3404
|
/* @__PURE__ */ n(
|
|
3404
3405
|
"input",
|
|
3405
3406
|
{
|
|
3406
3407
|
type: "radio",
|
|
3407
3408
|
checked: C === M,
|
|
3408
|
-
onChange: () =>
|
|
3409
|
+
onChange: () => A(M),
|
|
3409
3410
|
className: "h-4 w-4 text-primary-500 border-gray-300 focus:ring-primary-500"
|
|
3410
3411
|
}
|
|
3411
3412
|
),
|
|
3412
3413
|
/* @__PURE__ */ n("span", { className: "text-sm", children: M })
|
|
3413
|
-
] }, `${
|
|
3414
|
+
] }, `${E}-${B}`)) })
|
|
3414
3415
|
}
|
|
3415
3416
|
)
|
|
3416
3417
|
] }),
|
|
@@ -3420,8 +3421,8 @@ const Vr = ue.any(), xr = ({
|
|
|
3420
3421
|
J,
|
|
3421
3422
|
{
|
|
3422
3423
|
control: g,
|
|
3423
|
-
name: `criteriaValueInputs.${
|
|
3424
|
-
render: ({ field: { value: C = [], onChange:
|
|
3424
|
+
name: `criteriaValueInputs.${E}.values`,
|
|
3425
|
+
render: ({ field: { value: C = [], onChange: A } }) => /* @__PURE__ */ n("div", { className: "space-y-2", children: h.defaultValues.map((M, B) => /* @__PURE__ */ o("label", { className: "flex items-center space-x-2 cursor-pointer", children: [
|
|
3425
3426
|
/* @__PURE__ */ n(
|
|
3426
3427
|
"input",
|
|
3427
3428
|
{
|
|
@@ -3429,13 +3430,13 @@ const Vr = ue.any(), xr = ({
|
|
|
3429
3430
|
checked: Array.isArray(C) && C.includes(M),
|
|
3430
3431
|
onChange: (Q) => {
|
|
3431
3432
|
const _ = Array.isArray(C) ? C : [], p = Q.target.checked ? [..._, M] : _.filter((w) => w !== M);
|
|
3432
|
-
|
|
3433
|
+
A(p);
|
|
3433
3434
|
},
|
|
3434
3435
|
className: "h-4 w-4 text-primary-500 rounded border-gray-300 focus:ring-primary-500"
|
|
3435
3436
|
}
|
|
3436
3437
|
),
|
|
3437
3438
|
/* @__PURE__ */ n("span", { className: "text-sm", children: M })
|
|
3438
|
-
] }, `${
|
|
3439
|
+
] }, `${E}-${B}`)) })
|
|
3439
3440
|
}
|
|
3440
3441
|
)
|
|
3441
3442
|
] }),
|
|
@@ -3443,9 +3444,9 @@ const Vr = ue.any(), xr = ({
|
|
|
3443
3444
|
J,
|
|
3444
3445
|
{
|
|
3445
3446
|
control: g,
|
|
3446
|
-
name: `criteriaValueInputs.${
|
|
3447
|
+
name: `criteriaValueInputs.${E}.values.0`,
|
|
3447
3448
|
render: ({ field: C }) => {
|
|
3448
|
-
var
|
|
3449
|
+
var A, M, B;
|
|
3449
3450
|
return /* @__PURE__ */ n(
|
|
3450
3451
|
ye,
|
|
3451
3452
|
{
|
|
@@ -3457,13 +3458,13 @@ const Vr = ue.any(), xr = ({
|
|
|
3457
3458
|
// TODO: Load from base information service
|
|
3458
3459
|
],
|
|
3459
3460
|
placeholder: "Select a country...",
|
|
3460
|
-
error: (B = (M = (
|
|
3461
|
+
error: (B = (M = (A = m.criteriaValueInputs) == null ? void 0 : A[E]) == null ? void 0 : M.values) == null ? void 0 : B.message
|
|
3461
3462
|
}
|
|
3462
3463
|
);
|
|
3463
3464
|
}
|
|
3464
3465
|
}
|
|
3465
3466
|
),
|
|
3466
|
-
((P = (I = (S = m.criteriaValueInputs) == null ? void 0 : S[
|
|
3467
|
+
((P = (I = (S = m.criteriaValueInputs) == null ? void 0 : S[E]) == null ? void 0 : I.values) == null ? void 0 : P.message) && /* @__PURE__ */ n("p", { className: "text-sm text-danger-500 mt-1", children: m.criteriaValueInputs[E].values.message })
|
|
3467
3468
|
] }, h.id);
|
|
3468
3469
|
}) }),
|
|
3469
3470
|
/* @__PURE__ */ o(ne, { className: "flex justify-between", children: [
|
|
@@ -3628,7 +3629,7 @@ const Vr = ue.any(), xr = ({
|
|
|
3628
3629
|
onComplete: e,
|
|
3629
3630
|
onBack: r
|
|
3630
3631
|
}) => {
|
|
3631
|
-
const { appropriatenessTestService: s } = se(), [a, i] = N(null), [l, c] = N(!0), [d, u] = N(!1), [y, x] = N(null), [g, b] = N({}), [m, f] = N(0), [k, h] = N(!1), [
|
|
3632
|
+
const { appropriatenessTestService: s } = se(), [a, i] = N(null), [l, c] = N(!0), [d, u] = N(!1), [y, x] = N(null), [g, b] = N({}), [m, f] = N(0), [k, h] = N(!1), [E, v] = N(!1), [S, I] = N(0);
|
|
3632
3633
|
Y(() => {
|
|
3633
3634
|
(async () => {
|
|
3634
3635
|
try {
|
|
@@ -3669,9 +3670,9 @@ const Vr = ue.any(), xr = ({
|
|
|
3669
3670
|
}, 1e3);
|
|
3670
3671
|
return () => clearInterval(p);
|
|
3671
3672
|
}, [S]), Y(() => {
|
|
3672
|
-
|
|
3673
|
-
}, [
|
|
3674
|
-
const
|
|
3673
|
+
E && !d && B();
|
|
3674
|
+
}, [E]);
|
|
3675
|
+
const A = () => {
|
|
3675
3676
|
a && (h(!0), f(a.testDurationSec));
|
|
3676
3677
|
}, M = (p, w) => {
|
|
3677
3678
|
b((O) => ({
|
|
@@ -3680,7 +3681,7 @@ const Vr = ue.any(), xr = ({
|
|
|
3680
3681
|
}));
|
|
3681
3682
|
}, B = async (p) => {
|
|
3682
3683
|
if (p && p.preventDefault(), !!a) {
|
|
3683
|
-
if (!
|
|
3684
|
+
if (!E) {
|
|
3684
3685
|
const w = a.appropriatenessQuestions.length - Object.keys(g).length;
|
|
3685
3686
|
if (w > 0) {
|
|
3686
3687
|
x(`Please answer all questions. ${w} question(s) remaining.`);
|
|
@@ -3829,12 +3830,12 @@ Failed to reload test data. Please refresh the page.`);
|
|
|
3829
3830
|
},
|
|
3830
3831
|
p.id
|
|
3831
3832
|
)),
|
|
3832
|
-
y && !
|
|
3833
|
+
y && !E && /* @__PURE__ */ n("div", { className: "p-4 bg-red-50 dark:bg-red-900/20 border border-red-200 dark:border-red-800 rounded-lg", children: /* @__PURE__ */ o("p", { className: "text-red-600 dark:text-red-400 text-sm", children: [
|
|
3833
3834
|
/* @__PURE__ */ n("strong", { children: "Error:" }),
|
|
3834
3835
|
" ",
|
|
3835
3836
|
y
|
|
3836
3837
|
] }) }),
|
|
3837
|
-
|
|
3838
|
+
E && /* @__PURE__ */ n("div", { className: "p-4 bg-yellow-50 dark:bg-yellow-900/20 border border-yellow-200 dark:border-yellow-800 rounded-lg", children: /* @__PURE__ */ o("p", { className: "text-yellow-700 dark:text-yellow-400 text-sm", children: [
|
|
3838
3839
|
/* @__PURE__ */ n("strong", { children: "Time's up!" }),
|
|
3839
3840
|
" Your answers are being submitted automatically."
|
|
3840
3841
|
] }) })
|
|
@@ -3856,7 +3857,7 @@ Failed to reload test data. Please refresh the page.`);
|
|
|
3856
3857
|
type: "submit",
|
|
3857
3858
|
isLoading: d,
|
|
3858
3859
|
disabled: Object.keys(g).length < a.totalQuestionCount,
|
|
3859
|
-
children:
|
|
3860
|
+
children: E ? "Submitting..." : "Submit Test"
|
|
3860
3861
|
}
|
|
3861
3862
|
)
|
|
3862
3863
|
] })
|
|
@@ -3898,7 +3899,7 @@ Failed to reload test data. Please refresh the page.`);
|
|
|
3898
3899
|
j,
|
|
3899
3900
|
{
|
|
3900
3901
|
type: "button",
|
|
3901
|
-
onClick:
|
|
3902
|
+
onClick: A,
|
|
3902
3903
|
disabled: _ <= 0,
|
|
3903
3904
|
children: "Start Test"
|
|
3904
3905
|
}
|
|
@@ -3911,7 +3912,7 @@ Failed to reload test data. Please refresh the page.`);
|
|
|
3911
3912
|
onBack: r
|
|
3912
3913
|
}) => {
|
|
3913
3914
|
var O, z, R, we;
|
|
3914
|
-
const { applicantService: s, baseInformationService: a, config: i } = se(), { identityData: l, provider: c, token: d, isLoading: u, error: y, requestIdentity: x, restartIdentity: g } = er(t), [b, m] = N(null), [f, k] = N(null), [h,
|
|
3915
|
+
const { applicantService: s, baseInformationService: a, config: i } = se(), { identityData: l, provider: c, token: d, isLoading: u, error: y, requestIdentity: x, restartIdentity: g } = er(t), [b, m] = N(null), [f, k] = N(null), [h, E] = N([]), [v, S] = N(!0), [I, P] = N(!1), [C, A] = N(null), [M, B] = N(!1), Q = ie.useRef(!1), _ = Te({
|
|
3915
3916
|
defaultValues: {
|
|
3916
3917
|
street: "",
|
|
3917
3918
|
streetNumber: "",
|
|
@@ -3934,7 +3935,7 @@ Failed to reload test data. Please refresh the page.`);
|
|
|
3934
3935
|
const Ae = me.abbreviation3 || me.abbreviation;
|
|
3935
3936
|
return !Ae || V.has(Ae) ? !1 : (V.add(Ae), !0);
|
|
3936
3937
|
});
|
|
3937
|
-
|
|
3938
|
+
E(ae);
|
|
3938
3939
|
const $ = D.applicantRequestData;
|
|
3939
3940
|
if (_.reset({
|
|
3940
3941
|
street: ($ == null ? void 0 : $.street) || "",
|
|
@@ -3965,7 +3966,7 @@ Failed to reload test data. Please refresh the page.`);
|
|
|
3965
3966
|
if (d.expiresAt) {
|
|
3966
3967
|
const F = new Date(d.expiresAt).getTime();
|
|
3967
3968
|
if (Date.now() >= F) {
|
|
3968
|
-
console.warn("[Identity] Token has expired (expiresAt)"), B(!0),
|
|
3969
|
+
console.warn("[Identity] Token has expired (expiresAt)"), B(!0), A("Your verification session has expired. Please restart.");
|
|
3969
3970
|
return;
|
|
3970
3971
|
}
|
|
3971
3972
|
}
|
|
@@ -3973,14 +3974,14 @@ Failed to reload test data. Please refresh the page.`);
|
|
|
3973
3974
|
try {
|
|
3974
3975
|
const D = new URL(d.url).toString().toLowerCase();
|
|
3975
3976
|
if (D.includes("expired") || D.includes("invalid") || D.includes("error")) {
|
|
3976
|
-
console.warn("[Identity] Token URL indicates expiration"), B(!0),
|
|
3977
|
+
console.warn("[Identity] Token URL indicates expiration"), B(!0), A("Your verification link has expired. Please restart.");
|
|
3977
3978
|
return;
|
|
3978
3979
|
}
|
|
3979
3980
|
} catch {
|
|
3980
3981
|
console.error("[Identity] Invalid token URL");
|
|
3981
3982
|
}
|
|
3982
3983
|
if (d.status === "expired" || d.error === "expired" || d.expired === !0) {
|
|
3983
|
-
console.warn("[Identity] Token object indicates expiration"), B(!0),
|
|
3984
|
+
console.warn("[Identity] Token object indicates expiration"), B(!0), A("Your verification session has expired. Please restart.");
|
|
3984
3985
|
return;
|
|
3985
3986
|
}
|
|
3986
3987
|
}
|
|
@@ -3988,7 +3989,7 @@ Failed to reload test data. Please refresh the page.`);
|
|
|
3988
3989
|
if (c !== null && d && !b && I && !M) {
|
|
3989
3990
|
const F = c;
|
|
3990
3991
|
if (d.url) {
|
|
3991
|
-
console.log("[Identity] Loading provider URL for user verification:", d.url),
|
|
3992
|
+
console.log("[Identity] Loading provider URL for user verification:", d.url), A(null);
|
|
3992
3993
|
try {
|
|
3993
3994
|
if (new URL(d.url), F === oe.SardinAI) {
|
|
3994
3995
|
console.log("[SardinAI] Initializing Risk SDK in background...");
|
|
@@ -4005,12 +4006,12 @@ Failed to reload test data. Please refresh the page.`);
|
|
|
4005
4006
|
}
|
|
4006
4007
|
m({ type: "url", url: d.url });
|
|
4007
4008
|
} catch (D) {
|
|
4008
|
-
console.error("[Identity] Invalid URL:", D),
|
|
4009
|
+
console.error("[Identity] Invalid URL:", D), A("Invalid verification URL. Please restart."), B(!0);
|
|
4009
4010
|
}
|
|
4010
4011
|
return;
|
|
4011
4012
|
}
|
|
4012
4013
|
if (F === oe.SardinAI) {
|
|
4013
|
-
console.log("[SardinAI] No URL provided - initializing Risk SDK only..."),
|
|
4014
|
+
console.log("[SardinAI] No URL provided - initializing Risk SDK only..."), A(null);
|
|
4014
4015
|
try {
|
|
4015
4016
|
const D = fe.parseProviderConfig(c, d, i), G = fe.createProvider(c, D);
|
|
4016
4017
|
G.initialize().then(() => {
|
|
@@ -4021,26 +4022,26 @@ Failed to reload test data. Please refresh the page.`);
|
|
|
4021
4022
|
var $;
|
|
4022
4023
|
console.error("[SardinAI] Failed to initialize:", V);
|
|
4023
4024
|
const ae = (($ = V.message) == null ? void 0 : $.toLowerCase()) || "";
|
|
4024
|
-
ae.includes("expired") || ae.includes("invalid") || ae.includes("401") || ae.includes("400") ? (B(!0),
|
|
4025
|
+
ae.includes("expired") || ae.includes("invalid") || ae.includes("401") || ae.includes("400") ? (B(!0), A("Session expired or invalid. Please restart verification.")) : A(`Failed to initialize: ${V.message}`);
|
|
4025
4026
|
});
|
|
4026
4027
|
} catch (D) {
|
|
4027
|
-
console.error("[SardinAI] Error creating provider:", D),
|
|
4028
|
+
console.error("[SardinAI] Error creating provider:", D), A(`Configuration error: ${D.message}`);
|
|
4028
4029
|
}
|
|
4029
4030
|
return;
|
|
4030
4031
|
}
|
|
4031
4032
|
try {
|
|
4032
|
-
|
|
4033
|
+
A(null);
|
|
4033
4034
|
const D = fe.parseProviderConfig(c, d, i), G = fe.createProvider(c, D);
|
|
4034
4035
|
F === oe.Sumsub ? (G.initialize("identity-container").catch((V) => {
|
|
4035
4036
|
var ae;
|
|
4036
|
-
console.error("[Sumsub] Initialization error:", V),
|
|
4037
|
+
console.error("[Sumsub] Initialization error:", V), A(`Failed to initialize: ${V.message}`), (ae = V.message) != null && ae.toLowerCase().includes("expired") && B(!0);
|
|
4037
4038
|
}), G.onComplete && G.onComplete(() => {
|
|
4038
4039
|
e == null || e();
|
|
4039
4040
|
})) : F === oe.Onfido && G.initialize("identity-container").catch((V) => {
|
|
4040
|
-
console.error("[Onfido] Initialization error:", V),
|
|
4041
|
+
console.error("[Onfido] Initialization error:", V), A(`Failed to initialize: ${V.message}`);
|
|
4041
4042
|
}), m(G);
|
|
4042
4043
|
} catch (D) {
|
|
4043
|
-
console.error("[Identity] Provider setup error:", D),
|
|
4044
|
+
console.error("[Identity] Provider setup error:", D), A(`Setup error: ${D.message}`);
|
|
4044
4045
|
}
|
|
4045
4046
|
}
|
|
4046
4047
|
return () => {
|
|
@@ -4054,15 +4055,15 @@ Failed to reload test data. Please refresh the page.`);
|
|
|
4054
4055
|
}, [c, d, b, I, e, M]);
|
|
4055
4056
|
const p = async () => {
|
|
4056
4057
|
try {
|
|
4057
|
-
|
|
4058
|
+
A(null), B(!1), await x(), P(!0);
|
|
4058
4059
|
} catch (F) {
|
|
4059
4060
|
console.error("Error starting identity verification:", F);
|
|
4060
4061
|
}
|
|
4061
4062
|
}, w = async () => {
|
|
4062
4063
|
try {
|
|
4063
|
-
|
|
4064
|
+
A(null), B(!1), m(null), console.log("[Identity] Restarting verification..."), await g(), P(!0);
|
|
4064
4065
|
} catch (F) {
|
|
4065
|
-
console.error("Error restarting identity verification:", F),
|
|
4066
|
+
console.error("Error restarting identity verification:", F), A(F.message || "Failed to restart verification");
|
|
4066
4067
|
}
|
|
4067
4068
|
};
|
|
4068
4069
|
if (v || u)
|
|
@@ -4156,7 +4157,7 @@ Failed to reload test data. Please refresh the page.`);
|
|
|
4156
4157
|
const $ = D.target, Ce = $.contentDocument || ((G = $.contentWindow) == null ? void 0 : G.document);
|
|
4157
4158
|
if (Ce) {
|
|
4158
4159
|
const me = ((ae = (V = Ce.body) == null ? void 0 : V.textContent) == null ? void 0 : ae.toLowerCase()) || "";
|
|
4159
|
-
(me.includes("expired") || me.includes("invalid") || me.includes("error")) && (console.warn("[Identity] Iframe shows expiration message"), B(!0),
|
|
4160
|
+
(me.includes("expired") || me.includes("invalid") || me.includes("error")) && (console.warn("[Identity] Iframe shows expiration message"), B(!0), A("Your verification link has expired."));
|
|
4160
4161
|
}
|
|
4161
4162
|
} catch {
|
|
4162
4163
|
console.log("[Identity] Cannot check iframe content (CORS)");
|
|
@@ -4483,13 +4484,13 @@ Failed to reload test data. Please refresh the page.`);
|
|
|
4483
4484
|
onCancel: s
|
|
4484
4485
|
}) => {
|
|
4485
4486
|
var B, Q, _;
|
|
4486
|
-
const { config: a, baseInformationService: i } = se(), { createApplicant: l, isLoading: c } = rr(), [d, u] = N([]), [y, x] = N(!0), [g, b] = N(!1), [m, f] = N(null), k = H(!1), h = H(!1),
|
|
4487
|
-
if (!
|
|
4487
|
+
const { config: a, baseInformationService: i } = se(), { createApplicant: l, isLoading: c } = rr(), [d, u] = N([]), [y, x] = N(!0), [g, b] = N(!1), [m, f] = N(null), k = H(!1), h = H(!1), E = t || ((B = a.applicantForm) == null ? void 0 : B.workflowKey);
|
|
4488
|
+
if (!E)
|
|
4488
4489
|
throw new Error(
|
|
4489
4490
|
"workflowKey is required. Provide it either as a prop to CreateApplicantForm or set it in config.applicantForm.workflowKey"
|
|
4490
4491
|
);
|
|
4491
4492
|
const v = e || ((Q = a.applicantForm) == null ? void 0 : Q.externalRefId) || "", S = ((_ = a.applicantForm) == null ? void 0 : _.visibleFields) || gt, [I, P] = N({
|
|
4492
|
-
workflowKey:
|
|
4493
|
+
workflowKey: E,
|
|
4493
4494
|
firstName: "",
|
|
4494
4495
|
lastName: "",
|
|
4495
4496
|
title: "",
|
|
@@ -4537,7 +4538,7 @@ Failed to reload test data. Please refresh the page.`);
|
|
|
4537
4538
|
}, []);
|
|
4538
4539
|
const C = (p, w) => {
|
|
4539
4540
|
P((O) => ({ ...O, [p]: w }));
|
|
4540
|
-
},
|
|
4541
|
+
}, A = async (p) => {
|
|
4541
4542
|
p.preventDefault(), b(!0), f(null);
|
|
4542
4543
|
try {
|
|
4543
4544
|
if (!I.externalRefId || I.externalRefId.trim() === "") {
|
|
@@ -4664,7 +4665,7 @@ Failed to reload test data. Please refresh the page.`);
|
|
|
4664
4665
|
return y ? /* @__PURE__ */ n("div", { className: "metakyc-sdk", children: /* @__PURE__ */ n(L, { children: /* @__PURE__ */ o(T, { children: [
|
|
4665
4666
|
/* @__PURE__ */ n(ce, { className: "my-8" }),
|
|
4666
4667
|
/* @__PURE__ */ n("p", { className: "text-center text-gray-600 dark:text-gray-400 mt-4", children: "Loading form..." })
|
|
4667
|
-
] }) }) }) : /* @__PURE__ */ n("div", { className: "metakyc-sdk", children: /* @__PURE__ */ n("form", { onSubmit:
|
|
4668
|
+
] }) }) }) : /* @__PURE__ */ n("div", { className: "metakyc-sdk", children: /* @__PURE__ */ n("form", { onSubmit: A, children: /* @__PURE__ */ o(L, { children: [
|
|
4668
4669
|
/* @__PURE__ */ n(ee, { children: /* @__PURE__ */ n(
|
|
4669
4670
|
Ze,
|
|
4670
4671
|
{
|
|
@@ -4781,8 +4782,8 @@ Failed to reload test data. Please refresh the page.`);
|
|
|
4781
4782
|
P
|
|
4782
4783
|
] })
|
|
4783
4784
|
] }),
|
|
4784
|
-
/* @__PURE__ */ n("div", { className: "flex items-center", children: v.map((C,
|
|
4785
|
-
const M =
|
|
4785
|
+
/* @__PURE__ */ n("div", { className: "flex items-center", children: v.map((C, A) => {
|
|
4786
|
+
const M = A < S, B = C.order === l.order;
|
|
4786
4787
|
return /* @__PURE__ */ o(ie.Fragment, { children: [
|
|
4787
4788
|
/* @__PURE__ */ o("div", { className: "flex items-center", children: [
|
|
4788
4789
|
/* @__PURE__ */ n(
|
|
@@ -4792,18 +4793,18 @@ Failed to reload test data. Please refresh the page.`);
|
|
|
4792
4793
|
w-8 h-8 rounded-full flex items-center justify-center text-sm font-medium
|
|
4793
4794
|
${M || B ? "bg-primary-500 text-white" : "bg-gray-200 text-gray-600 dark:bg-gray-700 dark:text-gray-400"}
|
|
4794
4795
|
`,
|
|
4795
|
-
children:
|
|
4796
|
+
children: A + 1
|
|
4796
4797
|
}
|
|
4797
4798
|
),
|
|
4798
4799
|
/* @__PURE__ */ n(
|
|
4799
4800
|
"span",
|
|
4800
4801
|
{
|
|
4801
4802
|
className: `ml-2 text-sm ${B ? "font-semibold text-gray-900 dark:text-white" : "text-gray-600 dark:text-gray-400"}`,
|
|
4802
|
-
children: C.displayName
|
|
4803
|
+
children: C.displayName || C.name || `Step ${A + 1}`
|
|
4803
4804
|
}
|
|
4804
4805
|
)
|
|
4805
4806
|
] }),
|
|
4806
|
-
|
|
4807
|
+
A < v.length - 1 && /* @__PURE__ */ n(
|
|
4807
4808
|
"div",
|
|
4808
4809
|
{
|
|
4809
4810
|
className: `flex-1 h-0.5 mx-4 ${M ? "bg-primary-500" : "bg-gray-200 dark:bg-gray-700"}`
|
|
@@ -4812,7 +4813,7 @@ Failed to reload test data. Please refresh the page.`);
|
|
|
4812
4813
|
] }, C.order);
|
|
4813
4814
|
}) })
|
|
4814
4815
|
] });
|
|
4815
|
-
},
|
|
4816
|
+
}, E = () => {
|
|
4816
4817
|
const v = {
|
|
4817
4818
|
applicantId: t,
|
|
4818
4819
|
onComplete: async () => {
|
|
@@ -4862,7 +4863,7 @@ Failed to reload test data. Please refresh the page.`);
|
|
|
4862
4863
|
};
|
|
4863
4864
|
return /* @__PURE__ */ o("div", { className: `metakyc-sdk ${a || ""}`, children: [
|
|
4864
4865
|
h(),
|
|
4865
|
-
|
|
4866
|
+
E()
|
|
4866
4867
|
] });
|
|
4867
4868
|
};
|
|
4868
4869
|
export {
|