@incodetech/core 2.0.0 → 2.0.1-rc.0

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.
Files changed (178) hide show
  1. package/dist/Actor-CI32dTbG.d.ts +2 -0
  2. package/dist/BaseWasmProvider-C_DLEI40.esm.js +1118 -0
  3. package/dist/BrowserStorageProvider-CuOW1Er2.esm.js +55 -0
  4. package/dist/BrowserTimerProvider-DhNc_x02.esm.js +22 -0
  5. package/dist/ITimerCapability-C67ZRskg.esm.js +7 -0
  6. package/dist/IpifyProvider-D7jx52AL.esm.js +139 -0
  7. package/dist/Manager-C8PrhBOx.d.ts +19 -0
  8. package/dist/MotionSensorProvider-4v7xkqAp.esm.js +254 -0
  9. package/dist/OpenViduRecordingProvider-CMu6XVdc.esm.js +87 -0
  10. package/dist/StateMachine-BCQrZJhf.d.ts +2 -0
  11. package/dist/WasmUtilProvider-j98OJf-S.esm.js +114 -0
  12. package/dist/addressSearch-BpTbTWCa.esm.js +430 -0
  13. package/dist/ae-signature-DDDZmWXj.esm.js +12 -0
  14. package/dist/ae-signature.d.ts +25 -0
  15. package/dist/ae-signature.esm.js +8 -0
  16. package/dist/antifraud.d.ts +57 -0
  17. package/dist/antifraud.esm.js +45 -0
  18. package/dist/antifraudStateMachine-O0TMf6yc.esm.js +39 -0
  19. package/dist/api-CESGtpbH.esm.js +53 -0
  20. package/dist/authentication.d.ts +12 -0
  21. package/dist/authentication.esm.js +25 -0
  22. package/dist/authenticationManager-5M-fKzXx.esm.js +67 -0
  23. package/dist/authenticationManager-C83GNIhl.d.ts +66 -0
  24. package/dist/authenticationStateMachine-BMZqatiF.esm.js +139 -0
  25. package/dist/backCameraStream-DMdMeGk2.esm.js +346 -0
  26. package/dist/browserSimulation-gxD8cSpM.esm.js +20 -0
  27. package/dist/camera-DBSxa6ML.d.ts +4 -0
  28. package/dist/camera-PA2Ljri3.esm.js +22 -0
  29. package/dist/camera.d.ts +15 -0
  30. package/dist/camera.esm.js +5 -0
  31. package/dist/chunk-CRF6K_H_.esm.js +49 -0
  32. package/dist/consent.d.ts +398 -0
  33. package/dist/consent.esm.js +79 -0
  34. package/dist/consentStateMachine-CCT-B60O.esm.js +151 -0
  35. package/dist/cpf-PPz2Njto.esm.js +38 -0
  36. package/dist/cpf-ocr.d.ts +204 -0
  37. package/dist/cpf-ocr.esm.js +177 -0
  38. package/dist/cross-document-data-match.d.ts +34 -0
  39. package/dist/cross-document-data-match.esm.js +71 -0
  40. package/dist/curp-validation.d.ts +188 -0
  41. package/dist/curp-validation.esm.js +110 -0
  42. package/dist/curpValidationStateMachine-CitWLr2c.esm.js +595 -0
  43. package/dist/custom-fields.d.ts +115 -0
  44. package/dist/custom-fields.esm.js +177 -0
  45. package/dist/custom-watchlist.d.ts +66 -0
  46. package/dist/custom-watchlist.esm.js +86 -0
  47. package/dist/dateUtils-UoN5xswP.esm.js +23 -0
  48. package/dist/deepsightLoader-Cm4JIT_z.esm.js +52 -0
  49. package/dist/deepsightService-CEVxzehb.d.ts +412 -0
  50. package/dist/deepsightService-O74l4Y__.esm.js +489 -0
  51. package/dist/device.d.ts +46 -0
  52. package/dist/device.esm.js +106 -0
  53. package/dist/displayErrors-DqJ_IbsG.d.ts +39 -0
  54. package/dist/document-capture.d.ts +906 -0
  55. package/dist/document-capture.esm.js +156 -0
  56. package/dist/document-upload.d.ts +331 -0
  57. package/dist/document-upload.esm.js +203 -0
  58. package/dist/documentCaptureStateMachine-BqzTDy9k.esm.js +394 -0
  59. package/dist/dynamic-forms.d.ts +178 -0
  60. package/dist/dynamic-forms.esm.js +323 -0
  61. package/dist/ekyb.d.ts +148 -0
  62. package/dist/ekyb.esm.js +127 -0
  63. package/dist/ekybStateMachine-BR2let5f.esm.js +674 -0
  64. package/dist/ekyc.d.ts +164 -0
  65. package/dist/ekyc.esm.js +104 -0
  66. package/dist/ekycStateMachine-oeO0Iekd.esm.js +10626 -0
  67. package/dist/electronic-signature.d.ts +4 -0
  68. package/dist/electronic-signature.esm.js +7 -0
  69. package/dist/electronicSignatureManager-D9OHzTpG.esm.js +428 -0
  70. package/dist/email.d.ts +4 -0
  71. package/dist/email.esm.js +9 -0
  72. package/dist/emailManager-DIfnS5g1.d.ts +352 -0
  73. package/dist/emailManager-wAV0LE-H.esm.js +238 -0
  74. package/dist/emailStateMachine-DOf4j58N.esm.js +292 -0
  75. package/dist/endpoints-CnN3SyDa.esm.js +87 -0
  76. package/dist/events-D6-e4vok.esm.js +596 -0
  77. package/dist/events.d.ts +265 -0
  78. package/dist/events.esm.js +4 -0
  79. package/dist/extensibility.d.ts +122 -0
  80. package/dist/extensibility.esm.js +43 -0
  81. package/dist/face-match.d.ts +228 -0
  82. package/dist/face-match.esm.js +173 -0
  83. package/dist/faceCaptureManagerFactory-Dh2PdGlF.esm.js +290 -0
  84. package/dist/faceCaptureManagerFactory-yqtpxjnN.d.ts +690 -0
  85. package/dist/faceCaptureSetup-B3faSpYA.esm.js +873 -0
  86. package/dist/faceMatchStateMachine-DNFrxTFS.esm.js +127 -0
  87. package/dist/flow-events.d.ts +6 -0
  88. package/dist/flow-events.esm.js +0 -0
  89. package/dist/flow.d.ts +358 -0
  90. package/dist/flow.esm.js +825 -0
  91. package/dist/flowCompletionService-DhkT4SRY.d.ts +10 -0
  92. package/dist/flowCompletionService-P54yzGvA.esm.js +13 -0
  93. package/dist/flowServices-DG3IdWw6.esm.js +188 -0
  94. package/dist/geolocation.d.ts +127 -0
  95. package/dist/geolocation.esm.js +89 -0
  96. package/dist/geolocationStateMachine-asasuHY2.esm.js +105 -0
  97. package/dist/getBrowser-BSXUTWXw.esm.js +41 -0
  98. package/dist/getDeviceClass-BSntT9_j.esm.js +14 -0
  99. package/dist/government-validation.d.ts +67 -0
  100. package/dist/government-validation.esm.js +81 -0
  101. package/dist/governmentValidationStateMachine-BDDYrJTo.esm.js +271 -0
  102. package/dist/home.d.ts +99 -0
  103. package/dist/home.esm.js +61 -0
  104. package/dist/http.d.ts +68 -0
  105. package/dist/http.esm.js +3 -0
  106. package/dist/id-ocr.d.ts +635 -0
  107. package/dist/id-ocr.esm.js +86 -0
  108. package/dist/id-verification.d.ts +190 -0
  109. package/dist/id-verification.esm.js +43 -0
  110. package/dist/id.d.ts +24 -0
  111. package/dist/id.esm.js +164 -0
  112. package/dist/idCaptureManager-Fyd0eam-.d.ts +958 -0
  113. package/dist/idCaptureManager-ZPkD7Gjk.esm.js +581 -0
  114. package/dist/idCaptureStateMachine-BK0bPHoc.esm.js +2963 -0
  115. package/dist/idOcrStateMachine-YbjjC_Gg.esm.js +388 -0
  116. package/dist/idVerificationStateMachine-xbw9HP1Z.esm.js +71 -0
  117. package/dist/identity-reuse.d.ts +530 -0
  118. package/dist/identity-reuse.esm.js +274 -0
  119. package/dist/index-BcRG8rtJ.d.ts +97 -0
  120. package/dist/index-DZoqeAo9.d.ts +1177 -0
  121. package/dist/index.d.ts +3 -0
  122. package/dist/index.esm.js +12 -0
  123. package/dist/invokeOnCaptureCallback-rc6kBHo5.esm.js +30 -0
  124. package/dist/lib-BB0B_qQX.esm.js +12499 -0
  125. package/dist/mandatory-consent.d.ts +412 -0
  126. package/dist/mandatory-consent.esm.js +78 -0
  127. package/dist/mandatoryConsentStateMachine-Cnco1jvn.esm.js +126 -0
  128. package/dist/openviduLazy-Cm0XFh_v.esm.js +3 -0
  129. package/dist/openviduLazy-Cok70ZSg.esm.js +12 -0
  130. package/dist/permissionServices-D_i6nzEw.esm.js +50 -0
  131. package/dist/phone.d.ts +4 -0
  132. package/dist/phone.esm.js +9 -0
  133. package/dist/phoneManager-B6M30hKE.d.ts +397 -0
  134. package/dist/phoneManager-DAJbGhlY.esm.js +256 -0
  135. package/dist/phoneStateMachine-CuPARRaT.esm.js +351 -0
  136. package/dist/platform-CfrjKhmi.esm.js +83 -0
  137. package/dist/qe-signature-DFo_Cc-I.esm.js +12 -0
  138. package/dist/qe-signature.d.ts +25 -0
  139. package/dist/qe-signature.esm.js +8 -0
  140. package/dist/recordingService-Ig2UgbLv.esm.js +1003 -0
  141. package/dist/redirect-to-mobile.d.ts +107 -0
  142. package/dist/redirect-to-mobile.esm.js +102 -0
  143. package/dist/redirectToMobileStateMachine-BOEqe46A.esm.js +249 -0
  144. package/dist/runChildModule-CqqwqAkW.esm.js +219 -0
  145. package/dist/selfie.d.ts +26 -0
  146. package/dist/selfie.esm.js +146 -0
  147. package/dist/selfieManager-D0lSgd-J.d.ts +68 -0
  148. package/dist/selfieManager-Duisl7qN.esm.js +60 -0
  149. package/dist/selfieStateMachine-D76whWEf.esm.js +68 -0
  150. package/dist/session-CGtQJJzB.esm.js +3206 -0
  151. package/dist/session.d.ts +217 -0
  152. package/dist/session.esm.js +9 -0
  153. package/dist/setup-C5AITV8m.d.ts +254 -0
  154. package/dist/setup-DsM8IG7k.esm.js +887 -0
  155. package/dist/signature.d.ts +94 -0
  156. package/dist/signature.esm.js +66 -0
  157. package/dist/signatureStateMachine-B5-QVUve.esm.js +132 -0
  158. package/dist/stats-CIfiPzb1.esm.js +16 -0
  159. package/dist/stats.d.ts +16 -0
  160. package/dist/stats.esm.js +4 -0
  161. package/dist/trust-graph.d.ts +54 -0
  162. package/dist/trust-graph.esm.js +56 -0
  163. package/dist/types-B06Ypu2F.d.ts +49 -0
  164. package/dist/types-BP1m8VRw.d.ts +340 -0
  165. package/dist/types-CAD4va6a.d.ts +5 -0
  166. package/dist/types-CFV9G_7j.d.ts +24 -0
  167. package/dist/warmup-CEcppFiS.d.ts +63 -0
  168. package/dist/wasm.d.ts +15 -0
  169. package/dist/wasm.esm.js +12 -0
  170. package/dist/watchlist-for-business.d.ts +79 -0
  171. package/dist/watchlist-for-business.esm.js +148 -0
  172. package/dist/watchlist.d.ts +62 -0
  173. package/dist/watchlist.esm.js +86 -0
  174. package/dist/watchlistServices-DMbUhkBX.esm.js +12 -0
  175. package/dist/workflow.d.ts +907 -0
  176. package/dist/workflow.esm.js +702 -0
  177. package/dist/xstate.esm-B70JrNqo.esm.js +3404 -0
  178. package/package.json +1 -1
