@vpdev2/metakyc-sdk 1.0.63 → 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,
@@ -1789,37 +1789,37 @@ class dr {
1789
1789
  }
1790
1790
  }
1791
1791
  const mt = Nt(null), on = ({ config: e, children: t }) => {
1792
- const [n, a] = b(null), i = ge.useRef(!1), o = ge.useRef(!1), c = Ee(() => {
1793
- 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();
1794
1794
  return {
1795
1795
  httpClient: u,
1796
1796
  applicantService: p,
1797
- questionnaireService: x,
1797
+ questionnaireService: b,
1798
1798
  uploadDocumentService: N,
1799
1799
  appropriatenessTestService: m,
1800
- overviewService: y,
1800
+ overviewService: x,
1801
1801
  riskScoringService: h,
1802
1802
  identityService: C,
1803
- baseInformationService: F,
1803
+ baseInformationService: D,
1804
1804
  investorCategorizationService: k,
1805
- themeService: $,
1805
+ themeService: z,
1806
1806
  themeManager: A
1807
1807
  };
1808
1808
  }, [e]), d = Ee(() => ({
1809
1809
  config: e,
1810
- ...c,
1810
+ ...l,
1811
1811
  currentTheme: n,
1812
1812
  createOrchestrator: () => new sr(
1813
- c.applicantService,
1814
- c.questionnaireService,
1815
- c.uploadDocumentService,
1816
- c.appropriatenessTestService,
1817
- c.overviewService,
1818
- c.riskScoringService,
1819
- c.identityService,
1820
- 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
1821
1821
  )
1822
- }), [e, c, n]);
1822
+ }), [e, l, n]);
1823
1823
  return ne(() => ((async () => {
1824
1824
  if (i.current || o.current) {
1825
1825
  console.log("[MetaKYC] Theme already loading or loaded, skipping...");
@@ -1828,19 +1828,19 @@ const mt = Nt(null), on = ({ config: e, children: t }) => {
1828
1828
  i.current = !0;
1829
1829
  try {
1830
1830
  if (e.theme) {
1831
- 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;
1832
1832
  return;
1833
1833
  }
1834
1834
  console.log("[MetaKYC] Fetching theme from backend...");
1835
- const p = await c.themeService.getThemeConfiguration();
1836
- 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);
1837
1837
  } catch (p) {
1838
- 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;
1839
1839
  } finally {
1840
1840
  i.current = !1;
1841
1841
  }
1842
1842
  })(), () => {
1843
- c.themeManager.cleanup();
1843
+ l.themeManager.cleanup();
1844
1844
  }), []), /* @__PURE__ */ r(mt.Provider, { value: d, children: t });
1845
1845
  };
1846
1846
  function ye() {
@@ -1933,7 +1933,7 @@ function mn() {
1933
1933
  hr(), yr();
1934
1934
  }
1935
1935
  function fr(e) {
1936
- 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();
1937
1937
  ne(() => {
1938
1938
  u.current || (u.current = t());
1939
1939
  }, [t]), ne(() => {
@@ -1947,40 +1947,40 @@ function fr(e) {
1947
1947
  nextWorkflowKey: n.nextWorkflowKey
1948
1948
  }));
1949
1949
  }, [n, p]);
