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