import { h } from "@stencil/core";
export class EclSocialMediaShare {
    constructor() {
        this.theme = 'ec';
        this.styleClass = undefined;
        this.variant = 'horizontal';
        this.description = undefined;
    }
    getClass() {
        return [
            `ecl-social-media-share`,
            `ecl-social-media-share--${this.variant}`,
            this.styleClass
        ].join(' ');
    }
    componentDidRender() {
        if (this.el.querySelector('.ecl-social-media-share__list')) {
            const list = this.el.querySelector('.ecl-social-media-share__list');
            const popover = this.el.getElementsByTagName('ecl-popover')[0] || false;
            if (popover) {
                const li = document.createElement('li');
                li.classList.add('ecl-social-media-share__item', `sc-ecl-social-media-share-${this.theme}`);
                popover.parentNode.insertBefore(li, popover);
                li.appendChild(popover);
                li.querySelector('.ecl-popover__toggle').classList.add(`ecl-social-media-share__link`, `sc-ecl-social-media-share-${this.theme}`);
            }
            const items = this.el.querySelectorAll('.ecl-social-media-share__item');
            list.innerHTML = '';
            list.append(...items);
        }
    }
    render() {
        return (h("div", { class: this.getClass() }, this.description ?
            h("p", { class: "ecl-social-media-share__description" }, this.description) : '', h("ul", { class: "ecl-social-media-share__list" }, h("slot", null))));
    }
    static get is() { return "ecl-social-media-share"; }
    static get encapsulation() { return "scoped"; }
    static get originalStyleUrls() {
        return {
            "ec": ["./build/styles/ecl-social-media-share-ec.css"],
            "eu": ["./build/styles/ecl-social-media-share-eu.css"]
        };
    }
    static get styleUrls() {
        return {
            "ec": ["build/styles/ecl-social-media-share-ec.css"],
            "eu": ["build/styles/ecl-social-media-share-eu.css"]
        };
    }
    static get properties() {
        return {
            "theme": {
                "type": "string",
                "mutable": false,
                "complexType": {
                    "original": "string",
                    "resolved": "string",
                    "references": {}
                },
                "required": false,
                "optional": false,
                "docs": {
                    "tags": [],
                    "text": ""
                },
                "attribute": "theme",
                "reflect": false,
                "defaultValue": "'ec'"
            },
            "styleClass": {
                "type": "string",
                "mutable": false,
                "complexType": {
                    "original": "string",
                    "resolved": "string",
                    "references": {}
                },
                "required": false,
                "optional": false,
                "docs": {
                    "tags": [],
                    "text": ""
                },
                "attribute": "style-class",
                "reflect": false
            },
            "variant": {
                "type": "string",
                "mutable": false,
                "complexType": {
                    "original": "string",
                    "resolved": "string",
                    "references": {}
                },
                "required": false,
                "optional": false,
                "docs": {
                    "tags": [],
                    "text": ""
                },
                "attribute": "variant",
                "reflect": false,
                "defaultValue": "'horizontal'"
            },
            "description": {
                "type": "string",
                "mutable": false,
                "complexType": {
                    "original": "string",
                    "resolved": "string",
                    "references": {}
                },
                "required": false,
                "optional": false,
                "docs": {
                    "tags": [],
                    "text": ""
                },
                "attribute": "description",
                "reflect": false
            }
        };
    }
    static get elementRef() { return "el"; }
}
//# sourceMappingURL=ecl-social-media-share.js.map
