import { h } from "@stencil/core";
import { formatFileSize } from "../../utils/utils";
export class SpwFileUpload {
    constructor() {
        /** Indique si le champ est désactivé, rendant le téléversement de fichiers non disponible */
        this.disabled = false;
        /** Indique s'il y a une erreur visuelle associée au composant de téléversement de fichiers */
        this.error = false;
        /** Valeur actuelle sélectionnée, utilisée pour les formulaires */
        this.value = [];
        /** Active ou désactive la zone de dépôt pour le glisser-déposer de fichiers */
        this.enableDropZone = false;
        /** Permet de téléverser plusieurs fichiers si vrai */
        this.multiple = false;
        /** Types de fichiers acceptés, spécifiés sous forme de chaîne de types MIME ou extensions (whitelist) */
        this.accept = '';
        /** Types de fichiers refusés, spécifiés sous forme de chaîne de types MIME ou extensions (blacklist) */
        this.refuse = '';
        /** Taille maximale autorisée pour chaque fichier, en Mo */
        this.maxFileSize = 100;
        /** Unité de mesure pour maxFileSize ('mo' ou 'go') */
        this.maxFileSizeUnit = 'mo';
        /** Nombre maximal de fichiers pouvant être téléversés */
        this.maxFiles = Infinity;
        // Textes customisables
        /** Texte du bouton pour sélectionner un fichier (mode simple) */
        this.textChooseFile = 'Choisir votre fichier...';
        /** Texte du bouton pour sélectionner plusieurs fichiers (mode multiple) */
        this.textChooseFiles = 'Choisir vos fichiers...';
        /** Texte de la zone de dépôt pour un fichier */
        this.textDropFile = 'Déposez votre fichier ici ou';
        /** Texte de la zone de dépôt pour plusieurs fichiers */
        this.textDropFiles = 'Déposez vos fichiers ici ou';
        /** Texte du lien pour choisir depuis l'ordinateur */
        this.textChooseFromComputer = 'choisissez sur votre ordinateur...';
        /** Texte du lien de suppression */
        this.textDelete = 'Supprimer';
        /** Texte pour la taille maximale par fichier (utiliser {size} et {unit} comme placeholders) */
        this.textMaxFileSize = 'Taille maximale par fichier : {size} {unit}';
        /** Texte pour le nombre maximum de fichiers (utiliser {count} comme placeholder) */
        this.textMaxFiles = '{count} fichier(s) maximum';
        /** Texte pour les formats autorisés (utiliser {formats} comme placeholder) */
        this.textAcceptedFormats = 'Formats autorisés : {formats}.';
        /** Texte pour les formats refusés (utiliser {formats} comme placeholder) */
        this.textRefusedFormats = 'Formats refusés : {formats}.';
        /** Texte quand tous les formats sont autorisés */
        this.textAllFormats = 'Formats autorisés : tous les formats.';
        /** Message d'erreur quand le format n'est pas autorisé (utiliser {filename} comme placeholder) */
        this.textErrorFormat = "{filename} n'a pas été pris en compte car le format n'est pas autorisé.";
        /** Message d'erreur quand la taille est dépassée (utiliser {filename} comme placeholder) */
        this.textErrorSize = "{filename} n'a pas été pris en compte car il dépasse la taille maximale autorisée.";
        /** Message d'erreur quand le format et la taille sont invalides (utiliser {filename} comme placeholder) */
        this.textErrorFormatAndSize = "{filename} n'a pas été pris en compte car le format n'est pas autorisé et la limite de poids est dépassée.";
        /** Message quand la limite de fichiers est atteinte */
        this.textLimitReached = 'Vous avez atteint la limite autorisée de fichiers.';
        /** Message quand on dépasse la limite de fichiers (utiliser {count} comme placeholder) */
        this.textLimitExceeded = 'Vous ne pouvez pas télécharger plus de {count} fichier(s).';
        this.selectedFiles = [];
        this.fileTypeErrors = [];
        this.fileLimitErrors = [];
        this.isDragging = false;
        this.isMaxFilesReachedExact = false;
    }
    watchValueHandler(newValue) {
        if (newValue && newValue.length > 0) {
            this.selectedFiles = [...newValue];
        }
        else if (newValue && newValue.length === 0) {
            this.selectedFiles = [];
        }
    }
    componentWillLoad() {
        if (this.value && this.value.length > 0) {
            this.selectedFiles = [...this.value];
        }
        if (this.maxFileSizeUnit === 'go') {
            this.maxFileSize = this.maxFileSize * 1024 * 1024 * 1024;
        }
        else {
            this.maxFileSize = this.maxFileSize * 1024 * 1024;
        }
        if (this.accept && this.refuse) {
            console.warn('spw-file-upload: Vous ne pouvez pas utiliser "accept" et "refuse" en même temps. Seul "accept" sera pris en compte.');
        }
    }
    get isMaxFilesReached() {
        return this.selectedFiles.length >= this.maxFiles;
    }
    handleFileChange(event) {
        const input = event.target;
        const files = input.files ? Array.from(input.files) : [];
        this.processFiles(files);
        input.value = '';
    }
    processFiles(files) {
        this.fileTypeErrors = [];
        this.fileLimitErrors = [];
        this.isMaxFilesReachedExact = false;
        if (!this.multiple) {
            this.selectedFiles = [];
            files = files.slice(0, 1);
        }
        const validFiles = files.filter(file => {
            const isFileAccepted = this.isFileAccepted(file);
            const isFileSizeValid = this.isFileSizeValid(file);
            if (!isFileAccepted && !isFileSizeValid) {
                this.fileTypeErrors.push(this.textErrorFormatAndSize.replace('{filename}', file.name));
                return false;
            }
            else if (!isFileAccepted) {
                this.fileTypeErrors.push(this.textErrorFormat.replace('{filename}', file.name));
                return false;
            }
            else if (!isFileSizeValid) {
                this.fileTypeErrors.push(this.textErrorSize.replace('{filename}', file.name));
                return false;
            }
            return true;
        });
        if (this.selectedFiles.length + validFiles.length >= this.maxFiles) {
            const allowedFiles = this.maxFiles - this.selectedFiles.length;
            if (this.selectedFiles.length + validFiles.length === this.maxFiles) {
                this.isMaxFilesReachedExact = true;
                this.fileLimitErrors.push(this.textLimitReached);
            }
            else {
                validFiles.splice(allowedFiles);
                this.fileLimitErrors.push(this.textLimitExceeded.replace('{count}', String(this.maxFiles)));
            }
        }
        this.selectedFiles = [...this.selectedFiles, ...validFiles];
        this.spwFileChange.emit({ files: this.selectedFiles });
        this.updateFormValue();
    }
    isFileAccepted(file) {
        if (this.accept && this.refuse) {
            const acceptedTypes = this.accept.split(',').map(type => type.trim());
            return acceptedTypes.includes(file.type) || acceptedTypes.some(type => file.name.endsWith(type));
        }
        if (this.accept) {
            const acceptedTypes = this.accept.split(',').map(type => type.trim());
            return acceptedTypes.includes(file.type) || acceptedTypes.some(type => file.name.endsWith(type));
        }
        if (this.refuse) {
            const refusedTypes = this.refuse.split(',').map(type => type.trim());
            const isRefused = refusedTypes.includes(file.type) || refusedTypes.some(type => file.name.endsWith(type));
            return !isRefused;
        }
        return true;
    }
    isFileSizeValid(file) {
        return file.size <= this.maxFileSize;
    }
    updateFormValue() {
        if (this.selectedFiles.length > 0) {
            const formData = new FormData();
            this.selectedFiles.forEach((file, index) => {
                formData.append(`${this.name}[${index}]`, file);
            });
            this.internals.setFormValue(formData);
        }
        else {
            this.internals.setFormValue(null);
        }
    }
    /** Réinitialise le champ de téléchargement de fichiers */
    async resetInput() {
        this.inputElement.value = '';
        this.selectedFiles = [];
        this.fileLimitErrors = [];
        this.fileTypeErrors = [];
        this.updateFormValue();
    }
    formResetCallback() {
        this.resetInput();
    }
    handleDragOver(event) {
        event.preventDefault();
        if (!this.disabled && this.enableDropZone && !this.isMaxFilesReached) {
            this.isDragging = true;
        }
    }
    handleDragLeave() {
        if (!this.disabled && this.enableDropZone) {
            this.isDragging = false;
        }
    }
    handleDrop(event) {
        var _a;
        event.preventDefault();
        if (!this.disabled && this.enableDropZone && !this.isMaxFilesReached) {
            this.isDragging = false;
            const files = ((_a = event.dataTransfer) === null || _a === void 0 ? void 0 : _a.files) ? Array.from(event.dataTransfer.files) : [];
            this.processFiles(files);
        }
    }
    removeFile(index) {
        this.selectedFiles = this.selectedFiles.filter((_, i) => i !== index);
        this.fileLimitErrors = [];
        this.updateFormValue();
        this.spwFileChange.emit({ files: this.selectedFiles });
    }
    handleKeydown(event) {
        if ((event.key === ' ' || event.key === 'Enter') && !this.isMaxFilesReached) {
            event.preventDefault();
            !this.disabled && this.inputElement.click();
        }
    }
    get elementClass() {
        return {
            'spw-file-upload__wrapper': true,
            'spw-file-upload__wrapper--disabled': this.disabled || this.isMaxFilesReached,
            'spw-file-upload__wrapper--error': this.error,
            'spw-file-upload--has-dropzone': this.enableDropZone,
            'spw-file-upload--is-dragging': this.isDragging,
        };
    }
    get hintsMessages() {
        let maxSizeDisplay;
        let unitDisplay;
        if (this.maxFileSizeUnit === 'go') {
            maxSizeDisplay = this.maxFileSize / (1024 * 1024 * 1024);
            unitDisplay = 'Go';
        }
        else {
            maxSizeDisplay = this.maxFileSize / (1024 * 1024);
            unitDisplay = 'Mo';
        }
        const messages = [];
        let message = this.textMaxFileSize.replace('{size}', String(maxSizeDisplay)).replace('{unit}', unitDisplay);
        if (this.multiple && this.maxFiles !== Infinity) {
            message += ` - ${this.textMaxFiles.replace('{count}', String(this.maxFiles))}`;
        }
        else {
            message += '.';
        }
        messages.push(message);
        if (this.accept && this.refuse) {
            messages.push(this.textAcceptedFormats.replace('{formats}', this.accept));
        }
        else if (this.accept) {
            messages.push(this.textAcceptedFormats.replace('{formats}', this.accept));
        }
        else if (this.refuse) {
            messages.push(this.textRefusedFormats.replace('{formats}', this.refuse));
        }
        else {
            messages.push(this.textAllFormats);
        }
        return messages;
    }
    render() {
        const inputTextNoDrop = this.multiple ? this.textChooseFiles : this.textChooseFile;
        const inputTextDrop = this.multiple ? this.textDropFiles : this.textDropFile;
        return (h("div", { key: '095815bbee9c872183a2341238301ac432ce869d', class: this.elementClass, onDragOver: this.handleDragOver.bind(this), onDragLeave: this.handleDragLeave.bind(this), onDrop: this.handleDrop.bind(this) }, h("input", { key: '726cfe005146924eaf46928a526d82e82ddab1c3', type: "file", ref: el => (this.inputElement = el), onChange: this.handleFileChange.bind(this), name: this.name, multiple: this.multiple, accept: this.accept, style: { display: 'none' }, disabled: this.isMaxFilesReached }), this.enableDropZone ? (h("div", { tabindex: this.disabled || this.isMaxFilesReached ? -1 : 0, onKeyDown: this.handleKeydown.bind(this), onClick: () => !this.disabled && !this.isMaxFilesReached && this.inputElement.click(), class: "spw-file-upload__dropzone" }, inputTextDrop, " ", h("span", { class: "spw-file-upload__dropzone-link" }, this.textChooseFromComputer))) : (h("spw-button", { variant: "secondary", onClick: () => !this.disabled && !this.isMaxFilesReached && this.inputElement.click(), disabled: this.disabled || this.isMaxFilesReached }, inputTextNoDrop)), h("div", { key: 'a6a12a7dc2df2f202897002c1f1feab51557700f', class: "spw-file-upload__hints" }, this.hintsMessages.length > 0 && (h("ul", { key: '1d9643b6214b0d4b312a16f4a91ee063b96de380' }, this.hintsMessages.map((message, index) => (h("li", { key: index }, message)))))), h("div", { key: 'e98776cde22505ae8d1ffe0016ed205544031c9b', class: "spw-file-upload__info" }, this.selectedFiles.length > 0 ? (h("ul", { class: "spw-file-upload__info-list" }, this.selectedFiles.map((file, index) => (h("li", { key: index }, h("span", { class: "spw-file-upload__info-list-name" }, file.name), h("div", { class: "spw-file-upload__info-list-actions" }, h("span", { class: "spw-file-upload__spacing" }, formatFileSize(file.size)), h("a", { class: "spw-file-upload__info-list-delete", href: "#", onClick: e => {
                e.preventDefault();
                this.removeFile(index);
            } }, this.textDelete))))))) : (''), this.fileLimitErrors.length > 0 && (h("ul", { key: '87d3841b82f412458d986ec97a6d6636a1f038d1', class: `spw-file-upload__errors ${this.isMaxFilesReachedExact ? 'spw-file-upload__errors--warning' : ''}` }, this.fileLimitErrors.map((message, index) => (h("li", { key: index }, h("spw-icon", { class: "spw-file-upload__spacing", icon: this.isMaxFilesReachedExact ? 'fa-circle-exclamation' : 'fa-warning' }), message))))), this.fileTypeErrors.length > 0 && (h("ul", { key: '5878e2f09ff3249386fe3d3d68a4ac79b2f05868', class: "spw-file-upload__errors" }, this.fileTypeErrors.map((message, index) => (h("li", { key: index }, h("spw-icon", { class: "spw-file-upload__spacing", icon: "fa-warning" }), message))))))));
    }
    static get is() { return "spw-file-upload"; }
    static get encapsulation() { return "shadow"; }
    static get formAssociated() { return true; }
    static get originalStyleUrls() {
        return {
            "$": ["spw-file-upload.scss"]
        };
    }
    static get styleUrls() {
        return {
            "$": ["spw-file-upload.css"]
        };
    }
    static get properties() {
        return {
            "disabled": {
                "type": "boolean",
                "mutable": false,
                "complexType": {
                    "original": "boolean",
                    "resolved": "boolean",
                    "references": {}
                },
                "required": false,
                "optional": false,
                "docs": {
                    "tags": [],
                    "text": "Indique si le champ est d\u00E9sactiv\u00E9, rendant le t\u00E9l\u00E9versement de fichiers non disponible"
                },
                "getter": false,
                "setter": false,
                "reflect": false,
                "attribute": "disabled",
                "defaultValue": "false"
            },
            "error": {
                "type": "boolean",
                "mutable": false,
                "complexType": {
                    "original": "boolean",
                    "resolved": "boolean",
                    "references": {}
                },
                "required": false,
                "optional": false,
                "docs": {
                    "tags": [],
                    "text": "Indique s'il y a une erreur visuelle associ\u00E9e au composant de t\u00E9l\u00E9versement de fichiers"
                },
                "getter": false,
                "setter": false,
                "reflect": false,
                "attribute": "error",
                "defaultValue": "false"
            },
            "name": {
                "type": "string",
                "mutable": false,
                "complexType": {
                    "original": "string",
                    "resolved": "string",
                    "references": {}
                },
                "required": false,
                "optional": false,
                "docs": {
                    "tags": [],
                    "text": "Nom de l'\u00E9l\u00E9ment utilis\u00E9 dans les formulaires pour associer la valeur des fichiers"
                },
                "getter": false,
                "setter": false,
                "reflect": false,
                "attribute": "name"
            },
            "value": {
                "type": "unknown",
                "mutable": false,
                "complexType": {
                    "original": "File[]",
                    "resolved": "File[]",
                    "references": {
                        "File": {
                            "location": "global",
                            "id": "global::File"
                        }
                    }
                },
                "required": false,
                "optional": false,
                "docs": {
                    "tags": [],
                    "text": "Valeur actuelle s\u00E9lectionn\u00E9e, utilis\u00E9e pour les formulaires"
                },
                "getter": false,
                "setter": false,
                "defaultValue": "[]"
            },
            "enableDropZone": {
                "type": "boolean",
                "mutable": false,
                "complexType": {
                    "original": "boolean",
                    "resolved": "boolean",
                    "references": {}
                },
                "required": false,
                "optional": false,
                "docs": {
                    "tags": [],
                    "text": "Active ou d\u00E9sactive la zone de d\u00E9p\u00F4t pour le glisser-d\u00E9poser de fichiers"
                },
                "getter": false,
                "setter": false,
                "reflect": false,
                "attribute": "enable-drop-zone",
                "defaultValue": "false"
            },
            "multiple": {
                "type": "boolean",
                "mutable": false,
                "complexType": {
                    "original": "boolean",
                    "resolved": "boolean",
                    "references": {}
                },
                "required": false,
                "optional": false,
                "docs": {
                    "tags": [],
                    "text": "Permet de t\u00E9l\u00E9verser plusieurs fichiers si vrai"
                },
                "getter": false,
                "setter": false,
                "reflect": false,
                "attribute": "multiple",
                "defaultValue": "false"
            },
            "accept": {
                "type": "string",
                "mutable": false,
                "complexType": {
                    "original": "string",
                    "resolved": "string",
                    "references": {}
                },
                "required": false,
                "optional": false,
                "docs": {
                    "tags": [],
                    "text": "Types de fichiers accept\u00E9s, sp\u00E9cifi\u00E9s sous forme de cha\u00EEne de types MIME ou extensions (whitelist)"
                },
                "getter": false,
                "setter": false,
                "reflect": false,
                "attribute": "accept",
                "defaultValue": "''"
            },
            "refuse": {
                "type": "string",
                "mutable": false,
                "complexType": {
                    "original": "string",
                    "resolved": "string",
                    "references": {}
                },
                "required": false,
                "optional": false,
                "docs": {
                    "tags": [],
                    "text": "Types de fichiers refus\u00E9s, sp\u00E9cifi\u00E9s sous forme de cha\u00EEne de types MIME ou extensions (blacklist)"
                },
                "getter": false,
                "setter": false,
                "reflect": false,
                "attribute": "refuse",
                "defaultValue": "''"
            },
            "maxFileSize": {
                "type": "number",
                "mutable": false,
                "complexType": {
                    "original": "number",
                    "resolved": "number",
                    "references": {}
                },
                "required": false,
                "optional": false,
                "docs": {
                    "tags": [],
                    "text": "Taille maximale autoris\u00E9e pour chaque fichier, en Mo"
                },
                "getter": false,
                "setter": false,
                "reflect": false,
                "attribute": "max-file-size",
                "defaultValue": "100"
            },
            "maxFileSizeUnit": {
                "type": "string",
                "mutable": false,
                "complexType": {
                    "original": "'mo' | 'go'",
                    "resolved": "\"go\" | \"mo\"",
                    "references": {}
                },
                "required": false,
                "optional": false,
                "docs": {
                    "tags": [],
                    "text": "Unit\u00E9 de mesure pour maxFileSize ('mo' ou 'go')"
                },
                "getter": false,
                "setter": false,
                "reflect": false,
                "attribute": "max-file-size-unit",
                "defaultValue": "'mo'"
            },
            "maxFiles": {
                "type": "number",
                "mutable": false,
                "complexType": {
                    "original": "number",
                    "resolved": "number",
                    "references": {}
                },
                "required": false,
                "optional": false,
                "docs": {
                    "tags": [],
                    "text": "Nombre maximal de fichiers pouvant \u00EAtre t\u00E9l\u00E9vers\u00E9s"
                },
                "getter": false,
                "setter": false,
                "reflect": false,
                "attribute": "max-files",
                "defaultValue": "Infinity"
            },
            "textChooseFile": {
                "type": "string",
                "mutable": false,
                "complexType": {
                    "original": "string",
                    "resolved": "string",
                    "references": {}
                },
                "required": false,
                "optional": false,
                "docs": {
                    "tags": [],
                    "text": "Texte du bouton pour s\u00E9lectionner un fichier (mode simple)"
                },
                "getter": false,
                "setter": false,
                "reflect": false,
                "attribute": "text-choose-file",
                "defaultValue": "'Choisir votre fichier...'"
            },
            "textChooseFiles": {
                "type": "string",
                "mutable": false,
                "complexType": {
                    "original": "string",
                    "resolved": "string",
                    "references": {}
                },
                "required": false,
                "optional": false,
                "docs": {
                    "tags": [],
                    "text": "Texte du bouton pour s\u00E9lectionner plusieurs fichiers (mode multiple)"
                },
                "getter": false,
                "setter": false,
                "reflect": false,
                "attribute": "text-choose-files",
                "defaultValue": "'Choisir vos fichiers...'"
            },
            "textDropFile": {
                "type": "string",
                "mutable": false,
                "complexType": {
                    "original": "string",
                    "resolved": "string",
                    "references": {}
                },
                "required": false,
                "optional": false,
                "docs": {
                    "tags": [],
                    "text": "Texte de la zone de d\u00E9p\u00F4t pour un fichier"
                },
                "getter": false,
                "setter": false,
                "reflect": false,
                "attribute": "text-drop-file",
                "defaultValue": "'D\u00E9posez votre fichier ici ou'"
            },
            "textDropFiles": {
                "type": "string",
                "mutable": false,
                "complexType": {
                    "original": "string",
                    "resolved": "string",
                    "references": {}
                },
                "required": false,
                "optional": false,
                "docs": {
                    "tags": [],
                    "text": "Texte de la zone de d\u00E9p\u00F4t pour plusieurs fichiers"
                },
                "getter": false,
                "setter": false,
                "reflect": false,
                "attribute": "text-drop-files",
                "defaultValue": "'D\u00E9posez vos fichiers ici ou'"
            },
            "textChooseFromComputer": {
                "type": "string",
                "mutable": false,
                "complexType": {
                    "original": "string",
                    "resolved": "string",
                    "references": {}
                },
                "required": false,
                "optional": false,
                "docs": {
                    "tags": [],
                    "text": "Texte du lien pour choisir depuis l'ordinateur"
                },
                "getter": false,
                "setter": false,
                "reflect": false,
                "attribute": "text-choose-from-computer",
                "defaultValue": "'choisissez sur votre ordinateur...'"
            },
            "textDelete": {
                "type": "string",
                "mutable": false,
                "complexType": {
                    "original": "string",
                    "resolved": "string",
                    "references": {}
                },
                "required": false,
                "optional": false,
                "docs": {
                    "tags": [],
                    "text": "Texte du lien de suppression"
                },
                "getter": false,
                "setter": false,
                "reflect": false,
                "attribute": "text-delete",
                "defaultValue": "'Supprimer'"
            },
            "textMaxFileSize": {
                "type": "string",
                "mutable": false,
                "complexType": {
                    "original": "string",
                    "resolved": "string",
                    "references": {}
                },
                "required": false,
                "optional": false,
                "docs": {
                    "tags": [],
                    "text": "Texte pour la taille maximale par fichier (utiliser {size} et {unit} comme placeholders)"
                },
                "getter": false,
                "setter": false,
                "reflect": false,
                "attribute": "text-max-file-size",
                "defaultValue": "'Taille maximale par fichier : {size} {unit}'"
            },
            "textMaxFiles": {
                "type": "string",
                "mutable": false,
                "complexType": {
                    "original": "string",
                    "resolved": "string",
                    "references": {}
                },
                "required": false,
                "optional": false,
                "docs": {
                    "tags": [],
                    "text": "Texte pour le nombre maximum de fichiers (utiliser {count} comme placeholder)"
                },
                "getter": false,
                "setter": false,
                "reflect": false,
                "attribute": "text-max-files",
                "defaultValue": "'{count} fichier(s) maximum'"
            },
            "textAcceptedFormats": {
                "type": "string",
                "mutable": false,
                "complexType": {
                    "original": "string",
                    "resolved": "string",
                    "references": {}
                },
                "required": false,
                "optional": false,
                "docs": {
                    "tags": [],
                    "text": "Texte pour les formats autoris\u00E9s (utiliser {formats} comme placeholder)"
                },
                "getter": false,
                "setter": false,
                "reflect": false,
                "attribute": "text-accepted-formats",
                "defaultValue": "'Formats autoris\u00E9s : {formats}.'"
            },
            "textRefusedFormats": {
                "type": "string",
                "mutable": false,
                "complexType": {
                    "original": "string",
                    "resolved": "string",
                    "references": {}
                },
                "required": false,
                "optional": false,
                "docs": {
                    "tags": [],
                    "text": "Texte pour les formats refus\u00E9s (utiliser {formats} comme placeholder)"
                },
                "getter": false,
                "setter": false,
                "reflect": false,
                "attribute": "text-refused-formats",
                "defaultValue": "'Formats refus\u00E9s : {formats}.'"
            },
            "textAllFormats": {
                "type": "string",
                "mutable": false,
                "complexType": {
                    "original": "string",
                    "resolved": "string",
                    "references": {}
                },
                "required": false,
                "optional": false,
                "docs": {
                    "tags": [],
                    "text": "Texte quand tous les formats sont autoris\u00E9s"
                },
                "getter": false,
                "setter": false,
                "reflect": false,
                "attribute": "text-all-formats",
                "defaultValue": "'Formats autoris\u00E9s : tous les formats.'"
            },
            "textErrorFormat": {
                "type": "string",
                "mutable": false,
                "complexType": {
                    "original": "string",
                    "resolved": "string",
                    "references": {}
                },
                "required": false,
                "optional": false,
                "docs": {
                    "tags": [],
                    "text": "Message d'erreur quand le format n'est pas autoris\u00E9 (utiliser {filename} comme placeholder)"
                },
                "getter": false,
                "setter": false,
                "reflect": false,
                "attribute": "text-error-format",
                "defaultValue": "\"{filename} n'a pas \u00E9t\u00E9 pris en compte car le format n'est pas autoris\u00E9.\""
            },
            "textErrorSize": {
                "type": "string",
                "mutable": false,
                "complexType": {
                    "original": "string",
                    "resolved": "string",
                    "references": {}
                },
                "required": false,
                "optional": false,
                "docs": {
                    "tags": [],
                    "text": "Message d'erreur quand la taille est d\u00E9pass\u00E9e (utiliser {filename} comme placeholder)"
                },
                "getter": false,
                "setter": false,
                "reflect": false,
                "attribute": "text-error-size",
                "defaultValue": "\"{filename} n'a pas \u00E9t\u00E9 pris en compte car il d\u00E9passe la taille maximale autoris\u00E9e.\""
            },
            "textErrorFormatAndSize": {
                "type": "string",
                "mutable": false,
                "complexType": {
                    "original": "string",
                    "resolved": "string",
                    "references": {}
                },
                "required": false,
                "optional": false,
                "docs": {
                    "tags": [],
                    "text": "Message d'erreur quand le format et la taille sont invalides (utiliser {filename} comme placeholder)"
                },
                "getter": false,
                "setter": false,
                "reflect": false,
                "attribute": "text-error-format-and-size",
                "defaultValue": "\"{filename} n'a pas \u00E9t\u00E9 pris en compte car le format n'est pas autoris\u00E9 et la limite de poids est d\u00E9pass\u00E9e.\""
            },
            "textLimitReached": {
                "type": "string",
                "mutable": false,
                "complexType": {
                    "original": "string",
                    "resolved": "string",
                    "references": {}
                },
                "required": false,
                "optional": false,
                "docs": {
                    "tags": [],
                    "text": "Message quand la limite de fichiers est atteinte"
                },
                "getter": false,
                "setter": false,
                "reflect": false,
                "attribute": "text-limit-reached",
                "defaultValue": "'Vous avez atteint la limite autoris\u00E9e de fichiers.'"
            },
            "textLimitExceeded": {
                "type": "string",
                "mutable": false,
                "complexType": {
                    "original": "string",
                    "resolved": "string",
                    "references": {}
                },
                "required": false,
                "optional": false,
                "docs": {
                    "tags": [],
                    "text": "Message quand on d\u00E9passe la limite de fichiers (utiliser {count} comme placeholder)"
                },
                "getter": false,
                "setter": false,
                "reflect": false,
                "attribute": "text-limit-exceeded",
                "defaultValue": "'Vous ne pouvez pas t\u00E9l\u00E9charger plus de {count} fichier(s).'"
            }
        };
    }
    static get states() {
        return {
            "selectedFiles": {},
            "fileTypeErrors": {},
            "fileLimitErrors": {},
            "isDragging": {},
            "isMaxFilesReachedExact": {}
        };
    }
    static get events() {
        return [{
                "method": "spwFileChange",
                "name": "spwFileChange",
                "bubbles": true,
                "cancelable": true,
                "composed": true,
                "docs": {
                    "tags": [],
                    "text": "\u00C9v\u00E9nement \u00E9mis lorsque la s\u00E9lection de fichiers change"
                },
                "complexType": {
                    "original": "{ files: File[] }",
                    "resolved": "{ files: File[]; }",
                    "references": {
                        "File": {
                            "location": "global",
                            "id": "global::File"
                        }
                    }
                }
            }];
    }
    static get methods() {
        return {
            "resetInput": {
                "complexType": {
                    "signature": "() => Promise<void>",
                    "parameters": [],
                    "references": {
                        "Promise": {
                            "location": "global",
                            "id": "global::Promise"
                        }
                    },
                    "return": "Promise<void>"
                },
                "docs": {
                    "text": "R\u00E9initialise le champ de t\u00E9l\u00E9chargement de fichiers",
                    "tags": []
                }
            }
        };
    }
    static get elementRef() { return "el"; }
    static get watchers() {
        return [{
                "propName": "value",
                "methodName": "watchValueHandler"
            }];
    }
    static get attachInternalsMemberName() { return "internals"; }
}
