// #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 { Disableable } from '../../../Behaviors/Disableable';
import { Sizeable } from '../../../Behaviors/Sizeable';
import { Slottable } from '../../../Behaviors/Slottable';
import { Themeable } from '../../../Behaviors/Themeable';
import { addInheritanceConsumerController } from '../../../Controllers/InheritanceConsumerController';
import { Attribute } from '../../../Decorators/AttributeDecorator';
import { Component } from '../../../Decorators/ComponentDecorator';
import { CustomElement } from '../../Abstracts/CustomElement';
import { ACTIONBAR_INHERITANCE_CONTEXT } from './ActionbarInheritanceContext';
import { actionbarItemElementTemplate } from './ActionbarItemElementTemplate';
import { actionbarItemElementCosmopolitanStyle } from './Themes/ActionbarItemElement.Cosmopolitan';
import { actionbarItemElementJoyStyle } from './Themes/ActionbarItemElement.Joy';
import { actionbarItemElementMemphisStyle } from './Themes/ActionbarItemElement.Memphis';
// #endregion
/**
 * Actionbar Item - The generic adapter for one primary inner control within the Actionbar.
 *
 * @description
 * The Actionbar Item is the structural and presentational bridge between the Actionbar context
 * and a concrete child control. It hosts exactly one primary slotted control
 * and integrates it into the Actionbar layout with consistent sizing, spacing, and alignment.
 *
 * The item provides Actionbar-level states such as `active` and `selected`, and enables
 * Actionbar-specific restyling of the inner control through CSS custom properties and
 * `::slotted()` rules. This allows controls to render differently inside an Actionbar than
 * outside of it, without modifying the controls themselves.
 *
 * The item does not implement control-specific domain behavior (toggle logic, dropdown
 * behavior, etc.). Those concerns remain in the slotted child control.
 *
 * @name Actionbar Item
 * @element mosaik-actionbar-item
 * @category Grouping
 *
 * @slot - The default slot for exactly one primary child control (button, toggle, etc.)
 *
 * @csspart root - The item container element
 *
 * @cssprop {String} --actionbar-item-background-color - Background color of the item
 * @cssprop {String} --actionbar-item-background-color-hover - Background color on hover
 * @cssprop {String} --actionbar-item-background-color-active - Background color when active/selected
 * @cssprop {String} --actionbar-item-border-radius - Border radius of the item
 * @cssprop {String} --actionbar-item-padding-bottom - Bottom padding
 * @cssprop {String} --actionbar-item-padding-left - Left padding
 * @cssprop {String} --actionbar-item-padding-right - Right padding
 * @cssprop {String} --actionbar-item-padding-top - Top padding
 * @cssprop {String} --actionbar-item-transition-duration - Duration of transitions
 * @cssprop {String} --actionbar-item-transition-mode - Timing function for transitions
 * @cssprop {String} --actionbar-item-transition-property - CSS properties to transition
 *
 * @example
 * Item wrapping a button in an actionbar group:
 * ```html
 * <mosaik-actionbar-group>
 *   <mosaik-actionbar-item>
 *     <mosaik-button label="Copy"></mosaik-button>
 *   </mosaik-actionbar-item>
 *   <mosaik-actionbar-item active>
 *     <mosaik-toggle-button label="Bold"></mosaik-toggle-button>
 *   </mosaik-actionbar-item>
 * </mosaik-actionbar-group>
 * ```
 *
 * @example
 * Item with grow for a combobox:
 * ```html
 * <mosaik-actionbar-item grow>
 *   <mosaik-combobox></mosaik-combobox>
 * </mosaik-actionbar-item>
 * ```
 *
 * @public
 */
