@incodetech/core 2.1.1 → 2.2.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.
- package/dist/{3dAvatarProvider-BwOmTMOy.esm.js → 3dAvatarProvider-g02DTFqT.esm.js} +811 -880
- package/dist/Actor-iTq7YY48.d.ts +1 -0
- package/dist/BrowserDiagnosticsCryptoProvider-CriIh1Gt.esm.js +95 -0
- package/dist/BrowserLazyImportProvider-BhoA957O.esm.js +114 -0
- package/dist/{BrowserStorageProvider-CBHBhKQN.esm.js → BrowserStorageProvider-k-FDkC4W.esm.js} +2 -4
- package/dist/{BrowserTimerProvider-CHloo0eQ.esm.js → BrowserTimerProvider-BXhgNxLt.esm.js} +1 -2
- package/dist/{BrowserVisibilityObserverProvider-GBS6XSii.esm.js → BrowserVisibilityObserverProvider-BX1BiLDK.esm.js} +1 -2
- package/dist/Face2DProvider-UUQt_vRC.esm.js +437 -0
- package/dist/{createFaceAvatar-CpdYp9Iy.d.ts → FaceDetectionProvider-Mh6q3EbA.d.ts} +107 -159
- package/dist/IBrowserEnvironmentCapability-DEaRRk-R.esm.js +9 -0
- package/dist/IFaceAvatarCapability-BrL19G0s.d.ts +23 -0
- package/dist/IFeatureManagementCapability-DdEUp6tB.d.ts +1125 -0
- package/dist/IIdCaptureCapability-DHTT3FC2.d.ts +237 -0
- package/dist/IStorageCapability-ORkQfK3F.d.ts +242 -0
- package/dist/{ITimerCapability-DJ73P4RK.esm.js → ITimerCapability-DgdDzp8G.esm.js} +1 -2
- package/dist/{Manager-goNPc_h_.d.ts → Manager-CQQ99QOI.d.ts} +1 -0
- package/dist/{MotionSensorProvider-BHuHoYvJ.esm.js → MotionSensorProvider-DGiV77J_.esm.js} +2 -37
- package/dist/{OpenViduRecordingProvider-CK6A5kiU.esm.js → OpenViduRecordingProvider-Du98qevC.esm.js} +2 -4
- package/dist/PrivacyLensProvider-D8PS7AJa.esm.js +405 -0
- package/dist/StateMachine-EDpYWy0i.d.ts +6 -0
- package/dist/{StreamCanvasCapture-CAqUdVkM.esm.js → StreamCanvasCapture-D2XcXCZ4.esm.js} +2 -4
- package/dist/{addressSearch-D7msRieq.esm.js → addressSearch-DQyrvDQj.esm.js} +10 -21
- package/dist/ae-signature.d.ts +4 -6
- package/dist/ae-signature.esm.js +10 -11
- package/dist/antifraud.d.ts +1 -6
- package/dist/antifraud.esm.js +3 -8
- package/dist/{antifraudManager-5KA84wtF.esm.js → antifraudManager-B8Plzf7a.esm.js} +11 -8
- package/dist/{antifraudManager-DCiNI6np.d.ts → antifraudManager-BY36bS12.d.ts} +3 -3
- package/dist/{antifraudStateMachine-BQVw46N5.esm.js → antifraudStateMachine-r4VxSBS4.esm.js} +5 -7
- package/dist/api-Bx3gKW_y.esm.js +129 -0
- package/dist/{apiError-DkOXfFBu.esm.js → apiError-DZfAyExM.esm.js} +25 -3
- package/dist/authentication.d.ts +3 -19
- package/dist/authentication.esm.js +3 -35
- package/dist/{authenticationManager-BeT6tNZm.d.ts → authenticationManager-BBMGTcwW.d.ts} +3 -4
- package/dist/{authenticationManager-BryLnSaF.esm.js → authenticationManager-DscbQwIl.esm.js} +7 -10
- package/dist/{authenticationStateMachine-DbdxfGHx.esm.js → authenticationStateMachine-SyuM00Fa.esm.js} +11 -15
- package/dist/avatar.d.ts +2 -2
- package/dist/avatar.esm.js +2 -3
- package/dist/avatar2dWarm-DqucNFX4.esm.js +1330 -0
- package/dist/avatarStats-CdUOb3VD.esm.js +136 -0
- package/dist/{backCameraStream-ChrMTJv-.esm.js → backCameraStream-CUeYm5eu.esm.js} +20 -8
- package/dist/browser-DlFgHpoC-DnyrCR8r.esm.js +1513 -0
- package/dist/callback-645_omgz.d.ts +133 -0
- package/dist/camera-_2sXMXiF.esm.js +140 -0
- package/dist/camera.d.ts +19 -2
- package/dist/camera.esm.js +2 -6
- package/dist/{canvas-Pi10hG_l.esm.js → canvas-E1zGkel4.esm.js} +1 -2
- package/dist/certificate-issuance.d.ts +34 -39
- package/dist/certificate-issuance.esm.js +4 -11
- package/dist/{certificateIssuanceStateMachine-DlZQT1_u.esm.js → certificateIssuanceStateMachine-COd7_l2T.esm.js} +7 -11
- package/dist/consent.d.ts +1 -4
- package/dist/consent.esm.js +3 -8
- package/dist/{consentManager-BwNu-uC-.esm.js → consentManager-BApTlfA0.esm.js} +5 -7
- package/dist/{consentManager-B4PMGXW-.d.ts → consentManager-uhDPdU6i.d.ts} +55 -61
- package/dist/{consentStateMachine-BOkVFiU7.esm.js → consentStateMachine-WD-S-Yhs.esm.js} +5 -7
- package/dist/{cpf-16m_cGAM.esm.js → cpf-BIADjddF.esm.js} +1 -2
- package/dist/createFaceAvatar-BEj18KXi.d.ts +50 -0
- package/dist/createFaceAvatar-DQKaRise.esm.js +103 -0
- package/dist/cross-document-data-match.d.ts +2 -26
- package/dist/cross-document-data-match.esm.js +2 -71
- package/dist/crossDocumentDataMatchManager-Dq8Z3SOg.d.ts +41 -0
- package/dist/crossDocumentDataMatchManager-OmYvyung.esm.js +84 -0
- package/dist/curp-validation.d.ts +1 -11
- package/dist/curp-validation.esm.js +3 -8
- package/dist/{curpValidationManager-CoqODZx5.d.ts → curpValidationManager-DVGr7Fq7.d.ts} +4 -6
- package/dist/{curpValidationManager-Cbji2inV.esm.js → curpValidationManager-UZxcrsrz.esm.js} +11 -7
- package/dist/{curpValidationStateMachine-Dlw4qfFb.esm.js → curpValidationStateMachine-9KwnqeoB.esm.js} +22 -14
- package/dist/custom-fields.d.ts +2 -5
- package/dist/custom-fields.esm.js +24 -11
- package/dist/custom-watchlist.d.ts +1 -3
- package/dist/custom-watchlist.esm.js +11 -10
- package/dist/{customWatchlistStateMachine-D8w0mNxm.esm.js → customWatchlistStateMachine-B_ey3TFj.esm.js} +5 -7
- package/dist/{dateUtils-BW6mBV6p.esm.js → dateUtils-CvG0FvK8.esm.js} +1 -2
- package/dist/{deepsightService-CViys6T4.esm.js → deepsightLoader-DcWjMC6A.esm.js} +68 -14
- package/dist/{deepsightService-BuTOFTr8.d.ts → deepsightService-DLVQS_RH.d.ts} +41 -2
- package/dist/device.d.ts +10 -2
- package/dist/device.esm.js +21 -21
- package/dist/document-capture.d.ts +3 -1816
- package/dist/document-capture.esm.js +3 -245
- package/dist/document-upload.d.ts +48 -55
- package/dist/document-upload.esm.js +8 -14
- package/dist/documentCaptureManager-B4Kivr8_.d.ts +2062 -0
- package/dist/documentCaptureManager-DszmcU-l.esm.js +296 -0
- package/dist/{documentCaptureStateMachine-BkTvU3yq.esm.js → documentCaptureStateMachine-D2jBwwVb.esm.js} +66 -40
- package/dist/dynamic-forms.d.ts +2 -4
- package/dist/dynamic-forms.esm.js +3 -9
- package/dist/{dynamicFormsManager-CHXUBNs4.esm.js → dynamicFormsManager-BoZ2-OUI.esm.js} +48 -9
- package/dist/{dynamicFormsManager-CKZkE7Wo.d.ts → dynamicFormsManager-fhK0yINk.d.ts} +22 -46
- package/dist/{dynamicFormsStateMachine-DJ1HGZff.esm.js → dynamicFormsStateMachine-D0RzkoEV.esm.js} +161 -34
- package/dist/ekyb.d.ts +5 -137
- package/dist/ekyb.esm.js +4 -179
- package/dist/ekybManager-DTvfxAOZ.esm.js +178 -0
- package/dist/ekybManager-Dzswb_b8.d.ts +114 -0
- package/dist/{ekybStateMachine-D9GzA4MW.esm.js → ekybStateMachine-BlTIozb6.esm.js} +16 -193
- package/dist/ekyc.d.ts +2 -79
- package/dist/ekyc.esm.js +4 -154
- package/dist/ekycManager-BFpHbBoT.d.ts +97 -0
- package/dist/ekycManager-oTstTJuL.esm.js +156 -0
- package/dist/{ekycStateMachine-DnVRiu3s.esm.js → ekycStateMachine-DHvksnrr.esm.js} +141 -423
- package/dist/ekycUtils-Dew1rBG0.esm.js +223 -0
- package/dist/electronic-signature.d.ts +3 -5
- package/dist/electronic-signature.esm.js +2 -10
- package/dist/{index-36QX_21w.d.ts → electronicSignatureManager-CcUXQZS7.d.ts} +220 -251
- package/dist/{electronicSignatureManager-DESRgObX.esm.js → electronicSignatureManager-DRYlHPjT.esm.js} +47 -33
- package/dist/email.d.ts +1 -5
- package/dist/email.esm.js +3 -10
- package/dist/{emailManager-CMS4q_r6.d.ts → emailManager-CADXW_9X.d.ts} +4 -7
- package/dist/{emailManager-B9Vrv3Ma.esm.js → emailManager-tE-YvNtS.esm.js} +76 -12
- package/dist/{emailStateMachine-CbmKFVSi.esm.js → emailStateMachine-Bm894MHB.esm.js} +7 -9
- package/dist/{endpoints-CwrFQfW7.esm.js → endpoints-CCzL3XD_.esm.js} +55 -6
- package/dist/{events-1wxZ97yf.esm.js → events-CxfNJVZW.esm.js} +43 -176
- package/dist/events.d.ts +28 -10
- package/dist/events.esm.js +2 -4
- package/dist/extensibility.d.ts +37 -37
- package/dist/extensibility.esm.js +31 -80
- package/dist/{externalFetch-hvmz_npP.esm.js → externalFetch-BKBThAUC.esm.js} +2 -4
- package/dist/face-match.d.ts +2 -225
- package/dist/face-match.esm.js +3 -173
- package/dist/{faceCaptureManagerFactory-C9TiGbkA.esm.js → faceCaptureManagerFactory-BDAsBCkh.esm.js} +52 -31
- package/dist/{faceCaptureManagerFactory-DiJ64oem.d.ts → faceCaptureManagerFactory-BxWPpxyd.d.ts} +63 -24
- package/dist/{faceCaptureSetup-BqhqfFHL.esm.js → faceCaptureSetup-C7Qv79fA.esm.js} +57 -36
- package/dist/faceMatchManager-BXp2WUT-.esm.js +201 -0
- package/dist/faceMatchManager-BnvrZM2F.d.ts +268 -0
- package/dist/{faceMatchStateMachine-MDb30gCm.esm.js → faceMatchStateMachine-CJiO2yLO.esm.js} +14 -10
- package/dist/feature-management-DS_Nj5Gg.esm.js +615 -0
- package/dist/feature-management.d.ts +173 -0
- package/dist/feature-management.esm.js +2 -0
- package/dist/field-comparison.d.ts +1 -4
- package/dist/field-comparison.esm.js +2 -7
- package/dist/{fieldComparisonManager-OLKVsG2Z.d.ts → fieldComparisonManager-CBvEGxFx.d.ts} +3 -5
- package/dist/{fieldComparisonManager-Cw4uzD7S.esm.js → fieldComparisonManager-DhnYdYZ2.esm.js} +6 -11
- package/dist/fiscal-qr.d.ts +1 -6
- package/dist/fiscal-qr.esm.js +14 -29
- package/dist/flow-events.d.ts +2 -9
- package/dist/flow.d.ts +59 -21
- package/dist/flow.esm.js +132 -49
- package/dist/{flowCompletionService-B6P6_EF3.esm.js → flowCompletionService-BSe3p7pg.esm.js} +4 -6
- package/dist/flowServices-unhF9V9F.esm.js +620 -0
- package/dist/geolocation.d.ts +1 -4
- package/dist/geolocation.esm.js +3 -9
- package/dist/{geolocationManager-CF6-NizA.esm.js → geolocationManager-Bv9MSVNr.esm.js} +44 -16
- package/dist/geolocationManager-Cz744E5S.d.ts +506 -0
- package/dist/{geolocationStateMachine-CD2XJs1b.esm.js → geolocationStateMachine-BxD6JK1M.esm.js} +53 -28
- package/dist/{getBrowser-1yNcfFZR.esm.js → getBrowser-Cb8Zgrgp.esm.js} +1 -2
- package/dist/getBrowser-DNrQeL4T.esm.js +16 -0
- package/dist/getDeviceClass-9y-kbVDw.esm.js +19 -0
- package/dist/{getDeviceClass-C-Dg6IsJ.esm.js → getDeviceClass-CeBiEayS.esm.js} +1 -2
- package/dist/getParsedUserAgent-pJjATANs.esm.js +1622 -0
- package/dist/government-validation.d.ts +3 -6
- package/dist/government-validation.esm.js +7 -13
- package/dist/{governmentValidationStateMachine-BE5wiQ7Y.esm.js → governmentValidationStateMachine-BYKYUdza.esm.js} +8 -11
- package/dist/home.d.ts +14 -22
- package/dist/home.esm.js +3 -8
- package/dist/http.d.ts +0 -1
- package/dist/http.esm.js +2 -4
- package/dist/id-ocr.d.ts +8 -7
- package/dist/id-ocr.esm.js +20 -9
- package/dist/id-selfie-flow.d.ts +179 -0
- package/dist/id-selfie-flow.esm.js +917 -0
- package/dist/id-verification.d.ts +2 -191
- package/dist/id-verification.esm.js +3 -43
- package/dist/id.d.ts +7 -18
- package/dist/id.esm.js +47 -53
- package/dist/{idCaptureDefaults-CZajItdO.esm.js → idCaptureDefaults-WeHbQM7W.esm.js} +54 -17
- package/dist/idCaptureManager-BjU-Wyow.d.ts +429 -0
- package/dist/{idCaptureManager-DASPUMtC.esm.js → idCaptureManager-BjiBSrHm.esm.js} +173 -34
- package/dist/idCaptureServices-CFDwqTtQ.esm.js +396 -0
- package/dist/{idCaptureStateMachine-DZ2ZTSxu.esm.js → idCaptureStateMachine-CRwQh8jc.esm.js} +438 -585
- package/dist/{idOcrManager-Tm4LzKR0.esm.js → idOcrManager-CvJZhmBR.esm.js} +4 -7
- package/dist/{idOcrManager-DLfAjDZn.d.ts → idOcrManager-DXc_xRN7.d.ts} +62 -229
- package/dist/{idOcrStateMachine-BJxZCxwS.esm.js → idOcrStateMachine-Bq_e3l4E.esm.js} +15 -20
- package/dist/idVerificationManager-BB4Pj_N6.d.ts +197 -0
- package/dist/idVerificationManager-CduNXhWd.esm.js +51 -0
- package/dist/{idVerificationStateMachine-DXN9WcdM.esm.js → idVerificationStateMachine-GEQWUPU2.esm.js} +5 -7
- package/dist/identity-reuse.d.ts +1 -4
- package/dist/identity-reuse.esm.js +3 -8
- package/dist/{identityReuseManager-LjkPvSQN.esm.js → identityReuseManager-D5vXknnJ.esm.js} +24 -7
- package/dist/{identityReuseManager-CLVOYxcp.d.ts → identityReuseManager-v2TH5g7e.d.ts} +38 -43
- package/dist/{identityReuseStateMachine-Bp-zONoV.esm.js → identityReuseStateMachine-AubRPhIi.esm.js} +6 -8
- package/dist/index-B8weJxmL.d.ts +1 -0
- package/dist/index-BKOWUhxG.d.ts +258 -0
- package/dist/{index-DrpWp15Z.d.ts → index-CLMF0QLQ.d.ts} +3 -3
- package/dist/index.d.ts +1 -3
- package/dist/index.esm.js +2 -15
- package/dist/{invokeOnCaptureCallback-CCS2Ruzi.esm.js → invokeOnCaptureCallback-1m1VJ3Q4.esm.js} +2 -4
- package/dist/{lib-Bjd6nOLG.esm.js → lib-DAyUtOTj.esm.js} +1510 -1589
- package/dist/mandatory-consent.d.ts +2 -10
- package/dist/mandatory-consent.esm.js +3 -8
- package/dist/{mandatoryConsentManager-DeBmOHcQ.d.ts → mandatoryConsentManager-B29kR0XA.d.ts} +60 -85
- package/dist/{mandatoryConsentManager-DZ26sg4B.esm.js → mandatoryConsentManager-BeELm1zS.esm.js} +4 -7
- package/dist/{mandatoryConsentStateMachine-_44ZoDSh.esm.js → mandatoryConsentStateMachine-zroQGzwb.esm.js} +5 -7
- package/dist/manualReviewService-D4IkipnN.esm.js +15 -0
- package/dist/{mediaRecorderOptions-CClCKAiF.esm.js → mediaRecorderOptions-dALSV8af.esm.js} +2 -4
- package/dist/{mediapipeShared-Bcmkzs3x.esm.js → mediapipeShared-B6oNoXEQ.esm.js} +21 -9
- package/dist/{onDeviceFaceResults-DILtthks.esm.js → onDeviceFaceResults-f81FVdQs.esm.js} +30 -87
- package/dist/openviduLazy-CCDpFWg1.esm.js +10 -0
- package/dist/{otp-B1YeyRXu.d.ts → otp-CEWfTj9v.d.ts} +0 -1
- package/dist/{otp-uaXiKt_R.esm.js → otp-D2k3PeSL.esm.js} +3 -14
- package/dist/{permissionGuards-BNOe4Tnu.esm.js → permissionGuards-KINpmKtI.esm.js} +2 -4
- package/dist/{permissionServices-C_kxhNeo.esm.js → permissionServices-UvUcOSRb.esm.js} +35 -28
- package/dist/personhood.d.ts +13 -20
- package/dist/personhood.esm.js +153 -85
- package/dist/phone.d.ts +1 -5
- package/dist/phone.esm.js +3 -10
- package/dist/{phoneManager-_KtitbUA.d.ts → phoneManager-BBU8Lq0O.d.ts} +4 -7
- package/dist/{phoneManager-CRblfdcI.esm.js → phoneManager-Cpiai2IM.esm.js} +82 -12
- package/dist/{phoneStateMachine-DjFGWMjQ.esm.js → phoneStateMachine-E1fUUcNM.esm.js} +7 -9
- package/dist/{platform-0Ot-bF_a.esm.js → platform-BJrm5nzZ.esm.js} +31 -11
- package/dist/privacyLensWorker-DI-Rg83h.esm.js +355 -0
- package/dist/qe-signature.d.ts +4 -6
- package/dist/qe-signature.esm.js +10 -11
- package/dist/{recordingService-CxaYkITO.esm.js → recordingService-CFpfdXSS.esm.js} +13 -31
- package/dist/redirect-to-mobile.d.ts +2 -6
- package/dist/redirect-to-mobile.esm.js +3 -10
- package/dist/{redirectToMobileManager-dv29o_LS.d.ts → redirectToMobileManager-BD2PvT5B.d.ts} +8 -44
- package/dist/{redirectToMobileManager-DbuNUlru.esm.js → redirectToMobileManager-C0dfc7f6.esm.js} +28 -8
- package/dist/{redirectToMobileStateMachine-BRaIJWOM.esm.js → redirectToMobileStateMachine-C9SYCJcH.esm.js} +74 -18
- package/dist/rolldown-runtime-FZ4Itg2g.esm.js +42 -0
- package/dist/{runChildModule-kojSv3MH.esm.js → runChildModule-DpvgAGFA.esm.js} +10 -9
- package/dist/{WasmUtilProvider-BgzcXBdl.esm.js → safeStorage-Ep56I-f_.esm.js} +98 -473
- package/dist/selfie.d.ts +8 -21
- package/dist/selfie.esm.js +40 -47
- package/dist/selfieErrorUtils-C2PYBVsp.esm.js +90 -0
- package/dist/{selfieManager-B1Px3GGa.esm.js → selfieManager-Br4onIMy.esm.js} +7 -10
- package/dist/{selfieManager-4juKfrHG.d.ts → selfieManager-DwlCppg0.d.ts} +3 -4
- package/dist/{selfieStateMachine-D0TS93Tu.esm.js → selfieStateMachine-CNGs8vFK.esm.js} +14 -29
- package/dist/{session-CLsU2Jnb.esm.js → session-CX2H3tmI.esm.js} +16 -7
- package/dist/session.d.ts +12 -10
- package/dist/session.esm.js +5 -15
- package/dist/sessionInitializer-CV6Rj_dn.esm.js +1865 -0
- package/dist/{setup-CfNsYAeB.esm.js → setup-CYdVacqv.esm.js} +319 -137
- package/dist/{setup-CmA2apmN.d.ts → setup-DywQeePQ.d.ts} +186 -4
- package/dist/signature.d.ts +2 -96
- package/dist/signature.esm.js +3 -108
- package/dist/signatureManager-DGBSWz2_.d.ts +106 -0
- package/dist/signatureManager-DdPgcmou.esm.js +113 -0
- package/dist/{signatureStateMachine-CdhlMih-.esm.js → signatureStateMachine-Cf73DGWO.esm.js} +5 -7
- package/dist/spawn-D9jgw9pW.d.ts +1441 -0
- package/dist/src-0Jurt29N.esm.js +4482 -0
- package/dist/{stats-BVy52wLy.esm.js → stats-B0nFKawG.esm.js} +3 -5
- package/dist/stats.esm.js +2 -5
- package/dist/topLevelStateName-B5i2avbh.esm.js +41 -0
- package/dist/{tri-CFAPtAUM.esm.js → tri-4RsGrIt6.esm.js} +3 -119
- package/dist/tri.d.ts +2 -2
- package/dist/tri.esm-BIjHhBJ2.esm.js +2620 -0
- package/dist/tri.esm.js +2 -4
- package/dist/trueSight-B8G85W4z.esm.js +1 -0
- package/dist/trueSightService-6dTpiaTh.esm.js +1894 -0
- package/dist/trust-graph.d.ts +4 -5
- package/dist/trust-graph.esm.js +13 -9
- package/dist/types-BEwVKkLJ.d.ts +15 -0
- package/dist/{types-BKLb3C42.esm.js → types-BN5RPPIZ.esm.js} +1 -2
- package/dist/types-BSBzhHRH.d.ts +57 -0
- package/dist/types-BX_XkMsQ2.d.ts +21 -0
- package/dist/types-BfHiko5D.d.ts +48 -0
- package/dist/{types-D8Cl1N2Z.d.ts → types-BfgmV7s72.d.ts} +2 -2
- package/dist/types-CJ7Yl9K-2.d.ts +164 -0
- package/dist/types-DPIDuhut.d.ts +40 -0
- package/dist/types-DVmXIdzW.d.ts +82 -0
- package/dist/types-DelMqZLe.d.ts +105 -0
- package/dist/types-EELWyWpd.d.ts +6 -0
- package/dist/{types-fO6KIdol.d.ts → types-Hmd7U0JA.d.ts} +80 -6
- package/dist/{types-BUgeB2X6.d.ts → types-KPvmag_B.d.ts} +7 -7
- package/dist/types-M6eb82ra2.d.ts +589 -0
- package/dist/{types-DV3wkhQ4.d.ts → types-Vb4P9ovf.d.ts} +1 -3
- package/dist/{urlUtils-CpiYwn7w.esm.js → urlUtils-D6phjq1-.esm.js} +1 -2
- package/dist/{video-ZY92rkel.esm.js → video-BtSWtHy1.esm.js} +1 -2
- package/dist/video-selfie.d.ts +71 -117
- package/dist/video-selfie.esm.js +575 -643
- package/dist/videoSelfieCameraWarmer-h_VUk5Vu.esm.js +651 -0
- package/dist/videoSelfieStepDetector-D3oo2ofo.d.ts +123 -0
- package/dist/wasm.d.ts +2 -4
- package/dist/wasm.esm.js +4 -15
- package/dist/wasmDefaults-DTUrftxR.esm.js +125 -0
- package/dist/{wasmDsFlagSync-Ch0mFJNT.esm.js → wasmDsFlagSync-BqUCwLY8.esm.js} +2 -4
- package/dist/wasmWebClient-DM8lkb0z.esm.js +407 -0
- package/dist/watchlist-for-business.d.ts +1 -3
- package/dist/watchlist-for-business.esm.js +9 -9
- package/dist/watchlist.d.ts +1 -52
- package/dist/watchlist.esm.js +3 -70
- package/dist/{watchlistForBusinessStateMachine-R1Yp1g5A.esm.js → watchlistForBusinessStateMachine-BcBMkMvV.esm.js} +5 -7
- package/dist/watchlistManager-CjSMmbyq.esm.js +83 -0
- package/dist/watchlistManager-DLXef90v.d.ts +68 -0
- package/dist/{watchlistStateMachine-D07UVq1m.esm.js → watchlistStateMachine-Bl7Wy9Cm.esm.js} +5 -7
- package/dist/workflow.d.ts +239 -203
- package/dist/workflow.esm.js +156 -101
- package/dist/xstate-actors.esm-CtI5S0f4.esm.js +310 -0
- package/dist/{xstate.esm-nY3M5UYm.esm.js → xstate.esm-Cf4e0Cfd.esm.js} +136 -610
- package/package.json +14 -9
- package/dist/Actor-BwgmOPkb.d.ts +0 -2
- package/dist/Face2DProvider-CZU11g6r.esm.js +0 -824
- package/dist/FaceDetectionProvider-CPWg-PAH.d.ts +0 -119
- package/dist/IWasmUtilCapability-DaSNxgA8.d.ts +0 -150
- package/dist/PrivacyLensProvider-B_zrV25p.esm.js +0 -339
- package/dist/StateMachine-D5WO6lHS.d.ts +0 -2
- package/dist/StreamCanvasCapture-DHaWferF.d.ts +0 -42
- package/dist/ae-signature-Pp4oCAHD.esm.js +0 -12
- package/dist/api-DsbUi7TO.esm.js +0 -72
- package/dist/browser-DlFgHpoC-Br3G10gw.esm.js +0 -1425
- package/dist/browserSimulation-DZwEy9bu.esm.js +0 -2804
- package/dist/camera-CxxXV0VN.esm.js +0 -79
- package/dist/canvas-90BqS0NF.d.ts +0 -112
- package/dist/chunk-CIKcdghV.esm.js +0 -49
- package/dist/clientLifecycle-VyzRfALg.esm.js +0 -534
- package/dist/cpf-ocr.d.ts +0 -10
- package/dist/cpf-ocr.esm.js +0 -8
- package/dist/cpfOcrManager-9eM4z4o7.esm.js +0 -190
- package/dist/cpfOcrManager-C5U9E0hf.d.ts +0 -216
- package/dist/createFaceAvatar-BZSg2MNo.esm.js +0 -46
- package/dist/deepsightLoader-CU_tiLMx.esm.js +0 -62
- package/dist/flowServices-DkQmOkLV.esm.js +0 -208
- package/dist/geolocationManager-DaHYFkVO.d.ts +0 -156
- package/dist/getDeviceClass-DIjnTPjR.esm.js +0 -14
- package/dist/http-CnsKEaJY.esm.js +0 -0
- package/dist/idCaptureManager-CwuXtVu6.d.ts +0 -1013
- package/dist/index-BAyZ8_iI.d.ts +0 -93
- package/dist/openviduLazy-jPgABwrt.esm.js +0 -3
- package/dist/openviduLazy-wEojM41w.esm.js +0 -12
- package/dist/qe-signature-BnWIpR-O.esm.js +0 -12
- package/dist/sessionInitializer-Dj7-aJaP.esm.js +0 -547
- package/dist/tri.esm-DDJ1zOqG.esm.js +0 -2593
- package/dist/types-BcF-fii5.d.ts +0 -5
- package/dist/videoSelfieSteps-Djpv7cjb.esm.js +0 -58
- /package/dist/{IVisibilityObserverCapability-BZ1rE7ly.d.ts → IVisibilityObserverCapability-D4tvIB5v.d.ts} +0 -0
- /package/dist/{camera-CKU96nwJ.d.ts → camera-9wWD-pwg.d.ts} +0 -0
- /package/dist/{flowCompletionService-BOSTlAWo.d.ts → flowCompletionService-BlAHsKyv.d.ts} +0 -0
- /package/dist/{types-BgjMAEXl.d.ts → types-Bk_6dmDa.d.ts} +0 -0
- /package/dist/{warmup-Dd0iq6KF.d.ts → warmup-Dv2alr2-.d.ts} +0 -0
|
@@ -0,0 +1,651 @@
|
|
|
1
|
+
import { t as BrowserTimerProvider } from "./BrowserTimerProvider-BXhgNxLt.esm.js";
|
|
2
|
+
import { t as api } from "./api-Bx3gKW_y.esm.js";
|
|
3
|
+
import { t as endpoints } from "./endpoints-CCzL3XD_.esm.js";
|
|
4
|
+
import { l as facingModeForStep, u as resolveVideoSelfieSteps } from "./flowServices-unhF9V9F.esm.js";
|
|
5
|
+
import { i as requestCameraWithFallback, r as requestCameraAccess } from "./camera-_2sXMXiF.esm.js";
|
|
6
|
+
import { t as checkPermission } from "./permissionServices-UvUcOSRb.esm.js";
|
|
7
|
+
import { _ as StreamCanvasProcessingSession, a as encryptSelfieImage, l as startDetection, v as FaceDetectionProvider } from "./onDeviceFaceResults-f81FVdQs.esm.js";
|
|
8
|
+
import { n as getBackCameraStream } from "./backCameraStream-CUeYm5eu.esm.js";
|
|
9
|
+
import { n as getWindowDimensions } from "./getDeviceClass-CeBiEayS.esm.js";
|
|
10
|
+
import { t as FACE_ERROR_CODES } from "./types-BN5RPPIZ.esm.js";
|
|
11
|
+
import { i as uploadSelfie, r as processFace, t as getFaceErrorCodeFromUnknown } from "./selfieErrorUtils-C2PYBVsp.esm.js";
|
|
12
|
+
import { t as StreamCanvasCapture } from "./StreamCanvasCapture-D2XcXCZ4.esm.js";
|
|
13
|
+
import { n as DEFAULT_ID_CAPTURE_THRESHOLDS, r as IdCaptureProvider, t as DEFAULT_ID_CAPTURE_GEOMETRY } from "./idCaptureDefaults-WeHbQM7W.esm.js";
|
|
14
|
+
//#region src/modules/video-selfie/videoSelfieCompareService.ts
|
|
15
|
+
async function postVideoSelfieCompare(endpoint, base64Image) {
|
|
16
|
+
return (await api.post(endpoint, { base64Image })).data;
|
|
17
|
+
}
|
|
18
|
+
/** Compare a front-ID frame from the video selfie against the captured ID. */
|
|
19
|
+
const compareVideoSelfieId = (base64Image) => postVideoSelfieCompare(endpoints.videoSelfieCompareId, base64Image);
|
|
20
|
+
/** Compare OCR from a front-ID frame against the captured ID's OCR. */
|
|
21
|
+
const compareVideoSelfieOcr = (base64Image) => postVideoSelfieCompare(endpoints.videoSelfieCompareOcr, base64Image);
|
|
22
|
+
/** Compare a back-ID frame from the video selfie against the captured ID. */
|
|
23
|
+
const compareVideoSelfieBackId = (base64Image) => postVideoSelfieCompare(endpoints.videoSelfieCompareBackId, base64Image);
|
|
24
|
+
/** Compare OCR from a back-ID frame against the captured ID's OCR. */
|
|
25
|
+
const compareVideoSelfieBackOcr = (base64Image) => postVideoSelfieCompare(endpoints.videoSelfieCompareBackOcr, base64Image);
|
|
26
|
+
//#endregion
|
|
27
|
+
//#region src/modules/video-selfie/videoSelfieStepDetector.ts
|
|
28
|
+
/** Default autocapture window for the selfie step when the config omits one. */
|
|
29
|
+
const SELFIE_AUTOCAPTURE_MS = 1e4;
|
|
30
|
+
/**
|
|
31
|
+
* Whether the backend reported a confident face match on a front-ID compare.
|
|
32
|
+
* The backend normalizes `faceRecognitionConfidence` to 0 (no match) or 1 (match).
|
|
33
|
+
*/
|
|
34
|
+
function isFaceRecognitionMatch(confidence) {
|
|
35
|
+
if (typeof confidence !== "number") return true;
|
|
36
|
+
return confidence >= 1;
|
|
37
|
+
}
|
|
38
|
+
const SELFIE_SUCCESS_DWELL_MS = 900;
|
|
39
|
+
/**
|
|
40
|
+
* How long the ID step holds on the "success" state (green check) after the
|
|
41
|
+
* backend validates a side, before advancing. Gives the user a beat to see the
|
|
42
|
+
* capture succeeded instead of the step jumping silently. Mirrors V1's
|
|
43
|
+
* IdVideoSelfie success flash.
|
|
44
|
+
*/
|
|
45
|
+
const ID_SUCCESS_DWELL_MS = 900;
|
|
46
|
+
const SELFIE_VALIDATION_ERROR_CODES = [
|
|
47
|
+
FACE_ERROR_CODES.FACE_OCCLUDED,
|
|
48
|
+
FACE_ERROR_CODES.LIVENESS,
|
|
49
|
+
FACE_ERROR_CODES.BRIGHTNESS,
|
|
50
|
+
FACE_ERROR_CODES.LENSES,
|
|
51
|
+
FACE_ERROR_CODES.MASK,
|
|
52
|
+
FACE_ERROR_CODES.CLOSED_EYES,
|
|
53
|
+
FACE_ERROR_CODES.HEAD_COVER,
|
|
54
|
+
FACE_ERROR_CODES.FACE_NOT_FOUND,
|
|
55
|
+
FACE_ERROR_CODES.MULTIPLE_FACES,
|
|
56
|
+
FACE_ERROR_CODES.TOO_BLURRY,
|
|
57
|
+
FACE_ERROR_CODES.TOO_DARK,
|
|
58
|
+
FACE_ERROR_CODES.USER_IS_NOT_RECOGNIZED,
|
|
59
|
+
FACE_ERROR_CODES.SPOOF_ATTEMPT_DETECTED,
|
|
60
|
+
FACE_ERROR_CODES.FACE_TOO_DARK,
|
|
61
|
+
FACE_ERROR_CODES.LENSES_DETECTED,
|
|
62
|
+
FACE_ERROR_CODES.FACE_MASK_DETECTED,
|
|
63
|
+
FACE_ERROR_CODES.CLOSED_EYES_DETECTED,
|
|
64
|
+
FACE_ERROR_CODES.HEAD_COVER_DETECTED,
|
|
65
|
+
FACE_ERROR_CODES.FACE_CROPPING_FAILED,
|
|
66
|
+
FACE_ERROR_CODES.FACE_TOO_SMALL,
|
|
67
|
+
FACE_ERROR_CODES.FACE_TOO_BLURRY,
|
|
68
|
+
FACE_ERROR_CODES.BAD_PHOTO_QUALITY,
|
|
69
|
+
FACE_ERROR_CODES.SELFIE_IMAGE_LOW_QUALITY
|
|
70
|
+
];
|
|
71
|
+
const SELFIE_VALIDATION_STATUS_CODES = [
|
|
72
|
+
3004,
|
|
73
|
+
3005,
|
|
74
|
+
3006,
|
|
75
|
+
3007,
|
|
76
|
+
4010,
|
|
77
|
+
4019,
|
|
78
|
+
4077,
|
|
79
|
+
4078
|
|
80
|
+
];
|
|
81
|
+
function getErrorStatus(error) {
|
|
82
|
+
if (typeof error !== "object" || error === null) return;
|
|
83
|
+
if ("data" in error) {
|
|
84
|
+
const data = error.data;
|
|
85
|
+
if (typeof data === "object" && data !== null && "status" in data && typeof data.status === "number") return data.status;
|
|
86
|
+
}
|
|
87
|
+
if ("status" in error && typeof error.status === "number") return error.status;
|
|
88
|
+
}
|
|
89
|
+
function isSelfieValidationError(error) {
|
|
90
|
+
const errorCode = getFaceErrorCodeFromUnknown(error);
|
|
91
|
+
if (errorCode !== void 0 && SELFIE_VALIDATION_ERROR_CODES.includes(errorCode)) return true;
|
|
92
|
+
const status = getErrorStatus(error);
|
|
93
|
+
return status !== void 0 && SELFIE_VALIDATION_STATUS_CODES.includes(status);
|
|
94
|
+
}
|
|
95
|
+
/** Attempts for the selfie upload + process round (first try + retries). */
|
|
96
|
+
const SELFIE_SUBMIT_ATTEMPTS = 3;
|
|
97
|
+
const SELFIE_SUBMIT_BACKOFF_MS = 2e3;
|
|
98
|
+
/**
|
|
99
|
+
* True for HTTP-transport-shaped failures — network error / client-side
|
|
100
|
+
* timeout (status 0), 408, 429, 5xx — as opposed to a backend verdict.
|
|
101
|
+
* Plain Errors (aborts, programming faults) are not connection errors.
|
|
102
|
+
*/
|
|
103
|
+
function isConnectionError(error) {
|
|
104
|
+
if (typeof error !== "object" || error === null || !("status" in error)) return false;
|
|
105
|
+
const status = error.status;
|
|
106
|
+
if (typeof status !== "number") return false;
|
|
107
|
+
return status === 0 || status === 408 || status === 429 || status >= 500;
|
|
108
|
+
}
|
|
109
|
+
/**
|
|
110
|
+
* True for errors where the selfie submission never got a meaningful backend
|
|
111
|
+
* verdict, as opposed to a validation outcome. Re-sending the same payload
|
|
112
|
+
* can succeed, so these are retried in place instead of failing the whole
|
|
113
|
+
* recording.
|
|
114
|
+
*/
|
|
115
|
+
function isSelfieTransportError(error) {
|
|
116
|
+
return !isSelfieValidationError(error) && isConnectionError(error);
|
|
117
|
+
}
|
|
118
|
+
function isIdComparisonValidationError(error) {
|
|
119
|
+
return typeof error === "object" && error !== null && "status" in error && typeof error.status === "number" && error.status > 0;
|
|
120
|
+
}
|
|
121
|
+
function abortError() {
|
|
122
|
+
return /* @__PURE__ */ new Error("aborted");
|
|
123
|
+
}
|
|
124
|
+
function throwIfAborted(signal) {
|
|
125
|
+
if (signal.aborted) throw abortError();
|
|
126
|
+
}
|
|
127
|
+
/** Resolves after `ms`, or rejects early if `signal` aborts. */
|
|
128
|
+
function delay(ms, signal) {
|
|
129
|
+
if (signal.aborted) return Promise.reject(abortError());
|
|
130
|
+
const timerProvider = BrowserTimerProvider.getInstance();
|
|
131
|
+
return new Promise((resolve, reject) => {
|
|
132
|
+
const timer = timerProvider.setTimeout(() => {
|
|
133
|
+
signal.removeEventListener("abort", onAbort);
|
|
134
|
+
resolve();
|
|
135
|
+
}, ms);
|
|
136
|
+
const onAbort = () => {
|
|
137
|
+
timerProvider.clearTimeout(timer);
|
|
138
|
+
reject(abortError());
|
|
139
|
+
};
|
|
140
|
+
signal.addEventListener("abort", onAbort, { once: true });
|
|
141
|
+
if (signal.aborted) onAbort();
|
|
142
|
+
});
|
|
143
|
+
}
|
|
144
|
+
function isWrongVideoSelfieIdSide(step, reportedSide) {
|
|
145
|
+
const side = reportedSide.toLowerCase();
|
|
146
|
+
if (side === "wrong") return true;
|
|
147
|
+
const isFront = side.includes("front") && !side.includes("back");
|
|
148
|
+
const isBack = side.includes("back") && !side.includes("front");
|
|
149
|
+
return step === "frontId" ? isBack : isFront;
|
|
150
|
+
}
|
|
151
|
+
/**
|
|
152
|
+
* Builds the default per-step detector from the module config. Today it
|
|
153
|
+
* auto-captures the `selfie` step (face detection → `add/face` → `process/face`);
|
|
154
|
+
* ID / proof-of-address / questions / speech advance manually until their
|
|
155
|
+
* detectors land.
|
|
156
|
+
*/
|
|
157
|
+
function createDefaultStepDetector(config, deps) {
|
|
158
|
+
return ({ step, stream, signal, onStatus, onOrientation }) => {
|
|
159
|
+
if (step === "selfie") return detectSelfie({
|
|
160
|
+
config,
|
|
161
|
+
deps,
|
|
162
|
+
stream,
|
|
163
|
+
signal,
|
|
164
|
+
onStatus
|
|
165
|
+
});
|
|
166
|
+
if (step === "frontId" || step === "backId") return detectId({
|
|
167
|
+
step,
|
|
168
|
+
config,
|
|
169
|
+
stream,
|
|
170
|
+
signal,
|
|
171
|
+
onStatus,
|
|
172
|
+
onOrientation
|
|
173
|
+
});
|
|
174
|
+
return new Promise(() => {});
|
|
175
|
+
};
|
|
176
|
+
}
|
|
177
|
+
async function detectSelfie(params) {
|
|
178
|
+
const { config, deps, stream, signal, onStatus } = params;
|
|
179
|
+
const provider = new FaceDetectionProvider();
|
|
180
|
+
await provider.initialize({
|
|
181
|
+
autocaptureInterval: SELFIE_AUTOCAPTURE_MS,
|
|
182
|
+
useOnDeviceWorkflow: false,
|
|
183
|
+
videoSelfie: true
|
|
184
|
+
});
|
|
185
|
+
if (signal.aborted) {
|
|
186
|
+
provider.dispose();
|
|
187
|
+
throw abortError();
|
|
188
|
+
}
|
|
189
|
+
provider.setChecksEnabled({
|
|
190
|
+
lenses: config.validateLenses ?? false,
|
|
191
|
+
mask: config.validateFaceMask ?? false,
|
|
192
|
+
closedEyes: config.validateClosedEyes ?? false,
|
|
193
|
+
headWear: config.validateHeadCover ?? false,
|
|
194
|
+
occlusion: false
|
|
195
|
+
});
|
|
196
|
+
const imageType = config.useAsSelfie === true ? "selfie" : "videoSelfie";
|
|
197
|
+
const capturer = new StreamCanvasCapture(stream);
|
|
198
|
+
const detectionConfig = {
|
|
199
|
+
showTutorial: false,
|
|
200
|
+
validateBrightness: false,
|
|
201
|
+
validateLenses: config.validateLenses ?? false,
|
|
202
|
+
validateFaceMask: config.validateFaceMask ?? false,
|
|
203
|
+
validateClosedEyes: config.validateClosedEyes ?? false,
|
|
204
|
+
validateHeadCover: config.validateHeadCover ?? false,
|
|
205
|
+
autoCaptureTimeout: SELFIE_AUTOCAPTURE_MS / 1e3
|
|
206
|
+
};
|
|
207
|
+
const runAttempt = () => new Promise((resolve, reject) => {
|
|
208
|
+
if (signal.aborted) {
|
|
209
|
+
reject(abortError());
|
|
210
|
+
return;
|
|
211
|
+
}
|
|
212
|
+
let settled = false;
|
|
213
|
+
function settle(run) {
|
|
214
|
+
if (settled) return;
|
|
215
|
+
settled = true;
|
|
216
|
+
signal.removeEventListener("abort", onAbort);
|
|
217
|
+
run();
|
|
218
|
+
}
|
|
219
|
+
const detection = startDetection({
|
|
220
|
+
config: detectionConfig,
|
|
221
|
+
capturer,
|
|
222
|
+
provider,
|
|
223
|
+
onUpdate: (status) => onStatus?.(status),
|
|
224
|
+
onSuccess: (canvas, faceCoordinates) => {
|
|
225
|
+
onStatus?.("capturing");
|
|
226
|
+
(async () => {
|
|
227
|
+
try {
|
|
228
|
+
const encryptedBase64Image = await encryptSelfieImage({
|
|
229
|
+
canvas,
|
|
230
|
+
dependencies: { getWasmUtil: async () => deps.getWasmUtil() }
|
|
231
|
+
});
|
|
232
|
+
throwIfAborted(signal);
|
|
233
|
+
for (let attempt = 1;; attempt += 1) try {
|
|
234
|
+
await uploadSelfie({
|
|
235
|
+
encryptedBase64Image,
|
|
236
|
+
faceCoordinates,
|
|
237
|
+
imageType
|
|
238
|
+
});
|
|
239
|
+
throwIfAborted(signal);
|
|
240
|
+
await processFace(imageType);
|
|
241
|
+
break;
|
|
242
|
+
} catch (error) {
|
|
243
|
+
if (signal.aborted || !isSelfieTransportError(error) || attempt >= SELFIE_SUBMIT_ATTEMPTS) throw error;
|
|
244
|
+
await delay(SELFIE_SUBMIT_BACKOFF_MS * attempt, signal);
|
|
245
|
+
}
|
|
246
|
+
throwIfAborted(signal);
|
|
247
|
+
onStatus?.("success");
|
|
248
|
+
await delay(SELFIE_SUCCESS_DWELL_MS, signal);
|
|
249
|
+
settle(resolve);
|
|
250
|
+
} catch (error) {
|
|
251
|
+
settle(() => reject(error instanceof Error ? error : new Error(String(error))));
|
|
252
|
+
}
|
|
253
|
+
})();
|
|
254
|
+
}
|
|
255
|
+
});
|
|
256
|
+
function onAbort() {
|
|
257
|
+
detection.cleanup();
|
|
258
|
+
settle(() => reject(abortError()));
|
|
259
|
+
}
|
|
260
|
+
signal.addEventListener("abort", onAbort, { once: true });
|
|
261
|
+
if (signal.aborted) onAbort();
|
|
262
|
+
});
|
|
263
|
+
try {
|
|
264
|
+
await runAttempt();
|
|
265
|
+
return { outcome: "success" };
|
|
266
|
+
} catch (error) {
|
|
267
|
+
if (signal.aborted) throw error;
|
|
268
|
+
if (isSelfieTransportError(error)) {
|
|
269
|
+
onStatus?.("error");
|
|
270
|
+
return {
|
|
271
|
+
outcome: "retryableFailure",
|
|
272
|
+
failure: "selfieUploadFailed"
|
|
273
|
+
};
|
|
274
|
+
}
|
|
275
|
+
if (!isSelfieValidationError(error)) throw error;
|
|
276
|
+
onStatus?.("error");
|
|
277
|
+
return {
|
|
278
|
+
outcome: "validationFailed",
|
|
279
|
+
failure: "selfieVerificationFailed"
|
|
280
|
+
};
|
|
281
|
+
} finally {
|
|
282
|
+
capturer.dispose();
|
|
283
|
+
provider.dispose();
|
|
284
|
+
}
|
|
285
|
+
}
|
|
286
|
+
async function detectId(params) {
|
|
287
|
+
const { step, config, stream, signal, onStatus, onOrientation } = params;
|
|
288
|
+
const provider = new IdCaptureProvider();
|
|
289
|
+
await provider.initialize({ videoSelfie: true });
|
|
290
|
+
if (signal.aborted) {
|
|
291
|
+
provider.dispose();
|
|
292
|
+
throw abortError();
|
|
293
|
+
}
|
|
294
|
+
const windowDimensions = getWindowDimensions();
|
|
295
|
+
provider.setGeometry({
|
|
296
|
+
...DEFAULT_ID_CAPTURE_GEOMETRY,
|
|
297
|
+
windowOuterWidth: windowDimensions.outerWidth,
|
|
298
|
+
windowOuterHeight: windowDimensions.outerHeight,
|
|
299
|
+
windowInnerWidth: windowDimensions.innerWidth,
|
|
300
|
+
windowInnerHeight: windowDimensions.innerHeight
|
|
301
|
+
});
|
|
302
|
+
provider.setSettings({
|
|
303
|
+
isFixedMask: false,
|
|
304
|
+
isIPhone14OrHigher: false,
|
|
305
|
+
idType: step === "backId" ? "BackId" : "FrontId",
|
|
306
|
+
blurCheckEnabled: true,
|
|
307
|
+
glareCheckEnabled: false,
|
|
308
|
+
faceQualityCheckEnabled: false,
|
|
309
|
+
iouCheckEnabled: true,
|
|
310
|
+
fpsLimitEnabled: false
|
|
311
|
+
});
|
|
312
|
+
provider.setThresholds(DEFAULT_ID_CAPTURE_THRESHOLDS);
|
|
313
|
+
provider.setModelType("v2");
|
|
314
|
+
const capturer = new StreamCanvasCapture(stream);
|
|
315
|
+
return new Promise((resolve, reject) => {
|
|
316
|
+
let validating = false;
|
|
317
|
+
let wrongSide = false;
|
|
318
|
+
let settled = false;
|
|
319
|
+
let toreDown = false;
|
|
320
|
+
const session = new StreamCanvasProcessingSession({
|
|
321
|
+
capturer,
|
|
322
|
+
provider
|
|
323
|
+
});
|
|
324
|
+
function teardown() {
|
|
325
|
+
if (toreDown) return;
|
|
326
|
+
toreDown = true;
|
|
327
|
+
session.dispose();
|
|
328
|
+
capturer.dispose();
|
|
329
|
+
provider.dispose();
|
|
330
|
+
}
|
|
331
|
+
function settle(run) {
|
|
332
|
+
if (settled) return;
|
|
333
|
+
settled = true;
|
|
334
|
+
signal.removeEventListener("abort", onAbort);
|
|
335
|
+
teardown();
|
|
336
|
+
run();
|
|
337
|
+
}
|
|
338
|
+
function onAbort() {
|
|
339
|
+
settle(() => reject(abortError()));
|
|
340
|
+
}
|
|
341
|
+
provider.setCallbacks({
|
|
342
|
+
onFarAway: () => {
|
|
343
|
+
if (!validating && !wrongSide) onStatus?.("tooFar");
|
|
344
|
+
},
|
|
345
|
+
onMaskChange: (_show, _mask, _top, orientation) => {
|
|
346
|
+
onOrientation?.(orientation);
|
|
347
|
+
},
|
|
348
|
+
onBlur: () => {
|
|
349
|
+
if (!validating && !wrongSide) onStatus?.("blur");
|
|
350
|
+
},
|
|
351
|
+
onIdSideChange: (side) => {
|
|
352
|
+
wrongSide = isWrongVideoSelfieIdSide(step, side);
|
|
353
|
+
onStatus?.(wrongSide ? "wrongSide" : "detecting");
|
|
354
|
+
},
|
|
355
|
+
onCapturing: () => {
|
|
356
|
+
if (validating || wrongSide) return;
|
|
357
|
+
const base64Image = capturer.getLatestCanvas()?.getBase64Image();
|
|
358
|
+
if (!base64Image) return;
|
|
359
|
+
validating = true;
|
|
360
|
+
onStatus?.("capturing");
|
|
361
|
+
(async () => {
|
|
362
|
+
try {
|
|
363
|
+
const result = await validateIdFrame(step, config, base64Image);
|
|
364
|
+
if (result.outcome === "success") {
|
|
365
|
+
throwIfAborted(signal);
|
|
366
|
+
onStatus?.("success");
|
|
367
|
+
await delay(ID_SUCCESS_DWELL_MS, signal);
|
|
368
|
+
settle(() => resolve(result));
|
|
369
|
+
return;
|
|
370
|
+
}
|
|
371
|
+
onStatus?.("error");
|
|
372
|
+
settle(() => resolve(result));
|
|
373
|
+
} catch (error) {
|
|
374
|
+
if (signal.aborted) {
|
|
375
|
+
settle(() => reject(error instanceof Error ? error : new Error(String(error))));
|
|
376
|
+
return;
|
|
377
|
+
}
|
|
378
|
+
onStatus?.("error");
|
|
379
|
+
if (isIdComparisonValidationError(error)) {
|
|
380
|
+
settle(() => resolve({
|
|
381
|
+
outcome: "validationFailed",
|
|
382
|
+
failure: "idScanFailed"
|
|
383
|
+
}));
|
|
384
|
+
return;
|
|
385
|
+
}
|
|
386
|
+
settle(() => resolve({
|
|
387
|
+
outcome: "retryableFailure",
|
|
388
|
+
failure: "idScanFailed"
|
|
389
|
+
}));
|
|
390
|
+
}
|
|
391
|
+
})();
|
|
392
|
+
}
|
|
393
|
+
});
|
|
394
|
+
onStatus?.("detecting");
|
|
395
|
+
signal.addEventListener("abort", onAbort, { once: true });
|
|
396
|
+
if (signal.aborted) onAbort();
|
|
397
|
+
});
|
|
398
|
+
}
|
|
399
|
+
/** Runs the configured ID/OCR comparisons for a captured ID frame. */
|
|
400
|
+
async function validateIdFrame(step, config, base64Image) {
|
|
401
|
+
if (step === "backId") {
|
|
402
|
+
if (config.compareBackIdEnabled) {
|
|
403
|
+
const result = await compareVideoSelfieBackId(base64Image);
|
|
404
|
+
if (result.idSideMatched === false || result.success === false) return {
|
|
405
|
+
outcome: "validationFailed",
|
|
406
|
+
failure: "idTypeMismatch"
|
|
407
|
+
};
|
|
408
|
+
}
|
|
409
|
+
if (config.compareBackOcrEnabled) {
|
|
410
|
+
if ((await compareVideoSelfieBackOcr(base64Image)).success === false) return {
|
|
411
|
+
outcome: "validationFailed",
|
|
412
|
+
failure: "nameVerificationFailed"
|
|
413
|
+
};
|
|
414
|
+
}
|
|
415
|
+
return { outcome: "success" };
|
|
416
|
+
}
|
|
417
|
+
if (config.compareIdEnabled) {
|
|
418
|
+
const result = await compareVideoSelfieId(base64Image);
|
|
419
|
+
if (result.idTypeMatched === false) return {
|
|
420
|
+
outcome: "validationFailed",
|
|
421
|
+
failure: "idTypeMismatch"
|
|
422
|
+
};
|
|
423
|
+
if (typeof result.faceRecognitionConfidence === "number" && !isFaceRecognitionMatch(result.faceRecognitionConfidence)) return {
|
|
424
|
+
outcome: "validationFailed",
|
|
425
|
+
failure: "photoVerificationFailed"
|
|
426
|
+
};
|
|
427
|
+
}
|
|
428
|
+
if (config.compareOcrEnabled) {
|
|
429
|
+
if ((await compareVideoSelfieOcr(base64Image)).success === false) return {
|
|
430
|
+
outcome: "validationFailed",
|
|
431
|
+
failure: "nameVerificationFailed"
|
|
432
|
+
};
|
|
433
|
+
}
|
|
434
|
+
return { outcome: "success" };
|
|
435
|
+
}
|
|
436
|
+
//#endregion
|
|
437
|
+
//#region ../infra/src/media/CameraCompositor.ts
|
|
438
|
+
const MAX_COMPOSITE_LONG_EDGE = 1280;
|
|
439
|
+
const MAX_COMPOSITE_SHORT_EDGE = 720;
|
|
440
|
+
const FRAME_INTERVAL_TOLERANCE_RATIO = .9;
|
|
441
|
+
/**
|
|
442
|
+
* Composites the *active* camera into a canvas and exposes the canvas as a
|
|
443
|
+
* single, stable `MediaStream` to record. Switching cameras (front ↔ back)
|
|
444
|
+
* just repoints what the canvas draws — the output stream and its audio track
|
|
445
|
+
* are never replaced — so a single `MediaRecorder` produces one continuous
|
|
446
|
+
* video that follows the camera switches (V1 parity), instead of restarting
|
|
447
|
+
* per camera.
|
|
448
|
+
*
|
|
449
|
+
* The audio track from the initial stream is carried through unchanged across
|
|
450
|
+
* video switches, so there's no audio glitch when the camera flips.
|
|
451
|
+
*/
|
|
452
|
+
var CameraCompositor = class {
|
|
453
|
+
constructor(options = {}) {
|
|
454
|
+
this.canvas = null;
|
|
455
|
+
this.ctx = null;
|
|
456
|
+
this.video = null;
|
|
457
|
+
this.frameRequestId = null;
|
|
458
|
+
this.frameRequestKind = null;
|
|
459
|
+
this.lastDrawTimeMs = null;
|
|
460
|
+
this.lastVideoTimeSeconds = null;
|
|
461
|
+
this.audioTrack = null;
|
|
462
|
+
this.videoTrack = null;
|
|
463
|
+
this.composite = null;
|
|
464
|
+
this.fps = options.fps ?? 30;
|
|
465
|
+
this.frameIntervalMs = this.fps > 0 ? 1e3 / this.fps : 0;
|
|
466
|
+
}
|
|
467
|
+
/**
|
|
468
|
+
* Begin compositing `stream` and return the composite stream to record. The
|
|
469
|
+
* stream's audio track (if any) is carried through unchanged across later
|
|
470
|
+
* `switchVideo` calls.
|
|
471
|
+
*/
|
|
472
|
+
start(stream) {
|
|
473
|
+
this.canvas = document.createElement("canvas");
|
|
474
|
+
this.ctx = this.canvas.getContext("2d");
|
|
475
|
+
this.video = document.createElement("video");
|
|
476
|
+
this.video.muted = true;
|
|
477
|
+
this.video.playsInline = true;
|
|
478
|
+
this.audioTrack = stream.getAudioTracks()[0] ?? null;
|
|
479
|
+
this.setVideoSource(stream);
|
|
480
|
+
const composite = this.canvas.captureStream(this.fps);
|
|
481
|
+
if (this.audioTrack) composite.addTrack(this.audioTrack);
|
|
482
|
+
this.composite = composite;
|
|
483
|
+
this.startDrawLoop();
|
|
484
|
+
return composite;
|
|
485
|
+
}
|
|
486
|
+
/**
|
|
487
|
+
* Swap the camera feeding the canvas without interrupting the composite
|
|
488
|
+
* stream. Pass a video-only stream (audio is kept from `start`). The previous
|
|
489
|
+
* video track is stopped.
|
|
490
|
+
*/
|
|
491
|
+
switchVideo(stream) {
|
|
492
|
+
if (!this.composite) return;
|
|
493
|
+
const previousVideoTrack = this.videoTrack;
|
|
494
|
+
this.setVideoSource(stream);
|
|
495
|
+
this.startDrawLoop();
|
|
496
|
+
if (previousVideoTrack) previousVideoTrack.stop();
|
|
497
|
+
}
|
|
498
|
+
/** The composite stream being recorded, if compositing is active. */
|
|
499
|
+
get stream() {
|
|
500
|
+
return this.composite ?? void 0;
|
|
501
|
+
}
|
|
502
|
+
/** Stop compositing and release the canvas, audio, and video tracks. */
|
|
503
|
+
stop() {
|
|
504
|
+
this.cancelDrawLoop();
|
|
505
|
+
this.videoTrack?.stop();
|
|
506
|
+
this.audioTrack?.stop();
|
|
507
|
+
this.composite?.getTracks().forEach((track) => track.stop());
|
|
508
|
+
if (this.video) this.video.srcObject = null;
|
|
509
|
+
this.canvas = null;
|
|
510
|
+
this.ctx = null;
|
|
511
|
+
this.video = null;
|
|
512
|
+
this.videoTrack = null;
|
|
513
|
+
this.audioTrack = null;
|
|
514
|
+
this.composite = null;
|
|
515
|
+
}
|
|
516
|
+
setVideoSource(stream) {
|
|
517
|
+
this.videoTrack = stream.getVideoTracks()[0] ?? null;
|
|
518
|
+
const video = this.video;
|
|
519
|
+
if (!video) return;
|
|
520
|
+
video.srcObject = new MediaStream(stream.getVideoTracks());
|
|
521
|
+
video.play().catch(() => {});
|
|
522
|
+
}
|
|
523
|
+
startDrawLoop() {
|
|
524
|
+
this.cancelDrawLoop();
|
|
525
|
+
this.lastDrawTimeMs = null;
|
|
526
|
+
this.lastVideoTimeSeconds = null;
|
|
527
|
+
const draw = (timeMs) => {
|
|
528
|
+
const elapsed = this.lastDrawTimeMs === null ? Infinity : timeMs - this.lastDrawTimeMs;
|
|
529
|
+
if ((this.frameIntervalMs === 0 || elapsed >= this.frameIntervalMs * FRAME_INTERVAL_TOLERANCE_RATIO) && this.drawCurrentFrame()) this.lastDrawTimeMs = timeMs;
|
|
530
|
+
this.scheduleNextFrame(draw);
|
|
531
|
+
};
|
|
532
|
+
this.scheduleNextFrame(draw);
|
|
533
|
+
}
|
|
534
|
+
scheduleNextFrame(callback) {
|
|
535
|
+
const video = this.video;
|
|
536
|
+
if (video && typeof video.requestVideoFrameCallback === "function") {
|
|
537
|
+
this.frameRequestKind = "video";
|
|
538
|
+
this.frameRequestId = video.requestVideoFrameCallback(callback);
|
|
539
|
+
return;
|
|
540
|
+
}
|
|
541
|
+
this.frameRequestKind = "animation";
|
|
542
|
+
this.frameRequestId = requestAnimationFrame(callback);
|
|
543
|
+
}
|
|
544
|
+
cancelDrawLoop() {
|
|
545
|
+
if (this.frameRequestId === null) return;
|
|
546
|
+
if (this.frameRequestKind === "video" && this.video && typeof this.video.cancelVideoFrameCallback === "function") this.video.cancelVideoFrameCallback(this.frameRequestId);
|
|
547
|
+
else cancelAnimationFrame(this.frameRequestId);
|
|
548
|
+
this.frameRequestId = null;
|
|
549
|
+
this.frameRequestKind = null;
|
|
550
|
+
}
|
|
551
|
+
drawCurrentFrame() {
|
|
552
|
+
const video = this.video;
|
|
553
|
+
const canvas = this.canvas;
|
|
554
|
+
const ctx = this.ctx;
|
|
555
|
+
if (!video || !canvas || !ctx || video.videoWidth <= 0) return false;
|
|
556
|
+
if (this.lastVideoTimeSeconds === video.currentTime) return false;
|
|
557
|
+
const dimensions = this.getBoundedDimensions(video.videoWidth, video.videoHeight);
|
|
558
|
+
if (canvas.width !== dimensions.width || canvas.height !== dimensions.height) {
|
|
559
|
+
canvas.width = dimensions.width;
|
|
560
|
+
canvas.height = dimensions.height;
|
|
561
|
+
}
|
|
562
|
+
ctx.drawImage(video, 0, 0, canvas.width, canvas.height);
|
|
563
|
+
this.lastVideoTimeSeconds = video.currentTime;
|
|
564
|
+
return true;
|
|
565
|
+
}
|
|
566
|
+
getBoundedDimensions(width, height) {
|
|
567
|
+
const longEdge = Math.max(width, height);
|
|
568
|
+
const shortEdge = Math.min(width, height);
|
|
569
|
+
const scale = Math.min(1, MAX_COMPOSITE_LONG_EDGE / longEdge, MAX_COMPOSITE_SHORT_EDGE / shortEdge);
|
|
570
|
+
return {
|
|
571
|
+
width: Math.max(1, Math.round(width * scale)),
|
|
572
|
+
height: Math.max(1, Math.round(height * scale))
|
|
573
|
+
};
|
|
574
|
+
}
|
|
575
|
+
};
|
|
576
|
+
//#endregion
|
|
577
|
+
//#region src/modules/video-selfie/videoSelfieCameraWarmer.ts
|
|
578
|
+
/**
|
|
579
|
+
* Acquire the camera for a Video Selfie step. The rear (`environment`) steps
|
|
580
|
+
* (frontId / backId / poa) route through {@link getBackCameraStream} so the
|
|
581
|
+
* main autofocus lens is selected — Samsung's default `facingMode:environment`
|
|
582
|
+
* camera is often a fixed-focus auxiliary lens, which blurs the ID steps and
|
|
583
|
+
* stalls capture (client-side blur check is on). This mirrors the ID Capture
|
|
584
|
+
* module. `getBackCameraStream` returns video only, so audio is acquired and
|
|
585
|
+
* merged separately when the step needs it. Front (`user`) steps keep the
|
|
586
|
+
* plain fallback path. Used both as the recording machine's default
|
|
587
|
+
* `acquireCamera` dependency and as this warmer's own acquire/fallback.
|
|
588
|
+
*/
|
|
589
|
+
async function defaultAcquireCamera(facingMode, withAudio) {
|
|
590
|
+
if (facingMode !== "environment") return requestCameraWithFallback({
|
|
591
|
+
video: { facingMode },
|
|
592
|
+
audio: withAudio
|
|
593
|
+
});
|
|
594
|
+
const { stream } = await getBackCameraStream();
|
|
595
|
+
if (withAudio) try {
|
|
596
|
+
const audioStream = await requestCameraAccess({ audio: true });
|
|
597
|
+
for (const audioTrack of audioStream.getAudioTracks()) stream.addTrack(audioTrack);
|
|
598
|
+
} catch (error) {
|
|
599
|
+
stream.getTracks().forEach((track) => track.stop());
|
|
600
|
+
throw error;
|
|
601
|
+
}
|
|
602
|
+
return stream;
|
|
603
|
+
}
|
|
604
|
+
function stopStream(stream) {
|
|
605
|
+
stream?.getTracks().forEach((track) => track.stop());
|
|
606
|
+
}
|
|
607
|
+
/**
|
|
608
|
+
* Creates a {@link VideoSelfieCameraWarmer} for the given config. The first
|
|
609
|
+
* camera (and whether it needs audio) is derived from the resolved step order —
|
|
610
|
+
* the same first acquire the recording machine performs on `START`.
|
|
611
|
+
*/
|
|
612
|
+
function createVideoSelfieCameraWarmer(config) {
|
|
613
|
+
const firstFacing = facingModeForStep(resolveVideoSelfieSteps(config)[0] ?? "selfie");
|
|
614
|
+
let warming = null;
|
|
615
|
+
let warmed = null;
|
|
616
|
+
let consumed = false;
|
|
617
|
+
return {
|
|
618
|
+
warm() {
|
|
619
|
+
if (warming) return;
|
|
620
|
+
warming = (async () => {
|
|
621
|
+
try {
|
|
622
|
+
if (await checkPermission() !== "granted") return null;
|
|
623
|
+
warmed = await defaultAcquireCamera(firstFacing, true);
|
|
624
|
+
return warmed;
|
|
625
|
+
} catch {
|
|
626
|
+
return null;
|
|
627
|
+
}
|
|
628
|
+
})();
|
|
629
|
+
},
|
|
630
|
+
async acquireCamera(facingMode, withAudio) {
|
|
631
|
+
if (!consumed && facingMode === firstFacing && withAudio) {
|
|
632
|
+
consumed = true;
|
|
633
|
+
const stream = warmed ?? (warming ? await warming : null);
|
|
634
|
+
warmed = null;
|
|
635
|
+
if (stream) return stream;
|
|
636
|
+
}
|
|
637
|
+
return defaultAcquireCamera(facingMode, withAudio);
|
|
638
|
+
},
|
|
639
|
+
dispose() {
|
|
640
|
+
if (consumed) return;
|
|
641
|
+
if (warmed) {
|
|
642
|
+
stopStream(warmed);
|
|
643
|
+
warmed = null;
|
|
644
|
+
} else if (warming) warming.then((stream) => {
|
|
645
|
+
if (!consumed) stopStream(stream);
|
|
646
|
+
});
|
|
647
|
+
}
|
|
648
|
+
};
|
|
649
|
+
}
|
|
650
|
+
//#endregion
|
|
651
|
+
export { delay as a, isWrongVideoSelfieIdSide as c, createDefaultStepDetector as i, defaultAcquireCamera as n, isConnectionError as o, CameraCompositor as r, isSelfieValidationError as s, createVideoSelfieCameraWarmer as t };
|