@incodetech/core 2.0.1 → 2.1.0-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 (218) hide show
  1. package/dist/{BrowserStorageProvider-CuOW1Er2.esm.js → BrowserStorageProvider-BpJM-gIl.esm.js} +8 -1
  2. package/dist/{IpifyProvider-D7jx52AL.esm.js → IpifyProvider-D4LWD15E.esm.js} +28 -0
  3. package/dist/{MotionSensorProvider-4v7xkqAp.esm.js → MotionSensorProvider-Bx7Mpzt0.esm.js} +63 -13
  4. package/dist/{OpenViduRecordingProvider-CMu6XVdc.esm.js → OpenViduRecordingProvider-O4GjBseO.esm.js} +1 -1
  5. package/dist/StateMachine-BC_nGvrc.d.ts +2 -0
  6. package/dist/StreamCanvasCapture-ImiDQdVA.esm.js +118 -0
  7. package/dist/StreamCanvasCapture-yyl20qd9.d.ts +152 -0
  8. package/dist/{BaseWasmProvider-C_DLEI40.esm.js → WasmUtilProvider-CiEN7Gjn.esm.js} +183 -11
  9. package/dist/{addressSearch-BpTbTWCa.esm.js → addressSearch-DvmWXKZg.esm.js} +63 -57
  10. package/dist/{ae-signature-DDDZmWXj.esm.js → ae-signature-BFZta3TZ.esm.js} +1 -1
  11. package/dist/ae-signature.d.ts +3 -3
  12. package/dist/ae-signature.esm.js +6 -5
  13. package/dist/antifraud.d.ts +5 -46
  14. package/dist/antifraud.esm.js +6 -43
  15. package/dist/antifraudManager-CkV4u-LE.esm.js +55 -0
  16. package/dist/antifraudManager-CznnhyvD.d.ts +63 -0
  17. package/dist/{antifraudStateMachine-O0TMf6yc.esm.js → antifraudStateMachine-Ccrb-Jxc.esm.js} +2 -2
  18. package/dist/apiError-B-j-gyDx.esm.js +51 -0
  19. package/dist/authentication.d.ts +13 -11
  20. package/dist/authentication.esm.js +26 -22
  21. package/dist/{authenticationManager-C83GNIhl.d.ts → authenticationManager-CIVY80H9.d.ts} +4 -4
  22. package/dist/{authenticationManager-5M-fKzXx.esm.js → authenticationManager-ZNotsWnC.esm.js} +6 -6
  23. package/dist/{authenticationStateMachine-BMZqatiF.esm.js → authenticationStateMachine-DksVbF_H.esm.js} +21 -9
  24. package/dist/{backCameraStream-DMdMeGk2.esm.js → backCameraStream-D7Wo4Nbx.esm.js} +95 -7
  25. package/dist/{session-CrkWAs-q.esm.js → browserSimulation-B1dWiXp7.esm.js} +61 -476
  26. package/dist/camera.d.ts +4 -3
  27. package/dist/camera.esm.js +4 -3
  28. package/dist/canvas-SKcRBxsk.esm.js +230 -0
  29. package/dist/consent.d.ts +4 -398
  30. package/dist/consent.esm.js +6 -77
  31. package/dist/consentManager-BLd51QiW.d.ts +419 -0
  32. package/dist/consentManager-BYo9Nu1r.esm.js +90 -0
  33. package/dist/{consentStateMachine-CCT-B60O.esm.js → consentStateMachine-BG3yL8aC.esm.js} +9 -6
  34. package/dist/cpf-ocr.d.ts +4 -199
  35. package/dist/cpf-ocr.esm.js +8 -177
  36. package/dist/cpfOcrManager-BnieFXuG.d.ts +216 -0
  37. package/dist/cpfOcrManager-sSKegxox.esm.js +190 -0
  38. package/dist/cross-document-data-match.d.ts +1 -1
  39. package/dist/cross-document-data-match.esm.js +4 -4
  40. package/dist/curp-validation.d.ts +8 -158
  41. package/dist/curp-validation.esm.js +6 -108
  42. package/dist/curpValidationManager-CFem6zP9.esm.js +122 -0
  43. package/dist/curpValidationManager-RttixpIc.d.ts +184 -0
  44. package/dist/{curpValidationStateMachine-CitWLr2c.esm.js → curpValidationStateMachine-B7V_qp66.esm.js} +20 -13
  45. package/dist/custom-fields.d.ts +2 -2
  46. package/dist/custom-fields.esm.js +4 -4
  47. package/dist/custom-watchlist.d.ts +1 -1
  48. package/dist/custom-watchlist.esm.js +4 -41
  49. package/dist/customWatchlistStateMachine-HmFybXLX.esm.js +50 -0
  50. package/dist/{deepsightLoader-Cm4JIT_z.esm.js → deepsightLoader-65k1Appi.esm.js} +19 -10
  51. package/dist/{deepsightService-CEVxzehb.d.ts → deepsightService-B7ShOkWL.d.ts} +8 -160
  52. package/dist/deepsightService-CrHmvx8X.esm.js +276 -0
  53. package/dist/device.esm.js +4 -3
  54. package/dist/document-capture.d.ts +995 -86
  55. package/dist/document-capture.esm.js +34 -8
  56. package/dist/document-upload.d.ts +47 -47
  57. package/dist/document-upload.esm.js +7 -7
  58. package/dist/{documentCaptureStateMachine-BqzTDy9k.esm.js → documentCaptureStateMachine-WYV1r9le.esm.js} +90 -6
  59. package/dist/dynamic-forms.d.ts +20 -5
  60. package/dist/dynamic-forms.esm.js +150 -61
  61. package/dist/ekyb.d.ts +32 -13
  62. package/dist/ekyb.esm.js +25 -15
  63. package/dist/{ekybStateMachine-CyMx_kg-.esm.js → ekybStateMachine-aYixw2sL.esm.js} +319 -207
  64. package/dist/ekyc.d.ts +10 -78
  65. package/dist/ekyc.esm.js +17 -12
  66. package/dist/{ekycStateMachine-oeO0Iekd.esm.js → ekycStateMachine-CXbpaJJn.esm.js} +201 -113
  67. package/dist/electronic-signature.d.ts +3 -3
  68. package/dist/electronic-signature.esm.js +5 -4
  69. package/dist/{electronicSignatureManager-D9OHzTpG.esm.js → electronicSignatureManager-BaECdJ1u.esm.js} +91 -23
  70. package/dist/email.d.ts +4 -3
  71. package/dist/email.esm.js +6 -5
  72. package/dist/{emailManager-wAV0LE-H.esm.js → emailManager--D5G3ChB.esm.js} +30 -7
  73. package/dist/{emailManager-DIfnS5g1.d.ts → emailManager-lAzDoQOs.d.ts} +66 -8
  74. package/dist/{emailStateMachine-DOf4j58N.esm.js → emailStateMachine-CxTOMAjC.esm.js} +46 -11
  75. package/dist/{endpoints-CnN3SyDa.esm.js → endpoints-BeTK0Mlt.esm.js} +6 -3
  76. package/dist/{events-D6-e4vok.esm.js → events-Dvvriq9l.esm.js} +3 -1
  77. package/dist/events.d.ts +2 -0
  78. package/dist/events.esm.js +1 -1
  79. package/dist/extensibility.d.ts +32 -16
  80. package/dist/extensibility.esm.js +55 -33
  81. package/dist/face-match.d.ts +32 -2
  82. package/dist/face-match.esm.js +5 -5
  83. package/dist/{faceCaptureManagerFactory-yqtpxjnN.d.ts → faceCaptureManagerFactory-C_hRHx8a.d.ts} +35 -11
  84. package/dist/{faceCaptureManagerFactory-Dh2PdGlF.esm.js → faceCaptureManagerFactory-kqbUqtrr.esm.js} +21 -5
  85. package/dist/{faceCaptureSetup-B3faSpYA.esm.js → faceCaptureSetup-CtvHWd3x.esm.js} +68 -183
  86. package/dist/{faceMatchStateMachine-DNFrxTFS.esm.js → faceMatchStateMachine-DdGXUBnx.esm.js} +60 -6
  87. package/dist/field-comparison.d.ts +4 -0
  88. package/dist/field-comparison.esm.js +7 -0
  89. package/dist/fieldComparisonManager-Bu5TaSr3.d.ts +76 -0
  90. package/dist/fieldComparisonManager-COGI2ARD.esm.js +162 -0
  91. package/dist/fiscal-qr.d.ts +59 -0
  92. package/dist/fiscal-qr.esm.js +323 -0
  93. package/dist/flow-events.d.ts +6 -5
  94. package/dist/flow.d.ts +23 -15
  95. package/dist/flow.esm.js +63 -17
  96. package/dist/flowCompletionService-BdR2cGgB.d.ts +19 -0
  97. package/dist/flowCompletionService-DdGojV9K.esm.js +20 -0
  98. package/dist/{flowServices-PiNsxLfK.esm.js → flowServices-BTuHLHVr.esm.js} +10 -5
  99. package/dist/geolocation.d.ts +4 -4
  100. package/dist/geolocation.esm.js +6 -6
  101. package/dist/{geolocationStateMachine-asasuHY2.esm.js → geolocationStateMachine-Dvh7X0wF.esm.js} +5 -5
  102. package/dist/getBrowser-C8DP7oTB.esm.js +8 -0
  103. package/dist/{getBrowser-BSXUTWXw.esm.js → getDeviceClass-C0olyNFS.esm.js} +1 -8
  104. package/dist/{getDeviceClass-BSntT9_j.esm.js → getDeviceClass-C8Do2qYu.esm.js} +1 -1
  105. package/dist/government-validation.d.ts +28 -8
  106. package/dist/government-validation.esm.js +19 -8
  107. package/dist/{governmentValidationStateMachine-BDDYrJTo.esm.js → governmentValidationStateMachine-DcJ-BfsC.esm.js} +35 -77
  108. package/dist/home.d.ts +15 -14
  109. package/dist/home.esm.js +2 -2
  110. package/dist/http-Cai3IoLS.esm.js +0 -0
  111. package/dist/http.esm.js +1 -0
  112. package/dist/id-ocr.d.ts +54 -54
  113. package/dist/id-ocr.esm.js +5 -5
  114. package/dist/id-verification.d.ts +27 -27
  115. package/dist/id-verification.esm.js +4 -4
  116. package/dist/id.d.ts +12 -10
  117. package/dist/id.esm.js +36 -26
  118. package/dist/{idCaptureManager-Fyd0eam-.d.ts → idCaptureManager-D-QYESvF.d.ts} +28 -14
  119. package/dist/{idCaptureManager-D0ktk7Hh.esm.js → idCaptureManager-DGVv5l1_.esm.js} +22 -7
  120. package/dist/{idCaptureStateMachine-dwlBUjbC.esm.js → idCaptureStateMachine-DHi7HydI.esm.js} +172 -123
  121. package/dist/{idOcrStateMachine-YbjjC_Gg.esm.js → idOcrStateMachine-CDQ5d_VM.esm.js} +4 -4
  122. package/dist/{idVerificationStateMachine-xbw9HP1Z.esm.js → idVerificationStateMachine-kRxwImzO.esm.js} +2 -2
  123. package/dist/identity-reuse.d.ts +4 -530
  124. package/dist/identity-reuse.esm.js +8 -274
  125. package/dist/identityReuseManager-C6n_97dw.esm.js +95 -0
  126. package/dist/identityReuseManager-DwLtVzUn.d.ts +428 -0
  127. package/dist/identityReuseStateMachine-BfE5YiEr.esm.js +148 -0
  128. package/dist/{index-BcRG8rtJ.d.ts → index-B5hPA0Bg.d.ts} +2 -2
  129. package/dist/{index-ChHWNH48.d.ts → index-B9NysVDB.d.ts} +469 -195
  130. package/dist/index.d.ts +2 -2
  131. package/dist/index.esm.js +10 -8
  132. package/dist/{invokeOnCaptureCallback-rc6kBHo5.esm.js → invokeOnCaptureCallback-ygByVdnn.esm.js} +1 -1
  133. package/dist/{lib-BB0B_qQX.esm.js → lib-BY67lgbq.esm.js} +1 -1
  134. package/dist/mandatory-consent.d.ts +8 -412
  135. package/dist/mandatory-consent.esm.js +6 -76
  136. package/dist/mandatoryConsentManager-H6D18cZB.esm.js +89 -0
  137. package/dist/mandatoryConsentManager-KfIlURRY.d.ts +429 -0
  138. package/dist/{mandatoryConsentStateMachine-Cnco1jvn.esm.js → mandatoryConsentStateMachine-DtQNW1ji.esm.js} +6 -6
  139. package/dist/openviduLazy-B8L--0oe.esm.js +3 -0
  140. package/dist/{openviduLazy-Cok70ZSg.esm.js → openviduLazy-Dh14JNJc.esm.js} +2 -2
  141. package/dist/otp-CGMdUzBC.esm.js +33 -0
  142. package/dist/otp-DF5A0sFx.d.ts +8 -0
  143. package/dist/permissionGuards-C1ispV96.esm.js +23 -0
  144. package/dist/permissionServices-CG3bMSfG.esm.js +130 -0
  145. package/dist/phone.d.ts +4 -3
  146. package/dist/phone.esm.js +6 -5
  147. package/dist/{phoneManager-DAJbGhlY.esm.js → phoneManager-BmF-0Ez4.esm.js} +30 -7
  148. package/dist/{phoneManager-B6M30hKE.d.ts → phoneManager-fPmIBYQK.d.ts} +65 -7
  149. package/dist/{phoneStateMachine-CuPARRaT.esm.js → phoneStateMachine-BiV0yoEx.esm.js} +46 -11
  150. package/dist/{qe-signature-DFo_Cc-I.esm.js → qe-signature-CUYPcHVo.esm.js} +1 -1
  151. package/dist/qe-signature.d.ts +3 -3
  152. package/dist/qe-signature.esm.js +6 -5
  153. package/dist/{recordingService-Ig2UgbLv.esm.js → recordingService-Bn9EdCmz.esm.js} +197 -179
  154. package/dist/redirect-to-mobile.d.ts +6 -104
  155. package/dist/redirect-to-mobile.esm.js +6 -99
  156. package/dist/redirectToMobileManager-BNe3IzC_.d.ts +178 -0
  157. package/dist/redirectToMobileManager-Dy3t7o0C.esm.js +159 -0
  158. package/dist/{redirectToMobileStateMachine-BOEqe46A.esm.js → redirectToMobileStateMachine-DyAdRxfP.esm.js} +28 -19
  159. package/dist/{runChildModule-CqqwqAkW.esm.js → runChildModule-CuoHZ1cx.esm.js} +35 -3
  160. package/dist/selfie.d.ts +13 -11
  161. package/dist/selfie.esm.js +27 -23
  162. package/dist/{selfieManager-Duisl7qN.esm.js → selfieManager-BjCoKRy0.esm.js} +6 -6
  163. package/dist/{selfieManager-D0lSgd-J.d.ts → selfieManager-dUbKRzOh.d.ts} +4 -4
  164. package/dist/{selfieStateMachine-D76whWEf.esm.js → selfieStateMachine-b4F2q9zw.esm.js} +5 -3
  165. package/dist/session-DoVb-OcB.esm.js +152 -0
  166. package/dist/session.d.ts +37 -5
  167. package/dist/session.esm.js +12 -7
  168. package/dist/sessionInitializer-B8H5MsXM.esm.js +366 -0
  169. package/dist/{setup-C5AITV8m.d.ts → setup-BbkprdVv.d.ts} +57 -6
  170. package/dist/{setup-DPPAxmXf.esm.js → setup-BqEfrdja.esm.js} +162 -24
  171. package/dist/signature.d.ts +2 -2
  172. package/dist/signature.esm.js +4 -4
  173. package/dist/{signatureStateMachine-B5-QVUve.esm.js → signatureStateMachine-C5qqYLRz.esm.js} +3 -3
  174. package/dist/stats-BMNUG1AU.esm.js +41 -0
  175. package/dist/stats.d.ts +13 -2
  176. package/dist/stats.esm.js +3 -2
  177. package/dist/trust-graph.d.ts +33 -4
  178. package/dist/trust-graph.esm.js +21 -15
  179. package/dist/{types-CFV9G_7j.d.ts → types-Bj9hdFjU.d.ts} +1 -1
  180. package/dist/{types-BP1m8VRw.d.ts → types-DOUhndhT.d.ts} +14 -2
  181. package/dist/types-DsnEVMhr.esm.js +34 -0
  182. package/dist/types-DvGZI7BF.d.ts +131 -0
  183. package/dist/{types-B06Ypu2F.d.ts → types-NuT8ftBV.d.ts} +1 -1
  184. package/dist/types-ya0LN_MX.d.ts +5 -0
  185. package/dist/{warmup-CEcppFiS.d.ts → warmup-Dg8Lh-50.d.ts} +8 -0
  186. package/dist/wasm.d.ts +6 -4
  187. package/dist/wasm.esm.js +11 -9
  188. package/dist/watchlist-for-business.d.ts +1 -1
  189. package/dist/watchlist-for-business.esm.js +5 -73
  190. package/dist/watchlist.d.ts +1 -1
  191. package/dist/watchlist.esm.js +4 -41
  192. package/dist/watchlistForBusinessStateMachine-DMl8j2Ov.esm.js +74 -0
  193. package/dist/watchlistStateMachine-DmQlqI6L.esm.js +50 -0
  194. package/dist/workflow.d.ts +150 -97
  195. package/dist/workflow.esm.js +156 -80
  196. package/package.json +19 -1
  197. package/dist/StateMachine-BCQrZJhf.d.ts +0 -2
  198. package/dist/WasmUtilProvider-j98OJf-S.esm.js +0 -114
  199. package/dist/browserSimulation-gxD8cSpM.esm.js +0 -20
  200. package/dist/deepsightService-O74l4Y__.esm.js +0 -489
  201. package/dist/displayErrors-DqJ_IbsG.d.ts +0 -39
  202. package/dist/flowCompletionService-DhkT4SRY.d.ts +0 -10
  203. package/dist/flowCompletionService-P54yzGvA.esm.js +0 -13
  204. package/dist/openviduLazy-Cm0XFh_v.esm.js +0 -3
  205. package/dist/permissionServices-D_i6nzEw.esm.js +0 -50
  206. package/dist/stats-CIfiPzb1.esm.js +0 -16
  207. package/dist/types-CAD4va6a.d.ts +0 -5
  208. package/dist/watchlistServices-DMbUhkBX.esm.js +0 -12
  209. /package/dist/{Actor-CI32dTbG.d.ts → Actor-Y0_Fj-KL.d.ts} +0 -0
  210. /package/dist/{ITimerCapability-C67ZRskg.esm.js → ITimerCapability-CB0I1Uf2.esm.js} +0 -0
  211. /package/dist/{Manager-C8PrhBOx.d.ts → Manager-BHn8wH8K.d.ts} +0 -0
  212. /package/dist/{camera-PA2Ljri3.esm.js → camera-DJWm3V4g.esm.js} +0 -0
  213. /package/dist/{camera-DBSxa6ML.d.ts → camera-SRBpPq2X.d.ts} +0 -0
  214. /package/dist/{chunk-CRF6K_H_.esm.js → chunk-CMUKZ2uL.esm.js} +0 -0
  215. /package/dist/{cpf-PPz2Njto.esm.js → cpf-BRzggV8G.esm.js} +0 -0
  216. /package/dist/{dateUtils-UoN5xswP.esm.js → dateUtils-AksLQmgV.esm.js} +0 -0
  217. /package/dist/{platform-CfrjKhmi.esm.js → platform-SKvEfCBh.esm.js} +0 -0
  218. /package/dist/{xstate.esm-B70JrNqo.esm.js → xstate.esm-C9wncMQa.esm.js} +0 -0
