import { r as registerInstance, h } from './index-e78ba223.js';

const EclListIllustrationItem = class {
    constructor(hostRef) {
        registerInstance(this, hostRef);
        this.theme = 'ec';
        this.itemTitle = undefined;
        this.itemLink = undefined;
        this.image = undefined;
        this.icon = undefined;
        this.imageAlt = undefined;
        this.squareImage = false;
        this.styleClass = undefined;
        this.mediaSize = 'm';
        this.itemValue = undefined;
    }
    getClass() {
        const styleClasses = [
            `sc-ecl-list-illustration-${this.theme}`,
            `ecl-list-illustration__item`,
            this.styleClass
        ];
        return styleClasses.join(' ');
    }
    getImgClass() {
        const imgClasses = [
            `sc-ecl-list-illustration-${this.theme}`,
            `ecl-list-illustration__image`,
        ];
        if (this.squareImage) {
            imgClasses.push('ecl-list-illustration__image--square');
            imgClasses.push(`ecl-list-illustration__image--${this.mediaSize}`);
        }
        return imgClasses.join(' ');
    }
    getImgAttr() {
        const attrs = {
            role: 'img',
        };
        if (this.imageAlt) {
            attrs['aria-label'] = this.imageAlt;
        }
        return attrs;
    }
    getIconSize() {
        return this.mediaSize === 'l' ? '2xl' : 'l';
    }
    render() {
        return (h("div", { class: this.getClass() }, this.image ?
            h("ecl-picture", Object.assign({ styleClass: `ecl-list-illustration__picture sc-ecl-list-illustration-${this.theme}`, imgClass: this.getImgClass(), image: this.image, imageAlt: this.imageAlt }, this.getImgAttr()), h("slot", { name: "sources" })) : '', h("div", { class: `ecl-list-illustration__detail sc-ecl-list-illustration-${this.theme}` }, h("div", { class: `ecl-list-illustration__title-container sc-ecl-list-illustration-${this.theme}` }, this.icon ?
            h("ecl-icon", { icon: this.icon, size: this.getIconSize(), "style-class": `ecl-list-illustration__icon sc-ecl-list-illustration-${this.theme}` }) : '', this.itemValue ?
            h("div", { class: `ecl-list-illustration__value sc-ecl-list-illustration-${this.theme}` }, this.itemValue) : '', this.itemTitle && (h("div", { class: `ecl-list-illustration__title sc-ecl-list-illustration-${this.theme}` }, this.itemLink ? (h("ecl-link", { variant: "standalone", path: this.itemLink }, this.itemTitle)) : (this.itemTitle)))), h("div", { class: `ecl-list-illustration__description sc-ecl-list-illustration-${this.theme}` }, h("slot", null)))));
    }
};

export { EclListIllustrationItem as ecl_list_illustration_item };

//# sourceMappingURL=ecl-list-illustration-item.entry.js.map