import { NgTemplateOutlet } from '@angular/common';
import * as i0 from '@angular/core';
import { InjectionToken, ViewChild, Inject, ChangeDetectionStrategy, ViewEncapsulation, Component, EventEmitter, input, booleanAttribute, inject, DestroyRef, Injector, ElementRef, forwardRef, Input, ViewChildren, Output, Optional, NgModule } from '@angular/core';
import { takeUntilDestroyed } from '@angular/core/rxjs-interop';
import { InitialFocusDirective, DynamicComponentService, FocusTrapService } from '@fundamental-ngx/cdk/utils';
import { ButtonBarComponent, BarComponent, BarRightDirective, BarElementDirective } from '@fundamental-ngx/core/bar';
import { DialogFooterComponent, DialogComponent, DialogBodyComponent, DialogCloseButtonComponent, DialogHeaderComponent } from '@fundamental-ngx/core/dialog';
import { MobileModeBase, MobileModeControl } from '@fundamental-ngx/core/mobile-mode';
import { TitleComponent } from '@fundamental-ngx/core/title';
import * as i4 from '@angular/forms';
import { FormsModule, NG_VALUE_ACCESSOR, NG_VALIDATORS } from '@angular/forms';
import { ButtonComponent } from '@fundamental-ngx/core/button';
import { CalendarTypeEnum, FdCalendarViewEnum, CalendarComponent, CalendarLegendFocusingService } from '@fundamental-ngx/core/calendar';
import * as i1 from '@fundamental-ngx/core/datetime';
import { DATE_TIME_FORMATS } from '@fundamental-ngx/core/datetime';
import * as i2 from '@fundamental-ngx/core/form';
import { FormMessageComponent, PopoverFormMessageService, registerFormItemControl } from '@fundamental-ngx/core/form';
import { InputGroupComponent, InputGroupInputDirective } from '@fundamental-ngx/core/input-group';
import * as i3 from '@fundamental-ngx/core/popover';
import { PopoverModule, PopoverService } from '@fundamental-ngx/core/popover';
import { FdTranslatePipe } from '@fundamental-ngx/i18n';
import { Subscription } from 'rxjs';
import { startWith } from 'rxjs/operators';

const FD_DATE_PICKER_COMPONENT = new InjectionToken('FdDatePickerComponent');
const FD_DATE_PICKER_MOBILE_CONFIG = new InjectionToken('FdDatePickerMobileConfig');

class DatePickerMobileComponent extends MobileModeBase {
    /** @hidden */
    constructor(datePickerConfig, datePickerComponent) {
        super(datePickerComponent, MobileModeControl.DATE_PICKER);
        this.datePickerConfig = datePickerConfig;
        this._component.isOpenChange.subscribe((isOpen) => {
            this._toggleDialog(isOpen);
        });
    }
    /** @hidden */
    _getShowCalendarLegend() {
        const show = this._component.showCalendarLegend;
        if (typeof show === 'boolean') {
            return show;
        }
        return show?.() || false;
    }
    /** @hidden */
    _getLegendCol() {
        const col = this._component.legendCol;
        if (typeof col === 'boolean') {
            return col;
        }
        return col?.() || false;
    }
    /** @hidden */
    handleApprove() {
        this.dialogRef.close();
        this._component.dialogApprove();
    }
    /** @hidden */
    handleDismiss() {
        this.dialogRef.dismiss();
        this._component.dialogDismiss(this._selectedBackup);
    }
    /** @hidden */
    _toggleDialog(open) {
        if (open) {
            this._selectedBackup = this._component.getSelectedDate();
            if (!this._dialogService.hasOpenDialogs()) {
                this._open();
            }
        }
    }
    /** @hidden */
    _open() {
        this.dialogRef = this._dialogService.open(this.dialogTemplate, {
            mobile: true,
            backdropClickCloseable: false,
            disablePaddings: true,
            ...this.dialogConfig,
            container: this._elementRef.nativeElement
        });
        this._selectedBackup = this._component.getSelectedDate();
        const refSub = this.dialogRef.afterClosed.pipe(takeUntilDestroyed(this._destroyRef)).subscribe({
            error: (type) => {
                if (type === 'escape') {
                    this._component.dialogDismiss(this._selectedBackup);
                    refSub.unsubscribe();
                }
            }
        });
    }
    static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.1.0", ngImport: i0, type: DatePickerMobileComponent, deps: [{ token: FD_DATE_PICKER_MOBILE_CONFIG }, { token: FD_DATE_PICKER_COMPONENT }], target: i0.ɵɵFactoryTarget.Component }); }
    static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.1.0", type: DatePickerMobileComponent, isStandalone: true, selector: "fd-date-picker-mobile", viewQueries: [{ propertyName: "dialogTemplate", first: true, predicate: ["dialogTemplate"], descendants: true }], usesInheritance: true, ngImport: i0, template: "<ng-template [fdDialogTemplate] let-dialog let-dialogConfig=\"dialogConfig\" #dialogTemplate>\n    <fd-dialog [dialogConfig]=\"dialogConfig\" [dialogRef]=\"dialog\">\n        <fd-dialog-header>\n            @if (mobileConfig.title) {\n                <h1 fd-title>{{ mobileConfig.title }}</h1>\n            }\n            @if (mobileConfig.hasCloseButton) {\n                <button title=\"Close\" fd-dialog-close-button [mobile]=\"true\" (click)=\"handleDismiss()\"></button>\n            }\n        </fd-dialog-header>\n        <fd-dialog-body>\n            <ng-template [ngTemplateOutlet]=\"datePickerConfig.calendarTemplate || null\"></ng-template>\n        </fd-dialog-body>\n        <fd-dialog-footer>\n            @if (mobileConfig.approveButtonText) {\n                <fd-button-bar fdType=\"emphasized\" [label]=\"mobileConfig.approveButtonText!\" (click)=\"handleApprove()\">\n                </fd-button-bar>\n            }\n            @if (mobileConfig.cancelButtonText) {\n                <fd-button-bar fdkInitialFocus [label]=\"mobileConfig.cancelButtonText!\" (click)=\"handleDismiss()\">\n                </fd-button-bar>\n            }\n        </fd-dialog-footer>\n    </fd-dialog>\n</ng-template>\n", dependencies: [{ kind: "component", type: TitleComponent, selector: "[fd-title], [fdTitle]", inputs: ["headerSize", "wrap"], exportAs: ["fd-title"] }, { kind: "directive", type: NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "component", type: DialogFooterComponent, selector: "fd-dialog-footer" }, { kind: "component", type: DialogComponent, selector: "fd-dialog", inputs: ["class", "dialogRef", "dialogConfig"] }, { kind: "component", type: DialogBodyComponent, selector: "fd-dialog-body", inputs: ["disablePaddings"] }, { kind: "component", type: DialogCloseButtonComponent, selector: "[fd-dialog-close-button]", inputs: ["mobile", "title", "ariaLabel"] }, { kind: "component", type: DialogHeaderComponent, selector: "fd-dialog-header" }, { kind: "component", type: ButtonBarComponent, selector: "fd-button-bar", inputs: ["fullWidth", "fdType", "title", "ariaLabelledby", "id"] }, { kind: "directive", type: InitialFocusDirective, selector: "[fdkInitialFocus]", inputs: ["fdkInitialFocus", "enabled", "focusLastElement"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None }); }
}
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.1.0", ngImport: i0, type: DatePickerMobileComponent, decorators: [{
            type: Component,
            args: [{ selector: 'fd-date-picker-mobile', encapsulation: ViewEncapsulation.None, changeDetection: ChangeDetectionStrategy.OnPush, imports: [
                        TitleComponent,
                        NgTemplateOutlet,
                        DialogFooterComponent,
                        DialogComponent,
                        DialogBodyComponent,
                        DialogCloseButtonComponent,
                        DialogHeaderComponent,
                        ButtonBarComponent,
                        InitialFocusDirective
                    ], template: "<ng-template [fdDialogTemplate] let-dialog let-dialogConfig=\"dialogConfig\" #dialogTemplate>\n    <fd-dialog [dialogConfig]=\"dialogConfig\" [dialogRef]=\"dialog\">\n        <fd-dialog-header>\n            @if (mobileConfig.title) {\n                <h1 fd-title>{{ mobileConfig.title }}</h1>\n            }\n            @if (mobileConfig.hasCloseButton) {\n                <button title=\"Close\" fd-dialog-close-button [mobile]=\"true\" (click)=\"handleDismiss()\"></button>\n            }\n        </fd-dialog-header>\n        <fd-dialog-body>\n            <ng-template [ngTemplateOutlet]=\"datePickerConfig.calendarTemplate || null\"></ng-template>\n        </fd-dialog-body>\n        <fd-dialog-footer>\n            @if (mobileConfig.approveButtonText) {\n                <fd-button-bar fdType=\"emphasized\" [label]=\"mobileConfig.approveButtonText!\" (click)=\"handleApprove()\">\n                </fd-button-bar>\n            }\n            @if (mobileConfig.cancelButtonText) {\n                <fd-button-bar fdkInitialFocus [label]=\"mobileConfig.cancelButtonText!\" (click)=\"handleDismiss()\">\n                </fd-button-bar>\n            }\n        </fd-dialog-footer>\n    </fd-dialog>\n</ng-template>\n" }]
        }], ctorParameters: () => [{ type: undefined, decorators: [{
                    type: Inject,
                    args: [FD_DATE_PICKER_MOBILE_CONFIG]
                }] }, { type: undefined, decorators: [{
                    type: Inject,
                    args: [FD_DATE_PICKER_COMPONENT]
                }] }], propDecorators: { dialogTemplate: [{
                type: ViewChild,
                args: ['dialogTemplate']
            }] } });

