import { A as StateMachine, C as StateValue, D as PromiseActorLogic, a as ActorRefFromLogic, b as RequiredActorOptions, c as AnyEventObject, d as DoneActorEvent, f as ErrorActorEvent, g as IsNotNever, h as InputFrom, i as ActorRefFrom, k as MachineSnapshot, m as GetConcreteByKey, o as AnyActorLogic, p as EventObject, r as ActorRef, s as AnyActorRef, t as ActionFunction, u as ConditionalRequired, v as MetaObject, w as Values, x as RequiredLogicInput, y as NonReducibleUnknown } from "./spawn-D9jgw9pW.js"; import "./StateMachine-EDpYWy0i.js"; import { t as Manager } from "./Manager-CQQ99QOI.js"; import "./Actor-iTq7YY48.js"; import { n as PermissionStatus, t as PermissionResult } from "./types-BEwVKkLJ.js"; import { a as DocumentCaptureErrorCode, c as DocumentType, i as DocumentCaptureContext, l as DocumentUploadResponse, o as DocumentCaptureInput, r as DocumentCaptureConfig, s as DocumentCaptureNextPageType, t as CapturedDocument, u as FinalizeDocumentResponse } from "./types-DelMqZLe.js"; //#region src/modules/document-capture/documentCaptureStateMachine.d.ts declare const documentCaptureMachine: StateMachine> | ActorRefFromLogic; processingType: string; onProgress: (progress: number) => void; }, EventObject>> | ActorRefFromLogic> | ActorRefFromLogic> | ActorRefFromLogic> | undefined; }, Values<{ uploadDocument: { src: "uploadDocument"; logic: PromiseActorLogic; processingType: string; onProgress: (progress: number) => void; }, EventObject>; id: string | undefined; }; initCamera: { src: "initCamera"; logic: PromiseActorLogic; id: string | undefined; }; requestPermission: { src: "requestPermission"; logic: PromiseActorLogic; id: string | undefined; }; checkPermission: { src: "checkPermission"; logic: PromiseActorLogic; id: string | undefined; }; finalizeDocumentRequest: { src: "finalizeDocumentRequest"; logic: PromiseActorLogic; id: string | undefined; }; }>, Values<{ decrementAttemptsRemaining: { type: "decrementAttemptsRemaining"; params: NonReducibleUnknown; }; setStream: { type: "setStream"; params: NonReducibleUnknown; }; setProgress: { type: "setProgress"; params: NonReducibleUnknown; }; clearError: { type: "clearError"; params: NonReducibleUnknown; }; stopStream: { type: "stopStream"; params: NonReducibleUnknown; }; setCapturedDocument: { type: "setCapturedDocument"; params: NonReducibleUnknown; }; setFileTooLargeError: { type: "setFileTooLargeError"; params: NonReducibleUnknown; }; setUploadError: { type: "setUploadError"; params: NonReducibleUnknown; }; setFinalizeError: { type: "setFinalizeError"; params: NonReducibleUnknown; }; setCaptureMethodFile: { type: "setCaptureMethodFile"; params: NonReducibleUnknown; }; setCaptureMethodCamera: { type: "setCaptureMethodCamera"; params: NonReducibleUnknown; }; setCaptureMethodGallery: { type: "setCaptureMethodGallery"; params: NonReducibleUnknown; }; clearCaptureMethod: { type: "clearCaptureMethod"; params: NonReducibleUnknown; }; openMethodSelection: { type: "openMethodSelection"; params: NonReducibleUnknown; }; closeMethodSelection: { type: "closeMethodSelection"; params: NonReducibleUnknown; }; openHelp: { type: "openHelp"; params: NonReducibleUnknown; }; closeHelp: { type: "closeHelp"; params: NonReducibleUnknown; }; clearCapturedDocument: { type: "clearCapturedDocument"; params: NonReducibleUnknown; }; resetPageNumber: { type: "resetPageNumber"; params: NonReducibleUnknown; }; clearCapturedDocumentGalleryRetake: { type: "clearCapturedDocumentGalleryRetake"; params: NonReducibleUnknown; }; setNextPageType: { type: "setNextPageType"; params: NonReducibleUnknown; }; clearForNextPage: { type: "clearForNextPage"; params: NonReducibleUnknown; }; resetProgress: { type: "resetProgress"; params: NonReducibleUnknown; }; }>, Values<{ allowSkip: { type: "allowSkip"; params: unknown; }; fileSizeOk: { type: "fileSizeOk"; params: unknown; }; canRetry: { type: "canRetry"; params: unknown; }; attemptsExhausted: { type: "attemptsExhausted"; params: unknown; }; allowsCameraCapture: { type: "allowsCameraCapture"; params: unknown; }; isCameraPermissionGranted: { type: "isCameraPermissionGranted"; params: unknown; }; isCameraPermissionDenied: { type: "isCameraPermissionDenied"; params: unknown; }; isCaptureMethodCamera: { type: "isCaptureMethodCamera"; params: unknown; }; isCaptureMethodGallery: { type: "isCaptureMethodGallery"; params: unknown; }; isCaptureMethodFile: { type: "isCaptureMethodFile"; params: unknown; }; isNextPageOptional: { type: "isNextPageOptional"; params: unknown; }; isNextPageRequired: { type: "isNextPageRequired"; params: unknown; }; canFinalizeOptionalPages: { type: "canFinalizeOptionalPages"; params: unknown; }; fileSizeOkForGallery: { type: "fileSizeOkForGallery"; params: unknown; }; fileSizeOkForNonGallery: { type: "fileSizeOkForNonGallery"; params: unknown; }; }>, never, "uploading" | "closed" | "success" | "finished" | "initCamera" | "capturing" | "tutorial" | "preview" | "failure" | "nextPage" | "finalizing" | { permissions: "idle" | "denied" | "waitingForUser" | "requesting" | "learnMore"; }, string, DocumentCaptureInput, NonReducibleUnknown, EventObject, MetaObject, { readonly id: "documentCapture"; readonly initial: "tutorial"; readonly context: ({ input }: { spawn: { (logic: TSrc, ...[options]: ({ src: "uploadDocument"; logic: PromiseActorLogic; processingType: string; onProgress: (progress: number) => void; }, EventObject>; id: string | undefined; } extends (infer T) ? T extends { src: "uploadDocument"; logic: PromiseActorLogic; processingType: string; onProgress: (progress: number) => void; }, EventObject>; id: string | undefined; } ? T extends { src: TSrc; } ? ConditionalRequired<[options?: ({ id?: T["id"] | undefined; systemId?: string; input?: InputFrom | undefined; syncSnapshot?: boolean; } & { [K in RequiredActorOptions]: unknown; }) | undefined], IsNotNever>> : never : never : never) | ({ src: "initCamera"; logic: PromiseActorLogic; id: string | undefined; } extends (infer T_1) ? T_1 extends { src: "initCamera"; logic: PromiseActorLogic; id: string | undefined; } ? T_1 extends { src: TSrc; } ? ConditionalRequired<[options?: ({ id?: T_1["id"] | undefined; systemId?: string; input?: InputFrom | undefined; syncSnapshot?: boolean; } & { [K_1 in RequiredActorOptions]: unknown; }) | undefined], IsNotNever>> : never : never : never) | ({ src: "requestPermission"; logic: PromiseActorLogic; id: string | undefined; } extends (infer T_2) ? T_2 extends { src: "requestPermission"; logic: PromiseActorLogic; id: string | undefined; } ? T_2 extends { src: TSrc; } ? ConditionalRequired<[options?: ({ id?: T_2["id"] | undefined; systemId?: string; input?: InputFrom | undefined; syncSnapshot?: boolean; } & { [K_2 in RequiredActorOptions]: unknown; }) | undefined], IsNotNever>> : never : never : never) | ({ src: "checkPermission"; logic: PromiseActorLogic; id: string | undefined; } extends (infer T_3) ? T_3 extends { src: "checkPermission"; logic: PromiseActorLogic; id: string | undefined; } ? T_3 extends { src: TSrc; } ? ConditionalRequired<[options?: ({ id?: T_3["id"] | undefined; systemId?: string; input?: InputFrom | undefined; syncSnapshot?: boolean; } & { [K_3 in RequiredActorOptions]: unknown; }) | undefined], IsNotNever>> : never : never : never) | ({ src: "finalizeDocumentRequest"; logic: PromiseActorLogic; id: string | undefined; } extends (infer T_4) ? T_4 extends { src: "finalizeDocumentRequest"; logic: PromiseActorLogic; id: string | undefined; } ? T_4 extends { src: TSrc; } ? ConditionalRequired<[options?: ({ id?: T_4["id"] | undefined; systemId?: string; input?: InputFrom | undefined; syncSnapshot?: boolean; } & { [K_4 in RequiredActorOptions]: unknown; }) | undefined], IsNotNever>> : never : never : never)): ActorRefFromLogic; processingType: string; onProgress: (progress: number) => void; }, EventObject>; id: string | undefined; }; initCamera: { src: "initCamera"; logic: PromiseActorLogic; id: string | undefined; }; requestPermission: { src: "requestPermission"; logic: PromiseActorLogic; id: string | undefined; }; checkPermission: { src: "checkPermission"; logic: PromiseActorLogic; id: string | undefined; }; finalizeDocumentRequest: { src: "finalizeDocumentRequest"; logic: PromiseActorLogic; id: string | undefined; }; }>, "src", TSrc>["logic"]>; (src: TLogic, ...[options]: ConditionalRequired<[options?: ({ id?: never; systemId?: string; input?: InputFrom | undefined; syncSnapshot?: boolean; } & { [K in RequiredLogicInput]: unknown; }) | undefined], IsNotNever>>): ActorRefFromLogic; }; input: DocumentCaptureInput; self: ActorRef, StateValue, string, unknown, any, any>, { type: "CAPTURE"; } | { type: "FILE_SELECTED"; file: File; imageBase64: string; fileType: string; } | { type: "ACCEPT"; } | { type: "RETAKE"; } | { type: "UPLOAD_PROGRESS"; progress: number; } | { type: "RETRY"; } | { type: "CONTINUE"; } | { type: "NEXT_PAGE_CAMERA"; } | { type: "NEXT_PAGE_PHOTO_LIBRARY"; } | { type: "ALL_PAGES_CAPTURED"; } | { type: "SKIP"; } | { type: "OPEN_METHOD_SELECTION"; } | { type: "CLOSE_METHOD_SELECTION"; } | { type: "SELECT_UPLOAD_METHOD"; } | { type: "DESELECT_UPLOAD_METHOD"; } | { type: "OPEN_HELP"; } | { type: "CLOSE_HELP"; } | { type: "REQUEST_PERMISSION"; } | { type: "GO_TO_LEARN_MORE"; } | { type: "BACK"; } | { type: "CLOSE"; }, AnyEventObject>; }) => { config: { processingType: DocumentType; onlyCapture: boolean; onlyUpload: boolean; allowSkipDocumentCapture: boolean; captureAttempts: number; sendBase64: boolean; maxFileSize: number; onlyPdf: boolean; title: string | undefined; text: string | undefined; step2Title: string | undefined; step2Text: string | undefined; }; stream: undefined; permissionResult: undefined; capturedDocument: undefined; captureMethod: undefined; methodSelectionOpen: false; helpOpen: false; progress: number; error: undefined; attemptsRemaining: number; pageNumber: number; nextPageType: "none"; }; readonly states: { readonly tutorial: { readonly on: { readonly OPEN_METHOD_SELECTION: { readonly actions: "openMethodSelection"; }; readonly CLOSE_METHOD_SELECTION: { readonly actions: readonly ["closeMethodSelection", "clearCaptureMethod"]; }; readonly SELECT_UPLOAD_METHOD: { readonly actions: "setCaptureMethodFile"; }; readonly DESELECT_UPLOAD_METHOD: { readonly actions: "clearCaptureMethod"; }; readonly CAPTURE: readonly [{ readonly target: "permissions"; readonly guard: "allowsCameraCapture"; readonly actions: readonly ["closeMethodSelection", "clearCaptureMethod"]; }, { readonly target: "capturing"; readonly actions: readonly ["closeMethodSelection", "clearCaptureMethod"]; }]; readonly FILE_SELECTED: readonly [{ readonly target: "preview"; readonly guard: "fileSizeOk"; readonly actions: readonly ["setCapturedDocument", "setCaptureMethodFile", "closeMethodSelection"]; }, { readonly target: "tutorial"; readonly actions: readonly ["setFileTooLargeError", "closeMethodSelection"]; }]; readonly SKIP: { readonly target: "finished"; readonly guard: "allowSkip"; }; readonly CLOSE: { readonly target: "closed"; }; }; }; readonly permissions: { readonly initial: "idle"; readonly states: { readonly idle: { readonly invoke: { readonly id: "checkPermissionIdle"; readonly src: "checkPermission"; readonly onDone: readonly [{ readonly target: "#documentCapture.initCamera"; readonly guard: "isCameraPermissionGranted"; readonly actions: ActionFunction, { type: "CAPTURE"; } | { type: "FILE_SELECTED"; file: File; imageBase64: string; fileType: string; } | { type: "ACCEPT"; } | { type: "RETAKE"; } | { type: "UPLOAD_PROGRESS"; progress: number; } | { type: "RETRY"; } | { type: "CONTINUE"; } | { type: "NEXT_PAGE_CAMERA"; } | { type: "NEXT_PAGE_PHOTO_LIBRARY"; } | { type: "ALL_PAGES_CAPTURED"; } | { type: "SKIP"; } | { type: "OPEN_METHOD_SELECTION"; } | { type: "CLOSE_METHOD_SELECTION"; } | { type: "SELECT_UPLOAD_METHOD"; } | { type: "DESELECT_UPLOAD_METHOD"; } | { type: "OPEN_HELP"; } | { type: "CLOSE_HELP"; } | { type: "REQUEST_PERMISSION"; } | { type: "GO_TO_LEARN_MORE"; } | { type: "BACK"; } | { type: "CLOSE"; }, undefined, Values<{ uploadDocument: { src: "uploadDocument"; logic: PromiseActorLogic; processingType: string; onProgress: (progress: number) => void; }, EventObject>; id: string | undefined; }; initCamera: { src: "initCamera"; logic: PromiseActorLogic; id: string | undefined; }; requestPermission: { src: "requestPermission"; logic: PromiseActorLogic; id: string | undefined; }; checkPermission: { src: "checkPermission"; logic: PromiseActorLogic; id: string | undefined; }; finalizeDocumentRequest: { src: "finalizeDocumentRequest"; logic: PromiseActorLogic; id: string | undefined; }; }>, never, never, never, never>; }, { readonly target: "denied"; readonly guard: "isCameraPermissionDenied"; readonly actions: ActionFunction, { type: "CAPTURE"; } | { type: "FILE_SELECTED"; file: File; imageBase64: string; fileType: string; } | { type: "ACCEPT"; } | { type: "RETAKE"; } | { type: "UPLOAD_PROGRESS"; progress: number; } | { type: "RETRY"; } | { type: "CONTINUE"; } | { type: "NEXT_PAGE_CAMERA"; } | { type: "NEXT_PAGE_PHOTO_LIBRARY"; } | { type: "ALL_PAGES_CAPTURED"; } | { type: "SKIP"; } | { type: "OPEN_METHOD_SELECTION"; } | { type: "CLOSE_METHOD_SELECTION"; } | { type: "SELECT_UPLOAD_METHOD"; } | { type: "DESELECT_UPLOAD_METHOD"; } | { type: "OPEN_HELP"; } | { type: "CLOSE_HELP"; } | { type: "REQUEST_PERMISSION"; } | { type: "GO_TO_LEARN_MORE"; } | { type: "BACK"; } | { type: "CLOSE"; }, undefined, Values<{ uploadDocument: { src: "uploadDocument"; logic: PromiseActorLogic; processingType: string; onProgress: (progress: number) => void; }, EventObject>; id: string | undefined; }; initCamera: { src: "initCamera"; logic: PromiseActorLogic; id: string | undefined; }; requestPermission: { src: "requestPermission"; logic: PromiseActorLogic; id: string | undefined; }; checkPermission: { src: "checkPermission"; logic: PromiseActorLogic; id: string | undefined; }; finalizeDocumentRequest: { src: "finalizeDocumentRequest"; logic: PromiseActorLogic; id: string | undefined; }; }>, never, never, never, never>; }, { readonly target: "waitingForUser"; readonly actions: ActionFunction, { type: "CAPTURE"; } | { type: "FILE_SELECTED"; file: File; imageBase64: string; fileType: string; } | { type: "ACCEPT"; } | { type: "RETAKE"; } | { type: "UPLOAD_PROGRESS"; progress: number; } | { type: "RETRY"; } | { type: "CONTINUE"; } | { type: "NEXT_PAGE_CAMERA"; } | { type: "NEXT_PAGE_PHOTO_LIBRARY"; } | { type: "ALL_PAGES_CAPTURED"; } | { type: "SKIP"; } | { type: "OPEN_METHOD_SELECTION"; } | { type: "CLOSE_METHOD_SELECTION"; } | { type: "SELECT_UPLOAD_METHOD"; } | { type: "DESELECT_UPLOAD_METHOD"; } | { type: "OPEN_HELP"; } | { type: "CLOSE_HELP"; } | { type: "REQUEST_PERMISSION"; } | { type: "GO_TO_LEARN_MORE"; } | { type: "BACK"; } | { type: "CLOSE"; }, undefined, Values<{ uploadDocument: { src: "uploadDocument"; logic: PromiseActorLogic; processingType: string; onProgress: (progress: number) => void; }, EventObject>; id: string | undefined; }; initCamera: { src: "initCamera"; logic: PromiseActorLogic; id: string | undefined; }; requestPermission: { src: "requestPermission"; logic: PromiseActorLogic; id: string | undefined; }; checkPermission: { src: "checkPermission"; logic: PromiseActorLogic; id: string | undefined; }; finalizeDocumentRequest: { src: "finalizeDocumentRequest"; logic: PromiseActorLogic; id: string | undefined; }; }>, never, never, never, never>; }]; readonly onError: { readonly target: "waitingForUser"; readonly actions: ActionFunction, { type: "CAPTURE"; } | { type: "FILE_SELECTED"; file: File; imageBase64: string; fileType: string; } | { type: "ACCEPT"; } | { type: "RETAKE"; } | { type: "UPLOAD_PROGRESS"; progress: number; } | { type: "RETRY"; } | { type: "CONTINUE"; } | { type: "NEXT_PAGE_CAMERA"; } | { type: "NEXT_PAGE_PHOTO_LIBRARY"; } | { type: "ALL_PAGES_CAPTURED"; } | { type: "SKIP"; } | { type: "OPEN_METHOD_SELECTION"; } | { type: "CLOSE_METHOD_SELECTION"; } | { type: "SELECT_UPLOAD_METHOD"; } | { type: "DESELECT_UPLOAD_METHOD"; } | { type: "OPEN_HELP"; } | { type: "CLOSE_HELP"; } | { type: "REQUEST_PERMISSION"; } | { type: "GO_TO_LEARN_MORE"; } | { type: "BACK"; } | { type: "CLOSE"; }, undefined, Values<{ uploadDocument: { src: "uploadDocument"; logic: PromiseActorLogic; processingType: string; onProgress: (progress: number) => void; }, EventObject>; id: string | undefined; }; initCamera: { src: "initCamera"; logic: PromiseActorLogic; id: string | undefined; }; requestPermission: { src: "requestPermission"; logic: PromiseActorLogic; id: string | undefined; }; checkPermission: { src: "checkPermission"; logic: PromiseActorLogic; id: string | undefined; }; finalizeDocumentRequest: { src: "finalizeDocumentRequest"; logic: PromiseActorLogic; id: string | undefined; }; }>, never, never, never, never>; }; }; readonly on: { readonly REQUEST_PERMISSION: "requesting"; readonly GO_TO_LEARN_MORE: "learnMore"; }; }; readonly waitingForUser: { readonly on: { readonly REQUEST_PERMISSION: "requesting"; readonly GO_TO_LEARN_MORE: "learnMore"; }; }; readonly learnMore: { readonly on: { readonly BACK: "idle"; readonly REQUEST_PERMISSION: "requesting"; }; }; readonly requesting: { readonly invoke: { readonly id: "requestPermission"; readonly src: "requestPermission"; readonly input: ({ context }: { context: DocumentCaptureContext; event: { type: "CAPTURE"; } | { type: "FILE_SELECTED"; file: File; imageBase64: string; fileType: string; } | { type: "ACCEPT"; } | { type: "RETAKE"; } | { type: "UPLOAD_PROGRESS"; progress: number; } | { type: "RETRY"; } | { type: "CONTINUE"; } | { type: "NEXT_PAGE_CAMERA"; } | { type: "NEXT_PAGE_PHOTO_LIBRARY"; } | { type: "ALL_PAGES_CAPTURED"; } | { type: "SKIP"; } | { type: "OPEN_METHOD_SELECTION"; } | { type: "CLOSE_METHOD_SELECTION"; } | { type: "SELECT_UPLOAD_METHOD"; } | { type: "DESELECT_UPLOAD_METHOD"; } | { type: "OPEN_HELP"; } | { type: "CLOSE_HELP"; } | { type: "REQUEST_PERMISSION"; } | { type: "GO_TO_LEARN_MORE"; } | { type: "BACK"; } | { type: "CLOSE"; }; self: ActorRef, StateValue, string, unknown, any, any>, { type: "CAPTURE"; } | { type: "FILE_SELECTED"; file: File; imageBase64: string; fileType: string; } | { type: "ACCEPT"; } | { type: "RETAKE"; } | { type: "UPLOAD_PROGRESS"; progress: number; } | { type: "RETRY"; } | { type: "CONTINUE"; } | { type: "NEXT_PAGE_CAMERA"; } | { type: "NEXT_PAGE_PHOTO_LIBRARY"; } | { type: "ALL_PAGES_CAPTURED"; } | { type: "SKIP"; } | { type: "OPEN_METHOD_SELECTION"; } | { type: "CLOSE_METHOD_SELECTION"; } | { type: "SELECT_UPLOAD_METHOD"; } | { type: "DESELECT_UPLOAD_METHOD"; } | { type: "OPEN_HELP"; } | { type: "CLOSE_HELP"; } | { type: "REQUEST_PERMISSION"; } | { type: "GO_TO_LEARN_MORE"; } | { type: "BACK"; } | { type: "CLOSE"; }, AnyEventObject>; }) => { permissionResult: PermissionResult | undefined; requestMotionPermission: false; }; readonly onDone: readonly [{ readonly target: "#documentCapture.initCamera"; readonly guard: "isCameraPermissionGranted"; readonly actions: ActionFunction, { type: "CAPTURE"; } | { type: "FILE_SELECTED"; file: File; imageBase64: string; fileType: string; } | { type: "ACCEPT"; } | { type: "RETAKE"; } | { type: "UPLOAD_PROGRESS"; progress: number; } | { type: "RETRY"; } | { type: "CONTINUE"; } | { type: "NEXT_PAGE_CAMERA"; } | { type: "NEXT_PAGE_PHOTO_LIBRARY"; } | { type: "ALL_PAGES_CAPTURED"; } | { type: "SKIP"; } | { type: "OPEN_METHOD_SELECTION"; } | { type: "CLOSE_METHOD_SELECTION"; } | { type: "SELECT_UPLOAD_METHOD"; } | { type: "DESELECT_UPLOAD_METHOD"; } | { type: "OPEN_HELP"; } | { type: "CLOSE_HELP"; } | { type: "REQUEST_PERMISSION"; } | { type: "GO_TO_LEARN_MORE"; } | { type: "BACK"; } | { type: "CLOSE"; }, undefined, Values<{ uploadDocument: { src: "uploadDocument"; logic: PromiseActorLogic; processingType: string; onProgress: (progress: number) => void; }, EventObject>; id: string | undefined; }; initCamera: { src: "initCamera"; logic: PromiseActorLogic; id: string | undefined; }; requestPermission: { src: "requestPermission"; logic: PromiseActorLogic; id: string | undefined; }; checkPermission: { src: "checkPermission"; logic: PromiseActorLogic; id: string | undefined; }; finalizeDocumentRequest: { src: "finalizeDocumentRequest"; logic: PromiseActorLogic; id: string | undefined; }; }>, never, never, never, never>; }, { readonly target: "denied"; readonly guard: "isCameraPermissionDenied"; readonly actions: ActionFunction, { type: "CAPTURE"; } | { type: "FILE_SELECTED"; file: File; imageBase64: string; fileType: string; } | { type: "ACCEPT"; } | { type: "RETAKE"; } | { type: "UPLOAD_PROGRESS"; progress: number; } | { type: "RETRY"; } | { type: "CONTINUE"; } | { type: "NEXT_PAGE_CAMERA"; } | { type: "NEXT_PAGE_PHOTO_LIBRARY"; } | { type: "ALL_PAGES_CAPTURED"; } | { type: "SKIP"; } | { type: "OPEN_METHOD_SELECTION"; } | { type: "CLOSE_METHOD_SELECTION"; } | { type: "SELECT_UPLOAD_METHOD"; } | { type: "DESELECT_UPLOAD_METHOD"; } | { type: "OPEN_HELP"; } | { type: "CLOSE_HELP"; } | { type: "REQUEST_PERMISSION"; } | { type: "GO_TO_LEARN_MORE"; } | { type: "BACK"; } | { type: "CLOSE"; }, undefined, Values<{ uploadDocument: { src: "uploadDocument"; logic: PromiseActorLogic; processingType: string; onProgress: (progress: number) => void; }, EventObject>; id: string | undefined; }; initCamera: { src: "initCamera"; logic: PromiseActorLogic; id: string | undefined; }; requestPermission: { src: "requestPermission"; logic: PromiseActorLogic; id: string | undefined; }; checkPermission: { src: "checkPermission"; logic: PromiseActorLogic; id: string | undefined; }; finalizeDocumentRequest: { src: "finalizeDocumentRequest"; logic: PromiseActorLogic; id: string | undefined; }; }>, never, never, never, never>; }, { readonly target: "waitingForUser"; readonly actions: ActionFunction, { type: "CAPTURE"; } | { type: "FILE_SELECTED"; file: File; imageBase64: string; fileType: string; } | { type: "ACCEPT"; } | { type: "RETAKE"; } | { type: "UPLOAD_PROGRESS"; progress: number; } | { type: "RETRY"; } | { type: "CONTINUE"; } | { type: "NEXT_PAGE_CAMERA"; } | { type: "NEXT_PAGE_PHOTO_LIBRARY"; } | { type: "ALL_PAGES_CAPTURED"; } | { type: "SKIP"; } | { type: "OPEN_METHOD_SELECTION"; } | { type: "CLOSE_METHOD_SELECTION"; } | { type: "SELECT_UPLOAD_METHOD"; } | { type: "DESELECT_UPLOAD_METHOD"; } | { type: "OPEN_HELP"; } | { type: "CLOSE_HELP"; } | { type: "REQUEST_PERMISSION"; } | { type: "GO_TO_LEARN_MORE"; } | { type: "BACK"; } | { type: "CLOSE"; }, undefined, Values<{ uploadDocument: { src: "uploadDocument"; logic: PromiseActorLogic; processingType: string; onProgress: (progress: number) => void; }, EventObject>; id: string | undefined; }; initCamera: { src: "initCamera"; logic: PromiseActorLogic; id: string | undefined; }; requestPermission: { src: "requestPermission"; logic: PromiseActorLogic; id: string | undefined; }; checkPermission: { src: "checkPermission"; logic: PromiseActorLogic; id: string | undefined; }; finalizeDocumentRequest: { src: "finalizeDocumentRequest"; logic: PromiseActorLogic; id: string | undefined; }; }>, never, never, never, never>; }]; readonly onError: { readonly target: "denied"; }; }; }; readonly denied: { readonly entry: ActionFunction; processingType: string; onProgress: (progress: number) => void; }, EventObject>; id: string | undefined; }; initCamera: { src: "initCamera"; logic: PromiseActorLogic; id: string | undefined; }; requestPermission: { src: "requestPermission"; logic: PromiseActorLogic; id: string | undefined; }; checkPermission: { src: "checkPermission"; logic: PromiseActorLogic; id: string | undefined; }; finalizeDocumentRequest: { src: "finalizeDocumentRequest"; logic: PromiseActorLogic; id: string | undefined; }; }>, never, never, never, never>; }; }; readonly on: { readonly CLOSE: { readonly target: "closed"; }; }; }; readonly initCamera: { readonly invoke: { readonly id: "initCamera"; readonly src: "initCamera"; readonly input: undefined; readonly onDone: { readonly target: "capturing"; readonly actions: "setStream"; }; readonly onError: { readonly target: "failure"; readonly actions: "setUploadError"; }; }; readonly on: { readonly CLOSE: { readonly target: "closed"; }; }; }; readonly capturing: { readonly on: { readonly OPEN_HELP: { readonly actions: "openHelp"; }; readonly CLOSE_HELP: { readonly actions: "closeHelp"; }; readonly FILE_SELECTED: readonly [{ readonly target: "preview"; readonly guard: "fileSizeOkForGallery"; readonly actions: readonly ["setCapturedDocument", "closeHelp"]; }, { readonly target: "preview"; readonly guard: "fileSizeOkForNonGallery"; readonly actions: readonly ["setCapturedDocument", "setCaptureMethodCamera", "closeHelp"]; }, { readonly target: "capturing"; readonly actions: "setFileTooLargeError"; }]; readonly CLOSE: { readonly target: "closed"; readonly actions: "stopStream"; }; }; }; readonly preview: { readonly on: { readonly ACCEPT: { readonly target: "uploading"; readonly actions: "resetProgress"; }; readonly RETAKE: readonly [{ readonly target: "tutorial"; readonly guard: "isCaptureMethodFile"; readonly actions: "clearCapturedDocument"; }, { readonly target: "capturing"; readonly guard: "isCaptureMethodGallery"; readonly actions: "clearCapturedDocumentGalleryRetake"; }, { readonly target: "capturing"; readonly actions: "clearCapturedDocument"; }]; readonly CLOSE: { readonly target: "closed"; readonly actions: "stopStream"; }; }; }; readonly uploading: { readonly invoke: { readonly id: "uploadDocument"; readonly src: "uploadDocument"; readonly input: ({ context, self }: { context: DocumentCaptureContext; event: { type: "CAPTURE"; } | { type: "FILE_SELECTED"; file: File; imageBase64: string; fileType: string; } | { type: "ACCEPT"; } | { type: "RETAKE"; } | { type: "UPLOAD_PROGRESS"; progress: number; } | { type: "RETRY"; } | { type: "CONTINUE"; } | { type: "NEXT_PAGE_CAMERA"; } | { type: "NEXT_PAGE_PHOTO_LIBRARY"; } | { type: "ALL_PAGES_CAPTURED"; } | { type: "SKIP"; } | { type: "OPEN_METHOD_SELECTION"; } | { type: "CLOSE_METHOD_SELECTION"; } | { type: "SELECT_UPLOAD_METHOD"; } | { type: "DESELECT_UPLOAD_METHOD"; } | { type: "OPEN_HELP"; } | { type: "CLOSE_HELP"; } | { type: "REQUEST_PERMISSION"; } | { type: "GO_TO_LEARN_MORE"; } | { type: "BACK"; } | { type: "CLOSE"; }; self: ActorRef, StateValue, string, unknown, any, any>, { type: "CAPTURE"; } | { type: "FILE_SELECTED"; file: File; imageBase64: string; fileType: string; } | { type: "ACCEPT"; } | { type: "RETAKE"; } | { type: "UPLOAD_PROGRESS"; progress: number; } | { type: "RETRY"; } | { type: "CONTINUE"; } | { type: "NEXT_PAGE_CAMERA"; } | { type: "NEXT_PAGE_PHOTO_LIBRARY"; } | { type: "ALL_PAGES_CAPTURED"; } | { type: "SKIP"; } | { type: "OPEN_METHOD_SELECTION"; } | { type: "CLOSE_METHOD_SELECTION"; } | { type: "SELECT_UPLOAD_METHOD"; } | { type: "DESELECT_UPLOAD_METHOD"; } | { type: "OPEN_HELP"; } | { type: "CLOSE_HELP"; } | { type: "REQUEST_PERMISSION"; } | { type: "GO_TO_LEARN_MORE"; } | { type: "BACK"; } | { type: "CLOSE"; }, AnyEventObject>; }) => { capturedDocument: CapturedDocument; processingType: DocumentType; onProgress: (progress: number) => void; }; readonly onDone: { readonly target: "success"; readonly actions: readonly ["setNextPageType", "stopStream"]; }; readonly onError: { readonly target: "failure"; readonly actions: readonly ["setUploadError", "decrementAttemptsRemaining", "stopStream"]; }; }; readonly on: { readonly UPLOAD_PROGRESS: { readonly actions: "setProgress"; }; }; }; readonly success: { readonly on: { readonly CONTINUE: readonly [{ readonly target: "nextPage"; readonly guard: "isNextPageOptional"; }, { readonly target: "nextPage"; readonly guard: "isNextPageRequired"; }, { readonly target: "finished"; }]; readonly CLOSE: { readonly target: "closed"; }; }; }; readonly nextPage: { readonly on: { readonly NEXT_PAGE_CAMERA: { readonly target: "permissions"; readonly actions: readonly ["clearForNextPage", "setCaptureMethodCamera"]; }; readonly NEXT_PAGE_PHOTO_LIBRARY: { readonly target: "capturing"; readonly actions: readonly ["clearForNextPage", "setCaptureMethodGallery"]; }; readonly ALL_PAGES_CAPTURED: readonly [{ readonly target: "finalizing"; readonly guard: "canFinalizeOptionalPages"; }, { readonly target: "finished"; }]; readonly CLOSE: { readonly target: "closed"; }; }; }; readonly finalizing: { readonly invoke: { readonly id: "finalizeDocument"; readonly src: "finalizeDocumentRequest"; readonly input: ({ context }: { context: DocumentCaptureContext; event: { type: "CAPTURE"; } | { type: "FILE_SELECTED"; file: File; imageBase64: string; fileType: string; } | { type: "ACCEPT"; } | { type: "RETAKE"; } | { type: "UPLOAD_PROGRESS"; progress: number; } | { type: "RETRY"; } | { type: "CONTINUE"; } | { type: "NEXT_PAGE_CAMERA"; } | { type: "NEXT_PAGE_PHOTO_LIBRARY"; } | { type: "ALL_PAGES_CAPTURED"; } | { type: "SKIP"; } | { type: "OPEN_METHOD_SELECTION"; } | { type: "CLOSE_METHOD_SELECTION"; } | { type: "SELECT_UPLOAD_METHOD"; } | { type: "DESELECT_UPLOAD_METHOD"; } | { type: "OPEN_HELP"; } | { type: "CLOSE_HELP"; } | { type: "REQUEST_PERMISSION"; } | { type: "GO_TO_LEARN_MORE"; } | { type: "BACK"; } | { type: "CLOSE"; }; self: ActorRef, StateValue, string, unknown, any, any>, { type: "CAPTURE"; } | { type: "FILE_SELECTED"; file: File; imageBase64: string; fileType: string; } | { type: "ACCEPT"; } | { type: "RETAKE"; } | { type: "UPLOAD_PROGRESS"; progress: number; } | { type: "RETRY"; } | { type: "CONTINUE"; } | { type: "NEXT_PAGE_CAMERA"; } | { type: "NEXT_PAGE_PHOTO_LIBRARY"; } | { type: "ALL_PAGES_CAPTURED"; } | { type: "SKIP"; } | { type: "OPEN_METHOD_SELECTION"; } | { type: "CLOSE_METHOD_SELECTION"; } | { type: "SELECT_UPLOAD_METHOD"; } | { type: "DESELECT_UPLOAD_METHOD"; } | { type: "OPEN_HELP"; } | { type: "CLOSE_HELP"; } | { type: "REQUEST_PERMISSION"; } | { type: "GO_TO_LEARN_MORE"; } | { type: "BACK"; } | { type: "CLOSE"; }, AnyEventObject>; }) => { processingType: DocumentType; }; readonly onDone: { readonly target: "finished"; }; readonly onError: { readonly target: "failure"; readonly actions: readonly ["setFinalizeError", "decrementAttemptsRemaining"]; }; }; }; readonly failure: { readonly on: { readonly RETRY: { readonly target: "tutorial"; readonly guard: "canRetry"; readonly actions: readonly ["clearError", "clearCapturedDocument", "resetPageNumber"]; }; readonly CONTINUE: { readonly target: "finished"; readonly guard: "attemptsExhausted"; }; readonly CLOSE: { readonly target: "closed"; }; }; }; readonly finished: { readonly type: "final"; }; readonly closed: { readonly type: "final"; }; }; }>; type DocumentCaptureMachine = typeof documentCaptureMachine; //#endregion //#region src/modules/document-capture/documentCaptureActor.d.ts type CreateDocumentCaptureActorOptions = { config: DocumentCaptureConfig; }; type DocumentCaptureActor = ActorRefFrom; //#endregion //#region src/modules/document-capture/documentCaptureManager.d.ts type DocumentCaptureTutorialState = { status: 'tutorial'; title: string | undefined; text: string | undefined; allowSkipDocumentCapture: boolean; onlyCapture: boolean; onlyUpload: boolean; methodSelectionOpen: boolean; onlyPdf: boolean; error: DocumentCaptureErrorCode | undefined; pageNumber: number; }; type DocumentCapturePermissionsState = { status: 'permissions'; permissionStatus: PermissionStatus; }; type DocumentCaptureInitializingCameraState = { status: 'initializingCamera'; }; type DocumentCaptureCapturingState = { status: 'capturing'; stream: MediaStream | undefined; onlyCapture: boolean; onlyUpload: boolean; captureMethod: 'camera' | 'file' | 'gallery' | undefined; helpOpen: boolean; onlyPdf: boolean; error: DocumentCaptureErrorCode | undefined; pageNumber: number; }; type DocumentCapturePreviewState = { status: 'preview'; imageBase64: string; fileType: string; fileName: string; }; type DocumentCaptureUploadingState = { status: 'uploading'; progress: number; imageBase64: string; fileType: string; fileName: string; }; type DocumentCaptureSuccessState = { status: 'success'; imageBase64: string; fileType: string; fileName: string; nextPageType: DocumentCaptureNextPageType; }; type DocumentCaptureFailureState = { status: 'failure'; error: DocumentCaptureErrorCode; attemptsRemaining: number; }; type DocumentCaptureFinishedState = { status: 'finished'; }; type DocumentCaptureClosedState = { status: 'closed'; }; type DocumentCaptureNextPageState = { status: 'nextPage'; imageBase64: string; fileType: string; fileName: string; pageNumber: number; nextPageType: Exclude; onlyCapture: boolean; onlyUpload: boolean; onlyPdf: boolean; }; /** Confirming optional multi-page capture with the backend (short-lived). */ type DocumentCaptureFinalizingState = { status: 'finalizing'; }; type DocumentCaptureState = DocumentCaptureTutorialState | DocumentCapturePermissionsState | DocumentCaptureInitializingCameraState | DocumentCaptureCapturingState | DocumentCapturePreviewState | DocumentCaptureUploadingState | DocumentCaptureSuccessState | DocumentCaptureFailureState | DocumentCaptureFinishedState | DocumentCaptureClosedState | DocumentCaptureNextPageState | DocumentCaptureFinalizingState; declare function createDocumentCaptureManager(options: CreateDocumentCaptureActorOptions): Manager & { capture(): void; setFile(file: File, imageBase64: string): void; accept(): void; retake(): void; retry(): void; continue(): void; skip(): void; openMethodSelection(): void; closeMethodSelection(): void; selectUploadMethod(): void; deselectUploadMethod(): void; openHelp(): void; closeHelp(): void; close(): void; requestPermission(): void; goToLearnMore(): void; back(): void; captureNextPageFromCamera(): void; captureNextPageFromFile(): void; finishPageCapture(): void; }; /** * Creates a document-capture manager from a pre-built actor. * Use this when overriding the machine via `.provide()` for custom backends * or for story-isolation testing. */ declare function createDocumentCaptureManagerFromActor(actor: DocumentCaptureActor): Manager & { capture(): void; setFile(file: File, imageBase64: string): void; accept(): void; retake(): void; retry(): void; continue(): void; skip(): void; openMethodSelection(): void; closeMethodSelection(): void; selectUploadMethod(): void; deselectUploadMethod(): void; openHelp(): void; closeHelp(): void; close(): void; requestPermission(): void; goToLearnMore(): void; back(): void; captureNextPageFromCamera(): void; captureNextPageFromFile(): void; finishPageCapture(): void; }; type DocumentCaptureManager = ReturnType; //#endregion export { DocumentCaptureActor as a, createDocumentCaptureManagerFromActor as i, DocumentCaptureState as n, documentCaptureMachine as o, createDocumentCaptureManager as r, DocumentCaptureManager as t };