@incodetech/core 0.0.0-dev-20260409-a38d5e8 → 0.0.0-dev-20260409-089e5c6

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 (137) hide show
  1. package/dist/BrowserStorageProvider-ByxoNfxC.esm.js +55 -0
  2. package/dist/{OpenViduRecordingProvider-Bn2meybK.esm.js → OpenViduRecordingProvider-JatjSE3h.esm.js} +1 -1
  3. package/dist/{WasmUtilProvider-BpZSvZbg.esm.js → WasmUtilProvider-DRh0wrlm.esm.js} +1 -1
  4. package/dist/{addressSearch-DOFI7lwy.esm.js → addressSearch-CDdN30un.esm.js} +4 -4
  5. package/dist/antifraud.d.ts +1 -1
  6. package/dist/antifraud.esm.js +4 -37
  7. package/dist/antifraudStateMachine-C1AgS0nL.esm.js +39 -0
  8. package/dist/authentication.d.ts +11 -11
  9. package/dist/authentication.esm.js +22 -19
  10. package/dist/{authenticationManager-C2mk36yK.d.ts → authenticationManager-DYFYx68i.d.ts} +2 -2
  11. package/dist/authenticationManager-UaO9UTN7.esm.js +67 -0
  12. package/dist/{authenticationManager-C7dL_avf.esm.js → authenticationStateMachine-DWI65EwK.esm.js} +7 -67
  13. package/dist/{backCameraStream-tabTmwDS.esm.js → backCameraStream-BihRmMzc.esm.js} +3 -3
  14. package/dist/camera.d.ts +1 -1
  15. package/dist/camera.esm.js +3 -3
  16. package/dist/consent.d.ts +57 -57
  17. package/dist/consent.esm.js +4 -149
  18. package/dist/consentStateMachine-CpRu2hF0.esm.js +151 -0
  19. package/dist/cross-document-data-match.d.ts +1 -1
  20. package/dist/cross-document-data-match.esm.js +4 -4
  21. package/dist/curp-validation.d.ts +5 -5
  22. package/dist/curp-validation.esm.js +4 -417
  23. package/dist/curpValidationStateMachine-Czzgv2W1.esm.js +419 -0
  24. package/dist/{deepsightLoader-Cj6SyUQ-.esm.js → deepsightLoader-jIgoauFK.esm.js} +10 -10
  25. package/dist/{deepsightService-BjgXl5hs.esm.js → deepsightService-D4mM8yJ2.esm.js} +5 -5
  26. package/dist/{deepsightService-ByD6uIs7.d.ts → deepsightService-DAeakjDd.d.ts} +2 -2
  27. package/dist/device.esm.js +3 -3
  28. package/dist/document-capture.d.ts +75 -73
  29. package/dist/document-capture.esm.js +8 -403
  30. package/dist/document-upload.d.ts +50 -50
  31. package/dist/document-upload.esm.js +7 -7
  32. package/dist/documentCaptureStateMachine-XbpsHzh5.esm.js +403 -0
  33. package/dist/ekyb.d.ts +3 -3
  34. package/dist/ekyb.esm.js +10 -655
  35. package/dist/ekybStateMachine-BDuCae6s.esm.js +653 -0
  36. package/dist/ekyc.d.ts +3 -3
  37. package/dist/ekyc.esm.js +6 -10614
  38. package/dist/ekycStateMachine-BN4KBDYY.esm.js +10615 -0
  39. package/dist/email.d.ts +3 -3
  40. package/dist/email.esm.js +6 -5
  41. package/dist/emailManager-CAeo59lD.esm.js +238 -0
  42. package/dist/{emailManager-CU_hzrsl.d.ts → emailManager-CZYfcu0n.d.ts} +4 -3
  43. package/dist/{emailManager-_9R4vm6g.esm.js → emailStateMachine-Bqwe_sQS.esm.js} +6 -239
  44. package/dist/{events-DlHrOIRc.esm.js → events-CZ2ka3pu.esm.js} +8 -1
  45. package/dist/events.d.ts +1 -0
  46. package/dist/events.esm.js +2 -2
  47. package/dist/extensibility.d.ts +15 -15
  48. package/dist/extensibility.esm.js +33 -26
  49. package/dist/face-match.d.ts +7 -6
  50. package/dist/face-match.esm.js +8 -129
  51. package/dist/faceCaptureManagerFactory-D8zlMTvd.esm.js +117 -0
  52. package/dist/{faceCaptureManagerFactory-Da_-ohdg.d.ts → faceCaptureManagerFactory-DS-6yCya.d.ts} +8 -8
  53. package/dist/{faceCaptureSetup-CaVWkjvE.esm.js → faceCaptureSetup-1M6uUEjK.esm.js} +5 -119
  54. package/dist/faceMatchStateMachine-D3DuP_ya.esm.js +127 -0
  55. package/dist/flow.d.ts +8 -13
  56. package/dist/flow.esm.js +10 -29
  57. package/dist/{flowCompletionService-B5JemmC6.esm.js → flowCompletionService-W6bj7Xd3.esm.js} +2 -2
  58. package/dist/{flowServices-p22wrYPf.esm.js → flowServices-C4tjBD8q.esm.js} +3 -3
  59. package/dist/geolocation.d.ts +7 -6
  60. package/dist/geolocation.esm.js +7 -105
  61. package/dist/geolocationStateMachine-Bj2LkGwy.esm.js +105 -0
  62. package/dist/{getDeviceClass-DEzz4cmY.esm.js → getDeviceClass-BoiWvKAc.esm.js} +1 -1
  63. package/dist/government-validation.d.ts +2 -2
  64. package/dist/government-validation.esm.js +5 -269
  65. package/dist/governmentValidationStateMachine-W1CzRjVw.esm.js +271 -0
  66. package/dist/http.esm.js +1 -1
  67. package/dist/id.d.ts +10 -10
  68. package/dist/id.esm.js +22 -20
  69. package/dist/idCaptureManager-BcS8fgW4.esm.js +335 -0
  70. package/dist/{idCaptureManager-CV08v1e3.d.ts → idCaptureManager-oR6YPYHj.d.ts} +7 -7
  71. package/dist/{idCaptureManager-dyZzKv8L.esm.js → idCaptureStateMachine-MAzfM_2O.esm.js} +17 -346
  72. package/dist/identity-reuse.d.ts +530 -0
  73. package/dist/identity-reuse.esm.js +273 -0
  74. package/dist/index.d.ts +2 -2
  75. package/dist/index.esm.js +8 -8
  76. package/dist/{lib-Bavz2qmt.esm.js → lib-CxDxnzRd.esm.js} +1 -1
  77. package/dist/mandatory-consent.d.ts +55 -55
  78. package/dist/mandatory-consent.esm.js +4 -124
  79. package/dist/mandatoryConsentStateMachine-BMKi26Re.esm.js +126 -0
  80. package/dist/{openviduLazy-vhrVZCr_.esm.js → openviduLazy-B8tinh9W.esm.js} +2 -2
  81. package/dist/openviduLazy-CItjpMfL.esm.js +3 -0
  82. package/dist/{permissionServices-Cskq32Yd.esm.js → permissionServices-Cj120WaT.esm.js} +2 -2
  83. package/dist/phone.d.ts +3 -3
  84. package/dist/phone.esm.js +6 -5
  85. package/dist/phoneManager-Bvj6Jr4o.esm.js +258 -0
  86. package/dist/{phoneManager-ulJuGvJ8.d.ts → phoneManager-CCMCkyYr.d.ts} +2 -2
  87. package/dist/{phoneManager-DerdUfd4.esm.js → phoneStateMachine-B1t1Z-Dd.esm.js} +5 -258
  88. package/dist/{recordingService-483wQ6kR.esm.js → recordingService-8I_-hhNI.esm.js} +14 -68
  89. package/dist/redirect-to-mobile.d.ts +2 -2
  90. package/dist/redirect-to-mobile.esm.js +5 -247
  91. package/dist/redirectToMobileStateMachine-BVP1KcoO.esm.js +249 -0
  92. package/dist/runChildModule-B5DEiOS7.esm.js +27 -0
  93. package/dist/selfie.d.ts +11 -11
  94. package/dist/selfie.esm.js +22 -19
  95. package/dist/selfieManager-B6x3O5Ns.esm.js +60 -0
  96. package/dist/{selfieManager-DCRP7X75.d.ts → selfieManager-gizt3Zha.d.ts} +2 -2
  97. package/dist/selfieStateMachine-DHPSBFj0.esm.js +56 -0
  98. package/dist/{session-CUh77zj3.esm.js → session-DoI-X9FK.esm.js} +4 -4
  99. package/dist/session.d.ts +1 -1
  100. package/dist/session.esm.js +6 -6
  101. package/dist/{setup-XpxfZgKn.esm.js → setup-Bh2S53NT.esm.js} +6 -5
  102. package/dist/{setup-DpHakxsC.d.ts → setup-Bz3Ffaoc.d.ts} +1 -1
  103. package/dist/signature.d.ts +4 -3
  104. package/dist/signature.esm.js +6 -189
  105. package/dist/signatureStateMachine-Cv7yPuEf.esm.js +189 -0
  106. package/dist/{stats-DHDoqSBV.esm.js → stats-wkQyDFV3.esm.js} +1 -1
  107. package/dist/stats.esm.js +2 -2
  108. package/dist/types-BdEM5Jj7.d.ts +35 -0
  109. package/dist/{types-2OPf1pyv.d.ts → types-CdlQrTiZ.d.ts} +1 -1
  110. package/dist/{types-CVJVQ7fp.d.ts → types-m43DfiSx.d.ts} +1 -1
  111. package/dist/wasm.d.ts +2 -2
  112. package/dist/wasm.esm.js +8 -8
  113. package/dist/workflow.d.ts +813 -0
  114. package/dist/workflow.esm.js +600 -0
  115. package/package.json +11 -3
  116. package/dist/openviduLazy-BIPHozOu.esm.js +0 -3
  117. package/dist/selfieManager-DeOcNel4.esm.js +0 -110
  118. /package/dist/{Actor-Ba71-_30.d.ts → Actor-BkPcZGke.d.ts} +0 -0
  119. /package/dist/{BaseWasmProvider-D-s_6M5H.esm.js → BaseWasmProvider-C73c2nV9.esm.js} +0 -0
  120. /package/dist/{BrowserEnvironmentProvider-DaHeLJQw.esm.js → BrowserEnvironmentProvider-lxn4oxXn.esm.js} +0 -0
  121. /package/dist/{BrowserTimerProvider-BhD2MlHg.esm.js → BrowserTimerProvider-CSdm7__S.esm.js} +0 -0
  122. /package/dist/{ITimerCapability-oixwa6nj.esm.js → ITimerCapability-DAIaq369.esm.js} +0 -0
  123. /package/dist/{Manager-BN2g_I8W.d.ts → Manager-Bcnemkyi.d.ts} +0 -0
  124. /package/dist/{MotionSensorProvider-CodM3e0E.esm.js → MotionSensorProvider-BLnFo6My.esm.js} +0 -0
  125. /package/dist/{StateMachine-BoJsfMvg.d.ts → StateMachine-DIeoDJ7r.d.ts} +0 -0
  126. /package/dist/{api-DzpnV6O7.esm.js → api-CqKwkjJ3.esm.js} +0 -0
  127. /package/dist/{browserSimulation-B4ubb2OL.esm.js → browserSimulation-7W5-A3RV.esm.js} +0 -0
  128. /package/dist/{camera-DmkFpf5N.esm.js → camera-B-5traWf.esm.js} +0 -0
  129. /package/dist/{camera-1eeGnAaL.d.ts → camera-CgnuDuxy.d.ts} +0 -0
  130. /package/dist/{chunk-DsxENsBR.esm.js → chunk-Qw4qVmMx.esm.js} +0 -0
  131. /package/dist/{displayErrors-BZLX7idb.d.ts → displayErrors-C9-VaqmS.d.ts} +0 -0
  132. /package/dist/{flowCompletionService-D-3YCHyO.d.ts → flowCompletionService-CPLdZxe-.d.ts} +0 -0
  133. /package/dist/{getBrowser-Dtyt9J_h.esm.js → getBrowser-DJkbzQ5t.esm.js} +0 -0
  134. /package/dist/{platform-Dv7a2fv-.esm.js → platform-BfoqeM61.esm.js} +0 -0
  135. /package/dist/{types-D_QfFKxT.d.ts → types-CxU9jTRl.d.ts} +0 -0
  136. /package/dist/{warmup-CIj_wEV_.d.ts → warmup-Cs0uqxUW.d.ts} +0 -0
  137. /package/dist/{xstate.esm-Bv55-lJ4.esm.js → xstate.esm-D7D6CGwY.esm.js} +0 -0
