@vpdev2/metakyc-sdk 1.0.80 → 1.0.81
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/components/core/MultiSelect.d.ts.map +1 -1
- package/dist/components/core/SearchableSelect.d.ts.map +1 -1
- package/dist/index.cjs +14 -14
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +859 -845
- package/dist/index.js.map +1 -1
- package/dist/styles.css +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -3,13 +3,13 @@ var kt = (e, t, n) => t in e ? vt(e, t, { enumerable: !0, configurable: !0, writ
|
|
|
3
3
|
var ae = (e, t, n) => kt(e, typeof t != "symbol" ? t + "" : t, n);
|
|
4
4
|
import wt from "axios";
|
|
5
5
|
import * as ot from "react";
|
|
6
|
-
import ve, { createContext as Nt, useState as k, useMemo as Pe, useEffect as ie, useContext as St, useRef as te, useCallback as
|
|
7
|
-
import { jsx as r, jsxs as o, Fragment as
|
|
6
|
+
import ve, { createContext as Nt, useState as k, useMemo as Pe, useEffect as ie, useContext as St, useRef as te, useCallback as Q, forwardRef as Qe, createElement as nt } from "react";
|
|
7
|
+
import { jsx as r, jsxs as o, Fragment as qe } from "react/jsx-runtime";
|
|
8
8
|
import Ct, { createPortal as it } from "react-dom";
|
|
9
|
-
import { useForm as Et, Controller as
|
|
9
|
+
import { useForm as Et, Controller as Le } from "react-hook-form";
|
|
10
10
|
import { z as Ae } from "zod";
|
|
11
|
-
var
|
|
12
|
-
const
|
|
11
|
+
var ee = /* @__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))(ee || {}), Je = /* @__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))(Je || {}), Ne = /* @__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))(Ne || {}), It = /* @__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))(It || {}), At = /* @__PURE__ */ ((e) => (e[e.LowRisk = 0] = "LowRisk", e[e.MediumRisk = 1] = "MediumRisk", e[e.HighRisk = 2] = "HighRisk", e[e.Alert = 3] = "Alert", e))(At || {}), De = /* @__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))(De || {}), Me = /* @__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))(Me || {}), Rt = /* @__PURE__ */ ((e) => (e[e.ProviderResultPending = 0] = "ProviderResultPending", e[e.ProviderResultReceived = 1] = "ProviderResultReceived", e[e.Canceled = 2] = "Canceled", e[e.ExtendedToNewApplicant = 3] = "ExtendedToNewApplicant", e))(Rt || {}), Pt = /* @__PURE__ */ ((e) => (e[e.None = 0] = "None", e[e.ProviderResultPending = 1] = "ProviderResultPending", e[e.ProviderResultReceived = 2] = "ProviderResultReceived", e[e.Canceled = 3] = "Canceled", e))(Pt || {}), we = /* @__PURE__ */ ((e) => (e[e.Onfido = 0] = "Onfido", e[e.Sumsub = 2] = "Sumsub", e[e.SardinAI = 3] = "SardinAI", e))(we || {}), Tt = /* @__PURE__ */ ((e) => (e[e.Individual = 0] = "Individual", e[e.Company = 1] = "Company", e))(Tt || {}), Ze = /* @__PURE__ */ ((e) => (e[e.Male = 0] = "Male", e[e.Female = 1] = "Female", e[e.Other = 2] = "Other", e))(Ze || {}), Ft = /* @__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))(Ft || {}), Lt = /* @__PURE__ */ ((e) => (e[e.Pending = 0] = "Pending", e[e.Approved = 1] = "Approved", e[e.Rejected = 2] = "Rejected", e[e.RequiresRevision = 3] = "RequiresRevision", e))(Lt || {}), Dt = /* @__PURE__ */ ((e) => (e[e.SingleChoice = 0] = "SingleChoice", e[e.MultipleChoice = 1] = "MultipleChoice", e[e.Text = 2] = "Text", e))(Dt || {}), Ie = /* @__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))(Ie || {}), Mt = /* @__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))(Mt || {}), Ot = /* @__PURE__ */ ((e) => (e[e.None = 0] = "None", e[e.Country = 1] = "Country", e))(Ot || {}), xe = /* @__PURE__ */ ((e) => (e[e.Individual = 0] = "Individual", e[e.Sophisticated = 1] = "Sophisticated", e[e.HighNetWorth = 2] = "HighNetWorth", e[e.Business = 3] = "Business", e))(xe || {}), Bt = /* @__PURE__ */ ((e) => (e[e.Retail = 0] = "Retail", e[e.Professional = 1] = "Professional", e[e.EligibleCounterparty = 2] = "EligibleCounterparty", e))(Bt || {});
|
|
12
|
+
const Be = {
|
|
13
13
|
Nationality: 10,
|
|
14
14
|
Address: 20,
|
|
15
15
|
CountryOfBirth: 30,
|
|
@@ -23,22 +23,22 @@ const $e = {
|
|
|
23
23
|
dateOfBirth: { label: "Date of Birth", type: "date" },
|
|
24
24
|
salutation: { label: "Salutation", type: "select" },
|
|
25
25
|
title: { label: "Title", type: "text" },
|
|
26
|
-
mobileCountryCode: { label: "Mobile Country Code", type: "select", countriesType:
|
|
26
|
+
mobileCountryCode: { label: "Mobile Country Code", type: "select", countriesType: Be.PhoneNumber },
|
|
27
27
|
street: { label: "Street", type: "text" },
|
|
28
28
|
streetNumber: { label: "Street Number", type: "text" },
|
|
29
29
|
zip: { label: "ZIP / Postal Code", type: "text" },
|
|
30
30
|
city: { label: "City", type: "text" },
|
|
31
|
-
country: { label: "Country", type: "select", countriesType:
|
|
32
|
-
nationality: { label: "Nationality", type: "select", countriesType:
|
|
33
|
-
otherNationality: { label: "Other Nationalities", type: "multiselect", countriesType:
|
|
34
|
-
countryOfBirth: { label: "Country of Birth", type: "select", countriesType:
|
|
31
|
+
country: { label: "Country", type: "select", countriesType: Be.Address },
|
|
32
|
+
nationality: { label: "Nationality", type: "select", countriesType: Be.Nationality },
|
|
33
|
+
otherNationality: { label: "Other Nationalities", type: "multiselect", countriesType: Be.Nationality },
|
|
34
|
+
countryOfBirth: { label: "Country of Birth", type: "select", countriesType: Be.CountryOfBirth },
|
|
35
35
|
placeOfBirth: { label: "Place of Birth", type: "text" },
|
|
36
|
-
taxCountry: { label: "Tax Country", type: "select", countriesType:
|
|
36
|
+
taxCountry: { label: "Tax Country", type: "select", countriesType: Be.Address },
|
|
37
37
|
taxNumber: { label: "Tax Number", type: "text" },
|
|
38
38
|
defaultLanguage: { label: "Default Language", type: "select" },
|
|
39
39
|
educationLevel: { label: "Education Level", type: "text" },
|
|
40
40
|
occupation: { label: "Occupation", type: "text" }
|
|
41
|
-
},
|
|
41
|
+
}, $t = [
|
|
42
42
|
"firstName",
|
|
43
43
|
"lastName",
|
|
44
44
|
"email",
|
|
@@ -64,7 +64,7 @@ const $e = {
|
|
|
64
64
|
{ value: "NO", label: "Norwegian" }
|
|
65
65
|
];
|
|
66
66
|
var pe = /* @__PURE__ */ ((e) => (e.Default = "default", e.Corporate = "corporate", e.Fintech = "fintech", e.Healthcare = "healthcare", e.Modern = "modern", e.Minimal = "minimal", e))(pe || {});
|
|
67
|
-
const
|
|
67
|
+
const zt = {
|
|
68
68
|
timeout: 3e4,
|
|
69
69
|
retries: 3,
|
|
70
70
|
locale: "en",
|
|
@@ -174,7 +174,7 @@ class Ht {
|
|
|
174
174
|
ae(this, "axiosInstance");
|
|
175
175
|
ae(this, "endpointBuilder");
|
|
176
176
|
ae(this, "config");
|
|
177
|
-
this.config = { ...
|
|
177
|
+
this.config = { ...zt, ...t }, this.endpointBuilder = new _t(this.config.endpoints), this.axiosInstance = wt.create({
|
|
178
178
|
baseURL: this.config.baseUrl,
|
|
179
179
|
timeout: this.config.timeout,
|
|
180
180
|
headers: {
|
|
@@ -486,7 +486,7 @@ class Yt {
|
|
|
486
486
|
await this.httpClient.get("Applicant", "PassOverview", { applicantId: t });
|
|
487
487
|
}
|
|
488
488
|
}
|
|
489
|
-
class
|
|
489
|
+
class Vt {
|
|
490
490
|
constructor(t) {
|
|
491
491
|
this.httpClient = t;
|
|
492
492
|
}
|
|
@@ -521,7 +521,7 @@ class qt {
|
|
|
521
521
|
)).result;
|
|
522
522
|
}
|
|
523
523
|
}
|
|
524
|
-
class
|
|
524
|
+
class qt {
|
|
525
525
|
constructor(t) {
|
|
526
526
|
this.httpClient = t;
|
|
527
527
|
}
|
|
@@ -1177,7 +1177,7 @@ class sr {
|
|
|
1177
1177
|
async loadStepData(t, n) {
|
|
1178
1178
|
const a = this.getHandler(t);
|
|
1179
1179
|
if (!a)
|
|
1180
|
-
throw new Error(`No handler registered for step action: ${
|
|
1180
|
+
throw new Error(`No handler registered for step action: ${ee[t]}`);
|
|
1181
1181
|
return a.loadData(n);
|
|
1182
1182
|
}
|
|
1183
1183
|
/**
|
|
@@ -1186,7 +1186,7 @@ class sr {
|
|
|
1186
1186
|
async submitStepData(t, n) {
|
|
1187
1187
|
const a = this.getHandler(t);
|
|
1188
1188
|
if (!a)
|
|
1189
|
-
throw new Error(`No handler registered for step action: ${
|
|
1189
|
+
throw new Error(`No handler registered for step action: ${ee[t]}`);
|
|
1190
1190
|
return a.submitData(n);
|
|
1191
1191
|
}
|
|
1192
1192
|
}
|
|
@@ -1200,47 +1200,47 @@ class or {
|
|
|
1200
1200
|
* Register all step handlers
|
|
1201
1201
|
*/
|
|
1202
1202
|
registerStepHandlers() {
|
|
1203
|
-
this.stepRouter.registerHandler(
|
|
1203
|
+
this.stepRouter.registerHandler(ee.Questionaries, {
|
|
1204
1204
|
loadData: (t) => this.questionnaireService.getQuestionnaire(t),
|
|
1205
1205
|
submitData: async (t) => {
|
|
1206
1206
|
await this.questionnaireService.fillQuestionnaire(t);
|
|
1207
1207
|
}
|
|
1208
|
-
}), this.stepRouter.registerHandler(
|
|
1208
|
+
}), this.stepRouter.registerHandler(ee.UploadDocument, {
|
|
1209
1209
|
loadData: (t) => this.uploadDocumentService.getUploadDocument(t),
|
|
1210
1210
|
submitData: (t) => this.uploadDocumentService.fillUploadDocument(t)
|
|
1211
|
-
}), this.stepRouter.registerHandler(
|
|
1211
|
+
}), this.stepRouter.registerHandler(ee.AppropriatenessTest, {
|
|
1212
1212
|
loadData: (t) => this.appropriatenessTestService.getAppropriatenessTest(t),
|
|
1213
1213
|
submitData: async (t) => {
|
|
1214
1214
|
await this.appropriatenessTestService.fillAppropriatenessTest(t);
|
|
1215
1215
|
}
|
|
1216
|
-
}), this.stepRouter.registerHandler(
|
|
1216
|
+
}), this.stepRouter.registerHandler(ee.Overview, {
|
|
1217
1217
|
loadData: (t) => this.overviewService.getOverviewData(t),
|
|
1218
1218
|
submitData: (t) => this.overviewService.passOverview(t.applicantId)
|
|
1219
|
-
}), this.stepRouter.registerHandler(
|
|
1219
|
+
}), this.stepRouter.registerHandler(ee.RiskScoring, {
|
|
1220
1220
|
loadData: (t) => this.riskScoringService.getRiskCriterias(t),
|
|
1221
1221
|
submitData: async (t) => {
|
|
1222
1222
|
await this.riskScoringService.submitRiskScoring(t);
|
|
1223
1223
|
}
|
|
1224
|
-
}), this.stepRouter.registerHandler(
|
|
1224
|
+
}), this.stepRouter.registerHandler(ee.IdentitySdk, {
|
|
1225
1225
|
loadData: async (t) => ({
|
|
1226
1226
|
applicantId: t,
|
|
1227
1227
|
message: "Identity verification required"
|
|
1228
1228
|
}),
|
|
1229
1229
|
submitData: async () => {
|
|
1230
1230
|
}
|
|
1231
|
-
}), this.stepRouter.registerHandler(
|
|
1231
|
+
}), this.stepRouter.registerHandler(ee.InvestorCategorization, {
|
|
1232
1232
|
loadData: (t) => this.investorCategorizationService.getInvestorCategorization(t),
|
|
1233
1233
|
submitData: async (t) => {
|
|
1234
1234
|
await this.investorCategorizationService.setInvestorCategorization(t);
|
|
1235
1235
|
}
|
|
1236
|
-
}), this.stepRouter.registerHandler(
|
|
1236
|
+
}), this.stepRouter.registerHandler(ee.ManualReview, {
|
|
1237
1237
|
loadData: async (t) => ({
|
|
1238
1238
|
applicantId: t,
|
|
1239
1239
|
message: "Your application is under manual review"
|
|
1240
1240
|
}),
|
|
1241
1241
|
submitData: async () => {
|
|
1242
1242
|
}
|
|
1243
|
-
}), this.stepRouter.registerHandler(
|
|
1243
|
+
}), this.stepRouter.registerHandler(ee.AdditionalData, {
|
|
1244
1244
|
loadData: async (t) => ({
|
|
1245
1245
|
applicantId: t,
|
|
1246
1246
|
message: "Additional data required"
|
|
@@ -1616,7 +1616,7 @@ class dr {
|
|
|
1616
1616
|
this.sardineContext && (this.sardineContext = null);
|
|
1617
1617
|
}
|
|
1618
1618
|
}
|
|
1619
|
-
class
|
|
1619
|
+
class $e {
|
|
1620
1620
|
/**
|
|
1621
1621
|
* Create a provider instance
|
|
1622
1622
|
*/
|
|
@@ -1845,7 +1845,7 @@ class mr {
|
|
|
1845
1845
|
}
|
|
1846
1846
|
const yt = Nt(null), mn = ({ config: e, children: t }) => {
|
|
1847
1847
|
const [n, a] = k(null), s = ve.useRef(!1), l = ve.useRef(!1), c = Pe(() => {
|
|
1848
|
-
const h = new Ht(e), m = new Ut(h), v = new jt(h), w = new Kt(h), f = new Wt(h), N = new Yt(h), b = new
|
|
1848
|
+
const h = new Ht(e), m = new Ut(h), v = new jt(h), w = new Kt(h), f = new Wt(h), N = new Yt(h), b = new Vt(h), P = new qt(h), T = new Qt(h), R = new Gt(h), O = new nr(h), A = new mr();
|
|
1849
1849
|
return {
|
|
1850
1850
|
httpClient: h,
|
|
1851
1851
|
applicantService: m,
|
|
@@ -1854,11 +1854,11 @@ const yt = Nt(null), mn = ({ config: e, children: t }) => {
|
|
|
1854
1854
|
appropriatenessTestService: f,
|
|
1855
1855
|
overviewService: N,
|
|
1856
1856
|
riskScoringService: b,
|
|
1857
|
-
identityService:
|
|
1858
|
-
baseInformationService:
|
|
1859
|
-
investorCategorizationService:
|
|
1857
|
+
identityService: P,
|
|
1858
|
+
baseInformationService: T,
|
|
1859
|
+
investorCategorizationService: R,
|
|
1860
1860
|
themeService: O,
|
|
1861
|
-
themeManager:
|
|
1861
|
+
themeManager: A
|
|
1862
1862
|
};
|
|
1863
1863
|
}, [e]), u = Pe(() => ({
|
|
1864
1864
|
config: e,
|
|
@@ -1936,20 +1936,20 @@ function yn(e) {
|
|
|
1936
1936
|
function ue(...e) {
|
|
1937
1937
|
return e.filter(Boolean).join(" ");
|
|
1938
1938
|
}
|
|
1939
|
-
const
|
|
1939
|
+
const ze = {
|
|
1940
1940
|
APPLICANT_ID: "metakyc_applicant_id",
|
|
1941
1941
|
WORKFLOW_STATE: "metakyc_workflow_state"
|
|
1942
1942
|
};
|
|
1943
1943
|
function hr(e) {
|
|
1944
1944
|
try {
|
|
1945
|
-
localStorage.setItem(
|
|
1945
|
+
localStorage.setItem(ze.APPLICANT_ID, e.toString());
|
|
1946
1946
|
} catch (t) {
|
|
1947
1947
|
console.warn("Failed to save applicant ID to storage:", t);
|
|
1948
1948
|
}
|
|
1949
1949
|
}
|
|
1950
1950
|
function yr() {
|
|
1951
1951
|
try {
|
|
1952
|
-
const e = localStorage.getItem(
|
|
1952
|
+
const e = localStorage.getItem(ze.APPLICANT_ID);
|
|
1953
1953
|
return e ? parseInt(e, 10) : null;
|
|
1954
1954
|
} catch (e) {
|
|
1955
1955
|
return console.warn("Failed to retrieve applicant ID from storage:", e), null;
|
|
@@ -1957,21 +1957,21 @@ function yr() {
|
|
|
1957
1957
|
}
|
|
1958
1958
|
function gr() {
|
|
1959
1959
|
try {
|
|
1960
|
-
localStorage.removeItem(
|
|
1960
|
+
localStorage.removeItem(ze.APPLICANT_ID);
|
|
1961
1961
|
} catch (e) {
|
|
1962
1962
|
console.warn("Failed to clear applicant ID from storage:", e);
|
|
1963
1963
|
}
|
|
1964
1964
|
}
|
|
1965
1965
|
function fr(e) {
|
|
1966
1966
|
try {
|
|
1967
|
-
localStorage.setItem(
|
|
1967
|
+
localStorage.setItem(ze.WORKFLOW_STATE, JSON.stringify(e));
|
|
1968
1968
|
} catch (t) {
|
|
1969
1969
|
console.warn("Failed to save workflow state to storage:", t);
|
|
1970
1970
|
}
|
|
1971
1971
|
}
|
|
1972
1972
|
function gn() {
|
|
1973
1973
|
try {
|
|
1974
|
-
const e = localStorage.getItem(
|
|
1974
|
+
const e = localStorage.getItem(ze.WORKFLOW_STATE);
|
|
1975
1975
|
return e ? JSON.parse(e) : null;
|
|
1976
1976
|
} catch (e) {
|
|
1977
1977
|
return console.warn("Failed to retrieve workflow state from storage:", e), null;
|
|
@@ -1979,7 +1979,7 @@ function gn() {
|
|
|
1979
1979
|
}
|
|
1980
1980
|
function br() {
|
|
1981
1981
|
try {
|
|
1982
|
-
localStorage.removeItem(
|
|
1982
|
+
localStorage.removeItem(ze.WORKFLOW_STATE);
|
|
1983
1983
|
} catch (e) {
|
|
1984
1984
|
console.warn("Failed to clear workflow state from storage:", e);
|
|
1985
1985
|
}
|
|
@@ -1992,17 +1992,17 @@ function xr(e) {
|
|
|
1992
1992
|
ie(() => {
|
|
1993
1993
|
h.current || (h.current = t());
|
|
1994
1994
|
}, [t]), ie(() => {
|
|
1995
|
-
var
|
|
1995
|
+
var A;
|
|
1996
1996
|
n && m && (hr(m), fr({
|
|
1997
1997
|
applicantId: m,
|
|
1998
|
-
currentStepOrder: (
|
|
1998
|
+
currentStepOrder: (A = n.currentStep) == null ? void 0 : A.order,
|
|
1999
1999
|
status: n.status,
|
|
2000
2000
|
lastUpdated: (/* @__PURE__ */ new Date()).toISOString(),
|
|
2001
2001
|
workflowKey: n.workFlowKey,
|
|
2002
2002
|
nextWorkflowKey: n.nextWorkflowKey
|
|
2003
2003
|
}));
|
|
2004
2004
|
}, [n, m]);
|
|
2005
|
-
const v = te(!1), w = te(!1), f =
|
|
2005
|
+
const v = te(!1), w = te(!1), f = Q(async () => {
|
|
2006
2006
|
if (!(!m || !h.current)) {
|
|
2007
2007
|
if (v.current) {
|
|
2008
2008
|
console.log("[Workflow] Load already in progress, skipping...");
|
|
@@ -2010,10 +2010,10 @@ function xr(e) {
|
|
|
2010
2010
|
}
|
|
2011
2011
|
v.current = !0, l(!0), u(null);
|
|
2012
2012
|
try {
|
|
2013
|
-
const
|
|
2014
|
-
a(
|
|
2015
|
-
} catch (
|
|
2016
|
-
u(
|
|
2013
|
+
const A = await h.current.initialize(m);
|
|
2014
|
+
a(A), w.current = !0;
|
|
2015
|
+
} catch (A) {
|
|
2016
|
+
u(A);
|
|
2017
2017
|
} finally {
|
|
2018
2018
|
l(!1), v.current = !1;
|
|
2019
2019
|
}
|
|
@@ -2022,7 +2022,7 @@ function xr(e) {
|
|
|
2022
2022
|
ie(() => {
|
|
2023
2023
|
m && !w.current && f();
|
|
2024
2024
|
}, [m, f]);
|
|
2025
|
-
const N =
|
|
2025
|
+
const N = Q(async () => {
|
|
2026
2026
|
if (h.current) {
|
|
2027
2027
|
if (v.current) {
|
|
2028
2028
|
console.log("[Workflow] Refresh already in progress, skipping...");
|
|
@@ -2030,57 +2030,57 @@ function xr(e) {
|
|
|
2030
2030
|
}
|
|
2031
2031
|
v.current = !0, l(!0), u(null);
|
|
2032
2032
|
try {
|
|
2033
|
-
const
|
|
2034
|
-
a(
|
|
2035
|
-
} catch (
|
|
2036
|
-
u(
|
|
2033
|
+
const A = await h.current.refreshProgress();
|
|
2034
|
+
a(A);
|
|
2035
|
+
} catch (A) {
|
|
2036
|
+
u(A);
|
|
2037
2037
|
} finally {
|
|
2038
2038
|
l(!1), v.current = !1;
|
|
2039
2039
|
}
|
|
2040
2040
|
}
|
|
2041
|
-
}, []), b =
|
|
2041
|
+
}, []), b = Q(async () => {
|
|
2042
2042
|
if (h.current) {
|
|
2043
2043
|
l(!0), u(null);
|
|
2044
2044
|
try {
|
|
2045
|
-
const
|
|
2046
|
-
a(
|
|
2047
|
-
} catch (
|
|
2048
|
-
u(
|
|
2045
|
+
const A = await h.current.moveToNextStep();
|
|
2046
|
+
a(A);
|
|
2047
|
+
} catch (A) {
|
|
2048
|
+
u(A);
|
|
2049
2049
|
} finally {
|
|
2050
2050
|
l(!1);
|
|
2051
2051
|
}
|
|
2052
2052
|
}
|
|
2053
|
-
}, []),
|
|
2053
|
+
}, []), P = Q(async () => {
|
|
2054
2054
|
if (h.current) {
|
|
2055
2055
|
l(!0), u(null);
|
|
2056
2056
|
try {
|
|
2057
|
-
const
|
|
2058
|
-
a(
|
|
2059
|
-
} catch (
|
|
2060
|
-
u(
|
|
2057
|
+
const A = await h.current.moveToPreviousStep();
|
|
2058
|
+
a(A);
|
|
2059
|
+
} catch (A) {
|
|
2060
|
+
u(A);
|
|
2061
2061
|
} finally {
|
|
2062
2062
|
l(!1);
|
|
2063
2063
|
}
|
|
2064
2064
|
}
|
|
2065
|
-
}, []),
|
|
2065
|
+
}, []), T = Q(async (A) => {
|
|
2066
2066
|
if (h.current) {
|
|
2067
2067
|
l(!0), u(null);
|
|
2068
2068
|
try {
|
|
2069
|
-
await h.current.submitCurrentStep(
|
|
2070
|
-
const
|
|
2071
|
-
a(
|
|
2072
|
-
} catch (
|
|
2073
|
-
throw u(
|
|
2069
|
+
await h.current.submitCurrentStep(A);
|
|
2070
|
+
const F = await h.current.refreshProgress();
|
|
2071
|
+
a(F);
|
|
2072
|
+
} catch (F) {
|
|
2073
|
+
throw u(F), F;
|
|
2074
2074
|
} finally {
|
|
2075
2075
|
l(!1);
|
|
2076
2076
|
}
|
|
2077
2077
|
}
|
|
2078
|
-
}, []),
|
|
2078
|
+
}, []), R = ot.useMemo(() => n != null && n.stepInfoList ? [...n.stepInfoList].sort((A, F) => A.order - F.order) : [], [n == null ? void 0 : n.stepInfoList]), O = ot.useMemo(() => n ? n.nextWorkflowKey && n.nextWorkflowKey !== n.workFlowKey : !1, [n]);
|
|
2079
2079
|
return {
|
|
2080
2080
|
progress: n,
|
|
2081
2081
|
applicantId: m,
|
|
2082
2082
|
currentStep: (n == null ? void 0 : n.currentStep) || null,
|
|
2083
|
-
steps:
|
|
2083
|
+
steps: R,
|
|
2084
2084
|
status: (n == null ? void 0 : n.status) || Ne.None,
|
|
2085
2085
|
workflowResult: (n == null ? void 0 : n.workflowResult) || null,
|
|
2086
2086
|
workflowKey: n == null ? void 0 : n.workFlowKey,
|
|
@@ -2092,14 +2092,14 @@ function xr(e) {
|
|
|
2092
2092
|
isOnHold: (n == null ? void 0 : n.status) === Ne.OnHold,
|
|
2093
2093
|
refreshProgress: N,
|
|
2094
2094
|
moveToNext: b,
|
|
2095
|
-
moveBack:
|
|
2096
|
-
submitCurrentStep:
|
|
2095
|
+
moveBack: P,
|
|
2096
|
+
submitCurrentStep: T,
|
|
2097
2097
|
orchestrator: h.current
|
|
2098
2098
|
};
|
|
2099
2099
|
}
|
|
2100
2100
|
function vr(e) {
|
|
2101
|
-
const { questionnaireService: t, applicantService: n } = be(), [a, s] = k(null), [l, c] = k({}), [u, h] = k(!1), [m, v] = k(!1), [w, f] = k(null), N = te(!1), b = te(null),
|
|
2102
|
-
var
|
|
2101
|
+
const { questionnaireService: t, applicantService: n } = be(), [a, s] = k(null), [l, c] = k({}), [u, h] = k(!1), [m, v] = k(!1), [w, f] = k(null), N = te(!1), b = te(null), P = Q(async () => {
|
|
2102
|
+
var R, O;
|
|
2103
2103
|
if (e) {
|
|
2104
2104
|
if (N.current) {
|
|
2105
2105
|
console.log("[Questionnaire] Load already in progress, skipping...");
|
|
@@ -2107,37 +2107,37 @@ function vr(e) {
|
|
|
2107
2107
|
}
|
|
2108
2108
|
N.current = !0, h(!0), f(null);
|
|
2109
2109
|
try {
|
|
2110
|
-
const [
|
|
2110
|
+
const [A, F] = await Promise.all([
|
|
2111
2111
|
t.getQuestionnaire(e),
|
|
2112
2112
|
n.getApplicantData(e).catch(() => null)
|
|
2113
2113
|
]);
|
|
2114
|
-
if (s(
|
|
2115
|
-
const
|
|
2116
|
-
for (const S of
|
|
2117
|
-
S.question && ((O = S.answers) != null && O.length) &&
|
|
2118
|
-
const re = {},
|
|
2119
|
-
for (const S of
|
|
2114
|
+
if (s(A), (R = F == null ? void 0 : F.questionnaireResults) != null && R.length && A) {
|
|
2115
|
+
const K = /* @__PURE__ */ new Map();
|
|
2116
|
+
for (const S of F.questionnaireResults)
|
|
2117
|
+
S.question && ((O = S.answers) != null && O.length) && K.set(S.question.trim().toLowerCase(), S.answers);
|
|
2118
|
+
const re = {}, B = A.questionGroups.flatMap((S) => S.questions ?? []);
|
|
2119
|
+
for (const S of B) {
|
|
2120
2120
|
const U = S.text.trim().toLowerCase();
|
|
2121
|
-
|
|
2121
|
+
K.has(U) && (re[S.id] = K.get(U));
|
|
2122
2122
|
}
|
|
2123
2123
|
c(re);
|
|
2124
2124
|
}
|
|
2125
2125
|
b.current = e;
|
|
2126
|
-
} catch (
|
|
2127
|
-
f(
|
|
2126
|
+
} catch (A) {
|
|
2127
|
+
f(A);
|
|
2128
2128
|
} finally {
|
|
2129
2129
|
h(!1), N.current = !1;
|
|
2130
2130
|
}
|
|
2131
2131
|
}
|
|
2132
2132
|
}, [e, t, n]);
|
|
2133
2133
|
ie(() => {
|
|
2134
|
-
e && b.current !== e &&
|
|
2134
|
+
e && b.current !== e && P();
|
|
2135
2135
|
}, [e]);
|
|
2136
|
-
const
|
|
2137
|
-
async (
|
|
2136
|
+
const T = Q(
|
|
2137
|
+
async (R) => {
|
|
2138
2138
|
v(!0), f(null);
|
|
2139
2139
|
try {
|
|
2140
|
-
return await t.fillQuestionnaire(
|
|
2140
|
+
return await t.fillQuestionnaire(R);
|
|
2141
2141
|
} catch (O) {
|
|
2142
2142
|
throw f(O), O;
|
|
2143
2143
|
} finally {
|
|
@@ -2152,12 +2152,12 @@ function vr(e) {
|
|
|
2152
2152
|
isLoading: u,
|
|
2153
2153
|
isSubmitting: m,
|
|
2154
2154
|
error: w,
|
|
2155
|
-
load:
|
|
2156
|
-
submit:
|
|
2155
|
+
load: P,
|
|
2156
|
+
submit: T
|
|
2157
2157
|
};
|
|
2158
2158
|
}
|
|
2159
2159
|
function kr(e) {
|
|
2160
|
-
const { uploadDocumentService: t } = be(), [n, a] = k(null), [s, l] = k(!1), [c, u] = k(!1), [h, m] = k(0), [v, w] = k(null), f = te(!1), N = te(null), b =
|
|
2160
|
+
const { uploadDocumentService: t } = be(), [n, a] = k(null), [s, l] = k(!1), [c, u] = k(!1), [h, m] = k(0), [v, w] = k(null), f = te(!1), N = te(null), b = Q(async () => {
|
|
2161
2161
|
if (e) {
|
|
2162
2162
|
if (f.current) {
|
|
2163
2163
|
console.log("[UploadDocument] Load already in progress, skipping...");
|
|
@@ -2165,10 +2165,10 @@ function kr(e) {
|
|
|
2165
2165
|
}
|
|
2166
2166
|
f.current = !0, l(!0), w(null);
|
|
2167
2167
|
try {
|
|
2168
|
-
const
|
|
2169
|
-
a(
|
|
2170
|
-
} catch (
|
|
2171
|
-
w(
|
|
2168
|
+
const T = await t.getUploadDocument(e);
|
|
2169
|
+
a(T), N.current = e;
|
|
2170
|
+
} catch (T) {
|
|
2171
|
+
w(T);
|
|
2172
2172
|
} finally {
|
|
2173
2173
|
l(!1), f.current = !1;
|
|
2174
2174
|
}
|
|
@@ -2177,13 +2177,13 @@ function kr(e) {
|
|
|
2177
2177
|
ie(() => {
|
|
2178
2178
|
e && N.current !== e && b();
|
|
2179
2179
|
}, [e]);
|
|
2180
|
-
const
|
|
2181
|
-
async (
|
|
2180
|
+
const P = Q(
|
|
2181
|
+
async (T) => {
|
|
2182
2182
|
u(!0), m(0), w(null);
|
|
2183
2183
|
try {
|
|
2184
|
-
await t.fillUploadDocument(
|
|
2185
|
-
} catch (
|
|
2186
|
-
throw w(
|
|
2184
|
+
await t.fillUploadDocument(T), m(100);
|
|
2185
|
+
} catch (R) {
|
|
2186
|
+
throw w(R), R;
|
|
2187
2187
|
} finally {
|
|
2188
2188
|
u(!1);
|
|
2189
2189
|
}
|
|
@@ -2197,11 +2197,11 @@ function kr(e) {
|
|
|
2197
2197
|
uploadProgress: h,
|
|
2198
2198
|
error: v,
|
|
2199
2199
|
load: b,
|
|
2200
|
-
submit:
|
|
2200
|
+
submit: P
|
|
2201
2201
|
};
|
|
2202
2202
|
}
|
|
2203
2203
|
function bn(e) {
|
|
2204
|
-
const { appropriatenessTestService: t } = be(), [n, a] = k(null), [s, l] = k(!1), [c, u] = k(!1), [h, m] = k(null), [v, w] = k(null), f = te(!1), N = te(null), b =
|
|
2204
|
+
const { appropriatenessTestService: t } = be(), [n, a] = k(null), [s, l] = k(!1), [c, u] = k(!1), [h, m] = k(null), [v, w] = k(null), f = te(!1), N = te(null), b = Q(async () => {
|
|
2205
2205
|
if (e) {
|
|
2206
2206
|
if (f.current) {
|
|
2207
2207
|
console.log("[AppropriatenessTest] Load already in progress, skipping...");
|
|
@@ -2209,10 +2209,10 @@ function bn(e) {
|
|
|
2209
2209
|
}
|
|
2210
2210
|
f.current = !0, l(!0), m(null);
|
|
2211
2211
|
try {
|
|
2212
|
-
const
|
|
2213
|
-
a(
|
|
2214
|
-
} catch (
|
|
2215
|
-
m(
|
|
2212
|
+
const T = await t.getAppropriatenessTest(e);
|
|
2213
|
+
a(T), N.current = e;
|
|
2214
|
+
} catch (T) {
|
|
2215
|
+
m(T);
|
|
2216
2216
|
} finally {
|
|
2217
2217
|
l(!1), f.current = !1;
|
|
2218
2218
|
}
|
|
@@ -2221,14 +2221,14 @@ function bn(e) {
|
|
|
2221
2221
|
ie(() => {
|
|
2222
2222
|
e && N.current !== e && b();
|
|
2223
2223
|
}, [e]);
|
|
2224
|
-
const
|
|
2225
|
-
async (
|
|
2224
|
+
const P = Q(
|
|
2225
|
+
async (T) => {
|
|
2226
2226
|
u(!0), m(null);
|
|
2227
2227
|
try {
|
|
2228
|
-
const
|
|
2229
|
-
return w(
|
|
2230
|
-
} catch (
|
|
2231
|
-
throw m(
|
|
2228
|
+
const R = await t.fillAppropriatenessTest(T);
|
|
2229
|
+
return w(R), R;
|
|
2230
|
+
} catch (R) {
|
|
2231
|
+
throw m(R), R;
|
|
2232
2232
|
} finally {
|
|
2233
2233
|
u(!1);
|
|
2234
2234
|
}
|
|
@@ -2242,11 +2242,11 @@ function bn(e) {
|
|
|
2242
2242
|
isSubmitting: c,
|
|
2243
2243
|
error: h,
|
|
2244
2244
|
load: b,
|
|
2245
|
-
submit:
|
|
2245
|
+
submit: P
|
|
2246
2246
|
};
|
|
2247
2247
|
}
|
|
2248
2248
|
function wr(e) {
|
|
2249
|
-
const { overviewService: t } = be(), [n, a] = k(null), [s, l] = k(!1), [c, u] = k(!1), [h, m] = k(null), v = te(!1), w = te(null), f =
|
|
2249
|
+
const { overviewService: t } = be(), [n, a] = k(null), [s, l] = k(!1), [c, u] = k(!1), [h, m] = k(null), v = te(!1), w = te(null), f = Q(async () => {
|
|
2250
2250
|
if (e) {
|
|
2251
2251
|
if (v.current) {
|
|
2252
2252
|
console.log("[Overview] Load already in progress, skipping...");
|
|
@@ -2266,7 +2266,7 @@ function wr(e) {
|
|
|
2266
2266
|
ie(() => {
|
|
2267
2267
|
e && w.current !== e && f();
|
|
2268
2268
|
}, [e]);
|
|
2269
|
-
const N =
|
|
2269
|
+
const N = Q(async () => {
|
|
2270
2270
|
if (e) {
|
|
2271
2271
|
u(!0), m(null);
|
|
2272
2272
|
try {
|
|
@@ -2290,7 +2290,7 @@ function wr(e) {
|
|
|
2290
2290
|
function Nr(e) {
|
|
2291
2291
|
const { identityService: t } = be(), [n, a] = k(
|
|
2292
2292
|
null
|
|
2293
|
-
), [s, l] = k(!1), [c, u] = k(null), h = te(!1), m =
|
|
2293
|
+
), [s, l] = k(!1), [c, u] = k(null), h = te(!1), m = Q(
|
|
2294
2294
|
async (f, N) => {
|
|
2295
2295
|
if (e) {
|
|
2296
2296
|
if (h.current) {
|
|
@@ -2307,8 +2307,8 @@ function Nr(e) {
|
|
|
2307
2307
|
// Default: 7 days
|
|
2308
2308
|
};
|
|
2309
2309
|
console.log("Identity request input:", b);
|
|
2310
|
-
const
|
|
2311
|
-
return console.log("Identity request result:",
|
|
2310
|
+
const P = await t.identityRequest(b);
|
|
2311
|
+
return console.log("Identity request result:", P), a(P), P;
|
|
2312
2312
|
} catch (b) {
|
|
2313
2313
|
throw u(b), b;
|
|
2314
2314
|
} finally {
|
|
@@ -2317,7 +2317,7 @@ function Nr(e) {
|
|
|
2317
2317
|
}
|
|
2318
2318
|
},
|
|
2319
2319
|
[e, t]
|
|
2320
|
-
), v =
|
|
2320
|
+
), v = Q(
|
|
2321
2321
|
async (f, N) => {
|
|
2322
2322
|
if (e) {
|
|
2323
2323
|
l(!0), u(null);
|
|
@@ -2327,8 +2327,8 @@ function Nr(e) {
|
|
|
2327
2327
|
restart: !1,
|
|
2328
2328
|
redirectUrl: f,
|
|
2329
2329
|
ttl: N
|
|
2330
|
-
},
|
|
2331
|
-
return a(
|
|
2330
|
+
}, P = await t.identityCompanyRequest(b);
|
|
2331
|
+
return a(P), P;
|
|
2332
2332
|
} catch (b) {
|
|
2333
2333
|
throw u(b), b;
|
|
2334
2334
|
} finally {
|
|
@@ -2337,7 +2337,7 @@ function Nr(e) {
|
|
|
2337
2337
|
}
|
|
2338
2338
|
},
|
|
2339
2339
|
[e, t]
|
|
2340
|
-
), w =
|
|
2340
|
+
), w = Q(async () => {
|
|
2341
2341
|
if (e) {
|
|
2342
2342
|
if (h.current) {
|
|
2343
2343
|
console.log("[Identity] Restart already in progress, skipping...");
|
|
@@ -2374,49 +2374,49 @@ function Nr(e) {
|
|
|
2374
2374
|
};
|
|
2375
2375
|
}
|
|
2376
2376
|
function Sr(e) {
|
|
2377
|
-
const { riskScoringService: t, applicantService: n } = be(), [a, s] = k(null), [l, c] = k({}), [u, h] = k(!1), [m, v] = k(!1), [w, f] = k(null), [N, b] = k(null),
|
|
2378
|
-
var
|
|
2377
|
+
const { riskScoringService: t, applicantService: n } = be(), [a, s] = k(null), [l, c] = k({}), [u, h] = k(!1), [m, v] = k(!1), [w, f] = k(null), [N, b] = k(null), P = te(!1), T = te(null), R = Q(async () => {
|
|
2378
|
+
var A;
|
|
2379
2379
|
if (e) {
|
|
2380
|
-
if (
|
|
2380
|
+
if (P.current) {
|
|
2381
2381
|
console.log("[RiskScoring] Load already in progress, skipping...");
|
|
2382
2382
|
return;
|
|
2383
2383
|
}
|
|
2384
|
-
|
|
2384
|
+
P.current = !0, h(!0), f(null);
|
|
2385
2385
|
try {
|
|
2386
|
-
const [
|
|
2386
|
+
const [F, K] = await Promise.all([
|
|
2387
2387
|
t.getRiskCriterias(e),
|
|
2388
2388
|
n.getApplicantData(e).catch(() => null)
|
|
2389
2389
|
]);
|
|
2390
|
-
if (s(
|
|
2391
|
-
const re =
|
|
2390
|
+
if (s(F), (A = K == null ? void 0 : K.riskScoringResults) != null && A.length) {
|
|
2391
|
+
const re = K.riskScoringResults[0], B = {};
|
|
2392
2392
|
for (const S of re.riskCriteriaResults ?? [])
|
|
2393
2393
|
if (S.riskCriteriaId != null && S.answer != null && S.answer !== "") {
|
|
2394
2394
|
const U = [...new Set(
|
|
2395
|
-
S.answer.split(",").map((
|
|
2395
|
+
S.answer.split(",").map((j) => j.trim()).filter((j) => j !== "")
|
|
2396
2396
|
)];
|
|
2397
|
-
U.length > 0 && (
|
|
2397
|
+
U.length > 0 && (B[S.riskCriteriaId] = U);
|
|
2398
2398
|
}
|
|
2399
|
-
c(
|
|
2399
|
+
c(B);
|
|
2400
2400
|
}
|
|
2401
|
-
|
|
2402
|
-
} catch (
|
|
2403
|
-
f(
|
|
2401
|
+
T.current = e;
|
|
2402
|
+
} catch (F) {
|
|
2403
|
+
f(F);
|
|
2404
2404
|
} finally {
|
|
2405
|
-
h(!1),
|
|
2405
|
+
h(!1), P.current = !1;
|
|
2406
2406
|
}
|
|
2407
2407
|
}
|
|
2408
2408
|
}, [e, t, n]);
|
|
2409
2409
|
ie(() => {
|
|
2410
|
-
e &&
|
|
2410
|
+
e && T.current !== e && R();
|
|
2411
2411
|
}, [e]);
|
|
2412
|
-
const O =
|
|
2413
|
-
async (
|
|
2412
|
+
const O = Q(
|
|
2413
|
+
async (A) => {
|
|
2414
2414
|
v(!0), f(null);
|
|
2415
2415
|
try {
|
|
2416
|
-
const
|
|
2417
|
-
return b(
|
|
2418
|
-
} catch (
|
|
2419
|
-
throw f(
|
|
2416
|
+
const F = await t.submitRiskScoring(A);
|
|
2417
|
+
return b(F), F;
|
|
2418
|
+
} catch (F) {
|
|
2419
|
+
throw f(F), F;
|
|
2420
2420
|
} finally {
|
|
2421
2421
|
v(!1);
|
|
2422
2422
|
}
|
|
@@ -2430,7 +2430,7 @@ function Sr(e) {
|
|
|
2430
2430
|
isLoading: u,
|
|
2431
2431
|
isSubmitting: m,
|
|
2432
2432
|
error: w,
|
|
2433
|
-
load:
|
|
2433
|
+
load: R,
|
|
2434
2434
|
submit: O
|
|
2435
2435
|
};
|
|
2436
2436
|
}
|
|
@@ -2438,7 +2438,7 @@ function Cr() {
|
|
|
2438
2438
|
const { applicantService: e, config: t } = be(), [n, a] = k(!1), [s, l] = k(null), c = te(!1), u = te(!1), h = () => "xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g, function(N) {
|
|
2439
2439
|
const b = Math.random() * 16 | 0;
|
|
2440
2440
|
return (N === "x" ? b : b & 3 | 8).toString(16);
|
|
2441
|
-
}), m =
|
|
2441
|
+
}), m = Q(
|
|
2442
2442
|
async (N) => {
|
|
2443
2443
|
var b;
|
|
2444
2444
|
if (c.current)
|
|
@@ -2446,21 +2446,21 @@ function Cr() {
|
|
|
2446
2446
|
c.current = !0, a(!0), l(null);
|
|
2447
2447
|
try {
|
|
2448
2448
|
if (N.applicantAdditionalDatas || (N.applicantAdditionalDatas = []), (b = t.identityProviders) != null && b.sardinai) {
|
|
2449
|
-
const
|
|
2450
|
-
console.log("[SardinAI] Generated session key:",
|
|
2449
|
+
const T = h();
|
|
2450
|
+
console.log("[SardinAI] Generated session key:", T), N.applicantAdditionalDatas.push({
|
|
2451
2451
|
paramName: "sessionKey",
|
|
2452
|
-
value:
|
|
2452
|
+
value: T
|
|
2453
2453
|
});
|
|
2454
2454
|
}
|
|
2455
2455
|
return await e.createApplicant(N);
|
|
2456
|
-
} catch (
|
|
2457
|
-
throw l(
|
|
2456
|
+
} catch (P) {
|
|
2457
|
+
throw l(P), P;
|
|
2458
2458
|
} finally {
|
|
2459
2459
|
a(!1), c.current = !1;
|
|
2460
2460
|
}
|
|
2461
2461
|
},
|
|
2462
2462
|
[e, t]
|
|
2463
|
-
), v =
|
|
2463
|
+
), v = Q(
|
|
2464
2464
|
async (N) => {
|
|
2465
2465
|
a(!0), l(null);
|
|
2466
2466
|
try {
|
|
@@ -2472,7 +2472,7 @@ function Cr() {
|
|
|
2472
2472
|
}
|
|
2473
2473
|
},
|
|
2474
2474
|
[e]
|
|
2475
|
-
), w =
|
|
2475
|
+
), w = Q(
|
|
2476
2476
|
async (N) => {
|
|
2477
2477
|
if (u.current)
|
|
2478
2478
|
throw console.log("[Applicant] Data load already in progress, skipping..."), new Error("Data load already in progress");
|
|
@@ -2486,7 +2486,7 @@ function Cr() {
|
|
|
2486
2486
|
}
|
|
2487
2487
|
},
|
|
2488
2488
|
[e]
|
|
2489
|
-
), f =
|
|
2489
|
+
), f = Q(
|
|
2490
2490
|
async (N) => {
|
|
2491
2491
|
a(!0), l(null);
|
|
2492
2492
|
try {
|
|
@@ -2508,7 +2508,7 @@ function Cr() {
|
|
|
2508
2508
|
stopProgress: f
|
|
2509
2509
|
};
|
|
2510
2510
|
}
|
|
2511
|
-
const
|
|
2511
|
+
const Z = ({
|
|
2512
2512
|
children: e,
|
|
2513
2513
|
variant: t = "primary",
|
|
2514
2514
|
size: n = "md",
|
|
@@ -2613,7 +2613,7 @@ const J = ({
|
|
|
2613
2613
|
] })
|
|
2614
2614
|
);
|
|
2615
2615
|
he.displayName = "Input";
|
|
2616
|
-
const
|
|
2616
|
+
const Y = ({ children: e, className: t, ...n }) => /* @__PURE__ */ r(
|
|
2617
2617
|
"div",
|
|
2618
2618
|
{
|
|
2619
2619
|
className: ue(
|
|
@@ -2637,7 +2637,7 @@ const W = ({ children: e, className: t, ...n }) => /* @__PURE__ */ r(
|
|
|
2637
2637
|
...n,
|
|
2638
2638
|
children: e
|
|
2639
2639
|
}
|
|
2640
|
-
),
|
|
2640
|
+
), V = ({ children: e, className: t, ...n }) => /* @__PURE__ */ r("div", { className: ue("px-6 py-4", t), ...n, children: e }), ge = ({ children: e, className: t, ...n }) => /* @__PURE__ */ r(
|
|
2641
2641
|
"div",
|
|
2642
2642
|
{
|
|
2643
2643
|
className: ue("px-6 py-4 border-t", t),
|
|
@@ -2783,60 +2783,60 @@ const ct = 280, Er = ({
|
|
|
2783
2783
|
primaryColor: "#2563eb",
|
|
2784
2784
|
primaryLight: "#eff6ff",
|
|
2785
2785
|
hoverBg: "#f9fafb"
|
|
2786
|
-
}),
|
|
2787
|
-
if (!
|
|
2788
|
-
const
|
|
2789
|
-
return { top:
|
|
2790
|
-
}, []),
|
|
2791
|
-
const
|
|
2786
|
+
}), P = te(null), T = te(null), R = te(null), O = Q(() => {
|
|
2787
|
+
if (!T.current) return null;
|
|
2788
|
+
const E = T.current.getBoundingClientRect(), G = window.innerHeight - E.bottom < ct && E.top > ct;
|
|
2789
|
+
return { top: G ? E.top : E.bottom + 4, left: E.left, width: E.width, openUp: G };
|
|
2790
|
+
}, []), A = Q(() => {
|
|
2791
|
+
const E = getComputedStyle(document.documentElement), _ = (le, ne) => E.getPropertyValue(le).trim() || ne, G = _("--metakyc-input-bg", _("--metakyc-background", "#ffffff"));
|
|
2792
2792
|
b({
|
|
2793
|
-
bg:
|
|
2794
|
-
borderColor:
|
|
2795
|
-
textPrimary:
|
|
2796
|
-
textSecondary:
|
|
2797
|
-
primaryColor:
|
|
2798
|
-
primaryLight:
|
|
2799
|
-
hoverBg:
|
|
2793
|
+
bg: G,
|
|
2794
|
+
borderColor: _("--metakyc-input-border", _("--metakyc-border", "#d1d5db")),
|
|
2795
|
+
textPrimary: _("--metakyc-input-text", _("--metakyc-text-primary", "#111827")),
|
|
2796
|
+
textSecondary: _("--metakyc-text-secondary", "#6b7280"),
|
|
2797
|
+
primaryColor: _("--metakyc-primary", "#2563eb"),
|
|
2798
|
+
primaryLight: _("--metakyc-primary-light", "#eff6ff"),
|
|
2799
|
+
hoverBg: _("--metakyc-surface", G)
|
|
2800
2800
|
});
|
|
2801
|
-
}, []),
|
|
2801
|
+
}, []), F = Q(() => {
|
|
2802
2802
|
if (l) return;
|
|
2803
|
-
|
|
2804
|
-
const
|
|
2805
|
-
|
|
2806
|
-
}, [l, O,
|
|
2803
|
+
A();
|
|
2804
|
+
const E = O();
|
|
2805
|
+
E && f(E), h(!0);
|
|
2806
|
+
}, [l, O, A]), K = Q(() => {
|
|
2807
2807
|
h(!1), v("");
|
|
2808
2808
|
}, []);
|
|
2809
2809
|
ie(() => {
|
|
2810
2810
|
if (!u) return;
|
|
2811
|
-
const
|
|
2812
|
-
var
|
|
2813
|
-
const
|
|
2814
|
-
!((
|
|
2811
|
+
const E = (_) => {
|
|
2812
|
+
var le, ne;
|
|
2813
|
+
const G = _.target;
|
|
2814
|
+
!((le = P.current) != null && le.contains(G)) && !((ne = R.current) != null && ne.contains(G)) && K();
|
|
2815
2815
|
};
|
|
2816
|
-
return document.addEventListener("mousedown",
|
|
2817
|
-
}, [u,
|
|
2816
|
+
return document.addEventListener("mousedown", E), () => document.removeEventListener("mousedown", E);
|
|
2817
|
+
}, [u, K]), ie(() => {
|
|
2818
2818
|
if (!u) return;
|
|
2819
|
-
const
|
|
2820
|
-
const
|
|
2821
|
-
|
|
2819
|
+
const E = () => {
|
|
2820
|
+
const _ = O();
|
|
2821
|
+
_ && f(_);
|
|
2822
2822
|
};
|
|
2823
|
-
return window.addEventListener("scroll",
|
|
2824
|
-
window.removeEventListener("scroll",
|
|
2823
|
+
return window.addEventListener("scroll", E, !0), window.addEventListener("resize", E), () => {
|
|
2824
|
+
window.removeEventListener("scroll", E, !0), window.removeEventListener("resize", E);
|
|
2825
2825
|
};
|
|
2826
2826
|
}, [u, O]);
|
|
2827
2827
|
const re = a.filter(
|
|
2828
|
-
(
|
|
2829
|
-
),
|
|
2830
|
-
l || n(t.includes(
|
|
2831
|
-
}, S = (
|
|
2832
|
-
|
|
2833
|
-
}, U = (
|
|
2834
|
-
var
|
|
2835
|
-
return ((
|
|
2836
|
-
}, { bg:
|
|
2828
|
+
(E) => E.label.toLowerCase().includes(m.toLowerCase())
|
|
2829
|
+
), B = (E) => {
|
|
2830
|
+
l || n(t.includes(E) ? t.filter((_) => _ !== E) : [...t, E]);
|
|
2831
|
+
}, S = (E, _) => {
|
|
2832
|
+
_.stopPropagation(), l || n(t.filter((G) => G !== E));
|
|
2833
|
+
}, U = (E) => {
|
|
2834
|
+
var _;
|
|
2835
|
+
return ((_ = a.find((G) => G.value === E)) == null ? void 0 : _.label) || E;
|
|
2836
|
+
}, { bg: j, borderColor: M, textPrimary: z, textSecondary: L, primaryColor: D, primaryLight: q, hoverBg: W } = N, de = u && w && /* @__PURE__ */ o(
|
|
2837
2837
|
"div",
|
|
2838
2838
|
{
|
|
2839
|
-
ref:
|
|
2839
|
+
ref: R,
|
|
2840
2840
|
className: "metakyc-multiselect-dropdown",
|
|
2841
2841
|
style: {
|
|
2842
2842
|
position: "fixed",
|
|
@@ -2848,7 +2848,7 @@ const ct = 280, Er = ({
|
|
|
2848
2848
|
borderRadius: "8px",
|
|
2849
2849
|
boxShadow: "0 4px 16px rgba(0,0,0,0.18)",
|
|
2850
2850
|
border: `1px solid ${M}`,
|
|
2851
|
-
backgroundColor:
|
|
2851
|
+
backgroundColor: j,
|
|
2852
2852
|
overflow: "hidden"
|
|
2853
2853
|
},
|
|
2854
2854
|
children: [
|
|
@@ -2857,10 +2857,10 @@ const ct = 280, Er = ({
|
|
|
2857
2857
|
{
|
|
2858
2858
|
type: "text",
|
|
2859
2859
|
value: m,
|
|
2860
|
-
onChange: (
|
|
2860
|
+
onChange: (E) => v(E.target.value),
|
|
2861
2861
|
placeholder: "Search...",
|
|
2862
2862
|
autoFocus: !0,
|
|
2863
|
-
onClick: (
|
|
2863
|
+
onClick: (E) => E.stopPropagation(),
|
|
2864
2864
|
className: "metakyc-multiselect-search w-full",
|
|
2865
2865
|
style: {
|
|
2866
2866
|
display: "block",
|
|
@@ -2869,19 +2869,26 @@ const ct = 280, Er = ({
|
|
|
2869
2869
|
fontSize: "13px",
|
|
2870
2870
|
borderRadius: "6px",
|
|
2871
2871
|
border: `1px solid ${M}`,
|
|
2872
|
-
backgroundColor:
|
|
2873
|
-
color:
|
|
2872
|
+
backgroundColor: j,
|
|
2873
|
+
color: z,
|
|
2874
2874
|
outline: "none",
|
|
2875
2875
|
boxSizing: "border-box"
|
|
2876
|
+
},
|
|
2877
|
+
onFocus: (E) => {
|
|
2878
|
+
const _ = getComputedStyle(document.documentElement), G = _.getPropertyValue("--metakyc-input-border-focus").trim() || _.getPropertyValue("--metakyc-primary").trim() || "#2563eb";
|
|
2879
|
+
E.currentTarget.style.backgroundColor = j, E.currentTarget.style.color = z, E.currentTarget.style.borderColor = G, E.currentTarget.style.outline = "none", E.currentTarget.style.boxShadow = `0 0 0 2px ${G}33`;
|
|
2880
|
+
},
|
|
2881
|
+
onBlur: (E) => {
|
|
2882
|
+
E.currentTarget.style.backgroundColor = j, E.currentTarget.style.color = z, E.currentTarget.style.borderColor = M, E.currentTarget.style.outline = "none", E.currentTarget.style.boxShadow = "none";
|
|
2876
2883
|
}
|
|
2877
2884
|
}
|
|
2878
2885
|
) }),
|
|
2879
|
-
/* @__PURE__ */ r("ul", { style: { listStyle: "none", margin: 0, padding: "4px 0", maxHeight: "192px", overflowY: "auto" }, children: re.length === 0 ? /* @__PURE__ */ r("li", { style: { padding: "8px 12px", fontSize: "13px", color:
|
|
2880
|
-
const
|
|
2886
|
+
/* @__PURE__ */ r("ul", { style: { listStyle: "none", margin: 0, padding: "4px 0", maxHeight: "192px", overflowY: "auto" }, children: re.length === 0 ? /* @__PURE__ */ r("li", { style: { padding: "8px 12px", fontSize: "13px", color: L }, children: "No results" }) : re.map((E) => {
|
|
2887
|
+
const _ = t.includes(E.value);
|
|
2881
2888
|
return /* @__PURE__ */ o(
|
|
2882
2889
|
"li",
|
|
2883
2890
|
{
|
|
2884
|
-
onClick: () =>
|
|
2891
|
+
onClick: () => B(E.value),
|
|
2885
2892
|
className: "metakyc-multiselect-option",
|
|
2886
2893
|
style: {
|
|
2887
2894
|
display: "flex",
|
|
@@ -2890,30 +2897,30 @@ const ct = 280, Er = ({
|
|
|
2890
2897
|
padding: "8px 12px",
|
|
2891
2898
|
fontSize: "13px",
|
|
2892
2899
|
cursor: "pointer",
|
|
2893
|
-
backgroundColor:
|
|
2894
|
-
color:
|
|
2900
|
+
backgroundColor: _ ? q : "transparent",
|
|
2901
|
+
color: _ ? D : z,
|
|
2895
2902
|
userSelect: "none"
|
|
2896
2903
|
},
|
|
2897
|
-
onMouseEnter: (
|
|
2898
|
-
|
|
2904
|
+
onMouseEnter: (G) => {
|
|
2905
|
+
_ || (G.currentTarget.style.backgroundColor = W);
|
|
2899
2906
|
},
|
|
2900
|
-
onMouseLeave: (
|
|
2901
|
-
|
|
2907
|
+
onMouseLeave: (G) => {
|
|
2908
|
+
_ || (G.currentTarget.style.backgroundColor = "transparent");
|
|
2902
2909
|
},
|
|
2903
2910
|
children: [
|
|
2904
2911
|
/* @__PURE__ */ r(
|
|
2905
2912
|
"input",
|
|
2906
2913
|
{
|
|
2907
2914
|
type: "checkbox",
|
|
2908
|
-
checked:
|
|
2915
|
+
checked: _,
|
|
2909
2916
|
readOnly: !0,
|
|
2910
|
-
style: { accentColor:
|
|
2917
|
+
style: { accentColor: D, pointerEvents: "none", flexShrink: 0 }
|
|
2911
2918
|
}
|
|
2912
2919
|
),
|
|
2913
|
-
/* @__PURE__ */ r("span", { children:
|
|
2920
|
+
/* @__PURE__ */ r("span", { children: E.label })
|
|
2914
2921
|
]
|
|
2915
2922
|
},
|
|
2916
|
-
|
|
2923
|
+
E.value
|
|
2917
2924
|
);
|
|
2918
2925
|
}) }),
|
|
2919
2926
|
t.length > 0 && /* @__PURE__ */ r("div", { style: { padding: "6px 12px", borderTop: `1px solid ${M}` }, children: /* @__PURE__ */ o(
|
|
@@ -2934,7 +2941,7 @@ const ct = 280, Er = ({
|
|
|
2934
2941
|
]
|
|
2935
2942
|
}
|
|
2936
2943
|
);
|
|
2937
|
-
return /* @__PURE__ */ o("div", { className: "w-full metakyc-multiselect", ref:
|
|
2944
|
+
return /* @__PURE__ */ o("div", { className: "w-full metakyc-multiselect", ref: P, children: [
|
|
2938
2945
|
e && /* @__PURE__ */ o(
|
|
2939
2946
|
"label",
|
|
2940
2947
|
{
|
|
@@ -2949,8 +2956,8 @@ const ct = 280, Er = ({
|
|
|
2949
2956
|
/* @__PURE__ */ o(
|
|
2950
2957
|
"div",
|
|
2951
2958
|
{
|
|
2952
|
-
ref:
|
|
2953
|
-
onClick: () => u ?
|
|
2959
|
+
ref: T,
|
|
2960
|
+
onClick: () => u ? K() : F(),
|
|
2954
2961
|
className: ue(
|
|
2955
2962
|
"metakyc-multiselect-trigger",
|
|
2956
2963
|
"min-h-[42px] w-full px-3 py-2 rounded-lg border text-sm transition-colors relative",
|
|
@@ -2970,7 +2977,7 @@ const ct = 280, Er = ({
|
|
|
2970
2977
|
style: { color: "var(--metakyc-text-secondary, #9ca3af)" },
|
|
2971
2978
|
children: s
|
|
2972
2979
|
}
|
|
2973
|
-
) : /* @__PURE__ */ r("div", { className: "flex flex-wrap gap-1 pr-6", children: t.map((
|
|
2980
|
+
) : /* @__PURE__ */ r("div", { className: "flex flex-wrap gap-1 pr-6", children: t.map((E) => /* @__PURE__ */ o(
|
|
2974
2981
|
"span",
|
|
2975
2982
|
{
|
|
2976
2983
|
className: "metakyc-multiselect-chip inline-flex items-center gap-1 px-2 py-0.5 rounded text-xs font-medium",
|
|
@@ -2979,12 +2986,12 @@ const ct = 280, Er = ({
|
|
|
2979
2986
|
color: "var(--metakyc-primary, #2563eb)"
|
|
2980
2987
|
},
|
|
2981
2988
|
children: [
|
|
2982
|
-
U(
|
|
2989
|
+
U(E),
|
|
2983
2990
|
!l && /* @__PURE__ */ r(
|
|
2984
2991
|
"button",
|
|
2985
2992
|
{
|
|
2986
2993
|
type: "button",
|
|
2987
|
-
onClick: (
|
|
2994
|
+
onClick: (_) => S(E, _),
|
|
2988
2995
|
className: "metakyc-multiselect-chip-remove",
|
|
2989
2996
|
style: {
|
|
2990
2997
|
background: "transparent",
|
|
@@ -3010,7 +3017,7 @@ const ct = 280, Er = ({
|
|
|
3010
3017
|
)
|
|
3011
3018
|
]
|
|
3012
3019
|
},
|
|
3013
|
-
|
|
3020
|
+
E
|
|
3014
3021
|
)) }),
|
|
3015
3022
|
/* @__PURE__ */ r(
|
|
3016
3023
|
"span",
|
|
@@ -3023,9 +3030,9 @@ const ct = 280, Er = ({
|
|
|
3023
3030
|
]
|
|
3024
3031
|
}
|
|
3025
3032
|
),
|
|
3026
|
-
typeof document < "u" &&
|
|
3033
|
+
typeof document < "u" && de ? it(de, document.body) : null
|
|
3027
3034
|
] });
|
|
3028
|
-
}, dt = 260,
|
|
3035
|
+
}, dt = 260, Te = ({
|
|
3029
3036
|
label: e,
|
|
3030
3037
|
error: t,
|
|
3031
3038
|
helperText: n,
|
|
@@ -3038,7 +3045,7 @@ const ct = 280, Er = ({
|
|
|
3038
3045
|
className: m
|
|
3039
3046
|
}) => {
|
|
3040
3047
|
var ne;
|
|
3041
|
-
const [v, w] = k(!1), [f, N] = k(""), [b,
|
|
3048
|
+
const [v, w] = k(!1), [f, N] = k(""), [b, P] = k(null), [T, R] = k({
|
|
3042
3049
|
bg: "#ffffff",
|
|
3043
3050
|
border: "#d1d5db",
|
|
3044
3051
|
text: "#111827",
|
|
@@ -3046,65 +3053,65 @@ const ct = 280, Er = ({
|
|
|
3046
3053
|
primary: "#2563eb",
|
|
3047
3054
|
primaryLight: "#eff6ff",
|
|
3048
3055
|
hoverBg: "#f9fafb"
|
|
3049
|
-
}), O =
|
|
3050
|
-
const
|
|
3051
|
-
|
|
3052
|
-
bg:
|
|
3053
|
-
border:
|
|
3054
|
-
text:
|
|
3055
|
-
textSecondary:
|
|
3056
|
-
primary:
|
|
3057
|
-
primaryLight:
|
|
3058
|
-
hoverBg:
|
|
3056
|
+
}), O = Q(() => {
|
|
3057
|
+
const I = getComputedStyle(document.documentElement), X = (ce, Ce) => I.getPropertyValue(ce).trim() || Ce, oe = X("--metakyc-input-bg", X("--metakyc-background", "#ffffff"));
|
|
3058
|
+
R({
|
|
3059
|
+
bg: oe,
|
|
3060
|
+
border: X("--metakyc-input-border", X("--metakyc-border", "#d1d5db")),
|
|
3061
|
+
text: X("--metakyc-input-text", X("--metakyc-text-primary", "#111827")),
|
|
3062
|
+
textSecondary: X("--metakyc-text-secondary", "#6b7280"),
|
|
3063
|
+
primary: X("--metakyc-primary", "#2563eb"),
|
|
3064
|
+
primaryLight: X("--metakyc-primary-light", "#eff6ff"),
|
|
3065
|
+
hoverBg: X("--metakyc-surface", oe)
|
|
3059
3066
|
});
|
|
3060
|
-
}, []),
|
|
3061
|
-
if (!
|
|
3062
|
-
const
|
|
3067
|
+
}, []), A = te(null), F = te(null), K = te(null), re = te(null), B = Q(() => {
|
|
3068
|
+
if (!F.current) return null;
|
|
3069
|
+
const I = F.current.getBoundingClientRect(), oe = window.innerHeight - I.bottom < dt && I.top > dt;
|
|
3063
3070
|
return {
|
|
3064
|
-
top:
|
|
3065
|
-
left:
|
|
3066
|
-
width:
|
|
3067
|
-
openUp:
|
|
3071
|
+
top: oe ? I.top : I.bottom + 4,
|
|
3072
|
+
left: I.left,
|
|
3073
|
+
width: I.width,
|
|
3074
|
+
openUp: oe
|
|
3068
3075
|
};
|
|
3069
|
-
}, []), S =
|
|
3076
|
+
}, []), S = Q(() => {
|
|
3070
3077
|
if (u) return;
|
|
3071
3078
|
O();
|
|
3072
|
-
const
|
|
3073
|
-
|
|
3074
|
-
}, [u,
|
|
3079
|
+
const I = B();
|
|
3080
|
+
I && P(I), w(!0);
|
|
3081
|
+
}, [u, B, O]), U = Q(() => {
|
|
3075
3082
|
w(!1), N("");
|
|
3076
|
-
}, []),
|
|
3083
|
+
}, []), j = () => v ? U() : S();
|
|
3077
3084
|
ie(() => {
|
|
3078
3085
|
if (!v) return;
|
|
3079
|
-
const
|
|
3080
|
-
var
|
|
3081
|
-
const
|
|
3082
|
-
!((
|
|
3086
|
+
const I = (X) => {
|
|
3087
|
+
var ce, Ce;
|
|
3088
|
+
const oe = X.target;
|
|
3089
|
+
!((ce = A.current) != null && ce.contains(oe)) && !((Ce = K.current) != null && Ce.contains(oe)) && U();
|
|
3083
3090
|
};
|
|
3084
|
-
return document.addEventListener("mousedown",
|
|
3091
|
+
return document.addEventListener("mousedown", I), () => document.removeEventListener("mousedown", I);
|
|
3085
3092
|
}, [v, U]), ie(() => {
|
|
3086
3093
|
if (!v) return;
|
|
3087
|
-
const
|
|
3088
|
-
const
|
|
3089
|
-
|
|
3094
|
+
const I = () => {
|
|
3095
|
+
const X = B();
|
|
3096
|
+
X && P(X);
|
|
3090
3097
|
};
|
|
3091
|
-
return window.addEventListener("scroll",
|
|
3092
|
-
window.removeEventListener("scroll",
|
|
3098
|
+
return window.addEventListener("scroll", I, !0), window.addEventListener("resize", I), () => {
|
|
3099
|
+
window.removeEventListener("scroll", I, !0), window.removeEventListener("resize", I);
|
|
3093
3100
|
};
|
|
3094
|
-
}, [v,
|
|
3101
|
+
}, [v, B]), ie(() => {
|
|
3095
3102
|
v && re.current && setTimeout(() => {
|
|
3096
|
-
var
|
|
3097
|
-
return (
|
|
3103
|
+
var I;
|
|
3104
|
+
return (I = re.current) == null ? void 0 : I.focus();
|
|
3098
3105
|
}, 0);
|
|
3099
3106
|
}, [v]);
|
|
3100
3107
|
const M = a.filter(
|
|
3101
|
-
(
|
|
3102
|
-
),
|
|
3103
|
-
u ||
|
|
3104
|
-
}, { bg:
|
|
3108
|
+
(I) => I.label.toLowerCase().includes(f.toLowerCase()) || I.value.toLowerCase().includes(f.toLowerCase())
|
|
3109
|
+
), z = (ne = a.find((I) => I.value === l)) == null ? void 0 : ne.label, L = (I, X) => {
|
|
3110
|
+
u || X || (c(I), U());
|
|
3111
|
+
}, { bg: D, border: q, text: W, textSecondary: de, primary: E, primaryLight: _, hoverBg: G } = T, le = v && b && /* @__PURE__ */ o(
|
|
3105
3112
|
"div",
|
|
3106
3113
|
{
|
|
3107
|
-
ref:
|
|
3114
|
+
ref: K,
|
|
3108
3115
|
className: "metakyc-searchable-select-dropdown",
|
|
3109
3116
|
style: {
|
|
3110
3117
|
position: "fixed",
|
|
@@ -3115,20 +3122,20 @@ const ct = 280, Er = ({
|
|
|
3115
3122
|
zIndex: 99999,
|
|
3116
3123
|
borderRadius: "8px",
|
|
3117
3124
|
boxShadow: "0 4px 16px rgba(0,0,0,0.18)",
|
|
3118
|
-
border: `1px solid ${
|
|
3119
|
-
backgroundColor:
|
|
3125
|
+
border: `1px solid ${q}`,
|
|
3126
|
+
backgroundColor: D,
|
|
3120
3127
|
overflow: "hidden"
|
|
3121
3128
|
},
|
|
3122
3129
|
children: [
|
|
3123
|
-
/* @__PURE__ */ r("div", { style: { padding: "8px", borderBottom: `1px solid ${
|
|
3130
|
+
/* @__PURE__ */ r("div", { style: { padding: "8px", borderBottom: `1px solid ${q}` }, children: /* @__PURE__ */ r(
|
|
3124
3131
|
"input",
|
|
3125
3132
|
{
|
|
3126
3133
|
ref: re,
|
|
3127
3134
|
type: "text",
|
|
3128
3135
|
value: f,
|
|
3129
|
-
onChange: (
|
|
3136
|
+
onChange: (I) => N(I.target.value),
|
|
3130
3137
|
placeholder: "Search...",
|
|
3131
|
-
onClick: (
|
|
3138
|
+
onClick: (I) => I.stopPropagation(),
|
|
3132
3139
|
className: "metakyc-searchable-select-search w-full",
|
|
3133
3140
|
style: {
|
|
3134
3141
|
display: "block",
|
|
@@ -3136,11 +3143,18 @@ const ct = 280, Er = ({
|
|
|
3136
3143
|
padding: "6px 8px",
|
|
3137
3144
|
fontSize: "13px",
|
|
3138
3145
|
borderRadius: "6px",
|
|
3139
|
-
border: `1px solid ${
|
|
3140
|
-
backgroundColor:
|
|
3141
|
-
color:
|
|
3146
|
+
border: `1px solid ${q}`,
|
|
3147
|
+
backgroundColor: D,
|
|
3148
|
+
color: W,
|
|
3142
3149
|
outline: "none",
|
|
3143
3150
|
boxSizing: "border-box"
|
|
3151
|
+
},
|
|
3152
|
+
onFocus: (I) => {
|
|
3153
|
+
const X = getComputedStyle(document.documentElement), oe = X.getPropertyValue("--metakyc-input-border-focus").trim() || X.getPropertyValue("--metakyc-primary").trim() || "#2563eb";
|
|
3154
|
+
I.currentTarget.style.backgroundColor = D, I.currentTarget.style.color = W, I.currentTarget.style.borderColor = oe, I.currentTarget.style.outline = "none", I.currentTarget.style.boxShadow = `0 0 0 2px ${oe}33`;
|
|
3155
|
+
},
|
|
3156
|
+
onBlur: (I) => {
|
|
3157
|
+
I.currentTarget.style.backgroundColor = D, I.currentTarget.style.color = W, I.currentTarget.style.borderColor = q, I.currentTarget.style.outline = "none", I.currentTarget.style.boxShadow = "none";
|
|
3144
3158
|
}
|
|
3145
3159
|
}
|
|
3146
3160
|
) }),
|
|
@@ -3154,31 +3168,31 @@ const ct = 280, Er = ({
|
|
|
3154
3168
|
maxHeight: "208px",
|
|
3155
3169
|
overflowY: "auto"
|
|
3156
3170
|
},
|
|
3157
|
-
children: M.length === 0 ? /* @__PURE__ */ r("li", { style: { padding: "8px 12px", fontSize: "13px", color:
|
|
3158
|
-
const
|
|
3171
|
+
children: M.length === 0 ? /* @__PURE__ */ r("li", { style: { padding: "8px 12px", fontSize: "13px", color: de }, children: "No results" }) : M.map((I) => {
|
|
3172
|
+
const X = I.value === l;
|
|
3159
3173
|
return /* @__PURE__ */ r(
|
|
3160
3174
|
"li",
|
|
3161
3175
|
{
|
|
3162
3176
|
className: "metakyc-searchable-select-option",
|
|
3163
|
-
onClick: () =>
|
|
3177
|
+
onClick: () => L(I.value, I.disabled),
|
|
3164
3178
|
style: {
|
|
3165
3179
|
padding: "8px 12px",
|
|
3166
3180
|
fontSize: "13px",
|
|
3167
|
-
cursor:
|
|
3168
|
-
opacity:
|
|
3169
|
-
backgroundColor:
|
|
3170
|
-
color:
|
|
3181
|
+
cursor: I.disabled ? "not-allowed" : "pointer",
|
|
3182
|
+
opacity: I.disabled ? 0.4 : 1,
|
|
3183
|
+
backgroundColor: X ? _ : "transparent",
|
|
3184
|
+
color: X ? E : W,
|
|
3171
3185
|
userSelect: "none"
|
|
3172
3186
|
},
|
|
3173
|
-
onMouseEnter: (
|
|
3174
|
-
!
|
|
3187
|
+
onMouseEnter: (oe) => {
|
|
3188
|
+
!X && !I.disabled && (oe.currentTarget.style.backgroundColor = G);
|
|
3175
3189
|
},
|
|
3176
|
-
onMouseLeave: (
|
|
3177
|
-
|
|
3190
|
+
onMouseLeave: (oe) => {
|
|
3191
|
+
X || (oe.currentTarget.style.backgroundColor = "transparent");
|
|
3178
3192
|
},
|
|
3179
|
-
children:
|
|
3193
|
+
children: I.label
|
|
3180
3194
|
},
|
|
3181
|
-
|
|
3195
|
+
I.value
|
|
3182
3196
|
);
|
|
3183
3197
|
})
|
|
3184
3198
|
}
|
|
@@ -3190,7 +3204,7 @@ const ct = 280, Er = ({
|
|
|
3190
3204
|
"div",
|
|
3191
3205
|
{
|
|
3192
3206
|
className: ue("w-full metakyc-searchable-select", m),
|
|
3193
|
-
ref:
|
|
3207
|
+
ref: A,
|
|
3194
3208
|
children: [
|
|
3195
3209
|
e && /* @__PURE__ */ o(
|
|
3196
3210
|
"label",
|
|
@@ -3206,12 +3220,12 @@ const ct = 280, Er = ({
|
|
|
3206
3220
|
/* @__PURE__ */ o(
|
|
3207
3221
|
"div",
|
|
3208
3222
|
{
|
|
3209
|
-
ref:
|
|
3223
|
+
ref: F,
|
|
3210
3224
|
role: "button",
|
|
3211
3225
|
tabIndex: u ? -1 : 0,
|
|
3212
|
-
onClick:
|
|
3213
|
-
onKeyDown: (
|
|
3214
|
-
(
|
|
3226
|
+
onClick: j,
|
|
3227
|
+
onKeyDown: (I) => {
|
|
3228
|
+
(I.key === "Enter" || I.key === " ") && (I.preventDefault(), j()), I.key === "Escape" && U();
|
|
3215
3229
|
},
|
|
3216
3230
|
className: ue(
|
|
3217
3231
|
"metakyc-searchable-select-trigger",
|
|
@@ -3222,14 +3236,14 @@ const ct = 280, Er = ({
|
|
|
3222
3236
|
),
|
|
3223
3237
|
style: {
|
|
3224
3238
|
backgroundColor: "var(--metakyc-input-bg, #ffffff)",
|
|
3225
|
-
color:
|
|
3239
|
+
color: z ? "var(--metakyc-input-text, var(--metakyc-text-primary, #111827))" : "var(--metakyc-input-placeholder, var(--metakyc-text-muted, #9ca3af))",
|
|
3226
3240
|
borderColor: t ? "var(--metakyc-danger, #ef4444)" : v ? "var(--metakyc-input-border-focus, var(--metakyc-primary, #2563eb))" : "var(--metakyc-input-border, var(--metakyc-border, #d1d5db))",
|
|
3227
3241
|
minHeight: "42px",
|
|
3228
3242
|
outline: v ? "2px solid var(--metakyc-input-border-focus, var(--metakyc-primary, #2563eb))" : "none",
|
|
3229
3243
|
outlineOffset: "-1px"
|
|
3230
3244
|
},
|
|
3231
3245
|
children: [
|
|
3232
|
-
/* @__PURE__ */ r("span", { className: "truncate flex-1", children:
|
|
3246
|
+
/* @__PURE__ */ r("span", { className: "truncate flex-1", children: z || s }),
|
|
3233
3247
|
/* @__PURE__ */ r(
|
|
3234
3248
|
"span",
|
|
3235
3249
|
{
|
|
@@ -3241,14 +3255,14 @@ const ct = 280, Er = ({
|
|
|
3241
3255
|
]
|
|
3242
3256
|
}
|
|
3243
3257
|
),
|
|
3244
|
-
typeof document < "u" &&
|
|
3258
|
+
typeof document < "u" && le ? it(le, document.body) : null,
|
|
3245
3259
|
t && /* @__PURE__ */ r("p", { className: "mt-1 text-sm", style: { color: "var(--metakyc-error, #ef4444)" }, children: t }),
|
|
3246
3260
|
!t && n && /* @__PURE__ */ r("p", { className: "mt-1 text-sm", style: { color: "var(--metakyc-text-secondary, #6b7280)" }, children: n })
|
|
3247
3261
|
]
|
|
3248
3262
|
}
|
|
3249
3263
|
);
|
|
3250
3264
|
};
|
|
3251
|
-
|
|
3265
|
+
Te.displayName = "SearchableSelect";
|
|
3252
3266
|
const Ir = ({
|
|
3253
3267
|
label: e,
|
|
3254
3268
|
error: t,
|
|
@@ -3259,26 +3273,26 @@ const Ir = ({
|
|
|
3259
3273
|
value: c = [],
|
|
3260
3274
|
className: u
|
|
3261
3275
|
}) => {
|
|
3262
|
-
const [h, m] = k(!1), v = te(null), w = (
|
|
3263
|
-
if (!
|
|
3264
|
-
const O = Array.from(
|
|
3265
|
-
if (s && O.filter((
|
|
3266
|
-
const
|
|
3267
|
-
alert(`Some files exceed the maximum size of ${
|
|
3276
|
+
const [h, m] = k(!1), v = te(null), w = (R) => {
|
|
3277
|
+
if (!R) return;
|
|
3278
|
+
const O = Array.from(R);
|
|
3279
|
+
if (s && O.filter((F) => F.size > s).length > 0) {
|
|
3280
|
+
const F = rt(s);
|
|
3281
|
+
alert(`Some files exceed the maximum size of ${F}`);
|
|
3268
3282
|
return;
|
|
3269
3283
|
}
|
|
3270
3284
|
l == null || l(a ? [...c, ...O] : [O[0]]);
|
|
3271
|
-
}, f = (
|
|
3272
|
-
|
|
3285
|
+
}, f = (R) => {
|
|
3286
|
+
R.preventDefault(), m(!0);
|
|
3273
3287
|
}, N = () => {
|
|
3274
3288
|
m(!1);
|
|
3275
|
-
}, b = (
|
|
3276
|
-
|
|
3277
|
-
},
|
|
3278
|
-
var
|
|
3279
|
-
(
|
|
3280
|
-
},
|
|
3281
|
-
const O = c.filter((
|
|
3289
|
+
}, b = (R) => {
|
|
3290
|
+
R.preventDefault(), m(!1), w(R.dataTransfer.files);
|
|
3291
|
+
}, P = () => {
|
|
3292
|
+
var R;
|
|
3293
|
+
(R = v.current) == null || R.click();
|
|
3294
|
+
}, T = (R) => {
|
|
3295
|
+
const O = c.filter((A, F) => F !== R);
|
|
3282
3296
|
l == null || l(O);
|
|
3283
3297
|
};
|
|
3284
3298
|
return /* @__PURE__ */ o("div", { className: ue("w-full", u), children: [
|
|
@@ -3294,7 +3308,7 @@ const Ir = ({
|
|
|
3294
3308
|
onDragOver: f,
|
|
3295
3309
|
onDragLeave: N,
|
|
3296
3310
|
onDrop: b,
|
|
3297
|
-
onClick:
|
|
3311
|
+
onClick: P,
|
|
3298
3312
|
children: [
|
|
3299
3313
|
/* @__PURE__ */ r(
|
|
3300
3314
|
"input",
|
|
@@ -3304,7 +3318,7 @@ const Ir = ({
|
|
|
3304
3318
|
className: "hidden",
|
|
3305
3319
|
accept: n,
|
|
3306
3320
|
multiple: a,
|
|
3307
|
-
onChange: (
|
|
3321
|
+
onChange: (R) => w(R.target.files)
|
|
3308
3322
|
}
|
|
3309
3323
|
),
|
|
3310
3324
|
/* @__PURE__ */ o("div", { className: "space-y-2", children: [
|
|
@@ -3338,7 +3352,7 @@ const Ir = ({
|
|
|
3338
3352
|
]
|
|
3339
3353
|
}
|
|
3340
3354
|
),
|
|
3341
|
-
c.length > 0 && /* @__PURE__ */ r("div", { className: "mt-3 space-y-2", children: c.map((
|
|
3355
|
+
c.length > 0 && /* @__PURE__ */ r("div", { className: "mt-3 space-y-2", children: c.map((R, O) => /* @__PURE__ */ o(
|
|
3342
3356
|
"div",
|
|
3343
3357
|
{
|
|
3344
3358
|
className: "flex items-center justify-between px-3 py-2 bg-gray-50 dark:bg-gray-700 rounded-lg",
|
|
@@ -3360,10 +3374,10 @@ const Ir = ({
|
|
|
3360
3374
|
)
|
|
3361
3375
|
}
|
|
3362
3376
|
),
|
|
3363
|
-
/* @__PURE__ */ r("span", { className: "text-sm text-gray-700 dark:text-gray-300 truncate", children:
|
|
3377
|
+
/* @__PURE__ */ r("span", { className: "text-sm text-gray-700 dark:text-gray-300 truncate", children: R.name }),
|
|
3364
3378
|
/* @__PURE__ */ o("span", { className: "text-xs text-gray-500", children: [
|
|
3365
3379
|
"(",
|
|
3366
|
-
rt(
|
|
3380
|
+
rt(R.size),
|
|
3367
3381
|
")"
|
|
3368
3382
|
] })
|
|
3369
3383
|
] }),
|
|
@@ -3371,8 +3385,8 @@ const Ir = ({
|
|
|
3371
3385
|
"button",
|
|
3372
3386
|
{
|
|
3373
3387
|
type: "button",
|
|
3374
|
-
onClick: (
|
|
3375
|
-
|
|
3388
|
+
onClick: (A) => {
|
|
3389
|
+
A.stopPropagation(), T(O);
|
|
3376
3390
|
},
|
|
3377
3391
|
className: "ml-2 text-danger-500 hover:text-danger-700 focus:outline-none",
|
|
3378
3392
|
children: /* @__PURE__ */ r("svg", { className: "h-5 w-5", fill: "currentColor", viewBox: "0 0 20 20", children: /* @__PURE__ */ r(
|
|
@@ -3478,7 +3492,7 @@ const ut = (e) => {
|
|
|
3478
3492
|
* This source code is licensed under the ISC license.
|
|
3479
3493
|
* See the LICENSE file in the root directory of this source tree.
|
|
3480
3494
|
*/
|
|
3481
|
-
var
|
|
3495
|
+
var Tr = {
|
|
3482
3496
|
xmlns: "http://www.w3.org/2000/svg",
|
|
3483
3497
|
width: 24,
|
|
3484
3498
|
height: 24,
|
|
@@ -3495,7 +3509,7 @@ var Fr = {
|
|
|
3495
3509
|
* This source code is licensed under the ISC license.
|
|
3496
3510
|
* See the LICENSE file in the root directory of this source tree.
|
|
3497
3511
|
*/
|
|
3498
|
-
const
|
|
3512
|
+
const Fr = (e) => {
|
|
3499
3513
|
for (const t in e)
|
|
3500
3514
|
if (t.startsWith("aria-") || t === "role" || t === "title")
|
|
3501
3515
|
return !0;
|
|
@@ -3507,7 +3521,7 @@ const Lr = (e) => {
|
|
|
3507
3521
|
* This source code is licensed under the ISC license.
|
|
3508
3522
|
* See the LICENSE file in the root directory of this source tree.
|
|
3509
3523
|
*/
|
|
3510
|
-
const
|
|
3524
|
+
const Lr = Qe(
|
|
3511
3525
|
({
|
|
3512
3526
|
color: e = "currentColor",
|
|
3513
3527
|
size: t = 24,
|
|
@@ -3521,13 +3535,13 @@ const Tr = Qe(
|
|
|
3521
3535
|
"svg",
|
|
3522
3536
|
{
|
|
3523
3537
|
ref: h,
|
|
3524
|
-
...
|
|
3538
|
+
...Tr,
|
|
3525
3539
|
width: t,
|
|
3526
3540
|
height: t,
|
|
3527
3541
|
stroke: e,
|
|
3528
3542
|
strokeWidth: a ? Number(n) * 24 / Number(t) : n,
|
|
3529
3543
|
className: gt("lucide", s),
|
|
3530
|
-
...!l && !
|
|
3544
|
+
...!l && !Fr(u) && { "aria-hidden": "true" },
|
|
3531
3545
|
...u
|
|
3532
3546
|
},
|
|
3533
3547
|
[
|
|
@@ -3544,7 +3558,7 @@ const Tr = Qe(
|
|
|
3544
3558
|
*/
|
|
3545
3559
|
const ft = (e, t) => {
|
|
3546
3560
|
const n = Qe(
|
|
3547
|
-
({ className: a, ...s }, l) => nt(
|
|
3561
|
+
({ className: a, ...s }, l) => nt(Lr, {
|
|
3548
3562
|
ref: l,
|
|
3549
3563
|
iconNode: t,
|
|
3550
3564
|
className: gt(
|
|
@@ -3600,7 +3614,7 @@ function Or(e, t) {
|
|
|
3600
3614
|
}
|
|
3601
3615
|
return null;
|
|
3602
3616
|
}
|
|
3603
|
-
function
|
|
3617
|
+
function Br(e) {
|
|
3604
3618
|
const t = e.flatMap(
|
|
3605
3619
|
(a, s) => (a.questions ?? []).map((l, c) => ({ question: l, groupIndex: s, qIdx: c }))
|
|
3606
3620
|
), n = /* @__PURE__ */ new Map();
|
|
@@ -3610,7 +3624,7 @@ function $r(e) {
|
|
|
3610
3624
|
}
|
|
3611
3625
|
return Array.from(n.entries()).sort(([a], [s]) => a - s).map(([, a]) => a);
|
|
3612
3626
|
}
|
|
3613
|
-
const
|
|
3627
|
+
const $r = ({
|
|
3614
3628
|
applicantId: e,
|
|
3615
3629
|
onComplete: t,
|
|
3616
3630
|
onBack: n
|
|
@@ -3619,58 +3633,58 @@ const zr = ({
|
|
|
3619
3633
|
ve.useEffect(() => {
|
|
3620
3634
|
s && Object.keys(s).length > 0 && Object.keys(m).length === 0 && v(s);
|
|
3621
3635
|
}, [s]);
|
|
3622
|
-
const
|
|
3623
|
-
() => a ?
|
|
3636
|
+
const P = Pe(
|
|
3637
|
+
() => a ? Br(a.questionGroups) : [],
|
|
3624
3638
|
[a]
|
|
3625
|
-
),
|
|
3626
|
-
v((U) => ({ ...U, [
|
|
3627
|
-
const
|
|
3628
|
-
return delete
|
|
3639
|
+
), T = N === P.length - 1, R = P[N] ?? [], O = Q((B, S) => {
|
|
3640
|
+
v((U) => ({ ...U, [B]: S })), f((U) => {
|
|
3641
|
+
const j = { ...U };
|
|
3642
|
+
return delete j[B], j;
|
|
3629
3643
|
});
|
|
3630
|
-
}, []),
|
|
3631
|
-
const
|
|
3632
|
-
for (const { question: S } of
|
|
3644
|
+
}, []), A = Q(() => {
|
|
3645
|
+
const B = {};
|
|
3646
|
+
for (const { question: S } of R) {
|
|
3633
3647
|
const U = Or(S, m[S.id] ?? []);
|
|
3634
|
-
U && (
|
|
3648
|
+
U && (B[S.id] = U);
|
|
3635
3649
|
}
|
|
3636
|
-
return f((S) => ({ ...S,
|
|
3637
|
-
}, [
|
|
3638
|
-
|
|
3639
|
-
},
|
|
3640
|
-
N > 0 ? b((
|
|
3650
|
+
return f((S) => ({ ...S, ...B })), Object.keys(B).length === 0;
|
|
3651
|
+
}, [R, m]), F = () => {
|
|
3652
|
+
A() && b((B) => B + 1);
|
|
3653
|
+
}, K = () => {
|
|
3654
|
+
N > 0 ? b((B) => B - 1) : n == null || n();
|
|
3641
3655
|
}, re = async () => {
|
|
3642
|
-
if (!(!
|
|
3656
|
+
if (!(!A() || !a))
|
|
3643
3657
|
try {
|
|
3644
|
-
const
|
|
3645
|
-
(U) => (U.questions ?? []).map((
|
|
3646
|
-
questionId:
|
|
3647
|
-
values: m[
|
|
3658
|
+
const B = a.questionGroups.flatMap(
|
|
3659
|
+
(U) => (U.questions ?? []).map((j) => ({
|
|
3660
|
+
questionId: j.id,
|
|
3661
|
+
values: m[j.id] ?? []
|
|
3648
3662
|
}))
|
|
3649
3663
|
), S = {
|
|
3650
3664
|
applicantId: e,
|
|
3651
3665
|
questionnarieId: a.id,
|
|
3652
|
-
questionResults:
|
|
3666
|
+
questionResults: B
|
|
3653
3667
|
};
|
|
3654
3668
|
await h(S), t == null || t();
|
|
3655
|
-
} catch (
|
|
3656
|
-
console.error("Questionnaire submit error:",
|
|
3669
|
+
} catch (B) {
|
|
3670
|
+
console.error("Questionnaire submit error:", B);
|
|
3657
3671
|
}
|
|
3658
3672
|
};
|
|
3659
|
-
return l ? /* @__PURE__ */ r(
|
|
3673
|
+
return l ? /* @__PURE__ */ r(Y, { children: /* @__PURE__ */ r(V, { children: /* @__PURE__ */ r(Se, { className: "my-8" }) }) }) : u ? /* @__PURE__ */ r(Y, { children: /* @__PURE__ */ r(V, { children: /* @__PURE__ */ o("p", { className: "text-danger-500", children: [
|
|
3660
3674
|
"Error loading questionnaire: ",
|
|
3661
3675
|
u.message
|
|
3662
|
-
] }) }) }) : a ? /* @__PURE__ */ o(
|
|
3676
|
+
] }) }) }) : a ? /* @__PURE__ */ o(Y, { children: [
|
|
3663
3677
|
/* @__PURE__ */ o(ye, { children: [
|
|
3664
3678
|
/* @__PURE__ */ r("h2", { className: "text-lg font-bold", children: a.displayName }),
|
|
3665
3679
|
a.subtitle && /* @__PURE__ */ r("p", { className: "text-sm", style: { color: "var(--metakyc-text-secondary, #6b7280)" }, children: a.subtitle }),
|
|
3666
|
-
|
|
3680
|
+
P.length > 1 && /* @__PURE__ */ o("div", { className: "flex items-center justify-between mt-3", children: [
|
|
3667
3681
|
/* @__PURE__ */ o("span", { className: "text-xs", style: { color: "var(--metakyc-text-muted, #9ca3af)" }, children: [
|
|
3668
3682
|
"Page ",
|
|
3669
3683
|
N + 1,
|
|
3670
3684
|
" of ",
|
|
3671
|
-
|
|
3685
|
+
P.length
|
|
3672
3686
|
] }),
|
|
3673
|
-
/* @__PURE__ */ r("div", { className: "flex items-center gap-1.5", children:
|
|
3687
|
+
/* @__PURE__ */ r("div", { className: "flex items-center gap-1.5", children: P.map((B, S) => /* @__PURE__ */ r(
|
|
3674
3688
|
"div",
|
|
3675
3689
|
{
|
|
3676
3690
|
className: "rounded-full transition-all duration-200",
|
|
@@ -3684,23 +3698,23 @@ const zr = ({
|
|
|
3684
3698
|
)) })
|
|
3685
3699
|
] })
|
|
3686
3700
|
] }),
|
|
3687
|
-
/* @__PURE__ */ r(
|
|
3688
|
-
|
|
3701
|
+
/* @__PURE__ */ r(V, { className: "space-y-6", children: R.map(({ question: B }) => /* @__PURE__ */ r(
|
|
3702
|
+
zr,
|
|
3689
3703
|
{
|
|
3690
|
-
question:
|
|
3691
|
-
value: m[
|
|
3692
|
-
error: w[
|
|
3693
|
-
onChange: (S) => O(
|
|
3704
|
+
question: B,
|
|
3705
|
+
value: m[B.id] ?? [],
|
|
3706
|
+
error: w[B.id],
|
|
3707
|
+
onChange: (S) => O(B.id, S)
|
|
3694
3708
|
},
|
|
3695
|
-
|
|
3709
|
+
B.id
|
|
3696
3710
|
)) }),
|
|
3697
3711
|
/* @__PURE__ */ o(ge, { className: "flex items-center justify-between", children: [
|
|
3698
3712
|
/* @__PURE__ */ o(
|
|
3699
|
-
|
|
3713
|
+
Z,
|
|
3700
3714
|
{
|
|
3701
3715
|
type: "button",
|
|
3702
3716
|
variant: "outline",
|
|
3703
|
-
onClick:
|
|
3717
|
+
onClick: K,
|
|
3704
3718
|
style: { display: "flex", alignItems: "center", gap: "4px" },
|
|
3705
3719
|
children: [
|
|
3706
3720
|
/* @__PURE__ */ r(bt, { size: 14 }),
|
|
@@ -3708,8 +3722,8 @@ const zr = ({
|
|
|
3708
3722
|
]
|
|
3709
3723
|
}
|
|
3710
3724
|
),
|
|
3711
|
-
|
|
3712
|
-
|
|
3725
|
+
T ? /* @__PURE__ */ r(
|
|
3726
|
+
Z,
|
|
3713
3727
|
{
|
|
3714
3728
|
type: "button",
|
|
3715
3729
|
isLoading: c,
|
|
@@ -3717,10 +3731,10 @@ const zr = ({
|
|
|
3717
3731
|
children: "Continue"
|
|
3718
3732
|
}
|
|
3719
3733
|
) : /* @__PURE__ */ o(
|
|
3720
|
-
|
|
3734
|
+
Z,
|
|
3721
3735
|
{
|
|
3722
3736
|
type: "button",
|
|
3723
|
-
onClick:
|
|
3737
|
+
onClick: F,
|
|
3724
3738
|
style: { display: "flex", alignItems: "center", gap: "4px" },
|
|
3725
3739
|
children: [
|
|
3726
3740
|
"Next",
|
|
@@ -3731,7 +3745,7 @@ const zr = ({
|
|
|
3731
3745
|
] }),
|
|
3732
3746
|
u && /* @__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: u.message }) })
|
|
3733
3747
|
] }) : null;
|
|
3734
|
-
},
|
|
3748
|
+
}, zr = ({ question: e, value: t, error: n, onChange: a }) => {
|
|
3735
3749
|
var c;
|
|
3736
3750
|
const l = (((c = e.defaultAnswers) == null ? void 0 : c.length) ?? 0) > 0 ? e.showAsDropdown ? e.canMultipleAnswer ? "multi-select" : "single-select" : e.canMultipleAnswer ? "checkbox" : "radio" : "text";
|
|
3737
3751
|
return /* @__PURE__ */ o("div", { className: "space-y-2", children: [
|
|
@@ -3847,15 +3861,15 @@ const zr = ({
|
|
|
3847
3861
|
if (w.preventDefault(), !a) return;
|
|
3848
3862
|
const f = await Promise.all(
|
|
3849
3863
|
a.uploadDocumentFiles.map(async (b) => {
|
|
3850
|
-
const
|
|
3851
|
-
|
|
3852
|
-
fileName:
|
|
3853
|
-
fileData: await pr(
|
|
3864
|
+
const P = h[b.id] || [], T = await Promise.all(
|
|
3865
|
+
P.map(async (R) => ({
|
|
3866
|
+
fileName: R.name,
|
|
3867
|
+
fileData: await pr(R)
|
|
3854
3868
|
}))
|
|
3855
3869
|
);
|
|
3856
3870
|
return {
|
|
3857
3871
|
uploadDocumentFileId: b.id,
|
|
3858
|
-
valueList:
|
|
3872
|
+
valueList: T
|
|
3859
3873
|
};
|
|
3860
3874
|
})
|
|
3861
3875
|
), N = {
|
|
@@ -3865,15 +3879,15 @@ const zr = ({
|
|
|
3865
3879
|
};
|
|
3866
3880
|
await u(N), t == null || t();
|
|
3867
3881
|
};
|
|
3868
|
-
return s ? /* @__PURE__ */ r(
|
|
3882
|
+
return s ? /* @__PURE__ */ r(Y, { children: /* @__PURE__ */ r(V, { children: /* @__PURE__ */ r(Se, { className: "my-8" }) }) }) : c ? /* @__PURE__ */ r(Y, { children: /* @__PURE__ */ r(V, { children: /* @__PURE__ */ o("p", { className: "text-danger-500", children: [
|
|
3869
3883
|
"Error loading document requirements: ",
|
|
3870
3884
|
c.message
|
|
3871
|
-
] }) }) }) : a ? /* @__PURE__ */ r("form", { onSubmit: v, children: /* @__PURE__ */ o(
|
|
3885
|
+
] }) }) }) : a ? /* @__PURE__ */ r("form", { onSubmit: v, children: /* @__PURE__ */ o(Y, { children: [
|
|
3872
3886
|
/* @__PURE__ */ o(ye, { children: [
|
|
3873
3887
|
/* @__PURE__ */ r("h2", { className: "text-lg font-bold", children: a.displayName }),
|
|
3874
3888
|
a.subtitle && /* @__PURE__ */ r("p", { className: "text-gray-600 dark:text-gray-400 mt-1", children: a.subtitle })
|
|
3875
3889
|
] }),
|
|
3876
|
-
/* @__PURE__ */ r(
|
|
3890
|
+
/* @__PURE__ */ r(V, { className: "space-y-6", children: a.uploadDocumentFiles.map((w) => /* @__PURE__ */ r(
|
|
3877
3891
|
Ir,
|
|
3878
3892
|
{
|
|
3879
3893
|
label: w.displayName,
|
|
@@ -3888,23 +3902,23 @@ const zr = ({
|
|
|
3888
3902
|
w.id
|
|
3889
3903
|
)) }),
|
|
3890
3904
|
/* @__PURE__ */ o(ge, { className: "flex justify-between", children: [
|
|
3891
|
-
n && /* @__PURE__ */ r(
|
|
3892
|
-
/* @__PURE__ */ r(
|
|
3905
|
+
n && /* @__PURE__ */ r(Z, { type: "button", variant: "outline", onClick: n, children: "Back" }),
|
|
3906
|
+
/* @__PURE__ */ r(Z, { type: "submit", isLoading: l, children: "Continue" })
|
|
3893
3907
|
] })
|
|
3894
3908
|
] }) }) : null;
|
|
3895
3909
|
}, Hr = ({ applicantId: e, onComplete: t, onBack: n }) => {
|
|
3896
3910
|
const { overview: a, isLoading: s, isSubmitting: l, error: c, passOverview: u } = wr(e), h = async () => {
|
|
3897
3911
|
await u(), t == null || t();
|
|
3898
3912
|
};
|
|
3899
|
-
return s ? /* @__PURE__ */ r(
|
|
3913
|
+
return s ? /* @__PURE__ */ r(Y, { children: /* @__PURE__ */ r(V, { children: /* @__PURE__ */ r(Se, { className: "my-8" }) }) }) : c ? /* @__PURE__ */ r(Y, { children: /* @__PURE__ */ r(V, { children: /* @__PURE__ */ o("p", { className: "text-danger-500", children: [
|
|
3900
3914
|
"Error loading overview: ",
|
|
3901
3915
|
c.message
|
|
3902
|
-
] }) }) }) : a ? /* @__PURE__ */ o(
|
|
3916
|
+
] }) }) }) : a ? /* @__PURE__ */ o(Y, { children: [
|
|
3903
3917
|
/* @__PURE__ */ o(ye, { children: [
|
|
3904
3918
|
/* @__PURE__ */ r("h2", { className: "text-lg font-bold", children: a.title || "Overview" }),
|
|
3905
3919
|
a.description && /* @__PURE__ */ r("p", { className: "text-gray-600 dark:text-gray-400 mt-1", children: a.description })
|
|
3906
3920
|
] }),
|
|
3907
|
-
/* @__PURE__ */ r(
|
|
3921
|
+
/* @__PURE__ */ r(V, { className: "space-y-8", children: a.steps && a.steps.length > 0 ? a.steps.sort((m, v) => m.order - v.order).map((m) => /* @__PURE__ */ o("div", { className: "metakyc-overview-step-item flex items-center space-x-3", children: [
|
|
3908
3922
|
/* @__PURE__ */ r("div", { className: "metakyc-step-icon flex-shrink-0", children: /* @__PURE__ */ r("div", { className: "w-8 h-8 rounded-full bg-primary-500 text-white flex items-center justify-center font-medium text-sm", children: m.order + 1 }) }),
|
|
3909
3923
|
/* @__PURE__ */ o(
|
|
3910
3924
|
"div",
|
|
@@ -3924,8 +3938,8 @@ const zr = ({
|
|
|
3924
3938
|
)
|
|
3925
3939
|
] }, m.order)) : /* @__PURE__ */ r("div", { className: "text-center py-8", children: /* @__PURE__ */ r("p", { className: "text-gray-600 dark:text-gray-400", children: "Loading overview data..." }) }) }),
|
|
3926
3940
|
/* @__PURE__ */ o(ge, { className: "flex justify-between", children: [
|
|
3927
|
-
n && /* @__PURE__ */ r(
|
|
3928
|
-
/* @__PURE__ */ r(
|
|
3941
|
+
n && /* @__PURE__ */ r(Z, { type: "button", variant: "outline", onClick: n, children: "Back" }),
|
|
3942
|
+
/* @__PURE__ */ r(Z, { onClick: h, isLoading: l, children: "Continue" })
|
|
3929
3943
|
] })
|
|
3930
3944
|
] }) : null;
|
|
3931
3945
|
};
|
|
@@ -3987,101 +4001,101 @@ function Yr(e) {
|
|
|
3987
4001
|
t.has(s) || t.set(s, []), t.get(s).push({ criterion: n, idx: a });
|
|
3988
4002
|
}), Array.from(t.entries()).sort(([n], [a]) => n - a).map(([, n]) => n);
|
|
3989
4003
|
}
|
|
3990
|
-
function
|
|
4004
|
+
function Vr(e) {
|
|
3991
4005
|
return e.builtInType === 1 ? "country" : !e.defaultValues || e.defaultValues.length === 0 ? "text" : e.multipleValue ? "checkbox" : "radio";
|
|
3992
4006
|
}
|
|
3993
|
-
const
|
|
4007
|
+
const qr = ({
|
|
3994
4008
|
applicantId: e,
|
|
3995
4009
|
onComplete: t,
|
|
3996
4010
|
onBack: n
|
|
3997
4011
|
}) => {
|
|
3998
|
-
const { config: a } = be(), s = a.locale ?? "en", { criteria: l, initialAnswers: c, isLoading: u, isSubmitting: h, error: m, submit: v } = Sr(e), [w, f] = k({}), [N, b] = k({}), [
|
|
4012
|
+
const { config: a } = be(), s = a.locale ?? "en", { criteria: l, initialAnswers: c, isLoading: u, isSubmitting: h, error: m, submit: v } = Sr(e), [w, f] = k({}), [N, b] = k({}), [P, T] = k(0), [R, O] = k(!1);
|
|
3999
4013
|
ve.useEffect(() => {
|
|
4000
4014
|
c && Object.keys(c).length > 0 && Object.keys(w).length === 0 && f(c);
|
|
4001
4015
|
}, [c]);
|
|
4002
|
-
const
|
|
4016
|
+
const A = Pe(
|
|
4003
4017
|
() => l && l.length > 0 ? Yr(l) : [],
|
|
4004
4018
|
[l]
|
|
4005
|
-
),
|
|
4019
|
+
), F = P === A.length - 1, K = A[P] ?? [];
|
|
4006
4020
|
ve.useEffect(() => {
|
|
4007
|
-
!u && l && l.length === 0 && !
|
|
4008
|
-
}, [u, l,
|
|
4009
|
-
const re =
|
|
4010
|
-
f((
|
|
4011
|
-
const
|
|
4012
|
-
return delete
|
|
4021
|
+
!u && l && l.length === 0 && !R && !h && (O(!0), v({ applicantId: e, criteriaValueInputs: [] }).then(() => t == null ? void 0 : t()).catch(console.error));
|
|
4022
|
+
}, [u, l, R, h, v, e, t]);
|
|
4023
|
+
const re = Q((M, z) => {
|
|
4024
|
+
f((L) => ({ ...L, [M]: z })), b((L) => {
|
|
4025
|
+
const D = { ...L };
|
|
4026
|
+
return delete D[M], D;
|
|
4013
4027
|
});
|
|
4014
|
-
}, []),
|
|
4028
|
+
}, []), B = Q(() => {
|
|
4015
4029
|
const M = {};
|
|
4016
|
-
for (const { criterion:
|
|
4017
|
-
const
|
|
4018
|
-
|
|
4030
|
+
for (const { criterion: z } of K) {
|
|
4031
|
+
const L = Wr(z, w[z.id] ?? []);
|
|
4032
|
+
L && (M[z.id] = L);
|
|
4019
4033
|
}
|
|
4020
|
-
return b((
|
|
4021
|
-
}, [
|
|
4022
|
-
|
|
4034
|
+
return b((z) => ({ ...z, ...M })), Object.keys(M).length === 0;
|
|
4035
|
+
}, [K, w]), S = () => {
|
|
4036
|
+
B() && T((M) => M + 1);
|
|
4023
4037
|
}, U = () => {
|
|
4024
|
-
|
|
4025
|
-
},
|
|
4026
|
-
if (!(
|
|
4038
|
+
P > 0 ? T((M) => M - 1) : n == null || n();
|
|
4039
|
+
}, j = async () => {
|
|
4040
|
+
if (!(!B() || !l))
|
|
4027
4041
|
try {
|
|
4028
|
-
const M = l.map((
|
|
4029
|
-
const
|
|
4030
|
-
return
|
|
4031
|
-
}).filter((
|
|
4042
|
+
const M = l.map((L) => {
|
|
4043
|
+
const D = (w[L.id] ?? []).filter((q) => q && q.trim());
|
|
4044
|
+
return D.length > 0 ? { riskCriteriaId: L.id, values: D } : null;
|
|
4045
|
+
}).filter((L) => L !== null);
|
|
4032
4046
|
await v({ applicantId: e, criteriaValueInputs: M }), t == null || t();
|
|
4033
4047
|
} catch (M) {
|
|
4034
4048
|
console.error("Risk scoring submit error:", M);
|
|
4035
4049
|
}
|
|
4036
4050
|
};
|
|
4037
|
-
return u ? /* @__PURE__ */ r(
|
|
4051
|
+
return u ? /* @__PURE__ */ r(Y, { children: /* @__PURE__ */ o(V, { children: [
|
|
4038
4052
|
/* @__PURE__ */ r(Se, { className: "my-8" }),
|
|
4039
4053
|
/* @__PURE__ */ r("p", { className: "text-center text-sm mt-4", style: { color: "var(--metakyc-text-secondary, #6b7280)" }, children: "Loading risk scoring criteria…" })
|
|
4040
|
-
] }) }) : !u && l && l.length === 0 ? /* @__PURE__ */ r(
|
|
4054
|
+
] }) }) : !u && l && l.length === 0 ? /* @__PURE__ */ r(Y, { children: /* @__PURE__ */ o(V, { children: [
|
|
4041
4055
|
/* @__PURE__ */ r(Se, { className: "my-8" }),
|
|
4042
4056
|
/* @__PURE__ */ r("p", { className: "text-center text-sm mt-4", style: { color: "var(--metakyc-text-secondary, #6b7280)" }, children: "No criteria required. Moving to next step…" })
|
|
4043
|
-
] }) }) : m ? /* @__PURE__ */ r(
|
|
4057
|
+
] }) }) : m ? /* @__PURE__ */ r(Y, { children: /* @__PURE__ */ r(V, { children: /* @__PURE__ */ o("p", { className: "text-danger-500", children: [
|
|
4044
4058
|
"Error loading criteria: ",
|
|
4045
4059
|
m.message
|
|
4046
|
-
] }) }) }) : l ? /* @__PURE__ */ o(
|
|
4060
|
+
] }) }) }) : l ? /* @__PURE__ */ o(Y, { children: [
|
|
4047
4061
|
/* @__PURE__ */ o(ye, { children: [
|
|
4048
4062
|
/* @__PURE__ */ r("h2", { className: "text-lg font-bold", children: "Risk Assessment" }),
|
|
4049
4063
|
/* @__PURE__ */ r("p", { className: "text-sm", style: { color: "var(--metakyc-text-secondary, #6b7280)" }, children: "Please answer the following questions for risk evaluation" }),
|
|
4050
|
-
|
|
4064
|
+
A.length > 1 && /* @__PURE__ */ o("div", { className: "flex items-center justify-between mt-3", children: [
|
|
4051
4065
|
/* @__PURE__ */ o("span", { className: "text-xs", style: { color: "var(--metakyc-text-muted, #9ca3af)" }, children: [
|
|
4052
4066
|
"Page ",
|
|
4053
|
-
|
|
4067
|
+
P + 1,
|
|
4054
4068
|
" of ",
|
|
4055
|
-
|
|
4069
|
+
A.length
|
|
4056
4070
|
] }),
|
|
4057
|
-
/* @__PURE__ */ r("div", { className: "flex items-center gap-1.5", children:
|
|
4071
|
+
/* @__PURE__ */ r("div", { className: "flex items-center gap-1.5", children: A.map((M, z) => /* @__PURE__ */ r(
|
|
4058
4072
|
"div",
|
|
4059
4073
|
{
|
|
4060
4074
|
className: "rounded-full transition-all duration-200",
|
|
4061
4075
|
style: {
|
|
4062
4076
|
height: "6px",
|
|
4063
|
-
width:
|
|
4064
|
-
backgroundColor:
|
|
4077
|
+
width: z === P ? "20px" : "6px",
|
|
4078
|
+
backgroundColor: z <= P ? "var(--metakyc-primary, #2563eb)" : "var(--metakyc-border, #e5e7eb)"
|
|
4065
4079
|
}
|
|
4066
4080
|
},
|
|
4067
|
-
|
|
4081
|
+
z
|
|
4068
4082
|
)) })
|
|
4069
4083
|
] })
|
|
4070
4084
|
] }),
|
|
4071
|
-
/* @__PURE__ */ r(
|
|
4085
|
+
/* @__PURE__ */ r(V, { className: "space-y-6", children: K.map(({ criterion: M }) => /* @__PURE__ */ r(
|
|
4072
4086
|
Qr,
|
|
4073
4087
|
{
|
|
4074
4088
|
criterion: M,
|
|
4075
4089
|
value: w[M.id] ?? [],
|
|
4076
4090
|
error: N[M.id],
|
|
4077
4091
|
locale: s,
|
|
4078
|
-
onChange: (
|
|
4092
|
+
onChange: (z) => re(M.id, z)
|
|
4079
4093
|
},
|
|
4080
4094
|
M.id
|
|
4081
4095
|
)) }),
|
|
4082
4096
|
/* @__PURE__ */ o(ge, { className: "flex items-center justify-between", children: [
|
|
4083
4097
|
/* @__PURE__ */ o(
|
|
4084
|
-
|
|
4098
|
+
Z,
|
|
4085
4099
|
{
|
|
4086
4100
|
type: "button",
|
|
4087
4101
|
variant: "outline",
|
|
@@ -4089,12 +4103,12 @@ const Vr = ({
|
|
|
4089
4103
|
style: { display: "flex", alignItems: "center", gap: "4px" },
|
|
4090
4104
|
children: [
|
|
4091
4105
|
/* @__PURE__ */ r(bt, { size: 14 }),
|
|
4092
|
-
|
|
4106
|
+
P > 0 ? "Previous" : "Back"
|
|
4093
4107
|
]
|
|
4094
4108
|
}
|
|
4095
4109
|
),
|
|
4096
|
-
|
|
4097
|
-
|
|
4110
|
+
F ? /* @__PURE__ */ r(Z, { type: "button", isLoading: h, onClick: j, children: "Continue" }) : /* @__PURE__ */ o(
|
|
4111
|
+
Z,
|
|
4098
4112
|
{
|
|
4099
4113
|
type: "button",
|
|
4100
4114
|
onClick: S,
|
|
@@ -4109,7 +4123,7 @@ const Vr = ({
|
|
|
4109
4123
|
m && /* @__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: m.message }) })
|
|
4110
4124
|
] }) : null;
|
|
4111
4125
|
}, Qr = ({ criterion: e, value: t, error: n, locale: a, onChange: s }) => {
|
|
4112
|
-
const l =
|
|
4126
|
+
const l = Vr(e), c = e.valueDataType === Ie.Integer || e.valueDataType === Ie.Money || e.valueDataType === Ie.DigitOnly, u = jr(e), h = (m) => u ? Kr(m, a) : m;
|
|
4113
4127
|
return /* @__PURE__ */ o("div", { className: "space-y-2", children: [
|
|
4114
4128
|
/* @__PURE__ */ o("label", { className: "block text-sm font-medium", style: { color: "var(--metakyc-text-primary, #111827)" }, children: [
|
|
4115
4129
|
e.displayName,
|
|
@@ -4250,12 +4264,12 @@ const Vr = ({
|
|
|
4250
4264
|
} finally {
|
|
4251
4265
|
u(!1);
|
|
4252
4266
|
}
|
|
4253
|
-
}, children: /* @__PURE__ */ o(
|
|
4267
|
+
}, children: /* @__PURE__ */ o(Y, { children: [
|
|
4254
4268
|
/* @__PURE__ */ o(ye, { children: [
|
|
4255
4269
|
/* @__PURE__ */ r("h2", { className: "text-lg font-bold text-gray-900 dark:text-white", children: "Which statement best describes you?" }),
|
|
4256
4270
|
/* @__PURE__ */ r("p", { className: "text-gray-600 dark:text-gray-400 mt-2", children: "All Tokenise clients are treated as Retail Investors under EU regulation, which gives you the highest level of investor protection. For our internal purposes, we ask you to select the description that best matches your situation" })
|
|
4257
4271
|
] }),
|
|
4258
|
-
/* @__PURE__ */ o(
|
|
4272
|
+
/* @__PURE__ */ o(V, { className: "space-y-4", children: [
|
|
4259
4273
|
/* @__PURE__ */ r("p", { className: "text-sm font-medium text-gray-700 dark:text-gray-300 mb-3", children: "Choose one" }),
|
|
4260
4274
|
/* @__PURE__ */ r(
|
|
4261
4275
|
"label",
|
|
@@ -4351,9 +4365,9 @@ const Vr = ({
|
|
|
4351
4365
|
] }) })
|
|
4352
4366
|
] }),
|
|
4353
4367
|
/* @__PURE__ */ o(ge, { className: "flex justify-between", children: [
|
|
4354
|
-
n && /* @__PURE__ */ r(
|
|
4368
|
+
n && /* @__PURE__ */ r(Z, { type: "button", variant: "outline", onClick: n, children: "Back" }),
|
|
4355
4369
|
/* @__PURE__ */ r(
|
|
4356
|
-
|
|
4370
|
+
Z,
|
|
4357
4371
|
{
|
|
4358
4372
|
type: "submit",
|
|
4359
4373
|
isLoading: c,
|
|
@@ -4368,134 +4382,134 @@ const Vr = ({
|
|
|
4368
4382
|
onComplete: t,
|
|
4369
4383
|
onBack: n
|
|
4370
4384
|
}) => {
|
|
4371
|
-
const { appropriatenessTestService: a } = be(), [s, l] = k(null), [c, u] = k(!0), [h, m] = k(!1), [v, w] = k(null), [f, N] = k({}), [b,
|
|
4385
|
+
const { appropriatenessTestService: a } = be(), [s, l] = k(null), [c, u] = k(!0), [h, m] = k(!1), [v, w] = k(null), [f, N] = k({}), [b, P] = k(0), [T, R] = k(!1), [O, A] = k(!1), [F, K] = k(0);
|
|
4372
4386
|
ie(() => {
|
|
4373
4387
|
(async () => {
|
|
4374
4388
|
try {
|
|
4375
4389
|
u(!0), w(null), console.log("Loading appropriateness test for applicant:", e);
|
|
4376
|
-
const
|
|
4377
|
-
if (console.log("Appropriateness test data:",
|
|
4378
|
-
const
|
|
4379
|
-
|
|
4390
|
+
const D = await a.getAppropriatenessTest(e);
|
|
4391
|
+
if (console.log("Appropriateness test data:", D), l(D), D.waitTimeSpanForNextTry && D.waitTimeSpanForNextTry !== "00:00:00") {
|
|
4392
|
+
const q = re(D.waitTimeSpanForNextTry);
|
|
4393
|
+
q > 0 && K(q);
|
|
4380
4394
|
}
|
|
4381
|
-
} catch (
|
|
4382
|
-
console.error("Error loading appropriateness test:",
|
|
4395
|
+
} catch (D) {
|
|
4396
|
+
console.error("Error loading appropriateness test:", D), w(D.message || "Failed to load appropriateness test");
|
|
4383
4397
|
} finally {
|
|
4384
4398
|
u(!1);
|
|
4385
4399
|
}
|
|
4386
4400
|
})();
|
|
4387
4401
|
}, [e, a]);
|
|
4388
|
-
const re = (
|
|
4389
|
-
const
|
|
4390
|
-
if (
|
|
4391
|
-
const [
|
|
4392
|
-
return
|
|
4402
|
+
const re = (L) => {
|
|
4403
|
+
const D = L.split(":").map(Number);
|
|
4404
|
+
if (D.length === 3) {
|
|
4405
|
+
const [q, W, de] = D;
|
|
4406
|
+
return q * 3600 + W * 60 + de;
|
|
4393
4407
|
}
|
|
4394
4408
|
return 0;
|
|
4395
|
-
},
|
|
4396
|
-
const
|
|
4397
|
-
return `${
|
|
4409
|
+
}, B = (L) => {
|
|
4410
|
+
const D = Math.floor(L / 60), q = L % 60;
|
|
4411
|
+
return `${D.toString().padStart(2, "0")}:${q.toString().padStart(2, "0")}`;
|
|
4398
4412
|
};
|
|
4399
4413
|
ie(() => {
|
|
4400
|
-
if (!
|
|
4401
|
-
const
|
|
4402
|
-
|
|
4414
|
+
if (!T || b <= 0) return;
|
|
4415
|
+
const L = setInterval(() => {
|
|
4416
|
+
P((D) => D <= 1 ? (A(!0), 0) : D - 1);
|
|
4403
4417
|
}, 1e3);
|
|
4404
|
-
return () => clearInterval(
|
|
4405
|
-
}, [
|
|
4406
|
-
if (
|
|
4407
|
-
const
|
|
4408
|
-
|
|
4418
|
+
return () => clearInterval(L);
|
|
4419
|
+
}, [T, b]), ie(() => {
|
|
4420
|
+
if (F <= 0) return;
|
|
4421
|
+
const L = setInterval(() => {
|
|
4422
|
+
K((D) => D <= 1 ? 0 : D - 1);
|
|
4409
4423
|
}, 1e3);
|
|
4410
|
-
return () => clearInterval(
|
|
4411
|
-
}, [
|
|
4412
|
-
O && !h &&
|
|
4424
|
+
return () => clearInterval(L);
|
|
4425
|
+
}, [F]), ie(() => {
|
|
4426
|
+
O && !h && j();
|
|
4413
4427
|
}, [O]);
|
|
4414
4428
|
const S = () => {
|
|
4415
|
-
s && (
|
|
4416
|
-
}, U = (
|
|
4417
|
-
N((
|
|
4418
|
-
...
|
|
4419
|
-
[
|
|
4429
|
+
s && (R(!0), P(s.testDurationSec));
|
|
4430
|
+
}, U = (L, D) => {
|
|
4431
|
+
N((q) => ({
|
|
4432
|
+
...q,
|
|
4433
|
+
[L]: D
|
|
4420
4434
|
}));
|
|
4421
|
-
},
|
|
4422
|
-
if (
|
|
4435
|
+
}, j = async (L) => {
|
|
4436
|
+
if (L && L.preventDefault(), !!s) {
|
|
4423
4437
|
if (!O) {
|
|
4424
|
-
const
|
|
4425
|
-
if (
|
|
4426
|
-
w(`Please answer all questions. ${
|
|
4438
|
+
const D = s.appropriatenessQuestions.length - Object.keys(f).length;
|
|
4439
|
+
if (D > 0) {
|
|
4440
|
+
w(`Please answer all questions. ${D} question(s) remaining.`);
|
|
4427
4441
|
return;
|
|
4428
4442
|
}
|
|
4429
4443
|
}
|
|
4430
4444
|
m(!0), w(null);
|
|
4431
4445
|
try {
|
|
4432
|
-
const
|
|
4433
|
-
(
|
|
4434
|
-
appropriatenessQuestionId:
|
|
4435
|
-
value: f[
|
|
4446
|
+
const D = s.appropriatenessQuestions.map(
|
|
4447
|
+
(W) => ({
|
|
4448
|
+
appropriatenessQuestionId: W.id,
|
|
4449
|
+
value: f[W.id] || ""
|
|
4436
4450
|
// Empty string if not answered
|
|
4437
4451
|
})
|
|
4438
|
-
),
|
|
4452
|
+
), q = {
|
|
4439
4453
|
applicantId: e,
|
|
4440
4454
|
appropriatenessTestId: s.id,
|
|
4441
|
-
appropriatenessQuestionResults:
|
|
4455
|
+
appropriatenessQuestionResults: D
|
|
4442
4456
|
};
|
|
4443
|
-
console.log("Submitting appropriateness test:",
|
|
4457
|
+
console.log("Submitting appropriateness test:", q);
|
|
4444
4458
|
try {
|
|
4445
|
-
const
|
|
4446
|
-
console.log("Appropriateness test result:",
|
|
4447
|
-
} catch (
|
|
4448
|
-
if (
|
|
4449
|
-
const
|
|
4450
|
-
console.log("Test failed:",
|
|
4459
|
+
const W = await a.fillAppropriatenessTest(q);
|
|
4460
|
+
console.log("Appropriateness test result:", W), W.message && (W.message.toLowerCase().includes("pass") || W.message.toLowerCase().includes("success") || W.message.toLowerCase().includes("congratulations")) ? t == null || t() : (w(W.message || "Test completed. Please check the result."), R(!1), A(!1), N({}), setTimeout(() => M(), 1e3));
|
|
4461
|
+
} catch (W) {
|
|
4462
|
+
if (W.code === 400 && W.message) {
|
|
4463
|
+
const de = W.message;
|
|
4464
|
+
console.log("Test failed:", de), w(de), R(!1), A(!1), N({}), setTimeout(() => M(), 1500);
|
|
4451
4465
|
} else
|
|
4452
|
-
throw
|
|
4466
|
+
throw W;
|
|
4453
4467
|
}
|
|
4454
|
-
} catch (
|
|
4455
|
-
console.error("Error submitting appropriateness test:",
|
|
4468
|
+
} catch (D) {
|
|
4469
|
+
console.error("Error submitting appropriateness test:", D), w(D.message || "Failed to submit test. Please try again."), R(!1), A(!1), N({});
|
|
4456
4470
|
} finally {
|
|
4457
4471
|
m(!1);
|
|
4458
4472
|
}
|
|
4459
4473
|
}
|
|
4460
4474
|
}, M = async () => {
|
|
4461
4475
|
try {
|
|
4462
|
-
const
|
|
4463
|
-
if (console.log("Reloaded test data:",
|
|
4464
|
-
const
|
|
4465
|
-
|
|
4476
|
+
const L = await a.getAppropriatenessTest(e);
|
|
4477
|
+
if (console.log("Reloaded test data:", L), l(L), L.waitTimeSpanForNextTry && L.waitTimeSpanForNextTry !== "00:00:00") {
|
|
4478
|
+
const D = re(L.waitTimeSpanForNextTry);
|
|
4479
|
+
D > 0 && K(D);
|
|
4466
4480
|
}
|
|
4467
|
-
} catch (
|
|
4468
|
-
console.error("Error reloading test data:",
|
|
4481
|
+
} catch (L) {
|
|
4482
|
+
console.error("Error reloading test data:", L), w((D) => D + `
|
|
4469
4483
|
|
|
4470
4484
|
Failed to reload test data. Please refresh the page.`);
|
|
4471
4485
|
}
|
|
4472
4486
|
};
|
|
4473
4487
|
if (c)
|
|
4474
|
-
return /* @__PURE__ */ r(
|
|
4488
|
+
return /* @__PURE__ */ r(Y, { children: /* @__PURE__ */ o(V, { children: [
|
|
4475
4489
|
/* @__PURE__ */ r(Se, { className: "my-8" }),
|
|
4476
4490
|
/* @__PURE__ */ r("p", { className: "text-center text-gray-600 dark:text-gray-400 mt-4", children: "Loading appropriateness test..." })
|
|
4477
4491
|
] }) });
|
|
4478
4492
|
if (!s)
|
|
4479
|
-
return /* @__PURE__ */ r(
|
|
4493
|
+
return /* @__PURE__ */ r(Y, { children: /* @__PURE__ */ o(V, { className: "py-12 text-center", children: [
|
|
4480
4494
|
/* @__PURE__ */ r("p", { className: "text-danger-500 text-lg mb-4", children: "No test data available" }),
|
|
4481
4495
|
v && /* @__PURE__ */ r("p", { className: "text-gray-600 dark:text-gray-400", children: v })
|
|
4482
4496
|
] }) });
|
|
4483
|
-
if (
|
|
4484
|
-
return /* @__PURE__ */ o(
|
|
4497
|
+
if (F > 0)
|
|
4498
|
+
return /* @__PURE__ */ o(Y, { children: [
|
|
4485
4499
|
/* @__PURE__ */ o(ye, { children: [
|
|
4486
4500
|
/* @__PURE__ */ r("h2", { className: "text-lg font-bold text-gray-900 dark:text-white", children: s.displayName }),
|
|
4487
4501
|
s.subtitle && /* @__PURE__ */ r("p", { className: "text-gray-600 dark:text-gray-400 mt-2", children: s.subtitle })
|
|
4488
4502
|
] }),
|
|
4489
|
-
/* @__PURE__ */ o(
|
|
4503
|
+
/* @__PURE__ */ o(V, { className: "py-12 text-center", children: [
|
|
4490
4504
|
/* @__PURE__ */ o("div", { className: "mb-6", children: [
|
|
4491
|
-
/* @__PURE__ */ r("div", { className: "text-6xl font-bold text-primary-500 mb-2", children:
|
|
4505
|
+
/* @__PURE__ */ r("div", { className: "text-6xl font-bold text-primary-500 mb-2", children: B(F) }),
|
|
4492
4506
|
/* @__PURE__ */ r("p", { className: "text-gray-600 dark:text-gray-400", children: "Please wait before attempting the test again" })
|
|
4493
4507
|
] }),
|
|
4494
4508
|
v && /* @__PURE__ */ r("div", { className: "mt-4 p-4 bg-red-50 dark:bg-red-900/20 border border-red-200 dark:border-red-800 rounded-lg", children: /* @__PURE__ */ r("p", { className: "text-red-600 dark:text-red-400 text-sm", children: v }) })
|
|
4495
4509
|
] })
|
|
4496
4510
|
] });
|
|
4497
|
-
const
|
|
4498
|
-
return
|
|
4511
|
+
const z = s.testAllowedMaxTry - s.totalFailedTries;
|
|
4512
|
+
return T ? /* @__PURE__ */ r("form", { onSubmit: j, children: /* @__PURE__ */ o(Y, { children: [
|
|
4499
4513
|
/* @__PURE__ */ r(ye, { children: /* @__PURE__ */ o("div", { className: "flex items-center justify-between", children: [
|
|
4500
4514
|
/* @__PURE__ */ o("div", { children: [
|
|
4501
4515
|
/* @__PURE__ */ r("h2", { className: "text-lg font-bold text-gray-900 dark:text-white", children: s.displayName }),
|
|
@@ -4506,13 +4520,13 @@ Failed to reload test data. Please refresh the page.`);
|
|
|
4506
4520
|
"div",
|
|
4507
4521
|
{
|
|
4508
4522
|
className: `text-3xl font-bold ${b <= 60 ? "text-danger-500" : "text-primary-500"}`,
|
|
4509
|
-
children:
|
|
4523
|
+
children: B(b)
|
|
4510
4524
|
}
|
|
4511
4525
|
),
|
|
4512
4526
|
/* @__PURE__ */ r("p", { className: "text-sm text-gray-500 dark:text-gray-400", children: "Time Remaining" })
|
|
4513
4527
|
] })
|
|
4514
4528
|
] }) }),
|
|
4515
|
-
/* @__PURE__ */ o(
|
|
4529
|
+
/* @__PURE__ */ o(V, { className: "space-y-6", children: [
|
|
4516
4530
|
/* @__PURE__ */ o("div", { className: "flex items-center justify-between mb-4", children: [
|
|
4517
4531
|
/* @__PURE__ */ o(Re, { variant: "info", children: [
|
|
4518
4532
|
"Question ",
|
|
@@ -4520,14 +4534,14 @@ Failed to reload test data. Please refresh the page.`);
|
|
|
4520
4534
|
" of ",
|
|
4521
4535
|
s.totalQuestionCount
|
|
4522
4536
|
] }),
|
|
4523
|
-
/* @__PURE__ */ o(Re, { variant:
|
|
4524
|
-
|
|
4537
|
+
/* @__PURE__ */ o(Re, { variant: z > 1 ? "success" : "warning", children: [
|
|
4538
|
+
z,
|
|
4525
4539
|
" attempt",
|
|
4526
|
-
|
|
4540
|
+
z !== 1 ? "s" : "",
|
|
4527
4541
|
" remaining"
|
|
4528
4542
|
] })
|
|
4529
4543
|
] }),
|
|
4530
|
-
s.appropriatenessQuestions.map((
|
|
4544
|
+
s.appropriatenessQuestions.map((L, D) => /* @__PURE__ */ o(
|
|
4531
4545
|
"div",
|
|
4532
4546
|
{
|
|
4533
4547
|
className: "p-4 border border-gray-200 dark:border-gray-700 rounded-lg",
|
|
@@ -4535,39 +4549,39 @@ Failed to reload test data. Please refresh the page.`);
|
|
|
4535
4549
|
/* @__PURE__ */ o("div", { className: "mb-4", children: [
|
|
4536
4550
|
/* @__PURE__ */ o("span", { className: "inline-block px-2 py-1 text-xs font-semibold text-primary-700 bg-primary-100 dark:text-primary-300 dark:bg-primary-900/30 rounded mb-2", children: [
|
|
4537
4551
|
"Question ",
|
|
4538
|
-
|
|
4552
|
+
D + 1
|
|
4539
4553
|
] }),
|
|
4540
|
-
|
|
4541
|
-
/* @__PURE__ */ r("h3", { className: "text-lg font-semibold text-gray-900 dark:text-white mt-2", children:
|
|
4554
|
+
L.groupName && /* @__PURE__ */ r("span", { className: "ml-2 text-xs text-gray-500 dark:text-gray-400", children: L.groupName }),
|
|
4555
|
+
/* @__PURE__ */ r("h3", { className: "text-lg font-semibold text-gray-900 dark:text-white mt-2", children: L.question })
|
|
4542
4556
|
] }),
|
|
4543
|
-
/* @__PURE__ */ r("div", { className: "space-y-2", children:
|
|
4557
|
+
/* @__PURE__ */ r("div", { className: "space-y-2", children: L.answers.map((q, W) => /* @__PURE__ */ o(
|
|
4544
4558
|
"label",
|
|
4545
4559
|
{
|
|
4546
4560
|
className: `
|
|
4547
4561
|
flex items-center p-3 border-2 rounded-lg cursor-pointer transition-all
|
|
4548
|
-
${f[
|
|
4562
|
+
${f[L.id] === q ? "border-primary-500 bg-primary-50 dark:bg-primary-900/20" : "border-gray-200 dark:border-gray-700 hover:border-gray-300 dark:hover:border-gray-600"}
|
|
4549
4563
|
`,
|
|
4550
4564
|
children: [
|
|
4551
4565
|
/* @__PURE__ */ r(
|
|
4552
4566
|
"input",
|
|
4553
4567
|
{
|
|
4554
4568
|
type: "radio",
|
|
4555
|
-
name: `question-${
|
|
4556
|
-
value:
|
|
4557
|
-
checked: f[
|
|
4558
|
-
onChange: (
|
|
4569
|
+
name: `question-${L.id}`,
|
|
4570
|
+
value: q,
|
|
4571
|
+
checked: f[L.id] === q,
|
|
4572
|
+
onChange: (de) => U(L.id, de.target.value),
|
|
4559
4573
|
className: "h-4 w-4 text-primary-500 border-gray-300 focus:ring-primary-500",
|
|
4560
4574
|
disabled: h
|
|
4561
4575
|
}
|
|
4562
4576
|
),
|
|
4563
|
-
/* @__PURE__ */ r("span", { className: "ml-3 text-gray-700 dark:text-gray-300", children:
|
|
4577
|
+
/* @__PURE__ */ r("span", { className: "ml-3 text-gray-700 dark:text-gray-300", children: q })
|
|
4564
4578
|
]
|
|
4565
4579
|
},
|
|
4566
|
-
|
|
4580
|
+
W
|
|
4567
4581
|
)) })
|
|
4568
4582
|
]
|
|
4569
4583
|
},
|
|
4570
|
-
|
|
4584
|
+
L.id
|
|
4571
4585
|
)),
|
|
4572
4586
|
v && !O && /* @__PURE__ */ r("div", { className: "p-4 bg-red-50 dark:bg-red-900/20 border border-red-200 dark:border-red-800 rounded-lg", children: /* @__PURE__ */ o("p", { className: "text-red-600 dark:text-red-400 text-sm", children: [
|
|
4573
4587
|
/* @__PURE__ */ r("strong", { children: "Error:" }),
|
|
@@ -4581,7 +4595,7 @@ Failed to reload test data. Please refresh the page.`);
|
|
|
4581
4595
|
] }),
|
|
4582
4596
|
/* @__PURE__ */ o(ge, { className: "flex justify-between", children: [
|
|
4583
4597
|
/* @__PURE__ */ r(
|
|
4584
|
-
|
|
4598
|
+
Z,
|
|
4585
4599
|
{
|
|
4586
4600
|
type: "button",
|
|
4587
4601
|
variant: "outline",
|
|
@@ -4591,7 +4605,7 @@ Failed to reload test data. Please refresh the page.`);
|
|
|
4591
4605
|
}
|
|
4592
4606
|
),
|
|
4593
4607
|
/* @__PURE__ */ r(
|
|
4594
|
-
|
|
4608
|
+
Z,
|
|
4595
4609
|
{
|
|
4596
4610
|
type: "submit",
|
|
4597
4611
|
isLoading: h,
|
|
@@ -4600,12 +4614,12 @@ Failed to reload test data. Please refresh the page.`);
|
|
|
4600
4614
|
}
|
|
4601
4615
|
)
|
|
4602
4616
|
] })
|
|
4603
|
-
] }) }) : /* @__PURE__ */ o(
|
|
4617
|
+
] }) }) : /* @__PURE__ */ o(Y, { children: [
|
|
4604
4618
|
/* @__PURE__ */ o(ye, { children: [
|
|
4605
4619
|
/* @__PURE__ */ r("h2", { className: "text-lg font-bold text-gray-900 dark:text-white", children: s.displayName }),
|
|
4606
4620
|
s.subtitle && /* @__PURE__ */ r("p", { className: "text-gray-600 dark:text-gray-400 mt-2", children: s.subtitle })
|
|
4607
4621
|
] }),
|
|
4608
|
-
/* @__PURE__ */ o(
|
|
4622
|
+
/* @__PURE__ */ o(V, { children: [
|
|
4609
4623
|
s.description && /* @__PURE__ */ r("div", { className: "mb-6 p-4 bg-gray-50 dark:bg-gray-800 rounded-lg", children: /* @__PURE__ */ r("p", { className: "text-gray-700 dark:text-gray-300", children: s.description }) }),
|
|
4610
4624
|
/* @__PURE__ */ o("div", { className: "space-y-4 mb-6", children: [
|
|
4611
4625
|
/* @__PURE__ */ o("div", { className: "flex items-center justify-between p-4 bg-blue-50 dark:bg-blue-900/20 rounded-lg", children: [
|
|
@@ -4614,7 +4628,7 @@ Failed to reload test data. Please refresh the page.`);
|
|
|
4614
4628
|
] }),
|
|
4615
4629
|
/* @__PURE__ */ o("div", { className: "flex items-center justify-between p-4 bg-blue-50 dark:bg-blue-900/20 rounded-lg", children: [
|
|
4616
4630
|
/* @__PURE__ */ r("span", { className: "text-gray-700 dark:text-gray-300 font-medium", children: "Time Limit:" }),
|
|
4617
|
-
/* @__PURE__ */ r(Re, { variant: "info", children:
|
|
4631
|
+
/* @__PURE__ */ r(Re, { variant: "info", children: B(s.testDurationSec) })
|
|
4618
4632
|
] }),
|
|
4619
4633
|
/* @__PURE__ */ o("div", { className: "flex items-center justify-between p-4 bg-blue-50 dark:bg-blue-900/20 rounded-lg", children: [
|
|
4620
4634
|
/* @__PURE__ */ r("span", { className: "text-gray-700 dark:text-gray-300 font-medium", children: "Correct Answers Required:" }),
|
|
@@ -4622,7 +4636,7 @@ Failed to reload test data. Please refresh the page.`);
|
|
|
4622
4636
|
] }),
|
|
4623
4637
|
/* @__PURE__ */ o("div", { className: "flex items-center justify-between p-4 bg-blue-50 dark:bg-blue-900/20 rounded-lg", children: [
|
|
4624
4638
|
/* @__PURE__ */ r("span", { className: "text-gray-700 dark:text-gray-300 font-medium", children: "Attempts Remaining:" }),
|
|
4625
|
-
/* @__PURE__ */ r(Re, { variant:
|
|
4639
|
+
/* @__PURE__ */ r(Re, { variant: z > 1 ? "success" : "warning", children: z })
|
|
4626
4640
|
] })
|
|
4627
4641
|
] }),
|
|
4628
4642
|
v && /* @__PURE__ */ r("div", { className: "mb-4 p-4 bg-red-50 dark:bg-red-900/20 border border-red-200 dark:border-red-800 rounded-lg", children: /* @__PURE__ */ o("p", { className: "text-red-600 dark:text-red-400 text-sm", children: [
|
|
@@ -4630,16 +4644,16 @@ Failed to reload test data. Please refresh the page.`);
|
|
|
4630
4644
|
" ",
|
|
4631
4645
|
v
|
|
4632
4646
|
] }) }),
|
|
4633
|
-
|
|
4647
|
+
z <= 0 && /* @__PURE__ */ r("div", { className: "p-4 bg-red-50 dark:bg-red-900/20 border border-red-200 dark:border-red-800 rounded-lg", children: /* @__PURE__ */ r("p", { className: "text-red-600 dark:text-red-400", children: "You have used all your attempts. Please contact support for assistance." }) })
|
|
4634
4648
|
] }),
|
|
4635
4649
|
/* @__PURE__ */ o(ge, { className: "flex justify-between", children: [
|
|
4636
|
-
n && /* @__PURE__ */ r(
|
|
4650
|
+
n && /* @__PURE__ */ r(Z, { type: "button", variant: "outline", onClick: n, children: "Back" }),
|
|
4637
4651
|
/* @__PURE__ */ r(
|
|
4638
|
-
|
|
4652
|
+
Z,
|
|
4639
4653
|
{
|
|
4640
4654
|
type: "button",
|
|
4641
4655
|
onClick: S,
|
|
4642
|
-
disabled:
|
|
4656
|
+
disabled: z <= 0,
|
|
4643
4657
|
children: "Start Test"
|
|
4644
4658
|
}
|
|
4645
4659
|
)
|
|
@@ -4651,8 +4665,8 @@ Failed to reload test data. Please refresh the page.`);
|
|
|
4651
4665
|
onBack: n
|
|
4652
4666
|
}) => {
|
|
4653
4667
|
var _e, He, Ue, je;
|
|
4654
|
-
const { applicantService: a, baseInformationService: s, config: l, currentTheme: c } = be(), { identityData: u, provider: h, token: m, isLoading: v, error: w, requestIdentity: f, restartIdentity: N } = Nr(e), [b,
|
|
4655
|
-
|
|
4668
|
+
const { applicantService: a, baseInformationService: s, config: l, currentTheme: c } = be(), { identityData: u, provider: h, token: m, isLoading: v, error: w, requestIdentity: f, restartIdentity: N } = Nr(e), [b, P] = k(null), [T, R] = k(null), [O, A] = k([]), [F, K] = k([]), [re, B] = k(!0), [S, U] = k(!1), [j, M] = k(null), [z, L] = k(!1), D = ve.useRef(!1), [q, W] = k({}), [de, E] = k({}), _ = c != null && c.reviewPageFields && c.reviewPageFields.length > 0 ? c.reviewPageFields[0] : null, G = !!(c != null && c.reviewPageDisabled), le = te(!1);
|
|
4669
|
+
le.current = G;
|
|
4656
4670
|
const ne = Et({
|
|
4657
4671
|
defaultValues: {
|
|
4658
4672
|
street: "",
|
|
@@ -4665,8 +4679,8 @@ Failed to reload test data. Please refresh the page.`);
|
|
|
4665
4679
|
}
|
|
4666
4680
|
});
|
|
4667
4681
|
ie(() => {
|
|
4668
|
-
if (
|
|
4669
|
-
|
|
4682
|
+
if (G) {
|
|
4683
|
+
D.current || (D.current = !0, f().then(() => U(!0)).catch((y) => console.error("[Identity] Auto-request failed:", y)).finally(() => B(!1)));
|
|
4670
4684
|
return;
|
|
4671
4685
|
}
|
|
4672
4686
|
(async () => {
|
|
@@ -4677,13 +4691,13 @@ Failed to reload test data. Please refresh the page.`);
|
|
|
4677
4691
|
s.getCountries("", "en", 40)
|
|
4678
4692
|
// CountriesType.PhoneNumber
|
|
4679
4693
|
]);
|
|
4680
|
-
|
|
4681
|
-
const p = /* @__PURE__ */ new Set(), C = x.map((
|
|
4682
|
-
|
|
4683
|
-
const
|
|
4684
|
-
|
|
4694
|
+
R(y);
|
|
4695
|
+
const p = /* @__PURE__ */ new Set(), C = x.map((J) => ({ value: J.abbreviation3 || J.abbreviation, label: J.name })).filter((J) => !J.value || p.has(J.value) ? !1 : (p.add(J.value), !0));
|
|
4696
|
+
A(C);
|
|
4697
|
+
const $ = /* @__PURE__ */ new Set(), H = d.filter((J) => J.countryCode).map((J) => ({ value: J.countryCode, label: `${J.countryCode} – ${J.name}` })).filter((J) => $.has(J.value) ? !1 : ($.add(J.value), !0));
|
|
4698
|
+
K(H);
|
|
4685
4699
|
const g = y.applicantRequestData;
|
|
4686
|
-
if (
|
|
4700
|
+
if (W({
|
|
4687
4701
|
firstName: (g == null ? void 0 : g.firstName) || "",
|
|
4688
4702
|
lastName: (g == null ? void 0 : g.lastName) || "",
|
|
4689
4703
|
email: (g == null ? void 0 : g.email) || "",
|
|
@@ -4713,28 +4727,28 @@ Failed to reload test data. Please refresh the page.`);
|
|
|
4713
4727
|
country: (g == null ? void 0 : g.country) || "",
|
|
4714
4728
|
nationality: (g == null ? void 0 : g.nationality) || "",
|
|
4715
4729
|
phonenumber: (g == null ? void 0 : g.phonenumber) || ""
|
|
4716
|
-
}), y.kycRecords && y.kycRecords.length > 0 && y.kycRecords[0].providerTokenObject !== null && !
|
|
4717
|
-
console.log("[Identity] Review page disabled + existing identity — auto-requesting..."),
|
|
4730
|
+
}), y.kycRecords && y.kycRecords.length > 0 && y.kycRecords[0].providerTokenObject !== null && !D.current && le.current) {
|
|
4731
|
+
console.log("[Identity] Review page disabled + existing identity — auto-requesting..."), D.current = !0;
|
|
4718
4732
|
try {
|
|
4719
4733
|
await f(), U(!0);
|
|
4720
|
-
} catch (
|
|
4721
|
-
console.error("[Identity] Auto-request failed:",
|
|
4734
|
+
} catch (J) {
|
|
4735
|
+
console.error("[Identity] Auto-request failed:", J);
|
|
4722
4736
|
}
|
|
4723
4737
|
}
|
|
4724
4738
|
} catch (y) {
|
|
4725
4739
|
console.error("Error loading applicant data:", y);
|
|
4726
4740
|
} finally {
|
|
4727
|
-
|
|
4741
|
+
B(!1);
|
|
4728
4742
|
}
|
|
4729
4743
|
})();
|
|
4730
4744
|
}, [e]), ie(() => {
|
|
4731
|
-
u && !S &&
|
|
4745
|
+
u && !S && le.current && (console.log("[Identity] Review page disabled — showing cached provider"), U(!0));
|
|
4732
4746
|
}, [u, S]), ie(() => {
|
|
4733
4747
|
if (m) {
|
|
4734
4748
|
if (m.expiresAt) {
|
|
4735
4749
|
const i = new Date(m.expiresAt).getTime();
|
|
4736
4750
|
if (Date.now() >= i) {
|
|
4737
|
-
console.warn("[Identity] Token has expired (expiresAt)"),
|
|
4751
|
+
console.warn("[Identity] Token has expired (expiresAt)"), L(!0), M("Your verification session has expired. Please restart.");
|
|
4738
4752
|
return;
|
|
4739
4753
|
}
|
|
4740
4754
|
}
|
|
@@ -4742,19 +4756,19 @@ Failed to reload test data. Please refresh the page.`);
|
|
|
4742
4756
|
try {
|
|
4743
4757
|
const y = new URL(m.url).toString().toLowerCase();
|
|
4744
4758
|
if (y.includes("expired") || y.includes("invalid") || y.includes("error")) {
|
|
4745
|
-
console.warn("[Identity] Token URL indicates expiration"),
|
|
4759
|
+
console.warn("[Identity] Token URL indicates expiration"), L(!0), M("Your verification link has expired. Please restart.");
|
|
4746
4760
|
return;
|
|
4747
4761
|
}
|
|
4748
4762
|
} catch {
|
|
4749
4763
|
console.error("[Identity] Invalid token URL");
|
|
4750
4764
|
}
|
|
4751
4765
|
if (m.status === "expired" || m.error === "expired" || m.expired === !0) {
|
|
4752
|
-
console.warn("[Identity] Token object indicates expiration"),
|
|
4766
|
+
console.warn("[Identity] Token object indicates expiration"), L(!0), M("Your verification session has expired. Please restart.");
|
|
4753
4767
|
return;
|
|
4754
4768
|
}
|
|
4755
4769
|
}
|
|
4756
4770
|
}, [m]), ie(() => {
|
|
4757
|
-
if (h !== null && m && !b && S && !
|
|
4771
|
+
if (h !== null && m && !b && S && !z) {
|
|
4758
4772
|
const i = h;
|
|
4759
4773
|
if (m.url) {
|
|
4760
4774
|
console.log("[Identity] Loading provider URL for user verification:", m.url), M(null);
|
|
@@ -4762,8 +4776,8 @@ Failed to reload test data. Please refresh the page.`);
|
|
|
4762
4776
|
if (new URL(m.url), i === we.SardinAI) {
|
|
4763
4777
|
console.log("[SardinAI] Initializing Risk SDK in background...");
|
|
4764
4778
|
try {
|
|
4765
|
-
const y =
|
|
4766
|
-
|
|
4779
|
+
const y = $e.parseProviderConfig(h, m, l);
|
|
4780
|
+
$e.createProvider(h, y).initialize().then(() => {
|
|
4767
4781
|
console.log("[SardinAI] Risk SDK initialized successfully in background");
|
|
4768
4782
|
}).catch((d) => {
|
|
4769
4783
|
console.warn("[SardinAI] Risk SDK initialization failed (non-blocking):", d);
|
|
@@ -4772,25 +4786,25 @@ Failed to reload test data. Please refresh the page.`);
|
|
|
4772
4786
|
console.warn("[SardinAI] Risk SDK setup failed (non-blocking):", y);
|
|
4773
4787
|
}
|
|
4774
4788
|
}
|
|
4775
|
-
|
|
4789
|
+
P({ type: "url", url: m.url });
|
|
4776
4790
|
} catch (y) {
|
|
4777
|
-
console.error("[Identity] Invalid URL:", y), M("Invalid verification URL. Please restart."),
|
|
4791
|
+
console.error("[Identity] Invalid URL:", y), M("Invalid verification URL. Please restart."), L(!0);
|
|
4778
4792
|
}
|
|
4779
4793
|
return;
|
|
4780
4794
|
}
|
|
4781
4795
|
if (i === we.SardinAI) {
|
|
4782
4796
|
console.log("[SardinAI] No URL provided - initializing Risk SDK only..."), M(null);
|
|
4783
4797
|
try {
|
|
4784
|
-
const y =
|
|
4798
|
+
const y = $e.parseProviderConfig(h, m, l), x = $e.createProvider(h, y);
|
|
4785
4799
|
x.initialize().then(() => {
|
|
4786
|
-
console.log("[SardinAI] Risk SDK initialized successfully"),
|
|
4800
|
+
console.log("[SardinAI] Risk SDK initialized successfully"), P(x), setTimeout(() => {
|
|
4787
4801
|
t == null || t();
|
|
4788
4802
|
}, 2e3);
|
|
4789
4803
|
}).catch((d) => {
|
|
4790
4804
|
var C;
|
|
4791
4805
|
console.error("[SardinAI] Failed to initialize:", d);
|
|
4792
4806
|
const p = ((C = d.message) == null ? void 0 : C.toLowerCase()) || "";
|
|
4793
|
-
p.includes("expired") || p.includes("invalid") || p.includes("401") || p.includes("400") ? (
|
|
4807
|
+
p.includes("expired") || p.includes("invalid") || p.includes("401") || p.includes("400") ? (L(!0), M("Session expired or invalid. Please restart verification.")) : M(`Failed to initialize: ${d.message}`);
|
|
4794
4808
|
});
|
|
4795
4809
|
} catch (y) {
|
|
4796
4810
|
console.error("[SardinAI] Error creating provider:", y), M(`Configuration error: ${y.message}`);
|
|
@@ -4799,15 +4813,15 @@ Failed to reload test data. Please refresh the page.`);
|
|
|
4799
4813
|
}
|
|
4800
4814
|
try {
|
|
4801
4815
|
M(null);
|
|
4802
|
-
const y =
|
|
4816
|
+
const y = $e.parseProviderConfig(h, m, l), x = $e.createProvider(h, y);
|
|
4803
4817
|
i === we.Sumsub ? (x.initialize("identity-container").catch((d) => {
|
|
4804
4818
|
var p;
|
|
4805
|
-
console.error("[Sumsub] Initialization error:", d), M(`Failed to initialize: ${d.message}`), (p = d.message) != null && p.toLowerCase().includes("expired") &&
|
|
4819
|
+
console.error("[Sumsub] Initialization error:", d), M(`Failed to initialize: ${d.message}`), (p = d.message) != null && p.toLowerCase().includes("expired") && L(!0);
|
|
4806
4820
|
}), x.onComplete && x.onComplete(() => {
|
|
4807
4821
|
t == null || t();
|
|
4808
4822
|
})) : i === we.Onfido && x.initialize("identity-container").catch((d) => {
|
|
4809
4823
|
console.error("[Onfido] Initialization error:", d), M(`Failed to initialize: ${d.message}`);
|
|
4810
|
-
}),
|
|
4824
|
+
}), P(x);
|
|
4811
4825
|
} catch (y) {
|
|
4812
4826
|
console.error("[Identity] Provider setup error:", y), M(`Setup error: ${y.message}`);
|
|
4813
4827
|
}
|
|
@@ -4820,34 +4834,34 @@ Failed to reload test data. Please refresh the page.`);
|
|
|
4820
4834
|
console.error("[Identity] Error destroying provider:", i);
|
|
4821
4835
|
}
|
|
4822
4836
|
};
|
|
4823
|
-
}, [h, m, b, S, t,
|
|
4824
|
-
const
|
|
4837
|
+
}, [h, m, b, S, t, z]);
|
|
4838
|
+
const I = async () => {
|
|
4825
4839
|
try {
|
|
4826
|
-
M(null),
|
|
4840
|
+
M(null), L(!1), await f(), U(!0);
|
|
4827
4841
|
} catch (i) {
|
|
4828
4842
|
console.error("Error starting identity verification:", i);
|
|
4829
4843
|
}
|
|
4830
|
-
},
|
|
4844
|
+
}, X = async () => {
|
|
4831
4845
|
try {
|
|
4832
|
-
M(null),
|
|
4846
|
+
M(null), L(!1), P(null), console.log("[Identity] Restarting verification..."), await N(), U(!0);
|
|
4833
4847
|
} catch (i) {
|
|
4834
4848
|
console.error("Error restarting identity verification:", i), M(i.message || "Failed to restart verification");
|
|
4835
4849
|
}
|
|
4836
4850
|
};
|
|
4837
4851
|
if (re || v)
|
|
4838
|
-
return /* @__PURE__ */ r(
|
|
4852
|
+
return /* @__PURE__ */ r(Y, { children: /* @__PURE__ */ o(V, { children: [
|
|
4839
4853
|
/* @__PURE__ */ r(Se, { className: "my-8" }),
|
|
4840
4854
|
/* @__PURE__ */ r("p", { className: "text-center text-gray-600 dark:text-gray-400 mt-4", children: "Loading identity verification..." })
|
|
4841
4855
|
] }) });
|
|
4842
4856
|
if (w)
|
|
4843
|
-
return /* @__PURE__ */ r(
|
|
4857
|
+
return /* @__PURE__ */ r(Y, { children: /* @__PURE__ */ r(V, { children: /* @__PURE__ */ o("p", { className: "text-danger-500", children: [
|
|
4844
4858
|
"Error: ",
|
|
4845
4859
|
w.message
|
|
4846
4860
|
] }) }) });
|
|
4847
|
-
if (S && (
|
|
4848
|
-
return /* @__PURE__ */ o(
|
|
4861
|
+
if (S && (j || z))
|
|
4862
|
+
return /* @__PURE__ */ o(Y, { children: [
|
|
4849
4863
|
/* @__PURE__ */ r(ye, { children: /* @__PURE__ */ r("h2", { className: "text-2xl font-bold text-gray-900 dark:text-white", children: "Verification Session Issue" }) }),
|
|
4850
|
-
/* @__PURE__ */ o(
|
|
4864
|
+
/* @__PURE__ */ o(V, { children: [
|
|
4851
4865
|
/* @__PURE__ */ r("div", { className: "p-4 bg-red-50 dark:bg-red-900/20 border border-red-200 dark:border-red-800 rounded-lg mb-6", children: /* @__PURE__ */ o("div", { className: "flex items-start", children: [
|
|
4852
4866
|
/* @__PURE__ */ r(
|
|
4853
4867
|
"svg",
|
|
@@ -4868,8 +4882,8 @@ Failed to reload test data. Please refresh the page.`);
|
|
|
4868
4882
|
}
|
|
4869
4883
|
),
|
|
4870
4884
|
/* @__PURE__ */ o("div", { children: [
|
|
4871
|
-
/* @__PURE__ */ r("h3", { className: "font-semibold text-red-900 dark:text-red-100 mb-1", children:
|
|
4872
|
-
/* @__PURE__ */ r("p", { className: "text-red-800 dark:text-red-200 text-sm", children:
|
|
4885
|
+
/* @__PURE__ */ r("h3", { className: "font-semibold text-red-900 dark:text-red-100 mb-1", children: z ? "Session Expired" : "Verification Error" }),
|
|
4886
|
+
/* @__PURE__ */ r("p", { className: "text-red-800 dark:text-red-200 text-sm", children: j || "Your verification session has expired and needs to be restarted." })
|
|
4873
4887
|
] })
|
|
4874
4888
|
] }) }),
|
|
4875
4889
|
/* @__PURE__ */ o("div", { className: "bg-blue-50 dark:bg-blue-900/20 border border-blue-200 dark:border-blue-800 rounded-lg p-4", children: [
|
|
@@ -4882,31 +4896,31 @@ Failed to reload test data. Please refresh the page.`);
|
|
|
4882
4896
|
] })
|
|
4883
4897
|
] }),
|
|
4884
4898
|
/* @__PURE__ */ o(ge, { className: "flex justify-between", children: [
|
|
4885
|
-
n && /* @__PURE__ */ r(
|
|
4886
|
-
/* @__PURE__ */ r(
|
|
4899
|
+
n && /* @__PURE__ */ r(Z, { type: "button", variant: "outline", onClick: n, children: "Back" }),
|
|
4900
|
+
/* @__PURE__ */ r(Z, { type: "button", onClick: X, disabled: v, children: v ? "Restarting..." : "Restart Verification" })
|
|
4887
4901
|
] })
|
|
4888
4902
|
] });
|
|
4889
4903
|
if (S && u) {
|
|
4890
4904
|
const i = h;
|
|
4891
|
-
return m != null && m.url ? /* @__PURE__ */ o(
|
|
4905
|
+
return m != null && m.url ? /* @__PURE__ */ o(Y, { children: [
|
|
4892
4906
|
/* @__PURE__ */ r(ye, { children: /* @__PURE__ */ o("div", { className: "flex items-center justify-between", children: [
|
|
4893
4907
|
/* @__PURE__ */ o("div", { children: [
|
|
4894
4908
|
/* @__PURE__ */ r("h2", { className: "text-2xl font-bold", children: "Identity Verification" }),
|
|
4895
4909
|
/* @__PURE__ */ r("p", { className: "text-gray-600 dark:text-gray-400 mt-1", children: "Please complete the identity verification process" })
|
|
4896
4910
|
] }),
|
|
4897
4911
|
/* @__PURE__ */ r(
|
|
4898
|
-
|
|
4912
|
+
Z,
|
|
4899
4913
|
{
|
|
4900
4914
|
type: "button",
|
|
4901
4915
|
variant: "outline",
|
|
4902
4916
|
size: "sm",
|
|
4903
|
-
onClick:
|
|
4917
|
+
onClick: X,
|
|
4904
4918
|
disabled: v,
|
|
4905
4919
|
children: "Restart"
|
|
4906
4920
|
}
|
|
4907
4921
|
)
|
|
4908
4922
|
] }) }),
|
|
4909
|
-
/* @__PURE__ */ o(
|
|
4923
|
+
/* @__PURE__ */ o(V, { children: [
|
|
4910
4924
|
/* @__PURE__ */ r("div", { className: "mb-4 p-3 bg-yellow-50 dark:bg-yellow-900/20 border border-yellow-200 dark:border-yellow-800 rounded-lg", children: /* @__PURE__ */ o("p", { className: "text-yellow-800 dark:text-yellow-200 text-sm", children: [
|
|
4911
4925
|
/* @__PURE__ */ r("strong", { children: "Important:" }),
|
|
4912
4926
|
' If you see an "expired" or "invalid link" message below, click the "Restart" button above to generate a new verification session.'
|
|
@@ -4922,10 +4936,10 @@ Failed to reload test data. Please refresh the page.`);
|
|
|
4922
4936
|
var x, d, p;
|
|
4923
4937
|
console.log("[Identity] Iframe loaded");
|
|
4924
4938
|
try {
|
|
4925
|
-
const C = y.target,
|
|
4926
|
-
if (
|
|
4927
|
-
const
|
|
4928
|
-
(
|
|
4939
|
+
const C = y.target, $ = C.contentDocument || ((x = C.contentWindow) == null ? void 0 : x.document);
|
|
4940
|
+
if ($) {
|
|
4941
|
+
const H = ((p = (d = $.body) == null ? void 0 : d.textContent) == null ? void 0 : p.toLowerCase()) || "";
|
|
4942
|
+
(H.includes("expired") || H.includes("invalid") || H.includes("error")) && (console.warn("[Identity] Iframe shows expiration message"), L(!0), M("Your verification link has expired."));
|
|
4929
4943
|
}
|
|
4930
4944
|
} catch {
|
|
4931
4945
|
console.log("[Identity] Cannot check iframe content (CORS)");
|
|
@@ -4934,36 +4948,36 @@ Failed to reload test data. Please refresh the page.`);
|
|
|
4934
4948
|
}
|
|
4935
4949
|
) })
|
|
4936
4950
|
] }),
|
|
4937
|
-
n && /* @__PURE__ */ r(ge, { children: /* @__PURE__ */ r(
|
|
4938
|
-
] }) : i === we.SardinAI ? /* @__PURE__ */ o(
|
|
4951
|
+
n && /* @__PURE__ */ r(ge, { children: /* @__PURE__ */ r(Z, { variant: "outline", onClick: n, children: "Back" }) })
|
|
4952
|
+
] }) : i === we.SardinAI ? /* @__PURE__ */ o(Y, { children: [
|
|
4939
4953
|
/* @__PURE__ */ o(ye, { children: [
|
|
4940
4954
|
/* @__PURE__ */ r("h2", { className: "text-2xl font-bold", children: "Device Risk Assessment" }),
|
|
4941
4955
|
/* @__PURE__ */ r("p", { className: "text-gray-600 dark:text-gray-400 mt-1", children: "Analyzing device security and behavioral patterns..." })
|
|
4942
4956
|
] }),
|
|
4943
|
-
/* @__PURE__ */ r(
|
|
4957
|
+
/* @__PURE__ */ r(V, { children: /* @__PURE__ */ o("div", { className: "text-center py-12", children: [
|
|
4944
4958
|
/* @__PURE__ */ r(Se, { className: "mb-4" }),
|
|
4945
4959
|
/* @__PURE__ */ r("p", { className: "text-gray-600 dark:text-gray-400", children: "Please wait while we verify your device security" }),
|
|
4946
4960
|
/* @__PURE__ */ r("p", { className: "text-sm text-gray-500 dark:text-gray-500 mt-2", children: "This process is automatic and will complete in a few seconds" })
|
|
4947
4961
|
] }) })
|
|
4948
|
-
] }) : /* @__PURE__ */ o(
|
|
4962
|
+
] }) : /* @__PURE__ */ o(Y, { children: [
|
|
4949
4963
|
/* @__PURE__ */ o(ye, { children: [
|
|
4950
4964
|
/* @__PURE__ */ r("h2", { className: "text-2xl font-bold", children: "Identity Verification" }),
|
|
4951
4965
|
/* @__PURE__ */ r("p", { className: "text-gray-600 dark:text-gray-400 mt-1", children: "Please complete the identity verification process" })
|
|
4952
4966
|
] }),
|
|
4953
|
-
/* @__PURE__ */ r(
|
|
4954
|
-
n && /* @__PURE__ */ r(ge, { children: /* @__PURE__ */ r(
|
|
4967
|
+
/* @__PURE__ */ r(V, { children: /* @__PURE__ */ r("div", { id: "identity-container", className: "min-h-[400px]" }) }),
|
|
4968
|
+
n && /* @__PURE__ */ r(ge, { children: /* @__PURE__ */ r(Z, { variant: "outline", onClick: n, children: "Back" }) })
|
|
4955
4969
|
] });
|
|
4956
4970
|
}
|
|
4957
|
-
const
|
|
4971
|
+
const oe = /* @__PURE__ */ new Set(["country", "nationality", "taxCountry", "countryOfBirth", "mobileCountryCode", "otherNationality"]), ce = (i = 4) => ({ 1: "col-span-1", 2: "col-span-2", 3: "col-span-3", 4: "col-span-4" })[i] || "col-span-4", Ce = (i, y) => {
|
|
4958
4972
|
if (!y && y !== 0) return "—";
|
|
4959
|
-
if (
|
|
4973
|
+
if (oe.has(i) && i !== "mobileCountryCode") {
|
|
4960
4974
|
const x = O.find((d) => d.value === y);
|
|
4961
4975
|
return x ? x.label : String(y);
|
|
4962
4976
|
}
|
|
4963
4977
|
return String(y);
|
|
4964
4978
|
}, Xe = ({ helpText: i }) => {
|
|
4965
4979
|
const [y, x] = k(!1), d = te(null), [, p] = k({ top: 0, left: 0 });
|
|
4966
|
-
return /* @__PURE__ */ o(
|
|
4980
|
+
return /* @__PURE__ */ o(qe, { children: [
|
|
4967
4981
|
/* @__PURE__ */ r(
|
|
4968
4982
|
"button",
|
|
4969
4983
|
{
|
|
@@ -4972,8 +4986,8 @@ Failed to reload test data. Please refresh the page.`);
|
|
|
4972
4986
|
ref: d,
|
|
4973
4987
|
onClick: () => {
|
|
4974
4988
|
if (d.current) {
|
|
4975
|
-
const
|
|
4976
|
-
p({ top:
|
|
4989
|
+
const $ = d.current.getBoundingClientRect();
|
|
4990
|
+
p({ top: $.bottom + window.scrollY + 6, left: $.left + window.scrollX });
|
|
4977
4991
|
}
|
|
4978
4992
|
x(!0);
|
|
4979
4993
|
},
|
|
@@ -5015,7 +5029,7 @@ Failed to reload test data. Please refresh the page.`);
|
|
|
5015
5029
|
children: /* @__PURE__ */ o(
|
|
5016
5030
|
"div",
|
|
5017
5031
|
{
|
|
5018
|
-
onClick: (
|
|
5032
|
+
onClick: ($) => $.stopPropagation(),
|
|
5019
5033
|
style: {
|
|
5020
5034
|
background: "var(--metakyc-surface, #fff)",
|
|
5021
5035
|
border: "1px solid var(--metakyc-border, #e5e7eb)",
|
|
@@ -5057,11 +5071,11 @@ Failed to reload test data. Please refresh the page.`);
|
|
|
5057
5071
|
/* @__PURE__ */ r("div", { style: { flex: 1, minWidth: 0 }, children: i }),
|
|
5058
5072
|
/* @__PURE__ */ r("div", { style: { paddingTop: 24 }, children: /* @__PURE__ */ r(Xe, { helpText: y }) })
|
|
5059
5073
|
] }) : i, et = (i, y) => {
|
|
5060
|
-
const x = `cf-${y}`, d = i.paramName ?? "", p =
|
|
5074
|
+
const x = `cf-${y}`, d = i.paramName ?? "", p = de[d];
|
|
5061
5075
|
if (i.customType === "br")
|
|
5062
|
-
return /* @__PURE__ */ r("div", { className:
|
|
5076
|
+
return /* @__PURE__ */ r("div", { className: ce(i.colSpan), style: { minHeight: "0.5rem" } }, x);
|
|
5063
5077
|
if (i.customType === "paragraph")
|
|
5064
|
-
return /* @__PURE__ */ r("div", { className:
|
|
5078
|
+
return /* @__PURE__ */ r("div", { className: ce(i.colSpan), children: /* @__PURE__ */ r(
|
|
5065
5079
|
"div",
|
|
5066
5080
|
{
|
|
5067
5081
|
className: "text-sm",
|
|
@@ -5073,13 +5087,13 @@ Failed to reload test data. Please refresh the page.`);
|
|
|
5073
5087
|
return /* @__PURE__ */ r(
|
|
5074
5088
|
"div",
|
|
5075
5089
|
{
|
|
5076
|
-
className:
|
|
5090
|
+
className: ce(i.colSpan),
|
|
5077
5091
|
dangerouslySetInnerHTML: { __html: i.label || "" }
|
|
5078
5092
|
},
|
|
5079
5093
|
x
|
|
5080
5094
|
);
|
|
5081
5095
|
if (i.customType === "link")
|
|
5082
|
-
return /* @__PURE__ */ r("div", { className:
|
|
5096
|
+
return /* @__PURE__ */ r("div", { className: ce(i.colSpan), children: ke(
|
|
5083
5097
|
/* @__PURE__ */ r(
|
|
5084
5098
|
"a",
|
|
5085
5099
|
{
|
|
@@ -5095,14 +5109,14 @@ Failed to reload test data. Please refresh the page.`);
|
|
|
5095
5109
|
) }, x);
|
|
5096
5110
|
if (i.customType === "checkbox" || i.customType === "link_checkbox") {
|
|
5097
5111
|
const C = p === "true" || p === !0;
|
|
5098
|
-
return /* @__PURE__ */ r("div", { className:
|
|
5112
|
+
return /* @__PURE__ */ r("div", { className: ce(i.colSpan), children: ke(
|
|
5099
5113
|
/* @__PURE__ */ o("label", { style: { display: "flex", alignItems: "flex-start", gap: 8, cursor: "pointer" }, children: [
|
|
5100
5114
|
/* @__PURE__ */ r(
|
|
5101
5115
|
"input",
|
|
5102
5116
|
{
|
|
5103
5117
|
type: "checkbox",
|
|
5104
5118
|
checked: !!C,
|
|
5105
|
-
onChange: (
|
|
5119
|
+
onChange: ($) => E((H) => ({ ...H, [d]: String($.target.checked) })),
|
|
5106
5120
|
style: {
|
|
5107
5121
|
width: 16,
|
|
5108
5122
|
height: 16,
|
|
@@ -5112,7 +5126,7 @@ Failed to reload test data. Please refresh the page.`);
|
|
|
5112
5126
|
}
|
|
5113
5127
|
}
|
|
5114
5128
|
),
|
|
5115
|
-
/* @__PURE__ */ r("span", { className: "text-sm", style: { color: "var(--metakyc-text-primary, #111827)" }, children: i.customType === "link_checkbox" && i.linkUrl ? /* @__PURE__ */ o(
|
|
5129
|
+
/* @__PURE__ */ r("span", { className: "text-sm", style: { color: "var(--metakyc-text-primary, #111827)" }, children: i.customType === "link_checkbox" && i.linkUrl ? /* @__PURE__ */ o(qe, { children: [
|
|
5116
5130
|
/* @__PURE__ */ r("a", { href: i.linkUrl, target: "_blank", rel: "noopener noreferrer", style: { color: "var(--metakyc-primary, #6366f1)", textDecoration: "underline" }, children: i.linkText || i.label }),
|
|
5117
5131
|
i.label && i.linkText ? ` ${i.label}` : ""
|
|
5118
5132
|
] }) : i.displayText || i.label })
|
|
@@ -5121,32 +5135,32 @@ Failed to reload test data. Please refresh the page.`);
|
|
|
5121
5135
|
) }, x);
|
|
5122
5136
|
}
|
|
5123
5137
|
if (i.customType === "group_checkbox") {
|
|
5124
|
-
const C = Array.isArray(p) ? p : p ? [p] : [],
|
|
5125
|
-
i.singleSelect ?
|
|
5138
|
+
const C = Array.isArray(p) ? p : p ? [p] : [], $ = (H) => {
|
|
5139
|
+
i.singleSelect ? E((g) => ({ ...g, [d]: C[0] === H ? [] : [H] })) : E((g) => ({
|
|
5126
5140
|
...g,
|
|
5127
|
-
[d]: C.includes(
|
|
5141
|
+
[d]: C.includes(H) ? C.filter((se) => se !== H) : [...C, H]
|
|
5128
5142
|
}));
|
|
5129
5143
|
};
|
|
5130
|
-
return /* @__PURE__ */ r("div", { className:
|
|
5144
|
+
return /* @__PURE__ */ r("div", { className: ce(i.colSpan), children: ke(
|
|
5131
5145
|
/* @__PURE__ */ o("div", { className: "space-y-1.5", children: [
|
|
5132
5146
|
i.label && /* @__PURE__ */ r("p", { className: "text-sm font-medium", style: { color: "var(--metakyc-text-primary, #111827)" }, children: i.displayText || i.label }),
|
|
5133
|
-
(i.options || []).map((
|
|
5147
|
+
(i.options || []).map((H) => /* @__PURE__ */ o("label", { style: { display: "flex", alignItems: "flex-start", gap: 8, cursor: "pointer" }, children: [
|
|
5134
5148
|
/* @__PURE__ */ r(
|
|
5135
5149
|
"input",
|
|
5136
5150
|
{
|
|
5137
5151
|
type: "checkbox",
|
|
5138
|
-
checked: C.includes(
|
|
5139
|
-
onChange: () =>
|
|
5152
|
+
checked: C.includes(H.value),
|
|
5153
|
+
onChange: () => $(H.value),
|
|
5140
5154
|
style: { width: 16, height: 16, flexShrink: 0, marginTop: 2, accentColor: "var(--metakyc-primary, #6366f1)" }
|
|
5141
5155
|
}
|
|
5142
5156
|
),
|
|
5143
|
-
/* @__PURE__ */ r("span", { className: "text-sm", style: { color: "var(--metakyc-text-primary, #111827)" }, children:
|
|
5144
|
-
] },
|
|
5157
|
+
/* @__PURE__ */ r("span", { className: "text-sm", style: { color: "var(--metakyc-text-primary, #111827)" }, children: H.label })
|
|
5158
|
+
] }, H.value))
|
|
5145
5159
|
] }),
|
|
5146
5160
|
i.helpText
|
|
5147
5161
|
) }, x);
|
|
5148
5162
|
}
|
|
5149
|
-
return i.customType === "radio_group" ? /* @__PURE__ */ r("div", { className:
|
|
5163
|
+
return i.customType === "radio_group" ? /* @__PURE__ */ r("div", { className: ce(i.colSpan), children: ke(
|
|
5150
5164
|
/* @__PURE__ */ o("div", { className: "space-y-1.5", children: [
|
|
5151
5165
|
i.label && /* @__PURE__ */ r("p", { className: "text-sm font-medium", style: { color: "var(--metakyc-text-primary, #111827)" }, children: i.displayText || i.label }),
|
|
5152
5166
|
(i.options || []).map((C) => /* @__PURE__ */ o("label", { style: { display: "flex", alignItems: "flex-start", gap: 8, cursor: "pointer" }, children: [
|
|
@@ -5157,7 +5171,7 @@ Failed to reload test data. Please refresh the page.`);
|
|
|
5157
5171
|
name: `rg-${d}`,
|
|
5158
5172
|
value: C.value,
|
|
5159
5173
|
checked: p === C.value,
|
|
5160
|
-
onChange: () =>
|
|
5174
|
+
onChange: () => E(($) => ({ ...$, [d]: C.value })),
|
|
5161
5175
|
style: { width: 16, height: 16, flexShrink: 0, marginTop: 2, accentColor: "var(--metakyc-primary, #6366f1)" }
|
|
5162
5176
|
}
|
|
5163
5177
|
),
|
|
@@ -5165,87 +5179,87 @@ Failed to reload test data. Please refresh the page.`);
|
|
|
5165
5179
|
] }, C.value))
|
|
5166
5180
|
] }),
|
|
5167
5181
|
i.helpText
|
|
5168
|
-
) }, x) : /* @__PURE__ */ r("div", { className:
|
|
5182
|
+
) }, x) : /* @__PURE__ */ r("div", { className: ce(i.colSpan), children: ke(
|
|
5169
5183
|
/* @__PURE__ */ r(
|
|
5170
5184
|
he,
|
|
5171
5185
|
{
|
|
5172
5186
|
label: i.displayText || i.label || d,
|
|
5173
5187
|
value: String(p ?? ""),
|
|
5174
|
-
onChange: (C) =>
|
|
5188
|
+
onChange: (C) => E(($) => ({ ...$, [d]: C.target.value }))
|
|
5175
5189
|
}
|
|
5176
5190
|
),
|
|
5177
5191
|
i.helpText
|
|
5178
5192
|
) }, x);
|
|
5179
5193
|
}, tt = (i, y) => {
|
|
5180
5194
|
if (i.isCustom) return et(i, y);
|
|
5181
|
-
const x = i.name ?? "", d = Oe[x], p = i.displayText || (d == null ? void 0 : d.label) || x, C =
|
|
5182
|
-
return i.editable ?
|
|
5195
|
+
const x = i.name ?? "", d = Oe[x], p = i.displayText || (d == null ? void 0 : d.label) || x, C = q[x] ?? "", $ = x === "mobileCountryCode", H = !!(d != null && d.countriesType) && !$;
|
|
5196
|
+
return i.editable ? $ ? /* @__PURE__ */ r("div", { className: ce(i.colSpan ?? 2), children: ke(
|
|
5183
5197
|
/* @__PURE__ */ r(
|
|
5184
|
-
|
|
5198
|
+
Te,
|
|
5185
5199
|
{
|
|
5186
5200
|
label: p,
|
|
5187
5201
|
value: String(C),
|
|
5188
|
-
onChange: (g) =>
|
|
5189
|
-
options: [{ value: "", label: "Select country code…" }, ...
|
|
5202
|
+
onChange: (g) => W((se) => ({ ...se, [x]: g })),
|
|
5203
|
+
options: [{ value: "", label: "Select country code…" }, ...F]
|
|
5190
5204
|
}
|
|
5191
5205
|
),
|
|
5192
5206
|
i.helpText
|
|
5193
|
-
) }, `epc-${y}`) :
|
|
5207
|
+
) }, `epc-${y}`) : H ? /* @__PURE__ */ r("div", { className: ce(i.colSpan ?? 2), children: ke(
|
|
5194
5208
|
/* @__PURE__ */ r(
|
|
5195
|
-
|
|
5209
|
+
Te,
|
|
5196
5210
|
{
|
|
5197
5211
|
label: p,
|
|
5198
5212
|
value: String(C),
|
|
5199
|
-
onChange: (g) =>
|
|
5213
|
+
onChange: (g) => W((se) => ({ ...se, [x]: g })),
|
|
5200
5214
|
options: [{ value: "", label: `Select ${p.toLowerCase()}…` }, ...O]
|
|
5201
5215
|
}
|
|
5202
5216
|
),
|
|
5203
5217
|
i.helpText
|
|
5204
|
-
) }, `ec-${y}`) : /* @__PURE__ */ r("div", { className:
|
|
5218
|
+
) }, `ec-${y}`) : /* @__PURE__ */ r("div", { className: ce(i.colSpan ?? 2), children: ke(
|
|
5205
5219
|
/* @__PURE__ */ r(
|
|
5206
5220
|
he,
|
|
5207
5221
|
{
|
|
5208
5222
|
label: p,
|
|
5209
5223
|
type: (d == null ? void 0 : d.type) === "date" ? "date" : (d == null ? void 0 : d.type) === "email" ? "email" : "text",
|
|
5210
5224
|
value: String(C),
|
|
5211
|
-
onChange: (g) =>
|
|
5225
|
+
onChange: (g) => W((se) => ({ ...se, [x]: g.target.value }))
|
|
5212
5226
|
}
|
|
5213
5227
|
),
|
|
5214
5228
|
i.helpText
|
|
5215
|
-
) }, `ei-${y}`) : /* @__PURE__ */ r("div", { className:
|
|
5216
|
-
/* @__PURE__ */ o(
|
|
5229
|
+
) }, `ei-${y}`) : /* @__PURE__ */ r("div", { className: ce(i.colSpan ?? 2), children: ke(
|
|
5230
|
+
/* @__PURE__ */ o(qe, { children: [
|
|
5217
5231
|
/* @__PURE__ */ r("label", { className: "block text-sm font-medium mb-0.5", style: { color: "var(--metakyc-text-secondary, #6b7280)" }, children: p }),
|
|
5218
5232
|
/* @__PURE__ */ r("p", { className: "text-sm", style: { color: "var(--metakyc-text-primary, #111827)", minHeight: "1.5rem" }, children: Ce(x, C) })
|
|
5219
5233
|
] }),
|
|
5220
5234
|
i.helpText
|
|
5221
5235
|
) }, `ro-${y}`);
|
|
5222
5236
|
};
|
|
5223
|
-
if (
|
|
5224
|
-
const i =
|
|
5237
|
+
if (_) {
|
|
5238
|
+
const i = _.title || "Review Your Information", y = _.subtitle || "Please review and confirm your information before starting identity verification";
|
|
5225
5239
|
return /* @__PURE__ */ r("form", { onSubmit: (x) => {
|
|
5226
|
-
x.preventDefault(),
|
|
5227
|
-
}, children: /* @__PURE__ */ o(
|
|
5240
|
+
x.preventDefault(), I();
|
|
5241
|
+
}, children: /* @__PURE__ */ o(Y, { children: [
|
|
5228
5242
|
/* @__PURE__ */ o(ye, { children: [
|
|
5229
5243
|
/* @__PURE__ */ r("h2", { className: "text-lg font-bold", style: { color: "var(--metakyc-text-primary, #111827)" }, children: i }),
|
|
5230
5244
|
/* @__PURE__ */ r("p", { className: "mt-1 text-sm", style: { color: "var(--metakyc-text-secondary, #6b7280)" }, children: y })
|
|
5231
5245
|
] }),
|
|
5232
|
-
/* @__PURE__ */ r(
|
|
5246
|
+
/* @__PURE__ */ r(V, { children: /* @__PURE__ */ r("div", { className: "grid grid-cols-4 gap-4", children: _.fields.map((x, d) => tt(x, d)) }) }),
|
|
5233
5247
|
/* @__PURE__ */ o(ge, { className: "flex justify-between", children: [
|
|
5234
|
-
n && /* @__PURE__ */ r(
|
|
5235
|
-
/* @__PURE__ */ r(
|
|
5248
|
+
n && /* @__PURE__ */ r(Z, { type: "button", variant: "outline", onClick: n, children: "Back" }),
|
|
5249
|
+
/* @__PURE__ */ r(Z, { type: "submit", isLoading: v, children: "Confirm and Start Verification" })
|
|
5236
5250
|
] })
|
|
5237
5251
|
] }) });
|
|
5238
5252
|
}
|
|
5239
|
-
return /* @__PURE__ */ r("form", { onSubmit: ne.handleSubmit(
|
|
5253
|
+
return /* @__PURE__ */ r("form", { onSubmit: ne.handleSubmit(I), children: /* @__PURE__ */ o(Y, { children: [
|
|
5240
5254
|
/* @__PURE__ */ o(ye, { children: [
|
|
5241
5255
|
/* @__PURE__ */ r("h2", { className: "text-lg font-bold", style: { color: "var(--metakyc-text-primary, #111827)" }, children: "Review Your Information" }),
|
|
5242
5256
|
/* @__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" })
|
|
5243
5257
|
] }),
|
|
5244
|
-
/* @__PURE__ */ o(
|
|
5258
|
+
/* @__PURE__ */ o(V, { className: "space-y-6", children: [
|
|
5245
5259
|
/* @__PURE__ */ r("div", { className: "space-y-4 pb-4", style: { borderBottom: "1px solid var(--metakyc-border, #e5e7eb)" }, children: [
|
|
5246
|
-
{ label: "Name", value: `${((_e =
|
|
5247
|
-
{ label: "Email", value: (Ue =
|
|
5248
|
-
{ label: "Date of Birth", value: ((je =
|
|
5260
|
+
{ label: "Name", value: `${((_e = T == null ? void 0 : T.applicantRequestData) == null ? void 0 : _e.firstName) || ""} ${((He = T == null ? void 0 : T.applicantRequestData) == null ? void 0 : He.lastName) || ""}`.trim() },
|
|
5261
|
+
{ label: "Email", value: (Ue = T == null ? void 0 : T.applicantRequestData) == null ? void 0 : Ue.email },
|
|
5262
|
+
{ label: "Date of Birth", value: ((je = T == null ? void 0 : T.applicantRequestData) == null ? void 0 : je.dateOfBirth) || "Not provided" }
|
|
5249
5263
|
].map(({ label: i, value: y }) => /* @__PURE__ */ o("div", { children: [
|
|
5250
5264
|
/* @__PURE__ */ r("label", { className: "block text-sm font-medium", style: { color: "var(--metakyc-text-secondary, #6b7280)" }, children: i }),
|
|
5251
5265
|
/* @__PURE__ */ r("p", { className: "mt-1 text-base", style: { color: "var(--metakyc-text-primary, #111827)" }, children: y })
|
|
@@ -5254,12 +5268,12 @@ Failed to reload test data. Please refresh the page.`);
|
|
|
5254
5268
|
/* @__PURE__ */ r("h3", { className: "text-base font-semibold", style: { color: "var(--metakyc-text-primary, #111827)" }, children: "Address Information" }),
|
|
5255
5269
|
/* @__PURE__ */ o("div", { className: "grid grid-cols-1 md:grid-cols-2 gap-4", children: [
|
|
5256
5270
|
/* @__PURE__ */ r(
|
|
5257
|
-
|
|
5271
|
+
Le,
|
|
5258
5272
|
{
|
|
5259
5273
|
control: ne.control,
|
|
5260
5274
|
name: "country",
|
|
5261
5275
|
render: ({ field: i }) => /* @__PURE__ */ r(
|
|
5262
|
-
|
|
5276
|
+
Te,
|
|
5263
5277
|
{
|
|
5264
5278
|
label: "Country",
|
|
5265
5279
|
value: i.value,
|
|
@@ -5270,12 +5284,12 @@ Failed to reload test data. Please refresh the page.`);
|
|
|
5270
5284
|
}
|
|
5271
5285
|
),
|
|
5272
5286
|
/* @__PURE__ */ r(
|
|
5273
|
-
|
|
5287
|
+
Le,
|
|
5274
5288
|
{
|
|
5275
5289
|
control: ne.control,
|
|
5276
5290
|
name: "nationality",
|
|
5277
5291
|
render: ({ field: i }) => /* @__PURE__ */ r(
|
|
5278
|
-
|
|
5292
|
+
Te,
|
|
5279
5293
|
{
|
|
5280
5294
|
label: "Nationality",
|
|
5281
5295
|
value: i.value,
|
|
@@ -5287,19 +5301,19 @@ Failed to reload test data. Please refresh the page.`);
|
|
|
5287
5301
|
)
|
|
5288
5302
|
] }),
|
|
5289
5303
|
/* @__PURE__ */ o("div", { className: "grid grid-cols-1 md:grid-cols-2 gap-4", children: [
|
|
5290
|
-
/* @__PURE__ */ r(
|
|
5291
|
-
/* @__PURE__ */ r(
|
|
5304
|
+
/* @__PURE__ */ r(Le, { control: ne.control, name: "street", render: ({ field: i }) => /* @__PURE__ */ r(he, { ...i, label: "Street" }) }),
|
|
5305
|
+
/* @__PURE__ */ r(Le, { control: ne.control, name: "streetNumber", render: ({ field: i }) => /* @__PURE__ */ r(he, { ...i, label: "Street Number" }) })
|
|
5292
5306
|
] }),
|
|
5293
5307
|
/* @__PURE__ */ o("div", { className: "grid grid-cols-1 md:grid-cols-2 gap-4", children: [
|
|
5294
|
-
/* @__PURE__ */ r(
|
|
5295
|
-
/* @__PURE__ */ r(
|
|
5308
|
+
/* @__PURE__ */ r(Le, { control: ne.control, name: "city", render: ({ field: i }) => /* @__PURE__ */ r(he, { ...i, label: "City" }) }),
|
|
5309
|
+
/* @__PURE__ */ r(Le, { control: ne.control, name: "zip", render: ({ field: i }) => /* @__PURE__ */ r(he, { ...i, label: "ZIP / Postal Code" }) })
|
|
5296
5310
|
] }),
|
|
5297
|
-
/* @__PURE__ */ r(
|
|
5311
|
+
/* @__PURE__ */ r(Le, { control: ne.control, name: "phonenumber", render: ({ field: i }) => /* @__PURE__ */ r(he, { ...i, label: "Phone Number", type: "tel" }) })
|
|
5298
5312
|
] })
|
|
5299
5313
|
] }),
|
|
5300
5314
|
/* @__PURE__ */ o(ge, { className: "flex justify-between", children: [
|
|
5301
|
-
n && /* @__PURE__ */ r(
|
|
5302
|
-
/* @__PURE__ */ r(
|
|
5315
|
+
n && /* @__PURE__ */ r(Z, { type: "button", variant: "outline", onClick: n, children: "Back" }),
|
|
5316
|
+
/* @__PURE__ */ r(Z, { type: "submit", isLoading: v, children: "Confirm and Start Verification" })
|
|
5303
5317
|
] })
|
|
5304
5318
|
] }) });
|
|
5305
5319
|
}, mt = ({
|
|
@@ -5381,8 +5395,8 @@ Failed to reload test data. Please refresh the page.`);
|
|
|
5381
5395
|
iconColor: "text-blue-600 dark:text-blue-400",
|
|
5382
5396
|
message: "Your application is being reviewed."
|
|
5383
5397
|
};
|
|
5384
|
-
return /* @__PURE__ */ o(
|
|
5385
|
-
/* @__PURE__ */ o(
|
|
5398
|
+
return /* @__PURE__ */ o(Y, { children: [
|
|
5399
|
+
/* @__PURE__ */ o(V, { className: "py-12", children: [
|
|
5386
5400
|
/* @__PURE__ */ r("div", { className: "flex justify-center mb-6", children: /* @__PURE__ */ r(
|
|
5387
5401
|
"div",
|
|
5388
5402
|
{
|
|
@@ -5436,10 +5450,10 @@ Failed to reload test data. Please refresh the page.`);
|
|
|
5436
5450
|
] }) })
|
|
5437
5451
|
] }),
|
|
5438
5452
|
/* @__PURE__ */ o(ge, { className: "flex justify-center gap-4", children: [
|
|
5439
|
-
u.type === "success" && s && /* @__PURE__ */ r(
|
|
5440
|
-
u.type === "error" && /* @__PURE__ */ o(
|
|
5441
|
-
l && /* @__PURE__ */ r(
|
|
5442
|
-
s && /* @__PURE__ */ r(
|
|
5453
|
+
u.type === "success" && s && /* @__PURE__ */ r(Z, { onClick: s, size: "lg", children: "Continue" }),
|
|
5454
|
+
u.type === "error" && /* @__PURE__ */ o(qe, { children: [
|
|
5455
|
+
l && /* @__PURE__ */ r(Z, { variant: "outline", onClick: l, children: "Contact Support" }),
|
|
5456
|
+
s && /* @__PURE__ */ r(Z, { onClick: s, children: "Try Again" })
|
|
5443
5457
|
] }),
|
|
5444
5458
|
u.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" }) })
|
|
5445
5459
|
] })
|
|
@@ -5484,7 +5498,7 @@ Failed to reload test data. Please refresh the page.`);
|
|
|
5484
5498
|
function Ye(e) {
|
|
5485
5499
|
return e == null || e === "" || Array.isArray(e) && e.length === 0;
|
|
5486
5500
|
}
|
|
5487
|
-
const
|
|
5501
|
+
const Ve = {
|
|
5488
5502
|
width: "16px",
|
|
5489
5503
|
height: "16px",
|
|
5490
5504
|
minWidth: "16px",
|
|
@@ -5498,7 +5512,7 @@ const qe = {
|
|
|
5498
5512
|
verticalAlign: "middle"
|
|
5499
5513
|
}, pt = ({ helpText: e, children: t }) => {
|
|
5500
5514
|
const [n, a] = ve.useState(!1);
|
|
5501
|
-
if (!e) return /* @__PURE__ */ r(
|
|
5515
|
+
if (!e) return /* @__PURE__ */ r(qe, { children: t });
|
|
5502
5516
|
const s = n ? /* @__PURE__ */ r(
|
|
5503
5517
|
"div",
|
|
5504
5518
|
{
|
|
@@ -5645,70 +5659,70 @@ const qe = {
|
|
|
5645
5659
|
return Array.from(p);
|
|
5646
5660
|
}
|
|
5647
5661
|
let i;
|
|
5648
|
-
(x = s.applicantForm) != null && x.visibleFields ? i = s.applicantForm.visibleFields : c != null && c.applicantFormVisibleFields && c.applicantFormVisibleFields.length > 0 ? i = c.applicantFormVisibleFields : i =
|
|
5662
|
+
(x = s.applicantForm) != null && x.visibleFields ? i = s.applicantForm.visibleFields : c != null && c.applicantFormVisibleFields && c.applicantFormVisibleFields.length > 0 ? i = c.applicantFormVisibleFields : i = $t;
|
|
5649
5663
|
const y = new Set(i);
|
|
5650
5664
|
for (const d of Ge) y.add(d);
|
|
5651
5665
|
return Array.from(y);
|
|
5652
|
-
}, [(je = s.applicantForm) == null ? void 0 : je.visibleFields, c == null ? void 0 : c.applicantFormVisibleFields, f]),
|
|
5666
|
+
}, [(je = s.applicantForm) == null ? void 0 : je.visibleFields, c == null ? void 0 : c.applicantFormVisibleFields, f]), P = /* @__PURE__ */ new Set([
|
|
5653
5667
|
"country",
|
|
5654
5668
|
"nationality",
|
|
5655
5669
|
"taxCountry",
|
|
5656
5670
|
"countryOfBirth",
|
|
5657
5671
|
"mobileCountryCode",
|
|
5658
5672
|
"otherNationality"
|
|
5659
|
-
]),
|
|
5673
|
+
]), T = Pe(() => {
|
|
5660
5674
|
var y, x;
|
|
5661
5675
|
const i = /* @__PURE__ */ new Set();
|
|
5662
5676
|
if (f)
|
|
5663
5677
|
for (const d of f)
|
|
5664
5678
|
for (const p of d.fields)
|
|
5665
|
-
!p.isCustom && p.name &&
|
|
5679
|
+
!p.isCustom && p.name && P.has(p.name) && i.add(p.countriesType ?? ((y = Oe[p.name]) == null ? void 0 : y.countriesType));
|
|
5666
5680
|
else
|
|
5667
5681
|
for (const d of b)
|
|
5668
|
-
|
|
5682
|
+
P.has(d) && i.add((x = Oe[d]) == null ? void 0 : x.countriesType);
|
|
5669
5683
|
return i.size === 0 && i.add(void 0), Array.from(i);
|
|
5670
|
-
}, [b, f]), [
|
|
5684
|
+
}, [b, f]), [R, O] = k({}), [A, F] = k(!0), K = te(/* @__PURE__ */ new Set()), re = te(/* @__PURE__ */ new Set());
|
|
5671
5685
|
ie(() => {
|
|
5672
5686
|
if (!c) return;
|
|
5673
|
-
const i =
|
|
5687
|
+
const i = T.filter((d) => {
|
|
5674
5688
|
const p = d != null ? String(d) : "all";
|
|
5675
|
-
return !re.current.has(p) && !
|
|
5689
|
+
return !re.current.has(p) && !K.current.has(p);
|
|
5676
5690
|
});
|
|
5677
5691
|
if (i.length === 0) {
|
|
5678
|
-
|
|
5692
|
+
T.every((p) => {
|
|
5679
5693
|
const C = p != null ? String(p) : "all";
|
|
5680
5694
|
return re.current.has(C);
|
|
5681
|
-
}) &&
|
|
5695
|
+
}) && F(!1);
|
|
5682
5696
|
return;
|
|
5683
5697
|
}
|
|
5684
|
-
|
|
5698
|
+
F(!0);
|
|
5685
5699
|
const y = i.map((d) => d != null ? String(d) : "all");
|
|
5686
|
-
y.forEach((d) =>
|
|
5700
|
+
y.forEach((d) => K.current.add(d)), (async () => {
|
|
5687
5701
|
try {
|
|
5688
5702
|
const d = await Promise.all(
|
|
5689
5703
|
i.map(async (p) => {
|
|
5690
|
-
const C = p != null ? String(p) : "all",
|
|
5691
|
-
value:
|
|
5692
|
-
label: `${
|
|
5693
|
-
} : { value:
|
|
5694
|
-
return re.current.add(C),
|
|
5704
|
+
const C = p != null ? String(p) : "all", $ = await l.getCountries("", s.locale || "en", p), H = p === 40, g = /* @__PURE__ */ new Set(), se = $.map((J) => H && J.countryCode ? {
|
|
5705
|
+
value: J.countryCode,
|
|
5706
|
+
label: `${J.countryCode} – ${J.name}`
|
|
5707
|
+
} : { value: J.abbreviation3 || J.abbreviation, label: J.name }).filter((J) => !J.value || g.has(J.value) ? !1 : (g.add(J.value), !0));
|
|
5708
|
+
return re.current.add(C), K.current.delete(C), [C, se];
|
|
5695
5709
|
})
|
|
5696
5710
|
);
|
|
5697
5711
|
O((p) => ({ ...p, ...Object.fromEntries(d) }));
|
|
5698
5712
|
} catch (d) {
|
|
5699
|
-
y.forEach((p) =>
|
|
5713
|
+
y.forEach((p) => K.current.delete(p)), console.error("Failed to load countries:", d);
|
|
5700
5714
|
} finally {
|
|
5701
|
-
|
|
5715
|
+
T.every((p) => {
|
|
5702
5716
|
const C = p != null ? String(p) : "all";
|
|
5703
5717
|
return re.current.has(C);
|
|
5704
|
-
}) &&
|
|
5718
|
+
}) && F(!1);
|
|
5705
5719
|
}
|
|
5706
5720
|
})();
|
|
5707
|
-
}, [
|
|
5708
|
-
const
|
|
5721
|
+
}, [T, c]);
|
|
5722
|
+
const B = (i, y) => {
|
|
5709
5723
|
var p;
|
|
5710
5724
|
const x = y ?? ((p = Oe[i]) == null ? void 0 : p.countriesType), d = x != null ? String(x) : "all";
|
|
5711
|
-
return
|
|
5725
|
+
return R[d] || [];
|
|
5712
5726
|
}, [S, U] = k({
|
|
5713
5727
|
workflowKey: m,
|
|
5714
5728
|
firstName: "",
|
|
@@ -5734,14 +5748,14 @@ const qe = {
|
|
|
5734
5748
|
educationLevel: "",
|
|
5735
5749
|
occupation: "",
|
|
5736
5750
|
taxNumber: ""
|
|
5737
|
-
}), [
|
|
5751
|
+
}), [j, M] = k({}), [z, L] = k(0), [D, q] = k({}), [W, de] = k(null), [E, _] = k(!1), G = (i, y) => U((x) => ({ ...x, [i]: y })), le = (i, y) => M((x) => ({ ...x, [i]: y })), ne = (i) => !i.conditionalOn || j[i.conditionalOn] === "true", I = f && z < f.length - 1 ? z + 1 : -1, X = f && z > 0 ? z - 1 : -1, oe = (i) => {
|
|
5738
5752
|
var x;
|
|
5739
5753
|
const y = {};
|
|
5740
5754
|
for (const d of i.fields)
|
|
5741
5755
|
if (d.isCustom) {
|
|
5742
5756
|
if (d.customType === "paragraph" || d.customType === "html" || d.customType === "br" || d.customType === "link") continue;
|
|
5743
5757
|
if (d.required && d.paramName) {
|
|
5744
|
-
const p =
|
|
5758
|
+
const p = j[d.paramName], C = d.displayText || d.label || d.paramName;
|
|
5745
5759
|
d.customType === "checkbox" || d.customType === "link_checkbox" ? p !== "true" && (y[d.paramName] = `${C} is required.`) : (!p || p.trim() === "") && (y[d.paramName] = `${C} is required.`);
|
|
5746
5760
|
}
|
|
5747
5761
|
} else if (d.name) {
|
|
@@ -5752,33 +5766,33 @@ const qe = {
|
|
|
5752
5766
|
}
|
|
5753
5767
|
}
|
|
5754
5768
|
return y;
|
|
5755
|
-
},
|
|
5769
|
+
}, ce = async () => {
|
|
5756
5770
|
if (!f) return;
|
|
5757
|
-
const i = f[
|
|
5771
|
+
const i = f[z];
|
|
5758
5772
|
if (i.conditionalOn && !ne(i)) {
|
|
5759
|
-
|
|
5773
|
+
q({}), I >= 0 ? L(I) : await Ce();
|
|
5760
5774
|
return;
|
|
5761
5775
|
}
|
|
5762
|
-
const y =
|
|
5776
|
+
const y = oe(i);
|
|
5763
5777
|
if (Object.keys(y).length > 0) {
|
|
5764
|
-
|
|
5778
|
+
q(y);
|
|
5765
5779
|
return;
|
|
5766
5780
|
}
|
|
5767
|
-
|
|
5781
|
+
q({}), I >= 0 ? L(I) : await Ce();
|
|
5768
5782
|
}, Ce = async () => {
|
|
5769
5783
|
if (f) {
|
|
5770
5784
|
let i = {};
|
|
5771
5785
|
for (const y of f)
|
|
5772
|
-
ne(y) && (i = { ...i, ...
|
|
5786
|
+
ne(y) && (i = { ...i, ...oe(y) });
|
|
5773
5787
|
if (Object.keys(i).length > 0) {
|
|
5774
|
-
|
|
5788
|
+
q(i);
|
|
5775
5789
|
return;
|
|
5776
5790
|
}
|
|
5777
5791
|
}
|
|
5778
|
-
|
|
5792
|
+
_(!0), de(null);
|
|
5779
5793
|
try {
|
|
5780
5794
|
if (!S.externalRefId || S.externalRefId.trim() === "") {
|
|
5781
|
-
|
|
5795
|
+
de("External Reference ID is required. Please pass it via config.applicantForm.externalRefId.");
|
|
5782
5796
|
return;
|
|
5783
5797
|
}
|
|
5784
5798
|
const i = {
|
|
@@ -5790,8 +5804,8 @@ const qe = {
|
|
|
5790
5804
|
if (ne(d)) {
|
|
5791
5805
|
for (const p of d.fields)
|
|
5792
5806
|
if (!p.isCustom && p.name) {
|
|
5793
|
-
const C = p.name,
|
|
5794
|
-
Ye(
|
|
5807
|
+
const C = p.name, $ = S[C];
|
|
5808
|
+
Ye($) || (i[C] = $);
|
|
5795
5809
|
}
|
|
5796
5810
|
}
|
|
5797
5811
|
for (const d of Ge)
|
|
@@ -5811,21 +5825,21 @@ const qe = {
|
|
|
5811
5825
|
if (ne(d))
|
|
5812
5826
|
for (const p of d.fields) {
|
|
5813
5827
|
if (!p.isCustom || !p.paramName || p.customType === "paragraph" || p.customType === "html" || p.customType === "br" || p.customType === "link") continue;
|
|
5814
|
-
const C =
|
|
5815
|
-
let
|
|
5828
|
+
const C = j[p.paramName] ?? "";
|
|
5829
|
+
let $;
|
|
5816
5830
|
if (p.customType === "checkbox" || p.customType === "link_checkbox")
|
|
5817
|
-
|
|
5818
|
-
else if (
|
|
5819
|
-
y.push({ paramName: p.paramName, value:
|
|
5831
|
+
$ = C === "true" ? "yes" : "no";
|
|
5832
|
+
else if ($ = C, !$ && !p.required) continue;
|
|
5833
|
+
y.push({ paramName: p.paramName, value: $ });
|
|
5820
5834
|
}
|
|
5821
5835
|
}
|
|
5822
5836
|
y.length > 0 && (i.applicantAdditionalDatas = y);
|
|
5823
5837
|
const x = await u(i);
|
|
5824
5838
|
n(x.applicantId);
|
|
5825
5839
|
} catch (i) {
|
|
5826
|
-
console.error("Error creating applicant:", i),
|
|
5840
|
+
console.error("Error creating applicant:", i), de(i.message || "Failed to create applicant");
|
|
5827
5841
|
} finally {
|
|
5828
|
-
|
|
5842
|
+
_(!1);
|
|
5829
5843
|
}
|
|
5830
5844
|
}, Xe = async (i) => {
|
|
5831
5845
|
var y;
|
|
@@ -5833,62 +5847,62 @@ const qe = {
|
|
|
5833
5847
|
for (const x of N)
|
|
5834
5848
|
if (Ye(S[x])) {
|
|
5835
5849
|
const d = ((y = Oe[x]) == null ? void 0 : y.label) || x;
|
|
5836
|
-
|
|
5850
|
+
de(`${d} is required.`);
|
|
5837
5851
|
return;
|
|
5838
5852
|
}
|
|
5839
5853
|
await Ce();
|
|
5840
5854
|
}, ke = (i, y, x, d) => {
|
|
5841
|
-
var
|
|
5855
|
+
var J;
|
|
5842
5856
|
const p = Oe[i];
|
|
5843
5857
|
if (!p) return null;
|
|
5844
|
-
const C = N.includes(i),
|
|
5858
|
+
const C = N.includes(i), $ = D[i], H = x || p.label, g = y ?? i, se = { required: C };
|
|
5845
5859
|
switch (p.type) {
|
|
5846
5860
|
case "select":
|
|
5847
5861
|
if (i === "country" || i === "nationality" || i === "taxCountry" || i === "countryOfBirth" || i === "mobileCountryCode") {
|
|
5848
|
-
const me =
|
|
5862
|
+
const me = B(i, d);
|
|
5849
5863
|
return /* @__PURE__ */ r(
|
|
5850
|
-
|
|
5864
|
+
Te,
|
|
5851
5865
|
{
|
|
5852
5866
|
...se,
|
|
5853
|
-
label:
|
|
5867
|
+
label: H,
|
|
5854
5868
|
value: S[i] || "",
|
|
5855
|
-
onChange: (
|
|
5856
|
-
options: [{ value: "", label: `Select ${
|
|
5857
|
-
disabled:
|
|
5858
|
-
error:
|
|
5869
|
+
onChange: (Fe) => G(i, Fe),
|
|
5870
|
+
options: [{ value: "", label: `Select ${H.toLowerCase()}...` }, ...me],
|
|
5871
|
+
disabled: A,
|
|
5872
|
+
error: $
|
|
5859
5873
|
},
|
|
5860
5874
|
g
|
|
5861
5875
|
);
|
|
5862
5876
|
}
|
|
5863
5877
|
if (i === "salutation")
|
|
5864
5878
|
return /* @__PURE__ */ r(
|
|
5865
|
-
|
|
5879
|
+
Te,
|
|
5866
5880
|
{
|
|
5867
5881
|
...se,
|
|
5868
|
-
label:
|
|
5869
|
-
value: ((
|
|
5870
|
-
onChange: (me) =>
|
|
5882
|
+
label: H,
|
|
5883
|
+
value: ((J = S[i]) == null ? void 0 : J.toString()) || "",
|
|
5884
|
+
onChange: (me) => G(i, me ? Number(me) : null),
|
|
5871
5885
|
options: [
|
|
5872
5886
|
{ value: "", label: "Select salutation..." },
|
|
5873
5887
|
{ value: Ze.Male.toString(), label: "Male" },
|
|
5874
5888
|
{ value: Ze.Female.toString(), label: "Female" },
|
|
5875
5889
|
{ value: Ze.Other.toString(), label: "Other" }
|
|
5876
5890
|
],
|
|
5877
|
-
error:
|
|
5891
|
+
error: $
|
|
5878
5892
|
},
|
|
5879
5893
|
g
|
|
5880
5894
|
);
|
|
5881
5895
|
if (i === "defaultLanguage") {
|
|
5882
|
-
const me = c != null && c.allowedLanguages && c.allowedLanguages.length > 0 ? lt.filter((
|
|
5896
|
+
const me = c != null && c.allowedLanguages && c.allowedLanguages.length > 0 ? lt.filter((Fe) => c.allowedLanguages.includes(Fe.value)) : lt;
|
|
5883
5897
|
return /* @__PURE__ */ r(
|
|
5884
|
-
|
|
5898
|
+
Te,
|
|
5885
5899
|
{
|
|
5886
5900
|
...se,
|
|
5887
|
-
label:
|
|
5901
|
+
label: H,
|
|
5888
5902
|
value: S[i] || "",
|
|
5889
|
-
onChange: (
|
|
5903
|
+
onChange: (Fe) => G(i, Fe),
|
|
5890
5904
|
options: [{ value: "", label: "Select language..." }, ...me],
|
|
5891
|
-
error:
|
|
5905
|
+
error: $
|
|
5892
5906
|
},
|
|
5893
5907
|
g
|
|
5894
5908
|
);
|
|
@@ -5896,17 +5910,17 @@ const qe = {
|
|
|
5896
5910
|
return null;
|
|
5897
5911
|
case "multiselect":
|
|
5898
5912
|
if (i === "otherNationality") {
|
|
5899
|
-
const me =
|
|
5913
|
+
const me = B(i, d);
|
|
5900
5914
|
return /* @__PURE__ */ r(
|
|
5901
5915
|
Er,
|
|
5902
5916
|
{
|
|
5903
5917
|
...se,
|
|
5904
|
-
label:
|
|
5918
|
+
label: H,
|
|
5905
5919
|
value: S[i] || [],
|
|
5906
|
-
onChange: (
|
|
5920
|
+
onChange: (Fe) => G(i, Fe),
|
|
5907
5921
|
options: me,
|
|
5908
5922
|
placeholder: "Select other nationalities...",
|
|
5909
|
-
disabled:
|
|
5923
|
+
disabled: A
|
|
5910
5924
|
},
|
|
5911
5925
|
g
|
|
5912
5926
|
);
|
|
@@ -5918,10 +5932,10 @@ const qe = {
|
|
|
5918
5932
|
{
|
|
5919
5933
|
...se,
|
|
5920
5934
|
type: "date",
|
|
5921
|
-
label:
|
|
5935
|
+
label: H,
|
|
5922
5936
|
value: S[i] || "",
|
|
5923
|
-
onChange: (me) =>
|
|
5924
|
-
error:
|
|
5937
|
+
onChange: (me) => G(i, me.target.value),
|
|
5938
|
+
error: $
|
|
5925
5939
|
},
|
|
5926
5940
|
g
|
|
5927
5941
|
);
|
|
@@ -5931,10 +5945,10 @@ const qe = {
|
|
|
5931
5945
|
{
|
|
5932
5946
|
...se,
|
|
5933
5947
|
type: "email",
|
|
5934
|
-
label:
|
|
5948
|
+
label: H,
|
|
5935
5949
|
value: S[i] || "",
|
|
5936
|
-
onChange: (me) =>
|
|
5937
|
-
error:
|
|
5950
|
+
onChange: (me) => G(i, me.target.value),
|
|
5951
|
+
error: $
|
|
5938
5952
|
},
|
|
5939
5953
|
g
|
|
5940
5954
|
);
|
|
@@ -5944,10 +5958,10 @@ const qe = {
|
|
|
5944
5958
|
{
|
|
5945
5959
|
...se,
|
|
5946
5960
|
type: "tel",
|
|
5947
|
-
label:
|
|
5961
|
+
label: H,
|
|
5948
5962
|
value: S[i] || "",
|
|
5949
|
-
onChange: (me) =>
|
|
5950
|
-
error:
|
|
5963
|
+
onChange: (me) => G(i, me.target.value),
|
|
5964
|
+
error: $
|
|
5951
5965
|
},
|
|
5952
5966
|
g
|
|
5953
5967
|
);
|
|
@@ -5957,10 +5971,10 @@ const qe = {
|
|
|
5957
5971
|
{
|
|
5958
5972
|
...se,
|
|
5959
5973
|
type: "text",
|
|
5960
|
-
label:
|
|
5974
|
+
label: H,
|
|
5961
5975
|
value: S[i] || "",
|
|
5962
|
-
onChange: (me) =>
|
|
5963
|
-
error:
|
|
5976
|
+
onChange: (me) => G(i, me.target.value),
|
|
5977
|
+
error: $
|
|
5964
5978
|
},
|
|
5965
5979
|
g
|
|
5966
5980
|
);
|
|
@@ -6018,7 +6032,7 @@ const qe = {
|
|
|
6018
6032
|
) }, `custom-${y}`);
|
|
6019
6033
|
}
|
|
6020
6034
|
if (!i.paramName) return null;
|
|
6021
|
-
const x =
|
|
6035
|
+
const x = D[i.paramName], d = i.displayText || i.label || i.paramName;
|
|
6022
6036
|
if (i.customType === "checkbox")
|
|
6023
6037
|
return /* @__PURE__ */ o("div", { className: "flex flex-col gap-1", children: [
|
|
6024
6038
|
/* @__PURE__ */ o(
|
|
@@ -6031,10 +6045,10 @@ const qe = {
|
|
|
6031
6045
|
"input",
|
|
6032
6046
|
{
|
|
6033
6047
|
type: "checkbox",
|
|
6034
|
-
checked:
|
|
6035
|
-
onChange: (p) =>
|
|
6048
|
+
checked: j[i.paramName] === "true",
|
|
6049
|
+
onChange: (p) => le(i.paramName, p.target.checked ? "true" : "false"),
|
|
6036
6050
|
className: "metakyc-option-input",
|
|
6037
|
-
style:
|
|
6051
|
+
style: Ve
|
|
6038
6052
|
}
|
|
6039
6053
|
),
|
|
6040
6054
|
/* @__PURE__ */ o(
|
|
@@ -6065,10 +6079,10 @@ const qe = {
|
|
|
6065
6079
|
"input",
|
|
6066
6080
|
{
|
|
6067
6081
|
type: "checkbox",
|
|
6068
|
-
checked:
|
|
6069
|
-
onChange: (p) =>
|
|
6082
|
+
checked: j[i.paramName] === "true",
|
|
6083
|
+
onChange: (p) => le(i.paramName, p.target.checked ? "true" : "false"),
|
|
6070
6084
|
className: "metakyc-option-input",
|
|
6071
|
-
style: { ...
|
|
6085
|
+
style: { ...Ve, alignSelf: "flex-start", marginTop: "2px" }
|
|
6072
6086
|
}
|
|
6073
6087
|
),
|
|
6074
6088
|
/* @__PURE__ */ o(
|
|
@@ -6101,7 +6115,7 @@ const qe = {
|
|
|
6101
6115
|
x && /* @__PURE__ */ r("p", { className: "text-red-500 text-xs mt-0.5", children: x })
|
|
6102
6116
|
] }, `custom-${y}`);
|
|
6103
6117
|
if (i.customType === "group_checkbox") {
|
|
6104
|
-
const p = (
|
|
6118
|
+
const p = (j[i.paramName] || "").split(",").filter(Boolean);
|
|
6105
6119
|
return /* @__PURE__ */ o("div", { className: "flex flex-col gap-1.5", children: [
|
|
6106
6120
|
/* @__PURE__ */ o(
|
|
6107
6121
|
"div",
|
|
@@ -6115,7 +6129,7 @@ const qe = {
|
|
|
6115
6129
|
}
|
|
6116
6130
|
),
|
|
6117
6131
|
/* @__PURE__ */ r("div", { className: "metakyc-options-group", style: { display: "flex", flexDirection: "column", gap: "8px" }, children: (i.options || []).map((C) => {
|
|
6118
|
-
const
|
|
6132
|
+
const $ = i.singleSelect ? j[i.paramName] === C.value : p.includes(C.value);
|
|
6119
6133
|
return /* @__PURE__ */ o(
|
|
6120
6134
|
"label",
|
|
6121
6135
|
{
|
|
@@ -6126,17 +6140,17 @@ const qe = {
|
|
|
6126
6140
|
"input",
|
|
6127
6141
|
{
|
|
6128
6142
|
type: "checkbox",
|
|
6129
|
-
checked:
|
|
6130
|
-
onChange: (
|
|
6143
|
+
checked: $,
|
|
6144
|
+
onChange: (H) => {
|
|
6131
6145
|
if (i.singleSelect)
|
|
6132
|
-
|
|
6146
|
+
le(i.paramName, H.target.checked ? C.value : "");
|
|
6133
6147
|
else {
|
|
6134
|
-
const g =
|
|
6135
|
-
|
|
6148
|
+
const g = H.target.checked ? [...p, C.value] : p.filter((se) => se !== C.value);
|
|
6149
|
+
le(i.paramName, g.join(","));
|
|
6136
6150
|
}
|
|
6137
6151
|
},
|
|
6138
6152
|
className: "metakyc-option-input",
|
|
6139
|
-
style:
|
|
6153
|
+
style: Ve
|
|
6140
6154
|
}
|
|
6141
6155
|
),
|
|
6142
6156
|
/* @__PURE__ */ r(
|
|
@@ -6177,11 +6191,11 @@ const qe = {
|
|
|
6177
6191
|
"input",
|
|
6178
6192
|
{
|
|
6179
6193
|
type: "radio",
|
|
6180
|
-
checked:
|
|
6181
|
-
onChange: () =>
|
|
6194
|
+
checked: j[i.paramName] === p.value,
|
|
6195
|
+
onChange: () => le(i.paramName, p.value),
|
|
6182
6196
|
name: `radio-group-${i.paramName}-${y}`,
|
|
6183
6197
|
className: "metakyc-option-input",
|
|
6184
|
-
style:
|
|
6198
|
+
style: Ve
|
|
6185
6199
|
}
|
|
6186
6200
|
),
|
|
6187
6201
|
/* @__PURE__ */ r(
|
|
@@ -6202,8 +6216,8 @@ const qe = {
|
|
|
6202
6216
|
{
|
|
6203
6217
|
type: "text",
|
|
6204
6218
|
label: `${d}${i.required ? " *" : ""}`,
|
|
6205
|
-
value:
|
|
6206
|
-
onChange: (p) =>
|
|
6219
|
+
value: j[i.paramName] || "",
|
|
6220
|
+
onChange: (p) => le(i.paramName, p.target.value),
|
|
6207
6221
|
required: i.required,
|
|
6208
6222
|
error: x
|
|
6209
6223
|
},
|
|
@@ -6223,9 +6237,9 @@ const qe = {
|
|
|
6223
6237
|
{
|
|
6224
6238
|
type: "checkbox",
|
|
6225
6239
|
checked: x,
|
|
6226
|
-
onChange: (d) =>
|
|
6240
|
+
onChange: (d) => le(i.conditionalOn, d.target.checked ? "true" : "false"),
|
|
6227
6241
|
className: "metakyc-option-input",
|
|
6228
|
-
style:
|
|
6242
|
+
style: Ve
|
|
6229
6243
|
}
|
|
6230
6244
|
),
|
|
6231
6245
|
/* @__PURE__ */ r(
|
|
@@ -6240,21 +6254,21 @@ const qe = {
|
|
|
6240
6254
|
}
|
|
6241
6255
|
) }),
|
|
6242
6256
|
x && /* @__PURE__ */ r("div", { className: "grid grid-cols-4 gap-4", children: i.fields.map((d, p) => {
|
|
6243
|
-
const C = d.colSpan === 1 ? "col-span-1" : d.colSpan === 2 ? "col-span-2" : d.colSpan === 3 ? "col-span-3" : "col-span-4",
|
|
6244
|
-
return /* @__PURE__ */ r("div", { className: C, children: /* @__PURE__ */ r(pt, { helpText: d.helpText, children: d.isCustom ? et(d, p) : ke(d.name,
|
|
6257
|
+
const C = d.colSpan === 1 ? "col-span-1" : d.colSpan === 2 ? "col-span-2" : d.colSpan === 3 ? "col-span-3" : "col-span-4", $ = d.isCustom ? `custom-${p}-${d.paramName}` : `builtin-${d.name}-${p}`;
|
|
6258
|
+
return /* @__PURE__ */ r("div", { className: C, children: /* @__PURE__ */ r(pt, { helpText: d.helpText, children: d.isCustom ? et(d, p) : ke(d.name, $, d.displayText, d.countriesType) }) }, $);
|
|
6245
6259
|
}) })
|
|
6246
6260
|
] });
|
|
6247
6261
|
};
|
|
6248
|
-
if (!c ||
|
|
6249
|
-
return /* @__PURE__ */ r("div", { className: "metakyc-sdk", children: /* @__PURE__ */ r(
|
|
6262
|
+
if (!c || A)
|
|
6263
|
+
return /* @__PURE__ */ r("div", { className: "metakyc-sdk", children: /* @__PURE__ */ r(Y, { children: /* @__PURE__ */ o(V, { children: [
|
|
6250
6264
|
/* @__PURE__ */ r(Se, { className: "my-8" }),
|
|
6251
6265
|
/* @__PURE__ */ r("p", { className: "text-center mt-4", style: { color: "var(--metakyc-text-secondary, #6b7280)", fontSize: "0.875rem" }, children: "Loading form…" })
|
|
6252
6266
|
] }) }) });
|
|
6253
6267
|
if (f) {
|
|
6254
|
-
const i = f[
|
|
6255
|
-
return /* @__PURE__ */ r("div", { className: "metakyc-sdk", children: /* @__PURE__ */ o(
|
|
6268
|
+
const i = f[z] ?? f[0], y = X === -1, x = I === -1, d = f.length, p = ne(i), C = Object.values(D);
|
|
6269
|
+
return /* @__PURE__ */ r("div", { className: "metakyc-sdk", children: /* @__PURE__ */ o(Y, { children: [
|
|
6256
6270
|
/* @__PURE__ */ r(ye, { children: /* @__PURE__ */ r(at, { title: (c == null ? void 0 : c.title) || "Create Applicant" }) }),
|
|
6257
|
-
/* @__PURE__ */ o(
|
|
6271
|
+
/* @__PURE__ */ o(V, { children: [
|
|
6258
6272
|
(i.title || i.subtitle || i.description) && /* @__PURE__ */ o("div", { className: "mb-4", children: [
|
|
6259
6273
|
i.title && /* @__PURE__ */ r(
|
|
6260
6274
|
"h3",
|
|
@@ -6281,25 +6295,25 @@ const qe = {
|
|
|
6281
6295
|
}
|
|
6282
6296
|
)
|
|
6283
6297
|
] }),
|
|
6284
|
-
(
|
|
6285
|
-
|
|
6298
|
+
(W || C.length > 0) && /* @__PURE__ */ o("div", { className: "mb-4 p-3 bg-red-50 border border-red-200 rounded-lg", children: [
|
|
6299
|
+
W && /* @__PURE__ */ o("p", { className: "text-red-600 text-sm", children: [
|
|
6286
6300
|
/* @__PURE__ */ r("strong", { children: "Error:" }),
|
|
6287
6301
|
" ",
|
|
6288
|
-
|
|
6302
|
+
W
|
|
6289
6303
|
] }),
|
|
6290
|
-
C.map((
|
|
6304
|
+
C.map(($, H) => /* @__PURE__ */ r("p", { className: "text-red-600 text-sm", children: $ }, H))
|
|
6291
6305
|
] }),
|
|
6292
6306
|
d > 1 && /* @__PURE__ */ o("div", { className: "flex items-center gap-2 mb-4", children: [
|
|
6293
|
-
f.map((
|
|
6307
|
+
f.map(($, H) => /* @__PURE__ */ r(
|
|
6294
6308
|
"div",
|
|
6295
6309
|
{
|
|
6296
|
-
className: `h-1.5 rounded-full transition-all ${
|
|
6297
|
-
style:
|
|
6310
|
+
className: `h-1.5 rounded-full transition-all ${H === z ? "flex-1" : "w-8"}`,
|
|
6311
|
+
style: H === z ? { backgroundColor: "var(--metakyc-primary, #2563eb)" } : H < z ? { backgroundColor: "var(--metakyc-primary-light, #93c5fd)", opacity: 0.7 } : { backgroundColor: "#e5e7eb" }
|
|
6298
6312
|
},
|
|
6299
|
-
|
|
6313
|
+
H
|
|
6300
6314
|
)),
|
|
6301
6315
|
/* @__PURE__ */ o("span", { className: "text-xs text-gray-400 flex-shrink-0", children: [
|
|
6302
|
-
|
|
6316
|
+
z + 1,
|
|
6303
6317
|
" / ",
|
|
6304
6318
|
d
|
|
6305
6319
|
] })
|
|
@@ -6309,44 +6323,44 @@ const qe = {
|
|
|
6309
6323
|
/* @__PURE__ */ o(ge, { className: "flex justify-between", children: [
|
|
6310
6324
|
/* @__PURE__ */ o("div", { children: [
|
|
6311
6325
|
!y && /* @__PURE__ */ r(
|
|
6312
|
-
|
|
6326
|
+
Z,
|
|
6313
6327
|
{
|
|
6314
6328
|
type: "button",
|
|
6315
6329
|
variant: "outline",
|
|
6316
6330
|
onClick: () => {
|
|
6317
|
-
|
|
6331
|
+
L(X), q({});
|
|
6318
6332
|
},
|
|
6319
|
-
disabled:
|
|
6333
|
+
disabled: E || h,
|
|
6320
6334
|
children: "Previous"
|
|
6321
6335
|
}
|
|
6322
6336
|
),
|
|
6323
|
-
y && a && /* @__PURE__ */ r(
|
|
6337
|
+
y && a && /* @__PURE__ */ r(Z, { type: "button", variant: "outline", onClick: a, disabled: E || h, children: "Cancel" })
|
|
6324
6338
|
] }),
|
|
6325
6339
|
/* @__PURE__ */ r(
|
|
6326
|
-
|
|
6340
|
+
Z,
|
|
6327
6341
|
{
|
|
6328
6342
|
type: "button",
|
|
6329
|
-
isLoading:
|
|
6330
|
-
onClick: x ? Ce :
|
|
6343
|
+
isLoading: E || h,
|
|
6344
|
+
onClick: x ? Ce : ce,
|
|
6331
6345
|
children: x ? i.conditionalOn && !p ? "Skip & Submit" : "Submit" : i.conditionalOn && !p ? "Skip" : "Next"
|
|
6332
6346
|
}
|
|
6333
6347
|
)
|
|
6334
6348
|
] })
|
|
6335
6349
|
] }) });
|
|
6336
6350
|
}
|
|
6337
|
-
return /* @__PURE__ */ r("div", { className: "metakyc-sdk", children: /* @__PURE__ */ r("form", { onSubmit: Xe, children: /* @__PURE__ */ o(
|
|
6351
|
+
return /* @__PURE__ */ r("div", { className: "metakyc-sdk", children: /* @__PURE__ */ r("form", { onSubmit: Xe, children: /* @__PURE__ */ o(Y, { children: [
|
|
6338
6352
|
/* @__PURE__ */ r(ye, { children: /* @__PURE__ */ r(at, { title: (c == null ? void 0 : c.title) || "Create Applicant" }) }),
|
|
6339
|
-
/* @__PURE__ */ o(
|
|
6340
|
-
|
|
6353
|
+
/* @__PURE__ */ o(V, { children: [
|
|
6354
|
+
W && /* @__PURE__ */ r("div", { className: "mb-6 p-4 bg-red-50 border border-red-200 rounded-lg", children: /* @__PURE__ */ o("p", { className: "text-red-600 text-sm", children: [
|
|
6341
6355
|
/* @__PURE__ */ r("strong", { children: "Error:" }),
|
|
6342
6356
|
" ",
|
|
6343
|
-
|
|
6357
|
+
W
|
|
6344
6358
|
] }) }),
|
|
6345
6359
|
/* @__PURE__ */ r("div", { className: "grid grid-cols-4 gap-4", children: b.map((i) => /* @__PURE__ */ r("div", { className: "col-span-4", children: ke(i) }, i)) })
|
|
6346
6360
|
] }),
|
|
6347
6361
|
/* @__PURE__ */ o(ge, { className: "flex justify-between", children: [
|
|
6348
|
-
a && /* @__PURE__ */ r(
|
|
6349
|
-
/* @__PURE__ */ r(
|
|
6362
|
+
a && /* @__PURE__ */ r(Z, { type: "button", variant: "outline", onClick: a, disabled: E || h, children: "Cancel" }),
|
|
6363
|
+
/* @__PURE__ */ r(Z, { type: "submit", isLoading: E || h, children: "Create Applicant" })
|
|
6350
6364
|
] })
|
|
6351
6365
|
] }) }) });
|
|
6352
6366
|
}, vn = ({
|
|
@@ -6367,7 +6381,7 @@ const qe = {
|
|
|
6367
6381
|
error: f,
|
|
6368
6382
|
moveBack: N,
|
|
6369
6383
|
refreshProgress: b
|
|
6370
|
-
} = xr(e), [
|
|
6384
|
+
} = xr(e), [P, T] = ve.useState(!1);
|
|
6371
6385
|
if (ve.useEffect(() => {
|
|
6372
6386
|
f && n && n(f);
|
|
6373
6387
|
}, [f, n]), ve.useEffect(() => {
|
|
@@ -6375,19 +6389,19 @@ const qe = {
|
|
|
6375
6389
|
}, [l == null ? void 0 : l.workflowResult, t]), ve.useEffect(() => {
|
|
6376
6390
|
a === "dark" ? document.documentElement.classList.add("dark") : document.documentElement.classList.remove("dark");
|
|
6377
6391
|
}, [a]), ve.useEffect(() => {
|
|
6378
|
-
v &&
|
|
6392
|
+
v && T(!1);
|
|
6379
6393
|
}, [v]), w || !l)
|
|
6380
|
-
return /* @__PURE__ */ r("div", { className: s, children: /* @__PURE__ */ r(
|
|
6394
|
+
return /* @__PURE__ */ r("div", { className: s, children: /* @__PURE__ */ r(Y, { children: /* @__PURE__ */ o(V, { children: [
|
|
6381
6395
|
/* @__PURE__ */ r(Se, { className: "my-8" }),
|
|
6382
6396
|
/* @__PURE__ */ r("p", { className: "text-center text-gray-600 dark:text-gray-400 mt-4", children: "Loading workflow..." })
|
|
6383
6397
|
] }) }) });
|
|
6384
6398
|
if (f)
|
|
6385
|
-
return /* @__PURE__ */ r("div", { className: s, children: /* @__PURE__ */ r(
|
|
6399
|
+
return /* @__PURE__ */ r("div", { className: s, children: /* @__PURE__ */ r(Y, { children: /* @__PURE__ */ r(V, { children: /* @__PURE__ */ o("div", { className: "text-center py-8", children: [
|
|
6386
6400
|
/* @__PURE__ */ r("p", { className: "text-danger-500 text-lg mb-4", children: "An error occurred" }),
|
|
6387
6401
|
/* @__PURE__ */ r("p", { className: "text-gray-600 dark:text-gray-400", children: f.message })
|
|
6388
6402
|
] }) }) }) });
|
|
6389
|
-
if (v && !
|
|
6390
|
-
return /* @__PURE__ */ r("div", { className: `metakyc-sdk ${s || ""}`, children: /* @__PURE__ */ r(
|
|
6403
|
+
if (v && !P)
|
|
6404
|
+
return /* @__PURE__ */ r("div", { className: `metakyc-sdk ${s || ""}`, children: /* @__PURE__ */ r(Y, { children: /* @__PURE__ */ r(V, { children: /* @__PURE__ */ o("div", { className: "text-center py-8", children: [
|
|
6391
6405
|
/* @__PURE__ */ r("div", { className: "mb-6", children: /* @__PURE__ */ r("div", { className: "inline-flex items-center justify-center w-16 h-16 rounded-full bg-blue-100 dark:bg-blue-900 mb-4", children: /* @__PURE__ */ r("svg", { className: "w-8 h-8 text-blue-600 dark:text-blue-400", fill: "none", stroke: "currentColor", viewBox: "0 0 24 24", children: /* @__PURE__ */ r("path", { strokeLinecap: "round", strokeLinejoin: "round", strokeWidth: 2, d: "M13 16h-1v-4h-1m1-4h.01M21 12a9 9 0 11-18 0 9 9 0 0118 0z" }) }) }) }),
|
|
6392
6406
|
/* @__PURE__ */ r("h3", { className: "text-xl font-semibold text-gray-900 dark:text-white mb-2", children: "Workflow Transition" }),
|
|
6393
6407
|
/* @__PURE__ */ r("p", { className: "text-gray-600 dark:text-gray-400 mb-6", children: "Your application workflow has been updated based on your progress." }),
|
|
@@ -6408,7 +6422,7 @@ const qe = {
|
|
|
6408
6422
|
/* @__PURE__ */ r(
|
|
6409
6423
|
"button",
|
|
6410
6424
|
{
|
|
6411
|
-
onClick: () =>
|
|
6425
|
+
onClick: () => T(!0),
|
|
6412
6426
|
className: "px-6 py-3 bg-blue-600 hover:bg-blue-700 text-white font-medium rounded-lg transition-colors",
|
|
6413
6427
|
children: "Continue with New Workflow"
|
|
6414
6428
|
}
|
|
@@ -6429,35 +6443,35 @@ const qe = {
|
|
|
6429
6443
|
}
|
|
6430
6444
|
) });
|
|
6431
6445
|
if (!c)
|
|
6432
|
-
return /* @__PURE__ */ r("div", { className: `metakyc-sdk ${s || ""}`, children: /* @__PURE__ */ r(
|
|
6446
|
+
return /* @__PURE__ */ r("div", { className: `metakyc-sdk ${s || ""}`, children: /* @__PURE__ */ r(Y, { children: /* @__PURE__ */ o(V, { children: [
|
|
6433
6447
|
/* @__PURE__ */ r(Se, { className: "my-8" }),
|
|
6434
6448
|
/* @__PURE__ */ r("p", { className: "text-center text-gray-600 dark:text-gray-400 mt-4", children: l.status === Ne.IdentityPending ? "Loading identity verification..." : "Loading current step..." })
|
|
6435
6449
|
] }) }) });
|
|
6436
|
-
const
|
|
6437
|
-
switch (
|
|
6438
|
-
case
|
|
6450
|
+
const R = (F) => {
|
|
6451
|
+
switch (F) {
|
|
6452
|
+
case ee.Overview:
|
|
6439
6453
|
return "Overview";
|
|
6440
|
-
case
|
|
6454
|
+
case ee.Questionaries:
|
|
6441
6455
|
return "Questionnaire";
|
|
6442
|
-
case
|
|
6456
|
+
case ee.UploadDocument:
|
|
6443
6457
|
return "Documents";
|
|
6444
|
-
case
|
|
6458
|
+
case ee.IdentitySdk:
|
|
6445
6459
|
return "Identity";
|
|
6446
|
-
case
|
|
6460
|
+
case ee.RiskScoring:
|
|
6447
6461
|
return "Risk Assessment";
|
|
6448
|
-
case
|
|
6462
|
+
case ee.InvestorCategorization:
|
|
6449
6463
|
return "Investor Categorization";
|
|
6450
|
-
case
|
|
6464
|
+
case ee.AppropriatenessTest:
|
|
6451
6465
|
return "Appropriateness Test";
|
|
6452
|
-
case
|
|
6466
|
+
case ee.AdditionalData:
|
|
6453
6467
|
return "Additional Data";
|
|
6454
|
-
case
|
|
6468
|
+
case ee.ManualReview:
|
|
6455
6469
|
return "Review";
|
|
6456
6470
|
default:
|
|
6457
6471
|
return "";
|
|
6458
6472
|
}
|
|
6459
6473
|
}, O = () => {
|
|
6460
|
-
const
|
|
6474
|
+
const F = u.filter((S) => S.visibility !== !1), K = F.findIndex((S) => S.order === c.order), re = K >= 0 ? K + 1 : 1, B = F.length;
|
|
6461
6475
|
return /* @__PURE__ */ o("div", { className: "mb-6", children: [
|
|
6462
6476
|
/* @__PURE__ */ o("div", { className: "flex items-start justify-between mb-4", children: [
|
|
6463
6477
|
/* @__PURE__ */ r(at, {}),
|
|
@@ -6465,11 +6479,11 @@ const qe = {
|
|
|
6465
6479
|
"Step ",
|
|
6466
6480
|
re,
|
|
6467
6481
|
" of ",
|
|
6468
|
-
|
|
6482
|
+
B
|
|
6469
6483
|
] })
|
|
6470
6484
|
] }),
|
|
6471
|
-
/* @__PURE__ */ r("div", { className: "flex items-center", children:
|
|
6472
|
-
const
|
|
6485
|
+
/* @__PURE__ */ r("div", { className: "flex items-center", children: F.map((S, U) => {
|
|
6486
|
+
const j = U < K, M = S.order === c.order;
|
|
6473
6487
|
return /* @__PURE__ */ o(ve.Fragment, { children: [
|
|
6474
6488
|
/* @__PURE__ */ o("div", { className: "flex items-center", children: [
|
|
6475
6489
|
/* @__PURE__ */ r(
|
|
@@ -6477,7 +6491,7 @@ const qe = {
|
|
|
6477
6491
|
{
|
|
6478
6492
|
className: `
|
|
6479
6493
|
w-8 h-8 rounded-full flex items-center justify-center text-sm font-medium
|
|
6480
|
-
${
|
|
6494
|
+
${j || M ? "bg-primary-500 text-white" : "bg-gray-200 text-gray-600 dark:bg-gray-700 dark:text-gray-400"}
|
|
6481
6495
|
`,
|
|
6482
6496
|
children: U + 1
|
|
6483
6497
|
}
|
|
@@ -6486,21 +6500,21 @@ const qe = {
|
|
|
6486
6500
|
"span",
|
|
6487
6501
|
{
|
|
6488
6502
|
className: `ml-2 text-sm ${M ? "font-semibold text-gray-900 dark:text-white" : "text-gray-600 dark:text-gray-400"}`,
|
|
6489
|
-
children: S.displayName || S.name ||
|
|
6503
|
+
children: S.displayName || S.name || R(S.action) || `Step ${U + 1}`
|
|
6490
6504
|
}
|
|
6491
6505
|
)
|
|
6492
6506
|
] }),
|
|
6493
|
-
U <
|
|
6507
|
+
U < F.length - 1 && /* @__PURE__ */ r(
|
|
6494
6508
|
"div",
|
|
6495
6509
|
{
|
|
6496
|
-
className: `flex-1 h-0.5 mx-4 ${
|
|
6510
|
+
className: `flex-1 h-0.5 mx-4 ${j ? "bg-primary-500" : "bg-gray-200 dark:bg-gray-700"}`
|
|
6497
6511
|
}
|
|
6498
6512
|
)
|
|
6499
6513
|
] }, S.order);
|
|
6500
6514
|
}) })
|
|
6501
6515
|
] });
|
|
6502
|
-
},
|
|
6503
|
-
const
|
|
6516
|
+
}, A = () => {
|
|
6517
|
+
const F = {
|
|
6504
6518
|
applicantId: e,
|
|
6505
6519
|
onComplete: async () => {
|
|
6506
6520
|
await b();
|
|
@@ -6508,22 +6522,22 @@ const qe = {
|
|
|
6508
6522
|
onBack: c.order > 0 ? N : void 0
|
|
6509
6523
|
};
|
|
6510
6524
|
switch (c.action) {
|
|
6511
|
-
case
|
|
6512
|
-
return /* @__PURE__ */ r(
|
|
6513
|
-
case
|
|
6514
|
-
return /* @__PURE__ */ r(_r, { ...
|
|
6515
|
-
case
|
|
6516
|
-
return /* @__PURE__ */ r(Hr, { ...
|
|
6517
|
-
case
|
|
6518
|
-
return /* @__PURE__ */ r(Zr, { ...
|
|
6519
|
-
case
|
|
6520
|
-
return /* @__PURE__ */ r(
|
|
6521
|
-
case
|
|
6522
|
-
case
|
|
6523
|
-
return /* @__PURE__ */ r(Gr, { ...
|
|
6524
|
-
case
|
|
6525
|
-
return /* @__PURE__ */ r(Jr, { ...
|
|
6526
|
-
case
|
|
6525
|
+
case ee.Questionaries:
|
|
6526
|
+
return /* @__PURE__ */ r($r, { ...F });
|
|
6527
|
+
case ee.UploadDocument:
|
|
6528
|
+
return /* @__PURE__ */ r(_r, { ...F });
|
|
6529
|
+
case ee.Overview:
|
|
6530
|
+
return /* @__PURE__ */ r(Hr, { ...F });
|
|
6531
|
+
case ee.IdentitySdk:
|
|
6532
|
+
return /* @__PURE__ */ r(Zr, { ...F });
|
|
6533
|
+
case ee.RiskScoring:
|
|
6534
|
+
return /* @__PURE__ */ r(qr, { ...F });
|
|
6535
|
+
case ee.AdditionalData:
|
|
6536
|
+
case ee.InvestorCategorization:
|
|
6537
|
+
return /* @__PURE__ */ r(Gr, { ...F });
|
|
6538
|
+
case ee.AppropriatenessTest:
|
|
6539
|
+
return /* @__PURE__ */ r(Jr, { ...F });
|
|
6540
|
+
case ee.ManualReview:
|
|
6527
6541
|
return /* @__PURE__ */ r(
|
|
6528
6542
|
mt,
|
|
6529
6543
|
{
|
|
@@ -6534,7 +6548,7 @@ const qe = {
|
|
|
6534
6548
|
}
|
|
6535
6549
|
);
|
|
6536
6550
|
default:
|
|
6537
|
-
return /* @__PURE__ */ r(
|
|
6551
|
+
return /* @__PURE__ */ r(Y, { children: /* @__PURE__ */ o(V, { className: "py-12 text-center", children: [
|
|
6538
6552
|
/* @__PURE__ */ r("div", { className: "mb-4", children: /* @__PURE__ */ r(Se, {}) }),
|
|
6539
6553
|
/* @__PURE__ */ o("p", { className: "text-gray-600 dark:text-gray-400 mb-2", children: [
|
|
6540
6554
|
"Processing step: ",
|
|
@@ -6542,14 +6556,14 @@ const qe = {
|
|
|
6542
6556
|
] }),
|
|
6543
6557
|
/* @__PURE__ */ o("p", { className: "text-sm text-gray-500 dark:text-gray-400", children: [
|
|
6544
6558
|
"Action type: ",
|
|
6545
|
-
|
|
6559
|
+
ee[c.action]
|
|
6546
6560
|
] })
|
|
6547
6561
|
] }) });
|
|
6548
6562
|
}
|
|
6549
6563
|
};
|
|
6550
6564
|
return /* @__PURE__ */ o("div", { className: `metakyc-sdk ${s || ""}`, children: [
|
|
6551
6565
|
O(),
|
|
6552
|
-
|
|
6566
|
+
A()
|
|
6553
6567
|
] });
|
|
6554
6568
|
};
|
|
6555
6569
|
function kn(e) {
|
|
@@ -6611,34 +6625,34 @@ export {
|
|
|
6611
6625
|
Jr as AppropriatenessTestStep,
|
|
6612
6626
|
Re as Badge,
|
|
6613
6627
|
Qt as BaseInformationService,
|
|
6614
|
-
|
|
6615
|
-
|
|
6616
|
-
|
|
6628
|
+
Z as Button,
|
|
6629
|
+
Y as Card,
|
|
6630
|
+
V as CardContent,
|
|
6617
6631
|
ge as CardFooter,
|
|
6618
6632
|
ye as CardHeader,
|
|
6619
|
-
|
|
6633
|
+
Be as CountriesType,
|
|
6620
6634
|
xn as CreateApplicantForm,
|
|
6621
6635
|
Ot as CriteriaBuiltInType,
|
|
6622
|
-
|
|
6623
|
-
|
|
6636
|
+
$t as DEFAULT_VISIBLE_FIELDS,
|
|
6637
|
+
Lt as DocumentReviewStatus,
|
|
6624
6638
|
_t as EndpointBuilder,
|
|
6625
6639
|
Ke as ErrorHandler,
|
|
6626
6640
|
ar as EventEmitter,
|
|
6627
6641
|
Oe as FIELD_METADATA,
|
|
6628
|
-
|
|
6642
|
+
Ft as FileType,
|
|
6629
6643
|
Ir as FileUpload,
|
|
6630
6644
|
Ze as GenderType,
|
|
6631
6645
|
at as Header,
|
|
6632
6646
|
Ht as HttpClient,
|
|
6633
|
-
|
|
6634
|
-
|
|
6647
|
+
$e as IdentityProviderManager,
|
|
6648
|
+
qt as IdentityService,
|
|
6635
6649
|
we as IdentityVerificationProvider,
|
|
6636
6650
|
Zr as IdentityVerificationStep,
|
|
6637
6651
|
he as Input,
|
|
6638
6652
|
Gt as InvestorCategorizationService,
|
|
6639
6653
|
Gr as InvestorCategorizationStep,
|
|
6640
6654
|
xe as InvestorCategorizationType,
|
|
6641
|
-
|
|
6655
|
+
Bt as InvestorCategoryType,
|
|
6642
6656
|
Pt as KycProcessStatus,
|
|
6643
6657
|
De as KycStatus,
|
|
6644
6658
|
mt as KycStatusDisplay,
|
|
@@ -6653,14 +6667,14 @@ export {
|
|
|
6653
6667
|
Hr as OverviewStep,
|
|
6654
6668
|
Ar as PhoneInput,
|
|
6655
6669
|
jt as QuestionnaireService,
|
|
6656
|
-
|
|
6670
|
+
$r as QuestionnaireStep,
|
|
6657
6671
|
Me as ReviewStatus,
|
|
6658
6672
|
Mt as RiskCriteriaType,
|
|
6659
6673
|
At as RiskLevel,
|
|
6660
|
-
|
|
6661
|
-
|
|
6674
|
+
Vt as RiskScoringService,
|
|
6675
|
+
qr as RiskScoringStep,
|
|
6662
6676
|
dr as SardinAIProvider,
|
|
6663
|
-
|
|
6677
|
+
Te as SearchableSelect,
|
|
6664
6678
|
st as Select,
|
|
6665
6679
|
Se as Spinner,
|
|
6666
6680
|
sr as StepRouter,
|
|
@@ -6670,19 +6684,19 @@ export {
|
|
|
6670
6684
|
nr as ThemeService,
|
|
6671
6685
|
Kt as UploadDocumentService,
|
|
6672
6686
|
_r as UploadDocumentStep,
|
|
6673
|
-
|
|
6687
|
+
Tt as UserType,
|
|
6674
6688
|
Ie as ValueDataType,
|
|
6675
6689
|
or as WorkflowOrchestrator,
|
|
6676
6690
|
Je as WorkflowResultType,
|
|
6677
6691
|
ir as WorkflowState,
|
|
6678
|
-
|
|
6692
|
+
ee as WorkflowStepAction,
|
|
6679
6693
|
Cn as appropriatenessTestSchema,
|
|
6680
6694
|
fn as clearAllStorage,
|
|
6681
6695
|
gr as clearApplicantId,
|
|
6682
6696
|
br as clearWorkflowState,
|
|
6683
6697
|
ue as cn,
|
|
6684
6698
|
Jt as corporateTheme,
|
|
6685
|
-
|
|
6699
|
+
zt as defaultConfig,
|
|
6686
6700
|
fe as defaultTheme,
|
|
6687
6701
|
pr as fileToBase64,
|
|
6688
6702
|
Zt as fintechTheme,
|