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;
};
import { MelodicComponent } from '@melodicdev/core';
import { cardTemplate } from './card.template.js';
import { cardStyles } from './card.styles.js';
/**
 * ml-card - Container component for grouping content
 *
 * @example
 * ```html
 * <ml-card>
 *   <h3 slot="header">Card Title</h3>
 *   <p>Card content goes here</p>
 *   <div slot="footer">Card footer</div>
 * </ml-card>
 * ```
 *
 * @slot header - Card header content
 * @slot default - Main card content
 * @slot footer - Card footer content
 */
let CardComponent = class CardComponent {
    constructor() {
        /** Card visual style */
        this.variant = 'default';
        /** Add hover effect */
        this.hoverable = false;
        /** Make card clickable */
        this.clickable = false;
        this.handleClick = (event) => {
            if (this.clickable) {
                this.elementRef.dispatchEvent(new CustomEvent('ml:click', {
                    bubbles: true,
                    composed: true,
                    detail: { originalEvent: event }
                }));
            }
        };
    }
    /** Internal: check if header slot has content */
    get hasHeader() {
        return this.elementRef?.querySelector('[slot="header"]') !== null;
    }
    /** Internal: check if footer slot has content */
    get hasFooter() {
        return this.elementRef?.querySelector('[slot="footer"]') !== null;
    }
};
CardComponent = __decorate([
    MelodicComponent({
        selector: 'ml-card',
        template: cardTemplate,
        styles: cardStyles,
        attributes: ['variant', 'hoverable', 'clickable']
    })
], CardComponent);
export { CardComponent };
