@vpdev2/metakyc-sdk 1.0.54 → 1.0.56
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/CreateApplicantForm.d.ts.map +1 -1
- package/dist/index.cjs +8 -8
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +373 -304
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -2,13 +2,13 @@ var bt = Object.defineProperty;
|
|
|
2
2
|
var vt = (e, t, n) => t in e ? bt(e, t, { enumerable: !0, configurable: !0, writable: !0, value: n }) : e[t] = n;
|
|
3
3
|
var re = (e, t, n) => vt(e, typeof t != "symbol" ? t + "" : t, n);
|
|
4
4
|
import kt from "axios";
|
|
5
|
-
import * as
|
|
6
|
-
import ge, { createContext as wt, useState as b, useMemo as Ee, useEffect as ne, useContext as Nt, useRef as ee, useCallback as Q, forwardRef as
|
|
7
|
-
import { jsx as r, jsxs as s, Fragment as
|
|
8
|
-
import { createPortal as
|
|
5
|
+
import * as nt from "react";
|
|
6
|
+
import ge, { createContext as wt, useState as b, useMemo as Ee, useEffect as ne, useContext as Nt, useRef as ee, useCallback as Q, forwardRef as Ue, createElement as Qe } from "react";
|
|
7
|
+
import { jsx as r, jsxs as s, Fragment as ct } from "react/jsx-runtime";
|
|
8
|
+
import { createPortal as Ve } from "react-dom";
|
|
9
9
|
import { useForm as St, Controller as Pe } from "react-hook-form";
|
|
10
10
|
import { z as Se } from "zod";
|
|
11
|
-
var G = /* @__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))(G || {}), qe = /* @__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))(qe || {}), xe = /* @__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))(xe || {}), Ct = /* @__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))(Ct || {}), At = /* @__PURE__ */ ((e) => (e[e.LowRisk = 0] = "LowRisk", e[e.MediumRisk = 1] = "MediumRisk", e[e.HighRisk = 2] = "HighRisk", e[e.Alert = 3] = "Alert", e))(At || {}), De = /* @__PURE__ */ ((e) => (e[e.None = 0] = "None", e[e.Pending = 1] = "Pending", e[e.Approved = 2] = "Approved", e[e.Rejected = 3] = "Rejected", e[e.ResendRequested = 4] = "ResendRequested", e[e.Unknown = 5] = "Unknown", e[e.InProgress = 6] = "InProgress", e))(De || {}), Fe = /* @__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))(Fe || {}), Et = /* @__PURE__ */ ((e) => (e[e.ProviderResultPending = 0] = "ProviderResultPending", e[e.ProviderResultReceived = 1] = "ProviderResultReceived", e[e.Canceled = 2] = "Canceled", e[e.ExtendedToNewApplicant = 3] = "ExtendedToNewApplicant", e))(Et || {}), It = /* @__PURE__ */ ((e) => (e[e.None = 0] = "None", e[e.ProviderResultPending = 1] = "ProviderResultPending", e[e.ProviderResultReceived = 2] = "ProviderResultReceived", e[e.Canceled = 3] = "Canceled", e))(It || {}), fe = /* @__PURE__ */ ((e) => (e[e.Onfido = 0] = "Onfido", e[e.Sumsub = 2] = "Sumsub", e[e.SardinAI = 3] = "SardinAI", e))(fe || {}), Rt = /* @__PURE__ */ ((e) => (e[e.Individual = 0] = "Individual", e[e.Company = 1] = "Company", e))(Rt || {}),
|
|
11
|
+
var G = /* @__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))(G || {}), qe = /* @__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))(qe || {}), xe = /* @__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))(xe || {}), Ct = /* @__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))(Ct || {}), At = /* @__PURE__ */ ((e) => (e[e.LowRisk = 0] = "LowRisk", e[e.MediumRisk = 1] = "MediumRisk", e[e.HighRisk = 2] = "HighRisk", e[e.Alert = 3] = "Alert", e))(At || {}), De = /* @__PURE__ */ ((e) => (e[e.None = 0] = "None", e[e.Pending = 1] = "Pending", e[e.Approved = 2] = "Approved", e[e.Rejected = 3] = "Rejected", e[e.ResendRequested = 4] = "ResendRequested", e[e.Unknown = 5] = "Unknown", e[e.InProgress = 6] = "InProgress", e))(De || {}), Fe = /* @__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))(Fe || {}), Et = /* @__PURE__ */ ((e) => (e[e.ProviderResultPending = 0] = "ProviderResultPending", e[e.ProviderResultReceived = 1] = "ProviderResultReceived", e[e.Canceled = 2] = "Canceled", e[e.ExtendedToNewApplicant = 3] = "ExtendedToNewApplicant", e))(Et || {}), It = /* @__PURE__ */ ((e) => (e[e.None = 0] = "None", e[e.ProviderResultPending = 1] = "ProviderResultPending", e[e.ProviderResultReceived = 2] = "ProviderResultReceived", e[e.Canceled = 3] = "Canceled", e))(It || {}), fe = /* @__PURE__ */ ((e) => (e[e.Onfido = 0] = "Onfido", e[e.Sumsub = 2] = "Sumsub", e[e.SardinAI = 3] = "SardinAI", e))(fe || {}), Rt = /* @__PURE__ */ ((e) => (e[e.Individual = 0] = "Individual", e[e.Company = 1] = "Company", e))(Rt || {}), Ke = /* @__PURE__ */ ((e) => (e[e.Male = 0] = "Male", e[e.Female = 1] = "Female", e[e.Other = 2] = "Other", e))(Ke || {}), Pt = /* @__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))(Pt || {}), Dt = /* @__PURE__ */ ((e) => (e[e.Pending = 0] = "Pending", e[e.Approved = 1] = "Approved", e[e.Rejected = 2] = "Rejected", e[e.RequiresRevision = 3] = "RequiresRevision", e))(Dt || {}), Ft = /* @__PURE__ */ ((e) => (e[e.SingleChoice = 0] = "SingleChoice", e[e.MultipleChoice = 1] = "MultipleChoice", e[e.Text = 2] = "Text", e))(Ft || {}), Ie = /* @__PURE__ */ ((e) => (e[e.String = 0] = "String", e[e.Integer = 1] = "Integer", e[e.Decimal = 2] = "Decimal", e[e.Boolean = 3] = "Boolean", e[e.Date = 4] = "Date", e[e.Country = 5] = "Country", e[e.DigitOnly = 6] = "DigitOnly", e))(Ie || {}), Lt = /* @__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))(Lt || {}), Tt = /* @__PURE__ */ ((e) => (e[e.None = 0] = "None", e[e.Country = 1] = "Country", e))(Tt || {}), he = /* @__PURE__ */ ((e) => (e[e.Individual = 0] = "Individual", e[e.Sophisticated = 1] = "Sophisticated", e[e.HighNetWorth = 2] = "HighNetWorth", e[e.Business = 3] = "Business", e))(he || {}), Mt = /* @__PURE__ */ ((e) => (e[e.Retail = 0] = "Retail", e[e.Professional = 1] = "Professional", e[e.EligibleCounterparty = 2] = "EligibleCounterparty", e))(Mt || {});
|
|
12
12
|
const Le = {
|
|
13
13
|
Nationality: 10,
|
|
14
14
|
Address: 20,
|
|
@@ -44,7 +44,7 @@ const Le = {
|
|
|
44
44
|
"email",
|
|
45
45
|
"phonenumber",
|
|
46
46
|
"dateOfBirth"
|
|
47
|
-
],
|
|
47
|
+
], at = [
|
|
48
48
|
{ value: "EN", label: "English" },
|
|
49
49
|
{ value: "DE", label: "German" },
|
|
50
50
|
{ value: "FR", label: "French" },
|
|
@@ -438,7 +438,7 @@ class Ut {
|
|
|
438
438
|
await this.httpClient.post("UploadDocument", "ReviewUploadDocument", t);
|
|
439
439
|
}
|
|
440
440
|
}
|
|
441
|
-
class
|
|
441
|
+
class jt {
|
|
442
442
|
constructor(t) {
|
|
443
443
|
this.httpClient = t;
|
|
444
444
|
}
|
|
@@ -464,7 +464,7 @@ class qt {
|
|
|
464
464
|
)).result;
|
|
465
465
|
}
|
|
466
466
|
}
|
|
467
|
-
class
|
|
467
|
+
class qt {
|
|
468
468
|
constructor(t) {
|
|
469
469
|
this.httpClient = t;
|
|
470
470
|
}
|
|
@@ -1788,7 +1788,7 @@ class cr {
|
|
|
1788
1788
|
}
|
|
1789
1789
|
const ut = wt(null), on = ({ config: e, children: t }) => {
|
|
1790
1790
|
const [n, a] = b(null), i = ge.useRef(!1), o = ge.useRef(!1), l = Ee(() => {
|
|
1791
|
-
const u = new Bt(e), p = new _t(u), x = new Ht(u), N = new Ut(u), m = new
|
|
1791
|
+
const u = new Bt(e), p = new _t(u), x = new Ht(u), N = new Ut(u), m = new jt(u), y = new qt(u), h = new Kt(u), C = new Wt(u), F = new Yt(u), k = new Qt(u), $ = new tr(u), A = new cr();
|
|
1792
1792
|
return {
|
|
1793
1793
|
httpClient: u,
|
|
1794
1794
|
applicantService: p,
|
|
@@ -1799,7 +1799,7 @@ const ut = wt(null), on = ({ config: e, children: t }) => {
|
|
|
1799
1799
|
riskScoringService: h,
|
|
1800
1800
|
identityService: C,
|
|
1801
1801
|
baseInformationService: F,
|
|
1802
|
-
investorCategorizationService:
|
|
1802
|
+
investorCategorizationService: k,
|
|
1803
1803
|
themeService: $,
|
|
1804
1804
|
themeManager: A
|
|
1805
1805
|
};
|
|
@@ -1868,7 +1868,7 @@ function cn(e, t) {
|
|
|
1868
1868
|
return e.type === a;
|
|
1869
1869
|
});
|
|
1870
1870
|
}
|
|
1871
|
-
function
|
|
1871
|
+
function Ye(e) {
|
|
1872
1872
|
if (e === 0) return "0 Bytes";
|
|
1873
1873
|
const t = 1024, n = ["Bytes", "KB", "MB", "GB"], a = Math.floor(Math.log(e) / Math.log(t));
|
|
1874
1874
|
return Math.round(e / Math.pow(t, a) * 100) / 100 + " " + n[a];
|
|
@@ -2018,12 +2018,12 @@ function yr(e) {
|
|
|
2018
2018
|
o(!1);
|
|
2019
2019
|
}
|
|
2020
2020
|
}
|
|
2021
|
-
}, []),
|
|
2021
|
+
}, []), k = nt.useMemo(() => n != null && n.stepInfoList ? [...n.stepInfoList].sort((A, I) => A.order - I.order) : [], [n == null ? void 0 : n.stepInfoList]), $ = nt.useMemo(() => n ? n.nextWorkflowKey && n.nextWorkflowKey !== n.workFlowKey : !1, [n]);
|
|
2022
2022
|
return {
|
|
2023
2023
|
progress: n,
|
|
2024
2024
|
applicantId: p,
|
|
2025
2025
|
currentStep: (n == null ? void 0 : n.currentStep) || null,
|
|
2026
|
-
steps:
|
|
2026
|
+
steps: k,
|
|
2027
2027
|
status: (n == null ? void 0 : n.status) || xe.None,
|
|
2028
2028
|
workflowResult: (n == null ? void 0 : n.workflowResult) || null,
|
|
2029
2029
|
workflowKey: n == null ? void 0 : n.workFlowKey,
|
|
@@ -2042,7 +2042,7 @@ function yr(e) {
|
|
|
2042
2042
|
}
|
|
2043
2043
|
function fr(e) {
|
|
2044
2044
|
const { questionnaireService: t, applicantService: n } = ye(), [a, i] = b(null), [o, l] = b({}), [d, u] = b(!1), [p, x] = b(!1), [N, m] = b(null), y = ee(!1), h = ee(null), C = Q(async () => {
|
|
2045
|
-
var
|
|
2045
|
+
var k, $;
|
|
2046
2046
|
if (e) {
|
|
2047
2047
|
if (y.current) {
|
|
2048
2048
|
console.log("[Questionnaire] Load already in progress, skipping...");
|
|
@@ -2054,14 +2054,14 @@ function fr(e) {
|
|
|
2054
2054
|
t.getQuestionnaire(e),
|
|
2055
2055
|
n.getApplicantData(e).catch(() => null)
|
|
2056
2056
|
]);
|
|
2057
|
-
if (i(A), (
|
|
2058
|
-
const
|
|
2057
|
+
if (i(A), (k = I == null ? void 0 : I.questionnaireResults) != null && k.length && A) {
|
|
2058
|
+
const j = /* @__PURE__ */ new Map();
|
|
2059
2059
|
for (const g of I.questionnaireResults)
|
|
2060
|
-
g.question && (($ = g.answers) != null && $.length) &&
|
|
2060
|
+
g.question && (($ = g.answers) != null && $.length) && j.set(g.question.trim().toLowerCase(), g.answers);
|
|
2061
2061
|
const J = {}, E = A.questionGroups.flatMap((g) => g.questions ?? []);
|
|
2062
2062
|
for (const g of E) {
|
|
2063
2063
|
const R = g.text.trim().toLowerCase();
|
|
2064
|
-
|
|
2064
|
+
j.has(R) && (J[g.id] = j.get(R));
|
|
2065
2065
|
}
|
|
2066
2066
|
l(J);
|
|
2067
2067
|
}
|
|
@@ -2077,10 +2077,10 @@ function fr(e) {
|
|
|
2077
2077
|
e && h.current !== e && C();
|
|
2078
2078
|
}, [e]);
|
|
2079
2079
|
const F = Q(
|
|
2080
|
-
async (
|
|
2080
|
+
async (k) => {
|
|
2081
2081
|
x(!0), m(null);
|
|
2082
2082
|
try {
|
|
2083
|
-
return await t.fillQuestionnaire(
|
|
2083
|
+
return await t.fillQuestionnaire(k);
|
|
2084
2084
|
} catch ($) {
|
|
2085
2085
|
throw m($), $;
|
|
2086
2086
|
} finally {
|
|
@@ -2125,8 +2125,8 @@ function xr(e) {
|
|
|
2125
2125
|
d(!0), p(0), N(null);
|
|
2126
2126
|
try {
|
|
2127
2127
|
await t.fillUploadDocument(F), p(100);
|
|
2128
|
-
} catch (
|
|
2129
|
-
throw N(
|
|
2128
|
+
} catch (k) {
|
|
2129
|
+
throw N(k), k;
|
|
2130
2130
|
} finally {
|
|
2131
2131
|
d(!1);
|
|
2132
2132
|
}
|
|
@@ -2168,10 +2168,10 @@ function pn(e) {
|
|
|
2168
2168
|
async (F) => {
|
|
2169
2169
|
d(!0), p(null);
|
|
2170
2170
|
try {
|
|
2171
|
-
const
|
|
2172
|
-
return N(
|
|
2173
|
-
} catch (
|
|
2174
|
-
throw p(
|
|
2171
|
+
const k = await t.fillAppropriatenessTest(F);
|
|
2172
|
+
return N(k), k;
|
|
2173
|
+
} catch (k) {
|
|
2174
|
+
throw p(k), k;
|
|
2175
2175
|
} finally {
|
|
2176
2176
|
d(!1);
|
|
2177
2177
|
}
|
|
@@ -2317,7 +2317,7 @@ function vr(e) {
|
|
|
2317
2317
|
};
|
|
2318
2318
|
}
|
|
2319
2319
|
function kr(e) {
|
|
2320
|
-
const { riskScoringService: t, applicantService: n } = ye(), [a, i] = b(null), [o, l] = b({}), [d, u] = b(!1), [p, x] = b(!1), [N, m] = b(null), [y, h] = b(null), C = ee(!1), F = ee(null),
|
|
2320
|
+
const { riskScoringService: t, applicantService: n } = ye(), [a, i] = b(null), [o, l] = b({}), [d, u] = b(!1), [p, x] = b(!1), [N, m] = b(null), [y, h] = b(null), C = ee(!1), F = ee(null), k = Q(async () => {
|
|
2321
2321
|
var A;
|
|
2322
2322
|
if (e) {
|
|
2323
2323
|
if (C.current) {
|
|
@@ -2326,12 +2326,12 @@ function kr(e) {
|
|
|
2326
2326
|
}
|
|
2327
2327
|
C.current = !0, u(!0), m(null);
|
|
2328
2328
|
try {
|
|
2329
|
-
const [I,
|
|
2329
|
+
const [I, j] = await Promise.all([
|
|
2330
2330
|
t.getRiskCriterias(e),
|
|
2331
2331
|
n.getApplicantData(e).catch(() => null)
|
|
2332
2332
|
]);
|
|
2333
|
-
if (i(I), (A =
|
|
2334
|
-
const J =
|
|
2333
|
+
if (i(I), (A = j == null ? void 0 : j.riskScoringResults) != null && A.length) {
|
|
2334
|
+
const J = j.riskScoringResults[0], E = {};
|
|
2335
2335
|
for (const g of J.riskCriteriaResults ?? [])
|
|
2336
2336
|
if (g.riskCriteriaId != null && g.answer != null && g.answer !== "") {
|
|
2337
2337
|
const R = [...new Set(
|
|
@@ -2350,7 +2350,7 @@ function kr(e) {
|
|
|
2350
2350
|
}
|
|
2351
2351
|
}, [e, t, n]);
|
|
2352
2352
|
ne(() => {
|
|
2353
|
-
e && F.current !== e &&
|
|
2353
|
+
e && F.current !== e && k();
|
|
2354
2354
|
}, [e]);
|
|
2355
2355
|
const $ = Q(
|
|
2356
2356
|
async (A) => {
|
|
@@ -2373,7 +2373,7 @@ function kr(e) {
|
|
|
2373
2373
|
isLoading: d,
|
|
2374
2374
|
isSubmitting: p,
|
|
2375
2375
|
error: N,
|
|
2376
|
-
load:
|
|
2376
|
+
load: k,
|
|
2377
2377
|
submit: $
|
|
2378
2378
|
};
|
|
2379
2379
|
}
|
|
@@ -2512,7 +2512,7 @@ const V = ({
|
|
|
2512
2512
|
]
|
|
2513
2513
|
}
|
|
2514
2514
|
);
|
|
2515
|
-
}, me =
|
|
2515
|
+
}, me = Ue(
|
|
2516
2516
|
({ label: e, error: t, helperText: n, leftIcon: a, rightIcon: i, className: o, ...l }, d) => /* @__PURE__ */ s("div", { className: "w-full", children: [
|
|
2517
2517
|
e && /* @__PURE__ */ s("label", { className: "block text-sm font-medium text-gray-700 dark:text-gray-300 mb-1", children: [
|
|
2518
2518
|
e,
|
|
@@ -2631,7 +2631,7 @@ const K = ({ children: e, className: t, ...n }) => /* @__PURE__ */ r(
|
|
|
2631
2631
|
]
|
|
2632
2632
|
}
|
|
2633
2633
|
) });
|
|
2634
|
-
},
|
|
2634
|
+
}, He = Ue(
|
|
2635
2635
|
({ label: e, error: t, helperText: n, options: a, placeholder: i, className: o, style: l, ...d }, u) => /* @__PURE__ */ s("div", { className: "w-full", children: [
|
|
2636
2636
|
e && /* @__PURE__ */ s(
|
|
2637
2637
|
"label",
|
|
@@ -2697,8 +2697,8 @@ const K = ({ children: e, className: t, ...n }) => /* @__PURE__ */ r(
|
|
|
2697
2697
|
!t && n && /* @__PURE__ */ r("p", { className: "mt-1 text-sm", style: { color: "var(--metakyc-text-secondary, #6b7280)" }, children: n })
|
|
2698
2698
|
] })
|
|
2699
2699
|
);
|
|
2700
|
-
|
|
2701
|
-
const
|
|
2700
|
+
He.displayName = "Select";
|
|
2701
|
+
const it = 280, Nr = ({
|
|
2702
2702
|
label: e,
|
|
2703
2703
|
value: t,
|
|
2704
2704
|
onChange: n,
|
|
@@ -2709,42 +2709,42 @@ const at = 280, Nr = ({
|
|
|
2709
2709
|
}) => {
|
|
2710
2710
|
const [d, u] = b(!1), [p, x] = b(""), [N, m] = b(null), y = ee(null), h = ee(null), C = ee(null), F = Q(() => {
|
|
2711
2711
|
if (!h.current) return null;
|
|
2712
|
-
const
|
|
2713
|
-
return { top: te ?
|
|
2714
|
-
}, []),
|
|
2712
|
+
const w = h.current.getBoundingClientRect(), te = window.innerHeight - w.bottom < it && w.top > it;
|
|
2713
|
+
return { top: te ? w.top : w.bottom + 4, left: w.left, width: w.width, openUp: te };
|
|
2714
|
+
}, []), k = Q(() => {
|
|
2715
2715
|
if (o) return;
|
|
2716
|
-
const
|
|
2717
|
-
|
|
2716
|
+
const w = F();
|
|
2717
|
+
w && m(w), u(!0);
|
|
2718
2718
|
}, [o, F]), $ = Q(() => {
|
|
2719
2719
|
u(!1), x("");
|
|
2720
2720
|
}, []);
|
|
2721
2721
|
ne(() => {
|
|
2722
2722
|
if (!d) return;
|
|
2723
|
-
const
|
|
2723
|
+
const w = (U) => {
|
|
2724
2724
|
var B, D;
|
|
2725
2725
|
const te = U.target;
|
|
2726
2726
|
!((B = y.current) != null && B.contains(te)) && !((D = C.current) != null && D.contains(te)) && $();
|
|
2727
2727
|
};
|
|
2728
|
-
return document.addEventListener("mousedown",
|
|
2728
|
+
return document.addEventListener("mousedown", w), () => document.removeEventListener("mousedown", w);
|
|
2729
2729
|
}, [d, $]), ne(() => {
|
|
2730
2730
|
if (!d) return;
|
|
2731
|
-
const
|
|
2731
|
+
const w = () => {
|
|
2732
2732
|
const U = F();
|
|
2733
2733
|
U && m(U);
|
|
2734
2734
|
};
|
|
2735
|
-
return window.addEventListener("scroll",
|
|
2736
|
-
window.removeEventListener("scroll",
|
|
2735
|
+
return window.addEventListener("scroll", w, !0), window.addEventListener("resize", w), () => {
|
|
2736
|
+
window.removeEventListener("scroll", w, !0), window.removeEventListener("resize", w);
|
|
2737
2737
|
};
|
|
2738
2738
|
}, [d, F]);
|
|
2739
2739
|
const A = a.filter(
|
|
2740
|
-
(
|
|
2741
|
-
), I = (
|
|
2742
|
-
o || n(t.includes(
|
|
2743
|
-
},
|
|
2744
|
-
U.stopPropagation(), o || n(t.filter((te) => te !==
|
|
2745
|
-
}, J = (
|
|
2740
|
+
(w) => w.label.toLowerCase().includes(p.toLowerCase())
|
|
2741
|
+
), I = (w) => {
|
|
2742
|
+
o || n(t.includes(w) ? t.filter((U) => U !== w) : [...t, w]);
|
|
2743
|
+
}, j = (w, U) => {
|
|
2744
|
+
U.stopPropagation(), o || n(t.filter((te) => te !== w));
|
|
2745
|
+
}, J = (w) => {
|
|
2746
2746
|
var U;
|
|
2747
|
-
return ((U = a.find((te) => te.value ===
|
|
2747
|
+
return ((U = a.find((te) => te.value === w)) == null ? void 0 : U.label) || w;
|
|
2748
2748
|
}, E = h.current ? getComputedStyle(h.current) : null, g = (E == null ? void 0 : E.getPropertyValue("--metakyc-input-bg").trim()) || "#ffffff", R = (E == null ? void 0 : E.getPropertyValue("--metakyc-border").trim()) || "#d1d5db", P = (E == null ? void 0 : E.getPropertyValue("--metakyc-text-primary").trim()) || "#111827", z = (E == null ? void 0 : E.getPropertyValue("--metakyc-text-secondary").trim()) || "#6b7280", _ = (E == null ? void 0 : E.getPropertyValue("--metakyc-primary").trim()) || "#2563eb", O = (E == null ? void 0 : E.getPropertyValue("--metakyc-primary-light").trim()) || "#eff6ff", M = (E == null ? void 0 : E.getPropertyValue("--metakyc-hover-bg").trim()) || "#f9fafb", Z = d && N && /* @__PURE__ */ s(
|
|
2749
2749
|
"div",
|
|
2750
2750
|
{
|
|
@@ -2769,10 +2769,10 @@ const at = 280, Nr = ({
|
|
|
2769
2769
|
{
|
|
2770
2770
|
type: "text",
|
|
2771
2771
|
value: p,
|
|
2772
|
-
onChange: (
|
|
2772
|
+
onChange: (w) => x(w.target.value),
|
|
2773
2773
|
placeholder: "Search...",
|
|
2774
2774
|
autoFocus: !0,
|
|
2775
|
-
onClick: (
|
|
2775
|
+
onClick: (w) => w.stopPropagation(),
|
|
2776
2776
|
className: "metakyc-multiselect-search w-full",
|
|
2777
2777
|
style: {
|
|
2778
2778
|
display: "block",
|
|
@@ -2788,12 +2788,12 @@ const at = 280, Nr = ({
|
|
|
2788
2788
|
}
|
|
2789
2789
|
}
|
|
2790
2790
|
) }),
|
|
2791
|
-
/* @__PURE__ */ r("ul", { style: { listStyle: "none", margin: 0, padding: "4px 0", maxHeight: "192px", overflowY: "auto" }, children: A.length === 0 ? /* @__PURE__ */ r("li", { style: { padding: "8px 12px", fontSize: "13px", color: z }, children: "No results" }) : A.map((
|
|
2792
|
-
const U = t.includes(
|
|
2791
|
+
/* @__PURE__ */ r("ul", { style: { listStyle: "none", margin: 0, padding: "4px 0", maxHeight: "192px", overflowY: "auto" }, children: A.length === 0 ? /* @__PURE__ */ r("li", { style: { padding: "8px 12px", fontSize: "13px", color: z }, children: "No results" }) : A.map((w) => {
|
|
2792
|
+
const U = t.includes(w.value);
|
|
2793
2793
|
return /* @__PURE__ */ s(
|
|
2794
2794
|
"li",
|
|
2795
2795
|
{
|
|
2796
|
-
onClick: () => I(
|
|
2796
|
+
onClick: () => I(w.value),
|
|
2797
2797
|
className: "metakyc-multiselect-option",
|
|
2798
2798
|
style: {
|
|
2799
2799
|
display: "flex",
|
|
@@ -2822,10 +2822,10 @@ const at = 280, Nr = ({
|
|
|
2822
2822
|
style: { accentColor: _, pointerEvents: "none", flexShrink: 0 }
|
|
2823
2823
|
}
|
|
2824
2824
|
),
|
|
2825
|
-
/* @__PURE__ */ r("span", { children:
|
|
2825
|
+
/* @__PURE__ */ r("span", { children: w.label })
|
|
2826
2826
|
]
|
|
2827
2827
|
},
|
|
2828
|
-
|
|
2828
|
+
w.value
|
|
2829
2829
|
);
|
|
2830
2830
|
}) }),
|
|
2831
2831
|
t.length > 0 && /* @__PURE__ */ r("div", { style: { padding: "6px 12px", borderTop: `1px solid ${R}` }, children: /* @__PURE__ */ s(
|
|
@@ -2862,7 +2862,7 @@ const at = 280, Nr = ({
|
|
|
2862
2862
|
"div",
|
|
2863
2863
|
{
|
|
2864
2864
|
ref: h,
|
|
2865
|
-
onClick: () => d ? $() :
|
|
2865
|
+
onClick: () => d ? $() : k(),
|
|
2866
2866
|
className: oe(
|
|
2867
2867
|
"metakyc-multiselect-trigger",
|
|
2868
2868
|
"min-h-[42px] w-full px-3 py-2 rounded-lg border text-sm transition-colors relative",
|
|
@@ -2882,7 +2882,7 @@ const at = 280, Nr = ({
|
|
|
2882
2882
|
style: { color: "var(--metakyc-text-secondary, #9ca3af)" },
|
|
2883
2883
|
children: i
|
|
2884
2884
|
}
|
|
2885
|
-
) : /* @__PURE__ */ r("div", { className: "flex flex-wrap gap-1 pr-6", children: t.map((
|
|
2885
|
+
) : /* @__PURE__ */ r("div", { className: "flex flex-wrap gap-1 pr-6", children: t.map((w) => /* @__PURE__ */ s(
|
|
2886
2886
|
"span",
|
|
2887
2887
|
{
|
|
2888
2888
|
className: "metakyc-multiselect-chip inline-flex items-center gap-1 px-2 py-0.5 rounded text-xs font-medium",
|
|
@@ -2891,12 +2891,12 @@ const at = 280, Nr = ({
|
|
|
2891
2891
|
color: "var(--metakyc-primary, #2563eb)"
|
|
2892
2892
|
},
|
|
2893
2893
|
children: [
|
|
2894
|
-
J(
|
|
2894
|
+
J(w),
|
|
2895
2895
|
!o && /* @__PURE__ */ r(
|
|
2896
2896
|
"button",
|
|
2897
2897
|
{
|
|
2898
2898
|
type: "button",
|
|
2899
|
-
onClick: (U) =>
|
|
2899
|
+
onClick: (U) => j(w, U),
|
|
2900
2900
|
className: "metakyc-multiselect-chip-remove",
|
|
2901
2901
|
style: {
|
|
2902
2902
|
background: "transparent",
|
|
@@ -2922,7 +2922,7 @@ const at = 280, Nr = ({
|
|
|
2922
2922
|
)
|
|
2923
2923
|
]
|
|
2924
2924
|
},
|
|
2925
|
-
|
|
2925
|
+
w
|
|
2926
2926
|
)) }),
|
|
2927
2927
|
/* @__PURE__ */ r(
|
|
2928
2928
|
"span",
|
|
@@ -2935,9 +2935,9 @@ const at = 280, Nr = ({
|
|
|
2935
2935
|
]
|
|
2936
2936
|
}
|
|
2937
2937
|
),
|
|
2938
|
-
typeof document < "u" && Z ?
|
|
2938
|
+
typeof document < "u" && Z ? Ve(Z, document.body) : null
|
|
2939
2939
|
] });
|
|
2940
|
-
},
|
|
2940
|
+
}, st = 260, We = ({
|
|
2941
2941
|
label: e,
|
|
2942
2942
|
error: t,
|
|
2943
2943
|
helperText: n,
|
|
@@ -2950,22 +2950,22 @@ const at = 280, Nr = ({
|
|
|
2950
2950
|
className: p
|
|
2951
2951
|
}) => {
|
|
2952
2952
|
var D;
|
|
2953
|
-
const [x, N] = b(!1), [m, y] = b(""), [h, C] = b(null), F = ee(null),
|
|
2954
|
-
if (!
|
|
2955
|
-
const S =
|
|
2953
|
+
const [x, N] = b(!1), [m, y] = b(""), [h, C] = b(null), F = ee(null), k = ee(null), $ = ee(null), A = ee(null), I = Q(() => {
|
|
2954
|
+
if (!k.current) return null;
|
|
2955
|
+
const S = k.current.getBoundingClientRect(), X = window.innerHeight - S.bottom < st && S.top > st;
|
|
2956
2956
|
return {
|
|
2957
2957
|
top: X ? S.top : S.bottom + 4,
|
|
2958
2958
|
left: S.left,
|
|
2959
2959
|
width: S.width,
|
|
2960
2960
|
openUp: X
|
|
2961
2961
|
};
|
|
2962
|
-
}, []),
|
|
2962
|
+
}, []), j = Q(() => {
|
|
2963
2963
|
if (d) return;
|
|
2964
2964
|
const S = I();
|
|
2965
2965
|
S && C(S), N(!0);
|
|
2966
2966
|
}, [d, I]), J = Q(() => {
|
|
2967
2967
|
N(!1), y("");
|
|
2968
|
-
}, []), E = () => x ? J() :
|
|
2968
|
+
}, []), E = () => x ? J() : j();
|
|
2969
2969
|
ne(() => {
|
|
2970
2970
|
if (!x) return;
|
|
2971
2971
|
const S = (H) => {
|
|
@@ -2993,7 +2993,7 @@ const at = 280, Nr = ({
|
|
|
2993
2993
|
(S) => S.label.toLowerCase().includes(m.toLowerCase()) || S.value.toLowerCase().includes(m.toLowerCase())
|
|
2994
2994
|
), R = (D = a.find((S) => S.value === o)) == null ? void 0 : D.label, P = (S, H) => {
|
|
2995
2995
|
d || H || (l(S), J());
|
|
2996
|
-
}, z =
|
|
2996
|
+
}, z = k.current ? getComputedStyle(k.current) : null, _ = (z == null ? void 0 : z.getPropertyValue("--metakyc-input-bg").trim()) || "#ffffff", O = (z == null ? void 0 : z.getPropertyValue("--metakyc-border").trim()) || "#d1d5db", M = (z == null ? void 0 : z.getPropertyValue("--metakyc-text-primary").trim()) || "#111827", Z = (z == null ? void 0 : z.getPropertyValue("--metakyc-text-secondary").trim()) || "#6b7280", w = (z == null ? void 0 : z.getPropertyValue("--metakyc-primary").trim()) || "#2563eb", U = (z == null ? void 0 : z.getPropertyValue("--metakyc-primary-light").trim()) || "#eff6ff", te = (z == null ? void 0 : z.getPropertyValue("--metakyc-hover-bg").trim()) || "#f9fafb", B = x && h && /* @__PURE__ */ s(
|
|
2997
2997
|
"div",
|
|
2998
2998
|
{
|
|
2999
2999
|
ref: $,
|
|
@@ -3059,7 +3059,7 @@ const at = 280, Nr = ({
|
|
|
3059
3059
|
cursor: S.disabled ? "not-allowed" : "pointer",
|
|
3060
3060
|
opacity: S.disabled ? 0.4 : 1,
|
|
3061
3061
|
backgroundColor: H ? U : "transparent",
|
|
3062
|
-
color: H ?
|
|
3062
|
+
color: H ? w : M,
|
|
3063
3063
|
userSelect: "none"
|
|
3064
3064
|
},
|
|
3065
3065
|
onMouseEnter: (X) => {
|
|
@@ -3098,7 +3098,7 @@ const at = 280, Nr = ({
|
|
|
3098
3098
|
/* @__PURE__ */ s(
|
|
3099
3099
|
"div",
|
|
3100
3100
|
{
|
|
3101
|
-
ref:
|
|
3101
|
+
ref: k,
|
|
3102
3102
|
role: "button",
|
|
3103
3103
|
tabIndex: d ? -1 : 0,
|
|
3104
3104
|
onClick: E,
|
|
@@ -3133,14 +3133,14 @@ const at = 280, Nr = ({
|
|
|
3133
3133
|
]
|
|
3134
3134
|
}
|
|
3135
3135
|
),
|
|
3136
|
-
typeof document < "u" && B ?
|
|
3136
|
+
typeof document < "u" && B ? Ve(B, document.body) : null,
|
|
3137
3137
|
t && /* @__PURE__ */ r("p", { className: "mt-1 text-sm", style: { color: "var(--metakyc-error, #ef4444)" }, children: t }),
|
|
3138
3138
|
!t && n && /* @__PURE__ */ r("p", { className: "mt-1 text-sm", style: { color: "var(--metakyc-text-secondary, #6b7280)" }, children: n })
|
|
3139
3139
|
]
|
|
3140
3140
|
}
|
|
3141
3141
|
);
|
|
3142
3142
|
};
|
|
3143
|
-
|
|
3143
|
+
We.displayName = "SearchableSelect";
|
|
3144
3144
|
const Sr = ({
|
|
3145
3145
|
label: e,
|
|
3146
3146
|
error: t,
|
|
@@ -3151,26 +3151,26 @@ const Sr = ({
|
|
|
3151
3151
|
value: l = [],
|
|
3152
3152
|
className: d
|
|
3153
3153
|
}) => {
|
|
3154
|
-
const [u, p] = b(!1), x = ee(null), N = (
|
|
3155
|
-
if (!
|
|
3156
|
-
const $ = Array.from(
|
|
3154
|
+
const [u, p] = b(!1), x = ee(null), N = (k) => {
|
|
3155
|
+
if (!k) return;
|
|
3156
|
+
const $ = Array.from(k);
|
|
3157
3157
|
if (i && $.filter((I) => I.size > i).length > 0) {
|
|
3158
|
-
const I =
|
|
3158
|
+
const I = Ye(i);
|
|
3159
3159
|
alert(`Some files exceed the maximum size of ${I}`);
|
|
3160
3160
|
return;
|
|
3161
3161
|
}
|
|
3162
3162
|
o == null || o(a ? [...l, ...$] : [$[0]]);
|
|
3163
|
-
}, m = (
|
|
3164
|
-
|
|
3163
|
+
}, m = (k) => {
|
|
3164
|
+
k.preventDefault(), p(!0);
|
|
3165
3165
|
}, y = () => {
|
|
3166
3166
|
p(!1);
|
|
3167
|
-
}, h = (
|
|
3168
|
-
|
|
3167
|
+
}, h = (k) => {
|
|
3168
|
+
k.preventDefault(), p(!1), N(k.dataTransfer.files);
|
|
3169
3169
|
}, C = () => {
|
|
3170
|
-
var
|
|
3171
|
-
(
|
|
3172
|
-
}, F = (
|
|
3173
|
-
const $ = l.filter((A, I) => I !==
|
|
3170
|
+
var k;
|
|
3171
|
+
(k = x.current) == null || k.click();
|
|
3172
|
+
}, F = (k) => {
|
|
3173
|
+
const $ = l.filter((A, I) => I !== k);
|
|
3174
3174
|
o == null || o($);
|
|
3175
3175
|
};
|
|
3176
3176
|
return /* @__PURE__ */ s("div", { className: oe("w-full", d), children: [
|
|
@@ -3196,7 +3196,7 @@ const Sr = ({
|
|
|
3196
3196
|
className: "hidden",
|
|
3197
3197
|
accept: n,
|
|
3198
3198
|
multiple: a,
|
|
3199
|
-
onChange: (
|
|
3199
|
+
onChange: (k) => N(k.target.files)
|
|
3200
3200
|
}
|
|
3201
3201
|
),
|
|
3202
3202
|
/* @__PURE__ */ s("div", { className: "space-y-2", children: [
|
|
@@ -3224,13 +3224,13 @@ const Sr = ({
|
|
|
3224
3224
|
] }),
|
|
3225
3225
|
i && /* @__PURE__ */ s("p", { className: "text-xs text-gray-500", children: [
|
|
3226
3226
|
"Maximum file size: ",
|
|
3227
|
-
|
|
3227
|
+
Ye(i)
|
|
3228
3228
|
] })
|
|
3229
3229
|
] })
|
|
3230
3230
|
]
|
|
3231
3231
|
}
|
|
3232
3232
|
),
|
|
3233
|
-
l.length > 0 && /* @__PURE__ */ r("div", { className: "mt-3 space-y-2", children: l.map((
|
|
3233
|
+
l.length > 0 && /* @__PURE__ */ r("div", { className: "mt-3 space-y-2", children: l.map((k, $) => /* @__PURE__ */ s(
|
|
3234
3234
|
"div",
|
|
3235
3235
|
{
|
|
3236
3236
|
className: "flex items-center justify-between px-3 py-2 bg-gray-50 dark:bg-gray-700 rounded-lg",
|
|
@@ -3252,10 +3252,10 @@ const Sr = ({
|
|
|
3252
3252
|
)
|
|
3253
3253
|
}
|
|
3254
3254
|
),
|
|
3255
|
-
/* @__PURE__ */ r("span", { className: "text-sm text-gray-700 dark:text-gray-300 truncate", children:
|
|
3255
|
+
/* @__PURE__ */ r("span", { className: "text-sm text-gray-700 dark:text-gray-300 truncate", children: k.name }),
|
|
3256
3256
|
/* @__PURE__ */ s("span", { className: "text-xs text-gray-500", children: [
|
|
3257
3257
|
"(",
|
|
3258
|
-
|
|
3258
|
+
Ye(k.size),
|
|
3259
3259
|
")"
|
|
3260
3260
|
] })
|
|
3261
3261
|
] }),
|
|
@@ -3283,7 +3283,7 @@ const Sr = ({
|
|
|
3283
3283
|
)) }),
|
|
3284
3284
|
t && /* @__PURE__ */ r("p", { className: "mt-1 text-sm text-danger-500", children: t })
|
|
3285
3285
|
] });
|
|
3286
|
-
}, Cr =
|
|
3286
|
+
}, Cr = Ue(
|
|
3287
3287
|
({ countryCode: e = "+1", onCountryCodeChange: t, className: n, ...a }, i) => /* @__PURE__ */ s("div", { className: "w-full", children: [
|
|
3288
3288
|
a.label && /* @__PURE__ */ s("label", { className: "block text-sm font-medium text-gray-700 dark:text-gray-300 mb-1", children: [
|
|
3289
3289
|
a.label,
|
|
@@ -3349,7 +3349,7 @@ const Er = (e) => e.replace(
|
|
|
3349
3349
|
* This source code is licensed under the ISC license.
|
|
3350
3350
|
* See the LICENSE file in the root directory of this source tree.
|
|
3351
3351
|
*/
|
|
3352
|
-
const
|
|
3352
|
+
const ot = (e) => {
|
|
3353
3353
|
const t = Er(e);
|
|
3354
3354
|
return t.charAt(0).toUpperCase() + t.slice(1);
|
|
3355
3355
|
};
|
|
@@ -3388,7 +3388,7 @@ const Rr = (e) => {
|
|
|
3388
3388
|
* This source code is licensed under the ISC license.
|
|
3389
3389
|
* See the LICENSE file in the root directory of this source tree.
|
|
3390
3390
|
*/
|
|
3391
|
-
const Pr =
|
|
3391
|
+
const Pr = Ue(
|
|
3392
3392
|
({
|
|
3393
3393
|
color: e = "currentColor",
|
|
3394
3394
|
size: t = 24,
|
|
@@ -3424,19 +3424,19 @@ const Pr = He(
|
|
|
3424
3424
|
* See the LICENSE file in the root directory of this source tree.
|
|
3425
3425
|
*/
|
|
3426
3426
|
const pt = (e, t) => {
|
|
3427
|
-
const n =
|
|
3427
|
+
const n = Ue(
|
|
3428
3428
|
({ className: a, ...i }, o) => Qe(Pr, {
|
|
3429
3429
|
ref: o,
|
|
3430
3430
|
iconNode: t,
|
|
3431
3431
|
className: mt(
|
|
3432
|
-
`lucide-${Ar(
|
|
3432
|
+
`lucide-${Ar(ot(e))}`,
|
|
3433
3433
|
`lucide-${e}`,
|
|
3434
3434
|
a
|
|
3435
3435
|
),
|
|
3436
3436
|
...i
|
|
3437
3437
|
})
|
|
3438
3438
|
);
|
|
3439
|
-
return n.displayName =
|
|
3439
|
+
return n.displayName = ot(e), n;
|
|
3440
3440
|
};
|
|
3441
3441
|
/**
|
|
3442
3442
|
* @license lucide-react v0.574.0 - ISC
|
|
@@ -3503,21 +3503,21 @@ const Mr = ({
|
|
|
3503
3503
|
const C = Ee(
|
|
3504
3504
|
() => a ? Tr(a.questionGroups) : [],
|
|
3505
3505
|
[a]
|
|
3506
|
-
), F = y === C.length - 1,
|
|
3506
|
+
), F = y === C.length - 1, k = C[y] ?? [], $ = Q((E, g) => {
|
|
3507
3507
|
x((R) => ({ ...R, [E]: g })), m((R) => {
|
|
3508
3508
|
const P = { ...R };
|
|
3509
3509
|
return delete P[E], P;
|
|
3510
3510
|
});
|
|
3511
3511
|
}, []), A = Q(() => {
|
|
3512
3512
|
const E = {};
|
|
3513
|
-
for (const { question: g } of
|
|
3513
|
+
for (const { question: g } of k) {
|
|
3514
3514
|
const R = Lr(g, p[g.id] ?? []);
|
|
3515
3515
|
R && (E[g.id] = R);
|
|
3516
3516
|
}
|
|
3517
3517
|
return m((g) => ({ ...g, ...E })), Object.keys(E).length === 0;
|
|
3518
|
-
}, [
|
|
3518
|
+
}, [k, p]), I = () => {
|
|
3519
3519
|
A() && h((E) => E + 1);
|
|
3520
|
-
},
|
|
3520
|
+
}, j = () => {
|
|
3521
3521
|
y > 0 ? h((E) => E - 1) : n == null || n();
|
|
3522
3522
|
}, J = async () => {
|
|
3523
3523
|
if (!(!A() || !a))
|
|
@@ -3565,7 +3565,7 @@ const Mr = ({
|
|
|
3565
3565
|
)) })
|
|
3566
3566
|
] })
|
|
3567
3567
|
] }),
|
|
3568
|
-
/* @__PURE__ */ r(W, { className: "space-y-6", children:
|
|
3568
|
+
/* @__PURE__ */ r(W, { className: "space-y-6", children: k.map(({ question: E }) => /* @__PURE__ */ r(
|
|
3569
3569
|
Or,
|
|
3570
3570
|
{
|
|
3571
3571
|
question: E,
|
|
@@ -3581,7 +3581,7 @@ const Mr = ({
|
|
|
3581
3581
|
{
|
|
3582
3582
|
type: "button",
|
|
3583
3583
|
variant: "outline",
|
|
3584
|
-
onClick:
|
|
3584
|
+
onClick: j,
|
|
3585
3585
|
style: { display: "flex", alignItems: "center", gap: "4px" },
|
|
3586
3586
|
children: [
|
|
3587
3587
|
/* @__PURE__ */ r(ht, { size: 14 }),
|
|
@@ -3633,7 +3633,7 @@ const Mr = ({
|
|
|
3633
3633
|
}
|
|
3634
3634
|
),
|
|
3635
3635
|
o === "single-select" && /* @__PURE__ */ r(
|
|
3636
|
-
|
|
3636
|
+
He,
|
|
3637
3637
|
{
|
|
3638
3638
|
value: t[0] ?? "",
|
|
3639
3639
|
onChange: (d) => a([d.target.value]),
|
|
@@ -3729,9 +3729,9 @@ const Mr = ({
|
|
|
3729
3729
|
const m = await Promise.all(
|
|
3730
3730
|
a.uploadDocumentFiles.map(async (h) => {
|
|
3731
3731
|
const C = u[h.id] || [], F = await Promise.all(
|
|
3732
|
-
C.map(async (
|
|
3733
|
-
fileName:
|
|
3734
|
-
fileData: await dr(
|
|
3732
|
+
C.map(async (k) => ({
|
|
3733
|
+
fileName: k.name,
|
|
3734
|
+
fileData: await dr(k)
|
|
3735
3735
|
}))
|
|
3736
3736
|
);
|
|
3737
3737
|
return {
|
|
@@ -3859,10 +3859,10 @@ const Ur = ({
|
|
|
3859
3859
|
ge.useEffect(() => {
|
|
3860
3860
|
i && Object.keys(i).length > 0 && Object.keys(p).length === 0 && x(i);
|
|
3861
3861
|
}, [i]);
|
|
3862
|
-
const
|
|
3862
|
+
const k = Ee(
|
|
3863
3863
|
() => a && a.length > 0 ? _r(a) : [],
|
|
3864
3864
|
[a]
|
|
3865
|
-
), $ = y ===
|
|
3865
|
+
), $ = y === k.length - 1, A = k[y] ?? [];
|
|
3866
3866
|
ge.useEffect(() => {
|
|
3867
3867
|
!o && a && a.length === 0 && !C && !l && (F(!0), u({ applicantId: e, criteriaValueInputs: [] }).then(() => t == null ? void 0 : t()).catch(console.error));
|
|
3868
3868
|
}, [o, a, C, l, u, e, t]);
|
|
@@ -3871,7 +3871,7 @@ const Ur = ({
|
|
|
3871
3871
|
const _ = { ...z };
|
|
3872
3872
|
return delete _[R], _;
|
|
3873
3873
|
});
|
|
3874
|
-
}, []),
|
|
3874
|
+
}, []), j = Q(() => {
|
|
3875
3875
|
const R = {};
|
|
3876
3876
|
for (const { criterion: P } of A) {
|
|
3877
3877
|
const z = Br(P, p[P.id] ?? []);
|
|
@@ -3879,11 +3879,11 @@ const Ur = ({
|
|
|
3879
3879
|
}
|
|
3880
3880
|
return m((P) => ({ ...P, ...R })), Object.keys(R).length === 0;
|
|
3881
3881
|
}, [A, p]), J = () => {
|
|
3882
|
-
|
|
3882
|
+
j() && h((R) => R + 1);
|
|
3883
3883
|
}, E = () => {
|
|
3884
3884
|
y > 0 ? h((R) => R - 1) : n == null || n();
|
|
3885
3885
|
}, g = async () => {
|
|
3886
|
-
if (!(!
|
|
3886
|
+
if (!(!j() || !a))
|
|
3887
3887
|
try {
|
|
3888
3888
|
const R = a.map((z) => {
|
|
3889
3889
|
const _ = (p[z.id] ?? []).filter((O) => O && O.trim());
|
|
@@ -3907,14 +3907,14 @@ const Ur = ({
|
|
|
3907
3907
|
/* @__PURE__ */ s(de, { children: [
|
|
3908
3908
|
/* @__PURE__ */ r("h2", { className: "text-lg font-bold", children: "Risk Assessment" }),
|
|
3909
3909
|
/* @__PURE__ */ r("p", { className: "text-sm", style: { color: "var(--metakyc-text-secondary, #6b7280)" }, children: "Please answer the following questions for risk evaluation" }),
|
|
3910
|
-
|
|
3910
|
+
k.length > 1 && /* @__PURE__ */ s("div", { className: "flex items-center justify-between mt-3", children: [
|
|
3911
3911
|
/* @__PURE__ */ s("span", { className: "text-xs", style: { color: "var(--metakyc-text-muted, #9ca3af)" }, children: [
|
|
3912
3912
|
"Page ",
|
|
3913
3913
|
y + 1,
|
|
3914
3914
|
" of ",
|
|
3915
|
-
|
|
3915
|
+
k.length
|
|
3916
3916
|
] }),
|
|
3917
|
-
/* @__PURE__ */ r("div", { className: "flex items-center gap-1.5", children:
|
|
3917
|
+
/* @__PURE__ */ r("div", { className: "flex items-center gap-1.5", children: k.map((R, P) => /* @__PURE__ */ r(
|
|
3918
3918
|
"div",
|
|
3919
3919
|
{
|
|
3920
3920
|
className: "rounded-full transition-all duration-200",
|
|
@@ -3929,7 +3929,7 @@ const Ur = ({
|
|
|
3929
3929
|
] })
|
|
3930
3930
|
] }),
|
|
3931
3931
|
/* @__PURE__ */ r(W, { className: "space-y-6", children: A.map(({ criterion: R }) => /* @__PURE__ */ r(
|
|
3932
|
-
|
|
3932
|
+
jr,
|
|
3933
3933
|
{
|
|
3934
3934
|
criterion: R,
|
|
3935
3935
|
value: p[R.id] ?? [],
|
|
@@ -3967,7 +3967,7 @@ const Ur = ({
|
|
|
3967
3967
|
] }),
|
|
3968
3968
|
d && /* @__PURE__ */ r("div", { className: "mx-6 mb-4 p-3 bg-red-50 border border-red-200 rounded", children: /* @__PURE__ */ r("p", { className: "text-red-600 text-sm", children: d.message }) })
|
|
3969
3969
|
] }) : null;
|
|
3970
|
-
},
|
|
3970
|
+
}, jr = ({ criterion: e, value: t, error: n, onChange: a }) => {
|
|
3971
3971
|
const i = Hr(e), o = e.valueDataType === Ie.Integer || e.valueDataType === Ie.Decimal || e.valueDataType === Ie.DigitOnly;
|
|
3972
3972
|
return /* @__PURE__ */ s("div", { className: "space-y-2", children: [
|
|
3973
3973
|
/* @__PURE__ */ s("label", { className: "block text-sm font-medium", style: { color: "var(--metakyc-text-primary, #111827)" }, children: [
|
|
@@ -4067,7 +4067,7 @@ const Ur = ({
|
|
|
4067
4067
|
n && /* @__PURE__ */ r("p", { className: "text-sm text-danger-500", children: n })
|
|
4068
4068
|
] }),
|
|
4069
4069
|
i === "country" && /* @__PURE__ */ r(
|
|
4070
|
-
|
|
4070
|
+
He,
|
|
4071
4071
|
{
|
|
4072
4072
|
value: t[0] ?? "",
|
|
4073
4073
|
onChange: (l) => a([l.target.value]),
|
|
@@ -4084,7 +4084,7 @@ const Ur = ({
|
|
|
4084
4084
|
}
|
|
4085
4085
|
)
|
|
4086
4086
|
] });
|
|
4087
|
-
},
|
|
4087
|
+
}, qr = ({
|
|
4088
4088
|
applicantId: e,
|
|
4089
4089
|
onComplete: t,
|
|
4090
4090
|
onBack: n
|
|
@@ -4227,7 +4227,7 @@ const Ur = ({
|
|
|
4227
4227
|
onComplete: t,
|
|
4228
4228
|
onBack: n
|
|
4229
4229
|
}) => {
|
|
4230
|
-
const { appropriatenessTestService: a } = ye(), [i, o] = b(null), [l, d] = b(!0), [u, p] = b(!1), [x, N] = b(null), [m, y] = b({}), [h, C] = b(0), [F,
|
|
4230
|
+
const { appropriatenessTestService: a } = ye(), [i, o] = b(null), [l, d] = b(!0), [u, p] = b(!1), [x, N] = b(null), [m, y] = b({}), [h, C] = b(0), [F, k] = b(!1), [$, A] = b(!1), [I, j] = b(0);
|
|
4231
4231
|
ne(() => {
|
|
4232
4232
|
(async () => {
|
|
4233
4233
|
try {
|
|
@@ -4235,7 +4235,7 @@ const Ur = ({
|
|
|
4235
4235
|
const M = await a.getAppropriatenessTest(e);
|
|
4236
4236
|
if (console.log("Appropriateness test data:", M), o(M), M.waitTimeSpanForNextTry && M.waitTimeSpanForNextTry !== "00:00:00") {
|
|
4237
4237
|
const Z = J(M.waitTimeSpanForNextTry);
|
|
4238
|
-
Z > 0 &&
|
|
4238
|
+
Z > 0 && j(Z);
|
|
4239
4239
|
}
|
|
4240
4240
|
} catch (M) {
|
|
4241
4241
|
console.error("Error loading appropriateness test:", M), N(M.message || "Failed to load appropriateness test");
|
|
@@ -4247,8 +4247,8 @@ const Ur = ({
|
|
|
4247
4247
|
const J = (O) => {
|
|
4248
4248
|
const M = O.split(":").map(Number);
|
|
4249
4249
|
if (M.length === 3) {
|
|
4250
|
-
const [Z,
|
|
4251
|
-
return Z * 3600 +
|
|
4250
|
+
const [Z, w, U] = M;
|
|
4251
|
+
return Z * 3600 + w * 60 + U;
|
|
4252
4252
|
}
|
|
4253
4253
|
return 0;
|
|
4254
4254
|
}, E = (O) => {
|
|
@@ -4264,14 +4264,14 @@ const Ur = ({
|
|
|
4264
4264
|
}, [F, h]), ne(() => {
|
|
4265
4265
|
if (I <= 0) return;
|
|
4266
4266
|
const O = setInterval(() => {
|
|
4267
|
-
|
|
4267
|
+
j((M) => M <= 1 ? 0 : M - 1);
|
|
4268
4268
|
}, 1e3);
|
|
4269
4269
|
return () => clearInterval(O);
|
|
4270
4270
|
}, [I]), ne(() => {
|
|
4271
4271
|
$ && !u && P();
|
|
4272
4272
|
}, [$]);
|
|
4273
4273
|
const g = () => {
|
|
4274
|
-
i && (
|
|
4274
|
+
i && (k(!0), C(i.testDurationSec));
|
|
4275
4275
|
}, R = (O, M) => {
|
|
4276
4276
|
y((Z) => ({
|
|
4277
4277
|
...Z,
|
|
@@ -4289,9 +4289,9 @@ const Ur = ({
|
|
|
4289
4289
|
p(!0), N(null);
|
|
4290
4290
|
try {
|
|
4291
4291
|
const M = i.appropriatenessQuestions.map(
|
|
4292
|
-
(
|
|
4293
|
-
appropriatenessQuestionId:
|
|
4294
|
-
value: m[
|
|
4292
|
+
(w) => ({
|
|
4293
|
+
appropriatenessQuestionId: w.id,
|
|
4294
|
+
value: m[w.id] || ""
|
|
4295
4295
|
// Empty string if not answered
|
|
4296
4296
|
})
|
|
4297
4297
|
), Z = {
|
|
@@ -4301,17 +4301,17 @@ const Ur = ({
|
|
|
4301
4301
|
};
|
|
4302
4302
|
console.log("Submitting appropriateness test:", Z);
|
|
4303
4303
|
try {
|
|
4304
|
-
const
|
|
4305
|
-
console.log("Appropriateness test result:",
|
|
4306
|
-
} catch (
|
|
4307
|
-
if (
|
|
4308
|
-
const U =
|
|
4309
|
-
console.log("Test failed:", U), N(U),
|
|
4304
|
+
const w = await a.fillAppropriatenessTest(Z);
|
|
4305
|
+
console.log("Appropriateness test result:", w), w.message && (w.message.toLowerCase().includes("pass") || w.message.toLowerCase().includes("success") || w.message.toLowerCase().includes("congratulations")) ? t == null || t() : (N(w.message || "Test completed. Please check the result."), k(!1), A(!1), y({}), setTimeout(() => z(), 1e3));
|
|
4306
|
+
} catch (w) {
|
|
4307
|
+
if (w.code === 400 && w.message) {
|
|
4308
|
+
const U = w.message;
|
|
4309
|
+
console.log("Test failed:", U), N(U), k(!1), A(!1), y({}), setTimeout(() => z(), 1500);
|
|
4310
4310
|
} else
|
|
4311
|
-
throw
|
|
4311
|
+
throw w;
|
|
4312
4312
|
}
|
|
4313
4313
|
} catch (M) {
|
|
4314
|
-
console.error("Error submitting appropriateness test:", M), N(M.message || "Failed to submit test. Please try again."),
|
|
4314
|
+
console.error("Error submitting appropriateness test:", M), N(M.message || "Failed to submit test. Please try again."), k(!1), A(!1), y({});
|
|
4315
4315
|
} finally {
|
|
4316
4316
|
p(!1);
|
|
4317
4317
|
}
|
|
@@ -4321,7 +4321,7 @@ const Ur = ({
|
|
|
4321
4321
|
const O = await a.getAppropriatenessTest(e);
|
|
4322
4322
|
if (console.log("Reloaded test data:", O), o(O), O.waitTimeSpanForNextTry && O.waitTimeSpanForNextTry !== "00:00:00") {
|
|
4323
4323
|
const M = J(O.waitTimeSpanForNextTry);
|
|
4324
|
-
M > 0 &&
|
|
4324
|
+
M > 0 && j(M);
|
|
4325
4325
|
}
|
|
4326
4326
|
} catch (O) {
|
|
4327
4327
|
console.error("Error reloading test data:", O), N((M) => M + `
|
|
@@ -4399,7 +4399,7 @@ Failed to reload test data. Please refresh the page.`);
|
|
|
4399
4399
|
O.groupName && /* @__PURE__ */ r("span", { className: "ml-2 text-xs text-gray-500 dark:text-gray-400", children: O.groupName }),
|
|
4400
4400
|
/* @__PURE__ */ r("h3", { className: "text-lg font-semibold text-gray-900 dark:text-white mt-2", children: O.question })
|
|
4401
4401
|
] }),
|
|
4402
|
-
/* @__PURE__ */ r("div", { className: "space-y-2", children: O.answers.map((Z,
|
|
4402
|
+
/* @__PURE__ */ r("div", { className: "space-y-2", children: O.answers.map((Z, w) => /* @__PURE__ */ s(
|
|
4403
4403
|
"label",
|
|
4404
4404
|
{
|
|
4405
4405
|
className: `
|
|
@@ -4422,7 +4422,7 @@ Failed to reload test data. Please refresh the page.`);
|
|
|
4422
4422
|
/* @__PURE__ */ r("span", { className: "ml-3 text-gray-700 dark:text-gray-300", children: Z })
|
|
4423
4423
|
]
|
|
4424
4424
|
},
|
|
4425
|
-
|
|
4425
|
+
w
|
|
4426
4426
|
)) })
|
|
4427
4427
|
]
|
|
4428
4428
|
},
|
|
@@ -4509,8 +4509,8 @@ Failed to reload test data. Please refresh the page.`);
|
|
|
4509
4509
|
onComplete: t,
|
|
4510
4510
|
onBack: n
|
|
4511
4511
|
}) => {
|
|
4512
|
-
var Z,
|
|
4513
|
-
const { applicantService: a, baseInformationService: i, config: o } = ye(), { identityData: l, provider: d, token: u, isLoading: p, error: x, requestIdentity: N, restartIdentity: m } = vr(e), [y, h] = b(null), [C, F] = b(null), [
|
|
4512
|
+
var Z, w, U, te;
|
|
4513
|
+
const { applicantService: a, baseInformationService: i, config: o } = ye(), { identityData: l, provider: d, token: u, isLoading: p, error: x, requestIdentity: N, restartIdentity: m } = vr(e), [y, h] = b(null), [C, F] = b(null), [k, $] = b([]), [A, I] = b(!0), [j, J] = b(!1), [E, g] = b(null), [R, P] = b(!1), z = ge.useRef(!1), _ = St({
|
|
4514
4514
|
defaultValues: {
|
|
4515
4515
|
street: "",
|
|
4516
4516
|
streetNumber: "",
|
|
@@ -4558,8 +4558,8 @@ Failed to reload test data. Please refresh the page.`);
|
|
|
4558
4558
|
}
|
|
4559
4559
|
})();
|
|
4560
4560
|
}, [e]), ne(() => {
|
|
4561
|
-
l && !
|
|
4562
|
-
}, [l,
|
|
4561
|
+
l && !j && (console.log("[Identity] Identity data already loaded, showing provider"), J(!0));
|
|
4562
|
+
}, [l, j]), ne(() => {
|
|
4563
4563
|
if (u) {
|
|
4564
4564
|
if (u.expiresAt) {
|
|
4565
4565
|
const B = new Date(u.expiresAt).getTime();
|
|
@@ -4584,7 +4584,7 @@ Failed to reload test data. Please refresh the page.`);
|
|
|
4584
4584
|
}
|
|
4585
4585
|
}
|
|
4586
4586
|
}, [u]), ne(() => {
|
|
4587
|
-
if (d !== null && u && !y &&
|
|
4587
|
+
if (d !== null && u && !y && j && !R) {
|
|
4588
4588
|
const B = d;
|
|
4589
4589
|
if (u.url) {
|
|
4590
4590
|
console.log("[Identity] Loading provider URL for user verification:", u.url), g(null);
|
|
@@ -4650,7 +4650,7 @@ Failed to reload test data. Please refresh the page.`);
|
|
|
4650
4650
|
console.error("[Identity] Error destroying provider:", B);
|
|
4651
4651
|
}
|
|
4652
4652
|
};
|
|
4653
|
-
}, [d, u, y,
|
|
4653
|
+
}, [d, u, y, j, t, R]);
|
|
4654
4654
|
const O = async () => {
|
|
4655
4655
|
try {
|
|
4656
4656
|
g(null), P(!1), await N(), J(!0);
|
|
@@ -4674,7 +4674,7 @@ Failed to reload test data. Please refresh the page.`);
|
|
|
4674
4674
|
"Error: ",
|
|
4675
4675
|
x.message
|
|
4676
4676
|
] }) }) });
|
|
4677
|
-
if (
|
|
4677
|
+
if (j && (E || R))
|
|
4678
4678
|
return /* @__PURE__ */ s(K, { children: [
|
|
4679
4679
|
/* @__PURE__ */ r(de, { children: /* @__PURE__ */ r("h2", { className: "text-2xl font-bold text-gray-900 dark:text-white", children: "Verification Session Issue" }) }),
|
|
4680
4680
|
/* @__PURE__ */ s(W, { children: [
|
|
@@ -4716,7 +4716,7 @@ Failed to reload test data. Please refresh the page.`);
|
|
|
4716
4716
|
/* @__PURE__ */ r(V, { type: "button", onClick: M, disabled: p, children: p ? "Restarting..." : "Restart Verification" })
|
|
4717
4717
|
] })
|
|
4718
4718
|
] });
|
|
4719
|
-
if (
|
|
4719
|
+
if (j && l) {
|
|
4720
4720
|
const B = d;
|
|
4721
4721
|
return u != null && u.url ? /* @__PURE__ */ s(K, { children: [
|
|
4722
4722
|
/* @__PURE__ */ r(de, { children: /* @__PURE__ */ s("div", { className: "flex items-center justify-between", children: [
|
|
@@ -4796,7 +4796,7 @@ Failed to reload test data. Please refresh the page.`);
|
|
|
4796
4796
|
/* @__PURE__ */ s("p", { className: "mt-1 text-base", children: [
|
|
4797
4797
|
(Z = C == null ? void 0 : C.applicantRequestData) == null ? void 0 : Z.firstName,
|
|
4798
4798
|
" ",
|
|
4799
|
-
(
|
|
4799
|
+
(w = C == null ? void 0 : C.applicantRequestData) == null ? void 0 : w.lastName
|
|
4800
4800
|
] })
|
|
4801
4801
|
] }),
|
|
4802
4802
|
/* @__PURE__ */ s("div", { children: [
|
|
@@ -4817,13 +4817,13 @@ Failed to reload test data. Please refresh the page.`);
|
|
|
4817
4817
|
control: _.control,
|
|
4818
4818
|
name: "country",
|
|
4819
4819
|
render: ({ field: B }) => /* @__PURE__ */ r(
|
|
4820
|
-
|
|
4820
|
+
He,
|
|
4821
4821
|
{
|
|
4822
4822
|
...B,
|
|
4823
4823
|
label: "Country",
|
|
4824
4824
|
options: [
|
|
4825
4825
|
{ value: "", label: "Select country..." },
|
|
4826
|
-
...
|
|
4826
|
+
...k.map((D) => ({
|
|
4827
4827
|
value: D.abbreviation3 || D.abbreviation,
|
|
4828
4828
|
label: D.name
|
|
4829
4829
|
}))
|
|
@@ -4838,13 +4838,13 @@ Failed to reload test data. Please refresh the page.`);
|
|
|
4838
4838
|
control: _.control,
|
|
4839
4839
|
name: "nationality",
|
|
4840
4840
|
render: ({ field: B }) => /* @__PURE__ */ r(
|
|
4841
|
-
|
|
4841
|
+
He,
|
|
4842
4842
|
{
|
|
4843
4843
|
...B,
|
|
4844
4844
|
label: "Nationality",
|
|
4845
4845
|
options: [
|
|
4846
4846
|
{ value: "", label: "Select nationality..." },
|
|
4847
|
-
...
|
|
4847
|
+
...k.map((D) => ({
|
|
4848
4848
|
value: D.abbreviation3 || D.abbreviation,
|
|
4849
4849
|
label: D.name
|
|
4850
4850
|
}))
|
|
@@ -4905,7 +4905,7 @@ Failed to reload test data. Please refresh the page.`);
|
|
|
4905
4905
|
/* @__PURE__ */ r(V, { type: "submit", isLoading: p, children: "Confirm and Start Verification" })
|
|
4906
4906
|
] })
|
|
4907
4907
|
] }) });
|
|
4908
|
-
},
|
|
4908
|
+
}, lt = ({
|
|
4909
4909
|
kycStatus: e,
|
|
4910
4910
|
reviewStatus: t,
|
|
4911
4911
|
workflowResult: n,
|
|
@@ -5040,7 +5040,7 @@ Failed to reload test data. Please refresh the page.`);
|
|
|
5040
5040
|
] }),
|
|
5041
5041
|
/* @__PURE__ */ s(pe, { className: "flex justify-center gap-4", children: [
|
|
5042
5042
|
d.type === "success" && i && /* @__PURE__ */ r(V, { onClick: i, size: "lg", children: "Continue" }),
|
|
5043
|
-
d.type === "error" && /* @__PURE__ */ s(
|
|
5043
|
+
d.type === "error" && /* @__PURE__ */ s(ct, { children: [
|
|
5044
5044
|
o && /* @__PURE__ */ r(V, { variant: "outline", onClick: o, children: "Contact Support" }),
|
|
5045
5045
|
i && /* @__PURE__ */ r(V, { onClick: i, children: "Try Again" })
|
|
5046
5046
|
] }),
|
|
@@ -5083,11 +5083,11 @@ Failed to reload test data. Please refresh the page.`);
|
|
|
5083
5083
|
] }),
|
|
5084
5084
|
t && /* @__PURE__ */ r("p", { className: "text-sm text-gray-600 dark:text-gray-400 mt-1", children: t })
|
|
5085
5085
|
] });
|
|
5086
|
-
},
|
|
5087
|
-
function
|
|
5086
|
+
}, je = ["firstName", "lastName", "email", "phonenumber", "dateOfBirth"];
|
|
5087
|
+
function Be(e) {
|
|
5088
5088
|
return e == null || e === "" || Array.isArray(e) && e.length === 0;
|
|
5089
5089
|
}
|
|
5090
|
-
const
|
|
5090
|
+
const _e = {
|
|
5091
5091
|
width: "16px",
|
|
5092
5092
|
height: "16px",
|
|
5093
5093
|
minWidth: "16px",
|
|
@@ -5101,71 +5101,135 @@ const Be = {
|
|
|
5101
5101
|
verticalAlign: "middle"
|
|
5102
5102
|
}, Qr = ({ helpText: e, children: t }) => {
|
|
5103
5103
|
const [n, a] = ge.useState(!1);
|
|
5104
|
-
|
|
5105
|
-
|
|
5106
|
-
|
|
5107
|
-
|
|
5108
|
-
|
|
5104
|
+
if (!e) return /* @__PURE__ */ r(ct, { children: t });
|
|
5105
|
+
const i = n ? /* @__PURE__ */ r(
|
|
5106
|
+
"div",
|
|
5107
|
+
{
|
|
5108
|
+
role: "dialog",
|
|
5109
|
+
"aria-modal": "true",
|
|
5110
|
+
onClick: () => a(!1),
|
|
5111
|
+
style: {
|
|
5112
|
+
position: "fixed",
|
|
5113
|
+
inset: 0,
|
|
5114
|
+
zIndex: 999999,
|
|
5115
|
+
background: "rgba(0, 0, 0, 0.45)",
|
|
5116
|
+
display: "flex",
|
|
5117
|
+
alignItems: "center",
|
|
5118
|
+
justifyContent: "center",
|
|
5119
|
+
padding: "16px"
|
|
5120
|
+
},
|
|
5121
|
+
children: /* @__PURE__ */ s(
|
|
5122
|
+
"div",
|
|
5109
5123
|
{
|
|
5110
|
-
|
|
5111
|
-
onClick: () => a((i) => !i),
|
|
5112
|
-
"aria-label": "Help",
|
|
5124
|
+
onClick: (o) => o.stopPropagation(),
|
|
5113
5125
|
style: {
|
|
5114
|
-
|
|
5115
|
-
|
|
5116
|
-
|
|
5117
|
-
|
|
5118
|
-
|
|
5119
|
-
|
|
5120
|
-
|
|
5121
|
-
|
|
5122
|
-
|
|
5123
|
-
fontWeight: "bold",
|
|
5124
|
-
cursor: "pointer",
|
|
5125
|
-
display: "flex",
|
|
5126
|
-
alignItems: "center",
|
|
5127
|
-
justifyContent: "center",
|
|
5128
|
-
lineHeight: 1,
|
|
5129
|
-
transition: "all 0.15s"
|
|
5126
|
+
background: "var(--metakyc-card-bg, #ffffff)",
|
|
5127
|
+
borderRadius: "12px",
|
|
5128
|
+
padding: "28px 24px 24px",
|
|
5129
|
+
maxWidth: "480px",
|
|
5130
|
+
width: "100%",
|
|
5131
|
+
maxHeight: "80vh",
|
|
5132
|
+
overflowY: "auto",
|
|
5133
|
+
boxShadow: "0 24px 64px rgba(0,0,0,0.25)",
|
|
5134
|
+
position: "relative"
|
|
5130
5135
|
},
|
|
5131
|
-
children:
|
|
5136
|
+
children: [
|
|
5137
|
+
/* @__PURE__ */ r(
|
|
5138
|
+
"button",
|
|
5139
|
+
{
|
|
5140
|
+
type: "button",
|
|
5141
|
+
onClick: () => a(!1),
|
|
5142
|
+
"aria-label": "Close",
|
|
5143
|
+
style: {
|
|
5144
|
+
position: "absolute",
|
|
5145
|
+
top: "12px",
|
|
5146
|
+
right: "12px",
|
|
5147
|
+
width: "28px",
|
|
5148
|
+
height: "28px",
|
|
5149
|
+
borderRadius: "50%",
|
|
5150
|
+
border: "1px solid var(--metakyc-border, #e5e7eb)",
|
|
5151
|
+
background: "var(--metakyc-input-bg, #f3f4f6)",
|
|
5152
|
+
color: "var(--metakyc-text-secondary, #6b7280)",
|
|
5153
|
+
fontSize: "16px",
|
|
5154
|
+
cursor: "pointer",
|
|
5155
|
+
display: "flex",
|
|
5156
|
+
alignItems: "center",
|
|
5157
|
+
justifyContent: "center",
|
|
5158
|
+
lineHeight: 1
|
|
5159
|
+
},
|
|
5160
|
+
children: "×"
|
|
5161
|
+
}
|
|
5162
|
+
),
|
|
5163
|
+
/* @__PURE__ */ r(
|
|
5164
|
+
"div",
|
|
5165
|
+
{
|
|
5166
|
+
style: {
|
|
5167
|
+
color: "var(--metakyc-text-primary, #111827)",
|
|
5168
|
+
fontSize: "14px",
|
|
5169
|
+
lineHeight: 1.75
|
|
5170
|
+
},
|
|
5171
|
+
dangerouslySetInnerHTML: { __html: e }
|
|
5172
|
+
}
|
|
5173
|
+
)
|
|
5174
|
+
]
|
|
5132
5175
|
}
|
|
5133
5176
|
)
|
|
5134
|
-
|
|
5135
|
-
|
|
5136
|
-
|
|
5177
|
+
}
|
|
5178
|
+
) : null;
|
|
5179
|
+
return /* @__PURE__ */ s("div", { style: { display: "flex", alignItems: "flex-start", gap: "6px" }, children: [
|
|
5180
|
+
/* @__PURE__ */ r("div", { style: { flex: 1, minWidth: 0 }, children: t }),
|
|
5181
|
+
/* @__PURE__ */ r(
|
|
5182
|
+
"button",
|
|
5137
5183
|
{
|
|
5184
|
+
type: "button",
|
|
5185
|
+
onClick: () => a(!0),
|
|
5186
|
+
"aria-label": "Help",
|
|
5138
5187
|
style: {
|
|
5139
|
-
|
|
5140
|
-
|
|
5141
|
-
|
|
5142
|
-
|
|
5143
|
-
|
|
5144
|
-
|
|
5145
|
-
|
|
5146
|
-
|
|
5188
|
+
flexShrink: 0,
|
|
5189
|
+
marginTop: "26px",
|
|
5190
|
+
width: "20px",
|
|
5191
|
+
height: "20px",
|
|
5192
|
+
borderRadius: "50%",
|
|
5193
|
+
border: "1.5px solid var(--metakyc-primary, #10b981)",
|
|
5194
|
+
background: "transparent",
|
|
5195
|
+
color: "var(--metakyc-primary, #10b981)",
|
|
5196
|
+
fontSize: "11px",
|
|
5197
|
+
fontWeight: "bold",
|
|
5198
|
+
cursor: "pointer",
|
|
5199
|
+
display: "flex",
|
|
5200
|
+
alignItems: "center",
|
|
5201
|
+
justifyContent: "center",
|
|
5202
|
+
lineHeight: 1,
|
|
5203
|
+
transition: "background 0.15s, color 0.15s"
|
|
5204
|
+
},
|
|
5205
|
+
onMouseEnter: (o) => {
|
|
5206
|
+
o.currentTarget.style.background = "var(--metakyc-primary, #10b981)", o.currentTarget.style.color = "#fff";
|
|
5207
|
+
},
|
|
5208
|
+
onMouseLeave: (o) => {
|
|
5209
|
+
o.currentTarget.style.background = "transparent", o.currentTarget.style.color = "var(--metakyc-primary, #10b981)";
|
|
5147
5210
|
},
|
|
5148
|
-
children:
|
|
5211
|
+
children: "?"
|
|
5149
5212
|
}
|
|
5150
|
-
)
|
|
5151
|
-
|
|
5213
|
+
),
|
|
5214
|
+
typeof document < "u" && i ? Ve(i, document.body) : null
|
|
5215
|
+
] });
|
|
5152
5216
|
}, hn = ({
|
|
5153
5217
|
workflowKey: e,
|
|
5154
5218
|
externalRefId: t,
|
|
5155
5219
|
onSuccess: n,
|
|
5156
5220
|
onCancel: a
|
|
5157
5221
|
}) => {
|
|
5158
|
-
var
|
|
5159
|
-
const { config: i, baseInformationService: o, currentTheme: l } = ye(), { createApplicant: d, isLoading: u } = wr(), p = e || ((
|
|
5222
|
+
var Je, Xe, et, tt;
|
|
5223
|
+
const { config: i, baseInformationService: o, currentTheme: l } = ye(), { createApplicant: d, isLoading: u } = wr(), p = e || ((Je = i.applicantForm) == null ? void 0 : Je.workflowKey);
|
|
5160
5224
|
if (!p)
|
|
5161
5225
|
throw new Error(
|
|
5162
5226
|
"workflowKey is required. Provide it either as a prop to CreateApplicantForm or set it in config.applicantForm.workflowKey"
|
|
5163
5227
|
);
|
|
5164
|
-
const x = t || ((
|
|
5228
|
+
const x = t || ((Xe = i.applicantForm) == null ? void 0 : Xe.externalRefId) || "", N = ((et = i.applicantForm) == null ? void 0 : et.email) || "", m = Ee(
|
|
5165
5229
|
() => l != null && l.applicantFormPages && l.applicantFormPages.length > 0 ? l.applicantFormPages : null,
|
|
5166
5230
|
[l == null ? void 0 : l.applicantFormPages]
|
|
5167
5231
|
), y = Ee(() => {
|
|
5168
|
-
const c = new Set(
|
|
5232
|
+
const c = new Set(je), T = l == null ? void 0 : l.applicantFormRequiredFields;
|
|
5169
5233
|
if (T) for (const L of T) c.add(L);
|
|
5170
5234
|
if (m)
|
|
5171
5235
|
for (const L of m)
|
|
@@ -5175,16 +5239,16 @@ const Be = {
|
|
|
5175
5239
|
}, [l == null ? void 0 : l.applicantFormRequiredFields, m]), h = Ee(() => {
|
|
5176
5240
|
var L;
|
|
5177
5241
|
if (m) {
|
|
5178
|
-
const f = m.flatMap((
|
|
5179
|
-
for (const
|
|
5180
|
-
return Array.from(
|
|
5242
|
+
const f = m.flatMap((q) => q.fields).filter((q) => !q.isCustom && q.name).map((q) => q.name), v = new Set(f);
|
|
5243
|
+
for (const q of je) v.add(q);
|
|
5244
|
+
return Array.from(v);
|
|
5181
5245
|
}
|
|
5182
5246
|
let c;
|
|
5183
5247
|
(L = i.applicantForm) != null && L.visibleFields ? c = i.applicantForm.visibleFields : l != null && l.applicantFormVisibleFields && l.applicantFormVisibleFields.length > 0 ? c = l.applicantFormVisibleFields : c = Ot;
|
|
5184
5248
|
const T = new Set(c);
|
|
5185
|
-
for (const f of
|
|
5249
|
+
for (const f of je) T.add(f);
|
|
5186
5250
|
return Array.from(T);
|
|
5187
|
-
}, [(
|
|
5251
|
+
}, [(tt = i.applicantForm) == null ? void 0 : tt.visibleFields, l == null ? void 0 : l.applicantFormVisibleFields, m]), C = /* @__PURE__ */ new Set([
|
|
5188
5252
|
"country",
|
|
5189
5253
|
"nationality",
|
|
5190
5254
|
"taxCountry",
|
|
@@ -5196,15 +5260,15 @@ const Be = {
|
|
|
5196
5260
|
const c = /* @__PURE__ */ new Set();
|
|
5197
5261
|
if (m)
|
|
5198
5262
|
for (const f of m)
|
|
5199
|
-
for (const
|
|
5200
|
-
!
|
|
5263
|
+
for (const v of f.fields)
|
|
5264
|
+
!v.isCustom && v.name && C.has(v.name) && c.add(v.countriesType ?? ((T = Te[v.name]) == null ? void 0 : T.countriesType));
|
|
5201
5265
|
else
|
|
5202
5266
|
for (const f of h)
|
|
5203
5267
|
C.has(f) && c.add((L = Te[f]) == null ? void 0 : L.countriesType);
|
|
5204
5268
|
return c.size === 0 && c.add(void 0), Array.from(c);
|
|
5205
|
-
}, [h, m]), [
|
|
5269
|
+
}, [h, m]), [k, $] = b({}), [A, I] = b(!0), j = ee(!1), J = ee(/* @__PURE__ */ new Set());
|
|
5206
5270
|
ne(() => {
|
|
5207
|
-
if (
|
|
5271
|
+
if (j.current || F.length === 0) return;
|
|
5208
5272
|
const c = F.filter((L) => {
|
|
5209
5273
|
const f = L != null ? String(L) : "all";
|
|
5210
5274
|
return !J.current.has(f);
|
|
@@ -5213,26 +5277,26 @@ const Be = {
|
|
|
5213
5277
|
I(!1);
|
|
5214
5278
|
return;
|
|
5215
5279
|
}
|
|
5216
|
-
|
|
5280
|
+
j.current = !0, I(!0), (async () => {
|
|
5217
5281
|
try {
|
|
5218
5282
|
const L = await Promise.all(
|
|
5219
5283
|
c.map(async (f) => {
|
|
5220
|
-
const
|
|
5221
|
-
return J.current.add(
|
|
5284
|
+
const v = f != null ? String(f) : "all", q = await o.getCountries("", i.locale || "en", f), ae = /* @__PURE__ */ new Set(), ie = q.map((se) => ({ value: se.abbreviation3 || se.abbreviation, label: se.name })).filter((se) => !se.value || ae.has(se.value) ? !1 : (ae.add(se.value), !0));
|
|
5285
|
+
return J.current.add(v), [v, ie];
|
|
5222
5286
|
})
|
|
5223
5287
|
);
|
|
5224
5288
|
$((f) => ({ ...f, ...Object.fromEntries(L) }));
|
|
5225
5289
|
} catch (L) {
|
|
5226
5290
|
console.error("Failed to load countries:", L);
|
|
5227
5291
|
} finally {
|
|
5228
|
-
I(!1),
|
|
5292
|
+
I(!1), j.current = !1;
|
|
5229
5293
|
}
|
|
5230
5294
|
})();
|
|
5231
5295
|
}, [F]);
|
|
5232
5296
|
const E = (c, T) => {
|
|
5233
|
-
var
|
|
5234
|
-
const L = T ?? ((
|
|
5235
|
-
return
|
|
5297
|
+
var v;
|
|
5298
|
+
const L = T ?? ((v = Te[c]) == null ? void 0 : v.countriesType), f = L != null ? String(L) : "all";
|
|
5299
|
+
return k[f] || [];
|
|
5236
5300
|
}, [g, R] = b({
|
|
5237
5301
|
workflowKey: p,
|
|
5238
5302
|
firstName: "",
|
|
@@ -5258,21 +5322,21 @@ const Be = {
|
|
|
5258
5322
|
educationLevel: "",
|
|
5259
5323
|
occupation: "",
|
|
5260
5324
|
taxNumber: ""
|
|
5261
|
-
}), [P, z] = b({}), [_, O] = b(0), [M, Z] = b({}), [
|
|
5325
|
+
}), [P, z] = b({}), [_, O] = b(0), [M, Z] = b({}), [w, U] = b(null), [te, B] = b(!1), D = (c, T) => R((L) => ({ ...L, [c]: T })), S = (c, T) => z((L) => ({ ...L, [c]: T })), H = (c) => !c.conditionalOn || P[c.conditionalOn] === "true", X = m && _ < m.length - 1 ? _ + 1 : -1, Y = m && _ > 0 ? _ - 1 : -1, we = (c) => {
|
|
5262
5326
|
var L;
|
|
5263
5327
|
const T = {};
|
|
5264
5328
|
for (const f of c.fields)
|
|
5265
5329
|
if (f.isCustom) {
|
|
5266
5330
|
if (f.customType === "paragraph" || f.customType === "br" || f.customType === "link") continue;
|
|
5267
5331
|
if (f.required && f.paramName) {
|
|
5268
|
-
const
|
|
5269
|
-
f.customType === "checkbox" || f.customType === "link_checkbox" ?
|
|
5332
|
+
const v = P[f.paramName], q = f.displayText || f.label || f.paramName;
|
|
5333
|
+
f.customType === "checkbox" || f.customType === "link_checkbox" ? v !== "true" && (T[f.paramName] = `${q} is required.`) : (!v || v.trim() === "") && (T[f.paramName] = `${q} is required.`);
|
|
5270
5334
|
}
|
|
5271
5335
|
} else if (f.name) {
|
|
5272
|
-
const
|
|
5273
|
-
if (y.includes(
|
|
5274
|
-
const
|
|
5275
|
-
T[
|
|
5336
|
+
const v = f.name;
|
|
5337
|
+
if (y.includes(v) && Be(g[v])) {
|
|
5338
|
+
const q = f.displayText || ((L = Te[v]) == null ? void 0 : L.label) || v;
|
|
5339
|
+
T[v] = `${q} is required.`;
|
|
5276
5340
|
}
|
|
5277
5341
|
}
|
|
5278
5342
|
return T;
|
|
@@ -5312,26 +5376,31 @@ const Be = {
|
|
|
5312
5376
|
if (m) {
|
|
5313
5377
|
for (const f of m)
|
|
5314
5378
|
if (H(f)) {
|
|
5315
|
-
for (const
|
|
5316
|
-
if (!
|
|
5317
|
-
const
|
|
5318
|
-
|
|
5379
|
+
for (const v of f.fields)
|
|
5380
|
+
if (!v.isCustom && v.name) {
|
|
5381
|
+
const q = v.name, ae = g[q];
|
|
5382
|
+
Be(ae) || (c[q] = ae);
|
|
5319
5383
|
}
|
|
5320
5384
|
}
|
|
5385
|
+
for (const f of je)
|
|
5386
|
+
if (c[f] === void 0) {
|
|
5387
|
+
const v = g[f];
|
|
5388
|
+
Be(v) || (c[f] = v);
|
|
5389
|
+
}
|
|
5321
5390
|
} else
|
|
5322
5391
|
h.forEach((f) => {
|
|
5323
5392
|
if (f === "externalRefId") return;
|
|
5324
|
-
const
|
|
5325
|
-
|
|
5393
|
+
const v = g[f];
|
|
5394
|
+
Be(v) || (c[f] = v);
|
|
5326
5395
|
});
|
|
5327
5396
|
const T = [];
|
|
5328
5397
|
if (m) {
|
|
5329
5398
|
for (const f of m)
|
|
5330
5399
|
if (H(f)) {
|
|
5331
|
-
for (const
|
|
5332
|
-
if (
|
|
5333
|
-
const
|
|
5334
|
-
T.push({ paramName:
|
|
5400
|
+
for (const v of f.fields)
|
|
5401
|
+
if (v.isCustom && v.paramName && v.customType !== "paragraph" && v.customType !== "br" && v.customType !== "link") {
|
|
5402
|
+
const q = P[v.paramName] ?? "";
|
|
5403
|
+
T.push({ paramName: v.paramName, paramValue: q });
|
|
5335
5404
|
}
|
|
5336
5405
|
}
|
|
5337
5406
|
}
|
|
@@ -5347,23 +5416,23 @@ const Be = {
|
|
|
5347
5416
|
var T;
|
|
5348
5417
|
c.preventDefault();
|
|
5349
5418
|
for (const L of y)
|
|
5350
|
-
if (
|
|
5419
|
+
if (Be(g[L])) {
|
|
5351
5420
|
const f = ((T = Te[L]) == null ? void 0 : T.label) || L;
|
|
5352
5421
|
U(`${f} is required.`);
|
|
5353
5422
|
return;
|
|
5354
5423
|
}
|
|
5355
5424
|
await Ce();
|
|
5356
|
-
},
|
|
5357
|
-
var
|
|
5358
|
-
const
|
|
5359
|
-
if (!
|
|
5360
|
-
const
|
|
5361
|
-
switch (
|
|
5425
|
+
}, Ze = (c, T, L, f) => {
|
|
5426
|
+
var rt;
|
|
5427
|
+
const v = Te[c];
|
|
5428
|
+
if (!v) return null;
|
|
5429
|
+
const q = y.includes(c), ae = M[c], ie = L || v.label, se = T ?? c, ke = { required: q };
|
|
5430
|
+
switch (v.type) {
|
|
5362
5431
|
case "select":
|
|
5363
5432
|
if (c === "country" || c === "nationality" || c === "taxCountry" || c === "countryOfBirth" || c === "mobileCountryCode") {
|
|
5364
5433
|
const le = E(c, f);
|
|
5365
5434
|
return /* @__PURE__ */ r(
|
|
5366
|
-
|
|
5435
|
+
We,
|
|
5367
5436
|
{
|
|
5368
5437
|
...ke,
|
|
5369
5438
|
label: ie,
|
|
@@ -5378,26 +5447,26 @@ const Be = {
|
|
|
5378
5447
|
}
|
|
5379
5448
|
if (c === "salutation")
|
|
5380
5449
|
return /* @__PURE__ */ r(
|
|
5381
|
-
|
|
5450
|
+
We,
|
|
5382
5451
|
{
|
|
5383
5452
|
...ke,
|
|
5384
5453
|
label: ie,
|
|
5385
|
-
value: ((
|
|
5454
|
+
value: ((rt = g[c]) == null ? void 0 : rt.toString()) || "",
|
|
5386
5455
|
onChange: (le) => D(c, le ? Number(le) : null),
|
|
5387
5456
|
options: [
|
|
5388
5457
|
{ value: "", label: "Select salutation..." },
|
|
5389
|
-
{ value:
|
|
5390
|
-
{ value:
|
|
5391
|
-
{ value:
|
|
5458
|
+
{ value: Ke.Male.toString(), label: "Male" },
|
|
5459
|
+
{ value: Ke.Female.toString(), label: "Female" },
|
|
5460
|
+
{ value: Ke.Other.toString(), label: "Other" }
|
|
5392
5461
|
],
|
|
5393
5462
|
error: ae
|
|
5394
5463
|
},
|
|
5395
5464
|
se
|
|
5396
5465
|
);
|
|
5397
5466
|
if (c === "defaultLanguage") {
|
|
5398
|
-
const le = l != null && l.allowedLanguages && l.allowedLanguages.length > 0 ?
|
|
5467
|
+
const le = l != null && l.allowedLanguages && l.allowedLanguages.length > 0 ? at.filter((Re) => l.allowedLanguages.includes(Re.value)) : at;
|
|
5399
5468
|
return /* @__PURE__ */ r(
|
|
5400
|
-
|
|
5469
|
+
We,
|
|
5401
5470
|
{
|
|
5402
5471
|
...ke,
|
|
5403
5472
|
label: ie,
|
|
@@ -5483,7 +5552,7 @@ const Be = {
|
|
|
5483
5552
|
}
|
|
5484
5553
|
}, ft = (c, T) => {
|
|
5485
5554
|
if (c.customType === "paragraph") {
|
|
5486
|
-
const
|
|
5555
|
+
const v = c.displayText || c.label || "";
|
|
5487
5556
|
return /* @__PURE__ */ r(
|
|
5488
5557
|
"p",
|
|
5489
5558
|
{
|
|
@@ -5494,7 +5563,7 @@ const Be = {
|
|
|
5494
5563
|
margin: 0,
|
|
5495
5564
|
color: "var(--metakyc-text-secondary, #6b7280)"
|
|
5496
5565
|
},
|
|
5497
|
-
dangerouslySetInnerHTML: { __html:
|
|
5566
|
+
dangerouslySetInnerHTML: { __html: v }
|
|
5498
5567
|
},
|
|
5499
5568
|
`custom-${T}`
|
|
5500
5569
|
);
|
|
@@ -5502,7 +5571,7 @@ const Be = {
|
|
|
5502
5571
|
if (c.customType === "br")
|
|
5503
5572
|
return /* @__PURE__ */ r("div", { style: { height: "12px" } }, `custom-${T}`);
|
|
5504
5573
|
if (c.customType === "link") {
|
|
5505
|
-
const
|
|
5574
|
+
const v = c.displayText || c.label || c.linkText || c.linkUrl || "";
|
|
5506
5575
|
return /* @__PURE__ */ r("div", { className: "metakyc-link-field", children: /* @__PURE__ */ s(
|
|
5507
5576
|
"a",
|
|
5508
5577
|
{
|
|
@@ -5519,7 +5588,7 @@ const Be = {
|
|
|
5519
5588
|
cursor: "pointer"
|
|
5520
5589
|
},
|
|
5521
5590
|
children: [
|
|
5522
|
-
|
|
5591
|
+
v,
|
|
5523
5592
|
/* @__PURE__ */ r("span", { style: { fontSize: "10px", opacity: 0.7 }, children: "↗" })
|
|
5524
5593
|
]
|
|
5525
5594
|
}
|
|
@@ -5540,9 +5609,9 @@ const Be = {
|
|
|
5540
5609
|
{
|
|
5541
5610
|
type: "checkbox",
|
|
5542
5611
|
checked: P[c.paramName] === "true",
|
|
5543
|
-
onChange: (
|
|
5612
|
+
onChange: (v) => S(c.paramName, v.target.checked ? "true" : "false"),
|
|
5544
5613
|
className: "metakyc-option-input",
|
|
5545
|
-
style:
|
|
5614
|
+
style: _e
|
|
5546
5615
|
}
|
|
5547
5616
|
),
|
|
5548
5617
|
/* @__PURE__ */ s(
|
|
@@ -5574,9 +5643,9 @@ const Be = {
|
|
|
5574
5643
|
{
|
|
5575
5644
|
type: "checkbox",
|
|
5576
5645
|
checked: P[c.paramName] === "true",
|
|
5577
|
-
onChange: (
|
|
5646
|
+
onChange: (v) => S(c.paramName, v.target.checked ? "true" : "false"),
|
|
5578
5647
|
className: "metakyc-option-input",
|
|
5579
|
-
style: { ...
|
|
5648
|
+
style: { ..._e, alignSelf: "flex-start", marginTop: "2px" }
|
|
5580
5649
|
}
|
|
5581
5650
|
),
|
|
5582
5651
|
/* @__PURE__ */ s(
|
|
@@ -5595,7 +5664,7 @@ const Be = {
|
|
|
5595
5664
|
rel: "noopener noreferrer",
|
|
5596
5665
|
className: "underline",
|
|
5597
5666
|
style: { color: "var(--metakyc-primary, #2563eb)" },
|
|
5598
|
-
onClick: (
|
|
5667
|
+
onClick: (v) => v.stopPropagation(),
|
|
5599
5668
|
children: c.linkText || c.linkUrl
|
|
5600
5669
|
}
|
|
5601
5670
|
),
|
|
@@ -5609,7 +5678,7 @@ const Be = {
|
|
|
5609
5678
|
L && /* @__PURE__ */ r("p", { className: "text-red-500 text-xs mt-0.5", children: L })
|
|
5610
5679
|
] }, `custom-${T}`);
|
|
5611
5680
|
if (c.customType === "group_checkbox") {
|
|
5612
|
-
const
|
|
5681
|
+
const v = (P[c.paramName] || "").split(",").filter(Boolean);
|
|
5613
5682
|
return /* @__PURE__ */ s("div", { className: "flex flex-col gap-1.5", children: [
|
|
5614
5683
|
/* @__PURE__ */ s(
|
|
5615
5684
|
"div",
|
|
@@ -5622,8 +5691,8 @@ const Be = {
|
|
|
5622
5691
|
]
|
|
5623
5692
|
}
|
|
5624
5693
|
),
|
|
5625
|
-
/* @__PURE__ */ r("div", { className: "metakyc-options-group", style: { display: "flex", flexDirection: "column", gap: "8px" }, children: (c.options || []).map((
|
|
5626
|
-
const ae = c.singleSelect ? P[c.paramName] ===
|
|
5694
|
+
/* @__PURE__ */ r("div", { className: "metakyc-options-group", style: { display: "flex", flexDirection: "column", gap: "8px" }, children: (c.options || []).map((q) => {
|
|
5695
|
+
const ae = c.singleSelect ? P[c.paramName] === q.value : v.includes(q.value);
|
|
5627
5696
|
return /* @__PURE__ */ s(
|
|
5628
5697
|
"label",
|
|
5629
5698
|
{
|
|
@@ -5637,14 +5706,14 @@ const Be = {
|
|
|
5637
5706
|
checked: ae,
|
|
5638
5707
|
onChange: (ie) => {
|
|
5639
5708
|
if (c.singleSelect)
|
|
5640
|
-
S(c.paramName, ie.target.checked ?
|
|
5709
|
+
S(c.paramName, ie.target.checked ? q.value : "");
|
|
5641
5710
|
else {
|
|
5642
|
-
const se = ie.target.checked ? [...
|
|
5711
|
+
const se = ie.target.checked ? [...v, q.value] : v.filter((ke) => ke !== q.value);
|
|
5643
5712
|
S(c.paramName, se.join(","));
|
|
5644
5713
|
}
|
|
5645
5714
|
},
|
|
5646
5715
|
className: "metakyc-option-input",
|
|
5647
|
-
style:
|
|
5716
|
+
style: _e
|
|
5648
5717
|
}
|
|
5649
5718
|
),
|
|
5650
5719
|
/* @__PURE__ */ r(
|
|
@@ -5652,12 +5721,12 @@ const Be = {
|
|
|
5652
5721
|
{
|
|
5653
5722
|
className: "metakyc-option-text",
|
|
5654
5723
|
style: { fontSize: "14px", color: "var(--metakyc-text-primary, #111827)", lineHeight: "1.4" },
|
|
5655
|
-
children:
|
|
5724
|
+
children: q.label
|
|
5656
5725
|
}
|
|
5657
5726
|
)
|
|
5658
5727
|
]
|
|
5659
5728
|
},
|
|
5660
|
-
|
|
5729
|
+
q.value
|
|
5661
5730
|
);
|
|
5662
5731
|
}) }),
|
|
5663
5732
|
L && /* @__PURE__ */ r("p", { className: "text-red-500 text-xs", children: L })
|
|
@@ -5675,7 +5744,7 @@ const Be = {
|
|
|
5675
5744
|
]
|
|
5676
5745
|
}
|
|
5677
5746
|
),
|
|
5678
|
-
/* @__PURE__ */ r("div", { className: "metakyc-options-group", style: { display: "flex", flexDirection: "column", gap: "8px" }, children: (c.options || []).map((
|
|
5747
|
+
/* @__PURE__ */ r("div", { className: "metakyc-options-group", style: { display: "flex", flexDirection: "column", gap: "8px" }, children: (c.options || []).map((v) => /* @__PURE__ */ s(
|
|
5679
5748
|
"label",
|
|
5680
5749
|
{
|
|
5681
5750
|
className: "metakyc-option-label",
|
|
@@ -5685,11 +5754,11 @@ const Be = {
|
|
|
5685
5754
|
"input",
|
|
5686
5755
|
{
|
|
5687
5756
|
type: "radio",
|
|
5688
|
-
checked: P[c.paramName] ===
|
|
5689
|
-
onChange: () => S(c.paramName,
|
|
5757
|
+
checked: P[c.paramName] === v.value,
|
|
5758
|
+
onChange: () => S(c.paramName, v.value),
|
|
5690
5759
|
name: `radio-group-${c.paramName}-${T}`,
|
|
5691
5760
|
className: "metakyc-option-input",
|
|
5692
|
-
style:
|
|
5761
|
+
style: _e
|
|
5693
5762
|
}
|
|
5694
5763
|
),
|
|
5695
5764
|
/* @__PURE__ */ r(
|
|
@@ -5697,12 +5766,12 @@ const Be = {
|
|
|
5697
5766
|
{
|
|
5698
5767
|
className: "metakyc-option-text",
|
|
5699
5768
|
style: { fontSize: "14px", color: "var(--metakyc-text-primary, #111827)", lineHeight: "1.4" },
|
|
5700
|
-
children:
|
|
5769
|
+
children: v.label
|
|
5701
5770
|
}
|
|
5702
5771
|
)
|
|
5703
5772
|
]
|
|
5704
5773
|
},
|
|
5705
|
-
|
|
5774
|
+
v.value
|
|
5706
5775
|
)) }),
|
|
5707
5776
|
L && /* @__PURE__ */ r("p", { className: "text-red-500 text-xs", children: L })
|
|
5708
5777
|
] }, `custom-${T}`) : /* @__PURE__ */ r(
|
|
@@ -5711,7 +5780,7 @@ const Be = {
|
|
|
5711
5780
|
type: "text",
|
|
5712
5781
|
label: `${f}${c.required ? " *" : ""}`,
|
|
5713
5782
|
value: P[c.paramName] || "",
|
|
5714
|
-
onChange: (
|
|
5783
|
+
onChange: (v) => S(c.paramName, v.target.value),
|
|
5715
5784
|
required: c.required,
|
|
5716
5785
|
error: L
|
|
5717
5786
|
},
|
|
@@ -5733,7 +5802,7 @@ const Be = {
|
|
|
5733
5802
|
checked: L,
|
|
5734
5803
|
onChange: (f) => S(c.conditionalOn, f.target.checked ? "true" : "false"),
|
|
5735
5804
|
className: "metakyc-option-input",
|
|
5736
|
-
style:
|
|
5805
|
+
style: _e
|
|
5737
5806
|
}
|
|
5738
5807
|
),
|
|
5739
5808
|
/* @__PURE__ */ r(
|
|
@@ -5747,9 +5816,9 @@ const Be = {
|
|
|
5747
5816
|
]
|
|
5748
5817
|
}
|
|
5749
5818
|
),
|
|
5750
|
-
L && /* @__PURE__ */ r("div", { className: "grid grid-cols-4 gap-4", children: c.fields.map((f,
|
|
5751
|
-
const
|
|
5752
|
-
return /* @__PURE__ */ r("div", { className:
|
|
5819
|
+
L && /* @__PURE__ */ r("div", { className: "grid grid-cols-4 gap-4", children: c.fields.map((f, v) => {
|
|
5820
|
+
const q = f.colSpan === 1 ? "col-span-1" : f.colSpan === 2 ? "col-span-2" : f.colSpan === 3 ? "col-span-3" : "col-span-4", ae = f.isCustom ? `custom-${v}-${f.paramName}` : `builtin-${f.name}-${v}`;
|
|
5821
|
+
return /* @__PURE__ */ r("div", { className: q, children: /* @__PURE__ */ r(Qr, { helpText: f.helpText, children: f.isCustom ? ft(f, v) : Ze(f.name, ae, f.displayText, f.countriesType) }) }, ae);
|
|
5753
5822
|
}) })
|
|
5754
5823
|
] });
|
|
5755
5824
|
};
|
|
@@ -5759,7 +5828,7 @@ const Be = {
|
|
|
5759
5828
|
/* @__PURE__ */ r("p", { className: "text-center text-gray-600 dark:text-gray-400 mt-4", children: "Loading form..." })
|
|
5760
5829
|
] }) }) });
|
|
5761
5830
|
if (m) {
|
|
5762
|
-
const c = m[_] ?? m[0], T = Y === -1, L = X === -1, f = m.length,
|
|
5831
|
+
const c = m[_] ?? m[0], T = Y === -1, L = X === -1, f = m.length, v = H(c), q = Object.values(M);
|
|
5763
5832
|
return /* @__PURE__ */ r("div", { className: "metakyc-sdk", children: /* @__PURE__ */ s(K, { children: [
|
|
5764
5833
|
/* @__PURE__ */ r(de, { children: /* @__PURE__ */ r(Ge, { title: (l == null ? void 0 : l.title) || "Create Applicant" }) }),
|
|
5765
5834
|
/* @__PURE__ */ s(W, { children: [
|
|
@@ -5789,13 +5858,13 @@ const Be = {
|
|
|
5789
5858
|
}
|
|
5790
5859
|
)
|
|
5791
5860
|
] }),
|
|
5792
|
-
(
|
|
5793
|
-
|
|
5861
|
+
(w || q.length > 0) && /* @__PURE__ */ s("div", { className: "mb-4 p-3 bg-red-50 border border-red-200 rounded-lg", children: [
|
|
5862
|
+
w && /* @__PURE__ */ s("p", { className: "text-red-600 text-sm", children: [
|
|
5794
5863
|
/* @__PURE__ */ r("strong", { children: "Error:" }),
|
|
5795
5864
|
" ",
|
|
5796
|
-
|
|
5865
|
+
w
|
|
5797
5866
|
] }),
|
|
5798
|
-
|
|
5867
|
+
q.map((ae, ie) => /* @__PURE__ */ r("p", { className: "text-red-600 text-sm", children: ae }, ie))
|
|
5799
5868
|
] }),
|
|
5800
5869
|
f > 1 && /* @__PURE__ */ s("div", { className: "flex items-center gap-2 mb-4", children: [
|
|
5801
5870
|
m.map((ae, ie) => /* @__PURE__ */ r(
|
|
@@ -5836,7 +5905,7 @@ const Be = {
|
|
|
5836
5905
|
type: "button",
|
|
5837
5906
|
isLoading: te || u,
|
|
5838
5907
|
onClick: L ? Ce : ve,
|
|
5839
|
-
children: L ? c.conditionalOn && !
|
|
5908
|
+
children: L ? c.conditionalOn && !v ? "Skip & Submit" : "Submit" : c.conditionalOn && !v ? "Skip" : "Next"
|
|
5840
5909
|
}
|
|
5841
5910
|
)
|
|
5842
5911
|
] })
|
|
@@ -5845,12 +5914,12 @@ const Be = {
|
|
|
5845
5914
|
return /* @__PURE__ */ r("div", { className: "metakyc-sdk", children: /* @__PURE__ */ r("form", { onSubmit: yt, children: /* @__PURE__ */ s(K, { children: [
|
|
5846
5915
|
/* @__PURE__ */ r(de, { children: /* @__PURE__ */ r(Ge, { title: (l == null ? void 0 : l.title) || "Create Applicant" }) }),
|
|
5847
5916
|
/* @__PURE__ */ s(W, { children: [
|
|
5848
|
-
|
|
5917
|
+
w && /* @__PURE__ */ r("div", { className: "mb-6 p-4 bg-red-50 border border-red-200 rounded-lg", children: /* @__PURE__ */ s("p", { className: "text-red-600 text-sm", children: [
|
|
5849
5918
|
/* @__PURE__ */ r("strong", { children: "Error:" }),
|
|
5850
5919
|
" ",
|
|
5851
|
-
|
|
5920
|
+
w
|
|
5852
5921
|
] }) }),
|
|
5853
|
-
/* @__PURE__ */ r("div", { className: "grid grid-cols-4 gap-4", children: h.map((c) => /* @__PURE__ */ r("div", { className: "col-span-4", children:
|
|
5922
|
+
/* @__PURE__ */ r("div", { className: "grid grid-cols-4 gap-4", children: h.map((c) => /* @__PURE__ */ r("div", { className: "col-span-4", children: Ze(c) }, c)) })
|
|
5854
5923
|
] }),
|
|
5855
5924
|
/* @__PURE__ */ s(pe, { className: "flex justify-between", children: [
|
|
5856
5925
|
a && /* @__PURE__ */ r(V, { type: "button", variant: "outline", onClick: a, disabled: te || u, children: "Cancel" }),
|
|
@@ -5924,7 +5993,7 @@ const Be = {
|
|
|
5924
5993
|
] }) }) }) });
|
|
5925
5994
|
if (o.status === xe.Finished || o.status === xe.OnHold)
|
|
5926
5995
|
return /* @__PURE__ */ r("div", { className: `metakyc-sdk ${i || ""}`, children: /* @__PURE__ */ r(
|
|
5927
|
-
|
|
5996
|
+
lt,
|
|
5928
5997
|
{
|
|
5929
5998
|
kycStatus: o.kycStatus,
|
|
5930
5999
|
reviewStatus: o.reviewStatus,
|
|
@@ -5941,7 +6010,7 @@ const Be = {
|
|
|
5941
6010
|
/* @__PURE__ */ r(be, { className: "my-8" }),
|
|
5942
6011
|
/* @__PURE__ */ r("p", { className: "text-center text-gray-600 dark:text-gray-400 mt-4", children: o.status === xe.IdentityPending ? "Loading identity verification..." : "Loading current step..." })
|
|
5943
6012
|
] }) }) });
|
|
5944
|
-
const
|
|
6013
|
+
const k = (I) => {
|
|
5945
6014
|
switch (I) {
|
|
5946
6015
|
case G.Overview:
|
|
5947
6016
|
return "Overview";
|
|
@@ -5965,7 +6034,7 @@ const Be = {
|
|
|
5965
6034
|
return "";
|
|
5966
6035
|
}
|
|
5967
6036
|
}, $ = () => {
|
|
5968
|
-
const I = d.filter((g) => g.visibility !== !1),
|
|
6037
|
+
const I = d.filter((g) => g.visibility !== !1), j = I.findIndex((g) => g.order === l.order), J = j >= 0 ? j + 1 : 1, E = I.length;
|
|
5969
6038
|
return /* @__PURE__ */ s("div", { className: "mb-6", children: [
|
|
5970
6039
|
/* @__PURE__ */ s("div", { className: "flex items-start justify-between mb-4", children: [
|
|
5971
6040
|
/* @__PURE__ */ r(Ge, {}),
|
|
@@ -5977,7 +6046,7 @@ const Be = {
|
|
|
5977
6046
|
] })
|
|
5978
6047
|
] }),
|
|
5979
6048
|
/* @__PURE__ */ r("div", { className: "flex items-center", children: I.map((g, R) => {
|
|
5980
|
-
const P = R <
|
|
6049
|
+
const P = R < j, z = g.order === l.order;
|
|
5981
6050
|
return /* @__PURE__ */ s(ge.Fragment, { children: [
|
|
5982
6051
|
/* @__PURE__ */ s("div", { className: "flex items-center", children: [
|
|
5983
6052
|
/* @__PURE__ */ r(
|
|
@@ -5994,7 +6063,7 @@ const Be = {
|
|
|
5994
6063
|
"span",
|
|
5995
6064
|
{
|
|
5996
6065
|
className: `ml-2 text-sm ${z ? "font-semibold text-gray-900 dark:text-white" : "text-gray-600 dark:text-gray-400"}`,
|
|
5997
|
-
children: g.displayName || g.name ||
|
|
6066
|
+
children: g.displayName || g.name || k(g.action) || `Step ${R + 1}`
|
|
5998
6067
|
}
|
|
5999
6068
|
)
|
|
6000
6069
|
] }),
|
|
@@ -6028,12 +6097,12 @@ const Be = {
|
|
|
6028
6097
|
return /* @__PURE__ */ r(Ur, { ...I });
|
|
6029
6098
|
case G.AdditionalData:
|
|
6030
6099
|
case G.InvestorCategorization:
|
|
6031
|
-
return /* @__PURE__ */ r(
|
|
6100
|
+
return /* @__PURE__ */ r(qr, { ...I });
|
|
6032
6101
|
case G.AppropriatenessTest:
|
|
6033
6102
|
return /* @__PURE__ */ r(Kr, { ...I });
|
|
6034
6103
|
case G.ManualReview:
|
|
6035
6104
|
return /* @__PURE__ */ r(
|
|
6036
|
-
|
|
6105
|
+
lt,
|
|
6037
6106
|
{
|
|
6038
6107
|
kycStatus: o.kycStatus,
|
|
6039
6108
|
reviewStatus: o.reviewStatus,
|
|
@@ -6109,13 +6178,13 @@ function bn(e) {
|
|
|
6109
6178
|
}
|
|
6110
6179
|
const vn = Se.any();
|
|
6111
6180
|
export {
|
|
6112
|
-
|
|
6181
|
+
at as ALLOWED_LANGUAGES,
|
|
6113
6182
|
Ct as ApplicantProgressOnHoldReason,
|
|
6114
6183
|
xe as ApplicantProgressStatus,
|
|
6115
6184
|
_t as ApplicantService,
|
|
6116
6185
|
Et as ApplicantStatus,
|
|
6117
6186
|
Ft as AppropriatenessQuestionType,
|
|
6118
|
-
|
|
6187
|
+
jt as AppropriatenessTestService,
|
|
6119
6188
|
Kr as AppropriatenessTestStep,
|
|
6120
6189
|
Ae as Badge,
|
|
6121
6190
|
Yt as BaseInformationService,
|
|
@@ -6135,7 +6204,7 @@ export {
|
|
|
6135
6204
|
Te as FIELD_METADATA,
|
|
6136
6205
|
Pt as FileType,
|
|
6137
6206
|
Sr as FileUpload,
|
|
6138
|
-
|
|
6207
|
+
Ke as GenderType,
|
|
6139
6208
|
Ge as Header,
|
|
6140
6209
|
Bt as HttpClient,
|
|
6141
6210
|
Me as IdentityProviderManager,
|
|
@@ -6144,12 +6213,12 @@ export {
|
|
|
6144
6213
|
Wr as IdentityVerificationStep,
|
|
6145
6214
|
me as Input,
|
|
6146
6215
|
Qt as InvestorCategorizationService,
|
|
6147
|
-
|
|
6216
|
+
qr as InvestorCategorizationStep,
|
|
6148
6217
|
he as InvestorCategorizationType,
|
|
6149
6218
|
Mt as InvestorCategoryType,
|
|
6150
6219
|
It as KycProcessStatus,
|
|
6151
6220
|
De as KycStatus,
|
|
6152
|
-
|
|
6221
|
+
lt as KycStatusDisplay,
|
|
6153
6222
|
gn as KycWorkflow,
|
|
6154
6223
|
Yr as Logo,
|
|
6155
6224
|
ut as MetaKYCContext,
|
|
@@ -6157,7 +6226,7 @@ export {
|
|
|
6157
6226
|
on as MetaKYCProvider,
|
|
6158
6227
|
Nr as MultiSelect,
|
|
6159
6228
|
or as OnfidoProvider,
|
|
6160
|
-
|
|
6229
|
+
qt as OverviewService,
|
|
6161
6230
|
$r as OverviewStep,
|
|
6162
6231
|
Cr as PhoneInput,
|
|
6163
6232
|
Ht as QuestionnaireService,
|
|
@@ -6168,8 +6237,8 @@ export {
|
|
|
6168
6237
|
Kt as RiskScoringService,
|
|
6169
6238
|
Ur as RiskScoringStep,
|
|
6170
6239
|
lr as SardinAIProvider,
|
|
6171
|
-
|
|
6172
|
-
|
|
6240
|
+
We as SearchableSelect,
|
|
6241
|
+
He as Select,
|
|
6173
6242
|
be as Spinner,
|
|
6174
6243
|
ar as StepRouter,
|
|
6175
6244
|
sr as SumsubProvider,
|
|
@@ -6194,7 +6263,7 @@ export {
|
|
|
6194
6263
|
ue as defaultTheme,
|
|
6195
6264
|
dr as fileToBase64,
|
|
6196
6265
|
Vt as fintechTheme,
|
|
6197
|
-
|
|
6266
|
+
Ye as formatFileSize,
|
|
6198
6267
|
bn as generateAppropriatenessSchema,
|
|
6199
6268
|
yn as generateQuestionnaireSchema,
|
|
6200
6269
|
xn as generateRiskScoringSchema,
|