@incodetech/core 2.2.0 → 2.3.0-rc.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/THIRD_PARTY_NOTICES.txt +281 -0
- package/dist/BaseWasmProvider-Dyi6dKp1.d.ts +65 -0
- package/dist/{BrowserDiagnosticsCryptoProvider-B8vorxN5.esm.js → BrowserDiagnosticsCryptoProvider-C_9o3L2L.esm.js} +1 -1
- package/dist/{BrowserVisibilityObserverProvider-BX1BiLDK.esm.js → BrowserVisibilityObserverProvider-BrJN1B8A.esm.js} +2 -0
- package/dist/FaceDetectionProvider-DTetAE8H.esm.js +476 -0
- package/dist/FaceDetectionProvider-LdZ47bWy.d.ts +36 -0
- package/dist/{IIdCaptureCapability-DHTT3FC2.d.ts → IIdCaptureCapability-RNiFhvXR.d.ts} +7 -33
- package/dist/IWasmUtilCapability-CXXDA5l1.d.ts +159 -0
- package/dist/{MotionSensorProvider-DGiV77J_.esm.js → MotionSensorProvider-BgTYwg9L.esm.js} +1 -1
- package/dist/{deepsightService-DLVQS_RH.d.ts → StreamCanvasCapture-B3YT2Bt6.d.ts} +54 -41
- package/dist/{StreamCanvasCapture-D2XcXCZ4.esm.js → StreamCanvasCapture-C9jtgBdT.esm.js} +2 -2
- package/dist/{addressSearch-D1XpBdUS.esm.js → addressSearch-BRSu_aGA.esm.js} +1 -1
- package/dist/advanceableErrors-CpF2cBy6.esm.js +21 -0
- package/dist/ae-signature.d.ts +4 -2
- package/dist/ae-signature.esm.js +1 -1
- package/dist/antifraud.esm.js +2 -2
- package/dist/{antifraudManager-CQFNgSPt.esm.js → antifraudManager-Bg9ynGum.esm.js} +2 -2
- package/dist/{antifraudStateMachine-Bf_JVNwn.esm.js → antifraudStateMachine-BHxehiJZ.esm.js} +1 -1
- package/dist/{apiError-BA1d_au0.esm.js → apiError-D0v5hFyN.esm.js} +14 -2
- package/dist/authentication.d.ts +3 -3
- package/dist/authentication.esm.js +2 -2
- package/dist/{authenticationManager-zh9TC62P.esm.js → authenticationManager-C4B4-29g.esm.js} +5 -5
- package/dist/{authenticationManager-BBMGTcwW.d.ts → authenticationManager-DXTIUcma.d.ts} +7 -1
- package/dist/{authenticationStateMachine-xzi-vnvE.esm.js → authenticationStateMachine-DJ0zUm-A.esm.js} +6 -62
- package/dist/avatar.d.ts +1 -2
- package/dist/avatar.esm.js +1 -1
- package/dist/{backCameraStream-CUeYm5eu.esm.js → backCameraStream-BOtyQowf.esm.js} +83 -22
- package/dist/{camera-_2sXMXiF.esm.js → camera-sIa9ceW2.esm.js} +19 -1
- package/dist/camera.esm.js +1 -1
- package/dist/{canvas-E1zGkel4.esm.js → canvas-BxFzWTt-.esm.js} +19 -0
- package/dist/certificate-issuance.d.ts +2 -302
- package/dist/certificate-issuance.esm.js +3 -66
- package/dist/certificateIssuanceManager-Bfvkq7Cy.esm.js +69 -0
- package/dist/certificateIssuanceManager-DCgEidHz.d.ts +312 -0
- package/dist/{certificateIssuanceStateMachine-D_R92TYu.esm.js → certificateIssuanceStateMachine-BBD5h8c4.esm.js} +1 -1
- package/dist/consent.d.ts +1 -1
- package/dist/consent.esm.js +2 -2
- package/dist/{consentManager-BxjpLZAG.esm.js → consentManager-B5Vqdez-.esm.js} +2 -2
- package/dist/{consentManager-3Pbtj-RV.d.ts → consentManager-uhDPdU6i.d.ts} +4 -4
- package/dist/{consentStateMachine-D9D4ON8Z.esm.js → consentStateMachine-DbUmqWgV.esm.js} +1 -1
- package/dist/createCameraCycleOwnership-DQ5-F2oW.esm.js +826 -0
- package/dist/{createFaceAvatar-DQKaRise.esm.js → createFaceAvatar-BNHdeFj8.esm.js} +2 -2
- package/dist/createFaceAvatar-BlcTYgJv.d.ts +497 -0
- package/dist/cross-document-data-match.esm.js +1 -1
- package/dist/{crossDocumentDataMatchManager-CGT0V6RV.esm.js → crossDocumentDataMatchManager-QMOGwHXR.esm.js} +2 -2
- package/dist/curp-validation.d.ts +1 -1
- package/dist/curp-validation.esm.js +2 -2
- package/dist/{curpValidationManager-6Nmkn5u1.esm.js → curpValidationManager-D1ppROcF.esm.js} +2 -2
- package/dist/{curpValidationManager-DVGr7Fq7.d.ts → curpValidationManager-SSKNrm5Z.d.ts} +1 -1
- package/dist/{curpValidationStateMachine-Ds7KMacK.esm.js → curpValidationStateMachine-DvUPC_8S.esm.js} +1 -1
- package/dist/custom-fields.d.ts +2 -114
- package/dist/custom-fields.esm.js +2 -232
- package/dist/custom-watchlist.d.ts +2 -51
- package/dist/custom-watchlist.esm.js +3 -70
- package/dist/customFieldsManager-2j_PBq4U.esm.js +264 -0
- package/dist/customFieldsManager-8-W2KY4n.d.ts +141 -0
- package/dist/customWatchlistManager-DUVrEdw9.esm.js +73 -0
- package/dist/customWatchlistManager-PBWHr_oM.d.ts +64 -0
- package/dist/{customWatchlistStateMachine-YWSgKLbF.esm.js → customWatchlistStateMachine-qZVgkKgP.esm.js} +1 -1
- package/dist/{deepsightLoader--wMKWECS.esm.js → deepsightLoader-Dm7ejW4v.esm.js} +27 -71
- package/dist/device.d.ts +25 -2
- package/dist/device.esm.js +69 -7
- package/dist/document-capture.d.ts +2 -2
- package/dist/document-capture.esm.js +2 -2
- package/dist/{documentCaptureManager-DsQQhWry.esm.js → documentCaptureManager-DR_Wv-3H.esm.js} +2 -2
- package/dist/{documentCaptureManager-B3t0ydtg.d.ts → documentCaptureManager-DensIj5F.d.ts} +83 -83
- package/dist/{documentCaptureStateMachine-BM4Ex_5x.esm.js → documentCaptureStateMachine-CWOATHfE.esm.js} +5 -5
- package/dist/dynamic-forms.d.ts +1 -1
- package/dist/dynamic-forms.esm.js +2 -2
- package/dist/{dynamicFormsManager-fhK0yINk.d.ts → dynamicFormsManager-D5R_uxLQ.d.ts} +25 -3
- package/dist/{dynamicFormsManager-fFVIRBNv.esm.js → dynamicFormsManager-Dt98SDfV.esm.js} +16 -5
- package/dist/{dynamicFormsStateMachine-D6D7oEYk.esm.js → dynamicFormsStateMachine-obKr4IIp.esm.js} +35 -3
- package/dist/ekyb.d.ts +1 -1
- package/dist/ekyb.esm.js +3 -3
- package/dist/{ekybManager-Y3MkoXpC.esm.js → ekybManager-DNZKrKF3.esm.js} +2 -2
- package/dist/{ekybStateMachine-3nlnqdlr.esm.js → ekybStateMachine-DjhHQXZ8.esm.js} +3 -3
- package/dist/ekyc.esm.js +2 -2
- package/dist/{ekycManager-DgT48ky6.esm.js → ekycManager-CmQBpeiI.esm.js} +2 -2
- package/dist/{ekycStateMachine-CQwqiR-R.esm.js → ekycStateMachine-CmdW2gVm.esm.js} +2 -2
- package/dist/electronic-signature.d.ts +3 -3
- package/dist/electronic-signature.esm.js +2 -2
- package/dist/electronicSignatureManager-Ds-KEVTq.d.ts +2786 -0
- package/dist/{electronicSignatureManager-DGbAJ00W.esm.js → electronicSignatureManager-DzulxM4_.esm.js} +357 -51
- package/dist/email.esm.js +2 -2
- package/dist/{emailManager-BY0jeYwR.esm.js → emailManager-B5ek_UfM.esm.js} +2 -2
- package/dist/{emailStateMachine-Crw8QVmc.esm.js → emailStateMachine-CyPFZ7dW.esm.js} +1 -1
- package/dist/{endpoints-CCzL3XD_.esm.js → endpoints-D3B9mUHh.esm.js} +24 -7
- package/dist/{events-DYiyoSlx.esm.js → events-ijlbX_Wx.esm.js} +2 -2
- package/dist/events.d.ts +1 -1
- package/dist/events.esm.js +1 -1
- package/dist/extensibility.d.ts +24 -64
- package/dist/extensibility.esm.js +35 -29
- package/dist/face-match.esm.js +2 -2
- package/dist/{faceCaptureManagerFactory-BxWPpxyd.d.ts → faceCaptureManagerFactory-CvtqcLxs.d.ts} +87 -54
- package/dist/{faceCaptureManagerFactory-CVnZ0fa5.esm.js → faceCaptureManagerFactory-pCmG4MeF.esm.js} +68 -7
- package/dist/faceCaptureSetup-BSextack.esm.js +2106 -0
- package/dist/{faceMatchManager-Ri4UbNz0.esm.js → faceMatchManager-Caal2zyV.esm.js} +2 -2
- package/dist/{faceMatchStateMachine-20DdZ3jg.esm.js → faceMatchStateMachine-BUc5FXYy.esm.js} +1 -1
- package/dist/{feature-management-CPQ4qv3F.esm.js → feature-management-B0sGlozZ.esm.js} +32 -7
- package/dist/feature-management.d.ts +1 -1
- package/dist/feature-management.esm.js +1 -1
- package/dist/field-comparison.esm.js +1 -1
- package/dist/{fieldComparisonManager-Cg6kPQQx.esm.js → fieldComparisonManager-BIs6HPJG.esm.js} +2 -2
- package/dist/fiscal-qr.d.ts +2 -56
- package/dist/fiscal-qr.esm.js +2 -308
- package/dist/fiscalQrManager-Bp_-3LJr.esm.js +34131 -0
- package/dist/fiscalQrManager-CHcBJwUM.d.ts +68 -0
- package/dist/flow-events.d.ts +1 -1
- package/dist/flow.d.ts +212 -185
- package/dist/flow.esm.js +119 -30
- package/dist/{flowCompletionService-tfeoGre9.esm.js → flowCompletionService-CLtbWhSK.esm.js} +2 -2
- package/dist/{flowServices-f5Ruz7R9.esm.js → flowServices-B5FwukTQ.esm.js} +91 -26
- package/dist/geolocation.esm.js +2 -2
- package/dist/{geolocationManager-CH6RfqFH.esm.js → geolocationManager-DIw-xq9a.esm.js} +2 -2
- package/dist/{geolocationStateMachine-DmbWFely.esm.js → geolocationStateMachine-DpG0TFOU.esm.js} +3 -3
- package/dist/getBrowser-CBiibsL-.esm.js +19 -0
- package/dist/{getBrowser-DNrQeL4T.esm.js → getBrowser-Cbe1C4Tn.esm.js} +2 -1
- package/dist/{getDeviceClass-9y-kbVDw.esm.js → getDeviceClass-5NYZg9s6.esm.js} +2 -2
- package/dist/getParsedUserAgent-B2iFDql1.esm.js +1278 -0
- package/dist/government-validation.d.ts +2 -85
- package/dist/government-validation.esm.js +3 -120
- package/dist/governmentValidationManager-D02vT4yY.d.ts +63 -0
- package/dist/governmentValidationManager-TjC9iVjH.esm.js +79 -0
- package/dist/governmentValidationStateMachine-D1ZnEqdd.esm.js +54 -0
- package/dist/home.d.ts +1 -1
- package/dist/home.esm.js +1 -1
- package/dist/id-ocr.d.ts +2 -2
- package/dist/id-ocr.esm.js +2 -2
- package/dist/id-selfie-flow.d.ts +3 -2
- package/dist/id-selfie-flow.esm.js +11 -10
- package/dist/id-verification.esm.js +2 -2
- package/dist/id.d.ts +29 -5
- package/dist/id.esm.js +48 -46
- package/dist/idCaptureDefaults-BcxjQDI3.esm.js +484 -0
- package/dist/{idCaptureManager-CqrqSjJV.d.ts → idCaptureManager-CvmHOWWd.d.ts} +227 -39
- package/dist/{idCaptureManager-BYwTZ2H8.esm.js → idCaptureManager-Vby8oYqh.esm.js} +259 -46
- package/dist/{idCaptureServices-44kwQItl.esm.js → idCaptureServices-CJIxD9ep.esm.js} +342 -31
- package/dist/idCaptureStateMachine-CmqihkUy.esm.js +5343 -0
- package/dist/{idOcrManager-DXc_xRN7.d.ts → idOcrManager-BF_cXZq8.d.ts} +1 -1
- package/dist/{idOcrManager-BIQYQXXj.esm.js → idOcrManager-DHU22hVn.esm.js} +2 -2
- package/dist/{idOcrStateMachine-cSxzHpHt.esm.js → idOcrStateMachine-33UvRAHE.esm.js} +1 -1
- package/dist/{idVerificationManager-JpV_SAsl.esm.js → idVerificationManager-CyaixD0D.esm.js} +2 -2
- package/dist/{idVerificationStateMachine-nPeUNyFq.esm.js → idVerificationStateMachine-BPGrQZEm.esm.js} +1 -1
- package/dist/identity-reuse.esm.js +2 -2
- package/dist/{identityReuseManager-kNCg9AbD.esm.js → identityReuseManager-CWaNHBO3.esm.js} +2 -2
- package/dist/{identityReuseStateMachine-DyulxDjP.esm.js → identityReuseStateMachine-CQgnATo5.esm.js} +1 -1
- package/dist/{index-CLMF0QLQ.d.ts → index-DLcJT5YP.d.ts} +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.esm.js +1 -1
- package/dist/{invokeOnCaptureCallback-GpvMuz9o.esm.js → invokeOnCaptureCallback-BjzPjJ_p.esm.js} +1 -1
- package/dist/mandatory-consent.d.ts +2 -2
- package/dist/mandatory-consent.esm.js +2 -2
- package/dist/{mandatoryConsentManager-DyPzUmsZ.d.ts → mandatoryConsentManager-CJSyhTpi.d.ts} +5 -5
- package/dist/{mandatoryConsentManager-B4Niyg_u.esm.js → mandatoryConsentManager-Du-m-tZ_.esm.js} +2 -2
- package/dist/{mandatoryConsentStateMachine-B4-1u-L8.esm.js → mandatoryConsentStateMachine-DSDAk7WZ.esm.js} +1 -1
- package/dist/multipartRecordingService-B3C_zlev.esm.js +594 -0
- package/dist/{permissionGuards-KINpmKtI.esm.js → permissionGuards-uYZYFu4J.esm.js} +1 -1
- package/dist/{permissionServices-UvUcOSRb.esm.js → permissionServices-Bj_fyWtv.esm.js} +5 -5
- package/dist/personhood.d.ts +6 -5
- package/dist/personhood.esm.js +10 -10
- package/dist/phone.esm.js +2 -2
- package/dist/{phoneManager-FsJ0W2Ei.esm.js → phoneManager-N1-sbrY4.esm.js} +2 -2
- package/dist/{phoneStateMachine-Ba0wKHyX.esm.js → phoneStateMachine-jl8LJKCo.esm.js} +1 -1
- package/dist/{platform-BJrm5nzZ.esm.js → platform-DkcRc9JV.esm.js} +29 -1
- package/dist/qe-signature.d.ts +5 -3
- package/dist/qe-signature.esm.js +2 -2
- package/dist/recordingsRepository-CCWy13M-.esm.js +72 -0
- package/dist/redirect-to-mobile.esm.js +2 -2
- package/dist/{redirectToMobileManager-y4VQB11M.esm.js → redirectToMobileManager-DsFzdTwA.esm.js} +2 -2
- package/dist/{redirectToMobileStateMachine-Cyv2x0PP.esm.js → redirectToMobileStateMachine-v3otpT-L.esm.js} +1 -1
- package/dist/{rolldown-runtime-FZ4Itg2g.esm.js → rolldown-runtime-FDOR9p9I.esm.js} +1 -19
- package/dist/{runChildModule-Dukuw23X.esm.js → runChildModule-TuyGE00X.esm.js} +3 -21
- package/dist/safeStorage-B-trhxg6.esm.js +423 -0
- package/dist/{sdkVersion-D1Bm59g6.esm.js → sdkVersion-CLxKvdyz.esm.js} +1 -1
- package/dist/selfie.d.ts +5 -5
- package/dist/selfie.esm.js +14 -76
- package/dist/{selfieErrorUtils-C2PYBVsp.esm.js → selfieErrorUtils-C77GXJH6.esm.js} +30 -4
- package/dist/{selfieManager-Bj6B2ZVy.esm.js → selfieManager-CihVnODO.esm.js} +5 -5
- package/dist/{selfieManager-DwlCppg0.d.ts → selfieManager-D1KRJ39M.d.ts} +8 -11
- package/dist/selfieStateMachine-fwMmNtOi.esm.js +69 -0
- package/dist/{session-BFdLgN4i.esm.js → session-BHIeAamR.esm.js} +4 -5
- package/dist/session.d.ts +21 -11
- package/dist/session.esm.js +5 -5
- package/dist/{sessionInitializer-dlfDehHk.esm.js → sessionInitializer-BLoK7SP9.esm.js} +187 -68
- package/dist/{setup-BgoWtvIS.d.ts → setup-Cv-JM9QC.d.ts} +63 -69
- package/dist/{setup-BIAtLa8k.esm.js → setup-msLybMbC.esm.js} +226 -100
- package/dist/signature.esm.js +2 -2
- package/dist/{signatureManager-Ca43yhwk.esm.js → signatureManager-ChsB-nMD.esm.js} +2 -2
- package/dist/{signatureStateMachine-K1LMRrxG.esm.js → signatureStateMachine-BHPwkJZS.esm.js} +1 -1
- package/dist/{src-0Jurt29N.esm.js → src-35ekGRzK.esm.js} +1 -1
- package/dist/{stats-B0nFKawG.esm.js → stats-DkK-f8JT.esm.js} +1 -1
- package/dist/stats.esm.js +1 -1
- package/dist/{trueSightService---iW2KKJ.esm.js → trueSightService-CKrrfV0Q.esm.js} +7 -7
- package/dist/trust-graph.esm.js +1 -1
- package/dist/{types-BX_XkMsQ2.d.ts → types-9_esGTPj.d.ts} +1 -1
- package/dist/types-BT_Oalip.d.ts +1 -0
- package/dist/{types-DelMqZLe.d.ts → types-BjSly8cp.d.ts} +1 -1
- package/dist/{types-Hmd7U0JA.d.ts → types-CM-jtjJ2.d.ts} +6 -81
- package/dist/{types-Bdf8_LYB2.d.ts → types-CjKBS37a2.d.ts} +303 -13
- package/dist/{types-DVmXIdzW.d.ts → types-D0gekt4U.d.ts} +38 -5
- package/dist/types-DgDvvzg0.d.ts +10 -0
- package/dist/{types-KPvmag_B.d.ts → types-Do5rEXij.d.ts} +7 -4
- package/dist/types-ZT1XFIJ8.d.ts +6 -0
- package/dist/video-selfie.d.ts +59 -35
- package/dist/video-selfie.esm.js +510 -601
- package/dist/{videoSelfieCameraWarmer-NEhFZvWx.esm.js → videoSelfieCameraWarmer-CB1IzZkt.esm.js} +14 -153
- package/dist/videoSelfieFlowModuleMachine-BUe2uACW.esm.js +32 -0
- package/dist/{videoSelfieStepDetector-D3oo2ofo.d.ts → videoSelfieStepDetector-5YHFe0Mq.d.ts} +21 -5
- package/dist/virtualCameraCheck-WOloJ-do.esm.js +48 -0
- package/dist/warmup-CUUnwYxe.esm.js +714 -0
- package/dist/warmup-Cis2p6O0.d.ts +128 -0
- package/dist/wasm.d.ts +30 -6
- package/dist/wasm.esm.js +36 -4
- package/dist/{wasmDsFlagSync-BqUCwLY8.esm.js → wasmDsFlagSync-B2e8p268.esm.js} +2 -2
- package/dist/{wasmWebClient-DM8lkb0z.esm.js → wasmWebClient-B7baE-Wf.esm.js} +358 -28
- package/dist/watchlist-for-business.d.ts +2 -78
- package/dist/watchlist-for-business.esm.js +3 -102
- package/dist/watchlist.esm.js +2 -2
- package/dist/watchlistForBusinessManager-CpuuB1J2.esm.js +107 -0
- package/dist/watchlistForBusinessManager-CsnJnG-C.d.ts +99 -0
- package/dist/{watchlistForBusinessStateMachine-CxFnlshm.esm.js → watchlistForBusinessStateMachine-DEzgjz7C.esm.js} +13 -6
- package/dist/{watchlistManager-LoNZH9qm.esm.js → watchlistManager-CI8BHFob.esm.js} +2 -2
- package/dist/{watchlistStateMachine-DIKQDoUT.esm.js → watchlistStateMachine-DvOby3a-.esm.js} +1 -1
- package/dist/workflow.d.ts +12 -8
- package/dist/workflow.esm.js +48 -39
- package/package.json +4 -10
- package/dist/BrowserStorageProvider-k-FDkC4W.esm.js +0 -67
- package/dist/FaceDetectionProvider-Mh6q3EbA.d.ts +0 -349
- package/dist/IFaceAvatarCapability-BrL19G0s.d.ts +0 -23
- package/dist/IStorageCapability-ORkQfK3F.d.ts +0 -242
- package/dist/OpenViduRecordingProvider-Du98qevC.esm.js +0 -85
- package/dist/createFaceAvatar-BEj18KXi.d.ts +0 -50
- package/dist/document-upload.d.ts +0 -325
- package/dist/document-upload.esm.js +0 -197
- package/dist/electronicSignatureManager-CcUXQZS7.d.ts +0 -1300
- package/dist/faceCaptureSetup-Cd-04W_X.esm.js +0 -863
- package/dist/getBrowser-Cb8Zgrgp.esm.js +0 -7
- package/dist/getParsedUserAgent-pJjATANs.esm.js +0 -1622
- package/dist/governmentValidationStateMachine-CK9DrZXX.esm.js +0 -226
- package/dist/idCaptureDefaults-WeHbQM7W.esm.js +0 -225
- package/dist/idCaptureStateMachine-kZ5OpdfM.esm.js +0 -3342
- package/dist/lib-DAyUtOTj.esm.js +0 -12420
- package/dist/manualReviewService-D4IkipnN.esm.js +0 -15
- package/dist/mediaRecorderOptions-dALSV8af.esm.js +0 -40
- package/dist/onDeviceFaceResults-CUHwyZT4.esm.js +0 -646
- package/dist/openviduLazy-CCDpFWg1.esm.js +0 -10
- package/dist/recordingService-3NSENVwp.esm.js +0 -329
- package/dist/safeStorage-Ep56I-f_.esm.js +0 -982
- package/dist/selfieStateMachine-CHV_WNst.esm.js +0 -55
- package/dist/trueSight-B_icM8r2.esm.js +0 -1
- package/dist/types-EELWyWpd.d.ts +0 -6
- package/dist/types-Vb4P9ovf.d.ts +0 -22
- package/dist/warmup-Dv2alr2-.d.ts +0 -82
- package/dist/wasmDefaults-DTUrftxR.esm.js +0 -125
- package/dist/{Face2DProvider-UUQt_vRC.esm.js → Face2DProvider-BF48sz5c.esm.js} +1 -1
- package/dist/{PrivacyLensProvider-D8PS7AJa.esm.js → PrivacyLensProvider-EwnC_C5n.esm.js} +1 -1
- /package/dist/{types-BfgmV7s72.d.ts → types-BfgmV7s7.d.ts} +0 -0
- /package/dist/{types-CJ7Yl9K-2.d.ts → types-CJ7Yl9K-.d.ts} +0 -0
package/dist/id.esm.js
CHANGED
|
@@ -1,11 +1,21 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { n as eventModuleNames } from "./events-DYiyoSlx.esm.js";
|
|
1
|
+
import { n as eventModuleNames } from "./events-ijlbX_Wx.esm.js";
|
|
3
2
|
import { i as assign, s as createActor } from "./xstate.esm-BuFLFuzz.esm.js";
|
|
4
3
|
import { n as fromPromise } from "./xstate-actors.esm-BXeQ-Ucz.esm.js";
|
|
5
|
-
import { a as
|
|
6
|
-
import { n as createIdCaptureActor, r as createIdCaptureManagerFromActor, t as createIdCaptureManager } from "./idCaptureManager-
|
|
7
|
-
import { a as
|
|
8
|
-
import { t as invokeOnCaptureCallback } from "./invokeOnCaptureCallback-
|
|
4
|
+
import { a as createIdProtectedCaptureController, c as DIGITAL_ID_DOCUMENT_TYPES, d as resolveDigitalIdImplementation, f as MANUAL_UPLOAD_EXHAUSTION_FORWARD_MS, h as resolveWalletPlatform, i as createIdCaptureOnlyDeliveryActor, l as DIGITAL_ID_REGISTRY, m as MANUAL_UPLOAD_MAX_RETRIES, n as provideIdProtectedCaptureController, p as MANUAL_UPLOAD_MAX_FILE_SIZE_BYTES, r as attachIdProtectedCaptureController, t as idCaptureMachine, u as isRedirectFlowType } from "./idCaptureStateMachine-CmqihkUy.esm.js";
|
|
5
|
+
import { n as createIdCaptureActor, r as createIdCaptureManagerFromActor, t as createIdCaptureManager } from "./idCaptureManager-Vby8oYqh.esm.js";
|
|
6
|
+
import { _ as ID_ERROR_CODES, a as getRealQualityValue, c as preloadIdRecordingProvider, d as startRecordingSession, f as stopRecording, g as validateUploadResponse, h as uploadManualIdFile, i as finalizeRecordingSession, l as prepareRecordingForCameraRetry, m as uploadIdImage, n as barcodeToBase64, o as initializeIdCapture, p as stopStream, r as disposeRecordingSession, s as pauseRecordingForAttempt, t as addBarcode, u as processId, y as resolveIdCaptureThresholds } from "./idCaptureServices-CJIxD9ep.esm.js";
|
|
7
|
+
import { t as invokeOnCaptureCallback } from "./invokeOnCaptureCallback-BjzPjJ_p.esm.js";
|
|
8
|
+
//#region src/modules/id/deviceWallet/deviceWalletErrors.ts
|
|
9
|
+
/**
|
|
10
|
+
* Fail reason → i18n key for the device-wallet error screen (same shape as
|
|
11
|
+
* `DIGITAL_UPLOAD_ERROR_KEYS`). Keys are authored in i18nexus.
|
|
12
|
+
*/
|
|
13
|
+
const DEVICE_WALLET_ERROR_KEYS = {
|
|
14
|
+
UNSUPPORTED_PLATFORM: "idv2.deviceWallet.unsupportedPlatformDescription",
|
|
15
|
+
NO_CREDENTIAL: "idv2.deviceWallet.noCredentialDescription",
|
|
16
|
+
WALLET_ERROR: "idv2.deviceWallet.errorDescription"
|
|
17
|
+
};
|
|
18
|
+
//#endregion
|
|
9
19
|
//#region src/modules/id/idCaptureOnlyStateMachine.ts
|
|
10
20
|
function buildSubImage(canvas) {
|
|
11
21
|
if (!canvas) return void 0;
|
|
@@ -60,42 +70,31 @@ async function finalizeIdCaptureOnly(input, signal) {
|
|
|
60
70
|
* recording steps are local instead of remote.
|
|
61
71
|
*/
|
|
62
72
|
const idCaptureOnlyMachine = idCaptureMachine.provide({
|
|
63
|
-
actors: {
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
uploadIdImage: fromPromise(async ({ input, signal }) => {
|
|
71
|
-
return await finalizeIdCaptureOnly(input, signal);
|
|
73
|
+
actors: {
|
|
74
|
+
/** No backend processing in captureOnly. */
|
|
75
|
+
processId: fromPromise(async () => ({ isDocumentExpired: false })) },
|
|
76
|
+
actions: {
|
|
77
|
+
attachProtectedController: assign(({ self }) => {
|
|
78
|
+
attachIdProtectedCaptureController(self, createIdProtectedCaptureController({ finalizeCaptureOnly: finalizeIdCaptureOnly }));
|
|
79
|
+
return {};
|
|
72
80
|
}),
|
|
73
|
-
/** No backend processing in captureOnly. */
|
|
74
|
-
processId: fromPromise(async () => ({ isDocumentExpired: false })),
|
|
75
81
|
/**
|
|
76
|
-
*
|
|
77
|
-
*
|
|
78
|
-
* does not include any recording artifacts.
|
|
82
|
+
* Routes the rich payload from local delivery into `captureOnlyImages`
|
|
83
|
+
* keyed by side instead of the regular `capturedImages` slot.
|
|
79
84
|
*/
|
|
80
|
-
|
|
85
|
+
storeCapturedImage: assign(({ context, event }) => {
|
|
86
|
+
if (!("output" in event) || !context.currentMode) return { captureOnlyImages: context.captureOnlyImages };
|
|
87
|
+
const image = event.output;
|
|
88
|
+
const side = context.currentMode === "back" ? "back" : "front";
|
|
89
|
+
return {
|
|
90
|
+
captureOnlyImages: {
|
|
91
|
+
...context.captureOnlyImages,
|
|
92
|
+
[side]: image
|
|
93
|
+
},
|
|
94
|
+
previewImageUrl: image.croppedImage?.url ?? image.url ?? context.previewImageUrl
|
|
95
|
+
};
|
|
96
|
+
})
|
|
81
97
|
},
|
|
82
|
-
actions: {
|
|
83
|
-
/**
|
|
84
|
-
* Routes the rich payload from `uploadIdImage` into `captureOnlyImages`
|
|
85
|
-
* keyed by side instead of the regular `capturedImages` slot.
|
|
86
|
-
*/
|
|
87
|
-
storeCapturedImage: assign(({ context, event }) => {
|
|
88
|
-
if (!("output" in event) || !context.currentMode) return { captureOnlyImages: context.captureOnlyImages };
|
|
89
|
-
const image = event.output;
|
|
90
|
-
const side = context.currentMode === "back" ? "back" : "front";
|
|
91
|
-
return {
|
|
92
|
-
captureOnlyImages: {
|
|
93
|
-
...context.captureOnlyImages,
|
|
94
|
-
[side]: image
|
|
95
|
-
},
|
|
96
|
-
previewImageUrl: image.croppedImage?.url ?? image.url ?? context.previewImageUrl
|
|
97
|
-
};
|
|
98
|
-
}) },
|
|
99
98
|
guards: {
|
|
100
99
|
hasUploadValidationError: () => false,
|
|
101
100
|
/**
|
|
@@ -114,6 +113,9 @@ storeCapturedImage: assign(({ context, event }) => {
|
|
|
114
113
|
}
|
|
115
114
|
}
|
|
116
115
|
});
|
|
116
|
+
function provideIdCaptureOnlyController(controller) {
|
|
117
|
+
return provideIdProtectedCaptureController(idCaptureOnlyMachine, controller).provide({ actors: { captureOnlyDelivery: createIdCaptureOnlyDeliveryActor(controller) } });
|
|
118
|
+
}
|
|
117
119
|
//#endregion
|
|
118
120
|
//#region src/modules/id/idCaptureOnlyActor.ts
|
|
119
121
|
/**
|
|
@@ -147,17 +149,17 @@ const DEFAULT_ID_CAPTURE_ONLY_CONFIG = {
|
|
|
147
149
|
perCountryPerDocOverrides: {}
|
|
148
150
|
};
|
|
149
151
|
function createIdCaptureOnlyActor(options) {
|
|
150
|
-
const dependencies = options.dependencies ?? { storage: new BrowserStorageProvider() };
|
|
151
152
|
const mergedConfig = {
|
|
152
153
|
...DEFAULT_ID_CAPTURE_ONLY_CONFIG,
|
|
153
154
|
...options.config
|
|
154
155
|
};
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
156
|
+
const config = {
|
|
157
|
+
...mergedConfig,
|
|
158
|
+
thresholds: resolveIdCaptureThresholds(mergedConfig)
|
|
159
|
+
};
|
|
160
|
+
return createActor(provideIdCaptureOnlyController(createIdProtectedCaptureController({ finalizeCaptureOnly: finalizeIdCaptureOnly })), { input: {
|
|
161
|
+
config,
|
|
162
|
+
dependencies: options.dependencies
|
|
161
163
|
} }).start();
|
|
162
164
|
}
|
|
163
165
|
//#endregion
|
|
@@ -211,4 +213,4 @@ function createIdCaptureOnlyManager(options) {
|
|
|
211
213
|
return createIdCaptureOnlyManagerFromActor(createIdCaptureOnlyActor(options), options.config);
|
|
212
214
|
}
|
|
213
215
|
//#endregion
|
|
214
|
-
export { ID_ERROR_CODES, MANUAL_UPLOAD_EXHAUSTION_FORWARD_MS, MANUAL_UPLOAD_MAX_FILE_SIZE_BYTES, MANUAL_UPLOAD_MAX_RETRIES, addBarcode, barcodeToBase64, createIdCaptureActor, createIdCaptureManager, createIdCaptureOnlyActor, createIdCaptureOnlyManager, createIdCaptureOnlyManagerFromActor, idCaptureMachine, idCaptureOnlyMachine, initializeIdCapture, preloadIdRecordingProvider, processId, startRecordingSession, stopRecording, stopStream, uploadIdImage, uploadManualIdFile, validateUploadResponse };
|
|
216
|
+
export { DEVICE_WALLET_ERROR_KEYS, DIGITAL_ID_DOCUMENT_TYPES, DIGITAL_ID_REGISTRY, ID_ERROR_CODES, MANUAL_UPLOAD_EXHAUSTION_FORWARD_MS, MANUAL_UPLOAD_MAX_FILE_SIZE_BYTES, MANUAL_UPLOAD_MAX_RETRIES, addBarcode, barcodeToBase64, createIdCaptureActor, createIdCaptureManager, createIdCaptureOnlyActor, createIdCaptureOnlyManager, createIdCaptureOnlyManagerFromActor, disposeRecordingSession, finalizeRecordingSession, getRealQualityValue, idCaptureMachine, idCaptureOnlyMachine, initializeIdCapture, isRedirectFlowType, pauseRecordingForAttempt, preloadIdRecordingProvider, prepareRecordingForCameraRetry, processId, resolveDigitalIdImplementation, resolveWalletPlatform, startRecordingSession, stopRecording, stopStream, uploadIdImage, uploadManualIdFile, validateUploadResponse };
|
|
@@ -0,0 +1,484 @@
|
|
|
1
|
+
import { b as resolveWasmSource, p as WASM_MODEL_FILES } from "./wasmWebClient-B7baE-Wf.esm.js";
|
|
2
|
+
import { p as getBarcodeEnhanceModelUrl } from "./setup-msLybMbC.esm.js";
|
|
3
|
+
import { s as wasmRuntime, t as getResolvedModelSource } from "./warmup-CUUnwYxe.esm.js";
|
|
4
|
+
import { i as BaseWasmProvider } from "./safeStorage-B-trhxg6.esm.js";
|
|
5
|
+
import { t as IncodeCanvas } from "./canvas-BxFzWTt-.esm.js";
|
|
6
|
+
//#region ../infra/src/media/CameraCompositor.ts
|
|
7
|
+
const MAX_COMPOSITE_LONG_EDGE = 1280;
|
|
8
|
+
const MAX_COMPOSITE_SHORT_EDGE = 720;
|
|
9
|
+
const FRAME_INTERVAL_TOLERANCE_RATIO = .9;
|
|
10
|
+
const DEFAULT_RESUME_TIMEOUT_MS = 2e3;
|
|
11
|
+
/**
|
|
12
|
+
* Composites the *active* camera into a canvas and exposes the canvas as a
|
|
13
|
+
* single, stable `MediaStream` to record. Switching cameras (front ↔ back)
|
|
14
|
+
* just repoints what the canvas draws — the output stream and its audio track
|
|
15
|
+
* are never replaced — so a single `MediaRecorder` produces one continuous
|
|
16
|
+
* video that follows the camera switches (V1 parity), instead of restarting
|
|
17
|
+
* per camera.
|
|
18
|
+
*
|
|
19
|
+
* The audio track from the initial stream is carried through unchanged across
|
|
20
|
+
* video switches, so there's no audio glitch when the camera flips.
|
|
21
|
+
*/
|
|
22
|
+
var CameraCompositor = class {
|
|
23
|
+
constructor(options = {}) {
|
|
24
|
+
this.canvas = null;
|
|
25
|
+
this.ctx = null;
|
|
26
|
+
this.video = null;
|
|
27
|
+
this.frameRequestId = null;
|
|
28
|
+
this.frameRequestKind = null;
|
|
29
|
+
this.lastDrawTimeMs = null;
|
|
30
|
+
this.lastVideoTimeSeconds = null;
|
|
31
|
+
this.audioTrack = null;
|
|
32
|
+
this.videoTrack = null;
|
|
33
|
+
this.composite = null;
|
|
34
|
+
this.fps = options.fps ?? 30;
|
|
35
|
+
this.frameIntervalMs = this.fps > 0 ? 1e3 / this.fps : 0;
|
|
36
|
+
this.resumeTimeoutMs = options.resumeTimeoutMs ?? DEFAULT_RESUME_TIMEOUT_MS;
|
|
37
|
+
}
|
|
38
|
+
/**
|
|
39
|
+
* Begin compositing `stream` and return the composite stream to record. The
|
|
40
|
+
* stream's audio track (if any) is carried through unchanged across later
|
|
41
|
+
* `switchVideo` calls.
|
|
42
|
+
*/
|
|
43
|
+
start(stream) {
|
|
44
|
+
this.canvas = document.createElement("canvas");
|
|
45
|
+
this.ctx = this.canvas.getContext("2d");
|
|
46
|
+
this.video = document.createElement("video");
|
|
47
|
+
this.video.muted = true;
|
|
48
|
+
this.video.playsInline = true;
|
|
49
|
+
this.audioTrack = stream.getAudioTracks()[0] ?? null;
|
|
50
|
+
this.setVideoSource(stream);
|
|
51
|
+
const composite = this.canvas.captureStream(this.fps);
|
|
52
|
+
if (this.audioTrack) composite.addTrack(this.audioTrack);
|
|
53
|
+
this.composite = composite;
|
|
54
|
+
this.startDrawLoop();
|
|
55
|
+
return composite;
|
|
56
|
+
}
|
|
57
|
+
/**
|
|
58
|
+
* Swap the camera feeding the canvas without interrupting the composite
|
|
59
|
+
* stream. Pass a video-only stream (audio is kept from `start`). The previous
|
|
60
|
+
* video track is stopped.
|
|
61
|
+
*/
|
|
62
|
+
switchVideo(stream) {
|
|
63
|
+
if (!this.composite) return;
|
|
64
|
+
const previousVideoTrack = this.videoTrack;
|
|
65
|
+
this.setVideoSource(stream);
|
|
66
|
+
this.startDrawLoop();
|
|
67
|
+
if (previousVideoTrack) previousVideoTrack.stop();
|
|
68
|
+
}
|
|
69
|
+
/** The composite stream being recorded, if compositing is active. */
|
|
70
|
+
get stream() {
|
|
71
|
+
return this.composite ?? void 0;
|
|
72
|
+
}
|
|
73
|
+
/** Pause source playback and drawing while the page is backgrounded. */
|
|
74
|
+
pause() {
|
|
75
|
+
this.finishResume("timed-out");
|
|
76
|
+
this.cancelDrawLoop();
|
|
77
|
+
this.video?.pause();
|
|
78
|
+
}
|
|
79
|
+
/**
|
|
80
|
+
* Restart source playback and wait for a genuinely new camera frame to be
|
|
81
|
+
* drawn into the stable canvas stream. The caller must not resume encoding
|
|
82
|
+
* until this resolves with `resumed`.
|
|
83
|
+
*/
|
|
84
|
+
async resume(signal) {
|
|
85
|
+
const video = this.video;
|
|
86
|
+
if (!video || !this.composite) return "timed-out";
|
|
87
|
+
if (this.audioTrack?.readyState === "ended") return "audio-ended";
|
|
88
|
+
if (!this.videoTrack || this.videoTrack.readyState === "ended") return "video-ended";
|
|
89
|
+
if (signal?.aborted) return "timed-out";
|
|
90
|
+
try {
|
|
91
|
+
await video.play();
|
|
92
|
+
} catch {
|
|
93
|
+
return "timed-out";
|
|
94
|
+
}
|
|
95
|
+
if (signal?.aborted) return "timed-out";
|
|
96
|
+
this.finishResume("timed-out");
|
|
97
|
+
return new Promise((resolve) => {
|
|
98
|
+
const timeout = setTimeout(() => {
|
|
99
|
+
this.finishResume("timed-out");
|
|
100
|
+
}, this.resumeTimeoutMs);
|
|
101
|
+
if (signal) {
|
|
102
|
+
const onAbort = () => this.finishResume("timed-out");
|
|
103
|
+
this.resumeWaiter = {
|
|
104
|
+
resolve,
|
|
105
|
+
timeout,
|
|
106
|
+
signal,
|
|
107
|
+
onAbort
|
|
108
|
+
};
|
|
109
|
+
signal.addEventListener("abort", onAbort, { once: true });
|
|
110
|
+
if (signal.aborted) {
|
|
111
|
+
this.finishResume("timed-out");
|
|
112
|
+
return;
|
|
113
|
+
}
|
|
114
|
+
} else this.resumeWaiter = {
|
|
115
|
+
resolve,
|
|
116
|
+
timeout
|
|
117
|
+
};
|
|
118
|
+
this.startDrawLoop(false);
|
|
119
|
+
});
|
|
120
|
+
}
|
|
121
|
+
/** Stop compositing and release the canvas, audio, and video tracks. */
|
|
122
|
+
stop() {
|
|
123
|
+
this.finishResume("timed-out");
|
|
124
|
+
this.cancelDrawLoop();
|
|
125
|
+
this.videoTrack?.stop();
|
|
126
|
+
this.audioTrack?.stop();
|
|
127
|
+
this.composite?.getTracks().forEach((track) => track.stop());
|
|
128
|
+
if (this.video) this.video.srcObject = null;
|
|
129
|
+
this.canvas = null;
|
|
130
|
+
this.ctx = null;
|
|
131
|
+
this.video = null;
|
|
132
|
+
this.videoTrack = null;
|
|
133
|
+
this.audioTrack = null;
|
|
134
|
+
this.composite = null;
|
|
135
|
+
}
|
|
136
|
+
setVideoSource(stream) {
|
|
137
|
+
this.videoTrack = stream.getVideoTracks()[0] ?? null;
|
|
138
|
+
const video = this.video;
|
|
139
|
+
if (!video) return;
|
|
140
|
+
video.srcObject = new MediaStream(stream.getVideoTracks());
|
|
141
|
+
video.play().catch(() => {});
|
|
142
|
+
}
|
|
143
|
+
startDrawLoop(resetSourceTime = true) {
|
|
144
|
+
this.cancelDrawLoop();
|
|
145
|
+
this.lastDrawTimeMs = null;
|
|
146
|
+
if (resetSourceTime) this.lastVideoTimeSeconds = null;
|
|
147
|
+
const draw = (timeMs) => {
|
|
148
|
+
const elapsed = this.lastDrawTimeMs === null ? Infinity : timeMs - this.lastDrawTimeMs;
|
|
149
|
+
if ((this.frameIntervalMs === 0 || elapsed >= this.frameIntervalMs * FRAME_INTERVAL_TOLERANCE_RATIO) && this.drawCurrentFrame()) {
|
|
150
|
+
this.lastDrawTimeMs = timeMs;
|
|
151
|
+
this.finishResume("resumed");
|
|
152
|
+
}
|
|
153
|
+
this.scheduleNextFrame(draw);
|
|
154
|
+
};
|
|
155
|
+
this.scheduleNextFrame(draw);
|
|
156
|
+
}
|
|
157
|
+
finishResume(result) {
|
|
158
|
+
const waiter = this.resumeWaiter;
|
|
159
|
+
if (!waiter) return;
|
|
160
|
+
this.resumeWaiter = void 0;
|
|
161
|
+
clearTimeout(waiter.timeout);
|
|
162
|
+
if ("signal" in waiter) waiter.signal.removeEventListener("abort", waiter.onAbort);
|
|
163
|
+
waiter.resolve(result);
|
|
164
|
+
}
|
|
165
|
+
scheduleNextFrame(callback) {
|
|
166
|
+
const video = this.video;
|
|
167
|
+
if (video && typeof video.requestVideoFrameCallback === "function") {
|
|
168
|
+
this.frameRequestKind = "video";
|
|
169
|
+
this.frameRequestId = video.requestVideoFrameCallback(callback);
|
|
170
|
+
return;
|
|
171
|
+
}
|
|
172
|
+
this.frameRequestKind = "animation";
|
|
173
|
+
this.frameRequestId = requestAnimationFrame(callback);
|
|
174
|
+
}
|
|
175
|
+
cancelDrawLoop() {
|
|
176
|
+
if (this.frameRequestId === null) return;
|
|
177
|
+
if (this.frameRequestKind === "video" && this.video && typeof this.video.cancelVideoFrameCallback === "function") this.video.cancelVideoFrameCallback(this.frameRequestId);
|
|
178
|
+
else cancelAnimationFrame(this.frameRequestId);
|
|
179
|
+
this.frameRequestId = null;
|
|
180
|
+
this.frameRequestKind = null;
|
|
181
|
+
}
|
|
182
|
+
drawCurrentFrame() {
|
|
183
|
+
const video = this.video;
|
|
184
|
+
const canvas = this.canvas;
|
|
185
|
+
const ctx = this.ctx;
|
|
186
|
+
if (!video || !canvas || !ctx || video.videoWidth <= 0) return false;
|
|
187
|
+
if (this.lastVideoTimeSeconds === video.currentTime) return false;
|
|
188
|
+
const dimensions = this.getBoundedDimensions(video.videoWidth, video.videoHeight);
|
|
189
|
+
if (canvas.width !== dimensions.width || canvas.height !== dimensions.height) {
|
|
190
|
+
canvas.width = dimensions.width;
|
|
191
|
+
canvas.height = dimensions.height;
|
|
192
|
+
}
|
|
193
|
+
ctx.drawImage(video, 0, 0, canvas.width, canvas.height);
|
|
194
|
+
this.lastVideoTimeSeconds = video.currentTime;
|
|
195
|
+
return true;
|
|
196
|
+
}
|
|
197
|
+
getBoundedDimensions(width, height) {
|
|
198
|
+
const longEdge = Math.max(width, height);
|
|
199
|
+
const shortEdge = Math.min(width, height);
|
|
200
|
+
const scale = Math.min(1, MAX_COMPOSITE_LONG_EDGE / longEdge, MAX_COMPOSITE_SHORT_EDGE / shortEdge);
|
|
201
|
+
return {
|
|
202
|
+
width: Math.max(1, Math.round(width * scale)),
|
|
203
|
+
height: Math.max(1, Math.round(height * scale))
|
|
204
|
+
};
|
|
205
|
+
}
|
|
206
|
+
};
|
|
207
|
+
//#endregion
|
|
208
|
+
//#region ../infra/src/wasm/idCaptureWasmApi.ts
|
|
209
|
+
var IdCaptureWasmApi = class {
|
|
210
|
+
constructor(runtime = wasmRuntime) {
|
|
211
|
+
this.runtime = runtime;
|
|
212
|
+
}
|
|
213
|
+
async setIdCaptureThresholds(type, blurThreshold, blurChangeThreshold, glareThreshold, clsThreshold, sideThreshold, iouThreshold, idDetectedTimeout, autocaptureTimeout, framesAggregationInterval) {
|
|
214
|
+
this.runtime.requireIdCaptureApi("Unable to set thresholds, cpp API hasn't been initialized").setIdCaptureThresholds(this.runtime.pipelineTypeToWasmEnum(type), blurThreshold, blurChangeThreshold, glareThreshold, clsThreshold, sideThreshold, iouThreshold, idDetectedTimeout, autocaptureTimeout, framesAggregationInterval);
|
|
215
|
+
}
|
|
216
|
+
async setIdCaptureCallbacks(type, onFarAway, onDetectionStarted, onMaskChange, onBlur, onGlare, onCapturing, onCapture, onBestFrame, onIDNotDetected, onSwitchToManualCapture, onIDTypeChange, onIDSideChange, onCapturingCounterValueChange) {
|
|
217
|
+
this.runtime.requireIdCaptureApi("Unable to set callbacks, cpp API hasn't been initialized").setIdCaptureCallbacks(this.runtime.pipelineTypeToWasmEnum(type), onFarAway, onDetectionStarted, onMaskChange, onBlur, onGlare, onCapturing, onCapture, onBestFrame, onIDNotDetected, onSwitchToManualCapture, onIDTypeChange, onIDSideChange, onCapturingCounterValueChange);
|
|
218
|
+
}
|
|
219
|
+
async setIdCaptureGeometryParams(type, areaDown, areaUp, areaIOSPassportUp, areaIOSPassportDown, widthIOSUp, widthIOSDown, widthDown, widthUp, windowOuterWidth, windowOuterHeight, windowInnerWidth, windowInnerHeight) {
|
|
220
|
+
this.runtime.requireIdCaptureApi("Unable to set geometry params, cpp API hasn't been initialized").setIdCaptureGeometryParams(this.runtime.pipelineTypeToWasmEnum(type), areaDown, areaUp, areaIOSPassportUp, areaIOSPassportDown, widthIOSUp, widthIOSDown, widthDown, widthUp, windowOuterWidth, windowOuterHeight, windowInnerWidth, windowInnerHeight);
|
|
221
|
+
}
|
|
222
|
+
async setIdCaptureConfigParams(type, isFixedMask, isIPhone14OrHigher, idType, isBlurCheckEnabled, isGlareCheckEnabled, _isIdFaceQualityCheckEnabled, isIouCheckEnabled, _isFPSLimitEnabled) {
|
|
223
|
+
this.runtime.requireIdCaptureApi("Unable to set config params, cpp API hasn't been initialized").setIdCaptureConfigParams(this.runtime.pipelineTypeToWasmEnum(type), isFixedMask, isIPhone14OrHigher, idType, isBlurCheckEnabled, isGlareCheckEnabled, isIouCheckEnabled);
|
|
224
|
+
}
|
|
225
|
+
setIdCaptureModelType(pipelineType, modelType) {
|
|
226
|
+
this.runtime.requireIdCaptureApi("Unable to set model type, cpp API hasn't been initialized").setIdCaptureModelType(this.runtime.pipelineTypeToWasmEnum(pipelineType), this.runtime.IdCaptureModelTypeToWasmEnum(modelType));
|
|
227
|
+
}
|
|
228
|
+
setIdBarcodeCaptureEnabled(pipelineType, enabled) {
|
|
229
|
+
this.runtime.requireIdCaptureApi("Unable to set barcode capture enabled, cpp API hasn't been initialized").setIdBarcodeCaptureEnabled(this.runtime.pipelineTypeToWasmEnum(pipelineType), enabled);
|
|
230
|
+
}
|
|
231
|
+
setIdBarcodeAutoCaptureOnDecode(pipelineType, enabled) {
|
|
232
|
+
this.runtime.requireIdCaptureApi("Unable to set barcode auto-capture-on-decode, cpp API hasn't been initialized").setIdBarcodeAutoCaptureOnDecode(this.runtime.pipelineTypeToWasmEnum(pipelineType), enabled);
|
|
233
|
+
}
|
|
234
|
+
setIdBarcodeDecodedCallback(pipelineType, onBarcodeDecoded) {
|
|
235
|
+
this.runtime.requireIdCaptureApi("Unable to set barcode decoded callback, cpp API hasn't been initialized").setIdBarcodeDecodedCallback(this.runtime.pipelineTypeToWasmEnum(pipelineType), onBarcodeDecoded);
|
|
236
|
+
}
|
|
237
|
+
async setIdBarcodeEnhancementModel(pipelineType, modelPath) {
|
|
238
|
+
const message = "Unable to set barcode enhancement model, cpp API hasn't been initialized";
|
|
239
|
+
this.runtime.requireIdCaptureApi(message);
|
|
240
|
+
const buffer = await resolveWasmSource(modelPath, "barcode model");
|
|
241
|
+
return this.runtime.requireIdCaptureApi(message).setBarcodeEnhancementModel(this.runtime.pipelineTypeToWasmEnum(pipelineType), buffer);
|
|
242
|
+
}
|
|
243
|
+
IdPerspectiveTransform(image, frameRect) {
|
|
244
|
+
return this.runtime.requireIdCaptureApi("Unable to perform perspective transform, cpp API hasn't been initialized").IdPerspectiveTransform(image, frameRect);
|
|
245
|
+
}
|
|
246
|
+
/**
|
|
247
|
+
* Kept-dead: mirrors upstream `wasmApi.runIdCapture`. Nothing in the SDK calls
|
|
248
|
+
* it; it exists so the mirror stays 1:1 with upstream at the pinned tag.
|
|
249
|
+
*/
|
|
250
|
+
async runIdCapture(image) {
|
|
251
|
+
const idCaptureWasmApi = this.runtime.requireIdCaptureApi("Unable to run Id Capture, cpp API hasn't been initialized");
|
|
252
|
+
if (image) {
|
|
253
|
+
await this.runtime.allocateImageBuffers(image.width, image.height);
|
|
254
|
+
this.runtime.writeFrame(image);
|
|
255
|
+
}
|
|
256
|
+
return idCaptureWasmApi.runIdCapture();
|
|
257
|
+
}
|
|
258
|
+
};
|
|
259
|
+
const idCaptureWasmApi = new IdCaptureWasmApi();
|
|
260
|
+
//#endregion
|
|
261
|
+
//#region ../infra/src/providers/wasm/IdCaptureProvider.ts
|
|
262
|
+
var IdCaptureProvider = class extends BaseWasmProvider {
|
|
263
|
+
constructor(protectedWorkflow) {
|
|
264
|
+
super(protectedWorkflow ?? 0);
|
|
265
|
+
this.lastProcessResult = null;
|
|
266
|
+
this.capturedCanvas = null;
|
|
267
|
+
this.originalCapturedCanvas = null;
|
|
268
|
+
this.lastDecodedBarcode = null;
|
|
269
|
+
this.barcodeEnhancementModelLoaded = false;
|
|
270
|
+
}
|
|
271
|
+
async initialize(config) {
|
|
272
|
+
if (config.videoSelfie === true) {
|
|
273
|
+
if (this.pipelineType !== 0) throw new Error("[Incode SDK] Protected ID workflows are unavailable for video selfie.");
|
|
274
|
+
this.pipelineType = 2;
|
|
275
|
+
await this.initializeBase(config, "videoSelfieId");
|
|
276
|
+
} else await this.initializeBase(config, "idCapture");
|
|
277
|
+
}
|
|
278
|
+
setCallbacks(callbacks) {
|
|
279
|
+
this.ensureInitialized();
|
|
280
|
+
const onCaptureWrapper = (canvas) => {
|
|
281
|
+
callbacks.onCapture?.(canvas);
|
|
282
|
+
};
|
|
283
|
+
idCaptureWasmApi.setIdCaptureCallbacks(this.getPipelineType(), callbacks.onFarAway ?? (() => {}), callbacks.onDetectionStarted ?? (() => {}), callbacks.onMaskChange ? (show, mask, top, orientation) => callbacks.onMaskChange?.(show, mask, top, orientation) : () => {}, callbacks.onBlur ?? (() => {}), callbacks.onGlare ?? (() => {}), callbacks.onCapturing ?? (() => {}), callbacks.onCapture ? onCaptureWrapper : () => {}, callbacks.onBestFrame ? (blur, glare, orientation) => callbacks.onBestFrame?.(blur, glare, orientation) : () => {}, callbacks.onIdNotDetected ?? (() => {}), callbacks.onSwitchToManualCapture ?? (() => {}), callbacks.onIdTypeChange ? (idType) => callbacks.onIdTypeChange?.(idType) : () => {}, callbacks.onIdSideChange ? (side) => callbacks.onIdSideChange?.(side) : () => {}, callbacks.onCapturingCounterValueChange ? (value) => callbacks.onCapturingCounterValueChange?.(value) : () => {});
|
|
284
|
+
if (callbacks.onBarcodeDecoded) {
|
|
285
|
+
const onBarcodeDecoded = callbacks.onBarcodeDecoded;
|
|
286
|
+
idCaptureWasmApi.setIdBarcodeDecodedCallback(this.getPipelineType(), (decoded) => {
|
|
287
|
+
this.lastDecodedBarcode = decoded;
|
|
288
|
+
onBarcodeDecoded(decoded);
|
|
289
|
+
});
|
|
290
|
+
} else idCaptureWasmApi.setIdBarcodeDecodedCallback(this.getPipelineType(), () => {});
|
|
291
|
+
}
|
|
292
|
+
setThresholds(thresholds) {
|
|
293
|
+
this.ensureInitialized();
|
|
294
|
+
idCaptureWasmApi.setIdCaptureThresholds(this.getPipelineType(), thresholds.blurThreshold, thresholds.blurChangeThreshold, thresholds.glareThreshold, thresholds.clsThreshold, thresholds.sideThreshold, thresholds.iouThreshold, thresholds.idDetectedTimeout, thresholds.autocaptureTimeout, thresholds.framesAggregationInterval);
|
|
295
|
+
}
|
|
296
|
+
setGeometry(geometry) {
|
|
297
|
+
this.ensureInitialized();
|
|
298
|
+
idCaptureWasmApi.setIdCaptureGeometryParams(this.getPipelineType(), geometry.areaDown, geometry.areaUp, geometry.areaIOSPassportUp, geometry.areaIOSPassportDown, geometry.widthIOSUp, geometry.widthIOSDown, geometry.widthDown, geometry.widthUp, geometry.windowOuterWidth, geometry.windowOuterHeight, geometry.windowInnerWidth, geometry.windowInnerHeight);
|
|
299
|
+
}
|
|
300
|
+
setSettings(settings) {
|
|
301
|
+
this.ensureInitialized();
|
|
302
|
+
idCaptureWasmApi.setIdCaptureConfigParams(this.getPipelineType(), settings.isFixedMask, settings.isIPhone14OrHigher, settings.idType, settings.blurCheckEnabled, settings.glareCheckEnabled, settings.faceQualityCheckEnabled, settings.iouCheckEnabled, settings.fpsLimitEnabled);
|
|
303
|
+
}
|
|
304
|
+
setModelType(modelType) {
|
|
305
|
+
this.ensureInitialized();
|
|
306
|
+
let wasmModelType;
|
|
307
|
+
switch (modelType) {
|
|
308
|
+
case "v1":
|
|
309
|
+
wasmModelType = 0;
|
|
310
|
+
break;
|
|
311
|
+
case "v2":
|
|
312
|
+
wasmModelType = 1;
|
|
313
|
+
break;
|
|
314
|
+
case "v3":
|
|
315
|
+
wasmModelType = 2;
|
|
316
|
+
break;
|
|
317
|
+
default: throw new Error(`Unknown model type: ${modelType}`);
|
|
318
|
+
}
|
|
319
|
+
idCaptureWasmApi.setIdCaptureModelType(this.getPipelineType(), wasmModelType);
|
|
320
|
+
}
|
|
321
|
+
setBarcodeCaptureEnabled(enabled) {
|
|
322
|
+
this.ensureInitialized();
|
|
323
|
+
idCaptureWasmApi.setIdBarcodeCaptureEnabled(this.getPipelineType(), enabled);
|
|
324
|
+
}
|
|
325
|
+
setBarcodeAutoCaptureOnDecode(enabled) {
|
|
326
|
+
this.ensureInitialized();
|
|
327
|
+
idCaptureWasmApi.setIdBarcodeAutoCaptureOnDecode(this.getPipelineType(), enabled);
|
|
328
|
+
}
|
|
329
|
+
async setBarcodeEnhancementModel() {
|
|
330
|
+
this.ensureInitialized();
|
|
331
|
+
if (this.barcodeEnhancementModelLoaded) return true;
|
|
332
|
+
const modelUrl = getResolvedModelSource(WASM_MODEL_FILES.barcode, "idCapture") ?? getBarcodeEnhanceModelUrl();
|
|
333
|
+
const applied = await idCaptureWasmApi.setIdBarcodeEnhancementModel(this.getPipelineType(), modelUrl);
|
|
334
|
+
this.barcodeEnhancementModelLoaded = applied;
|
|
335
|
+
return applied;
|
|
336
|
+
}
|
|
337
|
+
getLastDecodedBarcode() {
|
|
338
|
+
return this.lastDecodedBarcode;
|
|
339
|
+
}
|
|
340
|
+
/**
|
|
341
|
+
* Processes a frame through the WASM pipeline and stores the result.
|
|
342
|
+
*/
|
|
343
|
+
async processFrame(image) {
|
|
344
|
+
const result = await this.processFrameWasm(image);
|
|
345
|
+
const pipelineType = this.getPipelineType();
|
|
346
|
+
if (result && (pipelineType === 0 || pipelineType === 2)) this.lastProcessResult = result;
|
|
347
|
+
else this.lastProcessResult = null;
|
|
348
|
+
}
|
|
349
|
+
/**
|
|
350
|
+
* Gets the last process result from the most recent frame processing.
|
|
351
|
+
* @returns The last process result with quad coordinates, or null if not available
|
|
352
|
+
*/
|
|
353
|
+
getLastProcessResult() {
|
|
354
|
+
return this.lastProcessResult;
|
|
355
|
+
}
|
|
356
|
+
transformPerspective(canvas, frameRect) {
|
|
357
|
+
this.ensureInitialized();
|
|
358
|
+
const originalWidth = canvas.width();
|
|
359
|
+
const originalHeight = canvas.height();
|
|
360
|
+
try {
|
|
361
|
+
const imageData = canvas.getImageData();
|
|
362
|
+
if (!imageData) return canvas;
|
|
363
|
+
const transformedCanvas = idCaptureWasmApi.IdPerspectiveTransform(imageData, frameRect);
|
|
364
|
+
if (transformedCanvas) {
|
|
365
|
+
const wrappedCanvas = new IncodeCanvas(transformedCanvas);
|
|
366
|
+
const wrappedWidth = wrappedCanvas.width();
|
|
367
|
+
const wrappedHeight = wrappedCanvas.height();
|
|
368
|
+
if (wrappedWidth === originalWidth && wrappedHeight === originalHeight) {
|
|
369
|
+
const croppedCanvas = this.cropCanvasToRect(wrappedCanvas, {
|
|
370
|
+
x: Math.round(frameRect.x),
|
|
371
|
+
y: Math.round(frameRect.y),
|
|
372
|
+
w: Math.round(frameRect.w),
|
|
373
|
+
h: Math.round(frameRect.h)
|
|
374
|
+
});
|
|
375
|
+
if (croppedCanvas) return croppedCanvas;
|
|
376
|
+
}
|
|
377
|
+
return wrappedCanvas;
|
|
378
|
+
}
|
|
379
|
+
return canvas;
|
|
380
|
+
} catch (_error) {
|
|
381
|
+
return canvas;
|
|
382
|
+
}
|
|
383
|
+
}
|
|
384
|
+
/**
|
|
385
|
+
* Crops a canvas to the specified rectangle region.
|
|
386
|
+
* @param canvas - The canvas to crop
|
|
387
|
+
* @param rect - The rectangle to crop to (x, y, w, h)
|
|
388
|
+
* @returns A new IncodeCanvas with the cropped region, or null if cropping fails
|
|
389
|
+
*/
|
|
390
|
+
cropCanvasToRect(canvas, rect) {
|
|
391
|
+
const canvasWidth = canvas.width();
|
|
392
|
+
const canvasHeight = canvas.height();
|
|
393
|
+
if (!canvasWidth || !canvasHeight) return null;
|
|
394
|
+
const x = Math.max(0, Math.min(rect.x, canvasWidth));
|
|
395
|
+
const y = Math.max(0, Math.min(rect.y, canvasHeight));
|
|
396
|
+
const w = Math.max(1, Math.min(rect.w, canvasWidth - x));
|
|
397
|
+
const h = Math.max(1, Math.min(rect.h, canvasHeight - y));
|
|
398
|
+
const croppedCanvasElement = document.createElement("canvas");
|
|
399
|
+
croppedCanvasElement.width = w;
|
|
400
|
+
croppedCanvasElement.height = h;
|
|
401
|
+
const ctx = croppedCanvasElement.getContext("2d");
|
|
402
|
+
if (!ctx) return null;
|
|
403
|
+
ctx.drawImage(canvas.canvas, x, y, w, h, 0, 0, w, h);
|
|
404
|
+
return new IncodeCanvas(croppedCanvasElement);
|
|
405
|
+
}
|
|
406
|
+
/**
|
|
407
|
+
* Gets the captured canvas (transformed for preview).
|
|
408
|
+
* @returns The captured canvas, or null if not available
|
|
409
|
+
*/
|
|
410
|
+
getCapturedCanvas() {
|
|
411
|
+
return this.capturedCanvas;
|
|
412
|
+
}
|
|
413
|
+
/**
|
|
414
|
+
* Gets the original captured canvas (full frame for upload).
|
|
415
|
+
* @returns The original captured canvas, or null if not available
|
|
416
|
+
*/
|
|
417
|
+
getOriginalCapturedCanvas() {
|
|
418
|
+
return this.originalCapturedCanvas;
|
|
419
|
+
}
|
|
420
|
+
/**
|
|
421
|
+
* Sets the captured canvases (original and transformed).
|
|
422
|
+
* @param original - The original full-frame canvas (for upload)
|
|
423
|
+
* @param transformed - The transformed canvas (for preview)
|
|
424
|
+
*/
|
|
425
|
+
setCapturedCanvases(original, transformed) {
|
|
426
|
+
this.originalCapturedCanvas = original;
|
|
427
|
+
this.capturedCanvas = transformed;
|
|
428
|
+
}
|
|
429
|
+
/**
|
|
430
|
+
* Re-arms WASM detection without discarding the captured result.
|
|
431
|
+
*
|
|
432
|
+
* Detection-session teardown runs immediately after a successful capture.
|
|
433
|
+
* The captured canvases must remain available for the subsequent upload and
|
|
434
|
+
* are only replaced by `setCapturedCanvases()` or cleared by a full reset.
|
|
435
|
+
*/
|
|
436
|
+
resetDetectionState() {
|
|
437
|
+
super.reset();
|
|
438
|
+
this.lastProcessResult = null;
|
|
439
|
+
this.lastDecodedBarcode = null;
|
|
440
|
+
}
|
|
441
|
+
reset() {
|
|
442
|
+
this.resetDetectionState();
|
|
443
|
+
this.capturedCanvas = null;
|
|
444
|
+
this.originalCapturedCanvas = null;
|
|
445
|
+
}
|
|
446
|
+
async dispose() {
|
|
447
|
+
await super.dispose();
|
|
448
|
+
this.barcodeEnhancementModelLoaded = false;
|
|
449
|
+
}
|
|
450
|
+
};
|
|
451
|
+
//#endregion
|
|
452
|
+
//#region ../infra/src/wasm/idCaptureDefaults.ts
|
|
453
|
+
/**
|
|
454
|
+
* Default WASM thresholds for ID capture quality checks.
|
|
455
|
+
* Matches SDK 1's `wasmWorkflowsConfig.ts` production ID profile. Explicit
|
|
456
|
+
* consumer and experiment overrides still take precedence in Core.
|
|
457
|
+
*/
|
|
458
|
+
const DEFAULT_ID_CAPTURE_THRESHOLDS = {
|
|
459
|
+
blurThreshold: .2,
|
|
460
|
+
blurChangeThreshold: .2,
|
|
461
|
+
glareThreshold: .3,
|
|
462
|
+
clsThreshold: .98,
|
|
463
|
+
sideThreshold: .8,
|
|
464
|
+
iouThreshold: .8,
|
|
465
|
+
idDetectedTimeout: 1e4,
|
|
466
|
+
autocaptureTimeout: 5e3,
|
|
467
|
+
framesAggregationInterval: 1700
|
|
468
|
+
};
|
|
469
|
+
/**
|
|
470
|
+
* Default geometry parameters for ID detection.
|
|
471
|
+
* Window dimensions must be provided at runtime.
|
|
472
|
+
*/
|
|
473
|
+
const DEFAULT_ID_CAPTURE_GEOMETRY = {
|
|
474
|
+
areaDown: 25e3,
|
|
475
|
+
areaUp: 55e3,
|
|
476
|
+
areaIOSPassportUp: 3e4,
|
|
477
|
+
areaIOSPassportDown: 2e4,
|
|
478
|
+
widthIOSUp: 160,
|
|
479
|
+
widthIOSDown: 85,
|
|
480
|
+
widthDown: 110,
|
|
481
|
+
widthUp: 205
|
|
482
|
+
};
|
|
483
|
+
//#endregion
|
|
484
|
+
export { CameraCompositor as i, DEFAULT_ID_CAPTURE_THRESHOLDS as n, IdCaptureProvider as r, DEFAULT_ID_CAPTURE_GEOMETRY as t };
|