ptechcore_ui 1.0.46 → 1.0.48

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (3) hide show
  1. package/dist/index.cjs +1116 -1091
  2. package/dist/index.js +1325 -1299
  3. package/package.json +1 -1
package/dist/index.cjs CHANGED
@@ -1022,6 +1022,8 @@ var SessionProvider = ({ children }) => {
1022
1022
  const result = res;
1023
1023
  if (result.success === true) {
1024
1024
  setLoggedUser(result.data.user);
1025
+ localStorage.setItem("token", result.data.token);
1026
+ setToken(result.data.token);
1025
1027
  setActiveBusinessEntity(
1026
1028
  result.data.user.centers_access.find((item) => parseInt(String(item.id)) === parseInt(saved_center_id)) || result.data.user.centers_access[0] || null
1027
1029
  );
@@ -4822,7 +4824,7 @@ var Pagination = ({
4822
4824
  };
4823
4825
 
4824
4826
  // src/components/common/FormVendor.tsx
4825
- var import_react11 = require("react");
4827
+ var import_react20 = require("react");
4826
4828
 
4827
4829
  // src/components/common/CommonSelect.tsx
4828
4830
  var import_react10 = require("react");
@@ -5854,919 +5856,363 @@ var SelectClient = ({
5854
5856
  ] });
5855
5857
  };
5856
5858
 
5857
- // src/components/common/FormVendor.tsx
5858
- var import_lucide_react8 = require("lucide-react");
5859
+ // src/components/common/FileManager/FileManager.tsx
5860
+ var import_react17 = require("react");
5861
+ var import_lucide_react15 = require("lucide-react");
5862
+
5863
+ // src/components/common/FileManager/FileManagerContext.tsx
5864
+ var import_react11 = require("react");
5859
5865
  var import_jsx_runtime15 = require("react/jsx-runtime");
5860
- var FormVendor = ({
5861
- isOpen,
5862
- onClose,
5863
- object,
5864
- from = "procurement",
5865
- refresh = () => {
5866
+ var defaultTexts = {
5867
+ createFolder: "Cr\xE9er un dossier",
5868
+ uploadFiles: "Uploader des fichiers",
5869
+ rename: "Renommer",
5870
+ delete: "Supprimer",
5871
+ download: "T\xE9l\xE9charger",
5872
+ open: "Ouvrir",
5873
+ deselectAll: "Tout d\xE9s\xE9lectionner",
5874
+ newFolderName: "Nom du dossier",
5875
+ confirmDelete: "Voulez-vous vraiment supprimer",
5876
+ noFiles: "Aucun fichier",
5877
+ dropFilesHere: "D\xE9posez vos fichiers ici",
5878
+ cancel: "Annuler",
5879
+ confirm: "Confirmer"
5880
+ };
5881
+ var FileManagerContext = (0, import_react11.createContext)(null);
5882
+ var useFileManager = () => {
5883
+ const context = (0, import_react11.useContext)(FileManagerContext);
5884
+ if (!context) {
5885
+ throw new Error("useFileManager must be used within a FileManagerProvider");
5866
5886
  }
5887
+ return context;
5888
+ };
5889
+ var FileManagerProvider = ({
5890
+ children,
5891
+ data,
5892
+ rootName = "Fichiers",
5893
+ viewMode: initialViewMode = "grid",
5894
+ allowMultiSelect = true,
5895
+ allowUpload = true,
5896
+ allowCreateFolder = true,
5897
+ allowRename = true,
5898
+ allowDelete = true,
5899
+ allowDownload = true,
5900
+ texts: customTexts = {},
5901
+ onCreateFolder,
5902
+ onUploadFiles,
5903
+ onRename,
5904
+ onDelete,
5905
+ onDownload,
5906
+ onOpen,
5907
+ onSelect
5867
5908
  }) => {
5868
- const [formData, setFormData] = (0, import_react11.useState)(object || {
5869
- from_module: from ?? null,
5870
- legal_name: "",
5871
- trading_name: "",
5872
- phone: "",
5873
- email: "",
5874
- logo: "",
5875
- year_founded: "",
5876
- activity_sector: "",
5877
- description: "",
5878
- accounting_account_number: "",
5879
- account: null,
5880
- capital: null,
5881
- annual_turnover: null,
5882
- payment_delay: null,
5883
- country: "",
5884
- city: "",
5885
- address: "",
5886
- legal_form: "",
5887
- tax_regime: "",
5888
- tax_account: "",
5889
- rccm: "",
5890
- legal_representative_name: "",
5891
- legal_representative_address: "",
5892
- legal_representative_phone: "",
5893
- legal_representative_email: "",
5894
- legal_representative_id_document: "",
5895
- legal_representative_id_number: "",
5896
- legal_representative_fonction: "",
5897
- bank_name: "",
5898
- bank_address: "",
5899
- bank_email: "",
5900
- bank_phone: "",
5901
- iban: "",
5902
- rib: "",
5903
- vendor_number: ""
5909
+ const rootFolder = (0, import_react11.useMemo)(
5910
+ () => ({
5911
+ id: "__root__",
5912
+ name: rootName,
5913
+ type: "folder",
5914
+ path: "/",
5915
+ children: data
5916
+ }),
5917
+ [data, rootName]
5918
+ );
5919
+ const [currentFolder, setCurrentFolder] = (0, import_react11.useState)(rootFolder);
5920
+ const [pathHistory, setPathHistory] = (0, import_react11.useState)([rootFolder]);
5921
+ const [selectedItems, setSelectedItems] = (0, import_react11.useState)([]);
5922
+ const [viewMode, setViewMode] = (0, import_react11.useState)(initialViewMode);
5923
+ const [renamingItem, setRenamingItem] = (0, import_react11.useState)(null);
5924
+ const [contextMenu, setContextMenu] = (0, import_react11.useState)({
5925
+ visible: false,
5926
+ position: { x: 0, y: 0 },
5927
+ item: null
5904
5928
  });
5905
- const [errors, setErrors] = (0, import_react11.useState)({});
5906
- const [activeTab, setActiveTab] = (0, import_react11.useState)("general");
5907
- const [loading, setLoading] = (0, import_react11.useState)(false);
5908
- const { token } = useSession();
5909
- const { success, error: showError } = useToast();
5910
- const handleInputChange = (e) => {
5911
- const { name, value } = e.target;
5912
- setFormData((prev) => ({ ...prev, [name]: value }));
5913
- if (errors[name]) {
5914
- setErrors((prev) => ({ ...prev, [name]: void 0 }));
5915
- }
5916
- };
5917
- const handleTextareaChange = (e) => {
5918
- const { name, value } = e.target;
5919
- setFormData((prev) => ({ ...prev, [name]: value }));
5920
- };
5921
- const validateForm = () => {
5922
- const newErrors = {};
5923
- if (!formData.legal_name?.trim()) {
5924
- newErrors.legal_name = "La raison sociale est obligatoire";
5925
- }
5926
- if (formData.email && !/^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(formData.email)) {
5927
- newErrors.email = "Format d'email invalide";
5928
- }
5929
- if (formData.iban && formData.iban.length > 0 && formData.iban.length < 15) {
5930
- newErrors.iban = "Format IBAN invalide";
5931
- }
5932
- setErrors(newErrors);
5933
- return Object.keys(newErrors).length === 0;
5934
- };
5935
- const handleSaveVendor = async (entityData) => {
5936
- try {
5937
- if (object && object.id) {
5938
- await VendorServices.update(object.id, entityData);
5939
- success("Fournisseur modifi\xE9 avec succ\xE8s !");
5929
+ const texts = (0, import_react11.useMemo)(() => ({ ...defaultTexts, ...customTexts }), [customTexts]);
5930
+ const currentFolderContents = (0, import_react11.useMemo)(() => {
5931
+ return currentFolder?.children || [];
5932
+ }, [currentFolder]);
5933
+ const navigateToFolder = (0, import_react11.useCallback)(
5934
+ (folder) => {
5935
+ if (!folder) {
5936
+ setCurrentFolder(rootFolder);
5937
+ setPathHistory([rootFolder]);
5940
5938
  } else {
5941
- await VendorServices.create(entityData);
5942
- success("Fournisseur cr\xE9\xE9 avec succ\xE8s !");
5939
+ setCurrentFolder(folder);
5940
+ setPathHistory((prev) => [...prev, folder]);
5943
5941
  }
5944
- refresh();
5945
- onClose();
5946
- } catch (error) {
5947
- console.error(error);
5948
- showError("Erreur lors de l'enregistrement du fournisseur");
5942
+ setSelectedItems([]);
5943
+ setContextMenu({ visible: false, position: { x: 0, y: 0 }, item: null });
5944
+ },
5945
+ [rootFolder]
5946
+ );
5947
+ const navigateBack = (0, import_react11.useCallback)(() => {
5948
+ if (pathHistory.length > 1) {
5949
+ const newHistory = [...pathHistory];
5950
+ newHistory.pop();
5951
+ const previousFolder = newHistory[newHistory.length - 1];
5952
+ setCurrentFolder(previousFolder);
5953
+ setPathHistory(newHistory);
5954
+ setSelectedItems([]);
5949
5955
  }
5950
- };
5951
- const handleSubmit = async (e) => {
5952
- e.preventDefault();
5953
- if (!validateForm()) return;
5954
- setLoading(true);
5955
- try {
5956
- await handleSaveVendor(formData);
5957
- } finally {
5958
- setLoading(false);
5956
+ }, [pathHistory]);
5957
+ const navigateToPath = (0, import_react11.useCallback)(
5958
+ (index) => {
5959
+ if (index < pathHistory.length - 1) {
5960
+ const newHistory = pathHistory.slice(0, index + 1);
5961
+ setCurrentFolder(newHistory[newHistory.length - 1]);
5962
+ setPathHistory(newHistory);
5963
+ setSelectedItems([]);
5964
+ }
5965
+ },
5966
+ [pathHistory]
5967
+ );
5968
+ const selectItem = (0, import_react11.useCallback)(
5969
+ (item, multiSelect = false) => {
5970
+ setSelectedItems((prev) => {
5971
+ if (multiSelect && allowMultiSelect) {
5972
+ const isSelected = prev.some((i) => i.id === item.id);
5973
+ if (isSelected) {
5974
+ return prev.filter((i) => i.id !== item.id);
5975
+ }
5976
+ return [...prev, item];
5977
+ }
5978
+ return [item];
5979
+ });
5980
+ if (onSelect) {
5981
+ const newSelection = allowMultiSelect && multiSelect ? selectedItems.some((i) => i.id === item.id) ? selectedItems.filter((i) => i.id !== item.id) : [...selectedItems, item] : [item];
5982
+ onSelect(newSelection);
5983
+ }
5984
+ },
5985
+ [allowMultiSelect, onSelect, selectedItems]
5986
+ );
5987
+ const deselectAll = (0, import_react11.useCallback)(() => {
5988
+ setSelectedItems([]);
5989
+ if (onSelect) {
5990
+ onSelect([]);
5959
5991
  }
5960
- };
5961
- const tabs = [
5962
- { id: "general", label: "G\xE9n\xE9ral", icon: import_lucide_react8.Building2 },
5963
- { id: "contacts", label: "Adresses & Contacts", icon: import_lucide_react8.MapPin },
5964
- { id: "representative", label: "Repr\xE9sentant", icon: import_lucide_react8.FileText },
5965
- { id: "accounting", label: "Comptabilit\xE9", icon: import_lucide_react8.FileText },
5966
- { id: "banking", label: "Bancaire", icon: import_lucide_react8.CreditCard }
5967
- ];
5968
- const renderTabContent = () => {
5969
- switch (activeTab) {
5970
- case "general":
5971
- return /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("div", { className: "space-y-4", children: [
5972
- /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
5973
- TextInput,
5974
- {
5975
- label: "Raison sociale",
5976
- name: "legal_name",
5977
- value: formData.legal_name || "",
5978
- placeholder: "Nom l\\u00e9gal de l'entit\\u00e9",
5979
- required: true,
5980
- error: errors.legal_name,
5981
- onChange: handleInputChange
5982
- }
5983
- ),
5984
- /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
5985
- TextInput,
5986
- {
5987
- label: "Nom commercial",
5988
- name: "trading_name",
5989
- value: formData.trading_name || "",
5990
- placeholder: "Nom commercial (optionnel)",
5991
- onChange: handleInputChange
5992
- }
5993
- ),
5994
- /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("div", { className: "grid grid-cols-1 md:grid-cols-2 gap-4", children: [
5995
- /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
5996
- TextInput,
5997
- {
5998
- label: "Num\\u00e9ro d'identification fiscale (NCC)",
5999
- name: "tax_account",
6000
- value: formData.tax_account || "",
6001
- placeholder: "Num\\u00e9ro d'identification fiscale",
6002
- onChange: handleInputChange
6003
- }
6004
- ),
6005
- /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
6006
- TextInput,
6007
- {
6008
- label: "RCCM",
6009
- name: "rccm",
6010
- value: formData.rccm || "",
6011
- placeholder: "Registre du Commerce et du Cr\\u00e9dit Mobilier",
6012
- onChange: handleInputChange
6013
- }
6014
- ),
6015
- /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
6016
- TextInput,
6017
- {
6018
- label: "Forme juridique",
6019
- name: "legal_form",
6020
- value: formData.legal_form || "",
6021
- placeholder: "SARL, SA, SAS, etc.",
6022
- onChange: handleInputChange
6023
- }
6024
- ),
6025
- /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
6026
- TextInput,
6027
- {
6028
- label: "R\\u00e9gime fiscal",
6029
- name: "tax_regime",
6030
- value: formData.tax_regime || "",
6031
- placeholder: "R\\u00e9gime fiscal",
6032
- onChange: handleInputChange
6033
- }
6034
- ),
6035
- /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
6036
- TextInput,
6037
- {
6038
- label: "Ann\\u00e9e de fondation",
6039
- name: "year_founded",
6040
- value: formData.year_founded || "",
6041
- placeholder: "2020",
6042
- onChange: handleInputChange
6043
- }
6044
- ),
6045
- /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
6046
- TextInput,
6047
- {
6048
- label: "Secteur d'activit\\u00e9",
6049
- name: "activity_sector",
6050
- value: formData.activity_sector || "",
6051
- placeholder: "Informatique, Commerce, etc.",
6052
- onChange: handleInputChange
6053
- }
6054
- )
6055
- ] }),
6056
- /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("div", { children: [
6057
- /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("label", { className: "block text-sm font-medium text-gray-700 mb-2", children: "Description" }),
6058
- /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
6059
- "textarea",
6060
- {
6061
- name: "description",
6062
- value: formData.description || "",
6063
- onChange: handleTextareaChange,
6064
- rows: 3,
6065
- className: "w-full px-4 py-3 border border-gray-200 rounded-lg focus:outline-none focus:ring-2 focus:ring-[#6B7C92] focus:border-transparent placeholder-gray-400",
6066
- placeholder: "Description de l'activit\\u00e9 de l'entit\\u00e9"
6067
- }
6068
- )
6069
- ] })
6070
- ] });
6071
- case "contacts":
6072
- return /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("div", { className: "space-y-4", children: [
6073
- /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("div", { className: "grid grid-cols-1 md:grid-cols-2 gap-4", children: [
6074
- /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
6075
- InputField,
6076
- {
6077
- label: "T\\u00e9l\\u00e9phone",
6078
- name: "phone",
6079
- type: "tel",
6080
- value: formData.phone || "",
6081
- placeholder: "+225 XX XX XX XX XX",
6082
- onChange: handleInputChange
6083
- }
6084
- ),
6085
- /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
6086
- InputField,
6087
- {
6088
- label: "Email",
6089
- name: "email",
6090
- type: "email",
6091
- value: formData.email || "",
6092
- placeholder: "contact@entite.com",
6093
- error: errors.email,
6094
- onChange: handleInputChange
6095
- }
6096
- )
6097
- ] }),
6098
- /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("div", { className: "grid grid-cols-1 md:grid-cols-2 gap-4", children: [
6099
- /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
6100
- TextInput,
6101
- {
6102
- label: "Pays",
6103
- name: "country",
6104
- value: formData.country || "",
6105
- placeholder: "C\\u00f4te d'Ivoire",
6106
- onChange: handleInputChange
6107
- }
6108
- ),
6109
- /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
6110
- TextInput,
6111
- {
6112
- label: "Ville",
6113
- name: "city",
6114
- value: formData.city || "",
6115
- placeholder: "Abidjan",
6116
- onChange: handleInputChange
6117
- }
6118
- )
6119
- ] }),
6120
- /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("div", { children: [
6121
- /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("label", { className: "block text-sm font-medium text-gray-700 mb-2", children: "Adresse compl\\u00e8te" }),
6122
- /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
6123
- "textarea",
6124
- {
6125
- name: "address",
6126
- value: formData.address || "",
6127
- onChange: handleTextareaChange,
6128
- rows: 3,
6129
- className: "w-full px-4 py-3 border border-gray-200 rounded-lg focus:outline-none focus:ring-2 focus:ring-[#6B7C92] focus:border-transparent placeholder-gray-400",
6130
- placeholder: "Adresse compl\\u00e8te de l'entit\\u00e9"
6131
- }
6132
- )
6133
- ] })
6134
- ] });
6135
- case "representative":
6136
- return /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("div", { className: "space-y-4", children: [
6137
- /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
6138
- TextInput,
5992
+ }, [onSelect]);
5993
+ const showContextMenu = (0, import_react11.useCallback)((item, position) => {
5994
+ setContextMenu({
5995
+ visible: true,
5996
+ position,
5997
+ item
5998
+ });
5999
+ }, []);
6000
+ const hideContextMenu = (0, import_react11.useCallback)(() => {
6001
+ setContextMenu((prev) => ({ ...prev, visible: false }));
6002
+ }, []);
6003
+ const startRenaming = (0, import_react11.useCallback)((item) => {
6004
+ setRenamingItem(item);
6005
+ hideContextMenu();
6006
+ }, [hideContextMenu]);
6007
+ const stopRenaming = (0, import_react11.useCallback)(() => {
6008
+ setRenamingItem(null);
6009
+ }, []);
6010
+ const contextValue = (0, import_react11.useMemo)(
6011
+ () => ({
6012
+ data,
6013
+ currentFolder,
6014
+ currentFolderContents,
6015
+ pathHistory,
6016
+ selectedItems,
6017
+ viewMode,
6018
+ contextMenu,
6019
+ renamingItem,
6020
+ navigateToFolder,
6021
+ navigateBack,
6022
+ navigateToPath,
6023
+ selectItem,
6024
+ deselectAll,
6025
+ setViewMode,
6026
+ showContextMenu,
6027
+ hideContextMenu,
6028
+ startRenaming,
6029
+ stopRenaming,
6030
+ onCreateFolder,
6031
+ onUploadFiles,
6032
+ onRename,
6033
+ onDelete,
6034
+ onDownload,
6035
+ onOpen,
6036
+ allowUpload,
6037
+ allowCreateFolder,
6038
+ allowRename,
6039
+ allowDelete,
6040
+ allowDownload,
6041
+ allowMultiSelect,
6042
+ texts
6043
+ }),
6044
+ [
6045
+ data,
6046
+ currentFolder,
6047
+ currentFolderContents,
6048
+ pathHistory,
6049
+ selectedItems,
6050
+ viewMode,
6051
+ contextMenu,
6052
+ renamingItem,
6053
+ navigateToFolder,
6054
+ navigateBack,
6055
+ navigateToPath,
6056
+ selectItem,
6057
+ deselectAll,
6058
+ showContextMenu,
6059
+ hideContextMenu,
6060
+ startRenaming,
6061
+ stopRenaming,
6062
+ onCreateFolder,
6063
+ onUploadFiles,
6064
+ onRename,
6065
+ onDelete,
6066
+ onDownload,
6067
+ onOpen,
6068
+ allowUpload,
6069
+ allowCreateFolder,
6070
+ allowRename,
6071
+ allowDelete,
6072
+ allowDownload,
6073
+ allowMultiSelect,
6074
+ texts
6075
+ ]
6076
+ );
6077
+ return /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(FileManagerContext.Provider, { value: contextValue, children });
6078
+ };
6079
+
6080
+ // src/components/common/FileManager/components/FolderTree.tsx
6081
+ var import_react12 = require("react");
6082
+ var import_lucide_react8 = require("lucide-react");
6083
+ var import_jsx_runtime16 = require("react/jsx-runtime");
6084
+ var FolderTreeItem = ({ item, level }) => {
6085
+ const { currentFolder, navigateToFolder, pathHistory } = useFileManager();
6086
+ const [isExpanded, setIsExpanded] = (0, import_react12.useState)(
6087
+ pathHistory.some((f) => f.id === item.id) || level === 0
6088
+ );
6089
+ const isSelected = currentFolder?.id === item.id;
6090
+ const hasChildren = item.children?.some((child) => child.type === "folder");
6091
+ const folderChildren = item.children?.filter((child) => child.type === "folder") || [];
6092
+ const handleToggle = (e) => {
6093
+ e.stopPropagation();
6094
+ setIsExpanded(!isExpanded);
6095
+ };
6096
+ const handleClick = () => {
6097
+ navigateToFolder(item);
6098
+ if (!isExpanded) {
6099
+ setIsExpanded(true);
6100
+ }
6101
+ };
6102
+ return /* @__PURE__ */ (0, import_jsx_runtime16.jsxs)("div", { children: [
6103
+ /* @__PURE__ */ (0, import_jsx_runtime16.jsxs)(
6104
+ "div",
6105
+ {
6106
+ className: cn(
6107
+ "flex items-center gap-1 py-1.5 px-2 rounded-lg cursor-pointer transition-colors",
6108
+ "hover:bg-gray-100 dark:hover:bg-gray-800",
6109
+ isSelected && "bg-blue-50 dark:bg-blue-900/30 text-blue-700 dark:text-blue-300"
6110
+ ),
6111
+ style: { paddingLeft: `${level * 12 + 8}px` },
6112
+ onClick: handleClick,
6113
+ children: [
6114
+ hasChildren ? /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(
6115
+ "button",
6139
6116
  {
6140
- label: "Nom du repr\\u00e9sentant l\\u00e9gal",
6141
- name: "legal_representative_name",
6142
- value: formData.legal_representative_name || "",
6143
- placeholder: "Nom et pr\\u00e9nom du repr\\u00e9sentant",
6144
- onChange: handleInputChange
6117
+ onClick: handleToggle,
6118
+ className: "p-0.5 hover:bg-gray-200 dark:hover:bg-gray-700 rounded",
6119
+ children: isExpanded ? /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(import_lucide_react8.ChevronDown, { className: "w-4 h-4 text-gray-500 dark:text-gray-400" }) : /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(import_lucide_react8.ChevronRight, { className: "w-4 h-4 text-gray-500 dark:text-gray-400" })
6145
6120
  }
6146
- ),
6147
- /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
6148
- TextInput,
6121
+ ) : /* @__PURE__ */ (0, import_jsx_runtime16.jsx)("span", { className: "w-5" }),
6122
+ isExpanded ? /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(import_lucide_react8.FolderOpen, { className: "w-4 h-4 text-yellow-500 flex-shrink-0" }) : /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(import_lucide_react8.Folder, { className: "w-4 h-4 text-yellow-500 flex-shrink-0" }),
6123
+ /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(
6124
+ "span",
6149
6125
  {
6150
- label: "Fonction du repr\\u00e9sentant",
6151
- name: "legal_representative_fonction",
6152
- value: formData.legal_representative_fonction || "",
6153
- placeholder: "Directeur G\\u00e9n\\u00e9ral, G\\u00e9rant, etc.",
6154
- onChange: handleInputChange
6126
+ className: cn(
6127
+ "text-sm truncate",
6128
+ isSelected ? "font-medium" : "text-gray-700 dark:text-gray-300"
6129
+ ),
6130
+ children: item.name
6155
6131
  }
6156
- ),
6157
- /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("div", { className: "grid grid-cols-1 md:grid-cols-2 gap-4", children: [
6158
- /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
6159
- InputField,
6160
- {
6161
- label: "T\\u00e9l\\u00e9phone du repr\\u00e9sentant",
6162
- name: "legal_representative_phone",
6163
- type: "tel",
6164
- value: formData.legal_representative_phone || "",
6165
- placeholder: "+225 XX XX XX XX XX",
6166
- onChange: handleInputChange
6167
- }
6168
- ),
6169
- /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
6170
- InputField,
6171
- {
6172
- label: "Email du repr\\u00e9sentant",
6173
- name: "legal_representative_email",
6174
- type: "email",
6175
- value: formData.legal_representative_email || "",
6176
- placeholder: "representant@entite.com",
6177
- onChange: handleInputChange
6178
- }
6179
- ),
6180
- /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
6181
- TextInput,
6182
- {
6183
- label: "Type de document d'identit\\u00e9",
6184
- name: "legal_representative_id_document",
6185
- value: formData.legal_representative_id_document || "",
6186
- placeholder: "CNI, Passeport, etc.",
6187
- onChange: handleInputChange
6188
- }
6189
- ),
6190
- /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
6191
- TextInput,
6192
- {
6193
- label: "Num\\u00e9ro de document d'identit\\u00e9",
6194
- name: "legal_representative_id_number",
6195
- value: formData.legal_representative_id_number || "",
6196
- placeholder: "Num\\u00e9ro du document",
6197
- onChange: handleInputChange
6198
- }
6199
- )
6200
- ] }),
6201
- /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("div", { children: [
6202
- /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("label", { className: "block text-sm font-medium text-gray-700 mb-2", children: "Adresse du repr\\u00e9sentant" }),
6203
- /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
6204
- "textarea",
6205
- {
6206
- name: "legal_representative_address",
6207
- value: formData.legal_representative_address || "",
6208
- onChange: handleTextareaChange,
6209
- rows: 3,
6210
- className: "w-full px-4 py-3 border border-gray-200 rounded-lg focus:outline-none focus:ring-2 focus:ring-[#6B7C92] focus:border-transparent placeholder-gray-400",
6211
- placeholder: "Adresse du repr\\u00e9sentant l\\u00e9gal"
6212
- }
6213
- )
6214
- ] })
6215
- ] });
6216
- case "accounting":
6217
- return /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("div", { className: "space-y-4", children: [
6218
- /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
6219
- SelectAccount,
6220
- {
6221
- value: formData.account,
6222
- filterClass: "4",
6223
- onSelect: (option) => {
6224
- setFormData((prev) => ({
6225
- ...prev,
6226
- account: option.value,
6227
- accounting_account_number: option.object?.account_number || ""
6228
- }));
6229
- }
6230
- }
6231
- ),
6232
- /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("div", { className: "grid grid-cols-1 md:grid-cols-2 gap-4", children: [
6233
- /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
6234
- TextInput,
6235
- {
6236
- label: "Numero de compte (manuel)",
6237
- name: "accounting_account_number",
6238
- value: formData.accounting_account_number || "",
6239
- placeholder: "Numero de compte comptable",
6240
- onChange: handleInputChange
6241
- }
6242
- ),
6243
- /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
6244
- TextInput,
6245
- {
6246
- label: "Capital",
6247
- name: "capital",
6248
- value: formData.capital?.toString() || "",
6249
- placeholder: "Capital social",
6250
- onChange: handleInputChange
6251
- }
6252
- ),
6253
- /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
6254
- TextInput,
6255
- {
6256
- label: "Chiffre d'affaires annuel",
6257
- name: "annual_turnover",
6258
- value: formData.annual_turnover?.toString() || "",
6259
- placeholder: "Chiffre d'affaires",
6260
- onChange: handleInputChange
6261
- }
6262
- ),
6263
- /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
6264
- TextInput,
6265
- {
6266
- label: "Delai de paiement (jours)",
6267
- name: "payment_delay",
6268
- value: formData.payment_delay?.toString() || "",
6269
- placeholder: "30",
6270
- onChange: handleInputChange
6271
- }
6272
- )
6273
- ] })
6274
- ] });
6275
- case "banking":
6276
- return /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("div", { className: "space-y-4", children: [
6277
- /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("div", { className: "grid grid-cols-1 md:grid-cols-2 gap-4", children: [
6278
- /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
6279
- TextInput,
6280
- {
6281
- label: "RIB",
6282
- name: "rib",
6283
- value: formData.rib || "",
6284
- placeholder: "Relev\\u00e9 d'Identit\\u00e9 Bancaire",
6285
- onChange: handleInputChange
6286
- }
6287
- ),
6288
- /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
6289
- TextInput,
6290
- {
6291
- label: "IBAN",
6292
- name: "iban",
6293
- value: formData.iban || "",
6294
- placeholder: "CI93 1234 5678 9012 3456 789",
6295
- error: errors.iban,
6296
- onChange: handleInputChange
6297
- }
6298
- )
6299
- ] }),
6300
- /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
6301
- TextInput,
6302
- {
6303
- label: "Nom de la banque",
6304
- name: "bank_name",
6305
- value: formData.bank_name || "",
6306
- placeholder: "Nom de la banque",
6307
- onChange: handleInputChange
6308
- }
6309
- ),
6310
- /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("div", { className: "grid grid-cols-1 md:grid-cols-2 gap-4", children: [
6311
- /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
6312
- InputField,
6313
- {
6314
- label: "Email de la banque",
6315
- name: "bank_email",
6316
- type: "email",
6317
- value: formData.bank_email || "",
6318
- placeholder: "contact@banque.com",
6319
- onChange: handleInputChange
6320
- }
6321
- ),
6322
- /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
6323
- InputField,
6324
- {
6325
- label: "T\\u00e9l\\u00e9phone de la banque",
6326
- name: "bank_phone",
6327
- type: "tel",
6328
- value: formData.bank_phone || "",
6329
- placeholder: "+225 XX XX XX XX XX",
6330
- onChange: handleInputChange
6331
- }
6332
- )
6333
- ] }),
6334
- /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("div", { children: [
6335
- /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("label", { className: "block text-sm font-medium text-gray-700 mb-2", children: "Adresse de la banque" }),
6336
- /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
6337
- "textarea",
6338
- {
6339
- name: "bank_address",
6340
- value: formData.bank_address || "",
6341
- onChange: handleTextareaChange,
6342
- rows: 2,
6343
- className: "w-full px-4 py-3 border border-gray-200 rounded-lg focus:outline-none focus:ring-2 focus:ring-[#6B7C92] focus:border-transparent placeholder-gray-400",
6344
- placeholder: "Adresse de la banque"
6345
- }
6346
- )
6347
- ] })
6348
- ] });
6349
- default:
6350
- return null;
6351
- }
6132
+ )
6133
+ ]
6134
+ }
6135
+ ),
6136
+ isExpanded && folderChildren.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime16.jsx)("div", { children: folderChildren.map((child) => /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(FolderTreeItem, { item: child, level: level + 1 }, child.id)) })
6137
+ ] });
6138
+ };
6139
+ var FolderTree = () => {
6140
+ const { data, currentFolder, navigateToFolder } = useFileManager();
6141
+ const rootItem = {
6142
+ id: "__root__",
6143
+ name: "Fichiers",
6144
+ type: "folder",
6145
+ path: "/",
6146
+ children: data
6352
6147
  };
6353
- if (!isOpen) return null;
6354
- return /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)(
6355
- Modals_default,
6356
- {
6357
- title: object ? "Modifier le fournisseur" : "Ajouter un fournisseur",
6358
- width: "w-[100%]",
6359
- description: "",
6360
- open: isOpen,
6361
- onClose,
6362
- children: [
6363
- /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("div", { className: "border-b border-gray-200", children: /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("nav", { className: "flex space-x-8 px-6", children: tabs.map((tab) => {
6364
- const Icon = tab.icon;
6365
- return /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)(
6366
- "button",
6367
- {
6368
- type: "button",
6369
- onClick: () => setActiveTab(tab.id),
6370
- className: `
6371
- flex items-center space-x-2 py-4 px-2 text-sm font-medium border-b-2 transition-colors
6372
- ${activeTab === tab.id ? "border-[#6A8A82] text-[#6A8A82]" : "border-transparent text-[#767676] hover:text-[#6A8A82] hover:border-[#6A8A82]/30"}
6373
- `,
6374
- children: [
6375
- /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(Icon, { className: "w-4 h-4 inline mr-2" }),
6376
- /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("span", { children: tab.label })
6377
- ]
6378
- },
6379
- tab.id
6380
- );
6381
- }) }) }),
6382
- /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("form", { onSubmit: handleSubmit, className: "p-6", children: [
6383
- renderTabContent(),
6384
- /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("div", { className: "flex justify-between pt-6 border-t border-gray-200 mt-8", children: [
6385
- /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
6386
- "button",
6387
- {
6388
- type: "button",
6389
- onClick: onClose,
6390
- className: "px-6 py-2 border border-gray-300 text-gray-700 rounded-lg hover:bg-gray-50 transition-colors",
6391
- children: "Annuler"
6392
- }
6393
- ),
6394
- /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
6395
- Buttons_default,
6396
- {
6397
- type: "submit",
6398
- disabled: loading,
6399
- children: loading ? "Chargement..." : object ? "Modifier" : "Enregistrer le fournisseur"
6400
- }
6401
- )
6402
- ] })
6403
- ] })
6404
- ]
6405
- }
6406
- );
6148
+ const isRootSelected = currentFolder?.id === "__root__";
6149
+ return /* @__PURE__ */ (0, import_jsx_runtime16.jsxs)("div", { className: "h-full overflow-y-auto py-2", children: [
6150
+ /* @__PURE__ */ (0, import_jsx_runtime16.jsxs)(
6151
+ "div",
6152
+ {
6153
+ className: cn(
6154
+ "flex items-center gap-2 py-1.5 px-3 rounded-lg cursor-pointer transition-colors mb-1",
6155
+ "hover:bg-gray-100 dark:hover:bg-gray-800",
6156
+ isRootSelected && "bg-blue-50 dark:bg-blue-900/30 text-blue-700 dark:text-blue-300"
6157
+ ),
6158
+ onClick: () => navigateToFolder(rootItem),
6159
+ children: [
6160
+ /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(import_lucide_react8.Folder, { className: "w-4 h-4 text-yellow-500" }),
6161
+ /* @__PURE__ */ (0, import_jsx_runtime16.jsx)("span", { className: cn("text-sm", isRootSelected && "font-medium"), children: rootItem.name })
6162
+ ]
6163
+ }
6164
+ ),
6165
+ data.filter((item) => item.type === "folder").map((folder) => /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(FolderTreeItem, { item: folder, level: 1 }, folder.id))
6166
+ ] });
6407
6167
  };