/** Creates an error to be thrown when attempting to use an invalid date implementation. */
function createMissingDateImplementationError(provider) {
    return Error(`FdDatePicker: No provider found for ${provider}. You must import one of the following ` +
        `modules at your application root: FdDatetimeModule, or provide a ` +
        `custom implementation.`);
}

let datePickerCounter = 0;
/**
 * The datetime picker component is an opinionated composition of the fd-popover and
 * fd-calendar components to accomplish the UI pattern for picking a date.
 *
 * Supports Angular Forms.
 * ```html
 * <fd-date-picker [(ngModel)]="date"></fd-date-picker>
 * ```
 *
 */
class DatePickerComponent {
    /** Text displayed in message */
    set message(message) {
        this._message = message;
    }
    /** The trigger events that will open/close the message box.
     *  Accepts any [HTML DOM Events](https://www.w3schools.com/jsref/dom_obj_event.asp). */
    set messageTriggers(triggers) {
        this._messageTriggers = triggers;
        this._popoverFormMessage.triggers = triggers;
    }
    /**
     *  The state of the form control - applies css classes.
     *  Also, this is applied to message.
     *  Can be `success`, `error`, `warning`, `information` or blank for default.
     */
    set state(state) {
        this._state = state || 'default';
    }
    /** @hidden */
    get state() {
        if (this._state == null && this.useValidation && this._isInvalidDateInput) {
            return 'error';
        }
        return this._state;
    }
    /** Whether the date picker is open. Can be used through two-way binding. */
    set isOpen(value) {
        if (value === this._isOpen) {
            return;
        }
        this._isOpen = value;
        this._showPopoverContents = value;
        this._changeDetectionRef.detectChanges();
    }
    get isOpen() {
        return this._isOpen;
    }
    /** @hidden */
    get _rangeDelimiter() {
        return this._dateTimeFormats.rangeDelimiter;
    }
    /**
     * Date input aria label key based on type
     * @hidden
     */
    get _dateInputArialLabelKey() {
        // return either input value or a key for "fdTranslate" pipe
        return this.type === CalendarTypeEnum.Range
            ? 'coreDatePicker.dateRangeInputLabel'
            : 'coreDatePicker.dateInputLabel';
    }
    /** @hidden */
    constructor(_changeDetectionRef, 
    // Use @Optional to avoid angular injection error message and throw our own which is more precise one
    _dateTimeAdapter, _dateTimeFormats, _popoverFormMessage) {
        this._changeDetectionRef = _changeDetectionRef;
        this._dateTimeAdapter = _dateTimeAdapter;
        this._dateTimeFormats = _dateTimeFormats;
        this._popoverFormMessage = _popoverFormMessage;
        /** The type of calendar, 'single' for single date selection or 'range' for a range of dates. */
        this.type = CalendarTypeEnum.Single;
        /** Date picker input placeholder string */
        this.placeholder = '';
        /** If it is mandatory field */
        this.required = false;
        /** The currently selected date model in multiple mode. */
        this.selectedMultipleDates = [];
        /** The currently selected date model with start and end in range mode. */
        this.selectedRangeDate = { start: null, end: null };
        /** The currently selected date model with multiple ranges. */
        this.selectedMultipleDateRanges = [];
        /**
         * Whether user wants to mark day cells on hover.
         * Works only on range mode, when start date is selected on Day View.
         */
        this.rangeHoverEffect = false;
        /** Whether to validate the date picker input. */
        this.useValidation = true;
        /** Whether a null input is considered valid. */
        this.allowNull = true;
        /** Actually shown active view one of 'day' | 'month' | 'year' in calendar component*/
        this.activeView = FdCalendarViewEnum.Day;
        /**
         *  The placement of the popover. It can be one of: top, top-start, top-end, bottom,
         *  bottom-start, bottom-end, right, right-start, right-end, left, left-start, left-end.
         */
        this.placement = 'bottom-start';
        /** Defines if date picker should be closed after date choose */
        this.closeOnDateChoose = true;
        /** Enables Today-Selection-Button if true */
        this.showTodayButton = false;
        /** Label for Today-Selection-Button */
        this.todayButtonLabel = 'Today';
        /**
         * @deprecated Popover is toggled with f4 key
         */
        this.buttonFocusable = false;
        /**
         * Special days mark, it can be used by passing array of object with
         * Special day number, list 1-20 [class:`fd-calendar__item--legend-{{number}}`] is available there:
         * https://sap.github.io/fundamental-styles/components/calendar.html calendar special days section
         * Rule accepts method with FdDate object as a parameter. ex:
         * `rule: (fdDate: FdDate) => fdDate.getDay() === 1`, which will mark all sundays as special day.
         */
        this.specialDaysRules = [];
        /**
         * Object to customize year grid,
         * Row, Columns and method to display year can be modified
         */
        this.yearGrid = {
            rows: 4,
            cols: 5
        };
        /**
         * Object to customize aggregated year grid,
         * Row, Columns and method to display year can be modified
         */
        this.aggregatedYearGrid = {
            rows: 4,
            cols: 3
        };
        /**
         * Whether user wants to mark sunday/saturday with `fd-calendar__item--weekend` class
         */
        this.markWeekends = true;
        /**
         * Whether user wants to show week numbers next to days
         */
        this.showWeekNumbers = true;
        /**
         * Whether the user wants to select multiple days or multiple range dates.
         * If `displayWeekNumbers` is true, the user can click on the week number to mark the related row.
         * The user can click on week days to mark the related column.
         * Note: Clickable selection for week row or column does not work for range selections.
         */
        this.allowMultipleSelection = false;
        /** Should date picker be inlined. */
        this.inline = true;
        /**
         * Whether to recalculate value from the input as user types or on blur.
         * By default, updates the value as user types.
         * @default false
         */
        this.processInputOnBlur = false;
        /**
         * Whether to prevent page scrolling when focusing date picker input field after calendar has been closed.
         */
        this.preventScrollOnFocus = false;
        /** Whether date picker should rendered in mobile mode. */
        this.mobile = false;
        /** Whether calendar is used inside mobile in landscape mode, it also adds close button on right side */
        this.mobileLandscape = false;
        /** Whether calendar is used inside mobile in portrait mode */
        this.mobilePortrait = false;
        /** Whether to select and display the date range in MM/YYYY or YYYY format
         * For month and year format value is 'month'
         * For year format value is 'year'
         */
        this.dateRangeFormat = '';
        /** Event emitted when the state of the isOpen property changes. */
        this.isOpenChange = new EventEmitter();
        /** Event thrown every time selected date in single mode is changed */
        this.selectedDateChange = new EventEmitter();
        /** Event thrown every time the selected dates in multiple mode are changed. */
        this.selectedMultipleDatesChange = new EventEmitter();
        /** Event thrown every time selected first or last date in range mode is changed */
        this.selectedRangeDateChange = new EventEmitter();
        /** Event thrown every time the first or last date in multiple range mode is changed. */
        this.selectedMultipleDateRangesChange = new EventEmitter();
        /** Event thrown every time calendar active view is changed */
        this.activeViewChange = new EventEmitter();
        /** Whether to display the calendar legend below the calendar. Default is false. */
        this.showCalendarLegend = input(false, { ...(ngDevMode ? { debugName: "showCalendarLegend" } : {}), transform: booleanAttribute });
        /** Whether the legend should display in column layout instead of row layout. Default is false. */
        this.legendCol = input(false, { ...(ngDevMode ? { debugName: "legendCol" } : {}), transform: booleanAttribute });
        /** @hidden */
        this._message = null;
        /** @hidden */
        this._messageTriggers = ['focusin', 'focusout'];
        /** @hidden The value of the input */
        this._inputFieldDate = null;
        /** @hidden Whether the date input is invalid */
        this._isInvalidDateInput = false;
        /** @hidden */
        this._showPopoverContents = false;
        /** @hidden */
        this._formValueStateMessageId = `fd-date-picker-form-message-${datePickerCounter++}`;
        /** @hidden */
        this._isOpen = false;
        /** @hidden */
        this._destroyRef = inject(DestroyRef);
        /** @hidden */
        this._subscriptions = new Subscription();
        /** @hidden */
        this._state = 'default';
        /** @hidden */
        this._injector = inject(Injector);
        /** @hidden */
        this._dynamicComponentService = inject(DynamicComponentService);
        /** @hidden */
        this._focusTrapService = inject(FocusTrapService, {
            optional: true
        });
        /**
         * Function used to disable certain dates in the calendar.
         */
        this.disableFunction = () => false;
        /**
         * Function used to disable certain dates in the calendar for the range start selection.
         */
        this.disableRangeStartFunction = () => false;
        /**
         * Function used to disable certain dates in the calendar for the range end selection.
         */
        this.disableRangeEndFunction = () => false;
        /** @hidden */
        this.onChange = () => { };
        /** @hidden */
        this.onTouched = () => { };
        if (!this._dateTimeAdapter) {
            throw createMissingDateImplementationError('DateTimeAdapter');
        }
        if (!this._dateTimeFormats) {
            throw createMissingDateImplementationError('DATE_TIME_FORMATS');
        }
    }
    /** @hidden */
    dialogApprove() { }
    /** @hidden */
    dialogDismiss(prevValue) {
        if (this.allowMultipleSelection) {
            if (this._isMultipleDateRanges(prevValue)) {
                this.handleMultipleDateRangesChange(prevValue);
            }
            else {
                const value = prevValue;
                this.handleMultipleDatesChange(value);
            }
        }
        else {
            if (this._isDateRange(prevValue)) {
                this.handleRangeDateChange(prevValue);
            }
            else {
                const value = prevValue;
                this.handleSingleDateChange(value);
            }
        }
    }
    /** @hidden */
    ngOnInit() {
        // initial view should be month or year if dateRangeFormat is provided
        if (this.dateRangeFormat === 'month') {
            this.activeView = FdCalendarViewEnum.Month;
        }
        else if (this.dateRangeFormat === 'year') {
            this.activeView = FdCalendarViewEnum.Year;
        }
        this._dateTimeAdapter.localeChanges.pipe(takeUntilDestroyed(this._destroyRef)).subscribe(() => {
            this.formatInputDate(this.selectedDate);
            this._changeDetectionRef.detectChanges();
        });
    }
    /** @hidden */
    ngOnChanges(changes) {
        if ('isOpen' in changes) {
            this._showPopoverContents = this.isOpen;
            this._changeDetectionRef.detectChanges();
        }
    }
    /** @hidden */
    ngAfterViewInit() {
        this._InitialiseVariablesInMessageService();
        this._calendars.changes.pipe(startWith(null), takeUntilDestroyed(this._destroyRef)).subscribe(() => {
            const calendar = this._calendars.first;
            this._calendarComponent = calendar;
            setTimeout(() => {
                if (this._calendarComponent) {
                    this._focusTrapService?.pauseCurrentFocusTrap();
                }
                else {
                    this._focusTrapService?.unpauseCurrentFocusTrap();
                }
                calendar?.setCurrentlyDisplayed(this._calendarPendingDate);
                calendar?.initialFocus();
            });
        });
        if (this.mobile) {
            this._setUpMobileMode();
        }
    }
    /** @hidden */
    ngOnDestroy() {
        this._subscriptions.unsubscribe();
        this._mobileComponentRef?.destroy();
    }
    /**
     * Method that handle calendar active view change and throws event.
     */
    handleCalendarActiveViewChange(activeView) {
        this.activeViewChange.emit(activeView);
    }
    /** @hidden */
    closeFromCalendar() {
        if (this.type === CalendarTypeEnum.Single && this.closeOnDateChoose && !this.allowMultipleSelection) {
            this.onTouched();
            this.closeCalendar();
        }
    }
    /** Opens the calendar */
    openCalendar() {
        if (this.disabled) {
            return;
        }
        this._setOpenState(true);
        this._changeMessageVisibility();
    }
    /** Toggles the calendar open or closed */
    toggleCalendar() {
        if (this.disabled) {
            return;
        }
        this._setOpenState(!this.isOpen);
        if (!this.isOpen) {
            this.onTouched();
        }
        this._changeMessageVisibility();
    }
    /** Closes the calendar if it is open */
    closeCalendar() {
        if (!this.isOpen) {
            return;
        }
        this._setOpenState(false);
        this._changeMessageVisibility();
    }
    /**
     * @hidden
     * Method that is triggered by events from calendar component, when there is selected single date changed
     */
    handleSingleDateChange(date) {
        if (!date) {
            return;
        }
        this.selectedDate = date;
        this.selectedDateChange.emit(date);
        this.onChange(date);
        this._refreshCurrentlyDisplayedCalendarDate(date);
        this.formatInputDate(date);
        this._isInvalidDateInput = !this.isModelValid();
        if (this.closeOnDateChoose && this.type === CalendarTypeEnum.Single) {
            this.closeCalendar();
        }
    }
    /**
     * @hidden
     * Method that is triggered by events from the calendar component when the selected multiple dates change.
     */
    handleMultipleDatesChange(dates) {
        if (!dates || dates.length === 0) {
            this.selectedMultipleDates = [];
            this.selectedMultipleDatesChange.emit([]);
            this.onChange([]);
            this._refreshCurrentlyDisplayedCalendarDate(null);
            this._inputFieldDate = null;
            return;
        }
        this.selectedMultipleDates = dates;
        this.selectedMultipleDatesChange.emit(dates);
        this.onChange(dates);
        /** Assuming the first date in the array is used for refresh */
        if (this.showTodayButton) {
            this._refreshCurrentlyDisplayedCalendarDate(dates[0]);
        }
        this._inputFieldDate = this.formatDateArray(dates);
        this._isInvalidDateInput = !this.isModelValid();
    }
    /**
     * @hidden
     * Method that is triggered by events from calendar component, when there is selected range date changed
     */
    handleRangeDateChange(dates) {
        const startChanged = !this._dateTimeAdapter.datesEqual(dates.start, this.selectedRangeDate.start);
        const endChanged = !this._dateTimeAdapter.datesEqual(dates.end, this.selectedRangeDate.end);
        if (dates && (startChanged || endChanged)) {
            const shouldClose = this.closeOnDateChoose && dates.end !== null;
            if (dates.end !== null) {
                this._inputFieldDate = this._formatDateRange(dates);
                this.selectedRangeDate = {
                    start: dates.start,
                    end: dates.end
                };
                this.selectedRangeDateChange.emit(this.selectedRangeDate);
                this.onChange(this.selectedRangeDate);
                this._refreshCurrentlyDisplayedCalendarDate(dates.start);
                this._isInvalidDateInput = !this.isModelValid();
            }
            if (shouldClose) {
                this.closeCalendar();
            }
        }
    }
    /**
     * @hidden
     * Method that is triggered by events from the calendar component when the selected multiple range dates change.
     */
    handleMultipleDateRangesChange(dates) {
        let hasChanged = false;
        // Check for changes in the date ranges
        if (dates.length !== this.selectedMultipleDateRanges.length) {
            hasChanged = true;
        }
        else {
            for (let i = 0; i < dates.length; i++) {
                if (!this._dateTimeAdapter.datesEqual(dates[i].start, this.selectedMultipleDateRanges[i].start) ||
                    !this._dateTimeAdapter.datesEqual(dates[i].end, this.selectedMultipleDateRanges[i].end)) {
                    hasChanged = true;
                    break;
                }
            }
        }
        // If any date range has changed, update the internal state and emit changes
        if (hasChanged) {
            this.selectedMultipleDateRanges = dates;
            // Update the formatted input field
            this._inputFieldDate = this._formatMultipleDateRanges(dates);
            // Emit the change event
            this.selectedMultipleDateRangesChange.emit(this.selectedMultipleDateRanges);
            // Perform any additional actions such as updating the model or refreshing the calendar
            this.onChange(this.selectedMultipleDateRanges);
            // if you want to refresh the calendar view, you can use the following line
            // this._refreshCurrentlyDisplayedCalendarDate(dates[0].start);
            this._calendarPendingDate = dates[0].start;
            this._isInvalidDateInput = !this.isModelValid();
        }
    }
    /**
     * @hidden
     * Method that is triggered date formatting in the date control
     */
    formatInputDate(date) {
        if (!date) {
            return;
        }
        this._inputFieldDate = this._formatDate(date);
    }
    /**
     * @hidden
     * Method that is triggered when Today-Selection-Button clicked, it changes selected date or date range to today's date
     */
    onTodayButtonClick() {
        const todayDate = this._dateTimeAdapter.today();
        if (this.allowMultipleSelection) {
            if (this.type === CalendarTypeEnum.Single) {
                this.handleMultipleDatesChange([todayDate]);
                this.closeFromCalendar();
            }
            else if (this.type === CalendarTypeEnum.Range) {
                this.handleMultipleDateRangesChange([
                    {
                        start: todayDate,
                        end: todayDate
                    }
                ]);
            }
        }
        else {
            if (this.type === CalendarTypeEnum.Single) {
                this.handleSingleDateChange(todayDate);
                this.closeFromCalendar();
            }
            else if (this.type === CalendarTypeEnum.Range) {
                this.handleRangeDateChange({
                    start: todayDate,
                    end: todayDate
                });
            }
        }
    }
    /**
     * @hidden
     * Method that is triggered when the text input is confirmed to ba changed, by clicking enter, or blur
     */
    handleInputChange(strDate, isTypeEvent) {
        if ((isTypeEvent && this.processInputOnBlur) || (!isTypeEvent && !this.processInputOnBlur)) {
            // if processInputOnBlur === true, ignore type event
            // if processInputOnBlur === false, ignore blur/enter event
            return;
        }
        this.dateStringUpdate(strDate);
    }
    /**
     * @hidden
     * Function that implements Validator Interface, adds validation support for forms
     */
    validate() {
        return this.isModelValid()
            ? null
            : {
                dateValidation: {
                    valid: false
                }
            };
    }
    /** @hidden */
    registerOnChange(fn) {
        this.onChange = fn;
    }
    /** @hidden */
    registerOnTouched(fn) {
        this.onTouched = fn;
    }
    /** @hidden */
    setDisabledState(isDisabled) {
        this.disabled = isDisabled;
        this._changeDetectionRef.detectChanges();
    }
    /**
     * @hidden
     * Function that provides support for ControlValueAccessor that allows to use [(ngModel)] or forms
     */
    writeValue(selected) {
        /** If written value is not defined, null, empty string */
        if (!selected) {
            this._inputFieldDate = '';
            this._refreshCurrentlyDisplayedCalendarDate(this._dateTimeAdapter.today());
            this.selectedRangeDate = {
                start: null,
                end: null
            };
            this.selectedDate = null;
            this.selectedMultipleDates = [];
            this.selectedMultipleDateRanges = [];
            this._changeDetectionRef.detectChanges();
            return;
        }
        if (this.allowMultipleSelection && Array.isArray(selected)) {
            if (this.type === CalendarTypeEnum.Single) {
                /**
                 * For single mode, if the date is invalid, model is changed, it refreshes currently
                 * input field text, but it does not refresh currently displayed day
                 */
                // selected = this._parseDate(selected)
                selected = selected;
                this.selectedMultipleDates = selected;
                this._inputFieldDate = this.formatDateArray(selected);
                this._refreshCurrentlyDisplayedCalendarDate(selected[0]);
            }
            if (this.type === CalendarTypeEnum.Range) {
                /**
                 * For range mode, if the date is invalid, model is changed, but it does not refresh currently
                 * displayed day view, or input field text
                 */
                selected = selected;
                if (selected && selected.length > 0) {
                    const filteredRanges = selected.filter((range) => range.start !== null && range.end !== null);
                    if (filteredRanges.length > 0) {
                        this.selectedMultipleDateRanges = filteredRanges.map((range) => ({
                            start: this._parseDate(range.start),
                            end: this._parseDate(range.end)
                        }));
                        this._refreshCurrentlyDisplayedCalendarDate(filteredRanges[0].start);
                        this._inputFieldDate = this._formatMultipleDateRanges(filteredRanges);
                    }
                    else {
                        this._inputFieldDate = '';
                    }
                }
                else {
                    this._inputFieldDate = '';
                }
            }
        }
        else {
            if (this.type === CalendarTypeEnum.Single) {
                /**
                 * For single mode, if the date is invalid, model is changed, it refreshes currently
                 * input field text, but it does not refresh currently displayed day
                 */
                selected = this._parseDate(selected);
                this.selectedDate = selected;
                this._inputFieldDate = this._formatDate(selected);
                this._refreshCurrentlyDisplayedCalendarDate(selected);
            }
            if (this.type === CalendarTypeEnum.Range) {
                /**
                 * For range mode, if the date is invalid, model is changed, but it does not refresh currently
                 * displayed day view, or input field text
                 */
                selected = selected;
                if (selected?.start) {
                    this.selectedRangeDate = {
                        start: this._parseDate(selected.start),
                        end: this._parseDate(selected.end)
                    };
                    this._refreshCurrentlyDisplayedCalendarDate(selected.start);
                    this._inputFieldDate = this._formatDateRange(selected);
                }
                else {
                    this._inputFieldDate = '';
                }
            }
        }
        this._isInvalidDateInput = !this.isModelValid();
        this._changeDetectionRef.detectChanges();
    }
    /**
     * @hidden
     * Method, which is responsible for transforming string to date, depending on type or
     * validation the results are different. It also changes the state of _isInvalidDateInput
     */
    dateStringUpdate(dateStr) {
        this._inputFieldDate = dateStr;
        if (this.allowMultipleSelection) {
            if (this.type === CalendarTypeEnum.Single) {
                this.updateMultipleDates(dateStr);
            }
            else {
                this._updateMultipleDateRanges(dateStr);
            }
        }
        else {
            if (this.type === CalendarTypeEnum.Single) {
                this._updateSingleDate(dateStr);
            }
            else {
                this._updateRangeDate(dateStr);
            }
        }
    }
    /** Method that provides information if model selected date/dates have properly types and are valid */
    isModelValid() {
        if (this.allowMultipleSelection) {
            if (this.type === CalendarTypeEnum.Single) {
                return this._isMultipleModelValid(this.selectedMultipleDates);
            }
            else {
                return this._isMultipleRangesModelValid(this.selectedMultipleDateRanges);
            }
        }
        else {
            if (this.type === CalendarTypeEnum.Single) {
                return this._isSingleModelValid(this.selectedDate);
            }
            else {
                return this._isRangeModelValid(this.selectedRangeDate);
            }
        }
    }
    /** Returns current selected date. */
    getSelectedDate() {
        return (this.selectedDate || this.selectedMultipleDates || this.selectedRangeDate || this.selectedMultipleDateRanges);
    }
    /** @hidden */
    _changeMessageVisibility() {
        if (this.isOpen) {
            this._popoverFormMessage.hide();
        }
        else {
            this._popoverFormMessage.show();
        }
    }
    /** @hidden */
    _onOpenStateChanged(isOpen) {
        this.isOpenChange.emit(isOpen);
        this._changeMessageVisibility();
        // focus input control every time popup is closed
        if (!isOpen && this._inputElement) {
            this._inputElement.nativeElement.focus({
                preventScroll: this.preventScrollOnFocus
            });
        }
    }
    /**
     * Renders the calendar right before the popover is opened.
     * Used for correct calculations of overlay position and size.
     */
    _beforePopoverOpen() {
        this._showPopoverContents = true;
        this._changeDetectionRef.detectChanges();
    }
    /** @hidden */
    _onBlur(event) {
        this.onTouched();
        this.handleInputChange(event.target.value, false);
    }
    /** Method that returns info if single model given is valid */
    _isSingleModelValid(date) {
        return (this._isDateValid(date) && !this.disableFunction(date)) || (!date && this.allowNull);
    }
    /** Method that returns info if multiple date model given is valid */
    _isMultipleModelValid(dates) {
        return dates?.every((date) => this._isSingleModelValid(date));
    }
    /** Method that returns info if range date model given is valid */
    _isRangeModelValid(fdRangeDate) {
        return ((fdRangeDate && this._isStartDateValid(fdRangeDate.start) && this._isEndDateValid(fdRangeDate.end)) ||
            (!fdRangeDate.start && !fdRangeDate.end && this.allowNull));
    }
    /** Method that returns info if multiple range date model given is valid */
    _isMultipleRangesModelValid(ranges) {
        if (!ranges || ranges.length === 0) {
            return this.allowNull;
        }
        return ranges.every((range) => range.start && range.end && this._isRangeModelValid(range));
    }
    /** Method that returns info if end date model given is valid */
    _isEndDateValid(endDate) {
        return this._isDateValid(endDate) && !this.disableRangeEndFunction(endDate);
    }
    /** Method that returns info if start date model given is valid */
    _isStartDateValid(startDate) {
        return this._isDateValid(startDate) && !this.disableRangeStartFunction(startDate);
    }
    /** Method that returns info if given date model is valid */
    _isDateValid(date) {
        return this._dateTimeAdapter.isValid(date);
    }
    /** @hidden */
    _refreshCurrentlyDisplayedCalendarDate(date) {
        this._calendarPendingDate = date;
        this._calendarComponent?.setCurrentlyDisplayed(date);
    }
    /** @hidden */
    _formatDate(date) {
        if (this.customDateTimeFormat) {
            return this._dateTimeAdapter.format(date, this.customDateTimeFormat);
        }
        return this._dateTimeAdapter.format(date, this._dateTimeFormats.display.dateInput);
    }
    /** @hidden */
    formatDateArray(dates) {
        return dates.map((date) => this._formatDate(date)).join(', ');
    }
    /** @hidden */
    _parseDate(date) {
        return this._dateTimeAdapter.parse(date, this._dateTimeFormats.parse.dateInput);
    }
    /**
     * Helper method to parse a date string into an array of dates.
     * @param dateStr The date string to parse.
     * @returns An array of dates.
     */
    parseDateString(dateStr) {
        return dateStr
            .split(',')
            .map((date) => this._parseDate(date.trim()))
            .filter((date) => date !== null);
    }
    /** @hidden */
    _formatDateRange(dateRange) {
        const startDate = this._formatDate(dateRange.start);
        const endDate = this._formatDate(dateRange.end);
        return startDate + this._rangeDelimiter + endDate;
    }
    /** @hidden */
    _formatMultipleDateRanges(dateRanges) {
        return dateRanges.map((dateRange) => this._formatDateRange(dateRange)).join(', ');
    }
    /** @hidden */
    _InitialiseVariablesInMessageService() {
        this._popoverFormMessage.init(this._inputGroupElement);
        this._popoverFormMessage.triggers = this._messageTriggers;
        this._popoverFormMessage.message = this._messagePopoverTemplate;
    }
    /** @hidden */
    _setOpenState(isOpen) {
        this._showPopoverContents = isOpen;
        this._changeDetectionRef.detectChanges();
        this.isOpen = isOpen;
        this.isOpenChange.emit(this.isOpen);
        this._changeDetectionRef.detectChanges();
    }
    /** @hidden */
    _setUpMobileMode() {
        const injector = Injector.create({
            providers: [
                { provide: FD_DATE_PICKER_COMPONENT, useValue: this },
                {
                    provide: FD_DATE_PICKER_MOBILE_CONFIG,
                    useValue: { calendarTemplate: this._calendarTemplate, controlTemplate: this._controlTemplate }
                }
            ],
            parent: this._injector
        });
        this._mobileComponentRef = this._dynamicComponentService.createDynamicComponent({}, (DatePickerMobileComponent), {
            container: 'body'
        }, {
            injector
        });
    }
    /** @hidden */
    _isDateRange(value) {
        return !!value && value.start && value.end;
    }
    /** @hidden */
    _isMultipleDateRanges(value) {
        return Array.isArray(value) && value.every((item) => this._isDateRange(item));
    }
    /**
     * @hidden
     * Updates the selected single date from a date string.
     * @param dateStr The date string to parse and update the selected date.
     */
    _updateSingleDate(dateStr) {
        if (!dateStr) {
            this._isInvalidDateInput = !this.allowNull;
            this.selectedDate = null;
            this._refreshCurrentlyDisplayedCalendarDate(this.selectedDate);
            this.onChange(this.selectedDate);
            this.selectedDateChange.emit(this.selectedDate);
            return;
        }
        const date = this._parseDate(dateStr);
        if (!this._dateTimeAdapter.datesEqual(date, this.selectedDate)) {
            this._isInvalidDateInput = !this._isSingleModelValid(date);
            if (!this._isInvalidDateInput) {
                this._refreshCurrentlyDisplayedCalendarDate(date);
            }
            this.selectedDate = date;
            this.onChange(this.selectedDate);
            this.selectedDateChange.emit(this.selectedDate);
        }
    }
    /**
     * @hidden
     * Updates the selected range date from a date string.
     * @param dateStr The date string to parse and update the selected range date.
     */
    _updateRangeDate(dateStr) {
        if (!dateStr) {
            this._isInvalidDateInput = !this.allowNull;
            this.selectedRangeDate = { start: null, end: null };
            this._refreshCurrentlyDisplayedCalendarDate(this.selectedRangeDate.start);
            this.onChange(this.selectedRangeDate);
            this.selectedRangeDateChange.emit(this.selectedRangeDate);
            return;
        }
        const [startDateStr, endDateStr] = dateStr.split(this._rangeDelimiter);
        const startDate = this._parseDate(startDateStr);
        const endDate = this._parseDate(endDateStr);
        if (!this._dateTimeAdapter.datesEqual(startDate, this.selectedRangeDate.start) ||
            !this._dateTimeAdapter.datesEqual(endDate, this.selectedRangeDate.end)) {
            let selectedRangeDate = null;
            if (this._dateTimeAdapter.isValid(startDate) &&
                this._dateTimeAdapter.isValid(endDate) &&
                this._dateTimeAdapter.compareDate(startDate, endDate) > 0) {
                selectedRangeDate = { start: endDate, end: startDate };
            }
            else {
                selectedRangeDate = { start: startDate, end: endDate };
            }
            this._isInvalidDateInput = !this._isRangeModelValid(selectedRangeDate);
            this.selectedRangeDate = selectedRangeDate;
            this.selectedRangeDateChange.emit(this.selectedRangeDate);
            this.onChange(this.selectedRangeDate);
            if (this._isStartDateValid(this.selectedRangeDate.start)) {
                this._refreshCurrentlyDisplayedCalendarDate(this.selectedRangeDate.start);
            }
        }
    }
    /**
     * @hidden
     * Updates the selected multiple dates from a date string.
     * @param dateStr The date string to parse and update the selected multiple dates.
     */
    updateMultipleDates(dateStr) {
        if (!dateStr) {
            this._isInvalidDateInput = !this.allowNull;
            this.selectedMultipleDates = [];
            this._refreshCurrentlyDisplayedCalendarDate(null);
            this.onChange(this.selectedMultipleDates);
            this.selectedMultipleDatesChange.emit(this.selectedMultipleDates);
            return;
        }
        const parsedDates = this.parseDateString(dateStr);
        // Check if the new parsed dates are different from the previously selected dates
        const datesChanged = !this._areDatesEqual(parsedDates, this.selectedMultipleDates);
        if (datesChanged) {
            this._isInvalidDateInput = !this._isMultipleModelValid(parsedDates);
            if (!this._isInvalidDateInput) {
                this._refreshCurrentlyDisplayedCalendarDate(parsedDates[0]);
            }
            this.selectedMultipleDates = parsedDates;
            this.onChange(this.selectedMultipleDates);
            this.selectedMultipleDatesChange.emit(this.selectedMultipleDates);
        }
    }
    /** Helper method to compare two arrays of dates */
    _areDatesEqual(dates1, dates2) {
        if (dates1.length !== dates2.length) {
            return false;
        }
        return dates1.every((date, index) => this._dateTimeAdapter.datesEqual(date, dates2[index]));
    }
    /**
     * @hidden
     * Updates the selected multiple date ranges from a date string.
     * @param dateStr The date string to parse and update the selected multiple date ranges.
     */
    _updateMultipleDateRanges(dateStr) {
        if (!dateStr) {
            this._isInvalidDateInput = !this.allowNull;
            this.selectedMultipleDateRanges = [{ start: null, end: null }];
            this._refreshCurrentlyDisplayedCalendarDate(null);
            this.onChange(this.selectedMultipleDateRanges);
            this.selectedMultipleDateRangesChange.emit(this.selectedMultipleDateRanges);
            return;
        }
        const rangeStrings = dateStr.split(',').map((range) => range.trim());
        const parsedRanges = rangeStrings.map((rangeStr) => {
            const [startStr, endStr] = rangeStr.split(this._rangeDelimiter).map((date) => date.trim());
            return {
                start: this._parseDate(startStr),
                end: this._parseDate(endStr)
            };
        });
        // Check if the new parsed ranges are different from the previously selected ranges
        const rangesChanged = !this._areDateRangesEqual(parsedRanges, this.selectedMultipleDateRanges);
        this._isInvalidDateInput = !this._isMultipleRangesModelValid(parsedRanges);
        if (!this._isInvalidDateInput && rangesChanged) {
            if (this._isStartDateValid(this.selectedMultipleDateRanges[0].start)) {
                this._refreshCurrentlyDisplayedCalendarDate(this.selectedMultipleDateRanges[0].start);
            }
            this.selectedMultipleDateRanges = parsedRanges;
            this.onChange(this.selectedMultipleDateRanges);
            this.selectedMultipleDateRangesChange.emit(this.selectedMultipleDateRanges);
        }
    }
    /** Helper method to compare two arrays of date ranges */
    _areDateRangesEqual(ranges1, ranges2) {
        if (ranges1.length !== ranges2.length) {
            return false;
        }
        return ranges1.every((range, index) => this._dateTimeAdapter.datesEqual(range.start, ranges2[index].start) &&
            this._dateTimeAdapter.datesEqual(range.end, ranges2[index].end));
    }
    static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.1.0", ngImport: i0, type: DatePickerComponent, deps: [{ token: i0.ChangeDetectorRef }, { token: i1.DatetimeAdapter, optional: true }, { token: DATE_TIME_FORMATS, optional: true }, { token: i2.PopoverFormMessageService }], target: i0.ɵɵFactoryTarget.Component }); }
    static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.1.0", type: DatePickerComponent, isStandalone: true, selector: "fd-date-picker", inputs: { type: { classPropertyName: "type", publicName: "type", isSignal: false, isRequired: false, transformFunction: null }, placeholder: { classPropertyName: "placeholder", publicName: "placeholder", isSignal: false, isRequired: false, transformFunction: null }, inputId: { classPropertyName: "inputId", publicName: "inputId", isSignal: false, isRequired: false, transformFunction: null }, required: { classPropertyName: "required", publicName: "required", isSignal: false, isRequired: false, transformFunction: null }, customDateTimeFormat: { classPropertyName: "customDateTimeFormat", publicName: "customDateTimeFormat", isSignal: false, isRequired: false, transformFunction: null }, message: { classPropertyName: "message", publicName: "message", isSignal: false, isRequired: false, transformFunction: null }, messageTriggers: { classPropertyName: "messageTriggers", publicName: "messageTriggers", isSignal: false, isRequired: false, transformFunction: null }, selectedDate: { classPropertyName: "selectedDate", publicName: "selectedDate", isSignal: false, isRequired: false, transformFunction: null }, selectedMultipleDates: { classPropertyName: "selectedMultipleDates", publicName: "selectedMultipleDates", isSignal: false, isRequired: false, transformFunction: null }, selectedRangeDate: { classPropertyName: "selectedRangeDate", publicName: "selectedRangeDate", isSignal: false, isRequired: false, transformFunction: null }, selectedMultipleDateRanges: { classPropertyName: "selectedMultipleDateRanges", publicName: "selectedMultipleDateRanges", isSignal: false, isRequired: false, transformFunction: null }, startingDayOfWeek: { classPropertyName: "startingDayOfWeek", publicName: "startingDayOfWeek", isSignal: false, isRequired: false, transformFunction: null }, rangeHoverEffect: { classPropertyName: "rangeHoverEffect", publicName: "rangeHoverEffect", isSignal: false, isRequired: false, transformFunction: null }, useValidation: { classPropertyName: "useValidation", publicName: "useValidation", isSignal: false, isRequired: false, transformFunction: null }, allowNull: { classPropertyName: "allowNull", publicName: "allowNull", isSignal: false, isRequired: false, transformFunction: null }, activeView: { classPropertyName: "activeView", publicName: "activeView", isSignal: false, isRequired: false, transformFunction: null }, placement: { classPropertyName: "placement", publicName: "placement", isSignal: false, isRequired: false, transformFunction: null }, appendTo: { classPropertyName: "appendTo", publicName: "appendTo", isSignal: false, isRequired: false, transformFunction: null }, disabled: { classPropertyName: "disabled", publicName: "disabled", isSignal: false, isRequired: false, transformFunction: null }, closeOnDateChoose: { classPropertyName: "closeOnDateChoose", publicName: "closeOnDateChoose", isSignal: false, isRequired: false, transformFunction: null }, showTodayButton: { classPropertyName: "showTodayButton", publicName: "showTodayButton", isSignal: false, isRequired: false, transformFunction: null }, todayButtonLabel: { classPropertyName: "todayButtonLabel", publicName: "todayButtonLabel", isSignal: false, isRequired: false, transformFunction: null }, previousButtonDisableFunction: { classPropertyName: "previousButtonDisableFunction", publicName: "previousButtonDisableFunction", isSignal: false, isRequired: false, transformFunction: null }, nextButtonDisableFunction: { classPropertyName: "nextButtonDisableFunction", publicName: "nextButtonDisableFunction", isSignal: false, isRequired: false, transformFunction: null }, buttonFocusable: { classPropertyName: "buttonFocusable", publicName: "buttonFocusable", isSignal: false, isRequired: false, transformFunction: null }, specialDaysRules: { classPropertyName: "specialDaysRules", publicName: "specialDaysRules", isSignal: false, isRequired: false, transformFunction: null }, yearGrid: { classPropertyName: "yearGrid", publicName: "yearGrid", isSignal: false, isRequired: false, transformFunction: null }, aggregatedYearGrid: { classPropertyName: "aggregatedYearGrid", publicName: "aggregatedYearGrid", isSignal: false, isRequired: false, transformFunction: null }, markWeekends: { classPropertyName: "markWeekends", publicName: "markWeekends", isSignal: false, isRequired: false, transformFunction: null }, showWeekNumbers: { classPropertyName: "showWeekNumbers", publicName: "showWeekNumbers", isSignal: false, isRequired: false, transformFunction: null }, allowMultipleSelection: { classPropertyName: "allowMultipleSelection", publicName: "allowMultipleSelection", isSignal: false, isRequired: false, transformFunction: null }, inline: { classPropertyName: "inline", publicName: "inline", isSignal: false, isRequired: false, transformFunction: null }, ariaLabelledBy: { classPropertyName: "ariaLabelledBy", publicName: "ariaLabelledBy", isSignal: false, isRequired: false, transformFunction: null }, processInputOnBlur: { classPropertyName: "processInputOnBlur", publicName: "processInputOnBlur", isSignal: false, isRequired: false, transformFunction: booleanAttribute }, preventScrollOnFocus: { classPropertyName: "preventScrollOnFocus", publicName: "preventScrollOnFocus", isSignal: false, isRequired: false, transformFunction: null }, mobile: { classPropertyName: "mobile", publicName: "mobile", isSignal: false, isRequired: false, transformFunction: null }, mobileConfig: { classPropertyName: "mobileConfig", publicName: "mobileConfig", isSignal: false, isRequired: false, transformFunction: null }, mobileLandscape: { classPropertyName: "mobileLandscape", publicName: "mobileLandscape", isSignal: false, isRequired: false, transformFunction: null }, mobilePortrait: { classPropertyName: "mobilePortrait", publicName: "mobilePortrait", isSignal: false, isRequired: false, transformFunction: null }, dateRangeFormat: { classPropertyName: "dateRangeFormat", publicName: "dateRangeFormat", isSignal: false, isRequired: false, transformFunction: null }, showCalendarLegend: { classPropertyName: "showCalendarLegend", publicName: "showCalendarLegend", isSignal: true, isRequired: false, transformFunction: null }, legendCol: { classPropertyName: "legendCol", publicName: "legendCol", isSignal: true, isRequired: false, transformFunction: null }, state: { classPropertyName: "state", publicName: "state", isSignal: false, isRequired: false, transformFunction: null }, isOpen: { classPropertyName: "isOpen", publicName: "isOpen", isSignal: false, isRequired: false, transformFunction: null }, disableFunction: { classPropertyName: "disableFunction", publicName: "disableFunction", isSignal: false, isRequired: false, transformFunction: null }, disableRangeStartFunction: { classPropertyName: "disableRangeStartFunction", publicName: "disableRangeStartFunction", isSignal: false, isRequired: false, transformFunction: null }, disableRangeEndFunction: { classPropertyName: "disableRangeEndFunction", publicName: "disableRangeEndFunction", isSignal: false, isRequired: false, transformFunction: null } }, outputs: { isOpenChange: "isOpenChange", selectedDateChange: "selectedDateChange", selectedMultipleDatesChange: "selectedMultipleDatesChange", selectedRangeDateChange: "selectedRangeDateChange", selectedMultipleDateRangesChange: "selectedMultipleDateRangesChange", activeViewChange: "activeViewChange" }, host: { listeners: { "blur": "onTouched()" }, properties: { "class.fd-date-picker": "true", "class.fd-date-picker-custom": "inline" } }, providers: [
            {
                provide: NG_VALUE_ACCESSOR,
                useExisting: forwardRef(() => DatePickerComponent),
                multi: true
            },
            {
                provide: NG_VALIDATORS,
                useExisting: forwardRef(() => DatePickerComponent),
                multi: true
            },
            {
                provide: FD_DATE_PICKER_COMPONENT,
                useExisting: DatePickerComponent
            },
            registerFormItemControl(DatePickerComponent),
            PopoverFormMessageService,
            PopoverService,
            DynamicComponentService,
            CalendarLegendFocusingService
        ], viewQueries: [{ propertyName: "_inputGroupElement", first: true, predicate: ["inputGroupComponent"], descendants: true, read: ElementRef }, { propertyName: "_inputElement", first: true, predicate: InputGroupInputDirective, descendants: true, read: ElementRef }, { propertyName: "_controlTemplate", first: true, predicate: ["controlTemplate"], descendants: true }, { propertyName: "_calendarTemplate", first: true, predicate: ["calendarTemplate"], descendants: true }, { propertyName: "_messagePopoverTemplate", first: true, predicate: ["popoverMessageTemplate"], descendants: true }, { propertyName: "_calendars", predicate: CalendarComponent, descendants: true }], usesOnChanges: true, ngImport: i0, template: "<ng-template [ngTemplateOutlet]=\"mobile ? controlTemplate : desktopTemplate\"></ng-template>\n<ng-template #popoverMessageTemplate>\n    @if (_message) {\n        <fd-form-message [embedded]=\"true\" [type]=\"state\">\n            {{ _message }}\n        </fd-form-message>\n    }\n</ng-template>\n<ng-template #desktopTemplate>\n    <fd-popover\n        [(isOpen)]=\"isOpen\"\n        (beforeOpen)=\"_beforePopoverOpen()\"\n        (isOpenChange)=\"_onOpenStateChanged($event)\"\n        [triggers]=\"[]\"\n        [placement]=\"placement\"\n        [disabled]=\"disabled\"\n        [focusTrapped]=\"true\"\n        [focusAutoCapture]=\"false\"\n        [appendTo]=\"appendTo\"\n    >\n        <fd-popover-control>\n            <ng-template [ngTemplateOutlet]=\"controlTemplate\"></ng-template>\n        </fd-popover-control>\n        <fd-popover-body [attr.aria-expanded]=\"isOpen\" [attr.aria-hidden]=\"!isOpen\">\n            @if (_showPopoverContents) {\n                <ng-template [ngTemplateOutlet]=\"popoverMessageTemplate\"></ng-template>\n                <ng-content></ng-content>\n                <ng-template [ngTemplateOutlet]=\"calendarTemplate\"></ng-template>\n            }\n        </fd-popover-body>\n    </fd-popover>\n</ng-template>\n<ng-template #controlTemplate>\n    <fd-input-group\n        #inputGroupComponent\n        [state]=\"state\"\n        [disabled]=\"disabled\"\n        [isControl]=\"true\"\n        [button]=\"true\"\n        [buttonFocusable]=\"buttonFocusable\"\n        glyph=\"appointment-2\"\n        [isExpanded]=\"isOpen\"\n        [glyphAriaLabel]=\"'coreDatePicker.displayCalendarToggleLabel' | fdTranslate\"\n        [iconTitle]=\"'coreDatePicker.displayCalendarToggleLabel' | fdTranslate\"\n        (addOnButtonClicked)=\"toggleCalendar()\"\n    >\n        <input\n            type=\"text\"\n            class=\"fd-input\"\n            fd-input-group-input\n            [disabled]=\"disabled\"\n            [placeholder]=\"placeholder\"\n            [attr.id]=\"inputId\"\n            aria-haspopup=\"grid\"\n            aria-autocomplete=\"none\"\n            [attr.aria-expanded]=\"isOpen\"\n            [attr.aria-labelledby]=\"ariaLabelledBy\"\n            [attr.aria-label]=\"_dateInputArialLabelKey | fdTranslate\"\n            [attr.aria-required]=\"required\"\n            [attr.aria-describedby]=\"_formValueStateMessageId\"\n            [ngModel]=\"_inputFieldDate\"\n            (keyup.enter)=\"handleInputChange($any($event.target).value, false)\"\n            (keydown.f4)=\"toggleCalendar()\"\n            (ngModelChange)=\"handleInputChange($event, true)\"\n            (click)=\"mobile && openCalendar()\"\n            (blur)=\"_onBlur($event)\"\n        />\n    </fd-input-group>\n</ng-template>\n<ng-template #calendarTemplate>\n    <fd-calendar\n        [activeView]=\"activeView\"\n        [markWeekends]=\"markWeekends\"\n        [specialDaysRules]=\"specialDaysRules\"\n        [showWeekNumbers]=\"showWeekNumbers\"\n        [allowMultipleSelection]=\"allowMultipleSelection\"\n        [aggregatedYearGrid]=\"aggregatedYearGrid\"\n        [yearGrid]=\"yearGrid\"\n        [calType]=\"type\"\n        [rangeHoverEffect]=\"rangeHoverEffect\"\n        [disableFunction]=\"disableFunction\"\n        [disableRangeStartFunction]=\"disableRangeStartFunction\"\n        [disableRangeEndFunction]=\"disableRangeEndFunction\"\n        [selectedDate]=\"selectedDate\"\n        [selectedMultipleDates]=\"selectedMultipleDates\"\n        [selectedRangeDate]=\"selectedRangeDate\"\n        [selectedMultipleDateRanges]=\"selectedMultipleDateRanges\"\n        [startingDayOfWeek]=\"startingDayOfWeek\"\n        [previousButtonDisableFunction]=\"previousButtonDisableFunction\"\n        [nextButtonDisableFunction]=\"nextButtonDisableFunction\"\n        [showCalendarLegend]=\"showCalendarLegend()\"\n        [legendCol]=\"legendCol()\"\n        [mobileLandscape]=\"mobile && mobileLandscape\"\n        [mobilePortrait]=\"mobile && mobilePortrait\"\n        [dateRangeFormat]=\"dateRangeFormat\"\n        (selectedDateChange)=\"handleSingleDateChange($event)\"\n        (selectedMultipleDatesChange)=\"handleMultipleDatesChange($event)\"\n        (selectedRangeDateChange)=\"handleRangeDateChange($event)\"\n        (selectedMultipleDateRangesChange)=\"handleMultipleDateRangesChange($event)\"\n        (activeViewChange)=\"handleCalendarActiveViewChange($event)\"\n        (closeCalendar)=\"closeFromCalendar()\"\n    ></fd-calendar>\n    @if (showTodayButton) {\n        <div fd-bar barDesign=\"footer\" class=\"fd-date-picker__bar\">\n            <div fd-bar-right>\n                <fd-bar-element>\n                    <button\n                        fd-button\n                        [label]=\"'coreCalendar.todayLabel' | fdTranslate\"\n                        (click)=\"onTodayButtonClick()\"\n                    ></button>\n                </fd-bar-element>\n            </div>\n        </div>\n    }\n</ng-template>\n<div [style.display]=\"'none'\" aria-hidden=\"true\">\n    <div [attr.id]=\"_formValueStateMessageId\" aria-atomic=\"true\" aria-live=\"assertive\">\n        @switch (state) {\n            @case ('success') {\n                {{ 'coreDatePicker.valueStateSuccessMessage' | fdTranslate }}\n            }\n            @case ('information') {\n                {{ 'coreDatePicker.valueStateInformationMessage' | fdTranslate }}\n            }\n            @case ('warning') {\n                {{ 'coreDatePicker.valueStateWarningMessage' | fdTranslate }}\n            }\n            @case ('error') {\n                {{ 'coreDatePicker.valueStateErrorMessage' | fdTranslate }}\n            }\n        }\n        {{ _message }}\n    </div>\n</div>\n", styles: [".fd-date-picker-custom{display:inline-block}.fd-date-picker-custom fd-popover{display:block}.fd-date-picker-custom fd-calendar{border-radius:.25rem;border-radius:var(--sapElement_BorderCornerRadius, .25rem)}.fd-date-picker__bar{overflow:hidden}\n"], dependencies: [{ kind: "directive", type: NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "ngmodule", type: PopoverModule }, { kind: "component", type: i3.PopoverControlComponent, selector: "fd-popover-control, [fdPopoverControl]" }, { kind: "component", type: i3.PopoverBodyComponent, selector: "fd-popover-body", inputs: ["minWidth", "maxWidth", "minHeight", "maxHeight"], outputs: ["onClose"] }, { kind: "component", type: i3.PopoverComponent, selector: "fd-popover", inputs: ["config", "title", "trigger", "id", "mobile", "mobileConfig", "preventSpaceKeyScroll", "placement", "maxWidth", "fillControlMode", "closeOnOutsideClick", "closeOnEscapeKey", "disabled", "triggers", "focusTrapped", "focusAutoCapture", "restoreFocusOnClose", "noArrow", "disableScrollbar", "appendTo", "placementContainer", "scrollStrategy", "cdkPositions", "applyOverlay", "additionalBodyClass", "additionalTriggerClass", "closeOnNavigation", "fixedPosition", "resizable", "isOpen"], outputs: ["triggerChange", "isOpenChange", "beforeOpen"] }, { kind: "component", type: FormMessageComponent, selector: "fd-form-message", inputs: ["type", "static", "embedded", "class"] }, { kind: "component", type: InputGroupComponent, selector: "fd-input-group", inputs: ["placement", "required", "inline", "addOnText", "buttonFocusable", "type", "glyph", "glyphFont", "button", "isControl", "showFocus", "isExpanded", "glyphAriaLabel", "addonButtonAriaHidden", "iconTitle", "ariaLabelledBy", "ariaLabel"], outputs: ["addOnButtonClicked", "search"] }, { kind: "directive", type: InputGroupInputDirective, selector: "[fdInputGroupInput], [fd-input-group-input]", inputs: ["class"] }, { kind: "ngmodule", type: FormsModule }, { kind: "directive", type: i4.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { kind: "directive", type: i4.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i4.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { kind: "component", type: CalendarComponent, selector: "fd-calendar", inputs: ["selectedDate", "selectedMultipleDates", "selectedRangeDate", "selectedMultipleDateRanges", "markWeekends", "showWeekNumbers", "allowMultipleSelection", "mobileLandscape", "mobilePortrait", "activeView", "startingDayOfWeek", "calType", "id", "specialDaysRules", "yearGrid", "aggregatedYearGrid", "rangeHoverEffect", "dateRangeFormat", "previousButtonDisableFunction", "nextButtonDisableFunction", "showCalendarLegend", "legendCol", "escapeFocusFunction", "disableFunction", "disableRangeStartFunction", "disableRangeEndFunction"], outputs: ["activeViewChange", "selectedDateChange", "selectedMultipleDatesChange", "selectedRangeDateChange", "selectedMultipleDateRangesChange", "isValidDateChange", "closeCalendar", "closeClicked"] }, { kind: "component", type: BarComponent, selector: "[fd-bar]", inputs: ["class", "barDesign", "inPage", "inHomePage", "clear", "size", "role"] }, { kind: "directive", type: BarRightDirective, selector: "[fd-bar-right]" }, { kind: "directive", type: BarElementDirective, selector: "fd-bar-element", inputs: ["fullWidth"] }, { kind: "component", type: ButtonComponent, selector: "button[fd-button], a[fd-button], span[fd-button]", inputs: ["id"], exportAs: ["fd-button"] }, { kind: "pipe", type: FdTranslatePipe, name: "fdTranslate" }], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None }); }
}
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.1.0", ngImport: i0, type: DatePickerComponent, decorators: [{
            type: Component,
            args: [{ selector: 'fd-date-picker', host: {
                        '(blur)': 'onTouched()',
                        '[class.fd-date-picker]': 'true',
                        '[class.fd-date-picker-custom]': 'inline'
                    }, providers: [
                        {
                            provide: NG_VALUE_ACCESSOR,
                            useExisting: forwardRef(() => DatePickerComponent),
                            multi: true
                        },
                        {
                            provide: NG_VALIDATORS,
                            useExisting: forwardRef(() => DatePickerComponent),
                            multi: true
                        },
                        {
                            provide: FD_DATE_PICKER_COMPONENT,
                            useExisting: DatePickerComponent
                        },
                        registerFormItemControl(DatePickerComponent),
                        PopoverFormMessageService,
                        PopoverService,
                        DynamicComponentService,
                        CalendarLegendFocusingService
                    ], encapsulation: ViewEncapsulation.None, changeDetection: ChangeDetectionStrategy.OnPush, imports: [
                        NgTemplateOutlet,
                        PopoverModule,
                        FormMessageComponent,
                        InputGroupComponent,
                        InputGroupInputDirective,
                        FormsModule,
                        CalendarComponent,
                        BarComponent,
                        BarRightDirective,
                        BarElementDirective,
                        ButtonComponent,
                        FdTranslatePipe
                    ], template: "<ng-template [ngTemplateOutlet]=\"mobile ? controlTemplate : desktopTemplate\"></ng-template>\n<ng-template #popoverMessageTemplate>\n    @if (_message) {\n        <fd-form-message [embedded]=\"true\" [type]=\"state\">\n            {{ _message }}\n        </fd-form-message>\n    }\n</ng-template>\n<ng-template #desktopTemplate>\n    <fd-popover\n        [(isOpen)]=\"isOpen\"\n        (beforeOpen)=\"_beforePopoverOpen()\"\n        (isOpenChange)=\"_onOpenStateChanged($event)\"\n        [triggers]=\"[]\"\n        [placement]=\"placement\"\n        [disabled]=\"disabled\"\n        [focusTrapped]=\"true\"\n        [focusAutoCapture]=\"false\"\n        [appendTo]=\"appendTo\"\n    >\n        <fd-popover-control>\n            <ng-template [ngTemplateOutlet]=\"controlTemplate\"></ng-template>\n        </fd-popover-control>\n        <fd-popover-body [attr.aria-expanded]=\"isOpen\" [attr.aria-hidden]=\"!isOpen\">\n            @if (_showPopoverContents) {\n                <ng-template [ngTemplateOutlet]=\"popoverMessageTemplate\"></ng-template>\n                <ng-content></ng-content>\n                <ng-template [ngTemplateOutlet]=\"calendarTemplate\"></ng-template>\n            }\n        </fd-popover-body>\n    </fd-popover>\n</ng-template>\n<ng-template #controlTemplate>\n    <fd-input-group\n        #inputGroupComponent\n        [state]=\"state\"\n        [disabled]=\"disabled\"\n        [isControl]=\"true\"\n        [button]=\"true\"\n        [buttonFocusable]=\"buttonFocusable\"\n        glyph=\"appointment-2\"\n        [isExpanded]=\"isOpen\"\n        [glyphAriaLabel]=\"'coreDatePicker.displayCalendarToggleLabel' | fdTranslate\"\n        [iconTitle]=\"'coreDatePicker.displayCalendarToggleLabel' | fdTranslate\"\n        (addOnButtonClicked)=\"toggleCalendar()\"\n    >\n        <input\n            type=\"text\"\n            class=\"fd-input\"\n            fd-input-group-input\n            [disabled]=\"disabled\"\n            [placeholder]=\"placeholder\"\n            [attr.id]=\"inputId\"\n            aria-haspopup=\"grid\"\n            aria-autocomplete=\"none\"\n            [attr.aria-expanded]=\"isOpen\"\n            [attr.aria-labelledby]=\"ariaLabelledBy\"\n            [attr.aria-label]=\"_dateInputArialLabelKey | fdTranslate\"\n            [attr.aria-required]=\"required\"\n            [attr.aria-describedby]=\"_formValueStateMessageId\"\n            [ngModel]=\"_inputFieldDate\"\n            (keyup.enter)=\"handleInputChange($any($event.target).value, false)\"\n            (keydown.f4)=\"toggleCalendar()\"\n            (ngModelChange)=\"handleInputChange($event, true)\"\n            (click)=\"mobile && openCalendar()\"\n            (blur)=\"_onBlur($event)\"\n        />\n    </fd-input-group>\n</ng-template>\n<ng-template #calendarTemplate>\n    <fd-calendar\n        [activeView]=\"activeView\"\n        [markWeekends]=\"markWeekends\"\n        [specialDaysRules]=\"specialDaysRules\"\n        [showWeekNumbers]=\"showWeekNumbers\"\n        [allowMultipleSelection]=\"allowMultipleSelection\"\n        [aggregatedYearGrid]=\"aggregatedYearGrid\"\n        [yearGrid]=\"yearGrid\"\n        [calType]=\"type\"\n        [rangeHoverEffect]=\"rangeHoverEffect\"\n        [disableFunction]=\"disableFunction\"\n        [disableRangeStartFunction]=\"disableRangeStartFunction\"\n        [disableRangeEndFunction]=\"disableRangeEndFunction\"\n        [selectedDate]=\"selectedDate\"\n        [selectedMultipleDates]=\"selectedMultipleDates\"\n        [selectedRangeDate]=\"selectedRangeDate\"\n        [selectedMultipleDateRanges]=\"selectedMultipleDateRanges\"\n        [startingDayOfWeek]=\"startingDayOfWeek\"\n        [previousButtonDisableFunction]=\"previousButtonDisableFunction\"\n        [nextButtonDisableFunction]=\"nextButtonDisableFunction\"\n        [showCalendarLegend]=\"showCalendarLegend()\"\n        [legendCol]=\"legendCol()\"\n        [mobileLandscape]=\"mobile && mobileLandscape\"\n        [mobilePortrait]=\"mobile && mobilePortrait\"\n        [dateRangeFormat]=\"dateRangeFormat\"\n        (selectedDateChange)=\"handleSingleDateChange($event)\"\n        (selectedMultipleDatesChange)=\"handleMultipleDatesChange($event)\"\n        (selectedRangeDateChange)=\"handleRangeDateChange($event)\"\n        (selectedMultipleDateRangesChange)=\"handleMultipleDateRangesChange($event)\"\n        (activeViewChange)=\"handleCalendarActiveViewChange($event)\"\n        (closeCalendar)=\"closeFromCalendar()\"\n    ></fd-calendar>\n    @if (showTodayButton) {\n        <div fd-bar barDesign=\"footer\" class=\"fd-date-picker__bar\">\n            <div fd-bar-right>\n                <fd-bar-element>\n                    <button\n                        fd-button\n                        [label]=\"'coreCalendar.todayLabel' | fdTranslate\"\n                        (click)=\"onTodayButtonClick()\"\n                    ></button>\n                </fd-bar-element>\n            </div>\n        </div>\n    }\n</ng-template>\n<div [style.display]=\"'none'\" aria-hidden=\"true\">\n    <div [attr.id]=\"_formValueStateMessageId\" aria-atomic=\"true\" aria-live=\"assertive\">\n        @switch (state) {\n            @case ('success') {\n                {{ 'coreDatePicker.valueStateSuccessMessage' | fdTranslate }}\n            }\n            @case ('information') {\n                {{ 'coreDatePicker.valueStateInformationMessage' | fdTranslate }}\n            }\n            @case ('warning') {\n                {{ 'coreDatePicker.valueStateWarningMessage' | fdTranslate }}\n            }\n            @case ('error') {\n                {{ 'coreDatePicker.valueStateErrorMessage' | fdTranslate }}\n            }\n        }\n        {{ _message }}\n    </div>\n</div>\n", styles: [".fd-date-picker-custom{display:inline-block}.fd-date-picker-custom fd-popover{display:block}.fd-date-picker-custom fd-calendar{border-radius:.25rem;border-radius:var(--sapElement_BorderCornerRadius, .25rem)}.fd-date-picker__bar{overflow:hidden}\n"] }]
        }], ctorParameters: () => [{ type: i0.ChangeDetectorRef }, { type: i1.DatetimeAdapter, decorators: [{
                    type: Optional
                }] }, { type: undefined, decorators: [{
                    type: Optional
                }, {
                    type: Inject,
                    args: [DATE_TIME_FORMATS]
                }] }, { type: i2.PopoverFormMessageService }], propDecorators: { type: [{
                type: Input
            }], placeholder: [{
                type: Input
            }], inputId: [{
                type: Input
            }], required: [{
                type: Input
            }], customDateTimeFormat: [{
                type: Input
            }], message: [{
                type: Input
            }], messageTriggers: [{
                type: Input
            }], selectedDate: [{
                type: Input
            }], selectedMultipleDates: [{
                type: Input
            }], selectedRangeDate: [{
                type: Input
            }], selectedMultipleDateRanges: [{
                type: Input
            }], startingDayOfWeek: [{
                type: Input
            }], rangeHoverEffect: [{
                type: Input
            }], useValidation: [{
                type: Input
            }], allowNull: [{
                type: Input
            }], activeView: [{
                type: Input
            }], placement: [{
                type: Input
            }], appendTo: [{
                type: Input
            }], disabled: [{
                type: Input
            }], closeOnDateChoose: [{
                type: Input
            }], showTodayButton: [{
                type: Input
            }], todayButtonLabel: [{
                type: Input
            }], previousButtonDisableFunction: [{
                type: Input
            }], nextButtonDisableFunction: [{
                type: Input
            }], buttonFocusable: [{
                type: Input
            }], specialDaysRules: [{
                type: Input
            }], yearGrid: [{
                type: Input
            }], aggregatedYearGrid: [{
                type: Input
            }], markWeekends: [{
                type: Input
            }], showWeekNumbers: [{
                type: Input
            }], allowMultipleSelection: [{
                type: Input
            }], inline: [{
                type: Input
            }], ariaLabelledBy: [{
                type: Input
            }], processInputOnBlur: [{
                type: Input,
                args: [{ transform: booleanAttribute }]
            }], preventScrollOnFocus: [{
                type: Input
            }], mobile: [{
                type: Input
            }], mobileConfig: [{
                type: Input
            }], mobileLandscape: [{
                type: Input
            }], mobilePortrait: [{
                type: Input
            }], dateRangeFormat: [{
                type: Input
            }], isOpenChange: [{
                type: Output
            }], selectedDateChange: [{
                type: Output
            }], selectedMultipleDatesChange: [{
                type: Output
            }], selectedRangeDateChange: [{
                type: Output
            }], selectedMultipleDateRangesChange: [{
                type: Output
            }], activeViewChange: [{
                type: Output
            }], _inputGroupElement: [{
                type: ViewChild,
                args: ['inputGroupComponent', {
                        read: ElementRef
                    }]
            }], _inputElement: [{
                type: ViewChild,
                args: [InputGroupInputDirective, {
                        read: ElementRef
                    }]
            }], _controlTemplate: [{
                type: ViewChild,
                args: ['controlTemplate']
            }], _calendarTemplate: [{
                type: ViewChild,
                args: ['calendarTemplate']
            }], _messagePopoverTemplate: [{
                type: ViewChild,
                args: ['popoverMessageTemplate']
            }], _calendars: [{
                type: ViewChildren,
                args: [CalendarComponent]
            }], showCalendarLegend: [{ type: i0.Input, args: [{ isSignal: true, alias: "showCalendarLegend", required: false }] }], legendCol: [{ type: i0.Input, args: [{ isSignal: true, alias: "legendCol", required: false }] }], state: [{
                type: Input
            }], isOpen: [{
                type: Input
            }], disableFunction: [{
                type: Input
            }], disableRangeStartFunction: [{
                type: Input
            }], disableRangeEndFunction: [{
                type: Input
            }] } });

/**
 * @deprecated
 * Use direct imports of components and directives.
 */
class DatePickerModule {
    static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.1.0", ngImport: i0, type: DatePickerModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule }); }
    static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "21.1.0", ngImport: i0, type: DatePickerModule, imports: [DatePickerComponent, DatePickerMobileComponent], exports: [DatePickerComponent, DatePickerMobileComponent] }); }
    static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "21.1.0", ngImport: i0, type: DatePickerModule, imports: [DatePickerComponent, DatePickerMobileComponent] }); }
}
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.1.0", ngImport: i0, type: DatePickerModule, decorators: [{
            type: NgModule,
            args: [{
                    imports: [DatePickerComponent, DatePickerMobileComponent],
                    exports: [DatePickerComponent, DatePickerMobileComponent]
                }]
        }] });

/**
 * Generated bundle index. Do not edit.
 */

export { DatePickerComponent, DatePickerMobileComponent, DatePickerModule };
//# sourceMappingURL=fundamental-ngx-core-date-picker.mjs.map
