import { EventEmitter, OnDestroy, OnInit } from '@angular/core';
import { FormBuilder, FormGroup } from '@angular/forms';
import { ActivatedRoute, Router } from '@angular/router';
import { Observable, Subject } from 'rxjs';
import { AbstractAppConfig } from '../../../../app.config';
import { ConditionalShowRegistrarService } from '../../../directives';
import { CaseEditGetNextPage, CaseEditSubmitForm, CaseEditonEventCanBeCompleted, CaseEventData, CaseEventTrigger, CaseView, Draft, HttpError, Profile } from '../../../domain';
import { EventDetails, Task, TaskEventCompletionInfo } from '../../../domain/work-allocation/Task';
import { AlertService, FieldsPurger, FieldsUtils, FormErrorService, FormValueService, LoadingService, ReadCookieService, SessionStorageService, WindowService } from '../../../services';
import { Confirmation, Wizard, WizardPage } from '../domain';
import { EventCompletionParams } from '../domain/event-completion-params.model';
import { CaseNotifier, WizardFactoryService, WorkAllocationService } from '../services';
import { ValidPageListCaseFieldsService } from '../services/valid-page-list-caseFields.service';
import * as i0 from "@angular/core";
export declare class CaseEditComponent implements OnInit, OnDestroy {
    private readonly fb;
    private readonly caseNotifier;
    private readonly router;
    private readonly route;
    private readonly fieldsUtils;
    private readonly fieldsPurger;
    private readonly registrarService;
    private readonly wizardFactory;
    private readonly sessionStorageService;
    private readonly windowsService;
    private readonly formValueService;
    private readonly formErrorService;
    private readonly loadingService;
    private readonly validPageListCaseFieldsService;
    private readonly workAllocationService;
    private readonly alertService;
    private readonly abstractConfig;
    private readonly cookieService;
    static readonly ORIGIN_QUERY_PARAM = "origin";
    static readonly ALERT_MESSAGE = "Page is being refreshed so you will be redirected to the first page of this event.";
    static readonly CLIENT_CONTEXT = "clientContext";
    static readonly TASK_EVENT_COMPLETION_INFO = "taskEventCompletionInfo";
    eventTrigger: CaseEventTrigger;
    submit: (caseEventData: CaseEventData, profile?: Profile) => Observable<object>;
    validate: (caseEventData: CaseEventData, pageId: string) => Observable<object>;
    saveDraft: (caseEventData: CaseEventData) => Observable<Draft>;
    caseDetails: CaseView;
    cancelled: EventEmitter<any>;
    submitted: EventEmitter<any>;
    wizard: Wizard;
    form: FormGroup;
    confirmation: Confirmation;
    navigationOrigin: any;
    initialUrl: string;
    isPageRefreshed: boolean;
    isSubmitting: boolean;
    eventCompletionParams: EventCompletionParams;
    submitResponse: Record<string, any>;
    isEventCompletionChecksRequired: boolean;
    isCaseFlagSubmission: boolean;
    ignoreWarning: boolean;
    isLinkedCasesSubmission: boolean;
    error: HttpError;
    callbackErrorsSubject: Subject<any>;
    validPageList: WizardPage[];
    constructor(fb: FormBuilder, caseNotifier: CaseNotifier, router: Router, route: ActivatedRoute, fieldsUtils: FieldsUtils, fieldsPurger: FieldsPurger, registrarService: ConditionalShowRegistrarService, wizardFactory: WizardFactoryService, sessionStorageService: SessionStorageService, windowsService: WindowService, formValueService: FormValueService, formErrorService: FormErrorService, loadingService: LoadingService, validPageListCaseFieldsService: ValidPageListCaseFieldsService, workAllocationService: WorkAllocationService, alertService: AlertService, abstractConfig: AbstractAppConfig, cookieService: ReadCookieService);
    ngOnInit(): void;
    ngOnDestroy(): void;
    checkPageRefresh(): boolean;
    getPage(pageId: string): WizardPage;
    first(): Promise<boolean>;
    navigateToPage(pageId: string): Promise<boolean>;
    next(currentPageId: string): Promise<boolean>;
    previous(currentPageId: string): Promise<boolean>;
    hasPrevious(currentPageId: string): boolean;
    cancel(): void;
    emitSubmitted(response: Record<string, any>): void;
    getNextPage({ wizard, currentPageId, eventTrigger, form }: CaseEditGetNextPage): WizardPage;
    confirm(confirmation: Confirmation): Promise<boolean>;
    submitForm({ eventTrigger, form, caseDetails, submit }: CaseEditSubmitForm): void;
    getCaseId(caseDetails: CaseView): string;
    private getEventId;
    private generateCaseEventData;
    /**
     * Replaces non-array value objects with `null` for any Complex-type fields whose value is effectively empty, i.e.
     * all its sub-fields and descendants are `null` or `undefined`.
     *
     * @param data The object tree representing all the form field data
     * @returns The form field data modified accordingly
     */
    private replaceEmptyComplexFieldValues;
    /**
     * Traverse *all* values of a {@link FormGroup}, including those for disabled fields (i.e. hidden ones), replacing the
     * value of any that are hidden AND have `retain_hidden_value` set to `true` in the corresponding `CaseField`, with
     * the *original* value held in the `CaseField` object.
     *
     * This is as per design in EUI-3622, where any user-driven updates to hidden fields with `retain_hidden_value` =
     * `true` are ignored (thus retaining the value displayed originally).
     *
     * * For Complex field types, the replacement above is performed recursively for all hidden sub-fields with
     * `retain_hidden_value` = `true`.
     *
     * * For Collection field types, including collections of Complex and Document field types, the replacement is
     * performed for all fields in the collection.
     *
     * @param formGroup The `FormGroup` instance whose raw values are to be traversed
     * @param caseFields The array of {@link CaseField} domain model objects corresponding to fields in `formGroup`
     * @param parentField Reference to the parent `CaseField`. Used for retrieving the sub-field values of a Complex field
     * to perform recursive replacement - the sub-field `CaseField`s themselves do *not* contain any values
     * @returns An object with the *raw* form value data (as key-value pairs), with any value replacements as necessary
     */
    private replaceHiddenFormValuesWithOriginalCaseData;
    private handleNonComplexField;
    private handleComplexField;
    private caseSubmit;
    private postCompleteTaskIfRequired;
    private finishEventCompletionLogic;
    private buildConfirmation;
    taskExistsForThisEvent(taskInSessionStorage: Task, taskEventCompletionInfo: TaskEventCompletionInfo, eventDetails: EventDetails): boolean;
    onEventCanBeCompleted({ eventTrigger, eventCanBeCompleted, caseDetails, form, submit }: CaseEditonEventCanBeCompleted): void;
    getStatus(response: object): any;
    private hasCallbackFailed;
    private eventMoreThanDayAgo;
    private eventDetailsDoNotMatch;
    private taskIsForEvent;
    static ɵfac: i0.ɵɵFactoryDeclaration<CaseEditComponent, never>;
    static ɵcmp: i0.ɵɵComponentDeclaration<CaseEditComponent, "ccd-case-edit", never, { "eventTrigger": { "alias": "eventTrigger"; "required": false; }; "submit": { "alias": "submit"; "required": false; }; "validate": { "alias": "validate"; "required": false; }; "saveDraft": { "alias": "saveDraft"; "required": false; }; "caseDetails": { "alias": "caseDetails"; "required": false; }; }, { "cancelled": "cancelled"; "submitted": "submitted"; }, never, never, false, never>;
}
//# sourceMappingURL=case-edit.component.d.ts.map