'use strict';

Object.defineProperty(exports, '__esModule', { value: true });

const index = require('./index-420e0ca1.js');

const EclBreadcrumbItem = class {
    constructor(hostRef) {
        index.registerInstance(this, hostRef);
        this.theme = 'ec';
        this.styleClass = undefined;
        this.variant = undefined;
        this.path = undefined;
        this.currentPage = false;
        this.ellipsis = false;
        this.buttonAriaLabel = '';
    }
    getClass() {
        const styleClasses = [
            `ecl-breadcrumb__segment`,
            `sc-ecl-breadcrumb-${this.theme}`,
            this.styleClass
        ];
        if (this.ellipsis) {
            styleClasses.push('ecl-breadcrumb__segment--ellipsis');
        }
        if (this.currentPage) {
            styleClasses.push('ecl-breadcrumb__current-page');
        }
        return styleClasses.join(' ');
    }
    getLinkClass() {
        const linkClasses = [
            `sc-ecl-breadcrumb-${this.theme}`,
            'ecl-breadcrumb__link',
            'ecl-link--no-visited',
        ];
        if (this.el.closest('.ecl-breadcrumb--negative')) {
            linkClasses.push('ecl-link--negative');
        }
        return linkClasses.join(' ');
    }
    getLiAttrs() {
        const attrs = { 'data-ecl-breadcrumb-item': 'static' };
        if (this.ellipsis) {
            attrs['data-ecl-breadcrumb-ellipsis'] = 'data-ecl-breadcrumb-ellipsis';
        }
        return attrs;
    }
    render() {
        return (index.h("li", Object.assign({ class: this.getClass() }, this.getLiAttrs()), !this.currentPage && !this.ellipsis ?
            index.h("ecl-link", { variant: "standalone", path: this.path, "style-class": this.getLinkClass() }, index.h("ecl-icon", { slot: "icon-after", "style-class": `ecl-breadcrumb__icon sc-ecl-breadcrumb-${this.theme}`, icon: "corner-arrow", transform: "rotate-90", size: "2xs" }), index.h("slot", null)) :
            index.h("slot", null), this.ellipsis ?
            index.h("ecl-button", { "style-class": `ecl-breadcrumb__ellipsis sc-ecl-breadcrumb-${this.theme}`, variant: "ghost", "data-ecl-breadcrumb-ellipsis-button": true, "aria-label": this.buttonAriaLabel }, "...", index.h("ecl-icon", { "style-class": `ecl-breadcrumb__icon sc-ecl-breadcrumb-${this.theme}`, size: "2xs", transform: "rotate-90", icon: "corner-arrow", slot: "icon-after" })) : '', this.currentPage ?
            index.h("slot", null) : ''));
    }
    get el() { return index.getElement(this); }
};

exports.ecl_breadcrumb_item = EclBreadcrumbItem;

//# sourceMappingURL=ecl-breadcrumb-item.cjs.entry.js.map