@incodetech/core 2.0.1 → 2.1.0-rc.1

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-BKWm8rSA.esm.js} +202 -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-5M-fKzXx.esm.js → authenticationManager-BlR6mSaG.esm.js} +6 -6
  22. package/dist/{authenticationManager-C83GNIhl.d.ts → authenticationManager-CaiQbp-q.d.ts} +4 -4
  23. package/dist/{authenticationStateMachine-BMZqatiF.esm.js → authenticationStateMachine-DkcGUMw5.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-BYo9Nu1r.esm.js +90 -0
  32. package/dist/consentManager-Cg5Sk2tv.d.ts +419 -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-Dg1s_TY5.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-8tnddNx-.esm.js} +19 -10
  51. package/dist/deepsightService-CrHmvx8X.esm.js +276 -0
  52. package/dist/{deepsightService-CEVxzehb.d.ts → deepsightService-Dh5P-hLf.d.ts} +13 -160
  53. package/dist/device.esm.js +4 -3
  54. package/dist/document-capture.d.ts +989 -80
  55. package/dist/document-capture.esm.js +34 -8
  56. package/dist/document-upload.d.ts +44 -44
  57. package/dist/document-upload.esm.js +7 -7
  58. package/dist/{documentCaptureStateMachine-BqzTDy9k.esm.js → documentCaptureStateMachine-CUTUzUw_.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-klc-AImJ.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 +41 -16
  80. package/dist/extensibility.esm.js +55 -33
  81. package/dist/face-match.d.ts +21 -2
  82. package/dist/face-match.esm.js +5 -5
  83. package/dist/{faceCaptureManagerFactory-yqtpxjnN.d.ts → faceCaptureManagerFactory-CjdBUS6s.d.ts} +48 -17
  84. package/dist/{faceCaptureManagerFactory-Dh2PdGlF.esm.js → faceCaptureManagerFactory-ej2j1LMr.esm.js} +21 -5
  85. package/dist/{faceCaptureSetup-B3faSpYA.esm.js → faceCaptureSetup-B9t6bYze.esm.js} +68 -183
  86. package/dist/{faceMatchStateMachine-DNFrxTFS.esm.js → faceMatchStateMachine-DeXXzSuz.esm.js} +62 -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 +56 -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-ChgTNggJ.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 +70 -27
  118. package/dist/{idCaptureManager-Fyd0eam-.d.ts → idCaptureManager-ChCNmgBj.d.ts} +40 -20
  119. package/dist/{idCaptureManager-D0ktk7Hh.esm.js → idCaptureManager-D3pwWutw.esm.js} +22 -7
  120. package/dist/{idCaptureStateMachine-dwlBUjbC.esm.js → idCaptureStateMachine-B3AiDIsT.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-Cww-NDtd.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-Dq6WiOZh.d.ts +429 -0
  137. package/dist/mandatoryConsentManager-H6D18cZB.esm.js +89 -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-D0wGddy7.esm.js +23 -0
  144. package/dist/permissionServices-Doec4X5L.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-yRw7hfzU.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 +53 -24
  162. package/dist/{selfieManager-Duisl7qN.esm.js → selfieManager-BNuTIGAz.esm.js} +6 -6
  163. package/dist/{selfieManager-D0lSgd-J.d.ts → selfieManager-C2y_t6DG.d.ts} +4 -4
  164. package/dist/{selfieStateMachine-D76whWEf.esm.js → selfieStateMachine-Bv99bZJE.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-DRB-hgbV.esm.js +366 -0
  169. package/dist/{setup-C5AITV8m.d.ts → setup-BwCluiw3.d.ts} +86 -6
  170. package/dist/{setup-DPPAxmXf.esm.js → setup-CUO4mErT.esm.js} +175 -25
  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 +146 -100
  195. package/dist/workflow.esm.js +116 -66
  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,18 +1,20 @@
1
- import { l as WasmPipelineType, r as mlWasmJSApi_default, t as BaseWasmProvider, u as IdCaptureModelType } from "./BaseWasmProvider-C_DLEI40.esm.js";
1
+ import { d as IdCaptureModelType, i as mlWasmJSApi_default, n as BaseWasmProvider, u as WasmPipelineType } from "./WasmUtilProvider-BKWm8rSA.esm.js";
2
2
  import { t as BrowserTimerProvider } from "./BrowserTimerProvider-DhNc_x02.esm.js";
3
3
  import { r as getToken, t as api } from "./api-CESGtpbH.esm.js";
4
- import { S as revokeObjectURL } from "./events-D6-e4vok.esm.js";
5
- import { t as endpoints } from "./endpoints-CnN3SyDa.esm.js";
6
- import { t as getDisableIpify } from "./session-CrkWAs-q.esm.js";
7
- import { a as fromPromise, i as fromCallback, n as sendTo, o as and, r as assign, t as setup } from "./xstate.esm-B70JrNqo.esm.js";
8
- import { n as IncodeCanvas } from "./deepsightService-O74l4Y__.esm.js";
9
- import { _ as stopRecording$1, a as StreamCanvasCapture, g as startRecording, h as createRecordingSession, i as flagIdManualReview, n as preloadOpenViduProvider, v as StreamCanvasProcessingSession } from "./recordingService-Ig2UgbLv.esm.js";
10
- import { n as isDesktop } from "./platform-CfrjKhmi.esm.js";
11
- import { t as getBackCameraStream } from "./backCameraStream-DMdMeGk2.esm.js";
12
- import { r as getWindowDimensions } from "./getBrowser-BSXUTWXw.esm.js";
13
- import { t as addDeviceStats } from "./stats-CIfiPzb1.esm.js";
14
- import { t as getDeviceClass } from "./getDeviceClass-BSntT9_j.esm.js";
15
- import { n as requestPermission, t as checkPermission } from "./permissionServices-D_i6nzEw.esm.js";
4
+ import { S as revokeObjectURL } from "./events-Dvvriq9l.esm.js";
5
+ import { t as endpoints } from "./endpoints-BeTK0Mlt.esm.js";
6
+ import { t as addDeviceStats } from "./stats-BMNUG1AU.esm.js";
7
+ import { t as getDisableIpify } from "./sessionInitializer-DRB-hgbV.esm.js";
8
+ import { n as isDesktop } from "./platform-SKvEfCBh.esm.js";
9
+ import { a as fromPromise, i as fromCallback, n as sendTo, o as and, r as assign, t as setup } from "./xstate.esm-C9wncMQa.esm.js";
10
+ import { n as invokeRequestPermissionActor, t as checkPermission } from "./permissionServices-Doec4X5L.esm.js";
11
+ import { _ as startRecording, g as createRecordingSession, i as flagIdManualReview, n as preloadOpenViduProvider, v as stopRecording$1, y as StreamCanvasProcessingSession } from "./recordingService-yRw7hfzU.esm.js";
12
+ import { t as IncodeCanvas } from "./canvas-SKcRBxsk.esm.js";
13
+ import { n as getBackCameraStream } from "./backCameraStream-D7Wo4Nbx.esm.js";
14
+ import { n as getWindowDimensions } from "./getDeviceClass-C0olyNFS.esm.js";
15
+ import { t as getDeviceClass } from "./getDeviceClass-C8Do2qYu.esm.js";
16
+ import { t as StreamCanvasCapture } from "./StreamCanvasCapture-ImiDQdVA.esm.js";
17
+ import { n as needsMotionPrimeOnlyFromPermission, r as resolveStoredPermissionResult, t as isReadyForCaptureFromPermission } from "./permissionGuards-D0wGddy7.esm.js";
16
18
 
17
19
  //#region src/modules/id/digitalUpload/digitalUploadErrors.ts
18
20
  const TERMINAL_FAIL_REASONS = new Set(["DIGITAL_ID_REQUESTED_BUT_OTHER_PROVIDED", "ID_TYPE_UNACCEPTABLE"]);
@@ -50,9 +52,11 @@ function classifyNetworkError(err) {
50
52
  //#region src/modules/id/digitalUpload/digitalUploadServices.ts
51
53
  const DIGITAL_ID_UPLOAD_PATH = "/omni/add/front-id";
52
54
  async function uploadDigitalIdFile(params) {
53
- const { file, signal, onProgress } = params;
55
+ const { file, signal, onProgress, extractIdFace } = params;
56
+ const query = { idType: "DigitalId" };
57
+ if (extractIdFace === false) query.extractIdFace = false;
54
58
  const response = await api.post(DIGITAL_ID_UPLOAD_PATH, file, {
55
- query: { idType: "DigitalId" },
59
+ query,
56
60
  headers: { "Content-Type": file.type || "application/pdf" },
57
61
  onUploadProgress: onProgress,
58
62
  signal
@@ -76,7 +80,8 @@ const uploadDigitalIdActor = fromPromise(async ({ input, signal }) => {
76
80
  return uploadDigitalIdFile({
77
81
  file: input.file,
78
82
  signal: input.signal ?? signal,
79
- onProgress: input.onProgress
83
+ onProgress: input.onProgress,
84
+ extractIdFace: input.extractIdFace
80
85
  });
81
86
  });
82
87
  const getUploadResponseFromEvent$1 = (event) => {
@@ -160,15 +165,19 @@ const _digitalUploadMachine = setup({
160
165
  showTutorial: input.showTutorial,
161
166
  file: null,
162
167
  uploadProgress: 0,
163
- attemptsRemaining: input.captureAttempts,
168
+ attemptsRemaining: input.attemptsRemaining,
164
169
  failReason: null,
165
170
  response: void 0,
166
171
  uploadDurationMs: void 0,
167
172
  pickerRequestId: 0,
168
173
  pendingPickerAutoOpen: !input.showTutorial,
169
- resultType: null
174
+ resultType: null,
175
+ extractIdFace: input.extractIdFace
176
+ }),
177
+ output: ({ context }) => ({
178
+ result: context.resultType ?? "exhausted",
179
+ attemptsRemaining: context.attemptsRemaining
170
180
  }),
171
- output: ({ context }) => ({ result: context.resultType ?? "exhausted" }),
172
181
  states: {
173
182
  decideStart: { always: [{
174
183
  guard: ({ context }) => context.showTutorial,
@@ -222,13 +231,18 @@ const _digitalUploadMachine = setup({
222
231
  type: "UPLOAD_PROGRESS",
223
232
  progress
224
233
  });
225
- }
234
+ },
235
+ extractIdFace: context.extractIdFace
226
236
  }),
227
237
  onDone: [
228
238
  {
229
239
  guard: "isTerminalFailReason",
230
- target: "retriesExhausted",
231
- actions: ["storeUploadResponse", "setFailReasonFromResponse"]
240
+ target: "terminalError",
241
+ actions: [
242
+ "storeUploadResponse",
243
+ "setFailReasonFromResponse",
244
+ "decrementAttemptOnFailure"
245
+ ]
232
246
  },
233
247
  {
234
248
  guard: "responseHasFailReason",
@@ -259,28 +273,32 @@ const _digitalUploadMachine = setup({
259
273
  checkRetries: { always: [
260
274
  {
261
275
  guard: "isCurrentFailReasonTerminal",
262
- target: "retriesExhausted"
276
+ target: "terminalError"
263
277
  },
264
278
  {
265
279
  guard: "hasAttemptsRemaining",
266
280
  target: "error"
267
281
  },
268
- { target: "retriesExhausted" }
282
+ { target: "terminalError" }
269
283
  ] },
270
284
  error: { on: {
271
285
  RETRY: {
272
286
  target: "selecting",
273
287
  actions: ["setPendingPickerAutoOpen", "clearSelectedFile"]
274
288
  },
275
- SCAN_INSTEAD: { target: "closed" }
289
+ SCAN_INSTEAD: {
290
+ target: "tutorial",
291
+ actions: ["clearSelectedFile"]
292
+ }
276
293
  } },
277
- retriesExhausted: {
278
- entry: assign({ resultType: "exhausted" }),
279
- on: { SCAN_INSTEAD: { target: "closed" } }
280
- },
281
- closed: {
294
+ terminalError: { on: { SCAN_INSTEAD: [{
295
+ guard: "hasAttemptsRemaining",
296
+ target: "tutorial",
297
+ actions: ["clearSelectedFile"]
298
+ }, { target: "exhausted" }] } },
299
+ exhausted: {
282
300
  type: "final",
283
- entry: assign({ resultType: "closed" })
301
+ entry: assign({ resultType: "exhausted" })
284
302
  },
285
303
  success: { on: { NEXT_STEP: { target: "completed" } } },
286
304
  completed: {
@@ -485,14 +503,6 @@ var IdCaptureProvider = class extends BaseWasmProvider {
485
503
  }
486
504
  };
487
505
 
488
- //#endregion
489
- //#region src/internal/analytics/deviceStats.ts
490
- async function postDeviceStats(stats) {
491
- try {
492
- await api.post(endpoints.deviceStats, stats);
493
- } catch {}
494
- }
495
-
496
506
  //#endregion
497
507
  //#region src/modules/id/idCameraStream.ts
498
508
  async function getIdCameraStream(deviceId) {
@@ -655,18 +665,11 @@ async function getExtraImages(params) {
655
665
  }
656
666
  const getRealQualityValue = (value) => (1 - value) * 100;
657
667
  async function uploadIdImage(params) {
658
- const { type, image, onProgress, signal, metadata, ageAssurance, glare, sharpness, shouldSkipGlareBack, analyticsProvider, imageData, isSecondId, onlyFront } = params;
668
+ const { type, image, onProgress, signal, metadata, ageAssurance, glare, sharpness, shouldSkipGlareBack, analyticsProvider, imageData, isSecondId, onlyFront, extractIdFace } = params;
659
669
  let finalMetadata = metadata;
660
670
  if (analyticsProvider && imageData) try {
661
671
  await analyticsProvider.analyzeFrame(imageData);
662
672
  analyticsProvider.update();
663
- const analysisStatus = analyticsProvider.getAnalysisStatus();
664
- const motionStatus = analyticsProvider.getMotionStatus();
665
- await postDeviceStats({
666
- frontIdStatsAnalysisStatus: type === "front" ? analysisStatus : void 0,
667
- backIdStatsAnalysisStatus: type === "back" ? analysisStatus : void 0,
668
- motionStatus
669
- });
670
673
  finalMetadata = analyticsProvider.getMetadata();
671
674
  } catch (error) {
672
675
  console.warn("[IdCapture] Analytics failed:", error);
@@ -681,6 +684,7 @@ async function uploadIdImage(params) {
681
684
  if (shouldSkipGlareBack && type === "back") queryParams.glare = 0;
682
685
  else if (glare !== void 0) queryParams.glare = getRealQualityValue(glare);
683
686
  if (sharpness !== void 0) queryParams.sharpness = getRealQualityValue(sharpness);
687
+ if (extractIdFace === false && type === "front") queryParams.extractIdFace = false;
684
688
  try {
685
689
  const res = await api.post(endpoint, body, {
686
690
  signal,
@@ -734,7 +738,7 @@ function preloadIdRecordingProvider(config) {
734
738
  preloadOpenViduProvider();
735
739
  }
736
740
  async function createOpenViduRecordingProvider() {
737
- const { OpenViduRecordingProvider } = await import("./OpenViduRecordingProvider-CMu6XVdc.esm.js");
741
+ const { OpenViduRecordingProvider } = await import("./OpenViduRecordingProvider-O4GjBseO.esm.js");
738
742
  return new OpenViduRecordingProvider();
739
743
  }
740
744
  async function startRecordingSession(params) {
@@ -793,11 +797,12 @@ async function processId(isSecondId = false, queueName = "", signal) {
793
797
  * must convert the File to base64 before calling this service.
794
798
  */
795
799
  async function uploadManualIdFile(params) {
796
- const { side, base64Image, retry, onlyFront, signal, isSecondId } = params;
800
+ const { side, base64Image, retry, onlyFront, signal, isSecondId, extractIdFace } = params;
797
801
  const endpoint = getUploadEndpoint(side === "back" ? "back" : "front", isSecondId);
798
802
  const queryParams = { captureType: "UPLOAD" };
799
803
  if (retry) queryParams.retry = true;
800
804
  if (onlyFront && side === "front") queryParams.onlyFront = true;
805
+ if (extractIdFace === false && side !== "back") queryParams.extractIdFace = false;
801
806
  const res = await api.post(endpoint, { base64Image }, {
802
807
  signal,
803
808
  query: queryParams
@@ -819,8 +824,7 @@ const MANUAL_UPLOAD_ERROR_KEYS = {
819
824
  generic: "manualIdUpload.generic",
820
825
  lowSharpness: "manualIdUpload.lowSharpness",
821
826
  glareDetected: "manualIdUpload.glareDetected",
822
- readabilityIssue: "manualIdUpload.readabilityIssue",
823
- qualityRejected: "manualIdUpload.qualityRejected"
827
+ readabilityIssue: "manualIdUpload.readabilityIssue"
824
828
  };
825
829
  /**
826
830
  * Map the server's `failReason` (plus client-side passport/ID tab mismatch and
@@ -828,8 +832,9 @@ const MANUAL_UPLOAD_ERROR_KEYS = {
828
832
  * branch logic in
829
833
  * `ms-incodesmile-web/packages/incode-welcome/src/manualIdUpload/manuaIdUpload.tsx`,
830
834
  * extended to also reject responses where the backend flagged a per-image
831
- * quality issue (`correctSharpness`, `correctGlare`, `readability`, or
832
- * `idQualityAttemptApproved` set to `false`).
835
+ * quality issue (`correctSharpness`, `correctGlare`, or `readability`).
836
+ * `idQualityAttemptApproved` is intentionally ignored — v1 did not treat it
837
+ * as a manual-upload rejection signal.
833
838
  *
834
839
  * Quality flags are checked with `=== false` so missing/undefined values
835
840
  * (older backends, partial payloads) keep the legacy "trust the server"
@@ -848,7 +853,6 @@ function mapFailReasonToErrorKey(response, expectedTab) {
848
853
  if (response.correctSharpness === false) return MANUAL_UPLOAD_ERROR_KEYS.lowSharpness;
849
854
  if (response.correctGlare === false) return MANUAL_UPLOAD_ERROR_KEYS.glareDetected;
850
855
  if (response.readability === false) return MANUAL_UPLOAD_ERROR_KEYS.readabilityIssue;
851
- if (response.idQualityAttemptApproved === false) return MANUAL_UPLOAD_ERROR_KEYS.qualityRejected;
852
856
  return null;
853
857
  }
854
858
 
@@ -890,6 +894,7 @@ const uploadManualFileActor = fromPromise(async ({ input, signal }) => {
890
894
  retry: input.retry,
891
895
  onlyFront: input.onlyFront,
892
896
  isSecondId: input.isSecondId,
897
+ extractIdFace: input.extractIdFace,
893
898
  signal
894
899
  });
895
900
  });
@@ -909,14 +914,8 @@ const _manualUploadMachine = setup({
909
914
  if (event.type !== "MANUAL_UPLOAD_TAB_CHANGED") return {};
910
915
  return {
911
916
  activeTab: event.tab,
912
- frontFile: null,
913
- backFile: null,
914
- passportFile: null,
915
- frontUploaded: false,
916
- backUploaded: false,
917
- passportUploaded: false,
918
- skipBackFromServer: false,
919
917
  errorMessage: null,
918
+ errorSide: null,
920
919
  retriesLeft: context.captureAttempts
921
920
  };
922
921
  }),
@@ -929,11 +928,15 @@ const _manualUploadMachine = setup({
929
928
  passportUploaded: false,
930
929
  skipBackFromServer: false,
931
930
  errorMessage: null,
931
+ errorSide: null,
932
932
  retriesLeft: context.captureAttempts
933
933
  })),
934
934
  storeSelectedFile: assign(({ event }) => {
935
935
  if (event.type !== "MANUAL_UPLOAD_FILE_SELECTED") return {};
936
- const updated = { errorMessage: null };
936
+ const updated = {
937
+ errorMessage: null,
938
+ errorSide: null
939
+ };
937
940
  if (event.side === "front") updated.frontFile = event.file;
938
941
  else if (event.side === "back") updated.backFile = event.file;
939
942
  else updated.passportFile = event.file;
@@ -941,15 +944,18 @@ const _manualUploadMachine = setup({
941
944
  }),
942
945
  markFrontUploaded: assign(() => ({
943
946
  frontUploaded: true,
944
- errorMessage: null
947
+ errorMessage: null,
948
+ errorSide: null
945
949
  })),
946
950
  markBackUploaded: assign(() => ({
947
951
  backUploaded: true,
948
- errorMessage: null
952
+ errorMessage: null,
953
+ errorSide: null
949
954
  })),
950
955
  markPassportUploaded: assign(() => ({
951
956
  passportUploaded: true,
952
- errorMessage: null
957
+ errorMessage: null,
958
+ errorSide: null
953
959
  })),
954
960
  recordSkipBackFromResponse: assign(({ event }) => {
955
961
  if (!("output" in event)) return {};
@@ -963,8 +969,19 @@ const _manualUploadMachine = setup({
963
969
  return { errorMessage: mapFailReasonToErrorKey(response, context.activeTab) ?? "manualIdUpload.generic" };
964
970
  }),
965
971
  setManualUploadGenericError: assign(() => ({ errorMessage: "manualIdUpload.generic" })),
966
- setManualUploadFileTooLargeError: assign(() => ({ errorMessage: "manualIdUpload.fileTooBig" })),
967
- clearManualUploadError: assign(() => ({ errorMessage: null }))
972
+ setManualUploadFileTooLargeError: assign(({ event }) => {
973
+ return {
974
+ errorMessage: "manualIdUpload.fileTooBig",
975
+ errorSide: event.type === "MANUAL_UPLOAD_FILE_SELECTED" ? event.side : null
976
+ };
977
+ }),
978
+ markErrorSideFront: assign(() => ({ errorSide: "front" })),
979
+ markErrorSideBack: assign(() => ({ errorSide: "back" })),
980
+ markErrorSidePassport: assign(() => ({ errorSide: "passport" })),
981
+ clearManualUploadError: assign(() => ({
982
+ errorMessage: null,
983
+ errorSide: null
984
+ }))
968
985
  },
969
986
  guards: {
970
987
  isSelectedFileTooLarge: ({ event }) => {
@@ -996,12 +1013,14 @@ const _manualUploadMachine = setup({
996
1013
  onlyFront: input.onlyFront,
997
1014
  isSecondId: input.isSecondId,
998
1015
  captureAttempts: input.captureAttempts,
1016
+ extractIdFace: input.extractIdFace,
999
1017
  frontFile: null,
1000
1018
  backFile: null,
1001
1019
  passportFile: null,
1002
1020
  activeTab: "id",
1003
1021
  retriesLeft: input.captureAttempts,
1004
1022
  errorMessage: null,
1023
+ errorSide: null,
1005
1024
  skipBackFromServer: false,
1006
1025
  frontUploaded: false,
1007
1026
  backUploaded: false,
@@ -1056,12 +1075,17 @@ const _manualUploadMachine = setup({
1056
1075
  file: context.frontFile,
1057
1076
  retry: context.retriesLeft < context.captureAttempts,
1058
1077
  onlyFront: context.onlyFront,
1059
- isSecondId: context.isSecondId
1078
+ isSecondId: context.isSecondId,
1079
+ extractIdFace: context.extractIdFace
1060
1080
  }),
1061
1081
  onDone: [{
1062
1082
  guard: "manualUploadResponseHasError",
1063
1083
  target: "checkRetries",
1064
- actions: ["decrementManualUploadRetries", "setManualUploadErrorFromResponse"]
1084
+ actions: [
1085
+ "decrementManualUploadRetries",
1086
+ "setManualUploadErrorFromResponse",
1087
+ "markErrorSideFront"
1088
+ ]
1065
1089
  }, {
1066
1090
  target: "selecting",
1067
1091
  actions: [
@@ -1072,7 +1096,11 @@ const _manualUploadMachine = setup({
1072
1096
  }],
1073
1097
  onError: {
1074
1098
  target: "checkRetries",
1075
- actions: ["decrementManualUploadRetries", "setManualUploadGenericError"]
1099
+ actions: [
1100
+ "decrementManualUploadRetries",
1101
+ "setManualUploadGenericError",
1102
+ "markErrorSideFront"
1103
+ ]
1076
1104
  }
1077
1105
  } },
1078
1106
  uploadingBack: { invoke: {
@@ -1088,14 +1116,22 @@ const _manualUploadMachine = setup({
1088
1116
  onDone: [{
1089
1117
  guard: "manualUploadResponseHasError",
1090
1118
  target: "checkRetries",
1091
- actions: ["decrementManualUploadRetries", "setManualUploadErrorFromResponse"]
1119
+ actions: [
1120
+ "decrementManualUploadRetries",
1121
+ "setManualUploadErrorFromResponse",
1122
+ "markErrorSideBack"
1123
+ ]
1092
1124
  }, {
1093
1125
  target: "selecting",
1094
1126
  actions: ["markBackUploaded", "clearManualUploadError"]
1095
1127
  }],
1096
1128
  onError: {
1097
1129
  target: "checkRetries",
1098
- actions: ["decrementManualUploadRetries", "setManualUploadGenericError"]
1130
+ actions: [
1131
+ "decrementManualUploadRetries",
1132
+ "setManualUploadGenericError",
1133
+ "markErrorSideBack"
1134
+ ]
1099
1135
  }
1100
1136
  } },
1101
1137
  uploadingPassport: { invoke: {
@@ -1106,19 +1142,28 @@ const _manualUploadMachine = setup({
1106
1142
  file: context.passportFile,
1107
1143
  retry: context.retriesLeft < context.captureAttempts,
1108
1144
  onlyFront: false,
1109
- isSecondId: context.isSecondId
1145
+ isSecondId: context.isSecondId,
1146
+ extractIdFace: context.extractIdFace
1110
1147
  }),
1111
1148
  onDone: [{
1112
1149
  guard: "manualUploadResponseHasError",
1113
1150
  target: "checkRetries",
1114
- actions: ["decrementManualUploadRetries", "setManualUploadErrorFromResponse"]
1151
+ actions: [
1152
+ "decrementManualUploadRetries",
1153
+ "setManualUploadErrorFromResponse",
1154
+ "markErrorSidePassport"
1155
+ ]
1115
1156
  }, {
1116
1157
  target: "selecting",
1117
1158
  actions: ["markPassportUploaded", "clearManualUploadError"]
1118
1159
  }],
1119
1160
  onError: {
1120
1161
  target: "checkRetries",
1121
- actions: ["decrementManualUploadRetries", "setManualUploadGenericError"]
1162
+ actions: [
1163
+ "decrementManualUploadRetries",
1164
+ "setManualUploadGenericError",
1165
+ "markErrorSidePassport"
1166
+ ]
1122
1167
  }
1123
1168
  } },
1124
1169
  checkRetries: { always: [{
@@ -1166,7 +1211,7 @@ const checkPermissionActor = fromPromise(async () => {
1166
1211
  return checkPermission();
1167
1212
  });
1168
1213
  const requestPermissionActor = fromPromise(async ({ input }) => {
1169
- return requestPermission({ requestMotion: input.requestMotionPermission });
1214
+ return invokeRequestPermissionActor(input);
1170
1215
  });
1171
1216
  const initializeCameraActor = fromPromise(async ({ input }) => {
1172
1217
  return initializeIdCapture(input);
@@ -1443,7 +1488,8 @@ const uploadIdImageActor = fromPromise(async ({ input, signal }) => {
1443
1488
  analyticsProvider: input.analyticsProvider,
1444
1489
  imageData,
1445
1490
  isSecondId: input.isSecondId,
1446
- onlyFront: input.onlyFront
1491
+ onlyFront: input.onlyFront,
1492
+ extractIdFace: input.extractIdFace
1447
1493
  });
1448
1494
  });
1449
1495
  const processIdActor = fromPromise(async ({ input, signal }) => {
@@ -1459,26 +1505,9 @@ const startRecordingActor = fromPromise(async ({ input }) => {
1459
1505
  type
1460
1506
  });
1461
1507
  });
1462
- const checkMotionSensorActor = fromCallback(({ input, sendBack }) => {
1463
- if (!input.motionProvider) {
1464
- sendBack({
1465
- type: "MOTION_STATUS",
1466
- status: "UNCLEAR"
1467
- });
1468
- return () => {};
1469
- }
1470
- const timer = BrowserTimerProvider.getInstance();
1471
- const interval = timer.setInterval(() => {
1472
- sendBack({
1473
- type: "MOTION_STATUS",
1474
- status: input.motionProvider.check()
1475
- });
1476
- }, 500);
1477
- return () => timer.clearInterval(interval);
1478
- });
1479
1508
  const initializeDeepsightSessionActor = fromPromise(async ({ input }) => {
1480
1509
  if (!input.dependencies) return;
1481
- const { loadDeepsightSession } = await import("./deepsightLoader-Cm4JIT_z.esm.js");
1510
+ const { loadDeepsightSession } = await import("./deepsightLoader-8tnddNx-.esm.js");
1482
1511
  return loadDeepsightSession({
1483
1512
  ds: input.ds,
1484
1513
  storage: input.dependencies.storage,
@@ -1744,6 +1773,12 @@ const isPermissionGrantedGuard = ({ event }) => {
1744
1773
  if ("output" in event) return event.output === "granted";
1745
1774
  return false;
1746
1775
  };
1776
+ const isReadyForCaptureGuard = ({ context, event }) => {
1777
+ return isReadyForCaptureFromPermission(resolveStoredPermissionResult("output" in event ? event.output : void 0, context.permissionResult), context.config.ds);
1778
+ };
1779
+ const needsMotionPrimeOnlyGuard = ({ context, event }) => {
1780
+ return needsMotionPrimeOnlyFromPermission(resolveStoredPermissionResult("output" in event ? event.output : void 0, context.permissionResult), context.config.ds);
1781
+ };
1747
1782
  const isPermissionDeniedErrorGuard = ({ event }) => {
1748
1783
  if ("error" in event) {
1749
1784
  const error = event.error;
@@ -1859,7 +1894,6 @@ const _idCaptureMachine = setup({
1859
1894
  uploadIdImage: uploadIdImageActor,
1860
1895
  processId: processIdActor,
1861
1896
  startRecording: startRecordingActor,
1862
- checkMotionSensor: checkMotionSensorActor,
1863
1897
  initializeDeepsightSession: initializeDeepsightSessionActor,
1864
1898
  checkVirtualCamera: checkVirtualCameraActor,
1865
1899
  manualUploadMachine,
@@ -2021,9 +2055,6 @@ const _idCaptureMachine = setup({
2021
2055
  setDetectionArea: assign({ detectionArea: ({ event }) => {
2022
2056
  if ("detectionArea" in event) return event.detectionArea;
2023
2057
  } }),
2024
- setMotionStatus: assign({ motionStatus: ({ event }) => {
2025
- if ("status" in event && event.type === "MOTION_STATUS") return event.status;
2026
- } }),
2027
2058
  incrementExpiredAttempts: assign(({ context }) => ({ expiredAttempts: context.expiredAttempts + 1 })),
2028
2059
  storeDigitalUploadResponse: assign(({ self }) => {
2029
2060
  const response = ((self.getSnapshot().children?.["digitalIdUpload"]?.getSnapshot())?.context)?.response;
@@ -2033,6 +2064,7 @@ const _idCaptureMachine = setup({
2033
2064
  isDigitalUpload: true
2034
2065
  };
2035
2066
  }),
2067
+ syncAttemptsFromDigitalUpload: assign({ attemptsRemaining: ({ event }) => event.output?.attemptsRemaining ?? 0 }),
2036
2068
  incrementProcessingExpiredAttempts: assign(({ context }) => ({ processingExpiredAttempts: context.processingExpiredAttempts + 1 })),
2037
2069
  setSkipProcessId: assign({ skipProcessId: () => true }),
2038
2070
  setExpiredFromUpload: assign({ expiredFromUpload: () => true }),
@@ -2045,6 +2077,8 @@ const _idCaptureMachine = setup({
2045
2077
  hasAgeAssurance: hasAgeAssuranceGuard,
2046
2078
  hasShowDocumentChooser: hasShowDocumentChooserGuard,
2047
2079
  isPermissionGranted: isPermissionGrantedGuard,
2080
+ isReadyForCapture: isReadyForCaptureGuard,
2081
+ needsMotionPrimeOnly: needsMotionPrimeOnlyGuard,
2048
2082
  isPermissionDeniedError: isPermissionDeniedErrorGuard,
2049
2083
  hasStream: hasStreamGuard,
2050
2084
  hasAttemptsRemaining: hasAttemptsRemainingGuard,
@@ -2072,7 +2106,6 @@ const _idCaptureMachine = setup({
2072
2106
  forceFinishAfterProcessing: forceFinishAfterProcessingGuard,
2073
2107
  isManualUploadExhausted: ({ event }) => event.output?.result === "exhausted",
2074
2108
  isDigitalUploadExhausted: ({ event }) => event.output?.result === "exhausted",
2075
- isDigitalUploadClosed: ({ event }) => event.output?.result === "closed",
2076
2109
  isDigitalUploadSuccessful: ({ event }) => event.output?.result === "success"
2077
2110
  }
2078
2111
  }).createMachine({
@@ -2113,7 +2146,6 @@ const _idCaptureMachine = setup({
2113
2146
  detectionArea: void 0,
2114
2147
  previewImageUrl: void 0,
2115
2148
  uploadProgress: void 0,
2116
- motionStatus: void 0,
2117
2149
  manualCaptureTriggered: false,
2118
2150
  deepsightService: void 0,
2119
2151
  analyticsProvider: input.analyticsProvider,
@@ -2234,7 +2266,7 @@ const _idCaptureMachine = setup({
2234
2266
  },
2235
2267
  onDone: [{
2236
2268
  target: "capture",
2237
- guard: "isPermissionGranted"
2269
+ guard: "isReadyForCapture"
2238
2270
  }, { target: "permissions" }]
2239
2271
  },
2240
2272
  tutorial: {
@@ -2247,7 +2279,7 @@ const _idCaptureMachine = setup({
2247
2279
  src: "checkPermission",
2248
2280
  onDone: [{
2249
2281
  target: "initializingCamera",
2250
- guard: "isPermissionGranted",
2282
+ guard: "isReadyForCapture",
2251
2283
  actions: assign({ permissionResult: ({ event }) => event.output })
2252
2284
  }, {
2253
2285
  target: "ready",
@@ -2330,14 +2362,22 @@ const _idCaptureMachine = setup({
2330
2362
  waitingForPermission: { invoke: {
2331
2363
  id: "checkPermissionWaiting",
2332
2364
  src: "checkPermission",
2333
- onDone: [{
2334
- target: "#idCapture.capture",
2335
- guard: "isPermissionGranted",
2336
- actions: assign({ permissionResult: ({ event }) => event.output })
2337
- }, {
2338
- target: "#idCapture.permissions",
2339
- actions: assign({ permissionResult: ({ event }) => event.output })
2340
- }]
2365
+ onDone: [
2366
+ {
2367
+ target: "#idCapture.capture",
2368
+ guard: "isReadyForCapture",
2369
+ actions: assign({ permissionResult: ({ event }) => event.output })
2370
+ },
2371
+ {
2372
+ target: "#idCapture.permissions.requesting",
2373
+ guard: "needsMotionPrimeOnly",
2374
+ actions: assign({ permissionResult: ({ event }) => event.output })
2375
+ },
2376
+ {
2377
+ target: "#idCapture.permissions",
2378
+ actions: assign({ permissionResult: ({ event }) => event.output })
2379
+ }
2380
+ ]
2341
2381
  } }
2342
2382
  }
2343
2383
  },
@@ -2352,7 +2392,7 @@ const _idCaptureMachine = setup({
2352
2392
  onDone: [
2353
2393
  {
2354
2394
  target: "#idCapture.capture",
2355
- guard: "isPermissionGranted",
2395
+ guard: "isReadyForCapture",
2356
2396
  actions: assign({ permissionResult: ({ event }) => event.output })
2357
2397
  },
2358
2398
  {
@@ -2360,6 +2400,11 @@ const _idCaptureMachine = setup({
2360
2400
  guard: ({ event }) => event.output === "denied",
2361
2401
  actions: assign({ permissionResult: ({ event }) => event.output })
2362
2402
  },
2403
+ {
2404
+ target: "motionOnly",
2405
+ guard: "needsMotionPrimeOnly",
2406
+ actions: assign({ permissionResult: ({ event }) => event.output })
2407
+ },
2363
2408
  {
2364
2409
  target: "waitingForUser",
2365
2410
  actions: assign({ permissionResult: ({ event }) => event.output })
@@ -2379,6 +2424,7 @@ const _idCaptureMachine = setup({
2379
2424
  REQUEST_PERMISSION: "requesting",
2380
2425
  GO_TO_LEARN_MORE: "learnMore"
2381
2426
  } },
2427
+ motionOnly: { on: { REQUEST_PERMISSION: "requesting" } },
2382
2428
  learnMore: { on: {
2383
2429
  BACK: "idle",
2384
2430
  REQUEST_PERMISSION: "requesting"
@@ -2386,11 +2432,14 @@ const _idCaptureMachine = setup({
2386
2432
  requesting: { invoke: {
2387
2433
  id: "requestPermission",
2388
2434
  src: "requestPermission",
2389
- input: ({ context }) => ({ requestMotionPermission: context.config.ds === true }),
2435
+ input: ({ context }) => ({
2436
+ permissionResult: context.permissionResult === "refresh" ? void 0 : context.permissionResult,
2437
+ requestMotionPermission: context.config.ds === true
2438
+ }),
2390
2439
  onDone: [
2391
2440
  {
2392
2441
  target: "#idCapture.capture",
2393
- guard: "isPermissionGranted",
2442
+ guard: "isReadyForCapture",
2394
2443
  actions: assign({ permissionResult: ({ event }) => event.output })
2395
2444
  },
2396
2445
  {
@@ -2399,7 +2448,7 @@ const _idCaptureMachine = setup({
2399
2448
  actions: assign({ permissionResult: ({ event }) => event.output })
2400
2449
  },
2401
2450
  {
2402
- target: "idle",
2451
+ target: "waitingForUser",
2403
2452
  actions: assign({ permissionResult: ({ event }) => event.output })
2404
2453
  }
2405
2454
  ],
@@ -2579,6 +2628,7 @@ const _idCaptureMachine = setup({
2579
2628
  dependencies: context.dependencies,
2580
2629
  captureResolution: context.captureResolution,
2581
2630
  cameraFallbackLevel: context.cameraFallbackLevel,
2631
+ extractIdFace: context.config.extractIdFace,
2582
2632
  croppedCanvas: context.provider?.getCapturedCanvas() ?? null
2583
2633
  };
2584
2634
  },
@@ -2888,7 +2938,8 @@ const _idCaptureMachine = setup({
2888
2938
  input: ({ context }) => ({
2889
2939
  isSecondId: context.config.isSecondId ?? false,
2890
2940
  onlyFront: false,
2891
- captureAttempts: context.config.captureAttempts
2941
+ captureAttempts: context.config.captureAttempts,
2942
+ extractIdFace: context.config.extractIdFace
2892
2943
  }),
2893
2944
  onSnapshot: { actions: () => {} },
2894
2945
  onDone: [{
@@ -2914,22 +2965,20 @@ const _idCaptureMachine = setup({
2914
2965
  src: "digitalUploadMachine",
2915
2966
  input: ({ context }) => ({
2916
2967
  showTutorial: context.config.showTutorial,
2917
- captureAttempts: context.config.captureAttempts
2968
+ attemptsRemaining: context.attemptsRemaining,
2969
+ extractIdFace: context.config.extractIdFace
2918
2970
  }),
2919
2971
  onSnapshot: { actions: () => {} },
2920
2972
  onDone: [
2921
2973
  {
2922
2974
  guard: "isDigitalUploadExhausted",
2923
- target: "#idCapture.finished"
2924
- },
2925
- {
2926
- guard: "isDigitalUploadClosed",
2927
- target: "#idCapture.chooser"
2975
+ target: "#idCapture.finished",
2976
+ actions: ["syncAttemptsFromDigitalUpload"]
2928
2977
  },
2929
2978
  {
2930
2979
  guard: "isDigitalUploadSuccessful",
2931
2980
  target: "#idCapture.processing",
2932
- actions: ["storeDigitalUploadResponse"]
2981
+ actions: ["syncAttemptsFromDigitalUpload", "storeDigitalUploadResponse"]
2933
2982
  },
2934
2983
  {
2935
2984
  target: "#idCapture.error",