@vpdev2/metakyc-sdk 1.0.45 → 1.0.47
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 +13 -13
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +868 -844
- package/dist/index.js.map +1 -1
- package/dist/styles.css +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -3,12 +3,12 @@ var ot = (e, t, r) => t in e ? lt(e, t, { enumerable: !0, configurable: !0, writ
|
|
|
3
3
|
var V = (e, t, r) => ot(e, typeof t != "symbol" ? t + "" : t, r);
|
|
4
4
|
import ct from "axios";
|
|
5
5
|
import * as Ze from "react";
|
|
6
|
-
import
|
|
6
|
+
import he, { createContext as dt, useState as x, useMemo as Re, useEffect as ee, useContext as ut, useRef as X, useCallback as Q, forwardRef as $e, createElement as He } from "react";
|
|
7
7
|
import { jsx as a, jsxs as i, Fragment as mt } from "react/jsx-runtime";
|
|
8
|
-
import { useForm as pt, Controller as
|
|
9
|
-
import { z as
|
|
10
|
-
var _ = /* @__PURE__ */ ((e) => (e[e.IdentitySdk = 0] = "IdentitySdk", e[e.RiskScoring = 1] = "RiskScoring", e[e.Questionaries = 2] = "Questionaries", e[e.AdditionalData = 3] = "AdditionalData", e[e.AppropriatenessTest = 4] = "AppropriatenessTest", e[e.UploadDocument = 5] = "UploadDocument", e[e.ManualReview = 6] = "ManualReview", e[e.Overview = 7] = "Overview", e[e.InvestorCategorization = 8] = "InvestorCategorization", e))(_ || {}),
|
|
11
|
-
const
|
|
8
|
+
import { useForm as pt, Controller as Ae } from "react-hook-form";
|
|
9
|
+
import { z as we } from "zod";
|
|
10
|
+
var _ = /* @__PURE__ */ ((e) => (e[e.IdentitySdk = 0] = "IdentitySdk", e[e.RiskScoring = 1] = "RiskScoring", e[e.Questionaries = 2] = "Questionaries", e[e.AdditionalData = 3] = "AdditionalData", e[e.AppropriatenessTest = 4] = "AppropriatenessTest", e[e.UploadDocument = 5] = "UploadDocument", e[e.ManualReview = 6] = "ManualReview", e[e.Overview = 7] = "Overview", e[e.InvestorCategorization = 8] = "InvestorCategorization", e))(_ || {}), ze = /* @__PURE__ */ ((e) => (e[e.NotStarted = 0] = "NotStarted", e[e.InProgress = 1] = "InProgress", e[e.Success = 2] = "Success", e[e.PartialSuccess = 3] = "PartialSuccess", e[e.Failed = 4] = "Failed", e[e.Skipped = 5] = "Skipped", e[e.AdminReview = 6] = "AdminReview", e[e.SkippedAndAdminReview = 7] = "SkippedAndAdminReview", e))(ze || {}), ye = /* @__PURE__ */ ((e) => (e[e.None = 0] = "None", e[e.InProgress = 1] = "InProgress", e[e.Finished = 2] = "Finished", e[e.OnHold = 3] = "OnHold", e[e.IdentityPending = 4] = "IdentityPending", e))(ye || {}), ht = /* @__PURE__ */ ((e) => (e[e.None = 0] = "None", e[e.RepresentativeKYC = 1] = "RepresentativeKYC", e[e.ManualRiskCriteria = 2] = "ManualRiskCriteria", e[e.UploadDocumentReview = 3] = "UploadDocumentReview", e[e.AdminReview = 4] = "AdminReview", e))(ht || {}), gt = /* @__PURE__ */ ((e) => (e[e.LowRisk = 0] = "LowRisk", e[e.MediumRisk = 1] = "MediumRisk", e[e.HighRisk = 2] = "HighRisk", e[e.Alert = 3] = "Alert", e))(gt || {}), Ie = /* @__PURE__ */ ((e) => (e[e.None = 0] = "None", e[e.Pending = 1] = "Pending", e[e.Approved = 2] = "Approved", e[e.Rejected = 3] = "Rejected", e[e.ResendRequested = 4] = "ResendRequested", e[e.Unknown = 5] = "Unknown", e[e.InProgress = 6] = "InProgress", e))(Ie || {}), Ee = /* @__PURE__ */ ((e) => (e[e.Approved = 0] = "Approved", e[e.Reject = 1] = "Reject", e[e.UnderReview = 2] = "UnderReview", e[e.Closed = 3] = "Closed", e[e.AdminReview = 4] = "AdminReview", e[e.New = 5] = "New", e[e.InProgress = 6] = "InProgress", e))(Ee || {}), yt = /* @__PURE__ */ ((e) => (e[e.ProviderResultPending = 0] = "ProviderResultPending", e[e.ProviderResultReceived = 1] = "ProviderResultReceived", e[e.Canceled = 2] = "Canceled", e[e.ExtendedToNewApplicant = 3] = "ExtendedToNewApplicant", e))(yt || {}), ft = /* @__PURE__ */ ((e) => (e[e.None = 0] = "None", e[e.ProviderResultPending = 1] = "ProviderResultPending", e[e.ProviderResultReceived = 2] = "ProviderResultReceived", e[e.Canceled = 3] = "Canceled", e))(ft || {}), ge = /* @__PURE__ */ ((e) => (e[e.Onfido = 0] = "Onfido", e[e.Sumsub = 2] = "Sumsub", e[e.SardinAI = 3] = "SardinAI", e))(ge || {}), xt = /* @__PURE__ */ ((e) => (e[e.Individual = 0] = "Individual", e[e.Company = 1] = "Company", e))(xt || {}), _e = /* @__PURE__ */ ((e) => (e[e.Male = 0] = "Male", e[e.Female = 1] = "Female", e[e.Other = 2] = "Other", e))(_e || {}), bt = /* @__PURE__ */ ((e) => (e[e.Image = 0] = "Image", e[e.Video = 1] = "Video", e[e.PDF = 2] = "PDF", e[e.OfficePDF = 3] = "OfficePDF", e[e.Custom = 4] = "Custom", e))(bt || {}), vt = /* @__PURE__ */ ((e) => (e[e.Pending = 0] = "Pending", e[e.Approved = 1] = "Approved", e[e.Rejected = 2] = "Rejected", e[e.RequiresRevision = 3] = "RequiresRevision", e))(vt || {}), kt = /* @__PURE__ */ ((e) => (e[e.SingleChoice = 0] = "SingleChoice", e[e.MultipleChoice = 1] = "MultipleChoice", e[e.Text = 2] = "Text", e))(kt || {}), Se = /* @__PURE__ */ ((e) => (e[e.String = 0] = "String", e[e.Integer = 1] = "Integer", e[e.Decimal = 2] = "Decimal", e[e.Boolean = 3] = "Boolean", e[e.Date = 4] = "Date", e[e.Country = 5] = "Country", e[e.DigitOnly = 6] = "DigitOnly", e))(Se || {}), wt = /* @__PURE__ */ ((e) => (e[e.Text = 0] = "Text", e[e.Radio = 1] = "Radio", e[e.Checkbox = 2] = "Checkbox", e[e.Dropdown = 3] = "Dropdown", e[e.Country = 4] = "Country", e))(wt || {}), Nt = /* @__PURE__ */ ((e) => (e[e.None = 0] = "None", e[e.Country = 1] = "Country", e))(Nt || {}), me = /* @__PURE__ */ ((e) => (e[e.Individual = 0] = "Individual", e[e.Sophisticated = 1] = "Sophisticated", e[e.HighNetWorth = 2] = "HighNetWorth", e[e.Business = 3] = "Business", e))(me || {}), St = /* @__PURE__ */ ((e) => (e[e.Retail = 0] = "Retail", e[e.Professional = 1] = "Professional", e[e.EligibleCounterparty = 2] = "EligibleCounterparty", e))(St || {});
|
|
11
|
+
const qe = {
|
|
12
12
|
firstName: { label: "First Name", type: "text" },
|
|
13
13
|
lastName: { label: "Last Name", type: "text" },
|
|
14
14
|
email: { label: "Email", type: "email" },
|
|
@@ -56,7 +56,7 @@ const Ke = {
|
|
|
56
56
|
{ value: "FI", label: "Finnish" },
|
|
57
57
|
{ value: "NO", label: "Norwegian" }
|
|
58
58
|
];
|
|
59
|
-
var
|
|
59
|
+
var ie = /* @__PURE__ */ ((e) => (e.Default = "default", e.Corporate = "corporate", e.Fintech = "fintech", e.Healthcare = "healthcare", e.Modern = "modern", e.Minimal = "minimal", e))(ie || {});
|
|
60
60
|
const At = {
|
|
61
61
|
timeout: 3e4,
|
|
62
62
|
retries: 3,
|
|
@@ -105,19 +105,19 @@ class It {
|
|
|
105
105
|
}[t] || t;
|
|
106
106
|
}
|
|
107
107
|
}
|
|
108
|
-
class
|
|
108
|
+
class ke extends Error {
|
|
109
109
|
constructor(r, n, s, l, o) {
|
|
110
110
|
super(r);
|
|
111
111
|
V(this, "response");
|
|
112
|
-
this.code = n, this.details = s, this.validationErrors = l, this.name = "MetaKYCError", this.response = o, Object.setPrototypeOf(this,
|
|
112
|
+
this.code = n, this.details = s, this.validationErrors = l, this.name = "MetaKYCError", this.response = o, Object.setPrototypeOf(this, ke.prototype);
|
|
113
113
|
}
|
|
114
114
|
}
|
|
115
|
-
class
|
|
115
|
+
class Me {
|
|
116
116
|
/**
|
|
117
117
|
* Process an error from the API response
|
|
118
118
|
*/
|
|
119
119
|
static handleApiError(t) {
|
|
120
|
-
return new
|
|
120
|
+
return new ke(
|
|
121
121
|
t.message || "An unknown error occurred",
|
|
122
122
|
t.code,
|
|
123
123
|
t.details || void 0,
|
|
@@ -130,36 +130,36 @@ class Te {
|
|
|
130
130
|
static handleAxiosError(t) {
|
|
131
131
|
if (t.response) {
|
|
132
132
|
const r = t.response.data;
|
|
133
|
-
return r && r.error ? new
|
|
133
|
+
return r && r.error ? new ke(
|
|
134
134
|
r.error.message || "An unknown error occurred",
|
|
135
135
|
r.error.code,
|
|
136
136
|
r.error.details || void 0,
|
|
137
137
|
r.error.validationErrors || void 0,
|
|
138
138
|
t.response
|
|
139
|
-
) : r && r.result && r.result.message ? new
|
|
139
|
+
) : r && r.result && r.result.message ? new ke(
|
|
140
140
|
r.result.message,
|
|
141
141
|
t.response.status,
|
|
142
142
|
`HTTP ${t.response.status}: ${t.response.statusText}`,
|
|
143
143
|
void 0,
|
|
144
144
|
t.response
|
|
145
|
-
) : new
|
|
145
|
+
) : new ke(
|
|
146
146
|
(r == null ? void 0 : r.message) || t.message || "Request failed",
|
|
147
147
|
t.response.status,
|
|
148
148
|
`HTTP ${t.response.status}: ${t.response.statusText}`,
|
|
149
149
|
void 0,
|
|
150
150
|
t.response
|
|
151
151
|
);
|
|
152
|
-
} else return t.request ? new
|
|
152
|
+
} else return t.request ? new ke(
|
|
153
153
|
"No response from server",
|
|
154
154
|
0,
|
|
155
155
|
"The request was made but no response was received. Please check your network connection."
|
|
156
|
-
) : new
|
|
156
|
+
) : new ke(t.message || "An unexpected error occurred", 0, t.toString());
|
|
157
157
|
}
|
|
158
158
|
/**
|
|
159
159
|
* Check if an error is a MetaKYCError
|
|
160
160
|
*/
|
|
161
161
|
static isMetaKYCError(t) {
|
|
162
|
-
return t instanceof
|
|
162
|
+
return t instanceof ke;
|
|
163
163
|
}
|
|
164
164
|
}
|
|
165
165
|
class Et {
|
|
@@ -203,7 +203,7 @@ class Et {
|
|
|
203
203
|
});
|
|
204
204
|
return this.handleResponse(l);
|
|
205
205
|
} catch (s) {
|
|
206
|
-
throw
|
|
206
|
+
throw Me.handleAxiosError(s);
|
|
207
207
|
}
|
|
208
208
|
}
|
|
209
209
|
/**
|
|
@@ -214,7 +214,7 @@ class Et {
|
|
|
214
214
|
const s = this.buildEndpoint(t, r), l = await this.axiosInstance.post(s, n);
|
|
215
215
|
return this.handleResponse(l);
|
|
216
216
|
} catch (s) {
|
|
217
|
-
throw
|
|
217
|
+
throw Me.handleAxiosError(s);
|
|
218
218
|
}
|
|
219
219
|
}
|
|
220
220
|
/**
|
|
@@ -225,7 +225,7 @@ class Et {
|
|
|
225
225
|
const s = this.buildEndpoint(t, r), l = await this.axiosInstance.put(s, n);
|
|
226
226
|
return this.handleResponse(l);
|
|
227
227
|
} catch (s) {
|
|
228
|
-
throw
|
|
228
|
+
throw Me.handleAxiosError(s);
|
|
229
229
|
}
|
|
230
230
|
}
|
|
231
231
|
/**
|
|
@@ -238,7 +238,7 @@ class Et {
|
|
|
238
238
|
});
|
|
239
239
|
return this.handleResponse(l);
|
|
240
240
|
} catch (s) {
|
|
241
|
-
throw
|
|
241
|
+
throw Me.handleAxiosError(s);
|
|
242
242
|
}
|
|
243
243
|
}
|
|
244
244
|
/**
|
|
@@ -247,7 +247,7 @@ class Et {
|
|
|
247
247
|
handleResponse(t) {
|
|
248
248
|
const r = t.data;
|
|
249
249
|
if (!r.success && r.error)
|
|
250
|
-
throw
|
|
250
|
+
throw Me.handleApiError(r.error);
|
|
251
251
|
return r;
|
|
252
252
|
}
|
|
253
253
|
/**
|
|
@@ -631,7 +631,7 @@ class $t {
|
|
|
631
631
|
)).result;
|
|
632
632
|
}
|
|
633
633
|
}
|
|
634
|
-
const
|
|
634
|
+
const ce = {
|
|
635
635
|
name: "Default",
|
|
636
636
|
title: "KYC Verification",
|
|
637
637
|
logo: {
|
|
@@ -865,15 +865,15 @@ const de = {
|
|
|
865
865
|
inputHeight: "2.25rem"
|
|
866
866
|
}
|
|
867
867
|
}, Kt = {
|
|
868
|
-
[
|
|
869
|
-
[
|
|
870
|
-
[
|
|
871
|
-
[
|
|
872
|
-
[
|
|
873
|
-
[
|
|
868
|
+
[ie.Default]: ce,
|
|
869
|
+
[ie.Corporate]: Bt,
|
|
870
|
+
[ie.Fintech]: zt,
|
|
871
|
+
[ie.Healthcare]: _t,
|
|
872
|
+
[ie.Modern]: Ut,
|
|
873
|
+
[ie.Minimal]: qt
|
|
874
874
|
};
|
|
875
|
-
function
|
|
876
|
-
return Kt[e] ||
|
|
875
|
+
function Te(e) {
|
|
876
|
+
return Kt[e] || ce;
|
|
877
877
|
}
|
|
878
878
|
class jt {
|
|
879
879
|
constructor(t) {
|
|
@@ -890,8 +890,8 @@ class jt {
|
|
|
890
890
|
"GetThemeConfiguration"
|
|
891
891
|
);
|
|
892
892
|
if (!r.result.isEnabled)
|
|
893
|
-
return
|
|
894
|
-
let n = r.result.preset ?
|
|
893
|
+
return Te(ie.Default);
|
|
894
|
+
let n = r.result.preset ? Te(r.result.preset) : Te(ie.Default);
|
|
895
895
|
if (r.result.title && (n.title = r.result.title), r.result.logo && (n.logo = { ...n.logo, ...r.result.logo }), r.result.colors && (n.colors = { ...n.colors, ...r.result.colors }), r.result.typography && (n.typography = { ...n.typography, ...r.result.typography }), r.result.spacing && (n.spacing = { ...n.spacing, ...r.result.spacing }), r.result.customCSS && (n.customCSS = r.result.customCSS), r.result.darkMode && (n.darkMode = {
|
|
896
896
|
colors: {
|
|
897
897
|
...(t = n.darkMode) == null ? void 0 : t.colors,
|
|
@@ -905,7 +905,7 @@ class jt {
|
|
|
905
905
|
}
|
|
906
906
|
return n;
|
|
907
907
|
} catch (r) {
|
|
908
|
-
return console.warn("[ThemeService] Failed to fetch theme configuration:", r),
|
|
908
|
+
return console.warn("[ThemeService] Failed to fetch theme configuration:", r), Te(ie.Default);
|
|
909
909
|
}
|
|
910
910
|
}
|
|
911
911
|
/**
|
|
@@ -919,19 +919,19 @@ class jt {
|
|
|
919
919
|
*/
|
|
920
920
|
getAvailablePresets() {
|
|
921
921
|
return [
|
|
922
|
-
{ id:
|
|
923
|
-
{ id:
|
|
924
|
-
{ id:
|
|
925
|
-
{ id:
|
|
926
|
-
{ id:
|
|
927
|
-
{ id:
|
|
922
|
+
{ id: ie.Default, name: "Default" },
|
|
923
|
+
{ id: ie.Corporate, name: "Corporate" },
|
|
924
|
+
{ id: ie.Fintech, name: "Fintech" },
|
|
925
|
+
{ id: ie.Healthcare, name: "Healthcare" },
|
|
926
|
+
{ id: ie.Modern, name: "Modern" },
|
|
927
|
+
{ id: ie.Minimal, name: "Minimal" }
|
|
928
928
|
];
|
|
929
929
|
}
|
|
930
930
|
/**
|
|
931
931
|
* Preview theme (doesn't save)
|
|
932
932
|
*/
|
|
933
933
|
getPreviewTheme(t, r) {
|
|
934
|
-
const n =
|
|
934
|
+
const n = Te(t);
|
|
935
935
|
return r ? {
|
|
936
936
|
...n,
|
|
937
937
|
...r,
|
|
@@ -1025,7 +1025,7 @@ class Wt {
|
|
|
1025
1025
|
*/
|
|
1026
1026
|
get status() {
|
|
1027
1027
|
var t;
|
|
1028
|
-
return ((t = this._progress) == null ? void 0 : t.status) ||
|
|
1028
|
+
return ((t = this._progress) == null ? void 0 : t.status) || ye.None;
|
|
1029
1029
|
}
|
|
1030
1030
|
/**
|
|
1031
1031
|
* Get workflow result
|
|
@@ -1044,19 +1044,19 @@ class Wt {
|
|
|
1044
1044
|
* Check if workflow is complete
|
|
1045
1045
|
*/
|
|
1046
1046
|
get isComplete() {
|
|
1047
|
-
return this.status ===
|
|
1047
|
+
return this.status === ye.Finished;
|
|
1048
1048
|
}
|
|
1049
1049
|
/**
|
|
1050
1050
|
* Check if workflow is on hold
|
|
1051
1051
|
*/
|
|
1052
1052
|
get isOnHold() {
|
|
1053
|
-
return this.status ===
|
|
1053
|
+
return this.status === ye.OnHold;
|
|
1054
1054
|
}
|
|
1055
1055
|
/**
|
|
1056
1056
|
* Check if workflow is in progress
|
|
1057
1057
|
*/
|
|
1058
1058
|
get isInProgress() {
|
|
1059
|
-
return this.status ===
|
|
1059
|
+
return this.status === ye.InProgress;
|
|
1060
1060
|
}
|
|
1061
1061
|
/**
|
|
1062
1062
|
* Set applicant ID
|
|
@@ -1070,7 +1070,7 @@ class Wt {
|
|
|
1070
1070
|
updateProgress(t) {
|
|
1071
1071
|
var n, s;
|
|
1072
1072
|
const r = (n = this._progress) == null ? void 0 : n.currentStep;
|
|
1073
|
-
this._progress = t, this._applicantId = t.applicantId, this._error = null, this.events.emit("progressUpdated", t), (r == null ? void 0 : r.order) !== ((s = t.currentStep) == null ? void 0 : s.order) && this.events.emit("stepChanged", t.currentStep), this.events.emit("statusChanged", t.status), t.status ===
|
|
1073
|
+
this._progress = t, this._applicantId = t.applicantId, this._error = null, this.events.emit("progressUpdated", t), (r == null ? void 0 : r.order) !== ((s = t.currentStep) == null ? void 0 : s.order) && this.events.emit("stepChanged", t.currentStep), this.events.emit("statusChanged", t.status), t.status === ye.Finished && t.workflowResult && this.events.emit("completed", t.workflowResult);
|
|
1074
1074
|
}
|
|
1075
1075
|
/**
|
|
1076
1076
|
* Set error
|
|
@@ -1529,10 +1529,10 @@ class Zt {
|
|
|
1529
1529
|
console.log(`[SardinAI] Device ID: ${c.deviceId}`);
|
|
1530
1530
|
},
|
|
1531
1531
|
// New callback for session updates
|
|
1532
|
-
onConfigUpdate: (c, u,
|
|
1532
|
+
onConfigUpdate: (c, u, m) => {
|
|
1533
1533
|
switch (c) {
|
|
1534
1534
|
case "SESSION_UPDATE_FAILED":
|
|
1535
|
-
console.error("[SardinAI] Session update failed:",
|
|
1535
|
+
console.error("[SardinAI] Session update failed:", m);
|
|
1536
1536
|
break;
|
|
1537
1537
|
case "SESSION_UPDATED":
|
|
1538
1538
|
console.log("[SardinAI] Session updated:", u);
|
|
@@ -1600,11 +1600,11 @@ class De {
|
|
|
1600
1600
|
*/
|
|
1601
1601
|
static createProvider(t, r) {
|
|
1602
1602
|
switch (t) {
|
|
1603
|
-
case
|
|
1603
|
+
case ge.Sumsub:
|
|
1604
1604
|
return new Vt(r);
|
|
1605
|
-
case
|
|
1605
|
+
case ge.Onfido:
|
|
1606
1606
|
return new Gt(r);
|
|
1607
|
-
case
|
|
1607
|
+
case ge.SardinAI:
|
|
1608
1608
|
return new Zt(r);
|
|
1609
1609
|
default:
|
|
1610
1610
|
throw new Error(`Unsupported identity provider: ${t}`);
|
|
@@ -1616,7 +1616,7 @@ class De {
|
|
|
1616
1616
|
static parseProviderConfig(t, r, n) {
|
|
1617
1617
|
var s;
|
|
1618
1618
|
switch (t) {
|
|
1619
|
-
case
|
|
1619
|
+
case ge.Sumsub:
|
|
1620
1620
|
return {
|
|
1621
1621
|
accessToken: r.accessToken || r.token,
|
|
1622
1622
|
applicantEmail: r.email,
|
|
@@ -1624,11 +1624,11 @@ class De {
|
|
|
1624
1624
|
externalUserId: r.externalUserId,
|
|
1625
1625
|
lang: r.lang || "en"
|
|
1626
1626
|
};
|
|
1627
|
-
case
|
|
1627
|
+
case ge.Onfido:
|
|
1628
1628
|
return {
|
|
1629
1629
|
token: r.token || r.sdkToken
|
|
1630
1630
|
};
|
|
1631
|
-
case
|
|
1631
|
+
case ge.SardinAI:
|
|
1632
1632
|
const l = ((s = n == null ? void 0 : n.identityProviders) == null ? void 0 : s.sardinai) || {};
|
|
1633
1633
|
return {
|
|
1634
1634
|
clientId: l.clientId || r.clientId,
|
|
@@ -1646,7 +1646,7 @@ class De {
|
|
|
1646
1646
|
}
|
|
1647
1647
|
class Jt {
|
|
1648
1648
|
constructor(t) {
|
|
1649
|
-
V(this, "currentTheme",
|
|
1649
|
+
V(this, "currentTheme", ce);
|
|
1650
1650
|
V(this, "customStyleElement", null);
|
|
1651
1651
|
V(this, "container");
|
|
1652
1652
|
this.container = t || document.documentElement;
|
|
@@ -1726,19 +1726,19 @@ class Jt {
|
|
|
1726
1726
|
mergeWithDefault(t) {
|
|
1727
1727
|
var r;
|
|
1728
1728
|
return {
|
|
1729
|
-
name: t.name ||
|
|
1730
|
-
title: t.title ||
|
|
1731
|
-
logo: { ...
|
|
1732
|
-
colors: { ...
|
|
1733
|
-
typography: t.typography ? { ...
|
|
1734
|
-
spacing: t.spacing ? { ...
|
|
1729
|
+
name: t.name || ce.name,
|
|
1730
|
+
title: t.title || ce.title,
|
|
1731
|
+
logo: { ...ce.logo, ...t.logo },
|
|
1732
|
+
colors: { ...ce.colors, ...t.colors },
|
|
1733
|
+
typography: t.typography ? { ...ce.typography, ...t.typography } : ce.typography,
|
|
1734
|
+
spacing: t.spacing ? { ...ce.spacing, ...t.spacing } : ce.spacing,
|
|
1735
1735
|
customCSS: t.customCSS,
|
|
1736
1736
|
darkMode: t.darkMode ? {
|
|
1737
1737
|
colors: {
|
|
1738
|
-
...(r =
|
|
1738
|
+
...(r = ce.darkMode) == null ? void 0 : r.colors,
|
|
1739
1739
|
...t.darkMode.colors
|
|
1740
1740
|
}
|
|
1741
|
-
} :
|
|
1741
|
+
} : ce.darkMode,
|
|
1742
1742
|
applicantFormVisibleFields: t.applicantFormVisibleFields,
|
|
1743
1743
|
applicantFormRequiredFields: t.applicantFormRequiredFields,
|
|
1744
1744
|
allowedLanguages: t.allowedLanguages,
|
|
@@ -1755,7 +1755,7 @@ class Jt {
|
|
|
1755
1755
|
* Reset to default theme
|
|
1756
1756
|
*/
|
|
1757
1757
|
resetTheme() {
|
|
1758
|
-
this.applyTheme(
|
|
1758
|
+
this.applyTheme(ce);
|
|
1759
1759
|
}
|
|
1760
1760
|
/**
|
|
1761
1761
|
* Remove all custom styles
|
|
@@ -1771,23 +1771,23 @@ class Jt {
|
|
|
1771
1771
|
}
|
|
1772
1772
|
}
|
|
1773
1773
|
const rt = dt(null), Yr = ({ config: e, children: t }) => {
|
|
1774
|
-
const [r, n] = x(null), s =
|
|
1775
|
-
const u = new Et(e),
|
|
1774
|
+
const [r, n] = x(null), s = he.useRef(!1), l = he.useRef(!1), o = Re(() => {
|
|
1775
|
+
const u = new Et(e), m = new Rt(u), w = new Ft(u), S = new Dt(u), y = new Pt(u), h = new Lt(u), g = new Mt(u), N = new Tt(u), b = new Ot(u), p = new $t(u), R = new jt(u), C = new Jt();
|
|
1776
1776
|
return {
|
|
1777
1777
|
httpClient: u,
|
|
1778
|
-
applicantService:
|
|
1778
|
+
applicantService: m,
|
|
1779
1779
|
questionnaireService: w,
|
|
1780
|
-
uploadDocumentService:
|
|
1780
|
+
uploadDocumentService: S,
|
|
1781
1781
|
appropriatenessTestService: y,
|
|
1782
1782
|
overviewService: h,
|
|
1783
1783
|
riskScoringService: g,
|
|
1784
|
-
identityService:
|
|
1784
|
+
identityService: N,
|
|
1785
1785
|
baseInformationService: b,
|
|
1786
|
-
investorCategorizationService:
|
|
1787
|
-
themeService:
|
|
1788
|
-
themeManager:
|
|
1786
|
+
investorCategorizationService: p,
|
|
1787
|
+
themeService: R,
|
|
1788
|
+
themeManager: C
|
|
1789
1789
|
};
|
|
1790
|
-
}, [e]), c =
|
|
1790
|
+
}, [e]), c = Re(() => ({
|
|
1791
1791
|
config: e,
|
|
1792
1792
|
...o,
|
|
1793
1793
|
currentTheme: r,
|
|
@@ -1802,7 +1802,7 @@ const rt = dt(null), Yr = ({ config: e, children: t }) => {
|
|
|
1802
1802
|
o.investorCategorizationService
|
|
1803
1803
|
)
|
|
1804
1804
|
}), [e, o, r]);
|
|
1805
|
-
return
|
|
1805
|
+
return ee(() => ((async () => {
|
|
1806
1806
|
if (s.current || l.current) {
|
|
1807
1807
|
console.log("[MetaKYC] Theme already loading or loaded, skipping...");
|
|
1808
1808
|
return;
|
|
@@ -1814,10 +1814,10 @@ const rt = dt(null), Yr = ({ config: e, children: t }) => {
|
|
|
1814
1814
|
return;
|
|
1815
1815
|
}
|
|
1816
1816
|
console.log("[MetaKYC] Fetching theme from backend...");
|
|
1817
|
-
const
|
|
1818
|
-
o.themeManager.applyTheme(
|
|
1819
|
-
} catch (
|
|
1820
|
-
console.warn("[MetaKYC] Failed to load theme, using default:",
|
|
1817
|
+
const m = await o.themeService.getThemeConfiguration();
|
|
1818
|
+
o.themeManager.applyTheme(m), n(o.themeManager.getCurrentTheme()), l.current = !0, console.log("[MetaKYC] Theme loaded and applied", m);
|
|
1819
|
+
} catch (m) {
|
|
1820
|
+
console.warn("[MetaKYC] Failed to load theme, using default:", m), n(o.themeManager.getCurrentTheme()), l.current = !0;
|
|
1821
1821
|
} finally {
|
|
1822
1822
|
s.current = !1;
|
|
1823
1823
|
}
|
|
@@ -1825,7 +1825,7 @@ const rt = dt(null), Yr = ({ config: e, children: t }) => {
|
|
|
1825
1825
|
o.themeManager.cleanup();
|
|
1826
1826
|
}), []), /* @__PURE__ */ a(rt.Provider, { value: c, children: t });
|
|
1827
1827
|
};
|
|
1828
|
-
function
|
|
1828
|
+
function pe() {
|
|
1829
1829
|
const e = ut(rt);
|
|
1830
1830
|
if (!e)
|
|
1831
1831
|
throw new Error("useMetaKYC must be used within a MetaKYCProvider");
|
|
@@ -1852,7 +1852,7 @@ function Vr(e, t) {
|
|
|
1852
1852
|
return e.type === n;
|
|
1853
1853
|
});
|
|
1854
1854
|
}
|
|
1855
|
-
function
|
|
1855
|
+
function Ke(e) {
|
|
1856
1856
|
if (e === 0) return "0 Bytes";
|
|
1857
1857
|
const t = 1024, r = ["Bytes", "KB", "MB", "GB"], n = Math.floor(Math.log(e) / Math.log(t));
|
|
1858
1858
|
return Math.round(e / Math.pow(t, n) * 100) / 100 + " " + r[n];
|
|
@@ -1860,7 +1860,7 @@ function je(e) {
|
|
|
1860
1860
|
function Gr(e) {
|
|
1861
1861
|
return e;
|
|
1862
1862
|
}
|
|
1863
|
-
function
|
|
1863
|
+
function le(...e) {
|
|
1864
1864
|
return e.filter(Boolean).join(" ");
|
|
1865
1865
|
}
|
|
1866
1866
|
const Pe = {
|
|
@@ -1915,41 +1915,41 @@ function Jr() {
|
|
|
1915
1915
|
rr(), nr();
|
|
1916
1916
|
}
|
|
1917
1917
|
function sr(e) {
|
|
1918
|
-
const { createOrchestrator: t } =
|
|
1919
|
-
|
|
1918
|
+
const { createOrchestrator: t } = pe(), [r, n] = x(null), [s, l] = x(!1), [o, c] = x(null), u = X(null), m = e || tr();
|
|
1919
|
+
ee(() => {
|
|
1920
1920
|
u.current || (u.current = t());
|
|
1921
|
-
}, [t]),
|
|
1922
|
-
var
|
|
1923
|
-
r &&
|
|
1924
|
-
applicantId:
|
|
1925
|
-
currentStepOrder: (
|
|
1921
|
+
}, [t]), ee(() => {
|
|
1922
|
+
var C;
|
|
1923
|
+
r && m && (er(m), ar({
|
|
1924
|
+
applicantId: m,
|
|
1925
|
+
currentStepOrder: (C = r.currentStep) == null ? void 0 : C.order,
|
|
1926
1926
|
status: r.status,
|
|
1927
1927
|
lastUpdated: (/* @__PURE__ */ new Date()).toISOString(),
|
|
1928
1928
|
workflowKey: r.workFlowKey,
|
|
1929
1929
|
nextWorkflowKey: r.nextWorkflowKey
|
|
1930
1930
|
}));
|
|
1931
|
-
}, [r,
|
|
1932
|
-
const w =
|
|
1933
|
-
if (!(!
|
|
1931
|
+
}, [r, m]);
|
|
1932
|
+
const w = X(!1), S = X(!1), y = Q(async () => {
|
|
1933
|
+
if (!(!m || !u.current)) {
|
|
1934
1934
|
if (w.current) {
|
|
1935
1935
|
console.log("[Workflow] Load already in progress, skipping...");
|
|
1936
1936
|
return;
|
|
1937
1937
|
}
|
|
1938
1938
|
w.current = !0, l(!0), c(null);
|
|
1939
1939
|
try {
|
|
1940
|
-
const
|
|
1941
|
-
n(
|
|
1942
|
-
} catch (
|
|
1943
|
-
c(
|
|
1940
|
+
const C = await u.current.initialize(m);
|
|
1941
|
+
n(C), S.current = !0;
|
|
1942
|
+
} catch (C) {
|
|
1943
|
+
c(C);
|
|
1944
1944
|
} finally {
|
|
1945
1945
|
l(!1), w.current = !1;
|
|
1946
1946
|
}
|
|
1947
1947
|
}
|
|
1948
|
-
}, [
|
|
1949
|
-
|
|
1950
|
-
|
|
1951
|
-
}, [
|
|
1952
|
-
const h =
|
|
1948
|
+
}, [m]);
|
|
1949
|
+
ee(() => {
|
|
1950
|
+
m && !S.current && y();
|
|
1951
|
+
}, [m, y]);
|
|
1952
|
+
const h = Q(async () => {
|
|
1953
1953
|
if (u.current) {
|
|
1954
1954
|
if (w.current) {
|
|
1955
1955
|
console.log("[Workflow] Refresh already in progress, skipping...");
|
|
@@ -1957,43 +1957,43 @@ function sr(e) {
|
|
|
1957
1957
|
}
|
|
1958
1958
|
w.current = !0, l(!0), c(null);
|
|
1959
1959
|
try {
|
|
1960
|
-
const
|
|
1961
|
-
n(
|
|
1962
|
-
} catch (
|
|
1963
|
-
c(
|
|
1960
|
+
const C = await u.current.refreshProgress();
|
|
1961
|
+
n(C);
|
|
1962
|
+
} catch (C) {
|
|
1963
|
+
c(C);
|
|
1964
1964
|
} finally {
|
|
1965
1965
|
l(!1), w.current = !1;
|
|
1966
1966
|
}
|
|
1967
1967
|
}
|
|
1968
|
-
}, []), g =
|
|
1968
|
+
}, []), g = Q(async () => {
|
|
1969
1969
|
if (u.current) {
|
|
1970
1970
|
l(!0), c(null);
|
|
1971
1971
|
try {
|
|
1972
|
-
const
|
|
1973
|
-
n(
|
|
1974
|
-
} catch (
|
|
1975
|
-
c(
|
|
1972
|
+
const C = await u.current.moveToNextStep();
|
|
1973
|
+
n(C);
|
|
1974
|
+
} catch (C) {
|
|
1975
|
+
c(C);
|
|
1976
1976
|
} finally {
|
|
1977
1977
|
l(!1);
|
|
1978
1978
|
}
|
|
1979
1979
|
}
|
|
1980
|
-
}, []),
|
|
1980
|
+
}, []), N = Q(async () => {
|
|
1981
1981
|
if (u.current) {
|
|
1982
1982
|
l(!0), c(null);
|
|
1983
1983
|
try {
|
|
1984
|
-
const
|
|
1985
|
-
n(
|
|
1986
|
-
} catch (
|
|
1987
|
-
c(
|
|
1984
|
+
const C = await u.current.moveToPreviousStep();
|
|
1985
|
+
n(C);
|
|
1986
|
+
} catch (C) {
|
|
1987
|
+
c(C);
|
|
1988
1988
|
} finally {
|
|
1989
1989
|
l(!1);
|
|
1990
1990
|
}
|
|
1991
1991
|
}
|
|
1992
|
-
}, []), b =
|
|
1992
|
+
}, []), b = Q(async (C) => {
|
|
1993
1993
|
if (u.current) {
|
|
1994
1994
|
l(!0), c(null);
|
|
1995
1995
|
try {
|
|
1996
|
-
await u.current.submitCurrentStep(
|
|
1996
|
+
await u.current.submitCurrentStep(C);
|
|
1997
1997
|
const v = await u.current.refreshProgress();
|
|
1998
1998
|
n(v);
|
|
1999
1999
|
} catch (v) {
|
|
@@ -2002,31 +2002,31 @@ function sr(e) {
|
|
|
2002
2002
|
l(!1);
|
|
2003
2003
|
}
|
|
2004
2004
|
}
|
|
2005
|
-
}, []),
|
|
2005
|
+
}, []), p = Ze.useMemo(() => r != null && r.stepInfoList ? [...r.stepInfoList].sort((C, v) => C.order - v.order) : [], [r == null ? void 0 : r.stepInfoList]), R = Ze.useMemo(() => r ? r.nextWorkflowKey && r.nextWorkflowKey !== r.workFlowKey : !1, [r]);
|
|
2006
2006
|
return {
|
|
2007
2007
|
progress: r,
|
|
2008
|
-
applicantId:
|
|
2008
|
+
applicantId: m,
|
|
2009
2009
|
currentStep: (r == null ? void 0 : r.currentStep) || null,
|
|
2010
|
-
steps:
|
|
2011
|
-
status: (r == null ? void 0 : r.status) ||
|
|
2010
|
+
steps: p,
|
|
2011
|
+
status: (r == null ? void 0 : r.status) || ye.None,
|
|
2012
2012
|
workflowResult: (r == null ? void 0 : r.workflowResult) || null,
|
|
2013
2013
|
workflowKey: r == null ? void 0 : r.workFlowKey,
|
|
2014
2014
|
nextWorkflowKey: r == null ? void 0 : r.nextWorkflowKey,
|
|
2015
|
-
hasWorkflowChanged:
|
|
2015
|
+
hasWorkflowChanged: R,
|
|
2016
2016
|
isLoading: s,
|
|
2017
2017
|
error: o,
|
|
2018
|
-
isComplete: (r == null ? void 0 : r.status) ===
|
|
2019
|
-
isOnHold: (r == null ? void 0 : r.status) ===
|
|
2018
|
+
isComplete: (r == null ? void 0 : r.status) === ye.Finished,
|
|
2019
|
+
isOnHold: (r == null ? void 0 : r.status) === ye.OnHold,
|
|
2020
2020
|
refreshProgress: h,
|
|
2021
2021
|
moveToNext: g,
|
|
2022
|
-
moveBack:
|
|
2022
|
+
moveBack: N,
|
|
2023
2023
|
submitCurrentStep: b,
|
|
2024
2024
|
orchestrator: u.current
|
|
2025
2025
|
};
|
|
2026
2026
|
}
|
|
2027
2027
|
function ir(e) {
|
|
2028
|
-
const { questionnaireService: t, applicantService: r } =
|
|
2029
|
-
var
|
|
2028
|
+
const { questionnaireService: t, applicantService: r } = pe(), [n, s] = x(null), [l, o] = x({}), [c, u] = x(!1), [m, w] = x(!1), [S, y] = x(null), h = X(!1), g = X(null), N = Q(async () => {
|
|
2029
|
+
var p, R;
|
|
2030
2030
|
if (e) {
|
|
2031
2031
|
if (h.current) {
|
|
2032
2032
|
console.log("[Questionnaire] Load already in progress, skipping...");
|
|
@@ -2034,39 +2034,39 @@ function ir(e) {
|
|
|
2034
2034
|
}
|
|
2035
2035
|
h.current = !0, u(!0), y(null);
|
|
2036
2036
|
try {
|
|
2037
|
-
const [
|
|
2037
|
+
const [C, v] = await Promise.all([
|
|
2038
2038
|
t.getQuestionnaire(e),
|
|
2039
2039
|
r.getApplicantData(e).catch(() => null)
|
|
2040
2040
|
]);
|
|
2041
|
-
if (s(
|
|
2041
|
+
if (s(C), (p = v == null ? void 0 : v.questionnaireResults) != null && p.length && C) {
|
|
2042
2042
|
const q = /* @__PURE__ */ new Map();
|
|
2043
2043
|
for (const f of v.questionnaireResults)
|
|
2044
|
-
f.question && ((
|
|
2045
|
-
const
|
|
2044
|
+
f.question && ((R = f.answers) != null && R.length) && q.set(f.question.trim().toLowerCase(), f.answers);
|
|
2045
|
+
const W = {}, T = C.questionGroups.flatMap((f) => f.questions ?? []);
|
|
2046
2046
|
for (const f of T) {
|
|
2047
2047
|
const A = f.text.trim().toLowerCase();
|
|
2048
|
-
q.has(A) && (
|
|
2048
|
+
q.has(A) && (W[f.id] = q.get(A));
|
|
2049
2049
|
}
|
|
2050
|
-
o(
|
|
2050
|
+
o(W);
|
|
2051
2051
|
}
|
|
2052
2052
|
g.current = e;
|
|
2053
|
-
} catch (
|
|
2054
|
-
y(
|
|
2053
|
+
} catch (C) {
|
|
2054
|
+
y(C);
|
|
2055
2055
|
} finally {
|
|
2056
2056
|
u(!1), h.current = !1;
|
|
2057
2057
|
}
|
|
2058
2058
|
}
|
|
2059
2059
|
}, [e, t, r]);
|
|
2060
|
-
|
|
2061
|
-
e && g.current !== e &&
|
|
2060
|
+
ee(() => {
|
|
2061
|
+
e && g.current !== e && N();
|
|
2062
2062
|
}, [e]);
|
|
2063
|
-
const b =
|
|
2064
|
-
async (
|
|
2063
|
+
const b = Q(
|
|
2064
|
+
async (p) => {
|
|
2065
2065
|
w(!0), y(null);
|
|
2066
2066
|
try {
|
|
2067
|
-
return await t.fillQuestionnaire(
|
|
2068
|
-
} catch (
|
|
2069
|
-
throw y(
|
|
2067
|
+
return await t.fillQuestionnaire(p);
|
|
2068
|
+
} catch (R) {
|
|
2069
|
+
throw y(R), R;
|
|
2070
2070
|
} finally {
|
|
2071
2071
|
w(!1);
|
|
2072
2072
|
}
|
|
@@ -2077,40 +2077,40 @@ function ir(e) {
|
|
|
2077
2077
|
questionnaire: n,
|
|
2078
2078
|
initialAnswers: l,
|
|
2079
2079
|
isLoading: c,
|
|
2080
|
-
isSubmitting:
|
|
2081
|
-
error:
|
|
2082
|
-
load:
|
|
2080
|
+
isSubmitting: m,
|
|
2081
|
+
error: S,
|
|
2082
|
+
load: N,
|
|
2083
2083
|
submit: b
|
|
2084
2084
|
};
|
|
2085
2085
|
}
|
|
2086
2086
|
function lr(e) {
|
|
2087
|
-
const { uploadDocumentService: t } =
|
|
2087
|
+
const { uploadDocumentService: t } = pe(), [r, n] = x(null), [s, l] = x(!1), [o, c] = x(!1), [u, m] = x(0), [w, S] = x(null), y = X(!1), h = X(null), g = Q(async () => {
|
|
2088
2088
|
if (e) {
|
|
2089
2089
|
if (y.current) {
|
|
2090
2090
|
console.log("[UploadDocument] Load already in progress, skipping...");
|
|
2091
2091
|
return;
|
|
2092
2092
|
}
|
|
2093
|
-
y.current = !0, l(!0),
|
|
2093
|
+
y.current = !0, l(!0), S(null);
|
|
2094
2094
|
try {
|
|
2095
2095
|
const b = await t.getUploadDocument(e);
|
|
2096
2096
|
n(b), h.current = e;
|
|
2097
2097
|
} catch (b) {
|
|
2098
|
-
|
|
2098
|
+
S(b);
|
|
2099
2099
|
} finally {
|
|
2100
2100
|
l(!1), y.current = !1;
|
|
2101
2101
|
}
|
|
2102
2102
|
}
|
|
2103
2103
|
}, [e, t]);
|
|
2104
|
-
|
|
2104
|
+
ee(() => {
|
|
2105
2105
|
e && h.current !== e && g();
|
|
2106
2106
|
}, [e]);
|
|
2107
|
-
const
|
|
2107
|
+
const N = Q(
|
|
2108
2108
|
async (b) => {
|
|
2109
|
-
c(!0),
|
|
2109
|
+
c(!0), m(0), S(null);
|
|
2110
2110
|
try {
|
|
2111
|
-
await t.fillUploadDocument(b),
|
|
2112
|
-
} catch (
|
|
2113
|
-
throw
|
|
2111
|
+
await t.fillUploadDocument(b), m(100);
|
|
2112
|
+
} catch (p) {
|
|
2113
|
+
throw S(p), p;
|
|
2114
2114
|
} finally {
|
|
2115
2115
|
c(!1);
|
|
2116
2116
|
}
|
|
@@ -2124,38 +2124,38 @@ function lr(e) {
|
|
|
2124
2124
|
uploadProgress: u,
|
|
2125
2125
|
error: w,
|
|
2126
2126
|
load: g,
|
|
2127
|
-
submit:
|
|
2127
|
+
submit: N
|
|
2128
2128
|
};
|
|
2129
2129
|
}
|
|
2130
2130
|
function Xr(e) {
|
|
2131
|
-
const { appropriatenessTestService: t } =
|
|
2131
|
+
const { appropriatenessTestService: t } = pe(), [r, n] = x(null), [s, l] = x(!1), [o, c] = x(!1), [u, m] = x(null), [w, S] = x(null), y = X(!1), h = X(null), g = Q(async () => {
|
|
2132
2132
|
if (e) {
|
|
2133
2133
|
if (y.current) {
|
|
2134
2134
|
console.log("[AppropriatenessTest] Load already in progress, skipping...");
|
|
2135
2135
|
return;
|
|
2136
2136
|
}
|
|
2137
|
-
y.current = !0, l(!0),
|
|
2137
|
+
y.current = !0, l(!0), m(null);
|
|
2138
2138
|
try {
|
|
2139
2139
|
const b = await t.getAppropriatenessTest(e);
|
|
2140
2140
|
n(b), h.current = e;
|
|
2141
2141
|
} catch (b) {
|
|
2142
|
-
|
|
2142
|
+
m(b);
|
|
2143
2143
|
} finally {
|
|
2144
2144
|
l(!1), y.current = !1;
|
|
2145
2145
|
}
|
|
2146
2146
|
}
|
|
2147
2147
|
}, [e, t]);
|
|
2148
|
-
|
|
2148
|
+
ee(() => {
|
|
2149
2149
|
e && h.current !== e && g();
|
|
2150
2150
|
}, [e]);
|
|
2151
|
-
const
|
|
2151
|
+
const N = Q(
|
|
2152
2152
|
async (b) => {
|
|
2153
|
-
c(!0),
|
|
2153
|
+
c(!0), m(null);
|
|
2154
2154
|
try {
|
|
2155
|
-
const
|
|
2156
|
-
return
|
|
2157
|
-
} catch (
|
|
2158
|
-
throw p
|
|
2155
|
+
const p = await t.fillAppropriatenessTest(b);
|
|
2156
|
+
return S(p), p;
|
|
2157
|
+
} catch (p) {
|
|
2158
|
+
throw m(p), p;
|
|
2159
2159
|
} finally {
|
|
2160
2160
|
c(!1);
|
|
2161
2161
|
}
|
|
@@ -2169,37 +2169,37 @@ function Xr(e) {
|
|
|
2169
2169
|
isSubmitting: o,
|
|
2170
2170
|
error: u,
|
|
2171
2171
|
load: g,
|
|
2172
|
-
submit:
|
|
2172
|
+
submit: N
|
|
2173
2173
|
};
|
|
2174
2174
|
}
|
|
2175
2175
|
function or(e) {
|
|
2176
|
-
const { overviewService: t } =
|
|
2176
|
+
const { overviewService: t } = pe(), [r, n] = x(null), [s, l] = x(!1), [o, c] = x(!1), [u, m] = x(null), w = X(!1), S = X(null), y = Q(async () => {
|
|
2177
2177
|
if (e) {
|
|
2178
2178
|
if (w.current) {
|
|
2179
2179
|
console.log("[Overview] Load already in progress, skipping...");
|
|
2180
2180
|
return;
|
|
2181
2181
|
}
|
|
2182
|
-
w.current = !0, l(!0),
|
|
2182
|
+
w.current = !0, l(!0), m(null);
|
|
2183
2183
|
try {
|
|
2184
2184
|
const g = await t.getOverviewData(e);
|
|
2185
|
-
n(g),
|
|
2185
|
+
n(g), S.current = e;
|
|
2186
2186
|
} catch (g) {
|
|
2187
|
-
|
|
2187
|
+
m(g);
|
|
2188
2188
|
} finally {
|
|
2189
2189
|
l(!1), w.current = !1;
|
|
2190
2190
|
}
|
|
2191
2191
|
}
|
|
2192
2192
|
}, [e, t]);
|
|
2193
|
-
|
|
2194
|
-
e &&
|
|
2193
|
+
ee(() => {
|
|
2194
|
+
e && S.current !== e && y();
|
|
2195
2195
|
}, [e]);
|
|
2196
|
-
const h =
|
|
2196
|
+
const h = Q(async () => {
|
|
2197
2197
|
if (e) {
|
|
2198
|
-
c(!0),
|
|
2198
|
+
c(!0), m(null);
|
|
2199
2199
|
try {
|
|
2200
2200
|
await t.passOverview(e);
|
|
2201
2201
|
} catch (g) {
|
|
2202
|
-
throw
|
|
2202
|
+
throw m(g), g;
|
|
2203
2203
|
} finally {
|
|
2204
2204
|
c(!1);
|
|
2205
2205
|
}
|
|
@@ -2215,9 +2215,9 @@ function or(e) {
|
|
|
2215
2215
|
};
|
|
2216
2216
|
}
|
|
2217
2217
|
function cr(e) {
|
|
2218
|
-
const { identityService: t } =
|
|
2218
|
+
const { identityService: t } = pe(), [r, n] = x(
|
|
2219
2219
|
null
|
|
2220
|
-
), [s, l] = x(!1), [o, c] = x(null), u =
|
|
2220
|
+
), [s, l] = x(!1), [o, c] = x(null), u = X(!1), m = Q(
|
|
2221
2221
|
async (y, h) => {
|
|
2222
2222
|
if (e) {
|
|
2223
2223
|
if (u.current) {
|
|
@@ -2234,8 +2234,8 @@ function cr(e) {
|
|
|
2234
2234
|
// Default: 7 days
|
|
2235
2235
|
};
|
|
2236
2236
|
console.log("Identity request input:", g);
|
|
2237
|
-
const
|
|
2238
|
-
return console.log("Identity request result:",
|
|
2237
|
+
const N = await t.identityRequest(g);
|
|
2238
|
+
return console.log("Identity request result:", N), n(N), N;
|
|
2239
2239
|
} catch (g) {
|
|
2240
2240
|
throw c(g), g;
|
|
2241
2241
|
} finally {
|
|
@@ -2244,7 +2244,7 @@ function cr(e) {
|
|
|
2244
2244
|
}
|
|
2245
2245
|
},
|
|
2246
2246
|
[e, t]
|
|
2247
|
-
), w =
|
|
2247
|
+
), w = Q(
|
|
2248
2248
|
async (y, h) => {
|
|
2249
2249
|
if (e) {
|
|
2250
2250
|
l(!0), c(null);
|
|
@@ -2254,8 +2254,8 @@ function cr(e) {
|
|
|
2254
2254
|
restart: !1,
|
|
2255
2255
|
redirectUrl: y,
|
|
2256
2256
|
ttl: h
|
|
2257
|
-
},
|
|
2258
|
-
return n(
|
|
2257
|
+
}, N = await t.identityCompanyRequest(g);
|
|
2258
|
+
return n(N), N;
|
|
2259
2259
|
} catch (g) {
|
|
2260
2260
|
throw c(g), g;
|
|
2261
2261
|
} finally {
|
|
@@ -2264,7 +2264,7 @@ function cr(e) {
|
|
|
2264
2264
|
}
|
|
2265
2265
|
},
|
|
2266
2266
|
[e, t]
|
|
2267
|
-
),
|
|
2267
|
+
), S = Q(async () => {
|
|
2268
2268
|
if (e) {
|
|
2269
2269
|
if (u.current) {
|
|
2270
2270
|
console.log("[Identity] Restart already in progress, skipping...");
|
|
@@ -2295,31 +2295,31 @@ function cr(e) {
|
|
|
2295
2295
|
token: (r == null ? void 0 : r.publicProviderTokenObject) || null,
|
|
2296
2296
|
isLoading: s,
|
|
2297
2297
|
error: o,
|
|
2298
|
-
requestIdentity:
|
|
2298
|
+
requestIdentity: m,
|
|
2299
2299
|
requestCompanyIdentity: w,
|
|
2300
|
-
restartIdentity:
|
|
2300
|
+
restartIdentity: S
|
|
2301
2301
|
};
|
|
2302
2302
|
}
|
|
2303
2303
|
function dr(e) {
|
|
2304
|
-
const { riskScoringService: t, applicantService: r } =
|
|
2305
|
-
var
|
|
2304
|
+
const { riskScoringService: t, applicantService: r } = pe(), [n, s] = x(null), [l, o] = x({}), [c, u] = x(!1), [m, w] = x(!1), [S, y] = x(null), [h, g] = x(null), N = X(!1), b = X(null), p = Q(async () => {
|
|
2305
|
+
var C;
|
|
2306
2306
|
if (e) {
|
|
2307
|
-
if (
|
|
2307
|
+
if (N.current) {
|
|
2308
2308
|
console.log("[RiskScoring] Load already in progress, skipping...");
|
|
2309
2309
|
return;
|
|
2310
2310
|
}
|
|
2311
|
-
|
|
2311
|
+
N.current = !0, u(!0), y(null);
|
|
2312
2312
|
try {
|
|
2313
2313
|
const [v, q] = await Promise.all([
|
|
2314
2314
|
t.getRiskCriterias(e),
|
|
2315
2315
|
r.getApplicantData(e).catch(() => null)
|
|
2316
2316
|
]);
|
|
2317
|
-
if (s(v), (
|
|
2318
|
-
const
|
|
2319
|
-
for (const f of
|
|
2317
|
+
if (s(v), (C = q == null ? void 0 : q.riskScoringResults) != null && C.length) {
|
|
2318
|
+
const W = q.riskScoringResults[0], T = {};
|
|
2319
|
+
for (const f of W.riskCriteriaResults ?? [])
|
|
2320
2320
|
if (f.riskCriteriaId != null && f.answer != null && f.answer !== "") {
|
|
2321
2321
|
const A = [...new Set(
|
|
2322
|
-
f.answer.split(",").map((
|
|
2322
|
+
f.answer.split(",").map((F) => F.trim()).filter((F) => F !== "")
|
|
2323
2323
|
)];
|
|
2324
2324
|
A.length > 0 && (T[f.riskCriteriaId] = A);
|
|
2325
2325
|
}
|
|
@@ -2329,18 +2329,18 @@ function dr(e) {
|
|
|
2329
2329
|
} catch (v) {
|
|
2330
2330
|
y(v);
|
|
2331
2331
|
} finally {
|
|
2332
|
-
u(!1),
|
|
2332
|
+
u(!1), N.current = !1;
|
|
2333
2333
|
}
|
|
2334
2334
|
}
|
|
2335
2335
|
}, [e, t, r]);
|
|
2336
|
-
|
|
2337
|
-
e && b.current !== e &&
|
|
2336
|
+
ee(() => {
|
|
2337
|
+
e && b.current !== e && p();
|
|
2338
2338
|
}, [e]);
|
|
2339
|
-
const
|
|
2340
|
-
async (
|
|
2339
|
+
const R = Q(
|
|
2340
|
+
async (C) => {
|
|
2341
2341
|
w(!0), y(null);
|
|
2342
2342
|
try {
|
|
2343
|
-
const v = await t.submitRiskScoring(
|
|
2343
|
+
const v = await t.submitRiskScoring(C);
|
|
2344
2344
|
return g(v), v;
|
|
2345
2345
|
} catch (v) {
|
|
2346
2346
|
throw y(v), v;
|
|
@@ -2355,17 +2355,17 @@ function dr(e) {
|
|
|
2355
2355
|
initialAnswers: l,
|
|
2356
2356
|
result: h,
|
|
2357
2357
|
isLoading: c,
|
|
2358
|
-
isSubmitting:
|
|
2359
|
-
error:
|
|
2360
|
-
load:
|
|
2361
|
-
submit:
|
|
2358
|
+
isSubmitting: m,
|
|
2359
|
+
error: S,
|
|
2360
|
+
load: p,
|
|
2361
|
+
submit: R
|
|
2362
2362
|
};
|
|
2363
2363
|
}
|
|
2364
2364
|
function ur() {
|
|
2365
|
-
const { applicantService: e, config: t } =
|
|
2365
|
+
const { applicantService: e, config: t } = pe(), [r, n] = x(!1), [s, l] = x(null), o = X(!1), c = X(!1), u = () => "xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g, function(h) {
|
|
2366
2366
|
const g = Math.random() * 16 | 0;
|
|
2367
2367
|
return (h === "x" ? g : g & 3 | 8).toString(16);
|
|
2368
|
-
}),
|
|
2368
|
+
}), m = Q(
|
|
2369
2369
|
async (h) => {
|
|
2370
2370
|
var g;
|
|
2371
2371
|
if (o.current)
|
|
@@ -2380,14 +2380,14 @@ function ur() {
|
|
|
2380
2380
|
});
|
|
2381
2381
|
}
|
|
2382
2382
|
return await e.createApplicant(h);
|
|
2383
|
-
} catch (
|
|
2384
|
-
throw l(
|
|
2383
|
+
} catch (N) {
|
|
2384
|
+
throw l(N), N;
|
|
2385
2385
|
} finally {
|
|
2386
2386
|
n(!1), o.current = !1;
|
|
2387
2387
|
}
|
|
2388
2388
|
},
|
|
2389
2389
|
[e, t]
|
|
2390
|
-
), w =
|
|
2390
|
+
), w = Q(
|
|
2391
2391
|
async (h) => {
|
|
2392
2392
|
n(!0), l(null);
|
|
2393
2393
|
try {
|
|
@@ -2399,7 +2399,7 @@ function ur() {
|
|
|
2399
2399
|
}
|
|
2400
2400
|
},
|
|
2401
2401
|
[e]
|
|
2402
|
-
),
|
|
2402
|
+
), S = Q(
|
|
2403
2403
|
async (h) => {
|
|
2404
2404
|
if (c.current)
|
|
2405
2405
|
throw console.log("[Applicant] Data load already in progress, skipping..."), new Error("Data load already in progress");
|
|
@@ -2413,7 +2413,7 @@ function ur() {
|
|
|
2413
2413
|
}
|
|
2414
2414
|
},
|
|
2415
2415
|
[e]
|
|
2416
|
-
), y =
|
|
2416
|
+
), y = Q(
|
|
2417
2417
|
async (h) => {
|
|
2418
2418
|
n(!0), l(null);
|
|
2419
2419
|
try {
|
|
@@ -2429,9 +2429,9 @@ function ur() {
|
|
|
2429
2429
|
return {
|
|
2430
2430
|
isLoading: r,
|
|
2431
2431
|
error: s,
|
|
2432
|
-
createApplicant:
|
|
2432
|
+
createApplicant: m,
|
|
2433
2433
|
createCompanyApplicant: w,
|
|
2434
|
-
getApplicantData:
|
|
2434
|
+
getApplicantData: S,
|
|
2435
2435
|
stopProgress: y
|
|
2436
2436
|
};
|
|
2437
2437
|
}
|
|
@@ -2450,7 +2450,7 @@ const U = ({
|
|
|
2450
2450
|
outline: "border-2 border-primary-500 text-primary-500 hover:bg-primary-50 focus:ring-primary-500",
|
|
2451
2451
|
danger: "bg-danger-500 text-white hover:bg-danger-600 focus:ring-danger-500",
|
|
2452
2452
|
ghost: "text-gray-700 hover:bg-gray-100 focus:ring-gray-400"
|
|
2453
|
-
},
|
|
2453
|
+
}, m = {
|
|
2454
2454
|
sm: "px-3 py-1.5 text-sm",
|
|
2455
2455
|
md: "px-4 py-2 text-base",
|
|
2456
2456
|
lg: "px-6 py-3 text-lg"
|
|
@@ -2458,7 +2458,7 @@ const U = ({
|
|
|
2458
2458
|
return /* @__PURE__ */ i(
|
|
2459
2459
|
"button",
|
|
2460
2460
|
{
|
|
2461
|
-
className:
|
|
2461
|
+
className: le(c, u[t], m[r], l),
|
|
2462
2462
|
disabled: s || n,
|
|
2463
2463
|
...o,
|
|
2464
2464
|
children: [
|
|
@@ -2496,7 +2496,7 @@ const U = ({
|
|
|
2496
2496
|
]
|
|
2497
2497
|
}
|
|
2498
2498
|
);
|
|
2499
|
-
},
|
|
2499
|
+
}, de = $e(
|
|
2500
2500
|
({ label: e, error: t, helperText: r, leftIcon: n, rightIcon: s, className: l, ...o }, c) => /* @__PURE__ */ i("div", { className: "w-full", children: [
|
|
2501
2501
|
e && /* @__PURE__ */ i("label", { className: "block text-sm font-medium text-gray-700 dark:text-gray-300 mb-1", children: [
|
|
2502
2502
|
e,
|
|
@@ -2508,7 +2508,7 @@ const U = ({
|
|
|
2508
2508
|
"input",
|
|
2509
2509
|
{
|
|
2510
2510
|
ref: c,
|
|
2511
|
-
className:
|
|
2511
|
+
className: le(
|
|
2512
2512
|
"block w-full rounded-lg border px-3 py-2 text-sm transition-colors",
|
|
2513
2513
|
"focus:outline-none focus:ring-2 focus:ring-primary-500 focus:border-transparent",
|
|
2514
2514
|
"disabled:bg-gray-100 disabled:cursor-not-allowed",
|
|
@@ -2527,11 +2527,11 @@ const U = ({
|
|
|
2527
2527
|
!t && r && /* @__PURE__ */ a("p", { className: "mt-1 text-sm text-gray-500", children: r })
|
|
2528
2528
|
] })
|
|
2529
2529
|
);
|
|
2530
|
-
|
|
2530
|
+
de.displayName = "Input";
|
|
2531
2531
|
const $ = ({ children: e, className: t, ...r }) => /* @__PURE__ */ a(
|
|
2532
2532
|
"div",
|
|
2533
2533
|
{
|
|
2534
|
-
className:
|
|
2534
|
+
className: le(
|
|
2535
2535
|
"metakyc-card rounded-xl shadow-sm border",
|
|
2536
2536
|
t
|
|
2537
2537
|
),
|
|
@@ -2545,27 +2545,27 @@ const $ = ({ children: e, className: t, ...r }) => /* @__PURE__ */ a(
|
|
|
2545
2545
|
), oe = ({ children: e, className: t, ...r }) => /* @__PURE__ */ a(
|
|
2546
2546
|
"div",
|
|
2547
2547
|
{
|
|
2548
|
-
className:
|
|
2548
|
+
className: le("px-6 py-4 border-b", t),
|
|
2549
2549
|
style: {
|
|
2550
2550
|
borderColor: "var(--metakyc-border, #e5e7eb)"
|
|
2551
2551
|
},
|
|
2552
2552
|
...r,
|
|
2553
2553
|
children: e
|
|
2554
2554
|
}
|
|
2555
|
-
), B = ({ children: e, className: t, ...r }) => /* @__PURE__ */ a("div", { className:
|
|
2555
|
+
), B = ({ children: e, className: t, ...r }) => /* @__PURE__ */ a("div", { className: le("px-6 py-4", t), ...r, children: e }), ue = ({ children: e, className: t, ...r }) => /* @__PURE__ */ a(
|
|
2556
2556
|
"div",
|
|
2557
2557
|
{
|
|
2558
|
-
className:
|
|
2558
|
+
className: le("px-6 py-4 border-t", t),
|
|
2559
2559
|
style: {
|
|
2560
2560
|
borderColor: "var(--metakyc-border, #e5e7eb)"
|
|
2561
2561
|
},
|
|
2562
2562
|
...r,
|
|
2563
2563
|
children: e
|
|
2564
2564
|
}
|
|
2565
|
-
),
|
|
2565
|
+
), Ne = ({ children: e, variant: t = "default", className: r, ...n }) => /* @__PURE__ */ a(
|
|
2566
2566
|
"span",
|
|
2567
2567
|
{
|
|
2568
|
-
className:
|
|
2568
|
+
className: le(
|
|
2569
2569
|
"inline-flex items-center px-2.5 py-0.5 rounded-full text-xs font-medium",
|
|
2570
2570
|
{
|
|
2571
2571
|
default: "bg-gray-100 text-gray-800 dark:bg-gray-700 dark:text-gray-300",
|
|
@@ -2579,16 +2579,16 @@ const $ = ({ children: e, className: t, ...r }) => /* @__PURE__ */ a(
|
|
|
2579
2579
|
...n,
|
|
2580
2580
|
children: e
|
|
2581
2581
|
}
|
|
2582
|
-
),
|
|
2582
|
+
), fe = ({ size: e = "md", className: t, ...r }) => {
|
|
2583
2583
|
const n = {
|
|
2584
2584
|
sm: "h-4 w-4",
|
|
2585
2585
|
md: "h-8 w-8",
|
|
2586
2586
|
lg: "h-12 w-12"
|
|
2587
2587
|
};
|
|
2588
|
-
return /* @__PURE__ */ a("div", { className:
|
|
2588
|
+
return /* @__PURE__ */ a("div", { className: le("flex items-center justify-center", t), ...r, children: /* @__PURE__ */ i(
|
|
2589
2589
|
"svg",
|
|
2590
2590
|
{
|
|
2591
|
-
className:
|
|
2591
|
+
className: le("animate-spin text-primary-500", n[e]),
|
|
2592
2592
|
xmlns: "http://www.w3.org/2000/svg",
|
|
2593
2593
|
fill: "none",
|
|
2594
2594
|
viewBox: "0 0 24 24",
|
|
@@ -2615,7 +2615,7 @@ const $ = ({ children: e, className: t, ...r }) => /* @__PURE__ */ a(
|
|
|
2615
2615
|
]
|
|
2616
2616
|
}
|
|
2617
2617
|
) });
|
|
2618
|
-
},
|
|
2618
|
+
}, Ce = $e(
|
|
2619
2619
|
({ label: e, error: t, helperText: r, options: n, placeholder: s, className: l, style: o, ...c }, u) => /* @__PURE__ */ i("div", { className: "w-full", children: [
|
|
2620
2620
|
e && /* @__PURE__ */ i(
|
|
2621
2621
|
"label",
|
|
@@ -2632,7 +2632,7 @@ const $ = ({ children: e, className: t, ...r }) => /* @__PURE__ */ a(
|
|
|
2632
2632
|
"select",
|
|
2633
2633
|
{
|
|
2634
2634
|
ref: u,
|
|
2635
|
-
className:
|
|
2635
|
+
className: le(
|
|
2636
2636
|
"block w-full rounded-lg border px-3 py-2 text-sm transition-colors",
|
|
2637
2637
|
"focus:outline-none focus:ring-2 focus:ring-offset-0",
|
|
2638
2638
|
"disabled:opacity-60 disabled:cursor-not-allowed",
|
|
@@ -2661,18 +2661,18 @@ const $ = ({ children: e, className: t, ...r }) => /* @__PURE__ */ a(
|
|
|
2661
2661
|
},
|
|
2662
2662
|
"__placeholder__"
|
|
2663
2663
|
),
|
|
2664
|
-
n.map((
|
|
2664
|
+
n.map((m, w) => /* @__PURE__ */ a(
|
|
2665
2665
|
"option",
|
|
2666
2666
|
{
|
|
2667
|
-
value:
|
|
2668
|
-
disabled:
|
|
2667
|
+
value: m.value,
|
|
2668
|
+
disabled: m.disabled,
|
|
2669
2669
|
style: {
|
|
2670
2670
|
backgroundColor: "var(--metakyc-input-bg, #ffffff)",
|
|
2671
|
-
color:
|
|
2671
|
+
color: m.disabled ? "var(--metakyc-text-secondary, #9ca3af)" : "var(--metakyc-text-primary, #111827)"
|
|
2672
2672
|
},
|
|
2673
|
-
children:
|
|
2673
|
+
children: m.label
|
|
2674
2674
|
},
|
|
2675
|
-
|
|
2675
|
+
m.value || `option-${w}`
|
|
2676
2676
|
))
|
|
2677
2677
|
]
|
|
2678
2678
|
}
|
|
@@ -2681,7 +2681,7 @@ const $ = ({ children: e, className: t, ...r }) => /* @__PURE__ */ a(
|
|
|
2681
2681
|
!t && r && /* @__PURE__ */ a("p", { className: "mt-1 text-sm", style: { color: "var(--metakyc-text-secondary, #6b7280)" }, children: r })
|
|
2682
2682
|
] })
|
|
2683
2683
|
);
|
|
2684
|
-
|
|
2684
|
+
Ce.displayName = "Select";
|
|
2685
2685
|
const mr = ({
|
|
2686
2686
|
label: e,
|
|
2687
2687
|
value: t,
|
|
@@ -2691,24 +2691,24 @@ const mr = ({
|
|
|
2691
2691
|
disabled: l = !1,
|
|
2692
2692
|
required: o = !1
|
|
2693
2693
|
}) => {
|
|
2694
|
-
const [c, u] = x(!1), [
|
|
2695
|
-
|
|
2696
|
-
const b = (
|
|
2697
|
-
|
|
2694
|
+
const [c, u] = x(!1), [m, w] = x(""), S = X(null);
|
|
2695
|
+
ee(() => {
|
|
2696
|
+
const b = (p) => {
|
|
2697
|
+
S.current && !S.current.contains(p.target) && (u(!1), w(""));
|
|
2698
2698
|
};
|
|
2699
2699
|
return document.addEventListener("mousedown", b), () => document.removeEventListener("mousedown", b);
|
|
2700
2700
|
}, []);
|
|
2701
2701
|
const y = n.filter(
|
|
2702
|
-
(b) => b.label.toLowerCase().includes(
|
|
2702
|
+
(b) => b.label.toLowerCase().includes(m.toLowerCase())
|
|
2703
2703
|
), h = (b) => {
|
|
2704
|
-
l || (t.includes(b) ? r(t.filter((
|
|
2705
|
-
}, g = (b,
|
|
2706
|
-
|
|
2707
|
-
},
|
|
2708
|
-
var
|
|
2709
|
-
return ((
|
|
2704
|
+
l || (t.includes(b) ? r(t.filter((p) => p !== b)) : r([...t, b]));
|
|
2705
|
+
}, g = (b, p) => {
|
|
2706
|
+
p.stopPropagation(), l || r(t.filter((R) => R !== b));
|
|
2707
|
+
}, N = (b) => {
|
|
2708
|
+
var p;
|
|
2709
|
+
return ((p = n.find((R) => R.value === b)) == null ? void 0 : p.label) || b;
|
|
2710
2710
|
};
|
|
2711
|
-
return /* @__PURE__ */ i("div", { className: "w-full metakyc-multiselect", ref:
|
|
2711
|
+
return /* @__PURE__ */ i("div", { className: "w-full metakyc-multiselect", ref: S, children: [
|
|
2712
2712
|
e && /* @__PURE__ */ i("label", { className: "block text-sm font-medium text-gray-700 dark:text-gray-300 mb-1", children: [
|
|
2713
2713
|
e,
|
|
2714
2714
|
o && /* @__PURE__ */ a("span", { className: "text-red-500 ml-1", children: "*" })
|
|
@@ -2718,7 +2718,7 @@ const mr = ({
|
|
|
2718
2718
|
"div",
|
|
2719
2719
|
{
|
|
2720
2720
|
onClick: () => !l && u(!c),
|
|
2721
|
-
className:
|
|
2721
|
+
className: le(
|
|
2722
2722
|
"metakyc-multiselect-trigger",
|
|
2723
2723
|
"min-h-[42px] w-full px-3 py-2 rounded-lg border text-sm transition-colors",
|
|
2724
2724
|
"bg-white dark:bg-gray-800",
|
|
@@ -2732,12 +2732,12 @@ const mr = ({
|
|
|
2732
2732
|
{
|
|
2733
2733
|
className: "metakyc-multiselect-chip inline-flex items-center gap-1 px-2 py-0.5 rounded bg-blue-100 dark:bg-blue-900/40 text-blue-800 dark:text-blue-300 text-xs font-medium",
|
|
2734
2734
|
children: [
|
|
2735
|
-
|
|
2735
|
+
N(b),
|
|
2736
2736
|
!l && /* @__PURE__ */ a(
|
|
2737
2737
|
"button",
|
|
2738
2738
|
{
|
|
2739
2739
|
type: "button",
|
|
2740
|
-
onClick: (
|
|
2740
|
+
onClick: (p) => g(b, p),
|
|
2741
2741
|
className: "metakyc-multiselect-chip-remove",
|
|
2742
2742
|
style: {
|
|
2743
2743
|
background: "transparent",
|
|
@@ -2779,7 +2779,7 @@ const mr = ({
|
|
|
2779
2779
|
"input",
|
|
2780
2780
|
{
|
|
2781
2781
|
type: "text",
|
|
2782
|
-
value:
|
|
2782
|
+
value: m,
|
|
2783
2783
|
onChange: (b) => w(b.target.value),
|
|
2784
2784
|
placeholder: "Search...",
|
|
2785
2785
|
autoFocus: !0,
|
|
@@ -2792,7 +2792,7 @@ const mr = ({
|
|
|
2792
2792
|
"li",
|
|
2793
2793
|
{
|
|
2794
2794
|
onClick: () => h(b.value),
|
|
2795
|
-
className:
|
|
2795
|
+
className: le(
|
|
2796
2796
|
"metakyc-multiselect-option",
|
|
2797
2797
|
"flex items-center gap-2 px-3 py-2 text-sm cursor-pointer",
|
|
2798
2798
|
"hover:bg-gray-50 dark:hover:bg-gray-700",
|
|
@@ -2843,34 +2843,34 @@ const mr = ({
|
|
|
2843
2843
|
value: o = [],
|
|
2844
2844
|
className: c
|
|
2845
2845
|
}) => {
|
|
2846
|
-
const [u,
|
|
2847
|
-
if (!
|
|
2848
|
-
const
|
|
2849
|
-
if (s &&
|
|
2850
|
-
const v =
|
|
2846
|
+
const [u, m] = x(!1), w = X(null), S = (p) => {
|
|
2847
|
+
if (!p) return;
|
|
2848
|
+
const R = Array.from(p);
|
|
2849
|
+
if (s && R.filter((v) => v.size > s).length > 0) {
|
|
2850
|
+
const v = Ke(s);
|
|
2851
2851
|
alert(`Some files exceed the maximum size of ${v}`);
|
|
2852
2852
|
return;
|
|
2853
2853
|
}
|
|
2854
|
-
l == null || l(n ? [...o, ...
|
|
2855
|
-
}, y = (
|
|
2856
|
-
|
|
2854
|
+
l == null || l(n ? [...o, ...R] : [R[0]]);
|
|
2855
|
+
}, y = (p) => {
|
|
2856
|
+
p.preventDefault(), m(!0);
|
|
2857
2857
|
}, h = () => {
|
|
2858
|
-
|
|
2859
|
-
}, g = (
|
|
2860
|
-
|
|
2861
|
-
},
|
|
2862
|
-
var
|
|
2863
|
-
(
|
|
2864
|
-
}, b = (
|
|
2865
|
-
const
|
|
2866
|
-
l == null || l(
|
|
2858
|
+
m(!1);
|
|
2859
|
+
}, g = (p) => {
|
|
2860
|
+
p.preventDefault(), m(!1), S(p.dataTransfer.files);
|
|
2861
|
+
}, N = () => {
|
|
2862
|
+
var p;
|
|
2863
|
+
(p = w.current) == null || p.click();
|
|
2864
|
+
}, b = (p) => {
|
|
2865
|
+
const R = o.filter((C, v) => v !== p);
|
|
2866
|
+
l == null || l(R);
|
|
2867
2867
|
};
|
|
2868
|
-
return /* @__PURE__ */ i("div", { className:
|
|
2868
|
+
return /* @__PURE__ */ i("div", { className: le("w-full", c), children: [
|
|
2869
2869
|
e && /* @__PURE__ */ a("label", { className: "block text-sm font-medium text-gray-700 dark:text-gray-300 mb-1", children: e }),
|
|
2870
2870
|
/* @__PURE__ */ i(
|
|
2871
2871
|
"div",
|
|
2872
2872
|
{
|
|
2873
|
-
className:
|
|
2873
|
+
className: le(
|
|
2874
2874
|
"border-2 border-dashed rounded-lg p-6 text-center cursor-pointer transition-colors",
|
|
2875
2875
|
u ? "border-primary-500 bg-primary-50 dark:bg-primary-900/20" : "border-gray-300 dark:border-gray-600 hover:border-primary-500",
|
|
2876
2876
|
t && "border-danger-500"
|
|
@@ -2878,7 +2878,7 @@ const mr = ({
|
|
|
2878
2878
|
onDragOver: y,
|
|
2879
2879
|
onDragLeave: h,
|
|
2880
2880
|
onDrop: g,
|
|
2881
|
-
onClick:
|
|
2881
|
+
onClick: N,
|
|
2882
2882
|
children: [
|
|
2883
2883
|
/* @__PURE__ */ a(
|
|
2884
2884
|
"input",
|
|
@@ -2888,7 +2888,7 @@ const mr = ({
|
|
|
2888
2888
|
className: "hidden",
|
|
2889
2889
|
accept: r,
|
|
2890
2890
|
multiple: n,
|
|
2891
|
-
onChange: (
|
|
2891
|
+
onChange: (p) => S(p.target.files)
|
|
2892
2892
|
}
|
|
2893
2893
|
),
|
|
2894
2894
|
/* @__PURE__ */ i("div", { className: "space-y-2", children: [
|
|
@@ -2916,13 +2916,13 @@ const mr = ({
|
|
|
2916
2916
|
] }),
|
|
2917
2917
|
s && /* @__PURE__ */ i("p", { className: "text-xs text-gray-500", children: [
|
|
2918
2918
|
"Maximum file size: ",
|
|
2919
|
-
|
|
2919
|
+
Ke(s)
|
|
2920
2920
|
] })
|
|
2921
2921
|
] })
|
|
2922
2922
|
]
|
|
2923
2923
|
}
|
|
2924
2924
|
),
|
|
2925
|
-
o.length > 0 && /* @__PURE__ */ a("div", { className: "mt-3 space-y-2", children: o.map((
|
|
2925
|
+
o.length > 0 && /* @__PURE__ */ a("div", { className: "mt-3 space-y-2", children: o.map((p, R) => /* @__PURE__ */ i(
|
|
2926
2926
|
"div",
|
|
2927
2927
|
{
|
|
2928
2928
|
className: "flex items-center justify-between px-3 py-2 bg-gray-50 dark:bg-gray-700 rounded-lg",
|
|
@@ -2944,10 +2944,10 @@ const mr = ({
|
|
|
2944
2944
|
)
|
|
2945
2945
|
}
|
|
2946
2946
|
),
|
|
2947
|
-
/* @__PURE__ */ a("span", { className: "text-sm text-gray-700 dark:text-gray-300 truncate", children:
|
|
2947
|
+
/* @__PURE__ */ a("span", { className: "text-sm text-gray-700 dark:text-gray-300 truncate", children: p.name }),
|
|
2948
2948
|
/* @__PURE__ */ i("span", { className: "text-xs text-gray-500", children: [
|
|
2949
2949
|
"(",
|
|
2950
|
-
|
|
2950
|
+
Ke(p.size),
|
|
2951
2951
|
")"
|
|
2952
2952
|
] })
|
|
2953
2953
|
] }),
|
|
@@ -2955,8 +2955,8 @@ const mr = ({
|
|
|
2955
2955
|
"button",
|
|
2956
2956
|
{
|
|
2957
2957
|
type: "button",
|
|
2958
|
-
onClick: (
|
|
2959
|
-
|
|
2958
|
+
onClick: (C) => {
|
|
2959
|
+
C.stopPropagation(), b(R);
|
|
2960
2960
|
},
|
|
2961
2961
|
className: "ml-2 text-danger-500 hover:text-danger-700 focus:outline-none",
|
|
2962
2962
|
children: /* @__PURE__ */ a("svg", { className: "h-5 w-5", fill: "currentColor", viewBox: "0 0 20 20", children: /* @__PURE__ */ a(
|
|
@@ -2971,7 +2971,7 @@ const mr = ({
|
|
|
2971
2971
|
)
|
|
2972
2972
|
]
|
|
2973
2973
|
},
|
|
2974
|
-
|
|
2974
|
+
R
|
|
2975
2975
|
)) }),
|
|
2976
2976
|
t && /* @__PURE__ */ a("p", { className: "mt-1 text-sm text-danger-500", children: t })
|
|
2977
2977
|
] });
|
|
@@ -2988,7 +2988,7 @@ const mr = ({
|
|
|
2988
2988
|
type: "text",
|
|
2989
2989
|
value: e,
|
|
2990
2990
|
onChange: (l) => t == null ? void 0 : t(l.target.value),
|
|
2991
|
-
className:
|
|
2991
|
+
className: le(
|
|
2992
2992
|
"w-20 rounded-lg border px-3 py-2 text-sm",
|
|
2993
2993
|
"focus:outline-none focus:ring-2 focus:ring-primary-500 focus:border-transparent",
|
|
2994
2994
|
"border-gray-300 dark:border-gray-600 dark:bg-gray-800 dark:text-white"
|
|
@@ -2997,11 +2997,11 @@ const mr = ({
|
|
|
2997
2997
|
}
|
|
2998
2998
|
),
|
|
2999
2999
|
/* @__PURE__ */ a(
|
|
3000
|
-
|
|
3000
|
+
de,
|
|
3001
3001
|
{
|
|
3002
3002
|
ref: s,
|
|
3003
3003
|
type: "tel",
|
|
3004
|
-
className:
|
|
3004
|
+
className: le("flex-1", r),
|
|
3005
3005
|
...n,
|
|
3006
3006
|
label: ""
|
|
3007
3007
|
}
|
|
@@ -3090,7 +3090,7 @@ const br = $e(
|
|
|
3090
3090
|
children: l,
|
|
3091
3091
|
iconNode: o,
|
|
3092
3092
|
...c
|
|
3093
|
-
}, u) =>
|
|
3093
|
+
}, u) => He(
|
|
3094
3094
|
"svg",
|
|
3095
3095
|
{
|
|
3096
3096
|
ref: u,
|
|
@@ -3104,7 +3104,7 @@ const br = $e(
|
|
|
3104
3104
|
...c
|
|
3105
3105
|
},
|
|
3106
3106
|
[
|
|
3107
|
-
...o.map(([
|
|
3107
|
+
...o.map(([m, w]) => He(m, w)),
|
|
3108
3108
|
...Array.isArray(l) ? l : [l]
|
|
3109
3109
|
]
|
|
3110
3110
|
)
|
|
@@ -3117,7 +3117,7 @@ const br = $e(
|
|
|
3117
3117
|
*/
|
|
3118
3118
|
const nt = (e, t) => {
|
|
3119
3119
|
const r = $e(
|
|
3120
|
-
({ className: n, ...s }, l) =>
|
|
3120
|
+
({ className: n, ...s }, l) => He(br, {
|
|
3121
3121
|
ref: l,
|
|
3122
3122
|
iconNode: t,
|
|
3123
3123
|
className: at(
|
|
@@ -3143,8 +3143,8 @@ const vr = [["path", { d: "m15 18-6-6 6-6", key: "1wnfg3" }]], st = nt("chevron-
|
|
|
3143
3143
|
* This source code is licensed under the ISC license.
|
|
3144
3144
|
* See the LICENSE file in the root directory of this source tree.
|
|
3145
3145
|
*/
|
|
3146
|
-
const
|
|
3147
|
-
function
|
|
3146
|
+
const kr = [["path", { d: "m9 18 6-6-6-6", key: "mthhwq" }]], it = nt("chevron-right", kr);
|
|
3147
|
+
function wr(e, t) {
|
|
3148
3148
|
const r = !t || t.length === 0 || t.every((n) => !n || !n.trim());
|
|
3149
3149
|
if (e.isRequired && r)
|
|
3150
3150
|
return e.errorMessage || "This field is required";
|
|
@@ -3188,36 +3188,36 @@ const Sr = ({
|
|
|
3188
3188
|
onComplete: t,
|
|
3189
3189
|
onBack: r
|
|
3190
3190
|
}) => {
|
|
3191
|
-
const { questionnaire: n, initialAnswers: s, isLoading: l, isSubmitting: o, error: c, submit: u } = ir(e), [
|
|
3192
|
-
|
|
3193
|
-
s && Object.keys(s).length > 0 && Object.keys(
|
|
3191
|
+
const { questionnaire: n, initialAnswers: s, isLoading: l, isSubmitting: o, error: c, submit: u } = ir(e), [m, w] = x({}), [S, y] = x({}), [h, g] = x(0);
|
|
3192
|
+
he.useEffect(() => {
|
|
3193
|
+
s && Object.keys(s).length > 0 && Object.keys(m).length === 0 && w(s);
|
|
3194
3194
|
}, [s]);
|
|
3195
|
-
const
|
|
3195
|
+
const N = Re(
|
|
3196
3196
|
() => n ? Nr(n.questionGroups) : [],
|
|
3197
3197
|
[n]
|
|
3198
|
-
), b = h ===
|
|
3198
|
+
), b = h === N.length - 1, p = N[h] ?? [], R = Q((T, f) => {
|
|
3199
3199
|
w((A) => ({ ...A, [T]: f })), y((A) => {
|
|
3200
|
-
const
|
|
3201
|
-
return delete
|
|
3200
|
+
const F = { ...A };
|
|
3201
|
+
return delete F[T], F;
|
|
3202
3202
|
});
|
|
3203
|
-
}, []),
|
|
3203
|
+
}, []), C = Q(() => {
|
|
3204
3204
|
const T = {};
|
|
3205
|
-
for (const { question: f } of
|
|
3206
|
-
const A =
|
|
3205
|
+
for (const { question: f } of p) {
|
|
3206
|
+
const A = wr(f, m[f.id] ?? []);
|
|
3207
3207
|
A && (T[f.id] = A);
|
|
3208
3208
|
}
|
|
3209
3209
|
return y((f) => ({ ...f, ...T })), Object.keys(T).length === 0;
|
|
3210
|
-
}, [
|
|
3211
|
-
|
|
3210
|
+
}, [p, m]), v = () => {
|
|
3211
|
+
C() && g((T) => T + 1);
|
|
3212
3212
|
}, q = () => {
|
|
3213
3213
|
h > 0 ? g((T) => T - 1) : r == null || r();
|
|
3214
|
-
},
|
|
3215
|
-
if (!(!
|
|
3214
|
+
}, W = async () => {
|
|
3215
|
+
if (!(!C() || !n))
|
|
3216
3216
|
try {
|
|
3217
3217
|
const T = n.questionGroups.flatMap(
|
|
3218
|
-
(A) => (A.questions ?? []).map((
|
|
3219
|
-
questionId:
|
|
3220
|
-
values:
|
|
3218
|
+
(A) => (A.questions ?? []).map((F) => ({
|
|
3219
|
+
questionId: F.id,
|
|
3220
|
+
values: m[F.id] ?? []
|
|
3221
3221
|
}))
|
|
3222
3222
|
), f = {
|
|
3223
3223
|
applicantId: e,
|
|
@@ -3229,21 +3229,21 @@ const Sr = ({
|
|
|
3229
3229
|
console.error("Questionnaire submit error:", T);
|
|
3230
3230
|
}
|
|
3231
3231
|
};
|
|
3232
|
-
return l ? /* @__PURE__ */ a($, { children: /* @__PURE__ */ a(B, { children: /* @__PURE__ */ a(
|
|
3232
|
+
return l ? /* @__PURE__ */ a($, { children: /* @__PURE__ */ a(B, { children: /* @__PURE__ */ a(fe, { className: "my-8" }) }) }) : c ? /* @__PURE__ */ a($, { children: /* @__PURE__ */ a(B, { children: /* @__PURE__ */ i("p", { className: "text-danger-500", children: [
|
|
3233
3233
|
"Error loading questionnaire: ",
|
|
3234
3234
|
c.message
|
|
3235
3235
|
] }) }) }) : n ? /* @__PURE__ */ i($, { children: [
|
|
3236
3236
|
/* @__PURE__ */ i(oe, { children: [
|
|
3237
3237
|
/* @__PURE__ */ a("h2", { className: "text-lg font-bold", children: n.displayName }),
|
|
3238
3238
|
n.subtitle && /* @__PURE__ */ a("p", { className: "text-sm", style: { color: "var(--metakyc-text-secondary, #6b7280)" }, children: n.subtitle }),
|
|
3239
|
-
|
|
3239
|
+
N.length > 1 && /* @__PURE__ */ i("div", { className: "flex items-center justify-between mt-3", children: [
|
|
3240
3240
|
/* @__PURE__ */ i("span", { className: "text-xs", style: { color: "var(--metakyc-text-muted, #9ca3af)" }, children: [
|
|
3241
3241
|
"Page ",
|
|
3242
3242
|
h + 1,
|
|
3243
3243
|
" of ",
|
|
3244
|
-
|
|
3244
|
+
N.length
|
|
3245
3245
|
] }),
|
|
3246
|
-
/* @__PURE__ */ a("div", { className: "flex items-center gap-1.5", children:
|
|
3246
|
+
/* @__PURE__ */ a("div", { className: "flex items-center gap-1.5", children: N.map((T, f) => /* @__PURE__ */ a(
|
|
3247
3247
|
"div",
|
|
3248
3248
|
{
|
|
3249
3249
|
className: "rounded-full transition-all duration-200",
|
|
@@ -3257,17 +3257,17 @@ const Sr = ({
|
|
|
3257
3257
|
)) })
|
|
3258
3258
|
] })
|
|
3259
3259
|
] }),
|
|
3260
|
-
/* @__PURE__ */ a(B, { className: "space-y-6", children:
|
|
3260
|
+
/* @__PURE__ */ a(B, { className: "space-y-6", children: p.map(({ question: T }) => /* @__PURE__ */ a(
|
|
3261
3261
|
Cr,
|
|
3262
3262
|
{
|
|
3263
3263
|
question: T,
|
|
3264
|
-
value:
|
|
3265
|
-
error:
|
|
3266
|
-
onChange: (f) =>
|
|
3264
|
+
value: m[T.id] ?? [],
|
|
3265
|
+
error: S[T.id],
|
|
3266
|
+
onChange: (f) => R(T.id, f)
|
|
3267
3267
|
},
|
|
3268
3268
|
T.id
|
|
3269
3269
|
)) }),
|
|
3270
|
-
/* @__PURE__ */ i(
|
|
3270
|
+
/* @__PURE__ */ i(ue, { className: "flex items-center justify-between", children: [
|
|
3271
3271
|
/* @__PURE__ */ i(
|
|
3272
3272
|
U,
|
|
3273
3273
|
{
|
|
@@ -3286,7 +3286,7 @@ const Sr = ({
|
|
|
3286
3286
|
{
|
|
3287
3287
|
type: "button",
|
|
3288
3288
|
isLoading: o,
|
|
3289
|
-
onClick:
|
|
3289
|
+
onClick: W,
|
|
3290
3290
|
children: "Continue"
|
|
3291
3291
|
}
|
|
3292
3292
|
) : /* @__PURE__ */ i(
|
|
@@ -3315,7 +3315,7 @@ const Sr = ({
|
|
|
3315
3315
|
e.subtitle && /* @__PURE__ */ a("p", { className: "text-xs", style: { color: "var(--metakyc-text-secondary, #6b7280)" }, children: e.subtitle }),
|
|
3316
3316
|
e.description && /* @__PURE__ */ a("p", { className: "text-xs", style: { color: "var(--metakyc-text-muted, #9ca3af)" }, children: e.description }),
|
|
3317
3317
|
l === "text" && /* @__PURE__ */ a(
|
|
3318
|
-
|
|
3318
|
+
de,
|
|
3319
3319
|
{
|
|
3320
3320
|
value: t[0] ?? "",
|
|
3321
3321
|
onChange: (c) => n([c.target.value]),
|
|
@@ -3325,7 +3325,7 @@ const Sr = ({
|
|
|
3325
3325
|
}
|
|
3326
3326
|
),
|
|
3327
3327
|
l === "single-select" && /* @__PURE__ */ a(
|
|
3328
|
-
|
|
3328
|
+
Ce,
|
|
3329
3329
|
{
|
|
3330
3330
|
value: t[0] ?? "",
|
|
3331
3331
|
onChange: (c) => n([c.target.value]),
|
|
@@ -3384,7 +3384,7 @@ const Sr = ({
|
|
|
3384
3384
|
type: "checkbox",
|
|
3385
3385
|
checked: t.includes(c),
|
|
3386
3386
|
onChange: (u) => {
|
|
3387
|
-
u.target.checked ? n([...t, c]) : n(t.filter((
|
|
3387
|
+
u.target.checked ? n([...t, c]) : n(t.filter((m) => m !== c));
|
|
3388
3388
|
},
|
|
3389
3389
|
className: "metakyc-option-input",
|
|
3390
3390
|
style: {
|
|
@@ -3416,14 +3416,14 @@ const Sr = ({
|
|
|
3416
3416
|
onComplete: t,
|
|
3417
3417
|
onBack: r
|
|
3418
3418
|
}) => {
|
|
3419
|
-
const { uploadDocument: n, isLoading: s, isSubmitting: l, error: o, submit: c } = lr(e), [u,
|
|
3420
|
-
if (
|
|
3419
|
+
const { uploadDocument: n, isLoading: s, isSubmitting: l, error: o, submit: c } = lr(e), [u, m] = x({}), w = async (S) => {
|
|
3420
|
+
if (S.preventDefault(), !n) return;
|
|
3421
3421
|
const y = await Promise.all(
|
|
3422
3422
|
n.uploadDocumentFiles.map(async (g) => {
|
|
3423
|
-
const
|
|
3424
|
-
|
|
3425
|
-
fileName:
|
|
3426
|
-
fileData: await Xt(
|
|
3423
|
+
const N = u[g.id] || [], b = await Promise.all(
|
|
3424
|
+
N.map(async (p) => ({
|
|
3425
|
+
fileName: p.name,
|
|
3426
|
+
fileData: await Xt(p)
|
|
3427
3427
|
}))
|
|
3428
3428
|
);
|
|
3429
3429
|
return {
|
|
@@ -3438,7 +3438,7 @@ const Sr = ({
|
|
|
3438
3438
|
};
|
|
3439
3439
|
await c(h), t == null || t();
|
|
3440
3440
|
};
|
|
3441
|
-
return s ? /* @__PURE__ */ a($, { children: /* @__PURE__ */ a(B, { children: /* @__PURE__ */ a(
|
|
3441
|
+
return s ? /* @__PURE__ */ a($, { children: /* @__PURE__ */ a(B, { children: /* @__PURE__ */ a(fe, { className: "my-8" }) }) }) : o ? /* @__PURE__ */ a($, { children: /* @__PURE__ */ a(B, { children: /* @__PURE__ */ i("p", { className: "text-danger-500", children: [
|
|
3442
3442
|
"Error loading document requirements: ",
|
|
3443
3443
|
o.message
|
|
3444
3444
|
] }) }) }) : n ? /* @__PURE__ */ a("form", { onSubmit: w, children: /* @__PURE__ */ i($, { children: [
|
|
@@ -3446,21 +3446,21 @@ const Sr = ({
|
|
|
3446
3446
|
/* @__PURE__ */ a("h2", { className: "text-lg font-bold", children: n.displayName }),
|
|
3447
3447
|
n.subtitle && /* @__PURE__ */ a("p", { className: "text-gray-600 dark:text-gray-400 mt-1", children: n.subtitle })
|
|
3448
3448
|
] }),
|
|
3449
|
-
/* @__PURE__ */ a(B, { className: "space-y-6", children: n.uploadDocumentFiles.map((
|
|
3449
|
+
/* @__PURE__ */ a(B, { className: "space-y-6", children: n.uploadDocumentFiles.map((S) => /* @__PURE__ */ a(
|
|
3450
3450
|
pr,
|
|
3451
3451
|
{
|
|
3452
|
-
label:
|
|
3453
|
-
accept:
|
|
3454
|
-
multiple:
|
|
3455
|
-
maxSize:
|
|
3456
|
-
value: u[
|
|
3452
|
+
label: S.displayName,
|
|
3453
|
+
accept: S.allowedTypes,
|
|
3454
|
+
multiple: S.multipleFile,
|
|
3455
|
+
maxSize: S.maxEachFileSizeByte,
|
|
3456
|
+
value: u[S.id] || [],
|
|
3457
3457
|
onChange: (y) => {
|
|
3458
|
-
|
|
3458
|
+
m((h) => ({ ...h, [S.id]: y }));
|
|
3459
3459
|
}
|
|
3460
3460
|
},
|
|
3461
|
-
|
|
3461
|
+
S.id
|
|
3462
3462
|
)) }),
|
|
3463
|
-
/* @__PURE__ */ i(
|
|
3463
|
+
/* @__PURE__ */ i(ue, { className: "flex justify-between", children: [
|
|
3464
3464
|
r && /* @__PURE__ */ a(U, { type: "button", variant: "outline", onClick: r, children: "Back" }),
|
|
3465
3465
|
/* @__PURE__ */ a(U, { type: "submit", isLoading: l, children: "Continue" })
|
|
3466
3466
|
] })
|
|
@@ -3469,7 +3469,7 @@ const Sr = ({
|
|
|
3469
3469
|
const { overview: n, isLoading: s, isSubmitting: l, error: o, passOverview: c } = or(e), u = async () => {
|
|
3470
3470
|
await c(), t == null || t();
|
|
3471
3471
|
};
|
|
3472
|
-
return s ? /* @__PURE__ */ a($, { children: /* @__PURE__ */ a(B, { children: /* @__PURE__ */ a(
|
|
3472
|
+
return s ? /* @__PURE__ */ a($, { children: /* @__PURE__ */ a(B, { children: /* @__PURE__ */ a(fe, { className: "my-8" }) }) }) : o ? /* @__PURE__ */ a($, { children: /* @__PURE__ */ a(B, { children: /* @__PURE__ */ i("p", { className: "text-danger-500", children: [
|
|
3473
3473
|
"Error loading overview: ",
|
|
3474
3474
|
o.message
|
|
3475
3475
|
] }) }) }) : n ? /* @__PURE__ */ i($, { children: [
|
|
@@ -3477,8 +3477,8 @@ const Sr = ({
|
|
|
3477
3477
|
/* @__PURE__ */ a("h2", { className: "text-lg font-bold", children: n.title || "Overview" }),
|
|
3478
3478
|
n.description && /* @__PURE__ */ a("p", { className: "text-gray-600 dark:text-gray-400 mt-1", children: n.description })
|
|
3479
3479
|
] }),
|
|
3480
|
-
/* @__PURE__ */ a(B, { className: "space-y-8", children: n.steps && n.steps.length > 0 ? n.steps.sort((
|
|
3481
|
-
/* @__PURE__ */ a("div", { className: "metakyc-step-icon flex-shrink-0", children: /* @__PURE__ */ a("div", { className: "w-8 h-8 rounded-full bg-primary-500 text-white flex items-center justify-center font-medium text-sm", children:
|
|
3480
|
+
/* @__PURE__ */ a(B, { className: "space-y-8", children: n.steps && n.steps.length > 0 ? n.steps.sort((m, w) => m.order - w.order).map((m) => /* @__PURE__ */ i("div", { className: "metakyc-overview-step-item flex items-center space-x-3", children: [
|
|
3481
|
+
/* @__PURE__ */ a("div", { className: "metakyc-step-icon flex-shrink-0", children: /* @__PURE__ */ a("div", { className: "w-8 h-8 rounded-full bg-primary-500 text-white flex items-center justify-center font-medium text-sm", children: m.order + 1 }) }),
|
|
3482
3482
|
/* @__PURE__ */ i(
|
|
3483
3483
|
"div",
|
|
3484
3484
|
{
|
|
@@ -3490,13 +3490,13 @@ const Sr = ({
|
|
|
3490
3490
|
background: "transparent"
|
|
3491
3491
|
},
|
|
3492
3492
|
children: [
|
|
3493
|
-
/* @__PURE__ */ a("span", { className: "metakyc-step-title text-sm font-semibold text-gray-900 dark:text-white", children:
|
|
3494
|
-
|
|
3493
|
+
/* @__PURE__ */ a("span", { className: "metakyc-step-title text-sm font-semibold text-gray-900 dark:text-white", children: m.title }),
|
|
3494
|
+
m.description && /* @__PURE__ */ a("p", { className: "metakyc-step-description text-sm text-gray-600 dark:text-gray-400", children: m.description })
|
|
3495
3495
|
]
|
|
3496
3496
|
}
|
|
3497
3497
|
)
|
|
3498
|
-
] },
|
|
3499
|
-
/* @__PURE__ */ i(
|
|
3498
|
+
] }, m.order)) : /* @__PURE__ */ a("div", { className: "text-center py-8", children: /* @__PURE__ */ a("p", { className: "text-gray-600 dark:text-gray-400", children: "Loading overview data..." }) }) }),
|
|
3499
|
+
/* @__PURE__ */ i(ue, { className: "flex justify-between", children: [
|
|
3500
3500
|
r && /* @__PURE__ */ a(U, { type: "button", variant: "outline", onClick: r, children: "Back" }),
|
|
3501
3501
|
/* @__PURE__ */ a(U, { onClick: u, isLoading: l, children: "Continue" })
|
|
3502
3502
|
] })
|
|
@@ -3514,7 +3514,7 @@ function Er(e, t) {
|
|
|
3514
3514
|
return e.errorMessage || "Invalid format";
|
|
3515
3515
|
} catch {
|
|
3516
3516
|
}
|
|
3517
|
-
const s = e.valueDataType ===
|
|
3517
|
+
const s = e.valueDataType === Se.Integer || e.valueDataType === Se.Decimal || e.valueDataType === Se.DigitOnly;
|
|
3518
3518
|
if (s && n.trim() !== "") {
|
|
3519
3519
|
const l = Number(n);
|
|
3520
3520
|
if (!isNaN(l)) {
|
|
@@ -3547,50 +3547,50 @@ const Dr = ({
|
|
|
3547
3547
|
onComplete: t,
|
|
3548
3548
|
onBack: r
|
|
3549
3549
|
}) => {
|
|
3550
|
-
const { criteria: n, initialAnswers: s, isLoading: l, isSubmitting: o, error: c, submit: u } = dr(e), [
|
|
3551
|
-
|
|
3552
|
-
s && Object.keys(s).length > 0 && Object.keys(
|
|
3550
|
+
const { criteria: n, initialAnswers: s, isLoading: l, isSubmitting: o, error: c, submit: u } = dr(e), [m, w] = x({}), [S, y] = x({}), [h, g] = x(0), [N, b] = x(!1);
|
|
3551
|
+
he.useEffect(() => {
|
|
3552
|
+
s && Object.keys(s).length > 0 && Object.keys(m).length === 0 && w(s);
|
|
3553
3553
|
}, [s]);
|
|
3554
|
-
const
|
|
3554
|
+
const p = Re(
|
|
3555
3555
|
() => n && n.length > 0 ? Rr(n) : [],
|
|
3556
3556
|
[n]
|
|
3557
|
-
),
|
|
3558
|
-
|
|
3559
|
-
!l && n && n.length === 0 && !
|
|
3560
|
-
}, [l, n,
|
|
3561
|
-
const v =
|
|
3562
|
-
w((
|
|
3563
|
-
const
|
|
3564
|
-
return delete
|
|
3557
|
+
), R = h === p.length - 1, C = p[h] ?? [];
|
|
3558
|
+
he.useEffect(() => {
|
|
3559
|
+
!l && n && n.length === 0 && !N && !o && (b(!0), u({ applicantId: e, criteriaValueInputs: [] }).then(() => t == null ? void 0 : t()).catch(console.error));
|
|
3560
|
+
}, [l, n, N, o, u, e, t]);
|
|
3561
|
+
const v = Q((A, F) => {
|
|
3562
|
+
w((Y) => ({ ...Y, [A]: F })), y((Y) => {
|
|
3563
|
+
const H = { ...Y };
|
|
3564
|
+
return delete H[A], H;
|
|
3565
3565
|
});
|
|
3566
|
-
}, []), q =
|
|
3566
|
+
}, []), q = Q(() => {
|
|
3567
3567
|
const A = {};
|
|
3568
|
-
for (const { criterion:
|
|
3569
|
-
const
|
|
3570
|
-
|
|
3568
|
+
for (const { criterion: F } of C) {
|
|
3569
|
+
const Y = Er(F, m[F.id] ?? []);
|
|
3570
|
+
Y && (A[F.id] = Y);
|
|
3571
3571
|
}
|
|
3572
|
-
return y((
|
|
3573
|
-
}, [
|
|
3572
|
+
return y((F) => ({ ...F, ...A })), Object.keys(A).length === 0;
|
|
3573
|
+
}, [C, m]), W = () => {
|
|
3574
3574
|
q() && g((A) => A + 1);
|
|
3575
3575
|
}, T = () => {
|
|
3576
3576
|
h > 0 ? g((A) => A - 1) : r == null || r();
|
|
3577
3577
|
}, f = async () => {
|
|
3578
3578
|
if (!(!q() || !n))
|
|
3579
3579
|
try {
|
|
3580
|
-
const A = n.map((
|
|
3581
|
-
const
|
|
3582
|
-
return
|
|
3583
|
-
}).filter((
|
|
3580
|
+
const A = n.map((Y) => {
|
|
3581
|
+
const H = (m[Y.id] ?? []).filter((P) => P && P.trim());
|
|
3582
|
+
return H.length > 0 ? { riskCriteriaId: Y.id, values: H } : null;
|
|
3583
|
+
}).filter((Y) => Y !== null);
|
|
3584
3584
|
await u({ applicantId: e, criteriaValueInputs: A }), t == null || t();
|
|
3585
3585
|
} catch (A) {
|
|
3586
3586
|
console.error("Risk scoring submit error:", A);
|
|
3587
3587
|
}
|
|
3588
3588
|
};
|
|
3589
3589
|
return l ? /* @__PURE__ */ a($, { children: /* @__PURE__ */ i(B, { children: [
|
|
3590
|
-
/* @__PURE__ */ a(
|
|
3590
|
+
/* @__PURE__ */ a(fe, { className: "my-8" }),
|
|
3591
3591
|
/* @__PURE__ */ a("p", { className: "text-center text-sm mt-4", style: { color: "var(--metakyc-text-secondary, #6b7280)" }, children: "Loading risk scoring criteria…" })
|
|
3592
3592
|
] }) }) : !l && n && n.length === 0 ? /* @__PURE__ */ a($, { children: /* @__PURE__ */ i(B, { children: [
|
|
3593
|
-
/* @__PURE__ */ a(
|
|
3593
|
+
/* @__PURE__ */ a(fe, { className: "my-8" }),
|
|
3594
3594
|
/* @__PURE__ */ a("p", { className: "text-center text-sm mt-4", style: { color: "var(--metakyc-text-secondary, #6b7280)" }, children: "No criteria required. Moving to next step…" })
|
|
3595
3595
|
] }) }) : c ? /* @__PURE__ */ a($, { children: /* @__PURE__ */ a(B, { children: /* @__PURE__ */ i("p", { className: "text-danger-500", children: [
|
|
3596
3596
|
"Error loading criteria: ",
|
|
@@ -3599,38 +3599,38 @@ const Dr = ({
|
|
|
3599
3599
|
/* @__PURE__ */ i(oe, { children: [
|
|
3600
3600
|
/* @__PURE__ */ a("h2", { className: "text-lg font-bold", children: "Risk Assessment" }),
|
|
3601
3601
|
/* @__PURE__ */ a("p", { className: "text-sm", style: { color: "var(--metakyc-text-secondary, #6b7280)" }, children: "Please answer the following questions for risk evaluation" }),
|
|
3602
|
-
|
|
3602
|
+
p.length > 1 && /* @__PURE__ */ i("div", { className: "flex items-center justify-between mt-3", children: [
|
|
3603
3603
|
/* @__PURE__ */ i("span", { className: "text-xs", style: { color: "var(--metakyc-text-muted, #9ca3af)" }, children: [
|
|
3604
3604
|
"Page ",
|
|
3605
3605
|
h + 1,
|
|
3606
3606
|
" of ",
|
|
3607
|
-
|
|
3607
|
+
p.length
|
|
3608
3608
|
] }),
|
|
3609
|
-
/* @__PURE__ */ a("div", { className: "flex items-center gap-1.5", children:
|
|
3609
|
+
/* @__PURE__ */ a("div", { className: "flex items-center gap-1.5", children: p.map((A, F) => /* @__PURE__ */ a(
|
|
3610
3610
|
"div",
|
|
3611
3611
|
{
|
|
3612
3612
|
className: "rounded-full transition-all duration-200",
|
|
3613
3613
|
style: {
|
|
3614
3614
|
height: "6px",
|
|
3615
|
-
width:
|
|
3616
|
-
backgroundColor:
|
|
3615
|
+
width: F === h ? "20px" : "6px",
|
|
3616
|
+
backgroundColor: F <= h ? "var(--metakyc-primary, #2563eb)" : "var(--metakyc-border, #e5e7eb)"
|
|
3617
3617
|
}
|
|
3618
3618
|
},
|
|
3619
|
-
|
|
3619
|
+
F
|
|
3620
3620
|
)) })
|
|
3621
3621
|
] })
|
|
3622
3622
|
] }),
|
|
3623
|
-
/* @__PURE__ */ a(B, { className: "space-y-6", children:
|
|
3623
|
+
/* @__PURE__ */ a(B, { className: "space-y-6", children: C.map(({ criterion: A }) => /* @__PURE__ */ a(
|
|
3624
3624
|
Pr,
|
|
3625
3625
|
{
|
|
3626
3626
|
criterion: A,
|
|
3627
|
-
value:
|
|
3628
|
-
error:
|
|
3629
|
-
onChange: (
|
|
3627
|
+
value: m[A.id] ?? [],
|
|
3628
|
+
error: S[A.id],
|
|
3629
|
+
onChange: (F) => v(A.id, F)
|
|
3630
3630
|
},
|
|
3631
3631
|
A.id
|
|
3632
3632
|
)) }),
|
|
3633
|
-
/* @__PURE__ */ i(
|
|
3633
|
+
/* @__PURE__ */ i(ue, { className: "flex items-center justify-between", children: [
|
|
3634
3634
|
/* @__PURE__ */ i(
|
|
3635
3635
|
U,
|
|
3636
3636
|
{
|
|
@@ -3644,11 +3644,11 @@ const Dr = ({
|
|
|
3644
3644
|
]
|
|
3645
3645
|
}
|
|
3646
3646
|
),
|
|
3647
|
-
|
|
3647
|
+
R ? /* @__PURE__ */ a(U, { type: "button", isLoading: o, onClick: f, children: "Continue" }) : /* @__PURE__ */ i(
|
|
3648
3648
|
U,
|
|
3649
3649
|
{
|
|
3650
3650
|
type: "button",
|
|
3651
|
-
onClick:
|
|
3651
|
+
onClick: W,
|
|
3652
3652
|
style: { display: "flex", alignItems: "center", gap: "4px" },
|
|
3653
3653
|
children: [
|
|
3654
3654
|
"Next",
|
|
@@ -3660,7 +3660,7 @@ const Dr = ({
|
|
|
3660
3660
|
c && /* @__PURE__ */ a("div", { className: "mx-6 mb-4 p-3 bg-red-50 border border-red-200 rounded", children: /* @__PURE__ */ a("p", { className: "text-red-600 text-sm", children: c.message }) })
|
|
3661
3661
|
] }) : null;
|
|
3662
3662
|
}, Pr = ({ criterion: e, value: t, error: r, onChange: n }) => {
|
|
3663
|
-
const s = Fr(e), l = e.valueDataType ===
|
|
3663
|
+
const s = Fr(e), l = e.valueDataType === Se.Integer || e.valueDataType === Se.Decimal || e.valueDataType === Se.DigitOnly;
|
|
3664
3664
|
return /* @__PURE__ */ i("div", { className: "space-y-2", children: [
|
|
3665
3665
|
/* @__PURE__ */ i("label", { className: "block text-sm font-medium", style: { color: "var(--metakyc-text-primary, #111827)" }, children: [
|
|
3666
3666
|
e.displayName,
|
|
@@ -3669,7 +3669,7 @@ const Dr = ({
|
|
|
3669
3669
|
e.description && /* @__PURE__ */ a("p", { className: "text-xs", style: { color: "var(--metakyc-text-secondary, #6b7280)" }, children: e.description }),
|
|
3670
3670
|
l && (e.min !== void 0 || e.max !== void 0) && /* @__PURE__ */ a("p", { className: "text-xs", style: { color: "var(--metakyc-text-muted, #9ca3af)" }, children: e.min !== void 0 && e.max !== void 0 ? `Range: ${e.min} – ${e.max}` : e.min !== void 0 ? `Minimum: ${e.min}` : `Maximum: ${e.max}` }),
|
|
3671
3671
|
s === "text" && /* @__PURE__ */ a(
|
|
3672
|
-
|
|
3672
|
+
de,
|
|
3673
3673
|
{
|
|
3674
3674
|
value: t[0] ?? "",
|
|
3675
3675
|
onChange: (o) => n([o.target.value]),
|
|
@@ -3680,7 +3680,7 @@ const Dr = ({
|
|
|
3680
3680
|
min: e.min,
|
|
3681
3681
|
max: e.max,
|
|
3682
3682
|
onKeyDown: (o) => {
|
|
3683
|
-
e.valueDataType ===
|
|
3683
|
+
e.valueDataType === Se.DigitOnly && ["e", "E", "+", "-", "."].includes(o.key) && o.preventDefault();
|
|
3684
3684
|
}
|
|
3685
3685
|
}
|
|
3686
3686
|
),
|
|
@@ -3759,7 +3759,7 @@ const Dr = ({
|
|
|
3759
3759
|
r && /* @__PURE__ */ a("p", { className: "text-sm text-danger-500", children: r })
|
|
3760
3760
|
] }),
|
|
3761
3761
|
s === "country" && /* @__PURE__ */ a(
|
|
3762
|
-
|
|
3762
|
+
Ce,
|
|
3763
3763
|
{
|
|
3764
3764
|
value: t[0] ?? "",
|
|
3765
3765
|
onChange: (o) => n([o.target.value]),
|
|
@@ -3781,13 +3781,13 @@ const Dr = ({
|
|
|
3781
3781
|
onComplete: t,
|
|
3782
3782
|
onBack: r
|
|
3783
3783
|
}) => {
|
|
3784
|
-
const { investorCategorizationService: n } =
|
|
3785
|
-
return /* @__PURE__ */ a("form", { onSubmit: async (
|
|
3786
|
-
if (
|
|
3787
|
-
|
|
3784
|
+
const { investorCategorizationService: n } = pe(), [s, l] = x(null), [o, c] = x(!1), [u, m] = x(null);
|
|
3785
|
+
return /* @__PURE__ */ a("form", { onSubmit: async (S) => {
|
|
3786
|
+
if (S.preventDefault(), s === null) {
|
|
3787
|
+
m("Please select an investor type");
|
|
3788
3788
|
return;
|
|
3789
3789
|
}
|
|
3790
|
-
c(!0),
|
|
3790
|
+
c(!0), m(null);
|
|
3791
3791
|
try {
|
|
3792
3792
|
const y = {
|
|
3793
3793
|
applicantId: e,
|
|
@@ -3797,7 +3797,7 @@ const Dr = ({
|
|
|
3797
3797
|
const h = await n.setInvestorCategorization(y);
|
|
3798
3798
|
console.log("Investor categorization result:", h), t == null || t();
|
|
3799
3799
|
} catch (y) {
|
|
3800
|
-
console.error("Error submitting investor categorization:", y),
|
|
3800
|
+
console.error("Error submitting investor categorization:", y), m(y.message || "Failed to submit investor categorization");
|
|
3801
3801
|
} finally {
|
|
3802
3802
|
c(!1);
|
|
3803
3803
|
}
|
|
@@ -3813,7 +3813,7 @@ const Dr = ({
|
|
|
3813
3813
|
{
|
|
3814
3814
|
className: `
|
|
3815
3815
|
block p-4 border-2 rounded-lg cursor-pointer transition-all
|
|
3816
|
-
${s ===
|
|
3816
|
+
${s === me.Individual ? "border-primary-500 bg-primary-50 dark:bg-primary-900/20" : "border-gray-200 dark:border-gray-700 hover:border-gray-300 dark:hover:border-gray-600"}
|
|
3817
3817
|
`,
|
|
3818
3818
|
children: /* @__PURE__ */ i("div", { className: "flex items-start", children: [
|
|
3819
3819
|
/* @__PURE__ */ a(
|
|
@@ -3821,9 +3821,9 @@ const Dr = ({
|
|
|
3821
3821
|
{
|
|
3822
3822
|
type: "radio",
|
|
3823
3823
|
name: "investorType",
|
|
3824
|
-
value:
|
|
3825
|
-
checked: s ===
|
|
3826
|
-
onChange: () => l(
|
|
3824
|
+
value: me.Individual,
|
|
3825
|
+
checked: s === me.Individual,
|
|
3826
|
+
onChange: () => l(me.Individual),
|
|
3827
3827
|
className: "mt-1 h-4 w-4 text-primary-500 border-gray-300 focus:ring-primary-500"
|
|
3828
3828
|
}
|
|
3829
3829
|
),
|
|
@@ -3839,7 +3839,7 @@ const Dr = ({
|
|
|
3839
3839
|
{
|
|
3840
3840
|
className: `
|
|
3841
3841
|
block p-4 border-2 rounded-lg cursor-pointer transition-all
|
|
3842
|
-
${s ===
|
|
3842
|
+
${s === me.Sophisticated ? "border-primary-500 bg-primary-50 dark:bg-primary-900/20" : "border-gray-200 dark:border-gray-700 hover:border-gray-300 dark:hover:border-gray-600"}
|
|
3843
3843
|
`,
|
|
3844
3844
|
children: /* @__PURE__ */ i("div", { className: "flex items-start", children: [
|
|
3845
3845
|
/* @__PURE__ */ a(
|
|
@@ -3847,9 +3847,9 @@ const Dr = ({
|
|
|
3847
3847
|
{
|
|
3848
3848
|
type: "radio",
|
|
3849
3849
|
name: "investorType",
|
|
3850
|
-
value:
|
|
3851
|
-
checked: s ===
|
|
3852
|
-
onChange: () => l(
|
|
3850
|
+
value: me.Sophisticated,
|
|
3851
|
+
checked: s === me.Sophisticated,
|
|
3852
|
+
onChange: () => l(me.Sophisticated),
|
|
3853
3853
|
className: "mt-1 h-4 w-4 text-primary-500 border-gray-300 focus:ring-primary-500"
|
|
3854
3854
|
}
|
|
3855
3855
|
),
|
|
@@ -3870,7 +3870,7 @@ const Dr = ({
|
|
|
3870
3870
|
{
|
|
3871
3871
|
className: `
|
|
3872
3872
|
block p-4 border-2 rounded-lg cursor-pointer transition-all
|
|
3873
|
-
${s ===
|
|
3873
|
+
${s === me.HighNetWorth ? "border-primary-500 bg-primary-50 dark:bg-primary-900/20" : "border-gray-200 dark:border-gray-700 hover:border-gray-300 dark:hover:border-gray-600"}
|
|
3874
3874
|
`,
|
|
3875
3875
|
children: /* @__PURE__ */ i("div", { className: "flex items-start", children: [
|
|
3876
3876
|
/* @__PURE__ */ a(
|
|
@@ -3878,9 +3878,9 @@ const Dr = ({
|
|
|
3878
3878
|
{
|
|
3879
3879
|
type: "radio",
|
|
3880
3880
|
name: "investorType",
|
|
3881
|
-
value:
|
|
3882
|
-
checked: s ===
|
|
3883
|
-
onChange: () => l(
|
|
3881
|
+
value: me.HighNetWorth,
|
|
3882
|
+
checked: s === me.HighNetWorth,
|
|
3883
|
+
onChange: () => l(me.HighNetWorth),
|
|
3884
3884
|
className: "mt-1 h-4 w-4 text-primary-500 border-gray-300 focus:ring-primary-500"
|
|
3885
3885
|
}
|
|
3886
3886
|
),
|
|
@@ -3901,7 +3901,7 @@ const Dr = ({
|
|
|
3901
3901
|
u
|
|
3902
3902
|
] }) })
|
|
3903
3903
|
] }),
|
|
3904
|
-
/* @__PURE__ */ i(
|
|
3904
|
+
/* @__PURE__ */ i(ue, { className: "flex justify-between", children: [
|
|
3905
3905
|
r && /* @__PURE__ */ a(U, { type: "button", variant: "outline", onClick: r, children: "Back" }),
|
|
3906
3906
|
/* @__PURE__ */ a(
|
|
3907
3907
|
U,
|
|
@@ -3919,68 +3919,68 @@ const Dr = ({
|
|
|
3919
3919
|
onComplete: t,
|
|
3920
3920
|
onBack: r
|
|
3921
3921
|
}) => {
|
|
3922
|
-
const { appropriatenessTestService: n } =
|
|
3923
|
-
|
|
3922
|
+
const { appropriatenessTestService: n } = pe(), [s, l] = x(null), [o, c] = x(!0), [u, m] = x(!1), [w, S] = x(null), [y, h] = x({}), [g, N] = x(0), [b, p] = x(!1), [R, C] = x(!1), [v, q] = x(0);
|
|
3923
|
+
ee(() => {
|
|
3924
3924
|
(async () => {
|
|
3925
3925
|
try {
|
|
3926
|
-
c(!0),
|
|
3927
|
-
const
|
|
3928
|
-
if (console.log("Appropriateness test data:",
|
|
3929
|
-
const G =
|
|
3926
|
+
c(!0), S(null), console.log("Loading appropriateness test for applicant:", e);
|
|
3927
|
+
const E = await n.getAppropriatenessTest(e);
|
|
3928
|
+
if (console.log("Appropriateness test data:", E), l(E), E.waitTimeSpanForNextTry && E.waitTimeSpanForNextTry !== "00:00:00") {
|
|
3929
|
+
const G = W(E.waitTimeSpanForNextTry);
|
|
3930
3930
|
G > 0 && q(G);
|
|
3931
3931
|
}
|
|
3932
|
-
} catch (
|
|
3933
|
-
console.error("Error loading appropriateness test:",
|
|
3932
|
+
} catch (E) {
|
|
3933
|
+
console.error("Error loading appropriateness test:", E), S(E.message || "Failed to load appropriateness test");
|
|
3934
3934
|
} finally {
|
|
3935
3935
|
c(!1);
|
|
3936
3936
|
}
|
|
3937
3937
|
})();
|
|
3938
3938
|
}, [e, n]);
|
|
3939
|
-
const
|
|
3940
|
-
const
|
|
3941
|
-
if (
|
|
3942
|
-
const [G, K,
|
|
3943
|
-
return G * 3600 + K * 60 +
|
|
3939
|
+
const W = (P) => {
|
|
3940
|
+
const E = P.split(":").map(Number);
|
|
3941
|
+
if (E.length === 3) {
|
|
3942
|
+
const [G, K, ne] = E;
|
|
3943
|
+
return G * 3600 + K * 60 + ne;
|
|
3944
3944
|
}
|
|
3945
3945
|
return 0;
|
|
3946
3946
|
}, T = (P) => {
|
|
3947
|
-
const
|
|
3948
|
-
return `${
|
|
3947
|
+
const E = Math.floor(P / 60), G = P % 60;
|
|
3948
|
+
return `${E.toString().padStart(2, "0")}:${G.toString().padStart(2, "0")}`;
|
|
3949
3949
|
};
|
|
3950
|
-
|
|
3950
|
+
ee(() => {
|
|
3951
3951
|
if (!b || g <= 0) return;
|
|
3952
3952
|
const P = setInterval(() => {
|
|
3953
|
-
|
|
3953
|
+
N((E) => E <= 1 ? (C(!0), 0) : E - 1);
|
|
3954
3954
|
}, 1e3);
|
|
3955
3955
|
return () => clearInterval(P);
|
|
3956
|
-
}, [b, g]),
|
|
3956
|
+
}, [b, g]), ee(() => {
|
|
3957
3957
|
if (v <= 0) return;
|
|
3958
3958
|
const P = setInterval(() => {
|
|
3959
|
-
q((
|
|
3959
|
+
q((E) => E <= 1 ? 0 : E - 1);
|
|
3960
3960
|
}, 1e3);
|
|
3961
3961
|
return () => clearInterval(P);
|
|
3962
|
-
}, [v]),
|
|
3963
|
-
|
|
3964
|
-
}, [
|
|
3962
|
+
}, [v]), ee(() => {
|
|
3963
|
+
R && !u && F();
|
|
3964
|
+
}, [R]);
|
|
3965
3965
|
const f = () => {
|
|
3966
|
-
s && (
|
|
3967
|
-
}, A = (P,
|
|
3966
|
+
s && (p(!0), N(s.testDurationSec));
|
|
3967
|
+
}, A = (P, E) => {
|
|
3968
3968
|
h((G) => ({
|
|
3969
3969
|
...G,
|
|
3970
|
-
[P]:
|
|
3970
|
+
[P]: E
|
|
3971
3971
|
}));
|
|
3972
|
-
},
|
|
3972
|
+
}, F = async (P) => {
|
|
3973
3973
|
if (P && P.preventDefault(), !!s) {
|
|
3974
|
-
if (!
|
|
3975
|
-
const
|
|
3976
|
-
if (
|
|
3977
|
-
|
|
3974
|
+
if (!R) {
|
|
3975
|
+
const E = s.appropriatenessQuestions.length - Object.keys(y).length;
|
|
3976
|
+
if (E > 0) {
|
|
3977
|
+
S(`Please answer all questions. ${E} question(s) remaining.`);
|
|
3978
3978
|
return;
|
|
3979
3979
|
}
|
|
3980
3980
|
}
|
|
3981
|
-
|
|
3981
|
+
m(!0), S(null);
|
|
3982
3982
|
try {
|
|
3983
|
-
const
|
|
3983
|
+
const E = s.appropriatenessQuestions.map(
|
|
3984
3984
|
(K) => ({
|
|
3985
3985
|
appropriatenessQuestionId: K.id,
|
|
3986
3986
|
value: y[K.id] || ""
|
|
@@ -3989,41 +3989,41 @@ const Dr = ({
|
|
|
3989
3989
|
), G = {
|
|
3990
3990
|
applicantId: e,
|
|
3991
3991
|
appropriatenessTestId: s.id,
|
|
3992
|
-
appropriatenessQuestionResults:
|
|
3992
|
+
appropriatenessQuestionResults: E
|
|
3993
3993
|
};
|
|
3994
3994
|
console.log("Submitting appropriateness test:", G);
|
|
3995
3995
|
try {
|
|
3996
3996
|
const K = await n.fillAppropriatenessTest(G);
|
|
3997
|
-
console.log("Appropriateness test result:", K), K.message && (K.message.toLowerCase().includes("pass") || K.message.toLowerCase().includes("success") || K.message.toLowerCase().includes("congratulations")) ? t == null || t() : (
|
|
3997
|
+
console.log("Appropriateness test result:", K), K.message && (K.message.toLowerCase().includes("pass") || K.message.toLowerCase().includes("success") || K.message.toLowerCase().includes("congratulations")) ? t == null || t() : (S(K.message || "Test completed. Please check the result."), p(!1), C(!1), h({}), setTimeout(() => Y(), 1e3));
|
|
3998
3998
|
} catch (K) {
|
|
3999
3999
|
if (K.code === 400 && K.message) {
|
|
4000
|
-
const
|
|
4001
|
-
console.log("Test failed:",
|
|
4000
|
+
const ne = K.message;
|
|
4001
|
+
console.log("Test failed:", ne), S(ne), p(!1), C(!1), h({}), setTimeout(() => Y(), 1500);
|
|
4002
4002
|
} else
|
|
4003
4003
|
throw K;
|
|
4004
4004
|
}
|
|
4005
|
-
} catch (
|
|
4006
|
-
console.error("Error submitting appropriateness test:",
|
|
4005
|
+
} catch (E) {
|
|
4006
|
+
console.error("Error submitting appropriateness test:", E), S(E.message || "Failed to submit test. Please try again."), p(!1), C(!1), h({});
|
|
4007
4007
|
} finally {
|
|
4008
|
-
|
|
4008
|
+
m(!1);
|
|
4009
4009
|
}
|
|
4010
4010
|
}
|
|
4011
|
-
},
|
|
4011
|
+
}, Y = async () => {
|
|
4012
4012
|
try {
|
|
4013
4013
|
const P = await n.getAppropriatenessTest(e);
|
|
4014
4014
|
if (console.log("Reloaded test data:", P), l(P), P.waitTimeSpanForNextTry && P.waitTimeSpanForNextTry !== "00:00:00") {
|
|
4015
|
-
const
|
|
4016
|
-
|
|
4015
|
+
const E = W(P.waitTimeSpanForNextTry);
|
|
4016
|
+
E > 0 && q(E);
|
|
4017
4017
|
}
|
|
4018
4018
|
} catch (P) {
|
|
4019
|
-
console.error("Error reloading test data:", P),
|
|
4019
|
+
console.error("Error reloading test data:", P), S((E) => E + `
|
|
4020
4020
|
|
|
4021
4021
|
Failed to reload test data. Please refresh the page.`);
|
|
4022
4022
|
}
|
|
4023
4023
|
};
|
|
4024
4024
|
if (o)
|
|
4025
4025
|
return /* @__PURE__ */ a($, { children: /* @__PURE__ */ i(B, { children: [
|
|
4026
|
-
/* @__PURE__ */ a(
|
|
4026
|
+
/* @__PURE__ */ a(fe, { className: "my-8" }),
|
|
4027
4027
|
/* @__PURE__ */ a("p", { className: "text-center text-gray-600 dark:text-gray-400 mt-4", children: "Loading appropriateness test..." })
|
|
4028
4028
|
] }) });
|
|
4029
4029
|
if (!s)
|
|
@@ -4045,8 +4045,8 @@ Failed to reload test data. Please refresh the page.`);
|
|
|
4045
4045
|
w && /* @__PURE__ */ a("div", { className: "mt-4 p-4 bg-red-50 dark:bg-red-900/20 border border-red-200 dark:border-red-800 rounded-lg", children: /* @__PURE__ */ a("p", { className: "text-red-600 dark:text-red-400 text-sm", children: w }) })
|
|
4046
4046
|
] })
|
|
4047
4047
|
] });
|
|
4048
|
-
const
|
|
4049
|
-
return b ? /* @__PURE__ */ a("form", { onSubmit:
|
|
4048
|
+
const H = s.testAllowedMaxTry - s.totalFailedTries;
|
|
4049
|
+
return b ? /* @__PURE__ */ a("form", { onSubmit: F, children: /* @__PURE__ */ i($, { children: [
|
|
4050
4050
|
/* @__PURE__ */ a(oe, { children: /* @__PURE__ */ i("div", { className: "flex items-center justify-between", children: [
|
|
4051
4051
|
/* @__PURE__ */ i("div", { children: [
|
|
4052
4052
|
/* @__PURE__ */ a("h2", { className: "text-lg font-bold text-gray-900 dark:text-white", children: s.displayName }),
|
|
@@ -4065,20 +4065,20 @@ Failed to reload test data. Please refresh the page.`);
|
|
|
4065
4065
|
] }) }),
|
|
4066
4066
|
/* @__PURE__ */ i(B, { className: "space-y-6", children: [
|
|
4067
4067
|
/* @__PURE__ */ i("div", { className: "flex items-center justify-between mb-4", children: [
|
|
4068
|
-
/* @__PURE__ */ i(
|
|
4068
|
+
/* @__PURE__ */ i(Ne, { variant: "info", children: [
|
|
4069
4069
|
"Question ",
|
|
4070
4070
|
Object.keys(y).length,
|
|
4071
4071
|
" of ",
|
|
4072
4072
|
s.totalQuestionCount
|
|
4073
4073
|
] }),
|
|
4074
|
-
/* @__PURE__ */ i(
|
|
4075
|
-
|
|
4074
|
+
/* @__PURE__ */ i(Ne, { variant: H > 1 ? "success" : "warning", children: [
|
|
4075
|
+
H,
|
|
4076
4076
|
" attempt",
|
|
4077
|
-
|
|
4077
|
+
H !== 1 ? "s" : "",
|
|
4078
4078
|
" remaining"
|
|
4079
4079
|
] })
|
|
4080
4080
|
] }),
|
|
4081
|
-
s.appropriatenessQuestions.map((P,
|
|
4081
|
+
s.appropriatenessQuestions.map((P, E) => /* @__PURE__ */ i(
|
|
4082
4082
|
"div",
|
|
4083
4083
|
{
|
|
4084
4084
|
className: "p-4 border border-gray-200 dark:border-gray-700 rounded-lg",
|
|
@@ -4086,7 +4086,7 @@ Failed to reload test data. Please refresh the page.`);
|
|
|
4086
4086
|
/* @__PURE__ */ i("div", { className: "mb-4", children: [
|
|
4087
4087
|
/* @__PURE__ */ i("span", { className: "inline-block px-2 py-1 text-xs font-semibold text-primary-700 bg-primary-100 dark:text-primary-300 dark:bg-primary-900/30 rounded mb-2", children: [
|
|
4088
4088
|
"Question ",
|
|
4089
|
-
|
|
4089
|
+
E + 1
|
|
4090
4090
|
] }),
|
|
4091
4091
|
P.groupName && /* @__PURE__ */ a("span", { className: "ml-2 text-xs text-gray-500 dark:text-gray-400", children: P.groupName }),
|
|
4092
4092
|
/* @__PURE__ */ a("h3", { className: "text-lg font-semibold text-gray-900 dark:text-white mt-2", children: P.question })
|
|
@@ -4106,7 +4106,7 @@ Failed to reload test data. Please refresh the page.`);
|
|
|
4106
4106
|
name: `question-${P.id}`,
|
|
4107
4107
|
value: G,
|
|
4108
4108
|
checked: y[P.id] === G,
|
|
4109
|
-
onChange: (
|
|
4109
|
+
onChange: (ne) => A(P.id, ne.target.value),
|
|
4110
4110
|
className: "h-4 w-4 text-primary-500 border-gray-300 focus:ring-primary-500",
|
|
4111
4111
|
disabled: u
|
|
4112
4112
|
}
|
|
@@ -4120,17 +4120,17 @@ Failed to reload test data. Please refresh the page.`);
|
|
|
4120
4120
|
},
|
|
4121
4121
|
P.id
|
|
4122
4122
|
)),
|
|
4123
|
-
w && !
|
|
4123
|
+
w && !R && /* @__PURE__ */ a("div", { className: "p-4 bg-red-50 dark:bg-red-900/20 border border-red-200 dark:border-red-800 rounded-lg", children: /* @__PURE__ */ i("p", { className: "text-red-600 dark:text-red-400 text-sm", children: [
|
|
4124
4124
|
/* @__PURE__ */ a("strong", { children: "Error:" }),
|
|
4125
4125
|
" ",
|
|
4126
4126
|
w
|
|
4127
4127
|
] }) }),
|
|
4128
|
-
|
|
4128
|
+
R && /* @__PURE__ */ a("div", { className: "p-4 bg-yellow-50 dark:bg-yellow-900/20 border border-yellow-200 dark:border-yellow-800 rounded-lg", children: /* @__PURE__ */ i("p", { className: "text-yellow-700 dark:text-yellow-400 text-sm", children: [
|
|
4129
4129
|
/* @__PURE__ */ a("strong", { children: "Time's up!" }),
|
|
4130
4130
|
" Your answers are being submitted automatically."
|
|
4131
4131
|
] }) })
|
|
4132
4132
|
] }),
|
|
4133
|
-
/* @__PURE__ */ i(
|
|
4133
|
+
/* @__PURE__ */ i(ue, { className: "flex justify-between", children: [
|
|
4134
4134
|
/* @__PURE__ */ a(
|
|
4135
4135
|
U,
|
|
4136
4136
|
{
|
|
@@ -4147,7 +4147,7 @@ Failed to reload test data. Please refresh the page.`);
|
|
|
4147
4147
|
type: "submit",
|
|
4148
4148
|
isLoading: u,
|
|
4149
4149
|
disabled: Object.keys(y).length < s.totalQuestionCount,
|
|
4150
|
-
children:
|
|
4150
|
+
children: R ? "Submitting..." : "Submit Test"
|
|
4151
4151
|
}
|
|
4152
4152
|
)
|
|
4153
4153
|
] })
|
|
@@ -4161,19 +4161,19 @@ Failed to reload test data. Please refresh the page.`);
|
|
|
4161
4161
|
/* @__PURE__ */ i("div", { className: "space-y-4 mb-6", children: [
|
|
4162
4162
|
/* @__PURE__ */ i("div", { className: "flex items-center justify-between p-4 bg-blue-50 dark:bg-blue-900/20 rounded-lg", children: [
|
|
4163
4163
|
/* @__PURE__ */ a("span", { className: "text-gray-700 dark:text-gray-300 font-medium", children: "Total Questions:" }),
|
|
4164
|
-
/* @__PURE__ */ a(
|
|
4164
|
+
/* @__PURE__ */ a(Ne, { variant: "info", children: s.totalQuestionCount })
|
|
4165
4165
|
] }),
|
|
4166
4166
|
/* @__PURE__ */ i("div", { className: "flex items-center justify-between p-4 bg-blue-50 dark:bg-blue-900/20 rounded-lg", children: [
|
|
4167
4167
|
/* @__PURE__ */ a("span", { className: "text-gray-700 dark:text-gray-300 font-medium", children: "Time Limit:" }),
|
|
4168
|
-
/* @__PURE__ */ a(
|
|
4168
|
+
/* @__PURE__ */ a(Ne, { variant: "info", children: T(s.testDurationSec) })
|
|
4169
4169
|
] }),
|
|
4170
4170
|
/* @__PURE__ */ i("div", { className: "flex items-center justify-between p-4 bg-blue-50 dark:bg-blue-900/20 rounded-lg", children: [
|
|
4171
4171
|
/* @__PURE__ */ a("span", { className: "text-gray-700 dark:text-gray-300 font-medium", children: "Correct Answers Required:" }),
|
|
4172
|
-
/* @__PURE__ */ a(
|
|
4172
|
+
/* @__PURE__ */ a(Ne, { variant: "info", children: s.testCorrectAnswerPassLimit })
|
|
4173
4173
|
] }),
|
|
4174
4174
|
/* @__PURE__ */ i("div", { className: "flex items-center justify-between p-4 bg-blue-50 dark:bg-blue-900/20 rounded-lg", children: [
|
|
4175
4175
|
/* @__PURE__ */ a("span", { className: "text-gray-700 dark:text-gray-300 font-medium", children: "Attempts Remaining:" }),
|
|
4176
|
-
/* @__PURE__ */ a(
|
|
4176
|
+
/* @__PURE__ */ a(Ne, { variant: H > 1 ? "success" : "warning", children: H })
|
|
4177
4177
|
] })
|
|
4178
4178
|
] }),
|
|
4179
4179
|
w && /* @__PURE__ */ a("div", { className: "mb-4 p-4 bg-red-50 dark:bg-red-900/20 border border-red-200 dark:border-red-800 rounded-lg", children: /* @__PURE__ */ i("p", { className: "text-red-600 dark:text-red-400 text-sm", children: [
|
|
@@ -4181,16 +4181,16 @@ Failed to reload test data. Please refresh the page.`);
|
|
|
4181
4181
|
" ",
|
|
4182
4182
|
w
|
|
4183
4183
|
] }) }),
|
|
4184
|
-
|
|
4184
|
+
H <= 0 && /* @__PURE__ */ a("div", { className: "p-4 bg-red-50 dark:bg-red-900/20 border border-red-200 dark:border-red-800 rounded-lg", children: /* @__PURE__ */ a("p", { className: "text-red-600 dark:text-red-400", children: "You have used all your attempts. Please contact support for assistance." }) })
|
|
4185
4185
|
] }),
|
|
4186
|
-
/* @__PURE__ */ i(
|
|
4186
|
+
/* @__PURE__ */ i(ue, { className: "flex justify-between", children: [
|
|
4187
4187
|
r && /* @__PURE__ */ a(U, { type: "button", variant: "outline", onClick: r, children: "Back" }),
|
|
4188
4188
|
/* @__PURE__ */ a(
|
|
4189
4189
|
U,
|
|
4190
4190
|
{
|
|
4191
4191
|
type: "button",
|
|
4192
4192
|
onClick: f,
|
|
4193
|
-
disabled:
|
|
4193
|
+
disabled: H <= 0,
|
|
4194
4194
|
children: "Start Test"
|
|
4195
4195
|
}
|
|
4196
4196
|
)
|
|
@@ -4201,8 +4201,8 @@ Failed to reload test data. Please refresh the page.`);
|
|
|
4201
4201
|
onComplete: t,
|
|
4202
4202
|
onBack: r
|
|
4203
4203
|
}) => {
|
|
4204
|
-
var G, K,
|
|
4205
|
-
const { applicantService: n, baseInformationService: s, config: l } =
|
|
4204
|
+
var G, K, ne, ve;
|
|
4205
|
+
const { applicantService: n, baseInformationService: s, config: l } = pe(), { identityData: o, provider: c, token: u, isLoading: m, error: w, requestIdentity: S, restartIdentity: y } = cr(e), [h, g] = x(null), [N, b] = x(null), [p, R] = x([]), [C, v] = x(!0), [q, W] = x(!1), [T, f] = x(null), [A, F] = x(!1), Y = he.useRef(!1), H = pt({
|
|
4206
4206
|
defaultValues: {
|
|
4207
4207
|
street: "",
|
|
4208
4208
|
streetNumber: "",
|
|
@@ -4213,21 +4213,21 @@ Failed to reload test data. Please refresh the page.`);
|
|
|
4213
4213
|
phonenumber: ""
|
|
4214
4214
|
}
|
|
4215
4215
|
});
|
|
4216
|
-
|
|
4216
|
+
ee(() => {
|
|
4217
4217
|
(async () => {
|
|
4218
4218
|
try {
|
|
4219
|
-
const [L,
|
|
4219
|
+
const [L, te] = await Promise.all([
|
|
4220
4220
|
n.getApplicantData(e),
|
|
4221
4221
|
s.getCountries("", "en")
|
|
4222
4222
|
]);
|
|
4223
4223
|
b(L);
|
|
4224
|
-
const Z = /* @__PURE__ */ new Set(),
|
|
4225
|
-
const Le =
|
|
4224
|
+
const Z = /* @__PURE__ */ new Set(), re = te.filter((xe) => {
|
|
4225
|
+
const Le = xe.abbreviation3 || xe.abbreviation;
|
|
4226
4226
|
return !Le || Z.has(Le) ? !1 : (Z.add(Le), !0);
|
|
4227
4227
|
});
|
|
4228
|
-
|
|
4228
|
+
R(re);
|
|
4229
4229
|
const j = L.applicantRequestData;
|
|
4230
|
-
if (
|
|
4230
|
+
if (H.reset({
|
|
4231
4231
|
street: (j == null ? void 0 : j.street) || "",
|
|
4232
4232
|
streetNumber: (j == null ? void 0 : j.streetNumber) || "",
|
|
4233
4233
|
city: (j == null ? void 0 : j.city) || "",
|
|
@@ -4235,12 +4235,12 @@ Failed to reload test data. Please refresh the page.`);
|
|
|
4235
4235
|
country: (j == null ? void 0 : j.country) || "",
|
|
4236
4236
|
nationality: (j == null ? void 0 : j.nationality) || "",
|
|
4237
4237
|
phonenumber: (j == null ? void 0 : j.phonenumber) || ""
|
|
4238
|
-
}), L.kycRecords && L.kycRecords.length > 0 && L.kycRecords[0].providerTokenObject !== null && !
|
|
4239
|
-
console.log("[Identity] Found existing identity verification, auto-requesting..."),
|
|
4238
|
+
}), L.kycRecords && L.kycRecords.length > 0 && L.kycRecords[0].providerTokenObject !== null && !Y.current) {
|
|
4239
|
+
console.log("[Identity] Found existing identity verification, auto-requesting..."), Y.current = !0;
|
|
4240
4240
|
try {
|
|
4241
|
-
await
|
|
4242
|
-
} catch (
|
|
4243
|
-
console.error("[Identity] Auto-request failed:",
|
|
4241
|
+
await S(), W(!0);
|
|
4242
|
+
} catch (xe) {
|
|
4243
|
+
console.error("[Identity] Auto-request failed:", xe);
|
|
4244
4244
|
}
|
|
4245
4245
|
}
|
|
4246
4246
|
} catch (L) {
|
|
@@ -4249,14 +4249,14 @@ Failed to reload test data. Please refresh the page.`);
|
|
|
4249
4249
|
v(!1);
|
|
4250
4250
|
}
|
|
4251
4251
|
})();
|
|
4252
|
-
}, [e]),
|
|
4253
|
-
o && !q && (console.log("[Identity] Identity data already loaded, showing provider"),
|
|
4254
|
-
}, [o, q]),
|
|
4252
|
+
}, [e]), ee(() => {
|
|
4253
|
+
o && !q && (console.log("[Identity] Identity data already loaded, showing provider"), W(!0));
|
|
4254
|
+
}, [o, q]), ee(() => {
|
|
4255
4255
|
if (u) {
|
|
4256
4256
|
if (u.expiresAt) {
|
|
4257
4257
|
const O = new Date(u.expiresAt).getTime();
|
|
4258
4258
|
if (Date.now() >= O) {
|
|
4259
|
-
console.warn("[Identity] Token has expired (expiresAt)"),
|
|
4259
|
+
console.warn("[Identity] Token has expired (expiresAt)"), F(!0), f("Your verification session has expired. Please restart.");
|
|
4260
4260
|
return;
|
|
4261
4261
|
}
|
|
4262
4262
|
}
|
|
@@ -4264,24 +4264,24 @@ Failed to reload test data. Please refresh the page.`);
|
|
|
4264
4264
|
try {
|
|
4265
4265
|
const L = new URL(u.url).toString().toLowerCase();
|
|
4266
4266
|
if (L.includes("expired") || L.includes("invalid") || L.includes("error")) {
|
|
4267
|
-
console.warn("[Identity] Token URL indicates expiration"),
|
|
4267
|
+
console.warn("[Identity] Token URL indicates expiration"), F(!0), f("Your verification link has expired. Please restart.");
|
|
4268
4268
|
return;
|
|
4269
4269
|
}
|
|
4270
4270
|
} catch {
|
|
4271
4271
|
console.error("[Identity] Invalid token URL");
|
|
4272
4272
|
}
|
|
4273
4273
|
if (u.status === "expired" || u.error === "expired" || u.expired === !0) {
|
|
4274
|
-
console.warn("[Identity] Token object indicates expiration"),
|
|
4274
|
+
console.warn("[Identity] Token object indicates expiration"), F(!0), f("Your verification session has expired. Please restart.");
|
|
4275
4275
|
return;
|
|
4276
4276
|
}
|
|
4277
4277
|
}
|
|
4278
|
-
}, [u]),
|
|
4278
|
+
}, [u]), ee(() => {
|
|
4279
4279
|
if (c !== null && u && !h && q && !A) {
|
|
4280
4280
|
const O = c;
|
|
4281
4281
|
if (u.url) {
|
|
4282
4282
|
console.log("[Identity] Loading provider URL for user verification:", u.url), f(null);
|
|
4283
4283
|
try {
|
|
4284
|
-
if (new URL(u.url), O ===
|
|
4284
|
+
if (new URL(u.url), O === ge.SardinAI) {
|
|
4285
4285
|
console.log("[SardinAI] Initializing Risk SDK in background...");
|
|
4286
4286
|
try {
|
|
4287
4287
|
const L = De.parseProviderConfig(c, u, l);
|
|
@@ -4296,23 +4296,23 @@ Failed to reload test data. Please refresh the page.`);
|
|
|
4296
4296
|
}
|
|
4297
4297
|
g({ type: "url", url: u.url });
|
|
4298
4298
|
} catch (L) {
|
|
4299
|
-
console.error("[Identity] Invalid URL:", L), f("Invalid verification URL. Please restart."),
|
|
4299
|
+
console.error("[Identity] Invalid URL:", L), f("Invalid verification URL. Please restart."), F(!0);
|
|
4300
4300
|
}
|
|
4301
4301
|
return;
|
|
4302
4302
|
}
|
|
4303
|
-
if (O ===
|
|
4303
|
+
if (O === ge.SardinAI) {
|
|
4304
4304
|
console.log("[SardinAI] No URL provided - initializing Risk SDK only..."), f(null);
|
|
4305
4305
|
try {
|
|
4306
|
-
const L = De.parseProviderConfig(c, u, l),
|
|
4307
|
-
|
|
4308
|
-
console.log("[SardinAI] Risk SDK initialized successfully"), g(
|
|
4306
|
+
const L = De.parseProviderConfig(c, u, l), te = De.createProvider(c, L);
|
|
4307
|
+
te.initialize().then(() => {
|
|
4308
|
+
console.log("[SardinAI] Risk SDK initialized successfully"), g(te), setTimeout(() => {
|
|
4309
4309
|
t == null || t();
|
|
4310
4310
|
}, 2e3);
|
|
4311
4311
|
}).catch((Z) => {
|
|
4312
4312
|
var j;
|
|
4313
4313
|
console.error("[SardinAI] Failed to initialize:", Z);
|
|
4314
|
-
const
|
|
4315
|
-
|
|
4314
|
+
const re = ((j = Z.message) == null ? void 0 : j.toLowerCase()) || "";
|
|
4315
|
+
re.includes("expired") || re.includes("invalid") || re.includes("401") || re.includes("400") ? (F(!0), f("Session expired or invalid. Please restart verification.")) : f(`Failed to initialize: ${Z.message}`);
|
|
4316
4316
|
});
|
|
4317
4317
|
} catch (L) {
|
|
4318
4318
|
console.error("[SardinAI] Error creating provider:", L), f(`Configuration error: ${L.message}`);
|
|
@@ -4321,15 +4321,15 @@ Failed to reload test data. Please refresh the page.`);
|
|
|
4321
4321
|
}
|
|
4322
4322
|
try {
|
|
4323
4323
|
f(null);
|
|
4324
|
-
const L = De.parseProviderConfig(c, u, l),
|
|
4325
|
-
O ===
|
|
4326
|
-
var
|
|
4327
|
-
console.error("[Sumsub] Initialization error:", Z), f(`Failed to initialize: ${Z.message}`), (
|
|
4328
|
-
}),
|
|
4324
|
+
const L = De.parseProviderConfig(c, u, l), te = De.createProvider(c, L);
|
|
4325
|
+
O === ge.Sumsub ? (te.initialize("identity-container").catch((Z) => {
|
|
4326
|
+
var re;
|
|
4327
|
+
console.error("[Sumsub] Initialization error:", Z), f(`Failed to initialize: ${Z.message}`), (re = Z.message) != null && re.toLowerCase().includes("expired") && F(!0);
|
|
4328
|
+
}), te.onComplete && te.onComplete(() => {
|
|
4329
4329
|
t == null || t();
|
|
4330
|
-
})) : O ===
|
|
4330
|
+
})) : O === ge.Onfido && te.initialize("identity-container").catch((Z) => {
|
|
4331
4331
|
console.error("[Onfido] Initialization error:", Z), f(`Failed to initialize: ${Z.message}`);
|
|
4332
|
-
}), g(
|
|
4332
|
+
}), g(te);
|
|
4333
4333
|
} catch (L) {
|
|
4334
4334
|
console.error("[Identity] Provider setup error:", L), f(`Setup error: ${L.message}`);
|
|
4335
4335
|
}
|
|
@@ -4345,20 +4345,20 @@ Failed to reload test data. Please refresh the page.`);
|
|
|
4345
4345
|
}, [c, u, h, q, t, A]);
|
|
4346
4346
|
const P = async () => {
|
|
4347
4347
|
try {
|
|
4348
|
-
f(null),
|
|
4348
|
+
f(null), F(!1), await S(), W(!0);
|
|
4349
4349
|
} catch (O) {
|
|
4350
4350
|
console.error("Error starting identity verification:", O);
|
|
4351
4351
|
}
|
|
4352
|
-
},
|
|
4352
|
+
}, E = async () => {
|
|
4353
4353
|
try {
|
|
4354
|
-
f(null),
|
|
4354
|
+
f(null), F(!1), g(null), console.log("[Identity] Restarting verification..."), await y(), W(!0);
|
|
4355
4355
|
} catch (O) {
|
|
4356
4356
|
console.error("Error restarting identity verification:", O), f(O.message || "Failed to restart verification");
|
|
4357
4357
|
}
|
|
4358
4358
|
};
|
|
4359
|
-
if (
|
|
4359
|
+
if (C || m)
|
|
4360
4360
|
return /* @__PURE__ */ a($, { children: /* @__PURE__ */ i(B, { children: [
|
|
4361
|
-
/* @__PURE__ */ a(
|
|
4361
|
+
/* @__PURE__ */ a(fe, { className: "my-8" }),
|
|
4362
4362
|
/* @__PURE__ */ a("p", { className: "text-center text-gray-600 dark:text-gray-400 mt-4", children: "Loading identity verification..." })
|
|
4363
4363
|
] }) });
|
|
4364
4364
|
if (w)
|
|
@@ -4403,9 +4403,9 @@ Failed to reload test data. Please refresh the page.`);
|
|
|
4403
4403
|
] })
|
|
4404
4404
|
] })
|
|
4405
4405
|
] }),
|
|
4406
|
-
/* @__PURE__ */ i(
|
|
4406
|
+
/* @__PURE__ */ i(ue, { className: "flex justify-between", children: [
|
|
4407
4407
|
r && /* @__PURE__ */ a(U, { type: "button", variant: "outline", onClick: r, children: "Back" }),
|
|
4408
|
-
/* @__PURE__ */ a(U, { type: "button", onClick:
|
|
4408
|
+
/* @__PURE__ */ a(U, { type: "button", onClick: E, disabled: m, children: m ? "Restarting..." : "Restart Verification" })
|
|
4409
4409
|
] })
|
|
4410
4410
|
] });
|
|
4411
4411
|
if (q && o) {
|
|
@@ -4422,8 +4422,8 @@ Failed to reload test data. Please refresh the page.`);
|
|
|
4422
4422
|
type: "button",
|
|
4423
4423
|
variant: "outline",
|
|
4424
4424
|
size: "sm",
|
|
4425
|
-
onClick:
|
|
4426
|
-
disabled:
|
|
4425
|
+
onClick: E,
|
|
4426
|
+
disabled: m,
|
|
4427
4427
|
children: "Restart"
|
|
4428
4428
|
}
|
|
4429
4429
|
)
|
|
@@ -4441,13 +4441,13 @@ Failed to reload test data. Please refresh the page.`);
|
|
|
4441
4441
|
allow: "camera; microphone; geolocation",
|
|
4442
4442
|
title: "Identity Verification",
|
|
4443
4443
|
onLoad: (L) => {
|
|
4444
|
-
var
|
|
4444
|
+
var te, Z, re;
|
|
4445
4445
|
console.log("[Identity] Iframe loaded");
|
|
4446
4446
|
try {
|
|
4447
|
-
const j = L.target, Fe = j.contentDocument || ((
|
|
4447
|
+
const j = L.target, Fe = j.contentDocument || ((te = j.contentWindow) == null ? void 0 : te.document);
|
|
4448
4448
|
if (Fe) {
|
|
4449
|
-
const
|
|
4450
|
-
(
|
|
4449
|
+
const xe = ((re = (Z = Fe.body) == null ? void 0 : Z.textContent) == null ? void 0 : re.toLowerCase()) || "";
|
|
4450
|
+
(xe.includes("expired") || xe.includes("invalid") || xe.includes("error")) && (console.warn("[Identity] Iframe shows expiration message"), F(!0), f("Your verification link has expired."));
|
|
4451
4451
|
}
|
|
4452
4452
|
} catch {
|
|
4453
4453
|
console.log("[Identity] Cannot check iframe content (CORS)");
|
|
@@ -4456,14 +4456,14 @@ Failed to reload test data. Please refresh the page.`);
|
|
|
4456
4456
|
}
|
|
4457
4457
|
) })
|
|
4458
4458
|
] }),
|
|
4459
|
-
r && /* @__PURE__ */ a(
|
|
4460
|
-
] }) : O ===
|
|
4459
|
+
r && /* @__PURE__ */ a(ue, { children: /* @__PURE__ */ a(U, { variant: "outline", onClick: r, children: "Back" }) })
|
|
4460
|
+
] }) : O === ge.SardinAI ? /* @__PURE__ */ i($, { children: [
|
|
4461
4461
|
/* @__PURE__ */ i(oe, { children: [
|
|
4462
4462
|
/* @__PURE__ */ a("h2", { className: "text-2xl font-bold", children: "Device Risk Assessment" }),
|
|
4463
4463
|
/* @__PURE__ */ a("p", { className: "text-gray-600 dark:text-gray-400 mt-1", children: "Analyzing device security and behavioral patterns..." })
|
|
4464
4464
|
] }),
|
|
4465
4465
|
/* @__PURE__ */ a(B, { children: /* @__PURE__ */ i("div", { className: "text-center py-12", children: [
|
|
4466
|
-
/* @__PURE__ */ a(
|
|
4466
|
+
/* @__PURE__ */ a(fe, { className: "mb-4" }),
|
|
4467
4467
|
/* @__PURE__ */ a("p", { className: "text-gray-600 dark:text-gray-400", children: "Please wait while we verify your device security" }),
|
|
4468
4468
|
/* @__PURE__ */ a("p", { className: "text-sm text-gray-500 dark:text-gray-500 mt-2", children: "This process is automatic and will complete in a few seconds" })
|
|
4469
4469
|
] }) })
|
|
@@ -4473,10 +4473,10 @@ Failed to reload test data. Please refresh the page.`);
|
|
|
4473
4473
|
/* @__PURE__ */ a("p", { className: "text-gray-600 dark:text-gray-400 mt-1", children: "Please complete the identity verification process" })
|
|
4474
4474
|
] }),
|
|
4475
4475
|
/* @__PURE__ */ a(B, { children: /* @__PURE__ */ a("div", { id: "identity-container", className: "min-h-[400px]" }) }),
|
|
4476
|
-
r && /* @__PURE__ */ a(
|
|
4476
|
+
r && /* @__PURE__ */ a(ue, { children: /* @__PURE__ */ a(U, { variant: "outline", onClick: r, children: "Back" }) })
|
|
4477
4477
|
] });
|
|
4478
4478
|
}
|
|
4479
|
-
return /* @__PURE__ */ a("form", { onSubmit:
|
|
4479
|
+
return /* @__PURE__ */ a("form", { onSubmit: H.handleSubmit(P), children: /* @__PURE__ */ i($, { children: [
|
|
4480
4480
|
/* @__PURE__ */ i(oe, { children: [
|
|
4481
4481
|
/* @__PURE__ */ a("h2", { className: "text-lg font-bold", children: "Review Your Information" }),
|
|
4482
4482
|
/* @__PURE__ */ a("p", { className: "text-gray-600 dark:text-gray-400 mt-1", children: "Please review and confirm your information before starting identity verification" })
|
|
@@ -4486,36 +4486,36 @@ Failed to reload test data. Please refresh the page.`);
|
|
|
4486
4486
|
/* @__PURE__ */ i("div", { children: [
|
|
4487
4487
|
/* @__PURE__ */ a("label", { className: "block text-sm font-medium text-gray-500 dark:text-gray-400", children: "Name" }),
|
|
4488
4488
|
/* @__PURE__ */ i("p", { className: "mt-1 text-base", children: [
|
|
4489
|
-
(G =
|
|
4489
|
+
(G = N == null ? void 0 : N.applicantRequestData) == null ? void 0 : G.firstName,
|
|
4490
4490
|
" ",
|
|
4491
|
-
(K =
|
|
4491
|
+
(K = N == null ? void 0 : N.applicantRequestData) == null ? void 0 : K.lastName
|
|
4492
4492
|
] })
|
|
4493
4493
|
] }),
|
|
4494
4494
|
/* @__PURE__ */ i("div", { children: [
|
|
4495
4495
|
/* @__PURE__ */ a("label", { className: "block text-sm font-medium text-gray-500 dark:text-gray-400", children: "Email" }),
|
|
4496
|
-
/* @__PURE__ */ a("p", { className: "mt-1 text-base", children: (
|
|
4496
|
+
/* @__PURE__ */ a("p", { className: "mt-1 text-base", children: (ne = N == null ? void 0 : N.applicantRequestData) == null ? void 0 : ne.email })
|
|
4497
4497
|
] }),
|
|
4498
4498
|
/* @__PURE__ */ i("div", { children: [
|
|
4499
4499
|
/* @__PURE__ */ a("label", { className: "block text-sm font-medium text-gray-500 dark:text-gray-400", children: "Date of Birth" }),
|
|
4500
|
-
/* @__PURE__ */ a("p", { className: "mt-1 text-base", children: ((
|
|
4500
|
+
/* @__PURE__ */ a("p", { className: "mt-1 text-base", children: ((ve = N == null ? void 0 : N.applicantRequestData) == null ? void 0 : ve.dateOfBirth) || "Not provided" })
|
|
4501
4501
|
] })
|
|
4502
4502
|
] }),
|
|
4503
4503
|
/* @__PURE__ */ i("div", { className: "space-y-4", children: [
|
|
4504
4504
|
/* @__PURE__ */ a("h3", { className: "text-lg font-semibold", children: "Address Information" }),
|
|
4505
4505
|
/* @__PURE__ */ i("div", { className: "grid grid-cols-1 md:grid-cols-2 gap-4", children: [
|
|
4506
4506
|
/* @__PURE__ */ a(
|
|
4507
|
-
|
|
4507
|
+
Ae,
|
|
4508
4508
|
{
|
|
4509
|
-
control:
|
|
4509
|
+
control: H.control,
|
|
4510
4510
|
name: "country",
|
|
4511
4511
|
render: ({ field: O }) => /* @__PURE__ */ a(
|
|
4512
|
-
|
|
4512
|
+
Ce,
|
|
4513
4513
|
{
|
|
4514
4514
|
...O,
|
|
4515
4515
|
label: "Country",
|
|
4516
4516
|
options: [
|
|
4517
4517
|
{ value: "", label: "Select country..." },
|
|
4518
|
-
...
|
|
4518
|
+
...p.map((L) => ({
|
|
4519
4519
|
value: L.abbreviation3 || L.abbreviation,
|
|
4520
4520
|
label: L.name
|
|
4521
4521
|
}))
|
|
@@ -4525,18 +4525,18 @@ Failed to reload test data. Please refresh the page.`);
|
|
|
4525
4525
|
}
|
|
4526
4526
|
),
|
|
4527
4527
|
/* @__PURE__ */ a(
|
|
4528
|
-
|
|
4528
|
+
Ae,
|
|
4529
4529
|
{
|
|
4530
|
-
control:
|
|
4530
|
+
control: H.control,
|
|
4531
4531
|
name: "nationality",
|
|
4532
4532
|
render: ({ field: O }) => /* @__PURE__ */ a(
|
|
4533
|
-
|
|
4533
|
+
Ce,
|
|
4534
4534
|
{
|
|
4535
4535
|
...O,
|
|
4536
4536
|
label: "Nationality",
|
|
4537
4537
|
options: [
|
|
4538
4538
|
{ value: "", label: "Select nationality..." },
|
|
4539
|
-
...
|
|
4539
|
+
...p.map((L) => ({
|
|
4540
4540
|
value: L.abbreviation3 || L.abbreviation,
|
|
4541
4541
|
label: L.name
|
|
4542
4542
|
}))
|
|
@@ -4548,53 +4548,53 @@ Failed to reload test data. Please refresh the page.`);
|
|
|
4548
4548
|
] }),
|
|
4549
4549
|
/* @__PURE__ */ i("div", { className: "grid grid-cols-1 md:grid-cols-2 gap-4", children: [
|
|
4550
4550
|
/* @__PURE__ */ a(
|
|
4551
|
-
|
|
4551
|
+
Ae,
|
|
4552
4552
|
{
|
|
4553
|
-
control:
|
|
4553
|
+
control: H.control,
|
|
4554
4554
|
name: "street",
|
|
4555
|
-
render: ({ field: O }) => /* @__PURE__ */ a(
|
|
4555
|
+
render: ({ field: O }) => /* @__PURE__ */ a(de, { ...O, label: "Street" })
|
|
4556
4556
|
}
|
|
4557
4557
|
),
|
|
4558
4558
|
/* @__PURE__ */ a(
|
|
4559
|
-
|
|
4559
|
+
Ae,
|
|
4560
4560
|
{
|
|
4561
|
-
control:
|
|
4561
|
+
control: H.control,
|
|
4562
4562
|
name: "streetNumber",
|
|
4563
|
-
render: ({ field: O }) => /* @__PURE__ */ a(
|
|
4563
|
+
render: ({ field: O }) => /* @__PURE__ */ a(de, { ...O, label: "Street Number" })
|
|
4564
4564
|
}
|
|
4565
4565
|
)
|
|
4566
4566
|
] }),
|
|
4567
4567
|
/* @__PURE__ */ i("div", { className: "grid grid-cols-1 md:grid-cols-2 gap-4", children: [
|
|
4568
4568
|
/* @__PURE__ */ a(
|
|
4569
|
-
|
|
4569
|
+
Ae,
|
|
4570
4570
|
{
|
|
4571
|
-
control:
|
|
4571
|
+
control: H.control,
|
|
4572
4572
|
name: "city",
|
|
4573
|
-
render: ({ field: O }) => /* @__PURE__ */ a(
|
|
4573
|
+
render: ({ field: O }) => /* @__PURE__ */ a(de, { ...O, label: "City" })
|
|
4574
4574
|
}
|
|
4575
4575
|
),
|
|
4576
4576
|
/* @__PURE__ */ a(
|
|
4577
|
-
|
|
4577
|
+
Ae,
|
|
4578
4578
|
{
|
|
4579
|
-
control:
|
|
4579
|
+
control: H.control,
|
|
4580
4580
|
name: "zip",
|
|
4581
|
-
render: ({ field: O }) => /* @__PURE__ */ a(
|
|
4581
|
+
render: ({ field: O }) => /* @__PURE__ */ a(de, { ...O, label: "ZIP/Postal Code" })
|
|
4582
4582
|
}
|
|
4583
4583
|
)
|
|
4584
4584
|
] }),
|
|
4585
4585
|
/* @__PURE__ */ a(
|
|
4586
|
-
|
|
4586
|
+
Ae,
|
|
4587
4587
|
{
|
|
4588
|
-
control:
|
|
4588
|
+
control: H.control,
|
|
4589
4589
|
name: "phonenumber",
|
|
4590
|
-
render: ({ field: O }) => /* @__PURE__ */ a(
|
|
4590
|
+
render: ({ field: O }) => /* @__PURE__ */ a(de, { ...O, label: "Phone Number", type: "tel" })
|
|
4591
4591
|
}
|
|
4592
4592
|
)
|
|
4593
4593
|
] })
|
|
4594
4594
|
] }),
|
|
4595
|
-
/* @__PURE__ */ i(
|
|
4595
|
+
/* @__PURE__ */ i(ue, { className: "flex justify-between", children: [
|
|
4596
4596
|
r && /* @__PURE__ */ a(U, { type: "button", variant: "outline", onClick: r, children: "Back" }),
|
|
4597
|
-
/* @__PURE__ */ a(U, { type: "submit", isLoading:
|
|
4597
|
+
/* @__PURE__ */ a(U, { type: "submit", isLoading: m, children: "Confirm and Start Verification" })
|
|
4598
4598
|
] })
|
|
4599
4599
|
] }) });
|
|
4600
4600
|
}, et = ({
|
|
@@ -4605,63 +4605,63 @@ Failed to reload test data. Please refresh the page.`);
|
|
|
4605
4605
|
onContinue: s,
|
|
4606
4606
|
onContactSupport: l
|
|
4607
4607
|
}) => {
|
|
4608
|
-
const c = e ===
|
|
4608
|
+
const c = e === Ie.Approved ? {
|
|
4609
4609
|
type: "success",
|
|
4610
4610
|
title: "Verification Approved",
|
|
4611
4611
|
icon: "✓",
|
|
4612
4612
|
iconBg: "bg-green-100 dark:bg-green-900/30",
|
|
4613
4613
|
iconColor: "text-green-600 dark:text-green-400",
|
|
4614
4614
|
message: "Your identity verification has been successfully approved."
|
|
4615
|
-
} : e ===
|
|
4615
|
+
} : e === Ie.Rejected ? {
|
|
4616
4616
|
type: "error",
|
|
4617
4617
|
title: "Verification Rejected",
|
|
4618
4618
|
icon: "✕",
|
|
4619
4619
|
iconBg: "bg-red-100 dark:bg-red-900/30",
|
|
4620
4620
|
iconColor: "text-red-600 dark:text-red-400",
|
|
4621
4621
|
message: "Unfortunately, your identity verification was not approved."
|
|
4622
|
-
} : e ===
|
|
4622
|
+
} : e === Ie.Pending || e === Ie.InProgress ? {
|
|
4623
4623
|
type: "pending",
|
|
4624
4624
|
title: "Verification Pending",
|
|
4625
4625
|
icon: "⏱",
|
|
4626
4626
|
iconBg: "bg-blue-100 dark:bg-blue-900/30",
|
|
4627
4627
|
iconColor: "text-blue-600 dark:text-blue-400",
|
|
4628
4628
|
message: "Your identity verification is currently being processed."
|
|
4629
|
-
} : t ===
|
|
4629
|
+
} : t === Ee.Approved ? {
|
|
4630
4630
|
type: "success",
|
|
4631
4631
|
title: "Application Approved",
|
|
4632
4632
|
icon: "✓",
|
|
4633
4633
|
iconBg: "bg-green-100 dark:bg-green-900/30",
|
|
4634
4634
|
iconColor: "text-green-600 dark:text-green-400",
|
|
4635
4635
|
message: "Your application has been approved."
|
|
4636
|
-
} : t ===
|
|
4636
|
+
} : t === Ee.Reject ? {
|
|
4637
4637
|
type: "error",
|
|
4638
4638
|
title: "Application Rejected",
|
|
4639
4639
|
icon: "✕",
|
|
4640
4640
|
iconBg: "bg-red-100 dark:bg-red-900/30",
|
|
4641
4641
|
iconColor: "text-red-600 dark:text-red-400",
|
|
4642
4642
|
message: "Your application has been rejected."
|
|
4643
|
-
} : t ===
|
|
4643
|
+
} : t === Ee.UnderReview || t === Ee.AdminReview ? {
|
|
4644
4644
|
type: "pending",
|
|
4645
4645
|
title: "Under Review",
|
|
4646
4646
|
icon: "📋",
|
|
4647
4647
|
iconBg: "bg-yellow-100 dark:bg-yellow-900/30",
|
|
4648
4648
|
iconColor: "text-yellow-700 dark:text-yellow-400",
|
|
4649
4649
|
message: "Your application is currently under manual review."
|
|
4650
|
-
} : r ===
|
|
4650
|
+
} : r === ze.Success ? {
|
|
4651
4651
|
type: "success",
|
|
4652
4652
|
title: "Process Complete",
|
|
4653
4653
|
icon: "✓",
|
|
4654
4654
|
iconBg: "bg-green-100 dark:bg-green-900/30",
|
|
4655
4655
|
iconColor: "text-green-600 dark:text-green-400",
|
|
4656
4656
|
message: "Your verification process has been completed successfully."
|
|
4657
|
-
} : r ===
|
|
4657
|
+
} : r === ze.Failed ? {
|
|
4658
4658
|
type: "error",
|
|
4659
4659
|
title: "Process Failed",
|
|
4660
4660
|
icon: "✕",
|
|
4661
4661
|
iconBg: "bg-red-100 dark:bg-red-900/30",
|
|
4662
4662
|
iconColor: "text-red-600 dark:text-red-400",
|
|
4663
4663
|
message: "The verification process could not be completed."
|
|
4664
|
-
} : r ===
|
|
4664
|
+
} : r === ze.AdminReview ? {
|
|
4665
4665
|
type: "pending",
|
|
4666
4666
|
title: "Admin Review Required",
|
|
4667
4667
|
icon: "📋",
|
|
@@ -4687,10 +4687,10 @@ Failed to reload test data. Please refresh the page.`);
|
|
|
4687
4687
|
) }),
|
|
4688
4688
|
/* @__PURE__ */ a("h2", { className: "text-3xl font-bold text-center text-gray-900 dark:text-white mb-4", children: c.title }),
|
|
4689
4689
|
/* @__PURE__ */ a("div", { className: "flex justify-center mb-6", children: /* @__PURE__ */ a(
|
|
4690
|
-
|
|
4690
|
+
Ne,
|
|
4691
4691
|
{
|
|
4692
4692
|
variant: c.type === "success" ? "success" : c.type === "error" ? "danger" : c.type === "pending" ? "warning" : "info",
|
|
4693
|
-
children: e != null ?
|
|
4693
|
+
children: e != null ? Ie[e] : Ee[t]
|
|
4694
4694
|
}
|
|
4695
4695
|
) }),
|
|
4696
4696
|
/* @__PURE__ */ a("p", { className: "text-center text-gray-600 dark:text-gray-400 mb-6 max-w-md mx-auto", children: n || c.message }),
|
|
@@ -4722,15 +4722,15 @@ Failed to reload test data. Please refresh the page.`);
|
|
|
4722
4722
|
/* @__PURE__ */ a("div", { className: "mt-6 pt-6 border-t border-gray-200 dark:border-gray-700", children: /* @__PURE__ */ i("div", { className: "grid grid-cols-2 gap-4 text-sm", children: [
|
|
4723
4723
|
/* @__PURE__ */ i("div", { children: [
|
|
4724
4724
|
/* @__PURE__ */ a("span", { className: "text-gray-500 dark:text-gray-400", children: "KYC Status:" }),
|
|
4725
|
-
/* @__PURE__ */ a("div", { className: "font-medium text-gray-900 dark:text-white mt-1", children: e != null ?
|
|
4725
|
+
/* @__PURE__ */ a("div", { className: "font-medium text-gray-900 dark:text-white mt-1", children: e != null ? Ie[e] : "Not Available" })
|
|
4726
4726
|
] }),
|
|
4727
4727
|
/* @__PURE__ */ i("div", { children: [
|
|
4728
4728
|
/* @__PURE__ */ a("span", { className: "text-gray-500 dark:text-gray-400", children: "Review Status:" }),
|
|
4729
|
-
/* @__PURE__ */ a("div", { className: "font-medium text-gray-900 dark:text-white mt-1", children:
|
|
4729
|
+
/* @__PURE__ */ a("div", { className: "font-medium text-gray-900 dark:text-white mt-1", children: Ee[t] })
|
|
4730
4730
|
] })
|
|
4731
4731
|
] }) })
|
|
4732
4732
|
] }),
|
|
4733
|
-
/* @__PURE__ */ i(
|
|
4733
|
+
/* @__PURE__ */ i(ue, { className: "flex justify-center gap-4", children: [
|
|
4734
4734
|
c.type === "success" && s && /* @__PURE__ */ a(U, { onClick: s, size: "lg", children: "Continue" }),
|
|
4735
4735
|
c.type === "error" && /* @__PURE__ */ i(mt, { children: [
|
|
4736
4736
|
l && /* @__PURE__ */ a(U, { variant: "outline", onClick: l, children: "Contact Support" }),
|
|
@@ -4754,12 +4754,12 @@ Failed to reload test data. Please refresh the page.`);
|
|
|
4754
4754
|
console.warn("[Logo] Failed to load logo:", e.url), r.target.style.display = "none";
|
|
4755
4755
|
}
|
|
4756
4756
|
}
|
|
4757
|
-
) }),
|
|
4757
|
+
) }), We = ({
|
|
4758
4758
|
title: e,
|
|
4759
4759
|
subtitle: t,
|
|
4760
4760
|
className: r = ""
|
|
4761
4761
|
}) => {
|
|
4762
|
-
const { currentTheme: n } =
|
|
4762
|
+
const { currentTheme: n } = pe(), s = e || (n == null ? void 0 : n.title) || "", l = !!(n != null && n.logo && n.logo.visible && n.logo.url), o = !!s;
|
|
4763
4763
|
return !l && !o ? null : /* @__PURE__ */ i("div", { className: `metakyc-header ${r}`, children: [
|
|
4764
4764
|
/* @__PURE__ */ i("div", { className: "metakyc-header-title flex items-center text-xl font-bold text-gray-900 dark:text-white", children: [
|
|
4765
4765
|
l && /* @__PURE__ */ a(Or, { config: n.logo }),
|
|
@@ -4775,11 +4775,11 @@ Failed to reload test data. Please refresh the page.`);
|
|
|
4775
4775
|
] }),
|
|
4776
4776
|
t && /* @__PURE__ */ a("p", { className: "text-sm text-gray-600 dark:text-gray-400 mt-1", children: t })
|
|
4777
4777
|
] });
|
|
4778
|
-
},
|
|
4778
|
+
}, je = ["firstName", "lastName", "email", "phonenumber", "dateOfBirth"];
|
|
4779
4779
|
function Be(e) {
|
|
4780
4780
|
return e == null || e === "" || Array.isArray(e) && e.length === 0;
|
|
4781
4781
|
}
|
|
4782
|
-
const
|
|
4782
|
+
const Oe = {
|
|
4783
4783
|
width: "16px",
|
|
4784
4784
|
height: "16px",
|
|
4785
4785
|
minWidth: "16px",
|
|
@@ -4797,55 +4797,55 @@ const ze = {
|
|
|
4797
4797
|
onSuccess: r,
|
|
4798
4798
|
onCancel: n
|
|
4799
4799
|
}) => {
|
|
4800
|
-
var Qe, Ve
|
|
4801
|
-
const { config: s, baseInformationService: l, currentTheme: o } =
|
|
4802
|
-
if (!
|
|
4800
|
+
var Ye, Qe, Ve;
|
|
4801
|
+
const { config: s, baseInformationService: l, currentTheme: o } = pe(), { createApplicant: c, isLoading: u } = ur(), m = e || ((Ye = s.applicantForm) == null ? void 0 : Ye.workflowKey);
|
|
4802
|
+
if (!m)
|
|
4803
4803
|
throw new Error(
|
|
4804
4804
|
"workflowKey is required. Provide it either as a prop to CreateApplicantForm or set it in config.applicantForm.workflowKey"
|
|
4805
4805
|
);
|
|
4806
|
-
const w = t || ((
|
|
4807
|
-
|
|
4806
|
+
const w = t || ((Qe = s.applicantForm) == null ? void 0 : Qe.externalRefId) || "", [S, y] = x([]), [h, g] = x(!0), N = X(!1), b = X(!1);
|
|
4807
|
+
ee(() => {
|
|
4808
4808
|
(async () => {
|
|
4809
|
-
if (!(
|
|
4810
|
-
|
|
4809
|
+
if (!(N.current || b.current)) {
|
|
4810
|
+
N.current = !0, g(!0);
|
|
4811
4811
|
try {
|
|
4812
|
-
const
|
|
4812
|
+
const D = await l.getCountries("", s.locale || "en"), M = /* @__PURE__ */ new Set();
|
|
4813
4813
|
y(
|
|
4814
|
-
|
|
4814
|
+
D.map((k) => ({ value: k.abbreviation3 || k.abbreviation, label: k.name })).filter((k) => !k.value || M.has(k.value) ? !1 : (M.add(k.value), !0))
|
|
4815
4815
|
), b.current = !0;
|
|
4816
|
-
} catch (
|
|
4817
|
-
console.error("Failed to load countries:",
|
|
4816
|
+
} catch (D) {
|
|
4817
|
+
console.error("Failed to load countries:", D);
|
|
4818
4818
|
} finally {
|
|
4819
|
-
g(!1),
|
|
4819
|
+
g(!1), N.current = !1;
|
|
4820
4820
|
}
|
|
4821
4821
|
}
|
|
4822
4822
|
})();
|
|
4823
4823
|
}, []);
|
|
4824
|
-
const
|
|
4824
|
+
const p = Re(
|
|
4825
4825
|
() => o != null && o.applicantFormPages && o.applicantFormPages.length > 0 ? o.applicantFormPages : null,
|
|
4826
4826
|
[o == null ? void 0 : o.applicantFormPages]
|
|
4827
|
-
),
|
|
4828
|
-
const d = new Set(
|
|
4829
|
-
if (
|
|
4830
|
-
if (
|
|
4831
|
-
for (const M of
|
|
4832
|
-
for (const
|
|
4833
|
-
!
|
|
4827
|
+
), R = Re(() => {
|
|
4828
|
+
const d = new Set(je), D = o == null ? void 0 : o.applicantFormRequiredFields;
|
|
4829
|
+
if (D) for (const M of D) d.add(M);
|
|
4830
|
+
if (p)
|
|
4831
|
+
for (const M of p)
|
|
4832
|
+
for (const k of M.fields)
|
|
4833
|
+
!k.isCustom && k.name && k.required && d.add(k.name);
|
|
4834
4834
|
return Array.from(d);
|
|
4835
|
-
}, [o == null ? void 0 : o.applicantFormRequiredFields,
|
|
4835
|
+
}, [o == null ? void 0 : o.applicantFormRequiredFields, p]), C = Re(() => {
|
|
4836
4836
|
var M;
|
|
4837
|
-
if (
|
|
4838
|
-
const
|
|
4839
|
-
for (const z of
|
|
4840
|
-
return Array.from(
|
|
4837
|
+
if (p) {
|
|
4838
|
+
const k = p.flatMap((z) => z.fields).filter((z) => !z.isCustom && z.name).map((z) => z.name), I = new Set(k);
|
|
4839
|
+
for (const z of je) I.add(z);
|
|
4840
|
+
return Array.from(I);
|
|
4841
4841
|
}
|
|
4842
4842
|
let d;
|
|
4843
4843
|
(M = s.applicantForm) != null && M.visibleFields ? d = s.applicantForm.visibleFields : o != null && o.applicantFormVisibleFields && o.applicantFormVisibleFields.length > 0 ? d = o.applicantFormVisibleFields : d = Ct;
|
|
4844
|
-
const
|
|
4845
|
-
for (const
|
|
4846
|
-
return Array.from(
|
|
4847
|
-
}, [(
|
|
4848
|
-
workflowKey:
|
|
4844
|
+
const D = new Set(d);
|
|
4845
|
+
for (const k of je) D.add(k);
|
|
4846
|
+
return Array.from(D);
|
|
4847
|
+
}, [(Ve = s.applicantForm) == null ? void 0 : Ve.visibleFields, o == null ? void 0 : o.applicantFormVisibleFields, p]), [v, q] = x({
|
|
4848
|
+
workflowKey: m,
|
|
4849
4849
|
firstName: "",
|
|
4850
4850
|
lastName: "",
|
|
4851
4851
|
title: "",
|
|
@@ -4869,48 +4869,43 @@ const ze = {
|
|
|
4869
4869
|
educationLevel: "",
|
|
4870
4870
|
occupation: "",
|
|
4871
4871
|
taxNumber: ""
|
|
4872
|
-
}), [
|
|
4873
|
-
if (!m) return -1;
|
|
4874
|
-
for (let d = f + 1; d < m.length; d++)
|
|
4875
|
-
if (be(m[d])) return d;
|
|
4876
|
-
return -1;
|
|
4877
|
-
}, [m, f, H]), L = ke(() => {
|
|
4878
|
-
if (!m) return -1;
|
|
4879
|
-
for (let d = f - 1; d >= 0; d--)
|
|
4880
|
-
if (be(m[d])) return d;
|
|
4881
|
-
return -1;
|
|
4882
|
-
}, [m, f, H]), ee = (d) => {
|
|
4872
|
+
}), [W, T] = x({}), [f, A] = x(0), [F, Y] = x({}), [H, P] = x(null), [E, G] = x(!1), K = (d, D) => q((M) => ({ ...M, [d]: D })), ne = (d, D) => T((M) => ({ ...M, [d]: D })), ve = (d) => !d.conditionalOn || W[d.conditionalOn] === "true", O = p && f < p.length - 1 ? f + 1 : -1, L = p && f > 0 ? f - 1 : -1, te = (d) => {
|
|
4883
4873
|
var M;
|
|
4884
|
-
const
|
|
4885
|
-
for (const
|
|
4886
|
-
if (
|
|
4887
|
-
if (
|
|
4888
|
-
const
|
|
4889
|
-
|
|
4874
|
+
const D = {};
|
|
4875
|
+
for (const k of d.fields)
|
|
4876
|
+
if (k.isCustom) {
|
|
4877
|
+
if (k.required && k.paramName) {
|
|
4878
|
+
const I = W[k.paramName], z = k.displayText || k.label || k.paramName;
|
|
4879
|
+
k.customType === "checkbox" || k.customType === "link_checkbox" ? I !== "true" && (D[k.paramName] = `${z} is required.`) : (!I || I.trim() === "") && (D[k.paramName] = `${z} is required.`);
|
|
4890
4880
|
}
|
|
4891
|
-
} else if (
|
|
4892
|
-
const
|
|
4893
|
-
if (
|
|
4894
|
-
const z =
|
|
4895
|
-
I
|
|
4881
|
+
} else if (k.name) {
|
|
4882
|
+
const I = k.name;
|
|
4883
|
+
if (R.includes(I) && Be(v[I])) {
|
|
4884
|
+
const z = k.displayText || ((M = qe[I]) == null ? void 0 : M.label) || I;
|
|
4885
|
+
D[I] = `${z} is required.`;
|
|
4896
4886
|
}
|
|
4897
4887
|
}
|
|
4898
|
-
return
|
|
4888
|
+
return D;
|
|
4899
4889
|
}, Z = async () => {
|
|
4900
|
-
if (!
|
|
4901
|
-
const d =
|
|
4902
|
-
if (
|
|
4903
|
-
|
|
4890
|
+
if (!p) return;
|
|
4891
|
+
const d = p[f];
|
|
4892
|
+
if (d.conditionalOn && !ve(d)) {
|
|
4893
|
+
Y({}), O >= 0 ? A(O) : await re();
|
|
4894
|
+
return;
|
|
4895
|
+
}
|
|
4896
|
+
const D = te(d);
|
|
4897
|
+
if (Object.keys(D).length > 0) {
|
|
4898
|
+
Y(D);
|
|
4904
4899
|
return;
|
|
4905
4900
|
}
|
|
4906
|
-
|
|
4907
|
-
},
|
|
4908
|
-
if (
|
|
4901
|
+
Y({}), O >= 0 ? A(O) : await re();
|
|
4902
|
+
}, re = async () => {
|
|
4903
|
+
if (p) {
|
|
4909
4904
|
let d = {};
|
|
4910
|
-
for (const
|
|
4911
|
-
|
|
4905
|
+
for (const D of p)
|
|
4906
|
+
ve(D) && (d = { ...d, ...te(D) });
|
|
4912
4907
|
if (Object.keys(d).length > 0) {
|
|
4913
|
-
|
|
4908
|
+
Y(d);
|
|
4914
4909
|
return;
|
|
4915
4910
|
}
|
|
4916
4911
|
}
|
|
@@ -4924,33 +4919,33 @@ const ze = {
|
|
|
4924
4919
|
workflowKey: v.workflowKey,
|
|
4925
4920
|
externalRefId: v.externalRefId.trim()
|
|
4926
4921
|
};
|
|
4927
|
-
if (
|
|
4928
|
-
for (const
|
|
4929
|
-
if (
|
|
4930
|
-
for (const
|
|
4931
|
-
if (!
|
|
4932
|
-
const z =
|
|
4933
|
-
Be(
|
|
4922
|
+
if (p) {
|
|
4923
|
+
for (const k of p)
|
|
4924
|
+
if (ve(k)) {
|
|
4925
|
+
for (const I of k.fields)
|
|
4926
|
+
if (!I.isCustom && I.name) {
|
|
4927
|
+
const z = I.name, J = v[z];
|
|
4928
|
+
Be(J) || (d[z] = J);
|
|
4934
4929
|
}
|
|
4935
4930
|
}
|
|
4936
4931
|
} else
|
|
4937
|
-
|
|
4938
|
-
if (
|
|
4939
|
-
const
|
|
4940
|
-
Be(
|
|
4932
|
+
C.forEach((k) => {
|
|
4933
|
+
if (k === "externalRefId") return;
|
|
4934
|
+
const I = v[k];
|
|
4935
|
+
Be(I) || (d[k] = I);
|
|
4941
4936
|
});
|
|
4942
|
-
const
|
|
4943
|
-
if (
|
|
4944
|
-
for (const
|
|
4945
|
-
if (
|
|
4946
|
-
for (const
|
|
4947
|
-
if (
|
|
4948
|
-
const z =
|
|
4949
|
-
|
|
4937
|
+
const D = [];
|
|
4938
|
+
if (p) {
|
|
4939
|
+
for (const k of p)
|
|
4940
|
+
if (ve(k)) {
|
|
4941
|
+
for (const I of k.fields)
|
|
4942
|
+
if (I.isCustom && I.paramName) {
|
|
4943
|
+
const z = W[I.paramName] ?? "";
|
|
4944
|
+
D.push({ paramName: I.paramName, paramValue: z });
|
|
4950
4945
|
}
|
|
4951
4946
|
}
|
|
4952
4947
|
}
|
|
4953
|
-
|
|
4948
|
+
D.length > 0 && (d.applicantAdditionalDatas = D);
|
|
4954
4949
|
const M = await c(d);
|
|
4955
4950
|
r(M.applicantId);
|
|
4956
4951
|
} catch (d) {
|
|
@@ -4959,64 +4954,64 @@ const ze = {
|
|
|
4959
4954
|
G(!1);
|
|
4960
4955
|
}
|
|
4961
4956
|
}, j = async (d) => {
|
|
4962
|
-
var
|
|
4957
|
+
var D;
|
|
4963
4958
|
d.preventDefault();
|
|
4964
|
-
for (const M of
|
|
4959
|
+
for (const M of R)
|
|
4965
4960
|
if (Be(v[M])) {
|
|
4966
|
-
const
|
|
4967
|
-
P(`${
|
|
4961
|
+
const k = ((D = qe[M]) == null ? void 0 : D.label) || M;
|
|
4962
|
+
P(`${k} is required.`);
|
|
4968
4963
|
return;
|
|
4969
4964
|
}
|
|
4970
|
-
await
|
|
4971
|
-
}, Fe = (d,
|
|
4972
|
-
var
|
|
4973
|
-
const
|
|
4974
|
-
if (!
|
|
4975
|
-
const
|
|
4976
|
-
switch (
|
|
4965
|
+
await re();
|
|
4966
|
+
}, Fe = (d, D, M) => {
|
|
4967
|
+
var Ge;
|
|
4968
|
+
const k = qe[d];
|
|
4969
|
+
if (!k) return null;
|
|
4970
|
+
const I = R.includes(d), z = F[d], J = M || k.label, ae = D ?? d, be = { required: I };
|
|
4971
|
+
switch (k.type) {
|
|
4977
4972
|
case "select":
|
|
4978
4973
|
if (d === "country" || d === "nationality" || d === "taxCountry" || d === "countryOfBirth")
|
|
4979
4974
|
return /* @__PURE__ */ a(
|
|
4980
|
-
|
|
4975
|
+
Ce,
|
|
4981
4976
|
{
|
|
4982
|
-
...
|
|
4983
|
-
label:
|
|
4977
|
+
...be,
|
|
4978
|
+
label: J,
|
|
4984
4979
|
value: v[d] || "",
|
|
4985
|
-
onChange: (
|
|
4986
|
-
options: [{ value: "", label: `Select ${
|
|
4980
|
+
onChange: (se) => K(d, se.target.value),
|
|
4981
|
+
options: [{ value: "", label: `Select ${J.toLowerCase()}...` }, ...S],
|
|
4987
4982
|
disabled: h
|
|
4988
4983
|
},
|
|
4989
|
-
|
|
4984
|
+
ae
|
|
4990
4985
|
);
|
|
4991
4986
|
if (d === "salutation")
|
|
4992
4987
|
return /* @__PURE__ */ a(
|
|
4993
|
-
|
|
4988
|
+
Ce,
|
|
4994
4989
|
{
|
|
4995
|
-
...
|
|
4996
|
-
label:
|
|
4997
|
-
value: ((
|
|
4998
|
-
onChange: (
|
|
4990
|
+
...be,
|
|
4991
|
+
label: J,
|
|
4992
|
+
value: ((Ge = v[d]) == null ? void 0 : Ge.toString()) || "",
|
|
4993
|
+
onChange: (se) => K(d, se.target.value ? Number(se.target.value) : null),
|
|
4999
4994
|
options: [
|
|
5000
4995
|
{ value: "", label: "Select salutation..." },
|
|
5001
|
-
{ value:
|
|
5002
|
-
{ value:
|
|
5003
|
-
{ value:
|
|
4996
|
+
{ value: _e.Male.toString(), label: "Male" },
|
|
4997
|
+
{ value: _e.Female.toString(), label: "Female" },
|
|
4998
|
+
{ value: _e.Other.toString(), label: "Other" }
|
|
5004
4999
|
]
|
|
5005
5000
|
},
|
|
5006
|
-
|
|
5001
|
+
ae
|
|
5007
5002
|
);
|
|
5008
5003
|
if (d === "defaultLanguage") {
|
|
5009
|
-
const
|
|
5004
|
+
const se = o != null && o.allowedLanguages && o.allowedLanguages.length > 0 ? Je.filter((Ue) => o.allowedLanguages.includes(Ue.value)) : Je;
|
|
5010
5005
|
return /* @__PURE__ */ a(
|
|
5011
|
-
|
|
5006
|
+
Ce,
|
|
5012
5007
|
{
|
|
5013
|
-
...
|
|
5014
|
-
label:
|
|
5008
|
+
...be,
|
|
5009
|
+
label: J,
|
|
5015
5010
|
value: v[d] || "",
|
|
5016
|
-
onChange: (
|
|
5017
|
-
options: [{ value: "", label: "Select language..." }, ...
|
|
5011
|
+
onChange: (Ue) => K(d, Ue.target.value),
|
|
5012
|
+
options: [{ value: "", label: "Select language..." }, ...se]
|
|
5018
5013
|
},
|
|
5019
|
-
|
|
5014
|
+
ae
|
|
5020
5015
|
);
|
|
5021
5016
|
}
|
|
5022
5017
|
return null;
|
|
@@ -5024,72 +5019,72 @@ const ze = {
|
|
|
5024
5019
|
return d === "otherNationality" ? /* @__PURE__ */ a(
|
|
5025
5020
|
mr,
|
|
5026
5021
|
{
|
|
5027
|
-
...
|
|
5028
|
-
label:
|
|
5022
|
+
...be,
|
|
5023
|
+
label: J,
|
|
5029
5024
|
value: v[d] || [],
|
|
5030
|
-
onChange: (
|
|
5031
|
-
options:
|
|
5025
|
+
onChange: (se) => K(d, se),
|
|
5026
|
+
options: S,
|
|
5032
5027
|
placeholder: "Select other nationalities...",
|
|
5033
5028
|
disabled: h
|
|
5034
5029
|
},
|
|
5035
|
-
|
|
5030
|
+
ae
|
|
5036
5031
|
) : null;
|
|
5037
5032
|
case "date":
|
|
5038
5033
|
return /* @__PURE__ */ a(
|
|
5039
|
-
|
|
5034
|
+
de,
|
|
5040
5035
|
{
|
|
5041
|
-
...
|
|
5036
|
+
...be,
|
|
5042
5037
|
type: "date",
|
|
5043
|
-
label:
|
|
5038
|
+
label: J,
|
|
5044
5039
|
value: v[d] || "",
|
|
5045
|
-
onChange: (
|
|
5040
|
+
onChange: (se) => K(d, se.target.value),
|
|
5046
5041
|
error: z
|
|
5047
5042
|
},
|
|
5048
|
-
|
|
5043
|
+
ae
|
|
5049
5044
|
);
|
|
5050
5045
|
case "email":
|
|
5051
5046
|
return /* @__PURE__ */ a(
|
|
5052
|
-
|
|
5047
|
+
de,
|
|
5053
5048
|
{
|
|
5054
|
-
...
|
|
5049
|
+
...be,
|
|
5055
5050
|
type: "email",
|
|
5056
|
-
label:
|
|
5051
|
+
label: J,
|
|
5057
5052
|
value: v[d] || "",
|
|
5058
|
-
onChange: (
|
|
5053
|
+
onChange: (se) => K(d, se.target.value),
|
|
5059
5054
|
error: z
|
|
5060
5055
|
},
|
|
5061
|
-
|
|
5056
|
+
ae
|
|
5062
5057
|
);
|
|
5063
5058
|
case "tel":
|
|
5064
5059
|
return /* @__PURE__ */ a(
|
|
5065
|
-
|
|
5060
|
+
de,
|
|
5066
5061
|
{
|
|
5067
|
-
...
|
|
5062
|
+
...be,
|
|
5068
5063
|
type: "tel",
|
|
5069
|
-
label:
|
|
5064
|
+
label: J,
|
|
5070
5065
|
value: v[d] || "",
|
|
5071
|
-
onChange: (
|
|
5066
|
+
onChange: (se) => K(d, se.target.value),
|
|
5072
5067
|
error: z
|
|
5073
5068
|
},
|
|
5074
|
-
|
|
5069
|
+
ae
|
|
5075
5070
|
);
|
|
5076
5071
|
default:
|
|
5077
5072
|
return /* @__PURE__ */ a(
|
|
5078
|
-
|
|
5073
|
+
de,
|
|
5079
5074
|
{
|
|
5080
|
-
...
|
|
5075
|
+
...be,
|
|
5081
5076
|
type: "text",
|
|
5082
|
-
label:
|
|
5077
|
+
label: J,
|
|
5083
5078
|
value: v[d] || "",
|
|
5084
|
-
onChange: (
|
|
5079
|
+
onChange: (se) => K(d, se.target.value),
|
|
5085
5080
|
error: z
|
|
5086
5081
|
},
|
|
5087
|
-
|
|
5082
|
+
ae
|
|
5088
5083
|
);
|
|
5089
5084
|
}
|
|
5090
|
-
},
|
|
5085
|
+
}, xe = (d, D) => {
|
|
5091
5086
|
if (!d.paramName) return null;
|
|
5092
|
-
const M =
|
|
5087
|
+
const M = F[d.paramName], k = d.displayText || d.label || d.paramName;
|
|
5093
5088
|
if (d.customType === "checkbox")
|
|
5094
5089
|
return /* @__PURE__ */ i("div", { className: "flex flex-col gap-1", children: [
|
|
5095
5090
|
/* @__PURE__ */ i(
|
|
@@ -5102,10 +5097,10 @@ const ze = {
|
|
|
5102
5097
|
"input",
|
|
5103
5098
|
{
|
|
5104
5099
|
type: "checkbox",
|
|
5105
|
-
checked:
|
|
5106
|
-
onChange: (
|
|
5100
|
+
checked: W[d.paramName] === "true",
|
|
5101
|
+
onChange: (I) => ne(d.paramName, I.target.checked ? "true" : "false"),
|
|
5107
5102
|
className: "metakyc-option-input",
|
|
5108
|
-
style:
|
|
5103
|
+
style: Oe
|
|
5109
5104
|
}
|
|
5110
5105
|
),
|
|
5111
5106
|
/* @__PURE__ */ i(
|
|
@@ -5114,7 +5109,7 @@ const ze = {
|
|
|
5114
5109
|
className: "metakyc-option-text",
|
|
5115
5110
|
style: { fontSize: "14px", color: "var(--metakyc-text-primary, #111827)", lineHeight: "1.4" },
|
|
5116
5111
|
children: [
|
|
5117
|
-
|
|
5112
|
+
k,
|
|
5118
5113
|
d.required && /* @__PURE__ */ a("span", { className: "text-red-500 ml-0.5", children: "*" })
|
|
5119
5114
|
]
|
|
5120
5115
|
}
|
|
@@ -5123,7 +5118,7 @@ const ze = {
|
|
|
5123
5118
|
}
|
|
5124
5119
|
),
|
|
5125
5120
|
M && /* @__PURE__ */ a("p", { className: "text-red-500 text-xs mt-0.5", children: M })
|
|
5126
|
-
] }, `custom-${
|
|
5121
|
+
] }, `custom-${D}`);
|
|
5127
5122
|
if (d.customType === "link_checkbox")
|
|
5128
5123
|
return /* @__PURE__ */ i("div", { className: "flex flex-col gap-1", children: [
|
|
5129
5124
|
/* @__PURE__ */ i(
|
|
@@ -5136,10 +5131,10 @@ const ze = {
|
|
|
5136
5131
|
"input",
|
|
5137
5132
|
{
|
|
5138
5133
|
type: "checkbox",
|
|
5139
|
-
checked:
|
|
5140
|
-
onChange: (
|
|
5134
|
+
checked: W[d.paramName] === "true",
|
|
5135
|
+
onChange: (I) => ne(d.paramName, I.target.checked ? "true" : "false"),
|
|
5141
5136
|
className: "metakyc-option-input",
|
|
5142
|
-
style: { ...
|
|
5137
|
+
style: { ...Oe, alignSelf: "flex-start", marginTop: "2px" }
|
|
5143
5138
|
}
|
|
5144
5139
|
),
|
|
5145
5140
|
/* @__PURE__ */ i(
|
|
@@ -5148,7 +5143,7 @@ const ze = {
|
|
|
5148
5143
|
className: "metakyc-option-text",
|
|
5149
5144
|
style: { fontSize: "14px", color: "var(--metakyc-text-primary, #111827)", lineHeight: "1.4" },
|
|
5150
5145
|
children: [
|
|
5151
|
-
|
|
5146
|
+
k,
|
|
5152
5147
|
" ",
|
|
5153
5148
|
d.linkUrl && /* @__PURE__ */ a(
|
|
5154
5149
|
"a",
|
|
@@ -5158,7 +5153,7 @@ const ze = {
|
|
|
5158
5153
|
rel: "noopener noreferrer",
|
|
5159
5154
|
className: "underline",
|
|
5160
5155
|
style: { color: "var(--metakyc-primary, #2563eb)" },
|
|
5161
|
-
onClick: (
|
|
5156
|
+
onClick: (I) => I.stopPropagation(),
|
|
5162
5157
|
children: d.linkText || d.linkUrl
|
|
5163
5158
|
}
|
|
5164
5159
|
),
|
|
@@ -5170,9 +5165,9 @@ const ze = {
|
|
|
5170
5165
|
}
|
|
5171
5166
|
),
|
|
5172
5167
|
M && /* @__PURE__ */ a("p", { className: "text-red-500 text-xs mt-0.5", children: M })
|
|
5173
|
-
] }, `custom-${
|
|
5168
|
+
] }, `custom-${D}`);
|
|
5174
5169
|
if (d.customType === "group_checkbox") {
|
|
5175
|
-
const
|
|
5170
|
+
const I = (W[d.paramName] || "").split(",").filter(Boolean);
|
|
5176
5171
|
return /* @__PURE__ */ i("div", { className: "flex flex-col gap-1.5", children: [
|
|
5177
5172
|
/* @__PURE__ */ i(
|
|
5178
5173
|
"div",
|
|
@@ -5180,7 +5175,7 @@ const ze = {
|
|
|
5180
5175
|
className: "text-sm font-medium",
|
|
5181
5176
|
style: { color: "var(--metakyc-text-primary, #111827)" },
|
|
5182
5177
|
children: [
|
|
5183
|
-
|
|
5178
|
+
k,
|
|
5184
5179
|
d.required && /* @__PURE__ */ a("span", { className: "text-red-500 ml-0.5", children: "*" })
|
|
5185
5180
|
]
|
|
5186
5181
|
}
|
|
@@ -5195,13 +5190,13 @@ const ze = {
|
|
|
5195
5190
|
"input",
|
|
5196
5191
|
{
|
|
5197
5192
|
type: "checkbox",
|
|
5198
|
-
checked:
|
|
5199
|
-
onChange: (
|
|
5200
|
-
const
|
|
5201
|
-
|
|
5193
|
+
checked: I.includes(z.value),
|
|
5194
|
+
onChange: (J) => {
|
|
5195
|
+
const ae = J.target.checked ? [...I, z.value] : I.filter((be) => be !== z.value);
|
|
5196
|
+
ne(d.paramName, ae.join(","));
|
|
5202
5197
|
},
|
|
5203
5198
|
className: "metakyc-option-input",
|
|
5204
|
-
style:
|
|
5199
|
+
style: Oe
|
|
5205
5200
|
}
|
|
5206
5201
|
),
|
|
5207
5202
|
/* @__PURE__ */ a(
|
|
@@ -5217,7 +5212,7 @@ const ze = {
|
|
|
5217
5212
|
z.value
|
|
5218
5213
|
)) }),
|
|
5219
5214
|
M && /* @__PURE__ */ a("p", { className: "text-red-500 text-xs", children: M })
|
|
5220
|
-
] }, `custom-${
|
|
5215
|
+
] }, `custom-${D}`);
|
|
5221
5216
|
}
|
|
5222
5217
|
return d.customType === "radio_group" ? /* @__PURE__ */ i("div", { className: "flex flex-col gap-1.5", children: [
|
|
5223
5218
|
/* @__PURE__ */ i(
|
|
@@ -5226,12 +5221,12 @@ const ze = {
|
|
|
5226
5221
|
className: "text-sm font-medium",
|
|
5227
5222
|
style: { color: "var(--metakyc-text-primary, #111827)" },
|
|
5228
5223
|
children: [
|
|
5229
|
-
|
|
5224
|
+
k,
|
|
5230
5225
|
d.required && /* @__PURE__ */ a("span", { className: "text-red-500 ml-0.5", children: "*" })
|
|
5231
5226
|
]
|
|
5232
5227
|
}
|
|
5233
5228
|
),
|
|
5234
|
-
/* @__PURE__ */ a("div", { className: "metakyc-options-group", style: { display: "flex", flexDirection: "column", gap: "8px" }, children: (d.options || []).map((
|
|
5229
|
+
/* @__PURE__ */ a("div", { className: "metakyc-options-group", style: { display: "flex", flexDirection: "column", gap: "8px" }, children: (d.options || []).map((I) => /* @__PURE__ */ i(
|
|
5235
5230
|
"label",
|
|
5236
5231
|
{
|
|
5237
5232
|
className: "metakyc-option-label",
|
|
@@ -5241,11 +5236,11 @@ const ze = {
|
|
|
5241
5236
|
"input",
|
|
5242
5237
|
{
|
|
5243
5238
|
type: "radio",
|
|
5244
|
-
checked:
|
|
5245
|
-
onChange: () =>
|
|
5246
|
-
name: `radio-group-${d.paramName}-${
|
|
5239
|
+
checked: W[d.paramName] === I.value,
|
|
5240
|
+
onChange: () => ne(d.paramName, I.value),
|
|
5241
|
+
name: `radio-group-${d.paramName}-${D}`,
|
|
5247
5242
|
className: "metakyc-option-input",
|
|
5248
|
-
style:
|
|
5243
|
+
style: Oe
|
|
5249
5244
|
}
|
|
5250
5245
|
),
|
|
5251
5246
|
/* @__PURE__ */ a(
|
|
@@ -5253,39 +5248,71 @@ const ze = {
|
|
|
5253
5248
|
{
|
|
5254
5249
|
className: "metakyc-option-text",
|
|
5255
5250
|
style: { fontSize: "14px", color: "var(--metakyc-text-primary, #111827)", lineHeight: "1.4" },
|
|
5256
|
-
children:
|
|
5251
|
+
children: I.label
|
|
5257
5252
|
}
|
|
5258
5253
|
)
|
|
5259
5254
|
]
|
|
5260
5255
|
},
|
|
5261
|
-
|
|
5256
|
+
I.value
|
|
5262
5257
|
)) }),
|
|
5263
5258
|
M && /* @__PURE__ */ a("p", { className: "text-red-500 text-xs", children: M })
|
|
5264
|
-
] }, `custom-${
|
|
5265
|
-
|
|
5259
|
+
] }, `custom-${D}`) : /* @__PURE__ */ a(
|
|
5260
|
+
de,
|
|
5266
5261
|
{
|
|
5267
5262
|
type: "text",
|
|
5268
|
-
label: `${
|
|
5269
|
-
value:
|
|
5270
|
-
onChange: (
|
|
5263
|
+
label: `${k}${d.required ? " *" : ""}`,
|
|
5264
|
+
value: W[d.paramName] || "",
|
|
5265
|
+
onChange: (I) => ne(d.paramName, I.target.value),
|
|
5271
5266
|
required: d.required,
|
|
5272
5267
|
error: M
|
|
5273
5268
|
},
|
|
5274
|
-
`custom-${
|
|
5269
|
+
`custom-${D}`
|
|
5275
5270
|
);
|
|
5276
|
-
}, Le = (d
|
|
5277
|
-
const
|
|
5278
|
-
return /* @__PURE__ */
|
|
5279
|
-
|
|
5271
|
+
}, Le = (d, D) => {
|
|
5272
|
+
const M = ve(d);
|
|
5273
|
+
return /* @__PURE__ */ i("div", { className: "space-y-4", children: [
|
|
5274
|
+
d.conditionalOn && /* @__PURE__ */ i(
|
|
5275
|
+
"label",
|
|
5276
|
+
{
|
|
5277
|
+
className: "metakyc-option-label",
|
|
5278
|
+
style: { display: "flex", alignItems: "center", gap: "10px", cursor: "pointer", margin: 0, padding: 0 },
|
|
5279
|
+
children: [
|
|
5280
|
+
/* @__PURE__ */ a(
|
|
5281
|
+
"input",
|
|
5282
|
+
{
|
|
5283
|
+
type: "checkbox",
|
|
5284
|
+
checked: M,
|
|
5285
|
+
onChange: (k) => ne(d.conditionalOn, k.target.checked ? "true" : "false"),
|
|
5286
|
+
className: "metakyc-option-input",
|
|
5287
|
+
style: Oe
|
|
5288
|
+
}
|
|
5289
|
+
),
|
|
5290
|
+
/* @__PURE__ */ a(
|
|
5291
|
+
"span",
|
|
5292
|
+
{
|
|
5293
|
+
className: "metakyc-option-text",
|
|
5294
|
+
style: { fontSize: "14px", color: "var(--metakyc-text-primary, #111827)", lineHeight: "1.4", fontWeight: 500 },
|
|
5295
|
+
children: d.conditionalOn
|
|
5296
|
+
}
|
|
5297
|
+
)
|
|
5298
|
+
]
|
|
5299
|
+
}
|
|
5300
|
+
),
|
|
5301
|
+
M && /* @__PURE__ */ a("div", { className: "grid grid-cols-2 gap-4", children: d.fields.map((k, I) => {
|
|
5302
|
+
const z = k.colSpan === 1 ? "col-span-1" : "col-span-2", J = k.isCustom ? `custom-${I}-${k.paramName}` : `builtin-${k.name}-${I}`;
|
|
5303
|
+
return /* @__PURE__ */ a("div", { className: z, children: k.isCustom ? xe(k, I) : Fe(k.name, J, k.displayText) }, J);
|
|
5304
|
+
}) })
|
|
5305
|
+
] });
|
|
5306
|
+
};
|
|
5280
5307
|
if (h)
|
|
5281
5308
|
return /* @__PURE__ */ a("div", { className: "metakyc-sdk", children: /* @__PURE__ */ a($, { children: /* @__PURE__ */ i(B, { children: [
|
|
5282
|
-
/* @__PURE__ */ a(
|
|
5309
|
+
/* @__PURE__ */ a(fe, { className: "my-8" }),
|
|
5283
5310
|
/* @__PURE__ */ a("p", { className: "text-center text-gray-600 dark:text-gray-400 mt-4", children: "Loading form..." })
|
|
5284
5311
|
] }) }) });
|
|
5285
|
-
if (
|
|
5286
|
-
const d =
|
|
5312
|
+
if (p) {
|
|
5313
|
+
const d = p[f] ?? p[0], D = L === -1, M = O === -1, k = p.length, I = ve(d), z = Object.values(F);
|
|
5287
5314
|
return /* @__PURE__ */ a("div", { className: "metakyc-sdk", children: /* @__PURE__ */ i($, { children: [
|
|
5288
|
-
/* @__PURE__ */ a(oe, { children: /* @__PURE__ */ a(
|
|
5315
|
+
/* @__PURE__ */ a(oe, { children: /* @__PURE__ */ a(We, { title: (o == null ? void 0 : o.title) || "Create Applicant" }) }),
|
|
5289
5316
|
/* @__PURE__ */ i(B, { children: [
|
|
5290
5317
|
(d.title || d.subtitle || d.description) && /* @__PURE__ */ i("div", { className: "mb-4", children: [
|
|
5291
5318
|
d.title && /* @__PURE__ */ a(
|
|
@@ -5313,75 +5340,72 @@ const ze = {
|
|
|
5313
5340
|
}
|
|
5314
5341
|
)
|
|
5315
5342
|
] }),
|
|
5316
|
-
(
|
|
5317
|
-
|
|
5343
|
+
(H || z.length > 0) && /* @__PURE__ */ i("div", { className: "mb-4 p-3 bg-red-50 border border-red-200 rounded-lg", children: [
|
|
5344
|
+
H && /* @__PURE__ */ i("p", { className: "text-red-600 text-sm", children: [
|
|
5318
5345
|
/* @__PURE__ */ a("strong", { children: "Error:" }),
|
|
5319
5346
|
" ",
|
|
5320
|
-
|
|
5347
|
+
H
|
|
5321
5348
|
] }),
|
|
5322
|
-
|
|
5349
|
+
z.map((J, ae) => /* @__PURE__ */ a("p", { className: "text-red-600 text-sm", children: J }, ae))
|
|
5323
5350
|
] }),
|
|
5324
|
-
|
|
5325
|
-
|
|
5326
|
-
|
|
5327
|
-
|
|
5328
|
-
"
|
|
5329
|
-
{
|
|
5330
|
-
|
|
5331
|
-
|
|
5332
|
-
|
|
5333
|
-
re
|
|
5334
|
-
);
|
|
5335
|
-
}),
|
|
5351
|
+
k > 1 && /* @__PURE__ */ i("div", { className: "flex items-center gap-2 mb-4", children: [
|
|
5352
|
+
p.map((J, ae) => /* @__PURE__ */ a(
|
|
5353
|
+
"div",
|
|
5354
|
+
{
|
|
5355
|
+
className: `h-1.5 rounded-full transition-all ${ae === f ? "flex-1" : "w-8"}`,
|
|
5356
|
+
style: ae === f ? { backgroundColor: "var(--metakyc-primary, #2563eb)" } : ae < f ? { backgroundColor: "var(--metakyc-primary-light, #93c5fd)", opacity: 0.7 } : { backgroundColor: "#e5e7eb" }
|
|
5357
|
+
},
|
|
5358
|
+
ae
|
|
5359
|
+
)),
|
|
5336
5360
|
/* @__PURE__ */ i("span", { className: "text-xs text-gray-400 flex-shrink-0", children: [
|
|
5337
|
-
|
|
5361
|
+
f + 1,
|
|
5338
5362
|
" / ",
|
|
5339
|
-
|
|
5363
|
+
k
|
|
5340
5364
|
] })
|
|
5341
5365
|
] }),
|
|
5342
5366
|
Le(d)
|
|
5343
5367
|
] }),
|
|
5344
|
-
/* @__PURE__ */ i(
|
|
5368
|
+
/* @__PURE__ */ i(ue, { className: "flex justify-between", children: [
|
|
5345
5369
|
/* @__PURE__ */ i("div", { children: [
|
|
5346
|
-
!
|
|
5370
|
+
!D && /* @__PURE__ */ a(
|
|
5347
5371
|
U,
|
|
5348
5372
|
{
|
|
5349
5373
|
type: "button",
|
|
5350
5374
|
variant: "outline",
|
|
5351
5375
|
onClick: () => {
|
|
5352
|
-
A(L),
|
|
5376
|
+
A(L), Y({});
|
|
5353
5377
|
},
|
|
5354
|
-
disabled:
|
|
5378
|
+
disabled: E || u,
|
|
5355
5379
|
children: "Previous"
|
|
5356
5380
|
}
|
|
5357
5381
|
),
|
|
5358
|
-
|
|
5382
|
+
D && n && /* @__PURE__ */ a(U, { type: "button", variant: "outline", onClick: n, disabled: E || u, children: "Cancel" })
|
|
5359
5383
|
] }),
|
|
5360
5384
|
/* @__PURE__ */ a(
|
|
5361
5385
|
U,
|
|
5362
5386
|
{
|
|
5363
5387
|
type: "button",
|
|
5364
|
-
isLoading:
|
|
5365
|
-
onClick: M ?
|
|
5366
|
-
children: M ? "Submit" : "Next"
|
|
5388
|
+
isLoading: E || u,
|
|
5389
|
+
onClick: M ? re : Z,
|
|
5390
|
+
children: M ? d.conditionalOn && !I ? "Skip & Submit" : "Submit" : d.conditionalOn && !I ? "Skip" : "Next"
|
|
5367
5391
|
}
|
|
5368
5392
|
)
|
|
5369
5393
|
] })
|
|
5370
5394
|
] }) });
|
|
5371
5395
|
}
|
|
5372
5396
|
return /* @__PURE__ */ a("div", { className: "metakyc-sdk", children: /* @__PURE__ */ a("form", { onSubmit: j, children: /* @__PURE__ */ i($, { children: [
|
|
5373
|
-
/* @__PURE__ */ a(oe, { children: /* @__PURE__ */ a(
|
|
5397
|
+
/* @__PURE__ */ a(oe, { children: /* @__PURE__ */ a(We, { title: (o == null ? void 0 : o.title) || "Create Applicant" }) }),
|
|
5374
5398
|
/* @__PURE__ */ i(B, { children: [
|
|
5375
|
-
|
|
5399
|
+
H && /* @__PURE__ */ a("div", { className: "mb-6 p-4 bg-red-50 border border-red-200 rounded-lg", children: /* @__PURE__ */ i("p", { className: "text-red-600 text-sm", children: [
|
|
5376
5400
|
/* @__PURE__ */ a("strong", { children: "Error:" }),
|
|
5377
5401
|
" ",
|
|
5378
|
-
|
|
5402
|
+
H
|
|
5379
5403
|
] }) }),
|
|
5380
|
-
/* @__PURE__ */ a("div", { className: "grid grid-cols-1 md:grid-cols-2 gap-4", children:
|
|
5404
|
+
/* @__PURE__ */ a("div", { className: "grid grid-cols-1 md:grid-cols-2 gap-4", children: C.map((d) => Fe(d)) })
|
|
5381
5405
|
] }),
|
|
5382
|
-
/* @__PURE__ */ i(
|
|
5383
|
-
n && /* @__PURE__ */ a(U, { type: "button", variant: "outline", onClick: n, disabled:
|
|
5384
|
-
/* @__PURE__ */ a(U, { type: "submit", isLoading:
|
|
5406
|
+
/* @__PURE__ */ i(ue, { className: "flex justify-between", children: [
|
|
5407
|
+
n && /* @__PURE__ */ a(U, { type: "button", variant: "outline", onClick: n, disabled: E || u, children: "Cancel" }),
|
|
5408
|
+
/* @__PURE__ */ a(U, { type: "submit", isLoading: E || u, children: "Create Applicant" })
|
|
5385
5409
|
] })
|
|
5386
5410
|
] }) }) });
|
|
5387
5411
|
}, ta = ({
|
|
@@ -5396,24 +5420,24 @@ const ze = {
|
|
|
5396
5420
|
currentStep: o,
|
|
5397
5421
|
steps: c,
|
|
5398
5422
|
workflowKey: u,
|
|
5399
|
-
nextWorkflowKey:
|
|
5423
|
+
nextWorkflowKey: m,
|
|
5400
5424
|
hasWorkflowChanged: w,
|
|
5401
|
-
isLoading:
|
|
5425
|
+
isLoading: S,
|
|
5402
5426
|
error: y,
|
|
5403
5427
|
moveBack: h,
|
|
5404
5428
|
refreshProgress: g
|
|
5405
|
-
} = sr(e), [
|
|
5406
|
-
if (
|
|
5429
|
+
} = sr(e), [N, b] = he.useState(!1);
|
|
5430
|
+
if (he.useEffect(() => {
|
|
5407
5431
|
y && r && r(y);
|
|
5408
|
-
}, [y, r]),
|
|
5432
|
+
}, [y, r]), he.useEffect(() => {
|
|
5409
5433
|
l != null && l.workflowResult && t && t(l.workflowResult);
|
|
5410
|
-
}, [l == null ? void 0 : l.workflowResult, t]),
|
|
5434
|
+
}, [l == null ? void 0 : l.workflowResult, t]), he.useEffect(() => {
|
|
5411
5435
|
n === "dark" ? document.documentElement.classList.add("dark") : document.documentElement.classList.remove("dark");
|
|
5412
|
-
}, [n]),
|
|
5436
|
+
}, [n]), he.useEffect(() => {
|
|
5413
5437
|
w && b(!1);
|
|
5414
|
-
}, [w]),
|
|
5438
|
+
}, [w]), S || !l)
|
|
5415
5439
|
return /* @__PURE__ */ a("div", { className: s, children: /* @__PURE__ */ a($, { children: /* @__PURE__ */ i(B, { children: [
|
|
5416
|
-
/* @__PURE__ */ a(
|
|
5440
|
+
/* @__PURE__ */ a(fe, { className: "my-8" }),
|
|
5417
5441
|
/* @__PURE__ */ a("p", { className: "text-center text-gray-600 dark:text-gray-400 mt-4", children: "Loading workflow..." })
|
|
5418
5442
|
] }) }) });
|
|
5419
5443
|
if (y)
|
|
@@ -5421,7 +5445,7 @@ const ze = {
|
|
|
5421
5445
|
/* @__PURE__ */ a("p", { className: "text-danger-500 text-lg mb-4", children: "An error occurred" }),
|
|
5422
5446
|
/* @__PURE__ */ a("p", { className: "text-gray-600 dark:text-gray-400", children: y.message })
|
|
5423
5447
|
] }) }) }) });
|
|
5424
|
-
if (w && !
|
|
5448
|
+
if (w && !N)
|
|
5425
5449
|
return /* @__PURE__ */ a("div", { className: `metakyc-sdk ${s || ""}`, children: /* @__PURE__ */ a($, { children: /* @__PURE__ */ a(B, { children: /* @__PURE__ */ i("div", { className: "text-center py-8", children: [
|
|
5426
5450
|
/* @__PURE__ */ a("div", { className: "mb-6", children: /* @__PURE__ */ a("div", { className: "inline-flex items-center justify-center w-16 h-16 rounded-full bg-blue-100 dark:bg-blue-900 mb-4", children: /* @__PURE__ */ a("svg", { className: "w-8 h-8 text-blue-600 dark:text-blue-400", fill: "none", stroke: "currentColor", viewBox: "0 0 24 24", children: /* @__PURE__ */ a("path", { strokeLinecap: "round", strokeLinejoin: "round", strokeWidth: 2, d: "M13 16h-1v-4h-1m1-4h.01M21 12a9 9 0 11-18 0 9 9 0 0118 0z" }) }) }) }),
|
|
5427
5451
|
/* @__PURE__ */ a("h3", { className: "text-xl font-semibold text-gray-900 dark:text-white mb-2", children: "Workflow Transition" }),
|
|
@@ -5435,7 +5459,7 @@ const ze = {
|
|
|
5435
5459
|
/* @__PURE__ */ a("svg", { className: "w-6 h-6 text-gray-400 mx-4", fill: "none", stroke: "currentColor", viewBox: "0 0 24 24", children: /* @__PURE__ */ a("path", { strokeLinecap: "round", strokeLinejoin: "round", strokeWidth: 2, d: "M13 7l5 5m0 0l-5 5m5-5H6" }) }),
|
|
5436
5460
|
/* @__PURE__ */ i("div", { className: "text-right", children: [
|
|
5437
5461
|
/* @__PURE__ */ a("p", { className: "text-gray-500 dark:text-gray-400 mb-1", children: "New Workflow" }),
|
|
5438
|
-
/* @__PURE__ */ a("p", { className: "font-medium text-blue-600 dark:text-blue-400", children:
|
|
5462
|
+
/* @__PURE__ */ a("p", { className: "font-medium text-blue-600 dark:text-blue-400", children: m })
|
|
5439
5463
|
] })
|
|
5440
5464
|
] }),
|
|
5441
5465
|
l.nextWorkflowName && /* @__PURE__ */ a("p", { className: "text-center text-gray-600 dark:text-gray-400 mt-2 text-xs", children: l.nextWorkflowName })
|
|
@@ -5449,7 +5473,7 @@ const ze = {
|
|
|
5449
5473
|
}
|
|
5450
5474
|
)
|
|
5451
5475
|
] }) }) }) });
|
|
5452
|
-
if (l.status ===
|
|
5476
|
+
if (l.status === ye.Finished || l.status === ye.OnHold)
|
|
5453
5477
|
return /* @__PURE__ */ a("div", { className: `metakyc-sdk ${s || ""}`, children: /* @__PURE__ */ a(
|
|
5454
5478
|
et,
|
|
5455
5479
|
{
|
|
@@ -5465,10 +5489,10 @@ const ze = {
|
|
|
5465
5489
|
) });
|
|
5466
5490
|
if (!o)
|
|
5467
5491
|
return /* @__PURE__ */ a("div", { className: `metakyc-sdk ${s || ""}`, children: /* @__PURE__ */ a($, { children: /* @__PURE__ */ i(B, { children: [
|
|
5468
|
-
/* @__PURE__ */ a(
|
|
5469
|
-
/* @__PURE__ */ a("p", { className: "text-center text-gray-600 dark:text-gray-400 mt-4", children: l.status ===
|
|
5492
|
+
/* @__PURE__ */ a(fe, { className: "my-8" }),
|
|
5493
|
+
/* @__PURE__ */ a("p", { className: "text-center text-gray-600 dark:text-gray-400 mt-4", children: l.status === ye.IdentityPending ? "Loading identity verification..." : "Loading current step..." })
|
|
5470
5494
|
] }) }) });
|
|
5471
|
-
const
|
|
5495
|
+
const p = (v) => {
|
|
5472
5496
|
switch (v) {
|
|
5473
5497
|
case _.Overview:
|
|
5474
5498
|
return "Overview";
|
|
@@ -5491,28 +5515,28 @@ const ze = {
|
|
|
5491
5515
|
default:
|
|
5492
5516
|
return "";
|
|
5493
5517
|
}
|
|
5494
|
-
},
|
|
5495
|
-
const v = c.filter((f) => f.visibility !== !1), q = v.findIndex((f) => f.order === o.order),
|
|
5518
|
+
}, R = () => {
|
|
5519
|
+
const v = c.filter((f) => f.visibility !== !1), q = v.findIndex((f) => f.order === o.order), W = q >= 0 ? q + 1 : 1, T = v.length;
|
|
5496
5520
|
return /* @__PURE__ */ i("div", { className: "mb-6", children: [
|
|
5497
5521
|
/* @__PURE__ */ i("div", { className: "flex items-start justify-between mb-4", children: [
|
|
5498
|
-
/* @__PURE__ */ a(
|
|
5499
|
-
/* @__PURE__ */ i(
|
|
5522
|
+
/* @__PURE__ */ a(We, {}),
|
|
5523
|
+
/* @__PURE__ */ i(Ne, { variant: l.status === 1 ? "info" : "success", children: [
|
|
5500
5524
|
"Step ",
|
|
5501
|
-
|
|
5525
|
+
W,
|
|
5502
5526
|
" of ",
|
|
5503
5527
|
T
|
|
5504
5528
|
] })
|
|
5505
5529
|
] }),
|
|
5506
5530
|
/* @__PURE__ */ a("div", { className: "flex items-center", children: v.map((f, A) => {
|
|
5507
|
-
const
|
|
5508
|
-
return /* @__PURE__ */ i(
|
|
5531
|
+
const F = A < q, Y = f.order === o.order;
|
|
5532
|
+
return /* @__PURE__ */ i(he.Fragment, { children: [
|
|
5509
5533
|
/* @__PURE__ */ i("div", { className: "flex items-center", children: [
|
|
5510
5534
|
/* @__PURE__ */ a(
|
|
5511
5535
|
"div",
|
|
5512
5536
|
{
|
|
5513
5537
|
className: `
|
|
5514
5538
|
w-8 h-8 rounded-full flex items-center justify-center text-sm font-medium
|
|
5515
|
-
${
|
|
5539
|
+
${F || Y ? "bg-primary-500 text-white" : "bg-gray-200 text-gray-600 dark:bg-gray-700 dark:text-gray-400"}
|
|
5516
5540
|
`,
|
|
5517
5541
|
children: A + 1
|
|
5518
5542
|
}
|
|
@@ -5520,21 +5544,21 @@ const ze = {
|
|
|
5520
5544
|
/* @__PURE__ */ a(
|
|
5521
5545
|
"span",
|
|
5522
5546
|
{
|
|
5523
|
-
className: `ml-2 text-sm ${
|
|
5524
|
-
children: f.displayName || f.name ||
|
|
5547
|
+
className: `ml-2 text-sm ${Y ? "font-semibold text-gray-900 dark:text-white" : "text-gray-600 dark:text-gray-400"}`,
|
|
5548
|
+
children: f.displayName || f.name || p(f.action) || `Step ${A + 1}`
|
|
5525
5549
|
}
|
|
5526
5550
|
)
|
|
5527
5551
|
] }),
|
|
5528
5552
|
A < v.length - 1 && /* @__PURE__ */ a(
|
|
5529
5553
|
"div",
|
|
5530
5554
|
{
|
|
5531
|
-
className: `flex-1 h-0.5 mx-4 ${
|
|
5555
|
+
className: `flex-1 h-0.5 mx-4 ${F ? "bg-primary-500" : "bg-gray-200 dark:bg-gray-700"}`
|
|
5532
5556
|
}
|
|
5533
5557
|
)
|
|
5534
5558
|
] }, f.order);
|
|
5535
5559
|
}) })
|
|
5536
5560
|
] });
|
|
5537
|
-
},
|
|
5561
|
+
}, C = () => {
|
|
5538
5562
|
const v = {
|
|
5539
5563
|
applicantId: e,
|
|
5540
5564
|
onComplete: async () => {
|
|
@@ -5570,7 +5594,7 @@ const ze = {
|
|
|
5570
5594
|
);
|
|
5571
5595
|
default:
|
|
5572
5596
|
return /* @__PURE__ */ a($, { children: /* @__PURE__ */ i(B, { className: "py-12 text-center", children: [
|
|
5573
|
-
/* @__PURE__ */ a("div", { className: "mb-4", children: /* @__PURE__ */ a(
|
|
5597
|
+
/* @__PURE__ */ a("div", { className: "mb-4", children: /* @__PURE__ */ a(fe, {}) }),
|
|
5574
5598
|
/* @__PURE__ */ i("p", { className: "text-gray-600 dark:text-gray-400 mb-2", children: [
|
|
5575
5599
|
"Processing step: ",
|
|
5576
5600
|
o.title || o.name
|
|
@@ -5583,17 +5607,17 @@ const ze = {
|
|
|
5583
5607
|
}
|
|
5584
5608
|
};
|
|
5585
5609
|
return /* @__PURE__ */ i("div", { className: `metakyc-sdk ${s || ""}`, children: [
|
|
5586
|
-
|
|
5587
|
-
|
|
5610
|
+
R(),
|
|
5611
|
+
C()
|
|
5588
5612
|
] });
|
|
5589
5613
|
};
|
|
5590
5614
|
function ra(e) {
|
|
5591
|
-
return
|
|
5592
|
-
questionResults:
|
|
5615
|
+
return we.object({
|
|
5616
|
+
questionResults: we.any()
|
|
5593
5617
|
}).passthrough();
|
|
5594
5618
|
}
|
|
5595
5619
|
function $r(e) {
|
|
5596
|
-
let t =
|
|
5620
|
+
let t = we.array(we.instanceof(File));
|
|
5597
5621
|
if (e.isRequired ? t = t.min(
|
|
5598
5622
|
1,
|
|
5599
5623
|
`${e.displayName} is required`
|
|
@@ -5619,67 +5643,67 @@ function aa(e) {
|
|
|
5619
5643
|
return e.uploadDocumentFiles.forEach((r) => {
|
|
5620
5644
|
const n = `file_${r.id}`;
|
|
5621
5645
|
t[n] = $r(r);
|
|
5622
|
-
}),
|
|
5646
|
+
}), we.object(t);
|
|
5623
5647
|
}
|
|
5624
5648
|
function na(e) {
|
|
5625
|
-
return
|
|
5649
|
+
return we.any();
|
|
5626
5650
|
}
|
|
5627
5651
|
function Br(e) {
|
|
5628
|
-
return
|
|
5652
|
+
return we.string().min(1, "This question is required");
|
|
5629
5653
|
}
|
|
5630
5654
|
function sa(e) {
|
|
5631
5655
|
const t = {};
|
|
5632
5656
|
return e.appropriatenessQuestions.forEach((r) => {
|
|
5633
5657
|
const n = `question_${r.id}`;
|
|
5634
5658
|
t[n] = Br();
|
|
5635
|
-
}),
|
|
5659
|
+
}), we.object(t);
|
|
5636
5660
|
}
|
|
5637
|
-
const ia =
|
|
5661
|
+
const ia = we.any();
|
|
5638
5662
|
export {
|
|
5639
5663
|
Je as ALLOWED_LANGUAGES,
|
|
5640
5664
|
ht as ApplicantProgressOnHoldReason,
|
|
5641
|
-
|
|
5665
|
+
ye as ApplicantProgressStatus,
|
|
5642
5666
|
Rt as ApplicantService,
|
|
5643
5667
|
yt as ApplicantStatus,
|
|
5644
|
-
|
|
5668
|
+
kt as AppropriatenessQuestionType,
|
|
5645
5669
|
Pt as AppropriatenessTestService,
|
|
5646
5670
|
Mr as AppropriatenessTestStep,
|
|
5647
|
-
|
|
5671
|
+
Ne as Badge,
|
|
5648
5672
|
Ot as BaseInformationService,
|
|
5649
5673
|
U as Button,
|
|
5650
5674
|
$ as Card,
|
|
5651
5675
|
B as CardContent,
|
|
5652
|
-
|
|
5676
|
+
ue as CardFooter,
|
|
5653
5677
|
oe as CardHeader,
|
|
5654
5678
|
ea as CreateApplicantForm,
|
|
5655
5679
|
Nt as CriteriaBuiltInType,
|
|
5656
5680
|
Ct as DEFAULT_VISIBLE_FIELDS,
|
|
5657
5681
|
vt as DocumentReviewStatus,
|
|
5658
5682
|
It as EndpointBuilder,
|
|
5659
|
-
|
|
5683
|
+
Me as ErrorHandler,
|
|
5660
5684
|
Ht as EventEmitter,
|
|
5661
|
-
|
|
5685
|
+
qe as FIELD_METADATA,
|
|
5662
5686
|
bt as FileType,
|
|
5663
5687
|
pr as FileUpload,
|
|
5664
|
-
|
|
5665
|
-
|
|
5688
|
+
_e as GenderType,
|
|
5689
|
+
We as Header,
|
|
5666
5690
|
Et as HttpClient,
|
|
5667
5691
|
De as IdentityProviderManager,
|
|
5668
5692
|
Tt as IdentityService,
|
|
5669
|
-
|
|
5693
|
+
ge as IdentityVerificationProvider,
|
|
5670
5694
|
Tr as IdentityVerificationStep,
|
|
5671
|
-
|
|
5695
|
+
de as Input,
|
|
5672
5696
|
$t as InvestorCategorizationService,
|
|
5673
5697
|
Lr as InvestorCategorizationStep,
|
|
5674
|
-
|
|
5698
|
+
me as InvestorCategorizationType,
|
|
5675
5699
|
St as InvestorCategoryType,
|
|
5676
5700
|
ft as KycProcessStatus,
|
|
5677
|
-
|
|
5701
|
+
Ie as KycStatus,
|
|
5678
5702
|
et as KycStatusDisplay,
|
|
5679
5703
|
ta as KycWorkflow,
|
|
5680
5704
|
Or as Logo,
|
|
5681
5705
|
rt as MetaKYCContext,
|
|
5682
|
-
|
|
5706
|
+
ke as MetaKYCError,
|
|
5683
5707
|
Yr as MetaKYCProvider,
|
|
5684
5708
|
mr as MultiSelect,
|
|
5685
5709
|
Gt as OnfidoProvider,
|
|
@@ -5688,45 +5712,45 @@ export {
|
|
|
5688
5712
|
hr as PhoneInput,
|
|
5689
5713
|
Ft as QuestionnaireService,
|
|
5690
5714
|
Sr as QuestionnaireStep,
|
|
5691
|
-
|
|
5692
|
-
|
|
5715
|
+
Ee as ReviewStatus,
|
|
5716
|
+
wt as RiskCriteriaType,
|
|
5693
5717
|
gt as RiskLevel,
|
|
5694
5718
|
Mt as RiskScoringService,
|
|
5695
5719
|
Dr as RiskScoringStep,
|
|
5696
5720
|
Zt as SardinAIProvider,
|
|
5697
|
-
|
|
5698
|
-
|
|
5721
|
+
Ce as Select,
|
|
5722
|
+
fe as Spinner,
|
|
5699
5723
|
Yt as StepRouter,
|
|
5700
5724
|
Vt as SumsubProvider,
|
|
5701
5725
|
Jt as ThemeManager,
|
|
5702
|
-
|
|
5726
|
+
ie as ThemePreset,
|
|
5703
5727
|
jt as ThemeService,
|
|
5704
5728
|
Dt as UploadDocumentService,
|
|
5705
5729
|
Ar as UploadDocumentStep,
|
|
5706
5730
|
xt as UserType,
|
|
5707
|
-
|
|
5731
|
+
Se as ValueDataType,
|
|
5708
5732
|
Qt as WorkflowOrchestrator,
|
|
5709
|
-
|
|
5733
|
+
ze as WorkflowResultType,
|
|
5710
5734
|
Wt as WorkflowState,
|
|
5711
5735
|
_ as WorkflowStepAction,
|
|
5712
5736
|
ia as appropriatenessTestSchema,
|
|
5713
5737
|
Jr as clearAllStorage,
|
|
5714
5738
|
rr as clearApplicantId,
|
|
5715
5739
|
nr as clearWorkflowState,
|
|
5716
|
-
|
|
5740
|
+
le as cn,
|
|
5717
5741
|
Bt as corporateTheme,
|
|
5718
5742
|
At as defaultConfig,
|
|
5719
|
-
|
|
5743
|
+
ce as defaultTheme,
|
|
5720
5744
|
Xt as fileToBase64,
|
|
5721
5745
|
zt as fintechTheme,
|
|
5722
|
-
|
|
5746
|
+
Ke as formatFileSize,
|
|
5723
5747
|
sa as generateAppropriatenessSchema,
|
|
5724
5748
|
ra as generateQuestionnaireSchema,
|
|
5725
5749
|
na as generateRiskScoringSchema,
|
|
5726
5750
|
aa as generateUploadDocumentSchema,
|
|
5727
5751
|
Gr as getAcceptString,
|
|
5728
5752
|
tr as getApplicantId,
|
|
5729
|
-
|
|
5753
|
+
Te as getThemePreset,
|
|
5730
5754
|
Zr as getWorkflowState,
|
|
5731
5755
|
_t as healthcareTheme,
|
|
5732
5756
|
Hr as isScriptLoaded,
|
|
@@ -5741,7 +5765,7 @@ export {
|
|
|
5741
5765
|
Xr as useAppropriatenessTest,
|
|
5742
5766
|
cr as useIdentityVerification,
|
|
5743
5767
|
sr as useKycWorkflow,
|
|
5744
|
-
|
|
5768
|
+
pe as useMetaKYC,
|
|
5745
5769
|
or as useOverview,
|
|
5746
5770
|
ir as useQuestionnaire,
|
|
5747
5771
|
dr as useRiskScoring,
|