'use strict';

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

const core = require('./core-0f211bec.js');
const resolveLocation = require('./resolve-location-afb71019.js');

const BceElementImage = class {
    constructor(hostRef) {
        core.registerInstance(this, hostRef);
        this.resolveLocation = resolveLocation.ResolveLocation.NOOP;
        this.url = '';
    }
    componentWillLoad() {
        if (!this.template)
            return;
        if (this.template.location.startsWith('BCE://'))
            this.resolveLocation(this.template.location).then(url => (this.url = url));
        else
            this.url = this.template.location;
    }
    render() {
        return this.template && this.url && core.h("img", { src: this.url });
    }
    static get style() { return "bce-element-image{display:block;max-width:1200px;text-align:center}bce-element-image img{margin:1rem 0;width:100%;max-height:32rem}\@media screen and (min-width:1024px){bce-element-image{text-align:left;width:auto}}"; }
};

exports.bce_element_image = BceElementImage;
