// #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 { Themeable } from '../../../../Controls/Behaviors/Themeable';
import { DomServiceLocator } from '../../../../Dom/Dom';
import { TextFormattable } from '../../../Behaviors/TextFormattable';
import { Attribute } from '../../../Decorators/AttributeDecorator';
import { Component } from '../../../Decorators/ComponentDecorator';
import { ContentElement } from '../../Primitives/Content/ContentElement';
import { TextElement } from '../../Primitives/Text/TextElement';
import { cardTitleElementTemplate } from './CardTitleElementTemplate';
import { cardTitleElementJoyStyle } from './Themes/CardTitleElement.Joy';
import { cardTitleElementMemphisStyle } from './Themes/CardTitleElement.Memphis';
import { cardTitleElementCosmopolitanStyle } from './Themes/CardTitleElement.Cosmopolitan';
// #endregion
/**
 * CardTitle - A component that represents the title section of a card.
 *
 * @description This component is used to display the title of a card, often styled to stand out from other content. It provides a clear heading for the information contained within the card.
 *
 * @name CardTitle
 * @element mosaik-card-title
 * @category UI Components
 *
 * @slot - The default slot for placing the title content.
 *
 * @cssprop {unknown} --card-title-font-family - The font-family property for the card title text.
 * @cssprop {unknown} --card-title-font-size - The font-size property for the card title text.
 * @cssprop {unknown} --card-title-font-line-height - The line-height property for the card title text.
 * @cssprop {unknown} --card-title-font-weight - The font-weight property for the card title text.
 * @cssprop {unknown} --card-title-font-letter-spacing - The letter-spacing property for the card title text.
 * @cssprop {unknown} --card-title-font-text-decoration - The text-decoration property for the card title text.
 * @cssprop {unknown} --card-title-font-text-transform - The text-transform property for the card title text.
 * @cssprop {unknown} --card-title-background-color - The background-color property for the card title.
 * @cssprop {unknown} --card-title-border-color - The border-color property for the card title.
 * @cssprop {unknown} --card-title-foreground-color - The foreground-color property for the card title.
 *
 * @dependency {TextElement} - The Text element used for displaying the title text.
 *
 * @example
 * ```html
 * <mosaik-card-title>Card Title</mosaik-card-title>
 * ```
 *
 * @public
 */
let CardTitleElement = class CardTitleElement extends Themeable(TextFormattable(ContentElement)) {
    // #region Fields
    _text;
    // #endregion
    // #region Ctor
    /**
     * @public
     */
    constructor() {
        super();
        this._text = '';
    }
    // #endregion
    // #region Properties
    /**
     * Returns the `is` property.
     *
     * @public
     * @static
     * @override
     * @readonly
    */
    static get is() {
        return 'mosaik-card-title';
    }
    /**
     * Gets or sets the `text` property.
     *
     * @public
     * @attr
     */
    get text() {
        return this._text;
    }
    set text(value) {
        if (this._text !== value) {
            this._text = value;
            this.requestUpdate('text');
        }
    }
    // #endregion
    // #region Methods
    /**
     * @protected
     * @override
     */
    onApplyTemplate() {
        super.onApplyTemplate();
        // TODO: create any kind of obsevation here
        const card = DomServiceLocator.current.findShadowDomHost(this, { strict: true });
        if (this._text === '' && card.text !== '') {
            this.text = card.text;
        }
        if (this.formatter === null && card.formatter !== null) {
            this.formatter = card.formatter;
        }
    }
};
__decorate([
    Attribute({ type: String }),
    __metadata("design:type", String),
    __metadata("design:paramtypes", [String])
], CardTitleElement.prototype, "text", null);
CardTitleElement = __decorate([
    Component({
        selector: 'mosaik-card-title',
        template: cardTitleElementTemplate,
        themes: {
            joy: cardTitleElementJoyStyle,
            memphis: cardTitleElementMemphisStyle,
            cosmopolitan: cardTitleElementCosmopolitanStyle
        },
        host: {
            slot: 'header'
        },
        imports: [
            TextElement
        ]
    }),
    __metadata("design:paramtypes", [])
], CardTitleElement);
export { CardTitleElement };
//# sourceMappingURL=CardTitleElement.js.map