import { proxyCustomElement, HTMLElement, createEvent, h, Host } from '@stencil/core/internal/client';
import { F as FormControlErrorText } from './form-control-error-text.js';
import { d as defineCustomElement$2 } from './custom-popper2.js';
import { d as defineCustomElement$1 } from './form-control-tooltip2.js';

const FormControlFileV2 = /*@__PURE__*/ proxyCustomElement(class FormControlFileV2 extends HTMLElement {
    constructor(registerHost) {
        super();
        if (registerHost !== false) {
            this.__registerHost();
        }
        this.formControlInput = createEvent(this, "formControlInput", 7);
        this.formControlBlur = createEvent(this, "formControlBlur", 7);
        this.errorText = '';
        this.inputHandler = () => { };
        this.disabled = false;
    }
    render() {
        return (h(Host, { key: '52fee4080e9475313f4043c1a1e116d07881fd72', exportparts: "label,input,input-invalid" }, h("div", { key: 'efe6ee7fae0693fad8086e7849fdc03a01525368', class: "form-group d-flex flex-column" }, h("div", { key: 'dd224535e329aa82cc86be2f32f40b4a8904e1bc', class: "d-flex align-items-start gap-2" }, h("label", { key: '6cee04c50d6eaba123d00ee5ffdad036e46bbf7d', part: "label", class: "form-label", htmlFor: this.name }, this.label), h("form-control-tooltip", { key: '30e545c71fa6a5e4eac985ea6073dc5b2ab78629', helpText: this.helpText })), h("input", { key: '3ba7425da1d80314acdd0050c90aa8a795473584', type: "file", name: this.name, part: `input ${this.errorText ? "input-invalid " : ""}${this.disabled ? "input-disabled" : ""}`, class: this.errorText ? "form-control is-invalid" : "form-control", multiple: this.multiple, disabled: this.disabled, onBlur: () => this.formControlBlur.emit(), onChange: () => this.errorText = "" }), h(FormControlErrorText, { key: '9ad4526e2937d98d555b325e60d20dc7305ee786', errorText: this.errorText, name: this.name }))));
    }
    get el() { return this; }
}, [256, "form-control-file-v2", {
        "label": [1],
        "name": [8],
        "helpText": [1, "help-text"],
        "errorText": [1, "error-text"],
        "multiple": [4],
        "inputHandler": [16],
        "disabled": [4],
        "files": [32]
    }]);
function defineCustomElement() {
    if (typeof customElements === "undefined") {
        return;
    }
    const components = ["form-control-file-v2", "custom-popper", "form-control-tooltip"];
    components.forEach(tagName => { switch (tagName) {
        case "form-control-file-v2":
            if (!customElements.get(tagName)) {
                customElements.define(tagName, FormControlFileV2);
            }
            break;
        case "custom-popper":
            if (!customElements.get(tagName)) {
                defineCustomElement$2();
            }
            break;
        case "form-control-tooltip":
            if (!customElements.get(tagName)) {
                defineCustomElement$1();
            }
            break;
    } });
}
defineCustomElement();

export { FormControlFileV2 as F, defineCustomElement as d };
