@incodetech/core 2.2.0 → 2.3.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 (258) hide show
  1. package/THIRD_PARTY_NOTICES.txt +281 -0
  2. package/dist/BaseWasmProvider-Dyi6dKp1.d.ts +65 -0
  3. package/dist/{BrowserDiagnosticsCryptoProvider-B8vorxN5.esm.js → BrowserDiagnosticsCryptoProvider-C_9o3L2L.esm.js} +1 -1
  4. package/dist/{BrowserVisibilityObserverProvider-BX1BiLDK.esm.js → BrowserVisibilityObserverProvider-BrJN1B8A.esm.js} +2 -0
  5. package/dist/FaceDetectionProvider-DTetAE8H.esm.js +476 -0
  6. package/dist/FaceDetectionProvider-LdZ47bWy.d.ts +36 -0
  7. package/dist/{IIdCaptureCapability-DHTT3FC2.d.ts → IIdCaptureCapability-RNiFhvXR.d.ts} +7 -33
  8. package/dist/IWasmUtilCapability-CXXDA5l1.d.ts +159 -0
  9. package/dist/{MotionSensorProvider-DGiV77J_.esm.js → MotionSensorProvider-BgTYwg9L.esm.js} +1 -1
  10. package/dist/{deepsightService-DLVQS_RH.d.ts → StreamCanvasCapture-B3YT2Bt6.d.ts} +54 -41
  11. package/dist/{StreamCanvasCapture-D2XcXCZ4.esm.js → StreamCanvasCapture-C9jtgBdT.esm.js} +2 -2
  12. package/dist/{addressSearch-D1XpBdUS.esm.js → addressSearch-BRSu_aGA.esm.js} +1 -1
  13. package/dist/advanceableErrors-CpF2cBy6.esm.js +21 -0
  14. package/dist/ae-signature.d.ts +4 -2
  15. package/dist/ae-signature.esm.js +1 -1
  16. package/dist/antifraud.esm.js +2 -2
  17. package/dist/{antifraudManager-CQFNgSPt.esm.js → antifraudManager-Bg9ynGum.esm.js} +2 -2
  18. package/dist/{antifraudStateMachine-Bf_JVNwn.esm.js → antifraudStateMachine-BHxehiJZ.esm.js} +1 -1
  19. package/dist/{apiError-BA1d_au0.esm.js → apiError-D0v5hFyN.esm.js} +14 -2
  20. package/dist/authentication.d.ts +3 -3
  21. package/dist/authentication.esm.js +2 -2
  22. package/dist/{authenticationManager-zh9TC62P.esm.js → authenticationManager-C4B4-29g.esm.js} +5 -5
  23. package/dist/{authenticationManager-BBMGTcwW.d.ts → authenticationManager-DXTIUcma.d.ts} +7 -1
  24. package/dist/{authenticationStateMachine-xzi-vnvE.esm.js → authenticationStateMachine-DJ0zUm-A.esm.js} +6 -62
  25. package/dist/avatar.d.ts +1 -2
  26. package/dist/avatar.esm.js +1 -1
  27. package/dist/{backCameraStream-CUeYm5eu.esm.js → backCameraStream-BOtyQowf.esm.js} +83 -22
  28. package/dist/{camera-_2sXMXiF.esm.js → camera-sIa9ceW2.esm.js} +19 -1
  29. package/dist/camera.esm.js +1 -1
  30. package/dist/{canvas-E1zGkel4.esm.js → canvas-BxFzWTt-.esm.js} +19 -0
  31. package/dist/certificate-issuance.d.ts +2 -302
  32. package/dist/certificate-issuance.esm.js +3 -66
  33. package/dist/certificateIssuanceManager-Bfvkq7Cy.esm.js +69 -0
  34. package/dist/certificateIssuanceManager-DCgEidHz.d.ts +312 -0
  35. package/dist/{certificateIssuanceStateMachine-D_R92TYu.esm.js → certificateIssuanceStateMachine-BBD5h8c4.esm.js} +1 -1
  36. package/dist/consent.d.ts +1 -1
  37. package/dist/consent.esm.js +2 -2
  38. package/dist/{consentManager-BxjpLZAG.esm.js → consentManager-B5Vqdez-.esm.js} +2 -2
  39. package/dist/{consentManager-3Pbtj-RV.d.ts → consentManager-uhDPdU6i.d.ts} +4 -4
  40. package/dist/{consentStateMachine-D9D4ON8Z.esm.js → consentStateMachine-DbUmqWgV.esm.js} +1 -1
  41. package/dist/createCameraCycleOwnership-DQ5-F2oW.esm.js +826 -0
  42. package/dist/{createFaceAvatar-DQKaRise.esm.js → createFaceAvatar-BNHdeFj8.esm.js} +2 -2
  43. package/dist/createFaceAvatar-BlcTYgJv.d.ts +497 -0
  44. package/dist/cross-document-data-match.esm.js +1 -1
  45. package/dist/{crossDocumentDataMatchManager-CGT0V6RV.esm.js → crossDocumentDataMatchManager-QMOGwHXR.esm.js} +2 -2
  46. package/dist/curp-validation.d.ts +1 -1
  47. package/dist/curp-validation.esm.js +2 -2
  48. package/dist/{curpValidationManager-6Nmkn5u1.esm.js → curpValidationManager-D1ppROcF.esm.js} +2 -2
  49. package/dist/{curpValidationManager-DVGr7Fq7.d.ts → curpValidationManager-SSKNrm5Z.d.ts} +1 -1
  50. package/dist/{curpValidationStateMachine-Ds7KMacK.esm.js → curpValidationStateMachine-DvUPC_8S.esm.js} +1 -1
  51. package/dist/custom-fields.d.ts +2 -114
  52. package/dist/custom-fields.esm.js +2 -232
  53. package/dist/custom-watchlist.d.ts +2 -51
  54. package/dist/custom-watchlist.esm.js +3 -70
  55. package/dist/customFieldsManager-2j_PBq4U.esm.js +264 -0
  56. package/dist/customFieldsManager-8-W2KY4n.d.ts +141 -0
  57. package/dist/customWatchlistManager-DUVrEdw9.esm.js +73 -0
  58. package/dist/customWatchlistManager-PBWHr_oM.d.ts +64 -0
  59. package/dist/{customWatchlistStateMachine-YWSgKLbF.esm.js → customWatchlistStateMachine-qZVgkKgP.esm.js} +1 -1
  60. package/dist/{deepsightLoader--wMKWECS.esm.js → deepsightLoader-Dm7ejW4v.esm.js} +27 -71
  61. package/dist/device.d.ts +25 -2
  62. package/dist/device.esm.js +69 -7
  63. package/dist/document-capture.d.ts +2 -2
  64. package/dist/document-capture.esm.js +2 -2
  65. package/dist/{documentCaptureManager-DsQQhWry.esm.js → documentCaptureManager-DR_Wv-3H.esm.js} +2 -2
  66. package/dist/{documentCaptureManager-B3t0ydtg.d.ts → documentCaptureManager-DensIj5F.d.ts} +83 -83
  67. package/dist/{documentCaptureStateMachine-BM4Ex_5x.esm.js → documentCaptureStateMachine-CWOATHfE.esm.js} +5 -5
  68. package/dist/dynamic-forms.d.ts +1 -1
  69. package/dist/dynamic-forms.esm.js +2 -2
  70. package/dist/{dynamicFormsManager-fhK0yINk.d.ts → dynamicFormsManager-D5R_uxLQ.d.ts} +25 -3
  71. package/dist/{dynamicFormsManager-fFVIRBNv.esm.js → dynamicFormsManager-Dt98SDfV.esm.js} +16 -5
  72. package/dist/{dynamicFormsStateMachine-D6D7oEYk.esm.js → dynamicFormsStateMachine-obKr4IIp.esm.js} +35 -3
  73. package/dist/ekyb.d.ts +1 -1
  74. package/dist/ekyb.esm.js +3 -3
  75. package/dist/{ekybManager-Y3MkoXpC.esm.js → ekybManager-DNZKrKF3.esm.js} +2 -2
  76. package/dist/{ekybStateMachine-3nlnqdlr.esm.js → ekybStateMachine-DjhHQXZ8.esm.js} +3 -3
  77. package/dist/ekyc.esm.js +2 -2
  78. package/dist/{ekycManager-DgT48ky6.esm.js → ekycManager-CmQBpeiI.esm.js} +2 -2
  79. package/dist/{ekycStateMachine-CQwqiR-R.esm.js → ekycStateMachine-CmdW2gVm.esm.js} +2 -2
  80. package/dist/electronic-signature.d.ts +3 -3
  81. package/dist/electronic-signature.esm.js +2 -2
  82. package/dist/electronicSignatureManager-Ds-KEVTq.d.ts +2786 -0
  83. package/dist/{electronicSignatureManager-DGbAJ00W.esm.js → electronicSignatureManager-DzulxM4_.esm.js} +357 -51
  84. package/dist/email.esm.js +2 -2
  85. package/dist/{emailManager-BY0jeYwR.esm.js → emailManager-B5ek_UfM.esm.js} +2 -2
  86. package/dist/{emailStateMachine-Crw8QVmc.esm.js → emailStateMachine-CyPFZ7dW.esm.js} +1 -1
  87. package/dist/{endpoints-CCzL3XD_.esm.js → endpoints-D3B9mUHh.esm.js} +24 -7
  88. package/dist/{events-DYiyoSlx.esm.js → events-ijlbX_Wx.esm.js} +2 -2
  89. package/dist/events.d.ts +1 -1
  90. package/dist/events.esm.js +1 -1
  91. package/dist/extensibility.d.ts +24 -64
  92. package/dist/extensibility.esm.js +35 -29
  93. package/dist/face-match.esm.js +2 -2
  94. package/dist/{faceCaptureManagerFactory-BxWPpxyd.d.ts → faceCaptureManagerFactory-CvtqcLxs.d.ts} +87 -54
  95. package/dist/{faceCaptureManagerFactory-CVnZ0fa5.esm.js → faceCaptureManagerFactory-pCmG4MeF.esm.js} +68 -7
  96. package/dist/faceCaptureSetup-BSextack.esm.js +2106 -0
  97. package/dist/{faceMatchManager-Ri4UbNz0.esm.js → faceMatchManager-Caal2zyV.esm.js} +2 -2
  98. package/dist/{faceMatchStateMachine-20DdZ3jg.esm.js → faceMatchStateMachine-BUc5FXYy.esm.js} +1 -1
  99. package/dist/{feature-management-CPQ4qv3F.esm.js → feature-management-B0sGlozZ.esm.js} +32 -7
  100. package/dist/feature-management.d.ts +1 -1
  101. package/dist/feature-management.esm.js +1 -1
  102. package/dist/field-comparison.esm.js +1 -1
  103. package/dist/{fieldComparisonManager-Cg6kPQQx.esm.js → fieldComparisonManager-BIs6HPJG.esm.js} +2 -2
  104. package/dist/fiscal-qr.d.ts +2 -56
  105. package/dist/fiscal-qr.esm.js +2 -308
  106. package/dist/fiscalQrManager-Bp_-3LJr.esm.js +34131 -0
  107. package/dist/fiscalQrManager-CHcBJwUM.d.ts +68 -0
  108. package/dist/flow-events.d.ts +1 -1
  109. package/dist/flow.d.ts +212 -185
  110. package/dist/flow.esm.js +119 -30
  111. package/dist/{flowCompletionService-tfeoGre9.esm.js → flowCompletionService-CLtbWhSK.esm.js} +2 -2
  112. package/dist/{flowServices-f5Ruz7R9.esm.js → flowServices-B5FwukTQ.esm.js} +91 -26
  113. package/dist/geolocation.esm.js +2 -2
  114. package/dist/{geolocationManager-CH6RfqFH.esm.js → geolocationManager-DIw-xq9a.esm.js} +2 -2
  115. package/dist/{geolocationStateMachine-DmbWFely.esm.js → geolocationStateMachine-DpG0TFOU.esm.js} +3 -3
  116. package/dist/getBrowser-CBiibsL-.esm.js +19 -0
  117. package/dist/{getBrowser-DNrQeL4T.esm.js → getBrowser-Cbe1C4Tn.esm.js} +2 -1
  118. package/dist/{getDeviceClass-9y-kbVDw.esm.js → getDeviceClass-5NYZg9s6.esm.js} +2 -2
  119. package/dist/getParsedUserAgent-B2iFDql1.esm.js +1278 -0
  120. package/dist/government-validation.d.ts +2 -85
  121. package/dist/government-validation.esm.js +3 -120
  122. package/dist/governmentValidationManager-D02vT4yY.d.ts +63 -0
  123. package/dist/governmentValidationManager-TjC9iVjH.esm.js +79 -0
  124. package/dist/governmentValidationStateMachine-D1ZnEqdd.esm.js +54 -0
  125. package/dist/home.d.ts +1 -1
  126. package/dist/home.esm.js +1 -1
  127. package/dist/id-ocr.d.ts +2 -2
  128. package/dist/id-ocr.esm.js +2 -2
  129. package/dist/id-selfie-flow.d.ts +3 -2
  130. package/dist/id-selfie-flow.esm.js +11 -10
  131. package/dist/id-verification.esm.js +2 -2
  132. package/dist/id.d.ts +29 -5
  133. package/dist/id.esm.js +48 -46
  134. package/dist/idCaptureDefaults-BcxjQDI3.esm.js +484 -0
  135. package/dist/{idCaptureManager-CqrqSjJV.d.ts → idCaptureManager-CvmHOWWd.d.ts} +227 -39
  136. package/dist/{idCaptureManager-BYwTZ2H8.esm.js → idCaptureManager-Vby8oYqh.esm.js} +259 -46
  137. package/dist/{idCaptureServices-44kwQItl.esm.js → idCaptureServices-CJIxD9ep.esm.js} +342 -31
  138. package/dist/idCaptureStateMachine-CmqihkUy.esm.js +5343 -0
  139. package/dist/{idOcrManager-DXc_xRN7.d.ts → idOcrManager-BF_cXZq8.d.ts} +1 -1
  140. package/dist/{idOcrManager-BIQYQXXj.esm.js → idOcrManager-DHU22hVn.esm.js} +2 -2
  141. package/dist/{idOcrStateMachine-cSxzHpHt.esm.js → idOcrStateMachine-33UvRAHE.esm.js} +1 -1
  142. package/dist/{idVerificationManager-JpV_SAsl.esm.js → idVerificationManager-CyaixD0D.esm.js} +2 -2
  143. package/dist/{idVerificationStateMachine-nPeUNyFq.esm.js → idVerificationStateMachine-BPGrQZEm.esm.js} +1 -1
  144. package/dist/identity-reuse.esm.js +2 -2
  145. package/dist/{identityReuseManager-kNCg9AbD.esm.js → identityReuseManager-CWaNHBO3.esm.js} +2 -2
  146. package/dist/{identityReuseStateMachine-DyulxDjP.esm.js → identityReuseStateMachine-CQgnATo5.esm.js} +1 -1
  147. package/dist/{index-CLMF0QLQ.d.ts → index-DLcJT5YP.d.ts} +1 -1
  148. package/dist/index.d.ts +1 -1
  149. package/dist/index.esm.js +1 -1
  150. package/dist/{invokeOnCaptureCallback-GpvMuz9o.esm.js → invokeOnCaptureCallback-BjzPjJ_p.esm.js} +1 -1
  151. package/dist/mandatory-consent.d.ts +2 -2
  152. package/dist/mandatory-consent.esm.js +2 -2
  153. package/dist/{mandatoryConsentManager-DyPzUmsZ.d.ts → mandatoryConsentManager-CJSyhTpi.d.ts} +5 -5
  154. package/dist/{mandatoryConsentManager-B4Niyg_u.esm.js → mandatoryConsentManager-Du-m-tZ_.esm.js} +2 -2
  155. package/dist/{mandatoryConsentStateMachine-B4-1u-L8.esm.js → mandatoryConsentStateMachine-DSDAk7WZ.esm.js} +1 -1
  156. package/dist/multipartRecordingService-B3C_zlev.esm.js +594 -0
  157. package/dist/{permissionGuards-KINpmKtI.esm.js → permissionGuards-uYZYFu4J.esm.js} +1 -1
  158. package/dist/{permissionServices-UvUcOSRb.esm.js → permissionServices-Bj_fyWtv.esm.js} +5 -5
  159. package/dist/personhood.d.ts +6 -5
  160. package/dist/personhood.esm.js +10 -10
  161. package/dist/phone.esm.js +2 -2
  162. package/dist/{phoneManager-FsJ0W2Ei.esm.js → phoneManager-N1-sbrY4.esm.js} +2 -2
  163. package/dist/{phoneStateMachine-Ba0wKHyX.esm.js → phoneStateMachine-jl8LJKCo.esm.js} +1 -1
  164. package/dist/{platform-BJrm5nzZ.esm.js → platform-DkcRc9JV.esm.js} +29 -1
  165. package/dist/qe-signature.d.ts +5 -3
  166. package/dist/qe-signature.esm.js +2 -2
  167. package/dist/recordingsRepository-CCWy13M-.esm.js +72 -0
  168. package/dist/redirect-to-mobile.esm.js +2 -2
  169. package/dist/{redirectToMobileManager-y4VQB11M.esm.js → redirectToMobileManager-DsFzdTwA.esm.js} +2 -2
  170. package/dist/{redirectToMobileStateMachine-Cyv2x0PP.esm.js → redirectToMobileStateMachine-v3otpT-L.esm.js} +1 -1
  171. package/dist/{rolldown-runtime-FZ4Itg2g.esm.js → rolldown-runtime-FDOR9p9I.esm.js} +1 -19
  172. package/dist/{runChildModule-Dukuw23X.esm.js → runChildModule-TuyGE00X.esm.js} +3 -21
  173. package/dist/safeStorage-B-trhxg6.esm.js +423 -0
  174. package/dist/{sdkVersion-D1Bm59g6.esm.js → sdkVersion-CLxKvdyz.esm.js} +1 -1
  175. package/dist/selfie.d.ts +5 -5
  176. package/dist/selfie.esm.js +14 -76
  177. package/dist/{selfieErrorUtils-C2PYBVsp.esm.js → selfieErrorUtils-C77GXJH6.esm.js} +30 -4
  178. package/dist/{selfieManager-Bj6B2ZVy.esm.js → selfieManager-CihVnODO.esm.js} +5 -5
  179. package/dist/{selfieManager-DwlCppg0.d.ts → selfieManager-D1KRJ39M.d.ts} +8 -11
  180. package/dist/selfieStateMachine-fwMmNtOi.esm.js +69 -0
  181. package/dist/{session-BFdLgN4i.esm.js → session-BHIeAamR.esm.js} +4 -5
  182. package/dist/session.d.ts +21 -11
  183. package/dist/session.esm.js +5 -5
  184. package/dist/{sessionInitializer-dlfDehHk.esm.js → sessionInitializer-BLoK7SP9.esm.js} +187 -68
  185. package/dist/{setup-BgoWtvIS.d.ts → setup-Cv-JM9QC.d.ts} +63 -69
  186. package/dist/{setup-BIAtLa8k.esm.js → setup-msLybMbC.esm.js} +226 -100
  187. package/dist/signature.esm.js +2 -2
  188. package/dist/{signatureManager-Ca43yhwk.esm.js → signatureManager-ChsB-nMD.esm.js} +2 -2
  189. package/dist/{signatureStateMachine-K1LMRrxG.esm.js → signatureStateMachine-BHPwkJZS.esm.js} +1 -1
  190. package/dist/{src-0Jurt29N.esm.js → src-35ekGRzK.esm.js} +1 -1
  191. package/dist/{stats-B0nFKawG.esm.js → stats-DkK-f8JT.esm.js} +1 -1
  192. package/dist/stats.esm.js +1 -1
  193. package/dist/{trueSightService---iW2KKJ.esm.js → trueSightService-CKrrfV0Q.esm.js} +7 -7
  194. package/dist/trust-graph.esm.js +1 -1
  195. package/dist/{types-BX_XkMsQ2.d.ts → types-9_esGTPj.d.ts} +1 -1
  196. package/dist/types-BT_Oalip.d.ts +1 -0
  197. package/dist/{types-DelMqZLe.d.ts → types-BjSly8cp.d.ts} +1 -1
  198. package/dist/{types-Hmd7U0JA.d.ts → types-CM-jtjJ2.d.ts} +6 -81
  199. package/dist/{types-Bdf8_LYB2.d.ts → types-CjKBS37a2.d.ts} +303 -13
  200. package/dist/{types-DVmXIdzW.d.ts → types-D0gekt4U.d.ts} +38 -5
  201. package/dist/types-DgDvvzg0.d.ts +10 -0
  202. package/dist/{types-KPvmag_B.d.ts → types-Do5rEXij.d.ts} +7 -4
  203. package/dist/types-ZT1XFIJ8.d.ts +6 -0
  204. package/dist/video-selfie.d.ts +59 -35
  205. package/dist/video-selfie.esm.js +510 -601
  206. package/dist/{videoSelfieCameraWarmer-NEhFZvWx.esm.js → videoSelfieCameraWarmer-CB1IzZkt.esm.js} +14 -153
  207. package/dist/videoSelfieFlowModuleMachine-BUe2uACW.esm.js +32 -0
  208. package/dist/{videoSelfieStepDetector-D3oo2ofo.d.ts → videoSelfieStepDetector-5YHFe0Mq.d.ts} +21 -5
  209. package/dist/virtualCameraCheck-WOloJ-do.esm.js +48 -0
  210. package/dist/warmup-CUUnwYxe.esm.js +714 -0
  211. package/dist/warmup-Cis2p6O0.d.ts +128 -0
  212. package/dist/wasm.d.ts +30 -6
  213. package/dist/wasm.esm.js +36 -4
  214. package/dist/{wasmDsFlagSync-BqUCwLY8.esm.js → wasmDsFlagSync-B2e8p268.esm.js} +2 -2
  215. package/dist/{wasmWebClient-DM8lkb0z.esm.js → wasmWebClient-B7baE-Wf.esm.js} +358 -28
  216. package/dist/watchlist-for-business.d.ts +2 -78
  217. package/dist/watchlist-for-business.esm.js +3 -102
  218. package/dist/watchlist.esm.js +2 -2
  219. package/dist/watchlistForBusinessManager-CpuuB1J2.esm.js +107 -0
  220. package/dist/watchlistForBusinessManager-CsnJnG-C.d.ts +99 -0
  221. package/dist/{watchlistForBusinessStateMachine-CxFnlshm.esm.js → watchlistForBusinessStateMachine-DEzgjz7C.esm.js} +13 -6
  222. package/dist/{watchlistManager-LoNZH9qm.esm.js → watchlistManager-CI8BHFob.esm.js} +2 -2
  223. package/dist/{watchlistStateMachine-DIKQDoUT.esm.js → watchlistStateMachine-DvOby3a-.esm.js} +1 -1
  224. package/dist/workflow.d.ts +12 -8
  225. package/dist/workflow.esm.js +48 -39
  226. package/package.json +4 -10
  227. package/dist/BrowserStorageProvider-k-FDkC4W.esm.js +0 -67
  228. package/dist/FaceDetectionProvider-Mh6q3EbA.d.ts +0 -349
  229. package/dist/IFaceAvatarCapability-BrL19G0s.d.ts +0 -23
  230. package/dist/IStorageCapability-ORkQfK3F.d.ts +0 -242
  231. package/dist/OpenViduRecordingProvider-Du98qevC.esm.js +0 -85
  232. package/dist/createFaceAvatar-BEj18KXi.d.ts +0 -50
  233. package/dist/document-upload.d.ts +0 -325
  234. package/dist/document-upload.esm.js +0 -197
  235. package/dist/electronicSignatureManager-CcUXQZS7.d.ts +0 -1300
  236. package/dist/faceCaptureSetup-Cd-04W_X.esm.js +0 -863
  237. package/dist/getBrowser-Cb8Zgrgp.esm.js +0 -7
  238. package/dist/getParsedUserAgent-pJjATANs.esm.js +0 -1622
  239. package/dist/governmentValidationStateMachine-CK9DrZXX.esm.js +0 -226
  240. package/dist/idCaptureDefaults-WeHbQM7W.esm.js +0 -225
  241. package/dist/idCaptureStateMachine-kZ5OpdfM.esm.js +0 -3342
  242. package/dist/lib-DAyUtOTj.esm.js +0 -12420
  243. package/dist/manualReviewService-D4IkipnN.esm.js +0 -15
  244. package/dist/mediaRecorderOptions-dALSV8af.esm.js +0 -40
  245. package/dist/onDeviceFaceResults-CUHwyZT4.esm.js +0 -646
  246. package/dist/openviduLazy-CCDpFWg1.esm.js +0 -10
  247. package/dist/recordingService-3NSENVwp.esm.js +0 -329
  248. package/dist/safeStorage-Ep56I-f_.esm.js +0 -982
  249. package/dist/selfieStateMachine-CHV_WNst.esm.js +0 -55
  250. package/dist/trueSight-B_icM8r2.esm.js +0 -1
  251. package/dist/types-EELWyWpd.d.ts +0 -6
  252. package/dist/types-Vb4P9ovf.d.ts +0 -22
  253. package/dist/warmup-Dv2alr2-.d.ts +0 -82
  254. package/dist/wasmDefaults-DTUrftxR.esm.js +0 -125
  255. package/dist/{Face2DProvider-UUQt_vRC.esm.js → Face2DProvider-BF48sz5c.esm.js} +1 -1
  256. package/dist/{PrivacyLensProvider-D8PS7AJa.esm.js → PrivacyLensProvider-EwnC_C5n.esm.js} +1 -1
  257. /package/dist/{types-BfgmV7s72.d.ts → types-BfgmV7s7.d.ts} +0 -0
  258. /package/dist/{types-CJ7Yl9K-2.d.ts → types-CJ7Yl9K-.d.ts} +0 -0
