import { h } from "@stencil/core";
export class EclVideo {
    constructor() {
        this.styleClass = '';
        this.controls = true;
        this.autoplay = false;
        this.loop = false;
        this.muted = false;
        this.zoom = false;
    }
    getClass() {
        const styleClasses = [
            `ecl-video`,
            this.styleClass
        ];
        if (this.zoom) {
            styleClasses.push('ecl-video--zoom');
        }
        return styleClasses.join(' ');
    }
    getAttr() {
        const attrs = {
            playsInline: true, // note: `playsinline` must be camelCase in JSX
        };
        if (this.muted)
            attrs.muted = true;
        if (this.loop)
            attrs.loop = true;
        if (this.autoplay)
            attrs.autoplay = true;
        if (this.controls)
            attrs.controls = true;
        if (this.poster) {
            attrs['poster'] = this.poster;
        }
        if (this.videoTitle && this.srVideoLabel) {
            attrs['aria-label'] = `${this.videoTitle} ${this.srVideoLabel}`;
        }
        else if (this.videoTitle && this.srVideoPlayer) {
            attrs['aria-label'] = `${this.videoTitle} ${this.srVideoPlayer}`;
        }
        return attrs;
    }
    componentWillLoad() {
        var _a;
        this.theme = (_a = document.documentElement.getAttribute('data-ecl-theme')) !== null && _a !== void 0 ? _a : (this.theme || 'ec');
    }
    render() {
        return (h("video", Object.assign({ key: '3404b5aa11142ac219018bff48a4e3ab9331f2dd', class: this.getClass() }, this.getAttr()), h("slot", { key: 'da3ff53de8cff0bb6bb448e6801025a2dc065a16' })));
    }
    ;
    static get is() { return "ecl-video"; }
    static get originalStyleUrls() {
        return {
            "ec": ["./build/styles/ecl-video-ec.css"],
            "eu": ["./build/styles/ecl-video-eu.css"]
        };
    }
    static get styleUrls() {
        return {
            "ec": ["build/styles/ecl-video-ec.css"],
            "eu": ["build/styles/ecl-video-eu.css"]
        };
    }
    static get properties() {
        return {
            "styleClass": {
                "type": "string",
                "mutable": false,
                "complexType": {
                    "original": "string",
                    "resolved": "string",
                    "references": {}
                },
                "required": false,
                "optional": false,
                "docs": {
                    "tags": [],
                    "text": ""
                },
                "getter": false,
                "setter": false,
                "reflect": false,
                "attribute": "style-class",
                "defaultValue": "''"
            },
            "theme": {
                "type": "string",
                "mutable": true,
                "complexType": {
                    "original": "string",
                    "resolved": "string",
                    "references": {}
                },
                "required": false,
                "optional": false,
                "docs": {
                    "tags": [],
                    "text": ""
                },
                "getter": false,
                "setter": false,
                "reflect": false,
                "attribute": "theme"
            },
            "videoTitle": {
                "type": "string",
                "mutable": false,
                "complexType": {
                    "original": "string",
                    "resolved": "string",
                    "references": {}
                },
                "required": false,
                "optional": false,
                "docs": {
                    "tags": [],
                    "text": ""
                },
                "getter": false,
                "setter": false,
                "reflect": false,
                "attribute": "video-title"
            },
            "srVideoPlayer": {
                "type": "string",
                "mutable": false,
                "complexType": {
                    "original": "string",
                    "resolved": "string",
                    "references": {}
                },
                "required": false,
                "optional": false,
                "docs": {
                    "tags": [],
                    "text": ""
                },
                "getter": false,
                "setter": false,
                "reflect": false,
                "attribute": "sr-video-player"
            },
            "srVideoLabel": {
                "type": "string",
                "mutable": false,
                "complexType": {
                    "original": "string",
                    "resolved": "string",
                    "references": {}
                },
                "required": false,
                "optional": false,
                "docs": {
                    "tags": [],
                    "text": ""
                },
                "getter": false,
                "setter": false,
                "reflect": false,
                "attribute": "sr-video-label"
            },
            "poster": {
                "type": "string",
                "mutable": false,
                "complexType": {
                    "original": "string",
                    "resolved": "string",
                    "references": {}
                },
                "required": false,
                "optional": false,
                "docs": {
                    "tags": [],
                    "text": ""
                },
                "getter": false,
                "setter": false,
                "reflect": false,
                "attribute": "poster"
            },
            "controls": {
                "type": "boolean",
                "mutable": false,
                "complexType": {
                    "original": "boolean",
                    "resolved": "boolean",
                    "references": {}
                },
                "required": false,
                "optional": false,
                "docs": {
                    "tags": [],
                    "text": ""
                },
                "getter": false,
                "setter": false,
                "reflect": false,
                "attribute": "controls",
                "defaultValue": "true"
            },
            "autoplay": {
                "type": "boolean",
                "mutable": false,
                "complexType": {
                    "original": "boolean",
                    "resolved": "boolean",
                    "references": {}
                },
                "required": false,
                "optional": false,
                "docs": {
                    "tags": [],
                    "text": ""
                },
                "getter": false,
                "setter": false,
                "reflect": false,
                "attribute": "autoplay",
                "defaultValue": "false"
            },
            "loop": {
                "type": "boolean",
                "mutable": false,
                "complexType": {
                    "original": "boolean",
                    "resolved": "boolean",
                    "references": {}
                },
                "required": false,
                "optional": false,
                "docs": {
                    "tags": [],
                    "text": ""
                },
                "getter": false,
                "setter": false,
                "reflect": false,
                "attribute": "loop",
                "defaultValue": "false"
            },
            "muted": {
                "type": "boolean",
                "mutable": false,
                "complexType": {
                    "original": "boolean",
                    "resolved": "boolean",
                    "references": {}
                },
                "required": false,
                "optional": false,
                "docs": {
                    "tags": [],
                    "text": ""
                },
                "getter": false,
                "setter": false,
                "reflect": false,
                "attribute": "muted",
                "defaultValue": "false"
            },
            "zoom": {
                "type": "boolean",
                "mutable": false,
                "complexType": {
                    "original": "boolean",
                    "resolved": "boolean",
                    "references": {}
                },
                "required": false,
                "optional": false,
                "docs": {
                    "tags": [],
                    "text": ""
                },
                "getter": false,
                "setter": false,
                "reflect": false,
                "attribute": "zoom",
                "defaultValue": "false"
            }
        };
    }
}
