@incodetech/core 0.0.0-dev-20260625-d0b37b1e → 0.0.0-dev-20260625-a43ee3be

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 (240) hide show
  1. package/dist/3dAvatarProvider-fTdHcYRZ.esm.js +28214 -0
  2. package/dist/{IpifyProvider-oZf7Ke1O.esm.js → BrowserEnvironmentProvider--Rda18RB.esm.js} +1 -51
  3. package/dist/{BrowserStorageProvider-D5xc7Lqo.esm.js → BrowserStorageProvider-BsoYOG0O.esm.js} +1 -25
  4. package/dist/BrowserVisibilityObserverProvider-EZ_rxOqV.esm.js +25 -0
  5. package/dist/Face2DProvider-B6fcPUZn.esm.js +824 -0
  6. package/dist/FaceDetectionProvider-CVU9Tfgu.d.ts +248 -0
  7. package/dist/IVisibilityObserverCapability-DIWWAmF2.d.ts +12 -0
  8. package/dist/IpifyProvider-CN96dlWf.esm.js +51 -0
  9. package/dist/{OpenViduRecordingProvider-DF7A4ZNJ.esm.js → OpenViduRecordingProvider-NzFiqaEU.esm.js} +1 -1
  10. package/dist/PrivacyLensProvider-DSgQUHtW.esm.js +339 -0
  11. package/dist/{StreamCanvasCapture-Dr5n_iK1.esm.js → StreamCanvasCapture-Koi0Xc6f.esm.js} +1 -1
  12. package/dist/StreamCanvasCapture-opC6JnBb.d.ts +42 -0
  13. package/dist/{addressSearch-BH96a3fq.esm.js → addressSearch-Cmf1l1zD.esm.js} +4 -4
  14. package/dist/{ae-signature-CDEN8y-w.esm.js → ae-signature-Kjug39_Z.esm.js} +1 -1
  15. package/dist/ae-signature.d.ts +3 -3
  16. package/dist/ae-signature.esm.js +10 -9
  17. package/dist/antifraud.d.ts +3 -3
  18. package/dist/antifraud.esm.js +7 -6
  19. package/dist/{antifraudManager-B7WQTIdu.d.ts → antifraudManager-B26zslni.d.ts} +2 -2
  20. package/dist/{antifraudManager-DZifA5zX.esm.js → antifraudManager-CSREEbtK.esm.js} +4 -3
  21. package/dist/{antifraudStateMachine-DlKrK2hL.esm.js → antifraudStateMachine-BLZzwvJY.esm.js} +3 -3
  22. package/dist/{api-DUZwyz0o.esm.js → api-KOw05L_i.esm.js} +21 -2
  23. package/dist/authentication.d.ts +16 -12
  24. package/dist/authentication.esm.js +32 -27
  25. package/dist/{authenticationManager-BM4LzyV7.esm.js → authenticationManager-BcOjHyWa.esm.js} +6 -6
  26. package/dist/{authenticationManager-Dve7mGLe.d.ts → authenticationManager-BxBa-I5y.d.ts} +3 -3
  27. package/dist/{authenticationStateMachine-Chx3ySdT.esm.js → authenticationStateMachine-DoFadRn8.esm.js} +8 -8
  28. package/dist/avatar.d.ts +3 -0
  29. package/dist/avatar.esm.js +3 -0
  30. package/dist/{backCameraStream-iftkf3rd.esm.js → backCameraStream-6nEEESaK.esm.js} +3 -3
  31. package/dist/{browserSimulation-CGjpdNA1.esm.js → browserSimulation-BaRUkqo0.esm.js} +2 -2
  32. package/dist/camera.d.ts +1 -1
  33. package/dist/camera.esm.js +4 -4
  34. package/dist/{StreamCanvasCapture-Ctgyx-oD.d.ts → canvas-BFl4HMZy.d.ts} +1 -41
  35. package/dist/certificate-issuance.d.ts +30 -30
  36. package/dist/certificate-issuance.esm.js +8 -7
  37. package/dist/{certificateIssuanceStateMachine-CLNXtXaC.esm.js → certificateIssuanceStateMachine-DVX0JsVJ.esm.js} +4 -4
  38. package/dist/clientLifecycle-B_ckqcX0.esm.js +534 -0
  39. package/dist/consent.d.ts +3 -3
  40. package/dist/consent.esm.js +7 -6
  41. package/dist/{consentManager-psDCeJ0E.esm.js → consentManager-BJmYmw_6.esm.js} +4 -3
  42. package/dist/{consentManager-B4V_yYxG.d.ts → consentManager-vvPkWTMc.d.ts} +54 -54
  43. package/dist/{consentStateMachine-DRsFFSHE.esm.js → consentStateMachine-DgSJ1ayL.esm.js} +3 -3
  44. package/dist/cpf-ocr.d.ts +3 -3
  45. package/dist/cpf-ocr.esm.js +7 -6
  46. package/dist/{cpfOcrManager-BWAxB7u-.d.ts → cpfOcrManager-B-VkoepP.d.ts} +22 -22
  47. package/dist/{cpfOcrManager-BxcgxvgO.esm.js → cpfOcrManager-Dpj_HlZe.esm.js} +6 -5
  48. package/dist/createFaceAvatar-CCD0HA4W.d.ts +394 -0
  49. package/dist/createFaceAvatar-D94d2jjL.esm.js +46 -0
  50. package/dist/cross-document-data-match.d.ts +1 -1
  51. package/dist/cross-document-data-match.esm.js +6 -5
  52. package/dist/curp-validation.d.ts +9 -7
  53. package/dist/curp-validation.esm.js +7 -6
  54. package/dist/{curpValidationManager-Bt6CVD8b.d.ts → curpValidationManager-5xtZ6QlA.d.ts} +3 -3
  55. package/dist/{curpValidationManager-BgLDw0Ub.esm.js → curpValidationManager-IqH8rIei.esm.js} +4 -3
  56. package/dist/{curpValidationStateMachine-BK_wJ48C.esm.js → curpValidationStateMachine-Cr2o6gEl.esm.js} +3 -3
  57. package/dist/custom-fields.d.ts +2 -2
  58. package/dist/custom-fields.esm.js +6 -5
  59. package/dist/custom-watchlist.d.ts +1 -1
  60. package/dist/custom-watchlist.esm.js +6 -5
  61. package/dist/{customWatchlistStateMachine-Bi4P59HM.esm.js → customWatchlistStateMachine-CTczBFAU.esm.js} +3 -3
  62. package/dist/{deepsightLoader-BMmvk0X6.esm.js → deepsightLoader-CjjkJx1c.esm.js} +15 -13
  63. package/dist/{deepsightService-CEZrdiW0.esm.js → deepsightService-Bu6z1_jl.esm.js} +8 -37
  64. package/dist/{deepsightService-ByNKY5Jv.d.ts → deepsightService-ek58P8wR.d.ts} +3 -72
  65. package/dist/device.esm.js +4 -4
  66. package/dist/document-capture.d.ts +235 -235
  67. package/dist/document-capture.esm.js +14 -13
  68. package/dist/document-upload.d.ts +50 -50
  69. package/dist/document-upload.esm.js +9 -8
  70. package/dist/{documentCaptureStateMachine-MpwpJO7t.esm.js → documentCaptureStateMachine-BPPxiBEI.esm.js} +7 -7
  71. package/dist/dynamic-forms.d.ts +2 -2
  72. package/dist/dynamic-forms.esm.js +7 -6
  73. package/dist/{dynamicFormsStateMachine-Do84A4uU.esm.js → dynamicFormsStateMachine-DXYYYnqM.esm.js} +4 -4
  74. package/dist/ekyb.d.ts +8 -6
  75. package/dist/ekyb.esm.js +20 -17
  76. package/dist/{ekybStateMachine-9tKuUA6e.esm.js → ekybStateMachine-9OxB2ALm.esm.js} +5 -5
  77. package/dist/ekyc.d.ts +3 -3
  78. package/dist/ekyc.esm.js +9 -8
  79. package/dist/{ekycStateMachine-DcynX0rj.esm.js → ekycStateMachine-M8Z7G5x4.esm.js} +5 -5
  80. package/dist/electronic-signature.d.ts +3 -3
  81. package/dist/electronic-signature.esm.js +9 -8
  82. package/dist/{electronicSignatureManager-B63aAuI5.esm.js → electronicSignatureManager--IIqwxf3.esm.js} +7 -6
  83. package/dist/email.d.ts +4 -4
  84. package/dist/email.esm.js +9 -8
  85. package/dist/{emailManager-DxHjAe5u.esm.js → emailManager-BzeQI0Vo.esm.js} +5 -4
  86. package/dist/{emailManager-C6D2u4mQ.d.ts → emailManager-hmA0Elfn.d.ts} +3 -3
  87. package/dist/{emailStateMachine-758f34gg.esm.js → emailStateMachine-BuoiLQJF.esm.js} +5 -5
  88. package/dist/{endpoints-BM2_j_IE.esm.js → endpoints-CJH8R79Q.esm.js} +4 -0
  89. package/dist/{events-DN-u67gb.esm.js → events-C5GpmPbS.esm.js} +2 -188
  90. package/dist/events.d.ts +1 -0
  91. package/dist/events.esm.js +3 -2
  92. package/dist/extensibility.d.ts +29 -25
  93. package/dist/extensibility.esm.js +65 -58
  94. package/dist/{externalFetch-crimxkN9.esm.js → externalFetch-DHzmXTlR.esm.js} +1 -1
  95. package/dist/face-match.d.ts +1 -1
  96. package/dist/face-match.esm.js +6 -5
  97. package/dist/faceCaptureManagerFactory-BLbVAxGM.d.ts +398 -0
  98. package/dist/{faceCaptureManagerFactory-BNXZchWX.esm.js → faceCaptureManagerFactory-C1OM3hCs.esm.js} +25 -16
  99. package/dist/{faceCaptureSetup-Dqb09D24.esm.js → faceCaptureSetup-BqYvT2de.esm.js} +97 -13
  100. package/dist/{faceMatchStateMachine-FikRaUZH.esm.js → faceMatchStateMachine-CrODY2X6.esm.js} +3 -3
  101. package/dist/field-comparison.d.ts +3 -3
  102. package/dist/field-comparison.esm.js +6 -5
  103. package/dist/{fieldComparisonManager-BXc6-DJv.d.ts → fieldComparisonManager-CvaG1tq6.d.ts} +2 -2
  104. package/dist/{fieldComparisonManager-Dic0DVgl.esm.js → fieldComparisonManager-n9Rz0az-.esm.js} +5 -4
  105. package/dist/fiscal-qr.d.ts +4 -3
  106. package/dist/fiscal-qr.esm.js +13 -12
  107. package/dist/flow-events.d.ts +8 -6
  108. package/dist/flow.d.ts +13 -11
  109. package/dist/flow.esm.js +21 -18
  110. package/dist/{flowCompletionService-D_CsiDZM.esm.js → flowCompletionService-CbGOzDDc.esm.js} +3 -3
  111. package/dist/{flowServices-DvpNlpPG.esm.js → flowServices-CG1KLhsN.esm.js} +4 -4
  112. package/dist/geolocation.d.ts +2 -2
  113. package/dist/geolocation.esm.js +7 -6
  114. package/dist/{geolocationStateMachine-BWjrMGS_.esm.js → geolocationStateMachine-D6afIT5B.esm.js} +4 -4
  115. package/dist/{getDeviceClass-rXKlXywy.esm.js → getDeviceClass-DF3rXlUY.esm.js} +1 -1
  116. package/dist/getDeviceData-CxHuJqz9.esm.js +101 -0
  117. package/dist/government-validation.d.ts +3 -3
  118. package/dist/government-validation.esm.js +8 -7
  119. package/dist/{governmentValidationStateMachine-BoF7U1of.esm.js → governmentValidationStateMachine-Cl_w7lDx.esm.js} +5 -5
  120. package/dist/home.d.ts +17 -15
  121. package/dist/home.esm.js +4 -3
  122. package/dist/http.esm.js +2 -2
  123. package/dist/id-ocr.d.ts +57 -57
  124. package/dist/id-ocr.esm.js +7 -6
  125. package/dist/id-verification.d.ts +27 -27
  126. package/dist/id-verification.esm.js +6 -5
  127. package/dist/id.d.ts +14 -11
  128. package/dist/id.esm.js +38 -32
  129. package/dist/{idCaptureManager-BompNgq8.esm.js → idCaptureManager-BWHXDmsp.esm.js} +7 -5
  130. package/dist/{idCaptureManager-BvGUSN2e.d.ts → idCaptureManager-BxmYAiCr.d.ts} +10 -7
  131. package/dist/{idCaptureStateMachine-Dhzgl3mX.esm.js → idCaptureStateMachine-DgwiwGTp.esm.js} +20 -19
  132. package/dist/{idOcrStateMachine-YMCDGplq.esm.js → idOcrStateMachine-CSnVfav-.esm.js} +5 -5
  133. package/dist/{idVerificationStateMachine-Bo1IYuZH.esm.js → idVerificationStateMachine-BYrQ6Ism.esm.js} +3 -3
  134. package/dist/identity-reuse.d.ts +3 -3
  135. package/dist/identity-reuse.esm.js +7 -6
  136. package/dist/{identityReuseManager-D0knIrOy.esm.js → identityReuseManager-BTBb6dNP.esm.js} +4 -3
  137. package/dist/{identityReuseManager-BAd_bDnZ.d.ts → identityReuseManager-DJUD1zYW.d.ts} +36 -36
  138. package/dist/{identityReuseStateMachine-CSQfZOqD.esm.js → identityReuseStateMachine-B-DkkQQG.esm.js} +3 -3
  139. package/dist/{index-CJ2M0GG9.d.ts → index-Btsz0iWy.d.ts} +169 -169
  140. package/dist/{index-CdqrfCh3.d.ts → index-DCAqU5Gu.d.ts} +2 -2
  141. package/dist/index.d.ts +3 -3
  142. package/dist/index.esm.js +17 -13
  143. package/dist/{invokeOnCaptureCallback-Dzemudhk.esm.js → invokeOnCaptureCallback-BuIOnlDE.esm.js} +1 -1
  144. package/dist/{lib-7ZQ9BdKH.esm.js → lib-BToFFxxd.esm.js} +1 -1
  145. package/dist/mandatory-consent.d.ts +9 -7
  146. package/dist/mandatory-consent.esm.js +7 -6
  147. package/dist/{mandatoryConsentManager-DzTXtPrr.d.ts → mandatoryConsentManager-BeWWbVnU.d.ts} +53 -53
  148. package/dist/{mandatoryConsentManager-Lon46nPQ.esm.js → mandatoryConsentManager-DOzIV_FJ.esm.js} +4 -3
  149. package/dist/{mandatoryConsentStateMachine-D_dZ7IF6.esm.js → mandatoryConsentStateMachine-_-BhToZb.esm.js} +3 -3
  150. package/dist/mediapipeShared-COY8pwRa.esm.js +67 -0
  151. package/dist/{recordingService-CxMJP4tQ.esm.js → onDeviceFaceResults-D8WDLBEo.esm.js} +64 -386
  152. package/dist/{openviduLazy-oAXXI9w_.esm.js → openviduLazy-BudLG7F2.esm.js} +2 -2
  153. package/dist/openviduLazy-DRlOk6Fa.esm.js +3 -0
  154. package/dist/{permissionGuards-D-Z-lgNj.esm.js → permissionGuards-BV5m2Z86.esm.js} +1 -1
  155. package/dist/{permissionServices-CPDboRoE.esm.js → permissionServices-Cc8lx66Z.esm.js} +3 -3
  156. package/dist/personhood.d.ts +531 -0
  157. package/dist/personhood.esm.js +1495 -0
  158. package/dist/phone.d.ts +4 -4
  159. package/dist/phone.esm.js +9 -8
  160. package/dist/{phoneManager-TSq1Ief6.d.ts → phoneManager-C6Go0zbQ.d.ts} +3 -3
  161. package/dist/{phoneManager-Blt4Oc2P.esm.js → phoneManager-Ss4F2DsU.esm.js} +5 -4
  162. package/dist/{phoneStateMachine-W3c6Z8sj.esm.js → phoneStateMachine-DTP4bnzW.esm.js} +5 -5
  163. package/dist/{qe-signature-CQLK6LKE.esm.js → qe-signature-0orRwkzA.esm.js} +1 -1
  164. package/dist/qe-signature.d.ts +3 -3
  165. package/dist/qe-signature.esm.js +10 -9
  166. package/dist/recordingService-IPWMXEFL.esm.js +374 -0
  167. package/dist/redirect-to-mobile.d.ts +3 -3
  168. package/dist/redirect-to-mobile.esm.js +9 -8
  169. package/dist/{redirectToMobileManager-yOHAmwg-.d.ts → redirectToMobileManager-BNyb1Snt.d.ts} +2 -2
  170. package/dist/{redirectToMobileManager-DCvpKdkD.esm.js → redirectToMobileManager-CivoSWZq.esm.js} +5 -4
  171. package/dist/{redirectToMobileStateMachine-DC9z4Vfu.esm.js → redirectToMobileStateMachine-DHUqKZFf.esm.js} +5 -5
  172. package/dist/{runChildModule-C9G0wfVC.esm.js → runChildModule-C1mLru0r.esm.js} +3 -3
  173. package/dist/selfie.d.ts +16 -12
  174. package/dist/selfie.esm.js +33 -28
  175. package/dist/{selfieManager-imY2dAcH.d.ts → selfieManager-6M1LjHJh.d.ts} +3 -3
  176. package/dist/{selfieManager-BRL6c_Oc.esm.js → selfieManager-qI7u7XbN.esm.js} +6 -6
  177. package/dist/{selfieStateMachine-D2Q0uwDK.esm.js → selfieStateMachine-CFAOkAVX.esm.js} +4 -4
  178. package/dist/{session-Be_IA1e0.esm.js → session-CSjmHjvS.esm.js} +3 -3
  179. package/dist/session.d.ts +7 -5
  180. package/dist/session.esm.js +17 -14
  181. package/dist/{sessionInitializer-BYi2q9WC.esm.js → sessionInitializer-CY3gDJ_h.esm.js} +11 -107
  182. package/dist/{setup-BJZAkajt.d.ts → setup-CBG8_-sJ.d.ts} +2 -2
  183. package/dist/{setup-Bk_aB8AH.esm.js → setup-CMXo0607.esm.js} +9 -534
  184. package/dist/signature.d.ts +2 -2
  185. package/dist/signature.esm.js +6 -5
  186. package/dist/{signatureStateMachine-DAxXmMrk.esm.js → signatureStateMachine-3spNUdNE.esm.js} +3 -3
  187. package/dist/{stats-DntyIiGr.esm.js → stats-s3hq1r1j.esm.js} +2 -2
  188. package/dist/stats.esm.js +3 -3
  189. package/dist/{tri-CtxWthxz.esm.js → tri-ByBCC5y2.esm.js} +2 -2
  190. package/dist/tri.d.ts +1 -1
  191. package/dist/{tri.esm-CrWAulDi.esm.js → tri.esm-DKh4PZHK.esm.js} +1 -1
  192. package/dist/tri.esm.js +2 -2
  193. package/dist/trust-graph.d.ts +3 -3
  194. package/dist/trust-graph.esm.js +4 -3
  195. package/dist/{types-Dv-9WPJX.d.ts → types-B5wtXkOy.d.ts} +35 -3
  196. package/dist/types-BmLWSDdq.esm.js +188 -0
  197. package/dist/{types-Z9wv19v2.d.ts → types-CzQBFW6W.d.ts} +1 -1
  198. package/dist/{types-DpTWgfKY.d.ts → types-DiIMjgm2.d.ts} +1 -1
  199. package/dist/video-CSEulBxm.esm.js +36 -0
  200. package/dist/wasm.d.ts +3 -3
  201. package/dist/wasm.esm.js +17 -13
  202. package/dist/watchlist-for-business.d.ts +1 -1
  203. package/dist/watchlist-for-business.esm.js +6 -5
  204. package/dist/watchlist.d.ts +1 -1
  205. package/dist/watchlist.esm.js +6 -5
  206. package/dist/{watchlistForBusinessStateMachine-DtefJb-D.esm.js → watchlistForBusinessStateMachine-DUnGwscI.esm.js} +3 -3
  207. package/dist/{watchlistStateMachine-B0aIS2_n.esm.js → watchlistStateMachine-D6x4BABN.esm.js} +3 -3
  208. package/dist/workflow.d.ts +112 -110
  209. package/dist/workflow.esm.js +72 -66
  210. package/package.json +13 -3
  211. package/dist/faceCaptureManagerFactory-CL-7T_vH.d.ts +0 -731
  212. package/dist/openviduLazy-B_s6jnEk.esm.js +0 -3
  213. /package/dist/{Actor-fIPLXfoi.d.ts → Actor-D0X2YV92.d.ts} +0 -0
  214. /package/dist/{BrowserTimerProvider-BVgutW_b.esm.js → BrowserTimerProvider-Dp6Dvq18.esm.js} +0 -0
  215. /package/dist/{ITimerCapability-BvH0pDwp.esm.js → ITimerCapability-Cqq9AIfp.esm.js} +0 -0
  216. /package/dist/{Manager-B2OEDYqf.d.ts → Manager-BV5ZkaGs.d.ts} +0 -0
  217. /package/dist/{MotionSensorProvider-C9fPAJdS.esm.js → MotionSensorProvider-DIBb_60H.esm.js} +0 -0
  218. /package/dist/{WasmUtilProvider-CIu373BZ.esm.js → WasmUtilProvider-DKxRt6ZI.esm.js} +0 -0
  219. /package/dist/{apiError-D-GTvFrH.esm.js → apiError-CFVRvReX.esm.js} +0 -0
  220. /package/dist/{browser-DlFgHpoC-7tbRR1aR.esm.js → browser-DlFgHpoC-CTDo0MZI.esm.js} +0 -0
  221. /package/dist/{camera-biGPWlmx.d.ts → camera-CE_iClyf.d.ts} +0 -0
  222. /package/dist/{camera-x4LjGTjZ.esm.js → camera-Kk9gT8I8.esm.js} +0 -0
  223. /package/dist/{canvas-7uX2izHb.esm.js → canvas-CYuviOmq.esm.js} +0 -0
  224. /package/dist/{chunk-BK1xu56N.esm.js → chunk-DWboWZWR.esm.js} +0 -0
  225. /package/dist/{cpf-xBg-DFNn.esm.js → cpf-DxC8njkD.esm.js} +0 -0
  226. /package/dist/{dateUtils-8dCcuArE.esm.js → dateUtils-GSUTCu5W.esm.js} +0 -0
  227. /package/dist/{flowCompletionService-W_gSMyD5.d.ts → flowCompletionService-CYN44D74.d.ts} +0 -0
  228. /package/dist/{getBrowser-Dv8LZyHE.esm.js → getBrowser-THrm1MWD.esm.js} +0 -0
  229. /package/dist/{getDeviceClass-C0zrM97a.esm.js → getDeviceClass-BsWQ9mVm.esm.js} +0 -0
  230. /package/dist/{http-CfVTgMfU.esm.js → http-BnPz8fHx.esm.js} +0 -0
  231. /package/dist/{index-52_qi4bd.d.ts → index-B0ZPExIF.d.ts} +0 -0
  232. /package/dist/{otp-BHJnjEEc.d.ts → otp-D3JAuulv.d.ts} +0 -0
  233. /package/dist/{otp-D87RTwrx.esm.js → otp-DoLw7vGV.esm.js} +0 -0
  234. /package/dist/{platform-BfoqeM61.esm.js → platform-CwFB3DeY.esm.js} +0 -0
  235. /package/dist/{types-BdVOWGGW.esm.js → types-BYdJ3Mc2.esm.js} +0 -0
  236. /package/dist/{types-DYZja-k9.d.ts → types-CoMD38x7.d.ts} +0 -0
  237. /package/dist/{types-F0IXbaCB.d.ts → types-Dzi_YW-0.d.ts} +0 -0
  238. /package/dist/{urlUtils-8RNHyW3x.esm.js → urlUtils-i6O-S_Eb.esm.js} +0 -0
  239. /package/dist/{warmup--6HA3yUR.d.ts → warmup-BPFiCw6Z.d.ts} +0 -0
  240. /package/dist/{xstate.esm-Dkm1jy5u.esm.js → xstate.esm-MXSDq4yW.esm.js} +0 -0
