// #region Imports
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
    var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
    if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
    else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
    return c > 3 && r && Object.defineProperty(target, key, r), r;
};
var __metadata = (this && this.__metadata) || function (k, v) {
    if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
};
import { Key } from '../../../../Controls/Types/Key';
import { DomServiceLocator } from '../../../../Dom/Dom';
import { isDate } from '../../../../Extensions/Extensions';
import { DateFormatter } from '../../../../Intl/Formatters/DateFormatter';
import { DateParser } from '../../../../Intl/DateParser';
import { Appearanceable } from '../../../Behaviors/Appearanceable';
import { Clearable } from '../../../Behaviors/Clearable';
import { Disableable } from '../../../Behaviors/Disableable';
import { DropDownable } from '../../../Behaviors/DropDownable';
import { Invalidable } from '../../../Behaviors/Invalidable';
import { Labelable } from '../../../Behaviors/Labelable';
import { Localeable } from '../../../Behaviors/Localeable';
import { Slottable } from '../../../Behaviors/Slottable';
import { Valueable } from '../../../Behaviors/Valueable';
import { Variantable } from '../../../Behaviors/Variantable';
import { ClickOutsideController } from '../../../Controllers/ClickOutsideController';
import { KeyboardController } from '../../../Controllers/KeyboardController';
import { Attribute } from '../../../Decorators/AttributeDecorator';
import { Component } from '../../../Decorators/ComponentDecorator';
import { Property } from '../../../Decorators/PropertyDecorator';
import { QueryChild } from '../../../Decorators/QueryChildDecorator';
import { Watch } from '../../../Decorators/WatchDecorator';
import { CalendarView } from '../../../Types/CalendarView';
import { DayOfWeek } from '../../../Types/DayOfWeek';
import { RangeSelectionMode } from '../../../Types/RangeSelectionMode';
import { SelectionMode } from '../../../Types/SelectionMode';
import { ButtonElement } from '../../Buttons/Button/ButtonElement';
import { IconElement } from '../../Media/Icon/IconElement';
import { FloatingElement } from '../../Primitives/Floating/FloatingElement';
import { FocusRingElement } from '../../Primitives/FocusRing/FocusRingElement';
import { PopupElement } from '../../Primitives/Popup/PopupElement';
import { InputBaseElement } from '../Abstracts/InputBase';
import { CalendarElement } from '../Calendar/CalendarElement';
import { getDateOnly } from '../Calendar/Utils';
import { dateBoxElementTemplate } from './DateBoxElementTemplate';
import { dateBoxElementJoyStyle } from './Themes/DateBoxElement.Joy';
import { dateBoxElementRetroStyle } from './Themes/DateBoxElement.Retro';
import { dateBoxElementCosmopolitanStyle } from './Themes/DateBoxElement.Cosmopolitan';
import { Themeable } from '../../../Behaviors/Themeable';
import { TextAlignment } from '../../../Types/TextAlignment';
// #endregion
/**
 * Date Box - A user interface component for selecting or displaying dates.
 *
 * @element mosaik-datebox
 *
 * @description
 * The Date Box component provides a visual interface for users to select or display dates. It often includes a
 * text input field that allows users to manually enter a date or pick a date from a calendar dropdown. Date Boxes
 * can also display selected dates in a human-readable format. They are commonly used in forms, date pickers, and
 * date-related interactions.
 *
 * @category Forms
 *
 * @keyhandle Space - Toggles the dropdown.
 * @keyhandle Enter - Toggles the dropdown.
 * @keyhandle Escape - Closes the dropdown if it is open, otherwise clears the value.
 * @keyhandle Tab - Closes the dropdown.
 *
 * @example
 * ```html
 * <mosaik-datebox></mosaik-datebox>
 * ```
 *
 * @public
 */
