@vpdev2/metakyc-sdk 1.0.35 → 1.0.36

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
@@ -8,7 +8,7 @@ import { jsx as a, jsxs as o, Fragment as Qe } from "react/jsx-runtime";
8
8
  import { useForm as Ve, Controller as ye } from "react-hook-form";
9
9
  import { z as ue } from "zod";
10
10
  var O = /* @__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))(O || {}), Se = /* @__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))(Se || {}), le = /* @__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))(le || {}), Ge = /* @__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))(Ge || {}), Ze = /* @__PURE__ */ ((e) => (e[e.LowRisk = 0] = "LowRisk", e[e.MediumRisk = 1] = "MediumRisk", e[e.HighRisk = 2] = "HighRisk", e[e.Alert = 3] = "Alert", e))(Ze || {}), fe = /* @__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))(fe || {}), be = /* @__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))(be || {}), Je = /* @__PURE__ */ ((e) => (e[e.ProviderResultPending = 0] = "ProviderResultPending", e[e.ProviderResultReceived = 1] = "ProviderResultReceived", e[e.Canceled = 2] = "Canceled", e[e.ExtendedToNewApplicant = 3] = "ExtendedToNewApplicant", e))(Je || {}), Xe = /* @__PURE__ */ ((e) => (e[e.None = 0] = "None", e[e.ProviderResultPending = 1] = "ProviderResultPending", e[e.ProviderResultReceived = 2] = "ProviderResultReceived", e[e.Canceled = 3] = "Canceled", e))(Xe || {}), oe = /* @__PURE__ */ ((e) => (e[e.Onfido = 0] = "Onfido", e[e.Sumsub = 2] = "Sumsub", e[e.SardinAI = 3] = "SardinAI", e))(oe || {}), et = /* @__PURE__ */ ((e) => (e[e.Individual = 0] = "Individual", e[e.Company = 1] = "Company", e))(et || {}), Ce = /* @__PURE__ */ ((e) => (e[e.Male = 0] = "Male", e[e.Female = 1] = "Female", e[e.Other = 2] = "Other", e))(Ce || {}), tt = /* @__PURE__ */ ((e) => (e[e.Image = 0] = "Image", e[e.Video = 1] = "Video", e[e.PDF = 2] = "PDF", e[e.OfficePDF = 3] = "OfficePDF", e[e.Custom = 4] = "Custom", e))(tt || {}), rt = /* @__PURE__ */ ((e) => (e[e.Pending = 0] = "Pending", e[e.Approved = 1] = "Approved", e[e.Rejected = 2] = "Rejected", e[e.RequiresRevision = 3] = "RequiresRevision", e))(rt || {}), at = /* @__PURE__ */ ((e) => (e[e.SingleChoice = 0] = "SingleChoice", e[e.MultipleChoice = 1] = "MultipleChoice", e[e.Text = 2] = "Text", e))(at || {}), he = /* @__PURE__ */ ((e) => (e[e.String = 0] = "String", e[e.Integer = 1] = "Integer", e[e.Decimal = 2] = "Decimal", e[e.Boolean = 3] = "Boolean", e[e.Date = 4] = "Date", e[e.Country = 5] = "Country", e[e.DigitOnly = 6] = "DigitOnly", e))(he || {}), nt = /* @__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))(nt || {}), st = /* @__PURE__ */ ((e) => (e[e.None = 0] = "None", e[e.Country = 1] = "Country", e))(st || {}), 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 || {}), it = /* @__PURE__ */ ((e) => (e[e.Retail = 0] = "Retail", e[e.Professional = 1] = "Professional", e[e.EligibleCounterparty = 2] = "EligibleCounterparty", e))(it || {});
