@incodetech/core 0.0.0-dev-20261002-8d83c2bc → 0.0.0-dev-20261005-4c26de38
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/{FaceDetectionProvider-C8R9L_4X.esm.js → FaceDetectionProvider-CZRhMwCj.esm.js} +4 -4
- package/dist/ae-signature.esm.js +1 -1
- package/dist/{apiError-O0-pQnns.esm.js → apiError-C8_ZsTnI.esm.js} +1 -1
- package/dist/authentication.esm.js +2 -2
- package/dist/{authenticationManager-88NNvOEB.esm.js → authenticationManager-BXexvhsC.esm.js} +3 -3
- package/dist/{authenticationStateMachine-Cg0ZBVKd.esm.js → authenticationStateMachine-VYlt1KgW.esm.js} +2 -2
- package/dist/consent.d.ts +1 -1
- package/dist/{consentManager-Cv_0QKLD.d.ts → consentManager-Ca8FHlC4.d.ts} +8 -8
- package/dist/{deepsightLoader-D1zNmkIg.esm.js → deepsightLoader-9vrTrc-M.esm.js} +3 -3
- package/dist/dynamic-forms.esm.js +2 -2
- package/dist/{dynamicFormsManager-B9kA697P.esm.js → dynamicFormsManager-BKRhvPhx.esm.js} +1 -1
- package/dist/{dynamicFormsStateMachine-BaXXf4a4.esm.js → dynamicFormsStateMachine-CRmYpozy.esm.js} +1 -1
- package/dist/ekyb.esm.js +3 -3
- package/dist/{ekybManager-BQQhKvLb.esm.js → ekybManager-CNCKmvP8.esm.js} +1 -1
- package/dist/{ekybStateMachine-DdP6zs6A.esm.js → ekybStateMachine-BCsoizYY.esm.js} +1 -1
- package/dist/electronic-signature.esm.js +1 -1
- package/dist/{electronicSignatureManager-CFGS9OQE.esm.js → electronicSignatureManager-D_xQJUzm.esm.js} +1 -1
- package/dist/extensibility.d.ts +4 -4
- package/dist/extensibility.esm.js +10 -10
- package/dist/{faceCaptureManagerFactory-DgAXrpVe.esm.js → faceCaptureManagerFactory-yFJuQzjR.esm.js} +1 -1
- package/dist/{faceCaptureSetup-5lO_9j_U.esm.js → faceCaptureSetup-DrSzpi1U.esm.js} +3 -3
- package/dist/{feature-management-CzojxmqK.esm.js → feature-management-CX5jephW.esm.js} +1 -1
- package/dist/feature-management.esm.js +1 -1
- package/dist/flow.d.ts +1 -1
- package/dist/flow.esm.js +3 -3
- package/dist/{flowCompletionService-CUVoQ9ce.esm.js → flowCompletionService-h3Di2YTn.esm.js} +1 -1
- package/dist/{flowServices-BmSe626K.esm.js → flowServices-PfeGN_Ew.esm.js} +4 -4
- package/dist/geolocation.esm.js +2 -2
- package/dist/{geolocationManager-DmL_GWgc.esm.js → geolocationManager-B8xKiikK.esm.js} +1 -1
- package/dist/{geolocationStateMachine-DPgbUArp.esm.js → geolocationStateMachine-DDaQTPh-.esm.js} +1 -1
- package/dist/id-selfie-flow.esm.js +7 -7
- package/dist/id.d.ts +2 -2
- package/dist/id.esm.js +3 -203
- package/dist/{idCaptureDefaults-JRyk8Pqy.esm.js → idCaptureDefaults-DbDoL1m5.esm.js} +1 -1
- package/dist/{idCaptureManager-DHfSJbYv.d.ts → idCaptureManager-BufUN-y6.d.ts} +3 -3
- package/dist/{idCaptureManager-R2Oi2WEj.esm.js → idCaptureManager-C9G54e0I.esm.js} +205 -7
- package/dist/{idCaptureServices-C63qdfgk.esm.js → idCaptureServices-B9cBHHIs.esm.js} +3 -3
- package/dist/{idCaptureStateMachine-UYvwNnwA.esm.js → idCaptureStateMachine-CIUgK8GN.esm.js} +55 -18
- package/dist/index.esm.js +1 -1
- package/dist/mandatory-consent.d.ts +1 -1
- package/dist/{mandatoryConsentManager-B6glP66e.d.ts → mandatoryConsentManager-bhnHk13z.d.ts} +4 -4
- package/dist/qe-signature.esm.js +1 -1
- package/dist/{runChildModule-BxdlT0Aa.esm.js → runChildModule-CcmHyGsP.esm.js} +1 -1
- package/dist/{sdkVersion-D6Qk_ASE.esm.js → sdkVersion-NIsie1FT.esm.js} +1 -1
- package/dist/selfie.esm.js +6 -6
- package/dist/{selfieErrorUtils-UyrfXWWO.esm.js → selfieErrorUtils-hcwm2LiU.esm.js} +1 -1
- package/dist/{selfieManager-BPubCyDr.esm.js → selfieManager-BqlcOMT7.esm.js} +3 -3
- package/dist/{selfieStateMachine-CDrU2akp.esm.js → selfieStateMachine-DhNKHT_f.esm.js} +3 -3
- package/dist/{session-DQNY26KV.esm.js → session-_t2tvJWl.esm.js} +3 -3
- package/dist/session.esm.js +4 -4
- package/dist/{sessionInitializer-esKkrBIL.esm.js → sessionInitializer-Q0N7DXtA.esm.js} +3 -3
- package/dist/{setup-s7Ad9Blp.esm.js → setup-D7nvxJuL.esm.js} +4 -4
- package/dist/{trueSightService-Bd2fQkGa.esm.js → trueSightService-CeIIDVW0.esm.js} +1 -1
- package/dist/{types-CrZKPInf2.d.ts → types-DBCRSabn2.d.ts} +13 -1
- package/dist/video-selfie.esm.js +3 -3
- package/dist/{videoSelfieCameraWarmer-Bc7Gyd7k.esm.js → videoSelfieCameraWarmer-BHi9pVoY.esm.js} +4 -4
- package/dist/wasm.esm.js +2 -2
- package/dist/workflow.esm.js +14 -14
- package/package.json +3 -3
package/dist/id.esm.js
CHANGED
|
@@ -1,10 +1,6 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { i as
|
|
3
|
-
import { n as
|
|
4
|
-
import { a as isRedirectFlowType, c as createIdCaptureOnlyDeliveryActor, d as renderWallet, f as createDeviceWalletManager, h as resolveWalletPlatform, i as DIGITAL_ID_REGISTRY, l as createIdProtectedCaptureController, n as provideIdProtectedCaptureController, o as resolveDigitalIdImplementation, r as DIGITAL_ID_DOCUMENT_TYPES, s as attachIdProtectedCaptureController, t as idCaptureMachine } from "./idCaptureStateMachine-UYvwNnwA.esm.js";
|
|
5
|
-
import { n as createIdCaptureActor, r as createIdCaptureManagerFromActor, t as createIdCaptureManager } from "./idCaptureManager-R2Oi2WEj.esm.js";
|
|
6
|
-
import { _ as ID_ERROR_CODES, a as getRealQualityValue, b as resolveIdCaptureThresholds, c as pauseRecordingForAttempt, d as resumeRecordingAfterPause, f as startRecordingSession, g as validateUploadResponse, h as uploadIdImage, i as finalizeRecordingSession, l as prepareRecordingForCameraRetry, m as stopStream, n as barcodeToBase64, o as initializeIdCapture, p as stopRecording, r as disposeRecordingSession, s as isSuspendableRecordingSession, t as addBarcode, u as processId } from "./idCaptureServices-C63qdfgk.esm.js";
|
|
7
|
-
import { t as invokeOnCaptureCallback } from "./invokeOnCaptureCallback-Brs1lo61.esm.js";
|
|
1
|
+
import { a as isRedirectFlowType, h as createDeviceWalletManager, i as DIGITAL_ID_REGISTRY, m as renderWallet, o as resolveDigitalIdImplementation, r as DIGITAL_ID_DOCUMENT_TYPES, t as idCaptureMachine, v as resolveWalletPlatform } from "./idCaptureStateMachine-CIUgK8GN.esm.js";
|
|
2
|
+
import { a as idCaptureOnlyMachine, i as createIdCaptureOnlyActor, n as createIdCaptureOnlyManager, o as createIdCaptureActor, r as createIdCaptureOnlyManagerFromActor, t as createIdCaptureManager } from "./idCaptureManager-C9G54e0I.esm.js";
|
|
3
|
+
import { _ as ID_ERROR_CODES, a as getRealQualityValue, c as pauseRecordingForAttempt, d as resumeRecordingAfterPause, f as startRecordingSession, g as validateUploadResponse, h as uploadIdImage, i as finalizeRecordingSession, l as prepareRecordingForCameraRetry, m as stopStream, n as barcodeToBase64, o as initializeIdCapture, p as stopRecording, r as disposeRecordingSession, s as isSuspendableRecordingSession, t as addBarcode, u as processId } from "./idCaptureServices-B9cBHHIs.esm.js";
|
|
8
4
|
//#region src/modules/id/deviceWallet/deviceWalletErrors.ts
|
|
9
5
|
/**
|
|
10
6
|
* Fail reason → i18n key for the device-wallet error screen (same shape as
|
|
@@ -16,200 +12,4 @@ const DEVICE_WALLET_ERROR_KEYS = {
|
|
|
16
12
|
WALLET_ERROR: "idv2.deviceWallet.errorDescription"
|
|
17
13
|
};
|
|
18
14
|
//#endregion
|
|
19
|
-
//#region src/modules/id/idCaptureOnlyStateMachine.ts
|
|
20
|
-
function buildSubImage(canvas) {
|
|
21
|
-
if (!canvas) return void 0;
|
|
22
|
-
canvas.updateBlob();
|
|
23
|
-
const blobData = canvas.getBlobData();
|
|
24
|
-
if (!blobData) return void 0;
|
|
25
|
-
const imageBase64 = canvas.getBase64Image() ?? "";
|
|
26
|
-
if (!imageBase64) return void 0;
|
|
27
|
-
return {
|
|
28
|
-
imageBase64,
|
|
29
|
-
blob: blobData.blob,
|
|
30
|
-
url: blobData.url
|
|
31
|
-
};
|
|
32
|
-
}
|
|
33
|
-
/**
|
|
34
|
-
* Local finalize for the captureOnly flow. Reads the canvases the base
|
|
35
|
-
* machine's `storeCapturedCanvasInProvider` already prepared:
|
|
36
|
-
* - `originalCanvas` — full unprocessed frame.
|
|
37
|
-
* - `transformedCanvas` — homography-warped crop produced by the WASM
|
|
38
|
-
* `transformPerspective`.
|
|
39
|
-
*
|
|
40
|
-
* Deepsight metadata is best-effort; failure does not block delivery.
|
|
41
|
-
*/
|
|
42
|
-
async function finalizeIdCaptureOnly(input, signal) {
|
|
43
|
-
const originalCanvas = input.canvas;
|
|
44
|
-
if (!originalCanvas) throw new Error(ID_ERROR_CODES.UPLOAD_ERROR);
|
|
45
|
-
const imageData = originalCanvas.getImageData() ?? void 0;
|
|
46
|
-
let metadata = "";
|
|
47
|
-
if (input.deepsightService && imageData) try {
|
|
48
|
-
await input.deepsightService.analyzeFrame(imageData);
|
|
49
|
-
if (signal.aborted) throw new DOMException("Aborted", "AbortError");
|
|
50
|
-
metadata = input.deepsightService.getMetadata();
|
|
51
|
-
} catch (error) {
|
|
52
|
-
if (error?.name === "AbortError") throw error;
|
|
53
|
-
}
|
|
54
|
-
const imageBase64 = originalCanvas.getBase64Image() ?? "";
|
|
55
|
-
originalCanvas.updateBlob();
|
|
56
|
-
const blobData = originalCanvas.getBlobData();
|
|
57
|
-
if (!blobData) throw new Error(ID_ERROR_CODES.UPLOAD_ERROR);
|
|
58
|
-
return {
|
|
59
|
-
imageBase64,
|
|
60
|
-
blob: blobData.blob,
|
|
61
|
-
url: blobData.url,
|
|
62
|
-
metadata,
|
|
63
|
-
croppedImage: buildSubImage(input.croppedCanvas ?? null)
|
|
64
|
-
};
|
|
65
|
-
}
|
|
66
|
-
/**
|
|
67
|
-
* ID capture state machine variant for the captureOnly flow. Shares the full
|
|
68
|
-
* base ID-capture state tree (chooser, tutorial, permissions, capture,
|
|
69
|
-
* front/back finished, processing, finished); only the upload, process, and
|
|
70
|
-
* recording steps are local instead of remote.
|
|
71
|
-
*/
|
|
72
|
-
const idCaptureOnlyMachine = idCaptureMachine.provide({
|
|
73
|
-
actors: {
|
|
74
|
-
/** No backend processing in captureOnly. */
|
|
75
|
-
processId: fromPromise(async () => ({ isDocumentExpired: false })) },
|
|
76
|
-
actions: {
|
|
77
|
-
attachProtectedController: assign(({ self }) => {
|
|
78
|
-
attachIdProtectedCaptureController(self, createIdProtectedCaptureController({ finalizeCaptureOnly: finalizeIdCaptureOnly }));
|
|
79
|
-
return {};
|
|
80
|
-
}),
|
|
81
|
-
/**
|
|
82
|
-
* Routes the rich payload from local delivery into `captureOnlyImages`
|
|
83
|
-
* keyed by side instead of the regular `capturedImages` slot.
|
|
84
|
-
*/
|
|
85
|
-
storeCapturedImage: assign(({ context, event }) => {
|
|
86
|
-
if (!("output" in event) || !context.currentMode) return { captureOnlyImages: context.captureOnlyImages };
|
|
87
|
-
const image = event.output;
|
|
88
|
-
const side = context.currentMode === "back" ? "back" : "front";
|
|
89
|
-
return {
|
|
90
|
-
captureOnlyImages: {
|
|
91
|
-
...context.captureOnlyImages,
|
|
92
|
-
[side]: image
|
|
93
|
-
},
|
|
94
|
-
previewImageUrl: image.croppedImage?.url ?? image.url ?? context.previewImageUrl
|
|
95
|
-
};
|
|
96
|
-
})
|
|
97
|
-
},
|
|
98
|
-
guards: {
|
|
99
|
-
hasUploadValidationError: () => false,
|
|
100
|
-
/**
|
|
101
|
-
* The base guard relies on the backend's `uploadResponse.skipBackIdCapture`
|
|
102
|
-
* to decide whether to skip back capture. CaptureOnly has no backend
|
|
103
|
-
* response, so the variant honors `config.onlyFront` directly. Other
|
|
104
|
-
* back-skip signals (`onlyBack`, `usSmartCapture`, `currentMode`) match
|
|
105
|
-
* the base behavior.
|
|
106
|
-
*/
|
|
107
|
-
shouldContinueToBack: ({ context }) => {
|
|
108
|
-
if (context.currentMode !== "front" && context.currentMode !== "passport") return false;
|
|
109
|
-
if (context.config.onlyFront) return false;
|
|
110
|
-
if (context.config.onlyBack) return false;
|
|
111
|
-
if (context.config.usSmartCapture) return false;
|
|
112
|
-
return true;
|
|
113
|
-
}
|
|
114
|
-
}
|
|
115
|
-
});
|
|
116
|
-
function provideIdCaptureOnlyController(controller) {
|
|
117
|
-
return provideIdProtectedCaptureController(idCaptureOnlyMachine, controller).provide({ actors: { captureOnlyDelivery: createIdCaptureOnlyDeliveryActor(controller) } });
|
|
118
|
-
}
|
|
119
|
-
//#endregion
|
|
120
|
-
//#region src/modules/id/idCaptureOnlyActor.ts
|
|
121
|
-
/**
|
|
122
|
-
* Defaults the capture-only flow applies for every {@link IdCaptureConfig}
|
|
123
|
-
* option the integrator doesn't set. Capture-only doesn't talk to a backend, so
|
|
124
|
-
* the upload/processing-oriented flags (device wallet, barcode, extra pages,
|
|
125
|
-
* smart capture, …) all default off; both document types are accepted. The
|
|
126
|
-
* integrator overrides only what they care about — `onCapture` is the one field
|
|
127
|
-
* they must supply.
|
|
128
|
-
*/
|
|
129
|
-
const DEFAULT_ID_CAPTURE_ONLY_CONFIG = {
|
|
130
|
-
showTutorial: true,
|
|
131
|
-
captureAttempts: 3,
|
|
132
|
-
isDeepsightEnabled: false,
|
|
133
|
-
enableId: true,
|
|
134
|
-
enablePassport: true,
|
|
135
|
-
deviceWallet: false,
|
|
136
|
-
onlyFront: false,
|
|
137
|
-
onlyBack: false,
|
|
138
|
-
barcodeCapture: false,
|
|
139
|
-
fetchAdditionalPage: false,
|
|
140
|
-
secondId: false,
|
|
141
|
-
thirdId: false,
|
|
142
|
-
autoCaptureTimeout: 5,
|
|
143
|
-
deviceIdleTimeout: 10,
|
|
144
|
-
digitalIdsUpload: false,
|
|
145
|
-
showDocumentChooserScreen: false,
|
|
146
|
-
enableIdRecording: false,
|
|
147
|
-
usSmartCapture: false,
|
|
148
|
-
perCountryPerDocOverrides: {}
|
|
149
|
-
};
|
|
150
|
-
function createIdCaptureOnlyActor(options) {
|
|
151
|
-
const mergedConfig = {
|
|
152
|
-
...DEFAULT_ID_CAPTURE_ONLY_CONFIG,
|
|
153
|
-
...options.config
|
|
154
|
-
};
|
|
155
|
-
const config = {
|
|
156
|
-
...mergedConfig,
|
|
157
|
-
thresholds: resolveIdCaptureThresholds(mergedConfig)
|
|
158
|
-
};
|
|
159
|
-
return createActor(provideIdCaptureOnlyController(createIdProtectedCaptureController({ finalizeCaptureOnly: finalizeIdCaptureOnly })), { input: {
|
|
160
|
-
config,
|
|
161
|
-
dependencies: options.dependencies
|
|
162
|
-
} }).start();
|
|
163
|
-
}
|
|
164
|
-
//#endregion
|
|
165
|
-
//#region src/modules/id/idCaptureOnlyManager.ts
|
|
166
|
-
/**
|
|
167
|
-
* Wraps an ID captureOnly actor with a manager that fires `onCapture` exactly
|
|
168
|
-
* once when the actor reaches the `finished` final state. `complete` fires
|
|
169
|
-
* for both `finished` and `closed` — gating on `finished` prevents a
|
|
170
|
-
* user-quit mid-capture from delivering a partial payload.
|
|
171
|
-
*/
|
|
172
|
-
function attachOnCaptureFiring(actor, config) {
|
|
173
|
-
const subscription = actor.subscribe({ complete: () => {
|
|
174
|
-
const snapshot = actor.getSnapshot();
|
|
175
|
-
if (!snapshot.matches("finished")) return;
|
|
176
|
-
const frontImage = snapshot.context.captureOnlyImages.front;
|
|
177
|
-
if (!frontImage) return;
|
|
178
|
-
const response = {
|
|
179
|
-
frontImage,
|
|
180
|
-
backImage: snapshot.context.captureOnlyImages.back
|
|
181
|
-
};
|
|
182
|
-
invokeOnCaptureCallback(config.onCapture, response, eventModuleNames.id);
|
|
183
|
-
} });
|
|
184
|
-
return () => subscription.unsubscribe();
|
|
185
|
-
}
|
|
186
|
-
/**
|
|
187
|
-
* `visibilityObserver` is an optional override escape-hatch — first-party
|
|
188
|
-
* callers omit it and the downstream factory defaults to
|
|
189
|
-
* `BrowserVisibilityObserverProvider`. Pass a custom or no-op observer to
|
|
190
|
-
* disable `background`/`foreground` tracking or to run in a non-DOM
|
|
191
|
-
* environment (e.g. SSR / tests).
|
|
192
|
-
*/
|
|
193
|
-
function createIdCaptureOnlyManagerFromActor(actor, config, visibilityObserver) {
|
|
194
|
-
const unsubscribe = attachOnCaptureFiring(actor, config);
|
|
195
|
-
const manager = createIdCaptureManagerFromActor(actor, visibilityObserver);
|
|
196
|
-
return {
|
|
197
|
-
...manager,
|
|
198
|
-
stop: () => {
|
|
199
|
-
unsubscribe();
|
|
200
|
-
manager.stop();
|
|
201
|
-
}
|
|
202
|
-
};
|
|
203
|
-
}
|
|
204
|
-
/**
|
|
205
|
-
* Creates a captureOnly ID capture manager.
|
|
206
|
-
*
|
|
207
|
-
* Unlike {@link createIdCaptureManager}, the captured ID image(s) are
|
|
208
|
-
* delivered locally to the integrator's `onCapture` callback instead of
|
|
209
|
-
* being uploaded to the Incode backend. `onCapture` is required.
|
|
210
|
-
*/
|
|
211
|
-
function createIdCaptureOnlyManager(options) {
|
|
212
|
-
return createIdCaptureOnlyManagerFromActor(createIdCaptureOnlyActor(options), options.config);
|
|
213
|
-
}
|
|
214
|
-
//#endregion
|
|
215
15
|
export { DEVICE_WALLET_ERROR_KEYS, DIGITAL_ID_DOCUMENT_TYPES, DIGITAL_ID_REGISTRY, ID_ERROR_CODES, addBarcode, barcodeToBase64, createDeviceWalletManager, createIdCaptureActor, createIdCaptureManager, createIdCaptureOnlyActor, createIdCaptureOnlyManager, createIdCaptureOnlyManagerFromActor, disposeRecordingSession, finalizeRecordingSession, getRealQualityValue, idCaptureMachine, idCaptureOnlyMachine, initializeIdCapture, isRedirectFlowType, isSuspendableRecordingSession, pauseRecordingForAttempt, prepareRecordingForCameraRetry, processId, renderWallet, resolveDigitalIdImplementation, resolveWalletPlatform, resumeRecordingAfterPause, startRecordingSession, stopRecording, stopStream, uploadIdImage, validateUploadResponse };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { b as resolveWasmSource, p as WASM_MODEL_FILES } from "./wasmWebClient-DPPQlS-U.esm.js";
|
|
2
|
-
import { E as getBarcodeEnhanceModelUrl } from "./trueSightService-
|
|
2
|
+
import { E as getBarcodeEnhanceModelUrl } from "./trueSightService-CeIIDVW0.esm.js";
|
|
3
3
|
import { s as wasmRuntime, t as getResolvedModelSource } from "./warmup-DLq_t-Zu.esm.js";
|
|
4
4
|
import { i as BaseWasmProvider } from "./safeStorage-Q_iUpxa8.esm.js";
|
|
5
5
|
import { t as IncodeCanvas } from "./canvas-BxFzWTt-.esm.js";
|
|
@@ -11,7 +11,7 @@ import { t as BaseWasmProvider } from "./BaseWasmProvider-BL9wIRnN.js";
|
|
|
11
11
|
import { n as DeepsightService } from "./StreamCanvasCapture-CeBBJ_RC.js";
|
|
12
12
|
import { t as CameraStream } from "./camera-9wWD-pwg.js";
|
|
13
13
|
import { i as Pdf417DecodeResult, n as IIdCaptureCapability, t as DetectionOrientation } from "./IIdCaptureCapability-DBsv9-7M.js";
|
|
14
|
-
import { A as DeviceWalletDecision, E as IdErrorCode, F as DeviceWalletProvider, G as DigitalIdProviderId, I as DeviceWalletServices, J as IDigitalCredentialsCapability, K as FailureReason, M as DeviceWalletFailReason, O as UploadIdResponse, P as DeviceWalletPlatform, b as IdCaptureOnlyConfig, c as DetectionStatus, d as IdCaptureContext, f as IdCaptureDependencies, g as IdCaptureEvent, h as IdCaptureDigitalIdRedirectOption, i as CaptureIdResponse, j as DeviceWalletDecryptResponse, k as IAnalyticsCapability, r as AddBarcodeV3Response, s as DetectionArea, t as AcceptedDocument, u as IdCaptureConfig, v as IdCaptureInput, w as IdDocumentType, x as IdCaptureOutput, y as IdCaptureMode } from "./types-
|
|
14
|
+
import { A as DeviceWalletDecision, E as IdErrorCode, F as DeviceWalletProvider, G as DigitalIdProviderId, I as DeviceWalletServices, J as IDigitalCredentialsCapability, K as FailureReason, M as DeviceWalletFailReason, O as UploadIdResponse, P as DeviceWalletPlatform, b as IdCaptureOnlyConfig, c as DetectionStatus, d as IdCaptureContext, f as IdCaptureDependencies, g as IdCaptureEvent, h as IdCaptureDigitalIdRedirectOption, i as CaptureIdResponse, j as DeviceWalletDecryptResponse, k as IAnalyticsCapability, r as AddBarcodeV3Response, s as DetectionArea, t as AcceptedDocument, u as IdCaptureConfig, v as IdCaptureInput, w as IdDocumentType, x as IdCaptureOutput, y as IdCaptureMode } from "./types-DBCRSabn2.js";
|
|
15
15
|
//#region ../infra/src/providers/wasm/WasmUtilProvider.d.ts
|
|
16
16
|
declare class WasmUtilProvider extends BaseWasmProvider implements IWasmUtilCapability {
|
|
17
17
|
private static instance;
|
|
@@ -726,8 +726,8 @@ type IdCaptureManager = ReturnType<typeof createIdCaptureManagerFromActor>;
|
|
|
726
726
|
* `internal/idCapture/idCaptureManagerFactory.ts`; this file is a thin
|
|
727
727
|
* wrapper that creates the actor and delegates to the factory.
|
|
728
728
|
*
|
|
729
|
-
*
|
|
730
|
-
*
|
|
729
|
+
* A config with an `onCapture` callback runs the captureOnly flow instead
|
|
730
|
+
* (see `createIdCaptureOnlyManager`): no backend, images go to `onCapture`.
|
|
731
731
|
*/
|
|
732
732
|
declare function createIdCaptureManager(options: CreateIdCaptureActorOptions): Manager<IdCaptureState> & {
|
|
733
733
|
load(): void;
|
|
@@ -1,13 +1,15 @@
|
|
|
1
|
-
import { l as BrowserStorageProvider } from "./setup-
|
|
1
|
+
import { l as BrowserStorageProvider } from "./setup-D7nvxJuL.esm.js";
|
|
2
2
|
import { n as eventModuleNames, o as createManagerInstrumentation } from "./events-CfLLkAh7.esm.js";
|
|
3
3
|
import { t as topLevelStateName } from "./topLevelStateName-B5i2avbh.esm.js";
|
|
4
|
-
import { s as createActor, u as createManager } from "./xstate.esm-Bg3FuvIs.esm.js";
|
|
4
|
+
import { i as assign, s as createActor, u as createManager } from "./xstate.esm-Bg3FuvIs.esm.js";
|
|
5
|
+
import { n as fromPromise } from "./xstate-actors.esm-Ccyzgxj1.esm.js";
|
|
5
6
|
import { t as setWasmDsFlagSync } from "./wasmDsFlagSync-DyNj8RY_.esm.js";
|
|
6
7
|
import { t as BrowserVisibilityObserverProvider } from "./BrowserVisibilityObserverProvider-BrJN1B8A.esm.js";
|
|
7
8
|
import { c as resetWasmMotionPrimedForModule, o as requiresMotionPermissionUserGesture, r as primeMotionFromUserGestureIfNeeded } from "./permissionServices-B9IqVf3c.esm.js";
|
|
8
9
|
import { t as getDeviceClass } from "./getDeviceClass-bsWdEDxP.esm.js";
|
|
9
|
-
import {
|
|
10
|
-
import { b as resolveIdCaptureThresholds, v as resolveCaptureOptimizingTreatment, y as resolveCountdownStepMs } from "./idCaptureServices-
|
|
10
|
+
import { _ as mapDeviceWalletScreenName, c as createIdCaptureOnlyDeliveryActor, d as captureOnlyNeedsBack, f as hasOnCaptureCallback, g as BrowserDigitalCredentialsProvider, l as createIdProtectedCaptureController, n as provideIdProtectedCaptureController, p as pickIdCaptureOnlyConfig, s as attachIdProtectedCaptureController, t as idCaptureMachine, u as findIdProtectedCaptureController } from "./idCaptureStateMachine-CIUgK8GN.esm.js";
|
|
11
|
+
import { _ as ID_ERROR_CODES, b as resolveIdCaptureThresholds, v as resolveCaptureOptimizingTreatment, y as resolveCountdownStepMs } from "./idCaptureServices-B9cBHHIs.esm.js";
|
|
12
|
+
import { t as invokeOnCaptureCallback } from "./invokeOnCaptureCallback-Brs1lo61.esm.js";
|
|
11
13
|
//#region src/modules/id/digitalUpload/instrumentation.ts
|
|
12
14
|
const TERMINAL_REASONS = /* @__PURE__ */ new Set(["DIGITAL_ID_REQUESTED_BUT_OTHER_PROVIDED", "ID_TYPE_UNACCEPTABLE"]);
|
|
13
15
|
function isHoldingState(value) {
|
|
@@ -168,6 +170,7 @@ function getErrorSubtitleKey(errorCode, uploadResponse, currentMode) {
|
|
|
168
170
|
}
|
|
169
171
|
function shouldCaptureBack(context) {
|
|
170
172
|
if (context.isDigitalUpload) return false;
|
|
173
|
+
if (hasOnCaptureCallback(context.config)) return captureOnlyNeedsBack(context);
|
|
171
174
|
if (!(context.currentMode === "front" || context.currentMode === "passport")) return false;
|
|
172
175
|
if (context.config.onlyBack) return false;
|
|
173
176
|
if (context.config.usSmartCapture && context.currentMode === "front") return false;
|
|
@@ -872,6 +875,197 @@ function createIdCaptureActor(options) {
|
|
|
872
875
|
} }).start();
|
|
873
876
|
}
|
|
874
877
|
//#endregion
|
|
878
|
+
//#region src/modules/id/idCaptureOnlyStateMachine.ts
|
|
879
|
+
function buildSubImage(canvas) {
|
|
880
|
+
if (!canvas) return void 0;
|
|
881
|
+
canvas.updateBlob();
|
|
882
|
+
const blobData = canvas.getBlobData();
|
|
883
|
+
if (!blobData) return void 0;
|
|
884
|
+
const imageBase64 = canvas.getBase64Image() ?? "";
|
|
885
|
+
if (!imageBase64) return void 0;
|
|
886
|
+
return {
|
|
887
|
+
imageBase64,
|
|
888
|
+
blob: blobData.blob,
|
|
889
|
+
url: blobData.url
|
|
890
|
+
};
|
|
891
|
+
}
|
|
892
|
+
/**
|
|
893
|
+
* Local finalize for the captureOnly flow. Reads the canvases the base
|
|
894
|
+
* machine's `storeCapturedCanvasInProvider` already prepared:
|
|
895
|
+
* - `originalCanvas` — full unprocessed frame.
|
|
896
|
+
* - `transformedCanvas` — homography-warped crop produced by the WASM
|
|
897
|
+
* `transformPerspective`.
|
|
898
|
+
*
|
|
899
|
+
* Deepsight metadata is best-effort; failure does not block delivery.
|
|
900
|
+
*/
|
|
901
|
+
async function finalizeIdCaptureOnly(input, signal) {
|
|
902
|
+
const originalCanvas = input.canvas;
|
|
903
|
+
if (!originalCanvas) throw new Error(ID_ERROR_CODES.UPLOAD_ERROR);
|
|
904
|
+
const imageData = originalCanvas.getImageData() ?? void 0;
|
|
905
|
+
let metadata = "";
|
|
906
|
+
if (input.deepsightService && imageData) try {
|
|
907
|
+
await input.deepsightService.analyzeFrame(imageData);
|
|
908
|
+
if (signal.aborted) throw new DOMException("Aborted", "AbortError");
|
|
909
|
+
metadata = input.deepsightService.getMetadata();
|
|
910
|
+
} catch (error) {
|
|
911
|
+
if (error?.name === "AbortError") throw error;
|
|
912
|
+
}
|
|
913
|
+
const imageBase64 = originalCanvas.getBase64Image() ?? "";
|
|
914
|
+
originalCanvas.updateBlob();
|
|
915
|
+
const blobData = originalCanvas.getBlobData();
|
|
916
|
+
if (!blobData) throw new Error(ID_ERROR_CODES.UPLOAD_ERROR);
|
|
917
|
+
return {
|
|
918
|
+
imageBase64,
|
|
919
|
+
blob: blobData.blob,
|
|
920
|
+
url: blobData.url,
|
|
921
|
+
metadata,
|
|
922
|
+
croppedImage: buildSubImage(input.croppedCanvas ?? null)
|
|
923
|
+
};
|
|
924
|
+
}
|
|
925
|
+
/**
|
|
926
|
+
* ID capture state machine variant for the captureOnly flow. Shares the full
|
|
927
|
+
* base ID-capture state tree (chooser, tutorial, permissions, capture,
|
|
928
|
+
* front/back finished, processing, finished); only the upload, process, and
|
|
929
|
+
* recording steps are local instead of remote.
|
|
930
|
+
*/
|
|
931
|
+
const idCaptureOnlyMachine = idCaptureMachine.provide({
|
|
932
|
+
actors: {
|
|
933
|
+
/** No backend processing in captureOnly. */
|
|
934
|
+
processId: fromPromise(async () => ({ isDocumentExpired: false })) },
|
|
935
|
+
actions: {
|
|
936
|
+
attachProtectedController: assign(({ self }) => {
|
|
937
|
+
attachIdProtectedCaptureController(self, createIdProtectedCaptureController({ finalizeCaptureOnly: finalizeIdCaptureOnly }));
|
|
938
|
+
return {};
|
|
939
|
+
}),
|
|
940
|
+
/**
|
|
941
|
+
* Routes the rich payload from local delivery into `captureOnlyImages`
|
|
942
|
+
* keyed by side instead of the regular `capturedImages` slot.
|
|
943
|
+
*/
|
|
944
|
+
storeCapturedImage: assign(({ context, event }) => {
|
|
945
|
+
if (!("output" in event) || !context.currentMode) return { captureOnlyImages: context.captureOnlyImages };
|
|
946
|
+
const image = event.output;
|
|
947
|
+
const side = context.currentMode === "back" ? "back" : "front";
|
|
948
|
+
return {
|
|
949
|
+
captureOnlyImages: {
|
|
950
|
+
...context.captureOnlyImages,
|
|
951
|
+
[side]: image
|
|
952
|
+
},
|
|
953
|
+
previewImageUrl: image.croppedImage?.url ?? image.url ?? context.previewImageUrl
|
|
954
|
+
};
|
|
955
|
+
})
|
|
956
|
+
},
|
|
957
|
+
guards: {
|
|
958
|
+
hasUploadValidationError: () => false,
|
|
959
|
+
/** No backend answer in captureOnly: the SDK config decides. */
|
|
960
|
+
shouldContinueToBack: ({ context }) => captureOnlyNeedsBack(context)
|
|
961
|
+
}
|
|
962
|
+
});
|
|
963
|
+
function provideIdCaptureOnlyController(controller) {
|
|
964
|
+
return provideIdProtectedCaptureController(idCaptureOnlyMachine, controller).provide({ actors: { captureOnlyDelivery: createIdCaptureOnlyDeliveryActor(controller) } });
|
|
965
|
+
}
|
|
966
|
+
//#endregion
|
|
967
|
+
//#region src/modules/id/idCaptureOnlyActor.ts
|
|
968
|
+
/**
|
|
969
|
+
* Defaults the capture-only flow applies for every {@link IdCaptureConfig}
|
|
970
|
+
* option the integrator doesn't set. Capture-only doesn't talk to a backend, so
|
|
971
|
+
* the upload/processing-oriented flags (device wallet, barcode, extra pages,
|
|
972
|
+
* smart capture, …) all default off; both document types are accepted. The
|
|
973
|
+
* integrator overrides only what they care about — `onCapture` is the one field
|
|
974
|
+
* they must supply.
|
|
975
|
+
*/
|
|
976
|
+
const DEFAULT_ID_CAPTURE_ONLY_CONFIG = {
|
|
977
|
+
showTutorial: true,
|
|
978
|
+
captureAttempts: 3,
|
|
979
|
+
isDeepsightEnabled: false,
|
|
980
|
+
enableId: true,
|
|
981
|
+
enablePassport: true,
|
|
982
|
+
deviceWallet: false,
|
|
983
|
+
onlyFront: false,
|
|
984
|
+
onlyBack: false,
|
|
985
|
+
barcodeCapture: false,
|
|
986
|
+
fetchAdditionalPage: false,
|
|
987
|
+
secondId: false,
|
|
988
|
+
thirdId: false,
|
|
989
|
+
autoCaptureTimeout: 5,
|
|
990
|
+
deviceIdleTimeout: 10,
|
|
991
|
+
digitalIdsUpload: false,
|
|
992
|
+
showDocumentChooserScreen: false,
|
|
993
|
+
enableIdRecording: false,
|
|
994
|
+
usSmartCapture: false,
|
|
995
|
+
perCountryPerDocOverrides: {}
|
|
996
|
+
};
|
|
997
|
+
function createIdCaptureOnlyActor(options) {
|
|
998
|
+
const mergedConfig = {
|
|
999
|
+
...DEFAULT_ID_CAPTURE_ONLY_CONFIG,
|
|
1000
|
+
...options.config
|
|
1001
|
+
};
|
|
1002
|
+
const config = {
|
|
1003
|
+
...mergedConfig,
|
|
1004
|
+
thresholds: resolveIdCaptureThresholds(mergedConfig)
|
|
1005
|
+
};
|
|
1006
|
+
return createActor(provideIdCaptureOnlyController(createIdProtectedCaptureController({ finalizeCaptureOnly: finalizeIdCaptureOnly })), { input: {
|
|
1007
|
+
config,
|
|
1008
|
+
dependencies: options.dependencies
|
|
1009
|
+
} }).start();
|
|
1010
|
+
}
|
|
1011
|
+
//#endregion
|
|
1012
|
+
//#region src/modules/id/idCaptureOnlyManager.ts
|
|
1013
|
+
/** A back-only capture (`onlyBack`) has no front image (ENG-58695). */
|
|
1014
|
+
function buildCaptureOnlyResponse({ front, back }) {
|
|
1015
|
+
if (front) return {
|
|
1016
|
+
frontImage: front,
|
|
1017
|
+
backImage: back
|
|
1018
|
+
};
|
|
1019
|
+
if (back) return {
|
|
1020
|
+
frontImage: void 0,
|
|
1021
|
+
backImage: back
|
|
1022
|
+
};
|
|
1023
|
+
}
|
|
1024
|
+
/**
|
|
1025
|
+
* Wraps an ID captureOnly actor with a manager that fires `onCapture` exactly
|
|
1026
|
+
* once when the actor reaches the `finished` final state. `complete` fires
|
|
1027
|
+
* for both `finished` and `closed` — gating on `finished` prevents a
|
|
1028
|
+
* user-quit mid-capture from delivering a partial payload.
|
|
1029
|
+
*/
|
|
1030
|
+
function attachOnCaptureFiring(actor, config) {
|
|
1031
|
+
const subscription = actor.subscribe({ complete: () => {
|
|
1032
|
+
const snapshot = actor.getSnapshot();
|
|
1033
|
+
if (!snapshot.matches("finished")) return;
|
|
1034
|
+
const response = buildCaptureOnlyResponse(snapshot.context.captureOnlyImages);
|
|
1035
|
+
if (!response) return;
|
|
1036
|
+
invokeOnCaptureCallback(config.onCapture, response, eventModuleNames.id);
|
|
1037
|
+
} });
|
|
1038
|
+
return () => subscription.unsubscribe();
|
|
1039
|
+
}
|
|
1040
|
+
/**
|
|
1041
|
+
* `visibilityObserver` is an optional override escape-hatch — first-party
|
|
1042
|
+
* callers omit it and the downstream factory defaults to
|
|
1043
|
+
* `BrowserVisibilityObserverProvider`. Pass a custom or no-op observer to
|
|
1044
|
+
* disable `background`/`foreground` tracking or to run in a non-DOM
|
|
1045
|
+
* environment (e.g. SSR / tests).
|
|
1046
|
+
*/
|
|
1047
|
+
function createIdCaptureOnlyManagerFromActor(actor, config, visibilityObserver) {
|
|
1048
|
+
const unsubscribe = attachOnCaptureFiring(actor, config);
|
|
1049
|
+
const manager = createIdCaptureManagerFromActor(actor, visibilityObserver);
|
|
1050
|
+
return {
|
|
1051
|
+
...manager,
|
|
1052
|
+
stop: () => {
|
|
1053
|
+
unsubscribe();
|
|
1054
|
+
manager.stop();
|
|
1055
|
+
}
|
|
1056
|
+
};
|
|
1057
|
+
}
|
|
1058
|
+
/**
|
|
1059
|
+
* Creates a captureOnly ID capture manager.
|
|
1060
|
+
*
|
|
1061
|
+
* Unlike {@link createIdCaptureManager}, the captured ID image(s) are
|
|
1062
|
+
* delivered locally to the integrator's `onCapture` callback instead of
|
|
1063
|
+
* being uploaded to the Incode backend. `onCapture` is required.
|
|
1064
|
+
*/
|
|
1065
|
+
function createIdCaptureOnlyManager(options) {
|
|
1066
|
+
return createIdCaptureOnlyManagerFromActor(createIdCaptureOnlyActor(options), options.config);
|
|
1067
|
+
}
|
|
1068
|
+
//#endregion
|
|
875
1069
|
//#region src/modules/id/idCaptureManager.ts
|
|
876
1070
|
/**
|
|
877
1071
|
* Creates a manager for the regular ID capture flow. The shared
|
|
@@ -879,11 +1073,15 @@ function createIdCaptureActor(options) {
|
|
|
879
1073
|
* `internal/idCapture/idCaptureManagerFactory.ts`; this file is a thin
|
|
880
1074
|
* wrapper that creates the actor and delegates to the factory.
|
|
881
1075
|
*
|
|
882
|
-
*
|
|
883
|
-
*
|
|
1076
|
+
* A config with an `onCapture` callback runs the captureOnly flow instead
|
|
1077
|
+
* (see `createIdCaptureOnlyManager`): no backend, images go to `onCapture`.
|
|
884
1078
|
*/
|
|
885
1079
|
function createIdCaptureManager(options) {
|
|
1080
|
+
if (hasOnCaptureCallback(options.config)) return createIdCaptureOnlyManager({
|
|
1081
|
+
config: pickIdCaptureOnlyConfig(options.config),
|
|
1082
|
+
dependencies: options.dependencies
|
|
1083
|
+
});
|
|
886
1084
|
return createIdCaptureManagerFromActor(createIdCaptureActor(options));
|
|
887
1085
|
}
|
|
888
1086
|
//#endregion
|
|
889
|
-
export {
|
|
1087
|
+
export { idCaptureOnlyMachine as a, createIdCaptureOnlyActor as i, createIdCaptureOnlyManager as n, createIdCaptureActor as o, createIdCaptureOnlyManagerFromActor as r, createIdCaptureManagerFromActor as s, createIdCaptureManager as t };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { t as ensureWasmPipelines } from "./setup-
|
|
2
|
-
import { i as numberParam, n as defineExperimentParams, t as booleanParam, u as resolveExperimentOnce } from "./feature-management-
|
|
1
|
+
import { t as ensureWasmPipelines } from "./setup-D7nvxJuL.esm.js";
|
|
2
|
+
import { i as numberParam, n as defineExperimentParams, t as booleanParam, u as resolveExperimentOnce } from "./feature-management-CX5jephW.esm.js";
|
|
3
3
|
import { t as api } from "./api-Bx3gKW_y.esm.js";
|
|
4
4
|
import { t as endpoints } from "./endpoints-Bs3D8B_G.esm.js";
|
|
5
5
|
import { i as isDesktop } from "./platform-DkcRc9JV.esm.js";
|
|
@@ -9,7 +9,7 @@ import { l as queryCameraPermission } from "./permissionServices-B9IqVf3c.esm.js
|
|
|
9
9
|
import { i as createRecordingCompositor, n as WorkerEncoderRecordingProvider, t as MultipartRecordingService } from "./multipartRecordingService-CMjkhS2x.esm.js";
|
|
10
10
|
import { n as getBackCameraStream, o as isBackFacingTrack } from "./backCameraStream-CMvXj4X4.esm.js";
|
|
11
11
|
import { t as getDeviceClass } from "./getDeviceClass-bsWdEDxP.esm.js";
|
|
12
|
-
import { n as DEFAULT_ID_CAPTURE_THRESHOLDS, r as IdCaptureProvider } from "./idCaptureDefaults-
|
|
12
|
+
import { n as DEFAULT_ID_CAPTURE_THRESHOLDS, r as IdCaptureProvider } from "./idCaptureDefaults-DbDoL1m5.esm.js";
|
|
13
13
|
//#region src/internal/camera/cameraServices.ts
|
|
14
14
|
function createCameraServices(camera) {
|
|
15
15
|
return {
|