@incodetech/web 0.0.0-dev-20260507-85da360 → 0.0.0-dev-20260507-a2cd155
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-av72n-l1.js";
|
|
7
7
|
import { t as f } from "../incodeModule-D_r2n18O.js";
|
|
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-
|
|
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-CPLC4c0j.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";
|
|
@@ -2,13 +2,13 @@ import { i as e, r as t } from "./i18n-BnVa5Y-_.js";
|
|
|
2
2
|
import { _ as n, l as r, p as i, v as a } from "./vendor-preact-D6SntenC.js";
|
|
3
3
|
import { t as o } from "./uiConfig-CwpQ-IM6.js";
|
|
4
4
|
import { t as s } from "./button-DcCUEn2n.js";
|
|
5
|
-
import { initializeWasmUtil as c, resolveWasmConfig as l, setWasmConfig as u,
|
|
6
|
-
import { setup as
|
|
7
|
-
import { getDeviceClass as
|
|
8
|
-
import { createOrchestratedFlowManager as
|
|
9
|
-
import { api as
|
|
5
|
+
import { initializeWasmUtil as c, resolveWasmConfig as l, setWasmConfig as u, upgradeToWasmHttpClient as d, warmupWasm as f } from "@incodetech/core/wasm";
|
|
6
|
+
import { setup as p } from "@incodetech/core";
|
|
7
|
+
import { getDeviceClass as m } from "@incodetech/core/device";
|
|
8
|
+
import { createOrchestratedFlowManager as h, getFlow as g, getRequiredWasmPipelines as _ } from "@incodetech/core/flow";
|
|
9
|
+
import { api as v } from "@incodetech/core/http";
|
|
10
10
|
//#region src/styles/generatePalette.ts
|
|
11
|
-
function
|
|
11
|
+
function y(e) {
|
|
12
12
|
let t = e.replace("#", "");
|
|
13
13
|
t.length === 3 && (t = t.split("").map((e) => e + e).join(""));
|
|
14
14
|
let n = /^([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec(t);
|
|
@@ -34,7 +34,7 @@ function v(e) {
|
|
|
34
34
|
l: u * 100
|
|
35
35
|
};
|
|
36
36
|
}
|
|
37
|
-
function
|
|
37
|
+
function b(e, t, n) {
|
|
38
38
|
let r = e / 360, i = t / 100, a = n / 100, o, s, c;
|
|
39
39
|
if (i === 0) o = s = c = a;
|
|
40
40
|
else {
|
|
@@ -47,24 +47,24 @@ function y(e, t, n) {
|
|
|
47
47
|
};
|
|
48
48
|
return `#${l(o)}${l(s)}${l(c)}`;
|
|
49
49
|
}
|
|
50
|
-
function
|
|
51
|
-
let t =
|
|
50
|
+
function ee(e) {
|
|
51
|
+
let t = y(e);
|
|
52
52
|
if (!t) throw Error(`Invalid color format: ${e}`);
|
|
53
53
|
return {
|
|
54
|
-
50:
|
|
55
|
-
200:
|
|
56
|
-
300:
|
|
57
|
-
400:
|
|
54
|
+
50: b(t.h, t.s, 95),
|
|
55
|
+
200: b(t.h, t.s, 80),
|
|
56
|
+
300: b(t.h, t.s, 65),
|
|
57
|
+
400: b(t.h, t.s, Math.min(100, t.l + 10)),
|
|
58
58
|
500: e,
|
|
59
|
-
600:
|
|
60
|
-
900:
|
|
59
|
+
600: b(t.h, t.s, Math.max(0, t.l - 10)),
|
|
60
|
+
900: b(t.h, t.s, 20)
|
|
61
61
|
};
|
|
62
62
|
}
|
|
63
63
|
//#endregion
|
|
64
64
|
//#region src/styles/applyTheme.ts
|
|
65
|
-
function
|
|
65
|
+
function te(e, t) {
|
|
66
66
|
if (typeof document > "u") return;
|
|
67
|
-
let n =
|
|
67
|
+
let n = ee(e), r = document.getElementById("incode-theme");
|
|
68
68
|
r || (r = document.createElement("style"), r.id = "incode-theme", document.head.appendChild(r));
|
|
69
69
|
let i = t || "#ffffff", a = `
|
|
70
70
|
:root,
|
|
@@ -83,38 +83,38 @@ function x(e, t) {
|
|
|
83
83
|
}
|
|
84
84
|
//#endregion
|
|
85
85
|
//#region src/styles/fetchTheme.ts
|
|
86
|
-
async function
|
|
87
|
-
return (await
|
|
86
|
+
async function x() {
|
|
87
|
+
return (await v.get("/omni/asset/fetch-all")).data;
|
|
88
88
|
}
|
|
89
|
-
var
|
|
90
|
-
async function
|
|
89
|
+
var S = /* @__PURE__ */ new Map();
|
|
90
|
+
async function C(e) {
|
|
91
91
|
if (e.startsWith("data:")) return e;
|
|
92
|
-
let t =
|
|
92
|
+
let t = S.get(e);
|
|
93
93
|
if (t) return t;
|
|
94
94
|
let n = await (await fetch(e)).blob(), r = await new Promise((e, t) => {
|
|
95
95
|
let r = new FileReader();
|
|
96
96
|
r.onloadend = () => e(r.result), r.onerror = t, r.readAsDataURL(n);
|
|
97
97
|
});
|
|
98
|
-
return
|
|
98
|
+
return S.set(e, r), r;
|
|
99
99
|
}
|
|
100
100
|
async function w() {
|
|
101
|
-
let e = await
|
|
101
|
+
let e = await x();
|
|
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;
|
|
104
104
|
if (n) {
|
|
105
105
|
let e = await fetch(t);
|
|
106
106
|
if (!e.ok) throw Error(`Failed to fetch theme: ${e.statusText}`);
|
|
107
107
|
r = await e.json();
|
|
108
|
-
} else r = (await
|
|
108
|
+
} else r = (await v.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 C(i)), {
|
|
111
111
|
...r,
|
|
112
112
|
logo: a
|
|
113
113
|
};
|
|
114
114
|
}
|
|
115
115
|
async function T() {
|
|
116
116
|
let e = await w();
|
|
117
|
-
return e.main &&
|
|
117
|
+
return e.main && te(e.main, e.buttonColor), e;
|
|
118
118
|
}
|
|
119
119
|
//#endregion
|
|
120
120
|
//#region src/modules/flow/flowInit.ts
|
|
@@ -209,11 +209,11 @@ function F() {
|
|
|
209
209
|
});
|
|
210
210
|
}
|
|
211
211
|
function I(e = {}) {
|
|
212
|
-
let t = {}, n = e.isDesktop ??
|
|
213
|
-
return
|
|
212
|
+
let t = {}, n = e.isDesktop ?? m() === "desktop", { enableHome: r, ...i } = e;
|
|
213
|
+
return h({
|
|
214
214
|
enableHome: r,
|
|
215
215
|
getFlow: async (e) => {
|
|
216
|
-
let r = await
|
|
216
|
+
let r = await g(e, {
|
|
217
217
|
...i,
|
|
218
218
|
isDesktop: n
|
|
219
219
|
}), a = A(r.flowModules ?? []);
|
|
@@ -224,7 +224,7 @@ function I(e = {}) {
|
|
|
224
224
|
});
|
|
225
225
|
}
|
|
226
226
|
async function L(n) {
|
|
227
|
-
await
|
|
227
|
+
await p({
|
|
228
228
|
token: n.token,
|
|
229
229
|
wasm: !1
|
|
230
230
|
}), t(e(n.lang ? { lang: n.lang } : void 0));
|
|
@@ -253,7 +253,7 @@ async function z() {
|
|
|
253
253
|
}
|
|
254
254
|
function B(e, t) {
|
|
255
255
|
if (e.currentStep === "REDIRECT_TO_MOBILE") return;
|
|
256
|
-
let n =
|
|
256
|
+
let n = _(e.flow);
|
|
257
257
|
if (n.length > 0) {
|
|
258
258
|
let e = l({
|
|
259
259
|
...t ?? {},
|
|
@@ -262,7 +262,7 @@ function B(e, t) {
|
|
|
262
262
|
...e,
|
|
263
263
|
pipelines: e.pipelines ? [...e.pipelines] : void 0
|
|
264
264
|
};
|
|
265
|
-
u(r),
|
|
265
|
+
u(r), f(e).then(() => c(r)).then(() => d(r)).catch((e) => {
|
|
266
266
|
console.error("WASM warmup failed:", e);
|
|
267
267
|
});
|
|
268
268
|
}
|
|
@@ -333,7 +333,7 @@ function Q(e) {
|
|
|
333
333
|
Component: t
|
|
334
334
|
} : { status: "loading" };
|
|
335
335
|
}
|
|
336
|
-
function
|
|
336
|
+
function ne(e, t, n) {
|
|
337
337
|
if (e) return t[e] ?? (n?.has(e) ? W : void 0);
|
|
338
338
|
}
|
|
339
339
|
function $(e) {
|
|
@@ -370,8 +370,8 @@ function $(e) {
|
|
|
370
370
|
};
|
|
371
371
|
}, [t]), c;
|
|
372
372
|
}
|
|
373
|
-
function
|
|
374
|
-
let { moduleKey: t, modules: r, headlessModuleKeys: a, onModuleLoading: o, onModuleLoaded: s, onError: c } = e, [l, u] = i(void 0), d =
|
|
373
|
+
function re(e) {
|
|
374
|
+
let { moduleKey: t, modules: r, headlessModuleKeys: a, onModuleLoading: o, onModuleLoaded: s, onError: c } = e, [l, u] = i(void 0), d = ne(t, r, a), f = $({
|
|
375
375
|
loader: d,
|
|
376
376
|
onLoading: t ? () => o?.(t) : void 0,
|
|
377
377
|
onLoaded: t ? () => s?.(t) : void 0,
|
|
@@ -399,16 +399,16 @@ function ne(e) {
|
|
|
399
399
|
Component: f.Component
|
|
400
400
|
} : { status: "idle" };
|
|
401
401
|
}
|
|
402
|
-
function
|
|
402
|
+
function ie(e) {
|
|
403
403
|
let { moduleKey: t, modules: n } = e, r = t ? n[t] : void 0, i = $({ loader: r });
|
|
404
404
|
return r != null && i.status === "loaded";
|
|
405
405
|
}
|
|
406
|
-
function
|
|
406
|
+
function ae(e) {
|
|
407
407
|
typeof requestIdleCallback < "u" ? requestIdleCallback(() => {
|
|
408
408
|
e();
|
|
409
409
|
}) : setTimeout(e, 0);
|
|
410
410
|
}
|
|
411
|
-
function
|
|
411
|
+
function oe(e, t, i, a) {
|
|
412
412
|
let o = r(/* @__PURE__ */ new Set());
|
|
413
413
|
n(() => {
|
|
414
414
|
if (a && t < e.length - 1) {
|
|
@@ -416,7 +416,7 @@ function ae(e, t, i, a) {
|
|
|
416
416
|
if (n && !o.current.has(n)) {
|
|
417
417
|
o.current.add(n);
|
|
418
418
|
let e = i[n];
|
|
419
|
-
e &&
|
|
419
|
+
e && ae(() => {
|
|
420
420
|
e().catch(() => {
|
|
421
421
|
o.current.delete(n);
|
|
422
422
|
});
|
|
@@ -431,4 +431,4 @@ function ae(e, t, i, a) {
|
|
|
431
431
|
]);
|
|
432
432
|
}
|
|
433
433
|
//#endregion
|
|
434
|
-
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,
|
|
434
|
+
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, ie as n, j as o, L as p, oe as r, I as s, re as t, V as u };
|
|
@@ -6,17 +6,17 @@ import { t as s } from "../incodeComponent-9ZUPvQgC.js";
|
|
|
6
6
|
import "../spinner-B4dcie2T.js";
|
|
7
7
|
import { t as c } from "../transitionSpinner-av72n-l1.js";
|
|
8
8
|
import { t as l } from "../incodeModule-D_r2n18O.js";
|
|
9
|
-
import { a as u, h as d, i as f, o as p, p as m, t as h } from "../useModuleLoader-
|
|
10
|
-
import { resolveWasmConfig as g,
|
|
11
|
-
import { getDeviceClass as
|
|
12
|
-
import { QrValidationError as
|
|
13
|
-
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-CPLC4c0j.js";
|
|
10
|
+
import { resolveWasmConfig as g, upgradeToWasmHttpClient as _, warmupWasm as v } from "@incodetech/core/wasm";
|
|
11
|
+
import { getDeviceClass as y } from "@incodetech/core/device";
|
|
12
|
+
import { QrValidationError as b, refreshQrUrlUuid as x } from "@incodetech/core/session";
|
|
13
|
+
import { createWorkflowManager as S } from "@incodetech/core/workflow";
|
|
14
14
|
//#region src/modules/workflow/workflowInit.ts
|
|
15
|
-
var
|
|
15
|
+
var C = {
|
|
16
16
|
...p,
|
|
17
17
|
REDIRECT_TO_MOBILE: () => import("../redirectToMobile-Cg-BpzrT.js").then((e) => e.RedirectToMobile)
|
|
18
18
|
};
|
|
19
|
-
async function
|
|
19
|
+
async function w() {
|
|
20
20
|
try {
|
|
21
21
|
let e = await d();
|
|
22
22
|
return {
|
|
@@ -30,26 +30,31 @@ async function C() {
|
|
|
30
30
|
return {};
|
|
31
31
|
}
|
|
32
32
|
}
|
|
33
|
-
function
|
|
34
|
-
return
|
|
33
|
+
function T(e = {}) {
|
|
34
|
+
return S({
|
|
35
35
|
customModuleCallback: e.customModuleCallback,
|
|
36
36
|
interviewId: e.interviewId,
|
|
37
|
-
isDesktop: e.isDesktop ??
|
|
37
|
+
isDesktop: e.isDesktop ?? y() === "desktop"
|
|
38
38
|
});
|
|
39
39
|
}
|
|
40
|
-
function
|
|
41
|
-
e
|
|
40
|
+
function E(e) {
|
|
41
|
+
if (e === !1) return;
|
|
42
|
+
let t = g({
|
|
42
43
|
...e,
|
|
43
44
|
pipelines: e?.pipelines ?? ["selfie", "idCapture"]
|
|
44
|
-
})
|
|
45
|
+
}), n = {
|
|
46
|
+
...t,
|
|
47
|
+
pipelines: t.pipelines ? [...t.pipelines] : void 0
|
|
48
|
+
};
|
|
49
|
+
v(t).then(() => _(n)).catch((e) => {
|
|
45
50
|
console.error("Workflow WASM warmup failed:", e);
|
|
46
51
|
});
|
|
47
52
|
}
|
|
48
53
|
//#endregion
|
|
49
54
|
//#region src/modules/workflow/useWorkflowInitialization.ts
|
|
50
|
-
function
|
|
55
|
+
function D(e) {
|
|
51
56
|
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), [_, v] = r(() => {
|
|
52
|
-
let e =
|
|
57
|
+
let e = T({
|
|
53
58
|
customModuleCallback: l,
|
|
54
59
|
interviewId: u,
|
|
55
60
|
isDesktop: d
|
|
@@ -58,31 +63,31 @@ function E(e) {
|
|
|
58
63
|
status: "initializing",
|
|
59
64
|
workflowManager: e
|
|
60
65
|
};
|
|
61
|
-
}),
|
|
66
|
+
}), y = n(!1);
|
|
62
67
|
return t(() => {
|
|
63
|
-
if (_.status !== "initializing" ||
|
|
64
|
-
|
|
68
|
+
if (_.status !== "initializing" || y.current) return;
|
|
69
|
+
y.current = !0;
|
|
65
70
|
let e = g.current, t = new AbortController(), { signal: n } = t;
|
|
66
71
|
return (async () => {
|
|
67
72
|
try {
|
|
68
73
|
await m({
|
|
69
74
|
token: i,
|
|
70
75
|
lang: o
|
|
71
|
-
}), f && await
|
|
76
|
+
}), f && await x({
|
|
72
77
|
urlUuid: f,
|
|
73
78
|
onboardingId: null,
|
|
74
79
|
onRefreshed: h
|
|
75
80
|
}, n);
|
|
76
|
-
let t = s ? Promise.resolve() :
|
|
81
|
+
let t = s ? Promise.resolve() : w().then((e) => {
|
|
77
82
|
e.uiConfig && a(e.uiConfig);
|
|
78
83
|
});
|
|
79
|
-
|
|
84
|
+
E(c), e.load(), await t, v({
|
|
80
85
|
status: "ready",
|
|
81
86
|
workflowManager: e
|
|
82
87
|
});
|
|
83
88
|
} catch (t) {
|
|
84
89
|
if (n.aborted) return;
|
|
85
|
-
let r = t instanceof Error ? t.message : "Failed to initialize SDK", i = t instanceof
|
|
90
|
+
let r = t instanceof Error ? t.message : "Failed to initialize SDK", i = t instanceof b ? t.status : void 0;
|
|
86
91
|
v({
|
|
87
92
|
status: "error",
|
|
88
93
|
error: r,
|
|
@@ -105,7 +110,7 @@ function E(e) {
|
|
|
105
110
|
}
|
|
106
111
|
//#endregion
|
|
107
112
|
//#region src/modules/workflow/workflow.tsx
|
|
108
|
-
function
|
|
113
|
+
function O(e) {
|
|
109
114
|
let { moduleKey: t, config: n, workflowId: r, authHint: i, lang: a, mergeSessionRecordings: o, ageAssurance: s } = e;
|
|
110
115
|
switch (t) {
|
|
111
116
|
case "AUTHENTICATION": return {
|
|
@@ -145,8 +150,8 @@ function D(e) {
|
|
|
145
150
|
default: return n;
|
|
146
151
|
}
|
|
147
152
|
}
|
|
148
|
-
var
|
|
149
|
-
let { i18n: l } = e(), d =
|
|
153
|
+
var k = ({ config: r, onFinish: a, onError: s }) => {
|
|
154
|
+
let { i18n: l } = e(), d = D({
|
|
150
155
|
token: r.token,
|
|
151
156
|
lang: r.lang,
|
|
152
157
|
disableDashboardTheme: r.disableDashboardTheme,
|
|
@@ -159,7 +164,7 @@ var O = ({ config: r, onFinish: a, onError: s }) => {
|
|
|
159
164
|
onUrlUuidRefreshed: r.onUrlUuidRefreshed
|
|
160
165
|
}), [p, m] = o(() => d.workflowManager, { autoLoad: !1 }), g = h({
|
|
161
166
|
moduleKey: p?.status === "ready" ? p.currentNode.moduleKey : void 0,
|
|
162
|
-
modules:
|
|
167
|
+
modules: C,
|
|
163
168
|
headlessModuleKeys: f,
|
|
164
169
|
onModuleLoading: r.onModuleLoading,
|
|
165
170
|
onModuleLoaded: r.onModuleLoaded,
|
|
@@ -206,7 +211,7 @@ var O = ({ config: r, onFinish: a, onError: s }) => {
|
|
|
206
211
|
return /* @__PURE__ */ i("div", {
|
|
207
212
|
class: "IncodeWorkflow",
|
|
208
213
|
children: /* @__PURE__ */ i(x, {
|
|
209
|
-
config:
|
|
214
|
+
config: O({
|
|
210
215
|
moduleKey: p.currentNode.moduleKey,
|
|
211
216
|
config: p.config,
|
|
212
217
|
workflowId: p.workflowConfig.id,
|
|
@@ -220,11 +225,11 @@ var O = ({ config: r, onFinish: a, onError: s }) => {
|
|
|
220
225
|
...p.currentNode.moduleKey === "REDIRECT_TO_MOBILE" ? { onContinue: () => m.completeModule() } : {}
|
|
221
226
|
}, p.currentNode.id)
|
|
222
227
|
});
|
|
223
|
-
},
|
|
228
|
+
}, A = ({ config: e, onFinish: t, onError: n }) => /* @__PURE__ */ i(s, { children: e ? /* @__PURE__ */ i(k, {
|
|
224
229
|
config: e,
|
|
225
230
|
onFinish: t,
|
|
226
231
|
onError: n
|
|
227
232
|
}) : null });
|
|
228
|
-
l(
|
|
233
|
+
l(A, "incode-workflow");
|
|
229
234
|
//#endregion
|
|
230
|
-
export {
|
|
235
|
+
export { A as IncodeWorkflow };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@incodetech/web",
|
|
3
|
-
"version": "0.0.0-dev-20260507-
|
|
3
|
+
"version": "0.0.0-dev-20260507-a2cd155",
|
|
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-20260507-
|
|
242
|
+
"@incodetech/core": "0.0.0-dev-20260507-a2cd155"
|
|
243
243
|
},
|
|
244
244
|
"devDependencies": {
|
|
245
245
|
"@microsoft/api-extractor": "^7.53.3",
|