// #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 { fadeIn, fadeOut } from '../../../../Animations/Presets/Fade';
import { Animatable } from '../../../Behaviors/Animatable';
import { Closeable } from '../../../Behaviors/Closeable';
import { Disableable } from '../../../Behaviors/Disableable';
import { Iconable } from '../../../Behaviors/Iconable';
import { Labelable } from '../../../Behaviors/Labelable';
import { Orientable } from '../../../Behaviors/Orientable';
import { Selectable } from '../../../Behaviors/Selectable';
import { Valueable } from '../../../Behaviors/Valueable';
import { Component } from '../../../Decorators/ComponentDecorator';
import { CustomElement } from '../../Abstracts/CustomElement';
import { tabItemElementTemplate } from './TabItemElementTemplate';
import { tabItemElementJoyStyle } from './Themes/TabItemElement.Joy';
import { tabItemElementRetroStyle } from './Themes/TabItemElement.Retro';
import { tabItemElementCosmopolitanStyle } from './Themes/TabItemElement.Cosmopolitan';
import { Themeable } from '../../../Behaviors/Themeable';
// #endregion
/**
 * Tab Item - A navigation option within a tabbed interface.
 *
 * @element mosaik-tab-item
 * @category Selector
 *
 * @slot - The default slot.
 *
 * @fires selectionChanged - Fired when the tab selection changes.
 * @fires closed - Fired when the tab will be closed.
 *
 * @public
 */
let TabItemElement = class TabItemElement extends Themeable(Animatable(Disableable(Orientable(Closeable(Selectable(Labelable(Iconable(Valueable(CustomElement))))))))) {
    // #region Ctor
    /**
     * Constructs a new instance of the `TabItemElement` class.
     *
     * @public
     */
    constructor() {
        super();
        this.enter = fadeIn;
        this.exit = fadeOut;
    }
    // #endregion
    // #region Properties
    /**
     * Returns the `is` property.
     *
     * @public
     * @static
     * @readonly
    */
    static get is() {
        return 'mosaik-tab-item';
    }
    // #endregion
    // #region Methods
    /**
     * @public
     * @override
     */
    connectedCallback() {
        super.connectedCallback();
        void this.play(this.enter ?? { steps: [] });
    }
    /**
     * @public
     * @override
     */
    disconnectedCallback() {
        void this.play(this.exit ?? { steps: [] });
        super.disconnectedCallback();
    }
    onSelectionChanges() {
        super.onSelectionChanges();
        if (this.isSelected) {
            void this.play(this.enter ?? { steps: [] });
        }
        else {
            void this.play(this.exit ?? { steps: [] });
        }
    }
};
TabItemElement = __decorate([
    Component({
        selector: 'mosaik-tab-item',
        template: tabItemElementTemplate,
        themes: {
            joy: tabItemElementJoyStyle,
            retro: tabItemElementRetroStyle,
            cosmopolitan: tabItemElementCosmopolitanStyle
        },
        imports: []
    }),
    __metadata("design:paramtypes", [])
], TabItemElement);
export { TabItemElement };
//# sourceMappingURL=TabItemElement.js.map