@@ -1,13 +1,64 @@
1
- import { l as WasmPipelineType, r as mlWasmJSApi_default, t as BaseWasmProvider } from "./BaseWasmProvider-C_DLEI40.esm.js";
2
- import { t as api } from "./api-CESGtpbH.esm.js";
3
- import { t as endpoints } from "./endpoints-CnN3SyDa.esm.js";
4
- import { i as stopCameraStream, r as requestCameraAccess } from "./camera-PA2Ljri3.esm.js";
5
- import { n as IncodeCanvas } from "./deepsightService-O74l4Y__.esm.js";
6
- import { a as isIPhone14OrHigher, n as isDesktop, r as isIOS, t as isAndroid } from "./platform-CfrjKhmi.esm.js";
7
- import { n as getDesktopCameraStream, t as getBackCameraStream } from "./backCameraStream-DMdMeGk2.esm.js";
8
- import { t as addDeviceStats } from "./stats-CIfiPzb1.esm.js";
9
- import { t as getDeviceClass } from "./getDeviceClass-BSntT9_j.esm.js";
1
+ import { i as mlWasmJSApi_default, n as BaseWasmProvider, u as WasmPipelineType } from "./WasmUtilProvider-CiEN7Gjn.esm.js";
2
+ import { r as getToken, t as api } from "./api-CESGtpbH.esm.js";
3
+ import { t as endpoints } from "./endpoints-BeTK0Mlt.esm.js";
4
+ import { t as addDeviceStats } from "./stats-BMNUG1AU.esm.js";
5
+ import { a as isIPhone14OrHigher, n as isDesktop, r as isIOS, t as isAndroid } from "./platform-SKvEfCBh.esm.js";
6
+ import { i as stopCameraStream, r as requestCameraAccess } from "./camera-DJWm3V4g.esm.js";
7
+ import { t as sleep } from "./ITimerCapability-CB0I1Uf2.esm.js";
8
+ import { t as IncodeCanvas } from "./canvas-SKcRBxsk.esm.js";
9
+ import { n as getBackCameraStream, r as getDesktopCameraStream, t as ensureFrontCameraStream } from "./backCameraStream-D7Wo4Nbx.esm.js";
10
+ import { t as getDeviceClass } from "./getDeviceClass-C8Do2qYu.esm.js";
11
+ import { t as FACE_ERROR_CODES } from "./types-DsnEVMhr.esm.js";
10
12
 
