import { Environment } from '../../../../../core/src/infrastructure/shared';
import { DomainError } from '../../../../../core/src/errors/index.ts';
/**
 * Props for the usePrescriptionSigning hook
 */
export type UsePrescriptionSigningProps = {
    /**
     * Environment configuration for the prescription service
     * - 'local': Development environment (localhost:52247)
     * - 'dev': Development Azure Container Apps
     * - 'int': Integration Azure Container Apps
     * - 'prod': Production Azure Container Apps
     */
    environment: Environment;
    /** Access token for authenticating with the backend service */
    accessToken: string;
    /**
     * Optional existing session token to reuse authentication state.
     * If provided, the hook will attempt to use existing authentication.
     */
    sessionToken?: string;
    /**
     * Optional callback invoked when the session token is updated.
     * Use this to persist the session token for reuse across hook instances.
     */
    onSessionTokenUpdate?: (token: string) => void;
    /**
     * Optional callback invoked when prescription signing succeeds.
     * Receives the signed CHMED data as a base64-encoded string.
     * Optionally receives the generatedPdf if the option
     * shouldGeneratePdf is set to true.
     *
     * @see shouldGeneratePdf
     */
    onSuccess?: (signedCHMED: string, generatedPdf?: string) => void;
    /**
     * Optional callback invoked when prescription signing fails.
     * Receives a specific error type indicating what went wrong.
     */
    onError?: (error: DomainError) => void;
    /**
     * Flag to generate PDF after signing.
     */
    shouldGeneratePdf: boolean;
};
/**
 * Hook to manage the ePrescription signature process
 *
 * This is a standalone hook that can be shipped in a library.
 * It handles the complete HIN authentication and signing flow.
 *
 * Required peer dependencies:
 * - next-auth/react (for session management)
 * - xstate and @xstate/react
 *
 * @returns Object containing:
 * - start: Function to initiate the signing process with CHMED data
 * - interrupt: Function to terminate the signing process at any time
 * - state: Raw XState machine state (for advanced usage)
 * - isIdle: true when ready to start signing (initial state)
 * - isActive: true when actively processing (excludes error/success states)
 * - isError: true when in error state (persists until retry)
 * - isSuccess: true when signing completed successfully
 * - isSigning: true during the actual signature operation
 * - signedCHMED: The signed prescription data (available after success)
 */