@@ -0,0 +1,248 @@
1
+ import { n as WasmPipeline } from "./warmup-BPFiCw6Z.js";
2
+ import { a as AvatarAssetsOverrides, c as FaceAttributesThresholds, d as FaceDetectionCallbacks, f as FaceDetectionConfig, h as IFaceDetectionCapability, l as FaceChecksConfig, m as FacePositionConstraints, p as FaceDetectionThresholds, v as WebApiHostRequestConfig } from "./createFaceAvatar-CCD0HA4W.js";
3
+ import { n as Flow, s as SelfieConcealmentOption } from "./types-B5wtXkOy.js";
4
+ import { a as IStorageCapability, n as IWasmUtilCapability, o as IRecordingCapability } from "./deepsightService-ek58P8wR.js";
5
+
6
+ //#region src/internal/faceCapture/types.d.ts
7
+
8
+ type CameraResolution = {
9
+ width?: number;
10
+ height?: number;
11
+ };
12
+ /**
13
+ * Rich captured face payload delivered via `onCapture` in the selfie
14
+ * captureOnly flow.
15
+ */
16
+ type FaceCapturedImageData = {
17
+ imageBase64: string;
18
+ blob: Blob;
19
+ url: string;
20
+ metadata: string;
21
+ /**
22
+ * Populated when local video recording is active
23
+ * (`enableFaceRecording === true` with `LocalRecordingService`).
24
+ * `undefined` when video recording is disabled, when the provider is
25
+ * OpenVidu (remote server-side recording), or when video assembly fails.
26
+ *
27
+ * Delivered as raw base64 (not encrypted via WASM `ens()` like the regular
28
+ * flow). Integrators receiving this are responsible for handling it as
29
+ * sensitive biometric data.
30
+ */
31
+ videoBase64: string | undefined;
32
+ };
33
+ /**
34
+ * Payload delivered to `SelfieCaptureOnlyConfig.onCapture`.
35
+ */
36
+ type FaceCaptureOnlyResponse = {
37
+ image: FaceCapturedImageData;
38
+ };
39
+ type BaseFaceCaptureConfig = {
40
+ showTutorial: boolean;
41
+ showPreview?: boolean;
42
+ assistedOnboarding?: boolean;
43
+ enableFaceRecording?: boolean;
44
+ autoCaptureTimeout: number;
45
+ captureAttempts?: number;
46
+ numberOfAttempts?: number;
47
+ validateLenses?: boolean;
48
+ validateFaceMask?: boolean;
49
+ validateHeadCover?: boolean;
50
+ validateClosedEyes?: boolean;
51
+ validateBrightness?: boolean;
52
+ deepsightLiveness?: 'SINGLE_FRAME' | 'MULTIMODAL' | 'VIDEOLIVENESS';
53
+ cameraResolution?: CameraResolution;
54
+ ageAssurance?: boolean;
55
+ recording?: {
56
+ capability?: IRecordingCapability;
57
+ };
58
+ ds?: Flow['ds'];
59
+ /**
60
+ * When true, face analysis runs on-device via the OnDevice WASM workflow
61
+ * (6 models) and only the results JSON is submitted to the backend
62
+ * (`/omni/add/face-results`). Recording is skipped entirely. Used by both
63
+ * SELFIE and AUTHENTICATION modules.
64
+ *
65
+ * **Requires E2EE.** The on-device face-results endpoint is only served on
66
+ * the E2EE-provisioned host. Configure `setup()` with the dedicated E2EE
67
+ * `apiURL` and `encryption: true` — see the `encryption` option on
68
+ * `SetupOptions`. Without it, `/omni/add/face-results` will fail.
69
+ */
70
+ onDeviceFaceResultsSubmissionEnabled?: boolean;
71
+ /**
72
+ * Cosmetic-only face concealment for the capture screen. The backend sends
73
+ * this single option on the SELFIE/AUTHENTICATION node config; the SDK derives
74
+ * which avatar (if any) conceals the live preview from it. A **display** change
75
+ * only — autocapture, quality, liveness, age and upload keep running on the
76
+ * real frames. The heavy avatar runtime (MediaPipe + three) is lazy-loaded only
77
+ * when an avatar is selected.
78
+ * - `OPTION_NONE` (or absent) — the live video, no avatar.
79
+ * - `OPTION_SILHOUETTE` — frosted-glass WebGL lens over the real video.
80
+ * - `OPTION_2D` — stylized 2D face (also the personhood avatar).
81
+ * - `OPTION_3D` — 3D VRM character.
82
+ * See docs/features/FACE_AVATAR.md.
83
+ */
84
+ selfieConcealmentOption?: SelfieConcealmentOption;
85
+ /**
86
+ * Optional overrides for where the avatar runtime assets (MediaPipe wasm,
87
+ * face-landmarker model, `.vrm`) are fetched from. Defaults to the bundled CDN
88
+ * layout. Only relevant when `selfieConcealmentOption` selects an avatar.
89
+ */
90
+ avatarAssets?: AvatarAssetsOverrides;
91
+ };
92
+ type FaceCaptureDependencies = {
93
+ storage: IStorageCapability;
94
+ getWasmUtil: () => Promise<IWasmUtilCapability>;
95
+ trackCaptureAttemptFinished?: (payload: {
96
+ logs: string;
97
+ }) => void;
98
+ };
99
+ type DetectionStatus = 'idle' | 'detecting' | 'noFace' | 'tooManyFaces' | 'tooClose' | 'tooFar' | 'blur' | 'dark' | 'tooBright' | 'faceAngle' | 'lookAtCamera' | 'headWear' | 'lenses' | 'eyesClosed' | 'faceMask' | 'faceOcclusion' | 'centerFace' | 'moveLeft' | 'moveRight' | 'manualCapture' | 'success' | 'error' | 'capturing' | 'getReady' | 'getReadyFinished' | 'offline';
100
+ declare const FACE_ERROR_CODES: {
101
+ readonly FACE_OCCLUDED: "FACE_OCCLUDED";
102
+ readonly LIVENESS: "LIVENESS_ERROR";
103
+ readonly BRIGHTNESS: "BRIGHTNESS_ERROR";
104
+ readonly LENSES: "LENSES_ERROR";
105
+ readonly MASK: "MASK_ERROR";
106
+ readonly CLOSED_EYES: "CLOSED_EYES_ERROR";
107
+ readonly HEAD_COVER: "HEAD_COVER_ERROR";
108
+ readonly SERVER: "SERVER_ERROR";
109
+ readonly FACE_NOT_FOUND: "FACE_NOT_FOUND";
110
+ readonly MULTIPLE_FACES: "MULTIPLE_FACES";
111
+ readonly TOO_BLURRY: "TOO_BLURRY_ERROR";
112
+ readonly TOO_DARK: "TOO_DARK_ERROR";
113
+ readonly USER_IS_NOT_RECOGNIZED: "USER_IS_NOT_RECOGNIZED";
114
+ readonly SPOOF_ATTEMPT_DETECTED: "SPOOF_ATTEMPT_DETECTED";
115
+ readonly FACE_TOO_DARK: "FACE_TOO_DARK";
116
+ readonly LENSES_DETECTED: "LENSES_DETECTED";
117
+ readonly FACE_MASK_DETECTED: "FACE_MASK_DETECTED";
118
+ readonly CLOSED_EYES_DETECTED: "CLOSED_EYES_DETECTED";
119
+ readonly HEAD_COVER_DETECTED: "HEAD_COVER_DETECTED";
120
+ readonly FACE_CROPPING_FAILED: "FACE_CROPPING_FAILED";
121
+ readonly FACE_TOO_SMALL: "FACE_TOO_SMALL";
122
+ readonly FACE_TOO_BLURRY: "FACE_TOO_BLURRY";
123
+ readonly BAD_PHOTO_QUALITY: "BAD_PHOTO_QUALITY";
124
+ readonly PROCESSING_ERROR: "PROCESSING_ERROR";
125
+ readonly BAD_REQUEST: "BAD_REQUEST";
126
+ readonly NONEXISTENT_CUSTOMER: "NONEXISTENT_CUSTOMER";
127
+ readonly HINT_NOT_PROVIDED: "HINT_NOT_PROVIDED";
128
+ readonly SELFIE_IMAGE_LOW_QUALITY: "SELFIE_IMAGE_LOW_QUALITY";
129
+ readonly NO_MORE_ATTEMPTS: "NO_MORE_ATTEMPTS";
130
+ };
131
+ type FaceErrorCode = (typeof FACE_ERROR_CODES)[keyof typeof FACE_ERROR_CODES];
132
+ //#endregion
133
+ //#region ../infra/src/wasm/WasmPipelineType.d.ts
134
+ declare enum WasmPipelineType {
135
+ IdBlurGlarePipeline = 0,
136
+ IdBarcodeAndTextQualityPipeline = 1,
137
+ IdVideoSelfiePipeline = 2,
138
+ SelfieWithAggregationMetrics = 3,
139
+ SelfieWithQualityMetrics = 4,
140
+ OnDeviceSelfieWorkflow = 5,
141
+ }
142
+ //#endregion
143
+ //#region ../infra/src/providers/wasm/BaseWasmProvider.d.ts
144
+ /**
145
+ * Base configuration for WASM providers
146
+ */
147
+ interface BaseWasmConfig {
148
+ /** Path to the WASM binary */
149
+ wasmPath?: string;
150
+ /** Path to the SIMD-optimized WASM binary (optional) */
151
+ wasmSimdPath?: string;
152
+ /** Path to the WASM glue code (paired with `wasmPath`) */
153
+ glueCodePath?: string;
154
+ /**
155
+ * Path to the SIMD-optimized WASM glue code (paired with `wasmSimdPath`).
156
+ * If omitted, defaults to a sibling `.js` derived from `wasmSimdPath`.
157
+ */
158
+ glueCodeSimdPath?: string;
159
+ /** Whether to use SIMD optimizations (default: true) */
160
+ useSimd?: boolean;
161
+ /**
162
+ * Base path for ML model files. Models will be loaded from `${modelsBasePath}/${modelFileName}`.
163
+ * If not provided, models are expected in a 'models' subdirectory relative to the WASM binary.
164
+ */
165
+ modelsBasePath?: string;
166
+ }
167
+ /**
168
+ * Base provider class that abstracts common WASM functionality.
169
+ * This serves as a foundation for specific ML capability providers
170
+ * like FaceDetectionProvider and IdCaptureProvider.
171
+ */
172
+ declare abstract class BaseWasmProvider {
173
+ private _isInitialized;
174
+ protected pipelineType: WasmPipelineType | undefined;
175
+ /**
176
+ * Creates a new BaseWasmProvider
177
+ * @param pipelineType - The WASM pipeline type this provider uses
178
+ */
179
+ constructor(pipelineType?: WasmPipelineType);
180
+ /**
181
+ * Returns whether this provider has been initialized.
182
+ */
183
+ get initialized(): boolean;
184
+ protected getPipelineType(): WasmPipelineType;
185
+ /**
186
+ * Initializes the provider by ensuring WASM is loaded
187
+ * @param config - Provider configuration
188
+ * @param pipeline - The pipeline type to warm up ('selfie', 'idCapture', etc.)
189
+ */
190
+ protected initializeBase(config: BaseWasmConfig, pipeline: WasmPipeline): Promise<void>;
191
+ /**
192
+ * Ensures the provider is initialized before performing operations.
193
+ * @throws Error if not initialized
194
+ */
195
+ protected ensureInitialized(): void;
196
+ /**
197
+ * Processes a frame through the WASM pipeline
198
+ * @param image - Image data to process
199
+ * @returns The pipeline result (type depends on pipeline - WASM returns any)
200
+ */
201
+ protected processFrameWasm(image: ImageData): Promise<any>;
202
+ abstract processFrame(image: ImageData): Promise<void>;
203
+ /**
204
+ * Resets the pipeline to its initial state.
205
+ * Safe to call even if not initialized (no-op in that case).
206
+ */
207
+ reset(): void;
208
+ /**
209
+ * Disposes of resources and resets initialization state.
210
+ * Safe to call even if not initialized.
211
+ */
212
+ dispose(): Promise<void>;
213
+ }
214
+ //#endregion
215
+ //#region ../infra/src/providers/wasm/FaceDetectionProvider.d.ts
216
+ declare class FaceDetectionProvider extends BaseWasmProvider implements IFaceDetectionCapability {
217
+ private defaultThresholds;
218
+ private currentThresholds;
219
+ private currentFrame;
220
+ private onFaceDataCallback;
221
+ constructor();
222
+ processFrame(image: ImageData): Promise<void>;
223
+ initialize(config: FaceDetectionConfig): Promise<void>;
224
+ /**
225
+ * Last-registered onCapture callback — captured into a private
226
+ * field so `forceCapture()` (called from outside the WASM-callback
227
+ * lifecycle) can re-fire the same wrapper. `setCallbacks` rebinds
228
+ * this on each invocation, so the field always reflects the
229
+ * current consumer.
230
+ */
231
+ private currentOnCaptureWrapper;
232
+ processPhoto(canvas: HTMLCanvasElement): void;
233
+ postFaceResults(config?: WebApiHostRequestConfig): Promise<unknown>;
234
+ setCallbacks(callbacks: FaceDetectionCallbacks): void;
235
+ setPositionConstraints(constraints: FacePositionConstraints): void;
236
+ applyDefaults(autocaptureInterval?: number): void;
237
+ setAutocaptureInterval(interval: number): void;
238
+ setThresholds(thresholds: FaceDetectionThresholds): void;
239
+ setAttributesThresholds(thresholds: FaceAttributesThresholds): void;
240
+ setChecksEnabled(config: FaceChecksConfig): void;
241
+ setVideoSelfieMode(enabled: boolean): void;
242
+ forceCapture(): void;
243
+ reset(): void;
244
+ private createDefaultFaceCoordinates;
245
+ private formatFaceCoordinates;
246
+ }
247
+ //#endregion
248
+ export { FaceCaptureDependencies as a, FaceErrorCode as c, DetectionStatus as i, BaseWasmProvider as n, FaceCaptureOnlyResponse as o, BaseFaceCaptureConfig as r, FaceCapturedImageData as s, FaceDetectionProvider as t };
@@ -0,0 +1,12 @@
1
+ //#region ../infra/src/capabilities/IVisibilityObserverCapability.d.ts
2
+ type IVisibilityObserverCapability = {
3
+ /**
4
+ * Whether the document is currently visible. Lets the orchestrator seed its
5
+ * dedupe state and emit an initial `background` when a session starts while
6
+ * the tab is already hidden (e.g. the SDK is opened in a background tab).
7
+ */
8
+ isVisible(): boolean;
9
+ onVisibilityChange(listener: (visible: boolean) => void): () => void;
10
+ };
11
+ //#endregion
12
+ export { IVisibilityObserverCapability as t };
@@ -0,0 +1,51 @@
1
+ //#region ../infra/src/providers/browser/IpifyProvider.ts
2
+ let cachedIp;
3
+ let inFlightLookup;
4
+ /**
5
+ * Resets the module-level IP cache. Intended for tests and full session resets.
6
+ */
7
+ function resetIpifyCache() {
8
+ cachedIp = void 0;
9
+ inFlightLookup = void 0;
10
+ }
11
+ async function fetchIpFromIpify() {
12
+ if (typeof fetch === "undefined") return "";
13
+ let timeoutId = 0;
14
+ const controller = new AbortController();
15
+ if (AbortSignal.timeout) {
16
+ const signal = AbortSignal.timeout(3e3);
17
+ return (await (await fetch("https://api.ipify.org?format=json", { signal })).json()).ip;
18
+ }
19
+ const timeoutPromise = new Promise((_, reject) => {
20
+ timeoutId = setTimeout(() => {
21
+ controller.abort();
22
+ reject(/* @__PURE__ */ new Error("Request timeout"));
23
+ }, 3e3);
24
+ });
25
+ const fetchPromise = fetch("https://api.ipify.org?format=json", { signal: controller.signal }).then((res) => res.json()).then((data) => data.ip);
26
+ const result = await Promise.race([fetchPromise, timeoutPromise]);
27
+ clearTimeout(timeoutId);
28
+ return result;
29
+ }
30
+ var IpifyProvider = class {
31
+ async getIp() {
32
+ if (cachedIp !== void 0) return cachedIp;
33
+ if (inFlightLookup) return inFlightLookup;
34
+ inFlightLookup = (async () => {
35
+ try {
36
+ const ip = await fetchIpFromIpify();
37
+ cachedIp = ip;
38
+ return ip;
39
+ } catch {
40
+ cachedIp = "";
41
+ return "";
42
+ } finally {
43
+ inFlightLookup = void 0;
44
+ }
45
+ })();
46
+ return inFlightLookup;
47
+ }
48
+ };
49
+
50
+ //#endregion
51
+ export { resetIpifyCache as n, IpifyProvider as t };
@@ -1,4 +1,4 @@
1
- import { t as loadOpenVidu } from "./openviduLazy-oAXXI9w_.esm.js";
1
+ import { t as loadOpenVidu } from "./openviduLazy-BudLG7F2.esm.js";
2
2
 
