import { r as registerInstance, h } from './index-77a9c9e7.js';
import { e as e$ } from './index.esm.min-cd800f97.js';

const bpSdkButtonCss = ".bp-sdk-button{--bp-sdk-button-color:var(--theme-color);color:var(--bp-sdk-button-color)}.bp-sdk-button__text{pointer-events:none}";
const BpSdkButtonStyle0 = bpSdkButtonCss;

const BpSdkButton = class {
    constructor(hostRef) {
        registerInstance(this, hostRef);
        this.text = undefined;
        this.buttonId = e$(8);
        this.buttonDisabled = false;
        this.useExternal = false;
    }
    resetState() { }
    connectedCallback() {
        this.resetState();
    }
    componentWillLoad() {
        this.useExternal = !!customElements.get('bp-sdk-external-button');
        customElements.whenDefined('bp-sdk-external-button').then(() => {
            this.useExternal = true;
        });
    }
    render() {
        return [this.useExternal && this.renderExternal(), !this.useExternal && this.renderInternal()];
    }
    renderExternal() {
        return (h("bp-sdk-external-button", { buttonId: this.buttonId, text: this.text, buttonDisabled: this.buttonDisabled }, h("slot", null)));
    }
    renderInternal() {
        return (h("button", { type: "button", class: "bp-sdk-button", id: this.buttonId, disabled: this.buttonDisabled }, h("slot", null), h("span", { class: "bp-sdk-button__text" }, this.text)));
    }
};
BpSdkButton.style = BpSdkButtonStyle0;

export { BpSdkButton as bp_sdk_button };