export declare function usePrescriptionSign(props: UsePrescriptionSigningProps): {
    start: (encodedCHMED: string, shouldGeneratePdf: boolean) => void;
    interrupt: () => void;
    state: import('xstate').MachineSnapshot<import('../../core').PrescriptionSignContext, {
        type: "OPEN_POPUP";
        popupRef: Window | null;
    } | {
        type: "CLOSE_POPUP";
    } | {
        type: "START";
        encodedCHMED: string;
        shouldGeneratePdf: boolean;
    } | {
        type: "TERMINATE";
    } | {
        type: "VERIFY_SESSION";
    } | {
        type: "REFRESH_TOKEN";
    } | {
        type: "GET_TOKEN";
    } | {
        type: "GET_SAML_AUTH_CODE";
        recoverable?: boolean;
        sessionToken: string;
    } | {
        type: "GET_SAML_AUTH_HANDLE";
        authCode: string;
    } | {
        type: "VALIDATE_CHMED";
        sessionToken: string;
    } | {
        type: "xstate.done.actor.getSAMLAuthHandle";
        sessionToken: string;
        recoverable?: boolean;
    } | {
        type: "SIGN_PRESCRIPTION";
        sessionToken: string;
        recoverable?: boolean;
    } | {
        type: "AUTHENTICATION_SUCCESS";
    } | {
        type: "ERROR";
        error: DomainError;
    } | {
        type: "UNAUTHORIZED_TOKEN";
    } | {
        type: "UNAUTHORIZED_HANDLE";
    }, {
        [x: string]: import('xstate').ActorRefFromLogic<import('xstate').CallbackActorLogic<import('xstate').AnyEventObject, {
            sessionToken?: string;
            hinClient: import('../../core/integration/hin').HINClient;
        }, import('xstate').EventObject>> | import('xstate').ActorRefFromLogic<import('xstate').CallbackActorLogic<import('xstate').AnyEventObject, {
            popupRef: Window | null;
        }, import('xstate').EventObject>> | import('xstate').ActorRefFromLogic<import('xstate').CallbackActorLogic<import('xstate').AnyEventObject, {
            hinClient: import('../../core/integration/hin').HINClient;
            accessToken: string;
        }, import('xstate').EventObject>> | import('xstate').ActorRefFromLogic<import('xstate').CallbackActorLogic<import('xstate').AnyEventObject, {
            hinClient: import('../../core/integration/hin').HINClient;
        }, import('xstate').EventObject>> | import('xstate').ActorRefFromLogic<import('xstate').PromiseActorLogic<void, {
            encodedCHMED?: string;
            parent: import('xstate').ActorRef<import('xstate').AnyMachineSnapshot, import('../../core').PrescriptionSignEvents>;
            hinClient: import('../../core/integration/hin').HINClient;
            sessionToken?: string;
        }, import('xstate').EventObject>> | import('xstate').ActorRefFromLogic<import('xstate').PromiseActorLogic<void, {
            parent: import('xstate').ActorRef<import('xstate').AnyMachineSnapshot, import('../../core').PrescriptionSignEvents>;
            hinClient: import('../../core/integration/hin').HINClient;
            sessionToken?: string;
        }, import('xstate').EventObject>> | import('xstate').ActorRefFromLogic<import('xstate').PromiseActorLogic<void, {
            parent: import('xstate').ActorRef<import('xstate').AnyMachineSnapshot, import('../../core').PrescriptionSignEvents>;
            popupRef: Window | null;
            hinClient: import('../../core/integration/hin').HINClient;
        }, import('xstate').EventObject>> | import('xstate').ActorRefFromLogic<import('xstate').CallbackActorLogic<import('xstate').AnyEventObject, {
            hinClient: import('../../core/integration/hin').HINClient;
            sessionToken?: string;
        }, import('xstate').EventObject>> | import('xstate').ActorRefFromLogic<import('xstate').PromiseActorLogic<{
            sessionToken: string;
        }, {
            hinClient: import('../../core/integration/hin').HINClient;
            sessionToken?: string;
        }, import('xstate').EventObject>> | import('xstate').ActorRefFromLogic<import('xstate').PromiseActorLogic<void, {
            parent: import('xstate').ActorRef<import('xstate').AnyMachineSnapshot, import('../../core').PrescriptionSignEvents>;
            popupRef: Window | null;
            hinClient: import('../../core/integration/hin').HINClient;
            recover: boolean;
            sessionToken?: string;
        }, import('xstate').EventObject>> | import('xstate').ActorRefFromLogic<import('xstate').CallbackActorLogic<import('xstate').AnyEventObject, {
            hinClient: import('../../core/integration/hin').HINClient;
        }, import('xstate').EventObject>> | import('xstate').ActorRefFromLogic<import('xstate').PromiseActorLogic<{
            sessionToken: string;
        }, {
            parent: import('xstate').ActorRef<import('xstate').AnyMachineSnapshot, import('../../core').PrescriptionSignEvents>;
            authCode: string;
            hinClient: import('../../core/integration/hin').HINClient;
            sessionToken?: string;
        }, import('xstate').EventObject>> | import('xstate').ActorRefFromLogic<import('xstate').PromiseActorLogic<{
            signedPrescription: string;
            generatedPdf?: string;
        }, {
            encodedCHMED?: string;
            shouldGeneratePdf: boolean;
            parent: import('xstate').ActorRef<import('xstate').AnyMachineSnapshot, import('../../core').PrescriptionSignEvents>;
            hinClient: import('../../core/integration/hin').HINClient;
            sessionToken?: string;
            recover: boolean;
        }, import('xstate').EventObject>> | import('xstate').ActorRefFromLogic<import('xstate').CallbackActorLogic<import('xstate').AnyEventObject, {
            error: DomainError;
        }, import('xstate').EventObject>> | import('xstate').ActorRefFromLogic<import('xstate').CallbackActorLogic<import('xstate').AnyEventObject, {
            signedCHMED?: string;
            generatedPdf?: string;
        }, import('xstate').EventObject>> | undefined;
    }, "Idle" | {
        Started: {
            Popup: "Opening" | "Open" | "Closed";
            Signing: "Authentication" | "SAMLAuth" | "Error" | "End" | "ValidatingCHMED" | "VerifySessionGuard" | "SigningCHMED" | "SAMLAuthCode" | "TokenRefreshing" | "OAuth" | "SAMLAuthHandle" | "Success";
        };
    }, string, import('xstate').NonReducibleUnknown, import('xstate').MetaObject, {
        readonly context: ({ input }: {
            spawn: {
                <TSrc extends "openPopup" | "trackPopup" | "listenAuthenticationMessage" | "listenSamlAuthMessage" | "validateCHMED" | "verifySession" | "initOAuth" | "listenOAuthMessage" | "refreshToken" | "initSAMLAuthCode" | "listenSAMLAuthCodeMessage" | "getSAMLAuthHandle" | "signCHMEDRx" | "errorHandler" | "successHandler">(logic: TSrc, ...[options]: ({
                    src: "openPopup";
                    logic: import('xstate').CallbackActorLogic<import('xstate').AnyEventObject, {
                        sessionToken?: string;
                        hinClient: import('../../core/integration/hin').HINClient;
                    }, import('xstate').EventObject>;
                    id: string | undefined;
                } extends infer T ? T extends {
                    src: "openPopup";
                    logic: import('xstate').CallbackActorLogic<import('xstate').AnyEventObject, {
                        sessionToken?: string;
                        hinClient: import('../../core/integration/hin').HINClient;
                    }, import('xstate').EventObject>;
                    id: string | undefined;
                } ? T extends {
                    src: TSrc;
                } ? import('xstate').ConditionalRequired<[options?: ({
                    id?: T["id"] | undefined;
                    systemId?: string;
                    input?: import('xstate').InputFrom<T["logic"]> | undefined;
                    syncSnapshot?: boolean;
                } & { [K in import('xstate').RequiredActorOptions<T>]: unknown; }) | undefined], import('xstate').IsNotNever<import('xstate').RequiredActorOptions<T>>> : never : never : never) | ({
                    src: "trackPopup";
                    logic: import('xstate').CallbackActorLogic<import('xstate').AnyEventObject, {
                        popupRef: Window | null;
                    }, import('xstate').EventObject>;
                    id: string | undefined;
                } extends infer T_1 ? T_1 extends {
                    src: "trackPopup";
                    logic: import('xstate').CallbackActorLogic<import('xstate').AnyEventObject, {
                        popupRef: Window | null;
                    }, import('xstate').EventObject>;
                    id: string | undefined;
                } ? T_1 extends {
                    src: TSrc;
                } ? import('xstate').ConditionalRequired<[options?: ({
                    id?: T_1["id"] | undefined;
                    systemId?: string;
                    input?: import('xstate').InputFrom<T_1["logic"]> | undefined;
                    syncSnapshot?: boolean;
                } & { [K_1 in import('xstate').RequiredActorOptions<T_1>]: unknown; }) | undefined], import('xstate').IsNotNever<import('xstate').RequiredActorOptions<T_1>>> : never : never : never) | ({
                    src: "listenAuthenticationMessage";
                    logic: import('xstate').CallbackActorLogic<import('xstate').AnyEventObject, {
                        hinClient: import('../../core/integration/hin').HINClient;
                        accessToken: string;
                    }, import('xstate').EventObject>;
                    id: string | undefined;
                } extends infer T_2 ? T_2 extends {
                    src: "listenAuthenticationMessage";
                    logic: import('xstate').CallbackActorLogic<import('xstate').AnyEventObject, {
                        hinClient: import('../../core/integration/hin').HINClient;
                        accessToken: string;
                    }, import('xstate').EventObject>;
                    id: string | undefined;
                } ? T_2 extends {
                    src: TSrc;
                } ? import('xstate').ConditionalRequired<[options?: ({
                    id?: T_2["id"] | undefined;
                    systemId?: string;
                    input?: import('xstate').InputFrom<T_2["logic"]> | undefined;
                    syncSnapshot?: boolean;
                } & { [K_2 in import('xstate').RequiredActorOptions<T_2>]: unknown; }) | undefined], import('xstate').IsNotNever<import('xstate').RequiredActorOptions<T_2>>> : never : never : never) | ({
                    src: "listenSamlAuthMessage";
                    logic: import('xstate').CallbackActorLogic<import('xstate').AnyEventObject, {
                        hinClient: import('../../core/integration/hin').HINClient;
                    }, import('xstate').EventObject>;
                    id: string | undefined;
                } extends infer T_3 ? T_3 extends {
                    src: "listenSamlAuthMessage";
                    logic: import('xstate').CallbackActorLogic<import('xstate').AnyEventObject, {
                        hinClient: import('../../core/integration/hin').HINClient;
                    }, import('xstate').EventObject>;
                    id: string | undefined;
                } ? T_3 extends {
                    src: TSrc;
                } ? import('xstate').ConditionalRequired<[options?: ({
                    id?: T_3["id"] | undefined;
                    systemId?: string;
                    input?: import('xstate').InputFrom<T_3["logic"]> | undefined;
                    syncSnapshot?: boolean;
                } & { [K_3 in import('xstate').RequiredActorOptions<T_3>]: unknown; }) | undefined], import('xstate').IsNotNever<import('xstate').RequiredActorOptions<T_3>>> : never : never : never) | ({
                    src: "validateCHMED";
                    logic: import('xstate').PromiseActorLogic<void, {
                        encodedCHMED?: string;
                        parent: import('xstate').ActorRef<import('xstate').AnyMachineSnapshot, import('../../core').PrescriptionSignEvents>;
                        hinClient: import('../../core/integration/hin').HINClient;
                        sessionToken?: string;
                    }, import('xstate').EventObject>;
                    id: string | undefined;
                } extends infer T_4 ? T_4 extends {
                    src: "validateCHMED";
                    logic: import('xstate').PromiseActorLogic<void, {
                        encodedCHMED?: string;
                        parent: import('xstate').ActorRef<import('xstate').AnyMachineSnapshot, import('../../core').PrescriptionSignEvents>;
                        hinClient: import('../../core/integration/hin').HINClient;
                        sessionToken?: string;
                    }, import('xstate').EventObject>;
                    id: string | undefined;
                } ? T_4 extends {
                    src: TSrc;
                } ? import('xstate').ConditionalRequired<[options?: ({
                    id?: T_4["id"] | undefined;
                    systemId?: string;
                    input?: import('xstate').InputFrom<T_4["logic"]> | undefined;
                    syncSnapshot?: boolean;
                } & { [K_4 in import('xstate').RequiredActorOptions<T_4>]: unknown; }) | undefined], import('xstate').IsNotNever<import('xstate').RequiredActorOptions<T_4>>> : never : never : never) | ({
                    src: "verifySession";
                    logic: import('xstate').PromiseActorLogic<void, {
                        parent: import('xstate').ActorRef<import('xstate').AnyMachineSnapshot, import('../../core').PrescriptionSignEvents>;
                        hinClient: import('../../core/integration/hin').HINClient;
                        sessionToken?: string;
                    }, import('xstate').EventObject>;
                    id: string | undefined;
                } extends infer T_5 ? T_5 extends {
                    src: "verifySession";
                    logic: import('xstate').PromiseActorLogic<void, {
                        parent: import('xstate').ActorRef<import('xstate').AnyMachineSnapshot, import('../../core').PrescriptionSignEvents>;
                        hinClient: import('../../core/integration/hin').HINClient;
                        sessionToken?: string;
                    }, import('xstate').EventObject>;
                    id: string | undefined;
                } ? T_5 extends {
                    src: TSrc;
                } ? import('xstate').ConditionalRequired<[options?: ({
                    id?: T_5["id"] | undefined;
                    systemId?: string;
                    input?: import('xstate').InputFrom<T_5["logic"]> | undefined;
                    syncSnapshot?: boolean;
                } & { [K_5 in import('xstate').RequiredActorOptions<T_5>]: unknown; }) | undefined], import('xstate').IsNotNever<import('xstate').RequiredActorOptions<T_5>>> : never : never : never) | ({
                    src: "initOAuth";
                    logic: import('xstate').PromiseActorLogic<void, {
                        parent: import('xstate').ActorRef<import('xstate').AnyMachineSnapshot, import('../../core').PrescriptionSignEvents>;
                        popupRef: Window | null;
                        hinClient: import('../../core/integration/hin').HINClient;
                    }, import('xstate').EventObject>;
                    id: string | undefined;
                } extends infer T_6 ? T_6 extends {
                    src: "initOAuth";
                    logic: import('xstate').PromiseActorLogic<void, {
                        parent: import('xstate').ActorRef<import('xstate').AnyMachineSnapshot, import('../../core').PrescriptionSignEvents>;
                        popupRef: Window | null;
                        hinClient: import('../../core/integration/hin').HINClient;
                    }, import('xstate').EventObject>;
                    id: string | undefined;
                } ? T_6 extends {
                    src: TSrc;
                } ? import('xstate').ConditionalRequired<[options?: ({
                    id?: T_6["id"] | undefined;
                    systemId?: string;
                    input?: import('xstate').InputFrom<T_6["logic"]> | undefined;
                    syncSnapshot?: boolean;
                } & { [K_6 in import('xstate').RequiredActorOptions<T_6>]: unknown; }) | undefined], import('xstate').IsNotNever<import('xstate').RequiredActorOptions<T_6>>> : never : never : never) | ({
                    src: "listenOAuthMessage";
                    logic: import('xstate').CallbackActorLogic<import('xstate').AnyEventObject, {
                        hinClient: import('../../core/integration/hin').HINClient;
                        sessionToken?: string;
                    }, import('xstate').EventObject>;
                    id: string | undefined;
                } extends infer T_7 ? T_7 extends {
                    src: "listenOAuthMessage";
                    logic: import('xstate').CallbackActorLogic<import('xstate').AnyEventObject, {
                        hinClient: import('../../core/integration/hin').HINClient;
                        sessionToken?: string;
                    }, import('xstate').EventObject>;
                    id: string | undefined;
                } ? T_7 extends {
                    src: TSrc;
                } ? import('xstate').ConditionalRequired<[options?: ({
                    id?: T_7["id"] | undefined;
                    systemId?: string;
                    input?: import('xstate').InputFrom<T_7["logic"]> | undefined;
                    syncSnapshot?: boolean;
                } & { [K_7 in import('xstate').RequiredActorOptions<T_7>]: unknown; }) | undefined], import('xstate').IsNotNever<import('xstate').RequiredActorOptions<T_7>>> : never : never : never) | ({
                    src: "refreshToken";
                    logic: import('xstate').PromiseActorLogic<{
                        sessionToken: string;
                    }, {
                        hinClient: import('../../core/integration/hin').HINClient;
                        sessionToken?: string;
                    }, import('xstate').EventObject>;
                    id: string | undefined;
                } extends infer T_8 ? T_8 extends {
                    src: "refreshToken";
                    logic: import('xstate').PromiseActorLogic<{
                        sessionToken: string;
                    }, {
                        hinClient: import('../../core/integration/hin').HINClient;
                        sessionToken?: string;
                    }, import('xstate').EventObject>;
                    id: string | undefined;
                } ? T_8 extends {
                    src: TSrc;
                } ? import('xstate').ConditionalRequired<[options?: ({
                    id?: T_8["id"] | undefined;
                    systemId?: string;
                    input?: import('xstate').InputFrom<T_8["logic"]> | undefined;
                    syncSnapshot?: boolean;
                } & { [K_8 in import('xstate').RequiredActorOptions<T_8>]: unknown; }) | undefined], import('xstate').IsNotNever<import('xstate').RequiredActorOptions<T_8>>> : never : never : never) | ({
                    src: "initSAMLAuthCode";
                    logic: import('xstate').PromiseActorLogic<void, {
                        parent: import('xstate').ActorRef<import('xstate').AnyMachineSnapshot, import('../../core').PrescriptionSignEvents>;
                        popupRef: Window | null;
                        hinClient: import('../../core/integration/hin').HINClient;
                        recover: boolean;
                        sessionToken?: string;
                    }, import('xstate').EventObject>;
                    id: string | undefined;
                } extends infer T_9 ? T_9 extends {
                    src: "initSAMLAuthCode";
                    logic: import('xstate').PromiseActorLogic<void, {
                        parent: import('xstate').ActorRef<import('xstate').AnyMachineSnapshot, import('../../core').PrescriptionSignEvents>;
                        popupRef: Window | null;
                        hinClient: import('../../core/integration/hin').HINClient;
                        recover: boolean;
                        sessionToken?: string;
                    }, import('xstate').EventObject>;
                    id: string | undefined;
                } ? T_9 extends {
                    src: TSrc;
                } ? import('xstate').ConditionalRequired<[options?: ({
                    id?: T_9["id"] | undefined;
                    systemId?: string;
                    input?: import('xstate').InputFrom<T_9["logic"]> | undefined;
                    syncSnapshot?: boolean;
                } & { [K_9 in import('xstate').RequiredActorOptions<T_9>]: unknown; }) | undefined], import('xstate').IsNotNever<import('xstate').RequiredActorOptions<T_9>>> : never : never : never) | ({
                    src: "listenSAMLAuthCodeMessage";
                    logic: import('xstate').CallbackActorLogic<import('xstate').AnyEventObject, {
                        hinClient: import('../../core/integration/hin').HINClient;
                    }, import('xstate').EventObject>;
                    id: string | undefined;
                } extends infer T_10 ? T_10 extends {
                    src: "listenSAMLAuthCodeMessage";
                    logic: import('xstate').CallbackActorLogic<import('xstate').AnyEventObject, {
                        hinClient: import('../../core/integration/hin').HINClient;
                    }, import('xstate').EventObject>;
                    id: string | undefined;
                } ? T_10 extends {
                    src: TSrc;
                } ? import('xstate').ConditionalRequired<[options?: ({
                    id?: T_10["id"] | undefined;
                    systemId?: string;
                    input?: import('xstate').InputFrom<T_10["logic"]> | undefined;
                    syncSnapshot?: boolean;
                } & { [K_10 in import('xstate').RequiredActorOptions<T_10>]: unknown; }) | undefined], import('xstate').IsNotNever<import('xstate').RequiredActorOptions<T_10>>> : never : never : never) | ({
                    src: "getSAMLAuthHandle";
                    logic: import('xstate').PromiseActorLogic<{
                        sessionToken: string;
                    }, {
                        parent: import('xstate').ActorRef<import('xstate').AnyMachineSnapshot, import('../../core').PrescriptionSignEvents>;
                        authCode: string;
                        hinClient: import('../../core/integration/hin').HINClient;
                        sessionToken?: string;
                    }, import('xstate').EventObject>;
                    id: string | undefined;
                } extends infer T_11 ? T_11 extends {
                    src: "getSAMLAuthHandle";
                    logic: import('xstate').PromiseActorLogic<{
                        sessionToken: string;
                    }, {
                        parent: import('xstate').ActorRef<import('xstate').AnyMachineSnapshot, import('../../core').PrescriptionSignEvents>;
                        authCode: string;
                        hinClient: import('../../core/integration/hin').HINClient;
                        sessionToken?: string;
                    }, import('xstate').EventObject>;
                    id: string | undefined;
                } ? T_11 extends {
                    src: TSrc;
                } ? import('xstate').ConditionalRequired<[options?: ({
                    id?: T_11["id"] | undefined;
                    systemId?: string;
                    input?: import('xstate').InputFrom<T_11["logic"]> | undefined;
                    syncSnapshot?: boolean;
                } & { [K_11 in import('xstate').RequiredActorOptions<T_11>]: unknown; }) | undefined], import('xstate').IsNotNever<import('xstate').RequiredActorOptions<T_11>>> : never : never : never) | ({
                    src: "signCHMEDRx";
                    logic: import('xstate').PromiseActorLogic<{
                        signedPrescription: string;
                        generatedPdf?: string;
                    }, {
                        encodedCHMED?: string;
                        shouldGeneratePdf: boolean;
                        parent: import('xstate').ActorRef<import('xstate').AnyMachineSnapshot, import('../../core').PrescriptionSignEvents>;
                        hinClient: import('../../core/integration/hin').HINClient;
                        sessionToken?: string;
                        recover: boolean;
                    }, import('xstate').EventObject>;
                    id: string | undefined;
                } extends infer T_12 ? T_12 extends {
                    src: "signCHMEDRx";
                    logic: import('xstate').PromiseActorLogic<{
                        signedPrescription: string;
                        generatedPdf?: string;
                    }, {
                        encodedCHMED?: string;
                        shouldGeneratePdf: boolean;
                        parent: import('xstate').ActorRef<import('xstate').AnyMachineSnapshot, import('../../core').PrescriptionSignEvents>;
                        hinClient: import('../../core/integration/hin').HINClient;
                        sessionToken?: string;
                        recover: boolean;
                    }, import('xstate').EventObject>;
                    id: string | undefined;
                } ? T_12 extends {
                    src: TSrc;
                } ? import('xstate').ConditionalRequired<[options?: ({
                    id?: T_12["id"] | undefined;
                    systemId?: string;
                    input?: import('xstate').InputFrom<T_12["logic"]> | undefined;
                    syncSnapshot?: boolean;
                } & { [K_12 in import('xstate').RequiredActorOptions<T_12>]: unknown; }) | undefined], import('xstate').IsNotNever<import('xstate').RequiredActorOptions<T_12>>> : never : never : never) | ({
                    src: "errorHandler";
                    logic: import('xstate').CallbackActorLogic<import('xstate').AnyEventObject, {
                        error: DomainError;
                    }, import('xstate').EventObject>;
                    id: string | undefined;
                } extends infer T_13 ? T_13 extends {
                    src: "errorHandler";
                    logic: import('xstate').CallbackActorLogic<import('xstate').AnyEventObject, {
                        error: DomainError;
                    }, import('xstate').EventObject>;
                    id: string | undefined;
                } ? T_13 extends {
                    src: TSrc;
                } ? import('xstate').ConditionalRequired<[options?: ({
                    id?: T_13["id"] | undefined;
                    systemId?: string;
                    input?: import('xstate').InputFrom<T_13["logic"]> | undefined;
                    syncSnapshot?: boolean;
                } & { [K_13 in import('xstate').RequiredActorOptions<T_13>]: unknown; }) | undefined], import('xstate').IsNotNever<import('xstate').RequiredActorOptions<T_13>>> : never : never : never) | ({
                    src: "successHandler";
                    logic: import('xstate').CallbackActorLogic<import('xstate').AnyEventObject, {
                        signedCHMED?: string;
                        generatedPdf?: string;
                    }, import('xstate').EventObject>;
                    id: string | undefined;
                } extends infer T_14 ? T_14 extends {
                    src: "successHandler";
                    logic: import('xstate').CallbackActorLogic<import('xstate').AnyEventObject, {
                        signedCHMED?: string;
                        generatedPdf?: string;
                    }, import('xstate').EventObject>;
                    id: string | undefined;
                } ? T_14 extends {
                    src: TSrc;
                } ? import('xstate').ConditionalRequired<[options?: ({
                    id?: T_14["id"] | undefined;
                    systemId?: string;
                    input?: import('xstate').InputFrom<T_14["logic"]> | undefined;
                    syncSnapshot?: boolean;
                } & { [K_14 in import('xstate').RequiredActorOptions<T_14>]: unknown; }) | undefined], import('xstate').IsNotNever<import('xstate').RequiredActorOptions<T_14>>> : never : never : never)): import('xstate').ActorRefFromLogic<import('xstate').GetConcreteByKey<import('xstate').Values<{
                    openPopup: {
                        src: "openPopup";
                        logic: import('xstate').CallbackActorLogic<import('xstate').AnyEventObject, {
                            sessionToken?: string;
                            hinClient: import('../../core/integration/hin').HINClient;
                        }, import('xstate').EventObject>;
                        id: string | undefined;
                    };
                    trackPopup: {
                        src: "trackPopup";
                        logic: import('xstate').CallbackActorLogic<import('xstate').AnyEventObject, {
                            popupRef: Window | null;
                        }, import('xstate').EventObject>;
                        id: string | undefined;
                    };
                    listenAuthenticationMessage: {
                        src: "listenAuthenticationMessage";
                        logic: import('xstate').CallbackActorLogic<import('xstate').AnyEventObject, {
                            hinClient: import('../../core/integration/hin').HINClient;
                            accessToken: string;
                        }, import('xstate').EventObject>;
                        id: string | undefined;
                    };
                    listenSamlAuthMessage: {
                        src: "listenSamlAuthMessage";
                        logic: import('xstate').CallbackActorLogic<import('xstate').AnyEventObject, {
                            hinClient: import('../../core/integration/hin').HINClient;
                        }, import('xstate').EventObject>;
                        id: string | undefined;
                    };
                    validateCHMED: {
                        src: "validateCHMED";
                        logic: import('xstate').PromiseActorLogic<void, {
                            encodedCHMED?: string;
                            parent: import('xstate').ActorRef<import('xstate').AnyMachineSnapshot, import('../../core').PrescriptionSignEvents>;
                            hinClient: import('../../core/integration/hin').HINClient;
                            sessionToken?: string;
                        }, import('xstate').EventObject>;
                        id: string | undefined;
                    };
                    verifySession: {
                        src: "verifySession";
                        logic: import('xstate').PromiseActorLogic<void, {
                            parent: import('xstate').ActorRef<import('xstate').AnyMachineSnapshot, import('../../core').PrescriptionSignEvents>;
                            hinClient: import('../../core/integration/hin').HINClient;
                            sessionToken?: string;
                        }, import('xstate').EventObject>;
                        id: string | undefined;
                    };
                    initOAuth: {
                        src: "initOAuth";
                        logic: import('xstate').PromiseActorLogic<void, {
                            parent: import('xstate').ActorRef<import('xstate').AnyMachineSnapshot, import('../../core').PrescriptionSignEvents>;
                            popupRef: Window | null;
                            hinClient: import('../../core/integration/hin').HINClient;
                        }, import('xstate').EventObject>;
                        id: string | undefined;
                    };
                    listenOAuthMessage: {
                        src: "listenOAuthMessage";
                        logic: import('xstate').CallbackActorLogic<import('xstate').AnyEventObject, {
                            hinClient: import('../../core/integration/hin').HINClient;
                            sessionToken?: string;
                        }, import('xstate').EventObject>;
                        id: string | undefined;
                    };
                    refreshToken: {
                        src: "refreshToken";
                        logic: import('xstate').PromiseActorLogic<{
                            sessionToken: string;
                        }, {
                            hinClient: import('../../core/integration/hin').HINClient;
                            sessionToken?: string;
                        }, import('xstate').EventObject>;
                        id: string | undefined;
                    };
                    initSAMLAuthCode: {
                        src: "initSAMLAuthCode";
                        logic: import('xstate').PromiseActorLogic<void, {
                            parent: import('xstate').ActorRef<import('xstate').AnyMachineSnapshot, import('../../core').PrescriptionSignEvents>;
                            popupRef: Window | null;
                            hinClient: import('../../core/integration/hin').HINClient;
                            recover: boolean;
                            sessionToken?: string;
                        }, import('xstate').EventObject>;
                        id: string | undefined;
                    };
                    listenSAMLAuthCodeMessage: {
                        src: "listenSAMLAuthCodeMessage";
                        logic: import('xstate').CallbackActorLogic<import('xstate').AnyEventObject, {
                            hinClient: import('../../core/integration/hin').HINClient;
                        }, import('xstate').EventObject>;
                        id: string | undefined;
                    };
                    getSAMLAuthHandle: {
                        src: "getSAMLAuthHandle";
                        logic: import('xstate').PromiseActorLogic<{
                            sessionToken: string;
                        }, {
                            parent: import('xstate').ActorRef<import('xstate').AnyMachineSnapshot, import('../../core').PrescriptionSignEvents>;
                            authCode: string;
                            hinClient: import('../../core/integration/hin').HINClient;
                            sessionToken?: string;
                        }, import('xstate').EventObject>;
                        id: string | undefined;
                    };
                    signCHMEDRx: {
                        src: "signCHMEDRx";
                        logic: import('xstate').PromiseActorLogic<{
                            signedPrescription: string;
                            generatedPdf?: string;
                        }, {
                            encodedCHMED?: string;
                            shouldGeneratePdf: boolean;
                            parent: import('xstate').ActorRef<import('xstate').AnyMachineSnapshot, import('../../core').PrescriptionSignEvents>;
                            hinClient: import('../../core/integration/hin').HINClient;
                            sessionToken?: string;
                            recover: boolean;
                        }, import('xstate').EventObject>;
                        id: string | undefined;
                    };
                    errorHandler: {
                        src: "errorHandler";
                        logic: import('xstate').CallbackActorLogic<import('xstate').AnyEventObject, {
                            error: DomainError;
                        }, import('xstate').EventObject>;
                        id: string | undefined;
                    };
                    successHandler: {
                        src: "successHandler";
                        logic: import('xstate').CallbackActorLogic<import('xstate').AnyEventObject, {
                            signedCHMED?: string;
                            generatedPdf?: string;
                        }, import('xstate').EventObject>;
                        id: string | undefined;
                    };
                }>, "src", TSrc>["logic"]>;
                <TLogic extends import('xstate').AnyActorLogic>(src: TLogic, ...[options]: import('xstate').ConditionalRequired<[options?: ({
                    id?: never;
                    systemId?: string;
                    input?: import('xstate').InputFrom<TLogic> | undefined;
                    syncSnapshot?: boolean;
                } & { [K in import('xstate').RequiredLogicInput<TLogic>]: unknown; }) | undefined], import('xstate').IsNotNever<import('xstate').RequiredLogicInput<TLogic>>>): import('xstate').ActorRefFromLogic<TLogic>;
            };
            input: import('../../core').PrescriptionSignContextInputs;
            self: import('xstate').ActorRef<import('xstate').MachineSnapshot<import('../../core').PrescriptionSignContext, {
                type: "OPEN_POPUP";
                popupRef: Window | null;
            } | {
                type: "CLOSE_POPUP";
            } | {
                type: "START";
                encodedCHMED: string;
                shouldGeneratePdf: boolean;
            } | {
                type: "TERMINATE";
            } | {
                type: "VERIFY_SESSION";
            } | {
                type: "REFRESH_TOKEN";
            } | {
                type: "GET_TOKEN";
            } | {
                type: "GET_SAML_AUTH_CODE";
                recoverable?: boolean;
                sessionToken: string;
            } | {
                type: "GET_SAML_AUTH_HANDLE";
                authCode: string;
            } | {
                type: "VALIDATE_CHMED";
                sessionToken: string;
            } | {
                type: "xstate.done.actor.getSAMLAuthHandle";
                sessionToken: string;
                recoverable?: boolean;
            } | {
                type: "SIGN_PRESCRIPTION";
                sessionToken: string;
                recoverable?: boolean;
            } | {
                type: "AUTHENTICATION_SUCCESS";
            } | {
                type: "ERROR";
                error: DomainError;
            } | {
                type: "UNAUTHORIZED_TOKEN";
            } | {
                type: "UNAUTHORIZED_HANDLE";
            }, Record<string, import('xstate').AnyActorRef | undefined>, import('xstate').StateValue, string, unknown, any, any>, {
                type: "OPEN_POPUP";
                popupRef: Window | null;
            } | {
                type: "CLOSE_POPUP";
            } | {
                type: "START";
                encodedCHMED: string;
                shouldGeneratePdf: boolean;
            } | {
                type: "TERMINATE";
            } | {
                type: "VERIFY_SESSION";
            } | {
                type: "REFRESH_TOKEN";
            } | {
                type: "GET_TOKEN";
            } | {
                type: "GET_SAML_AUTH_CODE";
                recoverable?: boolean;
                sessionToken: string;
            } | {
                type: "GET_SAML_AUTH_HANDLE";
                authCode: string;
            } | {
                type: "VALIDATE_CHMED";
                sessionToken: string;
            } | {
                type: "xstate.done.actor.getSAMLAuthHandle";
                sessionToken: string;
                recoverable?: boolean;
            } | {
                type: "SIGN_PRESCRIPTION";
                sessionToken: string;
                recoverable?: boolean;
            } | {
                type: "AUTHENTICATION_SUCCESS";
            } | {
                type: "ERROR";
                error: DomainError;
            } | {
                type: "UNAUTHORIZED_TOKEN";
            } | {
                type: "UNAUTHORIZED_HANDLE";
            }, import('xstate').AnyEventObject>;
        }) => {
            popupRef: null;
            encodedCHMED: undefined;
            signedCHMED: undefined;
            generatedPdf: undefined;
            shouldGeneratePdf: false;
            sessionToken: string | undefined;
            accessToken: string;
            hinClient: import('../../core/integration/hin').HINClient;
        };
        readonly id: "HINPrescriptionSigning";
        readonly initial: "Idle";
        readonly states: {
            readonly Idle: {
                readonly on: {
                    readonly START: {
                        readonly target: "Started";
                        readonly actions: import('xstate').ActionFunction<import('../../core').PrescriptionSignContext, {
                            type: "START";
                            encodedCHMED: string;
                            shouldGeneratePdf: boolean;
                        }, {
                            type: "OPEN_POPUP";
                            popupRef: Window | null;
                        } | {
                            type: "CLOSE_POPUP";
                        } | {
                            type: "START";
                            encodedCHMED: string;
                            shouldGeneratePdf: boolean;
                        } | {
                            type: "TERMINATE";
                        } | {
                            type: "VERIFY_SESSION";
                        } | {
                            type: "REFRESH_TOKEN";
                        } | {
                            type: "GET_TOKEN";
                        } | {
                            type: "GET_SAML_AUTH_CODE";
                            recoverable?: boolean;
                            sessionToken: string;
                        } | {
                            type: "GET_SAML_AUTH_HANDLE";
                            authCode: string;
                        } | {
                            type: "VALIDATE_CHMED";
                            sessionToken: string;
                        } | {
                            type: "xstate.done.actor.getSAMLAuthHandle";
                            sessionToken: string;
                            recoverable?: boolean;
                        } | {
                            type: "SIGN_PRESCRIPTION";
                            sessionToken: string;
                            recoverable?: boolean;
                        } | {
                            type: "AUTHENTICATION_SUCCESS";
                        } | {
                            type: "ERROR";
                            error: DomainError;
                        } | {
                            type: "UNAUTHORIZED_TOKEN";
                        } | {
                            type: "UNAUTHORIZED_HANDLE";
                        }, undefined, import('xstate').Values<{
                            openPopup: {
                                src: "openPopup";
                                logic: import('xstate').CallbackActorLogic<import('xstate').AnyEventObject, {
                                    sessionToken?: string;
                                    hinClient: import('../../core/integration/hin').HINClient;
                                }, import('xstate').EventObject>;
                                id: string | undefined;
                            };
                            trackPopup: {
                                src: "trackPopup";
                                logic: import('xstate').CallbackActorLogic<import('xstate').AnyEventObject, {
                                    popupRef: Window | null;
                                }, import('xstate').EventObject>;
                                id: string | undefined;
                            };
                            listenAuthenticationMessage: {
                                src: "listenAuthenticationMessage";
                                logic: import('xstate').CallbackActorLogic<import('xstate').AnyEventObject, {
                                    hinClient: import('../../core/integration/hin').HINClient;
                                    accessToken: string;
                                }, import('xstate').EventObject>;
                                id: string | undefined;
                            };
                            listenSamlAuthMessage: {
                                src: "listenSamlAuthMessage";
                                logic: import('xstate').CallbackActorLogic<import('xstate').AnyEventObject, {
                                    hinClient: import('../../core/integration/hin').HINClient;
                                }, import('xstate').EventObject>;
                                id: string | undefined;
                            };
                            validateCHMED: {
                                src: "validateCHMED";
                                logic: import('xstate').PromiseActorLogic<void, {
                                    encodedCHMED?: string;
                                    parent: import('xstate').ActorRef<import('xstate').AnyMachineSnapshot, import('../../core').PrescriptionSignEvents>;
                                    hinClient: import('../../core/integration/hin').HINClient;
                                    sessionToken?: string;
                                }, import('xstate').EventObject>;
                                id: string | undefined;
                            };
                            verifySession: {
                                src: "verifySession";
                                logic: import('xstate').PromiseActorLogic<void, {
                                    parent: import('xstate').ActorRef<import('xstate').AnyMachineSnapshot, import('../../core').PrescriptionSignEvents>;
                                    hinClient: import('../../core/integration/hin').HINClient;
                                    sessionToken?: string;
                                }, import('xstate').EventObject>;
                                id: string | undefined;
                            };
                            initOAuth: {
                                src: "initOAuth";
                                logic: import('xstate').PromiseActorLogic<void, {
                                    parent: import('xstate').ActorRef<import('xstate').AnyMachineSnapshot, import('../../core').PrescriptionSignEvents>;
                                    popupRef: Window | null;
                                    hinClient: import('../../core/integration/hin').HINClient;
                                }, import('xstate').EventObject>;
                                id: string | undefined;
                            };
                            listenOAuthMessage: {
                                src: "listenOAuthMessage";
                                logic: import('xstate').CallbackActorLogic<import('xstate').AnyEventObject, {
                                    hinClient: import('../../core/integration/hin').HINClient;
                                    sessionToken?: string;
                                }, import('xstate').EventObject>;
                                id: string | undefined;
                            };
                            refreshToken: {
                                src: "refreshToken";
                                logic: import('xstate').PromiseActorLogic<{
                                    sessionToken: string;
                                }, {
                                    hinClient: import('../../core/integration/hin').HINClient;
                                    sessionToken?: string;
                                }, import('xstate').EventObject>;
                                id: string | undefined;
                            };
                            initSAMLAuthCode: {
                                src: "initSAMLAuthCode";
                                logic: import('xstate').PromiseActorLogic<void, {
                                    parent: import('xstate').ActorRef<import('xstate').AnyMachineSnapshot, import('../../core').PrescriptionSignEvents>;
                                    popupRef: Window | null;
                                    hinClient: import('../../core/integration/hin').HINClient;
                                    recover: boolean;
                                    sessionToken?: string;
                                }, import('xstate').EventObject>;
                                id: string | undefined;
                            };
                            listenSAMLAuthCodeMessage: {
                                src: "listenSAMLAuthCodeMessage";
                                logic: import('xstate').CallbackActorLogic<import('xstate').AnyEventObject, {
                                    hinClient: import('../../core/integration/hin').HINClient;
                                }, import('xstate').EventObject>;
                                id: string | undefined;
                            };
                            getSAMLAuthHandle: {
                                src: "getSAMLAuthHandle";
                                logic: import('xstate').PromiseActorLogic<{
                                    sessionToken: string;
                                }, {
                                    parent: import('xstate').ActorRef<import('xstate').AnyMachineSnapshot, import('../../core').PrescriptionSignEvents>;
                                    authCode: string;
                                    hinClient: import('../../core/integration/hin').HINClient;
                                    sessionToken?: string;
                                }, import('xstate').EventObject>;
                                id: string | undefined;
                            };
                            signCHMEDRx: {
                                src: "signCHMEDRx";
                                logic: import('xstate').PromiseActorLogic<{
                                    signedPrescription: string;
                                    generatedPdf?: string;
                                }, {
                                    encodedCHMED?: string;
                                    shouldGeneratePdf: boolean;
                                    parent: import('xstate').ActorRef<import('xstate').AnyMachineSnapshot, import('../../core').PrescriptionSignEvents>;
                                    hinClient: import('../../core/integration/hin').HINClient;
                                    sessionToken?: string;
                                    recover: boolean;
                                }, import('xstate').EventObject>;
                                id: string | undefined;
                            };
                            errorHandler: {
                                src: "errorHandler";
                                logic: import('xstate').CallbackActorLogic<import('xstate').AnyEventObject, {
                                    error: DomainError;
                                }, import('xstate').EventObject>;
                                id: string | undefined;
                            };
                            successHandler: {
                                src: "successHandler";
                                logic: import('xstate').CallbackActorLogic<import('xstate').AnyEventObject, {
                                    signedCHMED?: string;
                                    generatedPdf?: string;
                                }, import('xstate').EventObject>;
                                id: string | undefined;
                            };
                        }>, never, never, never, never>;
                    };
                };
            };
            readonly Started: {
                readonly type: "parallel";
                readonly onDone: {
                    readonly target: "Idle";
                    readonly actions: import('xstate').ActionFunction<import('../../core').PrescriptionSignContext, import('xstate').DoneStateEvent<unknown>, {
                        type: "OPEN_POPUP";
                        popupRef: Window | null;
                    } | {
                        type: "CLOSE_POPUP";
                    } | {
                        type: "START";
                        encodedCHMED: string;
                        shouldGeneratePdf: boolean;
                    } | {
                        type: "TERMINATE";
                    } | {
                        type: "VERIFY_SESSION";
                    } | {
                        type: "REFRESH_TOKEN";
                    } | {
                        type: "GET_TOKEN";
                    } | {
                        type: "GET_SAML_AUTH_CODE";
                        recoverable?: boolean;
                        sessionToken: string;
                    } | {
                        type: "GET_SAML_AUTH_HANDLE";
                        authCode: string;
                    } | {
                        type: "VALIDATE_CHMED";
                        sessionToken: string;
                    } | {
                        type: "xstate.done.actor.getSAMLAuthHandle";
                        sessionToken: string;
                        recoverable?: boolean;
                    } | {
                        type: "SIGN_PRESCRIPTION";
                        sessionToken: string;
                        recoverable?: boolean;
                    } | {
                        type: "AUTHENTICATION_SUCCESS";
                    } | {
                        type: "ERROR";
                        error: DomainError;
                    } | {
                        type: "UNAUTHORIZED_TOKEN";
                    } | {
                        type: "UNAUTHORIZED_HANDLE";
                    }, undefined, import('xstate').Values<{
                        openPopup: {
                            src: "openPopup";
                            logic: import('xstate').CallbackActorLogic<import('xstate').AnyEventObject, {
                                sessionToken?: string;
                                hinClient: import('../../core/integration/hin').HINClient;
                            }, import('xstate').EventObject>;
                            id: string | undefined;
                        };
                        trackPopup: {
                            src: "trackPopup";
                            logic: import('xstate').CallbackActorLogic<import('xstate').AnyEventObject, {
                                popupRef: Window | null;
                            }, import('xstate').EventObject>;
                            id: string | undefined;
                        };
                        listenAuthenticationMessage: {
                            src: "listenAuthenticationMessage";
                            logic: import('xstate').CallbackActorLogic<import('xstate').AnyEventObject, {
                                hinClient: import('../../core/integration/hin').HINClient;
                                accessToken: string;
                            }, import('xstate').EventObject>;
                            id: string | undefined;
                        };
                        listenSamlAuthMessage: {
                            src: "listenSamlAuthMessage";
                            logic: import('xstate').CallbackActorLogic<import('xstate').AnyEventObject, {
                                hinClient: import('../../core/integration/hin').HINClient;
                            }, import('xstate').EventObject>;
                            id: string | undefined;
                        };
                        validateCHMED: {
                            src: "validateCHMED";
                            logic: import('xstate').PromiseActorLogic<void, {
                                encodedCHMED?: string;
                                parent: import('xstate').ActorRef<import('xstate').AnyMachineSnapshot, import('../../core').PrescriptionSignEvents>;
                                hinClient: import('../../core/integration/hin').HINClient;
                                sessionToken?: string;
                            }, import('xstate').EventObject>;
                            id: string | undefined;
                        };
                        verifySession: {
                            src: "verifySession";
                            logic: import('xstate').PromiseActorLogic<void, {
                                parent: import('xstate').ActorRef<import('xstate').AnyMachineSnapshot, import('../../core').PrescriptionSignEvents>;
                                hinClient: import('../../core/integration/hin').HINClient;
                                sessionToken?: string;
                            }, import('xstate').EventObject>;
                            id: string | undefined;
                        };
                        initOAuth: {
                            src: "initOAuth";
                            logic: import('xstate').PromiseActorLogic<void, {
                                parent: import('xstate').ActorRef<import('xstate').AnyMachineSnapshot, import('../../core').PrescriptionSignEvents>;
                                popupRef: Window | null;
                                hinClient: import('../../core/integration/hin').HINClient;
                            }, import('xstate').EventObject>;
                            id: string | undefined;
                        };
                        listenOAuthMessage: {
                            src: "listenOAuthMessage";
                            logic: import('xstate').CallbackActorLogic<import('xstate').AnyEventObject, {
                                hinClient: import('../../core/integration/hin').HINClient;
                                sessionToken?: string;
                            }, import('xstate').EventObject>;
                            id: string | undefined;
                        };
                        refreshToken: {
                            src: "refreshToken";
                            logic: import('xstate').PromiseActorLogic<{
                                sessionToken: string;
                            }, {
                                hinClient: import('../../core/integration/hin').HINClient;
                                sessionToken?: string;
                            }, import('xstate').EventObject>;
                            id: string | undefined;
                        };
                        initSAMLAuthCode: {
                            src: "initSAMLAuthCode";
                            logic: import('xstate').PromiseActorLogic<void, {
                                parent: import('xstate').ActorRef<import('xstate').AnyMachineSnapshot, import('../../core').PrescriptionSignEvents>;
                                popupRef: Window | null;
                                hinClient: import('../../core/integration/hin').HINClient;
                                recover: boolean;
                                sessionToken?: string;
                            }, import('xstate').EventObject>;
                            id: string | undefined;
                        };
                        listenSAMLAuthCodeMessage: {
                            src: "listenSAMLAuthCodeMessage";
                            logic: import('xstate').CallbackActorLogic<import('xstate').AnyEventObject, {
                                hinClient: import('../../core/integration/hin').HINClient;
                            }, import('xstate').EventObject>;
                            id: string | undefined;
                        };
                        getSAMLAuthHandle: {
                            src: "getSAMLAuthHandle";
                            logic: import('xstate').PromiseActorLogic<{
                                sessionToken: string;
                            }, {
                                parent: import('xstate').ActorRef<import('xstate').AnyMachineSnapshot, import('../../core').PrescriptionSignEvents>;
                                authCode: string;
                                hinClient: import('../../core/integration/hin').HINClient;
                                sessionToken?: string;
                            }, import('xstate').EventObject>;
                            id: string | undefined;
                        };
                        signCHMEDRx: {
                            src: "signCHMEDRx";
                            logic: import('xstate').PromiseActorLogic<{
                                signedPrescription: string;
                                generatedPdf?: string;
                            }, {
                                encodedCHMED?: string;
                                shouldGeneratePdf: boolean;
                                parent: import('xstate').ActorRef<import('xstate').AnyMachineSnapshot, import('../../core').PrescriptionSignEvents>;
                                hinClient: import('../../core/integration/hin').HINClient;
                                sessionToken?: string;
                                recover: boolean;
                            }, import('xstate').EventObject>;
                            id: string | undefined;
                        };
                        errorHandler: {
                            src: "errorHandler";
                            logic: import('xstate').CallbackActorLogic<import('xstate').AnyEventObject, {
                                error: DomainError;
                            }, import('xstate').EventObject>;
                            id: string | undefined;
                        };
                        successHandler: {
                            src: "successHandler";
                            logic: import('xstate').CallbackActorLogic<import('xstate').AnyEventObject, {
                                signedCHMED?: string;
                                generatedPdf?: string;
                            }, import('xstate').EventObject>;
                            id: string | undefined;
                        };
                    }>, never, never, never, never>;
                };
                readonly states: {
                    readonly Popup: {
                        readonly initial: "Opening";
                        readonly states: {
                            readonly Opening: {
                                readonly on: {
                                    readonly OPEN_POPUP: {
                                        readonly target: "Open";
                                        readonly actions: import('xstate').ActionFunction<import('../../core').PrescriptionSignContext, {
                                            type: "OPEN_POPUP";
                                            popupRef: Window | null;
                                        }, {
                                            type: "OPEN_POPUP";
                                            popupRef: Window | null;
                                        } | {
                                            type: "CLOSE_POPUP";
                                        } | {
                                            type: "START";
                                            encodedCHMED: string;
                                            shouldGeneratePdf: boolean;
                                        } | {
                                            type: "TERMINATE";
                                        } | {
                                            type: "VERIFY_SESSION";
                                        } | {
                                            type: "REFRESH_TOKEN";
                                        } | {
                                            type: "GET_TOKEN";
                                        } | {
                                            type: "GET_SAML_AUTH_CODE";
                                            recoverable?: boolean;
                                            sessionToken: string;
                                        } | {
                                            type: "GET_SAML_AUTH_HANDLE";
                                            authCode: string;
                                        } | {
                                            type: "VALIDATE_CHMED";
                                            sessionToken: string;
                                        } | {
                                            type: "xstate.done.actor.getSAMLAuthHandle";
                                            sessionToken: string;
                                            recoverable?: boolean;
                                        } | {
                                            type: "SIGN_PRESCRIPTION";
                                            sessionToken: string;
                                            recoverable?: boolean;
                                        } | {
                                            type: "AUTHENTICATION_SUCCESS";
                                        } | {
                                            type: "ERROR";
                                            error: DomainError;
                                        } | {
                                            type: "UNAUTHORIZED_TOKEN";
                                        } | {
                                            type: "UNAUTHORIZED_HANDLE";
                                        }, undefined, import('xstate').Values<{
                                            openPopup: {
                                                src: "openPopup";
                                                logic: import('xstate').CallbackActorLogic<import('xstate').AnyEventObject, {
                                                    sessionToken?: string;
                                                    hinClient: import('../../core/integration/hin').HINClient;
                                                }, import('xstate').EventObject>;
                                                id: string | undefined;
                                            };
                                            trackPopup: {
                                                src: "trackPopup";
                                                logic: import('xstate').CallbackActorLogic<import('xstate').AnyEventObject, {
                                                    popupRef: Window | null;
                                                }, import('xstate').EventObject>;
                                                id: string | undefined;
                                            };
                                            listenAuthenticationMessage: {
                                                src: "listenAuthenticationMessage";
                                                logic: import('xstate').CallbackActorLogic<import('xstate').AnyEventObject, {
                                                    hinClient: import('../../core/integration/hin').HINClient;
                                                    accessToken: string;
                                                }, import('xstate').EventObject>;
                                                id: string | undefined;
                                            };
                                            listenSamlAuthMessage: {
                                                src: "listenSamlAuthMessage";
                                                logic: import('xstate').CallbackActorLogic<import('xstate').AnyEventObject, {
                                                    hinClient: import('../../core/integration/hin').HINClient;
                                                }, import('xstate').EventObject>;
                                                id: string | undefined;
                                            };
                                            validateCHMED: {
                                                src: "validateCHMED";
                                                logic: import('xstate').PromiseActorLogic<void, {
                                                    encodedCHMED?: string;
                                                    parent: import('xstate').ActorRef<import('xstate').AnyMachineSnapshot, import('../../core').PrescriptionSignEvents>;
                                                    hinClient: import('../../core/integration/hin').HINClient;
                                                    sessionToken?: string;
                                                }, import('xstate').EventObject>;
                                                id: string | undefined;
                                            };
                                            verifySession: {
                                                src: "verifySession";
                                                logic: import('xstate').PromiseActorLogic<void, {
                                                    parent: import('xstate').ActorRef<import('xstate').AnyMachineSnapshot, import('../../core').PrescriptionSignEvents>;
                                                    hinClient: import('../../core/integration/hin').HINClient;
                                                    sessionToken?: string;
                                                }, import('xstate').EventObject>;
                                                id: string | undefined;
                                            };
                                            initOAuth: {
                                                src: "initOAuth";
                                                logic: import('xstate').PromiseActorLogic<void, {
                                                    parent: import('xstate').ActorRef<import('xstate').AnyMachineSnapshot, import('../../core').PrescriptionSignEvents>;
                                                    popupRef: Window | null;
                                                    hinClient: import('../../core/integration/hin').HINClient;
                                                }, import('xstate').EventObject>;
                                                id: string | undefined;
                                            };
                                            listenOAuthMessage: {
                                                src: "listenOAuthMessage";
                                                logic: import('xstate').CallbackActorLogic<import('xstate').AnyEventObject, {
                                                    hinClient: import('../../core/integration/hin').HINClient;
                                                    sessionToken?: string;
                                                }, import('xstate').EventObject>;
                                                id: string | undefined;
                                            };
                                            refreshToken: {
                                                src: "refreshToken";
                                                logic: import('xstate').PromiseActorLogic<{
                                                    sessionToken: string;
                                                }, {
                                                    hinClient: import('../../core/integration/hin').HINClient;
                                                    sessionToken?: string;
                                                }, import('xstate').EventObject>;
                                                id: string | undefined;
                                            };
                                            initSAMLAuthCode: {
                                                src: "initSAMLAuthCode";
                                                logic: import('xstate').PromiseActorLogic<void, {
                                                    parent: import('xstate').ActorRef<import('xstate').AnyMachineSnapshot, import('../../core').PrescriptionSignEvents>;
                                                    popupRef: Window | null;
                                                    hinClient: import('../../core/integration/hin').HINClient;
                                                    recover: boolean;
                                                    sessionToken?: string;
                                                }, import('xstate').EventObject>;
                                                id: string | undefined;
                                            };
                                            listenSAMLAuthCodeMessage: {
                                                src: "listenSAMLAuthCodeMessage";
                                                logic: import('xstate').CallbackActorLogic<import('xstate').AnyEventObject, {
                                                    hinClient: import('../../core/integration/hin').HINClient;
                                                }, import('xstate').EventObject>;
                                                id: string | undefined;
                                            };
                                            getSAMLAuthHandle: {
                                                src: "getSAMLAuthHandle";
                                                logic: import('xstate').PromiseActorLogic<{
                                                    sessionToken: string;
                                                }, {
                                                    parent: import('xstate').ActorRef<import('xstate').AnyMachineSnapshot, import('../../core').PrescriptionSignEvents>;
                                                    authCode: string;
                                                    hinClient: import('../../core/integration/hin').HINClient;
                                                    sessionToken?: string;
                                                }, import('xstate').EventObject>;
                                                id: string | undefined;
                                            };
                                            signCHMEDRx: {
                                                src: "signCHMEDRx";
                                                logic: import('xstate').PromiseActorLogic<{
                                                    signedPrescription: string;
                                                    generatedPdf?: string;
                                                }, {
                                                    encodedCHMED?: string;
                                                    shouldGeneratePdf: boolean;
                                                    parent: import('xstate').ActorRef<import('xstate').AnyMachineSnapshot, import('../../core').PrescriptionSignEvents>;
                                                    hinClient: import('../../core/integration/hin').HINClient;
                                                    sessionToken?: string;
                                                    recover: boolean;
                                                }, import('xstate').EventObject>;
                                                id: string | undefined;
                                            };
                                            errorHandler: {
                                                src: "errorHandler";
                                                logic: import('xstate').CallbackActorLogic<import('xstate').AnyEventObject, {
                                                    error: DomainError;
                                                }, import('xstate').EventObject>;
                                                id: string | undefined;
                                            };
                                            successHandler: {
                                                src: "successHandler";
                                                logic: import('xstate').CallbackActorLogic<import('xstate').AnyEventObject, {
                                                    signedCHMED?: string;
                                                    generatedPdf?: string;
                                                }, import('xstate').EventObject>;
                                                id: string | undefined;
                                            };
                                        }>, never, never, never, never>;
                                    };
                                };
                                readonly invoke: {
                                    readonly id: "openPopup";
                                    readonly input: ({ context }: {
                                        context: import('../../core').PrescriptionSignContext;
                                        event: {
                                            type: "OPEN_POPUP";
                                            popupRef: Window | null;
                                        } | {
                                            type: "CLOSE_POPUP";
                                        } | {
                                            type: "START";
                                            encodedCHMED: string;
                                            shouldGeneratePdf: boolean;
                                        } | {
                                            type: "TERMINATE";
                                        } | {
                                            type: "VERIFY_SESSION";
                                        } | {
                                            type: "REFRESH_TOKEN";
                                        } | {
                                            type: "GET_TOKEN";
                                        } | {
                                            type: "GET_SAML_AUTH_CODE";
                                            recoverable?: boolean;
                                            sessionToken: string;
                                        } | {
                                            type: "GET_SAML_AUTH_HANDLE";
                                            authCode: string;
                                        } | {
                                            type: "VALIDATE_CHMED";
                                            sessionToken: string;
                                        } | {
                                            type: "xstate.done.actor.getSAMLAuthHandle";
                                            sessionToken: string;
                                            recoverable?: boolean;
                                        } | {
                                            type: "SIGN_PRESCRIPTION";
                                            sessionToken: string;
                                            recoverable?: boolean;
                                        } | {
                                            type: "AUTHENTICATION_SUCCESS";
                                        } | {
                                            type: "ERROR";
                                            error: DomainError;
                                        } | {
                                            type: "UNAUTHORIZED_TOKEN";
                                        } | {
                                            type: "UNAUTHORIZED_HANDLE";
                                        };
                                        self: import('xstate').ActorRef<import('xstate').MachineSnapshot<import('../../core').PrescriptionSignContext, {
                                            type: "OPEN_POPUP";
                                            popupRef: Window | null;
                                        } | {
                                            type: "CLOSE_POPUP";
                                        } | {
                                            type: "START";
                                            encodedCHMED: string;
                                            shouldGeneratePdf: boolean;
                                        } | {
                                            type: "TERMINATE";
                                        } | {
                                            type: "VERIFY_SESSION";
                                        } | {
                                            type: "REFRESH_TOKEN";
                                        } | {
                                            type: "GET_TOKEN";
                                        } | {
                                            type: "GET_SAML_AUTH_CODE";
                                            recoverable?: boolean;
                                            sessionToken: string;
                                        } | {
                                            type: "GET_SAML_AUTH_HANDLE";
                                            authCode: string;
                                        } | {
                                            type: "VALIDATE_CHMED";
                                            sessionToken: string;
                                        } | {
                                            type: "xstate.done.actor.getSAMLAuthHandle";
                                            sessionToken: string;
                                            recoverable?: boolean;
                                        } | {
                                            type: "SIGN_PRESCRIPTION";
                                            sessionToken: string;
                                            recoverable?: boolean;
                                        } | {
                                            type: "AUTHENTICATION_SUCCESS";
                                        } | {
                                            type: "ERROR";
                                            error: DomainError;
                                        } | {
                                            type: "UNAUTHORIZED_TOKEN";
                                        } | {
                                            type: "UNAUTHORIZED_HANDLE";
                                        }, Record<string, import('xstate').AnyActorRef>, import('xstate').StateValue, string, unknown, any, any>, {
                                            type: "OPEN_POPUP";
                                            popupRef: Window | null;
                                        } | {
                                            type: "CLOSE_POPUP";
                                        } | {
                                            type: "START";
                                            encodedCHMED: string;
                                            shouldGeneratePdf: boolean;
                                        } | {
                                            type: "TERMINATE";
                                        } | {
                                            type: "VERIFY_SESSION";
                                        } | {
                                            type: "REFRESH_TOKEN";
                                        } | {
                                            type: "GET_TOKEN";
                                        } | {
                                            type: "GET_SAML_AUTH_CODE";
                                            recoverable?: boolean;
                                            sessionToken: string;
                                        } | {
                                            type: "GET_SAML_AUTH_HANDLE";
                                            authCode: string;
                                        } | {
                                            type: "VALIDATE_CHMED";
                                            sessionToken: string;
                                        } | {
                                            type: "xstate.done.actor.getSAMLAuthHandle";
                                            sessionToken: string;
                                            recoverable?: boolean;
                                        } | {
                                            type: "SIGN_PRESCRIPTION";
                                            sessionToken: string;
                                            recoverable?: boolean;
                                        } | {
                                            type: "AUTHENTICATION_SUCCESS";
                                        } | {
                                            type: "ERROR";
                                            error: DomainError;
                                        } | {
                                            type: "UNAUTHORIZED_TOKEN";
                                        } | {
                                            type: "UNAUTHORIZED_HANDLE";
                                        }, import('xstate').AnyEventObject>;
                                    }) => {
                                        sessionToken: string | undefined;
                                        hinClient: import('../../core/integration/hin').HINClient;
                                    };
                                    readonly src: "openPopup";
                                };
                            };
                            readonly Open: {
                                readonly on: {
                                    readonly CLOSE_POPUP: {
                                        readonly target: "Closed";
                                    };
                                    readonly ERROR: {
                                        readonly target: "Closed";
                                    };
                                };
                                readonly invoke: {
                                    readonly id: "trackPopup";
                                    readonly input: ({ context }: {
                                        context: import('../../core').PrescriptionSignContext;
                                        event: {
                                            type: "OPEN_POPUP";
                                            popupRef: Window | null;
                                        } | {
                                            type: "CLOSE_POPUP";
                                        } | {
                                            type: "START";
                                            encodedCHMED: string;
                                            shouldGeneratePdf: boolean;
                                        } | {
                                            type: "TERMINATE";
                                        } | {
                                            type: "VERIFY_SESSION";
                                        } | {
                                            type: "REFRESH_TOKEN";
                                        } | {
                                            type: "GET_TOKEN";
                                        } | {
                                            type: "GET_SAML_AUTH_CODE";
                                            recoverable?: boolean;
                                            sessionToken: string;
                                        } | {
                                            type: "GET_SAML_AUTH_HANDLE";
                                            authCode: string;
                                        } | {
                                            type: "VALIDATE_CHMED";
                                            sessionToken: string;
                                        } | {
                                            type: "xstate.done.actor.getSAMLAuthHandle";
                                            sessionToken: string;
                                            recoverable?: boolean;
                                        } | {
                                            type: "SIGN_PRESCRIPTION";
                                            sessionToken: string;
                                            recoverable?: boolean;
                                        } | {
                                            type: "AUTHENTICATION_SUCCESS";
                                        } | {
                                            type: "ERROR";
                                            error: DomainError;
                                        } | {
                                            type: "UNAUTHORIZED_TOKEN";
                                        } | {
                                            type: "UNAUTHORIZED_HANDLE";
                                        };
                                        self: import('xstate').ActorRef<import('xstate').MachineSnapshot<import('../../core').PrescriptionSignContext, {
                                            type: "OPEN_POPUP";
                                            popupRef: Window | null;
                                        } | {
                                            type: "CLOSE_POPUP";
                                        } | {
                                            type: "START";
                                            encodedCHMED: string;
                                            shouldGeneratePdf: boolean;
                                        } | {
                                            type: "TERMINATE";
                                        } | {
                                            type: "VERIFY_SESSION";
                                        } | {
                                            type: "REFRESH_TOKEN";
                                        } | {
                                            type: "GET_TOKEN";
                                        } | {
                                            type: "GET_SAML_AUTH_CODE";
                                            recoverable?: boolean;
                                            sessionToken: string;
                                        } | {
                                            type: "GET_SAML_AUTH_HANDLE";
                                            authCode: string;
                                        } | {
                                            type: "VALIDATE_CHMED";
                                            sessionToken: string;
                                        } | {
                                            type: "xstate.done.actor.getSAMLAuthHandle";
                                            sessionToken: string;
                                            recoverable?: boolean;
                                        } | {
                                            type: "SIGN_PRESCRIPTION";
                                            sessionToken: string;
                                            recoverable?: boolean;
                                        } | {
                                            type: "AUTHENTICATION_SUCCESS";
                                        } | {
                                            type: "ERROR";
                                            error: DomainError;
                                        } | {
                                            type: "UNAUTHORIZED_TOKEN";
                                        } | {
                                            type: "UNAUTHORIZED_HANDLE";
                                        }, Record<string, import('xstate').AnyActorRef>, import('xstate').StateValue, string, unknown, any, any>, {
                                            type: "OPEN_POPUP";
                                            popupRef: Window | null;
                                        } | {
                                            type: "CLOSE_POPUP";
                                        } | {
                                            type: "START";
                                            encodedCHMED: string;
                                            shouldGeneratePdf: boolean;
                                        } | {
                                            type: "TERMINATE";
                                        } | {
                                            type: "VERIFY_SESSION";
                                        } | {
                                            type: "REFRESH_TOKEN";
                                        } | {
                                            type: "GET_TOKEN";
                                        } | {
                                            type: "GET_SAML_AUTH_CODE";
                                            recoverable?: boolean;
                                            sessionToken: string;
                                        } | {
                                            type: "GET_SAML_AUTH_HANDLE";
                                            authCode: string;
                                        } | {
                                            type: "VALIDATE_CHMED";
                                            sessionToken: string;
                                        } | {
                                            type: "xstate.done.actor.getSAMLAuthHandle";
                                            sessionToken: string;
                                            recoverable?: boolean;
                                        } | {
                                            type: "SIGN_PRESCRIPTION";
                                            sessionToken: string;
                                            recoverable?: boolean;
                                        } | {
                                            type: "AUTHENTICATION_SUCCESS";
                                        } | {
                                            type: "ERROR";
                                            error: DomainError;
                                        } | {
                                            type: "UNAUTHORIZED_TOKEN";
                                        } | {
                                            type: "UNAUTHORIZED_HANDLE";
                                        }, import('xstate').AnyEventObject>;
                                    }) => {
                                        popupRef: Window | null;
                                    };
                                    readonly src: "trackPopup";
                                };
                            };
                            readonly Closed: {
                                readonly type: "final";
                                readonly entry: import('xstate').ActionFunction<import('../../core').PrescriptionSignContext, {
                                    type: "OPEN_POPUP";
                                    popupRef: Window | null;
                                } | {
                                    type: "CLOSE_POPUP";
                                } | {
                                    type: "START";
                                    encodedCHMED: string;
                                    shouldGeneratePdf: boolean;
                                } | {
                                    type: "TERMINATE";
                                } | {
                                    type: "VERIFY_SESSION";
                                } | {
                                    type: "REFRESH_TOKEN";
                                } | {
                                    type: "GET_TOKEN";
                                } | {
                                    type: "GET_SAML_AUTH_CODE";
                                    recoverable?: boolean;
                                    sessionToken: string;
                                } | {
                                    type: "GET_SAML_AUTH_HANDLE";
                                    authCode: string;
                                } | {
                                    type: "VALIDATE_CHMED";
                                    sessionToken: string;
                                } | {
                                    type: "xstate.done.actor.getSAMLAuthHandle";
                                    sessionToken: string;
                                    recoverable?: boolean;
                                } | {
                                    type: "SIGN_PRESCRIPTION";
                                    sessionToken: string;
                                    recoverable?: boolean;
                                } | {
                                    type: "AUTHENTICATION_SUCCESS";
                                } | {
                                    type: "ERROR";
                                    error: DomainError;
                                } | {
                                    type: "UNAUTHORIZED_TOKEN";
                                } | {
                                    type: "UNAUTHORIZED_HANDLE";
                                }, {
                                    type: "OPEN_POPUP";
                                    popupRef: Window | null;
                                } | {
                                    type: "CLOSE_POPUP";
                                } | {
                                    type: "START";
                                    encodedCHMED: string;
                                    shouldGeneratePdf: boolean;
                                } | {
                                    type: "TERMINATE";
                                } | {
                                    type: "VERIFY_SESSION";
                                } | {
                                    type: "REFRESH_TOKEN";
                                } | {
                                    type: "GET_TOKEN";
                                } | {
                                    type: "GET_SAML_AUTH_CODE";
                                    recoverable?: boolean;
                                    sessionToken: string;
                                } | {
                                    type: "GET_SAML_AUTH_HANDLE";
                                    authCode: string;
                                } | {
                                    type: "VALIDATE_CHMED";
                                    sessionToken: string;
                                } | {
                                    type: "xstate.done.actor.getSAMLAuthHandle";
                                    sessionToken: string;
                                    recoverable?: boolean;
                                } | {
                                    type: "SIGN_PRESCRIPTION";
                                    sessionToken: string;
                                    recoverable?: boolean;
                                } | {
                                    type: "AUTHENTICATION_SUCCESS";
                                } | {
                                    type: "ERROR";
                                    error: DomainError;
                                } | {
                                    type: "UNAUTHORIZED_TOKEN";
                                } | {
                                    type: "UNAUTHORIZED_HANDLE";
                                }, undefined, import('xstate').Values<{
                                    openPopup: {
                                        src: "openPopup";
                                        logic: import('xstate').CallbackActorLogic<import('xstate').AnyEventObject, {
                                            sessionToken?: string;
                                            hinClient: import('../../core/integration/hin').HINClient;
                                        }, import('xstate').EventObject>;
                                        id: string | undefined;
                                    };
                                    trackPopup: {
                                        src: "trackPopup";
                                        logic: import('xstate').CallbackActorLogic<import('xstate').AnyEventObject, {
                                            popupRef: Window | null;
                                        }, import('xstate').EventObject>;
                                        id: string | undefined;
                                    };
                                    listenAuthenticationMessage: {
                                        src: "listenAuthenticationMessage";
                                        logic: import('xstate').CallbackActorLogic<import('xstate').AnyEventObject, {
                                            hinClient: import('../../core/integration/hin').HINClient;
                                            accessToken: string;
                                        }, import('xstate').EventObject>;
                                        id: string | undefined;
                                    };
                                    listenSamlAuthMessage: {
                                        src: "listenSamlAuthMessage";
                                        logic: import('xstate').CallbackActorLogic<import('xstate').AnyEventObject, {
                                            hinClient: import('../../core/integration/hin').HINClient;
                                        }, import('xstate').EventObject>;
                                        id: string | undefined;
                                    };
                                    validateCHMED: {
                                        src: "validateCHMED";
                                        logic: import('xstate').PromiseActorLogic<void, {
                                            encodedCHMED?: string;
                                            parent: import('xstate').ActorRef<import('xstate').AnyMachineSnapshot, import('../../core').PrescriptionSignEvents>;
                                            hinClient: import('../../core/integration/hin').HINClient;
                                            sessionToken?: string;
                                        }, import('xstate').EventObject>;
                                        id: string | undefined;
                                    };
                                    verifySession: {
                                        src: "verifySession";
                                        logic: import('xstate').PromiseActorLogic<void, {
                                            parent: import('xstate').ActorRef<import('xstate').AnyMachineSnapshot, import('../../core').PrescriptionSignEvents>;
                                            hinClient: import('../../core/integration/hin').HINClient;
                                            sessionToken?: string;
                                        }, import('xstate').EventObject>;
                                        id: string | undefined;
                                    };
                                    initOAuth: {
                                        src: "initOAuth";
                                        logic: import('xstate').PromiseActorLogic<void, {
                                            parent: import('xstate').ActorRef<import('xstate').AnyMachineSnapshot, import('../../core').PrescriptionSignEvents>;
                                            popupRef: Window | null;
                                            hinClient: import('../../core/integration/hin').HINClient;
                                        }, import('xstate').EventObject>;
                                        id: string | undefined;
                                    };
                                    listenOAuthMessage: {
                                        src: "listenOAuthMessage";
                                        logic: import('xstate').CallbackActorLogic<import('xstate').AnyEventObject, {
                                            hinClient: import('../../core/integration/hin').HINClient;
                                            sessionToken?: string;
                                        }, import('xstate').EventObject>;
                                        id: string | undefined;
                                    };
                                    refreshToken: {
                                        src: "refreshToken";
                                        logic: import('xstate').PromiseActorLogic<{
                                            sessionToken: string;
                                        }, {
                                            hinClient: import('../../core/integration/hin').HINClient;
                                            sessionToken?: string;
                                        }, import('xstate').EventObject>;
                                        id: string | undefined;
                                    };
                                    initSAMLAuthCode: {
                                        src: "initSAMLAuthCode";
                                        logic: import('xstate').PromiseActorLogic<void, {
                                            parent: import('xstate').ActorRef<import('xstate').AnyMachineSnapshot, import('../../core').PrescriptionSignEvents>;
                                            popupRef: Window | null;
                                            hinClient: import('../../core/integration/hin').HINClient;
                                            recover: boolean;
                                            sessionToken?: string;
                                        }, import('xstate').EventObject>;
                                        id: string | undefined;
                                    };
                                    listenSAMLAuthCodeMessage: {
                                        src: "listenSAMLAuthCodeMessage";
                                        logic: import('xstate').CallbackActorLogic<import('xstate').AnyEventObject, {
                                            hinClient: import('../../core/integration/hin').HINClient;
                                        }, import('xstate').EventObject>;
                                        id: string | undefined;
                                    };
                                    getSAMLAuthHandle: {
                                        src: "getSAMLAuthHandle";
                                        logic: import('xstate').PromiseActorLogic<{
                                            sessionToken: string;
                                        }, {
                                            parent: import('xstate').ActorRef<import('xstate').AnyMachineSnapshot, import('../../core').PrescriptionSignEvents>;
                                            authCode: string;
                                            hinClient: import('../../core/integration/hin').HINClient;
                                            sessionToken?: string;
                                        }, import('xstate').EventObject>;
                                        id: string | undefined;
                                    };
                                    signCHMEDRx: {
                                        src: "signCHMEDRx";
                                        logic: import('xstate').PromiseActorLogic<{
                                            signedPrescription: string;
                                            generatedPdf?: string;
                                        }, {
                                            encodedCHMED?: string;
                                            shouldGeneratePdf: boolean;
                                            parent: import('xstate').ActorRef<import('xstate').AnyMachineSnapshot, import('../../core').PrescriptionSignEvents>;
                                            hinClient: import('../../core/integration/hin').HINClient;
                                            sessionToken?: string;
                                            recover: boolean;
                                        }, import('xstate').EventObject>;
                                        id: string | undefined;
                                    };
                                    errorHandler: {
                                        src: "errorHandler";
                                        logic: import('xstate').CallbackActorLogic<import('xstate').AnyEventObject, {
                                            error: DomainError;
                                        }, import('xstate').EventObject>;
                                        id: string | undefined;
                                    };
                                    successHandler: {
                                        src: "successHandler";
                                        logic: import('xstate').CallbackActorLogic<import('xstate').AnyEventObject, {
                                            signedCHMED?: string;
                                            generatedPdf?: string;
                                        }, import('xstate').EventObject>;
                                        id: string | undefined;
                                    };
                                }>, never, never, never, never>;
                            };
                        };
                    };
                    readonly Signing: {
                        readonly initial: "Authentication";
                        readonly states: {
                            readonly Authentication: {
                                readonly on: {
                                    readonly AUTHENTICATION_SUCCESS: {
                                        readonly target: "SAMLAuth";
                                    };
                                    readonly ERROR: {
                                        readonly target: "Error";
                                        readonly actions: readonly [{
                                            readonly type: "closePopup";
                                        }];
                                    };
                                    readonly TERMINATE: {
                                        readonly target: "End";
                                        readonly actions: readonly [{
                                            readonly type: "closePopup";
                                        }];
                                    };
                                };
                                readonly invoke: {
                                    readonly id: "listenAuthenticationMessage";
                                    readonly input: ({ context }: {
                                        context: import('../../core').PrescriptionSignContext;
                                        event: {
                                            type: "OPEN_POPUP";
                                            popupRef: Window | null;
                                        } | {
                                            type: "CLOSE_POPUP";
                                        } | {
                                            type: "START";
                                            encodedCHMED: string;
                                            shouldGeneratePdf: boolean;
                                        } | {
                                            type: "TERMINATE";
                                        } | {
                                            type: "VERIFY_SESSION";
                                        } | {
                                            type: "REFRESH_TOKEN";
                                        } | {
                                            type: "GET_TOKEN";
                                        } | {
                                            type: "GET_SAML_AUTH_CODE";
                                            recoverable?: boolean;
                                            sessionToken: string;
                                        } | {
                                            type: "GET_SAML_AUTH_HANDLE";
                                            authCode: string;
                                        } | {
                                            type: "VALIDATE_CHMED";
                                            sessionToken: string;
                                        } | {
                                            type: "xstate.done.actor.getSAMLAuthHandle";
                                            sessionToken: string;
                                            recoverable?: boolean;
                                        } | {
                                            type: "SIGN_PRESCRIPTION";
                                            sessionToken: string;
                                            recoverable?: boolean;
                                        } | {
                                            type: "AUTHENTICATION_SUCCESS";
                                        } | {
                                            type: "ERROR";
                                            error: DomainError;
                                        } | {
                                            type: "UNAUTHORIZED_TOKEN";
                                        } | {
                                            type: "UNAUTHORIZED_HANDLE";
                                        };
                                        self: import('xstate').ActorRef<import('xstate').MachineSnapshot<import('../../core').PrescriptionSignContext, {
                                            type: "OPEN_POPUP";
                                            popupRef: Window | null;
                                        } | {
                                            type: "CLOSE_POPUP";
                                        } | {
                                            type: "START";
                                            encodedCHMED: string;
                                            shouldGeneratePdf: boolean;
                                        } | {
                                            type: "TERMINATE";
                                        } | {
                                            type: "VERIFY_SESSION";
                                        } | {
                                            type: "REFRESH_TOKEN";
                                        } | {
                                            type: "GET_TOKEN";
                                        } | {
                                            type: "GET_SAML_AUTH_CODE";
                                            recoverable?: boolean;
                                            sessionToken: string;
                                        } | {
                                            type: "GET_SAML_AUTH_HANDLE";
                                            authCode: string;
                                        } | {
                                            type: "VALIDATE_CHMED";
                                            sessionToken: string;
                                        } | {
                                            type: "xstate.done.actor.getSAMLAuthHandle";
                                            sessionToken: string;
                                            recoverable?: boolean;
                                        } | {
                                            type: "SIGN_PRESCRIPTION";
                                            sessionToken: string;
                                            recoverable?: boolean;
                                        } | {
                                            type: "AUTHENTICATION_SUCCESS";
                                        } | {
                                            type: "ERROR";
                                            error: DomainError;
                                        } | {
                                            type: "UNAUTHORIZED_TOKEN";
                                        } | {
                                            type: "UNAUTHORIZED_HANDLE";
                                        }, Record<string, import('xstate').AnyActorRef>, import('xstate').StateValue, string, unknown, any, any>, {
                                            type: "OPEN_POPUP";
                                            popupRef: Window | null;
                                        } | {
                                            type: "CLOSE_POPUP";
                                        } | {
                                            type: "START";
                                            encodedCHMED: string;
                                            shouldGeneratePdf: boolean;
                                        } | {
                                            type: "TERMINATE";
                                        } | {
                                            type: "VERIFY_SESSION";
                                        } | {
                                            type: "REFRESH_TOKEN";
                                        } | {
                                            type: "GET_TOKEN";
                                        } | {
                                            type: "GET_SAML_AUTH_CODE";
                                            recoverable?: boolean;
                                            sessionToken: string;
                                        } | {
                                            type: "GET_SAML_AUTH_HANDLE";
                                            authCode: string;
                                        } | {
                                            type: "VALIDATE_CHMED";
                                            sessionToken: string;
                                        } | {
                                            type: "xstate.done.actor.getSAMLAuthHandle";
                                            sessionToken: string;
                                            recoverable?: boolean;
                                        } | {
                                            type: "SIGN_PRESCRIPTION";
                                            sessionToken: string;
                                            recoverable?: boolean;
                                        } | {
                                            type: "AUTHENTICATION_SUCCESS";
                                        } | {
                                            type: "ERROR";
                                            error: DomainError;
                                        } | {
                                            type: "UNAUTHORIZED_TOKEN";
                                        } | {
                                            type: "UNAUTHORIZED_HANDLE";
                                        }, import('xstate').AnyEventObject>;
                                    }) => {
                                        accessToken: string;
                                        hinClient: import('../../core/integration/hin').HINClient;
                                    };
                                    readonly src: "listenAuthenticationMessage";
                                    readonly onError: {
                                        readonly target: "Error";
                                        readonly actions: readonly [{
                                            readonly type: "closePopup";
                                        }];
                                    };
                                };
                            };
                            readonly SAMLAuth: {
                                readonly on: {
                                    readonly VALIDATE_CHMED: {
                                        readonly target: "ValidatingCHMED";
                                        readonly actions: readonly [{
                                            readonly type: "setAccessToken";
                                        }];
                                    };
                                    readonly ERROR: {
                                        readonly target: "Error";
                                    };
                                    readonly TERMINATE: {
                                        readonly target: "End";
                                        readonly actions: readonly [{
                                            readonly type: "closePopup";
                                        }];
                                    };
                                };
                                readonly invoke: {
                                    readonly id: "listenSamlAuthMessage";
                                    readonly input: ({ context }: {
                                        context: import('../../core').PrescriptionSignContext;
                                        event: {
                                            type: "OPEN_POPUP";
                                            popupRef: Window | null;
                                        } | {
                                            type: "CLOSE_POPUP";
                                        } | {
                                            type: "START";
                                            encodedCHMED: string;
                                            shouldGeneratePdf: boolean;
                                        } | {
                                            type: "TERMINATE";
                                        } | {
                                            type: "VERIFY_SESSION";
                                        } | {
                                            type: "REFRESH_TOKEN";
                                        } | {
                                            type: "GET_TOKEN";
                                        } | {
                                            type: "GET_SAML_AUTH_CODE";
                                            recoverable?: boolean;
                                            sessionToken: string;
                                        } | {
                                            type: "GET_SAML_AUTH_HANDLE";
                                            authCode: string;
                                        } | {
                                            type: "VALIDATE_CHMED";
                                            sessionToken: string;
                                        } | {
                                            type: "xstate.done.actor.getSAMLAuthHandle";
                                            sessionToken: string;
                                            recoverable?: boolean;
                                        } | {
                                            type: "SIGN_PRESCRIPTION";
                                            sessionToken: string;
                                            recoverable?: boolean;
                                        } | {
                                            type: "AUTHENTICATION_SUCCESS";
                                        } | {
                                            type: "ERROR";
                                            error: DomainError;
                                        } | {
                                            type: "UNAUTHORIZED_TOKEN";
                                        } | {
                                            type: "UNAUTHORIZED_HANDLE";
                                        };
                                        self: import('xstate').ActorRef<import('xstate').MachineSnapshot<import('../../core').PrescriptionSignContext, {
                                            type: "OPEN_POPUP";
                                            popupRef: Window | null;
                                        } | {
                                            type: "CLOSE_POPUP";
                                        } | {
                                            type: "START";
                                            encodedCHMED: string;
                                            shouldGeneratePdf: boolean;
                                        } | {
                                            type: "TERMINATE";
                                        } | {
                                            type: "VERIFY_SESSION";
                                        } | {
                                            type: "REFRESH_TOKEN";
                                        } | {
                                            type: "GET_TOKEN";
                                        } | {
                                            type: "GET_SAML_AUTH_CODE";
                                            recoverable?: boolean;
                                            sessionToken: string;
                                        } | {
                                            type: "GET_SAML_AUTH_HANDLE";
                                            authCode: string;
                                        } | {
                                            type: "VALIDATE_CHMED";
                                            sessionToken: string;
                                        } | {
                                            type: "xstate.done.actor.getSAMLAuthHandle";
                                            sessionToken: string;
                                            recoverable?: boolean;
                                        } | {
                                            type: "SIGN_PRESCRIPTION";
                                            sessionToken: string;
                                            recoverable?: boolean;
                                        } | {
                                            type: "AUTHENTICATION_SUCCESS";
                                        } | {
                                            type: "ERROR";
                                            error: DomainError;
                                        } | {
                                            type: "UNAUTHORIZED_TOKEN";
                                        } | {
                                            type: "UNAUTHORIZED_HANDLE";
                                        }, Record<string, import('xstate').AnyActorRef>, import('xstate').StateValue, string, unknown, any, any>, {
                                            type: "OPEN_POPUP";
                                            popupRef: Window | null;
                                        } | {
                                            type: "CLOSE_POPUP";
                                        } | {
                                            type: "START";
                                            encodedCHMED: string;
                                            shouldGeneratePdf: boolean;
                                        } | {
                                            type: "TERMINATE";
                                        } | {
                                            type: "VERIFY_SESSION";
                                        } | {
                                            type: "REFRESH_TOKEN";
                                        } | {
                                            type: "GET_TOKEN";
                                        } | {
                                            type: "GET_SAML_AUTH_CODE";
                                            recoverable?: boolean;
                                            sessionToken: string;
                                        } | {
                                            type: "GET_SAML_AUTH_HANDLE";
                                            authCode: string;
                                        } | {
                                            type: "VALIDATE_CHMED";
                                            sessionToken: string;
                                        } | {
                                            type: "xstate.done.actor.getSAMLAuthHandle";
                                            sessionToken: string;
                                            recoverable?: boolean;
                                        } | {
                                            type: "SIGN_PRESCRIPTION";
                                            sessionToken: string;
                                            recoverable?: boolean;
                                        } | {
                                            type: "AUTHENTICATION_SUCCESS";
                                        } | {
                                            type: "ERROR";
                                            error: DomainError;
                                        } | {
                                            type: "UNAUTHORIZED_TOKEN";
                                        } | {
                                            type: "UNAUTHORIZED_HANDLE";
                                        }, import('xstate').AnyEventObject>;
                                    }) => {
                                        hinClient: import('../../core/integration/hin').HINClient;
                                    };
                                    readonly src: "listenSamlAuthMessage";
                                };
                            };
                            readonly ValidatingCHMED: {
                                readonly on: {
                                    readonly VERIFY_SESSION: {
                                        readonly target: "VerifySessionGuard";
                                    };
                                    readonly ERROR: {
                                        readonly target: "Error";
                                    };
                                    readonly TERMINATE: {
                                        readonly target: "End";
                                        readonly actions: readonly [{
                                            readonly type: "closePopup";
                                        }];
                                    };
                                };
                                readonly invoke: {
                                    readonly id: "validateCHMED";
                                    readonly src: "validateCHMED";
                                    readonly input: ({ context, self }: {
                                        context: import('../../core').PrescriptionSignContext;
                                        event: {
                                            type: "OPEN_POPUP";
                                            popupRef: Window | null;
                                        } | {
                                            type: "CLOSE_POPUP";
                                        } | {
                                            type: "START";
                                            encodedCHMED: string;
                                            shouldGeneratePdf: boolean;
                                        } | {
                                            type: "TERMINATE";
                                        } | {
                                            type: "VERIFY_SESSION";
                                        } | {
                                            type: "REFRESH_TOKEN";
                                        } | {
                                            type: "GET_TOKEN";
                                        } | {
                                            type: "GET_SAML_AUTH_CODE";
                                            recoverable?: boolean;
                                            sessionToken: string;
                                        } | {
                                            type: "GET_SAML_AUTH_HANDLE";
                                            authCode: string;
                                        } | {
                                            type: "VALIDATE_CHMED";
                                            sessionToken: string;
                                        } | {
                                            type: "xstate.done.actor.getSAMLAuthHandle";
                                            sessionToken: string;
                                            recoverable?: boolean;
                                        } | {
                                            type: "SIGN_PRESCRIPTION";
                                            sessionToken: string;
                                            recoverable?: boolean;
                                        } | {
                                            type: "AUTHENTICATION_SUCCESS";
                                        } | {
                                            type: "ERROR";
                                            error: DomainError;
                                        } | {
                                            type: "UNAUTHORIZED_TOKEN";
                                        } | {
                                            type: "UNAUTHORIZED_HANDLE";
                                        };
                                        self: import('xstate').ActorRef<import('xstate').MachineSnapshot<import('../../core').PrescriptionSignContext, {
                                            type: "OPEN_POPUP";
                                            popupRef: Window | null;
                                        } | {
                                            type: "CLOSE_POPUP";
                                        } | {
                                            type: "START";
                                            encodedCHMED: string;
                                            shouldGeneratePdf: boolean;
                                        } | {
                                            type: "TERMINATE";
                                        } | {
                                            type: "VERIFY_SESSION";
                                        } | {
                                            type: "REFRESH_TOKEN";
                                        } | {
                                            type: "GET_TOKEN";
                                        } | {
                                            type: "GET_SAML_AUTH_CODE";
                                            recoverable?: boolean;
                                            sessionToken: string;
                                        } | {
                                            type: "GET_SAML_AUTH_HANDLE";
                                            authCode: string;
                                        } | {
                                            type: "VALIDATE_CHMED";
                                            sessionToken: string;
                                        } | {
                                            type: "xstate.done.actor.getSAMLAuthHandle";
                                            sessionToken: string;
                                            recoverable?: boolean;
                                        } | {
                                            type: "SIGN_PRESCRIPTION";
                                            sessionToken: string;
                                            recoverable?: boolean;
                                        } | {
                                            type: "AUTHENTICATION_SUCCESS";
                                        } | {
                                            type: "ERROR";
                                            error: DomainError;
                                        } | {
                                            type: "UNAUTHORIZED_TOKEN";
                                        } | {
                                            type: "UNAUTHORIZED_HANDLE";
                                        }, Record<string, import('xstate').AnyActorRef>, import('xstate').StateValue, string, unknown, any, any>, {
                                            type: "OPEN_POPUP";
                                            popupRef: Window | null;
                                        } | {
                                            type: "CLOSE_POPUP";
                                        } | {
                                            type: "START";
                                            encodedCHMED: string;
                                            shouldGeneratePdf: boolean;
                                        } | {
                                            type: "TERMINATE";
                                        } | {
                                            type: "VERIFY_SESSION";
                                        } | {
                                            type: "REFRESH_TOKEN";
                                        } | {
                                            type: "GET_TOKEN";
                                        } | {
                                            type: "GET_SAML_AUTH_CODE";
                                            recoverable?: boolean;
                                            sessionToken: string;
                                        } | {
                                            type: "GET_SAML_AUTH_HANDLE";
                                            authCode: string;
                                        } | {
                                            type: "VALIDATE_CHMED";
                                            sessionToken: string;
                                        } | {
                                            type: "xstate.done.actor.getSAMLAuthHandle";
                                            sessionToken: string;
                                            recoverable?: boolean;
                                        } | {
                                            type: "SIGN_PRESCRIPTION";
                                            sessionToken: string;
                                            recoverable?: boolean;
                                        } | {
                                            type: "AUTHENTICATION_SUCCESS";
                                        } | {
                                            type: "ERROR";
                                            error: DomainError;
                                        } | {
                                            type: "UNAUTHORIZED_TOKEN";
                                        } | {
                                            type: "UNAUTHORIZED_HANDLE";
                                        }, import('xstate').AnyEventObject>;
                                    }) => {
                                        encodedCHMED: string | undefined;
                                        parent: import('xstate').ActorRef<import('xstate').MachineSnapshot<import('../../core').PrescriptionSignContext, {
                                            type: "OPEN_POPUP";
                                            popupRef: Window | null;
                                        } | {
                                            type: "CLOSE_POPUP";
                                        } | {
                                            type: "START";
                                            encodedCHMED: string;
                                            shouldGeneratePdf: boolean;
                                        } | {
                                            type: "TERMINATE";
                                        } | {
                                            type: "VERIFY_SESSION";
                                        } | {
                                            type: "REFRESH_TOKEN";
                                        } | {
                                            type: "GET_TOKEN";
                                        } | {
                                            type: "GET_SAML_AUTH_CODE";
                                            recoverable?: boolean;
                                            sessionToken: string;
                                        } | {
                                            type: "GET_SAML_AUTH_HANDLE";
                                            authCode: string;
                                        } | {
                                            type: "VALIDATE_CHMED";
                                            sessionToken: string;
                                        } | {
                                            type: "xstate.done.actor.getSAMLAuthHandle";
                                            sessionToken: string;
                                            recoverable?: boolean;
                                        } | {
                                            type: "SIGN_PRESCRIPTION";
                                            sessionToken: string;
                                            recoverable?: boolean;
                                        } | {
                                            type: "AUTHENTICATION_SUCCESS";
                                        } | {
                                            type: "ERROR";
                                            error: DomainError;
                                        } | {
                                            type: "UNAUTHORIZED_TOKEN";
                                        } | {
                                            type: "UNAUTHORIZED_HANDLE";
                                        }, Record<string, import('xstate').AnyActorRef>, import('xstate').StateValue, string, unknown, any, any>, {
                                            type: "OPEN_POPUP";
                                            popupRef: Window | null;
                                        } | {
                                            type: "CLOSE_POPUP";
                                        } | {
                                            type: "START";
                                            encodedCHMED: string;
                                            shouldGeneratePdf: boolean;
                                        } | {
                                            type: "TERMINATE";
                                        } | {
                                            type: "VERIFY_SESSION";
                                        } | {
                                            type: "REFRESH_TOKEN";
                                        } | {
                                            type: "GET_TOKEN";
                                        } | {
                                            type: "GET_SAML_AUTH_CODE";
                                            recoverable?: boolean;
                                            sessionToken: string;
                                        } | {
                                            type: "GET_SAML_AUTH_HANDLE";
                                            authCode: string;
                                        } | {
                                            type: "VALIDATE_CHMED";
                                            sessionToken: string;
                                        } | {
                                            type: "xstate.done.actor.getSAMLAuthHandle";
                                            sessionToken: string;
                                            recoverable?: boolean;
                                        } | {
                                            type: "SIGN_PRESCRIPTION";
                                            sessionToken: string;
                                            recoverable?: boolean;
                                        } | {
                                            type: "AUTHENTICATION_SUCCESS";
                                        } | {
                                            type: "ERROR";
                                            error: DomainError;
                                        } | {
                                            type: "UNAUTHORIZED_TOKEN";
                                        } | {
                                            type: "UNAUTHORIZED_HANDLE";
                                        }, import('xstate').AnyEventObject>;
                                        hinClient: import('../../core/integration/hin').HINClient;
                                        sessionToken: string | undefined;
                                    };
                                };
                            };
                            readonly VerifySessionGuard: {
                                readonly on: {
                                    readonly SIGN_PRESCRIPTION: {
                                        readonly target: "SigningCHMED";
                                    };
                                    readonly GET_SAML_AUTH_CODE: {
                                        readonly target: "SAMLAuthCode";
                                        readonly actions: readonly [{
                                            readonly type: "setAccessToken";
                                        }];
                                    };
                                    readonly REFRESH_TOKEN: {
                                        readonly target: "TokenRefreshing";
                                    };
                                    readonly GET_TOKEN: {
                                        readonly target: "OAuth";
                                    };
                                    readonly TERMINATE: {
                                        readonly target: "End";
                                        readonly actions: readonly [{
                                            readonly type: "closePopup";
                                        }];
                                    };
                                };
                                readonly invoke: {
                                    readonly id: "verifySession";
                                    readonly input: ({ self, context }: {
                                        context: import('../../core').PrescriptionSignContext;
                                        event: {
                                            type: "OPEN_POPUP";
                                            popupRef: Window | null;
                                        } | {
                                            type: "CLOSE_POPUP";
                                        } | {
                                            type: "START";
                                            encodedCHMED: string;
                                            shouldGeneratePdf: boolean;
                                        } | {
                                            type: "TERMINATE";
                                        } | {
                                            type: "VERIFY_SESSION";
                                        } | {
                                            type: "REFRESH_TOKEN";
                                        } | {
                                            type: "GET_TOKEN";
                                        } | {
                                            type: "GET_SAML_AUTH_CODE";
                                            recoverable?: boolean;
                                            sessionToken: string;
                                        } | {
                                            type: "GET_SAML_AUTH_HANDLE";
                                            authCode: string;
                                        } | {
                                            type: "VALIDATE_CHMED";
                                            sessionToken: string;
                                        } | {
                                            type: "xstate.done.actor.getSAMLAuthHandle";
                                            sessionToken: string;
                                            recoverable?: boolean;
                                        } | {
                                            type: "SIGN_PRESCRIPTION";
                                            sessionToken: string;
                                            recoverable?: boolean;
                                        } | {
                                            type: "AUTHENTICATION_SUCCESS";
                                        } | {
                                            type: "ERROR";
                                            error: DomainError;
                                        } | {
                                            type: "UNAUTHORIZED_TOKEN";
                                        } | {
                                            type: "UNAUTHORIZED_HANDLE";
                                        };
                                        self: import('xstate').ActorRef<import('xstate').MachineSnapshot<import('../../core').PrescriptionSignContext, {
                                            type: "OPEN_POPUP";
                                            popupRef: Window | null;
                                        } | {
                                            type: "CLOSE_POPUP";
                                        } | {
                                            type: "START";
                                            encodedCHMED: string;
                                            shouldGeneratePdf: boolean;
                                        } | {
                                            type: "TERMINATE";
                                        } | {
                                            type: "VERIFY_SESSION";
                                        } | {
                                            type: "REFRESH_TOKEN";
                                        } | {
                                            type: "GET_TOKEN";
                                        } | {
                                            type: "GET_SAML_AUTH_CODE";
                                            recoverable?: boolean;
                                            sessionToken: string;
                                        } | {
                                            type: "GET_SAML_AUTH_HANDLE";
                                            authCode: string;
                                        } | {
                                            type: "VALIDATE_CHMED";
                                            sessionToken: string;
                                        } | {
                                            type: "xstate.done.actor.getSAMLAuthHandle";
                                            sessionToken: string;
                                            recoverable?: boolean;
                                        } | {
                                            type: "SIGN_PRESCRIPTION";
                                            sessionToken: string;
                                            recoverable?: boolean;
                                        } | {
                                            type: "AUTHENTICATION_SUCCESS";
                                        } | {
                                            type: "ERROR";
                                            error: DomainError;
                                        } | {
                                            type: "UNAUTHORIZED_TOKEN";
                                        } | {
                                            type: "UNAUTHORIZED_HANDLE";
                                        }, Record<string, import('xstate').AnyActorRef>, import('xstate').StateValue, string, unknown, any, any>, {
                                            type: "OPEN_POPUP";
                                            popupRef: Window | null;
                                        } | {
                                            type: "CLOSE_POPUP";
                                        } | {
                                            type: "START";
                                            encodedCHMED: string;
                                            shouldGeneratePdf: boolean;
                                        } | {
                                            type: "TERMINATE";
                                        } | {
                                            type: "VERIFY_SESSION";
                                        } | {
                                            type: "REFRESH_TOKEN";
                                        } | {
                                            type: "GET_TOKEN";
                                        } | {
                                            type: "GET_SAML_AUTH_CODE";
                                            recoverable?: boolean;
                                            sessionToken: string;
                                        } | {
                                            type: "GET_SAML_AUTH_HANDLE";
                                            authCode: string;
                                        } | {
                                            type: "VALIDATE_CHMED";
                                            sessionToken: string;
                                        } | {
                                            type: "xstate.done.actor.getSAMLAuthHandle";
                                            sessionToken: string;
                                            recoverable?: boolean;
                                        } | {
                                            type: "SIGN_PRESCRIPTION";
                                            sessionToken: string;
                                            recoverable?: boolean;
                                        } | {
                                            type: "AUTHENTICATION_SUCCESS";
                                        } | {
                                            type: "ERROR";
                                            error: DomainError;
                                        } | {
                                            type: "UNAUTHORIZED_TOKEN";
                                        } | {
                                            type: "UNAUTHORIZED_HANDLE";
                                        }, import('xstate').AnyEventObject>;
                                    }) => {
                                        parent: import('xstate').ActorRef<import('xstate').MachineSnapshot<import('../../core').PrescriptionSignContext, {
                                            type: "OPEN_POPUP";
                                            popupRef: Window | null;
                                        } | {
                                            type: "CLOSE_POPUP";
                                        } | {
                                            type: "START";
                                            encodedCHMED: string;
                                            shouldGeneratePdf: boolean;
                                        } | {
                                            type: "TERMINATE";
                                        } | {
                                            type: "VERIFY_SESSION";
                                        } | {
                                            type: "REFRESH_TOKEN";
                                        } | {
                                            type: "GET_TOKEN";
                                        } | {
                                            type: "GET_SAML_AUTH_CODE";
                                            recoverable?: boolean;
                                            sessionToken: string;
                                        } | {
                                            type: "GET_SAML_AUTH_HANDLE";
                                            authCode: string;
                                        } | {
                                            type: "VALIDATE_CHMED";
                                            sessionToken: string;
                                        } | {
                                            type: "xstate.done.actor.getSAMLAuthHandle";
                                            sessionToken: string;
                                            recoverable?: boolean;
                                        } | {
                                            type: "SIGN_PRESCRIPTION";
                                            sessionToken: string;
                                            recoverable?: boolean;
                                        } | {
                                            type: "AUTHENTICATION_SUCCESS";
                                        } | {
                                            type: "ERROR";
                                            error: DomainError;
                                        } | {
                                            type: "UNAUTHORIZED_TOKEN";
                                        } | {
                                            type: "UNAUTHORIZED_HANDLE";
                                        }, Record<string, import('xstate').AnyActorRef>, import('xstate').StateValue, string, unknown, any, any>, {
                                            type: "OPEN_POPUP";
                                            popupRef: Window | null;
                                        } | {
                                            type: "CLOSE_POPUP";
                                        } | {
                                            type: "START";
                                            encodedCHMED: string;
                                            shouldGeneratePdf: boolean;
                                        } | {
                                            type: "TERMINATE";
                                        } | {
                                            type: "VERIFY_SESSION";
                                        } | {
                                            type: "REFRESH_TOKEN";
                                        } | {
                                            type: "GET_TOKEN";
                                        } | {
                                            type: "GET_SAML_AUTH_CODE";
                                            recoverable?: boolean;
                                            sessionToken: string;
                                        } | {
                                            type: "GET_SAML_AUTH_HANDLE";
                                            authCode: string;
                                        } | {
                                            type: "VALIDATE_CHMED";
                                            sessionToken: string;
                                        } | {
                                            type: "xstate.done.actor.getSAMLAuthHandle";
                                            sessionToken: string;
                                            recoverable?: boolean;
                                        } | {
                                            type: "SIGN_PRESCRIPTION";
                                            sessionToken: string;
                                            recoverable?: boolean;
                                        } | {
                                            type: "AUTHENTICATION_SUCCESS";
                                        } | {
                                            type: "ERROR";
                                            error: DomainError;
                                        } | {
                                            type: "UNAUTHORIZED_TOKEN";
                                        } | {
                                            type: "UNAUTHORIZED_HANDLE";
                                        }, import('xstate').AnyEventObject>;
                                        hinClient: import('../../core/integration/hin').HINClient;
                                        sessionToken: string | undefined;
                                    };
                                    readonly src: "verifySession";
                                };
                            };
                            readonly OAuth: {
                                readonly on: {
                                    readonly GET_SAML_AUTH_CODE: {
                                        readonly target: "SAMLAuthCode";
                                        readonly actions: readonly [{
                                            readonly type: "setAccessToken";
                                        }];
                                    };
                                    readonly ERROR: {
                                        readonly target: "Error";
                                    };
                                    readonly TERMINATE: {
                                        readonly target: "End";
                                        readonly actions: readonly [{
                                            readonly type: "closePopup";
                                        }];
                                    };
                                };
                                readonly invoke: readonly [{
                                    readonly id: "initOAuth";
                                    readonly input: ({ self, context }: {
                                        context: import('../../core').PrescriptionSignContext;
                                        event: {
                                            type: "OPEN_POPUP";
                                            popupRef: Window | null;
                                        } | {
                                            type: "CLOSE_POPUP";
                                        } | {
                                            type: "START";
                                            encodedCHMED: string;
                                            shouldGeneratePdf: boolean;
                                        } | {
                                            type: "TERMINATE";
                                        } | {
                                            type: "VERIFY_SESSION";
                                        } | {
                                            type: "REFRESH_TOKEN";
                                        } | {
                                            type: "GET_TOKEN";
                                        } | {
                                            type: "GET_SAML_AUTH_CODE";
                                            recoverable?: boolean;
                                            sessionToken: string;
                                        } | {
                                            type: "GET_SAML_AUTH_HANDLE";
                                            authCode: string;
                                        } | {
                                            type: "VALIDATE_CHMED";
                                            sessionToken: string;
                                        } | {
                                            type: "xstate.done.actor.getSAMLAuthHandle";
                                            sessionToken: string;
                                            recoverable?: boolean;
                                        } | {
                                            type: "SIGN_PRESCRIPTION";
                                            sessionToken: string;
                                            recoverable?: boolean;
                                        } | {
                                            type: "AUTHENTICATION_SUCCESS";
                                        } | {
                                            type: "ERROR";
                                            error: DomainError;
                                        } | {
                                            type: "UNAUTHORIZED_TOKEN";
                                        } | {
                                            type: "UNAUTHORIZED_HANDLE";
                                        };
                                        self: import('xstate').ActorRef<import('xstate').MachineSnapshot<import('../../core').PrescriptionSignContext, {
                                            type: "OPEN_POPUP";
                                            popupRef: Window | null;
                                        } | {
                                            type: "CLOSE_POPUP";
                                        } | {
                                            type: "START";
                                            encodedCHMED: string;
                                            shouldGeneratePdf: boolean;
                                        } | {
                                            type: "TERMINATE";
                                        } | {
                                            type: "VERIFY_SESSION";
                                        } | {
                                            type: "REFRESH_TOKEN";
                                        } | {
                                            type: "GET_TOKEN";
                                        } | {
                                            type: "GET_SAML_AUTH_CODE";
                                            recoverable?: boolean;
                                            sessionToken: string;
                                        } | {
                                            type: "GET_SAML_AUTH_HANDLE";
                                            authCode: string;
                                        } | {
                                            type: "VALIDATE_CHMED";
                                            sessionToken: string;
                                        } | {
                                            type: "xstate.done.actor.getSAMLAuthHandle";
                                            sessionToken: string;
                                            recoverable?: boolean;
                                        } | {
                                            type: "SIGN_PRESCRIPTION";
                                            sessionToken: string;
                                            recoverable?: boolean;
                                        } | {
                                            type: "AUTHENTICATION_SUCCESS";
                                        } | {
                                            type: "ERROR";
                                            error: DomainError;
                                        } | {
                                            type: "UNAUTHORIZED_TOKEN";
                                        } | {
                                            type: "UNAUTHORIZED_HANDLE";
                                        }, Record<string, import('xstate').AnyActorRef>, import('xstate').StateValue, string, unknown, any, any>, {
                                            type: "OPEN_POPUP";
                                            popupRef: Window | null;
                                        } | {
                                            type: "CLOSE_POPUP";
                                        } | {
                                            type: "START";
                                            encodedCHMED: string;
                                            shouldGeneratePdf: boolean;
                                        } | {
                                            type: "TERMINATE";
                                        } | {
                                            type: "VERIFY_SESSION";
                                        } | {
                                            type: "REFRESH_TOKEN";
                                        } | {
                                            type: "GET_TOKEN";
                                        } | {
                                            type: "GET_SAML_AUTH_CODE";
                                            recoverable?: boolean;
                                            sessionToken: string;
                                        } | {
                                            type: "GET_SAML_AUTH_HANDLE";
                                            authCode: string;
                                        } | {
                                            type: "VALIDATE_CHMED";
                                            sessionToken: string;
                                        } | {
                                            type: "xstate.done.actor.getSAMLAuthHandle";
                                            sessionToken: string;
                                            recoverable?: boolean;
                                        } | {
                                            type: "SIGN_PRESCRIPTION";
                                            sessionToken: string;
                                            recoverable?: boolean;
                                        } | {
                                            type: "AUTHENTICATION_SUCCESS";
                                        } | {
                                            type: "ERROR";
                                            error: DomainError;
                                        } | {
                                            type: "UNAUTHORIZED_TOKEN";
                                        } | {
                                            type: "UNAUTHORIZED_HANDLE";
                                        }, import('xstate').AnyEventObject>;
                                    }) => {
                                        parent: import('xstate').ActorRef<import('xstate').MachineSnapshot<import('../../core').PrescriptionSignContext, {
                                            type: "OPEN_POPUP";
                                            popupRef: Window | null;
                                        } | {
                                            type: "CLOSE_POPUP";
                                        } | {
                                            type: "START";
                                            encodedCHMED: string;
                                            shouldGeneratePdf: boolean;
                                        } | {
                                            type: "TERMINATE";
                                        } | {
                                            type: "VERIFY_SESSION";
                                        } | {
                                            type: "REFRESH_TOKEN";
                                        } | {
                                            type: "GET_TOKEN";
                                        } | {
                                            type: "GET_SAML_AUTH_CODE";
                                            recoverable?: boolean;
                                            sessionToken: string;
                                        } | {
                                            type: "GET_SAML_AUTH_HANDLE";
                                            authCode: string;
                                        } | {
                                            type: "VALIDATE_CHMED";
                                            sessionToken: string;
                                        } | {
                                            type: "xstate.done.actor.getSAMLAuthHandle";
                                            sessionToken: string;
                                            recoverable?: boolean;
                                        } | {
                                            type: "SIGN_PRESCRIPTION";
                                            sessionToken: string;
                                            recoverable?: boolean;
                                        } | {
                                            type: "AUTHENTICATION_SUCCESS";
                                        } | {
                                            type: "ERROR";
                                            error: DomainError;
                                        } | {
                                            type: "UNAUTHORIZED_TOKEN";
                                        } | {
                                            type: "UNAUTHORIZED_HANDLE";
                                        }, Record<string, import('xstate').AnyActorRef>, import('xstate').StateValue, string, unknown, any, any>, {
                                            type: "OPEN_POPUP";
                                            popupRef: Window | null;
                                        } | {
                                            type: "CLOSE_POPUP";
                                        } | {
                                            type: "START";
                                            encodedCHMED: string;
                                            shouldGeneratePdf: boolean;
                                        } | {
                                            type: "TERMINATE";
                                        } | {
                                            type: "VERIFY_SESSION";
                                        } | {
                                            type: "REFRESH_TOKEN";
                                        } | {
                                            type: "GET_TOKEN";
                                        } | {
                                            type: "GET_SAML_AUTH_CODE";
                                            recoverable?: boolean;
                                            sessionToken: string;
                                        } | {
                                            type: "GET_SAML_AUTH_HANDLE";
                                            authCode: string;
                                        } | {
                                            type: "VALIDATE_CHMED";
                                            sessionToken: string;
                                        } | {
                                            type: "xstate.done.actor.getSAMLAuthHandle";
                                            sessionToken: string;
                                            recoverable?: boolean;
                                        } | {
                                            type: "SIGN_PRESCRIPTION";
                                            sessionToken: string;
                                            recoverable?: boolean;
                                        } | {
                                            type: "AUTHENTICATION_SUCCESS";
                                        } | {
                                            type: "ERROR";
                                            error: DomainError;
                                        } | {
                                            type: "UNAUTHORIZED_TOKEN";
                                        } | {
                                            type: "UNAUTHORIZED_HANDLE";
                                        }, import('xstate').AnyEventObject>;
                                        popupRef: Window | null;
                                        hinClient: import('../../core/integration/hin').HINClient;
                                    };
                                    readonly src: "initOAuth";
                                }, {
                                    readonly id: "listenOAuthMessage";
                                    readonly input: ({ context }: {
                                        context: import('../../core').PrescriptionSignContext;
                                        event: {
                                            type: "OPEN_POPUP";
                                            popupRef: Window | null;
                                        } | {
                                            type: "CLOSE_POPUP";
                                        } | {
                                            type: "START";
                                            encodedCHMED: string;
                                            shouldGeneratePdf: boolean;
                                        } | {
                                            type: "TERMINATE";
                                        } | {
                                            type: "VERIFY_SESSION";
                                        } | {
                                            type: "REFRESH_TOKEN";
                                        } | {
                                            type: "GET_TOKEN";
                                        } | {
                                            type: "GET_SAML_AUTH_CODE";
                                            recoverable?: boolean;
                                            sessionToken: string;
                                        } | {
                                            type: "GET_SAML_AUTH_HANDLE";
                                            authCode: string;
                                        } | {
                                            type: "VALIDATE_CHMED";
                                            sessionToken: string;
                                        } | {
                                            type: "xstate.done.actor.getSAMLAuthHandle";
                                            sessionToken: string;
                                            recoverable?: boolean;
                                        } | {
                                            type: "SIGN_PRESCRIPTION";
                                            sessionToken: string;
                                            recoverable?: boolean;
                                        } | {
                                            type: "AUTHENTICATION_SUCCESS";
                                        } | {
                                            type: "ERROR";
                                            error: DomainError;
                                        } | {
                                            type: "UNAUTHORIZED_TOKEN";
                                        } | {
                                            type: "UNAUTHORIZED_HANDLE";
                                        };
                                        self: import('xstate').ActorRef<import('xstate').MachineSnapshot<import('../../core').PrescriptionSignContext, {
                                            type: "OPEN_POPUP";
                                            popupRef: Window | null;
                                        } | {
                                            type: "CLOSE_POPUP";
                                        } | {
                                            type: "START";
                                            encodedCHMED: string;
                                            shouldGeneratePdf: boolean;
                                        } | {
                                            type: "TERMINATE";
                                        } | {
                                            type: "VERIFY_SESSION";
                                        } | {
                                            type: "REFRESH_TOKEN";
                                        } | {
                                            type: "GET_TOKEN";
                                        } | {
                                            type: "GET_SAML_AUTH_CODE";
                                            recoverable?: boolean;
                                            sessionToken: string;
                                        } | {
                                            type: "GET_SAML_AUTH_HANDLE";
                                            authCode: string;
                                        } | {
                                            type: "VALIDATE_CHMED";
                                            sessionToken: string;
                                        } | {
                                            type: "xstate.done.actor.getSAMLAuthHandle";
                                            sessionToken: string;
                                            recoverable?: boolean;
                                        } | {
                                            type: "SIGN_PRESCRIPTION";
                                            sessionToken: string;
                                            recoverable?: boolean;
                                        } | {
                                            type: "AUTHENTICATION_SUCCESS";
                                        } | {
                                            type: "ERROR";
                                            error: DomainError;
                                        } | {
                                            type: "UNAUTHORIZED_TOKEN";
                                        } | {
                                            type: "UNAUTHORIZED_HANDLE";
                                        }, Record<string, import('xstate').AnyActorRef>, import('xstate').StateValue, string, unknown, any, any>, {
                                            type: "OPEN_POPUP";
                                            popupRef: Window | null;
                                        } | {
                                            type: "CLOSE_POPUP";
                                        } | {
                                            type: "START";
                                            encodedCHMED: string;
                                            shouldGeneratePdf: boolean;
                                        } | {
                                            type: "TERMINATE";
                                        } | {
                                            type: "VERIFY_SESSION";
                                        } | {
                                            type: "REFRESH_TOKEN";
                                        } | {
                                            type: "GET_TOKEN";
                                        } | {
                                            type: "GET_SAML_AUTH_CODE";
                                            recoverable?: boolean;
                                            sessionToken: string;
                                        } | {
                                            type: "GET_SAML_AUTH_HANDLE";
                                            authCode: string;
                                        } | {
                                            type: "VALIDATE_CHMED";
                                            sessionToken: string;
                                        } | {
                                            type: "xstate.done.actor.getSAMLAuthHandle";
                                            sessionToken: string;
                                            recoverable?: boolean;
                                        } | {
                                            type: "SIGN_PRESCRIPTION";
                                            sessionToken: string;
                                            recoverable?: boolean;
                                        } | {
                                            type: "AUTHENTICATION_SUCCESS";
                                        } | {
                                            type: "ERROR";
                                            error: DomainError;
                                        } | {
                                            type: "UNAUTHORIZED_TOKEN";
                                        } | {
                                            type: "UNAUTHORIZED_HANDLE";
                                        }, import('xstate').AnyEventObject>;
                                    }) => {
                                        hinClient: import('../../core/integration/hin').HINClient;
                                        sessionToken: string | undefined;
                                    };
                                    readonly src: "listenOAuthMessage";
                                }];
                            };
                            readonly TokenRefreshing: {
                                readonly on: {
                                    readonly TERMINATE: {
                                        readonly target: "End";
                                        readonly actions: readonly [{
                                            readonly type: "closePopup";
                                        }];
                                    };
                                };
                                readonly invoke: {
                                    readonly id: "refreshToken";
                                    readonly input: ({ context }: {
                                        context: import('../../core').PrescriptionSignContext;
                                        event: {
                                            type: "OPEN_POPUP";
                                            popupRef: Window | null;
                                        } | {
                                            type: "CLOSE_POPUP";
                                        } | {
                                            type: "START";
                                            encodedCHMED: string;
                                            shouldGeneratePdf: boolean;
                                        } | {
                                            type: "TERMINATE";
                                        } | {
                                            type: "VERIFY_SESSION";
                                        } | {
                                            type: "REFRESH_TOKEN";
                                        } | {
                                            type: "GET_TOKEN";
                                        } | {
                                            type: "GET_SAML_AUTH_CODE";
                                            recoverable?: boolean;
                                            sessionToken: string;
                                        } | {
                                            type: "GET_SAML_AUTH_HANDLE";
                                            authCode: string;
                                        } | {
                                            type: "VALIDATE_CHMED";
                                            sessionToken: string;
                                        } | {
                                            type: "xstate.done.actor.getSAMLAuthHandle";
                                            sessionToken: string;
                                            recoverable?: boolean;
                                        } | {
                                            type: "SIGN_PRESCRIPTION";
                                            sessionToken: string;
                                            recoverable?: boolean;
                                        } | {
                                            type: "AUTHENTICATION_SUCCESS";
                                        } | {
                                            type: "ERROR";
                                            error: DomainError;
                                        } | {
                                            type: "UNAUTHORIZED_TOKEN";
                                        } | {
                                            type: "UNAUTHORIZED_HANDLE";
                                        };
                                        self: import('xstate').ActorRef<import('xstate').MachineSnapshot<import('../../core').PrescriptionSignContext, {
                                            type: "OPEN_POPUP";
                                            popupRef: Window | null;
                                        } | {
                                            type: "CLOSE_POPUP";
                                        } | {
                                            type: "START";
                                            encodedCHMED: string;
                                            shouldGeneratePdf: boolean;
                                        } | {
                                            type: "TERMINATE";
                                        } | {
                                            type: "VERIFY_SESSION";
                                        } | {
                                            type: "REFRESH_TOKEN";
                                        } | {
                                            type: "GET_TOKEN";
                                        } | {
                                            type: "GET_SAML_AUTH_CODE";
                                            recoverable?: boolean;
                                            sessionToken: string;
                                        } | {
                                            type: "GET_SAML_AUTH_HANDLE";
                                            authCode: string;
                                        } | {
                                            type: "VALIDATE_CHMED";
                                            sessionToken: string;
                                        } | {
                                            type: "xstate.done.actor.getSAMLAuthHandle";
                                            sessionToken: string;
                                            recoverable?: boolean;
                                        } | {
                                            type: "SIGN_PRESCRIPTION";
                                            sessionToken: string;
                                            recoverable?: boolean;
                                        } | {
                                            type: "AUTHENTICATION_SUCCESS";
                                        } | {
                                            type: "ERROR";
                                            error: DomainError;
                                        } | {
                                            type: "UNAUTHORIZED_TOKEN";
                                        } | {
                                            type: "UNAUTHORIZED_HANDLE";
                                        }, Record<string, import('xstate').AnyActorRef>, import('xstate').StateValue, string, unknown, any, any>, {
                                            type: "OPEN_POPUP";
                                            popupRef: Window | null;
                                        } | {
                                            type: "CLOSE_POPUP";
                                        } | {
                                            type: "START";
                                            encodedCHMED: string;
                                            shouldGeneratePdf: boolean;
                                        } | {
                                            type: "TERMINATE";
                                        } | {
                                            type: "VERIFY_SESSION";
                                        } | {
                                            type: "REFRESH_TOKEN";
                                        } | {
                                            type: "GET_TOKEN";
                                        } | {
                                            type: "GET_SAML_AUTH_CODE";
                                            recoverable?: boolean;
                                            sessionToken: string;
                                        } | {
                                            type: "GET_SAML_AUTH_HANDLE";
                                            authCode: string;
                                        } | {
                                            type: "VALIDATE_CHMED";
                                            sessionToken: string;
                                        } | {
                                            type: "xstate.done.actor.getSAMLAuthHandle";
                                            sessionToken: string;
                                            recoverable?: boolean;
                                        } | {
                                            type: "SIGN_PRESCRIPTION";
                                            sessionToken: string;
                                            recoverable?: boolean;
                                        } | {
                                            type: "AUTHENTICATION_SUCCESS";
                                        } | {
                                            type: "ERROR";
                                            error: DomainError;
                                        } | {
                                            type: "UNAUTHORIZED_TOKEN";
                                        } | {
                                            type: "UNAUTHORIZED_HANDLE";
                                        }, import('xstate').AnyEventObject>;
                                    }) => {
                                        sessionToken: string | undefined;
                                        hinClient: import('../../core/integration/hin').HINClient;
                                    };
                                    readonly onDone: {
                                        readonly target: "SAMLAuthCode";
                                        readonly actions: readonly [import('xstate').ActionFunction<import('../../core').PrescriptionSignContext, import('xstate').DoneActorEvent<{
                                            sessionToken: string;
                                        }, string>, {
                                            type: "OPEN_POPUP";
                                            popupRef: Window | null;
                                        } | {
                                            type: "CLOSE_POPUP";
                                        } | {
                                            type: "START";
                                            encodedCHMED: string;
                                            shouldGeneratePdf: boolean;
                                        } | {
                                            type: "TERMINATE";
                                        } | {
                                            type: "VERIFY_SESSION";
                                        } | {
                                            type: "REFRESH_TOKEN";
                                        } | {
                                            type: "GET_TOKEN";
                                        } | {
                                            type: "GET_SAML_AUTH_CODE";
                                            recoverable?: boolean;
                                            sessionToken: string;
                                        } | {
                                            type: "GET_SAML_AUTH_HANDLE";
                                            authCode: string;
                                        } | {
                                            type: "VALIDATE_CHMED";
                                            sessionToken: string;
                                        } | {
                                            type: "xstate.done.actor.getSAMLAuthHandle";
                                            sessionToken: string;
                                            recoverable?: boolean;
                                        } | {
                                            type: "SIGN_PRESCRIPTION";
                                            sessionToken: string;
                                            recoverable?: boolean;
                                        } | {
                                            type: "AUTHENTICATION_SUCCESS";
                                        } | {
                                            type: "ERROR";
                                            error: DomainError;
                                        } | {
                                            type: "UNAUTHORIZED_TOKEN";
                                        } | {
                                            type: "UNAUTHORIZED_HANDLE";
                                        }, undefined, import('xstate').Values<{
                                            openPopup: {
                                                src: "openPopup";
                                                logic: import('xstate').CallbackActorLogic<import('xstate').AnyEventObject, {
                                                    sessionToken?: string;
                                                    hinClient: import('../../core/integration/hin').HINClient;
                                                }, import('xstate').EventObject>;
                                                id: string | undefined;
                                            };
                                            trackPopup: {
                                                src: "trackPopup";
                                                logic: import('xstate').CallbackActorLogic<import('xstate').AnyEventObject, {
                                                    popupRef: Window | null;
                                                }, import('xstate').EventObject>;
                                                id: string | undefined;
                                            };
                                            listenAuthenticationMessage: {
                                                src: "listenAuthenticationMessage";
                                                logic: import('xstate').CallbackActorLogic<import('xstate').AnyEventObject, {
                                                    hinClient: import('../../core/integration/hin').HINClient;
                                                    accessToken: string;
                                                }, import('xstate').EventObject>;
                                                id: string | undefined;
                                            };
                                            listenSamlAuthMessage: {
                                                src: "listenSamlAuthMessage";
                                                logic: import('xstate').CallbackActorLogic<import('xstate').AnyEventObject, {
                                                    hinClient: import('../../core/integration/hin').HINClient;
                                                }, import('xstate').EventObject>;
                                                id: string | undefined;
                                            };
                                            validateCHMED: {
                                                src: "validateCHMED";
                                                logic: import('xstate').PromiseActorLogic<void, {
                                                    encodedCHMED?: string;
                                                    parent: import('xstate').ActorRef<import('xstate').AnyMachineSnapshot, import('../../core').PrescriptionSignEvents>;
                                                    hinClient: import('../../core/integration/hin').HINClient;
                                                    sessionToken?: string;
                                                }, import('xstate').EventObject>;
                                                id: string | undefined;
                                            };
                                            verifySession: {
                                                src: "verifySession";
                                                logic: import('xstate').PromiseActorLogic<void, {
                                                    parent: import('xstate').ActorRef<import('xstate').AnyMachineSnapshot, import('../../core').PrescriptionSignEvents>;
                                                    hinClient: import('../../core/integration/hin').HINClient;
                                                    sessionToken?: string;
                                                }, import('xstate').EventObject>;
                                                id: string | undefined;
                                            };
                                            initOAuth: {
                                                src: "initOAuth";
                                                logic: import('xstate').PromiseActorLogic<void, {
                                                    parent: import('xstate').ActorRef<import('xstate').AnyMachineSnapshot, import('../../core').PrescriptionSignEvents>;
                                                    popupRef: Window | null;
                                                    hinClient: import('../../core/integration/hin').HINClient;
                                                }, import('xstate').EventObject>;
                                                id: string | undefined;
                                            };
                                            listenOAuthMessage: {
                                                src: "listenOAuthMessage";
                                                logic: import('xstate').CallbackActorLogic<import('xstate').AnyEventObject, {
                                                    hinClient: import('../../core/integration/hin').HINClient;
                                                    sessionToken?: string;
                                                }, import('xstate').EventObject>;
                                                id: string | undefined;
                                            };
                                            refreshToken: {
                                                src: "refreshToken";
                                                logic: import('xstate').PromiseActorLogic<{
                                                    sessionToken: string;
                                                }, {
                                                    hinClient: import('../../core/integration/hin').HINClient;
                                                    sessionToken?: string;
                                                }, import('xstate').EventObject>;
                                                id: string | undefined;
                                            };
                                            initSAMLAuthCode: {
                                                src: "initSAMLAuthCode";
                                                logic: import('xstate').PromiseActorLogic<void, {
                                                    parent: import('xstate').ActorRef<import('xstate').AnyMachineSnapshot, import('../../core').PrescriptionSignEvents>;
                                                    popupRef: Window | null;
                                                    hinClient: import('../../core/integration/hin').HINClient;
                                                    recover: boolean;
                                                    sessionToken?: string;
                                                }, import('xstate').EventObject>;
                                                id: string | undefined;
                                            };
                                            listenSAMLAuthCodeMessage: {
                                                src: "listenSAMLAuthCodeMessage";
                                                logic: import('xstate').CallbackActorLogic<import('xstate').AnyEventObject, {
                                                    hinClient: import('../../core/integration/hin').HINClient;
                                                }, import('xstate').EventObject>;
                                                id: string | undefined;
                                            };
                                            getSAMLAuthHandle: {
                                                src: "getSAMLAuthHandle";
                                                logic: import('xstate').PromiseActorLogic<{
                                                    sessionToken: string;
                                                }, {
                                                    parent: import('xstate').ActorRef<import('xstate').AnyMachineSnapshot, import('../../core').PrescriptionSignEvents>;
                                                    authCode: string;
                                                    hinClient: import('../../core/integration/hin').HINClient;
                                                    sessionToken?: string;
                                                }, import('xstate').EventObject>;
                                                id: string | undefined;
                                            };
                                            signCHMEDRx: {
                                                src: "signCHMEDRx";
                                                logic: import('xstate').PromiseActorLogic<{
                                                    signedPrescription: string;
                                                    generatedPdf?: string;
                                                }, {
                                                    encodedCHMED?: string;
                                                    shouldGeneratePdf: boolean;
                                                    parent: import('xstate').ActorRef<import('xstate').AnyMachineSnapshot, import('../../core').PrescriptionSignEvents>;
                                                    hinClient: import('../../core/integration/hin').HINClient;
                                                    sessionToken?: string;
                                                    recover: boolean;
                                                }, import('xstate').EventObject>;
                                                id: string | undefined;
                                            };
                                            errorHandler: {
                                                src: "errorHandler";
                                                logic: import('xstate').CallbackActorLogic<import('xstate').AnyEventObject, {
                                                    error: DomainError;
                                                }, import('xstate').EventObject>;
                                                id: string | undefined;
                                            };
                                            successHandler: {
                                                src: "successHandler";
                                                logic: import('xstate').CallbackActorLogic<import('xstate').AnyEventObject, {
                                                    signedCHMED?: string;
                                                    generatedPdf?: string;
                                                }, import('xstate').EventObject>;
                                                id: string | undefined;
                                            };
                                        }>, never, never, never, never>];
                                    };
                                    readonly onError: {
                                        readonly target: "OAuth";
                                    };
                                    readonly src: "refreshToken";
                                };
                            };
                            readonly SAMLAuthCode: {
                                readonly on: {
                                    readonly GET_SAML_AUTH_HANDLE: {
                                        readonly target: "SAMLAuthHandle";
                                    };
                                    readonly UNAUTHORIZED_TOKEN: {
                                        readonly target: "TokenRefreshing";
                                    };
                                    readonly ERROR: {
                                        readonly target: "Error";
                                    };
                                    readonly TERMINATE: {
                                        readonly target: "End";
                                        readonly actions: readonly [{
                                            readonly type: "closePopup";
                                        }];
                                    };
                                };
                                readonly invoke: readonly [{
                                    readonly id: "initSAMLAuthCode";
                                    readonly input: ({ self, context, event }: {
                                        context: import('../../core').PrescriptionSignContext;
                                        event: {
                                            type: "OPEN_POPUP";
                                            popupRef: Window | null;
                                        } | {
                                            type: "CLOSE_POPUP";
                                        } | {
                                            type: "START";
                                            encodedCHMED: string;
                                            shouldGeneratePdf: boolean;
                                        } | {
                                            type: "TERMINATE";
                                        } | {
                                            type: "VERIFY_SESSION";
                                        } | {
                                            type: "REFRESH_TOKEN";
                                        } | {
                                            type: "GET_TOKEN";
                                        } | {
                                            type: "GET_SAML_AUTH_CODE";
                                            recoverable?: boolean;
                                            sessionToken: string;
                                        } | {
                                            type: "GET_SAML_AUTH_HANDLE";
                                            authCode: string;
                                        } | {
                                            type: "VALIDATE_CHMED";
                                            sessionToken: string;
                                        } | {
                                            type: "xstate.done.actor.getSAMLAuthHandle";
                                            sessionToken: string;
                                            recoverable?: boolean;
                                        } | {
                                            type: "SIGN_PRESCRIPTION";
                                            sessionToken: string;
                                            recoverable?: boolean;
                                        } | {
                                            type: "AUTHENTICATION_SUCCESS";
                                        } | {
                                            type: "ERROR";
                                            error: DomainError;
                                        } | {
                                            type: "UNAUTHORIZED_TOKEN";
                                        } | {
                                            type: "UNAUTHORIZED_HANDLE";
                                        };
                                        self: import('xstate').ActorRef<import('xstate').MachineSnapshot<import('../../core').PrescriptionSignContext, {
                                            type: "OPEN_POPUP";
                                            popupRef: Window | null;
                                        } | {
                                            type: "CLOSE_POPUP";
                                        } | {
                                            type: "START";
                                            encodedCHMED: string;
                                            shouldGeneratePdf: boolean;
                                        } | {
                                            type: "TERMINATE";
                                        } | {
                                            type: "VERIFY_SESSION";
                                        } | {
                                            type: "REFRESH_TOKEN";
                                        } | {
                                            type: "GET_TOKEN";
                                        } | {
                                            type: "GET_SAML_AUTH_CODE";
                                            recoverable?: boolean;
                                            sessionToken: string;
                                        } | {
                                            type: "GET_SAML_AUTH_HANDLE";
                                            authCode: string;
                                        } | {
                                            type: "VALIDATE_CHMED";
                                            sessionToken: string;
                                        } | {
                                            type: "xstate.done.actor.getSAMLAuthHandle";
                                            sessionToken: string;
                                            recoverable?: boolean;
                                        } | {
                                            type: "SIGN_PRESCRIPTION";
                                            sessionToken: string;
                                            recoverable?: boolean;
                                        } | {
                                            type: "AUTHENTICATION_SUCCESS";
                                        } | {
                                            type: "ERROR";
                                            error: DomainError;
                                        } | {
                                            type: "UNAUTHORIZED_TOKEN";
                                        } | {
                                            type: "UNAUTHORIZED_HANDLE";
                                        }, Record<string, import('xstate').AnyActorRef>, import('xstate').StateValue, string, unknown, any, any>, {
                                            type: "OPEN_POPUP";
                                            popupRef: Window | null;
                                        } | {
                                            type: "CLOSE_POPUP";
                                        } | {
                                            type: "START";
                                            encodedCHMED: string;
                                            shouldGeneratePdf: boolean;
                                        } | {
                                            type: "TERMINATE";
                                        } | {
                                            type: "VERIFY_SESSION";
                                        } | {
                                            type: "REFRESH_TOKEN";
                                        } | {
                                            type: "GET_TOKEN";
                                        } | {
                                            type: "GET_SAML_AUTH_CODE";
                                            recoverable?: boolean;
                                            sessionToken: string;
                                        } | {
                                            type: "GET_SAML_AUTH_HANDLE";
                                            authCode: string;
                                        } | {
                                            type: "VALIDATE_CHMED";
                                            sessionToken: string;
                                        } | {
                                            type: "xstate.done.actor.getSAMLAuthHandle";
                                            sessionToken: string;
                                            recoverable?: boolean;
                                        } | {
                                            type: "SIGN_PRESCRIPTION";
                                            sessionToken: string;
                                            recoverable?: boolean;
                                        } | {
                                            type: "AUTHENTICATION_SUCCESS";
                                        } | {
                                            type: "ERROR";
                                            error: DomainError;
                                        } | {
                                            type: "UNAUTHORIZED_TOKEN";
                                        } | {
                                            type: "UNAUTHORIZED_HANDLE";
                                        }, import('xstate').AnyEventObject>;
                                    }) => {
                                        parent: import('xstate').ActorRef<import('xstate').MachineSnapshot<import('../../core').PrescriptionSignContext, {
                                            type: "OPEN_POPUP";
                                            popupRef: Window | null;
                                        } | {
                                            type: "CLOSE_POPUP";
                                        } | {
                                            type: "START";
                                            encodedCHMED: string;
                                            shouldGeneratePdf: boolean;
                                        } | {
                                            type: "TERMINATE";
                                        } | {
                                            type: "VERIFY_SESSION";
                                        } | {
                                            type: "REFRESH_TOKEN";
                                        } | {
                                            type: "GET_TOKEN";
                                        } | {
                                            type: "GET_SAML_AUTH_CODE";
                                            recoverable?: boolean;
                                            sessionToken: string;
                                        } | {
                                            type: "GET_SAML_AUTH_HANDLE";
                                            authCode: string;
                                        } | {
                                            type: "VALIDATE_CHMED";
                                            sessionToken: string;
                                        } | {
                                            type: "xstate.done.actor.getSAMLAuthHandle";
                                            sessionToken: string;
                                            recoverable?: boolean;
                                        } | {
                                            type: "SIGN_PRESCRIPTION";
                                            sessionToken: string;
                                            recoverable?: boolean;
                                        } | {
                                            type: "AUTHENTICATION_SUCCESS";
                                        } | {
                                            type: "ERROR";
                                            error: DomainError;
                                        } | {
                                            type: "UNAUTHORIZED_TOKEN";
                                        } | {
                                            type: "UNAUTHORIZED_HANDLE";
                                        }, Record<string, import('xstate').AnyActorRef>, import('xstate').StateValue, string, unknown, any, any>, {
                                            type: "OPEN_POPUP";
                                            popupRef: Window | null;
                                        } | {
                                            type: "CLOSE_POPUP";
                                        } | {
                                            type: "START";
                                            encodedCHMED: string;
                                            shouldGeneratePdf: boolean;
                                        } | {
                                            type: "TERMINATE";
                                        } | {
                                            type: "VERIFY_SESSION";
                                        } | {
                                            type: "REFRESH_TOKEN";
                                        } | {
                                            type: "GET_TOKEN";
                                        } | {
                                            type: "GET_SAML_AUTH_CODE";
                                            recoverable?: boolean;
                                            sessionToken: string;
                                        } | {
                                            type: "GET_SAML_AUTH_HANDLE";
                                            authCode: string;
                                        } | {
                                            type: "VALIDATE_CHMED";
                                            sessionToken: string;
                                        } | {
                                            type: "xstate.done.actor.getSAMLAuthHandle";
                                            sessionToken: string;
                                            recoverable?: boolean;
                                        } | {
                                            type: "SIGN_PRESCRIPTION";
                                            sessionToken: string;
                                            recoverable?: boolean;
                                        } | {
                                            type: "AUTHENTICATION_SUCCESS";
                                        } | {
                                            type: "ERROR";
                                            error: DomainError;
                                        } | {
                                            type: "UNAUTHORIZED_TOKEN";
                                        } | {
                                            type: "UNAUTHORIZED_HANDLE";
                                        }, import('xstate').AnyEventObject>;
                                        popupRef: Window | null;
                                        hinClient: import('../../core/integration/hin').HINClient;
                                        recover: boolean;
                                        sessionToken: string | undefined;
                                    };
                                    readonly src: "initSAMLAuthCode";
                                }, {
                                    readonly id: "listenSAMLAuthCodeMessage";
                                    readonly input: ({ context }: {
                                        context: import('../../core').PrescriptionSignContext;
                                        event: {
                                            type: "OPEN_POPUP";
                                            popupRef: Window | null;
                                        } | {
                                            type: "CLOSE_POPUP";
                                        } | {
                                            type: "START";
                                            encodedCHMED: string;
                                            shouldGeneratePdf: boolean;
                                        } | {
                                            type: "TERMINATE";
                                        } | {
                                            type: "VERIFY_SESSION";
                                        } | {
                                            type: "REFRESH_TOKEN";
                                        } | {
                                            type: "GET_TOKEN";
                                        } | {
                                            type: "GET_SAML_AUTH_CODE";
                                            recoverable?: boolean;
                                            sessionToken: string;
                                        } | {
                                            type: "GET_SAML_AUTH_HANDLE";
                                            authCode: string;
                                        } | {
                                            type: "VALIDATE_CHMED";
                                            sessionToken: string;
                                        } | {
                                            type: "xstate.done.actor.getSAMLAuthHandle";
                                            sessionToken: string;
                                            recoverable?: boolean;
                                        } | {
                                            type: "SIGN_PRESCRIPTION";
                                            sessionToken: string;
                                            recoverable?: boolean;
                                        } | {
                                            type: "AUTHENTICATION_SUCCESS";
                                        } | {
                                            type: "ERROR";
                                            error: DomainError;
                                        } | {
                                            type: "UNAUTHORIZED_TOKEN";
                                        } | {
                                            type: "UNAUTHORIZED_HANDLE";
                                        };
                                        self: import('xstate').ActorRef<import('xstate').MachineSnapshot<import('../../core').PrescriptionSignContext, {
                                            type: "OPEN_POPUP";
                                            popupRef: Window | null;
                                        } | {
                                            type: "CLOSE_POPUP";
                                        } | {
                                            type: "START";
                                            encodedCHMED: string;
                                            shouldGeneratePdf: boolean;
                                        } | {
                                            type: "TERMINATE";
                                        } | {
                                            type: "VERIFY_SESSION";
                                        } | {
                                            type: "REFRESH_TOKEN";
                                        } | {
                                            type: "GET_TOKEN";
                                        } | {
                                            type: "GET_SAML_AUTH_CODE";
                                            recoverable?: boolean;
                                            sessionToken: string;
                                        } | {
                                            type: "GET_SAML_AUTH_HANDLE";
                                            authCode: string;
                                        } | {
                                            type: "VALIDATE_CHMED";
                                            sessionToken: string;
                                        } | {
                                            type: "xstate.done.actor.getSAMLAuthHandle";
                                            sessionToken: string;
                                            recoverable?: boolean;
                                        } | {
                                            type: "SIGN_PRESCRIPTION";
                                            sessionToken: string;
                                            recoverable?: boolean;
                                        } | {
                                            type: "AUTHENTICATION_SUCCESS";
                                        } | {
                                            type: "ERROR";
                                            error: DomainError;
                                        } | {
                                            type: "UNAUTHORIZED_TOKEN";
                                        } | {
                                            type: "UNAUTHORIZED_HANDLE";
                                        }, Record<string, import('xstate').AnyActorRef>, import('xstate').StateValue, string, unknown, any, any>, {
                                            type: "OPEN_POPUP";
                                            popupRef: Window | null;
                                        } | {
                                            type: "CLOSE_POPUP";
                                        } | {
                                            type: "START";
                                            encodedCHMED: string;
                                            shouldGeneratePdf: boolean;
                                        } | {
                                            type: "TERMINATE";
                                        } | {
                                            type: "VERIFY_SESSION";
                                        } | {
                                            type: "REFRESH_TOKEN";
                                        } | {
                                            type: "GET_TOKEN";
                                        } | {
                                            type: "GET_SAML_AUTH_CODE";
                                            recoverable?: boolean;
                                            sessionToken: string;
                                        } | {
                                            type: "GET_SAML_AUTH_HANDLE";
                                            authCode: string;
                                        } | {
                                            type: "VALIDATE_CHMED";
                                            sessionToken: string;
                                        } | {
                                            type: "xstate.done.actor.getSAMLAuthHandle";
                                            sessionToken: string;
                                            recoverable?: boolean;
                                        } | {
                                            type: "SIGN_PRESCRIPTION";
                                            sessionToken: string;
                                            recoverable?: boolean;
                                        } | {
                                            type: "AUTHENTICATION_SUCCESS";
                                        } | {
                                            type: "ERROR";
                                            error: DomainError;
                                        } | {
                                            type: "UNAUTHORIZED_TOKEN";
                                        } | {
                                            type: "UNAUTHORIZED_HANDLE";
                                        }, import('xstate').AnyEventObject>;
                                    }) => {
                                        hinClient: import('../../core/integration/hin').HINClient;
                                    };
                                    readonly src: "listenSAMLAuthCodeMessage";
                                }];
                            };
                            readonly SAMLAuthHandle: {
                                readonly on: {
                                    readonly ERROR: {
                                        readonly target: "Error";
                                    };
                                    readonly TERMINATE: {
                                        readonly target: "End";
                                        readonly actions: readonly [{
                                            readonly type: "closePopup";
                                        }];
                                    };
                                };
                                readonly invoke: {
                                    readonly id: "getSAMLAuthHandle";
                                    readonly src: "getSAMLAuthHandle";
                                    readonly input: ({ context, event, self }: {
                                        context: import('../../core').PrescriptionSignContext;
                                        event: {
                                            type: "OPEN_POPUP";
                                            popupRef: Window | null;
                                        } | {
                                            type: "CLOSE_POPUP";
                                        } | {
                                            type: "START";
                                            encodedCHMED: string;
                                            shouldGeneratePdf: boolean;
                                        } | {
                                            type: "TERMINATE";
                                        } | {
                                            type: "VERIFY_SESSION";
                                        } | {
                                            type: "REFRESH_TOKEN";
                                        } | {
                                            type: "GET_TOKEN";
                                        } | {
                                            type: "GET_SAML_AUTH_CODE";
                                            recoverable?: boolean;
                                            sessionToken: string;
                                        } | {
                                            type: "GET_SAML_AUTH_HANDLE";
                                            authCode: string;
                                        } | {
                                            type: "VALIDATE_CHMED";
                                            sessionToken: string;
                                        } | {
                                            type: "xstate.done.actor.getSAMLAuthHandle";
                                            sessionToken: string;
                                            recoverable?: boolean;
                                        } | {
                                            type: "SIGN_PRESCRIPTION";
                                            sessionToken: string;
                                            recoverable?: boolean;
                                        } | {
                                            type: "AUTHENTICATION_SUCCESS";
                                        } | {
                                            type: "ERROR";
                                            error: DomainError;
                                        } | {
                                            type: "UNAUTHORIZED_TOKEN";
                                        } | {
                                            type: "UNAUTHORIZED_HANDLE";
                                        };
                                        self: import('xstate').ActorRef<import('xstate').MachineSnapshot<import('../../core').PrescriptionSignContext, {
                                            type: "OPEN_POPUP";
                                            popupRef: Window | null;
                                        } | {
                                            type: "CLOSE_POPUP";
                                        } | {
                                            type: "START";
                                            encodedCHMED: string;
                                            shouldGeneratePdf: boolean;
                                        } | {
                                            type: "TERMINATE";
                                        } | {
                                            type: "VERIFY_SESSION";
                                        } | {
                                            type: "REFRESH_TOKEN";
                                        } | {
                                            type: "GET_TOKEN";
                                        } | {
                                            type: "GET_SAML_AUTH_CODE";
                                            recoverable?: boolean;
                                            sessionToken: string;
                                        } | {
                                            type: "GET_SAML_AUTH_HANDLE";
                                            authCode: string;
                                        } | {
                                            type: "VALIDATE_CHMED";
                                            sessionToken: string;
                                        } | {
                                            type: "xstate.done.actor.getSAMLAuthHandle";
                                            sessionToken: string;
                                            recoverable?: boolean;
                                        } | {
                                            type: "SIGN_PRESCRIPTION";
                                            sessionToken: string;
                                            recoverable?: boolean;
                                        } | {
                                            type: "AUTHENTICATION_SUCCESS";
                                        } | {
                                            type: "ERROR";
                                            error: DomainError;
                                        } | {
                                            type: "UNAUTHORIZED_TOKEN";
                                        } | {
                                            type: "UNAUTHORIZED_HANDLE";
                                        }, Record<string, import('xstate').AnyActorRef>, import('xstate').StateValue, string, unknown, any, any>, {
                                            type: "OPEN_POPUP";
                                            popupRef: Window | null;
                                        } | {
                                            type: "CLOSE_POPUP";
                                        } | {
                                            type: "START";
                                            encodedCHMED: string;
                                            shouldGeneratePdf: boolean;
                                        } | {
                                            type: "TERMINATE";
                                        } | {
                                            type: "VERIFY_SESSION";
                                        } | {
                                            type: "REFRESH_TOKEN";
                                        } | {
                                            type: "GET_TOKEN";
                                        } | {
                                            type: "GET_SAML_AUTH_CODE";
                                            recoverable?: boolean;
                                            sessionToken: string;
                                        } | {
                                            type: "GET_SAML_AUTH_HANDLE";
                                            authCode: string;
                                        } | {
                                            type: "VALIDATE_CHMED";
                                            sessionToken: string;
                                        } | {
                                            type: "xstate.done.actor.getSAMLAuthHandle";
                                            sessionToken: string;
                                            recoverable?: boolean;
                                        } | {
                                            type: "SIGN_PRESCRIPTION";
                                            sessionToken: string;
                                            recoverable?: boolean;
                                        } | {
                                            type: "AUTHENTICATION_SUCCESS";
                                        } | {
                                            type: "ERROR";
                                            error: DomainError;
                                        } | {
                                            type: "UNAUTHORIZED_TOKEN";
                                        } | {
                                            type: "UNAUTHORIZED_HANDLE";
                                        }, import('xstate').AnyEventObject>;
                                    }) => {
                                        authCode: string;
                                        parent: import('xstate').ActorRef<import('xstate').MachineSnapshot<import('../../core').PrescriptionSignContext, {
                                            type: "OPEN_POPUP";
                                            popupRef: Window | null;
                                        } | {
                                            type: "CLOSE_POPUP";
                                        } | {
                                            type: "START";
                                            encodedCHMED: string;
                                            shouldGeneratePdf: boolean;
                                        } | {
                                            type: "TERMINATE";
                                        } | {
                                            type: "VERIFY_SESSION";
                                        } | {
                                            type: "REFRESH_TOKEN";
                                        } | {
                                            type: "GET_TOKEN";
                                        } | {
                                            type: "GET_SAML_AUTH_CODE";
                                            recoverable?: boolean;
                                            sessionToken: string;
                                        } | {
                                            type: "GET_SAML_AUTH_HANDLE";
                                            authCode: string;
                                        } | {
                                            type: "VALIDATE_CHMED";
                                            sessionToken: string;
                                        } | {
                                            type: "xstate.done.actor.getSAMLAuthHandle";
                                            sessionToken: string;
                                            recoverable?: boolean;
                                        } | {
                                            type: "SIGN_PRESCRIPTION";
                                            sessionToken: string;
                                            recoverable?: boolean;
                                        } | {
                                            type: "AUTHENTICATION_SUCCESS";
                                        } | {
                                            type: "ERROR";
                                            error: DomainError;
                                        } | {
                                            type: "UNAUTHORIZED_TOKEN";
                                        } | {
                                            type: "UNAUTHORIZED_HANDLE";
                                        }, Record<string, import('xstate').AnyActorRef>, import('xstate').StateValue, string, unknown, any, any>, {
                                            type: "OPEN_POPUP";
                                            popupRef: Window | null;
                                        } | {
                                            type: "CLOSE_POPUP";
                                        } | {
                                            type: "START";
                                            encodedCHMED: string;
                                            shouldGeneratePdf: boolean;
                                        } | {
                                            type: "TERMINATE";
                                        } | {
                                            type: "VERIFY_SESSION";
                                        } | {
                                            type: "REFRESH_TOKEN";
                                        } | {
                                            type: "GET_TOKEN";
                                        } | {
                                            type: "GET_SAML_AUTH_CODE";
                                            recoverable?: boolean;
                                            sessionToken: string;
                                        } | {
                                            type: "GET_SAML_AUTH_HANDLE";
                                            authCode: string;
                                        } | {
                                            type: "VALIDATE_CHMED";
                                            sessionToken: string;
                                        } | {
                                            type: "xstate.done.actor.getSAMLAuthHandle";
                                            sessionToken: string;
                                            recoverable?: boolean;
                                        } | {
                                            type: "SIGN_PRESCRIPTION";
                                            sessionToken: string;
                                            recoverable?: boolean;
                                        } | {
                                            type: "AUTHENTICATION_SUCCESS";
                                        } | {
                                            type: "ERROR";
                                            error: DomainError;
                                        } | {
                                            type: "UNAUTHORIZED_TOKEN";
                                        } | {
                                            type: "UNAUTHORIZED_HANDLE";
                                        }, import('xstate').AnyEventObject>;
                                        hinClient: import('../../core/integration/hin').HINClient;
                                        sessionToken: string | undefined;
                                    };
                                    readonly onDone: {
                                        readonly target: "SigningCHMED";
                                        readonly actions: readonly [import('xstate').ActionFunction<import('../../core').PrescriptionSignContext, import('xstate').DoneActorEvent<{
                                            sessionToken: string;
                                        }, string>, {
                                            type: "OPEN_POPUP";
                                            popupRef: Window | null;
                                        } | {
                                            type: "CLOSE_POPUP";
                                        } | {
                                            type: "START";
                                            encodedCHMED: string;
                                            shouldGeneratePdf: boolean;
                                        } | {
                                            type: "TERMINATE";
                                        } | {
                                            type: "VERIFY_SESSION";
                                        } | {
                                            type: "REFRESH_TOKEN";
                                        } | {
                                            type: "GET_TOKEN";
                                        } | {
                                            type: "GET_SAML_AUTH_CODE";
                                            recoverable?: boolean;
                                            sessionToken: string;
                                        } | {
                                            type: "GET_SAML_AUTH_HANDLE";
                                            authCode: string;
                                        } | {
                                            type: "VALIDATE_CHMED";
                                            sessionToken: string;
                                        } | {
                                            type: "xstate.done.actor.getSAMLAuthHandle";
                                            sessionToken: string;
                                            recoverable?: boolean;
                                        } | {
                                            type: "SIGN_PRESCRIPTION";
                                            sessionToken: string;
                                            recoverable?: boolean;
                                        } | {
                                            type: "AUTHENTICATION_SUCCESS";
                                        } | {
                                            type: "ERROR";
                                            error: DomainError;
                                        } | {
                                            type: "UNAUTHORIZED_TOKEN";
                                        } | {
                                            type: "UNAUTHORIZED_HANDLE";
                                        }, undefined, import('xstate').Values<{
                                            openPopup: {
                                                src: "openPopup";
                                                logic: import('xstate').CallbackActorLogic<import('xstate').AnyEventObject, {
                                                    sessionToken?: string;
                                                    hinClient: import('../../core/integration/hin').HINClient;
                                                }, import('xstate').EventObject>;
                                                id: string | undefined;
                                            };
                                            trackPopup: {
                                                src: "trackPopup";
                                                logic: import('xstate').CallbackActorLogic<import('xstate').AnyEventObject, {
                                                    popupRef: Window | null;
                                                }, import('xstate').EventObject>;
                                                id: string | undefined;
                                            };
                                            listenAuthenticationMessage: {
                                                src: "listenAuthenticationMessage";
                                                logic: import('xstate').CallbackActorLogic<import('xstate').AnyEventObject, {
                                                    hinClient: import('../../core/integration/hin').HINClient;
                                                    accessToken: string;
                                                }, import('xstate').EventObject>;
                                                id: string | undefined;
                                            };
                                            listenSamlAuthMessage: {
                                                src: "listenSamlAuthMessage";
                                                logic: import('xstate').CallbackActorLogic<import('xstate').AnyEventObject, {
                                                    hinClient: import('../../core/integration/hin').HINClient;
                                                }, import('xstate').EventObject>;
                                                id: string | undefined;
                                            };
                                            validateCHMED: {
                                                src: "validateCHMED";
                                                logic: import('xstate').PromiseActorLogic<void, {
                                                    encodedCHMED?: string;
                                                    parent: import('xstate').ActorRef<import('xstate').AnyMachineSnapshot, import('../../core').PrescriptionSignEvents>;
                                                    hinClient: import('../../core/integration/hin').HINClient;
                                                    sessionToken?: string;
                                                }, import('xstate').EventObject>;
                                                id: string | undefined;
                                            };
                                            verifySession: {
                                                src: "verifySession";
                                                logic: import('xstate').PromiseActorLogic<void, {
                                                    parent: import('xstate').ActorRef<import('xstate').AnyMachineSnapshot, import('../../core').PrescriptionSignEvents>;
                                                    hinClient: import('../../core/integration/hin').HINClient;
                                                    sessionToken?: string;
                                                }, import('xstate').EventObject>;
                                                id: string | undefined;
                                            };
                                            initOAuth: {
                                                src: "initOAuth";
                                                logic: import('xstate').PromiseActorLogic<void, {
                                                    parent: import('xstate').ActorRef<import('xstate').AnyMachineSnapshot, import('../../core').PrescriptionSignEvents>;
                                                    popupRef: Window | null;
                                                    hinClient: import('../../core/integration/hin').HINClient;
                                                }, import('xstate').EventObject>;
                                                id: string | undefined;
                                            };
                                            listenOAuthMessage: {
                                                src: "listenOAuthMessage";
                                                logic: import('xstate').CallbackActorLogic<import('xstate').AnyEventObject, {
                                                    hinClient: import('../../core/integration/hin').HINClient;
                                                    sessionToken?: string;
                                                }, import('xstate').EventObject>;
                                                id: string | undefined;
                                            };
                                            refreshToken: {
                                                src: "refreshToken";
                                                logic: import('xstate').PromiseActorLogic<{
                                                    sessionToken: string;
                                                }, {
                                                    hinClient: import('../../core/integration/hin').HINClient;
                                                    sessionToken?: string;
                                                }, import('xstate').EventObject>;
                                                id: string | undefined;
                                            };
                                            initSAMLAuthCode: {
                                                src: "initSAMLAuthCode";
                                                logic: import('xstate').PromiseActorLogic<void, {
                                                    parent: import('xstate').ActorRef<import('xstate').AnyMachineSnapshot, import('../../core').PrescriptionSignEvents>;
                                                    popupRef: Window | null;
                                                    hinClient: import('../../core/integration/hin').HINClient;
                                                    recover: boolean;
                                                    sessionToken?: string;
                                                }, import('xstate').EventObject>;
                                                id: string | undefined;
                                            };
                                            listenSAMLAuthCodeMessage: {
                                                src: "listenSAMLAuthCodeMessage";
                                                logic: import('xstate').CallbackActorLogic<import('xstate').AnyEventObject, {
                                                    hinClient: import('../../core/integration/hin').HINClient;
                                                }, import('xstate').EventObject>;
                                                id: string | undefined;
                                            };
                                            getSAMLAuthHandle: {
                                                src: "getSAMLAuthHandle";
                                                logic: import('xstate').PromiseActorLogic<{
                                                    sessionToken: string;
                                                }, {
                                                    parent: import('xstate').ActorRef<import('xstate').AnyMachineSnapshot, import('../../core').PrescriptionSignEvents>;
                                                    authCode: string;
                                                    hinClient: import('../../core/integration/hin').HINClient;
                                                    sessionToken?: string;
                                                }, import('xstate').EventObject>;
                                                id: string | undefined;
                                            };
                                            signCHMEDRx: {
                                                src: "signCHMEDRx";
                                                logic: import('xstate').PromiseActorLogic<{
                                                    signedPrescription: string;
                                                    generatedPdf?: string;
                                                }, {
                                                    encodedCHMED?: string;
                                                    shouldGeneratePdf: boolean;
                                                    parent: import('xstate').ActorRef<import('xstate').AnyMachineSnapshot, import('../../core').PrescriptionSignEvents>;
                                                    hinClient: import('../../core/integration/hin').HINClient;
                                                    sessionToken?: string;
                                                    recover: boolean;
                                                }, import('xstate').EventObject>;
                                                id: string | undefined;
                                            };
                                            errorHandler: {
                                                src: "errorHandler";
                                                logic: import('xstate').CallbackActorLogic<import('xstate').AnyEventObject, {
                                                    error: DomainError;
                                                }, import('xstate').EventObject>;
                                                id: string | undefined;
                                            };
                                            successHandler: {
                                                src: "successHandler";
                                                logic: import('xstate').CallbackActorLogic<import('xstate').AnyEventObject, {
                                                    signedCHMED?: string;
                                                    generatedPdf?: string;
                                                }, import('xstate').EventObject>;
                                                id: string | undefined;
                                            };
                                        }>, never, never, never, never>];
                                    };
                                };
                            };
                            readonly SigningCHMED: {
                                readonly on: {
                                    readonly UNAUTHORIZED_HANDLE: {
                                        readonly target: "SAMLAuthCode";
                                    };
                                    readonly ERROR: {
                                        readonly target: "Error";
                                    };
                                    readonly TERMINATE: {
                                        readonly target: "End";
                                        readonly actions: readonly [{
                                            readonly type: "closePopup";
                                        }];
                                    };
                                };
                                readonly invoke: {
                                    readonly id: "signCHMEDRx";
                                    readonly input: ({ context, event, self }: {
                                        context: import('../../core').PrescriptionSignContext;
                                        event: {
                                            type: "OPEN_POPUP";
                                            popupRef: Window | null;
                                        } | {
                                            type: "CLOSE_POPUP";
                                        } | {
                                            type: "START";
                                            encodedCHMED: string;
                                            shouldGeneratePdf: boolean;
                                        } | {
                                            type: "TERMINATE";
                                        } | {
                                            type: "VERIFY_SESSION";
                                        } | {
                                            type: "REFRESH_TOKEN";
                                        } | {
                                            type: "GET_TOKEN";
                                        } | {
                                            type: "GET_SAML_AUTH_CODE";
                                            recoverable?: boolean;
                                            sessionToken: string;
                                        } | {
                                            type: "GET_SAML_AUTH_HANDLE";
                                            authCode: string;
                                        } | {
                                            type: "VALIDATE_CHMED";
                                            sessionToken: string;
                                        } | {
                                            type: "xstate.done.actor.getSAMLAuthHandle";
                                            sessionToken: string;
                                            recoverable?: boolean;
                                        } | {
                                            type: "SIGN_PRESCRIPTION";
                                            sessionToken: string;
                                            recoverable?: boolean;
                                        } | {
                                            type: "AUTHENTICATION_SUCCESS";
                                        } | {
                                            type: "ERROR";
                                            error: DomainError;
                                        } | {
                                            type: "UNAUTHORIZED_TOKEN";
                                        } | {
                                            type: "UNAUTHORIZED_HANDLE";
                                        };
                                        self: import('xstate').ActorRef<import('xstate').MachineSnapshot<import('../../core').PrescriptionSignContext, {
                                            type: "OPEN_POPUP";
                                            popupRef: Window | null;
                                        } | {
                                            type: "CLOSE_POPUP";
                                        } | {
                                            type: "START";
                                            encodedCHMED: string;
                                            shouldGeneratePdf: boolean;
                                        } | {
                                            type: "TERMINATE";
                                        } | {
                                            type: "VERIFY_SESSION";
                                        } | {
                                            type: "REFRESH_TOKEN";
                                        } | {
                                            type: "GET_TOKEN";
                                        } | {
                                            type: "GET_SAML_AUTH_CODE";
                                            recoverable?: boolean;
                                            sessionToken: string;
                                        } | {
                                            type: "GET_SAML_AUTH_HANDLE";
                                            authCode: string;
                                        } | {
                                            type: "VALIDATE_CHMED";
                                            sessionToken: string;
                                        } | {
                                            type: "xstate.done.actor.getSAMLAuthHandle";
                                            sessionToken: string;
                                            recoverable?: boolean;
                                        } | {
                                            type: "SIGN_PRESCRIPTION";
                                            sessionToken: string;
                                            recoverable?: boolean;
                                        } | {
                                            type: "AUTHENTICATION_SUCCESS";
                                        } | {
                                            type: "ERROR";
                                            error: DomainError;
                                        } | {
                                            type: "UNAUTHORIZED_TOKEN";
                                        } | {
                                            type: "UNAUTHORIZED_HANDLE";
                                        }, Record<string, import('xstate').AnyActorRef>, import('xstate').StateValue, string, unknown, any, any>, {
                                            type: "OPEN_POPUP";
                                            popupRef: Window | null;
                                        } | {
                                            type: "CLOSE_POPUP";
                                        } | {
                                            type: "START";
                                            encodedCHMED: string;
                                            shouldGeneratePdf: boolean;
                                        } | {
                                            type: "TERMINATE";
                                        } | {
                                            type: "VERIFY_SESSION";
                                        } | {
                                            type: "REFRESH_TOKEN";
                                        } | {
                                            type: "GET_TOKEN";
                                        } | {
                                            type: "GET_SAML_AUTH_CODE";
                                            recoverable?: boolean;
                                            sessionToken: string;
                                        } | {
                                            type: "GET_SAML_AUTH_HANDLE";
                                            authCode: string;
                                        } | {
                                            type: "VALIDATE_CHMED";
                                            sessionToken: string;
                                        } | {
                                            type: "xstate.done.actor.getSAMLAuthHandle";
                                            sessionToken: string;
                                            recoverable?: boolean;
                                        } | {
                                            type: "SIGN_PRESCRIPTION";
                                            sessionToken: string;
                                            recoverable?: boolean;
                                        } | {
                                            type: "AUTHENTICATION_SUCCESS";
                                        } | {
                                            type: "ERROR";
                                            error: DomainError;
                                        } | {
                                            type: "UNAUTHORIZED_TOKEN";
                                        } | {
                                            type: "UNAUTHORIZED_HANDLE";
                                        }, import('xstate').AnyEventObject>;
                                    }) => {
                                        encodedCHMED: string | undefined;
                                        parent: import('xstate').ActorRef<import('xstate').MachineSnapshot<import('../../core').PrescriptionSignContext, {
                                            type: "OPEN_POPUP";
                                            popupRef: Window | null;
                                        } | {
                                            type: "CLOSE_POPUP";
                                        } | {
                                            type: "START";
                                            encodedCHMED: string;
                                            shouldGeneratePdf: boolean;
                                        } | {
                                            type: "TERMINATE";
                                        } | {
                                            type: "VERIFY_SESSION";
                                        } | {
                                            type: "REFRESH_TOKEN";
                                        } | {
                                            type: "GET_TOKEN";
                                        } | {
                                            type: "GET_SAML_AUTH_CODE";
                                            recoverable?: boolean;
                                            sessionToken: string;
                                        } | {
                                            type: "GET_SAML_AUTH_HANDLE";
                                            authCode: string;
                                        } | {
                                            type: "VALIDATE_CHMED";
                                            sessionToken: string;
                                        } | {
                                            type: "xstate.done.actor.getSAMLAuthHandle";
                                            sessionToken: string;
                                            recoverable?: boolean;
                                        } | {
                                            type: "SIGN_PRESCRIPTION";
                                            sessionToken: string;
                                            recoverable?: boolean;
                                        } | {
                                            type: "AUTHENTICATION_SUCCESS";
                                        } | {
                                            type: "ERROR";
                                            error: DomainError;
                                        } | {
                                            type: "UNAUTHORIZED_TOKEN";
                                        } | {
                                            type: "UNAUTHORIZED_HANDLE";
                                        }, Record<string, import('xstate').AnyActorRef>, import('xstate').StateValue, string, unknown, any, any>, {
                                            type: "OPEN_POPUP";
                                            popupRef: Window | null;
                                        } | {
                                            type: "CLOSE_POPUP";
                                        } | {
                                            type: "START";
                                            encodedCHMED: string;
                                            shouldGeneratePdf: boolean;
                                        } | {
                                            type: "TERMINATE";
                                        } | {
                                            type: "VERIFY_SESSION";
                                        } | {
                                            type: "REFRESH_TOKEN";
                                        } | {
                                            type: "GET_TOKEN";
                                        } | {
                                            type: "GET_SAML_AUTH_CODE";
                                            recoverable?: boolean;
                                            sessionToken: string;
                                        } | {
                                            type: "GET_SAML_AUTH_HANDLE";
                                            authCode: string;
                                        } | {
                                            type: "VALIDATE_CHMED";
                                            sessionToken: string;
                                        } | {
                                            type: "xstate.done.actor.getSAMLAuthHandle";
                                            sessionToken: string;
                                            recoverable?: boolean;
                                        } | {
                                            type: "SIGN_PRESCRIPTION";
                                            sessionToken: string;
                                            recoverable?: boolean;
                                        } | {
                                            type: "AUTHENTICATION_SUCCESS";
                                        } | {
                                            type: "ERROR";
                                            error: DomainError;
                                        } | {
                                            type: "UNAUTHORIZED_TOKEN";
                                        } | {
                                            type: "UNAUTHORIZED_HANDLE";
                                        }, import('xstate').AnyEventObject>;
                                        hinClient: import('../../core/integration/hin').HINClient;
                                        sessionToken: string | undefined;
                                        recover: boolean;
                                        shouldGeneratePdf: boolean;
                                    };
                                    readonly onDone: {
                                        readonly target: "Success";
                                        readonly actions: readonly [import('xstate').ActionFunction<import('../../core').PrescriptionSignContext, import('xstate').DoneActorEvent<{
                                            signedPrescription: string;
                                            generatedPdf?: string;
                                        }, string>, {
                                            type: "OPEN_POPUP";
                                            popupRef: Window | null;
                                        } | {
                                            type: "CLOSE_POPUP";
                                        } | {
                                            type: "START";
                                            encodedCHMED: string;
                                            shouldGeneratePdf: boolean;
                                        } | {
                                            type: "TERMINATE";
                                        } | {
                                            type: "VERIFY_SESSION";
                                        } | {
                                            type: "REFRESH_TOKEN";
                                        } | {
                                            type: "GET_TOKEN";
                                        } | {
                                            type: "GET_SAML_AUTH_CODE";
                                            recoverable?: boolean;
                                            sessionToken: string;
                                        } | {
                                            type: "GET_SAML_AUTH_HANDLE";
                                            authCode: string;
                                        } | {
                                            type: "VALIDATE_CHMED";
                                            sessionToken: string;
                                        } | {
                                            type: "xstate.done.actor.getSAMLAuthHandle";
                                            sessionToken: string;
                                            recoverable?: boolean;
                                        } | {
                                            type: "SIGN_PRESCRIPTION";
                                            sessionToken: string;
                                            recoverable?: boolean;
                                        } | {
                                            type: "AUTHENTICATION_SUCCESS";
                                        } | {
                                            type: "ERROR";
                                            error: DomainError;
                                        } | {
                                            type: "UNAUTHORIZED_TOKEN";
                                        } | {
                                            type: "UNAUTHORIZED_HANDLE";
                                        }, undefined, import('xstate').Values<{
                                            openPopup: {
                                                src: "openPopup";
                                                logic: import('xstate').CallbackActorLogic<import('xstate').AnyEventObject, {
                                                    sessionToken?: string;
                                                    hinClient: import('../../core/integration/hin').HINClient;
                                                }, import('xstate').EventObject>;
                                                id: string | undefined;
                                            };
                                            trackPopup: {
                                                src: "trackPopup";
                                                logic: import('xstate').CallbackActorLogic<import('xstate').AnyEventObject, {
                                                    popupRef: Window | null;
                                                }, import('xstate').EventObject>;
                                                id: string | undefined;
                                            };
                                            listenAuthenticationMessage: {
                                                src: "listenAuthenticationMessage";
                                                logic: import('xstate').CallbackActorLogic<import('xstate').AnyEventObject, {
                                                    hinClient: import('../../core/integration/hin').HINClient;
                                                    accessToken: string;
                                                }, import('xstate').EventObject>;
                                                id: string | undefined;
                                            };
                                            listenSamlAuthMessage: {
                                                src: "listenSamlAuthMessage";
                                                logic: import('xstate').CallbackActorLogic<import('xstate').AnyEventObject, {
                                                    hinClient: import('../../core/integration/hin').HINClient;
                                                }, import('xstate').EventObject>;
                                                id: string | undefined;
                                            };
                                            validateCHMED: {
                                                src: "validateCHMED";
                                                logic: import('xstate').PromiseActorLogic<void, {
                                                    encodedCHMED?: string;
                                                    parent: import('xstate').ActorRef<import('xstate').AnyMachineSnapshot, import('../../core').PrescriptionSignEvents>;
                                                    hinClient: import('../../core/integration/hin').HINClient;
                                                    sessionToken?: string;
                                                }, import('xstate').EventObject>;
                                                id: string | undefined;
                                            };
                                            verifySession: {
                                                src: "verifySession";
                                                logic: import('xstate').PromiseActorLogic<void, {
                                                    parent: import('xstate').ActorRef<import('xstate').AnyMachineSnapshot, import('../../core').PrescriptionSignEvents>;
                                                    hinClient: import('../../core/integration/hin').HINClient;
                                                    sessionToken?: string;
                                                }, import('xstate').EventObject>;
                                                id: string | undefined;
                                            };
                                            initOAuth: {
                                                src: "initOAuth";
                                                logic: import('xstate').PromiseActorLogic<void, {
                                                    parent: import('xstate').ActorRef<import('xstate').AnyMachineSnapshot, import('../../core').PrescriptionSignEvents>;
                                                    popupRef: Window | null;
                                                    hinClient: import('../../core/integration/hin').HINClient;
                                                }, import('xstate').EventObject>;
                                                id: string | undefined;
                                            };
                                            listenOAuthMessage: {
                                                src: "listenOAuthMessage";
                                                logic: import('xstate').CallbackActorLogic<import('xstate').AnyEventObject, {
                                                    hinClient: import('../../core/integration/hin').HINClient;
                                                    sessionToken?: string;
                                                }, import('xstate').EventObject>;
                                                id: string | undefined;
                                            };
                                            refreshToken: {
                                                src: "refreshToken";
                                                logic: import('xstate').PromiseActorLogic<{
                                                    sessionToken: string;
                                                }, {
                                                    hinClient: import('../../core/integration/hin').HINClient;
                                                    sessionToken?: string;
                                                }, import('xstate').EventObject>;
                                                id: string | undefined;
                                            };
                                            initSAMLAuthCode: {
                                                src: "initSAMLAuthCode";
                                                logic: import('xstate').PromiseActorLogic<void, {
                                                    parent: import('xstate').ActorRef<import('xstate').AnyMachineSnapshot, import('../../core').PrescriptionSignEvents>;
                                                    popupRef: Window | null;
                                                    hinClient: import('../../core/integration/hin').HINClient;
                                                    recover: boolean;
                                                    sessionToken?: string;
                                                }, import('xstate').EventObject>;
                                                id: string | undefined;
                                            };
                                            listenSAMLAuthCodeMessage: {
                                                src: "listenSAMLAuthCodeMessage";
                                                logic: import('xstate').CallbackActorLogic<import('xstate').AnyEventObject, {
                                                    hinClient: import('../../core/integration/hin').HINClient;
                                                }, import('xstate').EventObject>;
                                                id: string | undefined;
                                            };
                                            getSAMLAuthHandle: {
                                                src: "getSAMLAuthHandle";
                                                logic: import('xstate').PromiseActorLogic<{
                                                    sessionToken: string;
                                                }, {
                                                    parent: import('xstate').ActorRef<import('xstate').AnyMachineSnapshot, import('../../core').PrescriptionSignEvents>;
                                                    authCode: string;
                                                    hinClient: import('../../core/integration/hin').HINClient;
                                                    sessionToken?: string;
                                                }, import('xstate').EventObject>;
                                                id: string | undefined;
                                            };
                                            signCHMEDRx: {
                                                src: "signCHMEDRx";
                                                logic: import('xstate').PromiseActorLogic<{
                                                    signedPrescription: string;
                                                    generatedPdf?: string;
                                                }, {
                                                    encodedCHMED?: string;
                                                    shouldGeneratePdf: boolean;
                                                    parent: import('xstate').ActorRef<import('xstate').AnyMachineSnapshot, import('../../core').PrescriptionSignEvents>;
                                                    hinClient: import('../../core/integration/hin').HINClient;
                                                    sessionToken?: string;
                                                    recover: boolean;
                                                }, import('xstate').EventObject>;
                                                id: string | undefined;
                                            };
                                            errorHandler: {
                                                src: "errorHandler";
                                                logic: import('xstate').CallbackActorLogic<import('xstate').AnyEventObject, {
                                                    error: DomainError;
                                                }, import('xstate').EventObject>;
                                                id: string | undefined;
                                            };
                                            successHandler: {
                                                src: "successHandler";
                                                logic: import('xstate').CallbackActorLogic<import('xstate').AnyEventObject, {
                                                    signedCHMED?: string;
                                                    generatedPdf?: string;
                                                }, import('xstate').EventObject>;
                                                id: string | undefined;
                                            };
                                        }>, never, never, never, never>, {
                                            readonly type: "closePopup";
                                        }];
                                    };
                                    readonly src: "signCHMEDRx";
                                };
                            };
                            readonly Error: {
                                readonly entry: readonly [{
                                    readonly type: "closePopup";
                                }, {
                                    readonly type: "setError";
                                }];
                                readonly invoke: {
                                    readonly id: "errorHandler";
                                    readonly input: ({ context, event }: {
                                        context: import('../../core').PrescriptionSignContext;
                                        event: {
                                            type: "OPEN_POPUP";
                                            popupRef: Window | null;
                                        } | {
                                            type: "CLOSE_POPUP";
                                        } | {
                                            type: "START";
                                            encodedCHMED: string;
                                            shouldGeneratePdf: boolean;
                                        } | {
                                            type: "TERMINATE";
                                        } | {
                                            type: "VERIFY_SESSION";
                                        } | {
                                            type: "REFRESH_TOKEN";
                                        } | {
                                            type: "GET_TOKEN";
                                        } | {
                                            type: "GET_SAML_AUTH_CODE";
                                            recoverable?: boolean;
                                            sessionToken: string;
                                        } | {
                                            type: "GET_SAML_AUTH_HANDLE";
                                            authCode: string;
                                        } | {
                                            type: "VALIDATE_CHMED";
                                            sessionToken: string;
                                        } | {
                                            type: "xstate.done.actor.getSAMLAuthHandle";
                                            sessionToken: string;
                                            recoverable?: boolean;
                                        } | {
                                            type: "SIGN_PRESCRIPTION";
                                            sessionToken: string;
                                            recoverable?: boolean;
                                        } | {
                                            type: "AUTHENTICATION_SUCCESS";
                                        } | {
                                            type: "ERROR";
                                            error: DomainError;
                                        } | {
                                            type: "UNAUTHORIZED_TOKEN";
                                        } | {
                                            type: "UNAUTHORIZED_HANDLE";
                                        };
                                        self: import('xstate').ActorRef<import('xstate').MachineSnapshot<import('../../core').PrescriptionSignContext, {
                                            type: "OPEN_POPUP";
                                            popupRef: Window | null;
                                        } | {
                                            type: "CLOSE_POPUP";
                                        } | {
                                            type: "START";
                                            encodedCHMED: string;
                                            shouldGeneratePdf: boolean;
                                        } | {
                                            type: "TERMINATE";
                                        } | {
                                            type: "VERIFY_SESSION";
                                        } | {
                                            type: "REFRESH_TOKEN";
                                        } | {
                                            type: "GET_TOKEN";
                                        } | {
                                            type: "GET_SAML_AUTH_CODE";
                                            recoverable?: boolean;
                                            sessionToken: string;
                                        } | {
                                            type: "GET_SAML_AUTH_HANDLE";
                                            authCode: string;
                                        } | {
                                            type: "VALIDATE_CHMED";
                                            sessionToken: string;
                                        } | {
                                            type: "xstate.done.actor.getSAMLAuthHandle";
                                            sessionToken: string;
                                            recoverable?: boolean;
                                        } | {
                                            type: "SIGN_PRESCRIPTION";
                                            sessionToken: string;
                                            recoverable?: boolean;
                                        } | {
                                            type: "AUTHENTICATION_SUCCESS";
                                        } | {
                                            type: "ERROR";
                                            error: DomainError;
                                        } | {
                                            type: "UNAUTHORIZED_TOKEN";
                                        } | {
                                            type: "UNAUTHORIZED_HANDLE";
                                        }, Record<string, import('xstate').AnyActorRef>, import('xstate').StateValue, string, unknown, any, any>, {
                                            type: "OPEN_POPUP";
                                            popupRef: Window | null;
                                        } | {
                                            type: "CLOSE_POPUP";
                                        } | {
                                            type: "START";
                                            encodedCHMED: string;
                                            shouldGeneratePdf: boolean;
                                        } | {
                                            type: "TERMINATE";
                                        } | {
                                            type: "VERIFY_SESSION";
                                        } | {
                                            type: "REFRESH_TOKEN";
                                        } | {
                                            type: "GET_TOKEN";
                                        } | {
                                            type: "GET_SAML_AUTH_CODE";
                                            recoverable?: boolean;
                                            sessionToken: string;
                                        } | {
                                            type: "GET_SAML_AUTH_HANDLE";
                                            authCode: string;
                                        } | {
                                            type: "VALIDATE_CHMED";
                                            sessionToken: string;
                                        } | {
                                            type: "xstate.done.actor.getSAMLAuthHandle";
                                            sessionToken: string;
                                            recoverable?: boolean;
                                        } | {
                                            type: "SIGN_PRESCRIPTION";
                                            sessionToken: string;
                                            recoverable?: boolean;
                                        } | {
                                            type: "AUTHENTICATION_SUCCESS";
                                        } | {
                                            type: "ERROR";
                                            error: DomainError;
                                        } | {
                                            type: "UNAUTHORIZED_TOKEN";
                                        } | {
                                            type: "UNAUTHORIZED_HANDLE";
                                        }, import('xstate').AnyEventObject>;
                                    }) => {
                                        error: DomainError;
                                    };
                                    readonly src: "errorHandler";
                                };
                                readonly on: {
                                    readonly START: {
                                        readonly target: "#HINPrescriptionSigning.Started";
                                        readonly actions: import('xstate').ActionFunction<import('../../core').PrescriptionSignContext, {
                                            type: "START";
                                            encodedCHMED: string;
                                            shouldGeneratePdf: boolean;
                                        }, {
                                            type: "OPEN_POPUP";
                                            popupRef: Window | null;
                                        } | {
                                            type: "CLOSE_POPUP";
                                        } | {
                                            type: "START";
                                            encodedCHMED: string;
                                            shouldGeneratePdf: boolean;
                                        } | {
                                            type: "TERMINATE";
                                        } | {
                                            type: "VERIFY_SESSION";
                                        } | {
                                            type: "REFRESH_TOKEN";
                                        } | {
                                            type: "GET_TOKEN";
                                        } | {
                                            type: "GET_SAML_AUTH_CODE";
                                            recoverable?: boolean;
                                            sessionToken: string;
                                        } | {
                                            type: "GET_SAML_AUTH_HANDLE";
                                            authCode: string;
                                        } | {
                                            type: "VALIDATE_CHMED";
                                            sessionToken: string;
                                        } | {
                                            type: "xstate.done.actor.getSAMLAuthHandle";
                                            sessionToken: string;
                                            recoverable?: boolean;
                                        } | {
                                            type: "SIGN_PRESCRIPTION";
                                            sessionToken: string;
                                            recoverable?: boolean;
                                        } | {
                                            type: "AUTHENTICATION_SUCCESS";
                                        } | {
                                            type: "ERROR";
                                            error: DomainError;
                                        } | {
                                            type: "UNAUTHORIZED_TOKEN";
                                        } | {
                                            type: "UNAUTHORIZED_HANDLE";
                                        }, undefined, import('xstate').Values<{
                                            openPopup: {
                                                src: "openPopup";
                                                logic: import('xstate').CallbackActorLogic<import('xstate').AnyEventObject, {
                                                    sessionToken?: string;
                                                    hinClient: import('../../core/integration/hin').HINClient;
                                                }, import('xstate').EventObject>;
                                                id: string | undefined;
                                            };
                                            trackPopup: {
                                                src: "trackPopup";
                                                logic: import('xstate').CallbackActorLogic<import('xstate').AnyEventObject, {
                                                    popupRef: Window | null;
                                                }, import('xstate').EventObject>;
                                                id: string | undefined;
                                            };
                                            listenAuthenticationMessage: {
                                                src: "listenAuthenticationMessage";
                                                logic: import('xstate').CallbackActorLogic<import('xstate').AnyEventObject, {
                                                    hinClient: import('../../core/integration/hin').HINClient;
                                                    accessToken: string;
                                                }, import('xstate').EventObject>;
                                                id: string | undefined;
                                            };
                                            listenSamlAuthMessage: {
                                                src: "listenSamlAuthMessage";
                                                logic: import('xstate').CallbackActorLogic<import('xstate').AnyEventObject, {
                                                    hinClient: import('../../core/integration/hin').HINClient;
                                                }, import('xstate').EventObject>;
                                                id: string | undefined;
                                            };
                                            validateCHMED: {
                                                src: "validateCHMED";
                                                logic: import('xstate').PromiseActorLogic<void, {
                                                    encodedCHMED?: string;
                                                    parent: import('xstate').ActorRef<import('xstate').AnyMachineSnapshot, import('../../core').PrescriptionSignEvents>;
                                                    hinClient: import('../../core/integration/hin').HINClient;
                                                    sessionToken?: string;
                                                }, import('xstate').EventObject>;
                                                id: string | undefined;
                                            };
                                            verifySession: {
                                                src: "verifySession";
                                                logic: import('xstate').PromiseActorLogic<void, {
                                                    parent: import('xstate').ActorRef<import('xstate').AnyMachineSnapshot, import('../../core').PrescriptionSignEvents>;
                                                    hinClient: import('../../core/integration/hin').HINClient;
                                                    sessionToken?: string;
                                                }, import('xstate').EventObject>;
                                                id: string | undefined;
                                            };
                                            initOAuth: {
                                                src: "initOAuth";
                                                logic: import('xstate').PromiseActorLogic<void, {
                                                    parent: import('xstate').ActorRef<import('xstate').AnyMachineSnapshot, import('../../core').PrescriptionSignEvents>;
                                                    popupRef: Window | null;
                                                    hinClient: import('../../core/integration/hin').HINClient;
                                                }, import('xstate').EventObject>;
                                                id: string | undefined;
                                            };
                                            listenOAuthMessage: {
                                                src: "listenOAuthMessage";
                                                logic: import('xstate').CallbackActorLogic<import('xstate').AnyEventObject, {
                                                    hinClient: import('../../core/integration/hin').HINClient;
                                                    sessionToken?: string;
                                                }, import('xstate').EventObject>;
                                                id: string | undefined;
                                            };
                                            refreshToken: {
                                                src: "refreshToken";
                                                logic: import('xstate').PromiseActorLogic<{
                                                    sessionToken: string;
                                                }, {
                                                    hinClient: import('../../core/integration/hin').HINClient;
                                                    sessionToken?: string;
                                                }, import('xstate').EventObject>;
                                                id: string | undefined;
                                            };
                                            initSAMLAuthCode: {
                                                src: "initSAMLAuthCode";
                                                logic: import('xstate').PromiseActorLogic<void, {
                                                    parent: import('xstate').ActorRef<import('xstate').AnyMachineSnapshot, import('../../core').PrescriptionSignEvents>;
                                                    popupRef: Window | null;
                                                    hinClient: import('../../core/integration/hin').HINClient;
                                                    recover: boolean;
                                                    sessionToken?: string;
                                                }, import('xstate').EventObject>;
                                                id: string | undefined;
                                            };
                                            listenSAMLAuthCodeMessage: {
                                                src: "listenSAMLAuthCodeMessage";
                                                logic: import('xstate').CallbackActorLogic<import('xstate').AnyEventObject, {
                                                    hinClient: import('../../core/integration/hin').HINClient;
                                                }, import('xstate').EventObject>;
                                                id: string | undefined;
                                            };
                                            getSAMLAuthHandle: {
                                                src: "getSAMLAuthHandle";
                                                logic: import('xstate').PromiseActorLogic<{
                                                    sessionToken: string;
                                                }, {
                                                    parent: import('xstate').ActorRef<import('xstate').AnyMachineSnapshot, import('../../core').PrescriptionSignEvents>;
                                                    authCode: string;
                                                    hinClient: import('../../core/integration/hin').HINClient;
                                                    sessionToken?: string;
                                                }, import('xstate').EventObject>;
                                                id: string | undefined;
                                            };
                                            signCHMEDRx: {
                                                src: "signCHMEDRx";
                                                logic: import('xstate').PromiseActorLogic<{
                                                    signedPrescription: string;
                                                    generatedPdf?: string;
                                                }, {
                                                    encodedCHMED?: string;
                                                    shouldGeneratePdf: boolean;
                                                    parent: import('xstate').ActorRef<import('xstate').AnyMachineSnapshot, import('../../core').PrescriptionSignEvents>;
                                                    hinClient: import('../../core/integration/hin').HINClient;
                                                    sessionToken?: string;
                                                    recover: boolean;
                                                }, import('xstate').EventObject>;
                                                id: string | undefined;
                                            };
                                            errorHandler: {
                                                src: "errorHandler";
                                                logic: import('xstate').CallbackActorLogic<import('xstate').AnyEventObject, {
                                                    error: DomainError;
                                                }, import('xstate').EventObject>;
                                                id: string | undefined;
                                            };
                                            successHandler: {
                                                src: "successHandler";
                                                logic: import('xstate').CallbackActorLogic<import('xstate').AnyEventObject, {
                                                    signedCHMED?: string;
                                                    generatedPdf?: string;
                                                }, import('xstate').EventObject>;
                                                id: string | undefined;
                                            };
                                        }>, never, never, never, never>;
                                    };
                                    readonly TERMINATE: {
                                        readonly target: "End";
                                    };
                                };
                            };
                            readonly Success: {
                                readonly on: {
                                    readonly TERMINATE: {
                                        readonly target: "End";
                                        readonly actions: readonly [{
                                            readonly type: "closePopup";
                                        }];
                                    };
                                };
                                readonly invoke: {
                                    readonly id: "successHandler";
                                    readonly input: ({ context }: {
                                        context: import('../../core').PrescriptionSignContext;
                                        event: {
                                            type: "OPEN_POPUP";
                                            popupRef: Window | null;
                                        } | {
                                            type: "CLOSE_POPUP";
                                        } | {
                                            type: "START";
                                            encodedCHMED: string;
                                            shouldGeneratePdf: boolean;
                                        } | {
                                            type: "TERMINATE";
                                        } | {
                                            type: "VERIFY_SESSION";
                                        } | {
                                            type: "REFRESH_TOKEN";
                                        } | {
                                            type: "GET_TOKEN";
                                        } | {
                                            type: "GET_SAML_AUTH_CODE";
                                            recoverable?: boolean;
                                            sessionToken: string;
                                        } | {
                                            type: "GET_SAML_AUTH_HANDLE";
                                            authCode: string;
                                        } | {
                                            type: "VALIDATE_CHMED";
                                            sessionToken: string;
                                        } | {
                                            type: "xstate.done.actor.getSAMLAuthHandle";
                                            sessionToken: string;
                                            recoverable?: boolean;
                                        } | {
                                            type: "SIGN_PRESCRIPTION";
                                            sessionToken: string;
                                            recoverable?: boolean;
                                        } | {
                                            type: "AUTHENTICATION_SUCCESS";
                                        } | {
                                            type: "ERROR";
                                            error: DomainError;
                                        } | {
                                            type: "UNAUTHORIZED_TOKEN";
                                        } | {
                                            type: "UNAUTHORIZED_HANDLE";
                                        };
                                        self: import('xstate').ActorRef<import('xstate').MachineSnapshot<import('../../core').PrescriptionSignContext, {
                                            type: "OPEN_POPUP";
                                            popupRef: Window | null;
                                        } | {
                                            type: "CLOSE_POPUP";
                                        } | {
                                            type: "START";
                                            encodedCHMED: string;
                                            shouldGeneratePdf: boolean;
                                        } | {
                                            type: "TERMINATE";
                                        } | {
                                            type: "VERIFY_SESSION";
                                        } | {
                                            type: "REFRESH_TOKEN";
                                        } | {
                                            type: "GET_TOKEN";
                                        } | {
                                            type: "GET_SAML_AUTH_CODE";
                                            recoverable?: boolean;
                                            sessionToken: string;
                                        } | {
                                            type: "GET_SAML_AUTH_HANDLE";
                                            authCode: string;
                                        } | {
                                            type: "VALIDATE_CHMED";
                                            sessionToken: string;
                                        } | {
                                            type: "xstate.done.actor.getSAMLAuthHandle";
                                            sessionToken: string;
                                            recoverable?: boolean;
                                        } | {
                                            type: "SIGN_PRESCRIPTION";
                                            sessionToken: string;
                                            recoverable?: boolean;
                                        } | {
                                            type: "AUTHENTICATION_SUCCESS";
                                        } | {
                                            type: "ERROR";
                                            error: DomainError;
                                        } | {
                                            type: "UNAUTHORIZED_TOKEN";
                                        } | {
                                            type: "UNAUTHORIZED_HANDLE";
                                        }, Record<string, import('xstate').AnyActorRef>, import('xstate').StateValue, string, unknown, any, any>, {
                                            type: "OPEN_POPUP";
                                            popupRef: Window | null;
                                        } | {
                                            type: "CLOSE_POPUP";
                                        } | {
                                            type: "START";
                                            encodedCHMED: string;
                                            shouldGeneratePdf: boolean;
                                        } | {
                                            type: "TERMINATE";
                                        } | {
                                            type: "VERIFY_SESSION";
                                        } | {
                                            type: "REFRESH_TOKEN";
                                        } | {
                                            type: "GET_TOKEN";
                                        } | {
                                            type: "GET_SAML_AUTH_CODE";
                                            recoverable?: boolean;
                                            sessionToken: string;
                                        } | {
                                            type: "GET_SAML_AUTH_HANDLE";
                                            authCode: string;
                                        } | {
                                            type: "VALIDATE_CHMED";
                                            sessionToken: string;
                                        } | {
                                            type: "xstate.done.actor.getSAMLAuthHandle";
                                            sessionToken: string;
                                            recoverable?: boolean;
                                        } | {
                                            type: "SIGN_PRESCRIPTION";
                                            sessionToken: string;
                                            recoverable?: boolean;
                                        } | {
                                            type: "AUTHENTICATION_SUCCESS";
                                        } | {
                                            type: "ERROR";
                                            error: DomainError;
                                        } | {
                                            type: "UNAUTHORIZED_TOKEN";
                                        } | {
                                            type: "UNAUTHORIZED_HANDLE";
                                        }, import('xstate').AnyEventObject>;
                                    }) => {
                                        signedCHMED: string | undefined;
                                        generatedPdf: string | undefined;
                                    };
                                    readonly src: "successHandler";
                                };
                            };
                            readonly End: {
                                readonly type: "final";
                            };
                        };
                    };
                };
            };
        };
    }>;
    isIdle: boolean;
    isActive: boolean;
    isError: boolean;
    isSuccess: boolean;
    isSigning: boolean;
    signedCHMED: string | undefined;
};
