@vpdev2/metakyc 1.0.5 → 1.0.6
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/context/MetaKYCProvider.d.ts.map +1 -1
- package/dist/index.cjs +22 -13
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +454 -433
- package/dist/index.js.map +1 -1
- package/dist/styles/critical-css.d.ts +2 -0
- package/dist/styles/critical-css.d.ts.map +1 -0
- package/dist/version.d.ts +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
|
-
var
|
|
2
|
-
var
|
|
3
|
-
var he = (e, t, n) =>
|
|
4
|
-
import
|
|
5
|
-
import * as
|
|
6
|
-
import ke, { createContext as
|
|
1
|
+
var qt = Object.defineProperty;
|
|
2
|
+
var Vt = (e, t, n) => t in e ? qt(e, t, { enumerable: !0, configurable: !0, writable: !0, value: n }) : e[t] = n;
|
|
3
|
+
var he = (e, t, n) => Vt(e, typeof t != "symbol" ? t + "" : t, n);
|
|
4
|
+
import Yt from "axios";
|
|
5
|
+
import * as Rt from "react";
|
|
6
|
+
import ke, { createContext as Qt, useState as k, useMemo as De, useEffect as ge, useContext as Gt, useRef as de, useCallback as ae, forwardRef as yt, createElement as St } from "react";
|
|
7
7
|
import { jsxs as o, jsx as r, Fragment as ct } from "react/jsx-runtime";
|
|
8
|
-
import
|
|
9
|
-
import { useForm as
|
|
8
|
+
import Jt, { createPortal as Ct } from "react-dom";
|
|
9
|
+
import { useForm as Zt, Controller as tt } from "react-hook-form";
|
|
10
10
|
import { z as Ye } from "zod";
|
|
11
|
-
var ce = /* @__PURE__ */ ((e) => (e[e.IdentitySdk = 0] = "IdentitySdk", e[e.RiskScoring = 1] = "RiskScoring", e[e.Questionaries = 2] = "Questionaries", e[e.AdditionalData = 3] = "AdditionalData", e[e.AppropriatenessTest = 4] = "AppropriatenessTest", e[e.UploadDocument = 5] = "UploadDocument", e[e.ManualReview = 6] = "ManualReview", e[e.Overview = 7] = "Overview", e[e.InvestorCategorization = 8] = "InvestorCategorization", e))(ce || {}), gt = /* @__PURE__ */ ((e) => (e[e.NotStarted = 0] = "NotStarted", e[e.InProgress = 1] = "InProgress", e[e.Success = 2] = "Success", e[e.PartialSuccess = 3] = "PartialSuccess", e[e.Failed = 4] = "Failed", e[e.Skipped = 5] = "Skipped", e[e.AdminReview = 6] = "AdminReview", e[e.SkippedAndAdminReview = 7] = "SkippedAndAdminReview", e))(gt || {}), ze = /* @__PURE__ */ ((e) => (e[e.None = 0] = "None", e[e.InProgress = 1] = "InProgress", e[e.Finished = 2] = "Finished", e[e.OnHold = 3] = "OnHold", e[e.IdentityPending = 4] = "IdentityPending", e))(ze || {}),
|
|
11
|
+
var ce = /* @__PURE__ */ ((e) => (e[e.IdentitySdk = 0] = "IdentitySdk", e[e.RiskScoring = 1] = "RiskScoring", e[e.Questionaries = 2] = "Questionaries", e[e.AdditionalData = 3] = "AdditionalData", e[e.AppropriatenessTest = 4] = "AppropriatenessTest", e[e.UploadDocument = 5] = "UploadDocument", e[e.ManualReview = 6] = "ManualReview", e[e.Overview = 7] = "Overview", e[e.InvestorCategorization = 8] = "InvestorCategorization", e))(ce || {}), gt = /* @__PURE__ */ ((e) => (e[e.NotStarted = 0] = "NotStarted", e[e.InProgress = 1] = "InProgress", e[e.Success = 2] = "Success", e[e.PartialSuccess = 3] = "PartialSuccess", e[e.Failed = 4] = "Failed", e[e.Skipped = 5] = "Skipped", e[e.AdminReview = 6] = "AdminReview", e[e.SkippedAndAdminReview = 7] = "SkippedAndAdminReview", e))(gt || {}), ze = /* @__PURE__ */ ((e) => (e[e.None = 0] = "None", e[e.InProgress = 1] = "InProgress", e[e.Finished = 2] = "Finished", e[e.OnHold = 3] = "OnHold", e[e.IdentityPending = 4] = "IdentityPending", e))(ze || {}), Xt = /* @__PURE__ */ ((e) => (e[e.None = 0] = "None", e[e.RepresentativeKYC = 1] = "RepresentativeKYC", e[e.ManualRiskCriteria = 2] = "ManualRiskCriteria", e[e.UploadDocumentReview = 3] = "UploadDocumentReview", e[e.AdminReview = 4] = "AdminReview", e))(Xt || {}), er = /* @__PURE__ */ ((e) => (e[e.LowRisk = 0] = "LowRisk", e[e.MediumRisk = 1] = "MediumRisk", e[e.HighRisk = 2] = "HighRisk", e[e.Alert = 3] = "Alert", e))(er || {}), rt = /* @__PURE__ */ ((e) => (e[e.None = 0] = "None", e[e.Pending = 1] = "Pending", e[e.Approved = 2] = "Approved", e[e.Rejected = 3] = "Rejected", e[e.ResendRequested = 4] = "ResendRequested", e[e.Unknown = 5] = "Unknown", e[e.InProgress = 6] = "InProgress", e))(rt || {}), nt = /* @__PURE__ */ ((e) => (e[e.Approved = 0] = "Approved", e[e.Reject = 1] = "Reject", e[e.UnderReview = 2] = "UnderReview", e[e.Closed = 3] = "Closed", e[e.AdminReview = 4] = "AdminReview", e[e.New = 5] = "New", e[e.InProgress = 6] = "InProgress", e))(nt || {}), tr = /* @__PURE__ */ ((e) => (e[e.ProviderResultPending = 0] = "ProviderResultPending", e[e.ProviderResultReceived = 1] = "ProviderResultReceived", e[e.Canceled = 2] = "Canceled", e[e.ExtendedToNewApplicant = 3] = "ExtendedToNewApplicant", e))(tr || {}), rr = /* @__PURE__ */ ((e) => (e[e.None = 0] = "None", e[e.ProviderResultPending = 1] = "ProviderResultPending", e[e.ProviderResultReceived = 2] = "ProviderResultReceived", e[e.Canceled = 3] = "Canceled", e))(rr || {}), Oe = /* @__PURE__ */ ((e) => (e[e.Onfido = 0] = "Onfido", e[e.Sumsub = 2] = "Sumsub", e[e.SardinAI = 3] = "SardinAI", e))(Oe || {}), nr = /* @__PURE__ */ ((e) => (e[e.Individual = 0] = "Individual", e[e.Company = 1] = "Company", e))(nr || {}), bt = /* @__PURE__ */ ((e) => (e[e.Male = 0] = "Male", e[e.Female = 1] = "Female", e[e.Other = 2] = "Other", e))(bt || {}), ar = /* @__PURE__ */ ((e) => (e[e.Image = 0] = "Image", e[e.Video = 1] = "Video", e[e.PDF = 2] = "PDF", e[e.OfficePDF = 3] = "OfficePDF", e[e.Custom = 4] = "Custom", e))(ar || {}), ir = /* @__PURE__ */ ((e) => (e[e.Pending = 0] = "Pending", e[e.Approved = 1] = "Approved", e[e.Rejected = 2] = "Rejected", e[e.RequiresRevision = 3] = "RequiresRevision", e))(ir || {}), or = /* @__PURE__ */ ((e) => (e[e.SingleChoice = 0] = "SingleChoice", e[e.MultipleChoice = 1] = "MultipleChoice", e[e.Text = 2] = "Text", e))(or || {}), qe = /* @__PURE__ */ ((e) => (e[e.String = 0] = "String", e[e.Integer = 1] = "Integer", e[e.Money = 2] = "Money", e[e.Boolean = 3] = "Boolean", e[e.Date = 4] = "Date", e[e.Country = 5] = "Country", e[e.DigitOnly = 6] = "DigitOnly", e))(qe || {}), sr = /* @__PURE__ */ ((e) => (e[e.Text = 0] = "Text", e[e.Radio = 1] = "Radio", e[e.Checkbox = 2] = "Checkbox", e[e.Dropdown = 3] = "Dropdown", e[e.Country = 4] = "Country", e))(sr || {}), lr = /* @__PURE__ */ ((e) => (e[e.None = 0] = "None", e[e.Country = 1] = "Country", e))(lr || {}), Ee = /* @__PURE__ */ ((e) => (e[e.Individual = 0] = "Individual", e[e.Sophisticated = 1] = "Sophisticated", e[e.HighNetWorth = 2] = "HighNetWorth", e[e.Business = 3] = "Business", e))(Ee || {}), cr = /* @__PURE__ */ ((e) => (e[e.Retail = 0] = "Retail", e[e.Professional = 1] = "Professional", e[e.EligibleCounterparty = 2] = "EligibleCounterparty", e))(cr || {});
|
|
12
12
|
const Ze = {
|
|
13
13
|
Nationality: 10,
|
|
14
14
|
Address: 20,
|
|
@@ -58,18 +58,18 @@ const Ze = {
|
|
|
58
58
|
postalCode: { label: "Postal Code", type: "text" },
|
|
59
59
|
addressCountry: { label: "Address Country", type: "select", countriesType: Ze.Address },
|
|
60
60
|
lei: { label: "LEI", type: "text" }
|
|
61
|
-
},
|
|
61
|
+
}, dr = [
|
|
62
62
|
"companyName",
|
|
63
63
|
"email",
|
|
64
64
|
"phone",
|
|
65
65
|
"registrationNumber"
|
|
66
|
-
],
|
|
66
|
+
], ur = [
|
|
67
67
|
"firstName",
|
|
68
68
|
"lastName",
|
|
69
69
|
"email",
|
|
70
70
|
"phonenumber",
|
|
71
71
|
"dateOfBirth"
|
|
72
|
-
],
|
|
72
|
+
], Et = [
|
|
73
73
|
{ value: "EN", label: "English" },
|
|
74
74
|
{ value: "DE", label: "German" },
|
|
75
75
|
{ value: "FR", label: "French" },
|
|
@@ -89,7 +89,7 @@ const Ze = {
|
|
|
89
89
|
{ value: "NO", label: "Norwegian" }
|
|
90
90
|
];
|
|
91
91
|
var Fe = /* @__PURE__ */ ((e) => (e.Default = "default", e.Corporate = "corporate", e.Fintech = "fintech", e.Healthcare = "healthcare", e.Modern = "modern", e.Minimal = "minimal", e))(Fe || {});
|
|
92
|
-
const
|
|
92
|
+
const pr = {
|
|
93
93
|
timeout: 3e4,
|
|
94
94
|
retries: 3,
|
|
95
95
|
locale: "en",
|
|
@@ -97,7 +97,7 @@ const dr = {
|
|
|
97
97
|
pattern: "host-controller"
|
|
98
98
|
}
|
|
99
99
|
};
|
|
100
|
-
class
|
|
100
|
+
class mr {
|
|
101
101
|
constructor(t) {
|
|
102
102
|
this.config = t;
|
|
103
103
|
}
|
|
@@ -194,12 +194,12 @@ class ut {
|
|
|
194
194
|
return t instanceof Ke;
|
|
195
195
|
}
|
|
196
196
|
}
|
|
197
|
-
class
|
|
197
|
+
class yr {
|
|
198
198
|
constructor(t) {
|
|
199
199
|
he(this, "axiosInstance");
|
|
200
200
|
he(this, "endpointBuilder");
|
|
201
201
|
he(this, "config");
|
|
202
|
-
this.config = { ...
|
|
202
|
+
this.config = { ...pr, ...t }, this.endpointBuilder = new mr(this.config.endpoints), this.axiosInstance = Yt.create({
|
|
203
203
|
baseURL: this.config.baseUrl,
|
|
204
204
|
timeout: this.config.timeout,
|
|
205
205
|
headers: {
|
|
@@ -295,7 +295,7 @@ class pr {
|
|
|
295
295
|
return this.axiosInstance;
|
|
296
296
|
}
|
|
297
297
|
}
|
|
298
|
-
class
|
|
298
|
+
class hr {
|
|
299
299
|
constructor(t) {
|
|
300
300
|
this.httpClient = t;
|
|
301
301
|
}
|
|
@@ -414,7 +414,7 @@ class mr {
|
|
|
414
414
|
)).result;
|
|
415
415
|
}
|
|
416
416
|
}
|
|
417
|
-
class
|
|
417
|
+
class fr {
|
|
418
418
|
constructor(t) {
|
|
419
419
|
this.httpClient = t;
|
|
420
420
|
}
|
|
@@ -441,7 +441,7 @@ class yr {
|
|
|
441
441
|
)).result;
|
|
442
442
|
}
|
|
443
443
|
}
|
|
444
|
-
class
|
|
444
|
+
class gr {
|
|
445
445
|
constructor(t) {
|
|
446
446
|
this.httpClient = t;
|
|
447
447
|
}
|
|
@@ -469,7 +469,7 @@ class hr {
|
|
|
469
469
|
await this.httpClient.post("UploadDocument", "ReviewUploadDocument", t);
|
|
470
470
|
}
|
|
471
471
|
}
|
|
472
|
-
class
|
|
472
|
+
class br {
|
|
473
473
|
constructor(t) {
|
|
474
474
|
this.httpClient = t;
|
|
475
475
|
}
|
|
@@ -495,7 +495,7 @@ class fr {
|
|
|
495
495
|
)).result;
|
|
496
496
|
}
|
|
497
497
|
}
|
|
498
|
-
class
|
|
498
|
+
class xr {
|
|
499
499
|
constructor(t) {
|
|
500
500
|
this.httpClient = t;
|
|
501
501
|
}
|
|
@@ -517,7 +517,7 @@ class gr {
|
|
|
517
517
|
await this.httpClient.get("Applicant", "PassOverview", { applicantId: t });
|
|
518
518
|
}
|
|
519
519
|
}
|
|
520
|
-
class
|
|
520
|
+
class vr {
|
|
521
521
|
constructor(t) {
|
|
522
522
|
this.httpClient = t;
|
|
523
523
|
}
|
|
@@ -552,7 +552,7 @@ class br {
|
|
|
552
552
|
)).result;
|
|
553
553
|
}
|
|
554
554
|
}
|
|
555
|
-
class
|
|
555
|
+
class kr {
|
|
556
556
|
constructor(t) {
|
|
557
557
|
this.httpClient = t;
|
|
558
558
|
}
|
|
@@ -620,7 +620,7 @@ class xr {
|
|
|
620
620
|
return console.log("[IdentityService] Sumsub token refresh result:", n), n.result.accessToken;
|
|
621
621
|
}
|
|
622
622
|
}
|
|
623
|
-
class
|
|
623
|
+
class wr {
|
|
624
624
|
constructor(t) {
|
|
625
625
|
this.httpClient = t;
|
|
626
626
|
}
|
|
@@ -656,7 +656,7 @@ class vr {
|
|
|
656
656
|
)).result;
|
|
657
657
|
}
|
|
658
658
|
}
|
|
659
|
-
class
|
|
659
|
+
class Sr {
|
|
660
660
|
constructor(t) {
|
|
661
661
|
this.httpClient = t;
|
|
662
662
|
}
|
|
@@ -741,7 +741,7 @@ const Le = {
|
|
|
741
741
|
textMuted: "#9ca3af"
|
|
742
742
|
}
|
|
743
743
|
}
|
|
744
|
-
},
|
|
744
|
+
}, Cr = {
|
|
745
745
|
name: "Corporate",
|
|
746
746
|
logo: {
|
|
747
747
|
url: "",
|
|
@@ -774,7 +774,7 @@ const Le = {
|
|
|
774
774
|
cardPadding: "1.5rem",
|
|
775
775
|
inputHeight: "2.5rem"
|
|
776
776
|
}
|
|
777
|
-
},
|
|
777
|
+
}, Nr = {
|
|
778
778
|
name: "Fintech",
|
|
779
779
|
logo: {
|
|
780
780
|
url: "",
|
|
@@ -807,7 +807,7 @@ const Le = {
|
|
|
807
807
|
cardPadding: "2rem",
|
|
808
808
|
inputHeight: "3rem"
|
|
809
809
|
}
|
|
810
|
-
},
|
|
810
|
+
}, Ir = {
|
|
811
811
|
name: "Healthcare",
|
|
812
812
|
logo: {
|
|
813
813
|
url: "",
|
|
@@ -849,7 +849,7 @@ const Le = {
|
|
|
849
849
|
textSecondary: "#CBD5E1"
|
|
850
850
|
}
|
|
851
851
|
}
|
|
852
|
-
},
|
|
852
|
+
}, Rr = {
|
|
853
853
|
name: "Modern",
|
|
854
854
|
logo: {
|
|
855
855
|
url: "",
|
|
@@ -882,7 +882,7 @@ const Le = {
|
|
|
882
882
|
cardPadding: "2rem",
|
|
883
883
|
inputHeight: "3rem"
|
|
884
884
|
}
|
|
885
|
-
},
|
|
885
|
+
}, Er = {
|
|
886
886
|
name: "Minimal",
|
|
887
887
|
logo: {
|
|
888
888
|
url: "",
|
|
@@ -915,18 +915,18 @@ const Le = {
|
|
|
915
915
|
cardPadding: "1.25rem",
|
|
916
916
|
inputHeight: "2.25rem"
|
|
917
917
|
}
|
|
918
|
-
},
|
|
918
|
+
}, Fr = {
|
|
919
919
|
[Fe.Default]: Le,
|
|
920
|
-
[Fe.Corporate]:
|
|
921
|
-
[Fe.Fintech]:
|
|
922
|
-
[Fe.Healthcare]:
|
|
923
|
-
[Fe.Modern]:
|
|
924
|
-
[Fe.Minimal]:
|
|
920
|
+
[Fe.Corporate]: Cr,
|
|
921
|
+
[Fe.Fintech]: Nr,
|
|
922
|
+
[Fe.Healthcare]: Ir,
|
|
923
|
+
[Fe.Modern]: Rr,
|
|
924
|
+
[Fe.Minimal]: Er
|
|
925
925
|
};
|
|
926
926
|
function pt(e) {
|
|
927
|
-
return
|
|
927
|
+
return Fr[e] || Le;
|
|
928
928
|
}
|
|
929
|
-
class
|
|
929
|
+
class Ar {
|
|
930
930
|
constructor(t) {
|
|
931
931
|
this.httpClient = t;
|
|
932
932
|
}
|
|
@@ -1029,7 +1029,7 @@ class Er {
|
|
|
1029
1029
|
} : a;
|
|
1030
1030
|
}
|
|
1031
1031
|
}
|
|
1032
|
-
class
|
|
1032
|
+
class Tr {
|
|
1033
1033
|
constructor() {
|
|
1034
1034
|
he(this, "listeners", /* @__PURE__ */ new Map());
|
|
1035
1035
|
}
|
|
@@ -1074,9 +1074,9 @@ class Fr {
|
|
|
1074
1074
|
this.listeners.delete(t);
|
|
1075
1075
|
}
|
|
1076
1076
|
}
|
|
1077
|
-
class
|
|
1077
|
+
class Pr {
|
|
1078
1078
|
constructor() {
|
|
1079
|
-
he(this, "events", new
|
|
1079
|
+
he(this, "events", new Tr());
|
|
1080
1080
|
he(this, "_applicantId", null);
|
|
1081
1081
|
he(this, "_progress", null);
|
|
1082
1082
|
he(this, "_error", null);
|
|
@@ -1214,7 +1214,7 @@ class Ar {
|
|
|
1214
1214
|
this.events.clear();
|
|
1215
1215
|
}
|
|
1216
1216
|
}
|
|
1217
|
-
class
|
|
1217
|
+
class Lr {
|
|
1218
1218
|
constructor() {
|
|
1219
1219
|
he(this, "handlers", /* @__PURE__ */ new Map());
|
|
1220
1220
|
}
|
|
@@ -1255,11 +1255,11 @@ class Tr {
|
|
|
1255
1255
|
return a.submitData(n);
|
|
1256
1256
|
}
|
|
1257
1257
|
}
|
|
1258
|
-
class
|
|
1258
|
+
class Dr {
|
|
1259
1259
|
constructor(t, n, a, i, s, c, d, y) {
|
|
1260
1260
|
he(this, "state");
|
|
1261
1261
|
he(this, "stepRouter");
|
|
1262
|
-
this.applicantService = t, this.questionnaireService = n, this.uploadDocumentService = a, this.appropriatenessTestService = i, this.overviewService = s, this.riskScoringService = c, this.investorCategorizationService = y, this.state = new
|
|
1262
|
+
this.applicantService = t, this.questionnaireService = n, this.uploadDocumentService = a, this.appropriatenessTestService = i, this.overviewService = s, this.riskScoringService = c, this.investorCategorizationService = y, this.state = new Pr(), this.stepRouter = new Lr(), this.registerStepHandlers();
|
|
1263
1263
|
}
|
|
1264
1264
|
/**
|
|
1265
1265
|
* Register all step handlers
|
|
@@ -1399,7 +1399,7 @@ class Pr {
|
|
|
1399
1399
|
return this.stepRouter;
|
|
1400
1400
|
}
|
|
1401
1401
|
}
|
|
1402
|
-
function
|
|
1402
|
+
function zt(e, t) {
|
|
1403
1403
|
return new Promise((n, a) => {
|
|
1404
1404
|
if (t && document.getElementById(t)) {
|
|
1405
1405
|
n();
|
|
@@ -1409,14 +1409,14 @@ function Mt(e, t) {
|
|
|
1409
1409
|
i.src = e, t && (i.id = t), i.async = !0, i.onload = () => n(), i.onerror = () => a(new Error(`Failed to load script: ${e}`)), document.head.appendChild(i);
|
|
1410
1410
|
});
|
|
1411
1411
|
}
|
|
1412
|
-
function
|
|
1412
|
+
function Gn(e) {
|
|
1413
1413
|
return !!document.getElementById(e);
|
|
1414
1414
|
}
|
|
1415
|
-
function
|
|
1415
|
+
function Jn(e) {
|
|
1416
1416
|
const t = document.getElementById(e);
|
|
1417
1417
|
t && t.remove();
|
|
1418
1418
|
}
|
|
1419
|
-
const
|
|
1419
|
+
const Mr = "https://static.sumsub.com/idensic/static/sns-websdk-builder.js";
|
|
1420
1420
|
function Ue(e, t) {
|
|
1421
1421
|
try {
|
|
1422
1422
|
return getComputedStyle(document.documentElement).getPropertyValue(e).trim() || t;
|
|
@@ -1424,7 +1424,7 @@ function Ue(e, t) {
|
|
|
1424
1424
|
return t;
|
|
1425
1425
|
}
|
|
1426
1426
|
}
|
|
1427
|
-
function
|
|
1427
|
+
function Or() {
|
|
1428
1428
|
const e = Ue("--metakyc-primary", "#2563eb"), t = Ue("--metakyc-primary-hover", "#1d4ed8"), n = Ue("--metakyc-background", "#ffffff"), a = Ue("--metakyc-surface", "#f9fafb"), i = Ue("--metakyc-text-primary", "#111827"), s = Ue("--metakyc-text-secondary", "#6b7280"), c = Ue("--metakyc-text-muted", "#9ca3af"), d = Ue("--metakyc-border", "#e5e7eb");
|
|
1429
1429
|
return `
|
|
1430
1430
|
body, html { font-family: ${Ue(
|
|
@@ -1451,7 +1451,7 @@ a { color: ${e}; }
|
|
|
1451
1451
|
a:hover { color: ${t}; }
|
|
1452
1452
|
`.trim();
|
|
1453
1453
|
}
|
|
1454
|
-
class
|
|
1454
|
+
class zr {
|
|
1455
1455
|
constructor(t) {
|
|
1456
1456
|
he(this, "sdk", null);
|
|
1457
1457
|
he(this, "config");
|
|
@@ -1460,7 +1460,7 @@ class Mr {
|
|
|
1460
1460
|
this.config = t;
|
|
1461
1461
|
}
|
|
1462
1462
|
async loadSDK() {
|
|
1463
|
-
if (!window.snsWebSdk && (await
|
|
1463
|
+
if (!window.snsWebSdk && (await zt(Mr, "sumsub-websdk"), !window.snsWebSdk))
|
|
1464
1464
|
throw new Error("Sumsub Web SDK failed to load from CDN");
|
|
1465
1465
|
}
|
|
1466
1466
|
async initialize(t) {
|
|
@@ -1470,7 +1470,7 @@ class Mr {
|
|
|
1470
1470
|
};
|
|
1471
1471
|
if (this.config.applicantEmail && (n.email = this.config.applicantEmail), this.config.applicantPhone && (n.phone = this.config.applicantPhone), this.config.theme && (n.theme = this.config.theme), this.config.customizationName && (n.customizationName = this.config.customizationName), !this.config.customizationName) {
|
|
1472
1472
|
const i = {};
|
|
1473
|
-
this.config.customCss && (i.customCss = this.config.customCss), this.config.customCssStr && (i.customCssStr = this.config.customCssStr), i.customCssStr || (i.customCssStr =
|
|
1473
|
+
this.config.customCss && (i.customCss = this.config.customCss), this.config.customCssStr && (i.customCssStr = this.config.customCssStr), i.customCssStr || (i.customCssStr = Or()), n.uiConf = i;
|
|
1474
1474
|
}
|
|
1475
1475
|
const a = window.snsWebSdk.init(
|
|
1476
1476
|
this.config.accessToken,
|
|
@@ -1508,7 +1508,7 @@ class Mr {
|
|
|
1508
1508
|
this.errorCallback = t;
|
|
1509
1509
|
}
|
|
1510
1510
|
}
|
|
1511
|
-
class
|
|
1511
|
+
class $r {
|
|
1512
1512
|
constructor(t) {
|
|
1513
1513
|
he(this, "sdk", null);
|
|
1514
1514
|
he(this, "config");
|
|
@@ -1518,7 +1518,7 @@ class Or {
|
|
|
1518
1518
|
* Load Onfido SDK
|
|
1519
1519
|
*/
|
|
1520
1520
|
async loadSDK() {
|
|
1521
|
-
await
|
|
1521
|
+
await zt(
|
|
1522
1522
|
"https://sdk.onfido.com/v12.0.0/onfido.min.js",
|
|
1523
1523
|
"onfido-sdk"
|
|
1524
1524
|
);
|
|
@@ -1574,7 +1574,7 @@ class Or {
|
|
|
1574
1574
|
this.sdk && (this.sdk.tearDown(), this.sdk = null);
|
|
1575
1575
|
}
|
|
1576
1576
|
}
|
|
1577
|
-
class
|
|
1577
|
+
class Br {
|
|
1578
1578
|
constructor(t) {
|
|
1579
1579
|
he(this, "sardineContext", null);
|
|
1580
1580
|
he(this, "config");
|
|
@@ -1725,11 +1725,11 @@ class Je {
|
|
|
1725
1725
|
static createProvider(t, n) {
|
|
1726
1726
|
switch (t) {
|
|
1727
1727
|
case Oe.Sumsub:
|
|
1728
|
-
return new
|
|
1728
|
+
return new zr(n);
|
|
1729
1729
|
case Oe.Onfido:
|
|
1730
|
-
return new
|
|
1730
|
+
return new $r(n);
|
|
1731
1731
|
case Oe.SardinAI:
|
|
1732
|
-
return new
|
|
1732
|
+
return new Br(n);
|
|
1733
1733
|
default:
|
|
1734
1734
|
throw new Error(`Unsupported identity provider: ${t}`);
|
|
1735
1735
|
}
|
|
@@ -1773,7 +1773,7 @@ class Je {
|
|
|
1773
1773
|
}
|
|
1774
1774
|
}
|
|
1775
1775
|
}
|
|
1776
|
-
function
|
|
1776
|
+
function _r() {
|
|
1777
1777
|
return `
|
|
1778
1778
|
/* ── metakyc-input-colors (ThemeManager failsafe — same rules as globals.css) ── */
|
|
1779
1779
|
.metakyc-sdk input:not([type="checkbox"]):not([type="radio"]):not([type="color"]):not([type="range"]),
|
|
@@ -1807,7 +1807,7 @@ function $r() {
|
|
|
1807
1807
|
}
|
|
1808
1808
|
`;
|
|
1809
1809
|
}
|
|
1810
|
-
class
|
|
1810
|
+
class jr {
|
|
1811
1811
|
constructor(t) {
|
|
1812
1812
|
he(this, "currentTheme", Le);
|
|
1813
1813
|
he(this, "customStyleElement", null);
|
|
@@ -1890,7 +1890,7 @@ class Br {
|
|
|
1890
1890
|
* These rules are placed BEFORE any custom CSS so that custom CSS can still override them.
|
|
1891
1891
|
*/
|
|
1892
1892
|
injectInputColors() {
|
|
1893
|
-
this.inputStyleElement && this.inputStyleElement.remove(), this.inputStyleElement = document.createElement("style"), this.inputStyleElement.id = "metakyc-input-colors", this.inputStyleElement.textContent =
|
|
1893
|
+
this.inputStyleElement && this.inputStyleElement.remove(), this.inputStyleElement = document.createElement("style"), this.inputStyleElement.id = "metakyc-input-colors", this.inputStyleElement.textContent = _r(), this.customStyleElement && this.customStyleElement.parentNode ? document.head.insertBefore(this.inputStyleElement, this.customStyleElement) : document.head.appendChild(this.inputStyleElement);
|
|
1894
1894
|
}
|
|
1895
1895
|
/**
|
|
1896
1896
|
* Inject custom CSS into document
|
|
@@ -1955,9 +1955,30 @@ class Br {
|
|
|
1955
1955
|
return t.replace(/([a-z0-9])([A-Z])/g, "$1-$2").toLowerCase();
|
|
1956
1956
|
}
|
|
1957
1957
|
}
|
|
1958
|
-
const
|
|
1958
|
+
const $t = Qt(null), Hr = "1.0.6", Ft = "metakyc-critical-css", Wr = `
|
|
1959
|
+
.metakyc-sdk{background-color:var(--metakyc-background,#fff)!important;color:var(--metakyc-text-primary,#111827)!important;color-scheme:light!important;line-height:1.5;-webkit-text-size-adjust:100%}
|
|
1960
|
+
.metakyc-sdk *,.metakyc-sdk *::before,.metakyc-sdk *::after{box-sizing:border-box;border-width:0;border-style:solid;border-color:var(--metakyc-border,#e5e7eb)}
|
|
1961
|
+
.metakyc-sdk .metakyc-card{background-color:var(--metakyc-surface,#fff)!important}
|
|
1962
|
+
.metakyc-sdk h1,.metakyc-sdk h2,.metakyc-sdk h3,.metakyc-sdk h4,.metakyc-sdk h5,.metakyc-sdk h6{color:var(--metakyc-text-primary,#111827)!important;margin:0}
|
|
1963
|
+
.metakyc-sdk p{margin:0}
|
|
1964
|
+
.metakyc-sdk input:not([type="checkbox"]):not([type="radio"]):not([type="color"]):not([type="range"]),.metakyc-sdk select,.metakyc-sdk textarea,.metakyc-sdk .metakyc-searchable-select-trigger,.metakyc-sdk .metakyc-multiselect-trigger{background-color:var(--metakyc-input-bg,var(--metakyc-background,#fff))!important;color:var(--metakyc-input-text,var(--metakyc-text-primary,#111827))!important;border-color:var(--metakyc-input-border,var(--metakyc-border,#d1d5db))!important}
|
|
1965
|
+
.metakyc-sdk button,.metakyc-sdk input,.metakyc-sdk select,.metakyc-sdk textarea{font-family:inherit;font-size:100%;line-height:inherit;color:inherit;margin:0;padding:0}
|
|
1966
|
+
.metakyc-sdk label{color:inherit}
|
|
1967
|
+
`;
|
|
1968
|
+
let xt = !1;
|
|
1969
|
+
function Ur() {
|
|
1970
|
+
if (xt || typeof document > "u") return;
|
|
1971
|
+
if (document.getElementById(Ft)) {
|
|
1972
|
+
xt = !0;
|
|
1973
|
+
return;
|
|
1974
|
+
}
|
|
1975
|
+
const e = document.createElement("style");
|
|
1976
|
+
e.id = Ft, e.textContent = Wr, document.head.insertBefore(e, document.head.firstChild), xt = !0;
|
|
1977
|
+
}
|
|
1978
|
+
const Zn = ({ config: e, children: t }) => {
|
|
1979
|
+
Ur();
|
|
1959
1980
|
const [n, a] = k(null), i = ke.useRef(!1), s = ke.useRef(!1), c = De(() => {
|
|
1960
|
-
const y = new
|
|
1981
|
+
const y = new yr(e), p = new hr(y), b = new fr(y), P = new gr(y), v = new br(y), A = new xr(y), T = new vr(y), w = new kr(y), N = new wr(y), z = new Sr(y), Q = new Ar(y), M = new jr();
|
|
1961
1982
|
return {
|
|
1962
1983
|
httpClient: y,
|
|
1963
1984
|
applicantService: p,
|
|
@@ -1976,7 +1997,7 @@ const Ot = Vt(null), _r = "1.0.5", Yn = ({ config: e, children: t }) => {
|
|
|
1976
1997
|
config: e,
|
|
1977
1998
|
...c,
|
|
1978
1999
|
currentTheme: n,
|
|
1979
|
-
createOrchestrator: () => new
|
|
2000
|
+
createOrchestrator: () => new Dr(
|
|
1980
2001
|
c.applicantService,
|
|
1981
2002
|
c.questionnaireService,
|
|
1982
2003
|
c.uploadDocumentService,
|
|
@@ -2008,7 +2029,7 @@ const Ot = Vt(null), _r = "1.0.5", Yn = ({ config: e, children: t }) => {
|
|
|
2008
2029
|
}
|
|
2009
2030
|
})(), () => {
|
|
2010
2031
|
c.themeManager.cleanup();
|
|
2011
|
-
}), []), /* @__PURE__ */ o(
|
|
2032
|
+
}), []), /* @__PURE__ */ o($t.Provider, { value: d, children: [
|
|
2012
2033
|
e.showVersion && /* @__PURE__ */ o(
|
|
2013
2034
|
"div",
|
|
2014
2035
|
{
|
|
@@ -2025,7 +2046,7 @@ const Ot = Vt(null), _r = "1.0.5", Yn = ({ config: e, children: t }) => {
|
|
|
2025
2046
|
},
|
|
2026
2047
|
children: [
|
|
2027
2048
|
"SDK v",
|
|
2028
|
-
|
|
2049
|
+
Hr
|
|
2029
2050
|
]
|
|
2030
2051
|
}
|
|
2031
2052
|
),
|
|
@@ -2033,12 +2054,12 @@ const Ot = Vt(null), _r = "1.0.5", Yn = ({ config: e, children: t }) => {
|
|
|
2033
2054
|
] });
|
|
2034
2055
|
};
|
|
2035
2056
|
function Te() {
|
|
2036
|
-
const e =
|
|
2057
|
+
const e = Gt($t);
|
|
2037
2058
|
if (!e)
|
|
2038
2059
|
throw new Error("useMetaKYC must be used within a MetaKYCProvider");
|
|
2039
2060
|
return e;
|
|
2040
2061
|
}
|
|
2041
|
-
async function
|
|
2062
|
+
async function Kr(e) {
|
|
2042
2063
|
return new Promise((t, n) => {
|
|
2043
2064
|
const a = new FileReader();
|
|
2044
2065
|
a.readAsDataURL(e), a.onload = () => {
|
|
@@ -2047,10 +2068,10 @@ async function Hr(e) {
|
|
|
2047
2068
|
}, a.onerror = (i) => n(i);
|
|
2048
2069
|
});
|
|
2049
2070
|
}
|
|
2050
|
-
function
|
|
2071
|
+
function Xn(e, t) {
|
|
2051
2072
|
return e.size <= t;
|
|
2052
2073
|
}
|
|
2053
|
-
function
|
|
2074
|
+
function ea(e, t) {
|
|
2054
2075
|
return t.split(",").map((a) => a.trim()).some((a) => {
|
|
2055
2076
|
if (a.endsWith("/*")) {
|
|
2056
2077
|
const i = a.slice(0, -2);
|
|
@@ -2059,12 +2080,12 @@ function Gn(e, t) {
|
|
|
2059
2080
|
return e.type === a;
|
|
2060
2081
|
});
|
|
2061
2082
|
}
|
|
2062
|
-
function
|
|
2083
|
+
function vt(e) {
|
|
2063
2084
|
if (e === 0) return "0 Bytes";
|
|
2064
2085
|
const t = 1024, n = ["Bytes", "KB", "MB", "GB"], a = Math.floor(Math.log(e) / Math.log(t));
|
|
2065
2086
|
return Math.round(e / Math.pow(t, a) * 100) / 100 + " " + n[a];
|
|
2066
2087
|
}
|
|
2067
|
-
function
|
|
2088
|
+
function ta(e) {
|
|
2068
2089
|
return e;
|
|
2069
2090
|
}
|
|
2070
2091
|
function Ae(...e) {
|
|
@@ -2074,14 +2095,14 @@ const dt = {
|
|
|
2074
2095
|
APPLICANT_ID: "metakyc_applicant_id",
|
|
2075
2096
|
WORKFLOW_STATE: "metakyc_workflow_state"
|
|
2076
2097
|
};
|
|
2077
|
-
function
|
|
2098
|
+
function qr(e) {
|
|
2078
2099
|
try {
|
|
2079
2100
|
localStorage.setItem(dt.APPLICANT_ID, e.toString());
|
|
2080
2101
|
} catch (t) {
|
|
2081
2102
|
console.warn("Failed to save applicant ID to storage:", t);
|
|
2082
2103
|
}
|
|
2083
2104
|
}
|
|
2084
|
-
function
|
|
2105
|
+
function Vr() {
|
|
2085
2106
|
try {
|
|
2086
2107
|
const e = localStorage.getItem(dt.APPLICANT_ID);
|
|
2087
2108
|
return e ? parseInt(e, 10) : null;
|
|
@@ -2089,21 +2110,21 @@ function Wr() {
|
|
|
2089
2110
|
return console.warn("Failed to retrieve applicant ID from storage:", e), null;
|
|
2090
2111
|
}
|
|
2091
2112
|
}
|
|
2092
|
-
function
|
|
2113
|
+
function Yr() {
|
|
2093
2114
|
try {
|
|
2094
2115
|
localStorage.removeItem(dt.APPLICANT_ID);
|
|
2095
2116
|
} catch (e) {
|
|
2096
2117
|
console.warn("Failed to clear applicant ID from storage:", e);
|
|
2097
2118
|
}
|
|
2098
2119
|
}
|
|
2099
|
-
function
|
|
2120
|
+
function Qr(e) {
|
|
2100
2121
|
try {
|
|
2101
2122
|
localStorage.setItem(dt.WORKFLOW_STATE, JSON.stringify(e));
|
|
2102
2123
|
} catch (t) {
|
|
2103
2124
|
console.warn("Failed to save workflow state to storage:", t);
|
|
2104
2125
|
}
|
|
2105
2126
|
}
|
|
2106
|
-
function
|
|
2127
|
+
function ra() {
|
|
2107
2128
|
try {
|
|
2108
2129
|
const e = localStorage.getItem(dt.WORKFLOW_STATE);
|
|
2109
2130
|
return e ? JSON.parse(e) : null;
|
|
@@ -2111,23 +2132,23 @@ function Zn() {
|
|
|
2111
2132
|
return console.warn("Failed to retrieve workflow state from storage:", e), null;
|
|
2112
2133
|
}
|
|
2113
2134
|
}
|
|
2114
|
-
function
|
|
2135
|
+
function Gr() {
|
|
2115
2136
|
try {
|
|
2116
2137
|
localStorage.removeItem(dt.WORKFLOW_STATE);
|
|
2117
2138
|
} catch (e) {
|
|
2118
2139
|
console.warn("Failed to clear workflow state from storage:", e);
|
|
2119
2140
|
}
|
|
2120
2141
|
}
|
|
2121
|
-
function
|
|
2122
|
-
|
|
2142
|
+
function na() {
|
|
2143
|
+
Yr(), Gr();
|
|
2123
2144
|
}
|
|
2124
|
-
function
|
|
2125
|
-
const { createOrchestrator: t } = Te(), [n, a] = k(null), [i, s] = k(!1), [c, d] = k(null), y = de(null), p = e ||
|
|
2145
|
+
function Jr(e) {
|
|
2146
|
+
const { createOrchestrator: t } = Te(), [n, a] = k(null), [i, s] = k(!1), [c, d] = k(null), y = de(null), p = e || Vr();
|
|
2126
2147
|
ge(() => {
|
|
2127
2148
|
y.current || (y.current = t());
|
|
2128
2149
|
}, [t]), ge(() => {
|
|
2129
2150
|
var M;
|
|
2130
|
-
n && p && (
|
|
2151
|
+
n && p && (qr(p), Qr({
|
|
2131
2152
|
applicantId: p,
|
|
2132
2153
|
currentStepOrder: (M = n.currentStep) == null ? void 0 : M.order,
|
|
2133
2154
|
status: n.status,
|
|
@@ -2201,15 +2222,15 @@ function Vr(e) {
|
|
|
2201
2222
|
s(!0), d(null);
|
|
2202
2223
|
try {
|
|
2203
2224
|
await y.current.submitCurrentStep(M);
|
|
2204
|
-
const
|
|
2205
|
-
a(
|
|
2206
|
-
} catch (
|
|
2207
|
-
throw d(
|
|
2225
|
+
const j = await y.current.refreshProgress();
|
|
2226
|
+
a(j);
|
|
2227
|
+
} catch (j) {
|
|
2228
|
+
throw d(j), j;
|
|
2208
2229
|
} finally {
|
|
2209
2230
|
s(!1);
|
|
2210
2231
|
}
|
|
2211
2232
|
}
|
|
2212
|
-
}, []), z =
|
|
2233
|
+
}, []), z = Rt.useMemo(() => n != null && n.stepInfoList ? [...n.stepInfoList].sort((M, j) => M.order - j.order) : [], [n == null ? void 0 : n.stepInfoList]), Q = Rt.useMemo(() => n ? n.nextWorkflowKey && n.nextWorkflowKey !== n.workFlowKey : !1, [n]);
|
|
2213
2234
|
return {
|
|
2214
2235
|
progress: n,
|
|
2215
2236
|
applicantId: p,
|
|
@@ -2231,7 +2252,7 @@ function Vr(e) {
|
|
|
2231
2252
|
orchestrator: y.current
|
|
2232
2253
|
};
|
|
2233
2254
|
}
|
|
2234
|
-
function
|
|
2255
|
+
function Zr(e) {
|
|
2235
2256
|
const { questionnaireService: t, applicantService: n } = Te(), [a, i] = k(null), [s, c] = k({}), [d, y] = k(!1), [p, b] = k(!1), [P, v] = k(null), A = de(!1), T = de(null), w = ae(async () => {
|
|
2236
2257
|
var z, Q;
|
|
2237
2258
|
if (e) {
|
|
@@ -2241,13 +2262,13 @@ function Yr(e) {
|
|
|
2241
2262
|
}
|
|
2242
2263
|
A.current = !0, y(!0), v(null);
|
|
2243
2264
|
try {
|
|
2244
|
-
const [M,
|
|
2265
|
+
const [M, j] = await Promise.all([
|
|
2245
2266
|
t.getQuestionnaire(e),
|
|
2246
2267
|
n.getApplicantData(e).catch(() => null)
|
|
2247
2268
|
]);
|
|
2248
|
-
if (i(M), (z =
|
|
2269
|
+
if (i(M), (z = j == null ? void 0 : j.questionnaireResults) != null && z.length && M) {
|
|
2249
2270
|
const K = /* @__PURE__ */ new Map();
|
|
2250
|
-
for (const g of
|
|
2271
|
+
for (const g of j.questionnaireResults)
|
|
2251
2272
|
g.question && ((Q = g.answers) != null && Q.length) && K.set(g.question.trim().toLowerCase(), g.answers);
|
|
2252
2273
|
const ee = {}, E = M.questionGroups.flatMap((g) => g.questions ?? []);
|
|
2253
2274
|
for (const g of E) {
|
|
@@ -2290,7 +2311,7 @@ function Yr(e) {
|
|
|
2290
2311
|
submit: N
|
|
2291
2312
|
};
|
|
2292
2313
|
}
|
|
2293
|
-
function
|
|
2314
|
+
function Xr(e) {
|
|
2294
2315
|
const { uploadDocumentService: t } = Te(), [n, a] = k(null), [i, s] = k(!1), [c, d] = k(!1), [y, p] = k(0), [b, P] = k(null), v = de(!1), A = de(null), T = ae(async () => {
|
|
2295
2316
|
if (e) {
|
|
2296
2317
|
if (v.current) {
|
|
@@ -2334,7 +2355,7 @@ function Qr(e) {
|
|
|
2334
2355
|
submit: w
|
|
2335
2356
|
};
|
|
2336
2357
|
}
|
|
2337
|
-
function
|
|
2358
|
+
function aa(e) {
|
|
2338
2359
|
const { appropriatenessTestService: t } = Te(), [n, a] = k(null), [i, s] = k(!1), [c, d] = k(!1), [y, p] = k(null), [b, P] = k(null), v = de(!1), A = de(null), T = ae(async () => {
|
|
2339
2360
|
if (e) {
|
|
2340
2361
|
if (v.current) {
|
|
@@ -2379,7 +2400,7 @@ function ea(e) {
|
|
|
2379
2400
|
submit: w
|
|
2380
2401
|
};
|
|
2381
2402
|
}
|
|
2382
|
-
function
|
|
2403
|
+
function en(e) {
|
|
2383
2404
|
const { overviewService: t } = Te(), [n, a] = k(null), [i, s] = k(!1), [c, d] = k(!1), [y, p] = k(null), b = de(!1), P = de(null), v = ae(async () => {
|
|
2384
2405
|
if (e) {
|
|
2385
2406
|
if (b.current) {
|
|
@@ -2421,7 +2442,7 @@ function Gr(e) {
|
|
|
2421
2442
|
passOverview: A
|
|
2422
2443
|
};
|
|
2423
2444
|
}
|
|
2424
|
-
function
|
|
2445
|
+
function tn(e) {
|
|
2425
2446
|
const { identityService: t } = Te(), [n, a] = k(
|
|
2426
2447
|
null
|
|
2427
2448
|
), [i, s] = k(!1), [c, d] = k(null), y = de(!1), p = ae(
|
|
@@ -2507,7 +2528,7 @@ function Jr(e) {
|
|
|
2507
2528
|
restartIdentity: P
|
|
2508
2529
|
};
|
|
2509
2530
|
}
|
|
2510
|
-
function
|
|
2531
|
+
function rn(e) {
|
|
2511
2532
|
const { riskScoringService: t, applicantService: n } = Te(), [a, i] = k(null), [s, c] = k({}), [d, y] = k(!1), [p, b] = k(!1), [P, v] = k(null), [A, T] = k(null), w = de(!1), N = de(null), z = ae(async () => {
|
|
2512
2533
|
var M;
|
|
2513
2534
|
if (e) {
|
|
@@ -2517,11 +2538,11 @@ function Zr(e) {
|
|
|
2517
2538
|
}
|
|
2518
2539
|
w.current = !0, y(!0), v(null);
|
|
2519
2540
|
try {
|
|
2520
|
-
const [
|
|
2541
|
+
const [j, K] = await Promise.all([
|
|
2521
2542
|
t.getRiskCriterias(e),
|
|
2522
2543
|
n.getApplicantData(e).catch(() => null)
|
|
2523
2544
|
]);
|
|
2524
|
-
if (i(
|
|
2545
|
+
if (i(j), (M = K == null ? void 0 : K.riskScoringResults) != null && M.length) {
|
|
2525
2546
|
const ee = K.riskScoringResults[0], E = {};
|
|
2526
2547
|
for (const g of ee.riskCriteriaResults ?? [])
|
|
2527
2548
|
if (g.riskCriteriaId != null && g.answer != null && g.answer !== "") {
|
|
@@ -2533,8 +2554,8 @@ function Zr(e) {
|
|
|
2533
2554
|
c(E);
|
|
2534
2555
|
}
|
|
2535
2556
|
N.current = e;
|
|
2536
|
-
} catch (
|
|
2537
|
-
v(
|
|
2557
|
+
} catch (j) {
|
|
2558
|
+
v(j);
|
|
2538
2559
|
} finally {
|
|
2539
2560
|
y(!1), w.current = !1;
|
|
2540
2561
|
}
|
|
@@ -2547,10 +2568,10 @@ function Zr(e) {
|
|
|
2547
2568
|
async (M) => {
|
|
2548
2569
|
b(!0), v(null);
|
|
2549
2570
|
try {
|
|
2550
|
-
const
|
|
2551
|
-
return T(
|
|
2552
|
-
} catch (
|
|
2553
|
-
throw v(
|
|
2571
|
+
const j = await t.submitRiskScoring(M);
|
|
2572
|
+
return T(j), j;
|
|
2573
|
+
} catch (j) {
|
|
2574
|
+
throw v(j), j;
|
|
2554
2575
|
} finally {
|
|
2555
2576
|
b(!1);
|
|
2556
2577
|
}
|
|
@@ -2568,7 +2589,7 @@ function Zr(e) {
|
|
|
2568
2589
|
submit: Q
|
|
2569
2590
|
};
|
|
2570
2591
|
}
|
|
2571
|
-
function
|
|
2592
|
+
function Bt() {
|
|
2572
2593
|
const { applicantService: e, config: t } = Te(), [n, a] = k(!1), [i, s] = k(null), c = de(!1), d = de(!1), y = () => "xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g, function(A) {
|
|
2573
2594
|
const T = Math.random() * 16 | 0;
|
|
2574
2595
|
return (A === "x" ? T : T & 3 | 8).toString(16);
|
|
@@ -2642,7 +2663,7 @@ function zt() {
|
|
|
2642
2663
|
stopProgress: v
|
|
2643
2664
|
};
|
|
2644
2665
|
}
|
|
2645
|
-
const
|
|
2666
|
+
const nn = {
|
|
2646
2667
|
primary: {
|
|
2647
2668
|
backgroundColor: "var(--metakyc-primary, #2563eb)",
|
|
2648
2669
|
color: "#ffffff",
|
|
@@ -2703,7 +2724,7 @@ const Xr = {
|
|
|
2703
2724
|
opacity: i || a ? 0.5 : 1,
|
|
2704
2725
|
lineHeight: "1.25rem",
|
|
2705
2726
|
...b[n],
|
|
2706
|
-
...
|
|
2727
|
+
...nn[t],
|
|
2707
2728
|
...c
|
|
2708
2729
|
},
|
|
2709
2730
|
disabled: i || a,
|
|
@@ -2840,7 +2861,7 @@ const re = ({ children: e, className: t, style: n, ...a }) => /* @__PURE__ */ r(
|
|
|
2840
2861
|
...a,
|
|
2841
2862
|
children: e
|
|
2842
2863
|
}
|
|
2843
|
-
),
|
|
2864
|
+
), an = {
|
|
2844
2865
|
display: "inline-flex",
|
|
2845
2866
|
alignItems: "center",
|
|
2846
2867
|
justifyContent: "center",
|
|
@@ -2874,7 +2895,7 @@ const re = ({ children: e, className: t, style: n, ...a }) => /* @__PURE__ */ r(
|
|
|
2874
2895
|
(d.key === " " || d.key === "Enter") && (d.preventDefault(), n || t(!e));
|
|
2875
2896
|
},
|
|
2876
2897
|
style: {
|
|
2877
|
-
...
|
|
2898
|
+
...an,
|
|
2878
2899
|
backgroundColor: e ? c : s,
|
|
2879
2900
|
borderColor: e ? c : i,
|
|
2880
2901
|
opacity: n ? 0.5 : 1,
|
|
@@ -2903,7 +2924,7 @@ const re = ({ children: e, className: t, style: n, ...a }) => /* @__PURE__ */ r(
|
|
|
2903
2924
|
)
|
|
2904
2925
|
}
|
|
2905
2926
|
);
|
|
2906
|
-
},
|
|
2927
|
+
}, on = {
|
|
2907
2928
|
// Theme-aware variants
|
|
2908
2929
|
default: {
|
|
2909
2930
|
backgroundColor: "var(--metakyc-surface, #f3f4f6)",
|
|
@@ -2926,14 +2947,14 @@ const re = ({ children: e, className: t, style: n, ...a }) => /* @__PURE__ */ r(
|
|
|
2926
2947
|
backgroundColor: "#fef3c7",
|
|
2927
2948
|
color: "#92400e"
|
|
2928
2949
|
}
|
|
2929
|
-
},
|
|
2950
|
+
}, _t = ({ children: e, variant: t = "default", className: n, style: a, ...i }) => /* @__PURE__ */ r(
|
|
2930
2951
|
"span",
|
|
2931
2952
|
{
|
|
2932
2953
|
className: Ae(
|
|
2933
2954
|
"inline-flex items-center px-2.5 py-0.5 rounded-full text-xs font-medium",
|
|
2934
2955
|
n
|
|
2935
2956
|
),
|
|
2936
|
-
style: { ...
|
|
2957
|
+
style: { ...on[t], ...a },
|
|
2937
2958
|
...i,
|
|
2938
2959
|
children: e
|
|
2939
2960
|
}
|
|
@@ -2973,7 +2994,7 @@ const re = ({ children: e, className: t, style: n, ...a }) => /* @__PURE__ */ r(
|
|
|
2973
2994
|
]
|
|
2974
2995
|
}
|
|
2975
2996
|
) });
|
|
2976
|
-
},
|
|
2997
|
+
}, Nt = yt(
|
|
2977
2998
|
({ label: e, error: t, helperText: n, options: a, placeholder: i, className: s, style: c, ...d }, y) => /* @__PURE__ */ o("div", { className: "w-full", children: [
|
|
2978
2999
|
e && /* @__PURE__ */ o(
|
|
2979
3000
|
"label",
|
|
@@ -3039,8 +3060,8 @@ const re = ({ children: e, className: t, style: n, ...a }) => /* @__PURE__ */ r(
|
|
|
3039
3060
|
!t && n && /* @__PURE__ */ r("p", { className: "mt-1 text-sm", style: { color: "var(--metakyc-text-secondary, #6b7280)" }, children: n })
|
|
3040
3061
|
] })
|
|
3041
3062
|
);
|
|
3042
|
-
|
|
3043
|
-
const
|
|
3063
|
+
Nt.displayName = "Select";
|
|
3064
|
+
const At = 280, sn = ({
|
|
3044
3065
|
label: e,
|
|
3045
3066
|
value: t,
|
|
3046
3067
|
onChange: n,
|
|
@@ -3058,12 +3079,12 @@ const Et = 280, rn = ({
|
|
|
3058
3079
|
primaryColor: "#2563eb",
|
|
3059
3080
|
primaryLight: "#eff6ff",
|
|
3060
3081
|
hoverBg: "#f9fafb"
|
|
3061
|
-
}), z = de(null), Q = de(null), M = de(null),
|
|
3082
|
+
}), z = de(null), Q = de(null), M = de(null), j = ae(() => {
|
|
3062
3083
|
if (!Q.current) return null;
|
|
3063
|
-
const F = Q.current.getBoundingClientRect(), B = window.innerHeight - F.bottom <
|
|
3084
|
+
const F = Q.current.getBoundingClientRect(), B = window.innerHeight - F.bottom < At && F.top > At;
|
|
3064
3085
|
return { top: B ? F.top : F.bottom + 4, left: F.left, width: F.width, openUp: B };
|
|
3065
3086
|
}, []), K = ae(() => {
|
|
3066
|
-
const F = getComputedStyle(document.documentElement), U = (
|
|
3087
|
+
const F = getComputedStyle(document.documentElement), U = (H, fe) => F.getPropertyValue(H).trim() || fe, B = U("--metakyc-input-bg", U("--metakyc-background", "#ffffff"));
|
|
3067
3088
|
N({
|
|
3068
3089
|
bg: B,
|
|
3069
3090
|
borderColor: U("--metakyc-input-border", U("--metakyc-border", "#d1d5db")),
|
|
@@ -3076,29 +3097,29 @@ const Et = 280, rn = ({
|
|
|
3076
3097
|
}, []), ee = ae(() => {
|
|
3077
3098
|
if (y) return;
|
|
3078
3099
|
K();
|
|
3079
|
-
const F =
|
|
3100
|
+
const F = j();
|
|
3080
3101
|
F && T(F), b(!0);
|
|
3081
|
-
}, [y,
|
|
3102
|
+
}, [y, j, K]), E = ae(() => {
|
|
3082
3103
|
b(!1), v("");
|
|
3083
3104
|
}, []);
|
|
3084
3105
|
ge(() => {
|
|
3085
3106
|
if (!p) return;
|
|
3086
3107
|
const F = (U) => {
|
|
3087
|
-
var
|
|
3108
|
+
var H, fe;
|
|
3088
3109
|
const B = U.target;
|
|
3089
|
-
!((
|
|
3110
|
+
!((H = z.current) != null && H.contains(B)) && !((fe = M.current) != null && fe.contains(B)) && E();
|
|
3090
3111
|
};
|
|
3091
3112
|
return document.addEventListener("mousedown", F), () => document.removeEventListener("mousedown", F);
|
|
3092
3113
|
}, [p, E]), ge(() => {
|
|
3093
3114
|
if (!p) return;
|
|
3094
3115
|
const F = () => {
|
|
3095
|
-
const U =
|
|
3116
|
+
const U = j();
|
|
3096
3117
|
U && T(U);
|
|
3097
3118
|
};
|
|
3098
3119
|
return window.addEventListener("scroll", F, !0), window.addEventListener("resize", F), () => {
|
|
3099
3120
|
window.removeEventListener("scroll", F, !0), window.removeEventListener("resize", F);
|
|
3100
3121
|
};
|
|
3101
|
-
}, [p,
|
|
3122
|
+
}, [p, j]);
|
|
3102
3123
|
const g = a.filter(
|
|
3103
3124
|
(F) => F.label.toLowerCase().includes(P.toLowerCase())
|
|
3104
3125
|
), $ = (F) => {
|
|
@@ -3305,9 +3326,9 @@ const Et = 280, rn = ({
|
|
|
3305
3326
|
]
|
|
3306
3327
|
}
|
|
3307
3328
|
),
|
|
3308
|
-
typeof document < "u" && ve ?
|
|
3329
|
+
typeof document < "u" && ve ? Ct(ve, document.body) : null
|
|
3309
3330
|
] });
|
|
3310
|
-
},
|
|
3331
|
+
}, Tt = 260, Ve = ({
|
|
3311
3332
|
label: e,
|
|
3312
3333
|
error: t,
|
|
3313
3334
|
helperText: n,
|
|
@@ -3329,7 +3350,7 @@ const Et = 280, rn = ({
|
|
|
3329
3350
|
primary: "#2563eb",
|
|
3330
3351
|
primaryLight: "#eff6ff",
|
|
3331
3352
|
hoverBg: "#f9fafb"
|
|
3332
|
-
}),
|
|
3353
|
+
}), j = ae(() => {
|
|
3333
3354
|
const R = getComputedStyle(document.documentElement), te = (oe, Ne) => R.getPropertyValue(oe).trim() || Ne, ye = te("--metakyc-input-bg", te("--metakyc-background", "#ffffff"));
|
|
3334
3355
|
M({
|
|
3335
3356
|
bg: ye,
|
|
@@ -3342,7 +3363,7 @@ const Et = 280, rn = ({
|
|
|
3342
3363
|
});
|
|
3343
3364
|
}, []), K = de(null), ee = de(null), E = de(null), g = de(null), $ = ae(() => {
|
|
3344
3365
|
if (!ee.current) return null;
|
|
3345
|
-
const R = ee.current.getBoundingClientRect(), ye = window.innerHeight - R.bottom <
|
|
3366
|
+
const R = ee.current.getBoundingClientRect(), ye = window.innerHeight - R.bottom < Tt && R.top > Tt;
|
|
3346
3367
|
return {
|
|
3347
3368
|
top: ye ? R.top : R.bottom + 4,
|
|
3348
3369
|
left: R.left,
|
|
@@ -3351,10 +3372,10 @@ const Et = 280, rn = ({
|
|
|
3351
3372
|
};
|
|
3352
3373
|
}, []), V = ae(() => {
|
|
3353
3374
|
if (P) return;
|
|
3354
|
-
|
|
3375
|
+
j();
|
|
3355
3376
|
const R = $();
|
|
3356
3377
|
R && z(R), A(!0);
|
|
3357
|
-
}, [P, $,
|
|
3378
|
+
}, [P, $, j]), G = ae(() => {
|
|
3358
3379
|
A(!1), w("");
|
|
3359
3380
|
}, []), _ = () => v ? G() : V();
|
|
3360
3381
|
ge(() => {
|
|
@@ -3384,7 +3405,7 @@ const Et = 280, rn = ({
|
|
|
3384
3405
|
(R) => R.label.toLowerCase().includes(T.toLowerCase()) || R.value.toLowerCase().includes(T.toLowerCase())
|
|
3385
3406
|
), ie = (fe = a.find((R) => R.value === s)) == null ? void 0 : fe.label, Y = (R, te) => {
|
|
3386
3407
|
P || te || (c(R), G());
|
|
3387
|
-
}, { bg: we, border: pe, text: me, textSecondary: ve, primary: F, primaryLight: U, hoverBg: B } = Q,
|
|
3408
|
+
}, { bg: we, border: pe, text: me, textSecondary: ve, primary: F, primaryLight: U, hoverBg: B } = Q, H = v && N && /* @__PURE__ */ o(
|
|
3388
3409
|
"div",
|
|
3389
3410
|
{
|
|
3390
3411
|
ref: E,
|
|
@@ -3531,7 +3552,7 @@ const Et = 280, rn = ({
|
|
|
3531
3552
|
]
|
|
3532
3553
|
}
|
|
3533
3554
|
),
|
|
3534
|
-
typeof document < "u" &&
|
|
3555
|
+
typeof document < "u" && H ? Ct(H, document.body) : null,
|
|
3535
3556
|
t && /* @__PURE__ */ r("p", { className: "mt-1 text-sm", style: { color: "var(--metakyc-error, #ef4444)" }, children: t }),
|
|
3536
3557
|
!t && n && /* @__PURE__ */ r("p", { className: "mt-1 text-sm", style: { color: "var(--metakyc-text-secondary, #6b7280)" }, children: n })
|
|
3537
3558
|
]
|
|
@@ -3539,11 +3560,11 @@ const Et = 280, rn = ({
|
|
|
3539
3560
|
);
|
|
3540
3561
|
};
|
|
3541
3562
|
Ve.displayName = "SearchableSelect";
|
|
3542
|
-
function
|
|
3563
|
+
function ln(e) {
|
|
3543
3564
|
const t = e.type;
|
|
3544
3565
|
return t.startsWith("image/") ? "image" : t === "application/pdf" ? "pdf" : "file";
|
|
3545
3566
|
}
|
|
3546
|
-
const
|
|
3567
|
+
const cn = ({
|
|
3547
3568
|
label: e,
|
|
3548
3569
|
subtitle: t,
|
|
3549
3570
|
error: n,
|
|
@@ -3560,7 +3581,7 @@ const an = ({
|
|
|
3560
3581
|
A(null);
|
|
3561
3582
|
const g = Array.from(E);
|
|
3562
3583
|
if (s && g.filter((V) => V.size > s).length > 0) {
|
|
3563
|
-
A(`File exceeds the maximum size of ${
|
|
3584
|
+
A(`File exceeds the maximum size of ${vt(s)}`);
|
|
3564
3585
|
return;
|
|
3565
3586
|
}
|
|
3566
3587
|
d == null || d(i ? [...y, ...g] : [g[0]]);
|
|
@@ -3573,7 +3594,7 @@ const an = ({
|
|
|
3573
3594
|
}, [w]), M = () => {
|
|
3574
3595
|
var E;
|
|
3575
3596
|
(E = T.current) == null || E.click();
|
|
3576
|
-
},
|
|
3597
|
+
}, j = (E) => {
|
|
3577
3598
|
A(null);
|
|
3578
3599
|
const g = y.filter(($, V) => V !== E);
|
|
3579
3600
|
d == null || d(g);
|
|
@@ -3674,7 +3695,7 @@ const an = ({
|
|
|
3674
3695
|
a && s && /* @__PURE__ */ r("span", { children: " · " }),
|
|
3675
3696
|
s && /* @__PURE__ */ o("span", { children: [
|
|
3676
3697
|
"Max ",
|
|
3677
|
-
|
|
3698
|
+
vt(s)
|
|
3678
3699
|
] })
|
|
3679
3700
|
] })
|
|
3680
3701
|
] })
|
|
@@ -3683,7 +3704,7 @@ const an = ({
|
|
|
3683
3704
|
}
|
|
3684
3705
|
),
|
|
3685
3706
|
ee && /* @__PURE__ */ r("div", { style: { marginTop: "12px", display: "flex", flexDirection: "column", gap: "8px" }, children: y.map((E, g) => {
|
|
3686
|
-
const $ =
|
|
3707
|
+
const $ = ln(E), V = $ === "image", G = V ? URL.createObjectURL(E) : null;
|
|
3687
3708
|
return /* @__PURE__ */ o(
|
|
3688
3709
|
"div",
|
|
3689
3710
|
{
|
|
@@ -3742,14 +3763,14 @@ const an = ({
|
|
|
3742
3763
|
textOverflow: "ellipsis",
|
|
3743
3764
|
whiteSpace: "nowrap"
|
|
3744
3765
|
}, children: E.name }),
|
|
3745
|
-
/* @__PURE__ */ r("p", { style: { fontSize: "12px", color: "var(--metakyc-text-muted, #9ca3af)", margin: 0, marginTop: "2px" }, children:
|
|
3766
|
+
/* @__PURE__ */ r("p", { style: { fontSize: "12px", color: "var(--metakyc-text-muted, #9ca3af)", margin: 0, marginTop: "2px" }, children: vt(E.size) })
|
|
3746
3767
|
] }),
|
|
3747
3768
|
/* @__PURE__ */ r(
|
|
3748
3769
|
"button",
|
|
3749
3770
|
{
|
|
3750
3771
|
type: "button",
|
|
3751
3772
|
onClick: (_) => {
|
|
3752
|
-
_.stopPropagation(),
|
|
3773
|
+
_.stopPropagation(), j(g);
|
|
3753
3774
|
},
|
|
3754
3775
|
style: {
|
|
3755
3776
|
display: "flex",
|
|
@@ -3785,7 +3806,7 @@ const an = ({
|
|
|
3785
3806
|
}) }),
|
|
3786
3807
|
K && /* @__PURE__ */ r("p", { style: { fontSize: "13px", color: "var(--metakyc-danger, #ef4444)", marginTop: "6px" }, children: K })
|
|
3787
3808
|
] });
|
|
3788
|
-
},
|
|
3809
|
+
}, dn = yt(
|
|
3789
3810
|
({ countryCode: e = "+1", onCountryCodeChange: t, className: n, ...a }, i) => /* @__PURE__ */ o("div", { className: "w-full", children: [
|
|
3790
3811
|
a.label && /* @__PURE__ */ o(
|
|
3791
3812
|
"label",
|
|
@@ -3832,28 +3853,28 @@ const an = ({
|
|
|
3832
3853
|
a.error && /* @__PURE__ */ r("p", { className: "mt-1 text-sm text-danger-500", children: a.error })
|
|
3833
3854
|
] })
|
|
3834
3855
|
);
|
|
3835
|
-
|
|
3856
|
+
dn.displayName = "PhoneInput";
|
|
3836
3857
|
/**
|
|
3837
3858
|
* @license lucide-react v0.574.0 - ISC
|
|
3838
3859
|
*
|
|
3839
3860
|
* This source code is licensed under the ISC license.
|
|
3840
3861
|
* See the LICENSE file in the root directory of this source tree.
|
|
3841
3862
|
*/
|
|
3842
|
-
const
|
|
3863
|
+
const jt = (...e) => e.filter((t, n, a) => !!t && t.trim() !== "" && a.indexOf(t) === n).join(" ").trim();
|
|
3843
3864
|
/**
|
|
3844
3865
|
* @license lucide-react v0.574.0 - ISC
|
|
3845
3866
|
*
|
|
3846
3867
|
* This source code is licensed under the ISC license.
|
|
3847
3868
|
* See the LICENSE file in the root directory of this source tree.
|
|
3848
3869
|
*/
|
|
3849
|
-
const
|
|
3870
|
+
const un = (e) => e.replace(/([a-z0-9])([A-Z])/g, "$1-$2").toLowerCase();
|
|
3850
3871
|
/**
|
|
3851
3872
|
* @license lucide-react v0.574.0 - ISC
|
|
3852
3873
|
*
|
|
3853
3874
|
* This source code is licensed under the ISC license.
|
|
3854
3875
|
* See the LICENSE file in the root directory of this source tree.
|
|
3855
3876
|
*/
|
|
3856
|
-
const
|
|
3877
|
+
const pn = (e) => e.replace(
|
|
3857
3878
|
/^([A-Z])|[\s-_]+(\w)/g,
|
|
3858
3879
|
(t, n, a) => a ? a.toUpperCase() : n.toLowerCase()
|
|
3859
3880
|
);
|
|
@@ -3863,8 +3884,8 @@ const ln = (e) => e.replace(
|
|
|
3863
3884
|
* This source code is licensed under the ISC license.
|
|
3864
3885
|
* See the LICENSE file in the root directory of this source tree.
|
|
3865
3886
|
*/
|
|
3866
|
-
const
|
|
3867
|
-
const t =
|
|
3887
|
+
const Pt = (e) => {
|
|
3888
|
+
const t = pn(e);
|
|
3868
3889
|
return t.charAt(0).toUpperCase() + t.slice(1);
|
|
3869
3890
|
};
|
|
3870
3891
|
/**
|
|
@@ -3873,7 +3894,7 @@ const At = (e) => {
|
|
|
3873
3894
|
* This source code is licensed under the ISC license.
|
|
3874
3895
|
* See the LICENSE file in the root directory of this source tree.
|
|
3875
3896
|
*/
|
|
3876
|
-
var
|
|
3897
|
+
var mn = {
|
|
3877
3898
|
xmlns: "http://www.w3.org/2000/svg",
|
|
3878
3899
|
width: 24,
|
|
3879
3900
|
height: 24,
|
|
@@ -3890,7 +3911,7 @@ var cn = {
|
|
|
3890
3911
|
* This source code is licensed under the ISC license.
|
|
3891
3912
|
* See the LICENSE file in the root directory of this source tree.
|
|
3892
3913
|
*/
|
|
3893
|
-
const
|
|
3914
|
+
const yn = (e) => {
|
|
3894
3915
|
for (const t in e)
|
|
3895
3916
|
if (t.startsWith("aria-") || t === "role" || t === "title")
|
|
3896
3917
|
return !0;
|
|
@@ -3902,7 +3923,7 @@ const dn = (e) => {
|
|
|
3902
3923
|
* This source code is licensed under the ISC license.
|
|
3903
3924
|
* See the LICENSE file in the root directory of this source tree.
|
|
3904
3925
|
*/
|
|
3905
|
-
const
|
|
3926
|
+
const hn = yt(
|
|
3906
3927
|
({
|
|
3907
3928
|
color: e = "currentColor",
|
|
3908
3929
|
size: t = 24,
|
|
@@ -3912,21 +3933,21 @@ const un = yt(
|
|
|
3912
3933
|
children: s,
|
|
3913
3934
|
iconNode: c,
|
|
3914
3935
|
...d
|
|
3915
|
-
}, y) =>
|
|
3936
|
+
}, y) => St(
|
|
3916
3937
|
"svg",
|
|
3917
3938
|
{
|
|
3918
3939
|
ref: y,
|
|
3919
|
-
...
|
|
3940
|
+
...mn,
|
|
3920
3941
|
width: t,
|
|
3921
3942
|
height: t,
|
|
3922
3943
|
stroke: e,
|
|
3923
3944
|
strokeWidth: a ? Number(n) * 24 / Number(t) : n,
|
|
3924
|
-
className:
|
|
3925
|
-
...!s && !
|
|
3945
|
+
className: jt("lucide", i),
|
|
3946
|
+
...!s && !yn(d) && { "aria-hidden": "true" },
|
|
3926
3947
|
...d
|
|
3927
3948
|
},
|
|
3928
3949
|
[
|
|
3929
|
-
...c.map(([p, b]) =>
|
|
3950
|
+
...c.map(([p, b]) => St(p, b)),
|
|
3930
3951
|
...Array.isArray(s) ? s : [s]
|
|
3931
3952
|
]
|
|
3932
3953
|
)
|
|
@@ -3937,20 +3958,20 @@ const un = yt(
|
|
|
3937
3958
|
* This source code is licensed under the ISC license.
|
|
3938
3959
|
* See the LICENSE file in the root directory of this source tree.
|
|
3939
3960
|
*/
|
|
3940
|
-
const
|
|
3961
|
+
const Ht = (e, t) => {
|
|
3941
3962
|
const n = yt(
|
|
3942
|
-
({ className: a, ...i }, s) =>
|
|
3963
|
+
({ className: a, ...i }, s) => St(hn, {
|
|
3943
3964
|
ref: s,
|
|
3944
3965
|
iconNode: t,
|
|
3945
|
-
className:
|
|
3946
|
-
`lucide-${
|
|
3966
|
+
className: jt(
|
|
3967
|
+
`lucide-${un(Pt(e))}`,
|
|
3947
3968
|
`lucide-${e}`,
|
|
3948
3969
|
a
|
|
3949
3970
|
),
|
|
3950
3971
|
...i
|
|
3951
3972
|
})
|
|
3952
3973
|
);
|
|
3953
|
-
return n.displayName =
|
|
3974
|
+
return n.displayName = Pt(e), n;
|
|
3954
3975
|
};
|
|
3955
3976
|
/**
|
|
3956
3977
|
* @license lucide-react v0.574.0 - ISC
|
|
@@ -3958,15 +3979,15 @@ const _t = (e, t) => {
|
|
|
3958
3979
|
* This source code is licensed under the ISC license.
|
|
3959
3980
|
* See the LICENSE file in the root directory of this source tree.
|
|
3960
3981
|
*/
|
|
3961
|
-
const
|
|
3982
|
+
const fn = [["path", { d: "m15 18-6-6 6-6", key: "1wnfg3" }]], Wt = Ht("chevron-left", fn);
|
|
3962
3983
|
/**
|
|
3963
3984
|
* @license lucide-react v0.574.0 - ISC
|
|
3964
3985
|
*
|
|
3965
3986
|
* This source code is licensed under the ISC license.
|
|
3966
3987
|
* See the LICENSE file in the root directory of this source tree.
|
|
3967
3988
|
*/
|
|
3968
|
-
const
|
|
3969
|
-
function
|
|
3989
|
+
const gn = [["path", { d: "m9 18 6-6-6-6", key: "mthhwq" }]], Ut = Ht("chevron-right", gn);
|
|
3990
|
+
function bn(e, t) {
|
|
3970
3991
|
const n = !t || t.length === 0 || t.every((a) => !a || !a.trim());
|
|
3971
3992
|
if (e.isRequired && n)
|
|
3972
3993
|
return e.errorMessage || "This field is required";
|
|
@@ -3995,7 +4016,7 @@ function yn(e, t) {
|
|
|
3995
4016
|
}
|
|
3996
4017
|
return null;
|
|
3997
4018
|
}
|
|
3998
|
-
function
|
|
4019
|
+
function xn(e) {
|
|
3999
4020
|
const t = e.flatMap(
|
|
4000
4021
|
(a, i) => (a.questions ?? []).map((s, c) => ({ question: s, groupIndex: i, qIdx: c }))
|
|
4001
4022
|
), n = /* @__PURE__ */ new Map();
|
|
@@ -4005,17 +4026,17 @@ function hn(e) {
|
|
|
4005
4026
|
}
|
|
4006
4027
|
return Array.from(n.entries()).sort(([a], [i]) => a - i).map(([, a]) => a);
|
|
4007
4028
|
}
|
|
4008
|
-
const
|
|
4029
|
+
const vn = ({
|
|
4009
4030
|
applicantId: e,
|
|
4010
4031
|
onComplete: t,
|
|
4011
4032
|
onBack: n
|
|
4012
4033
|
}) => {
|
|
4013
|
-
const { questionnaire: a, initialAnswers: i, isLoading: s, isSubmitting: c, error: d, submit: y } =
|
|
4034
|
+
const { questionnaire: a, initialAnswers: i, isLoading: s, isSubmitting: c, error: d, submit: y } = Zr(e), [p, b] = k({}), [P, v] = k({}), [A, T] = k(0);
|
|
4014
4035
|
ke.useEffect(() => {
|
|
4015
4036
|
i && Object.keys(i).length > 0 && Object.keys(p).length === 0 && b(i);
|
|
4016
4037
|
}, [i]);
|
|
4017
4038
|
const w = De(
|
|
4018
|
-
() => a ?
|
|
4039
|
+
() => a ? xn(a.questionGroups) : [],
|
|
4019
4040
|
[a]
|
|
4020
4041
|
), N = A === w.length - 1, z = w[A] ?? [], Q = ae((E, g) => {
|
|
4021
4042
|
b(($) => ({ ...$, [E]: g })), v(($) => {
|
|
@@ -4025,11 +4046,11 @@ const fn = ({
|
|
|
4025
4046
|
}, []), M = ae(() => {
|
|
4026
4047
|
const E = {};
|
|
4027
4048
|
for (const { question: g } of z) {
|
|
4028
|
-
const $ =
|
|
4049
|
+
const $ = bn(g, p[g.id] ?? []);
|
|
4029
4050
|
$ && (E[g.id] = $);
|
|
4030
4051
|
}
|
|
4031
4052
|
return v((g) => ({ ...g, ...E })), Object.keys(E).length === 0;
|
|
4032
|
-
}, [z, p]),
|
|
4053
|
+
}, [z, p]), j = () => {
|
|
4033
4054
|
M() && T((E) => E + 1);
|
|
4034
4055
|
}, K = () => {
|
|
4035
4056
|
A > 0 ? T((E) => E - 1) : n == null || n();
|
|
@@ -4080,7 +4101,7 @@ const fn = ({
|
|
|
4080
4101
|
] })
|
|
4081
4102
|
] }),
|
|
4082
4103
|
/* @__PURE__ */ r(ne, { className: "space-y-6", children: z.map(({ question: E }) => /* @__PURE__ */ r(
|
|
4083
|
-
|
|
4104
|
+
kn,
|
|
4084
4105
|
{
|
|
4085
4106
|
question: E,
|
|
4086
4107
|
value: p[E.id] ?? [],
|
|
@@ -4098,7 +4119,7 @@ const fn = ({
|
|
|
4098
4119
|
onClick: K,
|
|
4099
4120
|
style: { display: "flex", alignItems: "center", gap: "4px" },
|
|
4100
4121
|
children: [
|
|
4101
|
-
/* @__PURE__ */ r(
|
|
4122
|
+
/* @__PURE__ */ r(Wt, { size: 14 }),
|
|
4102
4123
|
A > 0 ? "Previous" : "Back"
|
|
4103
4124
|
]
|
|
4104
4125
|
}
|
|
@@ -4115,18 +4136,18 @@ const fn = ({
|
|
|
4115
4136
|
Z,
|
|
4116
4137
|
{
|
|
4117
4138
|
type: "button",
|
|
4118
|
-
onClick:
|
|
4139
|
+
onClick: j,
|
|
4119
4140
|
style: { display: "flex", alignItems: "center", gap: "4px" },
|
|
4120
4141
|
children: [
|
|
4121
4142
|
"Next",
|
|
4122
|
-
/* @__PURE__ */ r(
|
|
4143
|
+
/* @__PURE__ */ r(Ut, { size: 14 })
|
|
4123
4144
|
]
|
|
4124
4145
|
}
|
|
4125
4146
|
)
|
|
4126
4147
|
] }),
|
|
4127
4148
|
d && /* @__PURE__ */ r("div", { className: "mx-6 mb-4 p-3 bg-red-50 border border-red-200 rounded", children: /* @__PURE__ */ r("p", { className: "text-red-600 text-sm", children: d.message }) })
|
|
4128
4149
|
] }) : null;
|
|
4129
|
-
},
|
|
4150
|
+
}, kn = ({ question: e, value: t, error: n, onChange: a }) => {
|
|
4130
4151
|
var c;
|
|
4131
4152
|
const s = (((c = e.defaultAnswers) == null ? void 0 : c.length) ?? 0) > 0 ? e.showAsDropdown ? e.canMultipleAnswer ? "multi-select" : "single-select" : e.canMultipleAnswer ? "checkbox" : "radio" : "text";
|
|
4132
4153
|
return /* @__PURE__ */ o("div", { className: "space-y-2", children: [
|
|
@@ -4147,7 +4168,7 @@ const fn = ({
|
|
|
4147
4168
|
}
|
|
4148
4169
|
),
|
|
4149
4170
|
s === "single-select" && /* @__PURE__ */ r(
|
|
4150
|
-
|
|
4171
|
+
Nt,
|
|
4151
4172
|
{
|
|
4152
4173
|
value: t[0] ?? "",
|
|
4153
4174
|
onChange: (d) => a([d.target.value]),
|
|
@@ -4219,7 +4240,7 @@ const fn = ({
|
|
|
4219
4240
|
n && s === "text" && null
|
|
4220
4241
|
] });
|
|
4221
4242
|
};
|
|
4222
|
-
function
|
|
4243
|
+
function wn(e) {
|
|
4223
4244
|
const t = /* @__PURE__ */ new Map();
|
|
4224
4245
|
for (const n of e) {
|
|
4225
4246
|
const a = n.pageNumber != null && n.pageNumber > 0 ? n.pageNumber : 1;
|
|
@@ -4227,25 +4248,25 @@ function bn(e) {
|
|
|
4227
4248
|
}
|
|
4228
4249
|
return Array.from(t.entries()).sort(([n], [a]) => n - a).map(([, n]) => n);
|
|
4229
4250
|
}
|
|
4230
|
-
const
|
|
4251
|
+
const Sn = ({
|
|
4231
4252
|
applicantId: e,
|
|
4232
4253
|
onComplete: t,
|
|
4233
4254
|
onBack: n
|
|
4234
4255
|
}) => {
|
|
4235
|
-
const { uploadDocument: a, isLoading: i, isSubmitting: s, error: c, submit: d } =
|
|
4236
|
-
() => a ?
|
|
4256
|
+
const { uploadDocument: a, isLoading: i, isSubmitting: s, error: c, submit: d } = Xr(e), [y, p] = k({}), [b, P] = k(null), [v, A] = k(0), [T, w] = k({}), N = De(
|
|
4257
|
+
() => a ? wn(a.uploadDocumentFiles) : [],
|
|
4237
4258
|
[a]
|
|
4238
|
-
), z = N[v] ?? [], Q = v === N.length - 1, M = N.length,
|
|
4259
|
+
), z = N[v] ?? [], Q = v === N.length - 1, M = N.length, j = ae(() => {
|
|
4239
4260
|
const g = {};
|
|
4240
4261
|
for (const $ of z)
|
|
4241
4262
|
$.isRequired && (y[$.id] || []).length === 0 && (g[$.id] = `${$.displayName} is required`);
|
|
4242
4263
|
return w(g), Object.keys(g).length === 0;
|
|
4243
4264
|
}, [z, y]), K = () => {
|
|
4244
|
-
|
|
4265
|
+
j() && (A((g) => g + 1), w({}));
|
|
4245
4266
|
}, ee = () => {
|
|
4246
4267
|
v > 0 ? (A((g) => g - 1), w({})) : n == null || n();
|
|
4247
4268
|
}, E = async () => {
|
|
4248
|
-
if (!(!
|
|
4269
|
+
if (!(!j() || !a)) {
|
|
4249
4270
|
P(null);
|
|
4250
4271
|
try {
|
|
4251
4272
|
const g = await Promise.all(
|
|
@@ -4253,7 +4274,7 @@ const xn = ({
|
|
|
4253
4274
|
const G = y[V.id] || [], _ = await Promise.all(
|
|
4254
4275
|
G.map(async (J) => ({
|
|
4255
4276
|
fileName: J.name,
|
|
4256
|
-
fileData: await
|
|
4277
|
+
fileData: await Kr(J)
|
|
4257
4278
|
}))
|
|
4258
4279
|
);
|
|
4259
4280
|
return {
|
|
@@ -4375,7 +4396,7 @@ const xn = ({
|
|
|
4375
4396
|
}, children: a.description })
|
|
4376
4397
|
] }),
|
|
4377
4398
|
/* @__PURE__ */ r(ne, { children: /* @__PURE__ */ r("div", { style: { display: "flex", flexDirection: "column", gap: "24px" }, children: z.map((g) => /* @__PURE__ */ r(
|
|
4378
|
-
|
|
4399
|
+
cn,
|
|
4379
4400
|
{
|
|
4380
4401
|
label: g.displayName,
|
|
4381
4402
|
subtitle: g.subtitle,
|
|
@@ -4444,8 +4465,8 @@ const xn = ({
|
|
|
4444
4465
|
)
|
|
4445
4466
|
] }) })
|
|
4446
4467
|
] }) : null;
|
|
4447
|
-
},
|
|
4448
|
-
const { overview: a, isLoading: i, isSubmitting: s, error: c, passOverview: d } =
|
|
4468
|
+
}, Cn = ({ applicantId: e, onComplete: t, onBack: n }) => {
|
|
4469
|
+
const { overview: a, isLoading: i, isSubmitting: s, error: c, passOverview: d } = en(e), y = async () => {
|
|
4449
4470
|
await d(), t == null || t();
|
|
4450
4471
|
};
|
|
4451
4472
|
return i ? /* @__PURE__ */ r(re, { children: /* @__PURE__ */ r(ne, { children: /* @__PURE__ */ r(Me, { className: "my-8" }) }) }) : c ? /* @__PURE__ */ r(re, { children: /* @__PURE__ */ r(ne, { children: /* @__PURE__ */ o("p", { className: "text-danger-500", children: [
|
|
@@ -4488,7 +4509,7 @@ const xn = ({
|
|
|
4488
4509
|
] })
|
|
4489
4510
|
] }) : null;
|
|
4490
4511
|
};
|
|
4491
|
-
function
|
|
4512
|
+
function Nn(e) {
|
|
4492
4513
|
const t = (e ?? "en").toLowerCase().replace("_", "-");
|
|
4493
4514
|
try {
|
|
4494
4515
|
return Intl.NumberFormat.supportedLocalesOf([t]), t;
|
|
@@ -4496,11 +4517,11 @@ function kn(e) {
|
|
|
4496
4517
|
return "en";
|
|
4497
4518
|
}
|
|
4498
4519
|
}
|
|
4499
|
-
function
|
|
4520
|
+
function In(e) {
|
|
4500
4521
|
return e.valueDataType === qe.Money && Array.isArray(e.defaultValues) && e.defaultValues.length > 0;
|
|
4501
4522
|
}
|
|
4502
|
-
function
|
|
4503
|
-
const n = new Intl.NumberFormat(
|
|
4523
|
+
function Rn(e, t) {
|
|
4524
|
+
const n = new Intl.NumberFormat(Nn(t), {
|
|
4504
4525
|
minimumFractionDigits: 0,
|
|
4505
4526
|
maximumFractionDigits: 2
|
|
4506
4527
|
});
|
|
@@ -4509,7 +4530,7 @@ function Sn(e, t) {
|
|
|
4509
4530
|
return isNaN(i) ? a : n.format(i);
|
|
4510
4531
|
});
|
|
4511
4532
|
}
|
|
4512
|
-
function
|
|
4533
|
+
function En(e, t) {
|
|
4513
4534
|
const n = !t || t.length === 0 || t.every((a) => !a || !a.trim());
|
|
4514
4535
|
if (e.isRequired && n)
|
|
4515
4536
|
return e.errorMessage || `${e.displayName} is required`;
|
|
@@ -4539,29 +4560,29 @@ function Cn(e, t) {
|
|
|
4539
4560
|
}
|
|
4540
4561
|
return null;
|
|
4541
4562
|
}
|
|
4542
|
-
function
|
|
4563
|
+
function Fn(e) {
|
|
4543
4564
|
const t = /* @__PURE__ */ new Map();
|
|
4544
4565
|
return e.forEach((n, a) => {
|
|
4545
4566
|
const i = n.pageNumber != null && n.pageNumber > 0 ? n.pageNumber : 1;
|
|
4546
4567
|
t.has(i) || t.set(i, []), t.get(i).push({ criterion: n, idx: a });
|
|
4547
4568
|
}), Array.from(t.entries()).sort(([n], [a]) => n - a).map(([, n]) => n);
|
|
4548
4569
|
}
|
|
4549
|
-
function
|
|
4570
|
+
function An(e) {
|
|
4550
4571
|
return e.builtInType === 1 ? "country" : !e.defaultValues || e.defaultValues.length === 0 ? "text" : e.multipleValue ? "checkbox" : "radio";
|
|
4551
4572
|
}
|
|
4552
|
-
const
|
|
4573
|
+
const Tn = ({
|
|
4553
4574
|
applicantId: e,
|
|
4554
4575
|
onComplete: t,
|
|
4555
4576
|
onBack: n
|
|
4556
4577
|
}) => {
|
|
4557
|
-
const { config: a } = Te(), i = a.locale ?? "en", { criteria: s, initialAnswers: c, isLoading: d, isSubmitting: y, error: p, submit: b } =
|
|
4578
|
+
const { config: a } = Te(), i = a.locale ?? "en", { criteria: s, initialAnswers: c, isLoading: d, isSubmitting: y, error: p, submit: b } = rn(e), [P, v] = k({}), [A, T] = k({}), [w, N] = k(0), [z, Q] = k(!1);
|
|
4558
4579
|
ke.useEffect(() => {
|
|
4559
4580
|
c && Object.keys(c).length > 0 && Object.keys(P).length === 0 && v(c);
|
|
4560
4581
|
}, [c]);
|
|
4561
4582
|
const M = De(
|
|
4562
|
-
() => s && s.length > 0 ?
|
|
4583
|
+
() => s && s.length > 0 ? Fn(s) : [],
|
|
4563
4584
|
[s]
|
|
4564
|
-
),
|
|
4585
|
+
), j = w === M.length - 1, K = M[w] ?? [];
|
|
4565
4586
|
ke.useEffect(() => {
|
|
4566
4587
|
!d && s && s.length === 0 && !z && !y && (Q(!0), b({ applicantId: e, criteriaValueInputs: [] }).then(() => t == null ? void 0 : t()).catch(console.error));
|
|
4567
4588
|
}, [d, s, z, y, b, e, t]);
|
|
@@ -4573,7 +4594,7 @@ const Rn = ({
|
|
|
4573
4594
|
}, []), E = ae(() => {
|
|
4574
4595
|
const G = {};
|
|
4575
4596
|
for (const { criterion: _ } of K) {
|
|
4576
|
-
const J =
|
|
4597
|
+
const J = En(_, P[_.id] ?? []);
|
|
4577
4598
|
J && (G[_.id] = J);
|
|
4578
4599
|
}
|
|
4579
4600
|
return T((_) => ({ ..._, ...G })), Object.keys(G).length === 0;
|
|
@@ -4628,7 +4649,7 @@ const Rn = ({
|
|
|
4628
4649
|
] })
|
|
4629
4650
|
] }),
|
|
4630
4651
|
/* @__PURE__ */ r(ne, { className: "space-y-6", children: K.map(({ criterion: G }) => /* @__PURE__ */ r(
|
|
4631
|
-
|
|
4652
|
+
Pn,
|
|
4632
4653
|
{
|
|
4633
4654
|
criterion: G,
|
|
4634
4655
|
value: P[G.id] ?? [],
|
|
@@ -4647,12 +4668,12 @@ const Rn = ({
|
|
|
4647
4668
|
onClick: $,
|
|
4648
4669
|
style: { display: "flex", alignItems: "center", gap: "4px" },
|
|
4649
4670
|
children: [
|
|
4650
|
-
/* @__PURE__ */ r(
|
|
4671
|
+
/* @__PURE__ */ r(Wt, { size: 14 }),
|
|
4651
4672
|
w > 0 ? "Previous" : "Back"
|
|
4652
4673
|
]
|
|
4653
4674
|
}
|
|
4654
4675
|
),
|
|
4655
|
-
|
|
4676
|
+
j ? /* @__PURE__ */ r(Z, { type: "button", isLoading: y, onClick: V, children: "Continue" }) : /* @__PURE__ */ o(
|
|
4656
4677
|
Z,
|
|
4657
4678
|
{
|
|
4658
4679
|
type: "button",
|
|
@@ -4660,15 +4681,15 @@ const Rn = ({
|
|
|
4660
4681
|
style: { display: "flex", alignItems: "center", gap: "4px" },
|
|
4661
4682
|
children: [
|
|
4662
4683
|
"Next",
|
|
4663
|
-
/* @__PURE__ */ r(
|
|
4684
|
+
/* @__PURE__ */ r(Ut, { size: 14 })
|
|
4664
4685
|
]
|
|
4665
4686
|
}
|
|
4666
4687
|
)
|
|
4667
4688
|
] }),
|
|
4668
4689
|
p && /* @__PURE__ */ r("div", { className: "mx-6 mb-4 p-3 bg-red-50 border border-red-200 rounded", children: /* @__PURE__ */ r("p", { className: "text-red-600 text-sm", children: p.message }) })
|
|
4669
4690
|
] }) : null;
|
|
4670
|
-
},
|
|
4671
|
-
const s =
|
|
4691
|
+
}, Pn = ({ criterion: e, value: t, error: n, locale: a, onChange: i }) => {
|
|
4692
|
+
const s = An(e), c = e.valueDataType === qe.Integer || e.valueDataType === qe.Money || e.valueDataType === qe.DigitOnly, d = In(e), y = (p) => d ? Rn(p, a) : p;
|
|
4672
4693
|
return /* @__PURE__ */ o("div", { className: "space-y-2", children: [
|
|
4673
4694
|
/* @__PURE__ */ o("label", { className: "block text-sm font-medium", style: { color: "var(--metakyc-text-primary, #111827)" }, children: [
|
|
4674
4695
|
e.displayName,
|
|
@@ -4752,7 +4773,7 @@ const Rn = ({
|
|
|
4752
4773
|
n && /* @__PURE__ */ r("p", { className: "text-sm text-danger-500", children: n })
|
|
4753
4774
|
] }),
|
|
4754
4775
|
s === "country" && /* @__PURE__ */ r(
|
|
4755
|
-
|
|
4776
|
+
Nt,
|
|
4756
4777
|
{
|
|
4757
4778
|
value: t[0] ?? "",
|
|
4758
4779
|
onChange: (p) => i([p.target.value]),
|
|
@@ -4769,7 +4790,7 @@ const Rn = ({
|
|
|
4769
4790
|
}
|
|
4770
4791
|
)
|
|
4771
4792
|
] });
|
|
4772
|
-
},
|
|
4793
|
+
}, Ln = ({
|
|
4773
4794
|
applicantId: e,
|
|
4774
4795
|
onComplete: t,
|
|
4775
4796
|
onBack: n
|
|
@@ -4911,28 +4932,28 @@ const Rn = ({
|
|
|
4911
4932
|
] })
|
|
4912
4933
|
] }) });
|
|
4913
4934
|
};
|
|
4914
|
-
function
|
|
4935
|
+
function Lt(e) {
|
|
4915
4936
|
const t = e.split(":").map(Number);
|
|
4916
4937
|
return t.length === 3 ? t[0] * 3600 + t[1] * 60 + t[2] : 0;
|
|
4917
4938
|
}
|
|
4918
|
-
function
|
|
4939
|
+
function kt(e) {
|
|
4919
4940
|
const t = Math.floor(e / 60), n = e % 60;
|
|
4920
4941
|
return `${t.toString().padStart(2, "0")}:${n.toString().padStart(2, "0")}`;
|
|
4921
4942
|
}
|
|
4922
|
-
const
|
|
4943
|
+
const Dn = ({
|
|
4923
4944
|
applicantId: e,
|
|
4924
4945
|
onComplete: t,
|
|
4925
4946
|
onBack: n
|
|
4926
4947
|
}) => {
|
|
4927
|
-
const { appropriatenessTestService: a } = Te(), [i, s] = k(null), [c, d] = k(!0), [y, p] = k(!1), [b, P] = k(null), [v, A] = k({}), [T, w] = k(0), [N, z] = k(!1), [Q, M] = k(!1), [
|
|
4948
|
+
const { appropriatenessTestService: a } = Te(), [i, s] = k(null), [c, d] = k(!0), [y, p] = k(!1), [b, P] = k(null), [v, A] = k({}), [T, w] = k(0), [N, z] = k(!1), [Q, M] = k(!1), [j, K] = k(0), [ee, E] = k(0), [g, $] = k(null);
|
|
4928
4949
|
ge(() => {
|
|
4929
4950
|
(async () => {
|
|
4930
4951
|
try {
|
|
4931
4952
|
d(!0), P(null);
|
|
4932
4953
|
const B = await a.getAppropriatenessTest(e);
|
|
4933
4954
|
if (s(B), B.waitTimeSpanForNextTry && B.waitTimeSpanForNextTry !== "00:00:00") {
|
|
4934
|
-
const
|
|
4935
|
-
|
|
4955
|
+
const H = Lt(B.waitTimeSpanForNextTry);
|
|
4956
|
+
H > 0 && K(H);
|
|
4936
4957
|
}
|
|
4937
4958
|
} catch (B) {
|
|
4938
4959
|
P(B.message || "Failed to load appropriateness test");
|
|
@@ -4943,48 +4964,48 @@ const An = ({
|
|
|
4943
4964
|
}, [e, a]), ge(() => {
|
|
4944
4965
|
if (!N || T <= 0) return;
|
|
4945
4966
|
const B = setInterval(() => {
|
|
4946
|
-
w((
|
|
4967
|
+
w((H) => H <= 1 ? (M(!0), 0) : H - 1);
|
|
4947
4968
|
}, 1e3);
|
|
4948
4969
|
return () => clearInterval(B);
|
|
4949
4970
|
}, [N, T]), ge(() => {
|
|
4950
|
-
if (
|
|
4971
|
+
if (j <= 0) return;
|
|
4951
4972
|
const B = setInterval(() => {
|
|
4952
|
-
K((
|
|
4973
|
+
K((H) => H <= 1 ? 0 : H - 1);
|
|
4953
4974
|
}, 1e3);
|
|
4954
4975
|
return () => clearInterval(B);
|
|
4955
|
-
}, [
|
|
4976
|
+
}, [j]), ge(() => {
|
|
4956
4977
|
Q && !y && J();
|
|
4957
4978
|
}, [Q]);
|
|
4958
4979
|
const V = () => {
|
|
4959
4980
|
i && (z(!0), w(i.testDurationSec), E(0), A({}), P(null));
|
|
4960
|
-
}, G = (B,
|
|
4961
|
-
A((fe) => ({ ...fe, [B]:
|
|
4981
|
+
}, G = (B, H) => {
|
|
4982
|
+
A((fe) => ({ ...fe, [B]: H }));
|
|
4962
4983
|
}, _ = ae(async () => {
|
|
4963
4984
|
try {
|
|
4964
4985
|
const B = await a.getAppropriatenessTest(e);
|
|
4965
4986
|
if (s(B), B.waitTimeSpanForNextTry && B.waitTimeSpanForNextTry !== "00:00:00") {
|
|
4966
|
-
const
|
|
4967
|
-
|
|
4987
|
+
const H = Lt(B.waitTimeSpanForNextTry);
|
|
4988
|
+
H > 0 && K(H);
|
|
4968
4989
|
}
|
|
4969
4990
|
} catch {
|
|
4970
4991
|
}
|
|
4971
4992
|
}, [e, a]), J = async (B) => {
|
|
4972
4993
|
if (i) {
|
|
4973
4994
|
if (!Q) {
|
|
4974
|
-
const
|
|
4975
|
-
if (
|
|
4976
|
-
P(`Please answer all questions. ${
|
|
4995
|
+
const H = i.appropriatenessQuestions.length - Object.keys(v).length;
|
|
4996
|
+
if (H > 0) {
|
|
4997
|
+
P(`Please answer all questions. ${H} remaining.`);
|
|
4977
4998
|
return;
|
|
4978
4999
|
}
|
|
4979
5000
|
}
|
|
4980
5001
|
p(!0), P(null);
|
|
4981
5002
|
try {
|
|
4982
|
-
const
|
|
5003
|
+
const H = i.appropriatenessQuestions.map(
|
|
4983
5004
|
(R) => ({ appropriatenessQuestionId: R.id, value: v[R.id] || "" })
|
|
4984
5005
|
), fe = {
|
|
4985
5006
|
applicantId: e,
|
|
4986
5007
|
appropriatenessTestId: i.id,
|
|
4987
|
-
appropriatenessQuestionResults:
|
|
5008
|
+
appropriatenessQuestionResults: H
|
|
4988
5009
|
};
|
|
4989
5010
|
try {
|
|
4990
5011
|
const R = await a.fillAppropriatenessTest(fe);
|
|
@@ -4995,8 +5016,8 @@ const An = ({
|
|
|
4995
5016
|
else
|
|
4996
5017
|
throw R;
|
|
4997
5018
|
}
|
|
4998
|
-
} catch (
|
|
4999
|
-
P(
|
|
5019
|
+
} catch (H) {
|
|
5020
|
+
P(H.message || "Failed to submit test. Please try again."), ie();
|
|
5000
5021
|
} finally {
|
|
5001
5022
|
p(!1);
|
|
5002
5023
|
}
|
|
@@ -5015,7 +5036,7 @@ const An = ({
|
|
|
5015
5036
|
b && /* @__PURE__ */ r("p", { style: { fontSize: "14px", color: "var(--metakyc-text-muted, #9ca3af)", marginTop: "8px" }, children: b })
|
|
5016
5037
|
] }) }) });
|
|
5017
5038
|
const Y = i.testAllowedMaxTry - i.totalFailedTries, we = i.appropriatenessQuestions.length, pe = Object.keys(v).length;
|
|
5018
|
-
if (
|
|
5039
|
+
if (j > 0)
|
|
5019
5040
|
return /* @__PURE__ */ o(re, { children: [
|
|
5020
5041
|
/* @__PURE__ */ r(Se, { children: /* @__PURE__ */ r("h2", { style: { fontSize: "18px", fontWeight: 700, color: "var(--metakyc-text-primary, #111827)", margin: 0 }, children: i.displayName }) }),
|
|
5021
5042
|
/* @__PURE__ */ r(ne, { children: /* @__PURE__ */ o("div", { style: { textAlign: "center", padding: "32px 0" }, children: [
|
|
@@ -5033,7 +5054,7 @@ const An = ({
|
|
|
5033
5054
|
fontWeight: 700,
|
|
5034
5055
|
color: "var(--metakyc-primary, #2563eb)",
|
|
5035
5056
|
fontVariantNumeric: "tabular-nums"
|
|
5036
|
-
}, children:
|
|
5057
|
+
}, children: kt(j) }) }),
|
|
5037
5058
|
/* @__PURE__ */ r("p", { style: { fontSize: "15px", fontWeight: 500, color: "var(--metakyc-text-primary, #111827)" }, children: "Please wait before retrying" }),
|
|
5038
5059
|
/* @__PURE__ */ r("p", { style: { fontSize: "13px", color: "var(--metakyc-text-muted, #9ca3af)", marginTop: "4px" }, children: "You can attempt the test again once the timer expires" }),
|
|
5039
5060
|
b && /* @__PURE__ */ r("div", { style: {
|
|
@@ -5118,8 +5139,8 @@ const An = ({
|
|
|
5118
5139
|
}, children: "No attempts remaining. Please contact support for assistance." }) })
|
|
5119
5140
|
] }) }),
|
|
5120
5141
|
/* @__PURE__ */ r(Ce, { children: /* @__PURE__ */ r("div", { style: { display: "flex", justifyContent: "center", width: "100%", gap: "12px" }, children: g.success ? /* @__PURE__ */ r(Z, { type: "button", onClick: () => t == null ? void 0 : t(), children: "Continue" }) : /* @__PURE__ */ o(ct, { children: [
|
|
5121
|
-
Y > 0 &&
|
|
5122
|
-
Y > 0 &&
|
|
5142
|
+
Y > 0 && j <= 0 && /* @__PURE__ */ r(Z, { type: "button", onClick: B, children: "Retake Test" }),
|
|
5143
|
+
Y > 0 && j > 0 && /* @__PURE__ */ r(Z, { type: "button", onClick: B, children: "OK" }),
|
|
5123
5144
|
Y <= 0 && n && /* @__PURE__ */ r(Z, { type: "button", variant: "outline", onClick: n, children: "Back" })
|
|
5124
5145
|
] }) }) })
|
|
5125
5146
|
] });
|
|
@@ -5149,7 +5170,7 @@ const An = ({
|
|
|
5149
5170
|
] }),
|
|
5150
5171
|
/* @__PURE__ */ o("div", { style: { display: "grid", gridTemplateColumns: "1fr 1fr", gap: "12px", marginBottom: "20px" }, children: [
|
|
5151
5172
|
/* @__PURE__ */ r(ht, { icon: "questions", label: "Questions", value: String(i.totalQuestionCount) }),
|
|
5152
|
-
/* @__PURE__ */ r(ht, { icon: "time", label: "Time Limit", value:
|
|
5173
|
+
/* @__PURE__ */ r(ht, { icon: "time", label: "Time Limit", value: kt(i.testDurationSec) }),
|
|
5153
5174
|
/* @__PURE__ */ r(ht, { icon: "target", label: "Pass Requirement", value: `${i.testCorrectAnswerPassLimit} correct` }),
|
|
5154
5175
|
/* @__PURE__ */ r(
|
|
5155
5176
|
ht,
|
|
@@ -5238,7 +5259,7 @@ const An = ({
|
|
|
5238
5259
|
fontVariantNumeric: "tabular-nums",
|
|
5239
5260
|
color: U ? "var(--metakyc-danger, #ef4444)" : "var(--metakyc-text-primary, #111827)",
|
|
5240
5261
|
transition: "color 0.3s ease"
|
|
5241
|
-
}, children:
|
|
5262
|
+
}, children: kt(T) })
|
|
5242
5263
|
] })
|
|
5243
5264
|
] }),
|
|
5244
5265
|
/* @__PURE__ */ o("div", { style: { marginTop: "12px" }, children: [
|
|
@@ -5274,7 +5295,7 @@ const An = ({
|
|
|
5274
5295
|
] }),
|
|
5275
5296
|
/* @__PURE__ */ o(ne, { children: [
|
|
5276
5297
|
me && /* @__PURE__ */ r(
|
|
5277
|
-
|
|
5298
|
+
On,
|
|
5278
5299
|
{
|
|
5279
5300
|
question: me,
|
|
5280
5301
|
index: ee,
|
|
@@ -5289,17 +5310,17 @@ const An = ({
|
|
|
5289
5310
|
gap: "6px",
|
|
5290
5311
|
marginTop: "20px",
|
|
5291
5312
|
flexWrap: "wrap"
|
|
5292
|
-
}, children: i.appropriatenessQuestions.map((B,
|
|
5313
|
+
}, children: i.appropriatenessQuestions.map((B, H) => /* @__PURE__ */ r(
|
|
5293
5314
|
"button",
|
|
5294
5315
|
{
|
|
5295
5316
|
type: "button",
|
|
5296
|
-
onClick: () => E(
|
|
5317
|
+
onClick: () => E(H),
|
|
5297
5318
|
style: {
|
|
5298
5319
|
width: "28px",
|
|
5299
5320
|
height: "28px",
|
|
5300
5321
|
borderRadius: "8px",
|
|
5301
|
-
border:
|
|
5302
|
-
backgroundColor: v[B.id] ?
|
|
5322
|
+
border: H === ee ? "2px solid var(--metakyc-primary, #2563eb)" : "1px solid var(--metakyc-border, #e5e7eb)",
|
|
5323
|
+
backgroundColor: v[B.id] ? H === ee ? "color-mix(in srgb, var(--metakyc-primary, #2563eb) 15%, transparent)" : "color-mix(in srgb, var(--metakyc-primary, #2563eb) 8%, transparent)" : H === ee ? "var(--metakyc-surface, #f9fafb)" : "var(--metakyc-background, #ffffff)",
|
|
5303
5324
|
color: v[B.id] ? "var(--metakyc-primary, #2563eb)" : "var(--metakyc-text-muted, #9ca3af)",
|
|
5304
5325
|
fontSize: "12px",
|
|
5305
5326
|
fontWeight: 600,
|
|
@@ -5310,7 +5331,7 @@ const An = ({
|
|
|
5310
5331
|
alignItems: "center",
|
|
5311
5332
|
justifyContent: "center"
|
|
5312
5333
|
},
|
|
5313
|
-
children:
|
|
5334
|
+
children: H + 1
|
|
5314
5335
|
},
|
|
5315
5336
|
B.id
|
|
5316
5337
|
)) }),
|
|
@@ -5374,7 +5395,7 @@ const An = ({
|
|
|
5374
5395
|
] })
|
|
5375
5396
|
] }) })
|
|
5376
5397
|
] });
|
|
5377
|
-
},
|
|
5398
|
+
}, Mn = {
|
|
5378
5399
|
questions: /* @__PURE__ */ o("svg", { width: "18", height: "18", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round", children: [
|
|
5379
5400
|
/* @__PURE__ */ r("path", { d: "M9 11l3 3L22 4" }),
|
|
5380
5401
|
/* @__PURE__ */ r("path", { d: "M21 12v7a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h11" })
|
|
@@ -5406,7 +5427,7 @@ const An = ({
|
|
|
5406
5427
|
/* @__PURE__ */ r("div", { style: {
|
|
5407
5428
|
color: i ? "#f59e0b" : "var(--metakyc-primary, #2563eb)",
|
|
5408
5429
|
flexShrink: 0
|
|
5409
|
-
}, children:
|
|
5430
|
+
}, children: Mn[e] }),
|
|
5410
5431
|
/* @__PURE__ */ o("div", { children: [
|
|
5411
5432
|
/* @__PURE__ */ r("p", { style: { fontSize: "12px", color: "var(--metakyc-text-muted, #9ca3af)", margin: 0 }, children: t }),
|
|
5412
5433
|
/* @__PURE__ */ r("p", { style: {
|
|
@@ -5418,7 +5439,7 @@ const An = ({
|
|
|
5418
5439
|
}, children: n })
|
|
5419
5440
|
] })
|
|
5420
5441
|
] });
|
|
5421
|
-
},
|
|
5442
|
+
}, On = ({ question: e, selectedAnswer: t, onSelect: n, disabled: a }) => /* @__PURE__ */ o("div", { children: [
|
|
5422
5443
|
/* @__PURE__ */ o("div", { style: { marginBottom: "16px" }, children: [
|
|
5423
5444
|
e.groupName && /* @__PURE__ */ r("span", { style: {
|
|
5424
5445
|
display: "inline-block",
|
|
@@ -5500,15 +5521,15 @@ const An = ({
|
|
|
5500
5521
|
s
|
|
5501
5522
|
);
|
|
5502
5523
|
}) })
|
|
5503
|
-
] }),
|
|
5524
|
+
] }), zn = ({
|
|
5504
5525
|
applicantId: e,
|
|
5505
5526
|
onComplete: t,
|
|
5506
5527
|
onBack: n
|
|
5507
5528
|
}) => {
|
|
5508
|
-
var Xe,
|
|
5509
|
-
const { applicantService: a, baseInformationService: i, identityService: s, config: c, currentTheme: d } = Te(), { identityData: y, provider: p, token: b, isLoading: P, error: v, requestIdentity: A, restartIdentity: T } =
|
|
5529
|
+
var Xe, He, ot, Qe;
|
|
5530
|
+
const { applicantService: a, baseInformationService: i, identityService: s, config: c, currentTheme: d } = Te(), { identityData: y, provider: p, token: b, isLoading: P, error: v, requestIdentity: A, restartIdentity: T } = tn(e), [w, N] = k(null), [z, Q] = k(null), [M, j] = k([]), [K, ee] = k([]), [E, g] = k(!0), [$, V] = k(!1), [G, _] = k(null), [J, ie] = k(!1), Y = ke.useRef(!1), [we, pe] = k({}), [me, ve] = k({}), F = d != null && d.reviewPageFields && d.reviewPageFields.length > 0 ? d.reviewPageFields[0] : null, U = !!(d != null && d.reviewPageDisabled), B = de(!1);
|
|
5510
5531
|
B.current = U;
|
|
5511
|
-
const
|
|
5532
|
+
const H = Zt({
|
|
5512
5533
|
defaultValues: {
|
|
5513
5534
|
street: "",
|
|
5514
5535
|
streetNumber: "",
|
|
@@ -5534,7 +5555,7 @@ const An = ({
|
|
|
5534
5555
|
]);
|
|
5535
5556
|
Q(O);
|
|
5536
5557
|
const X = /* @__PURE__ */ new Set(), m = q.map((f) => ({ value: f.abbreviation3 || f.abbreviation, label: f.name })).filter((f) => !f.value || X.has(f.value) ? !1 : (X.add(f.value), !0));
|
|
5537
|
-
|
|
5558
|
+
j(m);
|
|
5538
5559
|
const I = /* @__PURE__ */ new Set(), L = W.filter((f) => f.countryCode).map((f) => ({ value: f.countryCode, label: `${f.countryCode} – ${f.name}` })).filter((f) => I.has(f.value) ? !1 : (I.add(f.value), !0));
|
|
5539
5560
|
ee(L);
|
|
5540
5561
|
const u = O.applicantRequestData;
|
|
@@ -5560,7 +5581,7 @@ const An = ({
|
|
|
5560
5581
|
occupation: (u == null ? void 0 : u.occupation) || "",
|
|
5561
5582
|
taxNumber: (u == null ? void 0 : u.taxNumber) || "",
|
|
5562
5583
|
defaultLanguage: (u == null ? void 0 : u.defaultLanguage) || ""
|
|
5563
|
-
}),
|
|
5584
|
+
}), H.reset({
|
|
5564
5585
|
street: (u == null ? void 0 : u.street) || "",
|
|
5565
5586
|
streetNumber: (u == null ? void 0 : u.streetNumber) || "",
|
|
5566
5587
|
city: (u == null ? void 0 : u.city) || "",
|
|
@@ -5927,7 +5948,7 @@ const An = ({
|
|
|
5927
5948
|
children: "?"
|
|
5928
5949
|
}
|
|
5929
5950
|
),
|
|
5930
|
-
O &&
|
|
5951
|
+
O && Jt.createPortal(
|
|
5931
5952
|
/* @__PURE__ */ r(
|
|
5932
5953
|
"div",
|
|
5933
5954
|
{
|
|
@@ -5987,7 +6008,7 @@ const An = ({
|
|
|
5987
6008
|
}, Ie = (h, O) => O ? /* @__PURE__ */ o("div", { style: { display: "flex", alignItems: "flex-start", gap: 5, flexWrap: "nowrap" }, children: [
|
|
5988
6009
|
/* @__PURE__ */ r("div", { style: { flex: 1, minWidth: 0 }, children: h }),
|
|
5989
6010
|
/* @__PURE__ */ r("div", { style: { paddingTop: 24 }, children: /* @__PURE__ */ r($e, { helpText: O }) })
|
|
5990
|
-
] }) : h,
|
|
6011
|
+
] }) : h, je = (h, O) => {
|
|
5991
6012
|
const q = `cf-${O}`, W = h.paramName ?? "", X = me[W];
|
|
5992
6013
|
if (h.customType === "br")
|
|
5993
6014
|
return /* @__PURE__ */ r("div", { style: { ...oe(h.colSpan), minHeight: "0.5rem" } }, q);
|
|
@@ -6100,7 +6121,7 @@ const An = ({
|
|
|
6100
6121
|
h.helpText
|
|
6101
6122
|
) }, q);
|
|
6102
6123
|
}, it = (h, O) => {
|
|
6103
|
-
if (h.isCustom) return
|
|
6124
|
+
if (h.isCustom) return je(h, O);
|
|
6104
6125
|
const q = h.name ?? "", W = at[q], X = h.displayText || (W == null ? void 0 : W.label) || q, m = we[q] ?? "", I = q === "mobileCountryCode", L = !!(W != null && W.countriesType) && !I;
|
|
6105
6126
|
return h.editable ? I ? /* @__PURE__ */ r("div", { style: oe(h.colSpan ?? 2), children: Ie(
|
|
6106
6127
|
/* @__PURE__ */ r(
|
|
@@ -6159,14 +6180,14 @@ const An = ({
|
|
|
6159
6180
|
] })
|
|
6160
6181
|
] }) });
|
|
6161
6182
|
}
|
|
6162
|
-
return /* @__PURE__ */ r("form", { onSubmit:
|
|
6183
|
+
return /* @__PURE__ */ r("form", { onSubmit: H.handleSubmit(R), children: /* @__PURE__ */ o(re, { children: [
|
|
6163
6184
|
/* @__PURE__ */ o(Se, { children: [
|
|
6164
6185
|
/* @__PURE__ */ r("h2", { className: "text-lg font-bold", style: { color: "var(--metakyc-text-primary, #111827)" }, children: "Review Your Information" }),
|
|
6165
6186
|
/* @__PURE__ */ r("p", { className: "mt-1 text-sm", style: { color: "var(--metakyc-text-secondary, #6b7280)" }, children: "Please review and confirm your information before starting identity verification" })
|
|
6166
6187
|
] }),
|
|
6167
6188
|
/* @__PURE__ */ o(ne, { className: "space-y-6", children: [
|
|
6168
6189
|
/* @__PURE__ */ r("div", { className: "space-y-4 pb-4", style: { borderBottom: "1px solid var(--metakyc-border, #e5e7eb)" }, children: [
|
|
6169
|
-
{ label: "Name", value: `${((Xe = z == null ? void 0 : z.applicantRequestData) == null ? void 0 : Xe.firstName) || ""} ${((
|
|
6190
|
+
{ label: "Name", value: `${((Xe = z == null ? void 0 : z.applicantRequestData) == null ? void 0 : Xe.firstName) || ""} ${((He = z == null ? void 0 : z.applicantRequestData) == null ? void 0 : He.lastName) || ""}`.trim() },
|
|
6170
6191
|
{ label: "Email", value: (ot = z == null ? void 0 : z.applicantRequestData) == null ? void 0 : ot.email },
|
|
6171
6192
|
{ label: "Date of Birth", value: ((Qe = z == null ? void 0 : z.applicantRequestData) == null ? void 0 : Qe.dateOfBirth) || "Not provided" }
|
|
6172
6193
|
].map(({ label: h, value: O }) => /* @__PURE__ */ o("div", { children: [
|
|
@@ -6179,7 +6200,7 @@ const An = ({
|
|
|
6179
6200
|
/* @__PURE__ */ r(
|
|
6180
6201
|
tt,
|
|
6181
6202
|
{
|
|
6182
|
-
control:
|
|
6203
|
+
control: H.control,
|
|
6183
6204
|
name: "country",
|
|
6184
6205
|
render: ({ field: h }) => /* @__PURE__ */ r(
|
|
6185
6206
|
Ve,
|
|
@@ -6195,7 +6216,7 @@ const An = ({
|
|
|
6195
6216
|
/* @__PURE__ */ r(
|
|
6196
6217
|
tt,
|
|
6197
6218
|
{
|
|
6198
|
-
control:
|
|
6219
|
+
control: H.control,
|
|
6199
6220
|
name: "nationality",
|
|
6200
6221
|
render: ({ field: h }) => /* @__PURE__ */ r(
|
|
6201
6222
|
Ve,
|
|
@@ -6210,14 +6231,14 @@ const An = ({
|
|
|
6210
6231
|
)
|
|
6211
6232
|
] }),
|
|
6212
6233
|
/* @__PURE__ */ o("div", { className: "grid grid-cols-1 md:grid-cols-2 gap-4", children: [
|
|
6213
|
-
/* @__PURE__ */ r(tt, { control:
|
|
6214
|
-
/* @__PURE__ */ r(tt, { control:
|
|
6234
|
+
/* @__PURE__ */ r(tt, { control: H.control, name: "street", render: ({ field: h }) => /* @__PURE__ */ r(xe, { ...h, label: "Street" }) }),
|
|
6235
|
+
/* @__PURE__ */ r(tt, { control: H.control, name: "streetNumber", render: ({ field: h }) => /* @__PURE__ */ r(xe, { ...h, label: "Street Number" }) })
|
|
6215
6236
|
] }),
|
|
6216
6237
|
/* @__PURE__ */ o("div", { className: "grid grid-cols-1 md:grid-cols-2 gap-4", children: [
|
|
6217
|
-
/* @__PURE__ */ r(tt, { control:
|
|
6218
|
-
/* @__PURE__ */ r(tt, { control:
|
|
6238
|
+
/* @__PURE__ */ r(tt, { control: H.control, name: "city", render: ({ field: h }) => /* @__PURE__ */ r(xe, { ...h, label: "City" }) }),
|
|
6239
|
+
/* @__PURE__ */ r(tt, { control: H.control, name: "zip", render: ({ field: h }) => /* @__PURE__ */ r(xe, { ...h, label: "ZIP / Postal Code" }) })
|
|
6219
6240
|
] }),
|
|
6220
|
-
/* @__PURE__ */ r(tt, { control:
|
|
6241
|
+
/* @__PURE__ */ r(tt, { control: H.control, name: "phonenumber", render: ({ field: h }) => /* @__PURE__ */ r(xe, { ...h, label: "Phone Number", type: "tel" }) })
|
|
6221
6242
|
] })
|
|
6222
6243
|
] }),
|
|
6223
6244
|
/* @__PURE__ */ o(Ce, { style: { display: "flex", justifyContent: "space-between", alignItems: "center" }, children: [
|
|
@@ -6225,7 +6246,7 @@ const An = ({
|
|
|
6225
6246
|
/* @__PURE__ */ r(Z, { type: "submit", isLoading: P, children: "Confirm and Start Verification" })
|
|
6226
6247
|
] })
|
|
6227
6248
|
] }) });
|
|
6228
|
-
},
|
|
6249
|
+
}, Dt = ({
|
|
6229
6250
|
kycStatus: e,
|
|
6230
6251
|
reviewStatus: t,
|
|
6231
6252
|
workflowResult: n,
|
|
@@ -6315,7 +6336,7 @@ const An = ({
|
|
|
6315
6336
|
) }),
|
|
6316
6337
|
/* @__PURE__ */ r("h2", { className: "text-3xl font-bold text-center mb-4", style: { color: "var(--metakyc-text-primary, #111827)" }, children: d.title }),
|
|
6317
6338
|
/* @__PURE__ */ r("div", { className: "flex justify-center mb-6", children: /* @__PURE__ */ r(
|
|
6318
|
-
|
|
6339
|
+
_t,
|
|
6319
6340
|
{
|
|
6320
6341
|
variant: d.type === "success" ? "success" : d.type === "error" ? "danger" : d.type === "pending" ? "warning" : "info",
|
|
6321
6342
|
children: e != null ? rt[e] : nt[t]
|
|
@@ -6367,7 +6388,7 @@ const An = ({
|
|
|
6367
6388
|
d.type === "pending" && /* @__PURE__ */ r("div", { className: "text-center", children: /* @__PURE__ */ r("p", { className: "text-sm text-gray-500 dark:text-gray-400", children: "Please check back later or wait for our email notification" }) })
|
|
6368
6389
|
] })
|
|
6369
6390
|
] });
|
|
6370
|
-
},
|
|
6391
|
+
}, $n = ({ config: e, className: t = "" }) => !(e != null && e.visible) || !(e != null && e.url) ? null : /* @__PURE__ */ r("div", { className: `metakyc-logo ${t}`, children: /* @__PURE__ */ r(
|
|
6371
6392
|
"img",
|
|
6372
6393
|
{
|
|
6373
6394
|
src: e.url,
|
|
@@ -6395,7 +6416,7 @@ const An = ({
|
|
|
6395
6416
|
className: "metakyc-header-title flex items-center text-xl font-bold",
|
|
6396
6417
|
style: { color: "var(--metakyc-text-primary, #111827)" },
|
|
6397
6418
|
children: [
|
|
6398
|
-
s && /* @__PURE__ */ r(
|
|
6419
|
+
s && /* @__PURE__ */ r($n, { config: a.logo }),
|
|
6399
6420
|
s && c && /* @__PURE__ */ r(
|
|
6400
6421
|
"span",
|
|
6401
6422
|
{
|
|
@@ -6413,7 +6434,7 @@ const An = ({
|
|
|
6413
6434
|
function lt(e) {
|
|
6414
6435
|
return e == null || e === "" || Array.isArray(e) && e.length === 0;
|
|
6415
6436
|
}
|
|
6416
|
-
const
|
|
6437
|
+
const Bn = {
|
|
6417
6438
|
width: "16px",
|
|
6418
6439
|
height: "16px",
|
|
6419
6440
|
minWidth: "16px",
|
|
@@ -6425,7 +6446,7 @@ const Mn = {
|
|
|
6425
6446
|
padding: 0,
|
|
6426
6447
|
display: "inline-block",
|
|
6427
6448
|
verticalAlign: "middle"
|
|
6428
|
-
},
|
|
6449
|
+
}, Mt = ({ helpText: e, children: t }) => {
|
|
6429
6450
|
const [n, a] = ke.useState(!1);
|
|
6430
6451
|
if (!e) return /* @__PURE__ */ r(ct, { children: t });
|
|
6431
6452
|
const i = n ? /* @__PURE__ */ r(
|
|
@@ -6544,16 +6565,16 @@ const Mn = {
|
|
|
6544
6565
|
children: "?"
|
|
6545
6566
|
}
|
|
6546
6567
|
),
|
|
6547
|
-
typeof document < "u" && i ?
|
|
6568
|
+
typeof document < "u" && i ? Ct(i, document.body) : null
|
|
6548
6569
|
] });
|
|
6549
|
-
},
|
|
6570
|
+
}, ia = ({
|
|
6550
6571
|
workflowKey: e,
|
|
6551
6572
|
externalRefId: t,
|
|
6552
6573
|
onSuccess: n,
|
|
6553
6574
|
onCancel: a
|
|
6554
6575
|
}) => {
|
|
6555
6576
|
var q, W, X, m, I, L, u;
|
|
6556
|
-
const { config: i, baseInformationService: s, currentTheme: c } = Te(), { createApplicant: d, isLoading: y } =
|
|
6577
|
+
const { config: i, baseInformationService: s, currentTheme: c } = Te(), { createApplicant: d, isLoading: y } = Bt(), p = e || ((q = i.applicantForm) == null ? void 0 : q.workflowKey);
|
|
6557
6578
|
if (!p)
|
|
6558
6579
|
throw new Error(
|
|
6559
6580
|
"workflowKey is required. Provide it either as a prop to CreateApplicantForm or set it in config.applicantForm.workflowKey"
|
|
@@ -6577,7 +6598,7 @@ const Mn = {
|
|
|
6577
6598
|
return Array.from(C);
|
|
6578
6599
|
}
|
|
6579
6600
|
let l;
|
|
6580
|
-
(D = i.applicantForm) != null && D.visibleFields ? l = i.applicantForm.visibleFields : c != null && c.applicantFormVisibleFields && c.applicantFormVisibleFields.length > 0 ? l = c.applicantFormVisibleFields : l =
|
|
6601
|
+
(D = i.applicantForm) != null && D.visibleFields ? l = i.applicantForm.visibleFields : c != null && c.applicantFormVisibleFields && c.applicantFormVisibleFields.length > 0 ? l = c.applicantFormVisibleFields : l = ur;
|
|
6581
6602
|
const f = new Set(l);
|
|
6582
6603
|
for (const x of ft) f.add(x);
|
|
6583
6604
|
return Array.from(f);
|
|
@@ -6588,7 +6609,7 @@ const Mn = {
|
|
|
6588
6609
|
"countryOfBirth",
|
|
6589
6610
|
"mobileCountryCode",
|
|
6590
6611
|
"otherNationality"
|
|
6591
|
-
]),
|
|
6612
|
+
]), j = De(() => {
|
|
6592
6613
|
var f, D;
|
|
6593
6614
|
const l = /* @__PURE__ */ new Set();
|
|
6594
6615
|
if (N)
|
|
@@ -6602,12 +6623,12 @@ const Mn = {
|
|
|
6602
6623
|
}, [Q, N]), [K, ee] = k({}), [E, g] = k(!0), $ = de(/* @__PURE__ */ new Set()), V = de(/* @__PURE__ */ new Set());
|
|
6603
6624
|
ge(() => {
|
|
6604
6625
|
if (!c) return;
|
|
6605
|
-
const l =
|
|
6626
|
+
const l = j.filter((x) => {
|
|
6606
6627
|
const C = x != null ? String(x) : "all";
|
|
6607
6628
|
return !V.current.has(C) && !$.current.has(C);
|
|
6608
6629
|
});
|
|
6609
6630
|
if (l.length === 0) {
|
|
6610
|
-
|
|
6631
|
+
j.every((C) => {
|
|
6611
6632
|
const S = C != null ? String(C) : "all";
|
|
6612
6633
|
return V.current.has(S);
|
|
6613
6634
|
}) && g(!1);
|
|
@@ -6630,13 +6651,13 @@ const Mn = {
|
|
|
6630
6651
|
} catch (x) {
|
|
6631
6652
|
f.forEach((C) => $.current.delete(C)), console.error("Failed to load countries:", x);
|
|
6632
6653
|
} finally {
|
|
6633
|
-
|
|
6654
|
+
j.every((C) => {
|
|
6634
6655
|
const S = C != null ? String(C) : "all";
|
|
6635
6656
|
return V.current.has(S);
|
|
6636
6657
|
}) && g(!1);
|
|
6637
6658
|
}
|
|
6638
6659
|
})();
|
|
6639
|
-
}, [
|
|
6660
|
+
}, [j, c]);
|
|
6640
6661
|
const G = (l, f) => {
|
|
6641
6662
|
var C;
|
|
6642
6663
|
const D = f ?? ((C = at[l]) == null ? void 0 : C.countriesType), x = D != null ? String(D) : "all";
|
|
@@ -6697,7 +6718,7 @@ const Mn = {
|
|
|
6697
6718
|
...ie
|
|
6698
6719
|
}), pe = Object.fromEntries(
|
|
6699
6720
|
Object.entries(v).filter(([l]) => !(l in J) && l !== "externalRefId" && l !== "workflowKey")
|
|
6700
|
-
), [me, ve] = k({ ...pe }), [F, U] = k(0), [B,
|
|
6721
|
+
), [me, ve] = k({ ...pe }), [F, U] = k(0), [B, H] = k({}), [fe, R] = k(null), [te, ye] = k(!1), oe = (l, f) => we((D) => ({ ...D, [l]: f })), Ne = (l, f) => ve((D) => ({ ...D, [l]: f })), $e = (l) => !l.conditionalOn || me[l.conditionalOn] === "true", Ie = N && F < N.length - 1 ? F + 1 : -1, je = N && F > 0 ? F - 1 : -1, it = (l) => {
|
|
6701
6722
|
var D;
|
|
6702
6723
|
const f = {};
|
|
6703
6724
|
for (const x of l.fields)
|
|
@@ -6719,22 +6740,22 @@ const Mn = {
|
|
|
6719
6740
|
if (!N) return;
|
|
6720
6741
|
const l = N[F];
|
|
6721
6742
|
if (l.conditionalOn && !$e(l)) {
|
|
6722
|
-
|
|
6743
|
+
H({}), Ie >= 0 ? U(Ie) : await He();
|
|
6723
6744
|
return;
|
|
6724
6745
|
}
|
|
6725
6746
|
const f = it(l);
|
|
6726
6747
|
if (Object.keys(f).length > 0) {
|
|
6727
|
-
|
|
6748
|
+
H(f);
|
|
6728
6749
|
return;
|
|
6729
6750
|
}
|
|
6730
|
-
|
|
6731
|
-
},
|
|
6751
|
+
H({}), Ie >= 0 ? U(Ie) : await He();
|
|
6752
|
+
}, He = async () => {
|
|
6732
6753
|
if (N) {
|
|
6733
6754
|
let l = {};
|
|
6734
6755
|
for (const f of N)
|
|
6735
6756
|
$e(f) && (l = { ...l, ...it(f) });
|
|
6736
6757
|
if (Object.keys(l).length > 0) {
|
|
6737
|
-
|
|
6758
|
+
H(l);
|
|
6738
6759
|
return;
|
|
6739
6760
|
}
|
|
6740
6761
|
}
|
|
@@ -6804,12 +6825,12 @@ const Mn = {
|
|
|
6804
6825
|
R(`${x} is required.`);
|
|
6805
6826
|
return;
|
|
6806
6827
|
}
|
|
6807
|
-
await
|
|
6828
|
+
await He();
|
|
6808
6829
|
}, Qe = (l, f, D, x, C) => {
|
|
6809
|
-
var
|
|
6830
|
+
var It;
|
|
6810
6831
|
const S = at[l];
|
|
6811
6832
|
if (!S) return null;
|
|
6812
|
-
const ue = z.includes(l), se = B[l], be = D || S.label, Pe = l in ie, le = f ?? l, _e = { required: ue }, We = C ? C !== "placeholder" : w, Ge = We ? be : void 0,
|
|
6833
|
+
const ue = z.includes(l), se = B[l], be = D || S.label, Pe = l in ie, le = f ?? l, _e = { required: ue }, We = C ? C !== "placeholder" : w, Ge = We ? be : void 0, Kt = We ? "..." : be;
|
|
6813
6834
|
switch (S.type) {
|
|
6814
6835
|
case "select":
|
|
6815
6836
|
if (l === "country" || l === "nationality" || l === "taxCountry" || l === "countryOfBirth" || l === "mobileCountryCode") {
|
|
@@ -6821,7 +6842,7 @@ const Mn = {
|
|
|
6821
6842
|
label: Ge,
|
|
6822
6843
|
value: Y[l] || "",
|
|
6823
6844
|
onChange: (et) => oe(l, et),
|
|
6824
|
-
options: [{ value: "", label: `Select ${
|
|
6845
|
+
options: [{ value: "", label: `Select ${Kt.toLowerCase()}` }, ...Re],
|
|
6825
6846
|
disabled: E,
|
|
6826
6847
|
readOnly: Pe,
|
|
6827
6848
|
error: se
|
|
@@ -6835,7 +6856,7 @@ const Mn = {
|
|
|
6835
6856
|
{
|
|
6836
6857
|
..._e,
|
|
6837
6858
|
label: Ge,
|
|
6838
|
-
value: ((
|
|
6859
|
+
value: ((It = Y[l]) == null ? void 0 : It.toString()) || "",
|
|
6839
6860
|
onChange: (Re) => oe(l, Re ? Number(Re) : null),
|
|
6840
6861
|
options: [
|
|
6841
6862
|
{ value: "", label: We ? "Select salutation..." : be },
|
|
@@ -6849,7 +6870,7 @@ const Mn = {
|
|
|
6849
6870
|
le
|
|
6850
6871
|
);
|
|
6851
6872
|
if (l === "defaultLanguage") {
|
|
6852
|
-
const Re = c != null && c.allowedLanguages && c.allowedLanguages.length > 0 ?
|
|
6873
|
+
const Re = c != null && c.allowedLanguages && c.allowedLanguages.length > 0 ? Et.filter((et) => c.allowedLanguages.includes(et.value)) : Et;
|
|
6853
6874
|
return /* @__PURE__ */ r(
|
|
6854
6875
|
Ve,
|
|
6855
6876
|
{
|
|
@@ -6869,7 +6890,7 @@ const Mn = {
|
|
|
6869
6890
|
if (l === "otherNationality") {
|
|
6870
6891
|
const Re = G(l, x);
|
|
6871
6892
|
return /* @__PURE__ */ r(
|
|
6872
|
-
|
|
6893
|
+
sn,
|
|
6873
6894
|
{
|
|
6874
6895
|
..._e,
|
|
6875
6896
|
label: Ge,
|
|
@@ -7153,7 +7174,7 @@ const Mn = {
|
|
|
7153
7174
|
onChange: () => Ne(l.paramName, S.value),
|
|
7154
7175
|
name: `radio-group-${l.paramName}-${f}`,
|
|
7155
7176
|
className: "metakyc-option-input",
|
|
7156
|
-
style:
|
|
7177
|
+
style: Bn
|
|
7157
7178
|
}
|
|
7158
7179
|
),
|
|
7159
7180
|
/* @__PURE__ */ r(
|
|
@@ -7185,7 +7206,7 @@ const Mn = {
|
|
|
7185
7206
|
}, O = (l, f) => {
|
|
7186
7207
|
const D = $e(l);
|
|
7187
7208
|
return /* @__PURE__ */ o("div", { className: "space-y-4", children: [
|
|
7188
|
-
l.conditionalOn && /* @__PURE__ */ r(
|
|
7209
|
+
l.conditionalOn && /* @__PURE__ */ r(Mt, { helpText: l.conditionalHelpText, children: /* @__PURE__ */ o(
|
|
7189
7210
|
"label",
|
|
7190
7211
|
{
|
|
7191
7212
|
className: "metakyc-option-label",
|
|
@@ -7211,7 +7232,7 @@ const Mn = {
|
|
|
7211
7232
|
) }),
|
|
7212
7233
|
D && /* @__PURE__ */ r("div", { style: { display: "grid", gridTemplateColumns: "repeat(4, minmax(0, 1fr))", gap: "1rem" }, children: l.fields.map((x, C) => {
|
|
7213
7234
|
const S = Math.min(4, Math.max(1, Number(x.colSpan) || 4)), ue = x.isCustom ? `custom-${C}-${x.paramName}` : `builtin-${x.name}-${C}`;
|
|
7214
|
-
return /* @__PURE__ */ r("div", { style: { gridColumn: `span ${S} / span ${S}` }, children: /* @__PURE__ */ r(
|
|
7235
|
+
return /* @__PURE__ */ r("div", { style: { gridColumn: `span ${S} / span ${S}` }, children: /* @__PURE__ */ r(Mt, { helpText: x.helpText, children: x.isCustom ? h(x, C) : Qe(x.name, ue, x.displayText, x.countriesType, x.labelMode) }) }, ue);
|
|
7215
7236
|
}) })
|
|
7216
7237
|
] });
|
|
7217
7238
|
};
|
|
@@ -7221,7 +7242,7 @@ const Mn = {
|
|
|
7221
7242
|
/* @__PURE__ */ r("p", { className: "text-center mt-4", style: { color: "var(--metakyc-text-secondary, #6b7280)", fontSize: "0.875rem" }, children: "Loading form…" })
|
|
7222
7243
|
] }) }) });
|
|
7223
7244
|
if (N) {
|
|
7224
|
-
const l = N[F] ?? N[0], f =
|
|
7245
|
+
const l = N[F] ?? N[0], f = je === -1, D = Ie === -1, x = N.length, C = $e(l), S = Object.values(B);
|
|
7225
7246
|
return /* @__PURE__ */ r("div", { className: "metakyc-sdk", children: /* @__PURE__ */ o(re, { children: [
|
|
7226
7247
|
/* @__PURE__ */ r(Se, { children: /* @__PURE__ */ r(mt, { title: (c == null ? void 0 : c.title) || "Create Applicant" }) }),
|
|
7227
7248
|
/* @__PURE__ */ o(ne, { children: [
|
|
@@ -7288,7 +7309,7 @@ const Mn = {
|
|
|
7288
7309
|
type: "button",
|
|
7289
7310
|
variant: "outline",
|
|
7290
7311
|
onClick: () => {
|
|
7291
|
-
U(
|
|
7312
|
+
U(je), H({});
|
|
7292
7313
|
},
|
|
7293
7314
|
disabled: te || y,
|
|
7294
7315
|
children: "Previous"
|
|
@@ -7301,7 +7322,7 @@ const Mn = {
|
|
|
7301
7322
|
{
|
|
7302
7323
|
type: "button",
|
|
7303
7324
|
isLoading: te || y,
|
|
7304
|
-
onClick: D ?
|
|
7325
|
+
onClick: D ? He : Xe,
|
|
7305
7326
|
children: D ? l.conditionalOn && !C ? "Skip & Submit" : "Submit" : l.conditionalOn && !C ? "Skip" : "Next"
|
|
7306
7327
|
}
|
|
7307
7328
|
)
|
|
@@ -7323,18 +7344,18 @@ const Mn = {
|
|
|
7323
7344
|
/* @__PURE__ */ r(Z, { type: "submit", isLoading: te || y, children: "Create Applicant" })
|
|
7324
7345
|
] })
|
|
7325
7346
|
] }) }) });
|
|
7326
|
-
},
|
|
7327
|
-
function
|
|
7347
|
+
}, Ot = ["companyName", "email"];
|
|
7348
|
+
function wt(e) {
|
|
7328
7349
|
return e == null || e === "" || Array.isArray(e) && e.length === 0;
|
|
7329
7350
|
}
|
|
7330
|
-
const
|
|
7351
|
+
const oa = ({
|
|
7331
7352
|
workflowKey: e,
|
|
7332
7353
|
externalRefId: t,
|
|
7333
7354
|
onSuccess: n,
|
|
7334
7355
|
onCancel: a
|
|
7335
7356
|
}) => {
|
|
7336
7357
|
var Qe, h, O, q, W, X;
|
|
7337
|
-
const { config: i, baseInformationService: s, currentTheme: c } = Te(), { createCompanyApplicant: d, isLoading: y } =
|
|
7358
|
+
const { config: i, baseInformationService: s, currentTheme: c } = Te(), { createCompanyApplicant: d, isLoading: y } = Bt(), p = e || ((Qe = i.applicantForm) == null ? void 0 : Qe.workflowKey);
|
|
7338
7359
|
if (!p)
|
|
7339
7360
|
throw new Error(
|
|
7340
7361
|
"workflowKey is required. Provide it either as a prop to CreateCompanyApplicantForm or set it in config.applicantForm.workflowKey"
|
|
@@ -7343,7 +7364,7 @@ const ra = ({
|
|
|
7343
7364
|
() => c != null && c.companyFormPages && c.companyFormPages.length > 0 ? c.companyFormPages : null,
|
|
7344
7365
|
[c == null ? void 0 : c.companyFormPages]
|
|
7345
7366
|
), N = De(() => {
|
|
7346
|
-
const m = new Set(
|
|
7367
|
+
const m = new Set(Ot), I = c == null ? void 0 : c.companyFormRequiredFields;
|
|
7347
7368
|
if (I) for (const L of I) m.add(L);
|
|
7348
7369
|
if (w)
|
|
7349
7370
|
for (const L of w)
|
|
@@ -7354,10 +7375,10 @@ const ra = ({
|
|
|
7354
7375
|
var m;
|
|
7355
7376
|
if (w) {
|
|
7356
7377
|
const I = w.flatMap((u) => u.fields).filter((u) => !u.isCustom && u.name).map((u) => u.name), L = new Set(I);
|
|
7357
|
-
for (const u of
|
|
7378
|
+
for (const u of Ot) L.add(u);
|
|
7358
7379
|
return Array.from(L);
|
|
7359
7380
|
}
|
|
7360
|
-
return (m = i.applicantForm) != null && m.visibleFields ? i.applicantForm.visibleFields : c != null && c.companyFormVisibleFields && c.companyFormVisibleFields.length > 0 ? c.companyFormVisibleFields :
|
|
7381
|
+
return (m = i.applicantForm) != null && m.visibleFields ? i.applicantForm.visibleFields : c != null && c.companyFormVisibleFields && c.companyFormVisibleFields.length > 0 ? c.companyFormVisibleFields : dr;
|
|
7361
7382
|
}, [(X = i.applicantForm) == null ? void 0 : X.visibleFields, c == null ? void 0 : c.companyFormVisibleFields, w]), Q = /* @__PURE__ */ new Set(["countryResidence", "addressCountry"]), M = De(() => {
|
|
7362
7383
|
var I, L;
|
|
7363
7384
|
const m = /* @__PURE__ */ new Set();
|
|
@@ -7369,7 +7390,7 @@ const ra = ({
|
|
|
7369
7390
|
for (const u of z)
|
|
7370
7391
|
Q.has(u) && m.add((L = st[u]) == null ? void 0 : L.countriesType);
|
|
7371
7392
|
return m.size === 0 && m.add(void 0), Array.from(m);
|
|
7372
|
-
}, [z, w]), [
|
|
7393
|
+
}, [z, w]), [j, K] = k({}), [ee, E] = k(!0), g = de(/* @__PURE__ */ new Set()), $ = de(/* @__PURE__ */ new Set());
|
|
7373
7394
|
ge(() => {
|
|
7374
7395
|
if (!c) return;
|
|
7375
7396
|
const m = M.filter((u) => {
|
|
@@ -7401,7 +7422,7 @@ const ra = ({
|
|
|
7401
7422
|
const V = (m, I) => {
|
|
7402
7423
|
var l;
|
|
7403
7424
|
const L = I ?? ((l = st[m]) == null ? void 0 : l.countriesType), u = L != null ? String(L) : "all";
|
|
7404
|
-
return
|
|
7425
|
+
return j[u] || [];
|
|
7405
7426
|
}, G = {
|
|
7406
7427
|
companyName: 1,
|
|
7407
7428
|
registrationNumber: 1,
|
|
@@ -7447,7 +7468,7 @@ const ra = ({
|
|
|
7447
7468
|
lei: "",
|
|
7448
7469
|
externalRefId: b,
|
|
7449
7470
|
..._
|
|
7450
|
-
}), [Y, we] = k({}), [pe, me] = k(0), [ve, F] = k({}), [U, B] = k(null), [
|
|
7471
|
+
}), [Y, we] = k({}), [pe, me] = k(0), [ve, F] = k({}), [U, B] = k(null), [H, fe] = k(!1), R = (m, I) => ie((L) => ({ ...L, [m]: I })), te = (m, I) => we((L) => ({ ...L, [m]: I })), ye = (m) => !m.conditionalOn || Y[m.conditionalOn] === "true", oe = w && pe < w.length - 1 ? pe + 1 : -1, Ne = w && pe > 0 ? pe - 1 : -1, $e = (m) => {
|
|
7451
7472
|
var L;
|
|
7452
7473
|
const I = {};
|
|
7453
7474
|
for (const u of m.fields)
|
|
@@ -7459,7 +7480,7 @@ const ra = ({
|
|
|
7459
7480
|
}
|
|
7460
7481
|
} else if (u.name) {
|
|
7461
7482
|
const l = u.name;
|
|
7462
|
-
if (N.includes(l) &&
|
|
7483
|
+
if (N.includes(l) && wt(J[l])) {
|
|
7463
7484
|
const f = u.displayText || ((L = st[l]) == null ? void 0 : L.label) || l;
|
|
7464
7485
|
I[l] = `${f} is required.`;
|
|
7465
7486
|
}
|
|
@@ -7469,7 +7490,7 @@ const ra = ({
|
|
|
7469
7490
|
if (!w) return;
|
|
7470
7491
|
const m = w[pe];
|
|
7471
7492
|
if (m.conditionalOn && !ye(m)) {
|
|
7472
|
-
F({}), oe >= 0 ? me(oe) : await
|
|
7493
|
+
F({}), oe >= 0 ? me(oe) : await je();
|
|
7473
7494
|
return;
|
|
7474
7495
|
}
|
|
7475
7496
|
const I = $e(m);
|
|
@@ -7477,8 +7498,8 @@ const ra = ({
|
|
|
7477
7498
|
F(I);
|
|
7478
7499
|
return;
|
|
7479
7500
|
}
|
|
7480
|
-
F({}), oe >= 0 ? me(oe) : await
|
|
7481
|
-
},
|
|
7501
|
+
F({}), oe >= 0 ? me(oe) : await je();
|
|
7502
|
+
}, je = async () => {
|
|
7482
7503
|
var m;
|
|
7483
7504
|
if (w) {
|
|
7484
7505
|
let I = {};
|
|
@@ -7497,7 +7518,7 @@ const ra = ({
|
|
|
7497
7518
|
}, L = w ? w.filter((f) => ye(f)).flatMap((f) => f.fields).filter((f) => !f.isCustom && f.name).map((f) => f.name) : z;
|
|
7498
7519
|
for (const f of L) {
|
|
7499
7520
|
const D = J[f];
|
|
7500
|
-
if (!
|
|
7521
|
+
if (!wt(D))
|
|
7501
7522
|
switch (f) {
|
|
7502
7523
|
case "companyName":
|
|
7503
7524
|
I.companyName = D;
|
|
@@ -7554,12 +7575,12 @@ const ra = ({
|
|
|
7554
7575
|
var I;
|
|
7555
7576
|
m.preventDefault();
|
|
7556
7577
|
for (const L of N)
|
|
7557
|
-
if (
|
|
7578
|
+
if (wt(J[L])) {
|
|
7558
7579
|
const u = ((I = st[L]) == null ? void 0 : I.label) || L;
|
|
7559
7580
|
B(`${u} is required.`);
|
|
7560
7581
|
return;
|
|
7561
7582
|
}
|
|
7562
|
-
await
|
|
7583
|
+
await je();
|
|
7563
7584
|
}, Xe = (m, I, L, u, l) => {
|
|
7564
7585
|
const f = st[m];
|
|
7565
7586
|
if (!f) return null;
|
|
@@ -7645,7 +7666,7 @@ const ra = ({
|
|
|
7645
7666
|
ue
|
|
7646
7667
|
);
|
|
7647
7668
|
}
|
|
7648
|
-
},
|
|
7669
|
+
}, He = (m, I) => {
|
|
7649
7670
|
if (m.customType === "paragraph")
|
|
7650
7671
|
return /* @__PURE__ */ r(
|
|
7651
7672
|
"p",
|
|
@@ -7715,7 +7736,7 @@ const ra = ({
|
|
|
7715
7736
|
] }),
|
|
7716
7737
|
I && /* @__PURE__ */ r("div", { style: { display: "grid", gridTemplateColumns: "repeat(4, minmax(0, 1fr))", gap: "1rem" }, children: m.fields.map((L, u) => {
|
|
7717
7738
|
const l = Math.min(4, Math.max(1, Number(L.colSpan) || 4)), f = L.isCustom ? `custom-${u}-${L.paramName}` : `builtin-${L.name}-${u}`;
|
|
7718
|
-
return /* @__PURE__ */ r("div", { style: { gridColumn: `span ${l} / span ${l}` }, children: L.isCustom ?
|
|
7739
|
+
return /* @__PURE__ */ r("div", { style: { gridColumn: `span ${l} / span ${l}` }, children: L.isCustom ? He(L, u) : Xe(L.name, f, L.displayText, L.countriesType, L.labelMode) }, f);
|
|
7719
7740
|
}) })
|
|
7720
7741
|
] });
|
|
7721
7742
|
};
|
|
@@ -7772,13 +7793,13 @@ const ra = ({
|
|
|
7772
7793
|
onClick: () => {
|
|
7773
7794
|
me(Ne), F({});
|
|
7774
7795
|
},
|
|
7775
|
-
disabled:
|
|
7796
|
+
disabled: H || y,
|
|
7776
7797
|
children: "Previous"
|
|
7777
7798
|
}
|
|
7778
7799
|
),
|
|
7779
|
-
I && a && /* @__PURE__ */ r(Z, { type: "button", variant: "outline", onClick: a, disabled:
|
|
7800
|
+
I && a && /* @__PURE__ */ r(Z, { type: "button", variant: "outline", onClick: a, disabled: H || y, children: "Cancel" })
|
|
7780
7801
|
] }),
|
|
7781
|
-
/* @__PURE__ */ r(Z, { type: "button", isLoading:
|
|
7802
|
+
/* @__PURE__ */ r(Z, { type: "button", isLoading: H || y, onClick: L ? je : Ie, children: L ? m.conditionalOn && !l ? "Skip & Submit" : "Submit" : m.conditionalOn && !l ? "Skip" : "Next" })
|
|
7782
7803
|
] })
|
|
7783
7804
|
] }) });
|
|
7784
7805
|
}
|
|
@@ -7793,11 +7814,11 @@ const ra = ({
|
|
|
7793
7814
|
/* @__PURE__ */ r("div", { style: { display: "grid", gridTemplateColumns: "repeat(4, minmax(0, 1fr))", gap: "1rem" }, children: z.map((m) => /* @__PURE__ */ r("div", { style: { gridColumn: "span 4 / span 4" }, children: Xe(m) }, m)) })
|
|
7794
7815
|
] }),
|
|
7795
7816
|
/* @__PURE__ */ o(Ce, { style: { display: "flex", justifyContent: "space-between", alignItems: "center" }, children: [
|
|
7796
|
-
a && /* @__PURE__ */ r(Z, { type: "button", variant: "outline", onClick: a, disabled:
|
|
7797
|
-
/* @__PURE__ */ r(Z, { type: "submit", isLoading:
|
|
7817
|
+
a && /* @__PURE__ */ r(Z, { type: "button", variant: "outline", onClick: a, disabled: H || y, children: "Cancel" }),
|
|
7818
|
+
/* @__PURE__ */ r(Z, { type: "submit", isLoading: H || y, children: "Register Company" })
|
|
7798
7819
|
] })
|
|
7799
7820
|
] }) }) });
|
|
7800
|
-
},
|
|
7821
|
+
}, sa = ({
|
|
7801
7822
|
applicantId: e,
|
|
7802
7823
|
onComplete: t,
|
|
7803
7824
|
onError: n,
|
|
@@ -7815,7 +7836,7 @@ const ra = ({
|
|
|
7815
7836
|
error: v,
|
|
7816
7837
|
moveBack: A,
|
|
7817
7838
|
refreshProgress: T
|
|
7818
|
-
} =
|
|
7839
|
+
} = Jr(e), [w, N] = ke.useState(!1), z = ke.useRef(null);
|
|
7819
7840
|
if (ke.useEffect(() => {
|
|
7820
7841
|
v && n && n(v);
|
|
7821
7842
|
}, [v, n]), ke.useEffect(() => {
|
|
@@ -7865,7 +7886,7 @@ const ra = ({
|
|
|
7865
7886
|
] }) }) }) });
|
|
7866
7887
|
if (s.status === ze.Finished || s.status === ze.OnHold)
|
|
7867
7888
|
return /* @__PURE__ */ r("div", { className: `metakyc-sdk ${i || ""}`, children: /* @__PURE__ */ r(
|
|
7868
|
-
|
|
7889
|
+
Dt,
|
|
7869
7890
|
{
|
|
7870
7891
|
kycStatus: s.kycStatus,
|
|
7871
7892
|
reviewStatus: s.reviewStatus,
|
|
@@ -7910,7 +7931,7 @@ const ra = ({
|
|
|
7910
7931
|
return /* @__PURE__ */ o("div", { style: { marginBottom: "24px" }, children: [
|
|
7911
7932
|
/* @__PURE__ */ o("div", { style: { display: "flex", alignItems: "flex-start", justifyContent: "space-between", marginBottom: "16px" }, children: [
|
|
7912
7933
|
/* @__PURE__ */ r(mt, {}),
|
|
7913
|
-
/* @__PURE__ */ o(
|
|
7934
|
+
/* @__PURE__ */ o(_t, { variant: s.status === 1 ? "info" : "success", children: [
|
|
7914
7935
|
"Step ",
|
|
7915
7936
|
E,
|
|
7916
7937
|
" of ",
|
|
@@ -7930,7 +7951,7 @@ const ra = ({
|
|
|
7930
7951
|
transition: "width 0.4s ease"
|
|
7931
7952
|
} }) }) }),
|
|
7932
7953
|
/* @__PURE__ */ r(
|
|
7933
|
-
|
|
7954
|
+
_n,
|
|
7934
7955
|
{
|
|
7935
7956
|
ref: z,
|
|
7936
7957
|
visibleSteps: K,
|
|
@@ -7939,7 +7960,7 @@ const ra = ({
|
|
|
7939
7960
|
}
|
|
7940
7961
|
)
|
|
7941
7962
|
] });
|
|
7942
|
-
},
|
|
7963
|
+
}, j = () => {
|
|
7943
7964
|
const K = {
|
|
7944
7965
|
applicantId: e,
|
|
7945
7966
|
onComplete: async () => {
|
|
@@ -7949,23 +7970,23 @@ const ra = ({
|
|
|
7949
7970
|
};
|
|
7950
7971
|
switch (c.action) {
|
|
7951
7972
|
case ce.Questionaries:
|
|
7952
|
-
return /* @__PURE__ */ r(
|
|
7973
|
+
return /* @__PURE__ */ r(vn, { ...K });
|
|
7953
7974
|
case ce.UploadDocument:
|
|
7954
|
-
return /* @__PURE__ */ r(
|
|
7975
|
+
return /* @__PURE__ */ r(Sn, { ...K });
|
|
7955
7976
|
case ce.Overview:
|
|
7956
|
-
return /* @__PURE__ */ r(
|
|
7977
|
+
return /* @__PURE__ */ r(Cn, { ...K });
|
|
7957
7978
|
case ce.IdentitySdk:
|
|
7958
|
-
return /* @__PURE__ */ r(
|
|
7979
|
+
return /* @__PURE__ */ r(zn, { ...K });
|
|
7959
7980
|
case ce.RiskScoring:
|
|
7960
|
-
return /* @__PURE__ */ r(
|
|
7981
|
+
return /* @__PURE__ */ r(Tn, { ...K });
|
|
7961
7982
|
case ce.AdditionalData:
|
|
7962
7983
|
case ce.InvestorCategorization:
|
|
7963
|
-
return /* @__PURE__ */ r(
|
|
7984
|
+
return /* @__PURE__ */ r(Ln, { ...K });
|
|
7964
7985
|
case ce.AppropriatenessTest:
|
|
7965
|
-
return /* @__PURE__ */ r(
|
|
7986
|
+
return /* @__PURE__ */ r(Dn, { ...K });
|
|
7966
7987
|
case ce.ManualReview:
|
|
7967
7988
|
return /* @__PURE__ */ r(
|
|
7968
|
-
|
|
7989
|
+
Dt,
|
|
7969
7990
|
{
|
|
7970
7991
|
kycStatus: s.kycStatus,
|
|
7971
7992
|
reviewStatus: s.reviewStatus,
|
|
@@ -7989,9 +8010,9 @@ const ra = ({
|
|
|
7989
8010
|
};
|
|
7990
8011
|
return /* @__PURE__ */ o("div", { className: `metakyc-sdk ${i || ""}`, children: [
|
|
7991
8012
|
M(),
|
|
7992
|
-
|
|
8013
|
+
j()
|
|
7993
8014
|
] });
|
|
7994
|
-
},
|
|
8015
|
+
}, _n = ke.forwardRef(
|
|
7995
8016
|
({ visibleSteps: e, currentVisibleStepIndex: t, getStepFallbackName: n }, a) => {
|
|
7996
8017
|
const i = ke.useRef(null), s = ke.useRef(null);
|
|
7997
8018
|
return ke.useImperativeHandle(a, () => i.current), ke.useEffect(() => {
|
|
@@ -8076,12 +8097,12 @@ const ra = ({
|
|
|
8076
8097
|
);
|
|
8077
8098
|
}
|
|
8078
8099
|
);
|
|
8079
|
-
function
|
|
8100
|
+
function la(e) {
|
|
8080
8101
|
return Ye.object({
|
|
8081
8102
|
questionResults: Ye.any()
|
|
8082
8103
|
}).passthrough();
|
|
8083
8104
|
}
|
|
8084
|
-
function
|
|
8105
|
+
function jn(e) {
|
|
8085
8106
|
let t = Ye.array(Ye.instanceof(File));
|
|
8086
8107
|
if (e.isRequired ? t = t.min(
|
|
8087
8108
|
1,
|
|
@@ -8103,38 +8124,38 @@ function zn(e) {
|
|
|
8103
8124
|
}
|
|
8104
8125
|
return t;
|
|
8105
8126
|
}
|
|
8106
|
-
function
|
|
8127
|
+
function ca(e) {
|
|
8107
8128
|
const t = {};
|
|
8108
8129
|
return e.uploadDocumentFiles.forEach((n) => {
|
|
8109
8130
|
const a = `file_${n.id}`;
|
|
8110
|
-
t[a] =
|
|
8131
|
+
t[a] = jn(n);
|
|
8111
8132
|
}), Ye.object(t);
|
|
8112
8133
|
}
|
|
8113
|
-
function
|
|
8134
|
+
function da(e) {
|
|
8114
8135
|
return Ye.any();
|
|
8115
8136
|
}
|
|
8116
|
-
function
|
|
8137
|
+
function Hn(e) {
|
|
8117
8138
|
return Ye.string().min(1, "This question is required");
|
|
8118
8139
|
}
|
|
8119
|
-
function
|
|
8140
|
+
function ua(e) {
|
|
8120
8141
|
const t = {};
|
|
8121
8142
|
return e.appropriatenessQuestions.forEach((n) => {
|
|
8122
8143
|
const a = `question_${n.id}`;
|
|
8123
|
-
t[a] =
|
|
8144
|
+
t[a] = Hn();
|
|
8124
8145
|
}), Ye.object(t);
|
|
8125
8146
|
}
|
|
8126
|
-
const
|
|
8147
|
+
const pa = Ye.any();
|
|
8127
8148
|
export {
|
|
8128
|
-
|
|
8129
|
-
|
|
8149
|
+
Et as ALLOWED_LANGUAGES,
|
|
8150
|
+
Xt as ApplicantProgressOnHoldReason,
|
|
8130
8151
|
ze as ApplicantProgressStatus,
|
|
8131
|
-
|
|
8132
|
-
|
|
8133
|
-
|
|
8134
|
-
|
|
8135
|
-
|
|
8136
|
-
|
|
8137
|
-
|
|
8152
|
+
hr as ApplicantService,
|
|
8153
|
+
tr as ApplicantStatus,
|
|
8154
|
+
or as AppropriatenessQuestionType,
|
|
8155
|
+
br as AppropriatenessTestService,
|
|
8156
|
+
Dn as AppropriatenessTestStep,
|
|
8157
|
+
_t as Badge,
|
|
8158
|
+
wr as BaseInformationService,
|
|
8138
8159
|
Z as Button,
|
|
8139
8160
|
st as COMPANY_FIELD_METADATA,
|
|
8140
8161
|
re as Card,
|
|
@@ -8143,106 +8164,106 @@ export {
|
|
|
8143
8164
|
Se as CardHeader,
|
|
8144
8165
|
Be as Checkbox,
|
|
8145
8166
|
Ze as CountriesType,
|
|
8146
|
-
|
|
8147
|
-
|
|
8148
|
-
|
|
8149
|
-
|
|
8150
|
-
|
|
8151
|
-
|
|
8152
|
-
|
|
8167
|
+
ia as CreateApplicantForm,
|
|
8168
|
+
oa as CreateCompanyApplicantForm,
|
|
8169
|
+
lr as CriteriaBuiltInType,
|
|
8170
|
+
dr as DEFAULT_COMPANY_VISIBLE_FIELDS,
|
|
8171
|
+
ur as DEFAULT_VISIBLE_FIELDS,
|
|
8172
|
+
ir as DocumentReviewStatus,
|
|
8173
|
+
mr as EndpointBuilder,
|
|
8153
8174
|
ut as ErrorHandler,
|
|
8154
|
-
|
|
8175
|
+
Tr as EventEmitter,
|
|
8155
8176
|
at as FIELD_METADATA,
|
|
8156
|
-
|
|
8157
|
-
|
|
8177
|
+
ar as FileType,
|
|
8178
|
+
cn as FileUpload,
|
|
8158
8179
|
bt as GenderType,
|
|
8159
8180
|
mt as Header,
|
|
8160
|
-
|
|
8181
|
+
yr as HttpClient,
|
|
8161
8182
|
Je as IdentityProviderManager,
|
|
8162
|
-
|
|
8183
|
+
kr as IdentityService,
|
|
8163
8184
|
Oe as IdentityVerificationProvider,
|
|
8164
|
-
|
|
8185
|
+
zn as IdentityVerificationStep,
|
|
8165
8186
|
xe as Input,
|
|
8166
|
-
|
|
8167
|
-
|
|
8187
|
+
Sr as InvestorCategorizationService,
|
|
8188
|
+
Ln as InvestorCategorizationStep,
|
|
8168
8189
|
Ee as InvestorCategorizationType,
|
|
8169
|
-
|
|
8170
|
-
|
|
8190
|
+
cr as InvestorCategoryType,
|
|
8191
|
+
rr as KycProcessStatus,
|
|
8171
8192
|
rt as KycStatus,
|
|
8172
|
-
|
|
8173
|
-
|
|
8174
|
-
|
|
8175
|
-
|
|
8193
|
+
Dt as KycStatusDisplay,
|
|
8194
|
+
sa as KycWorkflow,
|
|
8195
|
+
$n as Logo,
|
|
8196
|
+
$t as MetaKYCContext,
|
|
8176
8197
|
Ke as MetaKYCError,
|
|
8177
|
-
|
|
8178
|
-
|
|
8179
|
-
|
|
8180
|
-
|
|
8181
|
-
|
|
8182
|
-
|
|
8183
|
-
|
|
8184
|
-
|
|
8198
|
+
Zn as MetaKYCProvider,
|
|
8199
|
+
sn as MultiSelect,
|
|
8200
|
+
$r as OnfidoProvider,
|
|
8201
|
+
xr as OverviewService,
|
|
8202
|
+
Cn as OverviewStep,
|
|
8203
|
+
dn as PhoneInput,
|
|
8204
|
+
fr as QuestionnaireService,
|
|
8205
|
+
vn as QuestionnaireStep,
|
|
8185
8206
|
nt as ReviewStatus,
|
|
8186
|
-
|
|
8187
|
-
|
|
8188
|
-
|
|
8189
|
-
|
|
8190
|
-
|
|
8191
|
-
|
|
8207
|
+
sr as RiskCriteriaType,
|
|
8208
|
+
er as RiskLevel,
|
|
8209
|
+
vr as RiskScoringService,
|
|
8210
|
+
Tn as RiskScoringStep,
|
|
8211
|
+
Hr as SDK_VERSION,
|
|
8212
|
+
Br as SardinAIProvider,
|
|
8192
8213
|
Ve as SearchableSelect,
|
|
8193
|
-
|
|
8214
|
+
Nt as Select,
|
|
8194
8215
|
Me as Spinner,
|
|
8195
|
-
|
|
8196
|
-
|
|
8197
|
-
|
|
8216
|
+
Lr as StepRouter,
|
|
8217
|
+
zr as SumsubProvider,
|
|
8218
|
+
jr as ThemeManager,
|
|
8198
8219
|
Fe as ThemePreset,
|
|
8199
|
-
|
|
8200
|
-
|
|
8201
|
-
|
|
8202
|
-
|
|
8220
|
+
Ar as ThemeService,
|
|
8221
|
+
gr as UploadDocumentService,
|
|
8222
|
+
Sn as UploadDocumentStep,
|
|
8223
|
+
nr as UserType,
|
|
8203
8224
|
qe as ValueDataType,
|
|
8204
|
-
|
|
8225
|
+
Dr as WorkflowOrchestrator,
|
|
8205
8226
|
gt as WorkflowResultType,
|
|
8206
|
-
|
|
8227
|
+
Pr as WorkflowState,
|
|
8207
8228
|
ce as WorkflowStepAction,
|
|
8208
|
-
|
|
8209
|
-
|
|
8210
|
-
|
|
8211
|
-
|
|
8229
|
+
pa as appropriatenessTestSchema,
|
|
8230
|
+
na as clearAllStorage,
|
|
8231
|
+
Yr as clearApplicantId,
|
|
8232
|
+
Gr as clearWorkflowState,
|
|
8212
8233
|
Ae as cn,
|
|
8213
|
-
|
|
8214
|
-
|
|
8234
|
+
Cr as corporateTheme,
|
|
8235
|
+
pr as defaultConfig,
|
|
8215
8236
|
Le as defaultTheme,
|
|
8216
|
-
|
|
8217
|
-
|
|
8218
|
-
|
|
8219
|
-
|
|
8220
|
-
|
|
8221
|
-
|
|
8222
|
-
|
|
8223
|
-
|
|
8224
|
-
|
|
8237
|
+
Kr as fileToBase64,
|
|
8238
|
+
Nr as fintechTheme,
|
|
8239
|
+
vt as formatFileSize,
|
|
8240
|
+
ua as generateAppropriatenessSchema,
|
|
8241
|
+
la as generateQuestionnaireSchema,
|
|
8242
|
+
da as generateRiskScoringSchema,
|
|
8243
|
+
ca as generateUploadDocumentSchema,
|
|
8244
|
+
ta as getAcceptString,
|
|
8245
|
+
Vr as getApplicantId,
|
|
8225
8246
|
pt as getThemePreset,
|
|
8226
|
-
|
|
8227
|
-
|
|
8228
|
-
|
|
8229
|
-
|
|
8230
|
-
|
|
8231
|
-
|
|
8232
|
-
|
|
8233
|
-
|
|
8234
|
-
|
|
8235
|
-
|
|
8236
|
-
|
|
8237
|
-
|
|
8238
|
-
|
|
8239
|
-
|
|
8247
|
+
ra as getWorkflowState,
|
|
8248
|
+
Ir as healthcareTheme,
|
|
8249
|
+
Gn as isScriptLoaded,
|
|
8250
|
+
zt as loadScript,
|
|
8251
|
+
Er as minimalTheme,
|
|
8252
|
+
Rr as modernTheme,
|
|
8253
|
+
Jn as removeScript,
|
|
8254
|
+
qr as saveApplicantId,
|
|
8255
|
+
Qr as saveWorkflowState,
|
|
8256
|
+
Fr as themePresets,
|
|
8257
|
+
Bt as useApplicant,
|
|
8258
|
+
aa as useAppropriatenessTest,
|
|
8259
|
+
tn as useIdentityVerification,
|
|
8260
|
+
Jr as useKycWorkflow,
|
|
8240
8261
|
Te as useMetaKYC,
|
|
8241
|
-
|
|
8242
|
-
|
|
8243
|
-
|
|
8244
|
-
|
|
8245
|
-
|
|
8246
|
-
|
|
8262
|
+
en as useOverview,
|
|
8263
|
+
Zr as useQuestionnaire,
|
|
8264
|
+
rn as useRiskScoring,
|
|
8265
|
+
Xr as useUploadDocument,
|
|
8266
|
+
Xn as validateFileSize,
|
|
8267
|
+
ea as validateFileType
|
|
8247
8268
|
};
|
|
8248
8269
|
//# sourceMappingURL=index.js.map
|