@incodetech/core 2.0.0-rc.0 → 2.0.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/package.json +3 -3
  2. package/dist/Actor-CI32dTbG.d.ts +0 -2
  3. package/dist/BaseWasmProvider-C_DLEI40.esm.js +0 -1118
  4. package/dist/BrowserStorageProvider-CuOW1Er2.esm.js +0 -55
  5. package/dist/BrowserTimerProvider-DhNc_x02.esm.js +0 -22
  6. package/dist/ITimerCapability-C67ZRskg.esm.js +0 -7
  7. package/dist/IpifyProvider-D7jx52AL.esm.js +0 -139
  8. package/dist/Manager-C8PrhBOx.d.ts +0 -19
  9. package/dist/MotionSensorProvider-4v7xkqAp.esm.js +0 -254
  10. package/dist/OpenViduRecordingProvider-CMu6XVdc.esm.js +0 -87
  11. package/dist/StateMachine-BCQrZJhf.d.ts +0 -2
  12. package/dist/WasmUtilProvider-j98OJf-S.esm.js +0 -114
  13. package/dist/addressSearch-BpTbTWCa.esm.js +0 -430
  14. package/dist/ae-signature-DDDZmWXj.esm.js +0 -12
  15. package/dist/ae-signature.d.ts +0 -25
  16. package/dist/ae-signature.esm.js +0 -8
  17. package/dist/antifraud.d.ts +0 -57
  18. package/dist/antifraud.esm.js +0 -45
  19. package/dist/antifraudStateMachine-O0TMf6yc.esm.js +0 -39
  20. package/dist/api-CESGtpbH.esm.js +0 -53
  21. package/dist/authentication.d.ts +0 -12
  22. package/dist/authentication.esm.js +0 -25
  23. package/dist/authenticationManager-5M-fKzXx.esm.js +0 -67
  24. package/dist/authenticationManager-C83GNIhl.d.ts +0 -66
  25. package/dist/authenticationStateMachine-BMZqatiF.esm.js +0 -139
  26. package/dist/backCameraStream-DMdMeGk2.esm.js +0 -346
  27. package/dist/browserSimulation-gxD8cSpM.esm.js +0 -20
  28. package/dist/camera-DBSxa6ML.d.ts +0 -4
  29. package/dist/camera-PA2Ljri3.esm.js +0 -22
  30. package/dist/camera.d.ts +0 -15
  31. package/dist/camera.esm.js +0 -5
  32. package/dist/chunk-CRF6K_H_.esm.js +0 -49
  33. package/dist/consent.d.ts +0 -398
  34. package/dist/consent.esm.js +0 -79
  35. package/dist/consentStateMachine-CCT-B60O.esm.js +0 -151
  36. package/dist/cpf-PPz2Njto.esm.js +0 -38
  37. package/dist/cpf-ocr.d.ts +0 -204
  38. package/dist/cpf-ocr.esm.js +0 -177
  39. package/dist/cross-document-data-match.d.ts +0 -34
  40. package/dist/cross-document-data-match.esm.js +0 -71
  41. package/dist/curp-validation.d.ts +0 -188
  42. package/dist/curp-validation.esm.js +0 -110
  43. package/dist/curpValidationStateMachine-CitWLr2c.esm.js +0 -595
  44. package/dist/custom-fields.d.ts +0 -115
  45. package/dist/custom-fields.esm.js +0 -177
  46. package/dist/custom-watchlist.d.ts +0 -66
  47. package/dist/custom-watchlist.esm.js +0 -86
  48. package/dist/dateUtils-UoN5xswP.esm.js +0 -23
  49. package/dist/deepsightLoader-Cm4JIT_z.esm.js +0 -52
  50. package/dist/deepsightService-CEVxzehb.d.ts +0 -412
  51. package/dist/deepsightService-O74l4Y__.esm.js +0 -489
  52. package/dist/device.d.ts +0 -46
  53. package/dist/device.esm.js +0 -106
  54. package/dist/displayErrors-DqJ_IbsG.d.ts +0 -39
  55. package/dist/document-capture.d.ts +0 -906
  56. package/dist/document-capture.esm.js +0 -156
  57. package/dist/document-upload.d.ts +0 -331
  58. package/dist/document-upload.esm.js +0 -203
  59. package/dist/documentCaptureStateMachine-BqzTDy9k.esm.js +0 -394
  60. package/dist/dynamic-forms.d.ts +0 -178
  61. package/dist/dynamic-forms.esm.js +0 -323
  62. package/dist/ekyb.d.ts +0 -148
  63. package/dist/ekyb.esm.js +0 -127
  64. package/dist/ekybStateMachine-B59rQjgj.esm.js +0 -674
  65. package/dist/ekyc.d.ts +0 -164
  66. package/dist/ekyc.esm.js +0 -104
  67. package/dist/ekycStateMachine-oeO0Iekd.esm.js +0 -10626
  68. package/dist/electronic-signature.d.ts +0 -4
  69. package/dist/electronic-signature.esm.js +0 -7
  70. package/dist/electronicSignatureManager-D9OHzTpG.esm.js +0 -428
  71. package/dist/email.d.ts +0 -4
  72. package/dist/email.esm.js +0 -9
  73. package/dist/emailManager-DIfnS5g1.d.ts +0 -352
  74. package/dist/emailManager-wAV0LE-H.esm.js +0 -238
  75. package/dist/emailStateMachine-DOf4j58N.esm.js +0 -292
  76. package/dist/endpoints-CnN3SyDa.esm.js +0 -87
  77. package/dist/events-D6-e4vok.esm.js +0 -596
  78. package/dist/events.d.ts +0 -265
  79. package/dist/events.esm.js +0 -4
  80. package/dist/extensibility.d.ts +0 -122
  81. package/dist/extensibility.esm.js +0 -43
  82. package/dist/face-match.d.ts +0 -228
  83. package/dist/face-match.esm.js +0 -173
  84. package/dist/faceCaptureManagerFactory-Dh2PdGlF.esm.js +0 -290
  85. package/dist/faceCaptureManagerFactory-yqtpxjnN.d.ts +0 -690
  86. package/dist/faceCaptureSetup-B3faSpYA.esm.js +0 -873
  87. package/dist/faceMatchStateMachine-DNFrxTFS.esm.js +0 -127
  88. package/dist/flow-events.d.ts +0 -6
  89. package/dist/flow-events.esm.js +0 -0
  90. package/dist/flow.d.ts +0 -358
  91. package/dist/flow.esm.js +0 -825
  92. package/dist/flowCompletionService-DhkT4SRY.d.ts +0 -10
  93. package/dist/flowCompletionService-P54yzGvA.esm.js +0 -13
  94. package/dist/flowServices-DTsm-Vf1.esm.js +0 -188
  95. package/dist/geolocation.d.ts +0 -127
  96. package/dist/geolocation.esm.js +0 -89
  97. package/dist/geolocationStateMachine-asasuHY2.esm.js +0 -105
  98. package/dist/getBrowser-BSXUTWXw.esm.js +0 -41
  99. package/dist/getDeviceClass-BSntT9_j.esm.js +0 -14
  100. package/dist/government-validation.d.ts +0 -67
  101. package/dist/government-validation.esm.js +0 -81
  102. package/dist/governmentValidationStateMachine-BDDYrJTo.esm.js +0 -271
  103. package/dist/home.d.ts +0 -99
  104. package/dist/home.esm.js +0 -61
  105. package/dist/http.d.ts +0 -68
  106. package/dist/http.esm.js +0 -3
  107. package/dist/id-ocr.d.ts +0 -635
  108. package/dist/id-ocr.esm.js +0 -86
  109. package/dist/id-verification.d.ts +0 -190
  110. package/dist/id-verification.esm.js +0 -43
  111. package/dist/id.d.ts +0 -24
  112. package/dist/id.esm.js +0 -164
  113. package/dist/idCaptureManager-B9TGA5dq.d.ts +0 -956
  114. package/dist/idCaptureManager-DMK0GIt3.esm.js +0 -581
  115. package/dist/idCaptureStateMachine-Bq0fVZXl.esm.js +0 -2954
  116. package/dist/idOcrStateMachine-YbjjC_Gg.esm.js +0 -388
  117. package/dist/idVerificationStateMachine-xbw9HP1Z.esm.js +0 -71
  118. package/dist/identity-reuse.d.ts +0 -530
  119. package/dist/identity-reuse.esm.js +0 -274
  120. package/dist/index-BLKtMA0g.d.ts +0 -1177
  121. package/dist/index-BcRG8rtJ.d.ts +0 -97
  122. package/dist/index.d.ts +0 -3
  123. package/dist/index.esm.js +0 -12
  124. package/dist/invokeOnCaptureCallback-rc6kBHo5.esm.js +0 -30
  125. package/dist/lib-BB0B_qQX.esm.js +0 -12499
  126. package/dist/mandatory-consent.d.ts +0 -412
  127. package/dist/mandatory-consent.esm.js +0 -78
  128. package/dist/mandatoryConsentStateMachine-Cnco1jvn.esm.js +0 -126
  129. package/dist/openviduLazy-Cm0XFh_v.esm.js +0 -3
  130. package/dist/openviduLazy-Cok70ZSg.esm.js +0 -12
  131. package/dist/permissionServices-D_i6nzEw.esm.js +0 -50
  132. package/dist/phone.d.ts +0 -4
  133. package/dist/phone.esm.js +0 -9
  134. package/dist/phoneManager-B6M30hKE.d.ts +0 -397
  135. package/dist/phoneManager-DAJbGhlY.esm.js +0 -256
  136. package/dist/phoneStateMachine-CuPARRaT.esm.js +0 -351
  137. package/dist/platform-CfrjKhmi.esm.js +0 -83
  138. package/dist/qe-signature-DFo_Cc-I.esm.js +0 -12
  139. package/dist/qe-signature.d.ts +0 -25
  140. package/dist/qe-signature.esm.js +0 -8
  141. package/dist/recordingService-Ig2UgbLv.esm.js +0 -1003
  142. package/dist/redirect-to-mobile.d.ts +0 -107
  143. package/dist/redirect-to-mobile.esm.js +0 -102
  144. package/dist/redirectToMobileStateMachine-BOEqe46A.esm.js +0 -249
  145. package/dist/runChildModule-CqqwqAkW.esm.js +0 -219
  146. package/dist/selfie.d.ts +0 -26
  147. package/dist/selfie.esm.js +0 -146
  148. package/dist/selfieManager-D0lSgd-J.d.ts +0 -68
  149. package/dist/selfieManager-Duisl7qN.esm.js +0 -60
  150. package/dist/selfieStateMachine-D76whWEf.esm.js +0 -68
  151. package/dist/session-BS-d_vuE.esm.js +0 -3206
  152. package/dist/session.d.ts +0 -217
  153. package/dist/session.esm.js +0 -9
  154. package/dist/setup-Buy-hyj4.esm.js +0 -887
  155. package/dist/setup-C5AITV8m.d.ts +0 -254
  156. package/dist/signature.d.ts +0 -94
  157. package/dist/signature.esm.js +0 -66
  158. package/dist/signatureStateMachine-B5-QVUve.esm.js +0 -132
  159. package/dist/stats-CIfiPzb1.esm.js +0 -16
  160. package/dist/stats.d.ts +0 -16
  161. package/dist/stats.esm.js +0 -4
  162. package/dist/trust-graph.d.ts +0 -54
  163. package/dist/trust-graph.esm.js +0 -56
  164. package/dist/types-B06Ypu2F.d.ts +0 -49
  165. package/dist/types-BP1m8VRw.d.ts +0 -340
  166. package/dist/types-CAD4va6a.d.ts +0 -5
  167. package/dist/types-CFV9G_7j.d.ts +0 -24
  168. package/dist/warmup-CEcppFiS.d.ts +0 -63
  169. package/dist/wasm.d.ts +0 -15
  170. package/dist/wasm.esm.js +0 -12
  171. package/dist/watchlist-for-business.d.ts +0 -79
  172. package/dist/watchlist-for-business.esm.js +0 -148
  173. package/dist/watchlist.d.ts +0 -62
  174. package/dist/watchlist.esm.js +0 -86
  175. package/dist/watchlistServices-DMbUhkBX.esm.js +0 -12
  176. package/dist/workflow.d.ts +0 -907
  177. package/dist/workflow.esm.js +0 -702
  178. package/dist/xstate.esm-B70JrNqo.esm.js +0 -3404
