@vpdev2/metakyc-sdk 1.0.98 → 1.0.99
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/components/steps/AppropriatenessTestStep.d.ts.map +1 -1
- package/dist/index.cjs +4 -4
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +1163 -1084
- package/dist/index.js.map +1 -1
- package/dist/types/appropriateness-test.d.ts +1 -0
- package/dist/types/appropriateness-test.d.ts.map +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -3,12 +3,12 @@ var Bt = (e, t, n) => t in e ? $t(e, t, { enumerable: !0, configurable: !0, writ
|
|
|
3
3
|
var me = (e, t, n) => Bt(e, typeof t != "symbol" ? t + "" : t, n);
|
|
4
4
|
import _t from "axios";
|
|
5
5
|
import * as vt from "react";
|
|
6
|
-
import Fe, { createContext as jt, useState as k, useMemo as Ae, useEffect as ye, useContext as Ht, useRef as le, useCallback as
|
|
7
|
-
import { jsx as r, jsxs as i, Fragment as
|
|
6
|
+
import Fe, { createContext as jt, useState as k, useMemo as Ae, useEffect as ye, useContext as Ht, useRef as le, useCallback as te, forwardRef as lt, createElement as gt } from "react";
|
|
7
|
+
import { jsx as r, jsxs as i, Fragment as rt } from "react/jsx-runtime";
|
|
8
8
|
import Ut, { createPortal as ft } from "react-dom";
|
|
9
9
|
import { useForm as Wt, Controller as qe } from "react-hook-form";
|
|
10
10
|
import { z as _e } from "zod";
|
|
11
|
-
var se = /* @__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))(se || {}), ut = /* @__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))(ut || {}), Te = /* @__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))(Te || {}), Kt = /* @__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))(Kt || {}), qt = /* @__PURE__ */ ((e) => (e[e.LowRisk = 0] = "LowRisk", e[e.MediumRisk = 1] = "MediumRisk", e[e.HighRisk = 2] = "HighRisk", e[e.Alert = 3] = "Alert", e))(qt || {}),
|
|
11
|
+
var se = /* @__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))(se || {}), ut = /* @__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))(ut || {}), Te = /* @__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))(Te || {}), Kt = /* @__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))(Kt || {}), qt = /* @__PURE__ */ ((e) => (e[e.LowRisk = 0] = "LowRisk", e[e.MediumRisk = 1] = "MediumRisk", e[e.HighRisk = 2] = "HighRisk", e[e.Alert = 3] = "Alert", e))(qt || {}), Ye = /* @__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))(Ye || {}), Ve = /* @__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))(Ve || {}), Yt = /* @__PURE__ */ ((e) => (e[e.ProviderResultPending = 0] = "ProviderResultPending", e[e.ProviderResultReceived = 1] = "ProviderResultReceived", e[e.Canceled = 2] = "Canceled", e[e.ExtendedToNewApplicant = 3] = "ExtendedToNewApplicant", e))(Yt || {}), Vt = /* @__PURE__ */ ((e) => (e[e.None = 0] = "None", e[e.ProviderResultPending = 1] = "ProviderResultPending", e[e.ProviderResultReceived = 2] = "ProviderResultReceived", e[e.Canceled = 3] = "Canceled", e))(Vt || {}), Le = /* @__PURE__ */ ((e) => (e[e.Onfido = 0] = "Onfido", e[e.Sumsub = 2] = "Sumsub", e[e.SardinAI = 3] = "SardinAI", e))(Le || {}), Qt = /* @__PURE__ */ ((e) => (e[e.Individual = 0] = "Individual", e[e.Company = 1] = "Company", e))(Qt || {}), pt = /* @__PURE__ */ ((e) => (e[e.Male = 0] = "Male", e[e.Female = 1] = "Female", e[e.Other = 2] = "Other", e))(pt || {}), Gt = /* @__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))(Gt || {}), Jt = /* @__PURE__ */ ((e) => (e[e.Pending = 0] = "Pending", e[e.Approved = 1] = "Approved", e[e.Rejected = 2] = "Rejected", e[e.RequiresRevision = 3] = "RequiresRevision", e))(Jt || {}), Zt = /* @__PURE__ */ ((e) => (e[e.SingleChoice = 0] = "SingleChoice", e[e.MultipleChoice = 1] = "MultipleChoice", e[e.Text = 2] = "Text", e))(Zt || {}), $e = /* @__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))($e || {}), Xt = /* @__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))(Xt || {}), er = /* @__PURE__ */ ((e) => (e[e.None = 0] = "None", e[e.Country = 1] = "Country", e))(er || {}), Ce = /* @__PURE__ */ ((e) => (e[e.Individual = 0] = "Individual", e[e.Sophisticated = 1] = "Sophisticated", e[e.HighNetWorth = 2] = "HighNetWorth", e[e.Business = 3] = "Business", e))(Ce || {}), tr = /* @__PURE__ */ ((e) => (e[e.Retail = 0] = "Retail", e[e.Professional = 1] = "Professional", e[e.EligibleCounterparty = 2] = "EligibleCounterparty", e))(tr || {});
|
|
12
12
|
const Ue = {
|
|
13
13
|
Nationality: 10,
|
|
14
14
|
Address: 20,
|
|
@@ -144,7 +144,7 @@ class Oe extends Error {
|
|
|
144
144
|
this.code = a, this.details = s, this.validationErrors = l, this.name = "MetaKYCError", this.response = c, Object.setPrototypeOf(this, Oe.prototype);
|
|
145
145
|
}
|
|
146
146
|
}
|
|
147
|
-
class
|
|
147
|
+
class at {
|
|
148
148
|
/**
|
|
149
149
|
* Process an error from the API response
|
|
150
150
|
*/
|
|
@@ -235,7 +235,7 @@ class sr {
|
|
|
235
235
|
});
|
|
236
236
|
return this.handleResponse(l);
|
|
237
237
|
} catch (s) {
|
|
238
|
-
throw
|
|
238
|
+
throw at.handleAxiosError(s);
|
|
239
239
|
}
|
|
240
240
|
}
|
|
241
241
|
/**
|
|
@@ -246,7 +246,7 @@ class sr {
|
|
|
246
246
|
const s = this.buildEndpoint(t, n), l = await this.axiosInstance.post(s, a);
|
|
247
247
|
return this.handleResponse(l);
|
|
248
248
|
} catch (s) {
|
|
249
|
-
throw
|
|
249
|
+
throw at.handleAxiosError(s);
|
|
250
250
|
}
|
|
251
251
|
}
|
|
252
252
|
/**
|
|
@@ -257,7 +257,7 @@ class sr {
|
|
|
257
257
|
const s = this.buildEndpoint(t, n), l = await this.axiosInstance.put(s, a);
|
|
258
258
|
return this.handleResponse(l);
|
|
259
259
|
} catch (s) {
|
|
260
|
-
throw
|
|
260
|
+
throw at.handleAxiosError(s);
|
|
261
261
|
}
|
|
262
262
|
}
|
|
263
263
|
/**
|
|
@@ -270,7 +270,7 @@ class sr {
|
|
|
270
270
|
});
|
|
271
271
|
return this.handleResponse(l);
|
|
272
272
|
} catch (s) {
|
|
273
|
-
throw
|
|
273
|
+
throw at.handleAxiosError(s);
|
|
274
274
|
}
|
|
275
275
|
}
|
|
276
276
|
/**
|
|
@@ -279,7 +279,7 @@ class sr {
|
|
|
279
279
|
handleResponse(t) {
|
|
280
280
|
const n = t.data;
|
|
281
281
|
if (!n.success && n.error)
|
|
282
|
-
throw
|
|
282
|
+
throw at.handleApiError(n.error);
|
|
283
283
|
return n;
|
|
284
284
|
}
|
|
285
285
|
/**
|
|
@@ -904,7 +904,7 @@ const Ee = {
|
|
|
904
904
|
[Ne.Modern]: xr,
|
|
905
905
|
[Ne.Minimal]: vr
|
|
906
906
|
};
|
|
907
|
-
function
|
|
907
|
+
function it(e) {
|
|
908
908
|
return kr[e] || Ee;
|
|
909
909
|
}
|
|
910
910
|
class wr {
|
|
@@ -922,8 +922,8 @@ class wr {
|
|
|
922
922
|
"GetThemeConfiguration"
|
|
923
923
|
);
|
|
924
924
|
if (!n.result.isEnabled)
|
|
925
|
-
return
|
|
926
|
-
let a = n.result.preset ?
|
|
925
|
+
return it(Ne.Default);
|
|
926
|
+
let a = n.result.preset ? it(n.result.preset) : it(Ne.Default);
|
|
927
927
|
if (n.result.title && (a.title = n.result.title), n.result.logo && (a.logo = { ...a.logo, ...n.result.logo }), n.result.colors && (a.colors = { ...a.colors, ...n.result.colors }), n.result.typography && (a.typography = { ...a.typography, ...n.result.typography }), n.result.spacing && (a.spacing = { ...a.spacing, ...n.result.spacing }), n.result.customCSS && (a.customCSS = n.result.customCSS), n.result.darkMode && (a.darkMode = {
|
|
928
928
|
colors: {
|
|
929
929
|
...(t = a.darkMode) == null ? void 0 : t.colors,
|
|
@@ -973,7 +973,7 @@ class wr {
|
|
|
973
973
|
}
|
|
974
974
|
return a;
|
|
975
975
|
} catch (n) {
|
|
976
|
-
return console.warn("[ThemeService] Failed to fetch theme configuration:", n),
|
|
976
|
+
return console.warn("[ThemeService] Failed to fetch theme configuration:", n), it(Ne.Default);
|
|
977
977
|
}
|
|
978
978
|
}
|
|
979
979
|
/**
|
|
@@ -999,7 +999,7 @@ class wr {
|
|
|
999
999
|
* Preview theme (doesn't save)
|
|
1000
1000
|
*/
|
|
1001
1001
|
getPreviewTheme(t, n) {
|
|
1002
|
-
const a =
|
|
1002
|
+
const a = it(t);
|
|
1003
1003
|
return n ? {
|
|
1004
1004
|
...a,
|
|
1005
1005
|
...n,
|
|
@@ -1896,19 +1896,19 @@ class Pr {
|
|
|
1896
1896
|
}
|
|
1897
1897
|
const At = jt(null), zn = ({ config: e, children: t }) => {
|
|
1898
1898
|
const [n, a] = k(null), s = Fe.useRef(!1), l = Fe.useRef(!1), c = Ae(() => {
|
|
1899
|
-
const h = new sr(e), m = new or(h),
|
|
1899
|
+
const h = new sr(e), m = new or(h), I = new lr(h), T = new cr(h), R = new dr(h), L = new ur(h), f = new pr(h), S = new mr(h), D = new yr(h), U = new hr(h), W = new wr(h), M = new Pr();
|
|
1900
1900
|
return {
|
|
1901
1901
|
httpClient: h,
|
|
1902
1902
|
applicantService: m,
|
|
1903
|
-
questionnaireService:
|
|
1903
|
+
questionnaireService: I,
|
|
1904
1904
|
uploadDocumentService: T,
|
|
1905
|
-
appropriatenessTestService:
|
|
1905
|
+
appropriatenessTestService: R,
|
|
1906
1906
|
overviewService: L,
|
|
1907
1907
|
riskScoringService: f,
|
|
1908
|
-
identityService:
|
|
1908
|
+
identityService: S,
|
|
1909
1909
|
baseInformationService: D,
|
|
1910
1910
|
investorCategorizationService: U,
|
|
1911
|
-
themeService:
|
|
1911
|
+
themeService: W,
|
|
1912
1912
|
themeManager: M
|
|
1913
1913
|
};
|
|
1914
1914
|
}, [e]), u = Ae(() => ({
|
|
@@ -1987,20 +1987,20 @@ function Bn(e) {
|
|
|
1987
1987
|
function Ie(...e) {
|
|
1988
1988
|
return e.filter(Boolean).join(" ");
|
|
1989
1989
|
}
|
|
1990
|
-
const
|
|
1990
|
+
const nt = {
|
|
1991
1991
|
APPLICANT_ID: "metakyc_applicant_id",
|
|
1992
1992
|
WORKFLOW_STATE: "metakyc_workflow_state"
|
|
1993
1993
|
};
|
|
1994
1994
|
function Tr(e) {
|
|
1995
1995
|
try {
|
|
1996
|
-
localStorage.setItem(
|
|
1996
|
+
localStorage.setItem(nt.APPLICANT_ID, e.toString());
|
|
1997
1997
|
} catch (t) {
|
|
1998
1998
|
console.warn("Failed to save applicant ID to storage:", t);
|
|
1999
1999
|
}
|
|
2000
2000
|
}
|
|
2001
2001
|
function Dr() {
|
|
2002
2002
|
try {
|
|
2003
|
-
const e = localStorage.getItem(
|
|
2003
|
+
const e = localStorage.getItem(nt.APPLICANT_ID);
|
|
2004
2004
|
return e ? parseInt(e, 10) : null;
|
|
2005
2005
|
} catch (e) {
|
|
2006
2006
|
return console.warn("Failed to retrieve applicant ID from storage:", e), null;
|
|
@@ -2008,21 +2008,21 @@ function Dr() {
|
|
|
2008
2008
|
}
|
|
2009
2009
|
function Mr() {
|
|
2010
2010
|
try {
|
|
2011
|
-
localStorage.removeItem(
|
|
2011
|
+
localStorage.removeItem(nt.APPLICANT_ID);
|
|
2012
2012
|
} catch (e) {
|
|
2013
2013
|
console.warn("Failed to clear applicant ID from storage:", e);
|
|
2014
2014
|
}
|
|
2015
2015
|
}
|
|
2016
2016
|
function zr(e) {
|
|
2017
2017
|
try {
|
|
2018
|
-
localStorage.setItem(
|
|
2018
|
+
localStorage.setItem(nt.WORKFLOW_STATE, JSON.stringify(e));
|
|
2019
2019
|
} catch (t) {
|
|
2020
2020
|
console.warn("Failed to save workflow state to storage:", t);
|
|
2021
2021
|
}
|
|
2022
2022
|
}
|
|
2023
2023
|
function _n() {
|
|
2024
2024
|
try {
|
|
2025
|
-
const e = localStorage.getItem(
|
|
2025
|
+
const e = localStorage.getItem(nt.WORKFLOW_STATE);
|
|
2026
2026
|
return e ? JSON.parse(e) : null;
|
|
2027
2027
|
} catch (e) {
|
|
2028
2028
|
return console.warn("Failed to retrieve workflow state from storage:", e), null;
|
|
@@ -2030,7 +2030,7 @@ function _n() {
|
|
|
2030
2030
|
}
|
|
2031
2031
|
function Or() {
|
|
2032
2032
|
try {
|
|
2033
|
-
localStorage.removeItem(
|
|
2033
|
+
localStorage.removeItem(nt.WORKFLOW_STATE);
|
|
2034
2034
|
} catch (e) {
|
|
2035
2035
|
console.warn("Failed to clear workflow state from storage:", e);
|
|
2036
2036
|
}
|
|
@@ -2053,43 +2053,43 @@ function $r(e) {
|
|
|
2053
2053
|
nextWorkflowKey: n.nextWorkflowKey
|
|
2054
2054
|
}));
|
|
2055
2055
|
}, [n, m]);
|
|
2056
|
-
const
|
|
2056
|
+
const I = le(!1), T = le(!1), R = te(async () => {
|
|
2057
2057
|
if (!(!m || !h.current)) {
|
|
2058
|
-
if (
|
|
2058
|
+
if (I.current) {
|
|
2059
2059
|
console.log("[Workflow] Load already in progress, skipping...");
|
|
2060
2060
|
return;
|
|
2061
2061
|
}
|
|
2062
|
-
|
|
2062
|
+
I.current = !0, l(!0), u(null);
|
|
2063
2063
|
try {
|
|
2064
2064
|
const M = await h.current.initialize(m);
|
|
2065
2065
|
a(M), T.current = !0;
|
|
2066
2066
|
} catch (M) {
|
|
2067
2067
|
u(M);
|
|
2068
2068
|
} finally {
|
|
2069
|
-
l(!1),
|
|
2069
|
+
l(!1), I.current = !1;
|
|
2070
2070
|
}
|
|
2071
2071
|
}
|
|
2072
2072
|
}, [m]);
|
|
2073
2073
|
ye(() => {
|
|
2074
|
-
m && !T.current &&
|
|
2075
|
-
}, [m,
|
|
2076
|
-
const L =
|
|
2074
|
+
m && !T.current && R();
|
|
2075
|
+
}, [m, R]);
|
|
2076
|
+
const L = te(async () => {
|
|
2077
2077
|
if (h.current) {
|
|
2078
|
-
if (
|
|
2078
|
+
if (I.current) {
|
|
2079
2079
|
console.log("[Workflow] Refresh already in progress, skipping...");
|
|
2080
2080
|
return;
|
|
2081
2081
|
}
|
|
2082
|
-
|
|
2082
|
+
I.current = !0, l(!0), u(null);
|
|
2083
2083
|
try {
|
|
2084
2084
|
const M = await h.current.refreshProgress();
|
|
2085
2085
|
a(M);
|
|
2086
2086
|
} catch (M) {
|
|
2087
2087
|
u(M);
|
|
2088
2088
|
} finally {
|
|
2089
|
-
l(!1),
|
|
2089
|
+
l(!1), I.current = !1;
|
|
2090
2090
|
}
|
|
2091
2091
|
}
|
|
2092
|
-
}, []), f =
|
|
2092
|
+
}, []), f = te(async () => {
|
|
2093
2093
|
if (h.current) {
|
|
2094
2094
|
l(!0), u(null);
|
|
2095
2095
|
try {
|
|
@@ -2101,7 +2101,7 @@ function $r(e) {
|
|
|
2101
2101
|
l(!1);
|
|
2102
2102
|
}
|
|
2103
2103
|
}
|
|
2104
|
-
}, []),
|
|
2104
|
+
}, []), S = te(async () => {
|
|
2105
2105
|
if (h.current) {
|
|
2106
2106
|
l(!0), u(null);
|
|
2107
2107
|
try {
|
|
@@ -2113,7 +2113,7 @@ function $r(e) {
|
|
|
2113
2113
|
l(!1);
|
|
2114
2114
|
}
|
|
2115
2115
|
}
|
|
2116
|
-
}, []), D =
|
|
2116
|
+
}, []), D = te(async (M) => {
|
|
2117
2117
|
if (h.current) {
|
|
2118
2118
|
l(!0), u(null);
|
|
2119
2119
|
try {
|
|
@@ -2126,7 +2126,7 @@ function $r(e) {
|
|
|
2126
2126
|
l(!1);
|
|
2127
2127
|
}
|
|
2128
2128
|
}
|
|
2129
|
-
}, []), U = vt.useMemo(() => n != null && n.stepInfoList ? [...n.stepInfoList].sort((M, B) => M.order - B.order) : [], [n == null ? void 0 : n.stepInfoList]),
|
|
2129
|
+
}, []), U = vt.useMemo(() => n != null && n.stepInfoList ? [...n.stepInfoList].sort((M, B) => M.order - B.order) : [], [n == null ? void 0 : n.stepInfoList]), W = vt.useMemo(() => n ? n.nextWorkflowKey && n.nextWorkflowKey !== n.workFlowKey : !1, [n]);
|
|
2130
2130
|
return {
|
|
2131
2131
|
progress: n,
|
|
2132
2132
|
applicantId: m,
|
|
@@ -2136,63 +2136,63 @@ function $r(e) {
|
|
|
2136
2136
|
workflowResult: (n == null ? void 0 : n.workflowResult) || null,
|
|
2137
2137
|
workflowKey: n == null ? void 0 : n.workFlowKey,
|
|
2138
2138
|
nextWorkflowKey: n == null ? void 0 : n.nextWorkflowKey,
|
|
2139
|
-
hasWorkflowChanged:
|
|
2139
|
+
hasWorkflowChanged: W,
|
|
2140
2140
|
isLoading: s,
|
|
2141
2141
|
error: c,
|
|
2142
2142
|
isComplete: (n == null ? void 0 : n.status) === Te.Finished,
|
|
2143
2143
|
isOnHold: (n == null ? void 0 : n.status) === Te.OnHold,
|
|
2144
2144
|
refreshProgress: L,
|
|
2145
2145
|
moveToNext: f,
|
|
2146
|
-
moveBack:
|
|
2146
|
+
moveBack: S,
|
|
2147
2147
|
submitCurrentStep: D,
|
|
2148
2148
|
orchestrator: h.current
|
|
2149
2149
|
};
|
|
2150
2150
|
}
|
|
2151
2151
|
function Br(e) {
|
|
2152
|
-
const { questionnaireService: t, applicantService: n } = Re(), [a, s] = k(null), [l, c] = k({}), [u, h] = k(!1), [m,
|
|
2153
|
-
var U,
|
|
2152
|
+
const { questionnaireService: t, applicantService: n } = Re(), [a, s] = k(null), [l, c] = k({}), [u, h] = k(!1), [m, I] = k(!1), [T, R] = k(null), L = le(!1), f = le(null), S = te(async () => {
|
|
2153
|
+
var U, W;
|
|
2154
2154
|
if (e) {
|
|
2155
2155
|
if (L.current) {
|
|
2156
2156
|
console.log("[Questionnaire] Load already in progress, skipping...");
|
|
2157
2157
|
return;
|
|
2158
2158
|
}
|
|
2159
|
-
L.current = !0, h(!0),
|
|
2159
|
+
L.current = !0, h(!0), R(null);
|
|
2160
2160
|
try {
|
|
2161
2161
|
const [M, B] = await Promise.all([
|
|
2162
2162
|
t.getQuestionnaire(e),
|
|
2163
2163
|
n.getApplicantData(e).catch(() => null)
|
|
2164
2164
|
]);
|
|
2165
2165
|
if (s(M), (U = B == null ? void 0 : B.questionnaireResults) != null && U.length && M) {
|
|
2166
|
-
const
|
|
2166
|
+
const G = /* @__PURE__ */ new Map();
|
|
2167
2167
|
for (const b of B.questionnaireResults)
|
|
2168
|
-
b.question && ((
|
|
2169
|
-
const
|
|
2170
|
-
for (const b of
|
|
2171
|
-
const
|
|
2172
|
-
|
|
2168
|
+
b.question && ((W = b.answers) != null && W.length) && G.set(b.question.trim().toLowerCase(), b.answers);
|
|
2169
|
+
const J = {}, F = M.questionGroups.flatMap((b) => b.questions ?? []);
|
|
2170
|
+
for (const b of F) {
|
|
2171
|
+
const $ = b.text.trim().toLowerCase();
|
|
2172
|
+
G.has($) && (J[b.id] = G.get($));
|
|
2173
2173
|
}
|
|
2174
|
-
c(
|
|
2174
|
+
c(J);
|
|
2175
2175
|
}
|
|
2176
2176
|
f.current = e;
|
|
2177
2177
|
} catch (M) {
|
|
2178
|
-
|
|
2178
|
+
R(M);
|
|
2179
2179
|
} finally {
|
|
2180
2180
|
h(!1), L.current = !1;
|
|
2181
2181
|
}
|
|
2182
2182
|
}
|
|
2183
2183
|
}, [e, t, n]);
|
|
2184
2184
|
ye(() => {
|
|
2185
|
-
e && f.current !== e &&
|
|
2185
|
+
e && f.current !== e && S();
|
|
2186
2186
|
}, [e]);
|
|
2187
|
-
const D =
|
|
2187
|
+
const D = te(
|
|
2188
2188
|
async (U) => {
|
|
2189
|
-
|
|
2189
|
+
I(!0), R(null);
|
|
2190
2190
|
try {
|
|
2191
2191
|
return await t.fillQuestionnaire(U);
|
|
2192
|
-
} catch (
|
|
2193
|
-
throw
|
|
2192
|
+
} catch (W) {
|
|
2193
|
+
throw R(W), W;
|
|
2194
2194
|
} finally {
|
|
2195
|
-
|
|
2195
|
+
I(!1);
|
|
2196
2196
|
}
|
|
2197
2197
|
},
|
|
2198
2198
|
[t]
|
|
@@ -2203,32 +2203,32 @@ function Br(e) {
|
|
|
2203
2203
|
isLoading: u,
|
|
2204
2204
|
isSubmitting: m,
|
|
2205
2205
|
error: T,
|
|
2206
|
-
load:
|
|
2206
|
+
load: S,
|
|
2207
2207
|
submit: D
|
|
2208
2208
|
};
|
|
2209
2209
|
}
|
|
2210
2210
|
function _r(e) {
|
|
2211
|
-
const { uploadDocumentService: t } = Re(), [n, a] = k(null), [s, l] = k(!1), [c, u] = k(!1), [h, m] = k(0), [
|
|
2211
|
+
const { uploadDocumentService: t } = Re(), [n, a] = k(null), [s, l] = k(!1), [c, u] = k(!1), [h, m] = k(0), [I, T] = k(null), R = le(!1), L = le(null), f = te(async () => {
|
|
2212
2212
|
if (e) {
|
|
2213
|
-
if (
|
|
2213
|
+
if (R.current) {
|
|
2214
2214
|
console.log("[UploadDocument] Load already in progress, skipping...");
|
|
2215
2215
|
return;
|
|
2216
2216
|
}
|
|
2217
|
-
|
|
2217
|
+
R.current = !0, l(!0), T(null);
|
|
2218
2218
|
try {
|
|
2219
2219
|
const D = await t.getUploadDocument(e);
|
|
2220
2220
|
a(D), L.current = e;
|
|
2221
2221
|
} catch (D) {
|
|
2222
2222
|
T(D);
|
|
2223
2223
|
} finally {
|
|
2224
|
-
l(!1),
|
|
2224
|
+
l(!1), R.current = !1;
|
|
2225
2225
|
}
|
|
2226
2226
|
}
|
|
2227
2227
|
}, [e, t]);
|
|
2228
2228
|
ye(() => {
|
|
2229
2229
|
e && L.current !== e && f();
|
|
2230
2230
|
}, [e]);
|
|
2231
|
-
const
|
|
2231
|
+
const S = te(
|
|
2232
2232
|
async (D) => {
|
|
2233
2233
|
u(!0), m(0), T(null);
|
|
2234
2234
|
try {
|
|
@@ -2246,33 +2246,33 @@ function _r(e) {
|
|
|
2246
2246
|
isLoading: s,
|
|
2247
2247
|
isSubmitting: c,
|
|
2248
2248
|
uploadProgress: h,
|
|
2249
|
-
error:
|
|
2249
|
+
error: I,
|
|
2250
2250
|
load: f,
|
|
2251
|
-
submit:
|
|
2251
|
+
submit: S
|
|
2252
2252
|
};
|
|
2253
2253
|
}
|
|
2254
2254
|
function Hn(e) {
|
|
2255
|
-
const { appropriatenessTestService: t } = Re(), [n, a] = k(null), [s, l] = k(!1), [c, u] = k(!1), [h, m] = k(null), [
|
|
2255
|
+
const { appropriatenessTestService: t } = Re(), [n, a] = k(null), [s, l] = k(!1), [c, u] = k(!1), [h, m] = k(null), [I, T] = k(null), R = le(!1), L = le(null), f = te(async () => {
|
|
2256
2256
|
if (e) {
|
|
2257
|
-
if (
|
|
2257
|
+
if (R.current) {
|
|
2258
2258
|
console.log("[AppropriatenessTest] Load already in progress, skipping...");
|
|
2259
2259
|
return;
|
|
2260
2260
|
}
|
|
2261
|
-
|
|
2261
|
+
R.current = !0, l(!0), m(null);
|
|
2262
2262
|
try {
|
|
2263
2263
|
const D = await t.getAppropriatenessTest(e);
|
|
2264
2264
|
a(D), L.current = e;
|
|
2265
2265
|
} catch (D) {
|
|
2266
2266
|
m(D);
|
|
2267
2267
|
} finally {
|
|
2268
|
-
l(!1),
|
|
2268
|
+
l(!1), R.current = !1;
|
|
2269
2269
|
}
|
|
2270
2270
|
}
|
|
2271
2271
|
}, [e, t]);
|
|
2272
2272
|
ye(() => {
|
|
2273
2273
|
e && L.current !== e && f();
|
|
2274
2274
|
}, [e]);
|
|
2275
|
-
const
|
|
2275
|
+
const S = te(
|
|
2276
2276
|
async (D) => {
|
|
2277
2277
|
u(!0), m(null);
|
|
2278
2278
|
try {
|
|
@@ -2288,36 +2288,36 @@ function Hn(e) {
|
|
|
2288
2288
|
);
|
|
2289
2289
|
return {
|
|
2290
2290
|
test: n,
|
|
2291
|
-
result:
|
|
2291
|
+
result: I,
|
|
2292
2292
|
isLoading: s,
|
|
2293
2293
|
isSubmitting: c,
|
|
2294
2294
|
error: h,
|
|
2295
2295
|
load: f,
|
|
2296
|
-
submit:
|
|
2296
|
+
submit: S
|
|
2297
2297
|
};
|
|
2298
2298
|
}
|
|
2299
2299
|
function jr(e) {
|
|
2300
|
-
const { overviewService: t } = Re(), [n, a] = k(null), [s, l] = k(!1), [c, u] = k(!1), [h, m] = k(null),
|
|
2300
|
+
const { overviewService: t } = Re(), [n, a] = k(null), [s, l] = k(!1), [c, u] = k(!1), [h, m] = k(null), I = le(!1), T = le(null), R = te(async () => {
|
|
2301
2301
|
if (e) {
|
|
2302
|
-
if (
|
|
2302
|
+
if (I.current) {
|
|
2303
2303
|
console.log("[Overview] Load already in progress, skipping...");
|
|
2304
2304
|
return;
|
|
2305
2305
|
}
|
|
2306
|
-
|
|
2306
|
+
I.current = !0, l(!0), m(null);
|
|
2307
2307
|
try {
|
|
2308
2308
|
const f = await t.getOverviewData(e);
|
|
2309
2309
|
a(f), T.current = e;
|
|
2310
2310
|
} catch (f) {
|
|
2311
2311
|
m(f);
|
|
2312
2312
|
} finally {
|
|
2313
|
-
l(!1),
|
|
2313
|
+
l(!1), I.current = !1;
|
|
2314
2314
|
}
|
|
2315
2315
|
}
|
|
2316
2316
|
}, [e, t]);
|
|
2317
2317
|
ye(() => {
|
|
2318
|
-
e && T.current !== e &&
|
|
2318
|
+
e && T.current !== e && R();
|
|
2319
2319
|
}, [e]);
|
|
2320
|
-
const L =
|
|
2320
|
+
const L = te(async () => {
|
|
2321
2321
|
if (e) {
|
|
2322
2322
|
u(!0), m(null);
|
|
2323
2323
|
try {
|
|
@@ -2334,15 +2334,15 @@ function jr(e) {
|
|
|
2334
2334
|
isLoading: s,
|
|
2335
2335
|
isSubmitting: c,
|
|
2336
2336
|
error: h,
|
|
2337
|
-
load:
|
|
2337
|
+
load: R,
|
|
2338
2338
|
passOverview: L
|
|
2339
2339
|
};
|
|
2340
2340
|
}
|
|
2341
2341
|
function Hr(e) {
|
|
2342
2342
|
const { identityService: t } = Re(), [n, a] = k(
|
|
2343
2343
|
null
|
|
2344
|
-
), [s, l] = k(!1), [c, u] = k(null), h = le(!1), m =
|
|
2345
|
-
async (
|
|
2344
|
+
), [s, l] = k(!1), [c, u] = k(null), h = le(!1), m = te(
|
|
2345
|
+
async (R, L) => {
|
|
2346
2346
|
if (e) {
|
|
2347
2347
|
if (h.current) {
|
|
2348
2348
|
console.log("[Identity] Request already in progress, skipping...");
|
|
@@ -2353,13 +2353,13 @@ function Hr(e) {
|
|
|
2353
2353
|
const f = {
|
|
2354
2354
|
applicantId: e,
|
|
2355
2355
|
restart: !1,
|
|
2356
|
-
redirectUrl:
|
|
2356
|
+
redirectUrl: R || "",
|
|
2357
2357
|
ttl: L || 604800
|
|
2358
2358
|
// Default: 7 days
|
|
2359
2359
|
};
|
|
2360
2360
|
console.log("Identity request input:", f);
|
|
2361
|
-
const
|
|
2362
|
-
return console.log("Identity request result:",
|
|
2361
|
+
const S = await t.identityRequest(f);
|
|
2362
|
+
return console.log("Identity request result:", S), a(S), S;
|
|
2363
2363
|
} catch (f) {
|
|
2364
2364
|
throw u(f), f;
|
|
2365
2365
|
} finally {
|
|
@@ -2368,18 +2368,18 @@ function Hr(e) {
|
|
|
2368
2368
|
}
|
|
2369
2369
|
},
|
|
2370
2370
|
[e, t]
|
|
2371
|
-
),
|
|
2372
|
-
async (
|
|
2371
|
+
), I = te(
|
|
2372
|
+
async (R, L) => {
|
|
2373
2373
|
if (e) {
|
|
2374
2374
|
l(!0), u(null);
|
|
2375
2375
|
try {
|
|
2376
2376
|
const f = {
|
|
2377
2377
|
applicantId: e,
|
|
2378
2378
|
restart: !1,
|
|
2379
|
-
redirectUrl:
|
|
2379
|
+
redirectUrl: R,
|
|
2380
2380
|
ttl: L
|
|
2381
|
-
},
|
|
2382
|
-
return a(
|
|
2381
|
+
}, S = await t.identityCompanyRequest(f);
|
|
2382
|
+
return a(S), S;
|
|
2383
2383
|
} catch (f) {
|
|
2384
2384
|
throw u(f), f;
|
|
2385
2385
|
} finally {
|
|
@@ -2388,7 +2388,7 @@ function Hr(e) {
|
|
|
2388
2388
|
}
|
|
2389
2389
|
},
|
|
2390
2390
|
[e, t]
|
|
2391
|
-
), T =
|
|
2391
|
+
), T = te(async () => {
|
|
2392
2392
|
if (e) {
|
|
2393
2393
|
if (h.current) {
|
|
2394
2394
|
console.log("[Identity] Restart already in progress, skipping...");
|
|
@@ -2396,18 +2396,18 @@ function Hr(e) {
|
|
|
2396
2396
|
}
|
|
2397
2397
|
h.current = !0, l(!0), u(null);
|
|
2398
2398
|
try {
|
|
2399
|
-
const
|
|
2399
|
+
const R = {
|
|
2400
2400
|
applicantId: e,
|
|
2401
2401
|
restart: !0,
|
|
2402
2402
|
redirectUrl: "",
|
|
2403
2403
|
ttl: 604800
|
|
2404
2404
|
// 7 days
|
|
2405
2405
|
};
|
|
2406
|
-
console.log("Restarting identity with input:",
|
|
2407
|
-
const L = await t.identityRequest(
|
|
2406
|
+
console.log("Restarting identity with input:", R);
|
|
2407
|
+
const L = await t.identityRequest(R);
|
|
2408
2408
|
return console.log("Restart identity result:", L), a(L), L;
|
|
2409
|
-
} catch (
|
|
2410
|
-
throw u(
|
|
2409
|
+
} catch (R) {
|
|
2410
|
+
throw u(R), R;
|
|
2411
2411
|
} finally {
|
|
2412
2412
|
l(!1), h.current = !1;
|
|
2413
2413
|
}
|
|
@@ -2420,56 +2420,56 @@ function Hr(e) {
|
|
|
2420
2420
|
isLoading: s,
|
|
2421
2421
|
error: c,
|
|
2422
2422
|
requestIdentity: m,
|
|
2423
|
-
requestCompanyIdentity:
|
|
2423
|
+
requestCompanyIdentity: I,
|
|
2424
2424
|
restartIdentity: T
|
|
2425
2425
|
};
|
|
2426
2426
|
}
|
|
2427
2427
|
function Ur(e) {
|
|
2428
|
-
const { riskScoringService: t, applicantService: n } = Re(), [a, s] = k(null), [l, c] = k({}), [u, h] = k(!1), [m,
|
|
2428
|
+
const { riskScoringService: t, applicantService: n } = Re(), [a, s] = k(null), [l, c] = k({}), [u, h] = k(!1), [m, I] = k(!1), [T, R] = k(null), [L, f] = k(null), S = le(!1), D = le(null), U = te(async () => {
|
|
2429
2429
|
var M;
|
|
2430
2430
|
if (e) {
|
|
2431
|
-
if (
|
|
2431
|
+
if (S.current) {
|
|
2432
2432
|
console.log("[RiskScoring] Load already in progress, skipping...");
|
|
2433
2433
|
return;
|
|
2434
2434
|
}
|
|
2435
|
-
|
|
2435
|
+
S.current = !0, h(!0), R(null);
|
|
2436
2436
|
try {
|
|
2437
|
-
const [B,
|
|
2437
|
+
const [B, G] = await Promise.all([
|
|
2438
2438
|
t.getRiskCriterias(e),
|
|
2439
2439
|
n.getApplicantData(e).catch(() => null)
|
|
2440
2440
|
]);
|
|
2441
|
-
if (s(B), (M =
|
|
2442
|
-
const
|
|
2443
|
-
for (const b of
|
|
2441
|
+
if (s(B), (M = G == null ? void 0 : G.riskScoringResults) != null && M.length) {
|
|
2442
|
+
const J = G.riskScoringResults[0], F = {};
|
|
2443
|
+
for (const b of J.riskCriteriaResults ?? [])
|
|
2444
2444
|
if (b.riskCriteriaId != null && b.answer != null && b.answer !== "") {
|
|
2445
|
-
const
|
|
2445
|
+
const $ = [...new Set(
|
|
2446
2446
|
b.answer.split(",").map((H) => H.trim()).filter((H) => H !== "")
|
|
2447
2447
|
)];
|
|
2448
|
-
|
|
2448
|
+
$.length > 0 && (F[b.riskCriteriaId] = $);
|
|
2449
2449
|
}
|
|
2450
|
-
c(
|
|
2450
|
+
c(F);
|
|
2451
2451
|
}
|
|
2452
2452
|
D.current = e;
|
|
2453
2453
|
} catch (B) {
|
|
2454
|
-
|
|
2454
|
+
R(B);
|
|
2455
2455
|
} finally {
|
|
2456
|
-
h(!1),
|
|
2456
|
+
h(!1), S.current = !1;
|
|
2457
2457
|
}
|
|
2458
2458
|
}
|
|
2459
2459
|
}, [e, t, n]);
|
|
2460
2460
|
ye(() => {
|
|
2461
2461
|
e && D.current !== e && U();
|
|
2462
2462
|
}, [e]);
|
|
2463
|
-
const
|
|
2463
|
+
const W = te(
|
|
2464
2464
|
async (M) => {
|
|
2465
|
-
|
|
2465
|
+
I(!0), R(null);
|
|
2466
2466
|
try {
|
|
2467
2467
|
const B = await t.submitRiskScoring(M);
|
|
2468
2468
|
return f(B), B;
|
|
2469
2469
|
} catch (B) {
|
|
2470
|
-
throw
|
|
2470
|
+
throw R(B), B;
|
|
2471
2471
|
} finally {
|
|
2472
|
-
|
|
2472
|
+
I(!1);
|
|
2473
2473
|
}
|
|
2474
2474
|
},
|
|
2475
2475
|
[t]
|
|
@@ -2482,14 +2482,14 @@ function Ur(e) {
|
|
|
2482
2482
|
isSubmitting: m,
|
|
2483
2483
|
error: T,
|
|
2484
2484
|
load: U,
|
|
2485
|
-
submit:
|
|
2485
|
+
submit: W
|
|
2486
2486
|
};
|
|
2487
2487
|
}
|
|
2488
2488
|
function Pt() {
|
|
2489
2489
|
const { applicantService: e, config: t } = Re(), [n, a] = k(!1), [s, l] = k(null), c = le(!1), u = le(!1), h = () => "xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g, function(L) {
|
|
2490
2490
|
const f = Math.random() * 16 | 0;
|
|
2491
2491
|
return (L === "x" ? f : f & 3 | 8).toString(16);
|
|
2492
|
-
}), m =
|
|
2492
|
+
}), m = te(
|
|
2493
2493
|
async (L) => {
|
|
2494
2494
|
var f;
|
|
2495
2495
|
if (c.current)
|
|
@@ -2504,14 +2504,14 @@ function Pt() {
|
|
|
2504
2504
|
});
|
|
2505
2505
|
}
|
|
2506
2506
|
return await e.createApplicant(L);
|
|
2507
|
-
} catch (
|
|
2508
|
-
throw l(
|
|
2507
|
+
} catch (S) {
|
|
2508
|
+
throw l(S), S;
|
|
2509
2509
|
} finally {
|
|
2510
2510
|
a(!1), c.current = !1;
|
|
2511
2511
|
}
|
|
2512
2512
|
},
|
|
2513
2513
|
[e, t]
|
|
2514
|
-
),
|
|
2514
|
+
), I = te(
|
|
2515
2515
|
async (L) => {
|
|
2516
2516
|
a(!0), l(null);
|
|
2517
2517
|
try {
|
|
@@ -2523,7 +2523,7 @@ function Pt() {
|
|
|
2523
2523
|
}
|
|
2524
2524
|
},
|
|
2525
2525
|
[e]
|
|
2526
|
-
), T =
|
|
2526
|
+
), T = te(
|
|
2527
2527
|
async (L) => {
|
|
2528
2528
|
if (u.current)
|
|
2529
2529
|
throw console.log("[Applicant] Data load already in progress, skipping..."), new Error("Data load already in progress");
|
|
@@ -2537,7 +2537,7 @@ function Pt() {
|
|
|
2537
2537
|
}
|
|
2538
2538
|
},
|
|
2539
2539
|
[e]
|
|
2540
|
-
),
|
|
2540
|
+
), R = te(
|
|
2541
2541
|
async (L) => {
|
|
2542
2542
|
a(!0), l(null);
|
|
2543
2543
|
try {
|
|
@@ -2554,9 +2554,9 @@ function Pt() {
|
|
|
2554
2554
|
isLoading: n,
|
|
2555
2555
|
error: s,
|
|
2556
2556
|
createApplicant: m,
|
|
2557
|
-
createCompanyApplicant:
|
|
2557
|
+
createCompanyApplicant: I,
|
|
2558
2558
|
getApplicantData: T,
|
|
2559
|
-
stopProgress:
|
|
2559
|
+
stopProgress: R
|
|
2560
2560
|
};
|
|
2561
2561
|
}
|
|
2562
2562
|
const Wr = {
|
|
@@ -2585,7 +2585,7 @@ const Wr = {
|
|
|
2585
2585
|
color: "var(--metakyc-text-secondary, #6b7280)",
|
|
2586
2586
|
borderColor: "transparent"
|
|
2587
2587
|
}
|
|
2588
|
-
},
|
|
2588
|
+
}, V = ({
|
|
2589
2589
|
children: e,
|
|
2590
2590
|
variant: t = "primary",
|
|
2591
2591
|
size: n = "md",
|
|
@@ -2683,7 +2683,7 @@ const Wr = {
|
|
|
2683
2683
|
] })
|
|
2684
2684
|
);
|
|
2685
2685
|
fe.displayName = "Input";
|
|
2686
|
-
const
|
|
2686
|
+
const X = ({ children: e, className: t, ...n }) => /* @__PURE__ */ r(
|
|
2687
2687
|
"div",
|
|
2688
2688
|
{
|
|
2689
2689
|
className: Ie(
|
|
@@ -2707,7 +2707,7 @@ const ee = ({ children: e, className: t, ...n }) => /* @__PURE__ */ r(
|
|
|
2707
2707
|
...n,
|
|
2708
2708
|
children: e
|
|
2709
2709
|
}
|
|
2710
|
-
),
|
|
2710
|
+
), ee = ({ children: e, className: t, ...n }) => /* @__PURE__ */ r("div", { className: Ie("px-6 py-4", t), ...n, children: e }), xe = ({ children: e, className: t, ...n }) => /* @__PURE__ */ r(
|
|
2711
2711
|
"div",
|
|
2712
2712
|
{
|
|
2713
2713
|
className: Ie("px-6 py-4 border-t", t),
|
|
@@ -2832,7 +2832,7 @@ const ee = ({ children: e, className: t, ...n }) => /* @__PURE__ */ r(
|
|
|
2832
2832
|
},
|
|
2833
2833
|
"__placeholder__"
|
|
2834
2834
|
),
|
|
2835
|
-
a.map((m,
|
|
2835
|
+
a.map((m, I) => /* @__PURE__ */ r(
|
|
2836
2836
|
"option",
|
|
2837
2837
|
{
|
|
2838
2838
|
value: m.value,
|
|
@@ -2843,7 +2843,7 @@ const ee = ({ children: e, className: t, ...n }) => /* @__PURE__ */ r(
|
|
|
2843
2843
|
},
|
|
2844
2844
|
children: m.label
|
|
2845
2845
|
},
|
|
2846
|
-
m.value || `option-${
|
|
2846
|
+
m.value || `option-${I}`
|
|
2847
2847
|
))
|
|
2848
2848
|
]
|
|
2849
2849
|
}
|
|
@@ -2862,7 +2862,7 @@ const wt = 280, qr = ({
|
|
|
2862
2862
|
disabled: l = !1,
|
|
2863
2863
|
required: c = !1
|
|
2864
2864
|
}) => {
|
|
2865
|
-
const [u, h] = k(!1), [m,
|
|
2865
|
+
const [u, h] = k(!1), [m, I] = k(""), [T, R] = k(null), [L, f] = k({
|
|
2866
2866
|
bg: "#ffffff",
|
|
2867
2867
|
borderColor: "#d1d5db",
|
|
2868
2868
|
textPrimary: "#111827",
|
|
@@ -2870,57 +2870,57 @@ const wt = 280, qr = ({
|
|
|
2870
2870
|
primaryColor: "#2563eb",
|
|
2871
2871
|
primaryLight: "#eff6ff",
|
|
2872
2872
|
hoverBg: "#f9fafb"
|
|
2873
|
-
}),
|
|
2873
|
+
}), S = le(null), D = le(null), U = le(null), W = te(() => {
|
|
2874
2874
|
if (!D.current) return null;
|
|
2875
|
-
const P = D.current.getBoundingClientRect(),
|
|
2876
|
-
return { top:
|
|
2877
|
-
}, []), M =
|
|
2878
|
-
const P = getComputedStyle(document.documentElement),
|
|
2875
|
+
const P = D.current.getBoundingClientRect(), Z = window.innerHeight - P.bottom < wt && P.top > wt;
|
|
2876
|
+
return { top: Z ? P.top : P.bottom + 4, left: P.left, width: P.width, openUp: Z };
|
|
2877
|
+
}, []), M = te(() => {
|
|
2878
|
+
const P = getComputedStyle(document.documentElement), K = (ue, j) => P.getPropertyValue(ue).trim() || j, Z = K("--metakyc-input-bg", K("--metakyc-background", "#ffffff"));
|
|
2879
2879
|
f({
|
|
2880
|
-
bg:
|
|
2881
|
-
borderColor:
|
|
2882
|
-
textPrimary:
|
|
2883
|
-
textSecondary:
|
|
2884
|
-
primaryColor:
|
|
2885
|
-
primaryLight:
|
|
2886
|
-
hoverBg:
|
|
2880
|
+
bg: Z,
|
|
2881
|
+
borderColor: K("--metakyc-input-border", K("--metakyc-border", "#d1d5db")),
|
|
2882
|
+
textPrimary: K("--metakyc-input-text", K("--metakyc-text-primary", "#111827")),
|
|
2883
|
+
textSecondary: K("--metakyc-text-secondary", "#6b7280"),
|
|
2884
|
+
primaryColor: K("--metakyc-primary", "#2563eb"),
|
|
2885
|
+
primaryLight: K("--metakyc-primary-light", "#eff6ff"),
|
|
2886
|
+
hoverBg: K("--metakyc-surface", Z)
|
|
2887
2887
|
});
|
|
2888
|
-
}, []), B =
|
|
2888
|
+
}, []), B = te(() => {
|
|
2889
2889
|
if (l) return;
|
|
2890
2890
|
M();
|
|
2891
|
-
const P =
|
|
2892
|
-
P &&
|
|
2893
|
-
}, [l,
|
|
2894
|
-
h(!1),
|
|
2891
|
+
const P = W();
|
|
2892
|
+
P && R(P), h(!0);
|
|
2893
|
+
}, [l, W, M]), G = te(() => {
|
|
2894
|
+
h(!1), I("");
|
|
2895
2895
|
}, []);
|
|
2896
2896
|
ye(() => {
|
|
2897
2897
|
if (!u) return;
|
|
2898
|
-
const P = (
|
|
2899
|
-
var
|
|
2900
|
-
const
|
|
2901
|
-
!((
|
|
2898
|
+
const P = (K) => {
|
|
2899
|
+
var ue, j;
|
|
2900
|
+
const Z = K.target;
|
|
2901
|
+
!((ue = S.current) != null && ue.contains(Z)) && !((j = U.current) != null && j.contains(Z)) && G();
|
|
2902
2902
|
};
|
|
2903
2903
|
return document.addEventListener("mousedown", P), () => document.removeEventListener("mousedown", P);
|
|
2904
|
-
}, [u,
|
|
2904
|
+
}, [u, G]), ye(() => {
|
|
2905
2905
|
if (!u) return;
|
|
2906
2906
|
const P = () => {
|
|
2907
|
-
const
|
|
2908
|
-
|
|
2907
|
+
const K = W();
|
|
2908
|
+
K && R(K);
|
|
2909
2909
|
};
|
|
2910
2910
|
return window.addEventListener("scroll", P, !0), window.addEventListener("resize", P), () => {
|
|
2911
2911
|
window.removeEventListener("scroll", P, !0), window.removeEventListener("resize", P);
|
|
2912
2912
|
};
|
|
2913
|
-
}, [u,
|
|
2914
|
-
const
|
|
2913
|
+
}, [u, W]);
|
|
2914
|
+
const J = a.filter(
|
|
2915
2915
|
(P) => P.label.toLowerCase().includes(m.toLowerCase())
|
|
2916
|
-
),
|
|
2917
|
-
l || n(t.includes(P) ? t.filter((
|
|
2918
|
-
}, b = (P,
|
|
2919
|
-
|
|
2920
|
-
},
|
|
2921
|
-
var
|
|
2922
|
-
return ((
|
|
2923
|
-
}, { bg: H, borderColor: z, textPrimary: O, textSecondary:
|
|
2916
|
+
), F = (P) => {
|
|
2917
|
+
l || n(t.includes(P) ? t.filter((K) => K !== P) : [...t, P]);
|
|
2918
|
+
}, b = (P, K) => {
|
|
2919
|
+
K.stopPropagation(), l || n(t.filter((Z) => Z !== P));
|
|
2920
|
+
}, $ = (P) => {
|
|
2921
|
+
var K;
|
|
2922
|
+
return ((K = a.find((Z) => Z.value === P)) == null ? void 0 : K.label) || P;
|
|
2923
|
+
}, { bg: H, borderColor: z, textPrimary: O, textSecondary: ne, primaryColor: ae, primaryLight: re, hoverBg: he } = L, de = u && T && /* @__PURE__ */ i(
|
|
2924
2924
|
"div",
|
|
2925
2925
|
{
|
|
2926
2926
|
ref: U,
|
|
@@ -2944,7 +2944,7 @@ const wt = 280, qr = ({
|
|
|
2944
2944
|
{
|
|
2945
2945
|
type: "text",
|
|
2946
2946
|
value: m,
|
|
2947
|
-
onChange: (P) =>
|
|
2947
|
+
onChange: (P) => I(P.target.value),
|
|
2948
2948
|
placeholder: "Search...",
|
|
2949
2949
|
autoFocus: !0,
|
|
2950
2950
|
onClick: (P) => P.stopPropagation(),
|
|
@@ -2962,20 +2962,20 @@ const wt = 280, qr = ({
|
|
|
2962
2962
|
boxSizing: "border-box"
|
|
2963
2963
|
},
|
|
2964
2964
|
onFocus: (P) => {
|
|
2965
|
-
const
|
|
2966
|
-
P.currentTarget.style.backgroundColor = H, P.currentTarget.style.color = O, P.currentTarget.style.borderColor =
|
|
2965
|
+
const K = getComputedStyle(document.documentElement), Z = K.getPropertyValue("--metakyc-input-border-focus").trim() || K.getPropertyValue("--metakyc-primary").trim() || "#2563eb";
|
|
2966
|
+
P.currentTarget.style.backgroundColor = H, P.currentTarget.style.color = O, P.currentTarget.style.borderColor = Z, P.currentTarget.style.outline = "none", P.currentTarget.style.boxShadow = `0 0 0 2px ${Z}33`;
|
|
2967
2967
|
},
|
|
2968
2968
|
onBlur: (P) => {
|
|
2969
2969
|
P.currentTarget.style.backgroundColor = H, P.currentTarget.style.color = O, P.currentTarget.style.borderColor = z, P.currentTarget.style.outline = "none", P.currentTarget.style.boxShadow = "none";
|
|
2970
2970
|
}
|
|
2971
2971
|
}
|
|
2972
2972
|
) }),
|
|
2973
|
-
/* @__PURE__ */ r("ul", { style: { listStyle: "none", margin: 0, padding: "4px 0", maxHeight: "192px", overflowY: "auto" }, children:
|
|
2974
|
-
const
|
|
2973
|
+
/* @__PURE__ */ r("ul", { style: { listStyle: "none", margin: 0, padding: "4px 0", maxHeight: "192px", overflowY: "auto" }, children: J.length === 0 ? /* @__PURE__ */ r("li", { style: { padding: "8px 12px", fontSize: "13px", color: ne }, children: "No results" }) : J.map((P) => {
|
|
2974
|
+
const K = t.includes(P.value);
|
|
2975
2975
|
return /* @__PURE__ */ i(
|
|
2976
2976
|
"li",
|
|
2977
2977
|
{
|
|
2978
|
-
onClick: () =>
|
|
2978
|
+
onClick: () => F(P.value),
|
|
2979
2979
|
className: "metakyc-multiselect-option",
|
|
2980
2980
|
style: {
|
|
2981
2981
|
display: "flex",
|
|
@@ -2984,24 +2984,24 @@ const wt = 280, qr = ({
|
|
|
2984
2984
|
padding: "8px 12px",
|
|
2985
2985
|
fontSize: "13px",
|
|
2986
2986
|
cursor: "pointer",
|
|
2987
|
-
backgroundColor:
|
|
2988
|
-
color:
|
|
2987
|
+
backgroundColor: K ? re : "transparent",
|
|
2988
|
+
color: K ? ae : O,
|
|
2989
2989
|
userSelect: "none"
|
|
2990
2990
|
},
|
|
2991
|
-
onMouseEnter: (
|
|
2992
|
-
|
|
2991
|
+
onMouseEnter: (Z) => {
|
|
2992
|
+
K || (Z.currentTarget.style.backgroundColor = he);
|
|
2993
2993
|
},
|
|
2994
|
-
onMouseLeave: (
|
|
2995
|
-
|
|
2994
|
+
onMouseLeave: (Z) => {
|
|
2995
|
+
K || (Z.currentTarget.style.backgroundColor = "transparent");
|
|
2996
2996
|
},
|
|
2997
2997
|
children: [
|
|
2998
2998
|
/* @__PURE__ */ r(
|
|
2999
2999
|
"input",
|
|
3000
3000
|
{
|
|
3001
3001
|
type: "checkbox",
|
|
3002
|
-
checked:
|
|
3002
|
+
checked: K,
|
|
3003
3003
|
readOnly: !0,
|
|
3004
|
-
style: { accentColor:
|
|
3004
|
+
style: { accentColor: ae, pointerEvents: "none", flexShrink: 0 }
|
|
3005
3005
|
}
|
|
3006
3006
|
),
|
|
3007
3007
|
/* @__PURE__ */ r("span", { children: P.label })
|
|
@@ -3015,7 +3015,7 @@ const wt = 280, qr = ({
|
|
|
3015
3015
|
{
|
|
3016
3016
|
type: "button",
|
|
3017
3017
|
onClick: () => {
|
|
3018
|
-
n([]),
|
|
3018
|
+
n([]), I("");
|
|
3019
3019
|
},
|
|
3020
3020
|
style: { fontSize: "12px", color: "#ef4444", background: "none", border: "none", cursor: "pointer", padding: 0 },
|
|
3021
3021
|
children: [
|
|
@@ -3028,7 +3028,7 @@ const wt = 280, qr = ({
|
|
|
3028
3028
|
]
|
|
3029
3029
|
}
|
|
3030
3030
|
);
|
|
3031
|
-
return /* @__PURE__ */ i("div", { className: "w-full metakyc-multiselect", ref:
|
|
3031
|
+
return /* @__PURE__ */ i("div", { className: "w-full metakyc-multiselect", ref: S, children: [
|
|
3032
3032
|
e && /* @__PURE__ */ i(
|
|
3033
3033
|
"label",
|
|
3034
3034
|
{
|
|
@@ -3044,7 +3044,7 @@ const wt = 280, qr = ({
|
|
|
3044
3044
|
"div",
|
|
3045
3045
|
{
|
|
3046
3046
|
ref: D,
|
|
3047
|
-
onClick: () => u ?
|
|
3047
|
+
onClick: () => u ? G() : B(),
|
|
3048
3048
|
className: Ie(
|
|
3049
3049
|
"metakyc-multiselect-trigger",
|
|
3050
3050
|
"min-h-[42px] w-full px-3 py-2 rounded-lg border text-sm transition-colors relative",
|
|
@@ -3073,12 +3073,12 @@ const wt = 280, qr = ({
|
|
|
3073
3073
|
color: "var(--metakyc-primary, #2563eb)"
|
|
3074
3074
|
},
|
|
3075
3075
|
children: [
|
|
3076
|
-
|
|
3076
|
+
$(P),
|
|
3077
3077
|
!l && /* @__PURE__ */ r(
|
|
3078
3078
|
"button",
|
|
3079
3079
|
{
|
|
3080
3080
|
type: "button",
|
|
3081
|
-
onClick: (
|
|
3081
|
+
onClick: (K) => b(P, K),
|
|
3082
3082
|
className: "metakyc-multiselect-chip-remove",
|
|
3083
3083
|
style: {
|
|
3084
3084
|
background: "transparent",
|
|
@@ -3117,7 +3117,7 @@ const wt = 280, qr = ({
|
|
|
3117
3117
|
]
|
|
3118
3118
|
}
|
|
3119
3119
|
),
|
|
3120
|
-
typeof document < "u" &&
|
|
3120
|
+
typeof document < "u" && de ? ft(de, document.body) : null
|
|
3121
3121
|
] });
|
|
3122
3122
|
}, St = 260, Be = ({
|
|
3123
3123
|
label: e,
|
|
@@ -3131,8 +3131,8 @@ const wt = 280, qr = ({
|
|
|
3131
3131
|
required: h = !1,
|
|
3132
3132
|
className: m
|
|
3133
3133
|
}) => {
|
|
3134
|
-
var
|
|
3135
|
-
const [
|
|
3134
|
+
var j;
|
|
3135
|
+
const [I, T] = k(!1), [R, L] = k(""), [f, S] = k(null), [D, U] = k({
|
|
3136
3136
|
bg: "#ffffff",
|
|
3137
3137
|
border: "#d1d5db",
|
|
3138
3138
|
text: "#111827",
|
|
@@ -3140,65 +3140,65 @@ const wt = 280, qr = ({
|
|
|
3140
3140
|
primary: "#2563eb",
|
|
3141
3141
|
primaryLight: "#eff6ff",
|
|
3142
3142
|
hoverBg: "#f9fafb"
|
|
3143
|
-
}),
|
|
3144
|
-
const
|
|
3143
|
+
}), W = te(() => {
|
|
3144
|
+
const x = getComputedStyle(document.documentElement), Q = (ce, we) => x.getPropertyValue(ce).trim() || we, Y = Q("--metakyc-input-bg", Q("--metakyc-background", "#ffffff"));
|
|
3145
3145
|
U({
|
|
3146
|
-
bg:
|
|
3147
|
-
border:
|
|
3148
|
-
text:
|
|
3149
|
-
textSecondary:
|
|
3150
|
-
primary:
|
|
3151
|
-
primaryLight:
|
|
3152
|
-
hoverBg:
|
|
3146
|
+
bg: Y,
|
|
3147
|
+
border: Q("--metakyc-input-border", Q("--metakyc-border", "#d1d5db")),
|
|
3148
|
+
text: Q("--metakyc-input-text", Q("--metakyc-text-primary", "#111827")),
|
|
3149
|
+
textSecondary: Q("--metakyc-text-secondary", "#6b7280"),
|
|
3150
|
+
primary: Q("--metakyc-primary", "#2563eb"),
|
|
3151
|
+
primaryLight: Q("--metakyc-primary-light", "#eff6ff"),
|
|
3152
|
+
hoverBg: Q("--metakyc-surface", Y)
|
|
3153
3153
|
});
|
|
3154
|
-
}, []), M = le(null), B = le(null),
|
|
3154
|
+
}, []), M = le(null), B = le(null), G = le(null), J = le(null), F = te(() => {
|
|
3155
3155
|
if (!B.current) return null;
|
|
3156
|
-
const
|
|
3156
|
+
const x = B.current.getBoundingClientRect(), Y = window.innerHeight - x.bottom < St && x.top > St;
|
|
3157
3157
|
return {
|
|
3158
|
-
top:
|
|
3159
|
-
left:
|
|
3160
|
-
width:
|
|
3161
|
-
openUp:
|
|
3158
|
+
top: Y ? x.top : x.bottom + 4,
|
|
3159
|
+
left: x.left,
|
|
3160
|
+
width: x.width,
|
|
3161
|
+
openUp: Y
|
|
3162
3162
|
};
|
|
3163
|
-
}, []), b =
|
|
3163
|
+
}, []), b = te(() => {
|
|
3164
3164
|
if (u) return;
|
|
3165
|
-
|
|
3166
|
-
const
|
|
3167
|
-
|
|
3168
|
-
}, [u,
|
|
3165
|
+
W();
|
|
3166
|
+
const x = F();
|
|
3167
|
+
x && S(x), T(!0);
|
|
3168
|
+
}, [u, F, W]), $ = te(() => {
|
|
3169
3169
|
T(!1), L("");
|
|
3170
|
-
}, []), H = () =>
|
|
3170
|
+
}, []), H = () => I ? $() : b();
|
|
3171
3171
|
ye(() => {
|
|
3172
|
-
if (!
|
|
3173
|
-
const
|
|
3174
|
-
var
|
|
3175
|
-
const
|
|
3176
|
-
!((
|
|
3172
|
+
if (!I) return;
|
|
3173
|
+
const x = (Q) => {
|
|
3174
|
+
var ce, we;
|
|
3175
|
+
const Y = Q.target;
|
|
3176
|
+
!((ce = M.current) != null && ce.contains(Y)) && !((we = G.current) != null && we.contains(Y)) && $();
|
|
3177
3177
|
};
|
|
3178
|
-
return document.addEventListener("mousedown",
|
|
3179
|
-
}, [
|
|
3180
|
-
if (!
|
|
3181
|
-
const
|
|
3182
|
-
const
|
|
3183
|
-
|
|
3178
|
+
return document.addEventListener("mousedown", x), () => document.removeEventListener("mousedown", x);
|
|
3179
|
+
}, [I, $]), ye(() => {
|
|
3180
|
+
if (!I) return;
|
|
3181
|
+
const x = () => {
|
|
3182
|
+
const Q = F();
|
|
3183
|
+
Q && S(Q);
|
|
3184
3184
|
};
|
|
3185
|
-
return window.addEventListener("scroll",
|
|
3186
|
-
window.removeEventListener("scroll",
|
|
3185
|
+
return window.addEventListener("scroll", x, !0), window.addEventListener("resize", x), () => {
|
|
3186
|
+
window.removeEventListener("scroll", x, !0), window.removeEventListener("resize", x);
|
|
3187
3187
|
};
|
|
3188
|
-
}, [
|
|
3189
|
-
|
|
3190
|
-
var
|
|
3191
|
-
return (
|
|
3188
|
+
}, [I, F]), ye(() => {
|
|
3189
|
+
I && J.current && setTimeout(() => {
|
|
3190
|
+
var x;
|
|
3191
|
+
return (x = J.current) == null ? void 0 : x.focus();
|
|
3192
3192
|
}, 0);
|
|
3193
|
-
}, [
|
|
3193
|
+
}, [I]);
|
|
3194
3194
|
const z = a.filter(
|
|
3195
|
-
(
|
|
3196
|
-
), O = (
|
|
3197
|
-
u ||
|
|
3198
|
-
}, { bg:
|
|
3195
|
+
(x) => x.label.toLowerCase().includes(R.toLowerCase()) || x.value.toLowerCase().includes(R.toLowerCase())
|
|
3196
|
+
), O = (j = a.find((x) => x.value === l)) == null ? void 0 : j.label, ne = (x, Q) => {
|
|
3197
|
+
u || Q || (c(x), $());
|
|
3198
|
+
}, { bg: ae, border: re, text: he, textSecondary: de, primary: P, primaryLight: K, hoverBg: Z } = D, ue = I && f && /* @__PURE__ */ i(
|
|
3199
3199
|
"div",
|
|
3200
3200
|
{
|
|
3201
|
-
ref:
|
|
3201
|
+
ref: G,
|
|
3202
3202
|
className: "metakyc-searchable-select-dropdown",
|
|
3203
3203
|
style: {
|
|
3204
3204
|
position: "fixed",
|
|
@@ -3209,20 +3209,20 @@ const wt = 280, qr = ({
|
|
|
3209
3209
|
zIndex: 99999,
|
|
3210
3210
|
borderRadius: "8px",
|
|
3211
3211
|
boxShadow: "0 4px 16px rgba(0,0,0,0.18)",
|
|
3212
|
-
border: `1px solid ${
|
|
3213
|
-
backgroundColor:
|
|
3212
|
+
border: `1px solid ${re}`,
|
|
3213
|
+
backgroundColor: ae,
|
|
3214
3214
|
overflow: "hidden"
|
|
3215
3215
|
},
|
|
3216
3216
|
children: [
|
|
3217
|
-
/* @__PURE__ */ r("div", { style: { padding: "8px", borderBottom: `1px solid ${
|
|
3217
|
+
/* @__PURE__ */ r("div", { style: { padding: "8px", borderBottom: `1px solid ${re}` }, children: /* @__PURE__ */ r(
|
|
3218
3218
|
"input",
|
|
3219
3219
|
{
|
|
3220
|
-
ref:
|
|
3220
|
+
ref: J,
|
|
3221
3221
|
type: "text",
|
|
3222
|
-
value:
|
|
3223
|
-
onChange: (
|
|
3222
|
+
value: R,
|
|
3223
|
+
onChange: (x) => L(x.target.value),
|
|
3224
3224
|
placeholder: "Search...",
|
|
3225
|
-
onClick: (
|
|
3225
|
+
onClick: (x) => x.stopPropagation(),
|
|
3226
3226
|
className: "metakyc-searchable-select-search w-full",
|
|
3227
3227
|
style: {
|
|
3228
3228
|
display: "block",
|
|
@@ -3230,18 +3230,18 @@ const wt = 280, qr = ({
|
|
|
3230
3230
|
padding: "6px 8px",
|
|
3231
3231
|
fontSize: "13px",
|
|
3232
3232
|
borderRadius: "6px",
|
|
3233
|
-
border: `1px solid ${
|
|
3234
|
-
backgroundColor:
|
|
3233
|
+
border: `1px solid ${re}`,
|
|
3234
|
+
backgroundColor: ae,
|
|
3235
3235
|
color: he,
|
|
3236
3236
|
outline: "none",
|
|
3237
3237
|
boxSizing: "border-box"
|
|
3238
3238
|
},
|
|
3239
|
-
onFocus: (
|
|
3240
|
-
const
|
|
3241
|
-
|
|
3239
|
+
onFocus: (x) => {
|
|
3240
|
+
const Q = getComputedStyle(document.documentElement), Y = Q.getPropertyValue("--metakyc-input-border-focus").trim() || Q.getPropertyValue("--metakyc-primary").trim() || "#2563eb";
|
|
3241
|
+
x.currentTarget.style.backgroundColor = ae, x.currentTarget.style.color = he, x.currentTarget.style.borderColor = Y, x.currentTarget.style.outline = "none", x.currentTarget.style.boxShadow = `0 0 0 2px ${Y}33`;
|
|
3242
3242
|
},
|
|
3243
|
-
onBlur: (
|
|
3244
|
-
|
|
3243
|
+
onBlur: (x) => {
|
|
3244
|
+
x.currentTarget.style.backgroundColor = ae, x.currentTarget.style.color = he, x.currentTarget.style.borderColor = re, x.currentTarget.style.outline = "none", x.currentTarget.style.boxShadow = "none";
|
|
3245
3245
|
}
|
|
3246
3246
|
}
|
|
3247
3247
|
) }),
|
|
@@ -3255,31 +3255,31 @@ const wt = 280, qr = ({
|
|
|
3255
3255
|
maxHeight: "208px",
|
|
3256
3256
|
overflowY: "auto"
|
|
3257
3257
|
},
|
|
3258
|
-
children: z.length === 0 ? /* @__PURE__ */ r("li", { style: { padding: "8px 12px", fontSize: "13px", color:
|
|
3259
|
-
const
|
|
3258
|
+
children: z.length === 0 ? /* @__PURE__ */ r("li", { style: { padding: "8px 12px", fontSize: "13px", color: de }, children: "No results" }) : z.map((x) => {
|
|
3259
|
+
const Q = x.value === l;
|
|
3260
3260
|
return /* @__PURE__ */ r(
|
|
3261
3261
|
"li",
|
|
3262
3262
|
{
|
|
3263
3263
|
className: "metakyc-searchable-select-option",
|
|
3264
|
-
onClick: () =>
|
|
3264
|
+
onClick: () => ne(x.value, x.disabled),
|
|
3265
3265
|
style: {
|
|
3266
3266
|
padding: "8px 12px",
|
|
3267
3267
|
fontSize: "13px",
|
|
3268
|
-
cursor:
|
|
3269
|
-
opacity:
|
|
3270
|
-
backgroundColor:
|
|
3271
|
-
color:
|
|
3268
|
+
cursor: x.disabled ? "not-allowed" : "pointer",
|
|
3269
|
+
opacity: x.disabled ? 0.4 : 1,
|
|
3270
|
+
backgroundColor: Q ? K : "transparent",
|
|
3271
|
+
color: Q ? P : he,
|
|
3272
3272
|
userSelect: "none"
|
|
3273
3273
|
},
|
|
3274
|
-
onMouseEnter: (
|
|
3275
|
-
!
|
|
3274
|
+
onMouseEnter: (Y) => {
|
|
3275
|
+
!Q && !x.disabled && (Y.currentTarget.style.backgroundColor = Z);
|
|
3276
3276
|
},
|
|
3277
|
-
onMouseLeave: (
|
|
3278
|
-
|
|
3277
|
+
onMouseLeave: (Y) => {
|
|
3278
|
+
Q || (Y.currentTarget.style.backgroundColor = "transparent");
|
|
3279
3279
|
},
|
|
3280
|
-
children:
|
|
3280
|
+
children: x.label
|
|
3281
3281
|
},
|
|
3282
|
-
|
|
3282
|
+
x.value
|
|
3283
3283
|
);
|
|
3284
3284
|
})
|
|
3285
3285
|
}
|
|
@@ -3311,8 +3311,8 @@ const wt = 280, qr = ({
|
|
|
3311
3311
|
role: "button",
|
|
3312
3312
|
tabIndex: u ? -1 : 0,
|
|
3313
3313
|
onClick: H,
|
|
3314
|
-
onKeyDown: (
|
|
3315
|
-
(
|
|
3314
|
+
onKeyDown: (x) => {
|
|
3315
|
+
(x.key === "Enter" || x.key === " ") && (x.preventDefault(), H()), x.key === "Escape" && $();
|
|
3316
3316
|
},
|
|
3317
3317
|
className: Ie(
|
|
3318
3318
|
"metakyc-searchable-select-trigger",
|
|
@@ -3324,9 +3324,9 @@ const wt = 280, qr = ({
|
|
|
3324
3324
|
style: {
|
|
3325
3325
|
backgroundColor: "var(--metakyc-input-bg, #ffffff)",
|
|
3326
3326
|
color: O ? "var(--metakyc-input-text, var(--metakyc-text-primary, #111827))" : "var(--metakyc-input-placeholder, var(--metakyc-text-muted, #9ca3af))",
|
|
3327
|
-
borderColor: t ? "var(--metakyc-danger, #ef4444)" :
|
|
3327
|
+
borderColor: t ? "var(--metakyc-danger, #ef4444)" : I ? "var(--metakyc-input-border-focus, var(--metakyc-primary, #2563eb))" : "var(--metakyc-input-border, var(--metakyc-border, #d1d5db))",
|
|
3328
3328
|
minHeight: "42px",
|
|
3329
|
-
outline:
|
|
3329
|
+
outline: I ? "2px solid var(--metakyc-input-border-focus, var(--metakyc-primary, #2563eb))" : "none",
|
|
3330
3330
|
outlineOffset: "-1px"
|
|
3331
3331
|
},
|
|
3332
3332
|
children: [
|
|
@@ -3336,13 +3336,13 @@ const wt = 280, qr = ({
|
|
|
3336
3336
|
{
|
|
3337
3337
|
className: "flex-shrink-0 text-xs pointer-events-none",
|
|
3338
3338
|
style: { color: "var(--metakyc-text-secondary, #6b7280)" },
|
|
3339
|
-
children:
|
|
3339
|
+
children: I ? "▲" : "▼"
|
|
3340
3340
|
}
|
|
3341
3341
|
)
|
|
3342
3342
|
]
|
|
3343
3343
|
}
|
|
3344
3344
|
),
|
|
3345
|
-
typeof document < "u" &&
|
|
3345
|
+
typeof document < "u" && ue ? ft(ue, document.body) : null,
|
|
3346
3346
|
t && /* @__PURE__ */ r("p", { className: "mt-1 text-sm", style: { color: "var(--metakyc-error, #ef4444)" }, children: t }),
|
|
3347
3347
|
!t && n && /* @__PURE__ */ r("p", { className: "mt-1 text-sm", style: { color: "var(--metakyc-text-secondary, #6b7280)" }, children: n })
|
|
3348
3348
|
]
|
|
@@ -3350,11 +3350,11 @@ const wt = 280, qr = ({
|
|
|
3350
3350
|
);
|
|
3351
3351
|
};
|
|
3352
3352
|
Be.displayName = "SearchableSelect";
|
|
3353
|
-
function
|
|
3353
|
+
function Yr(e) {
|
|
3354
3354
|
const t = e.type;
|
|
3355
3355
|
return t.startsWith("image/") ? "image" : t === "application/pdf" ? "pdf" : "file";
|
|
3356
3356
|
}
|
|
3357
|
-
const
|
|
3357
|
+
const Vr = ({
|
|
3358
3358
|
label: e,
|
|
3359
3359
|
subtitle: t,
|
|
3360
3360
|
error: n,
|
|
@@ -3366,29 +3366,29 @@ const Yr = ({
|
|
|
3366
3366
|
value: h = [],
|
|
3367
3367
|
className: m
|
|
3368
3368
|
}) => {
|
|
3369
|
-
const [
|
|
3370
|
-
if (!
|
|
3369
|
+
const [I, T] = k(!1), [R, L] = k(null), f = le(null), S = te((F) => {
|
|
3370
|
+
if (!F) return;
|
|
3371
3371
|
L(null);
|
|
3372
|
-
const b = Array.from(
|
|
3372
|
+
const b = Array.from(F);
|
|
3373
3373
|
if (l && b.filter((H) => H.size > l).length > 0) {
|
|
3374
3374
|
L(`File exceeds the maximum size of ${mt(l)}`);
|
|
3375
3375
|
return;
|
|
3376
3376
|
}
|
|
3377
3377
|
u == null || u(s ? [...h, ...b] : [b[0]]);
|
|
3378
|
-
}, [l, s, u, h]), D =
|
|
3379
|
-
|
|
3380
|
-
}, []), U =
|
|
3381
|
-
|
|
3382
|
-
}, []),
|
|
3383
|
-
|
|
3384
|
-
}, [
|
|
3385
|
-
var
|
|
3386
|
-
(
|
|
3387
|
-
}, B = (
|
|
3378
|
+
}, [l, s, u, h]), D = te((F) => {
|
|
3379
|
+
F.preventDefault(), F.stopPropagation(), T(!0);
|
|
3380
|
+
}, []), U = te((F) => {
|
|
3381
|
+
F.preventDefault(), F.stopPropagation(), T(!1);
|
|
3382
|
+
}, []), W = te((F) => {
|
|
3383
|
+
F.preventDefault(), F.stopPropagation(), T(!1), S(F.dataTransfer.files);
|
|
3384
|
+
}, [S]), M = () => {
|
|
3385
|
+
var F;
|
|
3386
|
+
(F = f.current) == null || F.click();
|
|
3387
|
+
}, B = (F) => {
|
|
3388
3388
|
L(null);
|
|
3389
|
-
const b = h.filter((
|
|
3389
|
+
const b = h.filter(($, H) => H !== F);
|
|
3390
3390
|
u == null || u(b);
|
|
3391
|
-
},
|
|
3391
|
+
}, G = n || R, J = h.length > 0;
|
|
3392
3392
|
return /* @__PURE__ */ i("div", { className: Ie("metakyc-file-upload", m), style: { width: "100%" }, children: [
|
|
3393
3393
|
e && /* @__PURE__ */ i("div", { style: { marginBottom: "8px" }, children: [
|
|
3394
3394
|
/* @__PURE__ */ i(
|
|
@@ -3415,15 +3415,15 @@ const Yr = ({
|
|
|
3415
3415
|
onClick: M,
|
|
3416
3416
|
onDragOver: D,
|
|
3417
3417
|
onDragLeave: U,
|
|
3418
|
-
onDrop:
|
|
3418
|
+
onDrop: W,
|
|
3419
3419
|
style: {
|
|
3420
|
-
border: `2px dashed ${
|
|
3420
|
+
border: `2px dashed ${G ? "var(--metakyc-danger, #ef4444)" : I ? "var(--metakyc-primary, #2563eb)" : "var(--metakyc-border, #d1d5db)"}`,
|
|
3421
3421
|
borderRadius: "12px",
|
|
3422
|
-
padding:
|
|
3422
|
+
padding: J ? "20px" : "32px 20px",
|
|
3423
3423
|
textAlign: "center",
|
|
3424
3424
|
cursor: "pointer",
|
|
3425
3425
|
transition: "all 0.2s ease",
|
|
3426
|
-
backgroundColor:
|
|
3426
|
+
backgroundColor: I ? "color-mix(in srgb, var(--metakyc-primary, #2563eb) 5%, var(--metakyc-background, #ffffff))" : "var(--metakyc-background, #ffffff)"
|
|
3427
3427
|
},
|
|
3428
3428
|
children: [
|
|
3429
3429
|
/* @__PURE__ */ r(
|
|
@@ -3434,8 +3434,8 @@ const Yr = ({
|
|
|
3434
3434
|
style: { display: "none" },
|
|
3435
3435
|
accept: a,
|
|
3436
3436
|
multiple: s,
|
|
3437
|
-
onChange: (
|
|
3438
|
-
|
|
3437
|
+
onChange: (F) => {
|
|
3438
|
+
S(F.target.files), F.target.value = "";
|
|
3439
3439
|
}
|
|
3440
3440
|
}
|
|
3441
3441
|
),
|
|
@@ -3450,7 +3450,7 @@ const Yr = ({
|
|
|
3450
3450
|
display: "flex",
|
|
3451
3451
|
alignItems: "center",
|
|
3452
3452
|
justifyContent: "center",
|
|
3453
|
-
backgroundColor:
|
|
3453
|
+
backgroundColor: I ? "color-mix(in srgb, var(--metakyc-primary, #2563eb) 15%, transparent)" : "var(--metakyc-surface, #f9fafb)",
|
|
3454
3454
|
transition: "background-color 0.2s ease"
|
|
3455
3455
|
},
|
|
3456
3456
|
children: /* @__PURE__ */ i(
|
|
@@ -3460,7 +3460,7 @@ const Yr = ({
|
|
|
3460
3460
|
height: "24",
|
|
3461
3461
|
viewBox: "0 0 24 24",
|
|
3462
3462
|
fill: "none",
|
|
3463
|
-
stroke:
|
|
3463
|
+
stroke: I ? "var(--metakyc-primary, #2563eb)" : "var(--metakyc-text-muted, #9ca3af)",
|
|
3464
3464
|
strokeWidth: "2",
|
|
3465
3465
|
strokeLinecap: "round",
|
|
3466
3466
|
strokeLinejoin: "round",
|
|
@@ -3493,8 +3493,8 @@ const Yr = ({
|
|
|
3493
3493
|
]
|
|
3494
3494
|
}
|
|
3495
3495
|
),
|
|
3496
|
-
|
|
3497
|
-
const
|
|
3496
|
+
J && /* @__PURE__ */ r("div", { style: { marginTop: "12px", display: "flex", flexDirection: "column", gap: "8px" }, children: h.map((F, b) => {
|
|
3497
|
+
const $ = Yr(F), H = $ === "image", z = H ? URL.createObjectURL(F) : null;
|
|
3498
3498
|
return /* @__PURE__ */ i(
|
|
3499
3499
|
"div",
|
|
3500
3500
|
{
|
|
@@ -3528,10 +3528,10 @@ const Yr = ({
|
|
|
3528
3528
|
"img",
|
|
3529
3529
|
{
|
|
3530
3530
|
src: z,
|
|
3531
|
-
alt:
|
|
3531
|
+
alt: F.name,
|
|
3532
3532
|
style: { width: "100%", height: "100%", objectFit: "cover", borderRadius: "8px" }
|
|
3533
3533
|
}
|
|
3534
|
-
) :
|
|
3534
|
+
) : $ === "pdf" ? /* @__PURE__ */ i("svg", { width: "20", height: "20", viewBox: "0 0 24 24", fill: "none", stroke: "var(--metakyc-danger, #ef4444)", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round", children: [
|
|
3535
3535
|
/* @__PURE__ */ r("path", { d: "M14 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8z" }),
|
|
3536
3536
|
/* @__PURE__ */ r("polyline", { points: "14 2 14 8 20 8" }),
|
|
3537
3537
|
/* @__PURE__ */ r("line", { x1: "16", y1: "13", x2: "8", y2: "13" }),
|
|
@@ -3552,8 +3552,8 @@ const Yr = ({
|
|
|
3552
3552
|
overflow: "hidden",
|
|
3553
3553
|
textOverflow: "ellipsis",
|
|
3554
3554
|
whiteSpace: "nowrap"
|
|
3555
|
-
}, children:
|
|
3556
|
-
/* @__PURE__ */ r("p", { style: { fontSize: "12px", color: "var(--metakyc-text-muted, #9ca3af)", margin: 0, marginTop: "2px" }, children: mt(
|
|
3555
|
+
}, children: F.name }),
|
|
3556
|
+
/* @__PURE__ */ r("p", { style: { fontSize: "12px", color: "var(--metakyc-text-muted, #9ca3af)", margin: 0, marginTop: "2px" }, children: mt(F.size) })
|
|
3557
3557
|
] }),
|
|
3558
3558
|
/* @__PURE__ */ r(
|
|
3559
3559
|
"button",
|
|
@@ -3591,10 +3591,10 @@ const Yr = ({
|
|
|
3591
3591
|
)
|
|
3592
3592
|
]
|
|
3593
3593
|
},
|
|
3594
|
-
`${
|
|
3594
|
+
`${F.name}-${b}`
|
|
3595
3595
|
);
|
|
3596
3596
|
}) }),
|
|
3597
|
-
|
|
3597
|
+
G && /* @__PURE__ */ r("p", { style: { fontSize: "13px", color: "var(--metakyc-danger, #ef4444)", marginTop: "6px" }, children: G })
|
|
3598
3598
|
] });
|
|
3599
3599
|
}, Qr = lt(
|
|
3600
3600
|
({ countryCode: e = "+1", onCountryCodeChange: t, className: n, ...a }, s) => /* @__PURE__ */ i("div", { className: "w-full", children: [
|
|
@@ -3736,7 +3736,7 @@ const en = lt(
|
|
|
3736
3736
|
...u
|
|
3737
3737
|
},
|
|
3738
3738
|
[
|
|
3739
|
-
...c.map(([m,
|
|
3739
|
+
...c.map(([m, I]) => gt(m, I)),
|
|
3740
3740
|
...Array.isArray(l) ? l : [l]
|
|
3741
3741
|
]
|
|
3742
3742
|
)
|
|
@@ -3820,62 +3820,62 @@ const sn = ({
|
|
|
3820
3820
|
onComplete: t,
|
|
3821
3821
|
onBack: n
|
|
3822
3822
|
}) => {
|
|
3823
|
-
const { questionnaire: a, initialAnswers: s, isLoading: l, isSubmitting: c, error: u, submit: h } = Br(e), [m,
|
|
3823
|
+
const { questionnaire: a, initialAnswers: s, isLoading: l, isSubmitting: c, error: u, submit: h } = Br(e), [m, I] = k({}), [T, R] = k({}), [L, f] = k(0);
|
|
3824
3824
|
Fe.useEffect(() => {
|
|
3825
|
-
s && Object.keys(s).length > 0 && Object.keys(m).length === 0 &&
|
|
3825
|
+
s && Object.keys(s).length > 0 && Object.keys(m).length === 0 && I(s);
|
|
3826
3826
|
}, [s]);
|
|
3827
|
-
const
|
|
3827
|
+
const S = Ae(
|
|
3828
3828
|
() => a ? an(a.questionGroups) : [],
|
|
3829
3829
|
[a]
|
|
3830
|
-
), D = L ===
|
|
3831
|
-
|
|
3832
|
-
const H = {
|
|
3833
|
-
return delete H[
|
|
3830
|
+
), D = L === S.length - 1, U = S[L] ?? [], W = te((F, b) => {
|
|
3831
|
+
I(($) => ({ ...$, [F]: b })), R(($) => {
|
|
3832
|
+
const H = { ...$ };
|
|
3833
|
+
return delete H[F], H;
|
|
3834
3834
|
});
|
|
3835
|
-
}, []), M =
|
|
3836
|
-
const
|
|
3835
|
+
}, []), M = te(() => {
|
|
3836
|
+
const F = {};
|
|
3837
3837
|
for (const { question: b } of U) {
|
|
3838
|
-
const
|
|
3839
|
-
|
|
3838
|
+
const $ = nn(b, m[b.id] ?? []);
|
|
3839
|
+
$ && (F[b.id] = $);
|
|
3840
3840
|
}
|
|
3841
|
-
return
|
|
3841
|
+
return R((b) => ({ ...b, ...F })), Object.keys(F).length === 0;
|
|
3842
3842
|
}, [U, m]), B = () => {
|
|
3843
|
-
M() && f((
|
|
3844
|
-
},
|
|
3845
|
-
L > 0 ? f((
|
|
3846
|
-
},
|
|
3843
|
+
M() && f((F) => F + 1);
|
|
3844
|
+
}, G = () => {
|
|
3845
|
+
L > 0 ? f((F) => F - 1) : n == null || n();
|
|
3846
|
+
}, J = async () => {
|
|
3847
3847
|
if (!(!M() || !a))
|
|
3848
3848
|
try {
|
|
3849
|
-
const
|
|
3850
|
-
(
|
|
3849
|
+
const F = a.questionGroups.flatMap(
|
|
3850
|
+
($) => ($.questions ?? []).map((H) => ({
|
|
3851
3851
|
questionId: H.id,
|
|
3852
3852
|
values: m[H.id] ?? []
|
|
3853
3853
|
}))
|
|
3854
3854
|
), b = {
|
|
3855
3855
|
applicantId: e,
|
|
3856
3856
|
questionnarieId: a.id,
|
|
3857
|
-
questionResults:
|
|
3857
|
+
questionResults: F
|
|
3858
3858
|
};
|
|
3859
3859
|
await h(b), t == null || t();
|
|
3860
|
-
} catch (
|
|
3861
|
-
console.error("Questionnaire submit error:",
|
|
3860
|
+
} catch (F) {
|
|
3861
|
+
console.error("Questionnaire submit error:", F);
|
|
3862
3862
|
}
|
|
3863
3863
|
};
|
|
3864
|
-
return l ? /* @__PURE__ */ r(
|
|
3864
|
+
return l ? /* @__PURE__ */ r(X, { children: /* @__PURE__ */ r(ee, { children: /* @__PURE__ */ r(Pe, { className: "my-8" }) }) }) : u ? /* @__PURE__ */ r(X, { children: /* @__PURE__ */ r(ee, { children: /* @__PURE__ */ i("p", { className: "text-danger-500", children: [
|
|
3865
3865
|
"Error loading questionnaire: ",
|
|
3866
3866
|
u.message
|
|
3867
|
-
] }) }) }) : a ? /* @__PURE__ */ i(
|
|
3867
|
+
] }) }) }) : a ? /* @__PURE__ */ i(X, { children: [
|
|
3868
3868
|
/* @__PURE__ */ i(be, { children: [
|
|
3869
3869
|
/* @__PURE__ */ r("h2", { className: "text-lg font-bold", children: a.displayName }),
|
|
3870
3870
|
a.subtitle && /* @__PURE__ */ r("p", { className: "text-sm", style: { color: "var(--metakyc-text-secondary, #6b7280)" }, children: a.subtitle }),
|
|
3871
|
-
|
|
3871
|
+
S.length > 1 && /* @__PURE__ */ i("div", { className: "flex items-center justify-between mt-3", children: [
|
|
3872
3872
|
/* @__PURE__ */ i("span", { className: "text-xs", style: { color: "var(--metakyc-text-muted, #9ca3af)" }, children: [
|
|
3873
3873
|
"Page ",
|
|
3874
3874
|
L + 1,
|
|
3875
3875
|
" of ",
|
|
3876
|
-
|
|
3876
|
+
S.length
|
|
3877
3877
|
] }),
|
|
3878
|
-
/* @__PURE__ */ r("div", { className: "flex items-center gap-1.5", children:
|
|
3878
|
+
/* @__PURE__ */ r("div", { className: "flex items-center gap-1.5", children: S.map((F, b) => /* @__PURE__ */ r(
|
|
3879
3879
|
"div",
|
|
3880
3880
|
{
|
|
3881
3881
|
className: "rounded-full transition-all duration-200",
|
|
@@ -3889,23 +3889,23 @@ const sn = ({
|
|
|
3889
3889
|
)) })
|
|
3890
3890
|
] })
|
|
3891
3891
|
] }),
|
|
3892
|
-
/* @__PURE__ */ r(
|
|
3892
|
+
/* @__PURE__ */ r(ee, { className: "space-y-6", children: U.map(({ question: F }) => /* @__PURE__ */ r(
|
|
3893
3893
|
on,
|
|
3894
3894
|
{
|
|
3895
|
-
question:
|
|
3896
|
-
value: m[
|
|
3897
|
-
error: T[
|
|
3898
|
-
onChange: (b) =>
|
|
3895
|
+
question: F,
|
|
3896
|
+
value: m[F.id] ?? [],
|
|
3897
|
+
error: T[F.id],
|
|
3898
|
+
onChange: (b) => W(F.id, b)
|
|
3899
3899
|
},
|
|
3900
|
-
|
|
3900
|
+
F.id
|
|
3901
3901
|
)) }),
|
|
3902
|
-
/* @__PURE__ */ i(
|
|
3902
|
+
/* @__PURE__ */ i(xe, { className: "flex items-center justify-between", children: [
|
|
3903
3903
|
/* @__PURE__ */ i(
|
|
3904
|
-
|
|
3904
|
+
V,
|
|
3905
3905
|
{
|
|
3906
3906
|
type: "button",
|
|
3907
3907
|
variant: "outline",
|
|
3908
|
-
onClick:
|
|
3908
|
+
onClick: G,
|
|
3909
3909
|
style: { display: "flex", alignItems: "center", gap: "4px" },
|
|
3910
3910
|
children: [
|
|
3911
3911
|
/* @__PURE__ */ r(Mt, { size: 14 }),
|
|
@@ -3914,15 +3914,15 @@ const sn = ({
|
|
|
3914
3914
|
}
|
|
3915
3915
|
),
|
|
3916
3916
|
D ? /* @__PURE__ */ r(
|
|
3917
|
-
|
|
3917
|
+
V,
|
|
3918
3918
|
{
|
|
3919
3919
|
type: "button",
|
|
3920
3920
|
isLoading: c,
|
|
3921
|
-
onClick:
|
|
3921
|
+
onClick: J,
|
|
3922
3922
|
children: "Continue"
|
|
3923
3923
|
}
|
|
3924
3924
|
) : /* @__PURE__ */ i(
|
|
3925
|
-
|
|
3925
|
+
V,
|
|
3926
3926
|
{
|
|
3927
3927
|
type: "button",
|
|
3928
3928
|
onClick: B,
|
|
@@ -4057,28 +4057,28 @@ const cn = ({
|
|
|
4057
4057
|
onComplete: t,
|
|
4058
4058
|
onBack: n
|
|
4059
4059
|
}) => {
|
|
4060
|
-
const { uploadDocument: a, isLoading: s, isSubmitting: l, error: c, submit: u } = _r(e), [h, m] = k({}), [
|
|
4060
|
+
const { uploadDocument: a, isLoading: s, isSubmitting: l, error: c, submit: u } = _r(e), [h, m] = k({}), [I, T] = k(null), [R, L] = k(0), [f, S] = k({}), D = Ae(
|
|
4061
4061
|
() => a ? ln(a.uploadDocumentFiles) : [],
|
|
4062
4062
|
[a]
|
|
4063
|
-
), U = D[
|
|
4063
|
+
), U = D[R] ?? [], W = R === D.length - 1, M = D.length, B = te(() => {
|
|
4064
4064
|
const b = {};
|
|
4065
|
-
for (const
|
|
4066
|
-
|
|
4067
|
-
return
|
|
4068
|
-
}, [U, h]),
|
|
4069
|
-
B() && (L((b) => b + 1),
|
|
4070
|
-
},
|
|
4071
|
-
|
|
4072
|
-
},
|
|
4065
|
+
for (const $ of U)
|
|
4066
|
+
$.isRequired && (h[$.id] || []).length === 0 && (b[$.id] = `${$.displayName} is required`);
|
|
4067
|
+
return S(b), Object.keys(b).length === 0;
|
|
4068
|
+
}, [U, h]), G = () => {
|
|
4069
|
+
B() && (L((b) => b + 1), S({}));
|
|
4070
|
+
}, J = () => {
|
|
4071
|
+
R > 0 ? (L((b) => b - 1), S({})) : n == null || n();
|
|
4072
|
+
}, F = async () => {
|
|
4073
4073
|
if (!(!B() || !a)) {
|
|
4074
4074
|
T(null);
|
|
4075
4075
|
try {
|
|
4076
4076
|
const b = await Promise.all(
|
|
4077
4077
|
a.uploadDocumentFiles.map(async (H) => {
|
|
4078
4078
|
const z = h[H.id] || [], O = await Promise.all(
|
|
4079
|
-
z.map(async (
|
|
4080
|
-
fileName:
|
|
4081
|
-
fileData: await Lr(
|
|
4079
|
+
z.map(async (ne) => ({
|
|
4080
|
+
fileName: ne.name,
|
|
4081
|
+
fileData: await Lr(ne)
|
|
4082
4082
|
}))
|
|
4083
4083
|
);
|
|
4084
4084
|
return {
|
|
@@ -4086,21 +4086,21 @@ const cn = ({
|
|
|
4086
4086
|
valueList: O
|
|
4087
4087
|
};
|
|
4088
4088
|
})
|
|
4089
|
-
),
|
|
4089
|
+
), $ = {
|
|
4090
4090
|
applicantId: e,
|
|
4091
4091
|
uploadDocumentId: a.id,
|
|
4092
4092
|
uploadDocumentResults: b
|
|
4093
4093
|
};
|
|
4094
|
-
await u(
|
|
4094
|
+
await u($), t == null || t();
|
|
4095
4095
|
} catch (b) {
|
|
4096
4096
|
T((b == null ? void 0 : b.message) || "Failed to submit documents. Please try again.");
|
|
4097
4097
|
}
|
|
4098
4098
|
}
|
|
4099
4099
|
};
|
|
4100
|
-
return s ? /* @__PURE__ */ r(
|
|
4100
|
+
return s ? /* @__PURE__ */ r(X, { children: /* @__PURE__ */ r(ee, { children: /* @__PURE__ */ i("div", { style: { display: "flex", flexDirection: "column", alignItems: "center", padding: "48px 0", gap: "16px" }, children: [
|
|
4101
4101
|
/* @__PURE__ */ r(Pe, { className: "my-8" }),
|
|
4102
4102
|
/* @__PURE__ */ r("p", { style: { fontSize: "14px", color: "var(--metakyc-text-muted, #9ca3af)" }, children: "Loading document requirements..." })
|
|
4103
|
-
] }) }) }) : c ? /* @__PURE__ */ r(
|
|
4103
|
+
] }) }) }) : c ? /* @__PURE__ */ r(X, { children: /* @__PURE__ */ r(ee, { children: /* @__PURE__ */ i("div", { style: {
|
|
4104
4104
|
display: "flex",
|
|
4105
4105
|
flexDirection: "column",
|
|
4106
4106
|
alignItems: "center",
|
|
@@ -4123,7 +4123,7 @@ const cn = ({
|
|
|
4123
4123
|
] }) }),
|
|
4124
4124
|
/* @__PURE__ */ r("p", { style: { fontSize: "14px", color: "var(--metakyc-danger, #ef4444)", fontWeight: 500 }, children: "Error loading document requirements" }),
|
|
4125
4125
|
/* @__PURE__ */ r("p", { style: { fontSize: "13px", color: "var(--metakyc-text-muted, #9ca3af)" }, children: c.message })
|
|
4126
|
-
] }) }) }) : a ? /* @__PURE__ */ i(
|
|
4126
|
+
] }) }) }) : a ? /* @__PURE__ */ i(X, { children: [
|
|
4127
4127
|
/* @__PURE__ */ i(be, { children: [
|
|
4128
4128
|
/* @__PURE__ */ r("h2", { style: {
|
|
4129
4129
|
fontSize: "18px",
|
|
@@ -4144,26 +4144,26 @@ const cn = ({
|
|
|
4144
4144
|
}, children: [
|
|
4145
4145
|
/* @__PURE__ */ i("span", { style: { fontSize: "12px", color: "var(--metakyc-text-muted, #9ca3af)" }, children: [
|
|
4146
4146
|
"Page ",
|
|
4147
|
-
|
|
4147
|
+
R + 1,
|
|
4148
4148
|
" of ",
|
|
4149
4149
|
M
|
|
4150
4150
|
] }),
|
|
4151
|
-
/* @__PURE__ */ r("div", { style: { display: "flex", alignItems: "center", gap: "6px" }, children: D.map((b,
|
|
4151
|
+
/* @__PURE__ */ r("div", { style: { display: "flex", alignItems: "center", gap: "6px" }, children: D.map((b, $) => /* @__PURE__ */ r(
|
|
4152
4152
|
"div",
|
|
4153
4153
|
{
|
|
4154
4154
|
style: {
|
|
4155
4155
|
height: "6px",
|
|
4156
|
-
width:
|
|
4156
|
+
width: $ === R ? "20px" : "6px",
|
|
4157
4157
|
borderRadius: "999px",
|
|
4158
4158
|
transition: "all 0.2s ease",
|
|
4159
|
-
backgroundColor:
|
|
4159
|
+
backgroundColor: $ <= R ? "var(--metakyc-primary, #2563eb)" : "var(--metakyc-border, #e5e7eb)"
|
|
4160
4160
|
}
|
|
4161
4161
|
},
|
|
4162
|
-
|
|
4162
|
+
$
|
|
4163
4163
|
)) })
|
|
4164
4164
|
] })
|
|
4165
4165
|
] }),
|
|
4166
|
-
a.description &&
|
|
4166
|
+
a.description && R === 0 && /* @__PURE__ */ i("div", { style: {
|
|
4167
4167
|
margin: "0 24px",
|
|
4168
4168
|
marginTop: "4px",
|
|
4169
4169
|
display: "flex",
|
|
@@ -4199,8 +4199,8 @@ const cn = ({
|
|
|
4199
4199
|
lineHeight: 1.5
|
|
4200
4200
|
}, children: a.description })
|
|
4201
4201
|
] }),
|
|
4202
|
-
/* @__PURE__ */ r(
|
|
4203
|
-
|
|
4202
|
+
/* @__PURE__ */ r(ee, { children: /* @__PURE__ */ r("div", { style: { display: "flex", flexDirection: "column", gap: "24px" }, children: U.map((b) => /* @__PURE__ */ r(
|
|
4203
|
+
Vr,
|
|
4204
4204
|
{
|
|
4205
4205
|
label: b.displayName,
|
|
4206
4206
|
subtitle: b.subtitle,
|
|
@@ -4210,16 +4210,16 @@ const cn = ({
|
|
|
4210
4210
|
required: b.isRequired,
|
|
4211
4211
|
error: f[b.id],
|
|
4212
4212
|
value: h[b.id] || [],
|
|
4213
|
-
onChange: (
|
|
4214
|
-
T(null),
|
|
4213
|
+
onChange: ($) => {
|
|
4214
|
+
T(null), S((H) => {
|
|
4215
4215
|
const z = { ...H };
|
|
4216
4216
|
return delete z[b.id], z;
|
|
4217
|
-
}), m((H) => ({ ...H, [b.id]:
|
|
4217
|
+
}), m((H) => ({ ...H, [b.id]: $ }));
|
|
4218
4218
|
}
|
|
4219
4219
|
},
|
|
4220
4220
|
b.id
|
|
4221
4221
|
)) }) }),
|
|
4222
|
-
|
|
4222
|
+
I && /* @__PURE__ */ i("div", { style: {
|
|
4223
4223
|
margin: "0 24px",
|
|
4224
4224
|
padding: "10px 14px",
|
|
4225
4225
|
borderRadius: "8px",
|
|
@@ -4234,36 +4234,36 @@ const cn = ({
|
|
|
4234
4234
|
/* @__PURE__ */ r("line", { x1: "12", y1: "9", x2: "12", y2: "13" }),
|
|
4235
4235
|
/* @__PURE__ */ r("line", { x1: "12", y1: "17", x2: "12.01", y2: "17" })
|
|
4236
4236
|
] }),
|
|
4237
|
-
/* @__PURE__ */ r("p", { style: { fontSize: "13px", color: "var(--metakyc-danger, #ef4444)", margin: 0 }, children:
|
|
4237
|
+
/* @__PURE__ */ r("p", { style: { fontSize: "13px", color: "var(--metakyc-danger, #ef4444)", margin: 0 }, children: I })
|
|
4238
4238
|
] }),
|
|
4239
|
-
/* @__PURE__ */ r(
|
|
4239
|
+
/* @__PURE__ */ r(xe, { children: /* @__PURE__ */ i("div", { style: {
|
|
4240
4240
|
display: "flex",
|
|
4241
4241
|
alignItems: "center",
|
|
4242
4242
|
justifyContent: "space-between",
|
|
4243
4243
|
width: "100%"
|
|
4244
4244
|
}, children: [
|
|
4245
4245
|
/* @__PURE__ */ r(
|
|
4246
|
-
|
|
4246
|
+
V,
|
|
4247
4247
|
{
|
|
4248
4248
|
type: "button",
|
|
4249
4249
|
variant: "outline",
|
|
4250
|
-
onClick:
|
|
4251
|
-
children:
|
|
4250
|
+
onClick: J,
|
|
4251
|
+
children: R > 0 ? "Previous" : "Back"
|
|
4252
4252
|
}
|
|
4253
4253
|
),
|
|
4254
|
-
|
|
4255
|
-
|
|
4254
|
+
W ? /* @__PURE__ */ r(
|
|
4255
|
+
V,
|
|
4256
4256
|
{
|
|
4257
4257
|
type: "button",
|
|
4258
4258
|
isLoading: l,
|
|
4259
|
-
onClick:
|
|
4259
|
+
onClick: F,
|
|
4260
4260
|
children: l ? "Uploading..." : "Continue"
|
|
4261
4261
|
}
|
|
4262
4262
|
) : /* @__PURE__ */ r(
|
|
4263
|
-
|
|
4263
|
+
V,
|
|
4264
4264
|
{
|
|
4265
4265
|
type: "button",
|
|
4266
|
-
onClick:
|
|
4266
|
+
onClick: G,
|
|
4267
4267
|
children: "Next"
|
|
4268
4268
|
}
|
|
4269
4269
|
)
|
|
@@ -4273,15 +4273,15 @@ const cn = ({
|
|
|
4273
4273
|
const { overview: a, isLoading: s, isSubmitting: l, error: c, passOverview: u } = jr(e), h = async () => {
|
|
4274
4274
|
await u(), t == null || t();
|
|
4275
4275
|
};
|
|
4276
|
-
return s ? /* @__PURE__ */ r(
|
|
4276
|
+
return s ? /* @__PURE__ */ r(X, { children: /* @__PURE__ */ r(ee, { children: /* @__PURE__ */ r(Pe, { className: "my-8" }) }) }) : c ? /* @__PURE__ */ r(X, { children: /* @__PURE__ */ r(ee, { children: /* @__PURE__ */ i("p", { className: "text-danger-500", children: [
|
|
4277
4277
|
"Error loading overview: ",
|
|
4278
4278
|
c.message
|
|
4279
|
-
] }) }) }) : a ? /* @__PURE__ */ i(
|
|
4279
|
+
] }) }) }) : a ? /* @__PURE__ */ i(X, { children: [
|
|
4280
4280
|
/* @__PURE__ */ i(be, { children: [
|
|
4281
4281
|
/* @__PURE__ */ r("h2", { className: "text-lg font-bold", children: a.title || "Overview" }),
|
|
4282
4282
|
a.description && /* @__PURE__ */ r("p", { className: "mt-1", style: { color: "var(--metakyc-text-secondary, #6b7280)" }, children: a.description })
|
|
4283
4283
|
] }),
|
|
4284
|
-
/* @__PURE__ */ r(
|
|
4284
|
+
/* @__PURE__ */ r(ee, { className: "space-y-8", children: a.steps && a.steps.length > 0 ? a.steps.sort((m, I) => m.order - I.order).map((m) => /* @__PURE__ */ i("div", { className: "metakyc-overview-step-item flex items-center space-x-3", children: [
|
|
4285
4285
|
/* @__PURE__ */ r("div", { className: "metakyc-step-icon flex-shrink-0", children: /* @__PURE__ */ r(
|
|
4286
4286
|
"div",
|
|
4287
4287
|
{
|
|
@@ -4307,9 +4307,9 @@ const cn = ({
|
|
|
4307
4307
|
}
|
|
4308
4308
|
)
|
|
4309
4309
|
] }, m.order)) : /* @__PURE__ */ r("div", { className: "text-center py-8", children: /* @__PURE__ */ r("p", { style: { color: "var(--metakyc-text-secondary, #6b7280)" }, children: "Loading overview data..." }) }) }),
|
|
4310
|
-
/* @__PURE__ */ i(
|
|
4311
|
-
n && /* @__PURE__ */ r(
|
|
4312
|
-
/* @__PURE__ */ r(
|
|
4310
|
+
/* @__PURE__ */ i(xe, { className: "flex justify-between", children: [
|
|
4311
|
+
n && /* @__PURE__ */ r(V, { type: "button", variant: "outline", onClick: n, children: "Back" }),
|
|
4312
|
+
/* @__PURE__ */ r(V, { onClick: h, isLoading: l, children: "Continue" })
|
|
4313
4313
|
] })
|
|
4314
4314
|
] }) : null;
|
|
4315
4315
|
};
|
|
@@ -4379,62 +4379,62 @@ const fn = ({
|
|
|
4379
4379
|
onComplete: t,
|
|
4380
4380
|
onBack: n
|
|
4381
4381
|
}) => {
|
|
4382
|
-
const { config: a } = Re(), s = a.locale ?? "en", { criteria: l, initialAnswers: c, isLoading: u, isSubmitting: h, error: m, submit:
|
|
4382
|
+
const { config: a } = Re(), s = a.locale ?? "en", { criteria: l, initialAnswers: c, isLoading: u, isSubmitting: h, error: m, submit: I } = Ur(e), [T, R] = k({}), [L, f] = k({}), [S, D] = k(0), [U, W] = k(!1);
|
|
4383
4383
|
Fe.useEffect(() => {
|
|
4384
|
-
c && Object.keys(c).length > 0 && Object.keys(T).length === 0 &&
|
|
4384
|
+
c && Object.keys(c).length > 0 && Object.keys(T).length === 0 && R(c);
|
|
4385
4385
|
}, [c]);
|
|
4386
4386
|
const M = Ae(
|
|
4387
4387
|
() => l && l.length > 0 ? hn(l) : [],
|
|
4388
4388
|
[l]
|
|
4389
|
-
), B =
|
|
4389
|
+
), B = S === M.length - 1, G = M[S] ?? [];
|
|
4390
4390
|
Fe.useEffect(() => {
|
|
4391
|
-
!u && l && l.length === 0 && !U && !h && (
|
|
4392
|
-
}, [u, l, U, h,
|
|
4393
|
-
const
|
|
4394
|
-
|
|
4395
|
-
const
|
|
4396
|
-
return delete
|
|
4391
|
+
!u && l && l.length === 0 && !U && !h && (W(!0), I({ applicantId: e, criteriaValueInputs: [] }).then(() => t == null ? void 0 : t()).catch(console.error));
|
|
4392
|
+
}, [u, l, U, h, I, e, t]);
|
|
4393
|
+
const J = te((z, O) => {
|
|
4394
|
+
R((ne) => ({ ...ne, [z]: O })), f((ne) => {
|
|
4395
|
+
const ae = { ...ne };
|
|
4396
|
+
return delete ae[z], ae;
|
|
4397
4397
|
});
|
|
4398
|
-
}, []),
|
|
4398
|
+
}, []), F = te(() => {
|
|
4399
4399
|
const z = {};
|
|
4400
|
-
for (const { criterion: O } of
|
|
4401
|
-
const
|
|
4402
|
-
|
|
4400
|
+
for (const { criterion: O } of G) {
|
|
4401
|
+
const ne = yn(O, T[O.id] ?? []);
|
|
4402
|
+
ne && (z[O.id] = ne);
|
|
4403
4403
|
}
|
|
4404
4404
|
return f((O) => ({ ...O, ...z })), Object.keys(z).length === 0;
|
|
4405
|
-
}, [
|
|
4406
|
-
|
|
4407
|
-
},
|
|
4408
|
-
|
|
4405
|
+
}, [G, T]), b = () => {
|
|
4406
|
+
F() && D((z) => z + 1);
|
|
4407
|
+
}, $ = () => {
|
|
4408
|
+
S > 0 ? D((z) => z - 1) : n == null || n();
|
|
4409
4409
|
}, H = async () => {
|
|
4410
|
-
if (!(!
|
|
4410
|
+
if (!(!F() || !l))
|
|
4411
4411
|
try {
|
|
4412
|
-
const z = l.map((
|
|
4413
|
-
const
|
|
4414
|
-
return
|
|
4415
|
-
}).filter((
|
|
4416
|
-
await
|
|
4412
|
+
const z = l.map((ne) => {
|
|
4413
|
+
const ae = (T[ne.id] ?? []).filter((re) => re && re.trim());
|
|
4414
|
+
return ae.length > 0 ? { riskCriteriaId: ne.id, values: ae } : null;
|
|
4415
|
+
}).filter((ne) => ne !== null);
|
|
4416
|
+
await I({ applicantId: e, criteriaValueInputs: z }), t == null || t();
|
|
4417
4417
|
} catch (z) {
|
|
4418
4418
|
console.error("Risk scoring submit error:", z);
|
|
4419
4419
|
}
|
|
4420
4420
|
};
|
|
4421
|
-
return u ? /* @__PURE__ */ r(
|
|
4421
|
+
return u ? /* @__PURE__ */ r(X, { children: /* @__PURE__ */ i(ee, { children: [
|
|
4422
4422
|
/* @__PURE__ */ r(Pe, { className: "my-8" }),
|
|
4423
4423
|
/* @__PURE__ */ r("p", { className: "text-center text-sm mt-4", style: { color: "var(--metakyc-text-secondary, #6b7280)" }, children: "Loading risk scoring criteria…" })
|
|
4424
|
-
] }) }) : !u && l && l.length === 0 ? /* @__PURE__ */ r(
|
|
4424
|
+
] }) }) : !u && l && l.length === 0 ? /* @__PURE__ */ r(X, { children: /* @__PURE__ */ i(ee, { children: [
|
|
4425
4425
|
/* @__PURE__ */ r(Pe, { className: "my-8" }),
|
|
4426
4426
|
/* @__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…" })
|
|
4427
|
-
] }) }) : m ? /* @__PURE__ */ r(
|
|
4427
|
+
] }) }) : m ? /* @__PURE__ */ r(X, { children: /* @__PURE__ */ r(ee, { children: /* @__PURE__ */ i("p", { className: "text-danger-500", children: [
|
|
4428
4428
|
"Error loading criteria: ",
|
|
4429
4429
|
m.message
|
|
4430
|
-
] }) }) }) : l ? /* @__PURE__ */ i(
|
|
4430
|
+
] }) }) }) : l ? /* @__PURE__ */ i(X, { children: [
|
|
4431
4431
|
/* @__PURE__ */ i(be, { children: [
|
|
4432
4432
|
/* @__PURE__ */ r("h2", { className: "text-lg font-bold", children: "Risk Assessment" }),
|
|
4433
4433
|
/* @__PURE__ */ r("p", { className: "text-sm", style: { color: "var(--metakyc-text-secondary, #6b7280)" }, children: "Please answer the following questions for risk evaluation" }),
|
|
4434
4434
|
M.length > 1 && /* @__PURE__ */ i("div", { className: "flex items-center justify-between mt-3", children: [
|
|
4435
4435
|
/* @__PURE__ */ i("span", { className: "text-xs", style: { color: "var(--metakyc-text-muted, #9ca3af)" }, children: [
|
|
4436
4436
|
"Page ",
|
|
4437
|
-
|
|
4437
|
+
S + 1,
|
|
4438
4438
|
" of ",
|
|
4439
4439
|
M.length
|
|
4440
4440
|
] }),
|
|
@@ -4444,41 +4444,41 @@ const fn = ({
|
|
|
4444
4444
|
className: "rounded-full transition-all duration-200",
|
|
4445
4445
|
style: {
|
|
4446
4446
|
height: "6px",
|
|
4447
|
-
width: O ===
|
|
4448
|
-
backgroundColor: O <=
|
|
4447
|
+
width: O === S ? "20px" : "6px",
|
|
4448
|
+
backgroundColor: O <= S ? "var(--metakyc-primary, #2563eb)" : "var(--metakyc-border, #e5e7eb)"
|
|
4449
4449
|
}
|
|
4450
4450
|
},
|
|
4451
4451
|
O
|
|
4452
4452
|
)) })
|
|
4453
4453
|
] })
|
|
4454
4454
|
] }),
|
|
4455
|
-
/* @__PURE__ */ r(
|
|
4455
|
+
/* @__PURE__ */ r(ee, { className: "space-y-6", children: G.map(({ criterion: z }) => /* @__PURE__ */ r(
|
|
4456
4456
|
bn,
|
|
4457
4457
|
{
|
|
4458
4458
|
criterion: z,
|
|
4459
4459
|
value: T[z.id] ?? [],
|
|
4460
4460
|
error: L[z.id],
|
|
4461
4461
|
locale: s,
|
|
4462
|
-
onChange: (O) =>
|
|
4462
|
+
onChange: (O) => J(z.id, O)
|
|
4463
4463
|
},
|
|
4464
4464
|
z.id
|
|
4465
4465
|
)) }),
|
|
4466
|
-
/* @__PURE__ */ i(
|
|
4466
|
+
/* @__PURE__ */ i(xe, { className: "flex items-center justify-between", children: [
|
|
4467
4467
|
/* @__PURE__ */ i(
|
|
4468
|
-
|
|
4468
|
+
V,
|
|
4469
4469
|
{
|
|
4470
4470
|
type: "button",
|
|
4471
4471
|
variant: "outline",
|
|
4472
|
-
onClick:
|
|
4472
|
+
onClick: $,
|
|
4473
4473
|
style: { display: "flex", alignItems: "center", gap: "4px" },
|
|
4474
4474
|
children: [
|
|
4475
4475
|
/* @__PURE__ */ r(Mt, { size: 14 }),
|
|
4476
|
-
|
|
4476
|
+
S > 0 ? "Previous" : "Back"
|
|
4477
4477
|
]
|
|
4478
4478
|
}
|
|
4479
4479
|
),
|
|
4480
|
-
B ? /* @__PURE__ */ r(
|
|
4481
|
-
|
|
4480
|
+
B ? /* @__PURE__ */ r(V, { type: "button", isLoading: h, onClick: H, children: "Continue" }) : /* @__PURE__ */ i(
|
|
4481
|
+
V,
|
|
4482
4482
|
{
|
|
4483
4483
|
type: "button",
|
|
4484
4484
|
onClick: b,
|
|
@@ -4565,8 +4565,8 @@ const fn = ({
|
|
|
4565
4565
|
{
|
|
4566
4566
|
type: "checkbox",
|
|
4567
4567
|
checked: t.includes(m),
|
|
4568
|
-
onChange: (
|
|
4569
|
-
|
|
4568
|
+
onChange: (I) => {
|
|
4569
|
+
I.target.checked ? s([...t, m]) : s(t.filter((T) => T !== m));
|
|
4570
4570
|
},
|
|
4571
4571
|
className: "metakyc-option-input",
|
|
4572
4572
|
style: {
|
|
@@ -4622,24 +4622,24 @@ const fn = ({
|
|
|
4622
4622
|
}
|
|
4623
4623
|
u(!0), m(null);
|
|
4624
4624
|
try {
|
|
4625
|
-
const
|
|
4625
|
+
const R = {
|
|
4626
4626
|
applicantId: e,
|
|
4627
4627
|
investorType: s
|
|
4628
4628
|
};
|
|
4629
|
-
console.log("Submitting investor categorization:",
|
|
4630
|
-
const L = await a.setInvestorCategorization(
|
|
4629
|
+
console.log("Submitting investor categorization:", R);
|
|
4630
|
+
const L = await a.setInvestorCategorization(R);
|
|
4631
4631
|
console.log("Investor categorization result:", L), t == null || t();
|
|
4632
|
-
} catch (
|
|
4633
|
-
console.error("Error submitting investor categorization:",
|
|
4632
|
+
} catch (R) {
|
|
4633
|
+
console.error("Error submitting investor categorization:", R), m(R.message || "Failed to submit investor categorization");
|
|
4634
4634
|
} finally {
|
|
4635
4635
|
u(!1);
|
|
4636
4636
|
}
|
|
4637
|
-
}, children: /* @__PURE__ */ i(
|
|
4637
|
+
}, children: /* @__PURE__ */ i(X, { children: [
|
|
4638
4638
|
/* @__PURE__ */ i(be, { children: [
|
|
4639
4639
|
/* @__PURE__ */ r("h2", { className: "text-lg font-bold", style: { color: "var(--metakyc-text-primary, #111827)" }, children: "Which statement best describes you?" }),
|
|
4640
4640
|
/* @__PURE__ */ r("p", { className: "mt-2", style: { color: "var(--metakyc-text-secondary, #6b7280)" }, 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" })
|
|
4641
4641
|
] }),
|
|
4642
|
-
/* @__PURE__ */ i(
|
|
4642
|
+
/* @__PURE__ */ i(ee, { className: "space-y-4", children: [
|
|
4643
4643
|
/* @__PURE__ */ r("p", { className: "text-sm font-medium mb-3", style: { color: "var(--metakyc-text-secondary, #374151)" }, children: "Choose one" }),
|
|
4644
4644
|
/* @__PURE__ */ r(
|
|
4645
4645
|
"label",
|
|
@@ -4737,10 +4737,10 @@ const fn = ({
|
|
|
4737
4737
|
h
|
|
4738
4738
|
] }) })
|
|
4739
4739
|
] }),
|
|
4740
|
-
/* @__PURE__ */ i(
|
|
4741
|
-
n && /* @__PURE__ */ r(
|
|
4740
|
+
/* @__PURE__ */ i(xe, { className: "flex justify-between", children: [
|
|
4741
|
+
n && /* @__PURE__ */ r(V, { type: "button", variant: "outline", onClick: n, children: "Back" }),
|
|
4742
4742
|
/* @__PURE__ */ r(
|
|
4743
|
-
|
|
4743
|
+
V,
|
|
4744
4744
|
{
|
|
4745
4745
|
type: "submit",
|
|
4746
4746
|
isLoading: c,
|
|
@@ -4764,101 +4764,101 @@ const vn = ({
|
|
|
4764
4764
|
onComplete: t,
|
|
4765
4765
|
onBack: n
|
|
4766
4766
|
}) => {
|
|
4767
|
-
const { appropriatenessTestService: a } = Re(), [s, l] = k(null), [c, u] = k(!0), [h, m] = k(!1), [
|
|
4767
|
+
const { appropriatenessTestService: a } = Re(), [s, l] = k(null), [c, u] = k(!0), [h, m] = k(!1), [I, T] = k(null), [R, L] = k({}), [f, S] = k(0), [D, U] = k(!1), [W, M] = k(!1), [B, G] = k(0), [J, F] = k(0), [b, $] = k(null);
|
|
4768
4768
|
ye(() => {
|
|
4769
4769
|
(async () => {
|
|
4770
4770
|
try {
|
|
4771
4771
|
u(!0), T(null);
|
|
4772
|
-
const
|
|
4773
|
-
if (l(
|
|
4774
|
-
const
|
|
4775
|
-
|
|
4772
|
+
const j = await a.getAppropriatenessTest(e);
|
|
4773
|
+
if (l(j), j.waitTimeSpanForNextTry && j.waitTimeSpanForNextTry !== "00:00:00") {
|
|
4774
|
+
const x = Nt(j.waitTimeSpanForNextTry);
|
|
4775
|
+
x > 0 && G(x);
|
|
4776
4776
|
}
|
|
4777
|
-
} catch (
|
|
4778
|
-
T(
|
|
4777
|
+
} catch (j) {
|
|
4778
|
+
T(j.message || "Failed to load appropriateness test");
|
|
4779
4779
|
} finally {
|
|
4780
4780
|
u(!1);
|
|
4781
4781
|
}
|
|
4782
4782
|
})();
|
|
4783
4783
|
}, [e, a]), ye(() => {
|
|
4784
4784
|
if (!D || f <= 0) return;
|
|
4785
|
-
const
|
|
4786
|
-
|
|
4785
|
+
const j = setInterval(() => {
|
|
4786
|
+
S((x) => x <= 1 ? (M(!0), 0) : x - 1);
|
|
4787
4787
|
}, 1e3);
|
|
4788
|
-
return () => clearInterval(
|
|
4788
|
+
return () => clearInterval(j);
|
|
4789
4789
|
}, [D, f]), ye(() => {
|
|
4790
4790
|
if (B <= 0) return;
|
|
4791
|
-
const
|
|
4792
|
-
|
|
4791
|
+
const j = setInterval(() => {
|
|
4792
|
+
G((x) => x <= 1 ? 0 : x - 1);
|
|
4793
4793
|
}, 1e3);
|
|
4794
|
-
return () => clearInterval(
|
|
4794
|
+
return () => clearInterval(j);
|
|
4795
4795
|
}, [B]), ye(() => {
|
|
4796
|
-
|
|
4797
|
-
}, [
|
|
4798
|
-
const
|
|
4799
|
-
s && (U(!0),
|
|
4800
|
-
},
|
|
4801
|
-
L((
|
|
4802
|
-
},
|
|
4796
|
+
W && !h && ne();
|
|
4797
|
+
}, [W]);
|
|
4798
|
+
const H = () => {
|
|
4799
|
+
s && (U(!0), S(s.testDurationSec), F(0), L({}), T(null));
|
|
4800
|
+
}, z = (j, x) => {
|
|
4801
|
+
L((Q) => ({ ...Q, [j]: x }));
|
|
4802
|
+
}, O = te(async () => {
|
|
4803
4803
|
try {
|
|
4804
|
-
const
|
|
4805
|
-
if (l(
|
|
4806
|
-
const
|
|
4807
|
-
|
|
4804
|
+
const j = await a.getAppropriatenessTest(e);
|
|
4805
|
+
if (l(j), j.waitTimeSpanForNextTry && j.waitTimeSpanForNextTry !== "00:00:00") {
|
|
4806
|
+
const x = Nt(j.waitTimeSpanForNextTry);
|
|
4807
|
+
x > 0 && G(x);
|
|
4808
4808
|
}
|
|
4809
4809
|
} catch {
|
|
4810
4810
|
}
|
|
4811
|
-
}, [e, a]),
|
|
4811
|
+
}, [e, a]), ne = async (j) => {
|
|
4812
4812
|
if (s) {
|
|
4813
|
-
if (!
|
|
4814
|
-
const
|
|
4815
|
-
if (
|
|
4816
|
-
T(`Please answer all questions. ${
|
|
4813
|
+
if (!W) {
|
|
4814
|
+
const x = s.appropriatenessQuestions.length - Object.keys(R).length;
|
|
4815
|
+
if (x > 0) {
|
|
4816
|
+
T(`Please answer all questions. ${x} remaining.`);
|
|
4817
4817
|
return;
|
|
4818
4818
|
}
|
|
4819
4819
|
}
|
|
4820
4820
|
m(!0), T(null);
|
|
4821
4821
|
try {
|
|
4822
|
-
const
|
|
4823
|
-
(
|
|
4824
|
-
),
|
|
4822
|
+
const x = s.appropriatenessQuestions.map(
|
|
4823
|
+
(Y) => ({ appropriatenessQuestionId: Y.id, value: R[Y.id] || "" })
|
|
4824
|
+
), Q = {
|
|
4825
4825
|
applicantId: e,
|
|
4826
4826
|
appropriatenessTestId: s.id,
|
|
4827
|
-
appropriatenessQuestionResults:
|
|
4827
|
+
appropriatenessQuestionResults: x
|
|
4828
4828
|
};
|
|
4829
4829
|
try {
|
|
4830
|
-
const
|
|
4831
|
-
|
|
4832
|
-
} catch (
|
|
4833
|
-
if (
|
|
4834
|
-
|
|
4830
|
+
const Y = await a.fillAppropriatenessTest(Q);
|
|
4831
|
+
Y.isSuccess ? $({ success: !0, message: Y.message || "Congratulations! You have passed the test." }) : ($({ success: !1, message: Y.message || "You did not pass the test." }), setTimeout(() => O(), 1e3));
|
|
4832
|
+
} catch (Y) {
|
|
4833
|
+
if (Y.code === 400 && Y.message)
|
|
4834
|
+
$({ success: !1, message: Y.message }), setTimeout(() => O(), 1500);
|
|
4835
4835
|
else
|
|
4836
|
-
throw
|
|
4836
|
+
throw Y;
|
|
4837
4837
|
}
|
|
4838
|
-
} catch (
|
|
4839
|
-
T(
|
|
4838
|
+
} catch (x) {
|
|
4839
|
+
T(x.message || "Failed to submit test. Please try again."), ae();
|
|
4840
4840
|
} finally {
|
|
4841
4841
|
m(!1);
|
|
4842
4842
|
}
|
|
4843
4843
|
}
|
|
4844
|
-
},
|
|
4845
|
-
U(!1), M(!1), L({}),
|
|
4844
|
+
}, ae = () => {
|
|
4845
|
+
U(!1), M(!1), L({}), F(0);
|
|
4846
4846
|
};
|
|
4847
4847
|
if (c)
|
|
4848
|
-
return /* @__PURE__ */ r(
|
|
4848
|
+
return /* @__PURE__ */ r(X, { children: /* @__PURE__ */ r(ee, { children: /* @__PURE__ */ i("div", { style: { display: "flex", flexDirection: "column", alignItems: "center", padding: "48px 0", gap: "16px" }, children: [
|
|
4849
4849
|
/* @__PURE__ */ r(Pe, { className: "my-8" }),
|
|
4850
4850
|
/* @__PURE__ */ r("p", { style: { fontSize: "14px", color: "var(--metakyc-text-muted, #9ca3af)" }, children: "Loading test..." })
|
|
4851
4851
|
] }) }) });
|
|
4852
4852
|
if (!s)
|
|
4853
|
-
return /* @__PURE__ */ r(
|
|
4853
|
+
return /* @__PURE__ */ r(X, { children: /* @__PURE__ */ r(ee, { children: /* @__PURE__ */ i("div", { style: { textAlign: "center", padding: "48px 0" }, children: [
|
|
4854
4854
|
/* @__PURE__ */ r("p", { style: { fontSize: "16px", fontWeight: 600, color: "var(--metakyc-danger, #ef4444)" }, children: "No test data available" }),
|
|
4855
|
-
|
|
4855
|
+
I && /* @__PURE__ */ r("p", { style: { fontSize: "14px", color: "var(--metakyc-text-muted, #9ca3af)", marginTop: "8px" }, children: I })
|
|
4856
4856
|
] }) }) });
|
|
4857
|
-
const
|
|
4857
|
+
const re = s.testAllowedMaxTry - s.totalFailedTries, he = s.appropriatenessQuestions.length, de = Object.keys(R).length;
|
|
4858
4858
|
if (B > 0)
|
|
4859
|
-
return /* @__PURE__ */ i(
|
|
4859
|
+
return /* @__PURE__ */ i(X, { children: [
|
|
4860
4860
|
/* @__PURE__ */ r(be, { children: /* @__PURE__ */ r("h2", { style: { fontSize: "18px", fontWeight: 700, color: "var(--metakyc-text-primary, #111827)", margin: 0 }, children: s.displayName }) }),
|
|
4861
|
-
/* @__PURE__ */ r(
|
|
4861
|
+
/* @__PURE__ */ r(ee, { children: /* @__PURE__ */ i("div", { style: { textAlign: "center", padding: "32px 0" }, children: [
|
|
4862
4862
|
/* @__PURE__ */ r("div", { style: {
|
|
4863
4863
|
width: "100px",
|
|
4864
4864
|
height: "100px",
|
|
@@ -4876,22 +4876,101 @@ const vn = ({
|
|
|
4876
4876
|
}, children: yt(B) }) }),
|
|
4877
4877
|
/* @__PURE__ */ r("p", { style: { fontSize: "15px", fontWeight: 500, color: "var(--metakyc-text-primary, #111827)" }, children: "Please wait before retrying" }),
|
|
4878
4878
|
/* @__PURE__ */ r("p", { style: { fontSize: "13px", color: "var(--metakyc-text-muted, #9ca3af)", marginTop: "4px" }, children: "You can attempt the test again once the timer expires" }),
|
|
4879
|
-
|
|
4879
|
+
I && /* @__PURE__ */ r("div", { style: {
|
|
4880
4880
|
marginTop: "20px",
|
|
4881
4881
|
padding: "12px 16px",
|
|
4882
4882
|
borderRadius: "10px",
|
|
4883
4883
|
backgroundColor: "color-mix(in srgb, var(--metakyc-danger, #ef4444) 8%, transparent)",
|
|
4884
4884
|
border: "1px solid color-mix(in srgb, var(--metakyc-danger, #ef4444) 20%, transparent)"
|
|
4885
|
-
}, children: /* @__PURE__ */ r("p", { style: { fontSize: "13px", color: "var(--metakyc-danger, #ef4444)", margin: 0 }, children:
|
|
4885
|
+
}, children: /* @__PURE__ */ r("p", { style: { fontSize: "13px", color: "var(--metakyc-danger, #ef4444)", margin: 0 }, children: I }) })
|
|
4886
4886
|
] }) })
|
|
4887
4887
|
] });
|
|
4888
|
+
if (b) {
|
|
4889
|
+
const j = () => {
|
|
4890
|
+
$(null), ae(), T(null);
|
|
4891
|
+
};
|
|
4892
|
+
return /* @__PURE__ */ i(X, { children: [
|
|
4893
|
+
/* @__PURE__ */ r(ee, { children: /* @__PURE__ */ i("div", { style: {
|
|
4894
|
+
display: "flex",
|
|
4895
|
+
flexDirection: "column",
|
|
4896
|
+
alignItems: "center",
|
|
4897
|
+
textAlign: "center",
|
|
4898
|
+
padding: "40px 16px",
|
|
4899
|
+
gap: "16px"
|
|
4900
|
+
}, children: [
|
|
4901
|
+
/* @__PURE__ */ r("div", { style: {
|
|
4902
|
+
width: "72px",
|
|
4903
|
+
height: "72px",
|
|
4904
|
+
borderRadius: "50%",
|
|
4905
|
+
display: "flex",
|
|
4906
|
+
alignItems: "center",
|
|
4907
|
+
justifyContent: "center",
|
|
4908
|
+
backgroundColor: b.success ? "color-mix(in srgb, var(--metakyc-success, #10b981) 12%, transparent)" : "color-mix(in srgb, var(--metakyc-danger, #ef4444) 10%, transparent)"
|
|
4909
|
+
}, children: b.success ? /* @__PURE__ */ i("svg", { width: "36", height: "36", viewBox: "0 0 24 24", fill: "none", stroke: "var(--metakyc-success, #10b981)", strokeWidth: "2.5", strokeLinecap: "round", strokeLinejoin: "round", children: [
|
|
4910
|
+
/* @__PURE__ */ r("path", { d: "M22 11.08V12a10 10 0 1 1-5.93-9.14" }),
|
|
4911
|
+
/* @__PURE__ */ r("polyline", { points: "22 4 12 14.01 9 11.01" })
|
|
4912
|
+
] }) : /* @__PURE__ */ i("svg", { width: "36", height: "36", viewBox: "0 0 24 24", fill: "none", stroke: "var(--metakyc-danger, #ef4444)", strokeWidth: "2.5", strokeLinecap: "round", strokeLinejoin: "round", children: [
|
|
4913
|
+
/* @__PURE__ */ r("circle", { cx: "12", cy: "12", r: "10" }),
|
|
4914
|
+
/* @__PURE__ */ r("line", { x1: "15", y1: "9", x2: "9", y2: "15" }),
|
|
4915
|
+
/* @__PURE__ */ r("line", { x1: "9", y1: "9", x2: "15", y2: "15" })
|
|
4916
|
+
] }) }),
|
|
4917
|
+
/* @__PURE__ */ r("h2", { style: {
|
|
4918
|
+
fontSize: "20px",
|
|
4919
|
+
fontWeight: 700,
|
|
4920
|
+
color: b.success ? "var(--metakyc-success, #10b981)" : "var(--metakyc-danger, #ef4444)",
|
|
4921
|
+
margin: 0
|
|
4922
|
+
}, children: b.success ? "Test Passed" : "Test Failed" }),
|
|
4923
|
+
/* @__PURE__ */ r("p", { style: {
|
|
4924
|
+
fontSize: "14px",
|
|
4925
|
+
color: "var(--metakyc-text-secondary, #6b7280)",
|
|
4926
|
+
margin: 0,
|
|
4927
|
+
lineHeight: 1.6,
|
|
4928
|
+
maxWidth: "400px",
|
|
4929
|
+
whiteSpace: "pre-line"
|
|
4930
|
+
}, children: b.message }),
|
|
4931
|
+
!b.success && re > 0 && /* @__PURE__ */ r("div", { style: {
|
|
4932
|
+
marginTop: "4px",
|
|
4933
|
+
padding: "10px 20px",
|
|
4934
|
+
borderRadius: "10px",
|
|
4935
|
+
backgroundColor: "var(--metakyc-surface, #f9fafb)",
|
|
4936
|
+
border: "1px solid var(--metakyc-border, #e5e7eb)"
|
|
4937
|
+
}, children: /* @__PURE__ */ i("p", { style: {
|
|
4938
|
+
fontSize: "13px",
|
|
4939
|
+
color: "var(--metakyc-text-muted, #9ca3af)",
|
|
4940
|
+
margin: 0
|
|
4941
|
+
}, children: [
|
|
4942
|
+
"You have ",
|
|
4943
|
+
/* @__PURE__ */ r("strong", { style: { color: "var(--metakyc-text-primary, #111827)" }, children: re }),
|
|
4944
|
+
" attempt",
|
|
4945
|
+
re !== 1 ? "s" : "",
|
|
4946
|
+
" remaining"
|
|
4947
|
+
] }) }),
|
|
4948
|
+
!b.success && re <= 0 && /* @__PURE__ */ r("div", { style: {
|
|
4949
|
+
marginTop: "4px",
|
|
4950
|
+
padding: "10px 20px",
|
|
4951
|
+
borderRadius: "10px",
|
|
4952
|
+
backgroundColor: "color-mix(in srgb, var(--metakyc-danger, #ef4444) 8%, transparent)",
|
|
4953
|
+
border: "1px solid color-mix(in srgb, var(--metakyc-danger, #ef4444) 20%, transparent)"
|
|
4954
|
+
}, children: /* @__PURE__ */ r("p", { style: {
|
|
4955
|
+
fontSize: "13px",
|
|
4956
|
+
color: "var(--metakyc-danger, #ef4444)",
|
|
4957
|
+
margin: 0
|
|
4958
|
+
}, children: "No attempts remaining. Please contact support for assistance." }) })
|
|
4959
|
+
] }) }),
|
|
4960
|
+
/* @__PURE__ */ r(xe, { children: /* @__PURE__ */ r("div", { style: { display: "flex", justifyContent: "center", width: "100%", gap: "12px" }, children: b.success ? /* @__PURE__ */ r(V, { type: "button", onClick: () => t == null ? void 0 : t(), children: "Continue" }) : /* @__PURE__ */ i(rt, { children: [
|
|
4961
|
+
re > 0 && B <= 0 && /* @__PURE__ */ r(V, { type: "button", onClick: j, children: "Retake Test" }),
|
|
4962
|
+
re > 0 && B > 0 && /* @__PURE__ */ r(V, { type: "button", onClick: j, children: "OK" }),
|
|
4963
|
+
re <= 0 && n && /* @__PURE__ */ r(V, { type: "button", variant: "outline", onClick: n, children: "Back" })
|
|
4964
|
+
] }) }) })
|
|
4965
|
+
] });
|
|
4966
|
+
}
|
|
4888
4967
|
if (!D)
|
|
4889
|
-
return /* @__PURE__ */ i(
|
|
4968
|
+
return /* @__PURE__ */ i(X, { children: [
|
|
4890
4969
|
/* @__PURE__ */ i(be, { children: [
|
|
4891
4970
|
/* @__PURE__ */ r("h2", { style: { fontSize: "18px", fontWeight: 700, color: "var(--metakyc-text-primary, #111827)", margin: 0 }, children: s.displayName }),
|
|
4892
4971
|
s.subtitle && /* @__PURE__ */ r("p", { style: { fontSize: "14px", color: "var(--metakyc-text-secondary, #6b7280)", marginTop: "4px" }, children: s.subtitle })
|
|
4893
4972
|
] }),
|
|
4894
|
-
/* @__PURE__ */ i(
|
|
4973
|
+
/* @__PURE__ */ i(ee, { children: [
|
|
4895
4974
|
s.description && /* @__PURE__ */ i("div", { style: {
|
|
4896
4975
|
marginBottom: "20px",
|
|
4897
4976
|
padding: "12px 14px",
|
|
@@ -4917,12 +4996,12 @@ const vn = ({
|
|
|
4917
4996
|
{
|
|
4918
4997
|
icon: "retry",
|
|
4919
4998
|
label: "Attempts Left",
|
|
4920
|
-
value: String(
|
|
4921
|
-
variant:
|
|
4999
|
+
value: String(re),
|
|
5000
|
+
variant: re <= 1 ? "warning" : "default"
|
|
4922
5001
|
}
|
|
4923
5002
|
)
|
|
4924
5003
|
] }),
|
|
4925
|
-
|
|
5004
|
+
I && /* @__PURE__ */ i("div", { style: {
|
|
4926
5005
|
marginBottom: "16px",
|
|
4927
5006
|
padding: "12px 14px",
|
|
4928
5007
|
borderRadius: "10px",
|
|
@@ -4939,32 +5018,32 @@ const vn = ({
|
|
|
4939
5018
|
/* @__PURE__ */ i("p", { style: { fontSize: "13px", color: "var(--metakyc-danger, #ef4444)", margin: 0, lineHeight: 1.5 }, children: [
|
|
4940
5019
|
/* @__PURE__ */ r("strong", { children: "Previous attempt:" }),
|
|
4941
5020
|
" ",
|
|
4942
|
-
|
|
5021
|
+
I
|
|
4943
5022
|
] })
|
|
4944
5023
|
] }),
|
|
4945
|
-
|
|
5024
|
+
re <= 0 && /* @__PURE__ */ r("div", { style: {
|
|
4946
5025
|
padding: "12px 14px",
|
|
4947
5026
|
borderRadius: "10px",
|
|
4948
5027
|
backgroundColor: "color-mix(in srgb, var(--metakyc-danger, #ef4444) 8%, transparent)",
|
|
4949
5028
|
border: "1px solid color-mix(in srgb, var(--metakyc-danger, #ef4444) 20%, transparent)"
|
|
4950
5029
|
}, children: /* @__PURE__ */ r("p", { style: { fontSize: "13px", color: "var(--metakyc-danger, #ef4444)", margin: 0 }, children: "You have used all your attempts. Please contact support for assistance." }) })
|
|
4951
5030
|
] }),
|
|
4952
|
-
/* @__PURE__ */ r(
|
|
4953
|
-
n && /* @__PURE__ */ r(
|
|
4954
|
-
/* @__PURE__ */ r(
|
|
5031
|
+
/* @__PURE__ */ r(xe, { children: /* @__PURE__ */ i("div", { style: { display: "flex", alignItems: "center", justifyContent: n ? "space-between" : "flex-end", width: "100%" }, children: [
|
|
5032
|
+
n && /* @__PURE__ */ r(V, { type: "button", variant: "outline", onClick: n, children: "Back" }),
|
|
5033
|
+
/* @__PURE__ */ r(V, { type: "button", onClick: H, disabled: re <= 0, children: "Start Test" })
|
|
4955
5034
|
] }) })
|
|
4956
5035
|
] });
|
|
4957
|
-
const
|
|
4958
|
-
return /* @__PURE__ */ i(
|
|
5036
|
+
const P = s.appropriatenessQuestions[J], K = J === he - 1, Z = de === he, ue = f <= 60;
|
|
5037
|
+
return /* @__PURE__ */ i(X, { children: [
|
|
4959
5038
|
/* @__PURE__ */ i(be, { children: [
|
|
4960
5039
|
/* @__PURE__ */ i("div", { style: { display: "flex", alignItems: "center", justifyContent: "space-between" }, children: [
|
|
4961
5040
|
/* @__PURE__ */ i("div", { children: [
|
|
4962
5041
|
/* @__PURE__ */ r("h2", { style: { fontSize: "18px", fontWeight: 700, color: "var(--metakyc-text-primary, #111827)", margin: 0 }, children: s.displayName }),
|
|
4963
5042
|
/* @__PURE__ */ i("p", { style: { fontSize: "12px", color: "var(--metakyc-text-muted, #9ca3af)", marginTop: "2px" }, children: [
|
|
4964
5043
|
"Question ",
|
|
4965
|
-
|
|
5044
|
+
J + 1,
|
|
4966
5045
|
" of ",
|
|
4967
|
-
|
|
5046
|
+
he
|
|
4968
5047
|
] })
|
|
4969
5048
|
] }),
|
|
4970
5049
|
/* @__PURE__ */ i("div", { style: {
|
|
@@ -4973,7 +5052,7 @@ const vn = ({
|
|
|
4973
5052
|
gap: "8px",
|
|
4974
5053
|
padding: "6px 14px",
|
|
4975
5054
|
borderRadius: "999px",
|
|
4976
|
-
backgroundColor:
|
|
5055
|
+
backgroundColor: ue ? "color-mix(in srgb, var(--metakyc-danger, #ef4444) 10%, transparent)" : "var(--metakyc-surface, #f3f4f6)",
|
|
4977
5056
|
transition: "all 0.3s ease"
|
|
4978
5057
|
}, children: [
|
|
4979
5058
|
/* @__PURE__ */ i(
|
|
@@ -4983,7 +5062,7 @@ const vn = ({
|
|
|
4983
5062
|
height: "16",
|
|
4984
5063
|
viewBox: "0 0 24 24",
|
|
4985
5064
|
fill: "none",
|
|
4986
|
-
stroke:
|
|
5065
|
+
stroke: ue ? "var(--metakyc-danger, #ef4444)" : "var(--metakyc-text-muted, #9ca3af)",
|
|
4987
5066
|
strokeWidth: "2",
|
|
4988
5067
|
strokeLinecap: "round",
|
|
4989
5068
|
strokeLinejoin: "round",
|
|
@@ -4997,7 +5076,7 @@ const vn = ({
|
|
|
4997
5076
|
fontSize: "16px",
|
|
4998
5077
|
fontWeight: 700,
|
|
4999
5078
|
fontVariantNumeric: "tabular-nums",
|
|
5000
|
-
color:
|
|
5079
|
+
color: ue ? "var(--metakyc-danger, #ef4444)" : "var(--metakyc-text-primary, #111827)",
|
|
5001
5080
|
transition: "color 0.3s ease"
|
|
5002
5081
|
}, children: yt(f) })
|
|
5003
5082
|
] })
|
|
@@ -5012,7 +5091,7 @@ const vn = ({
|
|
|
5012
5091
|
height: "100%",
|
|
5013
5092
|
borderRadius: "999px",
|
|
5014
5093
|
backgroundColor: "var(--metakyc-primary, #2563eb)",
|
|
5015
|
-
width: `${
|
|
5094
|
+
width: `${de / he * 100}%`,
|
|
5016
5095
|
transition: "width 0.3s ease"
|
|
5017
5096
|
} }) }),
|
|
5018
5097
|
/* @__PURE__ */ i("div", { style: {
|
|
@@ -5021,47 +5100,47 @@ const vn = ({
|
|
|
5021
5100
|
marginTop: "4px"
|
|
5022
5101
|
}, children: [
|
|
5023
5102
|
/* @__PURE__ */ i("span", { style: { fontSize: "11px", color: "var(--metakyc-text-muted, #9ca3af)" }, children: [
|
|
5024
|
-
|
|
5103
|
+
de,
|
|
5025
5104
|
" answered"
|
|
5026
5105
|
] }),
|
|
5027
5106
|
/* @__PURE__ */ i("span", { style: { fontSize: "11px", color: "var(--metakyc-text-muted, #9ca3af)" }, children: [
|
|
5028
|
-
|
|
5107
|
+
re,
|
|
5029
5108
|
" attempt",
|
|
5030
|
-
|
|
5109
|
+
re !== 1 ? "s" : "",
|
|
5031
5110
|
" left"
|
|
5032
5111
|
] })
|
|
5033
5112
|
] })
|
|
5034
5113
|
] })
|
|
5035
5114
|
] }),
|
|
5036
|
-
/* @__PURE__ */ i(
|
|
5037
|
-
|
|
5115
|
+
/* @__PURE__ */ i(ee, { children: [
|
|
5116
|
+
P && /* @__PURE__ */ r(
|
|
5038
5117
|
wn,
|
|
5039
5118
|
{
|
|
5040
|
-
question:
|
|
5041
|
-
index:
|
|
5042
|
-
selectedAnswer:
|
|
5043
|
-
onSelect: (
|
|
5119
|
+
question: P,
|
|
5120
|
+
index: J,
|
|
5121
|
+
selectedAnswer: R[P.id],
|
|
5122
|
+
onSelect: (j) => z(P.id, j),
|
|
5044
5123
|
disabled: h
|
|
5045
5124
|
}
|
|
5046
5125
|
),
|
|
5047
|
-
|
|
5126
|
+
he > 1 && /* @__PURE__ */ r("div", { style: {
|
|
5048
5127
|
display: "flex",
|
|
5049
5128
|
justifyContent: "center",
|
|
5050
5129
|
gap: "6px",
|
|
5051
5130
|
marginTop: "20px",
|
|
5052
5131
|
flexWrap: "wrap"
|
|
5053
|
-
}, children: s.appropriatenessQuestions.map((
|
|
5132
|
+
}, children: s.appropriatenessQuestions.map((j, x) => /* @__PURE__ */ r(
|
|
5054
5133
|
"button",
|
|
5055
5134
|
{
|
|
5056
5135
|
type: "button",
|
|
5057
|
-
onClick: () =>
|
|
5136
|
+
onClick: () => F(x),
|
|
5058
5137
|
style: {
|
|
5059
5138
|
width: "28px",
|
|
5060
5139
|
height: "28px",
|
|
5061
5140
|
borderRadius: "8px",
|
|
5062
|
-
border:
|
|
5063
|
-
backgroundColor:
|
|
5064
|
-
color:
|
|
5141
|
+
border: x === J ? "2px solid var(--metakyc-primary, #2563eb)" : "1px solid var(--metakyc-border, #e5e7eb)",
|
|
5142
|
+
backgroundColor: R[j.id] ? x === J ? "color-mix(in srgb, var(--metakyc-primary, #2563eb) 15%, transparent)" : "color-mix(in srgb, var(--metakyc-primary, #2563eb) 8%, transparent)" : x === J ? "var(--metakyc-surface, #f9fafb)" : "var(--metakyc-background, #ffffff)",
|
|
5143
|
+
color: R[j.id] ? "var(--metakyc-primary, #2563eb)" : "var(--metakyc-text-muted, #9ca3af)",
|
|
5065
5144
|
fontSize: "12px",
|
|
5066
5145
|
fontWeight: 600,
|
|
5067
5146
|
cursor: "pointer",
|
|
@@ -5071,11 +5150,11 @@ const vn = ({
|
|
|
5071
5150
|
alignItems: "center",
|
|
5072
5151
|
justifyContent: "center"
|
|
5073
5152
|
},
|
|
5074
|
-
children:
|
|
5153
|
+
children: x + 1
|
|
5075
5154
|
},
|
|
5076
|
-
|
|
5155
|
+
j.id
|
|
5077
5156
|
)) }),
|
|
5078
|
-
|
|
5157
|
+
W && /* @__PURE__ */ i("div", { style: {
|
|
5079
5158
|
marginTop: "16px",
|
|
5080
5159
|
padding: "12px 14px",
|
|
5081
5160
|
borderRadius: "10px",
|
|
@@ -5091,45 +5170,45 @@ const vn = ({
|
|
|
5091
5170
|
] }),
|
|
5092
5171
|
/* @__PURE__ */ r("p", { style: { fontSize: "13px", color: "#b45309", margin: 0, fontWeight: 500 }, children: "Time's up! Your answers are being submitted." })
|
|
5093
5172
|
] }),
|
|
5094
|
-
|
|
5173
|
+
I && !W && /* @__PURE__ */ r("div", { style: {
|
|
5095
5174
|
marginTop: "16px",
|
|
5096
5175
|
padding: "12px 14px",
|
|
5097
5176
|
borderRadius: "10px",
|
|
5098
5177
|
backgroundColor: "color-mix(in srgb, var(--metakyc-danger, #ef4444) 8%, transparent)",
|
|
5099
5178
|
border: "1px solid color-mix(in srgb, var(--metakyc-danger, #ef4444) 20%, transparent)"
|
|
5100
|
-
}, children: /* @__PURE__ */ r("p", { style: { fontSize: "13px", color: "var(--metakyc-danger, #ef4444)", margin: 0 }, children:
|
|
5179
|
+
}, children: /* @__PURE__ */ r("p", { style: { fontSize: "13px", color: "var(--metakyc-danger, #ef4444)", margin: 0 }, children: I }) })
|
|
5101
5180
|
] }),
|
|
5102
|
-
/* @__PURE__ */ r(
|
|
5181
|
+
/* @__PURE__ */ r(xe, { children: /* @__PURE__ */ i("div", { style: { display: "flex", alignItems: "center", justifyContent: "space-between", width: "100%" }, children: [
|
|
5103
5182
|
/* @__PURE__ */ r(
|
|
5104
|
-
|
|
5183
|
+
V,
|
|
5105
5184
|
{
|
|
5106
5185
|
type: "button",
|
|
5107
5186
|
variant: "outline",
|
|
5108
5187
|
onClick: () => {
|
|
5109
|
-
|
|
5188
|
+
J > 0 ? F((j) => j - 1) : n == null || n();
|
|
5110
5189
|
},
|
|
5111
5190
|
disabled: h,
|
|
5112
|
-
children:
|
|
5191
|
+
children: J > 0 ? "Previous" : "Cancel"
|
|
5113
5192
|
}
|
|
5114
5193
|
),
|
|
5115
5194
|
/* @__PURE__ */ i("div", { style: { display: "flex", gap: "8px" }, children: [
|
|
5116
|
-
!
|
|
5117
|
-
|
|
5195
|
+
!K && /* @__PURE__ */ r(
|
|
5196
|
+
V,
|
|
5118
5197
|
{
|
|
5119
5198
|
type: "button",
|
|
5120
|
-
onClick: () =>
|
|
5199
|
+
onClick: () => F((j) => j + 1),
|
|
5121
5200
|
children: "Next"
|
|
5122
5201
|
}
|
|
5123
5202
|
),
|
|
5124
|
-
(
|
|
5125
|
-
|
|
5203
|
+
(K || Z) && /* @__PURE__ */ r(
|
|
5204
|
+
V,
|
|
5126
5205
|
{
|
|
5127
5206
|
type: "button",
|
|
5128
5207
|
isLoading: h,
|
|
5129
|
-
onClick: () =>
|
|
5130
|
-
disabled: !
|
|
5131
|
-
style: { opacity:
|
|
5132
|
-
children:
|
|
5208
|
+
onClick: () => ne(),
|
|
5209
|
+
disabled: !Z && !W,
|
|
5210
|
+
style: { opacity: Z || W ? 1 : 0.5 },
|
|
5211
|
+
children: W ? "Submitting..." : "Submit Test"
|
|
5133
5212
|
}
|
|
5134
5213
|
)
|
|
5135
5214
|
] })
|
|
@@ -5267,9 +5346,9 @@ const vn = ({
|
|
|
5267
5346
|
onBack: n
|
|
5268
5347
|
}) => {
|
|
5269
5348
|
var Me, Ze, je, We;
|
|
5270
|
-
const { applicantService: a, baseInformationService: s, config: l, currentTheme: c } = Re(), { identityData: u, provider: h, token: m, isLoading:
|
|
5271
|
-
|
|
5272
|
-
const
|
|
5349
|
+
const { applicantService: a, baseInformationService: s, config: l, currentTheme: c } = Re(), { identityData: u, provider: h, token: m, isLoading: I, error: T, requestIdentity: R, restartIdentity: L } = Hr(e), [f, S] = k(null), [D, U] = k(null), [W, M] = k([]), [B, G] = k([]), [J, F] = k(!0), [b, $] = k(!1), [H, z] = k(null), [O, ne] = k(!1), ae = Fe.useRef(!1), [re, he] = k({}), [de, P] = k({}), K = c != null && c.reviewPageFields && c.reviewPageFields.length > 0 ? c.reviewPageFields[0] : null, Z = !!(c != null && c.reviewPageDisabled), ue = le(!1);
|
|
5350
|
+
ue.current = Z;
|
|
5351
|
+
const j = Wt({
|
|
5273
5352
|
defaultValues: {
|
|
5274
5353
|
street: "",
|
|
5275
5354
|
streetNumber: "",
|
|
@@ -5281,24 +5360,24 @@ const vn = ({
|
|
|
5281
5360
|
}
|
|
5282
5361
|
});
|
|
5283
5362
|
ye(() => {
|
|
5284
|
-
if (
|
|
5285
|
-
|
|
5363
|
+
if (Z) {
|
|
5364
|
+
ae.current || (ae.current = !0, R().then(() => $(!0)).catch((_) => console.error("[Identity] Auto-request failed:", _)).finally(() => F(!1)));
|
|
5286
5365
|
return;
|
|
5287
5366
|
}
|
|
5288
5367
|
(async () => {
|
|
5289
5368
|
try {
|
|
5290
|
-
const [
|
|
5369
|
+
const [_, q, p] = await Promise.all([
|
|
5291
5370
|
a.getApplicantData(e),
|
|
5292
5371
|
s.getCountries("", "en"),
|
|
5293
5372
|
s.getCountries("", "en", 40)
|
|
5294
5373
|
// CountriesType.PhoneNumber
|
|
5295
5374
|
]);
|
|
5296
|
-
U(
|
|
5297
|
-
const
|
|
5298
|
-
M(
|
|
5299
|
-
const
|
|
5300
|
-
|
|
5301
|
-
const d =
|
|
5375
|
+
U(_);
|
|
5376
|
+
const w = /* @__PURE__ */ new Set(), E = q.map((y) => ({ value: y.abbreviation3 || y.abbreviation, label: y.name })).filter((y) => !y.value || w.has(y.value) ? !1 : (w.add(y.value), !0));
|
|
5377
|
+
M(E);
|
|
5378
|
+
const v = /* @__PURE__ */ new Set(), o = p.filter((y) => y.countryCode).map((y) => ({ value: y.countryCode, label: `${y.countryCode} – ${y.name}` })).filter((y) => v.has(y.value) ? !1 : (v.add(y.value), !0));
|
|
5379
|
+
G(o);
|
|
5380
|
+
const d = _.applicantRequestData;
|
|
5302
5381
|
if (he({
|
|
5303
5382
|
firstName: (d == null ? void 0 : d.firstName) || "",
|
|
5304
5383
|
lastName: (d == null ? void 0 : d.lastName) || "",
|
|
@@ -5321,7 +5400,7 @@ const vn = ({
|
|
|
5321
5400
|
occupation: (d == null ? void 0 : d.occupation) || "",
|
|
5322
5401
|
taxNumber: (d == null ? void 0 : d.taxNumber) || "",
|
|
5323
5402
|
defaultLanguage: (d == null ? void 0 : d.defaultLanguage) || ""
|
|
5324
|
-
}),
|
|
5403
|
+
}), j.reset({
|
|
5325
5404
|
street: (d == null ? void 0 : d.street) || "",
|
|
5326
5405
|
streetNumber: (d == null ? void 0 : d.streetNumber) || "",
|
|
5327
5406
|
city: (d == null ? void 0 : d.city) || "",
|
|
@@ -5329,43 +5408,43 @@ const vn = ({
|
|
|
5329
5408
|
country: (d == null ? void 0 : d.country) || "",
|
|
5330
5409
|
nationality: (d == null ? void 0 : d.nationality) || "",
|
|
5331
5410
|
phonenumber: (d == null ? void 0 : d.phonenumber) || ""
|
|
5332
|
-
}),
|
|
5333
|
-
console.log("[Identity] Review page disabled + existing identity — auto-requesting..."),
|
|
5411
|
+
}), _.kycRecords && _.kycRecords.length > 0 && _.kycRecords[0].providerTokenObject !== null && !ae.current && ue.current) {
|
|
5412
|
+
console.log("[Identity] Review page disabled + existing identity — auto-requesting..."), ae.current = !0;
|
|
5334
5413
|
try {
|
|
5335
|
-
await
|
|
5414
|
+
await R(), $(!0);
|
|
5336
5415
|
} catch (y) {
|
|
5337
5416
|
console.error("[Identity] Auto-request failed:", y);
|
|
5338
5417
|
}
|
|
5339
5418
|
}
|
|
5340
|
-
} catch (
|
|
5341
|
-
console.error("Error loading applicant data:",
|
|
5419
|
+
} catch (_) {
|
|
5420
|
+
console.error("Error loading applicant data:", _);
|
|
5342
5421
|
} finally {
|
|
5343
|
-
|
|
5422
|
+
F(!1);
|
|
5344
5423
|
}
|
|
5345
5424
|
})();
|
|
5346
5425
|
}, [e]), ye(() => {
|
|
5347
|
-
u && !b &&
|
|
5426
|
+
u && !b && ue.current && (console.log("[Identity] Review page disabled — showing cached provider"), $(!0));
|
|
5348
5427
|
}, [u, b]), ye(() => {
|
|
5349
5428
|
if (m) {
|
|
5350
5429
|
if (m.expiresAt) {
|
|
5351
5430
|
const g = new Date(m.expiresAt).getTime();
|
|
5352
5431
|
if (Date.now() >= g) {
|
|
5353
|
-
console.warn("[Identity] Token has expired (expiresAt)"),
|
|
5432
|
+
console.warn("[Identity] Token has expired (expiresAt)"), ne(!0), z("Your verification session has expired. Please restart.");
|
|
5354
5433
|
return;
|
|
5355
5434
|
}
|
|
5356
5435
|
}
|
|
5357
5436
|
if (m.url)
|
|
5358
5437
|
try {
|
|
5359
|
-
const
|
|
5360
|
-
if (
|
|
5361
|
-
console.warn("[Identity] Token URL indicates expiration"),
|
|
5438
|
+
const _ = new URL(m.url).toString().toLowerCase();
|
|
5439
|
+
if (_.includes("expired") || _.includes("invalid") || _.includes("error")) {
|
|
5440
|
+
console.warn("[Identity] Token URL indicates expiration"), ne(!0), z("Your verification link has expired. Please restart.");
|
|
5362
5441
|
return;
|
|
5363
5442
|
}
|
|
5364
5443
|
} catch {
|
|
5365
5444
|
console.error("[Identity] Invalid token URL");
|
|
5366
5445
|
}
|
|
5367
5446
|
if (m.status === "expired" || m.error === "expired" || m.expired === !0) {
|
|
5368
|
-
console.warn("[Identity] Token object indicates expiration"),
|
|
5447
|
+
console.warn("[Identity] Token object indicates expiration"), ne(!0), z("Your verification session has expired. Please restart.");
|
|
5369
5448
|
return;
|
|
5370
5449
|
}
|
|
5371
5450
|
}
|
|
@@ -5378,54 +5457,54 @@ const vn = ({
|
|
|
5378
5457
|
if (new URL(m.url), g === Le.SardinAI) {
|
|
5379
5458
|
console.log("[SardinAI] Initializing Risk SDK in background...");
|
|
5380
5459
|
try {
|
|
5381
|
-
const
|
|
5382
|
-
et.createProvider(h,
|
|
5460
|
+
const _ = et.parseProviderConfig(h, m, l);
|
|
5461
|
+
et.createProvider(h, _).initialize().then(() => {
|
|
5383
5462
|
console.log("[SardinAI] Risk SDK initialized successfully in background");
|
|
5384
5463
|
}).catch((p) => {
|
|
5385
5464
|
console.warn("[SardinAI] Risk SDK initialization failed (non-blocking):", p);
|
|
5386
5465
|
});
|
|
5387
|
-
} catch (
|
|
5388
|
-
console.warn("[SardinAI] Risk SDK setup failed (non-blocking):",
|
|
5466
|
+
} catch (_) {
|
|
5467
|
+
console.warn("[SardinAI] Risk SDK setup failed (non-blocking):", _);
|
|
5389
5468
|
}
|
|
5390
5469
|
}
|
|
5391
|
-
|
|
5392
|
-
} catch (
|
|
5393
|
-
console.error("[Identity] Invalid URL:",
|
|
5470
|
+
S({ type: "url", url: m.url });
|
|
5471
|
+
} catch (_) {
|
|
5472
|
+
console.error("[Identity] Invalid URL:", _), z("Invalid verification URL. Please restart."), ne(!0);
|
|
5394
5473
|
}
|
|
5395
5474
|
return;
|
|
5396
5475
|
}
|
|
5397
5476
|
if (g === Le.SardinAI) {
|
|
5398
5477
|
console.log("[SardinAI] No URL provided - initializing Risk SDK only..."), z(null);
|
|
5399
5478
|
try {
|
|
5400
|
-
const
|
|
5479
|
+
const _ = et.parseProviderConfig(h, m, l), q = et.createProvider(h, _);
|
|
5401
5480
|
q.initialize().then(() => {
|
|
5402
|
-
console.log("[SardinAI] Risk SDK initialized successfully"),
|
|
5481
|
+
console.log("[SardinAI] Risk SDK initialized successfully"), S(q), setTimeout(() => {
|
|
5403
5482
|
t == null || t();
|
|
5404
5483
|
}, 2e3);
|
|
5405
5484
|
}).catch((p) => {
|
|
5406
|
-
var
|
|
5485
|
+
var E;
|
|
5407
5486
|
console.error("[SardinAI] Failed to initialize:", p);
|
|
5408
|
-
const
|
|
5409
|
-
|
|
5487
|
+
const w = ((E = p.message) == null ? void 0 : E.toLowerCase()) || "";
|
|
5488
|
+
w.includes("expired") || w.includes("invalid") || w.includes("401") || w.includes("400") ? (ne(!0), z("Session expired or invalid. Please restart verification.")) : z(`Failed to initialize: ${p.message}`);
|
|
5410
5489
|
});
|
|
5411
|
-
} catch (
|
|
5412
|
-
console.error("[SardinAI] Error creating provider:",
|
|
5490
|
+
} catch (_) {
|
|
5491
|
+
console.error("[SardinAI] Error creating provider:", _), z(`Configuration error: ${_.message}`);
|
|
5413
5492
|
}
|
|
5414
5493
|
return;
|
|
5415
5494
|
}
|
|
5416
5495
|
try {
|
|
5417
5496
|
z(null);
|
|
5418
|
-
const
|
|
5497
|
+
const _ = et.parseProviderConfig(h, m, l), q = et.createProvider(h, _);
|
|
5419
5498
|
g === Le.Sumsub ? (q.initialize("identity-container").catch((p) => {
|
|
5420
|
-
var
|
|
5421
|
-
console.error("[Sumsub] Initialization error:", p), z(`Failed to initialize: ${p.message}`), (
|
|
5499
|
+
var w;
|
|
5500
|
+
console.error("[Sumsub] Initialization error:", p), z(`Failed to initialize: ${p.message}`), (w = p.message) != null && w.toLowerCase().includes("expired") && ne(!0);
|
|
5422
5501
|
}), q.onComplete && q.onComplete(() => {
|
|
5423
5502
|
t == null || t();
|
|
5424
5503
|
})) : g === Le.Onfido && q.initialize("identity-container").catch((p) => {
|
|
5425
5504
|
console.error("[Onfido] Initialization error:", p), z(`Failed to initialize: ${p.message}`);
|
|
5426
|
-
}),
|
|
5427
|
-
} catch (
|
|
5428
|
-
console.error("[Identity] Provider setup error:",
|
|
5505
|
+
}), S(q);
|
|
5506
|
+
} catch (_) {
|
|
5507
|
+
console.error("[Identity] Provider setup error:", _), z(`Setup error: ${_.message}`);
|
|
5429
5508
|
}
|
|
5430
5509
|
}
|
|
5431
5510
|
return () => {
|
|
@@ -5437,33 +5516,33 @@ const vn = ({
|
|
|
5437
5516
|
}
|
|
5438
5517
|
};
|
|
5439
5518
|
}, [h, m, f, b, t, O]);
|
|
5440
|
-
const
|
|
5519
|
+
const x = async () => {
|
|
5441
5520
|
try {
|
|
5442
|
-
z(null),
|
|
5521
|
+
z(null), ne(!1), await R(), $(!0);
|
|
5443
5522
|
} catch (g) {
|
|
5444
5523
|
console.error("Error starting identity verification:", g);
|
|
5445
5524
|
}
|
|
5446
|
-
},
|
|
5525
|
+
}, Q = async () => {
|
|
5447
5526
|
try {
|
|
5448
|
-
z(null),
|
|
5527
|
+
z(null), ne(!1), S(null), console.log("[Identity] Restarting verification..."), await L(), $(!0);
|
|
5449
5528
|
} catch (g) {
|
|
5450
5529
|
console.error("Error restarting identity verification:", g), z(g.message || "Failed to restart verification");
|
|
5451
5530
|
}
|
|
5452
5531
|
};
|
|
5453
|
-
if (
|
|
5454
|
-
return /* @__PURE__ */ r(
|
|
5532
|
+
if (J || I)
|
|
5533
|
+
return /* @__PURE__ */ r(X, { children: /* @__PURE__ */ i(ee, { children: [
|
|
5455
5534
|
/* @__PURE__ */ r(Pe, { className: "my-8" }),
|
|
5456
5535
|
/* @__PURE__ */ r("p", { className: "text-center text-gray-600 dark:text-gray-400 mt-4", children: "Loading identity verification..." })
|
|
5457
5536
|
] }) });
|
|
5458
5537
|
if (T)
|
|
5459
|
-
return /* @__PURE__ */ r(
|
|
5538
|
+
return /* @__PURE__ */ r(X, { children: /* @__PURE__ */ r(ee, { children: /* @__PURE__ */ i("p", { className: "text-danger-500", children: [
|
|
5460
5539
|
"Error: ",
|
|
5461
5540
|
T.message
|
|
5462
5541
|
] }) }) });
|
|
5463
5542
|
if (b && (H || O))
|
|
5464
|
-
return /* @__PURE__ */ i(
|
|
5543
|
+
return /* @__PURE__ */ i(X, { children: [
|
|
5465
5544
|
/* @__PURE__ */ r(be, { children: /* @__PURE__ */ r("h2", { className: "text-2xl font-bold text-gray-900 dark:text-white", children: "Verification Session Issue" }) }),
|
|
5466
|
-
/* @__PURE__ */ i(
|
|
5545
|
+
/* @__PURE__ */ i(ee, { children: [
|
|
5467
5546
|
/* @__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__ */ i("div", { className: "flex items-start", children: [
|
|
5468
5547
|
/* @__PURE__ */ r(
|
|
5469
5548
|
"svg",
|
|
@@ -5497,32 +5576,32 @@ const vn = ({
|
|
|
5497
5576
|
] })
|
|
5498
5577
|
] })
|
|
5499
5578
|
] }),
|
|
5500
|
-
/* @__PURE__ */ i(
|
|
5501
|
-
n && /* @__PURE__ */ r(
|
|
5502
|
-
/* @__PURE__ */ r(
|
|
5579
|
+
/* @__PURE__ */ i(xe, { className: "flex justify-between", children: [
|
|
5580
|
+
n && /* @__PURE__ */ r(V, { type: "button", variant: "outline", onClick: n, children: "Back" }),
|
|
5581
|
+
/* @__PURE__ */ r(V, { type: "button", onClick: Q, disabled: I, children: I ? "Restarting..." : "Restart Verification" })
|
|
5503
5582
|
] })
|
|
5504
5583
|
] });
|
|
5505
5584
|
if (b && u) {
|
|
5506
5585
|
const g = h;
|
|
5507
|
-
return m != null && m.url ? /* @__PURE__ */ i(
|
|
5586
|
+
return m != null && m.url ? /* @__PURE__ */ i(X, { children: [
|
|
5508
5587
|
/* @__PURE__ */ r(be, { children: /* @__PURE__ */ i("div", { className: "flex items-center justify-between", children: [
|
|
5509
5588
|
/* @__PURE__ */ i("div", { children: [
|
|
5510
5589
|
/* @__PURE__ */ r("h2", { className: "text-2xl font-bold", children: "Identity Verification" }),
|
|
5511
5590
|
/* @__PURE__ */ r("p", { className: "text-gray-600 dark:text-gray-400 mt-1", children: "Please complete the identity verification process" })
|
|
5512
5591
|
] }),
|
|
5513
5592
|
/* @__PURE__ */ r(
|
|
5514
|
-
|
|
5593
|
+
V,
|
|
5515
5594
|
{
|
|
5516
5595
|
type: "button",
|
|
5517
5596
|
variant: "outline",
|
|
5518
5597
|
size: "sm",
|
|
5519
|
-
onClick:
|
|
5520
|
-
disabled:
|
|
5598
|
+
onClick: Q,
|
|
5599
|
+
disabled: I,
|
|
5521
5600
|
children: "Restart"
|
|
5522
5601
|
}
|
|
5523
5602
|
)
|
|
5524
5603
|
] }) }),
|
|
5525
|
-
/* @__PURE__ */ i(
|
|
5604
|
+
/* @__PURE__ */ i(ee, { children: [
|
|
5526
5605
|
/* @__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__ */ i("p", { className: "text-yellow-800 dark:text-yellow-200 text-sm", children: [
|
|
5527
5606
|
/* @__PURE__ */ r("strong", { children: "Important:" }),
|
|
5528
5607
|
' If you see an "expired" or "invalid link" message below, click the "Restart" button above to generate a new verification session.'
|
|
@@ -5534,14 +5613,14 @@ const vn = ({
|
|
|
5534
5613
|
className: "w-full h-full border-0 rounded-lg",
|
|
5535
5614
|
allow: "camera; microphone; geolocation",
|
|
5536
5615
|
title: "Identity Verification",
|
|
5537
|
-
onLoad: (
|
|
5538
|
-
var q, p,
|
|
5616
|
+
onLoad: (_) => {
|
|
5617
|
+
var q, p, w;
|
|
5539
5618
|
console.log("[Identity] Iframe loaded");
|
|
5540
5619
|
try {
|
|
5541
|
-
const
|
|
5542
|
-
if (
|
|
5543
|
-
const o = ((
|
|
5544
|
-
(o.includes("expired") || o.includes("invalid") || o.includes("error")) && (console.warn("[Identity] Iframe shows expiration message"),
|
|
5620
|
+
const E = _.target, v = E.contentDocument || ((q = E.contentWindow) == null ? void 0 : q.document);
|
|
5621
|
+
if (v) {
|
|
5622
|
+
const o = ((w = (p = v.body) == null ? void 0 : p.textContent) == null ? void 0 : w.toLowerCase()) || "";
|
|
5623
|
+
(o.includes("expired") || o.includes("invalid") || o.includes("error")) && (console.warn("[Identity] Iframe shows expiration message"), ne(!0), z("Your verification link has expired."));
|
|
5545
5624
|
}
|
|
5546
5625
|
} catch {
|
|
5547
5626
|
console.log("[Identity] Cannot check iframe content (CORS)");
|
|
@@ -5550,36 +5629,36 @@ const vn = ({
|
|
|
5550
5629
|
}
|
|
5551
5630
|
) })
|
|
5552
5631
|
] }),
|
|
5553
|
-
n && /* @__PURE__ */ r(
|
|
5554
|
-
] }) : g === Le.SardinAI ? /* @__PURE__ */ i(
|
|
5632
|
+
n && /* @__PURE__ */ r(xe, { children: /* @__PURE__ */ r(V, { variant: "outline", onClick: n, children: "Back" }) })
|
|
5633
|
+
] }) : g === Le.SardinAI ? /* @__PURE__ */ i(X, { children: [
|
|
5555
5634
|
/* @__PURE__ */ i(be, { children: [
|
|
5556
5635
|
/* @__PURE__ */ r("h2", { className: "text-2xl font-bold", children: "Device Risk Assessment" }),
|
|
5557
5636
|
/* @__PURE__ */ r("p", { className: "text-gray-600 dark:text-gray-400 mt-1", children: "Analyzing device security and behavioral patterns..." })
|
|
5558
5637
|
] }),
|
|
5559
|
-
/* @__PURE__ */ r(
|
|
5638
|
+
/* @__PURE__ */ r(ee, { children: /* @__PURE__ */ i("div", { className: "text-center py-12", children: [
|
|
5560
5639
|
/* @__PURE__ */ r(Pe, { className: "mb-4" }),
|
|
5561
5640
|
/* @__PURE__ */ r("p", { className: "text-gray-600 dark:text-gray-400", children: "Please wait while we verify your device security" }),
|
|
5562
5641
|
/* @__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" })
|
|
5563
5642
|
] }) })
|
|
5564
|
-
] }) : /* @__PURE__ */ i(
|
|
5643
|
+
] }) : /* @__PURE__ */ i(X, { children: [
|
|
5565
5644
|
/* @__PURE__ */ i(be, { children: [
|
|
5566
5645
|
/* @__PURE__ */ r("h2", { className: "text-2xl font-bold", children: "Identity Verification" }),
|
|
5567
5646
|
/* @__PURE__ */ r("p", { className: "text-gray-600 dark:text-gray-400 mt-1", children: "Please complete the identity verification process" })
|
|
5568
5647
|
] }),
|
|
5569
|
-
/* @__PURE__ */ r(
|
|
5570
|
-
n && /* @__PURE__ */ r(
|
|
5648
|
+
/* @__PURE__ */ r(ee, { children: /* @__PURE__ */ r("div", { id: "identity-container", className: "min-h-[400px]" }) }),
|
|
5649
|
+
n && /* @__PURE__ */ r(xe, { children: /* @__PURE__ */ r(V, { variant: "outline", onClick: n, children: "Back" }) })
|
|
5571
5650
|
] });
|
|
5572
5651
|
}
|
|
5573
|
-
const
|
|
5574
|
-
if (!
|
|
5575
|
-
if (
|
|
5576
|
-
const q =
|
|
5577
|
-
return q ? q.label : String(
|
|
5652
|
+
const Y = /* @__PURE__ */ new Set(["country", "nationality", "taxCountry", "countryOfBirth", "mobileCountryCode", "otherNationality"]), ce = (g = 4) => ({ 1: "col-span-1", 2: "col-span-2", 3: "col-span-3", 4: "col-span-4" })[g] || "col-span-4", we = (g, _) => {
|
|
5653
|
+
if (!_ && _ !== 0) return "—";
|
|
5654
|
+
if (Y.has(g) && g !== "mobileCountryCode") {
|
|
5655
|
+
const q = W.find((p) => p.value === _);
|
|
5656
|
+
return q ? q.label : String(_);
|
|
5578
5657
|
}
|
|
5579
|
-
return String(
|
|
5658
|
+
return String(_);
|
|
5580
5659
|
}, De = ({ helpText: g }) => {
|
|
5581
|
-
const [
|
|
5582
|
-
return /* @__PURE__ */ i(
|
|
5660
|
+
const [_, q] = k(!1), p = le(null), [, w] = k({ top: 0, left: 0 });
|
|
5661
|
+
return /* @__PURE__ */ i(rt, { children: [
|
|
5583
5662
|
/* @__PURE__ */ r(
|
|
5584
5663
|
"button",
|
|
5585
5664
|
{
|
|
@@ -5588,8 +5667,8 @@ const vn = ({
|
|
|
5588
5667
|
ref: p,
|
|
5589
5668
|
onClick: () => {
|
|
5590
5669
|
if (p.current) {
|
|
5591
|
-
const
|
|
5592
|
-
|
|
5670
|
+
const v = p.current.getBoundingClientRect();
|
|
5671
|
+
w({ top: v.bottom + window.scrollY + 6, left: v.left + window.scrollX });
|
|
5593
5672
|
}
|
|
5594
5673
|
q(!0);
|
|
5595
5674
|
},
|
|
@@ -5614,7 +5693,7 @@ const vn = ({
|
|
|
5614
5693
|
children: "?"
|
|
5615
5694
|
}
|
|
5616
5695
|
),
|
|
5617
|
-
|
|
5696
|
+
_ && Ut.createPortal(
|
|
5618
5697
|
/* @__PURE__ */ r(
|
|
5619
5698
|
"div",
|
|
5620
5699
|
{
|
|
@@ -5633,7 +5712,7 @@ const vn = ({
|
|
|
5633
5712
|
children: /* @__PURE__ */ i(
|
|
5634
5713
|
"div",
|
|
5635
5714
|
{
|
|
5636
|
-
onClick: (
|
|
5715
|
+
onClick: (v) => v.stopPropagation(),
|
|
5637
5716
|
style: {
|
|
5638
5717
|
background: "var(--metakyc-surface, var(--metakyc-background, #ffffff))",
|
|
5639
5718
|
border: "1px solid var(--metakyc-border, #e5e7eb)",
|
|
@@ -5671,15 +5750,15 @@ const vn = ({
|
|
|
5671
5750
|
document.body
|
|
5672
5751
|
)
|
|
5673
5752
|
] });
|
|
5674
|
-
},
|
|
5753
|
+
}, ve = (g, _) => _ ? /* @__PURE__ */ i("div", { style: { display: "flex", alignItems: "flex-start", gap: 5, flexWrap: "nowrap" }, children: [
|
|
5675
5754
|
/* @__PURE__ */ r("div", { style: { flex: 1, minWidth: 0 }, children: g }),
|
|
5676
|
-
/* @__PURE__ */ r("div", { style: { paddingTop: 24 }, children: /* @__PURE__ */ r(De, { helpText:
|
|
5677
|
-
] }) : g, Ge = (g,
|
|
5678
|
-
const q = `cf-${
|
|
5755
|
+
/* @__PURE__ */ r("div", { style: { paddingTop: 24 }, children: /* @__PURE__ */ r(De, { helpText: _ }) })
|
|
5756
|
+
] }) : g, Ge = (g, _) => {
|
|
5757
|
+
const q = `cf-${_}`, p = g.paramName ?? "", w = de[p];
|
|
5679
5758
|
if (g.customType === "br")
|
|
5680
|
-
return /* @__PURE__ */ r("div", { className:
|
|
5759
|
+
return /* @__PURE__ */ r("div", { className: ce(g.colSpan), style: { minHeight: "0.5rem" } }, q);
|
|
5681
5760
|
if (g.customType === "paragraph")
|
|
5682
|
-
return /* @__PURE__ */ r("div", { className:
|
|
5761
|
+
return /* @__PURE__ */ r("div", { className: ce(g.colSpan), children: /* @__PURE__ */ r(
|
|
5683
5762
|
"div",
|
|
5684
5763
|
{
|
|
5685
5764
|
className: "text-sm",
|
|
@@ -5691,13 +5770,13 @@ const vn = ({
|
|
|
5691
5770
|
return /* @__PURE__ */ r(
|
|
5692
5771
|
"div",
|
|
5693
5772
|
{
|
|
5694
|
-
className:
|
|
5773
|
+
className: ce(g.colSpan),
|
|
5695
5774
|
dangerouslySetInnerHTML: { __html: g.label || "" }
|
|
5696
5775
|
},
|
|
5697
5776
|
q
|
|
5698
5777
|
);
|
|
5699
5778
|
if (g.customType === "link")
|
|
5700
|
-
return /* @__PURE__ */ r("div", { className:
|
|
5779
|
+
return /* @__PURE__ */ r("div", { className: ce(g.colSpan), children: ve(
|
|
5701
5780
|
/* @__PURE__ */ r(
|
|
5702
5781
|
"a",
|
|
5703
5782
|
{
|
|
@@ -5712,15 +5791,15 @@ const vn = ({
|
|
|
5712
5791
|
g.helpText
|
|
5713
5792
|
) }, q);
|
|
5714
5793
|
if (g.customType === "checkbox" || g.customType === "link_checkbox") {
|
|
5715
|
-
const
|
|
5716
|
-
return /* @__PURE__ */ r("div", { className:
|
|
5794
|
+
const E = w === "true" || w === !0;
|
|
5795
|
+
return /* @__PURE__ */ r("div", { className: ce(g.colSpan), children: ve(
|
|
5717
5796
|
/* @__PURE__ */ i("label", { style: { display: "flex", alignItems: "flex-start", gap: 8, cursor: "pointer" }, children: [
|
|
5718
5797
|
/* @__PURE__ */ r(
|
|
5719
5798
|
"input",
|
|
5720
5799
|
{
|
|
5721
5800
|
type: "checkbox",
|
|
5722
|
-
checked: !!
|
|
5723
|
-
onChange: (
|
|
5801
|
+
checked: !!E,
|
|
5802
|
+
onChange: (v) => P((o) => ({ ...o, [p]: String(v.target.checked) })),
|
|
5724
5803
|
style: {
|
|
5725
5804
|
width: 16,
|
|
5726
5805
|
height: 16,
|
|
@@ -5730,7 +5809,7 @@ const vn = ({
|
|
|
5730
5809
|
}
|
|
5731
5810
|
}
|
|
5732
5811
|
),
|
|
5733
|
-
/* @__PURE__ */ r("span", { className: "text-sm", style: { color: "var(--metakyc-text-primary, #111827)" }, children: g.customType === "link_checkbox" && g.linkUrl ? /* @__PURE__ */ i(
|
|
5812
|
+
/* @__PURE__ */ r("span", { className: "text-sm", style: { color: "var(--metakyc-text-primary, #111827)" }, children: g.customType === "link_checkbox" && g.linkUrl ? /* @__PURE__ */ i(rt, { children: [
|
|
5734
5813
|
/* @__PURE__ */ r("a", { href: g.linkUrl, target: "_blank", rel: "noopener noreferrer", style: { color: "var(--metakyc-primary, #6366f1)", textDecoration: "underline" }, children: g.linkText || g.label }),
|
|
5735
5814
|
g.label && g.linkText ? ` ${g.label}` : ""
|
|
5736
5815
|
] }) : g.displayText || g.label })
|
|
@@ -5739,13 +5818,13 @@ const vn = ({
|
|
|
5739
5818
|
) }, q);
|
|
5740
5819
|
}
|
|
5741
5820
|
if (g.customType === "group_checkbox") {
|
|
5742
|
-
const
|
|
5743
|
-
g.singleSelect ? P((d) => ({ ...d, [p]:
|
|
5821
|
+
const E = Array.isArray(w) ? w : w ? [w] : [], v = (o) => {
|
|
5822
|
+
g.singleSelect ? P((d) => ({ ...d, [p]: E[0] === o ? [] : [o] })) : P((d) => ({
|
|
5744
5823
|
...d,
|
|
5745
|
-
[p]:
|
|
5824
|
+
[p]: E.includes(o) ? E.filter((A) => A !== o) : [...E, o]
|
|
5746
5825
|
}));
|
|
5747
5826
|
};
|
|
5748
|
-
return /* @__PURE__ */ r("div", { className:
|
|
5827
|
+
return /* @__PURE__ */ r("div", { className: ce(g.colSpan), children: ve(
|
|
5749
5828
|
/* @__PURE__ */ i("div", { className: "space-y-1.5", children: [
|
|
5750
5829
|
g.label && /* @__PURE__ */ r("p", { className: "text-sm font-medium", style: { color: "var(--metakyc-text-primary, #111827)" }, children: g.displayText || g.label }),
|
|
5751
5830
|
(g.options || []).map((o) => /* @__PURE__ */ i("label", { style: { display: "flex", alignItems: "flex-start", gap: 8, cursor: "pointer" }, children: [
|
|
@@ -5753,8 +5832,8 @@ const vn = ({
|
|
|
5753
5832
|
"input",
|
|
5754
5833
|
{
|
|
5755
5834
|
type: "checkbox",
|
|
5756
|
-
checked:
|
|
5757
|
-
onChange: () =>
|
|
5835
|
+
checked: E.includes(o.value),
|
|
5836
|
+
onChange: () => v(o.value),
|
|
5758
5837
|
style: { width: 16, height: 16, flexShrink: 0, marginTop: 2, accentColor: "var(--metakyc-primary, #6366f1)" }
|
|
5759
5838
|
}
|
|
5760
5839
|
),
|
|
@@ -5764,109 +5843,109 @@ const vn = ({
|
|
|
5764
5843
|
g.helpText
|
|
5765
5844
|
) }, q);
|
|
5766
5845
|
}
|
|
5767
|
-
return g.customType === "radio_group" ? /* @__PURE__ */ r("div", { className:
|
|
5846
|
+
return g.customType === "radio_group" ? /* @__PURE__ */ r("div", { className: ce(g.colSpan), children: ve(
|
|
5768
5847
|
/* @__PURE__ */ i("div", { className: "space-y-1.5", children: [
|
|
5769
5848
|
g.label && /* @__PURE__ */ r("p", { className: "text-sm font-medium", style: { color: "var(--metakyc-text-primary, #111827)" }, children: g.displayText || g.label }),
|
|
5770
|
-
(g.options || []).map((
|
|
5849
|
+
(g.options || []).map((E) => /* @__PURE__ */ i("label", { style: { display: "flex", alignItems: "flex-start", gap: 8, cursor: "pointer" }, children: [
|
|
5771
5850
|
/* @__PURE__ */ r(
|
|
5772
5851
|
"input",
|
|
5773
5852
|
{
|
|
5774
5853
|
type: "radio",
|
|
5775
5854
|
name: `rg-${p}`,
|
|
5776
|
-
value:
|
|
5777
|
-
checked:
|
|
5778
|
-
onChange: () => P((
|
|
5855
|
+
value: E.value,
|
|
5856
|
+
checked: w === E.value,
|
|
5857
|
+
onChange: () => P((v) => ({ ...v, [p]: E.value })),
|
|
5779
5858
|
style: { width: 16, height: 16, flexShrink: 0, marginTop: 2, accentColor: "var(--metakyc-primary, #6366f1)" }
|
|
5780
5859
|
}
|
|
5781
5860
|
),
|
|
5782
|
-
/* @__PURE__ */ r("span", { className: "text-sm", style: { color: "var(--metakyc-text-primary, #111827)" }, children:
|
|
5783
|
-
] },
|
|
5861
|
+
/* @__PURE__ */ r("span", { className: "text-sm", style: { color: "var(--metakyc-text-primary, #111827)" }, children: E.label })
|
|
5862
|
+
] }, E.value))
|
|
5784
5863
|
] }),
|
|
5785
5864
|
g.helpText
|
|
5786
|
-
) }, q) : /* @__PURE__ */ r("div", { className:
|
|
5865
|
+
) }, q) : /* @__PURE__ */ r("div", { className: ce(g.colSpan), children: ve(
|
|
5787
5866
|
/* @__PURE__ */ r(
|
|
5788
5867
|
fe,
|
|
5789
5868
|
{
|
|
5790
5869
|
label: g.displayText || g.label || p,
|
|
5791
|
-
value: String(
|
|
5792
|
-
onChange: (
|
|
5870
|
+
value: String(w ?? ""),
|
|
5871
|
+
onChange: (E) => P((v) => ({ ...v, [p]: E.target.value }))
|
|
5793
5872
|
}
|
|
5794
5873
|
),
|
|
5795
5874
|
g.helpText
|
|
5796
5875
|
) }, q);
|
|
5797
|
-
}, Je = (g,
|
|
5798
|
-
if (g.isCustom) return Ge(g,
|
|
5799
|
-
const q = g.name ?? "", p = Qe[q],
|
|
5800
|
-
return g.editable ?
|
|
5876
|
+
}, Je = (g, _) => {
|
|
5877
|
+
if (g.isCustom) return Ge(g, _);
|
|
5878
|
+
const q = g.name ?? "", p = Qe[q], w = g.displayText || (p == null ? void 0 : p.label) || q, E = re[q] ?? "", v = q === "mobileCountryCode", o = !!(p != null && p.countriesType) && !v;
|
|
5879
|
+
return g.editable ? v ? /* @__PURE__ */ r("div", { className: ce(g.colSpan ?? 2), children: ve(
|
|
5801
5880
|
/* @__PURE__ */ r(
|
|
5802
5881
|
Be,
|
|
5803
5882
|
{
|
|
5804
|
-
label:
|
|
5805
|
-
value: String(
|
|
5883
|
+
label: w,
|
|
5884
|
+
value: String(E),
|
|
5806
5885
|
onChange: (d) => he((A) => ({ ...A, [q]: d })),
|
|
5807
5886
|
options: [{ value: "", label: "Select country code…" }, ...B]
|
|
5808
5887
|
}
|
|
5809
5888
|
),
|
|
5810
5889
|
g.helpText
|
|
5811
|
-
) }, `epc-${
|
|
5890
|
+
) }, `epc-${_}`) : o ? /* @__PURE__ */ r("div", { className: ce(g.colSpan ?? 2), children: ve(
|
|
5812
5891
|
/* @__PURE__ */ r(
|
|
5813
5892
|
Be,
|
|
5814
5893
|
{
|
|
5815
|
-
label:
|
|
5816
|
-
value: String(
|
|
5894
|
+
label: w,
|
|
5895
|
+
value: String(E),
|
|
5817
5896
|
onChange: (d) => he((A) => ({ ...A, [q]: d })),
|
|
5818
|
-
options: [{ value: "", label: `Select ${
|
|
5897
|
+
options: [{ value: "", label: `Select ${w.toLowerCase()}…` }, ...W]
|
|
5819
5898
|
}
|
|
5820
5899
|
),
|
|
5821
5900
|
g.helpText
|
|
5822
|
-
) }, `ec-${
|
|
5901
|
+
) }, `ec-${_}`) : /* @__PURE__ */ r("div", { className: ce(g.colSpan ?? 2), children: ve(
|
|
5823
5902
|
/* @__PURE__ */ r(
|
|
5824
5903
|
fe,
|
|
5825
5904
|
{
|
|
5826
|
-
label:
|
|
5905
|
+
label: w,
|
|
5827
5906
|
type: (p == null ? void 0 : p.type) === "date" ? "date" : (p == null ? void 0 : p.type) === "email" ? "email" : "text",
|
|
5828
|
-
value: String(
|
|
5907
|
+
value: String(E),
|
|
5829
5908
|
onChange: (d) => he((A) => ({ ...A, [q]: d.target.value }))
|
|
5830
5909
|
}
|
|
5831
5910
|
),
|
|
5832
5911
|
g.helpText
|
|
5833
|
-
) }, `ei-${
|
|
5834
|
-
/* @__PURE__ */ i(
|
|
5835
|
-
/* @__PURE__ */ r("label", { className: "block text-sm font-medium mb-0.5", style: { color: "var(--metakyc-text-secondary, #6b7280)" }, children:
|
|
5836
|
-
/* @__PURE__ */ r("p", { className: "text-sm", style: { color: "var(--metakyc-text-primary, #111827)", minHeight: "1.5rem" }, children: we(q,
|
|
5912
|
+
) }, `ei-${_}`) : /* @__PURE__ */ r("div", { className: ce(g.colSpan ?? 2), children: ve(
|
|
5913
|
+
/* @__PURE__ */ i(rt, { children: [
|
|
5914
|
+
/* @__PURE__ */ r("label", { className: "block text-sm font-medium mb-0.5", style: { color: "var(--metakyc-text-secondary, #6b7280)" }, children: w }),
|
|
5915
|
+
/* @__PURE__ */ r("p", { className: "text-sm", style: { color: "var(--metakyc-text-primary, #111827)", minHeight: "1.5rem" }, children: we(q, E) })
|
|
5837
5916
|
] }),
|
|
5838
5917
|
g.helpText
|
|
5839
|
-
) }, `ro-${
|
|
5918
|
+
) }, `ro-${_}`);
|
|
5840
5919
|
};
|
|
5841
|
-
if (
|
|
5842
|
-
const g =
|
|
5920
|
+
if (K) {
|
|
5921
|
+
const g = K.title || "Review Your Information", _ = K.subtitle || "Please review and confirm your information before starting identity verification";
|
|
5843
5922
|
return /* @__PURE__ */ r("form", { onSubmit: (q) => {
|
|
5844
|
-
q.preventDefault(),
|
|
5845
|
-
}, children: /* @__PURE__ */ i(
|
|
5923
|
+
q.preventDefault(), x();
|
|
5924
|
+
}, children: /* @__PURE__ */ i(X, { children: [
|
|
5846
5925
|
/* @__PURE__ */ i(be, { children: [
|
|
5847
5926
|
/* @__PURE__ */ r("h2", { className: "text-lg font-bold", style: { color: "var(--metakyc-text-primary, #111827)" }, children: g }),
|
|
5848
|
-
/* @__PURE__ */ r("p", { className: "mt-1 text-sm", style: { color: "var(--metakyc-text-secondary, #6b7280)" }, children:
|
|
5927
|
+
/* @__PURE__ */ r("p", { className: "mt-1 text-sm", style: { color: "var(--metakyc-text-secondary, #6b7280)" }, children: _ })
|
|
5849
5928
|
] }),
|
|
5850
|
-
/* @__PURE__ */ r(
|
|
5851
|
-
/* @__PURE__ */ i(
|
|
5852
|
-
n && /* @__PURE__ */ r(
|
|
5853
|
-
/* @__PURE__ */ r(
|
|
5929
|
+
/* @__PURE__ */ r(ee, { children: /* @__PURE__ */ r("div", { className: "grid grid-cols-4 gap-4", children: K.fields.map((q, p) => Je(q, p)) }) }),
|
|
5930
|
+
/* @__PURE__ */ i(xe, { className: "flex justify-between", children: [
|
|
5931
|
+
n && /* @__PURE__ */ r(V, { type: "button", variant: "outline", onClick: n, children: "Back" }),
|
|
5932
|
+
/* @__PURE__ */ r(V, { type: "submit", isLoading: I, children: "Confirm and Start Verification" })
|
|
5854
5933
|
] })
|
|
5855
5934
|
] }) });
|
|
5856
5935
|
}
|
|
5857
|
-
return /* @__PURE__ */ r("form", { onSubmit:
|
|
5936
|
+
return /* @__PURE__ */ r("form", { onSubmit: j.handleSubmit(x), children: /* @__PURE__ */ i(X, { children: [
|
|
5858
5937
|
/* @__PURE__ */ i(be, { children: [
|
|
5859
5938
|
/* @__PURE__ */ r("h2", { className: "text-lg font-bold", style: { color: "var(--metakyc-text-primary, #111827)" }, children: "Review Your Information" }),
|
|
5860
5939
|
/* @__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" })
|
|
5861
5940
|
] }),
|
|
5862
|
-
/* @__PURE__ */ i(
|
|
5941
|
+
/* @__PURE__ */ i(ee, { className: "space-y-6", children: [
|
|
5863
5942
|
/* @__PURE__ */ r("div", { className: "space-y-4 pb-4", style: { borderBottom: "1px solid var(--metakyc-border, #e5e7eb)" }, children: [
|
|
5864
5943
|
{ label: "Name", value: `${((Me = D == null ? void 0 : D.applicantRequestData) == null ? void 0 : Me.firstName) || ""} ${((Ze = D == null ? void 0 : D.applicantRequestData) == null ? void 0 : Ze.lastName) || ""}`.trim() },
|
|
5865
5944
|
{ label: "Email", value: (je = D == null ? void 0 : D.applicantRequestData) == null ? void 0 : je.email },
|
|
5866
5945
|
{ label: "Date of Birth", value: ((We = D == null ? void 0 : D.applicantRequestData) == null ? void 0 : We.dateOfBirth) || "Not provided" }
|
|
5867
|
-
].map(({ label: g, value:
|
|
5946
|
+
].map(({ label: g, value: _ }) => /* @__PURE__ */ i("div", { children: [
|
|
5868
5947
|
/* @__PURE__ */ r("label", { className: "block text-sm font-medium", style: { color: "var(--metakyc-text-secondary, #6b7280)" }, children: g }),
|
|
5869
|
-
/* @__PURE__ */ r("p", { className: "mt-1 text-base", style: { color: "var(--metakyc-text-primary, #111827)" }, children:
|
|
5948
|
+
/* @__PURE__ */ r("p", { className: "mt-1 text-base", style: { color: "var(--metakyc-text-primary, #111827)" }, children: _ })
|
|
5870
5949
|
] }, g)) }),
|
|
5871
5950
|
/* @__PURE__ */ i("div", { className: "space-y-4", children: [
|
|
5872
5951
|
/* @__PURE__ */ r("h3", { className: "text-base font-semibold", style: { color: "var(--metakyc-text-primary, #111827)" }, children: "Address Information" }),
|
|
@@ -5874,7 +5953,7 @@ const vn = ({
|
|
|
5874
5953
|
/* @__PURE__ */ r(
|
|
5875
5954
|
qe,
|
|
5876
5955
|
{
|
|
5877
|
-
control:
|
|
5956
|
+
control: j.control,
|
|
5878
5957
|
name: "country",
|
|
5879
5958
|
render: ({ field: g }) => /* @__PURE__ */ r(
|
|
5880
5959
|
Be,
|
|
@@ -5882,7 +5961,7 @@ const vn = ({
|
|
|
5882
5961
|
label: "Country",
|
|
5883
5962
|
value: g.value,
|
|
5884
5963
|
onChange: g.onChange,
|
|
5885
|
-
options: [{ value: "", label: "Select country…" }, ...
|
|
5964
|
+
options: [{ value: "", label: "Select country…" }, ...W]
|
|
5886
5965
|
}
|
|
5887
5966
|
)
|
|
5888
5967
|
}
|
|
@@ -5890,7 +5969,7 @@ const vn = ({
|
|
|
5890
5969
|
/* @__PURE__ */ r(
|
|
5891
5970
|
qe,
|
|
5892
5971
|
{
|
|
5893
|
-
control:
|
|
5972
|
+
control: j.control,
|
|
5894
5973
|
name: "nationality",
|
|
5895
5974
|
render: ({ field: g }) => /* @__PURE__ */ r(
|
|
5896
5975
|
Be,
|
|
@@ -5898,26 +5977,26 @@ const vn = ({
|
|
|
5898
5977
|
label: "Nationality",
|
|
5899
5978
|
value: g.value,
|
|
5900
5979
|
onChange: g.onChange,
|
|
5901
|
-
options: [{ value: "", label: "Select nationality…" }, ...
|
|
5980
|
+
options: [{ value: "", label: "Select nationality…" }, ...W]
|
|
5902
5981
|
}
|
|
5903
5982
|
)
|
|
5904
5983
|
}
|
|
5905
5984
|
)
|
|
5906
5985
|
] }),
|
|
5907
5986
|
/* @__PURE__ */ i("div", { className: "grid grid-cols-1 md:grid-cols-2 gap-4", children: [
|
|
5908
|
-
/* @__PURE__ */ r(qe, { control:
|
|
5909
|
-
/* @__PURE__ */ r(qe, { control:
|
|
5987
|
+
/* @__PURE__ */ r(qe, { control: j.control, name: "street", render: ({ field: g }) => /* @__PURE__ */ r(fe, { ...g, label: "Street" }) }),
|
|
5988
|
+
/* @__PURE__ */ r(qe, { control: j.control, name: "streetNumber", render: ({ field: g }) => /* @__PURE__ */ r(fe, { ...g, label: "Street Number" }) })
|
|
5910
5989
|
] }),
|
|
5911
5990
|
/* @__PURE__ */ i("div", { className: "grid grid-cols-1 md:grid-cols-2 gap-4", children: [
|
|
5912
|
-
/* @__PURE__ */ r(qe, { control:
|
|
5913
|
-
/* @__PURE__ */ r(qe, { control:
|
|
5991
|
+
/* @__PURE__ */ r(qe, { control: j.control, name: "city", render: ({ field: g }) => /* @__PURE__ */ r(fe, { ...g, label: "City" }) }),
|
|
5992
|
+
/* @__PURE__ */ r(qe, { control: j.control, name: "zip", render: ({ field: g }) => /* @__PURE__ */ r(fe, { ...g, label: "ZIP / Postal Code" }) })
|
|
5914
5993
|
] }),
|
|
5915
|
-
/* @__PURE__ */ r(qe, { control:
|
|
5994
|
+
/* @__PURE__ */ r(qe, { control: j.control, name: "phonenumber", render: ({ field: g }) => /* @__PURE__ */ r(fe, { ...g, label: "Phone Number", type: "tel" }) })
|
|
5916
5995
|
] })
|
|
5917
5996
|
] }),
|
|
5918
|
-
/* @__PURE__ */ i(
|
|
5919
|
-
n && /* @__PURE__ */ r(
|
|
5920
|
-
/* @__PURE__ */ r(
|
|
5997
|
+
/* @__PURE__ */ i(xe, { className: "flex justify-between", children: [
|
|
5998
|
+
n && /* @__PURE__ */ r(V, { type: "button", variant: "outline", onClick: n, children: "Back" }),
|
|
5999
|
+
/* @__PURE__ */ r(V, { type: "submit", isLoading: I, children: "Confirm and Start Verification" })
|
|
5921
6000
|
] })
|
|
5922
6001
|
] }) });
|
|
5923
6002
|
}, It = ({
|
|
@@ -5928,42 +6007,42 @@ const vn = ({
|
|
|
5928
6007
|
onContinue: s,
|
|
5929
6008
|
onContactSupport: l
|
|
5930
6009
|
}) => {
|
|
5931
|
-
const u = e ===
|
|
6010
|
+
const u = e === Ye.Approved ? {
|
|
5932
6011
|
type: "success",
|
|
5933
6012
|
title: "Verification Approved",
|
|
5934
6013
|
icon: "✓",
|
|
5935
6014
|
iconBg: "bg-green-100 dark:bg-green-900/30",
|
|
5936
6015
|
iconColor: "text-green-600 dark:text-green-400",
|
|
5937
6016
|
message: "Your identity verification has been successfully approved."
|
|
5938
|
-
} : e ===
|
|
6017
|
+
} : e === Ye.Rejected ? {
|
|
5939
6018
|
type: "error",
|
|
5940
6019
|
title: "Verification Rejected",
|
|
5941
6020
|
icon: "✕",
|
|
5942
6021
|
iconBg: "bg-red-100 dark:bg-red-900/30",
|
|
5943
6022
|
iconColor: "text-red-600 dark:text-red-400",
|
|
5944
6023
|
message: "Unfortunately, your identity verification was not approved."
|
|
5945
|
-
} : e ===
|
|
6024
|
+
} : e === Ye.Pending || e === Ye.InProgress ? {
|
|
5946
6025
|
type: "pending",
|
|
5947
6026
|
title: "Verification Pending",
|
|
5948
6027
|
icon: "⏱",
|
|
5949
6028
|
iconBg: "bg-blue-100 dark:bg-blue-900/30",
|
|
5950
6029
|
iconColor: "text-blue-600 dark:text-blue-400",
|
|
5951
6030
|
message: "Your identity verification is currently being processed."
|
|
5952
|
-
} : t ===
|
|
6031
|
+
} : t === Ve.Approved ? {
|
|
5953
6032
|
type: "success",
|
|
5954
6033
|
title: "Application Approved",
|
|
5955
6034
|
icon: "✓",
|
|
5956
6035
|
iconBg: "bg-green-100 dark:bg-green-900/30",
|
|
5957
6036
|
iconColor: "text-green-600 dark:text-green-400",
|
|
5958
6037
|
message: "Your application has been approved."
|
|
5959
|
-
} : t ===
|
|
6038
|
+
} : t === Ve.Reject ? {
|
|
5960
6039
|
type: "error",
|
|
5961
6040
|
title: "Application Rejected",
|
|
5962
6041
|
icon: "✕",
|
|
5963
6042
|
iconBg: "bg-red-100 dark:bg-red-900/30",
|
|
5964
6043
|
iconColor: "text-red-600 dark:text-red-400",
|
|
5965
6044
|
message: "Your application has been rejected."
|
|
5966
|
-
} : t ===
|
|
6045
|
+
} : t === Ve.UnderReview || t === Ve.AdminReview ? {
|
|
5967
6046
|
type: "pending",
|
|
5968
6047
|
title: "Under Review",
|
|
5969
6048
|
icon: "📋",
|
|
@@ -5999,8 +6078,8 @@ const vn = ({
|
|
|
5999
6078
|
iconColor: "text-blue-600 dark:text-blue-400",
|
|
6000
6079
|
message: "Your application is being reviewed."
|
|
6001
6080
|
};
|
|
6002
|
-
return /* @__PURE__ */ i(
|
|
6003
|
-
/* @__PURE__ */ i(
|
|
6081
|
+
return /* @__PURE__ */ i(X, { children: [
|
|
6082
|
+
/* @__PURE__ */ i(ee, { className: "py-12", children: [
|
|
6004
6083
|
/* @__PURE__ */ r("div", { className: "flex justify-center mb-6", children: /* @__PURE__ */ r(
|
|
6005
6084
|
"div",
|
|
6006
6085
|
{
|
|
@@ -6013,7 +6092,7 @@ const vn = ({
|
|
|
6013
6092
|
Lt,
|
|
6014
6093
|
{
|
|
6015
6094
|
variant: u.type === "success" ? "success" : u.type === "error" ? "danger" : u.type === "pending" ? "warning" : "info",
|
|
6016
|
-
children: e != null ?
|
|
6095
|
+
children: e != null ? Ye[e] : Ve[t]
|
|
6017
6096
|
}
|
|
6018
6097
|
) }),
|
|
6019
6098
|
/* @__PURE__ */ r("p", { className: "text-center mb-6 max-w-md mx-auto", style: { color: "var(--metakyc-text-secondary, #6b7280)" }, children: a || u.message }),
|
|
@@ -6045,19 +6124,19 @@ const vn = ({
|
|
|
6045
6124
|
/* @__PURE__ */ r("div", { className: "mt-6 pt-6", style: { borderTop: "1px solid var(--metakyc-border, #e5e7eb)" }, children: /* @__PURE__ */ i("div", { className: "grid grid-cols-2 gap-4 text-sm", children: [
|
|
6046
6125
|
/* @__PURE__ */ i("div", { children: [
|
|
6047
6126
|
/* @__PURE__ */ r("span", { style: { color: "var(--metakyc-text-muted, #9ca3af)" }, children: "KYC Status:" }),
|
|
6048
|
-
/* @__PURE__ */ r("div", { className: "font-medium mt-1", style: { color: "var(--metakyc-text-primary, #111827)" }, children: e != null ?
|
|
6127
|
+
/* @__PURE__ */ r("div", { className: "font-medium mt-1", style: { color: "var(--metakyc-text-primary, #111827)" }, children: e != null ? Ye[e] : "Not Available" })
|
|
6049
6128
|
] }),
|
|
6050
6129
|
/* @__PURE__ */ i("div", { children: [
|
|
6051
6130
|
/* @__PURE__ */ r("span", { style: { color: "var(--metakyc-text-muted, #9ca3af)" }, children: "Review Status:" }),
|
|
6052
|
-
/* @__PURE__ */ r("div", { className: "font-medium mt-1", style: { color: "var(--metakyc-text-primary, #111827)" }, children:
|
|
6131
|
+
/* @__PURE__ */ r("div", { className: "font-medium mt-1", style: { color: "var(--metakyc-text-primary, #111827)" }, children: Ve[t] })
|
|
6053
6132
|
] })
|
|
6054
6133
|
] }) })
|
|
6055
6134
|
] }),
|
|
6056
|
-
/* @__PURE__ */ i(
|
|
6057
|
-
u.type === "success" && s && /* @__PURE__ */ r(
|
|
6058
|
-
u.type === "error" && /* @__PURE__ */ i(
|
|
6059
|
-
l && /* @__PURE__ */ r(
|
|
6060
|
-
s && /* @__PURE__ */ r(
|
|
6135
|
+
/* @__PURE__ */ i(xe, { className: "flex justify-center gap-4", children: [
|
|
6136
|
+
u.type === "success" && s && /* @__PURE__ */ r(V, { onClick: s, size: "lg", children: "Continue" }),
|
|
6137
|
+
u.type === "error" && /* @__PURE__ */ i(rt, { children: [
|
|
6138
|
+
l && /* @__PURE__ */ r(V, { variant: "outline", onClick: l, children: "Contact Support" }),
|
|
6139
|
+
s && /* @__PURE__ */ r(V, { onClick: s, children: "Try Again" })
|
|
6061
6140
|
] }),
|
|
6062
6141
|
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" }) })
|
|
6063
6142
|
] })
|
|
@@ -6108,7 +6187,7 @@ const vn = ({
|
|
|
6108
6187
|
function tt(e) {
|
|
6109
6188
|
return e == null || e === "" || Array.isArray(e) && e.length === 0;
|
|
6110
6189
|
}
|
|
6111
|
-
const
|
|
6190
|
+
const st = {
|
|
6112
6191
|
width: "16px",
|
|
6113
6192
|
height: "16px",
|
|
6114
6193
|
minWidth: "16px",
|
|
@@ -6122,7 +6201,7 @@ const it = {
|
|
|
6122
6201
|
verticalAlign: "middle"
|
|
6123
6202
|
}, Rt = ({ helpText: e, children: t }) => {
|
|
6124
6203
|
const [n, a] = Fe.useState(!1);
|
|
6125
|
-
if (!e) return /* @__PURE__ */ r(
|
|
6204
|
+
if (!e) return /* @__PURE__ */ r(rt, { children: t });
|
|
6126
6205
|
const s = n ? /* @__PURE__ */ r(
|
|
6127
6206
|
"div",
|
|
6128
6207
|
{
|
|
@@ -6247,36 +6326,36 @@ const it = {
|
|
|
6247
6326
|
onSuccess: n,
|
|
6248
6327
|
onCancel: a
|
|
6249
6328
|
}) => {
|
|
6250
|
-
var
|
|
6251
|
-
const { config: s, baseInformationService: l, currentTheme: c } = Re(), { createApplicant: u, isLoading: h } = Pt(), m = e || ((
|
|
6329
|
+
var _, q, p, w, E, v;
|
|
6330
|
+
const { config: s, baseInformationService: l, currentTheme: c } = Re(), { createApplicant: u, isLoading: h } = Pt(), m = e || ((_ = s.applicantForm) == null ? void 0 : _.workflowKey);
|
|
6252
6331
|
if (!m)
|
|
6253
6332
|
throw new Error(
|
|
6254
6333
|
"workflowKey is required. Provide it either as a prop to CreateApplicantForm or set it in config.applicantForm.workflowKey"
|
|
6255
6334
|
);
|
|
6256
|
-
const
|
|
6335
|
+
const I = t || ((q = s.applicantForm) == null ? void 0 : q.externalRefId) || "", T = ((p = s.applicantForm) == null ? void 0 : p.email) || "", R = ((w = s.applicantForm) == null ? void 0 : w.hiddenValues) || {}, f = (((E = s.applicantForm) == null ? void 0 : E.fieldLabelMode) || (c == null ? void 0 : c.fieldLabelMode) || "label") !== "placeholder", S = Ae(
|
|
6257
6336
|
() => c != null && c.applicantFormPages && c.applicantFormPages.length > 0 ? c.applicantFormPages : null,
|
|
6258
6337
|
[c == null ? void 0 : c.applicantFormPages]
|
|
6259
6338
|
), D = Ae(() => {
|
|
6260
6339
|
const o = new Set(dt), d = c == null ? void 0 : c.applicantFormRequiredFields;
|
|
6261
6340
|
if (d) for (const A of d) o.add(A);
|
|
6262
|
-
if (
|
|
6263
|
-
for (const A of
|
|
6341
|
+
if (S)
|
|
6342
|
+
for (const A of S)
|
|
6264
6343
|
for (const y of A.fields)
|
|
6265
6344
|
!y.isCustom && y.name && y.required && o.add(y.name);
|
|
6266
6345
|
return Array.from(o);
|
|
6267
|
-
}, [c == null ? void 0 : c.applicantFormRequiredFields,
|
|
6346
|
+
}, [c == null ? void 0 : c.applicantFormRequiredFields, S]), U = Ae(() => {
|
|
6268
6347
|
var A;
|
|
6269
|
-
if (
|
|
6270
|
-
const y =
|
|
6271
|
-
for (const
|
|
6272
|
-
return Array.from(
|
|
6348
|
+
if (S) {
|
|
6349
|
+
const y = S.flatMap((C) => C.fields).filter((C) => !C.isCustom && C.name).map((C) => C.name), N = new Set(y);
|
|
6350
|
+
for (const C of dt) N.add(C);
|
|
6351
|
+
return Array.from(N);
|
|
6273
6352
|
}
|
|
6274
6353
|
let o;
|
|
6275
6354
|
(A = s.applicantForm) != null && A.visibleFields ? o = s.applicantForm.visibleFields : c != null && c.applicantFormVisibleFields && c.applicantFormVisibleFields.length > 0 ? o = c.applicantFormVisibleFields : o = nr;
|
|
6276
6355
|
const d = new Set(o);
|
|
6277
6356
|
for (const y of dt) d.add(y);
|
|
6278
6357
|
return Array.from(d);
|
|
6279
|
-
}, [(
|
|
6358
|
+
}, [(v = s.applicantForm) == null ? void 0 : v.visibleFields, c == null ? void 0 : c.applicantFormVisibleFields, S]), W = /* @__PURE__ */ new Set([
|
|
6280
6359
|
"country",
|
|
6281
6360
|
"nationality",
|
|
6282
6361
|
"taxCountry",
|
|
@@ -6286,58 +6365,58 @@ const it = {
|
|
|
6286
6365
|
]), M = Ae(() => {
|
|
6287
6366
|
var d, A;
|
|
6288
6367
|
const o = /* @__PURE__ */ new Set();
|
|
6289
|
-
if (
|
|
6290
|
-
for (const y of
|
|
6291
|
-
for (const
|
|
6292
|
-
!
|
|
6368
|
+
if (S)
|
|
6369
|
+
for (const y of S)
|
|
6370
|
+
for (const N of y.fields)
|
|
6371
|
+
!N.isCustom && N.name && W.has(N.name) && o.add(N.countriesType ?? ((d = Qe[N.name]) == null ? void 0 : d.countriesType));
|
|
6293
6372
|
else
|
|
6294
6373
|
for (const y of U)
|
|
6295
|
-
|
|
6374
|
+
W.has(y) && o.add((A = Qe[y]) == null ? void 0 : A.countriesType);
|
|
6296
6375
|
return o.size === 0 && o.add(void 0), Array.from(o);
|
|
6297
|
-
}, [U,
|
|
6376
|
+
}, [U, S]), [B, G] = k({}), [J, F] = k(!0), b = le(/* @__PURE__ */ new Set()), $ = le(/* @__PURE__ */ new Set());
|
|
6298
6377
|
ye(() => {
|
|
6299
6378
|
if (!c) return;
|
|
6300
6379
|
const o = M.filter((y) => {
|
|
6301
|
-
const
|
|
6302
|
-
return
|
|
6380
|
+
const N = y != null ? String(y) : "all";
|
|
6381
|
+
return !$.current.has(N) && !b.current.has(N);
|
|
6303
6382
|
});
|
|
6304
6383
|
if (o.length === 0) {
|
|
6305
|
-
M.every((
|
|
6306
|
-
const
|
|
6307
|
-
return
|
|
6308
|
-
}) &&
|
|
6384
|
+
M.every((N) => {
|
|
6385
|
+
const C = N != null ? String(N) : "all";
|
|
6386
|
+
return $.current.has(C);
|
|
6387
|
+
}) && F(!1);
|
|
6309
6388
|
return;
|
|
6310
6389
|
}
|
|
6311
|
-
|
|
6390
|
+
F(!0);
|
|
6312
6391
|
const d = o.map((y) => y != null ? String(y) : "all");
|
|
6313
6392
|
d.forEach((y) => b.current.add(y)), (async () => {
|
|
6314
6393
|
try {
|
|
6315
6394
|
const y = await Promise.all(
|
|
6316
|
-
o.map(async (
|
|
6317
|
-
const
|
|
6395
|
+
o.map(async (N) => {
|
|
6396
|
+
const C = N != null ? String(N) : "all", oe = await l.getCountries("", s.locale || "en", N), ie = N === 40, ke = /* @__PURE__ */ new Set(), ge = oe.map((pe) => ie && pe.countryCode ? {
|
|
6318
6397
|
value: pe.countryCode,
|
|
6319
6398
|
label: `${pe.countryCode} – ${pe.name}`
|
|
6320
|
-
} : { value: pe.abbreviation3 || pe.abbreviation, label: pe.name }).filter((pe) => !pe.value ||
|
|
6321
|
-
return
|
|
6399
|
+
} : { value: pe.abbreviation3 || pe.abbreviation, label: pe.name }).filter((pe) => !pe.value || ke.has(pe.value) ? !1 : (ke.add(pe.value), !0));
|
|
6400
|
+
return $.current.add(C), b.current.delete(C), [C, ge];
|
|
6322
6401
|
})
|
|
6323
6402
|
);
|
|
6324
|
-
|
|
6403
|
+
G((N) => ({ ...N, ...Object.fromEntries(y) }));
|
|
6325
6404
|
} catch (y) {
|
|
6326
|
-
d.forEach((
|
|
6405
|
+
d.forEach((N) => b.current.delete(N)), console.error("Failed to load countries:", y);
|
|
6327
6406
|
} finally {
|
|
6328
|
-
M.every((
|
|
6329
|
-
const
|
|
6330
|
-
return
|
|
6331
|
-
}) &&
|
|
6407
|
+
M.every((N) => {
|
|
6408
|
+
const C = N != null ? String(N) : "all";
|
|
6409
|
+
return $.current.has(C);
|
|
6410
|
+
}) && F(!1);
|
|
6332
6411
|
}
|
|
6333
6412
|
})();
|
|
6334
6413
|
}, [M, c]);
|
|
6335
6414
|
const H = (o, d) => {
|
|
6336
|
-
var
|
|
6337
|
-
const A = d ?? ((
|
|
6415
|
+
var N;
|
|
6416
|
+
const A = d ?? ((N = Qe[o]) == null ? void 0 : N.countriesType), y = A != null ? String(A) : "all";
|
|
6338
6417
|
return B[y] || [];
|
|
6339
6418
|
}, z = Object.fromEntries(
|
|
6340
|
-
Object.entries(
|
|
6419
|
+
Object.entries(R).filter(([o]) => o in {
|
|
6341
6420
|
firstName: 1,
|
|
6342
6421
|
lastName: 1,
|
|
6343
6422
|
title: 1,
|
|
@@ -6361,7 +6440,7 @@ const it = {
|
|
|
6361
6440
|
occupation: 1,
|
|
6362
6441
|
taxNumber: 1
|
|
6363
6442
|
})
|
|
6364
|
-
), [O,
|
|
6443
|
+
), [O, ne] = k({
|
|
6365
6444
|
workflowKey: m,
|
|
6366
6445
|
firstName: "",
|
|
6367
6446
|
lastName: "",
|
|
@@ -6369,7 +6448,7 @@ const it = {
|
|
|
6369
6448
|
email: T,
|
|
6370
6449
|
dateOfBirth: "",
|
|
6371
6450
|
phonenumber: "",
|
|
6372
|
-
externalRefId:
|
|
6451
|
+
externalRefId: I,
|
|
6373
6452
|
mobileCountryCode: "",
|
|
6374
6453
|
street: "",
|
|
6375
6454
|
streetNumber: "",
|
|
@@ -6387,105 +6466,105 @@ const it = {
|
|
|
6387
6466
|
occupation: "",
|
|
6388
6467
|
taxNumber: "",
|
|
6389
6468
|
...z
|
|
6390
|
-
}),
|
|
6391
|
-
Object.entries(
|
|
6392
|
-
), [
|
|
6469
|
+
}), ae = Object.fromEntries(
|
|
6470
|
+
Object.entries(R).filter(([o]) => !(o in z) && o !== "externalRefId" && o !== "workflowKey")
|
|
6471
|
+
), [re, he] = k({ ...ae }), [de, P] = k(0), [K, Z] = k({}), [ue, j] = k(null), [x, Q] = k(!1), Y = (o, d) => ne((A) => ({ ...A, [o]: d })), ce = (o, d) => he((A) => ({ ...A, [o]: d })), we = (o) => !o.conditionalOn || re[o.conditionalOn] === "true", De = S && de < S.length - 1 ? de + 1 : -1, ve = S && de > 0 ? de - 1 : -1, Ge = (o) => {
|
|
6393
6472
|
var A;
|
|
6394
6473
|
const d = {};
|
|
6395
6474
|
for (const y of o.fields)
|
|
6396
6475
|
if (y.isCustom) {
|
|
6397
6476
|
if (y.customType === "paragraph" || y.customType === "html" || y.customType === "br" || y.customType === "link") continue;
|
|
6398
6477
|
if (y.required && y.paramName) {
|
|
6399
|
-
const
|
|
6400
|
-
y.customType === "checkbox" || y.customType === "link_checkbox" ?
|
|
6478
|
+
const N = re[y.paramName], C = y.displayText || y.label || y.paramName;
|
|
6479
|
+
y.customType === "checkbox" || y.customType === "link_checkbox" ? N !== "true" && (d[y.paramName] = `${C} is required.`) : (!N || N.trim() === "") && (d[y.paramName] = `${C} is required.`);
|
|
6401
6480
|
}
|
|
6402
6481
|
} else if (y.name) {
|
|
6403
|
-
const
|
|
6404
|
-
if (D.includes(
|
|
6405
|
-
const
|
|
6406
|
-
d[
|
|
6482
|
+
const N = y.name;
|
|
6483
|
+
if (D.includes(N) && tt(O[N])) {
|
|
6484
|
+
const C = y.displayText || ((A = Qe[N]) == null ? void 0 : A.label) || N;
|
|
6485
|
+
d[N] = `${C} is required.`;
|
|
6407
6486
|
}
|
|
6408
6487
|
}
|
|
6409
6488
|
return d;
|
|
6410
6489
|
}, Je = async () => {
|
|
6411
|
-
if (!
|
|
6412
|
-
const o =
|
|
6490
|
+
if (!S) return;
|
|
6491
|
+
const o = S[de];
|
|
6413
6492
|
if (o.conditionalOn && !we(o)) {
|
|
6414
|
-
|
|
6493
|
+
Z({}), De >= 0 ? P(De) : await Me();
|
|
6415
6494
|
return;
|
|
6416
6495
|
}
|
|
6417
6496
|
const d = Ge(o);
|
|
6418
6497
|
if (Object.keys(d).length > 0) {
|
|
6419
|
-
|
|
6498
|
+
Z(d);
|
|
6420
6499
|
return;
|
|
6421
6500
|
}
|
|
6422
|
-
|
|
6501
|
+
Z({}), De >= 0 ? P(De) : await Me();
|
|
6423
6502
|
}, Me = async () => {
|
|
6424
|
-
if (
|
|
6503
|
+
if (S) {
|
|
6425
6504
|
let o = {};
|
|
6426
|
-
for (const d of
|
|
6505
|
+
for (const d of S)
|
|
6427
6506
|
we(d) && (o = { ...o, ...Ge(d) });
|
|
6428
6507
|
if (Object.keys(o).length > 0) {
|
|
6429
|
-
|
|
6508
|
+
Z(o);
|
|
6430
6509
|
return;
|
|
6431
6510
|
}
|
|
6432
6511
|
}
|
|
6433
|
-
|
|
6512
|
+
Q(!0), j(null);
|
|
6434
6513
|
try {
|
|
6435
6514
|
if (!O.externalRefId || O.externalRefId.trim() === "") {
|
|
6436
|
-
|
|
6515
|
+
j("External Reference ID is required. Please pass it via config.applicantForm.externalRefId.");
|
|
6437
6516
|
return;
|
|
6438
6517
|
}
|
|
6439
6518
|
const o = {
|
|
6440
6519
|
workflowKey: O.workflowKey,
|
|
6441
6520
|
externalRefId: O.externalRefId.trim()
|
|
6442
6521
|
};
|
|
6443
|
-
if (
|
|
6444
|
-
for (const
|
|
6445
|
-
if (we(
|
|
6446
|
-
for (const
|
|
6447
|
-
if (!
|
|
6448
|
-
const oe =
|
|
6522
|
+
if (S) {
|
|
6523
|
+
for (const N of S)
|
|
6524
|
+
if (we(N)) {
|
|
6525
|
+
for (const C of N.fields)
|
|
6526
|
+
if (!C.isCustom && C.name) {
|
|
6527
|
+
const oe = C.name, ie = O[oe];
|
|
6449
6528
|
tt(ie) || (o[oe] = ie);
|
|
6450
6529
|
}
|
|
6451
6530
|
}
|
|
6452
|
-
for (const
|
|
6453
|
-
if (o[
|
|
6454
|
-
const
|
|
6455
|
-
tt(
|
|
6531
|
+
for (const N of dt)
|
|
6532
|
+
if (o[N] === void 0) {
|
|
6533
|
+
const C = O[N];
|
|
6534
|
+
tt(C) || (o[N] = C);
|
|
6456
6535
|
}
|
|
6457
6536
|
} else
|
|
6458
|
-
U.forEach((
|
|
6459
|
-
if (
|
|
6460
|
-
const
|
|
6461
|
-
tt(
|
|
6537
|
+
U.forEach((N) => {
|
|
6538
|
+
if (N === "externalRefId") return;
|
|
6539
|
+
const C = O[N];
|
|
6540
|
+
tt(C) || (o[N] = C);
|
|
6462
6541
|
});
|
|
6463
6542
|
const d = [];
|
|
6464
|
-
if (
|
|
6465
|
-
for (const
|
|
6466
|
-
if (we(
|
|
6467
|
-
for (const
|
|
6468
|
-
if (!
|
|
6469
|
-
const oe =
|
|
6543
|
+
if (S) {
|
|
6544
|
+
for (const N of S)
|
|
6545
|
+
if (we(N))
|
|
6546
|
+
for (const C of N.fields) {
|
|
6547
|
+
if (!C.isCustom || !C.paramName || C.customType === "paragraph" || C.customType === "html" || C.customType === "br" || C.customType === "link") continue;
|
|
6548
|
+
const oe = re[C.paramName] ?? "";
|
|
6470
6549
|
let ie;
|
|
6471
|
-
if (
|
|
6550
|
+
if (C.customType === "checkbox" || C.customType === "link_checkbox")
|
|
6472
6551
|
ie = oe === "true" ? "yes" : "no";
|
|
6473
|
-
else if (ie = oe, !ie && !
|
|
6474
|
-
d.push({ paramName:
|
|
6552
|
+
else if (ie = oe, !ie && !C.required) continue;
|
|
6553
|
+
d.push({ paramName: C.paramName, value: ie });
|
|
6475
6554
|
}
|
|
6476
6555
|
}
|
|
6477
|
-
for (const [
|
|
6478
|
-
o[
|
|
6479
|
-
const A = new Set(d.map((
|
|
6480
|
-
for (const [
|
|
6481
|
-
!A.has(
|
|
6556
|
+
for (const [N, C] of Object.entries(z))
|
|
6557
|
+
o[N] === void 0 && !tt(C) && (o[N] = C);
|
|
6558
|
+
const A = new Set(d.map((N) => N.paramName));
|
|
6559
|
+
for (const [N, C] of Object.entries(ae))
|
|
6560
|
+
!A.has(N) && C && d.push({ paramName: N, value: C });
|
|
6482
6561
|
d.length > 0 && (o.applicantAdditionalDatas = d);
|
|
6483
6562
|
const y = await u(o);
|
|
6484
6563
|
n(y.applicantId);
|
|
6485
6564
|
} catch (o) {
|
|
6486
|
-
console.error("Error creating applicant:", o),
|
|
6565
|
+
console.error("Error creating applicant:", o), j(o.message || "Failed to create applicant");
|
|
6487
6566
|
} finally {
|
|
6488
|
-
|
|
6567
|
+
Q(!1);
|
|
6489
6568
|
}
|
|
6490
6569
|
}, Ze = async (o) => {
|
|
6491
6570
|
var d;
|
|
@@ -6493,16 +6572,16 @@ const it = {
|
|
|
6493
6572
|
for (const A of D)
|
|
6494
6573
|
if (tt(O[A])) {
|
|
6495
6574
|
const y = ((d = Qe[A]) == null ? void 0 : d.label) || A;
|
|
6496
|
-
|
|
6575
|
+
j(`${y} is required.`);
|
|
6497
6576
|
return;
|
|
6498
6577
|
}
|
|
6499
6578
|
await Me();
|
|
6500
|
-
}, je = (o, d, A, y,
|
|
6579
|
+
}, je = (o, d, A, y, N) => {
|
|
6501
6580
|
var xt;
|
|
6502
|
-
const
|
|
6503
|
-
if (!
|
|
6504
|
-
const oe = D.includes(o), ie =
|
|
6505
|
-
switch (
|
|
6581
|
+
const C = Qe[o];
|
|
6582
|
+
if (!C) return null;
|
|
6583
|
+
const oe = D.includes(o), ie = K[o], ke = A || C.label, ge = d ?? o, pe = { required: oe }, ze = N ? N !== "placeholder" : f, He = ze ? ke : void 0, Ot = ze ? "..." : ke;
|
|
6584
|
+
switch (C.type) {
|
|
6506
6585
|
case "select":
|
|
6507
6586
|
if (o === "country" || o === "nationality" || o === "taxCountry" || o === "countryOfBirth" || o === "mobileCountryCode") {
|
|
6508
6587
|
const Se = H(o, y);
|
|
@@ -6512,9 +6591,9 @@ const it = {
|
|
|
6512
6591
|
...pe,
|
|
6513
6592
|
label: He,
|
|
6514
6593
|
value: O[o] || "",
|
|
6515
|
-
onChange: (Ke) =>
|
|
6594
|
+
onChange: (Ke) => Y(o, Ke),
|
|
6516
6595
|
options: [{ value: "", label: `Select ${Ot.toLowerCase()}` }, ...Se],
|
|
6517
|
-
disabled:
|
|
6596
|
+
disabled: J,
|
|
6518
6597
|
error: ie
|
|
6519
6598
|
},
|
|
6520
6599
|
ge
|
|
@@ -6527,9 +6606,9 @@ const it = {
|
|
|
6527
6606
|
...pe,
|
|
6528
6607
|
label: He,
|
|
6529
6608
|
value: ((xt = O[o]) == null ? void 0 : xt.toString()) || "",
|
|
6530
|
-
onChange: (Se) =>
|
|
6609
|
+
onChange: (Se) => Y(o, Se ? Number(Se) : null),
|
|
6531
6610
|
options: [
|
|
6532
|
-
{ value: "", label: ze ? "Select salutation..." :
|
|
6611
|
+
{ value: "", label: ze ? "Select salutation..." : ke },
|
|
6533
6612
|
{ value: pt.Male.toString(), label: "Male" },
|
|
6534
6613
|
{ value: pt.Female.toString(), label: "Female" },
|
|
6535
6614
|
{ value: pt.Other.toString(), label: "Other" }
|
|
@@ -6546,8 +6625,8 @@ const it = {
|
|
|
6546
6625
|
...pe,
|
|
6547
6626
|
label: He,
|
|
6548
6627
|
value: O[o] || "",
|
|
6549
|
-
onChange: (Ke) =>
|
|
6550
|
-
options: [{ value: "", label: ze ? "Select language..." :
|
|
6628
|
+
onChange: (Ke) => Y(o, Ke),
|
|
6629
|
+
options: [{ value: "", label: ze ? "Select language..." : ke }, ...Se],
|
|
6551
6630
|
error: ie
|
|
6552
6631
|
},
|
|
6553
6632
|
ge
|
|
@@ -6563,10 +6642,10 @@ const it = {
|
|
|
6563
6642
|
...pe,
|
|
6564
6643
|
label: He,
|
|
6565
6644
|
value: O[o] || [],
|
|
6566
|
-
onChange: (Ke) =>
|
|
6645
|
+
onChange: (Ke) => Y(o, Ke),
|
|
6567
6646
|
options: Se,
|
|
6568
|
-
placeholder: ze ? "Select other nationalities..." :
|
|
6569
|
-
disabled:
|
|
6647
|
+
placeholder: ze ? "Select other nationalities..." : ke,
|
|
6648
|
+
disabled: J
|
|
6570
6649
|
},
|
|
6571
6650
|
ge
|
|
6572
6651
|
);
|
|
@@ -6579,9 +6658,9 @@ const it = {
|
|
|
6579
6658
|
...pe,
|
|
6580
6659
|
type: "date",
|
|
6581
6660
|
label: He,
|
|
6582
|
-
placeholder: ze ? void 0 :
|
|
6661
|
+
placeholder: ze ? void 0 : ke,
|
|
6583
6662
|
value: O[o] || "",
|
|
6584
|
-
onChange: (Se) =>
|
|
6663
|
+
onChange: (Se) => Y(o, Se.target.value),
|
|
6585
6664
|
error: ie
|
|
6586
6665
|
},
|
|
6587
6666
|
ge
|
|
@@ -6593,9 +6672,9 @@ const it = {
|
|
|
6593
6672
|
...pe,
|
|
6594
6673
|
type: "email",
|
|
6595
6674
|
label: He,
|
|
6596
|
-
placeholder: ze ? void 0 :
|
|
6675
|
+
placeholder: ze ? void 0 : ke,
|
|
6597
6676
|
value: O[o] || "",
|
|
6598
|
-
onChange: (Se) =>
|
|
6677
|
+
onChange: (Se) => Y(o, Se.target.value),
|
|
6599
6678
|
error: ie
|
|
6600
6679
|
},
|
|
6601
6680
|
ge
|
|
@@ -6607,9 +6686,9 @@ const it = {
|
|
|
6607
6686
|
...pe,
|
|
6608
6687
|
type: "tel",
|
|
6609
6688
|
label: He,
|
|
6610
|
-
placeholder: ze ? void 0 :
|
|
6689
|
+
placeholder: ze ? void 0 : ke,
|
|
6611
6690
|
value: O[o] || "",
|
|
6612
|
-
onChange: (Se) =>
|
|
6691
|
+
onChange: (Se) => Y(o, Se.target.value),
|
|
6613
6692
|
error: ie
|
|
6614
6693
|
},
|
|
6615
6694
|
ge
|
|
@@ -6621,9 +6700,9 @@ const it = {
|
|
|
6621
6700
|
...pe,
|
|
6622
6701
|
type: "text",
|
|
6623
6702
|
label: He,
|
|
6624
|
-
placeholder: ze ? void 0 :
|
|
6703
|
+
placeholder: ze ? void 0 : ke,
|
|
6625
6704
|
value: O[o] || "",
|
|
6626
|
-
onChange: (Se) =>
|
|
6705
|
+
onChange: (Se) => Y(o, Se.target.value),
|
|
6627
6706
|
error: ie
|
|
6628
6707
|
},
|
|
6629
6708
|
ge
|
|
@@ -6632,7 +6711,7 @@ const it = {
|
|
|
6632
6711
|
}, We = (o, d) => {
|
|
6633
6712
|
const A = o.labelMode ? o.labelMode !== "placeholder" : f;
|
|
6634
6713
|
if (o.customType === "paragraph") {
|
|
6635
|
-
const
|
|
6714
|
+
const C = o.displayText || o.label || "";
|
|
6636
6715
|
return /* @__PURE__ */ r(
|
|
6637
6716
|
"p",
|
|
6638
6717
|
{
|
|
@@ -6643,7 +6722,7 @@ const it = {
|
|
|
6643
6722
|
margin: 0,
|
|
6644
6723
|
color: "var(--metakyc-text-secondary, #6b7280)"
|
|
6645
6724
|
},
|
|
6646
|
-
dangerouslySetInnerHTML: { __html:
|
|
6725
|
+
dangerouslySetInnerHTML: { __html: C }
|
|
6647
6726
|
},
|
|
6648
6727
|
`custom-${d}`
|
|
6649
6728
|
);
|
|
@@ -6659,7 +6738,7 @@ const it = {
|
|
|
6659
6738
|
if (o.customType === "br")
|
|
6660
6739
|
return /* @__PURE__ */ r("div", { style: { height: "12px" } }, `custom-${d}`);
|
|
6661
6740
|
if (o.customType === "link") {
|
|
6662
|
-
const
|
|
6741
|
+
const C = o.displayText || o.label || o.linkText || o.linkUrl || "";
|
|
6663
6742
|
return /* @__PURE__ */ r("div", { className: "metakyc-link-field", children: /* @__PURE__ */ i(
|
|
6664
6743
|
"a",
|
|
6665
6744
|
{
|
|
@@ -6676,14 +6755,14 @@ const it = {
|
|
|
6676
6755
|
cursor: "pointer"
|
|
6677
6756
|
},
|
|
6678
6757
|
children: [
|
|
6679
|
-
|
|
6758
|
+
C,
|
|
6680
6759
|
/* @__PURE__ */ r("span", { style: { fontSize: "10px", opacity: 0.7 }, children: "↗" })
|
|
6681
6760
|
]
|
|
6682
6761
|
}
|
|
6683
6762
|
) }, `custom-${d}`);
|
|
6684
6763
|
}
|
|
6685
6764
|
if (!o.paramName) return null;
|
|
6686
|
-
const y =
|
|
6765
|
+
const y = K[o.paramName], N = o.displayText || o.label || o.paramName;
|
|
6687
6766
|
if (o.customType === "checkbox")
|
|
6688
6767
|
return /* @__PURE__ */ i("div", { className: "flex flex-col gap-1", children: [
|
|
6689
6768
|
/* @__PURE__ */ i(
|
|
@@ -6696,10 +6775,10 @@ const it = {
|
|
|
6696
6775
|
"input",
|
|
6697
6776
|
{
|
|
6698
6777
|
type: "checkbox",
|
|
6699
|
-
checked:
|
|
6700
|
-
onChange: (
|
|
6778
|
+
checked: re[o.paramName] === "true",
|
|
6779
|
+
onChange: (C) => ce(o.paramName, C.target.checked ? "true" : "false"),
|
|
6701
6780
|
className: "metakyc-option-input",
|
|
6702
|
-
style:
|
|
6781
|
+
style: st
|
|
6703
6782
|
}
|
|
6704
6783
|
),
|
|
6705
6784
|
/* @__PURE__ */ i(
|
|
@@ -6708,7 +6787,7 @@ const it = {
|
|
|
6708
6787
|
className: "metakyc-option-text",
|
|
6709
6788
|
style: { fontSize: "14px", color: "var(--metakyc-text-primary, #111827)", lineHeight: "1.4" },
|
|
6710
6789
|
children: [
|
|
6711
|
-
|
|
6790
|
+
N,
|
|
6712
6791
|
o.required && /* @__PURE__ */ r("span", { className: "text-red-500 ml-0.5", children: "*" })
|
|
6713
6792
|
]
|
|
6714
6793
|
}
|
|
@@ -6730,10 +6809,10 @@ const it = {
|
|
|
6730
6809
|
"input",
|
|
6731
6810
|
{
|
|
6732
6811
|
type: "checkbox",
|
|
6733
|
-
checked:
|
|
6734
|
-
onChange: (
|
|
6812
|
+
checked: re[o.paramName] === "true",
|
|
6813
|
+
onChange: (C) => ce(o.paramName, C.target.checked ? "true" : "false"),
|
|
6735
6814
|
className: "metakyc-option-input",
|
|
6736
|
-
style: { ...
|
|
6815
|
+
style: { ...st, alignSelf: "flex-start", marginTop: "2px" }
|
|
6737
6816
|
}
|
|
6738
6817
|
),
|
|
6739
6818
|
/* @__PURE__ */ i(
|
|
@@ -6742,7 +6821,7 @@ const it = {
|
|
|
6742
6821
|
className: "metakyc-option-text",
|
|
6743
6822
|
style: { fontSize: "14px", color: "var(--metakyc-text-primary, #111827)", lineHeight: "1.4" },
|
|
6744
6823
|
children: [
|
|
6745
|
-
|
|
6824
|
+
N,
|
|
6746
6825
|
" ",
|
|
6747
6826
|
o.linkUrl && /* @__PURE__ */ r(
|
|
6748
6827
|
"a",
|
|
@@ -6752,7 +6831,7 @@ const it = {
|
|
|
6752
6831
|
rel: "noopener noreferrer",
|
|
6753
6832
|
className: "underline",
|
|
6754
6833
|
style: { color: "var(--metakyc-primary, #2563eb)" },
|
|
6755
|
-
onClick: (
|
|
6834
|
+
onClick: (C) => C.stopPropagation(),
|
|
6756
6835
|
children: o.linkText || o.linkUrl
|
|
6757
6836
|
}
|
|
6758
6837
|
),
|
|
@@ -6766,7 +6845,7 @@ const it = {
|
|
|
6766
6845
|
y && /* @__PURE__ */ r("p", { className: "text-red-500 text-xs mt-0.5", children: y })
|
|
6767
6846
|
] }, `custom-${d}`);
|
|
6768
6847
|
if (o.customType === "group_checkbox") {
|
|
6769
|
-
const
|
|
6848
|
+
const C = (re[o.paramName] || "").split(",").filter(Boolean);
|
|
6770
6849
|
return /* @__PURE__ */ i("div", { className: "flex flex-col gap-1.5", children: [
|
|
6771
6850
|
A && /* @__PURE__ */ i(
|
|
6772
6851
|
"div",
|
|
@@ -6774,13 +6853,13 @@ const it = {
|
|
|
6774
6853
|
className: "text-sm font-medium",
|
|
6775
6854
|
style: { color: "var(--metakyc-text-primary, #111827)" },
|
|
6776
6855
|
children: [
|
|
6777
|
-
|
|
6856
|
+
N,
|
|
6778
6857
|
o.required && /* @__PURE__ */ r("span", { className: "text-red-500 ml-0.5", children: "*" })
|
|
6779
6858
|
]
|
|
6780
6859
|
}
|
|
6781
6860
|
),
|
|
6782
6861
|
/* @__PURE__ */ r("div", { className: "metakyc-options-group", style: { display: "flex", flexDirection: "column", gap: "8px" }, children: (o.options || []).map((oe) => {
|
|
6783
|
-
const ie = o.singleSelect ?
|
|
6862
|
+
const ie = o.singleSelect ? re[o.paramName] === oe.value : C.includes(oe.value);
|
|
6784
6863
|
return /* @__PURE__ */ i(
|
|
6785
6864
|
"label",
|
|
6786
6865
|
{
|
|
@@ -6792,16 +6871,16 @@ const it = {
|
|
|
6792
6871
|
{
|
|
6793
6872
|
type: "checkbox",
|
|
6794
6873
|
checked: ie,
|
|
6795
|
-
onChange: (
|
|
6874
|
+
onChange: (ke) => {
|
|
6796
6875
|
if (o.singleSelect)
|
|
6797
|
-
|
|
6876
|
+
ce(o.paramName, ke.target.checked ? oe.value : "");
|
|
6798
6877
|
else {
|
|
6799
|
-
const ge =
|
|
6800
|
-
|
|
6878
|
+
const ge = ke.target.checked ? [...C, oe.value] : C.filter((pe) => pe !== oe.value);
|
|
6879
|
+
ce(o.paramName, ge.join(","));
|
|
6801
6880
|
}
|
|
6802
6881
|
},
|
|
6803
6882
|
className: "metakyc-option-input",
|
|
6804
|
-
style:
|
|
6883
|
+
style: st
|
|
6805
6884
|
}
|
|
6806
6885
|
),
|
|
6807
6886
|
/* @__PURE__ */ r(
|
|
@@ -6827,12 +6906,12 @@ const it = {
|
|
|
6827
6906
|
className: "text-sm font-medium",
|
|
6828
6907
|
style: { color: "var(--metakyc-text-primary, #111827)" },
|
|
6829
6908
|
children: [
|
|
6830
|
-
|
|
6909
|
+
N,
|
|
6831
6910
|
o.required && /* @__PURE__ */ r("span", { className: "text-red-500 ml-0.5", children: "*" })
|
|
6832
6911
|
]
|
|
6833
6912
|
}
|
|
6834
6913
|
),
|
|
6835
|
-
/* @__PURE__ */ r("div", { className: "metakyc-options-group", style: { display: "flex", flexDirection: "column", gap: "8px" }, children: (o.options || []).map((
|
|
6914
|
+
/* @__PURE__ */ r("div", { className: "metakyc-options-group", style: { display: "flex", flexDirection: "column", gap: "8px" }, children: (o.options || []).map((C) => /* @__PURE__ */ i(
|
|
6836
6915
|
"label",
|
|
6837
6916
|
{
|
|
6838
6917
|
className: "metakyc-option-label",
|
|
@@ -6842,11 +6921,11 @@ const it = {
|
|
|
6842
6921
|
"input",
|
|
6843
6922
|
{
|
|
6844
6923
|
type: "radio",
|
|
6845
|
-
checked:
|
|
6846
|
-
onChange: () =>
|
|
6924
|
+
checked: re[o.paramName] === C.value,
|
|
6925
|
+
onChange: () => ce(o.paramName, C.value),
|
|
6847
6926
|
name: `radio-group-${o.paramName}-${d}`,
|
|
6848
6927
|
className: "metakyc-option-input",
|
|
6849
|
-
style:
|
|
6928
|
+
style: st
|
|
6850
6929
|
}
|
|
6851
6930
|
),
|
|
6852
6931
|
/* @__PURE__ */ r(
|
|
@@ -6854,22 +6933,22 @@ const it = {
|
|
|
6854
6933
|
{
|
|
6855
6934
|
className: "metakyc-option-text",
|
|
6856
6935
|
style: { fontSize: "14px", color: "var(--metakyc-text-primary, #111827)", lineHeight: "1.4" },
|
|
6857
|
-
children:
|
|
6936
|
+
children: C.label
|
|
6858
6937
|
}
|
|
6859
6938
|
)
|
|
6860
6939
|
]
|
|
6861
6940
|
},
|
|
6862
|
-
|
|
6941
|
+
C.value
|
|
6863
6942
|
)) }),
|
|
6864
6943
|
y && /* @__PURE__ */ r("p", { className: "text-red-500 text-xs", children: y })
|
|
6865
6944
|
] }, `custom-${d}`) : /* @__PURE__ */ r(
|
|
6866
6945
|
fe,
|
|
6867
6946
|
{
|
|
6868
6947
|
type: "text",
|
|
6869
|
-
label: A ? `${
|
|
6870
|
-
placeholder: A ? void 0 :
|
|
6871
|
-
value:
|
|
6872
|
-
onChange: (
|
|
6948
|
+
label: A ? `${N}${o.required ? " *" : ""}` : void 0,
|
|
6949
|
+
placeholder: A ? void 0 : N,
|
|
6950
|
+
value: re[o.paramName] || "",
|
|
6951
|
+
onChange: (C) => ce(o.paramName, C.target.value),
|
|
6873
6952
|
required: o.required,
|
|
6874
6953
|
error: y
|
|
6875
6954
|
},
|
|
@@ -6889,9 +6968,9 @@ const it = {
|
|
|
6889
6968
|
{
|
|
6890
6969
|
type: "checkbox",
|
|
6891
6970
|
checked: A,
|
|
6892
|
-
onChange: (y) =>
|
|
6971
|
+
onChange: (y) => ce(o.conditionalOn, y.target.checked ? "true" : "false"),
|
|
6893
6972
|
className: "metakyc-option-input",
|
|
6894
|
-
style:
|
|
6973
|
+
style: st
|
|
6895
6974
|
}
|
|
6896
6975
|
),
|
|
6897
6976
|
/* @__PURE__ */ r(
|
|
@@ -6905,22 +6984,22 @@ const it = {
|
|
|
6905
6984
|
]
|
|
6906
6985
|
}
|
|
6907
6986
|
) }),
|
|
6908
|
-
A && /* @__PURE__ */ r("div", { className: "grid grid-cols-4 gap-4", children: o.fields.map((y,
|
|
6909
|
-
const
|
|
6910
|
-
return /* @__PURE__ */ r("div", { className:
|
|
6987
|
+
A && /* @__PURE__ */ r("div", { className: "grid grid-cols-4 gap-4", children: o.fields.map((y, N) => {
|
|
6988
|
+
const C = y.colSpan === 1 ? "col-span-1" : y.colSpan === 2 ? "col-span-2" : y.colSpan === 3 ? "col-span-3" : "col-span-4", oe = y.isCustom ? `custom-${N}-${y.paramName}` : `builtin-${y.name}-${N}`;
|
|
6989
|
+
return /* @__PURE__ */ r("div", { className: C, children: /* @__PURE__ */ r(Rt, { helpText: y.helpText, children: y.isCustom ? We(y, N) : je(y.name, oe, y.displayText, y.countriesType, y.labelMode) }) }, oe);
|
|
6911
6990
|
}) })
|
|
6912
6991
|
] });
|
|
6913
6992
|
};
|
|
6914
|
-
if (!c ||
|
|
6915
|
-
return /* @__PURE__ */ r("div", { className: "metakyc-sdk", children: /* @__PURE__ */ r(
|
|
6993
|
+
if (!c || J)
|
|
6994
|
+
return /* @__PURE__ */ r("div", { className: "metakyc-sdk", children: /* @__PURE__ */ r(X, { children: /* @__PURE__ */ i(ee, { children: [
|
|
6916
6995
|
/* @__PURE__ */ r(Pe, { className: "my-8" }),
|
|
6917
6996
|
/* @__PURE__ */ r("p", { className: "text-center mt-4", style: { color: "var(--metakyc-text-secondary, #6b7280)", fontSize: "0.875rem" }, children: "Loading form…" })
|
|
6918
6997
|
] }) }) });
|
|
6919
|
-
if (
|
|
6920
|
-
const o =
|
|
6921
|
-
return /* @__PURE__ */ r("div", { className: "metakyc-sdk", children: /* @__PURE__ */ i(
|
|
6998
|
+
if (S) {
|
|
6999
|
+
const o = S[de] ?? S[0], d = ve === -1, A = De === -1, y = S.length, N = we(o), C = Object.values(K);
|
|
7000
|
+
return /* @__PURE__ */ r("div", { className: "metakyc-sdk", children: /* @__PURE__ */ i(X, { children: [
|
|
6922
7001
|
/* @__PURE__ */ r(be, { children: /* @__PURE__ */ r(ot, { title: (c == null ? void 0 : c.title) || "Create Applicant" }) }),
|
|
6923
|
-
/* @__PURE__ */ i(
|
|
7002
|
+
/* @__PURE__ */ i(ee, { children: [
|
|
6924
7003
|
(o.title || o.subtitle || o.description) && /* @__PURE__ */ i("div", { className: "mb-4", children: [
|
|
6925
7004
|
o.title && /* @__PURE__ */ r(
|
|
6926
7005
|
"h3",
|
|
@@ -6947,72 +7026,72 @@ const it = {
|
|
|
6947
7026
|
}
|
|
6948
7027
|
)
|
|
6949
7028
|
] }),
|
|
6950
|
-
(
|
|
6951
|
-
|
|
7029
|
+
(ue || C.length > 0) && /* @__PURE__ */ i("div", { className: "mb-4 p-3 bg-red-50 border border-red-200 rounded-lg", children: [
|
|
7030
|
+
ue && /* @__PURE__ */ i("p", { className: "text-red-600 text-sm", children: [
|
|
6952
7031
|
/* @__PURE__ */ r("strong", { children: "Error:" }),
|
|
6953
7032
|
" ",
|
|
6954
|
-
|
|
7033
|
+
ue
|
|
6955
7034
|
] }),
|
|
6956
|
-
|
|
7035
|
+
C.map((oe, ie) => /* @__PURE__ */ r("p", { className: "text-red-600 text-sm", children: oe }, ie))
|
|
6957
7036
|
] }),
|
|
6958
7037
|
y > 1 && /* @__PURE__ */ i("div", { className: "flex items-center gap-2 mb-4", children: [
|
|
6959
|
-
|
|
7038
|
+
S.map((oe, ie) => /* @__PURE__ */ r(
|
|
6960
7039
|
"div",
|
|
6961
7040
|
{
|
|
6962
|
-
className: `h-1.5 rounded-full transition-all ${ie ===
|
|
6963
|
-
style: ie ===
|
|
7041
|
+
className: `h-1.5 rounded-full transition-all ${ie === de ? "flex-1" : "w-8"}`,
|
|
7042
|
+
style: ie === de ? { backgroundColor: "var(--metakyc-primary, #2563eb)" } : ie < de ? { backgroundColor: "var(--metakyc-primary-light, #93c5fd)", opacity: 0.7 } : { backgroundColor: "#e5e7eb" }
|
|
6964
7043
|
},
|
|
6965
7044
|
ie
|
|
6966
7045
|
)),
|
|
6967
7046
|
/* @__PURE__ */ i("span", { className: "text-xs text-gray-400 flex-shrink-0", children: [
|
|
6968
|
-
|
|
7047
|
+
de + 1,
|
|
6969
7048
|
" / ",
|
|
6970
7049
|
y
|
|
6971
7050
|
] })
|
|
6972
7051
|
] }),
|
|
6973
7052
|
g(o)
|
|
6974
7053
|
] }),
|
|
6975
|
-
/* @__PURE__ */ i(
|
|
7054
|
+
/* @__PURE__ */ i(xe, { className: "flex justify-between", children: [
|
|
6976
7055
|
/* @__PURE__ */ i("div", { children: [
|
|
6977
7056
|
!d && /* @__PURE__ */ r(
|
|
6978
|
-
|
|
7057
|
+
V,
|
|
6979
7058
|
{
|
|
6980
7059
|
type: "button",
|
|
6981
7060
|
variant: "outline",
|
|
6982
7061
|
onClick: () => {
|
|
6983
|
-
P(
|
|
7062
|
+
P(ve), Z({});
|
|
6984
7063
|
},
|
|
6985
|
-
disabled:
|
|
7064
|
+
disabled: x || h,
|
|
6986
7065
|
children: "Previous"
|
|
6987
7066
|
}
|
|
6988
7067
|
),
|
|
6989
|
-
d && a && /* @__PURE__ */ r(
|
|
7068
|
+
d && a && /* @__PURE__ */ r(V, { type: "button", variant: "outline", onClick: a, disabled: x || h, children: "Cancel" })
|
|
6990
7069
|
] }),
|
|
6991
7070
|
/* @__PURE__ */ r(
|
|
6992
|
-
|
|
7071
|
+
V,
|
|
6993
7072
|
{
|
|
6994
7073
|
type: "button",
|
|
6995
|
-
isLoading:
|
|
7074
|
+
isLoading: x || h,
|
|
6996
7075
|
onClick: A ? Me : Je,
|
|
6997
|
-
children: A ? o.conditionalOn && !
|
|
7076
|
+
children: A ? o.conditionalOn && !N ? "Skip & Submit" : "Submit" : o.conditionalOn && !N ? "Skip" : "Next"
|
|
6998
7077
|
}
|
|
6999
7078
|
)
|
|
7000
7079
|
] })
|
|
7001
7080
|
] }) });
|
|
7002
7081
|
}
|
|
7003
|
-
return /* @__PURE__ */ r("div", { className: "metakyc-sdk", children: /* @__PURE__ */ r("form", { onSubmit: Ze, children: /* @__PURE__ */ i(
|
|
7082
|
+
return /* @__PURE__ */ r("div", { className: "metakyc-sdk", children: /* @__PURE__ */ r("form", { onSubmit: Ze, children: /* @__PURE__ */ i(X, { children: [
|
|
7004
7083
|
/* @__PURE__ */ r(be, { children: /* @__PURE__ */ r(ot, { title: (c == null ? void 0 : c.title) || "Create Applicant" }) }),
|
|
7005
|
-
/* @__PURE__ */ i(
|
|
7006
|
-
|
|
7084
|
+
/* @__PURE__ */ i(ee, { children: [
|
|
7085
|
+
ue && /* @__PURE__ */ r("div", { className: "mb-6 p-4 bg-red-50 border border-red-200 rounded-lg", children: /* @__PURE__ */ i("p", { className: "text-red-600 text-sm", children: [
|
|
7007
7086
|
/* @__PURE__ */ r("strong", { children: "Error:" }),
|
|
7008
7087
|
" ",
|
|
7009
|
-
|
|
7088
|
+
ue
|
|
7010
7089
|
] }) }),
|
|
7011
7090
|
/* @__PURE__ */ r("div", { className: "grid grid-cols-4 gap-4", children: U.map((o) => /* @__PURE__ */ r("div", { className: "col-span-4", children: je(o) }, o)) })
|
|
7012
7091
|
] }),
|
|
7013
|
-
/* @__PURE__ */ i(
|
|
7014
|
-
a && /* @__PURE__ */ r(
|
|
7015
|
-
/* @__PURE__ */ r(
|
|
7092
|
+
/* @__PURE__ */ i(xe, { className: "flex justify-between", children: [
|
|
7093
|
+
a && /* @__PURE__ */ r(V, { type: "button", variant: "outline", onClick: a, disabled: x || h, children: "Cancel" }),
|
|
7094
|
+
/* @__PURE__ */ r(V, { type: "submit", isLoading: x || h, children: "Create Applicant" })
|
|
7016
7095
|
] })
|
|
7017
7096
|
] }) }) });
|
|
7018
7097
|
}, Et = ["companyName", "email"];
|
|
@@ -7025,75 +7104,75 @@ const Wn = ({
|
|
|
7025
7104
|
onSuccess: n,
|
|
7026
7105
|
onCancel: a
|
|
7027
7106
|
}) => {
|
|
7028
|
-
var je, We, g,
|
|
7107
|
+
var je, We, g, _, q;
|
|
7029
7108
|
const { config: s, baseInformationService: l, currentTheme: c } = Re(), { createCompanyApplicant: u, isLoading: h } = Pt(), m = e || ((je = s.applicantForm) == null ? void 0 : je.workflowKey);
|
|
7030
7109
|
if (!m)
|
|
7031
7110
|
throw new Error(
|
|
7032
7111
|
"workflowKey is required. Provide it either as a prop to CreateCompanyApplicantForm or set it in config.applicantForm.workflowKey"
|
|
7033
7112
|
);
|
|
7034
|
-
const
|
|
7113
|
+
const I = t || ((We = s.applicantForm) == null ? void 0 : We.externalRefId) || "", T = ((g = s.applicantForm) == null ? void 0 : g.email) || "", L = (((_ = s.applicantForm) == null ? void 0 : _.fieldLabelMode) || (c == null ? void 0 : c.fieldLabelMode) || "label") !== "placeholder", f = Ae(
|
|
7035
7114
|
() => c != null && c.companyFormPages && c.companyFormPages.length > 0 ? c.companyFormPages : null,
|
|
7036
7115
|
[c == null ? void 0 : c.companyFormPages]
|
|
7037
|
-
),
|
|
7038
|
-
const p = new Set(Et),
|
|
7039
|
-
if (
|
|
7116
|
+
), S = Ae(() => {
|
|
7117
|
+
const p = new Set(Et), w = c == null ? void 0 : c.companyFormRequiredFields;
|
|
7118
|
+
if (w) for (const E of w) p.add(E);
|
|
7040
7119
|
if (f)
|
|
7041
|
-
for (const
|
|
7042
|
-
for (const
|
|
7043
|
-
!
|
|
7120
|
+
for (const E of f)
|
|
7121
|
+
for (const v of E.fields)
|
|
7122
|
+
!v.isCustom && v.name && v.required && p.add(v.name);
|
|
7044
7123
|
return Array.from(p);
|
|
7045
7124
|
}, [c == null ? void 0 : c.companyFormRequiredFields, f]), D = Ae(() => {
|
|
7046
7125
|
var p;
|
|
7047
7126
|
if (f) {
|
|
7048
|
-
const
|
|
7049
|
-
for (const
|
|
7050
|
-
return Array.from(
|
|
7127
|
+
const w = f.flatMap((v) => v.fields).filter((v) => !v.isCustom && v.name).map((v) => v.name), E = new Set(w);
|
|
7128
|
+
for (const v of Et) E.add(v);
|
|
7129
|
+
return Array.from(E);
|
|
7051
7130
|
}
|
|
7052
7131
|
return (p = s.applicantForm) != null && p.visibleFields ? s.applicantForm.visibleFields : c != null && c.companyFormVisibleFields && c.companyFormVisibleFields.length > 0 ? c.companyFormVisibleFields : rr;
|
|
7053
|
-
}, [(q = s.applicantForm) == null ? void 0 : q.visibleFields, c == null ? void 0 : c.companyFormVisibleFields, f]), U = /* @__PURE__ */ new Set(["countryResidence", "addressCountry"]),
|
|
7054
|
-
var
|
|
7132
|
+
}, [(q = s.applicantForm) == null ? void 0 : q.visibleFields, c == null ? void 0 : c.companyFormVisibleFields, f]), U = /* @__PURE__ */ new Set(["countryResidence", "addressCountry"]), W = Ae(() => {
|
|
7133
|
+
var w, E;
|
|
7055
7134
|
const p = /* @__PURE__ */ new Set();
|
|
7056
7135
|
if (f)
|
|
7057
|
-
for (const
|
|
7058
|
-
for (const o of
|
|
7059
|
-
!o.isCustom && o.name && U.has(o.name) && p.add(o.countriesType ?? ((
|
|
7136
|
+
for (const v of f)
|
|
7137
|
+
for (const o of v.fields)
|
|
7138
|
+
!o.isCustom && o.name && U.has(o.name) && p.add(o.countriesType ?? ((w = Xe[o.name]) == null ? void 0 : w.countriesType));
|
|
7060
7139
|
else
|
|
7061
|
-
for (const
|
|
7062
|
-
U.has(
|
|
7140
|
+
for (const v of D)
|
|
7141
|
+
U.has(v) && p.add((E = Xe[v]) == null ? void 0 : E.countriesType);
|
|
7063
7142
|
return p.size === 0 && p.add(void 0), Array.from(p);
|
|
7064
|
-
}, [D, f]), [M, B] = k({}), [
|
|
7143
|
+
}, [D, f]), [M, B] = k({}), [G, J] = k(!0), F = le(/* @__PURE__ */ new Set()), b = le(/* @__PURE__ */ new Set());
|
|
7065
7144
|
ye(() => {
|
|
7066
7145
|
if (!c) return;
|
|
7067
|
-
const p =
|
|
7068
|
-
const o =
|
|
7069
|
-
return !b.current.has(o) && !
|
|
7146
|
+
const p = W.filter((v) => {
|
|
7147
|
+
const o = v != null ? String(v) : "all";
|
|
7148
|
+
return !b.current.has(o) && !F.current.has(o);
|
|
7070
7149
|
});
|
|
7071
7150
|
if (p.length === 0) {
|
|
7072
|
-
|
|
7151
|
+
W.every((o) => b.current.has(o != null ? String(o) : "all")) && J(!1);
|
|
7073
7152
|
return;
|
|
7074
7153
|
}
|
|
7075
|
-
|
|
7076
|
-
const
|
|
7077
|
-
|
|
7154
|
+
J(!0);
|
|
7155
|
+
const w = p.map((v) => v != null ? String(v) : "all");
|
|
7156
|
+
w.forEach((v) => F.current.add(v)), (async () => {
|
|
7078
7157
|
try {
|
|
7079
|
-
const
|
|
7158
|
+
const v = await Promise.all(
|
|
7080
7159
|
p.map(async (o) => {
|
|
7081
|
-
const d = o != null ? String(o) : "all", A = await l.getCountries("", s.locale || "en", o), y = /* @__PURE__ */ new Set(),
|
|
7082
|
-
return b.current.add(d),
|
|
7160
|
+
const d = o != null ? String(o) : "all", A = await l.getCountries("", s.locale || "en", o), y = /* @__PURE__ */ new Set(), N = A.map((C) => ({ value: C.abbreviation3 || C.abbreviation, label: C.name })).filter((C) => !C.value || y.has(C.value) ? !1 : (y.add(C.value), !0));
|
|
7161
|
+
return b.current.add(d), F.current.delete(d), [d, N];
|
|
7083
7162
|
})
|
|
7084
7163
|
);
|
|
7085
|
-
B((o) => ({ ...o, ...Object.fromEntries(
|
|
7086
|
-
} catch (
|
|
7087
|
-
|
|
7164
|
+
B((o) => ({ ...o, ...Object.fromEntries(v) }));
|
|
7165
|
+
} catch (v) {
|
|
7166
|
+
w.forEach((o) => F.current.delete(o)), console.error("Failed to load countries:", v);
|
|
7088
7167
|
} finally {
|
|
7089
|
-
|
|
7168
|
+
W.every((o) => b.current.has(o != null ? String(o) : "all")) && J(!1);
|
|
7090
7169
|
}
|
|
7091
7170
|
})();
|
|
7092
|
-
}, [
|
|
7093
|
-
const
|
|
7171
|
+
}, [W, c]);
|
|
7172
|
+
const $ = (p, w) => {
|
|
7094
7173
|
var o;
|
|
7095
|
-
const
|
|
7096
|
-
return M[
|
|
7174
|
+
const E = w ?? ((o = Xe[p]) == null ? void 0 : o.countriesType), v = E != null ? String(E) : "all";
|
|
7175
|
+
return M[v] || [];
|
|
7097
7176
|
}, [H, z] = k({
|
|
7098
7177
|
workflowKey: m,
|
|
7099
7178
|
companyName: "",
|
|
@@ -7115,140 +7194,140 @@ const Wn = ({
|
|
|
7115
7194
|
postalCode: "",
|
|
7116
7195
|
addressCountry: "",
|
|
7117
7196
|
lei: "",
|
|
7118
|
-
externalRefId:
|
|
7119
|
-
}), [O,
|
|
7120
|
-
var
|
|
7121
|
-
const
|
|
7122
|
-
for (const
|
|
7123
|
-
if (
|
|
7124
|
-
if (
|
|
7125
|
-
if (
|
|
7126
|
-
const o = O[
|
|
7127
|
-
|
|
7197
|
+
externalRefId: I
|
|
7198
|
+
}), [O, ne] = k({}), [ae, re] = k(0), [he, de] = k({}), [P, K] = k(null), [Z, ue] = k(!1), j = (p, w) => z((E) => ({ ...E, [p]: w })), x = (p, w) => ne((E) => ({ ...E, [p]: w })), Q = (p) => !p.conditionalOn || O[p.conditionalOn] === "true", Y = f && ae < f.length - 1 ? ae + 1 : -1, ce = f && ae > 0 ? ae - 1 : -1, we = (p) => {
|
|
7199
|
+
var E;
|
|
7200
|
+
const w = {};
|
|
7201
|
+
for (const v of p.fields)
|
|
7202
|
+
if (v.isCustom) {
|
|
7203
|
+
if (v.customType === "paragraph" || v.customType === "html" || v.customType === "br" || v.customType === "link") continue;
|
|
7204
|
+
if (v.required && v.paramName) {
|
|
7205
|
+
const o = O[v.paramName], d = v.displayText || v.label || v.paramName;
|
|
7206
|
+
v.customType === "checkbox" || v.customType === "link_checkbox" ? o !== "true" && (w[v.paramName] = `${d} is required.`) : (!o || o.trim() === "") && (w[v.paramName] = `${d} is required.`);
|
|
7128
7207
|
}
|
|
7129
|
-
} else if (
|
|
7130
|
-
const o =
|
|
7131
|
-
if (
|
|
7132
|
-
const d =
|
|
7133
|
-
|
|
7208
|
+
} else if (v.name) {
|
|
7209
|
+
const o = v.name;
|
|
7210
|
+
if (S.includes(o) && ht(H[o])) {
|
|
7211
|
+
const d = v.displayText || ((E = Xe[o]) == null ? void 0 : E.label) || o;
|
|
7212
|
+
w[o] = `${d} is required.`;
|
|
7134
7213
|
}
|
|
7135
7214
|
}
|
|
7136
|
-
return
|
|
7215
|
+
return w;
|
|
7137
7216
|
}, De = async () => {
|
|
7138
7217
|
if (!f) return;
|
|
7139
|
-
const p = f[
|
|
7140
|
-
if (p.conditionalOn && !
|
|
7141
|
-
|
|
7218
|
+
const p = f[ae];
|
|
7219
|
+
if (p.conditionalOn && !Q(p)) {
|
|
7220
|
+
de({}), Y >= 0 ? re(Y) : await ve();
|
|
7142
7221
|
return;
|
|
7143
7222
|
}
|
|
7144
|
-
const
|
|
7145
|
-
if (Object.keys(
|
|
7146
|
-
|
|
7223
|
+
const w = we(p);
|
|
7224
|
+
if (Object.keys(w).length > 0) {
|
|
7225
|
+
de(w);
|
|
7147
7226
|
return;
|
|
7148
7227
|
}
|
|
7149
|
-
|
|
7150
|
-
},
|
|
7228
|
+
de({}), Y >= 0 ? re(Y) : await ve();
|
|
7229
|
+
}, ve = async () => {
|
|
7151
7230
|
var p;
|
|
7152
7231
|
if (f) {
|
|
7153
|
-
let
|
|
7154
|
-
for (const
|
|
7155
|
-
|
|
7156
|
-
if (Object.keys(
|
|
7157
|
-
|
|
7232
|
+
let w = {};
|
|
7233
|
+
for (const E of f)
|
|
7234
|
+
Q(E) && (w = { ...w, ...we(E) });
|
|
7235
|
+
if (Object.keys(w).length > 0) {
|
|
7236
|
+
de(w);
|
|
7158
7237
|
return;
|
|
7159
7238
|
}
|
|
7160
7239
|
}
|
|
7161
|
-
|
|
7240
|
+
ue(!0), K(null);
|
|
7162
7241
|
try {
|
|
7163
|
-
const
|
|
7242
|
+
const w = {
|
|
7164
7243
|
workflowKey: H.workflowKey,
|
|
7165
7244
|
externalRefId: ((p = H.externalRefId) == null ? void 0 : p.trim()) || void 0
|
|
7166
|
-
},
|
|
7167
|
-
for (const d of
|
|
7245
|
+
}, E = f ? f.filter((d) => Q(d)).flatMap((d) => d.fields).filter((d) => !d.isCustom && d.name).map((d) => d.name) : D;
|
|
7246
|
+
for (const d of E) {
|
|
7168
7247
|
const A = H[d];
|
|
7169
7248
|
if (!ht(A))
|
|
7170
7249
|
switch (d) {
|
|
7171
7250
|
case "companyName":
|
|
7172
|
-
|
|
7251
|
+
w.companyName = A;
|
|
7173
7252
|
break;
|
|
7174
7253
|
case "email":
|
|
7175
|
-
|
|
7254
|
+
w.companyEmail = A;
|
|
7176
7255
|
break;
|
|
7177
7256
|
case "phone":
|
|
7178
|
-
|
|
7257
|
+
w.companyPhone = A;
|
|
7179
7258
|
break;
|
|
7180
7259
|
case "registrationNumber":
|
|
7181
|
-
|
|
7260
|
+
w.companyRegistrationNumber = A;
|
|
7182
7261
|
break;
|
|
7183
7262
|
case "countryResidence":
|
|
7184
|
-
|
|
7263
|
+
w.companyCountry = A;
|
|
7185
7264
|
break;
|
|
7186
7265
|
case "city":
|
|
7187
|
-
|
|
7266
|
+
w.companyCity = A;
|
|
7188
7267
|
break;
|
|
7189
7268
|
case "street":
|
|
7190
|
-
|
|
7269
|
+
w.companyStreet = A;
|
|
7191
7270
|
break;
|
|
7192
7271
|
case "postalCode":
|
|
7193
|
-
|
|
7272
|
+
w.companyZip = A;
|
|
7194
7273
|
break;
|
|
7195
7274
|
default:
|
|
7196
|
-
|
|
7275
|
+
w[d] = A;
|
|
7197
7276
|
break;
|
|
7198
7277
|
}
|
|
7199
7278
|
}
|
|
7200
|
-
const
|
|
7279
|
+
const v = [];
|
|
7201
7280
|
if (f) {
|
|
7202
7281
|
for (const d of f)
|
|
7203
|
-
if (
|
|
7282
|
+
if (Q(d))
|
|
7204
7283
|
for (const A of d.fields) {
|
|
7205
7284
|
if (!A.isCustom || !A.paramName || A.customType === "paragraph" || A.customType === "html" || A.customType === "br" || A.customType === "link") continue;
|
|
7206
7285
|
const y = O[A.paramName] ?? "";
|
|
7207
|
-
let
|
|
7286
|
+
let N;
|
|
7208
7287
|
if (A.customType === "checkbox" || A.customType === "link_checkbox")
|
|
7209
|
-
|
|
7210
|
-
else if (
|
|
7211
|
-
|
|
7288
|
+
N = y === "true" ? "yes" : "no";
|
|
7289
|
+
else if (N = y, !N && !A.required) continue;
|
|
7290
|
+
v.push({ paramName: A.paramName, value: N });
|
|
7212
7291
|
}
|
|
7213
7292
|
}
|
|
7214
|
-
|
|
7215
|
-
const o = await u(
|
|
7293
|
+
v.length > 0 && (w.applicantAdditionalDatas = v);
|
|
7294
|
+
const o = await u(w);
|
|
7216
7295
|
n(o.applicantId);
|
|
7217
|
-
} catch (
|
|
7218
|
-
console.error("Error creating company applicant:",
|
|
7296
|
+
} catch (w) {
|
|
7297
|
+
console.error("Error creating company applicant:", w), K(w.message || "Failed to create company applicant");
|
|
7219
7298
|
} finally {
|
|
7220
|
-
|
|
7299
|
+
ue(!1);
|
|
7221
7300
|
}
|
|
7222
7301
|
}, Ge = async (p) => {
|
|
7223
|
-
var
|
|
7302
|
+
var w;
|
|
7224
7303
|
p.preventDefault();
|
|
7225
|
-
for (const
|
|
7226
|
-
if (ht(H[
|
|
7227
|
-
const
|
|
7228
|
-
|
|
7304
|
+
for (const E of S)
|
|
7305
|
+
if (ht(H[E])) {
|
|
7306
|
+
const v = ((w = Xe[E]) == null ? void 0 : w.label) || E;
|
|
7307
|
+
K(`${v} is required.`);
|
|
7229
7308
|
return;
|
|
7230
7309
|
}
|
|
7231
|
-
await
|
|
7232
|
-
}, Je = (p,
|
|
7310
|
+
await ve();
|
|
7311
|
+
}, Je = (p, w, E, v, o) => {
|
|
7233
7312
|
const d = Xe[p];
|
|
7234
7313
|
if (!d) return null;
|
|
7235
|
-
const A =
|
|
7314
|
+
const A = S.includes(p), y = he[p], N = E || d.label, C = w ?? p, oe = o ? o !== "placeholder" : L, ie = oe ? N : void 0, ke = oe ? "..." : N;
|
|
7236
7315
|
switch (d.type) {
|
|
7237
7316
|
case "select":
|
|
7238
7317
|
if (p === "countryResidence" || p === "addressCountry") {
|
|
7239
|
-
const ge =
|
|
7318
|
+
const ge = $(p, v);
|
|
7240
7319
|
return /* @__PURE__ */ r(
|
|
7241
7320
|
Be,
|
|
7242
7321
|
{
|
|
7243
7322
|
required: A,
|
|
7244
7323
|
label: ie,
|
|
7245
7324
|
value: H[p] || "",
|
|
7246
|
-
onChange: (pe) =>
|
|
7247
|
-
options: [{ value: "", label: `Select ${
|
|
7248
|
-
disabled:
|
|
7325
|
+
onChange: (pe) => j(p, pe),
|
|
7326
|
+
options: [{ value: "", label: `Select ${ke.toLowerCase()}` }, ...ge],
|
|
7327
|
+
disabled: G,
|
|
7249
7328
|
error: y
|
|
7250
7329
|
},
|
|
7251
|
-
|
|
7330
|
+
C
|
|
7252
7331
|
);
|
|
7253
7332
|
}
|
|
7254
7333
|
return null;
|
|
@@ -7259,12 +7338,12 @@ const Wn = ({
|
|
|
7259
7338
|
required: A,
|
|
7260
7339
|
type: "date",
|
|
7261
7340
|
label: ie,
|
|
7262
|
-
placeholder: oe ? void 0 :
|
|
7341
|
+
placeholder: oe ? void 0 : N,
|
|
7263
7342
|
value: H[p] || "",
|
|
7264
|
-
onChange: (ge) =>
|
|
7343
|
+
onChange: (ge) => j(p, ge.target.value),
|
|
7265
7344
|
error: y
|
|
7266
7345
|
},
|
|
7267
|
-
|
|
7346
|
+
C
|
|
7268
7347
|
);
|
|
7269
7348
|
case "email":
|
|
7270
7349
|
return /* @__PURE__ */ r(
|
|
@@ -7273,12 +7352,12 @@ const Wn = ({
|
|
|
7273
7352
|
required: A,
|
|
7274
7353
|
type: "email",
|
|
7275
7354
|
label: ie,
|
|
7276
|
-
placeholder: oe ? void 0 :
|
|
7355
|
+
placeholder: oe ? void 0 : N,
|
|
7277
7356
|
value: H[p] || "",
|
|
7278
|
-
onChange: (ge) =>
|
|
7357
|
+
onChange: (ge) => j(p, ge.target.value),
|
|
7279
7358
|
error: y
|
|
7280
7359
|
},
|
|
7281
|
-
|
|
7360
|
+
C
|
|
7282
7361
|
);
|
|
7283
7362
|
case "tel":
|
|
7284
7363
|
return /* @__PURE__ */ r(
|
|
@@ -7287,12 +7366,12 @@ const Wn = ({
|
|
|
7287
7366
|
required: A,
|
|
7288
7367
|
type: "tel",
|
|
7289
7368
|
label: ie,
|
|
7290
|
-
placeholder: oe ? void 0 :
|
|
7369
|
+
placeholder: oe ? void 0 : N,
|
|
7291
7370
|
value: H[p] || "",
|
|
7292
|
-
onChange: (ge) =>
|
|
7371
|
+
onChange: (ge) => j(p, ge.target.value),
|
|
7293
7372
|
error: y
|
|
7294
7373
|
},
|
|
7295
|
-
|
|
7374
|
+
C
|
|
7296
7375
|
);
|
|
7297
7376
|
default:
|
|
7298
7377
|
return /* @__PURE__ */ r(
|
|
@@ -7301,15 +7380,15 @@ const Wn = ({
|
|
|
7301
7380
|
required: A,
|
|
7302
7381
|
type: "text",
|
|
7303
7382
|
label: ie,
|
|
7304
|
-
placeholder: oe ? void 0 :
|
|
7383
|
+
placeholder: oe ? void 0 : N,
|
|
7305
7384
|
value: H[p] || "",
|
|
7306
|
-
onChange: (ge) =>
|
|
7385
|
+
onChange: (ge) => j(p, ge.target.value),
|
|
7307
7386
|
error: y
|
|
7308
7387
|
},
|
|
7309
|
-
|
|
7388
|
+
C
|
|
7310
7389
|
);
|
|
7311
7390
|
}
|
|
7312
|
-
}, Me = (p,
|
|
7391
|
+
}, Me = (p, w) => {
|
|
7313
7392
|
if (p.customType === "paragraph")
|
|
7314
7393
|
return /* @__PURE__ */ r(
|
|
7315
7394
|
"p",
|
|
@@ -7317,12 +7396,12 @@ const Wn = ({
|
|
|
7317
7396
|
style: { fontSize: "14px", lineHeight: "1.7", margin: 0, color: "var(--metakyc-text-secondary, #6b7280)" },
|
|
7318
7397
|
dangerouslySetInnerHTML: { __html: p.displayText || p.label || "" }
|
|
7319
7398
|
},
|
|
7320
|
-
`custom-${
|
|
7399
|
+
`custom-${w}`
|
|
7321
7400
|
);
|
|
7322
7401
|
if (p.customType === "html")
|
|
7323
|
-
return /* @__PURE__ */ r("div", { dangerouslySetInnerHTML: { __html: p.label || "" } }, `custom-${
|
|
7402
|
+
return /* @__PURE__ */ r("div", { dangerouslySetInnerHTML: { __html: p.label || "" } }, `custom-${w}`);
|
|
7324
7403
|
if (p.customType === "br")
|
|
7325
|
-
return /* @__PURE__ */ r("div", { style: { height: "12px" } }, `custom-${
|
|
7404
|
+
return /* @__PURE__ */ r("div", { style: { height: "12px" } }, `custom-${w}`);
|
|
7326
7405
|
if (p.customType === "link")
|
|
7327
7406
|
return /* @__PURE__ */ r("div", { children: /* @__PURE__ */ r(
|
|
7328
7407
|
"a",
|
|
@@ -7333,9 +7412,9 @@ const Wn = ({
|
|
|
7333
7412
|
style: { color: "var(--metakyc-primary, #2563eb)", fontSize: "14px", textDecoration: "underline" },
|
|
7334
7413
|
children: p.displayText || p.label || p.linkText || p.linkUrl || ""
|
|
7335
7414
|
}
|
|
7336
|
-
) }, `custom-${
|
|
7415
|
+
) }, `custom-${w}`);
|
|
7337
7416
|
if (!p.paramName) return null;
|
|
7338
|
-
const
|
|
7417
|
+
const E = he[p.paramName], v = p.displayText || p.label || p.paramName, o = p.labelMode ? p.labelMode !== "placeholder" : L;
|
|
7339
7418
|
return p.customType === "checkbox" ? /* @__PURE__ */ i("div", { className: "flex flex-col gap-1", children: [
|
|
7340
7419
|
/* @__PURE__ */ i("label", { style: { display: "flex", alignItems: "center", gap: "10px", cursor: "pointer" }, children: [
|
|
7341
7420
|
/* @__PURE__ */ r(
|
|
@@ -7343,60 +7422,60 @@ const Wn = ({
|
|
|
7343
7422
|
{
|
|
7344
7423
|
type: "checkbox",
|
|
7345
7424
|
checked: O[p.paramName] === "true",
|
|
7346
|
-
onChange: (d) =>
|
|
7425
|
+
onChange: (d) => x(p.paramName, d.target.checked ? "true" : "false"),
|
|
7347
7426
|
style: { width: "16px", height: "16px", accentColor: "var(--metakyc-primary, #2563eb)" }
|
|
7348
7427
|
}
|
|
7349
7428
|
),
|
|
7350
7429
|
/* @__PURE__ */ i("span", { style: { fontSize: "14px", color: "var(--metakyc-text-primary, #111827)" }, children: [
|
|
7351
|
-
|
|
7430
|
+
v,
|
|
7352
7431
|
p.required && /* @__PURE__ */ r("span", { className: "text-red-500 ml-0.5", children: "*" })
|
|
7353
7432
|
] })
|
|
7354
7433
|
] }),
|
|
7355
|
-
|
|
7356
|
-
] }, `custom-${
|
|
7434
|
+
E && /* @__PURE__ */ r("p", { className: "text-red-500 text-xs mt-0.5", children: E })
|
|
7435
|
+
] }, `custom-${w}`) : /* @__PURE__ */ r(
|
|
7357
7436
|
fe,
|
|
7358
7437
|
{
|
|
7359
7438
|
type: "text",
|
|
7360
|
-
label: o ? `${
|
|
7361
|
-
placeholder: o ? void 0 :
|
|
7439
|
+
label: o ? `${v}${p.required ? " *" : ""}` : void 0,
|
|
7440
|
+
placeholder: o ? void 0 : v,
|
|
7362
7441
|
value: O[p.paramName] || "",
|
|
7363
|
-
onChange: (d) =>
|
|
7442
|
+
onChange: (d) => x(p.paramName, d.target.value),
|
|
7364
7443
|
required: p.required,
|
|
7365
|
-
error:
|
|
7444
|
+
error: E
|
|
7366
7445
|
},
|
|
7367
|
-
`custom-${
|
|
7446
|
+
`custom-${w}`
|
|
7368
7447
|
);
|
|
7369
7448
|
}, Ze = (p) => {
|
|
7370
|
-
const
|
|
7449
|
+
const w = Q(p);
|
|
7371
7450
|
return /* @__PURE__ */ i("div", { className: "space-y-4", children: [
|
|
7372
7451
|
p.conditionalOn && /* @__PURE__ */ i("label", { style: { display: "flex", alignItems: "center", gap: "10px", cursor: "pointer" }, children: [
|
|
7373
7452
|
/* @__PURE__ */ r(
|
|
7374
7453
|
"input",
|
|
7375
7454
|
{
|
|
7376
7455
|
type: "checkbox",
|
|
7377
|
-
checked:
|
|
7378
|
-
onChange: (
|
|
7456
|
+
checked: w,
|
|
7457
|
+
onChange: (E) => x(p.conditionalOn, E.target.checked ? "true" : "false"),
|
|
7379
7458
|
style: { width: "16px", height: "16px", accentColor: "var(--metakyc-primary, #2563eb)" }
|
|
7380
7459
|
}
|
|
7381
7460
|
),
|
|
7382
7461
|
/* @__PURE__ */ r("span", { style: { fontSize: "14px", fontWeight: 500 }, children: p.conditionalOn })
|
|
7383
7462
|
] }),
|
|
7384
|
-
|
|
7385
|
-
const o =
|
|
7386
|
-
return /* @__PURE__ */ r("div", { className: o, children:
|
|
7463
|
+
w && /* @__PURE__ */ r("div", { className: "grid grid-cols-4 gap-4", children: p.fields.map((E, v) => {
|
|
7464
|
+
const o = E.colSpan === 1 ? "col-span-1" : E.colSpan === 2 ? "col-span-2" : E.colSpan === 3 ? "col-span-3" : "col-span-4", d = E.isCustom ? `custom-${v}-${E.paramName}` : `builtin-${E.name}-${v}`;
|
|
7465
|
+
return /* @__PURE__ */ r("div", { className: o, children: E.isCustom ? Me(E, v) : Je(E.name, d, E.displayText, E.countriesType, E.labelMode) }, d);
|
|
7387
7466
|
}) })
|
|
7388
7467
|
] });
|
|
7389
7468
|
};
|
|
7390
|
-
if (!c ||
|
|
7391
|
-
return /* @__PURE__ */ r("div", { className: "metakyc-sdk", children: /* @__PURE__ */ r(
|
|
7469
|
+
if (!c || G)
|
|
7470
|
+
return /* @__PURE__ */ r("div", { className: "metakyc-sdk", children: /* @__PURE__ */ r(X, { children: /* @__PURE__ */ i(ee, { children: [
|
|
7392
7471
|
/* @__PURE__ */ r(Pe, { className: "my-8" }),
|
|
7393
7472
|
/* @__PURE__ */ r("p", { className: "text-center mt-4", style: { color: "var(--metakyc-text-secondary, #6b7280)", fontSize: "0.875rem" }, children: "Loading form…" })
|
|
7394
7473
|
] }) }) });
|
|
7395
7474
|
if (f) {
|
|
7396
|
-
const p = f[
|
|
7397
|
-
return /* @__PURE__ */ r("div", { className: "metakyc-sdk", children: /* @__PURE__ */ i(
|
|
7475
|
+
const p = f[ae] ?? f[0], w = ce === -1, E = Y === -1, v = f.length, o = Q(p), d = Object.values(he);
|
|
7476
|
+
return /* @__PURE__ */ r("div", { className: "metakyc-sdk", children: /* @__PURE__ */ i(X, { children: [
|
|
7398
7477
|
/* @__PURE__ */ r(be, { children: /* @__PURE__ */ r(ot, { title: (c == null ? void 0 : c.title) || "Company Registration" }) }),
|
|
7399
|
-
/* @__PURE__ */ i(
|
|
7478
|
+
/* @__PURE__ */ i(ee, { children: [
|
|
7400
7479
|
(p.title || p.subtitle) && /* @__PURE__ */ i("div", { className: "mb-4", children: [
|
|
7401
7480
|
p.title && /* @__PURE__ */ r("h3", { className: "font-semibold text-base", style: { color: "var(--metakyc-text-primary, #111827)" }, children: p.title }),
|
|
7402
7481
|
p.subtitle && /* @__PURE__ */ r("p", { className: "text-sm mt-0.5", style: { color: "var(--metakyc-text-secondary, #6b7280)" }, children: p.subtitle })
|
|
@@ -7409,46 +7488,46 @@ const Wn = ({
|
|
|
7409
7488
|
] }),
|
|
7410
7489
|
d.map((A, y) => /* @__PURE__ */ r("p", { className: "text-red-600 text-sm", children: A }, y))
|
|
7411
7490
|
] }),
|
|
7412
|
-
|
|
7491
|
+
v > 1 && /* @__PURE__ */ i("div", { className: "flex items-center gap-2 mb-4", children: [
|
|
7413
7492
|
f.map((A, y) => /* @__PURE__ */ r(
|
|
7414
7493
|
"div",
|
|
7415
7494
|
{
|
|
7416
|
-
className: `h-1.5 rounded-full transition-all ${y ===
|
|
7417
|
-
style: y ===
|
|
7495
|
+
className: `h-1.5 rounded-full transition-all ${y === ae ? "flex-1" : "w-8"}`,
|
|
7496
|
+
style: y === ae ? { backgroundColor: "var(--metakyc-primary, #2563eb)" } : y < ae ? { backgroundColor: "var(--metakyc-primary-light, #93c5fd)", opacity: 0.7 } : { backgroundColor: "#e5e7eb" }
|
|
7418
7497
|
},
|
|
7419
7498
|
y
|
|
7420
7499
|
)),
|
|
7421
7500
|
/* @__PURE__ */ i("span", { className: "text-xs text-gray-400 flex-shrink-0", children: [
|
|
7422
|
-
|
|
7501
|
+
ae + 1,
|
|
7423
7502
|
" / ",
|
|
7424
|
-
|
|
7503
|
+
v
|
|
7425
7504
|
] })
|
|
7426
7505
|
] }),
|
|
7427
7506
|
Ze(p)
|
|
7428
7507
|
] }),
|
|
7429
|
-
/* @__PURE__ */ i(
|
|
7508
|
+
/* @__PURE__ */ i(xe, { className: "flex justify-between", children: [
|
|
7430
7509
|
/* @__PURE__ */ i("div", { children: [
|
|
7431
|
-
!
|
|
7432
|
-
|
|
7510
|
+
!w && /* @__PURE__ */ r(
|
|
7511
|
+
V,
|
|
7433
7512
|
{
|
|
7434
7513
|
type: "button",
|
|
7435
7514
|
variant: "outline",
|
|
7436
7515
|
onClick: () => {
|
|
7437
|
-
ce
|
|
7516
|
+
re(ce), de({});
|
|
7438
7517
|
},
|
|
7439
|
-
disabled:
|
|
7518
|
+
disabled: Z || h,
|
|
7440
7519
|
children: "Previous"
|
|
7441
7520
|
}
|
|
7442
7521
|
),
|
|
7443
|
-
|
|
7522
|
+
w && a && /* @__PURE__ */ r(V, { type: "button", variant: "outline", onClick: a, disabled: Z || h, children: "Cancel" })
|
|
7444
7523
|
] }),
|
|
7445
|
-
/* @__PURE__ */ r(
|
|
7524
|
+
/* @__PURE__ */ r(V, { type: "button", isLoading: Z || h, onClick: E ? ve : De, children: E ? p.conditionalOn && !o ? "Skip & Submit" : "Submit" : p.conditionalOn && !o ? "Skip" : "Next" })
|
|
7446
7525
|
] })
|
|
7447
7526
|
] }) });
|
|
7448
7527
|
}
|
|
7449
|
-
return /* @__PURE__ */ r("div", { className: "metakyc-sdk", children: /* @__PURE__ */ r("form", { onSubmit: Ge, children: /* @__PURE__ */ i(
|
|
7528
|
+
return /* @__PURE__ */ r("div", { className: "metakyc-sdk", children: /* @__PURE__ */ r("form", { onSubmit: Ge, children: /* @__PURE__ */ i(X, { children: [
|
|
7450
7529
|
/* @__PURE__ */ r(be, { children: /* @__PURE__ */ r(ot, { title: (c == null ? void 0 : c.title) || "Company Registration" }) }),
|
|
7451
|
-
/* @__PURE__ */ i(
|
|
7530
|
+
/* @__PURE__ */ i(ee, { children: [
|
|
7452
7531
|
P && /* @__PURE__ */ r("div", { className: "mb-6 p-4 bg-red-50 border border-red-200 rounded-lg", children: /* @__PURE__ */ i("p", { className: "text-red-600 text-sm", children: [
|
|
7453
7532
|
/* @__PURE__ */ r("strong", { children: "Error:" }),
|
|
7454
7533
|
" ",
|
|
@@ -7456,9 +7535,9 @@ const Wn = ({
|
|
|
7456
7535
|
] }) }),
|
|
7457
7536
|
/* @__PURE__ */ r("div", { className: "grid grid-cols-4 gap-4", children: D.map((p) => /* @__PURE__ */ r("div", { className: "col-span-4", children: Je(p) }, p)) })
|
|
7458
7537
|
] }),
|
|
7459
|
-
/* @__PURE__ */ i(
|
|
7460
|
-
a && /* @__PURE__ */ r(
|
|
7461
|
-
/* @__PURE__ */ r(
|
|
7538
|
+
/* @__PURE__ */ i(xe, { className: "flex justify-between", children: [
|
|
7539
|
+
a && /* @__PURE__ */ r(V, { type: "button", variant: "outline", onClick: a, disabled: Z || h, children: "Cancel" }),
|
|
7540
|
+
/* @__PURE__ */ r(V, { type: "submit", isLoading: Z || h, children: "Register Company" })
|
|
7462
7541
|
] })
|
|
7463
7542
|
] }) }) });
|
|
7464
7543
|
}, Kn = ({
|
|
@@ -7474,32 +7553,32 @@ const Wn = ({
|
|
|
7474
7553
|
steps: u,
|
|
7475
7554
|
workflowKey: h,
|
|
7476
7555
|
nextWorkflowKey: m,
|
|
7477
|
-
hasWorkflowChanged:
|
|
7556
|
+
hasWorkflowChanged: I,
|
|
7478
7557
|
isLoading: T,
|
|
7479
|
-
error:
|
|
7558
|
+
error: R,
|
|
7480
7559
|
moveBack: L,
|
|
7481
7560
|
refreshProgress: f
|
|
7482
|
-
} = $r(e), [
|
|
7561
|
+
} = $r(e), [S, D] = Fe.useState(!1);
|
|
7483
7562
|
if (Fe.useEffect(() => {
|
|
7484
|
-
|
|
7485
|
-
}, [
|
|
7563
|
+
R && n && n(R);
|
|
7564
|
+
}, [R, n]), Fe.useEffect(() => {
|
|
7486
7565
|
l != null && l.workflowResult && t && t(l.workflowResult);
|
|
7487
7566
|
}, [l == null ? void 0 : l.workflowResult, t]), Fe.useEffect(() => {
|
|
7488
7567
|
a === "dark" ? document.documentElement.classList.add("dark") : document.documentElement.classList.remove("dark");
|
|
7489
7568
|
}, [a]), Fe.useEffect(() => {
|
|
7490
|
-
|
|
7491
|
-
}, [
|
|
7492
|
-
return /* @__PURE__ */ r("div", { className: `metakyc-sdk ${s || ""}`, children: /* @__PURE__ */ r(
|
|
7569
|
+
I && D(!1);
|
|
7570
|
+
}, [I]), T || !l)
|
|
7571
|
+
return /* @__PURE__ */ r("div", { className: `metakyc-sdk ${s || ""}`, children: /* @__PURE__ */ r(X, { children: /* @__PURE__ */ i(ee, { children: [
|
|
7493
7572
|
/* @__PURE__ */ r(Pe, { className: "my-8" }),
|
|
7494
7573
|
/* @__PURE__ */ r("p", { className: "text-center mt-4", style: { color: "var(--metakyc-text-secondary, #6b7280)" }, children: "Loading workflow..." })
|
|
7495
7574
|
] }) }) });
|
|
7496
|
-
if (
|
|
7497
|
-
return /* @__PURE__ */ r("div", { className: `metakyc-sdk ${s || ""}`, children: /* @__PURE__ */ r(
|
|
7575
|
+
if (R)
|
|
7576
|
+
return /* @__PURE__ */ r("div", { className: `metakyc-sdk ${s || ""}`, children: /* @__PURE__ */ r(X, { children: /* @__PURE__ */ r(ee, { children: /* @__PURE__ */ i("div", { className: "text-center py-8", children: [
|
|
7498
7577
|
/* @__PURE__ */ r("p", { className: "text-lg mb-4", style: { color: "var(--metakyc-danger, #ef4444)" }, children: "An error occurred" }),
|
|
7499
|
-
/* @__PURE__ */ r("p", { style: { color: "var(--metakyc-text-secondary, #6b7280)" }, children:
|
|
7578
|
+
/* @__PURE__ */ r("p", { style: { color: "var(--metakyc-text-secondary, #6b7280)" }, children: R.message })
|
|
7500
7579
|
] }) }) }) });
|
|
7501
|
-
if (
|
|
7502
|
-
return /* @__PURE__ */ r("div", { className: `metakyc-sdk ${s || ""}`, children: /* @__PURE__ */ r(
|
|
7580
|
+
if (I && !S)
|
|
7581
|
+
return /* @__PURE__ */ r("div", { className: `metakyc-sdk ${s || ""}`, children: /* @__PURE__ */ r(X, { children: /* @__PURE__ */ r(ee, { children: /* @__PURE__ */ i("div", { className: "text-center py-8", children: [
|
|
7503
7582
|
/* @__PURE__ */ r("div", { className: "mb-6", children: /* @__PURE__ */ r("div", { className: "inline-flex items-center justify-center w-16 h-16 rounded-full mb-4", style: { backgroundColor: "var(--metakyc-primary-light, #dbeafe)" }, children: /* @__PURE__ */ r("svg", { className: "w-8 h-8", style: { color: "var(--metakyc-primary, #2563eb)" }, 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" }) }) }) }),
|
|
7504
7583
|
/* @__PURE__ */ r("h3", { className: "text-xl font-semibold mb-2", style: { color: "var(--metakyc-text-primary, #111827)" }, children: "Workflow Transition" }),
|
|
7505
7584
|
/* @__PURE__ */ r("p", { className: "mb-6", style: { color: "var(--metakyc-text-secondary, #6b7280)" }, children: "Your application workflow has been updated based on your progress." }),
|
|
@@ -7542,7 +7621,7 @@ const Wn = ({
|
|
|
7542
7621
|
}
|
|
7543
7622
|
) });
|
|
7544
7623
|
if (!c)
|
|
7545
|
-
return /* @__PURE__ */ r("div", { className: `metakyc-sdk ${s || ""}`, children: /* @__PURE__ */ r(
|
|
7624
|
+
return /* @__PURE__ */ r("div", { className: `metakyc-sdk ${s || ""}`, children: /* @__PURE__ */ r(X, { children: /* @__PURE__ */ i(ee, { children: [
|
|
7546
7625
|
/* @__PURE__ */ r(Pe, { className: "my-8" }),
|
|
7547
7626
|
/* @__PURE__ */ r("p", { className: "text-center mt-4", style: { color: "var(--metakyc-text-secondary, #6b7280)" }, children: l.status === Te.IdentityPending ? "Loading identity verification..." : "Loading current step..." })
|
|
7548
7627
|
] }) }) });
|
|
@@ -7569,20 +7648,20 @@ const Wn = ({
|
|
|
7569
7648
|
default:
|
|
7570
7649
|
return "";
|
|
7571
7650
|
}
|
|
7572
|
-
},
|
|
7573
|
-
const B = u.filter((b) => b.visibility !== !1),
|
|
7651
|
+
}, W = () => {
|
|
7652
|
+
const B = u.filter((b) => b.visibility !== !1), G = B.findIndex((b) => b.order === c.order), J = G >= 0 ? G + 1 : 1, F = B.length;
|
|
7574
7653
|
return /* @__PURE__ */ i("div", { className: "mb-6", children: [
|
|
7575
7654
|
/* @__PURE__ */ i("div", { className: "flex items-start justify-between mb-4", children: [
|
|
7576
7655
|
/* @__PURE__ */ r(ot, {}),
|
|
7577
7656
|
/* @__PURE__ */ i(Lt, { variant: l.status === 1 ? "info" : "success", children: [
|
|
7578
7657
|
"Step ",
|
|
7579
|
-
|
|
7658
|
+
J,
|
|
7580
7659
|
" of ",
|
|
7581
|
-
|
|
7660
|
+
F
|
|
7582
7661
|
] })
|
|
7583
7662
|
] }),
|
|
7584
|
-
/* @__PURE__ */ r("div", { className: "flex items-center", children: B.map((b,
|
|
7585
|
-
const H =
|
|
7663
|
+
/* @__PURE__ */ r("div", { className: "flex items-center", children: B.map((b, $) => {
|
|
7664
|
+
const H = $ < G, z = b.order === c.order, O = H || z;
|
|
7586
7665
|
return /* @__PURE__ */ i(Fe.Fragment, { children: [
|
|
7587
7666
|
/* @__PURE__ */ i("div", { className: "flex items-center", children: [
|
|
7588
7667
|
/* @__PURE__ */ r(
|
|
@@ -7598,7 +7677,7 @@ const Wn = ({
|
|
|
7598
7677
|
color: "var(--metakyc-text-muted, #9ca3af)",
|
|
7599
7678
|
border: "2px solid var(--metakyc-border, #e5e7eb)"
|
|
7600
7679
|
},
|
|
7601
|
-
children: H ? /* @__PURE__ */ r("svg", { className: "w-4 h-4", fill: "none", stroke: "currentColor", strokeWidth: 2.5, viewBox: "0 0 24 24", children: /* @__PURE__ */ r("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M5 13l4 4L19 7" }) }) :
|
|
7680
|
+
children: H ? /* @__PURE__ */ r("svg", { className: "w-4 h-4", fill: "none", stroke: "currentColor", strokeWidth: 2.5, viewBox: "0 0 24 24", children: /* @__PURE__ */ r("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M5 13l4 4L19 7" }) }) : $ + 1
|
|
7602
7681
|
}
|
|
7603
7682
|
),
|
|
7604
7683
|
/* @__PURE__ */ r(
|
|
@@ -7609,11 +7688,11 @@ const Wn = ({
|
|
|
7609
7688
|
fontWeight: z ? 600 : 400,
|
|
7610
7689
|
color: z ? "var(--metakyc-text-primary, #111827)" : "var(--metakyc-text-muted, #9ca3af)"
|
|
7611
7690
|
},
|
|
7612
|
-
children: b.displayName || b.name || U(b.action) || `Step ${
|
|
7691
|
+
children: b.displayName || b.name || U(b.action) || `Step ${$ + 1}`
|
|
7613
7692
|
}
|
|
7614
7693
|
)
|
|
7615
7694
|
] }),
|
|
7616
|
-
|
|
7695
|
+
$ < B.length - 1 && /* @__PURE__ */ r(
|
|
7617
7696
|
"div",
|
|
7618
7697
|
{
|
|
7619
7698
|
className: "flex-1 h-0.5 mx-3",
|
|
@@ -7660,7 +7739,7 @@ const Wn = ({
|
|
|
7660
7739
|
}
|
|
7661
7740
|
);
|
|
7662
7741
|
default:
|
|
7663
|
-
return /* @__PURE__ */ r(
|
|
7742
|
+
return /* @__PURE__ */ r(X, { children: /* @__PURE__ */ i(ee, { className: "py-12 text-center", children: [
|
|
7664
7743
|
/* @__PURE__ */ r("div", { className: "mb-4", children: /* @__PURE__ */ r(Pe, {}) }),
|
|
7665
7744
|
/* @__PURE__ */ i("p", { className: "text-gray-600 dark:text-gray-400 mb-2", children: [
|
|
7666
7745
|
"Processing step: ",
|
|
@@ -7674,7 +7753,7 @@ const Wn = ({
|
|
|
7674
7753
|
}
|
|
7675
7754
|
};
|
|
7676
7755
|
return /* @__PURE__ */ i("div", { className: `metakyc-sdk ${s || ""}`, children: [
|
|
7677
|
-
|
|
7756
|
+
W(),
|
|
7678
7757
|
M()
|
|
7679
7758
|
] });
|
|
7680
7759
|
};
|
|
@@ -7705,14 +7784,14 @@ function Nn(e) {
|
|
|
7705
7784
|
}
|
|
7706
7785
|
return t;
|
|
7707
7786
|
}
|
|
7708
|
-
function
|
|
7787
|
+
function Yn(e) {
|
|
7709
7788
|
const t = {};
|
|
7710
7789
|
return e.uploadDocumentFiles.forEach((n) => {
|
|
7711
7790
|
const a = `file_${n.id}`;
|
|
7712
7791
|
t[a] = Nn(n);
|
|
7713
7792
|
}), _e.object(t);
|
|
7714
7793
|
}
|
|
7715
|
-
function
|
|
7794
|
+
function Vn(e) {
|
|
7716
7795
|
return _e.any();
|
|
7717
7796
|
}
|
|
7718
7797
|
function In(e) {
|
|
@@ -7731,17 +7810,17 @@ export {
|
|
|
7731
7810
|
Kt as ApplicantProgressOnHoldReason,
|
|
7732
7811
|
Te as ApplicantProgressStatus,
|
|
7733
7812
|
or as ApplicantService,
|
|
7734
|
-
|
|
7813
|
+
Yt as ApplicantStatus,
|
|
7735
7814
|
Zt as AppropriatenessQuestionType,
|
|
7736
7815
|
dr as AppropriatenessTestService,
|
|
7737
7816
|
vn as AppropriatenessTestStep,
|
|
7738
7817
|
Lt as Badge,
|
|
7739
7818
|
yr as BaseInformationService,
|
|
7740
|
-
|
|
7819
|
+
V as Button,
|
|
7741
7820
|
Xe as COMPANY_FIELD_METADATA,
|
|
7742
|
-
|
|
7743
|
-
|
|
7744
|
-
|
|
7821
|
+
X as Card,
|
|
7822
|
+
ee as CardContent,
|
|
7823
|
+
xe as CardFooter,
|
|
7745
7824
|
be as CardHeader,
|
|
7746
7825
|
Ue as CountriesType,
|
|
7747
7826
|
Un as CreateApplicantForm,
|
|
@@ -7751,11 +7830,11 @@ export {
|
|
|
7751
7830
|
nr as DEFAULT_VISIBLE_FIELDS,
|
|
7752
7831
|
Jt as DocumentReviewStatus,
|
|
7753
7832
|
ir as EndpointBuilder,
|
|
7754
|
-
|
|
7833
|
+
at as ErrorHandler,
|
|
7755
7834
|
Sr as EventEmitter,
|
|
7756
7835
|
Qe as FIELD_METADATA,
|
|
7757
7836
|
Gt as FileType,
|
|
7758
|
-
|
|
7837
|
+
Vr as FileUpload,
|
|
7759
7838
|
pt as GenderType,
|
|
7760
7839
|
ot as Header,
|
|
7761
7840
|
sr as HttpClient,
|
|
@@ -7768,8 +7847,8 @@ export {
|
|
|
7768
7847
|
xn as InvestorCategorizationStep,
|
|
7769
7848
|
Ce as InvestorCategorizationType,
|
|
7770
7849
|
tr as InvestorCategoryType,
|
|
7771
|
-
|
|
7772
|
-
|
|
7850
|
+
Vt as KycProcessStatus,
|
|
7851
|
+
Ye as KycStatus,
|
|
7773
7852
|
It as KycStatusDisplay,
|
|
7774
7853
|
Kn as KycWorkflow,
|
|
7775
7854
|
Cn as Logo,
|
|
@@ -7783,7 +7862,7 @@ export {
|
|
|
7783
7862
|
Qr as PhoneInput,
|
|
7784
7863
|
lr as QuestionnaireService,
|
|
7785
7864
|
sn as QuestionnaireStep,
|
|
7786
|
-
|
|
7865
|
+
Ve as ReviewStatus,
|
|
7787
7866
|
Xt as RiskCriteriaType,
|
|
7788
7867
|
qt as RiskLevel,
|
|
7789
7868
|
pr as RiskScoringService,
|
|
@@ -7818,11 +7897,11 @@ export {
|
|
|
7818
7897
|
mt as formatFileSize,
|
|
7819
7898
|
Qn as generateAppropriatenessSchema,
|
|
7820
7899
|
qn as generateQuestionnaireSchema,
|
|
7821
|
-
|
|
7822
|
-
|
|
7900
|
+
Vn as generateRiskScoringSchema,
|
|
7901
|
+
Yn as generateUploadDocumentSchema,
|
|
7823
7902
|
Bn as getAcceptString,
|
|
7824
7903
|
Dr as getApplicantId,
|
|
7825
|
-
|
|
7904
|
+
it as getThemePreset,
|
|
7826
7905
|
_n as getWorkflowState,
|
|
7827
7906
|
br as healthcareTheme,
|
|
7828
7907
|
Dn as isScriptLoaded,
|