11
- const Pe = [
11
+ const Le = [
12
12
  { value: "EN", label: "English" },
13
13
  { value: "DE", label: "German" },
14
14
  { value: "FR", label: "French" },
@@ -64,7 +64,7 @@ const Pe = [
64
64
  "occupation",
65
65
  "taxNumber",
66
66
  "externalRefId"
67
- ], Le = {
67
+ ], Pe = {
68
68
  firstName: { label: "First Name", type: "text" },
69
69
  lastName: { label: "Last Name", type: "text" },
70
70
  title: { label: "Title", type: "text" },
@@ -1411,7 +1411,7 @@ class Ft {
1411
1411
  this.sdk && this.sdk.on("idCheck.onError", t);
1412
1412
  }
1413
1413
  }
1414
- class Pt {
1414
+ class Lt {
1415
1415
  constructor(t) {
1416
1416
  H(this, "sdk", null);
1417
1417
  H(this, "config");
@@ -1477,7 +1477,7 @@ class Pt {
1477
1477
  this.sdk && (this.sdk.tearDown(), this.sdk = null);
1478
1478
  }
1479
1479
  }
1480
- class Lt {
1480
+ class Pt {
1481
1481
  constructor(t) {
1482
1482
  H(this, "sardineContext", null);
1483
1483
  H(this, "config");
@@ -1630,9 +1630,9 @@ class xe {
1630
1630
  case oe.Sumsub:
1631
1631
  return new Ft(r);
1632
1632
  case oe.Onfido:
1633
- return new Pt(r);
1634
- case oe.SardinAI:
1635
1633
  return new Lt(r);
1634
+ case oe.SardinAI:
1635
+ return new Pt(r);
1636
1636
  default:
1637
1637
  throw new Error(`Unsupported identity provider: ${t}`);
1638
1638
  }
@@ -1869,7 +1869,7 @@ async function Tt(e) {
1869
1869
  function Fr(e, t) {
1870
1870
  return e.size <= t;
1871
1871
  }
1872
- function Pr(e, t) {
1872
+ function Lr(e, t) {
1873
1873
  return t.split(",").map((n) => n.trim()).some((n) => {
1874
1874
  if (n.endsWith("/*")) {
1875
1875
  const s = n.slice(0, -2);
@@ -1883,7 +1883,7 @@ function Re(e) {
1883
1883
  const t = 1024, r = ["Bytes", "KB", "MB", "GB"], n = Math.floor(Math.log(e) / Math.log(t));
1884
1884
  return Math.round(e / Math.pow(t, n) * 100) / 100 + " " + r[n];
1885
1885
  }
1886
- function Lr(e) {
1886
+ function Pr(e) {
1887
1887
  return e;
1888
1888
  }
1889
1889
  function J(...e) {
@@ -3158,8 +3158,8 @@ const ir = ({
3158
3158
  [n]
3159
3159
  ), N = p === m.length - 1, h = m[p] ?? [], x = K((D, z) => {
3160
3160
  u((g) => ({ ...g, [D]: z })), w((g) => {
3161
- const L = { ...g };
3162
- return delete L[D], L;
3161
+ const P = { ...g };
3162
+ return delete P[D], P;
3163
3163
  });
3164
3164
  }, []), E = K(() => {
3165
3165
  const D = {};
@@ -3176,9 +3176,9 @@ const ir = ({
3176
3176
  if (!(!E() || !n))
3177
3177
  try {
3178
3178
  const D = n.questionGroups.flatMap(
3179
- (g) => (g.questions ?? []).map((L) => ({
3180
- questionId: L.id,
3181
- values: d[L.id] ?? []
3179
+ (g) => (g.questions ?? []).map((P) => ({
3180
+ questionId: P.id,
3181
+ values: d[P.id] ?? []
3182
3182
  }))
3183
3183
  ), z = {
3184
3184
  applicantId: e,
@@ -3296,11 +3296,12 @@ const ir = ({
3296
3296
  required: e.isRequired
3297
3297
  }
3298
3298
  ),
3299
- i === "radio" && /* @__PURE__ */ o("div", { style: { display: "flex", flexDirection: "column", gap: "8px" }, children: [
3299
+ i === "radio" && /* @__PURE__ */ o("div", { className: "metakyc-options-group", style: { display: "flex", flexDirection: "column", gap: "8px" }, children: [
3300
3300
  (e.defaultAnswers ?? []).map((c) => /* @__PURE__ */ o(
3301
3301
  "label",
3302
3302
  {
3303
- style: { display: "flex", alignItems: "center", gap: "10px", cursor: "pointer", margin: 0 },
3303
+ className: "metakyc-option-label",
3304
+ style: { display: "flex", alignItems: "center", gap: "10px", cursor: "pointer", margin: 0, padding: 0 },
3304
3305
  children: [
3305
3306
  /* @__PURE__ */ a(
3306
3307
  "input",
@@ -3308,28 +3309,35 @@ const ir = ({
3308
3309
  type: "radio",
3309
3310
  checked: t[0] === c,
3310
3311
  onChange: () => n([c]),
3312
+ className: "metakyc-option-input",
3311
3313
  style: {
3312
3314
  width: "16px",
3313
3315
  height: "16px",
3316
+ minWidth: "16px",
3314
3317
  flexShrink: 0,
3318
+ flexGrow: 0,
3315
3319
  accentColor: "var(--metakyc-primary, #2563eb)",
3316
3320
  cursor: "pointer",
3317
- margin: 0
3321
+ margin: 0,
3322
+ padding: 0,
3323
+ display: "inline-block",
3324
+ verticalAlign: "middle"
3318
3325
  }
3319
3326
  }
3320
3327
  ),
3321
- /* @__PURE__ */ a("span", { style: { fontSize: "14px", color: "var(--metakyc-text-primary, #111827)", lineHeight: "1.4" }, children: c })
3328
+ /* @__PURE__ */ a("span", { className: "metakyc-option-text", style: { fontSize: "14px", color: "var(--metakyc-text-primary, #111827)", lineHeight: "1.4", marginLeft: 0 }, children: c })
3322
3329
  ]
3323
3330
  },
3324
3331
  c
3325
3332
  )),
3326
3333
  r && /* @__PURE__ */ a("p", { className: "text-sm text-danger-500", children: r })
3327
3334
  ] }),
3328
- (i === "checkbox" || i === "multi-select") && /* @__PURE__ */ o("div", { style: { display: "flex", flexDirection: "column", gap: "8px" }, children: [
3335
+ (i === "checkbox" || i === "multi-select") && /* @__PURE__ */ o("div", { className: "metakyc-options-group", style: { display: "flex", flexDirection: "column", gap: "8px" }, children: [
3329
3336
  (e.defaultAnswers ?? []).map((c) => /* @__PURE__ */ o(
3330
3337
  "label",
3331
3338
  {
3332
- style: { display: "flex", alignItems: "center", gap: "10px", cursor: "pointer", margin: 0 },
3339
+ className: "metakyc-option-label",
3340
+ style: { display: "flex", alignItems: "center", gap: "10px", cursor: "pointer", margin: 0, padding: 0 },
3333
3341
  children: [
3334
3342
  /* @__PURE__ */ a(
3335
3343
  "input",
@@ -3339,18 +3347,23 @@ const ir = ({
3339
3347
  onChange: (d) => {
3340
3348
  d.target.checked ? n([...t, c]) : n(t.filter((u) => u !== c));
3341
3349
  },
3350
+ className: "metakyc-option-input",
3342
3351
  style: {
3343
3352
  width: "16px",
3344
3353
  height: "16px",
3354
+ minWidth: "16px",
3345
3355
  flexShrink: 0,
3356
+ flexGrow: 0,
3346
3357
  accentColor: "var(--metakyc-primary, #2563eb)",
3347
3358
  cursor: "pointer",
3348
3359
  margin: 0,
3349
- borderRadius: "3px"
3360
+ padding: 0,
3361
+ display: "inline-block",
3362
+ verticalAlign: "middle"
3350
3363
  }
3351
3364
  }
3352
3365
  ),
3353
- /* @__PURE__ */ a("span", { style: { fontSize: "14px", color: "var(--metakyc-text-primary, #111827)", lineHeight: "1.4" }, children: c })
3366
+ /* @__PURE__ */ a("span", { className: "metakyc-option-text", style: { fontSize: "14px", color: "var(--metakyc-text-primary, #111827)", lineHeight: "1.4", marginLeft: 0 }, children: c })
3354
3367
  ]
3355
3368
  },
3356
3369
  c
@@ -3502,18 +3515,18 @@ const pr = ({
3502
3515
  ie.useEffect(() => {
3503
3516
  !s && n && n.length === 0 && !m && !i && (N(!0), c({ applicantId: e, criteriaValueInputs: [] }).then(() => t == null ? void 0 : t()).catch(console.error));
3504
3517
  }, [s, n, m, i, c, e, t]);
3505
- const S = K((g, L) => {
3506
- u((F) => ({ ...F, [g]: L })), w((F) => {
3518
+ const S = K((g, P) => {
3519
+ u((F) => ({ ...F, [g]: P })), w((F) => {
3507
3520
  const G = { ...F };
3508
3521
  return delete G[g], G;
3509
3522
  });
3510
3523
  }, []), I = K(() => {
3511
3524
  const g = {};
3512
- for (const { criterion: L } of E) {
3513
- const F = dr(L, d[L.id] ?? []);
3514
- F && (g[L.id] = F);
3525
+ for (const { criterion: P } of E) {
3526
+ const F = dr(P, d[P.id] ?? []);
3527
+ F && (g[P.id] = F);
3515
3528
  }
3516
- return w((L) => ({ ...L, ...g })), Object.keys(g).length === 0;
3529
+ return w((P) => ({ ...P, ...g })), Object.keys(g).length === 0;
3517
3530
  }, [E, d]), Y = () => {
3518
3531
  I() && b((g) => g + 1);
3519
3532
  }, D = () => {
@@ -3550,17 +3563,17 @@ const pr = ({
3550
3563
  " of ",
3551
3564
  h.length
3552
3565
  ] }),
3553
- /* @__PURE__ */ a("div", { className: "flex items-center gap-1.5", children: h.map((g, L) => /* @__PURE__ */ a(
3566
+ /* @__PURE__ */ a("div", { className: "flex items-center gap-1.5", children: h.map((g, P) => /* @__PURE__ */ a(
3554
3567
  "div",
3555
3568
  {
3556
3569
  className: "rounded-full transition-all duration-200",
3557
3570
  style: {
3558
3571
  height: "6px",
3559
- width: L === p ? "20px" : "6px",
3560
- backgroundColor: L <= p ? "var(--metakyc-primary, #2563eb)" : "var(--metakyc-border, #e5e7eb)"
3572
+ width: P === p ? "20px" : "6px",
3573
+ backgroundColor: P <= p ? "var(--metakyc-primary, #2563eb)" : "var(--metakyc-border, #e5e7eb)"
3561
3574
  }
3562
3575
  },
3563
- L
3576
+ P
3564
3577
  )) })
3565
3578
  ] })
3566
3579
  ] }),
@@ -3570,7 +3583,7 @@ const pr = ({
3570
3583
  criterion: g,
3571
3584
  value: d[g.id] ?? [],
3572
3585
  error: k[g.id],
3573
- onChange: (L) => S(g.id, L)
3586
+ onChange: (P) => S(g.id, P)
3574
3587
  },
3575
3588
  g.id
3576
3589
  )) }),
@@ -3628,11 +3641,12 @@ const pr = ({
3628
3641
  }
3629
3642
  }
3630
3643
  ),
3631
- s === "radio" && /* @__PURE__ */ o("div", { style: { display: "flex", flexDirection: "column", gap: "8px" }, children: [
3644
+ s === "radio" && /* @__PURE__ */ o("div", { className: "metakyc-options-group", style: { display: "flex", flexDirection: "column", gap: "8px" }, children: [
3632
3645
  (e.defaultValues ?? []).map((l) => /* @__PURE__ */ o(
3633
3646
  "label",
3634
3647
  {
3635
- style: { display: "flex", alignItems: "center", gap: "10px", cursor: "pointer", margin: 0 },
3648
+ className: "metakyc-option-label",
3649
+ style: { display: "flex", alignItems: "center", gap: "10px", cursor: "pointer", margin: 0, padding: 0 },
3636
3650
  children: [
3637
3651
  /* @__PURE__ */ a(
3638
3652
  "input",
@@ -3640,28 +3654,35 @@ const pr = ({
3640
3654
  type: "radio",
3641
3655
  checked: t[0] === l,
3642
3656
  onChange: () => n([l]),
3657
+ className: "metakyc-option-input",
3643
3658
  style: {
3644
3659
  width: "16px",
3645
3660
  height: "16px",
3661
+ minWidth: "16px",
3646
3662
  flexShrink: 0,
3663
+ flexGrow: 0,
3647
3664
  accentColor: "var(--metakyc-primary, #2563eb)",
3648
3665
  cursor: "pointer",
3649
- margin: 0
3666
+ margin: 0,
3667
+ padding: 0,
3668
+ display: "inline-block",
3669
+ verticalAlign: "middle"
3650
3670
  }
3651
3671
  }
3652
3672
  ),
3653
- /* @__PURE__ */ a("span", { style: { fontSize: "14px", color: "var(--metakyc-text-primary, #111827)", lineHeight: "1.4" }, children: l })
3673
+ /* @__PURE__ */ a("span", { className: "metakyc-option-text", style: { fontSize: "14px", color: "var(--metakyc-text-primary, #111827)", lineHeight: "1.4", marginLeft: 0 }, children: l })
3654
3674
  ]
3655
3675
  },
3656
3676
  l
3657
3677
  )),
3658
3678
  r && /* @__PURE__ */ a("p", { className: "text-sm text-danger-500", children: r })
3659
3679
  ] }),
3660
- s === "checkbox" && /* @__PURE__ */ o("div", { style: { display: "flex", flexDirection: "column", gap: "8px" }, children: [
3680
+ s === "checkbox" && /* @__PURE__ */ o("div", { className: "metakyc-options-group", style: { display: "flex", flexDirection: "column", gap: "8px" }, children: [
3661
3681
  (e.defaultValues ?? []).map((l) => /* @__PURE__ */ o(
3662
3682
  "label",
3663
3683
  {
3664
- style: { display: "flex", alignItems: "center", gap: "10px", cursor: "pointer", margin: 0 },
3684
+ className: "metakyc-option-label",
3685
+ style: { display: "flex", alignItems: "center", gap: "10px", cursor: "pointer", margin: 0, padding: 0 },
3665
3686
  children: [
3666
3687
  /* @__PURE__ */ a(
3667
3688
  "input",
@@ -3671,18 +3692,23 @@ const pr = ({
3671
3692
  onChange: (c) => {
3672
3693
  c.target.checked ? n([...t, l]) : n(t.filter((d) => d !== l));
3673
3694
  },
3695
+ className: "metakyc-option-input",
3674
3696
  style: {
3675
3697
  width: "16px",
3676
3698
  height: "16px",
3699
+ minWidth: "16px",
3677
3700
  flexShrink: 0,
3701
+ flexGrow: 0,
3678
3702
  accentColor: "var(--metakyc-primary, #2563eb)",
3679
3703
  cursor: "pointer",
3680
3704
  margin: 0,
3681
- borderRadius: "3px"
3705
+ padding: 0,
3706
+ display: "inline-block",
3707
+ verticalAlign: "middle"
3682
3708
  }
3683
3709
  }
3684
3710
  ),
3685
- /* @__PURE__ */ a("span", { style: { fontSize: "14px", color: "var(--metakyc-text-primary, #111827)", lineHeight: "1.4" }, children: l })
3711
+ /* @__PURE__ */ a("span", { className: "metakyc-option-text", style: { fontSize: "14px", color: "var(--metakyc-text-primary, #111827)", lineHeight: "1.4", marginLeft: 0 }, children: l })
3686
3712
  ]
3687
3713
  },
3688
3714
  l
@@ -3870,8 +3896,8 @@ const pr = ({
3870
3896
  const D = (R) => {
3871
3897
  const C = R.split(":").map(Number);
3872
3898
  if (C.length === 3) {
3873
- const [q, f, P] = C;
3874
- return q * 3600 + f * 60 + P;
3899
+ const [q, f, L] = C;
3900
+ return q * 3600 + f * 60 + L;
3875
3901
  }
3876
3902
  return 0;
3877
3903
  }, z = (R) => {
@@ -3895,7 +3921,7 @@ const pr = ({
3895
3921
  }, [E]);
3896
3922
  const g = () => {
3897
3923
  s && (x(!0), N(s.testDurationSec));
3898
- }, L = (R, C) => {
3924
+ }, P = (R, C) => {
3899
3925
  b((q) => ({
3900
3926
  ...q,
3901
3927
  [R]: C
@@ -3928,8 +3954,8 @@ const pr = ({
3928
3954
  console.log("Appropriateness test result:", f), f.message && (f.message.toLowerCase().includes("pass") || f.message.toLowerCase().includes("success") || f.message.toLowerCase().includes("congratulations")) ? t == null || t() : (w(f.message || "Test completed. Please check the result."), x(!1), S(!1), b({}), setTimeout(() => G(), 1e3));
3929
3955
  } catch (f) {
3930
3956
  if (f.code === 400 && f.message) {
3931
- const P = f.message;
3932
- console.log("Test failed:", P), w(P), x(!1), S(!1), b({}), setTimeout(() => G(), 1500);
3957
+ const L = f.message;
3958
+ console.log("Test failed:", L), w(L), x(!1), S(!1), b({}), setTimeout(() => G(), 1500);
3933
3959
  } else
3934
3960
  throw f;
3935
3961
  }
@@ -4037,7 +4063,7 @@ Failed to reload test data. Please refresh the page.`);
4037
4063
  name: `question-${R.id}`,
4038
4064
  value: q,
4039
4065
  checked: p[R.id] === q,
4040
- onChange: (P) => L(R.id, P.target.value),
4066
+ onChange: (L) => P(R.id, L.target.value),
4041
4067
  className: "h-4 w-4 text-primary-500 border-gray-300 focus:ring-primary-500",
4042
4068
  disabled: d
4043
4069
  }
@@ -4132,8 +4158,8 @@ Failed to reload test data. Please refresh the page.`);
4132
4158
  onComplete: t,
4133
4159
  onBack: r
4134
4160
  }) => {
4135
- var q, f, P, $;
4136
- const { applicantService: n, baseInformationService: s, config: i } = se(), { identityData: l, provider: c, token: d, isLoading: u, error: k, requestIdentity: w, restartIdentity: p } = qt(e), [b, m] = v(null), [N, h] = v(null), [x, E] = v([]), [S, I] = v(!0), [Y, D] = v(!1), [z, g] = v(null), [L, F] = v(!1), G = ie.useRef(!1), j = Ve({
4161
+ var q, f, L, $;
4162
+ const { applicantService: n, baseInformationService: s, config: i } = se(), { identityData: l, provider: c, token: d, isLoading: u, error: k, requestIdentity: w, restartIdentity: p } = qt(e), [b, m] = v(null), [N, h] = v(null), [x, E] = v([]), [S, I] = v(!0), [Y, D] = v(!1), [z, g] = v(null), [P, F] = v(!1), G = ie.useRef(!1), j = Ve({
4137
4163
  defaultValues: {
4138
4164
  street: "",
4139
4165
  streetNumber: "",
@@ -4207,7 +4233,7 @@ Failed to reload test data. Please refresh the page.`);
4207
4233
  }
4208
4234
  }
4209
4235
  }, [d]), V(() => {
4210
- if (c !== null && d && !b && Y && !L) {
4236
+ if (c !== null && d && !b && Y && !P) {
4211
4237
  const A = c;
4212
4238
  if (d.url) {
4213
4239
  console.log("[Identity] Loading provider URL for user verification:", d.url), g(null);
@@ -4273,7 +4299,7 @@ Failed to reload test data. Please refresh the page.`);
4273
4299
  console.error("[Identity] Error destroying provider:", A);
4274
4300
  }
4275
4301
  };
4276
- }, [c, d, b, Y, t, L]);
4302
+ }, [c, d, b, Y, t, P]);
4277
4303
  const R = async () => {
4278
4304
  try {
4279
4305
  g(null), F(!1), await w(), D(!0);
@@ -4297,7 +4323,7 @@ Failed to reload test data. Please refresh the page.`);
4297
4323
  "Error: ",
4298
4324
  k.message
4299
4325
  ] }) }) });
4300
- if (Y && (z || L))
4326
+ if (Y && (z || P))
4301
4327
  return /* @__PURE__ */ o(M, { children: [
4302
4328
  /* @__PURE__ */ a(te, { children: /* @__PURE__ */ a("h2", { className: "text-2xl font-bold text-gray-900 dark:text-white", children: "Verification Session Issue" }) }),
4303
4329
  /* @__PURE__ */ o(T, { children: [
@@ -4321,7 +4347,7 @@ Failed to reload test data. Please refresh the page.`);
4321
4347
  }
4322
4348
  ),
4323
4349
  /* @__PURE__ */ o("div", { children: [
4324
- /* @__PURE__ */ a("h3", { className: "font-semibold text-red-900 dark:text-red-100 mb-1", children: L ? "Session Expired" : "Verification Error" }),
4350
+ /* @__PURE__ */ a("h3", { className: "font-semibold text-red-900 dark:text-red-100 mb-1", children: P ? "Session Expired" : "Verification Error" }),
4325
4351
  /* @__PURE__ */ a("p", { className: "text-red-800 dark:text-red-200 text-sm", children: z || "Your verification session has expired and needs to be restarted." })
4326
4352
  ] })
4327
4353
  ] }) }),
@@ -4424,7 +4450,7 @@ Failed to reload test data. Please refresh the page.`);
4424
4450
  ] }),
4425
4451
  /* @__PURE__ */ o("div", { children: [
4426
4452
  /* @__PURE__ */ a("label", { className: "block text-sm font-medium text-gray-500 dark:text-gray-400", children: "Email" }),
4427
- /* @__PURE__ */ a("p", { className: "mt-1 text-base", children: (P = N == null ? void 0 : N.applicantRequestData) == null ? void 0 : P.email })
4453
+ /* @__PURE__ */ a("p", { className: "mt-1 text-base", children: (L = N == null ? void 0 : N.applicantRequestData) == null ? void 0 : L.email })
4428
4454
  ] }),
4429
4455
  /* @__PURE__ */ o("div", { children: [
4430
4456
  /* @__PURE__ */ a("label", { className: "block text-sm font-medium text-gray-500 dark:text-gray-400", children: "Date of Birth" }),
@@ -4719,20 +4745,20 @@ Failed to reload test data. Please refresh the page.`);
4719
4745
  "workflowKey is required. Provide it either as a prop to CreateApplicantForm or set it in config.applicantForm.workflowKey"
4720
4746
  );
4721
4747
  const I = t || ((C = s.applicantForm) == null ? void 0 : C.externalRefId) || "", Y = ["firstName", "lastName", "email", "phonenumber", "dateOfBirth"], D = ie.useMemo(() => {
4722
- const f = new Set(Y), P = l == null ? void 0 : l.applicantFormRequiredFields;
4723
- if (P && P.length > 0)
4724
- for (const $ of P)
4748
+ const f = new Set(Y), L = l == null ? void 0 : l.applicantFormRequiredFields;
4749
+ if (L && L.length > 0)
4750
+ for (const $ of L)
4725
4751
  f.add($);
4726
4752
  return Array.from(f);
4727
4753
  }, [l == null ? void 0 : l.applicantFormRequiredFields]), z = ie.useMemo(() => {
4728
4754
  var $;
4729
4755
  let f;
4730
4756
  ($ = s.applicantForm) != null && $.visibleFields ? f = s.applicantForm.visibleFields : l != null && l.applicantFormVisibleFields && l.applicantFormVisibleFields.length > 0 ? f = l.applicantFormVisibleFields : f = ot;
4731
- const P = new Set(f);
4757
+ const L = new Set(f);
4732
4758
  for (const A of Y)
4733
- P.add(A);
4734
- return Array.from(P);
4735
- }, [(q = s.applicantForm) == null ? void 0 : q.visibleFields, l == null ? void 0 : l.applicantFormVisibleFields]), [g, L] = v({
4759
+ L.add(A);
4760
+ return Array.from(L);
4761
+ }, [(q = s.applicantForm) == null ? void 0 : q.visibleFields, l == null ? void 0 : l.applicantFormVisibleFields]), [g, P] = v({
4736
4762
  workflowKey: S,
4737
4763
  firstName: "",
4738
4764
  lastName: "",
@@ -4767,22 +4793,22 @@ Failed to reload test data. Please refresh the page.`);
4767
4793
  }
4768
4794
  x.current = !0, p(!0);
4769
4795
  try {
4770
- const P = await i.getCountries("", s.locale || "en"), $ = /* @__PURE__ */ new Set(), A = P.map((y) => ({
4796
+ const L = await i.getCountries("", s.locale || "en"), $ = /* @__PURE__ */ new Set(), A = L.map((y) => ({
4771
4797
  value: y.abbreviation3 || y.abbreviation,
4772
4798
  label: y.name
4773
4799
  })).filter((y) => !y.value || $.has(y.value) ? !1 : ($.add(y.value), !0));
4774
4800
  k(A), E.current = !0;
4775
- } catch (P) {
4776
- console.error("Failed to load countries:", P);
4801
+ } catch (L) {
4802
+ console.error("Failed to load countries:", L);
4777
4803
  } finally {
4778
4804
  p(!1), x.current = !1;
4779
4805
  }
4780
4806
  })();
4781
4807
  }, []);
4782
- const F = (f, P) => {
4783
- L(($) => ({ ...$, [f]: P }));
4808
+ const F = (f, L) => {
4809
+ P(($) => ({ ...$, [f]: L }));
4784
4810
  }, G = async (f) => {
4785
- var P;
4811
+ var L;
4786
4812
  f.preventDefault(), m(!0), h(null);
4787
4813
  try {
4788
4814
  if (!g.externalRefId || g.externalRefId.trim() === "") {
@@ -4792,7 +4818,7 @@ Failed to reload test data. Please refresh the page.`);
4792
4818
  for (const y of D) {
4793
4819
  const B = g[y];
4794
4820
  if (B == null || B === "" || Array.isArray(B) && B.length === 0) {
4795
- const X = ((P = Le[y]) == null ? void 0 : P.label) || y;
4821
+ const X = ((L = Pe[y]) == null ? void 0 : L.label) || y;
4796
4822
  h(`${X} is required.`), m(!1);
4797
4823
  return;
4798
4824
  }
@@ -4818,18 +4844,18 @@ Failed to reload test data. Please refresh the page.`);
4818
4844
  }
4819
4845
  }, j = (f) => {
4820
4846
  var A;
4821
- const P = Le[f], $ = D.includes(f);
4822
- switch (P.type) {
4847
+ const L = Pe[f], $ = D.includes(f);
4848
+ switch (L.type) {
4823
4849
  case "select":
4824
4850
  if (f === "country" || f === "nationality" || f === "taxCountry" || f === "countryOfBirth")
4825
4851
  return /* @__PURE__ */ a(
4826
4852
  ge,
4827
4853
  {
4828
- label: P.label,
4854
+ label: L.label,
4829
4855
  value: g[f] || "",
4830
4856
  onChange: (y) => F(f, y.target.value),
4831
4857
  options: [
4832
- { value: "", label: `Select ${P.label.toLowerCase()}...` },
4858
+ { value: "", label: `Select ${L.label.toLowerCase()}...` },
4833
4859
  ...u
4834
4860
  ],
4835
4861
  disabled: w,
@@ -4841,7 +4867,7 @@ Failed to reload test data. Please refresh the page.`);
4841
4867
  return /* @__PURE__ */ a(
4842
4868
  ge,
4843
4869
  {
4844
- label: P.label,
4870
+ label: L.label,
4845
4871
  value: ((A = g[f]) == null ? void 0 : A.toString()) || "",
4846
4872
  onChange: (y) => F(f, y.target.value ? Number(y.target.value) : null),
4847
4873
  options: [
@@ -4855,11 +4881,11 @@ Failed to reload test data. Please refresh the page.`);
4855
4881
  f
4856
4882
  );
4857
4883
  if (f === "defaultLanguage") {
4858
- const y = l != null && l.allowedLanguages && l.allowedLanguages.length > 0 ? Pe.filter((B) => l.allowedLanguages.includes(B.value)) : Pe;
4884
+ const y = l != null && l.allowedLanguages && l.allowedLanguages.length > 0 ? Le.filter((B) => l.allowedLanguages.includes(B.value)) : Le;
4859
4885
  return /* @__PURE__ */ a(
4860
4886
  ge,
4861
4887
  {
4862
- label: P.label,
4888
+ label: L.label,
4863
4889
  value: g[f] || "",
4864
4890
  onChange: (B) => F(f, B.target.value),
4865
4891
  options: [
@@ -4876,7 +4902,7 @@ Failed to reload test data. Please refresh the page.`);
4876
4902
  return f === "otherNationality" ? /* @__PURE__ */ a(
4877
4903
  Qt,
4878
4904
  {
4879
- label: P.label,
4905
+ label: L.label,
4880
4906
  value: g[f] || [],
4881
4907
  onChange: (y) => F(f, y),
4882
4908
  options: u,
@@ -4891,7 +4917,7 @@ Failed to reload test data. Please refresh the page.`);
4891
4917
  ae,
4892
4918
  {
4893
4919
  type: "date",
4894
- label: P.label,
4920
+ label: L.label,
4895
4921
  value: g[f] || "",
4896
4922
  onChange: (y) => F(f, y.target.value),
4897
4923
  required: $
@@ -4903,7 +4929,7 @@ Failed to reload test data. Please refresh the page.`);
4903
4929
  ae,
4904
4930
  {
4905
4931
  type: "email",
4906
- label: P.label,
4932
+ label: L.label,
4907
4933
  value: g[f] || "",
4908
4934
  onChange: (y) => F(f, y.target.value),
4909
4935
  required: $
@@ -4915,7 +4941,7 @@ Failed to reload test data. Please refresh the page.`);
4915
4941
  ae,
4916
4942
  {
4917
4943
  type: "tel",
4918
- label: P.label,
4944
+ label: L.label,
4919
4945
  value: g[f] || "",
4920
4946
  onChange: (y) => F(f, y.target.value),
4921
4947
  required: $
@@ -4928,7 +4954,7 @@ Failed to reload test data. Please refresh the page.`);
4928
4954
  ae,
4929
4955
  {
4930
4956
  type: "text",
4931
- label: P.label,
4957
+ label: L.label,
4932
4958
  value: g[f] || "",
4933
4959
  onChange: (y) => F(f, y.target.value),
4934
4960
  required: $
@@ -5080,8 +5106,8 @@ Failed to reload test data. Please refresh the page.`);
5080
5106
  z
5081
5107
  ] })
5082
5108
  ] }),
5083
- /* @__PURE__ */ a("div", { className: "flex items-center", children: I.map((g, L) => {
5084
- const F = L < Y, G = g.order === l.order;
5109
+ /* @__PURE__ */ a("div", { className: "flex items-center", children: I.map((g, P) => {
5110
+ const F = P < Y, G = g.order === l.order;
5085
5111
  return /* @__PURE__ */ o(ie.Fragment, { children: [
5086
5112
  /* @__PURE__ */ o("div", { className: "flex items-center", children: [
5087
5113
  /* @__PURE__ */ a(
@@ -5091,18 +5117,18 @@ Failed to reload test data. Please refresh the page.`);
5091
5117
  w-8 h-8 rounded-full flex items-center justify-center text-sm font-medium
5092
5118
  ${F || G ? "bg-primary-500 text-white" : "bg-gray-200 text-gray-600 dark:bg-gray-700 dark:text-gray-400"}
5093
5119
  `,
5094
- children: L + 1
5120
+ children: P + 1
5095
5121
  }
5096
5122
  ),
5097
5123
  /* @__PURE__ */ a(
5098
5124
  "span",
5099
5125
  {
5100
5126
  className: `ml-2 text-sm ${G ? "font-semibold text-gray-900 dark:text-white" : "text-gray-600 dark:text-gray-400"}`,
5101
- children: g.displayName || g.name || x(g.action) || `Step ${L + 1}`
5127
+ children: g.displayName || g.name || x(g.action) || `Step ${P + 1}`
5102
5128
  }
5103
5129
  )
5104
5130
  ] }),
5105
- L < I.length - 1 && /* @__PURE__ */ a(
5131
+ P < I.length - 1 && /* @__PURE__ */ a(
5106
5132
  "div",
5107
5133
  {
5108
5134
  className: `flex-1 h-0.5 mx-4 ${F ? "bg-primary-500" : "bg-gray-200 dark:bg-gray-700"}`
@@ -5213,7 +5239,7 @@ function Kr(e) {
5213
5239
  }
5214
5240
  const Hr = ue.any();
5215
5241
  export {
5216
- Pe as ALLOWED_LANGUAGES,
5242
+ Le as ALLOWED_LANGUAGES,
5217
5243
  Ir as ALL_APPLICANT_FIELDS,
5218
5244
  Ge as ApplicantProgressOnHoldReason,
5219
5245
  le as ApplicantProgressStatus,
@@ -5236,7 +5262,7 @@ export {
5236
5262
  ct as EndpointBuilder,
5237
5263
  we as ErrorHandler,
5238
5264
  It as EventEmitter,
5239
- Le as FIELD_METADATA,
5265
+ Pe as FIELD_METADATA,
5240
5266
  tt as FileType,
5241
5267
  Vt as FileUpload,
5242
5268
  Ce as GenderType,
@@ -5260,7 +5286,7 @@ export {
5260
5286
  de as MetaKYCError,
5261
5287
  Dr as MetaKYCProvider,
5262
5288
  Qt as MultiSelect,
5263
- Pt as OnfidoProvider,
5289
+ Lt as OnfidoProvider,
5264
5290
  gt as OverviewService,
5265
5291
  cr as OverviewStep,
5266
5292
  Gt as PhoneInput,
@@ -5271,7 +5297,7 @@ export {
5271
5297
  Ze as RiskLevel,
5272
5298
  yt as RiskScoringService,
5273
5299
  pr as RiskScoringStep,
5274
- Lt as SardinAIProvider,
5300
+ Pt as SardinAIProvider,
5275
5301
  ge as Select,
5276
5302
  ce as Spinner,
5277
5303
  Rt as StepRouter,
@@ -5302,7 +5328,7 @@ export {
5302
5328
  $r as generateQuestionnaireSchema,
5303
5329
  Ur as generateRiskScoringSchema,
5304
5330
  _r as generateUploadDocumentSchema,
5305
- Lr as getAcceptString,
5331
+ Pr as getAcceptString,
5306
5332
  Ot as getApplicantId,
5307
5333
  ke as getThemePreset,
5308
5334
  Mr as getWorkflowState,
@@ -5325,6 +5351,6 @@ export {
5325
5351
  Yt as useRiskScoring,
5326
5352
  Ht as useUploadDocument,
5327
5353
  Fr as validateFileSize,
5328
- Pr as validateFileType
5354
+ Lr as validateFileType
5329
5355
  };
5330
5356
  //# sourceMappingURL=index.js.map