6408
- var MinimalVendorForm = FormVendor;
6409
6168
 
6410
- // src/components/common/FormClient.tsx
6411
- var import_react21 = require("react");
6169
+ // src/components/common/FileManager/components/FileGrid.tsx
6170
+ var import_lucide_react10 = require("lucide-react");
6412
6171
 
6413
- // src/components/common/FileManager/FileManager.tsx
6414
- var import_react18 = require("react");
6415
- var import_lucide_react16 = require("lucide-react");
6172
+ // src/components/common/FileManager/components/FileCard.tsx
6173
+ var import_react13 = require("react");
6416
6174
 
6417
- // src/components/common/FileManager/FileManagerContext.tsx
6418
- var import_react12 = require("react");
6419
- var import_jsx_runtime16 = require("react/jsx-runtime");
6420
- var defaultTexts = {
6421
- createFolder: "Cr\xE9er un dossier",
6422
- uploadFiles: "Uploader des fichiers",
6423
- rename: "Renommer",
6424
- delete: "Supprimer",
6425
- download: "T\xE9l\xE9charger",
6426
- open: "Ouvrir",
6427
- deselectAll: "Tout d\xE9s\xE9lectionner",
6428
- newFolderName: "Nom du dossier",
6429
- confirmDelete: "Voulez-vous vraiment supprimer",
6430
- noFiles: "Aucun fichier",
6431
- dropFilesHere: "D\xE9posez vos fichiers ici",
6432
- cancel: "Annuler",
6433
- confirm: "Confirmer"
6434
- };
6435
- var FileManagerContext = (0, import_react12.createContext)(null);
6436
- var useFileManager = () => {
6437
- const context = (0, import_react12.useContext)(FileManagerContext);
6438
- if (!context) {
6439
- throw new Error("useFileManager must be used within a FileManagerProvider");
6440
- }
6441
- return context;
6442
- };
6443
- var FileManagerProvider = ({
6444
- children,
6445
- data,
6446
- rootName = "Fichiers",
6447
- viewMode: initialViewMode = "grid",
6448
- allowMultiSelect = true,
6449
- allowUpload = true,
6450
- allowCreateFolder = true,
6451
- allowRename = true,
6452
- allowDelete = true,
6453
- allowDownload = true,
6454
- texts: customTexts = {},
6455
- onCreateFolder,
6456
- onUploadFiles,
6457
- onRename,
6458
- onDelete,
6459
- onDownload,
6460
- onOpen,
6461
- onSelect
6462
- }) => {
6463
- const rootFolder = (0, import_react12.useMemo)(
6464
- () => ({
6465
- id: "__root__",
6466
- name: rootName,
6467
- type: "folder",
6468
- path: "/",
6469
- children: data
6470
- }),
6471
- [data, rootName]
6472
- );
6473
- const [currentFolder, setCurrentFolder] = (0, import_react12.useState)(rootFolder);
6474
- const [pathHistory, setPathHistory] = (0, import_react12.useState)([rootFolder]);
6475
- const [selectedItems, setSelectedItems] = (0, import_react12.useState)([]);
6476
- const [viewMode, setViewMode] = (0, import_react12.useState)(initialViewMode);
6477
- const [renamingItem, setRenamingItem] = (0, import_react12.useState)(null);
6478
- const [contextMenu, setContextMenu] = (0, import_react12.useState)({
6479
- visible: false,
6480
- position: { x: 0, y: 0 },
6481
- item: null
6482
- });
6483
- const texts = (0, import_react12.useMemo)(() => ({ ...defaultTexts, ...customTexts }), [customTexts]);
6484
- const currentFolderContents = (0, import_react12.useMemo)(() => {
6485
- return currentFolder?.children || [];
6486
- }, [currentFolder]);
6487
- const navigateToFolder = (0, import_react12.useCallback)(
6488
- (folder) => {
6489
- if (!folder) {
6490
- setCurrentFolder(rootFolder);
6491
- setPathHistory([rootFolder]);
6492
- } else {
6493
- setCurrentFolder(folder);
6494
- setPathHistory((prev) => [...prev, folder]);
6495
- }
6496
- setSelectedItems([]);
6497
- setContextMenu({ visible: false, position: { x: 0, y: 0 }, item: null });
6498
- },
6499
- [rootFolder]
6500
- );
6501
- const navigateBack = (0, import_react12.useCallback)(() => {
6502
- if (pathHistory.length > 1) {
6503
- const newHistory = [...pathHistory];
6504
- newHistory.pop();
6505
- const previousFolder = newHistory[newHistory.length - 1];
6506
- setCurrentFolder(previousFolder);
6507
- setPathHistory(newHistory);
6508
- setSelectedItems([]);
6509
- }
6510
- }, [pathHistory]);
6511
- const navigateToPath = (0, import_react12.useCallback)(
6512
- (index) => {
6513
- if (index < pathHistory.length - 1) {
6514
- const newHistory = pathHistory.slice(0, index + 1);
6515
- setCurrentFolder(newHistory[newHistory.length - 1]);
6516
- setPathHistory(newHistory);
6517
- setSelectedItems([]);
6518
- }
6519
- },
6520
- [pathHistory]
6521
- );
6522
- const selectItem = (0, import_react12.useCallback)(
6523
- (item, multiSelect = false) => {
6524
- setSelectedItems((prev) => {
6525
- if (multiSelect && allowMultiSelect) {
6526
- const isSelected = prev.some((i) => i.id === item.id);
6527
- if (isSelected) {
6528
- return prev.filter((i) => i.id !== item.id);
6529
- }
6530
- return [...prev, item];
6531
- }
6532
- return [item];
6533
- });
6534
- if (onSelect) {
6535
- const newSelection = allowMultiSelect && multiSelect ? selectedItems.some((i) => i.id === item.id) ? selectedItems.filter((i) => i.id !== item.id) : [...selectedItems, item] : [item];
6536
- onSelect(newSelection);
6537
- }
6538
- },
6539
- [allowMultiSelect, onSelect, selectedItems]
6540
- );
6541
- const deselectAll = (0, import_react12.useCallback)(() => {
6542
- setSelectedItems([]);
6543
- if (onSelect) {
6544
- onSelect([]);
6545
- }
6546
- }, [onSelect]);
6547
- const showContextMenu = (0, import_react12.useCallback)((item, position) => {
6548
- setContextMenu({
6549
- visible: true,
6550
- position,
6551
- item
6552
- });
6553
- }, []);
6554
- const hideContextMenu = (0, import_react12.useCallback)(() => {
6555
- setContextMenu((prev) => ({ ...prev, visible: false }));
6556
- }, []);
6557
- const startRenaming = (0, import_react12.useCallback)((item) => {
6558
- setRenamingItem(item);
6559
- hideContextMenu();
6560
- }, [hideContextMenu]);
6561
- const stopRenaming = (0, import_react12.useCallback)(() => {
6562
- setRenamingItem(null);
6563
- }, []);
6564
- const contextValue = (0, import_react12.useMemo)(
6565
- () => ({
6566
- data,
6567
- currentFolder,
6568
- currentFolderContents,
6569
- pathHistory,
6570
- selectedItems,
6571
- viewMode,
6572
- contextMenu,
6573
- renamingItem,
6574
- navigateToFolder,
6575
- navigateBack,
6576
- navigateToPath,
6577
- selectItem,
6578
- deselectAll,
6579
- setViewMode,
6580
- showContextMenu,
6581
- hideContextMenu,
6582
- startRenaming,
6583
- stopRenaming,
6584
- onCreateFolder,
6585
- onUploadFiles,
6586
- onRename,
6587
- onDelete,
6588
- onDownload,
6589
- onOpen,
6590
- allowUpload,
6591
- allowCreateFolder,
6592
- allowRename,
6593
- allowDelete,
6594
- allowDownload,
6595
- allowMultiSelect,
6596
- texts
6597
- }),
6598
- [
6599
- data,
6600
- currentFolder,
6601
- currentFolderContents,
6602
- pathHistory,
6603
- selectedItems,
6604
- viewMode,
6605
- contextMenu,
6606
- renamingItem,
6607
- navigateToFolder,
6608
- navigateBack,
6609
- navigateToPath,
6610
- selectItem,
6611
- deselectAll,
6612
- showContextMenu,
6613
- hideContextMenu,
6614
- startRenaming,
6615
- stopRenaming,
6616
- onCreateFolder,
6617
- onUploadFiles,
6618
- onRename,
6619
- onDelete,
6620
- onDownload,
6621
- onOpen,
6622
- allowUpload,
6623
- allowCreateFolder,
6624
- allowRename,
6625
- allowDelete,
6626
- allowDownload,
6627
- allowMultiSelect,
6628
- texts
6629
- ]
6630
- );
6631
- return /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(FileManagerContext.Provider, { value: contextValue, children });
6632
- };
6633
-
6634
- // src/components/common/FileManager/components/FolderTree.tsx
6635
- var import_react13 = require("react");
6636
- var import_lucide_react9 = require("lucide-react");
6637
- var import_jsx_runtime17 = require("react/jsx-runtime");
6638
- var FolderTreeItem = ({ item, level }) => {
6639
- const { currentFolder, navigateToFolder, pathHistory } = useFileManager();
6640
- const [isExpanded, setIsExpanded] = (0, import_react13.useState)(
6641
- pathHistory.some((f) => f.id === item.id) || level === 0
6642
- );
6643
- const isSelected = currentFolder?.id === item.id;
6644
- const hasChildren = item.children?.some((child) => child.type === "folder");
6645
- const folderChildren = item.children?.filter((child) => child.type === "folder") || [];
6646
- const handleToggle = (e) => {
6647
- e.stopPropagation();
6648
- setIsExpanded(!isExpanded);
6649
- };
6650
- const handleClick = () => {
6651
- navigateToFolder(item);
6652
- if (!isExpanded) {
6653
- setIsExpanded(true);
6654
- }
6655
- };
6656
- return /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)("div", { children: [
6657
- /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)(
6658
- "div",
6659
- {
6660
- className: cn(
6661
- "flex items-center gap-1 py-1.5 px-2 rounded-lg cursor-pointer transition-colors",
6662
- "hover:bg-gray-100 dark:hover:bg-gray-800",
6663
- isSelected && "bg-blue-50 dark:bg-blue-900/30 text-blue-700 dark:text-blue-300"
6664
- ),
6665
- style: { paddingLeft: `${level * 12 + 8}px` },
6666
- onClick: handleClick,
6667
- children: [
6668
- hasChildren ? /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(
6669
- "button",
6670
- {
6671
- onClick: handleToggle,
6672
- className: "p-0.5 hover:bg-gray-200 dark:hover:bg-gray-700 rounded",
6673
- children: isExpanded ? /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(import_lucide_react9.ChevronDown, { className: "w-4 h-4 text-gray-500 dark:text-gray-400" }) : /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(import_lucide_react9.ChevronRight, { className: "w-4 h-4 text-gray-500 dark:text-gray-400" })
6674
- }
6675
- ) : /* @__PURE__ */ (0, import_jsx_runtime17.jsx)("span", { className: "w-5" }),
6676
- isExpanded ? /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(import_lucide_react9.FolderOpen, { className: "w-4 h-4 text-yellow-500 flex-shrink-0" }) : /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(import_lucide_react9.Folder, { className: "w-4 h-4 text-yellow-500 flex-shrink-0" }),
6677
- /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(
6678
- "span",
6679
- {
6680
- className: cn(
6681
- "text-sm truncate",
6682
- isSelected ? "font-medium" : "text-gray-700 dark:text-gray-300"
6683
- ),
6684
- children: item.name
6685
- }
6686
- )
6687
- ]
6688
- }
6689
- ),
6690
- isExpanded && folderChildren.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime17.jsx)("div", { children: folderChildren.map((child) => /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(FolderTreeItem, { item: child, level: level + 1 }, child.id)) })
6691
- ] });
6692
- };
6693
- var FolderTree = () => {
6694
- const { data, currentFolder, navigateToFolder } = useFileManager();
6695
- const rootItem = {
6696
- id: "__root__",
6697
- name: "Fichiers",
6698
- type: "folder",
6699
- path: "/",
6700
- children: data
6701
- };
6702
- const isRootSelected = currentFolder?.id === "__root__";
6703
- return /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)("div", { className: "h-full overflow-y-auto py-2", children: [
6704
- /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)(
6705
- "div",
6706
- {
6707
- className: cn(
6708
- "flex items-center gap-2 py-1.5 px-3 rounded-lg cursor-pointer transition-colors mb-1",
6709
- "hover:bg-gray-100 dark:hover:bg-gray-800",
6710
- isRootSelected && "bg-blue-50 dark:bg-blue-900/30 text-blue-700 dark:text-blue-300"
6711
- ),
6712
- onClick: () => navigateToFolder(rootItem),
6713
- children: [
6714
- /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(import_lucide_react9.Folder, { className: "w-4 h-4 text-yellow-500" }),
6715
- /* @__PURE__ */ (0, import_jsx_runtime17.jsx)("span", { className: cn("text-sm", isRootSelected && "font-medium"), children: rootItem.name })
6716
- ]
6717
- }
6718
- ),
6719
- data.filter((item) => item.type === "folder").map((folder) => /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(FolderTreeItem, { item: folder, level: 1 }, folder.id))
6720
- ] });
6721
- };
6722
-
6723
- // src/components/common/FileManager/components/FileGrid.tsx
6724
- var import_lucide_react11 = require("lucide-react");
6725
-
6726
- // src/components/common/FileManager/components/FileCard.tsx
6727
- var import_react14 = require("react");
6728
-
6729
- // src/components/common/FileManager/utils.ts
6730
- var import_lucide_react10 = require("lucide-react");
6731
- var getFileIcon = (mimeType, isFolder, isOpen) => {
6732
- if (isFolder) {
6733
- return isOpen ? import_lucide_react10.FolderOpen : import_lucide_react10.Folder;
6175
+ // src/components/common/FileManager/utils.ts
6176
+ var import_lucide_react9 = require("lucide-react");
6177
+ var getFileIcon = (mimeType, isFolder, isOpen) => {
6178
+ if (isFolder) {
6179
+ return isOpen ? import_lucide_react9.FolderOpen : import_lucide_react9.Folder;
6734
6180
  }
6735
6181
  if (!mimeType) {
6736
- return import_lucide_react10.File;
6182
+ return import_lucide_react9.File;
6737
6183
  }
6738
6184
  const type = mimeType.toLowerCase();
6739
6185
  if (type.startsWith("image/")) {
6740
- return import_lucide_react10.FileImage;
6186
+ return import_lucide_react9.FileImage;
6741
6187
  }
6742
6188
  if (type === "application/pdf") {
6743
- return import_lucide_react10.FileText;
6189
+ return import_lucide_react9.FileText;
6744
6190
  }
6745
6191
  if (type === "application/msword" || type === "application/vnd.openxmlformats-officedocument.wordprocessingml.document" || type.includes("word")) {
6746
- return import_lucide_react10.FileType;
6192
+ return import_lucide_react9.FileType;
6747
6193
  }
6748
6194
  if (type === "application/vnd.ms-excel" || type === "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet" || type.includes("excel") || type.includes("spreadsheet")) {
6749
- return import_lucide_react10.FileSpreadsheet;
6195
+ return import_lucide_react9.FileSpreadsheet;
6750
6196
  }
6751
6197
  if (type === "application/vnd.ms-powerpoint" || type === "application/vnd.openxmlformats-officedocument.presentationml.presentation" || type.includes("powerpoint") || type.includes("presentation")) {
6752
- return import_lucide_react10.FileType;
6198
+ return import_lucide_react9.FileType;
6753
6199
  }
6754
6200
  if (type === "application/zip" || type === "application/x-rar-compressed" || type === "application/x-7z-compressed" || type === "application/gzip" || type.includes("archive") || type.includes("compressed")) {
6755
- return import_lucide_react10.FileArchive;
6201
+ return import_lucide_react9.FileArchive;
6756
6202
  }
6757
6203
  if (type.startsWith("video/")) {
6758
- return import_lucide_react10.FileVideo;
6204
+ return import_lucide_react9.FileVideo;
6759
6205
  }
6760
6206
  if (type.startsWith("audio/")) {
6761
- return import_lucide_react10.FileAudio;
6207
+ return import_lucide_react9.FileAudio;
6762
6208
  }
6763
6209
  if (type.includes("javascript") || type.includes("typescript") || type.includes("json") || type.includes("xml") || type.includes("html") || type.includes("css")) {
6764
- return import_lucide_react10.FileCode;
6210
+ return import_lucide_react9.FileCode;
6765
6211
  }
6766
6212
  if (type.startsWith("text/")) {
6767
- return import_lucide_react10.FileText;
6213
+ return import_lucide_react9.FileText;
6768
6214
  }
6769
- return import_lucide_react10.File;
6215
+ return import_lucide_react9.File;
6770
6216
  };
6771
6217
  var formatFileSize = (bytes) => {
6772
6218
  if (bytes === void 0 || bytes === null) {
@@ -6796,7 +6242,7 @@ var formatDate = (date) => {
6796
6242
  };
6797
6243
 
6798
6244
  // src/components/common/FileManager/components/FileCard.tsx
6799
- var import_jsx_runtime18 = require("react/jsx-runtime");
6245
+ var import_jsx_runtime17 = require("react/jsx-runtime");
6800
6246
  var FileCard = ({ item, variant = "grid" }) => {
6801
6247
  const {
6802
6248
  selectedItems,
@@ -6810,19 +6256,19 @@ var FileCard = ({ item, variant = "grid" }) => {
6810
6256
  onDownload,
6811
6257
  allowRename
6812
6258
  } = useFileManager();
6813
- const [renameValue, setRenameValue] = (0, import_react14.useState)(item.name);
6814
- const inputRef = (0, import_react14.useRef)(null);
6259
+ const [renameValue, setRenameValue] = (0, import_react13.useState)(item.name);
6260
+ const inputRef = (0, import_react13.useRef)(null);
6815
6261
  const isSelected = selectedItems.some((i) => i.id === item.id);
6816
6262
  const isRenaming = renamingItem?.id === item.id;
6817
6263
  const isFolder = item.type === "folder";
6818
6264
  const Icon = getFileIcon(item.mimeType, isFolder);
6819
- (0, import_react14.useEffect)(() => {
6265
+ (0, import_react13.useEffect)(() => {
6820
6266
  if (isRenaming && inputRef.current) {
6821
6267
  inputRef.current.focus();
6822
6268
  inputRef.current.select();
6823
6269
  }
6824
6270
  }, [isRenaming]);
6825
- (0, import_react14.useEffect)(() => {
6271
+ (0, import_react13.useEffect)(() => {
6826
6272
  setRenameValue(item.name);
6827
6273
  }, [item.name]);
6828
6274
  const handleClick = (e) => {
@@ -6867,7 +6313,7 @@ var FileCard = ({ item, variant = "grid" }) => {
6867
6313
  }
6868
6314
  };
6869
6315
  if (variant === "list") {
6870
- return /* @__PURE__ */ (0, import_jsx_runtime18.jsxs)(
6316
+ return /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)(
6871
6317
  "div",
6872
6318
  {
6873
6319
  className: cn(
@@ -6879,7 +6325,7 @@ var FileCard = ({ item, variant = "grid" }) => {
6879
6325
  onDoubleClick: handleDoubleClick,
6880
6326
  onContextMenu: handleContextMenu,
6881
6327
  children: [
6882
- /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(
6328
+ /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(
6883
6329
  Icon,
6884
6330
  {
6885
6331
  className: cn(
@@ -6888,7 +6334,7 @@ var FileCard = ({ item, variant = "grid" }) => {
6888
6334
  )
6889
6335
  }
6890
6336
  ),
6891
- /* @__PURE__ */ (0, import_jsx_runtime18.jsx)("div", { className: "flex-1 min-w-0", children: isRenaming ? /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(
6337
+ /* @__PURE__ */ (0, import_jsx_runtime17.jsx)("div", { className: "flex-1 min-w-0", children: isRenaming ? /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(
6892
6338
  "input",
6893
6339
  {
6894
6340
  ref: inputRef,
@@ -6900,14 +6346,14 @@ var FileCard = ({ item, variant = "grid" }) => {
6900
6346
  className: "w-full px-2 py-0.5 text-sm border border-blue-500 rounded outline-none bg-white dark:bg-gray-900",
6901
6347
  onClick: (e) => e.stopPropagation()
6902
6348
  }
6903
- ) : /* @__PURE__ */ (0, import_jsx_runtime18.jsx)("span", { className: "block truncate text-sm text-gray-900 dark:text-gray-100", children: item.name }) }),
6904
- /* @__PURE__ */ (0, import_jsx_runtime18.jsx)("span", { className: "text-xs text-gray-500 dark:text-gray-400 w-20 text-right", children: !isFolder && formatFileSize(item.size) }),
6905
- /* @__PURE__ */ (0, import_jsx_runtime18.jsx)("span", { className: "text-xs text-gray-500 dark:text-gray-400 w-24 text-right", children: formatDate(item.updatedAt || item.createdAt) })
6349
+ ) : /* @__PURE__ */ (0, import_jsx_runtime17.jsx)("span", { className: "block truncate text-sm text-gray-900 dark:text-gray-100", children: item.name }) }),
6350
+ /* @__PURE__ */ (0, import_jsx_runtime17.jsx)("span", { className: "text-xs text-gray-500 dark:text-gray-400 w-20 text-right", children: !isFolder && formatFileSize(item.size) }),
6351
+ /* @__PURE__ */ (0, import_jsx_runtime17.jsx)("span", { className: "text-xs text-gray-500 dark:text-gray-400 w-24 text-right", children: formatDate(item.updatedAt || item.createdAt) })
6906
6352
  ]
6907
6353
  }
6908
6354
  );
6909
6355
  }
6910
- return /* @__PURE__ */ (0, import_jsx_runtime18.jsxs)(
6356
+ return /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)(
6911
6357
  "div",
6912
6358
  {
6913
6359
  className: cn(
@@ -6919,7 +6365,7 @@ var FileCard = ({ item, variant = "grid" }) => {
6919
6365
  onDoubleClick: handleDoubleClick,
6920
6366
  onContextMenu: handleContextMenu,
6921
6367
  children: [
6922
- /* @__PURE__ */ (0, import_jsx_runtime18.jsx)("div", { className: "w-16 h-16 flex items-center justify-center mb-2", children: /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(
6368
+ /* @__PURE__ */ (0, import_jsx_runtime17.jsx)("div", { className: "w-16 h-16 flex items-center justify-center mb-2", children: /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(
6923
6369
  Icon,
6924
6370
  {
6925
6371
  className: cn(
@@ -6928,7 +6374,7 @@ var FileCard = ({ item, variant = "grid" }) => {
6928
6374
  )
6929
6375
  }
6930
6376
  ) }),
6931
- /* @__PURE__ */ (0, import_jsx_runtime18.jsx)("div", { className: "w-full text-center", children: isRenaming ? /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(
6377
+ /* @__PURE__ */ (0, import_jsx_runtime17.jsx)("div", { className: "w-full text-center", children: isRenaming ? /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(
6932
6378
  "input",
6933
6379
  {
6934
6380
  ref: inputRef,
@@ -6940,15 +6386,15 @@ var FileCard = ({ item, variant = "grid" }) => {
6940
6386
  className: "w-full px-2 py-0.5 text-xs border border-blue-500 rounded outline-none text-center bg-white dark:bg-gray-900",
6941
6387
  onClick: (e) => e.stopPropagation()
6942
6388
  }
6943
- ) : /* @__PURE__ */ (0, import_jsx_runtime18.jsx)("span", { className: "block text-xs text-gray-900 dark:text-gray-100 truncate px-1", children: item.name }) }),
6944
- !isFolder && /* @__PURE__ */ (0, import_jsx_runtime18.jsx)("span", { className: "text-[10px] text-gray-500 dark:text-gray-400 mt-1", children: formatFileSize(item.size) })
6389
+ ) : /* @__PURE__ */ (0, import_jsx_runtime17.jsx)("span", { className: "block text-xs text-gray-900 dark:text-gray-100 truncate px-1", children: item.name }) }),
6390
+ !isFolder && /* @__PURE__ */ (0, import_jsx_runtime17.jsx)("span", { className: "text-[10px] text-gray-500 dark:text-gray-400 mt-1", children: formatFileSize(item.size) })
6945
6391
  ]
6946
6392
  }
6947
6393
  );
6948
6394
  };
6949
6395
 
6950
6396
  // src/components/common/FileManager/components/FileGrid.tsx
6951
- var import_jsx_runtime19 = require("react/jsx-runtime");
6397
+ var import_jsx_runtime18 = require("react/jsx-runtime");
6952
6398
  var FileGrid = () => {
6953
6399
  const { currentFolderContents, texts, deselectAll, hideContextMenu } = useFileManager();
6954
6400
  const sortedItems = [...currentFolderContents].sort((a, b) => {
@@ -6961,32 +6407,32 @@ var FileGrid = () => {
6961
6407
  hideContextMenu();
6962
6408
  };
6963
6409
  if (sortedItems.length === 0) {
6964
- return /* @__PURE__ */ (0, import_jsx_runtime19.jsxs)(
6410
+ return /* @__PURE__ */ (0, import_jsx_runtime18.jsxs)(
6965
6411
  "div",
6966
6412
  {
6967
6413
  className: "flex-1 flex flex-col items-center justify-center text-gray-500 dark:text-gray-400 p-8",
6968
6414
  onClick: handleContainerClick,
6969
6415
  children: [
6970
- /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(import_lucide_react11.FolderPlus, { className: "w-16 h-16 mb-4 opacity-50" }),
6971
- /* @__PURE__ */ (0, import_jsx_runtime19.jsx)("p", { className: "text-lg", children: texts.noFiles }),
6972
- /* @__PURE__ */ (0, import_jsx_runtime19.jsx)("p", { className: "text-sm mt-2", children: texts.dropFilesHere })
6416
+ /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(import_lucide_react10.FolderPlus, { className: "w-16 h-16 mb-4 opacity-50" }),
6417
+ /* @__PURE__ */ (0, import_jsx_runtime18.jsx)("p", { className: "text-lg", children: texts.noFiles }),
6418
+ /* @__PURE__ */ (0, import_jsx_runtime18.jsx)("p", { className: "text-sm mt-2", children: texts.dropFilesHere })
6973
6419
  ]
6974
6420
  }
6975
6421
  );
6976
6422
  }
6977
- return /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(
6423
+ return /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(
6978
6424
  "div",
6979
6425
  {
6980
6426
  className: "flex-1 overflow-y-auto p-4",
6981
6427
  onClick: handleContainerClick,
6982
- children: /* @__PURE__ */ (0, import_jsx_runtime19.jsx)("div", { className: "grid grid-cols-2 sm:grid-cols-3 md:grid-cols-4 lg:grid-cols-5 xl:grid-cols-6 gap-2", children: sortedItems.map((item) => /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(FileCard, { item, variant: "grid" }, item.id)) })
6428
+ children: /* @__PURE__ */ (0, import_jsx_runtime18.jsx)("div", { className: "grid grid-cols-2 sm:grid-cols-3 md:grid-cols-4 lg:grid-cols-5 xl:grid-cols-6 gap-2", children: sortedItems.map((item) => /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(FileCard, { item, variant: "grid" }, item.id)) })
6983
6429
  }
6984
6430
  );
6985
6431
  };
6986
6432
 
6987
6433
  // src/components/common/FileManager/components/FileList.tsx
6988
- var import_lucide_react12 = require("lucide-react");
6989
- var import_jsx_runtime20 = require("react/jsx-runtime");
6434
+ var import_lucide_react11 = require("lucide-react");
6435
+ var import_jsx_runtime19 = require("react/jsx-runtime");
6990
6436
  var FileList = () => {
6991
6437
  const { currentFolderContents, texts, deselectAll, hideContextMenu } = useFileManager();
6992
6438
  const sortedItems = [...currentFolderContents].sort((a, b) => {
@@ -6999,46 +6445,46 @@ var FileList = () => {
6999
6445
  hideContextMenu();
7000
6446
  };
7001
6447
  if (sortedItems.length === 0) {
7002
- return /* @__PURE__ */ (0, import_jsx_runtime20.jsxs)(
6448
+ return /* @__PURE__ */ (0, import_jsx_runtime19.jsxs)(
7003
6449
  "div",
7004
6450
  {
7005
6451
  className: "flex-1 flex flex-col items-center justify-center text-gray-500 dark:text-gray-400 p-8",
7006
6452
  onClick: handleContainerClick,
7007
6453
  children: [
7008
- /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(import_lucide_react12.FolderPlus, { className: "w-16 h-16 mb-4 opacity-50" }),
7009
- /* @__PURE__ */ (0, import_jsx_runtime20.jsx)("p", { className: "text-lg", children: texts.noFiles }),
7010
- /* @__PURE__ */ (0, import_jsx_runtime20.jsx)("p", { className: "text-sm mt-2", children: texts.dropFilesHere })
6454
+ /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(import_lucide_react11.FolderPlus, { className: "w-16 h-16 mb-4 opacity-50" }),
6455
+ /* @__PURE__ */ (0, import_jsx_runtime19.jsx)("p", { className: "text-lg", children: texts.noFiles }),
6456
+ /* @__PURE__ */ (0, import_jsx_runtime19.jsx)("p", { className: "text-sm mt-2", children: texts.dropFilesHere })
7011
6457
  ]
7012
6458
  }
7013
6459
  );
7014
6460
  }
7015
- return /* @__PURE__ */ (0, import_jsx_runtime20.jsxs)(
6461
+ return /* @__PURE__ */ (0, import_jsx_runtime19.jsxs)(
7016
6462
  "div",
7017
6463
  {
7018
6464
  className: "flex-1 overflow-y-auto p-4",
7019
6465
  onClick: handleContainerClick,
7020
6466
  children: [
7021
- /* @__PURE__ */ (0, import_jsx_runtime20.jsxs)("div", { className: "flex items-center gap-3 px-3 py-2 text-xs font-medium text-gray-500 dark:text-gray-400 uppercase tracking-wider border-b border-gray-200 dark:border-gray-700 mb-2", children: [
7022
- /* @__PURE__ */ (0, import_jsx_runtime20.jsx)("span", { className: "w-5" }),
6467
+ /* @__PURE__ */ (0, import_jsx_runtime19.jsxs)("div", { className: "flex items-center gap-3 px-3 py-2 text-xs font-medium text-gray-500 dark:text-gray-400 uppercase tracking-wider border-b border-gray-200 dark:border-gray-700 mb-2", children: [
6468
+ /* @__PURE__ */ (0, import_jsx_runtime19.jsx)("span", { className: "w-5" }),
7023
6469
  " ",
7024
- /* @__PURE__ */ (0, import_jsx_runtime20.jsx)("span", { className: "flex-1", children: "Nom" }),
7025
- /* @__PURE__ */ (0, import_jsx_runtime20.jsx)("span", { className: "w-20 text-right", children: "Taille" }),
7026
- /* @__PURE__ */ (0, import_jsx_runtime20.jsx)("span", { className: "w-24 text-right", children: "Modifi\xE9" })
6470
+ /* @__PURE__ */ (0, import_jsx_runtime19.jsx)("span", { className: "flex-1", children: "Nom" }),
6471
+ /* @__PURE__ */ (0, import_jsx_runtime19.jsx)("span", { className: "w-20 text-right", children: "Taille" }),
6472
+ /* @__PURE__ */ (0, import_jsx_runtime19.jsx)("span", { className: "w-24 text-right", children: "Modifi\xE9" })
7027
6473
  ] }),
7028
- /* @__PURE__ */ (0, import_jsx_runtime20.jsx)("div", { className: "space-y-1", children: sortedItems.map((item) => /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(FileCard, { item, variant: "list" }, item.id)) })
6474
+ /* @__PURE__ */ (0, import_jsx_runtime19.jsx)("div", { className: "space-y-1", children: sortedItems.map((item) => /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(FileCard, { item, variant: "list" }, item.id)) })
7029
6475
  ]
7030
6476
  }
7031
6477
  );
7032
6478
  };
7033
6479
 
7034
6480
  // src/components/common/FileManager/components/Breadcrumb.tsx
7035
- var import_react15 = __toESM(require("react"), 1);
7036
- var import_lucide_react13 = require("lucide-react");
7037
- var import_jsx_runtime21 = require("react/jsx-runtime");
6481
+ var import_react14 = __toESM(require("react"), 1);
6482
+ var import_lucide_react12 = require("lucide-react");
6483
+ var import_jsx_runtime20 = require("react/jsx-runtime");
7038
6484
  var Breadcrumb = () => {
7039
6485
  const { pathHistory, navigateBack, navigateToPath } = useFileManager();
7040
- return /* @__PURE__ */ (0, import_jsx_runtime21.jsxs)("div", { className: "flex items-center gap-1 px-2 py-2 bg-gray-50 dark:bg-gray-800/50 rounded-lg", children: [
7041
- /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(
6486
+ return /* @__PURE__ */ (0, import_jsx_runtime20.jsxs)("div", { className: "flex items-center gap-1 px-2 py-2 bg-gray-50 dark:bg-gray-800/50 rounded-lg", children: [
6487
+ /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(
7042
6488
  "button",
7043
6489
  {
7044
6490
  onClick: navigateBack,
@@ -7048,12 +6494,12 @@ var Breadcrumb = () => {
7048
6494
  pathHistory.length > 1 ? "hover:bg-gray-200 dark:hover:bg-gray-700 text-gray-700 dark:text-gray-300" : "text-gray-400 dark:text-gray-600 cursor-not-allowed"
7049
6495
  ),
7050
6496
  title: "Retour",
7051
- children: /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(import_lucide_react13.ChevronLeft, { className: "w-4 h-4" })
6497
+ children: /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(import_lucide_react12.ChevronLeft, { className: "w-4 h-4" })
7052
6498
  }
7053
6499
  ),
7054
- /* @__PURE__ */ (0, import_jsx_runtime21.jsx)("div", { className: "flex items-center gap-1 overflow-x-auto scrollbar-thin", children: pathHistory.map((folder, index) => /* @__PURE__ */ (0, import_jsx_runtime21.jsxs)(import_react15.default.Fragment, { children: [
7055
- index > 0 && /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(import_lucide_react13.ChevronRight, { className: "w-4 h-4 text-gray-400 dark:text-gray-600 flex-shrink-0" }),
7056
- /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(
6500
+ /* @__PURE__ */ (0, import_jsx_runtime20.jsx)("div", { className: "flex items-center gap-1 overflow-x-auto scrollbar-thin", children: pathHistory.map((folder, index) => /* @__PURE__ */ (0, import_jsx_runtime20.jsxs)(import_react14.default.Fragment, { children: [
6501
+ index > 0 && /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(import_lucide_react12.ChevronRight, { className: "w-4 h-4 text-gray-400 dark:text-gray-600 flex-shrink-0" }),
6502
+ /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(
7057
6503
  "button",
7058
6504
  {
7059
6505
  onClick: () => navigateToPath(index),
@@ -7069,18 +6515,18 @@ var Breadcrumb = () => {
7069
6515
  };
7070
6516
 
7071
6517
  // src/components/common/FileManager/components/Toolbar.tsx
7072
- var import_react16 = __toESM(require("react"), 1);
7073
- var import_lucide_react14 = require("lucide-react");
7074
- var import_jsx_runtime22 = require("react/jsx-runtime");
6518
+ var import_react15 = __toESM(require("react"), 1);
6519
+ var import_lucide_react13 = require("lucide-react");
6520
+ var import_jsx_runtime21 = require("react/jsx-runtime");
7075
6521
  var CreateFolderModal = ({
7076
6522
  isOpen,
7077
6523
  onClose,
7078
6524
  onSubmit,
7079
6525
  texts
7080
6526
  }) => {
7081
- const [folderName, setFolderName] = (0, import_react16.useState)("");
7082
- const inputRef = (0, import_react16.useRef)(null);
7083
- import_react16.default.useEffect(() => {
6527
+ const [folderName, setFolderName] = (0, import_react15.useState)("");
6528
+ const inputRef = (0, import_react15.useRef)(null);
6529
+ import_react15.default.useEffect(() => {
7084
6530
  if (isOpen && inputRef.current) {
7085
6531
  inputRef.current.focus();
7086
6532
  }
@@ -7097,21 +6543,21 @@ var CreateFolderModal = ({
7097
6543
  }
7098
6544
  };
7099
6545
  if (!isOpen) return null;
7100
- return /* @__PURE__ */ (0, import_jsx_runtime22.jsx)("div", { className: "fixed inset-0 z-50 flex items-center justify-center bg-black/50", children: /* @__PURE__ */ (0, import_jsx_runtime22.jsxs)("div", { className: "bg-white dark:bg-gray-900 rounded-xl shadow-xl p-6 w-full max-w-md mx-4", children: [
7101
- /* @__PURE__ */ (0, import_jsx_runtime22.jsxs)("div", { className: "flex items-center justify-between mb-4", children: [
7102
- /* @__PURE__ */ (0, import_jsx_runtime22.jsx)("h3", { className: "text-lg font-semibold text-gray-900 dark:text-gray-100", children: texts.createFolder }),
7103
- /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(
6546
+ return /* @__PURE__ */ (0, import_jsx_runtime21.jsx)("div", { className: "fixed inset-0 z-50 flex items-center justify-center bg-black/50", children: /* @__PURE__ */ (0, import_jsx_runtime21.jsxs)("div", { className: "bg-white dark:bg-gray-900 rounded-xl shadow-xl p-6 w-full max-w-md mx-4", children: [
6547
+ /* @__PURE__ */ (0, import_jsx_runtime21.jsxs)("div", { className: "flex items-center justify-between mb-4", children: [
6548
+ /* @__PURE__ */ (0, import_jsx_runtime21.jsx)("h3", { className: "text-lg font-semibold text-gray-900 dark:text-gray-100", children: texts.createFolder }),
6549
+ /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(
7104
6550
  "button",
7105
6551
  {
7106
6552
  onClick: onClose,
7107
6553
  className: "p-1 rounded-md hover:bg-gray-100 dark:hover:bg-gray-800 transition-colors",
7108
- children: /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(import_lucide_react14.X, { className: "w-5 h-5 text-gray-500" })
6554
+ children: /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(import_lucide_react13.X, { className: "w-5 h-5 text-gray-500" })
7109
6555
  }
7110
6556
  )
7111
6557
  ] }),
7112
- /* @__PURE__ */ (0, import_jsx_runtime22.jsxs)("form", { onSubmit: handleSubmit, children: [
7113
- /* @__PURE__ */ (0, import_jsx_runtime22.jsx)("label", { className: "block text-sm font-medium text-gray-700 dark:text-gray-300 mb-2", children: texts.newFolderName }),
7114
- /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(
6558
+ /* @__PURE__ */ (0, import_jsx_runtime21.jsxs)("form", { onSubmit: handleSubmit, children: [
6559
+ /* @__PURE__ */ (0, import_jsx_runtime21.jsx)("label", { className: "block text-sm font-medium text-gray-700 dark:text-gray-300 mb-2", children: texts.newFolderName }),
6560
+ /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(
7115
6561
  "input",
7116
6562
  {
7117
6563
  ref: inputRef,
@@ -7122,8 +6568,8 @@ var CreateFolderModal = ({
7122
6568
  placeholder: "Nouveau dossier"
7123
6569
  }
7124
6570
  ),
7125
- /* @__PURE__ */ (0, import_jsx_runtime22.jsxs)("div", { className: "flex justify-end gap-3 mt-6", children: [
7126
- /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(
6571
+ /* @__PURE__ */ (0, import_jsx_runtime21.jsxs)("div", { className: "flex justify-end gap-3 mt-6", children: [
6572
+ /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(
7127
6573
  "button",
7128
6574
  {
7129
6575
  type: "button",
@@ -7132,7 +6578,7 @@ var CreateFolderModal = ({
7132
6578
  children: texts.cancel
7133
6579
  }
7134
6580
  ),
7135
- /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(
6581
+ /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(
7136
6582
  "button",
7137
6583
  {
7138
6584
  type: "submit",
@@ -7161,8 +6607,8 @@ var Toolbar = () => {
7161
6607
  allowUpload,
7162
6608
  texts
7163
6609
  } = useFileManager();
7164
- const [showCreateModal, setShowCreateModal] = (0, import_react16.useState)(false);
7165
- const fileInputRef = (0, import_react16.useRef)(null);
6610
+ const [showCreateModal, setShowCreateModal] = (0, import_react15.useState)(false);
6611
+ const fileInputRef = (0, import_react15.useRef)(null);
7166
6612
  const handleCreateFolder = async (name) => {
7167
6613
  if (onCreateFolder && currentFolder) {
7168
6614
  try {
@@ -7188,10 +6634,10 @@ var Toolbar = () => {
7188
6634
  fileInputRef.current.value = "";
7189
6635
  }
7190
6636
  };
7191
- return /* @__PURE__ */ (0, import_jsx_runtime22.jsxs)(import_jsx_runtime22.Fragment, { children: [
7192
- /* @__PURE__ */ (0, import_jsx_runtime22.jsxs)("div", { className: "flex items-center justify-between gap-4 flex-wrap", children: [
7193
- /* @__PURE__ */ (0, import_jsx_runtime22.jsxs)("div", { className: "flex items-center gap-2", children: [
7194
- allowCreateFolder && /* @__PURE__ */ (0, import_jsx_runtime22.jsxs)(
6637
+ return /* @__PURE__ */ (0, import_jsx_runtime21.jsxs)(import_jsx_runtime21.Fragment, { children: [
6638
+ /* @__PURE__ */ (0, import_jsx_runtime21.jsxs)("div", { className: "flex items-center justify-between gap-4 flex-wrap", children: [
6639
+ /* @__PURE__ */ (0, import_jsx_runtime21.jsxs)("div", { className: "flex items-center gap-2", children: [
6640
+ allowCreateFolder && /* @__PURE__ */ (0, import_jsx_runtime21.jsxs)(
7195
6641
  "button",
7196
6642
  {
7197
6643
  onClick: () => setShowCreateModal(true),
@@ -7201,13 +6647,13 @@ var Toolbar = () => {
7201
6647
  "hover:bg-gray-200 dark:hover:bg-gray-700"
7202
6648
  ),
7203
6649
  children: [
7204
- /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(import_lucide_react14.FolderPlus, { className: "w-4 h-4" }),
7205
- /* @__PURE__ */ (0, import_jsx_runtime22.jsx)("span", { className: "hidden sm:inline", children: texts.createFolder })
6650
+ /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(import_lucide_react13.FolderPlus, { className: "w-4 h-4" }),
6651
+ /* @__PURE__ */ (0, import_jsx_runtime21.jsx)("span", { className: "hidden sm:inline", children: texts.createFolder })
7206
6652
  ]
7207
6653
  }
7208
6654
  ),
7209
- allowUpload && /* @__PURE__ */ (0, import_jsx_runtime22.jsxs)(import_jsx_runtime22.Fragment, { children: [
7210
- /* @__PURE__ */ (0, import_jsx_runtime22.jsxs)(
6655
+ allowUpload && /* @__PURE__ */ (0, import_jsx_runtime21.jsxs)(import_jsx_runtime21.Fragment, { children: [
6656
+ /* @__PURE__ */ (0, import_jsx_runtime21.jsxs)(
7211
6657
  "button",
7212
6658
  {
7213
6659
  onClick: handleUploadClick,
@@ -7216,12 +6662,12 @@ var Toolbar = () => {
7216
6662
  "bg-blue-600 text-white hover:bg-blue-700"
7217
6663
  ),
7218
6664
  children: [
7219
- /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(import_lucide_react14.Upload, { className: "w-4 h-4" }),
7220
- /* @__PURE__ */ (0, import_jsx_runtime22.jsx)("span", { className: "hidden sm:inline", children: texts.uploadFiles })
6665
+ /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(import_lucide_react13.Upload, { className: "w-4 h-4" }),
6666
+ /* @__PURE__ */ (0, import_jsx_runtime21.jsx)("span", { className: "hidden sm:inline", children: texts.uploadFiles })
7221
6667
  ]
7222
6668
  }
7223
6669
  ),
7224
- /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(
6670
+ /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(
7225
6671
  "input",
7226
6672
  {
7227
6673
  ref: fileInputRef,
@@ -7234,14 +6680,14 @@ var Toolbar = () => {
7234
6680
  )
7235
6681
  ] })
7236
6682
  ] }),
7237
- /* @__PURE__ */ (0, import_jsx_runtime22.jsxs)("div", { className: "flex items-center gap-2", children: [
7238
- selectedItems.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime22.jsxs)(
6683
+ /* @__PURE__ */ (0, import_jsx_runtime21.jsxs)("div", { className: "flex items-center gap-2", children: [
6684
+ selectedItems.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime21.jsxs)(
7239
6685
  "button",
7240
6686
  {
7241
6687
  onClick: deselectAll,
7242
6688
  className: "flex items-center gap-2 px-3 py-2 text-sm text-gray-600 dark:text-gray-400\r\n hover:text-gray-900 dark:hover:text-gray-100 transition-colors",
7243
6689
  children: [
7244
- /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(import_lucide_react14.X, { className: "w-4 h-4" }),
6690
+ /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(import_lucide_react13.X, { className: "w-4 h-4" }),
7245
6691
  texts.deselectAll,
7246
6692
  " (",
7247
6693
  selectedItems.length,
@@ -7249,8 +6695,8 @@ var Toolbar = () => {
7249
6695
  ]
7250
6696
  }
7251
6697
  ),
7252
- /* @__PURE__ */ (0, import_jsx_runtime22.jsxs)("div", { className: "flex items-center bg-gray-100 dark:bg-gray-800 rounded-lg p-1", children: [
7253
- /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(
6698
+ /* @__PURE__ */ (0, import_jsx_runtime21.jsxs)("div", { className: "flex items-center bg-gray-100 dark:bg-gray-800 rounded-lg p-1", children: [
6699
+ /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(
7254
6700
  "button",
7255
6701
  {
7256
6702
  onClick: () => setViewMode("grid"),
@@ -7259,10 +6705,10 @@ var Toolbar = () => {
7259
6705
  viewMode === "grid" ? "bg-white dark:bg-gray-700 shadow-sm text-gray-900 dark:text-gray-100" : "text-gray-500 hover:text-gray-700 dark:text-gray-400 dark:hover:text-gray-200"
7260
6706
  ),
7261
6707
  title: "Vue grille",
7262
- children: /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(import_lucide_react14.Grid, { className: "w-4 h-4" })
6708
+ children: /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(import_lucide_react13.Grid, { className: "w-4 h-4" })
7263
6709
  }
7264
6710
  ),
7265
- /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(
6711
+ /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(
7266
6712
  "button",
7267
6713
  {
7268
6714
  onClick: () => setViewMode("list"),
@@ -7271,13 +6717,13 @@ var Toolbar = () => {
7271
6717
  viewMode === "list" ? "bg-white dark:bg-gray-700 shadow-sm text-gray-900 dark:text-gray-100" : "text-gray-500 hover:text-gray-700 dark:text-gray-400 dark:hover:text-gray-200"
7272
6718
  ),
7273
6719
  title: "Vue liste",
7274
- children: /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(import_lucide_react14.List, { className: "w-4 h-4" })
6720
+ children: /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(import_lucide_react13.List, { className: "w-4 h-4" })
7275
6721
  }
7276
6722
  )
7277
6723
  ] })
7278
6724
  ] })
7279
6725
  ] }),
7280
- /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(
6726
+ /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(
7281
6727
  CreateFolderModal,
7282
6728
  {
7283
6729
  isOpen: showCreateModal,
@@ -7290,9 +6736,9 @@ var Toolbar = () => {
7290
6736
  };
7291
6737
 
7292
6738
  // src/components/common/FileManager/components/ContextMenu.tsx
7293
- var import_react17 = require("react");
7294
- var import_lucide_react15 = require("lucide-react");
7295
- var import_jsx_runtime23 = require("react/jsx-runtime");
6739
+ var import_react16 = require("react");
6740
+ var import_lucide_react14 = require("lucide-react");
6741
+ var import_jsx_runtime22 = require("react/jsx-runtime");
7296
6742
  var ContextMenu = () => {
7297
6743
  const {
7298
6744
  contextMenu,
@@ -7307,8 +6753,8 @@ var ContextMenu = () => {
7307
6753
  allowDownload,
7308
6754
  texts
7309
6755
  } = useFileManager();
7310
- const menuRef = (0, import_react17.useRef)(null);
7311
- (0, import_react17.useEffect)(() => {
6756
+ const menuRef = (0, import_react16.useRef)(null);
6757
+ (0, import_react16.useEffect)(() => {
7312
6758
  const handleClickOutside = (e) => {
7313
6759
  if (menuRef.current && !menuRef.current.contains(e.target)) {
7314
6760
  hideContextMenu();
@@ -7378,14 +6824,14 @@ var ContextMenu = () => {
7378
6824
  menuStyle.top = position.y - menuHeight;
7379
6825
  }
7380
6826
  }
7381
- return /* @__PURE__ */ (0, import_jsx_runtime23.jsxs)(
6827
+ return /* @__PURE__ */ (0, import_jsx_runtime22.jsxs)(
7382
6828
  "div",
7383
6829
  {
7384
6830
  ref: menuRef,
7385
6831
  style: menuStyle,
7386
6832
  className: "bg-white dark:bg-gray-900 rounded-lg shadow-lg border border-gray-200 dark:border-gray-700 py-1 min-w-[160px]",
7387
6833
  children: [
7388
- /* @__PURE__ */ (0, import_jsx_runtime23.jsxs)(
6834
+ /* @__PURE__ */ (0, import_jsx_runtime22.jsxs)(
7389
6835
  "button",
7390
6836
  {
7391
6837
  onClick: handleOpen,
@@ -7394,12 +6840,12 @@ var ContextMenu = () => {
7394
6840
  "text-gray-700 dark:text-gray-200 hover:bg-gray-100 dark:hover:bg-gray-800 transition-colors"
7395
6841
  ),
7396
6842
  children: [
7397
- /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(import_lucide_react15.FolderOpen, { className: "w-4 h-4" }),
6843
+ /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(import_lucide_react14.FolderOpen, { className: "w-4 h-4" }),
7398
6844
  texts.open
7399
6845
  ]
7400
6846
  }
7401
6847
  ),
7402
- allowRename && /* @__PURE__ */ (0, import_jsx_runtime23.jsxs)(
6848
+ allowRename && /* @__PURE__ */ (0, import_jsx_runtime22.jsxs)(
7403
6849
  "button",
7404
6850
  {
7405
6851
  onClick: handleRename,
@@ -7408,12 +6854,12 @@ var ContextMenu = () => {
7408
6854
  "text-gray-700 dark:text-gray-200 hover:bg-gray-100 dark:hover:bg-gray-800 transition-colors"
7409
6855
  ),
7410
6856
  children: [
7411
- /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(import_lucide_react15.Edit3, { className: "w-4 h-4" }),
6857
+ /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(import_lucide_react14.Edit3, { className: "w-4 h-4" }),
7412
6858
  texts.rename
7413
6859
  ]
7414
6860
  }
7415
6861
  ),
7416
- allowDownload && /* @__PURE__ */ (0, import_jsx_runtime23.jsxs)(
6862
+ allowDownload && /* @__PURE__ */ (0, import_jsx_runtime22.jsxs)(
7417
6863
  "button",
7418
6864
  {
7419
6865
  onClick: handleDownload,
@@ -7422,14 +6868,14 @@ var ContextMenu = () => {
7422
6868
  "text-gray-700 dark:text-gray-200 hover:bg-gray-100 dark:hover:bg-gray-800 transition-colors"
7423
6869
  ),
7424
6870
  children: [
7425
- /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(import_lucide_react15.Download, { className: "w-4 h-4" }),
6871
+ /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(import_lucide_react14.Download, { className: "w-4 h-4" }),
7426
6872
  texts.download
7427
6873
  ]
7428
6874
  }
7429
6875
  ),
7430
- allowDelete && /* @__PURE__ */ (0, import_jsx_runtime23.jsxs)(import_jsx_runtime23.Fragment, { children: [
7431
- /* @__PURE__ */ (0, import_jsx_runtime23.jsx)("div", { className: "border-t border-gray-200 dark:border-gray-700 my-1" }),
7432
- /* @__PURE__ */ (0, import_jsx_runtime23.jsxs)(
6876
+ allowDelete && /* @__PURE__ */ (0, import_jsx_runtime22.jsxs)(import_jsx_runtime22.Fragment, { children: [
6877
+ /* @__PURE__ */ (0, import_jsx_runtime22.jsx)("div", { className: "border-t border-gray-200 dark:border-gray-700 my-1" }),
6878
+ /* @__PURE__ */ (0, import_jsx_runtime22.jsxs)(
7433
6879
  "button",
7434
6880
  {
7435
6881
  onClick: handleDelete,
@@ -7438,7 +6884,7 @@ var ContextMenu = () => {
7438
6884
  "text-red-600 dark:text-red-400 hover:bg-red-50 dark:hover:bg-red-900/20 transition-colors"
7439
6885
  ),
7440
6886
  children: [
7441
- /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(import_lucide_react15.Trash2, { className: "w-4 h-4" }),
6887
+ /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(import_lucide_react14.Trash2, { className: "w-4 h-4" }),
7442
6888
  texts.delete
7443
6889
  ]
7444
6890
  }
@@ -7450,14 +6896,14 @@ var ContextMenu = () => {
7450
6896
  };
7451
6897
 
7452
6898
  // src/components/common/FileManager/FileManager.tsx
7453
- var import_jsx_runtime24 = require("react/jsx-runtime");
6899
+ var import_jsx_runtime23 = require("react/jsx-runtime");
7454
6900
  var FileManagerContent = ({ className }) => {
7455
6901
  const { viewMode, hideContextMenu } = useFileManager();
7456
- const [sidebarOpen, setSidebarOpen] = (0, import_react18.useState)(false);
6902
+ const [sidebarOpen, setSidebarOpen] = (0, import_react17.useState)(false);
7457
6903
  const handleMainClick = () => {
7458
6904
  hideContextMenu();
7459
6905
  };
7460
- return /* @__PURE__ */ (0, import_jsx_runtime24.jsxs)(
6906
+ return /* @__PURE__ */ (0, import_jsx_runtime23.jsxs)(
7461
6907
  "div",
7462
6908
  {
7463
6909
  className: cn(
@@ -7466,7 +6912,7 @@ var FileManagerContent = ({ className }) => {
7466
6912
  ),
7467
6913
  onClick: handleMainClick,
7468
6914
  children: [
7469
- /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(
6915
+ /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(
7470
6916
  "button",
7471
6917
  {
7472
6918
  onClick: (e) => {
@@ -7474,17 +6920,17 @@ var FileManagerContent = ({ className }) => {
7474
6920
  setSidebarOpen(!sidebarOpen);
7475
6921
  },
7476
6922
  className: "md:hidden fixed bottom-4 left-4 z-50 p-3 bg-blue-600 text-white rounded-full shadow-lg hover:bg-blue-700 transition-colors",
7477
- children: sidebarOpen ? /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(import_lucide_react16.X, { className: "w-6 h-6" }) : /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(import_lucide_react16.Menu, { className: "w-6 h-6" })
6923
+ children: sidebarOpen ? /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(import_lucide_react15.X, { className: "w-6 h-6" }) : /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(import_lucide_react15.Menu, { className: "w-6 h-6" })
7478
6924
  }
7479
6925
  ),
7480
- sidebarOpen && /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(
6926
+ sidebarOpen && /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(
7481
6927
  "div",
7482
6928
  {
7483
6929
  className: "md:hidden fixed inset-0 bg-black/50 z-40",
7484
6930
  onClick: () => setSidebarOpen(false)
7485
6931
  }
7486
6932
  ),
7487
- /* @__PURE__ */ (0, import_jsx_runtime24.jsxs)(
6933
+ /* @__PURE__ */ (0, import_jsx_runtime23.jsxs)(
7488
6934
  "aside",
7489
6935
  {
7490
6936
  className: cn(
@@ -7494,33 +6940,33 @@ var FileManagerContent = ({ className }) => {
7494
6940
  sidebarOpen ? "translate-x-0" : "-translate-x-full md:translate-x-0"
7495
6941
  ),
7496
6942
  children: [
7497
- /* @__PURE__ */ (0, import_jsx_runtime24.jsx)("div", { className: "p-3 border-b border-gray-200 dark:border-gray-800", children: /* @__PURE__ */ (0, import_jsx_runtime24.jsx)("h2", { className: "text-sm font-semibold text-gray-900 dark:text-gray-100", children: "Dossiers" }) }),
7498
- /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(FolderTree, {})
6943
+ /* @__PURE__ */ (0, import_jsx_runtime23.jsx)("div", { className: "p-3 border-b border-gray-200 dark:border-gray-800", children: /* @__PURE__ */ (0, import_jsx_runtime23.jsx)("h2", { className: "text-sm font-semibold text-gray-900 dark:text-gray-100", children: "Dossiers" }) }),
6944
+ /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(FolderTree, {})
7499
6945
  ]
7500
6946
  }
7501
6947
  ),
7502
- /* @__PURE__ */ (0, import_jsx_runtime24.jsxs)("main", { className: "flex-1 flex flex-col min-w-0", children: [
7503
- /* @__PURE__ */ (0, import_jsx_runtime24.jsxs)("header", { className: "p-4 border-b border-gray-200 dark:border-gray-800 space-y-3", children: [
7504
- /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(Toolbar, {}),
7505
- /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(Breadcrumb, {})
6948
+ /* @__PURE__ */ (0, import_jsx_runtime23.jsxs)("main", { className: "flex-1 flex flex-col min-w-0", children: [
6949
+ /* @__PURE__ */ (0, import_jsx_runtime23.jsxs)("header", { className: "p-4 border-b border-gray-200 dark:border-gray-800 space-y-3", children: [
6950
+ /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(Toolbar, {}),
6951
+ /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(Breadcrumb, {})
7506
6952
  ] }),
7507
- viewMode === "grid" ? /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(FileGrid, {}) : /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(FileList, {})
6953
+ viewMode === "grid" ? /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(FileGrid, {}) : /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(FileList, {})
7508
6954
  ] }),
7509
- /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(ContextMenu, {})
6955
+ /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(ContextMenu, {})
7510
6956
  ]
7511
6957
  }
7512
6958
  );
7513
6959
  };
7514
6960
  var FileManager = (props) => {
7515
- return /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(FileManagerProvider, { ...props, children: /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(FileManagerContent, { className: props.className }) });
6961
+ return /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(FileManagerProvider, { ...props, children: /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(FileManagerContent, { className: props.className }) });
7516
6962
  };
7517
6963
 
7518
6964
  // src/components/common/FileManager/components/EntityFileManager.tsx
7519
- var import_react20 = __toESM(require("react"), 1);
7520
- var import_lucide_react17 = require("lucide-react");
6965
+ var import_react19 = __toESM(require("react"), 1);
6966
+ var import_lucide_react16 = require("lucide-react");
7521
6967
 
7522
6968
  // src/components/common/FileManager/hooks/useFileManagerApi.ts
7523
- var import_react19 = require("react");
6969
+ var import_react18 = require("react");
7524
6970
 
7525
6971
  // src/components/common/FileManager/services/fileManagerApi.ts
7526
6972
  var API_BASE = "/api/files_manager";
@@ -7745,11 +7191,11 @@ function extractRootChildren(entityFolder) {
7745
7191
  return entityFolder.children || [];
7746
7192
  }
7747
7193
  function useFileManagerApi(entityType, entityId, businessEntityId) {
7748
- const [data, setData] = (0, import_react19.useState)([]);
7749
- const [loading, setLoading] = (0, import_react19.useState)(true);
7750
- const [error, setError] = (0, import_react19.useState)(null);
7751
- const [rootFolderCode, setRootFolderCode] = (0, import_react19.useState)(null);
7752
- const loadEntityFolders = (0, import_react19.useCallback)(async () => {
7194
+ const [data, setData] = (0, import_react18.useState)([]);
7195
+ const [loading, setLoading] = (0, import_react18.useState)(true);
7196
+ const [error, setError] = (0, import_react18.useState)(null);
7197
+ const [rootFolderCode, setRootFolderCode] = (0, import_react18.useState)(null);
7198
+ const loadEntityFolders = (0, import_react18.useCallback)(async () => {
7753
7199
  setLoading(true);
7754
7200
  setError(null);
7755
7201
  try {
@@ -7782,13 +7228,13 @@ function useFileManagerApi(entityType, entityId, businessEntityId) {
7782
7228
  setLoading(false);
7783
7229
  }
7784
7230
  }, [entityType, entityId]);
7785
- const refresh = (0, import_react19.useCallback)(async () => {
7231
+ const refresh = (0, import_react18.useCallback)(async () => {
7786
7232
  await loadEntityFolders();
7787
7233
  }, [loadEntityFolders]);
7788
- (0, import_react19.useEffect)(() => {
7234
+ (0, import_react18.useEffect)(() => {
7789
7235
  loadEntityFolders();
7790
7236
  }, [loadEntityFolders]);
7791
- const handleCreateFolder = (0, import_react19.useCallback)(
7237
+ const handleCreateFolder = (0, import_react18.useCallback)(
7792
7238
  async (name, parentId) => {
7793
7239
  try {
7794
7240
  const created = await fileManagerApi.createFolder(
@@ -7806,7 +7252,7 @@ function useFileManagerApi(entityType, entityId, businessEntityId) {
7806
7252
  },
7807
7253
  [businessEntityId, refresh]
7808
7254
  );
7809
- const handleUploadFiles = (0, import_react19.useCallback)(
7255
+ const handleUploadFiles = (0, import_react18.useCallback)(
7810
7256
  async (files, parentId) => {
7811
7257
  try {
7812
7258
  const uploaded = await fileManagerApi.uploadFiles(files, parentId);
@@ -7820,7 +7266,7 @@ function useFileManagerApi(entityType, entityId, businessEntityId) {
7820
7266
  },
7821
7267
  [refresh]
7822
7268
  );
7823
- const handleRename = (0, import_react19.useCallback)(
7269
+ const handleRename = (0, import_react18.useCallback)(
7824
7270
  async (item, newName) => {
7825
7271
  try {
7826
7272
  if (item.type === "folder") {
@@ -7837,7 +7283,7 @@ function useFileManagerApi(entityType, entityId, businessEntityId) {
7837
7283
  },
7838
7284
  [refresh]
7839
7285
  );
7840
- const handleDelete = (0, import_react19.useCallback)(
7286
+ const handleDelete = (0, import_react18.useCallback)(
7841
7287
  async (item) => {
7842
7288
  try {
7843
7289
  if (item.metadata?.isSystemFolder) {
@@ -7857,7 +7303,7 @@ function useFileManagerApi(entityType, entityId, businessEntityId) {
7857
7303
  },
7858
7304
  [refresh]
7859
7305
  );
7860
- const handleDownload = (0, import_react19.useCallback)((item) => {
7306
+ const handleDownload = (0, import_react18.useCallback)((item) => {
7861
7307
  if (item.type === "file") {
7862
7308
  const url = item.url || fileManagerApi.getDownloadUrl(item.id);
7863
7309
  window.open(url, "_blank");
@@ -7880,7 +7326,7 @@ function useFileManagerApi(entityType, entityId, businessEntityId) {
7880
7326
  }
7881
7327
 
7882
7328
  // src/components/common/FileManager/components/EntityFileManager.tsx
7883
- var import_jsx_runtime25 = require("react/jsx-runtime");
7329
+ var import_jsx_runtime24 = require("react/jsx-runtime");
7884
7330
  function getRootName(entityType) {
7885
7331
  const names = {
7886
7332
  CLIENT: "Documents Client",
@@ -7891,118 +7337,697 @@ function getRootName(entityType) {
7891
7337
  };
7892
7338
  return names[entityType] || "Documents";
7893
7339
  }
7894
- var LoadingState = ({ height = "400px" }) => /* @__PURE__ */ (0, import_jsx_runtime25.jsxs)(
7340
+ var LoadingState = ({ height = "400px" }) => /* @__PURE__ */ (0, import_jsx_runtime24.jsxs)(
7895
7341
  "div",
7896
7342
  {
7897
7343
  className: "flex flex-col items-center justify-center bg-gray-50 dark:bg-gray-900 rounded-xl border border-gray-200 dark:border-gray-800",
7898
7344
  style: { height },
7899
7345
  children: [
7900
- /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(import_lucide_react17.Loader2, { className: "w-10 h-10 text-blue-500 animate-spin mb-4" }),
7901
- /* @__PURE__ */ (0, import_jsx_runtime25.jsx)("p", { className: "text-gray-600 dark:text-gray-400 text-sm", children: "Chargement des documents..." })
7346
+ /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(import_lucide_react16.Loader2, { className: "w-10 h-10 text-blue-500 animate-spin mb-4" }),
7347
+ /* @__PURE__ */ (0, import_jsx_runtime24.jsx)("p", { className: "text-gray-600 dark:text-gray-400 text-sm", children: "Chargement des documents..." })
7902
7348
  ]
7903
7349
  }
7904
7350
  );
7905
- var ErrorState = ({ error, onRetry, height = "400px" }) => /* @__PURE__ */ (0, import_jsx_runtime25.jsxs)(
7351
+ var ErrorState = ({ error, onRetry, height = "400px" }) => /* @__PURE__ */ (0, import_jsx_runtime24.jsxs)(
7906
7352
  "div",
7907
7353
  {
7908
7354
  className: "flex flex-col items-center justify-center bg-red-50 dark:bg-red-900/20 rounded-xl border border-red-200 dark:border-red-800",
7909
7355
  style: { height },
7910
7356
  children: [
7911
- /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(import_lucide_react17.AlertCircle, { className: "w-10 h-10 text-red-500 mb-4" }),
7912
- /* @__PURE__ */ (0, import_jsx_runtime25.jsx)("p", { className: "text-red-600 dark:text-red-400 text-sm font-medium mb-2", children: "Erreur lors du chargement" }),
7913
- /* @__PURE__ */ (0, import_jsx_runtime25.jsx)("p", { className: "text-red-500 dark:text-red-400 text-xs mb-4 max-w-md text-center px-4", children: error.message }),
7914
- /* @__PURE__ */ (0, import_jsx_runtime25.jsxs)(
7357
+ /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(import_lucide_react16.AlertCircle, { className: "w-10 h-10 text-red-500 mb-4" }),
7358
+ /* @__PURE__ */ (0, import_jsx_runtime24.jsx)("p", { className: "text-red-600 dark:text-red-400 text-sm font-medium mb-2", children: "Erreur lors du chargement" }),
7359
+ /* @__PURE__ */ (0, import_jsx_runtime24.jsx)("p", { className: "text-red-500 dark:text-red-400 text-xs mb-4 max-w-md text-center px-4", children: error.message }),
7360
+ /* @__PURE__ */ (0, import_jsx_runtime24.jsxs)(
7915
7361
  "button",
7916
7362
  {
7917
7363
  onClick: onRetry,
7918
7364
  className: "flex items-center gap-2 px-4 py-2 bg-red-100 dark:bg-red-900/40 text-red-700 dark:text-red-300 rounded-lg hover:bg-red-200 dark:hover:bg-red-900/60 transition-colors text-sm",
7919
7365
  children: [
7920
- /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(import_lucide_react17.RefreshCw, { className: "w-4 h-4" }),
7366
+ /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(import_lucide_react16.RefreshCw, { className: "w-4 h-4" }),
7921
7367
  "R\xE9essayer"
7922
7368
  ]
7923
7369
  }
7924
- )
7925
- ]
7926
- }
7927
- );
7928
- var EmptyState = ({ height = "400px" }) => /* @__PURE__ */ (0, import_jsx_runtime25.jsxs)(
7929
- "div",
7930
- {
7931
- className: "flex flex-col items-center justify-center bg-gray-50 dark:bg-gray-900 rounded-xl border border-gray-200 dark:border-gray-800",
7932
- style: { height },
7933
- children: [
7934
- /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(import_lucide_react17.FolderX, { className: "w-10 h-10 text-gray-400 mb-4" }),
7935
- /* @__PURE__ */ (0, import_jsx_runtime25.jsx)("p", { className: "text-gray-600 dark:text-gray-400 text-sm font-medium mb-1", children: "Aucun document trouv\xE9" }),
7936
- /* @__PURE__ */ (0, import_jsx_runtime25.jsx)("p", { className: "text-gray-500 dark:text-gray-500 text-xs", children: "La structure de dossiers n'a pas encore \xE9t\xE9 cr\xE9\xE9e pour cette entit\xE9." })
7937
- ]
7938
- }
7939
- );
7940
- var EntityFileManager = ({
7941
- entityType,
7942
- entityId,
7943
- businessEntityId,
7944
- className,
7945
- height = "600px",
7946
- // Permissions (défaut: tout autorisé)
7947
- allowUpload = true,
7948
- allowCreateFolder = true,
7949
- allowRename = true,
7950
- allowDelete = true,
7951
- allowDownload = true,
7952
- // Callbacks
7953
- onFileSelect,
7954
- onFileOpen,
7955
- onUploadSuccess,
7956
- onError
7957
- }) => {
7958
- const { data, loading, error, refresh, handlers } = useFileManagerApi(
7959
- entityType,
7960
- entityId,
7961
- businessEntityId
7962
- );
7963
- import_react20.default.useEffect(() => {
7964
- if (error && onError) {
7965
- onError(error);
7966
- }
7967
- }, [error, onError]);
7968
- if (loading) {
7969
- return /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(LoadingState, { height });
7970
- }
7971
- if (error) {
7972
- return /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(ErrorState, { error, onRetry: refresh, height });
7973
- }
7974
- if (!data || data.length === 0) {
7975
- return /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(EmptyState, { height });
7976
- }
7977
- const handleUploadFiles = async (files, parentId) => {
7978
- const result = await handlers.onUploadFiles(files, parentId);
7979
- if (result && onUploadSuccess) {
7980
- onUploadSuccess(result);
7370
+ )
7371
+ ]
7372
+ }
7373
+ );
7374
+ var EmptyState = ({ height = "400px" }) => /* @__PURE__ */ (0, import_jsx_runtime24.jsxs)(
7375
+ "div",
7376
+ {
7377
+ className: "flex flex-col items-center justify-center bg-gray-50 dark:bg-gray-900 rounded-xl border border-gray-200 dark:border-gray-800",
7378
+ style: { height },
7379
+ children: [
7380
+ /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(import_lucide_react16.FolderX, { className: "w-10 h-10 text-gray-400 mb-4" }),
7381
+ /* @__PURE__ */ (0, import_jsx_runtime24.jsx)("p", { className: "text-gray-600 dark:text-gray-400 text-sm font-medium mb-1", children: "Aucun document trouv\xE9" }),
7382
+ /* @__PURE__ */ (0, import_jsx_runtime24.jsx)("p", { className: "text-gray-500 dark:text-gray-500 text-xs", children: "La structure de dossiers n'a pas encore \xE9t\xE9 cr\xE9\xE9e pour cette entit\xE9." })
7383
+ ]
7384
+ }
7385
+ );
7386
+ var EntityFileManager = ({
7387
+ entityType,
7388
+ entityId,
7389
+ businessEntityId,
7390
+ className,
7391
+ height = "600px",
7392
+ // Permissions (défaut: tout autorisé)
7393
+ allowUpload = true,
7394
+ allowCreateFolder = true,
7395
+ allowRename = true,
7396
+ allowDelete = true,
7397
+ allowDownload = true,
7398
+ // Callbacks
7399
+ onFileSelect,
7400
+ onFileOpen,
7401
+ onUploadSuccess,
7402
+ onError
7403
+ }) => {
7404
+ const { data, loading, error, refresh, handlers } = useFileManagerApi(
7405
+ entityType,
7406
+ entityId,
7407
+ businessEntityId
7408
+ );
7409
+ import_react19.default.useEffect(() => {
7410
+ if (error && onError) {
7411
+ onError(error);
7412
+ }
7413
+ }, [error, onError]);
7414
+ if (loading) {
7415
+ return /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(LoadingState, { height });
7416
+ }
7417
+ if (error) {
7418
+ return /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(ErrorState, { error, onRetry: refresh, height });
7419
+ }
7420
+ if (!data || data.length === 0) {
7421
+ return /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(EmptyState, { height });
7422
+ }
7423
+ const handleUploadFiles = async (files, parentId) => {
7424
+ const result = await handlers.onUploadFiles(files, parentId);
7425
+ if (result && onUploadSuccess) {
7426
+ onUploadSuccess(result);
7427
+ }
7428
+ return result;
7429
+ };
7430
+ return /* @__PURE__ */ (0, import_jsx_runtime24.jsx)("div", { className: cn("relative", className), style: { height }, children: /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(
7431
+ FileManager,
7432
+ {
7433
+ data,
7434
+ rootName: getRootName(entityType),
7435
+ onCreateFolder: handlers.onCreateFolder,
7436
+ onUploadFiles: handleUploadFiles,
7437
+ onRename: handlers.onRename,
7438
+ onDelete: handlers.onDelete,
7439
+ onDownload: handlers.onDownload,
7440
+ onSelect: onFileSelect,
7441
+ onOpen: onFileOpen,
7442
+ allowUpload,
7443
+ allowCreateFolder,
7444
+ allowRename,
7445
+ allowDelete,
7446
+ allowDownload,
7447
+ allowMultiSelect: true,
7448
+ className: "h-full"
7449
+ }
7450
+ ) });
7451
+ };
7452
+
7453
+ // src/components/common/FormVendor.tsx
7454
+ var import_lucide_react17 = require("lucide-react");
7455
+ var import_jsx_runtime25 = require("react/jsx-runtime");
7456
+ var FormVendor = ({
7457
+ isOpen,
7458
+ onClose,
7459
+ object,
7460
+ from = "procurement",
7461
+ refresh = () => {
7462
+ }
7463
+ }) => {
7464
+ const [formData, setFormData] = (0, import_react20.useState)(object || {
7465
+ from_module: from ?? null,
7466
+ legal_name: "",
7467
+ trading_name: "",
7468
+ phone: "",
7469
+ email: "",
7470
+ logo: "",
7471
+ year_founded: "",
7472
+ activity_sector: "",
7473
+ description: "",
7474
+ accounting_account_number: "",
7475
+ account: null,
7476
+ capital: null,
7477
+ annual_turnover: null,
7478
+ payment_delay: null,
7479
+ country: "",
7480
+ city: "",
7481
+ address: "",
7482
+ legal_form: "",
7483
+ tax_regime: "",
7484
+ tax_account: "",
7485
+ rccm: "",
7486
+ legal_representative_name: "",
7487
+ legal_representative_address: "",
7488
+ legal_representative_phone: "",
7489
+ legal_representative_email: "",
7490
+ legal_representative_id_document: "",
7491
+ legal_representative_id_number: "",
7492
+ legal_representative_fonction: "",
7493
+ bank_name: "",
7494
+ bank_address: "",
7495
+ bank_email: "",
7496
+ bank_phone: "",
7497
+ iban: "",
7498
+ rib: "",
7499
+ vendor_number: ""
7500
+ });
7501
+ const [errors, setErrors] = (0, import_react20.useState)({});
7502
+ const [activeTab, setActiveTab] = (0, import_react20.useState)("general");
7503
+ const [loading, setLoading] = (0, import_react20.useState)(false);
7504
+ const { token, activeBusinessEntity } = useSession();
7505
+ const { success, error: showError } = useToast();
7506
+ const handleInputChange = (e) => {
7507
+ const { name, value } = e.target;
7508
+ setFormData((prev) => ({ ...prev, [name]: value }));
7509
+ if (errors[name]) {
7510
+ setErrors((prev) => ({ ...prev, [name]: void 0 }));
7511
+ }
7512
+ };
7513
+ const handleTextareaChange = (e) => {
7514
+ const { name, value } = e.target;
7515
+ setFormData((prev) => ({ ...prev, [name]: value }));
7516
+ };
7517
+ const validateForm = () => {
7518
+ const newErrors = {};
7519
+ if (!formData.legal_name?.trim()) {
7520
+ newErrors.legal_name = "La raison sociale est obligatoire";
7521
+ }
7522
+ if (formData.email && !/^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(formData.email)) {
7523
+ newErrors.email = "Format d'email invalide";
7524
+ }
7525
+ if (formData.iban && formData.iban.length > 0 && formData.iban.length < 15) {
7526
+ newErrors.iban = "Format IBAN invalide";
7527
+ }
7528
+ setErrors(newErrors);
7529
+ return Object.keys(newErrors).length === 0;
7530
+ };
7531
+ const handleSaveVendor = async (entityData) => {
7532
+ try {
7533
+ if (object && object.id) {
7534
+ await VendorServices.update(object.id, entityData);
7535
+ success("Fournisseur modifi\xE9 avec succ\xE8s !");
7536
+ } else {
7537
+ await VendorServices.create(entityData);
7538
+ success("Fournisseur cr\xE9\xE9 avec succ\xE8s !");
7539
+ }
7540
+ refresh();
7541
+ onClose();
7542
+ } catch (error) {
7543
+ console.error(error);
7544
+ showError("Erreur lors de l'enregistrement du fournisseur");
7545
+ }
7546
+ };
7547
+ const handleSubmit = async (e) => {
7548
+ e.preventDefault();
7549
+ if (!validateForm()) return;
7550
+ setLoading(true);
7551
+ try {
7552
+ await handleSaveVendor(formData);
7553
+ } finally {
7554
+ setLoading(false);
7555
+ }
7556
+ };
7557
+ const tabs = [
7558
+ { id: "general", label: "G\xE9n\xE9ral", icon: import_lucide_react17.Building2 },
7559
+ { id: "contacts", label: "Adresses & Contacts", icon: import_lucide_react17.MapPin },
7560
+ { id: "representative", label: "Repr\xE9sentant", icon: import_lucide_react17.FileText },
7561
+ { id: "accounting", label: "Comptabilit\xE9", icon: import_lucide_react17.FileText },
7562
+ { id: "banking", label: "Bancaire", icon: import_lucide_react17.CreditCard },
7563
+ { id: "attachment", label: "Fichiers", icon: import_lucide_react17.File }
7564
+ ];
7565
+ const renderTabContent = () => {
7566
+ switch (activeTab) {
7567
+ case "general":
7568
+ return /* @__PURE__ */ (0, import_jsx_runtime25.jsxs)("div", { className: "space-y-4", children: [
7569
+ /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(
7570
+ TextInput,
7571
+ {
7572
+ label: "Raison sociale",
7573
+ name: "legal_name",
7574
+ value: formData.legal_name || "",
7575
+ placeholder: "Nom l\\u00e9gal de l'entit\\u00e9",
7576
+ required: true,
7577
+ error: errors.legal_name,
7578
+ onChange: handleInputChange
7579
+ }
7580
+ ),
7581
+ /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(
7582
+ TextInput,
7583
+ {
7584
+ label: "Nom commercial",
7585
+ name: "trading_name",
7586
+ value: formData.trading_name || "",
7587
+ placeholder: "Nom commercial (optionnel)",
7588
+ onChange: handleInputChange
7589
+ }
7590
+ ),
7591
+ /* @__PURE__ */ (0, import_jsx_runtime25.jsxs)("div", { className: "grid grid-cols-1 md:grid-cols-2 gap-4", children: [
7592
+ /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(
7593
+ TextInput,
7594
+ {
7595
+ label: "Num\\u00e9ro d'identification fiscale (NCC)",
7596
+ name: "tax_account",
7597
+ value: formData.tax_account || "",
7598
+ placeholder: "Num\\u00e9ro d'identification fiscale",
7599
+ onChange: handleInputChange
7600
+ }
7601
+ ),
7602
+ /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(
7603
+ TextInput,
7604
+ {
7605
+ label: "RCCM",
7606
+ name: "rccm",
7607
+ value: formData.rccm || "",
7608
+ placeholder: "Registre du Commerce et du Cr\\u00e9dit Mobilier",
7609
+ onChange: handleInputChange
7610
+ }
7611
+ ),
7612
+ /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(
7613
+ TextInput,
7614
+ {
7615
+ label: "Forme juridique",
7616
+ name: "legal_form",
7617
+ value: formData.legal_form || "",
7618
+ placeholder: "SARL, SA, SAS, etc.",
7619
+ onChange: handleInputChange
7620
+ }
7621
+ ),
7622
+ /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(
7623
+ TextInput,
7624
+ {
7625
+ label: "R\\u00e9gime fiscal",
7626
+ name: "tax_regime",
7627
+ value: formData.tax_regime || "",
7628
+ placeholder: "R\\u00e9gime fiscal",
7629
+ onChange: handleInputChange
7630
+ }
7631
+ ),
7632
+ /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(
7633
+ TextInput,
7634
+ {
7635
+ label: "Ann\\u00e9e de fondation",
7636
+ name: "year_founded",
7637
+ value: formData.year_founded || "",
7638
+ placeholder: "2020",
7639
+ onChange: handleInputChange
7640
+ }
7641
+ ),
7642
+ /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(
7643
+ TextInput,
7644
+ {
7645
+ label: "Secteur d'activit\\u00e9",
7646
+ name: "activity_sector",
7647
+ value: formData.activity_sector || "",
7648
+ placeholder: "Informatique, Commerce, etc.",
7649
+ onChange: handleInputChange
7650
+ }
7651
+ )
7652
+ ] }),
7653
+ /* @__PURE__ */ (0, import_jsx_runtime25.jsxs)("div", { children: [
7654
+ /* @__PURE__ */ (0, import_jsx_runtime25.jsx)("label", { className: "block text-sm font-medium text-gray-700 mb-2", children: "Description" }),
7655
+ /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(
7656
+ "textarea",
7657
+ {
7658
+ name: "description",
7659
+ value: formData.description || "",
7660
+ onChange: handleTextareaChange,
7661
+ rows: 3,
7662
+ className: "w-full px-4 py-3 border border-gray-200 rounded-lg focus:outline-none focus:ring-2 focus:ring-[#6B7C92] focus:border-transparent placeholder-gray-400",
7663
+ placeholder: "Description de l'activit\\u00e9 de l'entit\\u00e9"
7664
+ }
7665
+ )
7666
+ ] })
7667
+ ] });
7668
+ case "contacts":
7669
+ return /* @__PURE__ */ (0, import_jsx_runtime25.jsxs)("div", { className: "space-y-4", children: [
7670
+ /* @__PURE__ */ (0, import_jsx_runtime25.jsxs)("div", { className: "grid grid-cols-1 md:grid-cols-2 gap-4", children: [
7671
+ /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(
7672
+ InputField,
7673
+ {
7674
+ label: "T\\u00e9l\\u00e9phone",
7675
+ name: "phone",
7676
+ type: "tel",
7677
+ value: formData.phone || "",
7678
+ placeholder: "+225 XX XX XX XX XX",
7679
+ onChange: handleInputChange
7680
+ }
7681
+ ),
7682
+ /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(
7683
+ InputField,
7684
+ {
7685
+ label: "Email",
7686
+ name: "email",
7687
+ type: "email",
7688
+ value: formData.email || "",
7689
+ placeholder: "contact@entite.com",
7690
+ error: errors.email,
7691
+ onChange: handleInputChange
7692
+ }
7693
+ )
7694
+ ] }),
7695
+ /* @__PURE__ */ (0, import_jsx_runtime25.jsxs)("div", { className: "grid grid-cols-1 md:grid-cols-2 gap-4", children: [
7696
+ /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(
7697
+ TextInput,
7698
+ {
7699
+ label: "Pays",
7700
+ name: "country",
7701
+ value: formData.country || "",
7702
+ placeholder: "C\\u00f4te d'Ivoire",
7703
+ onChange: handleInputChange
7704
+ }
7705
+ ),
7706
+ /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(
7707
+ TextInput,
7708
+ {
7709
+ label: "Ville",
7710
+ name: "city",
7711
+ value: formData.city || "",
7712
+ placeholder: "Abidjan",
7713
+ onChange: handleInputChange
7714
+ }
7715
+ )
7716
+ ] }),
7717
+ /* @__PURE__ */ (0, import_jsx_runtime25.jsxs)("div", { children: [
7718
+ /* @__PURE__ */ (0, import_jsx_runtime25.jsx)("label", { className: "block text-sm font-medium text-gray-700 mb-2", children: "Adresse compl\\u00e8te" }),
7719
+ /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(
7720
+ "textarea",
7721
+ {
7722
+ name: "address",
7723
+ value: formData.address || "",
7724
+ onChange: handleTextareaChange,
7725
+ rows: 3,
7726
+ className: "w-full px-4 py-3 border border-gray-200 rounded-lg focus:outline-none focus:ring-2 focus:ring-[#6B7C92] focus:border-transparent placeholder-gray-400",
7727
+ placeholder: "Adresse compl\\u00e8te de l'entit\\u00e9"
7728
+ }
7729
+ )
7730
+ ] })
7731
+ ] });
7732
+ case "representative":
7733
+ return /* @__PURE__ */ (0, import_jsx_runtime25.jsxs)("div", { className: "space-y-4", children: [
7734
+ /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(
7735
+ TextInput,
7736
+ {
7737
+ label: "Nom du repr\\u00e9sentant l\\u00e9gal",
7738
+ name: "legal_representative_name",
7739
+ value: formData.legal_representative_name || "",
7740
+ placeholder: "Nom et pr\\u00e9nom du repr\\u00e9sentant",
7741
+ onChange: handleInputChange
7742
+ }
7743
+ ),
7744
+ /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(
7745
+ TextInput,
7746
+ {
7747
+ label: "Fonction du repr\\u00e9sentant",
7748
+ name: "legal_representative_fonction",
7749
+ value: formData.legal_representative_fonction || "",
7750
+ placeholder: "Directeur G\\u00e9n\\u00e9ral, G\\u00e9rant, etc.",
7751
+ onChange: handleInputChange
7752
+ }
7753
+ ),
7754
+ /* @__PURE__ */ (0, import_jsx_runtime25.jsxs)("div", { className: "grid grid-cols-1 md:grid-cols-2 gap-4", children: [
7755
+ /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(
7756
+ InputField,
7757
+ {
7758
+ label: "T\\u00e9l\\u00e9phone du repr\\u00e9sentant",
7759
+ name: "legal_representative_phone",
7760
+ type: "tel",
7761
+ value: formData.legal_representative_phone || "",
7762
+ placeholder: "+225 XX XX XX XX XX",
7763
+ onChange: handleInputChange
7764
+ }
7765
+ ),
7766
+ /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(
7767
+ InputField,
7768
+ {
7769
+ label: "Email du repr\\u00e9sentant",
7770
+ name: "legal_representative_email",
7771
+ type: "email",
7772
+ value: formData.legal_representative_email || "",
7773
+ placeholder: "representant@entite.com",
7774
+ onChange: handleInputChange
7775
+ }
7776
+ ),
7777
+ /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(
7778
+ TextInput,
7779
+ {
7780
+ label: "Type de document d'identit\\u00e9",
7781
+ name: "legal_representative_id_document",
7782
+ value: formData.legal_representative_id_document || "",
7783
+ placeholder: "CNI, Passeport, etc.",
7784
+ onChange: handleInputChange
7785
+ }
7786
+ ),
7787
+ /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(
7788
+ TextInput,
7789
+ {
7790
+ label: "Num\\u00e9ro de document d'identit\\u00e9",
7791
+ name: "legal_representative_id_number",
7792
+ value: formData.legal_representative_id_number || "",
7793
+ placeholder: "Num\\u00e9ro du document",
7794
+ onChange: handleInputChange
7795
+ }
7796
+ )
7797
+ ] }),
7798
+ /* @__PURE__ */ (0, import_jsx_runtime25.jsxs)("div", { children: [
7799
+ /* @__PURE__ */ (0, import_jsx_runtime25.jsx)("label", { className: "block text-sm font-medium text-gray-700 mb-2", children: "Adresse du repr\\u00e9sentant" }),
7800
+ /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(
7801
+ "textarea",
7802
+ {
7803
+ name: "legal_representative_address",
7804
+ value: formData.legal_representative_address || "",
7805
+ onChange: handleTextareaChange,
7806
+ rows: 3,
7807
+ className: "w-full px-4 py-3 border border-gray-200 rounded-lg focus:outline-none focus:ring-2 focus:ring-[#6B7C92] focus:border-transparent placeholder-gray-400",
7808
+ placeholder: "Adresse du repr\\u00e9sentant l\\u00e9gal"
7809
+ }
7810
+ )
7811
+ ] })
7812
+ ] });
7813
+ case "accounting":
7814
+ return /* @__PURE__ */ (0, import_jsx_runtime25.jsxs)("div", { className: "space-y-4", children: [
7815
+ /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(
7816
+ SelectAccount,
7817
+ {
7818
+ value: formData.account,
7819
+ filterClass: "4",
7820
+ onSelect: (option) => {
7821
+ setFormData((prev) => ({
7822
+ ...prev,
7823
+ account: option.value,
7824
+ accounting_account_number: option.object?.account_number || ""
7825
+ }));
7826
+ }
7827
+ }
7828
+ ),
7829
+ /* @__PURE__ */ (0, import_jsx_runtime25.jsxs)("div", { className: "grid grid-cols-1 md:grid-cols-2 gap-4", children: [
7830
+ /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(
7831
+ TextInput,
7832
+ {
7833
+ label: "Numero de compte (manuel)",
7834
+ name: "accounting_account_number",
7835
+ value: formData.accounting_account_number || "",
7836
+ placeholder: "Numero de compte comptable",
7837
+ onChange: handleInputChange
7838
+ }
7839
+ ),
7840
+ /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(
7841
+ TextInput,
7842
+ {
7843
+ label: "Capital",
7844
+ name: "capital",
7845
+ value: formData.capital?.toString() || "",
7846
+ placeholder: "Capital social",
7847
+ onChange: handleInputChange
7848
+ }
7849
+ ),
7850
+ /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(
7851
+ TextInput,
7852
+ {
7853
+ label: "Chiffre d'affaires annuel",
7854
+ name: "annual_turnover",
7855
+ value: formData.annual_turnover?.toString() || "",
7856
+ placeholder: "Chiffre d'affaires",
7857
+ onChange: handleInputChange
7858
+ }
7859
+ ),
7860
+ /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(
7861
+ TextInput,
7862
+ {
7863
+ label: "Delai de paiement (jours)",
7864
+ name: "payment_delay",
7865
+ value: formData.payment_delay?.toString() || "",
7866
+ placeholder: "30",
7867
+ onChange: handleInputChange
7868
+ }
7869
+ )
7870
+ ] })
7871
+ ] });
7872
+ case "banking":
7873
+ return /* @__PURE__ */ (0, import_jsx_runtime25.jsxs)("div", { className: "space-y-4", children: [
7874
+ /* @__PURE__ */ (0, import_jsx_runtime25.jsxs)("div", { className: "grid grid-cols-1 md:grid-cols-2 gap-4", children: [
7875
+ /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(
7876
+ TextInput,
7877
+ {
7878
+ label: "RIB",
7879
+ name: "rib",
7880
+ value: formData.rib || "",
7881
+ placeholder: "Relev\\u00e9 d'Identit\\u00e9 Bancaire",
7882
+ onChange: handleInputChange
7883
+ }
7884
+ ),
7885
+ /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(
7886
+ TextInput,
7887
+ {
7888
+ label: "IBAN",
7889
+ name: "iban",
7890
+ value: formData.iban || "",
7891
+ placeholder: "CI93 1234 5678 9012 3456 789",
7892
+ error: errors.iban,
7893
+ onChange: handleInputChange
7894
+ }
7895
+ )
7896
+ ] }),
7897
+ /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(
7898
+ TextInput,
7899
+ {
7900
+ label: "Nom de la banque",
7901
+ name: "bank_name",
7902
+ value: formData.bank_name || "",
7903
+ placeholder: "Nom de la banque",
7904
+ onChange: handleInputChange
7905
+ }
7906
+ ),
7907
+ /* @__PURE__ */ (0, import_jsx_runtime25.jsxs)("div", { className: "grid grid-cols-1 md:grid-cols-2 gap-4", children: [
7908
+ /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(
7909
+ InputField,
7910
+ {
7911
+ label: "Email de la banque",
7912
+ name: "bank_email",
7913
+ type: "email",
7914
+ value: formData.bank_email || "",
7915
+ placeholder: "contact@banque.com",
7916
+ onChange: handleInputChange
7917
+ }
7918
+ ),
7919
+ /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(
7920
+ InputField,
7921
+ {
7922
+ label: "T\\u00e9l\\u00e9phone de la banque",
7923
+ name: "bank_phone",
7924
+ type: "tel",
7925
+ value: formData.bank_phone || "",
7926
+ placeholder: "+225 XX XX XX XX XX",
7927
+ onChange: handleInputChange
7928
+ }
7929
+ )
7930
+ ] }),
7931
+ /* @__PURE__ */ (0, import_jsx_runtime25.jsxs)("div", { children: [
7932
+ /* @__PURE__ */ (0, import_jsx_runtime25.jsx)("label", { className: "block text-sm font-medium text-gray-700 mb-2", children: "Adresse de la banque" }),
7933
+ /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(
7934
+ "textarea",
7935
+ {
7936
+ name: "bank_address",
7937
+ value: formData.bank_address || "",
7938
+ onChange: handleTextareaChange,
7939
+ rows: 2,
7940
+ className: "w-full px-4 py-3 border border-gray-200 rounded-lg focus:outline-none focus:ring-2 focus:ring-[#6B7C92] focus:border-transparent placeholder-gray-400",
7941
+ placeholder: "Adresse de la banque"
7942
+ }
7943
+ )
7944
+ ] })
7945
+ ] });
7946
+ case "attachment":
7947
+ if (!object?.id) {
7948
+ return /* @__PURE__ */ (0, import_jsx_runtime25.jsxs)("div", { className: "flex flex-col items-center justify-center py-12 text-gray-500", children: [
7949
+ /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(import_lucide_react17.File, { className: "w-12 h-12 mb-4 text-gray-400" }),
7950
+ /* @__PURE__ */ (0, import_jsx_runtime25.jsx)("p", { className: "text-lg font-medium", children: "Fichiers non disponibles" }),
7951
+ /* @__PURE__ */ (0, import_jsx_runtime25.jsx)("p", { className: "text-sm mt-2", children: "Enregistrez d'abord le fournisseur pour pouvoir ajouter des fichiers." })
7952
+ ] });
7953
+ }
7954
+ return /* @__PURE__ */ (0, import_jsx_runtime25.jsx)("div", { className: "h-[500px]", children: /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(
7955
+ EntityFileManager,
7956
+ {
7957
+ entityType: "VENDOR",
7958
+ entityId: object.id,
7959
+ businessEntityId: activeBusinessEntity?.id || 0,
7960
+ height: "100%",
7961
+ allowUpload: true,
7962
+ allowCreateFolder: true,
7963
+ allowRename: true,
7964
+ allowDelete: true,
7965
+ allowDownload: true
7966
+ }
7967
+ ) });
7968
+ default:
7969
+ return null;
7981
7970
  }
7982
- return result;
7983
7971
  };
7984
- return /* @__PURE__ */ (0, import_jsx_runtime25.jsx)("div", { className: cn("relative", className), style: { height }, children: /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(
7985
- FileManager,
7972
+ if (!isOpen) return null;
7973
+ return /* @__PURE__ */ (0, import_jsx_runtime25.jsxs)(
7974
+ Modals_default,
7986
7975
  {
7987
- data,
7988
- rootName: getRootName(entityType),
7989
- onCreateFolder: handlers.onCreateFolder,
7990
- onUploadFiles: handleUploadFiles,
7991
- onRename: handlers.onRename,
7992
- onDelete: handlers.onDelete,
7993
- onDownload: handlers.onDownload,
7994
- onSelect: onFileSelect,
7995
- onOpen: onFileOpen,
7996
- allowUpload,
7997
- allowCreateFolder,
7998
- allowRename,
7999
- allowDelete,
8000
- allowDownload,
8001
- allowMultiSelect: true,
8002
- className: "h-full"
7976
+ title: object ? "Modifier le fournisseur" : "Ajouter un fournisseur",
7977
+ width: "w-[100%]",
7978
+ description: "",
7979
+ open: isOpen,
7980
+ onClose,
7981
+ children: [
7982
+ /* @__PURE__ */ (0, import_jsx_runtime25.jsx)("div", { className: "border-b border-gray-200", children: /* @__PURE__ */ (0, import_jsx_runtime25.jsx)("nav", { className: "flex space-x-8 px-6", children: tabs.map((tab) => {
7983
+ const Icon = tab.icon;
7984
+ return /* @__PURE__ */ (0, import_jsx_runtime25.jsxs)(
7985
+ "button",
7986
+ {
7987
+ type: "button",
7988
+ onClick: () => setActiveTab(tab.id),
7989
+ className: `
7990
+ flex items-center space-x-2 py-4 px-2 text-sm font-medium border-b-2 transition-colors
7991
+ ${activeTab === tab.id ? "border-[#6A8A82] text-[#6A8A82]" : "border-transparent text-[#767676] hover:text-[#6A8A82] hover:border-[#6A8A82]/30"}
7992
+ `,
7993
+ children: [
7994
+ /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(Icon, { className: "w-4 h-4 inline mr-2" }),
7995
+ /* @__PURE__ */ (0, import_jsx_runtime25.jsx)("span", { children: tab.label })
7996
+ ]
7997
+ },
7998
+ tab.id
7999
+ );
8000
+ }) }) }),
8001
+ /* @__PURE__ */ (0, import_jsx_runtime25.jsxs)("form", { onSubmit: handleSubmit, className: "p-6", children: [
8002
+ renderTabContent(),
8003
+ /* @__PURE__ */ (0, import_jsx_runtime25.jsxs)("div", { className: "flex justify-between pt-6 border-t border-gray-200 mt-8", children: [
8004
+ /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(
8005
+ "button",
8006
+ {
8007
+ type: "button",
8008
+ onClick: onClose,
8009
+ className: "px-6 py-2 border border-gray-300 text-gray-700 rounded-lg hover:bg-gray-50 transition-colors",
8010
+ children: "Annuler"
8011
+ }
8012
+ ),
8013
+ /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(
8014
+ Buttons_default,
8015
+ {
8016
+ type: "submit",
8017
+ disabled: loading,
8018
+ children: loading ? "Chargement..." : object ? "Modifier" : "Enregistrer le fournisseur"
8019
+ }
8020
+ )
8021
+ ] })
8022
+ ] })
8023
+ ]
8003
8024
  }
8004
- ) });
8025
+ );
8005
8026
  };
8027
+ var MinimalVendorForm = FormVendor;
8028
+
8029
+ // src/components/common/FormClient.tsx
8030
+ var import_react21 = require("react");
8006
8031
 
8007
8032
  // src/models/Client.ts
8008
8033
  var TEMPLATE_FNE_CHOICES = [