// #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 { Slottable } from '../../../Behaviors/Slottable';
import { Themeable } from '../../../Behaviors/Themeable';
import { Component } from '../../../Decorators/ComponentDecorator';
import { CustomElement } from '../../Abstracts/CustomElement';
import { titleLayoutElementCosmopolitanStyle } from './Themes/TitleLayoutElement.Cosmopolitan';
import { titleLayoutElementJoyStyle } from './Themes/TitleLayoutElement.Joy';
import { titleLayoutElementMemphisStyle } from './Themes/TitleLayoutElement.Memphis';
import { titleLayoutElementTemplate } from './TitleLayoutElementTemplate';
// #endregion
/**
 * The `TitleLayoutElement` element.
 *
 * @element mosaik-title-layout
 * @category Layout
 *
 * @slot - The default slot.
 * @slot end - The end slot.
 * @slot start - The start slot.
 *
 * @csspart end - The end part.
 * @csspart main - The main part.
 * @csspart root - The root part.
 * @csspart start - The start part.
 *
 * @cssprop {String} --title-layout-background-color - The layout background color CSS custom property.
 * @cssprop {String} --title-layout-font-family - The layout font family CSS custom property.
 * @cssprop {String} --title-layout-font-letter-spacing - The layout font letter spacing CSS custom property.
 * @cssprop {String} --title-layout-font-line-height - The layout font line height CSS custom property.
 * @cssprop {String} --title-layout-font-size - The layout font size CSS custom property.
 * @cssprop {String} --title-layout-font-text-decoration - The layout font text decoration CSS custom property.
 * @cssprop {String} --title-layout-font-text-transform - The layout font text transform CSS custom property.
 * @cssprop {String} --title-layout-font-weight - The layout font weight CSS custom property.
 * @cssprop {String} --title-layout-gap - The layout gap CSS custom property.
 * @cssprop {String} --title-layout-padding-bottom - The layout padding bottom CSS custom property.
 * @cssprop {String} --title-layout-padding-left - The layout padding left CSS custom property.
 * @cssprop {String} --title-layout-padding-right - The layout padding right CSS custom property.
 * @cssprop {String} --title-layout-padding-top - The layout padding top CSS custom property.
 * @cssprop {String} --title-layout-shadow - The layout shadow CSS custom property.
 * @cssprop {String} --title-layout-shadow-blur - The layout shadow blur CSS custom property.
 * @cssprop {String} --title-layout-shadow-color - The layout shadow color CSS custom property.
 * @cssprop {String} --title-layout-shadow-offset-x - The layout shadow offset x CSS custom property.
 * @cssprop {String} --title-layout-shadow-offset-y - The layout shadow offset y CSS custom property.
 * @cssprop {String} --title-layout-shadow-spread - The layout shadow spread CSS custom property.
 * @cssprop {String} --title-layout-transition-duration - The layout transition duration CSS custom property.
 * @cssprop {String} --title-layout-transition-mode - The layout transition mode CSS custom property.
 * @cssprop {String} --title-layout-transition-property - The layout transition property CSS custom property.
 * @cssprop {String} --title-layout-translate - The layout translate CSS custom property.
 *
 * @example
 * Title layout with slotted start, center, and end content:
 * ```html
 * <mosaik-title-layout>
 *   <mosaik-button slot="start"></mosaik-button>
 *   <span>Page Title</span>
 *   <mosaik-button slot="end"></mosaik-button>
 * </mosaik-title-layout>
 * ```
 *
 * @public
 */
let TitleLayoutElement = class TitleLayoutElement extends Themeable(Slottable(CustomElement)) {
    // #region Fields
    // #endregion
    // #region Ctor
    /**
     * @public
     */
    constructor() {
        super();
    }
    // #endregion
    // #region Properties
    /**
     * Returns the `is` property.
     * The `is` property represents natural name of this element.
     *
     * @public
     * @static
     * @readonly
     */
    static get is() {
        return 'mosaik-title-layout';
    }
    /**
     * @public
     * @override
     */
    onSlotChanges(slotName) {
        super.onSlotChanges(slotName);
        void this.updateComplete.then(() => {
            this.adjustSizes();
        });
    }
    /**
     * @private
     */
    adjustSizes() {
        const start = this.getTemplatePart('start');
        const end = this.getTemplatePart('end');
        const startWidth = start.offsetWidth;
        const endWidth = end.offsetWidth;
        if (startWidth > endWidth) {
            end.style.minWidth = `${startWidth}px`;
        }
        else if (endWidth > startWidth) {
            start.style.minWidth = `${endWidth}px`;
        }
        else {
            start.style.minWidth = '';
            end.style.minWidth = '';
        }
    }
};
TitleLayoutElement = __decorate([
    Component({
        selector: 'mosaik-title-layout',
        template: titleLayoutElementTemplate,
        themes: {
            joy: titleLayoutElementJoyStyle,
            memphis: titleLayoutElementMemphisStyle,
            cosmopolitan: titleLayoutElementCosmopolitanStyle
        },
        imports: []
    }),
    __metadata("design:paramtypes", [])
], TitleLayoutElement);
export { TitleLayoutElement };
//# sourceMappingURL=TitleLayoutElement.js.map