@vpdev2/metakyc-sdk 1.0.73 → 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/components/steps/RiskScoringStep.d.ts.map +1 -1
- package/dist/index.cjs +13 -13
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +1126 -1100
- 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/risk-scoring.d.ts +2 -1
- package/dist/types/risk-scoring.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
9
|
import { useForm as At, Controller as Te } from "react-hook-form";
|
|
10
|
-
import { z as
|
|
11
|
-
var
|
|
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 || {}), 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,
|
|
@@ -1177,7 +1177,7 @@ class sr {
|
|
|
1177
1177
|
async loadStepData(t, n) {
|
|
1178
1178
|
const a = this.getHandler(t);
|
|
1179
1179
|
if (!a)
|
|
1180
|
-
throw new Error(`No handler registered for step action: ${
|
|
1180
|
+
throw new Error(`No handler registered for step action: ${J[t]}`);
|
|
1181
1181
|
return a.loadData(n);
|
|
1182
1182
|
}
|
|
1183
1183
|
/**
|
|
@@ -1186,7 +1186,7 @@ class sr {
|
|
|
1186
1186
|
async submitStepData(t, n) {
|
|
1187
1187
|
const a = this.getHandler(t);
|
|
1188
1188
|
if (!a)
|
|
1189
|
-
throw new Error(`No handler registered for step action: ${
|
|
1189
|
+
throw new Error(`No handler registered for step action: ${J[t]}`);
|
|
1190
1190
|
return a.submitData(n);
|
|
1191
1191
|
}
|
|
1192
1192
|
}
|
|
@@ -1200,47 +1200,47 @@ class or {
|
|
|
1200
1200
|
* Register all step handlers
|
|
1201
1201
|
*/
|
|
1202
1202
|
registerStepHandlers() {
|
|
1203
|
-
this.stepRouter.registerHandler(
|
|
1203
|
+
this.stepRouter.registerHandler(J.Questionaries, {
|
|
1204
1204
|
loadData: (t) => this.questionnaireService.getQuestionnaire(t),
|
|
1205
1205
|
submitData: async (t) => {
|
|
1206
1206
|
await this.questionnaireService.fillQuestionnaire(t);
|
|
1207
1207
|
}
|
|
1208
|
-
}), this.stepRouter.registerHandler(
|
|
1208
|
+
}), this.stepRouter.registerHandler(J.UploadDocument, {
|
|
1209
1209
|
loadData: (t) => this.uploadDocumentService.getUploadDocument(t),
|
|
1210
1210
|
submitData: (t) => this.uploadDocumentService.fillUploadDocument(t)
|
|
1211
|
-
}), this.stepRouter.registerHandler(
|
|
1211
|
+
}), this.stepRouter.registerHandler(J.AppropriatenessTest, {
|
|
1212
1212
|
loadData: (t) => this.appropriatenessTestService.getAppropriatenessTest(t),
|
|
1213
1213
|
submitData: async (t) => {
|
|
1214
1214
|
await this.appropriatenessTestService.fillAppropriatenessTest(t);
|
|
1215
1215
|
}
|
|
1216
|
-
}), this.stepRouter.registerHandler(
|
|
1216
|
+
}), this.stepRouter.registerHandler(J.Overview, {
|
|
1217
1217
|
loadData: (t) => this.overviewService.getOverviewData(t),
|
|
1218
1218
|
submitData: (t) => this.overviewService.passOverview(t.applicantId)
|
|
1219
|
-
}), this.stepRouter.registerHandler(
|
|
1219
|
+
}), this.stepRouter.registerHandler(J.RiskScoring, {
|
|
1220
1220
|
loadData: (t) => this.riskScoringService.getRiskCriterias(t),
|
|
1221
1221
|
submitData: async (t) => {
|
|
1222
1222
|
await this.riskScoringService.submitRiskScoring(t);
|
|
1223
1223
|
}
|
|
1224
|
-
}), this.stepRouter.registerHandler(
|
|
1224
|
+
}), this.stepRouter.registerHandler(J.IdentitySdk, {
|
|
1225
1225
|
loadData: async (t) => ({
|
|
1226
1226
|
applicantId: t,
|
|
1227
1227
|
message: "Identity verification required"
|
|
1228
1228
|
}),
|
|
1229
1229
|
submitData: async () => {
|
|
1230
1230
|
}
|
|
1231
|
-
}), this.stepRouter.registerHandler(
|
|
1231
|
+
}), this.stepRouter.registerHandler(J.InvestorCategorization, {
|
|
1232
1232
|
loadData: (t) => this.investorCategorizationService.getInvestorCategorization(t),
|
|
1233
1233
|
submitData: async (t) => {
|
|
1234
1234
|
await this.investorCategorizationService.setInvestorCategorization(t);
|
|
1235
1235
|
}
|
|
1236
|
-
}), this.stepRouter.registerHandler(
|
|
1236
|
+
}), this.stepRouter.registerHandler(J.ManualReview, {
|
|
1237
1237
|
loadData: async (t) => ({
|
|
1238
1238
|
applicantId: t,
|
|
1239
1239
|
message: "Your application is under manual review"
|
|
1240
1240
|
}),
|
|
1241
1241
|
submitData: async () => {
|
|
1242
1242
|
}
|
|
1243
|
-
}), this.stepRouter.registerHandler(
|
|
1243
|
+
}), this.stepRouter.registerHandler(J.AdditionalData, {
|
|
1244
1244
|
loadData: async (t) => ({
|
|
1245
1245
|
applicantId: t,
|
|
1246
1246
|
message: "Additional data required"
|
|
@@ -1344,10 +1344,10 @@ function ht(e, t) {
|
|
|
1344
1344
|
s.src = e, t && (s.id = t), s.async = !0, s.onload = () => n(), s.onerror = () => a(new Error(`Failed to load script: ${e}`)), document.head.appendChild(s);
|
|
1345
1345
|
});
|
|
1346
1346
|
}
|
|
1347
|
-
function
|
|
1347
|
+
function cn(e) {
|
|
1348
1348
|
return !!document.getElementById(e);
|
|
1349
1349
|
}
|
|
1350
|
-
function
|
|
1350
|
+
function dn(e) {
|
|
1351
1351
|
const t = document.getElementById(e);
|
|
1352
1352
|
t && t.remove();
|
|
1353
1353
|
}
|
|
@@ -1551,10 +1551,10 @@ class dr {
|
|
|
1551
1551
|
console.log(`[SardinAI] Device ID: ${u.deviceId}`);
|
|
1552
1552
|
},
|
|
1553
1553
|
// New callback for session updates
|
|
1554
|
-
onConfigUpdate: (u, h,
|
|
1554
|
+
onConfigUpdate: (u, h, m) => {
|
|
1555
1555
|
switch (u) {
|
|
1556
1556
|
case "SESSION_UPDATE_FAILED":
|
|
1557
|
-
console.error("[SardinAI] Session update failed:",
|
|
1557
|
+
console.error("[SardinAI] Session update failed:", m);
|
|
1558
1558
|
break;
|
|
1559
1559
|
case "SESSION_UPDATED":
|
|
1560
1560
|
console.log("[SardinAI] Session updated:", h);
|
|
@@ -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);
|
|
@@ -1796,24 +1800,24 @@ class ur {
|
|
|
1796
1800
|
return t.replace(/([a-z0-9])([A-Z])/g, "$1-$2").toLowerCase();
|
|
1797
1801
|
}
|
|
1798
1802
|
}
|
|
1799
|
-
const gt = Nt(null),
|
|
1800
|
-
const [n, a] =
|
|
1801
|
-
const h = new Ht(e),
|
|
1803
|
+
const gt = Nt(null), un = ({ config: e, children: t }) => {
|
|
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
|
-
applicantService:
|
|
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
|
-
baseInformationService:
|
|
1812
|
-
investorCategorizationService:
|
|
1813
|
-
themeService:
|
|
1814
|
-
themeManager:
|
|
1815
|
+
baseInformationService: F,
|
|
1816
|
+
investorCategorizationService: P,
|
|
1817
|
+
themeService: $,
|
|
1818
|
+
themeManager: R
|
|
1815
1819
|
};
|
|
1816
|
-
}, [e]), u =
|
|
1820
|
+
}, [e]), u = Ee(() => ({
|
|
1817
1821
|
config: e,
|
|
1818
1822
|
...c,
|
|
1819
1823
|
currentTheme: n,
|
|
@@ -1840,10 +1844,10 @@ const gt = Nt(null), ln = ({ config: e, children: t }) => {
|
|
|
1840
1844
|
return;
|
|
1841
1845
|
}
|
|
1842
1846
|
console.log("[MetaKYC] Fetching theme from backend...");
|
|
1843
|
-
const
|
|
1844
|
-
c.themeManager.applyTheme(
|
|
1845
|
-
} catch (
|
|
1846
|
-
console.warn("[MetaKYC] Failed to load theme, using default:",
|
|
1847
|
+
const m = await c.themeService.getThemeConfiguration();
|
|
1848
|
+
c.themeManager.applyTheme(m), a(c.themeManager.getCurrentTheme()), l.current = !0, console.log("[MetaKYC] Theme loaded and applied", m);
|
|
1849
|
+
} catch (m) {
|
|
1850
|
+
console.warn("[MetaKYC] Failed to load theme, using default:", m), a(c.themeManager.getCurrentTheme()), l.current = !0;
|
|
1847
1851
|
} finally {
|
|
1848
1852
|
s.current = !1;
|
|
1849
1853
|
}
|
|
@@ -1851,7 +1855,7 @@ const gt = Nt(null), ln = ({ config: e, children: t }) => {
|
|
|
1851
1855
|
c.themeManager.cleanup();
|
|
1852
1856
|
}), []), /* @__PURE__ */ r(gt.Provider, { value: u, children: t });
|
|
1853
1857
|
};
|
|
1854
|
-
function
|
|
1858
|
+
function ge() {
|
|
1855
1859
|
const e = St(gt);
|
|
1856
1860
|
if (!e)
|
|
1857
1861
|
throw new Error("useMetaKYC must be used within a MetaKYCProvider");
|
|
@@ -1866,10 +1870,10 @@ async function mr(e) {
|
|
|
1866
1870
|
}, a.onerror = (s) => n(s);
|
|
1867
1871
|
});
|
|
1868
1872
|
}
|
|
1869
|
-
function
|
|
1873
|
+
function mn(e, t) {
|
|
1870
1874
|
return e.size <= t;
|
|
1871
1875
|
}
|
|
1872
|
-
function
|
|
1876
|
+
function pn(e, t) {
|
|
1873
1877
|
return t.split(",").map((a) => a.trim()).some((a) => {
|
|
1874
1878
|
if (a.endsWith("/*")) {
|
|
1875
1879
|
const s = a.slice(0, -2);
|
|
@@ -1883,7 +1887,7 @@ function rt(e) {
|
|
|
1883
1887
|
const t = 1024, n = ["Bytes", "KB", "MB", "GB"], a = Math.floor(Math.log(e) / Math.log(t));
|
|
1884
1888
|
return Math.round(e / Math.pow(t, a) * 100) / 100 + " " + n[a];
|
|
1885
1889
|
}
|
|
1886
|
-
function
|
|
1890
|
+
function hn(e) {
|
|
1887
1891
|
return e;
|
|
1888
1892
|
}
|
|
1889
1893
|
function oe(...e) {
|
|
@@ -1922,7 +1926,7 @@ function yr(e) {
|
|
|
1922
1926
|
console.warn("Failed to save workflow state to storage:", t);
|
|
1923
1927
|
}
|
|
1924
1928
|
}
|
|
1925
|
-
function
|
|
1929
|
+
function gn() {
|
|
1926
1930
|
try {
|
|
1927
1931
|
const e = localStorage.getItem(Be.WORKFLOW_STATE);
|
|
1928
1932
|
return e ? JSON.parse(e) : null;
|
|
@@ -1937,45 +1941,45 @@ function fr() {
|
|
|
1937
1941
|
console.warn("Failed to clear workflow state from storage:", e);
|
|
1938
1942
|
}
|
|
1939
1943
|
}
|
|
1940
|
-
function
|
|
1944
|
+
function yn() {
|
|
1941
1945
|
gr(), fr();
|
|
1942
1946
|
}
|
|
1943
|
-
function
|
|
1944
|
-
const { createOrchestrator: t } =
|
|
1947
|
+
function br(e) {
|
|
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
|
|
1949
|
-
n &&
|
|
1950
|
-
applicantId:
|
|
1951
|
-
currentStepOrder: (
|
|
1952
|
+
var R;
|
|
1953
|
+
n && m && (pr(m), yr({
|
|
1954
|
+
applicantId: m,
|
|
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
|
-
}, [n,
|
|
1958
|
-
const v = ee(!1),
|
|
1959
|
-
if (!(!
|
|
1961
|
+
}, [n, m]);
|
|
1962
|
+
const v = ee(!1), C = ee(!1), f = V(async () => {
|
|
1963
|
+
if (!(!m || !h.current)) {
|
|
1960
1964
|
if (v.current) {
|
|
1961
1965
|
console.log("[Workflow] Load already in progress, skipping...");
|
|
1962
1966
|
return;
|
|
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
|
-
|
|
1977
|
-
}, [
|
|
1978
|
-
const
|
|
1980
|
+
m && !C.current && f();
|
|
1981
|
+
}, [m, f]);
|
|
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,116 +1987,116 @@ 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
|
}
|
|
2005
2009
|
}
|
|
2006
|
-
}, []), D =
|
|
2010
|
+
}, []), D = V(async () => {
|
|
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
|
-
}, []),
|
|
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
|
-
applicantId:
|
|
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,
|
|
2040
2044
|
nextWorkflowKey: n == null ? void 0 : n.nextWorkflowKey,
|
|
2041
|
-
hasWorkflowChanged:
|
|
2045
|
+
hasWorkflowChanged: $,
|
|
2042
2046
|
isLoading: s,
|
|
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
|
-
submitCurrentStep:
|
|
2053
|
+
submitCurrentStep: F,
|
|
2050
2054
|
orchestrator: h.current
|
|
2051
2055
|
};
|
|
2052
2056
|
}
|
|
2053
|
-
function
|
|
2054
|
-
const { questionnaireService: t, applicantService: n } =
|
|
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(
|
|
2068
|
-
const
|
|
2069
|
-
for (const N of
|
|
2070
|
-
N.question && ((
|
|
2071
|
-
const X = {},
|
|
2072
|
-
for (const N of
|
|
2073
|
-
const
|
|
2074
|
-
|
|
2071
|
+
if (s(R), (P = T == null ? void 0 : T.questionnaireResults) != null && P.length && R) {
|
|
2072
|
+
const Y = /* @__PURE__ */ new Map();
|
|
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
|
-
const
|
|
2090
|
-
async (
|
|
2093
|
+
const F = V(
|
|
2094
|
+
async (P) => {
|
|
2091
2095
|
v(!0), f(null);
|
|
2092
2096
|
try {
|
|
2093
|
-
return await t.fillQuestionnaire(
|
|
2094
|
-
} catch (
|
|
2095
|
-
throw f(
|
|
2097
|
+
return await t.fillQuestionnaire(P);
|
|
2098
|
+
} catch ($) {
|
|
2099
|
+
throw f($), $;
|
|
2096
2100
|
} finally {
|
|
2097
2101
|
v(!1);
|
|
2098
2102
|
}
|
|
@@ -2103,40 +2107,40 @@ function br(e) {
|
|
|
2103
2107
|
questionnaire: a,
|
|
2104
2108
|
initialAnswers: l,
|
|
2105
2109
|
isLoading: u,
|
|
2106
|
-
isSubmitting:
|
|
2107
|
-
error:
|
|
2110
|
+
isSubmitting: m,
|
|
2111
|
+
error: C,
|
|
2108
2112
|
load: D,
|
|
2109
|
-
submit:
|
|
2113
|
+
submit: F
|
|
2110
2114
|
};
|
|
2111
2115
|
}
|
|
2112
2116
|
function vr(e) {
|
|
2113
|
-
const { uploadDocumentService: t } =
|
|
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
|
-
const
|
|
2122
|
-
a(
|
|
2123
|
-
} catch (
|
|
2124
|
-
|
|
2125
|
+
const F = await t.getUploadDocument(e);
|
|
2126
|
+
a(F), S.current = e;
|
|
2127
|
+
} catch (F) {
|
|
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
|
-
const D =
|
|
2134
|
-
async (
|
|
2135
|
-
u(!0),
|
|
2137
|
+
const D = V(
|
|
2138
|
+
async (F) => {
|
|
2139
|
+
u(!0), m(0), C(null);
|
|
2136
2140
|
try {
|
|
2137
|
-
await t.fillUploadDocument(
|
|
2138
|
-
} catch (
|
|
2139
|
-
throw
|
|
2141
|
+
await t.fillUploadDocument(F), m(100);
|
|
2142
|
+
} catch (P) {
|
|
2143
|
+
throw C(P), P;
|
|
2140
2144
|
} finally {
|
|
2141
2145
|
u(!1);
|
|
2142
2146
|
}
|
|
@@ -2149,39 +2153,39 @@ 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
|
-
function
|
|
2157
|
-
const { appropriatenessTestService: t } =
|
|
2160
|
+
function fn(e) {
|
|
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...");
|
|
2161
2165
|
return;
|
|
2162
2166
|
}
|
|
2163
|
-
f.current = !0, l(!0),
|
|
2167
|
+
f.current = !0, l(!0), m(null);
|
|
2164
2168
|
try {
|
|
2165
|
-
const
|
|
2166
|
-
a(
|
|
2167
|
-
} catch (
|
|
2168
|
-
|
|
2169
|
+
const F = await t.getAppropriatenessTest(e);
|
|
2170
|
+
a(F), S.current = e;
|
|
2171
|
+
} catch (F) {
|
|
2172
|
+
m(F);
|
|
2169
2173
|
} finally {
|
|
2170
2174
|
l(!1), f.current = !1;
|
|
2171
2175
|
}
|
|
2172
2176
|
}
|
|
2173
2177
|
}, [e, t]);
|
|
2174
2178
|
ne(() => {
|
|
2175
|
-
e &&
|
|
2179
|
+
e && S.current !== e && b();
|
|
2176
2180
|
}, [e]);
|
|
2177
|
-
const D =
|
|
2178
|
-
async (
|
|
2179
|
-
u(!0),
|
|
2181
|
+
const D = V(
|
|
2182
|
+
async (F) => {
|
|
2183
|
+
u(!0), m(null);
|
|
2180
2184
|
try {
|
|
2181
|
-
const
|
|
2182
|
-
return
|
|
2183
|
-
} catch (
|
|
2184
|
-
throw
|
|
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,38 +2198,38 @@ function hn(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 } =
|
|
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...");
|
|
2206
2210
|
return;
|
|
2207
2211
|
}
|
|
2208
|
-
v.current = !0, l(!0),
|
|
2212
|
+
v.current = !0, l(!0), m(null);
|
|
2209
2213
|
try {
|
|
2210
|
-
const
|
|
2211
|
-
a(
|
|
2212
|
-
} catch (
|
|
2213
|
-
|
|
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
|
-
u(!0),
|
|
2228
|
+
u(!0), m(null);
|
|
2225
2229
|
try {
|
|
2226
2230
|
await t.passOverview(e);
|
|
2227
|
-
} catch (
|
|
2228
|
-
throw
|
|
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
|
-
const { identityService: t } =
|
|
2248
|
+
const { identityService: t } = ge(), [n, a] = k(
|
|
2245
2249
|
null
|
|
2246
|
-
), [s, l] =
|
|
2247
|
-
async (f,
|
|
2250
|
+
), [s, l] = k(!1), [c, u] = k(null), h = ee(!1), m = V(
|
|
2251
|
+
async (f, S) => {
|
|
2248
2252
|
if (e) {
|
|
2249
2253
|
if (h.current) {
|
|
2250
2254
|
console.log("[Identity] Request already in progress, skipping...");
|
|
@@ -2252,45 +2256,45 @@ 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
|
}
|
|
2270
2274
|
}
|
|
2271
2275
|
},
|
|
2272
2276
|
[e, t]
|
|
2273
|
-
), v =
|
|
2274
|
-
async (f,
|
|
2277
|
+
), v = V(
|
|
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 {
|
|
@@ -2321,14 +2325,14 @@ function wr(e) {
|
|
|
2321
2325
|
token: (n == null ? void 0 : n.publicProviderTokenObject) || null,
|
|
2322
2326
|
isLoading: s,
|
|
2323
2327
|
error: c,
|
|
2324
|
-
requestIdentity:
|
|
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 } =
|
|
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 =
|
|
2347
|
+
if (s(T), (R = Y == null ? void 0 : Y.riskScoringResults) != null && R.length) {
|
|
2348
|
+
const X = Y.riskScoringResults[0], E = {};
|
|
2345
2349
|
for (const N of X.riskCriteriaResults ?? [])
|
|
2346
2350
|
if (N.riskCriteriaId != null && N.answer != null && N.answer !== "") {
|
|
2347
|
-
const
|
|
2348
|
-
N.answer.split(",").map((
|
|
2351
|
+
const H = [...new Set(
|
|
2352
|
+
N.answer.split(",").map((W) => W.trim()).filter((W) => W !== "")
|
|
2349
2353
|
)];
|
|
2350
|
-
|
|
2354
|
+
H.length > 0 && (E[N.riskCriteriaId] = H);
|
|
2351
2355
|
}
|
|
2352
|
-
c(
|
|
2356
|
+
c(E);
|
|
2353
2357
|
}
|
|
2354
|
-
|
|
2355
|
-
} catch (
|
|
2356
|
-
f(
|
|
2358
|
+
F.current = e;
|
|
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 &&
|
|
2367
|
+
e && F.current !== e && P();
|
|
2364
2368
|
}, [e]);
|
|
2365
|
-
const
|
|
2366
|
-
async (
|
|
2369
|
+
const $ = V(
|
|
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
|
-
isSubmitting:
|
|
2385
|
-
error:
|
|
2386
|
-
load:
|
|
2387
|
-
submit:
|
|
2388
|
+
isSubmitting: m,
|
|
2389
|
+
error: C,
|
|
2390
|
+
load: P,
|
|
2391
|
+
submit: $
|
|
2388
2392
|
};
|
|
2389
2393
|
}
|
|
2390
2394
|
function Sr() {
|
|
2391
|
-
const { applicantService: e, config: t } =
|
|
2392
|
-
const
|
|
2393
|
-
return (
|
|
2394
|
-
}),
|
|
2395
|
-
async (
|
|
2396
|
-
var
|
|
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);
|
|
2398
|
+
}), m = V(
|
|
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 (
|
|
2402
|
-
const
|
|
2403
|
-
console.log("[SardinAI] Generated session key:",
|
|
2405
|
+
if (S.applicantAdditionalDatas || (S.applicantAdditionalDatas = []), (b = t.identityProviders) != null && b.sardinai) {
|
|
2406
|
+
const F = h();
|
|
2407
|
+
console.log("[SardinAI] Generated session key:", F), S.applicantAdditionalDatas.push({
|
|
2404
2408
|
paramName: "sessionKey",
|
|
2405
|
-
value:
|
|
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 {
|
|
@@ -2413,39 +2417,39 @@ function Sr() {
|
|
|
2413
2417
|
}
|
|
2414
2418
|
},
|
|
2415
2419
|
[e, t]
|
|
2416
|
-
), v =
|
|
2417
|
-
async (
|
|
2420
|
+
), v = V(
|
|
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
|
-
), f =
|
|
2443
|
-
async (
|
|
2446
|
+
), f = V(
|
|
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
|
}
|
|
@@ -2455,13 +2459,13 @@ function Sr() {
|
|
|
2455
2459
|
return {
|
|
2456
2460
|
isLoading: n,
|
|
2457
2461
|
error: s,
|
|
2458
|
-
createApplicant:
|
|
2462
|
+
createApplicant: m,
|
|
2459
2463
|
createCompanyApplicant: v,
|
|
2460
|
-
getApplicantData:
|
|
2464
|
+
getApplicantData: C,
|
|
2461
2465
|
stopProgress: f
|
|
2462
2466
|
};
|
|
2463
2467
|
}
|
|
2464
|
-
const
|
|
2468
|
+
const Q = ({
|
|
2465
2469
|
children: e,
|
|
2466
2470
|
variant: t = "primary",
|
|
2467
2471
|
size: n = "md",
|
|
@@ -2476,7 +2480,7 @@ const q = ({
|
|
|
2476
2480
|
outline: "border-2 border-primary-500 text-primary-500 hover:bg-primary-50 focus:ring-primary-500",
|
|
2477
2481
|
danger: "bg-danger-500 text-white hover:bg-danger-600 focus:ring-danger-500",
|
|
2478
2482
|
ghost: "text-gray-700 hover:bg-gray-100 focus:ring-gray-400"
|
|
2479
|
-
},
|
|
2483
|
+
}, m = {
|
|
2480
2484
|
sm: "px-3 py-1.5 text-sm",
|
|
2481
2485
|
md: "px-4 py-2 text-base",
|
|
2482
2486
|
lg: "px-6 py-3 text-lg"
|
|
@@ -2484,7 +2488,7 @@ const q = ({
|
|
|
2484
2488
|
return /* @__PURE__ */ o(
|
|
2485
2489
|
"button",
|
|
2486
2490
|
{
|
|
2487
|
-
className: oe(u, h[t],
|
|
2491
|
+
className: oe(u, h[t], m[n], l),
|
|
2488
2492
|
disabled: s || a,
|
|
2489
2493
|
...c,
|
|
2490
2494
|
children: [
|
|
@@ -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
|
|
@@ -2599,7 +2604,7 @@ const j = ({ children: e, className: t, ...n }) => /* @__PURE__ */ r(
|
|
|
2599
2604
|
...n,
|
|
2600
2605
|
children: e
|
|
2601
2606
|
}
|
|
2602
|
-
),
|
|
2607
|
+
), Ie = ({ children: e, variant: t = "default", className: n, ...a }) => /* @__PURE__ */ r(
|
|
2603
2608
|
"span",
|
|
2604
2609
|
{
|
|
2605
2610
|
className: oe(
|
|
@@ -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,
|
|
@@ -2698,18 +2702,18 @@ const j = ({ children: e, className: t, ...n }) => /* @__PURE__ */ r(
|
|
|
2698
2702
|
},
|
|
2699
2703
|
"__placeholder__"
|
|
2700
2704
|
),
|
|
2701
|
-
a.map((
|
|
2705
|
+
a.map((m, v) => /* @__PURE__ */ r(
|
|
2702
2706
|
"option",
|
|
2703
2707
|
{
|
|
2704
|
-
value:
|
|
2705
|
-
disabled:
|
|
2708
|
+
value: m.value,
|
|
2709
|
+
disabled: m.disabled,
|
|
2706
2710
|
style: {
|
|
2707
2711
|
backgroundColor: "var(--metakyc-input-bg, #ffffff)",
|
|
2708
|
-
color:
|
|
2712
|
+
color: m.disabled ? "var(--metakyc-text-muted, #9ca3af)" : "var(--metakyc-input-text, var(--metakyc-text-primary, #111827))"
|
|
2709
2713
|
},
|
|
2710
|
-
children:
|
|
2714
|
+
children: m.label
|
|
2711
2715
|
},
|
|
2712
|
-
|
|
2716
|
+
m.value || `option-${v}`
|
|
2713
2717
|
))
|
|
2714
2718
|
]
|
|
2715
2719
|
}
|
|
@@ -2728,72 +2732,72 @@ const ct = 280, Cr = ({
|
|
|
2728
2732
|
disabled: l = !1,
|
|
2729
2733
|
required: c = !1
|
|
2730
2734
|
}) => {
|
|
2731
|
-
const [u, h] =
|
|
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
|
-
|
|
2739
|
-
}, [l,
|
|
2741
|
+
const A = F();
|
|
2742
|
+
A && f(A), h(!0);
|
|
2743
|
+
}, [l, F]), $ = V(() => {
|
|
2740
2744
|
h(!1), v("");
|
|
2741
2745
|
}, []);
|
|
2742
2746
|
ne(() => {
|
|
2743
2747
|
if (!u) return;
|
|
2744
|
-
const
|
|
2745
|
-
var
|
|
2748
|
+
const A = (U) => {
|
|
2749
|
+
var ye, se;
|
|
2746
2750
|
const te = U.target;
|
|
2747
|
-
!((
|
|
2751
|
+
!((ye = S.current) != null && ye.contains(te)) && !((se = D.current) != null && se.contains(te)) && $();
|
|
2748
2752
|
};
|
|
2749
|
-
return document.addEventListener("mousedown",
|
|
2750
|
-
}, [u,
|
|
2753
|
+
return document.addEventListener("mousedown", A), () => document.removeEventListener("mousedown", A);
|
|
2754
|
+
}, [u, $]), ne(() => {
|
|
2751
2755
|
if (!u) return;
|
|
2752
|
-
const
|
|
2753
|
-
const U =
|
|
2756
|
+
const A = () => {
|
|
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
|
-
}, [u,
|
|
2760
|
-
const
|
|
2761
|
-
(
|
|
2762
|
-
),
|
|
2763
|
-
l || n(t.includes(
|
|
2764
|
-
},
|
|
2765
|
-
U.stopPropagation(), l || n(t.filter((te) => te !==
|
|
2766
|
-
}, X = (
|
|
2763
|
+
}, [u, F]);
|
|
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
|
-
border: `1px solid ${
|
|
2787
|
+
border: `1px solid ${H}`,
|
|
2784
2788
|
backgroundColor: N,
|
|
2785
2789
|
overflow: "hidden"
|
|
2786
2790
|
},
|
|
2787
2791
|
children: [
|
|
2788
|
-
/* @__PURE__ */ r("div", { style: { padding: "8px", borderBottom: `1px solid ${
|
|
2792
|
+
/* @__PURE__ */ r("div", { style: { padding: "8px", borderBottom: `1px solid ${H}` }, children: /* @__PURE__ */ r(
|
|
2789
2793
|
"input",
|
|
2790
2794
|
{
|
|
2791
2795
|
type: "text",
|
|
2792
|
-
value:
|
|
2793
|
-
onChange: (
|
|
2796
|
+
value: m,
|
|
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",
|
|
@@ -2801,20 +2805,20 @@ const ct = 280, Cr = ({
|
|
|
2801
2805
|
padding: "6px 8px",
|
|
2802
2806
|
fontSize: "13px",
|
|
2803
2807
|
borderRadius: "6px",
|
|
2804
|
-
border: `1px solid ${
|
|
2808
|
+
border: `1px solid ${H}`,
|
|
2805
2809
|
backgroundColor: N,
|
|
2806
|
-
color:
|
|
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,12 +2827,12 @@ const ct = 280, Cr = ({
|
|
|
2823
2827
|
padding: "8px 12px",
|
|
2824
2828
|
fontSize: "13px",
|
|
2825
2829
|
cursor: "pointer",
|
|
2826
|
-
backgroundColor: U ?
|
|
2827
|
-
color: U ?
|
|
2830
|
+
backgroundColor: U ? L : "transparent",
|
|
2831
|
+
color: U ? B : W,
|
|
2828
2832
|
userSelect: "none"
|
|
2829
2833
|
},
|
|
2830
2834
|
onMouseEnter: (te) => {
|
|
2831
|
-
U || (te.currentTarget.style.backgroundColor =
|
|
2835
|
+
U || (te.currentTarget.style.backgroundColor = O);
|
|
2832
2836
|
},
|
|
2833
2837
|
onMouseLeave: (te) => {
|
|
2834
2838
|
U || (te.currentTarget.style.backgroundColor = "transparent");
|
|
@@ -2840,16 +2844,16 @@ const ct = 280, Cr = ({
|
|
|
2840
2844
|
type: "checkbox",
|
|
2841
2845
|
checked: U,
|
|
2842
2846
|
readOnly: !0,
|
|
2843
|
-
style: { accentColor:
|
|
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
|
-
t.length > 0 && /* @__PURE__ */ r("div", { style: { padding: "6px 12px", borderTop: `1px solid ${
|
|
2856
|
+
t.length > 0 && /* @__PURE__ */ r("div", { style: { padding: "6px 12px", borderTop: `1px solid ${H}` }, children: /* @__PURE__ */ o(
|
|
2853
2857
|
"button",
|
|
2854
2858
|
{
|
|
2855
2859
|
type: "button",
|
|
@@ -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) =>
|
|
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",
|
|
@@ -2956,7 +2960,7 @@ const ct = 280, Cr = ({
|
|
|
2956
2960
|
]
|
|
2957
2961
|
}
|
|
2958
2962
|
),
|
|
2959
|
-
typeof document < "u" &&
|
|
2963
|
+
typeof document < "u" && G ? it(G, document.body) : null
|
|
2960
2964
|
] });
|
|
2961
2965
|
}, dt = 260, Re = ({
|
|
2962
2966
|
label: e,
|
|
@@ -2968,78 +2972,78 @@ const ct = 280, Cr = ({
|
|
|
2968
2972
|
onChange: c,
|
|
2969
2973
|
disabled: u = !1,
|
|
2970
2974
|
required: h = !1,
|
|
2971
|
-
className:
|
|
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,
|
|
2980
2984
|
width: M.width,
|
|
2981
2985
|
openUp: ie
|
|
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) => {
|
|
2993
|
-
var
|
|
2997
|
+
var Ae, Pe;
|
|
2994
2998
|
const ie = Z.target;
|
|
2995
|
-
!((
|
|
2999
|
+
!((Ae = F.current) != null && Ae.contains(ie)) && !((Pe = $.current) != null && Pe.contains(ie)) && X();
|
|
2996
3000
|
};
|
|
2997
3001
|
return document.addEventListener("mousedown", M), () => document.removeEventListener("mousedown", M);
|
|
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
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
|
-
ref:
|
|
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 ${
|
|
3032
|
-
backgroundColor:
|
|
3035
|
+
border: `1px solid ${L}`,
|
|
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,9 +3053,9 @@ const ct = 280, Cr = ({
|
|
|
3049
3053
|
padding: "6px 8px",
|
|
3050
3054
|
fontSize: "13px",
|
|
3051
3055
|
borderRadius: "6px",
|
|
3052
|
-
border: `1px solid ${
|
|
3053
|
-
backgroundColor:
|
|
3054
|
-
color:
|
|
3056
|
+
border: `1px solid ${L}`,
|
|
3057
|
+
backgroundColor: B,
|
|
3058
|
+
color: O,
|
|
3055
3059
|
outline: "none",
|
|
3056
3060
|
boxSizing: "border-box"
|
|
3057
3061
|
}
|
|
@@ -3067,20 +3071,20 @@ const ct = 280, Cr = ({
|
|
|
3067
3071
|
maxHeight: "208px",
|
|
3068
3072
|
overflowY: "auto"
|
|
3069
3073
|
},
|
|
3070
|
-
children: N.length === 0 ? /* @__PURE__ */ r("li", { style: { padding: "8px 12px", fontSize: "13px", color:
|
|
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",
|
|
3074
3078
|
{
|
|
3075
3079
|
className: "metakyc-searchable-select-option",
|
|
3076
|
-
onClick: () =>
|
|
3080
|
+
onClick: () => W(M.value, M.disabled),
|
|
3077
3081
|
style: {
|
|
3078
3082
|
padding: "8px 12px",
|
|
3079
3083
|
fontSize: "13px",
|
|
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) => {
|
|
@@ -3102,8 +3106,8 @@ const ct = 280, Cr = ({
|
|
|
3102
3106
|
return /* @__PURE__ */ o(
|
|
3103
3107
|
"div",
|
|
3104
3108
|
{
|
|
3105
|
-
className: oe("w-full metakyc-searchable-select",
|
|
3106
|
-
ref:
|
|
3109
|
+
className: oe("w-full metakyc-searchable-select", m),
|
|
3110
|
+
ref: F,
|
|
3107
3111
|
children: [
|
|
3108
3112
|
e && /* @__PURE__ */ o(
|
|
3109
3113
|
"label",
|
|
@@ -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,14 +3139,14 @@ const ct = 280, Cr = ({
|
|
|
3135
3139
|
),
|
|
3136
3140
|
style: {
|
|
3137
3141
|
backgroundColor: "var(--metakyc-input-bg, #ffffff)",
|
|
3138
|
-
color:
|
|
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: [
|
|
3145
|
-
/* @__PURE__ */ r("span", { className: "truncate flex-1", children:
|
|
3149
|
+
/* @__PURE__ */ r("span", { className: "truncate flex-1", children: H || s }),
|
|
3146
3150
|
/* @__PURE__ */ r(
|
|
3147
3151
|
"span",
|
|
3148
3152
|
{
|
|
@@ -3154,7 +3158,7 @@ const ct = 280, Cr = ({
|
|
|
3154
3158
|
]
|
|
3155
3159
|
}
|
|
3156
3160
|
),
|
|
3157
|
-
typeof document < "u" &&
|
|
3161
|
+
typeof document < "u" && ye ? it(ye, document.body) : null,
|
|
3158
3162
|
t && /* @__PURE__ */ r("p", { className: "mt-1 text-sm", style: { color: "var(--metakyc-error, #ef4444)" }, children: t }),
|
|
3159
3163
|
!t && n && /* @__PURE__ */ r("p", { className: "mt-1 text-sm", style: { color: "var(--metakyc-text-secondary, #6b7280)" }, children: n })
|
|
3160
3164
|
]
|
|
@@ -3172,27 +3176,27 @@ const Ar = ({
|
|
|
3172
3176
|
value: c = [],
|
|
3173
3177
|
className: u
|
|
3174
3178
|
}) => {
|
|
3175
|
-
const [h,
|
|
3176
|
-
if (!
|
|
3177
|
-
const
|
|
3178
|
-
if (s &&
|
|
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
|
-
l == null || l(a ? [...c,
|
|
3184
|
-
}, f = (
|
|
3185
|
-
|
|
3186
|
-
},
|
|
3187
|
-
|
|
3188
|
-
},
|
|
3189
|
-
|
|
3187
|
+
l == null || l(a ? [...c, ...$] : [$[0]]);
|
|
3188
|
+
}, f = (P) => {
|
|
3189
|
+
P.preventDefault(), m(!0);
|
|
3190
|
+
}, S = () => {
|
|
3191
|
+
m(!1);
|
|
3192
|
+
}, b = (P) => {
|
|
3193
|
+
P.preventDefault(), m(!1), C(P.dataTransfer.files);
|
|
3190
3194
|
}, D = () => {
|
|
3191
|
-
var
|
|
3192
|
-
(
|
|
3193
|
-
},
|
|
3194
|
-
const
|
|
3195
|
-
l == null || l(
|
|
3195
|
+
var P;
|
|
3196
|
+
(P = v.current) == null || P.click();
|
|
3197
|
+
}, F = (P) => {
|
|
3198
|
+
const $ = c.filter((R, T) => T !== P);
|
|
3199
|
+
l == null || l($);
|
|
3196
3200
|
};
|
|
3197
3201
|
return /* @__PURE__ */ o("div", { className: oe("w-full", u), children: [
|
|
3198
3202
|
e && /* @__PURE__ */ r("label", { className: "block text-sm font-medium text-gray-700 dark:text-gray-300 mb-1", children: e }),
|
|
@@ -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(
|
|
@@ -3300,7 +3304,7 @@ const Ar = ({
|
|
|
3300
3304
|
)
|
|
3301
3305
|
]
|
|
3302
3306
|
},
|
|
3303
|
-
|
|
3307
|
+
$
|
|
3304
3308
|
)) }),
|
|
3305
3309
|
t && /* @__PURE__ */ r("p", { className: "mt-1 text-sm text-danger-500", children: t })
|
|
3306
3310
|
] });
|
|
@@ -3444,7 +3448,7 @@ const Tr = Ge(
|
|
|
3444
3448
|
...u
|
|
3445
3449
|
},
|
|
3446
3450
|
[
|
|
3447
|
-
...c.map(([
|
|
3451
|
+
...c.map(([m, v]) => nt(m, v)),
|
|
3448
3452
|
...Array.isArray(l) ? l : [l]
|
|
3449
3453
|
]
|
|
3450
3454
|
)
|
|
@@ -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 Lr = [["path", { d: "m15 18-6-6 6-6", key: "1wnfg3" }]],
|
|
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
|
-
|
|
3533
|
-
s && Object.keys(s).length > 0 && Object.keys(
|
|
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(() => {
|
|
3537
|
+
s && Object.keys(s).length > 0 && Object.keys(m).length === 0 && v(s);
|
|
3534
3538
|
}, [s]);
|
|
3535
|
-
const D =
|
|
3539
|
+
const D = Ee(
|
|
3536
3540
|
() => a ? Or(a.questionGroups) : [],
|
|
3537
3541
|
[a]
|
|
3538
|
-
),
|
|
3539
|
-
v((
|
|
3540
|
-
const
|
|
3541
|
-
return delete
|
|
3542
|
+
), F = S === D.length - 1, P = D[S] ?? [], $ = V((E, N) => {
|
|
3543
|
+
v((H) => ({ ...H, [E]: N })), f((H) => {
|
|
3544
|
+
const W = { ...H };
|
|
3545
|
+
return delete W[E], W;
|
|
3542
3546
|
});
|
|
3543
|
-
}, []),
|
|
3544
|
-
const
|
|
3545
|
-
for (const { question: N } of
|
|
3546
|
-
const
|
|
3547
|
-
|
|
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((N) => ({ ...N, ...
|
|
3550
|
-
}, [
|
|
3551
|
-
|
|
3552
|
-
},
|
|
3553
|
-
|
|
3553
|
+
return f((N) => ({ ...N, ...E })), Object.keys(E).length === 0;
|
|
3554
|
+
}, [P, m]), T = () => {
|
|
3555
|
+
R() && b((E) => E + 1);
|
|
3556
|
+
}, Y = () => {
|
|
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
|
|
3558
|
-
(
|
|
3559
|
-
questionId:
|
|
3560
|
-
values:
|
|
3561
|
+
const E = a.questionGroups.flatMap(
|
|
3562
|
+
(H) => (H.questions ?? []).map((W) => ({
|
|
3563
|
+
questionId: W.id,
|
|
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
3571
|
await h(N), t == null || t();
|
|
3568
|
-
} catch (
|
|
3569
|
-
console.error("Questionnaire submit error:",
|
|
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,50 +3583,50 @@ 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: N ===
|
|
3593
|
-
backgroundColor: N <=
|
|
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:
|
|
3605
|
-
error:
|
|
3606
|
-
onChange: (N) =>
|
|
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(
|
|
3612
|
-
|
|
3616
|
+
Q,
|
|
3613
3617
|
{
|
|
3614
3618
|
type: "button",
|
|
3615
3619
|
variant: "outline",
|
|
3616
|
-
onClick:
|
|
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
|
),
|
|
3624
|
-
|
|
3625
|
-
|
|
3628
|
+
F ? /* @__PURE__ */ r(
|
|
3629
|
+
Q,
|
|
3626
3630
|
{
|
|
3627
3631
|
type: "button",
|
|
3628
3632
|
isLoading: c,
|
|
@@ -3630,14 +3634,14 @@ const $r = ({
|
|
|
3630
3634
|
children: "Continue"
|
|
3631
3635
|
}
|
|
3632
3636
|
) : /* @__PURE__ */ o(
|
|
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
|
)
|
|
@@ -3724,7 +3728,7 @@ const $r = ({
|
|
|
3724
3728
|
type: "checkbox",
|
|
3725
3729
|
checked: t.includes(u),
|
|
3726
3730
|
onChange: (h) => {
|
|
3727
|
-
h.target.checked ? a([...t, u]) : a(t.filter((
|
|
3731
|
+
h.target.checked ? a([...t, u]) : a(t.filter((m) => m !== u));
|
|
3728
3732
|
},
|
|
3729
3733
|
className: "metakyc-option-input",
|
|
3730
3734
|
style: {
|
|
@@ -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,
|
|
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:
|
|
3771
|
-
valueList:
|
|
3774
|
+
uploadDocumentFileId: b.id,
|
|
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,23 +3790,23 @@ 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
|
-
|
|
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
|
-
n && /* @__PURE__ */ r(
|
|
3805
|
-
/* @__PURE__ */ r(
|
|
3808
|
+
n && /* @__PURE__ */ r(Q, { type: "button", variant: "outline", onClick: n, children: "Back" }),
|
|
3809
|
+
/* @__PURE__ */ r(Q, { type: "submit", isLoading: l, children: "Continue" })
|
|
3806
3810
|
] })
|
|
3807
3811
|
] }) }) : null;
|
|
3808
3812
|
}, _r = ({ applicantId: e, onComplete: t, onBack: n }) => {
|
|
@@ -3817,8 +3821,8 @@ const $r = ({
|
|
|
3817
3821
|
/* @__PURE__ */ r("h2", { className: "text-lg font-bold", children: a.title || "Overview" }),
|
|
3818
3822
|
a.description && /* @__PURE__ */ r("p", { className: "text-gray-600 dark:text-gray-400 mt-1", children: a.description })
|
|
3819
3823
|
] }),
|
|
3820
|
-
/* @__PURE__ */ r(K, { className: "space-y-8", children: a.steps && a.steps.length > 0 ? a.steps.sort((
|
|
3821
|
-
/* @__PURE__ */ r("div", { className: "metakyc-step-icon flex-shrink-0", children: /* @__PURE__ */ r("div", { className: "w-8 h-8 rounded-full bg-primary-500 text-white flex items-center justify-center font-medium text-sm", children:
|
|
3824
|
+
/* @__PURE__ */ r(K, { className: "space-y-8", children: a.steps && a.steps.length > 0 ? a.steps.sort((m, v) => m.order - v.order).map((m) => /* @__PURE__ */ o("div", { className: "metakyc-overview-step-item flex items-center space-x-3", children: [
|
|
3825
|
+
/* @__PURE__ */ r("div", { className: "metakyc-step-icon flex-shrink-0", children: /* @__PURE__ */ r("div", { className: "w-8 h-8 rounded-full bg-primary-500 text-white flex items-center justify-center font-medium text-sm", children: m.order + 1 }) }),
|
|
3822
3826
|
/* @__PURE__ */ o(
|
|
3823
3827
|
"div",
|
|
3824
3828
|
{
|
|
@@ -3830,19 +3834,40 @@ const $r = ({
|
|
|
3830
3834
|
background: "transparent"
|
|
3831
3835
|
},
|
|
3832
3836
|
children: [
|
|
3833
|
-
/* @__PURE__ */ r("span", { className: "metakyc-step-title text-sm font-semibold text-gray-900 dark:text-white", children:
|
|
3834
|
-
|
|
3837
|
+
/* @__PURE__ */ r("span", { className: "metakyc-step-title text-sm font-semibold text-gray-900 dark:text-white", children: m.title }),
|
|
3838
|
+
m.description && /* @__PURE__ */ r("p", { className: "metakyc-step-description text-sm text-gray-600 dark:text-gray-400", children: m.description })
|
|
3835
3839
|
]
|
|
3836
3840
|
}
|
|
3837
3841
|
)
|
|
3838
|
-
] },
|
|
3842
|
+
] }, m.order)) : /* @__PURE__ */ r("div", { className: "text-center py-8", children: /* @__PURE__ */ r("p", { className: "text-gray-600 dark:text-gray-400", children: "Loading overview data..." }) }) }),
|
|
3839
3843
|
/* @__PURE__ */ o(me, { className: "flex justify-between", children: [
|
|
3840
|
-
n && /* @__PURE__ */ r(
|
|
3841
|
-
/* @__PURE__ */ r(
|
|
3844
|
+
n && /* @__PURE__ */ r(Q, { type: "button", variant: "outline", onClick: n, children: "Back" }),
|
|
3845
|
+
/* @__PURE__ */ r(Q, { onClick: h, isLoading: l, children: "Continue" })
|
|
3842
3846
|
] })
|
|
3843
3847
|
] }) : null;
|
|
3844
3848
|
};
|
|
3845
|
-
function Hr(e
|
|
3849
|
+
function Hr(e) {
|
|
3850
|
+
const t = (e ?? "en").toLowerCase().replace("_", "-");
|
|
3851
|
+
try {
|
|
3852
|
+
return Intl.NumberFormat.supportedLocalesOf([t]), t;
|
|
3853
|
+
} catch {
|
|
3854
|
+
return "en";
|
|
3855
|
+
}
|
|
3856
|
+
}
|
|
3857
|
+
function Ur(e) {
|
|
3858
|
+
return e.valueDataType === Se.Money && Array.isArray(e.defaultValues) && e.defaultValues.length > 0;
|
|
3859
|
+
}
|
|
3860
|
+
function jr(e, t) {
|
|
3861
|
+
const n = new Intl.NumberFormat(Hr(t), {
|
|
3862
|
+
minimumFractionDigits: 0,
|
|
3863
|
+
maximumFractionDigits: 2
|
|
3864
|
+
});
|
|
3865
|
+
return e.replace(/([\d]+(?:\.\d+)?)/g, (a) => {
|
|
3866
|
+
const s = parseFloat(a);
|
|
3867
|
+
return isNaN(s) ? a : n.format(s);
|
|
3868
|
+
});
|
|
3869
|
+
}
|
|
3870
|
+
function Kr(e, t) {
|
|
3846
3871
|
const n = !t || t.length === 0 || t.every((a) => !a || !a.trim());
|
|
3847
3872
|
if (e.isRequired && n)
|
|
3848
3873
|
return e.errorMessage || `${e.displayName} is required`;
|
|
@@ -3854,7 +3879,7 @@ function Hr(e, t) {
|
|
|
3854
3879
|
return e.errorMessage || "Invalid format";
|
|
3855
3880
|
} catch {
|
|
3856
3881
|
}
|
|
3857
|
-
const s = e.valueDataType ===
|
|
3882
|
+
const s = e.valueDataType === Se.Integer || e.valueDataType === Se.Money || e.valueDataType === Se.DigitOnly;
|
|
3858
3883
|
if (s && a.trim() !== "") {
|
|
3859
3884
|
const l = Number(a);
|
|
3860
3885
|
if (!isNaN(l)) {
|
|
@@ -3872,160 +3897,161 @@ function Hr(e, t) {
|
|
|
3872
3897
|
}
|
|
3873
3898
|
return null;
|
|
3874
3899
|
}
|
|
3875
|
-
function
|
|
3900
|
+
function Wr(e) {
|
|
3876
3901
|
const t = /* @__PURE__ */ new Map();
|
|
3877
3902
|
return e.forEach((n, a) => {
|
|
3878
3903
|
const s = n.pageNumber != null && n.pageNumber > 0 ? n.pageNumber : 1;
|
|
3879
3904
|
t.has(s) || t.set(s, []), t.get(s).push({ criterion: n, idx: a });
|
|
3880
3905
|
}), Array.from(t.entries()).sort(([n], [a]) => n - a).map(([, n]) => n);
|
|
3881
3906
|
}
|
|
3882
|
-
function
|
|
3907
|
+
function Yr(e) {
|
|
3883
3908
|
return e.builtInType === 1 ? "country" : !e.defaultValues || e.defaultValues.length === 0 ? "text" : e.multipleValue ? "checkbox" : "radio";
|
|
3884
3909
|
}
|
|
3885
|
-
const
|
|
3910
|
+
const qr = ({
|
|
3886
3911
|
applicantId: e,
|
|
3887
3912
|
onComplete: t,
|
|
3888
3913
|
onBack: n
|
|
3889
3914
|
}) => {
|
|
3890
|
-
const {
|
|
3891
|
-
|
|
3892
|
-
|
|
3893
|
-
}, [
|
|
3894
|
-
const
|
|
3895
|
-
() =>
|
|
3896
|
-
[
|
|
3897
|
-
),
|
|
3898
|
-
|
|
3899
|
-
!
|
|
3900
|
-
}, [
|
|
3901
|
-
const
|
|
3902
|
-
|
|
3903
|
-
const
|
|
3904
|
-
return delete
|
|
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);
|
|
3918
|
+
}, [c]);
|
|
3919
|
+
const R = Ee(
|
|
3920
|
+
() => l && l.length > 0 ? Wr(l) : [],
|
|
3921
|
+
[l]
|
|
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;
|
|
3905
3930
|
});
|
|
3906
|
-
}, []),
|
|
3907
|
-
const
|
|
3908
|
-
for (const { criterion: B } of
|
|
3909
|
-
const
|
|
3910
|
-
|
|
3931
|
+
}, []), E = V(() => {
|
|
3932
|
+
const w = {};
|
|
3933
|
+
for (const { criterion: B } of Y) {
|
|
3934
|
+
const L = Kr(B, C[B.id] ?? []);
|
|
3935
|
+
L && (w[B.id] = L);
|
|
3911
3936
|
}
|
|
3912
|
-
return
|
|
3913
|
-
}, [
|
|
3914
|
-
|
|
3915
|
-
},
|
|
3916
|
-
|
|
3917
|
-
},
|
|
3918
|
-
if (!(!
|
|
3937
|
+
return b((B) => ({ ...B, ...w })), Object.keys(w).length === 0;
|
|
3938
|
+
}, [Y, C]), N = () => {
|
|
3939
|
+
E() && F((w) => w + 1);
|
|
3940
|
+
}, H = () => {
|
|
3941
|
+
D > 0 ? F((w) => w - 1) : n == null || n();
|
|
3942
|
+
}, W = async () => {
|
|
3943
|
+
if (!(!E() || !l))
|
|
3919
3944
|
try {
|
|
3920
|
-
const
|
|
3921
|
-
const
|
|
3922
|
-
return
|
|
3923
|
-
}).filter((
|
|
3924
|
-
await
|
|
3925
|
-
} catch (
|
|
3926
|
-
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);
|
|
3927
3952
|
}
|
|
3928
3953
|
};
|
|
3929
|
-
return
|
|
3954
|
+
return u ? /* @__PURE__ */ r(j, { children: /* @__PURE__ */ o(K, { children: [
|
|
3930
3955
|
/* @__PURE__ */ r(we, { className: "my-8" }),
|
|
3931
3956
|
/* @__PURE__ */ r("p", { className: "text-center text-sm mt-4", style: { color: "var(--metakyc-text-secondary, #6b7280)" }, children: "Loading risk scoring criteria…" })
|
|
3932
|
-
] }) }) : !
|
|
3957
|
+
] }) }) : !u && l && l.length === 0 ? /* @__PURE__ */ r(j, { children: /* @__PURE__ */ o(K, { children: [
|
|
3933
3958
|
/* @__PURE__ */ r(we, { className: "my-8" }),
|
|
3934
3959
|
/* @__PURE__ */ r("p", { className: "text-center text-sm mt-4", style: { color: "var(--metakyc-text-secondary, #6b7280)" }, children: "No criteria required. Moving to next step…" })
|
|
3935
|
-
] }) }) :
|
|
3960
|
+
] }) }) : m ? /* @__PURE__ */ r(j, { children: /* @__PURE__ */ r(K, { children: /* @__PURE__ */ o("p", { className: "text-danger-500", children: [
|
|
3936
3961
|
"Error loading criteria: ",
|
|
3937
|
-
|
|
3938
|
-
] }) }) }) :
|
|
3962
|
+
m.message
|
|
3963
|
+
] }) }) }) : l ? /* @__PURE__ */ o(j, { children: [
|
|
3939
3964
|
/* @__PURE__ */ o(ue, { children: [
|
|
3940
3965
|
/* @__PURE__ */ r("h2", { className: "text-lg font-bold", children: "Risk Assessment" }),
|
|
3941
3966
|
/* @__PURE__ */ r("p", { className: "text-sm", style: { color: "var(--metakyc-text-secondary, #6b7280)" }, children: "Please answer the following questions for risk evaluation" }),
|
|
3942
|
-
|
|
3967
|
+
R.length > 1 && /* @__PURE__ */ o("div", { className: "flex items-center justify-between mt-3", children: [
|
|
3943
3968
|
/* @__PURE__ */ o("span", { className: "text-xs", style: { color: "var(--metakyc-text-muted, #9ca3af)" }, children: [
|
|
3944
3969
|
"Page ",
|
|
3945
|
-
|
|
3970
|
+
D + 1,
|
|
3946
3971
|
" of ",
|
|
3947
|
-
|
|
3972
|
+
R.length
|
|
3948
3973
|
] }),
|
|
3949
|
-
/* @__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(
|
|
3950
3975
|
"div",
|
|
3951
3976
|
{
|
|
3952
3977
|
className: "rounded-full transition-all duration-200",
|
|
3953
3978
|
style: {
|
|
3954
3979
|
height: "6px",
|
|
3955
|
-
width: B ===
|
|
3956
|
-
backgroundColor: B <=
|
|
3980
|
+
width: B === D ? "20px" : "6px",
|
|
3981
|
+
backgroundColor: B <= D ? "var(--metakyc-primary, #2563eb)" : "var(--metakyc-border, #e5e7eb)"
|
|
3957
3982
|
}
|
|
3958
3983
|
},
|
|
3959
3984
|
B
|
|
3960
3985
|
)) })
|
|
3961
3986
|
] })
|
|
3962
3987
|
] }),
|
|
3963
|
-
/* @__PURE__ */ r(K, { className: "space-y-6", children:
|
|
3964
|
-
|
|
3988
|
+
/* @__PURE__ */ r(K, { className: "space-y-6", children: Y.map(({ criterion: w }) => /* @__PURE__ */ r(
|
|
3989
|
+
Qr,
|
|
3965
3990
|
{
|
|
3966
|
-
criterion:
|
|
3967
|
-
value:
|
|
3968
|
-
error:
|
|
3969
|
-
|
|
3991
|
+
criterion: w,
|
|
3992
|
+
value: C[w.id] ?? [],
|
|
3993
|
+
error: S[w.id],
|
|
3994
|
+
locale: s,
|
|
3995
|
+
onChange: (B) => X(w.id, B)
|
|
3970
3996
|
},
|
|
3971
|
-
|
|
3997
|
+
w.id
|
|
3972
3998
|
)) }),
|
|
3973
3999
|
/* @__PURE__ */ o(me, { className: "flex items-center justify-between", children: [
|
|
3974
4000
|
/* @__PURE__ */ o(
|
|
3975
|
-
|
|
4001
|
+
Q,
|
|
3976
4002
|
{
|
|
3977
4003
|
type: "button",
|
|
3978
4004
|
variant: "outline",
|
|
3979
|
-
onClick:
|
|
4005
|
+
onClick: H,
|
|
3980
4006
|
style: { display: "flex", alignItems: "center", gap: "4px" },
|
|
3981
4007
|
children: [
|
|
3982
|
-
/* @__PURE__ */ r(
|
|
3983
|
-
|
|
4008
|
+
/* @__PURE__ */ r(bt, { size: 14 }),
|
|
4009
|
+
D > 0 ? "Previous" : "Back"
|
|
3984
4010
|
]
|
|
3985
4011
|
}
|
|
3986
4012
|
),
|
|
3987
|
-
|
|
3988
|
-
|
|
4013
|
+
T ? /* @__PURE__ */ r(Q, { type: "button", isLoading: h, onClick: W, children: "Continue" }) : /* @__PURE__ */ o(
|
|
4014
|
+
Q,
|
|
3989
4015
|
{
|
|
3990
4016
|
type: "button",
|
|
3991
|
-
onClick:
|
|
4017
|
+
onClick: N,
|
|
3992
4018
|
style: { display: "flex", alignItems: "center", gap: "4px" },
|
|
3993
4019
|
children: [
|
|
3994
4020
|
"Next",
|
|
3995
|
-
/* @__PURE__ */ r(
|
|
4021
|
+
/* @__PURE__ */ r(xt, { size: 14 })
|
|
3996
4022
|
]
|
|
3997
4023
|
}
|
|
3998
4024
|
)
|
|
3999
4025
|
] }),
|
|
4000
|
-
|
|
4026
|
+
m && /* @__PURE__ */ r("div", { className: "mx-6 mb-4 p-3 bg-red-50 border border-red-200 rounded", children: /* @__PURE__ */ r("p", { className: "text-red-600 text-sm", children: m.message }) })
|
|
4001
4027
|
] }) : null;
|
|
4002
|
-
},
|
|
4003
|
-
const
|
|
4028
|
+
}, Qr = ({ criterion: e, value: t, error: n, locale: a, onChange: s }) => {
|
|
4029
|
+
const l = Yr(e), c = e.valueDataType === Se.Integer || e.valueDataType === Se.Money || e.valueDataType === Se.DigitOnly, u = Ur(e), h = (m) => u ? jr(m, a) : m;
|
|
4004
4030
|
return /* @__PURE__ */ o("div", { className: "space-y-2", children: [
|
|
4005
4031
|
/* @__PURE__ */ o("label", { className: "block text-sm font-medium", style: { color: "var(--metakyc-text-primary, #111827)" }, children: [
|
|
4006
4032
|
e.displayName,
|
|
4007
4033
|
e.isRequired && /* @__PURE__ */ r("span", { className: "text-danger-500 ml-1", children: "*" })
|
|
4008
4034
|
] }),
|
|
4009
4035
|
e.description && /* @__PURE__ */ r("p", { className: "text-xs", style: { color: "var(--metakyc-text-secondary, #6b7280)" }, children: e.description }),
|
|
4010
|
-
|
|
4011
|
-
|
|
4036
|
+
c && (e.min !== void 0 || e.max !== void 0) && /* @__PURE__ */ r("p", { className: "text-xs", style: { color: "var(--metakyc-text-muted, #9ca3af)" }, children: e.min !== void 0 && e.max !== void 0 ? `Range: ${e.min} – ${e.max}` : e.min !== void 0 ? `Minimum: ${e.min}` : `Maximum: ${e.max}` }),
|
|
4037
|
+
l === "text" && /* @__PURE__ */ r(
|
|
4012
4038
|
de,
|
|
4013
4039
|
{
|
|
4014
4040
|
value: t[0] ?? "",
|
|
4015
|
-
onChange: (
|
|
4016
|
-
type:
|
|
4041
|
+
onChange: (m) => s([m.target.value]),
|
|
4042
|
+
type: c ? "number" : "text",
|
|
4017
4043
|
placeholder: "Enter your answer…",
|
|
4018
4044
|
error: n,
|
|
4019
4045
|
required: e.isRequired,
|
|
4020
4046
|
min: e.min,
|
|
4021
4047
|
max: e.max,
|
|
4022
|
-
onKeyDown: (
|
|
4023
|
-
e.valueDataType ===
|
|
4048
|
+
onKeyDown: (m) => {
|
|
4049
|
+
e.valueDataType === Se.DigitOnly && ["e", "E", "+", "-", "."].includes(m.key) && m.preventDefault();
|
|
4024
4050
|
}
|
|
4025
4051
|
}
|
|
4026
4052
|
),
|
|
4027
|
-
|
|
4028
|
-
(e.defaultValues ?? []).map((
|
|
4053
|
+
l === "radio" && /* @__PURE__ */ o("div", { className: "metakyc-options-group", style: { display: "flex", flexDirection: "column", gap: "8px" }, children: [
|
|
4054
|
+
(e.defaultValues ?? []).map((m) => /* @__PURE__ */ o(
|
|
4029
4055
|
"label",
|
|
4030
4056
|
{
|
|
4031
4057
|
className: "metakyc-option-label",
|
|
@@ -4035,8 +4061,8 @@ const Kr = ({
|
|
|
4035
4061
|
"input",
|
|
4036
4062
|
{
|
|
4037
4063
|
type: "radio",
|
|
4038
|
-
checked: t[0] ===
|
|
4039
|
-
onChange: () =>
|
|
4064
|
+
checked: t[0] === m,
|
|
4065
|
+
onChange: () => s([m]),
|
|
4040
4066
|
className: "metakyc-option-input",
|
|
4041
4067
|
style: {
|
|
4042
4068
|
width: "16px",
|
|
@@ -4053,15 +4079,15 @@ const Kr = ({
|
|
|
4053
4079
|
}
|
|
4054
4080
|
}
|
|
4055
4081
|
),
|
|
4056
|
-
/* @__PURE__ */ r("span", { className: "metakyc-option-text", style: { fontSize: "14px", color: "var(--metakyc-text-primary, #111827)", lineHeight: "1.4", marginLeft: 0 }, children:
|
|
4082
|
+
/* @__PURE__ */ r("span", { className: "metakyc-option-text", style: { fontSize: "14px", color: "var(--metakyc-text-primary, #111827)", lineHeight: "1.4", marginLeft: 0 }, children: h(m) })
|
|
4057
4083
|
]
|
|
4058
4084
|
},
|
|
4059
|
-
|
|
4085
|
+
m
|
|
4060
4086
|
)),
|
|
4061
4087
|
n && /* @__PURE__ */ r("p", { className: "text-sm text-danger-500", children: n })
|
|
4062
4088
|
] }),
|
|
4063
|
-
|
|
4064
|
-
(e.defaultValues ?? []).map((
|
|
4089
|
+
l === "checkbox" && /* @__PURE__ */ o("div", { className: "metakyc-options-group", style: { display: "flex", flexDirection: "column", gap: "8px" }, children: [
|
|
4090
|
+
(e.defaultValues ?? []).map((m) => /* @__PURE__ */ o(
|
|
4065
4091
|
"label",
|
|
4066
4092
|
{
|
|
4067
4093
|
className: "metakyc-option-label",
|
|
@@ -4071,9 +4097,9 @@ const Kr = ({
|
|
|
4071
4097
|
"input",
|
|
4072
4098
|
{
|
|
4073
4099
|
type: "checkbox",
|
|
4074
|
-
checked: t.includes(
|
|
4075
|
-
onChange: (
|
|
4076
|
-
|
|
4100
|
+
checked: t.includes(m),
|
|
4101
|
+
onChange: (v) => {
|
|
4102
|
+
v.target.checked ? s([...t, m]) : s(t.filter((C) => C !== m));
|
|
4077
4103
|
},
|
|
4078
4104
|
className: "metakyc-option-input",
|
|
4079
4105
|
style: {
|
|
@@ -4091,18 +4117,18 @@ const Kr = ({
|
|
|
4091
4117
|
}
|
|
4092
4118
|
}
|
|
4093
4119
|
),
|
|
4094
|
-
/* @__PURE__ */ r("span", { className: "metakyc-option-text", style: { fontSize: "14px", color: "var(--metakyc-text-primary, #111827)", lineHeight: "1.4", marginLeft: 0 }, children:
|
|
4120
|
+
/* @__PURE__ */ r("span", { className: "metakyc-option-text", style: { fontSize: "14px", color: "var(--metakyc-text-primary, #111827)", lineHeight: "1.4", marginLeft: 0 }, children: h(m) })
|
|
4095
4121
|
]
|
|
4096
4122
|
},
|
|
4097
|
-
|
|
4123
|
+
m
|
|
4098
4124
|
)),
|
|
4099
4125
|
n && /* @__PURE__ */ r("p", { className: "text-sm text-danger-500", children: n })
|
|
4100
4126
|
] }),
|
|
4101
|
-
|
|
4127
|
+
l === "country" && /* @__PURE__ */ r(
|
|
4102
4128
|
st,
|
|
4103
4129
|
{
|
|
4104
4130
|
value: t[0] ?? "",
|
|
4105
|
-
onChange: (
|
|
4131
|
+
onChange: (m) => s([m.target.value]),
|
|
4106
4132
|
options: [
|
|
4107
4133
|
{ value: "US", label: "United States" },
|
|
4108
4134
|
{ value: "GB", label: "United Kingdom" },
|
|
@@ -4116,28 +4142,28 @@ const Kr = ({
|
|
|
4116
4142
|
}
|
|
4117
4143
|
)
|
|
4118
4144
|
] });
|
|
4119
|
-
},
|
|
4145
|
+
}, Gr = ({
|
|
4120
4146
|
applicantId: e,
|
|
4121
4147
|
onComplete: t,
|
|
4122
4148
|
onBack: n
|
|
4123
4149
|
}) => {
|
|
4124
|
-
const { investorCategorizationService: a } =
|
|
4125
|
-
return /* @__PURE__ */ r("form", { onSubmit: async (
|
|
4126
|
-
if (
|
|
4127
|
-
|
|
4150
|
+
const { investorCategorizationService: a } = ge(), [s, l] = k(null), [c, u] = k(!1), [h, m] = k(null);
|
|
4151
|
+
return /* @__PURE__ */ r("form", { onSubmit: async (C) => {
|
|
4152
|
+
if (C.preventDefault(), s === null) {
|
|
4153
|
+
m("Please select an investor type");
|
|
4128
4154
|
return;
|
|
4129
4155
|
}
|
|
4130
|
-
u(!0),
|
|
4156
|
+
u(!0), m(null);
|
|
4131
4157
|
try {
|
|
4132
4158
|
const f = {
|
|
4133
4159
|
applicantId: e,
|
|
4134
4160
|
investorType: s
|
|
4135
4161
|
};
|
|
4136
4162
|
console.log("Submitting investor categorization:", f);
|
|
4137
|
-
const
|
|
4138
|
-
console.log("Investor categorization result:",
|
|
4163
|
+
const S = await a.setInvestorCategorization(f);
|
|
4164
|
+
console.log("Investor categorization result:", S), t == null || t();
|
|
4139
4165
|
} catch (f) {
|
|
4140
|
-
console.error("Error submitting investor categorization:", f),
|
|
4166
|
+
console.error("Error submitting investor categorization:", f), m(f.message || "Failed to submit investor categorization");
|
|
4141
4167
|
} finally {
|
|
4142
4168
|
u(!1);
|
|
4143
4169
|
}
|
|
@@ -4153,7 +4179,7 @@ const Kr = ({
|
|
|
4153
4179
|
{
|
|
4154
4180
|
className: `
|
|
4155
4181
|
block p-4 border-2 rounded-lg cursor-pointer transition-all
|
|
4156
|
-
${s ===
|
|
4182
|
+
${s === fe.Individual ? "border-primary-500 bg-primary-50 dark:bg-primary-900/20" : "border-gray-200 dark:border-gray-700 hover:border-gray-300 dark:hover:border-gray-600"}
|
|
4157
4183
|
`,
|
|
4158
4184
|
children: /* @__PURE__ */ o("div", { className: "flex items-start", children: [
|
|
4159
4185
|
/* @__PURE__ */ r(
|
|
@@ -4161,9 +4187,9 @@ const Kr = ({
|
|
|
4161
4187
|
{
|
|
4162
4188
|
type: "radio",
|
|
4163
4189
|
name: "investorType",
|
|
4164
|
-
value:
|
|
4165
|
-
checked: s ===
|
|
4166
|
-
onChange: () => l(
|
|
4190
|
+
value: fe.Individual,
|
|
4191
|
+
checked: s === fe.Individual,
|
|
4192
|
+
onChange: () => l(fe.Individual),
|
|
4167
4193
|
className: "mt-1 h-4 w-4 text-primary-500 border-gray-300 focus:ring-primary-500"
|
|
4168
4194
|
}
|
|
4169
4195
|
),
|
|
@@ -4179,7 +4205,7 @@ const Kr = ({
|
|
|
4179
4205
|
{
|
|
4180
4206
|
className: `
|
|
4181
4207
|
block p-4 border-2 rounded-lg cursor-pointer transition-all
|
|
4182
|
-
${s ===
|
|
4208
|
+
${s === fe.Sophisticated ? "border-primary-500 bg-primary-50 dark:bg-primary-900/20" : "border-gray-200 dark:border-gray-700 hover:border-gray-300 dark:hover:border-gray-600"}
|
|
4183
4209
|
`,
|
|
4184
4210
|
children: /* @__PURE__ */ o("div", { className: "flex items-start", children: [
|
|
4185
4211
|
/* @__PURE__ */ r(
|
|
@@ -4187,9 +4213,9 @@ const Kr = ({
|
|
|
4187
4213
|
{
|
|
4188
4214
|
type: "radio",
|
|
4189
4215
|
name: "investorType",
|
|
4190
|
-
value:
|
|
4191
|
-
checked: s ===
|
|
4192
|
-
onChange: () => l(
|
|
4216
|
+
value: fe.Sophisticated,
|
|
4217
|
+
checked: s === fe.Sophisticated,
|
|
4218
|
+
onChange: () => l(fe.Sophisticated),
|
|
4193
4219
|
className: "mt-1 h-4 w-4 text-primary-500 border-gray-300 focus:ring-primary-500"
|
|
4194
4220
|
}
|
|
4195
4221
|
),
|
|
@@ -4210,7 +4236,7 @@ const Kr = ({
|
|
|
4210
4236
|
{
|
|
4211
4237
|
className: `
|
|
4212
4238
|
block p-4 border-2 rounded-lg cursor-pointer transition-all
|
|
4213
|
-
${s ===
|
|
4239
|
+
${s === fe.HighNetWorth ? "border-primary-500 bg-primary-50 dark:bg-primary-900/20" : "border-gray-200 dark:border-gray-700 hover:border-gray-300 dark:hover:border-gray-600"}
|
|
4214
4240
|
`,
|
|
4215
4241
|
children: /* @__PURE__ */ o("div", { className: "flex items-start", children: [
|
|
4216
4242
|
/* @__PURE__ */ r(
|
|
@@ -4218,9 +4244,9 @@ const Kr = ({
|
|
|
4218
4244
|
{
|
|
4219
4245
|
type: "radio",
|
|
4220
4246
|
name: "investorType",
|
|
4221
|
-
value:
|
|
4222
|
-
checked: s ===
|
|
4223
|
-
onChange: () => l(
|
|
4247
|
+
value: fe.HighNetWorth,
|
|
4248
|
+
checked: s === fe.HighNetWorth,
|
|
4249
|
+
onChange: () => l(fe.HighNetWorth),
|
|
4224
4250
|
className: "mt-1 h-4 w-4 text-primary-500 border-gray-300 focus:ring-primary-500"
|
|
4225
4251
|
}
|
|
4226
4252
|
),
|
|
@@ -4242,9 +4268,9 @@ const Kr = ({
|
|
|
4242
4268
|
] }) })
|
|
4243
4269
|
] }),
|
|
4244
4270
|
/* @__PURE__ */ o(me, { className: "flex justify-between", children: [
|
|
4245
|
-
n && /* @__PURE__ */ r(
|
|
4271
|
+
n && /* @__PURE__ */ r(Q, { type: "button", variant: "outline", onClick: n, children: "Back" }),
|
|
4246
4272
|
/* @__PURE__ */ r(
|
|
4247
|
-
|
|
4273
|
+
Q,
|
|
4248
4274
|
{
|
|
4249
4275
|
type: "submit",
|
|
4250
4276
|
isLoading: c,
|
|
@@ -4254,109 +4280,109 @@ const Kr = ({
|
|
|
4254
4280
|
)
|
|
4255
4281
|
] })
|
|
4256
4282
|
] }) });
|
|
4257
|
-
},
|
|
4283
|
+
}, Vr = ({
|
|
4258
4284
|
applicantId: e,
|
|
4259
4285
|
onComplete: t,
|
|
4260
4286
|
onBack: n
|
|
4261
4287
|
}) => {
|
|
4262
|
-
const { appropriatenessTestService: a } =
|
|
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);
|
|
4263
4289
|
ne(() => {
|
|
4264
4290
|
(async () => {
|
|
4265
4291
|
try {
|
|
4266
|
-
u(!0),
|
|
4267
|
-
const
|
|
4268
|
-
if (console.log("Appropriateness test data:",
|
|
4269
|
-
const
|
|
4270
|
-
|
|
4292
|
+
u(!0), C(null), console.log("Loading appropriateness test for applicant:", e);
|
|
4293
|
+
const O = await a.getAppropriatenessTest(e);
|
|
4294
|
+
if (console.log("Appropriateness test data:", O), l(O), O.waitTimeSpanForNextTry && O.waitTimeSpanForNextTry !== "00:00:00") {
|
|
4295
|
+
const G = X(O.waitTimeSpanForNextTry);
|
|
4296
|
+
G > 0 && Y(G);
|
|
4271
4297
|
}
|
|
4272
|
-
} catch (
|
|
4273
|
-
console.error("Error loading appropriateness test:",
|
|
4298
|
+
} catch (O) {
|
|
4299
|
+
console.error("Error loading appropriateness test:", O), C(O.message || "Failed to load appropriateness test");
|
|
4274
4300
|
} finally {
|
|
4275
4301
|
u(!1);
|
|
4276
4302
|
}
|
|
4277
4303
|
})();
|
|
4278
4304
|
}, [e, a]);
|
|
4279
|
-
const X = (
|
|
4280
|
-
const
|
|
4281
|
-
if (
|
|
4282
|
-
const [
|
|
4283
|
-
return
|
|
4305
|
+
const X = (L) => {
|
|
4306
|
+
const O = L.split(":").map(Number);
|
|
4307
|
+
if (O.length === 3) {
|
|
4308
|
+
const [G, A, U] = O;
|
|
4309
|
+
return G * 3600 + A * 60 + U;
|
|
4284
4310
|
}
|
|
4285
4311
|
return 0;
|
|
4286
|
-
},
|
|
4287
|
-
const
|
|
4288
|
-
return `${
|
|
4312
|
+
}, E = (L) => {
|
|
4313
|
+
const O = Math.floor(L / 60), G = L % 60;
|
|
4314
|
+
return `${O.toString().padStart(2, "0")}:${G.toString().padStart(2, "0")}`;
|
|
4289
4315
|
};
|
|
4290
4316
|
ne(() => {
|
|
4291
|
-
if (!
|
|
4292
|
-
const
|
|
4293
|
-
D((
|
|
4317
|
+
if (!F || b <= 0) return;
|
|
4318
|
+
const L = setInterval(() => {
|
|
4319
|
+
D((O) => O <= 1 ? (R(!0), 0) : O - 1);
|
|
4294
4320
|
}, 1e3);
|
|
4295
|
-
return () => clearInterval(
|
|
4296
|
-
}, [
|
|
4297
|
-
if (
|
|
4298
|
-
const
|
|
4299
|
-
|
|
4321
|
+
return () => clearInterval(L);
|
|
4322
|
+
}, [F, b]), ne(() => {
|
|
4323
|
+
if (T <= 0) return;
|
|
4324
|
+
const L = setInterval(() => {
|
|
4325
|
+
Y((O) => O <= 1 ? 0 : O - 1);
|
|
4300
4326
|
}, 1e3);
|
|
4301
|
-
return () => clearInterval(
|
|
4302
|
-
}, [
|
|
4303
|
-
|
|
4304
|
-
}, [
|
|
4327
|
+
return () => clearInterval(L);
|
|
4328
|
+
}, [T]), ne(() => {
|
|
4329
|
+
$ && !h && W();
|
|
4330
|
+
}, [$]);
|
|
4305
4331
|
const N = () => {
|
|
4306
|
-
s && (
|
|
4307
|
-
},
|
|
4308
|
-
|
|
4309
|
-
...
|
|
4310
|
-
[
|
|
4332
|
+
s && (P(!0), D(s.testDurationSec));
|
|
4333
|
+
}, H = (L, O) => {
|
|
4334
|
+
S((G) => ({
|
|
4335
|
+
...G,
|
|
4336
|
+
[L]: O
|
|
4311
4337
|
}));
|
|
4312
|
-
},
|
|
4313
|
-
if (
|
|
4314
|
-
if (
|
|
4315
|
-
const
|
|
4316
|
-
if (
|
|
4317
|
-
|
|
4338
|
+
}, W = async (L) => {
|
|
4339
|
+
if (L && L.preventDefault(), !!s) {
|
|
4340
|
+
if (!$) {
|
|
4341
|
+
const O = s.appropriatenessQuestions.length - Object.keys(f).length;
|
|
4342
|
+
if (O > 0) {
|
|
4343
|
+
C(`Please answer all questions. ${O} question(s) remaining.`);
|
|
4318
4344
|
return;
|
|
4319
4345
|
}
|
|
4320
4346
|
}
|
|
4321
|
-
|
|
4347
|
+
m(!0), C(null);
|
|
4322
4348
|
try {
|
|
4323
|
-
const
|
|
4324
|
-
(
|
|
4325
|
-
appropriatenessQuestionId:
|
|
4326
|
-
value: f[
|
|
4349
|
+
const O = s.appropriatenessQuestions.map(
|
|
4350
|
+
(A) => ({
|
|
4351
|
+
appropriatenessQuestionId: A.id,
|
|
4352
|
+
value: f[A.id] || ""
|
|
4327
4353
|
// Empty string if not answered
|
|
4328
4354
|
})
|
|
4329
|
-
),
|
|
4355
|
+
), G = {
|
|
4330
4356
|
applicantId: e,
|
|
4331
4357
|
appropriatenessTestId: s.id,
|
|
4332
|
-
appropriatenessQuestionResults:
|
|
4358
|
+
appropriatenessQuestionResults: O
|
|
4333
4359
|
};
|
|
4334
|
-
console.log("Submitting appropriateness test:",
|
|
4360
|
+
console.log("Submitting appropriateness test:", G);
|
|
4335
4361
|
try {
|
|
4336
|
-
const
|
|
4337
|
-
console.log("Appropriateness test result:",
|
|
4338
|
-
} catch (
|
|
4339
|
-
if (
|
|
4340
|
-
const U =
|
|
4341
|
-
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);
|
|
4342
4368
|
} else
|
|
4343
|
-
throw
|
|
4369
|
+
throw A;
|
|
4344
4370
|
}
|
|
4345
|
-
} catch (
|
|
4346
|
-
console.error("Error submitting appropriateness test:",
|
|
4371
|
+
} catch (O) {
|
|
4372
|
+
console.error("Error submitting appropriateness test:", O), C(O.message || "Failed to submit test. Please try again."), P(!1), R(!1), S({});
|
|
4347
4373
|
} finally {
|
|
4348
|
-
|
|
4374
|
+
m(!1);
|
|
4349
4375
|
}
|
|
4350
4376
|
}
|
|
4351
|
-
},
|
|
4377
|
+
}, w = async () => {
|
|
4352
4378
|
try {
|
|
4353
|
-
const
|
|
4354
|
-
if (console.log("Reloaded test data:",
|
|
4355
|
-
const
|
|
4356
|
-
|
|
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);
|
|
4382
|
+
O > 0 && Y(O);
|
|
4357
4383
|
}
|
|
4358
|
-
} catch (
|
|
4359
|
-
console.error("Error reloading test data:",
|
|
4384
|
+
} catch (L) {
|
|
4385
|
+
console.error("Error reloading test data:", L), C((O) => O + `
|
|
4360
4386
|
|
|
4361
4387
|
Failed to reload test data. Please refresh the page.`);
|
|
4362
4388
|
}
|
|
@@ -4371,7 +4397,7 @@ Failed to reload test data. Please refresh the page.`);
|
|
|
4371
4397
|
/* @__PURE__ */ r("p", { className: "text-danger-500 text-lg mb-4", children: "No test data available" }),
|
|
4372
4398
|
v && /* @__PURE__ */ r("p", { className: "text-gray-600 dark:text-gray-400", children: v })
|
|
4373
4399
|
] }) });
|
|
4374
|
-
if (
|
|
4400
|
+
if (T > 0)
|
|
4375
4401
|
return /* @__PURE__ */ o(j, { children: [
|
|
4376
4402
|
/* @__PURE__ */ o(ue, { children: [
|
|
4377
4403
|
/* @__PURE__ */ r("h2", { className: "text-lg font-bold text-gray-900 dark:text-white", children: s.displayName }),
|
|
@@ -4379,14 +4405,14 @@ Failed to reload test data. Please refresh the page.`);
|
|
|
4379
4405
|
] }),
|
|
4380
4406
|
/* @__PURE__ */ o(K, { className: "py-12 text-center", children: [
|
|
4381
4407
|
/* @__PURE__ */ o("div", { className: "mb-6", children: [
|
|
4382
|
-
/* @__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) }),
|
|
4383
4409
|
/* @__PURE__ */ r("p", { className: "text-gray-600 dark:text-gray-400", children: "Please wait before attempting the test again" })
|
|
4384
4410
|
] }),
|
|
4385
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 }) })
|
|
4386
4412
|
] })
|
|
4387
4413
|
] });
|
|
4388
|
-
const
|
|
4389
|
-
return
|
|
4414
|
+
const B = s.testAllowedMaxTry - s.totalFailedTries;
|
|
4415
|
+
return F ? /* @__PURE__ */ r("form", { onSubmit: W, children: /* @__PURE__ */ o(j, { children: [
|
|
4390
4416
|
/* @__PURE__ */ r(ue, { children: /* @__PURE__ */ o("div", { className: "flex items-center justify-between", children: [
|
|
4391
4417
|
/* @__PURE__ */ o("div", { children: [
|
|
4392
4418
|
/* @__PURE__ */ r("h2", { className: "text-lg font-bold text-gray-900 dark:text-white", children: s.displayName }),
|
|
@@ -4396,8 +4422,8 @@ Failed to reload test data. Please refresh the page.`);
|
|
|
4396
4422
|
/* @__PURE__ */ r(
|
|
4397
4423
|
"div",
|
|
4398
4424
|
{
|
|
4399
|
-
className: `text-3xl font-bold ${
|
|
4400
|
-
children:
|
|
4425
|
+
className: `text-3xl font-bold ${b <= 60 ? "text-danger-500" : "text-primary-500"}`,
|
|
4426
|
+
children: E(b)
|
|
4401
4427
|
}
|
|
4402
4428
|
),
|
|
4403
4429
|
/* @__PURE__ */ r("p", { className: "text-sm text-gray-500 dark:text-gray-400", children: "Time Remaining" })
|
|
@@ -4405,20 +4431,20 @@ Failed to reload test data. Please refresh the page.`);
|
|
|
4405
4431
|
] }) }),
|
|
4406
4432
|
/* @__PURE__ */ o(K, { className: "space-y-6", children: [
|
|
4407
4433
|
/* @__PURE__ */ o("div", { className: "flex items-center justify-between mb-4", children: [
|
|
4408
|
-
/* @__PURE__ */ o(
|
|
4434
|
+
/* @__PURE__ */ o(Ie, { variant: "info", children: [
|
|
4409
4435
|
"Question ",
|
|
4410
4436
|
Object.keys(f).length,
|
|
4411
4437
|
" of ",
|
|
4412
4438
|
s.totalQuestionCount
|
|
4413
4439
|
] }),
|
|
4414
|
-
/* @__PURE__ */ o(
|
|
4415
|
-
|
|
4440
|
+
/* @__PURE__ */ o(Ie, { variant: B > 1 ? "success" : "warning", children: [
|
|
4441
|
+
B,
|
|
4416
4442
|
" attempt",
|
|
4417
|
-
|
|
4443
|
+
B !== 1 ? "s" : "",
|
|
4418
4444
|
" remaining"
|
|
4419
4445
|
] })
|
|
4420
4446
|
] }),
|
|
4421
|
-
s.appropriatenessQuestions.map((
|
|
4447
|
+
s.appropriatenessQuestions.map((L, O) => /* @__PURE__ */ o(
|
|
4422
4448
|
"div",
|
|
4423
4449
|
{
|
|
4424
4450
|
className: "p-4 border border-gray-200 dark:border-gray-700 rounded-lg",
|
|
@@ -4426,53 +4452,53 @@ Failed to reload test data. Please refresh the page.`);
|
|
|
4426
4452
|
/* @__PURE__ */ o("div", { className: "mb-4", children: [
|
|
4427
4453
|
/* @__PURE__ */ o("span", { className: "inline-block px-2 py-1 text-xs font-semibold text-primary-700 bg-primary-100 dark:text-primary-300 dark:bg-primary-900/30 rounded mb-2", children: [
|
|
4428
4454
|
"Question ",
|
|
4429
|
-
|
|
4455
|
+
O + 1
|
|
4430
4456
|
] }),
|
|
4431
|
-
|
|
4432
|
-
/* @__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 })
|
|
4433
4459
|
] }),
|
|
4434
|
-
/* @__PURE__ */ r("div", { className: "space-y-2", children:
|
|
4460
|
+
/* @__PURE__ */ r("div", { className: "space-y-2", children: L.answers.map((G, A) => /* @__PURE__ */ o(
|
|
4435
4461
|
"label",
|
|
4436
4462
|
{
|
|
4437
4463
|
className: `
|
|
4438
4464
|
flex items-center p-3 border-2 rounded-lg cursor-pointer transition-all
|
|
4439
|
-
${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"}
|
|
4440
4466
|
`,
|
|
4441
4467
|
children: [
|
|
4442
4468
|
/* @__PURE__ */ r(
|
|
4443
4469
|
"input",
|
|
4444
4470
|
{
|
|
4445
4471
|
type: "radio",
|
|
4446
|
-
name: `question-${
|
|
4447
|
-
value:
|
|
4448
|
-
checked: f[
|
|
4449
|
-
onChange: (U) => L
|
|
4472
|
+
name: `question-${L.id}`,
|
|
4473
|
+
value: G,
|
|
4474
|
+
checked: f[L.id] === G,
|
|
4475
|
+
onChange: (U) => H(L.id, U.target.value),
|
|
4450
4476
|
className: "h-4 w-4 text-primary-500 border-gray-300 focus:ring-primary-500",
|
|
4451
4477
|
disabled: h
|
|
4452
4478
|
}
|
|
4453
4479
|
),
|
|
4454
|
-
/* @__PURE__ */ r("span", { className: "ml-3 text-gray-700 dark:text-gray-300", children:
|
|
4480
|
+
/* @__PURE__ */ r("span", { className: "ml-3 text-gray-700 dark:text-gray-300", children: G })
|
|
4455
4481
|
]
|
|
4456
4482
|
},
|
|
4457
|
-
|
|
4483
|
+
A
|
|
4458
4484
|
)) })
|
|
4459
4485
|
]
|
|
4460
4486
|
},
|
|
4461
|
-
|
|
4487
|
+
L.id
|
|
4462
4488
|
)),
|
|
4463
|
-
v &&
|
|
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: [
|
|
4464
4490
|
/* @__PURE__ */ r("strong", { children: "Error:" }),
|
|
4465
4491
|
" ",
|
|
4466
4492
|
v
|
|
4467
4493
|
] }) }),
|
|
4468
|
-
|
|
4494
|
+
$ && /* @__PURE__ */ r("div", { className: "p-4 bg-yellow-50 dark:bg-yellow-900/20 border border-yellow-200 dark:border-yellow-800 rounded-lg", children: /* @__PURE__ */ o("p", { className: "text-yellow-700 dark:text-yellow-400 text-sm", children: [
|
|
4469
4495
|
/* @__PURE__ */ r("strong", { children: "Time's up!" }),
|
|
4470
4496
|
" Your answers are being submitted automatically."
|
|
4471
4497
|
] }) })
|
|
4472
4498
|
] }),
|
|
4473
4499
|
/* @__PURE__ */ o(me, { className: "flex justify-between", children: [
|
|
4474
4500
|
/* @__PURE__ */ r(
|
|
4475
|
-
|
|
4501
|
+
Q,
|
|
4476
4502
|
{
|
|
4477
4503
|
type: "button",
|
|
4478
4504
|
variant: "outline",
|
|
@@ -4482,12 +4508,12 @@ Failed to reload test data. Please refresh the page.`);
|
|
|
4482
4508
|
}
|
|
4483
4509
|
),
|
|
4484
4510
|
/* @__PURE__ */ r(
|
|
4485
|
-
|
|
4511
|
+
Q,
|
|
4486
4512
|
{
|
|
4487
4513
|
type: "submit",
|
|
4488
4514
|
isLoading: h,
|
|
4489
4515
|
disabled: Object.keys(f).length < s.totalQuestionCount,
|
|
4490
|
-
children:
|
|
4516
|
+
children: $ ? "Submitting..." : "Submit Test"
|
|
4491
4517
|
}
|
|
4492
4518
|
)
|
|
4493
4519
|
] })
|
|
@@ -4501,19 +4527,19 @@ Failed to reload test data. Please refresh the page.`);
|
|
|
4501
4527
|
/* @__PURE__ */ o("div", { className: "space-y-4 mb-6", children: [
|
|
4502
4528
|
/* @__PURE__ */ o("div", { className: "flex items-center justify-between p-4 bg-blue-50 dark:bg-blue-900/20 rounded-lg", children: [
|
|
4503
4529
|
/* @__PURE__ */ r("span", { className: "text-gray-700 dark:text-gray-300 font-medium", children: "Total Questions:" }),
|
|
4504
|
-
/* @__PURE__ */ r(
|
|
4530
|
+
/* @__PURE__ */ r(Ie, { variant: "info", children: s.totalQuestionCount })
|
|
4505
4531
|
] }),
|
|
4506
4532
|
/* @__PURE__ */ o("div", { className: "flex items-center justify-between p-4 bg-blue-50 dark:bg-blue-900/20 rounded-lg", children: [
|
|
4507
4533
|
/* @__PURE__ */ r("span", { className: "text-gray-700 dark:text-gray-300 font-medium", children: "Time Limit:" }),
|
|
4508
|
-
/* @__PURE__ */ r(
|
|
4534
|
+
/* @__PURE__ */ r(Ie, { variant: "info", children: E(s.testDurationSec) })
|
|
4509
4535
|
] }),
|
|
4510
4536
|
/* @__PURE__ */ o("div", { className: "flex items-center justify-between p-4 bg-blue-50 dark:bg-blue-900/20 rounded-lg", children: [
|
|
4511
4537
|
/* @__PURE__ */ r("span", { className: "text-gray-700 dark:text-gray-300 font-medium", children: "Correct Answers Required:" }),
|
|
4512
|
-
/* @__PURE__ */ r(
|
|
4538
|
+
/* @__PURE__ */ r(Ie, { variant: "info", children: s.testCorrectAnswerPassLimit })
|
|
4513
4539
|
] }),
|
|
4514
4540
|
/* @__PURE__ */ o("div", { className: "flex items-center justify-between p-4 bg-blue-50 dark:bg-blue-900/20 rounded-lg", children: [
|
|
4515
4541
|
/* @__PURE__ */ r("span", { className: "text-gray-700 dark:text-gray-300 font-medium", children: "Attempts Remaining:" }),
|
|
4516
|
-
/* @__PURE__ */ r(
|
|
4542
|
+
/* @__PURE__ */ r(Ie, { variant: B > 1 ? "success" : "warning", children: B })
|
|
4517
4543
|
] })
|
|
4518
4544
|
] }),
|
|
4519
4545
|
v && /* @__PURE__ */ r("div", { className: "mb-4 p-4 bg-red-50 dark:bg-red-900/20 border border-red-200 dark:border-red-800 rounded-lg", children: /* @__PURE__ */ o("p", { className: "text-red-600 dark:text-red-400 text-sm", children: [
|
|
@@ -4521,28 +4547,28 @@ Failed to reload test data. Please refresh the page.`);
|
|
|
4521
4547
|
" ",
|
|
4522
4548
|
v
|
|
4523
4549
|
] }) }),
|
|
4524
|
-
|
|
4550
|
+
B <= 0 && /* @__PURE__ */ r("div", { className: "p-4 bg-red-50 dark:bg-red-900/20 border border-red-200 dark:border-red-800 rounded-lg", children: /* @__PURE__ */ r("p", { className: "text-red-600 dark:text-red-400", children: "You have used all your attempts. Please contact support for assistance." }) })
|
|
4525
4551
|
] }),
|
|
4526
4552
|
/* @__PURE__ */ o(me, { className: "flex justify-between", children: [
|
|
4527
|
-
n && /* @__PURE__ */ r(
|
|
4553
|
+
n && /* @__PURE__ */ r(Q, { type: "button", variant: "outline", onClick: n, children: "Back" }),
|
|
4528
4554
|
/* @__PURE__ */ r(
|
|
4529
|
-
|
|
4555
|
+
Q,
|
|
4530
4556
|
{
|
|
4531
4557
|
type: "button",
|
|
4532
4558
|
onClick: N,
|
|
4533
|
-
disabled:
|
|
4559
|
+
disabled: B <= 0,
|
|
4534
4560
|
children: "Start Test"
|
|
4535
4561
|
}
|
|
4536
4562
|
)
|
|
4537
4563
|
] })
|
|
4538
4564
|
] });
|
|
4539
|
-
},
|
|
4565
|
+
}, Jr = ({
|
|
4540
4566
|
applicantId: e,
|
|
4541
4567
|
onComplete: t,
|
|
4542
4568
|
onBack: n
|
|
4543
4569
|
}) => {
|
|
4544
4570
|
var _e, He, Ue, je;
|
|
4545
|
-
const { applicantService: a, baseInformationService: s, config: l, currentTheme: c } =
|
|
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);
|
|
4546
4572
|
M.current = se;
|
|
4547
4573
|
const Z = At({
|
|
4548
4574
|
defaultValues: {
|
|
@@ -4557,24 +4583,24 @@ Failed to reload test data. Please refresh the page.`);
|
|
|
4557
4583
|
});
|
|
4558
4584
|
ne(() => {
|
|
4559
4585
|
if (se) {
|
|
4560
|
-
|
|
4586
|
+
O.current || (O.current = !0, f().then(() => H(!0)).catch((g) => console.error("[Identity] Auto-request failed:", g)).finally(() => E(!1)));
|
|
4561
4587
|
return;
|
|
4562
4588
|
}
|
|
4563
4589
|
(async () => {
|
|
4564
4590
|
try {
|
|
4565
|
-
const [g,
|
|
4591
|
+
const [g, x, d] = await Promise.all([
|
|
4566
4592
|
a.getApplicantData(e),
|
|
4567
4593
|
s.getCountries("", "en"),
|
|
4568
4594
|
s.getCountries("", "en", 40)
|
|
4569
4595
|
// CountriesType.PhoneNumber
|
|
4570
4596
|
]);
|
|
4571
|
-
|
|
4572
|
-
const
|
|
4573
|
-
|
|
4574
|
-
const
|
|
4575
|
-
|
|
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);
|
|
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));
|
|
4601
|
+
Y(_);
|
|
4576
4602
|
const y = g.applicantRequestData;
|
|
4577
|
-
if (
|
|
4603
|
+
if (A({
|
|
4578
4604
|
firstName: (y == null ? void 0 : y.firstName) || "",
|
|
4579
4605
|
lastName: (y == null ? void 0 : y.lastName) || "",
|
|
4580
4606
|
email: (y == null ? void 0 : y.email) || "",
|
|
@@ -4604,56 +4630,56 @@ Failed to reload test data. Please refresh the page.`);
|
|
|
4604
4630
|
country: (y == null ? void 0 : y.country) || "",
|
|
4605
4631
|
nationality: (y == null ? void 0 : y.nationality) || "",
|
|
4606
4632
|
phonenumber: (y == null ? void 0 : y.phonenumber) || ""
|
|
4607
|
-
}), g.kycRecords && g.kycRecords.length > 0 && g.kycRecords[0].providerTokenObject !== null &&
|
|
4608
|
-
console.log("[Identity] Review page disabled + existing identity — auto-requesting..."),
|
|
4633
|
+
}), g.kycRecords && g.kycRecords.length > 0 && g.kycRecords[0].providerTokenObject !== null && !O.current && M.current) {
|
|
4634
|
+
console.log("[Identity] Review page disabled + existing identity — auto-requesting..."), O.current = !0;
|
|
4609
4635
|
try {
|
|
4610
|
-
await f(),
|
|
4611
|
-
} catch (
|
|
4612
|
-
console.error("[Identity] Auto-request failed:",
|
|
4636
|
+
await f(), H(!0);
|
|
4637
|
+
} catch (q) {
|
|
4638
|
+
console.error("[Identity] Auto-request failed:", q);
|
|
4613
4639
|
}
|
|
4614
4640
|
}
|
|
4615
4641
|
} catch (g) {
|
|
4616
4642
|
console.error("Error loading applicant data:", g);
|
|
4617
4643
|
} finally {
|
|
4618
|
-
|
|
4644
|
+
E(!1);
|
|
4619
4645
|
}
|
|
4620
4646
|
})();
|
|
4621
4647
|
}, [e]), ne(() => {
|
|
4622
|
-
u && !N && M.current && (console.log("[Identity] Review page disabled — showing cached provider"),
|
|
4648
|
+
u && !N && M.current && (console.log("[Identity] Review page disabled — showing cached provider"), H(!0));
|
|
4623
4649
|
}, [u, N]), ne(() => {
|
|
4624
|
-
if (
|
|
4625
|
-
if (
|
|
4626
|
-
const i = new Date(
|
|
4650
|
+
if (m) {
|
|
4651
|
+
if (m.expiresAt) {
|
|
4652
|
+
const i = new Date(m.expiresAt).getTime();
|
|
4627
4653
|
if (Date.now() >= i) {
|
|
4628
|
-
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.");
|
|
4629
4655
|
return;
|
|
4630
4656
|
}
|
|
4631
4657
|
}
|
|
4632
|
-
if (
|
|
4658
|
+
if (m.url)
|
|
4633
4659
|
try {
|
|
4634
|
-
const g = new URL(
|
|
4660
|
+
const g = new URL(m.url).toString().toLowerCase();
|
|
4635
4661
|
if (g.includes("expired") || g.includes("invalid") || g.includes("error")) {
|
|
4636
|
-
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.");
|
|
4637
4663
|
return;
|
|
4638
4664
|
}
|
|
4639
4665
|
} catch {
|
|
4640
4666
|
console.error("[Identity] Invalid token URL");
|
|
4641
4667
|
}
|
|
4642
|
-
if (
|
|
4643
|
-
console.warn("[Identity] Token object indicates expiration"),
|
|
4668
|
+
if (m.status === "expired" || m.error === "expired" || m.expired === !0) {
|
|
4669
|
+
console.warn("[Identity] Token object indicates expiration"), L(!0), w("Your verification session has expired. Please restart.");
|
|
4644
4670
|
return;
|
|
4645
4671
|
}
|
|
4646
4672
|
}
|
|
4647
|
-
}, [
|
|
4648
|
-
if (h !== null &&
|
|
4673
|
+
}, [m]), ne(() => {
|
|
4674
|
+
if (h !== null && m && !b && N && !B) {
|
|
4649
4675
|
const i = h;
|
|
4650
|
-
if (
|
|
4651
|
-
console.log("[Identity] Loading provider URL for user verification:",
|
|
4676
|
+
if (m.url) {
|
|
4677
|
+
console.log("[Identity] Loading provider URL for user verification:", m.url), w(null);
|
|
4652
4678
|
try {
|
|
4653
|
-
if (new URL(
|
|
4679
|
+
if (new URL(m.url), i === ve.SardinAI) {
|
|
4654
4680
|
console.log("[SardinAI] Initializing Risk SDK in background...");
|
|
4655
4681
|
try {
|
|
4656
|
-
const g = ze.parseProviderConfig(h,
|
|
4682
|
+
const g = ze.parseProviderConfig(h, m, l);
|
|
4657
4683
|
ze.createProvider(h, g).initialize().then(() => {
|
|
4658
4684
|
console.log("[SardinAI] Risk SDK initialized successfully in background");
|
|
4659
4685
|
}).catch((d) => {
|
|
@@ -4663,66 +4689,66 @@ Failed to reload test data. Please refresh the page.`);
|
|
|
4663
4689
|
console.warn("[SardinAI] Risk SDK setup failed (non-blocking):", g);
|
|
4664
4690
|
}
|
|
4665
4691
|
}
|
|
4666
|
-
D({ type: "url", url:
|
|
4692
|
+
D({ type: "url", url: m.url });
|
|
4667
4693
|
} catch (g) {
|
|
4668
|
-
console.error("[Identity] Invalid URL:", g),
|
|
4694
|
+
console.error("[Identity] Invalid URL:", g), w("Invalid verification URL. Please restart."), L(!0);
|
|
4669
4695
|
}
|
|
4670
4696
|
return;
|
|
4671
4697
|
}
|
|
4672
4698
|
if (i === ve.SardinAI) {
|
|
4673
|
-
console.log("[SardinAI] No URL provided - initializing Risk SDK only..."),
|
|
4699
|
+
console.log("[SardinAI] No URL provided - initializing Risk SDK only..."), w(null);
|
|
4674
4700
|
try {
|
|
4675
|
-
const g = ze.parseProviderConfig(h,
|
|
4676
|
-
|
|
4677
|
-
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(() => {
|
|
4678
4704
|
t == null || t();
|
|
4679
4705
|
}, 2e3);
|
|
4680
4706
|
}).catch((d) => {
|
|
4681
|
-
var
|
|
4707
|
+
var I;
|
|
4682
4708
|
console.error("[SardinAI] Failed to initialize:", d);
|
|
4683
|
-
const
|
|
4684
|
-
|
|
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}`);
|
|
4685
4711
|
});
|
|
4686
4712
|
} catch (g) {
|
|
4687
|
-
console.error("[SardinAI] Error creating provider:", g),
|
|
4713
|
+
console.error("[SardinAI] Error creating provider:", g), w(`Configuration error: ${g.message}`);
|
|
4688
4714
|
}
|
|
4689
4715
|
return;
|
|
4690
4716
|
}
|
|
4691
4717
|
try {
|
|
4692
|
-
|
|
4693
|
-
const g = ze.parseProviderConfig(h,
|
|
4694
|
-
i === ve.Sumsub ? (
|
|
4695
|
-
var
|
|
4696
|
-
console.error("[Sumsub] Initialization error:", d),
|
|
4697
|
-
}),
|
|
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) => {
|
|
4721
|
+
var p;
|
|
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(() => {
|
|
4698
4724
|
t == null || t();
|
|
4699
|
-
})) : i === ve.Onfido &&
|
|
4700
|
-
console.error("[Onfido] Initialization error:", d),
|
|
4701
|
-
}), 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);
|
|
4702
4728
|
} catch (g) {
|
|
4703
|
-
console.error("[Identity] Provider setup error:", g),
|
|
4729
|
+
console.error("[Identity] Provider setup error:", g), w(`Setup error: ${g.message}`);
|
|
4704
4730
|
}
|
|
4705
4731
|
}
|
|
4706
4732
|
return () => {
|
|
4707
|
-
if (
|
|
4733
|
+
if (b && b.destroy)
|
|
4708
4734
|
try {
|
|
4709
|
-
|
|
4735
|
+
b.destroy();
|
|
4710
4736
|
} catch (i) {
|
|
4711
4737
|
console.error("[Identity] Error destroying provider:", i);
|
|
4712
4738
|
}
|
|
4713
4739
|
};
|
|
4714
|
-
}, [h,
|
|
4740
|
+
}, [h, m, b, N, t, B]);
|
|
4715
4741
|
const ie = async () => {
|
|
4716
4742
|
try {
|
|
4717
|
-
|
|
4743
|
+
w(null), L(!1), await f(), H(!0);
|
|
4718
4744
|
} catch (i) {
|
|
4719
4745
|
console.error("Error starting identity verification:", i);
|
|
4720
4746
|
}
|
|
4721
|
-
},
|
|
4747
|
+
}, Ae = async () => {
|
|
4722
4748
|
try {
|
|
4723
|
-
|
|
4749
|
+
w(null), L(!1), D(null), console.log("[Identity] Restarting verification..."), await S(), H(!0);
|
|
4724
4750
|
} catch (i) {
|
|
4725
|
-
console.error("Error restarting identity verification:", i),
|
|
4751
|
+
console.error("Error restarting identity verification:", i), w(i.message || "Failed to restart verification");
|
|
4726
4752
|
}
|
|
4727
4753
|
};
|
|
4728
4754
|
if (X || v)
|
|
@@ -4730,12 +4756,12 @@ Failed to reload test data. Please refresh the page.`);
|
|
|
4730
4756
|
/* @__PURE__ */ r(we, { className: "my-8" }),
|
|
4731
4757
|
/* @__PURE__ */ r("p", { className: "text-center text-gray-600 dark:text-gray-400 mt-4", children: "Loading identity verification..." })
|
|
4732
4758
|
] }) });
|
|
4733
|
-
if (
|
|
4759
|
+
if (C)
|
|
4734
4760
|
return /* @__PURE__ */ r(j, { children: /* @__PURE__ */ r(K, { children: /* @__PURE__ */ o("p", { className: "text-danger-500", children: [
|
|
4735
4761
|
"Error: ",
|
|
4736
|
-
|
|
4762
|
+
C.message
|
|
4737
4763
|
] }) }) });
|
|
4738
|
-
if (N && (
|
|
4764
|
+
if (N && (W || B))
|
|
4739
4765
|
return /* @__PURE__ */ o(j, { children: [
|
|
4740
4766
|
/* @__PURE__ */ r(ue, { children: /* @__PURE__ */ r("h2", { className: "text-2xl font-bold text-gray-900 dark:text-white", children: "Verification Session Issue" }) }),
|
|
4741
4767
|
/* @__PURE__ */ o(K, { children: [
|
|
@@ -4759,8 +4785,8 @@ Failed to reload test data. Please refresh the page.`);
|
|
|
4759
4785
|
}
|
|
4760
4786
|
),
|
|
4761
4787
|
/* @__PURE__ */ o("div", { children: [
|
|
4762
|
-
/* @__PURE__ */ r("h3", { className: "font-semibold text-red-900 dark:text-red-100 mb-1", children:
|
|
4763
|
-
/* @__PURE__ */ r("p", { className: "text-red-800 dark:text-red-200 text-sm", children:
|
|
4788
|
+
/* @__PURE__ */ r("h3", { className: "font-semibold text-red-900 dark:text-red-100 mb-1", children: B ? "Session Expired" : "Verification Error" }),
|
|
4789
|
+
/* @__PURE__ */ r("p", { className: "text-red-800 dark:text-red-200 text-sm", children: W || "Your verification session has expired and needs to be restarted." })
|
|
4764
4790
|
] })
|
|
4765
4791
|
] }) }),
|
|
4766
4792
|
/* @__PURE__ */ o("div", { className: "bg-blue-50 dark:bg-blue-900/20 border border-blue-200 dark:border-blue-800 rounded-lg p-4", children: [
|
|
@@ -4773,25 +4799,25 @@ Failed to reload test data. Please refresh the page.`);
|
|
|
4773
4799
|
] })
|
|
4774
4800
|
] }),
|
|
4775
4801
|
/* @__PURE__ */ o(me, { className: "flex justify-between", children: [
|
|
4776
|
-
n && /* @__PURE__ */ r(
|
|
4777
|
-
/* @__PURE__ */ r(
|
|
4802
|
+
n && /* @__PURE__ */ r(Q, { type: "button", variant: "outline", onClick: n, children: "Back" }),
|
|
4803
|
+
/* @__PURE__ */ r(Q, { type: "button", onClick: Ae, disabled: v, children: v ? "Restarting..." : "Restart Verification" })
|
|
4778
4804
|
] })
|
|
4779
4805
|
] });
|
|
4780
4806
|
if (N && u) {
|
|
4781
4807
|
const i = h;
|
|
4782
|
-
return
|
|
4808
|
+
return m != null && m.url ? /* @__PURE__ */ o(j, { children: [
|
|
4783
4809
|
/* @__PURE__ */ r(ue, { children: /* @__PURE__ */ o("div", { className: "flex items-center justify-between", children: [
|
|
4784
4810
|
/* @__PURE__ */ o("div", { children: [
|
|
4785
4811
|
/* @__PURE__ */ r("h2", { className: "text-2xl font-bold", children: "Identity Verification" }),
|
|
4786
4812
|
/* @__PURE__ */ r("p", { className: "text-gray-600 dark:text-gray-400 mt-1", children: "Please complete the identity verification process" })
|
|
4787
4813
|
] }),
|
|
4788
4814
|
/* @__PURE__ */ r(
|
|
4789
|
-
|
|
4815
|
+
Q,
|
|
4790
4816
|
{
|
|
4791
4817
|
type: "button",
|
|
4792
4818
|
variant: "outline",
|
|
4793
4819
|
size: "sm",
|
|
4794
|
-
onClick:
|
|
4820
|
+
onClick: Ae,
|
|
4795
4821
|
disabled: v,
|
|
4796
4822
|
children: "Restart"
|
|
4797
4823
|
}
|
|
@@ -4805,18 +4831,18 @@ Failed to reload test data. Please refresh the page.`);
|
|
|
4805
4831
|
/* @__PURE__ */ r("div", { className: "w-full", style: { height: "600px" }, children: /* @__PURE__ */ r(
|
|
4806
4832
|
"iframe",
|
|
4807
4833
|
{
|
|
4808
|
-
src:
|
|
4834
|
+
src: m.url,
|
|
4809
4835
|
className: "w-full h-full border-0 rounded-lg",
|
|
4810
4836
|
allow: "camera; microphone; geolocation",
|
|
4811
4837
|
title: "Identity Verification",
|
|
4812
4838
|
onLoad: (g) => {
|
|
4813
|
-
var
|
|
4839
|
+
var x, d, p;
|
|
4814
4840
|
console.log("[Identity] Iframe loaded");
|
|
4815
4841
|
try {
|
|
4816
|
-
const
|
|
4817
|
-
if (
|
|
4818
|
-
const
|
|
4819
|
-
(
|
|
4842
|
+
const I = g.target, z = I.contentDocument || ((x = I.contentWindow) == null ? void 0 : x.document);
|
|
4843
|
+
if (z) {
|
|
4844
|
+
const _ = ((p = (d = z.body) == null ? void 0 : d.textContent) == null ? void 0 : p.toLowerCase()) || "";
|
|
4845
|
+
(_.includes("expired") || _.includes("invalid") || _.includes("error")) && (console.warn("[Identity] Iframe shows expiration message"), L(!0), w("Your verification link has expired."));
|
|
4820
4846
|
}
|
|
4821
4847
|
} catch {
|
|
4822
4848
|
console.log("[Identity] Cannot check iframe content (CORS)");
|
|
@@ -4825,7 +4851,7 @@ Failed to reload test data. Please refresh the page.`);
|
|
|
4825
4851
|
}
|
|
4826
4852
|
) })
|
|
4827
4853
|
] }),
|
|
4828
|
-
n && /* @__PURE__ */ r(me, { children: /* @__PURE__ */ r(
|
|
4854
|
+
n && /* @__PURE__ */ r(me, { children: /* @__PURE__ */ r(Q, { variant: "outline", onClick: n, children: "Back" }) })
|
|
4829
4855
|
] }) : i === ve.SardinAI ? /* @__PURE__ */ o(j, { children: [
|
|
4830
4856
|
/* @__PURE__ */ o(ue, { children: [
|
|
4831
4857
|
/* @__PURE__ */ r("h2", { className: "text-2xl font-bold", children: "Device Risk Assessment" }),
|
|
@@ -4842,18 +4868,18 @@ Failed to reload test data. Please refresh the page.`);
|
|
|
4842
4868
|
/* @__PURE__ */ r("p", { className: "text-gray-600 dark:text-gray-400 mt-1", children: "Please complete the identity verification process" })
|
|
4843
4869
|
] }),
|
|
4844
4870
|
/* @__PURE__ */ r(K, { children: /* @__PURE__ */ r("div", { id: "identity-container", className: "min-h-[400px]" }) }),
|
|
4845
|
-
n && /* @__PURE__ */ r(me, { children: /* @__PURE__ */ r(
|
|
4871
|
+
n && /* @__PURE__ */ r(me, { children: /* @__PURE__ */ r(Q, { variant: "outline", onClick: n, children: "Back" }) })
|
|
4846
4872
|
] });
|
|
4847
4873
|
}
|
|
4848
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) => {
|
|
4849
4875
|
if (!g && g !== 0) return "—";
|
|
4850
4876
|
if (Pe.has(i) && i !== "mobileCountryCode") {
|
|
4851
|
-
const
|
|
4852
|
-
return
|
|
4877
|
+
const x = $.find((d) => d.value === g);
|
|
4878
|
+
return x ? x.label : String(g);
|
|
4853
4879
|
}
|
|
4854
4880
|
return String(g);
|
|
4855
4881
|
}, Xe = ({ helpText: i }) => {
|
|
4856
|
-
const [g,
|
|
4882
|
+
const [g, x] = k(!1), d = ee(null), [, p] = k({ top: 0, left: 0 });
|
|
4857
4883
|
return /* @__PURE__ */ o(Qe, { children: [
|
|
4858
4884
|
/* @__PURE__ */ r(
|
|
4859
4885
|
"button",
|
|
@@ -4862,10 +4888,10 @@ Failed to reload test data. Please refresh the page.`);
|
|
|
4862
4888
|
ref: d,
|
|
4863
4889
|
onClick: () => {
|
|
4864
4890
|
if (d.current) {
|
|
4865
|
-
const
|
|
4866
|
-
|
|
4891
|
+
const z = d.current.getBoundingClientRect();
|
|
4892
|
+
p({ top: z.bottom + window.scrollY + 6, left: z.left + window.scrollX });
|
|
4867
4893
|
}
|
|
4868
|
-
|
|
4894
|
+
x(!0);
|
|
4869
4895
|
},
|
|
4870
4896
|
style: {
|
|
4871
4897
|
width: 18,
|
|
@@ -4899,11 +4925,11 @@ Failed to reload test data. Please refresh the page.`);
|
|
|
4899
4925
|
alignItems: "center",
|
|
4900
4926
|
justifyContent: "center"
|
|
4901
4927
|
},
|
|
4902
|
-
onClick: () =>
|
|
4928
|
+
onClick: () => x(!1),
|
|
4903
4929
|
children: /* @__PURE__ */ o(
|
|
4904
4930
|
"div",
|
|
4905
4931
|
{
|
|
4906
|
-
onClick: (
|
|
4932
|
+
onClick: (z) => z.stopPropagation(),
|
|
4907
4933
|
style: {
|
|
4908
4934
|
background: "var(--metakyc-surface, #fff)",
|
|
4909
4935
|
border: "1px solid var(--metakyc-border, #e5e7eb)",
|
|
@@ -4919,7 +4945,7 @@ Failed to reload test data. Please refresh the page.`);
|
|
|
4919
4945
|
"button",
|
|
4920
4946
|
{
|
|
4921
4947
|
type: "button",
|
|
4922
|
-
onClick: () =>
|
|
4948
|
+
onClick: () => x(!1),
|
|
4923
4949
|
style: {
|
|
4924
4950
|
marginTop: 12,
|
|
4925
4951
|
padding: "4px 12px",
|
|
@@ -4941,13 +4967,13 @@ Failed to reload test data. Please refresh the page.`);
|
|
|
4941
4967
|
document.body
|
|
4942
4968
|
)
|
|
4943
4969
|
] });
|
|
4944
|
-
},
|
|
4970
|
+
}, xe = (i, g) => g ? /* @__PURE__ */ o("div", { style: { display: "flex", alignItems: "flex-start", gap: 5, flexWrap: "nowrap" }, children: [
|
|
4945
4971
|
/* @__PURE__ */ r("div", { style: { flex: 1, minWidth: 0 }, children: i }),
|
|
4946
4972
|
/* @__PURE__ */ r("div", { style: { paddingTop: 24 }, children: /* @__PURE__ */ r(Xe, { helpText: g }) })
|
|
4947
4973
|
] }) : i, et = (i, g) => {
|
|
4948
|
-
const
|
|
4974
|
+
const x = `cf-${g}`, d = i.paramName ?? "", p = U[d];
|
|
4949
4975
|
if (i.customType === "br")
|
|
4950
|
-
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);
|
|
4951
4977
|
if (i.customType === "paragraph")
|
|
4952
4978
|
return /* @__PURE__ */ r("div", { className: pe(i.colSpan), children: /* @__PURE__ */ r(
|
|
4953
4979
|
"div",
|
|
@@ -4956,7 +4982,7 @@ Failed to reload test data. Please refresh the page.`);
|
|
|
4956
4982
|
style: { color: "var(--metakyc-text-secondary, #6b7280)" },
|
|
4957
4983
|
dangerouslySetInnerHTML: { __html: i.label || "" }
|
|
4958
4984
|
}
|
|
4959
|
-
) },
|
|
4985
|
+
) }, x);
|
|
4960
4986
|
if (i.customType === "html")
|
|
4961
4987
|
return /* @__PURE__ */ r(
|
|
4962
4988
|
"div",
|
|
@@ -4964,10 +4990,10 @@ Failed to reload test data. Please refresh the page.`);
|
|
|
4964
4990
|
className: pe(i.colSpan),
|
|
4965
4991
|
dangerouslySetInnerHTML: { __html: i.label || "" }
|
|
4966
4992
|
},
|
|
4967
|
-
|
|
4993
|
+
x
|
|
4968
4994
|
);
|
|
4969
4995
|
if (i.customType === "link")
|
|
4970
|
-
return /* @__PURE__ */ r("div", { className: pe(i.colSpan), children:
|
|
4996
|
+
return /* @__PURE__ */ r("div", { className: pe(i.colSpan), children: xe(
|
|
4971
4997
|
/* @__PURE__ */ r(
|
|
4972
4998
|
"a",
|
|
4973
4999
|
{
|
|
@@ -4980,17 +5006,17 @@ Failed to reload test data. Please refresh the page.`);
|
|
|
4980
5006
|
}
|
|
4981
5007
|
),
|
|
4982
5008
|
i.helpText
|
|
4983
|
-
) },
|
|
5009
|
+
) }, x);
|
|
4984
5010
|
if (i.customType === "checkbox" || i.customType === "link_checkbox") {
|
|
4985
|
-
const
|
|
4986
|
-
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(
|
|
4987
5013
|
/* @__PURE__ */ o("label", { style: { display: "flex", alignItems: "flex-start", gap: 8, cursor: "pointer" }, children: [
|
|
4988
5014
|
/* @__PURE__ */ r(
|
|
4989
5015
|
"input",
|
|
4990
5016
|
{
|
|
4991
5017
|
type: "checkbox",
|
|
4992
|
-
checked: !!
|
|
4993
|
-
onChange: (
|
|
5018
|
+
checked: !!I,
|
|
5019
|
+
onChange: (z) => te((_) => ({ ..._, [d]: String(z.target.checked) })),
|
|
4994
5020
|
style: {
|
|
4995
5021
|
width: 16,
|
|
4996
5022
|
height: 16,
|
|
@@ -5006,121 +5032,121 @@ Failed to reload test data. Please refresh the page.`);
|
|
|
5006
5032
|
] }) : i.displayText || i.label })
|
|
5007
5033
|
] }),
|
|
5008
5034
|
i.helpText
|
|
5009
|
-
) },
|
|
5035
|
+
) }, x);
|
|
5010
5036
|
}
|
|
5011
5037
|
if (i.customType === "group_checkbox") {
|
|
5012
|
-
const
|
|
5013
|
-
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) => ({
|
|
5014
5040
|
...y,
|
|
5015
|
-
[d]:
|
|
5041
|
+
[d]: I.includes(_) ? I.filter((ae) => ae !== _) : [...I, _]
|
|
5016
5042
|
}));
|
|
5017
5043
|
};
|
|
5018
|
-
return /* @__PURE__ */ r("div", { className: pe(i.colSpan), children:
|
|
5044
|
+
return /* @__PURE__ */ r("div", { className: pe(i.colSpan), children: xe(
|
|
5019
5045
|
/* @__PURE__ */ o("div", { className: "space-y-1.5", children: [
|
|
5020
5046
|
i.label && /* @__PURE__ */ r("p", { className: "text-sm font-medium", style: { color: "var(--metakyc-text-primary, #111827)" }, children: i.displayText || i.label }),
|
|
5021
|
-
(i.options || []).map((
|
|
5047
|
+
(i.options || []).map((_) => /* @__PURE__ */ o("label", { style: { display: "flex", alignItems: "flex-start", gap: 8, cursor: "pointer" }, children: [
|
|
5022
5048
|
/* @__PURE__ */ r(
|
|
5023
5049
|
"input",
|
|
5024
5050
|
{
|
|
5025
5051
|
type: "checkbox",
|
|
5026
|
-
checked:
|
|
5027
|
-
onChange: () => _
|
|
5052
|
+
checked: I.includes(_.value),
|
|
5053
|
+
onChange: () => z(_.value),
|
|
5028
5054
|
style: { width: 16, height: 16, flexShrink: 0, marginTop: 2, accentColor: "var(--metakyc-primary, #6366f1)" }
|
|
5029
5055
|
}
|
|
5030
5056
|
),
|
|
5031
|
-
/* @__PURE__ */ r("span", { className: "text-sm", style: { color: "var(--metakyc-text-primary, #111827)" }, children:
|
|
5032
|
-
] },
|
|
5057
|
+
/* @__PURE__ */ r("span", { className: "text-sm", style: { color: "var(--metakyc-text-primary, #111827)" }, children: _.label })
|
|
5058
|
+
] }, _.value))
|
|
5033
5059
|
] }),
|
|
5034
5060
|
i.helpText
|
|
5035
|
-
) },
|
|
5061
|
+
) }, x);
|
|
5036
5062
|
}
|
|
5037
|
-
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(
|
|
5038
5064
|
/* @__PURE__ */ o("div", { className: "space-y-1.5", children: [
|
|
5039
5065
|
i.label && /* @__PURE__ */ r("p", { className: "text-sm font-medium", style: { color: "var(--metakyc-text-primary, #111827)" }, children: i.displayText || i.label }),
|
|
5040
|
-
(i.options || []).map((
|
|
5066
|
+
(i.options || []).map((I) => /* @__PURE__ */ o("label", { style: { display: "flex", alignItems: "flex-start", gap: 8, cursor: "pointer" }, children: [
|
|
5041
5067
|
/* @__PURE__ */ r(
|
|
5042
5068
|
"input",
|
|
5043
5069
|
{
|
|
5044
5070
|
type: "radio",
|
|
5045
5071
|
name: `rg-${d}`,
|
|
5046
|
-
value:
|
|
5047
|
-
checked:
|
|
5048
|
-
onChange: () => te((
|
|
5072
|
+
value: I.value,
|
|
5073
|
+
checked: p === I.value,
|
|
5074
|
+
onChange: () => te((z) => ({ ...z, [d]: I.value })),
|
|
5049
5075
|
style: { width: 16, height: 16, flexShrink: 0, marginTop: 2, accentColor: "var(--metakyc-primary, #6366f1)" }
|
|
5050
5076
|
}
|
|
5051
5077
|
),
|
|
5052
|
-
/* @__PURE__ */ r("span", { className: "text-sm", style: { color: "var(--metakyc-text-primary, #111827)" }, children:
|
|
5053
|
-
] },
|
|
5078
|
+
/* @__PURE__ */ r("span", { className: "text-sm", style: { color: "var(--metakyc-text-primary, #111827)" }, children: I.label })
|
|
5079
|
+
] }, I.value))
|
|
5054
5080
|
] }),
|
|
5055
5081
|
i.helpText
|
|
5056
|
-
) },
|
|
5082
|
+
) }, x) : /* @__PURE__ */ r("div", { className: pe(i.colSpan), children: xe(
|
|
5057
5083
|
/* @__PURE__ */ r(
|
|
5058
5084
|
de,
|
|
5059
5085
|
{
|
|
5060
5086
|
label: i.displayText || i.label || d,
|
|
5061
|
-
value: String(
|
|
5062
|
-
onChange: (
|
|
5087
|
+
value: String(p ?? ""),
|
|
5088
|
+
onChange: (I) => te((z) => ({ ...z, [d]: I.target.value }))
|
|
5063
5089
|
}
|
|
5064
5090
|
),
|
|
5065
5091
|
i.helpText
|
|
5066
|
-
) },
|
|
5092
|
+
) }, x);
|
|
5067
5093
|
}, tt = (i, g) => {
|
|
5068
5094
|
if (i.isCustom) return et(i, g);
|
|
5069
|
-
const
|
|
5070
|
-
return i.editable ?
|
|
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(
|
|
5071
5097
|
/* @__PURE__ */ r(
|
|
5072
5098
|
Re,
|
|
5073
5099
|
{
|
|
5074
|
-
label:
|
|
5075
|
-
value: String(
|
|
5076
|
-
onChange: (y) =>
|
|
5077
|
-
options: [{ value: "", label: "Select country code…" }, ...
|
|
5100
|
+
label: p,
|
|
5101
|
+
value: String(I),
|
|
5102
|
+
onChange: (y) => A((ae) => ({ ...ae, [x]: y })),
|
|
5103
|
+
options: [{ value: "", label: "Select country code…" }, ...T]
|
|
5078
5104
|
}
|
|
5079
5105
|
),
|
|
5080
5106
|
i.helpText
|
|
5081
|
-
) }, `epc-${g}`) :
|
|
5107
|
+
) }, `epc-${g}`) : _ ? /* @__PURE__ */ r("div", { className: pe(i.colSpan ?? 2), children: xe(
|
|
5082
5108
|
/* @__PURE__ */ r(
|
|
5083
5109
|
Re,
|
|
5084
5110
|
{
|
|
5085
|
-
label:
|
|
5086
|
-
value: String(
|
|
5087
|
-
onChange: (y) =>
|
|
5088
|
-
options: [{ value: "", label: `Select ${
|
|
5111
|
+
label: p,
|
|
5112
|
+
value: String(I),
|
|
5113
|
+
onChange: (y) => A((ae) => ({ ...ae, [x]: y })),
|
|
5114
|
+
options: [{ value: "", label: `Select ${p.toLowerCase()}…` }, ...$]
|
|
5089
5115
|
}
|
|
5090
5116
|
),
|
|
5091
5117
|
i.helpText
|
|
5092
|
-
) }, `ec-${g}`) : /* @__PURE__ */ r("div", { className: pe(i.colSpan ?? 2), children:
|
|
5118
|
+
) }, `ec-${g}`) : /* @__PURE__ */ r("div", { className: pe(i.colSpan ?? 2), children: xe(
|
|
5093
5119
|
/* @__PURE__ */ r(
|
|
5094
5120
|
de,
|
|
5095
5121
|
{
|
|
5096
|
-
label:
|
|
5122
|
+
label: p,
|
|
5097
5123
|
type: (d == null ? void 0 : d.type) === "date" ? "date" : (d == null ? void 0 : d.type) === "email" ? "email" : "text",
|
|
5098
|
-
value: String(
|
|
5099
|
-
onChange: (y) =>
|
|
5124
|
+
value: String(I),
|
|
5125
|
+
onChange: (y) => A((ae) => ({ ...ae, [x]: y.target.value }))
|
|
5100
5126
|
}
|
|
5101
5127
|
),
|
|
5102
5128
|
i.helpText
|
|
5103
|
-
) }, `ei-${g}`) : /* @__PURE__ */ r("div", { className: pe(i.colSpan ?? 2), children:
|
|
5129
|
+
) }, `ei-${g}`) : /* @__PURE__ */ r("div", { className: pe(i.colSpan ?? 2), children: xe(
|
|
5104
5130
|
/* @__PURE__ */ o(Qe, { children: [
|
|
5105
|
-
/* @__PURE__ */ r("label", { className: "block text-sm font-medium mb-0.5", style: { color: "var(--metakyc-text-secondary, #6b7280)" }, children:
|
|
5106
|
-
/* @__PURE__ */ r("p", { className: "text-sm", style: { color: "var(--metakyc-text-primary, #111827)", minHeight: "1.5rem" }, children: Oe(
|
|
5131
|
+
/* @__PURE__ */ r("label", { className: "block text-sm font-medium mb-0.5", style: { color: "var(--metakyc-text-secondary, #6b7280)" }, children: p }),
|
|
5132
|
+
/* @__PURE__ */ r("p", { className: "text-sm", style: { color: "var(--metakyc-text-primary, #111827)", minHeight: "1.5rem" }, children: Oe(x, I) })
|
|
5107
5133
|
] }),
|
|
5108
5134
|
i.helpText
|
|
5109
5135
|
) }, `ro-${g}`);
|
|
5110
5136
|
};
|
|
5111
|
-
if (
|
|
5112
|
-
const i =
|
|
5113
|
-
return /* @__PURE__ */ r("form", { onSubmit: (
|
|
5114
|
-
|
|
5137
|
+
if (ye) {
|
|
5138
|
+
const i = ye.title || "Review Your Information", g = ye.subtitle || "Please review and confirm your information before starting identity verification";
|
|
5139
|
+
return /* @__PURE__ */ r("form", { onSubmit: (x) => {
|
|
5140
|
+
x.preventDefault(), ie();
|
|
5115
5141
|
}, children: /* @__PURE__ */ o(j, { children: [
|
|
5116
5142
|
/* @__PURE__ */ o(ue, { children: [
|
|
5117
5143
|
/* @__PURE__ */ r("h2", { className: "text-lg font-bold", style: { color: "var(--metakyc-text-primary, #111827)" }, children: i }),
|
|
5118
5144
|
/* @__PURE__ */ r("p", { className: "mt-1 text-sm", style: { color: "var(--metakyc-text-secondary, #6b7280)" }, children: g })
|
|
5119
5145
|
] }),
|
|
5120
|
-
/* @__PURE__ */ r(K, { children: /* @__PURE__ */ r("div", { className: "grid grid-cols-4 gap-4", children:
|
|
5146
|
+
/* @__PURE__ */ r(K, { children: /* @__PURE__ */ r("div", { className: "grid grid-cols-4 gap-4", children: ye.fields.map((x, d) => tt(x, d)) }) }),
|
|
5121
5147
|
/* @__PURE__ */ o(me, { className: "flex justify-between", children: [
|
|
5122
|
-
n && /* @__PURE__ */ r(
|
|
5123
|
-
/* @__PURE__ */ r(
|
|
5148
|
+
n && /* @__PURE__ */ r(Q, { type: "button", variant: "outline", onClick: n, children: "Back" }),
|
|
5149
|
+
/* @__PURE__ */ r(Q, { type: "submit", isLoading: v, children: "Confirm and Start Verification" })
|
|
5124
5150
|
] })
|
|
5125
5151
|
] }) });
|
|
5126
5152
|
}
|
|
@@ -5131,9 +5157,9 @@ Failed to reload test data. Please refresh the page.`);
|
|
|
5131
5157
|
] }),
|
|
5132
5158
|
/* @__PURE__ */ o(K, { className: "space-y-6", children: [
|
|
5133
5159
|
/* @__PURE__ */ r("div", { className: "space-y-4 pb-4", style: { borderBottom: "1px solid var(--metakyc-border, #e5e7eb)" }, children: [
|
|
5134
|
-
{ label: "Name", value: `${((_e =
|
|
5135
|
-
{ label: "Email", value: (Ue =
|
|
5136
|
-
{ label: "Date of Birth", value: ((je =
|
|
5160
|
+
{ label: "Name", value: `${((_e = F == null ? void 0 : F.applicantRequestData) == null ? void 0 : _e.firstName) || ""} ${((He = F == null ? void 0 : F.applicantRequestData) == null ? void 0 : He.lastName) || ""}`.trim() },
|
|
5161
|
+
{ label: "Email", value: (Ue = F == null ? void 0 : F.applicantRequestData) == null ? void 0 : Ue.email },
|
|
5162
|
+
{ label: "Date of Birth", value: ((je = F == null ? void 0 : F.applicantRequestData) == null ? void 0 : je.dateOfBirth) || "Not provided" }
|
|
5137
5163
|
].map(({ label: i, value: g }) => /* @__PURE__ */ o("div", { children: [
|
|
5138
5164
|
/* @__PURE__ */ r("label", { className: "block text-sm font-medium", style: { color: "var(--metakyc-text-secondary, #6b7280)" }, children: i }),
|
|
5139
5165
|
/* @__PURE__ */ r("p", { className: "mt-1 text-base", style: { color: "var(--metakyc-text-primary, #111827)" }, children: g })
|
|
@@ -5152,7 +5178,7 @@ Failed to reload test data. Please refresh the page.`);
|
|
|
5152
5178
|
label: "Country",
|
|
5153
5179
|
value: i.value,
|
|
5154
5180
|
onChange: i.onChange,
|
|
5155
|
-
options: [{ value: "", label: "Select country…" },
|
|
5181
|
+
options: [{ value: "", label: "Select country…" }, ...$]
|
|
5156
5182
|
}
|
|
5157
5183
|
)
|
|
5158
5184
|
}
|
|
@@ -5168,7 +5194,7 @@ Failed to reload test data. Please refresh the page.`);
|
|
|
5168
5194
|
label: "Nationality",
|
|
5169
5195
|
value: i.value,
|
|
5170
5196
|
onChange: i.onChange,
|
|
5171
|
-
options: [{ value: "", label: "Select nationality…" },
|
|
5197
|
+
options: [{ value: "", label: "Select nationality…" }, ...$]
|
|
5172
5198
|
}
|
|
5173
5199
|
)
|
|
5174
5200
|
}
|
|
@@ -5186,8 +5212,8 @@ Failed to reload test data. Please refresh the page.`);
|
|
|
5186
5212
|
] })
|
|
5187
5213
|
] }),
|
|
5188
5214
|
/* @__PURE__ */ o(me, { className: "flex justify-between", children: [
|
|
5189
|
-
n && /* @__PURE__ */ r(
|
|
5190
|
-
/* @__PURE__ */ r(
|
|
5215
|
+
n && /* @__PURE__ */ r(Q, { type: "button", variant: "outline", onClick: n, children: "Back" }),
|
|
5216
|
+
/* @__PURE__ */ r(Q, { type: "submit", isLoading: v, children: "Confirm and Start Verification" })
|
|
5191
5217
|
] })
|
|
5192
5218
|
] }) });
|
|
5193
5219
|
}, mt = ({
|
|
@@ -5280,7 +5306,7 @@ Failed to reload test data. Please refresh the page.`);
|
|
|
5280
5306
|
) }),
|
|
5281
5307
|
/* @__PURE__ */ r("h2", { className: "text-3xl font-bold text-center text-gray-900 dark:text-white mb-4", children: u.title }),
|
|
5282
5308
|
/* @__PURE__ */ r("div", { className: "flex justify-center mb-6", children: /* @__PURE__ */ r(
|
|
5283
|
-
|
|
5309
|
+
Ie,
|
|
5284
5310
|
{
|
|
5285
5311
|
variant: u.type === "success" ? "success" : u.type === "error" ? "danger" : u.type === "pending" ? "warning" : "info",
|
|
5286
5312
|
children: e != null ? Le[e] : De[t]
|
|
@@ -5324,15 +5350,15 @@ Failed to reload test data. Please refresh the page.`);
|
|
|
5324
5350
|
] }) })
|
|
5325
5351
|
] }),
|
|
5326
5352
|
/* @__PURE__ */ o(me, { className: "flex justify-center gap-4", children: [
|
|
5327
|
-
u.type === "success" && s && /* @__PURE__ */ r(
|
|
5353
|
+
u.type === "success" && s && /* @__PURE__ */ r(Q, { onClick: s, size: "lg", children: "Continue" }),
|
|
5328
5354
|
u.type === "error" && /* @__PURE__ */ o(Qe, { children: [
|
|
5329
|
-
l && /* @__PURE__ */ r(
|
|
5330
|
-
s && /* @__PURE__ */ r(
|
|
5355
|
+
l && /* @__PURE__ */ r(Q, { variant: "outline", onClick: l, children: "Contact Support" }),
|
|
5356
|
+
s && /* @__PURE__ */ r(Q, { onClick: s, children: "Try Again" })
|
|
5331
5357
|
] }),
|
|
5332
5358
|
u.type === "pending" && /* @__PURE__ */ r("div", { className: "text-center", children: /* @__PURE__ */ r("p", { className: "text-sm text-gray-500 dark:text-gray-400", children: "Please check back later or wait for our email notification" }) })
|
|
5333
5359
|
] })
|
|
5334
5360
|
] });
|
|
5335
|
-
},
|
|
5361
|
+
}, Zr = ({ config: e, className: t = "" }) => !(e != null && e.visible) || !(e != null && e.url) ? null : /* @__PURE__ */ r("div", { className: `metakyc-logo ${t}`, children: /* @__PURE__ */ r(
|
|
5336
5362
|
"img",
|
|
5337
5363
|
{
|
|
5338
5364
|
src: e.url,
|
|
@@ -5352,10 +5378,10 @@ Failed to reload test data. Please refresh the page.`);
|
|
|
5352
5378
|
subtitle: t,
|
|
5353
5379
|
className: n = ""
|
|
5354
5380
|
}) => {
|
|
5355
|
-
const { currentTheme: a } =
|
|
5381
|
+
const { currentTheme: a } = ge(), s = e || (a == null ? void 0 : a.title) || "", l = !!(a != null && a.logo && a.logo.visible && a.logo.url), c = !!s;
|
|
5356
5382
|
return !l && !c ? null : /* @__PURE__ */ o("div", { className: `metakyc-header ${n}`, children: [
|
|
5357
5383
|
/* @__PURE__ */ o("div", { className: "metakyc-header-title flex items-center text-xl font-bold text-gray-900 dark:text-white", children: [
|
|
5358
|
-
l && /* @__PURE__ */ r(
|
|
5384
|
+
l && /* @__PURE__ */ r(Zr, { config: a.logo }),
|
|
5359
5385
|
l && c && /* @__PURE__ */ r(
|
|
5360
5386
|
"span",
|
|
5361
5387
|
{
|
|
@@ -5385,7 +5411,7 @@ const qe = {
|
|
|
5385
5411
|
display: "inline-block",
|
|
5386
5412
|
verticalAlign: "middle"
|
|
5387
5413
|
}, pt = ({ helpText: e, children: t }) => {
|
|
5388
|
-
const [n, a] =
|
|
5414
|
+
const [n, a] = be.useState(!1);
|
|
5389
5415
|
if (!e) return /* @__PURE__ */ r(Qe, { children: t });
|
|
5390
5416
|
const s = n ? /* @__PURE__ */ r(
|
|
5391
5417
|
"div",
|
|
@@ -5499,38 +5525,38 @@ const qe = {
|
|
|
5499
5525
|
),
|
|
5500
5526
|
typeof document < "u" && s ? it(s, document.body) : null
|
|
5501
5527
|
] });
|
|
5502
|
-
},
|
|
5528
|
+
}, bn = ({
|
|
5503
5529
|
workflowKey: e,
|
|
5504
5530
|
externalRefId: t,
|
|
5505
5531
|
onSuccess: n,
|
|
5506
5532
|
onCancel: a
|
|
5507
5533
|
}) => {
|
|
5508
5534
|
var _e, He, Ue, je;
|
|
5509
|
-
const { config: s, baseInformationService: l, currentTheme: c } =
|
|
5510
|
-
if (!
|
|
5535
|
+
const { config: s, baseInformationService: l, currentTheme: c } = ge(), { createApplicant: u, isLoading: h } = Sr(), m = e || ((_e = s.applicantForm) == null ? void 0 : _e.workflowKey);
|
|
5536
|
+
if (!m)
|
|
5511
5537
|
throw new Error(
|
|
5512
5538
|
"workflowKey is required. Provide it either as a prop to CreateApplicantForm or set it in config.applicantForm.workflowKey"
|
|
5513
5539
|
);
|
|
5514
|
-
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(
|
|
5515
5541
|
() => c != null && c.applicantFormPages && c.applicantFormPages.length > 0 ? c.applicantFormPages : null,
|
|
5516
5542
|
[c == null ? void 0 : c.applicantFormPages]
|
|
5517
|
-
),
|
|
5543
|
+
), S = Ee(() => {
|
|
5518
5544
|
const i = new Set(Ve), g = c == null ? void 0 : c.applicantFormRequiredFields;
|
|
5519
|
-
if (g) for (const
|
|
5545
|
+
if (g) for (const x of g) i.add(x);
|
|
5520
5546
|
if (f)
|
|
5521
|
-
for (const
|
|
5522
|
-
for (const d of
|
|
5547
|
+
for (const x of f)
|
|
5548
|
+
for (const d of x.fields)
|
|
5523
5549
|
!d.isCustom && d.name && d.required && i.add(d.name);
|
|
5524
5550
|
return Array.from(i);
|
|
5525
|
-
}, [c == null ? void 0 : c.applicantFormRequiredFields, f]),
|
|
5526
|
-
var
|
|
5551
|
+
}, [c == null ? void 0 : c.applicantFormRequiredFields, f]), b = Ee(() => {
|
|
5552
|
+
var x;
|
|
5527
5553
|
if (f) {
|
|
5528
|
-
const d = f.flatMap((
|
|
5529
|
-
for (const
|
|
5530
|
-
return Array.from(
|
|
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);
|
|
5556
|
+
return Array.from(p);
|
|
5531
5557
|
}
|
|
5532
5558
|
let i;
|
|
5533
|
-
(
|
|
5559
|
+
(x = s.applicantForm) != null && x.visibleFields ? i = s.applicantForm.visibleFields : c != null && c.applicantFormVisibleFields && c.applicantFormVisibleFields.length > 0 ? i = c.applicantFormVisibleFields : i = zt;
|
|
5534
5560
|
const g = new Set(i);
|
|
5535
5561
|
for (const d of Ve) g.add(d);
|
|
5536
5562
|
return Array.from(g);
|
|
@@ -5541,65 +5567,65 @@ const qe = {
|
|
|
5541
5567
|
"countryOfBirth",
|
|
5542
5568
|
"mobileCountryCode",
|
|
5543
5569
|
"otherNationality"
|
|
5544
|
-
]),
|
|
5545
|
-
var g,
|
|
5570
|
+
]), F = Ee(() => {
|
|
5571
|
+
var g, x;
|
|
5546
5572
|
const i = /* @__PURE__ */ new Set();
|
|
5547
5573
|
if (f)
|
|
5548
5574
|
for (const d of f)
|
|
5549
|
-
for (const
|
|
5550
|
-
!
|
|
5575
|
+
for (const p of d.fields)
|
|
5576
|
+
!p.isCustom && p.name && D.has(p.name) && i.add(p.countriesType ?? ((g = Me[p.name]) == null ? void 0 : g.countriesType));
|
|
5551
5577
|
else
|
|
5552
|
-
for (const d of
|
|
5553
|
-
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);
|
|
5554
5580
|
return i.size === 0 && i.add(void 0), Array.from(i);
|
|
5555
|
-
}, [
|
|
5581
|
+
}, [b, f]), [P, $] = k({}), [R, T] = k(!0), Y = ee(/* @__PURE__ */ new Set()), X = ee(/* @__PURE__ */ new Set());
|
|
5556
5582
|
ne(() => {
|
|
5557
5583
|
if (!c) return;
|
|
5558
|
-
const i =
|
|
5559
|
-
const
|
|
5560
|
-
return !X.current.has(
|
|
5584
|
+
const i = F.filter((d) => {
|
|
5585
|
+
const p = d != null ? String(d) : "all";
|
|
5586
|
+
return !X.current.has(p) && !Y.current.has(p);
|
|
5561
5587
|
});
|
|
5562
5588
|
if (i.length === 0) {
|
|
5563
|
-
|
|
5564
|
-
const
|
|
5565
|
-
return X.current.has(
|
|
5566
|
-
}) &&
|
|
5589
|
+
F.every((p) => {
|
|
5590
|
+
const I = p != null ? String(p) : "all";
|
|
5591
|
+
return X.current.has(I);
|
|
5592
|
+
}) && T(!1);
|
|
5567
5593
|
return;
|
|
5568
5594
|
}
|
|
5569
|
-
|
|
5595
|
+
T(!0);
|
|
5570
5596
|
const g = i.map((d) => d != null ? String(d) : "all");
|
|
5571
|
-
g.forEach((d) =>
|
|
5597
|
+
g.forEach((d) => Y.current.add(d)), (async () => {
|
|
5572
5598
|
try {
|
|
5573
5599
|
const d = await Promise.all(
|
|
5574
|
-
i.map(async (
|
|
5575
|
-
const
|
|
5576
|
-
value:
|
|
5577
|
-
label: `${
|
|
5578
|
-
} : { value:
|
|
5579
|
-
return X.current.add(
|
|
5600
|
+
i.map(async (p) => {
|
|
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 ? {
|
|
5602
|
+
value: q.countryCode,
|
|
5603
|
+
label: `${q.countryCode} – ${q.name}`
|
|
5604
|
+
} : { value: q.abbreviation3 || q.abbreviation, label: q.name }).filter((q) => !q.value || y.has(q.value) ? !1 : (y.add(q.value), !0));
|
|
5605
|
+
return X.current.add(I), Y.current.delete(I), [I, ae];
|
|
5580
5606
|
})
|
|
5581
5607
|
);
|
|
5582
|
-
|
|
5608
|
+
$((p) => ({ ...p, ...Object.fromEntries(d) }));
|
|
5583
5609
|
} catch (d) {
|
|
5584
|
-
g.forEach((
|
|
5610
|
+
g.forEach((p) => Y.current.delete(p)), console.error("Failed to load countries:", d);
|
|
5585
5611
|
} finally {
|
|
5586
|
-
|
|
5587
|
-
const
|
|
5588
|
-
return X.current.has(
|
|
5589
|
-
}) &&
|
|
5612
|
+
F.every((p) => {
|
|
5613
|
+
const I = p != null ? String(p) : "all";
|
|
5614
|
+
return X.current.has(I);
|
|
5615
|
+
}) && T(!1);
|
|
5590
5616
|
}
|
|
5591
5617
|
})();
|
|
5592
|
-
}, [
|
|
5593
|
-
const
|
|
5594
|
-
var
|
|
5595
|
-
const
|
|
5596
|
-
return
|
|
5597
|
-
}, [N,
|
|
5598
|
-
workflowKey:
|
|
5618
|
+
}, [F, c]);
|
|
5619
|
+
const E = (i, g) => {
|
|
5620
|
+
var p;
|
|
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({
|
|
5624
|
+
workflowKey: m,
|
|
5599
5625
|
firstName: "",
|
|
5600
5626
|
lastName: "",
|
|
5601
5627
|
title: "",
|
|
5602
|
-
email:
|
|
5628
|
+
email: C,
|
|
5603
5629
|
dateOfBirth: "",
|
|
5604
5630
|
phonenumber: "",
|
|
5605
5631
|
externalRefId: v,
|
|
@@ -5619,48 +5645,48 @@ const qe = {
|
|
|
5619
5645
|
educationLevel: "",
|
|
5620
5646
|
occupation: "",
|
|
5621
5647
|
taxNumber: ""
|
|
5622
|
-
}), [
|
|
5623
|
-
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;
|
|
5624
5650
|
const g = {};
|
|
5625
5651
|
for (const d of i.fields)
|
|
5626
5652
|
if (d.isCustom) {
|
|
5627
5653
|
if (d.customType === "paragraph" || d.customType === "html" || d.customType === "br" || d.customType === "link") continue;
|
|
5628
5654
|
if (d.required && d.paramName) {
|
|
5629
|
-
const
|
|
5630
|
-
d.customType === "checkbox" || d.customType === "link_checkbox" ?
|
|
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.`);
|
|
5631
5657
|
}
|
|
5632
5658
|
} else if (d.name) {
|
|
5633
|
-
const
|
|
5634
|
-
if (
|
|
5635
|
-
const
|
|
5636
|
-
g[
|
|
5659
|
+
const p = d.name;
|
|
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.`;
|
|
5637
5663
|
}
|
|
5638
5664
|
}
|
|
5639
5665
|
return g;
|
|
5640
5666
|
}, pe = async () => {
|
|
5641
5667
|
if (!f) return;
|
|
5642
|
-
const i = f[
|
|
5668
|
+
const i = f[B];
|
|
5643
5669
|
if (i.conditionalOn && !Z(i)) {
|
|
5644
|
-
|
|
5670
|
+
G({}), ie >= 0 ? L(ie) : await Oe();
|
|
5645
5671
|
return;
|
|
5646
5672
|
}
|
|
5647
5673
|
const g = Pe(i);
|
|
5648
5674
|
if (Object.keys(g).length > 0) {
|
|
5649
|
-
|
|
5675
|
+
G(g);
|
|
5650
5676
|
return;
|
|
5651
5677
|
}
|
|
5652
|
-
|
|
5678
|
+
G({}), ie >= 0 ? L(ie) : await Oe();
|
|
5653
5679
|
}, Oe = async () => {
|
|
5654
5680
|
if (f) {
|
|
5655
5681
|
let i = {};
|
|
5656
5682
|
for (const g of f)
|
|
5657
5683
|
Z(g) && (i = { ...i, ...Pe(g) });
|
|
5658
5684
|
if (Object.keys(i).length > 0) {
|
|
5659
|
-
|
|
5685
|
+
G(i);
|
|
5660
5686
|
return;
|
|
5661
5687
|
}
|
|
5662
5688
|
}
|
|
5663
|
-
|
|
5689
|
+
ye(!0), U(null);
|
|
5664
5690
|
try {
|
|
5665
5691
|
if (!N.externalRefId || N.externalRefId.trim() === "") {
|
|
5666
5692
|
U("External Reference ID is required. Please pass it via config.applicantForm.externalRefId.");
|
|
@@ -5673,74 +5699,74 @@ const qe = {
|
|
|
5673
5699
|
if (f) {
|
|
5674
5700
|
for (const d of f)
|
|
5675
5701
|
if (Z(d)) {
|
|
5676
|
-
for (const
|
|
5677
|
-
if (!
|
|
5678
|
-
const
|
|
5679
|
-
Ye(
|
|
5702
|
+
for (const p of d.fields)
|
|
5703
|
+
if (!p.isCustom && p.name) {
|
|
5704
|
+
const I = p.name, z = N[I];
|
|
5705
|
+
Ye(z) || (i[I] = z);
|
|
5680
5706
|
}
|
|
5681
5707
|
}
|
|
5682
5708
|
for (const d of Ve)
|
|
5683
5709
|
if (i[d] === void 0) {
|
|
5684
|
-
const
|
|
5685
|
-
Ye(
|
|
5710
|
+
const p = N[d];
|
|
5711
|
+
Ye(p) || (i[d] = p);
|
|
5686
5712
|
}
|
|
5687
5713
|
} else
|
|
5688
|
-
|
|
5714
|
+
b.forEach((d) => {
|
|
5689
5715
|
if (d === "externalRefId") return;
|
|
5690
|
-
const
|
|
5691
|
-
Ye(
|
|
5716
|
+
const p = N[d];
|
|
5717
|
+
Ye(p) || (i[d] = p);
|
|
5692
5718
|
});
|
|
5693
5719
|
const g = [];
|
|
5694
5720
|
if (f) {
|
|
5695
5721
|
for (const d of f)
|
|
5696
5722
|
if (Z(d))
|
|
5697
|
-
for (const
|
|
5698
|
-
if (!
|
|
5699
|
-
const
|
|
5700
|
-
let
|
|
5701
|
-
if (
|
|
5702
|
-
|
|
5703
|
-
else if (
|
|
5704
|
-
g.push({ paramName:
|
|
5723
|
+
for (const p of d.fields) {
|
|
5724
|
+
if (!p.isCustom || !p.paramName || p.customType === "paragraph" || p.customType === "html" || p.customType === "br" || p.customType === "link") continue;
|
|
5725
|
+
const I = W[p.paramName] ?? "";
|
|
5726
|
+
let z;
|
|
5727
|
+
if (p.customType === "checkbox" || p.customType === "link_checkbox")
|
|
5728
|
+
z = I === "true" ? "yes" : "no";
|
|
5729
|
+
else if (z = I, !z && !p.required) continue;
|
|
5730
|
+
g.push({ paramName: p.paramName, value: z });
|
|
5705
5731
|
}
|
|
5706
5732
|
}
|
|
5707
5733
|
g.length > 0 && (i.applicantAdditionalDatas = g);
|
|
5708
|
-
const
|
|
5709
|
-
n(
|
|
5734
|
+
const x = await u(i);
|
|
5735
|
+
n(x.applicantId);
|
|
5710
5736
|
} catch (i) {
|
|
5711
5737
|
console.error("Error creating applicant:", i), U(i.message || "Failed to create applicant");
|
|
5712
5738
|
} finally {
|
|
5713
|
-
|
|
5739
|
+
ye(!1);
|
|
5714
5740
|
}
|
|
5715
5741
|
}, Xe = async (i) => {
|
|
5716
5742
|
var g;
|
|
5717
5743
|
i.preventDefault();
|
|
5718
|
-
for (const
|
|
5719
|
-
if (Ye(N[
|
|
5720
|
-
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;
|
|
5721
5747
|
U(`${d} is required.`);
|
|
5722
5748
|
return;
|
|
5723
5749
|
}
|
|
5724
5750
|
await Oe();
|
|
5725
|
-
},
|
|
5726
|
-
var
|
|
5727
|
-
const
|
|
5728
|
-
if (!
|
|
5729
|
-
const
|
|
5730
|
-
switch (
|
|
5751
|
+
}, xe = (i, g, x, d) => {
|
|
5752
|
+
var q;
|
|
5753
|
+
const p = Me[i];
|
|
5754
|
+
if (!p) return null;
|
|
5755
|
+
const I = S.includes(i), z = O[i], _ = x || p.label, y = g ?? i, ae = { required: I };
|
|
5756
|
+
switch (p.type) {
|
|
5731
5757
|
case "select":
|
|
5732
5758
|
if (i === "country" || i === "nationality" || i === "taxCountry" || i === "countryOfBirth" || i === "mobileCountryCode") {
|
|
5733
|
-
const le =
|
|
5759
|
+
const le = E(i, d);
|
|
5734
5760
|
return /* @__PURE__ */ r(
|
|
5735
5761
|
Re,
|
|
5736
5762
|
{
|
|
5737
5763
|
...ae,
|
|
5738
|
-
label:
|
|
5764
|
+
label: _,
|
|
5739
5765
|
value: N[i] || "",
|
|
5740
5766
|
onChange: (Fe) => se(i, Fe),
|
|
5741
|
-
options: [{ value: "", label: `Select ${
|
|
5742
|
-
disabled:
|
|
5743
|
-
error:
|
|
5767
|
+
options: [{ value: "", label: `Select ${_.toLowerCase()}...` }, ...le],
|
|
5768
|
+
disabled: R,
|
|
5769
|
+
error: z
|
|
5744
5770
|
},
|
|
5745
5771
|
y
|
|
5746
5772
|
);
|
|
@@ -5750,8 +5776,8 @@ const qe = {
|
|
|
5750
5776
|
Re,
|
|
5751
5777
|
{
|
|
5752
5778
|
...ae,
|
|
5753
|
-
label:
|
|
5754
|
-
value: ((
|
|
5779
|
+
label: _,
|
|
5780
|
+
value: ((q = N[i]) == null ? void 0 : q.toString()) || "",
|
|
5755
5781
|
onChange: (le) => se(i, le ? Number(le) : null),
|
|
5756
5782
|
options: [
|
|
5757
5783
|
{ value: "", label: "Select salutation..." },
|
|
@@ -5759,7 +5785,7 @@ const qe = {
|
|
|
5759
5785
|
{ value: Ze.Female.toString(), label: "Female" },
|
|
5760
5786
|
{ value: Ze.Other.toString(), label: "Other" }
|
|
5761
5787
|
],
|
|
5762
|
-
error:
|
|
5788
|
+
error: z
|
|
5763
5789
|
},
|
|
5764
5790
|
y
|
|
5765
5791
|
);
|
|
@@ -5769,11 +5795,11 @@ const qe = {
|
|
|
5769
5795
|
Re,
|
|
5770
5796
|
{
|
|
5771
5797
|
...ae,
|
|
5772
|
-
label:
|
|
5798
|
+
label: _,
|
|
5773
5799
|
value: N[i] || "",
|
|
5774
5800
|
onChange: (Fe) => se(i, Fe),
|
|
5775
5801
|
options: [{ value: "", label: "Select language..." }, ...le],
|
|
5776
|
-
error:
|
|
5802
|
+
error: z
|
|
5777
5803
|
},
|
|
5778
5804
|
y
|
|
5779
5805
|
);
|
|
@@ -5781,17 +5807,17 @@ const qe = {
|
|
|
5781
5807
|
return null;
|
|
5782
5808
|
case "multiselect":
|
|
5783
5809
|
if (i === "otherNationality") {
|
|
5784
|
-
const le =
|
|
5810
|
+
const le = E(i, d);
|
|
5785
5811
|
return /* @__PURE__ */ r(
|
|
5786
5812
|
Cr,
|
|
5787
5813
|
{
|
|
5788
5814
|
...ae,
|
|
5789
|
-
label:
|
|
5815
|
+
label: _,
|
|
5790
5816
|
value: N[i] || [],
|
|
5791
5817
|
onChange: (Fe) => se(i, Fe),
|
|
5792
5818
|
options: le,
|
|
5793
5819
|
placeholder: "Select other nationalities...",
|
|
5794
|
-
disabled:
|
|
5820
|
+
disabled: R
|
|
5795
5821
|
},
|
|
5796
5822
|
y
|
|
5797
5823
|
);
|
|
@@ -5803,10 +5829,10 @@ const qe = {
|
|
|
5803
5829
|
{
|
|
5804
5830
|
...ae,
|
|
5805
5831
|
type: "date",
|
|
5806
|
-
label:
|
|
5832
|
+
label: _,
|
|
5807
5833
|
value: N[i] || "",
|
|
5808
5834
|
onChange: (le) => se(i, le.target.value),
|
|
5809
|
-
error:
|
|
5835
|
+
error: z
|
|
5810
5836
|
},
|
|
5811
5837
|
y
|
|
5812
5838
|
);
|
|
@@ -5816,10 +5842,10 @@ const qe = {
|
|
|
5816
5842
|
{
|
|
5817
5843
|
...ae,
|
|
5818
5844
|
type: "email",
|
|
5819
|
-
label:
|
|
5845
|
+
label: _,
|
|
5820
5846
|
value: N[i] || "",
|
|
5821
5847
|
onChange: (le) => se(i, le.target.value),
|
|
5822
|
-
error:
|
|
5848
|
+
error: z
|
|
5823
5849
|
},
|
|
5824
5850
|
y
|
|
5825
5851
|
);
|
|
@@ -5829,10 +5855,10 @@ const qe = {
|
|
|
5829
5855
|
{
|
|
5830
5856
|
...ae,
|
|
5831
5857
|
type: "tel",
|
|
5832
|
-
label:
|
|
5858
|
+
label: _,
|
|
5833
5859
|
value: N[i] || "",
|
|
5834
5860
|
onChange: (le) => se(i, le.target.value),
|
|
5835
|
-
error:
|
|
5861
|
+
error: z
|
|
5836
5862
|
},
|
|
5837
5863
|
y
|
|
5838
5864
|
);
|
|
@@ -5842,17 +5868,17 @@ const qe = {
|
|
|
5842
5868
|
{
|
|
5843
5869
|
...ae,
|
|
5844
5870
|
type: "text",
|
|
5845
|
-
label:
|
|
5871
|
+
label: _,
|
|
5846
5872
|
value: N[i] || "",
|
|
5847
5873
|
onChange: (le) => se(i, le.target.value),
|
|
5848
|
-
error:
|
|
5874
|
+
error: z
|
|
5849
5875
|
},
|
|
5850
5876
|
y
|
|
5851
5877
|
);
|
|
5852
5878
|
}
|
|
5853
5879
|
}, et = (i, g) => {
|
|
5854
5880
|
if (i.customType === "paragraph") {
|
|
5855
|
-
const
|
|
5881
|
+
const p = i.displayText || i.label || "";
|
|
5856
5882
|
return /* @__PURE__ */ r(
|
|
5857
5883
|
"p",
|
|
5858
5884
|
{
|
|
@@ -5863,7 +5889,7 @@ const qe = {
|
|
|
5863
5889
|
margin: 0,
|
|
5864
5890
|
color: "var(--metakyc-text-secondary, #6b7280)"
|
|
5865
5891
|
},
|
|
5866
|
-
dangerouslySetInnerHTML: { __html:
|
|
5892
|
+
dangerouslySetInnerHTML: { __html: p }
|
|
5867
5893
|
},
|
|
5868
5894
|
`custom-${g}`
|
|
5869
5895
|
);
|
|
@@ -5879,7 +5905,7 @@ const qe = {
|
|
|
5879
5905
|
if (i.customType === "br")
|
|
5880
5906
|
return /* @__PURE__ */ r("div", { style: { height: "12px" } }, `custom-${g}`);
|
|
5881
5907
|
if (i.customType === "link") {
|
|
5882
|
-
const
|
|
5908
|
+
const p = i.displayText || i.label || i.linkText || i.linkUrl || "";
|
|
5883
5909
|
return /* @__PURE__ */ r("div", { className: "metakyc-link-field", children: /* @__PURE__ */ o(
|
|
5884
5910
|
"a",
|
|
5885
5911
|
{
|
|
@@ -5896,14 +5922,14 @@ const qe = {
|
|
|
5896
5922
|
cursor: "pointer"
|
|
5897
5923
|
},
|
|
5898
5924
|
children: [
|
|
5899
|
-
|
|
5925
|
+
p,
|
|
5900
5926
|
/* @__PURE__ */ r("span", { style: { fontSize: "10px", opacity: 0.7 }, children: "↗" })
|
|
5901
5927
|
]
|
|
5902
5928
|
}
|
|
5903
5929
|
) }, `custom-${g}`);
|
|
5904
5930
|
}
|
|
5905
5931
|
if (!i.paramName) return null;
|
|
5906
|
-
const
|
|
5932
|
+
const x = O[i.paramName], d = i.displayText || i.label || i.paramName;
|
|
5907
5933
|
if (i.customType === "checkbox")
|
|
5908
5934
|
return /* @__PURE__ */ o("div", { className: "flex flex-col gap-1", children: [
|
|
5909
5935
|
/* @__PURE__ */ o(
|
|
@@ -5916,8 +5942,8 @@ const qe = {
|
|
|
5916
5942
|
"input",
|
|
5917
5943
|
{
|
|
5918
5944
|
type: "checkbox",
|
|
5919
|
-
checked:
|
|
5920
|
-
onChange: (
|
|
5945
|
+
checked: W[i.paramName] === "true",
|
|
5946
|
+
onChange: (p) => M(i.paramName, p.target.checked ? "true" : "false"),
|
|
5921
5947
|
className: "metakyc-option-input",
|
|
5922
5948
|
style: qe
|
|
5923
5949
|
}
|
|
@@ -5936,7 +5962,7 @@ const qe = {
|
|
|
5936
5962
|
]
|
|
5937
5963
|
}
|
|
5938
5964
|
),
|
|
5939
|
-
|
|
5965
|
+
x && /* @__PURE__ */ r("p", { className: "text-red-500 text-xs mt-0.5", children: x })
|
|
5940
5966
|
] }, `custom-${g}`);
|
|
5941
5967
|
if (i.customType === "link_checkbox")
|
|
5942
5968
|
return /* @__PURE__ */ o("div", { className: "flex flex-col gap-1", children: [
|
|
@@ -5950,8 +5976,8 @@ const qe = {
|
|
|
5950
5976
|
"input",
|
|
5951
5977
|
{
|
|
5952
5978
|
type: "checkbox",
|
|
5953
|
-
checked:
|
|
5954
|
-
onChange: (
|
|
5979
|
+
checked: W[i.paramName] === "true",
|
|
5980
|
+
onChange: (p) => M(i.paramName, p.target.checked ? "true" : "false"),
|
|
5955
5981
|
className: "metakyc-option-input",
|
|
5956
5982
|
style: { ...qe, alignSelf: "flex-start", marginTop: "2px" }
|
|
5957
5983
|
}
|
|
@@ -5972,7 +5998,7 @@ const qe = {
|
|
|
5972
5998
|
rel: "noopener noreferrer",
|
|
5973
5999
|
className: "underline",
|
|
5974
6000
|
style: { color: "var(--metakyc-primary, #2563eb)" },
|
|
5975
|
-
onClick: (
|
|
6001
|
+
onClick: (p) => p.stopPropagation(),
|
|
5976
6002
|
children: i.linkText || i.linkUrl
|
|
5977
6003
|
}
|
|
5978
6004
|
),
|
|
@@ -5983,10 +6009,10 @@ const qe = {
|
|
|
5983
6009
|
]
|
|
5984
6010
|
}
|
|
5985
6011
|
),
|
|
5986
|
-
|
|
6012
|
+
x && /* @__PURE__ */ r("p", { className: "text-red-500 text-xs mt-0.5", children: x })
|
|
5987
6013
|
] }, `custom-${g}`);
|
|
5988
6014
|
if (i.customType === "group_checkbox") {
|
|
5989
|
-
const
|
|
6015
|
+
const p = (W[i.paramName] || "").split(",").filter(Boolean);
|
|
5990
6016
|
return /* @__PURE__ */ o("div", { className: "flex flex-col gap-1.5", children: [
|
|
5991
6017
|
/* @__PURE__ */ o(
|
|
5992
6018
|
"div",
|
|
@@ -5999,8 +6025,8 @@ const qe = {
|
|
|
5999
6025
|
]
|
|
6000
6026
|
}
|
|
6001
6027
|
),
|
|
6002
|
-
/* @__PURE__ */ r("div", { className: "metakyc-options-group", style: { display: "flex", flexDirection: "column", gap: "8px" }, children: (i.options || []).map((
|
|
6003
|
-
const
|
|
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);
|
|
6004
6030
|
return /* @__PURE__ */ o(
|
|
6005
6031
|
"label",
|
|
6006
6032
|
{
|
|
@@ -6011,12 +6037,12 @@ const qe = {
|
|
|
6011
6037
|
"input",
|
|
6012
6038
|
{
|
|
6013
6039
|
type: "checkbox",
|
|
6014
|
-
checked:
|
|
6015
|
-
onChange: (
|
|
6040
|
+
checked: z,
|
|
6041
|
+
onChange: (_) => {
|
|
6016
6042
|
if (i.singleSelect)
|
|
6017
|
-
M(i.paramName,
|
|
6043
|
+
M(i.paramName, _.target.checked ? I.value : "");
|
|
6018
6044
|
else {
|
|
6019
|
-
const y =
|
|
6045
|
+
const y = _.target.checked ? [...p, I.value] : p.filter((ae) => ae !== I.value);
|
|
6020
6046
|
M(i.paramName, y.join(","));
|
|
6021
6047
|
}
|
|
6022
6048
|
},
|
|
@@ -6029,15 +6055,15 @@ const qe = {
|
|
|
6029
6055
|
{
|
|
6030
6056
|
className: "metakyc-option-text",
|
|
6031
6057
|
style: { fontSize: "14px", color: "var(--metakyc-text-primary, #111827)", lineHeight: "1.4" },
|
|
6032
|
-
children:
|
|
6058
|
+
children: I.label
|
|
6033
6059
|
}
|
|
6034
6060
|
)
|
|
6035
6061
|
]
|
|
6036
6062
|
},
|
|
6037
|
-
|
|
6063
|
+
I.value
|
|
6038
6064
|
);
|
|
6039
6065
|
}) }),
|
|
6040
|
-
|
|
6066
|
+
x && /* @__PURE__ */ r("p", { className: "text-red-500 text-xs", children: x })
|
|
6041
6067
|
] }, `custom-${g}`);
|
|
6042
6068
|
}
|
|
6043
6069
|
return i.customType === "radio_group" ? /* @__PURE__ */ o("div", { className: "flex flex-col gap-1.5", children: [
|
|
@@ -6052,7 +6078,7 @@ const qe = {
|
|
|
6052
6078
|
]
|
|
6053
6079
|
}
|
|
6054
6080
|
),
|
|
6055
|
-
/* @__PURE__ */ r("div", { className: "metakyc-options-group", style: { display: "flex", flexDirection: "column", gap: "8px" }, children: (i.options || []).map((
|
|
6081
|
+
/* @__PURE__ */ r("div", { className: "metakyc-options-group", style: { display: "flex", flexDirection: "column", gap: "8px" }, children: (i.options || []).map((p) => /* @__PURE__ */ o(
|
|
6056
6082
|
"label",
|
|
6057
6083
|
{
|
|
6058
6084
|
className: "metakyc-option-label",
|
|
@@ -6062,8 +6088,8 @@ const qe = {
|
|
|
6062
6088
|
"input",
|
|
6063
6089
|
{
|
|
6064
6090
|
type: "radio",
|
|
6065
|
-
checked:
|
|
6066
|
-
onChange: () => M(i.paramName,
|
|
6091
|
+
checked: W[i.paramName] === p.value,
|
|
6092
|
+
onChange: () => M(i.paramName, p.value),
|
|
6067
6093
|
name: `radio-group-${i.paramName}-${g}`,
|
|
6068
6094
|
className: "metakyc-option-input",
|
|
6069
6095
|
style: qe
|
|
@@ -6074,28 +6100,28 @@ const qe = {
|
|
|
6074
6100
|
{
|
|
6075
6101
|
className: "metakyc-option-text",
|
|
6076
6102
|
style: { fontSize: "14px", color: "var(--metakyc-text-primary, #111827)", lineHeight: "1.4" },
|
|
6077
|
-
children:
|
|
6103
|
+
children: p.label
|
|
6078
6104
|
}
|
|
6079
6105
|
)
|
|
6080
6106
|
]
|
|
6081
6107
|
},
|
|
6082
|
-
|
|
6108
|
+
p.value
|
|
6083
6109
|
)) }),
|
|
6084
|
-
|
|
6110
|
+
x && /* @__PURE__ */ r("p", { className: "text-red-500 text-xs", children: x })
|
|
6085
6111
|
] }, `custom-${g}`) : /* @__PURE__ */ r(
|
|
6086
6112
|
de,
|
|
6087
6113
|
{
|
|
6088
6114
|
type: "text",
|
|
6089
6115
|
label: `${d}${i.required ? " *" : ""}`,
|
|
6090
|
-
value:
|
|
6091
|
-
onChange: (
|
|
6116
|
+
value: W[i.paramName] || "",
|
|
6117
|
+
onChange: (p) => M(i.paramName, p.target.value),
|
|
6092
6118
|
required: i.required,
|
|
6093
|
-
error:
|
|
6119
|
+
error: x
|
|
6094
6120
|
},
|
|
6095
6121
|
`custom-${g}`
|
|
6096
6122
|
);
|
|
6097
6123
|
}, tt = (i, g) => {
|
|
6098
|
-
const
|
|
6124
|
+
const x = Z(i);
|
|
6099
6125
|
return /* @__PURE__ */ o("div", { className: "space-y-4", children: [
|
|
6100
6126
|
i.conditionalOn && /* @__PURE__ */ r(pt, { helpText: i.conditionalHelpText, children: /* @__PURE__ */ o(
|
|
6101
6127
|
"label",
|
|
@@ -6107,7 +6133,7 @@ const qe = {
|
|
|
6107
6133
|
"input",
|
|
6108
6134
|
{
|
|
6109
6135
|
type: "checkbox",
|
|
6110
|
-
checked:
|
|
6136
|
+
checked: x,
|
|
6111
6137
|
onChange: (d) => M(i.conditionalOn, d.target.checked ? "true" : "false"),
|
|
6112
6138
|
className: "metakyc-option-input",
|
|
6113
6139
|
style: qe
|
|
@@ -6124,19 +6150,19 @@ const qe = {
|
|
|
6124
6150
|
]
|
|
6125
6151
|
}
|
|
6126
6152
|
) }),
|
|
6127
|
-
|
|
6128
|
-
const
|
|
6129
|
-
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);
|
|
6130
6156
|
}) })
|
|
6131
6157
|
] });
|
|
6132
6158
|
};
|
|
6133
|
-
if (!c ||
|
|
6159
|
+
if (!c || R)
|
|
6134
6160
|
return /* @__PURE__ */ r("div", { className: "metakyc-sdk", children: /* @__PURE__ */ r(j, { children: /* @__PURE__ */ o(K, { children: [
|
|
6135
6161
|
/* @__PURE__ */ r(we, { className: "my-8" }),
|
|
6136
6162
|
/* @__PURE__ */ r("p", { className: "text-center mt-4", style: { color: "var(--metakyc-text-secondary, #6b7280)", fontSize: "0.875rem" }, children: "Loading form…" })
|
|
6137
6163
|
] }) }) });
|
|
6138
6164
|
if (f) {
|
|
6139
|
-
const i = f[
|
|
6165
|
+
const i = f[B] ?? f[0], g = Ae === -1, x = ie === -1, d = f.length, p = Z(i), I = Object.values(O);
|
|
6140
6166
|
return /* @__PURE__ */ r("div", { className: "metakyc-sdk", children: /* @__PURE__ */ o(j, { children: [
|
|
6141
6167
|
/* @__PURE__ */ r(ue, { children: /* @__PURE__ */ r(at, { title: (c == null ? void 0 : c.title) || "Create Applicant" }) }),
|
|
6142
6168
|
/* @__PURE__ */ o(K, { children: [
|
|
@@ -6166,25 +6192,25 @@ const qe = {
|
|
|
6166
6192
|
}
|
|
6167
6193
|
)
|
|
6168
6194
|
] }),
|
|
6169
|
-
(
|
|
6170
|
-
|
|
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: [
|
|
6171
6197
|
/* @__PURE__ */ r("strong", { children: "Error:" }),
|
|
6172
6198
|
" ",
|
|
6173
|
-
|
|
6199
|
+
A
|
|
6174
6200
|
] }),
|
|
6175
|
-
|
|
6201
|
+
I.map((z, _) => /* @__PURE__ */ r("p", { className: "text-red-600 text-sm", children: z }, _))
|
|
6176
6202
|
] }),
|
|
6177
6203
|
d > 1 && /* @__PURE__ */ o("div", { className: "flex items-center gap-2 mb-4", children: [
|
|
6178
|
-
f.map((
|
|
6204
|
+
f.map((z, _) => /* @__PURE__ */ r(
|
|
6179
6205
|
"div",
|
|
6180
6206
|
{
|
|
6181
|
-
className: `h-1.5 rounded-full transition-all ${
|
|
6182
|
-
style:
|
|
6207
|
+
className: `h-1.5 rounded-full transition-all ${_ === B ? "flex-1" : "w-8"}`,
|
|
6208
|
+
style: _ === B ? { backgroundColor: "var(--metakyc-primary, #2563eb)" } : _ < B ? { backgroundColor: "var(--metakyc-primary-light, #93c5fd)", opacity: 0.7 } : { backgroundColor: "#e5e7eb" }
|
|
6183
6209
|
},
|
|
6184
|
-
|
|
6210
|
+
_
|
|
6185
6211
|
)),
|
|
6186
6212
|
/* @__PURE__ */ o("span", { className: "text-xs text-gray-400 flex-shrink-0", children: [
|
|
6187
|
-
|
|
6213
|
+
B + 1,
|
|
6188
6214
|
" / ",
|
|
6189
6215
|
d
|
|
6190
6216
|
] })
|
|
@@ -6194,26 +6220,26 @@ const qe = {
|
|
|
6194
6220
|
/* @__PURE__ */ o(me, { className: "flex justify-between", children: [
|
|
6195
6221
|
/* @__PURE__ */ o("div", { children: [
|
|
6196
6222
|
!g && /* @__PURE__ */ r(
|
|
6197
|
-
|
|
6223
|
+
Q,
|
|
6198
6224
|
{
|
|
6199
6225
|
type: "button",
|
|
6200
6226
|
variant: "outline",
|
|
6201
6227
|
onClick: () => {
|
|
6202
|
-
|
|
6228
|
+
L(Ae), G({});
|
|
6203
6229
|
},
|
|
6204
6230
|
disabled: te || h,
|
|
6205
6231
|
children: "Previous"
|
|
6206
6232
|
}
|
|
6207
6233
|
),
|
|
6208
|
-
g && a && /* @__PURE__ */ r(
|
|
6234
|
+
g && a && /* @__PURE__ */ r(Q, { type: "button", variant: "outline", onClick: a, disabled: te || h, children: "Cancel" })
|
|
6209
6235
|
] }),
|
|
6210
6236
|
/* @__PURE__ */ r(
|
|
6211
|
-
|
|
6237
|
+
Q,
|
|
6212
6238
|
{
|
|
6213
6239
|
type: "button",
|
|
6214
6240
|
isLoading: te || h,
|
|
6215
|
-
onClick:
|
|
6216
|
-
children:
|
|
6241
|
+
onClick: x ? Oe : pe,
|
|
6242
|
+
children: x ? i.conditionalOn && !p ? "Skip & Submit" : "Submit" : i.conditionalOn && !p ? "Skip" : "Next"
|
|
6217
6243
|
}
|
|
6218
6244
|
)
|
|
6219
6245
|
] })
|
|
@@ -6222,19 +6248,19 @@ const qe = {
|
|
|
6222
6248
|
return /* @__PURE__ */ r("div", { className: "metakyc-sdk", children: /* @__PURE__ */ r("form", { onSubmit: Xe, children: /* @__PURE__ */ o(j, { children: [
|
|
6223
6249
|
/* @__PURE__ */ r(ue, { children: /* @__PURE__ */ r(at, { title: (c == null ? void 0 : c.title) || "Create Applicant" }) }),
|
|
6224
6250
|
/* @__PURE__ */ o(K, { children: [
|
|
6225
|
-
|
|
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: [
|
|
6226
6252
|
/* @__PURE__ */ r("strong", { children: "Error:" }),
|
|
6227
6253
|
" ",
|
|
6228
|
-
|
|
6254
|
+
A
|
|
6229
6255
|
] }) }),
|
|
6230
|
-
/* @__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)) })
|
|
6231
6257
|
] }),
|
|
6232
6258
|
/* @__PURE__ */ o(me, { className: "flex justify-between", children: [
|
|
6233
|
-
a && /* @__PURE__ */ r(
|
|
6234
|
-
/* @__PURE__ */ r(
|
|
6259
|
+
a && /* @__PURE__ */ r(Q, { type: "button", variant: "outline", onClick: a, disabled: te || h, children: "Cancel" }),
|
|
6260
|
+
/* @__PURE__ */ r(Q, { type: "submit", isLoading: te || h, children: "Create Applicant" })
|
|
6235
6261
|
] })
|
|
6236
6262
|
] }) }) });
|
|
6237
|
-
},
|
|
6263
|
+
}, xn = ({
|
|
6238
6264
|
applicantId: e,
|
|
6239
6265
|
onComplete: t,
|
|
6240
6266
|
onError: n,
|
|
@@ -6246,22 +6272,22 @@ const qe = {
|
|
|
6246
6272
|
currentStep: c,
|
|
6247
6273
|
steps: u,
|
|
6248
6274
|
workflowKey: h,
|
|
6249
|
-
nextWorkflowKey:
|
|
6275
|
+
nextWorkflowKey: m,
|
|
6250
6276
|
hasWorkflowChanged: v,
|
|
6251
|
-
isLoading:
|
|
6277
|
+
isLoading: C,
|
|
6252
6278
|
error: f,
|
|
6253
|
-
moveBack:
|
|
6254
|
-
refreshProgress:
|
|
6255
|
-
} =
|
|
6256
|
-
if (
|
|
6279
|
+
moveBack: S,
|
|
6280
|
+
refreshProgress: b
|
|
6281
|
+
} = br(e), [D, F] = be.useState(!1);
|
|
6282
|
+
if (be.useEffect(() => {
|
|
6257
6283
|
f && n && n(f);
|
|
6258
|
-
}, [f, n]),
|
|
6284
|
+
}, [f, n]), be.useEffect(() => {
|
|
6259
6285
|
l != null && l.workflowResult && t && t(l.workflowResult);
|
|
6260
|
-
}, [l == null ? void 0 : l.workflowResult, t]),
|
|
6286
|
+
}, [l == null ? void 0 : l.workflowResult, t]), be.useEffect(() => {
|
|
6261
6287
|
a === "dark" ? document.documentElement.classList.add("dark") : document.documentElement.classList.remove("dark");
|
|
6262
|
-
}, [a]),
|
|
6263
|
-
v &&
|
|
6264
|
-
}, [v]),
|
|
6288
|
+
}, [a]), be.useEffect(() => {
|
|
6289
|
+
v && F(!1);
|
|
6290
|
+
}, [v]), C || !l)
|
|
6265
6291
|
return /* @__PURE__ */ r("div", { className: s, children: /* @__PURE__ */ r(j, { children: /* @__PURE__ */ o(K, { children: [
|
|
6266
6292
|
/* @__PURE__ */ r(we, { className: "my-8" }),
|
|
6267
6293
|
/* @__PURE__ */ r("p", { className: "text-center text-gray-600 dark:text-gray-400 mt-4", children: "Loading workflow..." })
|
|
@@ -6285,7 +6311,7 @@ const qe = {
|
|
|
6285
6311
|
/* @__PURE__ */ r("svg", { className: "w-6 h-6 text-gray-400 mx-4", fill: "none", stroke: "currentColor", viewBox: "0 0 24 24", children: /* @__PURE__ */ r("path", { strokeLinecap: "round", strokeLinejoin: "round", strokeWidth: 2, d: "M13 7l5 5m0 0l-5 5m5-5H6" }) }),
|
|
6286
6312
|
/* @__PURE__ */ o("div", { className: "text-right", children: [
|
|
6287
6313
|
/* @__PURE__ */ r("p", { className: "text-gray-500 dark:text-gray-400 mb-1", children: "New Workflow" }),
|
|
6288
|
-
/* @__PURE__ */ r("p", { className: "font-medium text-blue-600 dark:text-blue-400", children:
|
|
6314
|
+
/* @__PURE__ */ r("p", { className: "font-medium text-blue-600 dark:text-blue-400", children: m })
|
|
6289
6315
|
] })
|
|
6290
6316
|
] }),
|
|
6291
6317
|
l.nextWorkflowName && /* @__PURE__ */ r("p", { className: "text-center text-gray-600 dark:text-gray-400 mt-2 text-xs", children: l.nextWorkflowName })
|
|
@@ -6293,7 +6319,7 @@ const qe = {
|
|
|
6293
6319
|
/* @__PURE__ */ r(
|
|
6294
6320
|
"button",
|
|
6295
6321
|
{
|
|
6296
|
-
onClick: () =>
|
|
6322
|
+
onClick: () => F(!0),
|
|
6297
6323
|
className: "px-6 py-3 bg-blue-600 hover:bg-blue-700 text-white font-medium rounded-lg transition-colors",
|
|
6298
6324
|
children: "Continue with New Workflow"
|
|
6299
6325
|
}
|
|
@@ -6318,97 +6344,97 @@ const qe = {
|
|
|
6318
6344
|
/* @__PURE__ */ r(we, { className: "my-8" }),
|
|
6319
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..." })
|
|
6320
6346
|
] }) }) });
|
|
6321
|
-
const
|
|
6322
|
-
switch (
|
|
6323
|
-
case
|
|
6347
|
+
const P = (T) => {
|
|
6348
|
+
switch (T) {
|
|
6349
|
+
case J.Overview:
|
|
6324
6350
|
return "Overview";
|
|
6325
|
-
case
|
|
6351
|
+
case J.Questionaries:
|
|
6326
6352
|
return "Questionnaire";
|
|
6327
|
-
case
|
|
6353
|
+
case J.UploadDocument:
|
|
6328
6354
|
return "Documents";
|
|
6329
|
-
case
|
|
6355
|
+
case J.IdentitySdk:
|
|
6330
6356
|
return "Identity";
|
|
6331
|
-
case
|
|
6357
|
+
case J.RiskScoring:
|
|
6332
6358
|
return "Risk Assessment";
|
|
6333
|
-
case
|
|
6359
|
+
case J.InvestorCategorization:
|
|
6334
6360
|
return "Investor Categorization";
|
|
6335
|
-
case
|
|
6361
|
+
case J.AppropriatenessTest:
|
|
6336
6362
|
return "Appropriateness Test";
|
|
6337
|
-
case
|
|
6363
|
+
case J.AdditionalData:
|
|
6338
6364
|
return "Additional Data";
|
|
6339
|
-
case
|
|
6365
|
+
case J.ManualReview:
|
|
6340
6366
|
return "Review";
|
|
6341
6367
|
default:
|
|
6342
6368
|
return "";
|
|
6343
6369
|
}
|
|
6344
|
-
},
|
|
6345
|
-
const
|
|
6370
|
+
}, $ = () => {
|
|
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;
|
|
6346
6372
|
return /* @__PURE__ */ o("div", { className: "mb-6", children: [
|
|
6347
6373
|
/* @__PURE__ */ o("div", { className: "flex items-start justify-between mb-4", children: [
|
|
6348
6374
|
/* @__PURE__ */ r(at, {}),
|
|
6349
|
-
/* @__PURE__ */ o(
|
|
6375
|
+
/* @__PURE__ */ o(Ie, { variant: l.status === 1 ? "info" : "success", children: [
|
|
6350
6376
|
"Step ",
|
|
6351
6377
|
X,
|
|
6352
6378
|
" of ",
|
|
6353
|
-
|
|
6379
|
+
E
|
|
6354
6380
|
] })
|
|
6355
6381
|
] }),
|
|
6356
|
-
/* @__PURE__ */ r("div", { className: "flex items-center", children:
|
|
6357
|
-
const
|
|
6358
|
-
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: [
|
|
6359
6385
|
/* @__PURE__ */ o("div", { className: "flex items-center", children: [
|
|
6360
6386
|
/* @__PURE__ */ r(
|
|
6361
6387
|
"div",
|
|
6362
6388
|
{
|
|
6363
6389
|
className: `
|
|
6364
6390
|
w-8 h-8 rounded-full flex items-center justify-center text-sm font-medium
|
|
6365
|
-
${
|
|
6391
|
+
${W || w ? "bg-primary-500 text-white" : "bg-gray-200 text-gray-600 dark:bg-gray-700 dark:text-gray-400"}
|
|
6366
6392
|
`,
|
|
6367
|
-
children:
|
|
6393
|
+
children: H + 1
|
|
6368
6394
|
}
|
|
6369
6395
|
),
|
|
6370
6396
|
/* @__PURE__ */ r(
|
|
6371
6397
|
"span",
|
|
6372
6398
|
{
|
|
6373
|
-
className: `ml-2 text-sm ${
|
|
6374
|
-
children: N.displayName || N.name ||
|
|
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}`
|
|
6375
6401
|
}
|
|
6376
6402
|
)
|
|
6377
6403
|
] }),
|
|
6378
|
-
|
|
6404
|
+
H < T.length - 1 && /* @__PURE__ */ r(
|
|
6379
6405
|
"div",
|
|
6380
6406
|
{
|
|
6381
|
-
className: `flex-1 h-0.5 mx-4 ${
|
|
6407
|
+
className: `flex-1 h-0.5 mx-4 ${W ? "bg-primary-500" : "bg-gray-200 dark:bg-gray-700"}`
|
|
6382
6408
|
}
|
|
6383
6409
|
)
|
|
6384
6410
|
] }, N.order);
|
|
6385
6411
|
}) })
|
|
6386
6412
|
] });
|
|
6387
|
-
},
|
|
6388
|
-
const
|
|
6413
|
+
}, R = () => {
|
|
6414
|
+
const T = {
|
|
6389
6415
|
applicantId: e,
|
|
6390
6416
|
onComplete: async () => {
|
|
6391
|
-
await
|
|
6417
|
+
await b();
|
|
6392
6418
|
},
|
|
6393
|
-
onBack: c.order > 0 ?
|
|
6419
|
+
onBack: c.order > 0 ? S : void 0
|
|
6394
6420
|
};
|
|
6395
6421
|
switch (c.action) {
|
|
6396
|
-
case
|
|
6397
|
-
return /* @__PURE__ */ r($r, { ...
|
|
6398
|
-
case
|
|
6399
|
-
return /* @__PURE__ */ r(Br, { ...
|
|
6400
|
-
case
|
|
6401
|
-
return /* @__PURE__ */ r(_r, { ...
|
|
6402
|
-
case
|
|
6403
|
-
return /* @__PURE__ */ r(
|
|
6404
|
-
case
|
|
6405
|
-
return /* @__PURE__ */ r(
|
|
6406
|
-
case
|
|
6407
|
-
case
|
|
6408
|
-
return /* @__PURE__ */ r(
|
|
6409
|
-
case
|
|
6410
|
-
return /* @__PURE__ */ r(
|
|
6411
|
-
case
|
|
6422
|
+
case J.Questionaries:
|
|
6423
|
+
return /* @__PURE__ */ r($r, { ...T });
|
|
6424
|
+
case J.UploadDocument:
|
|
6425
|
+
return /* @__PURE__ */ r(Br, { ...T });
|
|
6426
|
+
case J.Overview:
|
|
6427
|
+
return /* @__PURE__ */ r(_r, { ...T });
|
|
6428
|
+
case J.IdentitySdk:
|
|
6429
|
+
return /* @__PURE__ */ r(Jr, { ...T });
|
|
6430
|
+
case J.RiskScoring:
|
|
6431
|
+
return /* @__PURE__ */ r(qr, { ...T });
|
|
6432
|
+
case J.AdditionalData:
|
|
6433
|
+
case J.InvestorCategorization:
|
|
6434
|
+
return /* @__PURE__ */ r(Gr, { ...T });
|
|
6435
|
+
case J.AppropriatenessTest:
|
|
6436
|
+
return /* @__PURE__ */ r(Vr, { ...T });
|
|
6437
|
+
case J.ManualReview:
|
|
6412
6438
|
return /* @__PURE__ */ r(
|
|
6413
6439
|
mt,
|
|
6414
6440
|
{
|
|
@@ -6427,23 +6453,23 @@ const qe = {
|
|
|
6427
6453
|
] }),
|
|
6428
6454
|
/* @__PURE__ */ o("p", { className: "text-sm text-gray-500 dark:text-gray-400", children: [
|
|
6429
6455
|
"Action type: ",
|
|
6430
|
-
|
|
6456
|
+
J[c.action]
|
|
6431
6457
|
] })
|
|
6432
6458
|
] }) });
|
|
6433
6459
|
}
|
|
6434
6460
|
};
|
|
6435
6461
|
return /* @__PURE__ */ o("div", { className: `metakyc-sdk ${s || ""}`, children: [
|
|
6436
|
-
|
|
6437
|
-
|
|
6462
|
+
$(),
|
|
6463
|
+
R()
|
|
6438
6464
|
] });
|
|
6439
6465
|
};
|
|
6440
|
-
function
|
|
6441
|
-
return
|
|
6442
|
-
questionResults:
|
|
6466
|
+
function vn(e) {
|
|
6467
|
+
return Ce.object({
|
|
6468
|
+
questionResults: Ce.any()
|
|
6443
6469
|
}).passthrough();
|
|
6444
6470
|
}
|
|
6445
|
-
function
|
|
6446
|
-
let t =
|
|
6471
|
+
function Xr(e) {
|
|
6472
|
+
let t = Ce.array(Ce.instanceof(File));
|
|
6447
6473
|
if (e.isRequired ? t = t.min(
|
|
6448
6474
|
1,
|
|
6449
6475
|
`${e.displayName} is required`
|
|
@@ -6464,27 +6490,27 @@ function Vr(e) {
|
|
|
6464
6490
|
}
|
|
6465
6491
|
return t;
|
|
6466
6492
|
}
|
|
6467
|
-
function
|
|
6493
|
+
function kn(e) {
|
|
6468
6494
|
const t = {};
|
|
6469
6495
|
return e.uploadDocumentFiles.forEach((n) => {
|
|
6470
6496
|
const a = `file_${n.id}`;
|
|
6471
|
-
t[a] =
|
|
6472
|
-
}),
|
|
6497
|
+
t[a] = Xr(n);
|
|
6498
|
+
}), Ce.object(t);
|
|
6473
6499
|
}
|
|
6474
|
-
function
|
|
6475
|
-
return
|
|
6500
|
+
function wn(e) {
|
|
6501
|
+
return Ce.any();
|
|
6476
6502
|
}
|
|
6477
|
-
function
|
|
6478
|
-
return
|
|
6503
|
+
function en(e) {
|
|
6504
|
+
return Ce.string().min(1, "This question is required");
|
|
6479
6505
|
}
|
|
6480
|
-
function
|
|
6506
|
+
function Nn(e) {
|
|
6481
6507
|
const t = {};
|
|
6482
6508
|
return e.appropriatenessQuestions.forEach((n) => {
|
|
6483
6509
|
const a = `question_${n.id}`;
|
|
6484
|
-
t[a] =
|
|
6485
|
-
}),
|
|
6510
|
+
t[a] = en();
|
|
6511
|
+
}), Ce.object(t);
|
|
6486
6512
|
}
|
|
6487
|
-
const
|
|
6513
|
+
const Sn = Ce.any();
|
|
6488
6514
|
export {
|
|
6489
6515
|
lt as ALLOWED_LANGUAGES,
|
|
6490
6516
|
It as ApplicantProgressOnHoldReason,
|
|
@@ -6493,16 +6519,16 @@ export {
|
|
|
6493
6519
|
Rt as ApplicantStatus,
|
|
6494
6520
|
Dt as AppropriatenessQuestionType,
|
|
6495
6521
|
Wt as AppropriatenessTestService,
|
|
6496
|
-
|
|
6497
|
-
|
|
6522
|
+
Vr as AppropriatenessTestStep,
|
|
6523
|
+
Ie as Badge,
|
|
6498
6524
|
Gt as BaseInformationService,
|
|
6499
|
-
|
|
6525
|
+
Q as Button,
|
|
6500
6526
|
j as Card,
|
|
6501
6527
|
K as CardContent,
|
|
6502
6528
|
me as CardFooter,
|
|
6503
6529
|
ue as CardHeader,
|
|
6504
6530
|
$e as CountriesType,
|
|
6505
|
-
|
|
6531
|
+
bn as CreateApplicantForm,
|
|
6506
6532
|
Ot as CriteriaBuiltInType,
|
|
6507
6533
|
zt as DEFAULT_VISIBLE_FIELDS,
|
|
6508
6534
|
Lt as DocumentReviewStatus,
|
|
@@ -6518,20 +6544,20 @@ export {
|
|
|
6518
6544
|
ze as IdentityProviderManager,
|
|
6519
6545
|
Qt as IdentityService,
|
|
6520
6546
|
ve as IdentityVerificationProvider,
|
|
6521
|
-
|
|
6547
|
+
Jr as IdentityVerificationStep,
|
|
6522
6548
|
de as Input,
|
|
6523
6549
|
Vt as InvestorCategorizationService,
|
|
6524
|
-
|
|
6525
|
-
|
|
6550
|
+
Gr as InvestorCategorizationStep,
|
|
6551
|
+
fe as InvestorCategorizationType,
|
|
6526
6552
|
$t as InvestorCategoryType,
|
|
6527
6553
|
Pt as KycProcessStatus,
|
|
6528
6554
|
Le as KycStatus,
|
|
6529
6555
|
mt as KycStatusDisplay,
|
|
6530
|
-
|
|
6531
|
-
|
|
6556
|
+
xn as KycWorkflow,
|
|
6557
|
+
Zr as Logo,
|
|
6532
6558
|
gt as MetaKYCContext,
|
|
6533
6559
|
Ne as MetaKYCError,
|
|
6534
|
-
|
|
6560
|
+
un as MetaKYCProvider,
|
|
6535
6561
|
Cr as MultiSelect,
|
|
6536
6562
|
cr as OnfidoProvider,
|
|
6537
6563
|
Yt as OverviewService,
|
|
@@ -6543,7 +6569,7 @@ export {
|
|
|
6543
6569
|
Mt as RiskCriteriaType,
|
|
6544
6570
|
Et as RiskLevel,
|
|
6545
6571
|
qt as RiskScoringService,
|
|
6546
|
-
|
|
6572
|
+
qr as RiskScoringStep,
|
|
6547
6573
|
dr as SardinAIProvider,
|
|
6548
6574
|
Re as SearchableSelect,
|
|
6549
6575
|
st as Select,
|
|
@@ -6556,13 +6582,13 @@ export {
|
|
|
6556
6582
|
Kt as UploadDocumentService,
|
|
6557
6583
|
Br as UploadDocumentStep,
|
|
6558
6584
|
Ft as UserType,
|
|
6559
|
-
|
|
6585
|
+
Se as ValueDataType,
|
|
6560
6586
|
or as WorkflowOrchestrator,
|
|
6561
6587
|
Je as WorkflowResultType,
|
|
6562
6588
|
ir as WorkflowState,
|
|
6563
|
-
|
|
6564
|
-
|
|
6565
|
-
|
|
6589
|
+
J as WorkflowStepAction,
|
|
6590
|
+
Sn as appropriatenessTestSchema,
|
|
6591
|
+
yn as clearAllStorage,
|
|
6566
6592
|
gr as clearApplicantId,
|
|
6567
6593
|
fr as clearWorkflowState,
|
|
6568
6594
|
oe as cn,
|
|
@@ -6572,33 +6598,33 @@ export {
|
|
|
6572
6598
|
mr as fileToBase64,
|
|
6573
6599
|
Zt as fintechTheme,
|
|
6574
6600
|
rt as formatFileSize,
|
|
6575
|
-
|
|
6576
|
-
|
|
6577
|
-
|
|
6578
|
-
|
|
6579
|
-
|
|
6601
|
+
Nn as generateAppropriatenessSchema,
|
|
6602
|
+
vn as generateQuestionnaireSchema,
|
|
6603
|
+
wn as generateRiskScoringSchema,
|
|
6604
|
+
kn as generateUploadDocumentSchema,
|
|
6605
|
+
hn as getAcceptString,
|
|
6580
6606
|
hr as getApplicantId,
|
|
6581
6607
|
We as getThemePreset,
|
|
6582
|
-
|
|
6608
|
+
gn as getWorkflowState,
|
|
6583
6609
|
Xt as healthcareTheme,
|
|
6584
|
-
|
|
6610
|
+
cn as isScriptLoaded,
|
|
6585
6611
|
ht as loadScript,
|
|
6586
6612
|
tr as minimalTheme,
|
|
6587
6613
|
er as modernTheme,
|
|
6588
|
-
|
|
6614
|
+
dn as removeScript,
|
|
6589
6615
|
pr as saveApplicantId,
|
|
6590
6616
|
yr as saveWorkflowState,
|
|
6591
6617
|
rr as themePresets,
|
|
6592
6618
|
Sr as useApplicant,
|
|
6593
|
-
|
|
6619
|
+
fn as useAppropriatenessTest,
|
|
6594
6620
|
wr as useIdentityVerification,
|
|
6595
|
-
|
|
6596
|
-
|
|
6621
|
+
br as useKycWorkflow,
|
|
6622
|
+
ge as useMetaKYC,
|
|
6597
6623
|
kr as useOverview,
|
|
6598
|
-
|
|
6624
|
+
xr as useQuestionnaire,
|
|
6599
6625
|
Nr as useRiskScoring,
|
|
6600
6626
|
vr as useUploadDocument,
|
|
6601
|
-
|
|
6602
|
-
|
|
6627
|
+
mn as validateFileSize,
|
|
6628
|
+
pn as validateFileType
|
|
6603
6629
|
};
|
|
6604
6630
|
//# sourceMappingURL=index.js.map
|