let ActionbarItemElement = class ActionbarItemElement extends Themeable(Sizeable(Disableable(Slottable(CustomElement)))) {
    // #region Fields
    _inheritance = addInheritanceConsumerController(this, {
        context: ACTIONBAR_INHERITANCE_CONTEXT
    });
    _active;
    _grow;
    _selected;
    _shrink;
    // #endregion
    // #region Ctor
    /**
     * @public
     */
    constructor() {
        super();
        this._active = false;
        this._grow = false;
        this._selected = false;
        this._shrink = false;
    }
    // #endregion
    // #region Properties
    /**
     * Returns the `is` property.
     *
     * @public
     * @static
     * @readonly
     */
    static get is() {
        return 'mosaik-actionbar-item';
    }
    /**
     * Gets or sets the `active` property.
     * A generic Actionbar item active state. This is an Actionbar-level state,
     * not the same as pressed/toggled behavior of a child control.
     *
     * @public
     * @attr
     */
    get active() {
        return this._active;
    }
    set active(value) {
        if (this._active !== value) {
            this._active = value;
            this.requestUpdate('active');
        }
    }
    /**
     * Gets or sets the `grow` property.
     * When true, the item expands to fill available space on the main axis.
     * Important for controls such as comboboxes or larger inputs.
     *
     * @public
     * @attr
     */
    get grow() {
        return this._grow;
    }
    set grow(value) {
        if (this._grow !== value) {
            this._grow = value;
            this.requestUpdate('grow');
        }
    }
    /**
     * Gets or sets the `selected` property.
     * A generic Actionbar item selected state. This is distinct from control-specific
     * selected behavior unless intentionally mapped.
     *
     * @public
     * @attr
     */
    get selected() {
        return this._selected;
    }
    set selected(value) {
        if (this._selected !== value) {
            this._selected = value;
            this.requestUpdate('selected');
        }
    }
    /**
     * Gets or sets the `shrink` property.
     * When true, the item can shrink below its natural size on the main axis
     * when space is limited.
     *
     * @public
     * @attr
     */
    get shrink() {
        return this._shrink;
    }
    set shrink(value) {
        if (this._shrink !== value) {
            this._shrink = value;
            this.requestUpdate('shrink');
        }
    }
    /**
     * Gets or sets the `disabled` property.
     * Inherits from the parent actionbar/group if not explicitly set.
     *
     * @public
     * @override
     */
    get disabled() {
        return this._inheritance.get('disabled', super.disabled);
    }
    set disabled(value) {
        this._inheritance.markExplicit('disabled');
        super.disabled = value;
    }
    /**
     * Gets or sets the `size` property.
     * Inherits from the parent actionbar/group if not explicitly set.
     *
     * @public
     * @override
     */
    get size() {
        return this._inheritance.get('size', super.size);
    }
    set size(value) {
        this._inheritance.markExplicit('size');
        super.size = value;
    }
};
__decorate([
    Attribute({ type: Boolean }),
    __metadata("design:type", Boolean),
    __metadata("design:paramtypes", [Boolean])
], ActionbarItemElement.prototype, "active", null);
__decorate([
    Attribute({ type: Boolean }),
    __metadata("design:type", Boolean),
    __metadata("design:paramtypes", [Boolean])
], ActionbarItemElement.prototype, "grow", null);
__decorate([
    Attribute({ type: Boolean }),
    __metadata("design:type", Boolean),
    __metadata("design:paramtypes", [Boolean])
], ActionbarItemElement.prototype, "selected", null);
__decorate([
    Attribute({ type: Boolean }),
    __metadata("design:type", Boolean),
    __metadata("design:paramtypes", [Boolean])
], ActionbarItemElement.prototype, "shrink", null);
ActionbarItemElement = __decorate([
    Component({
        selector: 'mosaik-actionbar-item',
        template: actionbarItemElementTemplate,
        themes: {
            joy: actionbarItemElementJoyStyle,
            memphis: actionbarItemElementMemphisStyle,
            cosmopolitan: actionbarItemElementCosmopolitanStyle
        }
    }),
    __metadata("design:paramtypes", [])
], ActionbarItemElement);
export { ActionbarItemElement };
//# sourceMappingURL=ActionbarItemElement.js.map