@@ -0,0 +1,958 @@
1
+ import { t as Manager } from "./Manager-C8PrhBOx.js";
2
+ import { t as ActorRefFrom } from "./Actor-CI32dTbG.js";
3
+ import { n as StateMachine, t as AnyStateMachine } from "./StateMachine-BCQrZJhf.js";
4
+ import { t as CameraStream } from "./camera-DBSxa6ML.js";
5
+ import { a as RegulationTypes, n as Flow, o as TutorialIdConfig } from "./types-BP1m8VRw.js";
6
+ import { c as IMLProviderCapability, d as IRecordingCapability, f as RecordingConnection, i as IncodeCanvas, l as MLProviderConfig, n as IMotionSensorCapability, r as StreamCanvasCapture, t as DeepsightService, u as IStorageCapability } from "./deepsightService-CEVxzehb.js";
7
+ import { n as PermissionStatus, t as PermissionResult } from "./types-CAD4va6a.js";
8
+
9
+ //#region ../infra/src/capabilities/IIdCaptureCapability.d.ts
10
+ /**
11
+ * Configuration for ID capture provider.
12
+ * Extends base ML provider config with ID-capture specific options.
13
+ */
14
+ type IdCaptureConfig$1 = MLProviderConfig;
15
+ interface IdCaptureThresholds$1 {
16
+ blurThreshold: number;
17
+ blurChangeThreshold: number;
18
+ glareThreshold: number;
19
+ clsThreshold: number;
20
+ sideThreshold: number;
21
+ iouThreshold: number;
22
+ idDetectedTimeout: number;
23
+ autocaptureTimeout: number;
24
+ framesAggregationInterval: number;
25
+ }
26
+ interface IdCaptureGeometry$1 {
27
+ areaDown: number;
28
+ areaUp: number;
29
+ areaIOSPassportUp: number;
30
+ areaIOSPassportDown: number;
31
+ widthIOSUp: number;
32
+ widthIOSDown: number;
33
+ widthDown: number;
34
+ widthUp: number;
35
+ windowOuterWidth: number;
36
+ windowOuterHeight: number;
37
+ windowInnerWidth: number;
38
+ windowInnerHeight: number;
39
+ }
40
+ interface IdCaptureSettings {
41
+ isFixedMask: boolean;
42
+ isIPhone14OrHigher: boolean;
43
+ idType: string;
44
+ blurCheckEnabled: boolean;
45
+ glareCheckEnabled: boolean;
46
+ faceQualityCheckEnabled: boolean;
47
+ iouCheckEnabled: boolean;
48
+ fpsLimitEnabled: boolean;
49
+ }
50
+ type IdCaptureModelType = 'v1' | 'v2' | 'v3';
51
+ type DetectionOrientation = 'horizontal' | 'vertical';
52
+ interface IdCaptureCallbacks {
53
+ onFarAway?: () => void;
54
+ onDetectionStarted?: () => void;
55
+ onMaskChange?: (show: boolean, mask: boolean, top: number, orientation: DetectionOrientation) => void;
56
+ onBlur?: () => void;
57
+ onGlare?: () => void;
58
+ onCapturing?: () => void;
59
+ onCapture?: () => void;
60
+ onBestFrame?: (blur: number, glare: number, orientation: string) => void;
61
+ onIdNotDetected?: () => void;
62
+ onSwitchToManualCapture?: () => void;
63
+ onIdTypeChange?: (idType: string) => void;
64
+ onIdSideChange?: (side: string) => void;
65
+ onCapturingCounterValueChange?: (value: number) => void;
66
+ }
67
+ /**
68
+ * WASM array type for quad coordinates.
69
+ * Use .get(index) instead of [index] to access elements.
70
+ */
71
+ interface QuadArray {
72
+ get(index: number): {
73
+ x: number;
74
+ y: number;
75
+ };
76
+ size?(): number;
77
+ length?: number;
78
+ }
79
+ interface IdCaptureProcessResult {
80
+ cls: number;
81
+ blur: number;
82
+ glare: number;
83
+ quad: QuadArray;
84
+ barQuad: QuadArray;
85
+ side: string;
86
+ size: number;
87
+ idType: string;
88
+ networkInferenceTime: number;
89
+ }
90
+ /**
91
+ * Capability interface for ID document capture.
92
+ * Extends the base ML provider capability with ID-capture specific methods.
93
+ */
94
+ interface IIdCaptureCapability extends IMLProviderCapability<IdCaptureConfig$1> {
95
+ /**
96
+ * Sets callbacks for ID capture events.
97
+ * @param callbacks - Object containing callback functions for various capture events
98
+ */
99
+ setCallbacks(callbacks: IdCaptureCallbacks): void;
100
+ /**
101
+ * Sets detection thresholds for quality checks.
102
+ * @param thresholds - Threshold values for blur, glare, and other quality metrics
103
+ */
104
+ setThresholds(thresholds: IdCaptureThresholds$1): void;
105
+ /**
106
+ * Sets geometry constraints for ID detection.
107
+ * @param geometry - Geometry parameters for ID positioning
108
+ */
109
+ setGeometry(geometry: IdCaptureGeometry$1): void;
110
+ /**
111
+ * Sets capture settings.
112
+ * @param settings - Configuration for capture behavior
113
+ */
114
+ setSettings(settings: IdCaptureSettings): void;
115
+ /**
116
+ * Sets the ML model type to use for ID detection.
117
+ * @param modelType - Model version ('v1', 'v2', or 'v3')
118
+ */
119
+ setModelType(modelType: IdCaptureModelType): void;
120
+ /**
121
+ * Gets the last process result from the most recent frame processing.
122
+ * Returns null if no frame has been processed yet.
123
+ * @returns The last process result with quad coordinates, or null if not available
124
+ */
125
+ getLastProcessResult(): IdCaptureProcessResult | null;
126
+ /**
127
+ * Transforms the canvas using perspective correction based on frame coordinates.
128
+ * @param canvas - The canvas to transform
129
+ * @param frameRect - Frame rectangle in canvas coordinates (x, y, w, h)
130
+ * @returns The transformed canvas
131
+ */
132
+ transformPerspective(canvas: IncodeCanvas, frameRect: {
133
+ x: number;
134
+ y: number;
135
+ w: number;
136
+ h: number;
137
+ }): IncodeCanvas;
138
+ /**
139
+ * Gets the captured canvas (transformed for preview).
140
+ * @returns The captured canvas, or null if not available
141
+ */
142
+ getCapturedCanvas(): IncodeCanvas | null;
143
+ /**
144
+ * Gets the original captured canvas (full frame for upload).
145
+ * @returns The original captured canvas, or null if not available
146
+ */
147
+ getOriginalCapturedCanvas(): IncodeCanvas | null;
148
+ /**
149
+ * Sets the captured canvases (original and transformed).
150
+ * Called by the state machine after capture and transformation.
151
+ * @param original - The original full-frame canvas (for upload)
152
+ * @param transformed - The transformed canvas (for preview)
153
+ */
154
+ setCapturedCanvases(original: IncodeCanvas, transformed: IncodeCanvas): void;
155
+ }
156
+ //#endregion
157
+ //#region src/modules/id/manualUpload/types.d.ts
158
+ type ManualUploadTab = 'id' | 'passport';
159
+ type ManualUploadSide = 'front' | 'back' | 'passport';
160
+ type ManualUploadContext = {
161
+ /** Passed from parent machine input — used by guards and actor inputs. */
162
+ onlyFront: boolean;
163
+ isSecondId: boolean;
164
+ /** Retry budget for this manual upload (sourced from `config.captureAttempts`). */
165
+ captureAttempts: number;
166
+ frontFile: File | null;
167
+ backFile: File | null;
168
+ passportFile: File | null;
169
+ activeTab: ManualUploadTab;
170
+ retriesLeft: number;
171
+ errorMessage: string | null;
172
+ /** Set from the front upload response; when true the back slot is auto-completed */
173
+ skipBackFromServer: boolean;
174
+ /** Whether each side has been successfully uploaded (for Continue gating) */
175
+ frontUploaded: boolean;
176
+ backUploaded: boolean;
177
+ passportUploaded: boolean;
178
+ };
179
+ declare const MANUAL_UPLOAD_MAX_RETRIES = 3;
180
+ declare const MANUAL_UPLOAD_MAX_FILE_SIZE_BYTES: number;
181
+ declare const MANUAL_UPLOAD_EXHAUSTION_FORWARD_MS = 5000;
182
+ //#endregion
183
+ //#region ../infra/src/capabilities/IAnalyticsCapability.d.ts
184
+ interface IAnalyticsCapability {
185
+ analyzeFrame(image: ImageData): Promise<void>;
186
+ update(): void;
187
+ getAnalysisStatus(): string;
188
+ getMotionStatus(): string;
189
+ getMetadata(): string;
190
+ }
191
+ //#endregion
192
+ //#region src/modules/id/types.d.ts
193
+ type IdCaptureMode = 'front' | 'back' | 'passport';
194
+ /**
195
+ * Document type options for the ID capture chooser (ID, passport, manual ID upload, digital ID upload, digital ID from device wallet).
196
+ * Used for selection and for the list of available options derived from config.
197
+ */
198
+ type IdDocumentType = 'id' | 'passport' | 'manualIdUpload' | 'digitalIdUpload' | 'digitalId';
199
+ type IdFlowStep = 'chooser' | 'ageVerification' | 'tutorial' | 'permissions' | 'capture' | 'mandatoryConsent' | 'frontFinished' | 'backFinished' | 'success' | 'processing' | 'expired' | 'finished' | 'error' | 'closed' | 'manualIdUpload' | 'digitalIdUpload';
200
+ type DetectionStatus = 'idle' | 'detecting' | 'farAway' | 'blur' | 'glare' | 'wrongSide' | 'capturing' | 'manualCapture' | 'idNotDetected' | 'offline';
201
+ /**
202
+ * Represents the detection area dimensions in pixels.
203
+ * Used by UI to communicate the expected ID position and size to the WASM detection.
204
+ */
205
+ type DetectionArea = {
206
+ x: number;
207
+ y: number;
208
+ width: number;
209
+ height: number;
210
+ };
211
+ type IdCaptureGeometry = {
212
+ areaDown: number;
213
+ areaUp: number;
214
+ areaIOSPassportUp: number;
215
+ areaIOSPassportDown: number;
216
+ widthIOSUp: number;
217
+ widthIOSDown: number;
218
+ widthDown: number;
219
+ widthUp: number;
220
+ windowOuterWidth: number;
221
+ windowOuterHeight: number;
222
+ windowInnerWidth: number;
223
+ windowInnerHeight: number;
224
+ };
225
+ type IdCaptureThresholds = {
226
+ blurThreshold: number;
227
+ blurChangeThreshold: number;
228
+ glareThreshold: number;
229
+ clsThreshold: number;
230
+ sideThreshold: number;
231
+ iouThreshold: number;
232
+ framesAggregationInterval: number;
233
+ idDetectedTimeout: number;
234
+ autocaptureTimeout: number;
235
+ };
236
+ type IdCaptureConfig = TutorialIdConfig & {
237
+ recording?: {
238
+ capability?: IRecordingCapability;
239
+ };
240
+ ageAssurance?: boolean;
241
+ mergeSessionRecordings?: boolean;
242
+ isDeepsightEnabled?: boolean;
243
+ isSecondId?: boolean;
244
+ geometry?: IdCaptureGeometry;
245
+ detectionArea?: DetectionArea;
246
+ thresholds?: Partial<IdCaptureThresholds>;
247
+ settings?: Partial<IdCaptureSettings>;
248
+ modelVersion?: 'v1' | 'v2' | 'v3';
249
+ ds?: Flow['ds'];
250
+ /**
251
+ * When true, the capture machine reaches `finished` immediately after
252
+ * back-side / manual-upload completion instead of invoking `/process/id`.
253
+ * Used by engines where verification is owned by a downstream node — the
254
+ * Workflow engine's `ID` node (handled by `idVerificationMachine`). Flow and
255
+ * any other single-step caller leave this `false` so the inline verification
256
+ * + recapture-on-expired UX continues to work.
257
+ */
258
+ skipProcessId?: boolean;
259
+ };
260
+ /**
261
+ * Public ID capture configuration for the captureOnly flow.
262
+ *
263
+ * Differs from {@link IdCaptureConfig} by requiring an `onCapture` callback —
264
+ * captureOnly bypasses the Incode upload pipeline and delivers the rich
265
+ * capture payload locally instead. Compile-time enforcement (vs. a runtime
266
+ * check) prevents shipping a captureOnly flow with no destination for the
267
+ * payload.
268
+ */
269
+ type IdCaptureOnlyConfig = IdCaptureConfig & {
270
+ onCapture: (response: CaptureOnlyResponse) => void | Promise<void>;
271
+ };
272
+ type IdErrorCode = 'UPLOAD_ERROR' | 'CLASSIFICATION_FAILED' | 'LOW_SHARPNESS' | 'GLARE_DETECTED' | 'WRONG_DOCUMENT_SIDE' | 'ID_TYPE_UNACCEPTABLE' | 'READABILITY_ISSUE' | 'RETRY_EXHAUSTED_CONTINUE_TO_BACK' | 'RETRY_EXHAUSTED_SKIP_BACK' | 'NO_MORE_TRIES' | 'UNEXPECTED_ERROR' | 'NO_TOKEN' | 'PERMISSION_DENIED' | 'USER_CANCELLED' | 'SERVER_ERROR';
273
+ type IdError = {
274
+ code: IdErrorCode;
275
+ message: string;
276
+ messageDescription?: string;
277
+ };
278
+ type UploadIdResponse = {
279
+ sharpness: number;
280
+ correctSharpness: boolean;
281
+ glare: number;
282
+ correctGlare: boolean;
283
+ horizontalResolution: number;
284
+ classification: boolean;
285
+ readability: boolean;
286
+ typeOfId: string;
287
+ issueYear: number;
288
+ issueName: string;
289
+ curpCheck?: boolean;
290
+ sessionStatus: string;
291
+ countryCode: string;
292
+ state?: string;
293
+ skipBackIdCapture?: boolean;
294
+ skipGlareFront?: boolean;
295
+ skipGlareBack?: boolean;
296
+ documentIsOnTheEdge?: boolean;
297
+ acceptedDocuments?: Array<{
298
+ type: string;
299
+ name: string;
300
+ }>;
301
+ forceFrontIdCapture?: boolean;
302
+ showMandatoryConsent?: boolean;
303
+ regulationType?: RegulationTypes;
304
+ failReason?: string;
305
+ side?: 'front' | 'back';
306
+ idQualityAttemptApproved?: boolean;
307
+ isDocumentExpired?: boolean;
308
+ /** `false` means the upload was rejected even when no `failReason` is set. */
309
+ success?: boolean;
310
+ };
311
+ type CaptureIdResponse = UploadIdResponse & {
312
+ croppedIDFace?: string;
313
+ croppedFrontID?: string;
314
+ croppedBackID?: string;
315
+ originalImage?: string;
316
+ frontIdImage?: string;
317
+ backIdImage?: string;
318
+ };
319
+ type CapturedImage = {
320
+ imageBase64: string;
321
+ };
322
+ /**
323
+ * Rich captured image shape used by the captureOnly flow.
324
+ *
325
+ * `imageBase64`/`blob`/`url` reference the unprocessed full frame — always
326
+ * present and the safest input for integrator-side processing.
327
+ *
328
+ * `croppedImage` is a best-effort approximate document crop produced by a
329
+ * bilinear quad map (not a true perspective/homography warp). It is
330
+ * populated only when on-device quad detection succeeds, and will visibly
331
+ * diverge from the correct projective result for strongly tilted captures.
332
+ * Prefer `imageBase64` when fidelity matters.
333
+ */
334
+ type IdCapturedImageData = {
335
+ imageBase64: string;
336
+ blob: Blob;
337
+ url: string;
338
+ metadata: string;
339
+ croppedImage?: {
340
+ imageBase64: string;
341
+ blob: Blob;
342
+ url: string;
343
+ };
344
+ };
345
+ /**
346
+ * Payload delivered to `IdCaptureConfig.onCapture` when `captureOnly` is enabled.
347
+ */
348
+ type CaptureOnlyResponse = {
349
+ frontImage: IdCapturedImageData;
350
+ backImage: IdCapturedImageData | undefined;
351
+ };
352
+ type RecordingSession = {
353
+ token: string;
354
+ sessionId: string;
355
+ videoRecordingId: string;
356
+ connection: RecordingConnection;
357
+ resolution?: string;
358
+ hasAudio: boolean;
359
+ };
360
+ declare const ID_ERROR_CODES: {
361
+ readonly UPLOAD_ERROR: "UPLOAD_ERROR";
362
+ readonly CLASSIFICATION_FAILED: "CLASSIFICATION_FAILED";
363
+ readonly LOW_SHARPNESS: "LOW_SHARPNESS";
364
+ readonly GLARE_DETECTED: "GLARE_DETECTED";
365
+ readonly WRONG_DOCUMENT_SIDE: "WRONG_DOCUMENT_SIDE";
366
+ readonly ID_TYPE_UNACCEPTABLE: "ID_TYPE_UNACCEPTABLE";
367
+ readonly READABILITY_ISSUE: "READABILITY_ISSUE";
368
+ readonly RETRY_EXHAUSTED_CONTINUE_TO_BACK: "RETRY_EXHAUSTED_CONTINUE_TO_BACK";
369
+ readonly RETRY_EXHAUSTED_SKIP_BACK: "RETRY_EXHAUSTED_SKIP_BACK";
370
+ readonly NO_MORE_TRIES: "NO_MORE_TRIES";
371
+ readonly UNEXPECTED_ERROR: "UNEXPECTED_ERROR";
372
+ readonly NO_TOKEN: "NO_TOKEN";
373
+ readonly PERMISSION_DENIED: "PERMISSION_DENIED";
374
+ readonly USER_CANCELLED: "USER_CANCELLED";
375
+ readonly SERVER: "SERVER_ERROR";
376
+ };
377
+ type IdCaptureContext = {
378
+ config: IdCaptureConfig;
379
+ currentMode: IdCaptureMode;
380
+ selectedDocumentType: IdDocumentType | undefined;
381
+ stream: CameraStream | undefined;
382
+ provider: IIdCaptureCapability | undefined;
383
+ frameCapturer: StreamCanvasCapture | undefined;
384
+ error: string | undefined;
385
+ detectionStatus: DetectionStatus;
386
+ counterValue: number;
387
+ orientation: DetectionOrientation | undefined;
388
+ capturedImages: {
389
+ front?: CapturedImage;
390
+ back?: CapturedImage;
391
+ };
392
+ /**
393
+ * Rich capture payload used only by the captureOnly flow.
394
+ * Populated by `finalizeIdCaptureOnly` actor; consumed by `finished.entry`
395
+ * when firing `config.onCapture`. Remains empty in the regular upload flow.
396
+ */
397
+ captureOnlyImages: {
398
+ front?: IdCapturedImageData;
399
+ back?: IdCapturedImageData;
400
+ };
401
+ uploadResponse: CaptureIdResponse | undefined;
402
+ recordingSession: RecordingSession | undefined;
403
+ attemptsRemaining: number;
404
+ /**
405
+ * Number of consecutive `isDocumentExpired === true` upload responses for
406
+ * the current side. Reset on side change; preserved across the soft-retry
407
+ * cycle (`expired → capture`). Compared against `config.captureAttempts`.
408
+ */
409
+ expiredAttempts: number;
410
+ /**
411
+ * Number of times `processId` (end-of-flow expired detection) has returned
412
+ * `isDocumentExpired === true` in this session. Persists across the full
413
+ * `resetContext`-driven retry loop (Figma Story #2.2, 2-cap on the
414
+ * digital-upload / multi-side path).
415
+ */
416
+ processingExpiredAttempts: number;
417
+ /**
418
+ * Set when the user has reached `expiredExhausted` and clicks Continue.
419
+ * Tells the `processing` state to bypass `processId` (V1 parity: no
420
+ * `/omni/process-id` call after force-back).
421
+ */
422
+ skipProcessId: boolean;
423
+ /**
424
+ * Distinguishes the two entry paths into the `expired` screen:
425
+ * `true` for per-upload (camera) expired, `false` for `processing.onDone`
426
+ * (digital-upload / end-of-flow expired). Drives the soft-retry branch.
427
+ */
428
+ expiredFromUpload: boolean;
429
+ /**
430
+ * `true` once a Digital ID upload has succeeded for this session. Digital
431
+ * IDs are single-side documents (semantically like a passport), so back
432
+ * capture must be skipped regardless of `alwaysCaptureBackOfId`. Used by
433
+ * the manager mapper's `shouldCaptureBack` to suppress `needsBackCapture`
434
+ * for the workflow orchestrator.
435
+ */
436
+ isDigitalUpload: boolean;
437
+ /**
438
+ * Set when `expiredExhausted` was reached via the per-upload (camera)
439
+ * exhaustion path. Used by `CONTINUE_EXHAUSTED` to decide whether to run
440
+ * `processId` once before finishing — required so the backend processes
441
+ * whatever sides were uploaded (e.g. valid front + expired back).
442
+ */
443
+ exhaustedFromUpload: boolean;
444
+ /**
445
+ * Tells the `processing` state to skip the per-upload-expired retry/exhaustion
446
+ * branches and go straight to `finished` after `processId.onDone`. Set
447
+ * when entering `processing` from the `expiredExhausted → Continue` path
448
+ * so we don't loop back to the Expired screen after we've already shown
449
+ * the terminal "No attempts remaining" view.
450
+ */
451
+ forceFinishAfterProcessing: boolean;
452
+ uploadError: IdErrorCode | undefined;
453
+ permissionResult: PermissionResult | 'refresh' | undefined;
454
+ resetDetection: (() => void) | undefined;
455
+ idType: string | undefined;
456
+ qualityElements: {
457
+ glare?: number;
458
+ sharpness?: number;
459
+ } | undefined;
460
+ debugFrame: ImageData | undefined;
461
+ frameRect: {
462
+ x: number;
463
+ y: number;
464
+ w: number;
465
+ h: number;
466
+ } | undefined;
467
+ detectionArea: DetectionArea | undefined;
468
+ previewImageUrl?: string;
469
+ uploadProgress?: number;
470
+ motionStatus?: 'PASS' | 'FAIL' | 'UNCLEAR';
471
+ manualCaptureTriggered: boolean;
472
+ deepsightService: DeepsightService | undefined;
473
+ analyticsProvider: IAnalyticsCapability | undefined;
474
+ dependencies: IdCaptureDependencies | undefined;
475
+ disableIpify: boolean;
476
+ deepsightInitAttempted: boolean;
477
+ availableDocumentTypes: IdDocumentType[];
478
+ /** Negotiated camera resolution (e.g. "1920x1080") for telemetry */
479
+ captureResolution?: string;
480
+ /** Android camera access fallback level that succeeded */
481
+ cameraFallbackLevel?: number;
482
+ };
483
+ type IdCaptureEvent = {
484
+ type: 'LOAD';
485
+ } | {
486
+ type: 'SELECT_DOCUMENT';
487
+ documentType: IdDocumentType;
488
+ } | {
489
+ type: 'NEXT_STEP';
490
+ } | {
491
+ type: 'REQUEST_PERMISSION';
492
+ } | {
493
+ type: 'GO_TO_LEARN_MORE';
494
+ } | {
495
+ type: 'BACK';
496
+ } | {
497
+ type: 'QUIT';
498
+ } | {
499
+ type: 'RESET';
500
+ } | {
501
+ type: 'MANUAL_CAPTURE';
502
+ } | {
503
+ type: 'SWITCH_TO_MANUAL_CAPTURE';
504
+ } | {
505
+ type: 'DETECTION_UPDATE';
506
+ status: DetectionStatus;
507
+ } | {
508
+ type: 'DETECTION_FRAME';
509
+ frame: ImageData;
510
+ } | {
511
+ type: 'DETECTION_SUCCESS';
512
+ canvas: IncodeCanvas;
513
+ qualityElements?: {
514
+ glare?: number;
515
+ sharpness?: number;
516
+ };
517
+ } | {
518
+ type: 'DETECTION_RESET_READY';
519
+ reset: () => void;
520
+ } | {
521
+ type: 'COUNTER_VALUE_CHANGE';
522
+ value: number;
523
+ } | {
524
+ type: 'ID_TYPE_CHANGE';
525
+ idType: string;
526
+ } | {
527
+ type: 'ID_SIDE_CHANGE';
528
+ side: string;
529
+ } | {
530
+ type: 'ORIENTATION_CHANGE';
531
+ orientation: DetectionOrientation;
532
+ } | {
533
+ type: 'RETRY_CAPTURE';
534
+ } | {
535
+ type: 'CONTINUE_EXHAUSTED';
536
+ } | {
537
+ type: 'CONTINUE_FROM_ERROR';
538
+ } | {
539
+ type: 'FRONT_COMPLETE';
540
+ } | {
541
+ type: 'CONTINUE_TO_BACK';
542
+ } | {
543
+ type: 'CONTINUE_TO_FRONT';
544
+ } | {
545
+ type: 'PROCESS_COMPLETE';
546
+ } | {
547
+ type: 'PROCESS_EXPIRED';
548
+ } | {
549
+ type: 'CONSENT_ACCEPT';
550
+ } | {
551
+ type: 'CONSENT_CANCEL';
552
+ } | {
553
+ type: 'SKIP_BACK';
554
+ } | {
555
+ type: 'UPLOAD_PROGRESS';
556
+ progress: number;
557
+ } | {
558
+ type: 'SET_FRAME_RECT';
559
+ frameRect: {
560
+ x: number;
561
+ y: number;
562
+ w: number;
563
+ h: number;
564
+ };
565
+ } | {
566
+ type: 'UPDATE_DETECTION_AREA';
567
+ detectionArea: {
568
+ x: number;
569
+ y: number;
570
+ width: number;
571
+ height: number;
572
+ };
573
+ } | {
574
+ type: 'MOTION_STATUS';
575
+ status: 'PASS' | 'FAIL' | 'UNCLEAR';
576
+ } | {
577
+ type: 'MANUAL_UPLOAD_TAB_CHANGED';
578
+ tab: ManualUploadTab;
579
+ } | {
580
+ type: 'MANUAL_UPLOAD_FILE_SELECTED';
581
+ side: ManualUploadSide;
582
+ file: File;
583
+ } | {
584
+ type: 'MANUAL_UPLOAD_CONTINUE';
585
+ } | {
586
+ type: 'MANUAL_UPLOAD_RESET';
587
+ } | {
588
+ type: 'DIGITAL_UPLOAD_NEXT_STEP';
589
+ } | {
590
+ type: 'DIGITAL_UPLOAD_FILE_PICKED';
591
+ file: File;
592
+ } | {
593
+ type: 'DIGITAL_UPLOAD_CONFIRM';
594
+ } | {
595
+ type: 'DIGITAL_UPLOAD_REPLACE';
596
+ } | {
597
+ type: 'DIGITAL_UPLOAD_RETRY';
598
+ } | {
599
+ type: 'DIGITAL_UPLOAD_SCAN_INSTEAD';
600
+ } | {
601
+ type: 'DIGITAL_UPLOAD_CHOOSE_ANOTHER';
602
+ };
603
+ type IdCaptureDependencies = {
604
+ storage: IStorageCapability;
605
+ trackCaptureAttemptFinished?: (payload: {
606
+ logs: string;
607
+ resolution?: string;
608
+ fallbackLevel?: number;
609
+ }) => void;
610
+ };
611
+ type IdCaptureInput = {
612
+ config: IdCaptureConfig;
613
+ motionProvider?: IMotionSensorCapability;
614
+ analyticsProvider?: IAnalyticsCapability;
615
+ dependencies?: IdCaptureDependencies;
616
+ };
617
+ //#endregion
618
+ //#region src/modules/id/idCaptureStateMachine.d.ts
619
+ declare const idCaptureMachine: AnyStateMachine;
620
+ type IdCaptureMachine = StateMachine<IdCaptureContext, IdCaptureEvent, any, any, any, any, any, any, any, IdCaptureInput, any, any, any, any>;
621
+ //#endregion
622
+ //#region src/modules/id/idCaptureActor.d.ts
623
+ type CreateIdCaptureActorOptions = {
624
+ config: IdCaptureConfig;
625
+ dependencies?: IdCaptureDependencies;
626
+ };
627
+ type IdCaptureActor = ActorRefFrom<IdCaptureMachine>;
628
+ declare function createIdCaptureActor(options: CreateIdCaptureActorOptions): IdCaptureActor;
629
+ //#endregion
630
+ //#region src/modules/id/idCaptureOnlyStateMachine.d.ts
631
+ type IdCaptureOnlyContext = IdCaptureContext;
632
+ type IdCaptureOnlyEvent = IdCaptureEvent;
633
+ type IdCaptureOnlyInput = IdCaptureInput;
634
+ /**
635
+ * ID capture state machine variant for the captureOnly flow. Shares the full
636
+ * base ID-capture state tree (chooser, tutorial, permissions, capture,
637
+ * front/back finished, processing, finished); only the upload, process, and
638
+ * recording steps are local instead of remote.
639
+ */
640
+ declare const idCaptureOnlyMachine: AnyStateMachine;
641
+ type IdCaptureOnlyMachine = StateMachine<IdCaptureOnlyContext, IdCaptureOnlyEvent, any, any, any, any, any, any, any, IdCaptureOnlyInput, any, any, any, any>;
642
+ //#endregion
643
+ //#region src/modules/id/idCaptureOnlyActor.d.ts
644
+ type CreateIdCaptureOnlyActorOptions = {
645
+ config: IdCaptureOnlyConfig;
646
+ dependencies?: IdCaptureDependencies;
647
+ };
648
+ type IdCaptureOnlyActor = ActorRefFrom<IdCaptureOnlyMachine>;
649
+ declare function createIdCaptureOnlyActor(options: CreateIdCaptureOnlyActorOptions): IdCaptureOnlyActor;
650
+ //#endregion
651
+ //#region src/modules/id/idCaptureServices.d.ts
652
+ type IdCaptureInitResult = {
653
+ stream: CameraStream;
654
+ provider: IIdCaptureCapability;
655
+ captureResolution?: string;
656
+ cameraFallbackLevel?: number;
657
+ };
658
+ type InitializeIdCaptureParams = {
659
+ config: IdCaptureConfig;
660
+ deepsightService?: DeepsightService;
661
+ };
662
+ declare function initializeIdCapture(params: InitializeIdCaptureParams): Promise<IdCaptureInitResult>;
663
+ declare function stopStream(stream: CameraStream): void;
664
+ type UploadIdImageParams = {
665
+ image: string;
666
+ type: 'front' | 'back';
667
+ sendBase64?: boolean;
668
+ isSecondId?: boolean;
669
+ onlyFront?: boolean;
670
+ glare?: number;
671
+ sharpness?: number;
672
+ shouldSkipGlareBack?: boolean;
673
+ shouldSkipGlareFront?: boolean;
674
+ captureType?: string;
675
+ ageAssurance?: boolean;
676
+ onProgress?: (progress: number) => void;
677
+ metadata?: string;
678
+ signal?: AbortSignal;
679
+ analyticsProvider?: IAnalyticsCapability;
680
+ imageData?: ImageData;
681
+ };
682
+ type ValidationError = {
683
+ error: boolean;
684
+ message: string;
685
+ messageDescription?: string;
686
+ errorKey: IdErrorCode;
687
+ };
688
+ declare function validateUploadResponse(response: UploadIdResponse & {
689
+ failReason?: string;
690
+ side?: 'front' | 'back';
691
+ }, sessionState?: {
692
+ skipGlareFront?: boolean;
693
+ skipGlareBack?: boolean;
694
+ }): ValidationError | undefined;
695
+ declare function uploadIdImage(params: UploadIdImageParams): Promise<CaptureIdResponse>;
696
+ type StartRecordingParams = {
697
+ config: IdCaptureConfig;
698
+ stream: CameraStream;
699
+ existing?: RecordingSession;
700
+ type: 'frontId' | 'backId';
701
+ };
702
+ declare function preloadIdRecordingProvider(config: IdCaptureConfig): void;
703
+ declare function startRecordingSession(params: StartRecordingParams): Promise<RecordingSession | undefined>;
704
+ declare function stopRecording(session: RecordingSession): void;
705
+ declare function processId(isSecondId?: boolean, queueName?: string, signal?: AbortSignal): Promise<{
706
+ isDocumentExpired: boolean;
707
+ }>;
708
+ type UploadManualIdFileParams = {
709
+ side: 'front' | 'back' | 'passport';
710
+ /**
711
+ * Raw base64 payload (no `data:<mime>;base64,` prefix). Callers must strip
712
+ * the data-URL prefix — the v2 backend rejects data URLs with
713
+ * `IllegalArgumentException: Illegal base64 character 3a`.
714
+ */
715
+ base64Image: string;
716
+ retry?: boolean;
717
+ onlyFront?: boolean;
718
+ signal?: AbortSignal;
719
+ isSecondId?: boolean;
720
+ };
721
+ /**
722
+ * Upload a user-selected image as front / back / passport ID.
723
+ *
724
+ * Uses the same request shape as the live-camera path (`uploadIdImage`):
725
+ * JSON body `{ base64Image }` with default application/json Content-Type,
726
+ * `captureType=UPLOAD` query param, `retry=true` when retrying.
727
+ * Back is POSTed to `/omni/add/back-id/v2` (or `/omni/add/back-second-id/v2`
728
+ * when `isSecondId`); front and passport go to `/omni/add/front-id/v2` (or
729
+ * `/omni/add/front-second-id/v2` when `isSecondId`).
730
+ *
731
+ * The v2 endpoints reject raw `image/jpeg` bodies with 415, so the caller
732
+ * must convert the File to base64 before calling this service.
733
+ */
734
+ declare function uploadManualIdFile(params: UploadManualIdFileParams): Promise<UploadIdResponse>;
735
+ //#endregion
736
+ //#region src/modules/id/digitalUpload/types.d.ts
737
+ type DigitalUploadFailReason = 'DIGITAL_ID_REQUESTED_BUT_OTHER_PROVIDED' | 'ID_TYPE_UNACCEPTABLE' | 'FILE_CHANGED_ERROR' | 'INVALID_FILE_TYPE' | 'NETWORK_ERROR' | 'GENERIC';
738
+ //#endregion
739
+ //#region src/internal/idCapture/idCaptureManagerFactory.d.ts
740
+ type CaptureStatus = 'initializing' | 'detecting' | 'capturing' | 'uploading' | 'uploadError' | 'success';
741
+ type IdCaptureIdleState = {
742
+ status: 'idle';
743
+ };
744
+ type IdCaptureChooserState = {
745
+ status: 'chooser';
746
+ availableDocumentTypes: IdDocumentType[];
747
+ };
748
+ type IdCaptureLoadingState = {
749
+ status: 'loading';
750
+ };
751
+ type IdCaptureTutorialState = {
752
+ status: 'tutorial';
753
+ selectedDocumentType: IdDocumentType | undefined;
754
+ currentMode: IdCaptureMode;
755
+ };
756
+ type IdCaptureAgeVerificationState = {
757
+ status: 'ageVerification';
758
+ };
759
+ type IdCapturePermissionsState = {
760
+ status: 'permissions';
761
+ permissionStatus: PermissionStatus;
762
+ };
763
+ type IdCaptureCaptureState = {
764
+ status: 'capture';
765
+ captureStatus: CaptureStatus;
766
+ stream: CameraStream | undefined;
767
+ detectionStatus: DetectionStatus;
768
+ debugFrame: ImageData | undefined;
769
+ attemptsRemaining: number;
770
+ uploadError: IdErrorCode | undefined;
771
+ currentMode: IdCaptureMode;
772
+ counterValue: number;
773
+ orientation: DetectionOrientation | undefined;
774
+ idType: string | undefined;
775
+ previewImageUrl?: string;
776
+ uploadProgress?: number;
777
+ ageAssurance: boolean;
778
+ uploadErrorMessage?: string;
779
+ uploadErrorDescription?: string;
780
+ /** Whether back capture is needed after front capture completes */
781
+ needsBackCapture: boolean;
782
+ /** Whether front capture is needed after back capture (usSmartCapture + forceFrontIdCapture) */
783
+ needsFrontCapture: boolean;
784
+ showCaptureButtonInAuto: boolean;
785
+ /** Whether retry is available (attemptsRemaining > 0) */
786
+ canRetry: boolean;
787
+ };
788
+ type IdCaptureMandatoryConsentState = {
789
+ status: 'mandatoryConsent';
790
+ regulationType: RegulationTypes;
791
+ };
792
+ type IdCaptureFrontFinishedState = {
793
+ status: 'frontFinished';
794
+ };
795
+ type IdCaptureBackFinishedState = {
796
+ status: 'backFinished';
797
+ };
798
+ type IdCaptureProcessingState = {
799
+ status: 'processing';
800
+ };
801
+ type IdCaptureExpiredState = {
802
+ status: 'expired';
803
+ /**
804
+ * Remaining attempts after this expired result. Mirrors V1's
805
+ * `idv2.capture.processing.attemptsRemainingLabel` counter and Figma's
806
+ * "X attempts remaining" line on `1-9-11-id-documenterror`.
807
+ */
808
+ attemptsRemaining: number;
809
+ };
810
+ type IdCaptureExpiredExhaustedState = {
811
+ status: 'expiredExhausted';
812
+ };
813
+ type IdCaptureFinishedState = {
814
+ status: 'finished';
815
+ };
816
+ type IdCaptureClosedState = {
817
+ status: 'closed';
818
+ };
819
+ type IdCaptureErrorState = {
820
+ status: 'error';
821
+ error: string;
822
+ };
823
+ type ManualUploadUploadingSide = ManualUploadSide;
824
+ type IdCaptureManualUploadState = {
825
+ status: 'manualUpload';
826
+ phase: 'selecting' | 'uploading' | 'exhausted';
827
+ /** Which side is currently uploading (undefined in `selecting`/`exhausted`). */
828
+ uploadingSide: ManualUploadUploadingSide | undefined;
829
+ activeTab: ManualUploadTab;
830
+ showIdTab: boolean;
831
+ showPassportTab: boolean;
832
+ /** Whether the ID tab should render a back-of-ID slot. */
833
+ showBackSlot: boolean;
834
+ frontFileName: string | undefined;
835
+ backFileName: string | undefined;
836
+ passportFileName: string | undefined;
837
+ frontUploaded: boolean;
838
+ backUploaded: boolean;
839
+ passportUploaded: boolean;
840
+ canContinue: boolean;
841
+ retriesLeft: number;
842
+ /** i18n key for the current error message, if any. */
843
+ errorKey: string | null;
844
+ };
845
+ type IdCaptureDigitalUploadState = {
846
+ status: 'digitalIdUpload';
847
+ phase: 'tutorial' | 'selecting' | 'reviewing' | 'uploading' | 'holding' | 'success' | 'error' | 'fileTooLarge' | 'exhausted';
848
+ file: File | null;
849
+ fileName: string | undefined;
850
+ failReason: DigitalUploadFailReason | null;
851
+ attemptsRemaining: number;
852
+ uploadProgress: number;
853
+ pickerRequestId: number;
854
+ };
855
+ type IdCaptureState = IdCaptureIdleState | IdCaptureChooserState | IdCaptureLoadingState | IdCaptureTutorialState | IdCaptureAgeVerificationState | IdCapturePermissionsState | IdCaptureCaptureState | IdCaptureMandatoryConsentState | IdCaptureFrontFinishedState | IdCaptureBackFinishedState | IdCaptureProcessingState | IdCaptureExpiredState | IdCaptureExpiredExhaustedState | IdCaptureFinishedState | IdCaptureClosedState | IdCaptureErrorState | IdCaptureManualUploadState | IdCaptureDigitalUploadState;
856
+ /**
857
+ * Union of all `idCaptureMachine` variants' actor types. Variants share the
858
+ * same state tree and context shape, so the manager helpers
859
+ * (`mapState`, `createApi`) work uniformly for either flavor at runtime.
860
+ */
861
+ type AnyIdCaptureActor = IdCaptureActor | IdCaptureOnlyActor;
862
+ /**
863
+ * Builds the public ID capture manager from an already-created actor.
864
+ * Used by both `createIdCaptureManager` and `createIdCaptureOnlyManager`.
865
+ *
866
+ * The internal cast to `IdCaptureActor` narrows the union for `createManager`,
867
+ * which is typed against the regular machine. Variants produced via
868
+ * `idCaptureMachine.provide({...})` share the same context and event types,
869
+ * so the cast is sound at runtime — only the actor implementation differs.
870
+ */
871
+ declare function createIdCaptureManagerFromActor(actor: AnyIdCaptureActor): Manager<IdCaptureState> & {
872
+ load(): void;
873
+ selectDocument(documentType: IdDocumentType): void;
874
+ nextStep(): void;
875
+ requestPermission(): void;
876
+ goToLearnMore(): void;
877
+ back(): void;
878
+ close(): void;
879
+ reset(): void;
880
+ retryCapture(): void;
881
+ continueExhausted(): void;
882
+ continueFromError(): void;
883
+ capture(): void;
884
+ switchToManualCapture(): void;
885
+ continueToBack(): void;
886
+ continueToFront(): void;
887
+ skipBack(): void;
888
+ acceptMandatoryConsent(): void;
889
+ cancelMandatoryConsent(): void;
890
+ /**
891
+ * Updates the detection area used for WASM geometry calculation.
892
+ * Call this when the UI detection area dimensions change (e.g., on resize or orientation change).
893
+ */
894
+ updateDetectionArea(detectionArea: DetectionArea): void;
895
+ /**
896
+ * Manual upload: tab change (ID / Passport). Resets per-tab file selections.
897
+ * Note: there is intentionally no `switchToManualUpload` method — entry to
898
+ * the manual-upload flow is gated by config + Chooser to prevent a
899
+ * dev-console bypass of live camera capture.
900
+ */
901
+ manualUploadChangeTab(tab: ManualUploadTab): void;
902
+ manualUploadSelectFile(side: ManualUploadSide, file: File): void;
903
+ manualUploadContinue(): void;
904
+ manualUploadReset(): void;
905
+ digitalUploadNextStep(): void;
906
+ digitalUploadPickFile(file: File): void;
907
+ digitalUploadConfirm(): void;
908
+ digitalUploadReplace(): void;
909
+ digitalUploadRetry(): void;
910
+ digitalUploadScanInstead(): void;
911
+ digitalUploadChooseAnother(): void;
912
+ };
913
+ type IdCaptureManager = ReturnType<typeof createIdCaptureManagerFromActor>;
914
+ //#endregion
915
+ //#region src/modules/id/idCaptureManager.d.ts
916
+ /**
917
+ * Creates a manager for the regular ID capture flow. The shared
918
+ * `mapState`/`createApi`/state-types live in
919
+ * `internal/idCapture/idCaptureManagerFactory.ts`; this file is a thin
920
+ * wrapper that creates the actor and delegates to the factory.
921
+ *
922
+ * For the captureOnly flow (rich payload delivered locally via `onCapture`),
923
+ * use `createIdCaptureOnlyManager`.
924
+ */
925
+ declare function createIdCaptureManager(options: CreateIdCaptureActorOptions): Manager<IdCaptureState> & {
926
+ load(): void;
927
+ selectDocument(documentType: IdDocumentType): void;
928
+ nextStep(): void;
929
+ requestPermission(): void;
930
+ goToLearnMore(): void;
931
+ back(): void;
932
+ close(): void;
933
+ reset(): void;
934
+ retryCapture(): void;
935
+ continueExhausted(): void;
936
+ continueFromError(): void;
937
+ capture(): void;
938
+ switchToManualCapture(): void;
939
+ continueToBack(): void;
940
+ continueToFront(): void;
941
+ skipBack(): void;
942
+ acceptMandatoryConsent(): void;
943
+ cancelMandatoryConsent(): void;
944
+ updateDetectionArea(detectionArea: DetectionArea): void;
945
+ manualUploadChangeTab(tab: ManualUploadTab): void;
946
+ manualUploadSelectFile(side: ManualUploadSide, file: File): void;
947
+ manualUploadContinue(): void;
948
+ manualUploadReset(): void;
949
+ digitalUploadNextStep(): void;
950
+ digitalUploadPickFile(file: File): void;
951
+ digitalUploadConfirm(): void;
952
+ digitalUploadReplace(): void;
953
+ digitalUploadRetry(): void;
954
+ digitalUploadScanInstead(): void;
955
+ digitalUploadChooseAnother(): void;
956
+ };
957
+ //#endregion
958
+ export { MANUAL_UPLOAD_MAX_FILE_SIZE_BYTES as $, CaptureIdResponse as A, IdCaptureGeometry as B, IdCaptureOnlyMachine as C, createIdCaptureActor as D, IdCaptureActor as E, ID_ERROR_CODES as F, IdCapturedImageData as G, IdCaptureMode as H, IdCaptureConfig as I, IdErrorCode as J, IdDocumentType as K, IdCaptureContext as L, CapturedImage as M, DetectionArea as N, IdCaptureMachine as O, DetectionStatus as P, MANUAL_UPLOAD_EXHAUSTION_FORWARD_MS as Q, IdCaptureDependencies as R, createIdCaptureOnlyActor as S, CreateIdCaptureActorOptions as T, IdCaptureOnlyConfig as U, IdCaptureInput as V, IdCaptureThresholds as W, RecordingSession as X, IdFlowStep as Y, UploadIdResponse as Z, uploadIdImage as _, IdCaptureInitResult as a, IdCaptureSettings as at, CreateIdCaptureOnlyActorOptions as b, UploadIdImageParams as c, initializeIdCapture as d, MANUAL_UPLOAD_MAX_RETRIES as et, preloadIdRecordingProvider as f, stopStream as g, stopRecording as h, createIdCaptureManagerFromActor as i, DetectionOrientation as it, CaptureOnlyResponse as j, idCaptureMachine as k, UploadManualIdFileParams as l, startRecordingSession as m, IdCaptureManager as n, ManualUploadSide as nt, InitializeIdCaptureParams as o, processId as p, IdError as q, IdCaptureState as r, ManualUploadTab as rt, StartRecordingParams as s, createIdCaptureManager as t, ManualUploadContext as tt, ValidationError as u, uploadManualIdFile as v, idCaptureOnlyMachine as w, IdCaptureOnlyActor as x, validateUploadResponse as y, IdCaptureEvent as z };