@vpdev2/metakyc-sdk 1.0.4 → 1.0.6

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.js CHANGED
@@ -1,14 +1,14 @@
1
- var Ge = Object.defineProperty;
2
- var Ze = (t, e, r) => e in t ? Ge(t, e, { enumerable: !0, configurable: !0, writable: !0, value: r }) : t[e] = r;
3
- var K = (t, e, r) => Ze(t, typeof e != "symbol" ? e + "" : e, r);
4
- import Je from "axios";
5
- import * as Pe from "react";
6
- import ce, { createContext as Xe, useMemo as Oe, useEffect as V, useContext as et, useState as v, useRef as ze, useCallback as q, forwardRef as Re } from "react";
7
- import { jsx as n, jsxs as o, Fragment as tt } from "react/jsx-runtime";
8
- import { get as Ae, set as Se, appendErrors as $e, useForm as De, Controller as Q } from "react-hook-form";
1
+ var Je = Object.defineProperty;
2
+ var Xe = (t, e, r) => e in t ? Je(t, e, { enumerable: !0, configurable: !0, writable: !0, value: r }) : t[e] = r;
3
+ var K = (t, e, r) => Xe(t, typeof e != "symbol" ? e + "" : e, r);
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";
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
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 || {}), ke = /* @__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))(ke || {}), se = /* @__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))(se || {}), rt = /* @__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))(rt || {}), nt = /* @__PURE__ */ ((t) => (t[t.LowRisk = 0] = "LowRisk", t[t.MediumRisk = 1] = "MediumRisk", t[t.HighRisk = 2] = "HighRisk", t[t.Alert = 3] = "Alert", t))(nt || {}), 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 || {}), at = /* @__PURE__ */ ((t) => (t[t.ProviderResultPending = 0] = "ProviderResultPending", t[t.ProviderResultReceived = 1] = "ProviderResultReceived", t[t.Canceled = 2] = "Canceled", t[t.ExtendedToNewApplicant = 3] = "ExtendedToNewApplicant", t))(at || {}), st = /* @__PURE__ */ ((t) => (t[t.None = 0] = "None", t[t.ProviderResultPending = 1] = "ProviderResultPending", t[t.ProviderResultReceived = 2] = "ProviderResultReceived", t[t.Canceled = 3] = "Canceled", t))(st || {}), ae = /* @__PURE__ */ ((t) => (t[t.Onfido = 0] = "Onfido", t[t.Sumsub = 2] = "Sumsub", t[t.SardinAI = 3] = "SardinAI", t))(ae || {}), it = /* @__PURE__ */ ((t) => (t[t.Individual = 0] = "Individual", t[t.Company = 1] = "Company", t))(it || {}), Ne = /* @__PURE__ */ ((t) => (t[t.Male = 0] = "Male", t[t.Female = 1] = "Female", t[t.Other = 2] = "Other", t))(Ne || {}), ot = /* @__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))(ot || {}), lt = /* @__PURE__ */ ((t) => (t[t.Pending = 0] = "Pending", t[t.Approved = 1] = "Approved", t[t.Rejected = 2] = "Rejected", t[t.RequiresRevision = 3] = "RequiresRevision", t))(lt || {}), ct = /* @__PURE__ */ ((t) => (t[t.SingleChoice = 0] = "SingleChoice", t[t.MultipleChoice = 1] = "MultipleChoice", t[t.Text = 2] = "Text", t))(ct || {}), Ee = /* @__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))(Ee || {}), dt = /* @__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))(dt || {}), ut = /* @__PURE__ */ ((t) => (t[t.None = 0] = "None", t[t.Country = 1] = "Country", t))(ut || {}), X = /* @__PURE__ */ ((t) => (t[t.Individual = 0] = "Individual", t[t.Sophisticated = 1] = "Sophisticated", t[t.HighNetWorth = 2] = "HighNetWorth", t[t.Business = 3] = "Business", t))(X || {}), mt = /* @__PURE__ */ ((t) => (t[t.Retail = 0] = "Retail", t[t.Professional = 1] = "Professional", t[t.EligibleCounterparty = 2] = "EligibleCounterparty", t))(mt || {});
11
- const ht = [
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 || {});
11
+ const gt = [
12
12
  "firstName",
13
13
  "lastName",
14
14
  "email",
@@ -22,7 +22,7 @@ const ht = [
22
22
  "nationality",
23
23
  "taxCountry",
24
24
  "taxNumber"
25
- ], Fr = [
25
+ ], Tr = [
26
26
  "firstName",
27
27
  "lastName",
28
28
  "title",
@@ -46,7 +46,7 @@ const ht = [
46
46
  "occupation",
47
47
  "taxNumber",
48
48
  "externalRefId"
49
- ], pt = {
49
+ ], yt = {
50
50
  firstName: { label: "First Name", type: "text" },
51
51
  lastName: { label: "Last Name", type: "text" },
52
52
  title: { label: "Title", type: "text" },
@@ -72,7 +72,7 @@ const ht = [
72
72
  externalRefId: { label: "External Reference ID", type: "text" }
73
73
  };
74
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 || {});
75
- const gt = {
75
+ const ft = {
76
76
  timeout: 3e4,
77
77
  retries: 3,
78
78
  locale: "en",
@@ -80,7 +80,7 @@ const gt = {
80
80
  pattern: "host-controller"
81
81
  }
82
82
  };
83
- class yt {
83
+ class bt {
84
84
  constructor(e) {
85
85
  this.config = e;
86
86
  }
@@ -91,9 +91,9 @@ class yt {
91
91
  * @returns The full endpoint path
92
92
  */
93
93
  build(e, r) {
94
- const a = `${e}.${r}`;
95
- if (this.config.customPaths && this.config.customPaths[a])
96
- return this.config.customPaths[a];
94
+ const s = `${e}.${r}`;
95
+ if (this.config.customPaths && this.config.customPaths[s])
96
+ return this.config.customPaths[s];
97
97
  switch (this.config.pattern) {
98
98
  case "host-controller":
99
99
  return `/api/${e}/${r}`;
@@ -101,7 +101,7 @@ class yt {
101
101
  return `/services/app/${this.getServiceName(e)}/${r}`;
102
102
  case "custom":
103
103
  throw new Error(
104
- `Custom endpoint path not found for ${a}. Please provide it in customPaths.`
104
+ `Custom endpoint path not found for ${s}. Please provide it in customPaths.`
105
105
  );
106
106
  default:
107
107
  throw new Error(`Unknown endpoint pattern: ${this.config.pattern}`);
@@ -120,19 +120,19 @@ class yt {
120
120
  }[e] || e;
121
121
  }
122
122
  }
123
- class le extends Error {
124
- constructor(r, a, s, i, c) {
123
+ class ce extends Error {
124
+ constructor(r, s, a, i, c) {
125
125
  super(r);
126
126
  K(this, "response");
127
- this.code = a, this.details = s, this.validationErrors = i, this.name = "MetaKYCError", this.response = c, Object.setPrototypeOf(this, le.prototype);
127
+ this.code = s, this.details = a, this.validationErrors = i, this.name = "MetaKYCError", this.response = c, Object.setPrototypeOf(this, ce.prototype);
128
128
  }
129
129
  }
130
- class xe {
130
+ class be {
131
131
  /**
132
132
  * Process an error from the API response
133
133
  */
134
134
  static handleApiError(e) {
135
- return new le(
135
+ return new ce(
136
136
  e.message || "An unknown error occurred",
137
137
  e.code,
138
138
  e.details || void 0,
@@ -145,44 +145,44 @@ class xe {
145
145
  static handleAxiosError(e) {
146
146
  if (e.response) {
147
147
  const r = e.response.data;
148
- return r && r.error ? new le(
148
+ return r && r.error ? new ce(
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 le(
154
+ ) : r && r.result && r.result.message ? new ce(
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 le(
160
+ ) : new ce(
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 le(
167
+ } else return e.request ? new ce(
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 le(e.message || "An unexpected error occurred", 0, e.toString());
171
+ ) : new ce(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 le;
177
+ return e instanceof ce;
178
178
  }
179
179
  }
180
- class ft {
180
+ class xt {
181
181
  constructor(e) {
182
182
  K(this, "axiosInstance");
183
183
  K(this, "endpointBuilder");
184
184
  K(this, "config");
185
- this.config = { ...gt, ...e }, this.endpointBuilder = new yt(this.config.endpoints), this.axiosInstance = Je.create({
185
+ this.config = { ...ft, ...e }, this.endpointBuilder = new bt(this.config.endpoints), this.axiosInstance = et.create({
186
186
  baseURL: this.config.baseUrl,
187
187
  timeout: this.config.timeout,
188
188
  headers: {
@@ -194,11 +194,11 @@ class ft {
194
194
  ), this.axiosInstance.interceptors.response.use(
195
195
  (r) => r,
196
196
  async (r) => {
197
- var s;
198
- const a = r.config;
199
- return ((s = r.response) == null ? void 0 : s.status) >= 500 && !a._retry && (a._retry = !0, a._retryCount = (a._retryCount || 0) + 1, a._retryCount < (this.config.retries || 3)) ? (await new Promise(
200
- (i) => setTimeout(i, 1e3 * a._retryCount)
201
- ), this.axiosInstance(a)) : Promise.reject(r);
197
+ var a;
198
+ const s = r.config;
199
+ return ((a = r.response) == null ? void 0 : a.status) >= 500 && !s._retry && (s._retry = !0, s._retryCount = (s._retryCount || 0) + 1, s._retryCount < (this.config.retries || 3)) ? (await new Promise(
200
+ (i) => setTimeout(i, 1e3 * s._retryCount)
201
+ ), this.axiosInstance(s)) : Promise.reject(r);
202
202
  }
203
203
  );
204
204
  }
@@ -211,49 +211,49 @@ class ft {
211
211
  /**
212
212
  * Make a GET request
213
213
  */
214
- async get(e, r, a) {
214
+ async get(e, r, s) {
215
215
  try {
216
- const s = this.buildEndpoint(e, r), i = await this.axiosInstance.get(s, {
217
- params: a
216
+ const a = this.buildEndpoint(e, r), i = await this.axiosInstance.get(a, {
217
+ params: s
218
218
  });
219
219
  return this.handleResponse(i);
220
- } catch (s) {
221
- throw xe.handleAxiosError(s);
220
+ } catch (a) {
221
+ throw be.handleAxiosError(a);
222
222
  }
223
223
  }
224
224
  /**
225
225
  * Make a POST request
226
226
  */
227
- async post(e, r, a) {
227
+ async post(e, r, s) {
228
228
  try {
229
- const s = this.buildEndpoint(e, r), i = await this.axiosInstance.post(s, a);
229
+ const a = this.buildEndpoint(e, r), i = await this.axiosInstance.post(a, s);
230
230
  return this.handleResponse(i);
231
- } catch (s) {
232
- throw xe.handleAxiosError(s);
231
+ } catch (a) {
232
+ throw be.handleAxiosError(a);
233
233
  }
234
234
  }
235
235
  /**
236
236
  * Make a PUT request
237
237
  */
238
- async put(e, r, a) {
238
+ async put(e, r, s) {
239
239
  try {
240
- const s = this.buildEndpoint(e, r), i = await this.axiosInstance.put(s, a);
240
+ const a = this.buildEndpoint(e, r), i = await this.axiosInstance.put(a, s);
241
241
  return this.handleResponse(i);
242
- } catch (s) {
243
- throw xe.handleAxiosError(s);
242
+ } catch (a) {
243
+ throw be.handleAxiosError(a);
244
244
  }
245
245
  }
246
246
  /**
247
247
  * Make a DELETE request
248
248
  */
249
- async delete(e, r, a) {
249
+ async delete(e, r, s) {
250
250
  try {
251
- const s = this.buildEndpoint(e, r), i = await this.axiosInstance.delete(s, {
252
- params: a
251
+ const a = this.buildEndpoint(e, r), i = await this.axiosInstance.delete(a, {
252
+ params: s
253
253
  });
254
254
  return this.handleResponse(i);
255
- } catch (s) {
256
- throw xe.handleAxiosError(s);
255
+ } catch (a) {
256
+ throw be.handleAxiosError(a);
257
257
  }
258
258
  }
259
259
  /**
@@ -262,7 +262,7 @@ class ft {
262
262
  handleResponse(e) {
263
263
  const r = e.data;
264
264
  if (!r.success && r.error)
265
- throw xe.handleApiError(r.error);
265
+ throw be.handleApiError(r.error);
266
266
  return r;
267
267
  }
268
268
  /**
@@ -272,7 +272,7 @@ class ft {
272
272
  return this.axiosInstance;
273
273
  }
274
274
  }
275
- class bt {
275
+ class vt {
276
276
  constructor(e) {
277
277
  this.httpClient = e;
278
278
  }
@@ -391,7 +391,7 @@ class bt {
391
391
  )).result;
392
392
  }
393
393
  }
394
- class xt {
394
+ class wt {
395
395
  constructor(e) {
396
396
  this.httpClient = e;
397
397
  }
@@ -418,7 +418,7 @@ class xt {
418
418
  )).result;
419
419
  }
420
420
  }
421
- class vt {
421
+ class kt {
422
422
  constructor(e) {
423
423
  this.httpClient = e;
424
424
  }
@@ -446,7 +446,7 @@ class vt {
446
446
  await this.httpClient.post("UploadDocument", "ReviewUploadDocument", e);
447
447
  }
448
448
  }
449
- class wt {
449
+ class Nt {
450
450
  constructor(e) {
451
451
  this.httpClient = e;
452
452
  }
@@ -472,7 +472,7 @@ class wt {
472
472
  )).result;
473
473
  }
474
474
  }
475
- class kt {
475
+ class St {
476
476
  constructor(e) {
477
477
  this.httpClient = e;
478
478
  }
@@ -494,7 +494,7 @@ class kt {
494
494
  await this.httpClient.get("Applicant", "PassOverview", { applicantId: e });
495
495
  }
496
496
  }
497
- class Nt {
497
+ class Ct {
498
498
  constructor(e) {
499
499
  this.httpClient = e;
500
500
  }
@@ -529,7 +529,7 @@ class Nt {
529
529
  )).result;
530
530
  }
531
531
  }
532
- class St {
532
+ class At {
533
533
  constructor(e) {
534
534
  this.httpClient = e;
535
535
  }
@@ -584,7 +584,7 @@ class St {
584
584
  return this.identityCompanyRequest(r);
585
585
  }
586
586
  }
587
- class Ct {
587
+ class Et {
588
588
  constructor(e) {
589
589
  this.httpClient = e;
590
590
  }
@@ -594,11 +594,11 @@ class Ct {
594
594
  * @param lng - Language code (e.g., 'en', 'de')
595
595
  * @param type - Optional country type filter
596
596
  */
597
- async getCountries(e, r, a) {
597
+ async getCountries(e, r, s) {
598
598
  return (await this.httpClient.get(
599
599
  "BaseInformation",
600
600
  "GetAllCountries",
601
- { filter: e || "", lng: r || "en", type: a }
601
+ { filter: e || "", lng: r || "en", type: s }
602
602
  )).result;
603
603
  }
604
604
  /**
@@ -620,7 +620,7 @@ class Ct {
620
620
  )).result;
621
621
  }
622
622
  }
623
- class At {
623
+ class It {
624
624
  constructor(e) {
625
625
  this.httpClient = e;
626
626
  }
@@ -646,7 +646,7 @@ class At {
646
646
  )).result;
647
647
  }
648
648
  }
649
- const ee = {
649
+ const Q = {
650
650
  name: "Default",
651
651
  title: "KYC Verification",
652
652
  logo: {
@@ -705,7 +705,7 @@ const ee = {
705
705
  textMuted: "#9ca3af"
706
706
  }
707
707
  }
708
- }, Et = {
708
+ }, Rt = {
709
709
  name: "Corporate",
710
710
  logo: {
711
711
  url: "",
@@ -738,7 +738,7 @@ const ee = {
738
738
  cardPadding: "1.5rem",
739
739
  inputHeight: "2.5rem"
740
740
  }
741
- }, It = {
741
+ }, Dt = {
742
742
  name: "Fintech",
743
743
  logo: {
744
744
  url: "",
@@ -771,7 +771,7 @@ const ee = {
771
771
  cardPadding: "2rem",
772
772
  inputHeight: "3rem"
773
773
  }
774
- }, Rt = {
774
+ }, Pt = {
775
775
  name: "Healthcare",
776
776
  logo: {
777
777
  url: "",
@@ -813,7 +813,7 @@ const ee = {
813
813
  textSecondary: "#CBD5E1"
814
814
  }
815
815
  }
816
- }, Dt = {
816
+ }, Ft = {
817
817
  name: "Modern",
818
818
  logo: {
819
819
  url: "",
@@ -846,7 +846,7 @@ const ee = {
846
846
  cardPadding: "2rem",
847
847
  inputHeight: "3rem"
848
848
  }
849
- }, Pt = {
849
+ }, Lt = {
850
850
  name: "Minimal",
851
851
  logo: {
852
852
  url: "",
@@ -879,18 +879,18 @@ const ee = {
879
879
  cardPadding: "1.25rem",
880
880
  inputHeight: "2.25rem"
881
881
  }
882
- }, Ft = {
883
- [Y.Default]: ee,
884
- [Y.Corporate]: Et,
885
- [Y.Fintech]: It,
886
- [Y.Healthcare]: Rt,
887
- [Y.Modern]: Dt,
888
- [Y.Minimal]: Pt
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
889
889
  };
890
- function ve(t) {
891
- return Ft[t] || ee;
890
+ function xe(t) {
891
+ return Tt[t] || Q;
892
892
  }
893
- class Lt {
893
+ class Mt {
894
894
  constructor(e) {
895
895
  this.httpClient = e;
896
896
  }
@@ -905,16 +905,16 @@ class Lt {
905
905
  "GetThemeConfiguration"
906
906
  );
907
907
  if (!r.result.isEnabled)
908
- return ve(Y.Default);
909
- let a = r.result.preset ? ve(r.result.preset) : ve(Y.Default);
910
- return r.result.title && (a.title = r.result.title), r.result.logo && (a.logo = { ...a.logo, ...r.result.logo }), r.result.colors && (a.colors = { ...a.colors, ...r.result.colors }), r.result.typography && (a.typography = { ...a.typography, ...r.result.typography }), r.result.spacing && (a.spacing = { ...a.spacing, ...r.result.spacing }), r.result.customCSS && (a.customCSS = r.result.customCSS), r.result.darkMode && (a.darkMode = {
908
+ return xe(Y.Default);
909
+ let s = r.result.preset ? xe(r.result.preset) : xe(Y.Default);
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
- ...(e = a.darkMode) == null ? void 0 : e.colors,
912
+ ...(e = s.darkMode) == null ? void 0 : e.colors,
913
913
  ...r.result.darkMode.colors
914
914
  }
915
- }), a;
915
+ }), s;
916
916
  } catch (r) {
917
- return console.warn("[ThemeService] Failed to fetch theme configuration:", r), ve(Y.Default);
917
+ return console.warn("[ThemeService] Failed to fetch theme configuration:", r), xe(Y.Default);
918
918
  }
919
919
  }
920
920
  /**
@@ -940,18 +940,18 @@ class Lt {
940
940
  * Preview theme (doesn't save)
941
941
  */
942
942
  getPreviewTheme(e, r) {
943
- const a = ve(e);
943
+ const s = xe(e);
944
944
  return r ? {
945
- ...a,
945
+ ...s,
946
946
  ...r,
947
- logo: { ...a.logo, ...r.logo },
948
- colors: { ...a.colors, ...r.colors },
949
- typography: r.typography ? { ...a.typography, ...r.typography } : a.typography,
950
- spacing: r.spacing ? { ...a.spacing, ...r.spacing } : a.spacing
951
- } : a;
947
+ logo: { ...s.logo, ...r.logo },
948
+ colors: { ...s.colors, ...r.colors },
949
+ typography: r.typography ? { ...s.typography, ...r.typography } : s.typography,
950
+ spacing: r.spacing ? { ...s.spacing, ...r.spacing } : s.spacing
951
+ } : s;
952
952
  }
953
953
  }
954
- class Tt {
954
+ class Bt {
955
955
  constructor() {
956
956
  K(this, "listeners", /* @__PURE__ */ new Map());
957
957
  }
@@ -967,17 +967,17 @@ class Tt {
967
967
  * Unsubscribe from an event
968
968
  */
969
969
  off(e, r) {
970
- const a = this.listeners.get(e);
971
- a && a.delete(r);
970
+ const s = this.listeners.get(e);
971
+ s && s.delete(r);
972
972
  }
973
973
  /**
974
974
  * Emit an event
975
975
  */
976
976
  emit(e, r) {
977
- const a = this.listeners.get(e);
978
- a && a.forEach((s) => {
977
+ const s = this.listeners.get(e);
978
+ s && s.forEach((a) => {
979
979
  try {
980
- s(r);
980
+ a(r);
981
981
  } catch (i) {
982
982
  console.error(`Error in event listener for "${e}":`, i);
983
983
  }
@@ -996,9 +996,9 @@ class Tt {
996
996
  this.listeners.delete(e);
997
997
  }
998
998
  }
999
- class Mt {
999
+ class Ot {
1000
1000
  constructor() {
1001
- K(this, "events", new Tt());
1001
+ K(this, "events", new Bt());
1002
1002
  K(this, "_applicantId", null);
1003
1003
  K(this, "_progress", null);
1004
1004
  K(this, "_error", null);
@@ -1034,7 +1034,7 @@ class Mt {
1034
1034
  */
1035
1035
  get status() {
1036
1036
  var e;
1037
- return ((e = this._progress) == null ? void 0 : e.status) || se.None;
1037
+ return ((e = this._progress) == null ? void 0 : e.status) || ae.None;
1038
1038
  }
1039
1039
  /**
1040
1040
  * Get workflow result
@@ -1053,19 +1053,19 @@ class Mt {
1053
1053
  * Check if workflow is complete
1054
1054
  */
1055
1055
  get isComplete() {
1056
- return this.status === se.Finished;
1056
+ return this.status === ae.Finished;
1057
1057
  }
1058
1058
  /**
1059
1059
  * Check if workflow is on hold
1060
1060
  */
1061
1061
  get isOnHold() {
1062
- return this.status === se.OnHold;
1062
+ return this.status === ae.OnHold;
1063
1063
  }
1064
1064
  /**
1065
1065
  * Check if workflow is in progress
1066
1066
  */
1067
1067
  get isInProgress() {
1068
- return this.status === se.InProgress;
1068
+ return this.status === ae.InProgress;
1069
1069
  }
1070
1070
  /**
1071
1071
  * Set applicant ID
@@ -1077,9 +1077,9 @@ class Mt {
1077
1077
  * Update progress
1078
1078
  */
1079
1079
  updateProgress(e) {
1080
- var a, s;
1081
- const r = (a = this._progress) == null ? void 0 : a.currentStep;
1082
- this._progress = e, this._applicantId = e.applicantId, this._error = null, this.events.emit("progressUpdated", e), (r == null ? void 0 : r.order) !== ((s = e.currentStep) == null ? void 0 : s.order) && this.events.emit("stepChanged", e.currentStep), this.events.emit("statusChanged", e.status), e.status === se.Finished && e.workflowResult && this.events.emit("completed", e.workflowResult);
1080
+ var s, a;
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);
1083
1083
  }
1084
1084
  /**
1085
1085
  * Set error
@@ -1136,7 +1136,7 @@ class Mt {
1136
1136
  this.events.clear();
1137
1137
  }
1138
1138
  }
1139
- class Bt {
1139
+ class zt {
1140
1140
  constructor() {
1141
1141
  K(this, "handlers", /* @__PURE__ */ new Map());
1142
1142
  }
@@ -1162,26 +1162,26 @@ class Bt {
1162
1162
  * Load data for a step
1163
1163
  */
1164
1164
  async loadStepData(e, r) {
1165
- const a = this.getHandler(e);
1166
- if (!a)
1165
+ const s = this.getHandler(e);
1166
+ if (!s)
1167
1167
  throw new Error(`No handler registered for step action: ${U[e]}`);
1168
- return a.loadData(r);
1168
+ return s.loadData(r);
1169
1169
  }
1170
1170
  /**
1171
1171
  * Submit data for a step
1172
1172
  */
1173
1173
  async submitStepData(e, r) {
1174
- const a = this.getHandler(e);
1175
- if (!a)
1174
+ const s = this.getHandler(e);
1175
+ if (!s)
1176
1176
  throw new Error(`No handler registered for step action: ${U[e]}`);
1177
- return a.submitData(r);
1177
+ return s.submitData(r);
1178
1178
  }
1179
1179
  }
1180
- class Ot {
1181
- constructor(e, r, a, s, i, c, l, d) {
1180
+ class $t {
1181
+ constructor(e, r, s, a, i, c, l, d) {
1182
1182
  K(this, "state");
1183
1183
  K(this, "stepRouter");
1184
- this.applicantService = e, this.questionnaireService = r, this.uploadDocumentService = a, this.appropriatenessTestService = s, this.overviewService = i, this.riskScoringService = c, this.investorCategorizationService = d, this.state = new Mt(), this.stepRouter = new Bt(), this.registerStepHandlers();
1184
+ this.applicantService = e, this.questionnaireService = r, this.uploadDocumentService = s, this.appropriatenessTestService = a, this.overviewService = i, this.riskScoringService = c, this.investorCategorizationService = d, this.state = new Ot(), this.stepRouter = new zt(), this.registerStepHandlers();
1185
1185
  }
1186
1186
  /**
1187
1187
  * Register all step handlers
@@ -1321,24 +1321,24 @@ class Ot {
1321
1321
  return this.stepRouter;
1322
1322
  }
1323
1323
  }
1324
- function _e(t, e) {
1325
- return new Promise((r, a) => {
1324
+ function Ke(t, e) {
1325
+ return new Promise((r, s) => {
1326
1326
  if (e && document.getElementById(e)) {
1327
1327
  r();
1328
1328
  return;
1329
1329
  }
1330
- const s = document.createElement("script");
1331
- s.src = t, e && (s.id = e), s.async = !0, s.onload = () => r(), s.onerror = () => a(new Error(`Failed to load script: ${t}`)), document.head.appendChild(s);
1330
+ const a = document.createElement("script");
1331
+ a.src = t, e && (a.id = e), a.async = !0, a.onload = () => r(), a.onerror = () => s(new Error(`Failed to load script: ${t}`)), document.head.appendChild(a);
1332
1332
  });
1333
1333
  }
1334
- function Lr(t) {
1334
+ function Mr(t) {
1335
1335
  return !!document.getElementById(t);
1336
1336
  }
1337
- function Tr(t) {
1337
+ function Br(t) {
1338
1338
  const e = document.getElementById(t);
1339
1339
  e && e.remove();
1340
1340
  }
1341
- class zt {
1341
+ class jt {
1342
1342
  constructor(e) {
1343
1343
  K(this, "sdk", null);
1344
1344
  K(this, "config");
@@ -1348,7 +1348,7 @@ class zt {
1348
1348
  * Load Sumsub SDK
1349
1349
  */
1350
1350
  async loadSDK() {
1351
- await _e(
1351
+ await Ke(
1352
1352
  "https://cdn.sumsub.com/websdk/v2/production/websdk.js",
1353
1353
  "sumsub-sdk"
1354
1354
  );
@@ -1393,7 +1393,7 @@ class zt {
1393
1393
  this.sdk && this.sdk.on("idCheck.onError", e);
1394
1394
  }
1395
1395
  }
1396
- class $t {
1396
+ class _t {
1397
1397
  constructor(e) {
1398
1398
  K(this, "sdk", null);
1399
1399
  K(this, "config");
@@ -1403,7 +1403,7 @@ class $t {
1403
1403
  * Load Onfido SDK
1404
1404
  */
1405
1405
  async loadSDK() {
1406
- await _e(
1406
+ await Ke(
1407
1407
  "https://sdk.onfido.com/v12.0.0/onfido.min.js",
1408
1408
  "onfido-sdk"
1409
1409
  );
@@ -1459,7 +1459,7 @@ class $t {
1459
1459
  this.sdk && (this.sdk.tearDown(), this.sdk = null);
1460
1460
  }
1461
1461
  }
1462
- class _t {
1462
+ class Kt {
1463
1463
  constructor(e) {
1464
1464
  K(this, "sardineContext", null);
1465
1465
  K(this, "config");
@@ -1502,14 +1502,14 @@ class _t {
1502
1502
  e();
1503
1503
  return;
1504
1504
  }
1505
- const a = this.getSardineHost(), s = document.createElement("script");
1506
- s.type = "text/javascript", s.async = !0, s.src = `https://${a}/assets/loader.min.js`, s.onload = () => {
1505
+ const s = this.getSardineHost(), a = document.createElement("script");
1506
+ a.type = "text/javascript", a.async = !0, a.src = `https://${s}/assets/loader.min.js`, a.onload = () => {
1507
1507
  console.log("[SardinAI] SDK loaded successfully"), e();
1508
- }, s.onerror = () => {
1508
+ }, a.onerror = () => {
1509
1509
  r(new Error("Failed to load SardinAI SDK"));
1510
1510
  };
1511
1511
  const i = document.getElementsByTagName("script")[0];
1512
- i && i.parentNode ? i.parentNode.insertBefore(s, i) : document.head.appendChild(s);
1512
+ i && i.parentNode ? i.parentNode.insertBefore(a, i) : document.head.appendChild(a);
1513
1513
  });
1514
1514
  }
1515
1515
  /**
@@ -1519,14 +1519,14 @@ class _t {
1519
1519
  try {
1520
1520
  if (await this.loadSDK(), !window._Sardine)
1521
1521
  throw new Error("SardinAI SDK not available after loading");
1522
- const e = this.getSardineHost(), { clientId: r, environment: a, flow: s, enableBiometrics: i, enablePortScanning: c } = this.config;
1522
+ const e = this.getSardineHost(), { clientId: r, environment: s, flow: a, enableBiometrics: i, enablePortScanning: c } = this.config;
1523
1523
  this.sardineContext = window._Sardine.createContext({
1524
1524
  clientId: r,
1525
1525
  sessionKey: this.sessionKey,
1526
1526
  userIdHash: void 0,
1527
1527
  // Will be set later via updateConfig
1528
- flow: s || window.location.pathname,
1529
- environment: a || "production",
1528
+ flow: a || window.location.pathname,
1529
+ environment: s || "production",
1530
1530
  parentElement: document.body,
1531
1531
  enableBiometrics: i !== !1,
1532
1532
  // Default true
@@ -1562,8 +1562,8 @@ class _t {
1562
1562
  * Add noscript fallback for cases where JS is disabled
1563
1563
  */
1564
1564
  addNoScriptFallback(e) {
1565
- const r = document.createElement("noscript"), a = document.createElement("img"), { clientId: s, flow: i } = this.config;
1566
- a.src = `https://${e}/v1/a.png?clientId=${s}&sessionKey=${this.sessionKey}&flow=${i || "kyc"}&ns=1`, a.style.display = "none", r.appendChild(a), document.body.appendChild(r);
1565
+ const r = document.createElement("noscript"), s = document.createElement("img"), { clientId: a, flow: i } = this.config;
1566
+ s.src = `https://${e}/v1/a.png?clientId=${a}&sessionKey=${this.sessionKey}&flow=${i || "kyc"}&ns=1`, s.style.display = "none", r.appendChild(s), document.body.appendChild(r);
1567
1567
  }
1568
1568
  /**
1569
1569
  * Update configuration (e.g., set userIdHash after login)
@@ -1575,13 +1575,13 @@ class _t {
1575
1575
  }
1576
1576
  e.sessionKey && (this.sessionKey = e.sessionKey), this.sardineContext.updateConfig({
1577
1577
  ...e,
1578
- onConfigUpdate: (r, a, s) => {
1578
+ onConfigUpdate: (r, s, a) => {
1579
1579
  switch (r) {
1580
1580
  case "SESSION_UPDATE_FAILED":
1581
- console.error("[SardinAI] Config update failed:", s);
1581
+ console.error("[SardinAI] Config update failed:", a);
1582
1582
  break;
1583
1583
  case "SESSION_UPDATED":
1584
- console.log("[SardinAI] Config updated:", a);
1584
+ console.log("[SardinAI] Config updated:", s);
1585
1585
  break;
1586
1586
  case "SESSION_NO_UPDATE":
1587
1587
  console.log("[SardinAI] No config update needed");
@@ -1603,18 +1603,18 @@ class _t {
1603
1603
  this.sardineContext && (this.sardineContext = null);
1604
1604
  }
1605
1605
  }
1606
- class fe {
1606
+ class ye {
1607
1607
  /**
1608
1608
  * Create a provider instance
1609
1609
  */
1610
1610
  static createProvider(e, r) {
1611
1611
  switch (e) {
1612
- case ae.Sumsub:
1613
- return new zt(r);
1614
- case ae.Onfido:
1615
- return new $t(r);
1616
- case ae.SardinAI:
1612
+ case se.Sumsub:
1613
+ return new jt(r);
1614
+ case se.Onfido:
1617
1615
  return new _t(r);
1616
+ case se.SardinAI:
1617
+ return new Kt(r);
1618
1618
  default:
1619
1619
  throw new Error(`Unsupported identity provider: ${e}`);
1620
1620
  }
@@ -1622,10 +1622,10 @@ class fe {
1622
1622
  /**
1623
1623
  * Get provider configuration from API token object
1624
1624
  */
1625
- static parseProviderConfig(e, r, a) {
1626
- var s;
1625
+ static parseProviderConfig(e, r, s) {
1626
+ var a;
1627
1627
  switch (e) {
1628
- case ae.Sumsub:
1628
+ case se.Sumsub:
1629
1629
  return {
1630
1630
  accessToken: r.accessToken || r.token,
1631
1631
  applicantEmail: r.email,
@@ -1633,12 +1633,12 @@ class fe {
1633
1633
  externalUserId: r.externalUserId,
1634
1634
  lang: r.lang || "en"
1635
1635
  };
1636
- case ae.Onfido:
1636
+ case se.Onfido:
1637
1637
  return {
1638
1638
  token: r.token || r.sdkToken
1639
1639
  };
1640
- case ae.SardinAI:
1641
- const i = ((s = a == null ? void 0 : a.identityProviders) == null ? void 0 : s.sardinai) || {};
1640
+ case se.SardinAI:
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,
1644
1644
  sessionKey: i.sessionKey || r.sessionKey,
@@ -1653,9 +1653,9 @@ class fe {
1653
1653
  }
1654
1654
  }
1655
1655
  }
1656
- class jt {
1656
+ class Ut {
1657
1657
  constructor(e) {
1658
- K(this, "currentTheme", ee);
1658
+ K(this, "currentTheme", Q);
1659
1659
  K(this, "customStyleElement", null);
1660
1660
  K(this, "container");
1661
1661
  this.container = e || document.documentElement;
@@ -1670,7 +1670,7 @@ class jt {
1670
1670
  * Apply color palette as CSS variables
1671
1671
  */
1672
1672
  applyColors(e) {
1673
- var a;
1673
+ var s;
1674
1674
  const r = {
1675
1675
  primary: e.primary,
1676
1676
  "primary-hover": e.primaryHover,
@@ -1689,18 +1689,18 @@ class jt {
1689
1689
  "text-secondary": e.textSecondary,
1690
1690
  "text-muted": e.textMuted
1691
1691
  };
1692
- Object.entries(r).forEach(([s, i]) => {
1693
- this.container.style.setProperty(`--metakyc-${s}`, i);
1694
- }), (a = this.currentTheme.darkMode) != null && a.colors && this.applyDarkModeColors(this.currentTheme.darkMode.colors);
1692
+ Object.entries(r).forEach(([a, i]) => {
1693
+ this.container.style.setProperty(`--metakyc-${a}`, i);
1694
+ }), (s = this.currentTheme.darkMode) != null && s.colors && this.applyDarkModeColors(this.currentTheme.darkMode.colors);
1695
1695
  }
1696
1696
  /**
1697
1697
  * Apply dark mode color overrides
1698
1698
  */
1699
1699
  applyDarkModeColors(e) {
1700
- Object.entries(e).forEach(([r, a]) => {
1701
- if (a) {
1702
- const s = `--metakyc-dark-${this.kebabCase(r)}`;
1703
- this.container.style.setProperty(s, a);
1700
+ Object.entries(e).forEach(([r, s]) => {
1701
+ if (s) {
1702
+ const a = `--metakyc-dark-${this.kebabCase(r)}`;
1703
+ this.container.style.setProperty(a, s);
1704
1704
  }
1705
1705
  });
1706
1706
  }
@@ -1708,19 +1708,19 @@ class jt {
1708
1708
  * Apply typography settings
1709
1709
  */
1710
1710
  applyTypography(e) {
1711
- e && (e.fontFamily && this.container.style.setProperty("--metakyc-font-family", e.fontFamily), e.headingFont && this.container.style.setProperty("--metakyc-heading-font", e.headingFont), e.fontSize && Object.entries(e.fontSize).forEach(([r, a]) => {
1712
- this.container.style.setProperty(`--metakyc-font-size-${r}`, a);
1713
- }), e.fontWeight && Object.entries(e.fontWeight).forEach(([r, a]) => {
1714
- this.container.style.setProperty(`--metakyc-font-weight-${r}`, a.toString());
1711
+ e && (e.fontFamily && this.container.style.setProperty("--metakyc-font-family", e.fontFamily), e.headingFont && this.container.style.setProperty("--metakyc-heading-font", e.headingFont), e.fontSize && Object.entries(e.fontSize).forEach(([r, s]) => {
1712
+ this.container.style.setProperty(`--metakyc-font-size-${r}`, s);
1713
+ }), e.fontWeight && Object.entries(e.fontWeight).forEach(([r, s]) => {
1714
+ this.container.style.setProperty(`--metakyc-font-weight-${r}`, s.toString());
1715
1715
  }));
1716
1716
  }
1717
1717
  /**
1718
1718
  * Apply spacing settings
1719
1719
  */
1720
1720
  applySpacing(e) {
1721
- e && Object.entries(e).forEach(([r, a]) => {
1722
- const s = `--metakyc-${this.kebabCase(r)}`;
1723
- this.container.style.setProperty(s, a);
1721
+ e && Object.entries(e).forEach(([r, s]) => {
1722
+ const a = `--metakyc-${this.kebabCase(r)}`;
1723
+ this.container.style.setProperty(a, s);
1724
1724
  });
1725
1725
  }
1726
1726
  /**
@@ -1735,18 +1735,19 @@ class jt {
1735
1735
  mergeWithDefault(e) {
1736
1736
  var r;
1737
1737
  return {
1738
- name: e.name || ee.name,
1739
- logo: { ...ee.logo, ...e.logo },
1740
- colors: { ...ee.colors, ...e.colors },
1741
- typography: e.typography ? { ...ee.typography, ...e.typography } : ee.typography,
1742
- spacing: e.spacing ? { ...ee.spacing, ...e.spacing } : ee.spacing,
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,
1743
1744
  customCSS: e.customCSS,
1744
1745
  darkMode: e.darkMode ? {
1745
1746
  colors: {
1746
- ...(r = ee.darkMode) == null ? void 0 : r.colors,
1747
+ ...(r = Q.darkMode) == null ? void 0 : r.colors,
1747
1748
  ...e.darkMode.colors
1748
1749
  }
1749
- } : ee.darkMode
1750
+ } : Q.darkMode
1750
1751
  };
1751
1752
  }
1752
1753
  /**
@@ -1759,7 +1760,7 @@ class jt {
1759
1760
  * Reset to default theme
1760
1761
  */
1761
1762
  resetTheme() {
1762
- this.applyTheme(ee);
1763
+ this.applyTheme(Q);
1763
1764
  }
1764
1765
  /**
1765
1766
  * Remove all custom styles
@@ -1774,147 +1775,148 @@ class jt {
1774
1775
  return e.replace(/([a-z0-9])([A-Z])/g, "$1-$2").toLowerCase();
1775
1776
  }
1776
1777
  }
1777
- const je = Xe(null), Mr = ({ config: t, children: e }) => {
1778
- const r = Oe(() => {
1779
- const a = new ft(t), s = new bt(a), i = new xt(a), c = new vt(a), l = new wt(a), d = new kt(a), u = new Nt(a), g = new St(a), p = new Ct(a), m = new At(a), b = new Lt(a), y = new jt();
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();
1780
1781
  return {
1781
1782
  config: t,
1782
- httpClient: a,
1783
- applicantService: s,
1784
- questionnaireService: i,
1785
- uploadDocumentService: c,
1786
- appropriatenessTestService: l,
1787
- overviewService: d,
1788
- riskScoringService: u,
1789
- identityService: g,
1790
- baseInformationService: p,
1791
- investorCategorizationService: m,
1792
- themeService: b,
1793
- themeManager: y,
1794
- createOrchestrator: () => new Ot(
1795
- s,
1796
- i,
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,
1795
+ currentTheme: r,
1796
+ createOrchestrator: () => new $t(
1797
1797
  c,
1798
1798
  l,
1799
1799
  d,
1800
1800
  u,
1801
1801
  g,
1802
- m
1802
+ p,
1803
+ m,
1804
+ y
1803
1805
  )
1804
1806
  };
1805
- }, [t]);
1807
+ }, [t, r]);
1806
1808
  return V(() => ((async () => {
1807
1809
  try {
1808
1810
  if (t.theme) {
1809
- console.log("[MetaKYC] Applying static theme from config"), r.themeManager.applyTheme(t.theme);
1811
+ console.log("[MetaKYC] Applying static theme from config"), a.themeManager.applyTheme(t.theme), s(a.themeManager.getCurrentTheme());
1810
1812
  return;
1811
1813
  }
1812
1814
  console.log("[MetaKYC] Fetching theme from backend...");
1813
- const s = await r.themeService.getThemeConfiguration();
1814
- r.themeManager.applyTheme(s), console.log("[MetaKYC] Theme loaded and applied");
1815
- } catch (s) {
1816
- console.warn("[MetaKYC] Failed to load theme, using default:", s);
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());
1817
1819
  }
1818
1820
  })(), () => {
1819
- r.themeManager.cleanup();
1820
- }), [t.theme, r.themeService, r.themeManager]), /* @__PURE__ */ n(je.Provider, { value: r, children: e });
1821
+ a.themeManager.cleanup();
1822
+ }), [t.theme, a.themeService, a.themeManager]), /* @__PURE__ */ n(Ue.Provider, { value: a, children: e });
1821
1823
  };
1822
1824
  function re() {
1823
- const t = et(je);
1825
+ const t = rt(Ue);
1824
1826
  if (!t)
1825
1827
  throw new Error("useMetaKYC must be used within a MetaKYCProvider");
1826
1828
  return t;
1827
1829
  }
1828
- async function Kt(t) {
1830
+ async function qt(t) {
1829
1831
  return new Promise((e, r) => {
1830
- const a = new FileReader();
1831
- a.readAsDataURL(t), a.onload = () => {
1832
- const i = a.result.split(",")[1];
1832
+ const s = new FileReader();
1833
+ s.readAsDataURL(t), s.onload = () => {
1834
+ const i = s.result.split(",")[1];
1833
1835
  e(i);
1834
- }, a.onerror = (s) => r(s);
1836
+ }, s.onerror = (a) => r(a);
1835
1837
  });
1836
1838
  }
1837
- function Br(t, e) {
1839
+ function zr(t, e) {
1838
1840
  return t.size <= e;
1839
1841
  }
1840
- function Or(t, e) {
1841
- return e.split(",").map((a) => a.trim()).some((a) => {
1842
- if (a.endsWith("/*")) {
1843
- const s = a.slice(0, -2);
1844
- return t.type.startsWith(s);
1842
+ function $r(t, e) {
1843
+ return e.split(",").map((s) => s.trim()).some((s) => {
1844
+ if (s.endsWith("/*")) {
1845
+ const a = s.slice(0, -2);
1846
+ return t.type.startsWith(a);
1845
1847
  }
1846
- return t.type === a;
1848
+ return t.type === s;
1847
1849
  });
1848
1850
  }
1849
- function Ce(t) {
1851
+ function Ae(t) {
1850
1852
  if (t === 0) return "0 Bytes";
1851
- const e = 1024, r = ["Bytes", "KB", "MB", "GB"], a = Math.floor(Math.log(t) / Math.log(e));
1852
- return Math.round(t / Math.pow(e, a) * 100) / 100 + " " + r[a];
1853
+ const e = 1024, r = ["Bytes", "KB", "MB", "GB"], s = Math.floor(Math.log(t) / Math.log(e));
1854
+ return Math.round(t / Math.pow(e, s) * 100) / 100 + " " + r[s];
1853
1855
  }
1854
- function zr(t) {
1856
+ function jr(t) {
1855
1857
  return t;
1856
1858
  }
1857
- function J(...t) {
1859
+ function X(...t) {
1858
1860
  return t.filter(Boolean).join(" ");
1859
1861
  }
1860
- const be = {
1862
+ const fe = {
1861
1863
  APPLICANT_ID: "metakyc_applicant_id",
1862
1864
  WORKFLOW_STATE: "metakyc_workflow_state"
1863
1865
  };
1864
- function Ut(t) {
1866
+ function Ht(t) {
1865
1867
  try {
1866
- localStorage.setItem(be.APPLICANT_ID, t.toString());
1868
+ localStorage.setItem(fe.APPLICANT_ID, t.toString());
1867
1869
  } catch (e) {
1868
1870
  console.warn("Failed to save applicant ID to storage:", e);
1869
1871
  }
1870
1872
  }
1871
- function qt() {
1873
+ function Vt() {
1872
1874
  try {
1873
- const t = localStorage.getItem(be.APPLICANT_ID);
1875
+ const t = localStorage.getItem(fe.APPLICANT_ID);
1874
1876
  return t ? parseInt(t, 10) : null;
1875
1877
  } catch (t) {
1876
1878
  return console.warn("Failed to retrieve applicant ID from storage:", t), null;
1877
1879
  }
1878
1880
  }
1879
- function Ht() {
1881
+ function Yt() {
1880
1882
  try {
1881
- localStorage.removeItem(be.APPLICANT_ID);
1883
+ localStorage.removeItem(fe.APPLICANT_ID);
1882
1884
  } catch (t) {
1883
1885
  console.warn("Failed to clear applicant ID from storage:", t);
1884
1886
  }
1885
1887
  }
1886
- function Vt(t) {
1888
+ function Wt(t) {
1887
1889
  try {
1888
- localStorage.setItem(be.WORKFLOW_STATE, JSON.stringify(t));
1890
+ localStorage.setItem(fe.WORKFLOW_STATE, JSON.stringify(t));
1889
1891
  } catch (e) {
1890
1892
  console.warn("Failed to save workflow state to storage:", e);
1891
1893
  }
1892
1894
  }
1893
- function $r() {
1895
+ function _r() {
1894
1896
  try {
1895
- const t = localStorage.getItem(be.WORKFLOW_STATE);
1897
+ const t = localStorage.getItem(fe.WORKFLOW_STATE);
1896
1898
  return t ? JSON.parse(t) : null;
1897
1899
  } catch (t) {
1898
1900
  return console.warn("Failed to retrieve workflow state from storage:", t), null;
1899
1901
  }
1900
1902
  }
1901
- function Yt() {
1903
+ function Qt() {
1902
1904
  try {
1903
- localStorage.removeItem(be.WORKFLOW_STATE);
1905
+ localStorage.removeItem(fe.WORKFLOW_STATE);
1904
1906
  } catch (t) {
1905
1907
  console.warn("Failed to clear workflow state from storage:", t);
1906
1908
  }
1907
1909
  }
1908
- function _r() {
1909
- Ht(), Yt();
1910
+ function Kr() {
1911
+ Yt(), Qt();
1910
1912
  }
1911
- function Wt(t) {
1912
- const { createOrchestrator: e } = re(), [r, a] = v(null), [s, i] = v(!1), [c, l] = v(null), d = ze(null), u = t || qt();
1913
+ 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();
1913
1915
  V(() => {
1914
1916
  d.current || (d.current = e());
1915
1917
  }, [e]), V(() => {
1916
1918
  var h;
1917
- r && u && (Ut(u), Vt({
1919
+ r && u && (Ht(u), Wt({
1918
1920
  applicantId: u,
1919
1921
  currentStepOrder: (h = r.currentStep) == null ? void 0 : h.order,
1920
1922
  status: r.status,
@@ -1928,7 +1930,7 @@ function Wt(t) {
1928
1930
  i(!0), l(null);
1929
1931
  try {
1930
1932
  const h = await d.current.initialize(u);
1931
- a(h);
1933
+ s(h);
1932
1934
  } catch (h) {
1933
1935
  l(h);
1934
1936
  } finally {
@@ -1944,7 +1946,7 @@ function Wt(t) {
1944
1946
  i(!0), l(null);
1945
1947
  try {
1946
1948
  const h = await d.current.refreshProgress();
1947
- a(h);
1949
+ s(h);
1948
1950
  } catch (h) {
1949
1951
  l(h);
1950
1952
  } finally {
@@ -1956,7 +1958,7 @@ function Wt(t) {
1956
1958
  i(!0), l(null);
1957
1959
  try {
1958
1960
  const h = await d.current.moveToNextStep();
1959
- a(h);
1961
+ s(h);
1960
1962
  } catch (h) {
1961
1963
  l(h);
1962
1964
  } finally {
@@ -1968,7 +1970,7 @@ function Wt(t) {
1968
1970
  i(!0), l(null);
1969
1971
  try {
1970
1972
  const h = await d.current.moveToPreviousStep();
1971
- a(h);
1973
+ s(h);
1972
1974
  } catch (h) {
1973
1975
  l(h);
1974
1976
  } finally {
@@ -1981,28 +1983,28 @@ function Wt(t) {
1981
1983
  try {
1982
1984
  await d.current.submitCurrentStep(h);
1983
1985
  const N = await d.current.refreshProgress();
1984
- a(N);
1986
+ s(N);
1985
1987
  } catch (N) {
1986
1988
  throw l(N), N;
1987
1989
  } finally {
1988
1990
  i(!1);
1989
1991
  }
1990
1992
  }
1991
- }, []), x = Pe.useMemo(() => r != null && r.stepInfoList ? [...r.stepInfoList].sort((h, N) => h.order - N.order) : [], [r == null ? void 0 : r.stepInfoList]), R = Pe.useMemo(() => r ? r.nextWorkflowKey && r.nextWorkflowKey !== r.workFlowKey : !1, [r]);
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]);
1992
1994
  return {
1993
1995
  progress: r,
1994
1996
  applicantId: u,
1995
1997
  currentStep: (r == null ? void 0 : r.currentStep) || null,
1996
- steps: x,
1997
- status: (r == null ? void 0 : r.status) || se.None,
1998
+ steps: f,
1999
+ status: (r == null ? void 0 : r.status) || ae.None,
1998
2000
  workflowResult: (r == null ? void 0 : r.workflowResult) || null,
1999
2001
  workflowKey: r == null ? void 0 : r.workFlowKey,
2000
2002
  nextWorkflowKey: r == null ? void 0 : r.nextWorkflowKey,
2001
- hasWorkflowChanged: R,
2002
- isLoading: s,
2003
+ hasWorkflowChanged: P,
2004
+ isLoading: a,
2003
2005
  error: c,
2004
- isComplete: (r == null ? void 0 : r.status) === se.Finished,
2005
- isOnHold: (r == null ? void 0 : r.status) === se.OnHold,
2006
+ isComplete: (r == null ? void 0 : r.status) === ae.Finished,
2007
+ isOnHold: (r == null ? void 0 : r.status) === ae.OnHold,
2006
2008
  refreshProgress: p,
2007
2009
  moveToNext: m,
2008
2010
  moveBack: b,
@@ -2010,13 +2012,13 @@ function Wt(t) {
2010
2012
  orchestrator: d.current
2011
2013
  };
2012
2014
  }
2013
- function Qt(t) {
2014
- const { questionnaireService: e } = re(), [r, a] = v(null), [s, i] = v(!1), [c, l] = v(!1), [d, u] = v(null), g = q(async () => {
2015
+ 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 () => {
2015
2017
  if (t) {
2016
2018
  i(!0), u(null);
2017
2019
  try {
2018
2020
  const m = await e.getQuestionnaire(t);
2019
- a(m);
2021
+ s(m);
2020
2022
  } catch (m) {
2021
2023
  u(m);
2022
2024
  } finally {
@@ -2042,20 +2044,20 @@ function Qt(t) {
2042
2044
  );
2043
2045
  return {
2044
2046
  questionnaire: r,
2045
- isLoading: s,
2047
+ isLoading: a,
2046
2048
  isSubmitting: c,
2047
2049
  error: d,
2048
2050
  load: g,
2049
2051
  submit: p
2050
2052
  };
2051
2053
  }
2052
- function Gt(t) {
2053
- const { uploadDocumentService: e } = re(), [r, a] = v(null), [s, i] = v(!1), [c, l] = v(!1), [d, u] = v(0), [g, p] = v(null), m = q(async () => {
2054
+ 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 () => {
2054
2056
  if (t) {
2055
2057
  i(!0), p(null);
2056
2058
  try {
2057
2059
  const y = await e.getUploadDocument(t);
2058
- a(y);
2060
+ s(y);
2059
2061
  } catch (y) {
2060
2062
  p(y);
2061
2063
  } finally {
@@ -2071,8 +2073,8 @@ function Gt(t) {
2071
2073
  l(!0), u(0), p(null);
2072
2074
  try {
2073
2075
  await e.fillUploadDocument(y), u(100);
2074
- } catch (x) {
2075
- throw p(x), x;
2076
+ } catch (f) {
2077
+ throw p(f), f;
2076
2078
  } finally {
2077
2079
  l(!1);
2078
2080
  }
@@ -2081,7 +2083,7 @@ function Gt(t) {
2081
2083
  );
2082
2084
  return {
2083
2085
  uploadDocument: r,
2084
- isLoading: s,
2086
+ isLoading: a,
2085
2087
  isSubmitting: c,
2086
2088
  uploadProgress: d,
2087
2089
  error: g,
@@ -2089,13 +2091,13 @@ function Gt(t) {
2089
2091
  submit: b
2090
2092
  };
2091
2093
  }
2092
- function jr(t) {
2093
- const { appropriatenessTestService: e } = re(), [r, a] = v(null), [s, i] = v(!1), [c, l] = v(!1), [d, u] = v(null), [g, p] = v(null), m = q(async () => {
2094
+ 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 () => {
2094
2096
  if (t) {
2095
2097
  i(!0), u(null);
2096
2098
  try {
2097
2099
  const y = await e.getAppropriatenessTest(t);
2098
- a(y);
2100
+ s(y);
2099
2101
  } catch (y) {
2100
2102
  u(y);
2101
2103
  } finally {
@@ -2110,10 +2112,10 @@ function jr(t) {
2110
2112
  async (y) => {
2111
2113
  l(!0), u(null);
2112
2114
  try {
2113
- const x = await e.fillAppropriatenessTest(y);
2114
- return p(x), x;
2115
- } catch (x) {
2116
- throw u(x), x;
2115
+ const f = await e.fillAppropriatenessTest(y);
2116
+ return p(f), f;
2117
+ } catch (f) {
2118
+ throw u(f), f;
2117
2119
  } finally {
2118
2120
  l(!1);
2119
2121
  }
@@ -2123,20 +2125,20 @@ function jr(t) {
2123
2125
  return {
2124
2126
  test: r,
2125
2127
  result: g,
2126
- isLoading: s,
2128
+ isLoading: a,
2127
2129
  isSubmitting: c,
2128
2130
  error: d,
2129
2131
  load: m,
2130
2132
  submit: b
2131
2133
  };
2132
2134
  }
2133
- function Zt(t) {
2134
- const { overviewService: e } = re(), [r, a] = v(null), [s, i] = v(!1), [c, l] = v(!1), [d, u] = v(null), g = q(async () => {
2135
+ 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 () => {
2135
2137
  if (t) {
2136
2138
  i(!0), u(null);
2137
2139
  try {
2138
2140
  const m = await e.getOverviewData(t);
2139
- a(m);
2141
+ s(m);
2140
2142
  } catch (m) {
2141
2143
  u(m);
2142
2144
  } finally {
@@ -2161,17 +2163,17 @@ function Zt(t) {
2161
2163
  }, [t, e]);
2162
2164
  return {
2163
2165
  overview: r,
2164
- isLoading: s,
2166
+ isLoading: a,
2165
2167
  isSubmitting: c,
2166
2168
  error: d,
2167
2169
  load: g,
2168
2170
  passOverview: p
2169
2171
  };
2170
2172
  }
2171
- function Jt(t) {
2172
- const { identityService: e } = re(), [r, a] = v(
2173
+ function er(t) {
2174
+ const { identityService: e } = re(), [r, s] = x(
2173
2175
  null
2174
- ), [s, i] = v(!1), [c, l] = v(null), d = q(
2176
+ ), [a, i] = x(!1), [c, l] = x(null), d = q(
2175
2177
  async (p, m) => {
2176
2178
  if (t) {
2177
2179
  i(!0), l(null);
@@ -2185,7 +2187,7 @@ function Jt(t) {
2185
2187
  };
2186
2188
  console.log("Identity request input:", b);
2187
2189
  const y = await e.identityRequest(b);
2188
- return console.log("Identity request result:", y), a(y), y;
2190
+ return console.log("Identity request result:", y), s(y), y;
2189
2191
  } catch (b) {
2190
2192
  throw l(b), b;
2191
2193
  } finally {
@@ -2205,7 +2207,7 @@ function Jt(t) {
2205
2207
  redirectUrl: p,
2206
2208
  ttl: m
2207
2209
  }, y = await e.identityCompanyRequest(b);
2208
- return a(y), y;
2210
+ return s(y), y;
2209
2211
  } catch (b) {
2210
2212
  throw l(b), b;
2211
2213
  } finally {
@@ -2227,7 +2229,7 @@ function Jt(t) {
2227
2229
  };
2228
2230
  console.log("Restarting identity with input:", p);
2229
2231
  const m = await e.identityRequest(p);
2230
- return console.log("Restart identity result:", m), a(m), m;
2232
+ return console.log("Restart identity result:", m), s(m), m;
2231
2233
  } catch (p) {
2232
2234
  throw l(p), p;
2233
2235
  } finally {
@@ -2239,20 +2241,20 @@ function Jt(t) {
2239
2241
  identityData: r,
2240
2242
  provider: (r == null ? void 0 : r.provider) || null,
2241
2243
  token: (r == null ? void 0 : r.publicProviderTokenObject) || null,
2242
- isLoading: s,
2244
+ isLoading: a,
2243
2245
  error: c,
2244
2246
  requestIdentity: d,
2245
2247
  requestCompanyIdentity: u,
2246
2248
  restartIdentity: g
2247
2249
  };
2248
2250
  }
2249
- function Xt(t) {
2250
- const { riskScoringService: e } = re(), [r, a] = v(null), [s, i] = v(!1), [c, l] = v(!1), [d, u] = v(null), [g, p] = v(null), m = q(async () => {
2251
+ 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 () => {
2251
2253
  if (t) {
2252
2254
  i(!0), u(null);
2253
2255
  try {
2254
2256
  const y = await e.getRiskCriterias(t);
2255
- a(y);
2257
+ s(y);
2256
2258
  } catch (y) {
2257
2259
  u(y);
2258
2260
  } finally {
@@ -2267,10 +2269,10 @@ function Xt(t) {
2267
2269
  async (y) => {
2268
2270
  l(!0), u(null);
2269
2271
  try {
2270
- const x = await e.submitRiskScoring(y);
2271
- return p(x), x;
2272
- } catch (x) {
2273
- throw u(x), x;
2272
+ const f = await e.submitRiskScoring(y);
2273
+ return p(f), f;
2274
+ } catch (f) {
2275
+ throw u(f), f;
2274
2276
  } finally {
2275
2277
  l(!1);
2276
2278
  }
@@ -2280,21 +2282,21 @@ function Xt(t) {
2280
2282
  return {
2281
2283
  criteria: r,
2282
2284
  result: g,
2283
- isLoading: s,
2285
+ isLoading: a,
2284
2286
  isSubmitting: c,
2285
2287
  error: d,
2286
2288
  load: m,
2287
2289
  submit: b
2288
2290
  };
2289
2291
  }
2290
- function er() {
2291
- const { applicantService: t, config: e } = re(), [r, a] = v(!1), [s, i] = v(null), c = () => "xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g, function(p) {
2292
+ 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) {
2292
2294
  const m = Math.random() * 16 | 0;
2293
2295
  return (p === "x" ? m : m & 3 | 8).toString(16);
2294
2296
  }), l = q(
2295
2297
  async (p) => {
2296
2298
  var m;
2297
- a(!0), i(null);
2299
+ s(!0), i(null);
2298
2300
  try {
2299
2301
  if (p.applicantAdditionalDatas || (p.applicantAdditionalDatas = []), (m = e.identityProviders) != null && m.sardinai) {
2300
2302
  const y = c();
@@ -2307,62 +2309,62 @@ function er() {
2307
2309
  } catch (b) {
2308
2310
  throw i(b), b;
2309
2311
  } finally {
2310
- a(!1);
2312
+ s(!1);
2311
2313
  }
2312
2314
  },
2313
2315
  [t, e]
2314
2316
  ), d = q(
2315
2317
  async (p) => {
2316
- a(!0), i(null);
2318
+ s(!0), i(null);
2317
2319
  try {
2318
2320
  return await t.createCompanyApplicant(p);
2319
2321
  } catch (m) {
2320
2322
  throw i(m), m;
2321
2323
  } finally {
2322
- a(!1);
2324
+ s(!1);
2323
2325
  }
2324
2326
  },
2325
2327
  [t]
2326
2328
  ), u = q(
2327
2329
  async (p) => {
2328
- a(!0), i(null);
2330
+ s(!0), i(null);
2329
2331
  try {
2330
2332
  return await t.getApplicantData(p);
2331
2333
  } catch (m) {
2332
2334
  throw i(m), m;
2333
2335
  } finally {
2334
- a(!1);
2336
+ s(!1);
2335
2337
  }
2336
2338
  },
2337
2339
  [t]
2338
2340
  ), g = q(
2339
2341
  async (p) => {
2340
- a(!0), i(null);
2342
+ s(!0), i(null);
2341
2343
  try {
2342
2344
  await t.stopProgress(p);
2343
2345
  } catch (m) {
2344
2346
  throw i(m), m;
2345
2347
  } finally {
2346
- a(!1);
2348
+ s(!1);
2347
2349
  }
2348
2350
  },
2349
2351
  [t]
2350
2352
  );
2351
2353
  return {
2352
2354
  isLoading: r,
2353
- error: s,
2355
+ error: a,
2354
2356
  createApplicant: l,
2355
2357
  createCompanyApplicant: d,
2356
2358
  getApplicantData: u,
2357
2359
  stopProgress: g
2358
2360
  };
2359
2361
  }
2360
- const _ = ({
2362
+ const j = ({
2361
2363
  children: t,
2362
2364
  variant: e = "primary",
2363
2365
  size: r = "md",
2364
- isLoading: a = !1,
2365
- disabled: s,
2366
+ isLoading: s = !1,
2367
+ disabled: a,
2366
2368
  className: i,
2367
2369
  ...c
2368
2370
  }) => {
@@ -2380,11 +2382,11 @@ const _ = ({
2380
2382
  return /* @__PURE__ */ o(
2381
2383
  "button",
2382
2384
  {
2383
- className: J(l, d[e], u[r], i),
2384
- disabled: s || a,
2385
+ className: X(l, d[e], u[r], i),
2386
+ disabled: a || s,
2385
2387
  ...c,
2386
2388
  children: [
2387
- a && /* @__PURE__ */ o(
2389
+ s && /* @__PURE__ */ o(
2388
2390
  "svg",
2389
2391
  {
2390
2392
  className: "animate-spin -ml-1 mr-2 h-4 w-4",
@@ -2418,52 +2420,76 @@ const _ = ({
2418
2420
  ]
2419
2421
  }
2420
2422
  );
2421
- }, G = Re(
2422
- ({ label: t, error: e, helperText: r, leftIcon: a, rightIcon: s, className: i, ...c }, l) => /* @__PURE__ */ o("div", { className: "w-full", children: [
2423
+ }, Z = De(
2424
+ ({ label: t, error: e, helperText: r, leftIcon: s, rightIcon: a, className: i, ...c }, l) => /* @__PURE__ */ o("div", { className: "w-full", children: [
2423
2425
  t && /* @__PURE__ */ o("label", { className: "block text-sm font-medium text-gray-700 dark:text-gray-300 mb-1", children: [
2424
2426
  t,
2425
2427
  c.required && /* @__PURE__ */ n("span", { className: "text-danger-500 ml-1", children: "*" })
2426
2428
  ] }),
2427
2429
  /* @__PURE__ */ o("div", { className: "relative", children: [
2428
- a && /* @__PURE__ */ n("div", { className: "absolute inset-y-0 left-0 pl-3 flex items-center pointer-events-none", children: a }),
2430
+ s && /* @__PURE__ */ n("div", { className: "absolute inset-y-0 left-0 pl-3 flex items-center pointer-events-none", children: s }),
2429
2431
  /* @__PURE__ */ n(
2430
2432
  "input",
2431
2433
  {
2432
2434
  ref: l,
2433
- className: J(
2435
+ className: X(
2434
2436
  "block w-full rounded-lg border px-3 py-2 text-sm transition-colors",
2435
2437
  "focus:outline-none focus:ring-2 focus:ring-primary-500 focus:border-transparent",
2436
2438
  "disabled:bg-gray-100 disabled:cursor-not-allowed",
2437
2439
  e ? "border-danger-500 focus:ring-danger-500" : "border-gray-300 dark:border-gray-600",
2438
2440
  "dark:bg-gray-800 dark:text-white",
2439
- a ? "pl-10" : "",
2440
- s ? "pr-10" : "",
2441
+ s ? "pl-10" : "",
2442
+ a ? "pr-10" : "",
2441
2443
  i
2442
2444
  ),
2443
2445
  ...c
2444
2446
  }
2445
2447
  ),
2446
- s && /* @__PURE__ */ n("div", { className: "absolute inset-y-0 right-0 pr-3 flex items-center pointer-events-none", children: s })
2448
+ a && /* @__PURE__ */ n("div", { className: "absolute inset-y-0 right-0 pr-3 flex items-center pointer-events-none", children: a })
2447
2449
  ] }),
2448
2450
  e && /* @__PURE__ */ n("p", { className: "mt-1 text-sm text-danger-500", children: e }),
2449
2451
  !e && r && /* @__PURE__ */ n("p", { className: "mt-1 text-sm text-gray-500", children: r })
2450
2452
  ] })
2451
2453
  );
2452
- G.displayName = "Input";
2453
- const L = ({ children: t, className: e, ...r }) => /* @__PURE__ */ n(
2454
+ Z.displayName = "Input";
2455
+ const T = ({ children: t, className: e, ...r }) => /* @__PURE__ */ n(
2454
2456
  "div",
2455
2457
  {
2456
- className: J(
2457
- "bg-white dark:bg-gray-800 rounded-xl shadow-sm border border-gray-200 dark:border-gray-700",
2458
+ className: X(
2459
+ "rounded-xl shadow-sm border",
2458
2460
  e
2459
2461
  ),
2462
+ style: {
2463
+ backgroundColor: "var(--metakyc-surface, #ffffff)",
2464
+ borderColor: "var(--metakyc-border, #e5e7eb)"
2465
+ },
2466
+ ...r,
2467
+ children: t
2468
+ }
2469
+ ), J = ({ children: t, className: e, ...r }) => /* @__PURE__ */ n(
2470
+ "div",
2471
+ {
2472
+ className: X("px-6 py-4 border-b", e),
2473
+ style: {
2474
+ borderColor: "var(--metakyc-border, #e5e7eb)"
2475
+ },
2476
+ ...r,
2477
+ children: t
2478
+ }
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(
2480
+ "div",
2481
+ {
2482
+ className: X("px-6 py-4 border-t", e),
2483
+ style: {
2484
+ borderColor: "var(--metakyc-border, #e5e7eb)"
2485
+ },
2460
2486
  ...r,
2461
2487
  children: t
2462
2488
  }
2463
- ), Z = ({ children: t, className: e, ...r }) => /* @__PURE__ */ n("div", { className: J("px-6 py-4 border-b border-gray-200 dark:border-gray-700", e), ...r, children: t }), T = ({ children: t, className: e, ...r }) => /* @__PURE__ */ n("div", { className: J("px-6 py-4", e), ...r, children: t }), te = ({ children: t, className: e, ...r }) => /* @__PURE__ */ n("div", { className: J("px-6 py-4 border-t border-gray-200 dark:border-gray-700", e), ...r, children: t }), ue = ({ children: t, variant: e = "default", className: r, ...a }) => /* @__PURE__ */ n(
2489
+ ), me = ({ children: t, variant: e = "default", className: r, ...s }) => /* @__PURE__ */ n(
2464
2490
  "span",
2465
2491
  {
2466
- className: J(
2492
+ className: X(
2467
2493
  "inline-flex items-center px-2.5 py-0.5 rounded-full text-xs font-medium",
2468
2494
  {
2469
2495
  default: "bg-gray-100 text-gray-800 dark:bg-gray-700 dark:text-gray-300",
@@ -2474,19 +2500,19 @@ const L = ({ children: t, className: e, ...r }) => /* @__PURE__ */ n(
2474
2500
  }[e],
2475
2501
  r
2476
2502
  ),
2477
- ...a,
2503
+ ...s,
2478
2504
  children: t
2479
2505
  }
2480
2506
  ), ie = ({ size: t = "md", className: e, ...r }) => {
2481
- const a = {
2507
+ const s = {
2482
2508
  sm: "h-4 w-4",
2483
2509
  md: "h-8 w-8",
2484
2510
  lg: "h-12 w-12"
2485
2511
  };
2486
- return /* @__PURE__ */ n("div", { className: J("flex items-center justify-center", e), ...r, children: /* @__PURE__ */ o(
2512
+ return /* @__PURE__ */ n("div", { className: X("flex items-center justify-center", e), ...r, children: /* @__PURE__ */ o(
2487
2513
  "svg",
2488
2514
  {
2489
- className: J("animate-spin text-primary-500", a[t]),
2515
+ className: X("animate-spin text-primary-500", s[t]),
2490
2516
  xmlns: "http://www.w3.org/2000/svg",
2491
2517
  fill: "none",
2492
2518
  viewBox: "0 0 24 24",
@@ -2513,8 +2539,8 @@ const L = ({ children: t, className: e, ...r }) => /* @__PURE__ */ n(
2513
2539
  ]
2514
2540
  }
2515
2541
  ) });
2516
- }, ye = Re(
2517
- ({ label: t, error: e, helperText: r, options: a, placeholder: s, className: i, ...c }, l) => /* @__PURE__ */ o("div", { className: "w-full", children: [
2542
+ }, ge = De(
2543
+ ({ label: t, error: e, helperText: r, options: s, placeholder: a, className: i, ...c }, l) => /* @__PURE__ */ o("div", { className: "w-full", children: [
2518
2544
  t && /* @__PURE__ */ o("label", { className: "block text-sm font-medium text-gray-700 dark:text-gray-300 mb-1", children: [
2519
2545
  t,
2520
2546
  c.required && /* @__PURE__ */ n("span", { className: "text-danger-500 ml-1", children: "*" })
@@ -2523,7 +2549,7 @@ const L = ({ children: t, className: e, ...r }) => /* @__PURE__ */ n(
2523
2549
  "select",
2524
2550
  {
2525
2551
  ref: l,
2526
- className: J(
2552
+ className: X(
2527
2553
  "block w-full rounded-lg border px-3 py-2 text-sm transition-colors",
2528
2554
  "focus:outline-none focus:ring-2 focus:ring-primary-500 focus:border-transparent",
2529
2555
  "disabled:bg-gray-100 disabled:cursor-not-allowed",
@@ -2533,8 +2559,8 @@ const L = ({ children: t, className: e, ...r }) => /* @__PURE__ */ n(
2533
2559
  ),
2534
2560
  ...c,
2535
2561
  children: [
2536
- s && /* @__PURE__ */ n("option", { value: "", disabled: !0, children: s }, "__placeholder__"),
2537
- a.map((d, u) => /* @__PURE__ */ n(
2562
+ a && /* @__PURE__ */ n("option", { value: "", disabled: !0, children: a }, "__placeholder__"),
2563
+ s.map((d, u) => /* @__PURE__ */ n(
2538
2564
  "option",
2539
2565
  {
2540
2566
  value: d.value,
@@ -2550,45 +2576,45 @@ const L = ({ children: t, className: e, ...r }) => /* @__PURE__ */ n(
2550
2576
  !e && r && /* @__PURE__ */ n("p", { className: "mt-1 text-sm text-gray-500", children: r })
2551
2577
  ] })
2552
2578
  );
2553
- ye.displayName = "Select";
2554
- const tr = ({
2579
+ ge.displayName = "Select";
2580
+ const nr = ({
2555
2581
  label: t,
2556
2582
  error: e,
2557
2583
  accept: r,
2558
- multiple: a = !1,
2559
- maxSize: s,
2584
+ multiple: s = !1,
2585
+ maxSize: a,
2560
2586
  onChange: i,
2561
2587
  value: c = [],
2562
2588
  className: l
2563
2589
  }) => {
2564
- const [d, u] = v(!1), g = ze(null), p = (h) => {
2590
+ const [d, u] = x(!1), g = je(null), p = (h) => {
2565
2591
  if (!h) return;
2566
2592
  const N = Array.from(h);
2567
- if (s && N.filter((E) => E.size > s).length > 0) {
2568
- const E = Ce(s);
2569
- alert(`Some files exceed the maximum size of ${E}`);
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}`);
2570
2596
  return;
2571
2597
  }
2572
- i == null || i(a ? [...c, ...N] : [N[0]]);
2598
+ i == null || i(s ? [...c, ...N] : [N[0]]);
2573
2599
  }, m = (h) => {
2574
2600
  h.preventDefault(), u(!0);
2575
2601
  }, b = () => {
2576
2602
  u(!1);
2577
2603
  }, y = (h) => {
2578
2604
  h.preventDefault(), u(!1), p(h.dataTransfer.files);
2579
- }, x = () => {
2605
+ }, f = () => {
2580
2606
  var h;
2581
2607
  (h = g.current) == null || h.click();
2582
- }, R = (h) => {
2583
- const N = c.filter((w, E) => E !== h);
2608
+ }, P = (h) => {
2609
+ const N = c.filter((w, I) => I !== h);
2584
2610
  i == null || i(N);
2585
2611
  };
2586
- return /* @__PURE__ */ o("div", { className: J("w-full", l), children: [
2612
+ return /* @__PURE__ */ o("div", { className: X("w-full", l), children: [
2587
2613
  t && /* @__PURE__ */ n("label", { className: "block text-sm font-medium text-gray-700 dark:text-gray-300 mb-1", children: t }),
2588
2614
  /* @__PURE__ */ o(
2589
2615
  "div",
2590
2616
  {
2591
- className: J(
2617
+ className: X(
2592
2618
  "border-2 border-dashed rounded-lg p-6 text-center cursor-pointer transition-colors",
2593
2619
  d ? "border-primary-500 bg-primary-50 dark:bg-primary-900/20" : "border-gray-300 dark:border-gray-600 hover:border-primary-500",
2594
2620
  e && "border-danger-500"
@@ -2596,7 +2622,7 @@ const tr = ({
2596
2622
  onDragOver: m,
2597
2623
  onDragLeave: b,
2598
2624
  onDrop: y,
2599
- onClick: x,
2625
+ onClick: f,
2600
2626
  children: [
2601
2627
  /* @__PURE__ */ n(
2602
2628
  "input",
@@ -2605,7 +2631,7 @@ const tr = ({
2605
2631
  type: "file",
2606
2632
  className: "hidden",
2607
2633
  accept: r,
2608
- multiple: a,
2634
+ multiple: s,
2609
2635
  onChange: (h) => p(h.target.files)
2610
2636
  }
2611
2637
  ),
@@ -2632,9 +2658,9 @@ const tr = ({
2632
2658
  /* @__PURE__ */ n("span", { className: "font-medium text-primary-500", children: "Click to upload" }),
2633
2659
  " or drag and drop"
2634
2660
  ] }),
2635
- s && /* @__PURE__ */ o("p", { className: "text-xs text-gray-500", children: [
2661
+ a && /* @__PURE__ */ o("p", { className: "text-xs text-gray-500", children: [
2636
2662
  "Maximum file size: ",
2637
- Ce(s)
2663
+ Ae(a)
2638
2664
  ] })
2639
2665
  ] })
2640
2666
  ]
@@ -2665,7 +2691,7 @@ const tr = ({
2665
2691
  /* @__PURE__ */ n("span", { className: "text-sm text-gray-700 dark:text-gray-300 truncate", children: h.name }),
2666
2692
  /* @__PURE__ */ o("span", { className: "text-xs text-gray-500", children: [
2667
2693
  "(",
2668
- Ce(h.size),
2694
+ Ae(h.size),
2669
2695
  ")"
2670
2696
  ] })
2671
2697
  ] }),
@@ -2674,7 +2700,7 @@ const tr = ({
2674
2700
  {
2675
2701
  type: "button",
2676
2702
  onClick: (w) => {
2677
- w.stopPropagation(), R(N);
2703
+ w.stopPropagation(), P(N);
2678
2704
  },
2679
2705
  className: "ml-2 text-danger-500 hover:text-danger-700 focus:outline-none",
2680
2706
  children: /* @__PURE__ */ n("svg", { className: "h-5 w-5", fill: "currentColor", viewBox: "0 0 20 20", children: /* @__PURE__ */ n(
@@ -2693,11 +2719,11 @@ const tr = ({
2693
2719
  )) }),
2694
2720
  e && /* @__PURE__ */ n("p", { className: "mt-1 text-sm text-danger-500", children: e })
2695
2721
  ] });
2696
- }, rr = Re(
2697
- ({ countryCode: t = "+1", onCountryCodeChange: e, className: r, ...a }, s) => /* @__PURE__ */ o("div", { className: "w-full", children: [
2698
- a.label && /* @__PURE__ */ o("label", { className: "block text-sm font-medium text-gray-700 dark:text-gray-300 mb-1", children: [
2699
- a.label,
2700
- a.required && /* @__PURE__ */ n("span", { className: "text-danger-500 ml-1", children: "*" })
2722
+ }, sr = De(
2723
+ ({ countryCode: t = "+1", onCountryCodeChange: e, className: r, ...s }, a) => /* @__PURE__ */ o("div", { className: "w-full", children: [
2724
+ s.label && /* @__PURE__ */ o("label", { className: "block text-sm font-medium text-gray-700 dark:text-gray-300 mb-1", children: [
2725
+ s.label,
2726
+ s.required && /* @__PURE__ */ n("span", { className: "text-danger-500 ml-1", children: "*" })
2701
2727
  ] }),
2702
2728
  /* @__PURE__ */ o("div", { className: "flex gap-2", children: [
2703
2729
  /* @__PURE__ */ n(
@@ -2706,7 +2732,7 @@ const tr = ({
2706
2732
  type: "text",
2707
2733
  value: t,
2708
2734
  onChange: (i) => e == null ? void 0 : e(i.target.value),
2709
- className: J(
2735
+ className: X(
2710
2736
  "w-20 rounded-lg border px-3 py-2 text-sm",
2711
2737
  "focus:outline-none focus:ring-2 focus:ring-primary-500 focus:border-transparent",
2712
2738
  "border-gray-300 dark:border-gray-600 dark:bg-gray-800 dark:text-white"
@@ -2715,50 +2741,50 @@ const tr = ({
2715
2741
  }
2716
2742
  ),
2717
2743
  /* @__PURE__ */ n(
2718
- G,
2744
+ Z,
2719
2745
  {
2720
- ref: s,
2746
+ ref: a,
2721
2747
  type: "tel",
2722
- className: J("flex-1", r),
2723
- ...a,
2748
+ className: X("flex-1", r),
2749
+ ...s,
2724
2750
  label: ""
2725
2751
  }
2726
2752
  )
2727
2753
  ] }),
2728
- a.error && /* @__PURE__ */ n("p", { className: "mt-1 text-sm text-danger-500", children: a.error })
2754
+ s.error && /* @__PURE__ */ n("p", { className: "mt-1 text-sm text-danger-500", children: s.error })
2729
2755
  ] })
2730
2756
  );
2731
- rr.displayName = "PhoneInput";
2732
- const Fe = (t, e, r) => {
2757
+ sr.displayName = "PhoneInput";
2758
+ const Te = (t, e, r) => {
2733
2759
  if (t && "reportValidity" in t) {
2734
- const a = Ae(r, e);
2735
- t.setCustomValidity(a && a.message || ""), t.reportValidity();
2760
+ const s = Ee(r, e);
2761
+ t.setCustomValidity(s && s.message || ""), t.reportValidity();
2736
2762
  }
2737
- }, Ie = (t, e) => {
2763
+ }, Re = (t, e) => {
2738
2764
  for (const r in e.fields) {
2739
- const a = e.fields[r];
2740
- a && a.ref && "reportValidity" in a.ref ? Fe(a.ref, r, t) : a && a.refs && a.refs.forEach((s) => Fe(s, r, t));
2765
+ 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));
2741
2767
  }
2742
- }, Le = (t, e) => {
2743
- e.shouldUseNativeValidation && Ie(t, e);
2768
+ }, Me = (t, e) => {
2769
+ e.shouldUseNativeValidation && Re(t, e);
2744
2770
  const r = {};
2745
- for (const a in t) {
2746
- const s = Ae(e.fields, a), i = Object.assign(t[a] || {}, { ref: s && s.ref });
2747
- if (nr(e.names || Object.keys(t), a)) {
2748
- const c = Object.assign({}, Ae(r, a));
2749
- Se(c, "root", i), Se(r, a, c);
2750
- } else Se(r, a, i);
2771
+ for (const s in t) {
2772
+ const a = Ee(e.fields, s), i = Object.assign(t[s] || {}, { ref: a && a.ref });
2773
+ 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);
2751
2777
  }
2752
2778
  return r;
2753
- }, nr = (t, e) => {
2754
- const r = Te(e);
2755
- return t.some((a) => Te(a).match(`^${r}\\.\\d+`));
2779
+ }, ar = (t, e) => {
2780
+ const r = Be(e);
2781
+ return t.some((s) => Be(s).match(`^${r}\\.\\d+`));
2756
2782
  };
2757
- function Te(t) {
2783
+ function Be(t) {
2758
2784
  return t.replace(/\]|\[/g, "");
2759
2785
  }
2760
- function Ke(t, e, r) {
2761
- function a(l, d) {
2786
+ function qe(t, e, r) {
2787
+ function s(l, d) {
2762
2788
  var u;
2763
2789
  Object.defineProperty(l, "_zod", {
2764
2790
  value: l._zod ?? {},
@@ -2768,52 +2794,52 @@ function Ke(t, e, r) {
2768
2794
  g in l || Object.defineProperty(l, g, { value: c.prototype[g].bind(l) });
2769
2795
  l._zod.constr = c, l._zod.def = d;
2770
2796
  }
2771
- const s = (r == null ? void 0 : r.Parent) ?? Object;
2772
- class i extends s {
2797
+ const a = (r == null ? void 0 : r.Parent) ?? Object;
2798
+ class i extends a {
2773
2799
  }
2774
2800
  Object.defineProperty(i, "name", { value: t });
2775
2801
  function c(l) {
2776
2802
  var d;
2777
2803
  const u = r != null && r.Parent ? new i() : this;
2778
- a(u, l), (d = u._zod).deferred ?? (d.deferred = []);
2804
+ s(u, l), (d = u._zod).deferred ?? (d.deferred = []);
2779
2805
  for (const g of u._zod.deferred)
2780
2806
  g();
2781
2807
  return u;
2782
2808
  }
2783
- return Object.defineProperty(c, "init", { value: a }), Object.defineProperty(c, Symbol.hasInstance, {
2809
+ return Object.defineProperty(c, "init", { value: s }), Object.defineProperty(c, Symbol.hasInstance, {
2784
2810
  value: (l) => {
2785
2811
  var d, u;
2786
2812
  return r != null && r.Parent && l instanceof r.Parent ? !0 : (u = (d = l == null ? void 0 : l._zod) == null ? void 0 : d.traits) == null ? void 0 : u.has(t);
2787
2813
  }
2788
2814
  }), Object.defineProperty(c, "name", { value: t }), c;
2789
2815
  }
2790
- class ar extends Error {
2816
+ class ir extends Error {
2791
2817
  constructor() {
2792
2818
  super("Encountered Promise during synchronous parse. Use .parseAsync() instead.");
2793
2819
  }
2794
2820
  }
2795
- const sr = {};
2796
- function Ue(t) {
2797
- return sr;
2821
+ const or = {};
2822
+ function He(t) {
2823
+ return or;
2798
2824
  }
2799
- function ir(t, e) {
2825
+ function lr(t, e) {
2800
2826
  return typeof e == "bigint" ? e.toString() : e;
2801
2827
  }
2802
- const qe = Error.captureStackTrace ? Error.captureStackTrace : (...t) => {
2828
+ const Ve = Error.captureStackTrace ? Error.captureStackTrace : (...t) => {
2803
2829
  };
2804
- function we(t) {
2830
+ function ve(t) {
2805
2831
  return typeof t == "string" ? t : t == null ? void 0 : t.message;
2806
2832
  }
2807
- function He(t, e, r) {
2808
- var s, i, c, l, d, u;
2809
- const a = { ...t, path: t.path ?? [] };
2833
+ function Ye(t, e, r) {
2834
+ var a, i, c, l, d, u;
2835
+ const s = { ...t, path: t.path ?? [] };
2810
2836
  if (!t.message) {
2811
- const g = we((c = (i = (s = t.inst) == null ? void 0 : s._zod.def) == null ? void 0 : i.error) == null ? void 0 : c.call(i, t)) ?? we((l = e == null ? void 0 : e.error) == null ? void 0 : l.call(e, t)) ?? we((d = r.customError) == null ? void 0 : d.call(r, t)) ?? we((u = r.localeError) == null ? void 0 : u.call(r, t)) ?? "Invalid input";
2812
- a.message = g;
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;
2813
2839
  }
2814
- return delete a.inst, delete a.continue, e != null && e.reportInput || delete a.input, a;
2840
+ return delete s.inst, delete s.continue, e != null && e.reportInput || delete s.input, s;
2815
2841
  }
2816
- const Ve = (t, e) => {
2842
+ const We = (t, e) => {
2817
2843
  t.name = "$ZodError", Object.defineProperty(t, "_zod", {
2818
2844
  value: t._zod,
2819
2845
  enumerable: !1
@@ -2822,7 +2848,7 @@ const Ve = (t, e) => {
2822
2848
  enumerable: !1
2823
2849
  }), Object.defineProperty(t, "message", {
2824
2850
  get() {
2825
- return JSON.stringify(e, ir, 2);
2851
+ return JSON.stringify(e, lr, 2);
2826
2852
  },
2827
2853
  enumerable: !0
2828
2854
  // configurable: false,
@@ -2830,101 +2856,101 @@ const Ve = (t, e) => {
2830
2856
  value: () => t.message,
2831
2857
  enumerable: !1
2832
2858
  });
2833
- }, or = Ke("$ZodError", Ve), Ye = Ke("$ZodError", Ve, { Parent: Error }), lr = (t) => (e, r, a, s) => {
2834
- const i = a ? Object.assign(a, { async: !1 }) : { async: !1 }, c = e._zod.run({ value: r, issues: [] }, i);
2859
+ }, cr = qe("$ZodError", We), Qe = qe("$ZodError", We, { Parent: Error }), dr = (t) => (e, r, s, a) => {
2860
+ const i = s ? Object.assign(s, { async: !1 }) : { async: !1 }, c = e._zod.run({ value: r, issues: [] }, i);
2835
2861
  if (c instanceof Promise)
2836
- throw new ar();
2862
+ throw new ir();
2837
2863
  if (c.issues.length) {
2838
- const l = new ((s == null ? void 0 : s.Err) ?? t)(c.issues.map((d) => He(d, i, Ue())));
2839
- throw qe(l, s == null ? void 0 : s.callee), l;
2864
+ const l = new ((a == null ? void 0 : a.Err) ?? t)(c.issues.map((d) => Ye(d, i, He())));
2865
+ throw Ve(l, a == null ? void 0 : a.callee), l;
2840
2866
  }
2841
2867
  return c.value;
2842
- }, cr = /* @__PURE__ */ lr(Ye), dr = (t) => async (e, r, a, s) => {
2843
- const i = a ? Object.assign(a, { async: !0 }) : { async: !0 };
2868
+ }, ur = /* @__PURE__ */ dr(Qe), mr = (t) => async (e, r, s, a) => {
2869
+ const i = s ? Object.assign(s, { async: !0 }) : { async: !0 };
2844
2870
  let c = e._zod.run({ value: r, issues: [] }, i);
2845
2871
  if (c instanceof Promise && (c = await c), c.issues.length) {
2846
- const l = new ((s == null ? void 0 : s.Err) ?? t)(c.issues.map((d) => He(d, i, Ue())));
2847
- throw qe(l, s == null ? void 0 : s.callee), l;
2872
+ const l = new ((a == null ? void 0 : a.Err) ?? t)(c.issues.map((d) => Ye(d, i, He())));
2873
+ throw Ve(l, a == null ? void 0 : a.callee), l;
2848
2874
  }
2849
2875
  return c.value;
2850
- }, ur = /* @__PURE__ */ dr(Ye);
2851
- function Me(t, e) {
2876
+ }, hr = /* @__PURE__ */ mr(Qe);
2877
+ function Oe(t, e) {
2852
2878
  try {
2853
2879
  var r = t();
2854
- } catch (a) {
2855
- return e(a);
2880
+ } catch (s) {
2881
+ return e(s);
2856
2882
  }
2857
2883
  return r && r.then ? r.then(void 0, e) : r;
2858
2884
  }
2859
- function mr(t, e) {
2885
+ function pr(t, e) {
2860
2886
  for (var r = {}; t.length; ) {
2861
- var a = t[0], s = a.code, i = a.message, c = a.path.join(".");
2862
- if (!r[c]) if ("unionErrors" in a) {
2863
- var l = a.unionErrors[0].errors[0];
2887
+ var s = t[0], a = s.code, i = s.message, c = s.path.join(".");
2888
+ if (!r[c]) if ("unionErrors" in s) {
2889
+ var l = s.unionErrors[0].errors[0];
2864
2890
  r[c] = { message: l.message, type: l.code };
2865
- } else r[c] = { message: i, type: s };
2866
- if ("unionErrors" in a && a.unionErrors.forEach(function(g) {
2891
+ } else r[c] = { message: i, type: a };
2892
+ if ("unionErrors" in s && s.unionErrors.forEach(function(g) {
2867
2893
  return g.errors.forEach(function(p) {
2868
2894
  return t.push(p);
2869
2895
  });
2870
2896
  }), e) {
2871
- var d = r[c].types, u = d && d[a.code];
2872
- r[c] = $e(c, e, r, s, u ? [].concat(u, a.message) : a.message);
2897
+ var d = r[c].types, u = d && d[s.code];
2898
+ r[c] = _e(c, e, r, a, u ? [].concat(u, s.message) : s.message);
2873
2899
  }
2874
2900
  t.shift();
2875
2901
  }
2876
2902
  return r;
2877
2903
  }
2878
- function hr(t, e) {
2904
+ function gr(t, e) {
2879
2905
  for (var r = {}; t.length; ) {
2880
- var a = t[0], s = a.code, i = a.message, c = a.path.join(".");
2881
- if (!r[c]) if (a.code === "invalid_union" && a.errors.length > 0) {
2882
- var l = a.errors[0][0];
2906
+ var s = t[0], a = s.code, i = s.message, c = s.path.join(".");
2907
+ if (!r[c]) if (s.code === "invalid_union" && s.errors.length > 0) {
2908
+ var l = s.errors[0][0];
2883
2909
  r[c] = { message: l.message, type: l.code };
2884
- } else r[c] = { message: i, type: s };
2885
- if (a.code === "invalid_union" && a.errors.forEach(function(g) {
2910
+ } else r[c] = { message: i, type: a };
2911
+ if (s.code === "invalid_union" && s.errors.forEach(function(g) {
2886
2912
  return g.forEach(function(p) {
2887
2913
  return t.push(p);
2888
2914
  });
2889
2915
  }), e) {
2890
- var d = r[c].types, u = d && d[a.code];
2891
- r[c] = $e(c, e, r, s, u ? [].concat(u, a.message) : a.message);
2916
+ var d = r[c].types, u = d && d[s.code];
2917
+ r[c] = _e(c, e, r, a, u ? [].concat(u, s.message) : s.message);
2892
2918
  }
2893
2919
  t.shift();
2894
2920
  }
2895
2921
  return r;
2896
2922
  }
2897
- function We(t, e, r) {
2898
- if (r === void 0 && (r = {}), function(a) {
2899
- return "_def" in a && typeof a._def == "object" && "typeName" in a._def;
2900
- }(t)) return function(a, s, i) {
2923
+ function Ge(t, e, r) {
2924
+ if (r === void 0 && (r = {}), function(s) {
2925
+ return "_def" in s && typeof s._def == "object" && "typeName" in s._def;
2926
+ }(t)) return function(s, a, i) {
2901
2927
  try {
2902
- return Promise.resolve(Me(function() {
2903
- return Promise.resolve(t[r.mode === "sync" ? "parse" : "parseAsync"](a, e)).then(function(c) {
2904
- return i.shouldUseNativeValidation && Ie({}, i), { errors: {}, values: r.raw ? Object.assign({}, a) : c };
2928
+ return Promise.resolve(Oe(function() {
2929
+ 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 };
2905
2931
  });
2906
2932
  }, function(c) {
2907
2933
  if (function(l) {
2908
2934
  return Array.isArray(l == null ? void 0 : l.issues);
2909
- }(c)) return { values: {}, errors: Le(mr(c.errors, !i.shouldUseNativeValidation && i.criteriaMode === "all"), i) };
2935
+ }(c)) return { values: {}, errors: Me(pr(c.errors, !i.shouldUseNativeValidation && i.criteriaMode === "all"), i) };
2910
2936
  throw c;
2911
2937
  }));
2912
2938
  } catch (c) {
2913
2939
  return Promise.reject(c);
2914
2940
  }
2915
2941
  };
2916
- if (function(a) {
2917
- return "_zod" in a && typeof a._zod == "object";
2918
- }(t)) return function(a, s, i) {
2942
+ if (function(s) {
2943
+ return "_zod" in s && typeof s._zod == "object";
2944
+ }(t)) return function(s, a, i) {
2919
2945
  try {
2920
- return Promise.resolve(Me(function() {
2921
- return Promise.resolve((r.mode === "sync" ? cr : ur)(t, a, e)).then(function(c) {
2922
- return i.shouldUseNativeValidation && Ie({}, i), { errors: {}, values: r.raw ? Object.assign({}, a) : c };
2946
+ return Promise.resolve(Oe(function() {
2947
+ 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 };
2923
2949
  });
2924
2950
  }, function(c) {
2925
2951
  if (function(l) {
2926
- return l instanceof or;
2927
- }(c)) return { values: {}, errors: Le(hr(c.issues, !i.shouldUseNativeValidation && i.criteriaMode === "all"), i) };
2952
+ return l instanceof cr;
2953
+ }(c)) return { values: {}, errors: Me(gr(c.issues, !i.shouldUseNativeValidation && i.criteriaMode === "all"), i) };
2928
2954
  throw c;
2929
2955
  }));
2930
2956
  } catch (c) {
@@ -2933,12 +2959,12 @@ function We(t, e, r) {
2933
2959
  };
2934
2960
  throw new Error("Invalid input: not a Zod schema");
2935
2961
  }
2936
- function pr(t) {
2962
+ function yr(t) {
2937
2963
  return de.object({
2938
2964
  questionResults: de.any()
2939
2965
  }).passthrough();
2940
2966
  }
2941
- function gr(t) {
2967
+ function fr(t) {
2942
2968
  let e = de.array(de.instanceof(File));
2943
2969
  if (t.isRequired ? e = e.min(
2944
2970
  1,
@@ -2947,137 +2973,137 @@ function gr(t) {
2947
2973
  (r) => !r || r.length <= 1,
2948
2974
  { message: "Only one file is allowed" }
2949
2975
  )), t.maxEachFileSizeByte > 0 && (e = e.refine(
2950
- (r) => !r || r.every((a) => a.size <= t.maxEachFileSizeByte),
2976
+ (r) => !r || r.every((s) => s.size <= t.maxEachFileSizeByte),
2951
2977
  { message: `File size must not exceed ${Math.round(t.maxEachFileSizeByte / 1024 / 1024)}MB` }
2952
2978
  )), t.allowedTypes) {
2953
- const r = t.allowedTypes.split(",").map((a) => a.trim());
2979
+ const r = t.allowedTypes.split(",").map((s) => s.trim());
2954
2980
  e = e.refine(
2955
- (a) => a ? a.every(
2956
- (s) => r.some((i) => i.endsWith("/*") ? s.type.startsWith(i.slice(0, -2)) : s.type === i)
2981
+ (s) => s ? s.every(
2982
+ (a) => r.some((i) => i.endsWith("/*") ? a.type.startsWith(i.slice(0, -2)) : a.type === i)
2957
2983
  ) : !0,
2958
2984
  { message: "Invalid file type" }
2959
2985
  );
2960
2986
  }
2961
2987
  return e;
2962
2988
  }
2963
- function Kr(t) {
2989
+ function qr(t) {
2964
2990
  const e = {};
2965
2991
  return t.uploadDocumentFiles.forEach((r) => {
2966
- const a = `file_${r.id}`;
2967
- e[a] = gr(r);
2992
+ const s = `file_${r.id}`;
2993
+ e[s] = fr(r);
2968
2994
  }), de.object(e);
2969
2995
  }
2970
- function yr(t) {
2996
+ function br(t) {
2971
2997
  return de.any();
2972
2998
  }
2973
- function fr(t) {
2999
+ function xr(t) {
2974
3000
  return de.string().min(1, "This question is required");
2975
3001
  }
2976
- function Ur(t) {
3002
+ function Hr(t) {
2977
3003
  const e = {};
2978
3004
  return t.appropriatenessQuestions.forEach((r) => {
2979
- const a = `question_${r.id}`;
2980
- e[a] = fr();
3005
+ const s = `question_${r.id}`;
3006
+ e[s] = xr();
2981
3007
  }), de.object(e);
2982
3008
  }
2983
- const qr = de.any(), br = ({
3009
+ const Vr = de.any(), vr = ({
2984
3010
  applicantId: t,
2985
3011
  onComplete: e,
2986
3012
  onBack: r
2987
3013
  }) => {
2988
- const { questionnaire: a, isLoading: s, isSubmitting: i, error: c, submit: l } = Qt(t), d = Oe(() => a ? { questionResults: a.questionGroups.map(
2989
- (x) => x.questions.map((R) => ({
2990
- questionId: R.id,
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,
2991
3017
  values: []
2992
3018
  }))
2993
- ) } : { questionResults: [] }, [a]), u = a ? pr() : null, {
3019
+ ) } : { questionResults: [] }, [s]), u = s ? yr() : null, {
2994
3020
  control: g,
2995
3021
  handleSubmit: p,
2996
3022
  formState: { errors: m }
2997
- } = De({
2998
- resolver: u ? We(u) : void 0,
3023
+ } = Pe({
3024
+ resolver: u ? Ge(u) : void 0,
2999
3025
  defaultValues: d
3000
3026
  }), b = async (y) => {
3001
- if (a)
3027
+ if (s)
3002
3028
  try {
3003
3029
  console.log("Form submitted with data:", y);
3004
- const x = a.questionGroups.flatMap(
3005
- (h, N) => h.questions.map((w, E) => {
3006
- var F, M, I;
3030
+ const f = s.questionGroups.flatMap(
3031
+ (h, N) => h.questions.map((w, I) => {
3032
+ var F, L, R;
3007
3033
  return {
3008
3034
  questionId: w.id,
3009
- values: ((I = (M = (F = y.questionResults) == null ? void 0 : F[N]) == null ? void 0 : M[E]) == null ? void 0 : I.values) || []
3035
+ values: ((R = (L = (F = y.questionResults) == null ? void 0 : F[N]) == null ? void 0 : L[I]) == null ? void 0 : R.values) || []
3010
3036
  };
3011
3037
  })
3012
3038
  );
3013
- console.log("Question results to submit:", x);
3014
- const R = {
3039
+ console.log("Question results to submit:", f);
3040
+ const P = {
3015
3041
  applicantId: t,
3016
- questionnarieId: a.id,
3017
- questionResults: x
3042
+ questionnarieId: s.id,
3043
+ questionResults: f
3018
3044
  };
3019
- console.log("Final input:", R), await l(R), e == null || e();
3020
- } catch (x) {
3021
- console.error("Error submitting questionnaire:", x);
3045
+ console.log("Final input:", P), await l(P), e == null || e();
3046
+ } catch (f) {
3047
+ console.error("Error submitting questionnaire:", f);
3022
3048
  }
3023
3049
  };
3024
- return s ? /* @__PURE__ */ n(L, { children: /* @__PURE__ */ n(T, { children: /* @__PURE__ */ n(ie, { className: "my-8" }) }) }) : c ? /* @__PURE__ */ n(L, { children: /* @__PURE__ */ n(T, { children: /* @__PURE__ */ o("p", { className: "text-danger-500", children: [
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: [
3025
3051
  "Error loading questionnaire: ",
3026
3052
  c.message
3027
- ] }) }) }) : a ? /* @__PURE__ */ n("form", { onSubmit: p(b), children: /* @__PURE__ */ o(L, { children: [
3028
- /* @__PURE__ */ o(Z, { children: [
3029
- /* @__PURE__ */ n("h2", { className: "text-2xl font-bold", children: a.displayName }),
3030
- a.subtitle && /* @__PURE__ */ n("p", { className: "text-gray-600 dark:text-gray-400 mt-1", children: a.subtitle })
3053
+ ] }) }) }) : s ? /* @__PURE__ */ n("form", { onSubmit: p(b), children: /* @__PURE__ */ o(T, { children: [
3054
+ /* @__PURE__ */ o(J, { children: [
3055
+ /* @__PURE__ */ n("h2", { className: "text-2xl font-bold", children: s.displayName }),
3056
+ s.subtitle && /* @__PURE__ */ n("p", { className: "text-gray-600 dark:text-gray-400 mt-1", children: s.subtitle })
3031
3057
  ] }),
3032
- /* @__PURE__ */ n(T, { className: "space-y-8", children: a.questionGroups.flatMap(
3033
- (y, x) => y.questions.map((R, h) => {
3034
- const w = R.defaultAnswers && R.defaultAnswers.length > 0 ? R.showAsDropdown ? R.canMultipleAnswer ? "multi-select" : "single-select" : R.canMultipleAnswer ? "checkbox" : "radio" : "text";
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";
3035
3061
  return /* @__PURE__ */ o("div", { className: "space-y-2", children: [
3036
3062
  /* @__PURE__ */ o("label", { className: "block text-sm font-medium text-gray-700 dark:text-gray-300", children: [
3037
- R.text,
3038
- R.isRequired && /* @__PURE__ */ n("span", { className: "text-danger-500 ml-1", children: "*" })
3063
+ P.text,
3064
+ P.isRequired && /* @__PURE__ */ n("span", { className: "text-danger-500 ml-1", children: "*" })
3039
3065
  ] }),
3040
3066
  w === "text" && /* @__PURE__ */ n(
3041
- Q,
3067
+ G,
3042
3068
  {
3043
3069
  control: g,
3044
- name: `questionResults.${x}.${h}.values.0`,
3045
- render: ({ field: E }) => {
3046
- var F, M, I, A;
3070
+ name: `questionResults.${f}.${h}.values.0`,
3071
+ render: ({ field: I }) => {
3072
+ var F, L, R, C;
3047
3073
  return /* @__PURE__ */ n(
3048
- G,
3074
+ Z,
3049
3075
  {
3050
- value: E.value || "",
3051
- onChange: E.onChange,
3052
- onBlur: E.onBlur,
3053
- name: E.name,
3076
+ value: I.value || "",
3077
+ onChange: I.onChange,
3078
+ onBlur: I.onBlur,
3079
+ name: I.name,
3054
3080
  placeholder: "Enter your answer...",
3055
- error: (A = (I = (M = (F = m.questionResults) == null ? void 0 : F[x]) == null ? void 0 : M[h]) == null ? void 0 : I.values) == null ? void 0 : A.message
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
3056
3082
  }
3057
3083
  );
3058
3084
  }
3059
3085
  }
3060
3086
  ),
3061
3087
  (w === "single-select" || w === "radio") && /* @__PURE__ */ n(
3062
- Q,
3088
+ G,
3063
3089
  {
3064
3090
  control: g,
3065
- name: `questionResults.${x}.${h}.values.0`,
3066
- render: ({ field: E }) => {
3067
- var F, M, I, A;
3091
+ name: `questionResults.${f}.${h}.values.0`,
3092
+ render: ({ field: I }) => {
3093
+ var F, L, R, C;
3068
3094
  return /* @__PURE__ */ n(
3069
- ye,
3095
+ ge,
3070
3096
  {
3071
- value: E.value || "",
3072
- onChange: E.onChange,
3073
- onBlur: E.onBlur,
3074
- name: E.name,
3075
- options: R.defaultAnswers.map((B) => ({
3097
+ value: I.value || "",
3098
+ onChange: I.onChange,
3099
+ onBlur: I.onBlur,
3100
+ name: I.name,
3101
+ options: P.defaultAnswers.map((B) => ({
3076
3102
  value: B,
3077
3103
  label: B
3078
3104
  })),
3079
3105
  placeholder: "Select an option...",
3080
- error: (A = (I = (M = (F = m.questionResults) == null ? void 0 : F[x]) == null ? void 0 : M[h]) == null ? void 0 : I.values) == null ? void 0 : A.message
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
3081
3107
  }
3082
3108
  );
3083
3109
  }
@@ -3086,11 +3112,11 @@ const qr = de.any(), br = ({
3086
3112
  (w === "checkbox" || w === "multi-select") && /* @__PURE__ */ o("div", { className: "space-y-2", children: [
3087
3113
  /* @__PURE__ */ n("p", { className: "text-sm text-gray-600 dark:text-gray-400 mb-2", children: "Choose one or more options" }),
3088
3114
  /* @__PURE__ */ n(
3089
- Q,
3115
+ G,
3090
3116
  {
3091
3117
  control: g,
3092
- name: `questionResults.${x}.${h}.values`,
3093
- render: ({ field: { value: E = [], onChange: F } }) => /* @__PURE__ */ n("div", { className: "space-y-2", children: R.defaultAnswers.map((M, I) => /* @__PURE__ */ o(
3118
+ 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(
3094
3120
  "label",
3095
3121
  {
3096
3122
  className: "flex items-center space-x-2 cursor-pointer",
@@ -3099,29 +3125,29 @@ const qr = de.any(), br = ({
3099
3125
  "input",
3100
3126
  {
3101
3127
  type: "checkbox",
3102
- checked: Array.isArray(E) && E.includes(M),
3103
- onChange: (A) => {
3104
- const B = Array.isArray(E) ? E : [], z = A.target.checked ? [...B, M] : B.filter((f) => f !== M);
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);
3105
3131
  F(z);
3106
3132
  },
3107
3133
  className: "h-4 w-4 text-primary-500 rounded border-gray-300 focus:ring-primary-500"
3108
3134
  }
3109
3135
  ),
3110
- /* @__PURE__ */ n("span", { className: "text-sm", children: M })
3136
+ /* @__PURE__ */ n("span", { className: "text-sm", children: L })
3111
3137
  ]
3112
3138
  },
3113
- `answer-${x}-${h}-${I}`
3139
+ `answer-${f}-${h}-${R}`
3114
3140
  )) })
3115
3141
  }
3116
3142
  )
3117
3143
  ] })
3118
- ] }, R.id);
3144
+ ] }, P.id);
3119
3145
  })
3120
3146
  ) }),
3121
3147
  /* @__PURE__ */ o(te, { className: "flex justify-between", children: [
3122
- r && /* @__PURE__ */ n(_, { type: "button", variant: "outline", onClick: r, children: "Back" }),
3148
+ r && /* @__PURE__ */ n(j, { type: "button", variant: "outline", onClick: r, children: "Back" }),
3123
3149
  /* @__PURE__ */ n(
3124
- _,
3150
+ j,
3125
3151
  {
3126
3152
  type: "submit",
3127
3153
  isLoading: i,
@@ -3137,43 +3163,43 @@ const qr = de.any(), br = ({
3137
3163
  c.message
3138
3164
  ] }) })
3139
3165
  ] }) }) : null;
3140
- }, xr = ({
3166
+ }, wr = ({
3141
3167
  applicantId: t,
3142
3168
  onComplete: e,
3143
3169
  onBack: r
3144
3170
  }) => {
3145
- const { uploadDocument: a, isLoading: s, isSubmitting: i, error: c, submit: l } = Gt(t), [d, u] = v({}), g = async (p) => {
3146
- if (p.preventDefault(), !a) return;
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;
3147
3173
  const m = await Promise.all(
3148
- a.uploadDocumentFiles.map(async (y) => {
3149
- const x = d[y.id] || [], R = await Promise.all(
3150
- x.map(async (h) => ({
3174
+ s.uploadDocumentFiles.map(async (y) => {
3175
+ const f = d[y.id] || [], P = await Promise.all(
3176
+ f.map(async (h) => ({
3151
3177
  fileName: h.name,
3152
- fileData: await Kt(h)
3178
+ fileData: await qt(h)
3153
3179
  }))
3154
3180
  );
3155
3181
  return {
3156
3182
  uploadDocumentFileId: y.id,
3157
- valueList: R
3183
+ valueList: P
3158
3184
  };
3159
3185
  })
3160
3186
  ), b = {
3161
3187
  applicantId: t,
3162
- uploadDocumentId: a.id,
3188
+ uploadDocumentId: s.id,
3163
3189
  uploadDocumentResults: m
3164
3190
  };
3165
3191
  await l(b), e == null || e();
3166
3192
  };
3167
- return s ? /* @__PURE__ */ n(L, { children: /* @__PURE__ */ n(T, { children: /* @__PURE__ */ n(ie, { className: "my-8" }) }) }) : c ? /* @__PURE__ */ n(L, { children: /* @__PURE__ */ n(T, { children: /* @__PURE__ */ o("p", { className: "text-danger-500", children: [
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: [
3168
3194
  "Error loading document requirements: ",
3169
3195
  c.message
3170
- ] }) }) }) : a ? /* @__PURE__ */ n("form", { onSubmit: g, children: /* @__PURE__ */ o(L, { children: [
3171
- /* @__PURE__ */ o(Z, { children: [
3172
- /* @__PURE__ */ n("h2", { className: "text-2xl font-bold", children: a.displayName }),
3173
- a.subtitle && /* @__PURE__ */ n("p", { className: "text-gray-600 dark:text-gray-400 mt-1", children: a.subtitle })
3196
+ ] }) }) }) : s ? /* @__PURE__ */ n("form", { onSubmit: g, children: /* @__PURE__ */ o(T, { children: [
3197
+ /* @__PURE__ */ o(J, { children: [
3198
+ /* @__PURE__ */ n("h2", { className: "text-2xl font-bold", children: s.displayName }),
3199
+ s.subtitle && /* @__PURE__ */ n("p", { className: "text-gray-600 dark:text-gray-400 mt-1", children: s.subtitle })
3174
3200
  ] }),
3175
- /* @__PURE__ */ n(T, { className: "space-y-6", children: a.uploadDocumentFiles.map((p) => /* @__PURE__ */ n(
3176
- tr,
3201
+ /* @__PURE__ */ n(M, { className: "space-y-6", children: s.uploadDocumentFiles.map((p) => /* @__PURE__ */ n(
3202
+ nr,
3177
3203
  {
3178
3204
  label: p.displayName,
3179
3205
  accept: p.allowedTypes,
@@ -3187,24 +3213,24 @@ const qr = de.any(), br = ({
3187
3213
  p.id
3188
3214
  )) }),
3189
3215
  /* @__PURE__ */ o(te, { className: "flex justify-between", children: [
3190
- r && /* @__PURE__ */ n(_, { type: "button", variant: "outline", onClick: r, children: "Back" }),
3191
- /* @__PURE__ */ n(_, { type: "submit", isLoading: i, children: "Continue" })
3216
+ r && /* @__PURE__ */ n(j, { type: "button", variant: "outline", onClick: r, children: "Back" }),
3217
+ /* @__PURE__ */ n(j, { type: "submit", isLoading: i, children: "Continue" })
3192
3218
  ] })
3193
3219
  ] }) }) : null;
3194
- }, vr = ({ applicantId: t, onComplete: e, onBack: r }) => {
3195
- const { overview: a, isLoading: s, isSubmitting: i, error: c, passOverview: l } = Zt(t), d = async () => {
3220
+ }, kr = ({ applicantId: t, onComplete: e, onBack: r }) => {
3221
+ const { overview: s, isLoading: a, isSubmitting: i, error: c, passOverview: l } = Xt(t), d = async () => {
3196
3222
  await l(), e == null || e();
3197
3223
  };
3198
- return s ? /* @__PURE__ */ n(L, { children: /* @__PURE__ */ n(T, { children: /* @__PURE__ */ n(ie, { className: "my-8" }) }) }) : c ? /* @__PURE__ */ n(L, { children: /* @__PURE__ */ n(T, { children: /* @__PURE__ */ o("p", { className: "text-danger-500", children: [
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: [
3199
3225
  "Error loading overview: ",
3200
3226
  c.message
3201
- ] }) }) }) : a ? /* @__PURE__ */ o(L, { children: [
3202
- /* @__PURE__ */ o(Z, { children: [
3203
- /* @__PURE__ */ n("h2", { className: "text-2xl font-bold", children: a.title || "Overview" }),
3204
- a.description && /* @__PURE__ */ n("p", { className: "text-gray-600 dark:text-gray-400 mt-1", children: a.description })
3227
+ ] }) }) }) : s ? /* @__PURE__ */ o(T, { children: [
3228
+ /* @__PURE__ */ o(J, { children: [
3229
+ /* @__PURE__ */ n("h2", { className: "text-2xl font-bold", children: s.title || "Overview" }),
3230
+ s.description && /* @__PURE__ */ n("p", { className: "text-gray-600 dark:text-gray-400 mt-1", children: s.description })
3205
3231
  ] }),
3206
- /* @__PURE__ */ o(T, { className: "space-y-6", children: [
3207
- a.steps && a.steps.length > 0 ? /* @__PURE__ */ n("div", { className: "space-y-4", children: a.steps.sort((u, g) => u.order - g.order).map((u) => /* @__PURE__ */ n(
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(
3208
3234
  "div",
3209
3235
  {
3210
3236
  className: "border border-gray-200 dark:border-gray-700 rounded-lg p-4 bg-gray-50 dark:bg-gray-800",
@@ -3218,49 +3244,49 @@ const qr = de.any(), br = ({
3218
3244
  },
3219
3245
  u.order
3220
3246
  )) }) : /* @__PURE__ */ n("div", { className: "text-center py-8", children: /* @__PURE__ */ n("p", { className: "text-gray-600 dark:text-gray-400", children: "Loading overview data..." }) }),
3221
- a.steps && a.steps.length > 0 && /* @__PURE__ */ n("div", { className: "mt-6 p-4 bg-green-50 dark:bg-green-900/20 border border-green-200 dark:border-green-800 rounded-lg", children: /* @__PURE__ */ o("p", { className: "text-green-800 dark:text-green-300 text-sm", children: [
3247
+ s.steps && s.steps.length > 0 && /* @__PURE__ */ n("div", { className: "mt-6 p-4 bg-green-50 dark:bg-green-900/20 border border-green-200 dark:border-green-800 rounded-lg", children: /* @__PURE__ */ o("p", { className: "text-green-800 dark:text-green-300 text-sm", children: [
3222
3248
  /* @__PURE__ */ n("strong", { children: "✓ All steps completed!" }),
3223
3249
  " Review the information above and confirm to proceed."
3224
3250
  ] }) })
3225
3251
  ] }),
3226
3252
  /* @__PURE__ */ o(te, { className: "flex justify-between", children: [
3227
- r && /* @__PURE__ */ n(_, { type: "button", variant: "outline", onClick: r, children: "Back" }),
3228
- /* @__PURE__ */ n(_, { onClick: d, isLoading: i, children: "Confirm and Continue" })
3253
+ r && /* @__PURE__ */ n(j, { type: "button", variant: "outline", onClick: r, children: "Back" }),
3254
+ /* @__PURE__ */ n(j, { onClick: d, isLoading: i, children: "Confirm and Continue" })
3229
3255
  ] })
3230
3256
  ] }) : null;
3231
- }, wr = ({
3257
+ }, Nr = ({
3232
3258
  applicantId: t,
3233
3259
  onComplete: e,
3234
3260
  onBack: r
3235
3261
  }) => {
3236
- const { criteria: a, isLoading: s, isSubmitting: i, error: c, submit: l } = Xt(t), [d, u] = ce.useState(!1), g = ce.useMemo(() => !a || a.length === 0 ? { criteriaValueInputs: [] } : {
3237
- criteriaValueInputs: a.map((h) => ({
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: [] } : {
3263
+ criteriaValueInputs: s.map((h) => ({
3238
3264
  riskCriteriaId: h.id,
3239
3265
  values: [""]
3240
3266
  // Initialize with empty string to prevent uncontrolled input warning
3241
3267
  }))
3242
- }, [a]), p = a && a.length > 0 ? yr() : null, {
3268
+ }, [s]), p = s && s.length > 0 ? br() : null, {
3243
3269
  control: m,
3244
3270
  handleSubmit: b,
3245
3271
  formState: { errors: y }
3246
- } = De({
3247
- resolver: p ? We(p) : void 0,
3272
+ } = Pe({
3273
+ resolver: p ? Ge(p) : void 0,
3248
3274
  defaultValues: g
3249
3275
  });
3250
- ce.useEffect(() => {
3251
- !s && a && a.length === 0 && !d && !i && (u(!0), l({ applicantId: t, criteriaValueInputs: [] }).then(() => e == null ? void 0 : e()).catch(console.error));
3252
- }, [s, a, d, i, l, t, e]);
3253
- const x = async (h) => {
3254
- if (a)
3276
+ le.useEffect(() => {
3277
+ !a && s && s.length === 0 && !d && !i && (u(!0), l({ applicantId: t, criteriaValueInputs: [] }).then(() => e == null ? void 0 : e()).catch(console.error));
3278
+ }, [a, s, d, i, l, t, e]);
3279
+ const f = async (h) => {
3280
+ if (s)
3255
3281
  try {
3256
- console.log("Risk scoring form submitted:", h), console.log("Criteria metadata:", a);
3257
- const N = h.criteriaValueInputs.map((E, F) => {
3258
- const M = E.values || [], I = Array.isArray(M) ? M.filter((A) => A && A.trim()) : M && M.toString().trim() ? [M.toString()] : [];
3259
- return I.length === 0 ? null : {
3260
- riskCriteriaId: a[F].id,
3261
- values: I
3282
+ 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
3262
3288
  };
3263
- }).filter((E) => E !== null);
3289
+ }).filter((I) => I !== null);
3264
3290
  console.log("Risk scoring criteriaValueInputs to submit:", N);
3265
3291
  const w = {
3266
3292
  applicantId: t,
@@ -3270,24 +3296,24 @@ const qr = de.any(), br = ({
3270
3296
  } catch (N) {
3271
3297
  throw console.error("Error submitting risk scoring:", N), N;
3272
3298
  }
3273
- }, R = (h) => h.builtInType === 1 ? "country" : !h.defaultValues || h.defaultValues.length === 0 ? "text" : h.multipleValue ? "checkbox" : "radio";
3274
- return s ? /* @__PURE__ */ n(L, { children: /* @__PURE__ */ o(T, { children: [
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: [
3275
3301
  /* @__PURE__ */ n(ie, { className: "my-8" }),
3276
3302
  /* @__PURE__ */ n("p", { className: "text-center text-gray-600 dark:text-gray-400 mt-4", children: "Loading risk scoring criteria..." })
3277
- ] }) }) : c ? /* @__PURE__ */ n(L, { children: /* @__PURE__ */ n(T, { children: /* @__PURE__ */ o("p", { className: "text-danger-500", children: [
3303
+ ] }) }) : c ? /* @__PURE__ */ n(T, { children: /* @__PURE__ */ n(M, { children: /* @__PURE__ */ o("p", { className: "text-danger-500", children: [
3278
3304
  "Error loading criteria: ",
3279
3305
  c.message
3280
- ] }) }) }) : !s && a && a.length === 0 ? /* @__PURE__ */ n(L, { children: /* @__PURE__ */ o(T, { children: [
3306
+ ] }) }) }) : !a && s && s.length === 0 ? /* @__PURE__ */ n(T, { children: /* @__PURE__ */ o(M, { children: [
3281
3307
  /* @__PURE__ */ n(ie, { className: "my-8" }),
3282
3308
  /* @__PURE__ */ n("p", { className: "text-center text-gray-600 dark:text-gray-400", children: "No risk scoring criteria required. Moving to next step..." })
3283
- ] }) }) : a ? /* @__PURE__ */ n("form", { onSubmit: b(x), children: /* @__PURE__ */ o(L, { children: [
3284
- /* @__PURE__ */ o(Z, { children: [
3309
+ ] }) }) : s ? /* @__PURE__ */ n("form", { onSubmit: b(f), children: /* @__PURE__ */ o(T, { children: [
3310
+ /* @__PURE__ */ o(J, { children: [
3285
3311
  /* @__PURE__ */ n("h2", { className: "text-2xl font-bold", children: "Risk Assessment" }),
3286
3312
  /* @__PURE__ */ n("p", { className: "text-gray-600 dark:text-gray-400 mt-1", children: "Please answer the following questions for risk evaluation" })
3287
3313
  ] }),
3288
- /* @__PURE__ */ n(T, { className: "space-y-8", children: a.map((h, N) => {
3289
- var E, F, M;
3290
- const w = R(h);
3314
+ /* @__PURE__ */ n(M, { className: "space-y-8", children: s.map((h, N) => {
3315
+ var I, F, L;
3316
+ const w = P(h);
3291
3317
  return /* @__PURE__ */ o("div", { className: "space-y-2", children: [
3292
3318
  /* @__PURE__ */ o("label", { className: "block text-sm font-medium text-gray-700 dark:text-gray-300", children: [
3293
3319
  h.displayName,
@@ -3295,22 +3321,22 @@ const qr = de.any(), br = ({
3295
3321
  ] }),
3296
3322
  h.description && /* @__PURE__ */ n("p", { className: "text-sm text-gray-500 dark:text-gray-400", children: h.description }),
3297
3323
  w === "text" && /* @__PURE__ */ n(
3298
- Q,
3324
+ G,
3299
3325
  {
3300
3326
  control: m,
3301
3327
  name: `criteriaValueInputs.${N}.values.0`,
3302
- render: ({ field: I }) => {
3303
- var A, B, z;
3328
+ render: ({ field: R }) => {
3329
+ var C, B, z;
3304
3330
  return /* @__PURE__ */ n(
3305
- G,
3331
+ Z,
3306
3332
  {
3307
- ...I,
3308
- value: I.value || "",
3309
- type: h.valueDataType === Ee.DigitOnly ? "number" : "text",
3333
+ ...R,
3334
+ value: R.value || "",
3335
+ type: h.valueDataType === Ie.DigitOnly ? "number" : "text",
3310
3336
  placeholder: "Enter your answer...",
3311
- error: (z = (B = (A = y.criteriaValueInputs) == null ? void 0 : A[N]) == null ? void 0 : B.values) == null ? void 0 : z.message,
3312
- onKeyDown: (f) => {
3313
- h.valueDataType === Ee.DigitOnly && ["e", "E", "+", "-", "."].includes(f.key) && f.preventDefault();
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();
3314
3340
  }
3315
3341
  }
3316
3342
  );
@@ -3320,17 +3346,17 @@ const qr = de.any(), br = ({
3320
3346
  w === "radio" && h.defaultValues && /* @__PURE__ */ o("div", { className: "space-y-2", children: [
3321
3347
  /* @__PURE__ */ n("p", { className: "text-sm text-gray-600 dark:text-gray-400", children: "Choose one option" }),
3322
3348
  /* @__PURE__ */ n(
3323
- Q,
3349
+ G,
3324
3350
  {
3325
3351
  control: m,
3326
3352
  name: `criteriaValueInputs.${N}.values.0`,
3327
- render: ({ field: { value: I, onChange: A } }) => /* @__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: [
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: [
3328
3354
  /* @__PURE__ */ n(
3329
3355
  "input",
3330
3356
  {
3331
3357
  type: "radio",
3332
- checked: I === B,
3333
- onChange: () => A(B),
3358
+ checked: R === B,
3359
+ onChange: () => C(B),
3334
3360
  className: "h-4 w-4 text-primary-500 border-gray-300 focus:ring-primary-500"
3335
3361
  }
3336
3362
  ),
@@ -3342,19 +3368,19 @@ const qr = de.any(), br = ({
3342
3368
  w === "checkbox" && h.defaultValues && /* @__PURE__ */ o("div", { className: "space-y-2", children: [
3343
3369
  /* @__PURE__ */ n("p", { className: "text-sm text-gray-600 dark:text-gray-400", children: "Choose one or more options" }),
3344
3370
  /* @__PURE__ */ n(
3345
- Q,
3371
+ G,
3346
3372
  {
3347
3373
  control: m,
3348
3374
  name: `criteriaValueInputs.${N}.values`,
3349
- render: ({ field: { value: I = [], onChange: A } }) => /* @__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: [
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: [
3350
3376
  /* @__PURE__ */ n(
3351
3377
  "input",
3352
3378
  {
3353
3379
  type: "checkbox",
3354
- checked: Array.isArray(I) && I.includes(B),
3355
- onChange: (f) => {
3356
- const D = Array.isArray(I) ? I : [], C = f.target.checked ? [...D, B] : D.filter((k) => k !== B);
3357
- A(C);
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);
3358
3384
  },
3359
3385
  className: "h-4 w-4 text-primary-500 rounded border-gray-300 focus:ring-primary-500"
3360
3386
  }
@@ -3365,16 +3391,16 @@ const qr = de.any(), br = ({
3365
3391
  )
3366
3392
  ] }),
3367
3393
  w === "country" && /* @__PURE__ */ n(
3368
- Q,
3394
+ G,
3369
3395
  {
3370
3396
  control: m,
3371
3397
  name: `criteriaValueInputs.${N}.values.0`,
3372
- render: ({ field: I }) => {
3373
- var A, B, z;
3398
+ render: ({ field: R }) => {
3399
+ var C, B, z;
3374
3400
  return /* @__PURE__ */ n(
3375
- ye,
3401
+ ge,
3376
3402
  {
3377
- ...I,
3403
+ ...R,
3378
3404
  options: [
3379
3405
  { value: "US", label: "United States" },
3380
3406
  { value: "GB", label: "United Kingdom" },
@@ -3382,19 +3408,19 @@ const qr = de.any(), br = ({
3382
3408
  // TODO: Load from base information service
3383
3409
  ],
3384
3410
  placeholder: "Select a country...",
3385
- error: (z = (B = (A = y.criteriaValueInputs) == null ? void 0 : A[N]) == null ? void 0 : B.values) == null ? void 0 : z.message
3411
+ error: (z = (B = (C = y.criteriaValueInputs) == null ? void 0 : C[N]) == null ? void 0 : B.values) == null ? void 0 : z.message
3386
3412
  }
3387
3413
  );
3388
3414
  }
3389
3415
  }
3390
3416
  ),
3391
- ((M = (F = (E = y.criteriaValueInputs) == null ? void 0 : E[N]) == null ? void 0 : F.values) == null ? void 0 : M.message) && /* @__PURE__ */ n("p", { className: "text-sm text-danger-500 mt-1", children: y.criteriaValueInputs[N].values.message })
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 })
3392
3418
  ] }, h.id);
3393
3419
  }) }),
3394
3420
  /* @__PURE__ */ o(te, { className: "flex justify-between", children: [
3395
- r && /* @__PURE__ */ n(_, { type: "button", variant: "outline", onClick: r, children: "Back" }),
3421
+ r && /* @__PURE__ */ n(j, { type: "button", variant: "outline", onClick: r, children: "Back" }),
3396
3422
  /* @__PURE__ */ n(
3397
- _,
3423
+ j,
3398
3424
  {
3399
3425
  type: "submit",
3400
3426
  isLoading: i,
@@ -3410,14 +3436,14 @@ const qr = de.any(), br = ({
3410
3436
  c.message
3411
3437
  ] }) })
3412
3438
  ] }) }) : null;
3413
- }, kr = ({
3439
+ }, Sr = ({
3414
3440
  applicantId: t,
3415
3441
  onComplete: e,
3416
3442
  onBack: r
3417
3443
  }) => {
3418
- const { investorCategorizationService: a } = re(), [s, i] = v(null), [c, l] = v(!1), [d, u] = v(null);
3444
+ const { investorCategorizationService: s } = re(), [a, i] = x(null), [c, l] = x(!1), [d, u] = x(null);
3419
3445
  return /* @__PURE__ */ n("form", { onSubmit: async (p) => {
3420
- if (p.preventDefault(), s === null) {
3446
+ if (p.preventDefault(), a === null) {
3421
3447
  u("Please select an investor type");
3422
3448
  return;
3423
3449
  }
@@ -3425,29 +3451,29 @@ const qr = de.any(), br = ({
3425
3451
  try {
3426
3452
  const m = {
3427
3453
  applicantId: t,
3428
- investorType: s
3454
+ investorType: a
3429
3455
  };
3430
3456
  console.log("Submitting investor categorization:", m);
3431
- const b = await a.setInvestorCategorization(m);
3457
+ const b = await s.setInvestorCategorization(m);
3432
3458
  console.log("Investor categorization result:", b), e == null || e();
3433
3459
  } catch (m) {
3434
3460
  console.error("Error submitting investor categorization:", m), u(m.message || "Failed to submit investor categorization");
3435
3461
  } finally {
3436
3462
  l(!1);
3437
3463
  }
3438
- }, children: /* @__PURE__ */ o(L, { children: [
3439
- /* @__PURE__ */ o(Z, { children: [
3464
+ }, children: /* @__PURE__ */ o(T, { children: [
3465
+ /* @__PURE__ */ o(J, { children: [
3440
3466
  /* @__PURE__ */ n("h2", { className: "text-2xl font-bold text-gray-900 dark:text-white", children: "Which statement best describes you?" }),
3441
3467
  /* @__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" })
3442
3468
  ] }),
3443
- /* @__PURE__ */ o(T, { className: "space-y-4", children: [
3469
+ /* @__PURE__ */ o(M, { className: "space-y-4", children: [
3444
3470
  /* @__PURE__ */ n("p", { className: "text-sm font-medium text-gray-700 dark:text-gray-300 mb-3", children: "Choose one" }),
3445
3471
  /* @__PURE__ */ n(
3446
3472
  "label",
3447
3473
  {
3448
3474
  className: `
3449
3475
  block p-4 border-2 rounded-lg cursor-pointer transition-all
3450
- ${s === X.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"}
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"}
3451
3477
  `,
3452
3478
  children: /* @__PURE__ */ o("div", { className: "flex items-start", children: [
3453
3479
  /* @__PURE__ */ n(
@@ -3455,9 +3481,9 @@ const qr = de.any(), br = ({
3455
3481
  {
3456
3482
  type: "radio",
3457
3483
  name: "investorType",
3458
- value: X.Individual,
3459
- checked: s === X.Individual,
3460
- onChange: () => i(X.Individual),
3484
+ value: ee.Individual,
3485
+ checked: a === ee.Individual,
3486
+ onChange: () => i(ee.Individual),
3461
3487
  className: "mt-1 h-4 w-4 text-primary-500 border-gray-300 focus:ring-primary-500"
3462
3488
  }
3463
3489
  ),
@@ -3473,7 +3499,7 @@ const qr = de.any(), br = ({
3473
3499
  {
3474
3500
  className: `
3475
3501
  block p-4 border-2 rounded-lg cursor-pointer transition-all
3476
- ${s === X.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"}
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"}
3477
3503
  `,
3478
3504
  children: /* @__PURE__ */ o("div", { className: "flex items-start", children: [
3479
3505
  /* @__PURE__ */ n(
@@ -3481,9 +3507,9 @@ const qr = de.any(), br = ({
3481
3507
  {
3482
3508
  type: "radio",
3483
3509
  name: "investorType",
3484
- value: X.Sophisticated,
3485
- checked: s === X.Sophisticated,
3486
- onChange: () => i(X.Sophisticated),
3510
+ value: ee.Sophisticated,
3511
+ checked: a === ee.Sophisticated,
3512
+ onChange: () => i(ee.Sophisticated),
3487
3513
  className: "mt-1 h-4 w-4 text-primary-500 border-gray-300 focus:ring-primary-500"
3488
3514
  }
3489
3515
  ),
@@ -3504,7 +3530,7 @@ const qr = de.any(), br = ({
3504
3530
  {
3505
3531
  className: `
3506
3532
  block p-4 border-2 rounded-lg cursor-pointer transition-all
3507
- ${s === X.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"}
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"}
3508
3534
  `,
3509
3535
  children: /* @__PURE__ */ o("div", { className: "flex items-start", children: [
3510
3536
  /* @__PURE__ */ n(
@@ -3512,9 +3538,9 @@ const qr = de.any(), br = ({
3512
3538
  {
3513
3539
  type: "radio",
3514
3540
  name: "investorType",
3515
- value: X.HighNetWorth,
3516
- checked: s === X.HighNetWorth,
3517
- onChange: () => i(X.HighNetWorth),
3541
+ value: ee.HighNetWorth,
3542
+ checked: a === ee.HighNetWorth,
3543
+ onChange: () => i(ee.HighNetWorth),
3518
3544
  className: "mt-1 h-4 w-4 text-primary-500 border-gray-300 focus:ring-primary-500"
3519
3545
  }
3520
3546
  ),
@@ -3536,31 +3562,31 @@ const qr = de.any(), br = ({
3536
3562
  ] }) })
3537
3563
  ] }),
3538
3564
  /* @__PURE__ */ o(te, { className: "flex justify-between", children: [
3539
- r && /* @__PURE__ */ n(_, { type: "button", variant: "outline", onClick: r, children: "Back" }),
3565
+ r && /* @__PURE__ */ n(j, { type: "button", variant: "outline", onClick: r, children: "Back" }),
3540
3566
  /* @__PURE__ */ n(
3541
- _,
3567
+ j,
3542
3568
  {
3543
3569
  type: "submit",
3544
3570
  isLoading: c,
3545
- disabled: s === null,
3571
+ disabled: a === null,
3546
3572
  children: "Submit"
3547
3573
  }
3548
3574
  )
3549
3575
  ] })
3550
3576
  ] }) });
3551
- }, Nr = ({
3577
+ }, Cr = ({
3552
3578
  applicantId: t,
3553
3579
  onComplete: e,
3554
3580
  onBack: r
3555
3581
  }) => {
3556
- const { appropriatenessTestService: a } = re(), [s, i] = v(null), [c, l] = v(!0), [d, u] = v(!1), [g, p] = v(null), [m, b] = v({}), [y, x] = v(0), [R, h] = v(!1), [N, w] = v(!1), [E, F] = v(0);
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);
3557
3583
  V(() => {
3558
3584
  (async () => {
3559
3585
  try {
3560
3586
  l(!0), p(null), console.log("Loading appropriateness test for applicant:", t);
3561
- const k = await a.getAppropriatenessTest(t);
3587
+ const k = await s.getAppropriatenessTest(t);
3562
3588
  if (console.log("Appropriateness test data:", k), i(k), k.waitTimeSpanForNextTry && k.waitTimeSpanForNextTry !== "00:00:00") {
3563
- const S = M(k.waitTimeSpanForNextTry);
3589
+ const S = L(k.waitTimeSpanForNextTry);
3564
3590
  S > 0 && F(S);
3565
3591
  }
3566
3592
  } catch (k) {
@@ -3569,44 +3595,44 @@ const qr = de.any(), br = ({
3569
3595
  l(!1);
3570
3596
  }
3571
3597
  })();
3572
- }, [t, a]);
3573
- const M = (C) => {
3574
- const k = C.split(":").map(Number);
3598
+ }, [t, s]);
3599
+ const L = (A) => {
3600
+ const k = A.split(":").map(Number);
3575
3601
  if (k.length === 3) {
3576
- const [S, j, oe] = k;
3577
- return S * 3600 + j * 60 + oe;
3602
+ const [S, _, oe] = k;
3603
+ return S * 3600 + _ * 60 + oe;
3578
3604
  }
3579
3605
  return 0;
3580
- }, I = (C) => {
3581
- const k = Math.floor(C / 60), S = C % 60;
3606
+ }, R = (A) => {
3607
+ const k = Math.floor(A / 60), S = A % 60;
3582
3608
  return `${k.toString().padStart(2, "0")}:${S.toString().padStart(2, "0")}`;
3583
3609
  };
3584
3610
  V(() => {
3585
- if (!R || y <= 0) return;
3586
- const C = setInterval(() => {
3587
- x((k) => k <= 1 ? (w(!0), 0) : k - 1);
3611
+ if (!P || y <= 0) return;
3612
+ const A = setInterval(() => {
3613
+ f((k) => k <= 1 ? (w(!0), 0) : k - 1);
3588
3614
  }, 1e3);
3589
- return () => clearInterval(C);
3590
- }, [R, y]), V(() => {
3591
- if (E <= 0) return;
3592
- const C = setInterval(() => {
3615
+ return () => clearInterval(A);
3616
+ }, [P, y]), V(() => {
3617
+ if (I <= 0) return;
3618
+ const A = setInterval(() => {
3593
3619
  F((k) => k <= 1 ? 0 : k - 1);
3594
3620
  }, 1e3);
3595
- return () => clearInterval(C);
3596
- }, [E]), V(() => {
3621
+ return () => clearInterval(A);
3622
+ }, [I]), V(() => {
3597
3623
  N && !d && z();
3598
3624
  }, [N]);
3599
- const A = () => {
3600
- s && (h(!0), x(s.testDurationSec));
3601
- }, B = (C, k) => {
3625
+ const C = () => {
3626
+ a && (h(!0), f(a.testDurationSec));
3627
+ }, B = (A, k) => {
3602
3628
  b((S) => ({
3603
3629
  ...S,
3604
- [C]: k
3630
+ [A]: k
3605
3631
  }));
3606
- }, z = async (C) => {
3607
- if (C && C.preventDefault(), !!s) {
3632
+ }, z = async (A) => {
3633
+ if (A && A.preventDefault(), !!a) {
3608
3634
  if (!N) {
3609
- const k = s.appropriatenessQuestions.length - Object.keys(m).length;
3635
+ const k = a.appropriatenessQuestions.length - Object.keys(m).length;
3610
3636
  if (k > 0) {
3611
3637
  p(`Please answer all questions. ${k} question(s) remaining.`);
3612
3638
  return;
@@ -3614,27 +3640,27 @@ const qr = de.any(), br = ({
3614
3640
  }
3615
3641
  u(!0), p(null);
3616
3642
  try {
3617
- const k = s.appropriatenessQuestions.map(
3618
- (j) => ({
3619
- appropriatenessQuestionId: j.id,
3620
- value: m[j.id] || ""
3643
+ const k = a.appropriatenessQuestions.map(
3644
+ (_) => ({
3645
+ appropriatenessQuestionId: _.id,
3646
+ value: m[_.id] || ""
3621
3647
  // Empty string if not answered
3622
3648
  })
3623
3649
  ), S = {
3624
3650
  applicantId: t,
3625
- appropriatenessTestId: s.id,
3651
+ appropriatenessTestId: a.id,
3626
3652
  appropriatenessQuestionResults: k
3627
3653
  };
3628
3654
  console.log("Submitting appropriateness test:", S);
3629
3655
  try {
3630
- const j = await a.fillAppropriatenessTest(S);
3631
- console.log("Appropriateness test result:", j), j.message && (j.message.toLowerCase().includes("pass") || j.message.toLowerCase().includes("success") || j.message.toLowerCase().includes("congratulations")) ? e == null || e() : (p(j.message || "Test completed. Please check the result."), h(!1), w(!1), b({}), setTimeout(() => f(), 1e3));
3632
- } catch (j) {
3633
- if (j.code === 400 && j.message) {
3634
- const oe = j.message;
3635
- console.log("Test failed:", oe), p(oe), h(!1), w(!1), b({}), setTimeout(() => f(), 1500);
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);
3636
3662
  } else
3637
- throw j;
3663
+ throw _;
3638
3664
  }
3639
3665
  } catch (k) {
3640
3666
  console.error("Error submitting appropriateness test:", k), p(k.message || "Failed to submit test. Please try again."), h(!1), w(!1), b({});
@@ -3642,77 +3668,77 @@ const qr = de.any(), br = ({
3642
3668
  u(!1);
3643
3669
  }
3644
3670
  }
3645
- }, f = async () => {
3671
+ }, v = async () => {
3646
3672
  try {
3647
- const C = await a.getAppropriatenessTest(t);
3648
- if (console.log("Reloaded test data:", C), i(C), C.waitTimeSpanForNextTry && C.waitTimeSpanForNextTry !== "00:00:00") {
3649
- const k = M(C.waitTimeSpanForNextTry);
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);
3650
3676
  k > 0 && F(k);
3651
3677
  }
3652
- } catch (C) {
3653
- console.error("Error reloading test data:", C), p((k) => k + `
3678
+ } catch (A) {
3679
+ console.error("Error reloading test data:", A), p((k) => k + `
3654
3680
 
3655
3681
  Failed to reload test data. Please refresh the page.`);
3656
3682
  }
3657
3683
  };
3658
3684
  if (c)
3659
- return /* @__PURE__ */ n(L, { children: /* @__PURE__ */ o(T, { children: [
3685
+ return /* @__PURE__ */ n(T, { children: /* @__PURE__ */ o(M, { children: [
3660
3686
  /* @__PURE__ */ n(ie, { className: "my-8" }),
3661
3687
  /* @__PURE__ */ n("p", { className: "text-center text-gray-600 dark:text-gray-400 mt-4", children: "Loading appropriateness test..." })
3662
3688
  ] }) });
3663
- if (!s)
3664
- return /* @__PURE__ */ n(L, { children: /* @__PURE__ */ o(T, { className: "py-12 text-center", children: [
3689
+ if (!a)
3690
+ return /* @__PURE__ */ n(T, { children: /* @__PURE__ */ o(M, { className: "py-12 text-center", children: [
3665
3691
  /* @__PURE__ */ n("p", { className: "text-danger-500 text-lg mb-4", children: "No test data available" }),
3666
3692
  g && /* @__PURE__ */ n("p", { className: "text-gray-600 dark:text-gray-400", children: g })
3667
3693
  ] }) });
3668
- if (E > 0)
3669
- return /* @__PURE__ */ o(L, { children: [
3670
- /* @__PURE__ */ o(Z, { children: [
3671
- /* @__PURE__ */ n("h2", { className: "text-2xl font-bold text-gray-900 dark:text-white", children: s.displayName }),
3672
- s.subtitle && /* @__PURE__ */ n("p", { className: "text-gray-600 dark:text-gray-400 mt-2", children: s.subtitle })
3694
+ if (I > 0)
3695
+ return /* @__PURE__ */ o(T, { children: [
3696
+ /* @__PURE__ */ o(J, { children: [
3697
+ /* @__PURE__ */ n("h2", { className: "text-2xl font-bold text-gray-900 dark:text-white", children: a.displayName }),
3698
+ a.subtitle && /* @__PURE__ */ n("p", { className: "text-gray-600 dark:text-gray-400 mt-2", children: a.subtitle })
3673
3699
  ] }),
3674
- /* @__PURE__ */ o(T, { className: "py-12 text-center", children: [
3700
+ /* @__PURE__ */ o(M, { className: "py-12 text-center", children: [
3675
3701
  /* @__PURE__ */ o("div", { className: "mb-6", children: [
3676
- /* @__PURE__ */ n("div", { className: "text-6xl font-bold text-primary-500 mb-2", children: I(E) }),
3702
+ /* @__PURE__ */ n("div", { className: "text-6xl font-bold text-primary-500 mb-2", children: R(I) }),
3677
3703
  /* @__PURE__ */ n("p", { className: "text-gray-600 dark:text-gray-400", children: "Please wait before attempting the test again" })
3678
3704
  ] }),
3679
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 }) })
3680
3706
  ] })
3681
3707
  ] });
3682
- const D = s.testAllowedMaxTry - s.totalFailedTries;
3683
- return R ? /* @__PURE__ */ n("form", { onSubmit: z, children: /* @__PURE__ */ o(L, { children: [
3684
- /* @__PURE__ */ n(Z, { children: /* @__PURE__ */ o("div", { className: "flex items-center justify-between", children: [
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: [
3685
3711
  /* @__PURE__ */ o("div", { children: [
3686
- /* @__PURE__ */ n("h2", { className: "text-2xl font-bold text-gray-900 dark:text-white", children: s.displayName }),
3687
- s.subtitle && /* @__PURE__ */ n("p", { className: "text-gray-600 dark:text-gray-400 mt-1", children: s.subtitle })
3712
+ /* @__PURE__ */ n("h2", { className: "text-2xl font-bold text-gray-900 dark:text-white", children: a.displayName }),
3713
+ a.subtitle && /* @__PURE__ */ n("p", { className: "text-gray-600 dark:text-gray-400 mt-1", children: a.subtitle })
3688
3714
  ] }),
3689
3715
  /* @__PURE__ */ o("div", { className: "text-right", children: [
3690
3716
  /* @__PURE__ */ n(
3691
3717
  "div",
3692
3718
  {
3693
3719
  className: `text-3xl font-bold ${y <= 60 ? "text-danger-500" : "text-primary-500"}`,
3694
- children: I(y)
3720
+ children: R(y)
3695
3721
  }
3696
3722
  ),
3697
3723
  /* @__PURE__ */ n("p", { className: "text-sm text-gray-500 dark:text-gray-400", children: "Time Remaining" })
3698
3724
  ] })
3699
3725
  ] }) }),
3700
- /* @__PURE__ */ o(T, { className: "space-y-6", children: [
3726
+ /* @__PURE__ */ o(M, { className: "space-y-6", children: [
3701
3727
  /* @__PURE__ */ o("div", { className: "flex items-center justify-between mb-4", children: [
3702
- /* @__PURE__ */ o(ue, { variant: "info", children: [
3728
+ /* @__PURE__ */ o(me, { variant: "info", children: [
3703
3729
  "Question ",
3704
3730
  Object.keys(m).length,
3705
3731
  " of ",
3706
- s.totalQuestionCount
3732
+ a.totalQuestionCount
3707
3733
  ] }),
3708
- /* @__PURE__ */ o(ue, { variant: D > 1 ? "success" : "warning", children: [
3709
- D,
3734
+ /* @__PURE__ */ o(me, { variant: E > 1 ? "success" : "warning", children: [
3735
+ E,
3710
3736
  " attempt",
3711
- D !== 1 ? "s" : "",
3737
+ E !== 1 ? "s" : "",
3712
3738
  " remaining"
3713
3739
  ] })
3714
3740
  ] }),
3715
- s.appropriatenessQuestions.map((C, k) => /* @__PURE__ */ o(
3741
+ a.appropriatenessQuestions.map((A, k) => /* @__PURE__ */ o(
3716
3742
  "div",
3717
3743
  {
3718
3744
  className: "p-4 border border-gray-200 dark:border-gray-700 rounded-lg",
@@ -3722,25 +3748,25 @@ Failed to reload test data. Please refresh the page.`);
3722
3748
  "Question ",
3723
3749
  k + 1
3724
3750
  ] }),
3725
- C.groupName && /* @__PURE__ */ n("span", { className: "ml-2 text-xs text-gray-500 dark:text-gray-400", children: C.groupName }),
3726
- /* @__PURE__ */ n("h3", { className: "text-lg font-semibold text-gray-900 dark:text-white mt-2", children: C.question })
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 })
3727
3753
  ] }),
3728
- /* @__PURE__ */ n("div", { className: "space-y-2", children: C.answers.map((S, j) => /* @__PURE__ */ o(
3754
+ /* @__PURE__ */ n("div", { className: "space-y-2", children: A.answers.map((S, _) => /* @__PURE__ */ o(
3729
3755
  "label",
3730
3756
  {
3731
3757
  className: `
3732
3758
  flex items-center p-3 border-2 rounded-lg cursor-pointer transition-all
3733
- ${m[C.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"}
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"}
3734
3760
  `,
3735
3761
  children: [
3736
3762
  /* @__PURE__ */ n(
3737
3763
  "input",
3738
3764
  {
3739
3765
  type: "radio",
3740
- name: `question-${C.id}`,
3766
+ name: `question-${A.id}`,
3741
3767
  value: S,
3742
- checked: m[C.id] === S,
3743
- onChange: (oe) => B(C.id, oe.target.value),
3768
+ checked: m[A.id] === S,
3769
+ onChange: (oe) => B(A.id, oe.target.value),
3744
3770
  className: "h-4 w-4 text-primary-500 border-gray-300 focus:ring-primary-500",
3745
3771
  disabled: d
3746
3772
  }
@@ -3748,11 +3774,11 @@ Failed to reload test data. Please refresh the page.`);
3748
3774
  /* @__PURE__ */ n("span", { className: "ml-3 text-gray-700 dark:text-gray-300", children: S })
3749
3775
  ]
3750
3776
  },
3751
- j
3777
+ _
3752
3778
  )) })
3753
3779
  ]
3754
3780
  },
3755
- C.id
3781
+ A.id
3756
3782
  )),
3757
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: [
3758
3784
  /* @__PURE__ */ n("strong", { children: "Error:" }),
@@ -3766,7 +3792,7 @@ Failed to reload test data. Please refresh the page.`);
3766
3792
  ] }),
3767
3793
  /* @__PURE__ */ o(te, { className: "flex justify-between", children: [
3768
3794
  /* @__PURE__ */ n(
3769
- _,
3795
+ j,
3770
3796
  {
3771
3797
  type: "button",
3772
3798
  variant: "outline",
@@ -3776,38 +3802,38 @@ Failed to reload test data. Please refresh the page.`);
3776
3802
  }
3777
3803
  ),
3778
3804
  /* @__PURE__ */ n(
3779
- _,
3805
+ j,
3780
3806
  {
3781
3807
  type: "submit",
3782
3808
  isLoading: d,
3783
- disabled: Object.keys(m).length < s.totalQuestionCount,
3809
+ disabled: Object.keys(m).length < a.totalQuestionCount,
3784
3810
  children: N ? "Submitting..." : "Submit Test"
3785
3811
  }
3786
3812
  )
3787
3813
  ] })
3788
- ] }) }) : /* @__PURE__ */ o(L, { children: [
3789
- /* @__PURE__ */ o(Z, { children: [
3790
- /* @__PURE__ */ n("h2", { className: "text-2xl font-bold text-gray-900 dark:text-white", children: s.displayName }),
3791
- s.subtitle && /* @__PURE__ */ n("p", { className: "text-gray-600 dark:text-gray-400 mt-2", children: s.subtitle })
3814
+ ] }) }) : /* @__PURE__ */ o(T, { children: [
3815
+ /* @__PURE__ */ o(J, { children: [
3816
+ /* @__PURE__ */ n("h2", { className: "text-2xl font-bold text-gray-900 dark:text-white", children: a.displayName }),
3817
+ a.subtitle && /* @__PURE__ */ n("p", { className: "text-gray-600 dark:text-gray-400 mt-2", children: a.subtitle })
3792
3818
  ] }),
3793
- /* @__PURE__ */ o(T, { children: [
3794
- s.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: s.description }) }),
3819
+ /* @__PURE__ */ o(M, { children: [
3820
+ 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 }) }),
3795
3821
  /* @__PURE__ */ o("div", { className: "space-y-4 mb-6", children: [
3796
3822
  /* @__PURE__ */ o("div", { className: "flex items-center justify-between p-4 bg-blue-50 dark:bg-blue-900/20 rounded-lg", children: [
3797
3823
  /* @__PURE__ */ n("span", { className: "text-gray-700 dark:text-gray-300 font-medium", children: "Total Questions:" }),
3798
- /* @__PURE__ */ n(ue, { variant: "info", children: s.totalQuestionCount })
3824
+ /* @__PURE__ */ n(me, { variant: "info", children: a.totalQuestionCount })
3799
3825
  ] }),
3800
3826
  /* @__PURE__ */ o("div", { className: "flex items-center justify-between p-4 bg-blue-50 dark:bg-blue-900/20 rounded-lg", children: [
3801
3827
  /* @__PURE__ */ n("span", { className: "text-gray-700 dark:text-gray-300 font-medium", children: "Time Limit:" }),
3802
- /* @__PURE__ */ n(ue, { variant: "info", children: I(s.testDurationSec) })
3828
+ /* @__PURE__ */ n(me, { variant: "info", children: R(a.testDurationSec) })
3803
3829
  ] }),
3804
3830
  /* @__PURE__ */ o("div", { className: "flex items-center justify-between p-4 bg-blue-50 dark:bg-blue-900/20 rounded-lg", children: [
3805
3831
  /* @__PURE__ */ n("span", { className: "text-gray-700 dark:text-gray-300 font-medium", children: "Correct Answers Required:" }),
3806
- /* @__PURE__ */ n(ue, { variant: "info", children: s.testCorrectAnswerPassLimit })
3832
+ /* @__PURE__ */ n(me, { variant: "info", children: a.testCorrectAnswerPassLimit })
3807
3833
  ] }),
3808
3834
  /* @__PURE__ */ o("div", { className: "flex items-center justify-between p-4 bg-blue-50 dark:bg-blue-900/20 rounded-lg", children: [
3809
3835
  /* @__PURE__ */ n("span", { className: "text-gray-700 dark:text-gray-300 font-medium", children: "Attempts Remaining:" }),
3810
- /* @__PURE__ */ n(ue, { variant: D > 1 ? "success" : "warning", children: D })
3836
+ /* @__PURE__ */ n(me, { variant: E > 1 ? "success" : "warning", children: E })
3811
3837
  ] })
3812
3838
  ] }),
3813
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: [
@@ -3815,28 +3841,28 @@ Failed to reload test data. Please refresh the page.`);
3815
3841
  " ",
3816
3842
  g
3817
3843
  ] }) }),
3818
- D <= 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." }) })
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." }) })
3819
3845
  ] }),
3820
3846
  /* @__PURE__ */ o(te, { className: "flex justify-between", children: [
3821
- r && /* @__PURE__ */ n(_, { type: "button", variant: "outline", onClick: r, children: "Back" }),
3847
+ r && /* @__PURE__ */ n(j, { type: "button", variant: "outline", onClick: r, children: "Back" }),
3822
3848
  /* @__PURE__ */ n(
3823
- _,
3849
+ j,
3824
3850
  {
3825
3851
  type: "button",
3826
- onClick: A,
3827
- disabled: D <= 0,
3852
+ onClick: C,
3853
+ disabled: E <= 0,
3828
3854
  children: "Start Test"
3829
3855
  }
3830
3856
  )
3831
3857
  ] })
3832
3858
  ] });
3833
- }, Sr = ({
3859
+ }, Ar = ({
3834
3860
  applicantId: t,
3835
3861
  onComplete: e,
3836
3862
  onBack: r
3837
3863
  }) => {
3838
- var k, S, j, oe;
3839
- const { applicantService: a, baseInformationService: s, config: i } = re(), { identityData: c, provider: l, token: d, isLoading: u, error: g, requestIdentity: p, restartIdentity: m } = Jt(t), [b, y] = v(null), [x, R] = v(null), [h, N] = v([]), [w, E] = v(!0), [F, M] = v(!1), [I, A] = v(null), [B, z] = v(!1), f = De({
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({
3840
3866
  defaultValues: {
3841
3867
  street: "",
3842
3868
  streetNumber: "",
@@ -3850,18 +3876,18 @@ Failed to reload test data. Please refresh the page.`);
3850
3876
  V(() => {
3851
3877
  (async () => {
3852
3878
  try {
3853
- const [P, W] = await Promise.all([
3854
- a.getApplicantData(t),
3855
- s.getCountries("", "en")
3879
+ const [D, W] = await Promise.all([
3880
+ s.getApplicantData(t),
3881
+ a.getCountries("", "en")
3856
3882
  ]);
3857
- R(P);
3858
- const H = /* @__PURE__ */ new Set(), ne = W.filter((me) => {
3859
- const he = me.abbreviation3 || me.abbreviation;
3860
- return !he || H.has(he) ? !1 : (H.add(he), !0);
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);
3861
3887
  });
3862
3888
  N(ne);
3863
- const $ = P.applicantRequestData;
3864
- if (f.reset({
3889
+ const $ = D.applicantRequestData;
3890
+ if (E.reset({
3865
3891
  street: ($ == null ? void 0 : $.street) || "",
3866
3892
  streetNumber: ($ == null ? void 0 : $.streetNumber) || "",
3867
3893
  city: ($ == null ? void 0 : $.city) || "",
@@ -3869,41 +3895,43 @@ Failed to reload test data. Please refresh the page.`);
3869
3895
  country: ($ == null ? void 0 : $.country) || "",
3870
3896
  nationality: ($ == null ? void 0 : $.nationality) || "",
3871
3897
  phonenumber: ($ == null ? void 0 : $.phonenumber) || ""
3872
- }), !c && !u) {
3873
- console.log("[Identity] Auto-requesting identity verification for IdentityPending status");
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;
3874
3900
  try {
3875
- await p(), M(!0);
3876
- } catch (me) {
3877
- console.error("[Identity] Auto-request failed:", me);
3901
+ await p(), L(!0);
3902
+ } catch (ue) {
3903
+ console.error("[Identity] Auto-request failed:", ue);
3878
3904
  }
3879
3905
  }
3880
- } catch (P) {
3881
- console.error("Error loading applicant data:", P);
3906
+ } catch (D) {
3907
+ console.error("Error loading applicant data:", D);
3882
3908
  } finally {
3883
- E(!1);
3909
+ I(!1);
3884
3910
  }
3885
3911
  })();
3886
- }, [t, a, s, f, c, u]), V(() => {
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(() => {
3887
3915
  if (d) {
3888
3916
  if (d.expiresAt) {
3889
3917
  const O = new Date(d.expiresAt).getTime();
3890
3918
  if (Date.now() >= O) {
3891
- console.warn("[Identity] Token has expired (expiresAt)"), z(!0), A("Your verification session has expired. Please restart.");
3919
+ console.warn("[Identity] Token has expired (expiresAt)"), z(!0), C("Your verification session has expired. Please restart.");
3892
3920
  return;
3893
3921
  }
3894
3922
  }
3895
3923
  if (d.url)
3896
3924
  try {
3897
- const P = new URL(d.url).toString().toLowerCase();
3898
- if (P.includes("expired") || P.includes("invalid") || P.includes("error")) {
3899
- console.warn("[Identity] Token URL indicates expiration"), z(!0), A("Your verification link has expired. Please restart.");
3925
+ const D = new URL(d.url).toString().toLowerCase();
3926
+ 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.");
3900
3928
  return;
3901
3929
  }
3902
3930
  } catch {
3903
3931
  console.error("[Identity] Invalid token URL");
3904
3932
  }
3905
3933
  if (d.status === "expired" || d.error === "expired" || d.expired === !0) {
3906
- console.warn("[Identity] Token object indicates expiration"), z(!0), A("Your verification session has expired. Please restart.");
3934
+ console.warn("[Identity] Token object indicates expiration"), z(!0), C("Your verification session has expired. Please restart.");
3907
3935
  return;
3908
3936
  }
3909
3937
  }
@@ -3911,31 +3939,31 @@ Failed to reload test data. Please refresh the page.`);
3911
3939
  if (l !== null && d && !b && F && !B) {
3912
3940
  const O = l;
3913
3941
  if (d.url) {
3914
- console.log("[Identity] Loading provider URL for user verification:", d.url), A(null);
3942
+ console.log("[Identity] Loading provider URL for user verification:", d.url), C(null);
3915
3943
  try {
3916
- if (new URL(d.url), O === ae.SardinAI) {
3944
+ if (new URL(d.url), O === se.SardinAI) {
3917
3945
  console.log("[SardinAI] Initializing Risk SDK in background...");
3918
3946
  try {
3919
- const P = fe.parseProviderConfig(l, d, i);
3920
- fe.createProvider(l, P).initialize().then(() => {
3947
+ const D = ye.parseProviderConfig(l, d, i);
3948
+ ye.createProvider(l, D).initialize().then(() => {
3921
3949
  console.log("[SardinAI] Risk SDK initialized successfully in background");
3922
3950
  }).catch((H) => {
3923
3951
  console.warn("[SardinAI] Risk SDK initialization failed (non-blocking):", H);
3924
3952
  });
3925
- } catch (P) {
3926
- console.warn("[SardinAI] Risk SDK setup failed (non-blocking):", P);
3953
+ } catch (D) {
3954
+ console.warn("[SardinAI] Risk SDK setup failed (non-blocking):", D);
3927
3955
  }
3928
3956
  }
3929
3957
  y({ type: "url", url: d.url });
3930
- } catch (P) {
3931
- console.error("[Identity] Invalid URL:", P), A("Invalid verification URL. Please restart."), z(!0);
3958
+ } catch (D) {
3959
+ console.error("[Identity] Invalid URL:", D), C("Invalid verification URL. Please restart."), z(!0);
3932
3960
  }
3933
3961
  return;
3934
3962
  }
3935
- if (O === ae.SardinAI) {
3936
- console.log("[SardinAI] No URL provided - initializing Risk SDK only..."), A(null);
3963
+ if (O === se.SardinAI) {
3964
+ console.log("[SardinAI] No URL provided - initializing Risk SDK only..."), C(null);
3937
3965
  try {
3938
- const P = fe.parseProviderConfig(l, d, i), W = fe.createProvider(l, P);
3966
+ const D = ye.parseProviderConfig(l, d, i), W = ye.createProvider(l, D);
3939
3967
  W.initialize().then(() => {
3940
3968
  console.log("[SardinAI] Risk SDK initialized successfully"), y(W), setTimeout(() => {
3941
3969
  e == null || e();
@@ -3944,26 +3972,26 @@ Failed to reload test data. Please refresh the page.`);
3944
3972
  var $;
3945
3973
  console.error("[SardinAI] Failed to initialize:", H);
3946
3974
  const ne = (($ = H.message) == null ? void 0 : $.toLowerCase()) || "";
3947
- ne.includes("expired") || ne.includes("invalid") || ne.includes("401") || ne.includes("400") ? (z(!0), A("Session expired or invalid. Please restart verification.")) : A(`Failed to initialize: ${H.message}`);
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}`);
3948
3976
  });
3949
- } catch (P) {
3950
- console.error("[SardinAI] Error creating provider:", P), A(`Configuration error: ${P.message}`);
3977
+ } catch (D) {
3978
+ console.error("[SardinAI] Error creating provider:", D), C(`Configuration error: ${D.message}`);
3951
3979
  }
3952
3980
  return;
3953
3981
  }
3954
3982
  try {
3955
- A(null);
3956
- const P = fe.parseProviderConfig(l, d, i), W = fe.createProvider(l, P);
3957
- O === ae.Sumsub ? (W.initialize("identity-container").catch((H) => {
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) => {
3958
3986
  var ne;
3959
- console.error("[Sumsub] Initialization error:", H), A(`Failed to initialize: ${H.message}`), (ne = H.message) != null && ne.toLowerCase().includes("expired") && z(!0);
3987
+ console.error("[Sumsub] Initialization error:", H), C(`Failed to initialize: ${H.message}`), (ne = H.message) != null && ne.toLowerCase().includes("expired") && z(!0);
3960
3988
  }), W.onComplete && W.onComplete(() => {
3961
3989
  e == null || e();
3962
- })) : O === ae.Onfido && W.initialize("identity-container").catch((H) => {
3963
- console.error("[Onfido] Initialization error:", H), A(`Failed to initialize: ${H.message}`);
3990
+ })) : O === se.Onfido && W.initialize("identity-container").catch((H) => {
3991
+ console.error("[Onfido] Initialization error:", H), C(`Failed to initialize: ${H.message}`);
3964
3992
  }), y(W);
3965
- } catch (P) {
3966
- console.error("[Identity] Provider setup error:", P), A(`Setup error: ${P.message}`);
3993
+ } catch (D) {
3994
+ console.error("[Identity] Provider setup error:", D), C(`Setup error: ${D.message}`);
3967
3995
  }
3968
3996
  }
3969
3997
  return () => {
@@ -3975,33 +4003,33 @@ Failed to reload test data. Please refresh the page.`);
3975
4003
  }
3976
4004
  };
3977
4005
  }, [l, d, b, F, e, B]);
3978
- const D = async () => {
4006
+ const A = async () => {
3979
4007
  try {
3980
- A(null), z(!1), await p(), M(!0);
4008
+ C(null), z(!1), await p(), L(!0);
3981
4009
  } catch (O) {
3982
4010
  console.error("Error starting identity verification:", O);
3983
4011
  }
3984
- }, C = async () => {
4012
+ }, k = async () => {
3985
4013
  try {
3986
- A(null), z(!1), y(null), console.log("[Identity] Restarting verification..."), await m(), M(!0);
4014
+ C(null), z(!1), y(null), console.log("[Identity] Restarting verification..."), await m(), L(!0);
3987
4015
  } catch (O) {
3988
- console.error("Error restarting identity verification:", O), A(O.message || "Failed to restart verification");
4016
+ console.error("Error restarting identity verification:", O), C(O.message || "Failed to restart verification");
3989
4017
  }
3990
4018
  };
3991
4019
  if (w || u)
3992
- return /* @__PURE__ */ n(L, { children: /* @__PURE__ */ o(T, { children: [
4020
+ return /* @__PURE__ */ n(T, { children: /* @__PURE__ */ o(M, { children: [
3993
4021
  /* @__PURE__ */ n(ie, { className: "my-8" }),
3994
4022
  /* @__PURE__ */ n("p", { className: "text-center text-gray-600 dark:text-gray-400 mt-4", children: "Loading identity verification..." })
3995
4023
  ] }) });
3996
4024
  if (g)
3997
- return /* @__PURE__ */ n(L, { children: /* @__PURE__ */ n(T, { children: /* @__PURE__ */ o("p", { className: "text-danger-500", children: [
4025
+ return /* @__PURE__ */ n(T, { children: /* @__PURE__ */ n(M, { children: /* @__PURE__ */ o("p", { className: "text-danger-500", children: [
3998
4026
  "Error: ",
3999
4027
  g.message
4000
4028
  ] }) }) });
4001
- if (F && (I || B))
4002
- return /* @__PURE__ */ o(L, { children: [
4003
- /* @__PURE__ */ n(Z, { children: /* @__PURE__ */ n("h2", { className: "text-2xl font-bold text-gray-900 dark:text-white", children: "Verification Session Issue" }) }),
4004
- /* @__PURE__ */ o(T, { children: [
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: [
4005
4033
  /* @__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: [
4006
4034
  /* @__PURE__ */ n(
4007
4035
  "svg",
@@ -4023,7 +4051,7 @@ Failed to reload test data. Please refresh the page.`);
4023
4051
  ),
4024
4052
  /* @__PURE__ */ o("div", { children: [
4025
4053
  /* @__PURE__ */ n("h3", { className: "font-semibold text-red-900 dark:text-red-100 mb-1", children: B ? "Session Expired" : "Verification Error" }),
4026
- /* @__PURE__ */ n("p", { className: "text-red-800 dark:text-red-200 text-sm", children: I || "Your verification session has expired and needs to be restarted." })
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." })
4027
4055
  ] })
4028
4056
  ] }) }),
4029
4057
  /* @__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: [
@@ -4036,31 +4064,31 @@ Failed to reload test data. Please refresh the page.`);
4036
4064
  ] })
4037
4065
  ] }),
4038
4066
  /* @__PURE__ */ o(te, { className: "flex justify-between", children: [
4039
- r && /* @__PURE__ */ n(_, { type: "button", variant: "outline", onClick: r, children: "Back" }),
4040
- /* @__PURE__ */ n(_, { type: "button", onClick: C, disabled: u, children: u ? "Restarting..." : "Restart Verification" })
4067
+ 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" })
4041
4069
  ] })
4042
4070
  ] });
4043
4071
  if (F && c) {
4044
4072
  const O = l;
4045
- return d != null && d.url ? /* @__PURE__ */ o(L, { children: [
4046
- /* @__PURE__ */ n(Z, { children: /* @__PURE__ */ o("div", { className: "flex items-center justify-between", children: [
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: [
4047
4075
  /* @__PURE__ */ o("div", { children: [
4048
4076
  /* @__PURE__ */ n("h2", { className: "text-2xl font-bold", children: "Identity Verification" }),
4049
4077
  /* @__PURE__ */ n("p", { className: "text-gray-600 dark:text-gray-400 mt-1", children: "Please complete the identity verification process" })
4050
4078
  ] }),
4051
4079
  /* @__PURE__ */ n(
4052
- _,
4080
+ j,
4053
4081
  {
4054
4082
  type: "button",
4055
4083
  variant: "outline",
4056
4084
  size: "sm",
4057
- onClick: C,
4085
+ onClick: k,
4058
4086
  disabled: u,
4059
4087
  children: "Restart"
4060
4088
  }
4061
4089
  )
4062
4090
  ] }) }),
4063
- /* @__PURE__ */ o(T, { children: [
4091
+ /* @__PURE__ */ o(M, { children: [
4064
4092
  /* @__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: [
4065
4093
  /* @__PURE__ */ n("strong", { children: "Important:" }),
4066
4094
  ' If you see an "expired" or "invalid link" message below, click the "Restart" button above to generate a new verification session.'
@@ -4072,14 +4100,14 @@ Failed to reload test data. Please refresh the page.`);
4072
4100
  className: "w-full h-full border-0 rounded-lg",
4073
4101
  allow: "camera; microphone; geolocation",
4074
4102
  title: "Identity Verification",
4075
- onLoad: (P) => {
4103
+ onLoad: (D) => {
4076
4104
  var W, H, ne;
4077
4105
  console.log("[Identity] Iframe loaded");
4078
4106
  try {
4079
- const $ = P.target, me = $.contentDocument || ((W = $.contentWindow) == null ? void 0 : W.document);
4080
- if (me) {
4081
- const he = ((ne = (H = me.body) == null ? void 0 : H.textContent) == null ? void 0 : ne.toLowerCase()) || "";
4082
- (he.includes("expired") || he.includes("invalid") || he.includes("error")) && (console.warn("[Identity] Iframe shows expiration message"), z(!0), A("Your verification link has expired."));
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."));
4083
4111
  }
4084
4112
  } catch {
4085
4113
  console.log("[Identity] Cannot check iframe content (CORS)");
@@ -4088,68 +4116,68 @@ Failed to reload test data. Please refresh the page.`);
4088
4116
  }
4089
4117
  ) })
4090
4118
  ] }),
4091
- r && /* @__PURE__ */ n(te, { children: /* @__PURE__ */ n(_, { variant: "outline", onClick: r, children: "Back" }) })
4092
- ] }) : O === ae.SardinAI ? /* @__PURE__ */ o(L, { children: [
4093
- /* @__PURE__ */ o(Z, { children: [
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: [
4094
4122
  /* @__PURE__ */ n("h2", { className: "text-2xl font-bold", children: "Device Risk Assessment" }),
4095
4123
  /* @__PURE__ */ n("p", { className: "text-gray-600 dark:text-gray-400 mt-1", children: "Analyzing device security and behavioral patterns..." })
4096
4124
  ] }),
4097
- /* @__PURE__ */ n(T, { children: /* @__PURE__ */ o("div", { className: "text-center py-12", children: [
4125
+ /* @__PURE__ */ n(M, { children: /* @__PURE__ */ o("div", { className: "text-center py-12", children: [
4098
4126
  /* @__PURE__ */ n(ie, { className: "mb-4" }),
4099
4127
  /* @__PURE__ */ n("p", { className: "text-gray-600 dark:text-gray-400", children: "Please wait while we verify your device security" }),
4100
4128
  /* @__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" })
4101
4129
  ] }) })
4102
- ] }) : /* @__PURE__ */ o(L, { children: [
4103
- /* @__PURE__ */ o(Z, { children: [
4130
+ ] }) : /* @__PURE__ */ o(T, { children: [
4131
+ /* @__PURE__ */ o(J, { children: [
4104
4132
  /* @__PURE__ */ n("h2", { className: "text-2xl font-bold", children: "Identity Verification" }),
4105
4133
  /* @__PURE__ */ n("p", { className: "text-gray-600 dark:text-gray-400 mt-1", children: "Please complete the identity verification process" })
4106
4134
  ] }),
4107
- /* @__PURE__ */ n(T, { children: /* @__PURE__ */ n("div", { id: "identity-container", className: "min-h-[400px]" }) }),
4108
- r && /* @__PURE__ */ n(te, { children: /* @__PURE__ */ n(_, { variant: "outline", onClick: r, children: "Back" }) })
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" }) })
4109
4137
  ] });
4110
4138
  }
4111
- return /* @__PURE__ */ n("form", { onSubmit: f.handleSubmit(D), children: /* @__PURE__ */ o(L, { children: [
4112
- /* @__PURE__ */ o(Z, { children: [
4139
+ return /* @__PURE__ */ n("form", { onSubmit: E.handleSubmit(A), children: /* @__PURE__ */ o(T, { children: [
4140
+ /* @__PURE__ */ o(J, { children: [
4113
4141
  /* @__PURE__ */ n("h2", { className: "text-2xl font-bold", children: "Review Your Information" }),
4114
4142
  /* @__PURE__ */ n("p", { className: "text-gray-600 dark:text-gray-400 mt-1", children: "Please review and confirm your information before starting identity verification" })
4115
4143
  ] }),
4116
- /* @__PURE__ */ o(T, { className: "space-y-6", children: [
4144
+ /* @__PURE__ */ o(M, { className: "space-y-6", children: [
4117
4145
  /* @__PURE__ */ o("div", { className: "space-y-4 pb-4 border-b border-gray-200 dark:border-gray-700", children: [
4118
4146
  /* @__PURE__ */ o("div", { children: [
4119
4147
  /* @__PURE__ */ n("label", { className: "block text-sm font-medium text-gray-500 dark:text-gray-400", children: "Name" }),
4120
4148
  /* @__PURE__ */ o("p", { className: "mt-1 text-base", children: [
4121
- (k = x == null ? void 0 : x.applicantRequestData) == null ? void 0 : k.firstName,
4149
+ (S = f == null ? void 0 : f.applicantRequestData) == null ? void 0 : S.firstName,
4122
4150
  " ",
4123
- (S = x == null ? void 0 : x.applicantRequestData) == null ? void 0 : S.lastName
4151
+ (_ = f == null ? void 0 : f.applicantRequestData) == null ? void 0 : _.lastName
4124
4152
  ] })
4125
4153
  ] }),
4126
4154
  /* @__PURE__ */ o("div", { children: [
4127
4155
  /* @__PURE__ */ n("label", { className: "block text-sm font-medium text-gray-500 dark:text-gray-400", children: "Email" }),
4128
- /* @__PURE__ */ n("p", { className: "mt-1 text-base", children: (j = x == null ? void 0 : x.applicantRequestData) == null ? void 0 : j.email })
4156
+ /* @__PURE__ */ n("p", { className: "mt-1 text-base", children: (oe = f == null ? void 0 : f.applicantRequestData) == null ? void 0 : oe.email })
4129
4157
  ] }),
4130
4158
  /* @__PURE__ */ o("div", { children: [
4131
4159
  /* @__PURE__ */ n("label", { className: "block text-sm font-medium text-gray-500 dark:text-gray-400", children: "Date of Birth" }),
4132
- /* @__PURE__ */ n("p", { className: "mt-1 text-base", children: ((oe = x == null ? void 0 : x.applicantRequestData) == null ? void 0 : oe.dateOfBirth) || "Not provided" })
4160
+ /* @__PURE__ */ n("p", { className: "mt-1 text-base", children: ((Fe = f == null ? void 0 : f.applicantRequestData) == null ? void 0 : Fe.dateOfBirth) || "Not provided" })
4133
4161
  ] })
4134
4162
  ] }),
4135
4163
  /* @__PURE__ */ o("div", { className: "space-y-4", children: [
4136
4164
  /* @__PURE__ */ n("h3", { className: "text-lg font-semibold", children: "Address Information" }),
4137
4165
  /* @__PURE__ */ o("div", { className: "grid grid-cols-1 md:grid-cols-2 gap-4", children: [
4138
4166
  /* @__PURE__ */ n(
4139
- Q,
4167
+ G,
4140
4168
  {
4141
- control: f.control,
4169
+ control: E.control,
4142
4170
  name: "country",
4143
4171
  render: ({ field: O }) => /* @__PURE__ */ n(
4144
- ye,
4172
+ ge,
4145
4173
  {
4146
4174
  ...O,
4147
4175
  label: "Country",
4148
4176
  options: [
4149
4177
  { value: "", label: "Select country..." },
4150
- ...h.map((P) => ({
4151
- value: P.abbreviation3 || P.abbreviation,
4152
- label: P.name
4178
+ ...h.map((D) => ({
4179
+ value: D.abbreviation3 || D.abbreviation,
4180
+ label: D.name
4153
4181
  }))
4154
4182
  ]
4155
4183
  }
@@ -4157,20 +4185,20 @@ Failed to reload test data. Please refresh the page.`);
4157
4185
  }
4158
4186
  ),
4159
4187
  /* @__PURE__ */ n(
4160
- Q,
4188
+ G,
4161
4189
  {
4162
- control: f.control,
4190
+ control: E.control,
4163
4191
  name: "nationality",
4164
4192
  render: ({ field: O }) => /* @__PURE__ */ n(
4165
- ye,
4193
+ ge,
4166
4194
  {
4167
4195
  ...O,
4168
4196
  label: "Nationality",
4169
4197
  options: [
4170
4198
  { value: "", label: "Select nationality..." },
4171
- ...h.map((P) => ({
4172
- value: P.abbreviation3 || P.abbreviation,
4173
- label: P.name
4199
+ ...h.map((D) => ({
4200
+ value: D.abbreviation3 || D.abbreviation,
4201
+ label: D.name
4174
4202
  }))
4175
4203
  ]
4176
4204
  }
@@ -4180,120 +4208,120 @@ Failed to reload test data. Please refresh the page.`);
4180
4208
  ] }),
4181
4209
  /* @__PURE__ */ o("div", { className: "grid grid-cols-1 md:grid-cols-2 gap-4", children: [
4182
4210
  /* @__PURE__ */ n(
4183
- Q,
4211
+ G,
4184
4212
  {
4185
- control: f.control,
4213
+ control: E.control,
4186
4214
  name: "street",
4187
- render: ({ field: O }) => /* @__PURE__ */ n(G, { ...O, label: "Street" })
4215
+ render: ({ field: O }) => /* @__PURE__ */ n(Z, { ...O, label: "Street" })
4188
4216
  }
4189
4217
  ),
4190
4218
  /* @__PURE__ */ n(
4191
- Q,
4219
+ G,
4192
4220
  {
4193
- control: f.control,
4221
+ control: E.control,
4194
4222
  name: "streetNumber",
4195
- render: ({ field: O }) => /* @__PURE__ */ n(G, { ...O, label: "Street Number" })
4223
+ render: ({ field: O }) => /* @__PURE__ */ n(Z, { ...O, label: "Street Number" })
4196
4224
  }
4197
4225
  )
4198
4226
  ] }),
4199
4227
  /* @__PURE__ */ o("div", { className: "grid grid-cols-1 md:grid-cols-2 gap-4", children: [
4200
4228
  /* @__PURE__ */ n(
4201
- Q,
4229
+ G,
4202
4230
  {
4203
- control: f.control,
4231
+ control: E.control,
4204
4232
  name: "city",
4205
- render: ({ field: O }) => /* @__PURE__ */ n(G, { ...O, label: "City" })
4233
+ render: ({ field: O }) => /* @__PURE__ */ n(Z, { ...O, label: "City" })
4206
4234
  }
4207
4235
  ),
4208
4236
  /* @__PURE__ */ n(
4209
- Q,
4237
+ G,
4210
4238
  {
4211
- control: f.control,
4239
+ control: E.control,
4212
4240
  name: "zip",
4213
- render: ({ field: O }) => /* @__PURE__ */ n(G, { ...O, label: "ZIP/Postal Code" })
4241
+ render: ({ field: O }) => /* @__PURE__ */ n(Z, { ...O, label: "ZIP/Postal Code" })
4214
4242
  }
4215
4243
  )
4216
4244
  ] }),
4217
4245
  /* @__PURE__ */ n(
4218
- Q,
4246
+ G,
4219
4247
  {
4220
- control: f.control,
4248
+ control: E.control,
4221
4249
  name: "phonenumber",
4222
- render: ({ field: O }) => /* @__PURE__ */ n(G, { ...O, label: "Phone Number", type: "tel" })
4250
+ render: ({ field: O }) => /* @__PURE__ */ n(Z, { ...O, label: "Phone Number", type: "tel" })
4223
4251
  }
4224
4252
  )
4225
4253
  ] })
4226
4254
  ] }),
4227
4255
  /* @__PURE__ */ o(te, { className: "flex justify-between", children: [
4228
- r && /* @__PURE__ */ n(_, { type: "button", variant: "outline", onClick: r, children: "Back" }),
4229
- /* @__PURE__ */ n(_, { type: "submit", isLoading: u, children: "Confirm and Start Verification" })
4256
+ r && /* @__PURE__ */ n(j, { type: "button", variant: "outline", onClick: r, children: "Back" }),
4257
+ /* @__PURE__ */ n(j, { type: "submit", isLoading: u, children: "Confirm and Start Verification" })
4230
4258
  ] })
4231
4259
  ] }) });
4232
- }, Be = ({
4260
+ }, ze = ({
4233
4261
  kycStatus: t,
4234
4262
  reviewStatus: e,
4235
4263
  workflowResult: r,
4236
- customMessage: a,
4237
- onContinue: s,
4264
+ customMessage: s,
4265
+ onContinue: a,
4238
4266
  onContactSupport: i
4239
4267
  }) => {
4240
- const l = t === pe.Approved ? {
4268
+ const l = t === he.Approved ? {
4241
4269
  type: "success",
4242
4270
  title: "Verification Approved",
4243
4271
  icon: "✓",
4244
4272
  iconBg: "bg-green-100 dark:bg-green-900/30",
4245
4273
  iconColor: "text-green-600 dark:text-green-400",
4246
4274
  message: "Your identity verification has been successfully approved."
4247
- } : t === pe.Rejected ? {
4275
+ } : t === he.Rejected ? {
4248
4276
  type: "error",
4249
4277
  title: "Verification Rejected",
4250
4278
  icon: "✕",
4251
4279
  iconBg: "bg-red-100 dark:bg-red-900/30",
4252
4280
  iconColor: "text-red-600 dark:text-red-400",
4253
4281
  message: "Unfortunately, your identity verification was not approved."
4254
- } : t === pe.Pending || t === pe.InProgress ? {
4282
+ } : t === he.Pending || t === he.InProgress ? {
4255
4283
  type: "pending",
4256
4284
  title: "Verification Pending",
4257
4285
  icon: "⏱",
4258
4286
  iconBg: "bg-blue-100 dark:bg-blue-900/30",
4259
4287
  iconColor: "text-blue-600 dark:text-blue-400",
4260
4288
  message: "Your identity verification is currently being processed."
4261
- } : e === ge.Approved ? {
4289
+ } : e === pe.Approved ? {
4262
4290
  type: "success",
4263
4291
  title: "Application Approved",
4264
4292
  icon: "✓",
4265
4293
  iconBg: "bg-green-100 dark:bg-green-900/30",
4266
4294
  iconColor: "text-green-600 dark:text-green-400",
4267
4295
  message: "Your application has been approved."
4268
- } : e === ge.Reject ? {
4296
+ } : e === pe.Reject ? {
4269
4297
  type: "error",
4270
4298
  title: "Application Rejected",
4271
4299
  icon: "✕",
4272
4300
  iconBg: "bg-red-100 dark:bg-red-900/30",
4273
4301
  iconColor: "text-red-600 dark:text-red-400",
4274
4302
  message: "Your application has been rejected."
4275
- } : e === ge.UnderReview || e === ge.AdminReview ? {
4303
+ } : e === pe.UnderReview || e === pe.AdminReview ? {
4276
4304
  type: "pending",
4277
4305
  title: "Under Review",
4278
4306
  icon: "📋",
4279
4307
  iconBg: "bg-yellow-100 dark:bg-yellow-900/30",
4280
4308
  iconColor: "text-yellow-700 dark:text-yellow-400",
4281
4309
  message: "Your application is currently under manual review."
4282
- } : r === ke.Success ? {
4310
+ } : r === we.Success ? {
4283
4311
  type: "success",
4284
4312
  title: "Process Complete",
4285
4313
  icon: "✓",
4286
4314
  iconBg: "bg-green-100 dark:bg-green-900/30",
4287
4315
  iconColor: "text-green-600 dark:text-green-400",
4288
4316
  message: "Your verification process has been completed successfully."
4289
- } : r === ke.Failed ? {
4317
+ } : r === we.Failed ? {
4290
4318
  type: "error",
4291
4319
  title: "Process Failed",
4292
4320
  icon: "✕",
4293
4321
  iconBg: "bg-red-100 dark:bg-red-900/30",
4294
4322
  iconColor: "text-red-600 dark:text-red-400",
4295
4323
  message: "The verification process could not be completed."
4296
- } : r === ke.AdminReview ? {
4324
+ } : r === we.AdminReview ? {
4297
4325
  type: "pending",
4298
4326
  title: "Admin Review Required",
4299
4327
  icon: "📋",
@@ -4308,8 +4336,8 @@ Failed to reload test data. Please refresh the page.`);
4308
4336
  iconColor: "text-blue-600 dark:text-blue-400",
4309
4337
  message: "Your application is being reviewed."
4310
4338
  };
4311
- return /* @__PURE__ */ o(L, { children: [
4312
- /* @__PURE__ */ o(T, { className: "py-12", children: [
4339
+ return /* @__PURE__ */ o(T, { children: [
4340
+ /* @__PURE__ */ o(M, { className: "py-12", children: [
4313
4341
  /* @__PURE__ */ n("div", { className: "flex justify-center mb-6", children: /* @__PURE__ */ n(
4314
4342
  "div",
4315
4343
  {
@@ -4319,13 +4347,13 @@ Failed to reload test data. Please refresh the page.`);
4319
4347
  ) }),
4320
4348
  /* @__PURE__ */ n("h2", { className: "text-3xl font-bold text-center text-gray-900 dark:text-white mb-4", children: l.title }),
4321
4349
  /* @__PURE__ */ n("div", { className: "flex justify-center mb-6", children: /* @__PURE__ */ n(
4322
- ue,
4350
+ me,
4323
4351
  {
4324
4352
  variant: l.type === "success" ? "success" : l.type === "error" ? "danger" : l.type === "pending" ? "warning" : "info",
4325
- children: t != null ? pe[t] : ge[e]
4353
+ children: t != null ? he[t] : pe[e]
4326
4354
  }
4327
4355
  ) }),
4328
- /* @__PURE__ */ n("p", { className: "text-center text-gray-600 dark:text-gray-400 mb-6 max-w-md mx-auto", children: a || l.message }),
4356
+ /* @__PURE__ */ n("p", { className: "text-center text-gray-600 dark:text-gray-400 mb-6 max-w-md mx-auto", children: s || l.message }),
4329
4357
  l.type === "success" && /* @__PURE__ */ o("div", { className: "bg-green-50 dark:bg-green-900/20 border border-green-200 dark:border-green-800 rounded-lg p-4 mb-6", children: [
4330
4358
  /* @__PURE__ */ n("h3", { className: "font-semibold text-green-900 dark:text-green-100 mb-2", children: "What's Next?" }),
4331
4359
  /* @__PURE__ */ o("ul", { className: "text-sm text-green-800 dark:text-green-200 space-y-1", children: [
@@ -4354,24 +4382,24 @@ Failed to reload test data. Please refresh the page.`);
4354
4382
  /* @__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: [
4355
4383
  /* @__PURE__ */ o("div", { children: [
4356
4384
  /* @__PURE__ */ n("span", { className: "text-gray-500 dark:text-gray-400", children: "KYC Status:" }),
4357
- /* @__PURE__ */ n("div", { className: "font-medium text-gray-900 dark:text-white mt-1", children: t != null ? pe[t] : "Not Available" })
4385
+ /* @__PURE__ */ n("div", { className: "font-medium text-gray-900 dark:text-white mt-1", children: t != null ? he[t] : "Not Available" })
4358
4386
  ] }),
4359
4387
  /* @__PURE__ */ o("div", { children: [
4360
4388
  /* @__PURE__ */ n("span", { className: "text-gray-500 dark:text-gray-400", children: "Review Status:" }),
4361
- /* @__PURE__ */ n("div", { className: "font-medium text-gray-900 dark:text-white mt-1", children: ge[e] })
4389
+ /* @__PURE__ */ n("div", { className: "font-medium text-gray-900 dark:text-white mt-1", children: pe[e] })
4362
4390
  ] })
4363
4391
  ] }) })
4364
4392
  ] }),
4365
4393
  /* @__PURE__ */ o(te, { className: "flex justify-center gap-4", children: [
4366
- l.type === "success" && s && /* @__PURE__ */ n(_, { onClick: s, size: "lg", children: "Continue" }),
4367
- l.type === "error" && /* @__PURE__ */ o(tt, { children: [
4368
- i && /* @__PURE__ */ n(_, { variant: "outline", onClick: i, children: "Contact Support" }),
4369
- s && /* @__PURE__ */ n(_, { onClick: s, children: "Try Again" })
4394
+ l.type === "success" && a && /* @__PURE__ */ n(j, { onClick: a, size: "lg", children: "Continue" }),
4395
+ l.type === "error" && /* @__PURE__ */ o(nt, { children: [
4396
+ i && /* @__PURE__ */ n(j, { variant: "outline", onClick: i, children: "Contact Support" }),
4397
+ a && /* @__PURE__ */ n(j, { onClick: a, children: "Try Again" })
4370
4398
  ] }),
4371
4399
  l.type === "pending" && /* @__PURE__ */ n("div", { className: "text-center", children: /* @__PURE__ */ n("p", { className: "text-sm text-gray-500 dark:text-gray-400", children: "Please check back later or wait for our email notification" }) })
4372
4400
  ] })
4373
4401
  ] });
4374
- }, Cr = ({ config: t, className: e = "" }) => !(t != null && t.visible) || !(t != null && t.url) ? null : /* @__PURE__ */ n("div", { className: `metakyc-logo ${e}`, children: /* @__PURE__ */ n(
4402
+ }, Er = ({ config: t, className: e = "" }) => !(t != null && t.visible) || !(t != null && t.url) ? null : /* @__PURE__ */ n("div", { className: `metakyc-logo ${e}`, children: /* @__PURE__ */ n(
4375
4403
  "img",
4376
4404
  {
4377
4405
  src: t.url,
@@ -4386,33 +4414,33 @@ Failed to reload test data. Please refresh the page.`);
4386
4414
  console.warn("[Logo] Failed to load logo:", t.url), r.target.style.display = "none";
4387
4415
  }
4388
4416
  }
4389
- ) }), Qe = ({
4417
+ ) }), Ze = ({
4390
4418
  title: t,
4391
4419
  subtitle: e,
4392
4420
  className: r = ""
4393
4421
  }) => {
4394
- const { themeManager: a } = re(), s = a.getCurrentTheme(), i = t || s.title || "KYC Verification";
4422
+ const { currentTheme: s } = re(), a = t || (s == null ? void 0 : s.title) || "KYC Verification";
4395
4423
  return /* @__PURE__ */ o("div", { className: `metakyc-header ${r}`, children: [
4396
- s.logo && s.logo.visible && /* @__PURE__ */ n("div", { className: "mb-3", children: /* @__PURE__ */ n(Cr, { config: s.logo }) }),
4424
+ (s == null ? void 0 : s.logo) && s.logo.visible && /* @__PURE__ */ n("div", { className: "mb-3", children: /* @__PURE__ */ n(Er, { config: s.logo }) }),
4397
4425
  /* @__PURE__ */ o("div", { children: [
4398
- /* @__PURE__ */ n("h1", { className: "text-2xl font-bold text-gray-900 dark:text-white", children: i }),
4426
+ /* @__PURE__ */ n("h1", { className: "text-2xl font-bold text-gray-900 dark:text-white", children: a }),
4399
4427
  e && /* @__PURE__ */ n("p", { className: "text-sm text-gray-600 dark:text-gray-400 mt-1", children: e })
4400
4428
  ] })
4401
4429
  ] });
4402
- }, Hr = ({
4430
+ }, Yr = ({
4403
4431
  workflowKey: t,
4404
4432
  externalRefId: e,
4405
4433
  onSuccess: r,
4406
- onCancel: a
4434
+ onCancel: s
4407
4435
  }) => {
4408
- var A, B, z;
4409
- const { config: s, baseInformationService: i } = re(), { createApplicant: c, isLoading: l } = er(), [d, u] = v([]), [g, p] = v(!0), [m, b] = v(!1), [y, x] = v(null), R = t || ((A = s.applicantForm) == null ? void 0 : A.workflowKey);
4410
- if (!R)
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)
4411
4439
  throw new Error(
4412
4440
  "workflowKey is required. Provide it either as a prop to CreateApplicantForm or set it in config.applicantForm.workflowKey"
4413
4441
  );
4414
- const h = e || ((B = s.applicantForm) == null ? void 0 : B.externalRefId) || "", N = ((z = s.applicantForm) == null ? void 0 : z.visibleFields) || ht, [w, E] = v({
4415
- workflowKey: R,
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,
4416
4444
  firstName: "",
4417
4445
  lastName: "",
4418
4446
  title: "",
@@ -4442,28 +4470,28 @@ Failed to reload test data. Please refresh the page.`);
4442
4470
  (async () => {
4443
4471
  try {
4444
4472
  p(!0);
4445
- const D = await i.getCountries("", s.locale || "en"), C = /* @__PURE__ */ new Set(), k = D.map((S) => ({
4473
+ const E = await i.getCountries("", a.locale || "en"), A = /* @__PURE__ */ new Set(), k = E.map((S) => ({
4446
4474
  value: S.abbreviation3 || S.abbreviation,
4447
4475
  label: S.name
4448
- })).filter((S) => !S.value || C.has(S.value) ? !1 : (C.add(S.value), !0));
4476
+ })).filter((S) => !S.value || A.has(S.value) ? !1 : (A.add(S.value), !0));
4449
4477
  u(k);
4450
- } catch (D) {
4451
- console.error("Failed to load countries:", D);
4478
+ } catch (E) {
4479
+ console.error("Failed to load countries:", E);
4452
4480
  } finally {
4453
4481
  p(!1);
4454
4482
  }
4455
4483
  })();
4456
- }, [i, s.locale]);
4457
- const F = (f, D) => {
4458
- E((C) => ({ ...C, [f]: D }));
4459
- }, M = async (f) => {
4460
- f.preventDefault(), b(!0), x(null);
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);
4461
4489
  try {
4462
4490
  if (!w.externalRefId || w.externalRefId.trim() === "") {
4463
- x("External Reference ID is required and cannot be empty"), b(!1);
4491
+ f("External Reference ID is required and cannot be empty"), b(!1);
4464
4492
  return;
4465
4493
  }
4466
- const D = {
4494
+ const E = {
4467
4495
  workflowKey: w.workflowKey,
4468
4496
  externalRefId: w.externalRefId.trim()
4469
4497
  // Always include, never empty
@@ -4471,145 +4499,145 @@ Failed to reload test data. Please refresh the page.`);
4471
4499
  N.forEach((k) => {
4472
4500
  if (k === "externalRefId") return;
4473
4501
  const S = w[k];
4474
- S != null && S !== "" && !(Array.isArray(S) && S.length === 0) && (D[k] = S);
4475
- }), console.log("Creating applicant with data:", D);
4476
- const C = await c(
4477
- D
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
4478
4506
  );
4479
- console.log("Applicant created:", C), r(C.applicantId);
4480
- } catch (D) {
4481
- console.error("Error creating applicant:", D), x(D.message || "Failed to create applicant");
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");
4482
4510
  } finally {
4483
4511
  b(!1);
4484
4512
  }
4485
- }, I = (f) => {
4486
- var C, k;
4487
- const D = pt[f];
4488
- switch (D.type) {
4513
+ }, R = (v) => {
4514
+ var A, k;
4515
+ const E = yt[v];
4516
+ switch (E.type) {
4489
4517
  case "select":
4490
- return f === "country" || f === "nationality" || f === "taxCountry" || f === "countryOfBirth" ? /* @__PURE__ */ n(
4491
- ye,
4518
+ return v === "country" || v === "nationality" || v === "taxCountry" || v === "countryOfBirth" ? /* @__PURE__ */ n(
4519
+ ge,
4492
4520
  {
4493
- label: D.label,
4494
- value: w[f] || "",
4495
- onChange: (S) => F(f, S.target.value),
4521
+ label: E.label,
4522
+ value: w[v] || "",
4523
+ onChange: (S) => F(v, S.target.value),
4496
4524
  options: [
4497
- { value: "", label: `Select ${D.label.toLowerCase()}...` },
4525
+ { value: "", label: `Select ${E.label.toLowerCase()}...` },
4498
4526
  ...d
4499
4527
  ],
4500
4528
  disabled: g
4501
4529
  },
4502
- f
4503
- ) : f === "salutation" ? /* @__PURE__ */ n(
4504
- ye,
4530
+ v
4531
+ ) : v === "salutation" ? /* @__PURE__ */ n(
4532
+ ge,
4505
4533
  {
4506
- label: D.label,
4507
- value: ((C = w[f]) == null ? void 0 : C.toString()) || "",
4508
- onChange: (S) => F(f, S.target.value ? Number(S.target.value) : null),
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),
4509
4537
  options: [
4510
4538
  { value: "", label: "Select salutation..." },
4511
- { value: Ne.Male.toString(), label: "Male" },
4512
- { value: Ne.Female.toString(), label: "Female" },
4513
- { value: Ne.Other.toString(), label: "Other" }
4539
+ { value: ke.Male.toString(), label: "Male" },
4540
+ { value: ke.Female.toString(), label: "Female" },
4541
+ { value: ke.Other.toString(), label: "Other" }
4514
4542
  ]
4515
4543
  },
4516
- f
4544
+ v
4517
4545
  ) : null;
4518
4546
  case "multiselect":
4519
- return f === "otherNationality" ? /* @__PURE__ */ n(
4520
- G,
4547
+ return v === "otherNationality" ? /* @__PURE__ */ n(
4548
+ Z,
4521
4549
  {
4522
4550
  type: "text",
4523
- label: D.label,
4524
- value: ((k = w[f]) == null ? void 0 : k.join(", ")) || "",
4551
+ label: E.label,
4552
+ value: ((k = w[v]) == null ? void 0 : k.join(", ")) || "",
4525
4553
  onChange: (S) => {
4526
- const j = S.target.value.split(",").map((oe) => oe.trim()).filter(Boolean);
4527
- F(f, j);
4554
+ const _ = S.target.value.split(",").map((oe) => oe.trim()).filter(Boolean);
4555
+ F(v, _);
4528
4556
  },
4529
4557
  placeholder: "Enter countries separated by commas"
4530
4558
  },
4531
- f
4559
+ v
4532
4560
  ) : null;
4533
4561
  case "date":
4534
4562
  return /* @__PURE__ */ n(
4535
- G,
4563
+ Z,
4536
4564
  {
4537
4565
  type: "date",
4538
- label: D.label,
4539
- value: w[f] || "",
4540
- onChange: (S) => F(f, S.target.value)
4566
+ label: E.label,
4567
+ value: w[v] || "",
4568
+ onChange: (S) => F(v, S.target.value)
4541
4569
  },
4542
- f
4570
+ v
4543
4571
  );
4544
4572
  case "email":
4545
4573
  return /* @__PURE__ */ n(
4546
- G,
4574
+ Z,
4547
4575
  {
4548
4576
  type: "email",
4549
- label: D.label,
4550
- value: w[f] || "",
4551
- onChange: (S) => F(f, S.target.value),
4552
- required: f === "email"
4577
+ label: E.label,
4578
+ value: w[v] || "",
4579
+ onChange: (S) => F(v, S.target.value),
4580
+ required: v === "email"
4553
4581
  },
4554
- f
4582
+ v
4555
4583
  );
4556
4584
  case "tel":
4557
4585
  return /* @__PURE__ */ n(
4558
- G,
4586
+ Z,
4559
4587
  {
4560
4588
  type: "tel",
4561
- label: D.label,
4562
- value: w[f] || "",
4563
- onChange: (S) => F(f, S.target.value),
4564
- required: f === "phonenumber"
4589
+ label: E.label,
4590
+ value: w[v] || "",
4591
+ onChange: (S) => F(v, S.target.value),
4592
+ required: v === "phonenumber"
4565
4593
  },
4566
- f
4594
+ v
4567
4595
  );
4568
4596
  case "text":
4569
4597
  default:
4570
4598
  return /* @__PURE__ */ n(
4571
- G,
4599
+ Z,
4572
4600
  {
4573
4601
  type: "text",
4574
- label: D.label,
4575
- value: w[f] || "",
4576
- onChange: (S) => F(f, S.target.value),
4577
- required: f === "firstName" || f === "lastName" || f === "externalRefId"
4602
+ label: E.label,
4603
+ value: w[v] || "",
4604
+ onChange: (S) => F(v, S.target.value),
4605
+ required: v === "firstName" || v === "lastName" || v === "externalRefId"
4578
4606
  },
4579
- f
4607
+ v
4580
4608
  );
4581
4609
  }
4582
4610
  };
4583
- return g ? /* @__PURE__ */ n("div", { className: "metakyc-sdk", children: /* @__PURE__ */ n(L, { children: /* @__PURE__ */ o(T, { children: [
4611
+ return g ? /* @__PURE__ */ n("div", { className: "metakyc-sdk", children: /* @__PURE__ */ n(T, { children: /* @__PURE__ */ o(M, { children: [
4584
4612
  /* @__PURE__ */ n(ie, { className: "my-8" }),
4585
4613
  /* @__PURE__ */ n("p", { className: "text-center text-gray-600 dark:text-gray-400 mt-4", children: "Loading form..." })
4586
- ] }) }) }) : /* @__PURE__ */ n("div", { className: "metakyc-sdk", children: /* @__PURE__ */ n("form", { onSubmit: M, children: /* @__PURE__ */ o(L, { children: [
4587
- /* @__PURE__ */ n(Z, { children: /* @__PURE__ */ n(
4588
- Qe,
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(
4616
+ Ze,
4589
4617
  {
4590
4618
  title: "Create Applicant",
4591
4619
  subtitle: "Please fill in the required information to begin the KYC verification process."
4592
4620
  }
4593
4621
  ) }),
4594
- /* @__PURE__ */ o(T, { children: [
4622
+ /* @__PURE__ */ o(M, { children: [
4595
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: [
4596
4624
  /* @__PURE__ */ n("strong", { children: "Error:" }),
4597
4625
  " ",
4598
4626
  y
4599
4627
  ] }) }),
4600
- /* @__PURE__ */ n("div", { className: "grid grid-cols-1 md:grid-cols-2 gap-4", children: N.map((f) => I(f)) })
4628
+ /* @__PURE__ */ n("div", { className: "grid grid-cols-1 md:grid-cols-2 gap-4", children: N.map((v) => R(v)) })
4601
4629
  ] }),
4602
4630
  /* @__PURE__ */ o(te, { className: "flex justify-between", children: [
4603
- a && /* @__PURE__ */ n(_, { type: "button", variant: "outline", onClick: a, disabled: m || l, children: "Cancel" }),
4604
- /* @__PURE__ */ n(_, { type: "submit", isLoading: m || l, children: "Create Applicant" })
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" })
4605
4633
  ] })
4606
4634
  ] }) }) });
4607
- }, Vr = ({
4635
+ }, Wr = ({
4608
4636
  applicantId: t,
4609
4637
  onComplete: e,
4610
4638
  onError: r,
4611
- theme: a = "light",
4612
- className: s
4639
+ theme: s = "light",
4640
+ className: a
4613
4641
  }) => {
4614
4642
  const {
4615
4643
  progress: i,
@@ -4622,27 +4650,27 @@ Failed to reload test data. Please refresh the page.`);
4622
4650
  error: m,
4623
4651
  moveBack: b,
4624
4652
  refreshProgress: y
4625
- } = Wt(t), [x, R] = ce.useState(!1);
4626
- if (ce.useEffect(() => {
4653
+ } = Gt(t), [f, P] = le.useState(!1);
4654
+ if (le.useEffect(() => {
4627
4655
  m && r && r(m);
4628
- }, [m, r]), ce.useEffect(() => {
4656
+ }, [m, r]), le.useEffect(() => {
4629
4657
  i != null && i.workflowResult && e && e(i.workflowResult);
4630
- }, [i == null ? void 0 : i.workflowResult, e]), ce.useEffect(() => {
4631
- a === "dark" ? document.documentElement.classList.add("dark") : document.documentElement.classList.remove("dark");
4632
- }, [a]), ce.useEffect(() => {
4633
- g && R(!1);
4658
+ }, [i == null ? void 0 : i.workflowResult, e]), le.useEffect(() => {
4659
+ s === "dark" ? document.documentElement.classList.add("dark") : document.documentElement.classList.remove("dark");
4660
+ }, [s]), le.useEffect(() => {
4661
+ g && P(!1);
4634
4662
  }, [g]), p || !i)
4635
- return /* @__PURE__ */ n("div", { className: s, children: /* @__PURE__ */ n(L, { children: /* @__PURE__ */ o(T, { children: [
4663
+ return /* @__PURE__ */ n("div", { className: a, children: /* @__PURE__ */ n(T, { children: /* @__PURE__ */ o(M, { children: [
4636
4664
  /* @__PURE__ */ n(ie, { className: "my-8" }),
4637
4665
  /* @__PURE__ */ n("p", { className: "text-center text-gray-600 dark:text-gray-400 mt-4", children: "Loading workflow..." })
4638
4666
  ] }) }) });
4639
4667
  if (m)
4640
- return /* @__PURE__ */ n("div", { className: s, children: /* @__PURE__ */ n(L, { children: /* @__PURE__ */ n(T, { children: /* @__PURE__ */ o("div", { className: "text-center py-8", children: [
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: [
4641
4669
  /* @__PURE__ */ n("p", { className: "text-danger-500 text-lg mb-4", children: "An error occurred" }),
4642
4670
  /* @__PURE__ */ n("p", { className: "text-gray-600 dark:text-gray-400", children: m.message })
4643
4671
  ] }) }) }) });
4644
- if (g && !x)
4645
- return /* @__PURE__ */ n("div", { className: `metakyc-sdk ${s || ""}`, children: /* @__PURE__ */ n(L, { children: /* @__PURE__ */ n(T, { children: /* @__PURE__ */ o("div", { className: "text-center py-8", children: [
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: [
4646
4674
  /* @__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" }) }) }) }),
4647
4675
  /* @__PURE__ */ n("h3", { className: "text-xl font-semibold text-gray-900 dark:text-white mb-2", children: "Workflow Transition" }),
4648
4676
  /* @__PURE__ */ n("p", { className: "text-gray-600 dark:text-gray-400 mb-6", children: "Your application workflow has been updated based on your progress." }),
@@ -4663,15 +4691,15 @@ Failed to reload test data. Please refresh the page.`);
4663
4691
  /* @__PURE__ */ n(
4664
4692
  "button",
4665
4693
  {
4666
- onClick: () => R(!0),
4694
+ onClick: () => P(!0),
4667
4695
  className: "px-6 py-3 bg-blue-600 hover:bg-blue-700 text-white font-medium rounded-lg transition-colors",
4668
4696
  children: "Continue with New Workflow"
4669
4697
  }
4670
4698
  )
4671
4699
  ] }) }) }) });
4672
- if (i.status === se.Finished || i.status === se.OnHold)
4673
- return /* @__PURE__ */ n("div", { className: `metakyc-sdk ${s || ""}`, children: /* @__PURE__ */ n(
4674
- Be,
4700
+ if (i.status === ae.Finished || i.status === ae.OnHold)
4701
+ return /* @__PURE__ */ n("div", { className: `metakyc-sdk ${a || ""}`, children: /* @__PURE__ */ n(
4702
+ ze,
4675
4703
  {
4676
4704
  kycStatus: i.kycStatus,
4677
4705
  reviewStatus: i.reviewStatus,
@@ -4684,25 +4712,25 @@ Failed to reload test data. Please refresh the page.`);
4684
4712
  }
4685
4713
  ) });
4686
4714
  if (!c)
4687
- return /* @__PURE__ */ n("div", { className: `metakyc-sdk ${s || ""}`, children: /* @__PURE__ */ n(L, { children: /* @__PURE__ */ o(T, { children: [
4715
+ return /* @__PURE__ */ n("div", { className: `metakyc-sdk ${a || ""}`, children: /* @__PURE__ */ n(T, { children: /* @__PURE__ */ o(M, { children: [
4688
4716
  /* @__PURE__ */ n(ie, { className: "my-8" }),
4689
- /* @__PURE__ */ n("p", { className: "text-center text-gray-600 dark:text-gray-400 mt-4", children: i.status === se.IdentityPending ? "Loading identity verification..." : "Loading current step..." })
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..." })
4690
4718
  ] }) }) });
4691
4719
  const h = () => {
4692
- const w = l.filter((I) => I.visibility !== !1), E = w.findIndex((I) => I.order === c.order), F = E >= 0 ? E + 1 : 1, M = w.length;
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;
4693
4721
  return /* @__PURE__ */ o("div", { className: "mb-6", children: [
4694
4722
  /* @__PURE__ */ o("div", { className: "flex items-start justify-between mb-4", children: [
4695
- /* @__PURE__ */ n(Qe, {}),
4696
- /* @__PURE__ */ o(ue, { variant: i.status === 1 ? "info" : "success", children: [
4723
+ /* @__PURE__ */ n(Ze, {}),
4724
+ /* @__PURE__ */ o(me, { variant: i.status === 1 ? "info" : "success", children: [
4697
4725
  "Step ",
4698
4726
  F,
4699
4727
  " of ",
4700
- M
4728
+ L
4701
4729
  ] })
4702
4730
  ] }),
4703
- /* @__PURE__ */ n("div", { className: "flex items-center", children: w.map((I, A) => {
4704
- const B = A < E, z = I.order === c.order;
4705
- return /* @__PURE__ */ o(ce.Fragment, { children: [
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: [
4706
4734
  /* @__PURE__ */ o("div", { className: "flex items-center", children: [
4707
4735
  /* @__PURE__ */ n(
4708
4736
  "div",
@@ -4711,24 +4739,24 @@ Failed to reload test data. Please refresh the page.`);
4711
4739
  w-8 h-8 rounded-full flex items-center justify-center text-sm font-medium
4712
4740
  ${B || z ? "bg-primary-500 text-white" : "bg-gray-200 text-gray-600 dark:bg-gray-700 dark:text-gray-400"}
4713
4741
  `,
4714
- children: A + 1
4742
+ children: C + 1
4715
4743
  }
4716
4744
  ),
4717
4745
  /* @__PURE__ */ n(
4718
4746
  "span",
4719
4747
  {
4720
4748
  className: `ml-2 text-sm ${z ? "font-semibold text-gray-900 dark:text-white" : "text-gray-600 dark:text-gray-400"}`,
4721
- children: I.displayName
4749
+ children: R.displayName
4722
4750
  }
4723
4751
  )
4724
4752
  ] }),
4725
- A < w.length - 1 && /* @__PURE__ */ n(
4753
+ C < w.length - 1 && /* @__PURE__ */ n(
4726
4754
  "div",
4727
4755
  {
4728
4756
  className: `flex-1 h-0.5 mx-4 ${B ? "bg-primary-500" : "bg-gray-200 dark:bg-gray-700"}`
4729
4757
  }
4730
4758
  )
4731
- ] }, I.order);
4759
+ ] }, R.order);
4732
4760
  }) })
4733
4761
  ] });
4734
4762
  }, N = () => {
@@ -4741,23 +4769,23 @@ Failed to reload test data. Please refresh the page.`);
4741
4769
  };
4742
4770
  switch (c.action) {
4743
4771
  case U.Questionaries:
4744
- return /* @__PURE__ */ n(br, { ...w });
4772
+ return /* @__PURE__ */ n(vr, { ...w });
4745
4773
  case U.UploadDocument:
4746
- return /* @__PURE__ */ n(xr, { ...w });
4774
+ return /* @__PURE__ */ n(wr, { ...w });
4747
4775
  case U.Overview:
4748
- return /* @__PURE__ */ n(vr, { ...w });
4776
+ return /* @__PURE__ */ n(kr, { ...w });
4749
4777
  case U.IdentitySdk:
4750
- return /* @__PURE__ */ n(Sr, { ...w });
4778
+ return /* @__PURE__ */ n(Ar, { ...w });
4751
4779
  case U.RiskScoring:
4752
- return /* @__PURE__ */ n(wr, { ...w });
4780
+ return /* @__PURE__ */ n(Nr, { ...w });
4753
4781
  case U.AdditionalData:
4754
4782
  case U.InvestorCategorization:
4755
- return /* @__PURE__ */ n(kr, { ...w });
4783
+ return /* @__PURE__ */ n(Sr, { ...w });
4756
4784
  case U.AppropriatenessTest:
4757
- return /* @__PURE__ */ n(Nr, { ...w });
4785
+ return /* @__PURE__ */ n(Cr, { ...w });
4758
4786
  case U.ManualReview:
4759
4787
  return /* @__PURE__ */ n(
4760
- Be,
4788
+ ze,
4761
4789
  {
4762
4790
  kycStatus: i.kycStatus,
4763
4791
  reviewStatus: i.reviewStatus,
@@ -4766,7 +4794,7 @@ Failed to reload test data. Please refresh the page.`);
4766
4794
  }
4767
4795
  );
4768
4796
  default:
4769
- return /* @__PURE__ */ n(L, { children: /* @__PURE__ */ o(T, { className: "py-12 text-center", children: [
4797
+ return /* @__PURE__ */ n(T, { children: /* @__PURE__ */ o(M, { className: "py-12 text-center", children: [
4770
4798
  /* @__PURE__ */ n("div", { className: "mb-4", children: /* @__PURE__ */ n(ie, {}) }),
4771
4799
  /* @__PURE__ */ o("p", { className: "text-gray-600 dark:text-gray-400 mb-2", children: [
4772
4800
  "Processing step: ",
@@ -4779,122 +4807,122 @@ Failed to reload test data. Please refresh the page.`);
4779
4807
  ] }) });
4780
4808
  }
4781
4809
  };
4782
- return /* @__PURE__ */ o("div", { className: `metakyc-sdk ${s || ""}`, children: [
4810
+ return /* @__PURE__ */ o("div", { className: `metakyc-sdk ${a || ""}`, children: [
4783
4811
  h(),
4784
4812
  N()
4785
4813
  ] });
4786
4814
  };
4787
4815
  export {
4788
- Fr as ALL_APPLICANT_FIELDS,
4789
- rt as ApplicantProgressOnHoldReason,
4790
- se as ApplicantProgressStatus,
4791
- bt as ApplicantService,
4792
- at as ApplicantStatus,
4793
- ct as AppropriatenessQuestionType,
4794
- wt as AppropriatenessTestService,
4795
- Nr as AppropriatenessTestStep,
4796
- ue as Badge,
4797
- Ct as BaseInformationService,
4798
- _ as Button,
4799
- L as Card,
4800
- T as CardContent,
4816
+ Tr as ALL_APPLICANT_FIELDS,
4817
+ st as ApplicantProgressOnHoldReason,
4818
+ ae as ApplicantProgressStatus,
4819
+ vt as ApplicantService,
4820
+ it as ApplicantStatus,
4821
+ ut as AppropriatenessQuestionType,
4822
+ Nt as AppropriatenessTestService,
4823
+ Cr as AppropriatenessTestStep,
4824
+ me as Badge,
4825
+ Et as BaseInformationService,
4826
+ j as Button,
4827
+ T as Card,
4828
+ M as CardContent,
4801
4829
  te as CardFooter,
4802
- Z as CardHeader,
4803
- Hr as CreateApplicantForm,
4804
- ut as CriteriaBuiltInType,
4805
- ht as DEFAULT_VISIBLE_FIELDS,
4806
- lt as DocumentReviewStatus,
4807
- yt as EndpointBuilder,
4808
- xe as ErrorHandler,
4809
- Tt as EventEmitter,
4810
- pt as FIELD_METADATA,
4811
- ot as FileType,
4812
- tr as FileUpload,
4813
- Ne as GenderType,
4814
- Qe as Header,
4815
- ft as HttpClient,
4816
- fe as IdentityProviderManager,
4817
- St as IdentityService,
4818
- ae as IdentityVerificationProvider,
4819
- Sr as IdentityVerificationStep,
4820
- G as Input,
4821
- At as InvestorCategorizationService,
4822
- kr as InvestorCategorizationStep,
4823
- X as InvestorCategorizationType,
4824
- mt as InvestorCategoryType,
4825
- st as KycProcessStatus,
4826
- pe as KycStatus,
4827
- Be as KycStatusDisplay,
4828
- Vr as KycWorkflow,
4829
- Cr as Logo,
4830
- je as MetaKYCContext,
4831
- le as MetaKYCError,
4832
- Mr as MetaKYCProvider,
4833
- $t as OnfidoProvider,
4834
- kt as OverviewService,
4835
- vr as OverviewStep,
4836
- rr as PhoneInput,
4837
- xt as QuestionnaireService,
4838
- br as QuestionnaireStep,
4839
- ge as ReviewStatus,
4840
- dt as RiskCriteriaType,
4841
- nt as RiskLevel,
4842
- Nt as RiskScoringService,
4843
- wr as RiskScoringStep,
4844
- _t as SardinAIProvider,
4845
- ye as Select,
4830
+ J as CardHeader,
4831
+ Yr as CreateApplicantForm,
4832
+ ht as CriteriaBuiltInType,
4833
+ gt as DEFAULT_VISIBLE_FIELDS,
4834
+ dt as DocumentReviewStatus,
4835
+ bt as EndpointBuilder,
4836
+ be as ErrorHandler,
4837
+ Bt as EventEmitter,
4838
+ yt as FIELD_METADATA,
4839
+ ct as FileType,
4840
+ nr as FileUpload,
4841
+ ke as GenderType,
4842
+ Ze as Header,
4843
+ xt as HttpClient,
4844
+ ye as IdentityProviderManager,
4845
+ At as IdentityService,
4846
+ se as IdentityVerificationProvider,
4847
+ Ar as IdentityVerificationStep,
4848
+ Z as Input,
4849
+ It as InvestorCategorizationService,
4850
+ Sr as InvestorCategorizationStep,
4851
+ ee as InvestorCategorizationType,
4852
+ pt as InvestorCategoryType,
4853
+ ot as KycProcessStatus,
4854
+ he as KycStatus,
4855
+ ze as KycStatusDisplay,
4856
+ Wr as KycWorkflow,
4857
+ Er as Logo,
4858
+ Ue as MetaKYCContext,
4859
+ ce as MetaKYCError,
4860
+ Or as MetaKYCProvider,
4861
+ _t as OnfidoProvider,
4862
+ St as OverviewService,
4863
+ kr as OverviewStep,
4864
+ sr as PhoneInput,
4865
+ wt as QuestionnaireService,
4866
+ vr as QuestionnaireStep,
4867
+ pe as ReviewStatus,
4868
+ mt as RiskCriteriaType,
4869
+ at as RiskLevel,
4870
+ Ct as RiskScoringService,
4871
+ Nr as RiskScoringStep,
4872
+ Kt as SardinAIProvider,
4873
+ ge as Select,
4846
4874
  ie as Spinner,
4847
- Bt as StepRouter,
4848
- zt as SumsubProvider,
4849
- jt as ThemeManager,
4875
+ zt as StepRouter,
4876
+ jt as SumsubProvider,
4877
+ Ut as ThemeManager,
4850
4878
  Y as ThemePreset,
4851
- Lt as ThemeService,
4852
- vt as UploadDocumentService,
4853
- xr as UploadDocumentStep,
4854
- it as UserType,
4855
- Ee as ValueDataType,
4856
- Ot as WorkflowOrchestrator,
4857
- ke as WorkflowResultType,
4858
- Mt as WorkflowState,
4879
+ Mt as ThemeService,
4880
+ kt as UploadDocumentService,
4881
+ wr as UploadDocumentStep,
4882
+ lt as UserType,
4883
+ Ie as ValueDataType,
4884
+ $t as WorkflowOrchestrator,
4885
+ we as WorkflowResultType,
4886
+ Ot as WorkflowState,
4859
4887
  U as WorkflowStepAction,
4860
- qr as appropriatenessTestSchema,
4861
- _r as clearAllStorage,
4862
- Ht as clearApplicantId,
4863
- Yt as clearWorkflowState,
4864
- J as cn,
4865
- Et as corporateTheme,
4866
- gt as defaultConfig,
4867
- ee as defaultTheme,
4868
- Kt as fileToBase64,
4869
- It as fintechTheme,
4870
- Ce as formatFileSize,
4871
- Ur as generateAppropriatenessSchema,
4872
- pr as generateQuestionnaireSchema,
4873
- yr as generateRiskScoringSchema,
4874
- Kr as generateUploadDocumentSchema,
4875
- zr as getAcceptString,
4876
- qt as getApplicantId,
4877
- ve as getThemePreset,
4878
- $r as getWorkflowState,
4879
- Rt as healthcareTheme,
4880
- Lr as isScriptLoaded,
4881
- _e as loadScript,
4882
- Pt as minimalTheme,
4883
- Dt as modernTheme,
4884
- Tr as removeScript,
4885
- Ut as saveApplicantId,
4886
- Vt as saveWorkflowState,
4887
- Ft as themePresets,
4888
- er as useApplicant,
4889
- jr as useAppropriatenessTest,
4890
- Jt as useIdentityVerification,
4891
- Wt as useKycWorkflow,
4888
+ Vr as appropriatenessTestSchema,
4889
+ Kr as clearAllStorage,
4890
+ Yt as clearApplicantId,
4891
+ Qt as clearWorkflowState,
4892
+ X as cn,
4893
+ Rt as corporateTheme,
4894
+ ft as defaultConfig,
4895
+ Q as defaultTheme,
4896
+ qt as fileToBase64,
4897
+ Dt as fintechTheme,
4898
+ Ae as formatFileSize,
4899
+ Hr as generateAppropriatenessSchema,
4900
+ yr as generateQuestionnaireSchema,
4901
+ br as generateRiskScoringSchema,
4902
+ qr as generateUploadDocumentSchema,
4903
+ jr as getAcceptString,
4904
+ Vt as getApplicantId,
4905
+ xe as getThemePreset,
4906
+ _r as getWorkflowState,
4907
+ Pt as healthcareTheme,
4908
+ Mr as isScriptLoaded,
4909
+ Ke as loadScript,
4910
+ Lt as minimalTheme,
4911
+ Ft as modernTheme,
4912
+ Br as removeScript,
4913
+ Ht as saveApplicantId,
4914
+ Wt as saveWorkflowState,
4915
+ Tt as themePresets,
4916
+ rr as useApplicant,
4917
+ Ur as useAppropriatenessTest,
4918
+ er as useIdentityVerification,
4919
+ Gt as useKycWorkflow,
4892
4920
  re as useMetaKYC,
4893
- Zt as useOverview,
4894
- Qt as useQuestionnaire,
4895
- Xt as useRiskScoring,
4896
- Gt as useUploadDocument,
4897
- Br as validateFileSize,
4898
- Or as validateFileType
4921
+ Xt as useOverview,
4922
+ Zt as useQuestionnaire,
4923
+ tr as useRiskScoring,
4924
+ Jt as useUploadDocument,
4925
+ zr as validateFileSize,
4926
+ $r as validateFileType
4899
4927
  };
4900
4928
  //# sourceMappingURL=index.js.map