@vpdev2/metakyc-sdk 1.0.64 → 1.0.65

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
@@ -1,9 +1,9 @@
1
1
  var vt = Object.defineProperty;
2
2
  var kt = (e, t, n) => t in e ? vt(e, t, { enumerable: !0, configurable: !0, writable: !0, value: n }) : e[t] = n;
3
- var re = (e, t, n) => kt(e, typeof t != "symbol" ? t + "" : t, n);
3
+ var ne = (e, t, n) => kt(e, typeof t != "symbol" ? t + "" : t, n);
4
4
  import wt from "axios";
5
5
  import * as nt from "react";
6
- import ge, { createContext as Nt, useState as v, useMemo as Ee, useEffect as ne, useContext as St, useRef as ee, useCallback as Q, forwardRef as Ue, createElement as Qe } from "react";
6
+ import ge, { createContext as Nt, useState as v, useMemo as Ee, useEffect as ae, useContext as St, useRef as ee, useCallback as Q, forwardRef as Ue, createElement as Qe } from "react";
7
7
  import { jsx as r, jsxs as s, Fragment as dt } from "react/jsx-runtime";
8
8
  import { createPortal as Ve } from "react-dom";
9
9
  import { useForm as Ct, Controller as Pe } from "react-hook-form";
@@ -115,7 +115,7 @@ class Bt {
115
115
  class Ne extends Error {
116
116
  constructor(n, a, i, o, l) {
117
117
  super(n);
118
- re(this, "response");
118
+ ne(this, "response");
119
119
  this.code = a, this.details = i, this.validationErrors = o, this.name = "MetaKYCError", this.response = l, Object.setPrototypeOf(this, Ne.prototype);
120
120
  }
121
121
  }
@@ -171,9 +171,9 @@ class ze {
171
171
  }
172
172
  class _t {
173
173
  constructor(t) {
174
- re(this, "axiosInstance");
175
- re(this, "endpointBuilder");
176
- re(this, "config");
174
+ ne(this, "axiosInstance");
175
+ ne(this, "endpointBuilder");
176
+ ne(this, "config");
177
177
  this.config = { ...$t, ...t }, this.endpointBuilder = new Bt(this.config.endpoints), this.axiosInstance = wt.create({
178
178
  baseURL: this.config.baseUrl,
179
179
  timeout: this.config.timeout,
@@ -960,7 +960,7 @@ class rr {
960
960
  }
961
961
  class nr {
962
962
  constructor() {
963
- re(this, "listeners", /* @__PURE__ */ new Map());
963
+ ne(this, "listeners", /* @__PURE__ */ new Map());
964
964
  }
965
965
  /**
966
966
  * Subscribe to an event
@@ -1005,10 +1005,10 @@ class nr {
1005
1005
  }
1006
1006
  class ar {
1007
1007
  constructor() {
1008
- re(this, "events", new nr());
1009
- re(this, "_applicantId", null);
1010
- re(this, "_progress", null);
1011
- re(this, "_error", null);
1008
+ ne(this, "events", new nr());
1009
+ ne(this, "_applicantId", null);
1010
+ ne(this, "_progress", null);
1011
+ ne(this, "_error", null);
1012
1012
  }
1013
1013
  /**
1014
1014
  * Get current applicant ID
@@ -1145,7 +1145,7 @@ class ar {
1145
1145
  }
1146
1146
  class ir {
1147
1147
  constructor() {
1148
- re(this, "handlers", /* @__PURE__ */ new Map());
1148
+ ne(this, "handlers", /* @__PURE__ */ new Map());
1149
1149
  }
1150
1150
  /**
1151
1151
  * Register a step handler
@@ -1186,8 +1186,8 @@ class ir {
1186
1186
  }
1187
1187
  class sr {
1188
1188
  constructor(t, n, a, i, o, l, d, u) {
1189
- re(this, "state");
1190
- re(this, "stepRouter");
1189
+ ne(this, "state");
1190
+ ne(this, "stepRouter");
1191
1191
  this.applicantService = t, this.questionnaireService = n, this.uploadDocumentService = a, this.appropriatenessTestService = i, this.overviewService = o, this.riskScoringService = l, this.investorCategorizationService = u, this.state = new ar(), this.stepRouter = new ir(), this.registerStepHandlers();
1192
1192
  }
1193
1193
  /**
@@ -1347,8 +1347,8 @@ function sn(e) {
1347
1347
  }
1348
1348
  class or {
1349
1349
  constructor(t) {
1350
- re(this, "sdk", null);
1351
- re(this, "config");
1350
+ ne(this, "sdk", null);
1351
+ ne(this, "config");
1352
1352
  this.config = t;
1353
1353
  }
1354
1354
  /**
@@ -1402,8 +1402,8 @@ class or {
1402
1402
  }
1403
1403
  class lr {
1404
1404
  constructor(t) {
1405
- re(this, "sdk", null);
1406
- re(this, "config");
1405
+ ne(this, "sdk", null);
1406
+ ne(this, "config");
1407
1407
  this.config = t;
1408
1408
  }
1409
1409
  /**
@@ -1468,9 +1468,9 @@ class lr {
1468
1468
  }
1469
1469
  class cr {
1470
1470
  constructor(t) {
1471
- re(this, "sardineContext", null);
1472
- re(this, "config");
1473
- re(this, "sessionKey");
1471
+ ne(this, "sardineContext", null);
1472
+ ne(this, "config");
1473
+ ne(this, "sessionKey");
1474
1474
  this.config = t, this.sessionKey = t.sessionKey || this.generateSessionKey();
1475
1475
  }
1476
1476
  /**
@@ -1662,9 +1662,9 @@ class Me {
1662
1662
  }
1663
1663
  class dr {
1664
1664
  constructor(t) {
1665
- re(this, "currentTheme", ue);
1666
- re(this, "customStyleElement", null);
1667
- re(this, "container");
1665
+ ne(this, "currentTheme", ue);
1666
+ ne(this, "customStyleElement", null);
1667
+ ne(this, "container");
1668
1668
  this.container = t || document.documentElement;
1669
1669
  }
1670
1670
  /**
@@ -1820,7 +1820,7 @@ const mt = Nt(null), on = ({ config: e, children: t }) => {
1820
1820
  l.investorCategorizationService
1821
1821
  )
1822
1822
  }), [e, l, n]);
1823
- return ne(() => ((async () => {
1823
+ return ae(() => ((async () => {
1824
1824
  if (i.current || o.current) {
1825
1825
  console.log("[MetaKYC] Theme already loading or loaded, skipping...");
1826
1826
  return;
@@ -1934,9 +1934,9 @@ function mn() {
1934
1934
  }
1935
1935
  function fr(e) {
1936
1936
  const { createOrchestrator: t } = ye(), [n, a] = v(null), [i, o] = v(!1), [l, d] = v(null), u = ee(null), p = e || pr();
1937
- ne(() => {
1937
+ ae(() => {
1938
1938
  u.current || (u.current = t());
1939
- }, [t]), ne(() => {
1939
+ }, [t]), ae(() => {
1940
1940
  var A;
1941
1941
  n && p && (mr(p), gr({
1942
1942
  applicantId: p,
@@ -1964,7 +1964,7 @@ function fr(e) {
1964
1964
  }
1965
1965
  }
1966
1966
  }, [p]);
1967
- ne(() => {
1967
+ ae(() => {
1968
1968
  p && !N.current && m();
1969
1969
  }, [p, m]);
1970
1970
  const x = Q(async () => {
@@ -2075,7 +2075,7 @@ function xr(e) {
2075
2075
  }
2076
2076
  }
2077
2077
  }, [e, t, n]);
2078
- ne(() => {
2078
+ ae(() => {
2079
2079
  e && h.current !== e && C();
2080
2080
  }, [e]);
2081
2081
  const D = Q(
@@ -2119,7 +2119,7 @@ function br(e) {
2119
2119
  }
2120
2120
  }
2121
2121
  }, [e, t]);
2122
- ne(() => {
2122
+ ae(() => {
2123
2123
  e && x.current !== e && h();
2124
2124
  }, [e]);
2125
2125
  const C = Q(
@@ -2163,7 +2163,7 @@ function pn(e) {
2163
2163
  }
2164
2164
  }
2165
2165
  }, [e, t]);
2166
- ne(() => {
2166
+ ae(() => {
2167
2167
  e && x.current !== e && h();
2168
2168
  }, [e]);
2169
2169
  const C = Q(
@@ -2208,7 +2208,7 @@ function vr(e) {
2208
2208
  }
2209
2209
  }
2210
2210
  }, [e, t]);
2211
- ne(() => {
2211
+ ae(() => {
2212
2212
  e && N.current !== e && m();
2213
2213
  }, [e]);
2214
2214
  const x = Q(async () => {
@@ -2351,7 +2351,7 @@ function wr(e) {
2351
2351
  }
2352
2352
  }
2353
2353
  }, [e, t, n]);
2354
- ne(() => {
2354
+ ae(() => {
2355
2355
  e && D.current !== e && k();
2356
2356
  }, [e]);
2357
2357
  const z = Q(
@@ -2722,8 +2722,8 @@ const it = 280, Sr = ({
2722
2722
  }) => {
2723
2723
  const [d, u] = v(!1), [p, b] = v(""), [N, m] = v(null), x = ee(null), h = ee(null), C = ee(null), D = Q(() => {
2724
2724
  if (!h.current) return null;
2725
- const w = h.current.getBoundingClientRect(), te = window.innerHeight - w.bottom < it && w.top > it;
2726
- return { top: te ? w.top : w.bottom + 4, left: w.left, width: w.width, openUp: te };
2725
+ const w = h.current.getBoundingClientRect(), re = window.innerHeight - w.bottom < it && w.top > it;
2726
+ return { top: re ? w.top : w.bottom + 4, left: w.left, width: w.width, openUp: re };
2727
2727
  }, []), k = Q(() => {
2728
2728
  if (o) return;
2729
2729
  const w = D();
@@ -2731,15 +2731,15 @@ const it = 280, Sr = ({
2731
2731
  }, [o, D]), z = Q(() => {
2732
2732
  u(!1), b("");
2733
2733
  }, []);
2734
- ne(() => {
2734
+ ae(() => {
2735
2735
  if (!d) return;
2736
2736
  const w = (q) => {
2737
- var B, F;
2738
- const te = q.target;
2739
- !((B = x.current) != null && B.contains(te)) && !((F = C.current) != null && F.contains(te)) && z();
2737
+ var _, F;
2738
+ const re = q.target;
2739
+ !((_ = x.current) != null && _.contains(re)) && !((F = C.current) != null && F.contains(re)) && z();
2740
2740
  };
2741
2741
  return document.addEventListener("mousedown", w), () => document.removeEventListener("mousedown", w);
2742
- }, [d, z]), ne(() => {
2742
+ }, [d, z]), ae(() => {
2743
2743
  if (!d) return;
2744
2744
  const w = () => {
2745
2745
  const q = D();
@@ -2754,10 +2754,10 @@ const it = 280, Sr = ({
2754
2754
  ), I = (w) => {
2755
2755
  o || n(t.includes(w) ? t.filter((q) => q !== w) : [...t, w]);
2756
2756
  }, j = (w, q) => {
2757
- q.stopPropagation(), o || n(t.filter((te) => te !== w));
2757
+ q.stopPropagation(), o || n(t.filter((re) => re !== w));
2758
2758
  }, G = (w) => {
2759
2759
  var q;
2760
- return ((q = a.find((te) => te.value === w)) == null ? void 0 : q.label) || w;
2760
+ return ((q = a.find((re) => re.value === w)) == null ? void 0 : q.label) || w;
2761
2761
  }, E = h.current ? getComputedStyle(h.current) : null, f = (E == null ? void 0 : E.getPropertyValue("--metakyc-input-bg").trim()) || "#ffffff", R = (E == null ? void 0 : E.getPropertyValue("--metakyc-border").trim()) || "#d1d5db", P = (E == null ? void 0 : E.getPropertyValue("--metakyc-text-primary").trim()) || "#111827", O = (E == null ? void 0 : E.getPropertyValue("--metakyc-text-secondary").trim()) || "#6b7280", H = (E == null ? void 0 : E.getPropertyValue("--metakyc-primary").trim()) || "#2563eb", M = (E == null ? void 0 : E.getPropertyValue("--metakyc-primary-light").trim()) || "#eff6ff", T = (E == null ? void 0 : E.getPropertyValue("--metakyc-hover-bg").trim()) || "#f9fafb", J = d && N && /* @__PURE__ */ s(
2762
2762
  "div",
2763
2763
  {
@@ -2819,11 +2819,11 @@ const it = 280, Sr = ({
2819
2819
  color: q ? H : P,
2820
2820
  userSelect: "none"
2821
2821
  },
2822
- onMouseEnter: (te) => {
2823
- q || (te.currentTarget.style.backgroundColor = T);
2822
+ onMouseEnter: (re) => {
2823
+ q || (re.currentTarget.style.backgroundColor = T);
2824
2824
  },
2825
- onMouseLeave: (te) => {
2826
- q || (te.currentTarget.style.backgroundColor = "transparent");
2825
+ onMouseLeave: (re) => {
2826
+ q || (re.currentTarget.style.backgroundColor = "transparent");
2827
2827
  },
2828
2828
  children: [
2829
2829
  /* @__PURE__ */ r(
@@ -2979,7 +2979,7 @@ const it = 280, Sr = ({
2979
2979
  }, [d, I]), G = Q(() => {
2980
2980
  N(!1), x("");
2981
2981
  }, []), E = () => b ? G() : j();
2982
- ne(() => {
2982
+ ae(() => {
2983
2983
  if (!b) return;
2984
2984
  const S = (U) => {
2985
2985
  var Y, we;
@@ -2987,7 +2987,7 @@ const it = 280, Sr = ({
2987
2987
  !((Y = D.current) != null && Y.contains(X)) && !((we = z.current) != null && we.contains(X)) && G();
2988
2988
  };
2989
2989
  return document.addEventListener("mousedown", S), () => document.removeEventListener("mousedown", S);
2990
- }, [b, G]), ne(() => {
2990
+ }, [b, G]), ae(() => {
2991
2991
  if (!b) return;
2992
2992
  const S = () => {
2993
2993
  const U = I();
@@ -2996,7 +2996,7 @@ const it = 280, Sr = ({
2996
2996
  return window.addEventListener("scroll", S, !0), window.addEventListener("resize", S), () => {
2997
2997
  window.removeEventListener("scroll", S, !0), window.removeEventListener("resize", S);
2998
2998
  };
2999
- }, [b, I]), ne(() => {
2999
+ }, [b, I]), ae(() => {
3000
3000
  b && A.current && setTimeout(() => {
3001
3001
  var S;
3002
3002
  return (S = A.current) == null ? void 0 : S.focus();
@@ -3006,7 +3006,7 @@ const it = 280, Sr = ({
3006
3006
  (S) => S.label.toLowerCase().includes(m.toLowerCase()) || S.value.toLowerCase().includes(m.toLowerCase())
3007
3007
  ), R = (F = a.find((S) => S.value === o)) == null ? void 0 : F.label, P = (S, U) => {
3008
3008
  d || U || (l(S), G());
3009
- }, O = k.current ? getComputedStyle(k.current) : null, H = (O == null ? void 0 : O.getPropertyValue("--metakyc-input-bg").trim()) || "#ffffff", M = (O == null ? void 0 : O.getPropertyValue("--metakyc-border").trim()) || "#d1d5db", T = (O == null ? void 0 : O.getPropertyValue("--metakyc-text-primary").trim()) || "#111827", J = (O == null ? void 0 : O.getPropertyValue("--metakyc-text-secondary").trim()) || "#6b7280", w = (O == null ? void 0 : O.getPropertyValue("--metakyc-primary").trim()) || "#2563eb", q = (O == null ? void 0 : O.getPropertyValue("--metakyc-primary-light").trim()) || "#eff6ff", te = (O == null ? void 0 : O.getPropertyValue("--metakyc-hover-bg").trim()) || "#f9fafb", B = b && h && /* @__PURE__ */ s(
3009
+ }, O = k.current ? getComputedStyle(k.current) : null, H = (O == null ? void 0 : O.getPropertyValue("--metakyc-input-bg").trim()) || "#ffffff", M = (O == null ? void 0 : O.getPropertyValue("--metakyc-border").trim()) || "#d1d5db", T = (O == null ? void 0 : O.getPropertyValue("--metakyc-text-primary").trim()) || "#111827", J = (O == null ? void 0 : O.getPropertyValue("--metakyc-text-secondary").trim()) || "#6b7280", w = (O == null ? void 0 : O.getPropertyValue("--metakyc-primary").trim()) || "#2563eb", q = (O == null ? void 0 : O.getPropertyValue("--metakyc-primary-light").trim()) || "#eff6ff", re = (O == null ? void 0 : O.getPropertyValue("--metakyc-hover-bg").trim()) || "#f9fafb", _ = b && h && /* @__PURE__ */ s(
3010
3010
  "div",
3011
3011
  {
3012
3012
  ref: z,
@@ -3076,7 +3076,7 @@ const it = 280, Sr = ({
3076
3076
  userSelect: "none"
3077
3077
  },
3078
3078
  onMouseEnter: (X) => {
3079
- !U && !S.disabled && (X.currentTarget.style.backgroundColor = te);
3079
+ !U && !S.disabled && (X.currentTarget.style.backgroundColor = re);
3080
3080
  },
3081
3081
  onMouseLeave: (X) => {
3082
3082
  U || (X.currentTarget.style.backgroundColor = "transparent");
@@ -3146,7 +3146,7 @@ const it = 280, Sr = ({
3146
3146
  ]
3147
3147
  }
3148
3148
  ),
3149
- typeof document < "u" && B ? Ve(B, document.body) : null,
3149
+ typeof document < "u" && _ ? Ve(_, document.body) : null,
3150
3150
  t && /* @__PURE__ */ r("p", { className: "mt-1 text-sm", style: { color: "var(--metakyc-error, #ef4444)" }, children: t }),
3151
3151
  !t && n && /* @__PURE__ */ r("p", { className: "mt-1 text-sm", style: { color: "var(--metakyc-text-secondary, #6b7280)" }, children: n })
3152
3152
  ]
@@ -4252,7 +4252,7 @@ const jr = ({
4252
4252
  onBack: n
4253
4253
  }) => {
4254
4254
  const { appropriatenessTestService: a } = ye(), [i, o] = v(null), [l, d] = v(!0), [u, p] = v(!1), [b, N] = v(null), [m, x] = v({}), [h, C] = v(0), [D, k] = v(!1), [z, A] = v(!1), [I, j] = v(0);
4255
- ne(() => {
4255
+ ae(() => {
4256
4256
  (async () => {
4257
4257
  try {
4258
4258
  d(!0), N(null), console.log("Loading appropriateness test for applicant:", e);
@@ -4279,19 +4279,19 @@ const jr = ({
4279
4279
  const T = Math.floor(M / 60), J = M % 60;
4280
4280
  return `${T.toString().padStart(2, "0")}:${J.toString().padStart(2, "0")}`;
4281
4281
  };
4282
- ne(() => {
4282
+ ae(() => {
4283
4283
  if (!D || h <= 0) return;
4284
4284
  const M = setInterval(() => {
4285
4285
  C((T) => T <= 1 ? (A(!0), 0) : T - 1);
4286
4286
  }, 1e3);
4287
4287
  return () => clearInterval(M);
4288
- }, [D, h]), ne(() => {
4288
+ }, [D, h]), ae(() => {
4289
4289
  if (I <= 0) return;
4290
4290
  const M = setInterval(() => {
4291
4291
  j((T) => T <= 1 ? 0 : T - 1);
4292
4292
  }, 1e3);
4293
4293
  return () => clearInterval(M);
4294
- }, [I]), ne(() => {
4294
+ }, [I]), ae(() => {
4295
4295
  z && !u && P();
4296
4296
  }, [z]);
4297
4297
  const f = () => {
@@ -4533,7 +4533,7 @@ Failed to reload test data. Please refresh the page.`);
4533
4533
  onComplete: t,
4534
4534
  onBack: n
4535
4535
  }) => {
4536
- var J, w, q, te;
4536
+ var J, w, q, re;
4537
4537
  const { applicantService: a, baseInformationService: i, config: o } = ye(), { identityData: l, provider: d, token: u, isLoading: p, error: b, requestIdentity: N, restartIdentity: m } = kr(e), [x, h] = v(null), [C, D] = v(null), [k, z] = v([]), [A, I] = v(!0), [j, G] = v(!1), [E, f] = v(null), [R, P] = v(!1), O = ge.useRef(!1), H = Ct({
4538
4538
  defaultValues: {
4539
4539
  street: "",
@@ -4545,7 +4545,7 @@ Failed to reload test data. Please refresh the page.`);
4545
4545
  phonenumber: ""
4546
4546
  }
4547
4547
  });
4548
- ne(() => {
4548
+ ae(() => {
4549
4549
  (async () => {
4550
4550
  try {
4551
4551
  const [F, S] = await Promise.all([
@@ -4581,13 +4581,13 @@ Failed to reload test data. Please refresh the page.`);
4581
4581
  I(!1);
4582
4582
  }
4583
4583
  })();
4584
- }, [e]), ne(() => {
4584
+ }, [e]), ae(() => {
4585
4585
  l && !j && (console.log("[Identity] Identity data already loaded, showing provider"), G(!0));
4586
- }, [l, j]), ne(() => {
4586
+ }, [l, j]), ae(() => {
4587
4587
  if (u) {
4588
4588
  if (u.expiresAt) {
4589
- const B = new Date(u.expiresAt).getTime();
4590
- if (Date.now() >= B) {
4589
+ const _ = new Date(u.expiresAt).getTime();
4590
+ if (Date.now() >= _) {
4591
4591
  console.warn("[Identity] Token has expired (expiresAt)"), P(!0), f("Your verification session has expired. Please restart.");
4592
4592
  return;
4593
4593
  }
@@ -4607,13 +4607,13 @@ Failed to reload test data. Please refresh the page.`);
4607
4607
  return;
4608
4608
  }
4609
4609
  }
4610
- }, [u]), ne(() => {
4610
+ }, [u]), ae(() => {
4611
4611
  if (d !== null && u && !x && j && !R) {
4612
- const B = d;
4612
+ const _ = d;
4613
4613
  if (u.url) {
4614
4614
  console.log("[Identity] Loading provider URL for user verification:", u.url), f(null);
4615
4615
  try {
4616
- if (new URL(u.url), B === xe.SardinAI) {
4616
+ if (new URL(u.url), _ === xe.SardinAI) {
4617
4617
  console.log("[SardinAI] Initializing Risk SDK in background...");
4618
4618
  try {
4619
4619
  const F = Me.parseProviderConfig(d, u, o);
@@ -4632,7 +4632,7 @@ Failed to reload test data. Please refresh the page.`);
4632
4632
  }
4633
4633
  return;
4634
4634
  }
4635
- if (B === xe.SardinAI) {
4635
+ if (_ === xe.SardinAI) {
4636
4636
  console.log("[SardinAI] No URL provided - initializing Risk SDK only..."), f(null);
4637
4637
  try {
4638
4638
  const F = Me.parseProviderConfig(d, u, o), S = Me.createProvider(d, F);
@@ -4654,12 +4654,12 @@ Failed to reload test data. Please refresh the page.`);
4654
4654
  try {
4655
4655
  f(null);
4656
4656
  const F = Me.parseProviderConfig(d, u, o), S = Me.createProvider(d, F);
4657
- B === xe.Sumsub ? (S.initialize("identity-container").catch((U) => {
4657
+ _ === xe.Sumsub ? (S.initialize("identity-container").catch((U) => {
4658
4658
  var X;
4659
4659
  console.error("[Sumsub] Initialization error:", U), f(`Failed to initialize: ${U.message}`), (X = U.message) != null && X.toLowerCase().includes("expired") && P(!0);
4660
4660
  }), S.onComplete && S.onComplete(() => {
4661
4661
  t == null || t();
4662
- })) : B === xe.Onfido && S.initialize("identity-container").catch((U) => {
4662
+ })) : _ === xe.Onfido && S.initialize("identity-container").catch((U) => {
4663
4663
  console.error("[Onfido] Initialization error:", U), f(`Failed to initialize: ${U.message}`);
4664
4664
  }), h(S);
4665
4665
  } catch (F) {
@@ -4670,22 +4670,22 @@ Failed to reload test data. Please refresh the page.`);
4670
4670
  if (x && x.destroy)
4671
4671
  try {
4672
4672
  x.destroy();
4673
- } catch (B) {
4674
- console.error("[Identity] Error destroying provider:", B);
4673
+ } catch (_) {
4674
+ console.error("[Identity] Error destroying provider:", _);
4675
4675
  }
4676
4676
  };
4677
4677
  }, [d, u, x, j, t, R]);
4678
4678
  const M = async () => {
4679
4679
  try {
4680
4680
  f(null), P(!1), await N(), G(!0);
4681
- } catch (B) {
4682
- console.error("Error starting identity verification:", B);
4681
+ } catch (_) {
4682
+ console.error("Error starting identity verification:", _);
4683
4683
  }
4684
4684
  }, T = async () => {
4685
4685
  try {
4686
4686
  f(null), P(!1), h(null), console.log("[Identity] Restarting verification..."), await m(), G(!0);
4687
- } catch (B) {
4688
- console.error("Error restarting identity verification:", B), f(B.message || "Failed to restart verification");
4687
+ } catch (_) {
4688
+ console.error("Error restarting identity verification:", _), f(_.message || "Failed to restart verification");
4689
4689
  }
4690
4690
  };
4691
4691
  if (A || p)
@@ -4741,7 +4741,7 @@ Failed to reload test data. Please refresh the page.`);
4741
4741
  ] })
4742
4742
  ] });
4743
4743
  if (j && l) {
4744
- const B = d;
4744
+ const _ = d;
4745
4745
  return u != null && u.url ? /* @__PURE__ */ s(K, { children: [
4746
4746
  /* @__PURE__ */ r(de, { children: /* @__PURE__ */ s("div", { className: "flex items-center justify-between", children: [
4747
4747
  /* @__PURE__ */ s("div", { children: [
@@ -4789,7 +4789,7 @@ Failed to reload test data. Please refresh the page.`);
4789
4789
  ) })
4790
4790
  ] }),
4791
4791
  n && /* @__PURE__ */ r(pe, { children: /* @__PURE__ */ r(Z, { variant: "outline", onClick: n, children: "Back" }) })
4792
- ] }) : B === xe.SardinAI ? /* @__PURE__ */ s(K, { children: [
4792
+ ] }) : _ === xe.SardinAI ? /* @__PURE__ */ s(K, { children: [
4793
4793
  /* @__PURE__ */ s(de, { children: [
4794
4794
  /* @__PURE__ */ r("h2", { className: "text-2xl font-bold", children: "Device Risk Assessment" }),
4795
4795
  /* @__PURE__ */ r("p", { className: "text-gray-600 dark:text-gray-400 mt-1", children: "Analyzing device security and behavioral patterns..." })
@@ -4829,7 +4829,7 @@ Failed to reload test data. Please refresh the page.`);
4829
4829
  ] }),
4830
4830
  /* @__PURE__ */ s("div", { children: [
4831
4831
  /* @__PURE__ */ r("label", { className: "block text-sm font-medium text-gray-500 dark:text-gray-400", children: "Date of Birth" }),
4832
- /* @__PURE__ */ r("p", { className: "mt-1 text-base", children: ((te = C == null ? void 0 : C.applicantRequestData) == null ? void 0 : te.dateOfBirth) || "Not provided" })
4832
+ /* @__PURE__ */ r("p", { className: "mt-1 text-base", children: ((re = C == null ? void 0 : C.applicantRequestData) == null ? void 0 : re.dateOfBirth) || "Not provided" })
4833
4833
  ] })
4834
4834
  ] }),
4835
4835
  /* @__PURE__ */ s("div", { className: "space-y-4", children: [
@@ -4840,10 +4840,10 @@ Failed to reload test data. Please refresh the page.`);
4840
4840
  {
4841
4841
  control: H.control,
4842
4842
  name: "country",
4843
- render: ({ field: B }) => /* @__PURE__ */ r(
4843
+ render: ({ field: _ }) => /* @__PURE__ */ r(
4844
4844
  He,
4845
4845
  {
4846
- ...B,
4846
+ ..._,
4847
4847
  label: "Country",
4848
4848
  options: [
4849
4849
  { value: "", label: "Select country..." },
@@ -4861,10 +4861,10 @@ Failed to reload test data. Please refresh the page.`);
4861
4861
  {
4862
4862
  control: H.control,
4863
4863
  name: "nationality",
4864
- render: ({ field: B }) => /* @__PURE__ */ r(
4864
+ render: ({ field: _ }) => /* @__PURE__ */ r(
4865
4865
  He,
4866
4866
  {
4867
- ...B,
4867
+ ..._,
4868
4868
  label: "Nationality",
4869
4869
  options: [
4870
4870
  { value: "", label: "Select nationality..." },
@@ -4884,7 +4884,7 @@ Failed to reload test data. Please refresh the page.`);
4884
4884
  {
4885
4885
  control: H.control,
4886
4886
  name: "street",
4887
- render: ({ field: B }) => /* @__PURE__ */ r(me, { ...B, label: "Street" })
4887
+ render: ({ field: _ }) => /* @__PURE__ */ r(me, { ..._, label: "Street" })
4888
4888
  }
4889
4889
  ),
4890
4890
  /* @__PURE__ */ r(
@@ -4892,7 +4892,7 @@ Failed to reload test data. Please refresh the page.`);
4892
4892
  {
4893
4893
  control: H.control,
4894
4894
  name: "streetNumber",
4895
- render: ({ field: B }) => /* @__PURE__ */ r(me, { ...B, label: "Street Number" })
4895
+ render: ({ field: _ }) => /* @__PURE__ */ r(me, { ..._, label: "Street Number" })
4896
4896
  }
4897
4897
  )
4898
4898
  ] }),
@@ -4902,7 +4902,7 @@ Failed to reload test data. Please refresh the page.`);
4902
4902
  {
4903
4903
  control: H.control,
4904
4904
  name: "city",
4905
- render: ({ field: B }) => /* @__PURE__ */ r(me, { ...B, label: "City" })
4905
+ render: ({ field: _ }) => /* @__PURE__ */ r(me, { ..._, label: "City" })
4906
4906
  }
4907
4907
  ),
4908
4908
  /* @__PURE__ */ r(
@@ -4910,7 +4910,7 @@ Failed to reload test data. Please refresh the page.`);
4910
4910
  {
4911
4911
  control: H.control,
4912
4912
  name: "zip",
4913
- render: ({ field: B }) => /* @__PURE__ */ r(me, { ...B, label: "ZIP/Postal Code" })
4913
+ render: ({ field: _ }) => /* @__PURE__ */ r(me, { ..._, label: "ZIP/Postal Code" })
4914
4914
  }
4915
4915
  )
4916
4916
  ] }),
@@ -4919,7 +4919,7 @@ Failed to reload test data. Please refresh the page.`);
4919
4919
  {
4920
4920
  control: H.control,
4921
4921
  name: "phonenumber",
4922
- render: ({ field: B }) => /* @__PURE__ */ r(me, { ...B, label: "Phone Number", type: "tel" })
4922
+ render: ({ field: _ }) => /* @__PURE__ */ r(me, { ..._, label: "Phone Number", type: "tel" })
4923
4923
  }
4924
4924
  )
4925
4925
  ] })
@@ -5258,20 +5258,20 @@ const _e = {
5258
5258
  if (L) for (const $ of L) c.add($);
5259
5259
  if (m)
5260
5260
  for (const $ of m)
5261
- for (const g of $.fields)
5262
- !g.isCustom && g.name && g.required && c.add(g.name);
5261
+ for (const y of $.fields)
5262
+ !y.isCustom && y.name && y.required && c.add(y.name);
5263
5263
  return Array.from(c);
5264
5264
  }, [l == null ? void 0 : l.applicantFormRequiredFields, m]), h = Ee(() => {
5265
5265
  var $;
5266
5266
  if (m) {
5267
- const g = m.flatMap((_) => _.fields).filter((_) => !_.isCustom && _.name).map((_) => _.name), y = new Set(g);
5268
- for (const _ of je) y.add(_);
5269
- return Array.from(y);
5267
+ const y = m.flatMap((B) => B.fields).filter((B) => !B.isCustom && B.name).map((B) => B.name), g = new Set(y);
5268
+ for (const B of je) g.add(B);
5269
+ return Array.from(g);
5270
5270
  }
5271
5271
  let c;
5272
5272
  ($ = i.applicantForm) != null && $.visibleFields ? c = i.applicantForm.visibleFields : l != null && l.applicantFormVisibleFields && l.applicantFormVisibleFields.length > 0 ? c = l.applicantFormVisibleFields : c = zt;
5273
5273
  const L = new Set(c);
5274
- for (const g of je) L.add(g);
5274
+ for (const y of je) L.add(y);
5275
5275
  return Array.from(L);
5276
5276
  }, [(tt = i.applicantForm) == null ? void 0 : tt.visibleFields, l == null ? void 0 : l.applicantFormVisibleFields, m]), C = /* @__PURE__ */ new Set([
5277
5277
  "country",
@@ -5284,52 +5284,52 @@ const _e = {
5284
5284
  var L, $;
5285
5285
  const c = /* @__PURE__ */ new Set();
5286
5286
  if (m)
5287
- for (const g of m)
5288
- for (const y of g.fields)
5289
- !y.isCustom && y.name && C.has(y.name) && c.add(y.countriesType ?? ((L = Te[y.name]) == null ? void 0 : L.countriesType));
5287
+ for (const y of m)
5288
+ for (const g of y.fields)
5289
+ !g.isCustom && g.name && C.has(g.name) && c.add(g.countriesType ?? ((L = Te[g.name]) == null ? void 0 : L.countriesType));
5290
5290
  else
5291
- for (const g of h)
5292
- C.has(g) && c.add(($ = Te[g]) == null ? void 0 : $.countriesType);
5291
+ for (const y of h)
5292
+ C.has(y) && c.add(($ = Te[y]) == null ? void 0 : $.countriesType);
5293
5293
  return c.size === 0 && c.add(void 0), Array.from(c);
5294
5294
  }, [h, m]), [k, z] = v({}), [A, I] = v(!0), j = ee(/* @__PURE__ */ new Set()), G = ee(/* @__PURE__ */ new Set());
5295
- ne(() => {
5295
+ ae(() => {
5296
5296
  if (!l) return;
5297
- const c = D.filter((g) => {
5298
- const y = g != null ? String(g) : "all";
5299
- return !G.current.has(y) && !j.current.has(y);
5297
+ const c = D.filter((y) => {
5298
+ const g = y != null ? String(y) : "all";
5299
+ return !G.current.has(g) && !j.current.has(g);
5300
5300
  });
5301
5301
  if (c.length === 0) {
5302
- D.every((y) => {
5303
- const _ = y != null ? String(y) : "all";
5304
- return G.current.has(_);
5302
+ D.every((g) => {
5303
+ const B = g != null ? String(g) : "all";
5304
+ return G.current.has(B);
5305
5305
  }) && I(!1);
5306
5306
  return;
5307
5307
  }
5308
5308
  I(!0);
5309
- const L = c.map((g) => g != null ? String(g) : "all");
5310
- L.forEach((g) => j.current.add(g)), (async () => {
5309
+ const L = c.map((y) => y != null ? String(y) : "all");
5310
+ L.forEach((y) => j.current.add(y)), (async () => {
5311
5311
  try {
5312
- const g = await Promise.all(
5313
- c.map(async (y) => {
5314
- const _ = y != null ? String(y) : "all", ie = await o.getCountries("", i.locale || "en", y), ae = /* @__PURE__ */ new Set(), fe = ie.map((se) => ({ value: se.abbreviation3 || se.abbreviation, label: se.name })).filter((se) => !se.value || ae.has(se.value) ? !1 : (ae.add(se.value), !0));
5315
- return G.current.add(_), j.current.delete(_), [_, fe];
5312
+ const y = await Promise.all(
5313
+ c.map(async (g) => {
5314
+ const B = g != null ? String(g) : "all", te = await o.getCountries("", i.locale || "en", g), ie = /* @__PURE__ */ new Set(), fe = te.map((se) => ({ value: se.abbreviation3 || se.abbreviation, label: se.name })).filter((se) => !se.value || ie.has(se.value) ? !1 : (ie.add(se.value), !0));
5315
+ return G.current.add(B), j.current.delete(B), [B, fe];
5316
5316
  })
5317
5317
  );
5318
- z((y) => ({ ...y, ...Object.fromEntries(g) }));
5319
- } catch (g) {
5320
- L.forEach((y) => j.current.delete(y)), console.error("Failed to load countries:", g);
5318
+ z((g) => ({ ...g, ...Object.fromEntries(y) }));
5319
+ } catch (y) {
5320
+ L.forEach((g) => j.current.delete(g)), console.error("Failed to load countries:", y);
5321
5321
  } finally {
5322
- D.every((y) => {
5323
- const _ = y != null ? String(y) : "all";
5324
- return G.current.has(_);
5322
+ D.every((g) => {
5323
+ const B = g != null ? String(g) : "all";
5324
+ return G.current.has(B);
5325
5325
  }) && I(!1);
5326
5326
  }
5327
5327
  })();
5328
5328
  }, [D, l]);
5329
5329
  const E = (c, L) => {
5330
- var y;
5331
- const $ = L ?? ((y = Te[c]) == null ? void 0 : y.countriesType), g = $ != null ? String($) : "all";
5332
- return k[g] || [];
5330
+ var g;
5331
+ const $ = L ?? ((g = Te[c]) == null ? void 0 : g.countriesType), y = $ != null ? String($) : "all";
5332
+ return k[y] || [];
5333
5333
  }, [f, R] = v({
5334
5334
  workflowKey: p,
5335
5335
  firstName: "",
@@ -5355,21 +5355,21 @@ const _e = {
5355
5355
  educationLevel: "",
5356
5356
  occupation: "",
5357
5357
  taxNumber: ""
5358
- }), [P, O] = v({}), [H, M] = v(0), [T, J] = v({}), [w, q] = v(null), [te, B] = v(!1), F = (c, L) => R(($) => ({ ...$, [c]: L })), S = (c, L) => O(($) => ({ ...$, [c]: L })), U = (c) => !c.conditionalOn || P[c.conditionalOn] === "true", X = m && H < m.length - 1 ? H + 1 : -1, Y = m && H > 0 ? H - 1 : -1, we = (c) => {
5358
+ }), [P, O] = v({}), [H, M] = v(0), [T, J] = v({}), [w, q] = v(null), [re, _] = v(!1), F = (c, L) => R(($) => ({ ...$, [c]: L })), S = (c, L) => O(($) => ({ ...$, [c]: L })), U = (c) => !c.conditionalOn || P[c.conditionalOn] === "true", X = m && H < m.length - 1 ? H + 1 : -1, Y = m && H > 0 ? H - 1 : -1, we = (c) => {
5359
5359
  var $;
5360
5360
  const L = {};
5361
- for (const g of c.fields)
5362
- if (g.isCustom) {
5363
- if (g.customType === "paragraph" || g.customType === "br" || g.customType === "link") continue;
5364
- if (g.required && g.paramName) {
5365
- const y = P[g.paramName], _ = g.displayText || g.label || g.paramName;
5366
- g.customType === "checkbox" || g.customType === "link_checkbox" ? y !== "true" && (L[g.paramName] = `${_} is required.`) : (!y || y.trim() === "") && (L[g.paramName] = `${_} is required.`);
5361
+ for (const y of c.fields)
5362
+ if (y.isCustom) {
5363
+ if (y.customType === "paragraph" || y.customType === "br" || y.customType === "link") continue;
5364
+ if (y.required && y.paramName) {
5365
+ const g = P[y.paramName], B = y.displayText || y.label || y.paramName;
5366
+ y.customType === "checkbox" || y.customType === "link_checkbox" ? g !== "true" && (L[y.paramName] = `${B} is required.`) : (!g || g.trim() === "") && (L[y.paramName] = `${B} is required.`);
5367
5367
  }
5368
- } else if (g.name) {
5369
- const y = g.name;
5370
- if (x.includes(y) && Be(f[y])) {
5371
- const _ = g.displayText || (($ = Te[y]) == null ? void 0 : $.label) || y;
5372
- L[y] = `${_} is required.`;
5368
+ } else if (y.name) {
5369
+ const g = y.name;
5370
+ if (x.includes(g) && Be(f[g])) {
5371
+ const B = y.displayText || (($ = Te[g]) == null ? void 0 : $.label) || g;
5372
+ L[g] = `${B} is required.`;
5373
5373
  }
5374
5374
  }
5375
5375
  return L;
@@ -5396,7 +5396,7 @@ const _e = {
5396
5396
  return;
5397
5397
  }
5398
5398
  }
5399
- B(!0), q(null);
5399
+ _(!0), q(null);
5400
5400
  try {
5401
5401
  if (!f.externalRefId || f.externalRefId.trim() === "") {
5402
5402
  q("External Reference ID is required. Please pass it via config.applicantForm.externalRefId.");
@@ -5407,35 +5407,38 @@ const _e = {
5407
5407
  externalRefId: f.externalRefId.trim()
5408
5408
  };
5409
5409
  if (m) {
5410
- for (const g of m)
5411
- if (U(g)) {
5412
- for (const y of g.fields)
5413
- if (!y.isCustom && y.name) {
5414
- const _ = y.name, ie = f[_];
5415
- Be(ie) || (c[_] = ie);
5410
+ for (const y of m)
5411
+ if (U(y)) {
5412
+ for (const g of y.fields)
5413
+ if (!g.isCustom && g.name) {
5414
+ const B = g.name, te = f[B];
5415
+ Be(te) || (c[B] = te);
5416
5416
  }
5417
5417
  }
5418
- for (const g of je)
5419
- if (c[g] === void 0) {
5420
- const y = f[g];
5421
- Be(y) || (c[g] = y);
5418
+ for (const y of je)
5419
+ if (c[y] === void 0) {
5420
+ const g = f[y];
5421
+ Be(g) || (c[y] = g);
5422
5422
  }
5423
5423
  } else
5424
- h.forEach((g) => {
5425
- if (g === "externalRefId") return;
5426
- const y = f[g];
5427
- Be(y) || (c[g] = y);
5424
+ h.forEach((y) => {
5425
+ if (y === "externalRefId") return;
5426
+ const g = f[y];
5427
+ Be(g) || (c[y] = g);
5428
5428
  });
5429
5429
  const L = [];
5430
5430
  if (m) {
5431
- for (const g of m)
5432
- if (U(g)) {
5433
- for (const y of g.fields)
5434
- if (y.isCustom && y.paramName && y.customType !== "paragraph" && y.customType !== "br" && y.customType !== "link") {
5435
- const _ = P[y.paramName] ?? "";
5436
- L.push({ paramName: y.paramName, paramValue: _ });
5437
- }
5438
- }
5431
+ for (const y of m)
5432
+ if (U(y))
5433
+ for (const g of y.fields) {
5434
+ if (!g.isCustom || !g.paramName || g.customType === "paragraph" || g.customType === "br" || g.customType === "link") continue;
5435
+ const B = P[g.paramName] ?? "";
5436
+ let te;
5437
+ if (g.customType === "checkbox" || g.customType === "link_checkbox")
5438
+ te = B === "true" ? "yes" : "no";
5439
+ else if (te = B, !te && !g.required) continue;
5440
+ L.push({ paramName: g.paramName, paramValue: te });
5441
+ }
5439
5442
  }
5440
5443
  L.length > 0 && (c.applicantAdditionalDatas = L);
5441
5444
  const $ = await d(c);
@@ -5443,37 +5446,37 @@ const _e = {
5443
5446
  } catch (c) {
5444
5447
  console.error("Error creating applicant:", c), q(c.message || "Failed to create applicant");
5445
5448
  } finally {
5446
- B(!1);
5449
+ _(!1);
5447
5450
  }
5448
5451
  }, ft = async (c) => {
5449
5452
  var L;
5450
5453
  c.preventDefault();
5451
5454
  for (const $ of x)
5452
5455
  if (Be(f[$])) {
5453
- const g = ((L = Te[$]) == null ? void 0 : L.label) || $;
5454
- q(`${g} is required.`);
5456
+ const y = ((L = Te[$]) == null ? void 0 : L.label) || $;
5457
+ q(`${y} is required.`);
5455
5458
  return;
5456
5459
  }
5457
5460
  await Ce();
5458
- }, Ze = (c, L, $, g) => {
5461
+ }, Ze = (c, L, $, y) => {
5459
5462
  var rt;
5460
- const y = Te[c];
5461
- if (!y) return null;
5462
- const _ = x.includes(c), ie = T[c], ae = $ || y.label, fe = L ?? c, se = { required: _ };
5463
- switch (y.type) {
5463
+ const g = Te[c];
5464
+ if (!g) return null;
5465
+ const B = x.includes(c), te = T[c], ie = $ || g.label, fe = L ?? c, se = { required: B };
5466
+ switch (g.type) {
5464
5467
  case "select":
5465
5468
  if (c === "country" || c === "nationality" || c === "taxCountry" || c === "countryOfBirth" || c === "mobileCountryCode") {
5466
- const le = E(c, g);
5469
+ const le = E(c, y);
5467
5470
  return /* @__PURE__ */ r(
5468
5471
  We,
5469
5472
  {
5470
5473
  ...se,
5471
- label: ae,
5474
+ label: ie,
5472
5475
  value: f[c] || "",
5473
5476
  onChange: (Re) => F(c, Re),
5474
- options: [{ value: "", label: `Select ${ae.toLowerCase()}...` }, ...le],
5477
+ options: [{ value: "", label: `Select ${ie.toLowerCase()}...` }, ...le],
5475
5478
  disabled: A,
5476
- error: ie
5479
+ error: te
5477
5480
  },
5478
5481
  fe
5479
5482
  );
@@ -5483,7 +5486,7 @@ const _e = {
5483
5486
  We,
5484
5487
  {
5485
5488
  ...se,
5486
- label: ae,
5489
+ label: ie,
5487
5490
  value: ((rt = f[c]) == null ? void 0 : rt.toString()) || "",
5488
5491
  onChange: (le) => F(c, le ? Number(le) : null),
5489
5492
  options: [
@@ -5492,7 +5495,7 @@ const _e = {
5492
5495
  { value: Ke.Female.toString(), label: "Female" },
5493
5496
  { value: Ke.Other.toString(), label: "Other" }
5494
5497
  ],
5495
- error: ie
5498
+ error: te
5496
5499
  },
5497
5500
  fe
5498
5501
  );
@@ -5502,11 +5505,11 @@ const _e = {
5502
5505
  We,
5503
5506
  {
5504
5507
  ...se,
5505
- label: ae,
5508
+ label: ie,
5506
5509
  value: f[c] || "",
5507
5510
  onChange: (Re) => F(c, Re),
5508
5511
  options: [{ value: "", label: "Select language..." }, ...le],
5509
- error: ie
5512
+ error: te
5510
5513
  },
5511
5514
  fe
5512
5515
  );
@@ -5514,12 +5517,12 @@ const _e = {
5514
5517
  return null;
5515
5518
  case "multiselect":
5516
5519
  if (c === "otherNationality") {
5517
- const le = E(c, g);
5520
+ const le = E(c, y);
5518
5521
  return /* @__PURE__ */ r(
5519
5522
  Sr,
5520
5523
  {
5521
5524
  ...se,
5522
- label: ae,
5525
+ label: ie,
5523
5526
  value: f[c] || [],
5524
5527
  onChange: (Re) => F(c, Re),
5525
5528
  options: le,
@@ -5536,10 +5539,10 @@ const _e = {
5536
5539
  {
5537
5540
  ...se,
5538
5541
  type: "date",
5539
- label: ae,
5542
+ label: ie,
5540
5543
  value: f[c] || "",
5541
5544
  onChange: (le) => F(c, le.target.value),
5542
- error: ie
5545
+ error: te
5543
5546
  },
5544
5547
  fe
5545
5548
  );
@@ -5549,10 +5552,10 @@ const _e = {
5549
5552
  {
5550
5553
  ...se,
5551
5554
  type: "email",
5552
- label: ae,
5555
+ label: ie,
5553
5556
  value: f[c] || "",
5554
5557
  onChange: (le) => F(c, le.target.value),
5555
- error: ie
5558
+ error: te
5556
5559
  },
5557
5560
  fe
5558
5561
  );
@@ -5562,10 +5565,10 @@ const _e = {
5562
5565
  {
5563
5566
  ...se,
5564
5567
  type: "tel",
5565
- label: ae,
5568
+ label: ie,
5566
5569
  value: f[c] || "",
5567
5570
  onChange: (le) => F(c, le.target.value),
5568
- error: ie
5571
+ error: te
5569
5572
  },
5570
5573
  fe
5571
5574
  );
@@ -5575,17 +5578,17 @@ const _e = {
5575
5578
  {
5576
5579
  ...se,
5577
5580
  type: "text",
5578
- label: ae,
5581
+ label: ie,
5579
5582
  value: f[c] || "",
5580
5583
  onChange: (le) => F(c, le.target.value),
5581
- error: ie
5584
+ error: te
5582
5585
  },
5583
5586
  fe
5584
5587
  );
5585
5588
  }
5586
5589
  }, xt = (c, L) => {
5587
5590
  if (c.customType === "paragraph") {
5588
- const y = c.displayText || c.label || "";
5591
+ const g = c.displayText || c.label || "";
5589
5592
  return /* @__PURE__ */ r(
5590
5593
  "p",
5591
5594
  {
@@ -5596,7 +5599,7 @@ const _e = {
5596
5599
  margin: 0,
5597
5600
  color: "var(--metakyc-text-secondary, #6b7280)"
5598
5601
  },
5599
- dangerouslySetInnerHTML: { __html: y }
5602
+ dangerouslySetInnerHTML: { __html: g }
5600
5603
  },
5601
5604
  `custom-${L}`
5602
5605
  );
@@ -5604,7 +5607,7 @@ const _e = {
5604
5607
  if (c.customType === "br")
5605
5608
  return /* @__PURE__ */ r("div", { style: { height: "12px" } }, `custom-${L}`);
5606
5609
  if (c.customType === "link") {
5607
- const y = c.displayText || c.label || c.linkText || c.linkUrl || "";
5610
+ const g = c.displayText || c.label || c.linkText || c.linkUrl || "";
5608
5611
  return /* @__PURE__ */ r("div", { className: "metakyc-link-field", children: /* @__PURE__ */ s(
5609
5612
  "a",
5610
5613
  {
@@ -5621,14 +5624,14 @@ const _e = {
5621
5624
  cursor: "pointer"
5622
5625
  },
5623
5626
  children: [
5624
- y,
5627
+ g,
5625
5628
  /* @__PURE__ */ r("span", { style: { fontSize: "10px", opacity: 0.7 }, children: "↗" })
5626
5629
  ]
5627
5630
  }
5628
5631
  ) }, `custom-${L}`);
5629
5632
  }
5630
5633
  if (!c.paramName) return null;
5631
- const $ = T[c.paramName], g = c.displayText || c.label || c.paramName;
5634
+ const $ = T[c.paramName], y = c.displayText || c.label || c.paramName;
5632
5635
  if (c.customType === "checkbox")
5633
5636
  return /* @__PURE__ */ s("div", { className: "flex flex-col gap-1", children: [
5634
5637
  /* @__PURE__ */ s(
@@ -5642,7 +5645,7 @@ const _e = {
5642
5645
  {
5643
5646
  type: "checkbox",
5644
5647
  checked: P[c.paramName] === "true",
5645
- onChange: (y) => S(c.paramName, y.target.checked ? "true" : "false"),
5648
+ onChange: (g) => S(c.paramName, g.target.checked ? "true" : "false"),
5646
5649
  className: "metakyc-option-input",
5647
5650
  style: _e
5648
5651
  }
@@ -5653,7 +5656,7 @@ const _e = {
5653
5656
  className: "metakyc-option-text",
5654
5657
  style: { fontSize: "14px", color: "var(--metakyc-text-primary, #111827)", lineHeight: "1.4" },
5655
5658
  children: [
5656
- g,
5659
+ y,
5657
5660
  c.required && /* @__PURE__ */ r("span", { className: "text-red-500 ml-0.5", children: "*" })
5658
5661
  ]
5659
5662
  }
@@ -5676,7 +5679,7 @@ const _e = {
5676
5679
  {
5677
5680
  type: "checkbox",
5678
5681
  checked: P[c.paramName] === "true",
5679
- onChange: (y) => S(c.paramName, y.target.checked ? "true" : "false"),
5682
+ onChange: (g) => S(c.paramName, g.target.checked ? "true" : "false"),
5680
5683
  className: "metakyc-option-input",
5681
5684
  style: { ..._e, alignSelf: "flex-start", marginTop: "2px" }
5682
5685
  }
@@ -5687,7 +5690,7 @@ const _e = {
5687
5690
  className: "metakyc-option-text",
5688
5691
  style: { fontSize: "14px", color: "var(--metakyc-text-primary, #111827)", lineHeight: "1.4" },
5689
5692
  children: [
5690
- g,
5693
+ y,
5691
5694
  " ",
5692
5695
  c.linkUrl && /* @__PURE__ */ r(
5693
5696
  "a",
@@ -5697,7 +5700,7 @@ const _e = {
5697
5700
  rel: "noopener noreferrer",
5698
5701
  className: "underline",
5699
5702
  style: { color: "var(--metakyc-primary, #2563eb)" },
5700
- onClick: (y) => y.stopPropagation(),
5703
+ onClick: (g) => g.stopPropagation(),
5701
5704
  children: c.linkText || c.linkUrl
5702
5705
  }
5703
5706
  ),
@@ -5711,7 +5714,7 @@ const _e = {
5711
5714
  $ && /* @__PURE__ */ r("p", { className: "text-red-500 text-xs mt-0.5", children: $ })
5712
5715
  ] }, `custom-${L}`);
5713
5716
  if (c.customType === "group_checkbox") {
5714
- const y = (P[c.paramName] || "").split(",").filter(Boolean);
5717
+ const g = (P[c.paramName] || "").split(",").filter(Boolean);
5715
5718
  return /* @__PURE__ */ s("div", { className: "flex flex-col gap-1.5", children: [
5716
5719
  /* @__PURE__ */ s(
5717
5720
  "div",
@@ -5719,13 +5722,13 @@ const _e = {
5719
5722
  className: "text-sm font-medium",
5720
5723
  style: { color: "var(--metakyc-text-primary, #111827)" },
5721
5724
  children: [
5722
- g,
5725
+ y,
5723
5726
  c.required && /* @__PURE__ */ r("span", { className: "text-red-500 ml-0.5", children: "*" })
5724
5727
  ]
5725
5728
  }
5726
5729
  ),
5727
- /* @__PURE__ */ r("div", { className: "metakyc-options-group", style: { display: "flex", flexDirection: "column", gap: "8px" }, children: (c.options || []).map((_) => {
5728
- const ie = c.singleSelect ? P[c.paramName] === _.value : y.includes(_.value);
5730
+ /* @__PURE__ */ r("div", { className: "metakyc-options-group", style: { display: "flex", flexDirection: "column", gap: "8px" }, children: (c.options || []).map((B) => {
5731
+ const te = c.singleSelect ? P[c.paramName] === B.value : g.includes(B.value);
5729
5732
  return /* @__PURE__ */ s(
5730
5733
  "label",
5731
5734
  {
@@ -5736,12 +5739,12 @@ const _e = {
5736
5739
  "input",
5737
5740
  {
5738
5741
  type: "checkbox",
5739
- checked: ie,
5740
- onChange: (ae) => {
5742
+ checked: te,
5743
+ onChange: (ie) => {
5741
5744
  if (c.singleSelect)
5742
- S(c.paramName, ae.target.checked ? _.value : "");
5745
+ S(c.paramName, ie.target.checked ? B.value : "");
5743
5746
  else {
5744
- const fe = ae.target.checked ? [...y, _.value] : y.filter((se) => se !== _.value);
5747
+ const fe = ie.target.checked ? [...g, B.value] : g.filter((se) => se !== B.value);
5745
5748
  S(c.paramName, fe.join(","));
5746
5749
  }
5747
5750
  },
@@ -5754,12 +5757,12 @@ const _e = {
5754
5757
  {
5755
5758
  className: "metakyc-option-text",
5756
5759
  style: { fontSize: "14px", color: "var(--metakyc-text-primary, #111827)", lineHeight: "1.4" },
5757
- children: _.label
5760
+ children: B.label
5758
5761
  }
5759
5762
  )
5760
5763
  ]
5761
5764
  },
5762
- _.value
5765
+ B.value
5763
5766
  );
5764
5767
  }) }),
5765
5768
  $ && /* @__PURE__ */ r("p", { className: "text-red-500 text-xs", children: $ })
@@ -5772,12 +5775,12 @@ const _e = {
5772
5775
  className: "text-sm font-medium",
5773
5776
  style: { color: "var(--metakyc-text-primary, #111827)" },
5774
5777
  children: [
5775
- g,
5778
+ y,
5776
5779
  c.required && /* @__PURE__ */ r("span", { className: "text-red-500 ml-0.5", children: "*" })
5777
5780
  ]
5778
5781
  }
5779
5782
  ),
5780
- /* @__PURE__ */ r("div", { className: "metakyc-options-group", style: { display: "flex", flexDirection: "column", gap: "8px" }, children: (c.options || []).map((y) => /* @__PURE__ */ s(
5783
+ /* @__PURE__ */ r("div", { className: "metakyc-options-group", style: { display: "flex", flexDirection: "column", gap: "8px" }, children: (c.options || []).map((g) => /* @__PURE__ */ s(
5781
5784
  "label",
5782
5785
  {
5783
5786
  className: "metakyc-option-label",
@@ -5787,8 +5790,8 @@ const _e = {
5787
5790
  "input",
5788
5791
  {
5789
5792
  type: "radio",
5790
- checked: P[c.paramName] === y.value,
5791
- onChange: () => S(c.paramName, y.value),
5793
+ checked: P[c.paramName] === g.value,
5794
+ onChange: () => S(c.paramName, g.value),
5792
5795
  name: `radio-group-${c.paramName}-${L}`,
5793
5796
  className: "metakyc-option-input",
5794
5797
  style: _e
@@ -5799,21 +5802,21 @@ const _e = {
5799
5802
  {
5800
5803
  className: "metakyc-option-text",
5801
5804
  style: { fontSize: "14px", color: "var(--metakyc-text-primary, #111827)", lineHeight: "1.4" },
5802
- children: y.label
5805
+ children: g.label
5803
5806
  }
5804
5807
  )
5805
5808
  ]
5806
5809
  },
5807
- y.value
5810
+ g.value
5808
5811
  )) }),
5809
5812
  $ && /* @__PURE__ */ r("p", { className: "text-red-500 text-xs", children: $ })
5810
5813
  ] }, `custom-${L}`) : /* @__PURE__ */ r(
5811
5814
  me,
5812
5815
  {
5813
5816
  type: "text",
5814
- label: `${g}${c.required ? " *" : ""}`,
5817
+ label: `${y}${c.required ? " *" : ""}`,
5815
5818
  value: P[c.paramName] || "",
5816
- onChange: (y) => S(c.paramName, y.target.value),
5819
+ onChange: (g) => S(c.paramName, g.target.value),
5817
5820
  required: c.required,
5818
5821
  error: $
5819
5822
  },
@@ -5833,7 +5836,7 @@ const _e = {
5833
5836
  {
5834
5837
  type: "checkbox",
5835
5838
  checked: $,
5836
- onChange: (g) => S(c.conditionalOn, g.target.checked ? "true" : "false"),
5839
+ onChange: (y) => S(c.conditionalOn, y.target.checked ? "true" : "false"),
5837
5840
  className: "metakyc-option-input",
5838
5841
  style: _e
5839
5842
  }
@@ -5849,9 +5852,9 @@ const _e = {
5849
5852
  ]
5850
5853
  }
5851
5854
  ) }),
5852
- $ && /* @__PURE__ */ r("div", { className: "grid grid-cols-4 gap-4", children: c.fields.map((g, y) => {
5853
- const _ = g.colSpan === 1 ? "col-span-1" : g.colSpan === 2 ? "col-span-2" : g.colSpan === 3 ? "col-span-3" : "col-span-4", ie = g.isCustom ? `custom-${y}-${g.paramName}` : `builtin-${g.name}-${y}`;
5854
- return /* @__PURE__ */ r("div", { className: _, children: /* @__PURE__ */ r(ct, { helpText: g.helpText, children: g.isCustom ? xt(g, y) : Ze(g.name, ie, g.displayText, g.countriesType) }) }, ie);
5855
+ $ && /* @__PURE__ */ r("div", { className: "grid grid-cols-4 gap-4", children: c.fields.map((y, g) => {
5856
+ const B = y.colSpan === 1 ? "col-span-1" : y.colSpan === 2 ? "col-span-2" : y.colSpan === 3 ? "col-span-3" : "col-span-4", te = y.isCustom ? `custom-${g}-${y.paramName}` : `builtin-${y.name}-${g}`;
5857
+ return /* @__PURE__ */ r("div", { className: B, children: /* @__PURE__ */ r(ct, { helpText: y.helpText, children: y.isCustom ? xt(y, g) : Ze(y.name, te, y.displayText, y.countriesType) }) }, te);
5855
5858
  }) })
5856
5859
  ] });
5857
5860
  };
@@ -5861,7 +5864,7 @@ const _e = {
5861
5864
  /* @__PURE__ */ r("p", { className: "text-center mt-4", style: { color: "var(--metakyc-text-secondary, #6b7280)", fontSize: "0.875rem" }, children: "Loading form…" })
5862
5865
  ] }) }) });
5863
5866
  if (m) {
5864
- const c = m[H] ?? m[0], L = Y === -1, $ = X === -1, g = m.length, y = U(c), _ = Object.values(T);
5867
+ const c = m[H] ?? m[0], L = Y === -1, $ = X === -1, y = m.length, g = U(c), B = Object.values(T);
5865
5868
  return /* @__PURE__ */ r("div", { className: "metakyc-sdk", children: /* @__PURE__ */ s(K, { children: [
5866
5869
  /* @__PURE__ */ r(de, { children: /* @__PURE__ */ r(Ge, { title: (l == null ? void 0 : l.title) || "Create Applicant" }) }),
5867
5870
  /* @__PURE__ */ s(W, { children: [
@@ -5891,27 +5894,27 @@ const _e = {
5891
5894
  }
5892
5895
  )
5893
5896
  ] }),
5894
- (w || _.length > 0) && /* @__PURE__ */ s("div", { className: "mb-4 p-3 bg-red-50 border border-red-200 rounded-lg", children: [
5897
+ (w || B.length > 0) && /* @__PURE__ */ s("div", { className: "mb-4 p-3 bg-red-50 border border-red-200 rounded-lg", children: [
5895
5898
  w && /* @__PURE__ */ s("p", { className: "text-red-600 text-sm", children: [
5896
5899
  /* @__PURE__ */ r("strong", { children: "Error:" }),
5897
5900
  " ",
5898
5901
  w
5899
5902
  ] }),
5900
- _.map((ie, ae) => /* @__PURE__ */ r("p", { className: "text-red-600 text-sm", children: ie }, ae))
5903
+ B.map((te, ie) => /* @__PURE__ */ r("p", { className: "text-red-600 text-sm", children: te }, ie))
5901
5904
  ] }),
5902
- g > 1 && /* @__PURE__ */ s("div", { className: "flex items-center gap-2 mb-4", children: [
5903
- m.map((ie, ae) => /* @__PURE__ */ r(
5905
+ y > 1 && /* @__PURE__ */ s("div", { className: "flex items-center gap-2 mb-4", children: [
5906
+ m.map((te, ie) => /* @__PURE__ */ r(
5904
5907
  "div",
5905
5908
  {
5906
- className: `h-1.5 rounded-full transition-all ${ae === H ? "flex-1" : "w-8"}`,
5907
- style: ae === H ? { backgroundColor: "var(--metakyc-primary, #2563eb)" } : ae < H ? { backgroundColor: "var(--metakyc-primary-light, #93c5fd)", opacity: 0.7 } : { backgroundColor: "#e5e7eb" }
5909
+ className: `h-1.5 rounded-full transition-all ${ie === H ? "flex-1" : "w-8"}`,
5910
+ style: ie === H ? { backgroundColor: "var(--metakyc-primary, #2563eb)" } : ie < H ? { backgroundColor: "var(--metakyc-primary-light, #93c5fd)", opacity: 0.7 } : { backgroundColor: "#e5e7eb" }
5908
5911
  },
5909
- ae
5912
+ ie
5910
5913
  )),
5911
5914
  /* @__PURE__ */ s("span", { className: "text-xs text-gray-400 flex-shrink-0", children: [
5912
5915
  H + 1,
5913
5916
  " / ",
5914
- g
5917
+ y
5915
5918
  ] })
5916
5919
  ] }),
5917
5920
  bt(c)
@@ -5926,19 +5929,19 @@ const _e = {
5926
5929
  onClick: () => {
5927
5930
  M(Y), J({});
5928
5931
  },
5929
- disabled: te || u,
5932
+ disabled: re || u,
5930
5933
  children: "Previous"
5931
5934
  }
5932
5935
  ),
5933
- L && a && /* @__PURE__ */ r(Z, { type: "button", variant: "outline", onClick: a, disabled: te || u, children: "Cancel" })
5936
+ L && a && /* @__PURE__ */ r(Z, { type: "button", variant: "outline", onClick: a, disabled: re || u, children: "Cancel" })
5934
5937
  ] }),
5935
5938
  /* @__PURE__ */ r(
5936
5939
  Z,
5937
5940
  {
5938
5941
  type: "button",
5939
- isLoading: te || u,
5942
+ isLoading: re || u,
5940
5943
  onClick: $ ? Ce : ke,
5941
- children: $ ? c.conditionalOn && !y ? "Skip & Submit" : "Submit" : c.conditionalOn && !y ? "Skip" : "Next"
5944
+ children: $ ? c.conditionalOn && !g ? "Skip & Submit" : "Submit" : c.conditionalOn && !g ? "Skip" : "Next"
5942
5945
  }
5943
5946
  )
5944
5947
  ] })
@@ -5955,8 +5958,8 @@ const _e = {
5955
5958
  /* @__PURE__ */ r("div", { className: "grid grid-cols-4 gap-4", children: h.map((c) => /* @__PURE__ */ r("div", { className: "col-span-4", children: Ze(c) }, c)) })
5956
5959
  ] }),
5957
5960
  /* @__PURE__ */ s(pe, { className: "flex justify-between", children: [
5958
- a && /* @__PURE__ */ r(Z, { type: "button", variant: "outline", onClick: a, disabled: te || u, children: "Cancel" }),
5959
- /* @__PURE__ */ r(Z, { type: "submit", isLoading: te || u, children: "Create Applicant" })
5961
+ a && /* @__PURE__ */ r(Z, { type: "button", variant: "outline", onClick: a, disabled: re || u, children: "Cancel" }),
5962
+ /* @__PURE__ */ r(Z, { type: "submit", isLoading: re || u, children: "Create Applicant" })
5960
5963
  ] })
5961
5964
  ] }) }) });
5962
5965
  }, gn = ({