13
+ //#region ../infra/src/scheduling/yieldUntilNextPaint.ts
14
+ /**
15
+ * Resolves after the browser has had a chance to commit and paint a queued
16
+ * render.
17
+ *
18
+ * Strategy:
19
+ * - `requestAnimationFrame` callbacks fire BEFORE the paint of the frame
20
+ * they belong to (per the HTML5 "update the rendering" step). If we
21
+ * resolve the promise inside a rAF callback, the await-continuation
22
+ * runs as a microtask immediately after the callback returns — still
23
+ * before the paint phase of that frame. A caller that then blocks the
24
+ * main thread (e.g. synchronous WASM `processPhoto`) starves the paint.
25
+ * - We therefore chain rAF → setTimeout: the rAF fires before frame N's
26
+ * paint, the setTimeout runs as a macrotask scheduled after frame N's
27
+ * "update the rendering" step, which the browser will only get to once
28
+ * the paint actually lands. By the time setTimeout fires, the paint
29
+ * for the queued render is on screen.
30
+ * - In environments where rAF never ticks (jsdom, happy-dom, backgrounded
31
+ * tabs), a parallel `setTimeout` fallback at 100 ms resolves instead.
32
+ * 100 ms is comfortably longer than two real-browser frames so rAF +
33
+ * setTimeout wins reliably in any foregrounded browser. (An earlier
34
+ * implementation raced rAF against a `MessageChannel` macrotask, but
35
+ * MessageChannel drains immediately after the current task's
36
+ * microtasks — before the next paint — so it resolved the promise too
37
+ * early and defeated the whole point of the helper.)
38
+ *
39
+ * Lives in infra because it touches browser APIs (`requestAnimationFrame`,
40
+ * `setTimeout`) that the architecture rules forbid from core. Core modules
41
+ * that need to yield to the browser render loop should import this helper
42
+ * directly via its file path.
43
+ */
44
+ function yieldUntilNextPaint() {
45
+ return new Promise((resolve) => {
46
+ let resolved = false;
47
+ const done = () => {
48
+ if (resolved) return;
49
+ resolved = true;
50
+ resolve();
51
+ };
52
+ if (typeof requestAnimationFrame === "function") requestAnimationFrame(() => {
53
+ requestAnimationFrame(() => {
54
+ setTimeout(done, 0);
55
+ });
56
+ });
57
+ setTimeout(done, 100);
58
+ });
59
+ }
60
+
61
+ //#endregion
11
62
  //#region ../infra/src/providers/wasm/FaceDetectionProvider.ts
