@vpdev2/metakyc-sdk 1.0.74 → 1.0.75
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/components/core/Input.d.ts.map +1 -1
- package/dist/components/core/MultiSelect.d.ts.map +1 -1
- package/dist/components/core/SearchableSelect.d.ts.map +1 -1
- package/dist/components/core/Select.d.ts.map +1 -1
- package/dist/index.cjs +13 -13
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +673 -669
- package/dist/index.js.map +1 -1
- package/dist/styles.css +1 -1
- package/dist/theme/theme-manager.d.ts.map +1 -1
- package/dist/types/theme.d.ts +5 -0
- package/dist/types/theme.d.ts.map +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -3,12 +3,12 @@ var kt = (e, t, n) => t in e ? vt(e, t, { enumerable: !0, configurable: !0, writ
|
|
|
3
3
|
var re = (e, t, n) => kt(e, typeof t != "symbol" ? t + "" : t, n);
|
|
4
4
|
import wt from "axios";
|
|
5
5
|
import * as ot from "react";
|
|
6
|
-
import
|
|
6
|
+
import be, { createContext as Nt, useState as k, useMemo as Ee, useEffect as ne, useContext as St, useRef as ee, useCallback as V, forwardRef as Ge, createElement as nt } from "react";
|
|
7
7
|
import { jsx as r, jsxs as o, Fragment as Qe } from "react/jsx-runtime";
|
|
8
8
|
import Ct, { createPortal as it } from "react-dom";
|
|
9
|
-
import { useForm as At, Controller as
|
|
9
|
+
import { useForm as At, Controller as Te } from "react-hook-form";
|
|
10
10
|
import { z as Ce } from "zod";
|
|
11
|
-
var J = /* @__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))(J || {}), Je = /* @__PURE__ */ ((e) => (e[e.NotStarted = 0] = "NotStarted", e[e.InProgress = 1] = "InProgress", e[e.Success = 2] = "Success", e[e.PartialSuccess = 3] = "PartialSuccess", e[e.Failed = 4] = "Failed", e[e.Skipped = 5] = "Skipped", e[e.AdminReview = 6] = "AdminReview", e[e.SkippedAndAdminReview = 7] = "SkippedAndAdminReview", e))(Je || {}), ke = /* @__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))(ke || {}), It = /* @__PURE__ */ ((e) => (e[e.None = 0] = "None", e[e.RepresentativeKYC = 1] = "RepresentativeKYC", e[e.ManualRiskCriteria = 2] = "ManualRiskCriteria", e[e.UploadDocumentReview = 3] = "UploadDocumentReview", e[e.AdminReview = 4] = "AdminReview", e))(It || {}), Et = /* @__PURE__ */ ((e) => (e[e.LowRisk = 0] = "LowRisk", e[e.MediumRisk = 1] = "MediumRisk", e[e.HighRisk = 2] = "HighRisk", e[e.Alert = 3] = "Alert", e))(Et || {}),
|
|
11
|
+
var J = /* @__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))(J || {}), Je = /* @__PURE__ */ ((e) => (e[e.NotStarted = 0] = "NotStarted", e[e.InProgress = 1] = "InProgress", e[e.Success = 2] = "Success", e[e.PartialSuccess = 3] = "PartialSuccess", e[e.Failed = 4] = "Failed", e[e.Skipped = 5] = "Skipped", e[e.AdminReview = 6] = "AdminReview", e[e.SkippedAndAdminReview = 7] = "SkippedAndAdminReview", e))(Je || {}), ke = /* @__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))(ke || {}), It = /* @__PURE__ */ ((e) => (e[e.None = 0] = "None", e[e.RepresentativeKYC = 1] = "RepresentativeKYC", e[e.ManualRiskCriteria = 2] = "ManualRiskCriteria", e[e.UploadDocumentReview = 3] = "UploadDocumentReview", e[e.AdminReview = 4] = "AdminReview", e))(It || {}), Et = /* @__PURE__ */ ((e) => (e[e.LowRisk = 0] = "LowRisk", e[e.MediumRisk = 1] = "MediumRisk", e[e.HighRisk = 2] = "HighRisk", e[e.Alert = 3] = "Alert", e))(Et || {}), Le = /* @__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))(Le || {}), De = /* @__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))(De || {}), Rt = /* @__PURE__ */ ((e) => (e[e.ProviderResultPending = 0] = "ProviderResultPending", e[e.ProviderResultReceived = 1] = "ProviderResultReceived", e[e.Canceled = 2] = "Canceled", e[e.ExtendedToNewApplicant = 3] = "ExtendedToNewApplicant", e))(Rt || {}), Pt = /* @__PURE__ */ ((e) => (e[e.None = 0] = "None", e[e.ProviderResultPending = 1] = "ProviderResultPending", e[e.ProviderResultReceived = 2] = "ProviderResultReceived", e[e.Canceled = 3] = "Canceled", e))(Pt || {}), ve = /* @__PURE__ */ ((e) => (e[e.Onfido = 0] = "Onfido", e[e.Sumsub = 2] = "Sumsub", e[e.SardinAI = 3] = "SardinAI", e))(ve || {}), Ft = /* @__PURE__ */ ((e) => (e[e.Individual = 0] = "Individual", e[e.Company = 1] = "Company", e))(Ft || {}), Ze = /* @__PURE__ */ ((e) => (e[e.Male = 0] = "Male", e[e.Female = 1] = "Female", e[e.Other = 2] = "Other", e))(Ze || {}), Tt = /* @__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))(Tt || {}), Lt = /* @__PURE__ */ ((e) => (e[e.Pending = 0] = "Pending", e[e.Approved = 1] = "Approved", e[e.Rejected = 2] = "Rejected", e[e.RequiresRevision = 3] = "RequiresRevision", e))(Lt || {}), Dt = /* @__PURE__ */ ((e) => (e[e.SingleChoice = 0] = "SingleChoice", e[e.MultipleChoice = 1] = "MultipleChoice", e[e.Text = 2] = "Text", e))(Dt || {}), Se = /* @__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))(Se || {}), Mt = /* @__PURE__ */ ((e) => (e[e.Text = 0] = "Text", e[e.Radio = 1] = "Radio", e[e.Checkbox = 2] = "Checkbox", e[e.Dropdown = 3] = "Dropdown", e[e.Country = 4] = "Country", e))(Mt || {}), Ot = /* @__PURE__ */ ((e) => (e[e.None = 0] = "None", e[e.Country = 1] = "Country", e))(Ot || {}), fe = /* @__PURE__ */ ((e) => (e[e.Individual = 0] = "Individual", e[e.Sophisticated = 1] = "Sophisticated", e[e.HighNetWorth = 2] = "HighNetWorth", e[e.Business = 3] = "Business", e))(fe || {}), $t = /* @__PURE__ */ ((e) => (e[e.Retail = 0] = "Retail", e[e.Professional = 1] = "Professional", e[e.EligibleCounterparty = 2] = "EligibleCounterparty", e))($t || {});
|
|
12
12
|
const $e = {
|
|
13
13
|
Nationality: 10,
|
|
14
14
|
Address: 20,
|
|
@@ -1696,13 +1696,17 @@ class ur {
|
|
|
1696
1696
|
danger: t.danger,
|
|
1697
1697
|
info: t.info,
|
|
1698
1698
|
background: t.background,
|
|
1699
|
-
// alias used by Input, Select, SearchableSelect, MultiSelect components
|
|
1700
|
-
"input-bg": t.background,
|
|
1701
1699
|
surface: t.surface,
|
|
1702
1700
|
border: t.border,
|
|
1703
1701
|
"text-primary": t.textPrimary,
|
|
1704
1702
|
"text-secondary": t.textSecondary,
|
|
1705
|
-
"text-muted": t.textMuted
|
|
1703
|
+
"text-muted": t.textMuted,
|
|
1704
|
+
// Input-specific — fall back to general colors when not explicitly set
|
|
1705
|
+
"input-bg": t.inputBg ?? t.background,
|
|
1706
|
+
"input-text": t.inputText ?? t.textPrimary,
|
|
1707
|
+
"input-border": t.inputBorder ?? t.border,
|
|
1708
|
+
"input-border-focus": t.inputBorderFocus ?? t.primary,
|
|
1709
|
+
"input-placeholder": t.inputPlaceholder ?? t.textMuted
|
|
1706
1710
|
};
|
|
1707
1711
|
Object.entries(n).forEach(([s, l]) => {
|
|
1708
1712
|
this.container.style.setProperty(`--metakyc-${s}`, l);
|
|
@@ -1797,21 +1801,21 @@ class ur {
|
|
|
1797
1801
|
}
|
|
1798
1802
|
}
|
|
1799
1803
|
const gt = Nt(null), un = ({ config: e, children: t }) => {
|
|
1800
|
-
const [n, a] = k(null), s =
|
|
1801
|
-
const h = new Ht(e), m = new Ut(h), v = new jt(h),
|
|
1804
|
+
const [n, a] = k(null), s = be.useRef(!1), l = be.useRef(!1), c = Ee(() => {
|
|
1805
|
+
const h = new Ht(e), m = new Ut(h), v = new jt(h), C = new Kt(h), f = new Wt(h), S = new Yt(h), b = new qt(h), D = new Qt(h), F = new Gt(h), P = new Vt(h), $ = new nr(h), R = new ur();
|
|
1802
1806
|
return {
|
|
1803
1807
|
httpClient: h,
|
|
1804
1808
|
applicantService: m,
|
|
1805
1809
|
questionnaireService: v,
|
|
1806
|
-
uploadDocumentService:
|
|
1810
|
+
uploadDocumentService: C,
|
|
1807
1811
|
appropriatenessTestService: f,
|
|
1808
|
-
overviewService:
|
|
1809
|
-
riskScoringService:
|
|
1812
|
+
overviewService: S,
|
|
1813
|
+
riskScoringService: b,
|
|
1810
1814
|
identityService: D,
|
|
1811
1815
|
baseInformationService: F,
|
|
1812
|
-
investorCategorizationService:
|
|
1816
|
+
investorCategorizationService: P,
|
|
1813
1817
|
themeService: $,
|
|
1814
|
-
themeManager:
|
|
1818
|
+
themeManager: R
|
|
1815
1819
|
};
|
|
1816
1820
|
}, [e]), u = Ee(() => ({
|
|
1817
1821
|
config: e,
|
|
@@ -1940,22 +1944,22 @@ function fr() {
|
|
|
1940
1944
|
function yn() {
|
|
1941
1945
|
gr(), fr();
|
|
1942
1946
|
}
|
|
1943
|
-
function
|
|
1947
|
+
function br(e) {
|
|
1944
1948
|
const { createOrchestrator: t } = ge(), [n, a] = k(null), [s, l] = k(!1), [c, u] = k(null), h = ee(null), m = e || hr();
|
|
1945
1949
|
ne(() => {
|
|
1946
1950
|
h.current || (h.current = t());
|
|
1947
1951
|
}, [t]), ne(() => {
|
|
1948
|
-
var
|
|
1952
|
+
var R;
|
|
1949
1953
|
n && m && (pr(m), yr({
|
|
1950
1954
|
applicantId: m,
|
|
1951
|
-
currentStepOrder: (
|
|
1955
|
+
currentStepOrder: (R = n.currentStep) == null ? void 0 : R.order,
|
|
1952
1956
|
status: n.status,
|
|
1953
1957
|
lastUpdated: (/* @__PURE__ */ new Date()).toISOString(),
|
|
1954
1958
|
workflowKey: n.workFlowKey,
|
|
1955
1959
|
nextWorkflowKey: n.nextWorkflowKey
|
|
1956
1960
|
}));
|
|
1957
1961
|
}, [n, m]);
|
|
1958
|
-
const v = ee(!1),
|
|
1962
|
+
const v = ee(!1), C = ee(!1), f = V(async () => {
|
|
1959
1963
|
if (!(!m || !h.current)) {
|
|
1960
1964
|
if (v.current) {
|
|
1961
1965
|
console.log("[Workflow] Load already in progress, skipping...");
|
|
@@ -1963,19 +1967,19 @@ function xr(e) {
|
|
|
1963
1967
|
}
|
|
1964
1968
|
v.current = !0, l(!0), u(null);
|
|
1965
1969
|
try {
|
|
1966
|
-
const
|
|
1967
|
-
a(
|
|
1968
|
-
} catch (
|
|
1969
|
-
u(
|
|
1970
|
+
const R = await h.current.initialize(m);
|
|
1971
|
+
a(R), C.current = !0;
|
|
1972
|
+
} catch (R) {
|
|
1973
|
+
u(R);
|
|
1970
1974
|
} finally {
|
|
1971
1975
|
l(!1), v.current = !1;
|
|
1972
1976
|
}
|
|
1973
1977
|
}
|
|
1974
1978
|
}, [m]);
|
|
1975
1979
|
ne(() => {
|
|
1976
|
-
m && !
|
|
1980
|
+
m && !C.current && f();
|
|
1977
1981
|
}, [m, f]);
|
|
1978
|
-
const
|
|
1982
|
+
const S = V(async () => {
|
|
1979
1983
|
if (h.current) {
|
|
1980
1984
|
if (v.current) {
|
|
1981
1985
|
console.log("[Workflow] Refresh already in progress, skipping...");
|
|
@@ -1983,22 +1987,22 @@ function xr(e) {
|
|
|
1983
1987
|
}
|
|
1984
1988
|
v.current = !0, l(!0), u(null);
|
|
1985
1989
|
try {
|
|
1986
|
-
const
|
|
1987
|
-
a(
|
|
1988
|
-
} catch (
|
|
1989
|
-
u(
|
|
1990
|
+
const R = await h.current.refreshProgress();
|
|
1991
|
+
a(R);
|
|
1992
|
+
} catch (R) {
|
|
1993
|
+
u(R);
|
|
1990
1994
|
} finally {
|
|
1991
1995
|
l(!1), v.current = !1;
|
|
1992
1996
|
}
|
|
1993
1997
|
}
|
|
1994
|
-
}, []),
|
|
1998
|
+
}, []), b = V(async () => {
|
|
1995
1999
|
if (h.current) {
|
|
1996
2000
|
l(!0), u(null);
|
|
1997
2001
|
try {
|
|
1998
|
-
const
|
|
1999
|
-
a(
|
|
2000
|
-
} catch (
|
|
2001
|
-
u(
|
|
2002
|
+
const R = await h.current.moveToNextStep();
|
|
2003
|
+
a(R);
|
|
2004
|
+
} catch (R) {
|
|
2005
|
+
u(R);
|
|
2002
2006
|
} finally {
|
|
2003
2007
|
l(!1);
|
|
2004
2008
|
}
|
|
@@ -2007,33 +2011,33 @@ function xr(e) {
|
|
|
2007
2011
|
if (h.current) {
|
|
2008
2012
|
l(!0), u(null);
|
|
2009
2013
|
try {
|
|
2010
|
-
const
|
|
2011
|
-
a(
|
|
2012
|
-
} catch (
|
|
2013
|
-
u(
|
|
2014
|
+
const R = await h.current.moveToPreviousStep();
|
|
2015
|
+
a(R);
|
|
2016
|
+
} catch (R) {
|
|
2017
|
+
u(R);
|
|
2014
2018
|
} finally {
|
|
2015
2019
|
l(!1);
|
|
2016
2020
|
}
|
|
2017
2021
|
}
|
|
2018
|
-
}, []), F = V(async (
|
|
2022
|
+
}, []), F = V(async (R) => {
|
|
2019
2023
|
if (h.current) {
|
|
2020
2024
|
l(!0), u(null);
|
|
2021
2025
|
try {
|
|
2022
|
-
await h.current.submitCurrentStep(
|
|
2023
|
-
const
|
|
2024
|
-
a(
|
|
2025
|
-
} catch (
|
|
2026
|
-
throw u(
|
|
2026
|
+
await h.current.submitCurrentStep(R);
|
|
2027
|
+
const T = await h.current.refreshProgress();
|
|
2028
|
+
a(T);
|
|
2029
|
+
} catch (T) {
|
|
2030
|
+
throw u(T), T;
|
|
2027
2031
|
} finally {
|
|
2028
2032
|
l(!1);
|
|
2029
2033
|
}
|
|
2030
2034
|
}
|
|
2031
|
-
}, []),
|
|
2035
|
+
}, []), P = ot.useMemo(() => n != null && n.stepInfoList ? [...n.stepInfoList].sort((R, T) => R.order - T.order) : [], [n == null ? void 0 : n.stepInfoList]), $ = ot.useMemo(() => n ? n.nextWorkflowKey && n.nextWorkflowKey !== n.workFlowKey : !1, [n]);
|
|
2032
2036
|
return {
|
|
2033
2037
|
progress: n,
|
|
2034
2038
|
applicantId: m,
|
|
2035
2039
|
currentStep: (n == null ? void 0 : n.currentStep) || null,
|
|
2036
|
-
steps:
|
|
2040
|
+
steps: P,
|
|
2037
2041
|
status: (n == null ? void 0 : n.status) || ke.None,
|
|
2038
2042
|
workflowResult: (n == null ? void 0 : n.workflowResult) || null,
|
|
2039
2043
|
workflowKey: n == null ? void 0 : n.workFlowKey,
|
|
@@ -2043,54 +2047,54 @@ function xr(e) {
|
|
|
2043
2047
|
error: c,
|
|
2044
2048
|
isComplete: (n == null ? void 0 : n.status) === ke.Finished,
|
|
2045
2049
|
isOnHold: (n == null ? void 0 : n.status) === ke.OnHold,
|
|
2046
|
-
refreshProgress:
|
|
2047
|
-
moveToNext:
|
|
2050
|
+
refreshProgress: S,
|
|
2051
|
+
moveToNext: b,
|
|
2048
2052
|
moveBack: D,
|
|
2049
2053
|
submitCurrentStep: F,
|
|
2050
2054
|
orchestrator: h.current
|
|
2051
2055
|
};
|
|
2052
2056
|
}
|
|
2053
|
-
function
|
|
2054
|
-
const { questionnaireService: t, applicantService: n } = ge(), [a, s] = k(null), [l, c] = k({}), [u, h] = k(!1), [m, v] = k(!1), [
|
|
2055
|
-
var
|
|
2057
|
+
function xr(e) {
|
|
2058
|
+
const { questionnaireService: t, applicantService: n } = ge(), [a, s] = k(null), [l, c] = k({}), [u, h] = k(!1), [m, v] = k(!1), [C, f] = k(null), S = ee(!1), b = ee(null), D = V(async () => {
|
|
2059
|
+
var P, $;
|
|
2056
2060
|
if (e) {
|
|
2057
|
-
if (
|
|
2061
|
+
if (S.current) {
|
|
2058
2062
|
console.log("[Questionnaire] Load already in progress, skipping...");
|
|
2059
2063
|
return;
|
|
2060
2064
|
}
|
|
2061
|
-
|
|
2065
|
+
S.current = !0, h(!0), f(null);
|
|
2062
2066
|
try {
|
|
2063
|
-
const [
|
|
2067
|
+
const [R, T] = await Promise.all([
|
|
2064
2068
|
t.getQuestionnaire(e),
|
|
2065
2069
|
n.getApplicantData(e).catch(() => null)
|
|
2066
2070
|
]);
|
|
2067
|
-
if (s(
|
|
2071
|
+
if (s(R), (P = T == null ? void 0 : T.questionnaireResults) != null && P.length && R) {
|
|
2068
2072
|
const Y = /* @__PURE__ */ new Map();
|
|
2069
|
-
for (const
|
|
2070
|
-
|
|
2071
|
-
const X = {},
|
|
2072
|
-
for (const
|
|
2073
|
-
const H =
|
|
2074
|
-
Y.has(H) && (X[
|
|
2073
|
+
for (const N of T.questionnaireResults)
|
|
2074
|
+
N.question && (($ = N.answers) != null && $.length) && Y.set(N.question.trim().toLowerCase(), N.answers);
|
|
2075
|
+
const X = {}, E = R.questionGroups.flatMap((N) => N.questions ?? []);
|
|
2076
|
+
for (const N of E) {
|
|
2077
|
+
const H = N.text.trim().toLowerCase();
|
|
2078
|
+
Y.has(H) && (X[N.id] = Y.get(H));
|
|
2075
2079
|
}
|
|
2076
2080
|
c(X);
|
|
2077
2081
|
}
|
|
2078
|
-
|
|
2079
|
-
} catch (
|
|
2080
|
-
f(
|
|
2082
|
+
b.current = e;
|
|
2083
|
+
} catch (R) {
|
|
2084
|
+
f(R);
|
|
2081
2085
|
} finally {
|
|
2082
|
-
h(!1),
|
|
2086
|
+
h(!1), S.current = !1;
|
|
2083
2087
|
}
|
|
2084
2088
|
}
|
|
2085
2089
|
}, [e, t, n]);
|
|
2086
2090
|
ne(() => {
|
|
2087
|
-
e &&
|
|
2091
|
+
e && b.current !== e && D();
|
|
2088
2092
|
}, [e]);
|
|
2089
2093
|
const F = V(
|
|
2090
|
-
async (
|
|
2094
|
+
async (P) => {
|
|
2091
2095
|
v(!0), f(null);
|
|
2092
2096
|
try {
|
|
2093
|
-
return await t.fillQuestionnaire(
|
|
2097
|
+
return await t.fillQuestionnaire(P);
|
|
2094
2098
|
} catch ($) {
|
|
2095
2099
|
throw f($), $;
|
|
2096
2100
|
} finally {
|
|
@@ -2104,39 +2108,39 @@ function br(e) {
|
|
|
2104
2108
|
initialAnswers: l,
|
|
2105
2109
|
isLoading: u,
|
|
2106
2110
|
isSubmitting: m,
|
|
2107
|
-
error:
|
|
2111
|
+
error: C,
|
|
2108
2112
|
load: D,
|
|
2109
2113
|
submit: F
|
|
2110
2114
|
};
|
|
2111
2115
|
}
|
|
2112
2116
|
function vr(e) {
|
|
2113
|
-
const { uploadDocumentService: t } = ge(), [n, a] = k(null), [s, l] = k(!1), [c, u] = k(!1), [h, m] = k(0), [v,
|
|
2117
|
+
const { uploadDocumentService: t } = ge(), [n, a] = k(null), [s, l] = k(!1), [c, u] = k(!1), [h, m] = k(0), [v, C] = k(null), f = ee(!1), S = ee(null), b = V(async () => {
|
|
2114
2118
|
if (e) {
|
|
2115
2119
|
if (f.current) {
|
|
2116
2120
|
console.log("[UploadDocument] Load already in progress, skipping...");
|
|
2117
2121
|
return;
|
|
2118
2122
|
}
|
|
2119
|
-
f.current = !0, l(!0),
|
|
2123
|
+
f.current = !0, l(!0), C(null);
|
|
2120
2124
|
try {
|
|
2121
2125
|
const F = await t.getUploadDocument(e);
|
|
2122
|
-
a(F),
|
|
2126
|
+
a(F), S.current = e;
|
|
2123
2127
|
} catch (F) {
|
|
2124
|
-
|
|
2128
|
+
C(F);
|
|
2125
2129
|
} finally {
|
|
2126
2130
|
l(!1), f.current = !1;
|
|
2127
2131
|
}
|
|
2128
2132
|
}
|
|
2129
2133
|
}, [e, t]);
|
|
2130
2134
|
ne(() => {
|
|
2131
|
-
e &&
|
|
2135
|
+
e && S.current !== e && b();
|
|
2132
2136
|
}, [e]);
|
|
2133
2137
|
const D = V(
|
|
2134
2138
|
async (F) => {
|
|
2135
|
-
u(!0), m(0),
|
|
2139
|
+
u(!0), m(0), C(null);
|
|
2136
2140
|
try {
|
|
2137
2141
|
await t.fillUploadDocument(F), m(100);
|
|
2138
|
-
} catch (
|
|
2139
|
-
throw
|
|
2142
|
+
} catch (P) {
|
|
2143
|
+
throw C(P), P;
|
|
2140
2144
|
} finally {
|
|
2141
2145
|
u(!1);
|
|
2142
2146
|
}
|
|
@@ -2149,12 +2153,12 @@ function vr(e) {
|
|
|
2149
2153
|
isSubmitting: c,
|
|
2150
2154
|
uploadProgress: h,
|
|
2151
2155
|
error: v,
|
|
2152
|
-
load:
|
|
2156
|
+
load: b,
|
|
2153
2157
|
submit: D
|
|
2154
2158
|
};
|
|
2155
2159
|
}
|
|
2156
2160
|
function fn(e) {
|
|
2157
|
-
const { appropriatenessTestService: t } = ge(), [n, a] = k(null), [s, l] = k(!1), [c, u] = k(!1), [h, m] = k(null), [v,
|
|
2161
|
+
const { appropriatenessTestService: t } = ge(), [n, a] = k(null), [s, l] = k(!1), [c, u] = k(!1), [h, m] = k(null), [v, C] = k(null), f = ee(!1), S = ee(null), b = V(async () => {
|
|
2158
2162
|
if (e) {
|
|
2159
2163
|
if (f.current) {
|
|
2160
2164
|
console.log("[AppropriatenessTest] Load already in progress, skipping...");
|
|
@@ -2163,7 +2167,7 @@ function fn(e) {
|
|
|
2163
2167
|
f.current = !0, l(!0), m(null);
|
|
2164
2168
|
try {
|
|
2165
2169
|
const F = await t.getAppropriatenessTest(e);
|
|
2166
|
-
a(F),
|
|
2170
|
+
a(F), S.current = e;
|
|
2167
2171
|
} catch (F) {
|
|
2168
2172
|
m(F);
|
|
2169
2173
|
} finally {
|
|
@@ -2172,16 +2176,16 @@ function fn(e) {
|
|
|
2172
2176
|
}
|
|
2173
2177
|
}, [e, t]);
|
|
2174
2178
|
ne(() => {
|
|
2175
|
-
e &&
|
|
2179
|
+
e && S.current !== e && b();
|
|
2176
2180
|
}, [e]);
|
|
2177
2181
|
const D = V(
|
|
2178
2182
|
async (F) => {
|
|
2179
2183
|
u(!0), m(null);
|
|
2180
2184
|
try {
|
|
2181
|
-
const
|
|
2182
|
-
return
|
|
2183
|
-
} catch (
|
|
2184
|
-
throw m(
|
|
2185
|
+
const P = await t.fillAppropriatenessTest(F);
|
|
2186
|
+
return C(P), P;
|
|
2187
|
+
} catch (P) {
|
|
2188
|
+
throw m(P), P;
|
|
2185
2189
|
} finally {
|
|
2186
2190
|
u(!1);
|
|
2187
2191
|
}
|
|
@@ -2194,12 +2198,12 @@ function fn(e) {
|
|
|
2194
2198
|
isLoading: s,
|
|
2195
2199
|
isSubmitting: c,
|
|
2196
2200
|
error: h,
|
|
2197
|
-
load:
|
|
2201
|
+
load: b,
|
|
2198
2202
|
submit: D
|
|
2199
2203
|
};
|
|
2200
2204
|
}
|
|
2201
2205
|
function kr(e) {
|
|
2202
|
-
const { overviewService: t } = ge(), [n, a] = k(null), [s, l] = k(!1), [c, u] = k(!1), [h, m] = k(null), v = ee(!1),
|
|
2206
|
+
const { overviewService: t } = ge(), [n, a] = k(null), [s, l] = k(!1), [c, u] = k(!1), [h, m] = k(null), v = ee(!1), C = ee(null), f = V(async () => {
|
|
2203
2207
|
if (e) {
|
|
2204
2208
|
if (v.current) {
|
|
2205
2209
|
console.log("[Overview] Load already in progress, skipping...");
|
|
@@ -2207,25 +2211,25 @@ function kr(e) {
|
|
|
2207
2211
|
}
|
|
2208
2212
|
v.current = !0, l(!0), m(null);
|
|
2209
2213
|
try {
|
|
2210
|
-
const
|
|
2211
|
-
a(
|
|
2212
|
-
} catch (
|
|
2213
|
-
m(
|
|
2214
|
+
const b = await t.getOverviewData(e);
|
|
2215
|
+
a(b), C.current = e;
|
|
2216
|
+
} catch (b) {
|
|
2217
|
+
m(b);
|
|
2214
2218
|
} finally {
|
|
2215
2219
|
l(!1), v.current = !1;
|
|
2216
2220
|
}
|
|
2217
2221
|
}
|
|
2218
2222
|
}, [e, t]);
|
|
2219
2223
|
ne(() => {
|
|
2220
|
-
e &&
|
|
2224
|
+
e && C.current !== e && f();
|
|
2221
2225
|
}, [e]);
|
|
2222
|
-
const
|
|
2226
|
+
const S = V(async () => {
|
|
2223
2227
|
if (e) {
|
|
2224
2228
|
u(!0), m(null);
|
|
2225
2229
|
try {
|
|
2226
2230
|
await t.passOverview(e);
|
|
2227
|
-
} catch (
|
|
2228
|
-
throw m(
|
|
2231
|
+
} catch (b) {
|
|
2232
|
+
throw m(b), b;
|
|
2229
2233
|
} finally {
|
|
2230
2234
|
u(!1);
|
|
2231
2235
|
}
|
|
@@ -2237,14 +2241,14 @@ function kr(e) {
|
|
|
2237
2241
|
isSubmitting: c,
|
|
2238
2242
|
error: h,
|
|
2239
2243
|
load: f,
|
|
2240
|
-
passOverview:
|
|
2244
|
+
passOverview: S
|
|
2241
2245
|
};
|
|
2242
2246
|
}
|
|
2243
2247
|
function wr(e) {
|
|
2244
2248
|
const { identityService: t } = ge(), [n, a] = k(
|
|
2245
2249
|
null
|
|
2246
2250
|
), [s, l] = k(!1), [c, u] = k(null), h = ee(!1), m = V(
|
|
2247
|
-
async (f,
|
|
2251
|
+
async (f, S) => {
|
|
2248
2252
|
if (e) {
|
|
2249
2253
|
if (h.current) {
|
|
2250
2254
|
console.log("[Identity] Request already in progress, skipping...");
|
|
@@ -2252,18 +2256,18 @@ function wr(e) {
|
|
|
2252
2256
|
}
|
|
2253
2257
|
h.current = !0, l(!0), u(null);
|
|
2254
2258
|
try {
|
|
2255
|
-
const
|
|
2259
|
+
const b = {
|
|
2256
2260
|
applicantId: e,
|
|
2257
2261
|
restart: !1,
|
|
2258
2262
|
redirectUrl: f || "",
|
|
2259
|
-
ttl:
|
|
2263
|
+
ttl: S || 604800
|
|
2260
2264
|
// Default: 7 days
|
|
2261
2265
|
};
|
|
2262
|
-
console.log("Identity request input:",
|
|
2263
|
-
const D = await t.identityRequest(
|
|
2266
|
+
console.log("Identity request input:", b);
|
|
2267
|
+
const D = await t.identityRequest(b);
|
|
2264
2268
|
return console.log("Identity request result:", D), a(D), D;
|
|
2265
|
-
} catch (
|
|
2266
|
-
throw u(
|
|
2269
|
+
} catch (b) {
|
|
2270
|
+
throw u(b), b;
|
|
2267
2271
|
} finally {
|
|
2268
2272
|
l(!1), h.current = !1;
|
|
2269
2273
|
}
|
|
@@ -2271,26 +2275,26 @@ function wr(e) {
|
|
|
2271
2275
|
},
|
|
2272
2276
|
[e, t]
|
|
2273
2277
|
), v = V(
|
|
2274
|
-
async (f,
|
|
2278
|
+
async (f, S) => {
|
|
2275
2279
|
if (e) {
|
|
2276
2280
|
l(!0), u(null);
|
|
2277
2281
|
try {
|
|
2278
|
-
const
|
|
2282
|
+
const b = {
|
|
2279
2283
|
applicantId: e,
|
|
2280
2284
|
restart: !1,
|
|
2281
2285
|
redirectUrl: f,
|
|
2282
|
-
ttl:
|
|
2283
|
-
}, D = await t.identityCompanyRequest(
|
|
2286
|
+
ttl: S
|
|
2287
|
+
}, D = await t.identityCompanyRequest(b);
|
|
2284
2288
|
return a(D), D;
|
|
2285
|
-
} catch (
|
|
2286
|
-
throw u(
|
|
2289
|
+
} catch (b) {
|
|
2290
|
+
throw u(b), b;
|
|
2287
2291
|
} finally {
|
|
2288
2292
|
l(!1);
|
|
2289
2293
|
}
|
|
2290
2294
|
}
|
|
2291
2295
|
},
|
|
2292
2296
|
[e, t]
|
|
2293
|
-
),
|
|
2297
|
+
), C = V(async () => {
|
|
2294
2298
|
if (e) {
|
|
2295
2299
|
if (h.current) {
|
|
2296
2300
|
console.log("[Identity] Restart already in progress, skipping...");
|
|
@@ -2306,8 +2310,8 @@ function wr(e) {
|
|
|
2306
2310
|
// 7 days
|
|
2307
2311
|
};
|
|
2308
2312
|
console.log("Restarting identity with input:", f);
|
|
2309
|
-
const
|
|
2310
|
-
return console.log("Restart identity result:",
|
|
2313
|
+
const S = await t.identityRequest(f);
|
|
2314
|
+
return console.log("Restart identity result:", S), a(S), S;
|
|
2311
2315
|
} catch (f) {
|
|
2312
2316
|
throw u(f), f;
|
|
2313
2317
|
} finally {
|
|
@@ -2323,12 +2327,12 @@ function wr(e) {
|
|
|
2323
2327
|
error: c,
|
|
2324
2328
|
requestIdentity: m,
|
|
2325
2329
|
requestCompanyIdentity: v,
|
|
2326
|
-
restartIdentity:
|
|
2330
|
+
restartIdentity: C
|
|
2327
2331
|
};
|
|
2328
2332
|
}
|
|
2329
2333
|
function Nr(e) {
|
|
2330
|
-
const { riskScoringService: t, applicantService: n } = ge(), [a, s] = k(null), [l, c] = k({}), [u, h] = k(!1), [m, v] = k(!1), [
|
|
2331
|
-
var
|
|
2334
|
+
const { riskScoringService: t, applicantService: n } = ge(), [a, s] = k(null), [l, c] = k({}), [u, h] = k(!1), [m, v] = k(!1), [C, f] = k(null), [S, b] = k(null), D = ee(!1), F = ee(null), P = V(async () => {
|
|
2335
|
+
var R;
|
|
2332
2336
|
if (e) {
|
|
2333
2337
|
if (D.current) {
|
|
2334
2338
|
console.log("[RiskScoring] Load already in progress, skipping...");
|
|
@@ -2336,40 +2340,40 @@ function Nr(e) {
|
|
|
2336
2340
|
}
|
|
2337
2341
|
D.current = !0, h(!0), f(null);
|
|
2338
2342
|
try {
|
|
2339
|
-
const [
|
|
2343
|
+
const [T, Y] = await Promise.all([
|
|
2340
2344
|
t.getRiskCriterias(e),
|
|
2341
2345
|
n.getApplicantData(e).catch(() => null)
|
|
2342
2346
|
]);
|
|
2343
|
-
if (s(
|
|
2344
|
-
const X = Y.riskScoringResults[0],
|
|
2345
|
-
for (const
|
|
2346
|
-
if (
|
|
2347
|
+
if (s(T), (R = Y == null ? void 0 : Y.riskScoringResults) != null && R.length) {
|
|
2348
|
+
const X = Y.riskScoringResults[0], E = {};
|
|
2349
|
+
for (const N of X.riskCriteriaResults ?? [])
|
|
2350
|
+
if (N.riskCriteriaId != null && N.answer != null && N.answer !== "") {
|
|
2347
2351
|
const H = [...new Set(
|
|
2348
|
-
|
|
2352
|
+
N.answer.split(",").map((W) => W.trim()).filter((W) => W !== "")
|
|
2349
2353
|
)];
|
|
2350
|
-
H.length > 0 && (
|
|
2354
|
+
H.length > 0 && (E[N.riskCriteriaId] = H);
|
|
2351
2355
|
}
|
|
2352
|
-
c(
|
|
2356
|
+
c(E);
|
|
2353
2357
|
}
|
|
2354
2358
|
F.current = e;
|
|
2355
|
-
} catch (
|
|
2356
|
-
f(
|
|
2359
|
+
} catch (T) {
|
|
2360
|
+
f(T);
|
|
2357
2361
|
} finally {
|
|
2358
2362
|
h(!1), D.current = !1;
|
|
2359
2363
|
}
|
|
2360
2364
|
}
|
|
2361
2365
|
}, [e, t, n]);
|
|
2362
2366
|
ne(() => {
|
|
2363
|
-
e && F.current !== e &&
|
|
2367
|
+
e && F.current !== e && P();
|
|
2364
2368
|
}, [e]);
|
|
2365
2369
|
const $ = V(
|
|
2366
|
-
async (
|
|
2370
|
+
async (R) => {
|
|
2367
2371
|
v(!0), f(null);
|
|
2368
2372
|
try {
|
|
2369
|
-
const
|
|
2370
|
-
return
|
|
2371
|
-
} catch (
|
|
2372
|
-
throw f(
|
|
2373
|
+
const T = await t.submitRiskScoring(R);
|
|
2374
|
+
return b(T), T;
|
|
2375
|
+
} catch (T) {
|
|
2376
|
+
throw f(T), T;
|
|
2373
2377
|
} finally {
|
|
2374
2378
|
v(!1);
|
|
2375
2379
|
}
|
|
@@ -2379,33 +2383,33 @@ function Nr(e) {
|
|
|
2379
2383
|
return {
|
|
2380
2384
|
criteria: a,
|
|
2381
2385
|
initialAnswers: l,
|
|
2382
|
-
result:
|
|
2386
|
+
result: S,
|
|
2383
2387
|
isLoading: u,
|
|
2384
2388
|
isSubmitting: m,
|
|
2385
|
-
error:
|
|
2386
|
-
load:
|
|
2389
|
+
error: C,
|
|
2390
|
+
load: P,
|
|
2387
2391
|
submit: $
|
|
2388
2392
|
};
|
|
2389
2393
|
}
|
|
2390
2394
|
function Sr() {
|
|
2391
|
-
const { applicantService: e, config: t } = ge(), [n, a] = k(!1), [s, l] = k(null), c = ee(!1), u = ee(!1), h = () => "xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g, function(
|
|
2392
|
-
const
|
|
2393
|
-
return (
|
|
2395
|
+
const { applicantService: e, config: t } = ge(), [n, a] = k(!1), [s, l] = k(null), c = ee(!1), u = ee(!1), h = () => "xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g, function(S) {
|
|
2396
|
+
const b = Math.random() * 16 | 0;
|
|
2397
|
+
return (S === "x" ? b : b & 3 | 8).toString(16);
|
|
2394
2398
|
}), m = V(
|
|
2395
|
-
async (
|
|
2396
|
-
var
|
|
2399
|
+
async (S) => {
|
|
2400
|
+
var b;
|
|
2397
2401
|
if (c.current)
|
|
2398
2402
|
throw console.log("[Applicant] Create already in progress, skipping..."), new Error("Creation already in progress");
|
|
2399
2403
|
c.current = !0, a(!0), l(null);
|
|
2400
2404
|
try {
|
|
2401
|
-
if (
|
|
2405
|
+
if (S.applicantAdditionalDatas || (S.applicantAdditionalDatas = []), (b = t.identityProviders) != null && b.sardinai) {
|
|
2402
2406
|
const F = h();
|
|
2403
|
-
console.log("[SardinAI] Generated session key:", F),
|
|
2407
|
+
console.log("[SardinAI] Generated session key:", F), S.applicantAdditionalDatas.push({
|
|
2404
2408
|
paramName: "sessionKey",
|
|
2405
2409
|
value: F
|
|
2406
2410
|
});
|
|
2407
2411
|
}
|
|
2408
|
-
return await e.createApplicant(
|
|
2412
|
+
return await e.createApplicant(S);
|
|
2409
2413
|
} catch (D) {
|
|
2410
2414
|
throw l(D), D;
|
|
2411
2415
|
} finally {
|
|
@@ -2414,38 +2418,38 @@ function Sr() {
|
|
|
2414
2418
|
},
|
|
2415
2419
|
[e, t]
|
|
2416
2420
|
), v = V(
|
|
2417
|
-
async (
|
|
2421
|
+
async (S) => {
|
|
2418
2422
|
a(!0), l(null);
|
|
2419
2423
|
try {
|
|
2420
|
-
return await e.createCompanyApplicant(
|
|
2421
|
-
} catch (
|
|
2422
|
-
throw l(
|
|
2424
|
+
return await e.createCompanyApplicant(S);
|
|
2425
|
+
} catch (b) {
|
|
2426
|
+
throw l(b), b;
|
|
2423
2427
|
} finally {
|
|
2424
2428
|
a(!1);
|
|
2425
2429
|
}
|
|
2426
2430
|
},
|
|
2427
2431
|
[e]
|
|
2428
|
-
),
|
|
2429
|
-
async (
|
|
2432
|
+
), C = V(
|
|
2433
|
+
async (S) => {
|
|
2430
2434
|
if (u.current)
|
|
2431
2435
|
throw console.log("[Applicant] Data load already in progress, skipping..."), new Error("Data load already in progress");
|
|
2432
2436
|
u.current = !0, a(!0), l(null);
|
|
2433
2437
|
try {
|
|
2434
|
-
return await e.getApplicantData(
|
|
2435
|
-
} catch (
|
|
2436
|
-
throw l(
|
|
2438
|
+
return await e.getApplicantData(S);
|
|
2439
|
+
} catch (b) {
|
|
2440
|
+
throw l(b), b;
|
|
2437
2441
|
} finally {
|
|
2438
2442
|
a(!1), u.current = !1;
|
|
2439
2443
|
}
|
|
2440
2444
|
},
|
|
2441
2445
|
[e]
|
|
2442
2446
|
), f = V(
|
|
2443
|
-
async (
|
|
2447
|
+
async (S) => {
|
|
2444
2448
|
a(!0), l(null);
|
|
2445
2449
|
try {
|
|
2446
|
-
await e.stopProgress(
|
|
2447
|
-
} catch (
|
|
2448
|
-
throw l(
|
|
2450
|
+
await e.stopProgress(S);
|
|
2451
|
+
} catch (b) {
|
|
2452
|
+
throw l(b), b;
|
|
2449
2453
|
} finally {
|
|
2450
2454
|
a(!1);
|
|
2451
2455
|
}
|
|
@@ -2457,7 +2461,7 @@ function Sr() {
|
|
|
2457
2461
|
error: s,
|
|
2458
2462
|
createApplicant: m,
|
|
2459
2463
|
createCompanyApplicant: v,
|
|
2460
|
-
getApplicantData:
|
|
2464
|
+
getApplicantData: C,
|
|
2461
2465
|
stopProgress: f
|
|
2462
2466
|
};
|
|
2463
2467
|
}
|
|
@@ -2551,8 +2555,9 @@ const Q = ({
|
|
|
2551
2555
|
),
|
|
2552
2556
|
style: {
|
|
2553
2557
|
backgroundColor: "var(--metakyc-input-bg, #ffffff)",
|
|
2554
|
-
color: "var(--metakyc-text-primary, #111827)",
|
|
2555
|
-
borderColor: t ? "var(--metakyc-danger, #ef4444)" : "var(--metakyc-border, #d1d5db)",
|
|
2558
|
+
color: "var(--metakyc-input-text, var(--metakyc-text-primary, #111827))",
|
|
2559
|
+
borderColor: t ? "var(--metakyc-danger, #ef4444)" : "var(--metakyc-input-border, var(--metakyc-border, #d1d5db))",
|
|
2560
|
+
// placeholder and focus-ring are handled via global CSS in styles.css
|
|
2556
2561
|
...c
|
|
2557
2562
|
},
|
|
2558
2563
|
...u
|
|
@@ -2678,9 +2683,8 @@ const j = ({ children: e, className: t, ...n }) => /* @__PURE__ */ r(
|
|
|
2678
2683
|
),
|
|
2679
2684
|
style: {
|
|
2680
2685
|
backgroundColor: "var(--metakyc-input-bg, #ffffff)",
|
|
2681
|
-
color: "var(--metakyc-text-primary, #111827)",
|
|
2682
|
-
borderColor: t ? "var(--metakyc-
|
|
2683
|
-
// ring color via outline on focus
|
|
2686
|
+
color: "var(--metakyc-input-text, var(--metakyc-text-primary, #111827))",
|
|
2687
|
+
borderColor: t ? "var(--metakyc-danger, #ef4444)" : "var(--metakyc-input-border, var(--metakyc-border, #d1d5db))",
|
|
2684
2688
|
...c
|
|
2685
2689
|
},
|
|
2686
2690
|
...u,
|
|
@@ -2705,7 +2709,7 @@ const j = ({ children: e, className: t, ...n }) => /* @__PURE__ */ r(
|
|
|
2705
2709
|
disabled: m.disabled,
|
|
2706
2710
|
style: {
|
|
2707
2711
|
backgroundColor: "var(--metakyc-input-bg, #ffffff)",
|
|
2708
|
-
color: m.disabled ? "var(--metakyc-text-
|
|
2712
|
+
color: m.disabled ? "var(--metakyc-text-muted, #9ca3af)" : "var(--metakyc-input-text, var(--metakyc-text-primary, #111827))"
|
|
2709
2713
|
},
|
|
2710
2714
|
children: m.label
|
|
2711
2715
|
},
|
|
@@ -2728,60 +2732,60 @@ const ct = 280, Cr = ({
|
|
|
2728
2732
|
disabled: l = !1,
|
|
2729
2733
|
required: c = !1
|
|
2730
2734
|
}) => {
|
|
2731
|
-
const [u, h] = k(!1), [m, v] = k(""), [
|
|
2732
|
-
if (!
|
|
2733
|
-
const
|
|
2734
|
-
return { top: te ?
|
|
2735
|
-
}, []),
|
|
2735
|
+
const [u, h] = k(!1), [m, v] = k(""), [C, f] = k(null), S = ee(null), b = ee(null), D = ee(null), F = V(() => {
|
|
2736
|
+
if (!b.current) return null;
|
|
2737
|
+
const A = b.current.getBoundingClientRect(), te = window.innerHeight - A.bottom < ct && A.top > ct;
|
|
2738
|
+
return { top: te ? A.top : A.bottom + 4, left: A.left, width: A.width, openUp: te };
|
|
2739
|
+
}, []), P = V(() => {
|
|
2736
2740
|
if (l) return;
|
|
2737
|
-
const
|
|
2738
|
-
|
|
2741
|
+
const A = F();
|
|
2742
|
+
A && f(A), h(!0);
|
|
2739
2743
|
}, [l, F]), $ = V(() => {
|
|
2740
2744
|
h(!1), v("");
|
|
2741
2745
|
}, []);
|
|
2742
2746
|
ne(() => {
|
|
2743
2747
|
if (!u) return;
|
|
2744
|
-
const
|
|
2748
|
+
const A = (U) => {
|
|
2745
2749
|
var ye, se;
|
|
2746
2750
|
const te = U.target;
|
|
2747
|
-
!((ye =
|
|
2751
|
+
!((ye = S.current) != null && ye.contains(te)) && !((se = D.current) != null && se.contains(te)) && $();
|
|
2748
2752
|
};
|
|
2749
|
-
return document.addEventListener("mousedown",
|
|
2753
|
+
return document.addEventListener("mousedown", A), () => document.removeEventListener("mousedown", A);
|
|
2750
2754
|
}, [u, $]), ne(() => {
|
|
2751
2755
|
if (!u) return;
|
|
2752
|
-
const
|
|
2756
|
+
const A = () => {
|
|
2753
2757
|
const U = F();
|
|
2754
2758
|
U && f(U);
|
|
2755
2759
|
};
|
|
2756
|
-
return window.addEventListener("scroll",
|
|
2757
|
-
window.removeEventListener("scroll",
|
|
2760
|
+
return window.addEventListener("scroll", A, !0), window.addEventListener("resize", A), () => {
|
|
2761
|
+
window.removeEventListener("scroll", A, !0), window.removeEventListener("resize", A);
|
|
2758
2762
|
};
|
|
2759
2763
|
}, [u, F]);
|
|
2760
|
-
const
|
|
2761
|
-
(
|
|
2762
|
-
),
|
|
2763
|
-
l || n(t.includes(
|
|
2764
|
-
}, Y = (
|
|
2765
|
-
U.stopPropagation(), l || n(t.filter((te) => te !==
|
|
2766
|
-
}, X = (
|
|
2764
|
+
const R = a.filter(
|
|
2765
|
+
(A) => A.label.toLowerCase().includes(m.toLowerCase())
|
|
2766
|
+
), T = (A) => {
|
|
2767
|
+
l || n(t.includes(A) ? t.filter((U) => U !== A) : [...t, A]);
|
|
2768
|
+
}, Y = (A, U) => {
|
|
2769
|
+
U.stopPropagation(), l || n(t.filter((te) => te !== A));
|
|
2770
|
+
}, X = (A) => {
|
|
2767
2771
|
var U;
|
|
2768
|
-
return ((U = a.find((te) => te.value ===
|
|
2769
|
-
},
|
|
2772
|
+
return ((U = a.find((te) => te.value === A)) == null ? void 0 : U.label) || A;
|
|
2773
|
+
}, E = b.current ? getComputedStyle(b.current) : null, N = (E == null ? void 0 : E.getPropertyValue("--metakyc-input-bg").trim()) || "#ffffff", H = (E == null ? void 0 : E.getPropertyValue("--metakyc-input-border").trim()) || (E == null ? void 0 : E.getPropertyValue("--metakyc-border").trim()) || "#d1d5db", W = (E == null ? void 0 : E.getPropertyValue("--metakyc-input-text").trim()) || (E == null ? void 0 : E.getPropertyValue("--metakyc-text-primary").trim()) || "#111827", w = (E == null ? void 0 : E.getPropertyValue("--metakyc-text-secondary").trim()) || "#6b7280", B = (E == null ? void 0 : E.getPropertyValue("--metakyc-primary").trim()) || "#2563eb", L = (E == null ? void 0 : E.getPropertyValue("--metakyc-primary-light").trim()) || "#eff6ff", O = (E == null ? void 0 : E.getPropertyValue("--metakyc-hover-bg").trim()) || "#f9fafb", G = u && C && /* @__PURE__ */ o(
|
|
2770
2774
|
"div",
|
|
2771
2775
|
{
|
|
2772
2776
|
ref: D,
|
|
2773
2777
|
className: "metakyc-multiselect-dropdown",
|
|
2774
2778
|
style: {
|
|
2775
2779
|
position: "fixed",
|
|
2776
|
-
top:
|
|
2777
|
-
bottom:
|
|
2778
|
-
left:
|
|
2779
|
-
width:
|
|
2780
|
+
top: C.openUp ? void 0 : C.top,
|
|
2781
|
+
bottom: C.openUp ? window.innerHeight - C.top + 4 : void 0,
|
|
2782
|
+
left: C.left,
|
|
2783
|
+
width: C.width,
|
|
2780
2784
|
zIndex: 99999,
|
|
2781
2785
|
borderRadius: "8px",
|
|
2782
2786
|
boxShadow: "0 4px 16px rgba(0,0,0,0.18)",
|
|
2783
2787
|
border: `1px solid ${H}`,
|
|
2784
|
-
backgroundColor:
|
|
2788
|
+
backgroundColor: N,
|
|
2785
2789
|
overflow: "hidden"
|
|
2786
2790
|
},
|
|
2787
2791
|
children: [
|
|
@@ -2790,10 +2794,10 @@ const ct = 280, Cr = ({
|
|
|
2790
2794
|
{
|
|
2791
2795
|
type: "text",
|
|
2792
2796
|
value: m,
|
|
2793
|
-
onChange: (
|
|
2797
|
+
onChange: (A) => v(A.target.value),
|
|
2794
2798
|
placeholder: "Search...",
|
|
2795
2799
|
autoFocus: !0,
|
|
2796
|
-
onClick: (
|
|
2800
|
+
onClick: (A) => A.stopPropagation(),
|
|
2797
2801
|
className: "metakyc-multiselect-search w-full",
|
|
2798
2802
|
style: {
|
|
2799
2803
|
display: "block",
|
|
@@ -2802,19 +2806,19 @@ const ct = 280, Cr = ({
|
|
|
2802
2806
|
fontSize: "13px",
|
|
2803
2807
|
borderRadius: "6px",
|
|
2804
2808
|
border: `1px solid ${H}`,
|
|
2805
|
-
backgroundColor:
|
|
2809
|
+
backgroundColor: N,
|
|
2806
2810
|
color: W,
|
|
2807
2811
|
outline: "none",
|
|
2808
2812
|
boxSizing: "border-box"
|
|
2809
2813
|
}
|
|
2810
2814
|
}
|
|
2811
2815
|
) }),
|
|
2812
|
-
/* @__PURE__ */ r("ul", { style: { listStyle: "none", margin: 0, padding: "4px 0", maxHeight: "192px", overflowY: "auto" }, children:
|
|
2813
|
-
const U = t.includes(
|
|
2816
|
+
/* @__PURE__ */ r("ul", { style: { listStyle: "none", margin: 0, padding: "4px 0", maxHeight: "192px", overflowY: "auto" }, children: R.length === 0 ? /* @__PURE__ */ r("li", { style: { padding: "8px 12px", fontSize: "13px", color: w }, children: "No results" }) : R.map((A) => {
|
|
2817
|
+
const U = t.includes(A.value);
|
|
2814
2818
|
return /* @__PURE__ */ o(
|
|
2815
2819
|
"li",
|
|
2816
2820
|
{
|
|
2817
|
-
onClick: () =>
|
|
2821
|
+
onClick: () => T(A.value),
|
|
2818
2822
|
className: "metakyc-multiselect-option",
|
|
2819
2823
|
style: {
|
|
2820
2824
|
display: "flex",
|
|
@@ -2823,7 +2827,7 @@ const ct = 280, Cr = ({
|
|
|
2823
2827
|
padding: "8px 12px",
|
|
2824
2828
|
fontSize: "13px",
|
|
2825
2829
|
cursor: "pointer",
|
|
2826
|
-
backgroundColor: U ?
|
|
2830
|
+
backgroundColor: U ? L : "transparent",
|
|
2827
2831
|
color: U ? B : W,
|
|
2828
2832
|
userSelect: "none"
|
|
2829
2833
|
},
|
|
@@ -2843,10 +2847,10 @@ const ct = 280, Cr = ({
|
|
|
2843
2847
|
style: { accentColor: B, pointerEvents: "none", flexShrink: 0 }
|
|
2844
2848
|
}
|
|
2845
2849
|
),
|
|
2846
|
-
/* @__PURE__ */ r("span", { children:
|
|
2850
|
+
/* @__PURE__ */ r("span", { children: A.label })
|
|
2847
2851
|
]
|
|
2848
2852
|
},
|
|
2849
|
-
|
|
2853
|
+
A.value
|
|
2850
2854
|
);
|
|
2851
2855
|
}) }),
|
|
2852
2856
|
t.length > 0 && /* @__PURE__ */ r("div", { style: { padding: "6px 12px", borderTop: `1px solid ${H}` }, children: /* @__PURE__ */ o(
|
|
@@ -2867,7 +2871,7 @@ const ct = 280, Cr = ({
|
|
|
2867
2871
|
]
|
|
2868
2872
|
}
|
|
2869
2873
|
);
|
|
2870
|
-
return /* @__PURE__ */ o("div", { className: "w-full metakyc-multiselect", ref:
|
|
2874
|
+
return /* @__PURE__ */ o("div", { className: "w-full metakyc-multiselect", ref: S, children: [
|
|
2871
2875
|
e && /* @__PURE__ */ o(
|
|
2872
2876
|
"label",
|
|
2873
2877
|
{
|
|
@@ -2882,8 +2886,8 @@ const ct = 280, Cr = ({
|
|
|
2882
2886
|
/* @__PURE__ */ o(
|
|
2883
2887
|
"div",
|
|
2884
2888
|
{
|
|
2885
|
-
ref:
|
|
2886
|
-
onClick: () => u ? $() :
|
|
2889
|
+
ref: b,
|
|
2890
|
+
onClick: () => u ? $() : P(),
|
|
2887
2891
|
className: oe(
|
|
2888
2892
|
"metakyc-multiselect-trigger",
|
|
2889
2893
|
"min-h-[42px] w-full px-3 py-2 rounded-lg border text-sm transition-colors relative",
|
|
@@ -2891,8 +2895,8 @@ const ct = 280, Cr = ({
|
|
|
2891
2895
|
),
|
|
2892
2896
|
style: {
|
|
2893
2897
|
backgroundColor: "var(--metakyc-input-bg, #ffffff)",
|
|
2894
|
-
borderColor: u ? "var(--metakyc-primary, #2563eb)" : "var(--metakyc-border, #d1d5db)",
|
|
2895
|
-
outline: u ? "2px solid var(--metakyc-primary, #2563eb)" : "none",
|
|
2898
|
+
borderColor: u ? "var(--metakyc-input-border-focus, var(--metakyc-primary, #2563eb))" : "var(--metakyc-input-border, var(--metakyc-border, #d1d5db))",
|
|
2899
|
+
outline: u ? "2px solid var(--metakyc-input-border-focus, var(--metakyc-primary, #2563eb))" : "none",
|
|
2896
2900
|
outlineOffset: "-1px"
|
|
2897
2901
|
},
|
|
2898
2902
|
children: [
|
|
@@ -2903,7 +2907,7 @@ const ct = 280, Cr = ({
|
|
|
2903
2907
|
style: { color: "var(--metakyc-text-secondary, #9ca3af)" },
|
|
2904
2908
|
children: s
|
|
2905
2909
|
}
|
|
2906
|
-
) : /* @__PURE__ */ r("div", { className: "flex flex-wrap gap-1 pr-6", children: t.map((
|
|
2910
|
+
) : /* @__PURE__ */ r("div", { className: "flex flex-wrap gap-1 pr-6", children: t.map((A) => /* @__PURE__ */ o(
|
|
2907
2911
|
"span",
|
|
2908
2912
|
{
|
|
2909
2913
|
className: "metakyc-multiselect-chip inline-flex items-center gap-1 px-2 py-0.5 rounded text-xs font-medium",
|
|
@@ -2912,12 +2916,12 @@ const ct = 280, Cr = ({
|
|
|
2912
2916
|
color: "var(--metakyc-primary, #2563eb)"
|
|
2913
2917
|
},
|
|
2914
2918
|
children: [
|
|
2915
|
-
X(
|
|
2919
|
+
X(A),
|
|
2916
2920
|
!l && /* @__PURE__ */ r(
|
|
2917
2921
|
"button",
|
|
2918
2922
|
{
|
|
2919
2923
|
type: "button",
|
|
2920
|
-
onClick: (U) => Y(
|
|
2924
|
+
onClick: (U) => Y(A, U),
|
|
2921
2925
|
className: "metakyc-multiselect-chip-remove",
|
|
2922
2926
|
style: {
|
|
2923
2927
|
background: "transparent",
|
|
@@ -2943,7 +2947,7 @@ const ct = 280, Cr = ({
|
|
|
2943
2947
|
)
|
|
2944
2948
|
]
|
|
2945
2949
|
},
|
|
2946
|
-
|
|
2950
|
+
A
|
|
2947
2951
|
)) }),
|
|
2948
2952
|
/* @__PURE__ */ r(
|
|
2949
2953
|
"span",
|
|
@@ -2971,9 +2975,9 @@ const ct = 280, Cr = ({
|
|
|
2971
2975
|
className: m
|
|
2972
2976
|
}) => {
|
|
2973
2977
|
var se;
|
|
2974
|
-
const [v,
|
|
2975
|
-
if (!
|
|
2976
|
-
const M =
|
|
2978
|
+
const [v, C] = k(!1), [f, S] = k(""), [b, D] = k(null), F = ee(null), P = ee(null), $ = ee(null), R = ee(null), T = V(() => {
|
|
2979
|
+
if (!P.current) return null;
|
|
2980
|
+
const M = P.current.getBoundingClientRect(), ie = window.innerHeight - M.bottom < dt && M.top > dt;
|
|
2977
2981
|
return {
|
|
2978
2982
|
top: ie ? M.top : M.bottom + 4,
|
|
2979
2983
|
left: M.left,
|
|
@@ -2982,11 +2986,11 @@ const ct = 280, Cr = ({
|
|
|
2982
2986
|
};
|
|
2983
2987
|
}, []), Y = V(() => {
|
|
2984
2988
|
if (u) return;
|
|
2985
|
-
const M =
|
|
2986
|
-
M && D(M),
|
|
2987
|
-
}, [u,
|
|
2988
|
-
|
|
2989
|
-
}, []),
|
|
2989
|
+
const M = T();
|
|
2990
|
+
M && D(M), C(!0);
|
|
2991
|
+
}, [u, T]), X = V(() => {
|
|
2992
|
+
C(!1), S("");
|
|
2993
|
+
}, []), E = () => v ? X() : Y();
|
|
2990
2994
|
ne(() => {
|
|
2991
2995
|
if (!v) return;
|
|
2992
2996
|
const M = (Z) => {
|
|
@@ -2998,48 +3002,48 @@ const ct = 280, Cr = ({
|
|
|
2998
3002
|
}, [v, X]), ne(() => {
|
|
2999
3003
|
if (!v) return;
|
|
3000
3004
|
const M = () => {
|
|
3001
|
-
const Z =
|
|
3005
|
+
const Z = T();
|
|
3002
3006
|
Z && D(Z);
|
|
3003
3007
|
};
|
|
3004
3008
|
return window.addEventListener("scroll", M, !0), window.addEventListener("resize", M), () => {
|
|
3005
3009
|
window.removeEventListener("scroll", M, !0), window.removeEventListener("resize", M);
|
|
3006
3010
|
};
|
|
3007
|
-
}, [v,
|
|
3008
|
-
v &&
|
|
3011
|
+
}, [v, T]), ne(() => {
|
|
3012
|
+
v && R.current && setTimeout(() => {
|
|
3009
3013
|
var M;
|
|
3010
|
-
return (M =
|
|
3014
|
+
return (M = R.current) == null ? void 0 : M.focus();
|
|
3011
3015
|
}, 0);
|
|
3012
3016
|
}, [v]);
|
|
3013
|
-
const
|
|
3017
|
+
const N = a.filter(
|
|
3014
3018
|
(M) => M.label.toLowerCase().includes(f.toLowerCase()) || M.value.toLowerCase().includes(f.toLowerCase())
|
|
3015
3019
|
), H = (se = a.find((M) => M.value === l)) == null ? void 0 : se.label, W = (M, Z) => {
|
|
3016
3020
|
u || Z || (c(M), X());
|
|
3017
|
-
},
|
|
3021
|
+
}, w = P.current ? getComputedStyle(P.current) : null, B = (w == null ? void 0 : w.getPropertyValue("--metakyc-input-bg").trim()) || "#ffffff", L = (w == null ? void 0 : w.getPropertyValue("--metakyc-input-border").trim()) || (w == null ? void 0 : w.getPropertyValue("--metakyc-border").trim()) || "#d1d5db", O = (w == null ? void 0 : w.getPropertyValue("--metakyc-input-text").trim()) || (w == null ? void 0 : w.getPropertyValue("--metakyc-text-primary").trim()) || "#111827", G = (w == null ? void 0 : w.getPropertyValue("--metakyc-text-secondary").trim()) || "#6b7280", A = (w == null ? void 0 : w.getPropertyValue("--metakyc-primary").trim()) || "#2563eb", U = (w == null ? void 0 : w.getPropertyValue("--metakyc-primary-light").trim()) || "#eff6ff", te = (w == null ? void 0 : w.getPropertyValue("--metakyc-hover-bg").trim()) || "#f9fafb", ye = v && b && /* @__PURE__ */ o(
|
|
3018
3022
|
"div",
|
|
3019
3023
|
{
|
|
3020
3024
|
ref: $,
|
|
3021
3025
|
className: "metakyc-searchable-select-dropdown",
|
|
3022
3026
|
style: {
|
|
3023
3027
|
position: "fixed",
|
|
3024
|
-
top:
|
|
3025
|
-
bottom:
|
|
3026
|
-
left:
|
|
3027
|
-
width:
|
|
3028
|
+
top: b.openUp ? void 0 : b.top,
|
|
3029
|
+
bottom: b.openUp ? window.innerHeight - b.top + 4 : void 0,
|
|
3030
|
+
left: b.left,
|
|
3031
|
+
width: b.width,
|
|
3028
3032
|
zIndex: 99999,
|
|
3029
3033
|
borderRadius: "8px",
|
|
3030
3034
|
boxShadow: "0 4px 16px rgba(0,0,0,0.18)",
|
|
3031
|
-
border: `1px solid ${
|
|
3035
|
+
border: `1px solid ${L}`,
|
|
3032
3036
|
backgroundColor: B,
|
|
3033
3037
|
overflow: "hidden"
|
|
3034
3038
|
},
|
|
3035
3039
|
children: [
|
|
3036
|
-
/* @__PURE__ */ r("div", { style: { padding: "8px", borderBottom: `1px solid ${
|
|
3040
|
+
/* @__PURE__ */ r("div", { style: { padding: "8px", borderBottom: `1px solid ${L}` }, children: /* @__PURE__ */ r(
|
|
3037
3041
|
"input",
|
|
3038
3042
|
{
|
|
3039
|
-
ref:
|
|
3043
|
+
ref: R,
|
|
3040
3044
|
type: "text",
|
|
3041
3045
|
value: f,
|
|
3042
|
-
onChange: (M) =>
|
|
3046
|
+
onChange: (M) => S(M.target.value),
|
|
3043
3047
|
placeholder: "Search...",
|
|
3044
3048
|
onClick: (M) => M.stopPropagation(),
|
|
3045
3049
|
className: "metakyc-searchable-select-search w-full",
|
|
@@ -3049,7 +3053,7 @@ const ct = 280, Cr = ({
|
|
|
3049
3053
|
padding: "6px 8px",
|
|
3050
3054
|
fontSize: "13px",
|
|
3051
3055
|
borderRadius: "6px",
|
|
3052
|
-
border: `1px solid ${
|
|
3056
|
+
border: `1px solid ${L}`,
|
|
3053
3057
|
backgroundColor: B,
|
|
3054
3058
|
color: O,
|
|
3055
3059
|
outline: "none",
|
|
@@ -3067,7 +3071,7 @@ const ct = 280, Cr = ({
|
|
|
3067
3071
|
maxHeight: "208px",
|
|
3068
3072
|
overflowY: "auto"
|
|
3069
3073
|
},
|
|
3070
|
-
children:
|
|
3074
|
+
children: N.length === 0 ? /* @__PURE__ */ r("li", { style: { padding: "8px 12px", fontSize: "13px", color: G }, children: "No results" }) : N.map((M) => {
|
|
3071
3075
|
const Z = M.value === l;
|
|
3072
3076
|
return /* @__PURE__ */ r(
|
|
3073
3077
|
"li",
|
|
@@ -3080,7 +3084,7 @@ const ct = 280, Cr = ({
|
|
|
3080
3084
|
cursor: M.disabled ? "not-allowed" : "pointer",
|
|
3081
3085
|
opacity: M.disabled ? 0.4 : 1,
|
|
3082
3086
|
backgroundColor: Z ? U : "transparent",
|
|
3083
|
-
color: Z ?
|
|
3087
|
+
color: Z ? A : O,
|
|
3084
3088
|
userSelect: "none"
|
|
3085
3089
|
},
|
|
3086
3090
|
onMouseEnter: (ie) => {
|
|
@@ -3119,12 +3123,12 @@ const ct = 280, Cr = ({
|
|
|
3119
3123
|
/* @__PURE__ */ o(
|
|
3120
3124
|
"div",
|
|
3121
3125
|
{
|
|
3122
|
-
ref:
|
|
3126
|
+
ref: P,
|
|
3123
3127
|
role: "button",
|
|
3124
3128
|
tabIndex: u ? -1 : 0,
|
|
3125
|
-
onClick:
|
|
3129
|
+
onClick: E,
|
|
3126
3130
|
onKeyDown: (M) => {
|
|
3127
|
-
(M.key === "Enter" || M.key === " ") && (M.preventDefault(),
|
|
3131
|
+
(M.key === "Enter" || M.key === " ") && (M.preventDefault(), E()), M.key === "Escape" && X();
|
|
3128
3132
|
},
|
|
3129
3133
|
className: oe(
|
|
3130
3134
|
"metakyc-searchable-select-trigger",
|
|
@@ -3135,10 +3139,10 @@ const ct = 280, Cr = ({
|
|
|
3135
3139
|
),
|
|
3136
3140
|
style: {
|
|
3137
3141
|
backgroundColor: "var(--metakyc-input-bg, #ffffff)",
|
|
3138
|
-
color: H ? "var(--metakyc-text-primary, #111827)" : "var(--metakyc-text-
|
|
3139
|
-
borderColor: t ? "var(--metakyc-
|
|
3142
|
+
color: H ? "var(--metakyc-input-text, var(--metakyc-text-primary, #111827))" : "var(--metakyc-input-placeholder, var(--metakyc-text-muted, #9ca3af))",
|
|
3143
|
+
borderColor: t ? "var(--metakyc-danger, #ef4444)" : v ? "var(--metakyc-input-border-focus, var(--metakyc-primary, #2563eb))" : "var(--metakyc-input-border, var(--metakyc-border, #d1d5db))",
|
|
3140
3144
|
minHeight: "42px",
|
|
3141
|
-
outline: v ? "2px solid var(--metakyc-primary, #2563eb)" : "none",
|
|
3145
|
+
outline: v ? "2px solid var(--metakyc-input-border-focus, var(--metakyc-primary, #2563eb))" : "none",
|
|
3142
3146
|
outlineOffset: "-1px"
|
|
3143
3147
|
},
|
|
3144
3148
|
children: [
|
|
@@ -3172,26 +3176,26 @@ const Ar = ({
|
|
|
3172
3176
|
value: c = [],
|
|
3173
3177
|
className: u
|
|
3174
3178
|
}) => {
|
|
3175
|
-
const [h, m] = k(!1), v = ee(null),
|
|
3176
|
-
if (!
|
|
3177
|
-
const $ = Array.from(
|
|
3178
|
-
if (s && $.filter((
|
|
3179
|
-
const
|
|
3180
|
-
alert(`Some files exceed the maximum size of ${
|
|
3179
|
+
const [h, m] = k(!1), v = ee(null), C = (P) => {
|
|
3180
|
+
if (!P) return;
|
|
3181
|
+
const $ = Array.from(P);
|
|
3182
|
+
if (s && $.filter((T) => T.size > s).length > 0) {
|
|
3183
|
+
const T = rt(s);
|
|
3184
|
+
alert(`Some files exceed the maximum size of ${T}`);
|
|
3181
3185
|
return;
|
|
3182
3186
|
}
|
|
3183
3187
|
l == null || l(a ? [...c, ...$] : [$[0]]);
|
|
3184
|
-
}, f = (
|
|
3185
|
-
|
|
3186
|
-
},
|
|
3188
|
+
}, f = (P) => {
|
|
3189
|
+
P.preventDefault(), m(!0);
|
|
3190
|
+
}, S = () => {
|
|
3187
3191
|
m(!1);
|
|
3188
|
-
},
|
|
3189
|
-
|
|
3192
|
+
}, b = (P) => {
|
|
3193
|
+
P.preventDefault(), m(!1), C(P.dataTransfer.files);
|
|
3190
3194
|
}, D = () => {
|
|
3191
|
-
var
|
|
3192
|
-
(
|
|
3193
|
-
}, F = (
|
|
3194
|
-
const $ = c.filter((
|
|
3195
|
+
var P;
|
|
3196
|
+
(P = v.current) == null || P.click();
|
|
3197
|
+
}, F = (P) => {
|
|
3198
|
+
const $ = c.filter((R, T) => T !== P);
|
|
3195
3199
|
l == null || l($);
|
|
3196
3200
|
};
|
|
3197
3201
|
return /* @__PURE__ */ o("div", { className: oe("w-full", u), children: [
|
|
@@ -3205,8 +3209,8 @@ const Ar = ({
|
|
|
3205
3209
|
t && "border-danger-500"
|
|
3206
3210
|
),
|
|
3207
3211
|
onDragOver: f,
|
|
3208
|
-
onDragLeave:
|
|
3209
|
-
onDrop:
|
|
3212
|
+
onDragLeave: S,
|
|
3213
|
+
onDrop: b,
|
|
3210
3214
|
onClick: D,
|
|
3211
3215
|
children: [
|
|
3212
3216
|
/* @__PURE__ */ r(
|
|
@@ -3217,7 +3221,7 @@ const Ar = ({
|
|
|
3217
3221
|
className: "hidden",
|
|
3218
3222
|
accept: n,
|
|
3219
3223
|
multiple: a,
|
|
3220
|
-
onChange: (
|
|
3224
|
+
onChange: (P) => C(P.target.files)
|
|
3221
3225
|
}
|
|
3222
3226
|
),
|
|
3223
3227
|
/* @__PURE__ */ o("div", { className: "space-y-2", children: [
|
|
@@ -3251,7 +3255,7 @@ const Ar = ({
|
|
|
3251
3255
|
]
|
|
3252
3256
|
}
|
|
3253
3257
|
),
|
|
3254
|
-
c.length > 0 && /* @__PURE__ */ r("div", { className: "mt-3 space-y-2", children: c.map((
|
|
3258
|
+
c.length > 0 && /* @__PURE__ */ r("div", { className: "mt-3 space-y-2", children: c.map((P, $) => /* @__PURE__ */ o(
|
|
3255
3259
|
"div",
|
|
3256
3260
|
{
|
|
3257
3261
|
className: "flex items-center justify-between px-3 py-2 bg-gray-50 dark:bg-gray-700 rounded-lg",
|
|
@@ -3273,10 +3277,10 @@ const Ar = ({
|
|
|
3273
3277
|
)
|
|
3274
3278
|
}
|
|
3275
3279
|
),
|
|
3276
|
-
/* @__PURE__ */ r("span", { className: "text-sm text-gray-700 dark:text-gray-300 truncate", children:
|
|
3280
|
+
/* @__PURE__ */ r("span", { className: "text-sm text-gray-700 dark:text-gray-300 truncate", children: P.name }),
|
|
3277
3281
|
/* @__PURE__ */ o("span", { className: "text-xs text-gray-500", children: [
|
|
3278
3282
|
"(",
|
|
3279
|
-
rt(
|
|
3283
|
+
rt(P.size),
|
|
3280
3284
|
")"
|
|
3281
3285
|
] })
|
|
3282
3286
|
] }),
|
|
@@ -3284,8 +3288,8 @@ const Ar = ({
|
|
|
3284
3288
|
"button",
|
|
3285
3289
|
{
|
|
3286
3290
|
type: "button",
|
|
3287
|
-
onClick: (
|
|
3288
|
-
|
|
3291
|
+
onClick: (R) => {
|
|
3292
|
+
R.stopPropagation(), F($);
|
|
3289
3293
|
},
|
|
3290
3294
|
className: "ml-2 text-danger-500 hover:text-danger-700 focus:outline-none",
|
|
3291
3295
|
children: /* @__PURE__ */ r("svg", { className: "h-5 w-5", fill: "currentColor", viewBox: "0 0 20 20", children: /* @__PURE__ */ r(
|
|
@@ -3420,7 +3424,7 @@ const Fr = (e) => {
|
|
|
3420
3424
|
* This source code is licensed under the ISC license.
|
|
3421
3425
|
* See the LICENSE file in the root directory of this source tree.
|
|
3422
3426
|
*/
|
|
3423
|
-
const
|
|
3427
|
+
const Tr = Ge(
|
|
3424
3428
|
({
|
|
3425
3429
|
color: e = "currentColor",
|
|
3426
3430
|
size: t = 24,
|
|
@@ -3457,7 +3461,7 @@ const Lr = Ge(
|
|
|
3457
3461
|
*/
|
|
3458
3462
|
const ft = (e, t) => {
|
|
3459
3463
|
const n = Ge(
|
|
3460
|
-
({ className: a, ...s }, l) => nt(
|
|
3464
|
+
({ className: a, ...s }, l) => nt(Tr, {
|
|
3461
3465
|
ref: l,
|
|
3462
3466
|
iconNode: t,
|
|
3463
3467
|
className: yt(
|
|
@@ -3476,14 +3480,14 @@ const ft = (e, t) => {
|
|
|
3476
3480
|
* This source code is licensed under the ISC license.
|
|
3477
3481
|
* See the LICENSE file in the root directory of this source tree.
|
|
3478
3482
|
*/
|
|
3479
|
-
const
|
|
3483
|
+
const Lr = [["path", { d: "m15 18-6-6 6-6", key: "1wnfg3" }]], bt = ft("chevron-left", Lr);
|
|
3480
3484
|
/**
|
|
3481
3485
|
* @license lucide-react v0.574.0 - ISC
|
|
3482
3486
|
*
|
|
3483
3487
|
* This source code is licensed under the ISC license.
|
|
3484
3488
|
* See the LICENSE file in the root directory of this source tree.
|
|
3485
3489
|
*/
|
|
3486
|
-
const Dr = [["path", { d: "m9 18 6-6-6-6", key: "mthhwq" }]],
|
|
3490
|
+
const Dr = [["path", { d: "m9 18 6-6-6-6", key: "mthhwq" }]], xt = ft("chevron-right", Dr);
|
|
3487
3491
|
function Mr(e, t) {
|
|
3488
3492
|
const n = !t || t.length === 0 || t.every((a) => !a || !a.trim());
|
|
3489
3493
|
if (e.isRequired && n)
|
|
@@ -3528,45 +3532,45 @@ const $r = ({
|
|
|
3528
3532
|
onComplete: t,
|
|
3529
3533
|
onBack: n
|
|
3530
3534
|
}) => {
|
|
3531
|
-
const { questionnaire: a, initialAnswers: s, isLoading: l, isSubmitting: c, error: u, submit: h } =
|
|
3532
|
-
|
|
3535
|
+
const { questionnaire: a, initialAnswers: s, isLoading: l, isSubmitting: c, error: u, submit: h } = xr(e), [m, v] = k({}), [C, f] = k({}), [S, b] = k(0);
|
|
3536
|
+
be.useEffect(() => {
|
|
3533
3537
|
s && Object.keys(s).length > 0 && Object.keys(m).length === 0 && v(s);
|
|
3534
3538
|
}, [s]);
|
|
3535
3539
|
const D = Ee(
|
|
3536
3540
|
() => a ? Or(a.questionGroups) : [],
|
|
3537
3541
|
[a]
|
|
3538
|
-
), F =
|
|
3539
|
-
v((H) => ({ ...H, [
|
|
3542
|
+
), F = S === D.length - 1, P = D[S] ?? [], $ = V((E, N) => {
|
|
3543
|
+
v((H) => ({ ...H, [E]: N })), f((H) => {
|
|
3540
3544
|
const W = { ...H };
|
|
3541
|
-
return delete W[
|
|
3545
|
+
return delete W[E], W;
|
|
3542
3546
|
});
|
|
3543
|
-
}, []),
|
|
3544
|
-
const
|
|
3545
|
-
for (const { question:
|
|
3546
|
-
const H = Mr(
|
|
3547
|
-
H && (
|
|
3547
|
+
}, []), R = V(() => {
|
|
3548
|
+
const E = {};
|
|
3549
|
+
for (const { question: N } of P) {
|
|
3550
|
+
const H = Mr(N, m[N.id] ?? []);
|
|
3551
|
+
H && (E[N.id] = H);
|
|
3548
3552
|
}
|
|
3549
|
-
return f((
|
|
3550
|
-
}, [
|
|
3551
|
-
|
|
3553
|
+
return f((N) => ({ ...N, ...E })), Object.keys(E).length === 0;
|
|
3554
|
+
}, [P, m]), T = () => {
|
|
3555
|
+
R() && b((E) => E + 1);
|
|
3552
3556
|
}, Y = () => {
|
|
3553
|
-
|
|
3557
|
+
S > 0 ? b((E) => E - 1) : n == null || n();
|
|
3554
3558
|
}, X = async () => {
|
|
3555
|
-
if (!(!
|
|
3559
|
+
if (!(!R() || !a))
|
|
3556
3560
|
try {
|
|
3557
|
-
const
|
|
3561
|
+
const E = a.questionGroups.flatMap(
|
|
3558
3562
|
(H) => (H.questions ?? []).map((W) => ({
|
|
3559
3563
|
questionId: W.id,
|
|
3560
3564
|
values: m[W.id] ?? []
|
|
3561
3565
|
}))
|
|
3562
|
-
),
|
|
3566
|
+
), N = {
|
|
3563
3567
|
applicantId: e,
|
|
3564
3568
|
questionnarieId: a.id,
|
|
3565
|
-
questionResults:
|
|
3569
|
+
questionResults: E
|
|
3566
3570
|
};
|
|
3567
|
-
await h(
|
|
3568
|
-
} catch (
|
|
3569
|
-
console.error("Questionnaire submit error:",
|
|
3571
|
+
await h(N), t == null || t();
|
|
3572
|
+
} catch (E) {
|
|
3573
|
+
console.error("Questionnaire submit error:", E);
|
|
3570
3574
|
}
|
|
3571
3575
|
};
|
|
3572
3576
|
return l ? /* @__PURE__ */ r(j, { children: /* @__PURE__ */ r(K, { children: /* @__PURE__ */ r(we, { className: "my-8" }) }) }) : u ? /* @__PURE__ */ r(j, { children: /* @__PURE__ */ r(K, { children: /* @__PURE__ */ o("p", { className: "text-danger-500", children: [
|
|
@@ -3579,33 +3583,33 @@ const $r = ({
|
|
|
3579
3583
|
D.length > 1 && /* @__PURE__ */ o("div", { className: "flex items-center justify-between mt-3", children: [
|
|
3580
3584
|
/* @__PURE__ */ o("span", { className: "text-xs", style: { color: "var(--metakyc-text-muted, #9ca3af)" }, children: [
|
|
3581
3585
|
"Page ",
|
|
3582
|
-
|
|
3586
|
+
S + 1,
|
|
3583
3587
|
" of ",
|
|
3584
3588
|
D.length
|
|
3585
3589
|
] }),
|
|
3586
|
-
/* @__PURE__ */ r("div", { className: "flex items-center gap-1.5", children: D.map((
|
|
3590
|
+
/* @__PURE__ */ r("div", { className: "flex items-center gap-1.5", children: D.map((E, N) => /* @__PURE__ */ r(
|
|
3587
3591
|
"div",
|
|
3588
3592
|
{
|
|
3589
3593
|
className: "rounded-full transition-all duration-200",
|
|
3590
3594
|
style: {
|
|
3591
3595
|
height: "6px",
|
|
3592
|
-
width:
|
|
3593
|
-
backgroundColor:
|
|
3596
|
+
width: N === S ? "20px" : "6px",
|
|
3597
|
+
backgroundColor: N <= S ? "var(--metakyc-primary, #2563eb)" : "var(--metakyc-border, #e5e7eb)"
|
|
3594
3598
|
}
|
|
3595
3599
|
},
|
|
3596
|
-
|
|
3600
|
+
N
|
|
3597
3601
|
)) })
|
|
3598
3602
|
] })
|
|
3599
3603
|
] }),
|
|
3600
|
-
/* @__PURE__ */ r(K, { className: "space-y-6", children:
|
|
3604
|
+
/* @__PURE__ */ r(K, { className: "space-y-6", children: P.map(({ question: E }) => /* @__PURE__ */ r(
|
|
3601
3605
|
zr,
|
|
3602
3606
|
{
|
|
3603
|
-
question:
|
|
3604
|
-
value: m[
|
|
3605
|
-
error:
|
|
3606
|
-
onChange: (
|
|
3607
|
+
question: E,
|
|
3608
|
+
value: m[E.id] ?? [],
|
|
3609
|
+
error: C[E.id],
|
|
3610
|
+
onChange: (N) => $(E.id, N)
|
|
3607
3611
|
},
|
|
3608
|
-
|
|
3612
|
+
E.id
|
|
3609
3613
|
)) }),
|
|
3610
3614
|
/* @__PURE__ */ o(me, { className: "flex items-center justify-between", children: [
|
|
3611
3615
|
/* @__PURE__ */ o(
|
|
@@ -3616,8 +3620,8 @@ const $r = ({
|
|
|
3616
3620
|
onClick: Y,
|
|
3617
3621
|
style: { display: "flex", alignItems: "center", gap: "4px" },
|
|
3618
3622
|
children: [
|
|
3619
|
-
/* @__PURE__ */ r(
|
|
3620
|
-
|
|
3623
|
+
/* @__PURE__ */ r(bt, { size: 14 }),
|
|
3624
|
+
S > 0 ? "Previous" : "Back"
|
|
3621
3625
|
]
|
|
3622
3626
|
}
|
|
3623
3627
|
),
|
|
@@ -3633,11 +3637,11 @@ const $r = ({
|
|
|
3633
3637
|
Q,
|
|
3634
3638
|
{
|
|
3635
3639
|
type: "button",
|
|
3636
|
-
onClick:
|
|
3640
|
+
onClick: T,
|
|
3637
3641
|
style: { display: "flex", alignItems: "center", gap: "4px" },
|
|
3638
3642
|
children: [
|
|
3639
3643
|
"Next",
|
|
3640
|
-
/* @__PURE__ */ r(
|
|
3644
|
+
/* @__PURE__ */ r(xt, { size: 14 })
|
|
3641
3645
|
]
|
|
3642
3646
|
}
|
|
3643
3647
|
)
|
|
@@ -3756,27 +3760,27 @@ const $r = ({
|
|
|
3756
3760
|
onComplete: t,
|
|
3757
3761
|
onBack: n
|
|
3758
3762
|
}) => {
|
|
3759
|
-
const { uploadDocument: a, isLoading: s, isSubmitting: l, error: c, submit: u } = vr(e), [h, m] = k({}), v = async (
|
|
3760
|
-
if (
|
|
3763
|
+
const { uploadDocument: a, isLoading: s, isSubmitting: l, error: c, submit: u } = vr(e), [h, m] = k({}), v = async (C) => {
|
|
3764
|
+
if (C.preventDefault(), !a) return;
|
|
3761
3765
|
const f = await Promise.all(
|
|
3762
|
-
a.uploadDocumentFiles.map(async (
|
|
3763
|
-
const D = h[
|
|
3764
|
-
D.map(async (
|
|
3765
|
-
fileName:
|
|
3766
|
-
fileData: await mr(
|
|
3766
|
+
a.uploadDocumentFiles.map(async (b) => {
|
|
3767
|
+
const D = h[b.id] || [], F = await Promise.all(
|
|
3768
|
+
D.map(async (P) => ({
|
|
3769
|
+
fileName: P.name,
|
|
3770
|
+
fileData: await mr(P)
|
|
3767
3771
|
}))
|
|
3768
3772
|
);
|
|
3769
3773
|
return {
|
|
3770
|
-
uploadDocumentFileId:
|
|
3774
|
+
uploadDocumentFileId: b.id,
|
|
3771
3775
|
valueList: F
|
|
3772
3776
|
};
|
|
3773
3777
|
})
|
|
3774
|
-
),
|
|
3778
|
+
), S = {
|
|
3775
3779
|
applicantId: e,
|
|
3776
3780
|
uploadDocumentId: a.id,
|
|
3777
3781
|
uploadDocumentResults: f
|
|
3778
3782
|
};
|
|
3779
|
-
await u(
|
|
3783
|
+
await u(S), t == null || t();
|
|
3780
3784
|
};
|
|
3781
3785
|
return s ? /* @__PURE__ */ r(j, { children: /* @__PURE__ */ r(K, { children: /* @__PURE__ */ r(we, { className: "my-8" }) }) }) : c ? /* @__PURE__ */ r(j, { children: /* @__PURE__ */ r(K, { children: /* @__PURE__ */ o("p", { className: "text-danger-500", children: [
|
|
3782
3786
|
"Error loading document requirements: ",
|
|
@@ -3786,19 +3790,19 @@ const $r = ({
|
|
|
3786
3790
|
/* @__PURE__ */ r("h2", { className: "text-lg font-bold", children: a.displayName }),
|
|
3787
3791
|
a.subtitle && /* @__PURE__ */ r("p", { className: "text-gray-600 dark:text-gray-400 mt-1", children: a.subtitle })
|
|
3788
3792
|
] }),
|
|
3789
|
-
/* @__PURE__ */ r(K, { className: "space-y-6", children: a.uploadDocumentFiles.map((
|
|
3793
|
+
/* @__PURE__ */ r(K, { className: "space-y-6", children: a.uploadDocumentFiles.map((C) => /* @__PURE__ */ r(
|
|
3790
3794
|
Ar,
|
|
3791
3795
|
{
|
|
3792
|
-
label:
|
|
3793
|
-
accept:
|
|
3794
|
-
multiple:
|
|
3795
|
-
maxSize:
|
|
3796
|
-
value: h[
|
|
3796
|
+
label: C.displayName,
|
|
3797
|
+
accept: C.allowedTypes,
|
|
3798
|
+
multiple: C.multipleFile,
|
|
3799
|
+
maxSize: C.maxEachFileSizeByte,
|
|
3800
|
+
value: h[C.id] || [],
|
|
3797
3801
|
onChange: (f) => {
|
|
3798
|
-
m((
|
|
3802
|
+
m((S) => ({ ...S, [C.id]: f }));
|
|
3799
3803
|
}
|
|
3800
3804
|
},
|
|
3801
|
-
|
|
3805
|
+
C.id
|
|
3802
3806
|
)) }),
|
|
3803
3807
|
/* @__PURE__ */ o(me, { className: "flex justify-between", children: [
|
|
3804
3808
|
n && /* @__PURE__ */ r(Q, { type: "button", variant: "outline", onClick: n, children: "Back" }),
|
|
@@ -3908,43 +3912,43 @@ const qr = ({
|
|
|
3908
3912
|
onComplete: t,
|
|
3909
3913
|
onBack: n
|
|
3910
3914
|
}) => {
|
|
3911
|
-
const { config: a } = ge(), s = a.locale ?? "en", { criteria: l, initialAnswers: c, isLoading: u, isSubmitting: h, error: m, submit: v } = Nr(e), [
|
|
3912
|
-
|
|
3913
|
-
c && Object.keys(c).length > 0 && Object.keys(
|
|
3915
|
+
const { config: a } = ge(), s = a.locale ?? "en", { criteria: l, initialAnswers: c, isLoading: u, isSubmitting: h, error: m, submit: v } = Nr(e), [C, f] = k({}), [S, b] = k({}), [D, F] = k(0), [P, $] = k(!1);
|
|
3916
|
+
be.useEffect(() => {
|
|
3917
|
+
c && Object.keys(c).length > 0 && Object.keys(C).length === 0 && f(c);
|
|
3914
3918
|
}, [c]);
|
|
3915
|
-
const
|
|
3919
|
+
const R = Ee(
|
|
3916
3920
|
() => l && l.length > 0 ? Wr(l) : [],
|
|
3917
3921
|
[l]
|
|
3918
|
-
),
|
|
3919
|
-
|
|
3920
|
-
!u && l && l.length === 0 && !
|
|
3921
|
-
}, [u, l,
|
|
3922
|
-
const X = V((
|
|
3923
|
-
f((
|
|
3924
|
-
const O = { ...
|
|
3925
|
-
return delete O[
|
|
3922
|
+
), T = D === R.length - 1, Y = R[D] ?? [];
|
|
3923
|
+
be.useEffect(() => {
|
|
3924
|
+
!u && l && l.length === 0 && !P && !h && ($(!0), v({ applicantId: e, criteriaValueInputs: [] }).then(() => t == null ? void 0 : t()).catch(console.error));
|
|
3925
|
+
}, [u, l, P, h, v, e, t]);
|
|
3926
|
+
const X = V((w, B) => {
|
|
3927
|
+
f((L) => ({ ...L, [w]: B })), b((L) => {
|
|
3928
|
+
const O = { ...L };
|
|
3929
|
+
return delete O[w], O;
|
|
3926
3930
|
});
|
|
3927
|
-
}, []),
|
|
3928
|
-
const
|
|
3931
|
+
}, []), E = V(() => {
|
|
3932
|
+
const w = {};
|
|
3929
3933
|
for (const { criterion: B } of Y) {
|
|
3930
|
-
const
|
|
3931
|
-
|
|
3934
|
+
const L = Kr(B, C[B.id] ?? []);
|
|
3935
|
+
L && (w[B.id] = L);
|
|
3932
3936
|
}
|
|
3933
|
-
return
|
|
3934
|
-
}, [Y,
|
|
3935
|
-
|
|
3937
|
+
return b((B) => ({ ...B, ...w })), Object.keys(w).length === 0;
|
|
3938
|
+
}, [Y, C]), N = () => {
|
|
3939
|
+
E() && F((w) => w + 1);
|
|
3936
3940
|
}, H = () => {
|
|
3937
|
-
D > 0 ? F((
|
|
3941
|
+
D > 0 ? F((w) => w - 1) : n == null || n();
|
|
3938
3942
|
}, W = async () => {
|
|
3939
|
-
if (!(!
|
|
3943
|
+
if (!(!E() || !l))
|
|
3940
3944
|
try {
|
|
3941
|
-
const
|
|
3942
|
-
const O = (
|
|
3943
|
-
return O.length > 0 ? { riskCriteriaId:
|
|
3944
|
-
}).filter((
|
|
3945
|
-
await v({ applicantId: e, criteriaValueInputs:
|
|
3946
|
-
} catch (
|
|
3947
|
-
console.error("Risk scoring submit error:",
|
|
3945
|
+
const w = l.map((L) => {
|
|
3946
|
+
const O = (C[L.id] ?? []).filter((G) => G && G.trim());
|
|
3947
|
+
return O.length > 0 ? { riskCriteriaId: L.id, values: O } : null;
|
|
3948
|
+
}).filter((L) => L !== null);
|
|
3949
|
+
await v({ applicantId: e, criteriaValueInputs: w }), t == null || t();
|
|
3950
|
+
} catch (w) {
|
|
3951
|
+
console.error("Risk scoring submit error:", w);
|
|
3948
3952
|
}
|
|
3949
3953
|
};
|
|
3950
3954
|
return u ? /* @__PURE__ */ r(j, { children: /* @__PURE__ */ o(K, { children: [
|
|
@@ -3960,14 +3964,14 @@ const qr = ({
|
|
|
3960
3964
|
/* @__PURE__ */ o(ue, { children: [
|
|
3961
3965
|
/* @__PURE__ */ r("h2", { className: "text-lg font-bold", children: "Risk Assessment" }),
|
|
3962
3966
|
/* @__PURE__ */ r("p", { className: "text-sm", style: { color: "var(--metakyc-text-secondary, #6b7280)" }, children: "Please answer the following questions for risk evaluation" }),
|
|
3963
|
-
|
|
3967
|
+
R.length > 1 && /* @__PURE__ */ o("div", { className: "flex items-center justify-between mt-3", children: [
|
|
3964
3968
|
/* @__PURE__ */ o("span", { className: "text-xs", style: { color: "var(--metakyc-text-muted, #9ca3af)" }, children: [
|
|
3965
3969
|
"Page ",
|
|
3966
3970
|
D + 1,
|
|
3967
3971
|
" of ",
|
|
3968
|
-
|
|
3972
|
+
R.length
|
|
3969
3973
|
] }),
|
|
3970
|
-
/* @__PURE__ */ r("div", { className: "flex items-center gap-1.5", children:
|
|
3974
|
+
/* @__PURE__ */ r("div", { className: "flex items-center gap-1.5", children: R.map((w, B) => /* @__PURE__ */ r(
|
|
3971
3975
|
"div",
|
|
3972
3976
|
{
|
|
3973
3977
|
className: "rounded-full transition-all duration-200",
|
|
@@ -3981,16 +3985,16 @@ const qr = ({
|
|
|
3981
3985
|
)) })
|
|
3982
3986
|
] })
|
|
3983
3987
|
] }),
|
|
3984
|
-
/* @__PURE__ */ r(K, { className: "space-y-6", children: Y.map(({ criterion:
|
|
3988
|
+
/* @__PURE__ */ r(K, { className: "space-y-6", children: Y.map(({ criterion: w }) => /* @__PURE__ */ r(
|
|
3985
3989
|
Qr,
|
|
3986
3990
|
{
|
|
3987
|
-
criterion:
|
|
3988
|
-
value:
|
|
3989
|
-
error:
|
|
3991
|
+
criterion: w,
|
|
3992
|
+
value: C[w.id] ?? [],
|
|
3993
|
+
error: S[w.id],
|
|
3990
3994
|
locale: s,
|
|
3991
|
-
onChange: (B) => X(
|
|
3995
|
+
onChange: (B) => X(w.id, B)
|
|
3992
3996
|
},
|
|
3993
|
-
|
|
3997
|
+
w.id
|
|
3994
3998
|
)) }),
|
|
3995
3999
|
/* @__PURE__ */ o(me, { className: "flex items-center justify-between", children: [
|
|
3996
4000
|
/* @__PURE__ */ o(
|
|
@@ -4001,20 +4005,20 @@ const qr = ({
|
|
|
4001
4005
|
onClick: H,
|
|
4002
4006
|
style: { display: "flex", alignItems: "center", gap: "4px" },
|
|
4003
4007
|
children: [
|
|
4004
|
-
/* @__PURE__ */ r(
|
|
4008
|
+
/* @__PURE__ */ r(bt, { size: 14 }),
|
|
4005
4009
|
D > 0 ? "Previous" : "Back"
|
|
4006
4010
|
]
|
|
4007
4011
|
}
|
|
4008
4012
|
),
|
|
4009
|
-
|
|
4013
|
+
T ? /* @__PURE__ */ r(Q, { type: "button", isLoading: h, onClick: W, children: "Continue" }) : /* @__PURE__ */ o(
|
|
4010
4014
|
Q,
|
|
4011
4015
|
{
|
|
4012
4016
|
type: "button",
|
|
4013
|
-
onClick:
|
|
4017
|
+
onClick: N,
|
|
4014
4018
|
style: { display: "flex", alignItems: "center", gap: "4px" },
|
|
4015
4019
|
children: [
|
|
4016
4020
|
"Next",
|
|
4017
|
-
/* @__PURE__ */ r(
|
|
4021
|
+
/* @__PURE__ */ r(xt, { size: 14 })
|
|
4018
4022
|
]
|
|
4019
4023
|
}
|
|
4020
4024
|
)
|
|
@@ -4095,7 +4099,7 @@ const qr = ({
|
|
|
4095
4099
|
type: "checkbox",
|
|
4096
4100
|
checked: t.includes(m),
|
|
4097
4101
|
onChange: (v) => {
|
|
4098
|
-
v.target.checked ? s([...t, m]) : s(t.filter((
|
|
4102
|
+
v.target.checked ? s([...t, m]) : s(t.filter((C) => C !== m));
|
|
4099
4103
|
},
|
|
4100
4104
|
className: "metakyc-option-input",
|
|
4101
4105
|
style: {
|
|
@@ -4144,8 +4148,8 @@ const qr = ({
|
|
|
4144
4148
|
onBack: n
|
|
4145
4149
|
}) => {
|
|
4146
4150
|
const { investorCategorizationService: a } = ge(), [s, l] = k(null), [c, u] = k(!1), [h, m] = k(null);
|
|
4147
|
-
return /* @__PURE__ */ r("form", { onSubmit: async (
|
|
4148
|
-
if (
|
|
4151
|
+
return /* @__PURE__ */ r("form", { onSubmit: async (C) => {
|
|
4152
|
+
if (C.preventDefault(), s === null) {
|
|
4149
4153
|
m("Please select an investor type");
|
|
4150
4154
|
return;
|
|
4151
4155
|
}
|
|
@@ -4156,8 +4160,8 @@ const qr = ({
|
|
|
4156
4160
|
investorType: s
|
|
4157
4161
|
};
|
|
4158
4162
|
console.log("Submitting investor categorization:", f);
|
|
4159
|
-
const
|
|
4160
|
-
console.log("Investor categorization result:",
|
|
4163
|
+
const S = await a.setInvestorCategorization(f);
|
|
4164
|
+
console.log("Investor categorization result:", S), t == null || t();
|
|
4161
4165
|
} catch (f) {
|
|
4162
4166
|
console.error("Error submitting investor categorization:", f), m(f.message || "Failed to submit investor categorization");
|
|
4163
4167
|
} finally {
|
|
@@ -4281,71 +4285,71 @@ const qr = ({
|
|
|
4281
4285
|
onComplete: t,
|
|
4282
4286
|
onBack: n
|
|
4283
4287
|
}) => {
|
|
4284
|
-
const { appropriatenessTestService: a } = ge(), [s, l] = k(null), [c, u] = k(!0), [h, m] = k(!1), [v,
|
|
4288
|
+
const { appropriatenessTestService: a } = ge(), [s, l] = k(null), [c, u] = k(!0), [h, m] = k(!1), [v, C] = k(null), [f, S] = k({}), [b, D] = k(0), [F, P] = k(!1), [$, R] = k(!1), [T, Y] = k(0);
|
|
4285
4289
|
ne(() => {
|
|
4286
4290
|
(async () => {
|
|
4287
4291
|
try {
|
|
4288
|
-
u(!0),
|
|
4292
|
+
u(!0), C(null), console.log("Loading appropriateness test for applicant:", e);
|
|
4289
4293
|
const O = await a.getAppropriatenessTest(e);
|
|
4290
4294
|
if (console.log("Appropriateness test data:", O), l(O), O.waitTimeSpanForNextTry && O.waitTimeSpanForNextTry !== "00:00:00") {
|
|
4291
4295
|
const G = X(O.waitTimeSpanForNextTry);
|
|
4292
4296
|
G > 0 && Y(G);
|
|
4293
4297
|
}
|
|
4294
4298
|
} catch (O) {
|
|
4295
|
-
console.error("Error loading appropriateness test:", O),
|
|
4299
|
+
console.error("Error loading appropriateness test:", O), C(O.message || "Failed to load appropriateness test");
|
|
4296
4300
|
} finally {
|
|
4297
4301
|
u(!1);
|
|
4298
4302
|
}
|
|
4299
4303
|
})();
|
|
4300
4304
|
}, [e, a]);
|
|
4301
|
-
const X = (
|
|
4302
|
-
const O =
|
|
4305
|
+
const X = (L) => {
|
|
4306
|
+
const O = L.split(":").map(Number);
|
|
4303
4307
|
if (O.length === 3) {
|
|
4304
|
-
const [G,
|
|
4305
|
-
return G * 3600 +
|
|
4308
|
+
const [G, A, U] = O;
|
|
4309
|
+
return G * 3600 + A * 60 + U;
|
|
4306
4310
|
}
|
|
4307
4311
|
return 0;
|
|
4308
|
-
},
|
|
4309
|
-
const O = Math.floor(
|
|
4312
|
+
}, E = (L) => {
|
|
4313
|
+
const O = Math.floor(L / 60), G = L % 60;
|
|
4310
4314
|
return `${O.toString().padStart(2, "0")}:${G.toString().padStart(2, "0")}`;
|
|
4311
4315
|
};
|
|
4312
4316
|
ne(() => {
|
|
4313
|
-
if (!F ||
|
|
4314
|
-
const
|
|
4315
|
-
D((O) => O <= 1 ? (
|
|
4317
|
+
if (!F || b <= 0) return;
|
|
4318
|
+
const L = setInterval(() => {
|
|
4319
|
+
D((O) => O <= 1 ? (R(!0), 0) : O - 1);
|
|
4316
4320
|
}, 1e3);
|
|
4317
|
-
return () => clearInterval(
|
|
4318
|
-
}, [F,
|
|
4319
|
-
if (
|
|
4320
|
-
const
|
|
4321
|
+
return () => clearInterval(L);
|
|
4322
|
+
}, [F, b]), ne(() => {
|
|
4323
|
+
if (T <= 0) return;
|
|
4324
|
+
const L = setInterval(() => {
|
|
4321
4325
|
Y((O) => O <= 1 ? 0 : O - 1);
|
|
4322
4326
|
}, 1e3);
|
|
4323
|
-
return () => clearInterval(
|
|
4324
|
-
}, [
|
|
4327
|
+
return () => clearInterval(L);
|
|
4328
|
+
}, [T]), ne(() => {
|
|
4325
4329
|
$ && !h && W();
|
|
4326
4330
|
}, [$]);
|
|
4327
|
-
const
|
|
4328
|
-
s && (
|
|
4329
|
-
}, H = (
|
|
4330
|
-
|
|
4331
|
+
const N = () => {
|
|
4332
|
+
s && (P(!0), D(s.testDurationSec));
|
|
4333
|
+
}, H = (L, O) => {
|
|
4334
|
+
S((G) => ({
|
|
4331
4335
|
...G,
|
|
4332
|
-
[
|
|
4336
|
+
[L]: O
|
|
4333
4337
|
}));
|
|
4334
|
-
}, W = async (
|
|
4335
|
-
if (
|
|
4338
|
+
}, W = async (L) => {
|
|
4339
|
+
if (L && L.preventDefault(), !!s) {
|
|
4336
4340
|
if (!$) {
|
|
4337
4341
|
const O = s.appropriatenessQuestions.length - Object.keys(f).length;
|
|
4338
4342
|
if (O > 0) {
|
|
4339
|
-
|
|
4343
|
+
C(`Please answer all questions. ${O} question(s) remaining.`);
|
|
4340
4344
|
return;
|
|
4341
4345
|
}
|
|
4342
4346
|
}
|
|
4343
|
-
m(!0),
|
|
4347
|
+
m(!0), C(null);
|
|
4344
4348
|
try {
|
|
4345
4349
|
const O = s.appropriatenessQuestions.map(
|
|
4346
|
-
(
|
|
4347
|
-
appropriatenessQuestionId:
|
|
4348
|
-
value: f[
|
|
4350
|
+
(A) => ({
|
|
4351
|
+
appropriatenessQuestionId: A.id,
|
|
4352
|
+
value: f[A.id] || ""
|
|
4349
4353
|
// Empty string if not answered
|
|
4350
4354
|
})
|
|
4351
4355
|
), G = {
|
|
@@ -4355,30 +4359,30 @@ const qr = ({
|
|
|
4355
4359
|
};
|
|
4356
4360
|
console.log("Submitting appropriateness test:", G);
|
|
4357
4361
|
try {
|
|
4358
|
-
const
|
|
4359
|
-
console.log("Appropriateness test result:",
|
|
4360
|
-
} catch (
|
|
4361
|
-
if (
|
|
4362
|
-
const U =
|
|
4363
|
-
console.log("Test failed:", U),
|
|
4362
|
+
const A = await a.fillAppropriatenessTest(G);
|
|
4363
|
+
console.log("Appropriateness test result:", A), A.message && (A.message.toLowerCase().includes("pass") || A.message.toLowerCase().includes("success") || A.message.toLowerCase().includes("congratulations")) ? t == null || t() : (C(A.message || "Test completed. Please check the result."), P(!1), R(!1), S({}), setTimeout(() => w(), 1e3));
|
|
4364
|
+
} catch (A) {
|
|
4365
|
+
if (A.code === 400 && A.message) {
|
|
4366
|
+
const U = A.message;
|
|
4367
|
+
console.log("Test failed:", U), C(U), P(!1), R(!1), S({}), setTimeout(() => w(), 1500);
|
|
4364
4368
|
} else
|
|
4365
|
-
throw
|
|
4369
|
+
throw A;
|
|
4366
4370
|
}
|
|
4367
4371
|
} catch (O) {
|
|
4368
|
-
console.error("Error submitting appropriateness test:", O),
|
|
4372
|
+
console.error("Error submitting appropriateness test:", O), C(O.message || "Failed to submit test. Please try again."), P(!1), R(!1), S({});
|
|
4369
4373
|
} finally {
|
|
4370
4374
|
m(!1);
|
|
4371
4375
|
}
|
|
4372
4376
|
}
|
|
4373
|
-
},
|
|
4377
|
+
}, w = async () => {
|
|
4374
4378
|
try {
|
|
4375
|
-
const
|
|
4376
|
-
if (console.log("Reloaded test data:",
|
|
4377
|
-
const O = X(
|
|
4379
|
+
const L = await a.getAppropriatenessTest(e);
|
|
4380
|
+
if (console.log("Reloaded test data:", L), l(L), L.waitTimeSpanForNextTry && L.waitTimeSpanForNextTry !== "00:00:00") {
|
|
4381
|
+
const O = X(L.waitTimeSpanForNextTry);
|
|
4378
4382
|
O > 0 && Y(O);
|
|
4379
4383
|
}
|
|
4380
|
-
} catch (
|
|
4381
|
-
console.error("Error reloading test data:",
|
|
4384
|
+
} catch (L) {
|
|
4385
|
+
console.error("Error reloading test data:", L), C((O) => O + `
|
|
4382
4386
|
|
|
4383
4387
|
Failed to reload test data. Please refresh the page.`);
|
|
4384
4388
|
}
|
|
@@ -4393,7 +4397,7 @@ Failed to reload test data. Please refresh the page.`);
|
|
|
4393
4397
|
/* @__PURE__ */ r("p", { className: "text-danger-500 text-lg mb-4", children: "No test data available" }),
|
|
4394
4398
|
v && /* @__PURE__ */ r("p", { className: "text-gray-600 dark:text-gray-400", children: v })
|
|
4395
4399
|
] }) });
|
|
4396
|
-
if (
|
|
4400
|
+
if (T > 0)
|
|
4397
4401
|
return /* @__PURE__ */ o(j, { children: [
|
|
4398
4402
|
/* @__PURE__ */ o(ue, { children: [
|
|
4399
4403
|
/* @__PURE__ */ r("h2", { className: "text-lg font-bold text-gray-900 dark:text-white", children: s.displayName }),
|
|
@@ -4401,7 +4405,7 @@ Failed to reload test data. Please refresh the page.`);
|
|
|
4401
4405
|
] }),
|
|
4402
4406
|
/* @__PURE__ */ o(K, { className: "py-12 text-center", children: [
|
|
4403
4407
|
/* @__PURE__ */ o("div", { className: "mb-6", children: [
|
|
4404
|
-
/* @__PURE__ */ r("div", { className: "text-6xl font-bold text-primary-500 mb-2", children:
|
|
4408
|
+
/* @__PURE__ */ r("div", { className: "text-6xl font-bold text-primary-500 mb-2", children: E(T) }),
|
|
4405
4409
|
/* @__PURE__ */ r("p", { className: "text-gray-600 dark:text-gray-400", children: "Please wait before attempting the test again" })
|
|
4406
4410
|
] }),
|
|
4407
4411
|
v && /* @__PURE__ */ r("div", { className: "mt-4 p-4 bg-red-50 dark:bg-red-900/20 border border-red-200 dark:border-red-800 rounded-lg", children: /* @__PURE__ */ r("p", { className: "text-red-600 dark:text-red-400 text-sm", children: v }) })
|
|
@@ -4418,8 +4422,8 @@ Failed to reload test data. Please refresh the page.`);
|
|
|
4418
4422
|
/* @__PURE__ */ r(
|
|
4419
4423
|
"div",
|
|
4420
4424
|
{
|
|
4421
|
-
className: `text-3xl font-bold ${
|
|
4422
|
-
children:
|
|
4425
|
+
className: `text-3xl font-bold ${b <= 60 ? "text-danger-500" : "text-primary-500"}`,
|
|
4426
|
+
children: E(b)
|
|
4423
4427
|
}
|
|
4424
4428
|
),
|
|
4425
4429
|
/* @__PURE__ */ r("p", { className: "text-sm text-gray-500 dark:text-gray-400", children: "Time Remaining" })
|
|
@@ -4440,7 +4444,7 @@ Failed to reload test data. Please refresh the page.`);
|
|
|
4440
4444
|
" remaining"
|
|
4441
4445
|
] })
|
|
4442
4446
|
] }),
|
|
4443
|
-
s.appropriatenessQuestions.map((
|
|
4447
|
+
s.appropriatenessQuestions.map((L, O) => /* @__PURE__ */ o(
|
|
4444
4448
|
"div",
|
|
4445
4449
|
{
|
|
4446
4450
|
className: "p-4 border border-gray-200 dark:border-gray-700 rounded-lg",
|
|
@@ -4450,25 +4454,25 @@ Failed to reload test data. Please refresh the page.`);
|
|
|
4450
4454
|
"Question ",
|
|
4451
4455
|
O + 1
|
|
4452
4456
|
] }),
|
|
4453
|
-
|
|
4454
|
-
/* @__PURE__ */ r("h3", { className: "text-lg font-semibold text-gray-900 dark:text-white mt-2", children:
|
|
4457
|
+
L.groupName && /* @__PURE__ */ r("span", { className: "ml-2 text-xs text-gray-500 dark:text-gray-400", children: L.groupName }),
|
|
4458
|
+
/* @__PURE__ */ r("h3", { className: "text-lg font-semibold text-gray-900 dark:text-white mt-2", children: L.question })
|
|
4455
4459
|
] }),
|
|
4456
|
-
/* @__PURE__ */ r("div", { className: "space-y-2", children:
|
|
4460
|
+
/* @__PURE__ */ r("div", { className: "space-y-2", children: L.answers.map((G, A) => /* @__PURE__ */ o(
|
|
4457
4461
|
"label",
|
|
4458
4462
|
{
|
|
4459
4463
|
className: `
|
|
4460
4464
|
flex items-center p-3 border-2 rounded-lg cursor-pointer transition-all
|
|
4461
|
-
${f[
|
|
4465
|
+
${f[L.id] === G ? "border-primary-500 bg-primary-50 dark:bg-primary-900/20" : "border-gray-200 dark:border-gray-700 hover:border-gray-300 dark:hover:border-gray-600"}
|
|
4462
4466
|
`,
|
|
4463
4467
|
children: [
|
|
4464
4468
|
/* @__PURE__ */ r(
|
|
4465
4469
|
"input",
|
|
4466
4470
|
{
|
|
4467
4471
|
type: "radio",
|
|
4468
|
-
name: `question-${
|
|
4472
|
+
name: `question-${L.id}`,
|
|
4469
4473
|
value: G,
|
|
4470
|
-
checked: f[
|
|
4471
|
-
onChange: (U) => H(
|
|
4474
|
+
checked: f[L.id] === G,
|
|
4475
|
+
onChange: (U) => H(L.id, U.target.value),
|
|
4472
4476
|
className: "h-4 w-4 text-primary-500 border-gray-300 focus:ring-primary-500",
|
|
4473
4477
|
disabled: h
|
|
4474
4478
|
}
|
|
@@ -4476,11 +4480,11 @@ Failed to reload test data. Please refresh the page.`);
|
|
|
4476
4480
|
/* @__PURE__ */ r("span", { className: "ml-3 text-gray-700 dark:text-gray-300", children: G })
|
|
4477
4481
|
]
|
|
4478
4482
|
},
|
|
4479
|
-
|
|
4483
|
+
A
|
|
4480
4484
|
)) })
|
|
4481
4485
|
]
|
|
4482
4486
|
},
|
|
4483
|
-
|
|
4487
|
+
L.id
|
|
4484
4488
|
)),
|
|
4485
4489
|
v && !$ && /* @__PURE__ */ r("div", { className: "p-4 bg-red-50 dark:bg-red-900/20 border border-red-200 dark:border-red-800 rounded-lg", children: /* @__PURE__ */ o("p", { className: "text-red-600 dark:text-red-400 text-sm", children: [
|
|
4486
4490
|
/* @__PURE__ */ r("strong", { children: "Error:" }),
|
|
@@ -4527,7 +4531,7 @@ Failed to reload test data. Please refresh the page.`);
|
|
|
4527
4531
|
] }),
|
|
4528
4532
|
/* @__PURE__ */ o("div", { className: "flex items-center justify-between p-4 bg-blue-50 dark:bg-blue-900/20 rounded-lg", children: [
|
|
4529
4533
|
/* @__PURE__ */ r("span", { className: "text-gray-700 dark:text-gray-300 font-medium", children: "Time Limit:" }),
|
|
4530
|
-
/* @__PURE__ */ r(Ie, { variant: "info", children:
|
|
4534
|
+
/* @__PURE__ */ r(Ie, { variant: "info", children: E(s.testDurationSec) })
|
|
4531
4535
|
] }),
|
|
4532
4536
|
/* @__PURE__ */ o("div", { className: "flex items-center justify-between p-4 bg-blue-50 dark:bg-blue-900/20 rounded-lg", children: [
|
|
4533
4537
|
/* @__PURE__ */ r("span", { className: "text-gray-700 dark:text-gray-300 font-medium", children: "Correct Answers Required:" }),
|
|
@@ -4551,7 +4555,7 @@ Failed to reload test data. Please refresh the page.`);
|
|
|
4551
4555
|
Q,
|
|
4552
4556
|
{
|
|
4553
4557
|
type: "button",
|
|
4554
|
-
onClick:
|
|
4558
|
+
onClick: N,
|
|
4555
4559
|
disabled: B <= 0,
|
|
4556
4560
|
children: "Start Test"
|
|
4557
4561
|
}
|
|
@@ -4564,7 +4568,7 @@ Failed to reload test data. Please refresh the page.`);
|
|
|
4564
4568
|
onBack: n
|
|
4565
4569
|
}) => {
|
|
4566
4570
|
var _e, He, Ue, je;
|
|
4567
|
-
const { applicantService: a, baseInformationService: s, config: l, currentTheme: c } = ge(), { identityData: u, provider: h, token: m, isLoading: v, error:
|
|
4571
|
+
const { applicantService: a, baseInformationService: s, config: l, currentTheme: c } = ge(), { identityData: u, provider: h, token: m, isLoading: v, error: C, requestIdentity: f, restartIdentity: S } = wr(e), [b, D] = k(null), [F, P] = k(null), [$, R] = k([]), [T, Y] = k([]), [X, E] = k(!0), [N, H] = k(!1), [W, w] = k(null), [B, L] = k(!1), O = be.useRef(!1), [G, A] = k({}), [U, te] = k({}), ye = c != null && c.reviewPageFields && c.reviewPageFields.length > 0 ? c.reviewPageFields[0] : null, se = !!(c != null && c.reviewPageDisabled), M = ee(!1);
|
|
4568
4572
|
M.current = se;
|
|
4569
4573
|
const Z = At({
|
|
4570
4574
|
defaultValues: {
|
|
@@ -4579,24 +4583,24 @@ Failed to reload test data. Please refresh the page.`);
|
|
|
4579
4583
|
});
|
|
4580
4584
|
ne(() => {
|
|
4581
4585
|
if (se) {
|
|
4582
|
-
O.current || (O.current = !0, f().then(() => H(!0)).catch((g) => console.error("[Identity] Auto-request failed:", g)).finally(() =>
|
|
4586
|
+
O.current || (O.current = !0, f().then(() => H(!0)).catch((g) => console.error("[Identity] Auto-request failed:", g)).finally(() => E(!1)));
|
|
4583
4587
|
return;
|
|
4584
4588
|
}
|
|
4585
4589
|
(async () => {
|
|
4586
4590
|
try {
|
|
4587
|
-
const [g,
|
|
4591
|
+
const [g, x, d] = await Promise.all([
|
|
4588
4592
|
a.getApplicantData(e),
|
|
4589
4593
|
s.getCountries("", "en"),
|
|
4590
4594
|
s.getCountries("", "en", 40)
|
|
4591
4595
|
// CountriesType.PhoneNumber
|
|
4592
4596
|
]);
|
|
4593
|
-
|
|
4594
|
-
const p = /* @__PURE__ */ new Set(),
|
|
4595
|
-
|
|
4597
|
+
P(g);
|
|
4598
|
+
const p = /* @__PURE__ */ new Set(), I = x.map((q) => ({ value: q.abbreviation3 || q.abbreviation, label: q.name })).filter((q) => !q.value || p.has(q.value) ? !1 : (p.add(q.value), !0));
|
|
4599
|
+
R(I);
|
|
4596
4600
|
const z = /* @__PURE__ */ new Set(), _ = d.filter((q) => q.countryCode).map((q) => ({ value: q.countryCode, label: `${q.countryCode} – ${q.name}` })).filter((q) => z.has(q.value) ? !1 : (z.add(q.value), !0));
|
|
4597
4601
|
Y(_);
|
|
4598
4602
|
const y = g.applicantRequestData;
|
|
4599
|
-
if (
|
|
4603
|
+
if (A({
|
|
4600
4604
|
firstName: (y == null ? void 0 : y.firstName) || "",
|
|
4601
4605
|
lastName: (y == null ? void 0 : y.lastName) || "",
|
|
4602
4606
|
email: (y == null ? void 0 : y.email) || "",
|
|
@@ -4637,17 +4641,17 @@ Failed to reload test data. Please refresh the page.`);
|
|
|
4637
4641
|
} catch (g) {
|
|
4638
4642
|
console.error("Error loading applicant data:", g);
|
|
4639
4643
|
} finally {
|
|
4640
|
-
|
|
4644
|
+
E(!1);
|
|
4641
4645
|
}
|
|
4642
4646
|
})();
|
|
4643
4647
|
}, [e]), ne(() => {
|
|
4644
|
-
u && !
|
|
4645
|
-
}, [u,
|
|
4648
|
+
u && !N && M.current && (console.log("[Identity] Review page disabled — showing cached provider"), H(!0));
|
|
4649
|
+
}, [u, N]), ne(() => {
|
|
4646
4650
|
if (m) {
|
|
4647
4651
|
if (m.expiresAt) {
|
|
4648
4652
|
const i = new Date(m.expiresAt).getTime();
|
|
4649
4653
|
if (Date.now() >= i) {
|
|
4650
|
-
console.warn("[Identity] Token has expired (expiresAt)"),
|
|
4654
|
+
console.warn("[Identity] Token has expired (expiresAt)"), L(!0), w("Your verification session has expired. Please restart.");
|
|
4651
4655
|
return;
|
|
4652
4656
|
}
|
|
4653
4657
|
}
|
|
@@ -4655,22 +4659,22 @@ Failed to reload test data. Please refresh the page.`);
|
|
|
4655
4659
|
try {
|
|
4656
4660
|
const g = new URL(m.url).toString().toLowerCase();
|
|
4657
4661
|
if (g.includes("expired") || g.includes("invalid") || g.includes("error")) {
|
|
4658
|
-
console.warn("[Identity] Token URL indicates expiration"),
|
|
4662
|
+
console.warn("[Identity] Token URL indicates expiration"), L(!0), w("Your verification link has expired. Please restart.");
|
|
4659
4663
|
return;
|
|
4660
4664
|
}
|
|
4661
4665
|
} catch {
|
|
4662
4666
|
console.error("[Identity] Invalid token URL");
|
|
4663
4667
|
}
|
|
4664
4668
|
if (m.status === "expired" || m.error === "expired" || m.expired === !0) {
|
|
4665
|
-
console.warn("[Identity] Token object indicates expiration"),
|
|
4669
|
+
console.warn("[Identity] Token object indicates expiration"), L(!0), w("Your verification session has expired. Please restart.");
|
|
4666
4670
|
return;
|
|
4667
4671
|
}
|
|
4668
4672
|
}
|
|
4669
4673
|
}, [m]), ne(() => {
|
|
4670
|
-
if (h !== null && m && !
|
|
4674
|
+
if (h !== null && m && !b && N && !B) {
|
|
4671
4675
|
const i = h;
|
|
4672
4676
|
if (m.url) {
|
|
4673
|
-
console.log("[Identity] Loading provider URL for user verification:", m.url),
|
|
4677
|
+
console.log("[Identity] Loading provider URL for user verification:", m.url), w(null);
|
|
4674
4678
|
try {
|
|
4675
4679
|
if (new URL(m.url), i === ve.SardinAI) {
|
|
4676
4680
|
console.log("[SardinAI] Initializing Risk SDK in background...");
|
|
@@ -4687,64 +4691,64 @@ Failed to reload test data. Please refresh the page.`);
|
|
|
4687
4691
|
}
|
|
4688
4692
|
D({ type: "url", url: m.url });
|
|
4689
4693
|
} catch (g) {
|
|
4690
|
-
console.error("[Identity] Invalid URL:", g),
|
|
4694
|
+
console.error("[Identity] Invalid URL:", g), w("Invalid verification URL. Please restart."), L(!0);
|
|
4691
4695
|
}
|
|
4692
4696
|
return;
|
|
4693
4697
|
}
|
|
4694
4698
|
if (i === ve.SardinAI) {
|
|
4695
|
-
console.log("[SardinAI] No URL provided - initializing Risk SDK only..."),
|
|
4699
|
+
console.log("[SardinAI] No URL provided - initializing Risk SDK only..."), w(null);
|
|
4696
4700
|
try {
|
|
4697
|
-
const g = ze.parseProviderConfig(h, m, l),
|
|
4698
|
-
|
|
4699
|
-
console.log("[SardinAI] Risk SDK initialized successfully"), D(
|
|
4701
|
+
const g = ze.parseProviderConfig(h, m, l), x = ze.createProvider(h, g);
|
|
4702
|
+
x.initialize().then(() => {
|
|
4703
|
+
console.log("[SardinAI] Risk SDK initialized successfully"), D(x), setTimeout(() => {
|
|
4700
4704
|
t == null || t();
|
|
4701
4705
|
}, 2e3);
|
|
4702
4706
|
}).catch((d) => {
|
|
4703
|
-
var
|
|
4707
|
+
var I;
|
|
4704
4708
|
console.error("[SardinAI] Failed to initialize:", d);
|
|
4705
|
-
const p = ((
|
|
4706
|
-
p.includes("expired") || p.includes("invalid") || p.includes("401") || p.includes("400") ? (
|
|
4709
|
+
const p = ((I = d.message) == null ? void 0 : I.toLowerCase()) || "";
|
|
4710
|
+
p.includes("expired") || p.includes("invalid") || p.includes("401") || p.includes("400") ? (L(!0), w("Session expired or invalid. Please restart verification.")) : w(`Failed to initialize: ${d.message}`);
|
|
4707
4711
|
});
|
|
4708
4712
|
} catch (g) {
|
|
4709
|
-
console.error("[SardinAI] Error creating provider:", g),
|
|
4713
|
+
console.error("[SardinAI] Error creating provider:", g), w(`Configuration error: ${g.message}`);
|
|
4710
4714
|
}
|
|
4711
4715
|
return;
|
|
4712
4716
|
}
|
|
4713
4717
|
try {
|
|
4714
|
-
|
|
4715
|
-
const g = ze.parseProviderConfig(h, m, l),
|
|
4716
|
-
i === ve.Sumsub ? (
|
|
4718
|
+
w(null);
|
|
4719
|
+
const g = ze.parseProviderConfig(h, m, l), x = ze.createProvider(h, g);
|
|
4720
|
+
i === ve.Sumsub ? (x.initialize("identity-container").catch((d) => {
|
|
4717
4721
|
var p;
|
|
4718
|
-
console.error("[Sumsub] Initialization error:", d),
|
|
4719
|
-
}),
|
|
4722
|
+
console.error("[Sumsub] Initialization error:", d), w(`Failed to initialize: ${d.message}`), (p = d.message) != null && p.toLowerCase().includes("expired") && L(!0);
|
|
4723
|
+
}), x.onComplete && x.onComplete(() => {
|
|
4720
4724
|
t == null || t();
|
|
4721
|
-
})) : i === ve.Onfido &&
|
|
4722
|
-
console.error("[Onfido] Initialization error:", d),
|
|
4723
|
-
}), D(
|
|
4725
|
+
})) : i === ve.Onfido && x.initialize("identity-container").catch((d) => {
|
|
4726
|
+
console.error("[Onfido] Initialization error:", d), w(`Failed to initialize: ${d.message}`);
|
|
4727
|
+
}), D(x);
|
|
4724
4728
|
} catch (g) {
|
|
4725
|
-
console.error("[Identity] Provider setup error:", g),
|
|
4729
|
+
console.error("[Identity] Provider setup error:", g), w(`Setup error: ${g.message}`);
|
|
4726
4730
|
}
|
|
4727
4731
|
}
|
|
4728
4732
|
return () => {
|
|
4729
|
-
if (
|
|
4733
|
+
if (b && b.destroy)
|
|
4730
4734
|
try {
|
|
4731
|
-
|
|
4735
|
+
b.destroy();
|
|
4732
4736
|
} catch (i) {
|
|
4733
4737
|
console.error("[Identity] Error destroying provider:", i);
|
|
4734
4738
|
}
|
|
4735
4739
|
};
|
|
4736
|
-
}, [h, m,
|
|
4740
|
+
}, [h, m, b, N, t, B]);
|
|
4737
4741
|
const ie = async () => {
|
|
4738
4742
|
try {
|
|
4739
|
-
|
|
4743
|
+
w(null), L(!1), await f(), H(!0);
|
|
4740
4744
|
} catch (i) {
|
|
4741
4745
|
console.error("Error starting identity verification:", i);
|
|
4742
4746
|
}
|
|
4743
4747
|
}, Ae = async () => {
|
|
4744
4748
|
try {
|
|
4745
|
-
|
|
4749
|
+
w(null), L(!1), D(null), console.log("[Identity] Restarting verification..."), await S(), H(!0);
|
|
4746
4750
|
} catch (i) {
|
|
4747
|
-
console.error("Error restarting identity verification:", i),
|
|
4751
|
+
console.error("Error restarting identity verification:", i), w(i.message || "Failed to restart verification");
|
|
4748
4752
|
}
|
|
4749
4753
|
};
|
|
4750
4754
|
if (X || v)
|
|
@@ -4752,12 +4756,12 @@ Failed to reload test data. Please refresh the page.`);
|
|
|
4752
4756
|
/* @__PURE__ */ r(we, { className: "my-8" }),
|
|
4753
4757
|
/* @__PURE__ */ r("p", { className: "text-center text-gray-600 dark:text-gray-400 mt-4", children: "Loading identity verification..." })
|
|
4754
4758
|
] }) });
|
|
4755
|
-
if (
|
|
4759
|
+
if (C)
|
|
4756
4760
|
return /* @__PURE__ */ r(j, { children: /* @__PURE__ */ r(K, { children: /* @__PURE__ */ o("p", { className: "text-danger-500", children: [
|
|
4757
4761
|
"Error: ",
|
|
4758
|
-
|
|
4762
|
+
C.message
|
|
4759
4763
|
] }) }) });
|
|
4760
|
-
if (
|
|
4764
|
+
if (N && (W || B))
|
|
4761
4765
|
return /* @__PURE__ */ o(j, { children: [
|
|
4762
4766
|
/* @__PURE__ */ r(ue, { children: /* @__PURE__ */ r("h2", { className: "text-2xl font-bold text-gray-900 dark:text-white", children: "Verification Session Issue" }) }),
|
|
4763
4767
|
/* @__PURE__ */ o(K, { children: [
|
|
@@ -4799,7 +4803,7 @@ Failed to reload test data. Please refresh the page.`);
|
|
|
4799
4803
|
/* @__PURE__ */ r(Q, { type: "button", onClick: Ae, disabled: v, children: v ? "Restarting..." : "Restart Verification" })
|
|
4800
4804
|
] })
|
|
4801
4805
|
] });
|
|
4802
|
-
if (
|
|
4806
|
+
if (N && u) {
|
|
4803
4807
|
const i = h;
|
|
4804
4808
|
return m != null && m.url ? /* @__PURE__ */ o(j, { children: [
|
|
4805
4809
|
/* @__PURE__ */ r(ue, { children: /* @__PURE__ */ o("div", { className: "flex items-center justify-between", children: [
|
|
@@ -4832,13 +4836,13 @@ Failed to reload test data. Please refresh the page.`);
|
|
|
4832
4836
|
allow: "camera; microphone; geolocation",
|
|
4833
4837
|
title: "Identity Verification",
|
|
4834
4838
|
onLoad: (g) => {
|
|
4835
|
-
var
|
|
4839
|
+
var x, d, p;
|
|
4836
4840
|
console.log("[Identity] Iframe loaded");
|
|
4837
4841
|
try {
|
|
4838
|
-
const
|
|
4842
|
+
const I = g.target, z = I.contentDocument || ((x = I.contentWindow) == null ? void 0 : x.document);
|
|
4839
4843
|
if (z) {
|
|
4840
4844
|
const _ = ((p = (d = z.body) == null ? void 0 : d.textContent) == null ? void 0 : p.toLowerCase()) || "";
|
|
4841
|
-
(_.includes("expired") || _.includes("invalid") || _.includes("error")) && (console.warn("[Identity] Iframe shows expiration message"),
|
|
4845
|
+
(_.includes("expired") || _.includes("invalid") || _.includes("error")) && (console.warn("[Identity] Iframe shows expiration message"), L(!0), w("Your verification link has expired."));
|
|
4842
4846
|
}
|
|
4843
4847
|
} catch {
|
|
4844
4848
|
console.log("[Identity] Cannot check iframe content (CORS)");
|
|
@@ -4870,12 +4874,12 @@ Failed to reload test data. Please refresh the page.`);
|
|
|
4870
4874
|
const Pe = /* @__PURE__ */ new Set(["country", "nationality", "taxCountry", "countryOfBirth", "mobileCountryCode", "otherNationality"]), pe = (i = 4) => ({ 1: "col-span-1", 2: "col-span-2", 3: "col-span-3", 4: "col-span-4" })[i] || "col-span-4", Oe = (i, g) => {
|
|
4871
4875
|
if (!g && g !== 0) return "—";
|
|
4872
4876
|
if (Pe.has(i) && i !== "mobileCountryCode") {
|
|
4873
|
-
const
|
|
4874
|
-
return
|
|
4877
|
+
const x = $.find((d) => d.value === g);
|
|
4878
|
+
return x ? x.label : String(g);
|
|
4875
4879
|
}
|
|
4876
4880
|
return String(g);
|
|
4877
4881
|
}, Xe = ({ helpText: i }) => {
|
|
4878
|
-
const [g,
|
|
4882
|
+
const [g, x] = k(!1), d = ee(null), [, p] = k({ top: 0, left: 0 });
|
|
4879
4883
|
return /* @__PURE__ */ o(Qe, { children: [
|
|
4880
4884
|
/* @__PURE__ */ r(
|
|
4881
4885
|
"button",
|
|
@@ -4887,7 +4891,7 @@ Failed to reload test data. Please refresh the page.`);
|
|
|
4887
4891
|
const z = d.current.getBoundingClientRect();
|
|
4888
4892
|
p({ top: z.bottom + window.scrollY + 6, left: z.left + window.scrollX });
|
|
4889
4893
|
}
|
|
4890
|
-
|
|
4894
|
+
x(!0);
|
|
4891
4895
|
},
|
|
4892
4896
|
style: {
|
|
4893
4897
|
width: 18,
|
|
@@ -4921,7 +4925,7 @@ Failed to reload test data. Please refresh the page.`);
|
|
|
4921
4925
|
alignItems: "center",
|
|
4922
4926
|
justifyContent: "center"
|
|
4923
4927
|
},
|
|
4924
|
-
onClick: () =>
|
|
4928
|
+
onClick: () => x(!1),
|
|
4925
4929
|
children: /* @__PURE__ */ o(
|
|
4926
4930
|
"div",
|
|
4927
4931
|
{
|
|
@@ -4941,7 +4945,7 @@ Failed to reload test data. Please refresh the page.`);
|
|
|
4941
4945
|
"button",
|
|
4942
4946
|
{
|
|
4943
4947
|
type: "button",
|
|
4944
|
-
onClick: () =>
|
|
4948
|
+
onClick: () => x(!1),
|
|
4945
4949
|
style: {
|
|
4946
4950
|
marginTop: 12,
|
|
4947
4951
|
padding: "4px 12px",
|
|
@@ -4963,13 +4967,13 @@ Failed to reload test data. Please refresh the page.`);
|
|
|
4963
4967
|
document.body
|
|
4964
4968
|
)
|
|
4965
4969
|
] });
|
|
4966
|
-
},
|
|
4970
|
+
}, xe = (i, g) => g ? /* @__PURE__ */ o("div", { style: { display: "flex", alignItems: "flex-start", gap: 5, flexWrap: "nowrap" }, children: [
|
|
4967
4971
|
/* @__PURE__ */ r("div", { style: { flex: 1, minWidth: 0 }, children: i }),
|
|
4968
4972
|
/* @__PURE__ */ r("div", { style: { paddingTop: 24 }, children: /* @__PURE__ */ r(Xe, { helpText: g }) })
|
|
4969
4973
|
] }) : i, et = (i, g) => {
|
|
4970
|
-
const
|
|
4974
|
+
const x = `cf-${g}`, d = i.paramName ?? "", p = U[d];
|
|
4971
4975
|
if (i.customType === "br")
|
|
4972
|
-
return /* @__PURE__ */ r("div", { className: pe(i.colSpan), style: { minHeight: "0.5rem" } },
|
|
4976
|
+
return /* @__PURE__ */ r("div", { className: pe(i.colSpan), style: { minHeight: "0.5rem" } }, x);
|
|
4973
4977
|
if (i.customType === "paragraph")
|
|
4974
4978
|
return /* @__PURE__ */ r("div", { className: pe(i.colSpan), children: /* @__PURE__ */ r(
|
|
4975
4979
|
"div",
|
|
@@ -4978,7 +4982,7 @@ Failed to reload test data. Please refresh the page.`);
|
|
|
4978
4982
|
style: { color: "var(--metakyc-text-secondary, #6b7280)" },
|
|
4979
4983
|
dangerouslySetInnerHTML: { __html: i.label || "" }
|
|
4980
4984
|
}
|
|
4981
|
-
) },
|
|
4985
|
+
) }, x);
|
|
4982
4986
|
if (i.customType === "html")
|
|
4983
4987
|
return /* @__PURE__ */ r(
|
|
4984
4988
|
"div",
|
|
@@ -4986,10 +4990,10 @@ Failed to reload test data. Please refresh the page.`);
|
|
|
4986
4990
|
className: pe(i.colSpan),
|
|
4987
4991
|
dangerouslySetInnerHTML: { __html: i.label || "" }
|
|
4988
4992
|
},
|
|
4989
|
-
|
|
4993
|
+
x
|
|
4990
4994
|
);
|
|
4991
4995
|
if (i.customType === "link")
|
|
4992
|
-
return /* @__PURE__ */ r("div", { className: pe(i.colSpan), children:
|
|
4996
|
+
return /* @__PURE__ */ r("div", { className: pe(i.colSpan), children: xe(
|
|
4993
4997
|
/* @__PURE__ */ r(
|
|
4994
4998
|
"a",
|
|
4995
4999
|
{
|
|
@@ -5002,16 +5006,16 @@ Failed to reload test data. Please refresh the page.`);
|
|
|
5002
5006
|
}
|
|
5003
5007
|
),
|
|
5004
5008
|
i.helpText
|
|
5005
|
-
) },
|
|
5009
|
+
) }, x);
|
|
5006
5010
|
if (i.customType === "checkbox" || i.customType === "link_checkbox") {
|
|
5007
|
-
const
|
|
5008
|
-
return /* @__PURE__ */ r("div", { className: pe(i.colSpan), children:
|
|
5011
|
+
const I = p === "true" || p === !0;
|
|
5012
|
+
return /* @__PURE__ */ r("div", { className: pe(i.colSpan), children: xe(
|
|
5009
5013
|
/* @__PURE__ */ o("label", { style: { display: "flex", alignItems: "flex-start", gap: 8, cursor: "pointer" }, children: [
|
|
5010
5014
|
/* @__PURE__ */ r(
|
|
5011
5015
|
"input",
|
|
5012
5016
|
{
|
|
5013
5017
|
type: "checkbox",
|
|
5014
|
-
checked: !!
|
|
5018
|
+
checked: !!I,
|
|
5015
5019
|
onChange: (z) => te((_) => ({ ..._, [d]: String(z.target.checked) })),
|
|
5016
5020
|
style: {
|
|
5017
5021
|
width: 16,
|
|
@@ -5028,16 +5032,16 @@ Failed to reload test data. Please refresh the page.`);
|
|
|
5028
5032
|
] }) : i.displayText || i.label })
|
|
5029
5033
|
] }),
|
|
5030
5034
|
i.helpText
|
|
5031
|
-
) },
|
|
5035
|
+
) }, x);
|
|
5032
5036
|
}
|
|
5033
5037
|
if (i.customType === "group_checkbox") {
|
|
5034
|
-
const
|
|
5035
|
-
i.singleSelect ? te((y) => ({ ...y, [d]:
|
|
5038
|
+
const I = Array.isArray(p) ? p : p ? [p] : [], z = (_) => {
|
|
5039
|
+
i.singleSelect ? te((y) => ({ ...y, [d]: I[0] === _ ? [] : [_] })) : te((y) => ({
|
|
5036
5040
|
...y,
|
|
5037
|
-
[d]:
|
|
5041
|
+
[d]: I.includes(_) ? I.filter((ae) => ae !== _) : [...I, _]
|
|
5038
5042
|
}));
|
|
5039
5043
|
};
|
|
5040
|
-
return /* @__PURE__ */ r("div", { className: pe(i.colSpan), children:
|
|
5044
|
+
return /* @__PURE__ */ r("div", { className: pe(i.colSpan), children: xe(
|
|
5041
5045
|
/* @__PURE__ */ o("div", { className: "space-y-1.5", children: [
|
|
5042
5046
|
i.label && /* @__PURE__ */ r("p", { className: "text-sm font-medium", style: { color: "var(--metakyc-text-primary, #111827)" }, children: i.displayText || i.label }),
|
|
5043
5047
|
(i.options || []).map((_) => /* @__PURE__ */ o("label", { style: { display: "flex", alignItems: "flex-start", gap: 8, cursor: "pointer" }, children: [
|
|
@@ -5045,7 +5049,7 @@ Failed to reload test data. Please refresh the page.`);
|
|
|
5045
5049
|
"input",
|
|
5046
5050
|
{
|
|
5047
5051
|
type: "checkbox",
|
|
5048
|
-
checked:
|
|
5052
|
+
checked: I.includes(_.value),
|
|
5049
5053
|
onChange: () => z(_.value),
|
|
5050
5054
|
style: { width: 16, height: 16, flexShrink: 0, marginTop: 2, accentColor: "var(--metakyc-primary, #6366f1)" }
|
|
5051
5055
|
}
|
|
@@ -5054,92 +5058,92 @@ Failed to reload test data. Please refresh the page.`);
|
|
|
5054
5058
|
] }, _.value))
|
|
5055
5059
|
] }),
|
|
5056
5060
|
i.helpText
|
|
5057
|
-
) },
|
|
5061
|
+
) }, x);
|
|
5058
5062
|
}
|
|
5059
|
-
return i.customType === "radio_group" ? /* @__PURE__ */ r("div", { className: pe(i.colSpan), children:
|
|
5063
|
+
return i.customType === "radio_group" ? /* @__PURE__ */ r("div", { className: pe(i.colSpan), children: xe(
|
|
5060
5064
|
/* @__PURE__ */ o("div", { className: "space-y-1.5", children: [
|
|
5061
5065
|
i.label && /* @__PURE__ */ r("p", { className: "text-sm font-medium", style: { color: "var(--metakyc-text-primary, #111827)" }, children: i.displayText || i.label }),
|
|
5062
|
-
(i.options || []).map((
|
|
5066
|
+
(i.options || []).map((I) => /* @__PURE__ */ o("label", { style: { display: "flex", alignItems: "flex-start", gap: 8, cursor: "pointer" }, children: [
|
|
5063
5067
|
/* @__PURE__ */ r(
|
|
5064
5068
|
"input",
|
|
5065
5069
|
{
|
|
5066
5070
|
type: "radio",
|
|
5067
5071
|
name: `rg-${d}`,
|
|
5068
|
-
value:
|
|
5069
|
-
checked: p ===
|
|
5070
|
-
onChange: () => te((z) => ({ ...z, [d]:
|
|
5072
|
+
value: I.value,
|
|
5073
|
+
checked: p === I.value,
|
|
5074
|
+
onChange: () => te((z) => ({ ...z, [d]: I.value })),
|
|
5071
5075
|
style: { width: 16, height: 16, flexShrink: 0, marginTop: 2, accentColor: "var(--metakyc-primary, #6366f1)" }
|
|
5072
5076
|
}
|
|
5073
5077
|
),
|
|
5074
|
-
/* @__PURE__ */ r("span", { className: "text-sm", style: { color: "var(--metakyc-text-primary, #111827)" }, children:
|
|
5075
|
-
] },
|
|
5078
|
+
/* @__PURE__ */ r("span", { className: "text-sm", style: { color: "var(--metakyc-text-primary, #111827)" }, children: I.label })
|
|
5079
|
+
] }, I.value))
|
|
5076
5080
|
] }),
|
|
5077
5081
|
i.helpText
|
|
5078
|
-
) },
|
|
5082
|
+
) }, x) : /* @__PURE__ */ r("div", { className: pe(i.colSpan), children: xe(
|
|
5079
5083
|
/* @__PURE__ */ r(
|
|
5080
5084
|
de,
|
|
5081
5085
|
{
|
|
5082
5086
|
label: i.displayText || i.label || d,
|
|
5083
5087
|
value: String(p ?? ""),
|
|
5084
|
-
onChange: (
|
|
5088
|
+
onChange: (I) => te((z) => ({ ...z, [d]: I.target.value }))
|
|
5085
5089
|
}
|
|
5086
5090
|
),
|
|
5087
5091
|
i.helpText
|
|
5088
|
-
) },
|
|
5092
|
+
) }, x);
|
|
5089
5093
|
}, tt = (i, g) => {
|
|
5090
5094
|
if (i.isCustom) return et(i, g);
|
|
5091
|
-
const
|
|
5092
|
-
return i.editable ? z ? /* @__PURE__ */ r("div", { className: pe(i.colSpan ?? 2), children:
|
|
5095
|
+
const x = i.name ?? "", d = Me[x], p = i.displayText || (d == null ? void 0 : d.label) || x, I = G[x] ?? "", z = x === "mobileCountryCode", _ = !!(d != null && d.countriesType) && !z;
|
|
5096
|
+
return i.editable ? z ? /* @__PURE__ */ r("div", { className: pe(i.colSpan ?? 2), children: xe(
|
|
5093
5097
|
/* @__PURE__ */ r(
|
|
5094
5098
|
Re,
|
|
5095
5099
|
{
|
|
5096
5100
|
label: p,
|
|
5097
|
-
value: String(
|
|
5098
|
-
onChange: (y) =>
|
|
5099
|
-
options: [{ value: "", label: "Select country code…" }, ...
|
|
5101
|
+
value: String(I),
|
|
5102
|
+
onChange: (y) => A((ae) => ({ ...ae, [x]: y })),
|
|
5103
|
+
options: [{ value: "", label: "Select country code…" }, ...T]
|
|
5100
5104
|
}
|
|
5101
5105
|
),
|
|
5102
5106
|
i.helpText
|
|
5103
|
-
) }, `epc-${g}`) : _ ? /* @__PURE__ */ r("div", { className: pe(i.colSpan ?? 2), children:
|
|
5107
|
+
) }, `epc-${g}`) : _ ? /* @__PURE__ */ r("div", { className: pe(i.colSpan ?? 2), children: xe(
|
|
5104
5108
|
/* @__PURE__ */ r(
|
|
5105
5109
|
Re,
|
|
5106
5110
|
{
|
|
5107
5111
|
label: p,
|
|
5108
|
-
value: String(
|
|
5109
|
-
onChange: (y) =>
|
|
5112
|
+
value: String(I),
|
|
5113
|
+
onChange: (y) => A((ae) => ({ ...ae, [x]: y })),
|
|
5110
5114
|
options: [{ value: "", label: `Select ${p.toLowerCase()}…` }, ...$]
|
|
5111
5115
|
}
|
|
5112
5116
|
),
|
|
5113
5117
|
i.helpText
|
|
5114
|
-
) }, `ec-${g}`) : /* @__PURE__ */ r("div", { className: pe(i.colSpan ?? 2), children:
|
|
5118
|
+
) }, `ec-${g}`) : /* @__PURE__ */ r("div", { className: pe(i.colSpan ?? 2), children: xe(
|
|
5115
5119
|
/* @__PURE__ */ r(
|
|
5116
5120
|
de,
|
|
5117
5121
|
{
|
|
5118
5122
|
label: p,
|
|
5119
5123
|
type: (d == null ? void 0 : d.type) === "date" ? "date" : (d == null ? void 0 : d.type) === "email" ? "email" : "text",
|
|
5120
|
-
value: String(
|
|
5121
|
-
onChange: (y) =>
|
|
5124
|
+
value: String(I),
|
|
5125
|
+
onChange: (y) => A((ae) => ({ ...ae, [x]: y.target.value }))
|
|
5122
5126
|
}
|
|
5123
5127
|
),
|
|
5124
5128
|
i.helpText
|
|
5125
|
-
) }, `ei-${g}`) : /* @__PURE__ */ r("div", { className: pe(i.colSpan ?? 2), children:
|
|
5129
|
+
) }, `ei-${g}`) : /* @__PURE__ */ r("div", { className: pe(i.colSpan ?? 2), children: xe(
|
|
5126
5130
|
/* @__PURE__ */ o(Qe, { children: [
|
|
5127
5131
|
/* @__PURE__ */ r("label", { className: "block text-sm font-medium mb-0.5", style: { color: "var(--metakyc-text-secondary, #6b7280)" }, children: p }),
|
|
5128
|
-
/* @__PURE__ */ r("p", { className: "text-sm", style: { color: "var(--metakyc-text-primary, #111827)", minHeight: "1.5rem" }, children: Oe(
|
|
5132
|
+
/* @__PURE__ */ r("p", { className: "text-sm", style: { color: "var(--metakyc-text-primary, #111827)", minHeight: "1.5rem" }, children: Oe(x, I) })
|
|
5129
5133
|
] }),
|
|
5130
5134
|
i.helpText
|
|
5131
5135
|
) }, `ro-${g}`);
|
|
5132
5136
|
};
|
|
5133
5137
|
if (ye) {
|
|
5134
5138
|
const i = ye.title || "Review Your Information", g = ye.subtitle || "Please review and confirm your information before starting identity verification";
|
|
5135
|
-
return /* @__PURE__ */ r("form", { onSubmit: (
|
|
5136
|
-
|
|
5139
|
+
return /* @__PURE__ */ r("form", { onSubmit: (x) => {
|
|
5140
|
+
x.preventDefault(), ie();
|
|
5137
5141
|
}, children: /* @__PURE__ */ o(j, { children: [
|
|
5138
5142
|
/* @__PURE__ */ o(ue, { children: [
|
|
5139
5143
|
/* @__PURE__ */ r("h2", { className: "text-lg font-bold", style: { color: "var(--metakyc-text-primary, #111827)" }, children: i }),
|
|
5140
5144
|
/* @__PURE__ */ r("p", { className: "mt-1 text-sm", style: { color: "var(--metakyc-text-secondary, #6b7280)" }, children: g })
|
|
5141
5145
|
] }),
|
|
5142
|
-
/* @__PURE__ */ r(K, { children: /* @__PURE__ */ r("div", { className: "grid grid-cols-4 gap-4", children: ye.fields.map((
|
|
5146
|
+
/* @__PURE__ */ r(K, { children: /* @__PURE__ */ r("div", { className: "grid grid-cols-4 gap-4", children: ye.fields.map((x, d) => tt(x, d)) }) }),
|
|
5143
5147
|
/* @__PURE__ */ o(me, { className: "flex justify-between", children: [
|
|
5144
5148
|
n && /* @__PURE__ */ r(Q, { type: "button", variant: "outline", onClick: n, children: "Back" }),
|
|
5145
5149
|
/* @__PURE__ */ r(Q, { type: "submit", isLoading: v, children: "Confirm and Start Verification" })
|
|
@@ -5164,7 +5168,7 @@ Failed to reload test data. Please refresh the page.`);
|
|
|
5164
5168
|
/* @__PURE__ */ r("h3", { className: "text-base font-semibold", style: { color: "var(--metakyc-text-primary, #111827)" }, children: "Address Information" }),
|
|
5165
5169
|
/* @__PURE__ */ o("div", { className: "grid grid-cols-1 md:grid-cols-2 gap-4", children: [
|
|
5166
5170
|
/* @__PURE__ */ r(
|
|
5167
|
-
|
|
5171
|
+
Te,
|
|
5168
5172
|
{
|
|
5169
5173
|
control: Z.control,
|
|
5170
5174
|
name: "country",
|
|
@@ -5180,7 +5184,7 @@ Failed to reload test data. Please refresh the page.`);
|
|
|
5180
5184
|
}
|
|
5181
5185
|
),
|
|
5182
5186
|
/* @__PURE__ */ r(
|
|
5183
|
-
|
|
5187
|
+
Te,
|
|
5184
5188
|
{
|
|
5185
5189
|
control: Z.control,
|
|
5186
5190
|
name: "nationality",
|
|
@@ -5197,14 +5201,14 @@ Failed to reload test data. Please refresh the page.`);
|
|
|
5197
5201
|
)
|
|
5198
5202
|
] }),
|
|
5199
5203
|
/* @__PURE__ */ o("div", { className: "grid grid-cols-1 md:grid-cols-2 gap-4", children: [
|
|
5200
|
-
/* @__PURE__ */ r(
|
|
5201
|
-
/* @__PURE__ */ r(
|
|
5204
|
+
/* @__PURE__ */ r(Te, { control: Z.control, name: "street", render: ({ field: i }) => /* @__PURE__ */ r(de, { ...i, label: "Street" }) }),
|
|
5205
|
+
/* @__PURE__ */ r(Te, { control: Z.control, name: "streetNumber", render: ({ field: i }) => /* @__PURE__ */ r(de, { ...i, label: "Street Number" }) })
|
|
5202
5206
|
] }),
|
|
5203
5207
|
/* @__PURE__ */ o("div", { className: "grid grid-cols-1 md:grid-cols-2 gap-4", children: [
|
|
5204
|
-
/* @__PURE__ */ r(
|
|
5205
|
-
/* @__PURE__ */ r(
|
|
5208
|
+
/* @__PURE__ */ r(Te, { control: Z.control, name: "city", render: ({ field: i }) => /* @__PURE__ */ r(de, { ...i, label: "City" }) }),
|
|
5209
|
+
/* @__PURE__ */ r(Te, { control: Z.control, name: "zip", render: ({ field: i }) => /* @__PURE__ */ r(de, { ...i, label: "ZIP / Postal Code" }) })
|
|
5206
5210
|
] }),
|
|
5207
|
-
/* @__PURE__ */ r(
|
|
5211
|
+
/* @__PURE__ */ r(Te, { control: Z.control, name: "phonenumber", render: ({ field: i }) => /* @__PURE__ */ r(de, { ...i, label: "Phone Number", type: "tel" }) })
|
|
5208
5212
|
] })
|
|
5209
5213
|
] }),
|
|
5210
5214
|
/* @__PURE__ */ o(me, { className: "flex justify-between", children: [
|
|
@@ -5220,21 +5224,21 @@ Failed to reload test data. Please refresh the page.`);
|
|
|
5220
5224
|
onContinue: s,
|
|
5221
5225
|
onContactSupport: l
|
|
5222
5226
|
}) => {
|
|
5223
|
-
const u = e ===
|
|
5227
|
+
const u = e === Le.Approved ? {
|
|
5224
5228
|
type: "success",
|
|
5225
5229
|
title: "Verification Approved",
|
|
5226
5230
|
icon: "✓",
|
|
5227
5231
|
iconBg: "bg-green-100 dark:bg-green-900/30",
|
|
5228
5232
|
iconColor: "text-green-600 dark:text-green-400",
|
|
5229
5233
|
message: "Your identity verification has been successfully approved."
|
|
5230
|
-
} : e ===
|
|
5234
|
+
} : e === Le.Rejected ? {
|
|
5231
5235
|
type: "error",
|
|
5232
5236
|
title: "Verification Rejected",
|
|
5233
5237
|
icon: "✕",
|
|
5234
5238
|
iconBg: "bg-red-100 dark:bg-red-900/30",
|
|
5235
5239
|
iconColor: "text-red-600 dark:text-red-400",
|
|
5236
5240
|
message: "Unfortunately, your identity verification was not approved."
|
|
5237
|
-
} : e ===
|
|
5241
|
+
} : e === Le.Pending || e === Le.InProgress ? {
|
|
5238
5242
|
type: "pending",
|
|
5239
5243
|
title: "Verification Pending",
|
|
5240
5244
|
icon: "⏱",
|
|
@@ -5305,7 +5309,7 @@ Failed to reload test data. Please refresh the page.`);
|
|
|
5305
5309
|
Ie,
|
|
5306
5310
|
{
|
|
5307
5311
|
variant: u.type === "success" ? "success" : u.type === "error" ? "danger" : u.type === "pending" ? "warning" : "info",
|
|
5308
|
-
children: e != null ?
|
|
5312
|
+
children: e != null ? Le[e] : De[t]
|
|
5309
5313
|
}
|
|
5310
5314
|
) }),
|
|
5311
5315
|
/* @__PURE__ */ r("p", { className: "text-center text-gray-600 dark:text-gray-400 mb-6 max-w-md mx-auto", children: a || u.message }),
|
|
@@ -5337,7 +5341,7 @@ Failed to reload test data. Please refresh the page.`);
|
|
|
5337
5341
|
/* @__PURE__ */ r("div", { className: "mt-6 pt-6 border-t border-gray-200 dark:border-gray-700", children: /* @__PURE__ */ o("div", { className: "grid grid-cols-2 gap-4 text-sm", children: [
|
|
5338
5342
|
/* @__PURE__ */ o("div", { children: [
|
|
5339
5343
|
/* @__PURE__ */ r("span", { className: "text-gray-500 dark:text-gray-400", children: "KYC Status:" }),
|
|
5340
|
-
/* @__PURE__ */ r("div", { className: "font-medium text-gray-900 dark:text-white mt-1", children: e != null ?
|
|
5344
|
+
/* @__PURE__ */ r("div", { className: "font-medium text-gray-900 dark:text-white mt-1", children: e != null ? Le[e] : "Not Available" })
|
|
5341
5345
|
] }),
|
|
5342
5346
|
/* @__PURE__ */ o("div", { children: [
|
|
5343
5347
|
/* @__PURE__ */ r("span", { className: "text-gray-500 dark:text-gray-400", children: "Review Status:" }),
|
|
@@ -5407,7 +5411,7 @@ const qe = {
|
|
|
5407
5411
|
display: "inline-block",
|
|
5408
5412
|
verticalAlign: "middle"
|
|
5409
5413
|
}, pt = ({ helpText: e, children: t }) => {
|
|
5410
|
-
const [n, a] =
|
|
5414
|
+
const [n, a] = be.useState(!1);
|
|
5411
5415
|
if (!e) return /* @__PURE__ */ r(Qe, { children: t });
|
|
5412
5416
|
const s = n ? /* @__PURE__ */ r(
|
|
5413
5417
|
"div",
|
|
@@ -5521,7 +5525,7 @@ const qe = {
|
|
|
5521
5525
|
),
|
|
5522
5526
|
typeof document < "u" && s ? it(s, document.body) : null
|
|
5523
5527
|
] });
|
|
5524
|
-
},
|
|
5528
|
+
}, bn = ({
|
|
5525
5529
|
workflowKey: e,
|
|
5526
5530
|
externalRefId: t,
|
|
5527
5531
|
onSuccess: n,
|
|
@@ -5533,26 +5537,26 @@ const qe = {
|
|
|
5533
5537
|
throw new Error(
|
|
5534
5538
|
"workflowKey is required. Provide it either as a prop to CreateApplicantForm or set it in config.applicantForm.workflowKey"
|
|
5535
5539
|
);
|
|
5536
|
-
const v = t || ((He = s.applicantForm) == null ? void 0 : He.externalRefId) || "",
|
|
5540
|
+
const v = t || ((He = s.applicantForm) == null ? void 0 : He.externalRefId) || "", C = ((Ue = s.applicantForm) == null ? void 0 : Ue.email) || "", f = Ee(
|
|
5537
5541
|
() => c != null && c.applicantFormPages && c.applicantFormPages.length > 0 ? c.applicantFormPages : null,
|
|
5538
5542
|
[c == null ? void 0 : c.applicantFormPages]
|
|
5539
|
-
),
|
|
5543
|
+
), S = Ee(() => {
|
|
5540
5544
|
const i = new Set(Ve), g = c == null ? void 0 : c.applicantFormRequiredFields;
|
|
5541
|
-
if (g) for (const
|
|
5545
|
+
if (g) for (const x of g) i.add(x);
|
|
5542
5546
|
if (f)
|
|
5543
|
-
for (const
|
|
5544
|
-
for (const d of
|
|
5547
|
+
for (const x of f)
|
|
5548
|
+
for (const d of x.fields)
|
|
5545
5549
|
!d.isCustom && d.name && d.required && i.add(d.name);
|
|
5546
5550
|
return Array.from(i);
|
|
5547
|
-
}, [c == null ? void 0 : c.applicantFormRequiredFields, f]),
|
|
5548
|
-
var
|
|
5551
|
+
}, [c == null ? void 0 : c.applicantFormRequiredFields, f]), b = Ee(() => {
|
|
5552
|
+
var x;
|
|
5549
5553
|
if (f) {
|
|
5550
|
-
const d = f.flatMap((
|
|
5551
|
-
for (const
|
|
5554
|
+
const d = f.flatMap((I) => I.fields).filter((I) => !I.isCustom && I.name).map((I) => I.name), p = new Set(d);
|
|
5555
|
+
for (const I of Ve) p.add(I);
|
|
5552
5556
|
return Array.from(p);
|
|
5553
5557
|
}
|
|
5554
5558
|
let i;
|
|
5555
|
-
(
|
|
5559
|
+
(x = s.applicantForm) != null && x.visibleFields ? i = s.applicantForm.visibleFields : c != null && c.applicantFormVisibleFields && c.applicantFormVisibleFields.length > 0 ? i = c.applicantFormVisibleFields : i = zt;
|
|
5556
5560
|
const g = new Set(i);
|
|
5557
5561
|
for (const d of Ve) g.add(d);
|
|
5558
5562
|
return Array.from(g);
|
|
@@ -5564,17 +5568,17 @@ const qe = {
|
|
|
5564
5568
|
"mobileCountryCode",
|
|
5565
5569
|
"otherNationality"
|
|
5566
5570
|
]), F = Ee(() => {
|
|
5567
|
-
var g,
|
|
5571
|
+
var g, x;
|
|
5568
5572
|
const i = /* @__PURE__ */ new Set();
|
|
5569
5573
|
if (f)
|
|
5570
5574
|
for (const d of f)
|
|
5571
5575
|
for (const p of d.fields)
|
|
5572
5576
|
!p.isCustom && p.name && D.has(p.name) && i.add(p.countriesType ?? ((g = Me[p.name]) == null ? void 0 : g.countriesType));
|
|
5573
5577
|
else
|
|
5574
|
-
for (const d of
|
|
5575
|
-
D.has(d) && i.add((
|
|
5578
|
+
for (const d of b)
|
|
5579
|
+
D.has(d) && i.add((x = Me[d]) == null ? void 0 : x.countriesType);
|
|
5576
5580
|
return i.size === 0 && i.add(void 0), Array.from(i);
|
|
5577
|
-
}, [
|
|
5581
|
+
}, [b, f]), [P, $] = k({}), [R, T] = k(!0), Y = ee(/* @__PURE__ */ new Set()), X = ee(/* @__PURE__ */ new Set());
|
|
5578
5582
|
ne(() => {
|
|
5579
5583
|
if (!c) return;
|
|
5580
5584
|
const i = F.filter((d) => {
|
|
@@ -5583,22 +5587,22 @@ const qe = {
|
|
|
5583
5587
|
});
|
|
5584
5588
|
if (i.length === 0) {
|
|
5585
5589
|
F.every((p) => {
|
|
5586
|
-
const
|
|
5587
|
-
return X.current.has(
|
|
5588
|
-
}) &&
|
|
5590
|
+
const I = p != null ? String(p) : "all";
|
|
5591
|
+
return X.current.has(I);
|
|
5592
|
+
}) && T(!1);
|
|
5589
5593
|
return;
|
|
5590
5594
|
}
|
|
5591
|
-
|
|
5595
|
+
T(!0);
|
|
5592
5596
|
const g = i.map((d) => d != null ? String(d) : "all");
|
|
5593
5597
|
g.forEach((d) => Y.current.add(d)), (async () => {
|
|
5594
5598
|
try {
|
|
5595
5599
|
const d = await Promise.all(
|
|
5596
5600
|
i.map(async (p) => {
|
|
5597
|
-
const
|
|
5601
|
+
const I = p != null ? String(p) : "all", z = await l.getCountries("", s.locale || "en", p), _ = p === 40, y = /* @__PURE__ */ new Set(), ae = z.map((q) => _ && q.countryCode ? {
|
|
5598
5602
|
value: q.countryCode,
|
|
5599
5603
|
label: `${q.countryCode} – ${q.name}`
|
|
5600
5604
|
} : { value: q.abbreviation3 || q.abbreviation, label: q.name }).filter((q) => !q.value || y.has(q.value) ? !1 : (y.add(q.value), !0));
|
|
5601
|
-
return X.current.add(
|
|
5605
|
+
return X.current.add(I), Y.current.delete(I), [I, ae];
|
|
5602
5606
|
})
|
|
5603
5607
|
);
|
|
5604
5608
|
$((p) => ({ ...p, ...Object.fromEntries(d) }));
|
|
@@ -5606,22 +5610,22 @@ const qe = {
|
|
|
5606
5610
|
g.forEach((p) => Y.current.delete(p)), console.error("Failed to load countries:", d);
|
|
5607
5611
|
} finally {
|
|
5608
5612
|
F.every((p) => {
|
|
5609
|
-
const
|
|
5610
|
-
return X.current.has(
|
|
5611
|
-
}) &&
|
|
5613
|
+
const I = p != null ? String(p) : "all";
|
|
5614
|
+
return X.current.has(I);
|
|
5615
|
+
}) && T(!1);
|
|
5612
5616
|
}
|
|
5613
5617
|
})();
|
|
5614
5618
|
}, [F, c]);
|
|
5615
|
-
const
|
|
5619
|
+
const E = (i, g) => {
|
|
5616
5620
|
var p;
|
|
5617
|
-
const
|
|
5618
|
-
return
|
|
5619
|
-
}, [
|
|
5621
|
+
const x = g ?? ((p = Me[i]) == null ? void 0 : p.countriesType), d = x != null ? String(x) : "all";
|
|
5622
|
+
return P[d] || [];
|
|
5623
|
+
}, [N, H] = k({
|
|
5620
5624
|
workflowKey: m,
|
|
5621
5625
|
firstName: "",
|
|
5622
5626
|
lastName: "",
|
|
5623
5627
|
title: "",
|
|
5624
|
-
email:
|
|
5628
|
+
email: C,
|
|
5625
5629
|
dateOfBirth: "",
|
|
5626
5630
|
phonenumber: "",
|
|
5627
5631
|
externalRefId: v,
|
|
@@ -5641,21 +5645,21 @@ const qe = {
|
|
|
5641
5645
|
educationLevel: "",
|
|
5642
5646
|
occupation: "",
|
|
5643
5647
|
taxNumber: ""
|
|
5644
|
-
}), [W,
|
|
5645
|
-
var
|
|
5648
|
+
}), [W, w] = k({}), [B, L] = k(0), [O, G] = k({}), [A, U] = k(null), [te, ye] = k(!1), se = (i, g) => H((x) => ({ ...x, [i]: g })), M = (i, g) => w((x) => ({ ...x, [i]: g })), Z = (i) => !i.conditionalOn || W[i.conditionalOn] === "true", ie = f && B < f.length - 1 ? B + 1 : -1, Ae = f && B > 0 ? B - 1 : -1, Pe = (i) => {
|
|
5649
|
+
var x;
|
|
5646
5650
|
const g = {};
|
|
5647
5651
|
for (const d of i.fields)
|
|
5648
5652
|
if (d.isCustom) {
|
|
5649
5653
|
if (d.customType === "paragraph" || d.customType === "html" || d.customType === "br" || d.customType === "link") continue;
|
|
5650
5654
|
if (d.required && d.paramName) {
|
|
5651
|
-
const p = W[d.paramName],
|
|
5652
|
-
d.customType === "checkbox" || d.customType === "link_checkbox" ? p !== "true" && (g[d.paramName] = `${
|
|
5655
|
+
const p = W[d.paramName], I = d.displayText || d.label || d.paramName;
|
|
5656
|
+
d.customType === "checkbox" || d.customType === "link_checkbox" ? p !== "true" && (g[d.paramName] = `${I} is required.`) : (!p || p.trim() === "") && (g[d.paramName] = `${I} is required.`);
|
|
5653
5657
|
}
|
|
5654
5658
|
} else if (d.name) {
|
|
5655
5659
|
const p = d.name;
|
|
5656
|
-
if (
|
|
5657
|
-
const
|
|
5658
|
-
g[p] = `${
|
|
5660
|
+
if (S.includes(p) && Ye(N[p])) {
|
|
5661
|
+
const I = d.displayText || ((x = Me[p]) == null ? void 0 : x.label) || p;
|
|
5662
|
+
g[p] = `${I} is required.`;
|
|
5659
5663
|
}
|
|
5660
5664
|
}
|
|
5661
5665
|
return g;
|
|
@@ -5663,7 +5667,7 @@ const qe = {
|
|
|
5663
5667
|
if (!f) return;
|
|
5664
5668
|
const i = f[B];
|
|
5665
5669
|
if (i.conditionalOn && !Z(i)) {
|
|
5666
|
-
G({}), ie >= 0 ?
|
|
5670
|
+
G({}), ie >= 0 ? L(ie) : await Oe();
|
|
5667
5671
|
return;
|
|
5668
5672
|
}
|
|
5669
5673
|
const g = Pe(i);
|
|
@@ -5671,7 +5675,7 @@ const qe = {
|
|
|
5671
5675
|
G(g);
|
|
5672
5676
|
return;
|
|
5673
5677
|
}
|
|
5674
|
-
G({}), ie >= 0 ?
|
|
5678
|
+
G({}), ie >= 0 ? L(ie) : await Oe();
|
|
5675
5679
|
}, Oe = async () => {
|
|
5676
5680
|
if (f) {
|
|
5677
5681
|
let i = {};
|
|
@@ -5684,32 +5688,32 @@ const qe = {
|
|
|
5684
5688
|
}
|
|
5685
5689
|
ye(!0), U(null);
|
|
5686
5690
|
try {
|
|
5687
|
-
if (!
|
|
5691
|
+
if (!N.externalRefId || N.externalRefId.trim() === "") {
|
|
5688
5692
|
U("External Reference ID is required. Please pass it via config.applicantForm.externalRefId.");
|
|
5689
5693
|
return;
|
|
5690
5694
|
}
|
|
5691
5695
|
const i = {
|
|
5692
|
-
workflowKey:
|
|
5693
|
-
externalRefId:
|
|
5696
|
+
workflowKey: N.workflowKey,
|
|
5697
|
+
externalRefId: N.externalRefId.trim()
|
|
5694
5698
|
};
|
|
5695
5699
|
if (f) {
|
|
5696
5700
|
for (const d of f)
|
|
5697
5701
|
if (Z(d)) {
|
|
5698
5702
|
for (const p of d.fields)
|
|
5699
5703
|
if (!p.isCustom && p.name) {
|
|
5700
|
-
const
|
|
5701
|
-
Ye(z) || (i[
|
|
5704
|
+
const I = p.name, z = N[I];
|
|
5705
|
+
Ye(z) || (i[I] = z);
|
|
5702
5706
|
}
|
|
5703
5707
|
}
|
|
5704
5708
|
for (const d of Ve)
|
|
5705
5709
|
if (i[d] === void 0) {
|
|
5706
|
-
const p =
|
|
5710
|
+
const p = N[d];
|
|
5707
5711
|
Ye(p) || (i[d] = p);
|
|
5708
5712
|
}
|
|
5709
5713
|
} else
|
|
5710
|
-
|
|
5714
|
+
b.forEach((d) => {
|
|
5711
5715
|
if (d === "externalRefId") return;
|
|
5712
|
-
const p =
|
|
5716
|
+
const p = N[d];
|
|
5713
5717
|
Ye(p) || (i[d] = p);
|
|
5714
5718
|
});
|
|
5715
5719
|
const g = [];
|
|
@@ -5718,17 +5722,17 @@ const qe = {
|
|
|
5718
5722
|
if (Z(d))
|
|
5719
5723
|
for (const p of d.fields) {
|
|
5720
5724
|
if (!p.isCustom || !p.paramName || p.customType === "paragraph" || p.customType === "html" || p.customType === "br" || p.customType === "link") continue;
|
|
5721
|
-
const
|
|
5725
|
+
const I = W[p.paramName] ?? "";
|
|
5722
5726
|
let z;
|
|
5723
5727
|
if (p.customType === "checkbox" || p.customType === "link_checkbox")
|
|
5724
|
-
z =
|
|
5725
|
-
else if (z =
|
|
5728
|
+
z = I === "true" ? "yes" : "no";
|
|
5729
|
+
else if (z = I, !z && !p.required) continue;
|
|
5726
5730
|
g.push({ paramName: p.paramName, value: z });
|
|
5727
5731
|
}
|
|
5728
5732
|
}
|
|
5729
5733
|
g.length > 0 && (i.applicantAdditionalDatas = g);
|
|
5730
|
-
const
|
|
5731
|
-
n(
|
|
5734
|
+
const x = await u(i);
|
|
5735
|
+
n(x.applicantId);
|
|
5732
5736
|
} catch (i) {
|
|
5733
5737
|
console.error("Error creating applicant:", i), U(i.message || "Failed to create applicant");
|
|
5734
5738
|
} finally {
|
|
@@ -5737,31 +5741,31 @@ const qe = {
|
|
|
5737
5741
|
}, Xe = async (i) => {
|
|
5738
5742
|
var g;
|
|
5739
5743
|
i.preventDefault();
|
|
5740
|
-
for (const
|
|
5741
|
-
if (Ye(
|
|
5742
|
-
const d = ((g = Me[
|
|
5744
|
+
for (const x of S)
|
|
5745
|
+
if (Ye(N[x])) {
|
|
5746
|
+
const d = ((g = Me[x]) == null ? void 0 : g.label) || x;
|
|
5743
5747
|
U(`${d} is required.`);
|
|
5744
5748
|
return;
|
|
5745
5749
|
}
|
|
5746
5750
|
await Oe();
|
|
5747
|
-
},
|
|
5751
|
+
}, xe = (i, g, x, d) => {
|
|
5748
5752
|
var q;
|
|
5749
5753
|
const p = Me[i];
|
|
5750
5754
|
if (!p) return null;
|
|
5751
|
-
const
|
|
5755
|
+
const I = S.includes(i), z = O[i], _ = x || p.label, y = g ?? i, ae = { required: I };
|
|
5752
5756
|
switch (p.type) {
|
|
5753
5757
|
case "select":
|
|
5754
5758
|
if (i === "country" || i === "nationality" || i === "taxCountry" || i === "countryOfBirth" || i === "mobileCountryCode") {
|
|
5755
|
-
const le =
|
|
5759
|
+
const le = E(i, d);
|
|
5756
5760
|
return /* @__PURE__ */ r(
|
|
5757
5761
|
Re,
|
|
5758
5762
|
{
|
|
5759
5763
|
...ae,
|
|
5760
5764
|
label: _,
|
|
5761
|
-
value:
|
|
5765
|
+
value: N[i] || "",
|
|
5762
5766
|
onChange: (Fe) => se(i, Fe),
|
|
5763
5767
|
options: [{ value: "", label: `Select ${_.toLowerCase()}...` }, ...le],
|
|
5764
|
-
disabled:
|
|
5768
|
+
disabled: R,
|
|
5765
5769
|
error: z
|
|
5766
5770
|
},
|
|
5767
5771
|
y
|
|
@@ -5773,7 +5777,7 @@ const qe = {
|
|
|
5773
5777
|
{
|
|
5774
5778
|
...ae,
|
|
5775
5779
|
label: _,
|
|
5776
|
-
value: ((q =
|
|
5780
|
+
value: ((q = N[i]) == null ? void 0 : q.toString()) || "",
|
|
5777
5781
|
onChange: (le) => se(i, le ? Number(le) : null),
|
|
5778
5782
|
options: [
|
|
5779
5783
|
{ value: "", label: "Select salutation..." },
|
|
@@ -5792,7 +5796,7 @@ const qe = {
|
|
|
5792
5796
|
{
|
|
5793
5797
|
...ae,
|
|
5794
5798
|
label: _,
|
|
5795
|
-
value:
|
|
5799
|
+
value: N[i] || "",
|
|
5796
5800
|
onChange: (Fe) => se(i, Fe),
|
|
5797
5801
|
options: [{ value: "", label: "Select language..." }, ...le],
|
|
5798
5802
|
error: z
|
|
@@ -5803,17 +5807,17 @@ const qe = {
|
|
|
5803
5807
|
return null;
|
|
5804
5808
|
case "multiselect":
|
|
5805
5809
|
if (i === "otherNationality") {
|
|
5806
|
-
const le =
|
|
5810
|
+
const le = E(i, d);
|
|
5807
5811
|
return /* @__PURE__ */ r(
|
|
5808
5812
|
Cr,
|
|
5809
5813
|
{
|
|
5810
5814
|
...ae,
|
|
5811
5815
|
label: _,
|
|
5812
|
-
value:
|
|
5816
|
+
value: N[i] || [],
|
|
5813
5817
|
onChange: (Fe) => se(i, Fe),
|
|
5814
5818
|
options: le,
|
|
5815
5819
|
placeholder: "Select other nationalities...",
|
|
5816
|
-
disabled:
|
|
5820
|
+
disabled: R
|
|
5817
5821
|
},
|
|
5818
5822
|
y
|
|
5819
5823
|
);
|
|
@@ -5826,7 +5830,7 @@ const qe = {
|
|
|
5826
5830
|
...ae,
|
|
5827
5831
|
type: "date",
|
|
5828
5832
|
label: _,
|
|
5829
|
-
value:
|
|
5833
|
+
value: N[i] || "",
|
|
5830
5834
|
onChange: (le) => se(i, le.target.value),
|
|
5831
5835
|
error: z
|
|
5832
5836
|
},
|
|
@@ -5839,7 +5843,7 @@ const qe = {
|
|
|
5839
5843
|
...ae,
|
|
5840
5844
|
type: "email",
|
|
5841
5845
|
label: _,
|
|
5842
|
-
value:
|
|
5846
|
+
value: N[i] || "",
|
|
5843
5847
|
onChange: (le) => se(i, le.target.value),
|
|
5844
5848
|
error: z
|
|
5845
5849
|
},
|
|
@@ -5852,7 +5856,7 @@ const qe = {
|
|
|
5852
5856
|
...ae,
|
|
5853
5857
|
type: "tel",
|
|
5854
5858
|
label: _,
|
|
5855
|
-
value:
|
|
5859
|
+
value: N[i] || "",
|
|
5856
5860
|
onChange: (le) => se(i, le.target.value),
|
|
5857
5861
|
error: z
|
|
5858
5862
|
},
|
|
@@ -5865,7 +5869,7 @@ const qe = {
|
|
|
5865
5869
|
...ae,
|
|
5866
5870
|
type: "text",
|
|
5867
5871
|
label: _,
|
|
5868
|
-
value:
|
|
5872
|
+
value: N[i] || "",
|
|
5869
5873
|
onChange: (le) => se(i, le.target.value),
|
|
5870
5874
|
error: z
|
|
5871
5875
|
},
|
|
@@ -5925,7 +5929,7 @@ const qe = {
|
|
|
5925
5929
|
) }, `custom-${g}`);
|
|
5926
5930
|
}
|
|
5927
5931
|
if (!i.paramName) return null;
|
|
5928
|
-
const
|
|
5932
|
+
const x = O[i.paramName], d = i.displayText || i.label || i.paramName;
|
|
5929
5933
|
if (i.customType === "checkbox")
|
|
5930
5934
|
return /* @__PURE__ */ o("div", { className: "flex flex-col gap-1", children: [
|
|
5931
5935
|
/* @__PURE__ */ o(
|
|
@@ -5958,7 +5962,7 @@ const qe = {
|
|
|
5958
5962
|
]
|
|
5959
5963
|
}
|
|
5960
5964
|
),
|
|
5961
|
-
|
|
5965
|
+
x && /* @__PURE__ */ r("p", { className: "text-red-500 text-xs mt-0.5", children: x })
|
|
5962
5966
|
] }, `custom-${g}`);
|
|
5963
5967
|
if (i.customType === "link_checkbox")
|
|
5964
5968
|
return /* @__PURE__ */ o("div", { className: "flex flex-col gap-1", children: [
|
|
@@ -6005,7 +6009,7 @@ const qe = {
|
|
|
6005
6009
|
]
|
|
6006
6010
|
}
|
|
6007
6011
|
),
|
|
6008
|
-
|
|
6012
|
+
x && /* @__PURE__ */ r("p", { className: "text-red-500 text-xs mt-0.5", children: x })
|
|
6009
6013
|
] }, `custom-${g}`);
|
|
6010
6014
|
if (i.customType === "group_checkbox") {
|
|
6011
6015
|
const p = (W[i.paramName] || "").split(",").filter(Boolean);
|
|
@@ -6021,8 +6025,8 @@ const qe = {
|
|
|
6021
6025
|
]
|
|
6022
6026
|
}
|
|
6023
6027
|
),
|
|
6024
|
-
/* @__PURE__ */ r("div", { className: "metakyc-options-group", style: { display: "flex", flexDirection: "column", gap: "8px" }, children: (i.options || []).map((
|
|
6025
|
-
const z = i.singleSelect ? W[i.paramName] ===
|
|
6028
|
+
/* @__PURE__ */ r("div", { className: "metakyc-options-group", style: { display: "flex", flexDirection: "column", gap: "8px" }, children: (i.options || []).map((I) => {
|
|
6029
|
+
const z = i.singleSelect ? W[i.paramName] === I.value : p.includes(I.value);
|
|
6026
6030
|
return /* @__PURE__ */ o(
|
|
6027
6031
|
"label",
|
|
6028
6032
|
{
|
|
@@ -6036,9 +6040,9 @@ const qe = {
|
|
|
6036
6040
|
checked: z,
|
|
6037
6041
|
onChange: (_) => {
|
|
6038
6042
|
if (i.singleSelect)
|
|
6039
|
-
M(i.paramName, _.target.checked ?
|
|
6043
|
+
M(i.paramName, _.target.checked ? I.value : "");
|
|
6040
6044
|
else {
|
|
6041
|
-
const y = _.target.checked ? [...p,
|
|
6045
|
+
const y = _.target.checked ? [...p, I.value] : p.filter((ae) => ae !== I.value);
|
|
6042
6046
|
M(i.paramName, y.join(","));
|
|
6043
6047
|
}
|
|
6044
6048
|
},
|
|
@@ -6051,15 +6055,15 @@ const qe = {
|
|
|
6051
6055
|
{
|
|
6052
6056
|
className: "metakyc-option-text",
|
|
6053
6057
|
style: { fontSize: "14px", color: "var(--metakyc-text-primary, #111827)", lineHeight: "1.4" },
|
|
6054
|
-
children:
|
|
6058
|
+
children: I.label
|
|
6055
6059
|
}
|
|
6056
6060
|
)
|
|
6057
6061
|
]
|
|
6058
6062
|
},
|
|
6059
|
-
|
|
6063
|
+
I.value
|
|
6060
6064
|
);
|
|
6061
6065
|
}) }),
|
|
6062
|
-
|
|
6066
|
+
x && /* @__PURE__ */ r("p", { className: "text-red-500 text-xs", children: x })
|
|
6063
6067
|
] }, `custom-${g}`);
|
|
6064
6068
|
}
|
|
6065
6069
|
return i.customType === "radio_group" ? /* @__PURE__ */ o("div", { className: "flex flex-col gap-1.5", children: [
|
|
@@ -6103,7 +6107,7 @@ const qe = {
|
|
|
6103
6107
|
},
|
|
6104
6108
|
p.value
|
|
6105
6109
|
)) }),
|
|
6106
|
-
|
|
6110
|
+
x && /* @__PURE__ */ r("p", { className: "text-red-500 text-xs", children: x })
|
|
6107
6111
|
] }, `custom-${g}`) : /* @__PURE__ */ r(
|
|
6108
6112
|
de,
|
|
6109
6113
|
{
|
|
@@ -6112,12 +6116,12 @@ const qe = {
|
|
|
6112
6116
|
value: W[i.paramName] || "",
|
|
6113
6117
|
onChange: (p) => M(i.paramName, p.target.value),
|
|
6114
6118
|
required: i.required,
|
|
6115
|
-
error:
|
|
6119
|
+
error: x
|
|
6116
6120
|
},
|
|
6117
6121
|
`custom-${g}`
|
|
6118
6122
|
);
|
|
6119
6123
|
}, tt = (i, g) => {
|
|
6120
|
-
const
|
|
6124
|
+
const x = Z(i);
|
|
6121
6125
|
return /* @__PURE__ */ o("div", { className: "space-y-4", children: [
|
|
6122
6126
|
i.conditionalOn && /* @__PURE__ */ r(pt, { helpText: i.conditionalHelpText, children: /* @__PURE__ */ o(
|
|
6123
6127
|
"label",
|
|
@@ -6129,7 +6133,7 @@ const qe = {
|
|
|
6129
6133
|
"input",
|
|
6130
6134
|
{
|
|
6131
6135
|
type: "checkbox",
|
|
6132
|
-
checked:
|
|
6136
|
+
checked: x,
|
|
6133
6137
|
onChange: (d) => M(i.conditionalOn, d.target.checked ? "true" : "false"),
|
|
6134
6138
|
className: "metakyc-option-input",
|
|
6135
6139
|
style: qe
|
|
@@ -6146,19 +6150,19 @@ const qe = {
|
|
|
6146
6150
|
]
|
|
6147
6151
|
}
|
|
6148
6152
|
) }),
|
|
6149
|
-
|
|
6150
|
-
const
|
|
6151
|
-
return /* @__PURE__ */ r("div", { className:
|
|
6153
|
+
x && /* @__PURE__ */ r("div", { className: "grid grid-cols-4 gap-4", children: i.fields.map((d, p) => {
|
|
6154
|
+
const I = d.colSpan === 1 ? "col-span-1" : d.colSpan === 2 ? "col-span-2" : d.colSpan === 3 ? "col-span-3" : "col-span-4", z = d.isCustom ? `custom-${p}-${d.paramName}` : `builtin-${d.name}-${p}`;
|
|
6155
|
+
return /* @__PURE__ */ r("div", { className: I, children: /* @__PURE__ */ r(pt, { helpText: d.helpText, children: d.isCustom ? et(d, p) : xe(d.name, z, d.displayText, d.countriesType) }) }, z);
|
|
6152
6156
|
}) })
|
|
6153
6157
|
] });
|
|
6154
6158
|
};
|
|
6155
|
-
if (!c ||
|
|
6159
|
+
if (!c || R)
|
|
6156
6160
|
return /* @__PURE__ */ r("div", { className: "metakyc-sdk", children: /* @__PURE__ */ r(j, { children: /* @__PURE__ */ o(K, { children: [
|
|
6157
6161
|
/* @__PURE__ */ r(we, { className: "my-8" }),
|
|
6158
6162
|
/* @__PURE__ */ r("p", { className: "text-center mt-4", style: { color: "var(--metakyc-text-secondary, #6b7280)", fontSize: "0.875rem" }, children: "Loading form…" })
|
|
6159
6163
|
] }) }) });
|
|
6160
6164
|
if (f) {
|
|
6161
|
-
const i = f[B] ?? f[0], g = Ae === -1,
|
|
6165
|
+
const i = f[B] ?? f[0], g = Ae === -1, x = ie === -1, d = f.length, p = Z(i), I = Object.values(O);
|
|
6162
6166
|
return /* @__PURE__ */ r("div", { className: "metakyc-sdk", children: /* @__PURE__ */ o(j, { children: [
|
|
6163
6167
|
/* @__PURE__ */ r(ue, { children: /* @__PURE__ */ r(at, { title: (c == null ? void 0 : c.title) || "Create Applicant" }) }),
|
|
6164
6168
|
/* @__PURE__ */ o(K, { children: [
|
|
@@ -6188,13 +6192,13 @@ const qe = {
|
|
|
6188
6192
|
}
|
|
6189
6193
|
)
|
|
6190
6194
|
] }),
|
|
6191
|
-
(
|
|
6192
|
-
|
|
6195
|
+
(A || I.length > 0) && /* @__PURE__ */ o("div", { className: "mb-4 p-3 bg-red-50 border border-red-200 rounded-lg", children: [
|
|
6196
|
+
A && /* @__PURE__ */ o("p", { className: "text-red-600 text-sm", children: [
|
|
6193
6197
|
/* @__PURE__ */ r("strong", { children: "Error:" }),
|
|
6194
6198
|
" ",
|
|
6195
|
-
|
|
6199
|
+
A
|
|
6196
6200
|
] }),
|
|
6197
|
-
|
|
6201
|
+
I.map((z, _) => /* @__PURE__ */ r("p", { className: "text-red-600 text-sm", children: z }, _))
|
|
6198
6202
|
] }),
|
|
6199
6203
|
d > 1 && /* @__PURE__ */ o("div", { className: "flex items-center gap-2 mb-4", children: [
|
|
6200
6204
|
f.map((z, _) => /* @__PURE__ */ r(
|
|
@@ -6221,7 +6225,7 @@ const qe = {
|
|
|
6221
6225
|
type: "button",
|
|
6222
6226
|
variant: "outline",
|
|
6223
6227
|
onClick: () => {
|
|
6224
|
-
|
|
6228
|
+
L(Ae), G({});
|
|
6225
6229
|
},
|
|
6226
6230
|
disabled: te || h,
|
|
6227
6231
|
children: "Previous"
|
|
@@ -6234,8 +6238,8 @@ const qe = {
|
|
|
6234
6238
|
{
|
|
6235
6239
|
type: "button",
|
|
6236
6240
|
isLoading: te || h,
|
|
6237
|
-
onClick:
|
|
6238
|
-
children:
|
|
6241
|
+
onClick: x ? Oe : pe,
|
|
6242
|
+
children: x ? i.conditionalOn && !p ? "Skip & Submit" : "Submit" : i.conditionalOn && !p ? "Skip" : "Next"
|
|
6239
6243
|
}
|
|
6240
6244
|
)
|
|
6241
6245
|
] })
|
|
@@ -6244,19 +6248,19 @@ const qe = {
|
|
|
6244
6248
|
return /* @__PURE__ */ r("div", { className: "metakyc-sdk", children: /* @__PURE__ */ r("form", { onSubmit: Xe, children: /* @__PURE__ */ o(j, { children: [
|
|
6245
6249
|
/* @__PURE__ */ r(ue, { children: /* @__PURE__ */ r(at, { title: (c == null ? void 0 : c.title) || "Create Applicant" }) }),
|
|
6246
6250
|
/* @__PURE__ */ o(K, { children: [
|
|
6247
|
-
|
|
6251
|
+
A && /* @__PURE__ */ r("div", { className: "mb-6 p-4 bg-red-50 border border-red-200 rounded-lg", children: /* @__PURE__ */ o("p", { className: "text-red-600 text-sm", children: [
|
|
6248
6252
|
/* @__PURE__ */ r("strong", { children: "Error:" }),
|
|
6249
6253
|
" ",
|
|
6250
|
-
|
|
6254
|
+
A
|
|
6251
6255
|
] }) }),
|
|
6252
|
-
/* @__PURE__ */ r("div", { className: "grid grid-cols-4 gap-4", children:
|
|
6256
|
+
/* @__PURE__ */ r("div", { className: "grid grid-cols-4 gap-4", children: b.map((i) => /* @__PURE__ */ r("div", { className: "col-span-4", children: xe(i) }, i)) })
|
|
6253
6257
|
] }),
|
|
6254
6258
|
/* @__PURE__ */ o(me, { className: "flex justify-between", children: [
|
|
6255
6259
|
a && /* @__PURE__ */ r(Q, { type: "button", variant: "outline", onClick: a, disabled: te || h, children: "Cancel" }),
|
|
6256
6260
|
/* @__PURE__ */ r(Q, { type: "submit", isLoading: te || h, children: "Create Applicant" })
|
|
6257
6261
|
] })
|
|
6258
6262
|
] }) }) });
|
|
6259
|
-
},
|
|
6263
|
+
}, xn = ({
|
|
6260
6264
|
applicantId: e,
|
|
6261
6265
|
onComplete: t,
|
|
6262
6266
|
onError: n,
|
|
@@ -6270,20 +6274,20 @@ const qe = {
|
|
|
6270
6274
|
workflowKey: h,
|
|
6271
6275
|
nextWorkflowKey: m,
|
|
6272
6276
|
hasWorkflowChanged: v,
|
|
6273
|
-
isLoading:
|
|
6277
|
+
isLoading: C,
|
|
6274
6278
|
error: f,
|
|
6275
|
-
moveBack:
|
|
6276
|
-
refreshProgress:
|
|
6277
|
-
} =
|
|
6278
|
-
if (
|
|
6279
|
+
moveBack: S,
|
|
6280
|
+
refreshProgress: b
|
|
6281
|
+
} = br(e), [D, F] = be.useState(!1);
|
|
6282
|
+
if (be.useEffect(() => {
|
|
6279
6283
|
f && n && n(f);
|
|
6280
|
-
}, [f, n]),
|
|
6284
|
+
}, [f, n]), be.useEffect(() => {
|
|
6281
6285
|
l != null && l.workflowResult && t && t(l.workflowResult);
|
|
6282
|
-
}, [l == null ? void 0 : l.workflowResult, t]),
|
|
6286
|
+
}, [l == null ? void 0 : l.workflowResult, t]), be.useEffect(() => {
|
|
6283
6287
|
a === "dark" ? document.documentElement.classList.add("dark") : document.documentElement.classList.remove("dark");
|
|
6284
|
-
}, [a]),
|
|
6288
|
+
}, [a]), be.useEffect(() => {
|
|
6285
6289
|
v && F(!1);
|
|
6286
|
-
}, [v]),
|
|
6290
|
+
}, [v]), C || !l)
|
|
6287
6291
|
return /* @__PURE__ */ r("div", { className: s, children: /* @__PURE__ */ r(j, { children: /* @__PURE__ */ o(K, { children: [
|
|
6288
6292
|
/* @__PURE__ */ r(we, { className: "my-8" }),
|
|
6289
6293
|
/* @__PURE__ */ r("p", { className: "text-center text-gray-600 dark:text-gray-400 mt-4", children: "Loading workflow..." })
|
|
@@ -6340,8 +6344,8 @@ const qe = {
|
|
|
6340
6344
|
/* @__PURE__ */ r(we, { className: "my-8" }),
|
|
6341
6345
|
/* @__PURE__ */ r("p", { className: "text-center text-gray-600 dark:text-gray-400 mt-4", children: l.status === ke.IdentityPending ? "Loading identity verification..." : "Loading current step..." })
|
|
6342
6346
|
] }) }) });
|
|
6343
|
-
const
|
|
6344
|
-
switch (
|
|
6347
|
+
const P = (T) => {
|
|
6348
|
+
switch (T) {
|
|
6345
6349
|
case J.Overview:
|
|
6346
6350
|
return "Overview";
|
|
6347
6351
|
case J.Questionaries:
|
|
@@ -6364,7 +6368,7 @@ const qe = {
|
|
|
6364
6368
|
return "";
|
|
6365
6369
|
}
|
|
6366
6370
|
}, $ = () => {
|
|
6367
|
-
const
|
|
6371
|
+
const T = u.filter((N) => N.visibility !== !1), Y = T.findIndex((N) => N.order === c.order), X = Y >= 0 ? Y + 1 : 1, E = T.length;
|
|
6368
6372
|
return /* @__PURE__ */ o("div", { className: "mb-6", children: [
|
|
6369
6373
|
/* @__PURE__ */ o("div", { className: "flex items-start justify-between mb-4", children: [
|
|
6370
6374
|
/* @__PURE__ */ r(at, {}),
|
|
@@ -6372,19 +6376,19 @@ const qe = {
|
|
|
6372
6376
|
"Step ",
|
|
6373
6377
|
X,
|
|
6374
6378
|
" of ",
|
|
6375
|
-
|
|
6379
|
+
E
|
|
6376
6380
|
] })
|
|
6377
6381
|
] }),
|
|
6378
|
-
/* @__PURE__ */ r("div", { className: "flex items-center", children:
|
|
6379
|
-
const W = H < Y,
|
|
6380
|
-
return /* @__PURE__ */ o(
|
|
6382
|
+
/* @__PURE__ */ r("div", { className: "flex items-center", children: T.map((N, H) => {
|
|
6383
|
+
const W = H < Y, w = N.order === c.order;
|
|
6384
|
+
return /* @__PURE__ */ o(be.Fragment, { children: [
|
|
6381
6385
|
/* @__PURE__ */ o("div", { className: "flex items-center", children: [
|
|
6382
6386
|
/* @__PURE__ */ r(
|
|
6383
6387
|
"div",
|
|
6384
6388
|
{
|
|
6385
6389
|
className: `
|
|
6386
6390
|
w-8 h-8 rounded-full flex items-center justify-center text-sm font-medium
|
|
6387
|
-
${W ||
|
|
6391
|
+
${W || w ? "bg-primary-500 text-white" : "bg-gray-200 text-gray-600 dark:bg-gray-700 dark:text-gray-400"}
|
|
6388
6392
|
`,
|
|
6389
6393
|
children: H + 1
|
|
6390
6394
|
}
|
|
@@ -6392,44 +6396,44 @@ const qe = {
|
|
|
6392
6396
|
/* @__PURE__ */ r(
|
|
6393
6397
|
"span",
|
|
6394
6398
|
{
|
|
6395
|
-
className: `ml-2 text-sm ${
|
|
6396
|
-
children:
|
|
6399
|
+
className: `ml-2 text-sm ${w ? "font-semibold text-gray-900 dark:text-white" : "text-gray-600 dark:text-gray-400"}`,
|
|
6400
|
+
children: N.displayName || N.name || P(N.action) || `Step ${H + 1}`
|
|
6397
6401
|
}
|
|
6398
6402
|
)
|
|
6399
6403
|
] }),
|
|
6400
|
-
H <
|
|
6404
|
+
H < T.length - 1 && /* @__PURE__ */ r(
|
|
6401
6405
|
"div",
|
|
6402
6406
|
{
|
|
6403
6407
|
className: `flex-1 h-0.5 mx-4 ${W ? "bg-primary-500" : "bg-gray-200 dark:bg-gray-700"}`
|
|
6404
6408
|
}
|
|
6405
6409
|
)
|
|
6406
|
-
] },
|
|
6410
|
+
] }, N.order);
|
|
6407
6411
|
}) })
|
|
6408
6412
|
] });
|
|
6409
|
-
},
|
|
6410
|
-
const
|
|
6413
|
+
}, R = () => {
|
|
6414
|
+
const T = {
|
|
6411
6415
|
applicantId: e,
|
|
6412
6416
|
onComplete: async () => {
|
|
6413
|
-
await
|
|
6417
|
+
await b();
|
|
6414
6418
|
},
|
|
6415
|
-
onBack: c.order > 0 ?
|
|
6419
|
+
onBack: c.order > 0 ? S : void 0
|
|
6416
6420
|
};
|
|
6417
6421
|
switch (c.action) {
|
|
6418
6422
|
case J.Questionaries:
|
|
6419
|
-
return /* @__PURE__ */ r($r, { ...
|
|
6423
|
+
return /* @__PURE__ */ r($r, { ...T });
|
|
6420
6424
|
case J.UploadDocument:
|
|
6421
|
-
return /* @__PURE__ */ r(Br, { ...
|
|
6425
|
+
return /* @__PURE__ */ r(Br, { ...T });
|
|
6422
6426
|
case J.Overview:
|
|
6423
|
-
return /* @__PURE__ */ r(_r, { ...
|
|
6427
|
+
return /* @__PURE__ */ r(_r, { ...T });
|
|
6424
6428
|
case J.IdentitySdk:
|
|
6425
|
-
return /* @__PURE__ */ r(Jr, { ...
|
|
6429
|
+
return /* @__PURE__ */ r(Jr, { ...T });
|
|
6426
6430
|
case J.RiskScoring:
|
|
6427
|
-
return /* @__PURE__ */ r(qr, { ...
|
|
6431
|
+
return /* @__PURE__ */ r(qr, { ...T });
|
|
6428
6432
|
case J.AdditionalData:
|
|
6429
6433
|
case J.InvestorCategorization:
|
|
6430
|
-
return /* @__PURE__ */ r(Gr, { ...
|
|
6434
|
+
return /* @__PURE__ */ r(Gr, { ...T });
|
|
6431
6435
|
case J.AppropriatenessTest:
|
|
6432
|
-
return /* @__PURE__ */ r(Vr, { ...
|
|
6436
|
+
return /* @__PURE__ */ r(Vr, { ...T });
|
|
6433
6437
|
case J.ManualReview:
|
|
6434
6438
|
return /* @__PURE__ */ r(
|
|
6435
6439
|
mt,
|
|
@@ -6456,7 +6460,7 @@ const qe = {
|
|
|
6456
6460
|
};
|
|
6457
6461
|
return /* @__PURE__ */ o("div", { className: `metakyc-sdk ${s || ""}`, children: [
|
|
6458
6462
|
$(),
|
|
6459
|
-
|
|
6463
|
+
R()
|
|
6460
6464
|
] });
|
|
6461
6465
|
};
|
|
6462
6466
|
function vn(e) {
|
|
@@ -6524,15 +6528,15 @@ export {
|
|
|
6524
6528
|
me as CardFooter,
|
|
6525
6529
|
ue as CardHeader,
|
|
6526
6530
|
$e as CountriesType,
|
|
6527
|
-
|
|
6531
|
+
bn as CreateApplicantForm,
|
|
6528
6532
|
Ot as CriteriaBuiltInType,
|
|
6529
6533
|
zt as DEFAULT_VISIBLE_FIELDS,
|
|
6530
|
-
|
|
6534
|
+
Lt as DocumentReviewStatus,
|
|
6531
6535
|
_t as EndpointBuilder,
|
|
6532
6536
|
Ke as ErrorHandler,
|
|
6533
6537
|
ar as EventEmitter,
|
|
6534
6538
|
Me as FIELD_METADATA,
|
|
6535
|
-
|
|
6539
|
+
Tt as FileType,
|
|
6536
6540
|
Ar as FileUpload,
|
|
6537
6541
|
Ze as GenderType,
|
|
6538
6542
|
at as Header,
|
|
@@ -6547,9 +6551,9 @@ export {
|
|
|
6547
6551
|
fe as InvestorCategorizationType,
|
|
6548
6552
|
$t as InvestorCategoryType,
|
|
6549
6553
|
Pt as KycProcessStatus,
|
|
6550
|
-
|
|
6554
|
+
Le as KycStatus,
|
|
6551
6555
|
mt as KycStatusDisplay,
|
|
6552
|
-
|
|
6556
|
+
xn as KycWorkflow,
|
|
6553
6557
|
Zr as Logo,
|
|
6554
6558
|
gt as MetaKYCContext,
|
|
6555
6559
|
Ne as MetaKYCError,
|
|
@@ -6614,10 +6618,10 @@ export {
|
|
|
6614
6618
|
Sr as useApplicant,
|
|
6615
6619
|
fn as useAppropriatenessTest,
|
|
6616
6620
|
wr as useIdentityVerification,
|
|
6617
|
-
|
|
6621
|
+
br as useKycWorkflow,
|
|
6618
6622
|
ge as useMetaKYC,
|
|
6619
6623
|
kr as useOverview,
|
|
6620
|
-
|
|
6624
|
+
xr as useQuestionnaire,
|
|
6621
6625
|
Nr as useRiskScoring,
|
|
6622
6626
|
vr as useUploadDocument,
|
|
6623
6627
|
mn as validateFileSize,
|