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

const EclTagSet = class {
    constructor(hostRef) {
        registerInstance(this, hostRef);
    }
    getClass() {
        const styleClasses = [
            'ecl-tag-set',
            `sc-ecl-tag-${this.theme}`,
            this.styleClass
        ];
        if (this.colorMode) {
            styleClasses.push(`ecl-color-mode--${this.colorMode}`);
        }
        return styleClasses.join(' ');
    }
    componentWillLoad() {
        var _a;
        this.theme =
            (_a = document.documentElement.getAttribute('data-ecl-theme')) !== null && _a !== void 0 ? _a : (this.theme || 'ec');
    }
    componentDidLoad() {
        const tagElements = Array.from(this.el.querySelectorAll('ecl-tag'));
        tagElements.forEach((tag) => {
            const li = document.createElement('li');
            li.className = `ecl-tag-set__item sc-ecl-tag-${this.theme}`;
            li.appendChild(tag);
            this.listEl.appendChild(li);
        });
    }
    render() {
        return (h("ul", { key: '4e760bec5e90ca30234ba16496ac2317ac943c32', class: this.getClass(), ref: (el) => (this.listEl = el) }));
    }
    get el() { return getElement(this); }
};

export { EclTagSet as ecl_tag_set };
