'use strict';

var index = require('./index-Bkm7eeWO.js');

const eclVideoEcCss = () => `.ecl-video--zoom{transition:transform .5s}.ecl-video--zoom:hover{transform:scale(1.1)}`;

const eclVideoEuCss = () => `.ecl-video--zoom{transition:transform .5s}.ecl-video--zoom:hover{transform:scale(1.1)}`;

const EclVideo = class {
    constructor(hostRef) {
        index.registerInstance(this, hostRef);
        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 (index.h("video", Object.assign({ key: '3404b5aa11142ac219018bff48a4e3ab9331f2dd', class: this.getClass() }, this.getAttr()), index.h("slot", { key: 'da3ff53de8cff0bb6bb448e6801025a2dc065a16' })));
    }
    ;
};
EclVideo.style = {
    ec: eclVideoEcCss(),
    eu: eclVideoEuCss()
};

exports.ecl_video = EclVideo;
