import { h } from "@stencil/core";
export class BpSdkProgress {
    constructor() {
        this.label = undefined;
        this.value = undefined;
        this.useExternal = false;
    }
    resetState() { }
    connectedCallback() {
        this.resetState();
    }
    componentWillLoad() {
        this.useExternal = !!customElements.get('bp-sdk-external-progress');
        customElements.whenDefined('bp-sdk-external-progress').then(() => {
            this.useExternal = true;
        });
    }
    render() {
        return [this.useExternal && this.renderExternal(), !this.useExternal && this.renderInternal()];
    }
    renderExternal() {
        return h("bp-sdk-external-progress", { label: this.label, value: this.value });
    }
    renderInternal() {
        return (h("div", { class: "bp-sdk-progress__container" }, h("progress", { class: "bp-sdk-progress__bar", value: this.value, "aria-label": this.label })));
    }
    static get is() { return "bp-sdk-progress"; }
    static get originalStyleUrls() {
        return {
            "$": ["./bp-sdk-progress.css"]
        };
    }
    static get styleUrls() {
        return {
            "$": ["bp-sdk-progress.css"]
        };
    }
    static get properties() {
        return {
            "label": {
                "type": "string",
                "mutable": false,
                "complexType": {
                    "original": "string",
                    "resolved": "string",
                    "references": {}
                },
                "required": false,
                "optional": false,
                "docs": {
                    "tags": [],
                    "text": "Progress description for screen readers"
                },
                "attribute": "label",
                "reflect": false
            },
            "value": {
                "type": "number",
                "mutable": false,
                "complexType": {
                    "original": "number",
                    "resolved": "number",
                    "references": {}
                },
                "required": false,
                "optional": false,
                "docs": {
                    "tags": [],
                    "text": "Progress value"
                },
                "attribute": "value",
                "reflect": false
            }
        };
    }
    static get states() {
        return {
            "useExternal": {}
        };
    }
}
