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