'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 bpSdkVehicleVinInputCss = "";
const BpSdkVehicleVinInputStyle0 = bpSdkVehicleVinInputCss;

const BpSdkVehicleVinInput = class {
    constructor(hostRef) {
        index.registerInstance(this, hostRef);
        this.code = undefined;
        this.label = undefined;
        this.pristine = true;
        this.touched = false;
        this.errors = [];
        this.value = undefined;
        this.labelId = index_esm_min.e$(8);
        this.useExternal = false;
    }
    resetState() { }
    connectedCallback() {
        this.resetState();
    }
    componentWillLoad() {
        this.useExternal = !!customElements.get('bp-sdk-external-vehicle-vin-input');
        customElements.whenDefined('bp-sdk-external-vehicle-vin-input').then(() => {
            this.useExternal = true;
        });
    }
    render() {
        return [this.useExternal && this.renderExternal(), !this.useExternal && this.renderInternal()];
    }
    renderExternal() {
        return (index.h("bp-sdk-external-vehicle-vin-input", { code: this.code, errors: this.errors, label: this.label, pristine: this.pristine, touched: this.touched }));
    }
    renderInternal() {
        return (index.h("div", { class: "bp-sdk-vehicle-vin-input__container" }, index.h("bp-sdk-text-input", { code: this.code, errors: this.errors, fieldType: 'text', label: this.label, labelId: this.labelId, placeholder: "Vin", pristine: this.pristine, questionId: this.labelId, touched: this.touched, text: this.value })));
    }
};
BpSdkVehicleVinInput.style = BpSdkVehicleVinInputStyle0;

exports.bp_sdk_vehicle_vin_input = BpSdkVehicleVinInput;
