@vpdev2/metakyc-sdk 1.0.6 → 1.0.8

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
@@ -2,12 +2,12 @@ var Je = Object.defineProperty;
2
2
  var Xe = (t, e, r) => e in t ? Je(t, e, { enumerable: !0, configurable: !0, writable: !0, value: r }) : t[e] = r;
3
3
  var K = (t, e, r) => Xe(t, typeof e != "symbol" ? e + "" : e, r);
4
4
  import et from "axios";
5
- import * as Le from "react";
6
- import le, { createContext as tt, useState as x, useMemo as $e, useEffect as V, useContext as rt, useRef as je, useCallback as q, forwardRef as De } from "react";
5
+ import * as Te from "react";
6
+ import ce, { createContext as tt, useState as N, useMemo as je, useEffect as Y, useContext as rt, useRef as H, useCallback as q, forwardRef as Fe } from "react";
7
7
  import { jsx as n, jsxs as o, Fragment as nt } from "react/jsx-runtime";
8
- import { get as Ee, set as Ce, appendErrors as _e, useForm as Pe, Controller as G } from "react-hook-form";
9
- import { z as de } from "zod";
10
- var U = /* @__PURE__ */ ((t) => (t[t.IdentitySdk = 0] = "IdentitySdk", t[t.RiskScoring = 1] = "RiskScoring", t[t.Questionaries = 2] = "Questionaries", t[t.AdditionalData = 3] = "AdditionalData", t[t.AppropriatenessTest = 4] = "AppropriatenessTest", t[t.UploadDocument = 5] = "UploadDocument", t[t.ManualReview = 6] = "ManualReview", t[t.Overview = 7] = "Overview", t[t.InvestorCategorization = 8] = "InvestorCategorization", t))(U || {}), we = /* @__PURE__ */ ((t) => (t[t.NotStarted = 0] = "NotStarted", t[t.InProgress = 1] = "InProgress", t[t.Success = 2] = "Success", t[t.PartialSuccess = 3] = "PartialSuccess", t[t.Failed = 4] = "Failed", t[t.Skipped = 5] = "Skipped", t[t.AdminReview = 6] = "AdminReview", t[t.SkippedAndAdminReview = 7] = "SkippedAndAdminReview", t))(we || {}), ae = /* @__PURE__ */ ((t) => (t[t.None = 0] = "None", t[t.InProgress = 1] = "InProgress", t[t.Finished = 2] = "Finished", t[t.OnHold = 3] = "OnHold", t[t.IdentityPending = 4] = "IdentityPending", t))(ae || {}), st = /* @__PURE__ */ ((t) => (t[t.None = 0] = "None", t[t.RepresentativeKYC = 1] = "RepresentativeKYC", t[t.ManualRiskCriteria = 2] = "ManualRiskCriteria", t[t.UploadDocumentReview = 3] = "UploadDocumentReview", t[t.AdminReview = 4] = "AdminReview", t))(st || {}), at = /* @__PURE__ */ ((t) => (t[t.LowRisk = 0] = "LowRisk", t[t.MediumRisk = 1] = "MediumRisk", t[t.HighRisk = 2] = "HighRisk", t[t.Alert = 3] = "Alert", t))(at || {}), he = /* @__PURE__ */ ((t) => (t[t.None = 0] = "None", t[t.Pending = 1] = "Pending", t[t.Approved = 2] = "Approved", t[t.Rejected = 3] = "Rejected", t[t.ResendRequested = 4] = "ResendRequested", t[t.Unknown = 5] = "Unknown", t[t.InProgress = 6] = "InProgress", t))(he || {}), pe = /* @__PURE__ */ ((t) => (t[t.Approved = 0] = "Approved", t[t.Reject = 1] = "Reject", t[t.UnderReview = 2] = "UnderReview", t[t.Closed = 3] = "Closed", t[t.AdminReview = 4] = "AdminReview", t[t.New = 5] = "New", t[t.InProgress = 6] = "InProgress", t))(pe || {}), it = /* @__PURE__ */ ((t) => (t[t.ProviderResultPending = 0] = "ProviderResultPending", t[t.ProviderResultReceived = 1] = "ProviderResultReceived", t[t.Canceled = 2] = "Canceled", t[t.ExtendedToNewApplicant = 3] = "ExtendedToNewApplicant", t))(it || {}), ot = /* @__PURE__ */ ((t) => (t[t.None = 0] = "None", t[t.ProviderResultPending = 1] = "ProviderResultPending", t[t.ProviderResultReceived = 2] = "ProviderResultReceived", t[t.Canceled = 3] = "Canceled", t))(ot || {}), se = /* @__PURE__ */ ((t) => (t[t.Onfido = 0] = "Onfido", t[t.Sumsub = 2] = "Sumsub", t[t.SardinAI = 3] = "SardinAI", t))(se || {}), lt = /* @__PURE__ */ ((t) => (t[t.Individual = 0] = "Individual", t[t.Company = 1] = "Company", t))(lt || {}), ke = /* @__PURE__ */ ((t) => (t[t.Male = 0] = "Male", t[t.Female = 1] = "Female", t[t.Other = 2] = "Other", t))(ke || {}), ct = /* @__PURE__ */ ((t) => (t[t.Image = 0] = "Image", t[t.Video = 1] = "Video", t[t.PDF = 2] = "PDF", t[t.OfficePDF = 3] = "OfficePDF", t[t.Custom = 4] = "Custom", t))(ct || {}), dt = /* @__PURE__ */ ((t) => (t[t.Pending = 0] = "Pending", t[t.Approved = 1] = "Approved", t[t.Rejected = 2] = "Rejected", t[t.RequiresRevision = 3] = "RequiresRevision", t))(dt || {}), ut = /* @__PURE__ */ ((t) => (t[t.SingleChoice = 0] = "SingleChoice", t[t.MultipleChoice = 1] = "MultipleChoice", t[t.Text = 2] = "Text", t))(ut || {}), Ie = /* @__PURE__ */ ((t) => (t[t.String = 0] = "String", t[t.Integer = 1] = "Integer", t[t.Decimal = 2] = "Decimal", t[t.Boolean = 3] = "Boolean", t[t.Date = 4] = "Date", t[t.Country = 5] = "Country", t[t.DigitOnly = 6] = "DigitOnly", t))(Ie || {}), mt = /* @__PURE__ */ ((t) => (t[t.Text = 0] = "Text", t[t.Radio = 1] = "Radio", t[t.Checkbox = 2] = "Checkbox", t[t.Dropdown = 3] = "Dropdown", t[t.Country = 4] = "Country", t))(mt || {}), ht = /* @__PURE__ */ ((t) => (t[t.None = 0] = "None", t[t.Country = 1] = "Country", t))(ht || {}), ee = /* @__PURE__ */ ((t) => (t[t.Individual = 0] = "Individual", t[t.Sophisticated = 1] = "Sophisticated", t[t.HighNetWorth = 2] = "HighNetWorth", t[t.Business = 3] = "Business", t))(ee || {}), pt = /* @__PURE__ */ ((t) => (t[t.Retail = 0] = "Retail", t[t.Professional = 1] = "Professional", t[t.EligibleCounterparty = 2] = "EligibleCounterparty", t))(pt || {});
8
+ import { get as Re, set as Ee, appendErrors as _e, useForm as Le, Controller as J } from "react-hook-form";
9
+ import { z as ue } from "zod";
10
+ var U = /* @__PURE__ */ ((t) => (t[t.IdentitySdk = 0] = "IdentitySdk", t[t.RiskScoring = 1] = "RiskScoring", t[t.Questionaries = 2] = "Questionaries", t[t.AdditionalData = 3] = "AdditionalData", t[t.AppropriatenessTest = 4] = "AppropriatenessTest", t[t.UploadDocument = 5] = "UploadDocument", t[t.ManualReview = 6] = "ManualReview", t[t.Overview = 7] = "Overview", t[t.InvestorCategorization = 8] = "InvestorCategorization", t))(U || {}), Ne = /* @__PURE__ */ ((t) => (t[t.NotStarted = 0] = "NotStarted", t[t.InProgress = 1] = "InProgress", t[t.Success = 2] = "Success", t[t.PartialSuccess = 3] = "PartialSuccess", t[t.Failed = 4] = "Failed", t[t.Skipped = 5] = "Skipped", t[t.AdminReview = 6] = "AdminReview", t[t.SkippedAndAdminReview = 7] = "SkippedAndAdminReview", t))(Ne || {}), oe = /* @__PURE__ */ ((t) => (t[t.None = 0] = "None", t[t.InProgress = 1] = "InProgress", t[t.Finished = 2] = "Finished", t[t.OnHold = 3] = "OnHold", t[t.IdentityPending = 4] = "IdentityPending", t))(oe || {}), st = /* @__PURE__ */ ((t) => (t[t.None = 0] = "None", t[t.RepresentativeKYC = 1] = "RepresentativeKYC", t[t.ManualRiskCriteria = 2] = "ManualRiskCriteria", t[t.UploadDocumentReview = 3] = "UploadDocumentReview", t[t.AdminReview = 4] = "AdminReview", t))(st || {}), at = /* @__PURE__ */ ((t) => (t[t.LowRisk = 0] = "LowRisk", t[t.MediumRisk = 1] = "MediumRisk", t[t.HighRisk = 2] = "HighRisk", t[t.Alert = 3] = "Alert", t))(at || {}), pe = /* @__PURE__ */ ((t) => (t[t.None = 0] = "None", t[t.Pending = 1] = "Pending", t[t.Approved = 2] = "Approved", t[t.Rejected = 3] = "Rejected", t[t.ResendRequested = 4] = "ResendRequested", t[t.Unknown = 5] = "Unknown", t[t.InProgress = 6] = "InProgress", t))(pe || {}), ge = /* @__PURE__ */ ((t) => (t[t.Approved = 0] = "Approved", t[t.Reject = 1] = "Reject", t[t.UnderReview = 2] = "UnderReview", t[t.Closed = 3] = "Closed", t[t.AdminReview = 4] = "AdminReview", t[t.New = 5] = "New", t[t.InProgress = 6] = "InProgress", t))(ge || {}), it = /* @__PURE__ */ ((t) => (t[t.ProviderResultPending = 0] = "ProviderResultPending", t[t.ProviderResultReceived = 1] = "ProviderResultReceived", t[t.Canceled = 2] = "Canceled", t[t.ExtendedToNewApplicant = 3] = "ExtendedToNewApplicant", t))(it || {}), ot = /* @__PURE__ */ ((t) => (t[t.None = 0] = "None", t[t.ProviderResultPending = 1] = "ProviderResultPending", t[t.ProviderResultReceived = 2] = "ProviderResultReceived", t[t.Canceled = 3] = "Canceled", t))(ot || {}), ie = /* @__PURE__ */ ((t) => (t[t.Onfido = 0] = "Onfido", t[t.Sumsub = 2] = "Sumsub", t[t.SardinAI = 3] = "SardinAI", t))(ie || {}), lt = /* @__PURE__ */ ((t) => (t[t.Individual = 0] = "Individual", t[t.Company = 1] = "Company", t))(lt || {}), Se = /* @__PURE__ */ ((t) => (t[t.Male = 0] = "Male", t[t.Female = 1] = "Female", t[t.Other = 2] = "Other", t))(Se || {}), ct = /* @__PURE__ */ ((t) => (t[t.Image = 0] = "Image", t[t.Video = 1] = "Video", t[t.PDF = 2] = "PDF", t[t.OfficePDF = 3] = "OfficePDF", t[t.Custom = 4] = "Custom", t))(ct || {}), dt = /* @__PURE__ */ ((t) => (t[t.Pending = 0] = "Pending", t[t.Approved = 1] = "Approved", t[t.Rejected = 2] = "Rejected", t[t.RequiresRevision = 3] = "RequiresRevision", t))(dt || {}), ut = /* @__PURE__ */ ((t) => (t[t.SingleChoice = 0] = "SingleChoice", t[t.MultipleChoice = 1] = "MultipleChoice", t[t.Text = 2] = "Text", t))(ut || {}), De = /* @__PURE__ */ ((t) => (t[t.String = 0] = "String", t[t.Integer = 1] = "Integer", t[t.Decimal = 2] = "Decimal", t[t.Boolean = 3] = "Boolean", t[t.Date = 4] = "Date", t[t.Country = 5] = "Country", t[t.DigitOnly = 6] = "DigitOnly", t))(De || {}), mt = /* @__PURE__ */ ((t) => (t[t.Text = 0] = "Text", t[t.Radio = 1] = "Radio", t[t.Checkbox = 2] = "Checkbox", t[t.Dropdown = 3] = "Dropdown", t[t.Country = 4] = "Country", t))(mt || {}), ht = /* @__PURE__ */ ((t) => (t[t.None = 0] = "None", t[t.Country = 1] = "Country", t))(ht || {}), re = /* @__PURE__ */ ((t) => (t[t.Individual = 0] = "Individual", t[t.Sophisticated = 1] = "Sophisticated", t[t.HighNetWorth = 2] = "HighNetWorth", t[t.Business = 3] = "Business", t))(re || {}), pt = /* @__PURE__ */ ((t) => (t[t.Retail = 0] = "Retail", t[t.Professional = 1] = "Professional", t[t.EligibleCounterparty = 2] = "EligibleCounterparty", t))(pt || {});
11
11
  const gt = [
12
12
  "firstName",
13
13
  "lastName",
@@ -71,7 +71,7 @@ const gt = [
71
71
  taxNumber: { label: "Tax Number", type: "text" },
72
72
  externalRefId: { label: "External Reference ID", type: "text" }
73
73
  };
74
- var Y = /* @__PURE__ */ ((t) => (t.Default = "default", t.Corporate = "corporate", t.Fintech = "fintech", t.Healthcare = "healthcare", t.Modern = "modern", t.Minimal = "minimal", t))(Y || {});
74
+ var W = /* @__PURE__ */ ((t) => (t.Default = "default", t.Corporate = "corporate", t.Fintech = "fintech", t.Healthcare = "healthcare", t.Modern = "modern", t.Minimal = "minimal", t))(W || {});
75
75
  const ft = {
76
76
  timeout: 3e4,
77
77
  retries: 3,
@@ -120,19 +120,19 @@ class bt {
120
120
  }[e] || e;
121
121
  }
122
122
  }
