'use strict';

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

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

const BceElementAudio = 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() {
        if (!this.template)
            return null;
        return (core.h("audio", { key: this.url, autoplay: this.template.autoplay, controls: true }, core.h("source", { src: this.url })));
    }
    static get style() { return "bce-element-audio{display:block;margin:1rem 0}"; }
};

exports.bce_element_audio = BceElementAudio;
