import { t as CameraStream } from "./camera-9wWD-pwg.js"; import { i as FlowModuleConfig } from "./types-KPvmag_B.js"; import { n as DetectionStatus } from "./types-Hmd7U0JA.js"; import { t as DetectionOrientation } from "./IIdCaptureCapability-DHTT3FC2.js"; //#region src/modules/video-selfie/types.d.ts /** * The capture steps a Video Selfie session can run, in flow order. Which steps * are active is derived from the module config (e.g. `checkIdScan` enables * `frontId`/`backId`, `checkVoiceConsent` enables `speech`). */ type VideoSelfieStep = 'selfie' | 'frontId' | 'backId' | 'poa' | 'questions' | 'speech'; /** * Public Video Selfie configuration. Mirrors the backend `VIDEO_ONBOARDING` * workflow module. * * The whole session is recorded on-device and streamed to the backend via S3 * multipart upload (`internal/recordings/multipartRecordingService`) — the * client-side replacement for V1's server-side OpenVidu recording. See * `docs/features/VIDEO_SELFIE.md`. */ type VideoSelfieConfig = FlowModuleConfig['VIDEO_ONBOARDING']; //#endregion //#region ../infra/src/capabilities/ICameraCapability.d.ts type FacingMode = 'user' | 'environment'; //#endregion //#region ../infra/src/media/CameraCompositor.d.ts type CameraCompositorOptions = { fps?: number; }; /** * Composites the *active* camera into a canvas and exposes the canvas as a * single, stable `MediaStream` to record. Switching cameras (front ↔ back) * just repoints what the canvas draws — the output stream and its audio track * are never replaced — so a single `MediaRecorder` produces one continuous * video that follows the camera switches (V1 parity), instead of restarting * per camera. * * The audio track from the initial stream is carried through unchanged across * video switches, so there's no audio glitch when the camera flips. */ declare class CameraCompositor { private readonly fps; private readonly frameIntervalMs; private canvas; private ctx; private video; private frameRequestId; private frameRequestKind; private lastDrawTimeMs; private lastVideoTimeSeconds; private audioTrack; private videoTrack; private composite; constructor(options?: CameraCompositorOptions); /** * Begin compositing `stream` and return the composite stream to record. The * stream's audio track (if any) is carried through unchanged across later * `switchVideo` calls. */ start(stream: CameraStream): MediaStream; /** * Swap the camera feeding the canvas without interrupting the composite * stream. Pass a video-only stream (audio is kept from `start`). The previous * video track is stopped. */ switchVideo(stream: CameraStream): void; /** The composite stream being recorded, if compositing is active. */ get stream(): MediaStream | undefined; /** Stop compositing and release the canvas, audio, and video tracks. */ stop(): void; private setVideoSource; private startDrawLoop; private scheduleNextFrame; private cancelDrawLoop; private drawCurrentFrame; private getBoundedDimensions; } //#endregion //#region src/modules/video-selfie/videoSelfieStepDetector.d.ts type VideoSelfieDetectionStatus = DetectionStatus | 'wrongSide'; type VideoSelfieValidationFailure = 'selfieVerificationFailed' | 'nameVerificationFailed' | 'photoVerificationFailed' | 'idTypeMismatch' | 'idScanFailed' | 'selfieUploadFailed'; /** * Failures that re-run the current step WITHOUT consuming an attempt or the * recording: the capture itself was fine — a transport-level problem kept * the backend from delivering a verdict. */ type VideoSelfieRetryableFailure = 'idScanFailed' | 'selfieUploadFailed'; type StepDetectionResult = { outcome: 'success'; } | { outcome: 'validationFailed'; failure: VideoSelfieValidationFailure; } | { outcome: 'retryableFailure'; failure: VideoSelfieRetryableFailure; }; /** * Runs the WASM detection + backend validation for a single capture step over * the given camera stream. Returns either success or a typed validation * failure, rejects on technical failures, and never settles for manual steps. */ type StepDetector = (params: { step: VideoSelfieStep; stream: MediaStream; signal: AbortSignal; onStatus?: (status: VideoSelfieDetectionStatus) => void; /** * Live ID orientation from the detector (regular ID pipeline only), so the * mask can follow a rotated document. The Video Selfie detector never emits * it — its simplified ID pipeline reports no orientation. */ onOrientation?: (orientation: DetectionOrientation) => void; /** * Hands the caller a trigger that captures + uploads the current frame * (regular ID pipeline only). The detector reports `manualCapture` via * `onStatus` when autocapture times out; the host then shows a capture * button wired to this trigger. The Video Selfie detector never registers * one. */ registerManualCapture?: (trigger: () => void) => void; }) => Promise; //#endregion export { FacingMode as a, CameraCompositor as i, VideoSelfieDetectionStatus as n, VideoSelfieConfig as o, VideoSelfieValidationFailure as r, VideoSelfieStep as s, StepDetector as t };