@incodetech/web 0.0.0-dev-20260506-d1f463c → 0.0.0-dev-20260506-02369cc
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/flow/flow.es.js
CHANGED
|
@@ -5,7 +5,7 @@ import { o as l } from "../hooks-BVnGysT7.js";
|
|
|
5
5
|
import { t as u } from "../incodeComponent-9ZUPvQgC.js";
|
|
6
6
|
import { t as d } from "../transitionSpinner-Dmj-tzXU.js";
|
|
7
7
|
import { t as f } from "../incodeModule-BH9gV7jI.js";
|
|
8
|
-
import { a as p, c as m, d as h,
|
|
8
|
+
import { a as p, c as m, d as h, f as g, l as _, m as v, n as y, o as b, r as x, s as S, t as C, u as w } from "../useModuleLoader-CRXhrZ1v.js";
|
|
9
9
|
import { getDeviceClass as T } from "@incodetech/core/device";
|
|
10
10
|
import { getRequiredWasmPipelines as E } from "@incodetech/core/flow";
|
|
11
11
|
import { QrValidationError as D, bootstrapSession as O, refreshQrUrlUuid as k } from "@incodetech/core/session";
|
|
@@ -92,8 +92,8 @@ function z(e) {
|
|
|
92
92
|
if (L.has(t)) return R(t);
|
|
93
93
|
let n, r, i = new Promise((e, t) => {
|
|
94
94
|
n = e, r = t;
|
|
95
|
-
}), a =
|
|
96
|
-
a.getState().presentation.shouldPrefetchHome &&
|
|
95
|
+
}), a = S(e);
|
|
96
|
+
a.getState().presentation.shouldPrefetchHome && h();
|
|
97
97
|
let o = {
|
|
98
98
|
status: "loading",
|
|
99
99
|
flowManager: a,
|
|
@@ -104,18 +104,18 @@ function z(e) {
|
|
|
104
104
|
};
|
|
105
105
|
return L.set(t, o), (async () => {
|
|
106
106
|
try {
|
|
107
|
-
await
|
|
107
|
+
await _({
|
|
108
108
|
token: e.token,
|
|
109
109
|
lang: e.lang,
|
|
110
110
|
flowManager: a
|
|
111
111
|
});
|
|
112
|
-
let t = e.disableDashboardTheme ? Promise.resolve({}) :
|
|
112
|
+
let t = e.disableDashboardTheme ? Promise.resolve({}) : m().then((e) => {
|
|
113
113
|
o.theme = e.theme, o.uiConfig = e.uiConfig;
|
|
114
114
|
});
|
|
115
115
|
o.unsubscribe = a.subscribe((t) => {
|
|
116
116
|
if (t.status === "ready") {
|
|
117
117
|
let n = t;
|
|
118
|
-
|
|
118
|
+
v(n, e.wasmConfig), w(n), o.unsubscribe?.(), o.unsubscribe = void 0, o.status = "ready", o.readyResolve();
|
|
119
119
|
} else t.status === "error" && (o.unsubscribe?.(), o.unsubscribe = void 0, o.status = "error", o.error = t.error, o.readyReject(Error(t.error)));
|
|
120
120
|
}), await t;
|
|
121
121
|
} catch (e) {
|
|
@@ -133,10 +133,10 @@ function V(e) {
|
|
|
133
133
|
//#endregion
|
|
134
134
|
//#region src/modules/flow/useFlowInitialization.ts
|
|
135
135
|
function H(e) {
|
|
136
|
-
e.getState().presentation.shouldPrefetchHome &&
|
|
136
|
+
e.getState().presentation.shouldPrefetchHome && h();
|
|
137
137
|
}
|
|
138
138
|
function U() {
|
|
139
|
-
T() === "desktop" &&
|
|
139
|
+
T() === "desktop" && g();
|
|
140
140
|
}
|
|
141
141
|
function W(e) {
|
|
142
142
|
let { lang: n, disableDashboardTheme: r, enableHome: a, onError: s, useCPF: l } = e, u = F(e) ? e.token : void 0, d = i(null), [f, p] = o(() => {
|
|
@@ -148,7 +148,7 @@ function W(e) {
|
|
|
148
148
|
flowManager: e.flowManager
|
|
149
149
|
};
|
|
150
150
|
}
|
|
151
|
-
let n =
|
|
151
|
+
let n = S({
|
|
152
152
|
authHint: e.authHint,
|
|
153
153
|
lang: e.lang,
|
|
154
154
|
enableHome: e.enableHome,
|
|
@@ -197,12 +197,12 @@ function W(e) {
|
|
|
197
197
|
}, a);
|
|
198
198
|
else if (I(e)) t = (await P(e, a)).token;
|
|
199
199
|
else throw Error("Flow requires token, or configurationId with apiKey or clientId");
|
|
200
|
-
await
|
|
200
|
+
await _({
|
|
201
201
|
token: t,
|
|
202
202
|
lang: n,
|
|
203
203
|
flowManager: f.flowManager
|
|
204
204
|
});
|
|
205
|
-
let i = r ? Promise.resolve() :
|
|
205
|
+
let i = r ? Promise.resolve() : m().then((e) => {
|
|
206
206
|
e.uiConfig && c(e.uiConfig);
|
|
207
207
|
}), o = f.flowManager.waitForReady();
|
|
208
208
|
await Promise.all([o, i]), p({
|
|
@@ -237,28 +237,28 @@ var G = n(() => import("../homeScreen-BsnPnOwW.js").then((e) => ({ default: e.Ho
|
|
|
237
237
|
let { i18n: c } = e(), u = W(r(() => ({
|
|
238
238
|
...n,
|
|
239
239
|
onError: o
|
|
240
|
-
}), [n, o])), [f, m] = l(() => u.flowManager, { autoLoad: !1 }),
|
|
241
|
-
moduleKey:
|
|
242
|
-
modules:
|
|
240
|
+
}), [n, o])), [f, m] = l(() => u.flowManager, { autoLoad: !1 }), g = f.presentation.lazyModuleKey, _ = f.status === "ready" ? f.currentStep : void 0, S = C({
|
|
241
|
+
moduleKey: g,
|
|
242
|
+
modules: b,
|
|
243
243
|
onModuleLoading: n.onModuleLoading,
|
|
244
244
|
onModuleLoaded: n.onModuleLoaded,
|
|
245
245
|
onError: o
|
|
246
246
|
});
|
|
247
|
-
|
|
247
|
+
y({
|
|
248
248
|
moduleKey: f.status === "ready" && f.homeScreen.visible ? _ : void 0,
|
|
249
|
-
modules:
|
|
249
|
+
modules: b
|
|
250
250
|
});
|
|
251
|
-
let
|
|
252
|
-
x(f?.status === "ready" ? f.steps : [], f?.status === "ready" ? f.currentStepIndex : -1,
|
|
251
|
+
let w = S.status === "loaded", T = n.enableHome === !0 && f.status === "ready" && f.flow.disableLaunchScreen !== !0 && f.currentStepIndex === 0 && f.homeScreen.visible === !1 && S.status === "loading", D = A(f.presentation.isAwaitingReady === !0, 150), O = A(f.status === "ready" && (S.status === "idle" || S.status === "loading" || S.status === "error"), 150);
|
|
252
|
+
x(f?.status === "ready" ? f.steps : [], f?.status === "ready" ? f.currentStepIndex : -1, b, w), t(() => {
|
|
253
253
|
if (n.onFlowEvent) return m.subscribeFlowEvent(n.onFlowEvent);
|
|
254
254
|
}, [m, n.onFlowEvent]), t(() => {
|
|
255
|
-
f.presentation.shouldPrefetchHome &&
|
|
255
|
+
f.presentation.shouldPrefetchHome && h();
|
|
256
256
|
}, [f.presentation.shouldPrefetchHome]), t(() => {
|
|
257
257
|
n.lang && c.language !== n.lang && c.changeLanguage(n.lang);
|
|
258
258
|
}, [n.lang, c]), t(() => {
|
|
259
259
|
if (f?.status !== "ready" || f.currentStep === "REDIRECT_TO_MOBILE") return;
|
|
260
260
|
let e = f, t = E(e.flow);
|
|
261
|
-
t.length > 0 && (n.onWasmWarmup?.(t),
|
|
261
|
+
t.length > 0 && (n.onWasmWarmup?.(t), v(e, n.wasmConfig));
|
|
262
262
|
}, [f, n]), t(() => {
|
|
263
263
|
f?.status === "finished" && i(f.finishStatus);
|
|
264
264
|
}, [
|
|
@@ -318,21 +318,21 @@ var G = n(() => import("../homeScreen-BsnPnOwW.js").then((e) => ({ default: e.Ho
|
|
|
318
318
|
})
|
|
319
319
|
});
|
|
320
320
|
if (e === "IP_ADDRESS") return /* @__PURE__ */ s("div", { class: "IncodeFlow" });
|
|
321
|
-
if (
|
|
321
|
+
if (S.status === "unsupported") return /* @__PURE__ */ s("div", {
|
|
322
322
|
class: "IncodeFlow",
|
|
323
|
-
children: /* @__PURE__ */ s(
|
|
323
|
+
children: /* @__PURE__ */ s(p, {
|
|
324
324
|
moduleKey: e,
|
|
325
325
|
onNext: () => m.completeModule()
|
|
326
326
|
})
|
|
327
327
|
});
|
|
328
|
-
if (
|
|
328
|
+
if (S.status === "idle" || S.status === "loading" || S.status === "error") return O ? /* @__PURE__ */ s("div", {
|
|
329
329
|
class: "IncodeFlow",
|
|
330
330
|
children: /* @__PURE__ */ s(d, {
|
|
331
331
|
spinnerConfig: n.spinnerConfig,
|
|
332
332
|
hideText: k
|
|
333
333
|
})
|
|
334
334
|
}) : /* @__PURE__ */ s("div", { class: "IncodeFlow" });
|
|
335
|
-
let { Component: a } =
|
|
335
|
+
let { Component: a } = S;
|
|
336
336
|
if (e === "REDIRECT_TO_MOBILE") return /* @__PURE__ */ s("div", {
|
|
337
337
|
class: "IncodeFlow",
|
|
338
338
|
children: /* @__PURE__ */ s(a, {
|
|
@@ -87,7 +87,7 @@ async function S() {
|
|
|
87
87
|
return (await _.get("/omni/asset/fetch-all")).data;
|
|
88
88
|
}
|
|
89
89
|
var C = /* @__PURE__ */ new Map();
|
|
90
|
-
async function
|
|
90
|
+
async function ee(e) {
|
|
91
91
|
if (e.startsWith("data:")) return e;
|
|
92
92
|
let t = C.get(e);
|
|
93
93
|
if (t) return t;
|
|
@@ -97,7 +97,7 @@ async function w(e) {
|
|
|
97
97
|
});
|
|
98
98
|
return C.set(e, r), r;
|
|
99
99
|
}
|
|
100
|
-
async function
|
|
100
|
+
async function w() {
|
|
101
101
|
let e = await S();
|
|
102
102
|
if (!e.theme) throw Error("Theme URL not found in assets response");
|
|
103
103
|
let t = e.theme, n = t.startsWith("http://") || t.startsWith("https://"), r;
|
|
@@ -107,19 +107,19 @@ async function T() {
|
|
|
107
107
|
r = await e.json();
|
|
108
108
|
} else r = (await _.get(t)).data;
|
|
109
109
|
let i = e["logo.png"] || e["logo.svg"] || e["logo.jpg"] || e["logo.jpeg"] || e["logo.webp"] || r.logo, a = i;
|
|
110
|
-
return i && (a = await
|
|
110
|
+
return i && (a = await ee(i)), {
|
|
111
111
|
...r,
|
|
112
112
|
logo: a
|
|
113
113
|
};
|
|
114
114
|
}
|
|
115
|
-
async function
|
|
116
|
-
let e = await
|
|
115
|
+
async function T() {
|
|
116
|
+
let e = await w();
|
|
117
117
|
return e.main && x(e.main, e.buttonColor), e;
|
|
118
118
|
}
|
|
119
119
|
//#endregion
|
|
120
120
|
//#region src/modules/flow/flowInit.ts
|
|
121
|
-
var
|
|
122
|
-
function
|
|
121
|
+
var E = () => import("./id/id.es.js").then((e) => e.Id), D = () => import("./homeScreen-BsnPnOwW.js").then((e) => e.HomeScreen), O;
|
|
122
|
+
function k(e) {
|
|
123
123
|
if (e === "IP_ADDRESS") return () => import("@incodetech/core/flow").then((e) => e.noOpFlowModuleMachine);
|
|
124
124
|
if (e === "REDIRECT_TO_MOBILE") return () => import("@incodetech/core/redirect-to-mobile").then((e) => e.redirectToMobileMachine);
|
|
125
125
|
if (e === "PHONE") return () => import("@incodetech/core/phone").then((e) => e.phoneMachine);
|
|
@@ -148,26 +148,26 @@ function A(e) {
|
|
|
148
148
|
if (e === "QE_SIGNATURE") return () => import("@incodetech/core/qe-signature").then((e) => e.qeSignatureMachine);
|
|
149
149
|
if (e === "CROSS_DOCUMENT_DATA_MATCH") return () => import("@incodetech/core/cross-document-data-match").then((e) => e.crossDocumentDataMatchMachine);
|
|
150
150
|
}
|
|
151
|
-
function
|
|
151
|
+
function A(e) {
|
|
152
152
|
let t = {};
|
|
153
153
|
for (let n of e) {
|
|
154
154
|
let e = n.key;
|
|
155
155
|
if (t[e]) continue;
|
|
156
|
-
let r =
|
|
156
|
+
let r = k(e);
|
|
157
157
|
r && (t[e] = r);
|
|
158
158
|
}
|
|
159
159
|
return t;
|
|
160
160
|
}
|
|
161
|
-
var
|
|
161
|
+
var j = {
|
|
162
162
|
REDIRECT_TO_MOBILE: () => import("./redirectToMobile---pcfaJC.js").then((e) => e.RedirectToMobile),
|
|
163
163
|
PHONE: () => import("./phone/phone.es.js").then((e) => e.Phone),
|
|
164
164
|
EMAIL: () => import("./email/email.es.js").then((e) => e.Email),
|
|
165
165
|
SELFIE: () => import("./selfie/selfie.es.js").then((e) => e.Selfie),
|
|
166
166
|
AUTHENTICATION: () => import("./authentication/authentication.es.js").then((e) => e.Authentication),
|
|
167
|
-
ID:
|
|
168
|
-
ID_CAPTURE:
|
|
169
|
-
TUTORIAL_ID:
|
|
170
|
-
SECOND_ID:
|
|
167
|
+
ID: E,
|
|
168
|
+
ID_CAPTURE: E,
|
|
169
|
+
TUTORIAL_ID: E,
|
|
170
|
+
SECOND_ID: E,
|
|
171
171
|
FACE_MATCH: () => import("./faceMatch-B9l5cU4z.js").then((e) => e.FaceMatch),
|
|
172
172
|
CURP_VALIDATION: () => import("./curp-validation/curp-validation.es.js").then((e) => e.CurpValidation),
|
|
173
173
|
GOVT_VALIDATION_PROVISIONING: () => import("./governmentValidation/governmentValidation.es.js").then((e) => e.GovernmentValidation),
|
|
@@ -190,23 +190,23 @@ var M = {
|
|
|
190
190
|
QE_SIGNATURE: () => import("./qe-signature/qe-signature.es.js").then((e) => e.QeSignature),
|
|
191
191
|
CROSS_DOCUMENT_DATA_MATCH: () => import("./cross-document-data-match/cross-document-data-match.es.js").then((e) => e.CrossDocumentDataMatch)
|
|
192
192
|
};
|
|
193
|
-
function
|
|
194
|
-
return
|
|
193
|
+
function M() {
|
|
194
|
+
return D();
|
|
195
195
|
}
|
|
196
|
-
function
|
|
197
|
-
|
|
198
|
-
|
|
196
|
+
function N() {
|
|
197
|
+
O || (O = M(), O.catch(() => {
|
|
198
|
+
O = void 0;
|
|
199
199
|
}));
|
|
200
200
|
}
|
|
201
|
-
var
|
|
202
|
-
function
|
|
203
|
-
if (
|
|
204
|
-
let e =
|
|
205
|
-
e && n.push(e()), t && n.push(t()),
|
|
206
|
-
|
|
201
|
+
var P;
|
|
202
|
+
function F() {
|
|
203
|
+
if (P) return;
|
|
204
|
+
let e = j.REDIRECT_TO_MOBILE, t = k("REDIRECT_TO_MOBILE"), n = [];
|
|
205
|
+
e && n.push(e()), t && n.push(t()), P = Promise.all(n), P.catch(() => {
|
|
206
|
+
P = void 0;
|
|
207
207
|
});
|
|
208
208
|
}
|
|
209
|
-
function
|
|
209
|
+
function I(e = {}) {
|
|
210
210
|
let t = {}, n = e.isDesktop ?? p() === "desktop", { enableHome: r, ...i } = e;
|
|
211
211
|
return m({
|
|
212
212
|
enableHome: r,
|
|
@@ -214,29 +214,29 @@ function L(e = {}) {
|
|
|
214
214
|
let r = await h(e, {
|
|
215
215
|
...i,
|
|
216
216
|
isDesktop: n
|
|
217
|
-
}), a =
|
|
217
|
+
}), a = A(r.flowModules ?? []);
|
|
218
218
|
for (let e of Object.keys(t)) delete t[e];
|
|
219
219
|
return Object.assign(t, a), r;
|
|
220
220
|
},
|
|
221
221
|
lazyModules: t
|
|
222
222
|
});
|
|
223
223
|
}
|
|
224
|
-
async function
|
|
224
|
+
async function L(n) {
|
|
225
225
|
await f({
|
|
226
226
|
token: n.token,
|
|
227
227
|
wasm: !1
|
|
228
228
|
}), t(e(n.lang ? { lang: n.lang } : void 0));
|
|
229
229
|
}
|
|
230
|
-
async function
|
|
230
|
+
async function R(e) {
|
|
231
231
|
let { token: t, lang: n, flowManager: r } = e;
|
|
232
|
-
await
|
|
232
|
+
await L({
|
|
233
233
|
token: t,
|
|
234
234
|
lang: n
|
|
235
235
|
}), r.load();
|
|
236
236
|
}
|
|
237
|
-
async function
|
|
237
|
+
async function z() {
|
|
238
238
|
try {
|
|
239
|
-
let e = await
|
|
239
|
+
let e = await T(), t = {
|
|
240
240
|
logoSrc: e.logo,
|
|
241
241
|
subtitle: e.subtitle,
|
|
242
242
|
hideFooterBranding: e.hideFooterBranding
|
|
@@ -249,7 +249,7 @@ async function B() {
|
|
|
249
249
|
return {};
|
|
250
250
|
}
|
|
251
251
|
}
|
|
252
|
-
function
|
|
252
|
+
function B(e, t) {
|
|
253
253
|
if (e.currentStep === "REDIRECT_TO_MOBILE") return;
|
|
254
254
|
let n = g(e.flow);
|
|
255
255
|
if (n.length > 0) {
|
|
@@ -265,16 +265,16 @@ function V(e, t) {
|
|
|
265
265
|
});
|
|
266
266
|
}
|
|
267
267
|
}
|
|
268
|
-
function
|
|
268
|
+
function V(e) {
|
|
269
269
|
let t = e.currentStep;
|
|
270
270
|
if (t) {
|
|
271
|
-
let e =
|
|
271
|
+
let e = j[t];
|
|
272
272
|
e && e().catch(() => {});
|
|
273
273
|
}
|
|
274
274
|
}
|
|
275
275
|
//#endregion
|
|
276
276
|
//#region src/modules/flow/unsupportedModule.tsx
|
|
277
|
-
var
|
|
277
|
+
var H = ({ moduleKey: e, onNext: t }) => /* @__PURE__ */ a("section", {
|
|
278
278
|
class: "IncodeUnsupportedModule",
|
|
279
279
|
"aria-live": "polite",
|
|
280
280
|
children: /* @__PURE__ */ a("div", {
|
|
@@ -300,61 +300,64 @@ var U = ({ moduleKey: e, onNext: t }) => /* @__PURE__ */ a("section", {
|
|
|
300
300
|
})
|
|
301
301
|
]
|
|
302
302
|
})
|
|
303
|
-
});
|
|
303
|
+
}), U = () => null, W = () => Promise.resolve(U), G = new Set(["IDENTITY_SEARCH"]);
|
|
304
304
|
//#endregion
|
|
305
305
|
//#region src/modules/flow/useModuleLoader.ts
|
|
306
|
-
function
|
|
306
|
+
function K(e, t) {
|
|
307
307
|
return e instanceof Error ? e.message : t;
|
|
308
308
|
}
|
|
309
|
-
var
|
|
310
|
-
function
|
|
309
|
+
var q = /* @__PURE__ */ new WeakMap(), J = /* @__PURE__ */ new WeakMap();
|
|
310
|
+
function Y(e) {
|
|
311
311
|
return e;
|
|
312
312
|
}
|
|
313
|
-
function
|
|
314
|
-
if (e) return
|
|
313
|
+
function X(e) {
|
|
314
|
+
if (e) return q.get(Y(e));
|
|
315
315
|
}
|
|
316
|
-
function
|
|
317
|
-
let t =
|
|
316
|
+
function Z(e) {
|
|
317
|
+
let t = Y(e), n = q.get(t);
|
|
318
318
|
if (n) return Promise.resolve(n);
|
|
319
|
-
let r =
|
|
319
|
+
let r = J.get(t);
|
|
320
320
|
if (r) return r;
|
|
321
|
-
let i = e().then((e) => (
|
|
322
|
-
throw
|
|
321
|
+
let i = e().then((e) => (q.set(t, e), J.delete(t), e)).catch((e) => {
|
|
322
|
+
throw J.delete(t), e;
|
|
323
323
|
});
|
|
324
|
-
return
|
|
324
|
+
return J.set(t, i), i;
|
|
325
325
|
}
|
|
326
|
-
function
|
|
326
|
+
function Q(e) {
|
|
327
327
|
if (!e) return { status: "idle" };
|
|
328
|
-
let t =
|
|
328
|
+
let t = X(e);
|
|
329
329
|
return t ? {
|
|
330
330
|
status: "loaded",
|
|
331
331
|
Component: t
|
|
332
332
|
} : { status: "loading" };
|
|
333
333
|
}
|
|
334
|
-
function
|
|
335
|
-
|
|
334
|
+
function te(e, t, n) {
|
|
335
|
+
if (e) return t[e] ?? (n?.has(e) ? W : void 0);
|
|
336
|
+
}
|
|
337
|
+
function $(e) {
|
|
338
|
+
let { loader: t, onLoading: a, onLoaded: o, onError: s } = e, [c, l] = i(() => Q(t)), u = r(t), d = r(a), f = r(o), p = r(s);
|
|
336
339
|
return n(() => {
|
|
337
340
|
d.current = a, f.current = o, p.current = s;
|
|
338
341
|
}, [
|
|
339
342
|
a,
|
|
340
343
|
o,
|
|
341
344
|
s
|
|
342
|
-
]), u.current !== t && (u.current = t, l(
|
|
345
|
+
]), u.current !== t && (u.current = t, l(Q(t))), n(() => {
|
|
343
346
|
if (!t) return;
|
|
344
|
-
if (
|
|
347
|
+
if (X(t)) {
|
|
345
348
|
f.current?.();
|
|
346
349
|
return;
|
|
347
350
|
}
|
|
348
351
|
d.current?.();
|
|
349
352
|
let e = !1;
|
|
350
|
-
return
|
|
353
|
+
return Z(t).then((t) => {
|
|
351
354
|
e || (l({
|
|
352
355
|
status: "loaded",
|
|
353
356
|
Component: t
|
|
354
357
|
}), f.current?.());
|
|
355
358
|
}).catch((t) => {
|
|
356
359
|
if (!e) {
|
|
357
|
-
let e =
|
|
360
|
+
let e = K(t, "Failed to load component");
|
|
358
361
|
l({
|
|
359
362
|
status: "error",
|
|
360
363
|
error: e
|
|
@@ -365,45 +368,45 @@ function Z(e) {
|
|
|
365
368
|
};
|
|
366
369
|
}, [t]), c;
|
|
367
370
|
}
|
|
368
|
-
function
|
|
369
|
-
let { moduleKey: t, modules: r,
|
|
370
|
-
loader:
|
|
371
|
-
onLoading: t ? () =>
|
|
372
|
-
onLoaded: t ? () =>
|
|
373
|
-
onError: t ? (e) =>
|
|
371
|
+
function ne(e) {
|
|
372
|
+
let { moduleKey: t, modules: r, headlessModuleKeys: a, onModuleLoading: o, onModuleLoaded: s, onError: c } = e, [l, u] = i(void 0), d = te(t, r, a), f = $({
|
|
373
|
+
loader: d,
|
|
374
|
+
onLoading: t ? () => o?.(t) : void 0,
|
|
375
|
+
onLoaded: t ? () => s?.(t) : void 0,
|
|
376
|
+
onError: t ? (e) => c?.(`Failed to load ${t}: ${e}`) : void 0
|
|
374
377
|
});
|
|
375
378
|
return n(() => {
|
|
376
379
|
if (!t) {
|
|
377
|
-
|
|
380
|
+
u(void 0);
|
|
378
381
|
return;
|
|
379
382
|
}
|
|
380
|
-
|
|
381
|
-
}, [
|
|
383
|
+
u(d ? void 0 : t);
|
|
384
|
+
}, [d, t]), t ? l ? {
|
|
382
385
|
status: "unsupported",
|
|
383
|
-
moduleKey:
|
|
384
|
-
} :
|
|
386
|
+
moduleKey: l
|
|
387
|
+
} : f.status === "idle" || f.status === "loading" ? {
|
|
385
388
|
status: "loading",
|
|
386
389
|
moduleKey: t
|
|
387
|
-
} :
|
|
390
|
+
} : f.status === "error" ? {
|
|
388
391
|
status: "error",
|
|
389
392
|
moduleKey: t,
|
|
390
|
-
error:
|
|
393
|
+
error: f.error
|
|
391
394
|
} : {
|
|
392
395
|
status: "loaded",
|
|
393
396
|
moduleKey: t,
|
|
394
|
-
Component:
|
|
397
|
+
Component: f.Component
|
|
395
398
|
} : { status: "idle" };
|
|
396
399
|
}
|
|
397
|
-
function
|
|
398
|
-
let { moduleKey: t, modules: n } = e, r = t ? n[t] : void 0, i =
|
|
400
|
+
function re(e) {
|
|
401
|
+
let { moduleKey: t, modules: n } = e, r = t ? n[t] : void 0, i = $({ loader: r });
|
|
399
402
|
return r != null && i.status === "loaded";
|
|
400
403
|
}
|
|
401
|
-
function
|
|
404
|
+
function ie(e) {
|
|
402
405
|
typeof requestIdleCallback < "u" ? requestIdleCallback(() => {
|
|
403
406
|
e();
|
|
404
407
|
}) : setTimeout(e, 0);
|
|
405
408
|
}
|
|
406
|
-
function
|
|
409
|
+
function ae(e, t, i, a) {
|
|
407
410
|
let o = r(/* @__PURE__ */ new Set());
|
|
408
411
|
n(() => {
|
|
409
412
|
if (a && t < e.length - 1) {
|
|
@@ -411,7 +414,7 @@ function te(e, t, i, a) {
|
|
|
411
414
|
if (n && !o.current.has(n)) {
|
|
412
415
|
o.current.add(n);
|
|
413
416
|
let e = i[n];
|
|
414
|
-
e &&
|
|
417
|
+
e && ie(() => {
|
|
415
418
|
e().catch(() => {
|
|
416
419
|
o.current.delete(n);
|
|
417
420
|
});
|
|
@@ -426,4 +429,4 @@ function te(e, t, i, a) {
|
|
|
426
429
|
]);
|
|
427
430
|
}
|
|
428
431
|
//#endregion
|
|
429
|
-
export {
|
|
432
|
+
export { H as a, z as c, N as d, F as f, T as h, G as i, R as l, B as m, re as n, j as o, L as p, ae as r, I as s, ne as t, V as u };
|
|
@@ -6,18 +6,18 @@ import { t as s } from "../incodeComponent-9ZUPvQgC.js";
|
|
|
6
6
|
import "../spinner-BiPJCr9Q.js";
|
|
7
7
|
import { t as c } from "../transitionSpinner-Dmj-tzXU.js";
|
|
8
8
|
import { t as l } from "../incodeModule-BH9gV7jI.js";
|
|
9
|
-
import { a as u,
|
|
10
|
-
import { resolveWasmConfig as
|
|
11
|
-
import { QrValidationError as
|
|
12
|
-
import { createWorkflowManager as
|
|
9
|
+
import { a as u, h as d, i as f, o as p, p as m, t as h } from "../useModuleLoader-CRXhrZ1v.js";
|
|
10
|
+
import { resolveWasmConfig as g, warmupWasm as _ } from "@incodetech/core/wasm";
|
|
11
|
+
import { QrValidationError as v, refreshQrUrlUuid as y } from "@incodetech/core/session";
|
|
12
|
+
import { createWorkflowManager as b } from "@incodetech/core/workflow";
|
|
13
13
|
//#region src/modules/workflow/workflowInit.ts
|
|
14
|
-
var
|
|
15
|
-
...
|
|
14
|
+
var x = {
|
|
15
|
+
...p,
|
|
16
16
|
REDIRECT_TO_MOBILE: () => import("../redirectToMobile---pcfaJC.js").then((e) => e.RedirectToMobile)
|
|
17
17
|
};
|
|
18
|
-
async function
|
|
18
|
+
async function S() {
|
|
19
19
|
try {
|
|
20
|
-
let e = await
|
|
20
|
+
let e = await d();
|
|
21
21
|
return {
|
|
22
22
|
theme: e,
|
|
23
23
|
uiConfig: {
|
|
@@ -29,15 +29,15 @@ async function x() {
|
|
|
29
29
|
return {};
|
|
30
30
|
}
|
|
31
31
|
}
|
|
32
|
-
function
|
|
33
|
-
return
|
|
32
|
+
function C(e = {}) {
|
|
33
|
+
return b({
|
|
34
34
|
customModuleCallback: e.customModuleCallback,
|
|
35
35
|
interviewId: e.interviewId,
|
|
36
36
|
isDesktop: e.isDesktop
|
|
37
37
|
});
|
|
38
38
|
}
|
|
39
|
-
function
|
|
40
|
-
e !== !1 && g(
|
|
39
|
+
function w(e) {
|
|
40
|
+
e !== !1 && _(g({
|
|
41
41
|
...e,
|
|
42
42
|
pipelines: e?.pipelines ?? ["selfie", "idCapture"]
|
|
43
43
|
})).catch((e) => {
|
|
@@ -46,48 +46,48 @@ function C(e) {
|
|
|
46
46
|
}
|
|
47
47
|
//#endregion
|
|
48
48
|
//#region src/modules/workflow/useWorkflowInitialization.ts
|
|
49
|
-
function
|
|
50
|
-
let { token: i, lang: o, disableDashboardTheme: s, wasmConfig: c, customModuleCallback: l, interviewId: u, isDesktop:
|
|
51
|
-
let e =
|
|
49
|
+
function T(e) {
|
|
50
|
+
let { token: i, lang: o, disableDashboardTheme: s, wasmConfig: c, customModuleCallback: l, interviewId: u, isDesktop: d, urlUuid: f, onError: p, onUrlUuidRefreshed: h } = e, g = n(null), [_, b] = r(() => {
|
|
51
|
+
let e = C({
|
|
52
52
|
customModuleCallback: l,
|
|
53
53
|
interviewId: u,
|
|
54
|
-
isDesktop:
|
|
54
|
+
isDesktop: d
|
|
55
55
|
});
|
|
56
56
|
return g.current = e, {
|
|
57
57
|
status: "initializing",
|
|
58
58
|
workflowManager: e
|
|
59
59
|
};
|
|
60
|
-
}),
|
|
60
|
+
}), x = n(!1);
|
|
61
61
|
return t(() => {
|
|
62
|
-
if (
|
|
63
|
-
|
|
62
|
+
if (_.status !== "initializing" || x.current) return;
|
|
63
|
+
x.current = !0;
|
|
64
64
|
let e = g.current, t = new AbortController(), { signal: n } = t;
|
|
65
65
|
return (async () => {
|
|
66
66
|
try {
|
|
67
|
-
await
|
|
67
|
+
await m({
|
|
68
68
|
token: i,
|
|
69
69
|
lang: o
|
|
70
|
-
}),
|
|
71
|
-
urlUuid:
|
|
70
|
+
}), f && await y({
|
|
71
|
+
urlUuid: f,
|
|
72
72
|
onboardingId: null,
|
|
73
73
|
onRefreshed: h
|
|
74
74
|
}, n);
|
|
75
|
-
let t = s ? Promise.resolve() :
|
|
75
|
+
let t = s ? Promise.resolve() : S().then((e) => {
|
|
76
76
|
e.uiConfig && a(e.uiConfig);
|
|
77
77
|
});
|
|
78
|
-
|
|
78
|
+
w(c), e.load(), await t, b({
|
|
79
79
|
status: "ready",
|
|
80
80
|
workflowManager: e
|
|
81
81
|
});
|
|
82
82
|
} catch (t) {
|
|
83
83
|
if (n.aborted) return;
|
|
84
|
-
let r = t instanceof Error ? t.message : "Failed to initialize SDK", i = t instanceof
|
|
84
|
+
let r = t instanceof Error ? t.message : "Failed to initialize SDK", i = t instanceof v ? t.status : void 0;
|
|
85
85
|
b({
|
|
86
86
|
status: "error",
|
|
87
87
|
error: r,
|
|
88
88
|
errorCode: i,
|
|
89
89
|
workflowManager: e
|
|
90
|
-
}),
|
|
90
|
+
}), p?.(r, i);
|
|
91
91
|
}
|
|
92
92
|
})(), () => {
|
|
93
93
|
t.abort(), e?.stop();
|
|
@@ -97,14 +97,14 @@ function w(e) {
|
|
|
97
97
|
o,
|
|
98
98
|
s,
|
|
99
99
|
c,
|
|
100
|
+
f,
|
|
100
101
|
p,
|
|
101
|
-
m,
|
|
102
102
|
h
|
|
103
|
-
]),
|
|
103
|
+
]), _;
|
|
104
104
|
}
|
|
105
105
|
//#endregion
|
|
106
106
|
//#region src/modules/workflow/workflow.tsx
|
|
107
|
-
function
|
|
107
|
+
function E(e) {
|
|
108
108
|
let { moduleKey: t, config: n, workflowId: r, authHint: i, lang: a, mergeSessionRecordings: o, ageAssurance: s } = e;
|
|
109
109
|
switch (t) {
|
|
110
110
|
case "AUTHENTICATION": return {
|
|
@@ -144,8 +144,8 @@ function T(e) {
|
|
|
144
144
|
default: return n;
|
|
145
145
|
}
|
|
146
146
|
}
|
|
147
|
-
var
|
|
148
|
-
let { i18n: l } = e(),
|
|
147
|
+
var D = ({ config: r, onFinish: a, onError: s }) => {
|
|
148
|
+
let { i18n: l } = e(), d = T({
|
|
149
149
|
token: r.token,
|
|
150
150
|
lang: r.lang,
|
|
151
151
|
disableDashboardTheme: r.disableDashboardTheme,
|
|
@@ -156,9 +156,10 @@ var E = ({ config: r, onFinish: a, onError: s }) => {
|
|
|
156
156
|
urlUuid: r.urlUuid,
|
|
157
157
|
onError: s,
|
|
158
158
|
onUrlUuidRefreshed: r.onUrlUuidRefreshed
|
|
159
|
-
}), [
|
|
160
|
-
moduleKey:
|
|
161
|
-
modules:
|
|
159
|
+
}), [p, m] = o(() => d.workflowManager, { autoLoad: !1 }), g = h({
|
|
160
|
+
moduleKey: p?.status === "ready" ? p.currentNode.moduleKey : void 0,
|
|
161
|
+
modules: x,
|
|
162
|
+
headlessModuleKeys: f,
|
|
162
163
|
onModuleLoading: r.onModuleLoading,
|
|
163
164
|
onModuleLoaded: r.onModuleLoaded,
|
|
164
165
|
onError: s
|
|
@@ -166,60 +167,60 @@ var E = ({ config: r, onFinish: a, onError: s }) => {
|
|
|
166
167
|
t(() => {
|
|
167
168
|
r.lang && l.language !== r.lang && l.changeLanguage(r.lang);
|
|
168
169
|
}, [r.lang, l]);
|
|
169
|
-
let
|
|
170
|
+
let _ = n(!1);
|
|
170
171
|
t(() => {
|
|
171
|
-
|
|
172
|
+
_.current || (p?.status === "finished" ? (_.current = !0, a?.(p.finishStatus)) : p?.status === "asyncResolution" && (_.current = !0, a?.()));
|
|
172
173
|
}, [
|
|
173
|
-
|
|
174
|
+
p?.status,
|
|
174
175
|
a,
|
|
175
|
-
|
|
176
|
+
p
|
|
176
177
|
]), t(() => {
|
|
177
|
-
|
|
178
|
+
p?.status === "error" && s && s(p.error, p.errorCode);
|
|
178
179
|
}, [
|
|
179
|
-
|
|
180
|
+
p?.status,
|
|
180
181
|
s,
|
|
181
|
-
|
|
182
|
+
p
|
|
182
183
|
]);
|
|
183
|
-
let
|
|
184
|
+
let v = () => /* @__PURE__ */ i("div", {
|
|
184
185
|
class: "IncodeWorkflow",
|
|
185
186
|
children: /* @__PURE__ */ i(c, { spinnerConfig: r.spinnerConfig })
|
|
186
|
-
}),
|
|
187
|
-
|
|
187
|
+
}), y = (e) => {
|
|
188
|
+
m.errorModule(e ?? "Module error"), s?.(e ?? "Module error");
|
|
188
189
|
};
|
|
189
|
-
if (
|
|
190
|
-
if (
|
|
191
|
-
if (
|
|
192
|
-
if (
|
|
190
|
+
if (d.status === "error") return null;
|
|
191
|
+
if (d.status === "initializing" || !p || p.status === "idle" || p.status === "loading") return v();
|
|
192
|
+
if (p.status === "finished" || p.status === "error" || p.status === "asyncResolution" || p.status === "closed") return null;
|
|
193
|
+
if (g.status === "unsupported") return /* @__PURE__ */ i("div", {
|
|
193
194
|
class: "IncodeWorkflow",
|
|
194
|
-
children: /* @__PURE__ */ i(
|
|
195
|
-
moduleKey:
|
|
196
|
-
onNext: () =>
|
|
195
|
+
children: /* @__PURE__ */ i(u, {
|
|
196
|
+
moduleKey: p.currentNode.moduleKey,
|
|
197
|
+
onNext: () => m.completeModule()
|
|
197
198
|
})
|
|
198
199
|
});
|
|
199
|
-
if (
|
|
200
|
-
let { Component:
|
|
200
|
+
if (g.status === "idle" || g.status === "loading" || g.status === "error") return v();
|
|
201
|
+
let { Component: b } = g;
|
|
201
202
|
return /* @__PURE__ */ i("div", {
|
|
202
203
|
class: "IncodeWorkflow",
|
|
203
|
-
children: /* @__PURE__ */ i(
|
|
204
|
-
config:
|
|
205
|
-
moduleKey:
|
|
206
|
-
config:
|
|
207
|
-
workflowId:
|
|
204
|
+
children: /* @__PURE__ */ i(b, {
|
|
205
|
+
config: E({
|
|
206
|
+
moduleKey: p.currentNode.moduleKey,
|
|
207
|
+
config: p.config,
|
|
208
|
+
workflowId: p.workflowConfig.id,
|
|
208
209
|
authHint: r.authHint,
|
|
209
210
|
lang: r.lang,
|
|
210
|
-
mergeSessionRecordings:
|
|
211
|
-
ageAssurance:
|
|
211
|
+
mergeSessionRecordings: p.workflowConfig.mergeSessionRecordings,
|
|
212
|
+
ageAssurance: p.workflowConfig.ageAssurance
|
|
212
213
|
}),
|
|
213
|
-
onFinish: () =>
|
|
214
|
-
onError:
|
|
215
|
-
...
|
|
216
|
-
},
|
|
214
|
+
onFinish: () => m.completeModule(),
|
|
215
|
+
onError: y,
|
|
216
|
+
...p.currentNode.moduleKey === "REDIRECT_TO_MOBILE" ? { onContinue: () => m.completeModule() } : {}
|
|
217
|
+
}, p.currentNode.id)
|
|
217
218
|
});
|
|
218
|
-
},
|
|
219
|
+
}, O = ({ config: e, onFinish: t, onError: n }) => /* @__PURE__ */ i(s, { children: e ? /* @__PURE__ */ i(D, {
|
|
219
220
|
config: e,
|
|
220
221
|
onFinish: t,
|
|
221
222
|
onError: n
|
|
222
223
|
}) : null });
|
|
223
|
-
l(
|
|
224
|
+
l(O, "incode-workflow");
|
|
224
225
|
//#endregion
|
|
225
|
-
export {
|
|
226
|
+
export { O as IncodeWorkflow };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@incodetech/web",
|
|
3
|
-
"version": "0.0.0-dev-20260506-
|
|
3
|
+
"version": "0.0.0-dev-20260506-02369cc",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"main": "./dist/index.es.js",
|
|
6
6
|
"types": "./dist/types/index.d.ts",
|
|
@@ -239,7 +239,7 @@
|
|
|
239
239
|
"qrcode": "^1.5.4",
|
|
240
240
|
"signature_pad": "^5.1.3",
|
|
241
241
|
"tailwindcss": "^4.1.17",
|
|
242
|
-
"@incodetech/core": "0.0.0-dev-20260506-
|
|
242
|
+
"@incodetech/core": "0.0.0-dev-20260506-02369cc"
|
|
243
243
|
},
|
|
244
244
|
"devDependencies": {
|
|
245
245
|
"@microsoft/api-extractor": "^7.53.3",
|