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