let DateBoxElement = class DateBoxElement extends Themeable(Slottable(Clearable(Localeable(Disableable(Invalidable(Valueable(Variantable(Appearanceable(DropDownable(Labelable(InputBaseElement))))))))))) {
    // #region Fields
    _inputElement;
    _clickOutsideController;
    _keyboardController;
    _value;
    _displayValue;
    _readonly;
    _required;
    _autofocus;
    _name;
    _placeholder;
    _autocomplete;
    _values;
    _view;
    _selectionMode;
    _blackoutDates;
    _specialDates;
    _minDate;
    _maxDate;
    _firstDayOfWeek;
    _isTodayHighlighted;
    _isWeekendHighlighted;
    _showWeekNumbers;
    _markerHandler;
    _showAdjacent;
    _format;
    _invalidInput;
    _textAlign;
    // #endregion
    // #region Ctor
    /**
     * @public
     */
    constructor() {
        super();
        // TODO: set this with oject assign
        this.maxDropDownHeight = 'auto';
        this._value = new Date();
        this._displayValue = '';
        this._readonly = false;
        this._required = false;
        this._autofocus = false;
        this._name = '';
        this._placeholder = '';
        this._autocomplete = false;
        this._values = new Array();
        this._view = CalendarView.Day;
        this._selectionMode = RangeSelectionMode.Single;
        this._blackoutDates = new Array();
        this._specialDates = new Array();
        this._minDate = null;
        this._maxDate = null;
        this._firstDayOfWeek = DayOfWeek.Sunday;
        this._isTodayHighlighted = false;
        this._isWeekendHighlighted = false;
        this._showWeekNumbers = false;
        this._markerHandler = (_item) => [];
        this._showAdjacent = false;
        this._format = 'yyyy-MM-dd';
        this._invalidInput = false;
        this._textAlign = TextAlignment.Right;
        this._clickOutsideController = new ClickOutsideController(this, {
            skipInitial: true,
            callback: () => {
                this.close();
            }
        });
        this._keyboardController = new KeyboardController(this);
    }
    // #endregion
    // #region Properties
    /**
     * Returns the `{@link is}` property.
     * The `{@link is}` property represents natural name of this element.
     *
     * @public
     * @static
     * @readonly
     */
    static get is() {
        return 'mosaik-datebox';
    }
    /**
     * Returns the `displayDate` property.
     * The `displayDate` property represents the initial date to display in the calendar.
     *
     * @public
     */
    get displayDate() {
        return this.value;
    }
    set displayDate(value) {
        this.value = value;
    }
    /**
     * Returns the `displayDateStart` property.
     * The `displayDateStart` property represents the start date to display in the calendar.
     *
     * @public
     */
    get displayDateStart() {
        return this._value;
    }
    set displayDateStart(value) {
        this._value = value;
    }
    /**
     * Returns the `displayDateEnd` property.
     * The `displayDateEnd` property represents the end date to display in the calendar.
     *
     * @public
     */
    get displayDateEnd() {
        return this._value;
    }
    set displayDateEnd(value) {
        this._value = value;
    }
    /**
     * Gets or sets the `value` property.
     *
     * @public
     * @override
     */
    get value() {
        return this._value;
    }
    set value(value) {
        if (isDate(value)) {
            value = getDateOnly(value);
        }
        if (this._value !== value) {
            this._value = value;
            this.requestUpdate('value');
        }
    }
    /**
     * Gets or sets the `displayValue` property.
     *
     * @public
     * @readonly
     */
    get displayValue() {
        return this._displayValue;
    }
    set displayValue(value) {
        if (this._displayValue !== value) {
            this._displayValue = value;
            this.requestUpdate('displayValue');
        }
    }
    /**
     * Gets or sets the `readonly` property.
     *
     * @public
     * @attr
     */
    get readonly() {
        return this._readonly;
    }
    set readonly(value) {
        if (this._readonly !== value) {
            this._readonly = value;
            this.requestUpdate('readonly');
        }
    }
    /**
     * Gets or sets the `required` property.
     *
     * @public
     * @attr
     */
    get required() {
        return this._required;
    }
    set required(value) {
        if (this._required !== value) {
            this._required = value;
            this.requestUpdate('required');
        }
    }
    /**
     * Gets or sets the `autofocus` property.
     *
     * @public
     * @override
     */
    get autofocus() {
        return this._autofocus;
    }
    set autofocus(value) {
        if (this._autofocus !== value) {
            this._autofocus = value;
            this.requestUpdate('autofocus');
        }
    }
    /**
     * Gets or sets the `name` property.
     *
     * @public
     * @attr
     */
    get name() {
        return this._name;
    }
    set name(value) {
        if (this._name !== value) {
            this._name = value;
            this.requestUpdate('name');
        }
    }
    /**
     * Gets or sets the `placeholder` property.
     *
     * @public
     * @attr
     */
    get placeholder() {
        return this._placeholder;
    }
    set placeholder(value) {
        if (this._placeholder !== value) {
            this._placeholder = value;
            this.requestUpdate('placeholder');
        }
    }
    /**
     * Gets or sets the `autocomplete` property.
     *
     * @public
     * @attr
     */
    get autocomplete() {
        return this._autocomplete;
    }
    set autocomplete(value) {
        if (this._autocomplete !== value) {
            this._autocomplete = value;
            this.requestUpdate('autocomplete');
        }
    }
    /**
     * Gets or sets the `values` property.
     *
     * @public
     * @attr
     */
    get values() {
        return this._values;
    }
    set values(value) {
        if (this._values !== value) {
            this._values = value;
            this.requestUpdate('values');
        }
    }
    /**
     * Gets or sets the `view` property.
     *
     * @public
     * @attr
     */
    get view() {
        return this._view;
    }
    set view(value) {
        if (this._view !== value) {
            this._view = value;
            this.requestUpdate('view');
        }
    }
    /**
     * Gets or sets the `selectionMode` property.
     *
     * @public
     * @attr
     */
    get selectionMode() {
        return this._selectionMode;
    }
    set selectionMode(value) {
        if (this._selectionMode !== value) {
            this._selectionMode = value;
            this.requestUpdate('selectionMode');
        }
    }
    /**
     * Gets or sets the `blackoutDates` property.
     *
     * @public
     * @attr
     */
    get blackoutDates() {
        return this._blackoutDates;
    }
    set blackoutDates(value) {
        if (this._blackoutDates !== value) {
            this._blackoutDates = value;
            this.requestUpdate('blackoutDates');
        }
    }
    /**
     * Gets or sets the `specialDates` property.
     *
     * @public
     * @attr
     */
    get specialDates() {
        return this._specialDates;
    }
    set specialDates(value) {
        if (this._specialDates !== value) {
            this._specialDates = value;
            this.requestUpdate('specialDates');
        }
    }
    /**
     * Gets or sets the `minDate` property.
     *
     * @public
     * @attr
     */
    get minDate() {
        return this._minDate;
    }
    set minDate(value) {
        if (this._minDate !== value) {
            this._minDate = value;
            this.requestUpdate('minDate');
        }
    }
    /**
     * Gets or sets the `maxDate` property.
     *
     * @public
     * @attr
     */
    get maxDate() {
        return this._maxDate;
    }
    set maxDate(value) {
        if (this._maxDate !== value) {
            this._maxDate = value;
            this.requestUpdate('maxDate');
        }
    }
    /**
     * Gets or sets the `firstDayOfWeek` property.
     *
     * @public
     * @attr
     */
    get firstDayOfWeek() {
        return this._firstDayOfWeek;
    }
    set firstDayOfWeek(value) {
        if (this._firstDayOfWeek !== value) {
            this._firstDayOfWeek = value;
            this.requestUpdate('firstDayOfWeek');
        }
    }
    /**
     * Gets or sets the `isTodayHighlighted` property.
     *
     * @public
     * @attr
     */
    get isTodayHighlighted() {
        return this._isTodayHighlighted;
    }
    set isTodayHighlighted(value) {
        if (this._isTodayHighlighted !== value) {
            this._isTodayHighlighted = value;
            this.requestUpdate('isTodayHighlighted');
        }
    }
    /**
     * Gets or sets the `isWeekendHighlighted` property.
     *
     * @public
     * @attr
     */
    get isWeekendHighlighted() {
        return this._isWeekendHighlighted;
    }
    set isWeekendHighlighted(value) {
        if (this._isWeekendHighlighted !== value) {
            this._isWeekendHighlighted = value;
            this.requestUpdate('isWeekendHighlighted');
        }
    }
    /**
     * Gets or sets the `showWeekNumbers` property.
     *
     * @public
     * @attr
     */
    get showWeekNumbers() {
        return this._showWeekNumbers;
    }
    set showWeekNumbers(value) {
        if (this._showWeekNumbers !== value) {
            this._showWeekNumbers = value;
            this.requestUpdate('showWeekNumbers');
        }
    }
    /**
     * A handler that gets date and returns null or a tuple with circled marker data. See {@link CalendarMarkerData}.
     *
     * @public
     */
    get markerHandler() {
        return this._markerHandler;
    }
    set markerHandler(value) {
        if (this._markerHandler !== value) {
            this._markerHandler = value;
            this.requestUpdate('markerHandler');
        }
    }
    /**
     * Gets or sets the `showAdjacent` property.
     *
     * @public
     * @attr
     */
    get showAdjacent() {
        return this._showAdjacent;
    }
    set showAdjacent(value) {
        if (this._showAdjacent !== value) {
            this._showAdjacent = value;
            this.requestUpdate('showAdjacent');
        }
    }
    /**
     * Gets or sets the `format` property.
     *
     * Supported date format specifiers:
     * - `d`   : Day of the month (1-31) without leading zero.
     * - `dd`  : Day of the month (01-31) with leading zero.
     * - `ddd` : Abbreviated name of the day of the week (e.g., Mon, Tue).
     * - `dddd`: Full name of the day of the week (e.g., Monday, Tuesday).
     * - `M`   : Month (1-12) without leading zero.
     * - `MM`  : Month (01-12) with leading zero.
     * - `MMM` : Abbreviated name of the month (e.g., Jan, Feb).
     * - `MMMM`: Full name of the month (e.g., January, February).
     * - `y`   : Year as the last two digits without leading zero (e.g., 9 for 2009).
     * - `yy`  : Year as the last two digits with leading zero (e.g., 09 for 2009).
     * - `yyy` : Year with a minimum of three digits (e.g., 009, 2009).
     * - `yyyy`: Year as a four-digit number (e.g., 2009).
     * - `-`   : Custom separator (e.g., hyphen).
     * - `/`   : Date separator (e.g., slash).
     * - `.`   : Custom separator (e.g., dot).
     *
     * @public
     * @attr
     */
    get format() {
        return this._format;
    }
    set format(value) {
        if (this._format !== value) {
            this._format = value;
            this.requestUpdate('format');
        }
    }
    /**
     * Determines the text alignment of the component.
     *
     * @public
     * @attr
     */
    get textAlign() {
        return this._textAlign;
    }
    set textAlign(value) {
        if (this._textAlign !== value) {
            this._textAlign = value;
            this.requestUpdate('textAlign');
        }
    }
    /**
     * Determines whether the element has a prefix or not.
     * The Prefix is a slot that is displayed before the input.
     *
     * @private
     * @readonly
     * @attr
     */
    get hasPrefix() {
        return this.hasSlotContent('prefix');
    }
    /**
     * Determines whether the element has a suffix or not.
     * The Suffix is a slot that is displayed after the input.
     *
     * @private
     * @readonly
     * @attr
     */
    get hasSuffix() {
        return this.hasSlotContent('suffix');
    }
    /**
     * @protected
     * @readonly
     */
    get keyboard() {
        return this._keyboardController;
    }
    // #endregion
    // #region Methods
    /**
     * @public
     * @override
     */
    connectedCallback() {
        super.connectedCallback();
        this.keyboard
            .add([Key.Space, Key.Enter], () => this.toggle(), undefined, { preventDefault: true })
            .add([Key.Escape], () => {
            if (this.isDropDownOpen) {
                this.close();
            }
            else {
                this.clear();
            }
        }, undefined, { preventDefault: true })
            .add([Key.Tab], () => this.close());
        this.on('click', () => this.focus());
    }
    /**
     * Sets focus on the input.
     *
     * @public
     * @override
     */
    focus() {
        if (this.shadowRoot) {
            DomServiceLocator.current.findDescendant(this.shadowRoot, 'input')?.focus();
        }
    }
    /**
     * Removes keyboard focus from the input.
     *
     * @public
     * @override
     */
    blur() {
        if (this.shadowRoot) {
            DomServiceLocator.current.findDescendant(this.shadowRoot, 'input')?.blur();
        }
    }
    /**
     * Clears the value of the element but not the validation.
     *
     * @public
     * @override
     */
    clear(force) {
        const isCleared = super.clear(force);
        if (isCleared) {
            this.emit('change', {
                bubbles: true,
                composed: true
            });
        }
        return isCleared;
    }
    /**
     * Resets the value, all kinds of validation and errors.
     *
     * @public
     * @override
     */
    reset() {
        super.reset();
        this.clear();
        this._invalidInput = false;
        this.invalid = false;
    }
    /**
     * Checks the validity of the element and returns `true` if it is valid; otherwise, `false`.
     *
     * @public
     * @override
     */
    checkValidity() {
        return this.shadowRoot
            ? (this._inputElement?.checkValidity() && !this._invalidInput) ?? true
            : true;
    }
    /**
     * @protected
     * @template
     */
    onChange(event) {
        if (!event.target) {
            return;
        }
        if (event.target instanceof HTMLInputElement) {
            const inputValue = event.target.value;
            const date = DateParser.tryParse(inputValue, this._format, this.locale);
            if (date) {
                const formattedDate = DateFormatter.format(date, this._format, this.locale);
                this.displayValue = formattedDate;
                this.value = date;
                this._invalidInput = false;
            }
            else {
                this.value = null;
                this._invalidInput = true;
            }
        }
        this.emit('change', { detail: this.value });
    }
    /**
     * @protected
     * @template
     * @override
     */
    onInput(event) {
        super.onInput(event);
        this.emit('input', { detail: this.value });
    }
    /**
     * @protected
     * @template
     * @override
     */
    onFocus(event) {
        super.onFocus(event);
        this.emit('focus', { detail: event });
    }
    /**
     * @protected
     * @template
     * @override
     */
    onBlur(event) {
        super.onBlur(event);
        this.emit('blur', { detail: event });
    }
    /**
     * @protected
     * @template
     */
    onDateChanged(detail) {
        this.value = detail.value?.date ?? null;
        this.emit('change', { detail: this.value });
        this.close();
    }
    /**
     * @protected
     */
    onIsDropDownOpenPropertyChanged(_prev, next) {
        // handle interaction outside of popup
        if (next) {
            this._clickOutsideController.observe();
        }
        else {
            this._clickOutsideController.unobserve();
        }
    }
    /**
     * @protected
     */
    onFormatPropertyChanged(_prev, next) {
        if (this.value && next) {
            const formattedDate = DateFormatter.format(this.value, next, this.locale);
            this.displayValue = formattedDate;
        }
    }
    /**
     * @protected
     */
    onDisabledPropertyChanged(_prev, next) {
        if (next) {
            this.close();
        }
    }
    /**
     * @protected
     */
    onValuePropertyChanged(_prev, next) {
        if (next) {
            const formattedDate = DateFormatter.format(next, this._format, this.locale);
            this.displayValue = formattedDate;
        }
    }
};
__decorate([
    QueryChild('[part="input"]'),
    __metadata("design:type", HTMLInputElement)
], DateBoxElement.prototype, "_inputElement", void 0);
__decorate([
    Property({ type: Date }),
    __metadata("design:type", Object),
    __metadata("design:paramtypes", [Object])
], DateBoxElement.prototype, "displayDate", null);
__decorate([
    Property({ type: Date }),
    __metadata("design:type", Object),
    __metadata("design:paramtypes", [Object])
], DateBoxElement.prototype, "displayDateStart", null);
__decorate([
    Property({ type: Date }),
    __metadata("design:type", Object),
    __metadata("design:paramtypes", [Object])
], DateBoxElement.prototype, "displayDateEnd", null);
__decorate([
    Attribute({
        type: Date,
        converter: {
            fromAttribute: (value) => value ? new Date(value) : null,
            toAttribute: (value) => value ? value.toISOString() : ''
        }
    }),
    __metadata("design:type", Object),
    __metadata("design:paramtypes", [Object])
], DateBoxElement.prototype, "value", null);
__decorate([
    Property({ type: String }),
    __metadata("design:type", String),
    __metadata("design:paramtypes", [String])
], DateBoxElement.prototype, "displayValue", null);
__decorate([
    Attribute({
        type: Boolean,
        useDefault: true
    }),
    __metadata("design:type", Boolean),
    __metadata("design:paramtypes", [Boolean])
], DateBoxElement.prototype, "readonly", null);
__decorate([
    Attribute({
        type: Boolean,
        useDefault: true
    }),
    __metadata("design:type", Boolean),
    __metadata("design:paramtypes", [Boolean])
], DateBoxElement.prototype, "required", null);
__decorate([
    Attribute({
        type: Boolean,
        useDefault: true
    }),
    __metadata("design:type", Boolean),
    __metadata("design:paramtypes", [Boolean])
], DateBoxElement.prototype, "autofocus", null);
__decorate([
    Attribute({ type: String }),
    __metadata("design:type", String),
    __metadata("design:paramtypes", [String])
], DateBoxElement.prototype, "name", null);
__decorate([
    Attribute({ type: String }),
    __metadata("design:type", String),
    __metadata("design:paramtypes", [String])
], DateBoxElement.prototype, "placeholder", null);
__decorate([
    Attribute({
        type: Boolean,
        useDefault: true
    }),
    __metadata("design:type", Boolean),
    __metadata("design:paramtypes", [Boolean])
], DateBoxElement.prototype, "autocomplete", null);
__decorate([
    Attribute({
        type: (Array),
        converter: {
            fromAttribute: (value) => !value
                ? undefined
                : value
                    .split(' ')
                    .map((v) => v.trim())
                    .filter((v) => v)
                    .map((v) => new Date(v)),
            toAttribute: (value) => value.map((v) => v.toISOString()).join(' ')
        }
    }),
    __metadata("design:type", Array),
    __metadata("design:paramtypes", [Array])
], DateBoxElement.prototype, "values", null);
__decorate([
    Attribute({ type: CalendarView }),
    __metadata("design:type", String),
    __metadata("design:paramtypes", [String])
], DateBoxElement.prototype, "view", null);
__decorate([
    Attribute({ type: SelectionMode }),
    __metadata("design:type", String),
    __metadata("design:paramtypes", [String])
], DateBoxElement.prototype, "selectionMode", null);
__decorate([
    Attribute({ type: (Array) }),
    __metadata("design:type", Array),
    __metadata("design:paramtypes", [Array])
], DateBoxElement.prototype, "blackoutDates", null);
__decorate([
    Attribute({ type: (Array) }),
    __metadata("design:type", Array),
    __metadata("design:paramtypes", [Array])
], DateBoxElement.prototype, "specialDates", null);
__decorate([
    Attribute({
        type: Date,
        converter: {
            fromAttribute: (value) => value ? new Date(value) : new Date(),
            toAttribute: (value) => value ? value.toISOString() : ''
        }
    }),
    __metadata("design:type", Object),
    __metadata("design:paramtypes", [Object])
], DateBoxElement.prototype, "minDate", null);
__decorate([
    Attribute({
        type: Date,
        converter: {
            fromAttribute: (value) => value ? new Date(value) : new Date(),
            toAttribute: (value) => value ? value.toISOString() : ''
        }
    }),
    __metadata("design:type", Object),
    __metadata("design:paramtypes", [Object])
], DateBoxElement.prototype, "maxDate", null);
__decorate([
    Attribute({ type: DayOfWeek }),
    __metadata("design:type", Number),
    __metadata("design:paramtypes", [Number])
], DateBoxElement.prototype, "firstDayOfWeek", null);
__decorate([
    Attribute({
        type: Boolean,
        useDefault: true
    }),
    __metadata("design:type", Boolean),
    __metadata("design:paramtypes", [Boolean])
], DateBoxElement.prototype, "isTodayHighlighted", null);
__decorate([
    Attribute({
        type: Boolean,
        useDefault: true
    }),
    __metadata("design:type", Boolean),
    __metadata("design:paramtypes", [Boolean])
], DateBoxElement.prototype, "isWeekendHighlighted", null);
__decorate([
    Attribute({
        type: Boolean,
        useDefault: true
    }),
    __metadata("design:type", Boolean),
    __metadata("design:paramtypes", [Boolean])
], DateBoxElement.prototype, "showWeekNumbers", null);
__decorate([
    Property({ type: Function }),
    __metadata("design:type", Function),
    __metadata("design:paramtypes", [Function])
], DateBoxElement.prototype, "markerHandler", null);
__decorate([
    Attribute({
        type: Boolean,
        useDefault: true
    }),
    __metadata("design:type", Boolean),
    __metadata("design:paramtypes", [Boolean])
], DateBoxElement.prototype, "showAdjacent", null);
__decorate([
    Attribute({ type: String }),
    __metadata("design:type", String),
    __metadata("design:paramtypes", [String])
], DateBoxElement.prototype, "format", null);
__decorate([
    Attribute({ type: TextAlignment }),
    __metadata("design:type", String),
    __metadata("design:paramtypes", [String])
], DateBoxElement.prototype, "textAlign", null);
__decorate([
    Attribute({
        type: Boolean,
        useDefault: true
    }),
    __metadata("design:type", Boolean),
    __metadata("design:paramtypes", [])
], DateBoxElement.prototype, "hasPrefix", null);
__decorate([
    Attribute({
        type: Boolean,
        useDefault: true
    }),
    __metadata("design:type", Boolean),
    __metadata("design:paramtypes", [])
], DateBoxElement.prototype, "hasSuffix", null);
__decorate([
    Watch('isDropDownOpen', { waitUntilFirstUpdate: true }),
    __metadata("design:type", Function),
    __metadata("design:paramtypes", [Boolean, Boolean]),
    __metadata("design:returntype", void 0)
], DateBoxElement.prototype, "onIsDropDownOpenPropertyChanged", null);
__decorate([
    Watch('format', { waitUntilFirstUpdate: true }),
    __metadata("design:type", Function),
    __metadata("design:paramtypes", [String, String]),
    __metadata("design:returntype", void 0)
], DateBoxElement.prototype, "onFormatPropertyChanged", null);
__decorate([
    Watch('disabled', { waitUntilFirstUpdate: true }),
    __metadata("design:type", Function),
    __metadata("design:paramtypes", [Boolean, Boolean]),
    __metadata("design:returntype", void 0)
], DateBoxElement.prototype, "onDisabledPropertyChanged", null);
__decorate([
    Watch('value'),
    __metadata("design:type", Function),
    __metadata("design:paramtypes", [Object, Object]),
    __metadata("design:returntype", void 0)
], DateBoxElement.prototype, "onValuePropertyChanged", null);
DateBoxElement = __decorate([
    Component({
        selector: 'mosaik-datebox',
        template: dateBoxElementTemplate,
        themes: {
            joy: dateBoxElementJoyStyle,
            retro: dateBoxElementRetroStyle,
            cosmopolitan: dateBoxElementCosmopolitanStyle
        },
        host: {
            tabIndex: '0'
        },
        options: {
            mode: 'open',
            delegatesFocus: true
        },
        imports: [
            IconElement,
            PopupElement,
            CalendarElement,
            FocusRingElement,
            FloatingElement,
            ButtonElement
        ]
    }),
    __metadata("design:paramtypes", [])
], DateBoxElement);
export { DateBoxElement };
//# sourceMappingURL=DateBoxElement.js.map