@@ -0,0 +1,335 @@
1
+ import { n as eventModuleNames, o as createManagerInstrumentation, r as eventScreenNames } from "./events-CZ2ka3pu.esm.js";
2
+ import { a as createActor, o as createManager } from "./xstate.esm-D7D6CGwY.esm.js";
3
+ import { t as BrowserStorageProvider } from "./BrowserStorageProvider-ByxoNfxC.esm.js";
4
+ import { t as idCaptureMachine } from "./idCaptureStateMachine-MAzfM_2O.esm.js";
5
+
6
+ //#region src/modules/id/idCaptureActor.ts
7
+ function createIdCaptureActor(options) {
8
+ const dependencies = options.dependencies ?? { storage: new BrowserStorageProvider() };
9
+ return createActor(idCaptureMachine, { input: {
10
+ config: options.config,
11
+ dependencies
12
+ } }).start();
13
+ }
14
+
15
+ //#endregion
16
+ //#region src/modules/id/idCaptureManager.ts
17
+ function getPermissionStatus(snapshot) {
18
+ if (!snapshot.matches("permissions")) return;
19
+ if (snapshot.matches({ permissions: "idle" })) return "idle";
20
+ if (snapshot.matches({ permissions: "waitingForUser" })) return "idle";
21
+ if (snapshot.matches({ permissions: "learnMore" })) return "learnMore";
22
+ if (snapshot.matches({ permissions: "requesting" })) return "requesting";
23
+ if (snapshot.matches({ permissions: "denied" })) return "denied";
24
+ }
25
+ function getCaptureStatus(snapshot) {
26
+ const matches = {
27
+ initializing: snapshot.matches({ capture: "initializing" }),
28
+ detecting: snapshot.matches({ capture: "detecting" }),
29
+ manualCaptureWaiting: snapshot.matches({ capture: "manualCaptureWaiting" }),
30
+ capturing: snapshot.matches({ capture: "capturing" }),
31
+ capturingManual: snapshot.matches({ capture: "capturingManual" }),
32
+ uploading: snapshot.matches({ capture: "uploading" }),
33
+ uploadError: snapshot.matches({ capture: "uploadError" }),
34
+ success: snapshot.matches({ capture: "success" })
35
+ };
36
+ if (matches.initializing) return "initializing";
37
+ if (matches.detecting || matches.manualCaptureWaiting) return "detecting";
38
+ if (matches.capturing || matches.capturingManual) return "capturing";
39
+ if (matches.uploading) return "uploading";
40
+ if (matches.uploadError) return "uploadError";
41
+ if (matches.success) return "success";
42
+ }
43
+ function getErrorMessage(errorCode) {
44
+ if (!errorCode) return void 0;
45
+ return {
46
+ UPLOAD_ERROR: "Upload failed",
47
+ CLASSIFICATION_FAILED: "ID classification failed",
48
+ LOW_SHARPNESS: "Image is not sharp enough",
49
+ GLARE_DETECTED: "Glare detected on ID",
50
+ WRONG_DOCUMENT_SIDE: "Wrong side of document",
51
+ ID_TYPE_UNACCEPTABLE: "ID type is not acceptable",
52
+ READABILITY_ISSUE: "ID readability issue",
53
+ RETRY_EXHAUSTED_CONTINUE_TO_BACK: "Retry exhausted",
54
+ RETRY_EXHAUSTED_SKIP_BACK: "Retry exhausted",
55
+ NO_MORE_TRIES: "No more tries remaining",
56
+ UNEXPECTED_ERROR: "An unexpected error occurred",
57
+ NO_TOKEN: "No token available",
58
+ PERMISSION_DENIED: "Permission denied",
59
+ USER_CANCELLED: "User cancelled",
60
+ SERVER_ERROR: "Server error"
61
+ }[errorCode];
62
+ }
63
+ function getErrorDescription(errorCode, uploadResponse) {
64
+ if (!errorCode) return void 0;
65
+ return {
66
+ UPLOAD_ERROR: "Please try again",
67
+ CLASSIFICATION_FAILED: "Please ensure your ID is clearly visible",
68
+ LOW_SHARPNESS: "Please ensure the image is clear and well-focused",
69
+ GLARE_DETECTED: "Please avoid bright reflections on your ID",
70
+ WRONG_DOCUMENT_SIDE: uploadResponse?.side === "back" ? "Please show the back side of your ID" : "Please show the front side of your ID",
71
+ ID_TYPE_UNACCEPTABLE: "Please use a valid ID type",
72
+ READABILITY_ISSUE: "Please ensure all text is clearly visible",
73
+ RETRY_EXHAUSTED_CONTINUE_TO_BACK: "Continuing to back side capture",
74
+ RETRY_EXHAUSTED_SKIP_BACK: "Skipping back side capture",
75
+ NO_MORE_TRIES: "Maximum attempts reached",
76
+ UNEXPECTED_ERROR: "Please try again later",
77
+ NO_TOKEN: "Session expired",
78
+ PERMISSION_DENIED: "Camera permission is required",
79
+ USER_CANCELLED: "Capture was cancelled",
80
+ SERVER_ERROR: "Please try again later"
81
+ }[errorCode];
82
+ }
83
+ function mapState(snapshot) {
84
+ const { context } = snapshot;
85
+ if (snapshot.matches("idle")) return { status: "idle" };
86
+ if (snapshot.matches("chooser")) return {
87
+ status: "chooser",
88
+ availableDocumentTypes: context.availableDocumentTypes
89
+ };
90
+ if (snapshot.matches("loading")) return { status: "loading" };
91
+ if (snapshot.matches("tutorial")) return {
92
+ status: "tutorial",
93
+ selectedDocumentType: context.selectedDocumentType,
94
+ currentMode: context.currentMode
95
+ };
96
+ if (snapshot.matches("closed")) return { status: "closed" };
97
+ if (snapshot.matches("permissions")) {
98
+ const permissionStatus = getPermissionStatus(snapshot);
99
+ if (permissionStatus === void 0) return {
100
+ status: "permissions",
101
+ permissionStatus: "idle"
102
+ };
103
+ return {
104
+ status: "permissions",
105
+ permissionStatus
106
+ };
107
+ }
108
+ if (snapshot.matches("capture")) {
109
+ const captureStatus = getCaptureStatus(snapshot);
110
+ const needsBackCapture = (context.currentMode === "front" || context.currentMode === "passport") && !context.config.onlyFront && !context.config.onlyBack && !context.uploadResponse?.skipBackIdCapture && !(context.config.usSmartCapture && context.currentMode === "front");
111
+ const needsFrontCapture = context.config.usSmartCapture === true && context.currentMode === "back" && context.uploadResponse?.forceFrontIdCapture === true;
112
+ return {
113
+ status: "capture",
114
+ captureStatus: captureStatus ?? "initializing",
115
+ stream: context.stream,
116
+ detectionStatus: context.detectionStatus,
117
+ debugFrame: void 0,
118
+ attemptsRemaining: context.attemptsRemaining,
119
+ uploadError: context.uploadError,
120
+ currentMode: context.currentMode,
121
+ counterValue: context.counterValue,
122
+ orientation: context.orientation,
123
+ idType: context.idType,
124
+ previewImageUrl: context.previewImageUrl,
125
+ uploadProgress: context.uploadProgress ?? 0,
126
+ uploadErrorMessage: context.uploadError ? getErrorMessage(context.uploadError) : void 0,
127
+ uploadErrorDescription: context.uploadError ? getErrorDescription(context.uploadError, context.uploadResponse) : void 0,
128
+ needsBackCapture,
129
+ needsFrontCapture,
130
+ showCaptureButtonInAuto: context.config.showCaptureButtonInAuto ?? false,
131
+ canRetry: context.attemptsRemaining > 0
132
+ };
133
+ }
134
+ if (snapshot.matches("mandatoryConsent")) return {
135
+ status: "mandatoryConsent",
136
+ regulationType: context.uploadResponse?.regulationType ?? "Other"
137
+ };
138
+ if (snapshot.matches("frontFinished")) return { status: "frontFinished" };
139
+ if (snapshot.matches("backFinished")) return { status: "backFinished" };
140
+ if (snapshot.matches("processing")) return { status: "processing" };
141
+ if (snapshot.matches("expired")) return { status: "expired" };
142
+ if (snapshot.matches("finished")) return { status: "finished" };
143
+ if (snapshot.matches("error")) return {
144
+ status: "error",
145
+ error: context.error ?? "Unknown error"
146
+ };
147
+ return { status: "idle" };
148
+ }
149
+ function createApi({ actor, trackElementClicked, trackCaptureAttemptFinished }) {
150
+ const snapshot = actor.getSnapshot();
151
+ if (snapshot.context.dependencies) snapshot.context.dependencies.trackCaptureAttemptFinished = trackCaptureAttemptFinished;
152
+ return {
153
+ load() {
154
+ actor.send({ type: "LOAD" });
155
+ },
156
+ selectDocument(documentType) {
157
+ trackElementClicked?.(`selectDocument.${documentType}`);
158
+ actor.send({
159
+ type: "SELECT_DOCUMENT",
160
+ documentType
161
+ });
162
+ },
163
+ nextStep() {
164
+ trackElementClicked?.("nextStep");
165
+ actor.send({ type: "NEXT_STEP" });
166
+ },
167
+ requestPermission() {
168
+ trackElementClicked?.("requestPermission");
169
+ actor.send({ type: "REQUEST_PERMISSION" });
170
+ },
171
+ goToLearnMore() {
172
+ trackElementClicked?.("goToLearnMore");
173
+ actor.send({ type: "GO_TO_LEARN_MORE" });
174
+ },
175
+ back() {
176
+ trackElementClicked?.("back");
177
+ actor.send({ type: "BACK" });
178
+ },
179
+ close() {
180
+ trackElementClicked?.("close");
181
+ actor.send({ type: "QUIT" });
182
+ },
183
+ reset() {
184
+ actor.send({ type: "RESET" });
185
+ },
186
+ retryCapture() {
187
+ trackElementClicked?.("retryCapture");
188
+ actor.send({ type: "RETRY_CAPTURE" });
189
+ },
190
+ continueFromError() {
191
+ trackElementClicked?.("continueFromError");
192
+ actor.send({ type: "CONTINUE_FROM_ERROR" });
193
+ },
194
+ capture() {
195
+ trackElementClicked?.("capture");
196
+ actor.send({ type: "MANUAL_CAPTURE" });
197
+ },
198
+ switchToManualCapture() {
199
+ trackElementClicked?.("switchToManualCapture");
200
+ actor.send({ type: "SWITCH_TO_MANUAL_CAPTURE" });
201
+ },
202
+ continueToBack() {
203
+ trackElementClicked?.("continueToBack");
204
+ actor.send({ type: "CONTINUE_TO_BACK" });
205
+ },
206
+ continueToFront() {
207
+ trackElementClicked?.("continueToFront");
208
+ actor.send({ type: "CONTINUE_TO_FRONT" });
209
+ },
210
+ skipBack() {
211
+ trackElementClicked?.("skipBack");
212
+ actor.send({ type: "SKIP_BACK" });
213
+ },
214
+ acceptMandatoryConsent() {
215
+ trackElementClicked?.("acceptMandatoryConsent");
216
+ actor.send({ type: "CONSENT_ACCEPT" });
217
+ },
218
+ cancelMandatoryConsent() {
219
+ trackElementClicked?.("cancelMandatoryConsent");
220
+ actor.send({ type: "CONSENT_CANCEL" });
221
+ },
222
+ updateDetectionArea(detectionArea) {
223
+ actor.send({
224
+ type: "UPDATE_DETECTION_AREA",
225
+ detectionArea
226
+ });
227
+ }
228
+ };
229
+ }
230
+ const FRONT_SCREENS = {
231
+ tutorial: eventScreenNames.frontTutorial,
232
+ cameraCapture: eventScreenNames.frontCameraCapture,
233
+ uploadProgress: eventScreenNames.frontUploadProgress,
234
+ attemptFailed: eventScreenNames.frontAttemptFailed,
235
+ uploadSuccess: eventScreenNames.frontUploadSuccess,
236
+ help: eventScreenNames.frontHelp
237
+ };
238
+ const BACK_SCREENS = {
239
+ tutorial: eventScreenNames.backTutorial,
240
+ cameraCapture: eventScreenNames.backCameraCapture,
241
+ uploadProgress: eventScreenNames.backUploadProgress,
242
+ attemptFailed: eventScreenNames.backAttemptFailed,
243
+ uploadSuccess: eventScreenNames.backUploadSuccess,
244
+ help: eventScreenNames.backHelp
245
+ };
246
+ const PASSPORT_SCREENS = { tutorial: eventScreenNames.passportTutorial };
247
+ function getSideScreens(mode) {
248
+ if (mode === "back") return BACK_SCREENS;
249
+ if (mode === "passport") return {
250
+ ...FRONT_SCREENS,
251
+ ...PASSPORT_SCREENS
252
+ };
253
+ return FRONT_SCREENS;
254
+ }
255
+ function getCaptureSubstateScreen(value, screens) {
256
+ if (typeof value !== "object" || value === null) return void 0;
257
+ const captureValue = value.capture;
258
+ if (captureValue === void 0) return void 0;
259
+ if (typeof captureValue === "string") switch (captureValue) {
260
+ case "detecting":
261
+ case "manualCaptureWaiting":
262
+ case "capturing":
263
+ case "capturingManual": return screens.cameraCapture;
264
+ case "uploading":
265
+ case "validatingUpload": return screens.uploadProgress;
266
+ case "uploadError": return screens.attemptFailed;
267
+ case "success": return screens.uploadSuccess;
268
+ }
269
+ if (typeof captureValue === "object" && captureValue !== null) {
270
+ const substates = Object.keys(captureValue);
271
+ if (substates.includes("detecting") || substates.includes("capturing")) return screens.cameraCapture;
272
+ if (substates.includes("uploading")) return screens.uploadProgress;
273
+ if (substates.includes("uploadError")) return screens.attemptFailed;
274
+ if (substates.includes("success")) return screens.uploadSuccess;
275
+ }
276
+ return screens.cameraCapture;
277
+ }
278
+ function getIdCaptureScreenName(snapshot) {
279
+ const { value, context } = snapshot;
280
+ if (value === void 0 || value === null) return void 0;
281
+ const topLevel = typeof value === "string" ? value : typeof value === "object" ? Object.keys(value)[0] : void 0;
282
+ if (topLevel === void 0) return void 0;
283
+ const side = context.currentMode;
284
+ const screens = getSideScreens(side);
285
+ switch (topLevel) {
286
+ case "idle": return "IDLE";
287
+ case "chooser": return "DOCUMENT_CHOOSER";
288
+ case "loading": return "LOADING";
289
+ case "tutorial": return screens.tutorial;
290
+ case "permissions": return "PERMISSIONS";
291
+ case "capture": return getCaptureSubstateScreen(value, screens);
292
+ case "mandatoryConsent": return "MANDATORY_CONSENT";
293
+ case "frontFinished": return screens.uploadSuccess;
294
+ case "backFinished": return screens.uploadSuccess;
295
+ case "processing": return "PROCESSING";
296
+ case "expired": return "EXPIRED";
297
+ case "finished": return "FINISHED";
298
+ case "closed": return "CLOSED";
299
+ case "error": return "ERROR";
300
+ default: return topLevel;
301
+ }
302
+ }
303
+ function mapIdCaptureScreenName(snapshot) {
304
+ return getIdCaptureScreenName(snapshot);
305
+ }
306
+ function getIdCaptureErrorPayload(snapshot) {
307
+ const errorCode = snapshot.context.uploadError;
308
+ if (errorCode === void 0) return;
309
+ return { errorCode };
310
+ }
311
+ function createIdCaptureManager(options) {
312
+ return createManager({
313
+ actor: createIdCaptureActor(options),
314
+ mapState,
315
+ createApi,
316
+ instrumentation: createManagerInstrumentation(eventModuleNames.id, {
317
+ getScreenName: mapIdCaptureScreenName,
318
+ getErrorPayload: getIdCaptureErrorPayload
319
+ })
320
+ });
321
+ }
322
+ function createIdCaptureManagerFromActor(actor) {
323
+ return createManager({
324
+ actor,
325
+ mapState,
326
+ createApi,
327
+ instrumentation: createManagerInstrumentation(eventModuleNames.id, {
328
+ getScreenName: mapIdCaptureScreenName,
329
+ getErrorPayload: getIdCaptureErrorPayload
330
+ })
331
+ });
332
+ }
333
+
334
+ //#endregion
335
+ export { createIdCaptureManagerFromActor as n, createIdCaptureActor as r, createIdCaptureManager as t };
@@ -1,10 +1,10 @@
1
- import { t as Manager } from "./Manager-BN2g_I8W.js";
2
- import { t as ActorRefFrom } from "./Actor-Ba71-_30.js";
3
- import { n as StateMachine, t as AnyStateMachine } from "./StateMachine-BoJsfMvg.js";
4
- import { t as CameraStream } from "./camera-1eeGnAaL.js";
5
- import { a as TutorialIdConfig, i as RegulationTypes, t as Flow } from "./types-CVJVQ7fp.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-ByD6uIs7.js";
7
- import { n as PermissionStatus, t as PermissionResult } from "./types-D_QfFKxT.js";
1
+ import { t as Manager } from "./Manager-Bcnemkyi.js";
2
+ import { t as ActorRefFrom } from "./Actor-BkPcZGke.js";
3
+ import { n as StateMachine, t as AnyStateMachine } from "./StateMachine-DIeoDJ7r.js";
4
+ import { t as CameraStream } from "./camera-CgnuDuxy.js";
5
+ import { a as TutorialIdConfig, i as RegulationTypes, t as Flow } from "./types-m43DfiSx.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-DAeakjDd.js";
7
+ import { n as PermissionStatus, t as PermissionResult } from "./types-CxU9jTRl.js";
8
8
 
9
9
  //#region ../infra/src/capabilities/IIdCaptureCapability.d.ts
10
10
  /**