'use strict';

Object.defineProperty(exports, '__esModule', { value: true });

const index = require('./index-ceff47a0.js');
const index_esm_min = require('./index.esm.min-2e158fd8.js');

const bpSdkVehicleQuestionSetButtonCss = "";
const BpSdkVehicleQuestionSetButtonStyle0 = bpSdkVehicleQuestionSetButtonCss;

const BpSdkVehicleQuestionSetButton = class {
    constructor(hostRef) {
        index.registerInstance(this, hostRef);
        this.text = '';
        this.buttonId = index_esm_min.e$(8);
        this.buttonDisabled = false;
        this.extraCssClasses = undefined;
        this.cssClasses = 'bp-sdk-vehicle-question-set-button__container';
        this.useExternal = false;
    }
    resetState() { }
    connectedCallback() {
        this.resetState();
    }
    componentWillLoad() {
        this.useExternal = !!customElements.get('bp-sdk-external-vehicle-question-set-button');
        customElements.whenDefined('bp-sdk-external-vehicle-question-set-button').then(() => {
            this.useExternal = true;
        });
        this.calculateButtonClasses(this.extraCssClasses);
    }
    calculateButtonClasses(extraClasses = '') {
        this.cssClasses = `bp-sdk-vehicle-question-set-button__container ${extraClasses}`;
    }
    render() {
        return [this.useExternal && this.renderExternal(), !this.useExternal && this.renderInternal()];
    }
    renderExternal() {
        return index.h("bp-sdk-external-vehicle-question-set-button", { text: this.text, buttonId: this.buttonId, buttonDisabled: this.buttonDisabled });
    }
    renderInternal() {
        return index.h("bp-sdk-button", { class: this.cssClasses, text: this.text, buttonId: this.buttonId, buttonDisabled: this.buttonDisabled });
    }
    static get watchers() { return {
        "extraCssClasses": ["calculateButtonClasses"]
    }; }
};
BpSdkVehicleQuestionSetButton.style = BpSdkVehicleQuestionSetButtonStyle0;

exports.bp_sdk_vehicle_question_set_button = BpSdkVehicleQuestionSetButton;