12
63
  var FaceDetectionProvider = class extends BaseWasmProvider {
13
64
  constructor() {
@@ -31,10 +82,8 @@ var FaceDetectionProvider = class extends BaseWasmProvider {
31
82
  framesAggregationInterval: 2e3,
32
83
  minFramesWithFace: 3
33
84
  };
34
- this.currentFrame = null;
35
85
  }
36
86
  async processFrame(image) {
37
- this.currentFrame = image;
38
87
  await this.processFrameWasm(image);
39
88
  }
40
89
  async initialize(config) {
@@ -55,15 +104,11 @@ var FaceDetectionProvider = class extends BaseWasmProvider {
55
104
  setCallbacks(callbacks) {
56
105
  this.ensureInitialized();
57
106
  const onCaptureWrapper = (wasmCanvas, face) => {
58
- let frameCanvas = null;
59
- if (this.currentFrame) frameCanvas = IncodeCanvas.fromImageData(this.currentFrame);
60
- else if (wasmCanvas) frameCanvas = new IncodeCanvas(wasmCanvas);
61
- if (!frameCanvas) return;
107
+ if (!wasmCanvas) return;
108
+ const frameCanvas = new IncodeCanvas(wasmCanvas);
109
+ frameCanvas.updateBase64Image();
110
+ frameCanvas.updateBlob();
62
111
  const faceCoordinates = face ? this.formatFaceCoordinates(face) : this.createDefaultFaceCoordinates(frameCanvas);
63
- try {
64
- frameCanvas.updateBase64Image();
65
- frameCanvas.updateBlob();
66
- } catch {}
67
112
  callbacks.onCapture?.(frameCanvas, faceCoordinates);
68
113
  };
69
114
  mlWasmJSApi_default.setFaceDetectionCallbacks(this.getPipelineType(), callbacks.onFarAway ?? (() => {}), callbacks.onTooClose ?? (() => {}), callbacks.onTooManyFaces ?? (() => {}), callbacks.onNoFace ?? (() => {}), onCaptureWrapper, callbacks.onGetReady ?? (() => {}), callbacks.onGetReadyFinished ?? (() => {}), callbacks.onCenterFace ?? (() => {}), callbacks.onDark ?? (() => {}), callbacks.onBlur ?? (() => {}), callbacks.onFaceAngle ?? (() => {}), callbacks.onLenses ?? (() => {}), callbacks.onMask ?? (() => {}), callbacks.onEyesClosed ?? (() => {}), callbacks.onHeadWear ?? (() => {}), callbacks.onSwitchToManualCapture ?? (() => {}), callbacks.onFaceOccluded ?? (() => {}));
@@ -127,10 +172,6 @@ var FaceDetectionProvider = class extends BaseWasmProvider {
127
172
  this.ensureInitialized();
128
173
  mlWasmJSApi_default.setFaceDetectionMode(this.getPipelineType(), enabled);
129
174
  }
130
- reset() {
131
- super.reset();
132
- this.currentFrame = null;
133
- }
134
175
  createDefaultFaceCoordinates(canvas) {
135
176
  return {
136
177
  rightEyeX: 0,
@@ -240,45 +281,12 @@ async function uploadDeepsightVideo(encryptedVideo, token) {
240
281
  }
241
282
  }
242
283
 
243
- //#endregion
244
- //#region src/internal/faceCapture/types.ts
245
- const FACE_ERROR_CODES = {
246
- FACE_OCCLUDED: "FACE_OCCLUDED",
247
- LIVENESS: "LIVENESS_ERROR",
248
- BRIGHTNESS: "BRIGHTNESS_ERROR",
249
- LENSES: "LENSES_ERROR",
250
- MASK: "MASK_ERROR",
251
- CLOSED_EYES: "CLOSED_EYES_ERROR",
252
- HEAD_COVER: "HEAD_COVER_ERROR",
253
- SERVER: "SERVER_ERROR",
254
- FACE_NOT_FOUND: "FACE_NOT_FOUND",
255
- MULTIPLE_FACES: "MULTIPLE_FACES",
256
- TOO_BLURRY: "TOO_BLURRY_ERROR",
257
- TOO_DARK: "TOO_DARK_ERROR",
258
- USER_IS_NOT_RECOGNIZED: "USER_IS_NOT_RECOGNIZED",
259
- SPOOF_ATTEMPT_DETECTED: "SPOOF_ATTEMPT_DETECTED",
260
- FACE_TOO_DARK: "FACE_TOO_DARK",
261
- LENSES_DETECTED: "LENSES_DETECTED",
262
- FACE_MASK_DETECTED: "FACE_MASK_DETECTED",
263
- CLOSED_EYES_DETECTED: "CLOSED_EYES_DETECTED",
264
- HEAD_COVER_DETECTED: "HEAD_COVER_DETECTED",
265
- FACE_CROPPING_FAILED: "FACE_CROPPING_FAILED",
266
- FACE_TOO_SMALL: "FACE_TOO_SMALL",
267
- FACE_TOO_BLURRY: "FACE_TOO_BLURRY",
268
- BAD_PHOTO_QUALITY: "BAD_PHOTO_QUALITY",
269
- PROCESSING_ERROR: "PROCESSING_ERROR",
270
- BAD_REQUEST: "BAD_REQUEST",
271
- NONEXISTENT_CUSTOMER: "NONEXISTENT_CUSTOMER",
272
- HINT_NOT_PROVIDED: "HINT_NOT_PROVIDED",
273
- SELFIE_IMAGE_LOW_QUALITY: "SELFIE_IMAGE_LOW_QUALITY"
274
- };
275
-
276
284
  //#endregion
277
285
  //#region src/modules/selfie/selfieUploadService.ts
278
286
  /**
279
287
  * Uploads a selfie image to the backend.
280
288
  */
281
- async function uploadSelfie({ encryptedBase64Image, faceCoordinates, signal, metadata, recordingId }) {
289
+ async function uploadSelfie({ encryptedBase64Image, faceCoordinates, signal, metadata, recordingId, deepsightService }) {
282
290
  try {
283
291
  const payload = {
284
292
  base64Image: encryptedBase64Image,
@@ -294,6 +302,12 @@ async function uploadSelfie({ encryptedBase64Image, faceCoordinates, signal, met
294
302
  query
295
303
  });
296
304
  if (!res.ok) throw new Error(`POST ${endpoints.selfie} failed: ${res.status} ${res.statusText}`);
305
+ if (deepsightService) addDeviceStats({
306
+ frontIdStatsAnalysisStatus: "",
307
+ backIdStatsAnalysisStatus: "",
308
+ selfieStatsAnalysisStatus: deepsightService.getAnalysisStatus(),
309
+ motionStatus: deepsightService.getMotionStatus()
310
+ });
297
311
  return res.data;
298
312
  } catch (error) {
299
313
  const errorCode = getFaceErrorCodeFromHttpError(error);
@@ -326,6 +340,7 @@ async function processFace(imageType = "selfie", signal) {
326
340
 
327
341
  //#endregion
328
342
  //#region src/internal/faceCapture/faceCaptureServices.ts
343
+ const ONDEVICE_AUTOCAPTURE_INTERVAL_MS = 2147483647;
329
344
  function sendLabelInspectionEvent() {
330
345
  return addDeviceStats({ cameraLabelInspectionStatus: "FAIL" });
331
346
  }
@@ -341,10 +356,11 @@ const IPHONE14_SELFIE_CONSTRAINTS = {
341
356
  video: { height: { ideal: 1080 } },
342
357
  audio: false
343
358
  };
344
- function buildCameraConstraints(resolution) {
359
+ function buildCameraConstraints(resolution, deviceId) {
345
360
  if (resolution) return {
346
361
  video: {
347
362
  facingMode: "user",
363
+ deviceId: deviceId ? { exact: deviceId } : void 0,
348
364
  height: resolution.height ? { ideal: resolution.height } : void 0,
349
365
  width: resolution.width ? { ideal: resolution.width } : void 0
350
366
  },
@@ -357,16 +373,18 @@ function stopStream(stream) {
357
373
  stopCameraStream(stream);
358
374
  }
359
375
  async function getFrontCameraStream(resolution) {
360
- if (resolution) return requestCameraAccess(buildCameraConstraints(resolution));
361
- if (isDesktop()) return getDesktopCameraStream({});
362
- return requestCameraAccess(buildCameraConstraints());
376
+ if (isDesktop()) {
377
+ if (resolution) return ensureFrontCameraStream((deviceId) => requestCameraAccess(buildCameraConstraints(resolution, deviceId)));
378
+ return ensureFrontCameraStream((deviceId) => getDesktopCameraStream(deviceId ? { deviceId } : {}));
379
+ }
380
+ return requestCameraAccess(resolution ? buildCameraConstraints(resolution) : buildCameraConstraints());
363
381
  }
364
382
  async function initializeCamera(params) {
365
383
  const { config } = params;
366
384
  const prcConstraints = buildCameraConstraints(config.cameraResolution);
367
385
  const provider = new FaceDetectionProvider();
368
386
  await provider.initialize({
369
- autocaptureInterval: config.autoCaptureTimeout * 1e3,
387
+ autocaptureInterval: isOnDeviceMode(config) ? ONDEVICE_AUTOCAPTURE_INTERVAL_MS : config.autoCaptureTimeout * 1e3,
370
388
  useOnDeviceWorkflow: config.onDeviceFaceResultsSubmissionEnabled === true
371
389
  });
372
390
  provider.setChecksEnabled({
@@ -472,7 +490,7 @@ function buildResolutionFromStream(stream) {
472
490
  if (typeof width === "number" && typeof height === "number") return `${width}x${height}`;
473
491
  }
474
492
  async function createOpenViduRecordingProvider() {
475
- const { OpenViduRecordingProvider } = await import("./OpenViduRecordingProvider-CMu6XVdc.esm.js");
493
+ const { OpenViduRecordingProvider } = await import("./OpenViduRecordingProvider-O4GjBseO.esm.js");
476
494
  return new OpenViduRecordingProvider();
477
495
  }
478
496
  async function startRecordingSession(params) {
@@ -512,7 +530,7 @@ async function stopRecording(session) {
512
530
  }
513
531
  }
514
532
  async function initializeDeepsightSession(options) {
515
- const { loadDeepsightSession } = await import("./deepsightLoader-Cm4JIT_z.esm.js");
533
+ const { loadDeepsightSession } = await import("./deepsightLoader-65k1Appi.esm.js");
516
534
  return loadDeepsightSession({
517
535
  ds: options.ds,
518
536
  storage: options.storage
@@ -520,119 +538,116 @@ async function initializeDeepsightSession(options) {
520
538
  }
521
539
 
522
540
  //#endregion
523
- //#region ../infra/src/media/StreamCanvasCapture.ts
524
- var StreamCanvasCapture = class {
525
- constructor(stream, options) {
526
- this.hasFrame = false;
527
- this.disposed = false;
528
- this.eventTarget = new EventTarget();
529
- this.video = document.createElement("video");
530
- this.video.srcObject = stream;
531
- this.video.autoplay = true;
532
- this.video.playsInline = true;
533
- this.video.muted = true;
534
- const settings = stream.getVideoTracks()[0]?.getSettings();
535
- const initialWidth = options?.width ?? settings?.width ?? 1280;
536
- const initialHeight = options?.height ?? settings?.height ?? 720;
537
- this.canvas = document.createElement("canvas");
538
- this.canvas.width = initialWidth;
539
- this.canvas.height = initialHeight;
540
- this.ctx = this.canvas.getContext("2d", { willReadFrequently: true });
541
- const fps = options?.fps ?? 10;
542
- const intervalMs = fps > 0 ? Math.max(16, Math.floor(1e3 / fps)) : 0;
543
- this.video.addEventListener("loadedmetadata", () => {
544
- if (this.video.videoWidth > 0 && this.video.videoHeight > 0) {
545
- this.canvas.width = this.video.videoWidth;
546
- this.canvas.height = this.video.videoHeight;
547
- }
548
- });
549
- try {
550
- this.video.play();
551
- } catch {}
552
- this.rafLoop(intervalMs);
553
- }
554
- addEventListener(type, listener, options) {
555
- this.eventTarget.addEventListener(type, listener, options);
556
- }
557
- removeEventListener(type, listener, options) {
558
- this.eventTarget.removeEventListener(type, listener, options);
559
- }
560
- /**
561
- * Returns the latest cached frame as an {@link IncodeCanvas}.
562
- */
563
- getLatestCanvas() {
564
- if (!this.hasFrame) this.tick();
565
- if (!this.hasFrame) return null;
566
- return new IncodeCanvas(this.canvas);
567
- }
568
- /**
569
- * Returns the latest cached frame as raw {@link ImageData}.
570
- */
571
- getLatestFrame() {
572
- if (!this.ctx) return null;
573
- if (!this.hasFrame) this.tick();
574
- if (!this.hasFrame) return null;
575
- try {
576
- return this.ctx.getImageData(0, 0, this.canvas.width, this.canvas.height);
577
- } catch {
578
- return null;
579
- }
580
- }
581
- /**
582
- * Disposes internal resources and stops the capture loop.
583
- */
584
- dispose() {
585
- if (this.disposed) return;
586
- this.disposed = true;
587
- if (this.rafId !== void 0) {
588
- window.cancelAnimationFrame(this.rafId);
589
- this.rafId = void 0;
590
- }
591
- this.video.srcObject = null;
592
- this.canvas.width = 0;
593
- this.canvas.height = 0;
594
- this.hasFrame = false;
595
- }
596
- rafLoop(intervalMs) {
597
- const loop = (timeMs) => {
598
- if (this.disposed) return;
599
- if (intervalMs <= 0 || this.lastTickTimeMs === void 0 || timeMs - this.lastTickTimeMs >= intervalMs) {
600
- this.lastTickTimeMs = timeMs;
601
- const previousFrameTimeSeconds = this.lastFrameTimeSeconds;
602
- this.tick();
603
- const currentFrameTimeSeconds = this.video.currentTime;
604
- if (previousFrameTimeSeconds === void 0) {
605
- if (this.hasFrame) {
606
- this.lastFrameTimeSeconds = currentFrameTimeSeconds;
607
- this.eventTarget.dispatchEvent(new Event("frame"));
608
- }
609
- } else if (this.hasFrame && currentFrameTimeSeconds !== previousFrameTimeSeconds) {
610
- this.lastFrameTimeSeconds = currentFrameTimeSeconds;
611
- this.eventTarget.dispatchEvent(new Event("frame"));
612
- }
613
- }
614
- this.rafId = window.requestAnimationFrame(loop);
615
- };
616
- this.rafId = window.requestAnimationFrame(loop);
617
- }
618
- tick() {
619
- if (!this.ctx) return;
620
- if (this.video.readyState < HTMLMediaElement.HAVE_CURRENT_DATA) return;
621
- const videoWidth = this.video.videoWidth;
622
- const videoHeight = this.video.videoHeight;
623
- if (videoWidth === 0 || videoHeight === 0) return;
624
- if (this.canvas.width !== videoWidth || this.canvas.height !== videoHeight) {
625
- this.canvas.width = videoWidth;
626
- this.canvas.height = videoHeight;
627
- }
628
- try {
629
- this.ctx.drawImage(this.video, 0, 0);
630
- this.hasFrame = true;
631
- } catch {
632
- this.hasFrame = false;
633
- }
541
+ //#region src/internal/faceCapture/onDeviceFaceResults.ts
542
+ /**
543
+ * On-device face-results submission helpers.
544
+ *
545
+ * When a SELFIE or AUTHENTICATION module has
546
+ * `onDeviceFaceResultsSubmissionEnabled: true`, face analysis runs entirely
547
+ * inside the WASM `OnDeviceSelfieWorkflow` pipeline. Captured images are
548
+ * never uploaded — only the staged face-results JSON is POSTed via the WASM
549
+ * `WebApi` to `/omni/add/face-results`. The C++ side encrypts that JSON via
550
+ * `SessionEncryptor`, so the per-request `createWasmApi` encryption pipeline
551
+ * is not engaged on this path.
552
+ *
553
+ * Note: even though the per-request encryption pipeline is skipped, the
554
+ * on-device endpoint (`/omni/add/face-results`) is only served on the
555
+ * E2EE-provisioned host — callers must still configure `setup()` with the
556
+ * dedicated E2EE `apiURL` and `encryption: true`. See `SetupOptions.encryption`.
557
+ *
558
+ * These helpers are deliberately variant-agnostic: both the selfie and auth
559
+ * state machine variants delegate their `prepareFaceUpload`, `uploadFace`,
560
+ * and `processFace` actors here to share behavior. See the "Runtime modes
561
+ * within a module" section of `docs/patterns/XSTATE.md` for the broader
562
+ * pattern.
563
+ */
564
+ const isOnDeviceMode = (config) => config.onDeviceFaceResultsSubmissionEnabled === true;
565
+ /**
566
+ * The default (non-on-device) prepare-upload body shared by selfie and auth.
567
+ * Stops any active recording, runs deepsight virtual-camera + frame checks,
568
+ * tracks the capture attempt, and encrypts the captured image.
569
+ *
570
+ * Lifted out of `faceCaptureSetup.ts`'s base `prepareFaceUpload` actor so the
571
+ * default path can be reused by both variants while leaving room for an
572
+ * on-device branch alongside it.
573
+ */
574
+ async function defaultPrepareFaceUpload(ctx) {
575
+ const sessionToken = getToken();
576
+ const recordingId = (await ctx.recordingService?.stop())?.recordingId ?? null;
577
+ try {
578
+ if (ctx.deepsightService) await Promise.all([ctx.deepsightService.performVirtualCameraCheck(sessionToken, "SELFIE"), ctx.deepsightService.analyzeFrame(ctx.capturedImage.getImageData())]);
579
+ } catch (error) {}
580
+ const logs = ctx.deepsightService?.getPipelineState() ?? "";
581
+ ctx.dependencies.trackCaptureAttemptFinished?.({ logs });
582
+ return {
583
+ encryptedBase64Image: await encryptSelfieImage({
584
+ canvas: ctx.capturedImage,
585
+ dependencies: ctx.dependencies
586
+ }),
587
+ recordingId
588
+ };
589
+ }
590
+ /**
591
+ * On-device prepare-upload. No recording to stop (the recording service is
592
+ * never created when the flag is on), no image encryption needed.
593
+ *
594
+ * Behavior depends on which capture path got us here:
595
+ *
596
+ * - **Auto-capture path**: the WASM `OnDeviceSelfiePipeline` has been
597
+ * consuming every video frame via `processFrame()` and aggregating
598
+ * results across them. When it picks a best-shot, the C++
599
+ * `OnDeviceSelfieWorkflow::createOnCaptureHandler` calls
600
+ * `WebApi::setFaceResults(...)` automatically staging strong,
601
+ * aggregated `BestShotData` for the subsequent `postFaceResults` call.
602
+ * We must NOT call `processPhoto` here: `applyFaceResults` would
603
+ * overwrite that staged state with a weaker single-frame analysis of a
604
+ * post-capture snapshot (camera state has already changed: autocapture
605
+ * freeze, stream pause, post-detection latency), and the server then
606
+ * rejects the submission as "image quality too low".
607
+ *
608
+ * - **Manual-capture path**: the auto-capture timer expired without a
609
+ * successful best-shot, so the C++ pipeline has nothing staged. We
610
+ * need to run a single-frame analysis on the manually captured canvas
611
+ * via `processPhoto`, which itself calls
612
+ * `OnDeviceSelfieWorkflow::applyFaceResults` `WebApi::setFaceResults`
613
+ * to stage results. Mirrors V1 (`packages/incode-welcome/src/camera/useSelfie.ts`)
614
+ * where `processPhoto` is only invoked from `handleManualCapture`.
615
+ *
616
+ * Returns sentinel values for `encryptedBase64Image` and `recordingId` so
617
+ * the existing FaceCaptureContext shape remains stable; downstream actors
618
+ * for the on-device path simply ignore them.
619
+ */
620
+ async function prepareOnDeviceFaceUpload(ctx) {
621
+ if (!ctx.capturedImage) throw new Error("On-device capture requires a captured image canvas");
622
+ if (!ctx.provider) throw new Error("On-device capture requires the FaceDetectionProvider to be initialized");
623
+ if (ctx.manualCaptureTriggered) {
624
+ await yieldUntilNextPaint();
625
+ await sleep(350);
626
+ ctx.provider.processPhoto(ctx.capturedImage.canvas);
634
627
  }
635
- };
628
+ return {
629
+ encryptedBase64Image: "",
630
+ recordingId: null
631
+ };
632
+ }
633
+ /**
634
+ * POSTs the staged on-device face-results JSON to `/omni/add/face-results`
635
+ * through the WASM `WebApi`. Used as the `uploadFace` actor body for both
636
+ * selfie and auth variants when on-device mode is enabled.
637
+ *
638
+ * The C++ `WebApi` handles `SessionEncryptor` encryption and the actual
639
+ * HTTP via the WASM `WebClient` — so callers don't need to thread the
640
+ * session-encryption details through JS.
641
+ */
642
+ async function postOnDeviceFaceResults(ctx, signal) {
643
+ const provider = ctx.provider;
644
+ if (!provider) throw new Error("On-device upload requires the FaceDetectionProvider to be initialized");
645
+ const sessionToken = getToken();
646
+ return await provider.postFaceResults({
647
+ headers: sessionToken ? { "X-Incode-Hardware-Id": sessionToken } : void 0,
648
+ timeout: 3e4
649
+ }) ?? {};
650
+ }
636
651
 
637
652
  //#endregion
638
653
  //#region src/internal/manualReview/manualReviewService.ts
@@ -898,12 +913,12 @@ var LocalRecordingProvider = class {
898
913
  let openViduProviderImportPromise;
899
914
  let openViduBrowserImportPromise;
900
915
  function loadOpenViduProviderModule() {
901
- if (!openViduProviderImportPromise) openViduProviderImportPromise = import("./OpenViduRecordingProvider-CMu6XVdc.esm.js");
916
+ if (!openViduProviderImportPromise) openViduProviderImportPromise = import("./OpenViduRecordingProvider-O4GjBseO.esm.js");
902
917
  return openViduProviderImportPromise;
903
918
  }
904
919
  function loadOpenViduBrowserModule() {
905
920
  if (!openViduBrowserImportPromise) openViduBrowserImportPromise = (async () => {
906
- return (await import("./openviduLazy-Cm0XFh_v.esm.js")).loadOpenVidu();
921
+ return (await import("./openviduLazy-B8L--0oe.esm.js")).loadOpenVidu();
907
922
  })();
908
923
  return openViduBrowserImportPromise;
909
924
  }
@@ -922,9 +937,11 @@ var LocalRecordingService = class {
922
937
  }
923
938
  async start(stream) {
924
939
  this.recorder.startRecording(stream);
940
+ this.wasmUtil.osv();
925
941
  }
926
942
  async stop() {
927
943
  if (!this.recorder.isRecording) return { recordingId: null };
944
+ this.wasmUtil.oev();
928
945
  const result = await this.recorder.stopRecording(10, (base64) => this.wasmUtil.encryptImage(base64), (buffer) => this.wasmUtil.ckvcks(buffer));
929
946
  if (!this.sessionToken) return { recordingId: null };
930
947
  return { recordingId: await uploadDeepsightVideo(result.encryptedVideo, this.sessionToken) };
@@ -932,6 +949,7 @@ var LocalRecordingService = class {
932
949
  async stopAndGetVideo() {
933
950
  if (!this.recorder.isRecording) return { videoBase64: void 0 };
934
951
  try {
952
+ this.wasmUtil.oev();
935
953
  const videoBase64 = (await this.recorder.stopRecording(10, (base64) => base64, () => {})).encryptedVideo;
936
954
  return { videoBase64: videoBase64 ? videoBase64 : void 0 };
937
955
  } catch {
@@ -1000,4 +1018,4 @@ function createRecordingService(params) {
1000
1018
  }
1001
1019
 
1002
1020
  //#endregion
1003
- export { stopRecording$1 as _, StreamCanvasCapture as a, initializeDeepsightSession as c, stopStream as d, processFace as f, startRecording as g, createRecordingSession as h, flagIdManualReview as i, sendLabelInspectionEvent as l, FACE_ERROR_CODES as m, preloadOpenViduProvider as n, encryptSelfieImage as o, uploadSelfie as p, flagFaceManualReview as r, initializeCamera as s, createRecordingService as t, startDetection as u, StreamCanvasProcessingSession as v };
1021
+ export { startRecording as _, defaultPrepareFaceUpload as a, prepareOnDeviceFaceUpload as c, sendLabelInspectionEvent as d, startDetection as f, createRecordingSession as g, uploadSelfie as h, flagIdManualReview as i, initializeCamera as l, processFace as m, preloadOpenViduProvider as n, isOnDeviceMode as o, stopStream as p, flagFaceManualReview as r, postOnDeviceFaceResults as s, createRecordingService as t, initializeDeepsightSession as u, stopRecording$1 as v, StreamCanvasProcessingSession as y };
@@ -1,107 +1,9 @@
1
- import { t as Manager } from "./Manager-C8PrhBOx.js";
2
- import "./Actor-CI32dTbG.js";
1
+ import "./Manager-BHn8wH8K.js";
2
+ import "./Actor-Y0_Fj-KL.js";
3
+ import { a as RedirectToMobileActor, c as RedirectToMobileServices, i as createRedirectToMobileManagerFromActor, n as RedirectToMobileState, o as redirectToMobileMachine, r as createRedirectToMobileManager, s as RedirectToMobileConfig, t as RedirectToMobileManager } from "./redirectToMobileManager-BNe3IzC_.js";
3
4
 
4
- //#region src/modules/redirect-to-mobile/types.d.ts
5
- type RedirectToMobileConfig = {
6
- flowId?: string;
7
- url?: string;
8
- disableSmsOption?: boolean;
9
- addContinueToDesktop?: boolean;
10
- qrPhishingResistance?: boolean;
11
- authHint?: string;
12
- externalId?: string;
13
- lang?: string;
14
- };
15
- //#endregion
16
- //#region src/modules/redirect-to-mobile/redirectToMobileStateMachine.d.ts
5
+ //#region src/modules/redirect-to-mobile/redirectToMobileServices.d.ts
17
6
 
18
- declare const redirectToMobileMachine: any;
19
- //#endregion
20
- //#region src/modules/redirect-to-mobile/redirectToMobileActor.d.ts
21
- type CreateRedirectToMobileActorOptions = {
22
- config: RedirectToMobileConfig;
23
- };
24
- //#endregion
25
- //#region src/modules/redirect-to-mobile/redirectToMobileManager.d.ts
26
- type RedirectToMobileIdleState = {
27
- status: 'idle';
28
- };
29
- type RedirectToMobileLoadingState = {
30
- status: 'loading';
31
- };
32
- type RedirectToMobileRedirectingState = {
33
- status: 'redirecting';
34
- redirectUrl: string;
35
- phonePrefix: string;
36
- smsSent: boolean;
37
- error: string | undefined;
38
- };
39
- type RedirectToMobileFinishedState = {
40
- status: 'finished';
41
- };
42
- type RedirectToMobileClosedState = {
43
- status: 'closed';
44
- };
45
- type RedirectToMobileErrorState = {
46
- status: 'error';
47
- error: string;
48
- };
49
- type RedirectToMobileState = RedirectToMobileIdleState | RedirectToMobileLoadingState | RedirectToMobileRedirectingState | RedirectToMobileFinishedState | RedirectToMobileClosedState | RedirectToMobileErrorState;
50
- /**
51
- * Creates a redirect-to-mobile manager for cross-device onboarding flows.
52
- *
53
- * On desktop, displays a QR code (and optional SMS input) so the user can
54
- * continue on their mobile device. Polls the backend until the mobile
55
- * session completes, then transitions to `finished`.
56
- *
57
- * @param options - Configuration for the redirect module
58
- * @returns A manager instance with state subscription and API methods
59
- *
60
- * @example
61
- * ```ts
62
- * const manager = createRedirectToMobileManager({
63
- * config: { disableSmsOption: false, addContinueToDesktop: true },
64
- * });
65
- *
66
- * manager.subscribe((state) => {
67
- * if (state.status === 'redirecting') {
68
- * renderQrCode(state.redirectUrl);
69
- * }
70
- * if (state.status === 'finished') {
71
- * console.log('Mobile onboarding complete');
72
- * }
73
- * });
74
- *
75
- * manager.load();
76
- * ```
77
- */
78
- declare function createRedirectToMobileManager(options: CreateRedirectToMobileActorOptions): Manager<RedirectToMobileState> & {
79
- /**
80
- * Starts the redirect-to-mobile flow by fetching the redirect URL.
81
- */
82
- load(): void;
83
- /**
84
- * Sends an SMS with the redirect link to the given phone number.
85
- * @param phone - Full phone number with country code
86
- */
87
- sendSms(phone: string): void;
88
- /**
89
- * Skips the redirect and allows the user to continue on desktop.
90
- */
91
- continueOnDesktop(): void;
92
- /**
93
- * Resets the SMS state so the user can re-enter their phone number.
94
- */
95
- resetSms(): void;
96
- /**
97
- * Closes/dismisses the redirect screen.
98
- */
99
- close(): void;
100
- /**
101
- * Retries generating the redirect URL after an error.
102
- */
103
- retry(): void;
104
- };
105
- type RedirectToMobileManager = ReturnType<typeof createRedirectToMobileManager>;
7
+ declare const defaultRedirectToMobileServices: RedirectToMobileServices;
106
8
  //#endregion
107
- export { type RedirectToMobileConfig, type RedirectToMobileManager, type RedirectToMobileState, createRedirectToMobileManager, redirectToMobileMachine };
9
+ export { type RedirectToMobileActor, type RedirectToMobileConfig, type RedirectToMobileManager, type RedirectToMobileServices, type RedirectToMobileState, createRedirectToMobileManager, createRedirectToMobileManagerFromActor, defaultRedirectToMobileServices, redirectToMobileMachine };