@@ -1,15 +0,0 @@
1
- import { t as api } from "./api-Bx3gKW_y.esm.js";
2
- import { t as endpoints } from "./endpoints-CCzL3XD_.esm.js";
3
- //#region src/internal/manualReview/manualReviewService.ts
4
- async function flagFaceManualReview() {
5
- try {
6
- await api.put(endpoints.updateSession, { manualSelfieCheckNeeded: true });
7
- } catch {}
8
- }
9
- async function flagIdManualReview() {
10
- try {
11
- await api.put(endpoints.updateSession, { manualIdCheckNeeded: true });
12
- } catch {}
13
- }
14
- //#endregion
15
- export { flagIdManualReview as n, flagFaceManualReview as t };
@@ -1,40 +0,0 @@
1
- import { i as isIOS } from "./platform-BJrm5nzZ.esm.js";
2
- //#region ../infra/src/media/mediaRecorderOptions.ts
3
- /**
4
- * Picks a `MediaRecorder` mime type the current browser actually supports,
5
- * preferring mp4 on iOS and webm elsewhere. Returns '' when none match.
6
- */
7
- function getSupportedMediaRecorderMimeType() {
8
- const possibleTypes = isIOS() ? [
9
- "video/mp4",
10
- "video/webm",
11
- "video/webm;codecs=vp9",
12
- "video/webm;codecs=vp8"
13
- ] : [
14
- "video/webm",
15
- "video/webm;codecs=vp9",
16
- "video/webm;codecs=vp8",
17
- "video/mp4"
18
- ];
19
- for (const type of possibleTypes) if (MediaRecorder.isTypeSupported(type)) return type;
20
- return "";
21
- }
22
- /**
23
- * `MediaRecorder` options tuned per platform — a higher bitrate on iOS, lower
24
- * elsewhere — paired with the supported mime type.
25
- */
26
- function getAdaptiveMediaRecorderOptions() {
27
- const mimeType = getSupportedMediaRecorderMimeType();
28
- if (isIOS()) return {
29
- mimeType,
30
- videoBitsPerSecond: 1e6,
31
- bitsPerSecond: 1e6
32
- };
33
- return {
34
- mimeType,
35
- videoBitsPerSecond: 5e5,
36
- bitsPerSecond: 5e5
37
- };
38
- }
39
- //#endregion
40
- export { getSupportedMediaRecorderMimeType as n, getAdaptiveMediaRecorderOptions as t };
@@ -1,646 +0,0 @@
1
- import { c as mlWasmJSApi_default, i as BaseWasmProvider } from "./safeStorage-Ep56I-f_.esm.js";
2
- import { r as getToken, t as api } from "./api-Bx3gKW_y.esm.js";
3
- import { c as trueSightHintTransition, l as trueSightLog, r as noteTrueSightCaptureActivity } from "./trueSightService---iW2KKJ.esm.js";
4
- import { t as endpoints } from "./endpoints-CCzL3XD_.esm.js";
5
- import "./trueSight-B_icM8r2.esm.js";
6
- import { t as addDeviceStats } from "./stats-B0nFKawG.esm.js";
7
- import { o as isIPhone14OrHigher, r as isDesktop } from "./platform-BJrm5nzZ.esm.js";
8
- import { a as stopCameraStream, r as requestCameraAccess } from "./camera-_2sXMXiF.esm.js";
9
- import { t as sleep } from "./ITimerCapability-DgdDzp8G.esm.js";
10
- import { t as IncodeCanvas } from "./canvas-E1zGkel4.esm.js";
11
- import { i as hasBackCamera, n as getBackCameraStream, r as getDesktopCameraStream, t as ensureFrontCameraStream } from "./backCameraStream-CUeYm5eu.esm.js";
12
- //#region ../infra/src/scheduling/yieldUntilNextPaint.ts
13
- /**
14
- * Resolves after the browser has had a chance to commit and paint a queued
15
- * render.
16
- *
17
- * Strategy:
18
- * - `requestAnimationFrame` callbacks fire BEFORE the paint of the frame
19
- * they belong to (per the HTML5 "update the rendering" step). If we
20
- * resolve the promise inside a rAF callback, the await-continuation
21
- * runs as a microtask immediately after the callback returns — still
22
- * before the paint phase of that frame. A caller that then blocks the
23
- * main thread (e.g. synchronous WASM `processPhoto`) starves the paint.
24
- * - We therefore chain rAF → setTimeout: the rAF fires before frame N's
25
- * paint, the setTimeout runs as a macrotask scheduled after frame N's
26
- * "update the rendering" step, which the browser will only get to once
27
- * the paint actually lands. By the time setTimeout fires, the paint
28
- * for the queued render is on screen.
29
- * - In environments where rAF never ticks (jsdom, happy-dom, backgrounded
30
- * tabs), a parallel `setTimeout` fallback at 100 ms resolves instead.
31
- * 100 ms is comfortably longer than two real-browser frames so rAF +
32
- * setTimeout wins reliably in any foregrounded browser. (An earlier
33
- * implementation raced rAF against a `MessageChannel` macrotask, but
34
- * MessageChannel drains immediately after the current task's
35
- * microtasks — before the next paint — so it resolved the promise too
36
- * early and defeated the whole point of the helper.)
37
- *
38
- * Lives in infra because it touches browser APIs (`requestAnimationFrame`,
39
- * `setTimeout`) that the architecture rules forbid from core. Core modules
40
- * that need to yield to the browser render loop should import this helper
41
- * directly via its file path.
42
- */
43
- function yieldUntilNextPaint() {
44
- return new Promise((resolve) => {
45
- let resolved = false;
46
- const done = () => {
47
- if (resolved) return;
48
- resolved = true;
49
- resolve();
50
- };
51
- if (typeof requestAnimationFrame === "function") requestAnimationFrame(() => {
52
- requestAnimationFrame(() => {
53
- setTimeout(done, 0);
54
- });
55
- });
56
- setTimeout(done, 100);
57
- });
58
- }
59
- //#endregion
60
- //#region ../infra/src/providers/wasm/FaceDetectionProvider.ts
61
- /**
62
- * Best-effort `delete()` for Emscripten `embind`-bound handles. Plain
63
- * JS values lack a `.delete` method and are skipped; proxy objects
64
- * have it and need it called once to free the underlying C++ memory.
65
- * Swallows errors because this runs at 15–30 Hz on the detection hot
66
- * path — a throwing cleanup must never abort frame processing.
67
- */
68
- function tryDeleteEmbindHandle(value) {
69
- const maybeDelete = value?.delete;
70
- if (typeof maybeDelete !== "function") return;
71
- try {
72
- maybeDelete.call(value);
73
- } catch {}
74
- }
75
- var FaceDetectionProvider = class extends BaseWasmProvider {
76
- constructor() {
77
- super(4);
78
- this.defaultThresholds = {
79
- frameMinX: 0,
80
- frameMinY: 0,
81
- frameMaxX: 1,
82
- frameMaxY: 1,
83
- brightnessThreshold: 50,
84
- blurrinessThreshold: 50,
85
- tiltRotationAngleThreshold: 15,
86
- minMagicCropSize: 200,
87
- headwearThreshold: .86,
88
- lensesThreshold: .95,
89
- closedEyesThreshold: .9,
90
- maskThreshold: .85,
91
- minFaceQualityScore: .63,
92
- faceOcclusionThreshold: .3,
93
- getReadyDelay: 2e3,
94
- framesAggregationInterval: 2e3,
95
- minFramesWithFace: 3
96
- };
97
- this.currentFrame = null;
98
- }
99
- async processFrame(image) {
100
- this.currentFrame = image;
101
- const result = await this.processFrameWasm(image);
102
- if (this.onFaceDataCallback && result?.faces) {
103
- let face;
104
- try {
105
- if ((typeof result.faces.size === "function" ? result.faces.size() : 0) > 0) {
106
- face = typeof result.faces.get === "function" ? result.faces.get(0) : void 0;
107
- if (face) this.onFaceDataCallback(face, {
108
- width: image.width,
109
- height: image.height
110
- });
111
- }
112
- } catch {} finally {
113
- tryDeleteEmbindHandle(face);
114
- tryDeleteEmbindHandle(result.faces);
115
- tryDeleteEmbindHandle(result);
116
- }
117
- }
118
- }
119
- async initialize(config) {
120
- if (config.videoSelfie === true) {
121
- this.pipelineType = 3;
122
- await this.initializeBase(config, "videoSelfie");
123
- } else if (config.useOnDeviceWorkflow === true) {
124
- this.pipelineType = 5;
125
- await this.initializeBase(config, "onDeviceSelfie");
126
- } else await this.initializeBase(config, "selfie");
127
- this.applyDefaults(config.autocaptureInterval ?? 0);
128
- if (config.videoSelfie === true) this.setVideoSelfieMode(true);
129
- }
130
- processPhoto(canvas) {
131
- this.ensureInitialized();
132
- mlWasmJSApi_default.processPhoto(canvas);
133
- }
134
- async postFaceResults(config) {
135
- this.ensureInitialized();
136
- return mlWasmJSApi_default.postFaceResults(config);
137
- }
138
- setCallbacks(callbacks) {
139
- this.ensureInitialized();
140
- this.onFaceDataCallback = callbacks.onFaceData;
141
- const onCaptureWrapper = (wasmCanvas, face) => {
142
- if (!wasmCanvas) return;
143
- const frameCanvas = new IncodeCanvas(wasmCanvas);
144
- frameCanvas.updateBase64Image();
145
- frameCanvas.updateBlob();
146
- const faceCoordinates = face ? this.formatFaceCoordinates(face) : this.createDefaultFaceCoordinates(frameCanvas);
147
- callbacks.onCapture?.(frameCanvas, faceCoordinates);
148
- };
149
- this.currentOnCaptureWrapper = onCaptureWrapper;
150
- 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 ?? (() => {}));
151
- }
152
- setPositionConstraints(constraints) {
153
- this.ensureInitialized();
154
- mlWasmJSApi_default.setFacePositionConstraints(this.getPipelineType(), constraints.minX, constraints.minY, constraints.maxX, constraints.maxY);
155
- }
156
- applyDefaults(autocaptureInterval = 0) {
157
- this.ensureInitialized();
158
- this.setThresholds({
159
- brightnessThreshold: this.defaultThresholds.brightnessThreshold,
160
- blurrinessThreshold: this.defaultThresholds.blurrinessThreshold,
161
- tiltRotationAngleThreshold: this.defaultThresholds.tiltRotationAngleThreshold,
162
- minMagicCropSize: this.defaultThresholds.minMagicCropSize,
163
- autocaptureInterval,
164
- minFaceQualityScore: this.defaultThresholds.minFaceQualityScore,
165
- faceOcclusionThreshold: this.defaultThresholds.faceOcclusionThreshold,
166
- getReadyDelay: this.defaultThresholds.getReadyDelay,
167
- framesAggregationInterval: this.defaultThresholds.framesAggregationInterval,
168
- minFramesWithFace: this.defaultThresholds.minFramesWithFace
169
- });
170
- this.setPositionConstraints({
171
- minX: this.defaultThresholds.frameMinX,
172
- minY: this.defaultThresholds.frameMinY,
173
- maxX: this.defaultThresholds.frameMaxX,
174
- maxY: this.defaultThresholds.frameMaxY
175
- });
176
- this.setAttributesThresholds({
177
- headwearThreshold: this.defaultThresholds.headwearThreshold,
178
- lensesThreshold: this.defaultThresholds.lensesThreshold,
179
- closedEyesThreshold: this.defaultThresholds.closedEyesThreshold,
180
- maskThreshold: this.defaultThresholds.maskThreshold
181
- });
182
- }
183
- setAutocaptureInterval(interval) {
184
- this.ensureInitialized();
185
- if (!this.currentThresholds) {
186
- this.applyDefaults(interval);
187
- return;
188
- }
189
- this.setThresholds({
190
- ...this.currentThresholds,
191
- autocaptureInterval: interval
192
- });
193
- }
194
- setThresholds(thresholds) {
195
- this.ensureInitialized();
196
- this.currentThresholds = { ...thresholds };
197
- mlWasmJSApi_default.setFaceDetectionThresholds(this.getPipelineType(), thresholds.brightnessThreshold, thresholds.blurrinessThreshold, thresholds.tiltRotationAngleThreshold, thresholds.minMagicCropSize, thresholds.autocaptureInterval, thresholds.minFaceQualityScore, thresholds.faceOcclusionThreshold, thresholds.getReadyDelay, thresholds.framesAggregationInterval, thresholds.minFramesWithFace);
198
- }
199
- setAttributesThresholds(thresholds) {
200
- this.ensureInitialized();
201
- mlWasmJSApi_default.setFaceAttributesThresholds(this.getPipelineType(), thresholds.headwearThreshold, thresholds.lensesThreshold, thresholds.closedEyesThreshold, thresholds.maskThreshold);
202
- }
203
- setChecksEnabled(config) {
204
- this.ensureInitialized();
205
- mlWasmJSApi_default.setFaceChecksEnabled(this.getPipelineType(), config.lenses, config.mask, config.closedEyes, config.headWear, config.occlusion);
206
- }
207
- setVideoSelfieMode(enabled) {
208
- this.ensureInitialized();
209
- mlWasmJSApi_default.setFaceDetectionMode(this.getPipelineType(), enabled);
210
- }
211
- forceCapture() {
212
- if (!this.currentFrame || !this.currentOnCaptureWrapper) return;
213
- const frame = IncodeCanvas.fromImageData(this.currentFrame);
214
- this.currentOnCaptureWrapper(frame.canvas);
215
- }
216
- reset() {
217
- super.reset();
218
- this.currentFrame = null;
219
- this.onFaceDataCallback = void 0;
220
- this.currentOnCaptureWrapper = void 0;
221
- }
222
- createDefaultFaceCoordinates(canvas) {
223
- return {
224
- rightEyeX: 0,
225
- rightEyeY: 0,
226
- leftEyeX: 0,
227
- leftEyeY: 0,
228
- noseTipX: 0,
229
- noseTipY: 0,
230
- rightMouthX: 0,
231
- rightMouthY: 0,
232
- mouthX: 0,
233
- mouthY: 0,
234
- x: 0,
235
- y: 0,
236
- width: canvas.width() ?? 0,
237
- height: canvas.height() ?? 0
238
- };
239
- }
240
- formatFaceCoordinates(face) {
241
- return {
242
- rightEyeX: face.rightEye.x,
243
- rightEyeY: face.rightEye.y,
244
- leftEyeX: face.leftEye.x,
245
- leftEyeY: face.leftEye.y,
246
- noseTipX: face.noseTip.x,
247
- noseTipY: face.noseTip.y,
248
- rightMouthX: face.rightMouthCorner.x,
249
- rightMouthY: face.rightMouthCorner.y,
250
- mouthX: face.leftMouthCorner.x,
251
- mouthY: face.leftMouthCorner.y,
252
- x: face.rect.x,
253
- y: face.rect.y,
254
- width: face.rect.width,
255
- height: face.rect.height
256
- };
257
- }
258
- };
259
- //#endregion
260
- //#region ../infra/src/media/StreamCanvasProcessingSession.ts
261
- var StreamCanvasProcessingSession = class {
262
- /**
263
- * Creates a processing session that reacts to `StreamCanvasCapture` frame events
264
- * and drives a provider's `processFrame()` method with backpressure.
265
- */
266
- constructor(params) {
267
- this.disposed = false;
268
- this.isProcessing = false;
269
- this.onFrameEvent = () => {
270
- if (this.disposed || this.isProcessing) return;
271
- const frame = this.capturer.getLatestFrame();
272
- if (!frame) return;
273
- this.onFrame?.(frame);
274
- this.isProcessing = true;
275
- this.provider.processFrame(frame).catch(() => {}).finally(() => {
276
- this.isProcessing = false;
277
- });
278
- };
279
- this.capturer = params.capturer;
280
- this.provider = params.provider;
281
- this.onFrame = params.onFrame;
282
- this.capturer.addEventListener("frame", this.onFrameEvent);
283
- }
284
- /**
285
- * Unsubscribes from frame events and resets the provider.
286
- */
287
- dispose() {
288
- if (this.disposed) return;
289
- this.disposed = true;
290
- this.capturer.removeEventListener("frame", this.onFrameEvent);
291
- this.provider.reset();
292
- }
293
- /**
294
- * Returns whether the session has been disposed.
295
- */
296
- isDisposed() {
297
- return this.disposed;
298
- }
299
- };
300
- //#endregion
301
- //#region src/internal/recordings/recordingsRepository.ts
302
- async function createRecordingSession(type) {
303
- return (await api.post(endpoints.recordingCreateSessionV2, { type })).data;
304
- }
305
- async function startRecording(params) {
306
- return (await api.post(endpoints.recordingStartV2, {
307
- videoRecordingId: params.videoRecordingId,
308
- frameRate: 30,
309
- outputMode: "COMPOSED",
310
- resolution: params.resolution,
311
- type: params.type,
312
- hasAudio: params.hasAudio ?? false
313
- })).data;
314
- }
315
- async function stopRecording$1(videoRecordingId) {
316
- return (await api.post(endpoints.recordingStopV2, { videoRecordingId })).data;
317
- }
318
- async function uploadDeepsightVideo(encryptedVideo, token) {
319
- try {
320
- return (await api.post(endpoints.deepsightVideoImport, {
321
- video: encryptedVideo,
322
- type: "selfie"
323
- }, { headers: { "X-Incode-Hardware-Id": token } })).data.recordingId ?? "";
324
- } catch {
325
- return "";
326
- }
327
- }
328
- //#endregion
329
- //#region src/internal/faceCapture/faceCaptureServices.ts
330
- const ONDEVICE_AUTOCAPTURE_INTERVAL_MS = 2147483647;
331
- function sendLabelInspectionEvent() {
332
- return addDeviceStats({ cameraLabelInspectionStatus: "FAIL" });
333
- }
334
- const MOBILE_SELFIE_CONSTRAINTS = {
335
- video: {
336
- facingMode: "user",
337
- height: { ideal: 480 },
338
- width: { ideal: 640 }
339
- },
340
- audio: false
341
- };
342
- const IPHONE14_SELFIE_CONSTRAINTS = {
343
- video: { height: { ideal: 1080 } },
344
- audio: false
345
- };
346
- function buildCameraConstraints(resolution, deviceId) {
347
- if (resolution) return {
348
- video: {
349
- facingMode: "user",
350
- deviceId: deviceId ? { exact: deviceId } : void 0,
351
- height: resolution.height ? { ideal: resolution.height } : void 0,
352
- width: resolution.width ? { ideal: resolution.width } : void 0
353
- },
354
- audio: false
355
- };
356
- if (isIPhone14OrHigher()) return IPHONE14_SELFIE_CONSTRAINTS;
357
- return MOBILE_SELFIE_CONSTRAINTS;
358
- }
359
- function stopStream(stream) {
360
- stopCameraStream(stream);
361
- }
362
- async function getFrontCameraStream(resolution) {
363
- if (isDesktop()) {
364
- if (resolution) return ensureFrontCameraStream((deviceId) => requestCameraAccess(buildCameraConstraints(resolution, deviceId)));
365
- return ensureFrontCameraStream((deviceId) => getDesktopCameraStream(deviceId ? { deviceId } : {}));
366
- }
367
- return requestCameraAccess(resolution ? buildCameraConstraints(resolution) : buildCameraConstraints());
368
- }
369
- async function initializeCamera(params) {
370
- const { config } = params;
371
- const prcConstraints = buildCameraConstraints(config.cameraResolution);
372
- const provider = new FaceDetectionProvider();
373
- await provider.initialize({
374
- autocaptureInterval: isOnDeviceMode(config) ? ONDEVICE_AUTOCAPTURE_INTERVAL_MS : config.autoCaptureTimeout * 1e3,
375
- useOnDeviceWorkflow: config.onDeviceFaceResultsSubmissionEnabled === true
376
- });
377
- provider.setChecksEnabled({
378
- lenses: config.validateLenses ?? false,
379
- mask: config.validateFaceMask ?? false,
380
- closedEyes: config.validateClosedEyes ?? false,
381
- headWear: config.validateHeadCover ?? false,
382
- occlusion: false
383
- });
384
- await params.deepsightService.performPrcCheck({ constraints: { video: prcConstraints.video } });
385
- const usingBackCamera = config.assistedOnboarding === true && await hasBackCamera();
386
- return {
387
- stream: usingBackCamera ? (await getBackCameraStream()).stream : await getFrontCameraStream(config.cameraResolution),
388
- provider,
389
- usingBackCamera
390
- };
391
- }
392
- /**
393
- * Encrypts the provided selfie image using WASM.
394
- */
395
- async function encryptSelfieImage({ canvas, dependencies }) {
396
- const base64Image = canvas.getBase64Image();
397
- if (!base64Image) throw new Error("Canvas image is empty or null");
398
- return (await dependencies.getWasmUtil()).encryptImage(base64Image);
399
- }
400
- function startDetection(params) {
401
- let lastStatus;
402
- let session;
403
- const { provider } = params;
404
- const setStatus = (status) => {
405
- if (session?.isDisposed() === true) return;
406
- if (lastStatus === status) return;
407
- lastStatus = status;
408
- trueSightHintTransition("module.face-capture", "faceScan", status);
409
- params.onUpdate(status);
410
- };
411
- const stopDetectionLoop = () => {
412
- session?.dispose();
413
- noteTrueSightCaptureActivity(false);
414
- };
415
- const reset = () => {
416
- provider.reset();
417
- };
418
- const cleanup = () => {
419
- stopDetectionLoop();
420
- };
421
- (async () => {
422
- try {
423
- provider.setCallbacks({
424
- onFarAway: () => setStatus("tooFar"),
425
- onTooClose: () => setStatus("tooClose"),
426
- onTooManyFaces: () => setStatus("tooManyFaces"),
427
- onNoFace: () => setStatus("idle"),
428
- onCenterFace: () => setStatus("centerFace"),
429
- onGetReady: () => setStatus("getReady"),
430
- onGetReadyFinished: () => setStatus("getReadyFinished"),
431
- onDark: () => {
432
- if (params.config.validateBrightness) setStatus("dark");
433
- },
434
- onBlur: () => setStatus("blur"),
435
- onFaceAngle: () => setStatus("faceAngle"),
436
- onLenses: () => {
437
- if (params.config.validateLenses) setStatus("lenses");
438
- },
439
- onMask: () => {
440
- if (params.config.validateFaceMask) setStatus("faceMask");
441
- },
442
- onEyesClosed: () => {
443
- if (params.config.validateClosedEyes) setStatus("eyesClosed");
444
- },
445
- onHeadWear: () => {
446
- if (params.config.validateHeadCover) setStatus("headWear");
447
- },
448
- onFaceOccluded: () => setStatus("faceOcclusion"),
449
- onFaceData: params.onPose,
450
- onSwitchToManualCapture: () => {
451
- setStatus("manualCapture");
452
- stopDetectionLoop();
453
- },
454
- onCapture: (canvas, faceCoordinates) => {
455
- setStatus("success");
456
- params.onSuccess(canvas, faceCoordinates);
457
- cleanup();
458
- }
459
- });
460
- setStatus("detecting");
461
- session = new StreamCanvasProcessingSession({
462
- capturer: params.capturer,
463
- provider,
464
- onFrame: params.onFrame
465
- });
466
- noteTrueSightCaptureActivity(true);
467
- } catch {
468
- setStatus("error");
469
- cleanup();
470
- }
471
- })();
472
- return {
473
- cleanup,
474
- reset
475
- };
476
- }
477
- function buildResolutionFromStream(stream) {
478
- const track = stream.getVideoTracks()[0];
479
- if (!track) return;
480
- const settings = track.getSettings();
481
- const width = settings.width;
482
- const height = settings.height;
483
- if (typeof width === "number" && typeof height === "number") return `${width}x${height}`;
484
- }
485
- async function createOpenViduRecordingProvider() {
486
- const { OpenViduRecordingProvider } = await import("./OpenViduRecordingProvider-Du98qevC.esm.js");
487
- return new OpenViduRecordingProvider();
488
- }
489
- async function startRecordingSession(params) {
490
- if (params.config.deepsightLiveness === "VIDEOLIVENESS") return;
491
- if (params.config.enableFaceRecording !== true) return;
492
- if (params.existing) return params.existing;
493
- const provider = params.config.recording?.capability ?? await createOpenViduRecordingProvider();
494
- const clonedStream = params.clonedStream;
495
- const hasAudio = clonedStream.getAudioTracks().length > 0;
496
- const resolution = buildResolutionFromStream(clonedStream);
497
- const session = await createRecordingSession("selfie");
498
- const connection = await provider.connect({
499
- sessionToken: session.token,
500
- stream: clonedStream,
501
- events: {}
502
- });
503
- await startRecording({
504
- videoRecordingId: session.videoRecordingId,
505
- type: "selfie",
506
- resolution,
507
- hasAudio
508
- });
509
- return {
510
- token: session.token,
511
- sessionId: session.sessionId,
512
- videoRecordingId: session.videoRecordingId,
513
- connection,
514
- resolution,
515
- hasAudio
516
- };
517
- }
518
- async function stopRecording(session) {
519
- try {
520
- await stopRecording$1(session.videoRecordingId);
521
- } finally {
522
- await session.connection.disconnect();
523
- }
524
- }
525
- async function initializeDeepsightSession(options) {
526
- const { loadDeepsightSession } = await import("./deepsightLoader--wMKWECS.esm.js");
527
- return loadDeepsightSession({
528
- ds: options.ds,
529
- storage: options.storage
530
- });
531
- }
532
- //#endregion
533
- //#region src/internal/faceCapture/onDeviceFaceResults.ts
534
- /**
535
- * On-device face-results submission helpers.
536
- *
537
- * When a SELFIE or AUTHENTICATION module has
538
- * `onDeviceFaceResultsSubmissionEnabled: true`, face analysis runs entirely
539
- * inside the WASM `OnDeviceSelfieWorkflow` pipeline. Captured images are
540
- * never uploaded — only the staged face-results JSON is POSTed via the WASM
541
- * `WebApi` to `/omni/add/face-results`. The C++ side encrypts that JSON via
542
- * `SessionEncryptor`, so the per-request `createWasmApi` encryption pipeline
543
- * is not engaged on this path.
544
- *
545
- * Note: even though the per-request encryption pipeline is skipped, the
546
- * on-device endpoint (`/omni/add/face-results`) is only served on the
547
- * E2EE-provisioned host — callers must still configure `setup()` with the
548
- * dedicated E2EE `apiURL` and `encryption: true`. See `SetupOptions.encryption`.
549
- *
550
- * These helpers are deliberately variant-agnostic: both the selfie and auth
551
- * state machine variants delegate their `prepareFaceUpload`, `uploadFace`,
552
- * and `processFace` actors here to share behavior. See the "Runtime modes
553
- * within a module" section of `docs/patterns/XSTATE.md` for the broader
554
- * pattern.
555
- */
556
- const isOnDeviceMode = (config) => config.onDeviceFaceResultsSubmissionEnabled === true;
557
- /**
558
- * The default (non-on-device) prepare-upload body shared by selfie and auth.
559
- * Stops any active recording, runs deepsight virtual-camera + frame checks,
560
- * tracks the capture attempt, and encrypts the captured image.
561
- *
562
- * Lifted out of `faceCaptureSetup.ts`'s base `prepareFaceUpload` actor so the
563
- * default path can be reused by both variants while leaving room for an
564
- * on-device branch alongside it.
565
- */
566
- async function defaultPrepareFaceUpload(ctx) {
567
- const sessionToken = getToken();
568
- const recordingId = (await ctx.recordingService?.stop())?.recordingId ?? null;
569
- try {
570
- if (ctx.deepsightService) await Promise.all([ctx.deepsightService.performVirtualCameraCheck(sessionToken, "SELFIE"), ctx.deepsightService.analyzeFrame(ctx.capturedImage.getImageData())]);
571
- } catch (error) {
572
- trueSightLog("warning", "deepsight", "faceScan", `deepsight selfie analysis failed error=${String(error)}`);
573
- }
574
- const logs = ctx.deepsightService?.getPipelineState() ?? "";
575
- ctx.dependencies.trackCaptureAttemptFinished?.({ logs });
576
- return {
577
- encryptedBase64Image: await encryptSelfieImage({
578
- canvas: ctx.capturedImage,
579
- dependencies: ctx.dependencies
580
- }),
581
- recordingId
582
- };
583
- }
584
- /**
585
- * On-device prepare-upload. No recording to stop (the recording service is
586
- * never created when the flag is on), no image encryption needed.
587
- *
588
- * Behavior depends on which capture path got us here:
589
- *
590
- * - **Auto-capture path**: the WASM `OnDeviceSelfiePipeline` has been
591
- * consuming every video frame via `processFrame()` and aggregating
592
- * results across them. When it picks a best-shot, the C++
593
- * `OnDeviceSelfieWorkflow::createOnCaptureHandler` calls
594
- * `WebApi::setFaceResults(...)` automatically — staging strong,
595
- * aggregated `BestShotData` for the subsequent `postFaceResults` call.
596
- * We must NOT call `processPhoto` here: `applyFaceResults` would
597
- * overwrite that staged state with a weaker single-frame analysis of a
598
- * post-capture snapshot (camera state has already changed: autocapture
599
- * freeze, stream pause, post-detection latency), and the server then
600
- * rejects the submission as "image quality too low".
601
- *
602
- * - **Manual-capture path**: the auto-capture timer expired without a
603
- * successful best-shot, so the C++ pipeline has nothing staged. We
604
- * need to run a single-frame analysis on the manually captured canvas
605
- * via `processPhoto`, which itself calls
606
- * `OnDeviceSelfieWorkflow::applyFaceResults` → `WebApi::setFaceResults`
607
- * to stage results. Mirrors V1 (`packages/incode-welcome/src/camera/useSelfie.ts`)
608
- * where `processPhoto` is only invoked from `handleManualCapture`.
609
- *
610
- * Returns sentinel values for `encryptedBase64Image` and `recordingId` so
611
- * the existing FaceCaptureContext shape remains stable; downstream actors
612
- * for the on-device path simply ignore them.
613
- */
614
- async function prepareOnDeviceFaceUpload(ctx) {
615
- if (!ctx.capturedImage) throw new Error("On-device capture requires a captured image canvas");
616
- if (!ctx.provider) throw new Error("On-device capture requires the FaceDetectionProvider to be initialized");
617
- if (ctx.manualCaptureTriggered) {
618
- await yieldUntilNextPaint();
619
- await sleep(350);
620
- ctx.provider.processPhoto(ctx.capturedImage.canvas);
621
- }
622
- return {
623
- encryptedBase64Image: "",
624
- recordingId: null
625
- };
626
- }
627
- /**
628
- * POSTs the staged on-device face-results JSON to `/omni/add/face-results`
629
- * through the WASM `WebApi`. Used as the `uploadFace` actor body for both
630
- * selfie and auth variants when on-device mode is enabled.
631
- *
632
- * The C++ `WebApi` handles `SessionEncryptor` encryption and the actual
633
- * HTTP via the WASM `WebClient` — so callers don't need to thread the
634
- * session-encryption details through JS.
635
- */
636
- async function postOnDeviceFaceResults(ctx, signal) {
637
- const provider = ctx.provider;
638
- if (!provider) throw new Error("On-device upload requires the FaceDetectionProvider to be initialized");
639
- const sessionToken = getToken();
640
- return await provider.postFaceResults({
641
- headers: sessionToken ? { "X-Incode-Hardware-Id": sessionToken } : void 0,
642
- timeout: 3e4
643
- }) ?? {};
644
- }
645
- //#endregion
646
- export { StreamCanvasProcessingSession as _, encryptSelfieImage as a, sendLabelInspectionEvent as c, stopRecording as d, stopStream as f, uploadDeepsightVideo as g, stopRecording$1 as h, prepareOnDeviceFaceUpload as i, startDetection as l, startRecording as m, isOnDeviceMode as n, initializeCamera as o, createRecordingSession as p, postOnDeviceFaceResults as r, initializeDeepsightSession as s, defaultPrepareFaceUpload as t, startRecordingSession as u, FaceDetectionProvider as v };