@incodetech/core 0.0.0-dev-20260218-e020e1c → 0.0.0-dev-20260219-f9d9707
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/authentication.d.ts +1 -1
- package/dist/authentication.esm.js +6 -6
- package/dist/backCameraStream-DhKbn3gt.esm.js +337 -0
- package/dist/curp-validation.esm.js +2 -2
- package/dist/{deepsightLoader-Bf15_5Gk.esm.js → deepsightLoader-DRQJKHl8.esm.js} +3 -3
- package/dist/{deepsightService-jsdRuf0u.esm.js → deepsightService-CZC8YaHN.esm.js} +2 -2
- package/dist/email.esm.js +2 -2
- package/dist/{events-BvAMgEuE.esm.js → events-mFVnFpqq.esm.js} +1 -1
- package/dist/face-match.esm.js +2 -2
- package/dist/{faceCaptureManagerFactory-1AAwvEWC.d.ts → faceCaptureManagerFactory-DrUCn7LS.d.ts} +2 -0
- package/dist/{faceCaptureSetup-Cz44Uo-J.esm.js → faceCaptureSetup-Bxot-Bxs.esm.js} +8 -7
- package/dist/flow.esm.js +1 -1
- package/dist/government-validation.esm.js +1 -1
- package/dist/{id-DtrUp5nz.esm.js → id-DZsKpBfe.esm.js} +8 -236
- package/dist/id.esm.js +6 -6
- package/dist/index.esm.js +6 -6
- package/dist/phone.esm.js +2 -2
- package/dist/selfie.d.ts +1 -1
- package/dist/selfie.esm.js +6 -6
- package/dist/{stats-Bv2CLzQ0.esm.js → stats-C0Z_4KzW.esm.js} +1 -1
- package/dist/stats.esm.js +2 -2
- package/package.json +1 -1
- package/dist/streamingEvents-Bl2HRhLD.esm.js +0 -104
- /package/dist/{api-CmRbOLxk.esm.js → api-Cqrn4bGi.esm.js} +0 -0
package/dist/authentication.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import "./types-Dl8aaniO.js";
|
|
2
2
|
import { t as AnyStateMachine } from "./StateMachine-CvjqRbSg.js";
|
|
3
|
-
import { a as FaceCaptureDependencies, n as FaceCaptureManagerState, r as BaseFaceCaptureConfig, t as FaceCaptureManager } from "./faceCaptureManagerFactory-
|
|
3
|
+
import { a as FaceCaptureDependencies, n as FaceCaptureManagerState, r as BaseFaceCaptureConfig, t as FaceCaptureManager } from "./faceCaptureManagerFactory-DrUCn7LS.js";
|
|
4
4
|
import { t as Manager } from "./Manager-DZLpIRan.js";
|
|
5
5
|
import { t as ActorRefFrom } from "./Actor-DniIAF8X.js";
|
|
6
6
|
import { r as FlowModuleConfig } from "./types-DFgUJtIJ.js";
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import { d as addEvent, n as eventModuleNames } from "./events-
|
|
1
|
+
import { d as addEvent, n as eventModuleNames } from "./events-mFVnFpqq.esm.js";
|
|
2
|
+
import { l as getDeviceClass } from "./backCameraStream-DhKbn3gt.esm.js";
|
|
2
3
|
import { m as BrowserStorageProvider, r as WasmUtilProvider } from "./src-CKB3MNL0.esm.js";
|
|
3
4
|
import { a as fromPromise, o as createActor, r as assign, t as endpoints } from "./endpoints-CAXIQnl3.esm.js";
|
|
4
|
-
import
|
|
5
|
-
import "./
|
|
6
|
-
import
|
|
7
|
-
import "./
|
|
8
|
-
import { a as FACE_ERROR_CODES, n as faceCaptureMachine, o as createFaceCaptureManager, t as FACE_CAPTURE_EVENT_CODES } from "./faceCaptureSetup-Cz44Uo-J.esm.js";
|
|
5
|
+
import "./deepsightService-CZC8YaHN.esm.js";
|
|
6
|
+
import { t as api } from "./api-Cqrn4bGi.esm.js";
|
|
7
|
+
import "./stats-C0Z_4KzW.esm.js";
|
|
8
|
+
import { a as FACE_ERROR_CODES, n as faceCaptureMachine, o as createFaceCaptureManager, t as FACE_CAPTURE_EVENT_CODES } from "./faceCaptureSetup-Bxot-Bxs.esm.js";
|
|
9
9
|
|
|
10
10
|
//#region src/modules/authentication/authenticationErrorUtils.ts
|
|
11
11
|
const AUTH_ERROR_MAP = {
|
|
@@ -0,0 +1,337 @@
|
|
|
1
|
+
import { A as getUserAgent, C as enumerateVideoDevices, F as isSafari, N as isIOS, O as getDeviceInfo, P as isIPhone14OrHigher, S as applyTrackConstraints, T as stopCameraStream, j as isAndroid, l as MotionSensorProvider, w as requestCameraAccess, y as queryCameraPermission } from "./src-CKB3MNL0.esm.js";
|
|
2
|
+
import { t as endpoints } from "./endpoints-CAXIQnl3.esm.js";
|
|
3
|
+
import { t as api } from "./api-Cqrn4bGi.esm.js";
|
|
4
|
+
|
|
5
|
+
//#region ../infra/src/capabilities/ITimerCapability.ts
|
|
6
|
+
function sleep(ms) {
|
|
7
|
+
return new Promise((resolve) => setTimeout(resolve, ms));
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
//#endregion
|
|
11
|
+
//#region src/internal/device/getBrowser.ts
|
|
12
|
+
function getBrowser() {
|
|
13
|
+
const userAgent = getUserAgent();
|
|
14
|
+
if (!userAgent) return "other";
|
|
15
|
+
const ua = userAgent.toLowerCase();
|
|
16
|
+
if (ua.includes("edg/")) return "edge";
|
|
17
|
+
if (ua.includes("chrome") && !ua.includes("edg/")) return "chrome";
|
|
18
|
+
if (ua.includes("firefox")) return "firefox";
|
|
19
|
+
if (ua.includes("safari") && !ua.includes("chrome")) return "safari";
|
|
20
|
+
return "other";
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
//#endregion
|
|
24
|
+
//#region src/internal/device/getDeviceClass.ts
|
|
25
|
+
function getDeviceClass() {
|
|
26
|
+
const { userAgent, platform, maxTouchPoints } = getDeviceInfo();
|
|
27
|
+
if (!userAgent) return "desktop";
|
|
28
|
+
const ua = userAgent.toLowerCase();
|
|
29
|
+
if (/iphone|ipad|ipod/.test(ua) || platform === "MacIntel" && maxTouchPoints > 1) return "ios";
|
|
30
|
+
if (/android/.test(ua)) return "android";
|
|
31
|
+
return "desktop";
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
//#endregion
|
|
35
|
+
//#region src/internal/permissions/permissionServices.ts
|
|
36
|
+
/**
|
|
37
|
+
* Checks the current camera permission state without prompting the user.
|
|
38
|
+
*/
|
|
39
|
+
async function checkPermission() {
|
|
40
|
+
return queryCameraPermission();
|
|
41
|
+
}
|
|
42
|
+
/**
|
|
43
|
+
* Requests motion sensor permission. Must be called during a user gesture on iOS.
|
|
44
|
+
* Returns the permission result.
|
|
45
|
+
*/
|
|
46
|
+
async function requestMotionPermission() {
|
|
47
|
+
return new MotionSensorProvider().requestPermission();
|
|
48
|
+
}
|
|
49
|
+
/**
|
|
50
|
+
* Requests camera permission by attempting to access the camera, then immediately
|
|
51
|
+
* stops the obtained stream. Also requests motion sensor permission (required on iOS
|
|
52
|
+
* to be called during a user gesture). This function does not keep or return the stream.
|
|
53
|
+
*/
|
|
54
|
+
async function requestPermission() {
|
|
55
|
+
try {
|
|
56
|
+
await requestMotionPermission();
|
|
57
|
+
stopCameraStream(await requestCameraAccess({ video: true }));
|
|
58
|
+
return "granted";
|
|
59
|
+
} catch (error) {
|
|
60
|
+
const name = error instanceof Error ? error.name : void 0;
|
|
61
|
+
if (name === "NotAllowedError" || name === "PermissionDeniedError") return "denied";
|
|
62
|
+
return "prompt";
|
|
63
|
+
}
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
//#endregion
|
|
67
|
+
//#region src/internal/recordings/recordingsRepository.ts
|
|
68
|
+
async function createRecordingSession(type) {
|
|
69
|
+
return (await api.post(endpoints.recordingCreateSessionV2, { type })).data;
|
|
70
|
+
}
|
|
71
|
+
async function startRecording(params) {
|
|
72
|
+
return (await api.post(endpoints.recordingStartV2, {
|
|
73
|
+
videoRecordingId: params.videoRecordingId,
|
|
74
|
+
frameRate: 30,
|
|
75
|
+
outputMode: "COMPOSED",
|
|
76
|
+
resolution: params.resolution,
|
|
77
|
+
type: params.type,
|
|
78
|
+
hasAudio: params.hasAudio ?? false
|
|
79
|
+
})).data;
|
|
80
|
+
}
|
|
81
|
+
async function stopRecording(videoRecordingId) {
|
|
82
|
+
return (await api.post(endpoints.recordingStopV2, { videoRecordingId })).data;
|
|
83
|
+
}
|
|
84
|
+
async function uploadDeepsightVideo(encryptedVideo, token) {
|
|
85
|
+
try {
|
|
86
|
+
return (await api.post(endpoints.deepsightVideoImport, {
|
|
87
|
+
video: encryptedVideo,
|
|
88
|
+
type: "selfie"
|
|
89
|
+
}, { headers: { "X-Incode-Hardware-Id": token } })).data.recordingId ?? "";
|
|
90
|
+
} catch (error) {
|
|
91
|
+
console.error("Error uploading deepsight video:", error);
|
|
92
|
+
return "";
|
|
93
|
+
}
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
//#endregion
|
|
97
|
+
//#region src/internal/recordings/streamingEvents.ts
|
|
98
|
+
const streamingEvents = {
|
|
99
|
+
strSessionDidConnect: "strSessionDidConnect",
|
|
100
|
+
strSessionDidDisconnect: "strSessionDidDisconnect",
|
|
101
|
+
strSessionDidFailWithError: "strSessionDidFailWithError",
|
|
102
|
+
strStreamVideoCaptureStart: "strStreamVideoCaptureStart",
|
|
103
|
+
strStreamVideoCaptureStop: "strStreamVideoCaptureStop",
|
|
104
|
+
strStreamPublisherCreated: "strStreamPublisherCreated",
|
|
105
|
+
strStreamPublisherDestroyed: "strStreamPublisherDestroyed",
|
|
106
|
+
strStreamPublisherDidFailWithError: "strStreamPublisherDidFailWithError"
|
|
107
|
+
};
|
|
108
|
+
|
|
109
|
+
//#endregion
|
|
110
|
+
//#region src/internal/camera/backCameraStream.ts
|
|
111
|
+
const BACK_CAMERA_KEYWORDS = [
|
|
112
|
+
"rear",
|
|
113
|
+
"back",
|
|
114
|
+
"rück",
|
|
115
|
+
"arrière",
|
|
116
|
+
"trasera",
|
|
117
|
+
"trás",
|
|
118
|
+
"traseira",
|
|
119
|
+
"posteriore",
|
|
120
|
+
"后面",
|
|
121
|
+
"後面",
|
|
122
|
+
"背面",
|
|
123
|
+
"后置",
|
|
124
|
+
"後置",
|
|
125
|
+
"背置",
|
|
126
|
+
"задней",
|
|
127
|
+
"الخلفية",
|
|
128
|
+
"후",
|
|
129
|
+
"arka",
|
|
130
|
+
"achterzijde",
|
|
131
|
+
"หลัง",
|
|
132
|
+
"baksidan",
|
|
133
|
+
"bagside",
|
|
134
|
+
"sau",
|
|
135
|
+
"bak",
|
|
136
|
+
"tylny",
|
|
137
|
+
"takakamera",
|
|
138
|
+
"belakang",
|
|
139
|
+
"אחורית",
|
|
140
|
+
"πίσω",
|
|
141
|
+
"spate",
|
|
142
|
+
"hátsó",
|
|
143
|
+
"zadní",
|
|
144
|
+
"darrere",
|
|
145
|
+
"zadná",
|
|
146
|
+
"задня",
|
|
147
|
+
"stražnja",
|
|
148
|
+
"बैक"
|
|
149
|
+
];
|
|
150
|
+
function isBackCameraLabel(label) {
|
|
151
|
+
const lowercaseLabel = label.toLowerCase();
|
|
152
|
+
return BACK_CAMERA_KEYWORDS.some((keyword) => lowercaseLabel.includes(keyword));
|
|
153
|
+
}
|
|
154
|
+
function classifyCamera(device, index, totalDevices) {
|
|
155
|
+
let cameraType;
|
|
156
|
+
if (device.label === "") cameraType = totalDevices === 1 || index + 1 <= totalDevices / 2 ? "front" : "back";
|
|
157
|
+
else cameraType = isBackCameraLabel(device.label) ? "back" : "front";
|
|
158
|
+
return {
|
|
159
|
+
deviceId: device.deviceId,
|
|
160
|
+
label: device.label,
|
|
161
|
+
cameraType
|
|
162
|
+
};
|
|
163
|
+
}
|
|
164
|
+
async function getCameras() {
|
|
165
|
+
const videoDevices = await enumerateVideoDevices();
|
|
166
|
+
const cameras = videoDevices.map((d, i) => classifyCamera(d, i, videoDevices.length));
|
|
167
|
+
if (cameras.length > 1 && !cameras.some((c) => c.cameraType === "back")) {
|
|
168
|
+
const resolutions = cameras.map((c) => {
|
|
169
|
+
const match = c.label.match(/\b([0-9]+)MP?\b/i);
|
|
170
|
+
return match ? parseInt(match[1], 10) : NaN;
|
|
171
|
+
});
|
|
172
|
+
let backCameraIndex = cameras.length - 1;
|
|
173
|
+
if (!resolutions.some(isNaN)) backCameraIndex = resolutions.lastIndexOf(Math.max(...resolutions));
|
|
174
|
+
cameras[backCameraIndex].cameraType = "back";
|
|
175
|
+
}
|
|
176
|
+
return cameras;
|
|
177
|
+
}
|
|
178
|
+
function selectMainCameraFromStream(track, cameras) {
|
|
179
|
+
const settings = track.getSettings();
|
|
180
|
+
const activeCamera = cameras.find((c) => c.deviceId === settings.deviceId || c.label !== "" && c.label === track.label);
|
|
181
|
+
if (!activeCamera) return void 0;
|
|
182
|
+
if ((settings.facingMode === "environment" || isBackCameraLabel(track.label)) && cameras.length > 1) {
|
|
183
|
+
cameras.forEach((camera) => {
|
|
184
|
+
if (camera.deviceId === activeCamera.deviceId) camera.cameraType = "back";
|
|
185
|
+
else if (!isBackCameraLabel(camera.label)) camera.cameraType = "front";
|
|
186
|
+
});
|
|
187
|
+
return cameras.filter((c) => c.cameraType === "back").sort((a, b) => a.label.localeCompare(b.label))[0];
|
|
188
|
+
}
|
|
189
|
+
if (cameras.length === 1) return activeCamera;
|
|
190
|
+
}
|
|
191
|
+
function getAndroidVideoConstraints(level) {
|
|
192
|
+
const base = {
|
|
193
|
+
resizeMode: "none",
|
|
194
|
+
facingMode: "environment"
|
|
195
|
+
};
|
|
196
|
+
switch (level) {
|
|
197
|
+
case 0: return {
|
|
198
|
+
...base,
|
|
199
|
+
height: { ideal: 720 },
|
|
200
|
+
aspectRatio: { ideal: 19.5 / 9 }
|
|
201
|
+
};
|
|
202
|
+
case 1: return {
|
|
203
|
+
...base,
|
|
204
|
+
width: {
|
|
205
|
+
min: 3200,
|
|
206
|
+
ideal: 3840,
|
|
207
|
+
max: 4096
|
|
208
|
+
},
|
|
209
|
+
height: {
|
|
210
|
+
min: 1800,
|
|
211
|
+
ideal: 2160,
|
|
212
|
+
max: 2400
|
|
213
|
+
}
|
|
214
|
+
};
|
|
215
|
+
case 2: return {
|
|
216
|
+
...base,
|
|
217
|
+
width: {
|
|
218
|
+
min: 1400,
|
|
219
|
+
ideal: 1920,
|
|
220
|
+
max: 2160
|
|
221
|
+
},
|
|
222
|
+
height: {
|
|
223
|
+
min: 900,
|
|
224
|
+
ideal: 1080,
|
|
225
|
+
max: 1440
|
|
226
|
+
}
|
|
227
|
+
};
|
|
228
|
+
case 3: return {
|
|
229
|
+
...base,
|
|
230
|
+
width: {
|
|
231
|
+
min: 640,
|
|
232
|
+
ideal: 640,
|
|
233
|
+
max: 800
|
|
234
|
+
},
|
|
235
|
+
height: {
|
|
236
|
+
min: 480,
|
|
237
|
+
ideal: 480,
|
|
238
|
+
max: 600
|
|
239
|
+
}
|
|
240
|
+
};
|
|
241
|
+
case 4: return {
|
|
242
|
+
...base,
|
|
243
|
+
width: {
|
|
244
|
+
min: 640,
|
|
245
|
+
ideal: 800,
|
|
246
|
+
max: 960
|
|
247
|
+
},
|
|
248
|
+
height: {
|
|
249
|
+
min: 480,
|
|
250
|
+
ideal: 480,
|
|
251
|
+
max: 480
|
|
252
|
+
}
|
|
253
|
+
};
|
|
254
|
+
default: return {};
|
|
255
|
+
}
|
|
256
|
+
}
|
|
257
|
+
async function getAndroidBackCameraStream(fallbackLevel = 0) {
|
|
258
|
+
if (fallbackLevel > 4) throw new Error("Failed to get camera after all fallback attempts");
|
|
259
|
+
try {
|
|
260
|
+
const initialStream = await requestCameraAccess({ video: getAndroidVideoConstraints(fallbackLevel) });
|
|
261
|
+
const track = initialStream.getVideoTracks()[0];
|
|
262
|
+
const mainCamera = selectMainCameraFromStream(track, await getCameras());
|
|
263
|
+
stopCameraStream(initialStream);
|
|
264
|
+
if (!mainCamera) throw new Error("Could not identify main camera");
|
|
265
|
+
let idealWidth = 1280;
|
|
266
|
+
let idealHeight = 720;
|
|
267
|
+
if (fallbackLevel > 1) {
|
|
268
|
+
const constraints = getAndroidVideoConstraints(fallbackLevel);
|
|
269
|
+
const width = constraints.width;
|
|
270
|
+
const height = constraints.height;
|
|
271
|
+
idealWidth = width?.ideal ?? 1280;
|
|
272
|
+
idealHeight = height?.ideal ?? 720;
|
|
273
|
+
}
|
|
274
|
+
return await requestCameraAccess({ video: {
|
|
275
|
+
deviceId: { exact: mainCamera.deviceId },
|
|
276
|
+
width: { ideal: idealWidth },
|
|
277
|
+
height: { ideal: idealHeight }
|
|
278
|
+
} });
|
|
279
|
+
} catch (error) {
|
|
280
|
+
const errorName = error instanceof Error ? error.name : "UnknownError";
|
|
281
|
+
const nextLevel = Math.min(fallbackLevel + 1, 4);
|
|
282
|
+
if (errorName === "NotReadableError") {
|
|
283
|
+
await sleep(300);
|
|
284
|
+
return getAndroidBackCameraStream(nextLevel);
|
|
285
|
+
}
|
|
286
|
+
if (errorName === "AbortError") {
|
|
287
|
+
await sleep(300);
|
|
288
|
+
return getAndroidBackCameraStream(fallbackLevel);
|
|
289
|
+
}
|
|
290
|
+
return getAndroidBackCameraStream(nextLevel);
|
|
291
|
+
}
|
|
292
|
+
}
|
|
293
|
+
async function applyIOSFocusHack(stream) {
|
|
294
|
+
const videoTrack = stream.getVideoTracks()[0];
|
|
295
|
+
try {
|
|
296
|
+
await applyTrackConstraints(videoTrack, { advanced: [{ focusDistance: 1 }] });
|
|
297
|
+
} catch {}
|
|
298
|
+
}
|
|
299
|
+
function getIOSConstraints() {
|
|
300
|
+
return {
|
|
301
|
+
audio: false,
|
|
302
|
+
video: {
|
|
303
|
+
resizeMode: "none",
|
|
304
|
+
facingMode: "environment",
|
|
305
|
+
height: { ideal: isIPhone14OrHigher() ? 1080 : 720 },
|
|
306
|
+
aspectRatio: { ideal: 19.5 / 9 }
|
|
307
|
+
}
|
|
308
|
+
};
|
|
309
|
+
}
|
|
310
|
+
async function getIOSCameraStream() {
|
|
311
|
+
const stream = await requestCameraAccess(getIOSConstraints());
|
|
312
|
+
await applyIOSFocusHack(stream);
|
|
313
|
+
return stream;
|
|
314
|
+
}
|
|
315
|
+
function getDesktopConstraints(options) {
|
|
316
|
+
const { deviceId } = options;
|
|
317
|
+
return {
|
|
318
|
+
audio: isSafari(),
|
|
319
|
+
video: {
|
|
320
|
+
facingMode: "user",
|
|
321
|
+
deviceId: deviceId ? { exact: deviceId } : void 0,
|
|
322
|
+
height: { ideal: 1080 },
|
|
323
|
+
width: { ideal: 1920 }
|
|
324
|
+
}
|
|
325
|
+
};
|
|
326
|
+
}
|
|
327
|
+
async function getDesktopCameraStream(options) {
|
|
328
|
+
return requestCameraAccess(getDesktopConstraints(options));
|
|
329
|
+
}
|
|
330
|
+
async function getBackCameraStream(deviceId) {
|
|
331
|
+
if (isIOS()) return getIOSCameraStream();
|
|
332
|
+
if (isAndroid()) return getAndroidBackCameraStream(0);
|
|
333
|
+
return getDesktopCameraStream({ deviceId });
|
|
334
|
+
}
|
|
335
|
+
|
|
336
|
+
//#endregion
|
|
337
|
+
export { stopRecording as a, requestPermission as c, startRecording as i, getDeviceClass as l, streamingEvents as n, uploadDeepsightVideo as o, createRecordingSession as r, checkPermission as s, getBackCameraStream as t, getBrowser as u };
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { n as eventModuleNames, r as eventScreenNames, u as screenOpened } from "./events-
|
|
1
|
+
import { n as eventModuleNames, r as eventScreenNames, u as screenOpened } from "./events-mFVnFpqq.esm.js";
|
|
2
2
|
import { E as createManager } from "./src-CKB3MNL0.esm.js";
|
|
3
3
|
import { a as fromPromise, n as setup, o as createActor, r as assign, t as endpoints } from "./endpoints-CAXIQnl3.esm.js";
|
|
4
|
-
import { t as api } from "./api-
|
|
4
|
+
import { t as api } from "./api-Cqrn4bGi.esm.js";
|
|
5
5
|
|
|
6
6
|
//#region src/modules/curp-validation/curpValidationUtils.ts
|
|
7
7
|
const CURP_PATTERN = /^([A-Z][AEIOUX][A-Z]{2}\d{2}(?:0[1-9]|1[0-2])(?:0[1-9]|[12]\d|3[01])[HMX](?:AS|B[CS]|C[CLMSH]|D[FG]|G[TR]|HG|JC|M[CNS]|N[ETL]|OC|PL|Q[TR]|S[PLR]|T[CSL]|VZ|YN|ZS)[B-DF-HJ-NP-TV-Z]{3}[A-Z\d])(\d)$/;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { g as BrowserEnvironmentProvider, l as MotionSensorProvider, r as WasmUtilProvider, s as VisibilityProvider } from "./src-CKB3MNL0.esm.js";
|
|
2
|
-
import { t as createDeepsightService } from "./deepsightService-
|
|
3
|
-
import "./api-
|
|
4
|
-
import "./stats-
|
|
2
|
+
import { t as createDeepsightService } from "./deepsightService-CZC8YaHN.esm.js";
|
|
3
|
+
import "./api-Cqrn4bGi.esm.js";
|
|
4
|
+
import "./stats-C0Z_4KzW.esm.js";
|
|
5
5
|
|
|
6
6
|
//#region src/internal/deepsight/deepsightLoader.ts
|
|
7
7
|
const SDK_VERSION = "2.0.0";
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { A as getUserAgent, O as getDeviceInfo, T as stopCameraStream, b as createHiddenVideoElement, w as requestCameraAccess, x as IncodeCanvas } from "./src-CKB3MNL0.esm.js";
|
|
2
|
-
import { t as api } from "./api-
|
|
3
|
-
import { t as addDeviceStats } from "./stats-
|
|
2
|
+
import { t as api } from "./api-Cqrn4bGi.esm.js";
|
|
3
|
+
import { t as addDeviceStats } from "./stats-C0Z_4KzW.esm.js";
|
|
4
4
|
|
|
5
5
|
//#region src/internal/device/browserSimulation.ts
|
|
6
6
|
const AUTOMATION_MARKERS = {
|
package/dist/email.esm.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { d as addEvent, n as eventModuleNames, r as eventScreenNames } from "./events-
|
|
1
|
+
import { d as addEvent, n as eventModuleNames, r as eventScreenNames } from "./events-mFVnFpqq.esm.js";
|
|
2
2
|
import { E as createManager, p as BrowserTimerProvider } from "./src-CKB3MNL0.esm.js";
|
|
3
3
|
import { a as fromPromise, i as fromCallback, n as setup, o as createActor, r as assign, t as endpoints } from "./endpoints-CAXIQnl3.esm.js";
|
|
4
|
-
import { t as api } from "./api-
|
|
4
|
+
import { t as api } from "./api-Cqrn4bGi.esm.js";
|
|
5
5
|
|
|
6
6
|
//#region src/modules/email/emailServices.ts
|
|
7
7
|
async function fetchEmail(signal) {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { t as endpoints } from "./endpoints-CAXIQnl3.esm.js";
|
|
2
|
-
import { i as isApiConfigured, r as getToken, t as api } from "./api-
|
|
2
|
+
import { i as isApiConfigured, r as getToken, t as api } from "./api-Cqrn4bGi.esm.js";
|
|
3
3
|
|
|
4
4
|
//#region ../infra/src/capabilities/IBrowserEnvironmentCapability.ts
|
|
5
5
|
function getTimestamp() {
|
package/dist/face-match.esm.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { d as addEvent, n as eventModuleNames, r as eventScreenNames } from "./events-
|
|
1
|
+
import { d as addEvent, n as eventModuleNames, r as eventScreenNames } from "./events-mFVnFpqq.esm.js";
|
|
2
2
|
import { E as createManager } from "./src-CKB3MNL0.esm.js";
|
|
3
3
|
import { a as fromPromise, n as setup, o as createActor, r as assign, t as endpoints } from "./endpoints-CAXIQnl3.esm.js";
|
|
4
|
-
import { t as api } from "./api-
|
|
4
|
+
import { t as api } from "./api-Cqrn4bGi.esm.js";
|
|
5
5
|
|
|
6
6
|
//#region src/modules/face-match/faceMatchServices.ts
|
|
7
7
|
/**
|
package/dist/{faceCaptureManagerFactory-1AAwvEWC.d.ts → faceCaptureManagerFactory-DrUCn7LS.d.ts}
RENAMED
|
@@ -150,6 +150,8 @@ type FaceCaptureCaptureState = {
|
|
|
150
150
|
attemptsRemaining: number;
|
|
151
151
|
/** Error message from failed upload */
|
|
152
152
|
uploadError: string | undefined;
|
|
153
|
+
/** Whether assisted onboarding mode is active (back camera, no mirror) */
|
|
154
|
+
assistedOnboarding: boolean;
|
|
153
155
|
};
|
|
154
156
|
/** Processing the captured face */
|
|
155
157
|
type FaceCaptureProcessingState = {
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { d as addEvent, n as eventModuleNames } from "./events-
|
|
1
|
+
import { d as addEvent, n as eventModuleNames } from "./events-mFVnFpqq.esm.js";
|
|
2
|
+
import { a as stopRecording$1, c as requestPermission, i as startRecording, l as getDeviceClass, n as streamingEvents, o as uploadDeepsightVideo, r as createRecordingSession, s as checkPermission, t as getBackCameraStream } from "./backCameraStream-DhKbn3gt.esm.js";
|
|
2
3
|
import { E as createManager, T as stopCameraStream, _ as StreamCanvasProcessingSession, a as FaceDetectionProvider, c as OpenViduRecordingProvider, u as LocalRecordingProvider, v as StreamCanvasCapture, w as requestCameraAccess } from "./src-CKB3MNL0.esm.js";
|
|
3
4
|
import { a as fromPromise, i as fromCallback, n as setup, r as assign, t as endpoints } from "./endpoints-CAXIQnl3.esm.js";
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import { t as addDeviceStats } from "./stats-Bv2CLzQ0.esm.js";
|
|
5
|
+
import { r as getToken, t as api } from "./api-Cqrn4bGi.esm.js";
|
|
6
|
+
import { t as addDeviceStats } from "./stats-C0Z_4KzW.esm.js";
|
|
7
7
|
|
|
8
8
|
//#region src/internal/faceCapture/faceCaptureManagerFactory.ts
|
|
9
9
|
function getPermissionStatus(snapshot) {
|
|
@@ -46,7 +46,8 @@ function mapState(snapshot) {
|
|
|
46
46
|
detectionStatus: context.detectionStatus ?? "idle",
|
|
47
47
|
debugFrame: context.debugFrame,
|
|
48
48
|
attemptsRemaining: context.attemptsRemaining ?? 0,
|
|
49
|
-
uploadError: context.uploadError
|
|
49
|
+
uploadError: context.uploadError,
|
|
50
|
+
assistedOnboarding: context.config?.assistedOnboarding ?? false
|
|
50
51
|
};
|
|
51
52
|
if (snapshot.matches("processing")) return { status: "processing" };
|
|
52
53
|
if (snapshot.matches("finished")) return {
|
|
@@ -214,7 +215,7 @@ async function initializeCamera(params) {
|
|
|
214
215
|
});
|
|
215
216
|
await params.deepsightService.performPrcCheck({ constraints: { video: CAMERA_CONSTRAINTS.video } });
|
|
216
217
|
return {
|
|
217
|
-
stream: await requestCameraAccess({
|
|
218
|
+
stream: config.assistedOnboarding ? await getBackCameraStream() : await requestCameraAccess({
|
|
218
219
|
video: CAMERA_CONSTRAINTS.video,
|
|
219
220
|
audio: false
|
|
220
221
|
}),
|
|
@@ -444,7 +445,7 @@ function stopRecording(session) {
|
|
|
444
445
|
})();
|
|
445
446
|
}
|
|
446
447
|
async function initializeDeepsightSession(options) {
|
|
447
|
-
const { loadDeepsightSession } = await import("./deepsightLoader-
|
|
448
|
+
const { loadDeepsightSession } = await import("./deepsightLoader-DRQJKHl8.esm.js");
|
|
448
449
|
return loadDeepsightSession({
|
|
449
450
|
ds: options.ds,
|
|
450
451
|
storage: options.storage
|
package/dist/flow.esm.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { E as createManager } from "./src-CKB3MNL0.esm.js";
|
|
2
2
|
import { a as fromPromise, i as fromCallback, n as setup, o as createActor, r as assign, t as endpoints } from "./endpoints-CAXIQnl3.esm.js";
|
|
3
|
-
import { t as api } from "./api-
|
|
3
|
+
import { t as api } from "./api-Cqrn4bGi.esm.js";
|
|
4
4
|
|
|
5
5
|
//#region src/modules/flow/flowUtils.ts
|
|
6
6
|
const WASM_MODULE_PIPELINES = {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { E as createManager, p as BrowserTimerProvider } from "./src-CKB3MNL0.esm.js";
|
|
2
2
|
import { a as fromPromise, i as fromCallback, n as setup, o as createActor, r as assign, t as endpoints } from "./endpoints-CAXIQnl3.esm.js";
|
|
3
|
-
import { t as api } from "./api-
|
|
3
|
+
import { t as api } from "./api-Cqrn4bGi.esm.js";
|
|
4
4
|
|
|
5
5
|
//#region src/modules/government-validation/governmentValidationServices.ts
|
|
6
6
|
async function processGovernmentValidation(signal) {
|
|
@@ -1,17 +1,11 @@
|
|
|
1
|
-
import { d as addEvent, m as revokeObjectURL, n as eventModuleNames } from "./events-
|
|
2
|
-
import {
|
|
1
|
+
import { d as addEvent, m as revokeObjectURL, n as eventModuleNames } from "./events-mFVnFpqq.esm.js";
|
|
2
|
+
import { a as stopRecording$1, c as requestPermission, i as startRecording, l as getDeviceClass, n as streamingEvents, r as createRecordingSession, s as checkPermission, t as getBackCameraStream } from "./backCameraStream-DhKbn3gt.esm.js";
|
|
3
|
+
import { E as createManager, M as isDesktop, _ as StreamCanvasProcessingSession, c as OpenViduRecordingProvider, d as IpifyProvider, f as FingerprintProvider, g as BrowserEnvironmentProvider, h as BrowserInfoProvider, k as getWindowDimensions, m as BrowserStorageProvider, n as DEFAULT_ID_CAPTURE_THRESHOLDS, p as BrowserTimerProvider, t as DEFAULT_ID_CAPTURE_MODEL_VERSION, v as StreamCanvasCapture, x as IncodeCanvas } from "./src-CKB3MNL0.esm.js";
|
|
3
4
|
import { a as fromPromise, i as fromCallback, n as setup, o as createActor, r as assign, t as endpoints } from "./endpoints-CAXIQnl3.esm.js";
|
|
4
|
-
import {
|
|
5
|
-
import { n as
|
|
6
|
-
import {
|
|
7
|
-
import { t as addDeviceStats } from "./stats-Bv2CLzQ0.esm.js";
|
|
5
|
+
import { n as isBrowserSimulation } from "./deepsightService-CZC8YaHN.esm.js";
|
|
6
|
+
import { n as getApi, r as getToken, t as api } from "./api-Cqrn4bGi.esm.js";
|
|
7
|
+
import { t as addDeviceStats } from "./stats-C0Z_4KzW.esm.js";
|
|
8
8
|
|
|
9
|
-
//#region ../infra/src/capabilities/ITimerCapability.ts
|
|
10
|
-
function sleep(ms) {
|
|
11
|
-
return new Promise((resolve) => setTimeout(resolve, ms));
|
|
12
|
-
}
|
|
13
|
-
|
|
14
|
-
//#endregion
|
|
15
9
|
//#region src/internal/session/sessionService.ts
|
|
16
10
|
/**
|
|
17
11
|
* Creates a new onboarding session.
|
|
@@ -258,230 +252,8 @@ async function postDeviceStats(stats) {
|
|
|
258
252
|
|
|
259
253
|
//#endregion
|
|
260
254
|
//#region src/modules/id/idCameraStream.ts
|
|
261
|
-
const BACK_CAMERA_KEYWORDS = [
|
|
262
|
-
"rear",
|
|
263
|
-
"back",
|
|
264
|
-
"rück",
|
|
265
|
-
"arrière",
|
|
266
|
-
"trasera",
|
|
267
|
-
"trás",
|
|
268
|
-
"traseira",
|
|
269
|
-
"posteriore",
|
|
270
|
-
"后面",
|
|
271
|
-
"後面",
|
|
272
|
-
"背面",
|
|
273
|
-
"后置",
|
|
274
|
-
"後置",
|
|
275
|
-
"背置",
|
|
276
|
-
"задней",
|
|
277
|
-
"الخلفية",
|
|
278
|
-
"후",
|
|
279
|
-
"arka",
|
|
280
|
-
"achterzijde",
|
|
281
|
-
"หลัง",
|
|
282
|
-
"baksidan",
|
|
283
|
-
"bagside",
|
|
284
|
-
"sau",
|
|
285
|
-
"bak",
|
|
286
|
-
"tylny",
|
|
287
|
-
"takakamera",
|
|
288
|
-
"belakang",
|
|
289
|
-
"אחורית",
|
|
290
|
-
"πίσω",
|
|
291
|
-
"spate",
|
|
292
|
-
"hátsó",
|
|
293
|
-
"zadní",
|
|
294
|
-
"darrere",
|
|
295
|
-
"zadná",
|
|
296
|
-
"задня",
|
|
297
|
-
"stražnja",
|
|
298
|
-
"बैक"
|
|
299
|
-
];
|
|
300
|
-
function isBackCameraLabel(label) {
|
|
301
|
-
const lowercaseLabel = label.toLowerCase();
|
|
302
|
-
return BACK_CAMERA_KEYWORDS.some((keyword) => lowercaseLabel.includes(keyword));
|
|
303
|
-
}
|
|
304
|
-
function classifyCamera(device, index, totalDevices) {
|
|
305
|
-
let cameraType;
|
|
306
|
-
if (device.label === "") cameraType = totalDevices === 1 || index + 1 <= totalDevices / 2 ? "front" : "back";
|
|
307
|
-
else cameraType = isBackCameraLabel(device.label) ? "back" : "front";
|
|
308
|
-
return {
|
|
309
|
-
deviceId: device.deviceId,
|
|
310
|
-
label: device.label,
|
|
311
|
-
cameraType
|
|
312
|
-
};
|
|
313
|
-
}
|
|
314
|
-
async function getCameras() {
|
|
315
|
-
const videoDevices = await enumerateVideoDevices();
|
|
316
|
-
const cameras = videoDevices.map((d, i) => classifyCamera(d, i, videoDevices.length));
|
|
317
|
-
if (cameras.length > 1 && !cameras.some((c) => c.cameraType === "back")) {
|
|
318
|
-
const resolutions = cameras.map((c) => {
|
|
319
|
-
const match = c.label.match(/\b([0-9]+)MP?\b/i);
|
|
320
|
-
return match ? parseInt(match[1], 10) : NaN;
|
|
321
|
-
});
|
|
322
|
-
let backCameraIndex = cameras.length - 1;
|
|
323
|
-
if (!resolutions.some(isNaN)) backCameraIndex = resolutions.lastIndexOf(Math.max(...resolutions));
|
|
324
|
-
cameras[backCameraIndex].cameraType = "back";
|
|
325
|
-
}
|
|
326
|
-
return cameras;
|
|
327
|
-
}
|
|
328
|
-
function selectMainCameraFromStream(track, cameras) {
|
|
329
|
-
const settings = track.getSettings();
|
|
330
|
-
const activeCamera = cameras.find((c) => c.deviceId === settings.deviceId || c.label !== "" && c.label === track.label);
|
|
331
|
-
if (!activeCamera) return void 0;
|
|
332
|
-
if ((settings.facingMode === "environment" || isBackCameraLabel(track.label)) && cameras.length > 1) {
|
|
333
|
-
cameras.forEach((camera) => {
|
|
334
|
-
if (camera.deviceId === activeCamera.deviceId) camera.cameraType = "back";
|
|
335
|
-
else if (!isBackCameraLabel(camera.label)) camera.cameraType = "front";
|
|
336
|
-
});
|
|
337
|
-
return cameras.filter((c) => c.cameraType === "back").sort((a, b) => a.label.localeCompare(b.label))[0];
|
|
338
|
-
}
|
|
339
|
-
if (cameras.length === 1) return activeCamera;
|
|
340
|
-
}
|
|
341
|
-
function getAndroidVideoConstraints(level) {
|
|
342
|
-
const base = {
|
|
343
|
-
resizeMode: "none",
|
|
344
|
-
facingMode: "environment"
|
|
345
|
-
};
|
|
346
|
-
switch (level) {
|
|
347
|
-
case 0: return {
|
|
348
|
-
...base,
|
|
349
|
-
height: { ideal: 720 },
|
|
350
|
-
aspectRatio: { ideal: 19.5 / 9 }
|
|
351
|
-
};
|
|
352
|
-
case 1: return {
|
|
353
|
-
...base,
|
|
354
|
-
width: {
|
|
355
|
-
min: 3200,
|
|
356
|
-
ideal: 3840,
|
|
357
|
-
max: 4096
|
|
358
|
-
},
|
|
359
|
-
height: {
|
|
360
|
-
min: 1800,
|
|
361
|
-
ideal: 2160,
|
|
362
|
-
max: 2400
|
|
363
|
-
}
|
|
364
|
-
};
|
|
365
|
-
case 2: return {
|
|
366
|
-
...base,
|
|
367
|
-
width: {
|
|
368
|
-
min: 1400,
|
|
369
|
-
ideal: 1920,
|
|
370
|
-
max: 2160
|
|
371
|
-
},
|
|
372
|
-
height: {
|
|
373
|
-
min: 900,
|
|
374
|
-
ideal: 1080,
|
|
375
|
-
max: 1440
|
|
376
|
-
}
|
|
377
|
-
};
|
|
378
|
-
case 3: return {
|
|
379
|
-
...base,
|
|
380
|
-
width: {
|
|
381
|
-
min: 640,
|
|
382
|
-
ideal: 640,
|
|
383
|
-
max: 800
|
|
384
|
-
},
|
|
385
|
-
height: {
|
|
386
|
-
min: 480,
|
|
387
|
-
ideal: 480,
|
|
388
|
-
max: 600
|
|
389
|
-
}
|
|
390
|
-
};
|
|
391
|
-
case 4: return {
|
|
392
|
-
...base,
|
|
393
|
-
width: {
|
|
394
|
-
min: 640,
|
|
395
|
-
ideal: 800,
|
|
396
|
-
max: 960
|
|
397
|
-
},
|
|
398
|
-
height: {
|
|
399
|
-
min: 480,
|
|
400
|
-
ideal: 480,
|
|
401
|
-
max: 480
|
|
402
|
-
}
|
|
403
|
-
};
|
|
404
|
-
default: return {};
|
|
405
|
-
}
|
|
406
|
-
}
|
|
407
|
-
async function getAndroidBackCameraStream(fallbackLevel = 0) {
|
|
408
|
-
if (fallbackLevel > 4) throw new Error("Failed to get camera after all fallback attempts");
|
|
409
|
-
try {
|
|
410
|
-
const initialStream = await requestCameraAccess({ video: getAndroidVideoConstraints(fallbackLevel) });
|
|
411
|
-
const track = initialStream.getVideoTracks()[0];
|
|
412
|
-
const mainCamera = selectMainCameraFromStream(track, await getCameras());
|
|
413
|
-
stopCameraStream(initialStream);
|
|
414
|
-
if (!mainCamera) throw new Error("Could not identify main camera");
|
|
415
|
-
let idealWidth = 1280;
|
|
416
|
-
let idealHeight = 720;
|
|
417
|
-
if (fallbackLevel > 1) {
|
|
418
|
-
const constraints = getAndroidVideoConstraints(fallbackLevel);
|
|
419
|
-
const width = constraints.width;
|
|
420
|
-
const height = constraints.height;
|
|
421
|
-
idealWidth = width?.ideal ?? 1280;
|
|
422
|
-
idealHeight = height?.ideal ?? 720;
|
|
423
|
-
}
|
|
424
|
-
return await requestCameraAccess({ video: {
|
|
425
|
-
deviceId: { exact: mainCamera.deviceId },
|
|
426
|
-
width: { ideal: idealWidth },
|
|
427
|
-
height: { ideal: idealHeight }
|
|
428
|
-
} });
|
|
429
|
-
} catch (error) {
|
|
430
|
-
const errorName = error instanceof Error ? error.name : "UnknownError";
|
|
431
|
-
const nextLevel = Math.min(fallbackLevel + 1, 4);
|
|
432
|
-
if (errorName === "NotReadableError") {
|
|
433
|
-
await sleep(300);
|
|
434
|
-
return getAndroidBackCameraStream(nextLevel);
|
|
435
|
-
}
|
|
436
|
-
if (errorName === "AbortError") {
|
|
437
|
-
await sleep(300);
|
|
438
|
-
return getAndroidBackCameraStream(fallbackLevel);
|
|
439
|
-
}
|
|
440
|
-
return getAndroidBackCameraStream(nextLevel);
|
|
441
|
-
}
|
|
442
|
-
}
|
|
443
|
-
async function applyIOSFocusHack(stream) {
|
|
444
|
-
const videoTrack = stream.getVideoTracks()[0];
|
|
445
|
-
try {
|
|
446
|
-
await applyTrackConstraints(videoTrack, { advanced: [{ focusDistance: 1 }] });
|
|
447
|
-
} catch {}
|
|
448
|
-
}
|
|
449
|
-
function getIOSConstraints() {
|
|
450
|
-
return {
|
|
451
|
-
audio: false,
|
|
452
|
-
video: {
|
|
453
|
-
resizeMode: "none",
|
|
454
|
-
facingMode: "environment",
|
|
455
|
-
height: { ideal: isIPhone14OrHigher() ? 1080 : 720 },
|
|
456
|
-
aspectRatio: { ideal: 19.5 / 9 }
|
|
457
|
-
}
|
|
458
|
-
};
|
|
459
|
-
}
|
|
460
|
-
async function getIOSCameraStream() {
|
|
461
|
-
const stream = await requestCameraAccess(getIOSConstraints());
|
|
462
|
-
await applyIOSFocusHack(stream);
|
|
463
|
-
return stream;
|
|
464
|
-
}
|
|
465
|
-
function getDesktopConstraints(options) {
|
|
466
|
-
const { deviceId } = options;
|
|
467
|
-
return {
|
|
468
|
-
audio: isSafari(),
|
|
469
|
-
video: {
|
|
470
|
-
facingMode: "user",
|
|
471
|
-
deviceId: deviceId ? { exact: deviceId } : void 0,
|
|
472
|
-
height: { ideal: 1080 },
|
|
473
|
-
width: { ideal: 1920 }
|
|
474
|
-
}
|
|
475
|
-
};
|
|
476
|
-
}
|
|
477
|
-
async function getDesktopCameraStream(options) {
|
|
478
|
-
return requestCameraAccess(getDesktopConstraints(options));
|
|
479
|
-
}
|
|
480
255
|
async function getIdCameraStream(deviceId) {
|
|
481
|
-
|
|
482
|
-
if (isAndroid()) return getAndroidBackCameraStream(0);
|
|
483
|
-
if (isDesktop()) return getDesktopCameraStream({ deviceId });
|
|
484
|
-
return getDesktopCameraStream({ deviceId });
|
|
256
|
+
return getBackCameraStream(deviceId);
|
|
485
257
|
}
|
|
486
258
|
|
|
487
259
|
//#endregion
|
|
@@ -1125,7 +897,7 @@ const checkMotionSensorActor = fromCallback(({ input, sendBack }) => {
|
|
|
1125
897
|
});
|
|
1126
898
|
const initializeDeepsightSessionActor = fromPromise(async ({ input }) => {
|
|
1127
899
|
if (!input.dependencies) return;
|
|
1128
|
-
const { loadDeepsightSession } = await import("./deepsightLoader-
|
|
900
|
+
const { loadDeepsightSession } = await import("./deepsightLoader-DRQJKHl8.esm.js");
|
|
1129
901
|
return loadDeepsightSession({
|
|
1130
902
|
ds: input.ds,
|
|
1131
903
|
storage: input.dependencies.storage,
|
package/dist/id.esm.js
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import "./events-
|
|
2
|
-
import
|
|
1
|
+
import "./events-mFVnFpqq.esm.js";
|
|
2
|
+
import "./backCameraStream-DhKbn3gt.esm.js";
|
|
3
3
|
import { i as IdCaptureProvider } from "./src-CKB3MNL0.esm.js";
|
|
4
4
|
import "./endpoints-CAXIQnl3.esm.js";
|
|
5
|
-
import "./
|
|
6
|
-
import "./
|
|
7
|
-
import "./
|
|
8
|
-
import "./stats-
|
|
5
|
+
import "./deepsightService-CZC8YaHN.esm.js";
|
|
6
|
+
import "./api-Cqrn4bGi.esm.js";
|
|
7
|
+
import { a as processId, c as stopStream, d as ID_ERROR_CODES, i as initializeIdCapture, l as uploadIdImage, n as createIdCaptureActor, o as startRecordingSession, r as idCaptureMachine, s as stopRecording, t as createIdCaptureManager, u as validateUploadResponse } from "./id-DZsKpBfe.esm.js";
|
|
8
|
+
import "./stats-C0Z_4KzW.esm.js";
|
|
9
9
|
|
|
10
10
|
export { ID_ERROR_CODES, IdCaptureProvider, createIdCaptureActor, createIdCaptureManager, idCaptureMachine, initializeIdCapture, processId, startRecordingSession, stopRecording, stopStream, uploadIdImage, validateUploadResponse };
|
package/dist/index.esm.js
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import { a as videoSelfieEvents, c as screenClosed, d as addEvent, f as flushEventQueue, i as tutorialScreenNamesMapper, l as screenEvent, n as eventModuleNames, o as moduleClosed, p as subscribeEvent, r as eventScreenNames, s as moduleOpened, t as cameraScreenNamesMapper, u as screenOpened } from "./events-
|
|
2
|
-
import {
|
|
1
|
+
import { a as videoSelfieEvents, c as screenClosed, d as addEvent, f as flushEventQueue, i as tutorialScreenNamesMapper, l as screenEvent, n as eventModuleNames, o as moduleClosed, p as subscribeEvent, r as eventScreenNames, s as moduleOpened, t as cameraScreenNamesMapper, u as screenOpened } from "./events-mFVnFpqq.esm.js";
|
|
2
|
+
import { c as requestPermission, l as getDeviceClass, s as checkPermission, u as getBrowser } from "./backCameraStream-DhKbn3gt.esm.js";
|
|
3
3
|
import { D as createApi_default, i as IdCaptureProvider, o as warmupWasm, r as WasmUtilProvider } from "./src-CKB3MNL0.esm.js";
|
|
4
4
|
import "./endpoints-CAXIQnl3.esm.js";
|
|
5
|
-
import
|
|
6
|
-
import "./
|
|
7
|
-
import { a as
|
|
8
|
-
import "./stats-
|
|
5
|
+
import "./deepsightService-CZC8YaHN.esm.js";
|
|
6
|
+
import { a as resetApi, n as getApi, o as setClient, s as setToken, t as api } from "./api-Cqrn4bGi.esm.js";
|
|
7
|
+
import { _ as createSession, a as processId, c as stopStream, d as ID_ERROR_CODES, f as getDisableIpify, g as resetSessionInit, h as isSessionInitialized, i as initializeIdCapture, l as uploadIdImage, m as initializeSession, n as createIdCaptureActor, o as startRecordingSession, p as getSessionFeatures, r as idCaptureMachine, s as stopRecording, t as createIdCaptureManager, u as validateUploadResponse } from "./id-DZsKpBfe.esm.js";
|
|
8
|
+
import "./stats-C0Z_4KzW.esm.js";
|
|
9
9
|
|
|
10
10
|
//#region src/setup.ts
|
|
11
11
|
let wasmConfig;
|
package/dist/phone.esm.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { d as addEvent, n as eventModuleNames, r as eventScreenNames } from "./events-
|
|
1
|
+
import { d as addEvent, n as eventModuleNames, r as eventScreenNames } from "./events-mFVnFpqq.esm.js";
|
|
2
2
|
import { E as createManager, p as BrowserTimerProvider } from "./src-CKB3MNL0.esm.js";
|
|
3
3
|
import { a as fromPromise, i as fromCallback, n as setup, o as createActor, r as assign, t as endpoints } from "./endpoints-CAXIQnl3.esm.js";
|
|
4
|
-
import { t as api } from "./api-
|
|
4
|
+
import { t as api } from "./api-Cqrn4bGi.esm.js";
|
|
5
5
|
|
|
6
6
|
//#region src/modules/phone/phoneServices.ts
|
|
7
7
|
async function fetchPhone(signal) {
|
package/dist/selfie.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { a as IncodeCanvas, n as BaseWasmProvider, r as StreamCanvasCapture, t as DeepsightService } from "./deepsightService-B3FfuHt1.js";
|
|
2
2
|
import { c as MLProviderConfig, n as PermissionStatus, r as CameraStream, s as IMLProviderCapability, t as PermissionResult } from "./types-Dl8aaniO.js";
|
|
3
3
|
import { n as StateMachine, t as AnyStateMachine } from "./StateMachine-CvjqRbSg.js";
|
|
4
|
-
import { a as FaceCaptureDependencies, i as DetectionStatus, n as FaceCaptureManagerState, o as FaceErrorCode, r as BaseFaceCaptureConfig, t as FaceCaptureManager } from "./faceCaptureManagerFactory-
|
|
4
|
+
import { a as FaceCaptureDependencies, i as DetectionStatus, n as FaceCaptureManagerState, o as FaceErrorCode, r as BaseFaceCaptureConfig, t as FaceCaptureManager } from "./faceCaptureManagerFactory-DrUCn7LS.js";
|
|
5
5
|
import { t as Manager } from "./Manager-DZLpIRan.js";
|
|
6
6
|
import { r as FlowModuleConfig } from "./types-DFgUJtIJ.js";
|
|
7
7
|
|
package/dist/selfie.esm.js
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import { d as addEvent, n as eventModuleNames } from "./events-
|
|
1
|
+
import { d as addEvent, n as eventModuleNames } from "./events-mFVnFpqq.esm.js";
|
|
2
|
+
import "./backCameraStream-DhKbn3gt.esm.js";
|
|
2
3
|
import { m as BrowserStorageProvider, r as WasmUtilProvider } from "./src-CKB3MNL0.esm.js";
|
|
3
4
|
import { a as fromPromise, o as createActor, r as assign } from "./endpoints-CAXIQnl3.esm.js";
|
|
4
|
-
import "./
|
|
5
|
-
import "./
|
|
6
|
-
import "./
|
|
7
|
-
import "./
|
|
8
|
-
import { a as FACE_ERROR_CODES, i as uploadSelfie, n as faceCaptureMachine, o as createFaceCaptureManager, r as processFace, t as FACE_CAPTURE_EVENT_CODES } from "./faceCaptureSetup-Cz44Uo-J.esm.js";
|
|
5
|
+
import "./deepsightService-CZC8YaHN.esm.js";
|
|
6
|
+
import "./api-Cqrn4bGi.esm.js";
|
|
7
|
+
import "./stats-C0Z_4KzW.esm.js";
|
|
8
|
+
import { a as FACE_ERROR_CODES, i as uploadSelfie, n as faceCaptureMachine, o as createFaceCaptureManager, r as processFace, t as FACE_CAPTURE_EVENT_CODES } from "./faceCaptureSetup-Bxot-Bxs.esm.js";
|
|
9
9
|
|
|
10
10
|
//#region src/modules/selfie/selfieErrorUtils.ts
|
|
11
11
|
const FACE_ERROR_CODE_VALUES = Object.values(FACE_ERROR_CODES);
|
package/dist/stats.esm.js
CHANGED
package/package.json
CHANGED
|
@@ -1,104 +0,0 @@
|
|
|
1
|
-
import { A as getUserAgent, O as getDeviceInfo, T as stopCameraStream, l as MotionSensorProvider, w as requestCameraAccess, y as queryCameraPermission } from "./src-CKB3MNL0.esm.js";
|
|
2
|
-
import { t as endpoints } from "./endpoints-CAXIQnl3.esm.js";
|
|
3
|
-
import { t as api } from "./api-CmRbOLxk.esm.js";
|
|
4
|
-
|
|
5
|
-
//#region src/internal/device/getBrowser.ts
|
|
6
|
-
function getBrowser() {
|
|
7
|
-
const userAgent = getUserAgent();
|
|
8
|
-
if (!userAgent) return "other";
|
|
9
|
-
const ua = userAgent.toLowerCase();
|
|
10
|
-
if (ua.includes("edg/")) return "edge";
|
|
11
|
-
if (ua.includes("chrome") && !ua.includes("edg/")) return "chrome";
|
|
12
|
-
if (ua.includes("firefox")) return "firefox";
|
|
13
|
-
if (ua.includes("safari") && !ua.includes("chrome")) return "safari";
|
|
14
|
-
return "other";
|
|
15
|
-
}
|
|
16
|
-
|
|
17
|
-
//#endregion
|
|
18
|
-
//#region src/internal/device/getDeviceClass.ts
|
|
19
|
-
function getDeviceClass() {
|
|
20
|
-
const { userAgent, platform, maxTouchPoints } = getDeviceInfo();
|
|
21
|
-
if (!userAgent) return "desktop";
|
|
22
|
-
const ua = userAgent.toLowerCase();
|
|
23
|
-
if (/iphone|ipad|ipod/.test(ua) || platform === "MacIntel" && maxTouchPoints > 1) return "ios";
|
|
24
|
-
if (/android/.test(ua)) return "android";
|
|
25
|
-
return "desktop";
|
|
26
|
-
}
|
|
27
|
-
|
|
28
|
-
//#endregion
|
|
29
|
-
//#region src/internal/permissions/permissionServices.ts
|
|
30
|
-
/**
|
|
31
|
-
* Checks the current camera permission state without prompting the user.
|
|
32
|
-
*/
|
|
33
|
-
async function checkPermission() {
|
|
34
|
-
return queryCameraPermission();
|
|
35
|
-
}
|
|
36
|
-
/**
|
|
37
|
-
* Requests motion sensor permission. Must be called during a user gesture on iOS.
|
|
38
|
-
* Returns the permission result.
|
|
39
|
-
*/
|
|
40
|
-
async function requestMotionPermission() {
|
|
41
|
-
return new MotionSensorProvider().requestPermission();
|
|
42
|
-
}
|
|
43
|
-
/**
|
|
44
|
-
* Requests camera permission by attempting to access the camera, then immediately
|
|
45
|
-
* stops the obtained stream. Also requests motion sensor permission (required on iOS
|
|
46
|
-
* to be called during a user gesture). This function does not keep or return the stream.
|
|
47
|
-
*/
|
|
48
|
-
async function requestPermission() {
|
|
49
|
-
try {
|
|
50
|
-
await requestMotionPermission();
|
|
51
|
-
stopCameraStream(await requestCameraAccess({ video: true }));
|
|
52
|
-
return "granted";
|
|
53
|
-
} catch (error) {
|
|
54
|
-
const name = error instanceof Error ? error.name : void 0;
|
|
55
|
-
if (name === "NotAllowedError" || name === "PermissionDeniedError") return "denied";
|
|
56
|
-
return "prompt";
|
|
57
|
-
}
|
|
58
|
-
}
|
|
59
|
-
|
|
60
|
-
//#endregion
|
|
61
|
-
//#region src/internal/recordings/recordingsRepository.ts
|
|
62
|
-
async function createRecordingSession(type) {
|
|
63
|
-
return (await api.post(endpoints.recordingCreateSessionV2, { type })).data;
|
|
64
|
-
}
|
|
65
|
-
async function startRecording(params) {
|
|
66
|
-
return (await api.post(endpoints.recordingStartV2, {
|
|
67
|
-
videoRecordingId: params.videoRecordingId,
|
|
68
|
-
frameRate: 30,
|
|
69
|
-
outputMode: "COMPOSED",
|
|
70
|
-
resolution: params.resolution,
|
|
71
|
-
type: params.type,
|
|
72
|
-
hasAudio: params.hasAudio ?? false
|
|
73
|
-
})).data;
|
|
74
|
-
}
|
|
75
|
-
async function stopRecording(videoRecordingId) {
|
|
76
|
-
return (await api.post(endpoints.recordingStopV2, { videoRecordingId })).data;
|
|
77
|
-
}
|
|
78
|
-
async function uploadDeepsightVideo(encryptedVideo, token) {
|
|
79
|
-
try {
|
|
80
|
-
return (await api.post(endpoints.deepsightVideoImport, {
|
|
81
|
-
video: encryptedVideo,
|
|
82
|
-
type: "selfie"
|
|
83
|
-
}, { headers: { "X-Incode-Hardware-Id": token } })).data.recordingId ?? "";
|
|
84
|
-
} catch (error) {
|
|
85
|
-
console.error("Error uploading deepsight video:", error);
|
|
86
|
-
return "";
|
|
87
|
-
}
|
|
88
|
-
}
|
|
89
|
-
|
|
90
|
-
//#endregion
|
|
91
|
-
//#region src/internal/recordings/streamingEvents.ts
|
|
92
|
-
const streamingEvents = {
|
|
93
|
-
strSessionDidConnect: "strSessionDidConnect",
|
|
94
|
-
strSessionDidDisconnect: "strSessionDidDisconnect",
|
|
95
|
-
strSessionDidFailWithError: "strSessionDidFailWithError",
|
|
96
|
-
strStreamVideoCaptureStart: "strStreamVideoCaptureStart",
|
|
97
|
-
strStreamVideoCaptureStop: "strStreamVideoCaptureStop",
|
|
98
|
-
strStreamPublisherCreated: "strStreamPublisherCreated",
|
|
99
|
-
strStreamPublisherDestroyed: "strStreamPublisherDestroyed",
|
|
100
|
-
strStreamPublisherDidFailWithError: "strStreamPublisherDidFailWithError"
|
|
101
|
-
};
|
|
102
|
-
|
|
103
|
-
//#endregion
|
|
104
|
-
export { uploadDeepsightVideo as a, getDeviceClass as c, stopRecording as i, getBrowser as l, createRecordingSession as n, checkPermission as o, startRecording as r, requestPermission as s, streamingEvents as t };
|
|
File without changes
|