import { h } from "@stencil/core";
export class BpSdkDeleteQuestionPoolItem {
    constructor() {
        this.text = undefined;
        this.handleRemoveItem = undefined;
        this.useExternal = false;
    }
    componentWillLoad() {
        this.useExternal = !!customElements.get('bp-sdk-external-delete-question-pool-item');
        customElements.whenDefined('bp-sdk-external-delete-question-pool-item').then(() => {
            this.useExternal = true;
        });
    }
    render() {
        return [this.useExternal && this.renderExternal(), !this.useExternal && this.renderInternal()];
    }
    renderExternal() {
        return h("bp-sdk-external-delete-question-pool-item", { text: this.text, handleRemoveItem: this.handleRemoveItem });
    }
    renderInternal() {
        return (h("div", { class: "bp-sdk-delete-question-pool-item__container" }, h("bp-sdk-delete-button", { onClick: this.handleRemoveItem }, this.text)));
    }
    static get is() { return "bp-sdk-delete-question-pool-item"; }
    static get originalStyleUrls() {
        return {
            "$": ["./bp-sdk-delete-question-pool-item.css"]
        };
    }
    static get styleUrls() {
        return {
            "$": ["bp-sdk-delete-question-pool-item.css"]
        };
    }
    static get properties() {
        return {
            "text": {
                "type": "string",
                "mutable": false,
                "complexType": {
                    "original": "string",
                    "resolved": "string",
                    "references": {}
                },
                "required": false,
                "optional": false,
                "docs": {
                    "tags": [],
                    "text": "Display text"
                },
                "attribute": "text",
                "reflect": false
            },
            "handleRemoveItem": {
                "type": "unknown",
                "mutable": false,
                "complexType": {
                    "original": "() => void",
                    "resolved": "() => void",
                    "references": {}
                },
                "required": false,
                "optional": false,
                "docs": {
                    "tags": [],
                    "text": "Function that handles button click, should remove item from pool"
                }
            }
        };
    }
    static get states() {
        return {
            "useExternal": {}
        };
    }
}
