@vpdev2/metakyc-sdk 1.0.103 → 1.0.104

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/index.js CHANGED
@@ -3,19 +3,19 @@ var Ut = (e, t, n) => t in e ? Wt(e, t, { enumerable: !0, configurable: !0, writ
3
3
  var ye = (e, t, n) => Ut(e, typeof t != "symbol" ? t + "" : t, n);
4
4
  import Kt from "axios";
5
5
  import * as Nt from "react";
6
- import Se, { createContext as qt, useState as v, useMemo as Le, useEffect as he, useContext as Vt, useRef as le, useCallback as re, forwardRef as mt, createElement as kt } from "react";
6
+ import we, { createContext as qt, useState as k, useMemo as Le, useEffect as ge, useContext as Vt, useRef as ce, useCallback as ne, forwardRef as mt, createElement as kt } from "react";
7
7
  import { jsx as r, jsxs as o, Fragment as ot } from "react/jsx-runtime";
8
8
  import Yt, { createPortal as wt } from "react-dom";
9
- import { useForm as Qt, Controller as Ze } from "react-hook-form";
9
+ import { useForm as Qt, Controller as Xe } from "react-hook-form";
10
10
  import { z as Ke } from "zod";
11
- var oe = /* @__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))(oe || {}), gt = /* @__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))(gt || {}), Oe = /* @__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))(Oe || {}), Gt = /* @__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))(Gt || {}), Jt = /* @__PURE__ */ ((e) => (e[e.LowRisk = 0] = "LowRisk", e[e.MediumRisk = 1] = "MediumRisk", e[e.HighRisk = 2] = "HighRisk", e[e.Alert = 3] = "Alert", e))(Jt || {}), Xe = /* @__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))(Xe || {}), et = /* @__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))(et || {}), Zt = /* @__PURE__ */ ((e) => (e[e.ProviderResultPending = 0] = "ProviderResultPending", e[e.ProviderResultReceived = 1] = "ProviderResultReceived", e[e.Canceled = 2] = "Canceled", e[e.ExtendedToNewApplicant = 3] = "ExtendedToNewApplicant", e))(Zt || {}), Xt = /* @__PURE__ */ ((e) => (e[e.None = 0] = "None", e[e.ProviderResultPending = 1] = "ProviderResultPending", e[e.ProviderResultReceived = 2] = "ProviderResultReceived", e[e.Canceled = 3] = "Canceled", e))(Xt || {}), Me = /* @__PURE__ */ ((e) => (e[e.Onfido = 0] = "Onfido", e[e.Sumsub = 2] = "Sumsub", e[e.SardinAI = 3] = "SardinAI", e))(Me || {}), er = /* @__PURE__ */ ((e) => (e[e.Individual = 0] = "Individual", e[e.Company = 1] = "Company", e))(er || {}), ft = /* @__PURE__ */ ((e) => (e[e.Male = 0] = "Male", e[e.Female = 1] = "Female", e[e.Other = 2] = "Other", e))(ft || {}), tr = /* @__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))(tr || {}), rr = /* @__PURE__ */ ((e) => (e[e.Pending = 0] = "Pending", e[e.Approved = 1] = "Approved", e[e.Rejected = 2] = "Rejected", e[e.RequiresRevision = 3] = "RequiresRevision", e))(rr || {}), nr = /* @__PURE__ */ ((e) => (e[e.SingleChoice = 0] = "SingleChoice", e[e.MultipleChoice = 1] = "MultipleChoice", e[e.Text = 2] = "Text", e))(nr || {}), We = /* @__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))(We || {}), ar = /* @__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))(ar || {}), ir = /* @__PURE__ */ ((e) => (e[e.None = 0] = "None", e[e.Country = 1] = "Country", e))(ir || {}), Re = /* @__PURE__ */ ((e) => (e[e.Individual = 0] = "Individual", e[e.Sophisticated = 1] = "Sophisticated", e[e.HighNetWorth = 2] = "HighNetWorth", e[e.Business = 3] = "Business", e))(Re || {}), sr = /* @__PURE__ */ ((e) => (e[e.Retail = 0] = "Retail", e[e.Professional = 1] = "Professional", e[e.EligibleCounterparty = 2] = "EligibleCounterparty", e))(sr || {});
11
+ var le = /* @__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))(le || {}), gt = /* @__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))(gt || {}), Oe = /* @__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))(Oe || {}), Gt = /* @__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))(Gt || {}), Jt = /* @__PURE__ */ ((e) => (e[e.LowRisk = 0] = "LowRisk", e[e.MediumRisk = 1] = "MediumRisk", e[e.HighRisk = 2] = "HighRisk", e[e.Alert = 3] = "Alert", e))(Jt || {}), et = /* @__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))(et || {}), tt = /* @__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))(tt || {}), Zt = /* @__PURE__ */ ((e) => (e[e.ProviderResultPending = 0] = "ProviderResultPending", e[e.ProviderResultReceived = 1] = "ProviderResultReceived", e[e.Canceled = 2] = "Canceled", e[e.ExtendedToNewApplicant = 3] = "ExtendedToNewApplicant", e))(Zt || {}), Xt = /* @__PURE__ */ ((e) => (e[e.None = 0] = "None", e[e.ProviderResultPending = 1] = "ProviderResultPending", e[e.ProviderResultReceived = 2] = "ProviderResultReceived", e[e.Canceled = 3] = "Canceled", e))(Xt || {}), Me = /* @__PURE__ */ ((e) => (e[e.Onfido = 0] = "Onfido", e[e.Sumsub = 2] = "Sumsub", e[e.SardinAI = 3] = "SardinAI", e))(Me || {}), er = /* @__PURE__ */ ((e) => (e[e.Individual = 0] = "Individual", e[e.Company = 1] = "Company", e))(er || {}), ft = /* @__PURE__ */ ((e) => (e[e.Male = 0] = "Male", e[e.Female = 1] = "Female", e[e.Other = 2] = "Other", e))(ft || {}), tr = /* @__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))(tr || {}), rr = /* @__PURE__ */ ((e) => (e[e.Pending = 0] = "Pending", e[e.Approved = 1] = "Approved", e[e.Rejected = 2] = "Rejected", e[e.RequiresRevision = 3] = "RequiresRevision", e))(rr || {}), nr = /* @__PURE__ */ ((e) => (e[e.SingleChoice = 0] = "SingleChoice", e[e.MultipleChoice = 1] = "MultipleChoice", e[e.Text = 2] = "Text", e))(nr || {}), We = /* @__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))(We || {}), ar = /* @__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))(ar || {}), ir = /* @__PURE__ */ ((e) => (e[e.None = 0] = "None", e[e.Country = 1] = "Country", e))(ir || {}), Ie = /* @__PURE__ */ ((e) => (e[e.Individual = 0] = "Individual", e[e.Sophisticated = 1] = "Sophisticated", e[e.HighNetWorth = 2] = "HighNetWorth", e[e.Business = 3] = "Business", e))(Ie || {}), sr = /* @__PURE__ */ ((e) => (e[e.Retail = 0] = "Retail", e[e.Professional = 1] = "Professional", e[e.EligibleCounterparty = 2] = "EligibleCounterparty", e))(sr || {});
12
12
  const Qe = {
13
13
  Nationality: 10,
14
14
  Address: 20,
15
15
  CountryOfBirth: 30,
16
16
  PhoneNumber: 40,
17
17
  UboAddress: 50
18
- }, tt = {
18
+ }, rt = {
19
19
  firstName: { label: "First Name", type: "text" },
20
20
  lastName: { label: "Last Name", type: "text" },
21
21
  email: { label: "Email", type: "email" },
@@ -69,7 +69,7 @@ const Qe = {
69
69
  "email",
70
70
  "phonenumber",
71
71
  "dateOfBirth"
72
- ], It = [
72
+ ], Rt = [
73
73
  { value: "EN", label: "English" },
74
74
  { value: "DE", label: "German" },
75
75
  { value: "FR", label: "French" },
@@ -909,7 +909,7 @@ const Te = {
909
909
  cardPadding: "1.25rem",
910
910
  inputHeight: "2.25rem"
911
911
  }
912
- }, Ir = {
912
+ }, Rr = {
913
913
  [Ee.Default]: Te,
914
914
  [Ee.Corporate]: kr,
915
915
  [Ee.Fintech]: wr,
@@ -918,9 +918,9 @@ const Te = {
918
918
  [Ee.Minimal]: Nr
919
919
  };
920
920
  function dt(e) {
921
- return Ir[e] || Te;
921
+ return Rr[e] || Te;
922
922
  }
923
- class Rr {
923
+ class Ir {
924
924
  constructor(t) {
925
925
  this.httpClient = t;
926
926
  }
@@ -1236,7 +1236,7 @@ class Ar {
1236
1236
  async loadStepData(t, n) {
1237
1237
  const a = this.getHandler(t);
1238
1238
  if (!a)
1239
- throw new Error(`No handler registered for step action: ${oe[t]}`);
1239
+ throw new Error(`No handler registered for step action: ${le[t]}`);
1240
1240
  return a.loadData(n);
1241
1241
  }
1242
1242
  /**
@@ -1245,7 +1245,7 @@ class Ar {
1245
1245
  async submitStepData(t, n) {
1246
1246
  const a = this.getHandler(t);
1247
1247
  if (!a)
1248
- throw new Error(`No handler registered for step action: ${oe[t]}`);
1248
+ throw new Error(`No handler registered for step action: ${le[t]}`);
1249
1249
  return a.submitData(n);
1250
1250
  }
1251
1251
  }
@@ -1259,47 +1259,47 @@ class Pr {
1259
1259
  * Register all step handlers
1260
1260
  */
1261
1261
  registerStepHandlers() {
1262
- this.stepRouter.registerHandler(oe.Questionaries, {
1262
+ this.stepRouter.registerHandler(le.Questionaries, {
1263
1263
  loadData: (t) => this.questionnaireService.getQuestionnaire(t),
1264
1264
  submitData: async (t) => {
1265
1265
  await this.questionnaireService.fillQuestionnaire(t);
1266
1266
  }
1267
- }), this.stepRouter.registerHandler(oe.UploadDocument, {
1267
+ }), this.stepRouter.registerHandler(le.UploadDocument, {
1268
1268
  loadData: (t) => this.uploadDocumentService.getUploadDocument(t),
1269
1269
  submitData: (t) => this.uploadDocumentService.fillUploadDocument(t)
1270
- }), this.stepRouter.registerHandler(oe.AppropriatenessTest, {
1270
+ }), this.stepRouter.registerHandler(le.AppropriatenessTest, {
1271
1271
  loadData: (t) => this.appropriatenessTestService.getAppropriatenessTest(t),
1272
1272
  submitData: async (t) => {
1273
1273
  await this.appropriatenessTestService.fillAppropriatenessTest(t);
1274
1274
  }
1275
- }), this.stepRouter.registerHandler(oe.Overview, {
1275
+ }), this.stepRouter.registerHandler(le.Overview, {
1276
1276
  loadData: (t) => this.overviewService.getOverviewData(t),
1277
1277
  submitData: (t) => this.overviewService.passOverview(t.applicantId)
1278
- }), this.stepRouter.registerHandler(oe.RiskScoring, {
1278
+ }), this.stepRouter.registerHandler(le.RiskScoring, {
1279
1279
  loadData: (t) => this.riskScoringService.getRiskCriterias(t),
1280
1280
  submitData: async (t) => {
1281
1281
  await this.riskScoringService.submitRiskScoring(t);
1282
1282
  }
1283
- }), this.stepRouter.registerHandler(oe.IdentitySdk, {
1283
+ }), this.stepRouter.registerHandler(le.IdentitySdk, {
1284
1284
  loadData: async (t) => ({
1285
1285
  applicantId: t,
1286
1286
  message: "Identity verification required"
1287
1287
  }),
1288
1288
  submitData: async () => {
1289
1289
  }
1290
- }), this.stepRouter.registerHandler(oe.InvestorCategorization, {
1290
+ }), this.stepRouter.registerHandler(le.InvestorCategorization, {
1291
1291
  loadData: (t) => this.investorCategorizationService.getInvestorCategorization(t),
1292
1292
  submitData: async (t) => {
1293
1293
  await this.investorCategorizationService.setInvestorCategorization(t);
1294
1294
  }
1295
- }), this.stepRouter.registerHandler(oe.ManualReview, {
1295
+ }), this.stepRouter.registerHandler(le.ManualReview, {
1296
1296
  loadData: async (t) => ({
1297
1297
  applicantId: t,
1298
1298
  message: "Your application is under manual review"
1299
1299
  }),
1300
1300
  submitData: async () => {
1301
1301
  }
1302
- }), this.stepRouter.registerHandler(oe.AdditionalData, {
1302
+ }), this.stepRouter.registerHandler(le.AdditionalData, {
1303
1303
  loadData: async (t) => ({
1304
1304
  applicantId: t,
1305
1305
  message: "Additional data required"
@@ -1612,10 +1612,10 @@ class Mr {
1612
1612
  console.log(`[SardinAI] Device ID: ${d.deviceId}`);
1613
1613
  },
1614
1614
  // New callback for session updates
1615
- onConfigUpdate: (d, m, u) => {
1615
+ onConfigUpdate: (d, m, p) => {
1616
1616
  switch (d) {
1617
1617
  case "SESSION_UPDATE_FAILED":
1618
- console.error("[SardinAI] Session update failed:", u);
1618
+ console.error("[SardinAI] Session update failed:", p);
1619
1619
  break;
1620
1620
  case "SESSION_UPDATED":
1621
1621
  console.log("[SardinAI] Session updated:", m);
@@ -1914,18 +1914,18 @@ class zr {
1914
1914
  }
1915
1915
  }
1916
1916
  const Mt = qt(null), Wn = ({ config: e, children: t }) => {
1917
- const [n, a] = v(null), s = Se.useRef(!1), l = Se.useRef(!1), c = Le(() => {
1918
- const m = new ur(e), u = new pr(m), h = new mr(m), D = new yr(m), x = new hr(m), P = new gr(m), T = new fr(m), S = new br(m), R = new xr(m), z = new vr(m), Q = new Rr(m), M = new zr();
1917
+ const [n, a] = k(null), s = we.useRef(!1), l = we.useRef(!1), c = Le(() => {
1918
+ const m = new ur(e), p = new pr(m), b = new mr(m), D = new yr(m), x = new hr(m), P = new gr(m), T = new fr(m), S = new br(m), I = new xr(m), z = new vr(m), Q = new Ir(m), M = new zr();
1919
1919
  return {
1920
1920
  httpClient: m,
1921
- applicantService: u,
1922
- questionnaireService: h,
1921
+ applicantService: p,
1922
+ questionnaireService: b,
1923
1923
  uploadDocumentService: D,
1924
1924
  appropriatenessTestService: x,
1925
1925
  overviewService: P,
1926
1926
  riskScoringService: T,
1927
1927
  identityService: S,
1928
- baseInformationService: R,
1928
+ baseInformationService: I,
1929
1929
  investorCategorizationService: z,
1930
1930
  themeService: Q,
1931
1931
  themeManager: M
@@ -1945,7 +1945,7 @@ const Mt = qt(null), Wn = ({ config: e, children: t }) => {
1945
1945
  c.investorCategorizationService
1946
1946
  )
1947
1947
  }), [e, c, n]);
1948
- return he(() => ((async () => {
1948
+ return ge(() => ((async () => {
1949
1949
  if (s.current || l.current) {
1950
1950
  console.log("[MetaKYC] Theme already loading or loaded, skipping...");
1951
1951
  return;
@@ -1957,10 +1957,10 @@ const Mt = qt(null), Wn = ({ config: e, children: t }) => {
1957
1957
  return;
1958
1958
  }
1959
1959
  console.log("[MetaKYC] Fetching theme from backend...");
1960
- const u = await c.themeService.getThemeConfiguration();
1961
- c.themeManager.applyTheme(u), a(c.themeManager.getCurrentTheme()), l.current = !0, console.log("[MetaKYC] Theme loaded and applied", u);
1962
- } catch (u) {
1963
- console.warn("[MetaKYC] Failed to load theme, using default:", u), a(c.themeManager.getCurrentTheme()), l.current = !0;
1960
+ const p = await c.themeService.getThemeConfiguration();
1961
+ c.themeManager.applyTheme(p), a(c.themeManager.getCurrentTheme()), l.current = !0, console.log("[MetaKYC] Theme loaded and applied", p);
1962
+ } catch (p) {
1963
+ console.warn("[MetaKYC] Failed to load theme, using default:", p), a(c.themeManager.getCurrentTheme()), l.current = !0;
1964
1964
  } finally {
1965
1965
  s.current = !1;
1966
1966
  }
@@ -2058,57 +2058,57 @@ function Yn() {
2058
2058
  jr(), Wr();
2059
2059
  }
2060
2060
  function Ur(e) {
2061
- const { createOrchestrator: t } = Ae(), [n, a] = v(null), [s, l] = v(!1), [c, d] = v(null), m = le(null), u = e || _r();
2062
- he(() => {
2061
+ const { createOrchestrator: t } = Ae(), [n, a] = k(null), [s, l] = k(!1), [c, d] = k(null), m = ce(null), p = e || _r();
2062
+ ge(() => {
2063
2063
  m.current || (m.current = t());
2064
- }, [t]), he(() => {
2064
+ }, [t]), ge(() => {
2065
2065
  var M;
2066
- n && u && ($r(u), Hr({
2067
- applicantId: u,
2066
+ n && p && ($r(p), Hr({
2067
+ applicantId: p,
2068
2068
  currentStepOrder: (M = n.currentStep) == null ? void 0 : M.order,
2069
2069
  status: n.status,
2070
2070
  lastUpdated: (/* @__PURE__ */ new Date()).toISOString(),
2071
2071
  workflowKey: n.workFlowKey,
2072
2072
  nextWorkflowKey: n.nextWorkflowKey
2073
2073
  }));
2074
- }, [n, u]);
2075
- const h = le(!1), D = le(!1), x = re(async () => {
2076
- if (!(!u || !m.current)) {
2077
- if (h.current) {
2074
+ }, [n, p]);
2075
+ const b = ce(!1), D = ce(!1), x = ne(async () => {
2076
+ if (!(!p || !m.current)) {
2077
+ if (b.current) {
2078
2078
  console.log("[Workflow] Load already in progress, skipping...");
2079
2079
  return;
2080
2080
  }
2081
- h.current = !0, l(!0), d(null);
2081
+ b.current = !0, l(!0), d(null);
2082
2082
  try {
2083
- const M = await m.current.initialize(u);
2083
+ const M = await m.current.initialize(p);
2084
2084
  a(M), D.current = !0;
2085
2085
  } catch (M) {
2086
2086
  d(M);
2087
2087
  } finally {
2088
- l(!1), h.current = !1;
2088
+ l(!1), b.current = !1;
2089
2089
  }
2090
2090
  }
2091
- }, [u]);
2092
- he(() => {
2093
- u && !D.current && x();
2094
- }, [u, x]);
2095
- const P = re(async () => {
2091
+ }, [p]);
2092
+ ge(() => {
2093
+ p && !D.current && x();
2094
+ }, [p, x]);
2095
+ const P = ne(async () => {
2096
2096
  if (m.current) {
2097
- if (h.current) {
2097
+ if (b.current) {
2098
2098
  console.log("[Workflow] Refresh already in progress, skipping...");
2099
2099
  return;
2100
2100
  }
2101
- h.current = !0, l(!0), d(null);
2101
+ b.current = !0, l(!0), d(null);
2102
2102
  try {
2103
2103
  const M = await m.current.refreshProgress();
2104
2104
  a(M);
2105
2105
  } catch (M) {
2106
2106
  d(M);
2107
2107
  } finally {
2108
- l(!1), h.current = !1;
2108
+ l(!1), b.current = !1;
2109
2109
  }
2110
2110
  }
2111
- }, []), T = re(async () => {
2111
+ }, []), T = ne(async () => {
2112
2112
  if (m.current) {
2113
2113
  l(!0), d(null);
2114
2114
  try {
@@ -2120,7 +2120,7 @@ function Ur(e) {
2120
2120
  l(!1);
2121
2121
  }
2122
2122
  }
2123
- }, []), S = re(async () => {
2123
+ }, []), S = ne(async () => {
2124
2124
  if (m.current) {
2125
2125
  l(!0), d(null);
2126
2126
  try {
@@ -2132,23 +2132,23 @@ function Ur(e) {
2132
2132
  l(!1);
2133
2133
  }
2134
2134
  }
2135
- }, []), R = re(async (M) => {
2135
+ }, []), I = ne(async (M) => {
2136
2136
  if (m.current) {
2137
2137
  l(!0), d(null);
2138
2138
  try {
2139
2139
  await m.current.submitCurrentStep(M);
2140
- const H = await m.current.refreshProgress();
2141
- a(H);
2142
- } catch (H) {
2143
- throw d(H), H;
2140
+ const j = await m.current.refreshProgress();
2141
+ a(j);
2142
+ } catch (j) {
2143
+ throw d(j), j;
2144
2144
  } finally {
2145
2145
  l(!1);
2146
2146
  }
2147
2147
  }
2148
- }, []), z = Nt.useMemo(() => n != null && n.stepInfoList ? [...n.stepInfoList].sort((M, H) => M.order - H.order) : [], [n == null ? void 0 : n.stepInfoList]), Q = Nt.useMemo(() => n ? n.nextWorkflowKey && n.nextWorkflowKey !== n.workFlowKey : !1, [n]);
2148
+ }, []), z = Nt.useMemo(() => n != null && n.stepInfoList ? [...n.stepInfoList].sort((M, j) => M.order - j.order) : [], [n == null ? void 0 : n.stepInfoList]), Q = Nt.useMemo(() => n ? n.nextWorkflowKey && n.nextWorkflowKey !== n.workFlowKey : !1, [n]);
2149
2149
  return {
2150
2150
  progress: n,
2151
- applicantId: u,
2151
+ applicantId: p,
2152
2152
  currentStep: (n == null ? void 0 : n.currentStep) || null,
2153
2153
  steps: z,
2154
2154
  status: (n == null ? void 0 : n.status) || Oe.None,
@@ -2163,12 +2163,12 @@ function Ur(e) {
2163
2163
  refreshProgress: P,
2164
2164
  moveToNext: T,
2165
2165
  moveBack: S,
2166
- submitCurrentStep: R,
2166
+ submitCurrentStep: I,
2167
2167
  orchestrator: m.current
2168
2168
  };
2169
2169
  }
2170
2170
  function Kr(e) {
2171
- const { questionnaireService: t, applicantService: n } = Ae(), [a, s] = v(null), [l, c] = v({}), [d, m] = v(!1), [u, h] = v(!1), [D, x] = v(null), P = le(!1), T = le(null), S = re(async () => {
2171
+ const { questionnaireService: t, applicantService: n } = Ae(), [a, s] = k(null), [l, c] = k({}), [d, m] = k(!1), [p, b] = k(!1), [D, x] = k(null), P = ce(!1), T = ce(null), S = ne(async () => {
2172
2172
  var z, Q;
2173
2173
  if (e) {
2174
2174
  if (P.current) {
@@ -2177,18 +2177,18 @@ function Kr(e) {
2177
2177
  }
2178
2178
  P.current = !0, m(!0), x(null);
2179
2179
  try {
2180
- const [M, H] = await Promise.all([
2180
+ const [M, j] = await Promise.all([
2181
2181
  t.getQuestionnaire(e),
2182
2182
  n.getApplicantData(e).catch(() => null)
2183
2183
  ]);
2184
- if (s(M), (z = H == null ? void 0 : H.questionnaireResults) != null && z.length && M) {
2185
- const q = /* @__PURE__ */ new Map();
2186
- for (const f of H.questionnaireResults)
2187
- f.question && ((Q = f.answers) != null && Q.length) && q.set(f.question.trim().toLowerCase(), f.answers);
2188
- const X = {}, F = M.questionGroups.flatMap((f) => f.questions ?? []);
2189
- for (const f of F) {
2190
- const B = f.text.trim().toLowerCase();
2191
- q.has(B) && (X[f.id] = q.get(B));
2184
+ if (s(M), (z = j == null ? void 0 : j.questionnaireResults) != null && z.length && M) {
2185
+ const K = /* @__PURE__ */ new Map();
2186
+ for (const g of j.questionnaireResults)
2187
+ g.question && ((Q = g.answers) != null && Q.length) && K.set(g.question.trim().toLowerCase(), g.answers);
2188
+ const X = {}, F = M.questionGroups.flatMap((g) => g.questions ?? []);
2189
+ for (const g of F) {
2190
+ const B = g.text.trim().toLowerCase();
2191
+ K.has(B) && (X[g.id] = K.get(B));
2192
2192
  }
2193
2193
  c(X);
2194
2194
  }
@@ -2200,18 +2200,18 @@ function Kr(e) {
2200
2200
  }
2201
2201
  }
2202
2202
  }, [e, t, n]);
2203
- he(() => {
2203
+ ge(() => {
2204
2204
  e && T.current !== e && S();
2205
2205
  }, [e]);
2206
- const R = re(
2206
+ const I = ne(
2207
2207
  async (z) => {
2208
- h(!0), x(null);
2208
+ b(!0), x(null);
2209
2209
  try {
2210
2210
  return await t.fillQuestionnaire(z);
2211
2211
  } catch (Q) {
2212
2212
  throw x(Q), Q;
2213
2213
  } finally {
2214
- h(!1);
2214
+ b(!1);
2215
2215
  }
2216
2216
  },
2217
2217
  [t]
@@ -2220,14 +2220,14 @@ function Kr(e) {
2220
2220
  questionnaire: a,
2221
2221
  initialAnswers: l,
2222
2222
  isLoading: d,
2223
- isSubmitting: u,
2223
+ isSubmitting: p,
2224
2224
  error: D,
2225
2225
  load: S,
2226
- submit: R
2226
+ submit: I
2227
2227
  };
2228
2228
  }
2229
2229
  function qr(e) {
2230
- const { uploadDocumentService: t } = Ae(), [n, a] = v(null), [s, l] = v(!1), [c, d] = v(!1), [m, u] = v(0), [h, D] = v(null), x = le(!1), P = le(null), T = re(async () => {
2230
+ const { uploadDocumentService: t } = Ae(), [n, a] = k(null), [s, l] = k(!1), [c, d] = k(!1), [m, p] = k(0), [b, D] = k(null), x = ce(!1), P = ce(null), T = ne(async () => {
2231
2231
  if (e) {
2232
2232
  if (x.current) {
2233
2233
  console.log("[UploadDocument] Load already in progress, skipping...");
@@ -2235,23 +2235,23 @@ function qr(e) {
2235
2235
  }
2236
2236
  x.current = !0, l(!0), D(null);
2237
2237
  try {
2238
- const R = await t.getUploadDocument(e);
2239
- a(R), P.current = e;
2240
- } catch (R) {
2241
- D(R);
2238
+ const I = await t.getUploadDocument(e);
2239
+ a(I), P.current = e;
2240
+ } catch (I) {
2241
+ D(I);
2242
2242
  } finally {
2243
2243
  l(!1), x.current = !1;
2244
2244
  }
2245
2245
  }
2246
2246
  }, [e, t]);
2247
- he(() => {
2247
+ ge(() => {
2248
2248
  e && P.current !== e && T();
2249
2249
  }, [e]);
2250
- const S = re(
2251
- async (R) => {
2252
- d(!0), u(0), D(null);
2250
+ const S = ne(
2251
+ async (I) => {
2252
+ d(!0), p(0), D(null);
2253
2253
  try {
2254
- await t.fillUploadDocument(R), u(100);
2254
+ await t.fillUploadDocument(I), p(100);
2255
2255
  } catch (z) {
2256
2256
  throw D(z), z;
2257
2257
  } finally {
@@ -2265,40 +2265,40 @@ function qr(e) {
2265
2265
  isLoading: s,
2266
2266
  isSubmitting: c,
2267
2267
  uploadProgress: m,
2268
- error: h,
2268
+ error: b,
2269
2269
  load: T,
2270
2270
  submit: S
2271
2271
  };
2272
2272
  }
2273
2273
  function Qn(e) {
2274
- const { appropriatenessTestService: t } = Ae(), [n, a] = v(null), [s, l] = v(!1), [c, d] = v(!1), [m, u] = v(null), [h, D] = v(null), x = le(!1), P = le(null), T = re(async () => {
2274
+ const { appropriatenessTestService: t } = Ae(), [n, a] = k(null), [s, l] = k(!1), [c, d] = k(!1), [m, p] = k(null), [b, D] = k(null), x = ce(!1), P = ce(null), T = ne(async () => {
2275
2275
  if (e) {
2276
2276
  if (x.current) {
2277
2277
  console.log("[AppropriatenessTest] Load already in progress, skipping...");
2278
2278
  return;
2279
2279
  }
2280
- x.current = !0, l(!0), u(null);
2280
+ x.current = !0, l(!0), p(null);
2281
2281
  try {
2282
- const R = await t.getAppropriatenessTest(e);
2283
- a(R), P.current = e;
2284
- } catch (R) {
2285
- u(R);
2282
+ const I = await t.getAppropriatenessTest(e);
2283
+ a(I), P.current = e;
2284
+ } catch (I) {
2285
+ p(I);
2286
2286
  } finally {
2287
2287
  l(!1), x.current = !1;
2288
2288
  }
2289
2289
  }
2290
2290
  }, [e, t]);
2291
- he(() => {
2291
+ ge(() => {
2292
2292
  e && P.current !== e && T();
2293
2293
  }, [e]);
2294
- const S = re(
2295
- async (R) => {
2296
- d(!0), u(null);
2294
+ const S = ne(
2295
+ async (I) => {
2296
+ d(!0), p(null);
2297
2297
  try {
2298
- const z = await t.fillAppropriatenessTest(R);
2298
+ const z = await t.fillAppropriatenessTest(I);
2299
2299
  return D(z), z;
2300
2300
  } catch (z) {
2301
- throw u(z), z;
2301
+ throw p(z), z;
2302
2302
  } finally {
2303
2303
  d(!1);
2304
2304
  }
@@ -2307,7 +2307,7 @@ function Qn(e) {
2307
2307
  );
2308
2308
  return {
2309
2309
  test: n,
2310
- result: h,
2310
+ result: b,
2311
2311
  isLoading: s,
2312
2312
  isSubmitting: c,
2313
2313
  error: m,
@@ -2316,33 +2316,33 @@ function Qn(e) {
2316
2316
  };
2317
2317
  }
2318
2318
  function Vr(e) {
2319
- const { overviewService: t } = Ae(), [n, a] = v(null), [s, l] = v(!1), [c, d] = v(!1), [m, u] = v(null), h = le(!1), D = le(null), x = re(async () => {
2319
+ const { overviewService: t } = Ae(), [n, a] = k(null), [s, l] = k(!1), [c, d] = k(!1), [m, p] = k(null), b = ce(!1), D = ce(null), x = ne(async () => {
2320
2320
  if (e) {
2321
- if (h.current) {
2321
+ if (b.current) {
2322
2322
  console.log("[Overview] Load already in progress, skipping...");
2323
2323
  return;
2324
2324
  }
2325
- h.current = !0, l(!0), u(null);
2325
+ b.current = !0, l(!0), p(null);
2326
2326
  try {
2327
2327
  const T = await t.getOverviewData(e);
2328
2328
  a(T), D.current = e;
2329
2329
  } catch (T) {
2330
- u(T);
2330
+ p(T);
2331
2331
  } finally {
2332
- l(!1), h.current = !1;
2332
+ l(!1), b.current = !1;
2333
2333
  }
2334
2334
  }
2335
2335
  }, [e, t]);
2336
- he(() => {
2336
+ ge(() => {
2337
2337
  e && D.current !== e && x();
2338
2338
  }, [e]);
2339
- const P = re(async () => {
2339
+ const P = ne(async () => {
2340
2340
  if (e) {
2341
- d(!0), u(null);
2341
+ d(!0), p(null);
2342
2342
  try {
2343
2343
  await t.passOverview(e);
2344
2344
  } catch (T) {
2345
- throw u(T), T;
2345
+ throw p(T), T;
2346
2346
  } finally {
2347
2347
  d(!1);
2348
2348
  }
@@ -2358,9 +2358,9 @@ function Vr(e) {
2358
2358
  };
2359
2359
  }
2360
2360
  function Yr(e) {
2361
- const { identityService: t } = Ae(), [n, a] = v(
2361
+ const { identityService: t } = Ae(), [n, a] = k(
2362
2362
  null
2363
- ), [s, l] = v(!1), [c, d] = v(null), m = le(!1), u = re(
2363
+ ), [s, l] = k(!1), [c, d] = k(null), m = ce(!1), p = ne(
2364
2364
  async (x, P) => {
2365
2365
  if (e) {
2366
2366
  if (m.current) {
@@ -2387,7 +2387,7 @@ function Yr(e) {
2387
2387
  }
2388
2388
  },
2389
2389
  [e, t]
2390
- ), h = re(
2390
+ ), b = ne(
2391
2391
  async (x, P) => {
2392
2392
  if (e) {
2393
2393
  l(!0), d(null);
@@ -2407,7 +2407,7 @@ function Yr(e) {
2407
2407
  }
2408
2408
  },
2409
2409
  [e, t]
2410
- ), D = re(async () => {
2410
+ ), D = ne(async () => {
2411
2411
  if (e) {
2412
2412
  if (m.current) {
2413
2413
  console.log("[Identity] Restart already in progress, skipping...");
@@ -2438,13 +2438,13 @@ function Yr(e) {
2438
2438
  token: (n == null ? void 0 : n.publicProviderTokenObject) || null,
2439
2439
  isLoading: s,
2440
2440
  error: c,
2441
- requestIdentity: u,
2442
- requestCompanyIdentity: h,
2441
+ requestIdentity: p,
2442
+ requestCompanyIdentity: b,
2443
2443
  restartIdentity: D
2444
2444
  };
2445
2445
  }
2446
2446
  function Qr(e) {
2447
- const { riskScoringService: t, applicantService: n } = Ae(), [a, s] = v(null), [l, c] = v({}), [d, m] = v(!1), [u, h] = v(!1), [D, x] = v(null), [P, T] = v(null), S = le(!1), R = le(null), z = re(async () => {
2447
+ const { riskScoringService: t, applicantService: n } = Ae(), [a, s] = k(null), [l, c] = k({}), [d, m] = k(!1), [p, b] = k(!1), [D, x] = k(null), [P, T] = k(null), S = ce(!1), I = ce(null), z = ne(async () => {
2448
2448
  var M;
2449
2449
  if (e) {
2450
2450
  if (S.current) {
@@ -2453,42 +2453,42 @@ function Qr(e) {
2453
2453
  }
2454
2454
  S.current = !0, m(!0), x(null);
2455
2455
  try {
2456
- const [H, q] = await Promise.all([
2456
+ const [j, K] = await Promise.all([
2457
2457
  t.getRiskCriterias(e),
2458
2458
  n.getApplicantData(e).catch(() => null)
2459
2459
  ]);
2460
- if (s(H), (M = q == null ? void 0 : q.riskScoringResults) != null && M.length) {
2461
- const X = q.riskScoringResults[0], F = {};
2462
- for (const f of X.riskCriteriaResults ?? [])
2463
- if (f.riskCriteriaId != null && f.answer != null && f.answer !== "") {
2460
+ if (s(j), (M = K == null ? void 0 : K.riskScoringResults) != null && M.length) {
2461
+ const X = K.riskScoringResults[0], F = {};
2462
+ for (const g of X.riskCriteriaResults ?? [])
2463
+ if (g.riskCriteriaId != null && g.answer != null && g.answer !== "") {
2464
2464
  const B = [...new Set(
2465
- f.answer.split(",").map((V) => V.trim()).filter((V) => V !== "")
2465
+ g.answer.split(",").map((V) => V.trim()).filter((V) => V !== "")
2466
2466
  )];
2467
- B.length > 0 && (F[f.riskCriteriaId] = B);
2467
+ B.length > 0 && (F[g.riskCriteriaId] = B);
2468
2468
  }
2469
2469
  c(F);
2470
2470
  }
2471
- R.current = e;
2472
- } catch (H) {
2473
- x(H);
2471
+ I.current = e;
2472
+ } catch (j) {
2473
+ x(j);
2474
2474
  } finally {
2475
2475
  m(!1), S.current = !1;
2476
2476
  }
2477
2477
  }
2478
2478
  }, [e, t, n]);
2479
- he(() => {
2480
- e && R.current !== e && z();
2479
+ ge(() => {
2480
+ e && I.current !== e && z();
2481
2481
  }, [e]);
2482
- const Q = re(
2482
+ const Q = ne(
2483
2483
  async (M) => {
2484
- h(!0), x(null);
2484
+ b(!0), x(null);
2485
2485
  try {
2486
- const H = await t.submitRiskScoring(M);
2487
- return T(H), H;
2488
- } catch (H) {
2489
- throw x(H), H;
2486
+ const j = await t.submitRiskScoring(M);
2487
+ return T(j), j;
2488
+ } catch (j) {
2489
+ throw x(j), j;
2490
2490
  } finally {
2491
- h(!1);
2491
+ b(!1);
2492
2492
  }
2493
2493
  },
2494
2494
  [t]
@@ -2498,17 +2498,17 @@ function Qr(e) {
2498
2498
  initialAnswers: l,
2499
2499
  result: P,
2500
2500
  isLoading: d,
2501
- isSubmitting: u,
2501
+ isSubmitting: p,
2502
2502
  error: D,
2503
2503
  load: z,
2504
2504
  submit: Q
2505
2505
  };
2506
2506
  }
2507
2507
  function Ot() {
2508
- const { applicantService: e, config: t } = Ae(), [n, a] = v(!1), [s, l] = v(null), c = le(!1), d = le(!1), m = () => "xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g, function(P) {
2508
+ const { applicantService: e, config: t } = Ae(), [n, a] = k(!1), [s, l] = k(null), c = ce(!1), d = ce(!1), m = () => "xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g, function(P) {
2509
2509
  const T = Math.random() * 16 | 0;
2510
2510
  return (P === "x" ? T : T & 3 | 8).toString(16);
2511
- }), u = re(
2511
+ }), p = ne(
2512
2512
  async (P) => {
2513
2513
  var T;
2514
2514
  if (c.current)
@@ -2516,10 +2516,10 @@ function Ot() {
2516
2516
  c.current = !0, a(!0), l(null);
2517
2517
  try {
2518
2518
  if (P.applicantAdditionalDatas || (P.applicantAdditionalDatas = []), (T = t.identityProviders) != null && T.sardinai) {
2519
- const R = m();
2520
- console.log("[SardinAI] Generated session key:", R), P.applicantAdditionalDatas.push({
2519
+ const I = m();
2520
+ console.log("[SardinAI] Generated session key:", I), P.applicantAdditionalDatas.push({
2521
2521
  paramName: "sessionKey",
2522
- value: R
2522
+ value: I
2523
2523
  });
2524
2524
  }
2525
2525
  return await e.createApplicant(P);
@@ -2530,7 +2530,7 @@ function Ot() {
2530
2530
  }
2531
2531
  },
2532
2532
  [e, t]
2533
- ), h = re(
2533
+ ), b = ne(
2534
2534
  async (P) => {
2535
2535
  a(!0), l(null);
2536
2536
  try {
@@ -2542,7 +2542,7 @@ function Ot() {
2542
2542
  }
2543
2543
  },
2544
2544
  [e]
2545
- ), D = re(
2545
+ ), D = ne(
2546
2546
  async (P) => {
2547
2547
  if (d.current)
2548
2548
  throw console.log("[Applicant] Data load already in progress, skipping..."), new Error("Data load already in progress");
@@ -2556,7 +2556,7 @@ function Ot() {
2556
2556
  }
2557
2557
  },
2558
2558
  [e]
2559
- ), x = re(
2559
+ ), x = ne(
2560
2560
  async (P) => {
2561
2561
  a(!0), l(null);
2562
2562
  try {
@@ -2572,8 +2572,8 @@ function Ot() {
2572
2572
  return {
2573
2573
  isLoading: n,
2574
2574
  error: s,
2575
- createApplicant: u,
2576
- createCompanyApplicant: h,
2575
+ createApplicant: p,
2576
+ createCompanyApplicant: b,
2577
2577
  getApplicantData: D,
2578
2578
  stopProgress: x
2579
2579
  };
@@ -2658,7 +2658,7 @@ const Gr = {
2658
2658
  e
2659
2659
  ]
2660
2660
  }
2661
- ), xe = mt(
2661
+ ), be = mt(
2662
2662
  ({ label: e, error: t, helperText: n, leftIcon: a, rightIcon: s, className: l, style: c, ...d }, m) => /* @__PURE__ */ o("div", { className: "w-full", children: [
2663
2663
  e && /* @__PURE__ */ o(
2664
2664
  "label",
@@ -2701,7 +2701,7 @@ const Gr = {
2701
2701
  !t && n && /* @__PURE__ */ r("p", { className: "mt-1 text-sm", style: { color: "var(--metakyc-text-secondary, #6b7280)" }, children: n })
2702
2702
  ] })
2703
2703
  );
2704
- xe.displayName = "Input";
2704
+ be.displayName = "Input";
2705
2705
  const ee = ({ children: e, className: t, ...n }) => /* @__PURE__ */ r(
2706
2706
  "div",
2707
2707
  {
@@ -2716,7 +2716,7 @@ const ee = ({ children: e, className: t, ...n }) => /* @__PURE__ */ r(
2716
2716
  ...n,
2717
2717
  children: e
2718
2718
  }
2719
- ), we = ({ children: e, className: t, ...n }) => /* @__PURE__ */ r(
2719
+ ), ke = ({ children: e, className: t, ...n }) => /* @__PURE__ */ r(
2720
2720
  "div",
2721
2721
  {
2722
2722
  className: Fe("px-6 py-4 border-b", t),
@@ -2726,7 +2726,7 @@ const ee = ({ children: e, className: t, ...n }) => /* @__PURE__ */ r(
2726
2726
  ...n,
2727
2727
  children: e
2728
2728
  }
2729
- ), te = ({ children: e, className: t, ...n }) => /* @__PURE__ */ r("div", { className: Fe("px-6 py-4", t), ...n, children: e }), Ce = ({ children: e, className: t, ...n }) => /* @__PURE__ */ r(
2729
+ ), te = ({ children: e, className: t, ...n }) => /* @__PURE__ */ r("div", { className: Fe("px-6 py-4", t), ...n, children: e }), Se = ({ children: e, className: t, ...n }) => /* @__PURE__ */ r(
2730
2730
  "div",
2731
2731
  {
2732
2732
  className: Fe("px-6 py-4 border-t", t),
@@ -2851,18 +2851,18 @@ const ee = ({ children: e, className: t, ...n }) => /* @__PURE__ */ r(
2851
2851
  },
2852
2852
  "__placeholder__"
2853
2853
  ),
2854
- a.map((u, h) => /* @__PURE__ */ r(
2854
+ a.map((p, b) => /* @__PURE__ */ r(
2855
2855
  "option",
2856
2856
  {
2857
- value: u.value,
2858
- disabled: u.disabled,
2857
+ value: p.value,
2858
+ disabled: p.disabled,
2859
2859
  style: {
2860
2860
  backgroundColor: "var(--metakyc-input-bg, #ffffff)",
2861
- color: u.disabled ? "var(--metakyc-text-muted, #9ca3af)" : "var(--metakyc-input-text, var(--metakyc-text-primary, #111827))"
2861
+ color: p.disabled ? "var(--metakyc-text-muted, #9ca3af)" : "var(--metakyc-input-text, var(--metakyc-text-primary, #111827))"
2862
2862
  },
2863
- children: u.label
2863
+ children: p.label
2864
2864
  },
2865
- u.value || `option-${h}`
2865
+ p.value || `option-${b}`
2866
2866
  ))
2867
2867
  ]
2868
2868
  }
@@ -2872,7 +2872,7 @@ const ee = ({ children: e, className: t, ...n }) => /* @__PURE__ */ r(
2872
2872
  ] })
2873
2873
  );
2874
2874
  St.displayName = "Select";
2875
- const Rt = 280, Zr = ({
2875
+ const It = 280, Zr = ({
2876
2876
  label: e,
2877
2877
  value: t,
2878
2878
  onChange: n,
@@ -2882,7 +2882,7 @@ const Rt = 280, Zr = ({
2882
2882
  readOnly: c = !1,
2883
2883
  required: d = !1
2884
2884
  }) => {
2885
- const m = l || c, [u, h] = v(!1), [D, x] = v(""), [P, T] = v(null), [S, R] = v({
2885
+ const m = l || c, [p, b] = k(!1), [D, x] = k(""), [P, T] = k(null), [S, I] = k({
2886
2886
  bg: "#ffffff",
2887
2887
  borderColor: "#d1d5db",
2888
2888
  textPrimary: "#111827",
@@ -2890,13 +2890,13 @@ const Rt = 280, Zr = ({
2890
2890
  primaryColor: "#2563eb",
2891
2891
  primaryLight: "#eff6ff",
2892
2892
  hoverBg: "#f9fafb"
2893
- }), z = le(null), Q = le(null), M = le(null), H = re(() => {
2893
+ }), z = ce(null), Q = ce(null), M = ce(null), j = ne(() => {
2894
2894
  if (!Q.current) return null;
2895
- const A = Q.current.getBoundingClientRect(), $ = window.innerHeight - A.bottom < Rt && A.top > Rt;
2895
+ const A = Q.current.getBoundingClientRect(), $ = window.innerHeight - A.bottom < It && A.top > It;
2896
2896
  return { top: $ ? A.top : A.bottom + 4, left: A.left, width: A.width, openUp: $ };
2897
- }, []), q = re(() => {
2898
- const A = getComputedStyle(document.documentElement), U = (W, ge) => A.getPropertyValue(W).trim() || ge, $ = U("--metakyc-input-bg", U("--metakyc-background", "#ffffff"));
2899
- R({
2897
+ }, []), K = ne(() => {
2898
+ const A = getComputedStyle(document.documentElement), U = (H, he) => A.getPropertyValue(H).trim() || he, $ = U("--metakyc-input-bg", U("--metakyc-background", "#ffffff"));
2899
+ I({
2900
2900
  bg: $,
2901
2901
  borderColor: U("--metakyc-input-border", U("--metakyc-border", "#d1d5db")),
2902
2902
  textPrimary: U("--metakyc-input-text", U("--metakyc-text-primary", "#111827")),
@@ -2905,33 +2905,33 @@ const Rt = 280, Zr = ({
2905
2905
  primaryLight: U("--metakyc-primary-light", "#eff6ff"),
2906
2906
  hoverBg: U("--metakyc-surface", $)
2907
2907
  });
2908
- }, []), X = re(() => {
2908
+ }, []), X = ne(() => {
2909
2909
  if (m) return;
2910
- q();
2911
- const A = H();
2912
- A && T(A), h(!0);
2913
- }, [m, H, q]), F = re(() => {
2914
- h(!1), x("");
2910
+ K();
2911
+ const A = j();
2912
+ A && T(A), b(!0);
2913
+ }, [m, j, K]), F = ne(() => {
2914
+ b(!1), x("");
2915
2915
  }, []);
2916
- he(() => {
2917
- if (!u) return;
2916
+ ge(() => {
2917
+ if (!p) return;
2918
2918
  const A = (U) => {
2919
- var W, ge;
2919
+ var H, he;
2920
2920
  const $ = U.target;
2921
- !((W = z.current) != null && W.contains($)) && !((ge = M.current) != null && ge.contains($)) && F();
2921
+ !((H = z.current) != null && H.contains($)) && !((he = M.current) != null && he.contains($)) && F();
2922
2922
  };
2923
2923
  return document.addEventListener("mousedown", A), () => document.removeEventListener("mousedown", A);
2924
- }, [u, F]), he(() => {
2925
- if (!u) return;
2924
+ }, [p, F]), ge(() => {
2925
+ if (!p) return;
2926
2926
  const A = () => {
2927
- const U = H();
2927
+ const U = j();
2928
2928
  U && T(U);
2929
2929
  };
2930
2930
  return window.addEventListener("scroll", A, !0), window.addEventListener("resize", A), () => {
2931
2931
  window.removeEventListener("scroll", A, !0), window.removeEventListener("resize", A);
2932
2932
  };
2933
- }, [u, H]);
2934
- const f = a.filter(
2933
+ }, [p, j]);
2934
+ const g = a.filter(
2935
2935
  (A) => A.label.toLowerCase().includes(D.toLowerCase())
2936
2936
  ), B = (A) => {
2937
2937
  m || n(t.includes(A) ? t.filter((U) => U !== A) : [...t, A]);
@@ -2940,7 +2940,7 @@ const Rt = 280, Zr = ({
2940
2940
  }, G = (A) => {
2941
2941
  var U;
2942
2942
  return ((U = a.find(($) => $.value === A)) == null ? void 0 : U.label) || A;
2943
- }, { bg: _, borderColor: J, textPrimary: ie, textSecondary: Y, primaryColor: ve, primaryLight: ce, hoverBg: me } = S, ke = u && P && /* @__PURE__ */ o(
2943
+ }, { bg: _, borderColor: J, textPrimary: ie, textSecondary: Y, primaryColor: xe, primaryLight: de, hoverBg: pe } = S, ve = p && P && /* @__PURE__ */ o(
2944
2944
  "div",
2945
2945
  {
2946
2946
  ref: M,
@@ -2990,7 +2990,7 @@ const Rt = 280, Zr = ({
2990
2990
  }
2991
2991
  }
2992
2992
  ) }),
2993
- /* @__PURE__ */ r("ul", { style: { listStyle: "none", margin: 0, padding: "4px 0", maxHeight: "192px", overflowY: "auto" }, children: f.length === 0 ? /* @__PURE__ */ r("li", { style: { padding: "8px 12px", fontSize: "13px", color: Y }, children: "No results" }) : f.map((A) => {
2993
+ /* @__PURE__ */ r("ul", { style: { listStyle: "none", margin: 0, padding: "4px 0", maxHeight: "192px", overflowY: "auto" }, children: g.length === 0 ? /* @__PURE__ */ r("li", { style: { padding: "8px 12px", fontSize: "13px", color: Y }, children: "No results" }) : g.map((A) => {
2994
2994
  const U = t.includes(A.value);
2995
2995
  return /* @__PURE__ */ o(
2996
2996
  "li",
@@ -3004,12 +3004,12 @@ const Rt = 280, Zr = ({
3004
3004
  padding: "8px 12px",
3005
3005
  fontSize: "13px",
3006
3006
  cursor: "pointer",
3007
- backgroundColor: U ? ce : "transparent",
3008
- color: U ? ve : ie,
3007
+ backgroundColor: U ? de : "transparent",
3008
+ color: U ? xe : ie,
3009
3009
  userSelect: "none"
3010
3010
  },
3011
3011
  onMouseEnter: ($) => {
3012
- U || ($.currentTarget.style.backgroundColor = me);
3012
+ U || ($.currentTarget.style.backgroundColor = pe);
3013
3013
  },
3014
3014
  onMouseLeave: ($) => {
3015
3015
  U || ($.currentTarget.style.backgroundColor = "transparent");
@@ -3021,7 +3021,7 @@ const Rt = 280, Zr = ({
3021
3021
  type: "checkbox",
3022
3022
  checked: U,
3023
3023
  readOnly: !0,
3024
- style: { accentColor: ve, pointerEvents: "none", flexShrink: 0 }
3024
+ style: { accentColor: xe, pointerEvents: "none", flexShrink: 0 }
3025
3025
  }
3026
3026
  ),
3027
3027
  /* @__PURE__ */ r("span", { children: A.label })
@@ -3064,7 +3064,7 @@ const Rt = 280, Zr = ({
3064
3064
  "div",
3065
3065
  {
3066
3066
  ref: Q,
3067
- onClick: () => u ? F() : X(),
3067
+ onClick: () => p ? F() : X(),
3068
3068
  className: Fe(
3069
3069
  "metakyc-multiselect-trigger",
3070
3070
  "min-h-[42px] w-full px-3 py-2 rounded-lg border text-sm transition-colors relative",
@@ -3072,8 +3072,8 @@ const Rt = 280, Zr = ({
3072
3072
  ),
3073
3073
  style: {
3074
3074
  backgroundColor: "var(--metakyc-input-bg, #ffffff)",
3075
- borderColor: u ? "var(--metakyc-input-border-focus, var(--metakyc-primary, #2563eb))" : "var(--metakyc-input-border, var(--metakyc-border, #d1d5db))",
3076
- outline: u ? "2px solid var(--metakyc-input-border-focus, var(--metakyc-primary, #2563eb))" : "none",
3075
+ borderColor: p ? "var(--metakyc-input-border-focus, var(--metakyc-primary, #2563eb))" : "var(--metakyc-input-border, var(--metakyc-border, #d1d5db))",
3076
+ outline: p ? "2px solid var(--metakyc-input-border-focus, var(--metakyc-primary, #2563eb))" : "none",
3077
3077
  outlineOffset: "-1px"
3078
3078
  },
3079
3079
  children: [
@@ -3131,13 +3131,13 @@ const Rt = 280, Zr = ({
3131
3131
  {
3132
3132
  className: "metakyc-multiselect-arrow absolute right-3 top-1/2 -translate-y-1/2 pointer-events-none text-xs",
3133
3133
  style: { color: "var(--metakyc-text-secondary, #6b7280)" },
3134
- children: u ? "▲" : "▼"
3134
+ children: p ? "▲" : "▼"
3135
3135
  }
3136
3136
  )
3137
3137
  ]
3138
3138
  }
3139
3139
  ),
3140
- typeof document < "u" && ke ? wt(ke, document.body) : null
3140
+ typeof document < "u" && ve ? wt(ve, document.body) : null
3141
3141
  ] });
3142
3142
  }, Et = 260, Ue = ({
3143
3143
  label: e,
@@ -3149,11 +3149,11 @@ const Rt = 280, Zr = ({
3149
3149
  onChange: c,
3150
3150
  disabled: d = !1,
3151
3151
  readOnly: m = !1,
3152
- required: u = !1,
3153
- className: h
3152
+ required: p = !1,
3153
+ className: b
3154
3154
  }) => {
3155
- var ge;
3156
- const D = d || m, [x, P] = v(!1), [T, S] = v(""), [R, z] = v(null), [Q, M] = v({
3155
+ var he;
3156
+ const D = d || m, [x, P] = k(!1), [T, S] = k(""), [I, z] = k(null), [Q, M] = k({
3157
3157
  bg: "#ffffff",
3158
3158
  border: "#d1d5db",
3159
3159
  text: "#111827",
@@ -3161,84 +3161,84 @@ const Rt = 280, Zr = ({
3161
3161
  primary: "#2563eb",
3162
3162
  primaryLight: "#eff6ff",
3163
3163
  hoverBg: "#f9fafb"
3164
- }), H = re(() => {
3165
- const E = getComputedStyle(document.documentElement), ne = (fe, pe) => E.getPropertyValue(fe).trim() || pe, de = ne("--metakyc-input-bg", ne("--metakyc-background", "#ffffff"));
3164
+ }), j = ne(() => {
3165
+ const E = getComputedStyle(document.documentElement), re = (se, Ce) => E.getPropertyValue(se).trim() || Ce, me = re("--metakyc-input-bg", re("--metakyc-background", "#ffffff"));
3166
3166
  M({
3167
- bg: de,
3168
- border: ne("--metakyc-input-border", ne("--metakyc-border", "#d1d5db")),
3169
- text: ne("--metakyc-input-text", ne("--metakyc-text-primary", "#111827")),
3170
- textSecondary: ne("--metakyc-text-secondary", "#6b7280"),
3171
- primary: ne("--metakyc-primary", "#2563eb"),
3172
- primaryLight: ne("--metakyc-primary-light", "#eff6ff"),
3173
- hoverBg: ne("--metakyc-surface", de)
3167
+ bg: me,
3168
+ border: re("--metakyc-input-border", re("--metakyc-border", "#d1d5db")),
3169
+ text: re("--metakyc-input-text", re("--metakyc-text-primary", "#111827")),
3170
+ textSecondary: re("--metakyc-text-secondary", "#6b7280"),
3171
+ primary: re("--metakyc-primary", "#2563eb"),
3172
+ primaryLight: re("--metakyc-primary-light", "#eff6ff"),
3173
+ hoverBg: re("--metakyc-surface", me)
3174
3174
  });
3175
- }, []), q = le(null), X = le(null), F = le(null), f = le(null), B = re(() => {
3175
+ }, []), K = ce(null), X = ce(null), F = ce(null), g = ce(null), B = ne(() => {
3176
3176
  if (!X.current) return null;
3177
- const E = X.current.getBoundingClientRect(), de = window.innerHeight - E.bottom < Et && E.top > Et;
3177
+ const E = X.current.getBoundingClientRect(), me = window.innerHeight - E.bottom < Et && E.top > Et;
3178
3178
  return {
3179
- top: de ? E.top : E.bottom + 4,
3179
+ top: me ? E.top : E.bottom + 4,
3180
3180
  left: E.left,
3181
3181
  width: E.width,
3182
- openUp: de
3182
+ openUp: me
3183
3183
  };
3184
- }, []), V = re(() => {
3184
+ }, []), V = ne(() => {
3185
3185
  if (D) return;
3186
- H();
3186
+ j();
3187
3187
  const E = B();
3188
3188
  E && z(E), P(!0);
3189
- }, [D, B, H]), G = re(() => {
3189
+ }, [D, B, j]), G = ne(() => {
3190
3190
  P(!1), S("");
3191
3191
  }, []), _ = () => x ? G() : V();
3192
- he(() => {
3192
+ ge(() => {
3193
3193
  if (!x) return;
3194
- const E = (ne) => {
3195
- var fe, pe;
3196
- const de = ne.target;
3197
- !((fe = q.current) != null && fe.contains(de)) && !((pe = F.current) != null && pe.contains(de)) && G();
3194
+ const E = (re) => {
3195
+ var se, Ce;
3196
+ const me = re.target;
3197
+ !((se = K.current) != null && se.contains(me)) && !((Ce = F.current) != null && Ce.contains(me)) && G();
3198
3198
  };
3199
3199
  return document.addEventListener("mousedown", E), () => document.removeEventListener("mousedown", E);
3200
- }, [x, G]), he(() => {
3200
+ }, [x, G]), ge(() => {
3201
3201
  if (!x) return;
3202
3202
  const E = () => {
3203
- const ne = B();
3204
- ne && z(ne);
3203
+ const re = B();
3204
+ re && z(re);
3205
3205
  };
3206
3206
  return window.addEventListener("scroll", E, !0), window.addEventListener("resize", E), () => {
3207
3207
  window.removeEventListener("scroll", E, !0), window.removeEventListener("resize", E);
3208
3208
  };
3209
- }, [x, B]), he(() => {
3210
- x && f.current && setTimeout(() => {
3209
+ }, [x, B]), ge(() => {
3210
+ x && g.current && setTimeout(() => {
3211
3211
  var E;
3212
- return (E = f.current) == null ? void 0 : E.focus();
3212
+ return (E = g.current) == null ? void 0 : E.focus();
3213
3213
  }, 0);
3214
3214
  }, [x]);
3215
3215
  const J = a.filter(
3216
3216
  (E) => E.label.toLowerCase().includes(T.toLowerCase()) || E.value.toLowerCase().includes(T.toLowerCase())
3217
- ), ie = (ge = a.find((E) => E.value === l)) == null ? void 0 : ge.label, Y = (E, ne) => {
3218
- D || ne || (c(E), G());
3219
- }, { bg: ve, border: ce, text: me, textSecondary: ke, primary: A, primaryLight: U, hoverBg: $ } = Q, W = x && R && /* @__PURE__ */ o(
3217
+ ), ie = (he = a.find((E) => E.value === l)) == null ? void 0 : he.label, Y = (E, re) => {
3218
+ D || re || (c(E), G());
3219
+ }, { bg: xe, border: de, text: pe, textSecondary: ve, primary: A, primaryLight: U, hoverBg: $ } = Q, H = x && I && /* @__PURE__ */ o(
3220
3220
  "div",
3221
3221
  {
3222
3222
  ref: F,
3223
3223
  className: "metakyc-searchable-select-dropdown",
3224
3224
  style: {
3225
3225
  position: "fixed",
3226
- top: R.openUp ? void 0 : R.top,
3227
- bottom: R.openUp ? window.innerHeight - R.top + 4 : void 0,
3228
- left: R.left,
3229
- width: R.width,
3226
+ top: I.openUp ? void 0 : I.top,
3227
+ bottom: I.openUp ? window.innerHeight - I.top + 4 : void 0,
3228
+ left: I.left,
3229
+ width: I.width,
3230
3230
  zIndex: 99999,
3231
3231
  borderRadius: "8px",
3232
3232
  boxShadow: "0 4px 16px rgba(0,0,0,0.18)",
3233
- border: `1px solid ${ce}`,
3234
- backgroundColor: ve,
3233
+ border: `1px solid ${de}`,
3234
+ backgroundColor: xe,
3235
3235
  overflow: "hidden"
3236
3236
  },
3237
3237
  children: [
3238
- /* @__PURE__ */ r("div", { style: { padding: "8px", borderBottom: `1px solid ${ce}` }, children: /* @__PURE__ */ r(
3238
+ /* @__PURE__ */ r("div", { style: { padding: "8px", borderBottom: `1px solid ${de}` }, children: /* @__PURE__ */ r(
3239
3239
  "input",
3240
3240
  {
3241
- ref: f,
3241
+ ref: g,
3242
3242
  type: "text",
3243
3243
  value: T,
3244
3244
  onChange: (E) => S(E.target.value),
@@ -3251,18 +3251,18 @@ const Rt = 280, Zr = ({
3251
3251
  padding: "6px 8px",
3252
3252
  fontSize: "13px",
3253
3253
  borderRadius: "6px",
3254
- border: `1px solid ${ce}`,
3255
- backgroundColor: ve,
3256
- color: me,
3254
+ border: `1px solid ${de}`,
3255
+ backgroundColor: xe,
3256
+ color: pe,
3257
3257
  outline: "none",
3258
3258
  boxSizing: "border-box"
3259
3259
  },
3260
3260
  onFocus: (E) => {
3261
- const ne = getComputedStyle(document.documentElement), de = ne.getPropertyValue("--metakyc-input-border-focus").trim() || ne.getPropertyValue("--metakyc-primary").trim() || "#2563eb";
3262
- E.currentTarget.style.backgroundColor = ve, E.currentTarget.style.color = me, E.currentTarget.style.borderColor = de, E.currentTarget.style.outline = "none", E.currentTarget.style.boxShadow = `0 0 0 2px ${de}33`;
3261
+ const re = getComputedStyle(document.documentElement), me = re.getPropertyValue("--metakyc-input-border-focus").trim() || re.getPropertyValue("--metakyc-primary").trim() || "#2563eb";
3262
+ E.currentTarget.style.backgroundColor = xe, E.currentTarget.style.color = pe, E.currentTarget.style.borderColor = me, E.currentTarget.style.outline = "none", E.currentTarget.style.boxShadow = `0 0 0 2px ${me}33`;
3263
3263
  },
3264
3264
  onBlur: (E) => {
3265
- E.currentTarget.style.backgroundColor = ve, E.currentTarget.style.color = me, E.currentTarget.style.borderColor = ce, E.currentTarget.style.outline = "none", E.currentTarget.style.boxShadow = "none";
3265
+ E.currentTarget.style.backgroundColor = xe, E.currentTarget.style.color = pe, E.currentTarget.style.borderColor = de, E.currentTarget.style.outline = "none", E.currentTarget.style.boxShadow = "none";
3266
3266
  }
3267
3267
  }
3268
3268
  ) }),
@@ -3276,8 +3276,8 @@ const Rt = 280, Zr = ({
3276
3276
  maxHeight: "208px",
3277
3277
  overflowY: "auto"
3278
3278
  },
3279
- children: J.length === 0 ? /* @__PURE__ */ r("li", { style: { padding: "8px 12px", fontSize: "13px", color: ke }, children: "No results" }) : J.map((E) => {
3280
- const ne = E.value === l;
3279
+ children: J.length === 0 ? /* @__PURE__ */ r("li", { style: { padding: "8px 12px", fontSize: "13px", color: ve }, children: "No results" }) : J.map((E) => {
3280
+ const re = E.value === l;
3281
3281
  return /* @__PURE__ */ r(
3282
3282
  "li",
3283
3283
  {
@@ -3288,15 +3288,15 @@ const Rt = 280, Zr = ({
3288
3288
  fontSize: "13px",
3289
3289
  cursor: E.disabled ? "not-allowed" : "pointer",
3290
3290
  opacity: E.disabled ? 0.4 : 1,
3291
- backgroundColor: ne ? U : "transparent",
3292
- color: ne ? A : me,
3291
+ backgroundColor: re ? U : "transparent",
3292
+ color: re ? A : pe,
3293
3293
  userSelect: "none"
3294
3294
  },
3295
- onMouseEnter: (de) => {
3296
- !ne && !E.disabled && (de.currentTarget.style.backgroundColor = $);
3295
+ onMouseEnter: (me) => {
3296
+ !re && !E.disabled && (me.currentTarget.style.backgroundColor = $);
3297
3297
  },
3298
- onMouseLeave: (de) => {
3299
- ne || (de.currentTarget.style.backgroundColor = "transparent");
3298
+ onMouseLeave: (me) => {
3299
+ re || (me.currentTarget.style.backgroundColor = "transparent");
3300
3300
  },
3301
3301
  children: E.label
3302
3302
  },
@@ -3311,8 +3311,8 @@ const Rt = 280, Zr = ({
3311
3311
  return /* @__PURE__ */ o(
3312
3312
  "div",
3313
3313
  {
3314
- className: Fe("w-full metakyc-searchable-select", h),
3315
- ref: q,
3314
+ className: Fe("w-full metakyc-searchable-select", b),
3315
+ ref: K,
3316
3316
  children: [
3317
3317
  e && /* @__PURE__ */ o(
3318
3318
  "label",
@@ -3321,7 +3321,7 @@ const Rt = 280, Zr = ({
3321
3321
  style: { color: "var(--metakyc-text-primary, #374151)" },
3322
3322
  children: [
3323
3323
  e,
3324
- u && /* @__PURE__ */ r("span", { style: { color: "var(--metakyc-error, #ef4444)", marginLeft: "4px" }, children: "*" })
3324
+ p && /* @__PURE__ */ r("span", { style: { color: "var(--metakyc-error, #ef4444)", marginLeft: "4px" }, children: "*" })
3325
3325
  ]
3326
3326
  }
3327
3327
  ),
@@ -3363,7 +3363,7 @@ const Rt = 280, Zr = ({
3363
3363
  ]
3364
3364
  }
3365
3365
  ),
3366
- typeof document < "u" && W ? wt(W, document.body) : null,
3366
+ typeof document < "u" && H ? wt(H, document.body) : null,
3367
3367
  t && /* @__PURE__ */ r("p", { className: "mt-1 text-sm", style: { color: "var(--metakyc-error, #ef4444)" }, children: t }),
3368
3368
  !t && n && /* @__PURE__ */ r("p", { className: "mt-1 text-sm", style: { color: "var(--metakyc-text-secondary, #6b7280)" }, children: n })
3369
3369
  ]
@@ -3385,32 +3385,32 @@ const en = ({
3385
3385
  required: c,
3386
3386
  onChange: d,
3387
3387
  value: m = [],
3388
- className: u
3388
+ className: p
3389
3389
  }) => {
3390
- const [h, D] = v(!1), [x, P] = v(null), T = le(null), S = re((F) => {
3390
+ const [b, D] = k(!1), [x, P] = k(null), T = ce(null), S = ne((F) => {
3391
3391
  if (!F) return;
3392
3392
  P(null);
3393
- const f = Array.from(F);
3394
- if (l && f.filter((V) => V.size > l).length > 0) {
3393
+ const g = Array.from(F);
3394
+ if (l && g.filter((V) => V.size > l).length > 0) {
3395
3395
  P(`File exceeds the maximum size of ${bt(l)}`);
3396
3396
  return;
3397
3397
  }
3398
- d == null || d(s ? [...m, ...f] : [f[0]]);
3399
- }, [l, s, d, m]), R = re((F) => {
3398
+ d == null || d(s ? [...m, ...g] : [g[0]]);
3399
+ }, [l, s, d, m]), I = ne((F) => {
3400
3400
  F.preventDefault(), F.stopPropagation(), D(!0);
3401
- }, []), z = re((F) => {
3401
+ }, []), z = ne((F) => {
3402
3402
  F.preventDefault(), F.stopPropagation(), D(!1);
3403
- }, []), Q = re((F) => {
3403
+ }, []), Q = ne((F) => {
3404
3404
  F.preventDefault(), F.stopPropagation(), D(!1), S(F.dataTransfer.files);
3405
3405
  }, [S]), M = () => {
3406
3406
  var F;
3407
3407
  (F = T.current) == null || F.click();
3408
- }, H = (F) => {
3408
+ }, j = (F) => {
3409
3409
  P(null);
3410
- const f = m.filter((B, V) => V !== F);
3411
- d == null || d(f);
3412
- }, q = n || x, X = m.length > 0;
3413
- return /* @__PURE__ */ o("div", { className: Fe("metakyc-file-upload", u), style: { width: "100%" }, children: [
3410
+ const g = m.filter((B, V) => V !== F);
3411
+ d == null || d(g);
3412
+ }, K = n || x, X = m.length > 0;
3413
+ return /* @__PURE__ */ o("div", { className: Fe("metakyc-file-upload", p), style: { width: "100%" }, children: [
3414
3414
  e && /* @__PURE__ */ o("div", { style: { marginBottom: "8px" }, children: [
3415
3415
  /* @__PURE__ */ o(
3416
3416
  "label",
@@ -3434,17 +3434,17 @@ const en = ({
3434
3434
  {
3435
3435
  className: "metakyc-file-dropzone",
3436
3436
  onClick: M,
3437
- onDragOver: R,
3437
+ onDragOver: I,
3438
3438
  onDragLeave: z,
3439
3439
  onDrop: Q,
3440
3440
  style: {
3441
- border: `2px dashed ${q ? "var(--metakyc-danger, #ef4444)" : h ? "var(--metakyc-primary, #2563eb)" : "var(--metakyc-border, #d1d5db)"}`,
3441
+ border: `2px dashed ${K ? "var(--metakyc-danger, #ef4444)" : b ? "var(--metakyc-primary, #2563eb)" : "var(--metakyc-border, #d1d5db)"}`,
3442
3442
  borderRadius: "12px",
3443
3443
  padding: X ? "20px" : "32px 20px",
3444
3444
  textAlign: "center",
3445
3445
  cursor: "pointer",
3446
3446
  transition: "all 0.2s ease",
3447
- backgroundColor: h ? "color-mix(in srgb, var(--metakyc-primary, #2563eb) 5%, var(--metakyc-background, #ffffff))" : "var(--metakyc-background, #ffffff)"
3447
+ backgroundColor: b ? "color-mix(in srgb, var(--metakyc-primary, #2563eb) 5%, var(--metakyc-background, #ffffff))" : "var(--metakyc-background, #ffffff)"
3448
3448
  },
3449
3449
  children: [
3450
3450
  /* @__PURE__ */ r(
@@ -3471,7 +3471,7 @@ const en = ({
3471
3471
  display: "flex",
3472
3472
  alignItems: "center",
3473
3473
  justifyContent: "center",
3474
- backgroundColor: h ? "color-mix(in srgb, var(--metakyc-primary, #2563eb) 15%, transparent)" : "var(--metakyc-surface, #f9fafb)",
3474
+ backgroundColor: b ? "color-mix(in srgb, var(--metakyc-primary, #2563eb) 15%, transparent)" : "var(--metakyc-surface, #f9fafb)",
3475
3475
  transition: "background-color 0.2s ease"
3476
3476
  },
3477
3477
  children: /* @__PURE__ */ o(
@@ -3481,7 +3481,7 @@ const en = ({
3481
3481
  height: "24",
3482
3482
  viewBox: "0 0 24 24",
3483
3483
  fill: "none",
3484
- stroke: h ? "var(--metakyc-primary, #2563eb)" : "var(--metakyc-text-muted, #9ca3af)",
3484
+ stroke: b ? "var(--metakyc-primary, #2563eb)" : "var(--metakyc-text-muted, #9ca3af)",
3485
3485
  strokeWidth: "2",
3486
3486
  strokeLinecap: "round",
3487
3487
  strokeLinejoin: "round",
@@ -3514,7 +3514,7 @@ const en = ({
3514
3514
  ]
3515
3515
  }
3516
3516
  ),
3517
- X && /* @__PURE__ */ r("div", { style: { marginTop: "12px", display: "flex", flexDirection: "column", gap: "8px" }, children: m.map((F, f) => {
3517
+ X && /* @__PURE__ */ r("div", { style: { marginTop: "12px", display: "flex", flexDirection: "column", gap: "8px" }, children: m.map((F, g) => {
3518
3518
  const B = Xr(F), V = B === "image", G = V ? URL.createObjectURL(F) : null;
3519
3519
  return /* @__PURE__ */ o(
3520
3520
  "div",
@@ -3581,7 +3581,7 @@ const en = ({
3581
3581
  {
3582
3582
  type: "button",
3583
3583
  onClick: (_) => {
3584
- _.stopPropagation(), H(f);
3584
+ _.stopPropagation(), j(g);
3585
3585
  },
3586
3586
  style: {
3587
3587
  display: "flex",
@@ -3612,10 +3612,10 @@ const en = ({
3612
3612
  )
3613
3613
  ]
3614
3614
  },
3615
- `${F.name}-${f}`
3615
+ `${F.name}-${g}`
3616
3616
  );
3617
3617
  }) }),
3618
- q && /* @__PURE__ */ r("p", { style: { fontSize: "13px", color: "var(--metakyc-danger, #ef4444)", marginTop: "6px" }, children: q })
3618
+ K && /* @__PURE__ */ r("p", { style: { fontSize: "13px", color: "var(--metakyc-danger, #ef4444)", marginTop: "6px" }, children: K })
3619
3619
  ] });
3620
3620
  }, tn = mt(
3621
3621
  ({ countryCode: e = "+1", onCountryCodeChange: t, className: n, ...a }, s) => /* @__PURE__ */ o("div", { className: "w-full", children: [
@@ -3650,7 +3650,7 @@ const en = ({
3650
3650
  }
3651
3651
  ),
3652
3652
  /* @__PURE__ */ r(
3653
- xe,
3653
+ be,
3654
3654
  {
3655
3655
  ref: s,
3656
3656
  type: "tel",
@@ -3757,7 +3757,7 @@ const on = mt(
3757
3757
  ...d
3758
3758
  },
3759
3759
  [
3760
- ...c.map(([u, h]) => kt(u, h)),
3760
+ ...c.map(([p, b]) => kt(p, b)),
3761
3761
  ...Array.isArray(l) ? l : [l]
3762
3762
  ]
3763
3763
  )
@@ -3841,28 +3841,28 @@ const pn = ({
3841
3841
  onComplete: t,
3842
3842
  onBack: n
3843
3843
  }) => {
3844
- const { questionnaire: a, initialAnswers: s, isLoading: l, isSubmitting: c, error: d, submit: m } = Kr(e), [u, h] = v({}), [D, x] = v({}), [P, T] = v(0);
3845
- Se.useEffect(() => {
3846
- s && Object.keys(s).length > 0 && Object.keys(u).length === 0 && h(s);
3844
+ const { questionnaire: a, initialAnswers: s, isLoading: l, isSubmitting: c, error: d, submit: m } = Kr(e), [p, b] = k({}), [D, x] = k({}), [P, T] = k(0);
3845
+ we.useEffect(() => {
3846
+ s && Object.keys(s).length > 0 && Object.keys(p).length === 0 && b(s);
3847
3847
  }, [s]);
3848
3848
  const S = Le(
3849
3849
  () => a ? un(a.questionGroups) : [],
3850
3850
  [a]
3851
- ), R = P === S.length - 1, z = S[P] ?? [], Q = re((F, f) => {
3852
- h((B) => ({ ...B, [F]: f })), x((B) => {
3851
+ ), I = P === S.length - 1, z = S[P] ?? [], Q = ne((F, g) => {
3852
+ b((B) => ({ ...B, [F]: g })), x((B) => {
3853
3853
  const V = { ...B };
3854
3854
  return delete V[F], V;
3855
3855
  });
3856
- }, []), M = re(() => {
3856
+ }, []), M = ne(() => {
3857
3857
  const F = {};
3858
- for (const { question: f } of z) {
3859
- const B = dn(f, u[f.id] ?? []);
3860
- B && (F[f.id] = B);
3858
+ for (const { question: g } of z) {
3859
+ const B = dn(g, p[g.id] ?? []);
3860
+ B && (F[g.id] = B);
3861
3861
  }
3862
- return x((f) => ({ ...f, ...F })), Object.keys(F).length === 0;
3863
- }, [z, u]), H = () => {
3862
+ return x((g) => ({ ...g, ...F })), Object.keys(F).length === 0;
3863
+ }, [z, p]), j = () => {
3864
3864
  M() && T((F) => F + 1);
3865
- }, q = () => {
3865
+ }, K = () => {
3866
3866
  P > 0 ? T((F) => F - 1) : n == null || n();
3867
3867
  }, X = async () => {
3868
3868
  if (!(!M() || !a))
@@ -3870,14 +3870,14 @@ const pn = ({
3870
3870
  const F = a.questionGroups.flatMap(
3871
3871
  (B) => (B.questions ?? []).map((V) => ({
3872
3872
  questionId: V.id,
3873
- values: u[V.id] ?? []
3873
+ values: p[V.id] ?? []
3874
3874
  }))
3875
- ), f = {
3875
+ ), g = {
3876
3876
  applicantId: e,
3877
3877
  questionnarieId: a.id,
3878
3878
  questionResults: F
3879
3879
  };
3880
- await m(f), t == null || t();
3880
+ await m(g), t == null || t();
3881
3881
  } catch (F) {
3882
3882
  console.error("Questionnaire submit error:", F);
3883
3883
  }
@@ -3886,7 +3886,7 @@ const pn = ({
3886
3886
  "Error loading questionnaire: ",
3887
3887
  d.message
3888
3888
  ] }) }) }) : a ? /* @__PURE__ */ o(ee, { children: [
3889
- /* @__PURE__ */ o(we, { children: [
3889
+ /* @__PURE__ */ o(ke, { children: [
3890
3890
  /* @__PURE__ */ r("h2", { className: "text-lg font-bold", children: a.displayName }),
3891
3891
  a.subtitle && /* @__PURE__ */ r("p", { className: "text-sm", style: { color: "var(--metakyc-text-secondary, #6b7280)" }, children: a.subtitle }),
3892
3892
  S.length > 1 && /* @__PURE__ */ o("div", { className: "flex items-center justify-between mt-3", children: [
@@ -3896,17 +3896,17 @@ const pn = ({
3896
3896
  " of ",
3897
3897
  S.length
3898
3898
  ] }),
3899
- /* @__PURE__ */ r("div", { className: "flex items-center gap-1.5", children: S.map((F, f) => /* @__PURE__ */ r(
3899
+ /* @__PURE__ */ r("div", { className: "flex items-center gap-1.5", children: S.map((F, g) => /* @__PURE__ */ r(
3900
3900
  "div",
3901
3901
  {
3902
3902
  className: "rounded-full transition-all duration-200",
3903
3903
  style: {
3904
3904
  height: "6px",
3905
- width: f === P ? "20px" : "6px",
3906
- backgroundColor: f <= P ? "var(--metakyc-primary, #2563eb)" : "var(--metakyc-border, #e5e7eb)"
3905
+ width: g === P ? "20px" : "6px",
3906
+ backgroundColor: g <= P ? "var(--metakyc-primary, #2563eb)" : "var(--metakyc-border, #e5e7eb)"
3907
3907
  }
3908
3908
  },
3909
- f
3909
+ g
3910
3910
  )) })
3911
3911
  ] })
3912
3912
  ] }),
@@ -3914,19 +3914,19 @@ const pn = ({
3914
3914
  mn,
3915
3915
  {
3916
3916
  question: F,
3917
- value: u[F.id] ?? [],
3917
+ value: p[F.id] ?? [],
3918
3918
  error: D[F.id],
3919
- onChange: (f) => Q(F.id, f)
3919
+ onChange: (g) => Q(F.id, g)
3920
3920
  },
3921
3921
  F.id
3922
3922
  )) }),
3923
- /* @__PURE__ */ o(Ce, { className: "flex items-center justify-between", children: [
3923
+ /* @__PURE__ */ o(Se, { className: "flex items-center justify-between", children: [
3924
3924
  /* @__PURE__ */ o(
3925
3925
  Z,
3926
3926
  {
3927
3927
  type: "button",
3928
3928
  variant: "outline",
3929
- onClick: q,
3929
+ onClick: K,
3930
3930
  style: { display: "flex", alignItems: "center", gap: "4px" },
3931
3931
  children: [
3932
3932
  /* @__PURE__ */ r(_t, { size: 14 }),
@@ -3934,7 +3934,7 @@ const pn = ({
3934
3934
  ]
3935
3935
  }
3936
3936
  ),
3937
- R ? /* @__PURE__ */ r(
3937
+ I ? /* @__PURE__ */ r(
3938
3938
  Z,
3939
3939
  {
3940
3940
  type: "button",
@@ -3946,7 +3946,7 @@ const pn = ({
3946
3946
  Z,
3947
3947
  {
3948
3948
  type: "button",
3949
- onClick: H,
3949
+ onClick: j,
3950
3950
  style: { display: "flex", alignItems: "center", gap: "4px" },
3951
3951
  children: [
3952
3952
  "Next",
@@ -3968,7 +3968,7 @@ const pn = ({
3968
3968
  e.subtitle && /* @__PURE__ */ r("p", { className: "text-xs", style: { color: "var(--metakyc-text-secondary, #6b7280)" }, children: e.subtitle }),
3969
3969
  e.description && /* @__PURE__ */ r("p", { className: "text-xs", style: { color: "var(--metakyc-text-muted, #9ca3af)" }, children: e.description }),
3970
3970
  l === "text" && /* @__PURE__ */ r(
3971
- xe,
3971
+ be,
3972
3972
  {
3973
3973
  value: t[0] ?? "",
3974
3974
  onChange: (d) => a([d.target.value]),
@@ -4037,7 +4037,7 @@ const pn = ({
4037
4037
  type: "checkbox",
4038
4038
  checked: t.includes(d),
4039
4039
  onChange: (m) => {
4040
- m.target.checked ? a([...t, d]) : a(t.filter((u) => u !== d));
4040
+ m.target.checked ? a([...t, d]) : a(t.filter((p) => p !== d));
4041
4041
  },
4042
4042
  className: "metakyc-option-input",
4043
4043
  style: {
@@ -4078,23 +4078,23 @@ const hn = ({
4078
4078
  onComplete: t,
4079
4079
  onBack: n
4080
4080
  }) => {
4081
- const { uploadDocument: a, isLoading: s, isSubmitting: l, error: c, submit: d } = qr(e), [m, u] = v({}), [h, D] = v(null), [x, P] = v(0), [T, S] = v({}), R = Le(
4081
+ const { uploadDocument: a, isLoading: s, isSubmitting: l, error: c, submit: d } = qr(e), [m, p] = k({}), [b, D] = k(null), [x, P] = k(0), [T, S] = k({}), I = Le(
4082
4082
  () => a ? yn(a.uploadDocumentFiles) : [],
4083
4083
  [a]
4084
- ), z = R[x] ?? [], Q = x === R.length - 1, M = R.length, H = re(() => {
4085
- const f = {};
4084
+ ), z = I[x] ?? [], Q = x === I.length - 1, M = I.length, j = ne(() => {
4085
+ const g = {};
4086
4086
  for (const B of z)
4087
- B.isRequired && (m[B.id] || []).length === 0 && (f[B.id] = `${B.displayName} is required`);
4088
- return S(f), Object.keys(f).length === 0;
4089
- }, [z, m]), q = () => {
4090
- H() && (P((f) => f + 1), S({}));
4087
+ B.isRequired && (m[B.id] || []).length === 0 && (g[B.id] = `${B.displayName} is required`);
4088
+ return S(g), Object.keys(g).length === 0;
4089
+ }, [z, m]), K = () => {
4090
+ j() && (P((g) => g + 1), S({}));
4091
4091
  }, X = () => {
4092
- x > 0 ? (P((f) => f - 1), S({})) : n == null || n();
4092
+ x > 0 ? (P((g) => g - 1), S({})) : n == null || n();
4093
4093
  }, F = async () => {
4094
- if (!(!H() || !a)) {
4094
+ if (!(!j() || !a)) {
4095
4095
  D(null);
4096
4096
  try {
4097
- const f = await Promise.all(
4097
+ const g = await Promise.all(
4098
4098
  a.uploadDocumentFiles.map(async (V) => {
4099
4099
  const G = m[V.id] || [], _ = await Promise.all(
4100
4100
  G.map(async (J) => ({
@@ -4110,11 +4110,11 @@ const hn = ({
4110
4110
  ), B = {
4111
4111
  applicantId: e,
4112
4112
  uploadDocumentId: a.id,
4113
- uploadDocumentResults: f
4113
+ uploadDocumentResults: g
4114
4114
  };
4115
4115
  await d(B), t == null || t();
4116
- } catch (f) {
4117
- D((f == null ? void 0 : f.message) || "Failed to submit documents. Please try again.");
4116
+ } catch (g) {
4117
+ D((g == null ? void 0 : g.message) || "Failed to submit documents. Please try again.");
4118
4118
  }
4119
4119
  }
4120
4120
  };
@@ -4145,7 +4145,7 @@ const hn = ({
4145
4145
  /* @__PURE__ */ r("p", { style: { fontSize: "14px", color: "var(--metakyc-danger, #ef4444)", fontWeight: 500 }, children: "Error loading document requirements" }),
4146
4146
  /* @__PURE__ */ r("p", { style: { fontSize: "13px", color: "var(--metakyc-text-muted, #9ca3af)" }, children: c.message })
4147
4147
  ] }) }) }) : a ? /* @__PURE__ */ o(ee, { children: [
4148
- /* @__PURE__ */ o(we, { children: [
4148
+ /* @__PURE__ */ o(ke, { children: [
4149
4149
  /* @__PURE__ */ r("h2", { style: {
4150
4150
  fontSize: "18px",
4151
4151
  fontWeight: 700,
@@ -4169,7 +4169,7 @@ const hn = ({
4169
4169
  " of ",
4170
4170
  M
4171
4171
  ] }),
4172
- /* @__PURE__ */ r("div", { style: { display: "flex", alignItems: "center", gap: "6px" }, children: R.map((f, B) => /* @__PURE__ */ r(
4172
+ /* @__PURE__ */ r("div", { style: { display: "flex", alignItems: "center", gap: "6px" }, children: I.map((g, B) => /* @__PURE__ */ r(
4173
4173
  "div",
4174
4174
  {
4175
4175
  style: {
@@ -4220,27 +4220,27 @@ const hn = ({
4220
4220
  lineHeight: 1.5
4221
4221
  }, children: a.description })
4222
4222
  ] }),
4223
- /* @__PURE__ */ r(te, { children: /* @__PURE__ */ r("div", { style: { display: "flex", flexDirection: "column", gap: "24px" }, children: z.map((f) => /* @__PURE__ */ r(
4223
+ /* @__PURE__ */ r(te, { children: /* @__PURE__ */ r("div", { style: { display: "flex", flexDirection: "column", gap: "24px" }, children: z.map((g) => /* @__PURE__ */ r(
4224
4224
  en,
4225
4225
  {
4226
- label: f.displayName,
4227
- subtitle: f.subtitle,
4228
- accept: f.allowedTypes,
4229
- multiple: f.multipleFile,
4230
- maxSize: f.maxEachFileSizeByte,
4231
- required: f.isRequired,
4232
- error: T[f.id],
4233
- value: m[f.id] || [],
4226
+ label: g.displayName,
4227
+ subtitle: g.subtitle,
4228
+ accept: g.allowedTypes,
4229
+ multiple: g.multipleFile,
4230
+ maxSize: g.maxEachFileSizeByte,
4231
+ required: g.isRequired,
4232
+ error: T[g.id],
4233
+ value: m[g.id] || [],
4234
4234
  onChange: (B) => {
4235
4235
  D(null), S((V) => {
4236
4236
  const G = { ...V };
4237
- return delete G[f.id], G;
4238
- }), u((V) => ({ ...V, [f.id]: B }));
4237
+ return delete G[g.id], G;
4238
+ }), p((V) => ({ ...V, [g.id]: B }));
4239
4239
  }
4240
4240
  },
4241
- f.id
4241
+ g.id
4242
4242
  )) }) }),
4243
- h && /* @__PURE__ */ o("div", { style: {
4243
+ b && /* @__PURE__ */ o("div", { style: {
4244
4244
  margin: "0 24px",
4245
4245
  padding: "10px 14px",
4246
4246
  borderRadius: "8px",
@@ -4255,9 +4255,9 @@ const hn = ({
4255
4255
  /* @__PURE__ */ r("line", { x1: "12", y1: "9", x2: "12", y2: "13" }),
4256
4256
  /* @__PURE__ */ r("line", { x1: "12", y1: "17", x2: "12.01", y2: "17" })
4257
4257
  ] }),
4258
- /* @__PURE__ */ r("p", { style: { fontSize: "13px", color: "var(--metakyc-danger, #ef4444)", margin: 0 }, children: h })
4258
+ /* @__PURE__ */ r("p", { style: { fontSize: "13px", color: "var(--metakyc-danger, #ef4444)", margin: 0 }, children: b })
4259
4259
  ] }),
4260
- /* @__PURE__ */ r(Ce, { children: /* @__PURE__ */ o("div", { style: {
4260
+ /* @__PURE__ */ r(Se, { children: /* @__PURE__ */ o("div", { style: {
4261
4261
  display: "flex",
4262
4262
  alignItems: "center",
4263
4263
  justifyContent: "space-between",
@@ -4284,7 +4284,7 @@ const hn = ({
4284
4284
  Z,
4285
4285
  {
4286
4286
  type: "button",
4287
- onClick: q,
4287
+ onClick: K,
4288
4288
  children: "Next"
4289
4289
  }
4290
4290
  )
@@ -4298,17 +4298,17 @@ const hn = ({
4298
4298
  "Error loading overview: ",
4299
4299
  c.message
4300
4300
  ] }) }) }) : a ? /* @__PURE__ */ o(ee, { children: [
4301
- /* @__PURE__ */ o(we, { children: [
4301
+ /* @__PURE__ */ o(ke, { children: [
4302
4302
  /* @__PURE__ */ r("h2", { className: "text-lg font-bold", children: a.title || "Overview" }),
4303
4303
  a.description && /* @__PURE__ */ r("p", { className: "mt-1", style: { color: "var(--metakyc-text-secondary, #6b7280)" }, children: a.description })
4304
4304
  ] }),
4305
- /* @__PURE__ */ r(te, { className: "space-y-8", children: a.steps && a.steps.length > 0 ? a.steps.sort((u, h) => u.order - h.order).map((u) => /* @__PURE__ */ o("div", { className: "metakyc-overview-step-item flex items-center space-x-3", children: [
4305
+ /* @__PURE__ */ r(te, { className: "space-y-8", children: a.steps && a.steps.length > 0 ? a.steps.sort((p, b) => p.order - b.order).map((p) => /* @__PURE__ */ o("div", { className: "metakyc-overview-step-item flex items-center space-x-3", children: [
4306
4306
  /* @__PURE__ */ r("div", { className: "metakyc-step-icon flex-shrink-0", children: /* @__PURE__ */ r(
4307
4307
  "div",
4308
4308
  {
4309
4309
  className: "w-8 h-8 rounded-full flex items-center justify-center font-medium text-sm",
4310
4310
  style: { backgroundColor: "var(--metakyc-primary, #2563eb)", color: "#ffffff" },
4311
- children: u.order + 1
4311
+ children: p.order + 1
4312
4312
  }
4313
4313
  ) }),
4314
4314
  /* @__PURE__ */ o(
@@ -4322,13 +4322,13 @@ const hn = ({
4322
4322
  background: "transparent"
4323
4323
  },
4324
4324
  children: [
4325
- /* @__PURE__ */ r("span", { className: "metakyc-step-title text-sm font-semibold", style: { color: "var(--metakyc-text-primary, #111827)" }, children: u.title }),
4326
- u.description && /* @__PURE__ */ r("p", { className: "metakyc-step-description text-sm", style: { color: "var(--metakyc-text-secondary, #6b7280)" }, children: u.description })
4325
+ /* @__PURE__ */ r("span", { className: "metakyc-step-title text-sm font-semibold", style: { color: "var(--metakyc-text-primary, #111827)" }, children: p.title }),
4326
+ p.description && /* @__PURE__ */ r("p", { className: "metakyc-step-description text-sm", style: { color: "var(--metakyc-text-secondary, #6b7280)" }, children: p.description })
4327
4327
  ]
4328
4328
  }
4329
4329
  )
4330
- ] }, u.order)) : /* @__PURE__ */ r("div", { className: "text-center py-8", children: /* @__PURE__ */ r("p", { style: { color: "var(--metakyc-text-secondary, #6b7280)" }, children: "Loading overview data..." }) }) }),
4331
- /* @__PURE__ */ o(Ce, { className: "flex justify-between", children: [
4330
+ ] }, p.order)) : /* @__PURE__ */ r("div", { className: "text-center py-8", children: /* @__PURE__ */ r("p", { style: { color: "var(--metakyc-text-secondary, #6b7280)" }, children: "Loading overview data..." }) }) }),
4331
+ /* @__PURE__ */ o(Se, { className: "flex justify-between", children: [
4332
4332
  n && /* @__PURE__ */ r(Z, { type: "button", variant: "outline", onClick: n, children: "Back" }),
4333
4333
  /* @__PURE__ */ r(Z, { onClick: m, isLoading: l, children: "Continue" })
4334
4334
  ] })
@@ -4400,33 +4400,33 @@ const Sn = ({
4400
4400
  onComplete: t,
4401
4401
  onBack: n
4402
4402
  }) => {
4403
- const { config: a } = Ae(), s = a.locale ?? "en", { criteria: l, initialAnswers: c, isLoading: d, isSubmitting: m, error: u, submit: h } = Qr(e), [D, x] = v({}), [P, T] = v({}), [S, R] = v(0), [z, Q] = v(!1);
4404
- Se.useEffect(() => {
4403
+ const { config: a } = Ae(), s = a.locale ?? "en", { criteria: l, initialAnswers: c, isLoading: d, isSubmitting: m, error: p, submit: b } = Qr(e), [D, x] = k({}), [P, T] = k({}), [S, I] = k(0), [z, Q] = k(!1);
4404
+ we.useEffect(() => {
4405
4405
  c && Object.keys(c).length > 0 && Object.keys(D).length === 0 && x(c);
4406
4406
  }, [c]);
4407
4407
  const M = Le(
4408
4408
  () => l && l.length > 0 ? kn(l) : [],
4409
4409
  [l]
4410
- ), H = S === M.length - 1, q = M[S] ?? [];
4411
- Se.useEffect(() => {
4412
- !d && l && l.length === 0 && !z && !m && (Q(!0), h({ applicantId: e, criteriaValueInputs: [] }).then(() => t == null ? void 0 : t()).catch(console.error));
4413
- }, [d, l, z, m, h, e, t]);
4414
- const X = re((G, _) => {
4410
+ ), j = S === M.length - 1, K = M[S] ?? [];
4411
+ we.useEffect(() => {
4412
+ !d && l && l.length === 0 && !z && !m && (Q(!0), b({ applicantId: e, criteriaValueInputs: [] }).then(() => t == null ? void 0 : t()).catch(console.error));
4413
+ }, [d, l, z, m, b, e, t]);
4414
+ const X = ne((G, _) => {
4415
4415
  x((J) => ({ ...J, [G]: _ })), T((J) => {
4416
4416
  const ie = { ...J };
4417
4417
  return delete ie[G], ie;
4418
4418
  });
4419
- }, []), F = re(() => {
4419
+ }, []), F = ne(() => {
4420
4420
  const G = {};
4421
- for (const { criterion: _ } of q) {
4421
+ for (const { criterion: _ } of K) {
4422
4422
  const J = vn(_, D[_.id] ?? []);
4423
4423
  J && (G[_.id] = J);
4424
4424
  }
4425
4425
  return T((_) => ({ ..._, ...G })), Object.keys(G).length === 0;
4426
- }, [q, D]), f = () => {
4427
- F() && R((G) => G + 1);
4426
+ }, [K, D]), g = () => {
4427
+ F() && I((G) => G + 1);
4428
4428
  }, B = () => {
4429
- S > 0 ? R((G) => G - 1) : n == null || n();
4429
+ S > 0 ? I((G) => G - 1) : n == null || n();
4430
4430
  }, V = async () => {
4431
4431
  if (!(!F() || !l))
4432
4432
  try {
@@ -4434,7 +4434,7 @@ const Sn = ({
4434
4434
  const ie = (D[J.id] ?? []).filter((Y) => Y && Y.trim());
4435
4435
  return ie.length > 0 ? { riskCriteriaId: J.id, values: ie } : null;
4436
4436
  }).filter((J) => J !== null);
4437
- await h({ applicantId: e, criteriaValueInputs: G }), t == null || t();
4437
+ await b({ applicantId: e, criteriaValueInputs: G }), t == null || t();
4438
4438
  } catch (G) {
4439
4439
  console.error("Risk scoring submit error:", G);
4440
4440
  }
@@ -4445,11 +4445,11 @@ const Sn = ({
4445
4445
  ] }) }) : !d && l && l.length === 0 ? /* @__PURE__ */ r(ee, { children: /* @__PURE__ */ o(te, { children: [
4446
4446
  /* @__PURE__ */ r(De, { className: "my-8" }),
4447
4447
  /* @__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…" })
4448
- ] }) }) : u ? /* @__PURE__ */ r(ee, { children: /* @__PURE__ */ r(te, { children: /* @__PURE__ */ o("p", { className: "text-danger-500", children: [
4448
+ ] }) }) : p ? /* @__PURE__ */ r(ee, { children: /* @__PURE__ */ r(te, { children: /* @__PURE__ */ o("p", { className: "text-danger-500", children: [
4449
4449
  "Error loading criteria: ",
4450
- u.message
4450
+ p.message
4451
4451
  ] }) }) }) : l ? /* @__PURE__ */ o(ee, { children: [
4452
- /* @__PURE__ */ o(we, { children: [
4452
+ /* @__PURE__ */ o(ke, { children: [
4453
4453
  /* @__PURE__ */ r("h2", { className: "text-lg font-bold", children: "Risk Assessment" }),
4454
4454
  /* @__PURE__ */ r("p", { className: "text-sm", style: { color: "var(--metakyc-text-secondary, #6b7280)" }, children: "Please answer the following questions for risk evaluation" }),
4455
4455
  M.length > 1 && /* @__PURE__ */ o("div", { className: "flex items-center justify-between mt-3", children: [
@@ -4473,7 +4473,7 @@ const Sn = ({
4473
4473
  )) })
4474
4474
  ] })
4475
4475
  ] }),
4476
- /* @__PURE__ */ r(te, { className: "space-y-6", children: q.map(({ criterion: G }) => /* @__PURE__ */ r(
4476
+ /* @__PURE__ */ r(te, { className: "space-y-6", children: K.map(({ criterion: G }) => /* @__PURE__ */ r(
4477
4477
  Cn,
4478
4478
  {
4479
4479
  criterion: G,
@@ -4484,7 +4484,7 @@ const Sn = ({
4484
4484
  },
4485
4485
  G.id
4486
4486
  )) }),
4487
- /* @__PURE__ */ o(Ce, { className: "flex items-center justify-between", children: [
4487
+ /* @__PURE__ */ o(Se, { className: "flex items-center justify-between", children: [
4488
4488
  /* @__PURE__ */ o(
4489
4489
  Z,
4490
4490
  {
@@ -4498,11 +4498,11 @@ const Sn = ({
4498
4498
  ]
4499
4499
  }
4500
4500
  ),
4501
- H ? /* @__PURE__ */ r(Z, { type: "button", isLoading: m, onClick: V, children: "Continue" }) : /* @__PURE__ */ o(
4501
+ j ? /* @__PURE__ */ r(Z, { type: "button", isLoading: m, onClick: V, children: "Continue" }) : /* @__PURE__ */ o(
4502
4502
  Z,
4503
4503
  {
4504
4504
  type: "button",
4505
- onClick: f,
4505
+ onClick: g,
4506
4506
  style: { display: "flex", alignItems: "center", gap: "4px" },
4507
4507
  children: [
4508
4508
  "Next",
@@ -4511,10 +4511,10 @@ const Sn = ({
4511
4511
  }
4512
4512
  )
4513
4513
  ] }),
4514
- u && /* @__PURE__ */ r("div", { className: "mx-6 mb-4 p-3 bg-red-50 border border-red-200 rounded", children: /* @__PURE__ */ r("p", { className: "text-red-600 text-sm", children: u.message }) })
4514
+ p && /* @__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: p.message }) })
4515
4515
  ] }) : null;
4516
4516
  }, Cn = ({ criterion: e, value: t, error: n, locale: a, onChange: s }) => {
4517
- const l = wn(e), c = e.valueDataType === We.Integer || e.valueDataType === We.Money || e.valueDataType === We.DigitOnly, d = bn(e), m = (u) => d ? xn(u, a) : u;
4517
+ const l = wn(e), c = e.valueDataType === We.Integer || e.valueDataType === We.Money || e.valueDataType === We.DigitOnly, d = bn(e), m = (p) => d ? xn(p, a) : p;
4518
4518
  return /* @__PURE__ */ o("div", { className: "space-y-2", children: [
4519
4519
  /* @__PURE__ */ o("label", { className: "block text-sm font-medium", style: { color: "var(--metakyc-text-primary, #111827)" }, children: [
4520
4520
  e.displayName,
@@ -4523,23 +4523,23 @@ const Sn = ({
4523
4523
  e.description && /* @__PURE__ */ r("p", { className: "text-xs", style: { color: "var(--metakyc-text-secondary, #6b7280)" }, children: e.description }),
4524
4524
  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}` }),
4525
4525
  l === "text" && /* @__PURE__ */ r(
4526
- xe,
4526
+ be,
4527
4527
  {
4528
4528
  value: t[0] ?? "",
4529
- onChange: (u) => s([u.target.value]),
4529
+ onChange: (p) => s([p.target.value]),
4530
4530
  type: c ? "number" : "text",
4531
4531
  placeholder: "Enter your answer…",
4532
4532
  error: n,
4533
4533
  required: e.isRequired,
4534
4534
  min: e.min,
4535
4535
  max: e.max,
4536
- onKeyDown: (u) => {
4537
- e.valueDataType === We.DigitOnly && ["e", "E", "+", "-", "."].includes(u.key) && u.preventDefault();
4536
+ onKeyDown: (p) => {
4537
+ e.valueDataType === We.DigitOnly && ["e", "E", "+", "-", "."].includes(p.key) && p.preventDefault();
4538
4538
  }
4539
4539
  }
4540
4540
  ),
4541
4541
  l === "radio" && /* @__PURE__ */ o("div", { className: "metakyc-options-group", style: { display: "flex", flexDirection: "column", gap: "8px" }, children: [
4542
- (e.defaultValues ?? []).map((u) => /* @__PURE__ */ o(
4542
+ (e.defaultValues ?? []).map((p) => /* @__PURE__ */ o(
4543
4543
  "label",
4544
4544
  {
4545
4545
  className: "metakyc-option-label",
@@ -4549,8 +4549,8 @@ const Sn = ({
4549
4549
  "input",
4550
4550
  {
4551
4551
  type: "radio",
4552
- checked: t[0] === u,
4553
- onChange: () => s([u]),
4552
+ checked: t[0] === p,
4553
+ onChange: () => s([p]),
4554
4554
  className: "metakyc-option-input",
4555
4555
  style: {
4556
4556
  width: "16px",
@@ -4567,15 +4567,15 @@ const Sn = ({
4567
4567
  }
4568
4568
  }
4569
4569
  ),
4570
- /* @__PURE__ */ r("span", { className: "metakyc-option-text", style: { fontSize: "14px", color: "var(--metakyc-text-primary, #111827)", lineHeight: "1.4", marginLeft: 0 }, children: m(u) })
4570
+ /* @__PURE__ */ r("span", { className: "metakyc-option-text", style: { fontSize: "14px", color: "var(--metakyc-text-primary, #111827)", lineHeight: "1.4", marginLeft: 0 }, children: m(p) })
4571
4571
  ]
4572
4572
  },
4573
- u
4573
+ p
4574
4574
  )),
4575
4575
  n && /* @__PURE__ */ r("p", { className: "text-sm text-danger-500", children: n })
4576
4576
  ] }),
4577
4577
  l === "checkbox" && /* @__PURE__ */ o("div", { className: "metakyc-options-group", style: { display: "flex", flexDirection: "column", gap: "8px" }, children: [
4578
- (e.defaultValues ?? []).map((u) => /* @__PURE__ */ o(
4578
+ (e.defaultValues ?? []).map((p) => /* @__PURE__ */ o(
4579
4579
  "label",
4580
4580
  {
4581
4581
  className: "metakyc-option-label",
@@ -4585,9 +4585,9 @@ const Sn = ({
4585
4585
  "input",
4586
4586
  {
4587
4587
  type: "checkbox",
4588
- checked: t.includes(u),
4589
- onChange: (h) => {
4590
- h.target.checked ? s([...t, u]) : s(t.filter((D) => D !== u));
4588
+ checked: t.includes(p),
4589
+ onChange: (b) => {
4590
+ b.target.checked ? s([...t, p]) : s(t.filter((D) => D !== p));
4591
4591
  },
4592
4592
  className: "metakyc-option-input",
4593
4593
  style: {
@@ -4605,10 +4605,10 @@ const Sn = ({
4605
4605
  }
4606
4606
  }
4607
4607
  ),
4608
- /* @__PURE__ */ r("span", { className: "metakyc-option-text", style: { fontSize: "14px", color: "var(--metakyc-text-primary, #111827)", lineHeight: "1.4", marginLeft: 0 }, children: m(u) })
4608
+ /* @__PURE__ */ r("span", { className: "metakyc-option-text", style: { fontSize: "14px", color: "var(--metakyc-text-primary, #111827)", lineHeight: "1.4", marginLeft: 0 }, children: m(p) })
4609
4609
  ]
4610
4610
  },
4611
- u
4611
+ p
4612
4612
  )),
4613
4613
  n && /* @__PURE__ */ r("p", { className: "text-sm text-danger-500", children: n })
4614
4614
  ] }),
@@ -4616,7 +4616,7 @@ const Sn = ({
4616
4616
  St,
4617
4617
  {
4618
4618
  value: t[0] ?? "",
4619
- onChange: (u) => s([u.target.value]),
4619
+ onChange: (p) => s([p.target.value]),
4620
4620
  options: [
4621
4621
  { value: "US", label: "United States" },
4622
4622
  { value: "GB", label: "United Kingdom" },
@@ -4635,13 +4635,13 @@ const Sn = ({
4635
4635
  onComplete: t,
4636
4636
  onBack: n
4637
4637
  }) => {
4638
- const { investorCategorizationService: a } = Ae(), [s, l] = v(null), [c, d] = v(!1), [m, u] = v(null);
4638
+ const { investorCategorizationService: a } = Ae(), [s, l] = k(null), [c, d] = k(!1), [m, p] = k(null);
4639
4639
  return /* @__PURE__ */ r("form", { onSubmit: async (D) => {
4640
4640
  if (D.preventDefault(), s === null) {
4641
- u("Please select an investor type");
4641
+ p("Please select an investor type");
4642
4642
  return;
4643
4643
  }
4644
- d(!0), u(null);
4644
+ d(!0), p(null);
4645
4645
  try {
4646
4646
  const x = {
4647
4647
  applicantId: e,
@@ -4651,12 +4651,12 @@ const Sn = ({
4651
4651
  const P = await a.setInvestorCategorization(x);
4652
4652
  console.log("Investor categorization result:", P), t == null || t();
4653
4653
  } catch (x) {
4654
- console.error("Error submitting investor categorization:", x), u(x.message || "Failed to submit investor categorization");
4654
+ console.error("Error submitting investor categorization:", x), p(x.message || "Failed to submit investor categorization");
4655
4655
  } finally {
4656
4656
  d(!1);
4657
4657
  }
4658
4658
  }, children: /* @__PURE__ */ o(ee, { children: [
4659
- /* @__PURE__ */ o(we, { children: [
4659
+ /* @__PURE__ */ o(ke, { children: [
4660
4660
  /* @__PURE__ */ r("h2", { className: "text-lg font-bold", style: { color: "var(--metakyc-text-primary, #111827)" }, children: "Which statement best describes you?" }),
4661
4661
  /* @__PURE__ */ r("p", { className: "mt-2", style: { color: "var(--metakyc-text-secondary, #6b7280)" }, children: "All Tokenise clients are treated as Retail Investors under EU regulation, which gives you the highest level of investor protection. For our internal purposes, we ask you to select the description that best matches your situation" })
4662
4662
  ] }),
@@ -4667,8 +4667,8 @@ const Sn = ({
4667
4667
  {
4668
4668
  className: "block p-4 border-2 rounded-lg cursor-pointer transition-all",
4669
4669
  style: {
4670
- borderColor: s === Re.Individual ? "var(--metakyc-primary, #2563eb)" : "var(--metakyc-border, #e5e7eb)",
4671
- backgroundColor: s === Re.Individual ? "var(--metakyc-primary-light, #dbeafe)" : "transparent"
4670
+ borderColor: s === Ie.Individual ? "var(--metakyc-primary, #2563eb)" : "var(--metakyc-border, #e5e7eb)",
4671
+ backgroundColor: s === Ie.Individual ? "var(--metakyc-primary-light, #dbeafe)" : "transparent"
4672
4672
  },
4673
4673
  children: /* @__PURE__ */ o("div", { className: "flex items-start", children: [
4674
4674
  /* @__PURE__ */ r(
@@ -4676,9 +4676,9 @@ const Sn = ({
4676
4676
  {
4677
4677
  type: "radio",
4678
4678
  name: "investorType",
4679
- value: Re.Individual,
4680
- checked: s === Re.Individual,
4681
- onChange: () => l(Re.Individual),
4679
+ value: Ie.Individual,
4680
+ checked: s === Ie.Individual,
4681
+ onChange: () => l(Ie.Individual),
4682
4682
  className: "mt-1"
4683
4683
  }
4684
4684
  ),
@@ -4694,8 +4694,8 @@ const Sn = ({
4694
4694
  {
4695
4695
  className: "block p-4 border-2 rounded-lg cursor-pointer transition-all",
4696
4696
  style: {
4697
- borderColor: s === Re.Sophisticated ? "var(--metakyc-primary, #2563eb)" : "var(--metakyc-border, #e5e7eb)",
4698
- backgroundColor: s === Re.Sophisticated ? "var(--metakyc-primary-light, #dbeafe)" : "transparent"
4697
+ borderColor: s === Ie.Sophisticated ? "var(--metakyc-primary, #2563eb)" : "var(--metakyc-border, #e5e7eb)",
4698
+ backgroundColor: s === Ie.Sophisticated ? "var(--metakyc-primary-light, #dbeafe)" : "transparent"
4699
4699
  },
4700
4700
  children: /* @__PURE__ */ o("div", { className: "flex items-start", children: [
4701
4701
  /* @__PURE__ */ r(
@@ -4703,9 +4703,9 @@ const Sn = ({
4703
4703
  {
4704
4704
  type: "radio",
4705
4705
  name: "investorType",
4706
- value: Re.Sophisticated,
4707
- checked: s === Re.Sophisticated,
4708
- onChange: () => l(Re.Sophisticated),
4706
+ value: Ie.Sophisticated,
4707
+ checked: s === Ie.Sophisticated,
4708
+ onChange: () => l(Ie.Sophisticated),
4709
4709
  className: "mt-1"
4710
4710
  }
4711
4711
  ),
@@ -4726,8 +4726,8 @@ const Sn = ({
4726
4726
  {
4727
4727
  className: "block p-4 border-2 rounded-lg cursor-pointer transition-all",
4728
4728
  style: {
4729
- borderColor: s === Re.HighNetWorth ? "var(--metakyc-primary, #2563eb)" : "var(--metakyc-border, #e5e7eb)",
4730
- backgroundColor: s === Re.HighNetWorth ? "var(--metakyc-primary-light, #dbeafe)" : "transparent"
4729
+ borderColor: s === Ie.HighNetWorth ? "var(--metakyc-primary, #2563eb)" : "var(--metakyc-border, #e5e7eb)",
4730
+ backgroundColor: s === Ie.HighNetWorth ? "var(--metakyc-primary-light, #dbeafe)" : "transparent"
4731
4731
  },
4732
4732
  children: /* @__PURE__ */ o("div", { className: "flex items-start", children: [
4733
4733
  /* @__PURE__ */ r(
@@ -4735,9 +4735,9 @@ const Sn = ({
4735
4735
  {
4736
4736
  type: "radio",
4737
4737
  name: "investorType",
4738
- value: Re.HighNetWorth,
4739
- checked: s === Re.HighNetWorth,
4740
- onChange: () => l(Re.HighNetWorth),
4738
+ value: Ie.HighNetWorth,
4739
+ checked: s === Ie.HighNetWorth,
4740
+ onChange: () => l(Ie.HighNetWorth),
4741
4741
  className: "mt-1"
4742
4742
  }
4743
4743
  ),
@@ -4758,7 +4758,7 @@ const Sn = ({
4758
4758
  m
4759
4759
  ] }) })
4760
4760
  ] }),
4761
- /* @__PURE__ */ o(Ce, { className: "flex justify-between", children: [
4761
+ /* @__PURE__ */ o(Se, { className: "flex justify-between", children: [
4762
4762
  n && /* @__PURE__ */ r(Z, { type: "button", variant: "outline", onClick: n, children: "Back" }),
4763
4763
  /* @__PURE__ */ r(
4764
4764
  Z,
@@ -4780,20 +4780,20 @@ function xt(e) {
4780
4780
  const t = Math.floor(e / 60), n = e % 60;
4781
4781
  return `${t.toString().padStart(2, "0")}:${n.toString().padStart(2, "0")}`;
4782
4782
  }
4783
- const In = ({
4783
+ const Rn = ({
4784
4784
  applicantId: e,
4785
4785
  onComplete: t,
4786
4786
  onBack: n
4787
4787
  }) => {
4788
- const { appropriatenessTestService: a } = Ae(), [s, l] = v(null), [c, d] = v(!0), [m, u] = v(!1), [h, D] = v(null), [x, P] = v({}), [T, S] = v(0), [R, z] = v(!1), [Q, M] = v(!1), [H, q] = v(0), [X, F] = v(0), [f, B] = v(null);
4789
- he(() => {
4788
+ const { appropriatenessTestService: a } = Ae(), [s, l] = k(null), [c, d] = k(!0), [m, p] = k(!1), [b, D] = k(null), [x, P] = k({}), [T, S] = k(0), [I, z] = k(!1), [Q, M] = k(!1), [j, K] = k(0), [X, F] = k(0), [g, B] = k(null);
4789
+ ge(() => {
4790
4790
  (async () => {
4791
4791
  try {
4792
4792
  d(!0), D(null);
4793
4793
  const $ = await a.getAppropriatenessTest(e);
4794
4794
  if (l($), $.waitTimeSpanForNextTry && $.waitTimeSpanForNextTry !== "00:00:00") {
4795
- const W = At($.waitTimeSpanForNextTry);
4796
- W > 0 && q(W);
4795
+ const H = At($.waitTimeSpanForNextTry);
4796
+ H > 0 && K(H);
4797
4797
  }
4798
4798
  } catch ($) {
4799
4799
  D($.message || "Failed to load appropriateness test");
@@ -4801,54 +4801,54 @@ const In = ({
4801
4801
  d(!1);
4802
4802
  }
4803
4803
  })();
4804
- }, [e, a]), he(() => {
4805
- if (!R || T <= 0) return;
4804
+ }, [e, a]), ge(() => {
4805
+ if (!I || T <= 0) return;
4806
4806
  const $ = setInterval(() => {
4807
- S((W) => W <= 1 ? (M(!0), 0) : W - 1);
4807
+ S((H) => H <= 1 ? (M(!0), 0) : H - 1);
4808
4808
  }, 1e3);
4809
4809
  return () => clearInterval($);
4810
- }, [R, T]), he(() => {
4811
- if (H <= 0) return;
4810
+ }, [I, T]), ge(() => {
4811
+ if (j <= 0) return;
4812
4812
  const $ = setInterval(() => {
4813
- q((W) => W <= 1 ? 0 : W - 1);
4813
+ K((H) => H <= 1 ? 0 : H - 1);
4814
4814
  }, 1e3);
4815
4815
  return () => clearInterval($);
4816
- }, [H]), he(() => {
4816
+ }, [j]), ge(() => {
4817
4817
  Q && !m && J();
4818
4818
  }, [Q]);
4819
4819
  const V = () => {
4820
4820
  s && (z(!0), S(s.testDurationSec), F(0), P({}), D(null));
4821
- }, G = ($, W) => {
4822
- P((ge) => ({ ...ge, [$]: W }));
4823
- }, _ = re(async () => {
4821
+ }, G = ($, H) => {
4822
+ P((he) => ({ ...he, [$]: H }));
4823
+ }, _ = ne(async () => {
4824
4824
  try {
4825
4825
  const $ = await a.getAppropriatenessTest(e);
4826
4826
  if (l($), $.waitTimeSpanForNextTry && $.waitTimeSpanForNextTry !== "00:00:00") {
4827
- const W = At($.waitTimeSpanForNextTry);
4828
- W > 0 && q(W);
4827
+ const H = At($.waitTimeSpanForNextTry);
4828
+ H > 0 && K(H);
4829
4829
  }
4830
4830
  } catch {
4831
4831
  }
4832
4832
  }, [e, a]), J = async ($) => {
4833
4833
  if (s) {
4834
4834
  if (!Q) {
4835
- const W = s.appropriatenessQuestions.length - Object.keys(x).length;
4836
- if (W > 0) {
4837
- D(`Please answer all questions. ${W} remaining.`);
4835
+ const H = s.appropriatenessQuestions.length - Object.keys(x).length;
4836
+ if (H > 0) {
4837
+ D(`Please answer all questions. ${H} remaining.`);
4838
4838
  return;
4839
4839
  }
4840
4840
  }
4841
- u(!0), D(null);
4841
+ p(!0), D(null);
4842
4842
  try {
4843
- const W = s.appropriatenessQuestions.map(
4843
+ const H = s.appropriatenessQuestions.map(
4844
4844
  (E) => ({ appropriatenessQuestionId: E.id, value: x[E.id] || "" })
4845
- ), ge = {
4845
+ ), he = {
4846
4846
  applicantId: e,
4847
4847
  appropriatenessTestId: s.id,
4848
- appropriatenessQuestionResults: W
4848
+ appropriatenessQuestionResults: H
4849
4849
  };
4850
4850
  try {
4851
- const E = await a.fillAppropriatenessTest(ge);
4851
+ const E = await a.fillAppropriatenessTest(he);
4852
4852
  E.isSuccess ? B({ success: !0, message: E.message || "Congratulations! You have passed the test." }) : (B({ success: !1, message: E.message || "You did not pass the test." }), setTimeout(() => _(), 1e3));
4853
4853
  } catch (E) {
4854
4854
  if (E.code === 400 && E.message)
@@ -4856,10 +4856,10 @@ const In = ({
4856
4856
  else
4857
4857
  throw E;
4858
4858
  }
4859
- } catch (W) {
4860
- D(W.message || "Failed to submit test. Please try again."), ie();
4859
+ } catch (H) {
4860
+ D(H.message || "Failed to submit test. Please try again."), ie();
4861
4861
  } finally {
4862
- u(!1);
4862
+ p(!1);
4863
4863
  }
4864
4864
  }
4865
4865
  }, ie = () => {
@@ -4873,12 +4873,12 @@ const In = ({
4873
4873
  if (!s)
4874
4874
  return /* @__PURE__ */ r(ee, { children: /* @__PURE__ */ r(te, { children: /* @__PURE__ */ o("div", { style: { textAlign: "center", padding: "48px 0" }, children: [
4875
4875
  /* @__PURE__ */ r("p", { style: { fontSize: "16px", fontWeight: 600, color: "var(--metakyc-danger, #ef4444)" }, children: "No test data available" }),
4876
- h && /* @__PURE__ */ r("p", { style: { fontSize: "14px", color: "var(--metakyc-text-muted, #9ca3af)", marginTop: "8px" }, children: h })
4876
+ b && /* @__PURE__ */ r("p", { style: { fontSize: "14px", color: "var(--metakyc-text-muted, #9ca3af)", marginTop: "8px" }, children: b })
4877
4877
  ] }) }) });
4878
- const Y = s.testAllowedMaxTry - s.totalFailedTries, ve = s.appropriatenessQuestions.length, ce = Object.keys(x).length;
4879
- if (H > 0)
4878
+ const Y = s.testAllowedMaxTry - s.totalFailedTries, xe = s.appropriatenessQuestions.length, de = Object.keys(x).length;
4879
+ if (j > 0)
4880
4880
  return /* @__PURE__ */ o(ee, { children: [
4881
- /* @__PURE__ */ r(we, { children: /* @__PURE__ */ r("h2", { style: { fontSize: "18px", fontWeight: 700, color: "var(--metakyc-text-primary, #111827)", margin: 0 }, children: s.displayName }) }),
4881
+ /* @__PURE__ */ r(ke, { children: /* @__PURE__ */ r("h2", { style: { fontSize: "18px", fontWeight: 700, color: "var(--metakyc-text-primary, #111827)", margin: 0 }, children: s.displayName }) }),
4882
4882
  /* @__PURE__ */ r(te, { children: /* @__PURE__ */ o("div", { style: { textAlign: "center", padding: "32px 0" }, children: [
4883
4883
  /* @__PURE__ */ r("div", { style: {
4884
4884
  width: "100px",
@@ -4894,19 +4894,19 @@ const In = ({
4894
4894
  fontWeight: 700,
4895
4895
  color: "var(--metakyc-primary, #2563eb)",
4896
4896
  fontVariantNumeric: "tabular-nums"
4897
- }, children: xt(H) }) }),
4897
+ }, children: xt(j) }) }),
4898
4898
  /* @__PURE__ */ r("p", { style: { fontSize: "15px", fontWeight: 500, color: "var(--metakyc-text-primary, #111827)" }, children: "Please wait before retrying" }),
4899
4899
  /* @__PURE__ */ r("p", { style: { fontSize: "13px", color: "var(--metakyc-text-muted, #9ca3af)", marginTop: "4px" }, children: "You can attempt the test again once the timer expires" }),
4900
- h && /* @__PURE__ */ r("div", { style: {
4900
+ b && /* @__PURE__ */ r("div", { style: {
4901
4901
  marginTop: "20px",
4902
4902
  padding: "12px 16px",
4903
4903
  borderRadius: "10px",
4904
4904
  backgroundColor: "color-mix(in srgb, var(--metakyc-danger, #ef4444) 8%, transparent)",
4905
4905
  border: "1px solid color-mix(in srgb, var(--metakyc-danger, #ef4444) 20%, transparent)"
4906
- }, children: /* @__PURE__ */ r("p", { style: { fontSize: "13px", color: "var(--metakyc-danger, #ef4444)", margin: 0 }, children: h }) })
4906
+ }, children: /* @__PURE__ */ r("p", { style: { fontSize: "13px", color: "var(--metakyc-danger, #ef4444)", margin: 0 }, children: b }) })
4907
4907
  ] }) })
4908
4908
  ] });
4909
- if (f) {
4909
+ if (g) {
4910
4910
  const $ = () => {
4911
4911
  B(null), ie(), D(null);
4912
4912
  };
@@ -4926,8 +4926,8 @@ const In = ({
4926
4926
  display: "flex",
4927
4927
  alignItems: "center",
4928
4928
  justifyContent: "center",
4929
- backgroundColor: f.success ? "color-mix(in srgb, var(--metakyc-success, #10b981) 12%, transparent)" : "color-mix(in srgb, var(--metakyc-danger, #ef4444) 10%, transparent)"
4930
- }, children: f.success ? /* @__PURE__ */ o("svg", { width: "36", height: "36", viewBox: "0 0 24 24", fill: "none", stroke: "var(--metakyc-success, #10b981)", strokeWidth: "2.5", strokeLinecap: "round", strokeLinejoin: "round", children: [
4929
+ backgroundColor: g.success ? "color-mix(in srgb, var(--metakyc-success, #10b981) 12%, transparent)" : "color-mix(in srgb, var(--metakyc-danger, #ef4444) 10%, transparent)"
4930
+ }, children: g.success ? /* @__PURE__ */ o("svg", { width: "36", height: "36", viewBox: "0 0 24 24", fill: "none", stroke: "var(--metakyc-success, #10b981)", strokeWidth: "2.5", strokeLinecap: "round", strokeLinejoin: "round", children: [
4931
4931
  /* @__PURE__ */ r("path", { d: "M22 11.08V12a10 10 0 1 1-5.93-9.14" }),
4932
4932
  /* @__PURE__ */ r("polyline", { points: "22 4 12 14.01 9 11.01" })
4933
4933
  ] }) : /* @__PURE__ */ o("svg", { width: "36", height: "36", viewBox: "0 0 24 24", fill: "none", stroke: "var(--metakyc-danger, #ef4444)", strokeWidth: "2.5", strokeLinecap: "round", strokeLinejoin: "round", children: [
@@ -4938,9 +4938,9 @@ const In = ({
4938
4938
  /* @__PURE__ */ r("h2", { style: {
4939
4939
  fontSize: "20px",
4940
4940
  fontWeight: 700,
4941
- color: f.success ? "var(--metakyc-success, #10b981)" : "var(--metakyc-danger, #ef4444)",
4941
+ color: g.success ? "var(--metakyc-success, #10b981)" : "var(--metakyc-danger, #ef4444)",
4942
4942
  margin: 0
4943
- }, children: f.success ? "Test Passed" : "Test Failed" }),
4943
+ }, children: g.success ? "Test Passed" : "Test Failed" }),
4944
4944
  /* @__PURE__ */ r("p", { style: {
4945
4945
  fontSize: "14px",
4946
4946
  color: "var(--metakyc-text-secondary, #6b7280)",
@@ -4948,8 +4948,8 @@ const In = ({
4948
4948
  lineHeight: 1.6,
4949
4949
  maxWidth: "400px",
4950
4950
  whiteSpace: "pre-line"
4951
- }, children: f.message }),
4952
- !f.success && Y > 0 && /* @__PURE__ */ r("div", { style: {
4951
+ }, children: g.message }),
4952
+ !g.success && Y > 0 && /* @__PURE__ */ r("div", { style: {
4953
4953
  marginTop: "4px",
4954
4954
  padding: "10px 20px",
4955
4955
  borderRadius: "10px",
@@ -4966,7 +4966,7 @@ const In = ({
4966
4966
  Y !== 1 ? "s" : "",
4967
4967
  " remaining"
4968
4968
  ] }) }),
4969
- !f.success && Y <= 0 && /* @__PURE__ */ r("div", { style: {
4969
+ !g.success && Y <= 0 && /* @__PURE__ */ r("div", { style: {
4970
4970
  marginTop: "4px",
4971
4971
  padding: "10px 20px",
4972
4972
  borderRadius: "10px",
@@ -4978,16 +4978,16 @@ const In = ({
4978
4978
  margin: 0
4979
4979
  }, children: "No attempts remaining. Please contact support for assistance." }) })
4980
4980
  ] }) }),
4981
- /* @__PURE__ */ r(Ce, { children: /* @__PURE__ */ r("div", { style: { display: "flex", justifyContent: "center", width: "100%", gap: "12px" }, children: f.success ? /* @__PURE__ */ r(Z, { type: "button", onClick: () => t == null ? void 0 : t(), children: "Continue" }) : /* @__PURE__ */ o(ot, { children: [
4982
- Y > 0 && H <= 0 && /* @__PURE__ */ r(Z, { type: "button", onClick: $, children: "Retake Test" }),
4983
- Y > 0 && H > 0 && /* @__PURE__ */ r(Z, { type: "button", onClick: $, children: "OK" }),
4981
+ /* @__PURE__ */ r(Se, { children: /* @__PURE__ */ r("div", { style: { display: "flex", justifyContent: "center", width: "100%", gap: "12px" }, children: g.success ? /* @__PURE__ */ r(Z, { type: "button", onClick: () => t == null ? void 0 : t(), children: "Continue" }) : /* @__PURE__ */ o(ot, { children: [
4982
+ Y > 0 && j <= 0 && /* @__PURE__ */ r(Z, { type: "button", onClick: $, children: "Retake Test" }),
4983
+ Y > 0 && j > 0 && /* @__PURE__ */ r(Z, { type: "button", onClick: $, children: "OK" }),
4984
4984
  Y <= 0 && n && /* @__PURE__ */ r(Z, { type: "button", variant: "outline", onClick: n, children: "Back" })
4985
4985
  ] }) }) })
4986
4986
  ] });
4987
4987
  }
4988
- if (!R)
4988
+ if (!I)
4989
4989
  return /* @__PURE__ */ o(ee, { children: [
4990
- /* @__PURE__ */ o(we, { children: [
4990
+ /* @__PURE__ */ o(ke, { children: [
4991
4991
  /* @__PURE__ */ r("h2", { style: { fontSize: "18px", fontWeight: 700, color: "var(--metakyc-text-primary, #111827)", margin: 0 }, children: s.displayName }),
4992
4992
  s.subtitle && /* @__PURE__ */ r("p", { style: { fontSize: "14px", color: "var(--metakyc-text-secondary, #6b7280)", marginTop: "4px" }, children: s.subtitle })
4993
4993
  ] }),
@@ -5022,7 +5022,7 @@ const In = ({
5022
5022
  }
5023
5023
  )
5024
5024
  ] }),
5025
- h && /* @__PURE__ */ o("div", { style: {
5025
+ b && /* @__PURE__ */ o("div", { style: {
5026
5026
  marginBottom: "16px",
5027
5027
  padding: "12px 14px",
5028
5028
  borderRadius: "10px",
@@ -5039,7 +5039,7 @@ const In = ({
5039
5039
  /* @__PURE__ */ o("p", { style: { fontSize: "13px", color: "var(--metakyc-danger, #ef4444)", margin: 0, lineHeight: 1.5 }, children: [
5040
5040
  /* @__PURE__ */ r("strong", { children: "Previous attempt:" }),
5041
5041
  " ",
5042
- h
5042
+ b
5043
5043
  ] })
5044
5044
  ] }),
5045
5045
  Y <= 0 && /* @__PURE__ */ r("div", { style: {
@@ -5049,14 +5049,14 @@ const In = ({
5049
5049
  border: "1px solid color-mix(in srgb, var(--metakyc-danger, #ef4444) 20%, transparent)"
5050
5050
  }, children: /* @__PURE__ */ r("p", { style: { fontSize: "13px", color: "var(--metakyc-danger, #ef4444)", margin: 0 }, children: "You have used all your attempts. Please contact support for assistance." }) })
5051
5051
  ] }),
5052
- /* @__PURE__ */ r(Ce, { children: /* @__PURE__ */ o("div", { style: { display: "flex", alignItems: "center", justifyContent: n ? "space-between" : "flex-end", width: "100%" }, children: [
5052
+ /* @__PURE__ */ r(Se, { children: /* @__PURE__ */ o("div", { style: { display: "flex", alignItems: "center", justifyContent: n ? "space-between" : "flex-end", width: "100%" }, children: [
5053
5053
  n && /* @__PURE__ */ r(Z, { type: "button", variant: "outline", onClick: n, children: "Back" }),
5054
5054
  /* @__PURE__ */ r(Z, { type: "button", onClick: V, disabled: Y <= 0, children: "Start Test" })
5055
5055
  ] }) })
5056
5056
  ] });
5057
- const me = s.appropriatenessQuestions[X], ke = X === ve - 1, A = ce === ve, U = T <= 60;
5057
+ const pe = s.appropriatenessQuestions[X], ve = X === xe - 1, A = de === xe, U = T <= 60;
5058
5058
  return /* @__PURE__ */ o(ee, { children: [
5059
- /* @__PURE__ */ o(we, { children: [
5059
+ /* @__PURE__ */ o(ke, { children: [
5060
5060
  /* @__PURE__ */ o("div", { style: { display: "flex", alignItems: "center", justifyContent: "space-between" }, children: [
5061
5061
  /* @__PURE__ */ o("div", { children: [
5062
5062
  /* @__PURE__ */ r("h2", { style: { fontSize: "18px", fontWeight: 700, color: "var(--metakyc-text-primary, #111827)", margin: 0 }, children: s.displayName }),
@@ -5064,7 +5064,7 @@ const In = ({
5064
5064
  "Question ",
5065
5065
  X + 1,
5066
5066
  " of ",
5067
- ve
5067
+ xe
5068
5068
  ] })
5069
5069
  ] }),
5070
5070
  /* @__PURE__ */ o("div", { style: {
@@ -5112,7 +5112,7 @@ const In = ({
5112
5112
  height: "100%",
5113
5113
  borderRadius: "999px",
5114
5114
  backgroundColor: "var(--metakyc-primary, #2563eb)",
5115
- width: `${ce / ve * 100}%`,
5115
+ width: `${de / xe * 100}%`,
5116
5116
  transition: "width 0.3s ease"
5117
5117
  } }) }),
5118
5118
  /* @__PURE__ */ o("div", { style: {
@@ -5121,7 +5121,7 @@ const In = ({
5121
5121
  marginTop: "4px"
5122
5122
  }, children: [
5123
5123
  /* @__PURE__ */ o("span", { style: { fontSize: "11px", color: "var(--metakyc-text-muted, #9ca3af)" }, children: [
5124
- ce,
5124
+ de,
5125
5125
  " answered"
5126
5126
  ] }),
5127
5127
  /* @__PURE__ */ o("span", { style: { fontSize: "11px", color: "var(--metakyc-text-muted, #9ca3af)" }, children: [
@@ -5134,33 +5134,33 @@ const In = ({
5134
5134
  ] })
5135
5135
  ] }),
5136
5136
  /* @__PURE__ */ o(te, { children: [
5137
- me && /* @__PURE__ */ r(
5137
+ pe && /* @__PURE__ */ r(
5138
5138
  En,
5139
5139
  {
5140
- question: me,
5140
+ question: pe,
5141
5141
  index: X,
5142
- selectedAnswer: x[me.id],
5143
- onSelect: ($) => G(me.id, $),
5142
+ selectedAnswer: x[pe.id],
5143
+ onSelect: ($) => G(pe.id, $),
5144
5144
  disabled: m
5145
5145
  }
5146
5146
  ),
5147
- ve > 1 && /* @__PURE__ */ r("div", { style: {
5147
+ xe > 1 && /* @__PURE__ */ r("div", { style: {
5148
5148
  display: "flex",
5149
5149
  justifyContent: "center",
5150
5150
  gap: "6px",
5151
5151
  marginTop: "20px",
5152
5152
  flexWrap: "wrap"
5153
- }, children: s.appropriatenessQuestions.map(($, W) => /* @__PURE__ */ r(
5153
+ }, children: s.appropriatenessQuestions.map(($, H) => /* @__PURE__ */ r(
5154
5154
  "button",
5155
5155
  {
5156
5156
  type: "button",
5157
- onClick: () => F(W),
5157
+ onClick: () => F(H),
5158
5158
  style: {
5159
5159
  width: "28px",
5160
5160
  height: "28px",
5161
5161
  borderRadius: "8px",
5162
- border: W === X ? "2px solid var(--metakyc-primary, #2563eb)" : "1px solid var(--metakyc-border, #e5e7eb)",
5163
- backgroundColor: x[$.id] ? W === X ? "color-mix(in srgb, var(--metakyc-primary, #2563eb) 15%, transparent)" : "color-mix(in srgb, var(--metakyc-primary, #2563eb) 8%, transparent)" : W === X ? "var(--metakyc-surface, #f9fafb)" : "var(--metakyc-background, #ffffff)",
5162
+ border: H === X ? "2px solid var(--metakyc-primary, #2563eb)" : "1px solid var(--metakyc-border, #e5e7eb)",
5163
+ backgroundColor: x[$.id] ? H === X ? "color-mix(in srgb, var(--metakyc-primary, #2563eb) 15%, transparent)" : "color-mix(in srgb, var(--metakyc-primary, #2563eb) 8%, transparent)" : H === X ? "var(--metakyc-surface, #f9fafb)" : "var(--metakyc-background, #ffffff)",
5164
5164
  color: x[$.id] ? "var(--metakyc-primary, #2563eb)" : "var(--metakyc-text-muted, #9ca3af)",
5165
5165
  fontSize: "12px",
5166
5166
  fontWeight: 600,
@@ -5171,7 +5171,7 @@ const In = ({
5171
5171
  alignItems: "center",
5172
5172
  justifyContent: "center"
5173
5173
  },
5174
- children: W + 1
5174
+ children: H + 1
5175
5175
  },
5176
5176
  $.id
5177
5177
  )) }),
@@ -5191,15 +5191,15 @@ const In = ({
5191
5191
  ] }),
5192
5192
  /* @__PURE__ */ r("p", { style: { fontSize: "13px", color: "#b45309", margin: 0, fontWeight: 500 }, children: "Time's up! Your answers are being submitted." })
5193
5193
  ] }),
5194
- h && !Q && /* @__PURE__ */ r("div", { style: {
5194
+ b && !Q && /* @__PURE__ */ r("div", { style: {
5195
5195
  marginTop: "16px",
5196
5196
  padding: "12px 14px",
5197
5197
  borderRadius: "10px",
5198
5198
  backgroundColor: "color-mix(in srgb, var(--metakyc-danger, #ef4444) 8%, transparent)",
5199
5199
  border: "1px solid color-mix(in srgb, var(--metakyc-danger, #ef4444) 20%, transparent)"
5200
- }, children: /* @__PURE__ */ r("p", { style: { fontSize: "13px", color: "var(--metakyc-danger, #ef4444)", margin: 0 }, children: h }) })
5200
+ }, children: /* @__PURE__ */ r("p", { style: { fontSize: "13px", color: "var(--metakyc-danger, #ef4444)", margin: 0 }, children: b }) })
5201
5201
  ] }),
5202
- /* @__PURE__ */ r(Ce, { children: /* @__PURE__ */ o("div", { style: { display: "flex", alignItems: "center", justifyContent: "space-between", width: "100%" }, children: [
5202
+ /* @__PURE__ */ r(Se, { children: /* @__PURE__ */ o("div", { style: { display: "flex", alignItems: "center", justifyContent: "space-between", width: "100%" }, children: [
5203
5203
  /* @__PURE__ */ r(
5204
5204
  Z,
5205
5205
  {
@@ -5213,7 +5213,7 @@ const In = ({
5213
5213
  }
5214
5214
  ),
5215
5215
  /* @__PURE__ */ o("div", { style: { display: "flex", gap: "8px" }, children: [
5216
- !ke && /* @__PURE__ */ r(
5216
+ !ve && /* @__PURE__ */ r(
5217
5217
  Z,
5218
5218
  {
5219
5219
  type: "button",
@@ -5221,7 +5221,7 @@ const In = ({
5221
5221
  children: "Next"
5222
5222
  }
5223
5223
  ),
5224
- (ke || A) && /* @__PURE__ */ r(
5224
+ (ve || A) && /* @__PURE__ */ r(
5225
5225
  Z,
5226
5226
  {
5227
5227
  type: "button",
@@ -5235,7 +5235,7 @@ const In = ({
5235
5235
  ] })
5236
5236
  ] }) })
5237
5237
  ] });
5238
- }, Rn = {
5238
+ }, In = {
5239
5239
  questions: /* @__PURE__ */ o("svg", { width: "18", height: "18", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round", children: [
5240
5240
  /* @__PURE__ */ r("path", { d: "M9 11l3 3L22 4" }),
5241
5241
  /* @__PURE__ */ r("path", { d: "M21 12v7a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h11" })
@@ -5267,7 +5267,7 @@ const In = ({
5267
5267
  /* @__PURE__ */ r("div", { style: {
5268
5268
  color: s ? "#f59e0b" : "var(--metakyc-primary, #2563eb)",
5269
5269
  flexShrink: 0
5270
- }, children: Rn[e] }),
5270
+ }, children: In[e] }),
5271
5271
  /* @__PURE__ */ o("div", { children: [
5272
5272
  /* @__PURE__ */ r("p", { style: { fontSize: "12px", color: "var(--metakyc-text-muted, #9ca3af)", margin: 0 }, children: t }),
5273
5273
  /* @__PURE__ */ r("p", { style: {
@@ -5366,10 +5366,10 @@ const In = ({
5366
5366
  onComplete: t,
5367
5367
  onBack: n
5368
5368
  }) => {
5369
- var _e, at, qe, Ge;
5370
- const { applicantService: a, baseInformationService: s, identityService: l, config: c, currentTheme: d } = Ae(), { identityData: m, provider: u, token: h, isLoading: D, error: x, requestIdentity: P, restartIdentity: T } = Yr(e), [S, R] = v(null), [z, Q] = v(null), [M, H] = v([]), [q, X] = v([]), [F, f] = v(!0), [B, V] = v(!1), [G, _] = v(null), [J, ie] = v(!1), Y = Se.useRef(!1), [ve, ce] = v({}), [me, ke] = v({}), A = d != null && d.reviewPageFields && d.reviewPageFields.length > 0 ? d.reviewPageFields[0] : null, U = !!(d != null && d.reviewPageDisabled), $ = le(!1);
5369
+ var Ge, _e, at, qe, Je;
5370
+ const { applicantService: a, baseInformationService: s, identityService: l, config: c, currentTheme: d } = Ae(), { identityData: m, provider: p, token: b, isLoading: D, error: x, requestIdentity: P, restartIdentity: T } = Yr(e), [S, I] = k(null), [z, Q] = k(null), [M, j] = k([]), [K, X] = k([]), [F, g] = k(!0), [B, V] = k(!1), [G, _] = k(null), [J, ie] = k(!1), Y = we.useRef(!1), [xe, de] = k({}), [pe, ve] = k({}), A = d != null && d.reviewPageFields && d.reviewPageFields.length > 0 ? d.reviewPageFields[0] : null, U = !!(d != null && d.reviewPageDisabled), $ = ce(!1);
5371
5371
  $.current = U;
5372
- const W = Qt({
5372
+ const H = Qt({
5373
5373
  defaultValues: {
5374
5374
  street: "",
5375
5375
  streetNumber: "",
@@ -5380,26 +5380,26 @@ const In = ({
5380
5380
  phonenumber: ""
5381
5381
  }
5382
5382
  });
5383
- he(() => {
5383
+ ge(() => {
5384
5384
  if (U) {
5385
- Y.current || (Y.current = !0, P().then(() => V(!0)).catch((O) => console.error("[Identity] Auto-request failed:", O)).finally(() => f(!1)));
5385
+ Y.current || (Y.current = !0, P().then(() => V(!0)).catch((O) => console.error("[Identity] Auto-request failed:", O)).finally(() => g(!1)));
5386
5386
  return;
5387
5387
  }
5388
5388
  (async () => {
5389
5389
  try {
5390
- const [O, K, j] = await Promise.all([
5390
+ const [O, q, W] = await Promise.all([
5391
5391
  a.getApplicantData(e),
5392
5392
  s.getCountries("", "en"),
5393
5393
  s.getCountries("", "en", 40)
5394
5394
  // CountriesType.PhoneNumber
5395
5395
  ]);
5396
5396
  Q(O);
5397
- const p = /* @__PURE__ */ new Set(), k = K.map((N) => ({ value: N.abbreviation3 || N.abbreviation, label: N.name })).filter((N) => !N.value || p.has(N.value) ? !1 : (p.add(N.value), !0));
5398
- H(k);
5399
- const L = /* @__PURE__ */ new Set(), w = j.filter((N) => N.countryCode).map((N) => ({ value: N.countryCode, label: `${N.countryCode} – ${N.name}` })).filter((N) => L.has(N.value) ? !1 : (L.add(N.value), !0));
5397
+ const u = /* @__PURE__ */ new Set(), v = q.map((N) => ({ value: N.abbreviation3 || N.abbreviation, label: N.name })).filter((N) => !N.value || u.has(N.value) ? !1 : (u.add(N.value), !0));
5398
+ j(v);
5399
+ const L = /* @__PURE__ */ new Set(), w = W.filter((N) => N.countryCode).map((N) => ({ value: N.countryCode, label: `${N.countryCode} – ${N.name}` })).filter((N) => L.has(N.value) ? !1 : (L.add(N.value), !0));
5400
5400
  X(w);
5401
5401
  const i = O.applicantRequestData;
5402
- if (ce({
5402
+ if (de({
5403
5403
  firstName: (i == null ? void 0 : i.firstName) || "",
5404
5404
  lastName: (i == null ? void 0 : i.lastName) || "",
5405
5405
  email: (i == null ? void 0 : i.email) || "",
@@ -5421,7 +5421,7 @@ const In = ({
5421
5421
  occupation: (i == null ? void 0 : i.occupation) || "",
5422
5422
  taxNumber: (i == null ? void 0 : i.taxNumber) || "",
5423
5423
  defaultLanguage: (i == null ? void 0 : i.defaultLanguage) || ""
5424
- }), W.reset({
5424
+ }), H.reset({
5425
5425
  street: (i == null ? void 0 : i.street) || "",
5426
5426
  streetNumber: (i == null ? void 0 : i.streetNumber) || "",
5427
5427
  city: (i == null ? void 0 : i.city) || "",
@@ -5440,23 +5440,23 @@ const In = ({
5440
5440
  } catch (O) {
5441
5441
  console.error("Error loading applicant data:", O);
5442
5442
  } finally {
5443
- f(!1);
5443
+ g(!1);
5444
5444
  }
5445
5445
  })();
5446
- }, [e]), he(() => {
5446
+ }, [e]), ge(() => {
5447
5447
  m && !B && $.current && (console.log("[Identity] Review page disabled — showing cached provider"), V(!0));
5448
- }, [m, B]), he(() => {
5449
- if (h) {
5450
- if (h.expiresAt) {
5451
- const y = new Date(h.expiresAt).getTime();
5448
+ }, [m, B]), ge(() => {
5449
+ if (b) {
5450
+ if (b.expiresAt) {
5451
+ const y = new Date(b.expiresAt).getTime();
5452
5452
  if (Date.now() >= y) {
5453
5453
  console.warn("[Identity] Token has expired (expiresAt)"), ie(!0), _("Your verification session has expired. Please restart.");
5454
5454
  return;
5455
5455
  }
5456
5456
  }
5457
- if (h.url)
5457
+ if (b.url)
5458
5458
  try {
5459
- const O = new URL(h.url).toString().toLowerCase();
5459
+ const O = new URL(b.url).toString().toLowerCase();
5460
5460
  if (O.includes("expired") || O.includes("invalid") || O.includes("error")) {
5461
5461
  console.warn("[Identity] Token URL indicates expiration"), ie(!0), _("Your verification link has expired. Please restart.");
5462
5462
  return;
@@ -5464,50 +5464,46 @@ const In = ({
5464
5464
  } catch {
5465
5465
  console.error("[Identity] Invalid token URL");
5466
5466
  }
5467
- if (h.status === "expired" || h.error === "expired" || h.expired === !0) {
5467
+ if (b.status === "expired" || b.error === "expired" || b.expired === !0) {
5468
5468
  console.warn("[Identity] Token object indicates expiration"), ie(!0), _("Your verification session has expired. Please restart.");
5469
5469
  return;
5470
5470
  }
5471
5471
  }
5472
- }, [h]);
5473
- const ge = (h == null ? void 0 : h.accessToken) || (h == null ? void 0 : h.token), E = u !== null && u === Me.Sumsub && !!ge;
5474
- he(() => {
5475
- if (u !== null && h && !S && B && !J) {
5476
- const y = u;
5477
- if (E) {
5478
- console.log("[Sumsub] Initializing Web SDK with accessToken"), _(null);
5479
- try {
5480
- const O = Ye.parseProviderConfig(u, h, c);
5481
- O.onTokenRefresh = () => l.refreshSumsubToken(e);
5482
- const K = Ye.createProvider(u, O);
5483
- K.onComplete((j) => {
5484
- console.log("[Sumsub] Verification complete:", j), t == null || t();
5485
- }), K.onError((j) => {
5486
- console.error("[Sumsub] SDK error:", j), (typeof j == "string" ? j : (j == null ? void 0 : j.message) || "Unknown error").toLowerCase().includes("expired") && (ie(!0), _("Session expired. Please restart."));
5487
- }), K.initialize("sumsub-websdk-container").then(() => {
5488
- console.log("[Sumsub] Web SDK launched"), R(K);
5489
- }).catch((j) => {
5490
- var p;
5491
- console.error("[Sumsub] Initialization error:", j), _(`Failed to initialize: ${j.message}`), (p = j.message) != null && p.toLowerCase().includes("expired") && ie(!0);
5492
- });
5493
- } catch (O) {
5494
- console.error("[Sumsub] Setup error:", O), _(`Configuration error: ${O.message}`);
5495
- }
5472
+ }, [b]);
5473
+ const he = p !== null && p === Me.Sumsub && !!((Ge = c == null ? void 0 : c.identityProviders) != null && Ge.sumsub);
5474
+ ge(() => {
5475
+ if (p !== null && b && !S && B && !J) {
5476
+ const y = p;
5477
+ if (he) {
5478
+ console.log("[Sumsub] Fetching access token for Web SDK"), _(null), (async () => {
5479
+ try {
5480
+ const O = await l.refreshSumsubToken(e), q = Ye.parseProviderConfig(p, b, c);
5481
+ q.accessToken = O, q.onTokenRefresh = () => l.refreshSumsubToken(e);
5482
+ const W = Ye.createProvider(p, q);
5483
+ W.onComplete((u) => {
5484
+ console.log("[Sumsub] Verification complete:", u), t == null || t();
5485
+ }), W.onError((u) => {
5486
+ console.error("[Sumsub] SDK error:", u), (typeof u == "string" ? u : (u == null ? void 0 : u.message) || "Unknown error").toLowerCase().includes("expired") && (ie(!0), _("Session expired. Please restart."));
5487
+ }), await W.initialize("sumsub-websdk-container"), console.log("[Sumsub] Web SDK launched"), I(W);
5488
+ } catch (O) {
5489
+ console.error("[Sumsub] Initialization error:", O), _(`Failed to initialize: ${O.message || O}`), String(O.message || O).toLowerCase().includes("expired") && ie(!0);
5490
+ }
5491
+ })();
5496
5492
  return;
5497
5493
  }
5498
- if (h.url) {
5499
- console.log("[Identity] Loading provider URL for user verification:", h.url), _(null);
5494
+ if (b.url) {
5495
+ console.log("[Identity] Loading provider URL for user verification:", b.url), _(null);
5500
5496
  try {
5501
- if (new URL(h.url), y === Me.SardinAI) {
5497
+ if (new URL(b.url), y === Me.SardinAI) {
5502
5498
  console.log("[SardinAI] Initializing Risk SDK in background...");
5503
5499
  try {
5504
- const O = Ye.parseProviderConfig(u, h, c);
5505
- Ye.createProvider(u, O).initialize().then(() => console.log("[SardinAI] Risk SDK initialized in background")).catch((j) => console.warn("[SardinAI] Risk SDK init failed (non-blocking):", j));
5500
+ const O = Ye.parseProviderConfig(p, b, c);
5501
+ Ye.createProvider(p, O).initialize().then(() => console.log("[SardinAI] Risk SDK initialized in background")).catch((W) => console.warn("[SardinAI] Risk SDK init failed (non-blocking):", W));
5506
5502
  } catch (O) {
5507
5503
  console.warn("[SardinAI] Risk SDK setup failed (non-blocking):", O);
5508
5504
  }
5509
5505
  }
5510
- R({ type: "url", url: h.url });
5506
+ I({ type: "url", url: b.url });
5511
5507
  } catch (O) {
5512
5508
  console.error("[Identity] Invalid URL:", O), _("Invalid verification URL. Please restart."), ie(!0);
5513
5509
  }
@@ -5516,14 +5512,14 @@ const In = ({
5516
5512
  if (y === Me.SardinAI) {
5517
5513
  console.log("[SardinAI] No URL provided - initializing Risk SDK only..."), _(null);
5518
5514
  try {
5519
- const O = Ye.parseProviderConfig(u, h, c), K = Ye.createProvider(u, O);
5520
- K.initialize().then(() => {
5521
- console.log("[SardinAI] Risk SDK initialized successfully"), R(K), setTimeout(() => t == null ? void 0 : t(), 2e3);
5522
- }).catch((j) => {
5523
- var k;
5524
- console.error("[SardinAI] Failed to initialize:", j);
5525
- const p = ((k = j.message) == null ? void 0 : k.toLowerCase()) || "";
5526
- p.includes("expired") || p.includes("invalid") || p.includes("401") || p.includes("400") ? (ie(!0), _("Session expired or invalid. Please restart verification.")) : _(`Failed to initialize: ${j.message}`);
5515
+ const O = Ye.parseProviderConfig(p, b, c), q = Ye.createProvider(p, O);
5516
+ q.initialize().then(() => {
5517
+ console.log("[SardinAI] Risk SDK initialized successfully"), I(q), setTimeout(() => t == null ? void 0 : t(), 2e3);
5518
+ }).catch((W) => {
5519
+ var v;
5520
+ console.error("[SardinAI] Failed to initialize:", W);
5521
+ const u = ((v = W.message) == null ? void 0 : v.toLowerCase()) || "";
5522
+ u.includes("expired") || u.includes("invalid") || u.includes("401") || u.includes("400") ? (ie(!0), _("Session expired or invalid. Please restart verification.")) : _(`Failed to initialize: ${W.message}`);
5527
5523
  });
5528
5524
  } catch (O) {
5529
5525
  console.error("[SardinAI] Error creating provider:", O), _(`Configuration error: ${O.message}`);
@@ -5532,10 +5528,10 @@ const In = ({
5532
5528
  }
5533
5529
  try {
5534
5530
  _(null);
5535
- const O = Ye.parseProviderConfig(u, h, c), K = Ye.createProvider(u, O);
5536
- y === Me.Onfido && K.initialize("identity-container").catch((j) => {
5537
- console.error("[Onfido] Initialization error:", j), _(`Failed to initialize: ${j.message}`);
5538
- }), R(K);
5531
+ const O = Ye.parseProviderConfig(p, b, c), q = Ye.createProvider(p, O);
5532
+ y === Me.Onfido && q.initialize("identity-container").catch((W) => {
5533
+ console.error("[Onfido] Initialization error:", W), _(`Failed to initialize: ${W.message}`);
5534
+ }), I(q);
5539
5535
  } catch (O) {
5540
5536
  console.error("[Identity] Provider setup error:", O), _(`Setup error: ${O.message}`);
5541
5537
  }
@@ -5548,16 +5544,16 @@ const In = ({
5548
5544
  console.error("[Identity] Error destroying provider:", y);
5549
5545
  }
5550
5546
  };
5551
- }, [u, h, S, B, t, J, E, e, c, l]);
5552
- const ne = async () => {
5547
+ }, [p, b, S, B, t, J, he, e, c, l]);
5548
+ const E = async () => {
5553
5549
  try {
5554
5550
  _(null), ie(!1), await P(), V(!0);
5555
5551
  } catch (y) {
5556
5552
  console.error("Error starting identity verification:", y);
5557
5553
  }
5558
- }, de = async () => {
5554
+ }, re = async () => {
5559
5555
  try {
5560
- _(null), ie(!1), R(null), console.log("[Identity] Restarting verification..."), await T(), V(!0);
5556
+ _(null), ie(!1), I(null), console.log("[Identity] Restarting verification..."), await T(), V(!0);
5561
5557
  } catch (y) {
5562
5558
  console.error("Error restarting identity verification:", y), _(y.message || "Failed to restart verification");
5563
5559
  }
@@ -5574,7 +5570,7 @@ const In = ({
5574
5570
  ] }) }) });
5575
5571
  if (B && (G || J))
5576
5572
  return /* @__PURE__ */ o(ee, { children: [
5577
- /* @__PURE__ */ r(we, { children: /* @__PURE__ */ r("h2", { className: "text-2xl font-bold text-gray-900 dark:text-white", children: "Verification Session Issue" }) }),
5573
+ /* @__PURE__ */ r(ke, { children: /* @__PURE__ */ r("h2", { className: "text-2xl font-bold text-gray-900 dark:text-white", children: "Verification Session Issue" }) }),
5578
5574
  /* @__PURE__ */ o(te, { children: [
5579
5575
  /* @__PURE__ */ r("div", { className: "p-4 bg-red-50 dark:bg-red-900/20 border border-red-200 dark:border-red-800 rounded-lg mb-6", children: /* @__PURE__ */ o("div", { className: "flex items-start", children: [
5580
5576
  /* @__PURE__ */ r(
@@ -5609,15 +5605,15 @@ const In = ({
5609
5605
  ] })
5610
5606
  ] })
5611
5607
  ] }),
5612
- /* @__PURE__ */ o(Ce, { className: "flex justify-between", children: [
5608
+ /* @__PURE__ */ o(Se, { className: "flex justify-between", children: [
5613
5609
  n && /* @__PURE__ */ r(Z, { type: "button", variant: "outline", onClick: n, children: "Back" }),
5614
- /* @__PURE__ */ r(Z, { type: "button", onClick: de, disabled: D, children: D ? "Restarting..." : "Restart Verification" })
5610
+ /* @__PURE__ */ r(Z, { type: "button", onClick: re, disabled: D, children: D ? "Restarting..." : "Restart Verification" })
5615
5611
  ] })
5616
5612
  ] });
5617
5613
  if (B && m) {
5618
- const y = u;
5619
- return E ? /* @__PURE__ */ o(ee, { children: [
5620
- /* @__PURE__ */ r(we, { children: /* @__PURE__ */ o("div", { className: "flex items-center justify-between", children: [
5614
+ const y = p;
5615
+ return he ? /* @__PURE__ */ o(ee, { children: [
5616
+ /* @__PURE__ */ r(ke, { children: /* @__PURE__ */ o("div", { className: "flex items-center justify-between", children: [
5621
5617
  /* @__PURE__ */ o("div", { children: [
5622
5618
  /* @__PURE__ */ r("h2", { className: "text-2xl font-bold", style: { color: "var(--metakyc-text-primary, #111827)" }, children: "Identity Verification" }),
5623
5619
  /* @__PURE__ */ r("p", { style: { color: "var(--metakyc-text-secondary, #6b7280)", marginTop: "4px", fontSize: "14px" }, children: "Please complete the identity verification process" })
@@ -5628,7 +5624,7 @@ const In = ({
5628
5624
  type: "button",
5629
5625
  variant: "outline",
5630
5626
  size: "sm",
5631
- onClick: de,
5627
+ onClick: re,
5632
5628
  disabled: D,
5633
5629
  children: "Restart"
5634
5630
  }
@@ -5641,9 +5637,9 @@ const In = ({
5641
5637
  style: { minHeight: "500px", width: "100%" }
5642
5638
  }
5643
5639
  ) }),
5644
- n && /* @__PURE__ */ r(Ce, { children: /* @__PURE__ */ r(Z, { variant: "outline", onClick: n, children: "Back" }) })
5645
- ] }) : h != null && h.url ? /* @__PURE__ */ o(ee, { children: [
5646
- /* @__PURE__ */ r(we, { children: /* @__PURE__ */ o("div", { className: "flex items-center justify-between", children: [
5640
+ n && /* @__PURE__ */ r(Se, { children: /* @__PURE__ */ r(Z, { variant: "outline", onClick: n, children: "Back" }) })
5641
+ ] }) : b != null && b.url ? /* @__PURE__ */ o(ee, { children: [
5642
+ /* @__PURE__ */ r(ke, { children: /* @__PURE__ */ o("div", { className: "flex items-center justify-between", children: [
5647
5643
  /* @__PURE__ */ o("div", { children: [
5648
5644
  /* @__PURE__ */ r("h2", { className: "text-2xl font-bold", children: "Identity Verification" }),
5649
5645
  /* @__PURE__ */ r("p", { className: "text-gray-600 dark:text-gray-400 mt-1", children: "Please complete the identity verification process" })
@@ -5654,7 +5650,7 @@ const In = ({
5654
5650
  type: "button",
5655
5651
  variant: "outline",
5656
5652
  size: "sm",
5657
- onClick: de,
5653
+ onClick: re,
5658
5654
  disabled: D,
5659
5655
  children: "Restart"
5660
5656
  }
@@ -5668,17 +5664,17 @@ const In = ({
5668
5664
  /* @__PURE__ */ r("div", { className: "w-full", style: { height: "600px" }, children: /* @__PURE__ */ r(
5669
5665
  "iframe",
5670
5666
  {
5671
- src: h.url,
5667
+ src: b.url,
5672
5668
  className: "w-full h-full border-0 rounded-lg",
5673
5669
  allow: "camera; microphone; geolocation",
5674
5670
  title: "Identity Verification",
5675
5671
  onLoad: (O) => {
5676
- var K, j, p;
5672
+ var q, W, u;
5677
5673
  console.log("[Identity] Iframe loaded");
5678
5674
  try {
5679
- const k = O.target, L = k.contentDocument || ((K = k.contentWindow) == null ? void 0 : K.document);
5675
+ const v = O.target, L = v.contentDocument || ((q = v.contentWindow) == null ? void 0 : q.document);
5680
5676
  if (L) {
5681
- const w = ((p = (j = L.body) == null ? void 0 : j.textContent) == null ? void 0 : p.toLowerCase()) || "";
5677
+ const w = ((u = (W = L.body) == null ? void 0 : W.textContent) == null ? void 0 : u.toLowerCase()) || "";
5682
5678
  (w.includes("expired") || w.includes("invalid") || w.includes("error")) && (console.warn("[Identity] Iframe shows expiration message"), ie(!0), _("Your verification link has expired."));
5683
5679
  }
5684
5680
  } catch {
@@ -5688,9 +5684,9 @@ const In = ({
5688
5684
  }
5689
5685
  ) })
5690
5686
  ] }),
5691
- n && /* @__PURE__ */ r(Ce, { children: /* @__PURE__ */ r(Z, { variant: "outline", onClick: n, children: "Back" }) })
5687
+ n && /* @__PURE__ */ r(Se, { children: /* @__PURE__ */ r(Z, { variant: "outline", onClick: n, children: "Back" }) })
5692
5688
  ] }) : y === Me.SardinAI ? /* @__PURE__ */ o(ee, { children: [
5693
- /* @__PURE__ */ o(we, { children: [
5689
+ /* @__PURE__ */ o(ke, { children: [
5694
5690
  /* @__PURE__ */ r("h2", { className: "text-2xl font-bold", children: "Device Risk Assessment" }),
5695
5691
  /* @__PURE__ */ r("p", { className: "text-gray-600 dark:text-gray-400 mt-1", children: "Analyzing device security and behavioral patterns..." })
5696
5692
  ] }),
@@ -5700,36 +5696,36 @@ const In = ({
5700
5696
  /* @__PURE__ */ r("p", { className: "text-sm text-gray-500 dark:text-gray-500 mt-2", children: "This process is automatic and will complete in a few seconds" })
5701
5697
  ] }) })
5702
5698
  ] }) : /* @__PURE__ */ o(ee, { children: [
5703
- /* @__PURE__ */ o(we, { children: [
5699
+ /* @__PURE__ */ o(ke, { children: [
5704
5700
  /* @__PURE__ */ r("h2", { className: "text-2xl font-bold", children: "Identity Verification" }),
5705
5701
  /* @__PURE__ */ r("p", { className: "text-gray-600 dark:text-gray-400 mt-1", children: "Please complete the identity verification process" })
5706
5702
  ] }),
5707
5703
  /* @__PURE__ */ r(te, { children: /* @__PURE__ */ r("div", { id: "identity-container", className: "min-h-[400px]" }) }),
5708
- n && /* @__PURE__ */ r(Ce, { children: /* @__PURE__ */ r(Z, { variant: "outline", onClick: n, children: "Back" }) })
5704
+ n && /* @__PURE__ */ r(Se, { children: /* @__PURE__ */ r(Z, { variant: "outline", onClick: n, children: "Back" }) })
5709
5705
  ] });
5710
5706
  }
5711
- const fe = /* @__PURE__ */ new Set(["country", "nationality", "taxCountry", "countryOfBirth", "mobileCountryCode", "otherNationality"]), pe = (y = 4) => ({ 1: "col-span-1", 2: "col-span-2", 3: "col-span-3", 4: "col-span-4" })[y] || "col-span-4", ze = (y, O) => {
5707
+ const me = /* @__PURE__ */ new Set(["country", "nationality", "taxCountry", "countryOfBirth", "mobileCountryCode", "otherNationality"]), se = (y = 4) => ({ 1: "col-span-1", 2: "col-span-2", 3: "col-span-3", 4: "col-span-4" })[y] || "col-span-4", Ce = (y, O) => {
5712
5708
  if (!O && O !== 0) return "—";
5713
- if (fe.has(y) && y !== "mobileCountryCode") {
5714
- const K = M.find((j) => j.value === O);
5715
- return K ? K.label : String(O);
5709
+ if (me.has(y) && y !== "mobileCountryCode") {
5710
+ const q = M.find((W) => W.value === O);
5711
+ return q ? q.label : String(O);
5716
5712
  }
5717
5713
  return String(O);
5718
- }, $e = ({ helpText: y }) => {
5719
- const [O, K] = v(!1), j = le(null), [, p] = v({ top: 0, left: 0 });
5714
+ }, ze = ({ helpText: y }) => {
5715
+ const [O, q] = k(!1), W = ce(null), [, u] = k({ top: 0, left: 0 });
5720
5716
  return /* @__PURE__ */ o(ot, { children: [
5721
5717
  /* @__PURE__ */ r(
5722
5718
  "button",
5723
5719
  {
5724
5720
  type: "button",
5725
5721
  className: "metakyc-help-btn",
5726
- ref: j,
5722
+ ref: W,
5727
5723
  onClick: () => {
5728
- if (j.current) {
5729
- const L = j.current.getBoundingClientRect();
5730
- p({ top: L.bottom + window.scrollY + 6, left: L.left + window.scrollX });
5724
+ if (W.current) {
5725
+ const L = W.current.getBoundingClientRect();
5726
+ u({ top: L.bottom + window.scrollY + 6, left: L.left + window.scrollX });
5731
5727
  }
5732
- K(!0);
5728
+ q(!0);
5733
5729
  },
5734
5730
  style: {
5735
5731
  width: 18,
@@ -5767,7 +5763,7 @@ const In = ({
5767
5763
  alignItems: "center",
5768
5764
  justifyContent: "center"
5769
5765
  },
5770
- onClick: () => K(!1),
5766
+ onClick: () => q(!1),
5771
5767
  children: /* @__PURE__ */ o(
5772
5768
  "div",
5773
5769
  {
@@ -5787,7 +5783,7 @@ const In = ({
5787
5783
  "button",
5788
5784
  {
5789
5785
  type: "button",
5790
- onClick: () => K(!1),
5786
+ onClick: () => q(!1),
5791
5787
  style: {
5792
5788
  marginTop: 12,
5793
5789
  padding: "4px 12px",
@@ -5811,31 +5807,31 @@ const In = ({
5811
5807
  ] });
5812
5808
  }, Ne = (y, O) => O ? /* @__PURE__ */ o("div", { style: { display: "flex", alignItems: "flex-start", gap: 5, flexWrap: "nowrap" }, children: [
5813
5809
  /* @__PURE__ */ r("div", { style: { flex: 1, minWidth: 0 }, children: y }),
5814
- /* @__PURE__ */ r("div", { style: { paddingTop: 24 }, children: /* @__PURE__ */ r($e, { helpText: O }) })
5815
- ] }) : y, rt = (y, O) => {
5816
- const K = `cf-${O}`, j = y.paramName ?? "", p = me[j];
5810
+ /* @__PURE__ */ r("div", { style: { paddingTop: 24 }, children: /* @__PURE__ */ r(ze, { helpText: O }) })
5811
+ ] }) : y, $e = (y, O) => {
5812
+ const q = `cf-${O}`, W = y.paramName ?? "", u = pe[W];
5817
5813
  if (y.customType === "br")
5818
- return /* @__PURE__ */ r("div", { className: pe(y.colSpan), style: { minHeight: "0.5rem" } }, K);
5814
+ return /* @__PURE__ */ r("div", { className: se(y.colSpan), style: { minHeight: "0.5rem" } }, q);
5819
5815
  if (y.customType === "paragraph")
5820
- return /* @__PURE__ */ r("div", { className: pe(y.colSpan), children: /* @__PURE__ */ r(
5816
+ return /* @__PURE__ */ r("div", { className: se(y.colSpan), children: /* @__PURE__ */ r(
5821
5817
  "div",
5822
5818
  {
5823
5819
  className: "text-sm",
5824
5820
  style: { color: "var(--metakyc-text-secondary, #6b7280)" },
5825
5821
  dangerouslySetInnerHTML: { __html: y.label || "" }
5826
5822
  }
5827
- ) }, K);
5823
+ ) }, q);
5828
5824
  if (y.customType === "html")
5829
5825
  return /* @__PURE__ */ r(
5830
5826
  "div",
5831
5827
  {
5832
- className: pe(y.colSpan),
5828
+ className: se(y.colSpan),
5833
5829
  dangerouslySetInnerHTML: { __html: y.label || "" }
5834
5830
  },
5835
- K
5831
+ q
5836
5832
  );
5837
5833
  if (y.customType === "link")
5838
- return /* @__PURE__ */ r("div", { className: pe(y.colSpan), children: Ne(
5834
+ return /* @__PURE__ */ r("div", { className: se(y.colSpan), children: Ne(
5839
5835
  /* @__PURE__ */ r(
5840
5836
  "a",
5841
5837
  {
@@ -5848,17 +5844,17 @@ const In = ({
5848
5844
  }
5849
5845
  ),
5850
5846
  y.helpText
5851
- ) }, K);
5847
+ ) }, q);
5852
5848
  if (y.customType === "checkbox" || y.customType === "link_checkbox") {
5853
- const k = p === "true" || p === !0;
5854
- return /* @__PURE__ */ r("div", { className: pe(y.colSpan), children: Ne(
5849
+ const v = u === "true" || u === !0;
5850
+ return /* @__PURE__ */ r("div", { className: se(y.colSpan), children: Ne(
5855
5851
  /* @__PURE__ */ o("label", { style: { display: "flex", alignItems: "flex-start", gap: 8, cursor: "pointer" }, children: [
5856
5852
  /* @__PURE__ */ r(
5857
5853
  "input",
5858
5854
  {
5859
5855
  type: "checkbox",
5860
- checked: !!k,
5861
- onChange: (L) => ke((w) => ({ ...w, [j]: String(L.target.checked) })),
5856
+ checked: !!v,
5857
+ onChange: (L) => ve((w) => ({ ...w, [W]: String(L.target.checked) })),
5862
5858
  style: {
5863
5859
  width: 16,
5864
5860
  height: 16,
@@ -5874,16 +5870,16 @@ const In = ({
5874
5870
  ] }) : y.displayText || y.label })
5875
5871
  ] }),
5876
5872
  y.helpText
5877
- ) }, K);
5873
+ ) }, q);
5878
5874
  }
5879
5875
  if (y.customType === "group_checkbox") {
5880
- const k = Array.isArray(p) ? p : p ? [p] : [], L = (w) => {
5881
- y.singleSelect ? ke((i) => ({ ...i, [j]: k[0] === w ? [] : [w] })) : ke((i) => ({
5876
+ const v = Array.isArray(u) ? u : u ? [u] : [], L = (w) => {
5877
+ y.singleSelect ? ve((i) => ({ ...i, [W]: v[0] === w ? [] : [w] })) : ve((i) => ({
5882
5878
  ...i,
5883
- [j]: k.includes(w) ? k.filter((b) => b !== w) : [...k, w]
5879
+ [W]: v.includes(w) ? v.filter((f) => f !== w) : [...v, w]
5884
5880
  }));
5885
5881
  };
5886
- return /* @__PURE__ */ r("div", { className: pe(y.colSpan), children: Ne(
5882
+ return /* @__PURE__ */ r("div", { className: se(y.colSpan), children: Ne(
5887
5883
  /* @__PURE__ */ o("div", { className: "space-y-1.5", children: [
5888
5884
  y.label && /* @__PURE__ */ r("p", { className: "text-sm font-medium", style: { color: "var(--metakyc-text-primary, #111827)" }, children: y.displayText || y.label }),
5889
5885
  (y.options || []).map((w) => /* @__PURE__ */ o("label", { style: { display: "flex", alignItems: "flex-start", gap: 8, cursor: "pointer" }, children: [
@@ -5891,7 +5887,7 @@ const In = ({
5891
5887
  "input",
5892
5888
  {
5893
5889
  type: "checkbox",
5894
- checked: k.includes(w.value),
5890
+ checked: v.includes(w.value),
5895
5891
  onChange: () => L(w.value),
5896
5892
  style: { width: 16, height: 16, flexShrink: 0, marginTop: 2, accentColor: "var(--metakyc-primary, #6366f1)" }
5897
5893
  }
@@ -5900,100 +5896,100 @@ const In = ({
5900
5896
  ] }, w.value))
5901
5897
  ] }),
5902
5898
  y.helpText
5903
- ) }, K);
5899
+ ) }, q);
5904
5900
  }
5905
- return y.customType === "radio_group" ? /* @__PURE__ */ r("div", { className: pe(y.colSpan), children: Ne(
5901
+ return y.customType === "radio_group" ? /* @__PURE__ */ r("div", { className: se(y.colSpan), children: Ne(
5906
5902
  /* @__PURE__ */ o("div", { className: "space-y-1.5", children: [
5907
5903
  y.label && /* @__PURE__ */ r("p", { className: "text-sm font-medium", style: { color: "var(--metakyc-text-primary, #111827)" }, children: y.displayText || y.label }),
5908
- (y.options || []).map((k) => /* @__PURE__ */ o("label", { style: { display: "flex", alignItems: "flex-start", gap: 8, cursor: "pointer" }, children: [
5904
+ (y.options || []).map((v) => /* @__PURE__ */ o("label", { style: { display: "flex", alignItems: "flex-start", gap: 8, cursor: "pointer" }, children: [
5909
5905
  /* @__PURE__ */ r(
5910
5906
  "input",
5911
5907
  {
5912
5908
  type: "radio",
5913
- name: `rg-${j}`,
5914
- value: k.value,
5915
- checked: p === k.value,
5916
- onChange: () => ke((L) => ({ ...L, [j]: k.value })),
5909
+ name: `rg-${W}`,
5910
+ value: v.value,
5911
+ checked: u === v.value,
5912
+ onChange: () => ve((L) => ({ ...L, [W]: v.value })),
5917
5913
  style: { width: 16, height: 16, flexShrink: 0, marginTop: 2, accentColor: "var(--metakyc-primary, #6366f1)" }
5918
5914
  }
5919
5915
  ),
5920
- /* @__PURE__ */ r("span", { className: "text-sm", style: { color: "var(--metakyc-text-primary, #111827)" }, children: k.label })
5921
- ] }, k.value))
5916
+ /* @__PURE__ */ r("span", { className: "text-sm", style: { color: "var(--metakyc-text-primary, #111827)" }, children: v.label })
5917
+ ] }, v.value))
5922
5918
  ] }),
5923
5919
  y.helpText
5924
- ) }, K) : /* @__PURE__ */ r("div", { className: pe(y.colSpan), children: Ne(
5920
+ ) }, q) : /* @__PURE__ */ r("div", { className: se(y.colSpan), children: Ne(
5925
5921
  /* @__PURE__ */ r(
5926
- xe,
5922
+ be,
5927
5923
  {
5928
- label: y.displayText || y.label || j,
5929
- value: String(p ?? ""),
5930
- onChange: (k) => ke((L) => ({ ...L, [j]: k.target.value }))
5924
+ label: y.displayText || y.label || W,
5925
+ value: String(u ?? ""),
5926
+ onChange: (v) => ve((L) => ({ ...L, [W]: v.target.value }))
5931
5927
  }
5932
5928
  ),
5933
5929
  y.helpText
5934
- ) }, K);
5930
+ ) }, q);
5935
5931
  }, nt = (y, O) => {
5936
- if (y.isCustom) return rt(y, O);
5937
- const K = y.name ?? "", j = tt[K], p = y.displayText || (j == null ? void 0 : j.label) || K, k = ve[K] ?? "", L = K === "mobileCountryCode", w = !!(j != null && j.countriesType) && !L;
5938
- return y.editable ? L ? /* @__PURE__ */ r("div", { className: pe(y.colSpan ?? 2), children: Ne(
5932
+ if (y.isCustom) return $e(y, O);
5933
+ const q = y.name ?? "", W = rt[q], u = y.displayText || (W == null ? void 0 : W.label) || q, v = xe[q] ?? "", L = q === "mobileCountryCode", w = !!(W != null && W.countriesType) && !L;
5934
+ return y.editable ? L ? /* @__PURE__ */ r("div", { className: se(y.colSpan ?? 2), children: Ne(
5939
5935
  /* @__PURE__ */ r(
5940
5936
  Ue,
5941
5937
  {
5942
- label: p,
5943
- value: String(k),
5944
- onChange: (i) => ce((b) => ({ ...b, [K]: i })),
5945
- options: [{ value: "", label: "Select country code…" }, ...q]
5938
+ label: u,
5939
+ value: String(v),
5940
+ onChange: (i) => de((f) => ({ ...f, [q]: i })),
5941
+ options: [{ value: "", label: "Select country code…" }, ...K]
5946
5942
  }
5947
5943
  ),
5948
5944
  y.helpText
5949
- ) }, `epc-${O}`) : w ? /* @__PURE__ */ r("div", { className: pe(y.colSpan ?? 2), children: Ne(
5945
+ ) }, `epc-${O}`) : w ? /* @__PURE__ */ r("div", { className: se(y.colSpan ?? 2), children: Ne(
5950
5946
  /* @__PURE__ */ r(
5951
5947
  Ue,
5952
5948
  {
5953
- label: p,
5954
- value: String(k),
5955
- onChange: (i) => ce((b) => ({ ...b, [K]: i })),
5956
- options: [{ value: "", label: `Select ${p.toLowerCase()}…` }, ...M]
5949
+ label: u,
5950
+ value: String(v),
5951
+ onChange: (i) => de((f) => ({ ...f, [q]: i })),
5952
+ options: [{ value: "", label: `Select ${u.toLowerCase()}…` }, ...M]
5957
5953
  }
5958
5954
  ),
5959
5955
  y.helpText
5960
- ) }, `ec-${O}`) : /* @__PURE__ */ r("div", { className: pe(y.colSpan ?? 2), children: Ne(
5956
+ ) }, `ec-${O}`) : /* @__PURE__ */ r("div", { className: se(y.colSpan ?? 2), children: Ne(
5961
5957
  /* @__PURE__ */ r(
5962
- xe,
5958
+ be,
5963
5959
  {
5964
- label: p,
5965
- type: (j == null ? void 0 : j.type) === "date" ? "date" : (j == null ? void 0 : j.type) === "email" ? "email" : "text",
5966
- value: String(k),
5967
- onChange: (i) => ce((b) => ({ ...b, [K]: i.target.value }))
5960
+ label: u,
5961
+ type: (W == null ? void 0 : W.type) === "date" ? "date" : (W == null ? void 0 : W.type) === "email" ? "email" : "text",
5962
+ value: String(v),
5963
+ onChange: (i) => de((f) => ({ ...f, [q]: i.target.value }))
5968
5964
  }
5969
5965
  ),
5970
5966
  y.helpText
5971
- ) }, `ei-${O}`) : /* @__PURE__ */ r("div", { className: pe(y.colSpan ?? 2), children: Ne(
5967
+ ) }, `ei-${O}`) : /* @__PURE__ */ r("div", { className: se(y.colSpan ?? 2), children: Ne(
5972
5968
  /* @__PURE__ */ o(ot, { children: [
5973
- /* @__PURE__ */ r("label", { className: "block text-sm font-medium mb-0.5", style: { color: "var(--metakyc-text-secondary, #6b7280)" }, children: p }),
5974
- /* @__PURE__ */ r("p", { className: "text-sm", style: { color: "var(--metakyc-text-primary, #111827)", minHeight: "1.5rem" }, children: ze(K, k) })
5969
+ /* @__PURE__ */ r("label", { className: "block text-sm font-medium mb-0.5", style: { color: "var(--metakyc-text-secondary, #6b7280)" }, children: u }),
5970
+ /* @__PURE__ */ r("p", { className: "text-sm", style: { color: "var(--metakyc-text-primary, #111827)", minHeight: "1.5rem" }, children: Ce(q, v) })
5975
5971
  ] }),
5976
5972
  y.helpText
5977
5973
  ) }, `ro-${O}`);
5978
5974
  };
5979
5975
  if (A) {
5980
5976
  const y = A.title || "Review Your Information", O = A.subtitle || "Please review and confirm your information before starting identity verification";
5981
- return /* @__PURE__ */ r("form", { onSubmit: (K) => {
5982
- K.preventDefault(), ne();
5977
+ return /* @__PURE__ */ r("form", { onSubmit: (q) => {
5978
+ q.preventDefault(), E();
5983
5979
  }, children: /* @__PURE__ */ o(ee, { children: [
5984
- /* @__PURE__ */ o(we, { children: [
5980
+ /* @__PURE__ */ o(ke, { children: [
5985
5981
  /* @__PURE__ */ r("h2", { className: "text-lg font-bold", style: { color: "var(--metakyc-text-primary, #111827)" }, children: y }),
5986
5982
  /* @__PURE__ */ r("p", { className: "mt-1 text-sm", style: { color: "var(--metakyc-text-secondary, #6b7280)" }, children: O })
5987
5983
  ] }),
5988
- /* @__PURE__ */ r(te, { children: /* @__PURE__ */ r("div", { className: "grid grid-cols-4 gap-4", children: A.fields.map((K, j) => nt(K, j)) }) }),
5989
- /* @__PURE__ */ o(Ce, { className: "flex justify-between", children: [
5984
+ /* @__PURE__ */ r(te, { children: /* @__PURE__ */ r("div", { className: "grid grid-cols-4 gap-4", children: A.fields.map((q, W) => nt(q, W)) }) }),
5985
+ /* @__PURE__ */ o(Se, { className: "flex justify-between", children: [
5990
5986
  n && /* @__PURE__ */ r(Z, { type: "button", variant: "outline", onClick: n, children: "Back" }),
5991
5987
  /* @__PURE__ */ r(Z, { type: "submit", isLoading: D, children: "Confirm and Start Verification" })
5992
5988
  ] })
5993
5989
  ] }) });
5994
5990
  }
5995
- return /* @__PURE__ */ r("form", { onSubmit: W.handleSubmit(ne), children: /* @__PURE__ */ o(ee, { children: [
5996
- /* @__PURE__ */ o(we, { children: [
5991
+ return /* @__PURE__ */ r("form", { onSubmit: H.handleSubmit(E), children: /* @__PURE__ */ o(ee, { children: [
5992
+ /* @__PURE__ */ o(ke, { children: [
5997
5993
  /* @__PURE__ */ r("h2", { className: "text-lg font-bold", style: { color: "var(--metakyc-text-primary, #111827)" }, children: "Review Your Information" }),
5998
5994
  /* @__PURE__ */ r("p", { className: "mt-1 text-sm", style: { color: "var(--metakyc-text-secondary, #6b7280)" }, children: "Please review and confirm your information before starting identity verification" })
5999
5995
  ] }),
@@ -6001,7 +5997,7 @@ const In = ({
6001
5997
  /* @__PURE__ */ r("div", { className: "space-y-4 pb-4", style: { borderBottom: "1px solid var(--metakyc-border, #e5e7eb)" }, children: [
6002
5998
  { label: "Name", value: `${((_e = z == null ? void 0 : z.applicantRequestData) == null ? void 0 : _e.firstName) || ""} ${((at = z == null ? void 0 : z.applicantRequestData) == null ? void 0 : at.lastName) || ""}`.trim() },
6003
5999
  { label: "Email", value: (qe = z == null ? void 0 : z.applicantRequestData) == null ? void 0 : qe.email },
6004
- { label: "Date of Birth", value: ((Ge = z == null ? void 0 : z.applicantRequestData) == null ? void 0 : Ge.dateOfBirth) || "Not provided" }
6000
+ { label: "Date of Birth", value: ((Je = z == null ? void 0 : z.applicantRequestData) == null ? void 0 : Je.dateOfBirth) || "Not provided" }
6005
6001
  ].map(({ label: y, value: O }) => /* @__PURE__ */ o("div", { children: [
6006
6002
  /* @__PURE__ */ r("label", { className: "block text-sm font-medium", style: { color: "var(--metakyc-text-secondary, #6b7280)" }, children: y }),
6007
6003
  /* @__PURE__ */ r("p", { className: "mt-1 text-base", style: { color: "var(--metakyc-text-primary, #111827)" }, children: O })
@@ -6010,9 +6006,9 @@ const In = ({
6010
6006
  /* @__PURE__ */ r("h3", { className: "text-base font-semibold", style: { color: "var(--metakyc-text-primary, #111827)" }, children: "Address Information" }),
6011
6007
  /* @__PURE__ */ o("div", { className: "grid grid-cols-1 md:grid-cols-2 gap-4", children: [
6012
6008
  /* @__PURE__ */ r(
6013
- Ze,
6009
+ Xe,
6014
6010
  {
6015
- control: W.control,
6011
+ control: H.control,
6016
6012
  name: "country",
6017
6013
  render: ({ field: y }) => /* @__PURE__ */ r(
6018
6014
  Ue,
@@ -6026,9 +6022,9 @@ const In = ({
6026
6022
  }
6027
6023
  ),
6028
6024
  /* @__PURE__ */ r(
6029
- Ze,
6025
+ Xe,
6030
6026
  {
6031
- control: W.control,
6027
+ control: H.control,
6032
6028
  name: "nationality",
6033
6029
  render: ({ field: y }) => /* @__PURE__ */ r(
6034
6030
  Ue,
@@ -6043,17 +6039,17 @@ const In = ({
6043
6039
  )
6044
6040
  ] }),
6045
6041
  /* @__PURE__ */ o("div", { className: "grid grid-cols-1 md:grid-cols-2 gap-4", children: [
6046
- /* @__PURE__ */ r(Ze, { control: W.control, name: "street", render: ({ field: y }) => /* @__PURE__ */ r(xe, { ...y, label: "Street" }) }),
6047
- /* @__PURE__ */ r(Ze, { control: W.control, name: "streetNumber", render: ({ field: y }) => /* @__PURE__ */ r(xe, { ...y, label: "Street Number" }) })
6042
+ /* @__PURE__ */ r(Xe, { control: H.control, name: "street", render: ({ field: y }) => /* @__PURE__ */ r(be, { ...y, label: "Street" }) }),
6043
+ /* @__PURE__ */ r(Xe, { control: H.control, name: "streetNumber", render: ({ field: y }) => /* @__PURE__ */ r(be, { ...y, label: "Street Number" }) })
6048
6044
  ] }),
6049
6045
  /* @__PURE__ */ o("div", { className: "grid grid-cols-1 md:grid-cols-2 gap-4", children: [
6050
- /* @__PURE__ */ r(Ze, { control: W.control, name: "city", render: ({ field: y }) => /* @__PURE__ */ r(xe, { ...y, label: "City" }) }),
6051
- /* @__PURE__ */ r(Ze, { control: W.control, name: "zip", render: ({ field: y }) => /* @__PURE__ */ r(xe, { ...y, label: "ZIP / Postal Code" }) })
6046
+ /* @__PURE__ */ r(Xe, { control: H.control, name: "city", render: ({ field: y }) => /* @__PURE__ */ r(be, { ...y, label: "City" }) }),
6047
+ /* @__PURE__ */ r(Xe, { control: H.control, name: "zip", render: ({ field: y }) => /* @__PURE__ */ r(be, { ...y, label: "ZIP / Postal Code" }) })
6052
6048
  ] }),
6053
- /* @__PURE__ */ r(Ze, { control: W.control, name: "phonenumber", render: ({ field: y }) => /* @__PURE__ */ r(xe, { ...y, label: "Phone Number", type: "tel" }) })
6049
+ /* @__PURE__ */ r(Xe, { control: H.control, name: "phonenumber", render: ({ field: y }) => /* @__PURE__ */ r(be, { ...y, label: "Phone Number", type: "tel" }) })
6054
6050
  ] })
6055
6051
  ] }),
6056
- /* @__PURE__ */ o(Ce, { className: "flex justify-between", children: [
6052
+ /* @__PURE__ */ o(Se, { className: "flex justify-between", children: [
6057
6053
  n && /* @__PURE__ */ r(Z, { type: "button", variant: "outline", onClick: n, children: "Back" }),
6058
6054
  /* @__PURE__ */ r(Z, { type: "submit", isLoading: D, children: "Confirm and Start Verification" })
6059
6055
  ] })
@@ -6066,42 +6062,42 @@ const In = ({
6066
6062
  onContinue: s,
6067
6063
  onContactSupport: l
6068
6064
  }) => {
6069
- const d = e === Xe.Approved ? {
6065
+ const d = e === et.Approved ? {
6070
6066
  type: "success",
6071
6067
  title: "Verification Approved",
6072
6068
  icon: "✓",
6073
6069
  iconBg: "bg-green-100 dark:bg-green-900/30",
6074
6070
  iconColor: "text-green-600 dark:text-green-400",
6075
6071
  message: "Your identity verification has been successfully approved."
6076
- } : e === Xe.Rejected ? {
6072
+ } : e === et.Rejected ? {
6077
6073
  type: "error",
6078
6074
  title: "Verification Rejected",
6079
6075
  icon: "✕",
6080
6076
  iconBg: "bg-red-100 dark:bg-red-900/30",
6081
6077
  iconColor: "text-red-600 dark:text-red-400",
6082
6078
  message: "Unfortunately, your identity verification was not approved."
6083
- } : e === Xe.Pending || e === Xe.InProgress ? {
6079
+ } : e === et.Pending || e === et.InProgress ? {
6084
6080
  type: "pending",
6085
6081
  title: "Verification Pending",
6086
6082
  icon: "⏱",
6087
6083
  iconBg: "bg-blue-100 dark:bg-blue-900/30",
6088
6084
  iconColor: "text-blue-600 dark:text-blue-400",
6089
6085
  message: "Your identity verification is currently being processed."
6090
- } : t === et.Approved ? {
6086
+ } : t === tt.Approved ? {
6091
6087
  type: "success",
6092
6088
  title: "Application Approved",
6093
6089
  icon: "✓",
6094
6090
  iconBg: "bg-green-100 dark:bg-green-900/30",
6095
6091
  iconColor: "text-green-600 dark:text-green-400",
6096
6092
  message: "Your application has been approved."
6097
- } : t === et.Reject ? {
6093
+ } : t === tt.Reject ? {
6098
6094
  type: "error",
6099
6095
  title: "Application Rejected",
6100
6096
  icon: "✕",
6101
6097
  iconBg: "bg-red-100 dark:bg-red-900/30",
6102
6098
  iconColor: "text-red-600 dark:text-red-400",
6103
6099
  message: "Your application has been rejected."
6104
- } : t === et.UnderReview || t === et.AdminReview ? {
6100
+ } : t === tt.UnderReview || t === tt.AdminReview ? {
6105
6101
  type: "pending",
6106
6102
  title: "Under Review",
6107
6103
  icon: "📋",
@@ -6151,7 +6147,7 @@ const In = ({
6151
6147
  zt,
6152
6148
  {
6153
6149
  variant: d.type === "success" ? "success" : d.type === "error" ? "danger" : d.type === "pending" ? "warning" : "info",
6154
- children: e != null ? Xe[e] : et[t]
6150
+ children: e != null ? et[e] : tt[t]
6155
6151
  }
6156
6152
  ) }),
6157
6153
  /* @__PURE__ */ r("p", { className: "text-center mb-6 max-w-md mx-auto", style: { color: "var(--metakyc-text-secondary, #6b7280)" }, children: a || d.message }),
@@ -6183,15 +6179,15 @@ const In = ({
6183
6179
  /* @__PURE__ */ r("div", { className: "mt-6 pt-6", style: { borderTop: "1px solid var(--metakyc-border, #e5e7eb)" }, children: /* @__PURE__ */ o("div", { className: "grid grid-cols-2 gap-4 text-sm", children: [
6184
6180
  /* @__PURE__ */ o("div", { children: [
6185
6181
  /* @__PURE__ */ r("span", { style: { color: "var(--metakyc-text-muted, #9ca3af)" }, children: "KYC Status:" }),
6186
- /* @__PURE__ */ r("div", { className: "font-medium mt-1", style: { color: "var(--metakyc-text-primary, #111827)" }, children: e != null ? Xe[e] : "Not Available" })
6182
+ /* @__PURE__ */ r("div", { className: "font-medium mt-1", style: { color: "var(--metakyc-text-primary, #111827)" }, children: e != null ? et[e] : "Not Available" })
6187
6183
  ] }),
6188
6184
  /* @__PURE__ */ o("div", { children: [
6189
6185
  /* @__PURE__ */ r("span", { style: { color: "var(--metakyc-text-muted, #9ca3af)" }, children: "Review Status:" }),
6190
- /* @__PURE__ */ r("div", { className: "font-medium mt-1", style: { color: "var(--metakyc-text-primary, #111827)" }, children: et[t] })
6186
+ /* @__PURE__ */ r("div", { className: "font-medium mt-1", style: { color: "var(--metakyc-text-primary, #111827)" }, children: tt[t] })
6191
6187
  ] })
6192
6188
  ] }) })
6193
6189
  ] }),
6194
- /* @__PURE__ */ o(Ce, { className: "flex justify-center gap-4", children: [
6190
+ /* @__PURE__ */ o(Se, { className: "flex justify-center gap-4", children: [
6195
6191
  d.type === "success" && s && /* @__PURE__ */ r(Z, { onClick: s, size: "lg", children: "Continue" }),
6196
6192
  d.type === "error" && /* @__PURE__ */ o(ot, { children: [
6197
6193
  l && /* @__PURE__ */ r(Z, { variant: "outline", onClick: l, children: "Contact Support" }),
@@ -6259,7 +6255,7 @@ const ut = {
6259
6255
  display: "inline-block",
6260
6256
  verticalAlign: "middle"
6261
6257
  }, Tt = ({ helpText: e, children: t }) => {
6262
- const [n, a] = Se.useState(!1);
6258
+ const [n, a] = we.useState(!1);
6263
6259
  if (!e) return /* @__PURE__ */ r(ot, { children: t });
6264
6260
  const s = n ? /* @__PURE__ */ r(
6265
6261
  "div",
@@ -6385,95 +6381,95 @@ const ut = {
6385
6381
  onSuccess: n,
6386
6382
  onCancel: a
6387
6383
  }) => {
6388
- var O, K, j, p, k, L, w;
6389
- const { config: s, baseInformationService: l, currentTheme: c } = Ae(), { createApplicant: d, isLoading: m } = Ot(), u = e || ((O = s.applicantForm) == null ? void 0 : O.workflowKey);
6390
- if (!u)
6384
+ var O, q, W, u, v, L, w;
6385
+ const { config: s, baseInformationService: l, currentTheme: c } = Ae(), { createApplicant: d, isLoading: m } = Ot(), p = e || ((O = s.applicantForm) == null ? void 0 : O.workflowKey);
6386
+ if (!p)
6391
6387
  throw new Error(
6392
6388
  "workflowKey is required. Provide it either as a prop to CreateApplicantForm or set it in config.applicantForm.workflowKey"
6393
6389
  );
6394
- const h = t || ((K = s.applicantForm) == null ? void 0 : K.externalRefId) || "", D = ((j = s.applicantForm) == null ? void 0 : j.email) || "", x = ((p = s.applicantForm) == null ? void 0 : p.hiddenValues) || {}, P = ((k = s.applicantForm) == null ? void 0 : k.initialValues) || {}, S = (((L = s.applicantForm) == null ? void 0 : L.fieldLabelMode) || (c == null ? void 0 : c.fieldLabelMode) || "label") !== "placeholder", R = Le(
6390
+ const b = t || ((q = s.applicantForm) == null ? void 0 : q.externalRefId) || "", D = ((W = s.applicantForm) == null ? void 0 : W.email) || "", x = ((u = s.applicantForm) == null ? void 0 : u.hiddenValues) || {}, P = ((v = s.applicantForm) == null ? void 0 : v.initialValues) || {}, S = (((L = s.applicantForm) == null ? void 0 : L.fieldLabelMode) || (c == null ? void 0 : c.fieldLabelMode) || "label") !== "placeholder", I = Le(
6395
6391
  () => c != null && c.applicantFormPages && c.applicantFormPages.length > 0 ? c.applicantFormPages : null,
6396
6392
  [c == null ? void 0 : c.applicantFormPages]
6397
6393
  ), z = Le(() => {
6398
- const i = new Set(ht), b = c == null ? void 0 : c.applicantFormRequiredFields;
6399
- if (b) for (const N of b) i.add(N);
6400
- if (R)
6401
- for (const N of R)
6402
- for (const g of N.fields)
6403
- !g.isCustom && g.name && g.required && i.add(g.name);
6394
+ const i = new Set(ht), f = c == null ? void 0 : c.applicantFormRequiredFields;
6395
+ if (f) for (const N of f) i.add(N);
6396
+ if (I)
6397
+ for (const N of I)
6398
+ for (const h of N.fields)
6399
+ !h.isCustom && h.name && h.required && i.add(h.name);
6404
6400
  return Array.from(i);
6405
- }, [c == null ? void 0 : c.applicantFormRequiredFields, R]), Q = Le(() => {
6401
+ }, [c == null ? void 0 : c.applicantFormRequiredFields, I]), Q = Le(() => {
6406
6402
  var N;
6407
- if (R) {
6408
- const g = R.flatMap((C) => C.fields).filter((C) => !C.isCustom && C.name).map((C) => C.name), I = new Set(g);
6409
- for (const C of ht) I.add(C);
6410
- return Array.from(I);
6403
+ if (I) {
6404
+ const h = I.flatMap((C) => C.fields).filter((C) => !C.isCustom && C.name).map((C) => C.name), R = new Set(h);
6405
+ for (const C of ht) R.add(C);
6406
+ return Array.from(R);
6411
6407
  }
6412
6408
  let i;
6413
6409
  (N = s.applicantForm) != null && N.visibleFields ? i = s.applicantForm.visibleFields : c != null && c.applicantFormVisibleFields && c.applicantFormVisibleFields.length > 0 ? i = c.applicantFormVisibleFields : i = lr;
6414
- const b = new Set(i);
6415
- for (const g of ht) b.add(g);
6416
- return Array.from(b);
6417
- }, [(w = s.applicantForm) == null ? void 0 : w.visibleFields, c == null ? void 0 : c.applicantFormVisibleFields, R]), M = /* @__PURE__ */ new Set([
6410
+ const f = new Set(i);
6411
+ for (const h of ht) f.add(h);
6412
+ return Array.from(f);
6413
+ }, [(w = s.applicantForm) == null ? void 0 : w.visibleFields, c == null ? void 0 : c.applicantFormVisibleFields, I]), M = /* @__PURE__ */ new Set([
6418
6414
  "country",
6419
6415
  "nationality",
6420
6416
  "taxCountry",
6421
6417
  "countryOfBirth",
6422
6418
  "mobileCountryCode",
6423
6419
  "otherNationality"
6424
- ]), H = Le(() => {
6425
- var b, N;
6420
+ ]), j = Le(() => {
6421
+ var f, N;
6426
6422
  const i = /* @__PURE__ */ new Set();
6427
- if (R)
6428
- for (const g of R)
6429
- for (const I of g.fields)
6430
- !I.isCustom && I.name && M.has(I.name) && i.add(I.countriesType ?? ((b = tt[I.name]) == null ? void 0 : b.countriesType));
6423
+ if (I)
6424
+ for (const h of I)
6425
+ for (const R of h.fields)
6426
+ !R.isCustom && R.name && M.has(R.name) && i.add(R.countriesType ?? ((f = rt[R.name]) == null ? void 0 : f.countriesType));
6431
6427
  else
6432
- for (const g of Q)
6433
- M.has(g) && i.add((N = tt[g]) == null ? void 0 : N.countriesType);
6428
+ for (const h of Q)
6429
+ M.has(h) && i.add((N = rt[h]) == null ? void 0 : N.countriesType);
6434
6430
  return i.size === 0 && i.add(void 0), Array.from(i);
6435
- }, [Q, R]), [q, X] = v({}), [F, f] = v(!0), B = le(/* @__PURE__ */ new Set()), V = le(/* @__PURE__ */ new Set());
6436
- he(() => {
6431
+ }, [Q, I]), [K, X] = k({}), [F, g] = k(!0), B = ce(/* @__PURE__ */ new Set()), V = ce(/* @__PURE__ */ new Set());
6432
+ ge(() => {
6437
6433
  if (!c) return;
6438
- const i = H.filter((g) => {
6439
- const I = g != null ? String(g) : "all";
6440
- return !V.current.has(I) && !B.current.has(I);
6434
+ const i = j.filter((h) => {
6435
+ const R = h != null ? String(h) : "all";
6436
+ return !V.current.has(R) && !B.current.has(R);
6441
6437
  });
6442
6438
  if (i.length === 0) {
6443
- H.every((I) => {
6444
- const C = I != null ? String(I) : "all";
6439
+ j.every((R) => {
6440
+ const C = R != null ? String(R) : "all";
6445
6441
  return V.current.has(C);
6446
- }) && f(!1);
6442
+ }) && g(!1);
6447
6443
  return;
6448
6444
  }
6449
- f(!0);
6450
- const b = i.map((g) => g != null ? String(g) : "all");
6451
- b.forEach((g) => B.current.add(g)), (async () => {
6445
+ g(!0);
6446
+ const f = i.map((h) => h != null ? String(h) : "all");
6447
+ f.forEach((h) => B.current.add(h)), (async () => {
6452
6448
  try {
6453
- const g = await Promise.all(
6454
- i.map(async (I) => {
6455
- const C = I != null ? String(I) : "all", ue = await l.getCountries("", s.locale || "en", I), ae = I === 40, be = /* @__PURE__ */ new Set(), Pe = ue.map((se) => ae && se.countryCode ? {
6456
- value: se.countryCode,
6457
- label: `${se.countryCode} – ${se.name}`
6458
- } : { value: se.abbreviation3 || se.abbreviation, label: se.name }).filter((se) => !se.value || be.has(se.value) ? !1 : (be.add(se.value), !0));
6449
+ const h = await Promise.all(
6450
+ i.map(async (R) => {
6451
+ const C = R != null ? String(R) : "all", ue = await l.getCountries("", s.locale || "en", R), ae = R === 40, fe = /* @__PURE__ */ new Set(), Pe = ue.map((oe) => ae && oe.countryCode ? {
6452
+ value: oe.countryCode,
6453
+ label: `${oe.countryCode} – ${oe.name}`
6454
+ } : { value: oe.abbreviation3 || oe.abbreviation, label: oe.name }).filter((oe) => !oe.value || fe.has(oe.value) ? !1 : (fe.add(oe.value), !0));
6459
6455
  return V.current.add(C), B.current.delete(C), [C, Pe];
6460
6456
  })
6461
6457
  );
6462
- X((I) => ({ ...I, ...Object.fromEntries(g) }));
6463
- } catch (g) {
6464
- b.forEach((I) => B.current.delete(I)), console.error("Failed to load countries:", g);
6458
+ X((R) => ({ ...R, ...Object.fromEntries(h) }));
6459
+ } catch (h) {
6460
+ f.forEach((R) => B.current.delete(R)), console.error("Failed to load countries:", h);
6465
6461
  } finally {
6466
- H.every((I) => {
6467
- const C = I != null ? String(I) : "all";
6462
+ j.every((R) => {
6463
+ const C = R != null ? String(R) : "all";
6468
6464
  return V.current.has(C);
6469
- }) && f(!1);
6465
+ }) && g(!1);
6470
6466
  }
6471
6467
  })();
6472
- }, [H, c]);
6473
- const G = (i, b) => {
6474
- var I;
6475
- const N = b ?? ((I = tt[i]) == null ? void 0 : I.countriesType), g = N != null ? String(N) : "all";
6476
- return q[g] || [];
6468
+ }, [j, c]);
6469
+ const G = (i, f) => {
6470
+ var R;
6471
+ const N = f ?? ((R = rt[i]) == null ? void 0 : R.countriesType), h = N != null ? String(N) : "all";
6472
+ return K[h] || [];
6477
6473
  }, _ = {
6478
6474
  firstName: 1,
6479
6475
  lastName: 1,
@@ -6501,15 +6497,15 @@ const ut = {
6501
6497
  Object.entries(x).filter(([i]) => i in _)
6502
6498
  ), ie = Object.fromEntries(
6503
6499
  Object.entries(P).filter(([i]) => i in _)
6504
- ), [Y, ve] = v({
6505
- workflowKey: u,
6500
+ ), [Y, xe] = k({
6501
+ workflowKey: p,
6506
6502
  firstName: "",
6507
6503
  lastName: "",
6508
6504
  title: "",
6509
6505
  email: D,
6510
6506
  dateOfBirth: "",
6511
6507
  phonenumber: "",
6512
- externalRefId: h,
6508
+ externalRefId: b,
6513
6509
  mobileCountryCode: "",
6514
6510
  street: "",
6515
6511
  streetNumber: "",
@@ -6528,50 +6524,50 @@ const ut = {
6528
6524
  taxNumber: "",
6529
6525
  ...J,
6530
6526
  ...ie
6531
- }), ce = Object.fromEntries(
6527
+ }), de = Object.fromEntries(
6532
6528
  Object.entries(x).filter(([i]) => !(i in J) && i !== "externalRefId" && i !== "workflowKey")
6533
- ), [me, ke] = v({ ...ce }), [A, U] = v(0), [$, W] = v({}), [ge, E] = v(null), [ne, de] = v(!1), fe = (i, b) => ve((N) => ({ ...N, [i]: b })), pe = (i, b) => ke((N) => ({ ...N, [i]: b })), ze = (i) => !i.conditionalOn || me[i.conditionalOn] === "true", $e = R && A < R.length - 1 ? A + 1 : -1, Ne = R && A > 0 ? A - 1 : -1, rt = (i) => {
6529
+ ), [pe, ve] = k({ ...de }), [A, U] = k(0), [$, H] = k({}), [he, E] = k(null), [re, me] = k(!1), se = (i, f) => xe((N) => ({ ...N, [i]: f })), Ce = (i, f) => ve((N) => ({ ...N, [i]: f })), ze = (i) => !i.conditionalOn || pe[i.conditionalOn] === "true", Ne = I && A < I.length - 1 ? A + 1 : -1, $e = I && A > 0 ? A - 1 : -1, nt = (i) => {
6534
6530
  var N;
6535
- const b = {};
6536
- for (const g of i.fields)
6537
- if (g.isCustom) {
6538
- if (g.customType === "paragraph" || g.customType === "html" || g.customType === "br" || g.customType === "link") continue;
6539
- if (g.required && g.paramName) {
6540
- const I = me[g.paramName], C = g.displayText || g.label || g.paramName;
6541
- g.customType === "checkbox" || g.customType === "link_checkbox" ? I !== "true" && (b[g.paramName] = `${C} is required.`) : (!I || I.trim() === "") && (b[g.paramName] = `${C} is required.`);
6531
+ const f = {};
6532
+ for (const h of i.fields)
6533
+ if (h.isCustom) {
6534
+ if (h.customType === "paragraph" || h.customType === "html" || h.customType === "br" || h.customType === "link") continue;
6535
+ if (h.required && h.paramName) {
6536
+ const R = pe[h.paramName], C = h.displayText || h.label || h.paramName;
6537
+ h.customType === "checkbox" || h.customType === "link_checkbox" ? R !== "true" && (f[h.paramName] = `${C} is required.`) : (!R || R.trim() === "") && (f[h.paramName] = `${C} is required.`);
6542
6538
  }
6543
- } else if (g.name) {
6544
- const I = g.name;
6545
- if (z.includes(I) && st(Y[I])) {
6546
- const C = g.displayText || ((N = tt[I]) == null ? void 0 : N.label) || I;
6547
- b[I] = `${C} is required.`;
6539
+ } else if (h.name) {
6540
+ const R = h.name;
6541
+ if (z.includes(R) && st(Y[R])) {
6542
+ const C = h.displayText || ((N = rt[R]) == null ? void 0 : N.label) || R;
6543
+ f[R] = `${C} is required.`;
6548
6544
  }
6549
6545
  }
6550
- return b;
6551
- }, nt = async () => {
6552
- if (!R) return;
6553
- const i = R[A];
6546
+ return f;
6547
+ }, Ge = async () => {
6548
+ if (!I) return;
6549
+ const i = I[A];
6554
6550
  if (i.conditionalOn && !ze(i)) {
6555
- W({}), $e >= 0 ? U($e) : await _e();
6551
+ H({}), Ne >= 0 ? U(Ne) : await _e();
6556
6552
  return;
6557
6553
  }
6558
- const b = rt(i);
6559
- if (Object.keys(b).length > 0) {
6560
- W(b);
6554
+ const f = nt(i);
6555
+ if (Object.keys(f).length > 0) {
6556
+ H(f);
6561
6557
  return;
6562
6558
  }
6563
- W({}), $e >= 0 ? U($e) : await _e();
6559
+ H({}), Ne >= 0 ? U(Ne) : await _e();
6564
6560
  }, _e = async () => {
6565
- if (R) {
6561
+ if (I) {
6566
6562
  let i = {};
6567
- for (const b of R)
6568
- ze(b) && (i = { ...i, ...rt(b) });
6563
+ for (const f of I)
6564
+ ze(f) && (i = { ...i, ...nt(f) });
6569
6565
  if (Object.keys(i).length > 0) {
6570
- W(i);
6566
+ H(i);
6571
6567
  return;
6572
6568
  }
6573
6569
  }
6574
- de(!0), E(null);
6570
+ me(!0), E(null);
6575
6571
  try {
6576
6572
  if (!Y.externalRefId || Y.externalRefId.trim() === "") {
6577
6573
  E("External Reference ID is required. Please pass it via config.applicantForm.externalRefId.");
@@ -6581,85 +6577,85 @@ const ut = {
6581
6577
  workflowKey: Y.workflowKey,
6582
6578
  externalRefId: Y.externalRefId.trim()
6583
6579
  };
6584
- if (R) {
6585
- for (const I of R)
6586
- if (ze(I)) {
6587
- for (const C of I.fields)
6580
+ if (I) {
6581
+ for (const R of I)
6582
+ if (ze(R)) {
6583
+ for (const C of R.fields)
6588
6584
  if (!C.isCustom && C.name) {
6589
6585
  const ue = C.name, ae = Y[ue];
6590
6586
  st(ae) || (i[ue] = ae);
6591
6587
  }
6592
6588
  }
6593
- for (const I of ht)
6594
- if (i[I] === void 0) {
6595
- const C = Y[I];
6596
- st(C) || (i[I] = C);
6589
+ for (const R of ht)
6590
+ if (i[R] === void 0) {
6591
+ const C = Y[R];
6592
+ st(C) || (i[R] = C);
6597
6593
  }
6598
6594
  } else
6599
- Q.forEach((I) => {
6600
- if (I === "externalRefId") return;
6601
- const C = Y[I];
6602
- st(C) || (i[I] = C);
6595
+ Q.forEach((R) => {
6596
+ if (R === "externalRefId") return;
6597
+ const C = Y[R];
6598
+ st(C) || (i[R] = C);
6603
6599
  });
6604
- const b = [];
6605
- if (R) {
6606
- for (const I of R)
6607
- if (ze(I))
6608
- for (const C of I.fields) {
6600
+ const f = [];
6601
+ if (I) {
6602
+ for (const R of I)
6603
+ if (ze(R))
6604
+ for (const C of R.fields) {
6609
6605
  if (!C.isCustom || !C.paramName || C.customType === "paragraph" || C.customType === "html" || C.customType === "br" || C.customType === "link") continue;
6610
- const ue = me[C.paramName] ?? "";
6606
+ const ue = pe[C.paramName] ?? "";
6611
6607
  let ae;
6612
6608
  if (C.customType === "checkbox" || C.customType === "link_checkbox")
6613
6609
  ae = ue === "true" ? "yes" : "no";
6614
6610
  else if (ae = ue, !ae && !C.required) continue;
6615
- b.push({ paramName: C.paramName, value: ae });
6611
+ f.push({ paramName: C.paramName, value: ae });
6616
6612
  }
6617
6613
  }
6618
- for (const [I, C] of Object.entries(J))
6619
- i[I] === void 0 && !st(C) && (i[I] = C);
6620
- const N = new Set(b.map((I) => I.paramName));
6621
- for (const [I, C] of Object.entries(ce))
6622
- !N.has(I) && C && b.push({ paramName: I, value: C });
6623
- b.length > 0 && (i.applicantAdditionalDatas = b);
6624
- const g = await d(i);
6625
- n(g.applicantId);
6614
+ for (const [R, C] of Object.entries(J))
6615
+ i[R] === void 0 && !st(C) && (i[R] = C);
6616
+ const N = new Set(f.map((R) => R.paramName));
6617
+ for (const [R, C] of Object.entries(de))
6618
+ !N.has(R) && C && f.push({ paramName: R, value: C });
6619
+ f.length > 0 && (i.applicantAdditionalDatas = f);
6620
+ const h = await d(i);
6621
+ n(h.applicantId);
6626
6622
  } catch (i) {
6627
6623
  console.error("Error creating applicant:", i), E(i.message || "Failed to create applicant");
6628
6624
  } finally {
6629
- de(!1);
6625
+ me(!1);
6630
6626
  }
6631
6627
  }, at = async (i) => {
6632
- var b;
6628
+ var f;
6633
6629
  i.preventDefault();
6634
6630
  for (const N of z)
6635
6631
  if (st(Y[N])) {
6636
- const g = ((b = tt[N]) == null ? void 0 : b.label) || N;
6637
- E(`${g} is required.`);
6632
+ const h = ((f = rt[N]) == null ? void 0 : f.label) || N;
6633
+ E(`${h} is required.`);
6638
6634
  return;
6639
6635
  }
6640
6636
  await _e();
6641
- }, qe = (i, b, N, g, I) => {
6637
+ }, qe = (i, f, N, h, R) => {
6642
6638
  var Ct;
6643
- const C = tt[i];
6639
+ const C = rt[i];
6644
6640
  if (!C) return null;
6645
- const ue = z.includes(i), ae = $[i], be = N || C.label, Pe = i in ie, se = b ?? i, Be = { required: ue }, je = I ? I !== "placeholder" : S, Ve = je ? be : void 0, Ht = je ? "..." : be;
6641
+ const ue = z.includes(i), ae = $[i], fe = N || C.label, Pe = i in ie, oe = f ?? i, Be = { required: ue }, je = R ? R !== "placeholder" : S, Ve = je ? fe : void 0, Ht = je ? "..." : fe;
6646
6642
  switch (C.type) {
6647
6643
  case "select":
6648
6644
  if (i === "country" || i === "nationality" || i === "taxCountry" || i === "countryOfBirth" || i === "mobileCountryCode") {
6649
- const Ie = G(i, g);
6645
+ const Re = G(i, h);
6650
6646
  return /* @__PURE__ */ r(
6651
6647
  Ue,
6652
6648
  {
6653
6649
  ...Be,
6654
6650
  label: Ve,
6655
6651
  value: Y[i] || "",
6656
- onChange: (Je) => fe(i, Je),
6657
- options: [{ value: "", label: `Select ${Ht.toLowerCase()}` }, ...Ie],
6652
+ onChange: (Ze) => se(i, Ze),
6653
+ options: [{ value: "", label: `Select ${Ht.toLowerCase()}` }, ...Re],
6658
6654
  disabled: F,
6659
6655
  readOnly: Pe,
6660
6656
  error: ae
6661
6657
  },
6662
- se
6658
+ oe
6663
6659
  );
6664
6660
  }
6665
6661
  if (i === "salutation")
@@ -6669,9 +6665,9 @@ const ut = {
6669
6665
  ...Be,
6670
6666
  label: Ve,
6671
6667
  value: ((Ct = Y[i]) == null ? void 0 : Ct.toString()) || "",
6672
- onChange: (Ie) => fe(i, Ie ? Number(Ie) : null),
6668
+ onChange: (Re) => se(i, Re ? Number(Re) : null),
6673
6669
  options: [
6674
- { value: "", label: je ? "Select salutation..." : be },
6670
+ { value: "", label: je ? "Select salutation..." : fe },
6675
6671
  { value: ft.Male.toString(), label: "Male" },
6676
6672
  { value: ft.Female.toString(), label: "Female" },
6677
6673
  { value: ft.Other.toString(), label: "Other" }
@@ -6679,106 +6675,106 @@ const ut = {
6679
6675
  readOnly: Pe,
6680
6676
  error: ae
6681
6677
  },
6682
- se
6678
+ oe
6683
6679
  );
6684
6680
  if (i === "defaultLanguage") {
6685
- const Ie = c != null && c.allowedLanguages && c.allowedLanguages.length > 0 ? It.filter((Je) => c.allowedLanguages.includes(Je.value)) : It;
6681
+ const Re = c != null && c.allowedLanguages && c.allowedLanguages.length > 0 ? Rt.filter((Ze) => c.allowedLanguages.includes(Ze.value)) : Rt;
6686
6682
  return /* @__PURE__ */ r(
6687
6683
  Ue,
6688
6684
  {
6689
6685
  ...Be,
6690
6686
  label: Ve,
6691
6687
  value: Y[i] || "",
6692
- onChange: (Je) => fe(i, Je),
6693
- options: [{ value: "", label: je ? "Select language..." : be }, ...Ie],
6688
+ onChange: (Ze) => se(i, Ze),
6689
+ options: [{ value: "", label: je ? "Select language..." : fe }, ...Re],
6694
6690
  readOnly: Pe,
6695
6691
  error: ae
6696
6692
  },
6697
- se
6693
+ oe
6698
6694
  );
6699
6695
  }
6700
6696
  return null;
6701
6697
  case "multiselect":
6702
6698
  if (i === "otherNationality") {
6703
- const Ie = G(i, g);
6699
+ const Re = G(i, h);
6704
6700
  return /* @__PURE__ */ r(
6705
6701
  Zr,
6706
6702
  {
6707
6703
  ...Be,
6708
6704
  label: Ve,
6709
6705
  value: Y[i] || [],
6710
- onChange: (Je) => fe(i, Je),
6711
- options: Ie,
6712
- placeholder: je ? "Select other nationalities..." : be,
6706
+ onChange: (Ze) => se(i, Ze),
6707
+ options: Re,
6708
+ placeholder: je ? "Select other nationalities..." : fe,
6713
6709
  disabled: F,
6714
6710
  readOnly: Pe
6715
6711
  },
6716
- se
6712
+ oe
6717
6713
  );
6718
6714
  }
6719
6715
  return null;
6720
6716
  case "date":
6721
6717
  return /* @__PURE__ */ r(
6722
- xe,
6718
+ be,
6723
6719
  {
6724
6720
  ...Be,
6725
6721
  type: "date",
6726
6722
  label: Ve,
6727
- placeholder: je ? void 0 : be,
6723
+ placeholder: je ? void 0 : fe,
6728
6724
  value: Y[i] || "",
6729
- onChange: (Ie) => fe(i, Ie.target.value),
6725
+ onChange: (Re) => se(i, Re.target.value),
6730
6726
  readOnly: Pe,
6731
6727
  error: ae
6732
6728
  },
6733
- se
6729
+ oe
6734
6730
  );
6735
6731
  case "email":
6736
6732
  return /* @__PURE__ */ r(
6737
- xe,
6733
+ be,
6738
6734
  {
6739
6735
  ...Be,
6740
6736
  type: "email",
6741
6737
  label: Ve,
6742
- placeholder: je ? void 0 : be,
6738
+ placeholder: je ? void 0 : fe,
6743
6739
  value: Y[i] || "",
6744
- onChange: (Ie) => fe(i, Ie.target.value),
6740
+ onChange: (Re) => se(i, Re.target.value),
6745
6741
  readOnly: Pe,
6746
6742
  error: ae
6747
6743
  },
6748
- se
6744
+ oe
6749
6745
  );
6750
6746
  case "tel":
6751
6747
  return /* @__PURE__ */ r(
6752
- xe,
6748
+ be,
6753
6749
  {
6754
6750
  ...Be,
6755
6751
  type: "tel",
6756
6752
  label: Ve,
6757
- placeholder: je ? void 0 : be,
6753
+ placeholder: je ? void 0 : fe,
6758
6754
  value: Y[i] || "",
6759
- onChange: (Ie) => fe(i, Ie.target.value),
6755
+ onChange: (Re) => se(i, Re.target.value),
6760
6756
  readOnly: Pe,
6761
6757
  error: ae
6762
6758
  },
6763
- se
6759
+ oe
6764
6760
  );
6765
6761
  default:
6766
6762
  return /* @__PURE__ */ r(
6767
- xe,
6763
+ be,
6768
6764
  {
6769
6765
  ...Be,
6770
6766
  type: "text",
6771
6767
  label: Ve,
6772
- placeholder: je ? void 0 : be,
6768
+ placeholder: je ? void 0 : fe,
6773
6769
  value: Y[i] || "",
6774
- onChange: (Ie) => fe(i, Ie.target.value),
6770
+ onChange: (Re) => se(i, Re.target.value),
6775
6771
  readOnly: Pe,
6776
6772
  error: ae
6777
6773
  },
6778
- se
6774
+ oe
6779
6775
  );
6780
6776
  }
6781
- }, Ge = (i, b) => {
6777
+ }, Je = (i, f) => {
6782
6778
  const N = i.labelMode ? i.labelMode !== "placeholder" : S;
6783
6779
  if (i.customType === "paragraph") {
6784
6780
  const C = i.displayText || i.label || "";
@@ -6794,7 +6790,7 @@ const ut = {
6794
6790
  },
6795
6791
  dangerouslySetInnerHTML: { __html: C }
6796
6792
  },
6797
- `custom-${b}`
6793
+ `custom-${f}`
6798
6794
  );
6799
6795
  }
6800
6796
  if (i.customType === "html")
@@ -6803,10 +6799,10 @@ const ut = {
6803
6799
  {
6804
6800
  dangerouslySetInnerHTML: { __html: i.label || "" }
6805
6801
  },
6806
- `custom-${b}`
6802
+ `custom-${f}`
6807
6803
  );
6808
6804
  if (i.customType === "br")
6809
- return /* @__PURE__ */ r("div", { style: { height: "12px" } }, `custom-${b}`);
6805
+ return /* @__PURE__ */ r("div", { style: { height: "12px" } }, `custom-${f}`);
6810
6806
  if (i.customType === "link") {
6811
6807
  const C = i.displayText || i.label || i.linkText || i.linkUrl || "";
6812
6808
  return /* @__PURE__ */ r("div", { className: "metakyc-link-field", children: /* @__PURE__ */ o(
@@ -6829,10 +6825,10 @@ const ut = {
6829
6825
  /* @__PURE__ */ r("span", { style: { fontSize: "10px", opacity: 0.7 }, children: "↗" })
6830
6826
  ]
6831
6827
  }
6832
- ) }, `custom-${b}`);
6828
+ ) }, `custom-${f}`);
6833
6829
  }
6834
6830
  if (!i.paramName) return null;
6835
- const g = $[i.paramName], I = i.displayText || i.label || i.paramName;
6831
+ const h = $[i.paramName], R = i.displayText || i.label || i.paramName;
6836
6832
  if (i.customType === "checkbox")
6837
6833
  return /* @__PURE__ */ o("div", { className: "flex flex-col gap-1", children: [
6838
6834
  /* @__PURE__ */ o(
@@ -6845,8 +6841,8 @@ const ut = {
6845
6841
  "input",
6846
6842
  {
6847
6843
  type: "checkbox",
6848
- checked: me[i.paramName] === "true",
6849
- onChange: (C) => pe(i.paramName, C.target.checked ? "true" : "false"),
6844
+ checked: pe[i.paramName] === "true",
6845
+ onChange: (C) => Ce(i.paramName, C.target.checked ? "true" : "false"),
6850
6846
  className: "metakyc-option-input",
6851
6847
  style: ut
6852
6848
  }
@@ -6857,7 +6853,7 @@ const ut = {
6857
6853
  className: "metakyc-option-text",
6858
6854
  style: { fontSize: "14px", color: "var(--metakyc-text-primary, #111827)", lineHeight: "1.4" },
6859
6855
  children: [
6860
- I,
6856
+ R,
6861
6857
  i.required && /* @__PURE__ */ r("span", { className: "text-red-500 ml-0.5", children: "*" })
6862
6858
  ]
6863
6859
  }
@@ -6865,8 +6861,8 @@ const ut = {
6865
6861
  ]
6866
6862
  }
6867
6863
  ),
6868
- g && /* @__PURE__ */ r("p", { className: "text-red-500 text-xs mt-0.5", children: g })
6869
- ] }, `custom-${b}`);
6864
+ h && /* @__PURE__ */ r("p", { className: "text-red-500 text-xs mt-0.5", children: h })
6865
+ ] }, `custom-${f}`);
6870
6866
  if (i.customType === "link_checkbox")
6871
6867
  return /* @__PURE__ */ o("div", { className: "flex flex-col gap-1", children: [
6872
6868
  /* @__PURE__ */ o(
@@ -6879,8 +6875,8 @@ const ut = {
6879
6875
  "input",
6880
6876
  {
6881
6877
  type: "checkbox",
6882
- checked: me[i.paramName] === "true",
6883
- onChange: (C) => pe(i.paramName, C.target.checked ? "true" : "false"),
6878
+ checked: pe[i.paramName] === "true",
6879
+ onChange: (C) => Ce(i.paramName, C.target.checked ? "true" : "false"),
6884
6880
  className: "metakyc-option-input",
6885
6881
  style: { ...ut, alignSelf: "flex-start", marginTop: "2px" }
6886
6882
  }
@@ -6891,7 +6887,7 @@ const ut = {
6891
6887
  className: "metakyc-option-text",
6892
6888
  style: { fontSize: "14px", color: "var(--metakyc-text-primary, #111827)", lineHeight: "1.4" },
6893
6889
  children: [
6894
- I,
6890
+ R,
6895
6891
  " ",
6896
6892
  i.linkUrl && /* @__PURE__ */ r(
6897
6893
  "a",
@@ -6912,10 +6908,10 @@ const ut = {
6912
6908
  ]
6913
6909
  }
6914
6910
  ),
6915
- g && /* @__PURE__ */ r("p", { className: "text-red-500 text-xs mt-0.5", children: g })
6916
- ] }, `custom-${b}`);
6911
+ h && /* @__PURE__ */ r("p", { className: "text-red-500 text-xs mt-0.5", children: h })
6912
+ ] }, `custom-${f}`);
6917
6913
  if (i.customType === "group_checkbox") {
6918
- const C = (me[i.paramName] || "").split(",").filter(Boolean);
6914
+ const C = (pe[i.paramName] || "").split(",").filter(Boolean);
6919
6915
  return /* @__PURE__ */ o("div", { className: "flex flex-col gap-1.5", children: [
6920
6916
  N && /* @__PURE__ */ o(
6921
6917
  "div",
@@ -6923,13 +6919,13 @@ const ut = {
6923
6919
  className: "text-sm font-medium",
6924
6920
  style: { color: "var(--metakyc-text-primary, #111827)" },
6925
6921
  children: [
6926
- I,
6922
+ R,
6927
6923
  i.required && /* @__PURE__ */ r("span", { className: "text-red-500 ml-0.5", children: "*" })
6928
6924
  ]
6929
6925
  }
6930
6926
  ),
6931
6927
  /* @__PURE__ */ r("div", { className: "metakyc-options-group", style: { display: "flex", flexDirection: "column", gap: "8px" }, children: (i.options || []).map((ue) => {
6932
- const ae = i.singleSelect ? me[i.paramName] === ue.value : C.includes(ue.value);
6928
+ const ae = i.singleSelect ? pe[i.paramName] === ue.value : C.includes(ue.value);
6933
6929
  return /* @__PURE__ */ o(
6934
6930
  "label",
6935
6931
  {
@@ -6941,12 +6937,12 @@ const ut = {
6941
6937
  {
6942
6938
  type: "checkbox",
6943
6939
  checked: ae,
6944
- onChange: (be) => {
6940
+ onChange: (fe) => {
6945
6941
  if (i.singleSelect)
6946
- pe(i.paramName, be.target.checked ? ue.value : "");
6942
+ Ce(i.paramName, fe.target.checked ? ue.value : "");
6947
6943
  else {
6948
- const Pe = be.target.checked ? [...C, ue.value] : C.filter((se) => se !== ue.value);
6949
- pe(i.paramName, Pe.join(","));
6944
+ const Pe = fe.target.checked ? [...C, ue.value] : C.filter((oe) => oe !== ue.value);
6945
+ Ce(i.paramName, Pe.join(","));
6950
6946
  }
6951
6947
  },
6952
6948
  className: "metakyc-option-input",
@@ -6966,8 +6962,8 @@ const ut = {
6966
6962
  ue.value
6967
6963
  );
6968
6964
  }) }),
6969
- g && /* @__PURE__ */ r("p", { className: "text-red-500 text-xs", children: g })
6970
- ] }, `custom-${b}`);
6965
+ h && /* @__PURE__ */ r("p", { className: "text-red-500 text-xs", children: h })
6966
+ ] }, `custom-${f}`);
6971
6967
  }
6972
6968
  return i.customType === "radio_group" ? /* @__PURE__ */ o("div", { className: "flex flex-col gap-1.5", children: [
6973
6969
  N && /* @__PURE__ */ o(
@@ -6976,7 +6972,7 @@ const ut = {
6976
6972
  className: "text-sm font-medium",
6977
6973
  style: { color: "var(--metakyc-text-primary, #111827)" },
6978
6974
  children: [
6979
- I,
6975
+ R,
6980
6976
  i.required && /* @__PURE__ */ r("span", { className: "text-red-500 ml-0.5", children: "*" })
6981
6977
  ]
6982
6978
  }
@@ -6991,9 +6987,9 @@ const ut = {
6991
6987
  "input",
6992
6988
  {
6993
6989
  type: "radio",
6994
- checked: me[i.paramName] === C.value,
6995
- onChange: () => pe(i.paramName, C.value),
6996
- name: `radio-group-${i.paramName}-${b}`,
6990
+ checked: pe[i.paramName] === C.value,
6991
+ onChange: () => Ce(i.paramName, C.value),
6992
+ name: `radio-group-${i.paramName}-${f}`,
6997
6993
  className: "metakyc-option-input",
6998
6994
  style: ut
6999
6995
  }
@@ -7010,21 +7006,21 @@ const ut = {
7010
7006
  },
7011
7007
  C.value
7012
7008
  )) }),
7013
- g && /* @__PURE__ */ r("p", { className: "text-red-500 text-xs", children: g })
7014
- ] }, `custom-${b}`) : /* @__PURE__ */ r(
7015
- xe,
7009
+ h && /* @__PURE__ */ r("p", { className: "text-red-500 text-xs", children: h })
7010
+ ] }, `custom-${f}`) : /* @__PURE__ */ r(
7011
+ be,
7016
7012
  {
7017
7013
  type: "text",
7018
- label: N ? `${I}${i.required ? " *" : ""}` : void 0,
7019
- placeholder: N ? void 0 : I,
7020
- value: me[i.paramName] || "",
7021
- onChange: (C) => pe(i.paramName, C.target.value),
7014
+ label: N ? `${R}${i.required ? " *" : ""}` : void 0,
7015
+ placeholder: N ? void 0 : R,
7016
+ value: pe[i.paramName] || "",
7017
+ onChange: (C) => Ce(i.paramName, C.target.value),
7022
7018
  required: i.required,
7023
- error: g
7019
+ error: h
7024
7020
  },
7025
- `custom-${b}`
7021
+ `custom-${f}`
7026
7022
  );
7027
- }, y = (i, b) => {
7023
+ }, y = (i, f) => {
7028
7024
  const N = ze(i);
7029
7025
  return /* @__PURE__ */ o("div", { className: "space-y-4", children: [
7030
7026
  i.conditionalOn && /* @__PURE__ */ r(Tt, { helpText: i.conditionalHelpText, children: /* @__PURE__ */ o(
@@ -7038,7 +7034,7 @@ const ut = {
7038
7034
  {
7039
7035
  type: "checkbox",
7040
7036
  checked: N,
7041
- onChange: (g) => pe(i.conditionalOn, g.target.checked ? "true" : "false"),
7037
+ onChange: (h) => Ce(i.conditionalOn, h.target.checked ? "true" : "false"),
7042
7038
  className: "metakyc-option-input",
7043
7039
  style: ut
7044
7040
  }
@@ -7054,9 +7050,9 @@ const ut = {
7054
7050
  ]
7055
7051
  }
7056
7052
  ) }),
7057
- N && /* @__PURE__ */ r("div", { className: "grid grid-cols-4 gap-4", children: i.fields.map((g, I) => {
7058
- const C = g.colSpan === 1 ? "col-span-1" : g.colSpan === 2 ? "col-span-2" : g.colSpan === 3 ? "col-span-3" : "col-span-4", ue = g.isCustom ? `custom-${I}-${g.paramName}` : `builtin-${g.name}-${I}`;
7059
- return /* @__PURE__ */ r("div", { className: C, children: /* @__PURE__ */ r(Tt, { helpText: g.helpText, children: g.isCustom ? Ge(g, I) : qe(g.name, ue, g.displayText, g.countriesType, g.labelMode) }) }, ue);
7053
+ N && /* @__PURE__ */ r("div", { className: "grid grid-cols-4 gap-4", children: i.fields.map((h, R) => {
7054
+ const C = h.colSpan === 1 ? "col-span-1" : h.colSpan === 2 ? "col-span-2" : h.colSpan === 3 ? "col-span-3" : "col-span-4", ue = h.isCustom ? `custom-${R}-${h.paramName}` : `builtin-${h.name}-${R}`;
7055
+ return /* @__PURE__ */ r("div", { className: C, children: /* @__PURE__ */ r(Tt, { helpText: h.helpText, children: h.isCustom ? Je(h, R) : qe(h.name, ue, h.displayText, h.countriesType, h.labelMode) }) }, ue);
7060
7056
  }) })
7061
7057
  ] });
7062
7058
  };
@@ -7065,10 +7061,10 @@ const ut = {
7065
7061
  /* @__PURE__ */ r(De, { className: "my-8" }),
7066
7062
  /* @__PURE__ */ r("p", { className: "text-center mt-4", style: { color: "var(--metakyc-text-secondary, #6b7280)", fontSize: "0.875rem" }, children: "Loading form…" })
7067
7063
  ] }) }) });
7068
- if (R) {
7069
- const i = R[A] ?? R[0], b = Ne === -1, N = $e === -1, g = R.length, I = ze(i), C = Object.values($);
7064
+ if (I) {
7065
+ const i = I[A] ?? I[0], f = $e === -1, N = Ne === -1, h = I.length, R = ze(i), C = Object.values($);
7070
7066
  return /* @__PURE__ */ r("div", { className: "metakyc-sdk", children: /* @__PURE__ */ o(ee, { children: [
7071
- /* @__PURE__ */ r(we, { children: /* @__PURE__ */ r(pt, { title: (c == null ? void 0 : c.title) || "Create Applicant" }) }),
7067
+ /* @__PURE__ */ r(ke, { children: /* @__PURE__ */ r(pt, { title: (c == null ? void 0 : c.title) || "Create Applicant" }) }),
7072
7068
  /* @__PURE__ */ o(te, { children: [
7073
7069
  (i.title || i.subtitle || i.description) && /* @__PURE__ */ o("div", { className: "mb-4", children: [
7074
7070
  i.title && /* @__PURE__ */ r(
@@ -7096,16 +7092,16 @@ const ut = {
7096
7092
  }
7097
7093
  )
7098
7094
  ] }),
7099
- (ge || C.length > 0) && /* @__PURE__ */ o("div", { className: "mb-4 p-3 bg-red-50 border border-red-200 rounded-lg", children: [
7100
- ge && /* @__PURE__ */ o("p", { className: "text-red-600 text-sm", children: [
7095
+ (he || C.length > 0) && /* @__PURE__ */ o("div", { className: "mb-4 p-3 bg-red-50 border border-red-200 rounded-lg", children: [
7096
+ he && /* @__PURE__ */ o("p", { className: "text-red-600 text-sm", children: [
7101
7097
  /* @__PURE__ */ r("strong", { children: "Error:" }),
7102
7098
  " ",
7103
- ge
7099
+ he
7104
7100
  ] }),
7105
7101
  C.map((ue, ae) => /* @__PURE__ */ r("p", { className: "text-red-600 text-sm", children: ue }, ae))
7106
7102
  ] }),
7107
- g > 1 && /* @__PURE__ */ o("div", { className: "flex items-center gap-2 mb-4", children: [
7108
- R.map((ue, ae) => /* @__PURE__ */ r(
7103
+ h > 1 && /* @__PURE__ */ o("div", { className: "flex items-center gap-2 mb-4", children: [
7104
+ I.map((ue, ae) => /* @__PURE__ */ r(
7109
7105
  "div",
7110
7106
  {
7111
7107
  className: `h-1.5 rounded-full transition-all ${ae === A ? "flex-1" : "w-8"}`,
@@ -7116,52 +7112,52 @@ const ut = {
7116
7112
  /* @__PURE__ */ o("span", { className: "text-xs text-gray-400 flex-shrink-0", children: [
7117
7113
  A + 1,
7118
7114
  " / ",
7119
- g
7115
+ h
7120
7116
  ] })
7121
7117
  ] }),
7122
7118
  y(i)
7123
7119
  ] }),
7124
- /* @__PURE__ */ o(Ce, { className: "flex justify-between", children: [
7120
+ /* @__PURE__ */ o(Se, { className: "flex justify-between", children: [
7125
7121
  /* @__PURE__ */ o("div", { children: [
7126
- !b && /* @__PURE__ */ r(
7122
+ !f && /* @__PURE__ */ r(
7127
7123
  Z,
7128
7124
  {
7129
7125
  type: "button",
7130
7126
  variant: "outline",
7131
7127
  onClick: () => {
7132
- U(Ne), W({});
7128
+ U($e), H({});
7133
7129
  },
7134
- disabled: ne || m,
7130
+ disabled: re || m,
7135
7131
  children: "Previous"
7136
7132
  }
7137
7133
  ),
7138
- b && a && /* @__PURE__ */ r(Z, { type: "button", variant: "outline", onClick: a, disabled: ne || m, children: "Cancel" })
7134
+ f && a && /* @__PURE__ */ r(Z, { type: "button", variant: "outline", onClick: a, disabled: re || m, children: "Cancel" })
7139
7135
  ] }),
7140
7136
  /* @__PURE__ */ r(
7141
7137
  Z,
7142
7138
  {
7143
7139
  type: "button",
7144
- isLoading: ne || m,
7145
- onClick: N ? _e : nt,
7146
- children: N ? i.conditionalOn && !I ? "Skip & Submit" : "Submit" : i.conditionalOn && !I ? "Skip" : "Next"
7140
+ isLoading: re || m,
7141
+ onClick: N ? _e : Ge,
7142
+ children: N ? i.conditionalOn && !R ? "Skip & Submit" : "Submit" : i.conditionalOn && !R ? "Skip" : "Next"
7147
7143
  }
7148
7144
  )
7149
7145
  ] })
7150
7146
  ] }) });
7151
7147
  }
7152
7148
  return /* @__PURE__ */ r("div", { className: "metakyc-sdk", children: /* @__PURE__ */ r("form", { onSubmit: at, children: /* @__PURE__ */ o(ee, { children: [
7153
- /* @__PURE__ */ r(we, { children: /* @__PURE__ */ r(pt, { title: (c == null ? void 0 : c.title) || "Create Applicant" }) }),
7149
+ /* @__PURE__ */ r(ke, { children: /* @__PURE__ */ r(pt, { title: (c == null ? void 0 : c.title) || "Create Applicant" }) }),
7154
7150
  /* @__PURE__ */ o(te, { children: [
7155
- ge && /* @__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: [
7151
+ he && /* @__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: [
7156
7152
  /* @__PURE__ */ r("strong", { children: "Error:" }),
7157
7153
  " ",
7158
- ge
7154
+ he
7159
7155
  ] }) }),
7160
7156
  /* @__PURE__ */ r("div", { className: "grid grid-cols-4 gap-4", children: Q.map((i) => /* @__PURE__ */ r("div", { className: "col-span-4", children: qe(i) }, i)) })
7161
7157
  ] }),
7162
- /* @__PURE__ */ o(Ce, { className: "flex justify-between", children: [
7163
- a && /* @__PURE__ */ r(Z, { type: "button", variant: "outline", onClick: a, disabled: ne || m, children: "Cancel" }),
7164
- /* @__PURE__ */ r(Z, { type: "submit", isLoading: ne || m, children: "Create Applicant" })
7158
+ /* @__PURE__ */ o(Se, { className: "flex justify-between", children: [
7159
+ a && /* @__PURE__ */ r(Z, { type: "button", variant: "outline", onClick: a, disabled: re || m, children: "Cancel" }),
7160
+ /* @__PURE__ */ r(Z, { type: "submit", isLoading: re || m, children: "Create Applicant" })
7165
7161
  ] })
7166
7162
  ] }) }) });
7167
7163
  }, Lt = ["companyName", "email"];
@@ -7174,75 +7170,75 @@ const Jn = ({
7174
7170
  onSuccess: n,
7175
7171
  onCancel: a
7176
7172
  }) => {
7177
- var qe, Ge, y, O, K, j;
7178
- const { config: s, baseInformationService: l, currentTheme: c } = Ae(), { createCompanyApplicant: d, isLoading: m } = Ot(), u = e || ((qe = s.applicantForm) == null ? void 0 : qe.workflowKey);
7179
- if (!u)
7173
+ var qe, Je, y, O, q, W;
7174
+ const { config: s, baseInformationService: l, currentTheme: c } = Ae(), { createCompanyApplicant: d, isLoading: m } = Ot(), p = e || ((qe = s.applicantForm) == null ? void 0 : qe.workflowKey);
7175
+ if (!p)
7180
7176
  throw new Error(
7181
7177
  "workflowKey is required. Provide it either as a prop to CreateCompanyApplicantForm or set it in config.applicantForm.workflowKey"
7182
7178
  );
7183
- const h = t || ((Ge = s.applicantForm) == null ? void 0 : Ge.externalRefId) || "", D = ((y = s.applicantForm) == null ? void 0 : y.email) || "", x = ((O = s.applicantForm) == null ? void 0 : O.initialValues) || {}, T = (((K = s.applicantForm) == null ? void 0 : K.fieldLabelMode) || (c == null ? void 0 : c.fieldLabelMode) || "label") !== "placeholder", S = Le(
7179
+ const b = t || ((Je = s.applicantForm) == null ? void 0 : Je.externalRefId) || "", D = ((y = s.applicantForm) == null ? void 0 : y.email) || "", x = ((O = s.applicantForm) == null ? void 0 : O.initialValues) || {}, T = (((q = s.applicantForm) == null ? void 0 : q.fieldLabelMode) || (c == null ? void 0 : c.fieldLabelMode) || "label") !== "placeholder", S = Le(
7184
7180
  () => c != null && c.companyFormPages && c.companyFormPages.length > 0 ? c.companyFormPages : null,
7185
7181
  [c == null ? void 0 : c.companyFormPages]
7186
- ), R = Le(() => {
7187
- const p = new Set(Lt), k = c == null ? void 0 : c.companyFormRequiredFields;
7188
- if (k) for (const L of k) p.add(L);
7182
+ ), I = Le(() => {
7183
+ const u = new Set(Lt), v = c == null ? void 0 : c.companyFormRequiredFields;
7184
+ if (v) for (const L of v) u.add(L);
7189
7185
  if (S)
7190
7186
  for (const L of S)
7191
7187
  for (const w of L.fields)
7192
- !w.isCustom && w.name && w.required && p.add(w.name);
7193
- return Array.from(p);
7188
+ !w.isCustom && w.name && w.required && u.add(w.name);
7189
+ return Array.from(u);
7194
7190
  }, [c == null ? void 0 : c.companyFormRequiredFields, S]), z = Le(() => {
7195
- var p;
7191
+ var u;
7196
7192
  if (S) {
7197
- const k = S.flatMap((w) => w.fields).filter((w) => !w.isCustom && w.name).map((w) => w.name), L = new Set(k);
7193
+ const v = S.flatMap((w) => w.fields).filter((w) => !w.isCustom && w.name).map((w) => w.name), L = new Set(v);
7198
7194
  for (const w of Lt) L.add(w);
7199
7195
  return Array.from(L);
7200
7196
  }
7201
- return (p = s.applicantForm) != null && p.visibleFields ? s.applicantForm.visibleFields : c != null && c.companyFormVisibleFields && c.companyFormVisibleFields.length > 0 ? c.companyFormVisibleFields : or;
7202
- }, [(j = s.applicantForm) == null ? void 0 : j.visibleFields, c == null ? void 0 : c.companyFormVisibleFields, S]), Q = /* @__PURE__ */ new Set(["countryResidence", "addressCountry"]), M = Le(() => {
7203
- var k, L;
7204
- const p = /* @__PURE__ */ new Set();
7197
+ return (u = s.applicantForm) != null && u.visibleFields ? s.applicantForm.visibleFields : c != null && c.companyFormVisibleFields && c.companyFormVisibleFields.length > 0 ? c.companyFormVisibleFields : or;
7198
+ }, [(W = s.applicantForm) == null ? void 0 : W.visibleFields, c == null ? void 0 : c.companyFormVisibleFields, S]), Q = /* @__PURE__ */ new Set(["countryResidence", "addressCountry"]), M = Le(() => {
7199
+ var v, L;
7200
+ const u = /* @__PURE__ */ new Set();
7205
7201
  if (S)
7206
7202
  for (const w of S)
7207
7203
  for (const i of w.fields)
7208
- !i.isCustom && i.name && Q.has(i.name) && p.add(i.countriesType ?? ((k = it[i.name]) == null ? void 0 : k.countriesType));
7204
+ !i.isCustom && i.name && Q.has(i.name) && u.add(i.countriesType ?? ((v = it[i.name]) == null ? void 0 : v.countriesType));
7209
7205
  else
7210
7206
  for (const w of z)
7211
- Q.has(w) && p.add((L = it[w]) == null ? void 0 : L.countriesType);
7212
- return p.size === 0 && p.add(void 0), Array.from(p);
7213
- }, [z, S]), [H, q] = v({}), [X, F] = v(!0), f = le(/* @__PURE__ */ new Set()), B = le(/* @__PURE__ */ new Set());
7214
- he(() => {
7207
+ Q.has(w) && u.add((L = it[w]) == null ? void 0 : L.countriesType);
7208
+ return u.size === 0 && u.add(void 0), Array.from(u);
7209
+ }, [z, S]), [j, K] = k({}), [X, F] = k(!0), g = ce(/* @__PURE__ */ new Set()), B = ce(/* @__PURE__ */ new Set());
7210
+ ge(() => {
7215
7211
  if (!c) return;
7216
- const p = M.filter((w) => {
7212
+ const u = M.filter((w) => {
7217
7213
  const i = w != null ? String(w) : "all";
7218
- return !B.current.has(i) && !f.current.has(i);
7214
+ return !B.current.has(i) && !g.current.has(i);
7219
7215
  });
7220
- if (p.length === 0) {
7216
+ if (u.length === 0) {
7221
7217
  M.every((i) => B.current.has(i != null ? String(i) : "all")) && F(!1);
7222
7218
  return;
7223
7219
  }
7224
7220
  F(!0);
7225
- const k = p.map((w) => w != null ? String(w) : "all");
7226
- k.forEach((w) => f.current.add(w)), (async () => {
7221
+ const v = u.map((w) => w != null ? String(w) : "all");
7222
+ v.forEach((w) => g.current.add(w)), (async () => {
7227
7223
  try {
7228
7224
  const w = await Promise.all(
7229
- p.map(async (i) => {
7230
- const b = i != null ? String(i) : "all", N = await l.getCountries("", s.locale || "en", i), g = /* @__PURE__ */ new Set(), I = N.map((C) => ({ value: C.abbreviation3 || C.abbreviation, label: C.name })).filter((C) => !C.value || g.has(C.value) ? !1 : (g.add(C.value), !0));
7231
- return B.current.add(b), f.current.delete(b), [b, I];
7225
+ u.map(async (i) => {
7226
+ const f = i != null ? String(i) : "all", N = await l.getCountries("", s.locale || "en", i), h = /* @__PURE__ */ new Set(), R = N.map((C) => ({ value: C.abbreviation3 || C.abbreviation, label: C.name })).filter((C) => !C.value || h.has(C.value) ? !1 : (h.add(C.value), !0));
7227
+ return B.current.add(f), g.current.delete(f), [f, R];
7232
7228
  })
7233
7229
  );
7234
- q((i) => ({ ...i, ...Object.fromEntries(w) }));
7230
+ K((i) => ({ ...i, ...Object.fromEntries(w) }));
7235
7231
  } catch (w) {
7236
- k.forEach((i) => f.current.delete(i)), console.error("Failed to load countries:", w);
7232
+ v.forEach((i) => g.current.delete(i)), console.error("Failed to load countries:", w);
7237
7233
  } finally {
7238
7234
  M.every((i) => B.current.has(i != null ? String(i) : "all")) && F(!1);
7239
7235
  }
7240
7236
  })();
7241
7237
  }, [M, c]);
7242
- const V = (p, k) => {
7238
+ const V = (u, v) => {
7243
7239
  var i;
7244
- const L = k ?? ((i = it[p]) == null ? void 0 : i.countriesType), w = L != null ? String(L) : "all";
7245
- return H[w] || [];
7240
+ const L = v ?? ((i = it[u]) == null ? void 0 : i.countriesType), w = L != null ? String(L) : "all";
7241
+ return j[w] || [];
7246
7242
  }, G = {
7247
7243
  companyName: 1,
7248
7244
  registrationNumber: 1,
@@ -7264,9 +7260,9 @@ const Jn = ({
7264
7260
  addressCountry: 1,
7265
7261
  lei: 1
7266
7262
  }, _ = Object.fromEntries(
7267
- Object.entries(x).filter(([p]) => p in G)
7268
- ), [J, ie] = v({
7269
- workflowKey: u,
7263
+ Object.entries(x).filter(([u]) => u in G)
7264
+ ), [J, ie] = k({
7265
+ workflowKey: p,
7270
7266
  companyName: "",
7271
7267
  email: D,
7272
7268
  phone: "",
@@ -7286,140 +7282,140 @@ const Jn = ({
7286
7282
  postalCode: "",
7287
7283
  addressCountry: "",
7288
7284
  lei: "",
7289
- externalRefId: h,
7285
+ externalRefId: b,
7290
7286
  ..._
7291
- }), [Y, ve] = v({}), [ce, me] = v(0), [ke, A] = v({}), [U, $] = v(null), [W, ge] = v(!1), E = (p, k) => ie((L) => ({ ...L, [p]: k })), ne = (p, k) => ve((L) => ({ ...L, [p]: k })), de = (p) => !p.conditionalOn || Y[p.conditionalOn] === "true", fe = S && ce < S.length - 1 ? ce + 1 : -1, pe = S && ce > 0 ? ce - 1 : -1, ze = (p) => {
7287
+ }), [Y, xe] = k({}), [de, pe] = k(0), [ve, A] = k({}), [U, $] = k(null), [H, he] = k(!1), E = (u, v) => ie((L) => ({ ...L, [u]: v })), re = (u, v) => xe((L) => ({ ...L, [u]: v })), me = (u) => !u.conditionalOn || Y[u.conditionalOn] === "true", se = S && de < S.length - 1 ? de + 1 : -1, Ce = S && de > 0 ? de - 1 : -1, ze = (u) => {
7292
7288
  var L;
7293
- const k = {};
7294
- for (const w of p.fields)
7289
+ const v = {};
7290
+ for (const w of u.fields)
7295
7291
  if (w.isCustom) {
7296
7292
  if (w.customType === "paragraph" || w.customType === "html" || w.customType === "br" || w.customType === "link") continue;
7297
7293
  if (w.required && w.paramName) {
7298
- const i = Y[w.paramName], b = w.displayText || w.label || w.paramName;
7299
- w.customType === "checkbox" || w.customType === "link_checkbox" ? i !== "true" && (k[w.paramName] = `${b} is required.`) : (!i || i.trim() === "") && (k[w.paramName] = `${b} is required.`);
7294
+ const i = Y[w.paramName], f = w.displayText || w.label || w.paramName;
7295
+ w.customType === "checkbox" || w.customType === "link_checkbox" ? i !== "true" && (v[w.paramName] = `${f} is required.`) : (!i || i.trim() === "") && (v[w.paramName] = `${f} is required.`);
7300
7296
  }
7301
7297
  } else if (w.name) {
7302
7298
  const i = w.name;
7303
- if (R.includes(i) && vt(J[i])) {
7304
- const b = w.displayText || ((L = it[i]) == null ? void 0 : L.label) || i;
7305
- k[i] = `${b} is required.`;
7299
+ if (I.includes(i) && vt(J[i])) {
7300
+ const f = w.displayText || ((L = it[i]) == null ? void 0 : L.label) || i;
7301
+ v[i] = `${f} is required.`;
7306
7302
  }
7307
7303
  }
7308
- return k;
7309
- }, $e = async () => {
7304
+ return v;
7305
+ }, Ne = async () => {
7310
7306
  if (!S) return;
7311
- const p = S[ce];
7312
- if (p.conditionalOn && !de(p)) {
7313
- A({}), fe >= 0 ? me(fe) : await Ne();
7307
+ const u = S[de];
7308
+ if (u.conditionalOn && !me(u)) {
7309
+ A({}), se >= 0 ? pe(se) : await $e();
7314
7310
  return;
7315
7311
  }
7316
- const k = ze(p);
7317
- if (Object.keys(k).length > 0) {
7318
- A(k);
7312
+ const v = ze(u);
7313
+ if (Object.keys(v).length > 0) {
7314
+ A(v);
7319
7315
  return;
7320
7316
  }
7321
- A({}), fe >= 0 ? me(fe) : await Ne();
7322
- }, Ne = async () => {
7323
- var p;
7317
+ A({}), se >= 0 ? pe(se) : await $e();
7318
+ }, $e = async () => {
7319
+ var u;
7324
7320
  if (S) {
7325
- let k = {};
7321
+ let v = {};
7326
7322
  for (const L of S)
7327
- de(L) && (k = { ...k, ...ze(L) });
7328
- if (Object.keys(k).length > 0) {
7329
- A(k);
7323
+ me(L) && (v = { ...v, ...ze(L) });
7324
+ if (Object.keys(v).length > 0) {
7325
+ A(v);
7330
7326
  return;
7331
7327
  }
7332
7328
  }
7333
- ge(!0), $(null);
7329
+ he(!0), $(null);
7334
7330
  try {
7335
- const k = {
7331
+ const v = {
7336
7332
  workflowKey: J.workflowKey,
7337
- externalRefId: ((p = J.externalRefId) == null ? void 0 : p.trim()) || void 0
7338
- }, L = S ? S.filter((b) => de(b)).flatMap((b) => b.fields).filter((b) => !b.isCustom && b.name).map((b) => b.name) : z;
7339
- for (const b of L) {
7340
- const N = J[b];
7333
+ externalRefId: ((u = J.externalRefId) == null ? void 0 : u.trim()) || void 0
7334
+ }, L = S ? S.filter((f) => me(f)).flatMap((f) => f.fields).filter((f) => !f.isCustom && f.name).map((f) => f.name) : z;
7335
+ for (const f of L) {
7336
+ const N = J[f];
7341
7337
  if (!vt(N))
7342
- switch (b) {
7338
+ switch (f) {
7343
7339
  case "companyName":
7344
- k.companyName = N;
7340
+ v.companyName = N;
7345
7341
  break;
7346
7342
  case "email":
7347
- k.companyEmail = N;
7343
+ v.companyEmail = N;
7348
7344
  break;
7349
7345
  case "phone":
7350
- k.companyPhone = N;
7346
+ v.companyPhone = N;
7351
7347
  break;
7352
7348
  case "registrationNumber":
7353
- k.companyRegistrationNumber = N;
7349
+ v.companyRegistrationNumber = N;
7354
7350
  break;
7355
7351
  case "countryResidence":
7356
- k.companyCountry = N;
7352
+ v.companyCountry = N;
7357
7353
  break;
7358
7354
  case "city":
7359
- k.companyCity = N;
7355
+ v.companyCity = N;
7360
7356
  break;
7361
7357
  case "street":
7362
- k.companyStreet = N;
7358
+ v.companyStreet = N;
7363
7359
  break;
7364
7360
  case "postalCode":
7365
- k.companyZip = N;
7361
+ v.companyZip = N;
7366
7362
  break;
7367
7363
  default:
7368
- k[b] = N;
7364
+ v[f] = N;
7369
7365
  break;
7370
7366
  }
7371
7367
  }
7372
7368
  const w = [];
7373
7369
  if (S) {
7374
- for (const b of S)
7375
- if (de(b))
7376
- for (const N of b.fields) {
7370
+ for (const f of S)
7371
+ if (me(f))
7372
+ for (const N of f.fields) {
7377
7373
  if (!N.isCustom || !N.paramName || N.customType === "paragraph" || N.customType === "html" || N.customType === "br" || N.customType === "link") continue;
7378
- const g = Y[N.paramName] ?? "";
7379
- let I;
7374
+ const h = Y[N.paramName] ?? "";
7375
+ let R;
7380
7376
  if (N.customType === "checkbox" || N.customType === "link_checkbox")
7381
- I = g === "true" ? "yes" : "no";
7382
- else if (I = g, !I && !N.required) continue;
7383
- w.push({ paramName: N.paramName, value: I });
7377
+ R = h === "true" ? "yes" : "no";
7378
+ else if (R = h, !R && !N.required) continue;
7379
+ w.push({ paramName: N.paramName, value: R });
7384
7380
  }
7385
7381
  }
7386
- w.length > 0 && (k.applicantAdditionalDatas = w);
7387
- const i = await d(k);
7382
+ w.length > 0 && (v.applicantAdditionalDatas = w);
7383
+ const i = await d(v);
7388
7384
  n(i.applicantId);
7389
- } catch (k) {
7390
- console.error("Error creating company applicant:", k), $(k.message || "Failed to create company applicant");
7385
+ } catch (v) {
7386
+ console.error("Error creating company applicant:", v), $(v.message || "Failed to create company applicant");
7391
7387
  } finally {
7392
- ge(!1);
7388
+ he(!1);
7393
7389
  }
7394
- }, rt = async (p) => {
7395
- var k;
7396
- p.preventDefault();
7397
- for (const L of R)
7390
+ }, nt = async (u) => {
7391
+ var v;
7392
+ u.preventDefault();
7393
+ for (const L of I)
7398
7394
  if (vt(J[L])) {
7399
- const w = ((k = it[L]) == null ? void 0 : k.label) || L;
7395
+ const w = ((v = it[L]) == null ? void 0 : v.label) || L;
7400
7396
  $(`${w} is required.`);
7401
7397
  return;
7402
7398
  }
7403
- await Ne();
7404
- }, nt = (p, k, L, w, i) => {
7405
- const b = it[p];
7406
- if (!b) return null;
7407
- const N = R.includes(p), g = ke[p], I = L || b.label, C = p in _, ue = k ?? p, ae = i ? i !== "placeholder" : T, be = ae ? I : void 0, Pe = ae ? "..." : I;
7408
- switch (b.type) {
7399
+ await $e();
7400
+ }, Ge = (u, v, L, w, i) => {
7401
+ const f = it[u];
7402
+ if (!f) return null;
7403
+ const N = I.includes(u), h = ve[u], R = L || f.label, C = u in _, ue = v ?? u, ae = i ? i !== "placeholder" : T, fe = ae ? R : void 0, Pe = ae ? "..." : R;
7404
+ switch (f.type) {
7409
7405
  case "select":
7410
- if (p === "countryResidence" || p === "addressCountry") {
7411
- const se = V(p, w);
7406
+ if (u === "countryResidence" || u === "addressCountry") {
7407
+ const oe = V(u, w);
7412
7408
  return /* @__PURE__ */ r(
7413
7409
  Ue,
7414
7410
  {
7415
7411
  required: N,
7416
- label: be,
7417
- value: J[p] || "",
7418
- onChange: (Be) => E(p, Be),
7419
- options: [{ value: "", label: `Select ${Pe.toLowerCase()}` }, ...se],
7412
+ label: fe,
7413
+ value: J[u] || "",
7414
+ onChange: (Be) => E(u, Be),
7415
+ options: [{ value: "", label: `Select ${Pe.toLowerCase()}` }, ...oe],
7420
7416
  disabled: X,
7421
7417
  readOnly: C,
7422
- error: g
7418
+ error: h
7423
7419
  },
7424
7420
  ue
7425
7421
  );
@@ -7427,140 +7423,140 @@ const Jn = ({
7427
7423
  return null;
7428
7424
  case "date":
7429
7425
  return /* @__PURE__ */ r(
7430
- xe,
7426
+ be,
7431
7427
  {
7432
7428
  required: N,
7433
7429
  type: "date",
7434
- label: be,
7435
- placeholder: ae ? void 0 : I,
7436
- value: J[p] || "",
7437
- onChange: (se) => E(p, se.target.value),
7430
+ label: fe,
7431
+ placeholder: ae ? void 0 : R,
7432
+ value: J[u] || "",
7433
+ onChange: (oe) => E(u, oe.target.value),
7438
7434
  readOnly: C,
7439
- error: g
7435
+ error: h
7440
7436
  },
7441
7437
  ue
7442
7438
  );
7443
7439
  case "email":
7444
7440
  return /* @__PURE__ */ r(
7445
- xe,
7441
+ be,
7446
7442
  {
7447
7443
  required: N,
7448
7444
  type: "email",
7449
- label: be,
7450
- placeholder: ae ? void 0 : I,
7451
- value: J[p] || "",
7452
- onChange: (se) => E(p, se.target.value),
7445
+ label: fe,
7446
+ placeholder: ae ? void 0 : R,
7447
+ value: J[u] || "",
7448
+ onChange: (oe) => E(u, oe.target.value),
7453
7449
  readOnly: C,
7454
- error: g
7450
+ error: h
7455
7451
  },
7456
7452
  ue
7457
7453
  );
7458
7454
  case "tel":
7459
7455
  return /* @__PURE__ */ r(
7460
- xe,
7456
+ be,
7461
7457
  {
7462
7458
  required: N,
7463
7459
  type: "tel",
7464
- label: be,
7465
- placeholder: ae ? void 0 : I,
7466
- value: J[p] || "",
7467
- onChange: (se) => E(p, se.target.value),
7460
+ label: fe,
7461
+ placeholder: ae ? void 0 : R,
7462
+ value: J[u] || "",
7463
+ onChange: (oe) => E(u, oe.target.value),
7468
7464
  readOnly: C,
7469
- error: g
7465
+ error: h
7470
7466
  },
7471
7467
  ue
7472
7468
  );
7473
7469
  default:
7474
7470
  return /* @__PURE__ */ r(
7475
- xe,
7471
+ be,
7476
7472
  {
7477
7473
  required: N,
7478
7474
  type: "text",
7479
- label: be,
7480
- placeholder: ae ? void 0 : I,
7481
- value: J[p] || "",
7482
- onChange: (se) => E(p, se.target.value),
7475
+ label: fe,
7476
+ placeholder: ae ? void 0 : R,
7477
+ value: J[u] || "",
7478
+ onChange: (oe) => E(u, oe.target.value),
7483
7479
  readOnly: C,
7484
- error: g
7480
+ error: h
7485
7481
  },
7486
7482
  ue
7487
7483
  );
7488
7484
  }
7489
- }, _e = (p, k) => {
7490
- if (p.customType === "paragraph")
7485
+ }, _e = (u, v) => {
7486
+ if (u.customType === "paragraph")
7491
7487
  return /* @__PURE__ */ r(
7492
7488
  "p",
7493
7489
  {
7494
7490
  style: { fontSize: "14px", lineHeight: "1.7", margin: 0, color: "var(--metakyc-text-secondary, #6b7280)" },
7495
- dangerouslySetInnerHTML: { __html: p.displayText || p.label || "" }
7491
+ dangerouslySetInnerHTML: { __html: u.displayText || u.label || "" }
7496
7492
  },
7497
- `custom-${k}`
7493
+ `custom-${v}`
7498
7494
  );
7499
- if (p.customType === "html")
7500
- return /* @__PURE__ */ r("div", { dangerouslySetInnerHTML: { __html: p.label || "" } }, `custom-${k}`);
7501
- if (p.customType === "br")
7502
- return /* @__PURE__ */ r("div", { style: { height: "12px" } }, `custom-${k}`);
7503
- if (p.customType === "link")
7495
+ if (u.customType === "html")
7496
+ return /* @__PURE__ */ r("div", { dangerouslySetInnerHTML: { __html: u.label || "" } }, `custom-${v}`);
7497
+ if (u.customType === "br")
7498
+ return /* @__PURE__ */ r("div", { style: { height: "12px" } }, `custom-${v}`);
7499
+ if (u.customType === "link")
7504
7500
  return /* @__PURE__ */ r("div", { children: /* @__PURE__ */ r(
7505
7501
  "a",
7506
7502
  {
7507
- href: p.linkUrl || "#",
7503
+ href: u.linkUrl || "#",
7508
7504
  target: "_blank",
7509
7505
  rel: "noopener noreferrer",
7510
7506
  style: { color: "var(--metakyc-primary, #2563eb)", fontSize: "14px", textDecoration: "underline" },
7511
- children: p.displayText || p.label || p.linkText || p.linkUrl || ""
7507
+ children: u.displayText || u.label || u.linkText || u.linkUrl || ""
7512
7508
  }
7513
- ) }, `custom-${k}`);
7514
- if (!p.paramName) return null;
7515
- const L = ke[p.paramName], w = p.displayText || p.label || p.paramName, i = p.labelMode ? p.labelMode !== "placeholder" : T;
7516
- return p.customType === "checkbox" ? /* @__PURE__ */ o("div", { className: "flex flex-col gap-1", children: [
7509
+ ) }, `custom-${v}`);
7510
+ if (!u.paramName) return null;
7511
+ const L = ve[u.paramName], w = u.displayText || u.label || u.paramName, i = u.labelMode ? u.labelMode !== "placeholder" : T;
7512
+ return u.customType === "checkbox" ? /* @__PURE__ */ o("div", { className: "flex flex-col gap-1", children: [
7517
7513
  /* @__PURE__ */ o("label", { style: { display: "flex", alignItems: "center", gap: "10px", cursor: "pointer" }, children: [
7518
7514
  /* @__PURE__ */ r(
7519
7515
  "input",
7520
7516
  {
7521
7517
  type: "checkbox",
7522
- checked: Y[p.paramName] === "true",
7523
- onChange: (b) => ne(p.paramName, b.target.checked ? "true" : "false"),
7518
+ checked: Y[u.paramName] === "true",
7519
+ onChange: (f) => re(u.paramName, f.target.checked ? "true" : "false"),
7524
7520
  style: { width: "16px", height: "16px", accentColor: "var(--metakyc-primary, #2563eb)" }
7525
7521
  }
7526
7522
  ),
7527
7523
  /* @__PURE__ */ o("span", { style: { fontSize: "14px", color: "var(--metakyc-text-primary, #111827)" }, children: [
7528
7524
  w,
7529
- p.required && /* @__PURE__ */ r("span", { className: "text-red-500 ml-0.5", children: "*" })
7525
+ u.required && /* @__PURE__ */ r("span", { className: "text-red-500 ml-0.5", children: "*" })
7530
7526
  ] })
7531
7527
  ] }),
7532
7528
  L && /* @__PURE__ */ r("p", { className: "text-red-500 text-xs mt-0.5", children: L })
7533
- ] }, `custom-${k}`) : /* @__PURE__ */ r(
7534
- xe,
7529
+ ] }, `custom-${v}`) : /* @__PURE__ */ r(
7530
+ be,
7535
7531
  {
7536
7532
  type: "text",
7537
- label: i ? `${w}${p.required ? " *" : ""}` : void 0,
7533
+ label: i ? `${w}${u.required ? " *" : ""}` : void 0,
7538
7534
  placeholder: i ? void 0 : w,
7539
- value: Y[p.paramName] || "",
7540
- onChange: (b) => ne(p.paramName, b.target.value),
7541
- required: p.required,
7535
+ value: Y[u.paramName] || "",
7536
+ onChange: (f) => re(u.paramName, f.target.value),
7537
+ required: u.required,
7542
7538
  error: L
7543
7539
  },
7544
- `custom-${k}`
7540
+ `custom-${v}`
7545
7541
  );
7546
- }, at = (p) => {
7547
- const k = de(p);
7542
+ }, at = (u) => {
7543
+ const v = me(u);
7548
7544
  return /* @__PURE__ */ o("div", { className: "space-y-4", children: [
7549
- p.conditionalOn && /* @__PURE__ */ o("label", { style: { display: "flex", alignItems: "center", gap: "10px", cursor: "pointer" }, children: [
7545
+ u.conditionalOn && /* @__PURE__ */ o("label", { style: { display: "flex", alignItems: "center", gap: "10px", cursor: "pointer" }, children: [
7550
7546
  /* @__PURE__ */ r(
7551
7547
  "input",
7552
7548
  {
7553
7549
  type: "checkbox",
7554
- checked: k,
7555
- onChange: (L) => ne(p.conditionalOn, L.target.checked ? "true" : "false"),
7550
+ checked: v,
7551
+ onChange: (L) => re(u.conditionalOn, L.target.checked ? "true" : "false"),
7556
7552
  style: { width: "16px", height: "16px", accentColor: "var(--metakyc-primary, #2563eb)" }
7557
7553
  }
7558
7554
  ),
7559
- /* @__PURE__ */ r("span", { style: { fontSize: "14px", fontWeight: 500 }, children: p.conditionalOn })
7555
+ /* @__PURE__ */ r("span", { style: { fontSize: "14px", fontWeight: 500 }, children: u.conditionalOn })
7560
7556
  ] }),
7561
- k && /* @__PURE__ */ r("div", { className: "grid grid-cols-4 gap-4", children: p.fields.map((L, w) => {
7562
- const i = L.colSpan === 1 ? "col-span-1" : L.colSpan === 2 ? "col-span-2" : L.colSpan === 3 ? "col-span-3" : "col-span-4", b = L.isCustom ? `custom-${w}-${L.paramName}` : `builtin-${L.name}-${w}`;
7563
- return /* @__PURE__ */ r("div", { className: i, children: L.isCustom ? _e(L, w) : nt(L.name, b, L.displayText, L.countriesType, L.labelMode) }, b);
7557
+ v && /* @__PURE__ */ r("div", { className: "grid grid-cols-4 gap-4", children: u.fields.map((L, w) => {
7558
+ const i = L.colSpan === 1 ? "col-span-1" : L.colSpan === 2 ? "col-span-2" : L.colSpan === 3 ? "col-span-3" : "col-span-4", f = L.isCustom ? `custom-${w}-${L.paramName}` : `builtin-${L.name}-${w}`;
7559
+ return /* @__PURE__ */ r("div", { className: i, children: L.isCustom ? _e(L, w) : Ge(L.name, f, L.displayText, L.countriesType, L.labelMode) }, f);
7564
7560
  }) })
7565
7561
  ] });
7566
7562
  };
@@ -7570,72 +7566,72 @@ const Jn = ({
7570
7566
  /* @__PURE__ */ r("p", { className: "text-center mt-4", style: { color: "var(--metakyc-text-secondary, #6b7280)", fontSize: "0.875rem" }, children: "Loading form…" })
7571
7567
  ] }) }) });
7572
7568
  if (S) {
7573
- const p = S[ce] ?? S[0], k = pe === -1, L = fe === -1, w = S.length, i = de(p), b = Object.values(ke);
7569
+ const u = S[de] ?? S[0], v = Ce === -1, L = se === -1, w = S.length, i = me(u), f = Object.values(ve);
7574
7570
  return /* @__PURE__ */ r("div", { className: "metakyc-sdk", children: /* @__PURE__ */ o(ee, { children: [
7575
- /* @__PURE__ */ r(we, { children: /* @__PURE__ */ r(pt, { title: (c == null ? void 0 : c.title) || "Company Registration" }) }),
7571
+ /* @__PURE__ */ r(ke, { children: /* @__PURE__ */ r(pt, { title: (c == null ? void 0 : c.title) || "Company Registration" }) }),
7576
7572
  /* @__PURE__ */ o(te, { children: [
7577
- (p.title || p.subtitle) && /* @__PURE__ */ o("div", { className: "mb-4", children: [
7578
- p.title && /* @__PURE__ */ r("h3", { className: "font-semibold text-base", style: { color: "var(--metakyc-text-primary, #111827)" }, children: p.title }),
7579
- p.subtitle && /* @__PURE__ */ r("p", { className: "text-sm mt-0.5", style: { color: "var(--metakyc-text-secondary, #6b7280)" }, children: p.subtitle })
7573
+ (u.title || u.subtitle) && /* @__PURE__ */ o("div", { className: "mb-4", children: [
7574
+ u.title && /* @__PURE__ */ r("h3", { className: "font-semibold text-base", style: { color: "var(--metakyc-text-primary, #111827)" }, children: u.title }),
7575
+ u.subtitle && /* @__PURE__ */ r("p", { className: "text-sm mt-0.5", style: { color: "var(--metakyc-text-secondary, #6b7280)" }, children: u.subtitle })
7580
7576
  ] }),
7581
- (U || b.length > 0) && /* @__PURE__ */ o("div", { className: "mb-4 p-3 bg-red-50 border border-red-200 rounded-lg", children: [
7577
+ (U || f.length > 0) && /* @__PURE__ */ o("div", { className: "mb-4 p-3 bg-red-50 border border-red-200 rounded-lg", children: [
7582
7578
  U && /* @__PURE__ */ o("p", { className: "text-red-600 text-sm", children: [
7583
7579
  /* @__PURE__ */ r("strong", { children: "Error:" }),
7584
7580
  " ",
7585
7581
  U
7586
7582
  ] }),
7587
- b.map((N, g) => /* @__PURE__ */ r("p", { className: "text-red-600 text-sm", children: N }, g))
7583
+ f.map((N, h) => /* @__PURE__ */ r("p", { className: "text-red-600 text-sm", children: N }, h))
7588
7584
  ] }),
7589
7585
  w > 1 && /* @__PURE__ */ o("div", { className: "flex items-center gap-2 mb-4", children: [
7590
- S.map((N, g) => /* @__PURE__ */ r(
7586
+ S.map((N, h) => /* @__PURE__ */ r(
7591
7587
  "div",
7592
7588
  {
7593
- className: `h-1.5 rounded-full transition-all ${g === ce ? "flex-1" : "w-8"}`,
7594
- style: g === ce ? { backgroundColor: "var(--metakyc-primary, #2563eb)" } : g < ce ? { backgroundColor: "var(--metakyc-primary-light, #93c5fd)", opacity: 0.7 } : { backgroundColor: "#e5e7eb" }
7589
+ className: `h-1.5 rounded-full transition-all ${h === de ? "flex-1" : "w-8"}`,
7590
+ style: h === de ? { backgroundColor: "var(--metakyc-primary, #2563eb)" } : h < de ? { backgroundColor: "var(--metakyc-primary-light, #93c5fd)", opacity: 0.7 } : { backgroundColor: "#e5e7eb" }
7595
7591
  },
7596
- g
7592
+ h
7597
7593
  )),
7598
7594
  /* @__PURE__ */ o("span", { className: "text-xs text-gray-400 flex-shrink-0", children: [
7599
- ce + 1,
7595
+ de + 1,
7600
7596
  " / ",
7601
7597
  w
7602
7598
  ] })
7603
7599
  ] }),
7604
- at(p)
7600
+ at(u)
7605
7601
  ] }),
7606
- /* @__PURE__ */ o(Ce, { className: "flex justify-between", children: [
7602
+ /* @__PURE__ */ o(Se, { className: "flex justify-between", children: [
7607
7603
  /* @__PURE__ */ o("div", { children: [
7608
- !k && /* @__PURE__ */ r(
7604
+ !v && /* @__PURE__ */ r(
7609
7605
  Z,
7610
7606
  {
7611
7607
  type: "button",
7612
7608
  variant: "outline",
7613
7609
  onClick: () => {
7614
- me(pe), A({});
7610
+ pe(Ce), A({});
7615
7611
  },
7616
- disabled: W || m,
7612
+ disabled: H || m,
7617
7613
  children: "Previous"
7618
7614
  }
7619
7615
  ),
7620
- k && a && /* @__PURE__ */ r(Z, { type: "button", variant: "outline", onClick: a, disabled: W || m, children: "Cancel" })
7616
+ v && a && /* @__PURE__ */ r(Z, { type: "button", variant: "outline", onClick: a, disabled: H || m, children: "Cancel" })
7621
7617
  ] }),
7622
- /* @__PURE__ */ r(Z, { type: "button", isLoading: W || m, onClick: L ? Ne : $e, children: L ? p.conditionalOn && !i ? "Skip & Submit" : "Submit" : p.conditionalOn && !i ? "Skip" : "Next" })
7618
+ /* @__PURE__ */ r(Z, { type: "button", isLoading: H || m, onClick: L ? $e : Ne, children: L ? u.conditionalOn && !i ? "Skip & Submit" : "Submit" : u.conditionalOn && !i ? "Skip" : "Next" })
7623
7619
  ] })
7624
7620
  ] }) });
7625
7621
  }
7626
- return /* @__PURE__ */ r("div", { className: "metakyc-sdk", children: /* @__PURE__ */ r("form", { onSubmit: rt, children: /* @__PURE__ */ o(ee, { children: [
7627
- /* @__PURE__ */ r(we, { children: /* @__PURE__ */ r(pt, { title: (c == null ? void 0 : c.title) || "Company Registration" }) }),
7622
+ return /* @__PURE__ */ r("div", { className: "metakyc-sdk", children: /* @__PURE__ */ r("form", { onSubmit: nt, children: /* @__PURE__ */ o(ee, { children: [
7623
+ /* @__PURE__ */ r(ke, { children: /* @__PURE__ */ r(pt, { title: (c == null ? void 0 : c.title) || "Company Registration" }) }),
7628
7624
  /* @__PURE__ */ o(te, { children: [
7629
7625
  U && /* @__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: [
7630
7626
  /* @__PURE__ */ r("strong", { children: "Error:" }),
7631
7627
  " ",
7632
7628
  U
7633
7629
  ] }) }),
7634
- /* @__PURE__ */ r("div", { className: "grid grid-cols-4 gap-4", children: z.map((p) => /* @__PURE__ */ r("div", { className: "col-span-4", children: nt(p) }, p)) })
7630
+ /* @__PURE__ */ r("div", { className: "grid grid-cols-4 gap-4", children: z.map((u) => /* @__PURE__ */ r("div", { className: "col-span-4", children: Ge(u) }, u)) })
7635
7631
  ] }),
7636
- /* @__PURE__ */ o(Ce, { className: "flex justify-between", children: [
7637
- a && /* @__PURE__ */ r(Z, { type: "button", variant: "outline", onClick: a, disabled: W || m, children: "Cancel" }),
7638
- /* @__PURE__ */ r(Z, { type: "submit", isLoading: W || m, children: "Register Company" })
7632
+ /* @__PURE__ */ o(Se, { className: "flex justify-between", children: [
7633
+ a && /* @__PURE__ */ r(Z, { type: "button", variant: "outline", onClick: a, disabled: H || m, children: "Cancel" }),
7634
+ /* @__PURE__ */ r(Z, { type: "submit", isLoading: H || m, children: "Register Company" })
7639
7635
  ] })
7640
7636
  ] }) }) });
7641
7637
  }, Zn = ({
@@ -7650,22 +7646,22 @@ const Jn = ({
7650
7646
  currentStep: c,
7651
7647
  steps: d,
7652
7648
  workflowKey: m,
7653
- nextWorkflowKey: u,
7654
- hasWorkflowChanged: h,
7649
+ nextWorkflowKey: p,
7650
+ hasWorkflowChanged: b,
7655
7651
  isLoading: D,
7656
7652
  error: x,
7657
7653
  moveBack: P,
7658
7654
  refreshProgress: T
7659
- } = Ur(e), [S, R] = Se.useState(!1), z = Se.useRef(null);
7660
- if (Se.useEffect(() => {
7655
+ } = Ur(e), [S, I] = we.useState(!1), z = we.useRef(null);
7656
+ if (we.useEffect(() => {
7661
7657
  x && n && n(x);
7662
- }, [x, n]), Se.useEffect(() => {
7658
+ }, [x, n]), we.useEffect(() => {
7663
7659
  l != null && l.workflowResult && t && t(l.workflowResult);
7664
- }, [l == null ? void 0 : l.workflowResult, t]), Se.useEffect(() => {
7660
+ }, [l == null ? void 0 : l.workflowResult, t]), we.useEffect(() => {
7665
7661
  a === "dark" ? document.documentElement.classList.add("dark") : document.documentElement.classList.remove("dark");
7666
- }, [a]), Se.useEffect(() => {
7667
- h && R(!1);
7668
- }, [h]), D || !l)
7662
+ }, [a]), we.useEffect(() => {
7663
+ b && I(!1);
7664
+ }, [b]), D || !l)
7669
7665
  return /* @__PURE__ */ r("div", { className: `metakyc-sdk ${s || ""}`, children: /* @__PURE__ */ r(ee, { children: /* @__PURE__ */ o(te, { children: [
7670
7666
  /* @__PURE__ */ r(De, { className: "my-8" }),
7671
7667
  /* @__PURE__ */ r("p", { className: "text-center mt-4", style: { color: "var(--metakyc-text-secondary, #6b7280)" }, children: "Loading workflow..." })
@@ -7675,7 +7671,7 @@ const Jn = ({
7675
7671
  /* @__PURE__ */ r("p", { className: "text-lg mb-4", style: { color: "var(--metakyc-danger, #ef4444)" }, children: "An error occurred" }),
7676
7672
  /* @__PURE__ */ r("p", { style: { color: "var(--metakyc-text-secondary, #6b7280)" }, children: x.message })
7677
7673
  ] }) }) }) });
7678
- if (h && !S)
7674
+ if (b && !S)
7679
7675
  return /* @__PURE__ */ r("div", { className: `metakyc-sdk ${s || ""}`, children: /* @__PURE__ */ r(ee, { children: /* @__PURE__ */ r(te, { children: /* @__PURE__ */ o("div", { className: "text-center py-8", children: [
7680
7676
  /* @__PURE__ */ r("div", { className: "mb-6", children: /* @__PURE__ */ r("div", { className: "inline-flex items-center justify-center w-16 h-16 rounded-full mb-4", style: { backgroundColor: "var(--metakyc-primary-light, #dbeafe)" }, children: /* @__PURE__ */ r("svg", { className: "w-8 h-8", style: { color: "var(--metakyc-primary, #2563eb)" }, fill: "none", stroke: "currentColor", viewBox: "0 0 24 24", children: /* @__PURE__ */ r("path", { strokeLinecap: "round", strokeLinejoin: "round", strokeWidth: 2, d: "M13 16h-1v-4h-1m1-4h.01M21 12a9 9 0 11-18 0 9 9 0 0118 0z" }) }) }) }),
7681
7677
  /* @__PURE__ */ r("h3", { className: "text-xl font-semibold mb-2", style: { color: "var(--metakyc-text-primary, #111827)" }, children: "Workflow Transition" }),
@@ -7689,7 +7685,7 @@ const Jn = ({
7689
7685
  /* @__PURE__ */ r("svg", { className: "w-6 h-6 mx-4", style: { color: "var(--metakyc-text-muted, #9ca3af)" }, 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" }) }),
7690
7686
  /* @__PURE__ */ o("div", { className: "text-right", children: [
7691
7687
  /* @__PURE__ */ r("p", { className: "mb-1", style: { color: "var(--metakyc-text-muted, #9ca3af)" }, children: "New Workflow" }),
7692
- /* @__PURE__ */ r("p", { className: "font-medium", style: { color: "var(--metakyc-primary, #2563eb)" }, children: u })
7688
+ /* @__PURE__ */ r("p", { className: "font-medium", style: { color: "var(--metakyc-primary, #2563eb)" }, children: p })
7693
7689
  ] })
7694
7690
  ] }),
7695
7691
  l.nextWorkflowName && /* @__PURE__ */ r("p", { className: "text-center mt-2 text-xs", style: { color: "var(--metakyc-text-secondary, #6b7280)" }, children: l.nextWorkflowName })
@@ -7697,7 +7693,7 @@ const Jn = ({
7697
7693
  /* @__PURE__ */ r(
7698
7694
  "button",
7699
7695
  {
7700
- onClick: () => R(!0),
7696
+ onClick: () => I(!0),
7701
7697
  className: "px-6 py-3 font-medium rounded-lg transition-opacity hover:opacity-90",
7702
7698
  style: { backgroundColor: "var(--metakyc-primary, #2563eb)", color: "#ffffff" },
7703
7699
  children: "Continue with New Workflow"
@@ -7723,31 +7719,31 @@ const Jn = ({
7723
7719
  /* @__PURE__ */ r(De, { className: "my-8" }),
7724
7720
  /* @__PURE__ */ r("p", { className: "text-center mt-4", style: { color: "var(--metakyc-text-secondary, #6b7280)" }, children: l.status === Oe.IdentityPending ? "Loading identity verification..." : "Loading current step..." })
7725
7721
  ] }) }) });
7726
- const Q = (q) => {
7727
- switch (q) {
7728
- case oe.Overview:
7722
+ const Q = (K) => {
7723
+ switch (K) {
7724
+ case le.Overview:
7729
7725
  return "Overview";
7730
- case oe.Questionaries:
7726
+ case le.Questionaries:
7731
7727
  return "Questionnaire";
7732
- case oe.UploadDocument:
7728
+ case le.UploadDocument:
7733
7729
  return "Documents";
7734
- case oe.IdentitySdk:
7730
+ case le.IdentitySdk:
7735
7731
  return "Identity";
7736
- case oe.RiskScoring:
7732
+ case le.RiskScoring:
7737
7733
  return "Risk Assessment";
7738
- case oe.InvestorCategorization:
7734
+ case le.InvestorCategorization:
7739
7735
  return "Investor Categorization";
7740
- case oe.AppropriatenessTest:
7736
+ case le.AppropriatenessTest:
7741
7737
  return "Appropriateness Test";
7742
- case oe.AdditionalData:
7738
+ case le.AdditionalData:
7743
7739
  return "Additional Data";
7744
- case oe.ManualReview:
7740
+ case le.ManualReview:
7745
7741
  return "Review";
7746
7742
  default:
7747
7743
  return "";
7748
7744
  }
7749
7745
  }, M = () => {
7750
- const q = d.filter((V) => V.visibility !== !1), X = q.findIndex((V) => V.order === c.order), F = X >= 0 ? X + 1 : 1, f = q.length, B = f > 1 ? X / (f - 1) * 100 : 100;
7746
+ const K = d.filter((V) => V.visibility !== !1), X = K.findIndex((V) => V.order === c.order), F = X >= 0 ? X + 1 : 1, g = K.length, B = g > 1 ? X / (g - 1) * 100 : 100;
7751
7747
  return /* @__PURE__ */ o("div", { style: { marginBottom: "24px" }, children: [
7752
7748
  /* @__PURE__ */ o("div", { style: { display: "flex", alignItems: "flex-start", justifyContent: "space-between", marginBottom: "16px" }, children: [
7753
7749
  /* @__PURE__ */ r(pt, {}),
@@ -7755,7 +7751,7 @@ const Jn = ({
7755
7751
  "Step ",
7756
7752
  F,
7757
7753
  " of ",
7758
- f
7754
+ g
7759
7755
  ] })
7760
7756
  ] }),
7761
7757
  /* @__PURE__ */ r("div", { style: { marginBottom: "16px" }, children: /* @__PURE__ */ r("div", { style: {
@@ -7774,14 +7770,14 @@ const Jn = ({
7774
7770
  Pn,
7775
7771
  {
7776
7772
  ref: z,
7777
- visibleSteps: q,
7773
+ visibleSteps: K,
7778
7774
  currentVisibleStepIndex: X,
7779
7775
  getStepFallbackName: Q
7780
7776
  }
7781
7777
  )
7782
7778
  ] });
7783
- }, H = () => {
7784
- const q = {
7779
+ }, j = () => {
7780
+ const K = {
7785
7781
  applicantId: e,
7786
7782
  onComplete: async () => {
7787
7783
  await T();
@@ -7789,22 +7785,22 @@ const Jn = ({
7789
7785
  onBack: c.order > 0 ? P : void 0
7790
7786
  };
7791
7787
  switch (c.action) {
7792
- case oe.Questionaries:
7793
- return /* @__PURE__ */ r(pn, { ...q });
7794
- case oe.UploadDocument:
7795
- return /* @__PURE__ */ r(hn, { ...q });
7796
- case oe.Overview:
7797
- return /* @__PURE__ */ r(gn, { ...q });
7798
- case oe.IdentitySdk:
7799
- return /* @__PURE__ */ r(Fn, { ...q });
7800
- case oe.RiskScoring:
7801
- return /* @__PURE__ */ r(Sn, { ...q });
7802
- case oe.AdditionalData:
7803
- case oe.InvestorCategorization:
7804
- return /* @__PURE__ */ r(Nn, { ...q });
7805
- case oe.AppropriatenessTest:
7806
- return /* @__PURE__ */ r(In, { ...q });
7807
- case oe.ManualReview:
7788
+ case le.Questionaries:
7789
+ return /* @__PURE__ */ r(pn, { ...K });
7790
+ case le.UploadDocument:
7791
+ return /* @__PURE__ */ r(hn, { ...K });
7792
+ case le.Overview:
7793
+ return /* @__PURE__ */ r(gn, { ...K });
7794
+ case le.IdentitySdk:
7795
+ return /* @__PURE__ */ r(Fn, { ...K });
7796
+ case le.RiskScoring:
7797
+ return /* @__PURE__ */ r(Sn, { ...K });
7798
+ case le.AdditionalData:
7799
+ case le.InvestorCategorization:
7800
+ return /* @__PURE__ */ r(Nn, { ...K });
7801
+ case le.AppropriatenessTest:
7802
+ return /* @__PURE__ */ r(Rn, { ...K });
7803
+ case le.ManualReview:
7808
7804
  return /* @__PURE__ */ r(
7809
7805
  Pt,
7810
7806
  {
@@ -7823,19 +7819,19 @@ const Jn = ({
7823
7819
  ] }),
7824
7820
  /* @__PURE__ */ o("p", { className: "text-sm text-gray-500 dark:text-gray-400", children: [
7825
7821
  "Action type: ",
7826
- oe[c.action]
7822
+ le[c.action]
7827
7823
  ] })
7828
7824
  ] }) });
7829
7825
  }
7830
7826
  };
7831
7827
  return /* @__PURE__ */ o("div", { className: `metakyc-sdk ${s || ""}`, children: [
7832
7828
  M(),
7833
- H()
7829
+ j()
7834
7830
  ] });
7835
- }, Pn = Se.forwardRef(
7831
+ }, Pn = we.forwardRef(
7836
7832
  ({ visibleSteps: e, currentVisibleStepIndex: t, getStepFallbackName: n }, a) => {
7837
- const s = Se.useRef(null), l = Se.useRef(null);
7838
- return Se.useImperativeHandle(a, () => s.current), Se.useEffect(() => {
7833
+ const s = we.useRef(null), l = we.useRef(null);
7834
+ return we.useImperativeHandle(a, () => s.current), we.useEffect(() => {
7839
7835
  if (l.current && s.current) {
7840
7836
  const c = s.current, d = l.current, m = d.offsetLeft - c.offsetWidth / 2 + d.offsetWidth / 2;
7841
7837
  c.scrollTo({ left: Math.max(0, m), behavior: "smooth" });
@@ -7857,12 +7853,12 @@ const Jn = ({
7857
7853
  gap: "0"
7858
7854
  },
7859
7855
  children: e.map((c, d) => {
7860
- const m = d < t, u = d === t, h = m || u, D = c.displayName || c.name || n(c.action) || `Step ${d + 1}`;
7861
- return /* @__PURE__ */ o(Se.Fragment, { children: [
7856
+ const m = d < t, p = d === t, b = m || p, D = c.displayName || c.name || n(c.action) || `Step ${d + 1}`;
7857
+ return /* @__PURE__ */ o(we.Fragment, { children: [
7862
7858
  /* @__PURE__ */ o(
7863
7859
  "div",
7864
7860
  {
7865
- ref: u ? l : void 0,
7861
+ ref: p ? l : void 0,
7866
7862
  style: {
7867
7863
  display: "flex",
7868
7864
  alignItems: "center",
@@ -7880,7 +7876,7 @@ const Jn = ({
7880
7876
  fontWeight: 600,
7881
7877
  flexShrink: 0,
7882
7878
  transition: "all 0.2s ease",
7883
- ...h ? {
7879
+ ...b ? {
7884
7880
  backgroundColor: "var(--metakyc-primary, #2563eb)",
7885
7881
  color: "#ffffff",
7886
7882
  border: "none"
@@ -7894,8 +7890,8 @@ const Jn = ({
7894
7890
  marginLeft: "6px",
7895
7891
  fontSize: "13px",
7896
7892
  whiteSpace: "nowrap",
7897
- fontWeight: u ? 600 : 400,
7898
- color: u ? "var(--metakyc-text-primary, #111827)" : m ? "var(--metakyc-primary, #2563eb)" : "var(--metakyc-text-muted, #9ca3af)",
7893
+ fontWeight: p ? 600 : 400,
7894
+ color: p ? "var(--metakyc-text-primary, #111827)" : m ? "var(--metakyc-primary, #2563eb)" : "var(--metakyc-text-muted, #9ca3af)",
7899
7895
  transition: "color 0.2s ease"
7900
7896
  }, children: D })
7901
7897
  ]
@@ -7966,22 +7962,22 @@ function ra(e) {
7966
7962
  }
7967
7963
  const na = Ke.any();
7968
7964
  export {
7969
- It as ALLOWED_LANGUAGES,
7965
+ Rt as ALLOWED_LANGUAGES,
7970
7966
  Gt as ApplicantProgressOnHoldReason,
7971
7967
  Oe as ApplicantProgressStatus,
7972
7968
  pr as ApplicantService,
7973
7969
  Zt as ApplicantStatus,
7974
7970
  nr as AppropriatenessQuestionType,
7975
7971
  hr as AppropriatenessTestService,
7976
- In as AppropriatenessTestStep,
7972
+ Rn as AppropriatenessTestStep,
7977
7973
  zt as Badge,
7978
7974
  xr as BaseInformationService,
7979
7975
  Z as Button,
7980
7976
  it as COMPANY_FIELD_METADATA,
7981
7977
  ee as Card,
7982
7978
  te as CardContent,
7983
- Ce as CardFooter,
7984
- we as CardHeader,
7979
+ Se as CardFooter,
7980
+ ke as CardHeader,
7985
7981
  Qe as CountriesType,
7986
7982
  Gn as CreateApplicantForm,
7987
7983
  Jn as CreateCompanyApplicantForm,
@@ -7992,7 +7988,7 @@ export {
7992
7988
  dr as EndpointBuilder,
7993
7989
  ct as ErrorHandler,
7994
7990
  Er as EventEmitter,
7995
- tt as FIELD_METADATA,
7991
+ rt as FIELD_METADATA,
7996
7992
  tr as FileType,
7997
7993
  en as FileUpload,
7998
7994
  ft as GenderType,
@@ -8002,13 +7998,13 @@ export {
8002
7998
  br as IdentityService,
8003
7999
  Me as IdentityVerificationProvider,
8004
8000
  Fn as IdentityVerificationStep,
8005
- xe as Input,
8001
+ be as Input,
8006
8002
  vr as InvestorCategorizationService,
8007
8003
  Nn as InvestorCategorizationStep,
8008
- Re as InvestorCategorizationType,
8004
+ Ie as InvestorCategorizationType,
8009
8005
  sr as InvestorCategoryType,
8010
8006
  Xt as KycProcessStatus,
8011
- Xe as KycStatus,
8007
+ et as KycStatus,
8012
8008
  Pt as KycStatusDisplay,
8013
8009
  Zn as KycWorkflow,
8014
8010
  An as Logo,
@@ -8022,7 +8018,7 @@ export {
8022
8018
  tn as PhoneInput,
8023
8019
  mr as QuestionnaireService,
8024
8020
  pn as QuestionnaireStep,
8025
- et as ReviewStatus,
8021
+ tt as ReviewStatus,
8026
8022
  ar as RiskCriteriaType,
8027
8023
  Jt as RiskLevel,
8028
8024
  fr as RiskScoringService,
@@ -8035,7 +8031,7 @@ export {
8035
8031
  Lr as SumsubProvider,
8036
8032
  zr as ThemeManager,
8037
8033
  Ee as ThemePreset,
8038
- Rr as ThemeService,
8034
+ Ir as ThemeService,
8039
8035
  yr as UploadDocumentService,
8040
8036
  hn as UploadDocumentStep,
8041
8037
  er as UserType,
@@ -8043,7 +8039,7 @@ export {
8043
8039
  Pr as WorkflowOrchestrator,
8044
8040
  gt as WorkflowResultType,
8045
8041
  Fr as WorkflowState,
8046
- oe as WorkflowStepAction,
8042
+ le as WorkflowStepAction,
8047
8043
  na as appropriatenessTestSchema,
8048
8044
  Yn as clearAllStorage,
8049
8045
  jr as clearApplicantId,
@@ -8071,7 +8067,7 @@ export {
8071
8067
  Hn as removeScript,
8072
8068
  $r as saveApplicantId,
8073
8069
  Hr as saveWorkflowState,
8074
- Ir as themePresets,
8070
+ Rr as themePresets,
8075
8071
  Ot as useApplicant,
8076
8072
  Qn as useAppropriatenessTest,
8077
8073
  Yr as useIdentityVerification,