3
3
  //#region ../infra/src/providers/browser/OpenViduRecordingProvider.ts
4
4
  function createHiddenContainer() {
@@ -0,0 +1,339 @@
1
+ import { t as createHiddenVideoElement } from "./video-CSEulBxm.esm.js";
2
+
3
+ //#region ../infra/src/avatar/privacy-lens/privacyLensShaders.ts
4
+ /** Starting point; tuned live via the privacy-lens demo sliders. */
5
+ const PRIVACY_LENS_DEFAULTS = {
6
+ frost: .55,
7
+ sandblast: .28,
8
+ grainSize: .5,
9
+ brightness: 1.12,
10
+ shadowLift: .12,
11
+ warmth: .5,
12
+ sun: .71,
13
+ sunSpeed: .26
14
+ };
15
+ const PRIVACY_LENS_VERT = `
16
+ attribute vec2 aPos;
17
+ varying vec2 vUv;
18
+ void main() {
19
+ vUv = aPos * 0.5 + 0.5;
20
+ gl_Position = vec4(aPos, 0.0, 1.0);
21
+ }`;
22
+ const PRIVACY_LENS_FRAG = `
23
+ // The grain hash (h21 below) feeds large gl_FragCoord-derived values through
24
+ // sin()*43758.5 — that overflows mediump's range on many mobile GPUs and
25
+ // collapses the grain to a flat artifact. Use highp where available (all WebGL2
26
+ // and most WebGL1 devices); fall back to mediump on the rare device without it.
27
+ #ifdef GL_FRAGMENT_PRECISION_HIGH
28
+ precision highp float;
29
+ #else
30
+ precision mediump float;
31
+ #endif
32
+ varying vec2 vUv;
33
+ uniform sampler2D uVideo;
34
+ uniform vec2 uRes; // canvas pixel size (square)
35
+ uniform vec2 uVideoRes; // decoded video pixel size
36
+ uniform float uTime; // seconds (sun drift only)
37
+ uniform float uFrost;
38
+ uniform float uSandblast;
39
+ uniform float uGrainSize;
40
+ uniform float uWarmth;
41
+ uniform float uBright;
42
+ uniform float uShadow;
43
+ uniform float uSun;
44
+ uniform float uSunSpeed;
45
+
46
+ // Static per-cell hash — NO time term, so the grain is a fixed matte surface.
47
+ float h21(vec2 p) {
48
+ return fract(sin(dot(p, vec2(127.1, 311.7))) * 43758.5453123);
49
+ }
50
+
51
+ // Cover-fit the (non-square) video into the square output, centre-cropped, so
52
+ // faces are never stretched.
53
+ vec2 coverUv(vec2 uv) {
54
+ float va = uVideoRes.x / max(uVideoRes.y, 1.0);
55
+ vec2 o = uv;
56
+ if (va > 1.0) o.x = (uv.x - 0.5) / va + 0.5; // landscape: crop sides
57
+ else o.y = (uv.y - 0.5) * va + 0.5; // portrait: crop top/bottom
58
+ return o;
59
+ }
60
+
61
+ const int N = 12;
62
+
63
+ void main() {
64
+ vec2 uv = vUv;
65
+ vec2 base = coverUv(uv);
66
+ float aspect = uRes.y / max(uRes.x, 1.0);
67
+
68
+ // Per-fragment static seed, clustered into grain cells. Small cells = ultra
69
+ // fine sandblast (effectively invisible pattern); larger = coarser frosting.
70
+ vec2 cell = floor(gl_FragCoord.xy / max(uGrainSize, 0.5));
71
+ float rnd = h21(cell);
72
+ float baseAngle = rnd * 6.2831853;
73
+
74
+ // Stochastic sandblasted scatter: an even golden-angle disk, but each pixel
75
+ // cell rotates + jitters the kernel differently → a fine matte grain rather
76
+ // than a smooth blur. The video moves UNDER this fixed glass grain.
77
+ vec3 col = vec3(0.0);
78
+ for (int i = 0; i < N; i++) {
79
+ float fi = float(i) + 0.5;
80
+ float ang = baseAngle + fi * 2.399963; // golden angle
81
+ float rad = sqrt(fi / float(N)); // even area coverage 0..1
82
+ float j = h21(cell + vec2(fi * 7.13, fi * 3.71));
83
+ float r = uFrost * 0.06 * rad + (j - 0.5) * uSandblast * 0.03;
84
+ vec2 off = vec2(cos(ang), sin(ang)) * r;
85
+ off.x *= aspect;
86
+ col += texture2D(uVideo, base + off).rgb;
87
+ }
88
+ col /= float(N);
89
+
90
+ // Airy + warm grade (luminous frosted glass, not murky).
91
+ col = col + uShadow * (1.0 - col);
92
+ col *= uBright;
93
+ vec3 warm = vec3(1.0, 0.92, 0.80);
94
+ col = mix(col, col * warm + vec3(0.03, 0.015, 0.0), uWarmth);
95
+
96
+ // Drifting sun: a broad soft glow + a fine STATIC sparkle (per-cell) that
97
+ // catches the ground-glass grain only where the light falls — not all-over.
98
+ vec2 sun = vec2(0.34 + 0.16 * sin(uTime * uSunSpeed),
99
+ 0.26 + 0.10 * cos(uTime * uSunSpeed * 0.8));
100
+ float glow = smoothstep(0.7, 0.0, distance(uv, sun));
101
+ vec3 sunCol = vec3(1.0, 0.96, 0.88);
102
+ col += sunCol * glow * (0.20 + (rnd - 0.5) * 0.18 * uSandblast) * uSun;
103
+
104
+ gl_FragColor = vec4(clamp(col, 0.0, 1.0), 1.0);
105
+ }`;
106
+
107
+ //#endregion
108
+ //#region ../infra/src/avatar/privacy-lens/PrivacyLensProvider.ts
109
+ /**
110
+ * Privacy-lens avatar — sandblasted-glass effect over the **real** selfie video.
111
+ * **Self-contained** (see FACE_AVATAR.md → Isolation and ownership). No MediaPipe, no landmarks, no
112
+ * three/VRM, no npm deps, no textures but the live video — just a raw-WebGL
113
+ * fragment shader run on the video each frame (see `privacyLensShaders.ts`).
114
+ *
115
+ * Implements `IFaceAvatarCapability` (the generic `start/getCanvas/stop`
116
+ * contract) so it rides the existing concealment seam
117
+ * (`selfieConcealmentOption: 'OPTION_SILHOUETTE'`). The UI swaps the live `<Video>` for this
118
+ * canvas exactly as it does for the other avatars. Cosmetic-only: the authoritative
119
+ * pipeline still runs on the real frames; this only changes what is *displayed*.
120
+ *
121
+ * Mirroring is the UI's job (CSS), like every other provider — the shader
122
+ * renders forward.
123
+ */
124
+ const DEFAULT_MAX_FPS = 30;
125
+ const RENDER_SIZE = 512;
126
+ const asRvfc = (video) => {
127
+ const v = video;
128
+ return typeof v.requestVideoFrameCallback === "function" && typeof v.cancelVideoFrameCallback === "function" ? v : null;
129
+ };
130
+ const readParams = () => {
131
+ if (typeof window === "undefined") return PRIVACY_LENS_DEFAULTS;
132
+ const override = window.__incodePrivacyLensParams;
133
+ return override ? {
134
+ ...PRIVACY_LENS_DEFAULTS,
135
+ ...override
136
+ } : PRIVACY_LENS_DEFAULTS;
137
+ };
138
+ var PrivacyLensProvider = class {
139
+ constructor() {
140
+ this.gl = null;
141
+ this.program = null;
142
+ this.quad = null;
143
+ this.videoTex = null;
144
+ this.uniforms = /* @__PURE__ */ new Map();
145
+ this.videoHandle = null;
146
+ this.rafId = null;
147
+ this.rvfcHandle = null;
148
+ this.usingRvfc = false;
149
+ this.stopped = false;
150
+ this.lastFrameAt = 0;
151
+ this.minFrameIntervalMs = 1e3 / DEFAULT_MAX_FPS;
152
+ this.startTime = 0;
153
+ this.loop = (now) => {
154
+ if (this.stopped) return;
155
+ this.scheduleNextFrame();
156
+ if (now - this.lastFrameAt < this.minFrameIntervalMs) return;
157
+ this.lastFrameAt = now;
158
+ const gl = this.gl;
159
+ const video = this.videoHandle?.element;
160
+ if (!gl || !this.program) return;
161
+ if (!video || video.readyState < 2 || !video.videoWidth) {
162
+ gl.clear(gl.COLOR_BUFFER_BIT);
163
+ return;
164
+ }
165
+ gl.activeTexture(gl.TEXTURE0);
166
+ gl.bindTexture(gl.TEXTURE_2D, this.videoTex);
167
+ gl.texImage2D(gl.TEXTURE_2D, 0, gl.RGBA, gl.RGBA, gl.UNSIGNED_BYTE, video);
168
+ const p = readParams();
169
+ const setF = (name, value) => {
170
+ const loc = this.uniforms.get(name);
171
+ if (loc) gl.uniform1f(loc, value);
172
+ };
173
+ const set2 = (name, x, y) => {
174
+ const loc = this.uniforms.get(name);
175
+ if (loc) gl.uniform2f(loc, x, y);
176
+ };
177
+ set2("uRes", RENDER_SIZE, RENDER_SIZE);
178
+ set2("uVideoRes", video.videoWidth, video.videoHeight);
179
+ setF("uTime", (now - this.startTime) / 1e3);
180
+ setF("uFrost", p.frost);
181
+ setF("uSandblast", p.sandblast);
182
+ setF("uGrainSize", p.grainSize);
183
+ setF("uWarmth", p.warmth);
184
+ setF("uBright", p.brightness);
185
+ setF("uShadow", p.shadowLift);
186
+ setF("uSun", p.sun);
187
+ setF("uSunSpeed", p.sunSpeed);
188
+ gl.drawArrays(gl.TRIANGLE_STRIP, 0, 4);
189
+ };
190
+ this.canvas = document.createElement("canvas");
191
+ this.canvas.width = RENDER_SIZE;
192
+ this.canvas.height = RENDER_SIZE;
193
+ }
194
+ getCanvas() {
195
+ return this.canvas;
196
+ }
197
+ async start(stream, options = {}) {
198
+ this.minFrameIntervalMs = 1e3 / (options.maxFps ?? DEFAULT_MAX_FPS);
199
+ this.videoHandle = createHiddenVideoElement(stream, { keepStreamAlive: true });
200
+ try {
201
+ this.initGl();
202
+ if (this.stopped) return;
203
+ this.startTime = performance.now();
204
+ const video = this.videoHandle.element;
205
+ this.usingRvfc = !!asRvfc(video);
206
+ this.scheduleNextFrame();
207
+ } catch (error) {
208
+ this.stop();
209
+ throw error;
210
+ }
211
+ return Promise.resolve();
212
+ }
213
+ stop() {
214
+ this.stopped = true;
215
+ if (this.rafId != null) {
216
+ cancelAnimationFrame(this.rafId);
217
+ this.rafId = null;
218
+ }
219
+ const video = this.videoHandle?.element;
220
+ if (video && this.rvfcHandle != null) {
221
+ asRvfc(video)?.cancelVideoFrameCallback(this.rvfcHandle);
222
+ this.rvfcHandle = null;
223
+ }
224
+ const gl = this.gl;
225
+ if (gl) {
226
+ if (this.program) gl.deleteProgram(this.program);
227
+ if (this.quad) gl.deleteBuffer(this.quad);
228
+ if (this.videoTex) gl.deleteTexture(this.videoTex);
229
+ gl.getExtension("WEBGL_lose_context")?.loseContext();
230
+ }
231
+ this.program = null;
232
+ this.quad = null;
233
+ this.videoTex = null;
234
+ this.gl = null;
235
+ this.videoHandle?.dispose();
236
+ this.videoHandle = null;
237
+ }
238
+ initGl() {
239
+ const gl = this.canvas.getContext("webgl", {
240
+ alpha: false,
241
+ antialias: false,
242
+ premultipliedAlpha: false,
243
+ preserveDrawingBuffer: false
244
+ }) ?? this.canvas.getContext("experimental-webgl");
245
+ if (!gl) throw new Error("PrivacyLensProvider: WebGL is not available");
246
+ this.gl = gl;
247
+ const program = this.buildProgram(gl, PRIVACY_LENS_VERT, PRIVACY_LENS_FRAG);
248
+ this.program = program;
249
+ gl.useProgram(program);
250
+ const quad = gl.createBuffer();
251
+ gl.bindBuffer(gl.ARRAY_BUFFER, quad);
252
+ gl.bufferData(gl.ARRAY_BUFFER, new Float32Array([
253
+ -1,
254
+ -1,
255
+ 1,
256
+ -1,
257
+ -1,
258
+ 1,
259
+ 1,
260
+ 1
261
+ ]), gl.STATIC_DRAW);
262
+ const aPos = gl.getAttribLocation(program, "aPos");
263
+ gl.enableVertexAttribArray(aPos);
264
+ gl.vertexAttribPointer(aPos, 2, gl.FLOAT, false, 0, 0);
265
+ this.quad = quad;
266
+ this.videoTex = this.makeTexture(gl, gl.CLAMP_TO_EDGE);
267
+ gl.pixelStorei(gl.UNPACK_FLIP_Y_WEBGL, true);
268
+ for (const name of [
269
+ "uVideo",
270
+ "uRes",
271
+ "uVideoRes",
272
+ "uTime",
273
+ "uFrost",
274
+ "uSandblast",
275
+ "uGrainSize",
276
+ "uWarmth",
277
+ "uBright",
278
+ "uShadow",
279
+ "uSun",
280
+ "uSunSpeed"
281
+ ]) this.uniforms.set(name, gl.getUniformLocation(program, name));
282
+ gl.uniform1i(this.uniforms.get("uVideo") ?? null, 0);
283
+ gl.viewport(0, 0, RENDER_SIZE, RENDER_SIZE);
284
+ gl.clearColor(.88, .86, .83, 1);
285
+ }
286
+ buildProgram(gl, vertSrc, fragSrc) {
287
+ const compile = (type, src) => {
288
+ const shader = gl.createShader(type);
289
+ if (!shader) throw new Error("PrivacyLensProvider: createShader failed");
290
+ gl.shaderSource(shader, src);
291
+ gl.compileShader(shader);
292
+ if (!gl.getShaderParameter(shader, gl.COMPILE_STATUS)) {
293
+ const log = gl.getShaderInfoLog(shader);
294
+ gl.deleteShader(shader);
295
+ throw new Error(`PrivacyLensProvider: shader compile failed: ${log}`);
296
+ }
297
+ return shader;
298
+ };
299
+ const vs = compile(gl.VERTEX_SHADER, vertSrc);
300
+ const fs = compile(gl.FRAGMENT_SHADER, fragSrc);
301
+ const program = gl.createProgram();
302
+ if (!program) throw new Error("PrivacyLensProvider: createProgram failed");
303
+ gl.attachShader(program, vs);
304
+ gl.attachShader(program, fs);
305
+ gl.linkProgram(program);
306
+ gl.deleteShader(vs);
307
+ gl.deleteShader(fs);
308
+ if (!gl.getProgramParameter(program, gl.LINK_STATUS)) {
309
+ const log = gl.getProgramInfoLog(program);
310
+ gl.deleteProgram(program);
311
+ throw new Error(`PrivacyLensProvider: program link failed: ${log}`);
312
+ }
313
+ return program;
314
+ }
315
+ makeTexture(gl, wrap) {
316
+ const tex = gl.createTexture();
317
+ if (!tex) throw new Error("PrivacyLensProvider: createTexture failed");
318
+ gl.bindTexture(gl.TEXTURE_2D, tex);
319
+ gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_WRAP_S, wrap);
320
+ gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_WRAP_T, wrap);
321
+ gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MIN_FILTER, gl.LINEAR);
322
+ gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MAG_FILTER, gl.LINEAR);
323
+ return tex;
324
+ }
325
+ scheduleNextFrame() {
326
+ if (this.stopped) return;
327
+ const video = this.videoHandle?.element;
328
+ const rvfc = this.usingRvfc && video ? asRvfc(video) : null;
329
+ if (rvfc) this.rvfcHandle = rvfc.requestVideoFrameCallback(this.loop);
330
+ else this.rafId = requestAnimationFrame(this.loop);
331
+ }
332
+ };
333
+ /** Factory used by the avatar actor's provider selection (privacy-lens avatar). */
334
+ function createProvider() {
335
+ return new PrivacyLensProvider();
336
+ }
337
+
338
+ //#endregion
339
+ export { createProvider };
@@ -1,4 +1,4 @@
1
- import { t as IncodeCanvas } from "./canvas-7uX2izHb.esm.js";
1
+ import { t as IncodeCanvas } from "./canvas-CYuviOmq.esm.js";
2
2
 
3
3
  //#region ../infra/src/media/StreamCanvasCapture.ts
4
4
  var StreamCanvasCapture = class {