@vpdev2/metakyc 1.0.78 → 1.0.80

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
@@ -4,7 +4,7 @@ var be = (e, t, a) => Vi(e, typeof t != "symbol" ? t + "" : t, a);
4
4
  import Si from "axios";
5
5
  import { jsx as i, jsxs as s, Fragment as bt } from "react/jsx-runtime";
6
6
  import * as ei from "react";
7
- import fe, { createContext as Gt, useMemo as Ue, useState as T, useEffect as ye, useContext as Qt, useCallback as ee, useRef as pe, forwardRef as At, createElement as Wt } from "react";
7
+ import ye, { createContext as Gt, useMemo as Ue, useState as T, useEffect as fe, useContext as Qt, useCallback as ee, useRef as pe, forwardRef as At, createElement as Wt } from "react";
8
8
  import Bi, { createPortal as Ft } from "react-dom";
9
9
  import { useForm as qi, Controller as yt } from "react-hook-form";
10
10
  import { z as ot } from "zod";
@@ -7155,7 +7155,7 @@ function ie(e, t) {
7155
7155
  const r = Jr.exec(a);
7156
7156
  return r ? t(r[1]) : e;
7157
7157
  }
7158
- const Yt = "1.0.78", Ri = Gt(null), di = `metakyc-translations-${Yt}-`, ea = ({
7158
+ const Yt = "1.0.80", Ri = Gt(null), di = `metakyc-translations-${Yt}-`, ea = ({
7159
7159
  locale: e,
7160
7160
  fetchTranslations: t,
7161
7161
  children: a
@@ -7170,7 +7170,9 @@ const Yt = "1.0.78", Ri = Gt(null), di = `metakyc-translations-${Yt}-`, ea = ({
7170
7170
  }
7171
7171
  return u;
7172
7172
  }, [r]), [o, l] = T(n);
7173
- ye(() => {
7173
+ fe(() => {
7174
+ l(n);
7175
+ }, [n]), fe(() => {
7174
7176
  if (!t) return;
7175
7177
  let u = !1;
7176
7178
  return t(r).then((p) => {
@@ -7220,7 +7222,7 @@ function ia() {
7220
7222
  }
7221
7223
  const mi = "metakyc-theme-cache", An = ({ config: e, children: t }) => {
7222
7224
  ia();
7223
- const [a, r] = T(null), [n, o] = T(e.locale || "en"), l = fe.useRef(!1), c = fe.useRef(!1), u = Ue(() => {
7225
+ const [a, r] = T(null), [n, o] = T(e.locale || "en"), l = ye.useRef(!1), c = ye.useRef(!1), u = Ue(() => {
7224
7226
  _.setLevel(e.debug ?? e.logLevel ?? "none"), _.info(`SDK v${Yt} initializing — baseUrl=${e.baseUrl}`);
7225
7227
  const x = new sr(e), A = new lr(x), S = new cr(x), B = new dr(x), N = new ur(x), U = new mr(x), K = new pr(x), O = new gr(x), M = new fr(x), Y = new yr(x), G = new Sr(x), Q = new Cr(x), v = new Pr();
7226
7228
  if (typeof document < "u")
@@ -7267,7 +7269,7 @@ const mi = "metakyc-theme-cache", An = ({ config: e, children: t }) => {
7267
7269
  locale: n,
7268
7270
  setLocale: p
7269
7271
  }), [e, u, a, n, p]);
7270
- ye(() => ((async () => {
7272
+ fe(() => ((async () => {
7271
7273
  if (l.current || c.current) {
7272
7274
  _.debug("Theme already loading or loaded, skipping");
7273
7275
  return;
@@ -7409,9 +7411,9 @@ function Mn() {
7409
7411
  }
7410
7412
  function sa(e) {
7411
7413
  const { createOrchestrator: t, config: a } = Se(), [r, n] = T(null), [o, l] = T(!1), [c, u] = T(null), p = pe(null), f = e || a.applicantId || void 0;
7412
- ye(() => {
7414
+ fe(() => {
7413
7415
  p.current || (p.current = t());
7414
- }, [t]), ye(() => {
7416
+ }, [t]), fe(() => {
7415
7417
  var M;
7416
7418
  r && f && na({
7417
7419
  applicantId: f,
@@ -7439,7 +7441,7 @@ function sa(e) {
7439
7441
  }
7440
7442
  }
7441
7443
  }, [f]);
7442
- ye(() => {
7444
+ fe(() => {
7443
7445
  f && x.current !== f && A();
7444
7446
  }, [f, A]);
7445
7447
  const S = ee(async () => {
@@ -7530,7 +7532,7 @@ function la(e) {
7530
7532
  l(!1);
7531
7533
  }
7532
7534
  }, [t]);
7533
- ye(() => {
7535
+ fe(() => {
7534
7536
  A.current || S();
7535
7537
  }, [S]);
7536
7538
  const B = ee((G) => {
@@ -7583,7 +7585,7 @@ function ca(e) {
7583
7585
  }
7584
7586
  }
7585
7587
  }, [e, t, a]);
7586
- ye(() => {
7588
+ fe(() => {
7587
7589
  e && S.current !== e && B();
7588
7590
  }, [e]);
7589
7591
  const N = ee(
@@ -7627,7 +7629,7 @@ function da(e) {
7627
7629
  }
7628
7630
  }
7629
7631
  }, [e, t]);
7630
- ye(() => {
7632
+ fe(() => {
7631
7633
  e && A.current !== e && S();
7632
7634
  }, [e]);
7633
7635
  const B = ee(
@@ -7671,7 +7673,7 @@ function jn(e) {
7671
7673
  }
7672
7674
  }
7673
7675
  }, [e, t]);
7674
- ye(() => {
7676
+ fe(() => {
7675
7677
  e && A.current !== e && S();
7676
7678
  }, [e]);
7677
7679
  const B = ee(
@@ -7716,7 +7718,7 @@ function ua(e) {
7716
7718
  }
7717
7719
  }
7718
7720
  }, [e, t]);
7719
- ye(() => {
7721
+ fe(() => {
7720
7722
  e && y.current !== e && x();
7721
7723
  }, [e]);
7722
7724
  const A = ee(async () => {
@@ -7857,7 +7859,7 @@ function pa(e) {
7857
7859
  }
7858
7860
  }
7859
7861
  }, [e, t, a]);
7860
- ye(() => {
7862
+ fe(() => {
7861
7863
  e && N.current !== e && U();
7862
7864
  }, [e]);
7863
7865
  const K = ee(
@@ -8399,7 +8401,7 @@ const pi = 280, ha = ({
8399
8401
  }, [f, G, Q]), z = ee(() => {
8400
8402
  x(!1), S("");
8401
8403
  }, []);
8402
- ye(() => {
8404
+ fe(() => {
8403
8405
  if (!y) return;
8404
8406
  const R = (P) => {
8405
8407
  var Z, ge;
@@ -8407,7 +8409,7 @@ const pi = 280, ha = ({
8407
8409
  !((Z = O.current) != null && Z.contains(j)) && !((ge = Y.current) != null && ge.contains(j)) && z();
8408
8410
  };
8409
8411
  return document.addEventListener("mousedown", R), () => document.removeEventListener("mousedown", R);
8410
- }, [y, z]), ye(() => {
8412
+ }, [y, z]), fe(() => {
8411
8413
  if (!y) return;
8412
8414
  const R = () => {
8413
8415
  const P = G();
@@ -8676,7 +8678,7 @@ const pi = 280, ha = ({
8676
8678
  }, [A, X, G]), H = ee(() => {
8677
8679
  B(!1), U("");
8678
8680
  }, []), re = () => S ? H() : te();
8679
- ye(() => {
8681
+ fe(() => {
8680
8682
  if (!S) return;
8681
8683
  const W = (J) => {
8682
8684
  var Re, Ce;
@@ -8684,7 +8686,7 @@ const pi = 280, ha = ({
8684
8686
  !((Re = Q.current) != null && Re.contains(ke)) && !((Ce = z.current) != null && Ce.contains(ke)) && H();
8685
8687
  };
8686
8688
  return document.addEventListener("mousedown", W), () => document.removeEventListener("mousedown", W);
8687
- }, [S, H]), ye(() => {
8689
+ }, [S, H]), fe(() => {
8688
8690
  if (!S) return;
8689
8691
  const W = () => {
8690
8692
  const J = X();
@@ -8693,7 +8695,7 @@ const pi = 280, ha = ({
8693
8695
  return window.addEventListener("scroll", W, !0), window.addEventListener("resize", W), () => {
8694
8696
  window.removeEventListener("scroll", W, !0), window.removeEventListener("resize", W);
8695
8697
  };
8696
- }, [S, X]), ye(() => {
8698
+ }, [S, X]), fe(() => {
8697
8699
  S && F.current && setTimeout(() => {
8698
8700
  var W;
8699
8701
  return (W = F.current) == null ? void 0 : W.focus();
@@ -9327,7 +9329,7 @@ const za = ({
9327
9329
  onBack: a
9328
9330
  }) => {
9329
9331
  const { t: r } = Ie(), { questionnaire: n, initialAnswers: o, isLoading: l, isSubmitting: c, error: u, submit: p } = ca(e), [f, y] = T({}), [x, A] = T({}), [S, B] = T(0);
9330
- fe.useEffect(() => {
9332
+ ye.useEffect(() => {
9331
9333
  o && Object.keys(o).length > 0 && Object.keys(f).length === 0 && y(o);
9332
9334
  }, [o]);
9333
9335
  const N = Ue(
@@ -9866,14 +9868,14 @@ const qa = ({
9866
9868
  onBack: a
9867
9869
  }) => {
9868
9870
  const { t: r } = Ie(), { config: n } = Se(), o = n.locale ?? "en", { criteria: l, initialAnswers: c, isLoading: u, isSubmitting: p, error: f, submit: y } = pa(e), [x, A] = T({}), [S, B] = T({}), [N, U] = T(0), [K, O] = T(!1);
9869
- fe.useEffect(() => {
9871
+ ye.useEffect(() => {
9870
9872
  c && Object.keys(c).length > 0 && Object.keys(x).length === 0 && A(c);
9871
9873
  }, [c]);
9872
9874
  const M = Ue(
9873
9875
  () => l && l.length > 0 ? Va(l) : [],
9874
9876
  [l]
9875
9877
  ), Y = N === M.length - 1, G = M[N] ?? [];
9876
- fe.useEffect(() => {
9878
+ ye.useEffect(() => {
9877
9879
  !u && l && l.length === 0 && !K && !p && (O(!0), y({ applicantId: e, criteriaValueInputs: [] }).then(() => t == null ? void 0 : t()).catch(console.error));
9878
9880
  }, [u, l, K, p, y, e, t]);
9879
9881
  const Q = ee((te, H) => {
@@ -10226,7 +10228,7 @@ const Wa = ({
10226
10228
  onBack: a
10227
10229
  }) => {
10228
10230
  const { t: r } = Ie(), { appropriatenessTestService: n } = Se(), [o, l] = T(null), [c, u] = T(!0), [p, f] = T(!1), [y, x] = T(null), [A, S] = T({}), [B, N] = T(0), [U, K] = T(!1), [O, M] = T(!1), [Y, G] = T(0), [Q, v] = T(0), [z, F] = T(null);
10229
- ye(() => {
10231
+ fe(() => {
10230
10232
  (async () => {
10231
10233
  try {
10232
10234
  u(!0), x(null);
@@ -10241,19 +10243,19 @@ const Wa = ({
10241
10243
  u(!1);
10242
10244
  }
10243
10245
  })();
10244
- }, [e, n]), ye(() => {
10246
+ }, [e, n]), fe(() => {
10245
10247
  if (!U || B <= 0) return;
10246
10248
  const P = setInterval(() => {
10247
10249
  N((j) => j <= 1 ? (M(!0), 0) : j - 1);
10248
10250
  }, 1e3);
10249
10251
  return () => clearInterval(P);
10250
- }, [U, B]), ye(() => {
10252
+ }, [U, B]), fe(() => {
10251
10253
  if (Y <= 0) return;
10252
10254
  const P = setInterval(() => {
10253
10255
  G((j) => j <= 1 ? 0 : j - 1);
10254
10256
  }, 1e3);
10255
10257
  return () => clearInterval(P);
10256
- }, [Y]), ye(() => {
10258
+ }, [Y]), fe(() => {
10257
10259
  O && !p && re();
10258
10260
  }, [O]);
10259
10261
  const X = () => {
@@ -10796,7 +10798,7 @@ const Wa = ({
10796
10798
  onBack: a
10797
10799
  }) => {
10798
10800
  var gt, b, V, D;
10799
- const { t: r } = Ie(), { applicantService: n, baseInformationService: o, identityService: l, config: c, currentTheme: u } = Se(), { identityData: p, provider: f, token: y, isLoading: x, error: A, requestIdentity: S, restartIdentity: B } = ma(e), [N, U] = T(null), [K, O] = T(null), [M, Y] = T([]), [G, Q] = T([]), [v, z] = T(!0), [F, X] = T(!1), [te, H] = T(null), [re, me] = T(!1), de = fe.useRef(!1), [Ne, le] = T("idle"), ve = pe(!1), he = pe(null), [$, R] = T({}), [P, j] = T({}), Z = u != null && u.reviewPageFields && u.reviewPageFields.length > 0 ? u.reviewPageFields[0] : null, ge = !!(u != null && u.reviewPageDisabled), W = pe(!1);
10801
+ const { t: r } = Ie(), { applicantService: n, baseInformationService: o, identityService: l, config: c, currentTheme: u } = Se(), { identityData: p, provider: f, token: y, isLoading: x, error: A, requestIdentity: S, restartIdentity: B } = ma(e), [N, U] = T(null), [K, O] = T(null), [M, Y] = T([]), [G, Q] = T([]), [v, z] = T(!0), [F, X] = T(!1), [te, H] = T(null), [re, me] = T(!1), de = ye.useRef(!1), [Ne, le] = T("idle"), ve = pe(!1), he = pe(null), [$, R] = T({}), [P, j] = T({}), Z = u != null && u.reviewPageFields && u.reviewPageFields.length > 0 ? u.reviewPageFields[0] : null, ge = !!(u != null && u.reviewPageDisabled), W = pe(!1);
10800
10802
  W.current = ge;
10801
10803
  const J = qi({
10802
10804
  defaultValues: {
@@ -10809,7 +10811,7 @@ const Wa = ({
10809
10811
  phonenumber: ""
10810
10812
  }
10811
10813
  });
10812
- ye(() => {
10814
+ fe(() => {
10813
10815
  if (ge) {
10814
10816
  de.current || (de.current = !0, S().then(() => X(!0)).catch((h) => console.error("[Identity] Auto-request failed:", h)).finally(() => z(!1)));
10815
10817
  return;
@@ -10872,9 +10874,9 @@ const Wa = ({
10872
10874
  z(!1);
10873
10875
  }
10874
10876
  })();
10875
- }, [e]), ye(() => {
10877
+ }, [e]), fe(() => {
10876
10878
  p && !F && W.current && (console.log("[Identity] Review page disabled — showing cached provider"), X(!0));
10877
- }, [p, F]), ye(() => {
10879
+ }, [p, F]), fe(() => {
10878
10880
  if (y) {
10879
10881
  if (y.expiresAt) {
10880
10882
  const g = new Date(y.expiresAt).getTime();
@@ -10902,7 +10904,7 @@ const Wa = ({
10902
10904
  const ke = 5e3, Re = 600 * 1e3, Ce = ee(() => {
10903
10905
  ve.current || (ve.current = !0, he.current && (clearInterval(he.current), he.current = null), t == null || t());
10904
10906
  }, [t]);
10905
- ye(() => {
10907
+ fe(() => {
10906
10908
  if (!F || !e || ve.current) return;
10907
10909
  const g = Date.now(), h = async () => {
10908
10910
  var E;
@@ -10935,7 +10937,7 @@ const Wa = ({
10935
10937
  };
10936
10938
  }, [F, e, n, Ce]);
10937
10939
  const _e = f !== null && f === Ge.Sumsub;
10938
- ye(() => {
10940
+ fe(() => {
10939
10941
  if (f !== null && y && !N && F && !re) {
10940
10942
  const g = f;
10941
10943
  if (_e) {
@@ -11752,7 +11754,7 @@ const Qa = ({ children: e }) => {
11752
11754
  return /* @__PURE__ */ i(Mi.Provider, { value: p, children: e });
11753
11755
  }, ki = 2147483640, Xa = () => {
11754
11756
  const e = ji(), [t, a] = T(!1), [r, n] = T("actions"), [o, l] = T(null), c = pe(null);
11755
- if (ye(() => {
11757
+ if (fe(() => {
11756
11758
  if (!t) return;
11757
11759
  const v = (F) => {
11758
11760
  c.current && !c.current.contains(F.target) && a(!1);
@@ -11847,7 +11849,7 @@ const Qa = ({ children: e }) => {
11847
11849
  textAlign: "left",
11848
11850
  transition: "background 0.1s",
11849
11851
  opacity: v ? 0.6 : 1
11850
- }), M = (v) => /* @__PURE__ */ i("span", { style: { fontSize: "14px", width: "20px", textAlign: "center", flexShrink: 0 }, children: v }), Y = (v, z) => z.length === 0 ? null : /* @__PURE__ */ s(fe.Fragment, { children: [
11852
+ }), M = (v) => /* @__PURE__ */ i("span", { style: { fontSize: "14px", width: "20px", textAlign: "center", flexShrink: 0 }, children: v }), Y = (v, z) => z.length === 0 ? null : /* @__PURE__ */ s(ye.Fragment, { children: [
11851
11853
  /* @__PURE__ */ i("div", { style: K, children: v }),
11852
11854
  z.map((F) => /* @__PURE__ */ s(
11853
11855
  "button",
@@ -12018,7 +12020,7 @@ const nn = {
12018
12020
  display: "inline-block",
12019
12021
  verticalAlign: "middle"
12020
12022
  }, vi = ({ helpText: e, children: t }) => {
12021
- const [a, r] = fe.useState(!1);
12023
+ const [a, r] = ye.useState(!1);
12022
12024
  if (!e) return /* @__PURE__ */ i(bt, { children: t });
12023
12025
  const n = a ? /* @__PURE__ */ i(
12024
12026
  "div",
@@ -12193,7 +12195,7 @@ const nn = {
12193
12195
  G.has(m) && d.add((C = dt[m]) == null ? void 0 : C.countriesType);
12194
12196
  return d.size === 0 && d.add(void 0), Array.from(d);
12195
12197
  }, [Y, O]), [v, z] = T({}), [F, X] = T(!0), te = pe(/* @__PURE__ */ new Set()), H = pe(/* @__PURE__ */ new Set());
12196
- ye(() => {
12198
+ fe(() => {
12197
12199
  if (!c) return;
12198
12200
  const d = Q.filter((m) => {
12199
12201
  const k = m != null ? String(m) : "all";
@@ -12291,7 +12293,7 @@ const nn = {
12291
12293
  }), he = Object.fromEntries(
12292
12294
  Object.entries(B).filter(([d]) => !(d in de) && d !== "externalRefId" && d !== "workflowKey")
12293
12295
  ), [$, R] = T({ ...he }), [P, j] = T(!!a);
12294
- ye(() => {
12296
+ fe(() => {
12295
12297
  if (!a) return;
12296
12298
  let d = !1;
12297
12299
  return (async () => {
@@ -12362,7 +12364,7 @@ const nn = {
12362
12364
  return m;
12363
12365
  }), J({}), Re(null);
12364
12366
  }, [O, v]);
12365
- ye(() => {
12367
+ fe(() => {
12366
12368
  const d = st.current;
12367
12369
  if (d)
12368
12370
  return d.registerAction({
@@ -13075,7 +13077,7 @@ const sn = ({
13075
13077
  O.has(g) && b.add((D = ht[g]) == null ? void 0 : D.countriesType);
13076
13078
  return b.size === 0 && b.add(void 0), Array.from(b);
13077
13079
  }, [K, N]), [Y, G] = T({}), [Q, v] = T(!0), z = pe(/* @__PURE__ */ new Set()), F = pe(/* @__PURE__ */ new Set());
13078
- ye(() => {
13080
+ fe(() => {
13079
13081
  if (!l) return;
13080
13082
  const b = M.filter((g) => {
13081
13083
  const h = g != null ? String(g) : "all";
@@ -13178,7 +13180,7 @@ const sn = ({
13178
13180
  return g;
13179
13181
  }), $({}), P(null);
13180
13182
  }, [N, Y]);
13181
- ye(() => {
13183
+ fe(() => {
13182
13184
  const b = ge.current;
13183
13185
  if (b)
13184
13186
  return b.registerAction({
@@ -13595,14 +13597,14 @@ const sn = ({
13595
13597
  error: B,
13596
13598
  moveBack: N,
13597
13599
  refreshProgress: U
13598
- } = sa(e), [K, O] = fe.useState(!1), [M, Y] = fe.useState(null), G = fe.useRef(null), Q = It(), {
13600
+ } = sa(e), [K, O] = ye.useState(!1), [M, Y] = ye.useState(null), G = ye.useRef(null), Q = It(), {
13599
13601
  questionnaireService: v,
13600
13602
  overviewService: z,
13601
13603
  riskScoringService: F,
13602
13604
  appropriatenessTestService: X,
13603
13605
  uploadDocumentService: te
13604
13606
  } = Se();
13605
- fe.useEffect(() => {
13607
+ ye.useEffect(() => {
13606
13608
  const $ = Q.current;
13607
13609
  if (!$) return;
13608
13610
  const R = f ? f.title || f.name || ae[f.action] : null;
@@ -13613,7 +13615,7 @@ const sn = ({
13613
13615
  workflowStatus: (p == null ? void 0 : p.status) != null ? qe[p.status] : null,
13614
13616
  totalSteps: y.length
13615
13617
  });
13616
- }, [Q, f, p == null ? void 0 : p.status, y.length]), fe.useEffect(() => {
13618
+ }, [Q, f, p == null ? void 0 : p.status, y.length]), ye.useEffect(() => {
13617
13619
  const $ = Q.current;
13618
13620
  if ($)
13619
13621
  return $.registerAction({
@@ -13624,11 +13626,11 @@ const sn = ({
13624
13626
  handler: U
13625
13627
  }), () => $.unregisterAction("workflow-refresh");
13626
13628
  }, [Q, U]);
13627
- const H = fe.useMemo(() => y.filter(($) => $.visibility !== !1), [y]), me = fe.useMemo(
13629
+ const H = ye.useMemo(() => y.filter(($) => $.visibility !== !1), [y]), me = ye.useMemo(
13628
13630
  () => H.findIndex(($) => $.order === (f == null ? void 0 : f.order)),
13629
13631
  [H, f == null ? void 0 : f.order]
13630
13632
  ) <= 0;
13631
- fe.useEffect(() => {
13633
+ ye.useEffect(() => {
13632
13634
  const $ = Q.current;
13633
13635
  if ($) {
13634
13636
  if (me) {
@@ -13644,7 +13646,7 @@ const sn = ({
13644
13646
  }), () => $.unregisterAction("workflow-back");
13645
13647
  }
13646
13648
  }, [Q, N, me]);
13647
- const de = fe.useCallback(async () => {
13649
+ const de = ye.useCallback(async () => {
13648
13650
  if (!f || !e) return;
13649
13651
  const $ = f.action;
13650
13652
  try {
@@ -13748,7 +13750,7 @@ const sn = ({
13748
13750
  X,
13749
13751
  te
13750
13752
  ]);
13751
- fe.useEffect(() => {
13753
+ ye.useEffect(() => {
13752
13754
  const $ = Q.current;
13753
13755
  if (!$ || !f) return;
13754
13756
  const R = f.action;
@@ -13763,13 +13765,13 @@ const sn = ({
13763
13765
  group: "workflow",
13764
13766
  handler: de
13765
13767
  }), () => $.unregisterAction("workflow-skip");
13766
- }, [Q, f, de]), fe.useEffect(() => {
13768
+ }, [Q, f, de]), ye.useEffect(() => {
13767
13769
  B && a && a(B);
13768
- }, [B, a]), fe.useEffect(() => {
13770
+ }, [B, a]), ye.useEffect(() => {
13769
13771
  p != null && p.workflowResult && t && t(p.workflowResult);
13770
13772
  }, [p == null ? void 0 : p.workflowResult, t]);
13771
- const Ne = fe.useRef(!1);
13772
- if (fe.useEffect(() => {
13773
+ const Ne = ye.useRef(!1);
13774
+ if (ye.useEffect(() => {
13773
13775
  if (!A || !x || !e || Ne.current) return;
13774
13776
  Ne.current = !0;
13775
13777
  let $ = !1;
@@ -13943,10 +13945,10 @@ const sn = ({
13943
13945
  ve(),
13944
13946
  he()
13945
13947
  ] });
13946
- }, un = fe.forwardRef(
13948
+ }, un = ye.forwardRef(
13947
13949
  ({ visibleSteps: e, currentVisibleStepIndex: t, getStepFallbackName: a }, r) => {
13948
- const n = fe.useRef(null), o = fe.useRef(null);
13949
- return fe.useImperativeHandle(r, () => n.current), fe.useEffect(() => {
13950
+ const n = ye.useRef(null), o = ye.useRef(null);
13951
+ return ye.useImperativeHandle(r, () => n.current), ye.useEffect(() => {
13950
13952
  if (o.current && n.current) {
13951
13953
  const l = n.current, c = o.current, u = c.offsetLeft - l.offsetWidth / 2 + c.offsetWidth / 2;
13952
13954
  l.scrollTo({ left: Math.max(0, u), behavior: "smooth" });
@@ -13970,7 +13972,7 @@ const sn = ({
13970
13972
  },
13971
13973
  children: e.map((l, c) => {
13972
13974
  const u = c < t, p = c === t, f = u || p, y = l.displayName || l.name || a(l.action) || `Step ${c + 1}`;
13973
- return /* @__PURE__ */ s(fe.Fragment, { children: [
13975
+ return /* @__PURE__ */ s(ye.Fragment, { children: [
13974
13976
  /* @__PURE__ */ s(
13975
13977
  "div",
13976
13978
  {
@@ -14065,7 +14067,7 @@ const sn = ({
14065
14067
  }
14066
14068
  ), pn = () => {
14067
14069
  const { locale: e, setLocale: t } = Se(), [a, r] = T(!1), n = pe(null), o = Object.keys(Pt);
14068
- ye(() => {
14070
+ fe(() => {
14069
14071
  const c = (u) => {
14070
14072
  n.current && !n.current.contains(u.target) && r(!1);
14071
14073
  };
@@ -14187,11 +14189,12 @@ const sn = ({
14187
14189
  );
14188
14190
  }, gn = ["ar"], Ct = ({ className: e, children: t }) => {
14189
14191
  const { config: a, locale: r } = Se(), n = gn.includes(r);
14190
- return /* @__PURE__ */ s("div", { className: `metakyc-sdk ${e || ""}`, dir: n ? "rtl" : "ltr", children: [
14192
+ return /* @__PURE__ */ s("div", { className: `metakyc-sdk ${e || ""}`, dir: n ? "rtl" : "ltr", style: { position: "relative" }, children: [
14191
14193
  a.showLanguagePicker && /* @__PURE__ */ i("div", { style: {
14192
- display: "flex",
14193
- justifyContent: n ? "flex-start" : "flex-end",
14194
- marginBottom: "8px"
14194
+ position: "absolute",
14195
+ top: "1.5rem",
14196
+ ...n ? { left: "1.5rem" } : { right: "1.5rem" },
14197
+ zIndex: 50
14195
14198
  }, children: /* @__PURE__ */ i(pn, {}) }),
14196
14199
  t
14197
14200
  ] });
@@ -14204,7 +14207,7 @@ const sn = ({
14204
14207
  };
14205
14208
  function fn(e, t, a, r) {
14206
14209
  const n = It();
14207
- fe.useEffect(() => {
14210
+ ye.useEffect(() => {
14208
14211
  var o;
14209
14212
  (o = n.current) == null || o.updateSdkState({ phase: e, applicantId: t ?? null, isCompany: !!a, workflowKey: r ?? null });
14210
14213
  }, [n, e, t, a, r]);
@@ -14230,7 +14233,7 @@ const xi = ({
14230
14233
  } = la(e);
14231
14234
  fn(c, u, p, f);
14232
14235
  const N = It();
14233
- fe.useEffect(() => {
14236
+ ye.useEffect(() => {
14234
14237
  const M = N.current;
14235
14238
  if (M)
14236
14239
  return M.registerAction({
@@ -14240,10 +14243,10 @@ const xi = ({
14240
14243
  group: "general",
14241
14244
  handler: B
14242
14245
  }), () => M.unregisterAction("dev-refresh-state");
14243
- }, [N, B]), fe.useEffect(() => {
14246
+ }, [N, B]), ye.useEffect(() => {
14244
14247
  y && a && a(y);
14245
14248
  }, [y, a]);
14246
- const U = fe.useCallback((M) => {
14249
+ const U = ye.useCallback((M) => {
14247
14250
  r == null || r(M), A(M);
14248
14251
  }, [r, A]);
14249
14252
  if (c === "loading" || x)