import { r as registerInstance, h } from './index-77a9c9e7.js';

const BpSdkChip = class {
    constructor(hostRef) {
        registerInstance(this, hostRef);
        this.type = undefined;
        this.text = undefined;
        this.useExternal = false;
    }
    resetState() { }
    connectedCallback() {
        this.resetState();
    }
    componentWillLoad() {
        this.useExternal = !!customElements.get('bp-sdk-external-chip');
        customElements.whenDefined('bp-sdk-external-chip').then(() => {
            this.useExternal = true;
        });
    }
    render() {
        return [this.useExternal && this.renderExternal(), !this.useExternal && this.renderInternal()];
    }
    renderExternal() {
        return h("bp-sdk-external-chip", { type: this.type, text: this.text });
    }
    renderInternal() {
        return [
            h("bp-sdk-chip-before", { text: this.text }),
            h("span", { class: `bp-sdk-chip bp-sdk-chip__${this.type}`, innerHTML: this.text }),
            h("bp-sdk-chip-after", { text: this.text }),
        ];
    }
};

export { BpSdkChip as bp_sdk_chip };
