@idmission/websdk-ui 0.1.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/README.md +189 -0
- package/dist/DocumentCaptureView.d.ts +111 -0
- package/dist/DocumentCaptureView.d.ts.map +1 -0
- package/dist/DocumentCaptureView.js +225 -0
- package/dist/FaceLivenessView.d.ts +88 -0
- package/dist/FaceLivenessView.d.ts.map +1 -0
- package/dist/FaceLivenessView.js +298 -0
- package/dist/IdCaptureView.d.ts +271 -0
- package/dist/IdCaptureView.d.ts.map +1 -0
- package/dist/IdCaptureView.js +454 -0
- package/dist/SelfieCaptureView.d.ts +119 -0
- package/dist/SelfieCaptureView.d.ts.map +1 -0
- package/dist/SelfieCaptureView.js +168 -0
- package/dist/SignatureCaptureView.d.ts +136 -0
- package/dist/SignatureCaptureView.d.ts.map +1 -0
- package/dist/SignatureCaptureView.js +521 -0
- package/dist/VideoIdCaptureView.d.ts +104 -0
- package/dist/VideoIdCaptureView.d.ts.map +1 -0
- package/dist/VideoIdCaptureView.js +253 -0
- package/dist/bindings/useDocumentCapture.d.ts +3 -0
- package/dist/bindings/useDocumentCapture.d.ts.map +1 -0
- package/dist/bindings/useDocumentCapture.js +6 -0
- package/dist/bindings/useIdCapture.d.ts +5 -0
- package/dist/bindings/useIdCapture.d.ts.map +1 -0
- package/dist/bindings/useIdCapture.js +53 -0
- package/dist/bindings/useSelfieCapture.d.ts +5 -0
- package/dist/bindings/useSelfieCapture.d.ts.map +1 -0
- package/dist/bindings/useSelfieCapture.js +53 -0
- package/dist/bindings/useSignatureCapture.d.ts +3 -0
- package/dist/bindings/useSignatureCapture.d.ts.map +1 -0
- package/dist/bindings/useSignatureCapture.js +6 -0
- package/dist/bindings/useVideoIdCapture.d.ts +3 -0
- package/dist/bindings/useVideoIdCapture.d.ts.map +1 -0
- package/dist/bindings/useVideoIdCapture.js +6 -0
- package/dist/components/CameraFeed.d.ts +36 -0
- package/dist/components/CameraFeed.d.ts.map +1 -0
- package/dist/components/CameraFeed.js +74 -0
- package/dist/components/ExitCaptureButton.d.ts +6 -0
- package/dist/components/ExitCaptureButton.d.ts.map +1 -0
- package/dist/components/ExitCaptureButton.js +32 -0
- package/dist/components/GuidanceMessage.d.ts +25 -0
- package/dist/components/GuidanceMessage.d.ts.map +1 -0
- package/dist/components/GuidanceMessage.js +39 -0
- package/dist/components/OverrideWrongDocumentTypeDialog.d.ts +20 -0
- package/dist/components/OverrideWrongDocumentTypeDialog.d.ts.map +1 -0
- package/dist/components/OverrideWrongDocumentTypeDialog.js +55 -0
- package/dist/components/additional_documents/AdditionalDocumentCapture.d.ts +41 -0
- package/dist/components/additional_documents/AdditionalDocumentCapture.d.ts.map +1 -0
- package/dist/components/additional_documents/AdditionalDocumentCapture.js +118 -0
- package/dist/components/additional_documents/AdditionalDocumentCaptureWizard.d.ts +18 -0
- package/dist/components/additional_documents/AdditionalDocumentCaptureWizard.d.ts.map +1 -0
- package/dist/components/additional_documents/AdditionalDocumentCaptureWizard.js +93 -0
- package/dist/components/additional_documents/sequence.d.ts +10 -0
- package/dist/components/additional_documents/sequence.d.ts.map +1 -0
- package/dist/components/additional_documents/sequence.js +11 -0
- package/dist/components/additional_documents/types.d.ts +15 -0
- package/dist/components/additional_documents/types.d.ts.map +1 -0
- package/dist/components/additional_documents/types.js +1 -0
- package/dist/components/barcode/BarcodeGuideOverlay.d.ts +23 -0
- package/dist/components/barcode/BarcodeGuideOverlay.d.ts.map +1 -0
- package/dist/components/barcode/BarcodeGuideOverlay.js +157 -0
- package/dist/components/barcode/BarcodeSuccessOverlay.d.ts +7 -0
- package/dist/components/barcode/BarcodeSuccessOverlay.d.ts.map +1 -0
- package/dist/components/barcode/BarcodeSuccessOverlay.js +58 -0
- package/dist/components/common/ButtonsRow.d.ts +2 -0
- package/dist/components/common/ButtonsRow.d.ts.map +1 -0
- package/dist/components/common/ButtonsRow.js +7 -0
- package/dist/components/common/CapturedDocumentImg.d.ts +7 -0
- package/dist/components/common/CapturedDocumentImg.d.ts.map +1 -0
- package/dist/components/common/CapturedDocumentImg.js +31 -0
- package/dist/components/common/Card.d.ts +9 -0
- package/dist/components/common/Card.d.ts.map +1 -0
- package/dist/components/common/Card.js +16 -0
- package/dist/components/common/LoaderButton.d.ts +31 -0
- package/dist/components/common/LoaderButton.d.ts.map +1 -0
- package/dist/components/common/LoaderButton.js +444 -0
- package/dist/components/common/LoadingListItemIndicator.d.ts +5 -0
- package/dist/components/common/LoadingListItemIndicator.d.ts.map +1 -0
- package/dist/components/common/LoadingListItemIndicator.js +8 -0
- package/dist/components/common/animation.d.ts +5 -0
- package/dist/components/common/animation.d.ts.map +1 -0
- package/dist/components/common/animation.js +35 -0
- package/dist/components/common/downloadingLabel.d.ts +10 -0
- package/dist/components/common/downloadingLabel.d.ts.map +1 -0
- package/dist/components/common/downloadingLabel.js +15 -0
- package/dist/components/common/overlay.d.ts +142 -0
- package/dist/components/common/overlay.d.ts.map +1 -0
- package/dist/components/common/overlay.js +183 -0
- package/dist/components/customer_match/CustomerMatchFailure.d.ts +37 -0
- package/dist/components/customer_match/CustomerMatchFailure.d.ts.map +1 -0
- package/dist/components/customer_match/CustomerMatchFailure.js +38 -0
- package/dist/components/customer_match/CustomerMatchSuccess.d.ts +35 -0
- package/dist/components/customer_match/CustomerMatchSuccess.d.ts.map +1 -0
- package/dist/components/customer_match/CustomerMatchSuccess.js +44 -0
- package/dist/components/debug/debug.d.ts +91 -0
- package/dist/components/debug/debug.d.ts.map +1 -0
- package/dist/components/debug/debug.js +270 -0
- package/dist/components/document/DocumentCaptureGuideOverlay.d.ts +15 -0
- package/dist/components/document/DocumentCaptureGuideOverlay.d.ts.map +1 -0
- package/dist/components/document/DocumentCaptureGuideOverlay.js +148 -0
- package/dist/components/document/guideRect.d.ts +11 -0
- package/dist/components/document/guideRect.d.ts.map +1 -0
- package/dist/components/document/guideRect.js +25 -0
- package/dist/components/document/types.d.ts +25 -0
- package/dist/components/document/types.d.ts.map +1 -0
- package/dist/components/document/types.js +1 -0
- package/dist/components/error/CameraAccessDeniedOverlay.d.ts +31 -0
- package/dist/components/error/CameraAccessDeniedOverlay.d.ts.map +1 -0
- package/dist/components/error/CameraAccessDeniedOverlay.js +45 -0
- package/dist/components/error/ErrorScreen.d.ts +60 -0
- package/dist/components/error/ErrorScreen.d.ts.map +1 -0
- package/dist/components/error/ErrorScreen.js +150 -0
- package/dist/components/face_liveness/FaceLivenessFailure.d.ts +35 -0
- package/dist/components/face_liveness/FaceLivenessFailure.d.ts.map +1 -0
- package/dist/components/face_liveness/FaceLivenessFailure.js +30 -0
- package/dist/components/face_liveness/FaceLivenessSuccess.d.ts +31 -0
- package/dist/components/face_liveness/FaceLivenessSuccess.d.ts.map +1 -0
- package/dist/components/face_liveness/FaceLivenessSuccess.js +56 -0
- package/dist/components/fallback/IdCaptureFallback.d.ts +58 -0
- package/dist/components/fallback/IdCaptureFallback.d.ts.map +1 -0
- package/dist/components/fallback/IdCaptureFallback.js +128 -0
- package/dist/components/fallback/IdCaptureOrUploadScreen.d.ts +75 -0
- package/dist/components/fallback/IdCaptureOrUploadScreen.d.ts.map +1 -0
- package/dist/components/fallback/IdCaptureOrUploadScreen.js +205 -0
- package/dist/components/fallback/SelfieCaptureFallback.d.ts +54 -0
- package/dist/components/fallback/SelfieCaptureFallback.d.ts.map +1 -0
- package/dist/components/fallback/SelfieCaptureFallback.js +106 -0
- package/dist/components/fallback/fallbackInstructionStep.d.ts +5 -0
- package/dist/components/fallback/fallbackInstructionStep.d.ts.map +1 -0
- package/dist/components/fallback/fallbackInstructionStep.js +18 -0
- package/dist/components/fallback/readFile.d.ts +2 -0
- package/dist/components/fallback/readFile.d.ts.map +1 -0
- package/dist/components/fallback/readFile.js +14 -0
- package/dist/components/guide_images/backToFront.d.ts +3 -0
- package/dist/components/guide_images/backToFront.d.ts.map +1 -0
- package/dist/components/guide_images/backToFront.js +17 -0
- package/dist/components/guide_images/byUrl.d.ts +3 -0
- package/dist/components/guide_images/byUrl.d.ts.map +1 -0
- package/dist/components/guide_images/byUrl.js +6 -0
- package/dist/components/guide_images/defaults.d.ts +37 -0
- package/dist/components/guide_images/defaults.d.ts.map +1 -0
- package/dist/components/guide_images/defaults.js +37 -0
- package/dist/components/guide_images/index.d.ts +7 -0
- package/dist/components/guide_images/index.d.ts.map +1 -0
- package/dist/components/guide_images/index.js +5 -0
- package/dist/components/guide_images/orientation.d.ts +2 -0
- package/dist/components/guide_images/orientation.d.ts.map +1 -0
- package/dist/components/guide_images/orientation.js +5 -0
- package/dist/components/guide_images/types.d.ts +15 -0
- package/dist/components/guide_images/types.d.ts.map +1 -0
- package/dist/components/guide_images/types.js +1 -0
- package/dist/components/guide_images/useGuideImages.d.ts +3 -0
- package/dist/components/guide_images/useGuideImages.d.ts.map +1 -0
- package/dist/components/guide_images/useGuideImages.js +19 -0
- package/dist/components/guides/FlipIdPrompt.d.ts +28 -0
- package/dist/components/guides/FlipIdPrompt.d.ts.map +1 -0
- package/dist/components/guides/FlipIdPrompt.js +54 -0
- package/dist/components/guides/IdCaptureFitGuide.d.ts +51 -0
- package/dist/components/guides/IdCaptureFitGuide.d.ts.map +1 -0
- package/dist/components/guides/IdCaptureFitGuide.js +199 -0
- package/dist/components/guides/IdCaptureGuideOverlay.d.ts +100 -0
- package/dist/components/guides/IdCaptureGuideOverlay.d.ts.map +1 -0
- package/dist/components/guides/IdCaptureGuideOverlay.js +137 -0
- package/dist/components/guides/IdCaptureGuides.d.ts +47 -0
- package/dist/components/guides/IdCaptureGuides.d.ts.map +1 -0
- package/dist/components/guides/IdCaptureGuides.js +136 -0
- package/dist/components/guides/IdCaptureGuidesCommon.d.ts +136 -0
- package/dist/components/guides/IdCaptureGuidesCommon.d.ts.map +1 -0
- package/dist/components/guides/IdCaptureGuidesCommon.js +123 -0
- package/dist/components/loading/IdCaptureLoadingGraphic.d.ts +9 -0
- package/dist/components/loading/IdCaptureLoadingGraphic.d.ts.map +1 -0
- package/dist/components/loading/IdCaptureLoadingGraphic.js +76 -0
- package/dist/components/loading/IdCaptureLoadingOverlay.d.ts +134 -0
- package/dist/components/loading/IdCaptureLoadingOverlay.d.ts.map +1 -0
- package/dist/components/loading/IdCaptureLoadingOverlay.js +13 -0
- package/dist/components/loading/IdCaptureLoadingOverlayDefault.d.ts +3 -0
- package/dist/components/loading/IdCaptureLoadingOverlayDefault.d.ts.map +1 -0
- package/dist/components/loading/IdCaptureLoadingOverlayDefault.js +196 -0
- package/dist/components/loading/IdCaptureLoadingOverlayLegacy.d.ts +4 -0
- package/dist/components/loading/IdCaptureLoadingOverlayLegacy.d.ts.map +1 -0
- package/dist/components/loading/IdCaptureLoadingOverlayLegacy.js +69 -0
- package/dist/components/loading/IdCaptureLoadingOverlayRing.d.ts +3 -0
- package/dist/components/loading/IdCaptureLoadingOverlayRing.d.ts.map +1 -0
- package/dist/components/loading/IdCaptureLoadingOverlayRing.js +260 -0
- package/dist/components/loading/RingIntroScreen.d.ts +39 -0
- package/dist/components/loading/RingIntroScreen.d.ts.map +1 -0
- package/dist/components/loading/RingIntroScreen.js +216 -0
- package/dist/components/loading/RingProgress.d.ts +9 -0
- package/dist/components/loading/RingProgress.d.ts.map +1 -0
- package/dist/components/loading/RingProgress.js +24 -0
- package/dist/components/loading/RingStageTransition.d.ts +27 -0
- package/dist/components/loading/RingStageTransition.d.ts.map +1 -0
- package/dist/components/loading/RingStageTransition.js +145 -0
- package/dist/components/loading/customerSpinner.d.ts +58 -0
- package/dist/components/loading/customerSpinner.d.ts.map +1 -0
- package/dist/components/loading/customerSpinner.js +69 -0
- package/dist/components/loading/ringIntro.d.ts +15 -0
- package/dist/components/loading/ringIntro.d.ts.map +1 -0
- package/dist/components/loading/ringIntro.js +5 -0
- package/dist/components/loading/ringStatus.d.ts +8 -0
- package/dist/components/loading/ringStatus.d.ts.map +1 -0
- package/dist/components/loading/ringStatus.js +13 -0
- package/dist/components/loading/useAutoContinueWhenReady.d.ts +8 -0
- package/dist/components/loading/useAutoContinueWhenReady.d.ts.map +1 -0
- package/dist/components/loading/useAutoContinueWhenReady.js +25 -0
- package/dist/components/review/ReviewDiagnosticsPanel.d.ts +27 -0
- package/dist/components/review/ReviewDiagnosticsPanel.d.ts.map +1 -0
- package/dist/components/review/ReviewDiagnosticsPanel.js +475 -0
- package/dist/components/review/ReviewScreen.d.ts +34 -0
- package/dist/components/review/ReviewScreen.d.ts.map +1 -0
- package/dist/components/review/ReviewScreen.js +91 -0
- package/dist/components/ring/RingFailureScreen.d.ts +41 -0
- package/dist/components/ring/RingFailureScreen.d.ts.map +1 -0
- package/dist/components/ring/RingFailureScreen.js +384 -0
- package/dist/components/ring/RingFinishingScreen.d.ts +27 -0
- package/dist/components/ring/RingFinishingScreen.d.ts.map +1 -0
- package/dist/components/ring/RingFinishingScreen.js +184 -0
- package/dist/components/ring/RingSuccessScreen.d.ts +33 -0
- package/dist/components/ring/RingSuccessScreen.d.ts.map +1 -0
- package/dist/components/ring/RingSuccessScreen.js +185 -0
- package/dist/components/selfie/FaceCaptureGuideOverlay.d.ts +17 -0
- package/dist/components/selfie/FaceCaptureGuideOverlay.d.ts.map +1 -0
- package/dist/components/selfie/FaceCaptureGuideOverlay.js +39 -0
- package/dist/components/selfie/SelfieCameraFeed.d.ts +8 -0
- package/dist/components/selfie/SelfieCameraFeed.d.ts.map +1 -0
- package/dist/components/selfie/SelfieCameraFeed.js +16 -0
- package/dist/components/selfie/SelfieCaptureAnimatedMask.d.ts +15 -0
- package/dist/components/selfie/SelfieCaptureAnimatedMask.d.ts.map +1 -0
- package/dist/components/selfie/SelfieCaptureAnimatedMask.js +111 -0
- package/dist/components/selfie/SelfieCaptureLoadingGraphic.d.ts +4 -0
- package/dist/components/selfie/SelfieCaptureLoadingGraphic.d.ts.map +1 -0
- package/dist/components/selfie/SelfieCaptureLoadingGraphic.js +28 -0
- package/dist/components/selfie/SelfieCaptureSurface.d.ts +126 -0
- package/dist/components/selfie/SelfieCaptureSurface.d.ts.map +1 -0
- package/dist/components/selfie/SelfieCaptureSurface.js +248 -0
- package/dist/components/selfie_loading/SelfieCaptureLoadingOverlay.d.ts +136 -0
- package/dist/components/selfie_loading/SelfieCaptureLoadingOverlay.d.ts.map +1 -0
- package/dist/components/selfie_loading/SelfieCaptureLoadingOverlay.js +13 -0
- package/dist/components/selfie_loading/SelfieCaptureLoadingOverlayDefault.d.ts +3 -0
- package/dist/components/selfie_loading/SelfieCaptureLoadingOverlayDefault.d.ts.map +1 -0
- package/dist/components/selfie_loading/SelfieCaptureLoadingOverlayDefault.js +181 -0
- package/dist/components/selfie_loading/SelfieCaptureLoadingOverlayLegacy.d.ts +3 -0
- package/dist/components/selfie_loading/SelfieCaptureLoadingOverlayLegacy.d.ts.map +1 -0
- package/dist/components/selfie_loading/SelfieCaptureLoadingOverlayLegacy.js +67 -0
- package/dist/components/selfie_loading/SelfieCaptureLoadingOverlayRing.d.ts +3 -0
- package/dist/components/selfie_loading/SelfieCaptureLoadingOverlayRing.d.ts.map +1 -0
- package/dist/components/selfie_loading/SelfieCaptureLoadingOverlayRing.js +265 -0
- package/dist/components/videoId/VideoIdCaptureGuides.d.ts +42 -0
- package/dist/components/videoId/VideoIdCaptureGuides.d.ts.map +1 -0
- package/dist/components/videoId/VideoIdCaptureGuides.js +173 -0
- package/dist/flows/AuthStateContext.d.ts +33 -0
- package/dist/flows/AuthStateContext.d.ts.map +1 -0
- package/dist/flows/AuthStateContext.js +47 -0
- package/dist/flows/CompositeWizard.d.ts +76 -0
- package/dist/flows/CompositeWizard.d.ts.map +1 -0
- package/dist/flows/CompositeWizard.js +200 -0
- package/dist/flows/CustomerBiometricsEnrollmentFlow.d.ts +28 -0
- package/dist/flows/CustomerBiometricsEnrollmentFlow.d.ts.map +1 -0
- package/dist/flows/CustomerBiometricsEnrollmentFlow.js +138 -0
- package/dist/flows/CustomerIdAndBiometricsEnrollmentFlow.d.ts +47 -0
- package/dist/flows/CustomerIdAndBiometricsEnrollmentFlow.d.ts.map +1 -0
- package/dist/flows/CustomerIdAndBiometricsEnrollmentFlow.js +231 -0
- package/dist/flows/CustomerIdentificationFlow.d.ts +4 -0
- package/dist/flows/CustomerIdentificationFlow.d.ts.map +1 -0
- package/dist/flows/CustomerIdentificationFlow.js +11 -0
- package/dist/flows/CustomerVerificationFlow.d.ts +9 -0
- package/dist/flows/CustomerVerificationFlow.d.ts.map +1 -0
- package/dist/flows/CustomerVerificationFlow.js +17 -0
- package/dist/flows/DocumentCaptureFlow.d.ts +23 -0
- package/dist/flows/DocumentCaptureFlow.d.ts.map +1 -0
- package/dist/flows/DocumentCaptureFlow.js +116 -0
- package/dist/flows/FaceValidationFlow.d.ts +12 -0
- package/dist/flows/FaceValidationFlow.d.ts.map +1 -0
- package/dist/flows/FaceValidationFlow.js +53 -0
- package/dist/flows/FlowChassis.d.ts +39 -0
- package/dist/flows/FlowChassis.d.ts.map +1 -0
- package/dist/flows/FlowChassis.js +69 -0
- package/dist/flows/IdAndFaceValidationFlow.d.ts +36 -0
- package/dist/flows/IdAndFaceValidationFlow.d.ts.map +1 -0
- package/dist/flows/IdAndFaceValidationFlow.js +168 -0
- package/dist/flows/IdValidationFlow.d.ts +29 -0
- package/dist/flows/IdValidationFlow.d.ts.map +1 -0
- package/dist/flows/IdValidationFlow.js +106 -0
- package/dist/flows/OrbStatusScreen.d.ts +14 -0
- package/dist/flows/OrbStatusScreen.d.ts.map +1 -0
- package/dist/flows/OrbStatusScreen.js +60 -0
- package/dist/flows/RemoteDiagnosticsMount.d.ts +6 -0
- package/dist/flows/RemoteDiagnosticsMount.d.ts.map +1 -0
- package/dist/flows/RemoteDiagnosticsMount.js +57 -0
- package/dist/flows/SignatureKYCFlow.d.ts +33 -0
- package/dist/flows/SignatureKYCFlow.d.ts.map +1 -0
- package/dist/flows/SignatureKYCFlow.js +228 -0
- package/dist/flows/SubmissionProvider.d.ts +40 -0
- package/dist/flows/SubmissionProvider.d.ts.map +1 -0
- package/dist/flows/SubmissionProvider.js +136 -0
- package/dist/flows/SubmissionSuccess.d.ts +48 -0
- package/dist/flows/SubmissionSuccess.d.ts.map +1 -0
- package/dist/flows/SubmissionSuccess.js +488 -0
- package/dist/flows/VideoIdValidationFlow.d.ts +61 -0
- package/dist/flows/VideoIdValidationFlow.d.ts.map +1 -0
- package/dist/flows/VideoIdValidationFlow.js +171 -0
- package/dist/flows/additionalDocuments.d.ts +5 -0
- package/dist/flows/additionalDocuments.d.ts.map +1 -0
- package/dist/flows/additionalDocuments.js +26 -0
- package/dist/flows/artifacts.d.ts +8 -0
- package/dist/flows/artifacts.d.ts.map +1 -0
- package/dist/flows/artifacts.js +80 -0
- package/dist/flows/customerMatch/CustomerMatchCapture.d.ts +53 -0
- package/dist/flows/customerMatch/CustomerMatchCapture.d.ts.map +1 -0
- package/dist/flows/customerMatch/CustomerMatchCapture.js +211 -0
- package/dist/flows/customerMatch/CustomerMatchFlow.d.ts +94 -0
- package/dist/flows/customerMatch/CustomerMatchFlow.d.ts.map +1 -0
- package/dist/flows/customerMatch/CustomerMatchFlow.js +209 -0
- package/dist/flows/customerMatch/adapters.d.ts +34 -0
- package/dist/flows/customerMatch/adapters.d.ts.map +1 -0
- package/dist/flows/customerMatch/adapters.js +63 -0
- package/dist/flows/customerMatch/identificationReducer.d.ts +34 -0
- package/dist/flows/customerMatch/identificationReducer.d.ts.map +1 -0
- package/dist/flows/customerMatch/identificationReducer.js +75 -0
- package/dist/flows/customerMatch/verificationReducer.d.ts +34 -0
- package/dist/flows/customerMatch/verificationReducer.d.ts.map +1 -0
- package/dist/flows/customerMatch/verificationReducer.js +77 -0
- package/dist/flows/documentCapture.d.ts +5 -0
- package/dist/flows/documentCapture.d.ts.map +1 -0
- package/dist/flows/documentCapture.js +8 -0
- package/dist/flows/jsonHighlight.d.ts +19 -0
- package/dist/flows/jsonHighlight.d.ts.map +1 -0
- package/dist/flows/jsonHighlight.js +90 -0
- package/dist/flows/overlays.d.ts +91 -0
- package/dist/flows/overlays.d.ts.map +1 -0
- package/dist/flows/overlays.js +150 -0
- package/dist/flows/ringIntroImplications.d.ts +30 -0
- package/dist/flows/ringIntroImplications.d.ts.map +1 -0
- package/dist/flows/ringIntroImplications.js +58 -0
- package/dist/flows/ringScreens.d.ts +27 -0
- package/dist/flows/ringScreens.d.ts.map +1 -0
- package/dist/flows/ringScreens.js +18 -0
- package/dist/flows/sequencer.d.ts +12 -0
- package/dist/flows/sequencer.d.ts.map +1 -0
- package/dist/flows/sequencer.js +18 -0
- package/dist/flows/sharedCamera.d.ts +23 -0
- package/dist/flows/sharedCamera.d.ts.map +1 -0
- package/dist/flows/sharedCamera.js +64 -0
- package/dist/flows/signatureStep.d.ts +25 -0
- package/dist/flows/signatureStep.d.ts.map +1 -0
- package/dist/flows/signatureStep.js +99 -0
- package/dist/flows/types.d.ts +106 -0
- package/dist/flows/types.d.ts.map +1 -0
- package/dist/flows/types.js +1 -0
- package/dist/flows/useGeolocation.d.ts +24 -0
- package/dist/flows/useGeolocation.d.ts.map +1 -0
- package/dist/flows/useGeolocation.js +82 -0
- package/dist/flows/useShowSuccessScreen.d.ts +3 -0
- package/dist/flows/useShowSuccessScreen.d.ts.map +1 -0
- package/dist/flows/useShowSuccessScreen.js +51 -0
- package/dist/flows/useTimeout.d.ts +7 -0
- package/dist/flows/useTimeout.d.ts.map +1 -0
- package/dist/flows/useTimeout.js +68 -0
- package/dist/flows/videoIdSteps.d.ts +33 -0
- package/dist/flows/videoIdSteps.d.ts.map +1 -0
- package/dist/flows/videoIdSteps.js +54 -0
- package/dist/guidance/selfieStrings.d.ts +18 -0
- package/dist/guidance/selfieStrings.d.ts.map +1 -0
- package/dist/guidance/selfieStrings.js +97 -0
- package/dist/guidance/strings.d.ts +4 -0
- package/dist/guidance/strings.d.ts.map +1 -0
- package/dist/guidance/strings.js +43 -0
- package/dist/guidance/videoIdStrings.d.ts +23 -0
- package/dist/guidance/videoIdStrings.d.ts.map +1 -0
- package/dist/guidance/videoIdStrings.js +23 -0
- package/dist/i18n/index.d.ts +1221 -0
- package/dist/i18n/index.d.ts.map +1 -0
- package/dist/i18n/index.js +92 -0
- package/dist/i18n/locales/de.d.ts +149 -0
- package/dist/i18n/locales/de.d.ts.map +1 -0
- package/dist/i18n/locales/de.js +147 -0
- package/dist/i18n/locales/en.d.ts +3 -0
- package/dist/i18n/locales/en.d.ts.map +1 -0
- package/dist/i18n/locales/en.js +1 -0
- package/dist/i18n/locales/es.d.ts +149 -0
- package/dist/i18n/locales/es.d.ts.map +1 -0
- package/dist/i18n/locales/es.js +147 -0
- package/dist/i18n/locales/fr.d.ts +149 -0
- package/dist/i18n/locales/fr.d.ts.map +1 -0
- package/dist/i18n/locales/fr.js +147 -0
- package/dist/i18n/locales/it.d.ts +149 -0
- package/dist/i18n/locales/it.d.ts.map +1 -0
- package/dist/i18n/locales/it.js +147 -0
- package/dist/i18n/locales/ja.d.ts +149 -0
- package/dist/i18n/locales/ja.d.ts.map +1 -0
- package/dist/i18n/locales/ja.js +147 -0
- package/dist/i18n/locales/pt.d.ts +149 -0
- package/dist/i18n/locales/pt.d.ts.map +1 -0
- package/dist/i18n/locales/pt.js +147 -0
- package/dist/i18n/locales/ru.d.ts +149 -0
- package/dist/i18n/locales/ru.d.ts.map +1 -0
- package/dist/i18n/locales/ru.js +147 -0
- package/dist/i18n/locales/zh.d.ts +149 -0
- package/dist/i18n/locales/zh.d.ts.map +1 -0
- package/dist/i18n/locales/zh.js +147 -0
- package/dist/i18n/render.d.ts +3 -0
- package/dist/i18n/render.d.ts.map +1 -0
- package/dist/i18n/render.js +7 -0
- package/dist/index.d.ts +157 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +191 -0
- package/dist/layout/GuideLayoutContext.d.ts +24 -0
- package/dist/layout/GuideLayoutContext.d.ts.map +1 -0
- package/dist/layout/GuideLayoutContext.js +19 -0
- package/dist/layout/GuideOrientationContext.d.ts +16 -0
- package/dist/layout/GuideOrientationContext.d.ts.map +1 -0
- package/dist/layout/GuideOrientationContext.js +40 -0
- package/dist/layout/useResizeObserver.d.ts +11 -0
- package/dist/layout/useResizeObserver.d.ts.map +1 -0
- package/dist/layout/useResizeObserver.js +114 -0
- package/dist/testing/alignGlobals.d.ts +2 -0
- package/dist/testing/alignGlobals.d.ts.map +1 -0
- package/dist/testing/alignGlobals.js +25 -0
- package/dist/testing/buildDocumentState.d.ts +4 -0
- package/dist/testing/buildDocumentState.d.ts.map +1 -0
- package/dist/testing/buildDocumentState.js +19 -0
- package/dist/testing/buildSelfieState.d.ts +8 -0
- package/dist/testing/buildSelfieState.d.ts.map +1 -0
- package/dist/testing/buildSelfieState.js +84 -0
- package/dist/testing/buildSignatureState.d.ts +3 -0
- package/dist/testing/buildSignatureState.d.ts.map +1 -0
- package/dist/testing/buildSignatureState.js +12 -0
- package/dist/testing/buildState.d.ts +3 -0
- package/dist/testing/buildState.d.ts.map +1 -0
- package/dist/testing/buildState.js +34 -0
- package/dist/testing/buildVideoIdState.d.ts +3 -0
- package/dist/testing/buildVideoIdState.d.ts.map +1 -0
- package/dist/testing/buildVideoIdState.js +11 -0
- package/dist/testing/classNamesLeaves.d.ts +14 -0
- package/dist/testing/classNamesLeaves.d.ts.map +1 -0
- package/dist/testing/classNamesLeaves.js +144 -0
- package/dist/testing/fakeClient.d.ts +61 -0
- package/dist/testing/fakeClient.d.ts.map +1 -0
- package/dist/testing/fakeClient.js +142 -0
- package/dist/testing/fakeController.d.ts +18 -0
- package/dist/testing/fakeController.d.ts.map +1 -0
- package/dist/testing/fakeController.js +165 -0
- package/dist/testing/fakeDocumentController.d.ts +37 -0
- package/dist/testing/fakeDocumentController.d.ts.map +1 -0
- package/dist/testing/fakeDocumentController.js +104 -0
- package/dist/testing/fakeSelfieController.d.ts +15 -0
- package/dist/testing/fakeSelfieController.d.ts.map +1 -0
- package/dist/testing/fakeSelfieController.js +154 -0
- package/dist/testing/fakeSignatureController.d.ts +12 -0
- package/dist/testing/fakeSignatureController.d.ts.map +1 -0
- package/dist/testing/fakeSignatureController.js +58 -0
- package/dist/testing/fakeVideoIdController.d.ts +12 -0
- package/dist/testing/fakeVideoIdController.d.ts.map +1 -0
- package/dist/testing/fakeVideoIdController.js +50 -0
- package/dist/testing/index.d.ts +15 -0
- package/dist/testing/index.d.ts.map +1 -0
- package/dist/testing/index.js +18 -0
- package/dist/testing/stubSignatureCanvas.d.ts +2 -0
- package/dist/testing/stubSignatureCanvas.d.ts.map +1 -0
- package/dist/testing/stubSignatureCanvas.js +26 -0
- package/dist/testing/stubVideoCaptureDom.d.ts +2 -0
- package/dist/testing/stubVideoCaptureDom.d.ts.map +1 -0
- package/dist/testing/stubVideoCaptureDom.js +36 -0
- package/dist/theme/color.d.ts +14 -0
- package/dist/theme/color.d.ts.map +1 -0
- package/dist/theme/color.js +1 -0
- package/dist/theme/index.d.ts +405 -0
- package/dist/theme/index.d.ts.map +1 -0
- package/dist/theme/index.js +230 -0
- package/dist/utils/canvas.d.ts +3 -0
- package/dist/utils/canvas.d.ts.map +1 -0
- package/dist/utils/canvas.js +16 -0
- package/dist/utils/cdn.d.ts +2 -0
- package/dist/utils/cdn.d.ts.map +1 -0
- package/dist/utils/cdn.js +3 -0
- package/dist/utils/cropping.d.ts +4 -0
- package/dist/utils/cropping.d.ts.map +1 -0
- package/dist/utils/cropping.js +11 -0
- package/dist/utils/flowClock.d.ts +6 -0
- package/dist/utils/flowClock.d.ts.map +1 -0
- package/dist/utils/flowClock.js +22 -0
- package/dist/utils/isMobile.d.ts +3 -0
- package/dist/utils/isMobile.d.ts.map +1 -0
- package/dist/utils/isMobile.js +35 -0
- package/dist/utils/loadProgressHooks.d.ts +25 -0
- package/dist/utils/loadProgressHooks.d.ts.map +1 -0
- package/dist/utils/loadProgressHooks.js +79 -0
- package/dist/utils/logger.d.ts +18 -0
- package/dist/utils/logger.d.ts.map +1 -0
- package/dist/utils/logger.js +38 -0
- package/dist/utils/merge.d.ts +3 -0
- package/dist/utils/merge.d.ts.map +1 -0
- package/dist/utils/merge.js +23 -0
- package/dist/utils/signaturePadStrokeGuard.d.ts +16 -0
- package/dist/utils/signaturePadStrokeGuard.d.ts.map +1 -0
- package/dist/utils/signaturePadStrokeGuard.js +70 -0
- package/dist/version.d.ts +2 -0
- package/dist/version.d.ts.map +1 -0
- package/dist/version.js +3 -0
- package/package.json +71 -0
|
@@ -0,0 +1,171 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { useEffect, useMemo, useRef, useState } from 'react';
|
|
3
|
+
import { SubmissionAction, } from '@idmission/websdk-core/client';
|
|
4
|
+
import { createIdCaptureController, } from '@idmission/websdk-core/idCapture';
|
|
5
|
+
import { createSelfieCaptureController, } from '@idmission/websdk-core/selfieCapture';
|
|
6
|
+
import { createVideoIdCaptureController, } from '@idmission/websdk-core/videoIdCapture';
|
|
7
|
+
import { acquireCamera } from '@idmission/websdk-core/camera';
|
|
8
|
+
import { createSignatureCaptureController, } from '@idmission/websdk-core/signatureCapture';
|
|
9
|
+
import { CompositeWizard } from './CompositeWizard';
|
|
10
|
+
import { buildAdditionalDocumentsStep } from './additionalDocuments';
|
|
11
|
+
import { createSharedCameraAcquirer, withVirtualCameras, } from './sharedCamera';
|
|
12
|
+
import { buildSignatureStep, signatureStageMode, signatureStageReplacesFaceLiveness, } from './signatureStep';
|
|
13
|
+
import { FlowChassis } from './FlowChassis';
|
|
14
|
+
import { buildRingScreenProps } from './ringScreens';
|
|
15
|
+
import { isRingModeActive } from './ringIntroImplications';
|
|
16
|
+
import { buildVideoIdSteps } from './videoIdSteps';
|
|
17
|
+
const EMPTY_ID_CAPTURE = {};
|
|
18
|
+
const EMPTY_FACE_CAPTURE = {};
|
|
19
|
+
const EMPTY_SIGNATURE_CAPTURE = {};
|
|
20
|
+
const EMPTY_VIDEO_CAPTURE = {};
|
|
21
|
+
const EMPTY_ID_VIEW = {};
|
|
22
|
+
const EMPTY_FACE_VIEW = {};
|
|
23
|
+
const EMPTY_VIDEO_VIEW = {};
|
|
24
|
+
const EMPTY_SUBMISSION = {};
|
|
25
|
+
const EMPTY_ARTIFACTS = {};
|
|
26
|
+
export function VideoIdValidationFlow({ client, idController, selfieController, controller, idCapture = EMPTY_ID_CAPTURE, faceCapture = EMPTY_FACE_CAPTURE, capture = EMPTY_VIDEO_CAPTURE, idView = EMPTY_ID_VIEW, faceView = EMPTY_FACE_VIEW, view = EMPTY_VIDEO_VIEW, submission = EMPTY_SUBMISSION, initialArtifacts = EMPTY_ARTIFACTS, captureOnly = false, signatureController, signatureCapture = EMPTY_SIGNATURE_CAPTURE, signatureView, captureSignature, captureSignatureVideo, allowVirtualCameras, skipIdCapture = false, matchOnly = false, readTextPrompt, onMicrophoneAccessDenied, theme, className, showSuccessScreen = false, showDiagnostics = false, captureAdditionalDocuments, additionalDocumentClassNames, ringScreenClassNames, onCaptured, onSubmitted, onCaptureError, children, ...callbacks }) {
|
|
27
|
+
const { checkLivenessOptions, ...selfieCaptureConfig } = faceCapture;
|
|
28
|
+
const clientRef = useRef(client);
|
|
29
|
+
const checkLivenessOptionsRef = useRef(checkLivenessOptions);
|
|
30
|
+
useEffect(() => {
|
|
31
|
+
clientRef.current = client;
|
|
32
|
+
}, [client]);
|
|
33
|
+
useEffect(() => {
|
|
34
|
+
checkLivenessOptionsRef.current = checkLivenessOptions;
|
|
35
|
+
}, [checkLivenessOptions]);
|
|
36
|
+
// sdk2 VideoIdValidation.tsx:689-694, verbatim: an ID reaches the submission
|
|
37
|
+
// either by being captured or by being supplied for the face match, and with
|
|
38
|
+
// neither there is nothing to validate.
|
|
39
|
+
const action = submission.idCardForFaceMatch || !skipIdCapture
|
|
40
|
+
? matchOnly
|
|
41
|
+
? SubmissionAction.MATCH_ID_AND_FACE
|
|
42
|
+
: SubmissionAction.VALIDATE
|
|
43
|
+
: SubmissionAction.NONE;
|
|
44
|
+
// Throws on the mutually-exclusive prop pair before anything is created.
|
|
45
|
+
const signatureMode = signatureStageMode(captureSignature, captureSignatureVideo);
|
|
46
|
+
// Four stages want the camera in sequence; the shared acquirer removes the
|
|
47
|
+
// device-dependent handoff race entirely.
|
|
48
|
+
const [sharedAcquireCamera] = useState(() => createSharedCameraAcquirer(idCapture.io?.acquireCamera ??
|
|
49
|
+
selfieCaptureConfig.io?.acquireCamera ??
|
|
50
|
+
capture.io?.acquireCamera ??
|
|
51
|
+
signatureCapture.io?.acquireCamera ??
|
|
52
|
+
acquireCamera));
|
|
53
|
+
const [resolvedSignatureController] = useState(() => signatureMode
|
|
54
|
+
? (signatureController ??
|
|
55
|
+
createSignatureCaptureController({
|
|
56
|
+
...signatureCapture,
|
|
57
|
+
// `signatureMode`, NOT `signatureCapture.mode ?? signatureMode`:
|
|
58
|
+
// `buildSignatureStep` picks the STAGE from the captureSignature /
|
|
59
|
+
// captureSignatureVideo pair alone, so honouring a stale mode
|
|
60
|
+
// override here would mount a still-signature stage on a video
|
|
61
|
+
// controller (or the reverse). IdAndFaceValidationFlow already had
|
|
62
|
+
// this right and flows.test.tsx pins the rule.
|
|
63
|
+
mode: signatureMode,
|
|
64
|
+
camera: withVirtualCameras(signatureCapture.camera, allowVirtualCameras),
|
|
65
|
+
deferCameraAcquisition: true,
|
|
66
|
+
io: { ...signatureCapture.io, acquireCamera: sharedAcquireCamera },
|
|
67
|
+
}))
|
|
68
|
+
: null);
|
|
69
|
+
const [resolvedIdController] = useState(() => idController ??
|
|
70
|
+
createIdCaptureController({
|
|
71
|
+
...idCapture,
|
|
72
|
+
client,
|
|
73
|
+
submission: { ...submission, action },
|
|
74
|
+
flipConfirmation: idCapture.flipConfirmation ??
|
|
75
|
+
(idView.flipReview ? 'manual' : undefined),
|
|
76
|
+
camera: withVirtualCameras(idCapture.camera, allowVirtualCameras),
|
|
77
|
+
deferCameraAcquisition: idCapture.deferCameraAcquisition ??
|
|
78
|
+
(idView.loadingOverlayMode === 'ring' && idView.showIntroScreen),
|
|
79
|
+
io: { ...idCapture.io, acquireCamera: sharedAcquireCamera },
|
|
80
|
+
}));
|
|
81
|
+
const [resolvedSelfieController] = useState(() => selfieController ??
|
|
82
|
+
createSelfieCaptureController({
|
|
83
|
+
...selfieCaptureConfig,
|
|
84
|
+
deferCameraAcquisition: selfieCaptureConfig.deferCameraAcquisition ??
|
|
85
|
+
(faceView.loadingOverlayMode === 'ring' &&
|
|
86
|
+
faceView.showIntroScreen),
|
|
87
|
+
camera: withVirtualCameras(selfieCaptureConfig.camera, allowVirtualCameras),
|
|
88
|
+
liveness: {
|
|
89
|
+
...selfieCaptureConfig.liveness,
|
|
90
|
+
checkLiveness: (image) => clientRef.current.checkLiveness(image, checkLivenessOptionsRef.current),
|
|
91
|
+
},
|
|
92
|
+
io: { ...selfieCaptureConfig.io, acquireCamera: sharedAcquireCamera },
|
|
93
|
+
}));
|
|
94
|
+
const [resolvedVideoController] = useState(() => controller ??
|
|
95
|
+
createVideoIdCaptureController({
|
|
96
|
+
...capture,
|
|
97
|
+
// The controller only needs to know a reading stage exists; the
|
|
98
|
+
// sentence itself is the view's business.
|
|
99
|
+
readText: capture.readText ?? Boolean(readTextPrompt),
|
|
100
|
+
camera: withVirtualCameras({ preferFrontFacingCamera: true, ...capture.camera }, allowVirtualCameras),
|
|
101
|
+
deferCameraAcquisition: capture.deferCameraAcquisition ??
|
|
102
|
+
(view.loadingOverlayMode === 'ring' && view.showIntroScreen),
|
|
103
|
+
io: { ...capture.io, acquireCamera: sharedAcquireCamera },
|
|
104
|
+
}));
|
|
105
|
+
const steps = useMemo(() => {
|
|
106
|
+
const result = buildVideoIdSteps({
|
|
107
|
+
idController: resolvedIdController,
|
|
108
|
+
selfieController: resolvedSelfieController,
|
|
109
|
+
videoController: resolvedVideoController,
|
|
110
|
+
idView,
|
|
111
|
+
faceView,
|
|
112
|
+
view,
|
|
113
|
+
onCaptureError,
|
|
114
|
+
// sdk2's rule: a video signature supplies the liveness, so the
|
|
115
|
+
// face-liveness stage is dropped rather than run twice.
|
|
116
|
+
includeFaceLiveness: !signatureStageReplacesFaceLiveness(captureSignatureVideo),
|
|
117
|
+
includeIdCapture: !skipIdCapture,
|
|
118
|
+
readTextPrompt,
|
|
119
|
+
onMicrophoneAccessDenied,
|
|
120
|
+
});
|
|
121
|
+
if (resolvedSignatureController) {
|
|
122
|
+
const signature = buildSignatureStep({
|
|
123
|
+
captureSignature,
|
|
124
|
+
captureSignatureVideo,
|
|
125
|
+
controller: resolvedSignatureController,
|
|
126
|
+
view: signatureView,
|
|
127
|
+
});
|
|
128
|
+
if (signature)
|
|
129
|
+
result.push(signature);
|
|
130
|
+
}
|
|
131
|
+
const additionalDocuments = buildAdditionalDocumentsStep(captureAdditionalDocuments, additionalDocumentClassNames);
|
|
132
|
+
if (additionalDocuments)
|
|
133
|
+
result.push(additionalDocuments);
|
|
134
|
+
return result;
|
|
135
|
+
}, [
|
|
136
|
+
additionalDocumentClassNames,
|
|
137
|
+
captureAdditionalDocuments,
|
|
138
|
+
captureSignature,
|
|
139
|
+
captureSignatureVideo,
|
|
140
|
+
faceView,
|
|
141
|
+
idView,
|
|
142
|
+
skipIdCapture,
|
|
143
|
+
onCaptureError,
|
|
144
|
+
resolvedIdController,
|
|
145
|
+
resolvedSelfieController,
|
|
146
|
+
resolvedSignatureController,
|
|
147
|
+
resolvedVideoController,
|
|
148
|
+
readTextPrompt,
|
|
149
|
+
onMicrophoneAccessDenied,
|
|
150
|
+
signatureView,
|
|
151
|
+
view,
|
|
152
|
+
]);
|
|
153
|
+
// Ring-mode terminal screens, with this flow's own copy (sdk2 builds the
|
|
154
|
+
// same pair per flow). Falls back to the generic orb + diagnostic success
|
|
155
|
+
// screen when the flow is not in ring mode.
|
|
156
|
+
// buildVideoIdSteps DEFAULTS the face and video stages to ring
|
|
157
|
+
// (`loadingOverlayMode ?? 'ring'`), so a default-configured video-ID journey
|
|
158
|
+
// renders ring capture screens throughout. Reading `idView` alone left those
|
|
159
|
+
// journeys finishing on the generic orb instead of the ring pair; the
|
|
160
|
+
// sequence's own defaults are mirrored here so the two agree.
|
|
161
|
+
const videoIdSequenceIsRing = (faceView.loadingOverlayMode ?? 'ring') === 'ring' ||
|
|
162
|
+
(view.loadingOverlayMode ?? 'ring') === 'ring';
|
|
163
|
+
const ringScreens = buildRingScreenProps({
|
|
164
|
+
finishingClassNames: ringScreenClassNames?.finishingScreen,
|
|
165
|
+
successClassNames: ringScreenClassNames?.successScreen,
|
|
166
|
+
ringMode: isRingModeActive(idView) || videoIdSequenceIsRing,
|
|
167
|
+
finishingVerbiage: { finishingStage1Text: 'Uploading your captures', finishingStage2Text: 'Checking your ID details' },
|
|
168
|
+
successVerbiage: { successSubtitleText: '', successIssuerValueText: 'Identity data', successIssuerCaptionText: 'confirmed' },
|
|
169
|
+
});
|
|
170
|
+
return (_jsxs(FlowChassis, { client: client, action: action, submission: submission, theme: theme, className: className, ...callbacks, children: [_jsx(CompositeWizard, { ...ringScreens, steps: steps, initialArtifacts: initialArtifacts, captureOnly: captureOnly, showSuccessScreen: showSuccessScreen, showDiagnostics: showDiagnostics, onArtifactsCollected: onCaptured, onSubmitted: onSubmitted }), children] }));
|
|
171
|
+
}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { type AdditionalDocumentCaptureWizardClassNames, type AdditionalDocumentCaptureWizardVerbiage } from '../components/additional_documents/AdditionalDocumentCaptureWizard';
|
|
2
|
+
import type { AdditionalDocument } from '../components/additional_documents/types';
|
|
3
|
+
import type { CompositeWizardStep } from './CompositeWizard';
|
|
4
|
+
export declare function buildAdditionalDocumentsStep(documents: readonly AdditionalDocument[] | undefined, classNames?: AdditionalDocumentCaptureWizardClassNames, verbiage?: AdditionalDocumentCaptureWizardVerbiage): CompositeWizardStep | null;
|
|
5
|
+
//# sourceMappingURL=additionalDocuments.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"additionalDocuments.d.ts","sourceRoot":"","sources":["../../src/flows/additionalDocuments.tsx"],"names":[],"mappings":"AASA,OAAO,EAEL,KAAK,yCAAyC,EAC9C,KAAK,uCAAuC,EAC7C,MAAM,oEAAoE,CAAA;AAC3E,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,0CAA0C,CAAA;AAClF,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,mBAAmB,CAAA;AAE5D,wBAAgB,4BAA4B,CAC1C,SAAS,EAAE,SAAS,kBAAkB,EAAE,GAAG,SAAS,EAOpD,UAAU,CAAC,EAAE,yCAAyC,EACtD,QAAQ,CAAC,EAAE,uCAAuC,GACjD,mBAAmB,GAAG,IAAI,CAgB5B"}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
// The adapter between the additional-documents wizard and the flow chassis,
|
|
3
|
+
// replacing sdk2's `CompositeWizardCheck = 'AdditionalDocumentCapture'` stage
|
|
4
|
+
// (components/CompositeWizard.tsx:65, :466).
|
|
5
|
+
//
|
|
6
|
+
// sdk2 gates the stage on `documents?.length ?? 0 > 0`, which is an operator
|
|
7
|
+
// precedence slip (`>` binds tighter than `??`, so it evaluates
|
|
8
|
+
// `length ?? false`). It happens to behave correctly for every reachable
|
|
9
|
+
// input, so the clean `length > 0` here is behaviorally identical, not a
|
|
10
|
+
// divergence. Do not "fix" it back.
|
|
11
|
+
import { AdditionalDocumentCaptureWizard, } from '../components/additional_documents/AdditionalDocumentCaptureWizard';
|
|
12
|
+
export function buildAdditionalDocumentsStep(documents,
|
|
13
|
+
// Accepted and wired through to the wizard, but no flow currently exposes
|
|
14
|
+
// a prop that reaches these two parameters — every call site in this
|
|
15
|
+
// branch passes only `documents`. They exist as the seam a later task
|
|
16
|
+
// (workstream 06's sdk2 compat façade) plumbs sdk2's
|
|
17
|
+
// `classNames.additionalDocumentCapture` / `verbiage.additionalDocumentCapture`
|
|
18
|
+
// into; see the divergence ledger. Do not remove them as "unused."
|
|
19
|
+
classNames, verbiage) {
|
|
20
|
+
if (!documents?.length)
|
|
21
|
+
return null;
|
|
22
|
+
return {
|
|
23
|
+
id: 'additional-documents',
|
|
24
|
+
render: (complete) => (_jsx(AdditionalDocumentCaptureWizard, { documents: documents, classNames: classNames, verbiage: verbiage, onComplete: (additionalDocuments) => complete({ documents: { additionalDocuments } }) })),
|
|
25
|
+
};
|
|
26
|
+
}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import type { SubmissionArtifacts } from '@idmission/websdk-core/client';
|
|
2
|
+
/**
|
|
3
|
+
* Merges artifacts produced by consecutive flow stages without discarding
|
|
4
|
+
* capture-attempt metadata collected by an earlier stage.
|
|
5
|
+
*/
|
|
6
|
+
export declare function mergeSubmissionArtifacts(current: SubmissionArtifacts, incoming: SubmissionArtifacts): SubmissionArtifacts;
|
|
7
|
+
export declare function buildSelfieArtifacts(imageUrl: string, capturedAt: Date, capturedAttempt: NonNullable<NonNullable<NonNullable<SubmissionArtifacts['meta']>['captureAttempts']>['selfie']>[number] | null): SubmissionArtifacts;
|
|
8
|
+
//# sourceMappingURL=artifacts.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"artifacts.d.ts","sourceRoot":"","sources":["../../src/flows/artifacts.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,+BAA+B,CAAA;AA2BxE;;;GAGG;AACH,wBAAgB,wBAAwB,CACtC,OAAO,EAAE,mBAAmB,EAC5B,QAAQ,EAAE,mBAAmB,GAC5B,mBAAmB,CAsDrB;AAED,wBAAgB,oBAAoB,CAClC,QAAQ,EAAE,MAAM,EAChB,UAAU,EAAE,IAAI,EAChB,eAAe,EACX,WAAW,CACT,WAAW,CACT,WAAW,CAAC,mBAAmB,CAAC,MAAM,CAAC,CAAC,CAAC,iBAAiB,CAAC,CAC5D,CAAC,QAAQ,CAAC,CACZ,CAAC,MAAM,CAAC,GACT,IAAI,GACP,mBAAmB,CAYrB"}
|
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
function mergeCaptureAttempts(current, incoming) {
|
|
2
|
+
if (!current && !incoming)
|
|
3
|
+
return undefined;
|
|
4
|
+
return {
|
|
5
|
+
...(current?.front !== undefined || incoming?.front !== undefined
|
|
6
|
+
? { front: [...(current?.front ?? []), ...(incoming?.front ?? [])] }
|
|
7
|
+
: {}),
|
|
8
|
+
...(current?.back !== undefined || incoming?.back !== undefined
|
|
9
|
+
? { back: [...(current?.back ?? []), ...(incoming?.back ?? [])] }
|
|
10
|
+
: {}),
|
|
11
|
+
...(current?.selfie !== undefined || incoming?.selfie !== undefined
|
|
12
|
+
? { selfie: [...(current?.selfie ?? []), ...(incoming?.selfie ?? [])] }
|
|
13
|
+
: {}),
|
|
14
|
+
...(current?.barcode !== undefined || incoming?.barcode !== undefined
|
|
15
|
+
? { barcode: [...(current?.barcode ?? []), ...(incoming?.barcode ?? [])] }
|
|
16
|
+
: {}),
|
|
17
|
+
};
|
|
18
|
+
}
|
|
19
|
+
/**
|
|
20
|
+
* Merges artifacts produced by consecutive flow stages without discarding
|
|
21
|
+
* capture-attempt metadata collected by an earlier stage.
|
|
22
|
+
*/
|
|
23
|
+
export function mergeSubmissionArtifacts(current, incoming) {
|
|
24
|
+
const id = current.id || incoming.id ? { ...current.id, ...incoming.id } : undefined;
|
|
25
|
+
const face = current.face || incoming.face
|
|
26
|
+
? { ...current.face, ...incoming.face }
|
|
27
|
+
: undefined;
|
|
28
|
+
const video = current.video || incoming.video
|
|
29
|
+
? { ...current.video, ...incoming.video }
|
|
30
|
+
: undefined;
|
|
31
|
+
const signature = current.signature || incoming.signature
|
|
32
|
+
? { ...current.signature, ...incoming.signature }
|
|
33
|
+
: undefined;
|
|
34
|
+
const documents = current.documents || incoming.documents
|
|
35
|
+
? {
|
|
36
|
+
...current.documents,
|
|
37
|
+
...incoming.documents,
|
|
38
|
+
...(current.documents?.documentFileMetadata ||
|
|
39
|
+
incoming.documents?.documentFileMetadata
|
|
40
|
+
? {
|
|
41
|
+
documentFileMetadata: {
|
|
42
|
+
...current.documents?.documentFileMetadata,
|
|
43
|
+
...incoming.documents?.documentFileMetadata,
|
|
44
|
+
},
|
|
45
|
+
}
|
|
46
|
+
: {}),
|
|
47
|
+
}
|
|
48
|
+
: undefined;
|
|
49
|
+
const captureAttempts = mergeCaptureAttempts(current.meta?.captureAttempts, incoming.meta?.captureAttempts);
|
|
50
|
+
const meta = current.meta || incoming.meta
|
|
51
|
+
? {
|
|
52
|
+
...current.meta,
|
|
53
|
+
...incoming.meta,
|
|
54
|
+
...(captureAttempts ? { captureAttempts } : {}),
|
|
55
|
+
}
|
|
56
|
+
: undefined;
|
|
57
|
+
return {
|
|
58
|
+
...current,
|
|
59
|
+
...incoming,
|
|
60
|
+
...(id ? { id } : {}),
|
|
61
|
+
...(face ? { face } : {}),
|
|
62
|
+
...(video ? { video } : {}),
|
|
63
|
+
...(signature ? { signature } : {}),
|
|
64
|
+
...(documents ? { documents } : {}),
|
|
65
|
+
...(meta ? { meta } : {}),
|
|
66
|
+
};
|
|
67
|
+
}
|
|
68
|
+
export function buildSelfieArtifacts(imageUrl, capturedAt, capturedAttempt) {
|
|
69
|
+
return {
|
|
70
|
+
face: {
|
|
71
|
+
selfieImage: imageUrl.split(',')[1] ?? imageUrl,
|
|
72
|
+
selfieCapturedAt: capturedAt.toISOString(),
|
|
73
|
+
},
|
|
74
|
+
meta: {
|
|
75
|
+
captureAttempts: {
|
|
76
|
+
selfie: capturedAttempt ? [capturedAttempt] : [],
|
|
77
|
+
},
|
|
78
|
+
},
|
|
79
|
+
};
|
|
80
|
+
}
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
import { LiveFaceNotDetectedError, type IdmissionClient, type LivenessOptions, type SubmissionArtifacts, type SubmissionResponse } from '@idmission/websdk-core/client';
|
|
2
|
+
import type { SelfieCaptureController } from '@idmission/websdk-core/selfieCapture';
|
|
3
|
+
import { type RingFinishingScreenClassNames, type RingFinishingScreenVerbiage } from '../../components/ring/RingFinishingScreen';
|
|
4
|
+
import type { SelfieFlowViewProps } from '../types';
|
|
5
|
+
import type { MatchReducerAdapter } from './adapters';
|
|
6
|
+
export type CustomerMatchCaptureProps<S, A> = {
|
|
7
|
+
adapter: MatchReducerAdapter<S, A>;
|
|
8
|
+
client: IdmissionClient;
|
|
9
|
+
controller: SelfieCaptureController;
|
|
10
|
+
view?: SelfieFlowViewProps;
|
|
11
|
+
initialArtifacts?: SubmissionArtifacts;
|
|
12
|
+
/**
|
|
13
|
+
* Gates the matching submission on a confirmed live face. Mirrors sdk2's
|
|
14
|
+
* `useFrontendLivenessToken` prop: when false the live-check is skipped
|
|
15
|
+
* entirely and the captured selfie goes straight to the endpoint.
|
|
16
|
+
*/
|
|
17
|
+
useFrontendLivenessToken?: boolean;
|
|
18
|
+
checkLivenessOptions?: Omit<LivenessOptions, 'softFail'>;
|
|
19
|
+
captureGuidanceTimeoutDurationMs?: number;
|
|
20
|
+
/** Receives the response plus the selfie data URL that produced it. */
|
|
21
|
+
onMatched?: (response: SubmissionResponse, selfieDataUrl: string) => void;
|
|
22
|
+
onNotMatched?: (response: SubmissionResponse, selfieDataUrl: string) => void;
|
|
23
|
+
/** Fires once, after MAX_LIVENESS_ATTEMPTS rejected checks and BEFORE any submission. */
|
|
24
|
+
onLivenessCheckFailed?: (error: LiveFaceNotDetectedError) => void;
|
|
25
|
+
onRequestError?: (error: Error) => void;
|
|
26
|
+
/**
|
|
27
|
+
* Fires when the submission was intercepted by the client's `onSubmit`
|
|
28
|
+
* rather than posted, so there is no verdict to classify. The flow ends
|
|
29
|
+
* quietly — see the call site for why that is not a failure.
|
|
30
|
+
*/
|
|
31
|
+
onSubmissionIntercepted?: () => void;
|
|
32
|
+
onCaptureGuidanceTimeout?: () => void;
|
|
33
|
+
onExitCapture?: () => void;
|
|
34
|
+
/**
|
|
35
|
+
* Ring-mode finishing screen shown while the matching request is in flight,
|
|
36
|
+
* in place of the generic orb (sdk2 CustomerIdentificationWizard.tsx:391-402).
|
|
37
|
+
*
|
|
38
|
+
* sdk2 gated this on its `shouldShowCustomerIdentificationFinishing`
|
|
39
|
+
* predicate, whose attempt/finishingAttempt bookkeeping existed because its
|
|
40
|
+
* wizard's captureState and submission status updated independently and
|
|
41
|
+
* could disagree across attempts. Here the reducer moves SUBMITTING ->
|
|
42
|
+
* terminal atomically on the response, and a terminal outcome unmounts this
|
|
43
|
+
* component entirely, so the phase alone is unambiguous and that predicate
|
|
44
|
+
* has nothing left to guard.
|
|
45
|
+
*/
|
|
46
|
+
finishingScreen?: {
|
|
47
|
+
mode?: 'default' | 'ring';
|
|
48
|
+
verbiage?: RingFinishingScreenVerbiage;
|
|
49
|
+
classNames?: RingFinishingScreenClassNames;
|
|
50
|
+
};
|
|
51
|
+
};
|
|
52
|
+
export declare function CustomerMatchCapture<S, A>({ adapter, client, controller, view, initialArtifacts, useFrontendLivenessToken, checkLivenessOptions, captureGuidanceTimeoutDurationMs, onMatched, onNotMatched, onLivenessCheckFailed, onRequestError, onSubmissionIntercepted, onCaptureGuidanceTimeout, onExitCapture, finishingScreen, }: CustomerMatchCaptureProps<S, A>): import("react/jsx-runtime").JSX.Element;
|
|
53
|
+
//# sourceMappingURL=CustomerMatchCapture.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"CustomerMatchCapture.d.ts","sourceRoot":"","sources":["../../../src/flows/customerMatch/CustomerMatchCapture.tsx"],"names":[],"mappings":"AAiBA,OAAO,EACL,wBAAwB,EACxB,KAAK,eAAe,EACpB,KAAK,eAAe,EACpB,KAAK,mBAAmB,EACxB,KAAK,kBAAkB,EACxB,MAAM,+BAA+B,CAAA;AACtC,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,sCAAsC,CAAA;AAMnF,OAAO,EAEL,KAAK,6BAA6B,EAClC,KAAK,2BAA2B,EACjC,MAAM,2CAA2C,CAAA;AAElD,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,UAAU,CAAA;AACnD,OAAO,KAAK,EAAc,mBAAmB,EAAE,MAAM,YAAY,CAAA;AASjE,MAAM,MAAM,yBAAyB,CAAC,CAAC,EAAE,CAAC,IAAI;IAC5C,OAAO,EAAE,mBAAmB,CAAC,CAAC,EAAE,CAAC,CAAC,CAAA;IAClC,MAAM,EAAE,eAAe,CAAA;IACvB,UAAU,EAAE,uBAAuB,CAAA;IACnC,IAAI,CAAC,EAAE,mBAAmB,CAAA;IAC1B,gBAAgB,CAAC,EAAE,mBAAmB,CAAA;IACtC;;;;OAIG;IACH,wBAAwB,CAAC,EAAE,OAAO,CAAA;IAClC,oBAAoB,CAAC,EAAE,IAAI,CAAC,eAAe,EAAE,UAAU,CAAC,CAAA;IACxD,gCAAgC,CAAC,EAAE,MAAM,CAAA;IACzC,uEAAuE;IACvE,SAAS,CAAC,EAAE,CAAC,QAAQ,EAAE,kBAAkB,EAAE,aAAa,EAAE,MAAM,KAAK,IAAI,CAAA;IACzE,YAAY,CAAC,EAAE,CAAC,QAAQ,EAAE,kBAAkB,EAAE,aAAa,EAAE,MAAM,KAAK,IAAI,CAAA;IAC5E,yFAAyF;IACzF,qBAAqB,CAAC,EAAE,CAAC,KAAK,EAAE,wBAAwB,KAAK,IAAI,CAAA;IACjE,cAAc,CAAC,EAAE,CAAC,KAAK,EAAE,KAAK,KAAK,IAAI,CAAA;IACvC;;;;OAIG;IACH,uBAAuB,CAAC,EAAE,MAAM,IAAI,CAAA;IACpC,wBAAwB,CAAC,EAAE,MAAM,IAAI,CAAA;IACrC,aAAa,CAAC,EAAE,MAAM,IAAI,CAAA;IAC1B;;;;;;;;;;;OAWG;IACH,eAAe,CAAC,EAAE;QAChB,IAAI,CAAC,EAAE,SAAS,GAAG,MAAM,CAAA;QACzB,QAAQ,CAAC,EAAE,2BAA2B,CAAA;QACtC,UAAU,CAAC,EAAE,6BAA6B,CAAA;KAC3C,CAAA;CACF,CAAA;AAUD,wBAAgB,oBAAoB,CAAC,CAAC,EAAE,CAAC,EAAE,EACzC,OAAO,EACP,MAAM,EACN,UAAU,EACV,IAAiB,EACjB,gBAAkC,EAClC,wBAAgC,EAChC,oBAAoB,EACpB,gCAAgC,EAChC,SAAS,EACT,YAAY,EACZ,qBAAqB,EACrB,cAAc,EACd,uBAAuB,EACvB,wBAAwB,EACxB,aAAa,EACb,eAAe,GAChB,EAAE,yBAAyB,CAAC,CAAC,EAAE,CAAC,CAAC,2CA8NjC"}
|
|
@@ -0,0 +1,211 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
// The capture -> live-check -> submit -> classify loop shared by
|
|
3
|
+
// CustomerIdentificationFlow and CustomerVerificationFlow. Ports
|
|
4
|
+
// sdk2's CustomerIdentificationCapture.tsx / CustomerVerificationCapture.tsx
|
|
5
|
+
// (near-exact twins) onto core's selfie controller.
|
|
6
|
+
//
|
|
7
|
+
// Why this is NOT a CompositeWizard flow: CompositeWizard submits exactly once,
|
|
8
|
+
// when its step sequence completes. These flows submit once PER CAPTURE and may
|
|
9
|
+
// recapture -- a live-check that does not confirm a live face sends the user
|
|
10
|
+
// back to the camera without ever calling the matching endpoint. That loop is
|
|
11
|
+
// the whole point of the two liveness-gate specs (2026-07-09, 2026-07-10), so
|
|
12
|
+
// the flow owns its own stage machine, the way SignatureKYCFlow does.
|
|
13
|
+
//
|
|
14
|
+
// The parent MUST mount this keyed by its retry attempt (`key={attempt}`).
|
|
15
|
+
// That is sdk2's own reset mechanism (CustomerIdentificationWizard.tsx's
|
|
16
|
+
// `key={`capture${attempt}`}`): the ported reducers have no reset action, so a
|
|
17
|
+
// fresh attempt is a fresh mount.
|
|
18
|
+
import { useCallback, useEffect, useReducer, useRef, useState } from 'react';
|
|
19
|
+
import { LiveFaceNotDetectedError, } from '@idmission/websdk-core/client';
|
|
20
|
+
import { SelfieCaptureView } from '../../SelfieCaptureView';
|
|
21
|
+
import { buildSelfieArtifacts, mergeSubmissionArtifacts } from '../artifacts';
|
|
22
|
+
import { submissionStatusText } from '../CompositeWizard';
|
|
23
|
+
import { OrbStatusScreen } from '../OrbStatusScreen';
|
|
24
|
+
import { useSubmission } from '../SubmissionProvider';
|
|
25
|
+
import { RingFinishingScreen, } from '../../components/ring/RingFinishingScreen';
|
|
26
|
+
import { useTimeout } from '../useTimeout';
|
|
27
|
+
/** Phases where the kick-out timer must not fire: the run already finished. */
|
|
28
|
+
const TIMEOUT_AVERTED_PHASES = [
|
|
29
|
+
'MATCHED',
|
|
30
|
+
'NOT_MATCHED',
|
|
31
|
+
'LIVENESS_FAILED',
|
|
32
|
+
];
|
|
33
|
+
const EMPTY_VIEW = {};
|
|
34
|
+
const EMPTY_ARTIFACTS = {};
|
|
35
|
+
export function CustomerMatchCapture({ adapter, client, controller, view = EMPTY_VIEW, initialArtifacts = EMPTY_ARTIFACTS, useFrontendLivenessToken = false, checkLivenessOptions, captureGuidanceTimeoutDurationMs, onMatched, onNotMatched, onLivenessCheckFailed, onRequestError, onSubmissionIntercepted, onCaptureGuidanceTimeout, onExitCapture, finishingScreen, }) {
|
|
36
|
+
const [state, dispatch] = useReducer(adapter.reducer, adapter.initialState);
|
|
37
|
+
const [pendingCapture, setPendingCapture] = useState(null);
|
|
38
|
+
const [submittable, setSubmittable] = useState(null);
|
|
39
|
+
const { action, submit } = useSubmission();
|
|
40
|
+
const phase = adapter.phaseOf(state);
|
|
41
|
+
const livenessAttempts = adapter.livenessAttemptsOf(state);
|
|
42
|
+
const clientRef = useRef(client);
|
|
43
|
+
const checkLivenessOptionsRef = useRef(checkLivenessOptions);
|
|
44
|
+
useEffect(() => {
|
|
45
|
+
clientRef.current = client;
|
|
46
|
+
}, [client]);
|
|
47
|
+
useEffect(() => {
|
|
48
|
+
checkLivenessOptionsRef.current = checkLivenessOptions;
|
|
49
|
+
}, [checkLivenessOptions]);
|
|
50
|
+
const handleCaptured = useCallback((dataUrl) => {
|
|
51
|
+
const controllerState = controller.getState();
|
|
52
|
+
const capturedAt = controllerState.capturedSelfie?.capturedAt ?? new Date();
|
|
53
|
+
setPendingCapture({
|
|
54
|
+
dataUrl,
|
|
55
|
+
artifacts: mergeSubmissionArtifacts(initialArtifacts, buildSelfieArtifacts(dataUrl, capturedAt, controllerState.capturedAttempt)),
|
|
56
|
+
});
|
|
57
|
+
// The reducer's own CAPTURING/ERROR guard drops a capture that arrives
|
|
58
|
+
// while a check or submission is already in flight.
|
|
59
|
+
dispatch(adapter.ready());
|
|
60
|
+
}, [adapter, controller, initialArtifacts]);
|
|
61
|
+
// The live-check gate. sdk2's cancellation flag is preserved: a dependency
|
|
62
|
+
// change can re-run this effect for a newer capture while a prior run's
|
|
63
|
+
// check is still in flight, and a superseded run must not reject or submit
|
|
64
|
+
// against the capture that replaced it.
|
|
65
|
+
useEffect(() => {
|
|
66
|
+
if (!pendingCapture)
|
|
67
|
+
return;
|
|
68
|
+
if (!useFrontendLivenessToken) {
|
|
69
|
+
setSubmittable(pendingCapture);
|
|
70
|
+
return;
|
|
71
|
+
}
|
|
72
|
+
let cancelled = false;
|
|
73
|
+
void (async () => {
|
|
74
|
+
const result = await clientRef.current.checkLiveness(pendingCapture.dataUrl, { ...checkLivenessOptionsRef.current, softFail: true });
|
|
75
|
+
if (cancelled)
|
|
76
|
+
return;
|
|
77
|
+
if (!result.ok) {
|
|
78
|
+
// Not confirmed live, or the check itself errored — sdk2 counts both
|
|
79
|
+
// as the same kind of failed attempt.
|
|
80
|
+
dispatch(adapter.livenessRejected());
|
|
81
|
+
return;
|
|
82
|
+
}
|
|
83
|
+
setSubmittable(pendingCapture);
|
|
84
|
+
})();
|
|
85
|
+
return () => {
|
|
86
|
+
cancelled = true;
|
|
87
|
+
};
|
|
88
|
+
}, [adapter, pendingCapture, useFrontendLivenessToken]);
|
|
89
|
+
// Re-arm the camera after a rejected check. sdk2 got this for free (its
|
|
90
|
+
// SelfieCapture stayed mounted and auto-captured again); core's controller
|
|
91
|
+
// parks in 'processing' after a capture and needs an explicit retry(). Keyed
|
|
92
|
+
// on livenessAttempts so exactly one re-arm happens per rejection, however
|
|
93
|
+
// many times this effect re-runs.
|
|
94
|
+
const rearmedForAttemptRef = useRef(0);
|
|
95
|
+
const previousPhaseRef = useRef(null);
|
|
96
|
+
useEffect(() => {
|
|
97
|
+
const previous = previousPhaseRef.current;
|
|
98
|
+
previousPhaseRef.current = phase;
|
|
99
|
+
if (phase !== 'CAPTURING')
|
|
100
|
+
return;
|
|
101
|
+
// Two routes lead back to CAPTURING and both need the camera re-armed. A
|
|
102
|
+
// rejected live-check bumps livenessAttempts; a RETRYABLE non-match comes
|
|
103
|
+
// straight back from SUBMITTING and leaves it untouched, so keying on the
|
|
104
|
+
// counter alone left the controller parked in 'processing' with no way to
|
|
105
|
+
// capture again -- the flow just hung.
|
|
106
|
+
//
|
|
107
|
+
// Both shipped reducers pin ALLOWED_MISMATCH_RETRIES to 0 (verbatim sdk2),
|
|
108
|
+
// so that second route is dead code as configured and no response can
|
|
109
|
+
// reach it. customerMatch.test.tsx covers it through a test-local adapter
|
|
110
|
+
// that allows one retry, which is the shape the shipped reducers take the
|
|
111
|
+
// moment that constant moves.
|
|
112
|
+
const returnedFromSubmit = previous === 'SUBMITTING';
|
|
113
|
+
if (!returnedFromSubmit && livenessAttempts === rearmedForAttemptRef.current) {
|
|
114
|
+
return;
|
|
115
|
+
}
|
|
116
|
+
rearmedForAttemptRef.current = livenessAttempts;
|
|
117
|
+
setPendingCapture(null);
|
|
118
|
+
setSubmittable(null);
|
|
119
|
+
controller.actions.retry();
|
|
120
|
+
}, [controller, livenessAttempts, phase]);
|
|
121
|
+
// Budget exhausted: report the distinct error and hand the flow its terminal
|
|
122
|
+
// failure. The matching endpoint is never called — `submittable` was never set.
|
|
123
|
+
const livenessFailureReportedRef = useRef(false);
|
|
124
|
+
useEffect(() => {
|
|
125
|
+
if (phase !== 'LIVENESS_FAILED')
|
|
126
|
+
return;
|
|
127
|
+
if (livenessFailureReportedRef.current)
|
|
128
|
+
return;
|
|
129
|
+
livenessFailureReportedRef.current = true;
|
|
130
|
+
onLivenessCheckFailed?.(new LiveFaceNotDetectedError());
|
|
131
|
+
}, [onLivenessCheckFailed, phase]);
|
|
132
|
+
// The submission. Guarded on the artifact object's identity rather than
|
|
133
|
+
// sdk2's bare `[submittableSelfie, submissionError, submit]` deps: `submit`
|
|
134
|
+
// changes identity whenever the provider's options/callbacks do, and sdk2
|
|
135
|
+
// would re-enter and fire a second matching request for the same capture.
|
|
136
|
+
// `submit`'s resolution is the only place the response object exists — the
|
|
137
|
+
// reducer deliberately stores the classification, not the payload (sdk2 read
|
|
138
|
+
// it back off its submission context instead), so the outcome callbacks read
|
|
139
|
+
// it from here.
|
|
140
|
+
const lastResponseRef = useRef(null);
|
|
141
|
+
const submittedRef = useRef(null);
|
|
142
|
+
// Held in a ref for the same reason `submit` is kept out of the deps above:
|
|
143
|
+
// the flow passes an inline arrow, so listing it would change identity every
|
|
144
|
+
// render and re-enter the effect.
|
|
145
|
+
const onSubmissionInterceptedRef = useRef(onSubmissionIntercepted);
|
|
146
|
+
onSubmissionInterceptedRef.current = onSubmissionIntercepted;
|
|
147
|
+
useEffect(() => {
|
|
148
|
+
if (!submittable || submittedRef.current === submittable)
|
|
149
|
+
return;
|
|
150
|
+
submittedRef.current = submittable;
|
|
151
|
+
void (async () => {
|
|
152
|
+
try {
|
|
153
|
+
dispatch(adapter.submitting(submittable.dataUrl));
|
|
154
|
+
const response = await submit(submittable.artifacts);
|
|
155
|
+
// `null` = the client's `onSubmit` took the request instead of posting
|
|
156
|
+
// it (see IdmissionClientConfig.onSubmit). Nothing went wrong and
|
|
157
|
+
// there is no verdict to classify: the integrator now owns the
|
|
158
|
+
// outcome, so the flow steps aside and shows nothing.
|
|
159
|
+
//
|
|
160
|
+
// DELIBERATE DIVERGENCE from sdk2, which throws here
|
|
161
|
+
// (CustomerIdentificationCapture.tsx:184-196,
|
|
162
|
+
// `if (!submissionResponse) throw new Error('submission failed!')`)
|
|
163
|
+
// and lands on the failure screen. It does that because its `submit()`
|
|
164
|
+
// returns null for BOTH "intercepted" and "went wrong" and this layer
|
|
165
|
+
// cannot tell them apart — not because a successful hand-off is a
|
|
166
|
+
// failure. 3.0 can tell them apart, so it does not claim the user
|
|
167
|
+
// failed something they completed.
|
|
168
|
+
if (!response) {
|
|
169
|
+
onSubmissionInterceptedRef.current?.();
|
|
170
|
+
return;
|
|
171
|
+
}
|
|
172
|
+
lastResponseRef.current = response;
|
|
173
|
+
dispatch(adapter.completed(response));
|
|
174
|
+
}
|
|
175
|
+
catch (cause) {
|
|
176
|
+
const error = cause instanceof Error ? cause : new Error(String(cause));
|
|
177
|
+
dispatch(adapter.failed(error));
|
|
178
|
+
}
|
|
179
|
+
})();
|
|
180
|
+
}, [adapter, submit, submittable]);
|
|
181
|
+
// Terminal outcomes, reported once each.
|
|
182
|
+
const outcomeReportedRef = useRef(false);
|
|
183
|
+
useEffect(() => {
|
|
184
|
+
if (outcomeReportedRef.current)
|
|
185
|
+
return;
|
|
186
|
+
if (phase === 'MATCHED' || phase === 'NOT_MATCHED') {
|
|
187
|
+
const response = lastResponseRef.current;
|
|
188
|
+
const selfieDataUrl = submittedRef.current?.dataUrl;
|
|
189
|
+
if (!response || !selfieDataUrl)
|
|
190
|
+
return;
|
|
191
|
+
outcomeReportedRef.current = true;
|
|
192
|
+
if (phase === 'MATCHED')
|
|
193
|
+
onMatched?.(response, selfieDataUrl);
|
|
194
|
+
else
|
|
195
|
+
onNotMatched?.(response, selfieDataUrl);
|
|
196
|
+
}
|
|
197
|
+
else if (phase === 'ERROR') {
|
|
198
|
+
outcomeReportedRef.current = true;
|
|
199
|
+
onRequestError?.(adapter.requestErrorOf(state) ?? new Error('The request failed.'));
|
|
200
|
+
}
|
|
201
|
+
}, [adapter, onMatched, onNotMatched, onRequestError, phase, state]);
|
|
202
|
+
useTimeout(captureGuidanceTimeoutDurationMs, onCaptureGuidanceTimeout, TIMEOUT_AVERTED_PHASES.includes(phase), phase === 'SUBMITTING');
|
|
203
|
+
if (phase === 'SUBMITTING') {
|
|
204
|
+
if (finishingScreen?.mode === 'ring') {
|
|
205
|
+
return (_jsx(RingFinishingScreen, { selfieImage: submittable?.artifacts.face?.selfieImage ?? undefined, verbiage: finishingScreen.verbiage, classNames: finishingScreen.classNames }));
|
|
206
|
+
}
|
|
207
|
+
const text = submissionStatusText(action, submittable?.artifacts ?? initialArtifacts);
|
|
208
|
+
return (_jsx(OrbStatusScreen, { state: "working", text: text, loadingStage: "submission" }));
|
|
209
|
+
}
|
|
210
|
+
return (_jsx(SelfieCaptureView, { ...view, controller: controller, onCaptured: handleCaptured, onExit: onExitCapture }));
|
|
211
|
+
}
|