import { h } from "@stencil/core";
export class BpSdkQuoteRequestTaxesAndFeesContainer {
    constructor() {
        this.quoteInfo = undefined;
        this.useExternal = false;
        this.disclaimerHtml = undefined;
        this.fees = [];
        this.taxes = [];
    }
    resetState() { }
    componentWillLoad() {
        this.useExternal = !!customElements.get('bp-sdk-external-quote-request-taxes-and-fees-container');
        customElements.whenDefined('bp-sdk-external-quote-request-taxes-and-fees-container').then(() => {
            this.useExternal = true;
        });
        this.onQuoteInfoChange(this.quoteInfo);
    }
    onQuoteInfoChange(quoteInfo) {
        var _a, _b, _c, _d, _e;
        this.disclaimerHtml = (_a = quoteInfo === null || quoteInfo === void 0 ? void 0 : quoteInfo.price_details) === null || _a === void 0 ? void 0 : _a.disclaimer_html;
        this.taxes = (_c = (_b = quoteInfo === null || quoteInfo === void 0 ? void 0 : quoteInfo.price_details) === null || _b === void 0 ? void 0 : _b.taxes) !== null && _c !== void 0 ? _c : [];
        this.fees = (_e = (_d = quoteInfo === null || quoteInfo === void 0 ? void 0 : quoteInfo.price_details) === null || _d === void 0 ? void 0 : _d.fees) !== null && _e !== void 0 ? _e : [];
    }
    render() {
        return [this.useExternal && this.renderExternal(), !this.useExternal && this.renderInternal()];
    }
    renderExternal() {
        return h("bp-sdk-external-quote-request-taxes-and-fees-container", { quoteInfo: this.quoteInfo });
    }
    renderInternal() {
        return h("bp-sdk-quote-request-taxes-and-fees", { disclaimerHtml: this.disclaimerHtml, fees: this.fees, taxes: this.taxes });
    }
    static get is() { return "bp-sdk-quote-request-taxes-and-fees-container"; }
    static get originalStyleUrls() {
        return {
            "$": ["./bp-sdk-quote-request-taxes-and-fees-container.css"]
        };
    }
    static get styleUrls() {
        return {
            "$": ["bp-sdk-quote-request-taxes-and-fees-container.css"]
        };
    }
    static get properties() {
        return {
            "quoteInfo": {
                "type": "unknown",
                "mutable": false,
                "complexType": {
                    "original": "IQuoteInfo",
                    "resolved": "IQuoteInfo",
                    "references": {
                        "IQuoteInfo": {
                            "location": "import",
                            "path": "@boldpenguin/sdk-types",
                            "id": "../sdk-types/dist/types.d.ts::IQuoteInfo"
                        }
                    }
                },
                "required": false,
                "optional": false,
                "docs": {
                    "tags": [],
                    "text": "Quote information"
                }
            }
        };
    }
    static get states() {
        return {
            "useExternal": {},
            "disclaimerHtml": {},
            "fees": {},
            "taxes": {}
        };
    }
    static get watchers() {
        return [{
                "propName": "quoteInfo",
                "methodName": "onQuoteInfoChange"
            }];
    }
}