@@ -1,596 +0,0 @@
1
- import { t as api } from "./api-CESGtpbH.esm.js";
2
-
3
- //#region ../infra/src/capabilities/IBrowserEnvironmentCapability.ts
4
- function getTimestamp() {
5
- return Date.now();
6
- }
7
- function revokeObjectURL(url) {
8
- URL.revokeObjectURL(url);
9
- }
10
-
11
- //#endregion
12
- //#region src/internal/events/eventBus.ts
13
- function createEventBus() {
14
- const listeners = [];
15
- function subscribe(listener) {
16
- listeners.push(listener);
17
- return () => {
18
- const index = listeners.indexOf(listener);
19
- if (index > -1) listeners.splice(index, 1);
20
- };
21
- }
22
- function emit(event) {
23
- listeners.forEach((listener) => {
24
- try {
25
- listener(event);
26
- } catch {
27
- return;
28
- }
29
- });
30
- }
31
- function clear() {
32
- listeners.length = 0;
33
- }
34
- return {
35
- subscribe,
36
- emit,
37
- clear
38
- };
39
- }
40
-
41
- //#endregion
42
- //#region src/internal/events/addEvent.ts
43
- const INTERVIEW_EVENTS_MAX_SCREEN_LENGTH = 50;
44
- function normalizeScreenForInterviewEventsApi(screenValue) {
45
- const limit = INTERVIEW_EVENTS_MAX_SCREEN_LENGTH;
46
- if (screenValue.length <= limit) return screenValue;
47
- const head = screenValue.slice(0, limit);
48
- const lastDot = head.lastIndexOf(".");
49
- const lastPlus = head.lastIndexOf("+");
50
- const lastBoundary = Math.max(lastDot, lastPlus);
51
- if (lastBoundary > 0) return head.slice(0, lastBoundary);
52
- return head;
53
- }
54
- const eventBus = createEventBus();
55
- let analyticsBatcher = null;
56
- /**
57
- * Buffer for events fired before any batcher has been registered (i.e. before
58
- * `setup()` runs). Drained into the batcher's own buffer at registration time
59
- * so these events ride the first flush. Subscribers receive them at emit time
60
- * regardless.
61
- */
62
- const pendingEvents = [];
63
- /**
64
- * Registers the analytics batcher used by `addEvent` to ship events to the
65
- * interview-events API. Disposes any previously-registered instance and drains
66
- * any events queued before registration into the new batcher's buffer (FIFO).
67
- *
68
- * Returns the registered service so the caller can drive its lifecycle
69
- * (e.g. call `.start()` after session initialization completes).
70
- */
71
- function setAnalyticsBatcher(service) {
72
- analyticsBatcher?.dispose();
73
- analyticsBatcher = service;
74
- if (pendingEvents.length > 0) {
75
- const drained = pendingEvents.splice(0);
76
- for (const entry of drained) service.enqueue(entry);
77
- }
78
- return service;
79
- }
80
- /**
81
- * Returns the currently-registered analytics batcher, or null if none.
82
- * Used by `setup()` to reuse an existing batcher across multi-step setup
83
- * calls instead of disposing the buffered events on re-registration.
84
- */
85
- function getAnalyticsBatcher() {
86
- return analyticsBatcher;
87
- }
88
- /**
89
- * Disposes the registered analytics batcher, clears the slot, and drops any
90
- * events buffered in the pre-registration queue. Used by tests and `reset()`
91
- * to return the events module to a clean state.
92
- */
93
- function resetAnalyticsBatcher() {
94
- analyticsBatcher?.dispose();
95
- analyticsBatcher = null;
96
- pendingEvents.length = 0;
97
- }
98
- /**
99
- * Subscribes to raw SDK analytics events.
100
- *
101
- * This stream includes noisy tracking events such as `screenOpened`,
102
- * `elementClicked`, and `captureAttemptFinished`. These events are also used by
103
- * the SDK analytics pipeline and may be queued or posted to the interview-events
104
- * API.
105
- *
106
- * For curated flow milestones such as `flow.started`, `flow.ready`, and
107
- * `flow.completed`, use `manager.subscribeFlowEvent()`. The `FlowEvent` type is
108
- * exported from `@incodetech/core/flow-events`.
109
- *
110
- * @param listener - Callback function that receives each event
111
- * @returns Unsubscribe function to remove the listener
112
- *
113
- * @example
114
- * ```typescript
115
- * const unsubscribe = subscribeEvent((event) => {
116
- * console.log('[Event]', event.code, event.module);
117
- * });
118
- *
119
- * // Later
120
- * unsubscribe();
121
- * ```
122
- */
123
- function subscribeEvent(listener) {
124
- return eventBus.subscribe(listener);
125
- }
126
- /**
127
- * Sends an event to the dashboard for tracking.
128
- * Fire-and-forget: never blocks, never throws.
129
- * Subscribers always receive the event at emit time. When a batcher is
130
- * registered, the event is enqueued for batched delivery. Before any batcher
131
- * is registered (events fired pre-`setup()`), the event is buffered in a
132
- * one-shot pending queue and drained into the batcher when it's registered.
133
- */
134
- function addEvent(event) {
135
- eventBus.emit(event);
136
- const entry = {
137
- code: event.code,
138
- module: event.module,
139
- screen: event.screen !== void 0 ? normalizeScreenForInterviewEventsApi(event.screen) : void 0,
140
- clientTimestamp: event.clientTimestamp ?? getTimestamp(),
141
- payload: event.payload ?? {}
142
- };
143
- if (!analyticsBatcher) {
144
- pendingEvents.push(entry);
145
- return;
146
- }
147
- analyticsBatcher.enqueue(entry);
148
- }
149
-
150
- //#endregion
151
- //#region src/internal/events/AnalyticsBatchingService.ts
152
- const DEFAULT_MAX_BATCH_SIZE = 50;
153
- const DEFAULT_MAX_BATCH_AGE_MS = 1e3;
154
- const DEFAULT_MAX_RETRIES = 2;
155
- const RETRY_BASE_DELAY_MS = 250;
156
- function isTransientStatus(status) {
157
- return status === 0 || status >= 500 || status === 408 || status === 429;
158
- }
159
- function createAnalyticsBatchingService(options) {
160
- const { endpoint, authToken, pageLifecycle, timer, apiBaseUrl, apiClient = api, maxBatchSize = DEFAULT_MAX_BATCH_SIZE, maxBatchAgeMs = DEFAULT_MAX_BATCH_AGE_MS, maxRetries = DEFAULT_MAX_RETRIES } = options;
161
- let buffer = [];
162
- let started = false;
163
- let disposed = false;
164
- let ageTimerHandle = null;
165
- let unsubscribeLifecycle = null;
166
- let warnedNullToken = false;
167
- function clearAgeTimer() {
168
- if (ageTimerHandle !== null) {
169
- timer.clearTimeout(ageTimerHandle);
170
- ageTimerHandle = null;
171
- }
172
- }
173
- function armAgeTimerIfNeeded() {
174
- if (ageTimerHandle === null) ageTimerHandle = timer.setTimeout(() => {
175
- ageTimerHandle = null;
176
- flush();
177
- }, maxBatchAgeMs);
178
- }
179
- function dropTokenless() {
180
- if (!warnedNullToken) {
181
- warnedNullToken = true;
182
- console.warn("[AnalyticsBatchingService] Dropping batch: no auth token at flush time.");
183
- }
184
- }
185
- function sendBatch(batch, attempt) {
186
- let promise;
187
- try {
188
- promise = apiClient.post(endpoint, batch, { keepalive: true });
189
- } catch (error) {
190
- handleSendError(batch, error, attempt);
191
- return;
192
- }
193
- promise.catch((error) => handleSendError(batch, error, attempt));
194
- }
195
- function handleSendError(batch, error, attempt) {
196
- if (disposed) return;
197
- if (!isTransientStatus(error && typeof error === "object" && "status" in error ? Number(error.status) || 0 : 0)) return;
198
- if (attempt >= maxRetries) return;
199
- const delay = RETRY_BASE_DELAY_MS * 2 ** attempt;
200
- timer.setTimeout(() => {
201
- if (disposed) return;
202
- sendBatch(batch, attempt + 1);
203
- }, delay);
204
- }
205
- function flush() {
206
- if (disposed || buffer.length === 0) return;
207
- const batch = buffer;
208
- buffer = [];
209
- clearAgeTimer();
210
- if (!authToken()) {
211
- dropTokenless();
212
- return;
213
- }
214
- sendBatch(batch, 0);
215
- }
216
- function handlePageHide() {
217
- if (disposed || buffer.length === 0) return;
218
- const batch = buffer;
219
- buffer = [];
220
- clearAgeTimer();
221
- const token = authToken();
222
- if (!token) {
223
- dropTokenless();
224
- return;
225
- }
226
- const url = `${apiBaseUrl().replace(/\/$/, "")}${endpoint}`;
227
- const body = JSON.stringify({
228
- token,
229
- events: batch
230
- });
231
- pageLifecycle.sendBeacon(url, body);
232
- }
233
- function enqueue(entry) {
234
- if (disposed) return;
235
- buffer.push(entry);
236
- if (!started) return;
237
- if (buffer.length >= maxBatchSize) {
238
- flush();
239
- return;
240
- }
241
- armAgeTimerIfNeeded();
242
- }
243
- function start() {
244
- if (started || disposed) return;
245
- started = true;
246
- unsubscribeLifecycle = pageLifecycle.onPageHide(handlePageHide);
247
- if (buffer.length > 0) flush();
248
- }
249
- function dispose() {
250
- if (disposed) return;
251
- disposed = true;
252
- clearAgeTimer();
253
- unsubscribeLifecycle?.();
254
- unsubscribeLifecycle = null;
255
- buffer = [];
256
- }
257
- return {
258
- enqueue,
259
- start,
260
- flush,
261
- dispose
262
- };
263
- }
264
-
265
- //#endregion
266
- //#region src/internal/events/helpers.ts
267
- function screenEvent(params) {
268
- addEvent({
269
- code: params.code,
270
- module: params.module,
271
- screen: params.screen,
272
- clientTimestamp: getTimestamp(),
273
- payload: params.payload
274
- });
275
- }
276
- function moduleOpened(module, screen, payload) {
277
- screenEvent({
278
- module,
279
- screen,
280
- code: "moduleOpened",
281
- payload
282
- });
283
- }
284
- function moduleClosed(module, screen, payload) {
285
- screenEvent({
286
- module,
287
- screen,
288
- code: "moduleClosed",
289
- payload
290
- });
291
- }
292
- function screenOpened(module, screen, payload) {
293
- screenEvent({
294
- module,
295
- screen,
296
- code: "screenOpened",
297
- payload
298
- });
299
- }
300
- function screenClosed(module, screen, payload) {
301
- screenEvent({
302
- module,
303
- screen,
304
- code: "screenClosed",
305
- payload
306
- });
307
- }
308
- function errorTriggered(module, screen, payload) {
309
- screenEvent({
310
- module,
311
- screen,
312
- code: "errorTriggered",
313
- payload
314
- });
315
- }
316
- function elementClicked(module, screen, payload) {
317
- screenEvent({
318
- module,
319
- screen,
320
- code: "elementClicked",
321
- payload
322
- });
323
- }
324
- function captureAttemptFinished(module, screen, payload) {
325
- screenEvent({
326
- module,
327
- screen,
328
- code: "captureAttemptFinished",
329
- payload
330
- });
331
- }
332
-
333
- //#endregion
334
- //#region src/internal/events/managerInstrumentation.ts
335
- function normalizeSegment(segment) {
336
- if (typeof segment !== "string") return "";
337
- return segment.trim().replace(/([a-z0-9])([A-Z])/g, "$1-$2").toLowerCase().replace(/[^a-z0-9]+/g, "-").replace(/^-+|-+$/g, "");
338
- }
339
- function normalizeDottedPath(path) {
340
- return path.split("+").map((branch) => branch.split(".").map((segment) => normalizeSegment(segment)).filter((segment) => segment.length > 0).join(".")).filter((branch) => branch.length > 0).join("+");
341
- }
342
- function stateValueToScreenSegment(value) {
343
- if (typeof value === "string" || typeof value === "number") {
344
- const segment = normalizeSegment(String(value));
345
- return segment.length > 0 ? segment : void 0;
346
- }
347
- if (typeof value !== "object" || value === null) return;
348
- const entries = Object.entries(value).sort(([left], [right]) => {
349
- if (left < right) return -1;
350
- if (left > right) return 1;
351
- return 0;
352
- });
353
- if (entries.length === 0) return;
354
- const branches = entries.map(([key, nestedValue]) => {
355
- const normalizedKey = normalizeSegment(key);
356
- const nestedSegment = stateValueToScreenSegment(nestedValue);
357
- if (normalizedKey.length === 0) return nestedSegment;
358
- if (nestedSegment === void 0) return normalizedKey;
359
- return `${normalizedKey}.${nestedSegment}`;
360
- }).filter((branch) => branch !== void 0 && branch.length > 0);
361
- if (branches.length === 0) return;
362
- return branches.join("+");
363
- }
364
- function buildScreenName(moduleName, screenName) {
365
- const normalizedModuleName = typeof moduleName === "string" ? moduleName.trim() : "";
366
- const normalizedScreen = normalizeDottedPath(screenName);
367
- if (normalizedModuleName.length === 0) return normalizedScreen;
368
- if (normalizedScreen.length === 0) return normalizedModuleName;
369
- return `${normalizedModuleName}.${normalizedScreen}`;
370
- }
371
- function getDefaultManagerScreenName(snapshot) {
372
- return stateValueToScreenSegment(snapshot.value);
373
- }
374
- function getManagerScreenName(moduleName, snapshot, options) {
375
- const eventScreen = options?.getEventScreenName?.(snapshot);
376
- if (eventScreen !== void 0) return eventScreen;
377
- const mappedScreen = options?.getScreenName?.(snapshot) ?? getDefaultManagerScreenName(snapshot);
378
- if (mappedScreen === void 0) return;
379
- return buildScreenName(moduleName, mappedScreen);
380
- }
381
- function isErrorLikeSegment(segment) {
382
- return segment === "error" || segment.includes("error") || segment.includes("failed") || segment.includes("failure");
383
- }
384
- function getDefaultManagerErrorName(snapshot) {
385
- const screenSegment = stateValueToScreenSegment(snapshot.value);
386
- if (screenSegment === void 0) return;
387
- const normalizedSegment = normalizeDottedPath(screenSegment);
388
- if (normalizedSegment.length === 0) return;
389
- if (normalizedSegment === "error") return "error.unknown";
390
- if (!isErrorLikeSegment(normalizedSegment)) return;
391
- return `error.${normalizedSegment}`;
392
- }
393
- function createManagerInstrumentation(moduleName, options) {
394
- return {
395
- moduleName,
396
- onModuleOpened: moduleOpened,
397
- onModuleClosed: moduleClosed,
398
- onScreenOpened: screenOpened,
399
- onScreenClosed: screenClosed,
400
- onErrorTriggered: errorTriggered,
401
- onElementClicked: (moduleName$1, screenName, payload) => elementClicked(moduleName$1, screenName, payload),
402
- onCaptureAttemptFinished: (moduleName$1, screenName, payload) => captureAttemptFinished(moduleName$1, screenName, payload),
403
- getScreenName: (snapshot) => getManagerScreenName(moduleName, snapshot, {
404
- getEventScreenName: options?.getEventScreenName,
405
- getScreenName: options?.getScreenName
406
- }),
407
- getErrorName: (snapshot) => {
408
- const mappedError = options?.getErrorName?.(snapshot) ?? getDefaultManagerErrorName(snapshot);
409
- if (mappedError === void 0) return;
410
- return buildScreenName(moduleName, mappedError);
411
- },
412
- getErrorPayload: (snapshot) => options?.getErrorPayload?.(snapshot)
413
- };
414
- }
415
-
416
- //#endregion
417
- //#region src/internal/events/types.ts
418
- const eventModuleNames = {
419
- selfie: "SELFIE",
420
- faceCapture: "faceCapture",
421
- authentication: "AUTHENTICATION",
422
- authFace: "authFace",
423
- mlConsent: "ML_CONSENT",
424
- combinedConsent: "COMBINED_CONSENT",
425
- curpValidation: "CURP_VALIDATION",
426
- faceMatch: "FACE_MATCH",
427
- qr: "QR",
428
- videoSelfie: "VIDEO_ONBOARDING",
429
- passport: "ID",
430
- front: "ID",
431
- back: "ID",
432
- id: "ID",
433
- idCapture: "idCapture",
434
- idOcr: "ID_OCR",
435
- document: "DOCUMENT_CAPTURE",
436
- creditCard: "CREDIT_CARD_FRONT",
437
- creditCardBack: "CREDIT_CARD_BACK",
438
- conference: "CONFERENCE",
439
- otp: "OTP",
440
- signature: "SIGNATURE",
441
- ekyc: "EXTERNAL_VERIFICATION",
442
- watchlist: "WATCHLIST",
443
- globalWatchList: "GLOBAL_WATCHLIST",
444
- customWatchList: "CUSTOM_WATCHLIST",
445
- email: "EMAIL",
446
- phone: "PHONE",
447
- instantVerifyEmail: "INSTANT_VERIFY_EMAIL",
448
- instantVerifyConsent: "INSTANT_VERIFY_CONSENT",
449
- forms: "FORMS",
450
- customModule: "CUSTOM_MODULE",
451
- geolocation: "GEOLOCATION",
452
- ekyb: "EKYB",
453
- identityReuse: "IDENTITY_REUSE",
454
- antifraud: "ANTIFRAUD",
455
- aeSignature: "AE_SIGNATURE",
456
- qeSignature: "QE_SIGNATURE",
457
- crossDocumentDataMatch: "CROSS_DOCUMENT_DATA_MATCH",
458
- customFields: "CUSTOM_FIELDS",
459
- watchlistForBusiness: "WATCHLIST_FOR_BUSINESS",
460
- trustGraph: "TRUST_GRAPH"
461
- };
462
- const eventScreenNames = {
463
- faceMatch: "FACE_MATCH",
464
- faceCaptureTutorial: "SELFIE_CAPTURE_TUTORIAL",
465
- faceCaptureCamera: "SELFIE_CAMERA_CAPTURE",
466
- faceCaptureError: "SELFIE_ATTEMPT_FAILED",
467
- faceCaptureSuccess: "SELFIE_UPLOAD_SUCCEEDED",
468
- faceCaptureUpload: "SELFIE_UPLOAD_PROGRESS",
469
- mlConsent: "MACHINE_LEARNING_CONSENT",
470
- combinedConsent: "COMBINED_CONSENT",
471
- curpEnter: "ENTER_CURP",
472
- curpValidate: "VALIDATE_CURP",
473
- curpGenerate: "GENERATE_CURP",
474
- curpValidation: "CURP_VALIDATION_PROGRESS",
475
- curpValidationFailed: "CURP_VALIDATION_FAILED",
476
- curpValidationSuccess: "CURP_VALIDATION_SUCCEEDED",
477
- qrTutorial: "QR_TUTORIAL",
478
- qrScan: "QR_SCAN",
479
- smsOtp: "OTP",
480
- simpleOTP: "OTP",
481
- signatureInput: "SIGNATURE_INPUT",
482
- frontTutorial: "FRONT_ID_CAPTURE_TUTORIAL",
483
- frontCameraCapture: "FRONT_ID_CAMERA_CAPTURE",
484
- frontHelp: "FRONT_ID_HELP",
485
- frontReviewPhoto: "FRONT_ID_REVIEW_PHOTO",
486
- frontUploadProgress: "FRONT_ID_UPLOAD_PROGRESS",
487
- frontAttemptFailed: "FRONT_ID_ATTEMPT_FAILED",
488
- frontUploadSuccess: "FRONT_ID_UPLOAD_SUCCEEDED",
489
- backTutorial: "BACK_ID_CAPTURE_TUTORIAL",
490
- backCameraCapture: "BACK_ID_CAMERA_CAPTURE",
491
- backReviewPhoto: "BACK_ID_REVIEW_PHOTO",
492
- backUploadProgress: "BACK_ID_UPLOAD_PROGRESS",
493
- backAttemptFailed: "BACK_ID_ATTEMPT_FAILED",
494
- backUploadSuccess: "BACK_ID_UPLOAD_SUCCEEDED",
495
- backHelp: "BACK_ID_HELP",
496
- passportTutorial: "TUTORIAL_PASSPORT",
497
- documentTutorial: "DOCUMENT_CAPTURE_TUTORIAL",
498
- documentCameraCapture: "DOCUMENT_CAMERA_CAPTURE",
499
- documentHelp: "DOCUMENT_HELP",
500
- documentReviewPhoto: "DOCUMENT_REVIEW_PHOTO",
501
- documentUploadProgress: "DOCUMENT_UPLOAD_IN_PROGRESS",
502
- documentAttemptFailed: "DOCUMENT_ATTEMPT_FAILED",
503
- documentUploadSuccess: "DOCUMENT_UPLOAD_SUCCEEDED",
504
- conferenceWait: "CONFERENCE_WAIT",
505
- conferenceVideoChat: "CONFERENCE_VIDEO_CHAT",
506
- conferenceMessageChat: "CONFERENCE_MESSAGE_CHAT",
507
- videoSelfieTutorial: "VIDEO_SELFIE_TUTORIAL",
508
- videoSelfie: "VIDEO_SELFIE",
509
- videoSelfieFaceCapture: "VIDEO_SELFIE_FACE_CAPTURE",
510
- videoSelfieFaceUploadProgress: "VIDEO_SELFIE_FACE_UPLOAD_PROGRESS",
511
- videoSelfieFaceAttemptFailed: "VIDEO_SELFIE_FACE_ATTEMPT_FAILED",
512
- videoSelfieFaceUploadSucceeded: "VIDEO_SELFIE_FACE_UPLOAD_SUCCEEDED",
513
- videoSelfieFrontIdCapture: "VIDEO_SELFIE_FRONT_ID_CAPTURE",
514
- videoSelfieFrontIdUploadProgress: "VIDEO_SELFIE_FRONT_ID_UPLOAD_PROGRESS",
515
- videoSelfieFrontIdAttemptFailed: "VIDEO_SELFIE_FRONT_ID_ATTEMPT_FAILED",
516
- videoSelfieFrontIdUploadSucceeded: "VIDEO_SELFIE_FRONT_ID_UPLOAD_SUCCEEDED",
517
- videoSelfieBackIdCapture: "VIDEO_SELFIE_BACK_ID_CAPTURE",
518
- videoSelfieBackIdUploadProgress: "VIDEO_SELFIE_BACK_ID_UPLOAD_PROGRESS",
519
- videoSelfieBackIdAttemptFailed: "VIDEO_SELFIE_BACK_ID_ATTEMPT_FAILED",
520
- videoSelfieBackIdUploadSucceeded: "VIDEO_SELFIE_BACK_ID_UPLOAD_SUCCEEDED",
521
- videoSelfieDocumentCapture: "VIDEO_SELFIE_DOCUMENT_CAPTURE",
522
- videoSelfieVoiceQuestion: "VIDEO_SELFIE_VOICE_QUESTION",
523
- videoSelfieVoiceFinalQuestion: "VIDEO_SELFIE_VOICE_FINAL_QUESTION",
524
- videoSelfieVideoUpload: "VIDEO SELFIE VIDEO UPLOAD",
525
- ekycInput: "EKYC_INPUT",
526
- ekycProgress: "EKYC_PROGRESS",
527
- ekycSucceeded: "EKYC_SUCCEEDED",
528
- ekycFailed: "EKYC_FAILED",
529
- forms: "FORMS",
530
- globalWatchListInput: "GLOBAL_WATCHLIST_INPUT",
531
- globalWatchListProgress: "GLOBAL_WATCHLIST_PROGRESS",
532
- globalWatchListSuccess: "GLOBAL_WATCHLIST_SUCCEEDED",
533
- globalWatchListFailed: "GLOBAL_WATCHLIST_FAILED",
534
- customWatchListInput: "CUSTOM_WATCHLIST_INPUT",
535
- customWatchListProgress: "CUSTOM_WATCHLIST_PROGRESS",
536
- customWatchListSuccess: "CUSTOM_WATCHLIST_SUCCEEDED",
537
- customWatchListFailed: "CUSTOM_WATCHLIST_FAILED",
538
- emailInput: "EMAIL_INPUT",
539
- phoneInput: "PHONE_INPUT",
540
- instantVerify: "INSTANT_VERIFY",
541
- authFace: "AUTH_FACE",
542
- authFaceError: "AUTH_FACE_ATTEMPT_FAILED",
543
- authFaceUpload: "AUTH_FACE_UPLOAD_PROGRESS",
544
- authFaceUploadSuccess: "AUTH_FACE_UPLOAD_SUCCEEDED",
545
- authFaceUploadFailed: "AUTH_FACE_UPLOAD_FAILED",
546
- authFaceTutorial: "AUTH_FACE_TUTORIAL",
547
- customModuleCallback: "CUSTOM_MODULE_CALLBACK",
548
- customModuleProcessing: "CUSTOM_MODULE_PROCESSING",
549
- digitalIdFileSelection: "DIGITAL_ID_FILE_SELECTION",
550
- digitalIdFileReview: "DIGITAL_ID_FILE_REVIEW",
551
- digitalIdUploadProgress: "DIGITAL_ID_UPLOAD_PROGRESS",
552
- digitalIdUploadSuccess: "DIGITAL_ID_UPLOAD_SUCCEEDED",
553
- digitalIdUploadFailed: "DIGITAL_ID_UPLOAD_FAILED",
554
- digitalIdAnalysisProgress: "DIGITAL_ID_ANALYSIS_PROGRESS",
555
- digitalIdVerificationSuccess: "DIGITAL_ID_VERIFICATION_SUCCESS",
556
- digitalIdVerificationFailed: "DIGITAL_ID_VERIFICATION_FAILED",
557
- ekybForm: "EKYB_FORM"
558
- };
559
- const videoSelfieEvents = {
560
- imageTooBlurry: "imageTooBlurry",
561
- fillFrame: "fillFrame",
562
- checkCameraOrLighting: "checkCameraOrLighting",
563
- frontIdCaptureStarted: "frontIdCaptureStarted",
564
- lookAtCamera: "lookAtCamera",
565
- moveCloser: "moveCloser",
566
- lookingForFrontId: "lookingForFrontId",
567
- lookingForBackId: "lookingForBackId",
568
- cameraSwitchToBack: "cameraSwitchToBack",
569
- cameraSwitchToFront: "cameraSwitchToFront",
570
- audioStreamOpened: "audioStreamOpened",
571
- audioStreamClosed: "audioStreamClosed",
572
- videoSelfieVideoUploadInProgress: "videoSelfieVideoUploadInProgress",
573
- videoSelfieTosNotAccepted: "videoSelfieTosNotAccepted",
574
- videoSelfieTosAccepted: "videoSelfieTosAccepted",
575
- videoSelfieStreamCreated: "videoSelfieStreamCreated",
576
- videoSelfieStreamDestroyed: "videoSelfieStreamDestroyed",
577
- videoSelfieReconnecting: "videoSelfieReconnecting",
578
- videoSelfieReconnected: "videoSelfieReconnected"
579
- };
580
- const tutorialScreenNamesMapper = {
581
- passport: eventScreenNames.passportTutorial,
582
- front: eventScreenNames.frontTutorial,
583
- back: eventScreenNames.backTutorial,
584
- selfie: eventScreenNames.faceCaptureTutorial
585
- };
586
- const cameraScreenNamesMapper = {
587
- front: "front",
588
- back: "back",
589
- passport: "passport",
590
- creditCard: "front",
591
- creditCardBack: "back",
592
- document: "document"
593
- };
594
-
595
- //#endregion
596
- export { revokeObjectURL as S, resetAnalyticsBatcher as _, videoSelfieEvents as a, createEventBus as b, elementClicked as c, screenClosed as d, screenEvent as f, getAnalyticsBatcher as g, addEvent as h, tutorialScreenNamesMapper as i, moduleClosed as l, createAnalyticsBatchingService as m, eventModuleNames as n, createManagerInstrumentation as o, screenOpened as p, eventScreenNames as r, captureAttemptFinished as s, cameraScreenNamesMapper as t, moduleOpened as u, setAnalyticsBatcher as v, getTimestamp as x, subscribeEvent as y };