import { h } from "@stencil/core";
import { generateId } from "@boldpenguin/sdk-utility";
export class BpSdkQuoteRequestPrice {
    constructor() {
        this.description = undefined;
        this.price = undefined;
        this.descriptionId = generateId(8);
        this.useExternal = false;
    }
    resetState() { }
    componentWillLoad() {
        this.useExternal = !!customElements.get('bp-sdk-external-quote-request-price');
        customElements.whenDefined('bp-sdk-external-quote-request-price').then(() => {
            this.useExternal = true;
        });
    }
    render() {
        return [this.useExternal && this.renderExternal(), !this.useExternal && this.renderInternal()];
    }
    renderExternal() {
        return h("bp-sdk-external-quote-request-price", { description: this.description, price: this.price });
    }
    renderInternal() {
        return (h("div", { class: "bp-sdk-quote-request-price__container" }, h("span", { class: "bp-sdk-quote-request-price__description", id: this.descriptionId }, this.description), h("span", { class: "bp-sdk-quote-request-price__separator" }, ":"), h("span", { class: "bp-sdk-quote-request-price__amount", "aria-labelledby": this.descriptionId }, this.price)));
    }
    static get is() { return "bp-sdk-quote-request-price"; }
    static get originalStyleUrls() {
        return {
            "$": ["./bp-sdk-quote-request-price.css"]
        };
    }
    static get styleUrls() {
        return {
            "$": ["bp-sdk-quote-request-price.css"]
        };
    }
    static get properties() {
        return {
            "description": {
                "type": "string",
                "mutable": false,
                "complexType": {
                    "original": "string",
                    "resolved": "string",
                    "references": {}
                },
                "required": false,
                "optional": false,
                "docs": {
                    "tags": [],
                    "text": "Description"
                },
                "attribute": "description",
                "reflect": false
            },
            "price": {
                "type": "string",
                "mutable": false,
                "complexType": {
                    "original": "string",
                    "resolved": "string",
                    "references": {}
                },
                "required": false,
                "optional": false,
                "docs": {
                    "tags": [],
                    "text": "Price"
                },
                "attribute": "price",
                "reflect": false
            }
        };
    }
    static get states() {
        return {
            "descriptionId": {},
            "useExternal": {}
        };
    }
}