1950
- const x = ee(!1), N = ee(!1), m = Q(async () => {
1950
+ const b = ee(!1), N = ee(!1), m = Q(async () => {
1951
1951
  if (!(!p || !u.current)) {
1952
- if (x.current) {
1952
+ if (b.current) {
1953
1953
  console.log("[Workflow] Load already in progress, skipping...");
1954
1954
  return;
1955
1955
  }
1956
- x.current = !0, o(!0), d(null);
1956
+ b.current = !0, o(!0), d(null);
1957
1957
  try {
1958
1958
  const A = await u.current.initialize(p);
1959
1959
  a(A), N.current = !0;
1960
1960
  } catch (A) {
1961
1961
  d(A);
1962
1962
  } finally {
1963
- o(!1), x.current = !1;
1963
+ o(!1), b.current = !1;
1964
1964
  }
1965
1965
  }
1966
1966
  }, [p]);
1967
1967
  ne(() => {
1968
1968
  p && !N.current && m();
1969
1969
  }, [p, m]);
1970
- const y = Q(async () => {
1970
+ const x = Q(async () => {
1971
1971
  if (u.current) {
1972
- if (x.current) {
1972
+ if (b.current) {
1973
1973
  console.log("[Workflow] Refresh already in progress, skipping...");
1974
1974
  return;
1975
1975
  }
1976
- x.current = !0, o(!0), d(null);
1976
+ b.current = !0, o(!0), d(null);
1977
1977
  try {
1978
1978
  const A = await u.current.refreshProgress();
1979
1979
  a(A);
1980
1980
  } catch (A) {
1981
1981
  d(A);
1982
1982
  } finally {
1983
- o(!1), x.current = !1;
1983
+ o(!1), b.current = !1;
1984
1984
  }
1985
1985
  }
1986
1986
  }, []), h = Q(async () => {
@@ -2007,7 +2007,7 @@ function fr(e) {
2007
2007
  o(!1);
2008
2008
  }
2009
2009
  }
2010
- }, []), F = Q(async (A) => {
2010
+ }, []), D = Q(async (A) => {
2011
2011
  if (u.current) {
2012
2012
  o(!0), d(null);
2013
2013
  try {
@@ -2020,37 +2020,37 @@ function fr(e) {
2020
2020
  o(!1);
2021
2021
  }
2022
2022
  }
2023
- }, []), 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]);
2024
2024
  return {
2025
2025
  progress: n,
2026
2026
  applicantId: p,
2027
2027
  currentStep: (n == null ? void 0 : n.currentStep) || null,
2028
2028
  steps: k,
2029
- status: (n == null ? void 0 : n.status) || xe.None,
2029
+ status: (n == null ? void 0 : n.status) || be.None,
2030
2030
  workflowResult: (n == null ? void 0 : n.workflowResult) || null,
2031
2031
  workflowKey: n == null ? void 0 : n.workFlowKey,
2032
2032
  nextWorkflowKey: n == null ? void 0 : n.nextWorkflowKey,
2033
- hasWorkflowChanged: $,
2033
+ hasWorkflowChanged: z,
2034
2034
  isLoading: i,
2035
- error: c,
2036
- isComplete: (n == null ? void 0 : n.status) === xe.Finished,
2037
- isOnHold: (n == null ? void 0 : n.status) === xe.OnHold,
2038
- 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,
2039
2039
  moveToNext: h,
2040
2040
  moveBack: C,
2041
- submitCurrentStep: F,
2041
+ submitCurrentStep: D,
2042
2042
  orchestrator: u.current
2043
2043
  };
2044
2044
  }
2045
2045
  function xr(e) {
2046
- 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 () => {
2047
- 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;
2048
2048
  if (e) {
2049
- if (y.current) {
2049
+ if (x.current) {
2050
2050
  console.log("[Questionnaire] Load already in progress, skipping...");
2051
2051
  return;
2052
2052
  }
2053
- y.current = !0, u(!0), m(null);
2053
+ x.current = !0, u(!0), m(null);
2054
2054
  try {
2055
2055
  const [A, I] = await Promise.all([
2056
2056
  t.getQuestionnaire(e),
@@ -2058,35 +2058,35 @@ function xr(e) {
2058
2058
  ]);
2059
2059
  if (i(A), (k = I == null ? void 0 : I.questionnaireResults) != null && k.length && A) {
2060
2060
  const j = /* @__PURE__ */ new Map();
2061
- for (const g of I.questionnaireResults)
2062
- g.question && (($ = g.answers) != null && $.length) && j.set(g.question.trim().toLowerCase(), g.answers);
2063
- const J = {}, E = A.questionGroups.flatMap((g) => g.questions ?? []);
2064
- for (const g of E) {
2065
- const R = g.text.trim().toLowerCase();
2066
- 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));
2067
2067
  }
2068
- c(J);
2068
+ l(G);
2069
2069
  }
2070
2070
  h.current = e;
2071
2071
  } catch (A) {
2072
2072
  m(A);
2073
2073
  } finally {
2074
- u(!1), y.current = !1;
2074
+ u(!1), x.current = !1;
2075
2075
  }
2076
2076
  }
2077
2077
  }, [e, t, n]);
2078
2078
  ne(() => {
2079
2079
  e && h.current !== e && C();
2080
2080
  }, [e]);
2081
- const F = Q(
2081
+ const D = Q(
2082
2082
  async (k) => {
2083
- x(!0), m(null);
2083
+ b(!0), m(null);
2084
2084
  try {
2085
2085
  return await t.fillQuestionnaire(k);
2086
- } catch ($) {
2087
- throw m($), $;
2086
+ } catch (z) {
2087
+ throw m(z), z;
2088
2088
  } finally {
2089
- x(!1);
2089
+ b(!1);
2090
2090
  }
2091
2091
  },
2092
2092
  [t]
@@ -2098,11 +2098,11 @@ function xr(e) {
2098
2098
  isSubmitting: p,
2099
2099
  error: N,
2100
2100
  load: C,
2101
- submit: F
2101
+ submit: D
2102
2102
  };
2103
2103
  }
2104
2104
  function br(e) {
2105
- 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 () => {
2106
2106
  if (e) {
2107
2107
  if (m.current) {
2108
2108
  console.log("[UploadDocument] Load already in progress, skipping...");
@@ -2110,23 +2110,23 @@ function br(e) {
2110
2110
  }
2111
2111
  m.current = !0, o(!0), N(null);
2112
2112
  try {
2113
- const F = await t.getUploadDocument(e);
2114
- a(F), y.current = e;
2115
- } catch (F) {
2116
- N(F);
2113
+ const D = await t.getUploadDocument(e);
2114
+ a(D), x.current = e;
2115
+ } catch (D) {
2116
+ N(D);
2117
2117
  } finally {
2118
2118
  o(!1), m.current = !1;
2119
2119
  }
2120
2120
  }
2121
2121
  }, [e, t]);
2122
2122
  ne(() => {
2123
- e && y.current !== e && h();
2123
+ e && x.current !== e && h();
2124
2124
  }, [e]);
2125
2125
  const C = Q(
2126
- async (F) => {
2126
+ async (D) => {
2127
2127
  d(!0), p(0), N(null);
2128
2128
  try {
2129
- await t.fillUploadDocument(F), p(100);
2129
+ await t.fillUploadDocument(D), p(100);
2130
2130
  } catch (k) {
2131
2131
  throw N(k), k;
2132
2132
  } finally {
@@ -2138,15 +2138,15 @@ function br(e) {
2138
2138
  return {
2139
2139
  uploadDocument: n,
2140
2140
  isLoading: i,
2141
- isSubmitting: c,
2141
+ isSubmitting: l,
2142
2142
  uploadProgress: u,
2143
- error: x,
2143
+ error: b,
2144
2144
  load: h,
2145
2145
  submit: C
2146
2146
  };
2147
2147
  }
2148
2148
  function pn(e) {
2149
- 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 () => {
2150
2150
  if (e) {
2151
2151
  if (m.current) {
2152
2152
  console.log("[AppropriatenessTest] Load already in progress, skipping...");
@@ -2154,23 +2154,23 @@ function pn(e) {
2154
2154
  }
2155
2155
  m.current = !0, o(!0), p(null);
2156
2156
  try {
2157
- const F = await t.getAppropriatenessTest(e);
2158
- a(F), y.current = e;
2159
- } catch (F) {
2160
- p(F);
2157
+ const D = await t.getAppropriatenessTest(e);
2158
+ a(D), x.current = e;
2159
+ } catch (D) {
2160
+ p(D);
2161
2161
  } finally {
2162
2162
  o(!1), m.current = !1;
2163
2163
  }
2164
2164
  }
2165
2165
  }, [e, t]);
2166
2166
  ne(() => {
2167
- e && y.current !== e && h();
2167
+ e && x.current !== e && h();
2168
2168
  }, [e]);
2169
2169
  const C = Q(
2170
- async (F) => {
2170
+ async (D) => {
2171
2171
  d(!0), p(null);
2172
2172
  try {
2173
- const k = await t.fillAppropriatenessTest(F);
2173
+ const k = await t.fillAppropriatenessTest(D);
2174
2174
  return N(k), k;
2175
2175
  } catch (k) {
2176
2176
  throw p(k), k;
@@ -2182,36 +2182,36 @@ function pn(e) {
2182
2182
  );
2183
2183
  return {
2184
2184
  test: n,
2185
- result: x,
2185
+ result: b,
2186
2186
  isLoading: i,
2187
- isSubmitting: c,
2187
+ isSubmitting: l,
2188
2188
  error: u,
2189
2189
  load: h,
2190
2190
  submit: C
2191
2191
  };
2192
2192
  }
2193
2193
  function vr(e) {
2194
- 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 () => {
2195
2195
  if (e) {
2196
- if (x.current) {
2196
+ if (b.current) {
2197
2197
  console.log("[Overview] Load already in progress, skipping...");
2198
2198
  return;
2199
2199
  }
2200
- x.current = !0, o(!0), p(null);
2200
+ b.current = !0, o(!0), p(null);
2201
2201
  try {
2202
2202
  const h = await t.getOverviewData(e);
2203
2203
  a(h), N.current = e;
2204
2204
  } catch (h) {
2205
2205
  p(h);
2206
2206
  } finally {
2207
- o(!1), x.current = !1;
2207
+ o(!1), b.current = !1;
2208
2208
  }
2209
2209
  }
2210
2210
  }, [e, t]);
2211
2211
  ne(() => {
2212
2212
  e && N.current !== e && m();
2213
2213
  }, [e]);
2214
- const y = Q(async () => {
2214
+ const x = Q(async () => {
2215
2215
  if (e) {
2216
2216
  d(!0), p(null);
2217
2217
  try {
@@ -2226,17 +2226,17 @@ function vr(e) {
2226
2226
  return {
2227
2227
  overview: n,
2228
2228
  isLoading: i,
2229
- isSubmitting: c,
2229
+ isSubmitting: l,
2230
2230
  error: u,
2231
2231
  load: m,
2232
- passOverview: y
2232
+ passOverview: x
2233
2233
  };
2234
2234
  }
2235
2235
  function kr(e) {
2236
- const { identityService: t } = ye(), [n, a] = b(
2236
+ const { identityService: t } = ye(), [n, a] = v(
2237
2237
  null
2238
- ), [i, o] = b(!1), [c, d] = b(null), u = ee(!1), p = Q(
2239
- async (m, y) => {
2238
+ ), [i, o] = v(!1), [l, d] = v(null), u = ee(!1), p = Q(
2239
+ async (m, x) => {
2240
2240
  if (e) {
2241
2241
  if (u.current) {
2242
2242
  console.log("[Identity] Request already in progress, skipping...");
@@ -2248,7 +2248,7 @@ function kr(e) {
2248
2248
  applicantId: e,
2249
2249
  restart: !1,
2250
2250
  redirectUrl: m || "",
2251
- ttl: y || 604800
2251
+ ttl: x || 604800
2252
2252
  // Default: 7 days
2253
2253
  };
2254
2254
  console.log("Identity request input:", h);
@@ -2262,8 +2262,8 @@ function kr(e) {
2262
2262
  }
2263
2263
  },
2264
2264
  [e, t]
2265
- ), x = Q(
2266
- async (m, y) => {
2265
+ ), b = Q(
2266
+ async (m, x) => {
2267
2267
  if (e) {
2268
2268
  o(!0), d(null);
2269
2269
  try {
@@ -2271,7 +2271,7 @@ function kr(e) {
2271
2271
  applicantId: e,
2272
2272
  restart: !1,
2273
2273
  redirectUrl: m,
2274
- ttl: y
2274
+ ttl: x
2275
2275
  }, C = await t.identityCompanyRequest(h);
2276
2276
  return a(C), C;
2277
2277
  } catch (h) {
@@ -2298,8 +2298,8 @@ function kr(e) {
2298
2298
  // 7 days
2299
2299
  };
2300
2300
  console.log("Restarting identity with input:", m);
2301
- const y = await t.identityRequest(m);
2302
- 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;
2303
2303
  } catch (m) {
2304
2304
  throw d(m), m;
2305
2305
  } finally {
@@ -2312,14 +2312,14 @@ function kr(e) {
2312
2312
  provider: (n == null ? void 0 : n.provider) || null,
2313
2313
  token: (n == null ? void 0 : n.publicProviderTokenObject) || null,
2314
2314
  isLoading: i,
2315
- error: c,
2315
+ error: l,
2316
2316
  requestIdentity: p,
2317
- requestCompanyIdentity: x,
2317
+ requestCompanyIdentity: b,
2318
2318
  restartIdentity: N
2319
2319
  };
2320
2320
  }
2321
2321
  function wr(e) {
2322
- 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 () => {
2323
2323
  var A;
2324
2324
  if (e) {
2325
2325
  if (C.current) {
@@ -2333,17 +2333,17 @@ function wr(e) {
2333
2333
  n.getApplicantData(e).catch(() => null)
2334
2334
  ]);
2335
2335
  if (i(I), (A = j == null ? void 0 : j.riskScoringResults) != null && A.length) {
2336
- const J = j.riskScoringResults[0], E = {};
2337
- for (const g of J.riskCriteriaResults ?? [])
2338
- 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 !== "") {
2339
2339
  const R = [...new Set(
2340
- g.answer.split(",").map((P) => P.trim()).filter((P) => P !== "")
2340
+ f.answer.split(",").map((P) => P.trim()).filter((P) => P !== "")
2341
2341
  )];
2342
- R.length > 0 && (E[g.riskCriteriaId] = R);
2342
+ R.length > 0 && (E[f.riskCriteriaId] = R);
2343
2343
  }
2344
- c(E);
2344
+ l(E);
2345
2345
  }
2346
- F.current = e;
2346
+ D.current = e;
2347
2347
  } catch (I) {
2348
2348
  m(I);
2349
2349
  } finally {
@@ -2352,18 +2352,18 @@ function wr(e) {
2352
2352
  }
2353
2353
  }, [e, t, n]);
2354
2354
  ne(() => {
2355
- e && F.current !== e && k();
2355
+ e && D.current !== e && k();
2356
2356
  }, [e]);
2357
- const $ = Q(
2357
+ const z = Q(
2358
2358
  async (A) => {
2359
- x(!0), m(null);
2359
+ b(!0), m(null);
2360
2360
  try {
2361
2361
  const I = await t.submitRiskScoring(A);
2362
2362
  return h(I), I;
2363
2363
  } catch (I) {
2364
2364
  throw m(I), I;
2365
2365
  } finally {
2366
- x(!1);
2366
+ b(!1);
2367
2367
  }
2368
2368
  },
2369
2369
  [t]
@@ -2371,45 +2371,45 @@ function wr(e) {
2371
2371
  return {
2372
2372
  criteria: a,
2373
2373
  initialAnswers: o,
2374
- result: y,
2374
+ result: x,
2375
2375
  isLoading: d,
2376
2376
  isSubmitting: p,
2377
2377
  error: N,
2378
2378
  load: k,
2379
- submit: $
2379
+ submit: z
2380
2380
  };
2381
2381
  }
2382
2382
  function Nr() {
2383
- 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) {
2384
2384
  const h = Math.random() * 16 | 0;
2385
- return (y === "x" ? h : h & 3 | 8).toString(16);
2385
+ return (x === "x" ? h : h & 3 | 8).toString(16);
2386
2386
  }), p = Q(
2387
- async (y) => {
2387
+ async (x) => {
2388
2388
  var h;
2389
- if (c.current)
2389
+ if (l.current)
2390
2390
  throw console.log("[Applicant] Create already in progress, skipping..."), new Error("Creation already in progress");
2391
- c.current = !0, a(!0), o(null);
2391
+ l.current = !0, a(!0), o(null);
2392
2392
  try {
2393
- if (y.applicantAdditionalDatas || (y.applicantAdditionalDatas = []), (h = t.identityProviders) != null && h.sardinai) {
2394
- const F = u();
2395
- 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({
2396
2396
  paramName: "sessionKey",
2397
- value: F
2397
+ value: D
2398
2398
  });
2399
2399
  }
2400
- return await e.createApplicant(y);
2400
+ return await e.createApplicant(x);
2401
2401
  } catch (C) {
2402
2402
  throw o(C), C;
2403
2403
  } finally {
2404
- a(!1), c.current = !1;
2404
+ a(!1), l.current = !1;
2405
2405
  }
2406
2406
  },
2407
2407
  [e, t]
2408
- ), x = Q(
2409
- async (y) => {
2408
+ ), b = Q(
2409
+ async (x) => {
2410
2410
  a(!0), o(null);
2411
2411
  try {
2412
- return await e.createCompanyApplicant(y);
2412
+ return await e.createCompanyApplicant(x);
2413
2413
  } catch (h) {
2414
2414
  throw o(h), h;
2415
2415
  } finally {
@@ -2418,12 +2418,12 @@ function Nr() {
2418
2418
  },
2419
2419
  [e]
2420
2420
  ), N = Q(
2421
- async (y) => {
2421
+ async (x) => {
2422
2422
  if (d.current)
2423
2423
  throw console.log("[Applicant] Data load already in progress, skipping..."), new Error("Data load already in progress");
2424
2424
  d.current = !0, a(!0), o(null);
2425
2425
  try {
2426
- return await e.getApplicantData(y);
2426
+ return await e.getApplicantData(x);
2427
2427
  } catch (h) {
2428
2428
  throw o(h), h;
2429
2429
  } finally {
@@ -2432,10 +2432,10 @@ function Nr() {
2432
2432
  },
2433
2433
  [e]
2434
2434
  ), m = Q(
2435
- async (y) => {
2435
+ async (x) => {
2436
2436
  a(!0), o(null);
2437
2437
  try {
2438
- await e.stopProgress(y);
2438
+ await e.stopProgress(x);
2439
2439
  } catch (h) {
2440
2440
  throw o(h), h;
2441
2441
  } finally {
@@ -2448,19 +2448,19 @@ function Nr() {
2448
2448
  isLoading: n,
2449
2449
  error: i,
2450
2450
  createApplicant: p,
2451
- createCompanyApplicant: x,
2451
+ createCompanyApplicant: b,
2452
2452
  getApplicantData: N,
2453
2453
  stopProgress: m
2454
2454
  };
2455
2455
  }
2456
- const V = ({
2456
+ const Z = ({
2457
2457
  children: e,
2458
2458
  variant: t = "primary",
2459
2459
  size: n = "md",
2460
2460
  isLoading: a = !1,
2461
2461
  disabled: i,
2462
2462
  className: o,
2463
- ...c
2463
+ ...l
2464
2464
  }) => {
2465
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 = {
2466
2466
  primary: "bg-primary-500 text-white hover:bg-primary-600 focus:ring-primary-500",
@@ -2478,7 +2478,7 @@ const V = ({
2478
2478
  {
2479
2479
  className: oe(d, u[t], p[n], o),
2480
2480
  disabled: i || a,
2481
- ...c,
2481
+ ...l,
2482
2482
  children: [
2483
2483
  a && /* @__PURE__ */ s(
2484
2484
  "svg",
@@ -2515,7 +2515,7 @@ const V = ({
2515
2515
  }
2516
2516
  );
2517
2517
  }, me = Ue(
2518
- ({ label: e, error: t, helperText: n, leftIcon: a, rightIcon: i, className: o, style: c, ...d }, u) => /* @__PURE__ */ s("div", { className: "w-full", children: [
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
2519
  e && /* @__PURE__ */ s(
2520
2520
  "label",
2521
2521
  {
@@ -2545,7 +2545,7 @@ const V = ({
2545
2545
  backgroundColor: "var(--metakyc-input-bg, #ffffff)",
2546
2546
  color: "var(--metakyc-text-primary, #111827)",
2547
2547
  borderColor: t ? "var(--metakyc-danger, #ef4444)" : "var(--metakyc-border, #d1d5db)",
2548
- ...c
2548
+ ...l
2549
2549
  },
2550
2550
  ...d
2551
2551
  }
@@ -2608,7 +2608,7 @@ const K = ({ children: e, className: t, ...n }) => /* @__PURE__ */ r(
2608
2608
  ...a,
2609
2609
  children: e
2610
2610
  }
2611
- ), be = ({ size: e = "md", className: t, ...n }) => {
2611
+ ), ve = ({ size: e = "md", className: t, ...n }) => {
2612
2612
  const a = {
2613
2613
  sm: "h-4 w-4",
2614
2614
  md: "h-8 w-8",
@@ -2645,7 +2645,7 @@ const K = ({ children: e, className: t, ...n }) => /* @__PURE__ */ r(
2645
2645
  }
2646
2646
  ) });
2647
2647
  }, He = Ue(
2648
- ({ 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: [
2649
2649
  e && /* @__PURE__ */ s(
2650
2650
  "label",
2651
2651
  {
@@ -2673,7 +2673,7 @@ const K = ({ children: e, className: t, ...n }) => /* @__PURE__ */ r(
2673
2673
  color: "var(--metakyc-text-primary, #111827)",
2674
2674
  borderColor: t ? "var(--metakyc-error, #ef4444)" : "var(--metakyc-border, #d1d5db)",
2675
2675
  // ring color via outline on focus
2676
- ...c
2676
+ ...l
2677
2677
  },
2678
2678
  ...d,
2679
2679
  children: [
@@ -2690,7 +2690,7 @@ const K = ({ children: e, className: t, ...n }) => /* @__PURE__ */ r(
2690
2690
  },
2691
2691
  "__placeholder__"
2692
2692
  ),
2693
- a.map((p, x) => /* @__PURE__ */ r(
2693
+ a.map((p, b) => /* @__PURE__ */ r(
2694
2694
  "option",
2695
2695
  {
2696
2696
  value: p.value,
@@ -2701,7 +2701,7 @@ const K = ({ children: e, className: t, ...n }) => /* @__PURE__ */ r(
2701
2701
  },
2702
2702
  children: p.label
2703
2703
  },
2704
- p.value || `option-${x}`
2704
+ p.value || `option-${b}`
2705
2705
  ))
2706
2706
  ]
2707
2707
  }
@@ -2718,47 +2718,47 @@ const it = 280, Sr = ({
2718
2718
  options: a,
2719
2719
  placeholder: i = "Select...",
2720
2720
  disabled: o = !1,
2721
- required: c = !1
2721
+ required: l = !1
2722
2722
  }) => {
2723
- 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(() => {
2724
2724
  if (!h.current) return null;
2725
2725
  const w = h.current.getBoundingClientRect(), te = window.innerHeight - w.bottom < it && w.top > it;
2726
2726
  return { top: te ? w.top : w.bottom + 4, left: w.left, width: w.width, openUp: te };
2727
2727
  }, []), k = Q(() => {
2728
2728
  if (o) return;
2729
- const w = F();
2729
+ const w = D();
2730
2730
  w && m(w), u(!0);
2731
- }, [o, F]), $ = Q(() => {
2732
- u(!1), x("");
2731
+ }, [o, D]), z = Q(() => {
2732
+ u(!1), b("");
2733
2733
  }, []);
2734
2734
  ne(() => {
2735
2735
  if (!d) return;
2736
- const w = (U) => {
2737
- var B, D;
2738
- const te = U.target;
2739
- !((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();
2740
2740
  };
2741
2741
  return document.addEventListener("mousedown", w), () => document.removeEventListener("mousedown", w);
2742
- }, [d, $]), ne(() => {
2742
+ }, [d, z]), ne(() => {
2743
2743
  if (!d) return;
2744
2744
  const w = () => {
2745
- const U = F();
2746
- U && m(U);
2745
+ const q = D();
2746
+ q && m(q);
2747
2747
  };
2748
2748
  return window.addEventListener("scroll", w, !0), window.addEventListener("resize", w), () => {
2749
2749
  window.removeEventListener("scroll", w, !0), window.removeEventListener("resize", w);
2750
2750
  };
2751
- }, [d, F]);
2751
+ }, [d, D]);
2752
2752
  const A = a.filter(
2753
2753
  (w) => w.label.toLowerCase().includes(p.toLowerCase())
2754
2754
  ), I = (w) => {
2755
- o || n(t.includes(w) ? t.filter((U) => U !== w) : [...t, w]);
2756
- }, j = (w, U) => {
2757
- U.stopPropagation(), o || n(t.filter((te) => te !== w));
2758
- }, J = (w) => {
2759
- var U;
2760
- return ((U = a.find((te) => te.value === w)) == null ? void 0 : U.label) || w;
2761
- }, 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(
2762
2762
  "div",
2763
2763
  {
2764
2764
  ref: C,
@@ -2773,7 +2773,7 @@ const it = 280, Sr = ({
2773
2773
  borderRadius: "8px",
2774
2774
  boxShadow: "0 4px 16px rgba(0,0,0,0.18)",
2775
2775
  border: `1px solid ${R}`,
2776
- backgroundColor: g,
2776
+ backgroundColor: f,
2777
2777
  overflow: "hidden"
2778
2778
  },
2779
2779
  children: [
@@ -2782,7 +2782,7 @@ const it = 280, Sr = ({
2782
2782
  {
2783
2783
  type: "text",
2784
2784
  value: p,
2785
- onChange: (w) => x(w.target.value),
2785
+ onChange: (w) => b(w.target.value),
2786
2786
  placeholder: "Search...",
2787
2787
  autoFocus: !0,
2788
2788
  onClick: (w) => w.stopPropagation(),
@@ -2794,15 +2794,15 @@ const it = 280, Sr = ({
2794
2794
  fontSize: "13px",
2795
2795
  borderRadius: "6px",
2796
2796
  border: `1px solid ${R}`,
2797
- backgroundColor: g,
2797
+ backgroundColor: f,
2798
2798
  color: P,
2799
2799
  outline: "none",
2800
2800
  boxSizing: "border-box"
2801
2801
  }
2802
2802
  }
2803
2803
  ) }),
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: z }, children: "No results" }) : A.map((w) => {
2805
- 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);
2806
2806
  return /* @__PURE__ */ s(
2807
2807
  "li",
2808
2808
  {
@@ -2815,24 +2815,24 @@ const it = 280, Sr = ({
2815
2815
  padding: "8px 12px",
2816
2816
  fontSize: "13px",
2817
2817
  cursor: "pointer",
2818
- backgroundColor: U ? O : "transparent",
2819
- color: U ? _ : P,
2818
+ backgroundColor: q ? M : "transparent",
2819
+ color: q ? H : P,
2820
2820
  userSelect: "none"
2821
2821
  },
2822
2822
  onMouseEnter: (te) => {
2823
- U || (te.currentTarget.style.backgroundColor = M);
2823
+ q || (te.currentTarget.style.backgroundColor = T);
2824
2824
  },
2825
2825
  onMouseLeave: (te) => {
2826
- U || (te.currentTarget.style.backgroundColor = "transparent");
2826
+ q || (te.currentTarget.style.backgroundColor = "transparent");
2827
2827
  },
2828
2828
  children: [
2829
2829
  /* @__PURE__ */ r(
2830
2830
  "input",
2831
2831
  {
2832
2832
  type: "checkbox",
2833
- checked: U,
2833
+ checked: q,
2834
2834
  readOnly: !0,
2835
- style: { accentColor: _, pointerEvents: "none", flexShrink: 0 }
2835
+ style: { accentColor: H, pointerEvents: "none", flexShrink: 0 }
2836
2836
  }
2837
2837
  ),
2838
2838
  /* @__PURE__ */ r("span", { children: w.label })
@@ -2846,7 +2846,7 @@ const it = 280, Sr = ({
2846
2846
  {
2847
2847
  type: "button",
2848
2848
  onClick: () => {
2849
- n([]), x("");
2849
+ n([]), b("");
2850
2850
  },
2851
2851
  style: { fontSize: "12px", color: "#ef4444", background: "none", border: "none", cursor: "pointer", padding: 0 },
2852
2852
  children: [
@@ -2859,7 +2859,7 @@ const it = 280, Sr = ({
2859
2859
  ]
2860
2860
  }
2861
2861
  );
2862
- 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: [
2863
2863
  e && /* @__PURE__ */ s(
2864
2864
  "label",
2865
2865
  {
@@ -2867,7 +2867,7 @@ const it = 280, Sr = ({
2867
2867
  style: { color: "var(--metakyc-text-primary, #374151)" },
2868
2868
  children: [
2869
2869
  e,
2870
- 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: "*" })
2871
2871
  ]
2872
2872
  }
2873
2873
  ),
@@ -2875,7 +2875,7 @@ const it = 280, Sr = ({
2875
2875
  "div",
2876
2876
  {
2877
2877
  ref: h,
2878
- onClick: () => d ? $() : k(),
2878
+ onClick: () => d ? z() : k(),
2879
2879
  className: oe(
2880
2880
  "metakyc-multiselect-trigger",
2881
2881
  "min-h-[42px] w-full px-3 py-2 rounded-lg border text-sm transition-colors relative",
@@ -2904,12 +2904,12 @@ const it = 280, Sr = ({
2904
2904
  color: "var(--metakyc-primary, #2563eb)"
2905
2905
  },
2906
2906
  children: [
2907
- J(w),
2907
+ G(w),
2908
2908
  !o && /* @__PURE__ */ r(
2909
2909
  "button",
2910
2910
  {
2911
2911
  type: "button",
2912
- onClick: (U) => j(w, U),
2912
+ onClick: (q) => j(w, q),
2913
2913
  className: "metakyc-multiselect-chip-remove",
2914
2914
  style: {
2915
2915
  background: "transparent",
@@ -2948,7 +2948,7 @@ const it = 280, Sr = ({
2948
2948
  ]
2949
2949
  }
2950
2950
  ),
2951
- typeof document < "u" && Z ? Ve(Z, document.body) : null
2951
+ typeof document < "u" && J ? Ve(J, document.body) : null
2952
2952
  ] });
2953
2953
  }, st = 260, We = ({
2954
2954
  label: e,
@@ -2957,13 +2957,13 @@ const it = 280, Sr = ({
2957
2957
  options: a,
2958
2958
  placeholder: i = "Select...",
2959
2959
  value: o,
2960
- onChange: c,
2960
+ onChange: l,
2961
2961
  disabled: d = !1,
2962
2962
  required: u = !1,
2963
2963
  className: p
2964
2964
  }) => {
2965
- var D;
2966
- 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(() => {
2967
2967
  if (!k.current) return null;
2968
2968
  const S = k.current.getBoundingClientRect(), X = window.innerHeight - S.bottom < st && S.top > st;
2969
2969
  return {
@@ -2976,40 +2976,40 @@ const it = 280, Sr = ({
2976
2976
  if (d) return;
2977
2977
  const S = I();
2978
2978
  S && C(S), N(!0);
2979
- }, [d, I]), J = Q(() => {
2980
- N(!1), y("");
2981
- }, []), E = () => x ? J() : j();
2979
+ }, [d, I]), G = Q(() => {
2980
+ N(!1), x("");
2981
+ }, []), E = () => b ? G() : j();
2982
2982
  ne(() => {
2983
- if (!x) return;
2984
- const S = (H) => {
2983
+ if (!b) return;
2984
+ const S = (U) => {
2985
2985
  var Y, we;
2986
- const X = H.target;
2987
- !((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();
2988
2988
  };
2989
2989
  return document.addEventListener("mousedown", S), () => document.removeEventListener("mousedown", S);
2990
- }, [x, J]), ne(() => {
2991
- if (!x) return;
2990
+ }, [b, G]), ne(() => {
2991
+ if (!b) return;
2992
2992
  const S = () => {
2993
- const H = I();
2994
- H && C(H);
2993
+ const U = I();
2994
+ U && C(U);
2995
2995
  };
2996
2996
  return window.addEventListener("scroll", S, !0), window.addEventListener("resize", S), () => {
2997
2997
  window.removeEventListener("scroll", S, !0), window.removeEventListener("resize", S);
2998
2998
  };
2999
- }, [x, I]), ne(() => {
3000
- x && A.current && setTimeout(() => {
2999
+ }, [b, I]), ne(() => {
3000
+ b && A.current && setTimeout(() => {
3001
3001
  var S;
3002
3002
  return (S = A.current) == null ? void 0 : S.focus();
3003
3003
  }, 0);
3004
- }, [x]);
3005
- const g = a.filter(
3004
+ }, [b]);
3005
+ const f = a.filter(
3006
3006
  (S) => S.label.toLowerCase().includes(m.toLowerCase()) || S.value.toLowerCase().includes(m.toLowerCase())
3007
- ), R = (D = a.find((S) => S.value === o)) == null ? void 0 : D.label, P = (S, H) => {
3008
- d || H || (c(S), J());
3009
- }, 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(
3010
3010
  "div",
3011
3011
  {
3012
- ref: $,
3012
+ ref: z,
3013
3013
  className: "metakyc-searchable-select-dropdown",
3014
3014
  style: {
3015
3015
  position: "fixed",
@@ -3020,18 +3020,18 @@ const it = 280, Sr = ({
3020
3020
  zIndex: 99999,
3021
3021
  borderRadius: "8px",
3022
3022
  boxShadow: "0 4px 16px rgba(0,0,0,0.18)",
3023
- border: `1px solid ${O}`,
3024
- backgroundColor: _,
3023
+ border: `1px solid ${M}`,
3024
+ backgroundColor: H,
3025
3025
  overflow: "hidden"
3026
3026
  },
3027
3027
  children: [
3028
- /* @__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(
3029
3029
  "input",
3030
3030
  {
3031
3031
  ref: A,
3032
3032
  type: "text",
3033
3033
  value: m,
3034
- onChange: (S) => y(S.target.value),
3034
+ onChange: (S) => x(S.target.value),
3035
3035
  placeholder: "Search...",
3036
3036
  onClick: (S) => S.stopPropagation(),
3037
3037
  className: "metakyc-searchable-select-search w-full",
@@ -3041,9 +3041,9 @@ const it = 280, Sr = ({
3041
3041
  padding: "6px 8px",
3042
3042
  fontSize: "13px",
3043
3043
  borderRadius: "6px",
3044
- border: `1px solid ${O}`,
3045
- backgroundColor: _,
3046
- color: M,
3044
+ border: `1px solid ${M}`,
3045
+ backgroundColor: H,
3046
+ color: T,
3047
3047
  outline: "none",
3048
3048
  boxSizing: "border-box"
3049
3049
  }
@@ -3059,8 +3059,8 @@ const it = 280, Sr = ({
3059
3059
  maxHeight: "208px",
3060
3060
  overflowY: "auto"
3061
3061
  },
3062
- children: g.length === 0 ? /* @__PURE__ */ r("li", { style: { padding: "8px 12px", fontSize: "13px", color: Z }, children: "No results" }) : g.map((S) => {
3063
- 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;
3064
3064
  return /* @__PURE__ */ r(
3065
3065
  "li",
3066
3066
  {
@@ -3071,15 +3071,15 @@ const it = 280, Sr = ({
3071
3071
  fontSize: "13px",
3072
3072
  cursor: S.disabled ? "not-allowed" : "pointer",
3073
3073
  opacity: S.disabled ? 0.4 : 1,
3074
- backgroundColor: H ? U : "transparent",
3075
- color: H ? w : M,
3074
+ backgroundColor: U ? q : "transparent",
3075
+ color: U ? w : T,
3076
3076
  userSelect: "none"
3077
3077
  },
3078
3078
  onMouseEnter: (X) => {
3079
- !H && !S.disabled && (X.currentTarget.style.backgroundColor = te);
3079
+ !U && !S.disabled && (X.currentTarget.style.backgroundColor = te);
3080
3080
  },
3081
3081
  onMouseLeave: (X) => {
3082
- H || (X.currentTarget.style.backgroundColor = "transparent");
3082
+ U || (X.currentTarget.style.backgroundColor = "transparent");
3083
3083
  },
3084
3084
  children: S.label
3085
3085
  },
@@ -3095,7 +3095,7 @@ const it = 280, Sr = ({
3095
3095
  "div",
3096
3096
  {
3097
3097
  className: oe("w-full metakyc-searchable-select", p),
3098
- ref: F,
3098
+ ref: D,
3099
3099
  children: [
3100
3100
  e && /* @__PURE__ */ s(
3101
3101
  "label",
@@ -3116,7 +3116,7 @@ const it = 280, Sr = ({
3116
3116
  tabIndex: d ? -1 : 0,
3117
3117
  onClick: E,
3118
3118
  onKeyDown: (S) => {
3119
- (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();
3120
3120
  },
3121
3121
  className: oe(
3122
3122
  "metakyc-searchable-select-trigger",
@@ -3128,9 +3128,9 @@ const it = 280, Sr = ({
3128
3128
  style: {
3129
3129
  backgroundColor: "var(--metakyc-input-bg, #ffffff)",
3130
3130
  color: R ? "var(--metakyc-text-primary, #111827)" : "var(--metakyc-text-secondary, #9ca3af)",
3131
- 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)",
3132
3132
  minHeight: "42px",
3133
- outline: x ? "2px solid var(--metakyc-primary, #2563eb)" : "none",
3133
+ outline: b ? "2px solid var(--metakyc-primary, #2563eb)" : "none",
3134
3134
  outlineOffset: "-1px"
3135
3135
  },
3136
3136
  children: [
@@ -3140,7 +3140,7 @@ const it = 280, Sr = ({
3140
3140
  {
3141
3141
  className: "flex-shrink-0 text-xs pointer-events-none",
3142
3142
  style: { color: "var(--metakyc-text-secondary, #6b7280)" },
3143
- children: x ? "▲" : "▼"
3143
+ children: b ? "▲" : "▼"
3144
3144
  }
3145
3145
  )
3146
3146
  ]
@@ -3161,30 +3161,30 @@ const Cr = ({
3161
3161
  multiple: a = !1,
3162
3162
  maxSize: i,
3163
3163
  onChange: o,
3164
- value: c = [],
3164
+ value: l = [],
3165
3165
  className: d
3166
3166
  }) => {
3167
- const [u, p] = b(!1), x = ee(null), N = (k) => {
3167
+ const [u, p] = v(!1), b = ee(null), N = (k) => {
3168
3168
  if (!k) return;
3169
- const $ = Array.from(k);
3170
- 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) {
3171
3171
  const I = Ye(i);
3172
3172
  alert(`Some files exceed the maximum size of ${I}`);
3173
3173
  return;
3174
3174
  }
3175
- o == null || o(a ? [...c, ...$] : [$[0]]);
3175
+ o == null || o(a ? [...l, ...z] : [z[0]]);
3176
3176
  }, m = (k) => {
3177
3177
  k.preventDefault(), p(!0);
3178
- }, y = () => {
3178
+ }, x = () => {
3179
3179
  p(!1);
3180
3180
  }, h = (k) => {
3181
3181
  k.preventDefault(), p(!1), N(k.dataTransfer.files);
3182
3182
  }, C = () => {
3183
3183
  var k;
3184
- (k = x.current) == null || k.click();
3185
- }, F = (k) => {
3186
- const $ = c.filter((A, I) => I !== k);
3187
- 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);
3188
3188
  };
3189
3189
  return /* @__PURE__ */ s("div", { className: oe("w-full", d), children: [
3190
3190
  e && /* @__PURE__ */ r("label", { className: "block text-sm font-medium text-gray-700 dark:text-gray-300 mb-1", children: e }),
@@ -3197,14 +3197,14 @@ const Cr = ({
3197
3197
  t && "border-danger-500"
3198
3198
  ),
3199
3199
  onDragOver: m,
3200
- onDragLeave: y,
3200
+ onDragLeave: x,
3201
3201
  onDrop: h,
3202
3202
  onClick: C,
3203
3203
  children: [
3204
3204
  /* @__PURE__ */ r(
3205
3205
  "input",
3206
3206
  {
3207
- ref: x,
3207
+ ref: b,
3208
3208
  type: "file",
3209
3209
  className: "hidden",
3210
3210
  accept: n,
@@ -3243,7 +3243,7 @@ const Cr = ({
3243
3243
  ]
3244
3244
  }
3245
3245
  ),
3246
- 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(
3247
3247
  "div",
3248
3248
  {
3249
3249
  className: "flex items-center justify-between px-3 py-2 bg-gray-50 dark:bg-gray-700 rounded-lg",
@@ -3277,7 +3277,7 @@ const Cr = ({
3277
3277
  {
3278
3278
  type: "button",
3279
3279
  onClick: (A) => {
3280
- A.stopPropagation(), F($);
3280
+ A.stopPropagation(), D(z);
3281
3281
  },
3282
3282
  className: "ml-2 text-danger-500 hover:text-danger-700 focus:outline-none",
3283
3283
  children: /* @__PURE__ */ r("svg", { className: "h-5 w-5", fill: "currentColor", viewBox: "0 0 20 20", children: /* @__PURE__ */ r(
@@ -3292,7 +3292,7 @@ const Cr = ({
3292
3292
  )
3293
3293
  ]
3294
3294
  },
3295
- $
3295
+ z
3296
3296
  )) }),
3297
3297
  t && /* @__PURE__ */ r("p", { className: "mt-1 text-sm text-danger-500", children: t })
3298
3298
  ] });
@@ -3420,7 +3420,7 @@ const Dr = Ue(
3420
3420
  absoluteStrokeWidth: a,
3421
3421
  className: i = "",
3422
3422
  children: o,
3423
- iconNode: c,
3423
+ iconNode: l,
3424
3424
  ...d
3425
3425
  }, u) => Qe(
3426
3426
  "svg",
@@ -3436,7 +3436,7 @@ const Dr = Ue(
3436
3436
  ...d
3437
3437
  },
3438
3438
  [
3439
- ...c.map(([p, x]) => Qe(p, x)),
3439
+ ...l.map(([p, b]) => Qe(p, b)),
3440
3440
  ...Array.isArray(o) ? o : [o]
3441
3441
  ]
3442
3442
  )
@@ -3507,7 +3507,7 @@ function Tr(e, t) {
3507
3507
  }
3508
3508
  function Mr(e) {
3509
3509
  const t = e.flatMap(
3510
- (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 }))
3511
3511
  ), n = /* @__PURE__ */ new Map();
3512
3512
  for (const a of t) {
3513
3513
  const i = a.question.pageNumber != null && a.question.pageNumber > 0 ? a.question.pageNumber : 1;
@@ -3520,30 +3520,30 @@ const Or = ({
3520
3520
  onComplete: t,
3521
3521
  onBack: n
3522
3522
  }) => {
3523
- 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);
3524
3524
  ge.useEffect(() => {
3525
- 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);
3526
3526
  }, [i]);
3527
3527
  const C = Ee(
3528
3528
  () => a ? Mr(a.questionGroups) : [],
3529
3529
  [a]
3530
- ), F = y === C.length - 1, k = C[y] ?? [], $ = Q((E, g) => {
3531
- 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) => {
3532
3532
  const P = { ...R };
3533
3533
  return delete P[E], P;
3534
3534
  });
3535
3535
  }, []), A = Q(() => {
3536
3536
  const E = {};
3537
- for (const { question: g } of k) {
3538
- const R = Tr(g, p[g.id] ?? []);
3539
- 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);
3540
3540
  }
3541
- return m((g) => ({ ...g, ...E })), Object.keys(E).length === 0;
3541
+ return m((f) => ({ ...f, ...E })), Object.keys(E).length === 0;
3542
3542
  }, [k, p]), I = () => {
3543
3543
  A() && h((E) => E + 1);
3544
3544
  }, j = () => {
3545
- y > 0 ? h((E) => E - 1) : n == null || n();
3546
- }, J = async () => {
3545
+ x > 0 ? h((E) => E - 1) : n == null || n();
3546
+ }, G = async () => {
3547
3547
  if (!(!A() || !a))
3548
3548
  try {
3549
3549
  const E = a.questionGroups.flatMap(
@@ -3551,17 +3551,17 @@ const Or = ({
3551
3551
  questionId: P.id,
3552
3552
  values: p[P.id] ?? []
3553
3553
  }))
3554
- ), g = {
3554
+ ), f = {
3555
3555
  applicantId: e,
3556
3556
  questionnarieId: a.id,
3557
3557
  questionResults: E
3558
3558
  };
3559
- await u(g), t == null || t();
3559
+ await u(f), t == null || t();
3560
3560
  } catch (E) {
3561
3561
  console.error("Questionnaire submit error:", E);
3562
3562
  }
3563
3563
  };
3564
- 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: [
3565
3565
  "Error loading questionnaire: ",
3566
3566
  d.message
3567
3567
  ] }) }) }) : a ? /* @__PURE__ */ s(K, { children: [
@@ -3571,21 +3571,21 @@ const Or = ({
3571
3571
  C.length > 1 && /* @__PURE__ */ s("div", { className: "flex items-center justify-between mt-3", children: [
3572
3572
  /* @__PURE__ */ s("span", { className: "text-xs", style: { color: "var(--metakyc-text-muted, #9ca3af)" }, children: [
3573
3573
  "Page ",
3574
- y + 1,
3574
+ x + 1,
3575
3575
  " of ",
3576
3576
  C.length
3577
3577
  ] }),
3578
- /* @__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(
3579
3579
  "div",
3580
3580
  {
3581
3581
  className: "rounded-full transition-all duration-200",
3582
3582
  style: {
3583
3583
  height: "6px",
3584
- width: g === y ? "20px" : "6px",
3585
- 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)"
3586
3586
  }
3587
3587
  },
3588
- g
3588
+ f
3589
3589
  )) })
3590
3590
  ] })
3591
3591
  ] }),
@@ -3595,13 +3595,13 @@ const Or = ({
3595
3595
  question: E,
3596
3596
  value: p[E.id] ?? [],
3597
3597
  error: N[E.id],
3598
- onChange: (g) => $(E.id, g)
3598
+ onChange: (f) => z(E.id, f)
3599
3599
  },
3600
3600
  E.id
3601
3601
  )) }),
3602
3602
  /* @__PURE__ */ s(pe, { className: "flex items-center justify-between", children: [
3603
3603
  /* @__PURE__ */ s(
3604
- V,
3604
+ Z,
3605
3605
  {
3606
3606
  type: "button",
3607
3607
  variant: "outline",
@@ -3609,20 +3609,20 @@ const Or = ({
3609
3609
  style: { display: "flex", alignItems: "center", gap: "4px" },
3610
3610
  children: [
3611
3611
  /* @__PURE__ */ r(gt, { size: 14 }),
3612
- y > 0 ? "Previous" : "Back"
3612
+ x > 0 ? "Previous" : "Back"
3613
3613
  ]
3614
3614
  }
3615
3615
  ),
3616
- F ? /* @__PURE__ */ r(
3617
- V,
3616
+ D ? /* @__PURE__ */ r(
3617
+ Z,
3618
3618
  {
3619
3619
  type: "button",
3620
- isLoading: c,
3621
- onClick: J,
3620
+ isLoading: l,
3621
+ onClick: G,
3622
3622
  children: "Continue"
3623
3623
  }
3624
3624
  ) : /* @__PURE__ */ s(
3625
- V,
3625
+ Z,
3626
3626
  {
3627
3627
  type: "button",
3628
3628
  onClick: I,
@@ -3637,8 +3637,8 @@ const Or = ({
3637
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 }) })
3638
3638
  ] }) : null;
3639
3639
  }, zr = ({ question: e, value: t, error: n, onChange: a }) => {
3640
- var c;
3641
- 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";
3642
3642
  return /* @__PURE__ */ s("div", { className: "space-y-2", children: [
3643
3643
  /* @__PURE__ */ s("label", { className: "block text-sm font-medium", style: { color: "var(--metakyc-text-primary, #111827)" }, children: [
3644
3644
  e.text,
@@ -3748,11 +3748,11 @@ const Or = ({
3748
3748
  onComplete: t,
3749
3749
  onBack: n
3750
3750
  }) => {
3751
- 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) => {
3752
3752
  if (N.preventDefault(), !a) return;
3753
3753
  const m = await Promise.all(
3754
3754
  a.uploadDocumentFiles.map(async (h) => {
3755
- const C = u[h.id] || [], F = await Promise.all(
3755
+ const C = u[h.id] || [], D = await Promise.all(
3756
3756
  C.map(async (k) => ({
3757
3757
  fileName: k.name,
3758
3758
  fileData: await ur(k)
@@ -3760,20 +3760,20 @@ const Or = ({
3760
3760
  );
3761
3761
  return {
3762
3762
  uploadDocumentFileId: h.id,
3763
- valueList: F
3763
+ valueList: D
3764
3764
  };
3765
3765
  })
3766
- ), y = {
3766
+ ), x = {
3767
3767
  applicantId: e,
3768
3768
  uploadDocumentId: a.id,
3769
3769
  uploadDocumentResults: m
3770
3770
  };
3771
- await d(y), t == null || t();
3771
+ await d(x), t == null || t();
3772
3772
  };
3773
- 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: [
3774
3774
  "Error loading document requirements: ",
3775
- c.message
3776
- ] }) }) }) : 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: [
3777
3777
  /* @__PURE__ */ s(de, { children: [
3778
3778
  /* @__PURE__ */ r("h2", { className: "text-lg font-bold", children: a.displayName }),
3779
3779
  a.subtitle && /* @__PURE__ */ r("p", { className: "text-gray-600 dark:text-gray-400 mt-1", children: a.subtitle })
@@ -3787,29 +3787,29 @@ const Or = ({
3787
3787
  maxSize: N.maxEachFileSizeByte,
3788
3788
  value: u[N.id] || [],
3789
3789
  onChange: (m) => {
3790
- p((y) => ({ ...y, [N.id]: m }));
3790
+ p((x) => ({ ...x, [N.id]: m }));
3791
3791
  }
3792
3792
  },
3793
3793
  N.id
3794
3794
  )) }),
3795
3795
  /* @__PURE__ */ s(pe, { className: "flex justify-between", children: [
3796
- n && /* @__PURE__ */ r(V, { type: "button", variant: "outline", onClick: n, children: "Back" }),
3797
- /* @__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" })
3798
3798
  ] })
3799
3799
  ] }) }) : null;
3800
3800
  }, Br = ({ applicantId: e, onComplete: t, onBack: n }) => {
3801
- 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 () => {
3802
3802
  await d(), t == null || t();
3803
3803
  };
3804
- 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: [
3805
3805
  "Error loading overview: ",
3806
- c.message
3806
+ l.message
3807
3807
  ] }) }) }) : a ? /* @__PURE__ */ s(K, { children: [
3808
3808
  /* @__PURE__ */ s(de, { children: [
3809
3809
  /* @__PURE__ */ r("h2", { className: "text-lg font-bold", children: a.title || "Overview" }),
3810
3810
  a.description && /* @__PURE__ */ r("p", { className: "text-gray-600 dark:text-gray-400 mt-1", children: a.description })
3811
3811
  ] }),
3812
- /* @__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: [
3813
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 }) }),
3814
3814
  /* @__PURE__ */ s(
3815
3815
  "div",
@@ -3829,8 +3829,8 @@ const Or = ({
3829
3829
  )
3830
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..." }) }) }),
3831
3831
  /* @__PURE__ */ s(pe, { className: "flex justify-between", children: [
3832
- n && /* @__PURE__ */ r(V, { type: "button", variant: "outline", onClick: n, children: "Back" }),
3833
- /* @__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" })
3834
3834
  ] })
3835
3835
  ] }) : null;
3836
3836
  };
@@ -3879,50 +3879,50 @@ const jr = ({
3879
3879
  onComplete: t,
3880
3880
  onBack: n
3881
3881
  }) => {
3882
- 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);
3883
3883
  ge.useEffect(() => {
3884
- 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);
3885
3885
  }, [i]);
3886
3886
  const k = Ee(
3887
3887
  () => a && a.length > 0 ? Hr(a) : [],
3888
3888
  [a]
3889
- ), $ = y === k.length - 1, A = k[y] ?? [];
3889
+ ), z = x === k.length - 1, A = k[x] ?? [];
3890
3890
  ge.useEffect(() => {
3891
- !o && a && a.length === 0 && !C && !c && (F(!0), u({ applicantId: e, criteriaValueInputs: [] }).then(() => t == null ? void 0 : t()).catch(console.error));
3892
- }, [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]);
3893
3893
  const I = Q((R, P) => {
3894
- x((z) => ({ ...z, [R]: P })), m((z) => {
3895
- const _ = { ...z };
3896
- return delete _[R], _;
3894
+ b((O) => ({ ...O, [R]: P })), m((O) => {
3895
+ const H = { ...O };
3896
+ return delete H[R], H;
3897
3897
  });
3898
3898
  }, []), j = Q(() => {
3899
3899
  const R = {};
3900
3900
  for (const { criterion: P } of A) {
3901
- const z = _r(P, p[P.id] ?? []);
3902
- z && (R[P.id] = z);
3901
+ const O = _r(P, p[P.id] ?? []);
3902
+ O && (R[P.id] = O);
3903
3903
  }
3904
3904
  return m((P) => ({ ...P, ...R })), Object.keys(R).length === 0;
3905
- }, [A, p]), J = () => {
3905
+ }, [A, p]), G = () => {
3906
3906
  j() && h((R) => R + 1);
3907
3907
  }, E = () => {
3908
- y > 0 ? h((R) => R - 1) : n == null || n();
3909
- }, g = async () => {
3908
+ x > 0 ? h((R) => R - 1) : n == null || n();
3909
+ }, f = async () => {
3910
3910
  if (!(!j() || !a))
3911
3911
  try {
3912
- const R = a.map((z) => {
3913
- const _ = (p[z.id] ?? []).filter((O) => O && O.trim());
3914
- return _.length > 0 ? { riskCriteriaId: z.id, values: _ } : null;
3915
- }).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);
3916
3916
  await u({ applicantId: e, criteriaValueInputs: R }), t == null || t();
3917
3917
  } catch (R) {
3918
3918
  console.error("Risk scoring submit error:", R);
3919
3919
  }
3920
3920
  };
3921
3921
  return o ? /* @__PURE__ */ r(K, { children: /* @__PURE__ */ s(W, { children: [
3922
- /* @__PURE__ */ r(be, { className: "my-8" }),
3922
+ /* @__PURE__ */ r(ve, { className: "my-8" }),
3923
3923
  /* @__PURE__ */ r("p", { className: "text-center text-sm mt-4", style: { color: "var(--metakyc-text-secondary, #6b7280)" }, children: "Loading risk scoring criteria…" })
3924
3924
  ] }) }) : !o && a && a.length === 0 ? /* @__PURE__ */ r(K, { children: /* @__PURE__ */ s(W, { children: [
3925
- /* @__PURE__ */ r(be, { className: "my-8" }),
3925
+ /* @__PURE__ */ r(ve, { className: "my-8" }),
3926
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…" })
3927
3927
  ] }) }) : d ? /* @__PURE__ */ r(K, { children: /* @__PURE__ */ r(W, { children: /* @__PURE__ */ s("p", { className: "text-danger-500", children: [
3928
3928
  "Error loading criteria: ",
@@ -3934,7 +3934,7 @@ const jr = ({
3934
3934
  k.length > 1 && /* @__PURE__ */ s("div", { className: "flex items-center justify-between mt-3", children: [
3935
3935
  /* @__PURE__ */ s("span", { className: "text-xs", style: { color: "var(--metakyc-text-muted, #9ca3af)" }, children: [
3936
3936
  "Page ",
3937
- y + 1,
3937
+ x + 1,
3938
3938
  " of ",
3939
3939
  k.length
3940
3940
  ] }),
@@ -3944,8 +3944,8 @@ const jr = ({
3944
3944
  className: "rounded-full transition-all duration-200",
3945
3945
  style: {
3946
3946
  height: "6px",
3947
- width: P === y ? "20px" : "6px",
3948
- 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)"
3949
3949
  }
3950
3950
  },
3951
3951
  P
@@ -3964,7 +3964,7 @@ const jr = ({
3964
3964
  )) }),
3965
3965
  /* @__PURE__ */ s(pe, { className: "flex items-center justify-between", children: [
3966
3966
  /* @__PURE__ */ s(
3967
- V,
3967
+ Z,
3968
3968
  {
3969
3969
  type: "button",
3970
3970
  variant: "outline",
@@ -3972,15 +3972,15 @@ const jr = ({
3972
3972
  style: { display: "flex", alignItems: "center", gap: "4px" },
3973
3973
  children: [
3974
3974
  /* @__PURE__ */ r(gt, { size: 14 }),
3975
- y > 0 ? "Previous" : "Back"
3975
+ x > 0 ? "Previous" : "Back"
3976
3976
  ]
3977
3977
  }
3978
3978
  ),
3979
- $ ? /* @__PURE__ */ r(V, { type: "button", isLoading: c, onClick: g, children: "Continue" }) : /* @__PURE__ */ s(
3980
- V,
3979
+ z ? /* @__PURE__ */ r(Z, { type: "button", isLoading: l, onClick: f, children: "Continue" }) : /* @__PURE__ */ s(
3980
+ Z,
3981
3981
  {
3982
3982
  type: "button",
3983
- onClick: J,
3983
+ onClick: G,
3984
3984
  style: { display: "flex", alignItems: "center", gap: "4px" },
3985
3985
  children: [
3986
3986
  "Next",
@@ -4004,20 +4004,20 @@ const jr = ({
4004
4004
  me,
4005
4005
  {
4006
4006
  value: t[0] ?? "",
4007
- onChange: (c) => a([c.target.value]),
4007
+ onChange: (l) => a([l.target.value]),
4008
4008
  type: o ? "number" : "text",
4009
4009
  placeholder: "Enter your answer…",
4010
4010
  error: n,
4011
4011
  required: e.isRequired,
4012
4012
  min: e.min,
4013
4013
  max: e.max,
4014
- onKeyDown: (c) => {
4015
- 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();
4016
4016
  }
4017
4017
  }
4018
4018
  ),
4019
4019
  i === "radio" && /* @__PURE__ */ s("div", { className: "metakyc-options-group", style: { display: "flex", flexDirection: "column", gap: "8px" }, children: [
4020
- (e.defaultValues ?? []).map((c) => /* @__PURE__ */ s(
4020
+ (e.defaultValues ?? []).map((l) => /* @__PURE__ */ s(
4021
4021
  "label",
4022
4022
  {
4023
4023
  className: "metakyc-option-label",
@@ -4027,8 +4027,8 @@ const jr = ({
4027
4027
  "input",
4028
4028
  {
4029
4029
  type: "radio",
4030
- checked: t[0] === c,
4031
- onChange: () => a([c]),
4030
+ checked: t[0] === l,
4031
+ onChange: () => a([l]),
4032
4032
  className: "metakyc-option-input",
4033
4033
  style: {
4034
4034
  width: "16px",
@@ -4045,15 +4045,15 @@ const jr = ({
4045
4045
  }
4046
4046
  }
4047
4047
  ),
4048
- /* @__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 })
4049
4049
  ]
4050
4050
  },
4051
- c
4051
+ l
4052
4052
  )),
4053
4053
  n && /* @__PURE__ */ r("p", { className: "text-sm text-danger-500", children: n })
4054
4054
  ] }),
4055
4055
  i === "checkbox" && /* @__PURE__ */ s("div", { className: "metakyc-options-group", style: { display: "flex", flexDirection: "column", gap: "8px" }, children: [
4056
- (e.defaultValues ?? []).map((c) => /* @__PURE__ */ s(
4056
+ (e.defaultValues ?? []).map((l) => /* @__PURE__ */ s(
4057
4057
  "label",
4058
4058
  {
4059
4059
  className: "metakyc-option-label",
@@ -4063,9 +4063,9 @@ const jr = ({
4063
4063
  "input",
4064
4064
  {
4065
4065
  type: "checkbox",
4066
- checked: t.includes(c),
4066
+ checked: t.includes(l),
4067
4067
  onChange: (d) => {
4068
- 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));
4069
4069
  },
4070
4070
  className: "metakyc-option-input",
4071
4071
  style: {
@@ -4083,10 +4083,10 @@ const jr = ({
4083
4083
  }
4084
4084
  }
4085
4085
  ),
4086
- /* @__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 })
4087
4087
  ]
4088
4088
  },
4089
- c
4089
+ l
4090
4090
  )),
4091
4091
  n && /* @__PURE__ */ r("p", { className: "text-sm text-danger-500", children: n })
4092
4092
  ] }),
@@ -4094,7 +4094,7 @@ const jr = ({
4094
4094
  He,
4095
4095
  {
4096
4096
  value: t[0] ?? "",
4097
- onChange: (c) => a([c.target.value]),
4097
+ onChange: (l) => a([l.target.value]),
4098
4098
  options: [
4099
4099
  { value: "US", label: "United States" },
4100
4100
  { value: "GB", label: "United Kingdom" },
@@ -4113,7 +4113,7 @@ const jr = ({
4113
4113
  onComplete: t,
4114
4114
  onBack: n
4115
4115
  }) => {
4116
- 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);
4117
4117
  return /* @__PURE__ */ r("form", { onSubmit: async (N) => {
4118
4118
  if (N.preventDefault(), i === null) {
4119
4119
  p("Please select an investor type");
@@ -4126,8 +4126,8 @@ const jr = ({
4126
4126
  investorType: i
4127
4127
  };
4128
4128
  console.log("Submitting investor categorization:", m);
4129
- const y = await a.setInvestorCategorization(m);
4130
- 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();
4131
4131
  } catch (m) {
4132
4132
  console.error("Error submitting investor categorization:", m), p(m.message || "Failed to submit investor categorization");
4133
4133
  } finally {
@@ -4234,12 +4234,12 @@ const jr = ({
4234
4234
  ] }) })
4235
4235
  ] }),
4236
4236
  /* @__PURE__ */ s(pe, { className: "flex justify-between", children: [
4237
- 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" }),
4238
4238
  /* @__PURE__ */ r(
4239
- V,
4239
+ Z,
4240
4240
  {
4241
4241
  type: "submit",
4242
- isLoading: c,
4242
+ isLoading: l,
4243
4243
  disabled: i === null,
4244
4244
  children: "Submit"
4245
4245
  }
@@ -4251,117 +4251,117 @@ const jr = ({
4251
4251
  onComplete: t,
4252
4252
  onBack: n
4253
4253
  }) => {
4254
- 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);
4255
4255
  ne(() => {
4256
4256
  (async () => {
4257
4257
  try {
4258
4258
  d(!0), N(null), console.log("Loading appropriateness test for applicant:", e);
4259
- const M = await a.getAppropriatenessTest(e);
4260
- if (console.log("Appropriateness test data:", M), o(M), M.waitTimeSpanForNextTry && M.waitTimeSpanForNextTry !== "00:00:00") {
4261
- const Z = J(M.waitTimeSpanForNextTry);
4262
- 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);
4263
4263
  }
4264
- } catch (M) {
4265
- 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");
4266
4266
  } finally {
4267
4267
  d(!1);
4268
4268
  }
4269
4269
  })();
4270
4270
  }, [e, a]);
4271
- const J = (O) => {
4272
- const M = O.split(":").map(Number);
4273
- if (M.length === 3) {
4274
- const [Z, w, U] = M;
4275
- 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;
4276
4276
  }
4277
4277
  return 0;
4278
- }, E = (O) => {
4279
- const M = Math.floor(O / 60), Z = O % 60;
4280
- 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")}`;
4281
4281
  };
4282
4282
  ne(() => {
4283
- if (!F || h <= 0) return;
4284
- const O = setInterval(() => {
4285
- 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);
4286
4286
  }, 1e3);
4287
- return () => clearInterval(O);
4288
- }, [F, h]), ne(() => {
4287
+ return () => clearInterval(M);
4288
+ }, [D, h]), ne(() => {
4289
4289
  if (I <= 0) return;
4290
- const O = setInterval(() => {
4291
- j((M) => M <= 1 ? 0 : M - 1);
4290
+ const M = setInterval(() => {
4291
+ j((T) => T <= 1 ? 0 : T - 1);
4292
4292
  }, 1e3);
4293
- return () => clearInterval(O);
4293
+ return () => clearInterval(M);
4294
4294
  }, [I]), ne(() => {
4295
- $ && !u && P();
4296
- }, [$]);
4297
- const g = () => {
4295
+ z && !u && P();
4296
+ }, [z]);
4297
+ const f = () => {
4298
4298
  i && (k(!0), C(i.testDurationSec));
4299
- }, R = (O, M) => {
4300
- y((Z) => ({
4301
- ...Z,
4302
- [O]: M
4299
+ }, R = (M, T) => {
4300
+ x((J) => ({
4301
+ ...J,
4302
+ [M]: T
4303
4303
  }));
4304
- }, P = async (O) => {
4305
- if (O && O.preventDefault(), !!i) {
4306
- if (!$) {
4307
- const M = i.appropriatenessQuestions.length - Object.keys(m).length;
4308
- if (M > 0) {
4309
- 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.`);
4310
4310
  return;
4311
4311
  }
4312
4312
  }
4313
4313
  p(!0), N(null);
4314
4314
  try {
4315
- const M = i.appropriatenessQuestions.map(
4315
+ const T = i.appropriatenessQuestions.map(
4316
4316
  (w) => ({
4317
4317
  appropriatenessQuestionId: w.id,
4318
4318
  value: m[w.id] || ""
4319
4319
  // Empty string if not answered
4320
4320
  })
4321
- ), Z = {
4321
+ ), J = {
4322
4322
  applicantId: e,
4323
4323
  appropriatenessTestId: i.id,
4324
- appropriatenessQuestionResults: M
4324
+ appropriatenessQuestionResults: T
4325
4325
  };
4326
- console.log("Submitting appropriateness test:", Z);
4326
+ console.log("Submitting appropriateness test:", J);
4327
4327
  try {
4328
- const w = await a.fillAppropriatenessTest(Z);
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), 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));
4330
4330
  } catch (w) {
4331
4331
  if (w.code === 400 && w.message) {
4332
- const U = w.message;
4333
- 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);
4334
4334
  } else
4335
4335
  throw w;
4336
4336
  }
4337
- } catch (M) {
4338
- 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({});
4339
4339
  } finally {
4340
4340
  p(!1);
4341
4341
  }
4342
4342
  }
4343
- }, z = async () => {
4343
+ }, O = async () => {
4344
4344
  try {
4345
- const O = await a.getAppropriatenessTest(e);
4346
- if (console.log("Reloaded test data:", O), o(O), O.waitTimeSpanForNextTry && O.waitTimeSpanForNextTry !== "00:00:00") {
4347
- const M = J(O.waitTimeSpanForNextTry);
4348
- 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);
4349
4349
  }
4350
- } catch (O) {
4351
- console.error("Error reloading test data:", O), N((M) => M + `
4350
+ } catch (M) {
4351
+ console.error("Error reloading test data:", M), N((T) => T + `
4352
4352
 
4353
4353
  Failed to reload test data. Please refresh the page.`);
4354
4354
  }
4355
4355
  };
4356
- if (c)
4356
+ if (l)
4357
4357
  return /* @__PURE__ */ r(K, { children: /* @__PURE__ */ s(W, { children: [
4358
- /* @__PURE__ */ r(be, { className: "my-8" }),
4358
+ /* @__PURE__ */ r(ve, { className: "my-8" }),
4359
4359
  /* @__PURE__ */ r("p", { className: "text-center text-gray-600 dark:text-gray-400 mt-4", children: "Loading appropriateness test..." })
4360
4360
  ] }) });
4361
4361
  if (!i)
4362
4362
  return /* @__PURE__ */ r(K, { children: /* @__PURE__ */ s(W, { className: "py-12 text-center", children: [
4363
4363
  /* @__PURE__ */ r("p", { className: "text-danger-500 text-lg mb-4", children: "No test data available" }),
4364
- 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 })
4365
4365
  ] }) });
4366
4366
  if (I > 0)
4367
4367
  return /* @__PURE__ */ s(K, { children: [
@@ -4374,11 +4374,11 @@ Failed to reload test data. Please refresh the page.`);
4374
4374
  /* @__PURE__ */ r("div", { className: "text-6xl font-bold text-primary-500 mb-2", children: E(I) }),
4375
4375
  /* @__PURE__ */ r("p", { className: "text-gray-600 dark:text-gray-400", children: "Please wait before attempting the test again" })
4376
4376
  ] }),
4377
- 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 }) })
4378
4378
  ] })
4379
4379
  ] });
4380
- const _ = i.testAllowedMaxTry - i.totalFailedTries;
4381
- 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: [
4382
4382
  /* @__PURE__ */ r(de, { children: /* @__PURE__ */ s("div", { className: "flex items-center justify-between", children: [
4383
4383
  /* @__PURE__ */ s("div", { children: [
4384
4384
  /* @__PURE__ */ r("h2", { className: "text-lg font-bold text-gray-900 dark:text-white", children: i.displayName }),
@@ -4403,14 +4403,14 @@ Failed to reload test data. Please refresh the page.`);
4403
4403
  " of ",
4404
4404
  i.totalQuestionCount
4405
4405
  ] }),
4406
- /* @__PURE__ */ s(Ae, { variant: _ > 1 ? "success" : "warning", children: [
4407
- _,
4406
+ /* @__PURE__ */ s(Ae, { variant: H > 1 ? "success" : "warning", children: [
4407
+ H,
4408
4408
  " attempt",
4409
- _ !== 1 ? "s" : "",
4409
+ H !== 1 ? "s" : "",
4410
4410
  " remaining"
4411
4411
  ] })
4412
4412
  ] }),
4413
- i.appropriatenessQuestions.map((O, M) => /* @__PURE__ */ s(
4413
+ i.appropriatenessQuestions.map((M, T) => /* @__PURE__ */ s(
4414
4414
  "div",
4415
4415
  {
4416
4416
  className: "p-4 border border-gray-200 dark:border-gray-700 rounded-lg",
@@ -4418,53 +4418,53 @@ Failed to reload test data. Please refresh the page.`);
4418
4418
  /* @__PURE__ */ s("div", { className: "mb-4", children: [
4419
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: [
4420
4420
  "Question ",
4421
- M + 1
4421
+ T + 1
4422
4422
  ] }),
4423
- O.groupName && /* @__PURE__ */ r("span", { className: "ml-2 text-xs text-gray-500 dark:text-gray-400", children: O.groupName }),
4424
- /* @__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 })
4425
4425
  ] }),
4426
- /* @__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(
4427
4427
  "label",
4428
4428
  {
4429
4429
  className: `
4430
4430
  flex items-center p-3 border-2 rounded-lg cursor-pointer transition-all
4431
- ${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"}
4432
4432
  `,
4433
4433
  children: [
4434
4434
  /* @__PURE__ */ r(
4435
4435
  "input",
4436
4436
  {
4437
4437
  type: "radio",
4438
- name: `question-${O.id}`,
4439
- value: Z,
4440
- checked: m[O.id] === Z,
4441
- 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),
4442
4442
  className: "h-4 w-4 text-primary-500 border-gray-300 focus:ring-primary-500",
4443
4443
  disabled: u
4444
4444
  }
4445
4445
  ),
4446
- /* @__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 })
4447
4447
  ]
4448
4448
  },
4449
4449
  w
4450
4450
  )) })
4451
4451
  ]
4452
4452
  },
4453
- O.id
4453
+ M.id
4454
4454
  )),
4455
- 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: [
4456
4456
  /* @__PURE__ */ r("strong", { children: "Error:" }),
4457
4457
  " ",
4458
- x
4458
+ b
4459
4459
  ] }) }),
4460
- $ && /* @__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: [
4461
4461
  /* @__PURE__ */ r("strong", { children: "Time's up!" }),
4462
4462
  " Your answers are being submitted automatically."
4463
4463
  ] }) })
4464
4464
  ] }),
4465
4465
  /* @__PURE__ */ s(pe, { className: "flex justify-between", children: [
4466
4466
  /* @__PURE__ */ r(
4467
- V,
4467
+ Z,
4468
4468
  {
4469
4469
  type: "button",
4470
4470
  variant: "outline",
@@ -4474,12 +4474,12 @@ Failed to reload test data. Please refresh the page.`);
4474
4474
  }
4475
4475
  ),
4476
4476
  /* @__PURE__ */ r(
4477
- V,
4477
+ Z,
4478
4478
  {
4479
4479
  type: "submit",
4480
4480
  isLoading: u,
4481
4481
  disabled: Object.keys(m).length < i.totalQuestionCount,
4482
- children: $ ? "Submitting..." : "Submit Test"
4482
+ children: z ? "Submitting..." : "Submit Test"
4483
4483
  }
4484
4484
  )
4485
4485
  ] })
@@ -4505,24 +4505,24 @@ Failed to reload test data. Please refresh the page.`);
4505
4505
  ] }),
4506
4506
  /* @__PURE__ */ s("div", { className: "flex items-center justify-between p-4 bg-blue-50 dark:bg-blue-900/20 rounded-lg", children: [
4507
4507
  /* @__PURE__ */ r("span", { className: "text-gray-700 dark:text-gray-300 font-medium", children: "Attempts Remaining:" }),
4508
- /* @__PURE__ */ r(Ae, { variant: _ > 1 ? "success" : "warning", children: _ })
4508
+ /* @__PURE__ */ r(Ae, { variant: H > 1 ? "success" : "warning", children: H })
4509
4509
  ] })
4510
4510
  ] }),
4511
- 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: [
4512
4512
  /* @__PURE__ */ r("strong", { children: "Previous Attempt:" }),
4513
4513
  " ",
4514
- x
4514
+ b
4515
4515
  ] }) }),
4516
- _ <= 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." }) })
4517
4517
  ] }),
4518
4518
  /* @__PURE__ */ s(pe, { className: "flex justify-between", children: [
4519
- 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" }),
4520
4520
  /* @__PURE__ */ r(
4521
- V,
4521
+ Z,
4522
4522
  {
4523
4523
  type: "button",
4524
- onClick: g,
4525
- disabled: _ <= 0,
4524
+ onClick: f,
4525
+ disabled: H <= 0,
4526
4526
  children: "Start Test"
4527
4527
  }
4528
4528
  )
@@ -4533,8 +4533,8 @@ Failed to reload test data. Please refresh the page.`);
4533
4533
  onComplete: t,
4534
4534
  onBack: n
4535
4535
  }) => {
4536
- var Z, w, U, te;
4537
- 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({
4538
4538
  defaultValues: {
4539
4539
  street: "",
4540
4540
  streetNumber: "",
@@ -4548,18 +4548,18 @@ Failed to reload test data. Please refresh the page.`);
4548
4548
  ne(() => {
4549
4549
  (async () => {
4550
4550
  try {
4551
- const [D, S] = await Promise.all([
4551
+ const [F, S] = await Promise.all([
4552
4552
  a.getApplicantData(e),
4553
4553
  i.getCountries("", "en")
4554
4554
  ]);
4555
- F(D);
4556
- const H = /* @__PURE__ */ new Set(), X = S.filter((ve) => {
4557
- const Ce = ve.abbreviation3 || ve.abbreviation;
4558
- 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);
4559
4559
  });
4560
- $(X);
4561
- const Y = D.applicantRequestData;
4562
- if (_.reset({
4560
+ z(X);
4561
+ const Y = F.applicantRequestData;
4562
+ if (H.reset({
4563
4563
  street: (Y == null ? void 0 : Y.street) || "",
4564
4564
  streetNumber: (Y == null ? void 0 : Y.streetNumber) || "",
4565
4565
  city: (Y == null ? void 0 : Y.city) || "",
@@ -4567,136 +4567,136 @@ Failed to reload test data. Please refresh the page.`);
4567
4567
  country: (Y == null ? void 0 : Y.country) || "",
4568
4568
  nationality: (Y == null ? void 0 : Y.nationality) || "",
4569
4569
  phonenumber: (Y == null ? void 0 : Y.phonenumber) || ""
4570
- }), D.kycRecords && D.kycRecords.length > 0 && D.kycRecords[0].providerTokenObject !== null && !z.current) {
4571
- 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;
4572
4572
  try {
4573
- await N(), J(!0);
4574
- } catch (ve) {
4575
- console.error("[Identity] Auto-request failed:", ve);
4573
+ await N(), G(!0);
4574
+ } catch (ke) {
4575
+ console.error("[Identity] Auto-request failed:", ke);
4576
4576
  }
4577
4577
  }
4578
- } catch (D) {
4579
- console.error("Error loading applicant data:", D);
4578
+ } catch (F) {
4579
+ console.error("Error loading applicant data:", F);
4580
4580
  } finally {
4581
4581
  I(!1);
4582
4582
  }
4583
4583
  })();
4584
4584
  }, [e]), ne(() => {
4585
- c && !j && (console.log("[Identity] Identity data already loaded, showing provider"), J(!0));
4586
- }, [c, j]), ne(() => {
4585
+ l && !j && (console.log("[Identity] Identity data already loaded, showing provider"), G(!0));
4586
+ }, [l, j]), ne(() => {
4587
4587
  if (u) {
4588
4588
  if (u.expiresAt) {
4589
4589
  const B = new Date(u.expiresAt).getTime();
4590
4590
  if (Date.now() >= B) {
4591
- 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.");
4592
4592
  return;
4593
4593
  }
4594
4594
  }
4595
4595
  if (u.url)
4596
4596
  try {
4597
- const D = new URL(u.url).toString().toLowerCase();
4598
- if (D.includes("expired") || D.includes("invalid") || D.includes("error")) {
4599
- 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.");
4600
4600
  return;
4601
4601
  }
4602
4602
  } catch {
4603
4603
  console.error("[Identity] Invalid token URL");
4604
4604
  }
4605
4605
  if (u.status === "expired" || u.error === "expired" || u.expired === !0) {
4606
- 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.");
4607
4607
  return;
4608
4608
  }
4609
4609
  }
4610
4610
  }, [u]), ne(() => {
4611
- if (d !== null && u && !y && j && !R) {
4611
+ if (d !== null && u && !x && j && !R) {
4612
4612
  const B = d;
4613
4613
  if (u.url) {
4614
- 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);
4615
4615
  try {
4616
- if (new URL(u.url), B === fe.SardinAI) {
4616
+ if (new URL(u.url), B === xe.SardinAI) {
4617
4617
  console.log("[SardinAI] Initializing Risk SDK in background...");
4618
4618
  try {
4619
- const D = Me.parseProviderConfig(d, u, o);
4620
- Me.createProvider(d, D).initialize().then(() => {
4619
+ const F = Me.parseProviderConfig(d, u, o);
4620
+ Me.createProvider(d, F).initialize().then(() => {
4621
4621
  console.log("[SardinAI] Risk SDK initialized successfully in background");
4622
- }).catch((H) => {
4623
- console.warn("[SardinAI] Risk SDK initialization failed (non-blocking):", H);
4622
+ }).catch((U) => {
4623
+ console.warn("[SardinAI] Risk SDK initialization failed (non-blocking):", U);
4624
4624
  });
4625
- } catch (D) {
4626
- console.warn("[SardinAI] Risk SDK setup failed (non-blocking):", D);
4625
+ } catch (F) {
4626
+ console.warn("[SardinAI] Risk SDK setup failed (non-blocking):", F);
4627
4627
  }
4628
4628
  }
4629
4629
  h({ type: "url", url: u.url });
4630
- } catch (D) {
4631
- 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);
4632
4632
  }
4633
4633
  return;
4634
4634
  }
4635
- if (B === fe.SardinAI) {
4636
- 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);
4637
4637
  try {
4638
- 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);
4639
4639
  S.initialize().then(() => {
4640
4640
  console.log("[SardinAI] Risk SDK initialized successfully"), h(S), setTimeout(() => {
4641
4641
  t == null || t();
4642
4642
  }, 2e3);
4643
- }).catch((H) => {
4643
+ }).catch((U) => {
4644
4644
  var Y;
4645
- console.error("[SardinAI] Failed to initialize:", H);
4646
- const X = ((Y = H.message) == null ? void 0 : Y.toLowerCase()) || "";
4647
- 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}`);
4648
4648
  });
4649
- } catch (D) {
4650
- 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}`);
4651
4651
  }
4652
4652
  return;
4653
4653
  }
4654
4654
  try {
4655
- g(null);
4656
- const D = Me.parseProviderConfig(d, u, o), S = Me.createProvider(d, D);
4657
- 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) => {
4658
4658
  var X;
4659
- 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);
4660
4660
  }), S.onComplete && S.onComplete(() => {
4661
4661
  t == null || t();
4662
- })) : B === fe.Onfido && S.initialize("identity-container").catch((H) => {
4663
- 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}`);
4664
4664
  }), h(S);
4665
- } catch (D) {
4666
- 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}`);
4667
4667
  }
4668
4668
  }
4669
4669
  return () => {
4670
- if (y && y.destroy)
4670
+ if (x && x.destroy)
4671
4671
  try {
4672
- y.destroy();
4672
+ x.destroy();
4673
4673
  } catch (B) {
4674
4674
  console.error("[Identity] Error destroying provider:", B);
4675
4675
  }
4676
4676
  };
4677
- }, [d, u, y, j, t, R]);
4678
- const O = async () => {
4677
+ }, [d, u, x, j, t, R]);
4678
+ const M = async () => {
4679
4679
  try {
4680
- g(null), P(!1), await N(), J(!0);
4680
+ f(null), P(!1), await N(), G(!0);
4681
4681
  } catch (B) {
4682
4682
  console.error("Error starting identity verification:", B);
4683
4683
  }
4684
- }, M = async () => {
4684
+ }, T = async () => {
4685
4685
  try {
4686
- 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);
4687
4687
  } catch (B) {
4688
- 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");
4689
4689
  }
4690
4690
  };
4691
4691
  if (A || p)
4692
4692
  return /* @__PURE__ */ r(K, { children: /* @__PURE__ */ s(W, { children: [
4693
- /* @__PURE__ */ r(be, { className: "my-8" }),
4693
+ /* @__PURE__ */ r(ve, { className: "my-8" }),
4694
4694
  /* @__PURE__ */ r("p", { className: "text-center text-gray-600 dark:text-gray-400 mt-4", children: "Loading identity verification..." })
4695
4695
  ] }) });
4696
- if (x)
4696
+ if (b)
4697
4697
  return /* @__PURE__ */ r(K, { children: /* @__PURE__ */ r(W, { children: /* @__PURE__ */ s("p", { className: "text-danger-500", children: [
4698
4698
  "Error: ",
4699
- x.message
4699
+ b.message
4700
4700
  ] }) }) });
4701
4701
  if (j && (E || R))
4702
4702
  return /* @__PURE__ */ s(K, { children: [
@@ -4736,11 +4736,11 @@ Failed to reload test data. Please refresh the page.`);
4736
4736
  ] })
4737
4737
  ] }),
4738
4738
  /* @__PURE__ */ s(pe, { className: "flex justify-between", children: [
4739
- n && /* @__PURE__ */ r(V, { type: "button", variant: "outline", onClick: n, children: "Back" }),
4740
- /* @__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" })
4741
4741
  ] })
4742
4742
  ] });
4743
- if (j && c) {
4743
+ if (j && l) {
4744
4744
  const B = d;
4745
4745
  return u != null && u.url ? /* @__PURE__ */ s(K, { children: [
4746
4746
  /* @__PURE__ */ r(de, { children: /* @__PURE__ */ s("div", { className: "flex items-center justify-between", children: [
@@ -4749,12 +4749,12 @@ Failed to reload test data. Please refresh the page.`);
4749
4749
  /* @__PURE__ */ r("p", { className: "text-gray-600 dark:text-gray-400 mt-1", children: "Please complete the identity verification process" })
4750
4750
  ] }),
4751
4751
  /* @__PURE__ */ r(
4752
- V,
4752
+ Z,
4753
4753
  {
4754
4754
  type: "button",
4755
4755
  variant: "outline",
4756
4756
  size: "sm",
4757
- onClick: M,
4757
+ onClick: T,
4758
4758
  disabled: p,
4759
4759
  children: "Restart"
4760
4760
  }
@@ -4772,14 +4772,14 @@ Failed to reload test data. Please refresh the page.`);
4772
4772
  className: "w-full h-full border-0 rounded-lg",
4773
4773
  allow: "camera; microphone; geolocation",
4774
4774
  title: "Identity Verification",
4775
- onLoad: (D) => {
4776
- var S, H, X;
4775
+ onLoad: (F) => {
4776
+ var S, U, X;
4777
4777
  console.log("[Identity] Iframe loaded");
4778
4778
  try {
4779
- 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);
4780
4780
  if (we) {
4781
- const ve = ((X = (H = we.body) == null ? void 0 : H.textContent) == null ? void 0 : X.toLowerCase()) || "";
4782
- (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."));
4783
4783
  }
4784
4784
  } catch {
4785
4785
  console.log("[Identity] Cannot check iframe content (CORS)");
@@ -4788,14 +4788,14 @@ Failed to reload test data. Please refresh the page.`);
4788
4788
  }
4789
4789
  ) })
4790
4790
  ] }),
4791
- n && /* @__PURE__ */ r(pe, { children: /* @__PURE__ */ r(V, { variant: "outline", onClick: n, children: "Back" }) })
4792
- ] }) : 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: [
4793
4793
  /* @__PURE__ */ s(de, { children: [
4794
4794
  /* @__PURE__ */ r("h2", { className: "text-2xl font-bold", children: "Device Risk Assessment" }),
4795
4795
  /* @__PURE__ */ r("p", { className: "text-gray-600 dark:text-gray-400 mt-1", children: "Analyzing device security and behavioral patterns..." })
4796
4796
  ] }),
4797
4797
  /* @__PURE__ */ r(W, { children: /* @__PURE__ */ s("div", { className: "text-center py-12", children: [
4798
- /* @__PURE__ */ r(be, { className: "mb-4" }),
4798
+ /* @__PURE__ */ r(ve, { className: "mb-4" }),
4799
4799
  /* @__PURE__ */ r("p", { className: "text-gray-600 dark:text-gray-400", children: "Please wait while we verify your device security" }),
4800
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" })
4801
4801
  ] }) })
@@ -4805,10 +4805,10 @@ Failed to reload test data. Please refresh the page.`);
4805
4805
  /* @__PURE__ */ r("p", { className: "text-gray-600 dark:text-gray-400 mt-1", children: "Please complete the identity verification process" })
4806
4806
  ] }),
4807
4807
  /* @__PURE__ */ r(W, { children: /* @__PURE__ */ r("div", { id: "identity-container", className: "min-h-[400px]" }) }),
4808
- 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" }) })
4809
4809
  ] });
4810
4810
  }
4811
- 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: [
4812
4812
  /* @__PURE__ */ s(de, { children: [
4813
4813
  /* @__PURE__ */ r("h2", { className: "text-lg font-bold", children: "Review Your Information" }),
4814
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" })
@@ -4818,14 +4818,14 @@ Failed to reload test data. Please refresh the page.`);
4818
4818
  /* @__PURE__ */ s("div", { children: [
4819
4819
  /* @__PURE__ */ r("label", { className: "block text-sm font-medium text-gray-500 dark:text-gray-400", children: "Name" }),
4820
4820
  /* @__PURE__ */ s("p", { className: "mt-1 text-base", children: [
4821
- (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,
4822
4822
  " ",
4823
4823
  (w = C == null ? void 0 : C.applicantRequestData) == null ? void 0 : w.lastName
4824
4824
  ] })
4825
4825
  ] }),
4826
4826
  /* @__PURE__ */ s("div", { children: [
4827
4827
  /* @__PURE__ */ r("label", { className: "block text-sm font-medium text-gray-500 dark:text-gray-400", children: "Email" }),
4828
- /* @__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 })
4829
4829
  ] }),
4830
4830
  /* @__PURE__ */ s("div", { children: [
4831
4831
  /* @__PURE__ */ r("label", { className: "block text-sm font-medium text-gray-500 dark:text-gray-400", children: "Date of Birth" }),
@@ -4838,7 +4838,7 @@ Failed to reload test data. Please refresh the page.`);
4838
4838
  /* @__PURE__ */ r(
4839
4839
  Pe,
4840
4840
  {
4841
- control: _.control,
4841
+ control: H.control,
4842
4842
  name: "country",
4843
4843
  render: ({ field: B }) => /* @__PURE__ */ r(
4844
4844
  He,
@@ -4847,9 +4847,9 @@ Failed to reload test data. Please refresh the page.`);
4847
4847
  label: "Country",
4848
4848
  options: [
4849
4849
  { value: "", label: "Select country..." },
4850
- ...k.map((D) => ({
4851
- value: D.abbreviation3 || D.abbreviation,
4852
- label: D.name
4850
+ ...k.map((F) => ({
4851
+ value: F.abbreviation3 || F.abbreviation,
4852
+ label: F.name
4853
4853
  }))
4854
4854
  ]
4855
4855
  }
@@ -4859,7 +4859,7 @@ Failed to reload test data. Please refresh the page.`);
4859
4859
  /* @__PURE__ */ r(
4860
4860
  Pe,
4861
4861
  {
4862
- control: _.control,
4862
+ control: H.control,
4863
4863
  name: "nationality",
4864
4864
  render: ({ field: B }) => /* @__PURE__ */ r(
4865
4865
  He,
@@ -4868,9 +4868,9 @@ Failed to reload test data. Please refresh the page.`);
4868
4868
  label: "Nationality",
4869
4869
  options: [
4870
4870
  { value: "", label: "Select nationality..." },
4871
- ...k.map((D) => ({
4872
- value: D.abbreviation3 || D.abbreviation,
4873
- label: D.name
4871
+ ...k.map((F) => ({
4872
+ value: F.abbreviation3 || F.abbreviation,
4873
+ label: F.name
4874
4874
  }))
4875
4875
  ]
4876
4876
  }
@@ -4882,7 +4882,7 @@ Failed to reload test data. Please refresh the page.`);
4882
4882
  /* @__PURE__ */ r(
4883
4883
  Pe,
4884
4884
  {
4885
- control: _.control,
4885
+ control: H.control,
4886
4886
  name: "street",
4887
4887
  render: ({ field: B }) => /* @__PURE__ */ r(me, { ...B, label: "Street" })
4888
4888
  }
@@ -4890,7 +4890,7 @@ Failed to reload test data. Please refresh the page.`);
4890
4890
  /* @__PURE__ */ r(
4891
4891
  Pe,
4892
4892
  {
4893
- control: _.control,
4893
+ control: H.control,
4894
4894
  name: "streetNumber",
4895
4895
  render: ({ field: B }) => /* @__PURE__ */ r(me, { ...B, label: "Street Number" })
4896
4896
  }
@@ -4900,7 +4900,7 @@ Failed to reload test data. Please refresh the page.`);
4900
4900
  /* @__PURE__ */ r(
4901
4901
  Pe,
4902
4902
  {
4903
- control: _.control,
4903
+ control: H.control,
4904
4904
  name: "city",
4905
4905
  render: ({ field: B }) => /* @__PURE__ */ r(me, { ...B, label: "City" })
4906
4906
  }
@@ -4908,7 +4908,7 @@ Failed to reload test data. Please refresh the page.`);
4908
4908
  /* @__PURE__ */ r(
4909
4909
  Pe,
4910
4910
  {
4911
- control: _.control,
4911
+ control: H.control,
4912
4912
  name: "zip",
4913
4913
  render: ({ field: B }) => /* @__PURE__ */ r(me, { ...B, label: "ZIP/Postal Code" })
4914
4914
  }
@@ -4917,7 +4917,7 @@ Failed to reload test data. Please refresh the page.`);
4917
4917
  /* @__PURE__ */ r(
4918
4918
  Pe,
4919
4919
  {
4920
- control: _.control,
4920
+ control: H.control,
4921
4921
  name: "phonenumber",
4922
4922
  render: ({ field: B }) => /* @__PURE__ */ r(me, { ...B, label: "Phone Number", type: "tel" })
4923
4923
  }
@@ -4925,8 +4925,8 @@ Failed to reload test data. Please refresh the page.`);
4925
4925
  ] })
4926
4926
  ] }),
4927
4927
  /* @__PURE__ */ s(pe, { className: "flex justify-between", children: [
4928
- n && /* @__PURE__ */ r(V, { type: "button", variant: "outline", onClick: n, children: "Back" }),
4929
- /* @__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" })
4930
4930
  ] })
4931
4931
  ] }) });
4932
4932
  }, lt = ({
@@ -5063,10 +5063,10 @@ Failed to reload test data. Please refresh the page.`);
5063
5063
  ] }) })
5064
5064
  ] }),
5065
5065
  /* @__PURE__ */ s(pe, { className: "flex justify-center gap-4", children: [
5066
- 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" }),
5067
5067
  d.type === "error" && /* @__PURE__ */ s(dt, { children: [
5068
- o && /* @__PURE__ */ r(V, { variant: "outline", onClick: o, children: "Contact Support" }),
5069
- 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" })
5070
5070
  ] }),
5071
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" }) })
5072
5072
  ] })
@@ -5091,11 +5091,11 @@ Failed to reload test data. Please refresh the page.`);
5091
5091
  subtitle: t,
5092
5092
  className: n = ""
5093
5093
  }) => {
5094
- 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;
5095
- 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: [
5096
5096
  /* @__PURE__ */ s("div", { className: "metakyc-header-title flex items-center text-xl font-bold text-gray-900 dark:text-white", children: [
5097
5097
  o && /* @__PURE__ */ r(Qr, { config: a.logo }),
5098
- o && c && /* @__PURE__ */ r(
5098
+ o && l && /* @__PURE__ */ r(
5099
5099
  "span",
5100
5100
  {
5101
5101
  className: "text-gray-400 dark:text-gray-500 mx-3",
@@ -5103,7 +5103,7 @@ Failed to reload test data. Please refresh the page.`);
5103
5103
  children: "|"
5104
5104
  }
5105
5105
  ),
5106
- c && /* @__PURE__ */ r("span", { children: i })
5106
+ l && /* @__PURE__ */ r("span", { children: i })
5107
5107
  ] }),
5108
5108
  t && /* @__PURE__ */ r("p", { className: "text-sm text-gray-600 dark:text-gray-400 mt-1", children: t })
5109
5109
  ] });
@@ -5245,84 +5245,92 @@ const _e = {
5245
5245
  onCancel: a
5246
5246
  }) => {
5247
5247
  var Je, Xe, et, tt;
5248
- 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);
5249
5249
  if (!p)
5250
5250
  throw new Error(
5251
5251
  "workflowKey is required. Provide it either as a prop to CreateApplicantForm or set it in config.applicantForm.workflowKey"
5252
5252
  );
5253
- const x = t || ((Xe = i.applicantForm) == null ? void 0 : Xe.externalRefId) || "", N = ((et = i.applicantForm) == null ? void 0 : et.email) || "", m = Ee(
5254
- () => c != null && c.applicantFormPages && c.applicantFormPages.length > 0 ? c.applicantFormPages : null,
5255
- [c == null ? void 0 : c.applicantFormPages]
5256
- ), y = Ee(() => {
5257
- const l = new Set(je), T = c == null ? void 0 : c.applicantFormRequiredFields;
5258
- 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($);
5259
5259
  if (m)
5260
- for (const L of m)
5261
- for (const f of L.fields)
5262
- !f.isCustom && f.name && f.required && l.add(f.name);
5263
- return Array.from(l);
5264
- }, [c == null ? void 0 : c.applicantFormRequiredFields, m]), h = Ee(() => {
5265
- 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 $;
5266
5266
  if (m) {
5267
- const f = m.flatMap((q) => q.fields).filter((q) => !q.isCustom && q.name).map((q) => q.name), v = new Set(f);
5268
- for (const q of je) v.add(q);
5269
- 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);
5270
5270
  }
5271
- let l;
5272
- (L = i.applicantForm) != null && L.visibleFields ? l = i.applicantForm.visibleFields : c != null && c.applicantFormVisibleFields && c.applicantFormVisibleFields.length > 0 ? l = c.applicantFormVisibleFields : l = zt;
5273
- const T = new Set(l);
5274
- for (const f of je) T.add(f);
5275
- return Array.from(T);
5276
- }, [(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([
5277
5277
  "country",
5278
5278
  "nationality",
5279
5279
  "taxCountry",
5280
5280
  "countryOfBirth",
5281
5281
  "mobileCountryCode",
5282
5282
  "otherNationality"
5283
- ]), F = Ee(() => {
5284
- var T, L;
5285
- const l = /* @__PURE__ */ new Set();
5283
+ ]), D = Ee(() => {
5284
+ var L, $;
5285
+ const c = /* @__PURE__ */ new Set();
5286
5286
  if (m)
5287
- for (const f of m)
5288
- for (const v of f.fields)
5289
- !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));
5290
5290
  else
5291
- for (const f of h)
5292
- C.has(f) && l.add((L = Te[f]) == null ? void 0 : L.countriesType);
5293
- return l.size === 0 && l.add(void 0), Array.from(l);
5294
- }, [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());
5295
5295
  ne(() => {
5296
- if (j.current || F.length === 0) return;
5297
- const l = F.filter((L) => {
5298
- const f = L != null ? String(L) : "all";
5299
- 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);
5300
5300
  });
5301
- if (l.length === 0) {
5302
- 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);
5303
5306
  return;
5304
5307
  }
5305
- 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 () => {
5306
5311
  try {
5307
- const L = await Promise.all(
5308
- l.map(async (f) => {
5309
- 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));
5310
- 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];
5311
5316
  })
5312
5317
  );
5313
- $((f) => ({ ...f, ...Object.fromEntries(L) }));
5314
- } catch (L) {
5315
- 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);
5316
5321
  } finally {
5317
- I(!1), j.current = !1;
5322
+ D.every((y) => {
5323
+ const _ = y != null ? String(y) : "all";
5324
+ return G.current.has(_);
5325
+ }) && I(!1);
5318
5326
  }
5319
5327
  })();
5320
- }, [F]);
5321
- const E = (l, T) => {
5322
- var v;
5323
- const L = T ?? ((v = Te[l]) == null ? void 0 : v.countriesType), f = L != null ? String(L) : "all";
5324
- return k[f] || [];
5325
- }, [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({
5326
5334
  workflowKey: p,
5327
5335
  firstName: "",
5328
5336
  lastName: "",
@@ -5330,7 +5338,7 @@ const _e = {
5330
5338
  email: N,
5331
5339
  dateOfBirth: "",
5332
5340
  phonenumber: "",
5333
- externalRefId: x,
5341
+ externalRefId: b,
5334
5342
  mobileCountryCode: "",
5335
5343
  street: "",
5336
5344
  streetNumber: "",
@@ -5347,178 +5355,178 @@ const _e = {
5347
5355
  educationLevel: "",
5348
5356
  occupation: "",
5349
5357
  taxNumber: ""
5350
- }), [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) => {
5351
- var L;
5352
- const T = {};
5353
- for (const f of l.fields)
5354
- if (f.isCustom) {
5355
- if (f.customType === "paragraph" || f.customType === "br" || f.customType === "link") continue;
5356
- if (f.required && f.paramName) {
5357
- const v = P[f.paramName], q = f.displayText || f.label || f.paramName;
5358
- 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.`);
5359
5367
  }
5360
- } else if (f.name) {
5361
- const v = f.name;
5362
- if (y.includes(v) && Be(g[v])) {
5363
- const q = f.displayText || ((L = Te[v]) == null ? void 0 : L.label) || v;
5364
- 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.`;
5365
5373
  }
5366
5374
  }
5367
- return T;
5368
- }, ve = async () => {
5375
+ return L;
5376
+ }, ke = async () => {
5369
5377
  if (!m) return;
5370
- const l = m[_];
5371
- if (l.conditionalOn && !H(l)) {
5372
- 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();
5373
5381
  return;
5374
5382
  }
5375
- const T = we(l);
5376
- if (Object.keys(T).length > 0) {
5377
- Z(T);
5383
+ const L = we(c);
5384
+ if (Object.keys(L).length > 0) {
5385
+ J(L);
5378
5386
  return;
5379
5387
  }
5380
- Z({}), X >= 0 ? O(X) : await Ce();
5388
+ J({}), X >= 0 ? M(X) : await Ce();
5381
5389
  }, Ce = async () => {
5382
5390
  if (m) {
5383
- let l = {};
5384
- for (const T of m)
5385
- H(T) && (l = { ...l, ...we(T) });
5386
- if (Object.keys(l).length > 0) {
5387
- 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);
5388
5396
  return;
5389
5397
  }
5390
5398
  }
5391
- B(!0), U(null);
5399
+ B(!0), q(null);
5392
5400
  try {
5393
- if (!g.externalRefId || g.externalRefId.trim() === "") {
5394
- 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.");
5395
5403
  return;
5396
5404
  }
5397
- const l = {
5398
- workflowKey: g.workflowKey,
5399
- externalRefId: g.externalRefId.trim()
5405
+ const c = {
5406
+ workflowKey: f.workflowKey,
5407
+ externalRefId: f.externalRefId.trim()
5400
5408
  };
5401
5409
  if (m) {
5402
- for (const f of m)
5403
- if (H(f)) {
5404
- for (const v of f.fields)
5405
- if (!v.isCustom && v.name) {
5406
- const q = v.name, ae = g[q];
5407
- 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);
5408
5416
  }
5409
5417
  }
5410
- for (const f of je)
5411
- if (l[f] === void 0) {
5412
- const v = g[f];
5413
- 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);
5414
5422
  }
5415
5423
  } else
5416
- h.forEach((f) => {
5417
- if (f === "externalRefId") return;
5418
- const v = g[f];
5419
- 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);
5420
5428
  });
5421
- const T = [];
5429
+ const L = [];
5422
5430
  if (m) {
5423
- for (const f of m)
5424
- if (H(f)) {
5425
- for (const v of f.fields)
5426
- if (v.isCustom && v.paramName && v.customType !== "paragraph" && v.customType !== "br" && v.customType !== "link") {
5427
- const q = P[v.paramName] ?? "";
5428
- 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: _ });
5429
5437
  }
5430
5438
  }
5431
5439
  }
5432
- T.length > 0 && (l.applicantAdditionalDatas = T);
5433
- const L = await d(l);
5434
- n(L.applicantId);
5435
- } catch (l) {
5436
- 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");
5437
5445
  } finally {
5438
5446
  B(!1);
5439
5447
  }
5440
- }, ft = async (l) => {
5441
- var T;
5442
- l.preventDefault();
5443
- for (const L of y)
5444
- if (Be(g[L])) {
5445
- const f = ((T = Te[L]) == null ? void 0 : T.label) || L;
5446
- 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.`);
5447
5455
  return;
5448
5456
  }
5449
5457
  await Ce();
5450
- }, Ze = (l, T, L, f) => {
5458
+ }, Ze = (c, L, $, g) => {
5451
5459
  var rt;
5452
- const v = Te[l];
5453
- if (!v) return null;
5454
- const q = y.includes(l), ae = M[l], ie = L || v.label, se = T ?? l, ke = { required: q };
5455
- 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) {
5456
5464
  case "select":
5457
- if (l === "country" || l === "nationality" || l === "taxCountry" || l === "countryOfBirth" || l === "mobileCountryCode") {
5458
- const le = E(l, f);
5465
+ if (c === "country" || c === "nationality" || c === "taxCountry" || c === "countryOfBirth" || c === "mobileCountryCode") {
5466
+ const le = E(c, g);
5459
5467
  return /* @__PURE__ */ r(
5460
5468
  We,
5461
5469
  {
5462
- ...ke,
5463
- label: ie,
5464
- value: g[l] || "",
5465
- onChange: (Re) => D(l, Re),
5466
- 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],
5467
5475
  disabled: A,
5468
- error: ae
5476
+ error: ie
5469
5477
  },
5470
- se
5478
+ fe
5471
5479
  );
5472
5480
  }
5473
- if (l === "salutation")
5481
+ if (c === "salutation")
5474
5482
  return /* @__PURE__ */ r(
5475
5483
  We,
5476
5484
  {
5477
- ...ke,
5478
- label: ie,
5479
- value: ((rt = g[l]) == null ? void 0 : rt.toString()) || "",
5480
- 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),
5481
5489
  options: [
5482
5490
  { value: "", label: "Select salutation..." },
5483
5491
  { value: Ke.Male.toString(), label: "Male" },
5484
5492
  { value: Ke.Female.toString(), label: "Female" },
5485
5493
  { value: Ke.Other.toString(), label: "Other" }
5486
5494
  ],
5487
- error: ae
5495
+ error: ie
5488
5496
  },
5489
- se
5497
+ fe
5490
5498
  );
5491
- if (l === "defaultLanguage") {
5492
- 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;
5493
5501
  return /* @__PURE__ */ r(
5494
5502
  We,
5495
5503
  {
5496
- ...ke,
5497
- label: ie,
5498
- value: g[l] || "",
5499
- onChange: (Re) => D(l, Re),
5504
+ ...se,
5505
+ label: ae,
5506
+ value: f[c] || "",
5507
+ onChange: (Re) => F(c, Re),
5500
5508
  options: [{ value: "", label: "Select language..." }, ...le],
5501
- error: ae
5509
+ error: ie
5502
5510
  },
5503
- se
5511
+ fe
5504
5512
  );
5505
5513
  }
5506
5514
  return null;
5507
5515
  case "multiselect":
5508
- if (l === "otherNationality") {
5509
- const le = E(l, f);
5516
+ if (c === "otherNationality") {
5517
+ const le = E(c, g);
5510
5518
  return /* @__PURE__ */ r(
5511
5519
  Sr,
5512
5520
  {
5513
- ...ke,
5514
- label: ie,
5515
- value: g[l] || [],
5516
- onChange: (Re) => D(l, Re),
5521
+ ...se,
5522
+ label: ae,
5523
+ value: f[c] || [],
5524
+ onChange: (Re) => F(c, Re),
5517
5525
  options: le,
5518
5526
  placeholder: "Select other nationalities...",
5519
5527
  disabled: A
5520
5528
  },
5521
- se
5529
+ fe
5522
5530
  );
5523
5531
  }
5524
5532
  return null;
@@ -5526,58 +5534,58 @@ const _e = {
5526
5534
  return /* @__PURE__ */ r(
5527
5535
  me,
5528
5536
  {
5529
- ...ke,
5537
+ ...se,
5530
5538
  type: "date",
5531
- label: ie,
5532
- value: g[l] || "",
5533
- onChange: (le) => D(l, le.target.value),
5534
- error: ae
5539
+ label: ae,
5540
+ value: f[c] || "",
5541
+ onChange: (le) => F(c, le.target.value),
5542
+ error: ie
5535
5543
  },
5536
- se
5544
+ fe
5537
5545
  );
5538
5546
  case "email":
5539
5547
  return /* @__PURE__ */ r(
5540
5548
  me,
5541
5549
  {
5542
- ...ke,
5550
+ ...se,
5543
5551
  type: "email",
5544
- label: ie,
5545
- value: g[l] || "",
5546
- onChange: (le) => D(l, le.target.value),
5547
- error: ae
5552
+ label: ae,
5553
+ value: f[c] || "",
5554
+ onChange: (le) => F(c, le.target.value),
5555
+ error: ie
5548
5556
  },
5549
- se
5557
+ fe
5550
5558
  );
5551
5559
  case "tel":
5552
5560
  return /* @__PURE__ */ r(
5553
5561
  me,
5554
5562
  {
5555
- ...ke,
5563
+ ...se,
5556
5564
  type: "tel",
5557
- label: ie,
5558
- value: g[l] || "",
5559
- onChange: (le) => D(l, le.target.value),
5560
- error: ae
5565
+ label: ae,
5566
+ value: f[c] || "",
5567
+ onChange: (le) => F(c, le.target.value),
5568
+ error: ie
5561
5569
  },
5562
- se
5570
+ fe
5563
5571
  );
5564
5572
  default:
5565
5573
  return /* @__PURE__ */ r(
5566
5574
  me,
5567
5575
  {
5568
- ...ke,
5576
+ ...se,
5569
5577
  type: "text",
5570
- label: ie,
5571
- value: g[l] || "",
5572
- onChange: (le) => D(l, le.target.value),
5573
- error: ae
5578
+ label: ae,
5579
+ value: f[c] || "",
5580
+ onChange: (le) => F(c, le.target.value),
5581
+ error: ie
5574
5582
  },
5575
- se
5583
+ fe
5576
5584
  );
5577
5585
  }
5578
- }, xt = (l, T) => {
5579
- if (l.customType === "paragraph") {
5580
- const v = l.displayText || l.label || "";
5586
+ }, xt = (c, L) => {
5587
+ if (c.customType === "paragraph") {
5588
+ const y = c.displayText || c.label || "";
5581
5589
  return /* @__PURE__ */ r(
5582
5590
  "p",
5583
5591
  {
@@ -5588,19 +5596,19 @@ const _e = {
5588
5596
  margin: 0,
5589
5597
  color: "var(--metakyc-text-secondary, #6b7280)"
5590
5598
  },
5591
- dangerouslySetInnerHTML: { __html: v }
5599
+ dangerouslySetInnerHTML: { __html: y }
5592
5600
  },
5593
- `custom-${T}`
5601
+ `custom-${L}`
5594
5602
  );
5595
5603
  }
5596
- if (l.customType === "br")
5597
- return /* @__PURE__ */ r("div", { style: { height: "12px" } }, `custom-${T}`);
5598
- if (l.customType === "link") {
5599
- 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 || "";
5600
5608
  return /* @__PURE__ */ r("div", { className: "metakyc-link-field", children: /* @__PURE__ */ s(
5601
5609
  "a",
5602
5610
  {
5603
- href: l.linkUrl || "#",
5611
+ href: c.linkUrl || "#",
5604
5612
  target: "_blank",
5605
5613
  rel: "noopener noreferrer",
5606
5614
  style: {
@@ -5613,15 +5621,15 @@ const _e = {
5613
5621
  cursor: "pointer"
5614
5622
  },
5615
5623
  children: [
5616
- v,
5624
+ y,
5617
5625
  /* @__PURE__ */ r("span", { style: { fontSize: "10px", opacity: 0.7 }, children: "↗" })
5618
5626
  ]
5619
5627
  }
5620
- ) }, `custom-${T}`);
5628
+ ) }, `custom-${L}`);
5621
5629
  }
5622
- if (!l.paramName) return null;
5623
- const L = M[l.paramName], f = l.displayText || l.label || l.paramName;
5624
- 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")
5625
5633
  return /* @__PURE__ */ s("div", { className: "flex flex-col gap-1", children: [
5626
5634
  /* @__PURE__ */ s(
5627
5635
  "label",
@@ -5633,8 +5641,8 @@ const _e = {
5633
5641
  "input",
5634
5642
  {
5635
5643
  type: "checkbox",
5636
- checked: P[l.paramName] === "true",
5637
- 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"),
5638
5646
  className: "metakyc-option-input",
5639
5647
  style: _e
5640
5648
  }
@@ -5645,17 +5653,17 @@ const _e = {
5645
5653
  className: "metakyc-option-text",
5646
5654
  style: { fontSize: "14px", color: "var(--metakyc-text-primary, #111827)", lineHeight: "1.4" },
5647
5655
  children: [
5648
- f,
5649
- 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: "*" })
5650
5658
  ]
5651
5659
  }
5652
5660
  )
5653
5661
  ]
5654
5662
  }
5655
5663
  ),
5656
- L && /* @__PURE__ */ r("p", { className: "text-red-500 text-xs mt-0.5", children: L })
5657
- ] }, `custom-${T}`);
5658
- 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")
5659
5667
  return /* @__PURE__ */ s("div", { className: "flex flex-col gap-1", children: [
5660
5668
  /* @__PURE__ */ s(
5661
5669
  "label",
@@ -5667,8 +5675,8 @@ const _e = {
5667
5675
  "input",
5668
5676
  {
5669
5677
  type: "checkbox",
5670
- checked: P[l.paramName] === "true",
5671
- 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"),
5672
5680
  className: "metakyc-option-input",
5673
5681
  style: { ..._e, alignSelf: "flex-start", marginTop: "2px" }
5674
5682
  }
@@ -5679,31 +5687,31 @@ const _e = {
5679
5687
  className: "metakyc-option-text",
5680
5688
  style: { fontSize: "14px", color: "var(--metakyc-text-primary, #111827)", lineHeight: "1.4" },
5681
5689
  children: [
5682
- f,
5690
+ g,
5683
5691
  " ",
5684
- l.linkUrl && /* @__PURE__ */ r(
5692
+ c.linkUrl && /* @__PURE__ */ r(
5685
5693
  "a",
5686
5694
  {
5687
- href: l.linkUrl,
5695
+ href: c.linkUrl,
5688
5696
  target: "_blank",
5689
5697
  rel: "noopener noreferrer",
5690
5698
  className: "underline",
5691
5699
  style: { color: "var(--metakyc-primary, #2563eb)" },
5692
- onClick: (v) => v.stopPropagation(),
5693
- children: l.linkText || l.linkUrl
5700
+ onClick: (y) => y.stopPropagation(),
5701
+ children: c.linkText || c.linkUrl
5694
5702
  }
5695
5703
  ),
5696
- 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: "*" })
5697
5705
  ]
5698
5706
  }
5699
5707
  )
5700
5708
  ]
5701
5709
  }
5702
5710
  ),
5703
- L && /* @__PURE__ */ r("p", { className: "text-red-500 text-xs mt-0.5", children: L })
5704
- ] }, `custom-${T}`);
5705
- if (l.customType === "group_checkbox") {
5706
- 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);
5707
5715
  return /* @__PURE__ */ s("div", { className: "flex flex-col gap-1.5", children: [
5708
5716
  /* @__PURE__ */ s(
5709
5717
  "div",
@@ -5711,13 +5719,13 @@ const _e = {
5711
5719
  className: "text-sm font-medium",
5712
5720
  style: { color: "var(--metakyc-text-primary, #111827)" },
5713
5721
  children: [
5714
- f,
5715
- 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: "*" })
5716
5724
  ]
5717
5725
  }
5718
5726
  ),
5719
- /* @__PURE__ */ r("div", { className: "metakyc-options-group", style: { display: "flex", flexDirection: "column", gap: "8px" }, children: (l.options || []).map((q) => {
5720
- 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);
5721
5729
  return /* @__PURE__ */ s(
5722
5730
  "label",
5723
5731
  {
@@ -5728,13 +5736,13 @@ const _e = {
5728
5736
  "input",
5729
5737
  {
5730
5738
  type: "checkbox",
5731
- checked: ae,
5732
- onChange: (ie) => {
5733
- if (l.singleSelect)
5734
- 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 : "");
5735
5743
  else {
5736
- const se = ie.target.checked ? [...v, q.value] : v.filter((ke) => ke !== q.value);
5737
- S(l.paramName, se.join(","));
5744
+ const fe = ae.target.checked ? [...y, _.value] : y.filter((se) => se !== _.value);
5745
+ S(c.paramName, fe.join(","));
5738
5746
  }
5739
5747
  },
5740
5748
  className: "metakyc-option-input",
@@ -5746,30 +5754,30 @@ const _e = {
5746
5754
  {
5747
5755
  className: "metakyc-option-text",
5748
5756
  style: { fontSize: "14px", color: "var(--metakyc-text-primary, #111827)", lineHeight: "1.4" },
5749
- children: q.label
5757
+ children: _.label
5750
5758
  }
5751
5759
  )
5752
5760
  ]
5753
5761
  },
5754
- q.value
5762
+ _.value
5755
5763
  );
5756
5764
  }) }),
5757
- L && /* @__PURE__ */ r("p", { className: "text-red-500 text-xs", children: L })
5758
- ] }, `custom-${T}`);
5765
+ $ && /* @__PURE__ */ r("p", { className: "text-red-500 text-xs", children: $ })
5766
+ ] }, `custom-${L}`);
5759
5767
  }
5760
- 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: [
5761
5769
  /* @__PURE__ */ s(
5762
5770
  "div",
5763
5771
  {
5764
5772
  className: "text-sm font-medium",
5765
5773
  style: { color: "var(--metakyc-text-primary, #111827)" },
5766
5774
  children: [
5767
- f,
5768
- 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: "*" })
5769
5777
  ]
5770
5778
  }
5771
5779
  ),
5772
- /* @__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(
5773
5781
  "label",
5774
5782
  {
5775
5783
  className: "metakyc-option-label",
@@ -5779,9 +5787,9 @@ const _e = {
5779
5787
  "input",
5780
5788
  {
5781
5789
  type: "radio",
5782
- checked: P[l.paramName] === v.value,
5783
- onChange: () => S(l.paramName, v.value),
5784
- 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}`,
5785
5793
  className: "metakyc-option-input",
5786
5794
  style: _e
5787
5795
  }
@@ -5791,30 +5799,30 @@ const _e = {
5791
5799
  {
5792
5800
  className: "metakyc-option-text",
5793
5801
  style: { fontSize: "14px", color: "var(--metakyc-text-primary, #111827)", lineHeight: "1.4" },
5794
- children: v.label
5802
+ children: y.label
5795
5803
  }
5796
5804
  )
5797
5805
  ]
5798
5806
  },
5799
- v.value
5807
+ y.value
5800
5808
  )) }),
5801
- L && /* @__PURE__ */ r("p", { className: "text-red-500 text-xs", children: L })
5802
- ] }, `custom-${T}`) : /* @__PURE__ */ r(
5809
+ $ && /* @__PURE__ */ r("p", { className: "text-red-500 text-xs", children: $ })
5810
+ ] }, `custom-${L}`) : /* @__PURE__ */ r(
5803
5811
  me,
5804
5812
  {
5805
5813
  type: "text",
5806
- label: `${f}${l.required ? " *" : ""}`,
5807
- value: P[l.paramName] || "",
5808
- onChange: (v) => S(l.paramName, v.target.value),
5809
- required: l.required,
5810
- 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: $
5811
5819
  },
5812
- `custom-${T}`
5820
+ `custom-${L}`
5813
5821
  );
5814
- }, bt = (l, T) => {
5815
- const L = H(l);
5822
+ }, bt = (c, L) => {
5823
+ const $ = U(c);
5816
5824
  return /* @__PURE__ */ s("div", { className: "space-y-4", children: [
5817
- l.conditionalOn && /* @__PURE__ */ r(ct, { helpText: l.conditionalHelpText, children: /* @__PURE__ */ s(
5825
+ c.conditionalOn && /* @__PURE__ */ r(ct, { helpText: c.conditionalHelpText, children: /* @__PURE__ */ s(
5818
5826
  "label",
5819
5827
  {
5820
5828
  className: "metakyc-option-label",
@@ -5824,8 +5832,8 @@ const _e = {
5824
5832
  "input",
5825
5833
  {
5826
5834
  type: "checkbox",
5827
- checked: L,
5828
- onChange: (f) => S(l.conditionalOn, f.target.checked ? "true" : "false"),
5835
+ checked: $,
5836
+ onChange: (g) => S(c.conditionalOn, g.target.checked ? "true" : "false"),
5829
5837
  className: "metakyc-option-input",
5830
5838
  style: _e
5831
5839
  }
@@ -5835,120 +5843,120 @@ const _e = {
5835
5843
  {
5836
5844
  className: "metakyc-option-text",
5837
5845
  style: { fontSize: "14px", color: "var(--metakyc-text-primary, #111827)", lineHeight: "1.4", fontWeight: 500 },
5838
- children: l.conditionalOn
5846
+ children: c.conditionalOn
5839
5847
  }
5840
5848
  )
5841
5849
  ]
5842
5850
  }
5843
5851
  ) }),
5844
- L && /* @__PURE__ */ r("div", { className: "grid grid-cols-4 gap-4", children: l.fields.map((f, v) => {
5845
- 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}`;
5846
- 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);
5847
5855
  }) })
5848
5856
  ] });
5849
5857
  };
5850
- if (A)
5858
+ if (!l || A)
5851
5859
  return /* @__PURE__ */ r("div", { className: "metakyc-sdk", children: /* @__PURE__ */ r(K, { children: /* @__PURE__ */ s(W, { children: [
5852
- /* @__PURE__ */ r(be, { className: "my-8" }),
5853
- /* @__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" })
5854
5862
  ] }) }) });
5855
5863
  if (m) {
5856
- 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);
5857
5865
  return /* @__PURE__ */ r("div", { className: "metakyc-sdk", children: /* @__PURE__ */ s(K, { children: [
5858
- /* @__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" }) }),
5859
5867
  /* @__PURE__ */ s(W, { children: [
5860
- (l.title || l.subtitle || l.description) && /* @__PURE__ */ s("div", { className: "mb-4", children: [
5861
- l.title && /* @__PURE__ */ r(
5868
+ (c.title || c.subtitle || c.description) && /* @__PURE__ */ s("div", { className: "mb-4", children: [
5869
+ c.title && /* @__PURE__ */ r(
5862
5870
  "h3",
5863
5871
  {
5864
5872
  className: "font-semibold text-base",
5865
5873
  style: { color: "var(--metakyc-text-primary, #111827)" },
5866
- children: l.title
5874
+ children: c.title
5867
5875
  }
5868
5876
  ),
5869
- l.subtitle && /* @__PURE__ */ r(
5877
+ c.subtitle && /* @__PURE__ */ r(
5870
5878
  "p",
5871
5879
  {
5872
5880
  className: "text-sm mt-0.5",
5873
5881
  style: { color: "var(--metakyc-text-secondary, #6b7280)" },
5874
- children: l.subtitle
5882
+ children: c.subtitle
5875
5883
  }
5876
5884
  ),
5877
- l.description && l.description !== l.subtitle && /* @__PURE__ */ r(
5885
+ c.description && c.description !== c.subtitle && /* @__PURE__ */ r(
5878
5886
  "p",
5879
5887
  {
5880
5888
  className: "text-xs mt-1",
5881
5889
  style: { color: "var(--metakyc-text-secondary, #6b7280)" },
5882
- children: l.description
5890
+ children: c.description
5883
5891
  }
5884
5892
  )
5885
5893
  ] }),
5886
- (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: [
5887
5895
  w && /* @__PURE__ */ s("p", { className: "text-red-600 text-sm", children: [
5888
5896
  /* @__PURE__ */ r("strong", { children: "Error:" }),
5889
5897
  " ",
5890
5898
  w
5891
5899
  ] }),
5892
- 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))
5893
5901
  ] }),
5894
- f > 1 && /* @__PURE__ */ s("div", { className: "flex items-center gap-2 mb-4", children: [
5895
- 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(
5896
5904
  "div",
5897
5905
  {
5898
- className: `h-1.5 rounded-full transition-all ${ie === _ ? "flex-1" : "w-8"}`,
5899
- 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" }
5900
5908
  },
5901
- ie
5909
+ ae
5902
5910
  )),
5903
5911
  /* @__PURE__ */ s("span", { className: "text-xs text-gray-400 flex-shrink-0", children: [
5904
- _ + 1,
5912
+ H + 1,
5905
5913
  " / ",
5906
- f
5914
+ g
5907
5915
  ] })
5908
5916
  ] }),
5909
- bt(l)
5917
+ bt(c)
5910
5918
  ] }),
5911
5919
  /* @__PURE__ */ s(pe, { className: "flex justify-between", children: [
5912
5920
  /* @__PURE__ */ s("div", { children: [
5913
- !T && /* @__PURE__ */ r(
5914
- V,
5921
+ !L && /* @__PURE__ */ r(
5922
+ Z,
5915
5923
  {
5916
5924
  type: "button",
5917
5925
  variant: "outline",
5918
5926
  onClick: () => {
5919
- O(Y), Z({});
5927
+ M(Y), J({});
5920
5928
  },
5921
5929
  disabled: te || u,
5922
5930
  children: "Previous"
5923
5931
  }
5924
5932
  ),
5925
- 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" })
5926
5934
  ] }),
5927
5935
  /* @__PURE__ */ r(
5928
- V,
5936
+ Z,
5929
5937
  {
5930
5938
  type: "button",
5931
5939
  isLoading: te || u,
5932
- onClick: L ? Ce : ve,
5933
- 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"
5934
5942
  }
5935
5943
  )
5936
5944
  ] })
5937
5945
  ] }) });
5938
5946
  }
5939
5947
  return /* @__PURE__ */ r("div", { className: "metakyc-sdk", children: /* @__PURE__ */ r("form", { onSubmit: ft, children: /* @__PURE__ */ s(K, { children: [
5940
- /* @__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" }) }),
5941
5949
  /* @__PURE__ */ s(W, { children: [
5942
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: [
5943
5951
  /* @__PURE__ */ r("strong", { children: "Error:" }),
5944
5952
  " ",
5945
5953
  w
5946
5954
  ] }) }),
5947
- /* @__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)) })
5948
5956
  ] }),
5949
5957
  /* @__PURE__ */ s(pe, { className: "flex justify-between", children: [
5950
- a && /* @__PURE__ */ r(V, { type: "button", variant: "outline", onClick: a, disabled: te || u, children: "Cancel" }),
5951
- /* @__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" })
5952
5960
  ] })
5953
5961
  ] }) }) });
5954
5962
  }, gn = ({
@@ -5960,16 +5968,16 @@ const _e = {
5960
5968
  }) => {
5961
5969
  const {
5962
5970
  progress: o,
5963
- currentStep: c,
5971
+ currentStep: l,
5964
5972
  steps: d,
5965
5973
  workflowKey: u,
5966
5974
  nextWorkflowKey: p,
5967
- hasWorkflowChanged: x,
5975
+ hasWorkflowChanged: b,
5968
5976
  isLoading: N,
5969
5977
  error: m,
5970
- moveBack: y,
5978
+ moveBack: x,
5971
5979
  refreshProgress: h
5972
- } = fr(e), [C, F] = ge.useState(!1);
5980
+ } = fr(e), [C, D] = ge.useState(!1);
5973
5981
  if (ge.useEffect(() => {
5974
5982
  m && n && n(m);
5975
5983
  }, [m, n]), ge.useEffect(() => {
@@ -5977,10 +5985,10 @@ const _e = {
5977
5985
  }, [o == null ? void 0 : o.workflowResult, t]), ge.useEffect(() => {
5978
5986
  a === "dark" ? document.documentElement.classList.add("dark") : document.documentElement.classList.remove("dark");
5979
5987
  }, [a]), ge.useEffect(() => {
5980
- x && F(!1);
5981
- }, [x]), N || !o)
5988
+ b && D(!1);
5989
+ }, [b]), N || !o)
5982
5990
  return /* @__PURE__ */ r("div", { className: i, children: /* @__PURE__ */ r(K, { children: /* @__PURE__ */ s(W, { children: [
5983
- /* @__PURE__ */ r(be, { className: "my-8" }),
5991
+ /* @__PURE__ */ r(ve, { className: "my-8" }),
5984
5992
  /* @__PURE__ */ r("p", { className: "text-center text-gray-600 dark:text-gray-400 mt-4", children: "Loading workflow..." })
5985
5993
  ] }) }) });
5986
5994
  if (m)
@@ -5988,7 +5996,7 @@ const _e = {
5988
5996
  /* @__PURE__ */ r("p", { className: "text-danger-500 text-lg mb-4", children: "An error occurred" }),
5989
5997
  /* @__PURE__ */ r("p", { className: "text-gray-600 dark:text-gray-400", children: m.message })
5990
5998
  ] }) }) }) });
5991
- if (x && !C)
5999
+ if (b && !C)
5992
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: [
5993
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" }) }) }) }),
5994
6002
  /* @__PURE__ */ r("h3", { className: "text-xl font-semibold text-gray-900 dark:text-white mb-2", children: "Workflow Transition" }),
@@ -6010,13 +6018,13 @@ const _e = {
6010
6018
  /* @__PURE__ */ r(
6011
6019
  "button",
6012
6020
  {
6013
- onClick: () => F(!0),
6021
+ onClick: () => D(!0),
6014
6022
  className: "px-6 py-3 bg-blue-600 hover:bg-blue-700 text-white font-medium rounded-lg transition-colors",
6015
6023
  children: "Continue with New Workflow"
6016
6024
  }
6017
6025
  )
6018
6026
  ] }) }) }) });
6019
- if (o.status === xe.Finished || o.status === xe.OnHold)
6027
+ if (o.status === be.Finished || o.status === be.OnHold)
6020
6028
  return /* @__PURE__ */ r("div", { className: `metakyc-sdk ${i || ""}`, children: /* @__PURE__ */ r(
6021
6029
  lt,
6022
6030
  {
@@ -6030,48 +6038,48 @@ const _e = {
6030
6038
  }
6031
6039
  }
6032
6040
  ) });
6033
- if (!c)
6041
+ if (!l)
6034
6042
  return /* @__PURE__ */ r("div", { className: `metakyc-sdk ${i || ""}`, children: /* @__PURE__ */ r(K, { children: /* @__PURE__ */ s(W, { children: [
6035
- /* @__PURE__ */ r(be, { className: "my-8" }),
6036
- /* @__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..." })
6037
6045
  ] }) }) });
6038
6046
  const k = (I) => {
6039
6047
  switch (I) {
6040
- case G.Overview:
6048
+ case V.Overview:
6041
6049
  return "Overview";
6042
- case G.Questionaries:
6050
+ case V.Questionaries:
6043
6051
  return "Questionnaire";
6044
- case G.UploadDocument:
6052
+ case V.UploadDocument:
6045
6053
  return "Documents";
6046
- case G.IdentitySdk:
6054
+ case V.IdentitySdk:
6047
6055
  return "Identity";
6048
- case G.RiskScoring:
6056
+ case V.RiskScoring:
6049
6057
  return "Risk Assessment";
6050
- case G.InvestorCategorization:
6058
+ case V.InvestorCategorization:
6051
6059
  return "Investor Categorization";
6052
- case G.AppropriatenessTest:
6060
+ case V.AppropriatenessTest:
6053
6061
  return "Appropriateness Test";
6054
- case G.AdditionalData:
6062
+ case V.AdditionalData:
6055
6063
  return "Additional Data";
6056
- case G.ManualReview:
6064
+ case V.ManualReview:
6057
6065
  return "Review";
6058
6066
  default:
6059
6067
  return "";
6060
6068
  }
6061
- }, $ = () => {
6062
- 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;
6063
6071
  return /* @__PURE__ */ s("div", { className: "mb-6", children: [
6064
6072
  /* @__PURE__ */ s("div", { className: "flex items-start justify-between mb-4", children: [
6065
6073
  /* @__PURE__ */ r(Ge, {}),
6066
6074
  /* @__PURE__ */ s(Ae, { variant: o.status === 1 ? "info" : "success", children: [
6067
6075
  "Step ",
6068
- J,
6076
+ G,
6069
6077
  " of ",
6070
6078
  E
6071
6079
  ] })
6072
6080
  ] }),
6073
- /* @__PURE__ */ r("div", { className: "flex items-center", children: I.map((g, R) => {
6074
- 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;
6075
6083
  return /* @__PURE__ */ s(ge.Fragment, { children: [
6076
6084
  /* @__PURE__ */ s("div", { className: "flex items-center", children: [
6077
6085
  /* @__PURE__ */ r(
@@ -6079,7 +6087,7 @@ const _e = {
6079
6087
  {
6080
6088
  className: `
6081
6089
  w-8 h-8 rounded-full flex items-center justify-center text-sm font-medium
6082
- ${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"}
6083
6091
  `,
6084
6092
  children: R + 1
6085
6093
  }
@@ -6087,8 +6095,8 @@ const _e = {
6087
6095
  /* @__PURE__ */ r(
6088
6096
  "span",
6089
6097
  {
6090
- className: `ml-2 text-sm ${z ? "font-semibold text-gray-900 dark:text-white" : "text-gray-600 dark:text-gray-400"}`,
6091
- 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}`
6092
6100
  }
6093
6101
  )
6094
6102
  ] }),
@@ -6098,7 +6106,7 @@ const _e = {
6098
6106
  className: `flex-1 h-0.5 mx-4 ${P ? "bg-primary-500" : "bg-gray-200 dark:bg-gray-700"}`
6099
6107
  }
6100
6108
  )
6101
- ] }, g.order);
6109
+ ] }, f.order);
6102
6110
  }) })
6103
6111
  ] });
6104
6112
  }, A = () => {
@@ -6107,25 +6115,25 @@ const _e = {
6107
6115
  onComplete: async () => {
6108
6116
  await h();
6109
6117
  },
6110
- onBack: c.order > 0 ? y : void 0
6118
+ onBack: l.order > 0 ? x : void 0
6111
6119
  };
6112
- switch (c.action) {
6113
- case G.Questionaries:
6120
+ switch (l.action) {
6121
+ case V.Questionaries:
6114
6122
  return /* @__PURE__ */ r(Or, { ...I });
6115
- case G.UploadDocument:
6123
+ case V.UploadDocument:
6116
6124
  return /* @__PURE__ */ r($r, { ...I });
6117
- case G.Overview:
6125
+ case V.Overview:
6118
6126
  return /* @__PURE__ */ r(Br, { ...I });
6119
- case G.IdentitySdk:
6127
+ case V.IdentitySdk:
6120
6128
  return /* @__PURE__ */ r(Yr, { ...I });
6121
- case G.RiskScoring:
6129
+ case V.RiskScoring:
6122
6130
  return /* @__PURE__ */ r(jr, { ...I });
6123
- case G.AdditionalData:
6124
- case G.InvestorCategorization:
6131
+ case V.AdditionalData:
6132
+ case V.InvestorCategorization:
6125
6133
  return /* @__PURE__ */ r(Kr, { ...I });
6126
- case G.AppropriatenessTest:
6134
+ case V.AppropriatenessTest:
6127
6135
  return /* @__PURE__ */ r(Wr, { ...I });
6128
- case G.ManualReview:
6136
+ case V.ManualReview:
6129
6137
  return /* @__PURE__ */ r(
6130
6138
  lt,
6131
6139
  {
@@ -6137,20 +6145,20 @@ const _e = {
6137
6145
  );
6138
6146
  default:
6139
6147
  return /* @__PURE__ */ r(K, { children: /* @__PURE__ */ s(W, { className: "py-12 text-center", children: [
6140
- /* @__PURE__ */ r("div", { className: "mb-4", children: /* @__PURE__ */ r(be, {}) }),
6148
+ /* @__PURE__ */ r("div", { className: "mb-4", children: /* @__PURE__ */ r(ve, {}) }),
6141
6149
  /* @__PURE__ */ s("p", { className: "text-gray-600 dark:text-gray-400 mb-2", children: [
6142
6150
  "Processing step: ",
6143
- c.title || c.name
6151
+ l.title || l.name
6144
6152
  ] }),
6145
6153
  /* @__PURE__ */ s("p", { className: "text-sm text-gray-500 dark:text-gray-400", children: [
6146
6154
  "Action type: ",
6147
- G[c.action]
6155
+ V[l.action]
6148
6156
  ] })
6149
6157
  ] }) });
6150
6158
  }
6151
6159
  };
6152
6160
  return /* @__PURE__ */ s("div", { className: `metakyc-sdk ${i || ""}`, children: [
6153
- $(),
6161
+ z(),
6154
6162
  A()
6155
6163
  ] });
6156
6164
  };
@@ -6205,7 +6213,7 @@ const vn = Se.any();
6205
6213
  export {
6206
6214
  at as ALLOWED_LANGUAGES,
6207
6215
  At as ApplicantProgressOnHoldReason,
6208
- xe as ApplicantProgressStatus,
6216
+ be as ApplicantProgressStatus,
6209
6217
  Ht as ApplicantService,
6210
6218
  It as ApplicantStatus,
6211
6219
  Lt as AppropriatenessQuestionType,
@@ -6213,7 +6221,7 @@ export {
6213
6221
  Wr as AppropriatenessTestStep,
6214
6222
  Ae as Badge,
6215
6223
  Qt as BaseInformationService,
6216
- V as Button,
6224
+ Z as Button,
6217
6225
  K as Card,
6218
6226
  W as CardContent,
6219
6227
  pe as CardFooter,
@@ -6234,7 +6242,7 @@ export {
6234
6242
  _t as HttpClient,
6235
6243
  Me as IdentityProviderManager,
6236
6244
  Yt as IdentityService,
6237
- fe as IdentityVerificationProvider,
6245
+ xe as IdentityVerificationProvider,
6238
6246
  Yr as IdentityVerificationStep,
6239
6247
  me as Input,
6240
6248
  Gt as InvestorCategorizationService,
@@ -6264,7 +6272,7 @@ export {
6264
6272
  cr as SardinAIProvider,
6265
6273
  We as SearchableSelect,
6266
6274
  He as Select,
6267
- be as Spinner,
6275
+ ve as Spinner,
6268
6276
  ir as StepRouter,
6269
6277
  or as SumsubProvider,
6270
6278
  dr as ThemeManager,
@@ -6277,7 +6285,7 @@ export {
6277
6285
  sr as WorkflowOrchestrator,
6278
6286
  qe as WorkflowResultType,
6279
6287
  ar as WorkflowState,
6280
- G as WorkflowStepAction,
6288
+ V as WorkflowStepAction,
6281
6289
  vn as appropriatenessTestSchema,
6282
6290
  mn as clearAllStorage,
6283
6291
  hr as clearApplicantId,