123
- class ce extends Error {
123
+ class de extends Error {
124
124
  constructor(r, s, a, i, c) {
125
125
  super(r);
126
126
  K(this, "response");
127
- this.code = s, this.details = a, this.validationErrors = i, this.name = "MetaKYCError", this.response = c, Object.setPrototypeOf(this, ce.prototype);
127
+ this.code = s, this.details = a, this.validationErrors = i, this.name = "MetaKYCError", this.response = c, Object.setPrototypeOf(this, de.prototype);
128
128
  }
129
129
  }
130
- class be {
130
+ class xe {
131
131
  /**
132
132
  * Process an error from the API response
133
133
  */
134
134
  static handleApiError(e) {
135
- return new ce(
135
+ return new de(
136
136
  e.message || "An unknown error occurred",
137
137
  e.code,
138
138
  e.details || void 0,
@@ -145,36 +145,36 @@ class be {
145
145
  static handleAxiosError(e) {
146
146
  if (e.response) {
147
147
  const r = e.response.data;
148
- return r && r.error ? new ce(
148
+ return r && r.error ? new de(
149
149
  r.error.message || "An unknown error occurred",
150
150
  r.error.code,
151
151
  r.error.details || void 0,
152
152
  r.error.validationErrors || void 0,
153
153
  e.response
154
- ) : r && r.result && r.result.message ? new ce(
154
+ ) : r && r.result && r.result.message ? new de(
155
155
  r.result.message,
156
156
  e.response.status,
157
157
  `HTTP ${e.response.status}: ${e.response.statusText}`,
158
158
  void 0,
159
159
  e.response
160
- ) : new ce(
160
+ ) : new de(
161
161
  (r == null ? void 0 : r.message) || e.message || "Request failed",
162
162
  e.response.status,
163
163
  `HTTP ${e.response.status}: ${e.response.statusText}`,
164
164
  void 0,
165
165
  e.response
166
166
  );
167
- } else return e.request ? new ce(
167
+ } else return e.request ? new de(
168
168
  "No response from server",
169
169
  0,
170
170
  "The request was made but no response was received. Please check your network connection."
171
- ) : new ce(e.message || "An unexpected error occurred", 0, e.toString());
171
+ ) : new de(e.message || "An unexpected error occurred", 0, e.toString());
172
172
  }
173
173
  /**
174
174
  * Check if an error is a MetaKYCError
175
175
  */
176
176
  static isMetaKYCError(e) {
177
- return e instanceof ce;
177
+ return e instanceof de;
178
178
  }
179
179
  }
180
180
  class xt {
@@ -218,7 +218,7 @@ class xt {
218
218
  });
219
219
  return this.handleResponse(i);
220
220
  } catch (a) {
221
- throw be.handleAxiosError(a);
221
+ throw xe.handleAxiosError(a);
222
222
  }
223
223
  }
224
224
  /**
@@ -229,7 +229,7 @@ class xt {
229
229
  const a = this.buildEndpoint(e, r), i = await this.axiosInstance.post(a, s);
230
230
  return this.handleResponse(i);
231
231
  } catch (a) {
232
- throw be.handleAxiosError(a);
232
+ throw xe.handleAxiosError(a);
233
233
  }
234
234
  }
235
235
  /**
@@ -240,7 +240,7 @@ class xt {
240
240
  const a = this.buildEndpoint(e, r), i = await this.axiosInstance.put(a, s);
241
241
  return this.handleResponse(i);
242
242
  } catch (a) {
243
- throw be.handleAxiosError(a);
243
+ throw xe.handleAxiosError(a);
244
244
  }
245
245
  }
246
246
  /**
@@ -253,7 +253,7 @@ class xt {
253
253
  });
254
254
  return this.handleResponse(i);
255
255
  } catch (a) {
256
- throw be.handleAxiosError(a);
256
+ throw xe.handleAxiosError(a);
257
257
  }
258
258
  }
259
259
  /**
@@ -262,7 +262,7 @@ class xt {
262
262
  handleResponse(e) {
263
263
  const r = e.data;
264
264
  if (!r.success && r.error)
265
- throw be.handleApiError(r.error);
265
+ throw xe.handleApiError(r.error);
266
266
  return r;
267
267
  }
268
268
  /**
@@ -646,7 +646,7 @@ class It {
646
646
  )).result;
647
647
  }
648
648
  }
649
- const Q = {
649
+ const Z = {
650
650
  name: "Default",
651
651
  title: "KYC Verification",
652
652
  logo: {
@@ -880,15 +880,15 @@ const Q = {
880
880
  inputHeight: "2.25rem"
881
881
  }
882
882
  }, Tt = {
883
- [Y.Default]: Q,
884
- [Y.Corporate]: Rt,
885
- [Y.Fintech]: Dt,
886
- [Y.Healthcare]: Pt,
887
- [Y.Modern]: Ft,
888
- [Y.Minimal]: Lt
883
+ [W.Default]: Z,
884
+ [W.Corporate]: Rt,
885
+ [W.Fintech]: Dt,
886
+ [W.Healthcare]: Pt,
887
+ [W.Modern]: Ft,
888
+ [W.Minimal]: Lt
889
889
  };
890
- function xe(t) {
891
- return Tt[t] || Q;
890
+ function ve(t) {
891
+ return Tt[t] || Z;
892
892
  }
893
893
  class Mt {
894
894
  constructor(e) {
@@ -905,8 +905,8 @@ class Mt {
905
905
  "GetThemeConfiguration"
906
906
  );
907
907
  if (!r.result.isEnabled)
908
- return xe(Y.Default);
909
- let s = r.result.preset ? xe(r.result.preset) : xe(Y.Default);
908
+ return ve(W.Default);
909
+ let s = r.result.preset ? ve(r.result.preset) : ve(W.Default);
910
910
  return r.result.title && (s.title = r.result.title), r.result.logo && (s.logo = { ...s.logo, ...r.result.logo }), r.result.colors && (s.colors = { ...s.colors, ...r.result.colors }), r.result.typography && (s.typography = { ...s.typography, ...r.result.typography }), r.result.spacing && (s.spacing = { ...s.spacing, ...r.result.spacing }), r.result.customCSS && (s.customCSS = r.result.customCSS), r.result.darkMode && (s.darkMode = {
911
911
  colors: {
912
912
  ...(e = s.darkMode) == null ? void 0 : e.colors,
@@ -914,7 +914,7 @@ class Mt {
914
914
  }
915
915
  }), s;
916
916
  } catch (r) {
917
- return console.warn("[ThemeService] Failed to fetch theme configuration:", r), xe(Y.Default);
917
+ return console.warn("[ThemeService] Failed to fetch theme configuration:", r), ve(W.Default);
918
918
  }
919
919
  }
920
920
  /**
@@ -928,19 +928,19 @@ class Mt {
928
928
  */
929
929
  getAvailablePresets() {
930
930
  return [
931
- { id: Y.Default, name: "Default" },
932
- { id: Y.Corporate, name: "Corporate" },
933
- { id: Y.Fintech, name: "Fintech" },
934
- { id: Y.Healthcare, name: "Healthcare" },
935
- { id: Y.Modern, name: "Modern" },
936
- { id: Y.Minimal, name: "Minimal" }
931
+ { id: W.Default, name: "Default" },
932
+ { id: W.Corporate, name: "Corporate" },
933
+ { id: W.Fintech, name: "Fintech" },
934
+ { id: W.Healthcare, name: "Healthcare" },
935
+ { id: W.Modern, name: "Modern" },
936
+ { id: W.Minimal, name: "Minimal" }
937
937
  ];
938
938
  }
939
939
  /**
940
940
  * Preview theme (doesn't save)
941
941
  */
942
942
  getPreviewTheme(e, r) {
943
- const s = xe(e);
943
+ const s = ve(e);
944
944
  return r ? {
945
945
  ...s,
946
946
  ...r,
@@ -1034,7 +1034,7 @@ class Ot {
1034
1034
  */
1035
1035
  get status() {
1036
1036
  var e;
1037
- return ((e = this._progress) == null ? void 0 : e.status) || ae.None;
1037
+ return ((e = this._progress) == null ? void 0 : e.status) || oe.None;
1038
1038
  }
1039
1039
  /**
1040
1040
  * Get workflow result
@@ -1053,19 +1053,19 @@ class Ot {
1053
1053
  * Check if workflow is complete
1054
1054
  */
1055
1055
  get isComplete() {
1056
- return this.status === ae.Finished;
1056
+ return this.status === oe.Finished;
1057
1057
  }
1058
1058
  /**
1059
1059
  * Check if workflow is on hold
1060
1060
  */
1061
1061
  get isOnHold() {
1062
- return this.status === ae.OnHold;
1062
+ return this.status === oe.OnHold;
1063
1063
  }
1064
1064
  /**
1065
1065
  * Check if workflow is in progress
1066
1066
  */
1067
1067
  get isInProgress() {
1068
- return this.status === ae.InProgress;
1068
+ return this.status === oe.InProgress;
1069
1069
  }
1070
1070
  /**
1071
1071
  * Set applicant ID
@@ -1079,7 +1079,7 @@ class Ot {
1079
1079
  updateProgress(e) {
1080
1080
  var s, a;
1081
1081
  const r = (s = this._progress) == null ? void 0 : s.currentStep;
1082
- this._progress = e, this._applicantId = e.applicantId, this._error = null, this.events.emit("progressUpdated", e), (r == null ? void 0 : r.order) !== ((a = e.currentStep) == null ? void 0 : a.order) && this.events.emit("stepChanged", e.currentStep), this.events.emit("statusChanged", e.status), e.status === ae.Finished && e.workflowResult && this.events.emit("completed", e.workflowResult);
1082
+ this._progress = e, this._applicantId = e.applicantId, this._error = null, this.events.emit("progressUpdated", e), (r == null ? void 0 : r.order) !== ((a = e.currentStep) == null ? void 0 : a.order) && this.events.emit("stepChanged", e.currentStep), this.events.emit("statusChanged", e.status), e.status === oe.Finished && e.workflowResult && this.events.emit("completed", e.workflowResult);
1083
1083
  }
1084
1084
  /**
1085
1085
  * Set error
@@ -1603,17 +1603,17 @@ class Kt {
1603
1603
  this.sardineContext && (this.sardineContext = null);
1604
1604
  }
1605
1605
  }
1606
- class ye {
1606
+ class fe {
1607
1607
  /**
1608
1608
  * Create a provider instance
1609
1609
  */
1610
1610
  static createProvider(e, r) {
1611
1611
  switch (e) {
1612
- case se.Sumsub:
1612
+ case ie.Sumsub:
1613
1613
  return new jt(r);
1614
- case se.Onfido:
1614
+ case ie.Onfido:
1615
1615
  return new _t(r);
1616
- case se.SardinAI:
1616
+ case ie.SardinAI:
1617
1617
  return new Kt(r);
1618
1618
  default:
1619
1619
  throw new Error(`Unsupported identity provider: ${e}`);
@@ -1625,7 +1625,7 @@ class ye {
1625
1625
  static parseProviderConfig(e, r, s) {
1626
1626
  var a;
1627
1627
  switch (e) {
1628
- case se.Sumsub:
1628
+ case ie.Sumsub:
1629
1629
  return {
1630
1630
  accessToken: r.accessToken || r.token,
1631
1631
  applicantEmail: r.email,
@@ -1633,11 +1633,11 @@ class ye {
1633
1633
  externalUserId: r.externalUserId,
1634
1634
  lang: r.lang || "en"
1635
1635
  };
1636
- case se.Onfido:
1636
+ case ie.Onfido:
1637
1637
  return {
1638
1638
  token: r.token || r.sdkToken
1639
1639
  };
1640
- case se.SardinAI:
1640
+ case ie.SardinAI:
1641
1641
  const i = ((a = s == null ? void 0 : s.identityProviders) == null ? void 0 : a.sardinai) || {};
1642
1642
  return {
1643
1643
  clientId: i.clientId || r.clientId,
@@ -1655,7 +1655,7 @@ class ye {
1655
1655
  }
1656
1656
  class Ut {
1657
1657
  constructor(e) {
1658
- K(this, "currentTheme", Q);
1658
+ K(this, "currentTheme", Z);
1659
1659
  K(this, "customStyleElement", null);
1660
1660
  K(this, "container");
1661
1661
  this.container = e || document.documentElement;
@@ -1735,19 +1735,19 @@ class Ut {
1735
1735
  mergeWithDefault(e) {
1736
1736
  var r;
1737
1737
  return {
1738
- name: e.name || Q.name,
1739
- title: e.title || Q.title,
1740
- logo: { ...Q.logo, ...e.logo },
1741
- colors: { ...Q.colors, ...e.colors },
1742
- typography: e.typography ? { ...Q.typography, ...e.typography } : Q.typography,
1743
- spacing: e.spacing ? { ...Q.spacing, ...e.spacing } : Q.spacing,
1738
+ name: e.name || Z.name,
1739
+ title: e.title || Z.title,
1740
+ logo: { ...Z.logo, ...e.logo },
1741
+ colors: { ...Z.colors, ...e.colors },
1742
+ typography: e.typography ? { ...Z.typography, ...e.typography } : Z.typography,
1743
+ spacing: e.spacing ? { ...Z.spacing, ...e.spacing } : Z.spacing,
1744
1744
  customCSS: e.customCSS,
1745
1745
  darkMode: e.darkMode ? {
1746
1746
  colors: {
1747
- ...(r = Q.darkMode) == null ? void 0 : r.colors,
1747
+ ...(r = Z.darkMode) == null ? void 0 : r.colors,
1748
1748
  ...e.darkMode.colors
1749
1749
  }
1750
- } : Q.darkMode
1750
+ } : Z.darkMode
1751
1751
  };
1752
1752
  }
1753
1753
  /**
@@ -1760,7 +1760,7 @@ class Ut {
1760
1760
  * Reset to default theme
1761
1761
  */
1762
1762
  resetTheme() {
1763
- this.applyTheme(Q);
1763
+ this.applyTheme(Z);
1764
1764
  }
1765
1765
  /**
1766
1766
  * Remove all custom styles
@@ -1776,52 +1776,59 @@ class Ut {
1776
1776
  }
1777
1777
  }
1778
1778
  const Ue = tt(null), Or = ({ config: t, children: e }) => {
1779
- const [r, s] = x(null), a = $e(() => {
1780
- const i = new xt(t), c = new vt(i), l = new wt(i), d = new kt(i), u = new Nt(i), g = new St(i), p = new Ct(i), m = new At(i), b = new Et(i), y = new It(i), f = new Mt(i), P = new Ut();
1779
+ const [r, s] = N(null), a = ce.useRef(!1), i = je(() => {
1780
+ const c = new xt(t), l = new vt(c), d = new wt(c), u = new kt(c), y = new Nt(c), x = new St(c), g = new Ct(c), b = new At(c), m = new Et(c), f = new It(c), k = new Mt(c), h = new Ut();
1781
1781
  return {
1782
1782
  config: t,
1783
- httpClient: i,
1784
- applicantService: c,
1785
- questionnaireService: l,
1786
- uploadDocumentService: d,
1787
- appropriatenessTestService: u,
1788
- overviewService: g,
1789
- riskScoringService: p,
1790
- identityService: m,
1791
- baseInformationService: b,
1792
- investorCategorizationService: y,
1793
- themeService: f,
1794
- themeManager: P,
1783
+ httpClient: c,
1784
+ applicantService: l,
1785
+ questionnaireService: d,
1786
+ uploadDocumentService: u,
1787
+ appropriatenessTestService: y,
1788
+ overviewService: x,
1789
+ riskScoringService: g,
1790
+ identityService: b,
1791
+ baseInformationService: m,
1792
+ investorCategorizationService: f,
1793
+ themeService: k,
1794
+ themeManager: h,
1795
1795
  currentTheme: r,
1796
1796
  createOrchestrator: () => new $t(
1797
- c,
1798
1797
  l,
1799
1798
  d,
1800
1799
  u,
1800
+ y,
1801
+ x,
1801
1802
  g,
1802
- p,
1803
- m,
1804
- y
1803
+ b,
1804
+ f
1805
1805
  )
1806
1806
  };
1807
1807
  }, [t, r]);
1808
- return V(() => ((async () => {
1808
+ return Y(() => ((async () => {
1809
+ if (a.current) {
1810
+ console.log("[MetaKYC] Theme load already in progress, skipping...");
1811
+ return;
1812
+ }
1813
+ a.current = !0;
1809
1814
  try {
1810
1815
  if (t.theme) {
1811
- console.log("[MetaKYC] Applying static theme from config"), a.themeManager.applyTheme(t.theme), s(a.themeManager.getCurrentTheme());
1816
+ console.log("[MetaKYC] Applying static theme from config"), i.themeManager.applyTheme(t.theme), s(i.themeManager.getCurrentTheme());
1812
1817
  return;
1813
1818
  }
1814
1819
  console.log("[MetaKYC] Fetching theme from backend...");
1815
- const c = await a.themeService.getThemeConfiguration();
1816
- a.themeManager.applyTheme(c), s(a.themeManager.getCurrentTheme()), console.log("[MetaKYC] Theme loaded and applied", c);
1817
- } catch (c) {
1818
- console.warn("[MetaKYC] Failed to load theme, using default:", c), s(a.themeManager.getCurrentTheme());
1820
+ const l = await i.themeService.getThemeConfiguration();
1821
+ i.themeManager.applyTheme(l), s(i.themeManager.getCurrentTheme()), console.log("[MetaKYC] Theme loaded and applied", l);
1822
+ } catch (l) {
1823
+ console.warn("[MetaKYC] Failed to load theme, using default:", l), s(i.themeManager.getCurrentTheme());
1824
+ } finally {
1825
+ a.current = !1;
1819
1826
  }
1820
1827
  })(), () => {
1821
- a.themeManager.cleanup();
1822
- }), [t.theme, a.themeService, a.themeManager]), /* @__PURE__ */ n(Ue.Provider, { value: a, children: e });
1828
+ i.themeManager.cleanup();
1829
+ }), [t.theme, i.themeService, i.themeManager]), /* @__PURE__ */ n(Ue.Provider, { value: i, children: e });
1823
1830
  };
1824
- function re() {
1831
+ function se() {
1825
1832
  const t = rt(Ue);
1826
1833
  if (!t)
1827
1834
  throw new Error("useMetaKYC must be used within a MetaKYCProvider");
@@ -1848,7 +1855,7 @@ function $r(t, e) {
1848
1855
  return t.type === s;
1849
1856
  });
1850
1857
  }
1851
- function Ae(t) {
1858
+ function Ie(t) {
1852
1859
  if (t === 0) return "0 Bytes";
1853
1860
  const e = 1024, r = ["Bytes", "KB", "MB", "GB"], s = Math.floor(Math.log(t) / Math.log(e));
1854
1861
  return Math.round(t / Math.pow(e, s) * 100) / 100 + " " + r[s];
@@ -1856,23 +1863,23 @@ function Ae(t) {
1856
1863
  function jr(t) {
1857
1864
  return t;
1858
1865
  }
1859
- function X(...t) {
1866
+ function te(...t) {
1860
1867
  return t.filter(Boolean).join(" ");
1861
1868
  }
1862
- const fe = {
1869
+ const be = {
1863
1870
  APPLICANT_ID: "metakyc_applicant_id",
1864
1871
  WORKFLOW_STATE: "metakyc_workflow_state"
1865
1872
  };
1866
1873
  function Ht(t) {
1867
1874
  try {
1868
- localStorage.setItem(fe.APPLICANT_ID, t.toString());
1875
+ localStorage.setItem(be.APPLICANT_ID, t.toString());
1869
1876
  } catch (e) {
1870
1877
  console.warn("Failed to save applicant ID to storage:", e);
1871
1878
  }
1872
1879
  }
1873
1880
  function Vt() {
1874
1881
  try {
1875
- const t = localStorage.getItem(fe.APPLICANT_ID);
1882
+ const t = localStorage.getItem(be.APPLICANT_ID);
1876
1883
  return t ? parseInt(t, 10) : null;
1877
1884
  } catch (t) {
1878
1885
  return console.warn("Failed to retrieve applicant ID from storage:", t), null;
@@ -1880,21 +1887,21 @@ function Vt() {
1880
1887
  }
1881
1888
  function Yt() {
1882
1889
  try {
1883
- localStorage.removeItem(fe.APPLICANT_ID);
1890
+ localStorage.removeItem(be.APPLICANT_ID);
1884
1891
  } catch (t) {
1885
1892
  console.warn("Failed to clear applicant ID from storage:", t);
1886
1893
  }
1887
1894
  }
1888
1895
  function Wt(t) {
1889
1896
  try {
1890
- localStorage.setItem(fe.WORKFLOW_STATE, JSON.stringify(t));
1897
+ localStorage.setItem(be.WORKFLOW_STATE, JSON.stringify(t));
1891
1898
  } catch (e) {
1892
1899
  console.warn("Failed to save workflow state to storage:", e);
1893
1900
  }
1894
1901
  }
1895
1902
  function _r() {
1896
1903
  try {
1897
- const t = localStorage.getItem(fe.WORKFLOW_STATE);
1904
+ const t = localStorage.getItem(be.WORKFLOW_STATE);
1898
1905
  return t ? JSON.parse(t) : null;
1899
1906
  } catch (t) {
1900
1907
  return console.warn("Failed to retrieve workflow state from storage:", t), null;
@@ -1902,7 +1909,7 @@ function _r() {
1902
1909
  }
1903
1910
  function Qt() {
1904
1911
  try {
1905
- localStorage.removeItem(fe.WORKFLOW_STATE);
1912
+ localStorage.removeItem(be.WORKFLOW_STATE);
1906
1913
  } catch (t) {
1907
1914
  console.warn("Failed to clear workflow state from storage:", t);
1908
1915
  }
@@ -1911,131 +1918,143 @@ function Kr() {
1911
1918
  Yt(), Qt();
1912
1919
  }
1913
1920
  function Gt(t) {
1914
- const { createOrchestrator: e } = re(), [r, s] = x(null), [a, i] = x(!1), [c, l] = x(null), d = je(null), u = t || Vt();
1915
- V(() => {
1921
+ const { createOrchestrator: e } = se(), [r, s] = N(null), [a, i] = N(!1), [c, l] = N(null), d = H(null), u = t || Vt();
1922
+ Y(() => {
1916
1923
  d.current || (d.current = e());
1917
- }, [e]), V(() => {
1918
- var h;
1924
+ }, [e]), Y(() => {
1925
+ var v;
1919
1926
  r && u && (Ht(u), Wt({
1920
1927
  applicantId: u,
1921
- currentStepOrder: (h = r.currentStep) == null ? void 0 : h.order,
1928
+ currentStepOrder: (v = r.currentStep) == null ? void 0 : v.order,
1922
1929
  status: r.status,
1923
1930
  lastUpdated: (/* @__PURE__ */ new Date()).toISOString(),
1924
1931
  workflowKey: r.workFlowKey,
1925
1932
  nextWorkflowKey: r.nextWorkflowKey
1926
1933
  }));
1927
1934
  }, [r, u]);
1928
- const g = q(async () => {
1935
+ const y = H(!1), x = H(!1), g = q(async () => {
1929
1936
  if (!(!u || !d.current)) {
1930
- i(!0), l(null);
1937
+ if (y.current) {
1938
+ console.log("[Workflow] Load already in progress, skipping...");
1939
+ return;
1940
+ }
1941
+ y.current = !0, i(!0), l(null);
1931
1942
  try {
1932
- const h = await d.current.initialize(u);
1933
- s(h);
1934
- } catch (h) {
1935
- l(h);
1943
+ const v = await d.current.initialize(u);
1944
+ s(v), x.current = !0;
1945
+ } catch (v) {
1946
+ l(v);
1936
1947
  } finally {
1937
- i(!1);
1948
+ i(!1), y.current = !1;
1938
1949
  }
1939
1950
  }
1940
1951
  }, [u]);
1941
- V(() => {
1942
- u && g();
1952
+ Y(() => {
1953
+ u && !x.current && g();
1943
1954
  }, [u, g]);
1944
- const p = q(async () => {
1955
+ const b = q(async () => {
1945
1956
  if (d.current) {
1946
- i(!0), l(null);
1957
+ if (y.current) {
1958
+ console.log("[Workflow] Refresh already in progress, skipping...");
1959
+ return;
1960
+ }
1961
+ y.current = !0, i(!0), l(null);
1947
1962
  try {
1948
- const h = await d.current.refreshProgress();
1949
- s(h);
1950
- } catch (h) {
1951
- l(h);
1963
+ const v = await d.current.refreshProgress();
1964
+ s(v);
1965
+ } catch (v) {
1966
+ l(v);
1952
1967
  } finally {
1953
- i(!1);
1968
+ i(!1), y.current = !1;
1954
1969
  }
1955
1970
  }
1956
1971
  }, []), m = q(async () => {
1957
1972
  if (d.current) {
1958
1973
  i(!0), l(null);
1959
1974
  try {
1960
- const h = await d.current.moveToNextStep();
1961
- s(h);
1962
- } catch (h) {
1963
- l(h);
1975
+ const v = await d.current.moveToNextStep();
1976
+ s(v);
1977
+ } catch (v) {
1978
+ l(v);
1964
1979
  } finally {
1965
1980
  i(!1);
1966
1981
  }
1967
1982
  }
1968
- }, []), b = q(async () => {
1983
+ }, []), f = q(async () => {
1969
1984
  if (d.current) {
1970
1985
  i(!0), l(null);
1971
1986
  try {
1972
- const h = await d.current.moveToPreviousStep();
1973
- s(h);
1974
- } catch (h) {
1975
- l(h);
1987
+ const v = await d.current.moveToPreviousStep();
1988
+ s(v);
1989
+ } catch (v) {
1990
+ l(v);
1976
1991
  } finally {
1977
1992
  i(!1);
1978
1993
  }
1979
1994
  }
1980
- }, []), y = q(async (h) => {
1995
+ }, []), k = q(async (v) => {
1981
1996
  if (d.current) {
1982
1997
  i(!0), l(null);
1983
1998
  try {
1984
- await d.current.submitCurrentStep(h);
1985
- const N = await d.current.refreshProgress();
1986
- s(N);
1987
- } catch (N) {
1988
- throw l(N), N;
1999
+ await d.current.submitCurrentStep(v);
2000
+ const S = await d.current.refreshProgress();
2001
+ s(S);
2002
+ } catch (S) {
2003
+ throw l(S), S;
1989
2004
  } finally {
1990
2005
  i(!1);
1991
2006
  }
1992
2007
  }
1993
- }, []), f = Le.useMemo(() => r != null && r.stepInfoList ? [...r.stepInfoList].sort((h, N) => h.order - N.order) : [], [r == null ? void 0 : r.stepInfoList]), P = Le.useMemo(() => r ? r.nextWorkflowKey && r.nextWorkflowKey !== r.workFlowKey : !1, [r]);
2008
+ }, []), h = Te.useMemo(() => r != null && r.stepInfoList ? [...r.stepInfoList].sort((v, S) => v.order - S.order) : [], [r == null ? void 0 : r.stepInfoList]), E = Te.useMemo(() => r ? r.nextWorkflowKey && r.nextWorkflowKey !== r.workFlowKey : !1, [r]);
1994
2009
  return {
1995
2010
  progress: r,
1996
2011
  applicantId: u,
1997
2012
  currentStep: (r == null ? void 0 : r.currentStep) || null,
1998
- steps: f,
1999
- status: (r == null ? void 0 : r.status) || ae.None,
2013
+ steps: h,
2014
+ status: (r == null ? void 0 : r.status) || oe.None,
2000
2015
  workflowResult: (r == null ? void 0 : r.workflowResult) || null,
2001
2016
  workflowKey: r == null ? void 0 : r.workFlowKey,
2002
2017
  nextWorkflowKey: r == null ? void 0 : r.nextWorkflowKey,
2003
- hasWorkflowChanged: P,
2018
+ hasWorkflowChanged: E,
2004
2019
  isLoading: a,
2005
2020
  error: c,
2006
- isComplete: (r == null ? void 0 : r.status) === ae.Finished,
2007
- isOnHold: (r == null ? void 0 : r.status) === ae.OnHold,
2008
- refreshProgress: p,
2021
+ isComplete: (r == null ? void 0 : r.status) === oe.Finished,
2022
+ isOnHold: (r == null ? void 0 : r.status) === oe.OnHold,
2023
+ refreshProgress: b,
2009
2024
  moveToNext: m,
2010
- moveBack: b,
2011
- submitCurrentStep: y,
2025
+ moveBack: f,
2026
+ submitCurrentStep: k,
2012
2027
  orchestrator: d.current
2013
2028
  };
2014
2029
  }
2015
2030
  function Zt(t) {
2016
- const { questionnaireService: e } = re(), [r, s] = x(null), [a, i] = x(!1), [c, l] = x(!1), [d, u] = x(null), g = q(async () => {
2031
+ const { questionnaireService: e } = se(), [r, s] = N(null), [a, i] = N(!1), [c, l] = N(!1), [d, u] = N(null), y = H(!1), x = H(null), g = q(async () => {
2017
2032
  if (t) {
2018
- i(!0), u(null);
2033
+ if (y.current) {
2034
+ console.log("[Questionnaire] Load already in progress, skipping...");
2035
+ return;
2036
+ }
2037
+ y.current = !0, i(!0), u(null);
2019
2038
  try {
2020
2039
  const m = await e.getQuestionnaire(t);
2021
- s(m);
2040
+ s(m), x.current = t;
2022
2041
  } catch (m) {
2023
2042
  u(m);
2024
2043
  } finally {
2025
- i(!1);
2044
+ i(!1), y.current = !1;
2026
2045
  }
2027
2046
  }
2028
2047
  }, [t, e]);
2029
- V(() => {
2030
- t && g();
2031
- }, [t, g]);
2032
- const p = q(
2048
+ Y(() => {
2049
+ t && x.current !== t && g();
2050
+ }, [t]);
2051
+ const b = q(
2033
2052
  async (m) => {
2034
2053
  l(!0), u(null);
2035
2054
  try {
2036
2055
  return await e.fillQuestionnaire(m);
2037
- } catch (b) {
2038
- throw u(b), b;
2056
+ } catch (f) {
2057
+ throw u(f), f;
2039
2058
  } finally {
2040
2059
  l(!1);
2041
2060
  }
@@ -2048,33 +2067,37 @@ function Zt(t) {
2048
2067
  isSubmitting: c,
2049
2068
  error: d,
2050
2069
  load: g,
2051
- submit: p
2070
+ submit: b
2052
2071
  };
2053
2072
  }
2054
2073
  function Jt(t) {
2055
- const { uploadDocumentService: e } = re(), [r, s] = x(null), [a, i] = x(!1), [c, l] = x(!1), [d, u] = x(0), [g, p] = x(null), m = q(async () => {
2074
+ const { uploadDocumentService: e } = se(), [r, s] = N(null), [a, i] = N(!1), [c, l] = N(!1), [d, u] = N(0), [y, x] = N(null), g = H(!1), b = H(null), m = q(async () => {
2056
2075
  if (t) {
2057
- i(!0), p(null);
2076
+ if (g.current) {
2077
+ console.log("[UploadDocument] Load already in progress, skipping...");
2078
+ return;
2079
+ }
2080
+ g.current = !0, i(!0), x(null);
2058
2081
  try {
2059
- const y = await e.getUploadDocument(t);
2060
- s(y);
2061
- } catch (y) {
2062
- p(y);
2082
+ const k = await e.getUploadDocument(t);
2083
+ s(k), b.current = t;
2084
+ } catch (k) {
2085
+ x(k);
2063
2086
  } finally {
2064
- i(!1);
2087
+ i(!1), g.current = !1;
2065
2088
  }
2066
2089
  }
2067
2090
  }, [t, e]);
2068
- V(() => {
2069
- t && m();
2070
- }, [t, m]);
2071
- const b = q(
2072
- async (y) => {
2073
- l(!0), u(0), p(null);
2091
+ Y(() => {
2092
+ t && b.current !== t && m();
2093
+ }, [t]);
2094
+ const f = q(
2095
+ async (k) => {
2096
+ l(!0), u(0), x(null);
2074
2097
  try {
2075
- await e.fillUploadDocument(y), u(100);
2076
- } catch (f) {
2077
- throw p(f), f;
2098
+ await e.fillUploadDocument(k), u(100);
2099
+ } catch (h) {
2100
+ throw x(h), h;
2078
2101
  } finally {
2079
2102
  l(!1);
2080
2103
  }
@@ -2086,36 +2109,40 @@ function Jt(t) {
2086
2109
  isLoading: a,
2087
2110
  isSubmitting: c,
2088
2111
  uploadProgress: d,
2089
- error: g,
2112
+ error: y,
2090
2113
  load: m,
2091
- submit: b
2114
+ submit: f
2092
2115
  };
2093
2116
  }
2094
2117
  function Ur(t) {
2095
- const { appropriatenessTestService: e } = re(), [r, s] = x(null), [a, i] = x(!1), [c, l] = x(!1), [d, u] = x(null), [g, p] = x(null), m = q(async () => {
2118
+ const { appropriatenessTestService: e } = se(), [r, s] = N(null), [a, i] = N(!1), [c, l] = N(!1), [d, u] = N(null), [y, x] = N(null), g = H(!1), b = H(null), m = q(async () => {
2096
2119
  if (t) {
2097
- i(!0), u(null);
2120
+ if (g.current) {
2121
+ console.log("[AppropriatenessTest] Load already in progress, skipping...");
2122
+ return;
2123
+ }
2124
+ g.current = !0, i(!0), u(null);
2098
2125
  try {
2099
- const y = await e.getAppropriatenessTest(t);
2100
- s(y);
2101
- } catch (y) {
2102
- u(y);
2126
+ const k = await e.getAppropriatenessTest(t);
2127
+ s(k), b.current = t;
2128
+ } catch (k) {
2129
+ u(k);
2103
2130
  } finally {
2104
- i(!1);
2131
+ i(!1), g.current = !1;
2105
2132
  }
2106
2133
  }
2107
2134
  }, [t, e]);
2108
- V(() => {
2109
- t && m();
2110
- }, [t, m]);
2111
- const b = q(
2112
- async (y) => {
2135
+ Y(() => {
2136
+ t && b.current !== t && m();
2137
+ }, [t]);
2138
+ const f = q(
2139
+ async (k) => {
2113
2140
  l(!0), u(null);
2114
2141
  try {
2115
- const f = await e.fillAppropriatenessTest(y);
2116
- return p(f), f;
2117
- } catch (f) {
2118
- throw u(f), f;
2142
+ const h = await e.fillAppropriatenessTest(k);
2143
+ return x(h), h;
2144
+ } catch (h) {
2145
+ throw u(h), h;
2119
2146
  } finally {
2120
2147
  l(!1);
2121
2148
  }
@@ -2124,32 +2151,36 @@ function Ur(t) {
2124
2151
  );
2125
2152
  return {
2126
2153
  test: r,
2127
- result: g,
2154
+ result: y,
2128
2155
  isLoading: a,
2129
2156
  isSubmitting: c,
2130
2157
  error: d,
2131
2158
  load: m,
2132
- submit: b
2159
+ submit: f
2133
2160
  };
2134
2161
  }
2135
2162
  function Xt(t) {
2136
- const { overviewService: e } = re(), [r, s] = x(null), [a, i] = x(!1), [c, l] = x(!1), [d, u] = x(null), g = q(async () => {
2163
+ const { overviewService: e } = se(), [r, s] = N(null), [a, i] = N(!1), [c, l] = N(!1), [d, u] = N(null), y = H(!1), x = H(null), g = q(async () => {
2137
2164
  if (t) {
2138
- i(!0), u(null);
2165
+ if (y.current) {
2166
+ console.log("[Overview] Load already in progress, skipping...");
2167
+ return;
2168
+ }
2169
+ y.current = !0, i(!0), u(null);
2139
2170
  try {
2140
2171
  const m = await e.getOverviewData(t);
2141
- s(m);
2172
+ s(m), x.current = t;
2142
2173
  } catch (m) {
2143
2174
  u(m);
2144
2175
  } finally {
2145
- i(!1);
2176
+ i(!1), y.current = !1;
2146
2177
  }
2147
2178
  }
2148
2179
  }, [t, e]);
2149
- V(() => {
2150
- t && g();
2151
- }, [t, g]);
2152
- const p = q(async () => {
2180
+ Y(() => {
2181
+ t && x.current !== t && g();
2182
+ }, [t]);
2183
+ const b = q(async () => {
2153
2184
  if (t) {
2154
2185
  l(!0), u(null);
2155
2186
  try {
@@ -2167,73 +2198,81 @@ function Xt(t) {
2167
2198
  isSubmitting: c,
2168
2199
  error: d,
2169
2200
  load: g,
2170
- passOverview: p
2201
+ passOverview: b
2171
2202
  };
2172
2203
  }
2173
2204
  function er(t) {
2174
- const { identityService: e } = re(), [r, s] = x(
2205
+ const { identityService: e } = se(), [r, s] = N(
2175
2206
  null
2176
- ), [a, i] = x(!1), [c, l] = x(null), d = q(
2177
- async (p, m) => {
2207
+ ), [a, i] = N(!1), [c, l] = N(null), d = H(!1), u = q(
2208
+ async (g, b) => {
2178
2209
  if (t) {
2179
- i(!0), l(null);
2210
+ if (d.current) {
2211
+ console.log("[Identity] Request already in progress, skipping...");
2212
+ return;
2213
+ }
2214
+ d.current = !0, i(!0), l(null);
2180
2215
  try {
2181
- const b = {
2216
+ const m = {
2182
2217
  applicantId: t,
2183
2218
  restart: !1,
2184
- redirectUrl: p || "",
2185
- ttl: m || 604800
2219
+ redirectUrl: g || "",
2220
+ ttl: b || 604800
2186
2221
  // Default: 7 days
2187
2222
  };
2188
- console.log("Identity request input:", b);
2189
- const y = await e.identityRequest(b);
2190
- return console.log("Identity request result:", y), s(y), y;
2191
- } catch (b) {
2192
- throw l(b), b;
2223
+ console.log("Identity request input:", m);
2224
+ const f = await e.identityRequest(m);
2225
+ return console.log("Identity request result:", f), s(f), f;
2226
+ } catch (m) {
2227
+ throw l(m), m;
2193
2228
  } finally {
2194
- i(!1);
2229
+ i(!1), d.current = !1;
2195
2230
  }
2196
2231
  }
2197
2232
  },
2198
2233
  [t, e]
2199
- ), u = q(
2200
- async (p, m) => {
2234
+ ), y = q(
2235
+ async (g, b) => {
2201
2236
  if (t) {
2202
2237
  i(!0), l(null);
2203
2238
  try {
2204
- const b = {
2239
+ const m = {
2205
2240
  applicantId: t,
2206
2241
  restart: !1,
2207
- redirectUrl: p,
2208
- ttl: m
2209
- }, y = await e.identityCompanyRequest(b);
2210
- return s(y), y;
2211
- } catch (b) {
2212
- throw l(b), b;
2242
+ redirectUrl: g,
2243
+ ttl: b
2244
+ }, f = await e.identityCompanyRequest(m);
2245
+ return s(f), f;
2246
+ } catch (m) {
2247
+ throw l(m), m;
2213
2248
  } finally {
2214
2249
  i(!1);
2215
2250
  }
2216
2251
  }
2217
2252
  },
2218
2253
  [t, e]
2219
- ), g = q(async () => {
2254
+ ), x = q(async () => {
2220
2255
  if (t) {
2221
- i(!0), l(null);
2256
+ if (d.current) {
2257
+ console.log("[Identity] Restart already in progress, skipping...");
2258
+ return;
2259
+ }
2260
+ d.current = !0, i(!0), l(null);
2222
2261
  try {
2223
- const p = {
2262
+ const g = {
2224
2263
  applicantId: t,
2225
2264
  restart: !0,
2226
2265
  redirectUrl: "",
2227
2266
  ttl: 604800
2228
2267
  // 7 days
2229
2268
  };
2230
- console.log("Restarting identity with input:", p);
2231
- const m = await e.identityRequest(p);
2232
- return console.log("Restart identity result:", m), s(m), m;
2233
- } catch (p) {
2234
- throw l(p), p;
2269
+ console.log("Restarting identity with input:", g);
2270
+ const b = await e.identityRequest(g);
2271
+ return console.log("Restart identity result:", b), s(b), b;
2272
+ } catch (g) {
2273
+ throw l(g), g;
2235
2274
  } finally {
2236
- i(!1);
2275
+ i(!1), d.current = !1;
2237
2276
  }
2238
2277
  }
2239
2278
  }, [t, e]);
@@ -2243,36 +2282,40 @@ function er(t) {
2243
2282
  token: (r == null ? void 0 : r.publicProviderTokenObject) || null,
2244
2283
  isLoading: a,
2245
2284
  error: c,
2246
- requestIdentity: d,
2247
- requestCompanyIdentity: u,
2248
- restartIdentity: g
2285
+ requestIdentity: u,
2286
+ requestCompanyIdentity: y,
2287
+ restartIdentity: x
2249
2288
  };
2250
2289
  }
2251
2290
  function tr(t) {
2252
- const { riskScoringService: e } = re(), [r, s] = x(null), [a, i] = x(!1), [c, l] = x(!1), [d, u] = x(null), [g, p] = x(null), m = q(async () => {
2291
+ const { riskScoringService: e } = se(), [r, s] = N(null), [a, i] = N(!1), [c, l] = N(!1), [d, u] = N(null), [y, x] = N(null), g = H(!1), b = H(null), m = q(async () => {
2253
2292
  if (t) {
2254
- i(!0), u(null);
2293
+ if (g.current) {
2294
+ console.log("[RiskScoring] Load already in progress, skipping...");
2295
+ return;
2296
+ }
2297
+ g.current = !0, i(!0), u(null);
2255
2298
  try {
2256
- const y = await e.getRiskCriterias(t);
2257
- s(y);
2258
- } catch (y) {
2259
- u(y);
2299
+ const k = await e.getRiskCriterias(t);
2300
+ s(k), b.current = t;
2301
+ } catch (k) {
2302
+ u(k);
2260
2303
  } finally {
2261
- i(!1);
2304
+ i(!1), g.current = !1;
2262
2305
  }
2263
2306
  }
2264
2307
  }, [t, e]);
2265
- V(() => {
2266
- t && m();
2267
- }, [t, m]);
2268
- const b = q(
2269
- async (y) => {
2308
+ Y(() => {
2309
+ t && b.current !== t && m();
2310
+ }, [t]);
2311
+ const f = q(
2312
+ async (k) => {
2270
2313
  l(!0), u(null);
2271
2314
  try {
2272
- const f = await e.submitRiskScoring(y);
2273
- return p(f), f;
2274
- } catch (f) {
2275
- throw u(f), f;
2315
+ const h = await e.submitRiskScoring(k);
2316
+ return x(h), h;
2317
+ } catch (h) {
2318
+ throw u(h), h;
2276
2319
  } finally {
2277
2320
  l(!1);
2278
2321
  }
@@ -2281,43 +2324,45 @@ function tr(t) {
2281
2324
  );
2282
2325
  return {
2283
2326
  criteria: r,
2284
- result: g,
2327
+ result: y,
2285
2328
  isLoading: a,
2286
2329
  isSubmitting: c,
2287
2330
  error: d,
2288
2331
  load: m,
2289
- submit: b
2332
+ submit: f
2290
2333
  };
2291
2334
  }
2292
2335
  function rr() {
2293
- const { applicantService: t, config: e } = re(), [r, s] = x(!1), [a, i] = x(null), c = () => "xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g, function(p) {
2336
+ const { applicantService: t, config: e } = se(), [r, s] = N(!1), [a, i] = N(null), c = H(!1), l = H(!1), d = () => "xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g, function(b) {
2294
2337
  const m = Math.random() * 16 | 0;
2295
- return (p === "x" ? m : m & 3 | 8).toString(16);
2296
- }), l = q(
2297
- async (p) => {
2338
+ return (b === "x" ? m : m & 3 | 8).toString(16);
2339
+ }), u = q(
2340
+ async (b) => {
2298
2341
  var m;
2299
- s(!0), i(null);
2342
+ if (c.current)
2343
+ throw console.log("[Applicant] Create already in progress, skipping..."), new Error("Creation already in progress");
2344
+ c.current = !0, s(!0), i(null);
2300
2345
  try {
2301
- if (p.applicantAdditionalDatas || (p.applicantAdditionalDatas = []), (m = e.identityProviders) != null && m.sardinai) {
2302
- const y = c();
2303
- console.log("[SardinAI] Generated session key:", y), p.applicantAdditionalDatas.push({
2346
+ if (b.applicantAdditionalDatas || (b.applicantAdditionalDatas = []), (m = e.identityProviders) != null && m.sardinai) {
2347
+ const k = d();
2348
+ console.log("[SardinAI] Generated session key:", k), b.applicantAdditionalDatas.push({
2304
2349
  paramName: "sessionKey",
2305
- value: y
2350
+ value: k
2306
2351
  });
2307
2352
  }
2308
- return await t.createApplicant(p);
2309
- } catch (b) {
2310
- throw i(b), b;
2353
+ return await t.createApplicant(b);
2354
+ } catch (f) {
2355
+ throw i(f), f;
2311
2356
  } finally {
2312
- s(!1);
2357
+ s(!1), c.current = !1;
2313
2358
  }
2314
2359
  },
2315
2360
  [t, e]
2316
- ), d = q(
2317
- async (p) => {
2361
+ ), y = q(
2362
+ async (b) => {
2318
2363
  s(!0), i(null);
2319
2364
  try {
2320
- return await t.createCompanyApplicant(p);
2365
+ return await t.createCompanyApplicant(b);
2321
2366
  } catch (m) {
2322
2367
  throw i(m), m;
2323
2368
  } finally {
@@ -2325,23 +2370,25 @@ function rr() {
2325
2370
  }
2326
2371
  },
2327
2372
  [t]
2328
- ), u = q(
2329
- async (p) => {
2330
- s(!0), i(null);
2373
+ ), x = q(
2374
+ async (b) => {
2375
+ if (l.current)
2376
+ throw console.log("[Applicant] Data load already in progress, skipping..."), new Error("Data load already in progress");
2377
+ l.current = !0, s(!0), i(null);
2331
2378
  try {
2332
- return await t.getApplicantData(p);
2379
+ return await t.getApplicantData(b);
2333
2380
  } catch (m) {
2334
2381
  throw i(m), m;
2335
2382
  } finally {
2336
- s(!1);
2383
+ s(!1), l.current = !1;
2337
2384
  }
2338
2385
  },
2339
2386
  [t]
2340
2387
  ), g = q(
2341
- async (p) => {
2388
+ async (b) => {
2342
2389
  s(!0), i(null);
2343
2390
  try {
2344
- await t.stopProgress(p);
2391
+ await t.stopProgress(b);
2345
2392
  } catch (m) {
2346
2393
  throw i(m), m;
2347
2394
  } finally {
@@ -2353,9 +2400,9 @@ function rr() {
2353
2400
  return {
2354
2401
  isLoading: r,
2355
2402
  error: a,
2356
- createApplicant: l,
2357
- createCompanyApplicant: d,
2358
- getApplicantData: u,
2403
+ createApplicant: u,
2404
+ createCompanyApplicant: y,
2405
+ getApplicantData: x,
2359
2406
  stopProgress: g
2360
2407
  };
2361
2408
  }
@@ -2382,7 +2429,7 @@ const j = ({
2382
2429
  return /* @__PURE__ */ o(
2383
2430
  "button",
2384
2431
  {
2385
- className: X(l, d[e], u[r], i),
2432
+ className: te(l, d[e], u[r], i),
2386
2433
  disabled: a || s,
2387
2434
  ...c,
2388
2435
  children: [
@@ -2420,7 +2467,7 @@ const j = ({
2420
2467
  ]
2421
2468
  }
2422
2469
  );
2423
- }, Z = De(
2470
+ }, X = Fe(
2424
2471
  ({ label: t, error: e, helperText: r, leftIcon: s, rightIcon: a, className: i, ...c }, l) => /* @__PURE__ */ o("div", { className: "w-full", children: [
2425
2472
  t && /* @__PURE__ */ o("label", { className: "block text-sm font-medium text-gray-700 dark:text-gray-300 mb-1", children: [
2426
2473
  t,
@@ -2432,7 +2479,7 @@ const j = ({
2432
2479
  "input",
2433
2480
  {
2434
2481
  ref: l,
2435
- className: X(
2482
+ className: te(
2436
2483
  "block w-full rounded-lg border px-3 py-2 text-sm transition-colors",
2437
2484
  "focus:outline-none focus:ring-2 focus:ring-primary-500 focus:border-transparent",
2438
2485
  "disabled:bg-gray-100 disabled:cursor-not-allowed",
@@ -2451,11 +2498,11 @@ const j = ({
2451
2498
  !e && r && /* @__PURE__ */ n("p", { className: "mt-1 text-sm text-gray-500", children: r })
2452
2499
  ] })
2453
2500
  );
2454
- Z.displayName = "Input";
2455
- const T = ({ children: t, className: e, ...r }) => /* @__PURE__ */ n(
2501
+ X.displayName = "Input";
2502
+ const L = ({ children: t, className: e, ...r }) => /* @__PURE__ */ n(
2456
2503
  "div",
2457
2504
  {
2458
- className: X(
2505
+ className: te(
2459
2506
  "rounded-xl shadow-sm border",
2460
2507
  e
2461
2508
  ),
@@ -2466,30 +2513,30 @@ const T = ({ children: t, className: e, ...r }) => /* @__PURE__ */ n(
2466
2513
  ...r,
2467
2514
  children: t
2468
2515
  }
2469
- ), J = ({ children: t, className: e, ...r }) => /* @__PURE__ */ n(
2516
+ ), ee = ({ children: t, className: e, ...r }) => /* @__PURE__ */ n(
2470
2517
  "div",
2471
2518
  {
2472
- className: X("px-6 py-4 border-b", e),
2519
+ className: te("px-6 py-4 border-b", e),
2473
2520
  style: {
2474
2521
  borderColor: "var(--metakyc-border, #e5e7eb)"
2475
2522
  },
2476
2523
  ...r,
2477
2524
  children: t
2478
2525
  }
2479
- ), M = ({ children: t, className: e, ...r }) => /* @__PURE__ */ n("div", { className: X("px-6 py-4", e), ...r, children: t }), te = ({ children: t, className: e, ...r }) => /* @__PURE__ */ n(
2526
+ ), T = ({ children: t, className: e, ...r }) => /* @__PURE__ */ n("div", { className: te("px-6 py-4", e), ...r, children: t }), ne = ({ children: t, className: e, ...r }) => /* @__PURE__ */ n(
2480
2527
  "div",
2481
2528
  {
2482
- className: X("px-6 py-4 border-t", e),
2529
+ className: te("px-6 py-4 border-t", e),
2483
2530
  style: {
2484
2531
  borderColor: "var(--metakyc-border, #e5e7eb)"
2485
2532
  },
2486
2533
  ...r,
2487
2534
  children: t
2488
2535
  }
2489
- ), me = ({ children: t, variant: e = "default", className: r, ...s }) => /* @__PURE__ */ n(
2536
+ ), he = ({ children: t, variant: e = "default", className: r, ...s }) => /* @__PURE__ */ n(
2490
2537
  "span",
2491
2538
  {
2492
- className: X(
2539
+ className: te(
2493
2540
  "inline-flex items-center px-2.5 py-0.5 rounded-full text-xs font-medium",
2494
2541
  {
2495
2542
  default: "bg-gray-100 text-gray-800 dark:bg-gray-700 dark:text-gray-300",
@@ -2503,16 +2550,16 @@ const T = ({ children: t, className: e, ...r }) => /* @__PURE__ */ n(
2503
2550
  ...s,
2504
2551
  children: t
2505
2552
  }
2506
- ), ie = ({ size: t = "md", className: e, ...r }) => {
2553
+ ), le = ({ size: t = "md", className: e, ...r }) => {
2507
2554
  const s = {
2508
2555
  sm: "h-4 w-4",
2509
2556
  md: "h-8 w-8",
2510
2557
  lg: "h-12 w-12"
2511
2558
  };
2512
- return /* @__PURE__ */ n("div", { className: X("flex items-center justify-center", e), ...r, children: /* @__PURE__ */ o(
2559
+ return /* @__PURE__ */ n("div", { className: te("flex items-center justify-center", e), ...r, children: /* @__PURE__ */ o(
2513
2560
  "svg",
2514
2561
  {
2515
- className: X("animate-spin text-primary-500", s[t]),
2562
+ className: te("animate-spin text-primary-500", s[t]),
2516
2563
  xmlns: "http://www.w3.org/2000/svg",
2517
2564
  fill: "none",
2518
2565
  viewBox: "0 0 24 24",
@@ -2539,7 +2586,7 @@ const T = ({ children: t, className: e, ...r }) => /* @__PURE__ */ n(
2539
2586
  ]
2540
2587
  }
2541
2588
  ) });
2542
- }, ge = De(
2589
+ }, ye = Fe(
2543
2590
  ({ label: t, error: e, helperText: r, options: s, placeholder: a, className: i, ...c }, l) => /* @__PURE__ */ o("div", { className: "w-full", children: [
2544
2591
  t && /* @__PURE__ */ o("label", { className: "block text-sm font-medium text-gray-700 dark:text-gray-300 mb-1", children: [
2545
2592
  t,
@@ -2549,7 +2596,7 @@ const T = ({ children: t, className: e, ...r }) => /* @__PURE__ */ n(
2549
2596
  "select",
2550
2597
  {
2551
2598
  ref: l,
2552
- className: X(
2599
+ className: te(
2553
2600
  "block w-full rounded-lg border px-3 py-2 text-sm transition-colors",
2554
2601
  "focus:outline-none focus:ring-2 focus:ring-primary-500 focus:border-transparent",
2555
2602
  "disabled:bg-gray-100 disabled:cursor-not-allowed",
@@ -2576,7 +2623,7 @@ const T = ({ children: t, className: e, ...r }) => /* @__PURE__ */ n(
2576
2623
  !e && r && /* @__PURE__ */ n("p", { className: "mt-1 text-sm text-gray-500", children: r })
2577
2624
  ] })
2578
2625
  );
2579
- ge.displayName = "Select";
2626
+ ye.displayName = "Select";
2580
2627
  const nr = ({
2581
2628
  label: t,
2582
2629
  error: e,
@@ -2587,52 +2634,52 @@ const nr = ({
2587
2634
  value: c = [],
2588
2635
  className: l
2589
2636
  }) => {
2590
- const [d, u] = x(!1), g = je(null), p = (h) => {
2637
+ const [d, u] = N(!1), y = H(null), x = (h) => {
2591
2638
  if (!h) return;
2592
- const N = Array.from(h);
2593
- if (a && N.filter((I) => I.size > a).length > 0) {
2594
- const I = Ae(a);
2595
- alert(`Some files exceed the maximum size of ${I}`);
2639
+ const E = Array.from(h);
2640
+ if (a && E.filter((S) => S.size > a).length > 0) {
2641
+ const S = Ie(a);
2642
+ alert(`Some files exceed the maximum size of ${S}`);
2596
2643
  return;
2597
2644
  }
2598
- i == null || i(s ? [...c, ...N] : [N[0]]);
2599
- }, m = (h) => {
2645
+ i == null || i(s ? [...c, ...E] : [E[0]]);
2646
+ }, g = (h) => {
2600
2647
  h.preventDefault(), u(!0);
2601
2648
  }, b = () => {
2602
2649
  u(!1);
2603
- }, y = (h) => {
2604
- h.preventDefault(), u(!1), p(h.dataTransfer.files);
2650
+ }, m = (h) => {
2651
+ h.preventDefault(), u(!1), x(h.dataTransfer.files);
2605
2652
  }, f = () => {
2606
2653
  var h;
2607
- (h = g.current) == null || h.click();
2608
- }, P = (h) => {
2609
- const N = c.filter((w, I) => I !== h);
2610
- i == null || i(N);
2654
+ (h = y.current) == null || h.click();
2655
+ }, k = (h) => {
2656
+ const E = c.filter((v, S) => S !== h);
2657
+ i == null || i(E);
2611
2658
  };
2612
- return /* @__PURE__ */ o("div", { className: X("w-full", l), children: [
2659
+ return /* @__PURE__ */ o("div", { className: te("w-full", l), children: [
2613
2660
  t && /* @__PURE__ */ n("label", { className: "block text-sm font-medium text-gray-700 dark:text-gray-300 mb-1", children: t }),
2614
2661
  /* @__PURE__ */ o(
2615
2662
  "div",
2616
2663
  {
2617
- className: X(
2664
+ className: te(
2618
2665
  "border-2 border-dashed rounded-lg p-6 text-center cursor-pointer transition-colors",
2619
2666
  d ? "border-primary-500 bg-primary-50 dark:bg-primary-900/20" : "border-gray-300 dark:border-gray-600 hover:border-primary-500",
2620
2667
  e && "border-danger-500"
2621
2668
  ),
2622
- onDragOver: m,
2669
+ onDragOver: g,
2623
2670
  onDragLeave: b,
2624
- onDrop: y,
2671
+ onDrop: m,
2625
2672
  onClick: f,
2626
2673
  children: [
2627
2674
  /* @__PURE__ */ n(
2628
2675
  "input",
2629
2676
  {
2630
- ref: g,
2677
+ ref: y,
2631
2678
  type: "file",
2632
2679
  className: "hidden",
2633
2680
  accept: r,
2634
2681
  multiple: s,
2635
- onChange: (h) => p(h.target.files)
2682
+ onChange: (h) => x(h.target.files)
2636
2683
  }
2637
2684
  ),
2638
2685
  /* @__PURE__ */ o("div", { className: "space-y-2", children: [
@@ -2660,13 +2707,13 @@ const nr = ({
2660
2707
  ] }),
2661
2708
  a && /* @__PURE__ */ o("p", { className: "text-xs text-gray-500", children: [
2662
2709
  "Maximum file size: ",
2663
- Ae(a)
2710
+ Ie(a)
2664
2711
  ] })
2665
2712
  ] })
2666
2713
  ]
2667
2714
  }
2668
2715
  ),
2669
- c.length > 0 && /* @__PURE__ */ n("div", { className: "mt-3 space-y-2", children: c.map((h, N) => /* @__PURE__ */ o(
2716
+ c.length > 0 && /* @__PURE__ */ n("div", { className: "mt-3 space-y-2", children: c.map((h, E) => /* @__PURE__ */ o(
2670
2717
  "div",
2671
2718
  {
2672
2719
  className: "flex items-center justify-between px-3 py-2 bg-gray-50 dark:bg-gray-700 rounded-lg",
@@ -2691,7 +2738,7 @@ const nr = ({
2691
2738
  /* @__PURE__ */ n("span", { className: "text-sm text-gray-700 dark:text-gray-300 truncate", children: h.name }),
2692
2739
  /* @__PURE__ */ o("span", { className: "text-xs text-gray-500", children: [
2693
2740
  "(",
2694
- Ae(h.size),
2741
+ Ie(h.size),
2695
2742
  ")"
2696
2743
  ] })
2697
2744
  ] }),
@@ -2699,8 +2746,8 @@ const nr = ({
2699
2746
  "button",
2700
2747
  {
2701
2748
  type: "button",
2702
- onClick: (w) => {
2703
- w.stopPropagation(), P(N);
2749
+ onClick: (v) => {
2750
+ v.stopPropagation(), k(E);
2704
2751
  },
2705
2752
  className: "ml-2 text-danger-500 hover:text-danger-700 focus:outline-none",
2706
2753
  children: /* @__PURE__ */ n("svg", { className: "h-5 w-5", fill: "currentColor", viewBox: "0 0 20 20", children: /* @__PURE__ */ n(
@@ -2715,11 +2762,11 @@ const nr = ({
2715
2762
  )
2716
2763
  ]
2717
2764
  },
2718
- N
2765
+ E
2719
2766
  )) }),
2720
2767
  e && /* @__PURE__ */ n("p", { className: "mt-1 text-sm text-danger-500", children: e })
2721
2768
  ] });
2722
- }, sr = De(
2769
+ }, sr = Fe(
2723
2770
  ({ countryCode: t = "+1", onCountryCodeChange: e, className: r, ...s }, a) => /* @__PURE__ */ o("div", { className: "w-full", children: [
2724
2771
  s.label && /* @__PURE__ */ o("label", { className: "block text-sm font-medium text-gray-700 dark:text-gray-300 mb-1", children: [
2725
2772
  s.label,
@@ -2732,7 +2779,7 @@ const nr = ({
2732
2779
  type: "text",
2733
2780
  value: t,
2734
2781
  onChange: (i) => e == null ? void 0 : e(i.target.value),
2735
- className: X(
2782
+ className: te(
2736
2783
  "w-20 rounded-lg border px-3 py-2 text-sm",
2737
2784
  "focus:outline-none focus:ring-2 focus:ring-primary-500 focus:border-transparent",
2738
2785
  "border-gray-300 dark:border-gray-600 dark:bg-gray-800 dark:text-white"
@@ -2741,11 +2788,11 @@ const nr = ({
2741
2788
  }
2742
2789
  ),
2743
2790
  /* @__PURE__ */ n(
2744
- Z,
2791
+ X,
2745
2792
  {
2746
2793
  ref: a,
2747
2794
  type: "tel",
2748
- className: X("flex-1", r),
2795
+ className: te("flex-1", r),
2749
2796
  ...s,
2750
2797
  label: ""
2751
2798
  }
@@ -2755,32 +2802,32 @@ const nr = ({
2755
2802
  ] })
2756
2803
  );
2757
2804
  sr.displayName = "PhoneInput";
2758
- const Te = (t, e, r) => {
2805
+ const Me = (t, e, r) => {
2759
2806
  if (t && "reportValidity" in t) {
2760
- const s = Ee(r, e);
2807
+ const s = Re(r, e);
2761
2808
  t.setCustomValidity(s && s.message || ""), t.reportValidity();
2762
2809
  }
2763
- }, Re = (t, e) => {
2810
+ }, Pe = (t, e) => {
2764
2811
  for (const r in e.fields) {
2765
2812
  const s = e.fields[r];
2766
- s && s.ref && "reportValidity" in s.ref ? Te(s.ref, r, t) : s && s.refs && s.refs.forEach((a) => Te(a, r, t));
2813
+ s && s.ref && "reportValidity" in s.ref ? Me(s.ref, r, t) : s && s.refs && s.refs.forEach((a) => Me(a, r, t));
2767
2814
  }
2768
- }, Me = (t, e) => {
2769
- e.shouldUseNativeValidation && Re(t, e);
2815
+ }, Be = (t, e) => {
2816
+ e.shouldUseNativeValidation && Pe(t, e);
2770
2817
  const r = {};
2771
2818
  for (const s in t) {
2772
- const a = Ee(e.fields, s), i = Object.assign(t[s] || {}, { ref: a && a.ref });
2819
+ const a = Re(e.fields, s), i = Object.assign(t[s] || {}, { ref: a && a.ref });
2773
2820
  if (ar(e.names || Object.keys(t), s)) {
2774
- const c = Object.assign({}, Ee(r, s));
2775
- Ce(c, "root", i), Ce(r, s, c);
2776
- } else Ce(r, s, i);
2821
+ const c = Object.assign({}, Re(r, s));
2822
+ Ee(c, "root", i), Ee(r, s, c);
2823
+ } else Ee(r, s, i);
2777
2824
  }
2778
2825
  return r;
2779
2826
  }, ar = (t, e) => {
2780
- const r = Be(e);
2781
- return t.some((s) => Be(s).match(`^${r}\\.\\d+`));
2827
+ const r = Oe(e);
2828
+ return t.some((s) => Oe(s).match(`^${r}\\.\\d+`));
2782
2829
  };
2783
- function Be(t) {
2830
+ function Oe(t) {
2784
2831
  return t.replace(/\]|\[/g, "");
2785
2832
  }
2786
2833
  function qe(t, e, r) {
@@ -2790,8 +2837,8 @@ function qe(t, e, r) {
2790
2837
  value: l._zod ?? {},
2791
2838
  enumerable: !1
2792
2839
  }), (u = l._zod).traits ?? (u.traits = /* @__PURE__ */ new Set()), l._zod.traits.add(t), e(l, d);
2793
- for (const g in c.prototype)
2794
- g in l || Object.defineProperty(l, g, { value: c.prototype[g].bind(l) });
2840
+ for (const y in c.prototype)
2841
+ y in l || Object.defineProperty(l, y, { value: c.prototype[y].bind(l) });
2795
2842
  l._zod.constr = c, l._zod.def = d;
2796
2843
  }
2797
2844
  const a = (r == null ? void 0 : r.Parent) ?? Object;
@@ -2802,8 +2849,8 @@ function qe(t, e, r) {
2802
2849
  var d;
2803
2850
  const u = r != null && r.Parent ? new i() : this;
2804
2851
  s(u, l), (d = u._zod).deferred ?? (d.deferred = []);
2805
- for (const g of u._zod.deferred)
2806
- g();
2852
+ for (const y of u._zod.deferred)
2853
+ y();
2807
2854
  return u;
2808
2855
  }
2809
2856
  return Object.defineProperty(c, "init", { value: s }), Object.defineProperty(c, Symbol.hasInstance, {
@@ -2827,15 +2874,15 @@ function lr(t, e) {
2827
2874
  }
2828
2875
  const Ve = Error.captureStackTrace ? Error.captureStackTrace : (...t) => {
2829
2876
  };
2830
- function ve(t) {
2877
+ function ke(t) {
2831
2878
  return typeof t == "string" ? t : t == null ? void 0 : t.message;
2832
2879
  }
2833
2880
  function Ye(t, e, r) {
2834
2881
  var a, i, c, l, d, u;
2835
2882
  const s = { ...t, path: t.path ?? [] };
2836
2883
  if (!t.message) {
2837
- const g = ve((c = (i = (a = t.inst) == null ? void 0 : a._zod.def) == null ? void 0 : i.error) == null ? void 0 : c.call(i, t)) ?? ve((l = e == null ? void 0 : e.error) == null ? void 0 : l.call(e, t)) ?? ve((d = r.customError) == null ? void 0 : d.call(r, t)) ?? ve((u = r.localeError) == null ? void 0 : u.call(r, t)) ?? "Invalid input";
2838
- s.message = g;
2884
+ const y = ke((c = (i = (a = t.inst) == null ? void 0 : a._zod.def) == null ? void 0 : i.error) == null ? void 0 : c.call(i, t)) ?? ke((l = e == null ? void 0 : e.error) == null ? void 0 : l.call(e, t)) ?? ke((d = r.customError) == null ? void 0 : d.call(r, t)) ?? ke((u = r.localeError) == null ? void 0 : u.call(r, t)) ?? "Invalid input";
2885
+ s.message = y;
2839
2886
  }
2840
2887
  return delete s.inst, delete s.continue, e != null && e.reportInput || delete s.input, s;
2841
2888
  }
@@ -2874,7 +2921,7 @@ const We = (t, e) => {
2874
2921
  }
2875
2922
  return c.value;
2876
2923
  }, hr = /* @__PURE__ */ mr(Qe);
2877
- function Oe(t, e) {
2924
+ function ze(t, e) {
2878
2925
  try {
2879
2926
  var r = t();
2880
2927
  } catch (s) {
@@ -2889,9 +2936,9 @@ function pr(t, e) {
2889
2936
  var l = s.unionErrors[0].errors[0];
2890
2937
  r[c] = { message: l.message, type: l.code };
2891
2938
  } else r[c] = { message: i, type: a };
2892
- if ("unionErrors" in s && s.unionErrors.forEach(function(g) {
2893
- return g.errors.forEach(function(p) {
2894
- return t.push(p);
2939
+ if ("unionErrors" in s && s.unionErrors.forEach(function(y) {
2940
+ return y.errors.forEach(function(x) {
2941
+ return t.push(x);
2895
2942
  });
2896
2943
  }), e) {
2897
2944
  var d = r[c].types, u = d && d[s.code];
@@ -2908,9 +2955,9 @@ function gr(t, e) {
2908
2955
  var l = s.errors[0][0];
2909
2956
  r[c] = { message: l.message, type: l.code };
2910
2957
  } else r[c] = { message: i, type: a };
2911
- if (s.code === "invalid_union" && s.errors.forEach(function(g) {
2912
- return g.forEach(function(p) {
2913
- return t.push(p);
2958
+ if (s.code === "invalid_union" && s.errors.forEach(function(y) {
2959
+ return y.forEach(function(x) {
2960
+ return t.push(x);
2914
2961
  });
2915
2962
  }), e) {
2916
2963
  var d = r[c].types, u = d && d[s.code];
@@ -2925,14 +2972,14 @@ function Ge(t, e, r) {
2925
2972
  return "_def" in s && typeof s._def == "object" && "typeName" in s._def;
2926
2973
  }(t)) return function(s, a, i) {
2927
2974
  try {
2928
- return Promise.resolve(Oe(function() {
2975
+ return Promise.resolve(ze(function() {
2929
2976
  return Promise.resolve(t[r.mode === "sync" ? "parse" : "parseAsync"](s, e)).then(function(c) {
2930
- return i.shouldUseNativeValidation && Re({}, i), { errors: {}, values: r.raw ? Object.assign({}, s) : c };
2977
+ return i.shouldUseNativeValidation && Pe({}, i), { errors: {}, values: r.raw ? Object.assign({}, s) : c };
2931
2978
  });
2932
2979
  }, function(c) {
2933
2980
  if (function(l) {
2934
2981
  return Array.isArray(l == null ? void 0 : l.issues);
2935
- }(c)) return { values: {}, errors: Me(pr(c.errors, !i.shouldUseNativeValidation && i.criteriaMode === "all"), i) };
2982
+ }(c)) return { values: {}, errors: Be(pr(c.errors, !i.shouldUseNativeValidation && i.criteriaMode === "all"), i) };
2936
2983
  throw c;
2937
2984
  }));
2938
2985
  } catch (c) {
@@ -2943,14 +2990,14 @@ function Ge(t, e, r) {
2943
2990
  return "_zod" in s && typeof s._zod == "object";
2944
2991
  }(t)) return function(s, a, i) {
2945
2992
  try {
2946
- return Promise.resolve(Oe(function() {
2993
+ return Promise.resolve(ze(function() {
2947
2994
  return Promise.resolve((r.mode === "sync" ? ur : hr)(t, s, e)).then(function(c) {
2948
- return i.shouldUseNativeValidation && Re({}, i), { errors: {}, values: r.raw ? Object.assign({}, s) : c };
2995
+ return i.shouldUseNativeValidation && Pe({}, i), { errors: {}, values: r.raw ? Object.assign({}, s) : c };
2949
2996
  });
2950
2997
  }, function(c) {
2951
2998
  if (function(l) {
2952
2999
  return l instanceof cr;
2953
- }(c)) return { values: {}, errors: Me(gr(c.issues, !i.shouldUseNativeValidation && i.criteriaMode === "all"), i) };
3000
+ }(c)) return { values: {}, errors: Be(gr(c.issues, !i.shouldUseNativeValidation && i.criteriaMode === "all"), i) };
2954
3001
  throw c;
2955
3002
  }));
2956
3003
  } catch (c) {
@@ -2960,12 +3007,12 @@ function Ge(t, e, r) {
2960
3007
  throw new Error("Invalid input: not a Zod schema");
2961
3008
  }
2962
3009
  function yr(t) {
2963
- return de.object({
2964
- questionResults: de.any()
3010
+ return ue.object({
3011
+ questionResults: ue.any()
2965
3012
  }).passthrough();
2966
3013
  }
2967
3014
  function fr(t) {
2968
- let e = de.array(de.instanceof(File));
3015
+ let e = ue.array(ue.instanceof(File));
2969
3016
  if (t.isRequired ? e = e.min(
2970
3017
  1,
2971
3018
  `${t.displayName} is required`
@@ -2991,132 +3038,132 @@ function qr(t) {
2991
3038
  return t.uploadDocumentFiles.forEach((r) => {
2992
3039
  const s = `file_${r.id}`;
2993
3040
  e[s] = fr(r);
2994
- }), de.object(e);
3041
+ }), ue.object(e);
2995
3042
  }
2996
3043
  function br(t) {
2997
- return de.any();
3044
+ return ue.any();
2998
3045
  }
2999
3046
  function xr(t) {
3000
- return de.string().min(1, "This question is required");
3047
+ return ue.string().min(1, "This question is required");
3001
3048
  }
3002
3049
  function Hr(t) {
3003
3050
  const e = {};
3004
3051
  return t.appropriatenessQuestions.forEach((r) => {
3005
3052
  const s = `question_${r.id}`;
3006
3053
  e[s] = xr();
3007
- }), de.object(e);
3054
+ }), ue.object(e);
3008
3055
  }
3009
- const Vr = de.any(), vr = ({
3056
+ const Vr = ue.any(), vr = ({
3010
3057
  applicantId: t,
3011
3058
  onComplete: e,
3012
3059
  onBack: r
3013
3060
  }) => {
3014
- const { questionnaire: s, isLoading: a, isSubmitting: i, error: c, submit: l } = Zt(t), d = $e(() => s ? { questionResults: s.questionGroups.map(
3015
- (f) => f.questions.map((P) => ({
3016
- questionId: P.id,
3061
+ const { questionnaire: s, isLoading: a, isSubmitting: i, error: c, submit: l } = Zt(t), d = je(() => s ? { questionResults: s.questionGroups.map(
3062
+ (f) => f.questions.map((k) => ({
3063
+ questionId: k.id,
3017
3064
  values: []
3018
3065
  }))
3019
3066
  ) } : { questionResults: [] }, [s]), u = s ? yr() : null, {
3020
- control: g,
3021
- handleSubmit: p,
3022
- formState: { errors: m }
3023
- } = Pe({
3067
+ control: y,
3068
+ handleSubmit: x,
3069
+ formState: { errors: g }
3070
+ } = Le({
3024
3071
  resolver: u ? Ge(u) : void 0,
3025
3072
  defaultValues: d
3026
- }), b = async (y) => {
3073
+ }), b = async (m) => {
3027
3074
  if (s)
3028
3075
  try {
3029
- console.log("Form submitted with data:", y);
3076
+ console.log("Form submitted with data:", m);
3030
3077
  const f = s.questionGroups.flatMap(
3031
- (h, N) => h.questions.map((w, I) => {
3032
- var F, L, R;
3078
+ (h, E) => h.questions.map((v, S) => {
3079
+ var I, P, C;
3033
3080
  return {
3034
- questionId: w.id,
3035
- values: ((R = (L = (F = y.questionResults) == null ? void 0 : F[N]) == null ? void 0 : L[I]) == null ? void 0 : R.values) || []
3081
+ questionId: v.id,
3082
+ values: ((C = (P = (I = m.questionResults) == null ? void 0 : I[E]) == null ? void 0 : P[S]) == null ? void 0 : C.values) || []
3036
3083
  };
3037
3084
  })
3038
3085
  );
3039
3086
  console.log("Question results to submit:", f);
3040
- const P = {
3087
+ const k = {
3041
3088
  applicantId: t,
3042
3089
  questionnarieId: s.id,
3043
3090
  questionResults: f
3044
3091
  };
3045
- console.log("Final input:", P), await l(P), e == null || e();
3092
+ console.log("Final input:", k), await l(k), e == null || e();
3046
3093
  } catch (f) {
3047
3094
  console.error("Error submitting questionnaire:", f);
3048
3095
  }
3049
3096
  };
3050
- return a ? /* @__PURE__ */ n(T, { children: /* @__PURE__ */ n(M, { children: /* @__PURE__ */ n(ie, { className: "my-8" }) }) }) : c ? /* @__PURE__ */ n(T, { children: /* @__PURE__ */ n(M, { children: /* @__PURE__ */ o("p", { className: "text-danger-500", children: [
3097
+ return a ? /* @__PURE__ */ n(L, { children: /* @__PURE__ */ n(T, { children: /* @__PURE__ */ n(le, { className: "my-8" }) }) }) : c ? /* @__PURE__ */ n(L, { children: /* @__PURE__ */ n(T, { children: /* @__PURE__ */ o("p", { className: "text-danger-500", children: [
3051
3098
  "Error loading questionnaire: ",
3052
3099
  c.message
3053
- ] }) }) }) : s ? /* @__PURE__ */ n("form", { onSubmit: p(b), children: /* @__PURE__ */ o(T, { children: [
3054
- /* @__PURE__ */ o(J, { children: [
3100
+ ] }) }) }) : s ? /* @__PURE__ */ n("form", { onSubmit: x(b), children: /* @__PURE__ */ o(L, { children: [
3101
+ /* @__PURE__ */ o(ee, { children: [
3055
3102
  /* @__PURE__ */ n("h2", { className: "text-2xl font-bold", children: s.displayName }),
3056
3103
  s.subtitle && /* @__PURE__ */ n("p", { className: "text-gray-600 dark:text-gray-400 mt-1", children: s.subtitle })
3057
3104
  ] }),
3058
- /* @__PURE__ */ n(M, { className: "space-y-8", children: s.questionGroups.flatMap(
3059
- (y, f) => y.questions.map((P, h) => {
3060
- const w = P.defaultAnswers && P.defaultAnswers.length > 0 ? P.showAsDropdown ? P.canMultipleAnswer ? "multi-select" : "single-select" : P.canMultipleAnswer ? "checkbox" : "radio" : "text";
3105
+ /* @__PURE__ */ n(T, { className: "space-y-8", children: s.questionGroups.flatMap(
3106
+ (m, f) => m.questions.map((k, h) => {
3107
+ const v = k.defaultAnswers && k.defaultAnswers.length > 0 ? k.showAsDropdown ? k.canMultipleAnswer ? "multi-select" : "single-select" : k.canMultipleAnswer ? "checkbox" : "radio" : "text";
3061
3108
  return /* @__PURE__ */ o("div", { className: "space-y-2", children: [
3062
3109
  /* @__PURE__ */ o("label", { className: "block text-sm font-medium text-gray-700 dark:text-gray-300", children: [
3063
- P.text,
3064
- P.isRequired && /* @__PURE__ */ n("span", { className: "text-danger-500 ml-1", children: "*" })
3110
+ k.text,
3111
+ k.isRequired && /* @__PURE__ */ n("span", { className: "text-danger-500 ml-1", children: "*" })
3065
3112
  ] }),
3066
- w === "text" && /* @__PURE__ */ n(
3067
- G,
3113
+ v === "text" && /* @__PURE__ */ n(
3114
+ J,
3068
3115
  {
3069
- control: g,
3116
+ control: y,
3070
3117
  name: `questionResults.${f}.${h}.values.0`,
3071
- render: ({ field: I }) => {
3072
- var F, L, R, C;
3118
+ render: ({ field: S }) => {
3119
+ var I, P, C, A;
3073
3120
  return /* @__PURE__ */ n(
3074
- Z,
3121
+ X,
3075
3122
  {
3076
- value: I.value || "",
3077
- onChange: I.onChange,
3078
- onBlur: I.onBlur,
3079
- name: I.name,
3123
+ value: S.value || "",
3124
+ onChange: S.onChange,
3125
+ onBlur: S.onBlur,
3126
+ name: S.name,
3080
3127
  placeholder: "Enter your answer...",
3081
- error: (C = (R = (L = (F = m.questionResults) == null ? void 0 : F[f]) == null ? void 0 : L[h]) == null ? void 0 : R.values) == null ? void 0 : C.message
3128
+ error: (A = (C = (P = (I = g.questionResults) == null ? void 0 : I[f]) == null ? void 0 : P[h]) == null ? void 0 : C.values) == null ? void 0 : A.message
3082
3129
  }
3083
3130
  );
3084
3131
  }
3085
3132
  }
3086
3133
  ),
3087
- (w === "single-select" || w === "radio") && /* @__PURE__ */ n(
3088
- G,
3134
+ (v === "single-select" || v === "radio") && /* @__PURE__ */ n(
3135
+ J,
3089
3136
  {
3090
- control: g,
3137
+ control: y,
3091
3138
  name: `questionResults.${f}.${h}.values.0`,
3092
- render: ({ field: I }) => {
3093
- var F, L, R, C;
3139
+ render: ({ field: S }) => {
3140
+ var I, P, C, A;
3094
3141
  return /* @__PURE__ */ n(
3095
- ge,
3142
+ ye,
3096
3143
  {
3097
- value: I.value || "",
3098
- onChange: I.onChange,
3099
- onBlur: I.onBlur,
3100
- name: I.name,
3101
- options: P.defaultAnswers.map((B) => ({
3102
- value: B,
3103
- label: B
3144
+ value: S.value || "",
3145
+ onChange: S.onChange,
3146
+ onBlur: S.onBlur,
3147
+ name: S.name,
3148
+ options: k.defaultAnswers.map((M) => ({
3149
+ value: M,
3150
+ label: M
3104
3151
  })),
3105
3152
  placeholder: "Select an option...",
3106
- error: (C = (R = (L = (F = m.questionResults) == null ? void 0 : F[f]) == null ? void 0 : L[h]) == null ? void 0 : R.values) == null ? void 0 : C.message
3153
+ error: (A = (C = (P = (I = g.questionResults) == null ? void 0 : I[f]) == null ? void 0 : P[h]) == null ? void 0 : C.values) == null ? void 0 : A.message
3107
3154
  }
3108
3155
  );
3109
3156
  }
3110
3157
  }
3111
3158
  ),
3112
- (w === "checkbox" || w === "multi-select") && /* @__PURE__ */ o("div", { className: "space-y-2", children: [
3159
+ (v === "checkbox" || v === "multi-select") && /* @__PURE__ */ o("div", { className: "space-y-2", children: [
3113
3160
  /* @__PURE__ */ n("p", { className: "text-sm text-gray-600 dark:text-gray-400 mb-2", children: "Choose one or more options" }),
3114
3161
  /* @__PURE__ */ n(
3115
- G,
3162
+ J,
3116
3163
  {
3117
- control: g,
3164
+ control: y,
3118
3165
  name: `questionResults.${f}.${h}.values`,
3119
- render: ({ field: { value: I = [], onChange: F } }) => /* @__PURE__ */ n("div", { className: "space-y-2", children: P.defaultAnswers.map((L, R) => /* @__PURE__ */ o(
3166
+ render: ({ field: { value: S = [], onChange: I } }) => /* @__PURE__ */ n("div", { className: "space-y-2", children: k.defaultAnswers.map((P, C) => /* @__PURE__ */ o(
3120
3167
  "label",
3121
3168
  {
3122
3169
  className: "flex items-center space-x-2 cursor-pointer",
@@ -3125,26 +3172,26 @@ const Vr = de.any(), vr = ({
3125
3172
  "input",
3126
3173
  {
3127
3174
  type: "checkbox",
3128
- checked: Array.isArray(I) && I.includes(L),
3129
- onChange: (C) => {
3130
- const B = Array.isArray(I) ? I : [], z = C.target.checked ? [...B, L] : B.filter((v) => v !== L);
3131
- F(z);
3175
+ checked: Array.isArray(S) && S.includes(P),
3176
+ onChange: (A) => {
3177
+ const M = Array.isArray(S) ? S : [], B = A.target.checked ? [...M, P] : M.filter((Q) => Q !== P);
3178
+ I(B);
3132
3179
  },
3133
3180
  className: "h-4 w-4 text-primary-500 rounded border-gray-300 focus:ring-primary-500"
3134
3181
  }
3135
3182
  ),
3136
- /* @__PURE__ */ n("span", { className: "text-sm", children: L })
3183
+ /* @__PURE__ */ n("span", { className: "text-sm", children: P })
3137
3184
  ]
3138
3185
  },
3139
- `answer-${f}-${h}-${R}`
3186
+ `answer-${f}-${h}-${C}`
3140
3187
  )) })
3141
3188
  }
3142
3189
  )
3143
3190
  ] })
3144
- ] }, P.id);
3191
+ ] }, k.id);
3145
3192
  })
3146
3193
  ) }),
3147
- /* @__PURE__ */ o(te, { className: "flex justify-between", children: [
3194
+ /* @__PURE__ */ o(ne, { className: "flex justify-between", children: [
3148
3195
  r && /* @__PURE__ */ n(j, { type: "button", variant: "outline", onClick: r, children: "Back" }),
3149
3196
  /* @__PURE__ */ n(
3150
3197
  j,
@@ -3152,7 +3199,7 @@ const Vr = de.any(), vr = ({
3152
3199
  type: "submit",
3153
3200
  isLoading: i,
3154
3201
  onClick: () => {
3155
- console.log("Continue button clicked"), console.log("Form errors:", m);
3202
+ console.log("Continue button clicked"), console.log("Form errors:", g);
3156
3203
  },
3157
3204
  children: "Continue"
3158
3205
  }
@@ -3168,51 +3215,51 @@ const Vr = de.any(), vr = ({
3168
3215
  onComplete: e,
3169
3216
  onBack: r
3170
3217
  }) => {
3171
- const { uploadDocument: s, isLoading: a, isSubmitting: i, error: c, submit: l } = Jt(t), [d, u] = x({}), g = async (p) => {
3172
- if (p.preventDefault(), !s) return;
3173
- const m = await Promise.all(
3174
- s.uploadDocumentFiles.map(async (y) => {
3175
- const f = d[y.id] || [], P = await Promise.all(
3218
+ const { uploadDocument: s, isLoading: a, isSubmitting: i, error: c, submit: l } = Jt(t), [d, u] = N({}), y = async (x) => {
3219
+ if (x.preventDefault(), !s) return;
3220
+ const g = await Promise.all(
3221
+ s.uploadDocumentFiles.map(async (m) => {
3222
+ const f = d[m.id] || [], k = await Promise.all(
3176
3223
  f.map(async (h) => ({
3177
3224
  fileName: h.name,
3178
3225
  fileData: await qt(h)
3179
3226
  }))
3180
3227
  );
3181
3228
  return {
3182
- uploadDocumentFileId: y.id,
3183
- valueList: P
3229
+ uploadDocumentFileId: m.id,
3230
+ valueList: k
3184
3231
  };
3185
3232
  })
3186
3233
  ), b = {
3187
3234
  applicantId: t,
3188
3235
  uploadDocumentId: s.id,
3189
- uploadDocumentResults: m
3236
+ uploadDocumentResults: g
3190
3237
  };
3191
3238
  await l(b), e == null || e();
3192
3239
  };
3193
- return a ? /* @__PURE__ */ n(T, { children: /* @__PURE__ */ n(M, { children: /* @__PURE__ */ n(ie, { className: "my-8" }) }) }) : c ? /* @__PURE__ */ n(T, { children: /* @__PURE__ */ n(M, { children: /* @__PURE__ */ o("p", { className: "text-danger-500", children: [
3240
+ return a ? /* @__PURE__ */ n(L, { children: /* @__PURE__ */ n(T, { children: /* @__PURE__ */ n(le, { className: "my-8" }) }) }) : c ? /* @__PURE__ */ n(L, { children: /* @__PURE__ */ n(T, { children: /* @__PURE__ */ o("p", { className: "text-danger-500", children: [
3194
3241
  "Error loading document requirements: ",
3195
3242
  c.message
3196
- ] }) }) }) : s ? /* @__PURE__ */ n("form", { onSubmit: g, children: /* @__PURE__ */ o(T, { children: [
3197
- /* @__PURE__ */ o(J, { children: [
3243
+ ] }) }) }) : s ? /* @__PURE__ */ n("form", { onSubmit: y, children: /* @__PURE__ */ o(L, { children: [
3244
+ /* @__PURE__ */ o(ee, { children: [
3198
3245
  /* @__PURE__ */ n("h2", { className: "text-2xl font-bold", children: s.displayName }),
3199
3246
  s.subtitle && /* @__PURE__ */ n("p", { className: "text-gray-600 dark:text-gray-400 mt-1", children: s.subtitle })
3200
3247
  ] }),
3201
- /* @__PURE__ */ n(M, { className: "space-y-6", children: s.uploadDocumentFiles.map((p) => /* @__PURE__ */ n(
3248
+ /* @__PURE__ */ n(T, { className: "space-y-6", children: s.uploadDocumentFiles.map((x) => /* @__PURE__ */ n(
3202
3249
  nr,
3203
3250
  {
3204
- label: p.displayName,
3205
- accept: p.allowedTypes,
3206
- multiple: p.multipleFile,
3207
- maxSize: p.maxEachFileSizeByte,
3208
- value: d[p.id] || [],
3209
- onChange: (m) => {
3210
- u((b) => ({ ...b, [p.id]: m }));
3251
+ label: x.displayName,
3252
+ accept: x.allowedTypes,
3253
+ multiple: x.multipleFile,
3254
+ maxSize: x.maxEachFileSizeByte,
3255
+ value: d[x.id] || [],
3256
+ onChange: (g) => {
3257
+ u((b) => ({ ...b, [x.id]: g }));
3211
3258
  }
3212
3259
  },
3213
- p.id
3260
+ x.id
3214
3261
  )) }),
3215
- /* @__PURE__ */ o(te, { className: "flex justify-between", children: [
3262
+ /* @__PURE__ */ o(ne, { className: "flex justify-between", children: [
3216
3263
  r && /* @__PURE__ */ n(j, { type: "button", variant: "outline", onClick: r, children: "Back" }),
3217
3264
  /* @__PURE__ */ n(j, { type: "submit", isLoading: i, children: "Continue" })
3218
3265
  ] })
@@ -3221,16 +3268,16 @@ const Vr = de.any(), vr = ({
3221
3268
  const { overview: s, isLoading: a, isSubmitting: i, error: c, passOverview: l } = Xt(t), d = async () => {
3222
3269
  await l(), e == null || e();
3223
3270
  };
3224
- return a ? /* @__PURE__ */ n(T, { children: /* @__PURE__ */ n(M, { children: /* @__PURE__ */ n(ie, { className: "my-8" }) }) }) : c ? /* @__PURE__ */ n(T, { children: /* @__PURE__ */ n(M, { children: /* @__PURE__ */ o("p", { className: "text-danger-500", children: [
3271
+ return a ? /* @__PURE__ */ n(L, { children: /* @__PURE__ */ n(T, { children: /* @__PURE__ */ n(le, { className: "my-8" }) }) }) : c ? /* @__PURE__ */ n(L, { children: /* @__PURE__ */ n(T, { children: /* @__PURE__ */ o("p", { className: "text-danger-500", children: [
3225
3272
  "Error loading overview: ",
3226
3273
  c.message
3227
- ] }) }) }) : s ? /* @__PURE__ */ o(T, { children: [
3228
- /* @__PURE__ */ o(J, { children: [
3274
+ ] }) }) }) : s ? /* @__PURE__ */ o(L, { children: [
3275
+ /* @__PURE__ */ o(ee, { children: [
3229
3276
  /* @__PURE__ */ n("h2", { className: "text-2xl font-bold", children: s.title || "Overview" }),
3230
3277
  s.description && /* @__PURE__ */ n("p", { className: "text-gray-600 dark:text-gray-400 mt-1", children: s.description })
3231
3278
  ] }),
3232
- /* @__PURE__ */ o(M, { className: "space-y-6", children: [
3233
- s.steps && s.steps.length > 0 ? /* @__PURE__ */ n("div", { className: "space-y-4", children: s.steps.sort((u, g) => u.order - g.order).map((u) => /* @__PURE__ */ n(
3279
+ /* @__PURE__ */ o(T, { className: "space-y-6", children: [
3280
+ s.steps && s.steps.length > 0 ? /* @__PURE__ */ n("div", { className: "space-y-4", children: s.steps.sort((u, y) => u.order - y.order).map((u) => /* @__PURE__ */ n(
3234
3281
  "div",
3235
3282
  {
3236
3283
  className: "border border-gray-200 dark:border-gray-700 rounded-lg p-4 bg-gray-50 dark:bg-gray-800",
@@ -3249,7 +3296,7 @@ const Vr = de.any(), vr = ({
3249
3296
  " Review the information above and confirm to proceed."
3250
3297
  ] }) })
3251
3298
  ] }),
3252
- /* @__PURE__ */ o(te, { className: "flex justify-between", children: [
3299
+ /* @__PURE__ */ o(ne, { className: "flex justify-between", children: [
3253
3300
  r && /* @__PURE__ */ n(j, { type: "button", variant: "outline", onClick: r, children: "Back" }),
3254
3301
  /* @__PURE__ */ n(j, { onClick: d, isLoading: i, children: "Confirm and Continue" })
3255
3302
  ] })
@@ -3259,148 +3306,148 @@ const Vr = de.any(), vr = ({
3259
3306
  onComplete: e,
3260
3307
  onBack: r
3261
3308
  }) => {
3262
- const { criteria: s, isLoading: a, isSubmitting: i, error: c, submit: l } = tr(t), [d, u] = le.useState(!1), g = le.useMemo(() => !s || s.length === 0 ? { criteriaValueInputs: [] } : {
3309
+ const { criteria: s, isLoading: a, isSubmitting: i, error: c, submit: l } = tr(t), [d, u] = ce.useState(!1), y = ce.useMemo(() => !s || s.length === 0 ? { criteriaValueInputs: [] } : {
3263
3310
  criteriaValueInputs: s.map((h) => ({
3264
3311
  riskCriteriaId: h.id,
3265
3312
  values: [""]
3266
3313
  // Initialize with empty string to prevent uncontrolled input warning
3267
3314
  }))
3268
- }, [s]), p = s && s.length > 0 ? br() : null, {
3269
- control: m,
3315
+ }, [s]), x = s && s.length > 0 ? br() : null, {
3316
+ control: g,
3270
3317
  handleSubmit: b,
3271
- formState: { errors: y }
3272
- } = Pe({
3273
- resolver: p ? Ge(p) : void 0,
3274
- defaultValues: g
3318
+ formState: { errors: m }
3319
+ } = Le({
3320
+ resolver: x ? Ge(x) : void 0,
3321
+ defaultValues: y
3275
3322
  });
3276
- le.useEffect(() => {
3323
+ ce.useEffect(() => {
3277
3324
  !a && s && s.length === 0 && !d && !i && (u(!0), l({ applicantId: t, criteriaValueInputs: [] }).then(() => e == null ? void 0 : e()).catch(console.error));
3278
3325
  }, [a, s, d, i, l, t, e]);
3279
3326
  const f = async (h) => {
3280
3327
  if (s)
3281
3328
  try {
3282
3329
  console.log("Risk scoring form submitted:", h), console.log("Criteria metadata:", s);
3283
- const N = h.criteriaValueInputs.map((I, F) => {
3284
- const L = I.values || [], R = Array.isArray(L) ? L.filter((C) => C && C.trim()) : L && L.toString().trim() ? [L.toString()] : [];
3285
- return R.length === 0 ? null : {
3286
- riskCriteriaId: s[F].id,
3287
- values: R
3330
+ const E = h.criteriaValueInputs.map((S, I) => {
3331
+ const P = S.values || [], C = Array.isArray(P) ? P.filter((A) => A && A.trim()) : P && P.toString().trim() ? [P.toString()] : [];
3332
+ return C.length === 0 ? null : {
3333
+ riskCriteriaId: s[I].id,
3334
+ values: C
3288
3335
  };
3289
- }).filter((I) => I !== null);
3290
- console.log("Risk scoring criteriaValueInputs to submit:", N);
3291
- const w = {
3336
+ }).filter((S) => S !== null);
3337
+ console.log("Risk scoring criteriaValueInputs to submit:", E);
3338
+ const v = {
3292
3339
  applicantId: t,
3293
- criteriaValueInputs: N
3340
+ criteriaValueInputs: E
3294
3341
  };
3295
- console.log("Final risk scoring input:", w), await l(w), console.log("Risk scoring submitted successfully!"), e == null || e();
3296
- } catch (N) {
3297
- throw console.error("Error submitting risk scoring:", N), N;
3342
+ console.log("Final risk scoring input:", v), await l(v), console.log("Risk scoring submitted successfully!"), e == null || e();
3343
+ } catch (E) {
3344
+ throw console.error("Error submitting risk scoring:", E), E;
3298
3345
  }
3299
- }, P = (h) => h.builtInType === 1 ? "country" : !h.defaultValues || h.defaultValues.length === 0 ? "text" : h.multipleValue ? "checkbox" : "radio";
3300
- return a ? /* @__PURE__ */ n(T, { children: /* @__PURE__ */ o(M, { children: [
3301
- /* @__PURE__ */ n(ie, { className: "my-8" }),
3346
+ }, k = (h) => h.builtInType === 1 ? "country" : !h.defaultValues || h.defaultValues.length === 0 ? "text" : h.multipleValue ? "checkbox" : "radio";
3347
+ return a ? /* @__PURE__ */ n(L, { children: /* @__PURE__ */ o(T, { children: [
3348
+ /* @__PURE__ */ n(le, { className: "my-8" }),
3302
3349
  /* @__PURE__ */ n("p", { className: "text-center text-gray-600 dark:text-gray-400 mt-4", children: "Loading risk scoring criteria..." })
3303
- ] }) }) : c ? /* @__PURE__ */ n(T, { children: /* @__PURE__ */ n(M, { children: /* @__PURE__ */ o("p", { className: "text-danger-500", children: [
3350
+ ] }) }) : c ? /* @__PURE__ */ n(L, { children: /* @__PURE__ */ n(T, { children: /* @__PURE__ */ o("p", { className: "text-danger-500", children: [
3304
3351
  "Error loading criteria: ",
3305
3352
  c.message
3306
- ] }) }) }) : !a && s && s.length === 0 ? /* @__PURE__ */ n(T, { children: /* @__PURE__ */ o(M, { children: [
3307
- /* @__PURE__ */ n(ie, { className: "my-8" }),
3353
+ ] }) }) }) : !a && s && s.length === 0 ? /* @__PURE__ */ n(L, { children: /* @__PURE__ */ o(T, { children: [
3354
+ /* @__PURE__ */ n(le, { className: "my-8" }),
3308
3355
  /* @__PURE__ */ n("p", { className: "text-center text-gray-600 dark:text-gray-400", children: "No risk scoring criteria required. Moving to next step..." })
3309
- ] }) }) : s ? /* @__PURE__ */ n("form", { onSubmit: b(f), children: /* @__PURE__ */ o(T, { children: [
3310
- /* @__PURE__ */ o(J, { children: [
3356
+ ] }) }) : s ? /* @__PURE__ */ n("form", { onSubmit: b(f), children: /* @__PURE__ */ o(L, { children: [
3357
+ /* @__PURE__ */ o(ee, { children: [
3311
3358
  /* @__PURE__ */ n("h2", { className: "text-2xl font-bold", children: "Risk Assessment" }),
3312
3359
  /* @__PURE__ */ n("p", { className: "text-gray-600 dark:text-gray-400 mt-1", children: "Please answer the following questions for risk evaluation" })
3313
3360
  ] }),
3314
- /* @__PURE__ */ n(M, { className: "space-y-8", children: s.map((h, N) => {
3315
- var I, F, L;
3316
- const w = P(h);
3361
+ /* @__PURE__ */ n(T, { className: "space-y-8", children: s.map((h, E) => {
3362
+ var S, I, P;
3363
+ const v = k(h);
3317
3364
  return /* @__PURE__ */ o("div", { className: "space-y-2", children: [
3318
3365
  /* @__PURE__ */ o("label", { className: "block text-sm font-medium text-gray-700 dark:text-gray-300", children: [
3319
3366
  h.displayName,
3320
3367
  h.isRequired && /* @__PURE__ */ n("span", { className: "text-danger-500 ml-1", children: "*" })
3321
3368
  ] }),
3322
3369
  h.description && /* @__PURE__ */ n("p", { className: "text-sm text-gray-500 dark:text-gray-400", children: h.description }),
3323
- w === "text" && /* @__PURE__ */ n(
3324
- G,
3370
+ v === "text" && /* @__PURE__ */ n(
3371
+ J,
3325
3372
  {
3326
- control: m,
3327
- name: `criteriaValueInputs.${N}.values.0`,
3328
- render: ({ field: R }) => {
3329
- var C, B, z;
3373
+ control: g,
3374
+ name: `criteriaValueInputs.${E}.values.0`,
3375
+ render: ({ field: C }) => {
3376
+ var A, M, B;
3330
3377
  return /* @__PURE__ */ n(
3331
- Z,
3378
+ X,
3332
3379
  {
3333
- ...R,
3334
- value: R.value || "",
3335
- type: h.valueDataType === Ie.DigitOnly ? "number" : "text",
3380
+ ...C,
3381
+ value: C.value || "",
3382
+ type: h.valueDataType === De.DigitOnly ? "number" : "text",
3336
3383
  placeholder: "Enter your answer...",
3337
- error: (z = (B = (C = y.criteriaValueInputs) == null ? void 0 : C[N]) == null ? void 0 : B.values) == null ? void 0 : z.message,
3338
- onKeyDown: (v) => {
3339
- h.valueDataType === Ie.DigitOnly && ["e", "E", "+", "-", "."].includes(v.key) && v.preventDefault();
3384
+ error: (B = (M = (A = m.criteriaValueInputs) == null ? void 0 : A[E]) == null ? void 0 : M.values) == null ? void 0 : B.message,
3385
+ onKeyDown: (Q) => {
3386
+ h.valueDataType === De.DigitOnly && ["e", "E", "+", "-", "."].includes(Q.key) && Q.preventDefault();
3340
3387
  }
3341
3388
  }
3342
3389
  );
3343
3390
  }
3344
3391
  }
3345
3392
  ),
3346
- w === "radio" && h.defaultValues && /* @__PURE__ */ o("div", { className: "space-y-2", children: [
3393
+ v === "radio" && h.defaultValues && /* @__PURE__ */ o("div", { className: "space-y-2", children: [
3347
3394
  /* @__PURE__ */ n("p", { className: "text-sm text-gray-600 dark:text-gray-400", children: "Choose one option" }),
3348
3395
  /* @__PURE__ */ n(
3349
- G,
3396
+ J,
3350
3397
  {
3351
- control: m,
3352
- name: `criteriaValueInputs.${N}.values.0`,
3353
- render: ({ field: { value: R, onChange: C } }) => /* @__PURE__ */ n("div", { className: "space-y-2", children: h.defaultValues.map((B, z) => /* @__PURE__ */ o("label", { className: "flex items-center space-x-2 cursor-pointer", children: [
3398
+ control: g,
3399
+ name: `criteriaValueInputs.${E}.values.0`,
3400
+ render: ({ field: { value: C, onChange: A } }) => /* @__PURE__ */ n("div", { className: "space-y-2", children: h.defaultValues.map((M, B) => /* @__PURE__ */ o("label", { className: "flex items-center space-x-2 cursor-pointer", children: [
3354
3401
  /* @__PURE__ */ n(
3355
3402
  "input",
3356
3403
  {
3357
3404
  type: "radio",
3358
- checked: R === B,
3359
- onChange: () => C(B),
3405
+ checked: C === M,
3406
+ onChange: () => A(M),
3360
3407
  className: "h-4 w-4 text-primary-500 border-gray-300 focus:ring-primary-500"
3361
3408
  }
3362
3409
  ),
3363
- /* @__PURE__ */ n("span", { className: "text-sm", children: B })
3364
- ] }, `${N}-${z}`)) })
3410
+ /* @__PURE__ */ n("span", { className: "text-sm", children: M })
3411
+ ] }, `${E}-${B}`)) })
3365
3412
  }
3366
3413
  )
3367
3414
  ] }),
3368
- w === "checkbox" && h.defaultValues && /* @__PURE__ */ o("div", { className: "space-y-2", children: [
3415
+ v === "checkbox" && h.defaultValues && /* @__PURE__ */ o("div", { className: "space-y-2", children: [
3369
3416
  /* @__PURE__ */ n("p", { className: "text-sm text-gray-600 dark:text-gray-400", children: "Choose one or more options" }),
3370
3417
  /* @__PURE__ */ n(
3371
- G,
3418
+ J,
3372
3419
  {
3373
- control: m,
3374
- name: `criteriaValueInputs.${N}.values`,
3375
- render: ({ field: { value: R = [], onChange: C } }) => /* @__PURE__ */ n("div", { className: "space-y-2", children: h.defaultValues.map((B, z) => /* @__PURE__ */ o("label", { className: "flex items-center space-x-2 cursor-pointer", children: [
3420
+ control: g,
3421
+ name: `criteriaValueInputs.${E}.values`,
3422
+ render: ({ field: { value: C = [], onChange: A } }) => /* @__PURE__ */ n("div", { className: "space-y-2", children: h.defaultValues.map((M, B) => /* @__PURE__ */ o("label", { className: "flex items-center space-x-2 cursor-pointer", children: [
3376
3423
  /* @__PURE__ */ n(
3377
3424
  "input",
3378
3425
  {
3379
3426
  type: "checkbox",
3380
- checked: Array.isArray(R) && R.includes(B),
3381
- onChange: (v) => {
3382
- const E = Array.isArray(R) ? R : [], A = v.target.checked ? [...E, B] : E.filter((k) => k !== B);
3383
- C(A);
3427
+ checked: Array.isArray(C) && C.includes(M),
3428
+ onChange: (Q) => {
3429
+ const _ = Array.isArray(C) ? C : [], p = Q.target.checked ? [..._, M] : _.filter((w) => w !== M);
3430
+ A(p);
3384
3431
  },
3385
3432
  className: "h-4 w-4 text-primary-500 rounded border-gray-300 focus:ring-primary-500"
3386
3433
  }
3387
3434
  ),
3388
- /* @__PURE__ */ n("span", { className: "text-sm", children: B })
3389
- ] }, `${N}-${z}`)) })
3435
+ /* @__PURE__ */ n("span", { className: "text-sm", children: M })
3436
+ ] }, `${E}-${B}`)) })
3390
3437
  }
3391
3438
  )
3392
3439
  ] }),
3393
- w === "country" && /* @__PURE__ */ n(
3394
- G,
3440
+ v === "country" && /* @__PURE__ */ n(
3441
+ J,
3395
3442
  {
3396
- control: m,
3397
- name: `criteriaValueInputs.${N}.values.0`,
3398
- render: ({ field: R }) => {
3399
- var C, B, z;
3443
+ control: g,
3444
+ name: `criteriaValueInputs.${E}.values.0`,
3445
+ render: ({ field: C }) => {
3446
+ var A, M, B;
3400
3447
  return /* @__PURE__ */ n(
3401
- ge,
3448
+ ye,
3402
3449
  {
3403
- ...R,
3450
+ ...C,
3404
3451
  options: [
3405
3452
  { value: "US", label: "United States" },
3406
3453
  { value: "GB", label: "United Kingdom" },
@@ -3408,16 +3455,16 @@ const Vr = de.any(), vr = ({
3408
3455
  // TODO: Load from base information service
3409
3456
  ],
3410
3457
  placeholder: "Select a country...",
3411
- error: (z = (B = (C = y.criteriaValueInputs) == null ? void 0 : C[N]) == null ? void 0 : B.values) == null ? void 0 : z.message
3458
+ error: (B = (M = (A = m.criteriaValueInputs) == null ? void 0 : A[E]) == null ? void 0 : M.values) == null ? void 0 : B.message
3412
3459
  }
3413
3460
  );
3414
3461
  }
3415
3462
  }
3416
3463
  ),
3417
- ((L = (F = (I = y.criteriaValueInputs) == null ? void 0 : I[N]) == null ? void 0 : F.values) == null ? void 0 : L.message) && /* @__PURE__ */ n("p", { className: "text-sm text-danger-500 mt-1", children: y.criteriaValueInputs[N].values.message })
3464
+ ((P = (I = (S = m.criteriaValueInputs) == null ? void 0 : S[E]) == null ? void 0 : I.values) == null ? void 0 : P.message) && /* @__PURE__ */ n("p", { className: "text-sm text-danger-500 mt-1", children: m.criteriaValueInputs[E].values.message })
3418
3465
  ] }, h.id);
3419
3466
  }) }),
3420
- /* @__PURE__ */ o(te, { className: "flex justify-between", children: [
3467
+ /* @__PURE__ */ o(ne, { className: "flex justify-between", children: [
3421
3468
  r && /* @__PURE__ */ n(j, { type: "button", variant: "outline", onClick: r, children: "Back" }),
3422
3469
  /* @__PURE__ */ n(
3423
3470
  j,
@@ -3425,7 +3472,7 @@ const Vr = de.any(), vr = ({
3425
3472
  type: "submit",
3426
3473
  isLoading: i,
3427
3474
  onClick: () => {
3428
- console.log("Risk scoring submit button clicked"), console.log("Form errors:", y);
3475
+ console.log("Risk scoring submit button clicked"), console.log("Form errors:", m);
3429
3476
  },
3430
3477
  children: "Continue"
3431
3478
  }
@@ -3441,39 +3488,39 @@ const Vr = de.any(), vr = ({
3441
3488
  onComplete: e,
3442
3489
  onBack: r
3443
3490
  }) => {
3444
- const { investorCategorizationService: s } = re(), [a, i] = x(null), [c, l] = x(!1), [d, u] = x(null);
3445
- return /* @__PURE__ */ n("form", { onSubmit: async (p) => {
3446
- if (p.preventDefault(), a === null) {
3491
+ const { investorCategorizationService: s } = se(), [a, i] = N(null), [c, l] = N(!1), [d, u] = N(null);
3492
+ return /* @__PURE__ */ n("form", { onSubmit: async (x) => {
3493
+ if (x.preventDefault(), a === null) {
3447
3494
  u("Please select an investor type");
3448
3495
  return;
3449
3496
  }
3450
3497
  l(!0), u(null);
3451
3498
  try {
3452
- const m = {
3499
+ const g = {
3453
3500
  applicantId: t,
3454
3501
  investorType: a
3455
3502
  };
3456
- console.log("Submitting investor categorization:", m);
3457
- const b = await s.setInvestorCategorization(m);
3503
+ console.log("Submitting investor categorization:", g);
3504
+ const b = await s.setInvestorCategorization(g);
3458
3505
  console.log("Investor categorization result:", b), e == null || e();
3459
- } catch (m) {
3460
- console.error("Error submitting investor categorization:", m), u(m.message || "Failed to submit investor categorization");
3506
+ } catch (g) {
3507
+ console.error("Error submitting investor categorization:", g), u(g.message || "Failed to submit investor categorization");
3461
3508
  } finally {
3462
3509
  l(!1);
3463
3510
  }
3464
- }, children: /* @__PURE__ */ o(T, { children: [
3465
- /* @__PURE__ */ o(J, { children: [
3511
+ }, children: /* @__PURE__ */ o(L, { children: [
3512
+ /* @__PURE__ */ o(ee, { children: [
3466
3513
  /* @__PURE__ */ n("h2", { className: "text-2xl font-bold text-gray-900 dark:text-white", children: "Which statement best describes you?" }),
3467
3514
  /* @__PURE__ */ n("p", { className: "text-gray-600 dark:text-gray-400 mt-2", children: "All Tokenise clients are treated as Retail Investors under EU regulation, which gives you the highest level of investor protection. For our internal purposes, we ask you to select the description that best matches your situation" })
3468
3515
  ] }),
3469
- /* @__PURE__ */ o(M, { className: "space-y-4", children: [
3516
+ /* @__PURE__ */ o(T, { className: "space-y-4", children: [
3470
3517
  /* @__PURE__ */ n("p", { className: "text-sm font-medium text-gray-700 dark:text-gray-300 mb-3", children: "Choose one" }),
3471
3518
  /* @__PURE__ */ n(
3472
3519
  "label",
3473
3520
  {
3474
3521
  className: `
3475
3522
  block p-4 border-2 rounded-lg cursor-pointer transition-all
3476
- ${a === ee.Individual ? "border-primary-500 bg-primary-50 dark:bg-primary-900/20" : "border-gray-200 dark:border-gray-700 hover:border-gray-300 dark:hover:border-gray-600"}
3523
+ ${a === re.Individual ? "border-primary-500 bg-primary-50 dark:bg-primary-900/20" : "border-gray-200 dark:border-gray-700 hover:border-gray-300 dark:hover:border-gray-600"}
3477
3524
  `,
3478
3525
  children: /* @__PURE__ */ o("div", { className: "flex items-start", children: [
3479
3526
  /* @__PURE__ */ n(
@@ -3481,9 +3528,9 @@ const Vr = de.any(), vr = ({
3481
3528
  {
3482
3529
  type: "radio",
3483
3530
  name: "investorType",
3484
- value: ee.Individual,
3485
- checked: a === ee.Individual,
3486
- onChange: () => i(ee.Individual),
3531
+ value: re.Individual,
3532
+ checked: a === re.Individual,
3533
+ onChange: () => i(re.Individual),
3487
3534
  className: "mt-1 h-4 w-4 text-primary-500 border-gray-300 focus:ring-primary-500"
3488
3535
  }
3489
3536
  ),
@@ -3499,7 +3546,7 @@ const Vr = de.any(), vr = ({
3499
3546
  {
3500
3547
  className: `
3501
3548
  block p-4 border-2 rounded-lg cursor-pointer transition-all
3502
- ${a === ee.Sophisticated ? "border-primary-500 bg-primary-50 dark:bg-primary-900/20" : "border-gray-200 dark:border-gray-700 hover:border-gray-300 dark:hover:border-gray-600"}
3549
+ ${a === re.Sophisticated ? "border-primary-500 bg-primary-50 dark:bg-primary-900/20" : "border-gray-200 dark:border-gray-700 hover:border-gray-300 dark:hover:border-gray-600"}
3503
3550
  `,
3504
3551
  children: /* @__PURE__ */ o("div", { className: "flex items-start", children: [
3505
3552
  /* @__PURE__ */ n(
@@ -3507,9 +3554,9 @@ const Vr = de.any(), vr = ({
3507
3554
  {
3508
3555
  type: "radio",
3509
3556
  name: "investorType",
3510
- value: ee.Sophisticated,
3511
- checked: a === ee.Sophisticated,
3512
- onChange: () => i(ee.Sophisticated),
3557
+ value: re.Sophisticated,
3558
+ checked: a === re.Sophisticated,
3559
+ onChange: () => i(re.Sophisticated),
3513
3560
  className: "mt-1 h-4 w-4 text-primary-500 border-gray-300 focus:ring-primary-500"
3514
3561
  }
3515
3562
  ),
@@ -3530,7 +3577,7 @@ const Vr = de.any(), vr = ({
3530
3577
  {
3531
3578
  className: `
3532
3579
  block p-4 border-2 rounded-lg cursor-pointer transition-all
3533
- ${a === ee.HighNetWorth ? "border-primary-500 bg-primary-50 dark:bg-primary-900/20" : "border-gray-200 dark:border-gray-700 hover:border-gray-300 dark:hover:border-gray-600"}
3580
+ ${a === re.HighNetWorth ? "border-primary-500 bg-primary-50 dark:bg-primary-900/20" : "border-gray-200 dark:border-gray-700 hover:border-gray-300 dark:hover:border-gray-600"}
3534
3581
  `,
3535
3582
  children: /* @__PURE__ */ o("div", { className: "flex items-start", children: [
3536
3583
  /* @__PURE__ */ n(
@@ -3538,9 +3585,9 @@ const Vr = de.any(), vr = ({
3538
3585
  {
3539
3586
  type: "radio",
3540
3587
  name: "investorType",
3541
- value: ee.HighNetWorth,
3542
- checked: a === ee.HighNetWorth,
3543
- onChange: () => i(ee.HighNetWorth),
3588
+ value: re.HighNetWorth,
3589
+ checked: a === re.HighNetWorth,
3590
+ onChange: () => i(re.HighNetWorth),
3544
3591
  className: "mt-1 h-4 w-4 text-primary-500 border-gray-300 focus:ring-primary-500"
3545
3592
  }
3546
3593
  ),
@@ -3561,7 +3608,7 @@ const Vr = de.any(), vr = ({
3561
3608
  d
3562
3609
  ] }) })
3563
3610
  ] }),
3564
- /* @__PURE__ */ o(te, { className: "flex justify-between", children: [
3611
+ /* @__PURE__ */ o(ne, { className: "flex justify-between", children: [
3565
3612
  r && /* @__PURE__ */ n(j, { type: "button", variant: "outline", onClick: r, children: "Back" }),
3566
3613
  /* @__PURE__ */ n(
3567
3614
  j,
@@ -3579,135 +3626,135 @@ const Vr = de.any(), vr = ({
3579
3626
  onComplete: e,
3580
3627
  onBack: r
3581
3628
  }) => {
3582
- const { appropriatenessTestService: s } = re(), [a, i] = x(null), [c, l] = x(!0), [d, u] = x(!1), [g, p] = x(null), [m, b] = x({}), [y, f] = x(0), [P, h] = x(!1), [N, w] = x(!1), [I, F] = x(0);
3583
- V(() => {
3629
+ const { appropriatenessTestService: s } = se(), [a, i] = N(null), [c, l] = N(!0), [d, u] = N(!1), [y, x] = N(null), [g, b] = N({}), [m, f] = N(0), [k, h] = N(!1), [E, v] = N(!1), [S, I] = N(0);
3630
+ Y(() => {
3584
3631
  (async () => {
3585
3632
  try {
3586
- l(!0), p(null), console.log("Loading appropriateness test for applicant:", t);
3587
- const k = await s.getAppropriatenessTest(t);
3588
- if (console.log("Appropriateness test data:", k), i(k), k.waitTimeSpanForNextTry && k.waitTimeSpanForNextTry !== "00:00:00") {
3589
- const S = L(k.waitTimeSpanForNextTry);
3590
- S > 0 && F(S);
3633
+ l(!0), x(null), console.log("Loading appropriateness test for applicant:", t);
3634
+ const w = await s.getAppropriatenessTest(t);
3635
+ if (console.log("Appropriateness test data:", w), i(w), w.waitTimeSpanForNextTry && w.waitTimeSpanForNextTry !== "00:00:00") {
3636
+ const O = P(w.waitTimeSpanForNextTry);
3637
+ O > 0 && I(O);
3591
3638
  }
3592
- } catch (k) {
3593
- console.error("Error loading appropriateness test:", k), p(k.message || "Failed to load appropriateness test");
3639
+ } catch (w) {
3640
+ console.error("Error loading appropriateness test:", w), x(w.message || "Failed to load appropriateness test");
3594
3641
  } finally {
3595
3642
  l(!1);
3596
3643
  }
3597
3644
  })();
3598
3645
  }, [t, s]);
3599
- const L = (A) => {
3600
- const k = A.split(":").map(Number);
3601
- if (k.length === 3) {
3602
- const [S, _, oe] = k;
3603
- return S * 3600 + _ * 60 + oe;
3646
+ const P = (p) => {
3647
+ const w = p.split(":").map(Number);
3648
+ if (w.length === 3) {
3649
+ const [O, z, R] = w;
3650
+ return O * 3600 + z * 60 + R;
3604
3651
  }
3605
3652
  return 0;
3606
- }, R = (A) => {
3607
- const k = Math.floor(A / 60), S = A % 60;
3608
- return `${k.toString().padStart(2, "0")}:${S.toString().padStart(2, "0")}`;
3653
+ }, C = (p) => {
3654
+ const w = Math.floor(p / 60), O = p % 60;
3655
+ return `${w.toString().padStart(2, "0")}:${O.toString().padStart(2, "0")}`;
3609
3656
  };
3610
- V(() => {
3611
- if (!P || y <= 0) return;
3612
- const A = setInterval(() => {
3613
- f((k) => k <= 1 ? (w(!0), 0) : k - 1);
3657
+ Y(() => {
3658
+ if (!k || m <= 0) return;
3659
+ const p = setInterval(() => {
3660
+ f((w) => w <= 1 ? (v(!0), 0) : w - 1);
3614
3661
  }, 1e3);
3615
- return () => clearInterval(A);
3616
- }, [P, y]), V(() => {
3617
- if (I <= 0) return;
3618
- const A = setInterval(() => {
3619
- F((k) => k <= 1 ? 0 : k - 1);
3662
+ return () => clearInterval(p);
3663
+ }, [k, m]), Y(() => {
3664
+ if (S <= 0) return;
3665
+ const p = setInterval(() => {
3666
+ I((w) => w <= 1 ? 0 : w - 1);
3620
3667
  }, 1e3);
3621
- return () => clearInterval(A);
3622
- }, [I]), V(() => {
3623
- N && !d && z();
3624
- }, [N]);
3625
- const C = () => {
3668
+ return () => clearInterval(p);
3669
+ }, [S]), Y(() => {
3670
+ E && !d && B();
3671
+ }, [E]);
3672
+ const A = () => {
3626
3673
  a && (h(!0), f(a.testDurationSec));
3627
- }, B = (A, k) => {
3628
- b((S) => ({
3629
- ...S,
3630
- [A]: k
3674
+ }, M = (p, w) => {
3675
+ b((O) => ({
3676
+ ...O,
3677
+ [p]: w
3631
3678
  }));
3632
- }, z = async (A) => {
3633
- if (A && A.preventDefault(), !!a) {
3634
- if (!N) {
3635
- const k = a.appropriatenessQuestions.length - Object.keys(m).length;
3636
- if (k > 0) {
3637
- p(`Please answer all questions. ${k} question(s) remaining.`);
3679
+ }, B = async (p) => {
3680
+ if (p && p.preventDefault(), !!a) {
3681
+ if (!E) {
3682
+ const w = a.appropriatenessQuestions.length - Object.keys(g).length;
3683
+ if (w > 0) {
3684
+ x(`Please answer all questions. ${w} question(s) remaining.`);
3638
3685
  return;
3639
3686
  }
3640
3687
  }
3641
- u(!0), p(null);
3688
+ u(!0), x(null);
3642
3689
  try {
3643
- const k = a.appropriatenessQuestions.map(
3644
- (_) => ({
3645
- appropriatenessQuestionId: _.id,
3646
- value: m[_.id] || ""
3690
+ const w = a.appropriatenessQuestions.map(
3691
+ (z) => ({
3692
+ appropriatenessQuestionId: z.id,
3693
+ value: g[z.id] || ""
3647
3694
  // Empty string if not answered
3648
3695
  })
3649
- ), S = {
3696
+ ), O = {
3650
3697
  applicantId: t,
3651
3698
  appropriatenessTestId: a.id,
3652
- appropriatenessQuestionResults: k
3699
+ appropriatenessQuestionResults: w
3653
3700
  };
3654
- console.log("Submitting appropriateness test:", S);
3701
+ console.log("Submitting appropriateness test:", O);
3655
3702
  try {
3656
- const _ = await s.fillAppropriatenessTest(S);
3657
- console.log("Appropriateness test result:", _), _.message && (_.message.toLowerCase().includes("pass") || _.message.toLowerCase().includes("success") || _.message.toLowerCase().includes("congratulations")) ? e == null || e() : (p(_.message || "Test completed. Please check the result."), h(!1), w(!1), b({}), setTimeout(() => v(), 1e3));
3658
- } catch (_) {
3659
- if (_.code === 400 && _.message) {
3660
- const oe = _.message;
3661
- console.log("Test failed:", oe), p(oe), h(!1), w(!1), b({}), setTimeout(() => v(), 1500);
3703
+ const z = await s.fillAppropriatenessTest(O);
3704
+ console.log("Appropriateness test result:", z), z.message && (z.message.toLowerCase().includes("pass") || z.message.toLowerCase().includes("success") || z.message.toLowerCase().includes("congratulations")) ? e == null || e() : (x(z.message || "Test completed. Please check the result."), h(!1), v(!1), b({}), setTimeout(() => Q(), 1e3));
3705
+ } catch (z) {
3706
+ if (z.code === 400 && z.message) {
3707
+ const R = z.message;
3708
+ console.log("Test failed:", R), x(R), h(!1), v(!1), b({}), setTimeout(() => Q(), 1500);
3662
3709
  } else
3663
- throw _;
3710
+ throw z;
3664
3711
  }
3665
- } catch (k) {
3666
- console.error("Error submitting appropriateness test:", k), p(k.message || "Failed to submit test. Please try again."), h(!1), w(!1), b({});
3712
+ } catch (w) {
3713
+ console.error("Error submitting appropriateness test:", w), x(w.message || "Failed to submit test. Please try again."), h(!1), v(!1), b({});
3667
3714
  } finally {
3668
3715
  u(!1);
3669
3716
  }
3670
3717
  }
3671
- }, v = async () => {
3718
+ }, Q = async () => {
3672
3719
  try {
3673
- const A = await s.getAppropriatenessTest(t);
3674
- if (console.log("Reloaded test data:", A), i(A), A.waitTimeSpanForNextTry && A.waitTimeSpanForNextTry !== "00:00:00") {
3675
- const k = L(A.waitTimeSpanForNextTry);
3676
- k > 0 && F(k);
3720
+ const p = await s.getAppropriatenessTest(t);
3721
+ if (console.log("Reloaded test data:", p), i(p), p.waitTimeSpanForNextTry && p.waitTimeSpanForNextTry !== "00:00:00") {
3722
+ const w = P(p.waitTimeSpanForNextTry);
3723
+ w > 0 && I(w);
3677
3724
  }
3678
- } catch (A) {
3679
- console.error("Error reloading test data:", A), p((k) => k + `
3725
+ } catch (p) {
3726
+ console.error("Error reloading test data:", p), x((w) => w + `
3680
3727
 
3681
3728
  Failed to reload test data. Please refresh the page.`);
3682
3729
  }
3683
3730
  };
3684
3731
  if (c)
3685
- return /* @__PURE__ */ n(T, { children: /* @__PURE__ */ o(M, { children: [
3686
- /* @__PURE__ */ n(ie, { className: "my-8" }),
3732
+ return /* @__PURE__ */ n(L, { children: /* @__PURE__ */ o(T, { children: [
3733
+ /* @__PURE__ */ n(le, { className: "my-8" }),
3687
3734
  /* @__PURE__ */ n("p", { className: "text-center text-gray-600 dark:text-gray-400 mt-4", children: "Loading appropriateness test..." })
3688
3735
  ] }) });
3689
3736
  if (!a)
3690
- return /* @__PURE__ */ n(T, { children: /* @__PURE__ */ o(M, { className: "py-12 text-center", children: [
3737
+ return /* @__PURE__ */ n(L, { children: /* @__PURE__ */ o(T, { className: "py-12 text-center", children: [
3691
3738
  /* @__PURE__ */ n("p", { className: "text-danger-500 text-lg mb-4", children: "No test data available" }),
3692
- g && /* @__PURE__ */ n("p", { className: "text-gray-600 dark:text-gray-400", children: g })
3739
+ y && /* @__PURE__ */ n("p", { className: "text-gray-600 dark:text-gray-400", children: y })
3693
3740
  ] }) });
3694
- if (I > 0)
3695
- return /* @__PURE__ */ o(T, { children: [
3696
- /* @__PURE__ */ o(J, { children: [
3741
+ if (S > 0)
3742
+ return /* @__PURE__ */ o(L, { children: [
3743
+ /* @__PURE__ */ o(ee, { children: [
3697
3744
  /* @__PURE__ */ n("h2", { className: "text-2xl font-bold text-gray-900 dark:text-white", children: a.displayName }),
3698
3745
  a.subtitle && /* @__PURE__ */ n("p", { className: "text-gray-600 dark:text-gray-400 mt-2", children: a.subtitle })
3699
3746
  ] }),
3700
- /* @__PURE__ */ o(M, { className: "py-12 text-center", children: [
3747
+ /* @__PURE__ */ o(T, { className: "py-12 text-center", children: [
3701
3748
  /* @__PURE__ */ o("div", { className: "mb-6", children: [
3702
- /* @__PURE__ */ n("div", { className: "text-6xl font-bold text-primary-500 mb-2", children: R(I) }),
3749
+ /* @__PURE__ */ n("div", { className: "text-6xl font-bold text-primary-500 mb-2", children: C(S) }),
3703
3750
  /* @__PURE__ */ n("p", { className: "text-gray-600 dark:text-gray-400", children: "Please wait before attempting the test again" })
3704
3751
  ] }),
3705
- g && /* @__PURE__ */ n("div", { className: "mt-4 p-4 bg-red-50 dark:bg-red-900/20 border border-red-200 dark:border-red-800 rounded-lg", children: /* @__PURE__ */ n("p", { className: "text-red-600 dark:text-red-400 text-sm", children: g }) })
3752
+ y && /* @__PURE__ */ n("div", { className: "mt-4 p-4 bg-red-50 dark:bg-red-900/20 border border-red-200 dark:border-red-800 rounded-lg", children: /* @__PURE__ */ n("p", { className: "text-red-600 dark:text-red-400 text-sm", children: y }) })
3706
3753
  ] })
3707
3754
  ] });
3708
- const E = a.testAllowedMaxTry - a.totalFailedTries;
3709
- return P ? /* @__PURE__ */ n("form", { onSubmit: z, children: /* @__PURE__ */ o(T, { children: [
3710
- /* @__PURE__ */ n(J, { children: /* @__PURE__ */ o("div", { className: "flex items-center justify-between", children: [
3755
+ const _ = a.testAllowedMaxTry - a.totalFailedTries;
3756
+ return k ? /* @__PURE__ */ n("form", { onSubmit: B, children: /* @__PURE__ */ o(L, { children: [
3757
+ /* @__PURE__ */ n(ee, { children: /* @__PURE__ */ o("div", { className: "flex items-center justify-between", children: [
3711
3758
  /* @__PURE__ */ o("div", { children: [
3712
3759
  /* @__PURE__ */ n("h2", { className: "text-2xl font-bold text-gray-900 dark:text-white", children: a.displayName }),
3713
3760
  a.subtitle && /* @__PURE__ */ n("p", { className: "text-gray-600 dark:text-gray-400 mt-1", children: a.subtitle })
@@ -3716,29 +3763,29 @@ Failed to reload test data. Please refresh the page.`);
3716
3763
  /* @__PURE__ */ n(
3717
3764
  "div",
3718
3765
  {
3719
- className: `text-3xl font-bold ${y <= 60 ? "text-danger-500" : "text-primary-500"}`,
3720
- children: R(y)
3766
+ className: `text-3xl font-bold ${m <= 60 ? "text-danger-500" : "text-primary-500"}`,
3767
+ children: C(m)
3721
3768
  }
3722
3769
  ),
3723
3770
  /* @__PURE__ */ n("p", { className: "text-sm text-gray-500 dark:text-gray-400", children: "Time Remaining" })
3724
3771
  ] })
3725
3772
  ] }) }),
3726
- /* @__PURE__ */ o(M, { className: "space-y-6", children: [
3773
+ /* @__PURE__ */ o(T, { className: "space-y-6", children: [
3727
3774
  /* @__PURE__ */ o("div", { className: "flex items-center justify-between mb-4", children: [
3728
- /* @__PURE__ */ o(me, { variant: "info", children: [
3775
+ /* @__PURE__ */ o(he, { variant: "info", children: [
3729
3776
  "Question ",
3730
- Object.keys(m).length,
3777
+ Object.keys(g).length,
3731
3778
  " of ",
3732
3779
  a.totalQuestionCount
3733
3780
  ] }),
3734
- /* @__PURE__ */ o(me, { variant: E > 1 ? "success" : "warning", children: [
3735
- E,
3781
+ /* @__PURE__ */ o(he, { variant: _ > 1 ? "success" : "warning", children: [
3782
+ _,
3736
3783
  " attempt",
3737
- E !== 1 ? "s" : "",
3784
+ _ !== 1 ? "s" : "",
3738
3785
  " remaining"
3739
3786
  ] })
3740
3787
  ] }),
3741
- a.appropriatenessQuestions.map((A, k) => /* @__PURE__ */ o(
3788
+ a.appropriatenessQuestions.map((p, w) => /* @__PURE__ */ o(
3742
3789
  "div",
3743
3790
  {
3744
3791
  className: "p-4 border border-gray-200 dark:border-gray-700 rounded-lg",
@@ -3746,51 +3793,51 @@ Failed to reload test data. Please refresh the page.`);
3746
3793
  /* @__PURE__ */ o("div", { className: "mb-4", children: [
3747
3794
  /* @__PURE__ */ o("span", { className: "inline-block px-2 py-1 text-xs font-semibold text-primary-700 bg-primary-100 dark:text-primary-300 dark:bg-primary-900/30 rounded mb-2", children: [
3748
3795
  "Question ",
3749
- k + 1
3796
+ w + 1
3750
3797
  ] }),
3751
- A.groupName && /* @__PURE__ */ n("span", { className: "ml-2 text-xs text-gray-500 dark:text-gray-400", children: A.groupName }),
3752
- /* @__PURE__ */ n("h3", { className: "text-lg font-semibold text-gray-900 dark:text-white mt-2", children: A.question })
3798
+ p.groupName && /* @__PURE__ */ n("span", { className: "ml-2 text-xs text-gray-500 dark:text-gray-400", children: p.groupName }),
3799
+ /* @__PURE__ */ n("h3", { className: "text-lg font-semibold text-gray-900 dark:text-white mt-2", children: p.question })
3753
3800
  ] }),
3754
- /* @__PURE__ */ n("div", { className: "space-y-2", children: A.answers.map((S, _) => /* @__PURE__ */ o(
3801
+ /* @__PURE__ */ n("div", { className: "space-y-2", children: p.answers.map((O, z) => /* @__PURE__ */ o(
3755
3802
  "label",
3756
3803
  {
3757
3804
  className: `
3758
3805
  flex items-center p-3 border-2 rounded-lg cursor-pointer transition-all
3759
- ${m[A.id] === S ? "border-primary-500 bg-primary-50 dark:bg-primary-900/20" : "border-gray-200 dark:border-gray-700 hover:border-gray-300 dark:hover:border-gray-600"}
3806
+ ${g[p.id] === O ? "border-primary-500 bg-primary-50 dark:bg-primary-900/20" : "border-gray-200 dark:border-gray-700 hover:border-gray-300 dark:hover:border-gray-600"}
3760
3807
  `,
3761
3808
  children: [
3762
3809
  /* @__PURE__ */ n(
3763
3810
  "input",
3764
3811
  {
3765
3812
  type: "radio",
3766
- name: `question-${A.id}`,
3767
- value: S,
3768
- checked: m[A.id] === S,
3769
- onChange: (oe) => B(A.id, oe.target.value),
3813
+ name: `question-${p.id}`,
3814
+ value: O,
3815
+ checked: g[p.id] === O,
3816
+ onChange: (R) => M(p.id, R.target.value),
3770
3817
  className: "h-4 w-4 text-primary-500 border-gray-300 focus:ring-primary-500",
3771
3818
  disabled: d
3772
3819
  }
3773
3820
  ),
3774
- /* @__PURE__ */ n("span", { className: "ml-3 text-gray-700 dark:text-gray-300", children: S })
3821
+ /* @__PURE__ */ n("span", { className: "ml-3 text-gray-700 dark:text-gray-300", children: O })
3775
3822
  ]
3776
3823
  },
3777
- _
3824
+ z
3778
3825
  )) })
3779
3826
  ]
3780
3827
  },
3781
- A.id
3828
+ p.id
3782
3829
  )),
3783
- g && !N && /* @__PURE__ */ n("div", { className: "p-4 bg-red-50 dark:bg-red-900/20 border border-red-200 dark:border-red-800 rounded-lg", children: /* @__PURE__ */ o("p", { className: "text-red-600 dark:text-red-400 text-sm", children: [
3830
+ y && !E && /* @__PURE__ */ n("div", { className: "p-4 bg-red-50 dark:bg-red-900/20 border border-red-200 dark:border-red-800 rounded-lg", children: /* @__PURE__ */ o("p", { className: "text-red-600 dark:text-red-400 text-sm", children: [
3784
3831
  /* @__PURE__ */ n("strong", { children: "Error:" }),
3785
3832
  " ",
3786
- g
3833
+ y
3787
3834
  ] }) }),
3788
- N && /* @__PURE__ */ n("div", { className: "p-4 bg-yellow-50 dark:bg-yellow-900/20 border border-yellow-200 dark:border-yellow-800 rounded-lg", children: /* @__PURE__ */ o("p", { className: "text-yellow-700 dark:text-yellow-400 text-sm", children: [
3835
+ E && /* @__PURE__ */ n("div", { className: "p-4 bg-yellow-50 dark:bg-yellow-900/20 border border-yellow-200 dark:border-yellow-800 rounded-lg", children: /* @__PURE__ */ o("p", { className: "text-yellow-700 dark:text-yellow-400 text-sm", children: [
3789
3836
  /* @__PURE__ */ n("strong", { children: "Time's up!" }),
3790
3837
  " Your answers are being submitted automatically."
3791
3838
  ] }) })
3792
3839
  ] }),
3793
- /* @__PURE__ */ o(te, { className: "flex justify-between", children: [
3840
+ /* @__PURE__ */ o(ne, { className: "flex justify-between", children: [
3794
3841
  /* @__PURE__ */ n(
3795
3842
  j,
3796
3843
  {
@@ -3806,51 +3853,51 @@ Failed to reload test data. Please refresh the page.`);
3806
3853
  {
3807
3854
  type: "submit",
3808
3855
  isLoading: d,
3809
- disabled: Object.keys(m).length < a.totalQuestionCount,
3810
- children: N ? "Submitting..." : "Submit Test"
3856
+ disabled: Object.keys(g).length < a.totalQuestionCount,
3857
+ children: E ? "Submitting..." : "Submit Test"
3811
3858
  }
3812
3859
  )
3813
3860
  ] })
3814
- ] }) }) : /* @__PURE__ */ o(T, { children: [
3815
- /* @__PURE__ */ o(J, { children: [
3861
+ ] }) }) : /* @__PURE__ */ o(L, { children: [
3862
+ /* @__PURE__ */ o(ee, { children: [
3816
3863
  /* @__PURE__ */ n("h2", { className: "text-2xl font-bold text-gray-900 dark:text-white", children: a.displayName }),
3817
3864
  a.subtitle && /* @__PURE__ */ n("p", { className: "text-gray-600 dark:text-gray-400 mt-2", children: a.subtitle })
3818
3865
  ] }),
3819
- /* @__PURE__ */ o(M, { children: [
3866
+ /* @__PURE__ */ o(T, { children: [
3820
3867
  a.description && /* @__PURE__ */ n("div", { className: "mb-6 p-4 bg-gray-50 dark:bg-gray-800 rounded-lg", children: /* @__PURE__ */ n("p", { className: "text-gray-700 dark:text-gray-300", children: a.description }) }),
3821
3868
  /* @__PURE__ */ o("div", { className: "space-y-4 mb-6", children: [
3822
3869
  /* @__PURE__ */ o("div", { className: "flex items-center justify-between p-4 bg-blue-50 dark:bg-blue-900/20 rounded-lg", children: [
3823
3870
  /* @__PURE__ */ n("span", { className: "text-gray-700 dark:text-gray-300 font-medium", children: "Total Questions:" }),
3824
- /* @__PURE__ */ n(me, { variant: "info", children: a.totalQuestionCount })
3871
+ /* @__PURE__ */ n(he, { variant: "info", children: a.totalQuestionCount })
3825
3872
  ] }),
3826
3873
  /* @__PURE__ */ o("div", { className: "flex items-center justify-between p-4 bg-blue-50 dark:bg-blue-900/20 rounded-lg", children: [
3827
3874
  /* @__PURE__ */ n("span", { className: "text-gray-700 dark:text-gray-300 font-medium", children: "Time Limit:" }),
3828
- /* @__PURE__ */ n(me, { variant: "info", children: R(a.testDurationSec) })
3875
+ /* @__PURE__ */ n(he, { variant: "info", children: C(a.testDurationSec) })
3829
3876
  ] }),
3830
3877
  /* @__PURE__ */ o("div", { className: "flex items-center justify-between p-4 bg-blue-50 dark:bg-blue-900/20 rounded-lg", children: [
3831
3878
  /* @__PURE__ */ n("span", { className: "text-gray-700 dark:text-gray-300 font-medium", children: "Correct Answers Required:" }),
3832
- /* @__PURE__ */ n(me, { variant: "info", children: a.testCorrectAnswerPassLimit })
3879
+ /* @__PURE__ */ n(he, { variant: "info", children: a.testCorrectAnswerPassLimit })
3833
3880
  ] }),
3834
3881
  /* @__PURE__ */ o("div", { className: "flex items-center justify-between p-4 bg-blue-50 dark:bg-blue-900/20 rounded-lg", children: [
3835
3882
  /* @__PURE__ */ n("span", { className: "text-gray-700 dark:text-gray-300 font-medium", children: "Attempts Remaining:" }),
3836
- /* @__PURE__ */ n(me, { variant: E > 1 ? "success" : "warning", children: E })
3883
+ /* @__PURE__ */ n(he, { variant: _ > 1 ? "success" : "warning", children: _ })
3837
3884
  ] })
3838
3885
  ] }),
3839
- g && /* @__PURE__ */ n("div", { className: "mb-4 p-4 bg-red-50 dark:bg-red-900/20 border border-red-200 dark:border-red-800 rounded-lg", children: /* @__PURE__ */ o("p", { className: "text-red-600 dark:text-red-400 text-sm", children: [
3886
+ y && /* @__PURE__ */ n("div", { className: "mb-4 p-4 bg-red-50 dark:bg-red-900/20 border border-red-200 dark:border-red-800 rounded-lg", children: /* @__PURE__ */ o("p", { className: "text-red-600 dark:text-red-400 text-sm", children: [
3840
3887
  /* @__PURE__ */ n("strong", { children: "Previous Attempt:" }),
3841
3888
  " ",
3842
- g
3889
+ y
3843
3890
  ] }) }),
3844
- E <= 0 && /* @__PURE__ */ n("div", { className: "p-4 bg-red-50 dark:bg-red-900/20 border border-red-200 dark:border-red-800 rounded-lg", children: /* @__PURE__ */ n("p", { className: "text-red-600 dark:text-red-400", children: "You have used all your attempts. Please contact support for assistance." }) })
3891
+ _ <= 0 && /* @__PURE__ */ n("div", { className: "p-4 bg-red-50 dark:bg-red-900/20 border border-red-200 dark:border-red-800 rounded-lg", children: /* @__PURE__ */ n("p", { className: "text-red-600 dark:text-red-400", children: "You have used all your attempts. Please contact support for assistance." }) })
3845
3892
  ] }),
3846
- /* @__PURE__ */ o(te, { className: "flex justify-between", children: [
3893
+ /* @__PURE__ */ o(ne, { className: "flex justify-between", children: [
3847
3894
  r && /* @__PURE__ */ n(j, { type: "button", variant: "outline", onClick: r, children: "Back" }),
3848
3895
  /* @__PURE__ */ n(
3849
3896
  j,
3850
3897
  {
3851
3898
  type: "button",
3852
- onClick: C,
3853
- disabled: E <= 0,
3899
+ onClick: A,
3900
+ disabled: _ <= 0,
3854
3901
  children: "Start Test"
3855
3902
  }
3856
3903
  )
@@ -3861,8 +3908,8 @@ Failed to reload test data. Please refresh the page.`);
3861
3908
  onComplete: e,
3862
3909
  onBack: r
3863
3910
  }) => {
3864
- var S, _, oe, Fe;
3865
- const { applicantService: s, baseInformationService: a, config: i } = re(), { identityData: c, provider: l, token: d, isLoading: u, error: g, requestIdentity: p, restartIdentity: m } = er(t), [b, y] = x(null), [f, P] = x(null), [h, N] = x([]), [w, I] = x(!0), [F, L] = x(!1), [R, C] = x(null), [B, z] = x(!1), v = le.useRef(!1), E = Pe({
3911
+ var O, z, R, we;
3912
+ const { applicantService: s, baseInformationService: a, config: i } = se(), { identityData: c, provider: l, token: d, isLoading: u, error: y, requestIdentity: x, restartIdentity: g } = er(t), [b, m] = N(null), [f, k] = N(null), [h, E] = N([]), [v, S] = N(!0), [I, P] = N(!1), [C, A] = N(null), [M, B] = N(!1), Q = ce.useRef(!1), _ = Le({
3866
3913
  defaultValues: {
3867
3914
  street: "",
3868
3915
  streetNumber: "",
@@ -3873,21 +3920,21 @@ Failed to reload test data. Please refresh the page.`);
3873
3920
  phonenumber: ""
3874
3921
  }
3875
3922
  });
3876
- V(() => {
3923
+ Y(() => {
3877
3924
  (async () => {
3878
3925
  try {
3879
- const [D, W] = await Promise.all([
3926
+ const [D, G] = await Promise.all([
3880
3927
  s.getApplicantData(t),
3881
3928
  a.getCountries("", "en")
3882
3929
  ]);
3883
- P(D);
3884
- const H = /* @__PURE__ */ new Set(), ne = W.filter((ue) => {
3885
- const Se = ue.abbreviation3 || ue.abbreviation;
3886
- return !Se || H.has(Se) ? !1 : (H.add(Se), !0);
3930
+ k(D);
3931
+ const V = /* @__PURE__ */ new Set(), ae = G.filter((me) => {
3932
+ const Ae = me.abbreviation3 || me.abbreviation;
3933
+ return !Ae || V.has(Ae) ? !1 : (V.add(Ae), !0);
3887
3934
  });
3888
- N(ne);
3935
+ E(ae);
3889
3936
  const $ = D.applicantRequestData;
3890
- if (E.reset({
3937
+ if (_.reset({
3891
3938
  street: ($ == null ? void 0 : $.street) || "",
3892
3939
  streetNumber: ($ == null ? void 0 : $.streetNumber) || "",
3893
3940
  city: ($ == null ? void 0 : $.city) || "",
@@ -3895,28 +3942,28 @@ Failed to reload test data. Please refresh the page.`);
3895
3942
  country: ($ == null ? void 0 : $.country) || "",
3896
3943
  nationality: ($ == null ? void 0 : $.nationality) || "",
3897
3944
  phonenumber: ($ == null ? void 0 : $.phonenumber) || ""
3898
- }), D.kycRecords && D.kycRecords.length > 0 && D.kycRecords[0].providerTokenObject !== null && !v.current) {
3899
- console.log("[Identity] Found existing identity verification, auto-requesting..."), v.current = !0;
3945
+ }), D.kycRecords && D.kycRecords.length > 0 && D.kycRecords[0].providerTokenObject !== null && !Q.current) {
3946
+ console.log("[Identity] Found existing identity verification, auto-requesting..."), Q.current = !0;
3900
3947
  try {
3901
- await p(), L(!0);
3902
- } catch (ue) {
3903
- console.error("[Identity] Auto-request failed:", ue);
3948
+ await x(), P(!0);
3949
+ } catch (me) {
3950
+ console.error("[Identity] Auto-request failed:", me);
3904
3951
  }
3905
3952
  }
3906
3953
  } catch (D) {
3907
3954
  console.error("Error loading applicant data:", D);
3908
3955
  } finally {
3909
- I(!1);
3956
+ S(!1);
3910
3957
  }
3911
3958
  })();
3912
- }, [t, s, a, E, p]), V(() => {
3913
- c && !F && (console.log("[Identity] Identity data already loaded, showing provider"), L(!0));
3914
- }, [c, F]), V(() => {
3959
+ }, [t]), Y(() => {
3960
+ c && !I && (console.log("[Identity] Identity data already loaded, showing provider"), P(!0));
3961
+ }, [c, I]), Y(() => {
3915
3962
  if (d) {
3916
3963
  if (d.expiresAt) {
3917
- const O = new Date(d.expiresAt).getTime();
3918
- if (Date.now() >= O) {
3919
- console.warn("[Identity] Token has expired (expiresAt)"), z(!0), C("Your verification session has expired. Please restart.");
3964
+ const F = new Date(d.expiresAt).getTime();
3965
+ if (Date.now() >= F) {
3966
+ console.warn("[Identity] Token has expired (expiresAt)"), B(!0), A("Your verification session has expired. Please restart.");
3920
3967
  return;
3921
3968
  }
3922
3969
  }
@@ -3924,112 +3971,112 @@ Failed to reload test data. Please refresh the page.`);
3924
3971
  try {
3925
3972
  const D = new URL(d.url).toString().toLowerCase();
3926
3973
  if (D.includes("expired") || D.includes("invalid") || D.includes("error")) {
3927
- console.warn("[Identity] Token URL indicates expiration"), z(!0), C("Your verification link has expired. Please restart.");
3974
+ console.warn("[Identity] Token URL indicates expiration"), B(!0), A("Your verification link has expired. Please restart.");
3928
3975
  return;
3929
3976
  }
3930
3977
  } catch {
3931
3978
  console.error("[Identity] Invalid token URL");
3932
3979
  }
3933
3980
  if (d.status === "expired" || d.error === "expired" || d.expired === !0) {
3934
- console.warn("[Identity] Token object indicates expiration"), z(!0), C("Your verification session has expired. Please restart.");
3981
+ console.warn("[Identity] Token object indicates expiration"), B(!0), A("Your verification session has expired. Please restart.");
3935
3982
  return;
3936
3983
  }
3937
3984
  }
3938
- }, [d]), V(() => {
3939
- if (l !== null && d && !b && F && !B) {
3940
- const O = l;
3985
+ }, [d]), Y(() => {
3986
+ if (l !== null && d && !b && I && !M) {
3987
+ const F = l;
3941
3988
  if (d.url) {
3942
- console.log("[Identity] Loading provider URL for user verification:", d.url), C(null);
3989
+ console.log("[Identity] Loading provider URL for user verification:", d.url), A(null);
3943
3990
  try {
3944
- if (new URL(d.url), O === se.SardinAI) {
3991
+ if (new URL(d.url), F === ie.SardinAI) {
3945
3992
  console.log("[SardinAI] Initializing Risk SDK in background...");
3946
3993
  try {
3947
- const D = ye.parseProviderConfig(l, d, i);
3948
- ye.createProvider(l, D).initialize().then(() => {
3994
+ const D = fe.parseProviderConfig(l, d, i);
3995
+ fe.createProvider(l, D).initialize().then(() => {
3949
3996
  console.log("[SardinAI] Risk SDK initialized successfully in background");
3950
- }).catch((H) => {
3951
- console.warn("[SardinAI] Risk SDK initialization failed (non-blocking):", H);
3997
+ }).catch((V) => {
3998
+ console.warn("[SardinAI] Risk SDK initialization failed (non-blocking):", V);
3952
3999
  });
3953
4000
  } catch (D) {
3954
4001
  console.warn("[SardinAI] Risk SDK setup failed (non-blocking):", D);
3955
4002
  }
3956
4003
  }
3957
- y({ type: "url", url: d.url });
4004
+ m({ type: "url", url: d.url });
3958
4005
  } catch (D) {
3959
- console.error("[Identity] Invalid URL:", D), C("Invalid verification URL. Please restart."), z(!0);
4006
+ console.error("[Identity] Invalid URL:", D), A("Invalid verification URL. Please restart."), B(!0);
3960
4007
  }
3961
4008
  return;
3962
4009
  }
3963
- if (O === se.SardinAI) {
3964
- console.log("[SardinAI] No URL provided - initializing Risk SDK only..."), C(null);
4010
+ if (F === ie.SardinAI) {
4011
+ console.log("[SardinAI] No URL provided - initializing Risk SDK only..."), A(null);
3965
4012
  try {
3966
- const D = ye.parseProviderConfig(l, d, i), W = ye.createProvider(l, D);
3967
- W.initialize().then(() => {
3968
- console.log("[SardinAI] Risk SDK initialized successfully"), y(W), setTimeout(() => {
4013
+ const D = fe.parseProviderConfig(l, d, i), G = fe.createProvider(l, D);
4014
+ G.initialize().then(() => {
4015
+ console.log("[SardinAI] Risk SDK initialized successfully"), m(G), setTimeout(() => {
3969
4016
  e == null || e();
3970
4017
  }, 2e3);
3971
- }).catch((H) => {
4018
+ }).catch((V) => {
3972
4019
  var $;
3973
- console.error("[SardinAI] Failed to initialize:", H);
3974
- const ne = (($ = H.message) == null ? void 0 : $.toLowerCase()) || "";
3975
- ne.includes("expired") || ne.includes("invalid") || ne.includes("401") || ne.includes("400") ? (z(!0), C("Session expired or invalid. Please restart verification.")) : C(`Failed to initialize: ${H.message}`);
4020
+ console.error("[SardinAI] Failed to initialize:", V);
4021
+ const ae = (($ = V.message) == null ? void 0 : $.toLowerCase()) || "";
4022
+ ae.includes("expired") || ae.includes("invalid") || ae.includes("401") || ae.includes("400") ? (B(!0), A("Session expired or invalid. Please restart verification.")) : A(`Failed to initialize: ${V.message}`);
3976
4023
  });
3977
4024
  } catch (D) {
3978
- console.error("[SardinAI] Error creating provider:", D), C(`Configuration error: ${D.message}`);
4025
+ console.error("[SardinAI] Error creating provider:", D), A(`Configuration error: ${D.message}`);
3979
4026
  }
3980
4027
  return;
3981
4028
  }
3982
4029
  try {
3983
- C(null);
3984
- const D = ye.parseProviderConfig(l, d, i), W = ye.createProvider(l, D);
3985
- O === se.Sumsub ? (W.initialize("identity-container").catch((H) => {
3986
- var ne;
3987
- console.error("[Sumsub] Initialization error:", H), C(`Failed to initialize: ${H.message}`), (ne = H.message) != null && ne.toLowerCase().includes("expired") && z(!0);
3988
- }), W.onComplete && W.onComplete(() => {
4030
+ A(null);
4031
+ const D = fe.parseProviderConfig(l, d, i), G = fe.createProvider(l, D);
4032
+ F === ie.Sumsub ? (G.initialize("identity-container").catch((V) => {
4033
+ var ae;
4034
+ console.error("[Sumsub] Initialization error:", V), A(`Failed to initialize: ${V.message}`), (ae = V.message) != null && ae.toLowerCase().includes("expired") && B(!0);
4035
+ }), G.onComplete && G.onComplete(() => {
3989
4036
  e == null || e();
3990
- })) : O === se.Onfido && W.initialize("identity-container").catch((H) => {
3991
- console.error("[Onfido] Initialization error:", H), C(`Failed to initialize: ${H.message}`);
3992
- }), y(W);
4037
+ })) : F === ie.Onfido && G.initialize("identity-container").catch((V) => {
4038
+ console.error("[Onfido] Initialization error:", V), A(`Failed to initialize: ${V.message}`);
4039
+ }), m(G);
3993
4040
  } catch (D) {
3994
- console.error("[Identity] Provider setup error:", D), C(`Setup error: ${D.message}`);
4041
+ console.error("[Identity] Provider setup error:", D), A(`Setup error: ${D.message}`);
3995
4042
  }
3996
4043
  }
3997
4044
  return () => {
3998
4045
  if (b && b.destroy)
3999
4046
  try {
4000
4047
  b.destroy();
4001
- } catch (O) {
4002
- console.error("[Identity] Error destroying provider:", O);
4048
+ } catch (F) {
4049
+ console.error("[Identity] Error destroying provider:", F);
4003
4050
  }
4004
4051
  };
4005
- }, [l, d, b, F, e, B]);
4006
- const A = async () => {
4052
+ }, [l, d, b, I, e, M]);
4053
+ const p = async () => {
4007
4054
  try {
4008
- C(null), z(!1), await p(), L(!0);
4009
- } catch (O) {
4010
- console.error("Error starting identity verification:", O);
4055
+ A(null), B(!1), await x(), P(!0);
4056
+ } catch (F) {
4057
+ console.error("Error starting identity verification:", F);
4011
4058
  }
4012
- }, k = async () => {
4059
+ }, w = async () => {
4013
4060
  try {
4014
- C(null), z(!1), y(null), console.log("[Identity] Restarting verification..."), await m(), L(!0);
4015
- } catch (O) {
4016
- console.error("Error restarting identity verification:", O), C(O.message || "Failed to restart verification");
4061
+ A(null), B(!1), m(null), console.log("[Identity] Restarting verification..."), await g(), P(!0);
4062
+ } catch (F) {
4063
+ console.error("Error restarting identity verification:", F), A(F.message || "Failed to restart verification");
4017
4064
  }
4018
4065
  };
4019
- if (w || u)
4020
- return /* @__PURE__ */ n(T, { children: /* @__PURE__ */ o(M, { children: [
4021
- /* @__PURE__ */ n(ie, { className: "my-8" }),
4066
+ if (v || u)
4067
+ return /* @__PURE__ */ n(L, { children: /* @__PURE__ */ o(T, { children: [
4068
+ /* @__PURE__ */ n(le, { className: "my-8" }),
4022
4069
  /* @__PURE__ */ n("p", { className: "text-center text-gray-600 dark:text-gray-400 mt-4", children: "Loading identity verification..." })
4023
4070
  ] }) });
4024
- if (g)
4025
- return /* @__PURE__ */ n(T, { children: /* @__PURE__ */ n(M, { children: /* @__PURE__ */ o("p", { className: "text-danger-500", children: [
4071
+ if (y)
4072
+ return /* @__PURE__ */ n(L, { children: /* @__PURE__ */ n(T, { children: /* @__PURE__ */ o("p", { className: "text-danger-500", children: [
4026
4073
  "Error: ",
4027
- g.message
4074
+ y.message
4028
4075
  ] }) }) });
4029
- if (F && (R || B))
4030
- return /* @__PURE__ */ o(T, { children: [
4031
- /* @__PURE__ */ n(J, { children: /* @__PURE__ */ n("h2", { className: "text-2xl font-bold text-gray-900 dark:text-white", children: "Verification Session Issue" }) }),
4032
- /* @__PURE__ */ o(M, { children: [
4076
+ if (I && (C || M))
4077
+ return /* @__PURE__ */ o(L, { children: [
4078
+ /* @__PURE__ */ n(ee, { children: /* @__PURE__ */ n("h2", { className: "text-2xl font-bold text-gray-900 dark:text-white", children: "Verification Session Issue" }) }),
4079
+ /* @__PURE__ */ o(T, { children: [
4033
4080
  /* @__PURE__ */ n("div", { className: "p-4 bg-red-50 dark:bg-red-900/20 border border-red-200 dark:border-red-800 rounded-lg mb-6", children: /* @__PURE__ */ o("div", { className: "flex items-start", children: [
4034
4081
  /* @__PURE__ */ n(
4035
4082
  "svg",
@@ -4050,8 +4097,8 @@ Failed to reload test data. Please refresh the page.`);
4050
4097
  }
4051
4098
  ),
4052
4099
  /* @__PURE__ */ o("div", { children: [
4053
- /* @__PURE__ */ n("h3", { className: "font-semibold text-red-900 dark:text-red-100 mb-1", children: B ? "Session Expired" : "Verification Error" }),
4054
- /* @__PURE__ */ n("p", { className: "text-red-800 dark:text-red-200 text-sm", children: R || "Your verification session has expired and needs to be restarted." })
4100
+ /* @__PURE__ */ n("h3", { className: "font-semibold text-red-900 dark:text-red-100 mb-1", children: M ? "Session Expired" : "Verification Error" }),
4101
+ /* @__PURE__ */ n("p", { className: "text-red-800 dark:text-red-200 text-sm", children: C || "Your verification session has expired and needs to be restarted." })
4055
4102
  ] })
4056
4103
  ] }) }),
4057
4104
  /* @__PURE__ */ o("div", { className: "bg-blue-50 dark:bg-blue-900/20 border border-blue-200 dark:border-blue-800 rounded-lg p-4", children: [
@@ -4063,15 +4110,15 @@ Failed to reload test data. Please refresh the page.`);
4063
4110
  ] })
4064
4111
  ] })
4065
4112
  ] }),
4066
- /* @__PURE__ */ o(te, { className: "flex justify-between", children: [
4113
+ /* @__PURE__ */ o(ne, { className: "flex justify-between", children: [
4067
4114
  r && /* @__PURE__ */ n(j, { type: "button", variant: "outline", onClick: r, children: "Back" }),
4068
- /* @__PURE__ */ n(j, { type: "button", onClick: k, disabled: u, children: u ? "Restarting..." : "Restart Verification" })
4115
+ /* @__PURE__ */ n(j, { type: "button", onClick: w, disabled: u, children: u ? "Restarting..." : "Restart Verification" })
4069
4116
  ] })
4070
4117
  ] });
4071
- if (F && c) {
4072
- const O = l;
4073
- return d != null && d.url ? /* @__PURE__ */ o(T, { children: [
4074
- /* @__PURE__ */ n(J, { children: /* @__PURE__ */ o("div", { className: "flex items-center justify-between", children: [
4118
+ if (I && c) {
4119
+ const F = l;
4120
+ return d != null && d.url ? /* @__PURE__ */ o(L, { children: [
4121
+ /* @__PURE__ */ n(ee, { children: /* @__PURE__ */ o("div", { className: "flex items-center justify-between", children: [
4075
4122
  /* @__PURE__ */ o("div", { children: [
4076
4123
  /* @__PURE__ */ n("h2", { className: "text-2xl font-bold", children: "Identity Verification" }),
4077
4124
  /* @__PURE__ */ n("p", { className: "text-gray-600 dark:text-gray-400 mt-1", children: "Please complete the identity verification process" })
@@ -4082,13 +4129,13 @@ Failed to reload test data. Please refresh the page.`);
4082
4129
  type: "button",
4083
4130
  variant: "outline",
4084
4131
  size: "sm",
4085
- onClick: k,
4132
+ onClick: w,
4086
4133
  disabled: u,
4087
4134
  children: "Restart"
4088
4135
  }
4089
4136
  )
4090
4137
  ] }) }),
4091
- /* @__PURE__ */ o(M, { children: [
4138
+ /* @__PURE__ */ o(T, { children: [
4092
4139
  /* @__PURE__ */ n("div", { className: "mb-4 p-3 bg-yellow-50 dark:bg-yellow-900/20 border border-yellow-200 dark:border-yellow-800 rounded-lg", children: /* @__PURE__ */ o("p", { className: "text-yellow-800 dark:text-yellow-200 text-sm", children: [
4093
4140
  /* @__PURE__ */ n("strong", { children: "Important:" }),
4094
4141
  ' If you see an "expired" or "invalid link" message below, click the "Restart" button above to generate a new verification session.'
@@ -4101,13 +4148,13 @@ Failed to reload test data. Please refresh the page.`);
4101
4148
  allow: "camera; microphone; geolocation",
4102
4149
  title: "Identity Verification",
4103
4150
  onLoad: (D) => {
4104
- var W, H, ne;
4151
+ var G, V, ae;
4105
4152
  console.log("[Identity] Iframe loaded");
4106
4153
  try {
4107
- const $ = D.target, Ne = $.contentDocument || ((W = $.contentWindow) == null ? void 0 : W.document);
4108
- if (Ne) {
4109
- const ue = ((ne = (H = Ne.body) == null ? void 0 : H.textContent) == null ? void 0 : ne.toLowerCase()) || "";
4110
- (ue.includes("expired") || ue.includes("invalid") || ue.includes("error")) && (console.warn("[Identity] Iframe shows expiration message"), z(!0), C("Your verification link has expired."));
4154
+ const $ = D.target, Ce = $.contentDocument || ((G = $.contentWindow) == null ? void 0 : G.document);
4155
+ if (Ce) {
4156
+ const me = ((ae = (V = Ce.body) == null ? void 0 : V.textContent) == null ? void 0 : ae.toLowerCase()) || "";
4157
+ (me.includes("expired") || me.includes("invalid") || me.includes("error")) && (console.warn("[Identity] Iframe shows expiration message"), B(!0), A("Your verification link has expired."));
4111
4158
  }
4112
4159
  } catch {
4113
4160
  console.log("[Identity] Cannot check iframe content (CORS)");
@@ -4116,62 +4163,62 @@ Failed to reload test data. Please refresh the page.`);
4116
4163
  }
4117
4164
  ) })
4118
4165
  ] }),
4119
- r && /* @__PURE__ */ n(te, { children: /* @__PURE__ */ n(j, { variant: "outline", onClick: r, children: "Back" }) })
4120
- ] }) : O === se.SardinAI ? /* @__PURE__ */ o(T, { children: [
4121
- /* @__PURE__ */ o(J, { children: [
4166
+ r && /* @__PURE__ */ n(ne, { children: /* @__PURE__ */ n(j, { variant: "outline", onClick: r, children: "Back" }) })
4167
+ ] }) : F === ie.SardinAI ? /* @__PURE__ */ o(L, { children: [
4168
+ /* @__PURE__ */ o(ee, { children: [
4122
4169
  /* @__PURE__ */ n("h2", { className: "text-2xl font-bold", children: "Device Risk Assessment" }),
4123
4170
  /* @__PURE__ */ n("p", { className: "text-gray-600 dark:text-gray-400 mt-1", children: "Analyzing device security and behavioral patterns..." })
4124
4171
  ] }),
4125
- /* @__PURE__ */ n(M, { children: /* @__PURE__ */ o("div", { className: "text-center py-12", children: [
4126
- /* @__PURE__ */ n(ie, { className: "mb-4" }),
4172
+ /* @__PURE__ */ n(T, { children: /* @__PURE__ */ o("div", { className: "text-center py-12", children: [
4173
+ /* @__PURE__ */ n(le, { className: "mb-4" }),
4127
4174
  /* @__PURE__ */ n("p", { className: "text-gray-600 dark:text-gray-400", children: "Please wait while we verify your device security" }),
4128
4175
  /* @__PURE__ */ n("p", { className: "text-sm text-gray-500 dark:text-gray-500 mt-2", children: "This process is automatic and will complete in a few seconds" })
4129
4176
  ] }) })
4130
- ] }) : /* @__PURE__ */ o(T, { children: [
4131
- /* @__PURE__ */ o(J, { children: [
4177
+ ] }) : /* @__PURE__ */ o(L, { children: [
4178
+ /* @__PURE__ */ o(ee, { children: [
4132
4179
  /* @__PURE__ */ n("h2", { className: "text-2xl font-bold", children: "Identity Verification" }),
4133
4180
  /* @__PURE__ */ n("p", { className: "text-gray-600 dark:text-gray-400 mt-1", children: "Please complete the identity verification process" })
4134
4181
  ] }),
4135
- /* @__PURE__ */ n(M, { children: /* @__PURE__ */ n("div", { id: "identity-container", className: "min-h-[400px]" }) }),
4136
- r && /* @__PURE__ */ n(te, { children: /* @__PURE__ */ n(j, { variant: "outline", onClick: r, children: "Back" }) })
4182
+ /* @__PURE__ */ n(T, { children: /* @__PURE__ */ n("div", { id: "identity-container", className: "min-h-[400px]" }) }),
4183
+ r && /* @__PURE__ */ n(ne, { children: /* @__PURE__ */ n(j, { variant: "outline", onClick: r, children: "Back" }) })
4137
4184
  ] });
4138
4185
  }
4139
- return /* @__PURE__ */ n("form", { onSubmit: E.handleSubmit(A), children: /* @__PURE__ */ o(T, { children: [
4140
- /* @__PURE__ */ o(J, { children: [
4186
+ return /* @__PURE__ */ n("form", { onSubmit: _.handleSubmit(p), children: /* @__PURE__ */ o(L, { children: [
4187
+ /* @__PURE__ */ o(ee, { children: [
4141
4188
  /* @__PURE__ */ n("h2", { className: "text-2xl font-bold", children: "Review Your Information" }),
4142
4189
  /* @__PURE__ */ n("p", { className: "text-gray-600 dark:text-gray-400 mt-1", children: "Please review and confirm your information before starting identity verification" })
4143
4190
  ] }),
4144
- /* @__PURE__ */ o(M, { className: "space-y-6", children: [
4191
+ /* @__PURE__ */ o(T, { className: "space-y-6", children: [
4145
4192
  /* @__PURE__ */ o("div", { className: "space-y-4 pb-4 border-b border-gray-200 dark:border-gray-700", children: [
4146
4193
  /* @__PURE__ */ o("div", { children: [
4147
4194
  /* @__PURE__ */ n("label", { className: "block text-sm font-medium text-gray-500 dark:text-gray-400", children: "Name" }),
4148
4195
  /* @__PURE__ */ o("p", { className: "mt-1 text-base", children: [
4149
- (S = f == null ? void 0 : f.applicantRequestData) == null ? void 0 : S.firstName,
4196
+ (O = f == null ? void 0 : f.applicantRequestData) == null ? void 0 : O.firstName,
4150
4197
  " ",
4151
- (_ = f == null ? void 0 : f.applicantRequestData) == null ? void 0 : _.lastName
4198
+ (z = f == null ? void 0 : f.applicantRequestData) == null ? void 0 : z.lastName
4152
4199
  ] })
4153
4200
  ] }),
4154
4201
  /* @__PURE__ */ o("div", { children: [
4155
4202
  /* @__PURE__ */ n("label", { className: "block text-sm font-medium text-gray-500 dark:text-gray-400", children: "Email" }),
4156
- /* @__PURE__ */ n("p", { className: "mt-1 text-base", children: (oe = f == null ? void 0 : f.applicantRequestData) == null ? void 0 : oe.email })
4203
+ /* @__PURE__ */ n("p", { className: "mt-1 text-base", children: (R = f == null ? void 0 : f.applicantRequestData) == null ? void 0 : R.email })
4157
4204
  ] }),
4158
4205
  /* @__PURE__ */ o("div", { children: [
4159
4206
  /* @__PURE__ */ n("label", { className: "block text-sm font-medium text-gray-500 dark:text-gray-400", children: "Date of Birth" }),
4160
- /* @__PURE__ */ n("p", { className: "mt-1 text-base", children: ((Fe = f == null ? void 0 : f.applicantRequestData) == null ? void 0 : Fe.dateOfBirth) || "Not provided" })
4207
+ /* @__PURE__ */ n("p", { className: "mt-1 text-base", children: ((we = f == null ? void 0 : f.applicantRequestData) == null ? void 0 : we.dateOfBirth) || "Not provided" })
4161
4208
  ] })
4162
4209
  ] }),
4163
4210
  /* @__PURE__ */ o("div", { className: "space-y-4", children: [
4164
4211
  /* @__PURE__ */ n("h3", { className: "text-lg font-semibold", children: "Address Information" }),
4165
4212
  /* @__PURE__ */ o("div", { className: "grid grid-cols-1 md:grid-cols-2 gap-4", children: [
4166
4213
  /* @__PURE__ */ n(
4167
- G,
4214
+ J,
4168
4215
  {
4169
- control: E.control,
4216
+ control: _.control,
4170
4217
  name: "country",
4171
- render: ({ field: O }) => /* @__PURE__ */ n(
4172
- ge,
4218
+ render: ({ field: F }) => /* @__PURE__ */ n(
4219
+ ye,
4173
4220
  {
4174
- ...O,
4221
+ ...F,
4175
4222
  label: "Country",
4176
4223
  options: [
4177
4224
  { value: "", label: "Select country..." },
@@ -4185,14 +4232,14 @@ Failed to reload test data. Please refresh the page.`);
4185
4232
  }
4186
4233
  ),
4187
4234
  /* @__PURE__ */ n(
4188
- G,
4235
+ J,
4189
4236
  {
4190
- control: E.control,
4237
+ control: _.control,
4191
4238
  name: "nationality",
4192
- render: ({ field: O }) => /* @__PURE__ */ n(
4193
- ge,
4239
+ render: ({ field: F }) => /* @__PURE__ */ n(
4240
+ ye,
4194
4241
  {
4195
- ...O,
4242
+ ...F,
4196
4243
  label: "Nationality",
4197
4244
  options: [
4198
4245
  { value: "", label: "Select nationality..." },
@@ -4208,56 +4255,56 @@ Failed to reload test data. Please refresh the page.`);
4208
4255
  ] }),
4209
4256
  /* @__PURE__ */ o("div", { className: "grid grid-cols-1 md:grid-cols-2 gap-4", children: [
4210
4257
  /* @__PURE__ */ n(
4211
- G,
4258
+ J,
4212
4259
  {
4213
- control: E.control,
4260
+ control: _.control,
4214
4261
  name: "street",
4215
- render: ({ field: O }) => /* @__PURE__ */ n(Z, { ...O, label: "Street" })
4262
+ render: ({ field: F }) => /* @__PURE__ */ n(X, { ...F, label: "Street" })
4216
4263
  }
4217
4264
  ),
4218
4265
  /* @__PURE__ */ n(
4219
- G,
4266
+ J,
4220
4267
  {
4221
- control: E.control,
4268
+ control: _.control,
4222
4269
  name: "streetNumber",
4223
- render: ({ field: O }) => /* @__PURE__ */ n(Z, { ...O, label: "Street Number" })
4270
+ render: ({ field: F }) => /* @__PURE__ */ n(X, { ...F, label: "Street Number" })
4224
4271
  }
4225
4272
  )
4226
4273
  ] }),
4227
4274
  /* @__PURE__ */ o("div", { className: "grid grid-cols-1 md:grid-cols-2 gap-4", children: [
4228
4275
  /* @__PURE__ */ n(
4229
- G,
4276
+ J,
4230
4277
  {
4231
- control: E.control,
4278
+ control: _.control,
4232
4279
  name: "city",
4233
- render: ({ field: O }) => /* @__PURE__ */ n(Z, { ...O, label: "City" })
4280
+ render: ({ field: F }) => /* @__PURE__ */ n(X, { ...F, label: "City" })
4234
4281
  }
4235
4282
  ),
4236
4283
  /* @__PURE__ */ n(
4237
- G,
4284
+ J,
4238
4285
  {
4239
- control: E.control,
4286
+ control: _.control,
4240
4287
  name: "zip",
4241
- render: ({ field: O }) => /* @__PURE__ */ n(Z, { ...O, label: "ZIP/Postal Code" })
4288
+ render: ({ field: F }) => /* @__PURE__ */ n(X, { ...F, label: "ZIP/Postal Code" })
4242
4289
  }
4243
4290
  )
4244
4291
  ] }),
4245
4292
  /* @__PURE__ */ n(
4246
- G,
4293
+ J,
4247
4294
  {
4248
- control: E.control,
4295
+ control: _.control,
4249
4296
  name: "phonenumber",
4250
- render: ({ field: O }) => /* @__PURE__ */ n(Z, { ...O, label: "Phone Number", type: "tel" })
4297
+ render: ({ field: F }) => /* @__PURE__ */ n(X, { ...F, label: "Phone Number", type: "tel" })
4251
4298
  }
4252
4299
  )
4253
4300
  ] })
4254
4301
  ] }),
4255
- /* @__PURE__ */ o(te, { className: "flex justify-between", children: [
4302
+ /* @__PURE__ */ o(ne, { className: "flex justify-between", children: [
4256
4303
  r && /* @__PURE__ */ n(j, { type: "button", variant: "outline", onClick: r, children: "Back" }),
4257
4304
  /* @__PURE__ */ n(j, { type: "submit", isLoading: u, children: "Confirm and Start Verification" })
4258
4305
  ] })
4259
4306
  ] }) });
4260
- }, ze = ({
4307
+ }, $e = ({
4261
4308
  kycStatus: t,
4262
4309
  reviewStatus: e,
4263
4310
  workflowResult: r,
@@ -4265,63 +4312,63 @@ Failed to reload test data. Please refresh the page.`);
4265
4312
  onContinue: a,
4266
4313
  onContactSupport: i
4267
4314
  }) => {
4268
- const l = t === he.Approved ? {
4315
+ const l = t === pe.Approved ? {
4269
4316
  type: "success",
4270
4317
  title: "Verification Approved",
4271
4318
  icon: "✓",
4272
4319
  iconBg: "bg-green-100 dark:bg-green-900/30",
4273
4320
  iconColor: "text-green-600 dark:text-green-400",
4274
4321
  message: "Your identity verification has been successfully approved."
4275
- } : t === he.Rejected ? {
4322
+ } : t === pe.Rejected ? {
4276
4323
  type: "error",
4277
4324
  title: "Verification Rejected",
4278
4325
  icon: "✕",
4279
4326
  iconBg: "bg-red-100 dark:bg-red-900/30",
4280
4327
  iconColor: "text-red-600 dark:text-red-400",
4281
4328
  message: "Unfortunately, your identity verification was not approved."
4282
- } : t === he.Pending || t === he.InProgress ? {
4329
+ } : t === pe.Pending || t === pe.InProgress ? {
4283
4330
  type: "pending",
4284
4331
  title: "Verification Pending",
4285
4332
  icon: "⏱",
4286
4333
  iconBg: "bg-blue-100 dark:bg-blue-900/30",
4287
4334
  iconColor: "text-blue-600 dark:text-blue-400",
4288
4335
  message: "Your identity verification is currently being processed."
4289
- } : e === pe.Approved ? {
4336
+ } : e === ge.Approved ? {
4290
4337
  type: "success",
4291
4338
  title: "Application Approved",
4292
4339
  icon: "✓",
4293
4340
  iconBg: "bg-green-100 dark:bg-green-900/30",
4294
4341
  iconColor: "text-green-600 dark:text-green-400",
4295
4342
  message: "Your application has been approved."
4296
- } : e === pe.Reject ? {
4343
+ } : e === ge.Reject ? {
4297
4344
  type: "error",
4298
4345
  title: "Application Rejected",
4299
4346
  icon: "✕",
4300
4347
  iconBg: "bg-red-100 dark:bg-red-900/30",
4301
4348
  iconColor: "text-red-600 dark:text-red-400",
4302
4349
  message: "Your application has been rejected."
4303
- } : e === pe.UnderReview || e === pe.AdminReview ? {
4350
+ } : e === ge.UnderReview || e === ge.AdminReview ? {
4304
4351
  type: "pending",
4305
4352
  title: "Under Review",
4306
4353
  icon: "📋",
4307
4354
  iconBg: "bg-yellow-100 dark:bg-yellow-900/30",
4308
4355
  iconColor: "text-yellow-700 dark:text-yellow-400",
4309
4356
  message: "Your application is currently under manual review."
4310
- } : r === we.Success ? {
4357
+ } : r === Ne.Success ? {
4311
4358
  type: "success",
4312
4359
  title: "Process Complete",
4313
4360
  icon: "✓",
4314
4361
  iconBg: "bg-green-100 dark:bg-green-900/30",
4315
4362
  iconColor: "text-green-600 dark:text-green-400",
4316
4363
  message: "Your verification process has been completed successfully."
4317
- } : r === we.Failed ? {
4364
+ } : r === Ne.Failed ? {
4318
4365
  type: "error",
4319
4366
  title: "Process Failed",
4320
4367
  icon: "✕",
4321
4368
  iconBg: "bg-red-100 dark:bg-red-900/30",
4322
4369
  iconColor: "text-red-600 dark:text-red-400",
4323
4370
  message: "The verification process could not be completed."
4324
- } : r === we.AdminReview ? {
4371
+ } : r === Ne.AdminReview ? {
4325
4372
  type: "pending",
4326
4373
  title: "Admin Review Required",
4327
4374
  icon: "📋",
@@ -4336,8 +4383,8 @@ Failed to reload test data. Please refresh the page.`);
4336
4383
  iconColor: "text-blue-600 dark:text-blue-400",
4337
4384
  message: "Your application is being reviewed."
4338
4385
  };
4339
- return /* @__PURE__ */ o(T, { children: [
4340
- /* @__PURE__ */ o(M, { className: "py-12", children: [
4386
+ return /* @__PURE__ */ o(L, { children: [
4387
+ /* @__PURE__ */ o(T, { className: "py-12", children: [
4341
4388
  /* @__PURE__ */ n("div", { className: "flex justify-center mb-6", children: /* @__PURE__ */ n(
4342
4389
  "div",
4343
4390
  {
@@ -4347,10 +4394,10 @@ Failed to reload test data. Please refresh the page.`);
4347
4394
  ) }),
4348
4395
  /* @__PURE__ */ n("h2", { className: "text-3xl font-bold text-center text-gray-900 dark:text-white mb-4", children: l.title }),
4349
4396
  /* @__PURE__ */ n("div", { className: "flex justify-center mb-6", children: /* @__PURE__ */ n(
4350
- me,
4397
+ he,
4351
4398
  {
4352
4399
  variant: l.type === "success" ? "success" : l.type === "error" ? "danger" : l.type === "pending" ? "warning" : "info",
4353
- children: t != null ? he[t] : pe[e]
4400
+ children: t != null ? pe[t] : ge[e]
4354
4401
  }
4355
4402
  ) }),
4356
4403
  /* @__PURE__ */ n("p", { className: "text-center text-gray-600 dark:text-gray-400 mb-6 max-w-md mx-auto", children: s || l.message }),
@@ -4382,15 +4429,15 @@ Failed to reload test data. Please refresh the page.`);
4382
4429
  /* @__PURE__ */ n("div", { className: "mt-6 pt-6 border-t border-gray-200 dark:border-gray-700", children: /* @__PURE__ */ o("div", { className: "grid grid-cols-2 gap-4 text-sm", children: [
4383
4430
  /* @__PURE__ */ o("div", { children: [
4384
4431
  /* @__PURE__ */ n("span", { className: "text-gray-500 dark:text-gray-400", children: "KYC Status:" }),
4385
- /* @__PURE__ */ n("div", { className: "font-medium text-gray-900 dark:text-white mt-1", children: t != null ? he[t] : "Not Available" })
4432
+ /* @__PURE__ */ n("div", { className: "font-medium text-gray-900 dark:text-white mt-1", children: t != null ? pe[t] : "Not Available" })
4386
4433
  ] }),
4387
4434
  /* @__PURE__ */ o("div", { children: [
4388
4435
  /* @__PURE__ */ n("span", { className: "text-gray-500 dark:text-gray-400", children: "Review Status:" }),
4389
- /* @__PURE__ */ n("div", { className: "font-medium text-gray-900 dark:text-white mt-1", children: pe[e] })
4436
+ /* @__PURE__ */ n("div", { className: "font-medium text-gray-900 dark:text-white mt-1", children: ge[e] })
4390
4437
  ] })
4391
4438
  ] }) })
4392
4439
  ] }),
4393
- /* @__PURE__ */ o(te, { className: "flex justify-center gap-4", children: [
4440
+ /* @__PURE__ */ o(ne, { className: "flex justify-center gap-4", children: [
4394
4441
  l.type === "success" && a && /* @__PURE__ */ n(j, { onClick: a, size: "lg", children: "Continue" }),
4395
4442
  l.type === "error" && /* @__PURE__ */ o(nt, { children: [
4396
4443
  i && /* @__PURE__ */ n(j, { variant: "outline", onClick: i, children: "Contact Support" }),
@@ -4419,7 +4466,7 @@ Failed to reload test data. Please refresh the page.`);
4419
4466
  subtitle: e,
4420
4467
  className: r = ""
4421
4468
  }) => {
4422
- const { currentTheme: s } = re(), a = t || (s == null ? void 0 : s.title) || "KYC Verification";
4469
+ const { currentTheme: s } = se(), a = t || (s == null ? void 0 : s.title) || "KYC Verification";
4423
4470
  return /* @__PURE__ */ o("div", { className: `metakyc-header ${r}`, children: [
4424
4471
  (s == null ? void 0 : s.logo) && s.logo.visible && /* @__PURE__ */ n("div", { className: "mb-3", children: /* @__PURE__ */ n(Er, { config: s.logo }) }),
4425
4472
  /* @__PURE__ */ o("div", { children: [
@@ -4433,21 +4480,21 @@ Failed to reload test data. Please refresh the page.`);
4433
4480
  onSuccess: r,
4434
4481
  onCancel: s
4435
4482
  }) => {
4436
- var C, B, z;
4437
- const { config: a, baseInformationService: i } = re(), { createApplicant: c, isLoading: l } = rr(), [d, u] = x([]), [g, p] = x(!0), [m, b] = x(!1), [y, f] = x(null), P = t || ((C = a.applicantForm) == null ? void 0 : C.workflowKey);
4438
- if (!P)
4483
+ var B, Q, _;
4484
+ const { config: a, baseInformationService: i } = se(), { createApplicant: c, isLoading: l } = rr(), [d, u] = N([]), [y, x] = N(!0), [g, b] = N(!1), [m, f] = N(null), k = H(!1), h = H(!1), E = t || ((B = a.applicantForm) == null ? void 0 : B.workflowKey);
4485
+ if (!E)
4439
4486
  throw new Error(
4440
4487
  "workflowKey is required. Provide it either as a prop to CreateApplicantForm or set it in config.applicantForm.workflowKey"
4441
4488
  );
4442
- const h = e || ((B = a.applicantForm) == null ? void 0 : B.externalRefId) || "", N = ((z = a.applicantForm) == null ? void 0 : z.visibleFields) || gt, [w, I] = x({
4443
- workflowKey: P,
4489
+ const v = e || ((Q = a.applicantForm) == null ? void 0 : Q.externalRefId) || "", S = ((_ = a.applicantForm) == null ? void 0 : _.visibleFields) || gt, [I, P] = N({
4490
+ workflowKey: E,
4444
4491
  firstName: "",
4445
4492
  lastName: "",
4446
4493
  title: "",
4447
4494
  email: "",
4448
4495
  dateOfBirth: "",
4449
4496
  phonenumber: "",
4450
- externalRefId: h,
4497
+ externalRefId: v,
4451
4498
  // Set from config or prop
4452
4499
  mobileCountryCode: "",
4453
4500
  street: "",
@@ -4466,170 +4513,174 @@ Failed to reload test data. Please refresh the page.`);
4466
4513
  occupation: "",
4467
4514
  taxNumber: ""
4468
4515
  });
4469
- V(() => {
4516
+ Y(() => {
4470
4517
  (async () => {
4518
+ if (k.current || h.current) {
4519
+ console.log("[CreateApplicant] Countries already loading or loaded, skipping...");
4520
+ return;
4521
+ }
4522
+ k.current = !0, x(!0);
4471
4523
  try {
4472
- p(!0);
4473
- const E = await i.getCountries("", a.locale || "en"), A = /* @__PURE__ */ new Set(), k = E.map((S) => ({
4474
- value: S.abbreviation3 || S.abbreviation,
4475
- label: S.name
4476
- })).filter((S) => !S.value || A.has(S.value) ? !1 : (A.add(S.value), !0));
4477
- u(k);
4478
- } catch (E) {
4479
- console.error("Failed to load countries:", E);
4524
+ const w = await i.getCountries("", a.locale || "en"), O = /* @__PURE__ */ new Set(), z = w.map((R) => ({
4525
+ value: R.abbreviation3 || R.abbreviation,
4526
+ label: R.name
4527
+ })).filter((R) => !R.value || O.has(R.value) ? !1 : (O.add(R.value), !0));
4528
+ u(z), h.current = !0;
4529
+ } catch (w) {
4530
+ console.error("Failed to load countries:", w);
4480
4531
  } finally {
4481
- p(!1);
4532
+ x(!1), k.current = !1;
4482
4533
  }
4483
4534
  })();
4484
- }, [i, a.locale]);
4485
- const F = (v, E) => {
4486
- I((A) => ({ ...A, [v]: E }));
4487
- }, L = async (v) => {
4488
- v.preventDefault(), b(!0), f(null);
4535
+ }, []);
4536
+ const C = (p, w) => {
4537
+ P((O) => ({ ...O, [p]: w }));
4538
+ }, A = async (p) => {
4539
+ p.preventDefault(), b(!0), f(null);
4489
4540
  try {
4490
- if (!w.externalRefId || w.externalRefId.trim() === "") {
4541
+ if (!I.externalRefId || I.externalRefId.trim() === "") {
4491
4542
  f("External Reference ID is required and cannot be empty"), b(!1);
4492
4543
  return;
4493
4544
  }
4494
- const E = {
4495
- workflowKey: w.workflowKey,
4496
- externalRefId: w.externalRefId.trim()
4545
+ const w = {
4546
+ workflowKey: I.workflowKey,
4547
+ externalRefId: I.externalRefId.trim()
4497
4548
  // Always include, never empty
4498
4549
  };
4499
- N.forEach((k) => {
4500
- if (k === "externalRefId") return;
4501
- const S = w[k];
4502
- S != null && S !== "" && !(Array.isArray(S) && S.length === 0) && (E[k] = S);
4503
- }), console.log("Creating applicant with data:", E);
4504
- const A = await c(
4505
- E
4550
+ S.forEach((z) => {
4551
+ if (z === "externalRefId") return;
4552
+ const R = I[z];
4553
+ R != null && R !== "" && !(Array.isArray(R) && R.length === 0) && (w[z] = R);
4554
+ }), console.log("Creating applicant with data:", w);
4555
+ const O = await c(
4556
+ w
4506
4557
  );
4507
- console.log("Applicant created:", A), r(A.applicantId);
4508
- } catch (E) {
4509
- console.error("Error creating applicant:", E), f(E.message || "Failed to create applicant");
4558
+ console.log("Applicant created:", O), r(O.applicantId);
4559
+ } catch (w) {
4560
+ console.error("Error creating applicant:", w), f(w.message || "Failed to create applicant");
4510
4561
  } finally {
4511
4562
  b(!1);
4512
4563
  }
4513
- }, R = (v) => {
4514
- var A, k;
4515
- const E = yt[v];
4516
- switch (E.type) {
4564
+ }, M = (p) => {
4565
+ var O, z;
4566
+ const w = yt[p];
4567
+ switch (w.type) {
4517
4568
  case "select":
4518
- return v === "country" || v === "nationality" || v === "taxCountry" || v === "countryOfBirth" ? /* @__PURE__ */ n(
4519
- ge,
4569
+ return p === "country" || p === "nationality" || p === "taxCountry" || p === "countryOfBirth" ? /* @__PURE__ */ n(
4570
+ ye,
4520
4571
  {
4521
- label: E.label,
4522
- value: w[v] || "",
4523
- onChange: (S) => F(v, S.target.value),
4572
+ label: w.label,
4573
+ value: I[p] || "",
4574
+ onChange: (R) => C(p, R.target.value),
4524
4575
  options: [
4525
- { value: "", label: `Select ${E.label.toLowerCase()}...` },
4576
+ { value: "", label: `Select ${w.label.toLowerCase()}...` },
4526
4577
  ...d
4527
4578
  ],
4528
- disabled: g
4579
+ disabled: y
4529
4580
  },
4530
- v
4531
- ) : v === "salutation" ? /* @__PURE__ */ n(
4532
- ge,
4581
+ p
4582
+ ) : p === "salutation" ? /* @__PURE__ */ n(
4583
+ ye,
4533
4584
  {
4534
- label: E.label,
4535
- value: ((A = w[v]) == null ? void 0 : A.toString()) || "",
4536
- onChange: (S) => F(v, S.target.value ? Number(S.target.value) : null),
4585
+ label: w.label,
4586
+ value: ((O = I[p]) == null ? void 0 : O.toString()) || "",
4587
+ onChange: (R) => C(p, R.target.value ? Number(R.target.value) : null),
4537
4588
  options: [
4538
4589
  { value: "", label: "Select salutation..." },
4539
- { value: ke.Male.toString(), label: "Male" },
4540
- { value: ke.Female.toString(), label: "Female" },
4541
- { value: ke.Other.toString(), label: "Other" }
4590
+ { value: Se.Male.toString(), label: "Male" },
4591
+ { value: Se.Female.toString(), label: "Female" },
4592
+ { value: Se.Other.toString(), label: "Other" }
4542
4593
  ]
4543
4594
  },
4544
- v
4595
+ p
4545
4596
  ) : null;
4546
4597
  case "multiselect":
4547
- return v === "otherNationality" ? /* @__PURE__ */ n(
4548
- Z,
4598
+ return p === "otherNationality" ? /* @__PURE__ */ n(
4599
+ X,
4549
4600
  {
4550
4601
  type: "text",
4551
- label: E.label,
4552
- value: ((k = w[v]) == null ? void 0 : k.join(", ")) || "",
4553
- onChange: (S) => {
4554
- const _ = S.target.value.split(",").map((oe) => oe.trim()).filter(Boolean);
4555
- F(v, _);
4602
+ label: w.label,
4603
+ value: ((z = I[p]) == null ? void 0 : z.join(", ")) || "",
4604
+ onChange: (R) => {
4605
+ const we = R.target.value.split(",").map((F) => F.trim()).filter(Boolean);
4606
+ C(p, we);
4556
4607
  },
4557
4608
  placeholder: "Enter countries separated by commas"
4558
4609
  },
4559
- v
4610
+ p
4560
4611
  ) : null;
4561
4612
  case "date":
4562
4613
  return /* @__PURE__ */ n(
4563
- Z,
4614
+ X,
4564
4615
  {
4565
4616
  type: "date",
4566
- label: E.label,
4567
- value: w[v] || "",
4568
- onChange: (S) => F(v, S.target.value)
4617
+ label: w.label,
4618
+ value: I[p] || "",
4619
+ onChange: (R) => C(p, R.target.value)
4569
4620
  },
4570
- v
4621
+ p
4571
4622
  );
4572
4623
  case "email":
4573
4624
  return /* @__PURE__ */ n(
4574
- Z,
4625
+ X,
4575
4626
  {
4576
4627
  type: "email",
4577
- label: E.label,
4578
- value: w[v] || "",
4579
- onChange: (S) => F(v, S.target.value),
4580
- required: v === "email"
4628
+ label: w.label,
4629
+ value: I[p] || "",
4630
+ onChange: (R) => C(p, R.target.value),
4631
+ required: p === "email"
4581
4632
  },
4582
- v
4633
+ p
4583
4634
  );
4584
4635
  case "tel":
4585
4636
  return /* @__PURE__ */ n(
4586
- Z,
4637
+ X,
4587
4638
  {
4588
4639
  type: "tel",
4589
- label: E.label,
4590
- value: w[v] || "",
4591
- onChange: (S) => F(v, S.target.value),
4592
- required: v === "phonenumber"
4640
+ label: w.label,
4641
+ value: I[p] || "",
4642
+ onChange: (R) => C(p, R.target.value),
4643
+ required: p === "phonenumber"
4593
4644
  },
4594
- v
4645
+ p
4595
4646
  );
4596
4647
  case "text":
4597
4648
  default:
4598
4649
  return /* @__PURE__ */ n(
4599
- Z,
4650
+ X,
4600
4651
  {
4601
4652
  type: "text",
4602
- label: E.label,
4603
- value: w[v] || "",
4604
- onChange: (S) => F(v, S.target.value),
4605
- required: v === "firstName" || v === "lastName" || v === "externalRefId"
4653
+ label: w.label,
4654
+ value: I[p] || "",
4655
+ onChange: (R) => C(p, R.target.value),
4656
+ required: p === "firstName" || p === "lastName" || p === "externalRefId"
4606
4657
  },
4607
- v
4658
+ p
4608
4659
  );
4609
4660
  }
4610
4661
  };
4611
- return g ? /* @__PURE__ */ n("div", { className: "metakyc-sdk", children: /* @__PURE__ */ n(T, { children: /* @__PURE__ */ o(M, { children: [
4612
- /* @__PURE__ */ n(ie, { className: "my-8" }),
4662
+ return y ? /* @__PURE__ */ n("div", { className: "metakyc-sdk", children: /* @__PURE__ */ n(L, { children: /* @__PURE__ */ o(T, { children: [
4663
+ /* @__PURE__ */ n(le, { className: "my-8" }),
4613
4664
  /* @__PURE__ */ n("p", { className: "text-center text-gray-600 dark:text-gray-400 mt-4", children: "Loading form..." })
4614
- ] }) }) }) : /* @__PURE__ */ n("div", { className: "metakyc-sdk", children: /* @__PURE__ */ n("form", { onSubmit: L, children: /* @__PURE__ */ o(T, { children: [
4615
- /* @__PURE__ */ n(J, { children: /* @__PURE__ */ n(
4665
+ ] }) }) }) : /* @__PURE__ */ n("div", { className: "metakyc-sdk", children: /* @__PURE__ */ n("form", { onSubmit: A, children: /* @__PURE__ */ o(L, { children: [
4666
+ /* @__PURE__ */ n(ee, { children: /* @__PURE__ */ n(
4616
4667
  Ze,
4617
4668
  {
4618
4669
  title: "Create Applicant",
4619
4670
  subtitle: "Please fill in the required information to begin the KYC verification process."
4620
4671
  }
4621
4672
  ) }),
4622
- /* @__PURE__ */ o(M, { children: [
4623
- y && /* @__PURE__ */ n("div", { className: "mb-6 p-4 bg-red-50 dark:bg-red-900/20 border border-red-200 dark:border-red-800 rounded-lg", children: /* @__PURE__ */ o("p", { className: "text-red-600 dark:text-red-400 text-sm", children: [
4673
+ /* @__PURE__ */ o(T, { children: [
4674
+ m && /* @__PURE__ */ n("div", { className: "mb-6 p-4 bg-red-50 dark:bg-red-900/20 border border-red-200 dark:border-red-800 rounded-lg", children: /* @__PURE__ */ o("p", { className: "text-red-600 dark:text-red-400 text-sm", children: [
4624
4675
  /* @__PURE__ */ n("strong", { children: "Error:" }),
4625
4676
  " ",
4626
- y
4677
+ m
4627
4678
  ] }) }),
4628
- /* @__PURE__ */ n("div", { className: "grid grid-cols-1 md:grid-cols-2 gap-4", children: N.map((v) => R(v)) })
4679
+ /* @__PURE__ */ n("div", { className: "grid grid-cols-1 md:grid-cols-2 gap-4", children: S.map((p) => M(p)) })
4629
4680
  ] }),
4630
- /* @__PURE__ */ o(te, { className: "flex justify-between", children: [
4631
- s && /* @__PURE__ */ n(j, { type: "button", variant: "outline", onClick: s, disabled: m || l, children: "Cancel" }),
4632
- /* @__PURE__ */ n(j, { type: "submit", isLoading: m || l, children: "Create Applicant" })
4681
+ /* @__PURE__ */ o(ne, { className: "flex justify-between", children: [
4682
+ s && /* @__PURE__ */ n(j, { type: "button", variant: "outline", onClick: s, disabled: g || l, children: "Cancel" }),
4683
+ /* @__PURE__ */ n(j, { type: "submit", isLoading: g || l, children: "Create Applicant" })
4633
4684
  ] })
4634
4685
  ] }) }) });
4635
4686
  }, Wr = ({
@@ -4645,32 +4696,32 @@ Failed to reload test data. Please refresh the page.`);
4645
4696
  steps: l,
4646
4697
  workflowKey: d,
4647
4698
  nextWorkflowKey: u,
4648
- hasWorkflowChanged: g,
4649
- isLoading: p,
4650
- error: m,
4699
+ hasWorkflowChanged: y,
4700
+ isLoading: x,
4701
+ error: g,
4651
4702
  moveBack: b,
4652
- refreshProgress: y
4653
- } = Gt(t), [f, P] = le.useState(!1);
4654
- if (le.useEffect(() => {
4655
- m && r && r(m);
4656
- }, [m, r]), le.useEffect(() => {
4703
+ refreshProgress: m
4704
+ } = Gt(t), [f, k] = ce.useState(!1);
4705
+ if (ce.useEffect(() => {
4706
+ g && r && r(g);
4707
+ }, [g, r]), ce.useEffect(() => {
4657
4708
  i != null && i.workflowResult && e && e(i.workflowResult);
4658
- }, [i == null ? void 0 : i.workflowResult, e]), le.useEffect(() => {
4709
+ }, [i == null ? void 0 : i.workflowResult, e]), ce.useEffect(() => {
4659
4710
  s === "dark" ? document.documentElement.classList.add("dark") : document.documentElement.classList.remove("dark");
4660
- }, [s]), le.useEffect(() => {
4661
- g && P(!1);
4662
- }, [g]), p || !i)
4663
- return /* @__PURE__ */ n("div", { className: a, children: /* @__PURE__ */ n(T, { children: /* @__PURE__ */ o(M, { children: [
4664
- /* @__PURE__ */ n(ie, { className: "my-8" }),
4711
+ }, [s]), ce.useEffect(() => {
4712
+ y && k(!1);
4713
+ }, [y]), x || !i)
4714
+ return /* @__PURE__ */ n("div", { className: a, children: /* @__PURE__ */ n(L, { children: /* @__PURE__ */ o(T, { children: [
4715
+ /* @__PURE__ */ n(le, { className: "my-8" }),
4665
4716
  /* @__PURE__ */ n("p", { className: "text-center text-gray-600 dark:text-gray-400 mt-4", children: "Loading workflow..." })
4666
4717
  ] }) }) });
4667
- if (m)
4668
- return /* @__PURE__ */ n("div", { className: a, children: /* @__PURE__ */ n(T, { children: /* @__PURE__ */ n(M, { children: /* @__PURE__ */ o("div", { className: "text-center py-8", children: [
4718
+ if (g)
4719
+ return /* @__PURE__ */ n("div", { className: a, children: /* @__PURE__ */ n(L, { children: /* @__PURE__ */ n(T, { children: /* @__PURE__ */ o("div", { className: "text-center py-8", children: [
4669
4720
  /* @__PURE__ */ n("p", { className: "text-danger-500 text-lg mb-4", children: "An error occurred" }),
4670
- /* @__PURE__ */ n("p", { className: "text-gray-600 dark:text-gray-400", children: m.message })
4721
+ /* @__PURE__ */ n("p", { className: "text-gray-600 dark:text-gray-400", children: g.message })
4671
4722
  ] }) }) }) });
4672
- if (g && !f)
4673
- return /* @__PURE__ */ n("div", { className: `metakyc-sdk ${a || ""}`, children: /* @__PURE__ */ n(T, { children: /* @__PURE__ */ n(M, { children: /* @__PURE__ */ o("div", { className: "text-center py-8", children: [
4723
+ if (y && !f)
4724
+ return /* @__PURE__ */ n("div", { className: `metakyc-sdk ${a || ""}`, children: /* @__PURE__ */ n(L, { children: /* @__PURE__ */ n(T, { children: /* @__PURE__ */ o("div", { className: "text-center py-8", children: [
4674
4725
  /* @__PURE__ */ n("div", { className: "mb-6", children: /* @__PURE__ */ n("div", { className: "inline-flex items-center justify-center w-16 h-16 rounded-full bg-blue-100 dark:bg-blue-900 mb-4", children: /* @__PURE__ */ n("svg", { className: "w-8 h-8 text-blue-600 dark:text-blue-400", fill: "none", stroke: "currentColor", viewBox: "0 0 24 24", children: /* @__PURE__ */ n("path", { strokeLinecap: "round", strokeLinejoin: "round", strokeWidth: 2, d: "M13 16h-1v-4h-1m1-4h.01M21 12a9 9 0 11-18 0 9 9 0 0118 0z" }) }) }) }),
4675
4726
  /* @__PURE__ */ n("h3", { className: "text-xl font-semibold text-gray-900 dark:text-white mb-2", children: "Workflow Transition" }),
4676
4727
  /* @__PURE__ */ n("p", { className: "text-gray-600 dark:text-gray-400 mb-6", children: "Your application workflow has been updated based on your progress." }),
@@ -4691,15 +4742,15 @@ Failed to reload test data. Please refresh the page.`);
4691
4742
  /* @__PURE__ */ n(
4692
4743
  "button",
4693
4744
  {
4694
- onClick: () => P(!0),
4745
+ onClick: () => k(!0),
4695
4746
  className: "px-6 py-3 bg-blue-600 hover:bg-blue-700 text-white font-medium rounded-lg transition-colors",
4696
4747
  children: "Continue with New Workflow"
4697
4748
  }
4698
4749
  )
4699
4750
  ] }) }) }) });
4700
- if (i.status === ae.Finished || i.status === ae.OnHold)
4751
+ if (i.status === oe.Finished || i.status === oe.OnHold)
4701
4752
  return /* @__PURE__ */ n("div", { className: `metakyc-sdk ${a || ""}`, children: /* @__PURE__ */ n(
4702
- ze,
4753
+ $e,
4703
4754
  {
4704
4755
  kycStatus: i.kycStatus,
4705
4756
  reviewStatus: i.reviewStatus,
@@ -4712,80 +4763,80 @@ Failed to reload test data. Please refresh the page.`);
4712
4763
  }
4713
4764
  ) });
4714
4765
  if (!c)
4715
- return /* @__PURE__ */ n("div", { className: `metakyc-sdk ${a || ""}`, children: /* @__PURE__ */ n(T, { children: /* @__PURE__ */ o(M, { children: [
4716
- /* @__PURE__ */ n(ie, { className: "my-8" }),
4717
- /* @__PURE__ */ n("p", { className: "text-center text-gray-600 dark:text-gray-400 mt-4", children: i.status === ae.IdentityPending ? "Loading identity verification..." : "Loading current step..." })
4766
+ return /* @__PURE__ */ n("div", { className: `metakyc-sdk ${a || ""}`, children: /* @__PURE__ */ n(L, { children: /* @__PURE__ */ o(T, { children: [
4767
+ /* @__PURE__ */ n(le, { className: "my-8" }),
4768
+ /* @__PURE__ */ n("p", { className: "text-center text-gray-600 dark:text-gray-400 mt-4", children: i.status === oe.IdentityPending ? "Loading identity verification..." : "Loading current step..." })
4718
4769
  ] }) }) });
4719
4770
  const h = () => {
4720
- const w = l.filter((R) => R.visibility !== !1), I = w.findIndex((R) => R.order === c.order), F = I >= 0 ? I + 1 : 1, L = w.length;
4771
+ const v = l.filter((C) => C.visibility !== !1), S = v.findIndex((C) => C.order === c.order), I = S >= 0 ? S + 1 : 1, P = v.length;
4721
4772
  return /* @__PURE__ */ o("div", { className: "mb-6", children: [
4722
4773
  /* @__PURE__ */ o("div", { className: "flex items-start justify-between mb-4", children: [
4723
4774
  /* @__PURE__ */ n(Ze, {}),
4724
- /* @__PURE__ */ o(me, { variant: i.status === 1 ? "info" : "success", children: [
4775
+ /* @__PURE__ */ o(he, { variant: i.status === 1 ? "info" : "success", children: [
4725
4776
  "Step ",
4726
- F,
4777
+ I,
4727
4778
  " of ",
4728
- L
4779
+ P
4729
4780
  ] })
4730
4781
  ] }),
4731
- /* @__PURE__ */ n("div", { className: "flex items-center", children: w.map((R, C) => {
4732
- const B = C < I, z = R.order === c.order;
4733
- return /* @__PURE__ */ o(le.Fragment, { children: [
4782
+ /* @__PURE__ */ n("div", { className: "flex items-center", children: v.map((C, A) => {
4783
+ const M = A < S, B = C.order === c.order;
4784
+ return /* @__PURE__ */ o(ce.Fragment, { children: [
4734
4785
  /* @__PURE__ */ o("div", { className: "flex items-center", children: [
4735
4786
  /* @__PURE__ */ n(
4736
4787
  "div",
4737
4788
  {
4738
4789
  className: `
4739
4790
  w-8 h-8 rounded-full flex items-center justify-center text-sm font-medium
4740
- ${B || z ? "bg-primary-500 text-white" : "bg-gray-200 text-gray-600 dark:bg-gray-700 dark:text-gray-400"}
4791
+ ${M || B ? "bg-primary-500 text-white" : "bg-gray-200 text-gray-600 dark:bg-gray-700 dark:text-gray-400"}
4741
4792
  `,
4742
- children: C + 1
4793
+ children: A + 1
4743
4794
  }
4744
4795
  ),
4745
4796
  /* @__PURE__ */ n(
4746
4797
  "span",
4747
4798
  {
4748
- className: `ml-2 text-sm ${z ? "font-semibold text-gray-900 dark:text-white" : "text-gray-600 dark:text-gray-400"}`,
4749
- children: R.displayName
4799
+ className: `ml-2 text-sm ${B ? "font-semibold text-gray-900 dark:text-white" : "text-gray-600 dark:text-gray-400"}`,
4800
+ children: C.displayName
4750
4801
  }
4751
4802
  )
4752
4803
  ] }),
4753
- C < w.length - 1 && /* @__PURE__ */ n(
4804
+ A < v.length - 1 && /* @__PURE__ */ n(
4754
4805
  "div",
4755
4806
  {
4756
- className: `flex-1 h-0.5 mx-4 ${B ? "bg-primary-500" : "bg-gray-200 dark:bg-gray-700"}`
4807
+ className: `flex-1 h-0.5 mx-4 ${M ? "bg-primary-500" : "bg-gray-200 dark:bg-gray-700"}`
4757
4808
  }
4758
4809
  )
4759
- ] }, R.order);
4810
+ ] }, C.order);
4760
4811
  }) })
4761
4812
  ] });
4762
- }, N = () => {
4763
- const w = {
4813
+ }, E = () => {
4814
+ const v = {
4764
4815
  applicantId: t,
4765
4816
  onComplete: async () => {
4766
- await y();
4817
+ await m();
4767
4818
  },
4768
4819
  onBack: c.order > 0 ? b : void 0
4769
4820
  };
4770
4821
  switch (c.action) {
4771
4822
  case U.Questionaries:
4772
- return /* @__PURE__ */ n(vr, { ...w });
4823
+ return /* @__PURE__ */ n(vr, { ...v });
4773
4824
  case U.UploadDocument:
4774
- return /* @__PURE__ */ n(wr, { ...w });
4825
+ return /* @__PURE__ */ n(wr, { ...v });
4775
4826
  case U.Overview:
4776
- return /* @__PURE__ */ n(kr, { ...w });
4827
+ return /* @__PURE__ */ n(kr, { ...v });
4777
4828
  case U.IdentitySdk:
4778
- return /* @__PURE__ */ n(Ar, { ...w });
4829
+ return /* @__PURE__ */ n(Ar, { ...v });
4779
4830
  case U.RiskScoring:
4780
- return /* @__PURE__ */ n(Nr, { ...w });
4831
+ return /* @__PURE__ */ n(Nr, { ...v });
4781
4832
  case U.AdditionalData:
4782
4833
  case U.InvestorCategorization:
4783
- return /* @__PURE__ */ n(Sr, { ...w });
4834
+ return /* @__PURE__ */ n(Sr, { ...v });
4784
4835
  case U.AppropriatenessTest:
4785
- return /* @__PURE__ */ n(Cr, { ...w });
4836
+ return /* @__PURE__ */ n(Cr, { ...v });
4786
4837
  case U.ManualReview:
4787
4838
  return /* @__PURE__ */ n(
4788
- ze,
4839
+ $e,
4789
4840
  {
4790
4841
  kycStatus: i.kycStatus,
4791
4842
  reviewStatus: i.reviewStatus,
@@ -4794,8 +4845,8 @@ Failed to reload test data. Please refresh the page.`);
4794
4845
  }
4795
4846
  );
4796
4847
  default:
4797
- return /* @__PURE__ */ n(T, { children: /* @__PURE__ */ o(M, { className: "py-12 text-center", children: [
4798
- /* @__PURE__ */ n("div", { className: "mb-4", children: /* @__PURE__ */ n(ie, {}) }),
4848
+ return /* @__PURE__ */ n(L, { children: /* @__PURE__ */ o(T, { className: "py-12 text-center", children: [
4849
+ /* @__PURE__ */ n("div", { className: "mb-4", children: /* @__PURE__ */ n(le, {}) }),
4799
4850
  /* @__PURE__ */ o("p", { className: "text-gray-600 dark:text-gray-400 mb-2", children: [
4800
4851
  "Processing step: ",
4801
4852
  c.title || c.name
@@ -4809,54 +4860,54 @@ Failed to reload test data. Please refresh the page.`);
4809
4860
  };
4810
4861
  return /* @__PURE__ */ o("div", { className: `metakyc-sdk ${a || ""}`, children: [
4811
4862
  h(),
4812
- N()
4863
+ E()
4813
4864
  ] });
4814
4865
  };
4815
4866
  export {
4816
4867
  Tr as ALL_APPLICANT_FIELDS,
4817
4868
  st as ApplicantProgressOnHoldReason,
4818
- ae as ApplicantProgressStatus,
4869
+ oe as ApplicantProgressStatus,
4819
4870
  vt as ApplicantService,
4820
4871
  it as ApplicantStatus,
4821
4872
  ut as AppropriatenessQuestionType,
4822
4873
  Nt as AppropriatenessTestService,
4823
4874
  Cr as AppropriatenessTestStep,
4824
- me as Badge,
4875
+ he as Badge,
4825
4876
  Et as BaseInformationService,
4826
4877
  j as Button,
4827
- T as Card,
4828
- M as CardContent,
4829
- te as CardFooter,
4830
- J as CardHeader,
4878
+ L as Card,
4879
+ T as CardContent,
4880
+ ne as CardFooter,
4881
+ ee as CardHeader,
4831
4882
  Yr as CreateApplicantForm,
4832
4883
  ht as CriteriaBuiltInType,
4833
4884
  gt as DEFAULT_VISIBLE_FIELDS,
4834
4885
  dt as DocumentReviewStatus,
4835
4886
  bt as EndpointBuilder,
4836
- be as ErrorHandler,
4887
+ xe as ErrorHandler,
4837
4888
  Bt as EventEmitter,
4838
4889
  yt as FIELD_METADATA,
4839
4890
  ct as FileType,
4840
4891
  nr as FileUpload,
4841
- ke as GenderType,
4892
+ Se as GenderType,
4842
4893
  Ze as Header,
4843
4894
  xt as HttpClient,
4844
- ye as IdentityProviderManager,
4895
+ fe as IdentityProviderManager,
4845
4896
  At as IdentityService,
4846
- se as IdentityVerificationProvider,
4897
+ ie as IdentityVerificationProvider,
4847
4898
  Ar as IdentityVerificationStep,
4848
- Z as Input,
4899
+ X as Input,
4849
4900
  It as InvestorCategorizationService,
4850
4901
  Sr as InvestorCategorizationStep,
4851
- ee as InvestorCategorizationType,
4902
+ re as InvestorCategorizationType,
4852
4903
  pt as InvestorCategoryType,
4853
4904
  ot as KycProcessStatus,
4854
- he as KycStatus,
4855
- ze as KycStatusDisplay,
4905
+ pe as KycStatus,
4906
+ $e as KycStatusDisplay,
4856
4907
  Wr as KycWorkflow,
4857
4908
  Er as Logo,
4858
4909
  Ue as MetaKYCContext,
4859
- ce as MetaKYCError,
4910
+ de as MetaKYCError,
4860
4911
  Or as MetaKYCProvider,
4861
4912
  _t as OnfidoProvider,
4862
4913
  St as OverviewService,
@@ -4864,45 +4915,45 @@ export {
4864
4915
  sr as PhoneInput,
4865
4916
  wt as QuestionnaireService,
4866
4917
  vr as QuestionnaireStep,
4867
- pe as ReviewStatus,
4918
+ ge as ReviewStatus,
4868
4919
  mt as RiskCriteriaType,
4869
4920
  at as RiskLevel,
4870
4921
  Ct as RiskScoringService,
4871
4922
  Nr as RiskScoringStep,
4872
4923
  Kt as SardinAIProvider,
4873
- ge as Select,
4874
- ie as Spinner,
4924
+ ye as Select,
4925
+ le as Spinner,
4875
4926
  zt as StepRouter,
4876
4927
  jt as SumsubProvider,
4877
4928
  Ut as ThemeManager,
4878
- Y as ThemePreset,
4929
+ W as ThemePreset,
4879
4930
  Mt as ThemeService,
4880
4931
  kt as UploadDocumentService,
4881
4932
  wr as UploadDocumentStep,
4882
4933
  lt as UserType,
4883
- Ie as ValueDataType,
4934
+ De as ValueDataType,
4884
4935
  $t as WorkflowOrchestrator,
4885
- we as WorkflowResultType,
4936
+ Ne as WorkflowResultType,
4886
4937
  Ot as WorkflowState,
4887
4938
  U as WorkflowStepAction,
4888
4939
  Vr as appropriatenessTestSchema,
4889
4940
  Kr as clearAllStorage,
4890
4941
  Yt as clearApplicantId,
4891
4942
  Qt as clearWorkflowState,
4892
- X as cn,
4943
+ te as cn,
4893
4944
  Rt as corporateTheme,
4894
4945
  ft as defaultConfig,
4895
- Q as defaultTheme,
4946
+ Z as defaultTheme,
4896
4947
  qt as fileToBase64,
4897
4948
  Dt as fintechTheme,
4898
- Ae as formatFileSize,
4949
+ Ie as formatFileSize,
4899
4950
  Hr as generateAppropriatenessSchema,
4900
4951
  yr as generateQuestionnaireSchema,
4901
4952
  br as generateRiskScoringSchema,
4902
4953
  qr as generateUploadDocumentSchema,
4903
4954
  jr as getAcceptString,
4904
4955
  Vt as getApplicantId,
4905
- xe as getThemePreset,
4956
+ ve as getThemePreset,
4906
4957
  _r as getWorkflowState,
4907
4958
  Pt as healthcareTheme,
4908
4959
  Mr as isScriptLoaded,
@@ -4917,7 +4968,7 @@ export {
4917
4968
  Ur as useAppropriatenessTest,
4918
4969
  er as useIdentityVerification,
4919
4970
  Gt as useKycWorkflow,
4920
- re as useMetaKYC,
4971
+ se as useMetaKYC,
4921
4972
  Xt as useOverview,
4922
4973
  Zt as useQuestionnaire,
4923
4974
  tr as useRiskScoring,