@vpdev2/metakyc-sdk 1.0.62 → 1.0.64

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
@@ -3,12 +3,12 @@ var kt = (e, t, n) => t in e ? vt(e, t, { enumerable: !0, configurable: !0, writ
3
3
  var re = (e, t, n) => kt(e, typeof t != "symbol" ? t + "" : t, n);
4
4
  import wt from "axios";
5
5
  import * as nt from "react";
6
- import ge, { createContext as Nt, useState as b, useMemo as Ee, useEffect as ne, useContext as St, useRef as ee, useCallback as Q, forwardRef as Ue, createElement as Qe } from "react";
6
+ import ge, { createContext as Nt, useState as v, useMemo as Ee, useEffect as ne, useContext as St, useRef as ee, useCallback as Q, forwardRef as Ue, createElement as Qe } from "react";
7
7
  import { jsx as r, jsxs as s, Fragment as dt } from "react/jsx-runtime";
8
8
  import { createPortal as Ve } from "react-dom";
9
9
  import { useForm as Ct, Controller as Pe } from "react-hook-form";
10
10
  import { z as Se } from "zod";
11
- var G = /* @__PURE__ */ ((e) => (e[e.IdentitySdk = 0] = "IdentitySdk", e[e.RiskScoring = 1] = "RiskScoring", e[e.Questionaries = 2] = "Questionaries", e[e.AdditionalData = 3] = "AdditionalData", e[e.AppropriatenessTest = 4] = "AppropriatenessTest", e[e.UploadDocument = 5] = "UploadDocument", e[e.ManualReview = 6] = "ManualReview", e[e.Overview = 7] = "Overview", e[e.InvestorCategorization = 8] = "InvestorCategorization", e))(G || {}), qe = /* @__PURE__ */ ((e) => (e[e.NotStarted = 0] = "NotStarted", e[e.InProgress = 1] = "InProgress", e[e.Success = 2] = "Success", e[e.PartialSuccess = 3] = "PartialSuccess", e[e.Failed = 4] = "Failed", e[e.Skipped = 5] = "Skipped", e[e.AdminReview = 6] = "AdminReview", e[e.SkippedAndAdminReview = 7] = "SkippedAndAdminReview", e))(qe || {}), xe = /* @__PURE__ */ ((e) => (e[e.None = 0] = "None", e[e.InProgress = 1] = "InProgress", e[e.Finished = 2] = "Finished", e[e.OnHold = 3] = "OnHold", e[e.IdentityPending = 4] = "IdentityPending", e))(xe || {}), At = /* @__PURE__ */ ((e) => (e[e.None = 0] = "None", e[e.RepresentativeKYC = 1] = "RepresentativeKYC", e[e.ManualRiskCriteria = 2] = "ManualRiskCriteria", e[e.UploadDocumentReview = 3] = "UploadDocumentReview", e[e.AdminReview = 4] = "AdminReview", e))(At || {}), Et = /* @__PURE__ */ ((e) => (e[e.LowRisk = 0] = "LowRisk", e[e.MediumRisk = 1] = "MediumRisk", e[e.HighRisk = 2] = "HighRisk", e[e.Alert = 3] = "Alert", e))(Et || {}), De = /* @__PURE__ */ ((e) => (e[e.None = 0] = "None", e[e.Pending = 1] = "Pending", e[e.Approved = 2] = "Approved", e[e.Rejected = 3] = "Rejected", e[e.ResendRequested = 4] = "ResendRequested", e[e.Unknown = 5] = "Unknown", e[e.InProgress = 6] = "InProgress", e))(De || {}), Fe = /* @__PURE__ */ ((e) => (e[e.Approved = 0] = "Approved", e[e.Reject = 1] = "Reject", e[e.UnderReview = 2] = "UnderReview", e[e.Closed = 3] = "Closed", e[e.AdminReview = 4] = "AdminReview", e[e.New = 5] = "New", e[e.InProgress = 6] = "InProgress", e))(Fe || {}), It = /* @__PURE__ */ ((e) => (e[e.ProviderResultPending = 0] = "ProviderResultPending", e[e.ProviderResultReceived = 1] = "ProviderResultReceived", e[e.Canceled = 2] = "Canceled", e[e.ExtendedToNewApplicant = 3] = "ExtendedToNewApplicant", e))(It || {}), Rt = /* @__PURE__ */ ((e) => (e[e.None = 0] = "None", e[e.ProviderResultPending = 1] = "ProviderResultPending", e[e.ProviderResultReceived = 2] = "ProviderResultReceived", e[e.Canceled = 3] = "Canceled", e))(Rt || {}), fe = /* @__PURE__ */ ((e) => (e[e.Onfido = 0] = "Onfido", e[e.Sumsub = 2] = "Sumsub", e[e.SardinAI = 3] = "SardinAI", e))(fe || {}), Pt = /* @__PURE__ */ ((e) => (e[e.Individual = 0] = "Individual", e[e.Company = 1] = "Company", e))(Pt || {}), Ke = /* @__PURE__ */ ((e) => (e[e.Male = 0] = "Male", e[e.Female = 1] = "Female", e[e.Other = 2] = "Other", e))(Ke || {}), Dt = /* @__PURE__ */ ((e) => (e[e.Image = 0] = "Image", e[e.Video = 1] = "Video", e[e.PDF = 2] = "PDF", e[e.OfficePDF = 3] = "OfficePDF", e[e.Custom = 4] = "Custom", e))(Dt || {}), Ft = /* @__PURE__ */ ((e) => (e[e.Pending = 0] = "Pending", e[e.Approved = 1] = "Approved", e[e.Rejected = 2] = "Rejected", e[e.RequiresRevision = 3] = "RequiresRevision", e))(Ft || {}), Lt = /* @__PURE__ */ ((e) => (e[e.SingleChoice = 0] = "SingleChoice", e[e.MultipleChoice = 1] = "MultipleChoice", e[e.Text = 2] = "Text", e))(Lt || {}), Ie = /* @__PURE__ */ ((e) => (e[e.String = 0] = "String", e[e.Integer = 1] = "Integer", e[e.Decimal = 2] = "Decimal", e[e.Boolean = 3] = "Boolean", e[e.Date = 4] = "Date", e[e.Country = 5] = "Country", e[e.DigitOnly = 6] = "DigitOnly", e))(Ie || {}), Tt = /* @__PURE__ */ ((e) => (e[e.Text = 0] = "Text", e[e.Radio = 1] = "Radio", e[e.Checkbox = 2] = "Checkbox", e[e.Dropdown = 3] = "Dropdown", e[e.Country = 4] = "Country", e))(Tt || {}), Mt = /* @__PURE__ */ ((e) => (e[e.None = 0] = "None", e[e.Country = 1] = "Country", e))(Mt || {}), he = /* @__PURE__ */ ((e) => (e[e.Individual = 0] = "Individual", e[e.Sophisticated = 1] = "Sophisticated", e[e.HighNetWorth = 2] = "HighNetWorth", e[e.Business = 3] = "Business", e))(he || {}), Ot = /* @__PURE__ */ ((e) => (e[e.Retail = 0] = "Retail", e[e.Professional = 1] = "Professional", e[e.EligibleCounterparty = 2] = "EligibleCounterparty", e))(Ot || {});
11
+ var V = /* @__PURE__ */ ((e) => (e[e.IdentitySdk = 0] = "IdentitySdk", e[e.RiskScoring = 1] = "RiskScoring", e[e.Questionaries = 2] = "Questionaries", e[e.AdditionalData = 3] = "AdditionalData", e[e.AppropriatenessTest = 4] = "AppropriatenessTest", e[e.UploadDocument = 5] = "UploadDocument", e[e.ManualReview = 6] = "ManualReview", e[e.Overview = 7] = "Overview", e[e.InvestorCategorization = 8] = "InvestorCategorization", e))(V || {}), qe = /* @__PURE__ */ ((e) => (e[e.NotStarted = 0] = "NotStarted", e[e.InProgress = 1] = "InProgress", e[e.Success = 2] = "Success", e[e.PartialSuccess = 3] = "PartialSuccess", e[e.Failed = 4] = "Failed", e[e.Skipped = 5] = "Skipped", e[e.AdminReview = 6] = "AdminReview", e[e.SkippedAndAdminReview = 7] = "SkippedAndAdminReview", e))(qe || {}), be = /* @__PURE__ */ ((e) => (e[e.None = 0] = "None", e[e.InProgress = 1] = "InProgress", e[e.Finished = 2] = "Finished", e[e.OnHold = 3] = "OnHold", e[e.IdentityPending = 4] = "IdentityPending", e))(be || {}), At = /* @__PURE__ */ ((e) => (e[e.None = 0] = "None", e[e.RepresentativeKYC = 1] = "RepresentativeKYC", e[e.ManualRiskCriteria = 2] = "ManualRiskCriteria", e[e.UploadDocumentReview = 3] = "UploadDocumentReview", e[e.AdminReview = 4] = "AdminReview", e))(At || {}), Et = /* @__PURE__ */ ((e) => (e[e.LowRisk = 0] = "LowRisk", e[e.MediumRisk = 1] = "MediumRisk", e[e.HighRisk = 2] = "HighRisk", e[e.Alert = 3] = "Alert", e))(Et || {}), De = /* @__PURE__ */ ((e) => (e[e.None = 0] = "None", e[e.Pending = 1] = "Pending", e[e.Approved = 2] = "Approved", e[e.Rejected = 3] = "Rejected", e[e.ResendRequested = 4] = "ResendRequested", e[e.Unknown = 5] = "Unknown", e[e.InProgress = 6] = "InProgress", e))(De || {}), Fe = /* @__PURE__ */ ((e) => (e[e.Approved = 0] = "Approved", e[e.Reject = 1] = "Reject", e[e.UnderReview = 2] = "UnderReview", e[e.Closed = 3] = "Closed", e[e.AdminReview = 4] = "AdminReview", e[e.New = 5] = "New", e[e.InProgress = 6] = "InProgress", e))(Fe || {}), It = /* @__PURE__ */ ((e) => (e[e.ProviderResultPending = 0] = "ProviderResultPending", e[e.ProviderResultReceived = 1] = "ProviderResultReceived", e[e.Canceled = 2] = "Canceled", e[e.ExtendedToNewApplicant = 3] = "ExtendedToNewApplicant", e))(It || {}), Rt = /* @__PURE__ */ ((e) => (e[e.None = 0] = "None", e[e.ProviderResultPending = 1] = "ProviderResultPending", e[e.ProviderResultReceived = 2] = "ProviderResultReceived", e[e.Canceled = 3] = "Canceled", e))(Rt || {}), xe = /* @__PURE__ */ ((e) => (e[e.Onfido = 0] = "Onfido", e[e.Sumsub = 2] = "Sumsub", e[e.SardinAI = 3] = "SardinAI", e))(xe || {}), Pt = /* @__PURE__ */ ((e) => (e[e.Individual = 0] = "Individual", e[e.Company = 1] = "Company", e))(Pt || {}), Ke = /* @__PURE__ */ ((e) => (e[e.Male = 0] = "Male", e[e.Female = 1] = "Female", e[e.Other = 2] = "Other", e))(Ke || {}), Dt = /* @__PURE__ */ ((e) => (e[e.Image = 0] = "Image", e[e.Video = 1] = "Video", e[e.PDF = 2] = "PDF", e[e.OfficePDF = 3] = "OfficePDF", e[e.Custom = 4] = "Custom", e))(Dt || {}), Ft = /* @__PURE__ */ ((e) => (e[e.Pending = 0] = "Pending", e[e.Approved = 1] = "Approved", e[e.Rejected = 2] = "Rejected", e[e.RequiresRevision = 3] = "RequiresRevision", e))(Ft || {}), Lt = /* @__PURE__ */ ((e) => (e[e.SingleChoice = 0] = "SingleChoice", e[e.MultipleChoice = 1] = "MultipleChoice", e[e.Text = 2] = "Text", e))(Lt || {}), Ie = /* @__PURE__ */ ((e) => (e[e.String = 0] = "String", e[e.Integer = 1] = "Integer", e[e.Decimal = 2] = "Decimal", e[e.Boolean = 3] = "Boolean", e[e.Date = 4] = "Date", e[e.Country = 5] = "Country", e[e.DigitOnly = 6] = "DigitOnly", e))(Ie || {}), Tt = /* @__PURE__ */ ((e) => (e[e.Text = 0] = "Text", e[e.Radio = 1] = "Radio", e[e.Checkbox = 2] = "Checkbox", e[e.Dropdown = 3] = "Dropdown", e[e.Country = 4] = "Country", e))(Tt || {}), Mt = /* @__PURE__ */ ((e) => (e[e.None = 0] = "None", e[e.Country = 1] = "Country", e))(Mt || {}), he = /* @__PURE__ */ ((e) => (e[e.Individual = 0] = "Individual", e[e.Sophisticated = 1] = "Sophisticated", e[e.HighNetWorth = 2] = "HighNetWorth", e[e.Business = 3] = "Business", e))(he || {}), Ot = /* @__PURE__ */ ((e) => (e[e.Retail = 0] = "Retail", e[e.Professional = 1] = "Professional", e[e.EligibleCounterparty = 2] = "EligibleCounterparty", e))(Ot || {});
12
12
  const Le = {
13
13
  Nationality: 10,
14
14
  Address: 20,
@@ -113,10 +113,10 @@ class Bt {
113
113
  }
114
114
  }
115
115
  class Ne extends Error {
116
- constructor(n, a, i, o, c) {
116
+ constructor(n, a, i, o, l) {
117
117
  super(n);
118
118
  re(this, "response");
119
- this.code = a, this.details = i, this.validationErrors = o, this.name = "MetaKYCError", this.response = c, Object.setPrototypeOf(this, Ne.prototype);
119
+ this.code = a, this.details = i, this.validationErrors = o, this.name = "MetaKYCError", this.response = l, Object.setPrototypeOf(this, Ne.prototype);
120
120
  }
121
121
  }
122
122
  class ze {
@@ -908,12 +908,12 @@ class rr {
908
908
  try {
909
909
  const i = typeof n.result.applicantFormPages == "string" ? JSON.parse(n.result.applicantFormPages) : n.result.applicantFormPages;
910
910
  Array.isArray(i) && i.length > 0 && (a.applicantFormPages = i.map((o) => {
911
- const c = !o._v || o._v < 4;
911
+ const l = !o._v || o._v < 4;
912
912
  return {
913
913
  ...o,
914
914
  fields: (o.fields || []).map((d) => ({
915
915
  ...d,
916
- colSpan: c ? d.colSpan === 1 ? 2 : 4 : Math.min(4, Math.max(1, d.colSpan ?? 4))
916
+ colSpan: l ? d.colSpan === 1 ? 2 : 4 : Math.min(4, Math.max(1, d.colSpan ?? 4))
917
917
  }))
918
918
  };
919
919
  }));
@@ -1041,7 +1041,7 @@ class ar {
1041
1041
  */
1042
1042
  get status() {
1043
1043
  var t;
1044
- return ((t = this._progress) == null ? void 0 : t.status) || xe.None;
1044
+ return ((t = this._progress) == null ? void 0 : t.status) || be.None;
1045
1045
  }
1046
1046
  /**
1047
1047
  * Get workflow result
@@ -1060,19 +1060,19 @@ class ar {
1060
1060
  * Check if workflow is complete
1061
1061
  */
1062
1062
  get isComplete() {
1063
- return this.status === xe.Finished;
1063
+ return this.status === be.Finished;
1064
1064
  }
1065
1065
  /**
1066
1066
  * Check if workflow is on hold
1067
1067
  */
1068
1068
  get isOnHold() {
1069
- return this.status === xe.OnHold;
1069
+ return this.status === be.OnHold;
1070
1070
  }
1071
1071
  /**
1072
1072
  * Check if workflow is in progress
1073
1073
  */
1074
1074
  get isInProgress() {
1075
- return this.status === xe.InProgress;
1075
+ return this.status === be.InProgress;
1076
1076
  }
1077
1077
  /**
1078
1078
  * Set applicant ID
@@ -1086,7 +1086,7 @@ class ar {
1086
1086
  updateProgress(t) {
1087
1087
  var a, i;
1088
1088
  const n = (a = this._progress) == null ? void 0 : a.currentStep;
1089
- this._progress = t, this._applicantId = t.applicantId, this._error = null, this.events.emit("progressUpdated", t), (n == null ? void 0 : n.order) !== ((i = t.currentStep) == null ? void 0 : i.order) && this.events.emit("stepChanged", t.currentStep), this.events.emit("statusChanged", t.status), t.status === xe.Finished && t.workflowResult && this.events.emit("completed", t.workflowResult);
1089
+ this._progress = t, this._applicantId = t.applicantId, this._error = null, this.events.emit("progressUpdated", t), (n == null ? void 0 : n.order) !== ((i = t.currentStep) == null ? void 0 : i.order) && this.events.emit("stepChanged", t.currentStep), this.events.emit("statusChanged", t.status), t.status === be.Finished && t.workflowResult && this.events.emit("completed", t.workflowResult);
1090
1090
  }
1091
1091
  /**
1092
1092
  * Set error
@@ -1171,7 +1171,7 @@ class ir {
1171
1171
  async loadStepData(t, n) {
1172
1172
  const a = this.getHandler(t);
1173
1173
  if (!a)
1174
- throw new Error(`No handler registered for step action: ${G[t]}`);
1174
+ throw new Error(`No handler registered for step action: ${V[t]}`);
1175
1175
  return a.loadData(n);
1176
1176
  }
1177
1177
  /**
@@ -1180,61 +1180,61 @@ class ir {
1180
1180
  async submitStepData(t, n) {
1181
1181
  const a = this.getHandler(t);
1182
1182
  if (!a)
1183
- throw new Error(`No handler registered for step action: ${G[t]}`);
1183
+ throw new Error(`No handler registered for step action: ${V[t]}`);
1184
1184
  return a.submitData(n);
1185
1185
  }
1186
1186
  }
1187
1187
  class sr {
1188
- constructor(t, n, a, i, o, c, d, u) {
1188
+ constructor(t, n, a, i, o, l, d, u) {
1189
1189
  re(this, "state");
1190
1190
  re(this, "stepRouter");
1191
- this.applicantService = t, this.questionnaireService = n, this.uploadDocumentService = a, this.appropriatenessTestService = i, this.overviewService = o, this.riskScoringService = c, this.investorCategorizationService = u, this.state = new ar(), this.stepRouter = new ir(), this.registerStepHandlers();
1191
+ this.applicantService = t, this.questionnaireService = n, this.uploadDocumentService = a, this.appropriatenessTestService = i, this.overviewService = o, this.riskScoringService = l, this.investorCategorizationService = u, this.state = new ar(), this.stepRouter = new ir(), this.registerStepHandlers();
1192
1192
  }
1193
1193
  /**
1194
1194
  * Register all step handlers
1195
1195
  */
1196
1196
  registerStepHandlers() {
1197
- this.stepRouter.registerHandler(G.Questionaries, {
1197
+ this.stepRouter.registerHandler(V.Questionaries, {
1198
1198
  loadData: (t) => this.questionnaireService.getQuestionnaire(t),
1199
1199
  submitData: async (t) => {
1200
1200
  await this.questionnaireService.fillQuestionnaire(t);
1201
1201
  }
1202
- }), this.stepRouter.registerHandler(G.UploadDocument, {
1202
+ }), this.stepRouter.registerHandler(V.UploadDocument, {
1203
1203
  loadData: (t) => this.uploadDocumentService.getUploadDocument(t),
1204
1204
  submitData: (t) => this.uploadDocumentService.fillUploadDocument(t)
1205
- }), this.stepRouter.registerHandler(G.AppropriatenessTest, {
1205
+ }), this.stepRouter.registerHandler(V.AppropriatenessTest, {
1206
1206
  loadData: (t) => this.appropriatenessTestService.getAppropriatenessTest(t),
1207
1207
  submitData: async (t) => {
1208
1208
  await this.appropriatenessTestService.fillAppropriatenessTest(t);
1209
1209
  }
1210
- }), this.stepRouter.registerHandler(G.Overview, {
1210
+ }), this.stepRouter.registerHandler(V.Overview, {
1211
1211
  loadData: (t) => this.overviewService.getOverviewData(t),
1212
1212
  submitData: (t) => this.overviewService.passOverview(t.applicantId)
1213
- }), this.stepRouter.registerHandler(G.RiskScoring, {
1213
+ }), this.stepRouter.registerHandler(V.RiskScoring, {
1214
1214
  loadData: (t) => this.riskScoringService.getRiskCriterias(t),
1215
1215
  submitData: async (t) => {
1216
1216
  await this.riskScoringService.submitRiskScoring(t);
1217
1217
  }
1218
- }), this.stepRouter.registerHandler(G.IdentitySdk, {
1218
+ }), this.stepRouter.registerHandler(V.IdentitySdk, {
1219
1219
  loadData: async (t) => ({
1220
1220
  applicantId: t,
1221
1221
  message: "Identity verification required"
1222
1222
  }),
1223
1223
  submitData: async () => {
1224
1224
  }
1225
- }), this.stepRouter.registerHandler(G.InvestorCategorization, {
1225
+ }), this.stepRouter.registerHandler(V.InvestorCategorization, {
1226
1226
  loadData: (t) => this.investorCategorizationService.getInvestorCategorization(t),
1227
1227
  submitData: async (t) => {
1228
1228
  await this.investorCategorizationService.setInvestorCategorization(t);
1229
1229
  }
1230
- }), this.stepRouter.registerHandler(G.ManualReview, {
1230
+ }), this.stepRouter.registerHandler(V.ManualReview, {
1231
1231
  loadData: async (t) => ({
1232
1232
  applicantId: t,
1233
1233
  message: "Your application is under manual review"
1234
1234
  }),
1235
1235
  submitData: async () => {
1236
1236
  }
1237
- }), this.stepRouter.registerHandler(G.AdditionalData, {
1237
+ }), this.stepRouter.registerHandler(V.AdditionalData, {
1238
1238
  loadData: async (t) => ({
1239
1239
  applicantId: t,
1240
1240
  message: "Additional data required"
@@ -1526,7 +1526,7 @@ class cr {
1526
1526
  try {
1527
1527
  if (await this.loadSDK(), !window._Sardine)
1528
1528
  throw new Error("SardinAI SDK not available after loading");
1529
- const t = this.getSardineHost(), { clientId: n, environment: a, flow: i, enableBiometrics: o, enablePortScanning: c } = this.config;
1529
+ const t = this.getSardineHost(), { clientId: n, environment: a, flow: i, enableBiometrics: o, enablePortScanning: l } = this.config;
1530
1530
  this.sardineContext = window._Sardine.createContext({
1531
1531
  clientId: n,
1532
1532
  sessionKey: this.sessionKey,
@@ -1537,7 +1537,7 @@ class cr {
1537
1537
  parentElement: document.body,
1538
1538
  enableBiometrics: o !== !1,
1539
1539
  // Default true
1540
- enablePortScanning: c === !0,
1540
+ enablePortScanning: l === !0,
1541
1541
  // Default false
1542
1542
  region: this.config.region,
1543
1543
  // Callback for device response (deprecated but kept for compatibility)
@@ -1616,11 +1616,11 @@ class Me {
1616
1616
  */
1617
1617
  static createProvider(t, n) {
1618
1618
  switch (t) {
1619
- case fe.Sumsub:
1619
+ case xe.Sumsub:
1620
1620
  return new or(n);
1621
- case fe.Onfido:
1621
+ case xe.Onfido:
1622
1622
  return new lr(n);
1623
- case fe.SardinAI:
1623
+ case xe.SardinAI:
1624
1624
  return new cr(n);
1625
1625
  default:
1626
1626
  throw new Error(`Unsupported identity provider: ${t}`);
@@ -1632,7 +1632,7 @@ class Me {
1632
1632
  static parseProviderConfig(t, n, a) {
1633
1633
  var i;
1634
1634
  switch (t) {
1635
- case fe.Sumsub:
1635
+ case xe.Sumsub:
1636
1636
  return {
1637
1637
  accessToken: n.accessToken || n.token,
1638
1638
  applicantEmail: n.email,
@@ -1640,11 +1640,11 @@ class Me {
1640
1640
  externalUserId: n.externalUserId,
1641
1641
  lang: n.lang || "en"
1642
1642
  };
1643
- case fe.Onfido:
1643
+ case xe.Onfido:
1644
1644
  return {
1645
1645
  token: n.token || n.sdkToken
1646
1646
  };
1647
- case fe.SardinAI:
1647
+ case xe.SardinAI:
1648
1648
  const o = ((i = a == null ? void 0 : a.identityProviders) == null ? void 0 : i.sardinai) || {};
1649
1649
  return {
1650
1650
  clientId: o.clientId || n.clientId,
@@ -1690,6 +1690,8 @@ class dr {
1690
1690
  danger: t.danger,
1691
1691
  info: t.info,
1692
1692
  background: t.background,
1693
+ // alias used by Input, Select, SearchableSelect, MultiSelect components
1694
+ "input-bg": t.background,
1693
1695
  surface: t.surface,
1694
1696
  border: t.border,
1695
1697
  "text-primary": t.textPrimary,
@@ -1787,37 +1789,37 @@ class dr {
1787
1789
  }
1788
1790
  }
1789
1791
  const mt = Nt(null), on = ({ config: e, children: t }) => {
1790
- const [n, a] = b(null), i = ge.useRef(!1), o = ge.useRef(!1), c = Ee(() => {
1791
- const u = new _t(e), p = new Ht(u), x = new Ut(u), N = new jt(u), m = new qt(u), y = new Kt(u), h = new Wt(u), C = new Yt(u), F = new Qt(u), k = new Gt(u), $ = new rr(u), A = new dr();
1792
+ const [n, a] = v(null), i = ge.useRef(!1), o = ge.useRef(!1), l = Ee(() => {
1793
+ const u = new _t(e), p = new Ht(u), b = new Ut(u), N = new jt(u), m = new qt(u), x = new Kt(u), h = new Wt(u), C = new Yt(u), D = new Qt(u), k = new Gt(u), z = new rr(u), A = new dr();
1792
1794
  return {
1793
1795
  httpClient: u,
1794
1796
  applicantService: p,
1795
- questionnaireService: x,
1797
+ questionnaireService: b,
1796
1798
  uploadDocumentService: N,
1797
1799
  appropriatenessTestService: m,
1798
- overviewService: y,
1800
+ overviewService: x,
1799
1801
  riskScoringService: h,
1800
1802
  identityService: C,
1801
- baseInformationService: F,
1803
+ baseInformationService: D,
1802
1804
  investorCategorizationService: k,
1803
- themeService: $,
1805
+ themeService: z,
1804
1806
  themeManager: A
1805
1807
  };
1806
1808
  }, [e]), d = Ee(() => ({
1807
1809
  config: e,
1808
- ...c,
1810
+ ...l,
1809
1811
  currentTheme: n,
1810
1812
  createOrchestrator: () => new sr(
1811
- c.applicantService,
1812
- c.questionnaireService,
1813
- c.uploadDocumentService,
1814
- c.appropriatenessTestService,
1815
- c.overviewService,
1816
- c.riskScoringService,
1817
- c.identityService,
1818
- c.investorCategorizationService
1813
+ l.applicantService,
1814
+ l.questionnaireService,
1815
+ l.uploadDocumentService,
1816
+ l.appropriatenessTestService,
1817
+ l.overviewService,
1818
+ l.riskScoringService,
1819
+ l.identityService,
1820
+ l.investorCategorizationService
1819
1821
  )
1820
- }), [e, c, n]);
1822
+ }), [e, l, n]);
1821
1823
  return ne(() => ((async () => {
1822
1824
  if (i.current || o.current) {
1823
1825
  console.log("[MetaKYC] Theme already loading or loaded, skipping...");
@@ -1826,19 +1828,19 @@ const mt = Nt(null), on = ({ config: e, children: t }) => {
1826
1828
  i.current = !0;
1827
1829
  try {
1828
1830
  if (e.theme) {
1829
- console.log("[MetaKYC] Applying static theme from config"), c.themeManager.applyTheme(e.theme), a(c.themeManager.getCurrentTheme()), o.current = !0;
1831
+ console.log("[MetaKYC] Applying static theme from config"), l.themeManager.applyTheme(e.theme), a(l.themeManager.getCurrentTheme()), o.current = !0;
1830
1832
  return;
1831
1833
  }
1832
1834
  console.log("[MetaKYC] Fetching theme from backend...");
1833
- const p = await c.themeService.getThemeConfiguration();
1834
- c.themeManager.applyTheme(p), a(c.themeManager.getCurrentTheme()), o.current = !0, console.log("[MetaKYC] Theme loaded and applied", p);
1835
+ const p = await l.themeService.getThemeConfiguration();
1836
+ l.themeManager.applyTheme(p), a(l.themeManager.getCurrentTheme()), o.current = !0, console.log("[MetaKYC] Theme loaded and applied", p);
1835
1837
  } catch (p) {
1836
- console.warn("[MetaKYC] Failed to load theme, using default:", p), a(c.themeManager.getCurrentTheme()), o.current = !0;
1838
+ console.warn("[MetaKYC] Failed to load theme, using default:", p), a(l.themeManager.getCurrentTheme()), o.current = !0;
1837
1839
  } finally {
1838
1840
  i.current = !1;
1839
1841
  }
1840
1842
  })(), () => {
1841
- c.themeManager.cleanup();
1843
+ l.themeManager.cleanup();
1842
1844
  }), []), /* @__PURE__ */ r(mt.Provider, { value: d, children: t });
1843
1845
  };
1844
1846
  function ye() {
@@ -1931,7 +1933,7 @@ function mn() {
1931
1933
  hr(), yr();
1932
1934
  }
1933
1935
  function fr(e) {
1934
- const { createOrchestrator: t } = ye(), [n, a] = b(null), [i, o] = b(!1), [c, d] = b(null), u = ee(null), p = e || pr();
1936
+ const { createOrchestrator: t } = ye(), [n, a] = v(null), [i, o] = v(!1), [l, d] = v(null), u = ee(null), p = e || pr();
1935
1937
  ne(() => {
1936
1938
  u.current || (u.current = t());
1937
1939
  }, [t]), ne(() => {
@@ -1945,40 +1947,40 @@ function fr(e) {
1945
1947
  nextWorkflowKey: n.nextWorkflowKey
1946
1948
  }));
1947
1949
  }, [n, p]);
1948
- const x = ee(!1), N = ee(!1), m = Q(async () => {
1950
+ const b = ee(!1), N = ee(!1), m = Q(async () => {
1949
1951
  if (!(!p || !u.current)) {
1950
- if (x.current) {
1952
+ if (b.current) {
1951
1953
  console.log("[Workflow] Load already in progress, skipping...");
1952
1954
  return;
1953
1955
  }
1954
- x.current = !0, o(!0), d(null);
1956
+ b.current = !0, o(!0), d(null);
1955
1957
  try {
1956
1958
  const A = await u.current.initialize(p);
1957
1959
  a(A), N.current = !0;
1958
1960
  } catch (A) {
1959
1961
  d(A);
1960
1962
  } finally {
1961
- o(!1), x.current = !1;
1963
+ o(!1), b.current = !1;
1962
1964
  }
1963
1965
  }
1964
1966
  }, [p]);
1965
1967
  ne(() => {
1966
1968
  p && !N.current && m();
1967
1969
  }, [p, m]);
1968
- const y = Q(async () => {
1970
+ const x = Q(async () => {
1969
1971
  if (u.current) {
1970
- if (x.current) {
1972
+ if (b.current) {
1971
1973
  console.log("[Workflow] Refresh already in progress, skipping...");
1972
1974
  return;
1973
1975
  }
1974
- x.current = !0, o(!0), d(null);
1976
+ b.current = !0, o(!0), d(null);
1975
1977
  try {
1976
1978
  const A = await u.current.refreshProgress();
1977
1979
  a(A);
1978
1980
  } catch (A) {
1979
1981
  d(A);
1980
1982
  } finally {
1981
- o(!1), x.current = !1;
1983
+ o(!1), b.current = !1;
1982
1984
  }
1983
1985
  }
1984
1986
  }, []), h = Q(async () => {
@@ -2005,7 +2007,7 @@ function fr(e) {
2005
2007
  o(!1);
2006
2008
  }
2007
2009
  }
2008
- }, []), F = Q(async (A) => {
2010
+ }, []), D = Q(async (A) => {
2009
2011
  if (u.current) {
2010
2012
  o(!0), d(null);
2011
2013
  try {
@@ -2018,37 +2020,37 @@ function fr(e) {
2018
2020
  o(!1);
2019
2021
  }
2020
2022
  }
2021
- }, []), k = nt.useMemo(() => n != null && n.stepInfoList ? [...n.stepInfoList].sort((A, I) => A.order - I.order) : [], [n == null ? void 0 : n.stepInfoList]), $ = nt.useMemo(() => n ? n.nextWorkflowKey && n.nextWorkflowKey !== n.workFlowKey : !1, [n]);
2023
+ }, []), k = nt.useMemo(() => n != null && n.stepInfoList ? [...n.stepInfoList].sort((A, I) => A.order - I.order) : [], [n == null ? void 0 : n.stepInfoList]), z = nt.useMemo(() => n ? n.nextWorkflowKey && n.nextWorkflowKey !== n.workFlowKey : !1, [n]);
2022
2024
  return {
2023
2025
  progress: n,
2024
2026
  applicantId: p,
2025
2027
  currentStep: (n == null ? void 0 : n.currentStep) || null,
2026
2028
  steps: k,
2027
- status: (n == null ? void 0 : n.status) || xe.None,
2029
+ status: (n == null ? void 0 : n.status) || be.None,
2028
2030
  workflowResult: (n == null ? void 0 : n.workflowResult) || null,
2029
2031
  workflowKey: n == null ? void 0 : n.workFlowKey,
2030
2032
  nextWorkflowKey: n == null ? void 0 : n.nextWorkflowKey,
2031
- hasWorkflowChanged: $,
2033
+ hasWorkflowChanged: z,
2032
2034
  isLoading: i,
2033
- error: c,
2034
- isComplete: (n == null ? void 0 : n.status) === xe.Finished,
2035
- isOnHold: (n == null ? void 0 : n.status) === xe.OnHold,
2036
- refreshProgress: y,
2035
+ error: l,
2036
+ isComplete: (n == null ? void 0 : n.status) === be.Finished,
2037
+ isOnHold: (n == null ? void 0 : n.status) === be.OnHold,
2038
+ refreshProgress: x,
2037
2039
  moveToNext: h,
2038
2040
  moveBack: C,
2039
- submitCurrentStep: F,
2041
+ submitCurrentStep: D,
2040
2042
  orchestrator: u.current
2041
2043
  };
2042
2044
  }
2043
2045
  function xr(e) {
2044
- const { questionnaireService: t, applicantService: n } = ye(), [a, i] = b(null), [o, c] = b({}), [d, u] = b(!1), [p, x] = b(!1), [N, m] = b(null), y = ee(!1), h = ee(null), C = Q(async () => {
2045
- var k, $;
2046
+ const { questionnaireService: t, applicantService: n } = ye(), [a, i] = v(null), [o, l] = v({}), [d, u] = v(!1), [p, b] = v(!1), [N, m] = v(null), x = ee(!1), h = ee(null), C = Q(async () => {
2047
+ var k, z;
2046
2048
  if (e) {
2047
- if (y.current) {
2049
+ if (x.current) {
2048
2050
  console.log("[Questionnaire] Load already in progress, skipping...");
2049
2051
  return;
2050
2052
  }
2051
- y.current = !0, u(!0), m(null);
2053
+ x.current = !0, u(!0), m(null);
2052
2054
  try {
2053
2055
  const [A, I] = await Promise.all([
2054
2056
  t.getQuestionnaire(e),
@@ -2056,35 +2058,35 @@ function xr(e) {
2056
2058
  ]);
2057
2059
  if (i(A), (k = I == null ? void 0 : I.questionnaireResults) != null && k.length && A) {
2058
2060
  const j = /* @__PURE__ */ new Map();
2059
- for (const g of I.questionnaireResults)
2060
- g.question && (($ = g.answers) != null && $.length) && j.set(g.question.trim().toLowerCase(), g.answers);
2061
- const J = {}, E = A.questionGroups.flatMap((g) => g.questions ?? []);
2062
- for (const g of E) {
2063
- const R = g.text.trim().toLowerCase();
2064
- j.has(R) && (J[g.id] = j.get(R));
2061
+ for (const f of I.questionnaireResults)
2062
+ f.question && ((z = f.answers) != null && z.length) && j.set(f.question.trim().toLowerCase(), f.answers);
2063
+ const G = {}, E = A.questionGroups.flatMap((f) => f.questions ?? []);
2064
+ for (const f of E) {
2065
+ const R = f.text.trim().toLowerCase();
2066
+ j.has(R) && (G[f.id] = j.get(R));
2065
2067
  }
2066
- c(J);
2068
+ l(G);
2067
2069
  }
2068
2070
  h.current = e;
2069
2071
  } catch (A) {
2070
2072
  m(A);
2071
2073
  } finally {
2072
- u(!1), y.current = !1;
2074
+ u(!1), x.current = !1;
2073
2075
  }
2074
2076
  }
2075
2077
  }, [e, t, n]);
2076
2078
  ne(() => {
2077
2079
  e && h.current !== e && C();
2078
2080
  }, [e]);
2079
- const F = Q(
2081
+ const D = Q(
2080
2082
  async (k) => {
2081
- x(!0), m(null);
2083
+ b(!0), m(null);
2082
2084
  try {
2083
2085
  return await t.fillQuestionnaire(k);
2084
- } catch ($) {
2085
- throw m($), $;
2086
+ } catch (z) {
2087
+ throw m(z), z;
2086
2088
  } finally {
2087
- x(!1);
2089
+ b(!1);
2088
2090
  }
2089
2091
  },
2090
2092
  [t]
@@ -2096,11 +2098,11 @@ function xr(e) {
2096
2098
  isSubmitting: p,
2097
2099
  error: N,
2098
2100
  load: C,
2099
- submit: F
2101
+ submit: D
2100
2102
  };
2101
2103
  }
2102
2104
  function br(e) {
2103
- const { uploadDocumentService: t } = ye(), [n, a] = b(null), [i, o] = b(!1), [c, d] = b(!1), [u, p] = b(0), [x, N] = b(null), m = ee(!1), y = ee(null), h = Q(async () => {
2105
+ const { uploadDocumentService: t } = ye(), [n, a] = v(null), [i, o] = v(!1), [l, d] = v(!1), [u, p] = v(0), [b, N] = v(null), m = ee(!1), x = ee(null), h = Q(async () => {
2104
2106
  if (e) {
2105
2107
  if (m.current) {
2106
2108
  console.log("[UploadDocument] Load already in progress, skipping...");
@@ -2108,23 +2110,23 @@ function br(e) {
2108
2110
  }
2109
2111
  m.current = !0, o(!0), N(null);
2110
2112
  try {
2111
- const F = await t.getUploadDocument(e);
2112
- a(F), y.current = e;
2113
- } catch (F) {
2114
- N(F);
2113
+ const D = await t.getUploadDocument(e);
2114
+ a(D), x.current = e;
2115
+ } catch (D) {
2116
+ N(D);
2115
2117
  } finally {
2116
2118
  o(!1), m.current = !1;
2117
2119
  }
2118
2120
  }
2119
2121
  }, [e, t]);
2120
2122
  ne(() => {
2121
- e && y.current !== e && h();
2123
+ e && x.current !== e && h();
2122
2124
  }, [e]);
2123
2125
  const C = Q(
2124
- async (F) => {
2126
+ async (D) => {
2125
2127
  d(!0), p(0), N(null);
2126
2128
  try {
2127
- await t.fillUploadDocument(F), p(100);
2129
+ await t.fillUploadDocument(D), p(100);
2128
2130
  } catch (k) {
2129
2131
  throw N(k), k;
2130
2132
  } finally {
@@ -2136,15 +2138,15 @@ function br(e) {
2136
2138
  return {
2137
2139
  uploadDocument: n,
2138
2140
  isLoading: i,
2139
- isSubmitting: c,
2141
+ isSubmitting: l,
2140
2142
  uploadProgress: u,
2141
- error: x,
2143
+ error: b,
2142
2144
  load: h,
2143
2145
  submit: C
2144
2146
  };
2145
2147
  }
2146
2148
  function pn(e) {
2147
- const { appropriatenessTestService: t } = ye(), [n, a] = b(null), [i, o] = b(!1), [c, d] = b(!1), [u, p] = b(null), [x, N] = b(null), m = ee(!1), y = ee(null), h = Q(async () => {
2149
+ const { appropriatenessTestService: t } = ye(), [n, a] = v(null), [i, o] = v(!1), [l, d] = v(!1), [u, p] = v(null), [b, N] = v(null), m = ee(!1), x = ee(null), h = Q(async () => {
2148
2150
  if (e) {
2149
2151
  if (m.current) {
2150
2152
  console.log("[AppropriatenessTest] Load already in progress, skipping...");
@@ -2152,23 +2154,23 @@ function pn(e) {
2152
2154
  }
2153
2155
  m.current = !0, o(!0), p(null);
2154
2156
  try {
2155
- const F = await t.getAppropriatenessTest(e);
2156
- a(F), y.current = e;
2157
- } catch (F) {
2158
- p(F);
2157
+ const D = await t.getAppropriatenessTest(e);
2158
+ a(D), x.current = e;
2159
+ } catch (D) {
2160
+ p(D);
2159
2161
  } finally {
2160
2162
  o(!1), m.current = !1;
2161
2163
  }
2162
2164
  }
2163
2165
  }, [e, t]);
2164
2166
  ne(() => {
2165
- e && y.current !== e && h();
2167
+ e && x.current !== e && h();
2166
2168
  }, [e]);
2167
2169
  const C = Q(
2168
- async (F) => {
2170
+ async (D) => {
2169
2171
  d(!0), p(null);
2170
2172
  try {
2171
- const k = await t.fillAppropriatenessTest(F);
2173
+ const k = await t.fillAppropriatenessTest(D);
2172
2174
  return N(k), k;
2173
2175
  } catch (k) {
2174
2176
  throw p(k), k;
@@ -2180,36 +2182,36 @@ function pn(e) {
2180
2182
  );
2181
2183
  return {
2182
2184
  test: n,
2183
- result: x,
2185
+ result: b,
2184
2186
  isLoading: i,
2185
- isSubmitting: c,
2187
+ isSubmitting: l,
2186
2188
  error: u,
2187
2189
  load: h,
2188
2190
  submit: C
2189
2191
  };
2190
2192
  }
2191
2193
  function vr(e) {
2192
- const { overviewService: t } = ye(), [n, a] = b(null), [i, o] = b(!1), [c, d] = b(!1), [u, p] = b(null), x = ee(!1), N = ee(null), m = Q(async () => {
2194
+ const { overviewService: t } = ye(), [n, a] = v(null), [i, o] = v(!1), [l, d] = v(!1), [u, p] = v(null), b = ee(!1), N = ee(null), m = Q(async () => {
2193
2195
  if (e) {
2194
- if (x.current) {
2196
+ if (b.current) {
2195
2197
  console.log("[Overview] Load already in progress, skipping...");
2196
2198
  return;
2197
2199
  }
2198
- x.current = !0, o(!0), p(null);
2200
+ b.current = !0, o(!0), p(null);
2199
2201
  try {
2200
2202
  const h = await t.getOverviewData(e);
2201
2203
  a(h), N.current = e;
2202
2204
  } catch (h) {
2203
2205
  p(h);
2204
2206
  } finally {
2205
- o(!1), x.current = !1;
2207
+ o(!1), b.current = !1;
2206
2208
  }
2207
2209
  }
2208
2210
  }, [e, t]);
2209
2211
  ne(() => {
2210
2212
  e && N.current !== e && m();
2211
2213
  }, [e]);
2212
- const y = Q(async () => {
2214
+ const x = Q(async () => {
2213
2215
  if (e) {
2214
2216
  d(!0), p(null);
2215
2217
  try {
@@ -2224,17 +2226,17 @@ function vr(e) {
2224
2226
  return {
2225
2227
  overview: n,
2226
2228
  isLoading: i,
2227
- isSubmitting: c,
2229
+ isSubmitting: l,
2228
2230
  error: u,
2229
2231
  load: m,
2230
- passOverview: y
2232
+ passOverview: x
2231
2233
  };
2232
2234
  }
2233
2235
  function kr(e) {
2234
- const { identityService: t } = ye(), [n, a] = b(
2236
+ const { identityService: t } = ye(), [n, a] = v(
2235
2237
  null
2236
- ), [i, o] = b(!1), [c, d] = b(null), u = ee(!1), p = Q(
2237
- async (m, y) => {
2238
+ ), [i, o] = v(!1), [l, d] = v(null), u = ee(!1), p = Q(
2239
+ async (m, x) => {
2238
2240
  if (e) {
2239
2241
  if (u.current) {
2240
2242
  console.log("[Identity] Request already in progress, skipping...");
@@ -2246,7 +2248,7 @@ function kr(e) {
2246
2248
  applicantId: e,
2247
2249
  restart: !1,
2248
2250
  redirectUrl: m || "",
2249
- ttl: y || 604800
2251
+ ttl: x || 604800
2250
2252
  // Default: 7 days
2251
2253
  };
2252
2254
  console.log("Identity request input:", h);
@@ -2260,8 +2262,8 @@ function kr(e) {
2260
2262
  }
2261
2263
  },
2262
2264
  [e, t]
2263
- ), x = Q(
2264
- async (m, y) => {
2265
+ ), b = Q(
2266
+ async (m, x) => {
2265
2267
  if (e) {
2266
2268
  o(!0), d(null);
2267
2269
  try {
@@ -2269,7 +2271,7 @@ function kr(e) {
2269
2271
  applicantId: e,
2270
2272
  restart: !1,
2271
2273
  redirectUrl: m,
2272
- ttl: y
2274
+ ttl: x
2273
2275
  }, C = await t.identityCompanyRequest(h);
2274
2276
  return a(C), C;
2275
2277
  } catch (h) {
@@ -2296,8 +2298,8 @@ function kr(e) {
2296
2298
  // 7 days
2297
2299
  };
2298
2300
  console.log("Restarting identity with input:", m);
2299
- const y = await t.identityRequest(m);
2300
- return console.log("Restart identity result:", y), a(y), y;
2301
+ const x = await t.identityRequest(m);
2302
+ return console.log("Restart identity result:", x), a(x), x;
2301
2303
  } catch (m) {
2302
2304
  throw d(m), m;
2303
2305
  } finally {
@@ -2310,14 +2312,14 @@ function kr(e) {
2310
2312
  provider: (n == null ? void 0 : n.provider) || null,
2311
2313
  token: (n == null ? void 0 : n.publicProviderTokenObject) || null,
2312
2314
  isLoading: i,
2313
- error: c,
2315
+ error: l,
2314
2316
  requestIdentity: p,
2315
- requestCompanyIdentity: x,
2317
+ requestCompanyIdentity: b,
2316
2318
  restartIdentity: N
2317
2319
  };
2318
2320
  }
2319
2321
  function wr(e) {
2320
- const { riskScoringService: t, applicantService: n } = ye(), [a, i] = b(null), [o, c] = b({}), [d, u] = b(!1), [p, x] = b(!1), [N, m] = b(null), [y, h] = b(null), C = ee(!1), F = ee(null), k = Q(async () => {
2322
+ const { riskScoringService: t, applicantService: n } = ye(), [a, i] = v(null), [o, l] = v({}), [d, u] = v(!1), [p, b] = v(!1), [N, m] = v(null), [x, h] = v(null), C = ee(!1), D = ee(null), k = Q(async () => {
2321
2323
  var A;
2322
2324
  if (e) {
2323
2325
  if (C.current) {
@@ -2331,17 +2333,17 @@ function wr(e) {
2331
2333
  n.getApplicantData(e).catch(() => null)
2332
2334
  ]);
2333
2335
  if (i(I), (A = j == null ? void 0 : j.riskScoringResults) != null && A.length) {
2334
- const J = j.riskScoringResults[0], E = {};
2335
- for (const g of J.riskCriteriaResults ?? [])
2336
- if (g.riskCriteriaId != null && g.answer != null && g.answer !== "") {
2336
+ const G = j.riskScoringResults[0], E = {};
2337
+ for (const f of G.riskCriteriaResults ?? [])
2338
+ if (f.riskCriteriaId != null && f.answer != null && f.answer !== "") {
2337
2339
  const R = [...new Set(
2338
- g.answer.split(",").map((P) => P.trim()).filter((P) => P !== "")
2340
+ f.answer.split(",").map((P) => P.trim()).filter((P) => P !== "")
2339
2341
  )];
2340
- R.length > 0 && (E[g.riskCriteriaId] = R);
2342
+ R.length > 0 && (E[f.riskCriteriaId] = R);
2341
2343
  }
2342
- c(E);
2344
+ l(E);
2343
2345
  }
2344
- F.current = e;
2346
+ D.current = e;
2345
2347
  } catch (I) {
2346
2348
  m(I);
2347
2349
  } finally {
@@ -2350,18 +2352,18 @@ function wr(e) {
2350
2352
  }
2351
2353
  }, [e, t, n]);
2352
2354
  ne(() => {
2353
- e && F.current !== e && k();
2355
+ e && D.current !== e && k();
2354
2356
  }, [e]);
2355
- const $ = Q(
2357
+ const z = Q(
2356
2358
  async (A) => {
2357
- x(!0), m(null);
2359
+ b(!0), m(null);
2358
2360
  try {
2359
2361
  const I = await t.submitRiskScoring(A);
2360
2362
  return h(I), I;
2361
2363
  } catch (I) {
2362
2364
  throw m(I), I;
2363
2365
  } finally {
2364
- x(!1);
2366
+ b(!1);
2365
2367
  }
2366
2368
  },
2367
2369
  [t]
@@ -2369,45 +2371,45 @@ function wr(e) {
2369
2371
  return {
2370
2372
  criteria: a,
2371
2373
  initialAnswers: o,
2372
- result: y,
2374
+ result: x,
2373
2375
  isLoading: d,
2374
2376
  isSubmitting: p,
2375
2377
  error: N,
2376
2378
  load: k,
2377
- submit: $
2379
+ submit: z
2378
2380
  };
2379
2381
  }
2380
2382
  function Nr() {
2381
- const { applicantService: e, config: t } = ye(), [n, a] = b(!1), [i, o] = b(null), c = ee(!1), d = ee(!1), u = () => "xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g, function(y) {
2383
+ const { applicantService: e, config: t } = ye(), [n, a] = v(!1), [i, o] = v(null), l = ee(!1), d = ee(!1), u = () => "xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g, function(x) {
2382
2384
  const h = Math.random() * 16 | 0;
2383
- return (y === "x" ? h : h & 3 | 8).toString(16);
2385
+ return (x === "x" ? h : h & 3 | 8).toString(16);
2384
2386
  }), p = Q(
2385
- async (y) => {
2387
+ async (x) => {
2386
2388
  var h;
2387
- if (c.current)
2389
+ if (l.current)
2388
2390
  throw console.log("[Applicant] Create already in progress, skipping..."), new Error("Creation already in progress");
2389
- c.current = !0, a(!0), o(null);
2391
+ l.current = !0, a(!0), o(null);
2390
2392
  try {
2391
- if (y.applicantAdditionalDatas || (y.applicantAdditionalDatas = []), (h = t.identityProviders) != null && h.sardinai) {
2392
- const F = u();
2393
- console.log("[SardinAI] Generated session key:", F), y.applicantAdditionalDatas.push({
2393
+ if (x.applicantAdditionalDatas || (x.applicantAdditionalDatas = []), (h = t.identityProviders) != null && h.sardinai) {
2394
+ const D = u();
2395
+ console.log("[SardinAI] Generated session key:", D), x.applicantAdditionalDatas.push({
2394
2396
  paramName: "sessionKey",
2395
- value: F
2397
+ value: D
2396
2398
  });
2397
2399
  }
2398
- return await e.createApplicant(y);
2400
+ return await e.createApplicant(x);
2399
2401
  } catch (C) {
2400
2402
  throw o(C), C;
2401
2403
  } finally {
2402
- a(!1), c.current = !1;
2404
+ a(!1), l.current = !1;
2403
2405
  }
2404
2406
  },
2405
2407
  [e, t]
2406
- ), x = Q(
2407
- async (y) => {
2408
+ ), b = Q(
2409
+ async (x) => {
2408
2410
  a(!0), o(null);
2409
2411
  try {
2410
- return await e.createCompanyApplicant(y);
2412
+ return await e.createCompanyApplicant(x);
2411
2413
  } catch (h) {
2412
2414
  throw o(h), h;
2413
2415
  } finally {
@@ -2416,12 +2418,12 @@ function Nr() {
2416
2418
  },
2417
2419
  [e]
2418
2420
  ), N = Q(
2419
- async (y) => {
2421
+ async (x) => {
2420
2422
  if (d.current)
2421
2423
  throw console.log("[Applicant] Data load already in progress, skipping..."), new Error("Data load already in progress");
2422
2424
  d.current = !0, a(!0), o(null);
2423
2425
  try {
2424
- return await e.getApplicantData(y);
2426
+ return await e.getApplicantData(x);
2425
2427
  } catch (h) {
2426
2428
  throw o(h), h;
2427
2429
  } finally {
@@ -2430,10 +2432,10 @@ function Nr() {
2430
2432
  },
2431
2433
  [e]
2432
2434
  ), m = Q(
2433
- async (y) => {
2435
+ async (x) => {
2434
2436
  a(!0), o(null);
2435
2437
  try {
2436
- await e.stopProgress(y);
2438
+ await e.stopProgress(x);
2437
2439
  } catch (h) {
2438
2440
  throw o(h), h;
2439
2441
  } finally {
@@ -2446,19 +2448,19 @@ function Nr() {
2446
2448
  isLoading: n,
2447
2449
  error: i,
2448
2450
  createApplicant: p,
2449
- createCompanyApplicant: x,
2451
+ createCompanyApplicant: b,
2450
2452
  getApplicantData: N,
2451
2453
  stopProgress: m
2452
2454
  };
2453
2455
  }
2454
- const V = ({
2456
+ const Z = ({
2455
2457
  children: e,
2456
2458
  variant: t = "primary",
2457
2459
  size: n = "md",
2458
2460
  isLoading: a = !1,
2459
2461
  disabled: i,
2460
2462
  className: o,
2461
- ...c
2463
+ ...l
2462
2464
  }) => {
2463
2465
  const d = "inline-flex items-center justify-center rounded-lg font-medium transition-colors focus:outline-none focus:ring-2 focus:ring-offset-2 disabled:opacity-50 disabled:cursor-not-allowed", u = {
2464
2466
  primary: "bg-primary-500 text-white hover:bg-primary-600 focus:ring-primary-500",
@@ -2476,7 +2478,7 @@ const V = ({
2476
2478
  {
2477
2479
  className: oe(d, u[t], p[n], o),
2478
2480
  disabled: i || a,
2479
- ...c,
2481
+ ...l,
2480
2482
  children: [
2481
2483
  a && /* @__PURE__ */ s(
2482
2484
  "svg",
@@ -2513,34 +2515,45 @@ const V = ({
2513
2515
  }
2514
2516
  );
2515
2517
  }, me = Ue(
2516
- ({ label: e, error: t, helperText: n, leftIcon: a, rightIcon: i, className: o, ...c }, d) => /* @__PURE__ */ s("div", { className: "w-full", children: [
2517
- e && /* @__PURE__ */ s("label", { className: "block text-sm font-medium text-gray-700 dark:text-gray-300 mb-1", children: [
2518
- e,
2519
- c.required && /* @__PURE__ */ r("span", { className: "text-danger-500 ml-1", children: "*" })
2520
- ] }),
2518
+ ({ label: e, error: t, helperText: n, leftIcon: a, rightIcon: i, className: o, style: l, ...d }, u) => /* @__PURE__ */ s("div", { className: "w-full", children: [
2519
+ e && /* @__PURE__ */ s(
2520
+ "label",
2521
+ {
2522
+ className: "block text-sm font-medium mb-1",
2523
+ style: { color: "var(--metakyc-text-primary, #374151)" },
2524
+ children: [
2525
+ e,
2526
+ d.required && /* @__PURE__ */ r("span", { className: "text-danger-500 ml-1", children: "*" })
2527
+ ]
2528
+ }
2529
+ ),
2521
2530
  /* @__PURE__ */ s("div", { className: "relative", children: [
2522
2531
  a && /* @__PURE__ */ r("div", { className: "absolute inset-y-0 left-0 pl-3 flex items-center pointer-events-none", children: a }),
2523
2532
  /* @__PURE__ */ r(
2524
2533
  "input",
2525
2534
  {
2526
- ref: d,
2535
+ ref: u,
2527
2536
  className: oe(
2528
2537
  "block w-full rounded-lg border px-3 py-2 text-sm transition-colors",
2529
- "focus:outline-none focus:ring-2 focus:ring-primary-500 focus:border-transparent",
2530
- "disabled:bg-gray-100 disabled:cursor-not-allowed",
2531
- t ? "border-danger-500 focus:ring-danger-500" : "border-gray-300 dark:border-gray-600",
2532
- "dark:bg-gray-800 dark:text-white",
2538
+ "focus:outline-none focus:ring-2 focus:ring-offset-0",
2539
+ "disabled:opacity-60 disabled:cursor-not-allowed",
2533
2540
  a ? "pl-10" : "",
2534
2541
  i ? "pr-10" : "",
2535
2542
  o
2536
2543
  ),
2537
- ...c
2544
+ style: {
2545
+ backgroundColor: "var(--metakyc-input-bg, #ffffff)",
2546
+ color: "var(--metakyc-text-primary, #111827)",
2547
+ borderColor: t ? "var(--metakyc-danger, #ef4444)" : "var(--metakyc-border, #d1d5db)",
2548
+ ...l
2549
+ },
2550
+ ...d
2538
2551
  }
2539
2552
  ),
2540
2553
  i && /* @__PURE__ */ r("div", { className: "absolute inset-y-0 right-0 pr-3 flex items-center pointer-events-none", children: i })
2541
2554
  ] }),
2542
- t && /* @__PURE__ */ r("p", { className: "mt-1 text-sm text-danger-500", children: t }),
2543
- !t && n && /* @__PURE__ */ r("p", { className: "mt-1 text-sm text-gray-500", children: n })
2555
+ t && /* @__PURE__ */ r("p", { className: "mt-1 text-sm", style: { color: "var(--metakyc-danger, #ef4444)" }, children: t }),
2556
+ !t && n && /* @__PURE__ */ r("p", { className: "mt-1 text-sm", style: { color: "var(--metakyc-text-secondary, #6b7280)" }, children: n })
2544
2557
  ] })
2545
2558
  );
2546
2559
  me.displayName = "Input";
@@ -2595,7 +2608,7 @@ const K = ({ children: e, className: t, ...n }) => /* @__PURE__ */ r(
2595
2608
  ...a,
2596
2609
  children: e
2597
2610
  }
2598
- ), be = ({ size: e = "md", className: t, ...n }) => {
2611
+ ), ve = ({ size: e = "md", className: t, ...n }) => {
2599
2612
  const a = {
2600
2613
  sm: "h-4 w-4",
2601
2614
  md: "h-8 w-8",
@@ -2632,7 +2645,7 @@ const K = ({ children: e, className: t, ...n }) => /* @__PURE__ */ r(
2632
2645
  }
2633
2646
  ) });
2634
2647
  }, He = Ue(
2635
- ({ label: e, error: t, helperText: n, options: a, placeholder: i, className: o, style: c, ...d }, u) => /* @__PURE__ */ s("div", { className: "w-full", children: [
2648
+ ({ label: e, error: t, helperText: n, options: a, placeholder: i, className: o, style: l, ...d }, u) => /* @__PURE__ */ s("div", { className: "w-full", children: [
2636
2649
  e && /* @__PURE__ */ s(
2637
2650
  "label",
2638
2651
  {
@@ -2660,7 +2673,7 @@ const K = ({ children: e, className: t, ...n }) => /* @__PURE__ */ r(
2660
2673
  color: "var(--metakyc-text-primary, #111827)",
2661
2674
  borderColor: t ? "var(--metakyc-error, #ef4444)" : "var(--metakyc-border, #d1d5db)",
2662
2675
  // ring color via outline on focus
2663
- ...c
2676
+ ...l
2664
2677
  },
2665
2678
  ...d,
2666
2679
  children: [
@@ -2677,7 +2690,7 @@ const K = ({ children: e, className: t, ...n }) => /* @__PURE__ */ r(
2677
2690
  },
2678
2691
  "__placeholder__"
2679
2692
  ),
2680
- a.map((p, x) => /* @__PURE__ */ r(
2693
+ a.map((p, b) => /* @__PURE__ */ r(
2681
2694
  "option",
2682
2695
  {
2683
2696
  value: p.value,
@@ -2688,7 +2701,7 @@ const K = ({ children: e, className: t, ...n }) => /* @__PURE__ */ r(
2688
2701
  },
2689
2702
  children: p.label
2690
2703
  },
2691
- p.value || `option-${x}`
2704
+ p.value || `option-${b}`
2692
2705
  ))
2693
2706
  ]
2694
2707
  }
@@ -2705,47 +2718,47 @@ const it = 280, Sr = ({
2705
2718
  options: a,
2706
2719
  placeholder: i = "Select...",
2707
2720
  disabled: o = !1,
2708
- required: c = !1
2721
+ required: l = !1
2709
2722
  }) => {
2710
- const [d, u] = b(!1), [p, x] = b(""), [N, m] = b(null), y = ee(null), h = ee(null), C = ee(null), F = Q(() => {
2723
+ const [d, u] = v(!1), [p, b] = v(""), [N, m] = v(null), x = ee(null), h = ee(null), C = ee(null), D = Q(() => {
2711
2724
  if (!h.current) return null;
2712
2725
  const w = h.current.getBoundingClientRect(), te = window.innerHeight - w.bottom < it && w.top > it;
2713
2726
  return { top: te ? w.top : w.bottom + 4, left: w.left, width: w.width, openUp: te };
2714
2727
  }, []), k = Q(() => {
2715
2728
  if (o) return;
2716
- const w = F();
2729
+ const w = D();
2717
2730
  w && m(w), u(!0);
2718
- }, [o, F]), $ = Q(() => {
2719
- u(!1), x("");
2731
+ }, [o, D]), z = Q(() => {
2732
+ u(!1), b("");
2720
2733
  }, []);
2721
2734
  ne(() => {
2722
2735
  if (!d) return;
2723
- const w = (U) => {
2724
- var B, D;
2725
- const te = U.target;
2726
- !((B = y.current) != null && B.contains(te)) && !((D = C.current) != null && D.contains(te)) && $();
2736
+ const w = (q) => {
2737
+ var B, F;
2738
+ const te = q.target;
2739
+ !((B = x.current) != null && B.contains(te)) && !((F = C.current) != null && F.contains(te)) && z();
2727
2740
  };
2728
2741
  return document.addEventListener("mousedown", w), () => document.removeEventListener("mousedown", w);
2729
- }, [d, $]), ne(() => {
2742
+ }, [d, z]), ne(() => {
2730
2743
  if (!d) return;
2731
2744
  const w = () => {
2732
- const U = F();
2733
- U && m(U);
2745
+ const q = D();
2746
+ q && m(q);
2734
2747
  };
2735
2748
  return window.addEventListener("scroll", w, !0), window.addEventListener("resize", w), () => {
2736
2749
  window.removeEventListener("scroll", w, !0), window.removeEventListener("resize", w);
2737
2750
  };
2738
- }, [d, F]);
2751
+ }, [d, D]);
2739
2752
  const A = a.filter(
2740
2753
  (w) => w.label.toLowerCase().includes(p.toLowerCase())
2741
2754
  ), I = (w) => {
2742
- o || n(t.includes(w) ? t.filter((U) => U !== w) : [...t, w]);
2743
- }, j = (w, U) => {
2744
- U.stopPropagation(), o || n(t.filter((te) => te !== w));
2745
- }, J = (w) => {
2746
- var U;
2747
- return ((U = a.find((te) => te.value === w)) == null ? void 0 : U.label) || w;
2748
- }, E = h.current ? getComputedStyle(h.current) : null, g = (E == null ? void 0 : E.getPropertyValue("--metakyc-input-bg").trim()) || "#ffffff", R = (E == null ? void 0 : E.getPropertyValue("--metakyc-border").trim()) || "#d1d5db", P = (E == null ? void 0 : E.getPropertyValue("--metakyc-text-primary").trim()) || "#111827", z = (E == null ? void 0 : E.getPropertyValue("--metakyc-text-secondary").trim()) || "#6b7280", _ = (E == null ? void 0 : E.getPropertyValue("--metakyc-primary").trim()) || "#2563eb", O = (E == null ? void 0 : E.getPropertyValue("--metakyc-primary-light").trim()) || "#eff6ff", M = (E == null ? void 0 : E.getPropertyValue("--metakyc-hover-bg").trim()) || "#f9fafb", Z = d && N && /* @__PURE__ */ s(
2755
+ o || n(t.includes(w) ? t.filter((q) => q !== w) : [...t, w]);
2756
+ }, j = (w, q) => {
2757
+ q.stopPropagation(), o || n(t.filter((te) => te !== w));
2758
+ }, G = (w) => {
2759
+ var q;
2760
+ return ((q = a.find((te) => te.value === w)) == null ? void 0 : q.label) || w;
2761
+ }, E = h.current ? getComputedStyle(h.current) : null, f = (E == null ? void 0 : E.getPropertyValue("--metakyc-input-bg").trim()) || "#ffffff", R = (E == null ? void 0 : E.getPropertyValue("--metakyc-border").trim()) || "#d1d5db", P = (E == null ? void 0 : E.getPropertyValue("--metakyc-text-primary").trim()) || "#111827", O = (E == null ? void 0 : E.getPropertyValue("--metakyc-text-secondary").trim()) || "#6b7280", H = (E == null ? void 0 : E.getPropertyValue("--metakyc-primary").trim()) || "#2563eb", M = (E == null ? void 0 : E.getPropertyValue("--metakyc-primary-light").trim()) || "#eff6ff", T = (E == null ? void 0 : E.getPropertyValue("--metakyc-hover-bg").trim()) || "#f9fafb", J = d && N && /* @__PURE__ */ s(
2749
2762
  "div",
2750
2763
  {
2751
2764
  ref: C,
@@ -2760,7 +2773,7 @@ const it = 280, Sr = ({
2760
2773
  borderRadius: "8px",
2761
2774
  boxShadow: "0 4px 16px rgba(0,0,0,0.18)",
2762
2775
  border: `1px solid ${R}`,
2763
- backgroundColor: g,
2776
+ backgroundColor: f,
2764
2777
  overflow: "hidden"
2765
2778
  },
2766
2779
  children: [
@@ -2769,7 +2782,7 @@ const it = 280, Sr = ({
2769
2782
  {
2770
2783
  type: "text",
2771
2784
  value: p,
2772
- onChange: (w) => x(w.target.value),
2785
+ onChange: (w) => b(w.target.value),
2773
2786
  placeholder: "Search...",
2774
2787
  autoFocus: !0,
2775
2788
  onClick: (w) => w.stopPropagation(),
@@ -2781,15 +2794,15 @@ const it = 280, Sr = ({
2781
2794
  fontSize: "13px",
2782
2795
  borderRadius: "6px",
2783
2796
  border: `1px solid ${R}`,
2784
- backgroundColor: g,
2797
+ backgroundColor: f,
2785
2798
  color: P,
2786
2799
  outline: "none",
2787
2800
  boxSizing: "border-box"
2788
2801
  }
2789
2802
  }
2790
2803
  ) }),
2791
- /* @__PURE__ */ r("ul", { style: { listStyle: "none", margin: 0, padding: "4px 0", maxHeight: "192px", overflowY: "auto" }, children: A.length === 0 ? /* @__PURE__ */ r("li", { style: { padding: "8px 12px", fontSize: "13px", color: z }, children: "No results" }) : A.map((w) => {
2792
- const U = t.includes(w.value);
2804
+ /* @__PURE__ */ r("ul", { style: { listStyle: "none", margin: 0, padding: "4px 0", maxHeight: "192px", overflowY: "auto" }, children: A.length === 0 ? /* @__PURE__ */ r("li", { style: { padding: "8px 12px", fontSize: "13px", color: O }, children: "No results" }) : A.map((w) => {
2805
+ const q = t.includes(w.value);
2793
2806
  return /* @__PURE__ */ s(
2794
2807
  "li",
2795
2808
  {
@@ -2802,24 +2815,24 @@ const it = 280, Sr = ({
2802
2815
  padding: "8px 12px",
2803
2816
  fontSize: "13px",
2804
2817
  cursor: "pointer",
2805
- backgroundColor: U ? O : "transparent",
2806
- color: U ? _ : P,
2818
+ backgroundColor: q ? M : "transparent",
2819
+ color: q ? H : P,
2807
2820
  userSelect: "none"
2808
2821
  },
2809
2822
  onMouseEnter: (te) => {
2810
- U || (te.currentTarget.style.backgroundColor = M);
2823
+ q || (te.currentTarget.style.backgroundColor = T);
2811
2824
  },
2812
2825
  onMouseLeave: (te) => {
2813
- U || (te.currentTarget.style.backgroundColor = "transparent");
2826
+ q || (te.currentTarget.style.backgroundColor = "transparent");
2814
2827
  },
2815
2828
  children: [
2816
2829
  /* @__PURE__ */ r(
2817
2830
  "input",
2818
2831
  {
2819
2832
  type: "checkbox",
2820
- checked: U,
2833
+ checked: q,
2821
2834
  readOnly: !0,
2822
- style: { accentColor: _, pointerEvents: "none", flexShrink: 0 }
2835
+ style: { accentColor: H, pointerEvents: "none", flexShrink: 0 }
2823
2836
  }
2824
2837
  ),
2825
2838
  /* @__PURE__ */ r("span", { children: w.label })
@@ -2833,7 +2846,7 @@ const it = 280, Sr = ({
2833
2846
  {
2834
2847
  type: "button",
2835
2848
  onClick: () => {
2836
- n([]), x("");
2849
+ n([]), b("");
2837
2850
  },
2838
2851
  style: { fontSize: "12px", color: "#ef4444", background: "none", border: "none", cursor: "pointer", padding: 0 },
2839
2852
  children: [
@@ -2846,7 +2859,7 @@ const it = 280, Sr = ({
2846
2859
  ]
2847
2860
  }
2848
2861
  );
2849
- return /* @__PURE__ */ s("div", { className: "w-full metakyc-multiselect", ref: y, children: [
2862
+ return /* @__PURE__ */ s("div", { className: "w-full metakyc-multiselect", ref: x, children: [
2850
2863
  e && /* @__PURE__ */ s(
2851
2864
  "label",
2852
2865
  {
@@ -2854,7 +2867,7 @@ const it = 280, Sr = ({
2854
2867
  style: { color: "var(--metakyc-text-primary, #374151)" },
2855
2868
  children: [
2856
2869
  e,
2857
- c && /* @__PURE__ */ r("span", { style: { color: "var(--metakyc-error, #ef4444)", marginLeft: "4px" }, children: "*" })
2870
+ l && /* @__PURE__ */ r("span", { style: { color: "var(--metakyc-error, #ef4444)", marginLeft: "4px" }, children: "*" })
2858
2871
  ]
2859
2872
  }
2860
2873
  ),
@@ -2862,7 +2875,7 @@ const it = 280, Sr = ({
2862
2875
  "div",
2863
2876
  {
2864
2877
  ref: h,
2865
- onClick: () => d ? $() : k(),
2878
+ onClick: () => d ? z() : k(),
2866
2879
  className: oe(
2867
2880
  "metakyc-multiselect-trigger",
2868
2881
  "min-h-[42px] w-full px-3 py-2 rounded-lg border text-sm transition-colors relative",
@@ -2891,12 +2904,12 @@ const it = 280, Sr = ({
2891
2904
  color: "var(--metakyc-primary, #2563eb)"
2892
2905
  },
2893
2906
  children: [
2894
- J(w),
2907
+ G(w),
2895
2908
  !o && /* @__PURE__ */ r(
2896
2909
  "button",
2897
2910
  {
2898
2911
  type: "button",
2899
- onClick: (U) => j(w, U),
2912
+ onClick: (q) => j(w, q),
2900
2913
  className: "metakyc-multiselect-chip-remove",
2901
2914
  style: {
2902
2915
  background: "transparent",
@@ -2935,7 +2948,7 @@ const it = 280, Sr = ({
2935
2948
  ]
2936
2949
  }
2937
2950
  ),
2938
- typeof document < "u" && Z ? Ve(Z, document.body) : null
2951
+ typeof document < "u" && J ? Ve(J, document.body) : null
2939
2952
  ] });
2940
2953
  }, st = 260, We = ({
2941
2954
  label: e,
@@ -2944,13 +2957,13 @@ const it = 280, Sr = ({
2944
2957
  options: a,
2945
2958
  placeholder: i = "Select...",
2946
2959
  value: o,
2947
- onChange: c,
2960
+ onChange: l,
2948
2961
  disabled: d = !1,
2949
2962
  required: u = !1,
2950
2963
  className: p
2951
2964
  }) => {
2952
- var D;
2953
- const [x, N] = b(!1), [m, y] = b(""), [h, C] = b(null), F = ee(null), k = ee(null), $ = ee(null), A = ee(null), I = Q(() => {
2965
+ var F;
2966
+ const [b, N] = v(!1), [m, x] = v(""), [h, C] = v(null), D = ee(null), k = ee(null), z = ee(null), A = ee(null), I = Q(() => {
2954
2967
  if (!k.current) return null;
2955
2968
  const S = k.current.getBoundingClientRect(), X = window.innerHeight - S.bottom < st && S.top > st;
2956
2969
  return {
@@ -2963,40 +2976,40 @@ const it = 280, Sr = ({
2963
2976
  if (d) return;
2964
2977
  const S = I();
2965
2978
  S && C(S), N(!0);
2966
- }, [d, I]), J = Q(() => {
2967
- N(!1), y("");
2968
- }, []), E = () => x ? J() : j();
2979
+ }, [d, I]), G = Q(() => {
2980
+ N(!1), x("");
2981
+ }, []), E = () => b ? G() : j();
2969
2982
  ne(() => {
2970
- if (!x) return;
2971
- const S = (H) => {
2983
+ if (!b) return;
2984
+ const S = (U) => {
2972
2985
  var Y, we;
2973
- const X = H.target;
2974
- !((Y = F.current) != null && Y.contains(X)) && !((we = $.current) != null && we.contains(X)) && J();
2986
+ const X = U.target;
2987
+ !((Y = D.current) != null && Y.contains(X)) && !((we = z.current) != null && we.contains(X)) && G();
2975
2988
  };
2976
2989
  return document.addEventListener("mousedown", S), () => document.removeEventListener("mousedown", S);
2977
- }, [x, J]), ne(() => {
2978
- if (!x) return;
2990
+ }, [b, G]), ne(() => {
2991
+ if (!b) return;
2979
2992
  const S = () => {
2980
- const H = I();
2981
- H && C(H);
2993
+ const U = I();
2994
+ U && C(U);
2982
2995
  };
2983
2996
  return window.addEventListener("scroll", S, !0), window.addEventListener("resize", S), () => {
2984
2997
  window.removeEventListener("scroll", S, !0), window.removeEventListener("resize", S);
2985
2998
  };
2986
- }, [x, I]), ne(() => {
2987
- x && A.current && setTimeout(() => {
2999
+ }, [b, I]), ne(() => {
3000
+ b && A.current && setTimeout(() => {
2988
3001
  var S;
2989
3002
  return (S = A.current) == null ? void 0 : S.focus();
2990
3003
  }, 0);
2991
- }, [x]);
2992
- const g = a.filter(
3004
+ }, [b]);
3005
+ const f = a.filter(
2993
3006
  (S) => S.label.toLowerCase().includes(m.toLowerCase()) || S.value.toLowerCase().includes(m.toLowerCase())
2994
- ), R = (D = a.find((S) => S.value === o)) == null ? void 0 : D.label, P = (S, H) => {
2995
- d || H || (c(S), J());
2996
- }, z = k.current ? getComputedStyle(k.current) : null, _ = (z == null ? void 0 : z.getPropertyValue("--metakyc-input-bg").trim()) || "#ffffff", O = (z == null ? void 0 : z.getPropertyValue("--metakyc-border").trim()) || "#d1d5db", M = (z == null ? void 0 : z.getPropertyValue("--metakyc-text-primary").trim()) || "#111827", Z = (z == null ? void 0 : z.getPropertyValue("--metakyc-text-secondary").trim()) || "#6b7280", w = (z == null ? void 0 : z.getPropertyValue("--metakyc-primary").trim()) || "#2563eb", U = (z == null ? void 0 : z.getPropertyValue("--metakyc-primary-light").trim()) || "#eff6ff", te = (z == null ? void 0 : z.getPropertyValue("--metakyc-hover-bg").trim()) || "#f9fafb", B = x && h && /* @__PURE__ */ s(
3007
+ ), R = (F = a.find((S) => S.value === o)) == null ? void 0 : F.label, P = (S, U) => {
3008
+ d || U || (l(S), G());
3009
+ }, O = k.current ? getComputedStyle(k.current) : null, H = (O == null ? void 0 : O.getPropertyValue("--metakyc-input-bg").trim()) || "#ffffff", M = (O == null ? void 0 : O.getPropertyValue("--metakyc-border").trim()) || "#d1d5db", T = (O == null ? void 0 : O.getPropertyValue("--metakyc-text-primary").trim()) || "#111827", J = (O == null ? void 0 : O.getPropertyValue("--metakyc-text-secondary").trim()) || "#6b7280", w = (O == null ? void 0 : O.getPropertyValue("--metakyc-primary").trim()) || "#2563eb", q = (O == null ? void 0 : O.getPropertyValue("--metakyc-primary-light").trim()) || "#eff6ff", te = (O == null ? void 0 : O.getPropertyValue("--metakyc-hover-bg").trim()) || "#f9fafb", B = b && h && /* @__PURE__ */ s(
2997
3010
  "div",
2998
3011
  {
2999
- ref: $,
3012
+ ref: z,
3000
3013
  className: "metakyc-searchable-select-dropdown",
3001
3014
  style: {
3002
3015
  position: "fixed",
@@ -3007,18 +3020,18 @@ const it = 280, Sr = ({
3007
3020
  zIndex: 99999,
3008
3021
  borderRadius: "8px",
3009
3022
  boxShadow: "0 4px 16px rgba(0,0,0,0.18)",
3010
- border: `1px solid ${O}`,
3011
- backgroundColor: _,
3023
+ border: `1px solid ${M}`,
3024
+ backgroundColor: H,
3012
3025
  overflow: "hidden"
3013
3026
  },
3014
3027
  children: [
3015
- /* @__PURE__ */ r("div", { style: { padding: "8px", borderBottom: `1px solid ${O}` }, children: /* @__PURE__ */ r(
3028
+ /* @__PURE__ */ r("div", { style: { padding: "8px", borderBottom: `1px solid ${M}` }, children: /* @__PURE__ */ r(
3016
3029
  "input",
3017
3030
  {
3018
3031
  ref: A,
3019
3032
  type: "text",
3020
3033
  value: m,
3021
- onChange: (S) => y(S.target.value),
3034
+ onChange: (S) => x(S.target.value),
3022
3035
  placeholder: "Search...",
3023
3036
  onClick: (S) => S.stopPropagation(),
3024
3037
  className: "metakyc-searchable-select-search w-full",
@@ -3028,9 +3041,9 @@ const it = 280, Sr = ({
3028
3041
  padding: "6px 8px",
3029
3042
  fontSize: "13px",
3030
3043
  borderRadius: "6px",
3031
- border: `1px solid ${O}`,
3032
- backgroundColor: _,
3033
- color: M,
3044
+ border: `1px solid ${M}`,
3045
+ backgroundColor: H,
3046
+ color: T,
3034
3047
  outline: "none",
3035
3048
  boxSizing: "border-box"
3036
3049
  }
@@ -3046,8 +3059,8 @@ const it = 280, Sr = ({
3046
3059
  maxHeight: "208px",
3047
3060
  overflowY: "auto"
3048
3061
  },
3049
- children: g.length === 0 ? /* @__PURE__ */ r("li", { style: { padding: "8px 12px", fontSize: "13px", color: Z }, children: "No results" }) : g.map((S) => {
3050
- const H = S.value === o;
3062
+ children: f.length === 0 ? /* @__PURE__ */ r("li", { style: { padding: "8px 12px", fontSize: "13px", color: J }, children: "No results" }) : f.map((S) => {
3063
+ const U = S.value === o;
3051
3064
  return /* @__PURE__ */ r(
3052
3065
  "li",
3053
3066
  {
@@ -3058,15 +3071,15 @@ const it = 280, Sr = ({
3058
3071
  fontSize: "13px",
3059
3072
  cursor: S.disabled ? "not-allowed" : "pointer",
3060
3073
  opacity: S.disabled ? 0.4 : 1,
3061
- backgroundColor: H ? U : "transparent",
3062
- color: H ? w : M,
3074
+ backgroundColor: U ? q : "transparent",
3075
+ color: U ? w : T,
3063
3076
  userSelect: "none"
3064
3077
  },
3065
3078
  onMouseEnter: (X) => {
3066
- !H && !S.disabled && (X.currentTarget.style.backgroundColor = te);
3079
+ !U && !S.disabled && (X.currentTarget.style.backgroundColor = te);
3067
3080
  },
3068
3081
  onMouseLeave: (X) => {
3069
- H || (X.currentTarget.style.backgroundColor = "transparent");
3082
+ U || (X.currentTarget.style.backgroundColor = "transparent");
3070
3083
  },
3071
3084
  children: S.label
3072
3085
  },
@@ -3082,7 +3095,7 @@ const it = 280, Sr = ({
3082
3095
  "div",
3083
3096
  {
3084
3097
  className: oe("w-full metakyc-searchable-select", p),
3085
- ref: F,
3098
+ ref: D,
3086
3099
  children: [
3087
3100
  e && /* @__PURE__ */ s(
3088
3101
  "label",
@@ -3103,7 +3116,7 @@ const it = 280, Sr = ({
3103
3116
  tabIndex: d ? -1 : 0,
3104
3117
  onClick: E,
3105
3118
  onKeyDown: (S) => {
3106
- (S.key === "Enter" || S.key === " ") && (S.preventDefault(), E()), S.key === "Escape" && J();
3119
+ (S.key === "Enter" || S.key === " ") && (S.preventDefault(), E()), S.key === "Escape" && G();
3107
3120
  },
3108
3121
  className: oe(
3109
3122
  "metakyc-searchable-select-trigger",
@@ -3115,9 +3128,9 @@ const it = 280, Sr = ({
3115
3128
  style: {
3116
3129
  backgroundColor: "var(--metakyc-input-bg, #ffffff)",
3117
3130
  color: R ? "var(--metakyc-text-primary, #111827)" : "var(--metakyc-text-secondary, #9ca3af)",
3118
- borderColor: t ? "var(--metakyc-error, #ef4444)" : x ? "var(--metakyc-primary, #2563eb)" : "var(--metakyc-border, #d1d5db)",
3131
+ borderColor: t ? "var(--metakyc-error, #ef4444)" : b ? "var(--metakyc-primary, #2563eb)" : "var(--metakyc-border, #d1d5db)",
3119
3132
  minHeight: "42px",
3120
- outline: x ? "2px solid var(--metakyc-primary, #2563eb)" : "none",
3133
+ outline: b ? "2px solid var(--metakyc-primary, #2563eb)" : "none",
3121
3134
  outlineOffset: "-1px"
3122
3135
  },
3123
3136
  children: [
@@ -3127,7 +3140,7 @@ const it = 280, Sr = ({
3127
3140
  {
3128
3141
  className: "flex-shrink-0 text-xs pointer-events-none",
3129
3142
  style: { color: "var(--metakyc-text-secondary, #6b7280)" },
3130
- children: x ? "▲" : "▼"
3143
+ children: b ? "▲" : "▼"
3131
3144
  }
3132
3145
  )
3133
3146
  ]
@@ -3148,30 +3161,30 @@ const Cr = ({
3148
3161
  multiple: a = !1,
3149
3162
  maxSize: i,
3150
3163
  onChange: o,
3151
- value: c = [],
3164
+ value: l = [],
3152
3165
  className: d
3153
3166
  }) => {
3154
- const [u, p] = b(!1), x = ee(null), N = (k) => {
3167
+ const [u, p] = v(!1), b = ee(null), N = (k) => {
3155
3168
  if (!k) return;
3156
- const $ = Array.from(k);
3157
- if (i && $.filter((I) => I.size > i).length > 0) {
3169
+ const z = Array.from(k);
3170
+ if (i && z.filter((I) => I.size > i).length > 0) {
3158
3171
  const I = Ye(i);
3159
3172
  alert(`Some files exceed the maximum size of ${I}`);
3160
3173
  return;
3161
3174
  }
3162
- o == null || o(a ? [...c, ...$] : [$[0]]);
3175
+ o == null || o(a ? [...l, ...z] : [z[0]]);
3163
3176
  }, m = (k) => {
3164
3177
  k.preventDefault(), p(!0);
3165
- }, y = () => {
3178
+ }, x = () => {
3166
3179
  p(!1);
3167
3180
  }, h = (k) => {
3168
3181
  k.preventDefault(), p(!1), N(k.dataTransfer.files);
3169
3182
  }, C = () => {
3170
3183
  var k;
3171
- (k = x.current) == null || k.click();
3172
- }, F = (k) => {
3173
- const $ = c.filter((A, I) => I !== k);
3174
- o == null || o($);
3184
+ (k = b.current) == null || k.click();
3185
+ }, D = (k) => {
3186
+ const z = l.filter((A, I) => I !== k);
3187
+ o == null || o(z);
3175
3188
  };
3176
3189
  return /* @__PURE__ */ s("div", { className: oe("w-full", d), children: [
3177
3190
  e && /* @__PURE__ */ r("label", { className: "block text-sm font-medium text-gray-700 dark:text-gray-300 mb-1", children: e }),
@@ -3184,14 +3197,14 @@ const Cr = ({
3184
3197
  t && "border-danger-500"
3185
3198
  ),
3186
3199
  onDragOver: m,
3187
- onDragLeave: y,
3200
+ onDragLeave: x,
3188
3201
  onDrop: h,
3189
3202
  onClick: C,
3190
3203
  children: [
3191
3204
  /* @__PURE__ */ r(
3192
3205
  "input",
3193
3206
  {
3194
- ref: x,
3207
+ ref: b,
3195
3208
  type: "file",
3196
3209
  className: "hidden",
3197
3210
  accept: n,
@@ -3230,7 +3243,7 @@ const Cr = ({
3230
3243
  ]
3231
3244
  }
3232
3245
  ),
3233
- c.length > 0 && /* @__PURE__ */ r("div", { className: "mt-3 space-y-2", children: c.map((k, $) => /* @__PURE__ */ s(
3246
+ l.length > 0 && /* @__PURE__ */ r("div", { className: "mt-3 space-y-2", children: l.map((k, z) => /* @__PURE__ */ s(
3234
3247
  "div",
3235
3248
  {
3236
3249
  className: "flex items-center justify-between px-3 py-2 bg-gray-50 dark:bg-gray-700 rounded-lg",
@@ -3264,7 +3277,7 @@ const Cr = ({
3264
3277
  {
3265
3278
  type: "button",
3266
3279
  onClick: (A) => {
3267
- A.stopPropagation(), F($);
3280
+ A.stopPropagation(), D(z);
3268
3281
  },
3269
3282
  className: "ml-2 text-danger-500 hover:text-danger-700 focus:outline-none",
3270
3283
  children: /* @__PURE__ */ r("svg", { className: "h-5 w-5", fill: "currentColor", viewBox: "0 0 20 20", children: /* @__PURE__ */ r(
@@ -3279,16 +3292,23 @@ const Cr = ({
3279
3292
  )
3280
3293
  ]
3281
3294
  },
3282
- $
3295
+ z
3283
3296
  )) }),
3284
3297
  t && /* @__PURE__ */ r("p", { className: "mt-1 text-sm text-danger-500", children: t })
3285
3298
  ] });
3286
3299
  }, Ar = Ue(
3287
3300
  ({ countryCode: e = "+1", onCountryCodeChange: t, className: n, ...a }, i) => /* @__PURE__ */ s("div", { className: "w-full", children: [
3288
- a.label && /* @__PURE__ */ s("label", { className: "block text-sm font-medium text-gray-700 dark:text-gray-300 mb-1", children: [
3289
- a.label,
3290
- a.required && /* @__PURE__ */ r("span", { className: "text-danger-500 ml-1", children: "*" })
3291
- ] }),
3301
+ a.label && /* @__PURE__ */ s(
3302
+ "label",
3303
+ {
3304
+ className: "block text-sm font-medium mb-1",
3305
+ style: { color: "var(--metakyc-text-primary, #374151)" },
3306
+ children: [
3307
+ a.label,
3308
+ a.required && /* @__PURE__ */ r("span", { className: "text-danger-500 ml-1", children: "*" })
3309
+ ]
3310
+ }
3311
+ ),
3292
3312
  /* @__PURE__ */ s("div", { className: "flex gap-2", children: [
3293
3313
  /* @__PURE__ */ r(
3294
3314
  "input",
@@ -3298,9 +3318,13 @@ const Cr = ({
3298
3318
  onChange: (o) => t == null ? void 0 : t(o.target.value),
3299
3319
  className: oe(
3300
3320
  "w-20 rounded-lg border px-3 py-2 text-sm",
3301
- "focus:outline-none focus:ring-2 focus:ring-primary-500 focus:border-transparent",
3302
- "border-gray-300 dark:border-gray-600 dark:bg-gray-800 dark:text-white"
3321
+ "focus:outline-none focus:ring-2 focus:ring-offset-0"
3303
3322
  ),
3323
+ style: {
3324
+ backgroundColor: "var(--metakyc-input-bg, #ffffff)",
3325
+ color: "var(--metakyc-text-primary, #111827)",
3326
+ borderColor: "var(--metakyc-border, #d1d5db)"
3327
+ },
3304
3328
  placeholder: "+1"
3305
3329
  }
3306
3330
  ),
@@ -3396,7 +3420,7 @@ const Dr = Ue(
3396
3420
  absoluteStrokeWidth: a,
3397
3421
  className: i = "",
3398
3422
  children: o,
3399
- iconNode: c,
3423
+ iconNode: l,
3400
3424
  ...d
3401
3425
  }, u) => Qe(
3402
3426
  "svg",
@@ -3412,7 +3436,7 @@ const Dr = Ue(
3412
3436
  ...d
3413
3437
  },
3414
3438
  [
3415
- ...c.map(([p, x]) => Qe(p, x)),
3439
+ ...l.map(([p, b]) => Qe(p, b)),
3416
3440
  ...Array.isArray(o) ? o : [o]
3417
3441
  ]
3418
3442
  )
@@ -3483,7 +3507,7 @@ function Tr(e, t) {
3483
3507
  }
3484
3508
  function Mr(e) {
3485
3509
  const t = e.flatMap(
3486
- (a, i) => (a.questions ?? []).map((o, c) => ({ question: o, groupIndex: i, qIdx: c }))
3510
+ (a, i) => (a.questions ?? []).map((o, l) => ({ question: o, groupIndex: i, qIdx: l }))
3487
3511
  ), n = /* @__PURE__ */ new Map();
3488
3512
  for (const a of t) {
3489
3513
  const i = a.question.pageNumber != null && a.question.pageNumber > 0 ? a.question.pageNumber : 1;
@@ -3496,30 +3520,30 @@ const Or = ({
3496
3520
  onComplete: t,
3497
3521
  onBack: n
3498
3522
  }) => {
3499
- const { questionnaire: a, initialAnswers: i, isLoading: o, isSubmitting: c, error: d, submit: u } = xr(e), [p, x] = b({}), [N, m] = b({}), [y, h] = b(0);
3523
+ const { questionnaire: a, initialAnswers: i, isLoading: o, isSubmitting: l, error: d, submit: u } = xr(e), [p, b] = v({}), [N, m] = v({}), [x, h] = v(0);
3500
3524
  ge.useEffect(() => {
3501
- i && Object.keys(i).length > 0 && Object.keys(p).length === 0 && x(i);
3525
+ i && Object.keys(i).length > 0 && Object.keys(p).length === 0 && b(i);
3502
3526
  }, [i]);
3503
3527
  const C = Ee(
3504
3528
  () => a ? Mr(a.questionGroups) : [],
3505
3529
  [a]
3506
- ), F = y === C.length - 1, k = C[y] ?? [], $ = Q((E, g) => {
3507
- x((R) => ({ ...R, [E]: g })), m((R) => {
3530
+ ), D = x === C.length - 1, k = C[x] ?? [], z = Q((E, f) => {
3531
+ b((R) => ({ ...R, [E]: f })), m((R) => {
3508
3532
  const P = { ...R };
3509
3533
  return delete P[E], P;
3510
3534
  });
3511
3535
  }, []), A = Q(() => {
3512
3536
  const E = {};
3513
- for (const { question: g } of k) {
3514
- const R = Tr(g, p[g.id] ?? []);
3515
- R && (E[g.id] = R);
3537
+ for (const { question: f } of k) {
3538
+ const R = Tr(f, p[f.id] ?? []);
3539
+ R && (E[f.id] = R);
3516
3540
  }
3517
- return m((g) => ({ ...g, ...E })), Object.keys(E).length === 0;
3541
+ return m((f) => ({ ...f, ...E })), Object.keys(E).length === 0;
3518
3542
  }, [k, p]), I = () => {
3519
3543
  A() && h((E) => E + 1);
3520
3544
  }, j = () => {
3521
- y > 0 ? h((E) => E - 1) : n == null || n();
3522
- }, J = async () => {
3545
+ x > 0 ? h((E) => E - 1) : n == null || n();
3546
+ }, G = async () => {
3523
3547
  if (!(!A() || !a))
3524
3548
  try {
3525
3549
  const E = a.questionGroups.flatMap(
@@ -3527,17 +3551,17 @@ const Or = ({
3527
3551
  questionId: P.id,
3528
3552
  values: p[P.id] ?? []
3529
3553
  }))
3530
- ), g = {
3554
+ ), f = {
3531
3555
  applicantId: e,
3532
3556
  questionnarieId: a.id,
3533
3557
  questionResults: E
3534
3558
  };
3535
- await u(g), t == null || t();
3559
+ await u(f), t == null || t();
3536
3560
  } catch (E) {
3537
3561
  console.error("Questionnaire submit error:", E);
3538
3562
  }
3539
3563
  };
3540
- return o ? /* @__PURE__ */ r(K, { children: /* @__PURE__ */ r(W, { children: /* @__PURE__ */ r(be, { className: "my-8" }) }) }) : d ? /* @__PURE__ */ r(K, { children: /* @__PURE__ */ r(W, { children: /* @__PURE__ */ s("p", { className: "text-danger-500", children: [
3564
+ return o ? /* @__PURE__ */ r(K, { children: /* @__PURE__ */ r(W, { children: /* @__PURE__ */ r(ve, { className: "my-8" }) }) }) : d ? /* @__PURE__ */ r(K, { children: /* @__PURE__ */ r(W, { children: /* @__PURE__ */ s("p", { className: "text-danger-500", children: [
3541
3565
  "Error loading questionnaire: ",
3542
3566
  d.message
3543
3567
  ] }) }) }) : a ? /* @__PURE__ */ s(K, { children: [
@@ -3547,21 +3571,21 @@ const Or = ({
3547
3571
  C.length > 1 && /* @__PURE__ */ s("div", { className: "flex items-center justify-between mt-3", children: [
3548
3572
  /* @__PURE__ */ s("span", { className: "text-xs", style: { color: "var(--metakyc-text-muted, #9ca3af)" }, children: [
3549
3573
  "Page ",
3550
- y + 1,
3574
+ x + 1,
3551
3575
  " of ",
3552
3576
  C.length
3553
3577
  ] }),
3554
- /* @__PURE__ */ r("div", { className: "flex items-center gap-1.5", children: C.map((E, g) => /* @__PURE__ */ r(
3578
+ /* @__PURE__ */ r("div", { className: "flex items-center gap-1.5", children: C.map((E, f) => /* @__PURE__ */ r(
3555
3579
  "div",
3556
3580
  {
3557
3581
  className: "rounded-full transition-all duration-200",
3558
3582
  style: {
3559
3583
  height: "6px",
3560
- width: g === y ? "20px" : "6px",
3561
- backgroundColor: g <= y ? "var(--metakyc-primary, #2563eb)" : "var(--metakyc-border, #e5e7eb)"
3584
+ width: f === x ? "20px" : "6px",
3585
+ backgroundColor: f <= x ? "var(--metakyc-primary, #2563eb)" : "var(--metakyc-border, #e5e7eb)"
3562
3586
  }
3563
3587
  },
3564
- g
3588
+ f
3565
3589
  )) })
3566
3590
  ] })
3567
3591
  ] }),
@@ -3571,13 +3595,13 @@ const Or = ({
3571
3595
  question: E,
3572
3596
  value: p[E.id] ?? [],
3573
3597
  error: N[E.id],
3574
- onChange: (g) => $(E.id, g)
3598
+ onChange: (f) => z(E.id, f)
3575
3599
  },
3576
3600
  E.id
3577
3601
  )) }),
3578
3602
  /* @__PURE__ */ s(pe, { className: "flex items-center justify-between", children: [
3579
3603
  /* @__PURE__ */ s(
3580
- V,
3604
+ Z,
3581
3605
  {
3582
3606
  type: "button",
3583
3607
  variant: "outline",
@@ -3585,20 +3609,20 @@ const Or = ({
3585
3609
  style: { display: "flex", alignItems: "center", gap: "4px" },
3586
3610
  children: [
3587
3611
  /* @__PURE__ */ r(gt, { size: 14 }),
3588
- y > 0 ? "Previous" : "Back"
3612
+ x > 0 ? "Previous" : "Back"
3589
3613
  ]
3590
3614
  }
3591
3615
  ),
3592
- F ? /* @__PURE__ */ r(
3593
- V,
3616
+ D ? /* @__PURE__ */ r(
3617
+ Z,
3594
3618
  {
3595
3619
  type: "button",
3596
- isLoading: c,
3597
- onClick: J,
3620
+ isLoading: l,
3621
+ onClick: G,
3598
3622
  children: "Continue"
3599
3623
  }
3600
3624
  ) : /* @__PURE__ */ s(
3601
- V,
3625
+ Z,
3602
3626
  {
3603
3627
  type: "button",
3604
3628
  onClick: I,
@@ -3613,8 +3637,8 @@ const Or = ({
3613
3637
  d && /* @__PURE__ */ r("div", { className: "mx-6 mb-4 p-3 bg-red-50 border border-red-200 rounded", children: /* @__PURE__ */ r("p", { className: "text-red-600 text-sm", children: d.message }) })
3614
3638
  ] }) : null;
3615
3639
  }, zr = ({ question: e, value: t, error: n, onChange: a }) => {
3616
- var c;
3617
- const o = (((c = e.defaultAnswers) == null ? void 0 : c.length) ?? 0) > 0 ? e.showAsDropdown ? e.canMultipleAnswer ? "multi-select" : "single-select" : e.canMultipleAnswer ? "checkbox" : "radio" : "text";
3640
+ var l;
3641
+ const o = (((l = e.defaultAnswers) == null ? void 0 : l.length) ?? 0) > 0 ? e.showAsDropdown ? e.canMultipleAnswer ? "multi-select" : "single-select" : e.canMultipleAnswer ? "checkbox" : "radio" : "text";
3618
3642
  return /* @__PURE__ */ s("div", { className: "space-y-2", children: [
3619
3643
  /* @__PURE__ */ s("label", { className: "block text-sm font-medium", style: { color: "var(--metakyc-text-primary, #111827)" }, children: [
3620
3644
  e.text,
@@ -3724,11 +3748,11 @@ const Or = ({
3724
3748
  onComplete: t,
3725
3749
  onBack: n
3726
3750
  }) => {
3727
- const { uploadDocument: a, isLoading: i, isSubmitting: o, error: c, submit: d } = br(e), [u, p] = b({}), x = async (N) => {
3751
+ const { uploadDocument: a, isLoading: i, isSubmitting: o, error: l, submit: d } = br(e), [u, p] = v({}), b = async (N) => {
3728
3752
  if (N.preventDefault(), !a) return;
3729
3753
  const m = await Promise.all(
3730
3754
  a.uploadDocumentFiles.map(async (h) => {
3731
- const C = u[h.id] || [], F = await Promise.all(
3755
+ const C = u[h.id] || [], D = await Promise.all(
3732
3756
  C.map(async (k) => ({
3733
3757
  fileName: k.name,
3734
3758
  fileData: await ur(k)
@@ -3736,20 +3760,20 @@ const Or = ({
3736
3760
  );
3737
3761
  return {
3738
3762
  uploadDocumentFileId: h.id,
3739
- valueList: F
3763
+ valueList: D
3740
3764
  };
3741
3765
  })
3742
- ), y = {
3766
+ ), x = {
3743
3767
  applicantId: e,
3744
3768
  uploadDocumentId: a.id,
3745
3769
  uploadDocumentResults: m
3746
3770
  };
3747
- await d(y), t == null || t();
3771
+ await d(x), t == null || t();
3748
3772
  };
3749
- return i ? /* @__PURE__ */ r(K, { children: /* @__PURE__ */ r(W, { children: /* @__PURE__ */ r(be, { className: "my-8" }) }) }) : c ? /* @__PURE__ */ r(K, { children: /* @__PURE__ */ r(W, { children: /* @__PURE__ */ s("p", { className: "text-danger-500", children: [
3773
+ return i ? /* @__PURE__ */ r(K, { children: /* @__PURE__ */ r(W, { children: /* @__PURE__ */ r(ve, { className: "my-8" }) }) }) : l ? /* @__PURE__ */ r(K, { children: /* @__PURE__ */ r(W, { children: /* @__PURE__ */ s("p", { className: "text-danger-500", children: [
3750
3774
  "Error loading document requirements: ",
3751
- c.message
3752
- ] }) }) }) : a ? /* @__PURE__ */ r("form", { onSubmit: x, children: /* @__PURE__ */ s(K, { children: [
3775
+ l.message
3776
+ ] }) }) }) : a ? /* @__PURE__ */ r("form", { onSubmit: b, children: /* @__PURE__ */ s(K, { children: [
3753
3777
  /* @__PURE__ */ s(de, { children: [
3754
3778
  /* @__PURE__ */ r("h2", { className: "text-lg font-bold", children: a.displayName }),
3755
3779
  a.subtitle && /* @__PURE__ */ r("p", { className: "text-gray-600 dark:text-gray-400 mt-1", children: a.subtitle })
@@ -3763,29 +3787,29 @@ const Or = ({
3763
3787
  maxSize: N.maxEachFileSizeByte,
3764
3788
  value: u[N.id] || [],
3765
3789
  onChange: (m) => {
3766
- p((y) => ({ ...y, [N.id]: m }));
3790
+ p((x) => ({ ...x, [N.id]: m }));
3767
3791
  }
3768
3792
  },
3769
3793
  N.id
3770
3794
  )) }),
3771
3795
  /* @__PURE__ */ s(pe, { className: "flex justify-between", children: [
3772
- n && /* @__PURE__ */ r(V, { type: "button", variant: "outline", onClick: n, children: "Back" }),
3773
- /* @__PURE__ */ r(V, { type: "submit", isLoading: o, children: "Continue" })
3796
+ n && /* @__PURE__ */ r(Z, { type: "button", variant: "outline", onClick: n, children: "Back" }),
3797
+ /* @__PURE__ */ r(Z, { type: "submit", isLoading: o, children: "Continue" })
3774
3798
  ] })
3775
3799
  ] }) }) : null;
3776
3800
  }, Br = ({ applicantId: e, onComplete: t, onBack: n }) => {
3777
- const { overview: a, isLoading: i, isSubmitting: o, error: c, passOverview: d } = vr(e), u = async () => {
3801
+ const { overview: a, isLoading: i, isSubmitting: o, error: l, passOverview: d } = vr(e), u = async () => {
3778
3802
  await d(), t == null || t();
3779
3803
  };
3780
- return i ? /* @__PURE__ */ r(K, { children: /* @__PURE__ */ r(W, { children: /* @__PURE__ */ r(be, { className: "my-8" }) }) }) : c ? /* @__PURE__ */ r(K, { children: /* @__PURE__ */ r(W, { children: /* @__PURE__ */ s("p", { className: "text-danger-500", children: [
3804
+ return i ? /* @__PURE__ */ r(K, { children: /* @__PURE__ */ r(W, { children: /* @__PURE__ */ r(ve, { className: "my-8" }) }) }) : l ? /* @__PURE__ */ r(K, { children: /* @__PURE__ */ r(W, { children: /* @__PURE__ */ s("p", { className: "text-danger-500", children: [
3781
3805
  "Error loading overview: ",
3782
- c.message
3806
+ l.message
3783
3807
  ] }) }) }) : a ? /* @__PURE__ */ s(K, { children: [
3784
3808
  /* @__PURE__ */ s(de, { children: [
3785
3809
  /* @__PURE__ */ r("h2", { className: "text-lg font-bold", children: a.title || "Overview" }),
3786
3810
  a.description && /* @__PURE__ */ r("p", { className: "text-gray-600 dark:text-gray-400 mt-1", children: a.description })
3787
3811
  ] }),
3788
- /* @__PURE__ */ r(W, { className: "space-y-8", children: a.steps && a.steps.length > 0 ? a.steps.sort((p, x) => p.order - x.order).map((p) => /* @__PURE__ */ s("div", { className: "metakyc-overview-step-item flex items-center space-x-3", children: [
3812
+ /* @__PURE__ */ r(W, { className: "space-y-8", children: a.steps && a.steps.length > 0 ? a.steps.sort((p, b) => p.order - b.order).map((p) => /* @__PURE__ */ s("div", { className: "metakyc-overview-step-item flex items-center space-x-3", children: [
3789
3813
  /* @__PURE__ */ r("div", { className: "metakyc-step-icon flex-shrink-0", children: /* @__PURE__ */ r("div", { className: "w-8 h-8 rounded-full bg-primary-500 text-white flex items-center justify-center font-medium text-sm", children: p.order + 1 }) }),
3790
3814
  /* @__PURE__ */ s(
3791
3815
  "div",
@@ -3805,8 +3829,8 @@ const Or = ({
3805
3829
  )
3806
3830
  ] }, p.order)) : /* @__PURE__ */ r("div", { className: "text-center py-8", children: /* @__PURE__ */ r("p", { className: "text-gray-600 dark:text-gray-400", children: "Loading overview data..." }) }) }),
3807
3831
  /* @__PURE__ */ s(pe, { className: "flex justify-between", children: [
3808
- n && /* @__PURE__ */ r(V, { type: "button", variant: "outline", onClick: n, children: "Back" }),
3809
- /* @__PURE__ */ r(V, { onClick: u, isLoading: o, children: "Continue" })
3832
+ n && /* @__PURE__ */ r(Z, { type: "button", variant: "outline", onClick: n, children: "Back" }),
3833
+ /* @__PURE__ */ r(Z, { onClick: u, isLoading: o, children: "Continue" })
3810
3834
  ] })
3811
3835
  ] }) : null;
3812
3836
  };
@@ -3855,50 +3879,50 @@ const jr = ({
3855
3879
  onComplete: t,
3856
3880
  onBack: n
3857
3881
  }) => {
3858
- const { criteria: a, initialAnswers: i, isLoading: o, isSubmitting: c, error: d, submit: u } = wr(e), [p, x] = b({}), [N, m] = b({}), [y, h] = b(0), [C, F] = b(!1);
3882
+ const { criteria: a, initialAnswers: i, isLoading: o, isSubmitting: l, error: d, submit: u } = wr(e), [p, b] = v({}), [N, m] = v({}), [x, h] = v(0), [C, D] = v(!1);
3859
3883
  ge.useEffect(() => {
3860
- i && Object.keys(i).length > 0 && Object.keys(p).length === 0 && x(i);
3884
+ i && Object.keys(i).length > 0 && Object.keys(p).length === 0 && b(i);
3861
3885
  }, [i]);
3862
3886
  const k = Ee(
3863
3887
  () => a && a.length > 0 ? Hr(a) : [],
3864
3888
  [a]
3865
- ), $ = y === k.length - 1, A = k[y] ?? [];
3889
+ ), z = x === k.length - 1, A = k[x] ?? [];
3866
3890
  ge.useEffect(() => {
3867
- !o && a && a.length === 0 && !C && !c && (F(!0), u({ applicantId: e, criteriaValueInputs: [] }).then(() => t == null ? void 0 : t()).catch(console.error));
3868
- }, [o, a, C, c, u, e, t]);
3891
+ !o && a && a.length === 0 && !C && !l && (D(!0), u({ applicantId: e, criteriaValueInputs: [] }).then(() => t == null ? void 0 : t()).catch(console.error));
3892
+ }, [o, a, C, l, u, e, t]);
3869
3893
  const I = Q((R, P) => {
3870
- x((z) => ({ ...z, [R]: P })), m((z) => {
3871
- const _ = { ...z };
3872
- return delete _[R], _;
3894
+ b((O) => ({ ...O, [R]: P })), m((O) => {
3895
+ const H = { ...O };
3896
+ return delete H[R], H;
3873
3897
  });
3874
3898
  }, []), j = Q(() => {
3875
3899
  const R = {};
3876
3900
  for (const { criterion: P } of A) {
3877
- const z = _r(P, p[P.id] ?? []);
3878
- z && (R[P.id] = z);
3901
+ const O = _r(P, p[P.id] ?? []);
3902
+ O && (R[P.id] = O);
3879
3903
  }
3880
3904
  return m((P) => ({ ...P, ...R })), Object.keys(R).length === 0;
3881
- }, [A, p]), J = () => {
3905
+ }, [A, p]), G = () => {
3882
3906
  j() && h((R) => R + 1);
3883
3907
  }, E = () => {
3884
- y > 0 ? h((R) => R - 1) : n == null || n();
3885
- }, g = async () => {
3908
+ x > 0 ? h((R) => R - 1) : n == null || n();
3909
+ }, f = async () => {
3886
3910
  if (!(!j() || !a))
3887
3911
  try {
3888
- const R = a.map((z) => {
3889
- const _ = (p[z.id] ?? []).filter((O) => O && O.trim());
3890
- return _.length > 0 ? { riskCriteriaId: z.id, values: _ } : null;
3891
- }).filter((z) => z !== null);
3912
+ const R = a.map((O) => {
3913
+ const H = (p[O.id] ?? []).filter((M) => M && M.trim());
3914
+ return H.length > 0 ? { riskCriteriaId: O.id, values: H } : null;
3915
+ }).filter((O) => O !== null);
3892
3916
  await u({ applicantId: e, criteriaValueInputs: R }), t == null || t();
3893
3917
  } catch (R) {
3894
3918
  console.error("Risk scoring submit error:", R);
3895
3919
  }
3896
3920
  };
3897
3921
  return o ? /* @__PURE__ */ r(K, { children: /* @__PURE__ */ s(W, { children: [
3898
- /* @__PURE__ */ r(be, { className: "my-8" }),
3922
+ /* @__PURE__ */ r(ve, { className: "my-8" }),
3899
3923
  /* @__PURE__ */ r("p", { className: "text-center text-sm mt-4", style: { color: "var(--metakyc-text-secondary, #6b7280)" }, children: "Loading risk scoring criteria…" })
3900
3924
  ] }) }) : !o && a && a.length === 0 ? /* @__PURE__ */ r(K, { children: /* @__PURE__ */ s(W, { children: [
3901
- /* @__PURE__ */ r(be, { className: "my-8" }),
3925
+ /* @__PURE__ */ r(ve, { className: "my-8" }),
3902
3926
  /* @__PURE__ */ r("p", { className: "text-center text-sm mt-4", style: { color: "var(--metakyc-text-secondary, #6b7280)" }, children: "No criteria required. Moving to next step…" })
3903
3927
  ] }) }) : d ? /* @__PURE__ */ r(K, { children: /* @__PURE__ */ r(W, { children: /* @__PURE__ */ s("p", { className: "text-danger-500", children: [
3904
3928
  "Error loading criteria: ",
@@ -3910,7 +3934,7 @@ const jr = ({
3910
3934
  k.length > 1 && /* @__PURE__ */ s("div", { className: "flex items-center justify-between mt-3", children: [
3911
3935
  /* @__PURE__ */ s("span", { className: "text-xs", style: { color: "var(--metakyc-text-muted, #9ca3af)" }, children: [
3912
3936
  "Page ",
3913
- y + 1,
3937
+ x + 1,
3914
3938
  " of ",
3915
3939
  k.length
3916
3940
  ] }),
@@ -3920,8 +3944,8 @@ const jr = ({
3920
3944
  className: "rounded-full transition-all duration-200",
3921
3945
  style: {
3922
3946
  height: "6px",
3923
- width: P === y ? "20px" : "6px",
3924
- backgroundColor: P <= y ? "var(--metakyc-primary, #2563eb)" : "var(--metakyc-border, #e5e7eb)"
3947
+ width: P === x ? "20px" : "6px",
3948
+ backgroundColor: P <= x ? "var(--metakyc-primary, #2563eb)" : "var(--metakyc-border, #e5e7eb)"
3925
3949
  }
3926
3950
  },
3927
3951
  P
@@ -3940,7 +3964,7 @@ const jr = ({
3940
3964
  )) }),
3941
3965
  /* @__PURE__ */ s(pe, { className: "flex items-center justify-between", children: [
3942
3966
  /* @__PURE__ */ s(
3943
- V,
3967
+ Z,
3944
3968
  {
3945
3969
  type: "button",
3946
3970
  variant: "outline",
@@ -3948,15 +3972,15 @@ const jr = ({
3948
3972
  style: { display: "flex", alignItems: "center", gap: "4px" },
3949
3973
  children: [
3950
3974
  /* @__PURE__ */ r(gt, { size: 14 }),
3951
- y > 0 ? "Previous" : "Back"
3975
+ x > 0 ? "Previous" : "Back"
3952
3976
  ]
3953
3977
  }
3954
3978
  ),
3955
- $ ? /* @__PURE__ */ r(V, { type: "button", isLoading: c, onClick: g, children: "Continue" }) : /* @__PURE__ */ s(
3956
- V,
3979
+ z ? /* @__PURE__ */ r(Z, { type: "button", isLoading: l, onClick: f, children: "Continue" }) : /* @__PURE__ */ s(
3980
+ Z,
3957
3981
  {
3958
3982
  type: "button",
3959
- onClick: J,
3983
+ onClick: G,
3960
3984
  style: { display: "flex", alignItems: "center", gap: "4px" },
3961
3985
  children: [
3962
3986
  "Next",
@@ -3980,20 +4004,20 @@ const jr = ({
3980
4004
  me,
3981
4005
  {
3982
4006
  value: t[0] ?? "",
3983
- onChange: (c) => a([c.target.value]),
4007
+ onChange: (l) => a([l.target.value]),
3984
4008
  type: o ? "number" : "text",
3985
4009
  placeholder: "Enter your answer…",
3986
4010
  error: n,
3987
4011
  required: e.isRequired,
3988
4012
  min: e.min,
3989
4013
  max: e.max,
3990
- onKeyDown: (c) => {
3991
- e.valueDataType === Ie.DigitOnly && ["e", "E", "+", "-", "."].includes(c.key) && c.preventDefault();
4014
+ onKeyDown: (l) => {
4015
+ e.valueDataType === Ie.DigitOnly && ["e", "E", "+", "-", "."].includes(l.key) && l.preventDefault();
3992
4016
  }
3993
4017
  }
3994
4018
  ),
3995
4019
  i === "radio" && /* @__PURE__ */ s("div", { className: "metakyc-options-group", style: { display: "flex", flexDirection: "column", gap: "8px" }, children: [
3996
- (e.defaultValues ?? []).map((c) => /* @__PURE__ */ s(
4020
+ (e.defaultValues ?? []).map((l) => /* @__PURE__ */ s(
3997
4021
  "label",
3998
4022
  {
3999
4023
  className: "metakyc-option-label",
@@ -4003,8 +4027,8 @@ const jr = ({
4003
4027
  "input",
4004
4028
  {
4005
4029
  type: "radio",
4006
- checked: t[0] === c,
4007
- onChange: () => a([c]),
4030
+ checked: t[0] === l,
4031
+ onChange: () => a([l]),
4008
4032
  className: "metakyc-option-input",
4009
4033
  style: {
4010
4034
  width: "16px",
@@ -4021,15 +4045,15 @@ const jr = ({
4021
4045
  }
4022
4046
  }
4023
4047
  ),
4024
- /* @__PURE__ */ r("span", { className: "metakyc-option-text", style: { fontSize: "14px", color: "var(--metakyc-text-primary, #111827)", lineHeight: "1.4", marginLeft: 0 }, children: c })
4048
+ /* @__PURE__ */ r("span", { className: "metakyc-option-text", style: { fontSize: "14px", color: "var(--metakyc-text-primary, #111827)", lineHeight: "1.4", marginLeft: 0 }, children: l })
4025
4049
  ]
4026
4050
  },
4027
- c
4051
+ l
4028
4052
  )),
4029
4053
  n && /* @__PURE__ */ r("p", { className: "text-sm text-danger-500", children: n })
4030
4054
  ] }),
4031
4055
  i === "checkbox" && /* @__PURE__ */ s("div", { className: "metakyc-options-group", style: { display: "flex", flexDirection: "column", gap: "8px" }, children: [
4032
- (e.defaultValues ?? []).map((c) => /* @__PURE__ */ s(
4056
+ (e.defaultValues ?? []).map((l) => /* @__PURE__ */ s(
4033
4057
  "label",
4034
4058
  {
4035
4059
  className: "metakyc-option-label",
@@ -4039,9 +4063,9 @@ const jr = ({
4039
4063
  "input",
4040
4064
  {
4041
4065
  type: "checkbox",
4042
- checked: t.includes(c),
4066
+ checked: t.includes(l),
4043
4067
  onChange: (d) => {
4044
- d.target.checked ? a([...t, c]) : a(t.filter((u) => u !== c));
4068
+ d.target.checked ? a([...t, l]) : a(t.filter((u) => u !== l));
4045
4069
  },
4046
4070
  className: "metakyc-option-input",
4047
4071
  style: {
@@ -4059,10 +4083,10 @@ const jr = ({
4059
4083
  }
4060
4084
  }
4061
4085
  ),
4062
- /* @__PURE__ */ r("span", { className: "metakyc-option-text", style: { fontSize: "14px", color: "var(--metakyc-text-primary, #111827)", lineHeight: "1.4", marginLeft: 0 }, children: c })
4086
+ /* @__PURE__ */ r("span", { className: "metakyc-option-text", style: { fontSize: "14px", color: "var(--metakyc-text-primary, #111827)", lineHeight: "1.4", marginLeft: 0 }, children: l })
4063
4087
  ]
4064
4088
  },
4065
- c
4089
+ l
4066
4090
  )),
4067
4091
  n && /* @__PURE__ */ r("p", { className: "text-sm text-danger-500", children: n })
4068
4092
  ] }),
@@ -4070,7 +4094,7 @@ const jr = ({
4070
4094
  He,
4071
4095
  {
4072
4096
  value: t[0] ?? "",
4073
- onChange: (c) => a([c.target.value]),
4097
+ onChange: (l) => a([l.target.value]),
4074
4098
  options: [
4075
4099
  { value: "US", label: "United States" },
4076
4100
  { value: "GB", label: "United Kingdom" },
@@ -4089,7 +4113,7 @@ const jr = ({
4089
4113
  onComplete: t,
4090
4114
  onBack: n
4091
4115
  }) => {
4092
- const { investorCategorizationService: a } = ye(), [i, o] = b(null), [c, d] = b(!1), [u, p] = b(null);
4116
+ const { investorCategorizationService: a } = ye(), [i, o] = v(null), [l, d] = v(!1), [u, p] = v(null);
4093
4117
  return /* @__PURE__ */ r("form", { onSubmit: async (N) => {
4094
4118
  if (N.preventDefault(), i === null) {
4095
4119
  p("Please select an investor type");
@@ -4102,8 +4126,8 @@ const jr = ({
4102
4126
  investorType: i
4103
4127
  };
4104
4128
  console.log("Submitting investor categorization:", m);
4105
- const y = await a.setInvestorCategorization(m);
4106
- console.log("Investor categorization result:", y), t == null || t();
4129
+ const x = await a.setInvestorCategorization(m);
4130
+ console.log("Investor categorization result:", x), t == null || t();
4107
4131
  } catch (m) {
4108
4132
  console.error("Error submitting investor categorization:", m), p(m.message || "Failed to submit investor categorization");
4109
4133
  } finally {
@@ -4210,12 +4234,12 @@ const jr = ({
4210
4234
  ] }) })
4211
4235
  ] }),
4212
4236
  /* @__PURE__ */ s(pe, { className: "flex justify-between", children: [
4213
- n && /* @__PURE__ */ r(V, { type: "button", variant: "outline", onClick: n, children: "Back" }),
4237
+ n && /* @__PURE__ */ r(Z, { type: "button", variant: "outline", onClick: n, children: "Back" }),
4214
4238
  /* @__PURE__ */ r(
4215
- V,
4239
+ Z,
4216
4240
  {
4217
4241
  type: "submit",
4218
- isLoading: c,
4242
+ isLoading: l,
4219
4243
  disabled: i === null,
4220
4244
  children: "Submit"
4221
4245
  }
@@ -4227,117 +4251,117 @@ const jr = ({
4227
4251
  onComplete: t,
4228
4252
  onBack: n
4229
4253
  }) => {
4230
- const { appropriatenessTestService: a } = ye(), [i, o] = b(null), [c, d] = b(!0), [u, p] = b(!1), [x, N] = b(null), [m, y] = b({}), [h, C] = b(0), [F, k] = b(!1), [$, A] = b(!1), [I, j] = b(0);
4254
+ const { appropriatenessTestService: a } = ye(), [i, o] = v(null), [l, d] = v(!0), [u, p] = v(!1), [b, N] = v(null), [m, x] = v({}), [h, C] = v(0), [D, k] = v(!1), [z, A] = v(!1), [I, j] = v(0);
4231
4255
  ne(() => {
4232
4256
  (async () => {
4233
4257
  try {
4234
4258
  d(!0), N(null), console.log("Loading appropriateness test for applicant:", e);
4235
- const M = await a.getAppropriatenessTest(e);
4236
- if (console.log("Appropriateness test data:", M), o(M), M.waitTimeSpanForNextTry && M.waitTimeSpanForNextTry !== "00:00:00") {
4237
- const Z = J(M.waitTimeSpanForNextTry);
4238
- Z > 0 && j(Z);
4259
+ const T = await a.getAppropriatenessTest(e);
4260
+ if (console.log("Appropriateness test data:", T), o(T), T.waitTimeSpanForNextTry && T.waitTimeSpanForNextTry !== "00:00:00") {
4261
+ const J = G(T.waitTimeSpanForNextTry);
4262
+ J > 0 && j(J);
4239
4263
  }
4240
- } catch (M) {
4241
- console.error("Error loading appropriateness test:", M), N(M.message || "Failed to load appropriateness test");
4264
+ } catch (T) {
4265
+ console.error("Error loading appropriateness test:", T), N(T.message || "Failed to load appropriateness test");
4242
4266
  } finally {
4243
4267
  d(!1);
4244
4268
  }
4245
4269
  })();
4246
4270
  }, [e, a]);
4247
- const J = (O) => {
4248
- const M = O.split(":").map(Number);
4249
- if (M.length === 3) {
4250
- const [Z, w, U] = M;
4251
- return Z * 3600 + w * 60 + U;
4271
+ const G = (M) => {
4272
+ const T = M.split(":").map(Number);
4273
+ if (T.length === 3) {
4274
+ const [J, w, q] = T;
4275
+ return J * 3600 + w * 60 + q;
4252
4276
  }
4253
4277
  return 0;
4254
- }, E = (O) => {
4255
- const M = Math.floor(O / 60), Z = O % 60;
4256
- return `${M.toString().padStart(2, "0")}:${Z.toString().padStart(2, "0")}`;
4278
+ }, E = (M) => {
4279
+ const T = Math.floor(M / 60), J = M % 60;
4280
+ return `${T.toString().padStart(2, "0")}:${J.toString().padStart(2, "0")}`;
4257
4281
  };
4258
4282
  ne(() => {
4259
- if (!F || h <= 0) return;
4260
- const O = setInterval(() => {
4261
- C((M) => M <= 1 ? (A(!0), 0) : M - 1);
4283
+ if (!D || h <= 0) return;
4284
+ const M = setInterval(() => {
4285
+ C((T) => T <= 1 ? (A(!0), 0) : T - 1);
4262
4286
  }, 1e3);
4263
- return () => clearInterval(O);
4264
- }, [F, h]), ne(() => {
4287
+ return () => clearInterval(M);
4288
+ }, [D, h]), ne(() => {
4265
4289
  if (I <= 0) return;
4266
- const O = setInterval(() => {
4267
- j((M) => M <= 1 ? 0 : M - 1);
4290
+ const M = setInterval(() => {
4291
+ j((T) => T <= 1 ? 0 : T - 1);
4268
4292
  }, 1e3);
4269
- return () => clearInterval(O);
4293
+ return () => clearInterval(M);
4270
4294
  }, [I]), ne(() => {
4271
- $ && !u && P();
4272
- }, [$]);
4273
- const g = () => {
4295
+ z && !u && P();
4296
+ }, [z]);
4297
+ const f = () => {
4274
4298
  i && (k(!0), C(i.testDurationSec));
4275
- }, R = (O, M) => {
4276
- y((Z) => ({
4277
- ...Z,
4278
- [O]: M
4299
+ }, R = (M, T) => {
4300
+ x((J) => ({
4301
+ ...J,
4302
+ [M]: T
4279
4303
  }));
4280
- }, P = async (O) => {
4281
- if (O && O.preventDefault(), !!i) {
4282
- if (!$) {
4283
- const M = i.appropriatenessQuestions.length - Object.keys(m).length;
4284
- if (M > 0) {
4285
- N(`Please answer all questions. ${M} question(s) remaining.`);
4304
+ }, P = async (M) => {
4305
+ if (M && M.preventDefault(), !!i) {
4306
+ if (!z) {
4307
+ const T = i.appropriatenessQuestions.length - Object.keys(m).length;
4308
+ if (T > 0) {
4309
+ N(`Please answer all questions. ${T} question(s) remaining.`);
4286
4310
  return;
4287
4311
  }
4288
4312
  }
4289
4313
  p(!0), N(null);
4290
4314
  try {
4291
- const M = i.appropriatenessQuestions.map(
4315
+ const T = i.appropriatenessQuestions.map(
4292
4316
  (w) => ({
4293
4317
  appropriatenessQuestionId: w.id,
4294
4318
  value: m[w.id] || ""
4295
4319
  // Empty string if not answered
4296
4320
  })
4297
- ), Z = {
4321
+ ), J = {
4298
4322
  applicantId: e,
4299
4323
  appropriatenessTestId: i.id,
4300
- appropriatenessQuestionResults: M
4324
+ appropriatenessQuestionResults: T
4301
4325
  };
4302
- console.log("Submitting appropriateness test:", Z);
4326
+ console.log("Submitting appropriateness test:", J);
4303
4327
  try {
4304
- const w = await a.fillAppropriatenessTest(Z);
4305
- console.log("Appropriateness test result:", w), w.message && (w.message.toLowerCase().includes("pass") || w.message.toLowerCase().includes("success") || w.message.toLowerCase().includes("congratulations")) ? t == null || t() : (N(w.message || "Test completed. Please check the result."), k(!1), A(!1), y({}), setTimeout(() => z(), 1e3));
4328
+ const w = await a.fillAppropriatenessTest(J);
4329
+ console.log("Appropriateness test result:", w), w.message && (w.message.toLowerCase().includes("pass") || w.message.toLowerCase().includes("success") || w.message.toLowerCase().includes("congratulations")) ? t == null || t() : (N(w.message || "Test completed. Please check the result."), k(!1), A(!1), x({}), setTimeout(() => O(), 1e3));
4306
4330
  } catch (w) {
4307
4331
  if (w.code === 400 && w.message) {
4308
- const U = w.message;
4309
- console.log("Test failed:", U), N(U), k(!1), A(!1), y({}), setTimeout(() => z(), 1500);
4332
+ const q = w.message;
4333
+ console.log("Test failed:", q), N(q), k(!1), A(!1), x({}), setTimeout(() => O(), 1500);
4310
4334
  } else
4311
4335
  throw w;
4312
4336
  }
4313
- } catch (M) {
4314
- console.error("Error submitting appropriateness test:", M), N(M.message || "Failed to submit test. Please try again."), k(!1), A(!1), y({});
4337
+ } catch (T) {
4338
+ console.error("Error submitting appropriateness test:", T), N(T.message || "Failed to submit test. Please try again."), k(!1), A(!1), x({});
4315
4339
  } finally {
4316
4340
  p(!1);
4317
4341
  }
4318
4342
  }
4319
- }, z = async () => {
4343
+ }, O = async () => {
4320
4344
  try {
4321
- const O = await a.getAppropriatenessTest(e);
4322
- if (console.log("Reloaded test data:", O), o(O), O.waitTimeSpanForNextTry && O.waitTimeSpanForNextTry !== "00:00:00") {
4323
- const M = J(O.waitTimeSpanForNextTry);
4324
- M > 0 && j(M);
4345
+ const M = await a.getAppropriatenessTest(e);
4346
+ if (console.log("Reloaded test data:", M), o(M), M.waitTimeSpanForNextTry && M.waitTimeSpanForNextTry !== "00:00:00") {
4347
+ const T = G(M.waitTimeSpanForNextTry);
4348
+ T > 0 && j(T);
4325
4349
  }
4326
- } catch (O) {
4327
- console.error("Error reloading test data:", O), N((M) => M + `
4350
+ } catch (M) {
4351
+ console.error("Error reloading test data:", M), N((T) => T + `
4328
4352
 
4329
4353
  Failed to reload test data. Please refresh the page.`);
4330
4354
  }
4331
4355
  };
4332
- if (c)
4356
+ if (l)
4333
4357
  return /* @__PURE__ */ r(K, { children: /* @__PURE__ */ s(W, { children: [
4334
- /* @__PURE__ */ r(be, { className: "my-8" }),
4358
+ /* @__PURE__ */ r(ve, { className: "my-8" }),
4335
4359
  /* @__PURE__ */ r("p", { className: "text-center text-gray-600 dark:text-gray-400 mt-4", children: "Loading appropriateness test..." })
4336
4360
  ] }) });
4337
4361
  if (!i)
4338
4362
  return /* @__PURE__ */ r(K, { children: /* @__PURE__ */ s(W, { className: "py-12 text-center", children: [
4339
4363
  /* @__PURE__ */ r("p", { className: "text-danger-500 text-lg mb-4", children: "No test data available" }),
4340
- x && /* @__PURE__ */ r("p", { className: "text-gray-600 dark:text-gray-400", children: x })
4364
+ b && /* @__PURE__ */ r("p", { className: "text-gray-600 dark:text-gray-400", children: b })
4341
4365
  ] }) });
4342
4366
  if (I > 0)
4343
4367
  return /* @__PURE__ */ s(K, { children: [
@@ -4350,11 +4374,11 @@ Failed to reload test data. Please refresh the page.`);
4350
4374
  /* @__PURE__ */ r("div", { className: "text-6xl font-bold text-primary-500 mb-2", children: E(I) }),
4351
4375
  /* @__PURE__ */ r("p", { className: "text-gray-600 dark:text-gray-400", children: "Please wait before attempting the test again" })
4352
4376
  ] }),
4353
- x && /* @__PURE__ */ r("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__ */ r("p", { className: "text-red-600 dark:text-red-400 text-sm", children: x }) })
4377
+ b && /* @__PURE__ */ r("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__ */ r("p", { className: "text-red-600 dark:text-red-400 text-sm", children: b }) })
4354
4378
  ] })
4355
4379
  ] });
4356
- const _ = i.testAllowedMaxTry - i.totalFailedTries;
4357
- return F ? /* @__PURE__ */ r("form", { onSubmit: P, children: /* @__PURE__ */ s(K, { children: [
4380
+ const H = i.testAllowedMaxTry - i.totalFailedTries;
4381
+ return D ? /* @__PURE__ */ r("form", { onSubmit: P, children: /* @__PURE__ */ s(K, { children: [
4358
4382
  /* @__PURE__ */ r(de, { children: /* @__PURE__ */ s("div", { className: "flex items-center justify-between", children: [
4359
4383
  /* @__PURE__ */ s("div", { children: [
4360
4384
  /* @__PURE__ */ r("h2", { className: "text-lg font-bold text-gray-900 dark:text-white", children: i.displayName }),
@@ -4379,14 +4403,14 @@ Failed to reload test data. Please refresh the page.`);
4379
4403
  " of ",
4380
4404
  i.totalQuestionCount
4381
4405
  ] }),
4382
- /* @__PURE__ */ s(Ae, { variant: _ > 1 ? "success" : "warning", children: [
4383
- _,
4406
+ /* @__PURE__ */ s(Ae, { variant: H > 1 ? "success" : "warning", children: [
4407
+ H,
4384
4408
  " attempt",
4385
- _ !== 1 ? "s" : "",
4409
+ H !== 1 ? "s" : "",
4386
4410
  " remaining"
4387
4411
  ] })
4388
4412
  ] }),
4389
- i.appropriatenessQuestions.map((O, M) => /* @__PURE__ */ s(
4413
+ i.appropriatenessQuestions.map((M, T) => /* @__PURE__ */ s(
4390
4414
  "div",
4391
4415
  {
4392
4416
  className: "p-4 border border-gray-200 dark:border-gray-700 rounded-lg",
@@ -4394,53 +4418,53 @@ Failed to reload test data. Please refresh the page.`);
4394
4418
  /* @__PURE__ */ s("div", { className: "mb-4", children: [
4395
4419
  /* @__PURE__ */ s("span", { className: "inline-block px-2 py-1 text-xs font-semibold text-primary-700 bg-primary-100 dark:text-primary-300 dark:bg-primary-900/30 rounded mb-2", children: [
4396
4420
  "Question ",
4397
- M + 1
4421
+ T + 1
4398
4422
  ] }),
4399
- O.groupName && /* @__PURE__ */ r("span", { className: "ml-2 text-xs text-gray-500 dark:text-gray-400", children: O.groupName }),
4400
- /* @__PURE__ */ r("h3", { className: "text-lg font-semibold text-gray-900 dark:text-white mt-2", children: O.question })
4423
+ M.groupName && /* @__PURE__ */ r("span", { className: "ml-2 text-xs text-gray-500 dark:text-gray-400", children: M.groupName }),
4424
+ /* @__PURE__ */ r("h3", { className: "text-lg font-semibold text-gray-900 dark:text-white mt-2", children: M.question })
4401
4425
  ] }),
4402
- /* @__PURE__ */ r("div", { className: "space-y-2", children: O.answers.map((Z, w) => /* @__PURE__ */ s(
4426
+ /* @__PURE__ */ r("div", { className: "space-y-2", children: M.answers.map((J, w) => /* @__PURE__ */ s(
4403
4427
  "label",
4404
4428
  {
4405
4429
  className: `
4406
4430
  flex items-center p-3 border-2 rounded-lg cursor-pointer transition-all
4407
- ${m[O.id] === Z ? "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"}
4431
+ ${m[M.id] === J ? "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"}
4408
4432
  `,
4409
4433
  children: [
4410
4434
  /* @__PURE__ */ r(
4411
4435
  "input",
4412
4436
  {
4413
4437
  type: "radio",
4414
- name: `question-${O.id}`,
4415
- value: Z,
4416
- checked: m[O.id] === Z,
4417
- onChange: (U) => R(O.id, U.target.value),
4438
+ name: `question-${M.id}`,
4439
+ value: J,
4440
+ checked: m[M.id] === J,
4441
+ onChange: (q) => R(M.id, q.target.value),
4418
4442
  className: "h-4 w-4 text-primary-500 border-gray-300 focus:ring-primary-500",
4419
4443
  disabled: u
4420
4444
  }
4421
4445
  ),
4422
- /* @__PURE__ */ r("span", { className: "ml-3 text-gray-700 dark:text-gray-300", children: Z })
4446
+ /* @__PURE__ */ r("span", { className: "ml-3 text-gray-700 dark:text-gray-300", children: J })
4423
4447
  ]
4424
4448
  },
4425
4449
  w
4426
4450
  )) })
4427
4451
  ]
4428
4452
  },
4429
- O.id
4453
+ M.id
4430
4454
  )),
4431
- x && !$ && /* @__PURE__ */ r("div", { className: "p-4 bg-red-50 dark:bg-red-900/20 border border-red-200 dark:border-red-800 rounded-lg", children: /* @__PURE__ */ s("p", { className: "text-red-600 dark:text-red-400 text-sm", children: [
4455
+ b && !z && /* @__PURE__ */ r("div", { className: "p-4 bg-red-50 dark:bg-red-900/20 border border-red-200 dark:border-red-800 rounded-lg", children: /* @__PURE__ */ s("p", { className: "text-red-600 dark:text-red-400 text-sm", children: [
4432
4456
  /* @__PURE__ */ r("strong", { children: "Error:" }),
4433
4457
  " ",
4434
- x
4458
+ b
4435
4459
  ] }) }),
4436
- $ && /* @__PURE__ */ r("div", { className: "p-4 bg-yellow-50 dark:bg-yellow-900/20 border border-yellow-200 dark:border-yellow-800 rounded-lg", children: /* @__PURE__ */ s("p", { className: "text-yellow-700 dark:text-yellow-400 text-sm", children: [
4460
+ z && /* @__PURE__ */ r("div", { className: "p-4 bg-yellow-50 dark:bg-yellow-900/20 border border-yellow-200 dark:border-yellow-800 rounded-lg", children: /* @__PURE__ */ s("p", { className: "text-yellow-700 dark:text-yellow-400 text-sm", children: [
4437
4461
  /* @__PURE__ */ r("strong", { children: "Time's up!" }),
4438
4462
  " Your answers are being submitted automatically."
4439
4463
  ] }) })
4440
4464
  ] }),
4441
4465
  /* @__PURE__ */ s(pe, { className: "flex justify-between", children: [
4442
4466
  /* @__PURE__ */ r(
4443
- V,
4467
+ Z,
4444
4468
  {
4445
4469
  type: "button",
4446
4470
  variant: "outline",
@@ -4450,12 +4474,12 @@ Failed to reload test data. Please refresh the page.`);
4450
4474
  }
4451
4475
  ),
4452
4476
  /* @__PURE__ */ r(
4453
- V,
4477
+ Z,
4454
4478
  {
4455
4479
  type: "submit",
4456
4480
  isLoading: u,
4457
4481
  disabled: Object.keys(m).length < i.totalQuestionCount,
4458
- children: $ ? "Submitting..." : "Submit Test"
4482
+ children: z ? "Submitting..." : "Submit Test"
4459
4483
  }
4460
4484
  )
4461
4485
  ] })
@@ -4481,24 +4505,24 @@ Failed to reload test data. Please refresh the page.`);
4481
4505
  ] }),
4482
4506
  /* @__PURE__ */ s("div", { className: "flex items-center justify-between p-4 bg-blue-50 dark:bg-blue-900/20 rounded-lg", children: [
4483
4507
  /* @__PURE__ */ r("span", { className: "text-gray-700 dark:text-gray-300 font-medium", children: "Attempts Remaining:" }),
4484
- /* @__PURE__ */ r(Ae, { variant: _ > 1 ? "success" : "warning", children: _ })
4508
+ /* @__PURE__ */ r(Ae, { variant: H > 1 ? "success" : "warning", children: H })
4485
4509
  ] })
4486
4510
  ] }),
4487
- x && /* @__PURE__ */ r("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__ */ s("p", { className: "text-red-600 dark:text-red-400 text-sm", children: [
4511
+ b && /* @__PURE__ */ r("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__ */ s("p", { className: "text-red-600 dark:text-red-400 text-sm", children: [
4488
4512
  /* @__PURE__ */ r("strong", { children: "Previous Attempt:" }),
4489
4513
  " ",
4490
- x
4514
+ b
4491
4515
  ] }) }),
4492
- _ <= 0 && /* @__PURE__ */ r("div", { className: "p-4 bg-red-50 dark:bg-red-900/20 border border-red-200 dark:border-red-800 rounded-lg", children: /* @__PURE__ */ r("p", { className: "text-red-600 dark:text-red-400", children: "You have used all your attempts. Please contact support for assistance." }) })
4516
+ H <= 0 && /* @__PURE__ */ r("div", { className: "p-4 bg-red-50 dark:bg-red-900/20 border border-red-200 dark:border-red-800 rounded-lg", children: /* @__PURE__ */ r("p", { className: "text-red-600 dark:text-red-400", children: "You have used all your attempts. Please contact support for assistance." }) })
4493
4517
  ] }),
4494
4518
  /* @__PURE__ */ s(pe, { className: "flex justify-between", children: [
4495
- n && /* @__PURE__ */ r(V, { type: "button", variant: "outline", onClick: n, children: "Back" }),
4519
+ n && /* @__PURE__ */ r(Z, { type: "button", variant: "outline", onClick: n, children: "Back" }),
4496
4520
  /* @__PURE__ */ r(
4497
- V,
4521
+ Z,
4498
4522
  {
4499
4523
  type: "button",
4500
- onClick: g,
4501
- disabled: _ <= 0,
4524
+ onClick: f,
4525
+ disabled: H <= 0,
4502
4526
  children: "Start Test"
4503
4527
  }
4504
4528
  )
@@ -4509,8 +4533,8 @@ Failed to reload test data. Please refresh the page.`);
4509
4533
  onComplete: t,
4510
4534
  onBack: n
4511
4535
  }) => {
4512
- var Z, w, U, te;
4513
- const { applicantService: a, baseInformationService: i, config: o } = ye(), { identityData: c, provider: d, token: u, isLoading: p, error: x, requestIdentity: N, restartIdentity: m } = kr(e), [y, h] = b(null), [C, F] = b(null), [k, $] = b([]), [A, I] = b(!0), [j, J] = b(!1), [E, g] = b(null), [R, P] = b(!1), z = ge.useRef(!1), _ = Ct({
4536
+ var J, w, q, te;
4537
+ const { applicantService: a, baseInformationService: i, config: o } = ye(), { identityData: l, provider: d, token: u, isLoading: p, error: b, requestIdentity: N, restartIdentity: m } = kr(e), [x, h] = v(null), [C, D] = v(null), [k, z] = v([]), [A, I] = v(!0), [j, G] = v(!1), [E, f] = v(null), [R, P] = v(!1), O = ge.useRef(!1), H = Ct({
4514
4538
  defaultValues: {
4515
4539
  street: "",
4516
4540
  streetNumber: "",
@@ -4524,18 +4548,18 @@ Failed to reload test data. Please refresh the page.`);
4524
4548
  ne(() => {
4525
4549
  (async () => {
4526
4550
  try {
4527
- const [D, S] = await Promise.all([
4551
+ const [F, S] = await Promise.all([
4528
4552
  a.getApplicantData(e),
4529
4553
  i.getCountries("", "en")
4530
4554
  ]);
4531
- F(D);
4532
- const H = /* @__PURE__ */ new Set(), X = S.filter((ve) => {
4533
- const Ce = ve.abbreviation3 || ve.abbreviation;
4534
- return !Ce || H.has(Ce) ? !1 : (H.add(Ce), !0);
4555
+ D(F);
4556
+ const U = /* @__PURE__ */ new Set(), X = S.filter((ke) => {
4557
+ const Ce = ke.abbreviation3 || ke.abbreviation;
4558
+ return !Ce || U.has(Ce) ? !1 : (U.add(Ce), !0);
4535
4559
  });
4536
- $(X);
4537
- const Y = D.applicantRequestData;
4538
- if (_.reset({
4560
+ z(X);
4561
+ const Y = F.applicantRequestData;
4562
+ if (H.reset({
4539
4563
  street: (Y == null ? void 0 : Y.street) || "",
4540
4564
  streetNumber: (Y == null ? void 0 : Y.streetNumber) || "",
4541
4565
  city: (Y == null ? void 0 : Y.city) || "",
@@ -4543,136 +4567,136 @@ Failed to reload test data. Please refresh the page.`);
4543
4567
  country: (Y == null ? void 0 : Y.country) || "",
4544
4568
  nationality: (Y == null ? void 0 : Y.nationality) || "",
4545
4569
  phonenumber: (Y == null ? void 0 : Y.phonenumber) || ""
4546
- }), D.kycRecords && D.kycRecords.length > 0 && D.kycRecords[0].providerTokenObject !== null && !z.current) {
4547
- console.log("[Identity] Found existing identity verification, auto-requesting..."), z.current = !0;
4570
+ }), F.kycRecords && F.kycRecords.length > 0 && F.kycRecords[0].providerTokenObject !== null && !O.current) {
4571
+ console.log("[Identity] Found existing identity verification, auto-requesting..."), O.current = !0;
4548
4572
  try {
4549
- await N(), J(!0);
4550
- } catch (ve) {
4551
- console.error("[Identity] Auto-request failed:", ve);
4573
+ await N(), G(!0);
4574
+ } catch (ke) {
4575
+ console.error("[Identity] Auto-request failed:", ke);
4552
4576
  }
4553
4577
  }
4554
- } catch (D) {
4555
- console.error("Error loading applicant data:", D);
4578
+ } catch (F) {
4579
+ console.error("Error loading applicant data:", F);
4556
4580
  } finally {
4557
4581
  I(!1);
4558
4582
  }
4559
4583
  })();
4560
4584
  }, [e]), ne(() => {
4561
- c && !j && (console.log("[Identity] Identity data already loaded, showing provider"), J(!0));
4562
- }, [c, j]), ne(() => {
4585
+ l && !j && (console.log("[Identity] Identity data already loaded, showing provider"), G(!0));
4586
+ }, [l, j]), ne(() => {
4563
4587
  if (u) {
4564
4588
  if (u.expiresAt) {
4565
4589
  const B = new Date(u.expiresAt).getTime();
4566
4590
  if (Date.now() >= B) {
4567
- console.warn("[Identity] Token has expired (expiresAt)"), P(!0), g("Your verification session has expired. Please restart.");
4591
+ console.warn("[Identity] Token has expired (expiresAt)"), P(!0), f("Your verification session has expired. Please restart.");
4568
4592
  return;
4569
4593
  }
4570
4594
  }
4571
4595
  if (u.url)
4572
4596
  try {
4573
- const D = new URL(u.url).toString().toLowerCase();
4574
- if (D.includes("expired") || D.includes("invalid") || D.includes("error")) {
4575
- console.warn("[Identity] Token URL indicates expiration"), P(!0), g("Your verification link has expired. Please restart.");
4597
+ const F = new URL(u.url).toString().toLowerCase();
4598
+ if (F.includes("expired") || F.includes("invalid") || F.includes("error")) {
4599
+ console.warn("[Identity] Token URL indicates expiration"), P(!0), f("Your verification link has expired. Please restart.");
4576
4600
  return;
4577
4601
  }
4578
4602
  } catch {
4579
4603
  console.error("[Identity] Invalid token URL");
4580
4604
  }
4581
4605
  if (u.status === "expired" || u.error === "expired" || u.expired === !0) {
4582
- console.warn("[Identity] Token object indicates expiration"), P(!0), g("Your verification session has expired. Please restart.");
4606
+ console.warn("[Identity] Token object indicates expiration"), P(!0), f("Your verification session has expired. Please restart.");
4583
4607
  return;
4584
4608
  }
4585
4609
  }
4586
4610
  }, [u]), ne(() => {
4587
- if (d !== null && u && !y && j && !R) {
4611
+ if (d !== null && u && !x && j && !R) {
4588
4612
  const B = d;
4589
4613
  if (u.url) {
4590
- console.log("[Identity] Loading provider URL for user verification:", u.url), g(null);
4614
+ console.log("[Identity] Loading provider URL for user verification:", u.url), f(null);
4591
4615
  try {
4592
- if (new URL(u.url), B === fe.SardinAI) {
4616
+ if (new URL(u.url), B === xe.SardinAI) {
4593
4617
  console.log("[SardinAI] Initializing Risk SDK in background...");
4594
4618
  try {
4595
- const D = Me.parseProviderConfig(d, u, o);
4596
- Me.createProvider(d, D).initialize().then(() => {
4619
+ const F = Me.parseProviderConfig(d, u, o);
4620
+ Me.createProvider(d, F).initialize().then(() => {
4597
4621
  console.log("[SardinAI] Risk SDK initialized successfully in background");
4598
- }).catch((H) => {
4599
- console.warn("[SardinAI] Risk SDK initialization failed (non-blocking):", H);
4622
+ }).catch((U) => {
4623
+ console.warn("[SardinAI] Risk SDK initialization failed (non-blocking):", U);
4600
4624
  });
4601
- } catch (D) {
4602
- console.warn("[SardinAI] Risk SDK setup failed (non-blocking):", D);
4625
+ } catch (F) {
4626
+ console.warn("[SardinAI] Risk SDK setup failed (non-blocking):", F);
4603
4627
  }
4604
4628
  }
4605
4629
  h({ type: "url", url: u.url });
4606
- } catch (D) {
4607
- console.error("[Identity] Invalid URL:", D), g("Invalid verification URL. Please restart."), P(!0);
4630
+ } catch (F) {
4631
+ console.error("[Identity] Invalid URL:", F), f("Invalid verification URL. Please restart."), P(!0);
4608
4632
  }
4609
4633
  return;
4610
4634
  }
4611
- if (B === fe.SardinAI) {
4612
- console.log("[SardinAI] No URL provided - initializing Risk SDK only..."), g(null);
4635
+ if (B === xe.SardinAI) {
4636
+ console.log("[SardinAI] No URL provided - initializing Risk SDK only..."), f(null);
4613
4637
  try {
4614
- const D = Me.parseProviderConfig(d, u, o), S = Me.createProvider(d, D);
4638
+ const F = Me.parseProviderConfig(d, u, o), S = Me.createProvider(d, F);
4615
4639
  S.initialize().then(() => {
4616
4640
  console.log("[SardinAI] Risk SDK initialized successfully"), h(S), setTimeout(() => {
4617
4641
  t == null || t();
4618
4642
  }, 2e3);
4619
- }).catch((H) => {
4643
+ }).catch((U) => {
4620
4644
  var Y;
4621
- console.error("[SardinAI] Failed to initialize:", H);
4622
- const X = ((Y = H.message) == null ? void 0 : Y.toLowerCase()) || "";
4623
- X.includes("expired") || X.includes("invalid") || X.includes("401") || X.includes("400") ? (P(!0), g("Session expired or invalid. Please restart verification.")) : g(`Failed to initialize: ${H.message}`);
4645
+ console.error("[SardinAI] Failed to initialize:", U);
4646
+ const X = ((Y = U.message) == null ? void 0 : Y.toLowerCase()) || "";
4647
+ X.includes("expired") || X.includes("invalid") || X.includes("401") || X.includes("400") ? (P(!0), f("Session expired or invalid. Please restart verification.")) : f(`Failed to initialize: ${U.message}`);
4624
4648
  });
4625
- } catch (D) {
4626
- console.error("[SardinAI] Error creating provider:", D), g(`Configuration error: ${D.message}`);
4649
+ } catch (F) {
4650
+ console.error("[SardinAI] Error creating provider:", F), f(`Configuration error: ${F.message}`);
4627
4651
  }
4628
4652
  return;
4629
4653
  }
4630
4654
  try {
4631
- g(null);
4632
- const D = Me.parseProviderConfig(d, u, o), S = Me.createProvider(d, D);
4633
- B === fe.Sumsub ? (S.initialize("identity-container").catch((H) => {
4655
+ f(null);
4656
+ const F = Me.parseProviderConfig(d, u, o), S = Me.createProvider(d, F);
4657
+ B === xe.Sumsub ? (S.initialize("identity-container").catch((U) => {
4634
4658
  var X;
4635
- console.error("[Sumsub] Initialization error:", H), g(`Failed to initialize: ${H.message}`), (X = H.message) != null && X.toLowerCase().includes("expired") && P(!0);
4659
+ console.error("[Sumsub] Initialization error:", U), f(`Failed to initialize: ${U.message}`), (X = U.message) != null && X.toLowerCase().includes("expired") && P(!0);
4636
4660
  }), S.onComplete && S.onComplete(() => {
4637
4661
  t == null || t();
4638
- })) : B === fe.Onfido && S.initialize("identity-container").catch((H) => {
4639
- console.error("[Onfido] Initialization error:", H), g(`Failed to initialize: ${H.message}`);
4662
+ })) : B === xe.Onfido && S.initialize("identity-container").catch((U) => {
4663
+ console.error("[Onfido] Initialization error:", U), f(`Failed to initialize: ${U.message}`);
4640
4664
  }), h(S);
4641
- } catch (D) {
4642
- console.error("[Identity] Provider setup error:", D), g(`Setup error: ${D.message}`);
4665
+ } catch (F) {
4666
+ console.error("[Identity] Provider setup error:", F), f(`Setup error: ${F.message}`);
4643
4667
  }
4644
4668
  }
4645
4669
  return () => {
4646
- if (y && y.destroy)
4670
+ if (x && x.destroy)
4647
4671
  try {
4648
- y.destroy();
4672
+ x.destroy();
4649
4673
  } catch (B) {
4650
4674
  console.error("[Identity] Error destroying provider:", B);
4651
4675
  }
4652
4676
  };
4653
- }, [d, u, y, j, t, R]);
4654
- const O = async () => {
4677
+ }, [d, u, x, j, t, R]);
4678
+ const M = async () => {
4655
4679
  try {
4656
- g(null), P(!1), await N(), J(!0);
4680
+ f(null), P(!1), await N(), G(!0);
4657
4681
  } catch (B) {
4658
4682
  console.error("Error starting identity verification:", B);
4659
4683
  }
4660
- }, M = async () => {
4684
+ }, T = async () => {
4661
4685
  try {
4662
- g(null), P(!1), h(null), console.log("[Identity] Restarting verification..."), await m(), J(!0);
4686
+ f(null), P(!1), h(null), console.log("[Identity] Restarting verification..."), await m(), G(!0);
4663
4687
  } catch (B) {
4664
- console.error("Error restarting identity verification:", B), g(B.message || "Failed to restart verification");
4688
+ console.error("Error restarting identity verification:", B), f(B.message || "Failed to restart verification");
4665
4689
  }
4666
4690
  };
4667
4691
  if (A || p)
4668
4692
  return /* @__PURE__ */ r(K, { children: /* @__PURE__ */ s(W, { children: [
4669
- /* @__PURE__ */ r(be, { className: "my-8" }),
4693
+ /* @__PURE__ */ r(ve, { className: "my-8" }),
4670
4694
  /* @__PURE__ */ r("p", { className: "text-center text-gray-600 dark:text-gray-400 mt-4", children: "Loading identity verification..." })
4671
4695
  ] }) });
4672
- if (x)
4696
+ if (b)
4673
4697
  return /* @__PURE__ */ r(K, { children: /* @__PURE__ */ r(W, { children: /* @__PURE__ */ s("p", { className: "text-danger-500", children: [
4674
4698
  "Error: ",
4675
- x.message
4699
+ b.message
4676
4700
  ] }) }) });
4677
4701
  if (j && (E || R))
4678
4702
  return /* @__PURE__ */ s(K, { children: [
@@ -4712,11 +4736,11 @@ Failed to reload test data. Please refresh the page.`);
4712
4736
  ] })
4713
4737
  ] }),
4714
4738
  /* @__PURE__ */ s(pe, { className: "flex justify-between", children: [
4715
- n && /* @__PURE__ */ r(V, { type: "button", variant: "outline", onClick: n, children: "Back" }),
4716
- /* @__PURE__ */ r(V, { type: "button", onClick: M, disabled: p, children: p ? "Restarting..." : "Restart Verification" })
4739
+ n && /* @__PURE__ */ r(Z, { type: "button", variant: "outline", onClick: n, children: "Back" }),
4740
+ /* @__PURE__ */ r(Z, { type: "button", onClick: T, disabled: p, children: p ? "Restarting..." : "Restart Verification" })
4717
4741
  ] })
4718
4742
  ] });
4719
- if (j && c) {
4743
+ if (j && l) {
4720
4744
  const B = d;
4721
4745
  return u != null && u.url ? /* @__PURE__ */ s(K, { children: [
4722
4746
  /* @__PURE__ */ r(de, { children: /* @__PURE__ */ s("div", { className: "flex items-center justify-between", children: [
@@ -4725,12 +4749,12 @@ Failed to reload test data. Please refresh the page.`);
4725
4749
  /* @__PURE__ */ r("p", { className: "text-gray-600 dark:text-gray-400 mt-1", children: "Please complete the identity verification process" })
4726
4750
  ] }),
4727
4751
  /* @__PURE__ */ r(
4728
- V,
4752
+ Z,
4729
4753
  {
4730
4754
  type: "button",
4731
4755
  variant: "outline",
4732
4756
  size: "sm",
4733
- onClick: M,
4757
+ onClick: T,
4734
4758
  disabled: p,
4735
4759
  children: "Restart"
4736
4760
  }
@@ -4748,14 +4772,14 @@ Failed to reload test data. Please refresh the page.`);
4748
4772
  className: "w-full h-full border-0 rounded-lg",
4749
4773
  allow: "camera; microphone; geolocation",
4750
4774
  title: "Identity Verification",
4751
- onLoad: (D) => {
4752
- var S, H, X;
4775
+ onLoad: (F) => {
4776
+ var S, U, X;
4753
4777
  console.log("[Identity] Iframe loaded");
4754
4778
  try {
4755
- const Y = D.target, we = Y.contentDocument || ((S = Y.contentWindow) == null ? void 0 : S.document);
4779
+ const Y = F.target, we = Y.contentDocument || ((S = Y.contentWindow) == null ? void 0 : S.document);
4756
4780
  if (we) {
4757
- const ve = ((X = (H = we.body) == null ? void 0 : H.textContent) == null ? void 0 : X.toLowerCase()) || "";
4758
- (ve.includes("expired") || ve.includes("invalid") || ve.includes("error")) && (console.warn("[Identity] Iframe shows expiration message"), P(!0), g("Your verification link has expired."));
4781
+ const ke = ((X = (U = we.body) == null ? void 0 : U.textContent) == null ? void 0 : X.toLowerCase()) || "";
4782
+ (ke.includes("expired") || ke.includes("invalid") || ke.includes("error")) && (console.warn("[Identity] Iframe shows expiration message"), P(!0), f("Your verification link has expired."));
4759
4783
  }
4760
4784
  } catch {
4761
4785
  console.log("[Identity] Cannot check iframe content (CORS)");
@@ -4764,14 +4788,14 @@ Failed to reload test data. Please refresh the page.`);
4764
4788
  }
4765
4789
  ) })
4766
4790
  ] }),
4767
- n && /* @__PURE__ */ r(pe, { children: /* @__PURE__ */ r(V, { variant: "outline", onClick: n, children: "Back" }) })
4768
- ] }) : B === fe.SardinAI ? /* @__PURE__ */ s(K, { children: [
4791
+ n && /* @__PURE__ */ r(pe, { children: /* @__PURE__ */ r(Z, { variant: "outline", onClick: n, children: "Back" }) })
4792
+ ] }) : B === xe.SardinAI ? /* @__PURE__ */ s(K, { children: [
4769
4793
  /* @__PURE__ */ s(de, { children: [
4770
4794
  /* @__PURE__ */ r("h2", { className: "text-2xl font-bold", children: "Device Risk Assessment" }),
4771
4795
  /* @__PURE__ */ r("p", { className: "text-gray-600 dark:text-gray-400 mt-1", children: "Analyzing device security and behavioral patterns..." })
4772
4796
  ] }),
4773
4797
  /* @__PURE__ */ r(W, { children: /* @__PURE__ */ s("div", { className: "text-center py-12", children: [
4774
- /* @__PURE__ */ r(be, { className: "mb-4" }),
4798
+ /* @__PURE__ */ r(ve, { className: "mb-4" }),
4775
4799
  /* @__PURE__ */ r("p", { className: "text-gray-600 dark:text-gray-400", children: "Please wait while we verify your device security" }),
4776
4800
  /* @__PURE__ */ r("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" })
4777
4801
  ] }) })
@@ -4781,10 +4805,10 @@ Failed to reload test data. Please refresh the page.`);
4781
4805
  /* @__PURE__ */ r("p", { className: "text-gray-600 dark:text-gray-400 mt-1", children: "Please complete the identity verification process" })
4782
4806
  ] }),
4783
4807
  /* @__PURE__ */ r(W, { children: /* @__PURE__ */ r("div", { id: "identity-container", className: "min-h-[400px]" }) }),
4784
- n && /* @__PURE__ */ r(pe, { children: /* @__PURE__ */ r(V, { variant: "outline", onClick: n, children: "Back" }) })
4808
+ n && /* @__PURE__ */ r(pe, { children: /* @__PURE__ */ r(Z, { variant: "outline", onClick: n, children: "Back" }) })
4785
4809
  ] });
4786
4810
  }
4787
- return /* @__PURE__ */ r("form", { onSubmit: _.handleSubmit(O), children: /* @__PURE__ */ s(K, { children: [
4811
+ return /* @__PURE__ */ r("form", { onSubmit: H.handleSubmit(M), children: /* @__PURE__ */ s(K, { children: [
4788
4812
  /* @__PURE__ */ s(de, { children: [
4789
4813
  /* @__PURE__ */ r("h2", { className: "text-lg font-bold", children: "Review Your Information" }),
4790
4814
  /* @__PURE__ */ r("p", { className: "text-gray-600 dark:text-gray-400 mt-1", children: "Please review and confirm your information before starting identity verification" })
@@ -4794,14 +4818,14 @@ Failed to reload test data. Please refresh the page.`);
4794
4818
  /* @__PURE__ */ s("div", { children: [
4795
4819
  /* @__PURE__ */ r("label", { className: "block text-sm font-medium text-gray-500 dark:text-gray-400", children: "Name" }),
4796
4820
  /* @__PURE__ */ s("p", { className: "mt-1 text-base", children: [
4797
- (Z = C == null ? void 0 : C.applicantRequestData) == null ? void 0 : Z.firstName,
4821
+ (J = C == null ? void 0 : C.applicantRequestData) == null ? void 0 : J.firstName,
4798
4822
  " ",
4799
4823
  (w = C == null ? void 0 : C.applicantRequestData) == null ? void 0 : w.lastName
4800
4824
  ] })
4801
4825
  ] }),
4802
4826
  /* @__PURE__ */ s("div", { children: [
4803
4827
  /* @__PURE__ */ r("label", { className: "block text-sm font-medium text-gray-500 dark:text-gray-400", children: "Email" }),
4804
- /* @__PURE__ */ r("p", { className: "mt-1 text-base", children: (U = C == null ? void 0 : C.applicantRequestData) == null ? void 0 : U.email })
4828
+ /* @__PURE__ */ r("p", { className: "mt-1 text-base", children: (q = C == null ? void 0 : C.applicantRequestData) == null ? void 0 : q.email })
4805
4829
  ] }),
4806
4830
  /* @__PURE__ */ s("div", { children: [
4807
4831
  /* @__PURE__ */ r("label", { className: "block text-sm font-medium text-gray-500 dark:text-gray-400", children: "Date of Birth" }),
@@ -4814,7 +4838,7 @@ Failed to reload test data. Please refresh the page.`);
4814
4838
  /* @__PURE__ */ r(
4815
4839
  Pe,
4816
4840
  {
4817
- control: _.control,
4841
+ control: H.control,
4818
4842
  name: "country",
4819
4843
  render: ({ field: B }) => /* @__PURE__ */ r(
4820
4844
  He,
@@ -4823,9 +4847,9 @@ Failed to reload test data. Please refresh the page.`);
4823
4847
  label: "Country",
4824
4848
  options: [
4825
4849
  { value: "", label: "Select country..." },
4826
- ...k.map((D) => ({
4827
- value: D.abbreviation3 || D.abbreviation,
4828
- label: D.name
4850
+ ...k.map((F) => ({
4851
+ value: F.abbreviation3 || F.abbreviation,
4852
+ label: F.name
4829
4853
  }))
4830
4854
  ]
4831
4855
  }
@@ -4835,7 +4859,7 @@ Failed to reload test data. Please refresh the page.`);
4835
4859
  /* @__PURE__ */ r(
4836
4860
  Pe,
4837
4861
  {
4838
- control: _.control,
4862
+ control: H.control,
4839
4863
  name: "nationality",
4840
4864
  render: ({ field: B }) => /* @__PURE__ */ r(
4841
4865
  He,
@@ -4844,9 +4868,9 @@ Failed to reload test data. Please refresh the page.`);
4844
4868
  label: "Nationality",
4845
4869
  options: [
4846
4870
  { value: "", label: "Select nationality..." },
4847
- ...k.map((D) => ({
4848
- value: D.abbreviation3 || D.abbreviation,
4849
- label: D.name
4871
+ ...k.map((F) => ({
4872
+ value: F.abbreviation3 || F.abbreviation,
4873
+ label: F.name
4850
4874
  }))
4851
4875
  ]
4852
4876
  }
@@ -4858,7 +4882,7 @@ Failed to reload test data. Please refresh the page.`);
4858
4882
  /* @__PURE__ */ r(
4859
4883
  Pe,
4860
4884
  {
4861
- control: _.control,
4885
+ control: H.control,
4862
4886
  name: "street",
4863
4887
  render: ({ field: B }) => /* @__PURE__ */ r(me, { ...B, label: "Street" })
4864
4888
  }
@@ -4866,7 +4890,7 @@ Failed to reload test data. Please refresh the page.`);
4866
4890
  /* @__PURE__ */ r(
4867
4891
  Pe,
4868
4892
  {
4869
- control: _.control,
4893
+ control: H.control,
4870
4894
  name: "streetNumber",
4871
4895
  render: ({ field: B }) => /* @__PURE__ */ r(me, { ...B, label: "Street Number" })
4872
4896
  }
@@ -4876,7 +4900,7 @@ Failed to reload test data. Please refresh the page.`);
4876
4900
  /* @__PURE__ */ r(
4877
4901
  Pe,
4878
4902
  {
4879
- control: _.control,
4903
+ control: H.control,
4880
4904
  name: "city",
4881
4905
  render: ({ field: B }) => /* @__PURE__ */ r(me, { ...B, label: "City" })
4882
4906
  }
@@ -4884,7 +4908,7 @@ Failed to reload test data. Please refresh the page.`);
4884
4908
  /* @__PURE__ */ r(
4885
4909
  Pe,
4886
4910
  {
4887
- control: _.control,
4911
+ control: H.control,
4888
4912
  name: "zip",
4889
4913
  render: ({ field: B }) => /* @__PURE__ */ r(me, { ...B, label: "ZIP/Postal Code" })
4890
4914
  }
@@ -4893,7 +4917,7 @@ Failed to reload test data. Please refresh the page.`);
4893
4917
  /* @__PURE__ */ r(
4894
4918
  Pe,
4895
4919
  {
4896
- control: _.control,
4920
+ control: H.control,
4897
4921
  name: "phonenumber",
4898
4922
  render: ({ field: B }) => /* @__PURE__ */ r(me, { ...B, label: "Phone Number", type: "tel" })
4899
4923
  }
@@ -4901,8 +4925,8 @@ Failed to reload test data. Please refresh the page.`);
4901
4925
  ] })
4902
4926
  ] }),
4903
4927
  /* @__PURE__ */ s(pe, { className: "flex justify-between", children: [
4904
- n && /* @__PURE__ */ r(V, { type: "button", variant: "outline", onClick: n, children: "Back" }),
4905
- /* @__PURE__ */ r(V, { type: "submit", isLoading: p, children: "Confirm and Start Verification" })
4928
+ n && /* @__PURE__ */ r(Z, { type: "button", variant: "outline", onClick: n, children: "Back" }),
4929
+ /* @__PURE__ */ r(Z, { type: "submit", isLoading: p, children: "Confirm and Start Verification" })
4906
4930
  ] })
4907
4931
  ] }) });
4908
4932
  }, lt = ({
@@ -5039,10 +5063,10 @@ Failed to reload test data. Please refresh the page.`);
5039
5063
  ] }) })
5040
5064
  ] }),
5041
5065
  /* @__PURE__ */ s(pe, { className: "flex justify-center gap-4", children: [
5042
- d.type === "success" && i && /* @__PURE__ */ r(V, { onClick: i, size: "lg", children: "Continue" }),
5066
+ d.type === "success" && i && /* @__PURE__ */ r(Z, { onClick: i, size: "lg", children: "Continue" }),
5043
5067
  d.type === "error" && /* @__PURE__ */ s(dt, { children: [
5044
- o && /* @__PURE__ */ r(V, { variant: "outline", onClick: o, children: "Contact Support" }),
5045
- i && /* @__PURE__ */ r(V, { onClick: i, children: "Try Again" })
5068
+ o && /* @__PURE__ */ r(Z, { variant: "outline", onClick: o, children: "Contact Support" }),
5069
+ i && /* @__PURE__ */ r(Z, { onClick: i, children: "Try Again" })
5046
5070
  ] }),
5047
5071
  d.type === "pending" && /* @__PURE__ */ r("div", { className: "text-center", children: /* @__PURE__ */ r("p", { className: "text-sm text-gray-500 dark:text-gray-400", children: "Please check back later or wait for our email notification" }) })
5048
5072
  ] })
@@ -5067,11 +5091,11 @@ Failed to reload test data. Please refresh the page.`);
5067
5091
  subtitle: t,
5068
5092
  className: n = ""
5069
5093
  }) => {
5070
- const { currentTheme: a } = ye(), i = e || (a == null ? void 0 : a.title) || "", o = !!(a != null && a.logo && a.logo.visible && a.logo.url), c = !!i;
5071
- return !o && !c ? null : /* @__PURE__ */ s("div", { className: `metakyc-header ${n}`, children: [
5094
+ const { currentTheme: a } = ye(), i = e || (a == null ? void 0 : a.title) || "", o = !!(a != null && a.logo && a.logo.visible && a.logo.url), l = !!i;
5095
+ return !o && !l ? null : /* @__PURE__ */ s("div", { className: `metakyc-header ${n}`, children: [
5072
5096
  /* @__PURE__ */ s("div", { className: "metakyc-header-title flex items-center text-xl font-bold text-gray-900 dark:text-white", children: [
5073
5097
  o && /* @__PURE__ */ r(Qr, { config: a.logo }),
5074
- o && c && /* @__PURE__ */ r(
5098
+ o && l && /* @__PURE__ */ r(
5075
5099
  "span",
5076
5100
  {
5077
5101
  className: "text-gray-400 dark:text-gray-500 mx-3",
@@ -5079,7 +5103,7 @@ Failed to reload test data. Please refresh the page.`);
5079
5103
  children: "|"
5080
5104
  }
5081
5105
  ),
5082
- c && /* @__PURE__ */ r("span", { children: i })
5106
+ l && /* @__PURE__ */ r("span", { children: i })
5083
5107
  ] }),
5084
5108
  t && /* @__PURE__ */ r("p", { className: "text-sm text-gray-600 dark:text-gray-400 mt-1", children: t })
5085
5109
  ] });
@@ -5221,84 +5245,92 @@ const _e = {
5221
5245
  onCancel: a
5222
5246
  }) => {
5223
5247
  var Je, Xe, et, tt;
5224
- const { config: i, baseInformationService: o, currentTheme: c } = ye(), { createApplicant: d, isLoading: u } = Nr(), p = e || ((Je = i.applicantForm) == null ? void 0 : Je.workflowKey);
5248
+ const { config: i, baseInformationService: o, currentTheme: l } = ye(), { createApplicant: d, isLoading: u } = Nr(), p = e || ((Je = i.applicantForm) == null ? void 0 : Je.workflowKey);
5225
5249
  if (!p)
5226
5250
  throw new Error(
5227
5251
  "workflowKey is required. Provide it either as a prop to CreateApplicantForm or set it in config.applicantForm.workflowKey"
5228
5252
  );
5229
- const x = t || ((Xe = i.applicantForm) == null ? void 0 : Xe.externalRefId) || "", N = ((et = i.applicantForm) == null ? void 0 : et.email) || "", m = Ee(
5230
- () => c != null && c.applicantFormPages && c.applicantFormPages.length > 0 ? c.applicantFormPages : null,
5231
- [c == null ? void 0 : c.applicantFormPages]
5232
- ), y = Ee(() => {
5233
- const l = new Set(je), T = c == null ? void 0 : c.applicantFormRequiredFields;
5234
- if (T) for (const L of T) l.add(L);
5253
+ const b = t || ((Xe = i.applicantForm) == null ? void 0 : Xe.externalRefId) || "", N = ((et = i.applicantForm) == null ? void 0 : et.email) || "", m = Ee(
5254
+ () => l != null && l.applicantFormPages && l.applicantFormPages.length > 0 ? l.applicantFormPages : null,
5255
+ [l == null ? void 0 : l.applicantFormPages]
5256
+ ), x = Ee(() => {
5257
+ const c = new Set(je), L = l == null ? void 0 : l.applicantFormRequiredFields;
5258
+ if (L) for (const $ of L) c.add($);
5235
5259
  if (m)
5236
- for (const L of m)
5237
- for (const f of L.fields)
5238
- !f.isCustom && f.name && f.required && l.add(f.name);
5239
- return Array.from(l);
5240
- }, [c == null ? void 0 : c.applicantFormRequiredFields, m]), h = Ee(() => {
5241
- var L;
5260
+ for (const $ of m)
5261
+ for (const g of $.fields)
5262
+ !g.isCustom && g.name && g.required && c.add(g.name);
5263
+ return Array.from(c);
5264
+ }, [l == null ? void 0 : l.applicantFormRequiredFields, m]), h = Ee(() => {
5265
+ var $;
5242
5266
  if (m) {
5243
- const f = m.flatMap((q) => q.fields).filter((q) => !q.isCustom && q.name).map((q) => q.name), v = new Set(f);
5244
- for (const q of je) v.add(q);
5245
- return Array.from(v);
5267
+ const g = m.flatMap((_) => _.fields).filter((_) => !_.isCustom && _.name).map((_) => _.name), y = new Set(g);
5268
+ for (const _ of je) y.add(_);
5269
+ return Array.from(y);
5246
5270
  }
5247
- let l;
5248
- (L = i.applicantForm) != null && L.visibleFields ? l = i.applicantForm.visibleFields : c != null && c.applicantFormVisibleFields && c.applicantFormVisibleFields.length > 0 ? l = c.applicantFormVisibleFields : l = zt;
5249
- const T = new Set(l);
5250
- for (const f of je) T.add(f);
5251
- return Array.from(T);
5252
- }, [(tt = i.applicantForm) == null ? void 0 : tt.visibleFields, c == null ? void 0 : c.applicantFormVisibleFields, m]), C = /* @__PURE__ */ new Set([
5271
+ let c;
5272
+ ($ = i.applicantForm) != null && $.visibleFields ? c = i.applicantForm.visibleFields : l != null && l.applicantFormVisibleFields && l.applicantFormVisibleFields.length > 0 ? c = l.applicantFormVisibleFields : c = zt;
5273
+ const L = new Set(c);
5274
+ for (const g of je) L.add(g);
5275
+ return Array.from(L);
5276
+ }, [(tt = i.applicantForm) == null ? void 0 : tt.visibleFields, l == null ? void 0 : l.applicantFormVisibleFields, m]), C = /* @__PURE__ */ new Set([
5253
5277
  "country",
5254
5278
  "nationality",
5255
5279
  "taxCountry",
5256
5280
  "countryOfBirth",
5257
5281
  "mobileCountryCode",
5258
5282
  "otherNationality"
5259
- ]), F = Ee(() => {
5260
- var T, L;
5261
- const l = /* @__PURE__ */ new Set();
5283
+ ]), D = Ee(() => {
5284
+ var L, $;
5285
+ const c = /* @__PURE__ */ new Set();
5262
5286
  if (m)
5263
- for (const f of m)
5264
- for (const v of f.fields)
5265
- !v.isCustom && v.name && C.has(v.name) && l.add(v.countriesType ?? ((T = Te[v.name]) == null ? void 0 : T.countriesType));
5287
+ for (const g of m)
5288
+ for (const y of g.fields)
5289
+ !y.isCustom && y.name && C.has(y.name) && c.add(y.countriesType ?? ((L = Te[y.name]) == null ? void 0 : L.countriesType));
5266
5290
  else
5267
- for (const f of h)
5268
- C.has(f) && l.add((L = Te[f]) == null ? void 0 : L.countriesType);
5269
- return l.size === 0 && l.add(void 0), Array.from(l);
5270
- }, [h, m]), [k, $] = b({}), [A, I] = b(!0), j = ee(!1), J = ee(/* @__PURE__ */ new Set());
5291
+ for (const g of h)
5292
+ C.has(g) && c.add(($ = Te[g]) == null ? void 0 : $.countriesType);
5293
+ return c.size === 0 && c.add(void 0), Array.from(c);
5294
+ }, [h, m]), [k, z] = v({}), [A, I] = v(!0), j = ee(/* @__PURE__ */ new Set()), G = ee(/* @__PURE__ */ new Set());
5271
5295
  ne(() => {
5272
- if (j.current || F.length === 0) return;
5273
- const l = F.filter((L) => {
5274
- const f = L != null ? String(L) : "all";
5275
- return !J.current.has(f);
5296
+ if (!l) return;
5297
+ const c = D.filter((g) => {
5298
+ const y = g != null ? String(g) : "all";
5299
+ return !G.current.has(y) && !j.current.has(y);
5276
5300
  });
5277
- if (l.length === 0) {
5278
- I(!1);
5301
+ if (c.length === 0) {
5302
+ D.every((y) => {
5303
+ const _ = y != null ? String(y) : "all";
5304
+ return G.current.has(_);
5305
+ }) && I(!1);
5279
5306
  return;
5280
5307
  }
5281
- j.current = !0, I(!0), (async () => {
5308
+ I(!0);
5309
+ const L = c.map((g) => g != null ? String(g) : "all");
5310
+ L.forEach((g) => j.current.add(g)), (async () => {
5282
5311
  try {
5283
- const L = await Promise.all(
5284
- l.map(async (f) => {
5285
- const v = f != null ? String(f) : "all", q = await o.getCountries("", i.locale || "en", f), ae = /* @__PURE__ */ new Set(), ie = q.map((se) => ({ value: se.abbreviation3 || se.abbreviation, label: se.name })).filter((se) => !se.value || ae.has(se.value) ? !1 : (ae.add(se.value), !0));
5286
- return J.current.add(v), [v, ie];
5312
+ const g = await Promise.all(
5313
+ c.map(async (y) => {
5314
+ const _ = y != null ? String(y) : "all", ie = await o.getCountries("", i.locale || "en", y), ae = /* @__PURE__ */ new Set(), fe = ie.map((se) => ({ value: se.abbreviation3 || se.abbreviation, label: se.name })).filter((se) => !se.value || ae.has(se.value) ? !1 : (ae.add(se.value), !0));
5315
+ return G.current.add(_), j.current.delete(_), [_, fe];
5287
5316
  })
5288
5317
  );
5289
- $((f) => ({ ...f, ...Object.fromEntries(L) }));
5290
- } catch (L) {
5291
- console.error("Failed to load countries:", L);
5318
+ z((y) => ({ ...y, ...Object.fromEntries(g) }));
5319
+ } catch (g) {
5320
+ L.forEach((y) => j.current.delete(y)), console.error("Failed to load countries:", g);
5292
5321
  } finally {
5293
- I(!1), j.current = !1;
5322
+ D.every((y) => {
5323
+ const _ = y != null ? String(y) : "all";
5324
+ return G.current.has(_);
5325
+ }) && I(!1);
5294
5326
  }
5295
5327
  })();
5296
- }, [F]);
5297
- const E = (l, T) => {
5298
- var v;
5299
- const L = T ?? ((v = Te[l]) == null ? void 0 : v.countriesType), f = L != null ? String(L) : "all";
5300
- return k[f] || [];
5301
- }, [g, R] = b({
5328
+ }, [D, l]);
5329
+ const E = (c, L) => {
5330
+ var y;
5331
+ const $ = L ?? ((y = Te[c]) == null ? void 0 : y.countriesType), g = $ != null ? String($) : "all";
5332
+ return k[g] || [];
5333
+ }, [f, R] = v({
5302
5334
  workflowKey: p,
5303
5335
  firstName: "",
5304
5336
  lastName: "",
@@ -5306,7 +5338,7 @@ const _e = {
5306
5338
  email: N,
5307
5339
  dateOfBirth: "",
5308
5340
  phonenumber: "",
5309
- externalRefId: x,
5341
+ externalRefId: b,
5310
5342
  mobileCountryCode: "",
5311
5343
  street: "",
5312
5344
  streetNumber: "",
@@ -5323,178 +5355,178 @@ const _e = {
5323
5355
  educationLevel: "",
5324
5356
  occupation: "",
5325
5357
  taxNumber: ""
5326
- }), [P, z] = b({}), [_, O] = b(0), [M, Z] = b({}), [w, U] = b(null), [te, B] = b(!1), D = (l, T) => R((L) => ({ ...L, [l]: T })), S = (l, T) => z((L) => ({ ...L, [l]: T })), H = (l) => !l.conditionalOn || P[l.conditionalOn] === "true", X = m && _ < m.length - 1 ? _ + 1 : -1, Y = m && _ > 0 ? _ - 1 : -1, we = (l) => {
5327
- var L;
5328
- const T = {};
5329
- for (const f of l.fields)
5330
- if (f.isCustom) {
5331
- if (f.customType === "paragraph" || f.customType === "br" || f.customType === "link") continue;
5332
- if (f.required && f.paramName) {
5333
- const v = P[f.paramName], q = f.displayText || f.label || f.paramName;
5334
- f.customType === "checkbox" || f.customType === "link_checkbox" ? v !== "true" && (T[f.paramName] = `${q} is required.`) : (!v || v.trim() === "") && (T[f.paramName] = `${q} is required.`);
5358
+ }), [P, O] = v({}), [H, M] = v(0), [T, J] = v({}), [w, q] = v(null), [te, B] = v(!1), F = (c, L) => R(($) => ({ ...$, [c]: L })), S = (c, L) => O(($) => ({ ...$, [c]: L })), U = (c) => !c.conditionalOn || P[c.conditionalOn] === "true", X = m && H < m.length - 1 ? H + 1 : -1, Y = m && H > 0 ? H - 1 : -1, we = (c) => {
5359
+ var $;
5360
+ const L = {};
5361
+ for (const g of c.fields)
5362
+ if (g.isCustom) {
5363
+ if (g.customType === "paragraph" || g.customType === "br" || g.customType === "link") continue;
5364
+ if (g.required && g.paramName) {
5365
+ const y = P[g.paramName], _ = g.displayText || g.label || g.paramName;
5366
+ g.customType === "checkbox" || g.customType === "link_checkbox" ? y !== "true" && (L[g.paramName] = `${_} is required.`) : (!y || y.trim() === "") && (L[g.paramName] = `${_} is required.`);
5335
5367
  }
5336
- } else if (f.name) {
5337
- const v = f.name;
5338
- if (y.includes(v) && Be(g[v])) {
5339
- const q = f.displayText || ((L = Te[v]) == null ? void 0 : L.label) || v;
5340
- T[v] = `${q} is required.`;
5368
+ } else if (g.name) {
5369
+ const y = g.name;
5370
+ if (x.includes(y) && Be(f[y])) {
5371
+ const _ = g.displayText || (($ = Te[y]) == null ? void 0 : $.label) || y;
5372
+ L[y] = `${_} is required.`;
5341
5373
  }
5342
5374
  }
5343
- return T;
5344
- }, ve = async () => {
5375
+ return L;
5376
+ }, ke = async () => {
5345
5377
  if (!m) return;
5346
- const l = m[_];
5347
- if (l.conditionalOn && !H(l)) {
5348
- Z({}), X >= 0 ? O(X) : await Ce();
5378
+ const c = m[H];
5379
+ if (c.conditionalOn && !U(c)) {
5380
+ J({}), X >= 0 ? M(X) : await Ce();
5349
5381
  return;
5350
5382
  }
5351
- const T = we(l);
5352
- if (Object.keys(T).length > 0) {
5353
- Z(T);
5383
+ const L = we(c);
5384
+ if (Object.keys(L).length > 0) {
5385
+ J(L);
5354
5386
  return;
5355
5387
  }
5356
- Z({}), X >= 0 ? O(X) : await Ce();
5388
+ J({}), X >= 0 ? M(X) : await Ce();
5357
5389
  }, Ce = async () => {
5358
5390
  if (m) {
5359
- let l = {};
5360
- for (const T of m)
5361
- H(T) && (l = { ...l, ...we(T) });
5362
- if (Object.keys(l).length > 0) {
5363
- Z(l);
5391
+ let c = {};
5392
+ for (const L of m)
5393
+ U(L) && (c = { ...c, ...we(L) });
5394
+ if (Object.keys(c).length > 0) {
5395
+ J(c);
5364
5396
  return;
5365
5397
  }
5366
5398
  }
5367
- B(!0), U(null);
5399
+ B(!0), q(null);
5368
5400
  try {
5369
- if (!g.externalRefId || g.externalRefId.trim() === "") {
5370
- U("External Reference ID is required. Please pass it via config.applicantForm.externalRefId.");
5401
+ if (!f.externalRefId || f.externalRefId.trim() === "") {
5402
+ q("External Reference ID is required. Please pass it via config.applicantForm.externalRefId.");
5371
5403
  return;
5372
5404
  }
5373
- const l = {
5374
- workflowKey: g.workflowKey,
5375
- externalRefId: g.externalRefId.trim()
5405
+ const c = {
5406
+ workflowKey: f.workflowKey,
5407
+ externalRefId: f.externalRefId.trim()
5376
5408
  };
5377
5409
  if (m) {
5378
- for (const f of m)
5379
- if (H(f)) {
5380
- for (const v of f.fields)
5381
- if (!v.isCustom && v.name) {
5382
- const q = v.name, ae = g[q];
5383
- Be(ae) || (l[q] = ae);
5410
+ for (const g of m)
5411
+ if (U(g)) {
5412
+ for (const y of g.fields)
5413
+ if (!y.isCustom && y.name) {
5414
+ const _ = y.name, ie = f[_];
5415
+ Be(ie) || (c[_] = ie);
5384
5416
  }
5385
5417
  }
5386
- for (const f of je)
5387
- if (l[f] === void 0) {
5388
- const v = g[f];
5389
- Be(v) || (l[f] = v);
5418
+ for (const g of je)
5419
+ if (c[g] === void 0) {
5420
+ const y = f[g];
5421
+ Be(y) || (c[g] = y);
5390
5422
  }
5391
5423
  } else
5392
- h.forEach((f) => {
5393
- if (f === "externalRefId") return;
5394
- const v = g[f];
5395
- Be(v) || (l[f] = v);
5424
+ h.forEach((g) => {
5425
+ if (g === "externalRefId") return;
5426
+ const y = f[g];
5427
+ Be(y) || (c[g] = y);
5396
5428
  });
5397
- const T = [];
5429
+ const L = [];
5398
5430
  if (m) {
5399
- for (const f of m)
5400
- if (H(f)) {
5401
- for (const v of f.fields)
5402
- if (v.isCustom && v.paramName && v.customType !== "paragraph" && v.customType !== "br" && v.customType !== "link") {
5403
- const q = P[v.paramName] ?? "";
5404
- T.push({ paramName: v.paramName, paramValue: q });
5431
+ for (const g of m)
5432
+ if (U(g)) {
5433
+ for (const y of g.fields)
5434
+ if (y.isCustom && y.paramName && y.customType !== "paragraph" && y.customType !== "br" && y.customType !== "link") {
5435
+ const _ = P[y.paramName] ?? "";
5436
+ L.push({ paramName: y.paramName, paramValue: _ });
5405
5437
  }
5406
5438
  }
5407
5439
  }
5408
- T.length > 0 && (l.applicantAdditionalDatas = T);
5409
- const L = await d(l);
5410
- n(L.applicantId);
5411
- } catch (l) {
5412
- console.error("Error creating applicant:", l), U(l.message || "Failed to create applicant");
5440
+ L.length > 0 && (c.applicantAdditionalDatas = L);
5441
+ const $ = await d(c);
5442
+ n($.applicantId);
5443
+ } catch (c) {
5444
+ console.error("Error creating applicant:", c), q(c.message || "Failed to create applicant");
5413
5445
  } finally {
5414
5446
  B(!1);
5415
5447
  }
5416
- }, ft = async (l) => {
5417
- var T;
5418
- l.preventDefault();
5419
- for (const L of y)
5420
- if (Be(g[L])) {
5421
- const f = ((T = Te[L]) == null ? void 0 : T.label) || L;
5422
- U(`${f} is required.`);
5448
+ }, ft = async (c) => {
5449
+ var L;
5450
+ c.preventDefault();
5451
+ for (const $ of x)
5452
+ if (Be(f[$])) {
5453
+ const g = ((L = Te[$]) == null ? void 0 : L.label) || $;
5454
+ q(`${g} is required.`);
5423
5455
  return;
5424
5456
  }
5425
5457
  await Ce();
5426
- }, Ze = (l, T, L, f) => {
5458
+ }, Ze = (c, L, $, g) => {
5427
5459
  var rt;
5428
- const v = Te[l];
5429
- if (!v) return null;
5430
- const q = y.includes(l), ae = M[l], ie = L || v.label, se = T ?? l, ke = { required: q };
5431
- switch (v.type) {
5460
+ const y = Te[c];
5461
+ if (!y) return null;
5462
+ const _ = x.includes(c), ie = T[c], ae = $ || y.label, fe = L ?? c, se = { required: _ };
5463
+ switch (y.type) {
5432
5464
  case "select":
5433
- if (l === "country" || l === "nationality" || l === "taxCountry" || l === "countryOfBirth" || l === "mobileCountryCode") {
5434
- const le = E(l, f);
5465
+ if (c === "country" || c === "nationality" || c === "taxCountry" || c === "countryOfBirth" || c === "mobileCountryCode") {
5466
+ const le = E(c, g);
5435
5467
  return /* @__PURE__ */ r(
5436
5468
  We,
5437
5469
  {
5438
- ...ke,
5439
- label: ie,
5440
- value: g[l] || "",
5441
- onChange: (Re) => D(l, Re),
5442
- options: [{ value: "", label: `Select ${ie.toLowerCase()}...` }, ...le],
5470
+ ...se,
5471
+ label: ae,
5472
+ value: f[c] || "",
5473
+ onChange: (Re) => F(c, Re),
5474
+ options: [{ value: "", label: `Select ${ae.toLowerCase()}...` }, ...le],
5443
5475
  disabled: A,
5444
- error: ae
5476
+ error: ie
5445
5477
  },
5446
- se
5478
+ fe
5447
5479
  );
5448
5480
  }
5449
- if (l === "salutation")
5481
+ if (c === "salutation")
5450
5482
  return /* @__PURE__ */ r(
5451
5483
  We,
5452
5484
  {
5453
- ...ke,
5454
- label: ie,
5455
- value: ((rt = g[l]) == null ? void 0 : rt.toString()) || "",
5456
- onChange: (le) => D(l, le ? Number(le) : null),
5485
+ ...se,
5486
+ label: ae,
5487
+ value: ((rt = f[c]) == null ? void 0 : rt.toString()) || "",
5488
+ onChange: (le) => F(c, le ? Number(le) : null),
5457
5489
  options: [
5458
5490
  { value: "", label: "Select salutation..." },
5459
5491
  { value: Ke.Male.toString(), label: "Male" },
5460
5492
  { value: Ke.Female.toString(), label: "Female" },
5461
5493
  { value: Ke.Other.toString(), label: "Other" }
5462
5494
  ],
5463
- error: ae
5495
+ error: ie
5464
5496
  },
5465
- se
5497
+ fe
5466
5498
  );
5467
- if (l === "defaultLanguage") {
5468
- const le = c != null && c.allowedLanguages && c.allowedLanguages.length > 0 ? at.filter((Re) => c.allowedLanguages.includes(Re.value)) : at;
5499
+ if (c === "defaultLanguage") {
5500
+ const le = l != null && l.allowedLanguages && l.allowedLanguages.length > 0 ? at.filter((Re) => l.allowedLanguages.includes(Re.value)) : at;
5469
5501
  return /* @__PURE__ */ r(
5470
5502
  We,
5471
5503
  {
5472
- ...ke,
5473
- label: ie,
5474
- value: g[l] || "",
5475
- onChange: (Re) => D(l, Re),
5504
+ ...se,
5505
+ label: ae,
5506
+ value: f[c] || "",
5507
+ onChange: (Re) => F(c, Re),
5476
5508
  options: [{ value: "", label: "Select language..." }, ...le],
5477
- error: ae
5509
+ error: ie
5478
5510
  },
5479
- se
5511
+ fe
5480
5512
  );
5481
5513
  }
5482
5514
  return null;
5483
5515
  case "multiselect":
5484
- if (l === "otherNationality") {
5485
- const le = E(l, f);
5516
+ if (c === "otherNationality") {
5517
+ const le = E(c, g);
5486
5518
  return /* @__PURE__ */ r(
5487
5519
  Sr,
5488
5520
  {
5489
- ...ke,
5490
- label: ie,
5491
- value: g[l] || [],
5492
- onChange: (Re) => D(l, Re),
5521
+ ...se,
5522
+ label: ae,
5523
+ value: f[c] || [],
5524
+ onChange: (Re) => F(c, Re),
5493
5525
  options: le,
5494
5526
  placeholder: "Select other nationalities...",
5495
5527
  disabled: A
5496
5528
  },
5497
- se
5529
+ fe
5498
5530
  );
5499
5531
  }
5500
5532
  return null;
@@ -5502,58 +5534,58 @@ const _e = {
5502
5534
  return /* @__PURE__ */ r(
5503
5535
  me,
5504
5536
  {
5505
- ...ke,
5537
+ ...se,
5506
5538
  type: "date",
5507
- label: ie,
5508
- value: g[l] || "",
5509
- onChange: (le) => D(l, le.target.value),
5510
- error: ae
5539
+ label: ae,
5540
+ value: f[c] || "",
5541
+ onChange: (le) => F(c, le.target.value),
5542
+ error: ie
5511
5543
  },
5512
- se
5544
+ fe
5513
5545
  );
5514
5546
  case "email":
5515
5547
  return /* @__PURE__ */ r(
5516
5548
  me,
5517
5549
  {
5518
- ...ke,
5550
+ ...se,
5519
5551
  type: "email",
5520
- label: ie,
5521
- value: g[l] || "",
5522
- onChange: (le) => D(l, le.target.value),
5523
- error: ae
5552
+ label: ae,
5553
+ value: f[c] || "",
5554
+ onChange: (le) => F(c, le.target.value),
5555
+ error: ie
5524
5556
  },
5525
- se
5557
+ fe
5526
5558
  );
5527
5559
  case "tel":
5528
5560
  return /* @__PURE__ */ r(
5529
5561
  me,
5530
5562
  {
5531
- ...ke,
5563
+ ...se,
5532
5564
  type: "tel",
5533
- label: ie,
5534
- value: g[l] || "",
5535
- onChange: (le) => D(l, le.target.value),
5536
- error: ae
5565
+ label: ae,
5566
+ value: f[c] || "",
5567
+ onChange: (le) => F(c, le.target.value),
5568
+ error: ie
5537
5569
  },
5538
- se
5570
+ fe
5539
5571
  );
5540
5572
  default:
5541
5573
  return /* @__PURE__ */ r(
5542
5574
  me,
5543
5575
  {
5544
- ...ke,
5576
+ ...se,
5545
5577
  type: "text",
5546
- label: ie,
5547
- value: g[l] || "",
5548
- onChange: (le) => D(l, le.target.value),
5549
- error: ae
5578
+ label: ae,
5579
+ value: f[c] || "",
5580
+ onChange: (le) => F(c, le.target.value),
5581
+ error: ie
5550
5582
  },
5551
- se
5583
+ fe
5552
5584
  );
5553
5585
  }
5554
- }, xt = (l, T) => {
5555
- if (l.customType === "paragraph") {
5556
- const v = l.displayText || l.label || "";
5586
+ }, xt = (c, L) => {
5587
+ if (c.customType === "paragraph") {
5588
+ const y = c.displayText || c.label || "";
5557
5589
  return /* @__PURE__ */ r(
5558
5590
  "p",
5559
5591
  {
@@ -5564,19 +5596,19 @@ const _e = {
5564
5596
  margin: 0,
5565
5597
  color: "var(--metakyc-text-secondary, #6b7280)"
5566
5598
  },
5567
- dangerouslySetInnerHTML: { __html: v }
5599
+ dangerouslySetInnerHTML: { __html: y }
5568
5600
  },
5569
- `custom-${T}`
5601
+ `custom-${L}`
5570
5602
  );
5571
5603
  }
5572
- if (l.customType === "br")
5573
- return /* @__PURE__ */ r("div", { style: { height: "12px" } }, `custom-${T}`);
5574
- if (l.customType === "link") {
5575
- const v = l.displayText || l.label || l.linkText || l.linkUrl || "";
5604
+ if (c.customType === "br")
5605
+ return /* @__PURE__ */ r("div", { style: { height: "12px" } }, `custom-${L}`);
5606
+ if (c.customType === "link") {
5607
+ const y = c.displayText || c.label || c.linkText || c.linkUrl || "";
5576
5608
  return /* @__PURE__ */ r("div", { className: "metakyc-link-field", children: /* @__PURE__ */ s(
5577
5609
  "a",
5578
5610
  {
5579
- href: l.linkUrl || "#",
5611
+ href: c.linkUrl || "#",
5580
5612
  target: "_blank",
5581
5613
  rel: "noopener noreferrer",
5582
5614
  style: {
@@ -5589,15 +5621,15 @@ const _e = {
5589
5621
  cursor: "pointer"
5590
5622
  },
5591
5623
  children: [
5592
- v,
5624
+ y,
5593
5625
  /* @__PURE__ */ r("span", { style: { fontSize: "10px", opacity: 0.7 }, children: "↗" })
5594
5626
  ]
5595
5627
  }
5596
- ) }, `custom-${T}`);
5628
+ ) }, `custom-${L}`);
5597
5629
  }
5598
- if (!l.paramName) return null;
5599
- const L = M[l.paramName], f = l.displayText || l.label || l.paramName;
5600
- if (l.customType === "checkbox")
5630
+ if (!c.paramName) return null;
5631
+ const $ = T[c.paramName], g = c.displayText || c.label || c.paramName;
5632
+ if (c.customType === "checkbox")
5601
5633
  return /* @__PURE__ */ s("div", { className: "flex flex-col gap-1", children: [
5602
5634
  /* @__PURE__ */ s(
5603
5635
  "label",
@@ -5609,8 +5641,8 @@ const _e = {
5609
5641
  "input",
5610
5642
  {
5611
5643
  type: "checkbox",
5612
- checked: P[l.paramName] === "true",
5613
- onChange: (v) => S(l.paramName, v.target.checked ? "true" : "false"),
5644
+ checked: P[c.paramName] === "true",
5645
+ onChange: (y) => S(c.paramName, y.target.checked ? "true" : "false"),
5614
5646
  className: "metakyc-option-input",
5615
5647
  style: _e
5616
5648
  }
@@ -5621,17 +5653,17 @@ const _e = {
5621
5653
  className: "metakyc-option-text",
5622
5654
  style: { fontSize: "14px", color: "var(--metakyc-text-primary, #111827)", lineHeight: "1.4" },
5623
5655
  children: [
5624
- f,
5625
- l.required && /* @__PURE__ */ r("span", { className: "text-red-500 ml-0.5", children: "*" })
5656
+ g,
5657
+ c.required && /* @__PURE__ */ r("span", { className: "text-red-500 ml-0.5", children: "*" })
5626
5658
  ]
5627
5659
  }
5628
5660
  )
5629
5661
  ]
5630
5662
  }
5631
5663
  ),
5632
- L && /* @__PURE__ */ r("p", { className: "text-red-500 text-xs mt-0.5", children: L })
5633
- ] }, `custom-${T}`);
5634
- if (l.customType === "link_checkbox")
5664
+ $ && /* @__PURE__ */ r("p", { className: "text-red-500 text-xs mt-0.5", children: $ })
5665
+ ] }, `custom-${L}`);
5666
+ if (c.customType === "link_checkbox")
5635
5667
  return /* @__PURE__ */ s("div", { className: "flex flex-col gap-1", children: [
5636
5668
  /* @__PURE__ */ s(
5637
5669
  "label",
@@ -5643,8 +5675,8 @@ const _e = {
5643
5675
  "input",
5644
5676
  {
5645
5677
  type: "checkbox",
5646
- checked: P[l.paramName] === "true",
5647
- onChange: (v) => S(l.paramName, v.target.checked ? "true" : "false"),
5678
+ checked: P[c.paramName] === "true",
5679
+ onChange: (y) => S(c.paramName, y.target.checked ? "true" : "false"),
5648
5680
  className: "metakyc-option-input",
5649
5681
  style: { ..._e, alignSelf: "flex-start", marginTop: "2px" }
5650
5682
  }
@@ -5655,31 +5687,31 @@ const _e = {
5655
5687
  className: "metakyc-option-text",
5656
5688
  style: { fontSize: "14px", color: "var(--metakyc-text-primary, #111827)", lineHeight: "1.4" },
5657
5689
  children: [
5658
- f,
5690
+ g,
5659
5691
  " ",
5660
- l.linkUrl && /* @__PURE__ */ r(
5692
+ c.linkUrl && /* @__PURE__ */ r(
5661
5693
  "a",
5662
5694
  {
5663
- href: l.linkUrl,
5695
+ href: c.linkUrl,
5664
5696
  target: "_blank",
5665
5697
  rel: "noopener noreferrer",
5666
5698
  className: "underline",
5667
5699
  style: { color: "var(--metakyc-primary, #2563eb)" },
5668
- onClick: (v) => v.stopPropagation(),
5669
- children: l.linkText || l.linkUrl
5700
+ onClick: (y) => y.stopPropagation(),
5701
+ children: c.linkText || c.linkUrl
5670
5702
  }
5671
5703
  ),
5672
- l.required && /* @__PURE__ */ r("span", { className: "text-red-500 ml-0.5", children: "*" })
5704
+ c.required && /* @__PURE__ */ r("span", { className: "text-red-500 ml-0.5", children: "*" })
5673
5705
  ]
5674
5706
  }
5675
5707
  )
5676
5708
  ]
5677
5709
  }
5678
5710
  ),
5679
- L && /* @__PURE__ */ r("p", { className: "text-red-500 text-xs mt-0.5", children: L })
5680
- ] }, `custom-${T}`);
5681
- if (l.customType === "group_checkbox") {
5682
- const v = (P[l.paramName] || "").split(",").filter(Boolean);
5711
+ $ && /* @__PURE__ */ r("p", { className: "text-red-500 text-xs mt-0.5", children: $ })
5712
+ ] }, `custom-${L}`);
5713
+ if (c.customType === "group_checkbox") {
5714
+ const y = (P[c.paramName] || "").split(",").filter(Boolean);
5683
5715
  return /* @__PURE__ */ s("div", { className: "flex flex-col gap-1.5", children: [
5684
5716
  /* @__PURE__ */ s(
5685
5717
  "div",
@@ -5687,13 +5719,13 @@ const _e = {
5687
5719
  className: "text-sm font-medium",
5688
5720
  style: { color: "var(--metakyc-text-primary, #111827)" },
5689
5721
  children: [
5690
- f,
5691
- l.required && /* @__PURE__ */ r("span", { className: "text-red-500 ml-0.5", children: "*" })
5722
+ g,
5723
+ c.required && /* @__PURE__ */ r("span", { className: "text-red-500 ml-0.5", children: "*" })
5692
5724
  ]
5693
5725
  }
5694
5726
  ),
5695
- /* @__PURE__ */ r("div", { className: "metakyc-options-group", style: { display: "flex", flexDirection: "column", gap: "8px" }, children: (l.options || []).map((q) => {
5696
- const ae = l.singleSelect ? P[l.paramName] === q.value : v.includes(q.value);
5727
+ /* @__PURE__ */ r("div", { className: "metakyc-options-group", style: { display: "flex", flexDirection: "column", gap: "8px" }, children: (c.options || []).map((_) => {
5728
+ const ie = c.singleSelect ? P[c.paramName] === _.value : y.includes(_.value);
5697
5729
  return /* @__PURE__ */ s(
5698
5730
  "label",
5699
5731
  {
@@ -5704,13 +5736,13 @@ const _e = {
5704
5736
  "input",
5705
5737
  {
5706
5738
  type: "checkbox",
5707
- checked: ae,
5708
- onChange: (ie) => {
5709
- if (l.singleSelect)
5710
- S(l.paramName, ie.target.checked ? q.value : "");
5739
+ checked: ie,
5740
+ onChange: (ae) => {
5741
+ if (c.singleSelect)
5742
+ S(c.paramName, ae.target.checked ? _.value : "");
5711
5743
  else {
5712
- const se = ie.target.checked ? [...v, q.value] : v.filter((ke) => ke !== q.value);
5713
- S(l.paramName, se.join(","));
5744
+ const fe = ae.target.checked ? [...y, _.value] : y.filter((se) => se !== _.value);
5745
+ S(c.paramName, fe.join(","));
5714
5746
  }
5715
5747
  },
5716
5748
  className: "metakyc-option-input",
@@ -5722,30 +5754,30 @@ const _e = {
5722
5754
  {
5723
5755
  className: "metakyc-option-text",
5724
5756
  style: { fontSize: "14px", color: "var(--metakyc-text-primary, #111827)", lineHeight: "1.4" },
5725
- children: q.label
5757
+ children: _.label
5726
5758
  }
5727
5759
  )
5728
5760
  ]
5729
5761
  },
5730
- q.value
5762
+ _.value
5731
5763
  );
5732
5764
  }) }),
5733
- L && /* @__PURE__ */ r("p", { className: "text-red-500 text-xs", children: L })
5734
- ] }, `custom-${T}`);
5765
+ $ && /* @__PURE__ */ r("p", { className: "text-red-500 text-xs", children: $ })
5766
+ ] }, `custom-${L}`);
5735
5767
  }
5736
- return l.customType === "radio_group" ? /* @__PURE__ */ s("div", { className: "flex flex-col gap-1.5", children: [
5768
+ return c.customType === "radio_group" ? /* @__PURE__ */ s("div", { className: "flex flex-col gap-1.5", children: [
5737
5769
  /* @__PURE__ */ s(
5738
5770
  "div",
5739
5771
  {
5740
5772
  className: "text-sm font-medium",
5741
5773
  style: { color: "var(--metakyc-text-primary, #111827)" },
5742
5774
  children: [
5743
- f,
5744
- l.required && /* @__PURE__ */ r("span", { className: "text-red-500 ml-0.5", children: "*" })
5775
+ g,
5776
+ c.required && /* @__PURE__ */ r("span", { className: "text-red-500 ml-0.5", children: "*" })
5745
5777
  ]
5746
5778
  }
5747
5779
  ),
5748
- /* @__PURE__ */ r("div", { className: "metakyc-options-group", style: { display: "flex", flexDirection: "column", gap: "8px" }, children: (l.options || []).map((v) => /* @__PURE__ */ s(
5780
+ /* @__PURE__ */ r("div", { className: "metakyc-options-group", style: { display: "flex", flexDirection: "column", gap: "8px" }, children: (c.options || []).map((y) => /* @__PURE__ */ s(
5749
5781
  "label",
5750
5782
  {
5751
5783
  className: "metakyc-option-label",
@@ -5755,9 +5787,9 @@ const _e = {
5755
5787
  "input",
5756
5788
  {
5757
5789
  type: "radio",
5758
- checked: P[l.paramName] === v.value,
5759
- onChange: () => S(l.paramName, v.value),
5760
- name: `radio-group-${l.paramName}-${T}`,
5790
+ checked: P[c.paramName] === y.value,
5791
+ onChange: () => S(c.paramName, y.value),
5792
+ name: `radio-group-${c.paramName}-${L}`,
5761
5793
  className: "metakyc-option-input",
5762
5794
  style: _e
5763
5795
  }
@@ -5767,30 +5799,30 @@ const _e = {
5767
5799
  {
5768
5800
  className: "metakyc-option-text",
5769
5801
  style: { fontSize: "14px", color: "var(--metakyc-text-primary, #111827)", lineHeight: "1.4" },
5770
- children: v.label
5802
+ children: y.label
5771
5803
  }
5772
5804
  )
5773
5805
  ]
5774
5806
  },
5775
- v.value
5807
+ y.value
5776
5808
  )) }),
5777
- L && /* @__PURE__ */ r("p", { className: "text-red-500 text-xs", children: L })
5778
- ] }, `custom-${T}`) : /* @__PURE__ */ r(
5809
+ $ && /* @__PURE__ */ r("p", { className: "text-red-500 text-xs", children: $ })
5810
+ ] }, `custom-${L}`) : /* @__PURE__ */ r(
5779
5811
  me,
5780
5812
  {
5781
5813
  type: "text",
5782
- label: `${f}${l.required ? " *" : ""}`,
5783
- value: P[l.paramName] || "",
5784
- onChange: (v) => S(l.paramName, v.target.value),
5785
- required: l.required,
5786
- error: L
5814
+ label: `${g}${c.required ? " *" : ""}`,
5815
+ value: P[c.paramName] || "",
5816
+ onChange: (y) => S(c.paramName, y.target.value),
5817
+ required: c.required,
5818
+ error: $
5787
5819
  },
5788
- `custom-${T}`
5820
+ `custom-${L}`
5789
5821
  );
5790
- }, bt = (l, T) => {
5791
- const L = H(l);
5822
+ }, bt = (c, L) => {
5823
+ const $ = U(c);
5792
5824
  return /* @__PURE__ */ s("div", { className: "space-y-4", children: [
5793
- l.conditionalOn && /* @__PURE__ */ r(ct, { helpText: l.conditionalHelpText, children: /* @__PURE__ */ s(
5825
+ c.conditionalOn && /* @__PURE__ */ r(ct, { helpText: c.conditionalHelpText, children: /* @__PURE__ */ s(
5794
5826
  "label",
5795
5827
  {
5796
5828
  className: "metakyc-option-label",
@@ -5800,8 +5832,8 @@ const _e = {
5800
5832
  "input",
5801
5833
  {
5802
5834
  type: "checkbox",
5803
- checked: L,
5804
- onChange: (f) => S(l.conditionalOn, f.target.checked ? "true" : "false"),
5835
+ checked: $,
5836
+ onChange: (g) => S(c.conditionalOn, g.target.checked ? "true" : "false"),
5805
5837
  className: "metakyc-option-input",
5806
5838
  style: _e
5807
5839
  }
@@ -5811,120 +5843,120 @@ const _e = {
5811
5843
  {
5812
5844
  className: "metakyc-option-text",
5813
5845
  style: { fontSize: "14px", color: "var(--metakyc-text-primary, #111827)", lineHeight: "1.4", fontWeight: 500 },
5814
- children: l.conditionalOn
5846
+ children: c.conditionalOn
5815
5847
  }
5816
5848
  )
5817
5849
  ]
5818
5850
  }
5819
5851
  ) }),
5820
- L && /* @__PURE__ */ r("div", { className: "grid grid-cols-4 gap-4", children: l.fields.map((f, v) => {
5821
- const q = f.colSpan === 1 ? "col-span-1" : f.colSpan === 2 ? "col-span-2" : f.colSpan === 3 ? "col-span-3" : "col-span-4", ae = f.isCustom ? `custom-${v}-${f.paramName}` : `builtin-${f.name}-${v}`;
5822
- return /* @__PURE__ */ r("div", { className: q, children: /* @__PURE__ */ r(ct, { helpText: f.helpText, children: f.isCustom ? xt(f, v) : Ze(f.name, ae, f.displayText, f.countriesType) }) }, ae);
5852
+ $ && /* @__PURE__ */ r("div", { className: "grid grid-cols-4 gap-4", children: c.fields.map((g, y) => {
5853
+ const _ = g.colSpan === 1 ? "col-span-1" : g.colSpan === 2 ? "col-span-2" : g.colSpan === 3 ? "col-span-3" : "col-span-4", ie = g.isCustom ? `custom-${y}-${g.paramName}` : `builtin-${g.name}-${y}`;
5854
+ return /* @__PURE__ */ r("div", { className: _, children: /* @__PURE__ */ r(ct, { helpText: g.helpText, children: g.isCustom ? xt(g, y) : Ze(g.name, ie, g.displayText, g.countriesType) }) }, ie);
5823
5855
  }) })
5824
5856
  ] });
5825
5857
  };
5826
- if (A)
5858
+ if (!l || A)
5827
5859
  return /* @__PURE__ */ r("div", { className: "metakyc-sdk", children: /* @__PURE__ */ r(K, { children: /* @__PURE__ */ s(W, { children: [
5828
- /* @__PURE__ */ r(be, { className: "my-8" }),
5829
- /* @__PURE__ */ r("p", { className: "text-center text-gray-600 dark:text-gray-400 mt-4", children: "Loading form..." })
5860
+ /* @__PURE__ */ r(ve, { className: "my-8" }),
5861
+ /* @__PURE__ */ r("p", { className: "text-center mt-4", style: { color: "var(--metakyc-text-secondary, #6b7280)", fontSize: "0.875rem" }, children: "Loading form" })
5830
5862
  ] }) }) });
5831
5863
  if (m) {
5832
- const l = m[_] ?? m[0], T = Y === -1, L = X === -1, f = m.length, v = H(l), q = Object.values(M);
5864
+ const c = m[H] ?? m[0], L = Y === -1, $ = X === -1, g = m.length, y = U(c), _ = Object.values(T);
5833
5865
  return /* @__PURE__ */ r("div", { className: "metakyc-sdk", children: /* @__PURE__ */ s(K, { children: [
5834
- /* @__PURE__ */ r(de, { children: /* @__PURE__ */ r(Ge, { title: (c == null ? void 0 : c.title) || "Create Applicant" }) }),
5866
+ /* @__PURE__ */ r(de, { children: /* @__PURE__ */ r(Ge, { title: (l == null ? void 0 : l.title) || "Create Applicant" }) }),
5835
5867
  /* @__PURE__ */ s(W, { children: [
5836
- (l.title || l.subtitle || l.description) && /* @__PURE__ */ s("div", { className: "mb-4", children: [
5837
- l.title && /* @__PURE__ */ r(
5868
+ (c.title || c.subtitle || c.description) && /* @__PURE__ */ s("div", { className: "mb-4", children: [
5869
+ c.title && /* @__PURE__ */ r(
5838
5870
  "h3",
5839
5871
  {
5840
5872
  className: "font-semibold text-base",
5841
5873
  style: { color: "var(--metakyc-text-primary, #111827)" },
5842
- children: l.title
5874
+ children: c.title
5843
5875
  }
5844
5876
  ),
5845
- l.subtitle && /* @__PURE__ */ r(
5877
+ c.subtitle && /* @__PURE__ */ r(
5846
5878
  "p",
5847
5879
  {
5848
5880
  className: "text-sm mt-0.5",
5849
5881
  style: { color: "var(--metakyc-text-secondary, #6b7280)" },
5850
- children: l.subtitle
5882
+ children: c.subtitle
5851
5883
  }
5852
5884
  ),
5853
- l.description && l.description !== l.subtitle && /* @__PURE__ */ r(
5885
+ c.description && c.description !== c.subtitle && /* @__PURE__ */ r(
5854
5886
  "p",
5855
5887
  {
5856
5888
  className: "text-xs mt-1",
5857
5889
  style: { color: "var(--metakyc-text-secondary, #6b7280)" },
5858
- children: l.description
5890
+ children: c.description
5859
5891
  }
5860
5892
  )
5861
5893
  ] }),
5862
- (w || q.length > 0) && /* @__PURE__ */ s("div", { className: "mb-4 p-3 bg-red-50 border border-red-200 rounded-lg", children: [
5894
+ (w || _.length > 0) && /* @__PURE__ */ s("div", { className: "mb-4 p-3 bg-red-50 border border-red-200 rounded-lg", children: [
5863
5895
  w && /* @__PURE__ */ s("p", { className: "text-red-600 text-sm", children: [
5864
5896
  /* @__PURE__ */ r("strong", { children: "Error:" }),
5865
5897
  " ",
5866
5898
  w
5867
5899
  ] }),
5868
- q.map((ae, ie) => /* @__PURE__ */ r("p", { className: "text-red-600 text-sm", children: ae }, ie))
5900
+ _.map((ie, ae) => /* @__PURE__ */ r("p", { className: "text-red-600 text-sm", children: ie }, ae))
5869
5901
  ] }),
5870
- f > 1 && /* @__PURE__ */ s("div", { className: "flex items-center gap-2 mb-4", children: [
5871
- m.map((ae, ie) => /* @__PURE__ */ r(
5902
+ g > 1 && /* @__PURE__ */ s("div", { className: "flex items-center gap-2 mb-4", children: [
5903
+ m.map((ie, ae) => /* @__PURE__ */ r(
5872
5904
  "div",
5873
5905
  {
5874
- className: `h-1.5 rounded-full transition-all ${ie === _ ? "flex-1" : "w-8"}`,
5875
- style: ie === _ ? { backgroundColor: "var(--metakyc-primary, #2563eb)" } : ie < _ ? { backgroundColor: "var(--metakyc-primary-light, #93c5fd)", opacity: 0.7 } : { backgroundColor: "#e5e7eb" }
5906
+ className: `h-1.5 rounded-full transition-all ${ae === H ? "flex-1" : "w-8"}`,
5907
+ style: ae === H ? { backgroundColor: "var(--metakyc-primary, #2563eb)" } : ae < H ? { backgroundColor: "var(--metakyc-primary-light, #93c5fd)", opacity: 0.7 } : { backgroundColor: "#e5e7eb" }
5876
5908
  },
5877
- ie
5909
+ ae
5878
5910
  )),
5879
5911
  /* @__PURE__ */ s("span", { className: "text-xs text-gray-400 flex-shrink-0", children: [
5880
- _ + 1,
5912
+ H + 1,
5881
5913
  " / ",
5882
- f
5914
+ g
5883
5915
  ] })
5884
5916
  ] }),
5885
- bt(l)
5917
+ bt(c)
5886
5918
  ] }),
5887
5919
  /* @__PURE__ */ s(pe, { className: "flex justify-between", children: [
5888
5920
  /* @__PURE__ */ s("div", { children: [
5889
- !T && /* @__PURE__ */ r(
5890
- V,
5921
+ !L && /* @__PURE__ */ r(
5922
+ Z,
5891
5923
  {
5892
5924
  type: "button",
5893
5925
  variant: "outline",
5894
5926
  onClick: () => {
5895
- O(Y), Z({});
5927
+ M(Y), J({});
5896
5928
  },
5897
5929
  disabled: te || u,
5898
5930
  children: "Previous"
5899
5931
  }
5900
5932
  ),
5901
- T && a && /* @__PURE__ */ r(V, { type: "button", variant: "outline", onClick: a, disabled: te || u, children: "Cancel" })
5933
+ L && a && /* @__PURE__ */ r(Z, { type: "button", variant: "outline", onClick: a, disabled: te || u, children: "Cancel" })
5902
5934
  ] }),
5903
5935
  /* @__PURE__ */ r(
5904
- V,
5936
+ Z,
5905
5937
  {
5906
5938
  type: "button",
5907
5939
  isLoading: te || u,
5908
- onClick: L ? Ce : ve,
5909
- children: L ? l.conditionalOn && !v ? "Skip & Submit" : "Submit" : l.conditionalOn && !v ? "Skip" : "Next"
5940
+ onClick: $ ? Ce : ke,
5941
+ children: $ ? c.conditionalOn && !y ? "Skip & Submit" : "Submit" : c.conditionalOn && !y ? "Skip" : "Next"
5910
5942
  }
5911
5943
  )
5912
5944
  ] })
5913
5945
  ] }) });
5914
5946
  }
5915
5947
  return /* @__PURE__ */ r("div", { className: "metakyc-sdk", children: /* @__PURE__ */ r("form", { onSubmit: ft, children: /* @__PURE__ */ s(K, { children: [
5916
- /* @__PURE__ */ r(de, { children: /* @__PURE__ */ r(Ge, { title: (c == null ? void 0 : c.title) || "Create Applicant" }) }),
5948
+ /* @__PURE__ */ r(de, { children: /* @__PURE__ */ r(Ge, { title: (l == null ? void 0 : l.title) || "Create Applicant" }) }),
5917
5949
  /* @__PURE__ */ s(W, { children: [
5918
5950
  w && /* @__PURE__ */ r("div", { className: "mb-6 p-4 bg-red-50 border border-red-200 rounded-lg", children: /* @__PURE__ */ s("p", { className: "text-red-600 text-sm", children: [
5919
5951
  /* @__PURE__ */ r("strong", { children: "Error:" }),
5920
5952
  " ",
5921
5953
  w
5922
5954
  ] }) }),
5923
- /* @__PURE__ */ r("div", { className: "grid grid-cols-4 gap-4", children: h.map((l) => /* @__PURE__ */ r("div", { className: "col-span-4", children: Ze(l) }, l)) })
5955
+ /* @__PURE__ */ r("div", { className: "grid grid-cols-4 gap-4", children: h.map((c) => /* @__PURE__ */ r("div", { className: "col-span-4", children: Ze(c) }, c)) })
5924
5956
  ] }),
5925
5957
  /* @__PURE__ */ s(pe, { className: "flex justify-between", children: [
5926
- a && /* @__PURE__ */ r(V, { type: "button", variant: "outline", onClick: a, disabled: te || u, children: "Cancel" }),
5927
- /* @__PURE__ */ r(V, { type: "submit", isLoading: te || u, children: "Create Applicant" })
5958
+ a && /* @__PURE__ */ r(Z, { type: "button", variant: "outline", onClick: a, disabled: te || u, children: "Cancel" }),
5959
+ /* @__PURE__ */ r(Z, { type: "submit", isLoading: te || u, children: "Create Applicant" })
5928
5960
  ] })
5929
5961
  ] }) }) });
5930
5962
  }, gn = ({
@@ -5936,16 +5968,16 @@ const _e = {
5936
5968
  }) => {
5937
5969
  const {
5938
5970
  progress: o,
5939
- currentStep: c,
5971
+ currentStep: l,
5940
5972
  steps: d,
5941
5973
  workflowKey: u,
5942
5974
  nextWorkflowKey: p,
5943
- hasWorkflowChanged: x,
5975
+ hasWorkflowChanged: b,
5944
5976
  isLoading: N,
5945
5977
  error: m,
5946
- moveBack: y,
5978
+ moveBack: x,
5947
5979
  refreshProgress: h
5948
- } = fr(e), [C, F] = ge.useState(!1);
5980
+ } = fr(e), [C, D] = ge.useState(!1);
5949
5981
  if (ge.useEffect(() => {
5950
5982
  m && n && n(m);
5951
5983
  }, [m, n]), ge.useEffect(() => {
@@ -5953,10 +5985,10 @@ const _e = {
5953
5985
  }, [o == null ? void 0 : o.workflowResult, t]), ge.useEffect(() => {
5954
5986
  a === "dark" ? document.documentElement.classList.add("dark") : document.documentElement.classList.remove("dark");
5955
5987
  }, [a]), ge.useEffect(() => {
5956
- x && F(!1);
5957
- }, [x]), N || !o)
5988
+ b && D(!1);
5989
+ }, [b]), N || !o)
5958
5990
  return /* @__PURE__ */ r("div", { className: i, children: /* @__PURE__ */ r(K, { children: /* @__PURE__ */ s(W, { children: [
5959
- /* @__PURE__ */ r(be, { className: "my-8" }),
5991
+ /* @__PURE__ */ r(ve, { className: "my-8" }),
5960
5992
  /* @__PURE__ */ r("p", { className: "text-center text-gray-600 dark:text-gray-400 mt-4", children: "Loading workflow..." })
5961
5993
  ] }) }) });
5962
5994
  if (m)
@@ -5964,7 +5996,7 @@ const _e = {
5964
5996
  /* @__PURE__ */ r("p", { className: "text-danger-500 text-lg mb-4", children: "An error occurred" }),
5965
5997
  /* @__PURE__ */ r("p", { className: "text-gray-600 dark:text-gray-400", children: m.message })
5966
5998
  ] }) }) }) });
5967
- if (x && !C)
5999
+ if (b && !C)
5968
6000
  return /* @__PURE__ */ r("div", { className: `metakyc-sdk ${i || ""}`, children: /* @__PURE__ */ r(K, { children: /* @__PURE__ */ r(W, { children: /* @__PURE__ */ s("div", { className: "text-center py-8", children: [
5969
6001
  /* @__PURE__ */ r("div", { className: "mb-6", children: /* @__PURE__ */ r("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__ */ r("svg", { className: "w-8 h-8 text-blue-600 dark:text-blue-400", fill: "none", stroke: "currentColor", viewBox: "0 0 24 24", children: /* @__PURE__ */ r("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" }) }) }) }),
5970
6002
  /* @__PURE__ */ r("h3", { className: "text-xl font-semibold text-gray-900 dark:text-white mb-2", children: "Workflow Transition" }),
@@ -5986,13 +6018,13 @@ const _e = {
5986
6018
  /* @__PURE__ */ r(
5987
6019
  "button",
5988
6020
  {
5989
- onClick: () => F(!0),
6021
+ onClick: () => D(!0),
5990
6022
  className: "px-6 py-3 bg-blue-600 hover:bg-blue-700 text-white font-medium rounded-lg transition-colors",
5991
6023
  children: "Continue with New Workflow"
5992
6024
  }
5993
6025
  )
5994
6026
  ] }) }) }) });
5995
- if (o.status === xe.Finished || o.status === xe.OnHold)
6027
+ if (o.status === be.Finished || o.status === be.OnHold)
5996
6028
  return /* @__PURE__ */ r("div", { className: `metakyc-sdk ${i || ""}`, children: /* @__PURE__ */ r(
5997
6029
  lt,
5998
6030
  {
@@ -6006,48 +6038,48 @@ const _e = {
6006
6038
  }
6007
6039
  }
6008
6040
  ) });
6009
- if (!c)
6041
+ if (!l)
6010
6042
  return /* @__PURE__ */ r("div", { className: `metakyc-sdk ${i || ""}`, children: /* @__PURE__ */ r(K, { children: /* @__PURE__ */ s(W, { children: [
6011
- /* @__PURE__ */ r(be, { className: "my-8" }),
6012
- /* @__PURE__ */ r("p", { className: "text-center text-gray-600 dark:text-gray-400 mt-4", children: o.status === xe.IdentityPending ? "Loading identity verification..." : "Loading current step..." })
6043
+ /* @__PURE__ */ r(ve, { className: "my-8" }),
6044
+ /* @__PURE__ */ r("p", { className: "text-center text-gray-600 dark:text-gray-400 mt-4", children: o.status === be.IdentityPending ? "Loading identity verification..." : "Loading current step..." })
6013
6045
  ] }) }) });
6014
6046
  const k = (I) => {
6015
6047
  switch (I) {
6016
- case G.Overview:
6048
+ case V.Overview:
6017
6049
  return "Overview";
6018
- case G.Questionaries:
6050
+ case V.Questionaries:
6019
6051
  return "Questionnaire";
6020
- case G.UploadDocument:
6052
+ case V.UploadDocument:
6021
6053
  return "Documents";
6022
- case G.IdentitySdk:
6054
+ case V.IdentitySdk:
6023
6055
  return "Identity";
6024
- case G.RiskScoring:
6056
+ case V.RiskScoring:
6025
6057
  return "Risk Assessment";
6026
- case G.InvestorCategorization:
6058
+ case V.InvestorCategorization:
6027
6059
  return "Investor Categorization";
6028
- case G.AppropriatenessTest:
6060
+ case V.AppropriatenessTest:
6029
6061
  return "Appropriateness Test";
6030
- case G.AdditionalData:
6062
+ case V.AdditionalData:
6031
6063
  return "Additional Data";
6032
- case G.ManualReview:
6064
+ case V.ManualReview:
6033
6065
  return "Review";
6034
6066
  default:
6035
6067
  return "";
6036
6068
  }
6037
- }, $ = () => {
6038
- const I = d.filter((g) => g.visibility !== !1), j = I.findIndex((g) => g.order === c.order), J = j >= 0 ? j + 1 : 1, E = I.length;
6069
+ }, z = () => {
6070
+ const I = d.filter((f) => f.visibility !== !1), j = I.findIndex((f) => f.order === l.order), G = j >= 0 ? j + 1 : 1, E = I.length;
6039
6071
  return /* @__PURE__ */ s("div", { className: "mb-6", children: [
6040
6072
  /* @__PURE__ */ s("div", { className: "flex items-start justify-between mb-4", children: [
6041
6073
  /* @__PURE__ */ r(Ge, {}),
6042
6074
  /* @__PURE__ */ s(Ae, { variant: o.status === 1 ? "info" : "success", children: [
6043
6075
  "Step ",
6044
- J,
6076
+ G,
6045
6077
  " of ",
6046
6078
  E
6047
6079
  ] })
6048
6080
  ] }),
6049
- /* @__PURE__ */ r("div", { className: "flex items-center", children: I.map((g, R) => {
6050
- const P = R < j, z = g.order === c.order;
6081
+ /* @__PURE__ */ r("div", { className: "flex items-center", children: I.map((f, R) => {
6082
+ const P = R < j, O = f.order === l.order;
6051
6083
  return /* @__PURE__ */ s(ge.Fragment, { children: [
6052
6084
  /* @__PURE__ */ s("div", { className: "flex items-center", children: [
6053
6085
  /* @__PURE__ */ r(
@@ -6055,7 +6087,7 @@ const _e = {
6055
6087
  {
6056
6088
  className: `
6057
6089
  w-8 h-8 rounded-full flex items-center justify-center text-sm font-medium
6058
- ${P || z ? "bg-primary-500 text-white" : "bg-gray-200 text-gray-600 dark:bg-gray-700 dark:text-gray-400"}
6090
+ ${P || O ? "bg-primary-500 text-white" : "bg-gray-200 text-gray-600 dark:bg-gray-700 dark:text-gray-400"}
6059
6091
  `,
6060
6092
  children: R + 1
6061
6093
  }
@@ -6063,8 +6095,8 @@ const _e = {
6063
6095
  /* @__PURE__ */ r(
6064
6096
  "span",
6065
6097
  {
6066
- className: `ml-2 text-sm ${z ? "font-semibold text-gray-900 dark:text-white" : "text-gray-600 dark:text-gray-400"}`,
6067
- children: g.displayName || g.name || k(g.action) || `Step ${R + 1}`
6098
+ className: `ml-2 text-sm ${O ? "font-semibold text-gray-900 dark:text-white" : "text-gray-600 dark:text-gray-400"}`,
6099
+ children: f.displayName || f.name || k(f.action) || `Step ${R + 1}`
6068
6100
  }
6069
6101
  )
6070
6102
  ] }),
@@ -6074,7 +6106,7 @@ const _e = {
6074
6106
  className: `flex-1 h-0.5 mx-4 ${P ? "bg-primary-500" : "bg-gray-200 dark:bg-gray-700"}`
6075
6107
  }
6076
6108
  )
6077
- ] }, g.order);
6109
+ ] }, f.order);
6078
6110
  }) })
6079
6111
  ] });
6080
6112
  }, A = () => {
@@ -6083,25 +6115,25 @@ const _e = {
6083
6115
  onComplete: async () => {
6084
6116
  await h();
6085
6117
  },
6086
- onBack: c.order > 0 ? y : void 0
6118
+ onBack: l.order > 0 ? x : void 0
6087
6119
  };
6088
- switch (c.action) {
6089
- case G.Questionaries:
6120
+ switch (l.action) {
6121
+ case V.Questionaries:
6090
6122
  return /* @__PURE__ */ r(Or, { ...I });
6091
- case G.UploadDocument:
6123
+ case V.UploadDocument:
6092
6124
  return /* @__PURE__ */ r($r, { ...I });
6093
- case G.Overview:
6125
+ case V.Overview:
6094
6126
  return /* @__PURE__ */ r(Br, { ...I });
6095
- case G.IdentitySdk:
6127
+ case V.IdentitySdk:
6096
6128
  return /* @__PURE__ */ r(Yr, { ...I });
6097
- case G.RiskScoring:
6129
+ case V.RiskScoring:
6098
6130
  return /* @__PURE__ */ r(jr, { ...I });
6099
- case G.AdditionalData:
6100
- case G.InvestorCategorization:
6131
+ case V.AdditionalData:
6132
+ case V.InvestorCategorization:
6101
6133
  return /* @__PURE__ */ r(Kr, { ...I });
6102
- case G.AppropriatenessTest:
6134
+ case V.AppropriatenessTest:
6103
6135
  return /* @__PURE__ */ r(Wr, { ...I });
6104
- case G.ManualReview:
6136
+ case V.ManualReview:
6105
6137
  return /* @__PURE__ */ r(
6106
6138
  lt,
6107
6139
  {
@@ -6113,20 +6145,20 @@ const _e = {
6113
6145
  );
6114
6146
  default:
6115
6147
  return /* @__PURE__ */ r(K, { children: /* @__PURE__ */ s(W, { className: "py-12 text-center", children: [
6116
- /* @__PURE__ */ r("div", { className: "mb-4", children: /* @__PURE__ */ r(be, {}) }),
6148
+ /* @__PURE__ */ r("div", { className: "mb-4", children: /* @__PURE__ */ r(ve, {}) }),
6117
6149
  /* @__PURE__ */ s("p", { className: "text-gray-600 dark:text-gray-400 mb-2", children: [
6118
6150
  "Processing step: ",
6119
- c.title || c.name
6151
+ l.title || l.name
6120
6152
  ] }),
6121
6153
  /* @__PURE__ */ s("p", { className: "text-sm text-gray-500 dark:text-gray-400", children: [
6122
6154
  "Action type: ",
6123
- G[c.action]
6155
+ V[l.action]
6124
6156
  ] })
6125
6157
  ] }) });
6126
6158
  }
6127
6159
  };
6128
6160
  return /* @__PURE__ */ s("div", { className: `metakyc-sdk ${i || ""}`, children: [
6129
- $(),
6161
+ z(),
6130
6162
  A()
6131
6163
  ] });
6132
6164
  };
@@ -6181,7 +6213,7 @@ const vn = Se.any();
6181
6213
  export {
6182
6214
  at as ALLOWED_LANGUAGES,
6183
6215
  At as ApplicantProgressOnHoldReason,
6184
- xe as ApplicantProgressStatus,
6216
+ be as ApplicantProgressStatus,
6185
6217
  Ht as ApplicantService,
6186
6218
  It as ApplicantStatus,
6187
6219
  Lt as AppropriatenessQuestionType,
@@ -6189,7 +6221,7 @@ export {
6189
6221
  Wr as AppropriatenessTestStep,
6190
6222
  Ae as Badge,
6191
6223
  Qt as BaseInformationService,
6192
- V as Button,
6224
+ Z as Button,
6193
6225
  K as Card,
6194
6226
  W as CardContent,
6195
6227
  pe as CardFooter,
@@ -6210,7 +6242,7 @@ export {
6210
6242
  _t as HttpClient,
6211
6243
  Me as IdentityProviderManager,
6212
6244
  Yt as IdentityService,
6213
- fe as IdentityVerificationProvider,
6245
+ xe as IdentityVerificationProvider,
6214
6246
  Yr as IdentityVerificationStep,
6215
6247
  me as Input,
6216
6248
  Gt as InvestorCategorizationService,
@@ -6240,7 +6272,7 @@ export {
6240
6272
  cr as SardinAIProvider,
6241
6273
  We as SearchableSelect,
6242
6274
  He as Select,
6243
- be as Spinner,
6275
+ ve as Spinner,
6244
6276
  ir as StepRouter,
6245
6277
  or as SumsubProvider,
6246
6278
  dr as ThemeManager,
@@ -6253,7 +6285,7 @@ export {
6253
6285
  sr as WorkflowOrchestrator,
6254
6286
  qe as WorkflowResultType,
6255
6287
  ar as WorkflowState,
6256
- G as WorkflowStepAction,
6288
+ V as WorkflowStepAction,
6257
6289
  vn as appropriatenessTestSchema,
6258
6290
  mn as clearAllStorage,
6259
6291
  hr as clearApplicantId,