@vpdev2/metakyc-sdk 1.0.31 → 1.0.33
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 +12 -12
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +949 -928
- package/dist/index.js.map +1 -1
- package/dist/services/theme.service.d.ts.map +1 -1
- package/dist/theme/theme-manager.d.ts.map +1 -1
- package/dist/types/theme.d.ts +7 -1
- package/dist/types/theme.d.ts.map +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
|
-
var
|
|
2
|
-
var
|
|
3
|
-
var
|
|
4
|
-
import
|
|
1
|
+
var et = Object.defineProperty;
|
|
2
|
+
var tt = (t, e, r) => e in t ? et(t, e, { enumerable: !0, configurable: !0, writable: !0, value: r }) : t[e] = r;
|
|
3
|
+
var U = (t, e, r) => tt(t, typeof e != "symbol" ? e + "" : e, r);
|
|
4
|
+
import rt from "axios";
|
|
5
5
|
import * as Me from "react";
|
|
6
|
-
import
|
|
7
|
-
import { jsx as n, jsxs as o, Fragment as
|
|
8
|
-
import { get as
|
|
6
|
+
import re, { createContext as nt, useState as S, useMemo as Re, useEffect as Q, useContext as at, useRef as Y, useCallback as V, forwardRef as Le } from "react";
|
|
7
|
+
import { jsx as n, jsxs as o, Fragment as st } from "react/jsx-runtime";
|
|
8
|
+
import { get as Fe, set as Ee, appendErrors as Ue, useForm as Te, Controller as te } from "react-hook-form";
|
|
9
9
|
import { z as me } from "zod";
|
|
10
|
-
var
|
|
11
|
-
const
|
|
10
|
+
var $ = /* @__PURE__ */ ((t) => (t[t.IdentitySdk = 0] = "IdentitySdk", t[t.RiskScoring = 1] = "RiskScoring", t[t.Questionaries = 2] = "Questionaries", t[t.AdditionalData = 3] = "AdditionalData", t[t.AppropriatenessTest = 4] = "AppropriatenessTest", t[t.UploadDocument = 5] = "UploadDocument", t[t.ManualReview = 6] = "ManualReview", t[t.Overview = 7] = "Overview", t[t.InvestorCategorization = 8] = "InvestorCategorization", t))($ || {}), Ne = /* @__PURE__ */ ((t) => (t[t.NotStarted = 0] = "NotStarted", t[t.InProgress = 1] = "InProgress", t[t.Success = 2] = "Success", t[t.PartialSuccess = 3] = "PartialSuccess", t[t.Failed = 4] = "Failed", t[t.Skipped = 5] = "Skipped", t[t.AdminReview = 6] = "AdminReview", t[t.SkippedAndAdminReview = 7] = "SkippedAndAdminReview", t))(Ne || {}), ce = /* @__PURE__ */ ((t) => (t[t.None = 0] = "None", t[t.InProgress = 1] = "InProgress", t[t.Finished = 2] = "Finished", t[t.OnHold = 3] = "OnHold", t[t.IdentityPending = 4] = "IdentityPending", t))(ce || {}), it = /* @__PURE__ */ ((t) => (t[t.None = 0] = "None", t[t.RepresentativeKYC = 1] = "RepresentativeKYC", t[t.ManualRiskCriteria = 2] = "ManualRiskCriteria", t[t.UploadDocumentReview = 3] = "UploadDocumentReview", t[t.AdminReview = 4] = "AdminReview", t))(it || {}), ot = /* @__PURE__ */ ((t) => (t[t.LowRisk = 0] = "LowRisk", t[t.MediumRisk = 1] = "MediumRisk", t[t.HighRisk = 2] = "HighRisk", t[t.Alert = 3] = "Alert", t))(ot || {}), ye = /* @__PURE__ */ ((t) => (t[t.None = 0] = "None", t[t.Pending = 1] = "Pending", t[t.Approved = 2] = "Approved", t[t.Rejected = 3] = "Rejected", t[t.ResendRequested = 4] = "ResendRequested", t[t.Unknown = 5] = "Unknown", t[t.InProgress = 6] = "InProgress", t))(ye || {}), fe = /* @__PURE__ */ ((t) => (t[t.Approved = 0] = "Approved", t[t.Reject = 1] = "Reject", t[t.UnderReview = 2] = "UnderReview", t[t.Closed = 3] = "Closed", t[t.AdminReview = 4] = "AdminReview", t[t.New = 5] = "New", t[t.InProgress = 6] = "InProgress", t))(fe || {}), lt = /* @__PURE__ */ ((t) => (t[t.ProviderResultPending = 0] = "ProviderResultPending", t[t.ProviderResultReceived = 1] = "ProviderResultReceived", t[t.Canceled = 2] = "Canceled", t[t.ExtendedToNewApplicant = 3] = "ExtendedToNewApplicant", t))(lt || {}), ct = /* @__PURE__ */ ((t) => (t[t.None = 0] = "None", t[t.ProviderResultPending = 1] = "ProviderResultPending", t[t.ProviderResultReceived = 2] = "ProviderResultReceived", t[t.Canceled = 3] = "Canceled", t))(ct || {}), le = /* @__PURE__ */ ((t) => (t[t.Onfido = 0] = "Onfido", t[t.Sumsub = 2] = "Sumsub", t[t.SardinAI = 3] = "SardinAI", t))(le || {}), dt = /* @__PURE__ */ ((t) => (t[t.Individual = 0] = "Individual", t[t.Company = 1] = "Company", t))(dt || {}), Se = /* @__PURE__ */ ((t) => (t[t.Male = 0] = "Male", t[t.Female = 1] = "Female", t[t.Other = 2] = "Other", t))(Se || {}), ut = /* @__PURE__ */ ((t) => (t[t.Image = 0] = "Image", t[t.Video = 1] = "Video", t[t.PDF = 2] = "PDF", t[t.OfficePDF = 3] = "OfficePDF", t[t.Custom = 4] = "Custom", t))(ut || {}), mt = /* @__PURE__ */ ((t) => (t[t.Pending = 0] = "Pending", t[t.Approved = 1] = "Approved", t[t.Rejected = 2] = "Rejected", t[t.RequiresRevision = 3] = "RequiresRevision", t))(mt || {}), ht = /* @__PURE__ */ ((t) => (t[t.SingleChoice = 0] = "SingleChoice", t[t.MultipleChoice = 1] = "MultipleChoice", t[t.Text = 2] = "Text", t))(ht || {}), De = /* @__PURE__ */ ((t) => (t[t.String = 0] = "String", t[t.Integer = 1] = "Integer", t[t.Decimal = 2] = "Decimal", t[t.Boolean = 3] = "Boolean", t[t.Date = 4] = "Date", t[t.Country = 5] = "Country", t[t.DigitOnly = 6] = "DigitOnly", t))(De || {}), pt = /* @__PURE__ */ ((t) => (t[t.Text = 0] = "Text", t[t.Radio = 1] = "Radio", t[t.Checkbox = 2] = "Checkbox", t[t.Dropdown = 3] = "Dropdown", t[t.Country = 4] = "Country", t))(pt || {}), gt = /* @__PURE__ */ ((t) => (t[t.None = 0] = "None", t[t.Country = 1] = "Country", t))(gt || {}), ae = /* @__PURE__ */ ((t) => (t[t.Individual = 0] = "Individual", t[t.Sophisticated = 1] = "Sophisticated", t[t.HighNetWorth = 2] = "HighNetWorth", t[t.Business = 3] = "Business", t))(ae || {}), yt = /* @__PURE__ */ ((t) => (t[t.Retail = 0] = "Retail", t[t.Professional = 1] = "Professional", t[t.EligibleCounterparty = 2] = "EligibleCounterparty", t))(yt || {});
|
|
11
|
+
const Oe = [
|
|
12
12
|
{ value: "EN", label: "English" },
|
|
13
13
|
{ value: "DE", label: "German" },
|
|
14
14
|
{ value: "FR", label: "French" },
|
|
@@ -26,7 +26,7 @@ const gt = [
|
|
|
26
26
|
{ value: "DA", label: "Danish" },
|
|
27
27
|
{ value: "FI", label: "Finnish" },
|
|
28
28
|
{ value: "NO", label: "Norwegian" }
|
|
29
|
-
],
|
|
29
|
+
], ft = [
|
|
30
30
|
"firstName",
|
|
31
31
|
"lastName",
|
|
32
32
|
"email",
|
|
@@ -64,7 +64,7 @@ const gt = [
|
|
|
64
64
|
"occupation",
|
|
65
65
|
"taxNumber",
|
|
66
66
|
"externalRefId"
|
|
67
|
-
],
|
|
67
|
+
], Be = {
|
|
68
68
|
firstName: { label: "First Name", type: "text" },
|
|
69
69
|
lastName: { label: "Last Name", type: "text" },
|
|
70
70
|
title: { label: "Title", type: "text" },
|
|
@@ -89,7 +89,7 @@ const gt = [
|
|
|
89
89
|
taxNumber: { label: "Tax Number", type: "text" },
|
|
90
90
|
externalRefId: { label: "External Reference ID", type: "text" }
|
|
91
91
|
};
|
|
92
|
-
var
|
|
92
|
+
var Z = /* @__PURE__ */ ((t) => (t.Default = "default", t.Corporate = "corporate", t.Fintech = "fintech", t.Healthcare = "healthcare", t.Modern = "modern", t.Minimal = "minimal", t))(Z || {});
|
|
93
93
|
const bt = {
|
|
94
94
|
timeout: 3e4,
|
|
95
95
|
retries: 3,
|
|
@@ -141,7 +141,7 @@ class vt {
|
|
|
141
141
|
class ue extends Error {
|
|
142
142
|
constructor(r, a, s, i, l) {
|
|
143
143
|
super(r);
|
|
144
|
-
|
|
144
|
+
U(this, "response");
|
|
145
145
|
this.code = a, this.details = s, this.validationErrors = i, this.name = "MetaKYCError", this.response = l, Object.setPrototypeOf(this, ue.prototype);
|
|
146
146
|
}
|
|
147
147
|
}
|
|
@@ -197,10 +197,10 @@ class xe {
|
|
|
197
197
|
}
|
|
198
198
|
class xt {
|
|
199
199
|
constructor(e) {
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
this.config = { ...bt, ...e }, this.endpointBuilder = new vt(this.config.endpoints), this.axiosInstance =
|
|
200
|
+
U(this, "axiosInstance");
|
|
201
|
+
U(this, "endpointBuilder");
|
|
202
|
+
U(this, "config");
|
|
203
|
+
this.config = { ...bt, ...e }, this.endpointBuilder = new vt(this.config.endpoints), this.axiosInstance = rt.create({
|
|
204
204
|
baseURL: this.config.baseUrl,
|
|
205
205
|
timeout: this.config.timeout,
|
|
206
206
|
headers: {
|
|
@@ -664,7 +664,7 @@ class Rt {
|
|
|
664
664
|
)).result;
|
|
665
665
|
}
|
|
666
666
|
}
|
|
667
|
-
const
|
|
667
|
+
const ee = {
|
|
668
668
|
name: "Default",
|
|
669
669
|
title: "KYC Verification",
|
|
670
670
|
logo: {
|
|
@@ -723,7 +723,7 @@ const J = {
|
|
|
723
723
|
textMuted: "#9ca3af"
|
|
724
724
|
}
|
|
725
725
|
}
|
|
726
|
-
},
|
|
726
|
+
}, Ft = {
|
|
727
727
|
name: "Corporate",
|
|
728
728
|
logo: {
|
|
729
729
|
url: "",
|
|
@@ -756,7 +756,7 @@ const J = {
|
|
|
756
756
|
cardPadding: "1.5rem",
|
|
757
757
|
inputHeight: "2.5rem"
|
|
758
758
|
}
|
|
759
|
-
},
|
|
759
|
+
}, Dt = {
|
|
760
760
|
name: "Fintech",
|
|
761
761
|
logo: {
|
|
762
762
|
url: "",
|
|
@@ -789,7 +789,7 @@ const J = {
|
|
|
789
789
|
cardPadding: "2rem",
|
|
790
790
|
inputHeight: "3rem"
|
|
791
791
|
}
|
|
792
|
-
},
|
|
792
|
+
}, Pt = {
|
|
793
793
|
name: "Healthcare",
|
|
794
794
|
logo: {
|
|
795
795
|
url: "",
|
|
@@ -898,15 +898,15 @@ const J = {
|
|
|
898
898
|
inputHeight: "2.25rem"
|
|
899
899
|
}
|
|
900
900
|
}, Mt = {
|
|
901
|
-
[
|
|
902
|
-
[
|
|
903
|
-
[
|
|
904
|
-
[
|
|
905
|
-
[
|
|
906
|
-
[
|
|
901
|
+
[Z.Default]: ee,
|
|
902
|
+
[Z.Corporate]: Ft,
|
|
903
|
+
[Z.Fintech]: Dt,
|
|
904
|
+
[Z.Healthcare]: Pt,
|
|
905
|
+
[Z.Modern]: Lt,
|
|
906
|
+
[Z.Minimal]: Tt
|
|
907
907
|
};
|
|
908
908
|
function we(t) {
|
|
909
|
-
return Mt[t] ||
|
|
909
|
+
return Mt[t] || ee;
|
|
910
910
|
}
|
|
911
911
|
class Ot {
|
|
912
912
|
constructor(e) {
|
|
@@ -923,16 +923,16 @@ class Ot {
|
|
|
923
923
|
"GetThemeConfiguration"
|
|
924
924
|
);
|
|
925
925
|
if (!r.result.isEnabled)
|
|
926
|
-
return we(
|
|
927
|
-
let a = r.result.preset ? we(r.result.preset) : we(
|
|
926
|
+
return we(Z.Default);
|
|
927
|
+
let a = r.result.preset ? we(r.result.preset) : we(Z.Default);
|
|
928
928
|
return r.result.title && (a.title = r.result.title), r.result.logo && (a.logo = { ...a.logo, ...r.result.logo }), r.result.colors && (a.colors = { ...a.colors, ...r.result.colors }), r.result.typography && (a.typography = { ...a.typography, ...r.result.typography }), r.result.spacing && (a.spacing = { ...a.spacing, ...r.result.spacing }), r.result.customCSS && (a.customCSS = r.result.customCSS), r.result.darkMode && (a.darkMode = {
|
|
929
929
|
colors: {
|
|
930
930
|
...(e = a.darkMode) == null ? void 0 : e.colors,
|
|
931
931
|
...r.result.darkMode.colors
|
|
932
932
|
}
|
|
933
|
-
}), r.result.applicantFormVisibleFields && r.result.applicantFormVisibleFields.length > 0 && (a.applicantFormVisibleFields = r.result.applicantFormVisibleFields), a;
|
|
933
|
+
}), r.result.applicantFormVisibleFields && r.result.applicantFormVisibleFields.length > 0 && (a.applicantFormVisibleFields = r.result.applicantFormVisibleFields), r.result.applicantFormRequiredFields && r.result.applicantFormRequiredFields.length > 0 && (a.applicantFormRequiredFields = r.result.applicantFormRequiredFields), r.result.allowedLanguages && r.result.allowedLanguages.length > 0 && (a.allowedLanguages = r.result.allowedLanguages), a;
|
|
934
934
|
} catch (r) {
|
|
935
|
-
return console.warn("[ThemeService] Failed to fetch theme configuration:", r), we(
|
|
935
|
+
return console.warn("[ThemeService] Failed to fetch theme configuration:", r), we(Z.Default);
|
|
936
936
|
}
|
|
937
937
|
}
|
|
938
938
|
/**
|
|
@@ -946,12 +946,12 @@ class Ot {
|
|
|
946
946
|
*/
|
|
947
947
|
getAvailablePresets() {
|
|
948
948
|
return [
|
|
949
|
-
{ id:
|
|
950
|
-
{ id:
|
|
951
|
-
{ id:
|
|
952
|
-
{ id:
|
|
953
|
-
{ id:
|
|
954
|
-
{ id:
|
|
949
|
+
{ id: Z.Default, name: "Default" },
|
|
950
|
+
{ id: Z.Corporate, name: "Corporate" },
|
|
951
|
+
{ id: Z.Fintech, name: "Fintech" },
|
|
952
|
+
{ id: Z.Healthcare, name: "Healthcare" },
|
|
953
|
+
{ id: Z.Modern, name: "Modern" },
|
|
954
|
+
{ id: Z.Minimal, name: "Minimal" }
|
|
955
955
|
];
|
|
956
956
|
}
|
|
957
957
|
/**
|
|
@@ -971,7 +971,7 @@ class Ot {
|
|
|
971
971
|
}
|
|
972
972
|
class Bt {
|
|
973
973
|
constructor() {
|
|
974
|
-
|
|
974
|
+
U(this, "listeners", /* @__PURE__ */ new Map());
|
|
975
975
|
}
|
|
976
976
|
/**
|
|
977
977
|
* Subscribe to an event
|
|
@@ -1016,10 +1016,10 @@ class Bt {
|
|
|
1016
1016
|
}
|
|
1017
1017
|
class zt {
|
|
1018
1018
|
constructor() {
|
|
1019
|
-
|
|
1020
|
-
|
|
1021
|
-
|
|
1022
|
-
|
|
1019
|
+
U(this, "events", new Bt());
|
|
1020
|
+
U(this, "_applicantId", null);
|
|
1021
|
+
U(this, "_progress", null);
|
|
1022
|
+
U(this, "_error", null);
|
|
1023
1023
|
}
|
|
1024
1024
|
/**
|
|
1025
1025
|
* Get current applicant ID
|
|
@@ -1156,7 +1156,7 @@ class zt {
|
|
|
1156
1156
|
}
|
|
1157
1157
|
class $t {
|
|
1158
1158
|
constructor() {
|
|
1159
|
-
|
|
1159
|
+
U(this, "handlers", /* @__PURE__ */ new Map());
|
|
1160
1160
|
}
|
|
1161
1161
|
/**
|
|
1162
1162
|
* Register a step handler
|
|
@@ -1182,7 +1182,7 @@ class $t {
|
|
|
1182
1182
|
async loadStepData(e, r) {
|
|
1183
1183
|
const a = this.getHandler(e);
|
|
1184
1184
|
if (!a)
|
|
1185
|
-
throw new Error(`No handler registered for step action: ${
|
|
1185
|
+
throw new Error(`No handler registered for step action: ${$[e]}`);
|
|
1186
1186
|
return a.loadData(r);
|
|
1187
1187
|
}
|
|
1188
1188
|
/**
|
|
@@ -1191,61 +1191,61 @@ class $t {
|
|
|
1191
1191
|
async submitStepData(e, r) {
|
|
1192
1192
|
const a = this.getHandler(e);
|
|
1193
1193
|
if (!a)
|
|
1194
|
-
throw new Error(`No handler registered for step action: ${
|
|
1194
|
+
throw new Error(`No handler registered for step action: ${$[e]}`);
|
|
1195
1195
|
return a.submitData(r);
|
|
1196
1196
|
}
|
|
1197
1197
|
}
|
|
1198
|
-
class
|
|
1198
|
+
class qt {
|
|
1199
1199
|
constructor(e, r, a, s, i, l, c, d) {
|
|
1200
|
-
|
|
1201
|
-
|
|
1200
|
+
U(this, "state");
|
|
1201
|
+
U(this, "stepRouter");
|
|
1202
1202
|
this.applicantService = e, this.questionnaireService = r, this.uploadDocumentService = a, this.appropriatenessTestService = s, this.overviewService = i, this.riskScoringService = l, this.investorCategorizationService = d, this.state = new zt(), this.stepRouter = new $t(), this.registerStepHandlers();
|
|
1203
1203
|
}
|
|
1204
1204
|
/**
|
|
1205
1205
|
* Register all step handlers
|
|
1206
1206
|
*/
|
|
1207
1207
|
registerStepHandlers() {
|
|
1208
|
-
this.stepRouter.registerHandler(
|
|
1208
|
+
this.stepRouter.registerHandler($.Questionaries, {
|
|
1209
1209
|
loadData: (e) => this.questionnaireService.getQuestionnaire(e),
|
|
1210
1210
|
submitData: async (e) => {
|
|
1211
1211
|
await this.questionnaireService.fillQuestionnaire(e);
|
|
1212
1212
|
}
|
|
1213
|
-
}), this.stepRouter.registerHandler(
|
|
1213
|
+
}), this.stepRouter.registerHandler($.UploadDocument, {
|
|
1214
1214
|
loadData: (e) => this.uploadDocumentService.getUploadDocument(e),
|
|
1215
1215
|
submitData: (e) => this.uploadDocumentService.fillUploadDocument(e)
|
|
1216
|
-
}), this.stepRouter.registerHandler(
|
|
1216
|
+
}), this.stepRouter.registerHandler($.AppropriatenessTest, {
|
|
1217
1217
|
loadData: (e) => this.appropriatenessTestService.getAppropriatenessTest(e),
|
|
1218
1218
|
submitData: async (e) => {
|
|
1219
1219
|
await this.appropriatenessTestService.fillAppropriatenessTest(e);
|
|
1220
1220
|
}
|
|
1221
|
-
}), this.stepRouter.registerHandler(
|
|
1221
|
+
}), this.stepRouter.registerHandler($.Overview, {
|
|
1222
1222
|
loadData: (e) => this.overviewService.getOverviewData(e),
|
|
1223
1223
|
submitData: (e) => this.overviewService.passOverview(e.applicantId)
|
|
1224
|
-
}), this.stepRouter.registerHandler(
|
|
1224
|
+
}), this.stepRouter.registerHandler($.RiskScoring, {
|
|
1225
1225
|
loadData: (e) => this.riskScoringService.getRiskCriterias(e),
|
|
1226
1226
|
submitData: async (e) => {
|
|
1227
1227
|
await this.riskScoringService.submitRiskScoring(e);
|
|
1228
1228
|
}
|
|
1229
|
-
}), this.stepRouter.registerHandler(
|
|
1229
|
+
}), this.stepRouter.registerHandler($.IdentitySdk, {
|
|
1230
1230
|
loadData: async (e) => ({
|
|
1231
1231
|
applicantId: e,
|
|
1232
1232
|
message: "Identity verification required"
|
|
1233
1233
|
}),
|
|
1234
1234
|
submitData: async () => {
|
|
1235
1235
|
}
|
|
1236
|
-
}), this.stepRouter.registerHandler(
|
|
1236
|
+
}), this.stepRouter.registerHandler($.InvestorCategorization, {
|
|
1237
1237
|
loadData: (e) => this.investorCategorizationService.getInvestorCategorization(e),
|
|
1238
1238
|
submitData: async (e) => {
|
|
1239
1239
|
await this.investorCategorizationService.setInvestorCategorization(e);
|
|
1240
1240
|
}
|
|
1241
|
-
}), this.stepRouter.registerHandler(
|
|
1241
|
+
}), this.stepRouter.registerHandler($.ManualReview, {
|
|
1242
1242
|
loadData: async (e) => ({
|
|
1243
1243
|
applicantId: e,
|
|
1244
1244
|
message: "Your application is under manual review"
|
|
1245
1245
|
}),
|
|
1246
1246
|
submitData: async () => {
|
|
1247
1247
|
}
|
|
1248
|
-
}), this.stepRouter.registerHandler(
|
|
1248
|
+
}), this.stepRouter.registerHandler($.AdditionalData, {
|
|
1249
1249
|
loadData: async (e) => ({
|
|
1250
1250
|
applicantId: e,
|
|
1251
1251
|
message: "Additional data required"
|
|
@@ -1339,7 +1339,7 @@ class _t {
|
|
|
1339
1339
|
return this.stepRouter;
|
|
1340
1340
|
}
|
|
1341
1341
|
}
|
|
1342
|
-
function
|
|
1342
|
+
function Ke(t, e) {
|
|
1343
1343
|
return new Promise((r, a) => {
|
|
1344
1344
|
if (e && document.getElementById(e)) {
|
|
1345
1345
|
r();
|
|
@@ -1356,17 +1356,17 @@ function zr(t) {
|
|
|
1356
1356
|
const e = document.getElementById(t);
|
|
1357
1357
|
e && e.remove();
|
|
1358
1358
|
}
|
|
1359
|
-
class
|
|
1359
|
+
class _t {
|
|
1360
1360
|
constructor(e) {
|
|
1361
|
-
|
|
1362
|
-
|
|
1361
|
+
U(this, "sdk", null);
|
|
1362
|
+
U(this, "config");
|
|
1363
1363
|
this.config = e;
|
|
1364
1364
|
}
|
|
1365
1365
|
/**
|
|
1366
1366
|
* Load Sumsub SDK
|
|
1367
1367
|
*/
|
|
1368
1368
|
async loadSDK() {
|
|
1369
|
-
await
|
|
1369
|
+
await Ke(
|
|
1370
1370
|
"https://cdn.sumsub.com/websdk/v2/production/websdk.js",
|
|
1371
1371
|
"sumsub-sdk"
|
|
1372
1372
|
);
|
|
@@ -1411,17 +1411,17 @@ class jt {
|
|
|
1411
1411
|
this.sdk && this.sdk.on("idCheck.onError", e);
|
|
1412
1412
|
}
|
|
1413
1413
|
}
|
|
1414
|
-
class
|
|
1414
|
+
class jt {
|
|
1415
1415
|
constructor(e) {
|
|
1416
|
-
|
|
1417
|
-
|
|
1416
|
+
U(this, "sdk", null);
|
|
1417
|
+
U(this, "config");
|
|
1418
1418
|
this.config = e;
|
|
1419
1419
|
}
|
|
1420
1420
|
/**
|
|
1421
1421
|
* Load Onfido SDK
|
|
1422
1422
|
*/
|
|
1423
1423
|
async loadSDK() {
|
|
1424
|
-
await
|
|
1424
|
+
await Ke(
|
|
1425
1425
|
"https://sdk.onfido.com/v12.0.0/onfido.min.js",
|
|
1426
1426
|
"onfido-sdk"
|
|
1427
1427
|
);
|
|
@@ -1477,11 +1477,11 @@ class Ut {
|
|
|
1477
1477
|
this.sdk && (this.sdk.tearDown(), this.sdk = null);
|
|
1478
1478
|
}
|
|
1479
1479
|
}
|
|
1480
|
-
class
|
|
1480
|
+
class Ut {
|
|
1481
1481
|
constructor(e) {
|
|
1482
|
-
|
|
1483
|
-
|
|
1484
|
-
|
|
1482
|
+
U(this, "sardineContext", null);
|
|
1483
|
+
U(this, "config");
|
|
1484
|
+
U(this, "sessionKey");
|
|
1485
1485
|
this.config = e, this.sessionKey = e.sessionKey || this.generateSessionKey();
|
|
1486
1486
|
}
|
|
1487
1487
|
/**
|
|
@@ -1628,11 +1628,11 @@ class be {
|
|
|
1628
1628
|
static createProvider(e, r) {
|
|
1629
1629
|
switch (e) {
|
|
1630
1630
|
case le.Sumsub:
|
|
1631
|
-
return new
|
|
1631
|
+
return new _t(r);
|
|
1632
1632
|
case le.Onfido:
|
|
1633
|
-
return new
|
|
1633
|
+
return new jt(r);
|
|
1634
1634
|
case le.SardinAI:
|
|
1635
|
-
return new
|
|
1635
|
+
return new Ut(r);
|
|
1636
1636
|
default:
|
|
1637
1637
|
throw new Error(`Unsupported identity provider: ${e}`);
|
|
1638
1638
|
}
|
|
@@ -1673,9 +1673,9 @@ class be {
|
|
|
1673
1673
|
}
|
|
1674
1674
|
class Kt {
|
|
1675
1675
|
constructor(e) {
|
|
1676
|
-
|
|
1677
|
-
|
|
1678
|
-
|
|
1676
|
+
U(this, "currentTheme", ee);
|
|
1677
|
+
U(this, "customStyleElement", null);
|
|
1678
|
+
U(this, "container");
|
|
1679
1679
|
this.container = e || document.documentElement;
|
|
1680
1680
|
}
|
|
1681
1681
|
/**
|
|
@@ -1753,20 +1753,22 @@ class Kt {
|
|
|
1753
1753
|
mergeWithDefault(e) {
|
|
1754
1754
|
var r;
|
|
1755
1755
|
return {
|
|
1756
|
-
name: e.name ||
|
|
1757
|
-
title: e.title ||
|
|
1758
|
-
logo: { ...
|
|
1759
|
-
colors: { ...
|
|
1760
|
-
typography: e.typography ? { ...
|
|
1761
|
-
spacing: e.spacing ? { ...
|
|
1756
|
+
name: e.name || ee.name,
|
|
1757
|
+
title: e.title || ee.title,
|
|
1758
|
+
logo: { ...ee.logo, ...e.logo },
|
|
1759
|
+
colors: { ...ee.colors, ...e.colors },
|
|
1760
|
+
typography: e.typography ? { ...ee.typography, ...e.typography } : ee.typography,
|
|
1761
|
+
spacing: e.spacing ? { ...ee.spacing, ...e.spacing } : ee.spacing,
|
|
1762
1762
|
customCSS: e.customCSS,
|
|
1763
1763
|
darkMode: e.darkMode ? {
|
|
1764
1764
|
colors: {
|
|
1765
|
-
...(r =
|
|
1765
|
+
...(r = ee.darkMode) == null ? void 0 : r.colors,
|
|
1766
1766
|
...e.darkMode.colors
|
|
1767
1767
|
}
|
|
1768
|
-
} :
|
|
1769
|
-
applicantFormVisibleFields: e.applicantFormVisibleFields
|
|
1768
|
+
} : ee.darkMode,
|
|
1769
|
+
applicantFormVisibleFields: e.applicantFormVisibleFields,
|
|
1770
|
+
applicantFormRequiredFields: e.applicantFormRequiredFields,
|
|
1771
|
+
allowedLanguages: e.allowedLanguages
|
|
1770
1772
|
};
|
|
1771
1773
|
}
|
|
1772
1774
|
/**
|
|
@@ -1779,7 +1781,7 @@ class Kt {
|
|
|
1779
1781
|
* Reset to default theme
|
|
1780
1782
|
*/
|
|
1781
1783
|
resetTheme() {
|
|
1782
|
-
this.applyTheme(
|
|
1784
|
+
this.applyTheme(ee);
|
|
1783
1785
|
}
|
|
1784
1786
|
/**
|
|
1785
1787
|
* Remove all custom styles
|
|
@@ -1794,28 +1796,28 @@ class Kt {
|
|
|
1794
1796
|
return e.replace(/([a-z0-9])([A-Z])/g, "$1-$2").toLowerCase();
|
|
1795
1797
|
}
|
|
1796
1798
|
}
|
|
1797
|
-
const
|
|
1798
|
-
const [r, a] =
|
|
1799
|
-
const d = new xt(t), u = new wt(d), y = new kt(d),
|
|
1799
|
+
const He = nt(null), $r = ({ config: t, children: e }) => {
|
|
1800
|
+
const [r, a] = S(null), s = re.useRef(!1), i = re.useRef(!1), l = Re(() => {
|
|
1801
|
+
const d = new xt(t), u = new wt(d), y = new kt(d), v = new Nt(d), g = new St(d), w = new Ct(d), h = new At(d), x = new Et(d), p = new It(d), m = new Rt(d), A = new Ot(d), C = new Kt();
|
|
1800
1802
|
return {
|
|
1801
1803
|
httpClient: d,
|
|
1802
1804
|
applicantService: u,
|
|
1803
1805
|
questionnaireService: y,
|
|
1804
|
-
uploadDocumentService:
|
|
1806
|
+
uploadDocumentService: v,
|
|
1805
1807
|
appropriatenessTestService: g,
|
|
1806
|
-
overviewService:
|
|
1808
|
+
overviewService: w,
|
|
1807
1809
|
riskScoringService: h,
|
|
1808
|
-
identityService:
|
|
1810
|
+
identityService: x,
|
|
1809
1811
|
baseInformationService: p,
|
|
1810
1812
|
investorCategorizationService: m,
|
|
1811
1813
|
themeService: A,
|
|
1812
|
-
themeManager:
|
|
1814
|
+
themeManager: C
|
|
1813
1815
|
};
|
|
1814
1816
|
}, [t]), c = Re(() => ({
|
|
1815
1817
|
config: t,
|
|
1816
1818
|
...l,
|
|
1817
1819
|
currentTheme: r,
|
|
1818
|
-
createOrchestrator: () => new
|
|
1820
|
+
createOrchestrator: () => new qt(
|
|
1819
1821
|
l.applicantService,
|
|
1820
1822
|
l.questionnaireService,
|
|
1821
1823
|
l.uploadDocumentService,
|
|
@@ -1826,7 +1828,7 @@ const qe = tt(null), $r = ({ config: t, children: e }) => {
|
|
|
1826
1828
|
l.investorCategorizationService
|
|
1827
1829
|
)
|
|
1828
1830
|
}), [t, l, r]);
|
|
1829
|
-
return
|
|
1831
|
+
return Q(() => ((async () => {
|
|
1830
1832
|
if (s.current || i.current) {
|
|
1831
1833
|
console.log("[MetaKYC] Theme already loading or loaded, skipping...");
|
|
1832
1834
|
return;
|
|
@@ -1847,10 +1849,10 @@ const qe = tt(null), $r = ({ config: t, children: e }) => {
|
|
|
1847
1849
|
}
|
|
1848
1850
|
})(), () => {
|
|
1849
1851
|
l.themeManager.cleanup();
|
|
1850
|
-
}), []), /* @__PURE__ */ n(
|
|
1852
|
+
}), []), /* @__PURE__ */ n(He.Provider, { value: c, children: e });
|
|
1851
1853
|
};
|
|
1852
|
-
function
|
|
1853
|
-
const t =
|
|
1854
|
+
function oe() {
|
|
1855
|
+
const t = at(He);
|
|
1854
1856
|
if (!t)
|
|
1855
1857
|
throw new Error("useMetaKYC must be used within a MetaKYCProvider");
|
|
1856
1858
|
return t;
|
|
@@ -1864,10 +1866,10 @@ async function Ht(t) {
|
|
|
1864
1866
|
}, a.onerror = (s) => r(s);
|
|
1865
1867
|
});
|
|
1866
1868
|
}
|
|
1867
|
-
function
|
|
1869
|
+
function qr(t, e) {
|
|
1868
1870
|
return t.size <= e;
|
|
1869
1871
|
}
|
|
1870
|
-
function
|
|
1872
|
+
function _r(t, e) {
|
|
1871
1873
|
return e.split(",").map((a) => a.trim()).some((a) => {
|
|
1872
1874
|
if (a.endsWith("/*")) {
|
|
1873
1875
|
const s = a.slice(0, -2);
|
|
@@ -1881,10 +1883,10 @@ function Ie(t) {
|
|
|
1881
1883
|
const e = 1024, r = ["Bytes", "KB", "MB", "GB"], a = Math.floor(Math.log(t) / Math.log(e));
|
|
1882
1884
|
return Math.round(t / Math.pow(e, a) * 100) / 100 + " " + r[a];
|
|
1883
1885
|
}
|
|
1884
|
-
function
|
|
1886
|
+
function jr(t) {
|
|
1885
1887
|
return t;
|
|
1886
1888
|
}
|
|
1887
|
-
function
|
|
1889
|
+
function J(...t) {
|
|
1888
1890
|
return t.filter(Boolean).join(" ");
|
|
1889
1891
|
}
|
|
1890
1892
|
const ve = {
|
|
@@ -1920,7 +1922,7 @@ function Qt(t) {
|
|
|
1920
1922
|
console.warn("Failed to save workflow state to storage:", e);
|
|
1921
1923
|
}
|
|
1922
1924
|
}
|
|
1923
|
-
function
|
|
1925
|
+
function Ur() {
|
|
1924
1926
|
try {
|
|
1925
1927
|
const t = localStorage.getItem(ve.WORKFLOW_STATE);
|
|
1926
1928
|
return t ? JSON.parse(t) : null;
|
|
@@ -1939,21 +1941,21 @@ function Kr() {
|
|
|
1939
1941
|
Wt(), Gt();
|
|
1940
1942
|
}
|
|
1941
1943
|
function Zt(t) {
|
|
1942
|
-
const { createOrchestrator: e } =
|
|
1943
|
-
|
|
1944
|
+
const { createOrchestrator: e } = oe(), [r, a] = S(null), [s, i] = S(!1), [l, c] = S(null), d = Y(null), u = t || Yt();
|
|
1945
|
+
Q(() => {
|
|
1944
1946
|
d.current || (d.current = e());
|
|
1945
|
-
}, [e]),
|
|
1946
|
-
var
|
|
1947
|
+
}, [e]), Q(() => {
|
|
1948
|
+
var C;
|
|
1947
1949
|
r && u && (Vt(u), Qt({
|
|
1948
1950
|
applicantId: u,
|
|
1949
|
-
currentStepOrder: (
|
|
1951
|
+
currentStepOrder: (C = r.currentStep) == null ? void 0 : C.order,
|
|
1950
1952
|
status: r.status,
|
|
1951
1953
|
lastUpdated: (/* @__PURE__ */ new Date()).toISOString(),
|
|
1952
1954
|
workflowKey: r.workFlowKey,
|
|
1953
1955
|
nextWorkflowKey: r.nextWorkflowKey
|
|
1954
1956
|
}));
|
|
1955
1957
|
}, [r, u]);
|
|
1956
|
-
const y =
|
|
1958
|
+
const y = Y(!1), v = Y(!1), g = V(async () => {
|
|
1957
1959
|
if (!(!u || !d.current)) {
|
|
1958
1960
|
if (y.current) {
|
|
1959
1961
|
console.log("[Workflow] Load already in progress, skipping...");
|
|
@@ -1961,19 +1963,19 @@ function Zt(t) {
|
|
|
1961
1963
|
}
|
|
1962
1964
|
y.current = !0, i(!0), c(null);
|
|
1963
1965
|
try {
|
|
1964
|
-
const
|
|
1965
|
-
a(
|
|
1966
|
-
} catch (
|
|
1967
|
-
c(
|
|
1966
|
+
const C = await d.current.initialize(u);
|
|
1967
|
+
a(C), v.current = !0;
|
|
1968
|
+
} catch (C) {
|
|
1969
|
+
c(C);
|
|
1968
1970
|
} finally {
|
|
1969
1971
|
i(!1), y.current = !1;
|
|
1970
1972
|
}
|
|
1971
1973
|
}
|
|
1972
1974
|
}, [u]);
|
|
1973
|
-
|
|
1974
|
-
u && !
|
|
1975
|
+
Q(() => {
|
|
1976
|
+
u && !v.current && g();
|
|
1975
1977
|
}, [u, g]);
|
|
1976
|
-
const
|
|
1978
|
+
const w = V(async () => {
|
|
1977
1979
|
if (d.current) {
|
|
1978
1980
|
if (y.current) {
|
|
1979
1981
|
console.log("[Workflow] Refresh already in progress, skipping...");
|
|
@@ -1981,52 +1983,52 @@ function Zt(t) {
|
|
|
1981
1983
|
}
|
|
1982
1984
|
y.current = !0, i(!0), c(null);
|
|
1983
1985
|
try {
|
|
1984
|
-
const
|
|
1985
|
-
a(
|
|
1986
|
-
} catch (
|
|
1987
|
-
c(
|
|
1986
|
+
const C = await d.current.refreshProgress();
|
|
1987
|
+
a(C);
|
|
1988
|
+
} catch (C) {
|
|
1989
|
+
c(C);
|
|
1988
1990
|
} finally {
|
|
1989
1991
|
i(!1), y.current = !1;
|
|
1990
1992
|
}
|
|
1991
1993
|
}
|
|
1992
|
-
}, []), h =
|
|
1994
|
+
}, []), h = V(async () => {
|
|
1993
1995
|
if (d.current) {
|
|
1994
1996
|
i(!0), c(null);
|
|
1995
1997
|
try {
|
|
1996
|
-
const
|
|
1997
|
-
a(
|
|
1998
|
-
} catch (
|
|
1999
|
-
c(
|
|
1998
|
+
const C = await d.current.moveToNextStep();
|
|
1999
|
+
a(C);
|
|
2000
|
+
} catch (C) {
|
|
2001
|
+
c(C);
|
|
2000
2002
|
} finally {
|
|
2001
2003
|
i(!1);
|
|
2002
2004
|
}
|
|
2003
2005
|
}
|
|
2004
|
-
}, []),
|
|
2006
|
+
}, []), x = V(async () => {
|
|
2005
2007
|
if (d.current) {
|
|
2006
2008
|
i(!0), c(null);
|
|
2007
2009
|
try {
|
|
2008
|
-
const
|
|
2009
|
-
a(
|
|
2010
|
-
} catch (
|
|
2011
|
-
c(
|
|
2010
|
+
const C = await d.current.moveToPreviousStep();
|
|
2011
|
+
a(C);
|
|
2012
|
+
} catch (C) {
|
|
2013
|
+
c(C);
|
|
2012
2014
|
} finally {
|
|
2013
2015
|
i(!1);
|
|
2014
2016
|
}
|
|
2015
2017
|
}
|
|
2016
|
-
}, []), p =
|
|
2018
|
+
}, []), p = V(async (C) => {
|
|
2017
2019
|
if (d.current) {
|
|
2018
2020
|
i(!0), c(null);
|
|
2019
2021
|
try {
|
|
2020
|
-
await d.current.submitCurrentStep(
|
|
2021
|
-
const
|
|
2022
|
-
a(
|
|
2023
|
-
} catch (
|
|
2024
|
-
throw c(
|
|
2022
|
+
await d.current.submitCurrentStep(C);
|
|
2023
|
+
const N = await d.current.refreshProgress();
|
|
2024
|
+
a(N);
|
|
2025
|
+
} catch (N) {
|
|
2026
|
+
throw c(N), N;
|
|
2025
2027
|
} finally {
|
|
2026
2028
|
i(!1);
|
|
2027
2029
|
}
|
|
2028
2030
|
}
|
|
2029
|
-
}, []), m = Me.useMemo(() => r != null && r.stepInfoList ? [...r.stepInfoList].sort((
|
|
2031
|
+
}, []), m = Me.useMemo(() => r != null && r.stepInfoList ? [...r.stepInfoList].sort((C, N) => C.order - N.order) : [], [r == null ? void 0 : r.stepInfoList]), A = Me.useMemo(() => r ? r.nextWorkflowKey && r.nextWorkflowKey !== r.workFlowKey : !1, [r]);
|
|
2030
2032
|
return {
|
|
2031
2033
|
progress: r,
|
|
2032
2034
|
applicantId: u,
|
|
@@ -2041,15 +2043,15 @@ function Zt(t) {
|
|
|
2041
2043
|
error: l,
|
|
2042
2044
|
isComplete: (r == null ? void 0 : r.status) === ce.Finished,
|
|
2043
2045
|
isOnHold: (r == null ? void 0 : r.status) === ce.OnHold,
|
|
2044
|
-
refreshProgress:
|
|
2046
|
+
refreshProgress: w,
|
|
2045
2047
|
moveToNext: h,
|
|
2046
|
-
moveBack:
|
|
2048
|
+
moveBack: x,
|
|
2047
2049
|
submitCurrentStep: p,
|
|
2048
2050
|
orchestrator: d.current
|
|
2049
2051
|
};
|
|
2050
2052
|
}
|
|
2051
2053
|
function Jt(t) {
|
|
2052
|
-
const { questionnaireService: e } =
|
|
2054
|
+
const { questionnaireService: e } = oe(), [r, a] = S(null), [s, i] = S(!1), [l, c] = S(!1), [d, u] = S(null), y = Y(!1), v = Y(null), g = V(async () => {
|
|
2053
2055
|
if (t) {
|
|
2054
2056
|
if (y.current) {
|
|
2055
2057
|
console.log("[Questionnaire] Load already in progress, skipping...");
|
|
@@ -2058,7 +2060,7 @@ function Jt(t) {
|
|
|
2058
2060
|
y.current = !0, i(!0), u(null);
|
|
2059
2061
|
try {
|
|
2060
2062
|
const h = await e.getQuestionnaire(t);
|
|
2061
|
-
a(h),
|
|
2063
|
+
a(h), v.current = t;
|
|
2062
2064
|
} catch (h) {
|
|
2063
2065
|
u(h);
|
|
2064
2066
|
} finally {
|
|
@@ -2066,16 +2068,16 @@ function Jt(t) {
|
|
|
2066
2068
|
}
|
|
2067
2069
|
}
|
|
2068
2070
|
}, [t, e]);
|
|
2069
|
-
|
|
2070
|
-
t &&
|
|
2071
|
+
Q(() => {
|
|
2072
|
+
t && v.current !== t && g();
|
|
2071
2073
|
}, [t]);
|
|
2072
|
-
const
|
|
2074
|
+
const w = V(
|
|
2073
2075
|
async (h) => {
|
|
2074
2076
|
c(!0), u(null);
|
|
2075
2077
|
try {
|
|
2076
2078
|
return await e.fillQuestionnaire(h);
|
|
2077
|
-
} catch (
|
|
2078
|
-
throw u(
|
|
2079
|
+
} catch (x) {
|
|
2080
|
+
throw u(x), x;
|
|
2079
2081
|
} finally {
|
|
2080
2082
|
c(!1);
|
|
2081
2083
|
}
|
|
@@ -2088,37 +2090,37 @@ function Jt(t) {
|
|
|
2088
2090
|
isSubmitting: l,
|
|
2089
2091
|
error: d,
|
|
2090
2092
|
load: g,
|
|
2091
|
-
submit:
|
|
2093
|
+
submit: w
|
|
2092
2094
|
};
|
|
2093
2095
|
}
|
|
2094
2096
|
function Xt(t) {
|
|
2095
|
-
const { uploadDocumentService: e } =
|
|
2097
|
+
const { uploadDocumentService: e } = oe(), [r, a] = S(null), [s, i] = S(!1), [l, c] = S(!1), [d, u] = S(0), [y, v] = S(null), g = Y(!1), w = Y(null), h = V(async () => {
|
|
2096
2098
|
if (t) {
|
|
2097
2099
|
if (g.current) {
|
|
2098
2100
|
console.log("[UploadDocument] Load already in progress, skipping...");
|
|
2099
2101
|
return;
|
|
2100
2102
|
}
|
|
2101
|
-
g.current = !0, i(!0),
|
|
2103
|
+
g.current = !0, i(!0), v(null);
|
|
2102
2104
|
try {
|
|
2103
2105
|
const p = await e.getUploadDocument(t);
|
|
2104
|
-
a(p),
|
|
2106
|
+
a(p), w.current = t;
|
|
2105
2107
|
} catch (p) {
|
|
2106
|
-
|
|
2108
|
+
v(p);
|
|
2107
2109
|
} finally {
|
|
2108
2110
|
i(!1), g.current = !1;
|
|
2109
2111
|
}
|
|
2110
2112
|
}
|
|
2111
2113
|
}, [t, e]);
|
|
2112
|
-
|
|
2113
|
-
t &&
|
|
2114
|
+
Q(() => {
|
|
2115
|
+
t && w.current !== t && h();
|
|
2114
2116
|
}, [t]);
|
|
2115
|
-
const
|
|
2117
|
+
const x = V(
|
|
2116
2118
|
async (p) => {
|
|
2117
|
-
c(!0), u(0),
|
|
2119
|
+
c(!0), u(0), v(null);
|
|
2118
2120
|
try {
|
|
2119
2121
|
await e.fillUploadDocument(p), u(100);
|
|
2120
2122
|
} catch (m) {
|
|
2121
|
-
throw
|
|
2123
|
+
throw v(m), m;
|
|
2122
2124
|
} finally {
|
|
2123
2125
|
c(!1);
|
|
2124
2126
|
}
|
|
@@ -2132,11 +2134,11 @@ function Xt(t) {
|
|
|
2132
2134
|
uploadProgress: d,
|
|
2133
2135
|
error: y,
|
|
2134
2136
|
load: h,
|
|
2135
|
-
submit:
|
|
2137
|
+
submit: x
|
|
2136
2138
|
};
|
|
2137
2139
|
}
|
|
2138
2140
|
function Hr(t) {
|
|
2139
|
-
const { appropriatenessTestService: e } =
|
|
2141
|
+
const { appropriatenessTestService: e } = oe(), [r, a] = S(null), [s, i] = S(!1), [l, c] = S(!1), [d, u] = S(null), [y, v] = S(null), g = Y(!1), w = Y(null), h = V(async () => {
|
|
2140
2142
|
if (t) {
|
|
2141
2143
|
if (g.current) {
|
|
2142
2144
|
console.log("[AppropriatenessTest] Load already in progress, skipping...");
|
|
@@ -2145,7 +2147,7 @@ function Hr(t) {
|
|
|
2145
2147
|
g.current = !0, i(!0), u(null);
|
|
2146
2148
|
try {
|
|
2147
2149
|
const p = await e.getAppropriatenessTest(t);
|
|
2148
|
-
a(p),
|
|
2150
|
+
a(p), w.current = t;
|
|
2149
2151
|
} catch (p) {
|
|
2150
2152
|
u(p);
|
|
2151
2153
|
} finally {
|
|
@@ -2153,15 +2155,15 @@ function Hr(t) {
|
|
|
2153
2155
|
}
|
|
2154
2156
|
}
|
|
2155
2157
|
}, [t, e]);
|
|
2156
|
-
|
|
2157
|
-
t &&
|
|
2158
|
+
Q(() => {
|
|
2159
|
+
t && w.current !== t && h();
|
|
2158
2160
|
}, [t]);
|
|
2159
|
-
const
|
|
2161
|
+
const x = V(
|
|
2160
2162
|
async (p) => {
|
|
2161
2163
|
c(!0), u(null);
|
|
2162
2164
|
try {
|
|
2163
2165
|
const m = await e.fillAppropriatenessTest(p);
|
|
2164
|
-
return
|
|
2166
|
+
return v(m), m;
|
|
2165
2167
|
} catch (m) {
|
|
2166
2168
|
throw u(m), m;
|
|
2167
2169
|
} finally {
|
|
@@ -2177,11 +2179,11 @@ function Hr(t) {
|
|
|
2177
2179
|
isSubmitting: l,
|
|
2178
2180
|
error: d,
|
|
2179
2181
|
load: h,
|
|
2180
|
-
submit:
|
|
2182
|
+
submit: x
|
|
2181
2183
|
};
|
|
2182
2184
|
}
|
|
2183
2185
|
function er(t) {
|
|
2184
|
-
const { overviewService: e } =
|
|
2186
|
+
const { overviewService: e } = oe(), [r, a] = S(null), [s, i] = S(!1), [l, c] = S(!1), [d, u] = S(null), y = Y(!1), v = Y(null), g = V(async () => {
|
|
2185
2187
|
if (t) {
|
|
2186
2188
|
if (y.current) {
|
|
2187
2189
|
console.log("[Overview] Load already in progress, skipping...");
|
|
@@ -2190,7 +2192,7 @@ function er(t) {
|
|
|
2190
2192
|
y.current = !0, i(!0), u(null);
|
|
2191
2193
|
try {
|
|
2192
2194
|
const h = await e.getOverviewData(t);
|
|
2193
|
-
a(h),
|
|
2195
|
+
a(h), v.current = t;
|
|
2194
2196
|
} catch (h) {
|
|
2195
2197
|
u(h);
|
|
2196
2198
|
} finally {
|
|
@@ -2198,10 +2200,10 @@ function er(t) {
|
|
|
2198
2200
|
}
|
|
2199
2201
|
}
|
|
2200
2202
|
}, [t, e]);
|
|
2201
|
-
|
|
2202
|
-
t &&
|
|
2203
|
+
Q(() => {
|
|
2204
|
+
t && v.current !== t && g();
|
|
2203
2205
|
}, [t]);
|
|
2204
|
-
const
|
|
2206
|
+
const w = V(async () => {
|
|
2205
2207
|
if (t) {
|
|
2206
2208
|
c(!0), u(null);
|
|
2207
2209
|
try {
|
|
@@ -2219,14 +2221,14 @@ function er(t) {
|
|
|
2219
2221
|
isSubmitting: l,
|
|
2220
2222
|
error: d,
|
|
2221
2223
|
load: g,
|
|
2222
|
-
passOverview:
|
|
2224
|
+
passOverview: w
|
|
2223
2225
|
};
|
|
2224
2226
|
}
|
|
2225
2227
|
function tr(t) {
|
|
2226
|
-
const { identityService: e } =
|
|
2228
|
+
const { identityService: e } = oe(), [r, a] = S(
|
|
2227
2229
|
null
|
|
2228
|
-
), [s, i] =
|
|
2229
|
-
async (g,
|
|
2230
|
+
), [s, i] = S(!1), [l, c] = S(null), d = Y(!1), u = V(
|
|
2231
|
+
async (g, w) => {
|
|
2230
2232
|
if (t) {
|
|
2231
2233
|
if (d.current) {
|
|
2232
2234
|
console.log("[Identity] Request already in progress, skipping...");
|
|
@@ -2238,12 +2240,12 @@ function tr(t) {
|
|
|
2238
2240
|
applicantId: t,
|
|
2239
2241
|
restart: !1,
|
|
2240
2242
|
redirectUrl: g || "",
|
|
2241
|
-
ttl:
|
|
2243
|
+
ttl: w || 604800
|
|
2242
2244
|
// Default: 7 days
|
|
2243
2245
|
};
|
|
2244
2246
|
console.log("Identity request input:", h);
|
|
2245
|
-
const
|
|
2246
|
-
return console.log("Identity request result:",
|
|
2247
|
+
const x = await e.identityRequest(h);
|
|
2248
|
+
return console.log("Identity request result:", x), a(x), x;
|
|
2247
2249
|
} catch (h) {
|
|
2248
2250
|
throw c(h), h;
|
|
2249
2251
|
} finally {
|
|
@@ -2252,8 +2254,8 @@ function tr(t) {
|
|
|
2252
2254
|
}
|
|
2253
2255
|
},
|
|
2254
2256
|
[t, e]
|
|
2255
|
-
), y =
|
|
2256
|
-
async (g,
|
|
2257
|
+
), y = V(
|
|
2258
|
+
async (g, w) => {
|
|
2257
2259
|
if (t) {
|
|
2258
2260
|
i(!0), c(null);
|
|
2259
2261
|
try {
|
|
@@ -2261,9 +2263,9 @@ function tr(t) {
|
|
|
2261
2263
|
applicantId: t,
|
|
2262
2264
|
restart: !1,
|
|
2263
2265
|
redirectUrl: g,
|
|
2264
|
-
ttl:
|
|
2265
|
-
},
|
|
2266
|
-
return a(
|
|
2266
|
+
ttl: w
|
|
2267
|
+
}, x = await e.identityCompanyRequest(h);
|
|
2268
|
+
return a(x), x;
|
|
2267
2269
|
} catch (h) {
|
|
2268
2270
|
throw c(h), h;
|
|
2269
2271
|
} finally {
|
|
@@ -2272,7 +2274,7 @@ function tr(t) {
|
|
|
2272
2274
|
}
|
|
2273
2275
|
},
|
|
2274
2276
|
[t, e]
|
|
2275
|
-
),
|
|
2277
|
+
), v = V(async () => {
|
|
2276
2278
|
if (t) {
|
|
2277
2279
|
if (d.current) {
|
|
2278
2280
|
console.log("[Identity] Restart already in progress, skipping...");
|
|
@@ -2288,8 +2290,8 @@ function tr(t) {
|
|
|
2288
2290
|
// 7 days
|
|
2289
2291
|
};
|
|
2290
2292
|
console.log("Restarting identity with input:", g);
|
|
2291
|
-
const
|
|
2292
|
-
return console.log("Restart identity result:",
|
|
2293
|
+
const w = await e.identityRequest(g);
|
|
2294
|
+
return console.log("Restart identity result:", w), a(w), w;
|
|
2293
2295
|
} catch (g) {
|
|
2294
2296
|
throw c(g), g;
|
|
2295
2297
|
} finally {
|
|
@@ -2305,11 +2307,11 @@ function tr(t) {
|
|
|
2305
2307
|
error: l,
|
|
2306
2308
|
requestIdentity: u,
|
|
2307
2309
|
requestCompanyIdentity: y,
|
|
2308
|
-
restartIdentity:
|
|
2310
|
+
restartIdentity: v
|
|
2309
2311
|
};
|
|
2310
2312
|
}
|
|
2311
2313
|
function rr(t) {
|
|
2312
|
-
const { riskScoringService: e } =
|
|
2314
|
+
const { riskScoringService: e } = oe(), [r, a] = S(null), [s, i] = S(!1), [l, c] = S(!1), [d, u] = S(null), [y, v] = S(null), g = Y(!1), w = Y(null), h = V(async () => {
|
|
2313
2315
|
if (t) {
|
|
2314
2316
|
if (g.current) {
|
|
2315
2317
|
console.log("[RiskScoring] Load already in progress, skipping...");
|
|
@@ -2318,7 +2320,7 @@ function rr(t) {
|
|
|
2318
2320
|
g.current = !0, i(!0), u(null);
|
|
2319
2321
|
try {
|
|
2320
2322
|
const p = await e.getRiskCriterias(t);
|
|
2321
|
-
a(p),
|
|
2323
|
+
a(p), w.current = t;
|
|
2322
2324
|
} catch (p) {
|
|
2323
2325
|
u(p);
|
|
2324
2326
|
} finally {
|
|
@@ -2326,15 +2328,15 @@ function rr(t) {
|
|
|
2326
2328
|
}
|
|
2327
2329
|
}
|
|
2328
2330
|
}, [t, e]);
|
|
2329
|
-
|
|
2330
|
-
t &&
|
|
2331
|
+
Q(() => {
|
|
2332
|
+
t && w.current !== t && h();
|
|
2331
2333
|
}, [t]);
|
|
2332
|
-
const
|
|
2334
|
+
const x = V(
|
|
2333
2335
|
async (p) => {
|
|
2334
2336
|
c(!0), u(null);
|
|
2335
2337
|
try {
|
|
2336
2338
|
const m = await e.submitRiskScoring(p);
|
|
2337
|
-
return
|
|
2339
|
+
return v(m), m;
|
|
2338
2340
|
} catch (m) {
|
|
2339
2341
|
throw u(m), m;
|
|
2340
2342
|
} finally {
|
|
@@ -2350,40 +2352,40 @@ function rr(t) {
|
|
|
2350
2352
|
isSubmitting: l,
|
|
2351
2353
|
error: d,
|
|
2352
2354
|
load: h,
|
|
2353
|
-
submit:
|
|
2355
|
+
submit: x
|
|
2354
2356
|
};
|
|
2355
2357
|
}
|
|
2356
2358
|
function nr() {
|
|
2357
|
-
const { applicantService: t, config: e } =
|
|
2359
|
+
const { applicantService: t, config: e } = oe(), [r, a] = S(!1), [s, i] = S(null), l = Y(!1), c = Y(!1), d = () => "xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g, function(w) {
|
|
2358
2360
|
const h = Math.random() * 16 | 0;
|
|
2359
|
-
return (
|
|
2360
|
-
}), u =
|
|
2361
|
-
async (
|
|
2361
|
+
return (w === "x" ? h : h & 3 | 8).toString(16);
|
|
2362
|
+
}), u = V(
|
|
2363
|
+
async (w) => {
|
|
2362
2364
|
var h;
|
|
2363
2365
|
if (l.current)
|
|
2364
2366
|
throw console.log("[Applicant] Create already in progress, skipping..."), new Error("Creation already in progress");
|
|
2365
2367
|
l.current = !0, a(!0), i(null);
|
|
2366
2368
|
try {
|
|
2367
|
-
if (
|
|
2369
|
+
if (w.applicantAdditionalDatas || (w.applicantAdditionalDatas = []), (h = e.identityProviders) != null && h.sardinai) {
|
|
2368
2370
|
const p = d();
|
|
2369
|
-
console.log("[SardinAI] Generated session key:", p),
|
|
2371
|
+
console.log("[SardinAI] Generated session key:", p), w.applicantAdditionalDatas.push({
|
|
2370
2372
|
paramName: "sessionKey",
|
|
2371
2373
|
value: p
|
|
2372
2374
|
});
|
|
2373
2375
|
}
|
|
2374
|
-
return await t.createApplicant(
|
|
2375
|
-
} catch (
|
|
2376
|
-
throw i(
|
|
2376
|
+
return await t.createApplicant(w);
|
|
2377
|
+
} catch (x) {
|
|
2378
|
+
throw i(x), x;
|
|
2377
2379
|
} finally {
|
|
2378
2380
|
a(!1), l.current = !1;
|
|
2379
2381
|
}
|
|
2380
2382
|
},
|
|
2381
2383
|
[t, e]
|
|
2382
|
-
), y =
|
|
2383
|
-
async (
|
|
2384
|
+
), y = V(
|
|
2385
|
+
async (w) => {
|
|
2384
2386
|
a(!0), i(null);
|
|
2385
2387
|
try {
|
|
2386
|
-
return await t.createCompanyApplicant(
|
|
2388
|
+
return await t.createCompanyApplicant(w);
|
|
2387
2389
|
} catch (h) {
|
|
2388
2390
|
throw i(h), h;
|
|
2389
2391
|
} finally {
|
|
@@ -2391,13 +2393,13 @@ function nr() {
|
|
|
2391
2393
|
}
|
|
2392
2394
|
},
|
|
2393
2395
|
[t]
|
|
2394
|
-
),
|
|
2395
|
-
async (
|
|
2396
|
+
), v = V(
|
|
2397
|
+
async (w) => {
|
|
2396
2398
|
if (c.current)
|
|
2397
2399
|
throw console.log("[Applicant] Data load already in progress, skipping..."), new Error("Data load already in progress");
|
|
2398
2400
|
c.current = !0, a(!0), i(null);
|
|
2399
2401
|
try {
|
|
2400
|
-
return await t.getApplicantData(
|
|
2402
|
+
return await t.getApplicantData(w);
|
|
2401
2403
|
} catch (h) {
|
|
2402
2404
|
throw i(h), h;
|
|
2403
2405
|
} finally {
|
|
@@ -2405,11 +2407,11 @@ function nr() {
|
|
|
2405
2407
|
}
|
|
2406
2408
|
},
|
|
2407
2409
|
[t]
|
|
2408
|
-
), g =
|
|
2409
|
-
async (
|
|
2410
|
+
), g = V(
|
|
2411
|
+
async (w) => {
|
|
2410
2412
|
a(!0), i(null);
|
|
2411
2413
|
try {
|
|
2412
|
-
await t.stopProgress(
|
|
2414
|
+
await t.stopProgress(w);
|
|
2413
2415
|
} catch (h) {
|
|
2414
2416
|
throw i(h), h;
|
|
2415
2417
|
} finally {
|
|
@@ -2423,7 +2425,7 @@ function nr() {
|
|
|
2423
2425
|
error: s,
|
|
2424
2426
|
createApplicant: u,
|
|
2425
2427
|
createCompanyApplicant: y,
|
|
2426
|
-
getApplicantData:
|
|
2428
|
+
getApplicantData: v,
|
|
2427
2429
|
stopProgress: g
|
|
2428
2430
|
};
|
|
2429
2431
|
}
|
|
@@ -2450,7 +2452,7 @@ const j = ({
|
|
|
2450
2452
|
return /* @__PURE__ */ o(
|
|
2451
2453
|
"button",
|
|
2452
2454
|
{
|
|
2453
|
-
className:
|
|
2455
|
+
className: J(c, d[e], u[r], i),
|
|
2454
2456
|
disabled: s || a,
|
|
2455
2457
|
...l,
|
|
2456
2458
|
children: [
|
|
@@ -2488,7 +2490,7 @@ const j = ({
|
|
|
2488
2490
|
]
|
|
2489
2491
|
}
|
|
2490
2492
|
);
|
|
2491
|
-
},
|
|
2493
|
+
}, se = Le(
|
|
2492
2494
|
({ label: t, error: e, helperText: r, leftIcon: a, rightIcon: s, className: i, ...l }, c) => /* @__PURE__ */ o("div", { className: "w-full", children: [
|
|
2493
2495
|
t && /* @__PURE__ */ o("label", { className: "block text-sm font-medium text-gray-700 dark:text-gray-300 mb-1", children: [
|
|
2494
2496
|
t,
|
|
@@ -2500,7 +2502,7 @@ const j = ({
|
|
|
2500
2502
|
"input",
|
|
2501
2503
|
{
|
|
2502
2504
|
ref: c,
|
|
2503
|
-
className:
|
|
2505
|
+
className: J(
|
|
2504
2506
|
"block w-full rounded-lg border px-3 py-2 text-sm transition-colors",
|
|
2505
2507
|
"focus:outline-none focus:ring-2 focus:ring-primary-500 focus:border-transparent",
|
|
2506
2508
|
"disabled:bg-gray-100 disabled:cursor-not-allowed",
|
|
@@ -2519,11 +2521,11 @@ const j = ({
|
|
|
2519
2521
|
!e && r && /* @__PURE__ */ n("p", { className: "mt-1 text-sm text-gray-500", children: r })
|
|
2520
2522
|
] })
|
|
2521
2523
|
);
|
|
2522
|
-
|
|
2523
|
-
const
|
|
2524
|
+
se.displayName = "Input";
|
|
2525
|
+
const M = ({ children: t, className: e, ...r }) => /* @__PURE__ */ n(
|
|
2524
2526
|
"div",
|
|
2525
2527
|
{
|
|
2526
|
-
className:
|
|
2528
|
+
className: J(
|
|
2527
2529
|
"metakyc-card rounded-xl shadow-sm border",
|
|
2528
2530
|
e
|
|
2529
2531
|
),
|
|
@@ -2534,20 +2536,20 @@ const T = ({ children: t, className: e, ...r }) => /* @__PURE__ */ n(
|
|
|
2534
2536
|
...r,
|
|
2535
2537
|
children: t
|
|
2536
2538
|
}
|
|
2537
|
-
),
|
|
2539
|
+
), ne = ({ children: t, className: e, ...r }) => /* @__PURE__ */ n(
|
|
2538
2540
|
"div",
|
|
2539
2541
|
{
|
|
2540
|
-
className:
|
|
2542
|
+
className: J("px-6 py-4 border-b", e),
|
|
2541
2543
|
style: {
|
|
2542
2544
|
borderColor: "var(--metakyc-border, #e5e7eb)"
|
|
2543
2545
|
},
|
|
2544
2546
|
...r,
|
|
2545
2547
|
children: t
|
|
2546
2548
|
}
|
|
2547
|
-
),
|
|
2549
|
+
), O = ({ children: t, className: e, ...r }) => /* @__PURE__ */ n("div", { className: J("px-6 py-4", e), ...r, children: t }), ie = ({ children: t, className: e, ...r }) => /* @__PURE__ */ n(
|
|
2548
2550
|
"div",
|
|
2549
2551
|
{
|
|
2550
|
-
className:
|
|
2552
|
+
className: J("px-6 py-4 border-t", e),
|
|
2551
2553
|
style: {
|
|
2552
2554
|
borderColor: "var(--metakyc-border, #e5e7eb)"
|
|
2553
2555
|
},
|
|
@@ -2557,7 +2559,7 @@ const T = ({ children: t, className: e, ...r }) => /* @__PURE__ */ n(
|
|
|
2557
2559
|
), pe = ({ children: t, variant: e = "default", className: r, ...a }) => /* @__PURE__ */ n(
|
|
2558
2560
|
"span",
|
|
2559
2561
|
{
|
|
2560
|
-
className:
|
|
2562
|
+
className: J(
|
|
2561
2563
|
"inline-flex items-center px-2.5 py-0.5 rounded-full text-xs font-medium",
|
|
2562
2564
|
{
|
|
2563
2565
|
default: "bg-gray-100 text-gray-800 dark:bg-gray-700 dark:text-gray-300",
|
|
@@ -2577,10 +2579,10 @@ const T = ({ children: t, className: e, ...r }) => /* @__PURE__ */ n(
|
|
|
2577
2579
|
md: "h-8 w-8",
|
|
2578
2580
|
lg: "h-12 w-12"
|
|
2579
2581
|
};
|
|
2580
|
-
return /* @__PURE__ */ n("div", { className:
|
|
2582
|
+
return /* @__PURE__ */ n("div", { className: J("flex items-center justify-center", e), ...r, children: /* @__PURE__ */ o(
|
|
2581
2583
|
"svg",
|
|
2582
2584
|
{
|
|
2583
|
-
className:
|
|
2585
|
+
className: J("animate-spin text-primary-500", a[t]),
|
|
2584
2586
|
xmlns: "http://www.w3.org/2000/svg",
|
|
2585
2587
|
fill: "none",
|
|
2586
2588
|
viewBox: "0 0 24 24",
|
|
@@ -2617,7 +2619,7 @@ const T = ({ children: t, className: e, ...r }) => /* @__PURE__ */ n(
|
|
|
2617
2619
|
"select",
|
|
2618
2620
|
{
|
|
2619
2621
|
ref: c,
|
|
2620
|
-
className:
|
|
2622
|
+
className: J(
|
|
2621
2623
|
"block w-full rounded-lg border px-3 py-2 text-sm transition-colors",
|
|
2622
2624
|
"focus:outline-none focus:ring-2 focus:ring-primary-500 focus:border-transparent",
|
|
2623
2625
|
"disabled:bg-gray-100 disabled:cursor-not-allowed",
|
|
@@ -2654,24 +2656,24 @@ const ar = ({
|
|
|
2654
2656
|
disabled: i = !1,
|
|
2655
2657
|
required: l = !1
|
|
2656
2658
|
}) => {
|
|
2657
|
-
const [c, d] =
|
|
2658
|
-
|
|
2659
|
+
const [c, d] = S(!1), [u, y] = S(""), v = Y(null);
|
|
2660
|
+
Q(() => {
|
|
2659
2661
|
const p = (m) => {
|
|
2660
|
-
|
|
2662
|
+
v.current && !v.current.contains(m.target) && (d(!1), y(""));
|
|
2661
2663
|
};
|
|
2662
2664
|
return document.addEventListener("mousedown", p), () => document.removeEventListener("mousedown", p);
|
|
2663
2665
|
}, []);
|
|
2664
2666
|
const g = a.filter(
|
|
2665
2667
|
(p) => p.label.toLowerCase().includes(u.toLowerCase())
|
|
2666
|
-
),
|
|
2668
|
+
), w = (p) => {
|
|
2667
2669
|
i || (e.includes(p) ? r(e.filter((m) => m !== p)) : r([...e, p]));
|
|
2668
2670
|
}, h = (p, m) => {
|
|
2669
2671
|
m.stopPropagation(), i || r(e.filter((A) => A !== p));
|
|
2670
|
-
},
|
|
2672
|
+
}, x = (p) => {
|
|
2671
2673
|
var m;
|
|
2672
2674
|
return ((m = a.find((A) => A.value === p)) == null ? void 0 : m.label) || p;
|
|
2673
2675
|
};
|
|
2674
|
-
return /* @__PURE__ */ o("div", { className: "w-full metakyc-multiselect", ref:
|
|
2676
|
+
return /* @__PURE__ */ o("div", { className: "w-full metakyc-multiselect", ref: v, children: [
|
|
2675
2677
|
t && /* @__PURE__ */ o("label", { className: "block text-sm font-medium text-gray-700 dark:text-gray-300 mb-1", children: [
|
|
2676
2678
|
t,
|
|
2677
2679
|
l && /* @__PURE__ */ n("span", { className: "text-red-500 ml-1", children: "*" })
|
|
@@ -2681,7 +2683,7 @@ const ar = ({
|
|
|
2681
2683
|
"div",
|
|
2682
2684
|
{
|
|
2683
2685
|
onClick: () => !i && d(!c),
|
|
2684
|
-
className:
|
|
2686
|
+
className: J(
|
|
2685
2687
|
"metakyc-multiselect-trigger",
|
|
2686
2688
|
"min-h-[42px] w-full px-3 py-2 rounded-lg border text-sm transition-colors",
|
|
2687
2689
|
"bg-white dark:bg-gray-800",
|
|
@@ -2695,7 +2697,7 @@ const ar = ({
|
|
|
2695
2697
|
{
|
|
2696
2698
|
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",
|
|
2697
2699
|
children: [
|
|
2698
|
-
|
|
2700
|
+
x(p),
|
|
2699
2701
|
!i && /* @__PURE__ */ n(
|
|
2700
2702
|
"button",
|
|
2701
2703
|
{
|
|
@@ -2754,8 +2756,8 @@ const ar = ({
|
|
|
2754
2756
|
/* @__PURE__ */ n("ul", { className: "max-h-48 overflow-y-auto py-1", children: g.length === 0 ? /* @__PURE__ */ n("li", { className: "px-3 py-2 text-sm text-gray-500 dark:text-gray-400", children: "No results" }) : g.map((p) => /* @__PURE__ */ o(
|
|
2755
2757
|
"li",
|
|
2756
2758
|
{
|
|
2757
|
-
onClick: () =>
|
|
2758
|
-
className:
|
|
2759
|
+
onClick: () => w(p.value),
|
|
2760
|
+
className: J(
|
|
2759
2761
|
"metakyc-multiselect-option",
|
|
2760
2762
|
"flex items-center gap-2 px-3 py-2 text-sm cursor-pointer",
|
|
2761
2763
|
"hover:bg-gray-50 dark:hover:bg-gray-700",
|
|
@@ -2806,42 +2808,42 @@ const ar = ({
|
|
|
2806
2808
|
value: l = [],
|
|
2807
2809
|
className: c
|
|
2808
2810
|
}) => {
|
|
2809
|
-
const [d, u] =
|
|
2811
|
+
const [d, u] = S(!1), y = Y(null), v = (m) => {
|
|
2810
2812
|
if (!m) return;
|
|
2811
2813
|
const A = Array.from(m);
|
|
2812
|
-
if (s && A.filter((
|
|
2813
|
-
const
|
|
2814
|
-
alert(`Some files exceed the maximum size of ${
|
|
2814
|
+
if (s && A.filter((N) => N.size > s).length > 0) {
|
|
2815
|
+
const N = Ie(s);
|
|
2816
|
+
alert(`Some files exceed the maximum size of ${N}`);
|
|
2815
2817
|
return;
|
|
2816
2818
|
}
|
|
2817
2819
|
i == null || i(a ? [...l, ...A] : [A[0]]);
|
|
2818
2820
|
}, g = (m) => {
|
|
2819
2821
|
m.preventDefault(), u(!0);
|
|
2820
|
-
},
|
|
2822
|
+
}, w = () => {
|
|
2821
2823
|
u(!1);
|
|
2822
2824
|
}, h = (m) => {
|
|
2823
|
-
m.preventDefault(), u(!1),
|
|
2824
|
-
},
|
|
2825
|
+
m.preventDefault(), u(!1), v(m.dataTransfer.files);
|
|
2826
|
+
}, x = () => {
|
|
2825
2827
|
var m;
|
|
2826
2828
|
(m = y.current) == null || m.click();
|
|
2827
2829
|
}, p = (m) => {
|
|
2828
|
-
const A = l.filter((
|
|
2830
|
+
const A = l.filter((C, N) => N !== m);
|
|
2829
2831
|
i == null || i(A);
|
|
2830
2832
|
};
|
|
2831
|
-
return /* @__PURE__ */ o("div", { className:
|
|
2833
|
+
return /* @__PURE__ */ o("div", { className: J("w-full", c), children: [
|
|
2832
2834
|
t && /* @__PURE__ */ n("label", { className: "block text-sm font-medium text-gray-700 dark:text-gray-300 mb-1", children: t }),
|
|
2833
2835
|
/* @__PURE__ */ o(
|
|
2834
2836
|
"div",
|
|
2835
2837
|
{
|
|
2836
|
-
className:
|
|
2838
|
+
className: J(
|
|
2837
2839
|
"border-2 border-dashed rounded-lg p-6 text-center cursor-pointer transition-colors",
|
|
2838
2840
|
d ? "border-primary-500 bg-primary-50 dark:bg-primary-900/20" : "border-gray-300 dark:border-gray-600 hover:border-primary-500",
|
|
2839
2841
|
e && "border-danger-500"
|
|
2840
2842
|
),
|
|
2841
2843
|
onDragOver: g,
|
|
2842
|
-
onDragLeave:
|
|
2844
|
+
onDragLeave: w,
|
|
2843
2845
|
onDrop: h,
|
|
2844
|
-
onClick:
|
|
2846
|
+
onClick: x,
|
|
2845
2847
|
children: [
|
|
2846
2848
|
/* @__PURE__ */ n(
|
|
2847
2849
|
"input",
|
|
@@ -2851,7 +2853,7 @@ const ar = ({
|
|
|
2851
2853
|
className: "hidden",
|
|
2852
2854
|
accept: r,
|
|
2853
2855
|
multiple: a,
|
|
2854
|
-
onChange: (m) =>
|
|
2856
|
+
onChange: (m) => v(m.target.files)
|
|
2855
2857
|
}
|
|
2856
2858
|
),
|
|
2857
2859
|
/* @__PURE__ */ o("div", { className: "space-y-2", children: [
|
|
@@ -2918,8 +2920,8 @@ const ar = ({
|
|
|
2918
2920
|
"button",
|
|
2919
2921
|
{
|
|
2920
2922
|
type: "button",
|
|
2921
|
-
onClick: (
|
|
2922
|
-
|
|
2923
|
+
onClick: (C) => {
|
|
2924
|
+
C.stopPropagation(), p(A);
|
|
2923
2925
|
},
|
|
2924
2926
|
className: "ml-2 text-danger-500 hover:text-danger-700 focus:outline-none",
|
|
2925
2927
|
children: /* @__PURE__ */ n("svg", { className: "h-5 w-5", fill: "currentColor", viewBox: "0 0 20 20", children: /* @__PURE__ */ n(
|
|
@@ -2951,7 +2953,7 @@ const ar = ({
|
|
|
2951
2953
|
type: "text",
|
|
2952
2954
|
value: t,
|
|
2953
2955
|
onChange: (i) => e == null ? void 0 : e(i.target.value),
|
|
2954
|
-
className:
|
|
2956
|
+
className: J(
|
|
2955
2957
|
"w-20 rounded-lg border px-3 py-2 text-sm",
|
|
2956
2958
|
"focus:outline-none focus:ring-2 focus:ring-primary-500 focus:border-transparent",
|
|
2957
2959
|
"border-gray-300 dark:border-gray-600 dark:bg-gray-800 dark:text-white"
|
|
@@ -2960,11 +2962,11 @@ const ar = ({
|
|
|
2960
2962
|
}
|
|
2961
2963
|
),
|
|
2962
2964
|
/* @__PURE__ */ n(
|
|
2963
|
-
|
|
2965
|
+
se,
|
|
2964
2966
|
{
|
|
2965
2967
|
ref: s,
|
|
2966
2968
|
type: "tel",
|
|
2967
|
-
className:
|
|
2969
|
+
className: J("flex-1", r),
|
|
2968
2970
|
...a,
|
|
2969
2971
|
label: ""
|
|
2970
2972
|
}
|
|
@@ -2974,35 +2976,35 @@ const ar = ({
|
|
|
2974
2976
|
] })
|
|
2975
2977
|
);
|
|
2976
2978
|
ir.displayName = "PhoneInput";
|
|
2977
|
-
const
|
|
2979
|
+
const ze = (t, e, r) => {
|
|
2978
2980
|
if (t && "reportValidity" in t) {
|
|
2979
|
-
const a =
|
|
2981
|
+
const a = Fe(r, e);
|
|
2980
2982
|
t.setCustomValidity(a && a.message || ""), t.reportValidity();
|
|
2981
2983
|
}
|
|
2982
|
-
},
|
|
2984
|
+
}, Pe = (t, e) => {
|
|
2983
2985
|
for (const r in e.fields) {
|
|
2984
2986
|
const a = e.fields[r];
|
|
2985
|
-
a && a.ref && "reportValidity" in a.ref ?
|
|
2987
|
+
a && a.ref && "reportValidity" in a.ref ? ze(a.ref, r, t) : a && a.refs && a.refs.forEach((s) => ze(s, r, t));
|
|
2986
2988
|
}
|
|
2987
|
-
},
|
|
2988
|
-
e.shouldUseNativeValidation &&
|
|
2989
|
+
}, $e = (t, e) => {
|
|
2990
|
+
e.shouldUseNativeValidation && Pe(t, e);
|
|
2989
2991
|
const r = {};
|
|
2990
2992
|
for (const a in t) {
|
|
2991
|
-
const s =
|
|
2993
|
+
const s = Fe(e.fields, a), i = Object.assign(t[a] || {}, { ref: s && s.ref });
|
|
2992
2994
|
if (or(e.names || Object.keys(t), a)) {
|
|
2993
|
-
const l = Object.assign({},
|
|
2995
|
+
const l = Object.assign({}, Fe(r, a));
|
|
2994
2996
|
Ee(l, "root", i), Ee(r, a, l);
|
|
2995
2997
|
} else Ee(r, a, i);
|
|
2996
2998
|
}
|
|
2997
2999
|
return r;
|
|
2998
3000
|
}, or = (t, e) => {
|
|
2999
|
-
const r =
|
|
3000
|
-
return t.some((a) =>
|
|
3001
|
+
const r = qe(e);
|
|
3002
|
+
return t.some((a) => qe(a).match(`^${r}\\.\\d+`));
|
|
3001
3003
|
};
|
|
3002
|
-
function
|
|
3004
|
+
function qe(t) {
|
|
3003
3005
|
return t.replace(/\]|\[/g, "");
|
|
3004
3006
|
}
|
|
3005
|
-
function
|
|
3007
|
+
function Ve(t, e, r) {
|
|
3006
3008
|
function a(c, d) {
|
|
3007
3009
|
var u;
|
|
3008
3010
|
Object.defineProperty(c, "_zod", {
|
|
@@ -3038,18 +3040,18 @@ class lr extends Error {
|
|
|
3038
3040
|
}
|
|
3039
3041
|
}
|
|
3040
3042
|
const cr = {};
|
|
3041
|
-
function
|
|
3043
|
+
function Ye(t) {
|
|
3042
3044
|
return cr;
|
|
3043
3045
|
}
|
|
3044
3046
|
function dr(t, e) {
|
|
3045
3047
|
return typeof e == "bigint" ? e.toString() : e;
|
|
3046
3048
|
}
|
|
3047
|
-
const
|
|
3049
|
+
const We = Error.captureStackTrace ? Error.captureStackTrace : (...t) => {
|
|
3048
3050
|
};
|
|
3049
3051
|
function ke(t) {
|
|
3050
3052
|
return typeof t == "string" ? t : t == null ? void 0 : t.message;
|
|
3051
3053
|
}
|
|
3052
|
-
function
|
|
3054
|
+
function Qe(t, e, r) {
|
|
3053
3055
|
var s, i, l, c, d, u;
|
|
3054
3056
|
const a = { ...t, path: t.path ?? [] };
|
|
3055
3057
|
if (!t.message) {
|
|
@@ -3058,7 +3060,7 @@ function Ye(t, e, r) {
|
|
|
3058
3060
|
}
|
|
3059
3061
|
return delete a.inst, delete a.continue, e != null && e.reportInput || delete a.input, a;
|
|
3060
3062
|
}
|
|
3061
|
-
const
|
|
3063
|
+
const Ge = (t, e) => {
|
|
3062
3064
|
t.name = "$ZodError", Object.defineProperty(t, "_zod", {
|
|
3063
3065
|
value: t._zod,
|
|
3064
3066
|
enumerable: !1
|
|
@@ -3075,25 +3077,25 @@ const We = (t, e) => {
|
|
|
3075
3077
|
value: () => t.message,
|
|
3076
3078
|
enumerable: !1
|
|
3077
3079
|
});
|
|
3078
|
-
}, ur =
|
|
3080
|
+
}, ur = Ve("$ZodError", Ge), Ze = Ve("$ZodError", Ge, { Parent: Error }), mr = (t) => (e, r, a, s) => {
|
|
3079
3081
|
const i = a ? Object.assign(a, { async: !1 }) : { async: !1 }, l = e._zod.run({ value: r, issues: [] }, i);
|
|
3080
3082
|
if (l instanceof Promise)
|
|
3081
3083
|
throw new lr();
|
|
3082
3084
|
if (l.issues.length) {
|
|
3083
|
-
const c = new ((s == null ? void 0 : s.Err) ?? t)(l.issues.map((d) =>
|
|
3084
|
-
throw
|
|
3085
|
+
const c = new ((s == null ? void 0 : s.Err) ?? t)(l.issues.map((d) => Qe(d, i, Ye())));
|
|
3086
|
+
throw We(c, s == null ? void 0 : s.callee), c;
|
|
3085
3087
|
}
|
|
3086
3088
|
return l.value;
|
|
3087
|
-
}, hr = /* @__PURE__ */ mr(
|
|
3089
|
+
}, hr = /* @__PURE__ */ mr(Ze), pr = (t) => async (e, r, a, s) => {
|
|
3088
3090
|
const i = a ? Object.assign(a, { async: !0 }) : { async: !0 };
|
|
3089
3091
|
let l = e._zod.run({ value: r, issues: [] }, i);
|
|
3090
3092
|
if (l instanceof Promise && (l = await l), l.issues.length) {
|
|
3091
|
-
const c = new ((s == null ? void 0 : s.Err) ?? t)(l.issues.map((d) =>
|
|
3092
|
-
throw
|
|
3093
|
+
const c = new ((s == null ? void 0 : s.Err) ?? t)(l.issues.map((d) => Qe(d, i, Ye())));
|
|
3094
|
+
throw We(c, s == null ? void 0 : s.callee), c;
|
|
3093
3095
|
}
|
|
3094
3096
|
return l.value;
|
|
3095
|
-
}, gr = /* @__PURE__ */ pr(
|
|
3096
|
-
function
|
|
3097
|
+
}, gr = /* @__PURE__ */ pr(Ze);
|
|
3098
|
+
function _e(t, e) {
|
|
3097
3099
|
try {
|
|
3098
3100
|
var r = t();
|
|
3099
3101
|
} catch (a) {
|
|
@@ -3109,12 +3111,12 @@ function yr(t, e) {
|
|
|
3109
3111
|
r[l] = { message: c.message, type: c.code };
|
|
3110
3112
|
} else r[l] = { message: i, type: s };
|
|
3111
3113
|
if ("unionErrors" in a && a.unionErrors.forEach(function(y) {
|
|
3112
|
-
return y.errors.forEach(function(
|
|
3113
|
-
return t.push(
|
|
3114
|
+
return y.errors.forEach(function(v) {
|
|
3115
|
+
return t.push(v);
|
|
3114
3116
|
});
|
|
3115
3117
|
}), e) {
|
|
3116
3118
|
var d = r[l].types, u = d && d[a.code];
|
|
3117
|
-
r[l] =
|
|
3119
|
+
r[l] = Ue(l, e, r, s, u ? [].concat(u, a.message) : a.message);
|
|
3118
3120
|
}
|
|
3119
3121
|
t.shift();
|
|
3120
3122
|
}
|
|
@@ -3128,30 +3130,30 @@ function fr(t, e) {
|
|
|
3128
3130
|
r[l] = { message: c.message, type: c.code };
|
|
3129
3131
|
} else r[l] = { message: i, type: s };
|
|
3130
3132
|
if (a.code === "invalid_union" && a.errors.forEach(function(y) {
|
|
3131
|
-
return y.forEach(function(
|
|
3132
|
-
return t.push(
|
|
3133
|
+
return y.forEach(function(v) {
|
|
3134
|
+
return t.push(v);
|
|
3133
3135
|
});
|
|
3134
3136
|
}), e) {
|
|
3135
3137
|
var d = r[l].types, u = d && d[a.code];
|
|
3136
|
-
r[l] =
|
|
3138
|
+
r[l] = Ue(l, e, r, s, u ? [].concat(u, a.message) : a.message);
|
|
3137
3139
|
}
|
|
3138
3140
|
t.shift();
|
|
3139
3141
|
}
|
|
3140
3142
|
return r;
|
|
3141
3143
|
}
|
|
3142
|
-
function
|
|
3144
|
+
function Je(t, e, r) {
|
|
3143
3145
|
if (r === void 0 && (r = {}), function(a) {
|
|
3144
3146
|
return "_def" in a && typeof a._def == "object" && "typeName" in a._def;
|
|
3145
3147
|
}(t)) return function(a, s, i) {
|
|
3146
3148
|
try {
|
|
3147
|
-
return Promise.resolve(
|
|
3149
|
+
return Promise.resolve(_e(function() {
|
|
3148
3150
|
return Promise.resolve(t[r.mode === "sync" ? "parse" : "parseAsync"](a, e)).then(function(l) {
|
|
3149
|
-
return i.shouldUseNativeValidation &&
|
|
3151
|
+
return i.shouldUseNativeValidation && Pe({}, i), { errors: {}, values: r.raw ? Object.assign({}, a) : l };
|
|
3150
3152
|
});
|
|
3151
3153
|
}, function(l) {
|
|
3152
3154
|
if (function(c) {
|
|
3153
3155
|
return Array.isArray(c == null ? void 0 : c.issues);
|
|
3154
|
-
}(l)) return { values: {}, errors:
|
|
3156
|
+
}(l)) return { values: {}, errors: $e(yr(l.errors, !i.shouldUseNativeValidation && i.criteriaMode === "all"), i) };
|
|
3155
3157
|
throw l;
|
|
3156
3158
|
}));
|
|
3157
3159
|
} catch (l) {
|
|
@@ -3162,14 +3164,14 @@ function Ge(t, e, r) {
|
|
|
3162
3164
|
return "_zod" in a && typeof a._zod == "object";
|
|
3163
3165
|
}(t)) return function(a, s, i) {
|
|
3164
3166
|
try {
|
|
3165
|
-
return Promise.resolve(
|
|
3167
|
+
return Promise.resolve(_e(function() {
|
|
3166
3168
|
return Promise.resolve((r.mode === "sync" ? hr : gr)(t, a, e)).then(function(l) {
|
|
3167
|
-
return i.shouldUseNativeValidation &&
|
|
3169
|
+
return i.shouldUseNativeValidation && Pe({}, i), { errors: {}, values: r.raw ? Object.assign({}, a) : l };
|
|
3168
3170
|
});
|
|
3169
3171
|
}, function(l) {
|
|
3170
3172
|
if (function(c) {
|
|
3171
3173
|
return c instanceof ur;
|
|
3172
|
-
}(l)) return { values: {}, errors:
|
|
3174
|
+
}(l)) return { values: {}, errors: $e(fr(l.issues, !i.shouldUseNativeValidation && i.criteriaMode === "all"), i) };
|
|
3173
3175
|
throw l;
|
|
3174
3176
|
}));
|
|
3175
3177
|
} catch (l) {
|
|
@@ -3231,111 +3233,111 @@ const Wr = me.any(), kr = ({
|
|
|
3231
3233
|
onBack: r
|
|
3232
3234
|
}) => {
|
|
3233
3235
|
const { questionnaire: a, isLoading: s, isSubmitting: i, error: l, submit: c } = Jt(t), d = Re(() => a ? { questionResults: a.questionGroups.map(
|
|
3234
|
-
(
|
|
3236
|
+
(x) => x.questions.map((p) => ({
|
|
3235
3237
|
questionId: p.id,
|
|
3236
3238
|
values: []
|
|
3237
3239
|
}))
|
|
3238
3240
|
) } : { questionResults: [] }, [a]), u = a ? br() : null, {
|
|
3239
3241
|
control: y,
|
|
3240
|
-
handleSubmit:
|
|
3242
|
+
handleSubmit: v,
|
|
3241
3243
|
formState: { errors: g }
|
|
3242
3244
|
} = Te({
|
|
3243
|
-
resolver: u ?
|
|
3245
|
+
resolver: u ? Je(u) : void 0,
|
|
3244
3246
|
defaultValues: d
|
|
3245
|
-
}),
|
|
3247
|
+
}), w = async (h) => {
|
|
3246
3248
|
if (a)
|
|
3247
3249
|
try {
|
|
3248
3250
|
console.log("Form submitted with data:", h);
|
|
3249
|
-
const
|
|
3250
|
-
(m, A) => m.questions.map((
|
|
3251
|
-
var
|
|
3251
|
+
const x = a.questionGroups.flatMap(
|
|
3252
|
+
(m, A) => m.questions.map((C, N) => {
|
|
3253
|
+
var B, L, F;
|
|
3252
3254
|
return {
|
|
3253
|
-
questionId:
|
|
3254
|
-
values: ((
|
|
3255
|
+
questionId: C.id,
|
|
3256
|
+
values: ((F = (L = (B = h.questionResults) == null ? void 0 : B[A]) == null ? void 0 : L[N]) == null ? void 0 : F.values) || []
|
|
3255
3257
|
};
|
|
3256
3258
|
})
|
|
3257
3259
|
);
|
|
3258
|
-
console.log("Question results to submit:",
|
|
3260
|
+
console.log("Question results to submit:", x);
|
|
3259
3261
|
const p = {
|
|
3260
3262
|
applicantId: t,
|
|
3261
3263
|
questionnarieId: a.id,
|
|
3262
|
-
questionResults:
|
|
3264
|
+
questionResults: x
|
|
3263
3265
|
};
|
|
3264
3266
|
console.log("Final input:", p), await c(p), e == null || e();
|
|
3265
|
-
} catch (
|
|
3266
|
-
console.error("Error submitting questionnaire:",
|
|
3267
|
+
} catch (x) {
|
|
3268
|
+
console.error("Error submitting questionnaire:", x);
|
|
3267
3269
|
}
|
|
3268
3270
|
};
|
|
3269
|
-
return s ? /* @__PURE__ */ n(
|
|
3271
|
+
return s ? /* @__PURE__ */ n(M, { children: /* @__PURE__ */ n(O, { children: /* @__PURE__ */ n(de, { className: "my-8" }) }) }) : l ? /* @__PURE__ */ n(M, { children: /* @__PURE__ */ n(O, { children: /* @__PURE__ */ o("p", { className: "text-danger-500", children: [
|
|
3270
3272
|
"Error loading questionnaire: ",
|
|
3271
3273
|
l.message
|
|
3272
|
-
] }) }) }) : a ? /* @__PURE__ */ n("form", { onSubmit:
|
|
3273
|
-
/* @__PURE__ */ o(
|
|
3274
|
+
] }) }) }) : a ? /* @__PURE__ */ n("form", { onSubmit: v(w), children: /* @__PURE__ */ o(M, { children: [
|
|
3275
|
+
/* @__PURE__ */ o(ne, { children: [
|
|
3274
3276
|
/* @__PURE__ */ n("h2", { className: "text-lg font-bold", children: a.displayName }),
|
|
3275
3277
|
a.subtitle && /* @__PURE__ */ n("p", { className: "text-gray-600 dark:text-gray-400 mt-1", children: a.subtitle })
|
|
3276
3278
|
] }),
|
|
3277
|
-
/* @__PURE__ */ n(
|
|
3278
|
-
(h,
|
|
3279
|
-
const
|
|
3279
|
+
/* @__PURE__ */ n(O, { className: "space-y-8", children: a.questionGroups.flatMap(
|
|
3280
|
+
(h, x) => h.questions.map((p, m) => {
|
|
3281
|
+
const C = p.defaultAnswers && p.defaultAnswers.length > 0 ? p.showAsDropdown ? p.canMultipleAnswer ? "multi-select" : "single-select" : p.canMultipleAnswer ? "checkbox" : "radio" : "text";
|
|
3280
3282
|
return /* @__PURE__ */ o("div", { className: "space-y-2", children: [
|
|
3281
3283
|
/* @__PURE__ */ o("label", { className: "block text-sm font-medium text-gray-700 dark:text-gray-300", children: [
|
|
3282
3284
|
p.text,
|
|
3283
3285
|
p.isRequired && /* @__PURE__ */ n("span", { className: "text-danger-500 ml-1", children: "*" })
|
|
3284
3286
|
] }),
|
|
3285
|
-
|
|
3286
|
-
|
|
3287
|
+
C === "text" && /* @__PURE__ */ n(
|
|
3288
|
+
te,
|
|
3287
3289
|
{
|
|
3288
3290
|
control: y,
|
|
3289
|
-
name: `questionResults.${
|
|
3290
|
-
render: ({ field:
|
|
3291
|
-
var
|
|
3291
|
+
name: `questionResults.${x}.${m}.values.0`,
|
|
3292
|
+
render: ({ field: N }) => {
|
|
3293
|
+
var B, L, F, k;
|
|
3292
3294
|
return /* @__PURE__ */ n(
|
|
3293
|
-
|
|
3295
|
+
se,
|
|
3294
3296
|
{
|
|
3295
|
-
value:
|
|
3296
|
-
onChange:
|
|
3297
|
-
onBlur:
|
|
3298
|
-
name:
|
|
3297
|
+
value: N.value || "",
|
|
3298
|
+
onChange: N.onChange,
|
|
3299
|
+
onBlur: N.onBlur,
|
|
3300
|
+
name: N.name,
|
|
3299
3301
|
placeholder: "Enter your answer...",
|
|
3300
|
-
error: (
|
|
3302
|
+
error: (k = (F = (L = (B = g.questionResults) == null ? void 0 : B[x]) == null ? void 0 : L[m]) == null ? void 0 : F.values) == null ? void 0 : k.message
|
|
3301
3303
|
}
|
|
3302
3304
|
);
|
|
3303
3305
|
}
|
|
3304
3306
|
}
|
|
3305
3307
|
),
|
|
3306
|
-
(
|
|
3307
|
-
|
|
3308
|
+
(C === "single-select" || C === "radio") && /* @__PURE__ */ n(
|
|
3309
|
+
te,
|
|
3308
3310
|
{
|
|
3309
3311
|
control: y,
|
|
3310
|
-
name: `questionResults.${
|
|
3311
|
-
render: ({ field:
|
|
3312
|
-
var
|
|
3312
|
+
name: `questionResults.${x}.${m}.values.0`,
|
|
3313
|
+
render: ({ field: N }) => {
|
|
3314
|
+
var B, L, F, k;
|
|
3313
3315
|
return /* @__PURE__ */ n(
|
|
3314
3316
|
ge,
|
|
3315
3317
|
{
|
|
3316
|
-
value:
|
|
3317
|
-
onChange:
|
|
3318
|
-
onBlur:
|
|
3319
|
-
name:
|
|
3320
|
-
options: p.defaultAnswers.map((
|
|
3321
|
-
value:
|
|
3322
|
-
label:
|
|
3318
|
+
value: N.value || "",
|
|
3319
|
+
onChange: N.onChange,
|
|
3320
|
+
onBlur: N.onBlur,
|
|
3321
|
+
name: N.name,
|
|
3322
|
+
options: p.defaultAnswers.map((T) => ({
|
|
3323
|
+
value: T,
|
|
3324
|
+
label: T
|
|
3323
3325
|
})),
|
|
3324
3326
|
placeholder: "Select an option...",
|
|
3325
|
-
error: (
|
|
3327
|
+
error: (k = (F = (L = (B = g.questionResults) == null ? void 0 : B[x]) == null ? void 0 : L[m]) == null ? void 0 : F.values) == null ? void 0 : k.message
|
|
3326
3328
|
}
|
|
3327
3329
|
);
|
|
3328
3330
|
}
|
|
3329
3331
|
}
|
|
3330
3332
|
),
|
|
3331
|
-
(
|
|
3333
|
+
(C === "checkbox" || C === "multi-select") && /* @__PURE__ */ o("div", { className: "space-y-2", children: [
|
|
3332
3334
|
/* @__PURE__ */ n("p", { className: "text-sm text-gray-600 dark:text-gray-400 mb-2", children: "Choose one or more options" }),
|
|
3333
3335
|
/* @__PURE__ */ n(
|
|
3334
|
-
|
|
3336
|
+
te,
|
|
3335
3337
|
{
|
|
3336
3338
|
control: y,
|
|
3337
|
-
name: `questionResults.${
|
|
3338
|
-
render: ({ field: { value:
|
|
3339
|
+
name: `questionResults.${x}.${m}.values`,
|
|
3340
|
+
render: ({ field: { value: N = [], onChange: B } }) => /* @__PURE__ */ n("div", { className: "space-y-2", children: p.defaultAnswers.map((L, F) => /* @__PURE__ */ o(
|
|
3339
3341
|
"label",
|
|
3340
3342
|
{
|
|
3341
3343
|
className: "flex items-center space-x-2 cursor-pointer",
|
|
@@ -3344,10 +3346,10 @@ const Wr = me.any(), kr = ({
|
|
|
3344
3346
|
"input",
|
|
3345
3347
|
{
|
|
3346
3348
|
type: "checkbox",
|
|
3347
|
-
checked: Array.isArray(
|
|
3348
|
-
onChange: (
|
|
3349
|
-
const
|
|
3350
|
-
|
|
3349
|
+
checked: Array.isArray(N) && N.includes(L),
|
|
3350
|
+
onChange: (k) => {
|
|
3351
|
+
const T = Array.isArray(N) ? N : [], D = k.target.checked ? [...T, L] : T.filter((G) => G !== L);
|
|
3352
|
+
B(D);
|
|
3351
3353
|
},
|
|
3352
3354
|
className: "h-4 w-4 text-primary-500 rounded border-gray-300 focus:ring-primary-500"
|
|
3353
3355
|
}
|
|
@@ -3355,7 +3357,7 @@ const Wr = me.any(), kr = ({
|
|
|
3355
3357
|
/* @__PURE__ */ n("span", { className: "text-sm", children: L })
|
|
3356
3358
|
]
|
|
3357
3359
|
},
|
|
3358
|
-
`answer-${
|
|
3360
|
+
`answer-${x}-${m}-${F}`
|
|
3359
3361
|
)) })
|
|
3360
3362
|
}
|
|
3361
3363
|
)
|
|
@@ -3363,7 +3365,7 @@ const Wr = me.any(), kr = ({
|
|
|
3363
3365
|
] }, p.id);
|
|
3364
3366
|
})
|
|
3365
3367
|
) }),
|
|
3366
|
-
/* @__PURE__ */ o(
|
|
3368
|
+
/* @__PURE__ */ o(ie, { className: "flex justify-between", children: [
|
|
3367
3369
|
r && /* @__PURE__ */ n(j, { type: "button", variant: "outline", onClick: r, children: "Back" }),
|
|
3368
3370
|
/* @__PURE__ */ n(
|
|
3369
3371
|
j,
|
|
@@ -3387,12 +3389,12 @@ const Wr = me.any(), kr = ({
|
|
|
3387
3389
|
onComplete: e,
|
|
3388
3390
|
onBack: r
|
|
3389
3391
|
}) => {
|
|
3390
|
-
const { uploadDocument: a, isLoading: s, isSubmitting: i, error: l, submit: c } = Xt(t), [d, u] =
|
|
3391
|
-
if (
|
|
3392
|
+
const { uploadDocument: a, isLoading: s, isSubmitting: i, error: l, submit: c } = Xt(t), [d, u] = S({}), y = async (v) => {
|
|
3393
|
+
if (v.preventDefault(), !a) return;
|
|
3392
3394
|
const g = await Promise.all(
|
|
3393
3395
|
a.uploadDocumentFiles.map(async (h) => {
|
|
3394
|
-
const
|
|
3395
|
-
|
|
3396
|
+
const x = d[h.id] || [], p = await Promise.all(
|
|
3397
|
+
x.map(async (m) => ({
|
|
3396
3398
|
fileName: m.name,
|
|
3397
3399
|
fileData: await Ht(m)
|
|
3398
3400
|
}))
|
|
@@ -3402,36 +3404,36 @@ const Wr = me.any(), kr = ({
|
|
|
3402
3404
|
valueList: p
|
|
3403
3405
|
};
|
|
3404
3406
|
})
|
|
3405
|
-
),
|
|
3407
|
+
), w = {
|
|
3406
3408
|
applicantId: t,
|
|
3407
3409
|
uploadDocumentId: a.id,
|
|
3408
3410
|
uploadDocumentResults: g
|
|
3409
3411
|
};
|
|
3410
|
-
await c(
|
|
3412
|
+
await c(w), e == null || e();
|
|
3411
3413
|
};
|
|
3412
|
-
return s ? /* @__PURE__ */ n(
|
|
3414
|
+
return s ? /* @__PURE__ */ n(M, { children: /* @__PURE__ */ n(O, { children: /* @__PURE__ */ n(de, { className: "my-8" }) }) }) : l ? /* @__PURE__ */ n(M, { children: /* @__PURE__ */ n(O, { children: /* @__PURE__ */ o("p", { className: "text-danger-500", children: [
|
|
3413
3415
|
"Error loading document requirements: ",
|
|
3414
3416
|
l.message
|
|
3415
|
-
] }) }) }) : a ? /* @__PURE__ */ n("form", { onSubmit: y, children: /* @__PURE__ */ o(
|
|
3416
|
-
/* @__PURE__ */ o(
|
|
3417
|
+
] }) }) }) : a ? /* @__PURE__ */ n("form", { onSubmit: y, children: /* @__PURE__ */ o(M, { children: [
|
|
3418
|
+
/* @__PURE__ */ o(ne, { children: [
|
|
3417
3419
|
/* @__PURE__ */ n("h2", { className: "text-lg font-bold", children: a.displayName }),
|
|
3418
3420
|
a.subtitle && /* @__PURE__ */ n("p", { className: "text-gray-600 dark:text-gray-400 mt-1", children: a.subtitle })
|
|
3419
3421
|
] }),
|
|
3420
|
-
/* @__PURE__ */ n(
|
|
3422
|
+
/* @__PURE__ */ n(O, { className: "space-y-6", children: a.uploadDocumentFiles.map((v) => /* @__PURE__ */ n(
|
|
3421
3423
|
sr,
|
|
3422
3424
|
{
|
|
3423
|
-
label:
|
|
3424
|
-
accept:
|
|
3425
|
-
multiple:
|
|
3426
|
-
maxSize:
|
|
3427
|
-
value: d[
|
|
3425
|
+
label: v.displayName,
|
|
3426
|
+
accept: v.allowedTypes,
|
|
3427
|
+
multiple: v.multipleFile,
|
|
3428
|
+
maxSize: v.maxEachFileSizeByte,
|
|
3429
|
+
value: d[v.id] || [],
|
|
3428
3430
|
onChange: (g) => {
|
|
3429
|
-
u((
|
|
3431
|
+
u((w) => ({ ...w, [v.id]: g }));
|
|
3430
3432
|
}
|
|
3431
3433
|
},
|
|
3432
|
-
|
|
3434
|
+
v.id
|
|
3433
3435
|
)) }),
|
|
3434
|
-
/* @__PURE__ */ o(
|
|
3436
|
+
/* @__PURE__ */ o(ie, { className: "flex justify-between", children: [
|
|
3435
3437
|
r && /* @__PURE__ */ n(j, { type: "button", variant: "outline", onClick: r, children: "Back" }),
|
|
3436
3438
|
/* @__PURE__ */ n(j, { type: "submit", isLoading: i, children: "Continue" })
|
|
3437
3439
|
] })
|
|
@@ -3440,15 +3442,15 @@ const Wr = me.any(), kr = ({
|
|
|
3440
3442
|
const { overview: a, isLoading: s, isSubmitting: i, error: l, passOverview: c } = er(t), d = async () => {
|
|
3441
3443
|
await c(), e == null || e();
|
|
3442
3444
|
};
|
|
3443
|
-
return s ? /* @__PURE__ */ n(
|
|
3445
|
+
return s ? /* @__PURE__ */ n(M, { children: /* @__PURE__ */ n(O, { children: /* @__PURE__ */ n(de, { className: "my-8" }) }) }) : l ? /* @__PURE__ */ n(M, { children: /* @__PURE__ */ n(O, { children: /* @__PURE__ */ o("p", { className: "text-danger-500", children: [
|
|
3444
3446
|
"Error loading overview: ",
|
|
3445
3447
|
l.message
|
|
3446
|
-
] }) }) }) : a ? /* @__PURE__ */ o(
|
|
3447
|
-
/* @__PURE__ */ o(
|
|
3448
|
+
] }) }) }) : a ? /* @__PURE__ */ o(M, { children: [
|
|
3449
|
+
/* @__PURE__ */ o(ne, { children: [
|
|
3448
3450
|
/* @__PURE__ */ n("h2", { className: "text-lg font-bold", children: a.title || "Overview" }),
|
|
3449
3451
|
a.description && /* @__PURE__ */ n("p", { className: "text-gray-600 dark:text-gray-400 mt-1", children: a.description })
|
|
3450
3452
|
] }),
|
|
3451
|
-
/* @__PURE__ */ n(
|
|
3453
|
+
/* @__PURE__ */ n(O, { className: "space-y-8", children: a.steps && a.steps.length > 0 ? a.steps.sort((u, y) => u.order - y.order).map((u) => /* @__PURE__ */ o("div", { className: "metakyc-overview-step-item flex items-center space-x-3", children: [
|
|
3452
3454
|
/* @__PURE__ */ n("div", { className: "metakyc-step-icon flex-shrink-0", children: /* @__PURE__ */ n("div", { className: "w-8 h-8 rounded-full bg-primary-500 text-white flex items-center justify-center font-medium text-sm", children: u.order + 1 }) }),
|
|
3453
3455
|
/* @__PURE__ */ o(
|
|
3454
3456
|
"div",
|
|
@@ -3467,7 +3469,7 @@ const Wr = me.any(), kr = ({
|
|
|
3467
3469
|
}
|
|
3468
3470
|
)
|
|
3469
3471
|
] }, u.order)) : /* @__PURE__ */ n("div", { className: "text-center py-8", children: /* @__PURE__ */ n("p", { className: "text-gray-600 dark:text-gray-400", children: "Loading overview data..." }) }) }),
|
|
3470
|
-
/* @__PURE__ */ o(
|
|
3472
|
+
/* @__PURE__ */ o(ie, { className: "flex justify-between", children: [
|
|
3471
3473
|
r && /* @__PURE__ */ n(j, { type: "button", variant: "outline", onClick: r, children: "Back" }),
|
|
3472
3474
|
/* @__PURE__ */ n(j, { onClick: d, isLoading: i, children: "Continue" })
|
|
3473
3475
|
] })
|
|
@@ -3477,148 +3479,148 @@ const Wr = me.any(), kr = ({
|
|
|
3477
3479
|
onComplete: e,
|
|
3478
3480
|
onBack: r
|
|
3479
3481
|
}) => {
|
|
3480
|
-
const { criteria: a, isLoading: s, isSubmitting: i, error: l, submit: c } = rr(t), [d, u] =
|
|
3482
|
+
const { criteria: a, isLoading: s, isSubmitting: i, error: l, submit: c } = rr(t), [d, u] = re.useState(!1), y = re.useMemo(() => !a || a.length === 0 ? { criteriaValueInputs: [] } : {
|
|
3481
3483
|
criteriaValueInputs: a.map((m) => ({
|
|
3482
3484
|
riskCriteriaId: m.id,
|
|
3483
3485
|
values: [""]
|
|
3484
3486
|
// Initialize with empty string to prevent uncontrolled input warning
|
|
3485
3487
|
}))
|
|
3486
|
-
}, [a]),
|
|
3488
|
+
}, [a]), v = a && a.length > 0 ? xr() : null, {
|
|
3487
3489
|
control: g,
|
|
3488
|
-
handleSubmit:
|
|
3490
|
+
handleSubmit: w,
|
|
3489
3491
|
formState: { errors: h }
|
|
3490
3492
|
} = Te({
|
|
3491
|
-
resolver:
|
|
3493
|
+
resolver: v ? Je(v) : void 0,
|
|
3492
3494
|
defaultValues: y
|
|
3493
3495
|
});
|
|
3494
|
-
|
|
3496
|
+
re.useEffect(() => {
|
|
3495
3497
|
!s && a && a.length === 0 && !d && !i && (u(!0), c({ applicantId: t, criteriaValueInputs: [] }).then(() => e == null ? void 0 : e()).catch(console.error));
|
|
3496
3498
|
}, [s, a, d, i, c, t, e]);
|
|
3497
|
-
const
|
|
3499
|
+
const x = async (m) => {
|
|
3498
3500
|
if (a)
|
|
3499
3501
|
try {
|
|
3500
3502
|
console.log("Risk scoring form submitted:", m), console.log("Criteria metadata:", a);
|
|
3501
|
-
const A = m.criteriaValueInputs.map((
|
|
3502
|
-
const L =
|
|
3503
|
-
return
|
|
3504
|
-
riskCriteriaId: a[
|
|
3505
|
-
values:
|
|
3503
|
+
const A = m.criteriaValueInputs.map((N, B) => {
|
|
3504
|
+
const L = N.values || [], F = Array.isArray(L) ? L.filter((k) => k && k.trim()) : L && L.toString().trim() ? [L.toString()] : [];
|
|
3505
|
+
return F.length === 0 ? null : {
|
|
3506
|
+
riskCriteriaId: a[B].id,
|
|
3507
|
+
values: F
|
|
3506
3508
|
};
|
|
3507
|
-
}).filter((
|
|
3509
|
+
}).filter((N) => N !== null);
|
|
3508
3510
|
console.log("Risk scoring criteriaValueInputs to submit:", A);
|
|
3509
|
-
const
|
|
3511
|
+
const C = {
|
|
3510
3512
|
applicantId: t,
|
|
3511
3513
|
criteriaValueInputs: A
|
|
3512
3514
|
};
|
|
3513
|
-
console.log("Final risk scoring input:",
|
|
3515
|
+
console.log("Final risk scoring input:", C), await c(C), console.log("Risk scoring submitted successfully!"), e == null || e();
|
|
3514
3516
|
} catch (A) {
|
|
3515
3517
|
throw console.error("Error submitting risk scoring:", A), A;
|
|
3516
3518
|
}
|
|
3517
3519
|
}, p = (m) => m.builtInType === 1 ? "country" : !m.defaultValues || m.defaultValues.length === 0 ? "text" : m.multipleValue ? "checkbox" : "radio";
|
|
3518
|
-
return s ? /* @__PURE__ */ n(
|
|
3520
|
+
return s ? /* @__PURE__ */ n(M, { children: /* @__PURE__ */ o(O, { children: [
|
|
3519
3521
|
/* @__PURE__ */ n(de, { className: "my-8" }),
|
|
3520
3522
|
/* @__PURE__ */ n("p", { className: "text-center text-gray-600 dark:text-gray-400 mt-4", children: "Loading risk scoring criteria..." })
|
|
3521
|
-
] }) }) : l ? /* @__PURE__ */ n(
|
|
3523
|
+
] }) }) : l ? /* @__PURE__ */ n(M, { children: /* @__PURE__ */ n(O, { children: /* @__PURE__ */ o("p", { className: "text-danger-500", children: [
|
|
3522
3524
|
"Error loading criteria: ",
|
|
3523
3525
|
l.message
|
|
3524
|
-
] }) }) }) : !s && a && a.length === 0 ? /* @__PURE__ */ n(
|
|
3526
|
+
] }) }) }) : !s && a && a.length === 0 ? /* @__PURE__ */ n(M, { children: /* @__PURE__ */ o(O, { children: [
|
|
3525
3527
|
/* @__PURE__ */ n(de, { className: "my-8" }),
|
|
3526
3528
|
/* @__PURE__ */ n("p", { className: "text-center text-gray-600 dark:text-gray-400", children: "No risk scoring criteria required. Moving to next step..." })
|
|
3527
|
-
] }) }) : a ? /* @__PURE__ */ n("form", { onSubmit:
|
|
3528
|
-
/* @__PURE__ */ o(
|
|
3529
|
+
] }) }) : a ? /* @__PURE__ */ n("form", { onSubmit: w(x), children: /* @__PURE__ */ o(M, { children: [
|
|
3530
|
+
/* @__PURE__ */ o(ne, { children: [
|
|
3529
3531
|
/* @__PURE__ */ n("h2", { className: "text-lg font-bold", children: "Risk Assessment" }),
|
|
3530
3532
|
/* @__PURE__ */ n("p", { className: "text-gray-600 dark:text-gray-400 mt-1", children: "Please answer the following questions for risk evaluation" })
|
|
3531
3533
|
] }),
|
|
3532
|
-
/* @__PURE__ */ n(
|
|
3533
|
-
var
|
|
3534
|
-
const
|
|
3534
|
+
/* @__PURE__ */ n(O, { className: "space-y-8", children: a.map((m, A) => {
|
|
3535
|
+
var N, B, L;
|
|
3536
|
+
const C = p(m);
|
|
3535
3537
|
return /* @__PURE__ */ o("div", { className: "space-y-2", children: [
|
|
3536
3538
|
/* @__PURE__ */ o("label", { className: "block text-sm font-medium text-gray-700 dark:text-gray-300", children: [
|
|
3537
3539
|
m.displayName,
|
|
3538
3540
|
m.isRequired && /* @__PURE__ */ n("span", { className: "text-danger-500 ml-1", children: "*" })
|
|
3539
3541
|
] }),
|
|
3540
3542
|
m.description && /* @__PURE__ */ n("p", { className: "text-sm text-gray-500 dark:text-gray-400", children: m.description }),
|
|
3541
|
-
|
|
3542
|
-
|
|
3543
|
+
C === "text" && /* @__PURE__ */ n(
|
|
3544
|
+
te,
|
|
3543
3545
|
{
|
|
3544
3546
|
control: g,
|
|
3545
3547
|
name: `criteriaValueInputs.${A}.values.0`,
|
|
3546
|
-
render: ({ field:
|
|
3547
|
-
var
|
|
3548
|
+
render: ({ field: F }) => {
|
|
3549
|
+
var k, T, D;
|
|
3548
3550
|
return /* @__PURE__ */ n(
|
|
3549
|
-
|
|
3551
|
+
se,
|
|
3550
3552
|
{
|
|
3551
|
-
...
|
|
3552
|
-
value:
|
|
3553
|
-
type: m.valueDataType ===
|
|
3553
|
+
...F,
|
|
3554
|
+
value: F.value || "",
|
|
3555
|
+
type: m.valueDataType === De.DigitOnly ? "number" : "text",
|
|
3554
3556
|
placeholder: "Enter your answer...",
|
|
3555
|
-
error: (
|
|
3556
|
-
onKeyDown: (
|
|
3557
|
-
m.valueDataType ===
|
|
3557
|
+
error: (D = (T = (k = h.criteriaValueInputs) == null ? void 0 : k[A]) == null ? void 0 : T.values) == null ? void 0 : D.message,
|
|
3558
|
+
onKeyDown: (G) => {
|
|
3559
|
+
m.valueDataType === De.DigitOnly && ["e", "E", "+", "-", "."].includes(G.key) && G.preventDefault();
|
|
3558
3560
|
}
|
|
3559
3561
|
}
|
|
3560
3562
|
);
|
|
3561
3563
|
}
|
|
3562
3564
|
}
|
|
3563
3565
|
),
|
|
3564
|
-
|
|
3566
|
+
C === "radio" && m.defaultValues && /* @__PURE__ */ o("div", { className: "space-y-2", children: [
|
|
3565
3567
|
/* @__PURE__ */ n("p", { className: "text-sm text-gray-600 dark:text-gray-400", children: "Choose one option" }),
|
|
3566
3568
|
/* @__PURE__ */ n(
|
|
3567
|
-
|
|
3569
|
+
te,
|
|
3568
3570
|
{
|
|
3569
3571
|
control: g,
|
|
3570
3572
|
name: `criteriaValueInputs.${A}.values.0`,
|
|
3571
|
-
render: ({ field: { value:
|
|
3573
|
+
render: ({ field: { value: F, onChange: k } }) => /* @__PURE__ */ n("div", { className: "space-y-2", children: m.defaultValues.map((T, D) => /* @__PURE__ */ o("label", { className: "flex items-center space-x-2 cursor-pointer", children: [
|
|
3572
3574
|
/* @__PURE__ */ n(
|
|
3573
3575
|
"input",
|
|
3574
3576
|
{
|
|
3575
3577
|
type: "radio",
|
|
3576
|
-
checked:
|
|
3577
|
-
onChange: () =>
|
|
3578
|
+
checked: F === T,
|
|
3579
|
+
onChange: () => k(T),
|
|
3578
3580
|
className: "h-4 w-4 text-primary-500 border-gray-300 focus:ring-primary-500"
|
|
3579
3581
|
}
|
|
3580
3582
|
),
|
|
3581
|
-
/* @__PURE__ */ n("span", { className: "text-sm", children:
|
|
3582
|
-
] }, `${A}-${
|
|
3583
|
+
/* @__PURE__ */ n("span", { className: "text-sm", children: T })
|
|
3584
|
+
] }, `${A}-${D}`)) })
|
|
3583
3585
|
}
|
|
3584
3586
|
)
|
|
3585
3587
|
] }),
|
|
3586
|
-
|
|
3588
|
+
C === "checkbox" && m.defaultValues && /* @__PURE__ */ o("div", { className: "space-y-2", children: [
|
|
3587
3589
|
/* @__PURE__ */ n("p", { className: "text-sm text-gray-600 dark:text-gray-400", children: "Choose one or more options" }),
|
|
3588
3590
|
/* @__PURE__ */ n(
|
|
3589
|
-
|
|
3591
|
+
te,
|
|
3590
3592
|
{
|
|
3591
3593
|
control: g,
|
|
3592
3594
|
name: `criteriaValueInputs.${A}.values`,
|
|
3593
|
-
render: ({ field: { value:
|
|
3595
|
+
render: ({ field: { value: F = [], onChange: k } }) => /* @__PURE__ */ n("div", { className: "space-y-2", children: m.defaultValues.map((T, D) => /* @__PURE__ */ o("label", { className: "flex items-center space-x-2 cursor-pointer", children: [
|
|
3594
3596
|
/* @__PURE__ */ n(
|
|
3595
3597
|
"input",
|
|
3596
3598
|
{
|
|
3597
3599
|
type: "checkbox",
|
|
3598
|
-
checked: Array.isArray(
|
|
3599
|
-
onChange: (
|
|
3600
|
-
const
|
|
3601
|
-
|
|
3600
|
+
checked: Array.isArray(F) && F.includes(T),
|
|
3601
|
+
onChange: (G) => {
|
|
3602
|
+
const K = Array.isArray(F) ? F : [], R = G.target.checked ? [...K, T] : K.filter((E) => E !== T);
|
|
3603
|
+
k(R);
|
|
3602
3604
|
},
|
|
3603
3605
|
className: "h-4 w-4 text-primary-500 rounded border-gray-300 focus:ring-primary-500"
|
|
3604
3606
|
}
|
|
3605
3607
|
),
|
|
3606
|
-
/* @__PURE__ */ n("span", { className: "text-sm", children:
|
|
3607
|
-
] }, `${A}-${
|
|
3608
|
+
/* @__PURE__ */ n("span", { className: "text-sm", children: T })
|
|
3609
|
+
] }, `${A}-${D}`)) })
|
|
3608
3610
|
}
|
|
3609
3611
|
)
|
|
3610
3612
|
] }),
|
|
3611
|
-
|
|
3612
|
-
|
|
3613
|
+
C === "country" && /* @__PURE__ */ n(
|
|
3614
|
+
te,
|
|
3613
3615
|
{
|
|
3614
3616
|
control: g,
|
|
3615
3617
|
name: `criteriaValueInputs.${A}.values.0`,
|
|
3616
|
-
render: ({ field:
|
|
3617
|
-
var
|
|
3618
|
+
render: ({ field: F }) => {
|
|
3619
|
+
var k, T, D;
|
|
3618
3620
|
return /* @__PURE__ */ n(
|
|
3619
3621
|
ge,
|
|
3620
3622
|
{
|
|
3621
|
-
...
|
|
3623
|
+
...F,
|
|
3622
3624
|
options: [
|
|
3623
3625
|
{ value: "US", label: "United States" },
|
|
3624
3626
|
{ value: "GB", label: "United Kingdom" },
|
|
@@ -3626,16 +3628,16 @@ const Wr = me.any(), kr = ({
|
|
|
3626
3628
|
// TODO: Load from base information service
|
|
3627
3629
|
],
|
|
3628
3630
|
placeholder: "Select a country...",
|
|
3629
|
-
error: (
|
|
3631
|
+
error: (D = (T = (k = h.criteriaValueInputs) == null ? void 0 : k[A]) == null ? void 0 : T.values) == null ? void 0 : D.message
|
|
3630
3632
|
}
|
|
3631
3633
|
);
|
|
3632
3634
|
}
|
|
3633
3635
|
}
|
|
3634
3636
|
),
|
|
3635
|
-
((L = (
|
|
3637
|
+
((L = (B = (N = h.criteriaValueInputs) == null ? void 0 : N[A]) == null ? void 0 : B.values) == null ? void 0 : L.message) && /* @__PURE__ */ n("p", { className: "text-sm text-danger-500 mt-1", children: h.criteriaValueInputs[A].values.message })
|
|
3636
3638
|
] }, m.id);
|
|
3637
3639
|
}) }),
|
|
3638
|
-
/* @__PURE__ */ o(
|
|
3640
|
+
/* @__PURE__ */ o(ie, { className: "flex justify-between", children: [
|
|
3639
3641
|
r && /* @__PURE__ */ n(j, { type: "button", variant: "outline", onClick: r, children: "Back" }),
|
|
3640
3642
|
/* @__PURE__ */ n(
|
|
3641
3643
|
j,
|
|
@@ -3659,9 +3661,9 @@ const Wr = me.any(), kr = ({
|
|
|
3659
3661
|
onComplete: e,
|
|
3660
3662
|
onBack: r
|
|
3661
3663
|
}) => {
|
|
3662
|
-
const { investorCategorizationService: a } =
|
|
3663
|
-
return /* @__PURE__ */ n("form", { onSubmit: async (
|
|
3664
|
-
if (
|
|
3664
|
+
const { investorCategorizationService: a } = oe(), [s, i] = S(null), [l, c] = S(!1), [d, u] = S(null);
|
|
3665
|
+
return /* @__PURE__ */ n("form", { onSubmit: async (v) => {
|
|
3666
|
+
if (v.preventDefault(), s === null) {
|
|
3665
3667
|
u("Please select an investor type");
|
|
3666
3668
|
return;
|
|
3667
3669
|
}
|
|
@@ -3672,26 +3674,26 @@ const Wr = me.any(), kr = ({
|
|
|
3672
3674
|
investorType: s
|
|
3673
3675
|
};
|
|
3674
3676
|
console.log("Submitting investor categorization:", g);
|
|
3675
|
-
const
|
|
3676
|
-
console.log("Investor categorization result:",
|
|
3677
|
+
const w = await a.setInvestorCategorization(g);
|
|
3678
|
+
console.log("Investor categorization result:", w), e == null || e();
|
|
3677
3679
|
} catch (g) {
|
|
3678
3680
|
console.error("Error submitting investor categorization:", g), u(g.message || "Failed to submit investor categorization");
|
|
3679
3681
|
} finally {
|
|
3680
3682
|
c(!1);
|
|
3681
3683
|
}
|
|
3682
|
-
}, children: /* @__PURE__ */ o(
|
|
3683
|
-
/* @__PURE__ */ o(
|
|
3684
|
+
}, children: /* @__PURE__ */ o(M, { children: [
|
|
3685
|
+
/* @__PURE__ */ o(ne, { children: [
|
|
3684
3686
|
/* @__PURE__ */ n("h2", { className: "text-lg font-bold text-gray-900 dark:text-white", children: "Which statement best describes you?" }),
|
|
3685
3687
|
/* @__PURE__ */ n("p", { className: "text-gray-600 dark:text-gray-400 mt-2", children: "All Tokenise clients are treated as Retail Investors under EU regulation, which gives you the highest level of investor protection. For our internal purposes, we ask you to select the description that best matches your situation" })
|
|
3686
3688
|
] }),
|
|
3687
|
-
/* @__PURE__ */ o(
|
|
3689
|
+
/* @__PURE__ */ o(O, { className: "space-y-4", children: [
|
|
3688
3690
|
/* @__PURE__ */ n("p", { className: "text-sm font-medium text-gray-700 dark:text-gray-300 mb-3", children: "Choose one" }),
|
|
3689
3691
|
/* @__PURE__ */ n(
|
|
3690
3692
|
"label",
|
|
3691
3693
|
{
|
|
3692
3694
|
className: `
|
|
3693
3695
|
block p-4 border-2 rounded-lg cursor-pointer transition-all
|
|
3694
|
-
${s ===
|
|
3696
|
+
${s === ae.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"}
|
|
3695
3697
|
`,
|
|
3696
3698
|
children: /* @__PURE__ */ o("div", { className: "flex items-start", children: [
|
|
3697
3699
|
/* @__PURE__ */ n(
|
|
@@ -3699,9 +3701,9 @@ const Wr = me.any(), kr = ({
|
|
|
3699
3701
|
{
|
|
3700
3702
|
type: "radio",
|
|
3701
3703
|
name: "investorType",
|
|
3702
|
-
value:
|
|
3703
|
-
checked: s ===
|
|
3704
|
-
onChange: () => i(
|
|
3704
|
+
value: ae.Individual,
|
|
3705
|
+
checked: s === ae.Individual,
|
|
3706
|
+
onChange: () => i(ae.Individual),
|
|
3705
3707
|
className: "mt-1 h-4 w-4 text-primary-500 border-gray-300 focus:ring-primary-500"
|
|
3706
3708
|
}
|
|
3707
3709
|
),
|
|
@@ -3717,7 +3719,7 @@ const Wr = me.any(), kr = ({
|
|
|
3717
3719
|
{
|
|
3718
3720
|
className: `
|
|
3719
3721
|
block p-4 border-2 rounded-lg cursor-pointer transition-all
|
|
3720
|
-
${s ===
|
|
3722
|
+
${s === ae.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"}
|
|
3721
3723
|
`,
|
|
3722
3724
|
children: /* @__PURE__ */ o("div", { className: "flex items-start", children: [
|
|
3723
3725
|
/* @__PURE__ */ n(
|
|
@@ -3725,9 +3727,9 @@ const Wr = me.any(), kr = ({
|
|
|
3725
3727
|
{
|
|
3726
3728
|
type: "radio",
|
|
3727
3729
|
name: "investorType",
|
|
3728
|
-
value:
|
|
3729
|
-
checked: s ===
|
|
3730
|
-
onChange: () => i(
|
|
3730
|
+
value: ae.Sophisticated,
|
|
3731
|
+
checked: s === ae.Sophisticated,
|
|
3732
|
+
onChange: () => i(ae.Sophisticated),
|
|
3731
3733
|
className: "mt-1 h-4 w-4 text-primary-500 border-gray-300 focus:ring-primary-500"
|
|
3732
3734
|
}
|
|
3733
3735
|
),
|
|
@@ -3748,7 +3750,7 @@ const Wr = me.any(), kr = ({
|
|
|
3748
3750
|
{
|
|
3749
3751
|
className: `
|
|
3750
3752
|
block p-4 border-2 rounded-lg cursor-pointer transition-all
|
|
3751
|
-
${s ===
|
|
3753
|
+
${s === ae.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"}
|
|
3752
3754
|
`,
|
|
3753
3755
|
children: /* @__PURE__ */ o("div", { className: "flex items-start", children: [
|
|
3754
3756
|
/* @__PURE__ */ n(
|
|
@@ -3756,9 +3758,9 @@ const Wr = me.any(), kr = ({
|
|
|
3756
3758
|
{
|
|
3757
3759
|
type: "radio",
|
|
3758
3760
|
name: "investorType",
|
|
3759
|
-
value:
|
|
3760
|
-
checked: s ===
|
|
3761
|
-
onChange: () => i(
|
|
3761
|
+
value: ae.HighNetWorth,
|
|
3762
|
+
checked: s === ae.HighNetWorth,
|
|
3763
|
+
onChange: () => i(ae.HighNetWorth),
|
|
3762
3764
|
className: "mt-1 h-4 w-4 text-primary-500 border-gray-300 focus:ring-primary-500"
|
|
3763
3765
|
}
|
|
3764
3766
|
),
|
|
@@ -3779,7 +3781,7 @@ const Wr = me.any(), kr = ({
|
|
|
3779
3781
|
d
|
|
3780
3782
|
] }) })
|
|
3781
3783
|
] }),
|
|
3782
|
-
/* @__PURE__ */ o(
|
|
3784
|
+
/* @__PURE__ */ o(ie, { className: "flex justify-between", children: [
|
|
3783
3785
|
r && /* @__PURE__ */ n(j, { type: "button", variant: "outline", onClick: r, children: "Back" }),
|
|
3784
3786
|
/* @__PURE__ */ n(
|
|
3785
3787
|
j,
|
|
@@ -3797,135 +3799,135 @@ const Wr = me.any(), kr = ({
|
|
|
3797
3799
|
onComplete: e,
|
|
3798
3800
|
onBack: r
|
|
3799
3801
|
}) => {
|
|
3800
|
-
const { appropriatenessTestService: a } =
|
|
3801
|
-
|
|
3802
|
+
const { appropriatenessTestService: a } = oe(), [s, i] = S(null), [l, c] = S(!0), [d, u] = S(!1), [y, v] = S(null), [g, w] = S({}), [h, x] = S(0), [p, m] = S(!1), [A, C] = S(!1), [N, B] = S(0);
|
|
3803
|
+
Q(() => {
|
|
3802
3804
|
(async () => {
|
|
3803
3805
|
try {
|
|
3804
|
-
c(!0),
|
|
3805
|
-
const
|
|
3806
|
-
if (console.log("Appropriateness test data:",
|
|
3807
|
-
const
|
|
3808
|
-
|
|
3806
|
+
c(!0), v(null), console.log("Loading appropriateness test for applicant:", t);
|
|
3807
|
+
const E = await a.getAppropriatenessTest(t);
|
|
3808
|
+
if (console.log("Appropriateness test data:", E), i(E), E.waitTimeSpanForNextTry && E.waitTimeSpanForNextTry !== "00:00:00") {
|
|
3809
|
+
const H = L(E.waitTimeSpanForNextTry);
|
|
3810
|
+
H > 0 && B(H);
|
|
3809
3811
|
}
|
|
3810
|
-
} catch (
|
|
3811
|
-
console.error("Error loading appropriateness test:",
|
|
3812
|
+
} catch (E) {
|
|
3813
|
+
console.error("Error loading appropriateness test:", E), v(E.message || "Failed to load appropriateness test");
|
|
3812
3814
|
} finally {
|
|
3813
3815
|
c(!1);
|
|
3814
3816
|
}
|
|
3815
3817
|
})();
|
|
3816
3818
|
}, [t, a]);
|
|
3817
|
-
const L = (
|
|
3818
|
-
const
|
|
3819
|
-
if (
|
|
3820
|
-
const [
|
|
3821
|
-
return
|
|
3819
|
+
const L = (R) => {
|
|
3820
|
+
const E = R.split(":").map(Number);
|
|
3821
|
+
if (E.length === 3) {
|
|
3822
|
+
const [H, b, P] = E;
|
|
3823
|
+
return H * 3600 + b * 60 + P;
|
|
3822
3824
|
}
|
|
3823
3825
|
return 0;
|
|
3824
|
-
},
|
|
3825
|
-
const
|
|
3826
|
-
return `${
|
|
3826
|
+
}, F = (R) => {
|
|
3827
|
+
const E = Math.floor(R / 60), H = R % 60;
|
|
3828
|
+
return `${E.toString().padStart(2, "0")}:${H.toString().padStart(2, "0")}`;
|
|
3827
3829
|
};
|
|
3828
|
-
|
|
3830
|
+
Q(() => {
|
|
3829
3831
|
if (!p || h <= 0) return;
|
|
3830
|
-
const
|
|
3831
|
-
|
|
3832
|
+
const R = setInterval(() => {
|
|
3833
|
+
x((E) => E <= 1 ? (C(!0), 0) : E - 1);
|
|
3832
3834
|
}, 1e3);
|
|
3833
|
-
return () => clearInterval(
|
|
3834
|
-
}, [p, h]),
|
|
3835
|
-
if (
|
|
3836
|
-
const
|
|
3837
|
-
|
|
3835
|
+
return () => clearInterval(R);
|
|
3836
|
+
}, [p, h]), Q(() => {
|
|
3837
|
+
if (N <= 0) return;
|
|
3838
|
+
const R = setInterval(() => {
|
|
3839
|
+
B((E) => E <= 1 ? 0 : E - 1);
|
|
3838
3840
|
}, 1e3);
|
|
3839
|
-
return () => clearInterval(
|
|
3840
|
-
}, [
|
|
3841
|
-
A && !d &&
|
|
3841
|
+
return () => clearInterval(R);
|
|
3842
|
+
}, [N]), Q(() => {
|
|
3843
|
+
A && !d && D();
|
|
3842
3844
|
}, [A]);
|
|
3843
|
-
const
|
|
3844
|
-
s && (m(!0),
|
|
3845
|
-
},
|
|
3846
|
-
|
|
3847
|
-
...
|
|
3848
|
-
[
|
|
3845
|
+
const k = () => {
|
|
3846
|
+
s && (m(!0), x(s.testDurationSec));
|
|
3847
|
+
}, T = (R, E) => {
|
|
3848
|
+
w((H) => ({
|
|
3849
|
+
...H,
|
|
3850
|
+
[R]: E
|
|
3849
3851
|
}));
|
|
3850
|
-
},
|
|
3851
|
-
if (
|
|
3852
|
+
}, D = async (R) => {
|
|
3853
|
+
if (R && R.preventDefault(), !!s) {
|
|
3852
3854
|
if (!A) {
|
|
3853
|
-
const
|
|
3854
|
-
if (
|
|
3855
|
-
|
|
3855
|
+
const E = s.appropriatenessQuestions.length - Object.keys(g).length;
|
|
3856
|
+
if (E > 0) {
|
|
3857
|
+
v(`Please answer all questions. ${E} question(s) remaining.`);
|
|
3856
3858
|
return;
|
|
3857
3859
|
}
|
|
3858
3860
|
}
|
|
3859
|
-
u(!0),
|
|
3861
|
+
u(!0), v(null);
|
|
3860
3862
|
try {
|
|
3861
|
-
const
|
|
3862
|
-
(
|
|
3863
|
-
appropriatenessQuestionId:
|
|
3864
|
-
value: g[
|
|
3863
|
+
const E = s.appropriatenessQuestions.map(
|
|
3864
|
+
(b) => ({
|
|
3865
|
+
appropriatenessQuestionId: b.id,
|
|
3866
|
+
value: g[b.id] || ""
|
|
3865
3867
|
// Empty string if not answered
|
|
3866
3868
|
})
|
|
3867
|
-
),
|
|
3869
|
+
), H = {
|
|
3868
3870
|
applicantId: t,
|
|
3869
3871
|
appropriatenessTestId: s.id,
|
|
3870
|
-
appropriatenessQuestionResults:
|
|
3872
|
+
appropriatenessQuestionResults: E
|
|
3871
3873
|
};
|
|
3872
|
-
console.log("Submitting appropriateness test:",
|
|
3874
|
+
console.log("Submitting appropriateness test:", H);
|
|
3873
3875
|
try {
|
|
3874
|
-
const
|
|
3875
|
-
console.log("Appropriateness test result:",
|
|
3876
|
-
} catch (
|
|
3877
|
-
if (
|
|
3878
|
-
const
|
|
3879
|
-
console.log("Test failed:",
|
|
3876
|
+
const b = await a.fillAppropriatenessTest(H);
|
|
3877
|
+
console.log("Appropriateness test result:", b), b.message && (b.message.toLowerCase().includes("pass") || b.message.toLowerCase().includes("success") || b.message.toLowerCase().includes("congratulations")) ? e == null || e() : (v(b.message || "Test completed. Please check the result."), m(!1), C(!1), w({}), setTimeout(() => G(), 1e3));
|
|
3878
|
+
} catch (b) {
|
|
3879
|
+
if (b.code === 400 && b.message) {
|
|
3880
|
+
const P = b.message;
|
|
3881
|
+
console.log("Test failed:", P), v(P), m(!1), C(!1), w({}), setTimeout(() => G(), 1500);
|
|
3880
3882
|
} else
|
|
3881
|
-
throw
|
|
3883
|
+
throw b;
|
|
3882
3884
|
}
|
|
3883
|
-
} catch (
|
|
3884
|
-
console.error("Error submitting appropriateness test:",
|
|
3885
|
+
} catch (E) {
|
|
3886
|
+
console.error("Error submitting appropriateness test:", E), v(E.message || "Failed to submit test. Please try again."), m(!1), C(!1), w({});
|
|
3885
3887
|
} finally {
|
|
3886
3888
|
u(!1);
|
|
3887
3889
|
}
|
|
3888
3890
|
}
|
|
3889
|
-
},
|
|
3891
|
+
}, G = async () => {
|
|
3890
3892
|
try {
|
|
3891
|
-
const
|
|
3892
|
-
if (console.log("Reloaded test data:",
|
|
3893
|
-
const
|
|
3894
|
-
|
|
3893
|
+
const R = await a.getAppropriatenessTest(t);
|
|
3894
|
+
if (console.log("Reloaded test data:", R), i(R), R.waitTimeSpanForNextTry && R.waitTimeSpanForNextTry !== "00:00:00") {
|
|
3895
|
+
const E = L(R.waitTimeSpanForNextTry);
|
|
3896
|
+
E > 0 && B(E);
|
|
3895
3897
|
}
|
|
3896
|
-
} catch (
|
|
3897
|
-
console.error("Error reloading test data:",
|
|
3898
|
+
} catch (R) {
|
|
3899
|
+
console.error("Error reloading test data:", R), v((E) => E + `
|
|
3898
3900
|
|
|
3899
3901
|
Failed to reload test data. Please refresh the page.`);
|
|
3900
3902
|
}
|
|
3901
3903
|
};
|
|
3902
3904
|
if (l)
|
|
3903
|
-
return /* @__PURE__ */ n(
|
|
3905
|
+
return /* @__PURE__ */ n(M, { children: /* @__PURE__ */ o(O, { children: [
|
|
3904
3906
|
/* @__PURE__ */ n(de, { className: "my-8" }),
|
|
3905
3907
|
/* @__PURE__ */ n("p", { className: "text-center text-gray-600 dark:text-gray-400 mt-4", children: "Loading appropriateness test..." })
|
|
3906
3908
|
] }) });
|
|
3907
3909
|
if (!s)
|
|
3908
|
-
return /* @__PURE__ */ n(
|
|
3910
|
+
return /* @__PURE__ */ n(M, { children: /* @__PURE__ */ o(O, { className: "py-12 text-center", children: [
|
|
3909
3911
|
/* @__PURE__ */ n("p", { className: "text-danger-500 text-lg mb-4", children: "No test data available" }),
|
|
3910
3912
|
y && /* @__PURE__ */ n("p", { className: "text-gray-600 dark:text-gray-400", children: y })
|
|
3911
3913
|
] }) });
|
|
3912
|
-
if (
|
|
3913
|
-
return /* @__PURE__ */ o(
|
|
3914
|
-
/* @__PURE__ */ o(
|
|
3914
|
+
if (N > 0)
|
|
3915
|
+
return /* @__PURE__ */ o(M, { children: [
|
|
3916
|
+
/* @__PURE__ */ o(ne, { children: [
|
|
3915
3917
|
/* @__PURE__ */ n("h2", { className: "text-lg font-bold text-gray-900 dark:text-white", children: s.displayName }),
|
|
3916
3918
|
s.subtitle && /* @__PURE__ */ n("p", { className: "text-gray-600 dark:text-gray-400 mt-2", children: s.subtitle })
|
|
3917
3919
|
] }),
|
|
3918
|
-
/* @__PURE__ */ o(
|
|
3920
|
+
/* @__PURE__ */ o(O, { className: "py-12 text-center", children: [
|
|
3919
3921
|
/* @__PURE__ */ o("div", { className: "mb-6", children: [
|
|
3920
|
-
/* @__PURE__ */ n("div", { className: "text-6xl font-bold text-primary-500 mb-2", children:
|
|
3922
|
+
/* @__PURE__ */ n("div", { className: "text-6xl font-bold text-primary-500 mb-2", children: F(N) }),
|
|
3921
3923
|
/* @__PURE__ */ n("p", { className: "text-gray-600 dark:text-gray-400", children: "Please wait before attempting the test again" })
|
|
3922
3924
|
] }),
|
|
3923
3925
|
y && /* @__PURE__ */ n("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__ */ n("p", { className: "text-red-600 dark:text-red-400 text-sm", children: y }) })
|
|
3924
3926
|
] })
|
|
3925
3927
|
] });
|
|
3926
|
-
const
|
|
3927
|
-
return p ? /* @__PURE__ */ n("form", { onSubmit:
|
|
3928
|
-
/* @__PURE__ */ n(
|
|
3928
|
+
const K = s.testAllowedMaxTry - s.totalFailedTries;
|
|
3929
|
+
return p ? /* @__PURE__ */ n("form", { onSubmit: D, children: /* @__PURE__ */ o(M, { children: [
|
|
3930
|
+
/* @__PURE__ */ n(ne, { children: /* @__PURE__ */ o("div", { className: "flex items-center justify-between", children: [
|
|
3929
3931
|
/* @__PURE__ */ o("div", { children: [
|
|
3930
3932
|
/* @__PURE__ */ n("h2", { className: "text-lg font-bold text-gray-900 dark:text-white", children: s.displayName }),
|
|
3931
3933
|
s.subtitle && /* @__PURE__ */ n("p", { className: "text-gray-600 dark:text-gray-400 mt-1", children: s.subtitle })
|
|
@@ -3935,13 +3937,13 @@ Failed to reload test data. Please refresh the page.`);
|
|
|
3935
3937
|
"div",
|
|
3936
3938
|
{
|
|
3937
3939
|
className: `text-3xl font-bold ${h <= 60 ? "text-danger-500" : "text-primary-500"}`,
|
|
3938
|
-
children:
|
|
3940
|
+
children: F(h)
|
|
3939
3941
|
}
|
|
3940
3942
|
),
|
|
3941
3943
|
/* @__PURE__ */ n("p", { className: "text-sm text-gray-500 dark:text-gray-400", children: "Time Remaining" })
|
|
3942
3944
|
] })
|
|
3943
3945
|
] }) }),
|
|
3944
|
-
/* @__PURE__ */ o(
|
|
3946
|
+
/* @__PURE__ */ o(O, { className: "space-y-6", children: [
|
|
3945
3947
|
/* @__PURE__ */ o("div", { className: "flex items-center justify-between mb-4", children: [
|
|
3946
3948
|
/* @__PURE__ */ o(pe, { variant: "info", children: [
|
|
3947
3949
|
"Question ",
|
|
@@ -3949,14 +3951,14 @@ Failed to reload test data. Please refresh the page.`);
|
|
|
3949
3951
|
" of ",
|
|
3950
3952
|
s.totalQuestionCount
|
|
3951
3953
|
] }),
|
|
3952
|
-
/* @__PURE__ */ o(pe, { variant:
|
|
3953
|
-
|
|
3954
|
+
/* @__PURE__ */ o(pe, { variant: K > 1 ? "success" : "warning", children: [
|
|
3955
|
+
K,
|
|
3954
3956
|
" attempt",
|
|
3955
|
-
|
|
3957
|
+
K !== 1 ? "s" : "",
|
|
3956
3958
|
" remaining"
|
|
3957
3959
|
] })
|
|
3958
3960
|
] }),
|
|
3959
|
-
s.appropriatenessQuestions.map((
|
|
3961
|
+
s.appropriatenessQuestions.map((R, E) => /* @__PURE__ */ o(
|
|
3960
3962
|
"div",
|
|
3961
3963
|
{
|
|
3962
3964
|
className: "p-4 border border-gray-200 dark:border-gray-700 rounded-lg",
|
|
@@ -3964,39 +3966,39 @@ Failed to reload test data. Please refresh the page.`);
|
|
|
3964
3966
|
/* @__PURE__ */ o("div", { className: "mb-4", children: [
|
|
3965
3967
|
/* @__PURE__ */ o("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: [
|
|
3966
3968
|
"Question ",
|
|
3967
|
-
|
|
3969
|
+
E + 1
|
|
3968
3970
|
] }),
|
|
3969
|
-
|
|
3970
|
-
/* @__PURE__ */ n("h3", { className: "text-lg font-semibold text-gray-900 dark:text-white mt-2", children:
|
|
3971
|
+
R.groupName && /* @__PURE__ */ n("span", { className: "ml-2 text-xs text-gray-500 dark:text-gray-400", children: R.groupName }),
|
|
3972
|
+
/* @__PURE__ */ n("h3", { className: "text-lg font-semibold text-gray-900 dark:text-white mt-2", children: R.question })
|
|
3971
3973
|
] }),
|
|
3972
|
-
/* @__PURE__ */ n("div", { className: "space-y-2", children:
|
|
3974
|
+
/* @__PURE__ */ n("div", { className: "space-y-2", children: R.answers.map((H, b) => /* @__PURE__ */ o(
|
|
3973
3975
|
"label",
|
|
3974
3976
|
{
|
|
3975
3977
|
className: `
|
|
3976
3978
|
flex items-center p-3 border-2 rounded-lg cursor-pointer transition-all
|
|
3977
|
-
${g[
|
|
3979
|
+
${g[R.id] === H ? "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"}
|
|
3978
3980
|
`,
|
|
3979
3981
|
children: [
|
|
3980
3982
|
/* @__PURE__ */ n(
|
|
3981
3983
|
"input",
|
|
3982
3984
|
{
|
|
3983
3985
|
type: "radio",
|
|
3984
|
-
name: `question-${
|
|
3985
|
-
value:
|
|
3986
|
-
checked: g[
|
|
3987
|
-
onChange: (
|
|
3986
|
+
name: `question-${R.id}`,
|
|
3987
|
+
value: H,
|
|
3988
|
+
checked: g[R.id] === H,
|
|
3989
|
+
onChange: (P) => T(R.id, P.target.value),
|
|
3988
3990
|
className: "h-4 w-4 text-primary-500 border-gray-300 focus:ring-primary-500",
|
|
3989
3991
|
disabled: d
|
|
3990
3992
|
}
|
|
3991
3993
|
),
|
|
3992
|
-
/* @__PURE__ */ n("span", { className: "ml-3 text-gray-700 dark:text-gray-300", children:
|
|
3994
|
+
/* @__PURE__ */ n("span", { className: "ml-3 text-gray-700 dark:text-gray-300", children: H })
|
|
3993
3995
|
]
|
|
3994
3996
|
},
|
|
3995
|
-
|
|
3997
|
+
b
|
|
3996
3998
|
)) })
|
|
3997
3999
|
]
|
|
3998
4000
|
},
|
|
3999
|
-
|
|
4001
|
+
R.id
|
|
4000
4002
|
)),
|
|
4001
4003
|
y && !A && /* @__PURE__ */ n("div", { className: "p-4 bg-red-50 dark:bg-red-900/20 border border-red-200 dark:border-red-800 rounded-lg", children: /* @__PURE__ */ o("p", { className: "text-red-600 dark:text-red-400 text-sm", children: [
|
|
4002
4004
|
/* @__PURE__ */ n("strong", { children: "Error:" }),
|
|
@@ -4008,7 +4010,7 @@ Failed to reload test data. Please refresh the page.`);
|
|
|
4008
4010
|
" Your answers are being submitted automatically."
|
|
4009
4011
|
] }) })
|
|
4010
4012
|
] }),
|
|
4011
|
-
/* @__PURE__ */ o(
|
|
4013
|
+
/* @__PURE__ */ o(ie, { className: "flex justify-between", children: [
|
|
4012
4014
|
/* @__PURE__ */ n(
|
|
4013
4015
|
j,
|
|
4014
4016
|
{
|
|
@@ -4029,12 +4031,12 @@ Failed to reload test data. Please refresh the page.`);
|
|
|
4029
4031
|
}
|
|
4030
4032
|
)
|
|
4031
4033
|
] })
|
|
4032
|
-
] }) }) : /* @__PURE__ */ o(
|
|
4033
|
-
/* @__PURE__ */ o(
|
|
4034
|
+
] }) }) : /* @__PURE__ */ o(M, { children: [
|
|
4035
|
+
/* @__PURE__ */ o(ne, { children: [
|
|
4034
4036
|
/* @__PURE__ */ n("h2", { className: "text-lg font-bold text-gray-900 dark:text-white", children: s.displayName }),
|
|
4035
4037
|
s.subtitle && /* @__PURE__ */ n("p", { className: "text-gray-600 dark:text-gray-400 mt-2", children: s.subtitle })
|
|
4036
4038
|
] }),
|
|
4037
|
-
/* @__PURE__ */ o(
|
|
4039
|
+
/* @__PURE__ */ o(O, { children: [
|
|
4038
4040
|
s.description && /* @__PURE__ */ n("div", { className: "mb-6 p-4 bg-gray-50 dark:bg-gray-800 rounded-lg", children: /* @__PURE__ */ n("p", { className: "text-gray-700 dark:text-gray-300", children: s.description }) }),
|
|
4039
4041
|
/* @__PURE__ */ o("div", { className: "space-y-4 mb-6", children: [
|
|
4040
4042
|
/* @__PURE__ */ o("div", { className: "flex items-center justify-between p-4 bg-blue-50 dark:bg-blue-900/20 rounded-lg", children: [
|
|
@@ -4043,7 +4045,7 @@ Failed to reload test data. Please refresh the page.`);
|
|
|
4043
4045
|
] }),
|
|
4044
4046
|
/* @__PURE__ */ o("div", { className: "flex items-center justify-between p-4 bg-blue-50 dark:bg-blue-900/20 rounded-lg", children: [
|
|
4045
4047
|
/* @__PURE__ */ n("span", { className: "text-gray-700 dark:text-gray-300 font-medium", children: "Time Limit:" }),
|
|
4046
|
-
/* @__PURE__ */ n(pe, { variant: "info", children:
|
|
4048
|
+
/* @__PURE__ */ n(pe, { variant: "info", children: F(s.testDurationSec) })
|
|
4047
4049
|
] }),
|
|
4048
4050
|
/* @__PURE__ */ o("div", { className: "flex items-center justify-between p-4 bg-blue-50 dark:bg-blue-900/20 rounded-lg", children: [
|
|
4049
4051
|
/* @__PURE__ */ n("span", { className: "text-gray-700 dark:text-gray-300 font-medium", children: "Correct Answers Required:" }),
|
|
@@ -4051,7 +4053,7 @@ Failed to reload test data. Please refresh the page.`);
|
|
|
4051
4053
|
] }),
|
|
4052
4054
|
/* @__PURE__ */ o("div", { className: "flex items-center justify-between p-4 bg-blue-50 dark:bg-blue-900/20 rounded-lg", children: [
|
|
4053
4055
|
/* @__PURE__ */ n("span", { className: "text-gray-700 dark:text-gray-300 font-medium", children: "Attempts Remaining:" }),
|
|
4054
|
-
/* @__PURE__ */ n(pe, { variant:
|
|
4056
|
+
/* @__PURE__ */ n(pe, { variant: K > 1 ? "success" : "warning", children: K })
|
|
4055
4057
|
] })
|
|
4056
4058
|
] }),
|
|
4057
4059
|
y && /* @__PURE__ */ n("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__ */ o("p", { className: "text-red-600 dark:text-red-400 text-sm", children: [
|
|
@@ -4059,16 +4061,16 @@ Failed to reload test data. Please refresh the page.`);
|
|
|
4059
4061
|
" ",
|
|
4060
4062
|
y
|
|
4061
4063
|
] }) }),
|
|
4062
|
-
|
|
4064
|
+
K <= 0 && /* @__PURE__ */ n("div", { className: "p-4 bg-red-50 dark:bg-red-900/20 border border-red-200 dark:border-red-800 rounded-lg", children: /* @__PURE__ */ n("p", { className: "text-red-600 dark:text-red-400", children: "You have used all your attempts. Please contact support for assistance." }) })
|
|
4063
4065
|
] }),
|
|
4064
|
-
/* @__PURE__ */ o(
|
|
4066
|
+
/* @__PURE__ */ o(ie, { className: "flex justify-between", children: [
|
|
4065
4067
|
r && /* @__PURE__ */ n(j, { type: "button", variant: "outline", onClick: r, children: "Back" }),
|
|
4066
4068
|
/* @__PURE__ */ n(
|
|
4067
4069
|
j,
|
|
4068
4070
|
{
|
|
4069
4071
|
type: "button",
|
|
4070
|
-
onClick:
|
|
4071
|
-
disabled:
|
|
4072
|
+
onClick: k,
|
|
4073
|
+
disabled: K <= 0,
|
|
4072
4074
|
children: "Start Test"
|
|
4073
4075
|
}
|
|
4074
4076
|
)
|
|
@@ -4079,8 +4081,8 @@ Failed to reload test data. Please refresh the page.`);
|
|
|
4079
4081
|
onComplete: e,
|
|
4080
4082
|
onBack: r
|
|
4081
4083
|
}) => {
|
|
4082
|
-
var
|
|
4083
|
-
const { applicantService: a, baseInformationService: s, config: i } =
|
|
4084
|
+
var H, b, P, q;
|
|
4085
|
+
const { applicantService: a, baseInformationService: s, config: i } = oe(), { identityData: l, provider: c, token: d, isLoading: u, error: y, requestIdentity: v, restartIdentity: g } = tr(t), [w, h] = S(null), [x, p] = S(null), [m, A] = S([]), [C, N] = S(!0), [B, L] = S(!1), [F, k] = S(null), [T, D] = S(!1), G = re.useRef(!1), K = Te({
|
|
4084
4086
|
defaultValues: {
|
|
4085
4087
|
street: "",
|
|
4086
4088
|
streetNumber: "",
|
|
@@ -4091,21 +4093,21 @@ Failed to reload test data. Please refresh the page.`);
|
|
|
4091
4093
|
phonenumber: ""
|
|
4092
4094
|
}
|
|
4093
4095
|
});
|
|
4094
|
-
|
|
4096
|
+
Q(() => {
|
|
4095
4097
|
(async () => {
|
|
4096
4098
|
try {
|
|
4097
|
-
const [
|
|
4099
|
+
const [f, z] = await Promise.all([
|
|
4098
4100
|
a.getApplicantData(t),
|
|
4099
4101
|
s.getCountries("", "en")
|
|
4100
4102
|
]);
|
|
4101
|
-
p(
|
|
4102
|
-
const
|
|
4103
|
+
p(f);
|
|
4104
|
+
const W = /* @__PURE__ */ new Set(), X = z.filter((he) => {
|
|
4103
4105
|
const Ae = he.abbreviation3 || he.abbreviation;
|
|
4104
|
-
return !Ae ||
|
|
4106
|
+
return !Ae || W.has(Ae) ? !1 : (W.add(Ae), !0);
|
|
4105
4107
|
});
|
|
4106
|
-
A(
|
|
4107
|
-
const _ =
|
|
4108
|
-
if (
|
|
4108
|
+
A(X);
|
|
4109
|
+
const _ = f.applicantRequestData;
|
|
4110
|
+
if (K.reset({
|
|
4109
4111
|
street: (_ == null ? void 0 : _.street) || "",
|
|
4110
4112
|
streetNumber: (_ == null ? void 0 : _.streetNumber) || "",
|
|
4111
4113
|
city: (_ == null ? void 0 : _.city) || "",
|
|
@@ -4113,141 +4115,141 @@ Failed to reload test data. Please refresh the page.`);
|
|
|
4113
4115
|
country: (_ == null ? void 0 : _.country) || "",
|
|
4114
4116
|
nationality: (_ == null ? void 0 : _.nationality) || "",
|
|
4115
4117
|
phonenumber: (_ == null ? void 0 : _.phonenumber) || ""
|
|
4116
|
-
}),
|
|
4117
|
-
console.log("[Identity] Found existing identity verification, auto-requesting..."),
|
|
4118
|
+
}), f.kycRecords && f.kycRecords.length > 0 && f.kycRecords[0].providerTokenObject !== null && !G.current) {
|
|
4119
|
+
console.log("[Identity] Found existing identity verification, auto-requesting..."), G.current = !0;
|
|
4118
4120
|
try {
|
|
4119
|
-
await
|
|
4121
|
+
await v(), L(!0);
|
|
4120
4122
|
} catch (he) {
|
|
4121
4123
|
console.error("[Identity] Auto-request failed:", he);
|
|
4122
4124
|
}
|
|
4123
4125
|
}
|
|
4124
|
-
} catch (
|
|
4125
|
-
console.error("Error loading applicant data:",
|
|
4126
|
+
} catch (f) {
|
|
4127
|
+
console.error("Error loading applicant data:", f);
|
|
4126
4128
|
} finally {
|
|
4127
|
-
|
|
4129
|
+
N(!1);
|
|
4128
4130
|
}
|
|
4129
4131
|
})();
|
|
4130
|
-
}, [t]),
|
|
4131
|
-
l && !
|
|
4132
|
-
}, [l,
|
|
4132
|
+
}, [t]), Q(() => {
|
|
4133
|
+
l && !B && (console.log("[Identity] Identity data already loaded, showing provider"), L(!0));
|
|
4134
|
+
}, [l, B]), Q(() => {
|
|
4133
4135
|
if (d) {
|
|
4134
4136
|
if (d.expiresAt) {
|
|
4135
|
-
const
|
|
4136
|
-
if (Date.now() >=
|
|
4137
|
-
console.warn("[Identity] Token has expired (expiresAt)"),
|
|
4137
|
+
const I = new Date(d.expiresAt).getTime();
|
|
4138
|
+
if (Date.now() >= I) {
|
|
4139
|
+
console.warn("[Identity] Token has expired (expiresAt)"), D(!0), k("Your verification session has expired. Please restart.");
|
|
4138
4140
|
return;
|
|
4139
4141
|
}
|
|
4140
4142
|
}
|
|
4141
4143
|
if (d.url)
|
|
4142
4144
|
try {
|
|
4143
|
-
const
|
|
4144
|
-
if (
|
|
4145
|
-
console.warn("[Identity] Token URL indicates expiration"),
|
|
4145
|
+
const f = new URL(d.url).toString().toLowerCase();
|
|
4146
|
+
if (f.includes("expired") || f.includes("invalid") || f.includes("error")) {
|
|
4147
|
+
console.warn("[Identity] Token URL indicates expiration"), D(!0), k("Your verification link has expired. Please restart.");
|
|
4146
4148
|
return;
|
|
4147
4149
|
}
|
|
4148
4150
|
} catch {
|
|
4149
4151
|
console.error("[Identity] Invalid token URL");
|
|
4150
4152
|
}
|
|
4151
4153
|
if (d.status === "expired" || d.error === "expired" || d.expired === !0) {
|
|
4152
|
-
console.warn("[Identity] Token object indicates expiration"),
|
|
4154
|
+
console.warn("[Identity] Token object indicates expiration"), D(!0), k("Your verification session has expired. Please restart.");
|
|
4153
4155
|
return;
|
|
4154
4156
|
}
|
|
4155
4157
|
}
|
|
4156
|
-
}, [d]),
|
|
4157
|
-
if (c !== null && d && !
|
|
4158
|
-
const
|
|
4158
|
+
}, [d]), Q(() => {
|
|
4159
|
+
if (c !== null && d && !w && B && !T) {
|
|
4160
|
+
const I = c;
|
|
4159
4161
|
if (d.url) {
|
|
4160
|
-
console.log("[Identity] Loading provider URL for user verification:", d.url),
|
|
4162
|
+
console.log("[Identity] Loading provider URL for user verification:", d.url), k(null);
|
|
4161
4163
|
try {
|
|
4162
|
-
if (new URL(d.url),
|
|
4164
|
+
if (new URL(d.url), I === le.SardinAI) {
|
|
4163
4165
|
console.log("[SardinAI] Initializing Risk SDK in background...");
|
|
4164
4166
|
try {
|
|
4165
|
-
const
|
|
4166
|
-
be.createProvider(c,
|
|
4167
|
+
const f = be.parseProviderConfig(c, d, i);
|
|
4168
|
+
be.createProvider(c, f).initialize().then(() => {
|
|
4167
4169
|
console.log("[SardinAI] Risk SDK initialized successfully in background");
|
|
4168
|
-
}).catch((
|
|
4169
|
-
console.warn("[SardinAI] Risk SDK initialization failed (non-blocking):",
|
|
4170
|
+
}).catch((W) => {
|
|
4171
|
+
console.warn("[SardinAI] Risk SDK initialization failed (non-blocking):", W);
|
|
4170
4172
|
});
|
|
4171
|
-
} catch (
|
|
4172
|
-
console.warn("[SardinAI] Risk SDK setup failed (non-blocking):",
|
|
4173
|
+
} catch (f) {
|
|
4174
|
+
console.warn("[SardinAI] Risk SDK setup failed (non-blocking):", f);
|
|
4173
4175
|
}
|
|
4174
4176
|
}
|
|
4175
4177
|
h({ type: "url", url: d.url });
|
|
4176
|
-
} catch (
|
|
4177
|
-
console.error("[Identity] Invalid URL:",
|
|
4178
|
+
} catch (f) {
|
|
4179
|
+
console.error("[Identity] Invalid URL:", f), k("Invalid verification URL. Please restart."), D(!0);
|
|
4178
4180
|
}
|
|
4179
4181
|
return;
|
|
4180
4182
|
}
|
|
4181
|
-
if (
|
|
4182
|
-
console.log("[SardinAI] No URL provided - initializing Risk SDK only..."),
|
|
4183
|
+
if (I === le.SardinAI) {
|
|
4184
|
+
console.log("[SardinAI] No URL provided - initializing Risk SDK only..."), k(null);
|
|
4183
4185
|
try {
|
|
4184
|
-
const
|
|
4185
|
-
|
|
4186
|
-
console.log("[SardinAI] Risk SDK initialized successfully"), h(
|
|
4186
|
+
const f = be.parseProviderConfig(c, d, i), z = be.createProvider(c, f);
|
|
4187
|
+
z.initialize().then(() => {
|
|
4188
|
+
console.log("[SardinAI] Risk SDK initialized successfully"), h(z), setTimeout(() => {
|
|
4187
4189
|
e == null || e();
|
|
4188
4190
|
}, 2e3);
|
|
4189
|
-
}).catch((
|
|
4191
|
+
}).catch((W) => {
|
|
4190
4192
|
var _;
|
|
4191
|
-
console.error("[SardinAI] Failed to initialize:",
|
|
4192
|
-
const
|
|
4193
|
-
|
|
4193
|
+
console.error("[SardinAI] Failed to initialize:", W);
|
|
4194
|
+
const X = ((_ = W.message) == null ? void 0 : _.toLowerCase()) || "";
|
|
4195
|
+
X.includes("expired") || X.includes("invalid") || X.includes("401") || X.includes("400") ? (D(!0), k("Session expired or invalid. Please restart verification.")) : k(`Failed to initialize: ${W.message}`);
|
|
4194
4196
|
});
|
|
4195
|
-
} catch (
|
|
4196
|
-
console.error("[SardinAI] Error creating provider:",
|
|
4197
|
+
} catch (f) {
|
|
4198
|
+
console.error("[SardinAI] Error creating provider:", f), k(`Configuration error: ${f.message}`);
|
|
4197
4199
|
}
|
|
4198
4200
|
return;
|
|
4199
4201
|
}
|
|
4200
4202
|
try {
|
|
4201
|
-
|
|
4202
|
-
const
|
|
4203
|
-
|
|
4204
|
-
var
|
|
4205
|
-
console.error("[Sumsub] Initialization error:",
|
|
4206
|
-
}),
|
|
4203
|
+
k(null);
|
|
4204
|
+
const f = be.parseProviderConfig(c, d, i), z = be.createProvider(c, f);
|
|
4205
|
+
I === le.Sumsub ? (z.initialize("identity-container").catch((W) => {
|
|
4206
|
+
var X;
|
|
4207
|
+
console.error("[Sumsub] Initialization error:", W), k(`Failed to initialize: ${W.message}`), (X = W.message) != null && X.toLowerCase().includes("expired") && D(!0);
|
|
4208
|
+
}), z.onComplete && z.onComplete(() => {
|
|
4207
4209
|
e == null || e();
|
|
4208
|
-
})) :
|
|
4209
|
-
console.error("[Onfido] Initialization error:",
|
|
4210
|
-
}), h(
|
|
4211
|
-
} catch (
|
|
4212
|
-
console.error("[Identity] Provider setup error:",
|
|
4210
|
+
})) : I === le.Onfido && z.initialize("identity-container").catch((W) => {
|
|
4211
|
+
console.error("[Onfido] Initialization error:", W), k(`Failed to initialize: ${W.message}`);
|
|
4212
|
+
}), h(z);
|
|
4213
|
+
} catch (f) {
|
|
4214
|
+
console.error("[Identity] Provider setup error:", f), k(`Setup error: ${f.message}`);
|
|
4213
4215
|
}
|
|
4214
4216
|
}
|
|
4215
4217
|
return () => {
|
|
4216
|
-
if (
|
|
4218
|
+
if (w && w.destroy)
|
|
4217
4219
|
try {
|
|
4218
|
-
|
|
4219
|
-
} catch (
|
|
4220
|
-
console.error("[Identity] Error destroying provider:",
|
|
4220
|
+
w.destroy();
|
|
4221
|
+
} catch (I) {
|
|
4222
|
+
console.error("[Identity] Error destroying provider:", I);
|
|
4221
4223
|
}
|
|
4222
4224
|
};
|
|
4223
|
-
}, [c, d,
|
|
4224
|
-
const
|
|
4225
|
+
}, [c, d, w, B, e, T]);
|
|
4226
|
+
const R = async () => {
|
|
4225
4227
|
try {
|
|
4226
|
-
|
|
4227
|
-
} catch (
|
|
4228
|
-
console.error("Error starting identity verification:",
|
|
4228
|
+
k(null), D(!1), await v(), L(!0);
|
|
4229
|
+
} catch (I) {
|
|
4230
|
+
console.error("Error starting identity verification:", I);
|
|
4229
4231
|
}
|
|
4230
|
-
},
|
|
4232
|
+
}, E = async () => {
|
|
4231
4233
|
try {
|
|
4232
|
-
|
|
4233
|
-
} catch (
|
|
4234
|
-
console.error("Error restarting identity verification:",
|
|
4234
|
+
k(null), D(!1), h(null), console.log("[Identity] Restarting verification..."), await g(), L(!0);
|
|
4235
|
+
} catch (I) {
|
|
4236
|
+
console.error("Error restarting identity verification:", I), k(I.message || "Failed to restart verification");
|
|
4235
4237
|
}
|
|
4236
4238
|
};
|
|
4237
|
-
if (
|
|
4238
|
-
return /* @__PURE__ */ n(
|
|
4239
|
+
if (C || u)
|
|
4240
|
+
return /* @__PURE__ */ n(M, { children: /* @__PURE__ */ o(O, { children: [
|
|
4239
4241
|
/* @__PURE__ */ n(de, { className: "my-8" }),
|
|
4240
4242
|
/* @__PURE__ */ n("p", { className: "text-center text-gray-600 dark:text-gray-400 mt-4", children: "Loading identity verification..." })
|
|
4241
4243
|
] }) });
|
|
4242
4244
|
if (y)
|
|
4243
|
-
return /* @__PURE__ */ n(
|
|
4245
|
+
return /* @__PURE__ */ n(M, { children: /* @__PURE__ */ n(O, { children: /* @__PURE__ */ o("p", { className: "text-danger-500", children: [
|
|
4244
4246
|
"Error: ",
|
|
4245
4247
|
y.message
|
|
4246
4248
|
] }) }) });
|
|
4247
|
-
if (
|
|
4248
|
-
return /* @__PURE__ */ o(
|
|
4249
|
-
/* @__PURE__ */ n(
|
|
4250
|
-
/* @__PURE__ */ o(
|
|
4249
|
+
if (B && (F || T))
|
|
4250
|
+
return /* @__PURE__ */ o(M, { children: [
|
|
4251
|
+
/* @__PURE__ */ n(ne, { children: /* @__PURE__ */ n("h2", { className: "text-2xl font-bold text-gray-900 dark:text-white", children: "Verification Session Issue" }) }),
|
|
4252
|
+
/* @__PURE__ */ o(O, { children: [
|
|
4251
4253
|
/* @__PURE__ */ n("div", { className: "p-4 bg-red-50 dark:bg-red-900/20 border border-red-200 dark:border-red-800 rounded-lg mb-6", children: /* @__PURE__ */ o("div", { className: "flex items-start", children: [
|
|
4252
4254
|
/* @__PURE__ */ n(
|
|
4253
4255
|
"svg",
|
|
@@ -4268,8 +4270,8 @@ Failed to reload test data. Please refresh the page.`);
|
|
|
4268
4270
|
}
|
|
4269
4271
|
),
|
|
4270
4272
|
/* @__PURE__ */ o("div", { children: [
|
|
4271
|
-
/* @__PURE__ */ n("h3", { className: "font-semibold text-red-900 dark:text-red-100 mb-1", children:
|
|
4272
|
-
/* @__PURE__ */ n("p", { className: "text-red-800 dark:text-red-200 text-sm", children:
|
|
4273
|
+
/* @__PURE__ */ n("h3", { className: "font-semibold text-red-900 dark:text-red-100 mb-1", children: T ? "Session Expired" : "Verification Error" }),
|
|
4274
|
+
/* @__PURE__ */ n("p", { className: "text-red-800 dark:text-red-200 text-sm", children: F || "Your verification session has expired and needs to be restarted." })
|
|
4273
4275
|
] })
|
|
4274
4276
|
] }) }),
|
|
4275
4277
|
/* @__PURE__ */ o("div", { className: "bg-blue-50 dark:bg-blue-900/20 border border-blue-200 dark:border-blue-800 rounded-lg p-4", children: [
|
|
@@ -4281,15 +4283,15 @@ Failed to reload test data. Please refresh the page.`);
|
|
|
4281
4283
|
] })
|
|
4282
4284
|
] })
|
|
4283
4285
|
] }),
|
|
4284
|
-
/* @__PURE__ */ o(
|
|
4286
|
+
/* @__PURE__ */ o(ie, { className: "flex justify-between", children: [
|
|
4285
4287
|
r && /* @__PURE__ */ n(j, { type: "button", variant: "outline", onClick: r, children: "Back" }),
|
|
4286
|
-
/* @__PURE__ */ n(j, { type: "button", onClick:
|
|
4288
|
+
/* @__PURE__ */ n(j, { type: "button", onClick: E, disabled: u, children: u ? "Restarting..." : "Restart Verification" })
|
|
4287
4289
|
] })
|
|
4288
4290
|
] });
|
|
4289
|
-
if (
|
|
4290
|
-
const
|
|
4291
|
-
return d != null && d.url ? /* @__PURE__ */ o(
|
|
4292
|
-
/* @__PURE__ */ n(
|
|
4291
|
+
if (B && l) {
|
|
4292
|
+
const I = c;
|
|
4293
|
+
return d != null && d.url ? /* @__PURE__ */ o(M, { children: [
|
|
4294
|
+
/* @__PURE__ */ n(ne, { children: /* @__PURE__ */ o("div", { className: "flex items-center justify-between", children: [
|
|
4293
4295
|
/* @__PURE__ */ o("div", { children: [
|
|
4294
4296
|
/* @__PURE__ */ n("h2", { className: "text-2xl font-bold", children: "Identity Verification" }),
|
|
4295
4297
|
/* @__PURE__ */ n("p", { className: "text-gray-600 dark:text-gray-400 mt-1", children: "Please complete the identity verification process" })
|
|
@@ -4300,13 +4302,13 @@ Failed to reload test data. Please refresh the page.`);
|
|
|
4300
4302
|
type: "button",
|
|
4301
4303
|
variant: "outline",
|
|
4302
4304
|
size: "sm",
|
|
4303
|
-
onClick:
|
|
4305
|
+
onClick: E,
|
|
4304
4306
|
disabled: u,
|
|
4305
4307
|
children: "Restart"
|
|
4306
4308
|
}
|
|
4307
4309
|
)
|
|
4308
4310
|
] }) }),
|
|
4309
|
-
/* @__PURE__ */ o(
|
|
4311
|
+
/* @__PURE__ */ o(O, { children: [
|
|
4310
4312
|
/* @__PURE__ */ n("div", { className: "mb-4 p-3 bg-yellow-50 dark:bg-yellow-900/20 border border-yellow-200 dark:border-yellow-800 rounded-lg", children: /* @__PURE__ */ o("p", { className: "text-yellow-800 dark:text-yellow-200 text-sm", children: [
|
|
4311
4313
|
/* @__PURE__ */ n("strong", { children: "Important:" }),
|
|
4312
4314
|
' If you see an "expired" or "invalid link" message below, click the "Restart" button above to generate a new verification session.'
|
|
@@ -4318,14 +4320,14 @@ Failed to reload test data. Please refresh the page.`);
|
|
|
4318
4320
|
className: "w-full h-full border-0 rounded-lg",
|
|
4319
4321
|
allow: "camera; microphone; geolocation",
|
|
4320
4322
|
title: "Identity Verification",
|
|
4321
|
-
onLoad: (
|
|
4322
|
-
var
|
|
4323
|
+
onLoad: (f) => {
|
|
4324
|
+
var z, W, X;
|
|
4323
4325
|
console.log("[Identity] Iframe loaded");
|
|
4324
4326
|
try {
|
|
4325
|
-
const _ =
|
|
4327
|
+
const _ = f.target, Ce = _.contentDocument || ((z = _.contentWindow) == null ? void 0 : z.document);
|
|
4326
4328
|
if (Ce) {
|
|
4327
|
-
const he = ((
|
|
4328
|
-
(he.includes("expired") || he.includes("invalid") || he.includes("error")) && (console.warn("[Identity] Iframe shows expiration message"),
|
|
4329
|
+
const he = ((X = (W = Ce.body) == null ? void 0 : W.textContent) == null ? void 0 : X.toLowerCase()) || "";
|
|
4330
|
+
(he.includes("expired") || he.includes("invalid") || he.includes("error")) && (console.warn("[Identity] Iframe shows expiration message"), D(!0), k("Your verification link has expired."));
|
|
4329
4331
|
}
|
|
4330
4332
|
} catch {
|
|
4331
4333
|
console.log("[Identity] Cannot check iframe content (CORS)");
|
|
@@ -4334,68 +4336,68 @@ Failed to reload test data. Please refresh the page.`);
|
|
|
4334
4336
|
}
|
|
4335
4337
|
) })
|
|
4336
4338
|
] }),
|
|
4337
|
-
r && /* @__PURE__ */ n(
|
|
4338
|
-
] }) :
|
|
4339
|
-
/* @__PURE__ */ o(
|
|
4339
|
+
r && /* @__PURE__ */ n(ie, { children: /* @__PURE__ */ n(j, { variant: "outline", onClick: r, children: "Back" }) })
|
|
4340
|
+
] }) : I === le.SardinAI ? /* @__PURE__ */ o(M, { children: [
|
|
4341
|
+
/* @__PURE__ */ o(ne, { children: [
|
|
4340
4342
|
/* @__PURE__ */ n("h2", { className: "text-2xl font-bold", children: "Device Risk Assessment" }),
|
|
4341
4343
|
/* @__PURE__ */ n("p", { className: "text-gray-600 dark:text-gray-400 mt-1", children: "Analyzing device security and behavioral patterns..." })
|
|
4342
4344
|
] }),
|
|
4343
|
-
/* @__PURE__ */ n(
|
|
4345
|
+
/* @__PURE__ */ n(O, { children: /* @__PURE__ */ o("div", { className: "text-center py-12", children: [
|
|
4344
4346
|
/* @__PURE__ */ n(de, { className: "mb-4" }),
|
|
4345
4347
|
/* @__PURE__ */ n("p", { className: "text-gray-600 dark:text-gray-400", children: "Please wait while we verify your device security" }),
|
|
4346
4348
|
/* @__PURE__ */ n("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" })
|
|
4347
4349
|
] }) })
|
|
4348
|
-
] }) : /* @__PURE__ */ o(
|
|
4349
|
-
/* @__PURE__ */ o(
|
|
4350
|
+
] }) : /* @__PURE__ */ o(M, { children: [
|
|
4351
|
+
/* @__PURE__ */ o(ne, { children: [
|
|
4350
4352
|
/* @__PURE__ */ n("h2", { className: "text-2xl font-bold", children: "Identity Verification" }),
|
|
4351
4353
|
/* @__PURE__ */ n("p", { className: "text-gray-600 dark:text-gray-400 mt-1", children: "Please complete the identity verification process" })
|
|
4352
4354
|
] }),
|
|
4353
|
-
/* @__PURE__ */ n(
|
|
4354
|
-
r && /* @__PURE__ */ n(
|
|
4355
|
+
/* @__PURE__ */ n(O, { children: /* @__PURE__ */ n("div", { id: "identity-container", className: "min-h-[400px]" }) }),
|
|
4356
|
+
r && /* @__PURE__ */ n(ie, { children: /* @__PURE__ */ n(j, { variant: "outline", onClick: r, children: "Back" }) })
|
|
4355
4357
|
] });
|
|
4356
4358
|
}
|
|
4357
|
-
return /* @__PURE__ */ n("form", { onSubmit:
|
|
4358
|
-
/* @__PURE__ */ o(
|
|
4359
|
+
return /* @__PURE__ */ n("form", { onSubmit: K.handleSubmit(R), children: /* @__PURE__ */ o(M, { children: [
|
|
4360
|
+
/* @__PURE__ */ o(ne, { children: [
|
|
4359
4361
|
/* @__PURE__ */ n("h2", { className: "text-2xl font-bold", children: "Review Your Information" }),
|
|
4360
4362
|
/* @__PURE__ */ n("p", { className: "text-gray-600 dark:text-gray-400 mt-1", children: "Please review and confirm your information before starting identity verification" })
|
|
4361
4363
|
] }),
|
|
4362
|
-
/* @__PURE__ */ o(
|
|
4364
|
+
/* @__PURE__ */ o(O, { className: "space-y-6", children: [
|
|
4363
4365
|
/* @__PURE__ */ o("div", { className: "space-y-4 pb-4 border-b border-gray-200 dark:border-gray-700", children: [
|
|
4364
4366
|
/* @__PURE__ */ o("div", { children: [
|
|
4365
4367
|
/* @__PURE__ */ n("label", { className: "block text-sm font-medium text-gray-500 dark:text-gray-400", children: "Name" }),
|
|
4366
4368
|
/* @__PURE__ */ o("p", { className: "mt-1 text-base", children: [
|
|
4367
|
-
(
|
|
4369
|
+
(H = x == null ? void 0 : x.applicantRequestData) == null ? void 0 : H.firstName,
|
|
4368
4370
|
" ",
|
|
4369
|
-
(
|
|
4371
|
+
(b = x == null ? void 0 : x.applicantRequestData) == null ? void 0 : b.lastName
|
|
4370
4372
|
] })
|
|
4371
4373
|
] }),
|
|
4372
4374
|
/* @__PURE__ */ o("div", { children: [
|
|
4373
4375
|
/* @__PURE__ */ n("label", { className: "block text-sm font-medium text-gray-500 dark:text-gray-400", children: "Email" }),
|
|
4374
|
-
/* @__PURE__ */ n("p", { className: "mt-1 text-base", children: (
|
|
4376
|
+
/* @__PURE__ */ n("p", { className: "mt-1 text-base", children: (P = x == null ? void 0 : x.applicantRequestData) == null ? void 0 : P.email })
|
|
4375
4377
|
] }),
|
|
4376
4378
|
/* @__PURE__ */ o("div", { children: [
|
|
4377
4379
|
/* @__PURE__ */ n("label", { className: "block text-sm font-medium text-gray-500 dark:text-gray-400", children: "Date of Birth" }),
|
|
4378
|
-
/* @__PURE__ */ n("p", { className: "mt-1 text-base", children: ((
|
|
4380
|
+
/* @__PURE__ */ n("p", { className: "mt-1 text-base", children: ((q = x == null ? void 0 : x.applicantRequestData) == null ? void 0 : q.dateOfBirth) || "Not provided" })
|
|
4379
4381
|
] })
|
|
4380
4382
|
] }),
|
|
4381
4383
|
/* @__PURE__ */ o("div", { className: "space-y-4", children: [
|
|
4382
4384
|
/* @__PURE__ */ n("h3", { className: "text-lg font-semibold", children: "Address Information" }),
|
|
4383
4385
|
/* @__PURE__ */ o("div", { className: "grid grid-cols-1 md:grid-cols-2 gap-4", children: [
|
|
4384
4386
|
/* @__PURE__ */ n(
|
|
4385
|
-
|
|
4387
|
+
te,
|
|
4386
4388
|
{
|
|
4387
|
-
control:
|
|
4389
|
+
control: K.control,
|
|
4388
4390
|
name: "country",
|
|
4389
|
-
render: ({ field:
|
|
4391
|
+
render: ({ field: I }) => /* @__PURE__ */ n(
|
|
4390
4392
|
ge,
|
|
4391
4393
|
{
|
|
4392
|
-
...
|
|
4394
|
+
...I,
|
|
4393
4395
|
label: "Country",
|
|
4394
4396
|
options: [
|
|
4395
4397
|
{ value: "", label: "Select country..." },
|
|
4396
|
-
...m.map((
|
|
4397
|
-
value:
|
|
4398
|
-
label:
|
|
4398
|
+
...m.map((f) => ({
|
|
4399
|
+
value: f.abbreviation3 || f.abbreviation,
|
|
4400
|
+
label: f.name
|
|
4399
4401
|
}))
|
|
4400
4402
|
]
|
|
4401
4403
|
}
|
|
@@ -4403,20 +4405,20 @@ Failed to reload test data. Please refresh the page.`);
|
|
|
4403
4405
|
}
|
|
4404
4406
|
),
|
|
4405
4407
|
/* @__PURE__ */ n(
|
|
4406
|
-
|
|
4408
|
+
te,
|
|
4407
4409
|
{
|
|
4408
|
-
control:
|
|
4410
|
+
control: K.control,
|
|
4409
4411
|
name: "nationality",
|
|
4410
|
-
render: ({ field:
|
|
4412
|
+
render: ({ field: I }) => /* @__PURE__ */ n(
|
|
4411
4413
|
ge,
|
|
4412
4414
|
{
|
|
4413
|
-
...
|
|
4415
|
+
...I,
|
|
4414
4416
|
label: "Nationality",
|
|
4415
4417
|
options: [
|
|
4416
4418
|
{ value: "", label: "Select nationality..." },
|
|
4417
|
-
...m.map((
|
|
4418
|
-
value:
|
|
4419
|
-
label:
|
|
4419
|
+
...m.map((f) => ({
|
|
4420
|
+
value: f.abbreviation3 || f.abbreviation,
|
|
4421
|
+
label: f.name
|
|
4420
4422
|
}))
|
|
4421
4423
|
]
|
|
4422
4424
|
}
|
|
@@ -4426,56 +4428,56 @@ Failed to reload test data. Please refresh the page.`);
|
|
|
4426
4428
|
] }),
|
|
4427
4429
|
/* @__PURE__ */ o("div", { className: "grid grid-cols-1 md:grid-cols-2 gap-4", children: [
|
|
4428
4430
|
/* @__PURE__ */ n(
|
|
4429
|
-
|
|
4431
|
+
te,
|
|
4430
4432
|
{
|
|
4431
|
-
control:
|
|
4433
|
+
control: K.control,
|
|
4432
4434
|
name: "street",
|
|
4433
|
-
render: ({ field:
|
|
4435
|
+
render: ({ field: I }) => /* @__PURE__ */ n(se, { ...I, label: "Street" })
|
|
4434
4436
|
}
|
|
4435
4437
|
),
|
|
4436
4438
|
/* @__PURE__ */ n(
|
|
4437
|
-
|
|
4439
|
+
te,
|
|
4438
4440
|
{
|
|
4439
|
-
control:
|
|
4441
|
+
control: K.control,
|
|
4440
4442
|
name: "streetNumber",
|
|
4441
|
-
render: ({ field:
|
|
4443
|
+
render: ({ field: I }) => /* @__PURE__ */ n(se, { ...I, label: "Street Number" })
|
|
4442
4444
|
}
|
|
4443
4445
|
)
|
|
4444
4446
|
] }),
|
|
4445
4447
|
/* @__PURE__ */ o("div", { className: "grid grid-cols-1 md:grid-cols-2 gap-4", children: [
|
|
4446
4448
|
/* @__PURE__ */ n(
|
|
4447
|
-
|
|
4449
|
+
te,
|
|
4448
4450
|
{
|
|
4449
|
-
control:
|
|
4451
|
+
control: K.control,
|
|
4450
4452
|
name: "city",
|
|
4451
|
-
render: ({ field:
|
|
4453
|
+
render: ({ field: I }) => /* @__PURE__ */ n(se, { ...I, label: "City" })
|
|
4452
4454
|
}
|
|
4453
4455
|
),
|
|
4454
4456
|
/* @__PURE__ */ n(
|
|
4455
|
-
|
|
4457
|
+
te,
|
|
4456
4458
|
{
|
|
4457
|
-
control:
|
|
4459
|
+
control: K.control,
|
|
4458
4460
|
name: "zip",
|
|
4459
|
-
render: ({ field:
|
|
4461
|
+
render: ({ field: I }) => /* @__PURE__ */ n(se, { ...I, label: "ZIP/Postal Code" })
|
|
4460
4462
|
}
|
|
4461
4463
|
)
|
|
4462
4464
|
] }),
|
|
4463
4465
|
/* @__PURE__ */ n(
|
|
4464
|
-
|
|
4466
|
+
te,
|
|
4465
4467
|
{
|
|
4466
|
-
control:
|
|
4468
|
+
control: K.control,
|
|
4467
4469
|
name: "phonenumber",
|
|
4468
|
-
render: ({ field:
|
|
4470
|
+
render: ({ field: I }) => /* @__PURE__ */ n(se, { ...I, label: "Phone Number", type: "tel" })
|
|
4469
4471
|
}
|
|
4470
4472
|
)
|
|
4471
4473
|
] })
|
|
4472
4474
|
] }),
|
|
4473
|
-
/* @__PURE__ */ o(
|
|
4475
|
+
/* @__PURE__ */ o(ie, { className: "flex justify-between", children: [
|
|
4474
4476
|
r && /* @__PURE__ */ n(j, { type: "button", variant: "outline", onClick: r, children: "Back" }),
|
|
4475
4477
|
/* @__PURE__ */ n(j, { type: "submit", isLoading: u, children: "Confirm and Start Verification" })
|
|
4476
4478
|
] })
|
|
4477
4479
|
] }) });
|
|
4478
|
-
},
|
|
4480
|
+
}, je = ({
|
|
4479
4481
|
kycStatus: t,
|
|
4480
4482
|
reviewStatus: e,
|
|
4481
4483
|
workflowResult: r,
|
|
@@ -4554,8 +4556,8 @@ Failed to reload test data. Please refresh the page.`);
|
|
|
4554
4556
|
iconColor: "text-blue-600 dark:text-blue-400",
|
|
4555
4557
|
message: "Your application is being reviewed."
|
|
4556
4558
|
};
|
|
4557
|
-
return /* @__PURE__ */ o(
|
|
4558
|
-
/* @__PURE__ */ o(
|
|
4559
|
+
return /* @__PURE__ */ o(M, { children: [
|
|
4560
|
+
/* @__PURE__ */ o(O, { className: "py-12", children: [
|
|
4559
4561
|
/* @__PURE__ */ n("div", { className: "flex justify-center mb-6", children: /* @__PURE__ */ n(
|
|
4560
4562
|
"div",
|
|
4561
4563
|
{
|
|
@@ -4608,9 +4610,9 @@ Failed to reload test data. Please refresh the page.`);
|
|
|
4608
4610
|
] })
|
|
4609
4611
|
] }) })
|
|
4610
4612
|
] }),
|
|
4611
|
-
/* @__PURE__ */ o(
|
|
4613
|
+
/* @__PURE__ */ o(ie, { className: "flex justify-center gap-4", children: [
|
|
4612
4614
|
c.type === "success" && s && /* @__PURE__ */ n(j, { onClick: s, size: "lg", children: "Continue" }),
|
|
4613
|
-
c.type === "error" && /* @__PURE__ */ o(
|
|
4615
|
+
c.type === "error" && /* @__PURE__ */ o(st, { children: [
|
|
4614
4616
|
i && /* @__PURE__ */ n(j, { variant: "outline", onClick: i, children: "Contact Support" }),
|
|
4615
4617
|
s && /* @__PURE__ */ n(j, { onClick: s, children: "Try Again" })
|
|
4616
4618
|
] }),
|
|
@@ -4632,12 +4634,12 @@ Failed to reload test data. Please refresh the page.`);
|
|
|
4632
4634
|
console.warn("[Logo] Failed to load logo:", t.url), r.target.style.display = "none";
|
|
4633
4635
|
}
|
|
4634
4636
|
}
|
|
4635
|
-
) }),
|
|
4637
|
+
) }), Xe = ({
|
|
4636
4638
|
title: t,
|
|
4637
4639
|
subtitle: e,
|
|
4638
4640
|
className: r = ""
|
|
4639
4641
|
}) => {
|
|
4640
|
-
const { currentTheme: a } =
|
|
4642
|
+
const { currentTheme: a } = oe(), s = t || (a == null ? void 0 : a.title) || "", i = !!(a != null && a.logo && a.logo.visible && a.logo.url), l = !!s;
|
|
4641
4643
|
return !i && !l ? null : /* @__PURE__ */ o("div", { className: `metakyc-header ${r}`, children: [
|
|
4642
4644
|
/* @__PURE__ */ o("div", { className: "metakyc-header-title flex items-center text-xl font-bold text-gray-900 dark:text-white", children: [
|
|
4643
4645
|
i && /* @__PURE__ */ n(Rr, { config: a.logo }),
|
|
@@ -4659,29 +4661,35 @@ Failed to reload test data. Please refresh the page.`);
|
|
|
4659
4661
|
onSuccess: r,
|
|
4660
4662
|
onCancel: a
|
|
4661
4663
|
}) => {
|
|
4662
|
-
var
|
|
4663
|
-
const { config: s, baseInformationService: i, currentTheme: l } =
|
|
4664
|
-
if (!
|
|
4664
|
+
var R, E, H;
|
|
4665
|
+
const { config: s, baseInformationService: i, currentTheme: l } = oe(), { createApplicant: c, isLoading: d } = nr(), [u, y] = S([]), [v, g] = S(!0), [w, h] = S(!1), [x, p] = S(null), m = Y(!1), A = Y(!1), C = t || ((R = s.applicantForm) == null ? void 0 : R.workflowKey);
|
|
4666
|
+
if (!C)
|
|
4665
4667
|
throw new Error(
|
|
4666
4668
|
"workflowKey is required. Provide it either as a prop to CreateApplicantForm or set it in config.applicantForm.workflowKey"
|
|
4667
4669
|
);
|
|
4668
|
-
const
|
|
4669
|
-
|
|
4670
|
-
|
|
4671
|
-
|
|
4672
|
-
|
|
4673
|
-
|
|
4674
|
-
|
|
4675
|
-
|
|
4676
|
-
|
|
4677
|
-
|
|
4670
|
+
const N = e || ((E = s.applicantForm) == null ? void 0 : E.externalRefId) || "", B = ["firstName", "lastName", "email", "phonenumber", "dateOfBirth"], L = re.useMemo(() => {
|
|
4671
|
+
const b = new Set(B), P = l == null ? void 0 : l.applicantFormRequiredFields;
|
|
4672
|
+
if (P && P.length > 0)
|
|
4673
|
+
for (const q of P)
|
|
4674
|
+
b.add(q);
|
|
4675
|
+
return Array.from(b);
|
|
4676
|
+
}, [l == null ? void 0 : l.applicantFormRequiredFields]), F = re.useMemo(() => {
|
|
4677
|
+
var q;
|
|
4678
|
+
let b;
|
|
4679
|
+
(q = s.applicantForm) != null && q.visibleFields ? b = s.applicantForm.visibleFields : l != null && l.applicantFormVisibleFields && l.applicantFormVisibleFields.length > 0 ? b = l.applicantFormVisibleFields : b = ft;
|
|
4680
|
+
const P = new Set(b);
|
|
4681
|
+
for (const I of B)
|
|
4682
|
+
P.add(I);
|
|
4683
|
+
return Array.from(P);
|
|
4684
|
+
}, [(H = s.applicantForm) == null ? void 0 : H.visibleFields, l == null ? void 0 : l.applicantFormVisibleFields]), [k, T] = S({
|
|
4685
|
+
workflowKey: C,
|
|
4678
4686
|
firstName: "",
|
|
4679
4687
|
lastName: "",
|
|
4680
4688
|
title: "",
|
|
4681
4689
|
email: "",
|
|
4682
4690
|
dateOfBirth: "",
|
|
4683
4691
|
phonenumber: "",
|
|
4684
|
-
externalRefId:
|
|
4692
|
+
externalRefId: N,
|
|
4685
4693
|
// Set from config or prop
|
|
4686
4694
|
mobileCountryCode: "",
|
|
4687
4695
|
street: "",
|
|
@@ -4700,7 +4708,7 @@ Failed to reload test data. Please refresh the page.`);
|
|
|
4700
4708
|
occupation: "",
|
|
4701
4709
|
taxNumber: ""
|
|
4702
4710
|
});
|
|
4703
|
-
|
|
4711
|
+
Q(() => {
|
|
4704
4712
|
(async () => {
|
|
4705
4713
|
if (m.current || A.current) {
|
|
4706
4714
|
console.log("[CreateApplicant] Countries already loading or loaded, skipping...");
|
|
@@ -4708,185 +4716,198 @@ Failed to reload test data. Please refresh the page.`);
|
|
|
4708
4716
|
}
|
|
4709
4717
|
m.current = !0, g(!0);
|
|
4710
4718
|
try {
|
|
4711
|
-
const
|
|
4712
|
-
value:
|
|
4713
|
-
label:
|
|
4714
|
-
})).filter((
|
|
4715
|
-
y(
|
|
4716
|
-
} catch (
|
|
4717
|
-
console.error("Failed to load countries:",
|
|
4719
|
+
const P = await i.getCountries("", s.locale || "en"), q = /* @__PURE__ */ new Set(), I = P.map((f) => ({
|
|
4720
|
+
value: f.abbreviation3 || f.abbreviation,
|
|
4721
|
+
label: f.name
|
|
4722
|
+
})).filter((f) => !f.value || q.has(f.value) ? !1 : (q.add(f.value), !0));
|
|
4723
|
+
y(I), A.current = !0;
|
|
4724
|
+
} catch (P) {
|
|
4725
|
+
console.error("Failed to load countries:", P);
|
|
4718
4726
|
} finally {
|
|
4719
4727
|
g(!1), m.current = !1;
|
|
4720
4728
|
}
|
|
4721
4729
|
})();
|
|
4722
4730
|
}, []);
|
|
4723
|
-
const D = (
|
|
4724
|
-
|
|
4725
|
-
},
|
|
4726
|
-
|
|
4731
|
+
const D = (b, P) => {
|
|
4732
|
+
T((q) => ({ ...q, [b]: P }));
|
|
4733
|
+
}, G = async (b) => {
|
|
4734
|
+
var P;
|
|
4735
|
+
b.preventDefault(), h(!0), p(null);
|
|
4727
4736
|
try {
|
|
4728
|
-
if (!
|
|
4737
|
+
if (!k.externalRefId || k.externalRefId.trim() === "") {
|
|
4729
4738
|
p("External Reference ID is required. Please pass it via config.applicantForm.externalRefId."), h(!1);
|
|
4730
4739
|
return;
|
|
4731
4740
|
}
|
|
4732
|
-
|
|
4733
|
-
|
|
4734
|
-
|
|
4741
|
+
for (const f of L) {
|
|
4742
|
+
const z = k[f];
|
|
4743
|
+
if (z == null || z === "" || Array.isArray(z) && z.length === 0) {
|
|
4744
|
+
const X = ((P = Be[f]) == null ? void 0 : P.label) || f;
|
|
4745
|
+
p(`${X} is required.`), h(!1);
|
|
4746
|
+
return;
|
|
4747
|
+
}
|
|
4735
4748
|
}
|
|
4736
|
-
const
|
|
4737
|
-
workflowKey:
|
|
4738
|
-
externalRefId:
|
|
4749
|
+
const q = {
|
|
4750
|
+
workflowKey: k.workflowKey,
|
|
4751
|
+
externalRefId: k.externalRefId.trim()
|
|
4739
4752
|
// Always include, never empty
|
|
4740
4753
|
};
|
|
4741
|
-
|
|
4742
|
-
if (
|
|
4743
|
-
const
|
|
4744
|
-
|
|
4745
|
-
}), console.log("Creating applicant with data:",
|
|
4746
|
-
const
|
|
4747
|
-
|
|
4754
|
+
F.forEach((f) => {
|
|
4755
|
+
if (f === "externalRefId") return;
|
|
4756
|
+
const z = k[f];
|
|
4757
|
+
z != null && z !== "" && !(Array.isArray(z) && z.length === 0) && (q[f] = z);
|
|
4758
|
+
}), console.log("Creating applicant with data:", q);
|
|
4759
|
+
const I = await c(
|
|
4760
|
+
q
|
|
4748
4761
|
);
|
|
4749
|
-
console.log("Applicant created:",
|
|
4750
|
-
} catch (
|
|
4751
|
-
console.error("Error creating applicant:",
|
|
4762
|
+
console.log("Applicant created:", I), r(I.applicantId);
|
|
4763
|
+
} catch (q) {
|
|
4764
|
+
console.error("Error creating applicant:", q), p(q.message || "Failed to create applicant");
|
|
4752
4765
|
} finally {
|
|
4753
4766
|
h(!1);
|
|
4754
4767
|
}
|
|
4755
|
-
},
|
|
4756
|
-
var
|
|
4757
|
-
const
|
|
4758
|
-
switch (
|
|
4768
|
+
}, K = (b) => {
|
|
4769
|
+
var I;
|
|
4770
|
+
const P = Be[b], q = L.includes(b);
|
|
4771
|
+
switch (P.type) {
|
|
4759
4772
|
case "select":
|
|
4760
|
-
|
|
4761
|
-
|
|
4762
|
-
|
|
4763
|
-
|
|
4764
|
-
|
|
4765
|
-
|
|
4766
|
-
|
|
4767
|
-
|
|
4768
|
-
|
|
4769
|
-
|
|
4770
|
-
|
|
4771
|
-
|
|
4772
|
-
|
|
4773
|
-
|
|
4774
|
-
|
|
4775
|
-
|
|
4776
|
-
|
|
4777
|
-
|
|
4778
|
-
|
|
4779
|
-
|
|
4780
|
-
|
|
4781
|
-
|
|
4782
|
-
|
|
4783
|
-
|
|
4784
|
-
|
|
4785
|
-
|
|
4786
|
-
|
|
4787
|
-
|
|
4788
|
-
|
|
4789
|
-
|
|
4790
|
-
|
|
4791
|
-
|
|
4792
|
-
|
|
4793
|
-
|
|
4794
|
-
|
|
4795
|
-
|
|
4796
|
-
|
|
4797
|
-
|
|
4798
|
-
|
|
4799
|
-
|
|
4800
|
-
|
|
4801
|
-
|
|
4802
|
-
|
|
4773
|
+
if (b === "country" || b === "nationality" || b === "taxCountry" || b === "countryOfBirth")
|
|
4774
|
+
return /* @__PURE__ */ n(
|
|
4775
|
+
ge,
|
|
4776
|
+
{
|
|
4777
|
+
label: P.label,
|
|
4778
|
+
value: k[b] || "",
|
|
4779
|
+
onChange: (f) => D(b, f.target.value),
|
|
4780
|
+
options: [
|
|
4781
|
+
{ value: "", label: `Select ${P.label.toLowerCase()}...` },
|
|
4782
|
+
...u
|
|
4783
|
+
],
|
|
4784
|
+
disabled: v,
|
|
4785
|
+
required: q
|
|
4786
|
+
},
|
|
4787
|
+
b
|
|
4788
|
+
);
|
|
4789
|
+
if (b === "salutation")
|
|
4790
|
+
return /* @__PURE__ */ n(
|
|
4791
|
+
ge,
|
|
4792
|
+
{
|
|
4793
|
+
label: P.label,
|
|
4794
|
+
value: ((I = k[b]) == null ? void 0 : I.toString()) || "",
|
|
4795
|
+
onChange: (f) => D(b, f.target.value ? Number(f.target.value) : null),
|
|
4796
|
+
options: [
|
|
4797
|
+
{ value: "", label: "Select salutation..." },
|
|
4798
|
+
{ value: Se.Male.toString(), label: "Male" },
|
|
4799
|
+
{ value: Se.Female.toString(), label: "Female" },
|
|
4800
|
+
{ value: Se.Other.toString(), label: "Other" }
|
|
4801
|
+
],
|
|
4802
|
+
required: q
|
|
4803
|
+
},
|
|
4804
|
+
b
|
|
4805
|
+
);
|
|
4806
|
+
if (b === "defaultLanguage") {
|
|
4807
|
+
const f = l != null && l.allowedLanguages && l.allowedLanguages.length > 0 ? Oe.filter((z) => l.allowedLanguages.includes(z.value)) : Oe;
|
|
4808
|
+
return /* @__PURE__ */ n(
|
|
4809
|
+
ge,
|
|
4810
|
+
{
|
|
4811
|
+
label: P.label,
|
|
4812
|
+
value: k[b] || "",
|
|
4813
|
+
onChange: (z) => D(b, z.target.value),
|
|
4814
|
+
options: [
|
|
4815
|
+
{ value: "", label: "Select language..." },
|
|
4816
|
+
...f
|
|
4817
|
+
],
|
|
4818
|
+
required: q
|
|
4819
|
+
},
|
|
4820
|
+
b
|
|
4821
|
+
);
|
|
4822
|
+
}
|
|
4823
|
+
return null;
|
|
4803
4824
|
case "multiselect":
|
|
4804
|
-
return
|
|
4825
|
+
return b === "otherNationality" ? /* @__PURE__ */ n(
|
|
4805
4826
|
ar,
|
|
4806
4827
|
{
|
|
4807
|
-
label:
|
|
4808
|
-
value:
|
|
4809
|
-
onChange: (
|
|
4828
|
+
label: P.label,
|
|
4829
|
+
value: k[b] || [],
|
|
4830
|
+
onChange: (f) => D(b, f),
|
|
4810
4831
|
options: u,
|
|
4811
4832
|
placeholder: "Select other nationalities...",
|
|
4812
|
-
disabled:
|
|
4813
|
-
required:
|
|
4833
|
+
disabled: v,
|
|
4834
|
+
required: q
|
|
4814
4835
|
},
|
|
4815
|
-
|
|
4836
|
+
b
|
|
4816
4837
|
) : null;
|
|
4817
4838
|
case "date":
|
|
4818
4839
|
return /* @__PURE__ */ n(
|
|
4819
|
-
|
|
4840
|
+
se,
|
|
4820
4841
|
{
|
|
4821
4842
|
type: "date",
|
|
4822
|
-
label:
|
|
4823
|
-
value:
|
|
4824
|
-
onChange: (
|
|
4825
|
-
required:
|
|
4843
|
+
label: P.label,
|
|
4844
|
+
value: k[b] || "",
|
|
4845
|
+
onChange: (f) => D(b, f.target.value),
|
|
4846
|
+
required: q
|
|
4826
4847
|
},
|
|
4827
|
-
|
|
4848
|
+
b
|
|
4828
4849
|
);
|
|
4829
4850
|
case "email":
|
|
4830
4851
|
return /* @__PURE__ */ n(
|
|
4831
|
-
|
|
4852
|
+
se,
|
|
4832
4853
|
{
|
|
4833
4854
|
type: "email",
|
|
4834
|
-
label:
|
|
4835
|
-
value:
|
|
4836
|
-
onChange: (
|
|
4837
|
-
required:
|
|
4855
|
+
label: P.label,
|
|
4856
|
+
value: k[b] || "",
|
|
4857
|
+
onChange: (f) => D(b, f.target.value),
|
|
4858
|
+
required: q
|
|
4838
4859
|
},
|
|
4839
|
-
|
|
4860
|
+
b
|
|
4840
4861
|
);
|
|
4841
4862
|
case "tel":
|
|
4842
4863
|
return /* @__PURE__ */ n(
|
|
4843
|
-
|
|
4864
|
+
se,
|
|
4844
4865
|
{
|
|
4845
4866
|
type: "tel",
|
|
4846
|
-
label:
|
|
4847
|
-
value:
|
|
4848
|
-
onChange: (
|
|
4849
|
-
required:
|
|
4867
|
+
label: P.label,
|
|
4868
|
+
value: k[b] || "",
|
|
4869
|
+
onChange: (f) => D(b, f.target.value),
|
|
4870
|
+
required: q
|
|
4850
4871
|
},
|
|
4851
|
-
|
|
4872
|
+
b
|
|
4852
4873
|
);
|
|
4853
4874
|
case "text":
|
|
4854
4875
|
default:
|
|
4855
4876
|
return /* @__PURE__ */ n(
|
|
4856
|
-
|
|
4877
|
+
se,
|
|
4857
4878
|
{
|
|
4858
4879
|
type: "text",
|
|
4859
|
-
label:
|
|
4860
|
-
value:
|
|
4861
|
-
onChange: (
|
|
4862
|
-
required:
|
|
4880
|
+
label: P.label,
|
|
4881
|
+
value: k[b] || "",
|
|
4882
|
+
onChange: (f) => D(b, f.target.value),
|
|
4883
|
+
required: q
|
|
4863
4884
|
},
|
|
4864
|
-
|
|
4885
|
+
b
|
|
4865
4886
|
);
|
|
4866
4887
|
}
|
|
4867
4888
|
};
|
|
4868
|
-
return
|
|
4889
|
+
return v ? /* @__PURE__ */ n("div", { className: "metakyc-sdk", children: /* @__PURE__ */ n(M, { children: /* @__PURE__ */ o(O, { children: [
|
|
4869
4890
|
/* @__PURE__ */ n(de, { className: "my-8" }),
|
|
4870
4891
|
/* @__PURE__ */ n("p", { className: "text-center text-gray-600 dark:text-gray-400 mt-4", children: "Loading form..." })
|
|
4871
|
-
] }) }) }) : /* @__PURE__ */ n("div", { className: "metakyc-sdk", children: /* @__PURE__ */ n("form", { onSubmit:
|
|
4872
|
-
/* @__PURE__ */ n(
|
|
4873
|
-
|
|
4892
|
+
] }) }) }) : /* @__PURE__ */ n("div", { className: "metakyc-sdk", children: /* @__PURE__ */ n("form", { onSubmit: G, children: /* @__PURE__ */ o(M, { children: [
|
|
4893
|
+
/* @__PURE__ */ n(ne, { children: /* @__PURE__ */ n(
|
|
4894
|
+
Xe,
|
|
4874
4895
|
{
|
|
4875
4896
|
title: "Create Applicant",
|
|
4876
4897
|
subtitle: "Please fill in the required information to begin the KYC verification process."
|
|
4877
4898
|
}
|
|
4878
4899
|
) }),
|
|
4879
|
-
/* @__PURE__ */ o(
|
|
4880
|
-
|
|
4900
|
+
/* @__PURE__ */ o(O, { children: [
|
|
4901
|
+
x && /* @__PURE__ */ n("div", { className: "mb-6 p-4 bg-red-50 dark:bg-red-900/20 border border-red-200 dark:border-red-800 rounded-lg", children: /* @__PURE__ */ o("p", { className: "text-red-600 dark:text-red-400 text-sm", children: [
|
|
4881
4902
|
/* @__PURE__ */ n("strong", { children: "Error:" }),
|
|
4882
4903
|
" ",
|
|
4883
|
-
|
|
4904
|
+
x
|
|
4884
4905
|
] }) }),
|
|
4885
|
-
/* @__PURE__ */ n("div", { className: "grid grid-cols-1 md:grid-cols-2 gap-4", children:
|
|
4906
|
+
/* @__PURE__ */ n("div", { className: "grid grid-cols-1 md:grid-cols-2 gap-4", children: F.map((b) => K(b)) })
|
|
4886
4907
|
] }),
|
|
4887
|
-
/* @__PURE__ */ o(
|
|
4888
|
-
a && /* @__PURE__ */ n(j, { type: "button", variant: "outline", onClick: a, disabled:
|
|
4889
|
-
/* @__PURE__ */ n(j, { type: "submit", isLoading:
|
|
4908
|
+
/* @__PURE__ */ o(ie, { className: "flex justify-between", children: [
|
|
4909
|
+
a && /* @__PURE__ */ n(j, { type: "button", variant: "outline", onClick: a, disabled: w || d, children: "Cancel" }),
|
|
4910
|
+
/* @__PURE__ */ n(j, { type: "submit", isLoading: w || d, children: "Create Applicant" })
|
|
4890
4911
|
] })
|
|
4891
4912
|
] }) }) });
|
|
4892
4913
|
}, Gr = ({
|
|
@@ -4903,31 +4924,31 @@ Failed to reload test data. Please refresh the page.`);
|
|
|
4903
4924
|
workflowKey: d,
|
|
4904
4925
|
nextWorkflowKey: u,
|
|
4905
4926
|
hasWorkflowChanged: y,
|
|
4906
|
-
isLoading:
|
|
4927
|
+
isLoading: v,
|
|
4907
4928
|
error: g,
|
|
4908
|
-
moveBack:
|
|
4929
|
+
moveBack: w,
|
|
4909
4930
|
refreshProgress: h
|
|
4910
|
-
} = Zt(t), [
|
|
4911
|
-
if (
|
|
4931
|
+
} = Zt(t), [x, p] = re.useState(!1);
|
|
4932
|
+
if (re.useEffect(() => {
|
|
4912
4933
|
g && r && r(g);
|
|
4913
|
-
}, [g, r]),
|
|
4934
|
+
}, [g, r]), re.useEffect(() => {
|
|
4914
4935
|
i != null && i.workflowResult && e && e(i.workflowResult);
|
|
4915
|
-
}, [i == null ? void 0 : i.workflowResult, e]),
|
|
4936
|
+
}, [i == null ? void 0 : i.workflowResult, e]), re.useEffect(() => {
|
|
4916
4937
|
a === "dark" ? document.documentElement.classList.add("dark") : document.documentElement.classList.remove("dark");
|
|
4917
|
-
}, [a]),
|
|
4938
|
+
}, [a]), re.useEffect(() => {
|
|
4918
4939
|
y && p(!1);
|
|
4919
|
-
}, [y]),
|
|
4920
|
-
return /* @__PURE__ */ n("div", { className: s, children: /* @__PURE__ */ n(
|
|
4940
|
+
}, [y]), v || !i)
|
|
4941
|
+
return /* @__PURE__ */ n("div", { className: s, children: /* @__PURE__ */ n(M, { children: /* @__PURE__ */ o(O, { children: [
|
|
4921
4942
|
/* @__PURE__ */ n(de, { className: "my-8" }),
|
|
4922
4943
|
/* @__PURE__ */ n("p", { className: "text-center text-gray-600 dark:text-gray-400 mt-4", children: "Loading workflow..." })
|
|
4923
4944
|
] }) }) });
|
|
4924
4945
|
if (g)
|
|
4925
|
-
return /* @__PURE__ */ n("div", { className: s, children: /* @__PURE__ */ n(
|
|
4946
|
+
return /* @__PURE__ */ n("div", { className: s, children: /* @__PURE__ */ n(M, { children: /* @__PURE__ */ n(O, { children: /* @__PURE__ */ o("div", { className: "text-center py-8", children: [
|
|
4926
4947
|
/* @__PURE__ */ n("p", { className: "text-danger-500 text-lg mb-4", children: "An error occurred" }),
|
|
4927
4948
|
/* @__PURE__ */ n("p", { className: "text-gray-600 dark:text-gray-400", children: g.message })
|
|
4928
4949
|
] }) }) }) });
|
|
4929
|
-
if (y && !
|
|
4930
|
-
return /* @__PURE__ */ n("div", { className: `metakyc-sdk ${s || ""}`, children: /* @__PURE__ */ n(
|
|
4950
|
+
if (y && !x)
|
|
4951
|
+
return /* @__PURE__ */ n("div", { className: `metakyc-sdk ${s || ""}`, children: /* @__PURE__ */ n(M, { children: /* @__PURE__ */ n(O, { children: /* @__PURE__ */ o("div", { className: "text-center py-8", children: [
|
|
4931
4952
|
/* @__PURE__ */ n("div", { className: "mb-6", children: /* @__PURE__ */ n("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__ */ n("svg", { className: "w-8 h-8 text-blue-600 dark:text-blue-400", fill: "none", stroke: "currentColor", viewBox: "0 0 24 24", children: /* @__PURE__ */ n("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" }) }) }) }),
|
|
4932
4953
|
/* @__PURE__ */ n("h3", { className: "text-xl font-semibold text-gray-900 dark:text-white mb-2", children: "Workflow Transition" }),
|
|
4933
4954
|
/* @__PURE__ */ n("p", { className: "text-gray-600 dark:text-gray-400 mb-6", children: "Your application workflow has been updated based on your progress." }),
|
|
@@ -4956,7 +4977,7 @@ Failed to reload test data. Please refresh the page.`);
|
|
|
4956
4977
|
] }) }) }) });
|
|
4957
4978
|
if (i.status === ce.Finished || i.status === ce.OnHold)
|
|
4958
4979
|
return /* @__PURE__ */ n("div", { className: `metakyc-sdk ${s || ""}`, children: /* @__PURE__ */ n(
|
|
4959
|
-
|
|
4980
|
+
je,
|
|
4960
4981
|
{
|
|
4961
4982
|
kycStatus: i.kycStatus,
|
|
4962
4983
|
reviewStatus: i.reviewStatus,
|
|
@@ -4969,103 +4990,103 @@ Failed to reload test data. Please refresh the page.`);
|
|
|
4969
4990
|
}
|
|
4970
4991
|
) });
|
|
4971
4992
|
if (!l)
|
|
4972
|
-
return /* @__PURE__ */ n("div", { className: `metakyc-sdk ${s || ""}`, children: /* @__PURE__ */ n(
|
|
4993
|
+
return /* @__PURE__ */ n("div", { className: `metakyc-sdk ${s || ""}`, children: /* @__PURE__ */ n(M, { children: /* @__PURE__ */ o(O, { children: [
|
|
4973
4994
|
/* @__PURE__ */ n(de, { className: "my-8" }),
|
|
4974
4995
|
/* @__PURE__ */ n("p", { className: "text-center text-gray-600 dark:text-gray-400 mt-4", children: i.status === ce.IdentityPending ? "Loading identity verification..." : "Loading current step..." })
|
|
4975
4996
|
] }) }) });
|
|
4976
|
-
const m = (
|
|
4977
|
-
switch (
|
|
4978
|
-
case
|
|
4997
|
+
const m = (N) => {
|
|
4998
|
+
switch (N) {
|
|
4999
|
+
case $.Overview:
|
|
4979
5000
|
return "Overview";
|
|
4980
|
-
case
|
|
5001
|
+
case $.Questionaries:
|
|
4981
5002
|
return "Questionnaire";
|
|
4982
|
-
case
|
|
5003
|
+
case $.UploadDocument:
|
|
4983
5004
|
return "Documents";
|
|
4984
|
-
case
|
|
5005
|
+
case $.IdentitySdk:
|
|
4985
5006
|
return "Identity";
|
|
4986
|
-
case
|
|
5007
|
+
case $.RiskScoring:
|
|
4987
5008
|
return "Risk Assessment";
|
|
4988
|
-
case
|
|
5009
|
+
case $.InvestorCategorization:
|
|
4989
5010
|
return "Investor Categorization";
|
|
4990
|
-
case
|
|
5011
|
+
case $.AppropriatenessTest:
|
|
4991
5012
|
return "Appropriateness Test";
|
|
4992
|
-
case
|
|
5013
|
+
case $.AdditionalData:
|
|
4993
5014
|
return "Additional Data";
|
|
4994
|
-
case
|
|
5015
|
+
case $.ManualReview:
|
|
4995
5016
|
return "Review";
|
|
4996
5017
|
default:
|
|
4997
5018
|
return "";
|
|
4998
5019
|
}
|
|
4999
5020
|
}, A = () => {
|
|
5000
|
-
const
|
|
5021
|
+
const N = c.filter((k) => k.visibility !== !1), B = N.findIndex((k) => k.order === l.order), L = B >= 0 ? B + 1 : 1, F = N.length;
|
|
5001
5022
|
return /* @__PURE__ */ o("div", { className: "mb-6", children: [
|
|
5002
5023
|
/* @__PURE__ */ o("div", { className: "flex items-start justify-between mb-4", children: [
|
|
5003
|
-
/* @__PURE__ */ n(
|
|
5024
|
+
/* @__PURE__ */ n(Xe, {}),
|
|
5004
5025
|
/* @__PURE__ */ o(pe, { variant: i.status === 1 ? "info" : "success", children: [
|
|
5005
5026
|
"Step ",
|
|
5006
5027
|
L,
|
|
5007
5028
|
" of ",
|
|
5008
|
-
|
|
5029
|
+
F
|
|
5009
5030
|
] })
|
|
5010
5031
|
] }),
|
|
5011
|
-
/* @__PURE__ */ n("div", { className: "flex items-center", children:
|
|
5012
|
-
const
|
|
5013
|
-
return /* @__PURE__ */ o(
|
|
5032
|
+
/* @__PURE__ */ n("div", { className: "flex items-center", children: N.map((k, T) => {
|
|
5033
|
+
const D = T < B, G = k.order === l.order;
|
|
5034
|
+
return /* @__PURE__ */ o(re.Fragment, { children: [
|
|
5014
5035
|
/* @__PURE__ */ o("div", { className: "flex items-center", children: [
|
|
5015
5036
|
/* @__PURE__ */ n(
|
|
5016
5037
|
"div",
|
|
5017
5038
|
{
|
|
5018
5039
|
className: `
|
|
5019
5040
|
w-8 h-8 rounded-full flex items-center justify-center text-sm font-medium
|
|
5020
|
-
${
|
|
5041
|
+
${D || G ? "bg-primary-500 text-white" : "bg-gray-200 text-gray-600 dark:bg-gray-700 dark:text-gray-400"}
|
|
5021
5042
|
`,
|
|
5022
|
-
children:
|
|
5043
|
+
children: T + 1
|
|
5023
5044
|
}
|
|
5024
5045
|
),
|
|
5025
5046
|
/* @__PURE__ */ n(
|
|
5026
5047
|
"span",
|
|
5027
5048
|
{
|
|
5028
|
-
className: `ml-2 text-sm ${
|
|
5029
|
-
children:
|
|
5049
|
+
className: `ml-2 text-sm ${G ? "font-semibold text-gray-900 dark:text-white" : "text-gray-600 dark:text-gray-400"}`,
|
|
5050
|
+
children: k.displayName || k.name || m(k.action) || `Step ${T + 1}`
|
|
5030
5051
|
}
|
|
5031
5052
|
)
|
|
5032
5053
|
] }),
|
|
5033
|
-
|
|
5054
|
+
T < N.length - 1 && /* @__PURE__ */ n(
|
|
5034
5055
|
"div",
|
|
5035
5056
|
{
|
|
5036
|
-
className: `flex-1 h-0.5 mx-4 ${
|
|
5057
|
+
className: `flex-1 h-0.5 mx-4 ${D ? "bg-primary-500" : "bg-gray-200 dark:bg-gray-700"}`
|
|
5037
5058
|
}
|
|
5038
5059
|
)
|
|
5039
|
-
] },
|
|
5060
|
+
] }, k.order);
|
|
5040
5061
|
}) })
|
|
5041
5062
|
] });
|
|
5042
|
-
},
|
|
5043
|
-
const
|
|
5063
|
+
}, C = () => {
|
|
5064
|
+
const N = {
|
|
5044
5065
|
applicantId: t,
|
|
5045
5066
|
onComplete: async () => {
|
|
5046
5067
|
await h();
|
|
5047
5068
|
},
|
|
5048
|
-
onBack: l.order > 0 ?
|
|
5069
|
+
onBack: l.order > 0 ? w : void 0
|
|
5049
5070
|
};
|
|
5050
5071
|
switch (l.action) {
|
|
5051
|
-
case
|
|
5052
|
-
return /* @__PURE__ */ n(kr, { ...
|
|
5053
|
-
case
|
|
5054
|
-
return /* @__PURE__ */ n(Nr, { ...
|
|
5055
|
-
case
|
|
5056
|
-
return /* @__PURE__ */ n(Sr, { ...
|
|
5057
|
-
case
|
|
5058
|
-
return /* @__PURE__ */ n(Ir, { ...
|
|
5059
|
-
case
|
|
5060
|
-
return /* @__PURE__ */ n(Cr, { ...
|
|
5061
|
-
case
|
|
5062
|
-
case
|
|
5063
|
-
return /* @__PURE__ */ n(Ar, { ...
|
|
5064
|
-
case
|
|
5065
|
-
return /* @__PURE__ */ n(Er, { ...
|
|
5066
|
-
case
|
|
5072
|
+
case $.Questionaries:
|
|
5073
|
+
return /* @__PURE__ */ n(kr, { ...N });
|
|
5074
|
+
case $.UploadDocument:
|
|
5075
|
+
return /* @__PURE__ */ n(Nr, { ...N });
|
|
5076
|
+
case $.Overview:
|
|
5077
|
+
return /* @__PURE__ */ n(Sr, { ...N });
|
|
5078
|
+
case $.IdentitySdk:
|
|
5079
|
+
return /* @__PURE__ */ n(Ir, { ...N });
|
|
5080
|
+
case $.RiskScoring:
|
|
5081
|
+
return /* @__PURE__ */ n(Cr, { ...N });
|
|
5082
|
+
case $.AdditionalData:
|
|
5083
|
+
case $.InvestorCategorization:
|
|
5084
|
+
return /* @__PURE__ */ n(Ar, { ...N });
|
|
5085
|
+
case $.AppropriatenessTest:
|
|
5086
|
+
return /* @__PURE__ */ n(Er, { ...N });
|
|
5087
|
+
case $.ManualReview:
|
|
5067
5088
|
return /* @__PURE__ */ n(
|
|
5068
|
-
|
|
5089
|
+
je,
|
|
5069
5090
|
{
|
|
5070
5091
|
kycStatus: i.kycStatus,
|
|
5071
5092
|
reviewStatus: i.reviewStatus,
|
|
@@ -5074,7 +5095,7 @@ Failed to reload test data. Please refresh the page.`);
|
|
|
5074
5095
|
}
|
|
5075
5096
|
);
|
|
5076
5097
|
default:
|
|
5077
|
-
return /* @__PURE__ */ n(
|
|
5098
|
+
return /* @__PURE__ */ n(M, { children: /* @__PURE__ */ o(O, { className: "py-12 text-center", children: [
|
|
5078
5099
|
/* @__PURE__ */ n("div", { className: "mb-4", children: /* @__PURE__ */ n(de, {}) }),
|
|
5079
5100
|
/* @__PURE__ */ o("p", { className: "text-gray-600 dark:text-gray-400 mb-2", children: [
|
|
5080
5101
|
"Processing step: ",
|
|
@@ -5082,113 +5103,113 @@ Failed to reload test data. Please refresh the page.`);
|
|
|
5082
5103
|
] }),
|
|
5083
5104
|
/* @__PURE__ */ o("p", { className: "text-sm text-gray-500 dark:text-gray-400", children: [
|
|
5084
5105
|
"Action type: ",
|
|
5085
|
-
|
|
5106
|
+
$[l.action]
|
|
5086
5107
|
] })
|
|
5087
5108
|
] }) });
|
|
5088
5109
|
}
|
|
5089
5110
|
};
|
|
5090
5111
|
return /* @__PURE__ */ o("div", { className: `metakyc-sdk ${s || ""}`, children: [
|
|
5091
5112
|
A(),
|
|
5092
|
-
|
|
5113
|
+
C()
|
|
5093
5114
|
] });
|
|
5094
5115
|
};
|
|
5095
5116
|
export {
|
|
5096
|
-
|
|
5117
|
+
Oe as ALLOWED_LANGUAGES,
|
|
5097
5118
|
Or as ALL_APPLICANT_FIELDS,
|
|
5098
|
-
|
|
5119
|
+
it as ApplicantProgressOnHoldReason,
|
|
5099
5120
|
ce as ApplicantProgressStatus,
|
|
5100
5121
|
wt as ApplicantService,
|
|
5101
|
-
|
|
5102
|
-
|
|
5122
|
+
lt as ApplicantStatus,
|
|
5123
|
+
ht as AppropriatenessQuestionType,
|
|
5103
5124
|
St as AppropriatenessTestService,
|
|
5104
5125
|
Er as AppropriatenessTestStep,
|
|
5105
5126
|
pe as Badge,
|
|
5106
5127
|
It as BaseInformationService,
|
|
5107
5128
|
j as Button,
|
|
5108
|
-
|
|
5109
|
-
|
|
5110
|
-
|
|
5111
|
-
|
|
5129
|
+
M as Card,
|
|
5130
|
+
O as CardContent,
|
|
5131
|
+
ie as CardFooter,
|
|
5132
|
+
ne as CardHeader,
|
|
5112
5133
|
Qr as CreateApplicantForm,
|
|
5113
|
-
|
|
5114
|
-
|
|
5115
|
-
|
|
5134
|
+
gt as CriteriaBuiltInType,
|
|
5135
|
+
ft as DEFAULT_VISIBLE_FIELDS,
|
|
5136
|
+
mt as DocumentReviewStatus,
|
|
5116
5137
|
vt as EndpointBuilder,
|
|
5117
5138
|
xe as ErrorHandler,
|
|
5118
5139
|
Bt as EventEmitter,
|
|
5119
|
-
|
|
5120
|
-
|
|
5140
|
+
Be as FIELD_METADATA,
|
|
5141
|
+
ut as FileType,
|
|
5121
5142
|
sr as FileUpload,
|
|
5122
5143
|
Se as GenderType,
|
|
5123
|
-
|
|
5144
|
+
Xe as Header,
|
|
5124
5145
|
xt as HttpClient,
|
|
5125
5146
|
be as IdentityProviderManager,
|
|
5126
5147
|
Et as IdentityService,
|
|
5127
5148
|
le as IdentityVerificationProvider,
|
|
5128
5149
|
Ir as IdentityVerificationStep,
|
|
5129
|
-
|
|
5150
|
+
se as Input,
|
|
5130
5151
|
Rt as InvestorCategorizationService,
|
|
5131
5152
|
Ar as InvestorCategorizationStep,
|
|
5132
|
-
|
|
5133
|
-
|
|
5134
|
-
|
|
5153
|
+
ae as InvestorCategorizationType,
|
|
5154
|
+
yt as InvestorCategoryType,
|
|
5155
|
+
ct as KycProcessStatus,
|
|
5135
5156
|
ye as KycStatus,
|
|
5136
|
-
|
|
5157
|
+
je as KycStatusDisplay,
|
|
5137
5158
|
Gr as KycWorkflow,
|
|
5138
5159
|
Rr as Logo,
|
|
5139
|
-
|
|
5160
|
+
He as MetaKYCContext,
|
|
5140
5161
|
ue as MetaKYCError,
|
|
5141
5162
|
$r as MetaKYCProvider,
|
|
5142
5163
|
ar as MultiSelect,
|
|
5143
|
-
|
|
5164
|
+
jt as OnfidoProvider,
|
|
5144
5165
|
Ct as OverviewService,
|
|
5145
5166
|
Sr as OverviewStep,
|
|
5146
5167
|
ir as PhoneInput,
|
|
5147
5168
|
kt as QuestionnaireService,
|
|
5148
5169
|
kr as QuestionnaireStep,
|
|
5149
5170
|
fe as ReviewStatus,
|
|
5150
|
-
|
|
5151
|
-
|
|
5171
|
+
pt as RiskCriteriaType,
|
|
5172
|
+
ot as RiskLevel,
|
|
5152
5173
|
At as RiskScoringService,
|
|
5153
5174
|
Cr as RiskScoringStep,
|
|
5154
|
-
|
|
5175
|
+
Ut as SardinAIProvider,
|
|
5155
5176
|
ge as Select,
|
|
5156
5177
|
de as Spinner,
|
|
5157
5178
|
$t as StepRouter,
|
|
5158
|
-
|
|
5179
|
+
_t as SumsubProvider,
|
|
5159
5180
|
Kt as ThemeManager,
|
|
5160
|
-
|
|
5181
|
+
Z as ThemePreset,
|
|
5161
5182
|
Ot as ThemeService,
|
|
5162
5183
|
Nt as UploadDocumentService,
|
|
5163
5184
|
Nr as UploadDocumentStep,
|
|
5164
|
-
|
|
5165
|
-
|
|
5166
|
-
|
|
5185
|
+
dt as UserType,
|
|
5186
|
+
De as ValueDataType,
|
|
5187
|
+
qt as WorkflowOrchestrator,
|
|
5167
5188
|
Ne as WorkflowResultType,
|
|
5168
5189
|
zt as WorkflowState,
|
|
5169
|
-
|
|
5190
|
+
$ as WorkflowStepAction,
|
|
5170
5191
|
Wr as appropriatenessTestSchema,
|
|
5171
5192
|
Kr as clearAllStorage,
|
|
5172
5193
|
Wt as clearApplicantId,
|
|
5173
5194
|
Gt as clearWorkflowState,
|
|
5174
|
-
|
|
5175
|
-
|
|
5195
|
+
J as cn,
|
|
5196
|
+
Ft as corporateTheme,
|
|
5176
5197
|
bt as defaultConfig,
|
|
5177
|
-
|
|
5198
|
+
ee as defaultTheme,
|
|
5178
5199
|
Ht as fileToBase64,
|
|
5179
|
-
|
|
5200
|
+
Dt as fintechTheme,
|
|
5180
5201
|
Ie as formatFileSize,
|
|
5181
5202
|
Yr as generateAppropriatenessSchema,
|
|
5182
5203
|
br as generateQuestionnaireSchema,
|
|
5183
5204
|
xr as generateRiskScoringSchema,
|
|
5184
5205
|
Vr as generateUploadDocumentSchema,
|
|
5185
|
-
|
|
5206
|
+
jr as getAcceptString,
|
|
5186
5207
|
Yt as getApplicantId,
|
|
5187
5208
|
we as getThemePreset,
|
|
5188
|
-
|
|
5189
|
-
|
|
5209
|
+
Ur as getWorkflowState,
|
|
5210
|
+
Pt as healthcareTheme,
|
|
5190
5211
|
Br as isScriptLoaded,
|
|
5191
|
-
|
|
5212
|
+
Ke as loadScript,
|
|
5192
5213
|
Tt as minimalTheme,
|
|
5193
5214
|
Lt as modernTheme,
|
|
5194
5215
|
zr as removeScript,
|
|
@@ -5199,12 +5220,12 @@ export {
|
|
|
5199
5220
|
Hr as useAppropriatenessTest,
|
|
5200
5221
|
tr as useIdentityVerification,
|
|
5201
5222
|
Zt as useKycWorkflow,
|
|
5202
|
-
|
|
5223
|
+
oe as useMetaKYC,
|
|
5203
5224
|
er as useOverview,
|
|
5204
5225
|
Jt as useQuestionnaire,
|
|
5205
5226
|
rr as useRiskScoring,
|
|
5206
5227
|
Xt as useUploadDocument,
|
|
5207
|
-
|
|
5208
|
-
|
|
5228
|
+
qr as validateFileSize,
|
|
5229
|
+
_r as validateFileType
|
|
5209
5230
|
};
|
|
5210
5231
|
//# sourceMappingURL=index.js.map
|