import { r as registerInstance, h } from './core-095fd691.js';
import { R as ResolveLocation } from './resolve-location-6b3481e9.js';

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

export { BceElementAudio as bce_element_audio };
