import { h } from "@stencil/core";
export class BpSdkSpinner {
    constructor() {
        this.useExternal = false;
    }
    resetState() { }
    connectedCallback() {
        this.resetState();
    }
    componentWillLoad() {
        this.useExternal = !!customElements.get('bp-sdk-external-spinner');
        customElements.whenDefined('bp-sdk-external-spinner').then(() => {
            this.useExternal = true;
        });
    }
    render() {
        return [this.useExternal && this.renderExternal(), !this.useExternal && this.renderInternal()];
    }
    renderExternal() {
        return h("bp-sdk-external-spinner", null);
    }
    renderInternal() {
        return (h("div", { class: "bp-sdk-spinner__container" }, h("bp-sdk-icon-container", { name: "spinner", cssClasses: "fa-spin" })));
    }
    static get is() { return "bp-sdk-spinner"; }
    static get originalStyleUrls() {
        return {
            "$": ["./bp-sdk-spinner.css"]
        };
    }
    static get styleUrls() {
        return {
            "$": ["bp-sdk-spinner.css"]
        };
    }
    static get states() {
        return {
            "useExternal": {}
        };
    }
}
