ptechcore_ui 1.0.20 → 1.0.22

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 (36) hide show
  1. package/dist/imgs/login_illustration.png +0 -0
  2. package/dist/index.cjs +691 -583
  3. package/dist/index.d.cts +21 -0
  4. package/dist/index.d.ts +21 -0
  5. package/dist/index.js +715 -693
  6. package/dist/modules-icons/accountingblanc.svg +1 -0
  7. package/dist/modules-icons/accountingblue.svg +1 -0
  8. package/dist/modules-icons/assetblanc.svg +1 -0
  9. package/dist/modules-icons/assetblue.svg +1 -0
  10. package/dist/modules-icons/biblanc.svg +1 -0
  11. package/dist/modules-icons/biblue.svg +1 -0
  12. package/dist/modules-icons/collection_litigationblanc.svg +1 -0
  13. package/dist/modules-icons/collection_litigationblue.svg +1 -0
  14. package/dist/modules-icons/crm-blue.svg +1 -0
  15. package/dist/modules-icons/crmwhite.svg +1 -0
  16. package/dist/modules-icons/facilityblanc.svg +1 -0
  17. package/dist/modules-icons/facilityblue.svg +1 -0
  18. package/dist/modules-icons/financeblanc.svg +1 -0
  19. package/dist/modules-icons/financeblue.svg +1 -0
  20. package/dist/modules-icons/human_capitalblanc.svg +1 -0
  21. package/dist/modules-icons/human_capitalblue.svg +1 -0
  22. package/dist/modules-icons/invoicingblanc.svg +1 -0
  23. package/dist/modules-icons/invoicingblue.svg +1 -0
  24. package/dist/modules-icons/marketingblanc.svg +1 -0
  25. package/dist/modules-icons/marketingblue.svg +1 -0
  26. package/dist/modules-icons/procurementblanc.svg +1 -0
  27. package/dist/modules-icons/procurementblue.svg +1 -0
  28. package/dist/modules-icons/security_managementblanc.svg +1 -0
  29. package/dist/modules-icons/security_managementblue.svg +1 -0
  30. package/dist/modules-icons/sopblancs.svg +1 -0
  31. package/dist/modules-icons/sopblues.svg +1 -0
  32. package/dist/modules-icons/thriveblanc.svg +1 -0
  33. package/dist/modules-icons/thriveblue.svg +1 -0
  34. package/dist/modules-icons/wiseblancs.svg +1 -0
  35. package/dist/modules-icons/wiseblues.svg +1 -0
  36. package/package.json +3 -2
package/dist/index.cjs CHANGED
@@ -819,6 +819,36 @@ var FetchApi = class {
819
819
  if (!res.ok) throw new Error(await res.text());
820
820
  return res.json();
821
821
  }
822
+ static async uploadFile(url, formData, token) {
823
+ const headers = {};
824
+ const local_token = localStorage.getItem("token");
825
+ if (local_token) {
826
+ headers["Authorization"] = `Token ${local_token}`;
827
+ }
828
+ const res = await fetch(url, {
829
+ method: "POST",
830
+ headers,
831
+ body: formData
832
+ });
833
+ if (!res.ok) throw new Error(await res.text());
834
+ return res.json();
835
+ }
836
+ static async patch(url, payload, token) {
837
+ const headers = {
838
+ "Content-Type": "application/json"
839
+ };
840
+ const local_token = localStorage.getItem("token");
841
+ if (local_token) {
842
+ headers["Authorization"] = `Token ${local_token}`;
843
+ }
844
+ const res = await fetch(url, {
845
+ method: "PATCH",
846
+ headers,
847
+ body: payload ? JSON.stringify(payload) : void 0
848
+ });
849
+ if (!res.ok) throw new Error(await res.text());
850
+ return res.json();
851
+ }
822
852
  };
823
853
 
824
854
  // src/services/AuthServices.ts
@@ -993,7 +1023,22 @@ var UserServices = {
993
1023
  getuserEntitiesAccess: (id, token) => FetchApi.get(`${API_URL}/core/entities/`, token),
994
1024
  // !!! ce n'est pas la bonne url
995
1025
  // Ajouter un utilisateur à une entité
996
- addUserToEntity: (entityId, userId, token) => FetchApi.post(`${API_URL}/core/entities/${entityId}/users/`, { user_id: userId }, token)
1026
+ addUserToEntity: (entityId, userId, token) => FetchApi.post(`${API_URL}/core/entities/${entityId}/users/`, { user_id: userId }, token),
1027
+ // === Nouvelles méthodes pour le profil utilisateur ===
1028
+ // Mettre à jour le profil de l'utilisateur connecté
1029
+ updateMyProfile: (data) => FetchApi.put(`${USERS_API_URL}me/`, data),
1030
+ // Changer la photo de profil
1031
+ updateProfilePicture: (file) => {
1032
+ const formData = new FormData();
1033
+ formData.append("profile_picture", file);
1034
+ return FetchApi.uploadFile(`${USERS_API_URL}me/upload-picture/`, formData);
1035
+ },
1036
+ // Supprimer la photo de profil
1037
+ deleteProfilePicture: () => FetchApi.delete(`${USERS_API_URL}me/delete-picture/`),
1038
+ // Changer le mot de passe (utilisateur authentifié)
1039
+ changePassword: (data) => FetchApi.post(`${API_BASE_URL2}change-my-password/`, data),
1040
+ // Obtenir le profil de l'utilisateur connecté
1041
+ getMyProfile: () => FetchApi.get(`${USERS_API_URL}me/`)
997
1042
  };
998
1043
 
999
1044
  // src/contexts/ToastContext.tsx
@@ -1020,9 +1065,10 @@ var ToastProvider = ({ children }) => {
1020
1065
  };
1021
1066
  const addToast = (0, import_react3.useCallback)((toast) => {
1022
1067
  const id = generateId();
1068
+ const defaultDuration = toast.type === "error" ? 7e3 : 3e3;
1023
1069
  const newToast = {
1024
1070
  id,
1025
- duration: 5e3,
1071
+ duration: toast.duration ?? defaultDuration,
1026
1072
  ...toast
1027
1073
  };
1028
1074
  setToasts((prev) => [...prev, newToast]);
@@ -1736,7 +1782,30 @@ var RewiseLayout = ({ children, module_name = "Rewise", module_description = "De
1736
1782
  const [showThemeMenu, setShowThemeMenu] = (0, import_react5.useState)(false);
1737
1783
  const [showCenterMenu, setShowCenterMenu] = (0, import_react5.useState)(false);
1738
1784
  const [showModulesMenu, setShowModulesMenu] = (0, import_react5.useState)(false);
1785
+ const [showProfileModal, setShowProfileModal] = (0, import_react5.useState)(false);
1786
+ const [showEditProfileModal, setShowEditProfileModal] = (0, import_react5.useState)(false);
1787
+ const [showChangePasswordModal, setShowChangePasswordModal] = (0, import_react5.useState)(false);
1739
1788
  const [currentSlide, setCurrentSlide] = (0, import_react5.useState)(0);
1789
+ const [editProfileData, setEditProfileData] = (0, import_react5.useState)({
1790
+ first_name: "",
1791
+ last_name: "",
1792
+ email: "",
1793
+ phonenumber: "",
1794
+ job_title: "",
1795
+ department: ""
1796
+ });
1797
+ const [savingProfile, setSavingProfile] = (0, import_react5.useState)(false);
1798
+ const [uploadingPhoto, setUploadingPhoto] = (0, import_react5.useState)(false);
1799
+ const [passwordData, setPasswordData] = (0, import_react5.useState)({
1800
+ current_password: "",
1801
+ new_password: "",
1802
+ confirm_password: ""
1803
+ });
1804
+ const [savingPassword, setSavingPassword] = (0, import_react5.useState)(false);
1805
+ const [showCurrentPassword, setShowCurrentPassword] = (0, import_react5.useState)(false);
1806
+ const [showNewPassword, setShowNewPassword] = (0, import_react5.useState)(false);
1807
+ const [showConfirmPassword, setShowConfirmPassword] = (0, import_react5.useState)(false);
1808
+ const fileInputRef = import_react5.default.useRef(null);
1740
1809
  const slides = [
1741
1810
  {
1742
1811
  title: "Rappel \u2013 Gestion des jours de cong\xE9",
@@ -1855,6 +1924,133 @@ var RewiseLayout = ({ children, module_name = "Rewise", module_description = "De
1855
1924
  showError("Erreur lors du marquage de la notification comme lue");
1856
1925
  }
1857
1926
  };
1927
+ const openEditProfileModal = () => {
1928
+ setEditProfileData({
1929
+ first_name: loggedUser?.first_name || "",
1930
+ last_name: loggedUser?.last_name || "",
1931
+ email: loggedUser?.email || "",
1932
+ phonenumber: loggedUser?.phonenumber || "",
1933
+ job_title: loggedUser?.job_title || "",
1934
+ department: loggedUser?.department || ""
1935
+ });
1936
+ setShowEditProfileModal(true);
1937
+ };
1938
+ const handleSaveProfile = async () => {
1939
+ setSavingProfile(true);
1940
+ try {
1941
+ const response = await UserServices.updateMyProfile(editProfileData);
1942
+ if (response.success) {
1943
+ success("Profil mis \xE0 jour avec succ\xE8s");
1944
+ setShowEditProfileModal(false);
1945
+ window.location.reload();
1946
+ } else {
1947
+ showError(response.message || "Erreur lors de la mise \xE0 jour du profil");
1948
+ }
1949
+ } catch (error) {
1950
+ console.error("Erreur lors de la mise \xE0 jour du profil:", error);
1951
+ showError("Erreur lors de la mise \xE0 jour du profil");
1952
+ } finally {
1953
+ setSavingProfile(false);
1954
+ }
1955
+ };
1956
+ const handlePhotoChange = async (event) => {
1957
+ const file = event.target.files?.[0];
1958
+ if (!file) return;
1959
+ const allowedTypes = ["image/jpeg", "image/png", "image/gif", "image/webp"];
1960
+ if (!allowedTypes.includes(file.type)) {
1961
+ showError("Format de fichier non support\xE9. Utilisez JPG, PNG, GIF ou WebP.");
1962
+ return;
1963
+ }
1964
+ const maxSize = 5 * 1024 * 1024;
1965
+ if (file.size > maxSize) {
1966
+ showError("La taille du fichier ne doit pas d\xE9passer 5 MB");
1967
+ return;
1968
+ }
1969
+ setUploadingPhoto(true);
1970
+ try {
1971
+ const response = await UserServices.updateProfilePicture(file);
1972
+ if (response.success) {
1973
+ success("Photo de profil mise \xE0 jour avec succ\xE8s");
1974
+ window.location.reload();
1975
+ } else {
1976
+ showError(response.message || "Erreur lors du t\xE9l\xE9chargement de la photo");
1977
+ }
1978
+ } catch (error) {
1979
+ console.error("Erreur lors du t\xE9l\xE9chargement de la photo:", error);
1980
+ showError("Erreur lors du t\xE9l\xE9chargement de la photo");
1981
+ } finally {
1982
+ setUploadingPhoto(false);
1983
+ if (fileInputRef.current) {
1984
+ fileInputRef.current.value = "";
1985
+ }
1986
+ }
1987
+ };
1988
+ const handleDeletePhoto = async () => {
1989
+ setUploadingPhoto(true);
1990
+ try {
1991
+ const response = await UserServices.deleteProfilePicture();
1992
+ if (response.success) {
1993
+ success("Photo de profil supprim\xE9e");
1994
+ window.location.reload();
1995
+ } else {
1996
+ showError(response.message || "Erreur lors de la suppression de la photo");
1997
+ }
1998
+ } catch (error) {
1999
+ console.error("Erreur lors de la suppression de la photo:", error);
2000
+ showError("Erreur lors de la suppression de la photo");
2001
+ } finally {
2002
+ setUploadingPhoto(false);
2003
+ }
2004
+ };
2005
+ const openChangePasswordModal = () => {
2006
+ setPasswordData({
2007
+ current_password: "",
2008
+ new_password: "",
2009
+ confirm_password: ""
2010
+ });
2011
+ setShowCurrentPassword(false);
2012
+ setShowNewPassword(false);
2013
+ setShowConfirmPassword(false);
2014
+ setShowChangePasswordModal(true);
2015
+ };
2016
+ const handleChangePassword = async () => {
2017
+ if (!passwordData.current_password) {
2018
+ showError("Veuillez entrer votre mot de passe actuel");
2019
+ return;
2020
+ }
2021
+ if (!passwordData.new_password) {
2022
+ showError("Veuillez entrer un nouveau mot de passe");
2023
+ return;
2024
+ }
2025
+ if (passwordData.new_password.length < 8) {
2026
+ showError("Le nouveau mot de passe doit contenir au moins 8 caract\xE8res");
2027
+ return;
2028
+ }
2029
+ if (passwordData.new_password !== passwordData.confirm_password) {
2030
+ showError("Les mots de passe ne correspondent pas");
2031
+ return;
2032
+ }
2033
+ setSavingPassword(true);
2034
+ try {
2035
+ const response = await UserServices.changePassword(passwordData);
2036
+ if (response.success) {
2037
+ success("Mot de passe chang\xE9 avec succ\xE8s");
2038
+ setShowChangePasswordModal(false);
2039
+ setPasswordData({
2040
+ current_password: "",
2041
+ new_password: "",
2042
+ confirm_password: ""
2043
+ });
2044
+ } else {
2045
+ showError(response.message || "Erreur lors du changement de mot de passe");
2046
+ }
2047
+ } catch (error) {
2048
+ console.error("Erreur lors du changement de mot de passe:", error);
2049
+ showError("Mot de passe actuel incorrect ou erreur serveur");
2050
+ } finally {
2051
+ setSavingPassword(false);
2052
+ }
2053
+ };
1858
2054
  return /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)("div", { className: "flex h-screen bg-[var(--color-background)] overflow-hidden", children: [
1859
2055
  /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
1860
2056
  "a",
@@ -2404,6 +2600,10 @@ var RewiseLayout = ({ children, module_name = "Rewise", module_description = "De
2404
2600
  /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)(
2405
2601
  "button",
2406
2602
  {
2603
+ onClick: () => {
2604
+ setShowProfileModal(true);
2605
+ setShowUserMenu(false);
2606
+ },
2407
2607
  className: "w-full flex items-center gap-3 px-3 py-2 rounded-lg hover:bg-[var(--color-surface-hover)] transition-colors",
2408
2608
  role: "menuitem",
2409
2609
  children: [
@@ -2701,6 +2901,418 @@ var RewiseLayout = ({ children, module_name = "Rewise", module_description = "De
2701
2901
  }
2702
2902
  )
2703
2903
  }
2904
+ ),
2905
+ /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
2906
+ Modals_default,
2907
+ {
2908
+ title: "Mon Profil",
2909
+ description: "G\xE9rez vos informations personnelles",
2910
+ width: "max-w-2xl",
2911
+ open: showProfileModal,
2912
+ onClose: () => setShowProfileModal(false),
2913
+ children: /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)("div", { className: "space-y-6", children: [
2914
+ /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
2915
+ "input",
2916
+ {
2917
+ ref: fileInputRef,
2918
+ type: "file",
2919
+ accept: "image/jpeg,image/png,image/gif,image/webp",
2920
+ onChange: handlePhotoChange,
2921
+ className: "hidden"
2922
+ }
2923
+ ),
2924
+ /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)("div", { className: "flex flex-col sm:flex-row items-center gap-6 pb-6 border-b border-[var(--color-border)]", children: [
2925
+ /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)("div", { className: "relative group", children: [
2926
+ /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("div", { className: "w-24 h-24 bg-gradient-to-br from-[var(--color-primary)] to-[var(--color-accent)] rounded-full flex items-center justify-center shadow-lg overflow-hidden", children: uploadingPhoto ? /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(import_lucide_react3.Loader2, { className: "w-8 h-8 text-white animate-spin" }) : loggedUser?.profile_picture ? /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
2927
+ "img",
2928
+ {
2929
+ src: loggedUser.profile_picture,
2930
+ alt: "Photo de profil",
2931
+ className: "w-full h-full rounded-full object-cover"
2932
+ }
2933
+ ) : /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)("span", { className: "text-3xl font-bold text-white", children: [
2934
+ loggedUser?.first_name?.charAt(0) || loggedUser?.username?.charAt(0) || "U",
2935
+ loggedUser?.last_name?.charAt(0) || ""
2936
+ ] }) }),
2937
+ /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)("div", { className: "absolute -bottom-1 -right-1 flex gap-1", children: [
2938
+ /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
2939
+ "button",
2940
+ {
2941
+ onClick: () => fileInputRef.current?.click(),
2942
+ disabled: uploadingPhoto,
2943
+ className: "w-8 h-8 bg-[var(--color-primary)] border-2 border-[var(--color-background)] rounded-full flex items-center justify-center shadow-md hover:bg-[var(--color-primary-dark)] transition-colors disabled:opacity-50",
2944
+ title: "Changer la photo",
2945
+ children: /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(import_lucide_react3.Camera, { className: "w-4 h-4 text-white" })
2946
+ }
2947
+ ),
2948
+ loggedUser?.profile_picture && /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
2949
+ "button",
2950
+ {
2951
+ onClick: handleDeletePhoto,
2952
+ disabled: uploadingPhoto,
2953
+ className: "w-8 h-8 bg-red-500 border-2 border-[var(--color-background)] rounded-full flex items-center justify-center shadow-md hover:bg-red-600 transition-colors disabled:opacity-50",
2954
+ title: "Supprimer la photo",
2955
+ children: /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(import_lucide_react3.Trash2, { className: "w-4 h-4 text-white" })
2956
+ }
2957
+ )
2958
+ ] })
2959
+ ] }),
2960
+ /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)("div", { className: "text-center sm:text-left flex-1", children: [
2961
+ /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("h2", { className: "text-xl font-bold text-[var(--color-text-primary)]", children: loggedUser?.first_name && loggedUser?.last_name ? `${loggedUser.first_name} ${loggedUser.last_name}` : loggedUser?.username || "Utilisateur" }),
2962
+ /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("p", { className: "text-[var(--color-text-secondary)] mt-1", children: loggedUser?.job_title || "Membre de l'\xE9quipe" }),
2963
+ /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)("div", { className: "flex items-center justify-center sm:justify-start gap-2 mt-2", children: [
2964
+ /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("span", { className: cn(
2965
+ "px-2 py-1 text-xs font-medium rounded-full",
2966
+ loggedUser?.is_active ? "bg-green-100 text-green-700" : "bg-gray-100 text-gray-600"
2967
+ ), children: loggedUser?.is_active ? "Actif" : "Inactif" }),
2968
+ loggedUser?.is_staff && /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("span", { className: "px-2 py-1 text-xs font-medium rounded-full bg-blue-100 text-blue-700", children: "Staff" })
2969
+ ] })
2970
+ ] }),
2971
+ /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)(
2972
+ "button",
2973
+ {
2974
+ onClick: openEditProfileModal,
2975
+ className: "flex items-center gap-2 px-4 py-2 bg-[var(--color-primary)] text-white rounded-lg hover:bg-[var(--color-primary-dark)] transition-colors",
2976
+ title: "Modifier le profil",
2977
+ children: [
2978
+ /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(import_lucide_react3.Edit3, { className: "w-4 h-4" }),
2979
+ /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("span", { className: "text-sm font-medium", children: "Modifier" })
2980
+ ]
2981
+ }
2982
+ )
2983
+ ] }),
2984
+ /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)("div", { className: "grid grid-cols-1 md:grid-cols-2 gap-4", children: [
2985
+ /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)("div", { className: "flex items-center gap-3 p-4 bg-[var(--color-surface)] rounded-lg border border-[var(--color-border)]", children: [
2986
+ /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("div", { className: "w-10 h-10 bg-[var(--color-primary-light)] rounded-lg flex items-center justify-center", children: /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(import_lucide_react3.Mail, { className: "w-5 h-5 text-[var(--color-primary)]" }) }),
2987
+ /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)("div", { className: "flex-1 min-w-0", children: [
2988
+ /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("p", { className: "text-xs text-[var(--color-text-tertiary)] uppercase tracking-wide", children: "Email" }),
2989
+ /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("p", { className: "text-sm font-medium text-[var(--color-text-primary)] truncate", children: loggedUser?.email || "Non renseign\xE9" })
2990
+ ] })
2991
+ ] }),
2992
+ /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)("div", { className: "flex items-center gap-3 p-4 bg-[var(--color-surface)] rounded-lg border border-[var(--color-border)]", children: [
2993
+ /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("div", { className: "w-10 h-10 bg-[var(--color-primary-light)] rounded-lg flex items-center justify-center", children: /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(import_lucide_react3.Phone, { className: "w-5 h-5 text-[var(--color-primary)]" }) }),
2994
+ /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)("div", { className: "flex-1 min-w-0", children: [
2995
+ /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("p", { className: "text-xs text-[var(--color-text-tertiary)] uppercase tracking-wide", children: "T\xE9l\xE9phone" }),
2996
+ /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("p", { className: "text-sm font-medium text-[var(--color-text-primary)] truncate", children: loggedUser?.phonenumber || "Non renseign\xE9" })
2997
+ ] })
2998
+ ] }),
2999
+ /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)("div", { className: "flex items-center gap-3 p-4 bg-[var(--color-surface)] rounded-lg border border-[var(--color-border)]", children: [
3000
+ /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("div", { className: "w-10 h-10 bg-[var(--color-primary-light)] rounded-lg flex items-center justify-center", children: /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(import_lucide_react3.User, { className: "w-5 h-5 text-[var(--color-primary)]" }) }),
3001
+ /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)("div", { className: "flex-1 min-w-0", children: [
3002
+ /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("p", { className: "text-xs text-[var(--color-text-tertiary)] uppercase tracking-wide", children: "Nom d'utilisateur" }),
3003
+ /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("p", { className: "text-sm font-medium text-[var(--color-text-primary)] truncate", children: loggedUser?.username || "Non renseign\xE9" })
3004
+ ] })
3005
+ ] }),
3006
+ /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)("div", { className: "flex items-center gap-3 p-4 bg-[var(--color-surface)] rounded-lg border border-[var(--color-border)]", children: [
3007
+ /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("div", { className: "w-10 h-10 bg-[var(--color-primary-light)] rounded-lg flex items-center justify-center", children: /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(import_lucide_react3.Briefcase, { className: "w-5 h-5 text-[var(--color-primary)]" }) }),
3008
+ /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)("div", { className: "flex-1 min-w-0", children: [
3009
+ /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("p", { className: "text-xs text-[var(--color-text-tertiary)] uppercase tracking-wide", children: "D\xE9partement" }),
3010
+ /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("p", { className: "text-sm font-medium text-[var(--color-text-primary)] truncate", children: loggedUser?.department || "Non renseign\xE9" })
3011
+ ] })
3012
+ ] })
3013
+ ] }),
3014
+ loggedUser?.centers_access && loggedUser.centers_access.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)("div", { className: "pt-4 border-t border-[var(--color-border)]", children: [
3015
+ /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)("h3", { className: "text-sm font-semibold text-[var(--color-text-primary)] mb-3 flex items-center gap-2", children: [
3016
+ /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(import_lucide_react3.Building2, { className: "w-4 h-4 text-[var(--color-primary)]" }),
3017
+ "Centres d'acc\xE8s (",
3018
+ loggedUser.centers_access.length,
3019
+ ")"
3020
+ ] }),
3021
+ /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("div", { className: "flex flex-wrap gap-2", children: loggedUser.centers_access.map((center) => /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
3022
+ "span",
3023
+ {
3024
+ className: cn(
3025
+ "px-3 py-1.5 text-sm rounded-lg border transition-colors",
3026
+ activeBusinessEntity?.id === center.id ? "bg-[var(--color-primary)] text-white border-[var(--color-primary)]" : "bg-[var(--color-surface)] text-[var(--color-text-secondary)] border-[var(--color-border)] hover:bg-[var(--color-surface-hover)]"
3027
+ ),
3028
+ children: center.legal_name
3029
+ },
3030
+ center.id
3031
+ )) })
3032
+ ] }),
3033
+ /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)("div", { className: "pt-4 border-t border-[var(--color-border)]", children: [
3034
+ /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)("h3", { className: "text-sm font-semibold text-[var(--color-text-primary)] mb-3 flex items-center gap-2", children: [
3035
+ /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(import_lucide_react3.Shield, { className: "w-4 h-4 text-[var(--color-primary)]" }),
3036
+ "S\xE9curit\xE9 du compte"
3037
+ ] }),
3038
+ /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)("div", { className: "grid grid-cols-1 sm:grid-cols-2 gap-3", children: [
3039
+ /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)("div", { className: "flex items-center justify-between p-3 bg-[var(--color-surface)] rounded-lg", children: [
3040
+ /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("span", { className: "text-sm text-[var(--color-text-secondary)]", children: "Derni\xE8re connexion" }),
3041
+ /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("span", { className: "text-sm font-medium text-[var(--color-text-primary)]", children: loggedUser?.last_login ? new Date(loggedUser.last_login).toLocaleDateString("fr-FR", {
3042
+ day: "numeric",
3043
+ month: "short",
3044
+ year: "numeric",
3045
+ hour: "2-digit",
3046
+ minute: "2-digit"
3047
+ }) : "Aujourd'hui" })
3048
+ ] }),
3049
+ /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)("div", { className: "flex items-center justify-between p-3 bg-[var(--color-surface)] rounded-lg", children: [
3050
+ /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("span", { className: "text-sm text-[var(--color-text-secondary)]", children: "Membre depuis" }),
3051
+ /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("span", { className: "text-sm font-medium text-[var(--color-text-primary)]", children: loggedUser?.date_joined ? new Date(loggedUser.date_joined).toLocaleDateString("fr-FR", {
3052
+ day: "numeric",
3053
+ month: "short",
3054
+ year: "numeric"
3055
+ }) : "N/A" })
3056
+ ] })
3057
+ ] }),
3058
+ /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)(
3059
+ "button",
3060
+ {
3061
+ onClick: openChangePasswordModal,
3062
+ className: "mt-4 w-full flex items-center justify-center gap-2 px-4 py-2.5 border border-[var(--color-border)] text-[var(--color-text-secondary)] rounded-lg hover:bg-[var(--color-surface-hover)] transition-colors",
3063
+ children: [
3064
+ /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(import_lucide_react3.Lock, { className: "w-4 h-4" }),
3065
+ /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("span", { className: "text-sm font-medium", children: "Changer le mot de passe" })
3066
+ ]
3067
+ }
3068
+ )
3069
+ ] })
3070
+ ] })
3071
+ }
3072
+ ),
3073
+ /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
3074
+ Modals_default,
3075
+ {
3076
+ title: "Modifier mon profil",
3077
+ description: "Mettez \xE0 jour vos informations personnelles",
3078
+ width: "max-w-lg",
3079
+ open: showEditProfileModal,
3080
+ onClose: () => setShowEditProfileModal(false),
3081
+ children: /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)("div", { className: "space-y-4", children: [
3082
+ /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)("div", { className: "grid grid-cols-2 gap-4", children: [
3083
+ /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)("div", { children: [
3084
+ /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("label", { className: "block text-sm font-medium text-[var(--color-text-secondary)] mb-1", children: "Pr\xE9nom" }),
3085
+ /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
3086
+ "input",
3087
+ {
3088
+ type: "text",
3089
+ value: editProfileData.first_name,
3090
+ onChange: (e) => setEditProfileData((prev) => ({ ...prev, first_name: e.target.value })),
3091
+ className: "w-full px-3 py-2 border border-[var(--color-border)] rounded-lg focus:outline-none focus:ring-2 focus:ring-[var(--color-primary)] focus:border-transparent bg-[var(--color-background)] text-[var(--color-text-primary)]",
3092
+ placeholder: "Votre pr\xE9nom"
3093
+ }
3094
+ )
3095
+ ] }),
3096
+ /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)("div", { children: [
3097
+ /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("label", { className: "block text-sm font-medium text-[var(--color-text-secondary)] mb-1", children: "Nom" }),
3098
+ /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
3099
+ "input",
3100
+ {
3101
+ type: "text",
3102
+ value: editProfileData.last_name,
3103
+ onChange: (e) => setEditProfileData((prev) => ({ ...prev, last_name: e.target.value })),
3104
+ className: "w-full px-3 py-2 border border-[var(--color-border)] rounded-lg focus:outline-none focus:ring-2 focus:ring-[var(--color-primary)] focus:border-transparent bg-[var(--color-background)] text-[var(--color-text-primary)]",
3105
+ placeholder: "Votre nom"
3106
+ }
3107
+ )
3108
+ ] })
3109
+ ] }),
3110
+ /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)("div", { children: [
3111
+ /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("label", { className: "block text-sm font-medium text-[var(--color-text-secondary)] mb-1", children: "Email" }),
3112
+ /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)("div", { className: "relative", children: [
3113
+ /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(import_lucide_react3.Mail, { className: "absolute left-3 top-1/2 -translate-y-1/2 w-4 h-4 text-[var(--color-text-tertiary)]" }),
3114
+ /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
3115
+ "input",
3116
+ {
3117
+ type: "email",
3118
+ value: editProfileData.email,
3119
+ onChange: (e) => setEditProfileData((prev) => ({ ...prev, email: e.target.value })),
3120
+ className: "w-full pl-10 pr-3 py-2 border border-[var(--color-border)] rounded-lg focus:outline-none focus:ring-2 focus:ring-[var(--color-primary)] focus:border-transparent bg-[var(--color-background)] text-[var(--color-text-primary)]",
3121
+ placeholder: "votre@email.com"
3122
+ }
3123
+ )
3124
+ ] })
3125
+ ] }),
3126
+ /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)("div", { children: [
3127
+ /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("label", { className: "block text-sm font-medium text-[var(--color-text-secondary)] mb-1", children: "T\xE9l\xE9phone" }),
3128
+ /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)("div", { className: "relative", children: [
3129
+ /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(import_lucide_react3.Phone, { className: "absolute left-3 top-1/2 -translate-y-1/2 w-4 h-4 text-[var(--color-text-tertiary)]" }),
3130
+ /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
3131
+ "input",
3132
+ {
3133
+ type: "tel",
3134
+ value: editProfileData.phonenumber,
3135
+ onChange: (e) => setEditProfileData((prev) => ({ ...prev, phonenumber: e.target.value })),
3136
+ className: "w-full pl-10 pr-3 py-2 border border-[var(--color-border)] rounded-lg focus:outline-none focus:ring-2 focus:ring-[var(--color-primary)] focus:border-transparent bg-[var(--color-background)] text-[var(--color-text-primary)]",
3137
+ placeholder: "+225 XX XX XX XX"
3138
+ }
3139
+ )
3140
+ ] })
3141
+ ] }),
3142
+ /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)("div", { children: [
3143
+ /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("label", { className: "block text-sm font-medium text-[var(--color-text-secondary)] mb-1", children: "Poste / Titre" }),
3144
+ /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)("div", { className: "relative", children: [
3145
+ /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(import_lucide_react3.Briefcase, { className: "absolute left-3 top-1/2 -translate-y-1/2 w-4 h-4 text-[var(--color-text-tertiary)]" }),
3146
+ /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
3147
+ "input",
3148
+ {
3149
+ type: "text",
3150
+ value: editProfileData.job_title,
3151
+ onChange: (e) => setEditProfileData((prev) => ({ ...prev, job_title: e.target.value })),
3152
+ className: "w-full pl-10 pr-3 py-2 border border-[var(--color-border)] rounded-lg focus:outline-none focus:ring-2 focus:ring-[var(--color-primary)] focus:border-transparent bg-[var(--color-background)] text-[var(--color-text-primary)]",
3153
+ placeholder: "Ex: Responsable Commercial"
3154
+ }
3155
+ )
3156
+ ] })
3157
+ ] }),
3158
+ /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)("div", { children: [
3159
+ /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("label", { className: "block text-sm font-medium text-[var(--color-text-secondary)] mb-1", children: "D\xE9partement" }),
3160
+ /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)("div", { className: "relative", children: [
3161
+ /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(import_lucide_react3.Building2, { className: "absolute left-3 top-1/2 -translate-y-1/2 w-4 h-4 text-[var(--color-text-tertiary)]" }),
3162
+ /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
3163
+ "input",
3164
+ {
3165
+ type: "text",
3166
+ value: editProfileData.department,
3167
+ onChange: (e) => setEditProfileData((prev) => ({ ...prev, department: e.target.value })),
3168
+ className: "w-full pl-10 pr-3 py-2 border border-[var(--color-border)] rounded-lg focus:outline-none focus:ring-2 focus:ring-[var(--color-primary)] focus:border-transparent bg-[var(--color-background)] text-[var(--color-text-primary)]",
3169
+ placeholder: "Ex: Ventes"
3170
+ }
3171
+ )
3172
+ ] })
3173
+ ] }),
3174
+ /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)("div", { className: "flex justify-end gap-3 pt-4 border-t border-[var(--color-border)]", children: [
3175
+ /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
3176
+ "button",
3177
+ {
3178
+ onClick: () => setShowEditProfileModal(false),
3179
+ className: "px-4 py-2 text-sm font-medium text-[var(--color-text-secondary)] bg-[var(--color-surface)] border border-[var(--color-border)] rounded-lg hover:bg-[var(--color-surface-hover)] transition-colors",
3180
+ children: "Annuler"
3181
+ }
3182
+ ),
3183
+ /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)(
3184
+ "button",
3185
+ {
3186
+ onClick: handleSaveProfile,
3187
+ disabled: savingProfile,
3188
+ className: "flex items-center gap-2 px-4 py-2 text-sm font-medium text-white bg-[var(--color-primary)] rounded-lg hover:bg-[var(--color-primary-dark)] transition-colors disabled:opacity-50",
3189
+ children: [
3190
+ savingProfile ? /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(import_lucide_react3.Loader2, { className: "w-4 h-4 animate-spin" }) : /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(import_lucide_react3.Save, { className: "w-4 h-4" }),
3191
+ savingProfile ? "Enregistrement..." : "Enregistrer"
3192
+ ]
3193
+ }
3194
+ )
3195
+ ] })
3196
+ ] })
3197
+ }
3198
+ ),
3199
+ /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
3200
+ Modals_default,
3201
+ {
3202
+ title: "Changer le mot de passe",
3203
+ description: "Entrez votre mot de passe actuel et choisissez un nouveau mot de passe",
3204
+ width: "max-w-md",
3205
+ open: showChangePasswordModal,
3206
+ onClose: () => setShowChangePasswordModal(false),
3207
+ children: /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)("div", { className: "space-y-4", children: [
3208
+ /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)("div", { children: [
3209
+ /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("label", { className: "block text-sm font-medium text-[var(--color-text-secondary)] mb-1", children: "Mot de passe actuel" }),
3210
+ /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)("div", { className: "relative", children: [
3211
+ /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(import_lucide_react3.Lock, { className: "absolute left-3 top-1/2 -translate-y-1/2 w-4 h-4 text-[var(--color-text-tertiary)]" }),
3212
+ /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
3213
+ "input",
3214
+ {
3215
+ type: showCurrentPassword ? "text" : "password",
3216
+ value: passwordData.current_password,
3217
+ onChange: (e) => setPasswordData((prev) => ({ ...prev, current_password: e.target.value })),
3218
+ className: "w-full pl-10 pr-10 py-2 border border-[var(--color-border)] rounded-lg focus:outline-none focus:ring-2 focus:ring-[var(--color-primary)] focus:border-transparent bg-[var(--color-background)] text-[var(--color-text-primary)]",
3219
+ placeholder: "Votre mot de passe actuel"
3220
+ }
3221
+ ),
3222
+ /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
3223
+ "button",
3224
+ {
3225
+ type: "button",
3226
+ onClick: () => setShowCurrentPassword(!showCurrentPassword),
3227
+ className: "absolute right-3 top-1/2 -translate-y-1/2 text-[var(--color-text-tertiary)] hover:text-[var(--color-text-secondary)]",
3228
+ children: showCurrentPassword ? /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(import_lucide_react3.EyeOff, { className: "w-4 h-4" }) : /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(import_lucide_react3.Eye, { className: "w-4 h-4" })
3229
+ }
3230
+ )
3231
+ ] })
3232
+ ] }),
3233
+ /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)("div", { children: [
3234
+ /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("label", { className: "block text-sm font-medium text-[var(--color-text-secondary)] mb-1", children: "Nouveau mot de passe" }),
3235
+ /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)("div", { className: "relative", children: [
3236
+ /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(import_lucide_react3.Lock, { className: "absolute left-3 top-1/2 -translate-y-1/2 w-4 h-4 text-[var(--color-text-tertiary)]" }),
3237
+ /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
3238
+ "input",
3239
+ {
3240
+ type: showNewPassword ? "text" : "password",
3241
+ value: passwordData.new_password,
3242
+ onChange: (e) => setPasswordData((prev) => ({ ...prev, new_password: e.target.value })),
3243
+ className: "w-full pl-10 pr-10 py-2 border border-[var(--color-border)] rounded-lg focus:outline-none focus:ring-2 focus:ring-[var(--color-primary)] focus:border-transparent bg-[var(--color-background)] text-[var(--color-text-primary)]",
3244
+ placeholder: "Au moins 8 caract\xE8res"
3245
+ }
3246
+ ),
3247
+ /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
3248
+ "button",
3249
+ {
3250
+ type: "button",
3251
+ onClick: () => setShowNewPassword(!showNewPassword),
3252
+ className: "absolute right-3 top-1/2 -translate-y-1/2 text-[var(--color-text-tertiary)] hover:text-[var(--color-text-secondary)]",
3253
+ children: showNewPassword ? /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(import_lucide_react3.EyeOff, { className: "w-4 h-4" }) : /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(import_lucide_react3.Eye, { className: "w-4 h-4" })
3254
+ }
3255
+ )
3256
+ ] }),
3257
+ passwordData.new_password && passwordData.new_password.length < 8 && /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("p", { className: "mt-1 text-xs text-red-500", children: "Le mot de passe doit contenir au moins 8 caract\xE8res" })
3258
+ ] }),
3259
+ /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)("div", { children: [
3260
+ /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("label", { className: "block text-sm font-medium text-[var(--color-text-secondary)] mb-1", children: "Confirmer le nouveau mot de passe" }),
3261
+ /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)("div", { className: "relative", children: [
3262
+ /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(import_lucide_react3.Lock, { className: "absolute left-3 top-1/2 -translate-y-1/2 w-4 h-4 text-[var(--color-text-tertiary)]" }),
3263
+ /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
3264
+ "input",
3265
+ {
3266
+ type: showConfirmPassword ? "text" : "password",
3267
+ value: passwordData.confirm_password,
3268
+ onChange: (e) => setPasswordData((prev) => ({ ...prev, confirm_password: e.target.value })),
3269
+ className: cn(
3270
+ "w-full pl-10 pr-10 py-2 border rounded-lg focus:outline-none focus:ring-2 focus:ring-[var(--color-primary)] focus:border-transparent bg-[var(--color-background)] text-[var(--color-text-primary)]",
3271
+ passwordData.confirm_password && passwordData.new_password !== passwordData.confirm_password ? "border-red-500" : "border-[var(--color-border)]"
3272
+ ),
3273
+ placeholder: "R\xE9p\xE9tez le nouveau mot de passe"
3274
+ }
3275
+ ),
3276
+ /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
3277
+ "button",
3278
+ {
3279
+ type: "button",
3280
+ onClick: () => setShowConfirmPassword(!showConfirmPassword),
3281
+ className: "absolute right-3 top-1/2 -translate-y-1/2 text-[var(--color-text-tertiary)] hover:text-[var(--color-text-secondary)]",
3282
+ children: showConfirmPassword ? /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(import_lucide_react3.EyeOff, { className: "w-4 h-4" }) : /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(import_lucide_react3.Eye, { className: "w-4 h-4" })
3283
+ }
3284
+ )
3285
+ ] }),
3286
+ passwordData.confirm_password && passwordData.new_password !== passwordData.confirm_password && /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("p", { className: "mt-1 text-xs text-red-500", children: "Les mots de passe ne correspondent pas" }),
3287
+ passwordData.confirm_password && passwordData.new_password === passwordData.confirm_password && passwordData.new_password.length >= 8 && /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)("p", { className: "mt-1 text-xs text-green-600 flex items-center gap-1", children: [
3288
+ /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(import_lucide_react3.Check, { className: "w-3 h-3" }),
3289
+ " Les mots de passe correspondent"
3290
+ ] })
3291
+ ] }),
3292
+ /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)("div", { className: "flex justify-end gap-3 pt-4 border-t border-[var(--color-border)]", children: [
3293
+ /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
3294
+ "button",
3295
+ {
3296
+ onClick: () => setShowChangePasswordModal(false),
3297
+ className: "px-4 py-2 text-sm font-medium text-[var(--color-text-secondary)] bg-[var(--color-surface)] border border-[var(--color-border)] rounded-lg hover:bg-[var(--color-surface-hover)] transition-colors",
3298
+ children: "Annuler"
3299
+ }
3300
+ ),
3301
+ /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)(
3302
+ "button",
3303
+ {
3304
+ onClick: handleChangePassword,
3305
+ disabled: savingPassword || !passwordData.current_password || !passwordData.new_password || passwordData.new_password !== passwordData.confirm_password || passwordData.new_password.length < 8,
3306
+ className: "flex items-center gap-2 px-4 py-2 text-sm font-medium text-white bg-[var(--color-primary)] rounded-lg hover:bg-[var(--color-primary-dark)] transition-colors disabled:opacity-50 disabled:cursor-not-allowed",
3307
+ children: [
3308
+ savingPassword ? /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(import_lucide_react3.Loader2, { className: "w-4 h-4 animate-spin" }) : /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(import_lucide_react3.Shield, { className: "w-4 h-4" }),
3309
+ savingPassword ? "Modification..." : "Changer le mot de passe"
3310
+ ]
3311
+ }
3312
+ )
3313
+ ] })
3314
+ ] })
3315
+ }
2704
3316
  )
2705
3317
  ] });
2706
3318
  };
@@ -5132,515 +5744,11 @@ var useAlert = () => {
5132
5744
  };
5133
5745
 
5134
5746
  // src/components/common/CommonSelect.tsx
5135
- var import_react102 = require("react");
5136
-
5137
- // dist/index.js
5138
- var import_jsx_runtime17 = require("react/jsx-runtime");
5139
- var import_jsx_runtime18 = require("react/jsx-runtime");
5140
- var import_react_router_dom5 = require("react-router-dom");
5141
- var import_jsx_runtime19 = require("react/jsx-runtime");
5142
- var import_react12 = __toESM(require("react"), 1);
5143
- var import_react_router_dom6 = require("react-router-dom");
5144
- var import_lucide_react9 = require("lucide-react");
5145
- var import_clsx2 = require("clsx");
5146
- var import_tailwind_merge2 = require("tailwind-merge");
5147
5747
  var import_react13 = require("react");
5148
- var import_jsx_runtime20 = require("react/jsx-runtime");
5149
- var import_react14 = require("react");
5150
- var import_jsx_runtime21 = require("react/jsx-runtime");
5151
- var import_react15 = require("react");
5152
- var import_lucide_react10 = require("lucide-react");
5153
- var import_jsx_runtime22 = require("react/jsx-runtime");
5154
- var import_react16 = require("react");
5155
- var import_jsx_runtime23 = require("react/jsx-runtime");
5156
- var import_lucide_react11 = require("lucide-react");
5157
- var import_react_router_dom7 = require("react-router-dom");
5158
- var import_jsx_runtime24 = require("react/jsx-runtime");
5159
- var import_jsx_runtime25 = require("react/jsx-runtime");
5160
- var import_react17 = require("react");
5161
- var import_lucide_react12 = require("lucide-react");
5162
- var import_jsx_runtime26 = require("react/jsx-runtime");
5163
- var import_lucide_react13 = require("lucide-react");
5164
- var import_react18 = require("react");
5165
- var import_jsx_runtime27 = require("react/jsx-runtime");
5166
- var import_react19 = __toESM(require("react"), 1);
5167
- var import_react_router_dom8 = require("react-router-dom");
5168
- var import_lucide_react14 = require("lucide-react");
5169
- var import_jsx_runtime28 = require("react/jsx-runtime");
5170
- var import_react20 = require("react");
5171
- var import_react21 = require("react");
5172
- var import_lucide_react15 = require("lucide-react");
5173
- var import_jsx_runtime29 = require("react/jsx-runtime");
5174
- var import_lucide_react16 = require("lucide-react");
5175
- var import_jsx_runtime30 = require("react/jsx-runtime");
5176
- var import_react22 = require("react");
5177
- var import_jsx_runtime31 = require("react/jsx-runtime");
5178
- var import_jsx_runtime32 = require("react/jsx-runtime");
5179
- var import_react23 = require("react");
5180
- var import_jsx_runtime33 = require("react/jsx-runtime");
5181
- var import_jsx_runtime34 = require("react/jsx-runtime");
5182
- var import_react_router_dom9 = require("react-router-dom");
5183
- var import_jsx_runtime35 = require("react/jsx-runtime");
5184
- var import_react24 = __toESM(require("react"), 1);
5185
- var import_react_router_dom10 = require("react-router-dom");
5186
- var import_lucide_react17 = require("lucide-react");
5187
- var import_clsx3 = require("clsx");
5188
- var import_tailwind_merge3 = require("tailwind-merge");
5189
- var import_react25 = require("react");
5190
- var import_jsx_runtime36 = require("react/jsx-runtime");
5191
- var import_react26 = require("react");
5192
- var import_jsx_runtime37 = require("react/jsx-runtime");
5193
- var import_react27 = require("react");
5194
- var import_jsx_runtime38 = require("react/jsx-runtime");
5195
- var import_react28 = require("react");
5196
- var import_jsx_runtime39 = require("react/jsx-runtime");
5197
- var import_lucide_react18 = require("lucide-react");
5198
- var import_react_router_dom11 = require("react-router-dom");
5199
- var import_jsx_runtime40 = require("react/jsx-runtime");
5200
- var import_jsx_runtime41 = require("react/jsx-runtime");
5201
- var import_react29 = require("react");
5202
- var import_lucide_react19 = require("lucide-react");
5203
- var import_jsx_runtime42 = require("react/jsx-runtime");
5204
- var import_lucide_react20 = require("lucide-react");
5205
- var import_react30 = require("react");
5206
- var import_jsx_runtime43 = require("react/jsx-runtime");
5207
- var import_react31 = require("react");
5208
- var import_react_router_dom12 = require("react-router-dom");
5209
- var import_lucide_react21 = require("lucide-react");
5210
- var import_jsx_runtime44 = require("react/jsx-runtime");
5211
- var import_react32 = require("react");
5212
- var import_react33 = require("react");
5213
- var import_lucide_react22 = require("lucide-react");
5214
- var import_jsx_runtime45 = require("react/jsx-runtime");
5215
- var import_lucide_react23 = require("lucide-react");
5216
- var import_jsx_runtime46 = require("react/jsx-runtime");
5217
- var import_react34 = require("react");
5218
- var import_jsx_runtime47 = require("react/jsx-runtime");
5219
- var import_jsx_runtime48 = require("react/jsx-runtime");
5220
- var import_react35 = require("react");
5221
- var import_jsx_runtime49 = require("react/jsx-runtime");
5222
- var import_jsx_runtime50 = require("react/jsx-runtime");
5223
- var import_react_router_dom13 = require("react-router-dom");
5224
- var import_jsx_runtime51 = require("react/jsx-runtime");
5225
- var import_react36 = __toESM(require("react"), 1);
5226
- var import_react_router_dom14 = require("react-router-dom");
5227
- var import_lucide_react24 = require("lucide-react");
5228
- var import_clsx4 = require("clsx");
5229
- var import_tailwind_merge4 = require("tailwind-merge");
5230
- var import_react37 = require("react");
5231
- var import_jsx_runtime52 = require("react/jsx-runtime");
5232
- var import_react38 = require("react");
5233
- var import_jsx_runtime53 = require("react/jsx-runtime");
5234
- var import_react39 = require("react");
5235
- var import_jsx_runtime54 = require("react/jsx-runtime");
5236
- var import_react40 = require("react");
5237
- var import_jsx_runtime55 = require("react/jsx-runtime");
5238
- var import_lucide_react25 = require("lucide-react");
5239
- var import_react_router_dom15 = require("react-router-dom");
5240
- var import_jsx_runtime56 = require("react/jsx-runtime");
5241
- var import_jsx_runtime57 = require("react/jsx-runtime");
5242
- var import_react41 = require("react");
5243
- var import_lucide_react26 = require("lucide-react");
5244
- var import_jsx_runtime58 = require("react/jsx-runtime");
5245
- var import_lucide_react27 = require("lucide-react");
5246
- var import_react42 = require("react");
5247
- var import_jsx_runtime59 = require("react/jsx-runtime");
5248
- var import_react43 = require("react");
5249
- var import_react_router_dom16 = require("react-router-dom");
5250
- var import_lucide_react28 = require("lucide-react");
5251
- var import_jsx_runtime60 = require("react/jsx-runtime");
5252
- var import_react44 = require("react");
5253
- var import_react45 = require("react");
5254
- var import_lucide_react29 = require("lucide-react");
5255
- var import_jsx_runtime61 = require("react/jsx-runtime");
5256
- var import_lucide_react30 = require("lucide-react");
5257
- var import_jsx_runtime62 = require("react/jsx-runtime");
5258
- var import_react46 = require("react");
5259
- var import_jsx_runtime63 = require("react/jsx-runtime");
5260
- var import_jsx_runtime64 = require("react/jsx-runtime");
5261
- var import_react47 = require("react");
5262
- var import_jsx_runtime65 = require("react/jsx-runtime");
5263
- var import_jsx_runtime66 = require("react/jsx-runtime");
5264
- var import_react_router_dom17 = require("react-router-dom");
5265
- var import_jsx_runtime67 = require("react/jsx-runtime");
5266
- var import_react48 = __toESM(require("react"), 1);
5267
- var import_react_router_dom18 = require("react-router-dom");
5268
- var import_lucide_react31 = require("lucide-react");
5269
- var import_clsx5 = require("clsx");
5270
- var import_tailwind_merge5 = require("tailwind-merge");
5271
- var import_react49 = require("react");
5272
- var import_jsx_runtime68 = require("react/jsx-runtime");
5273
- var import_react50 = require("react");
5274
- var import_jsx_runtime69 = require("react/jsx-runtime");
5275
- var import_react51 = require("react");
5276
- var import_jsx_runtime70 = require("react/jsx-runtime");
5277
- var import_react52 = require("react");
5278
- var import_jsx_runtime71 = require("react/jsx-runtime");
5279
- var import_lucide_react32 = require("lucide-react");
5280
- var import_react_router_dom19 = require("react-router-dom");
5281
- var import_jsx_runtime72 = require("react/jsx-runtime");
5282
- var import_jsx_runtime73 = require("react/jsx-runtime");
5283
- var import_react53 = require("react");
5284
- var import_lucide_react33 = require("lucide-react");
5285
- var import_jsx_runtime74 = require("react/jsx-runtime");
5286
- var import_lucide_react34 = require("lucide-react");
5287
- var import_react54 = require("react");
5288
- var import_jsx_runtime75 = require("react/jsx-runtime");
5289
- var import_react55 = require("react");
5290
- var import_react_router_dom20 = require("react-router-dom");
5291
- var import_lucide_react35 = require("lucide-react");
5292
- var import_jsx_runtime76 = require("react/jsx-runtime");
5293
- var import_react56 = require("react");
5294
- var import_react57 = require("react");
5295
- var import_lucide_react36 = require("lucide-react");
5296
- var import_jsx_runtime77 = require("react/jsx-runtime");
5297
- var import_lucide_react37 = require("lucide-react");
5298
- var import_jsx_runtime78 = require("react/jsx-runtime");
5299
- var import_react58 = require("react");
5300
- var import_jsx_runtime79 = require("react/jsx-runtime");
5301
- var import_jsx_runtime80 = require("react/jsx-runtime");
5302
- var import_react59 = require("react");
5303
- var import_jsx_runtime81 = require("react/jsx-runtime");
5304
- var import_jsx_runtime82 = require("react/jsx-runtime");
5305
- var import_react_router_dom21 = require("react-router-dom");
5306
- var import_jsx_runtime83 = require("react/jsx-runtime");
5307
- var import_react60 = __toESM(require("react"), 1);
5308
- var import_react_router_dom22 = require("react-router-dom");
5309
- var import_lucide_react38 = require("lucide-react");
5310
- var import_clsx6 = require("clsx");
5311
- var import_tailwind_merge6 = require("tailwind-merge");
5312
- var import_react61 = require("react");
5313
- var import_jsx_runtime84 = require("react/jsx-runtime");
5314
- var import_react62 = require("react");
5315
- var import_jsx_runtime85 = require("react/jsx-runtime");
5316
- var import_react63 = require("react");
5317
- var import_jsx_runtime86 = require("react/jsx-runtime");
5318
- var import_react64 = require("react");
5319
- var import_jsx_runtime87 = require("react/jsx-runtime");
5320
- var import_lucide_react39 = require("lucide-react");
5321
- var import_react_router_dom23 = require("react-router-dom");
5322
- var import_jsx_runtime88 = require("react/jsx-runtime");
5323
- var import_jsx_runtime89 = require("react/jsx-runtime");
5324
- var import_react65 = require("react");
5325
- var import_lucide_react40 = require("lucide-react");
5326
- var import_jsx_runtime90 = require("react/jsx-runtime");
5327
- var import_lucide_react41 = require("lucide-react");
5328
- var import_react66 = require("react");
5329
- var import_jsx_runtime91 = require("react/jsx-runtime");
5330
- var import_react67 = require("react");
5331
- var import_react_router_dom24 = require("react-router-dom");
5332
- var import_lucide_react42 = require("lucide-react");
5333
- var import_jsx_runtime92 = require("react/jsx-runtime");
5334
- var import_react68 = require("react");
5335
- var import_react69 = require("react");
5336
- var import_lucide_react43 = require("lucide-react");
5337
- var import_jsx_runtime93 = require("react/jsx-runtime");
5338
- var import_lucide_react44 = require("lucide-react");
5339
- var import_jsx_runtime94 = require("react/jsx-runtime");
5340
- var import_react70 = require("react");
5341
- var import_jsx_runtime95 = require("react/jsx-runtime");
5342
- var import_jsx_runtime96 = require("react/jsx-runtime");
5343
- var import_react71 = require("react");
5344
- var import_jsx_runtime97 = require("react/jsx-runtime");
5345
- var import_jsx_runtime98 = require("react/jsx-runtime");
5346
- var import_react_router_dom25 = require("react-router-dom");
5347
- var import_jsx_runtime99 = require("react/jsx-runtime");
5348
- var import_react72 = __toESM(require("react"), 1);
5349
- var import_react_router_dom26 = require("react-router-dom");
5350
- var import_lucide_react45 = require("lucide-react");
5351
- var import_clsx7 = require("clsx");
5352
- var import_tailwind_merge7 = require("tailwind-merge");
5353
- var import_react73 = require("react");
5354
- var import_jsx_runtime100 = require("react/jsx-runtime");
5355
- var import_react74 = require("react");
5356
- var import_jsx_runtime101 = require("react/jsx-runtime");
5357
- var import_react75 = require("react");
5358
- var import_jsx_runtime102 = require("react/jsx-runtime");
5359
- var import_react76 = require("react");
5360
- var import_jsx_runtime103 = require("react/jsx-runtime");
5361
- var import_lucide_react46 = require("lucide-react");
5362
- var import_react_router_dom27 = require("react-router-dom");
5363
- var import_jsx_runtime104 = require("react/jsx-runtime");
5364
- var import_jsx_runtime105 = require("react/jsx-runtime");
5365
- var import_react77 = require("react");
5366
- var import_lucide_react47 = require("lucide-react");
5367
- var import_jsx_runtime106 = require("react/jsx-runtime");
5368
- var import_lucide_react48 = require("lucide-react");
5369
- var import_react78 = require("react");
5370
- var import_jsx_runtime107 = require("react/jsx-runtime");
5371
- var import_react79 = require("react");
5372
- var import_react_router_dom28 = require("react-router-dom");
5373
- var import_lucide_react49 = require("lucide-react");
5374
- var import_jsx_runtime108 = require("react/jsx-runtime");
5375
- var import_react80 = require("react");
5376
- var import_react81 = require("react");
5377
- var import_lucide_react50 = require("lucide-react");
5378
- var import_jsx_runtime109 = require("react/jsx-runtime");
5379
- var import_lucide_react51 = require("lucide-react");
5380
- var import_jsx_runtime110 = require("react/jsx-runtime");
5381
- var import_react82 = require("react");
5382
- var import_jsx_runtime111 = require("react/jsx-runtime");
5383
- var import_jsx_runtime112 = require("react/jsx-runtime");
5384
- var import_react83 = require("react");
5385
- var import_jsx_runtime113 = require("react/jsx-runtime");
5386
- var import_jsx_runtime114 = require("react/jsx-runtime");
5387
- var import_react_router_dom29 = require("react-router-dom");
5388
- var import_jsx_runtime115 = require("react/jsx-runtime");
5389
- var import_react84 = __toESM(require("react"), 1);
5390
- var import_react_router_dom30 = require("react-router-dom");
5391
- var import_lucide_react52 = require("lucide-react");
5392
- var import_clsx8 = require("clsx");
5393
- var import_tailwind_merge8 = require("tailwind-merge");
5394
- var import_react85 = require("react");
5395
- var import_jsx_runtime116 = require("react/jsx-runtime");
5396
- var import_react86 = require("react");
5397
- var import_jsx_runtime117 = require("react/jsx-runtime");
5398
- var import_react87 = require("react");
5399
- var import_jsx_runtime118 = require("react/jsx-runtime");
5400
- var import_react88 = require("react");
5401
- var import_jsx_runtime119 = require("react/jsx-runtime");
5402
- var import_lucide_react53 = require("lucide-react");
5403
- var import_react_router_dom31 = require("react-router-dom");
5404
- var import_jsx_runtime120 = require("react/jsx-runtime");
5405
- var import_jsx_runtime121 = require("react/jsx-runtime");
5406
- var import_react89 = require("react");
5407
- var import_lucide_react54 = require("lucide-react");
5408
- var import_jsx_runtime122 = require("react/jsx-runtime");
5409
- var import_lucide_react55 = require("lucide-react");
5410
- var import_react90 = require("react");
5411
- var import_jsx_runtime123 = require("react/jsx-runtime");
5412
- var import_react91 = require("react");
5413
- var import_react_router_dom32 = require("react-router-dom");
5414
- var import_lucide_react56 = require("lucide-react");
5415
- var import_jsx_runtime124 = require("react/jsx-runtime");
5416
- var import_react92 = require("react");
5417
- var import_react93 = require("react");
5418
- var import_lucide_react57 = require("lucide-react");
5419
- var import_jsx_runtime125 = require("react/jsx-runtime");
5420
- var import_lucide_react58 = require("lucide-react");
5421
- var import_jsx_runtime126 = require("react/jsx-runtime");
5422
- var import_react94 = require("react");
5423
- var import_jsx_runtime127 = require("react/jsx-runtime");
5424
- var import_jsx_runtime128 = require("react/jsx-runtime");
5425
- var import_react95 = require("react");
5426
- var import_jsx_runtime129 = require("react/jsx-runtime");
5427
- var import_jsx_runtime130 = require("react/jsx-runtime");
5428
- var import_react96 = require("react");
5429
- var import_jsx_runtime131 = require("react/jsx-runtime");
5430
- var import_jsx_runtime132 = require("react/jsx-runtime");
5431
- var import_jsx_runtime133 = require("react/jsx-runtime");
5432
- var import_react97 = require("react");
5433
- var import_jsx_runtime134 = require("react/jsx-runtime");
5434
- var import_jsx_runtime135 = require("react/jsx-runtime");
5435
- var import_jsx_runtime136 = require("react/jsx-runtime");
5436
- var import_react98 = require("react");
5437
- var import_jsx_runtime137 = require("react/jsx-runtime");
5438
- var import_jsx_runtime138 = require("react/jsx-runtime");
5439
- var import_jsx_runtime139 = require("react/jsx-runtime");
5440
- var import_react99 = require("react");
5441
- var import_jsx_runtime140 = require("react/jsx-runtime");
5442
- var import_jsx_runtime141 = require("react/jsx-runtime");
5443
- var import_jsx_runtime142 = require("react/jsx-runtime");
5444
- var import_react100 = require("react");
5445
- var import_jsx_runtime143 = require("react/jsx-runtime");
5446
- var import_jsx_runtime144 = require("react/jsx-runtime");
5447
- var import_jsx_runtime145 = require("react/jsx-runtime");
5448
- var PrimaryButton2 = ({
5449
- loading = false,
5450
- children,
5451
- classname = "",
5452
- variant = "full",
5453
- ...props
5454
- }) => /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(
5455
- "button",
5456
- {
5457
- type: "submit",
5458
- disabled: loading || props.disabled,
5459
- className: `px-4 py-2 text-sm rounded-lg hover:bg-opacity-80 transition-colors disabled:opacity-50 disabled:cursor-not-allowed flex justify-center items-center ${classname} ${variant === "full" ? "bg-[#6A8A82] text-white" : variant === "outline" ? "border border-[#6A8A82] text-[#6A8A82] bg-transparent" : "bg-transparent text-[#6A8A82]"}`,
5460
- ...props,
5461
- children: loading ? "Connexion en cours..." : children
5462
- }
5463
- );
5464
- var Buttons_default2 = PrimaryButton2;
5465
- var Modal2 = ({ title, description, width = "max-w-lg", open, onClose, children }) => {
5466
- if (!open) return null;
5467
- return /* @__PURE__ */ (0, import_jsx_runtime18.jsx)("div", { className: "fixed inset-0 bg-black bg-opacity-50 flex items-center justify-center z-50", children: /* @__PURE__ */ (0, import_jsx_runtime18.jsxs)("div", { className: `bg-white rounded-lg p-6 mx-4 w-full ${width}`, children: [
5468
- /* @__PURE__ */ (0, import_jsx_runtime18.jsxs)("div", { className: "flex justify-between items-start mb-6", children: [
5469
- /* @__PURE__ */ (0, import_jsx_runtime18.jsxs)("div", { children: [
5470
- /* @__PURE__ */ (0, import_jsx_runtime18.jsx)("h3", { className: "text-xl font-semibold text-tuatara flex items-center space-x-2", children: /* @__PURE__ */ (0, import_jsx_runtime18.jsx)("span", { children: title }) }),
5471
- description && /* @__PURE__ */ (0, import_jsx_runtime18.jsx)("p", { className: "text-sm text-gray-600 mt-1", children: description })
5472
- ] }),
5473
- /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(
5474
- "button",
5475
- {
5476
- onClick: onClose,
5477
- className: "text-gray-400 hover:text-gray-600 text-xl",
5478
- "aria-label": "Close modal",
5479
- children: "\u2715"
5480
- }
5481
- )
5482
- ] }),
5483
- /* @__PURE__ */ (0, import_jsx_runtime18.jsx)("div", { className: "w-full max-h-[80vh] overflow-y-auto", children })
5484
- ] }) });
5485
- };
5486
- var Modals_default2 = Modal2;
5487
- var InputField2 = ({
5488
- label,
5489
- name,
5490
- type = "text",
5491
- value,
5492
- placeholder,
5493
- required = false,
5494
- disabled = false,
5495
- error,
5496
- onChange,
5497
- onBlur
5498
- }) => {
5499
- return /* @__PURE__ */ (0, import_jsx_runtime19.jsxs)("div", { className: "flex flex-col gap-1 w-full", children: [
5500
- label && /* @__PURE__ */ (0, import_jsx_runtime19.jsxs)("label", { htmlFor: name, className: "block text-gray-700 text-sm font-medium mb-2", children: [
5501
- label,
5502
- " ",
5503
- required && /* @__PURE__ */ (0, import_jsx_runtime19.jsx)("span", { className: "text-red-500", children: "*" })
5504
- ] }),
5505
- /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(
5506
- "input",
5507
- {
5508
- id: name,
5509
- name,
5510
- type,
5511
- value,
5512
- placeholder,
5513
- required,
5514
- disabled,
5515
- onChange,
5516
- onBlur,
5517
- className: `w-full px-3 py-2 border border-[#D9D9D9] focus:ring-2 focus:ring-[#6A8A82]/20
5518
- ${error ? "border-red-500" : "border-gray-300"}
5519
- ${disabled ? "bg-gray-100 cursor-not-allowed" : ""}
5520
- `
5521
- }
5522
- ),
5523
- error && /* @__PURE__ */ (0, import_jsx_runtime19.jsx)("p", { className: "text-xs text-red-500", children: error })
5524
- ] });
5525
- };
5526
- var TextInput2 = (props) => {
5527
- return /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(InputField2, { ...props, type: "text" });
5528
- };
5529
- var ThemeContext2 = (0, import_react13.createContext)(void 0);
5530
- var chooseEnv2 = localStorage.getItem("env") ?? "prod";
5531
- var ADDRESS_IP2 = chooseEnv2 === "prod" ? "back.rewise.praeduim-tech.com" : "localhost:8000";
5532
- var ADDRESS_IP_URL2 = chooseEnv2 === "prod" ? `https://${ADDRESS_IP2}/` : `http://${ADDRESS_IP2}/`;
5533
- var API_URL2 = `${ADDRESS_IP_URL2}api`;
5534
- var API_BASE_URL3 = `${API_URL2}/core/auth/`;
5535
- var VENDORS_API_URL2 = `${API_URL2}/accounting/vendors/`;
5536
- var SessionContext2 = (0, import_react14.createContext)(void 0);
5537
- var API_BASE_URL22 = `${API_URL2}/core/auth/`;
5538
- var USERS_API_URL2 = `${API_URL2}/core/users/`;
5539
- var ToastContext2 = (0, import_react15.createContext)(void 0);
5540
- var APPROVAL_API_URL2 = `${API_URL2}/approvals/cases/`;
5541
- var AlertContext2 = (0, import_react22.createContext)(void 0);
5542
- var ThemeContext22 = (0, import_react25.createContext)(void 0);
5543
- var chooseEnv22 = localStorage.getItem("env") ?? "prod";
5544
- var ADDRESS_IP22 = chooseEnv22 === "prod" ? "back.rewise.praeduim-tech.com" : "localhost:8000";
5545
- var ADDRESS_IP_URL22 = chooseEnv22 === "prod" ? `https://${ADDRESS_IP22}/` : `http://${ADDRESS_IP22}/`;
5546
- var API_URL22 = `${ADDRESS_IP_URL22}api`;
5547
- var API_BASE_URL32 = `${API_URL22}/core/auth/`;
5548
- var SessionContext22 = (0, import_react26.createContext)(void 0);
5549
- var API_BASE_URL222 = `${API_URL22}/core/auth/`;
5550
- var USERS_API_URL22 = `${API_URL22}/core/users/`;
5551
- var ToastContext22 = (0, import_react27.createContext)(void 0);
5552
- var APPROVAL_API_URL22 = `${API_URL22}/approvals/cases/`;
5553
- var AlertContext22 = (0, import_react34.createContext)(void 0);
5554
- var VENDORS_API_URL22 = `${API_URL22}/accounting/vendors/`;
5555
- var ThemeContext222 = (0, import_react37.createContext)(void 0);
5556
- var chooseEnv222 = localStorage.getItem("env") ?? "prod";
5557
- var ADDRESS_IP222 = chooseEnv222 === "prod" ? "back.rewise.praeduim-tech.com" : "localhost:8000";
5558
- var ADDRESS_IP_URL222 = chooseEnv222 === "prod" ? `https://${ADDRESS_IP222}/` : `http://${ADDRESS_IP222}/`;
5559
- var API_URL222 = `${ADDRESS_IP_URL222}api`;
5560
- var API_BASE_URL322 = `${API_URL222}/core/auth/`;
5561
- var SessionContext222 = (0, import_react38.createContext)(void 0);
5562
- var API_BASE_URL2222 = `${API_URL222}/core/auth/`;
5563
- var USERS_API_URL222 = `${API_URL222}/core/users/`;
5564
- var ToastContext222 = (0, import_react39.createContext)(void 0);
5565
- var APPROVAL_API_URL222 = `${API_URL222}/approvals/cases/`;
5566
- var AlertContext222 = (0, import_react46.createContext)(void 0);
5567
- var VENDORS_API_URL222 = `${API_URL222}/accounting/vendors/`;
5568
- var ThemeContext2222 = (0, import_react49.createContext)(void 0);
5569
- var chooseEnv2222 = localStorage.getItem("env") ?? "prod";
5570
- var ADDRESS_IP2222 = chooseEnv2222 === "prod" ? "back.rewise.praeduim-tech.com" : "localhost:8000";
5571
- var ADDRESS_IP_URL2222 = chooseEnv2222 === "prod" ? `https://${ADDRESS_IP2222}/` : `http://${ADDRESS_IP2222}/`;
5572
- var API_URL2222 = `${ADDRESS_IP_URL2222}api`;
5573
- var API_BASE_URL3222 = `${API_URL2222}/core/auth/`;
5574
- var SessionContext2222 = (0, import_react50.createContext)(void 0);
5575
- var API_BASE_URL22222 = `${API_URL2222}/core/auth/`;
5576
- var USERS_API_URL2222 = `${API_URL2222}/core/users/`;
5577
- var ToastContext2222 = (0, import_react51.createContext)(void 0);
5578
- var APPROVAL_API_URL2222 = `${API_URL2222}/approvals/cases/`;
5579
- var AlertContext2222 = (0, import_react58.createContext)(void 0);
5580
- var VENDORS_API_URL2222 = `${API_URL2222}/accounting/vendors/`;
5581
- var ThemeContext22222 = (0, import_react61.createContext)(void 0);
5582
- var ADDRESS_IP22222 = "localhost:8000";
5583
- var ADDRESS_IP_URL22222 = `http://${ADDRESS_IP22222}/`;
5584
- var API_URL22222 = `${ADDRESS_IP_URL22222}api`;
5585
- var API_BASE_URL32222 = `${API_URL22222}/core/auth/`;
5586
- var SessionContext22222 = (0, import_react62.createContext)(void 0);
5587
- var API_BASE_URL222222 = `${API_URL22222}/core/auth/`;
5588
- var USERS_API_URL22222 = `${API_URL22222}/core/users/`;
5589
- var ToastContext22222 = (0, import_react63.createContext)(void 0);
5590
- var APPROVAL_API_URL22222 = `${API_URL22222}/approvals/cases/`;
5591
- var AlertContext22222 = (0, import_react70.createContext)(void 0);
5592
- var VENDORS_API_URL22222 = `${API_URL22222}/accounting/vendors/`;
5593
- var ThemeContext222222 = (0, import_react73.createContext)(void 0);
5594
- var ADDRESS_IP222222 = "localhost:8000";
5595
- var ADDRESS_IP_URL222222 = `http://${ADDRESS_IP222222}/`;
5596
- var API_URL222222 = `${ADDRESS_IP_URL222222}api`;
5597
- var API_BASE_URL322222 = `${API_URL222222}/core/auth/`;
5598
- var SessionContext222222 = (0, import_react74.createContext)(void 0);
5599
- var API_BASE_URL2222222 = `${API_URL222222}/core/auth/`;
5600
- var USERS_API_URL222222 = `${API_URL222222}/core/users/`;
5601
- var ToastContext222222 = (0, import_react75.createContext)(void 0);
5602
- var APPROVAL_API_URL222222 = `${API_URL222222}/approvals/cases/`;
5603
- var AlertContext222222 = (0, import_react82.createContext)(void 0);
5604
- var VENDORS_API_URL222222 = `${API_URL222222}/accounting/vendors/`;
5605
- var ThemeContext2222222 = (0, import_react85.createContext)(void 0);
5606
- var ADDRESS_IP2222222 = "localhost:8000";
5607
- var ADDRESS_IP_URL2222222 = `http://${ADDRESS_IP2222222}/`;
5608
- var API_URL2222222 = `${ADDRESS_IP_URL2222222}api`;
5609
- var API_BASE_URL3222222 = `${API_URL2222222}/core/auth/`;
5610
- var SessionContext2222222 = (0, import_react86.createContext)(void 0);
5611
- var API_BASE_URL22222222 = `${API_URL2222222}/core/auth/`;
5612
- var USERS_API_URL2222222 = `${API_URL2222222}/core/users/`;
5613
- var ToastContext2222222 = (0, import_react87.createContext)(void 0);
5614
- var APPROVAL_API_URL2222222 = `${API_URL2222222}/approvals/cases/`;
5615
- var AlertContext2222222 = (0, import_react94.createContext)(void 0);
5616
- var URI = `${API_URL222222}/core/departments/`;
5617
- var URI2 = `${API_URL222222}/accounting/profit-or-cost-center/`;
5618
- var COST_URI = `${API_URL222222}/accounting/cost-center/`;
5619
- var PROFIT_URI = `${API_URL222222}/accounting/profit-center/`;
5620
- var URI3 = `${API_URL22222}/core/departments/`;
5621
- var URI4 = `${API_URL22222}/accounting/profit-or-cost-center/`;
5622
- var COST_URI2 = `${API_URL22222}/accounting/cost-center/`;
5623
- var PROFIT_URI2 = `${API_URL22222}/accounting/profit-center/`;
5624
- var URI5 = `${API_URL2222}/core/departments/`;
5625
- var URI6 = `${API_URL2222}/accounting/profit-or-cost-center/`;
5626
- var COST_URI3 = `${API_URL2222}/accounting/cost-center/`;
5627
- var PROFIT_URI3 = `${API_URL2222}/accounting/profit-center/`;
5628
- var URI7 = `${API_URL222}/core/departments/`;
5629
- var URI8 = `${API_URL222}/accounting/profit-or-cost-center/`;
5630
- var COST_URI4 = `${API_URL222}/accounting/cost-center/`;
5631
- var PROFIT_URI4 = `${API_URL222}/accounting/profit-center/`;
5632
- var URI9 = `${API_URL22}/core/departments/`;
5633
- var URI10 = `${API_URL22}/accounting/profit-or-cost-center/`;
5634
- var COST_URI5 = `${API_URL22}/accounting/cost-center/`;
5635
- var PROFIT_URI5 = `${API_URL22}/accounting/profit-center/`;
5636
- var URI11 = `${API_URL2}/core/departments/`;
5637
- var URI12 = `${API_URL2}/accounting/profit-or-cost-center/`;
5638
- var COST_URI6 = `${API_URL2}/accounting/cost-center/`;
5639
- var PROFIT_URI6 = `${API_URL2}/accounting/profit-center/`;
5640
5748
 
5641
5749
  // src/components/common/FormVendor.tsx
5642
- var import_react101 = require("react");
5643
- var import_jsx_runtime146 = require("react/jsx-runtime");
5750
+ var import_react12 = require("react");
5751
+ var import_jsx_runtime17 = require("react/jsx-runtime");
5644
5752
  var MinimalVendorForm = ({
5645
5753
  isOpen,
5646
5754
  onClose,
@@ -5649,13 +5757,13 @@ var MinimalVendorForm = ({
5649
5757
  refresh = () => {
5650
5758
  }
5651
5759
  }) => {
5652
- const [formData, setFormData] = (0, import_react101.useState)(object || {
5760
+ const [formData, setFormData] = (0, import_react12.useState)(object || {
5653
5761
  from_module: from ?? null,
5654
5762
  legal_name: "",
5655
5763
  trading_name: ""
5656
5764
  });
5657
- const [errors, setErrors] = (0, import_react101.useState)({});
5658
- const [loading, setLoading] = (0, import_react101.useState)(false);
5765
+ const [errors, setErrors] = (0, import_react12.useState)({});
5766
+ const [loading, setLoading] = (0, import_react12.useState)(false);
5659
5767
  const { token } = useSession();
5660
5768
  const { success, error: showError } = useToast();
5661
5769
  const handleInputChange = (e) => {
@@ -5714,18 +5822,18 @@ var MinimalVendorForm = ({
5714
5822
  }
5715
5823
  };
5716
5824
  if (!isOpen) return null;
5717
- return /* @__PURE__ */ (0, import_jsx_runtime146.jsx)(
5718
- Modals_default2,
5825
+ return /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(
5826
+ Modals_default,
5719
5827
  {
5720
5828
  title: "Ajouter un fournisseur",
5721
5829
  width: "w-[100%]",
5722
5830
  description: ``,
5723
5831
  open: isOpen,
5724
5832
  onClose,
5725
- children: /* @__PURE__ */ (0, import_jsx_runtime146.jsxs)("form", { onSubmit: handleSubmit, className: "p-", children: [
5726
- /* @__PURE__ */ (0, import_jsx_runtime146.jsx)("div", { className: "space-y-4", children: /* @__PURE__ */ (0, import_jsx_runtime146.jsxs)("div", { className: "grid grid-cols-1 md:grid-cols-2 gap-4", children: [
5727
- /* @__PURE__ */ (0, import_jsx_runtime146.jsx)(
5728
- TextInput2,
5833
+ children: /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)("form", { onSubmit: handleSubmit, className: "p-", children: [
5834
+ /* @__PURE__ */ (0, import_jsx_runtime17.jsx)("div", { className: "space-y-4", children: /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)("div", { className: "grid grid-cols-1 md:grid-cols-2 gap-4", children: [
5835
+ /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(
5836
+ TextInput,
5729
5837
  {
5730
5838
  label: "Raison sociale",
5731
5839
  name: "legal_name",
@@ -5736,8 +5844,8 @@ var MinimalVendorForm = ({
5736
5844
  onChange: handleInputChange
5737
5845
  }
5738
5846
  ),
5739
- /* @__PURE__ */ (0, import_jsx_runtime146.jsx)(
5740
- TextInput2,
5847
+ /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(
5848
+ TextInput,
5741
5849
  {
5742
5850
  label: "Nom commercial",
5743
5851
  name: "trading_name",
@@ -5747,8 +5855,8 @@ var MinimalVendorForm = ({
5747
5855
  }
5748
5856
  )
5749
5857
  ] }) }),
5750
- /* @__PURE__ */ (0, import_jsx_runtime146.jsxs)("div", { className: "flex justify-between pt-6 mt-8", children: [
5751
- /* @__PURE__ */ (0, import_jsx_runtime146.jsx)(
5858
+ /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)("div", { className: "flex justify-between pt-6 mt-8", children: [
5859
+ /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(
5752
5860
  "button",
5753
5861
  {
5754
5862
  type: "button",
@@ -5757,8 +5865,8 @@ var MinimalVendorForm = ({
5757
5865
  children: "Annuler"
5758
5866
  }
5759
5867
  ),
5760
- /* @__PURE__ */ (0, import_jsx_runtime146.jsx)(
5761
- Buttons_default2,
5868
+ /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(
5869
+ Buttons_default,
5762
5870
  {
5763
5871
  type: "button",
5764
5872
  onClick: handleSubmit,
@@ -5773,43 +5881,43 @@ var MinimalVendorForm = ({
5773
5881
  };
5774
5882
 
5775
5883
  // src/services/DepartmentServices.ts
5776
- var URI13 = `${API_URL}/core/departments/`;
5884
+ var URI = `${API_URL}/core/departments/`;
5777
5885
  var DepartmentServices = {
5778
- create: (data) => FetchApi.post(`${URI13}`, data),
5779
- get: (id) => FetchApi.get(`${URI13}${id}/`),
5780
- list: (params) => FetchApi.get(`${URI13}?${new URLSearchParams(params).toString()}`),
5781
- update: (id, data) => FetchApi.put(`${URI13}${id}/`, data),
5782
- delete: (id) => FetchApi.delete(`${URI13}${id}/`)
5886
+ create: (data) => FetchApi.post(`${URI}`, data),
5887
+ get: (id) => FetchApi.get(`${URI}${id}/`),
5888
+ list: (params) => FetchApi.get(`${URI}?${new URLSearchParams(params).toString()}`),
5889
+ update: (id, data) => FetchApi.put(`${URI}${id}/`, data),
5890
+ delete: (id) => FetchApi.delete(`${URI}${id}/`)
5783
5891
  };
5784
5892
 
5785
5893
  // src/services/ProfitCostsServices.ts
5786
- var URI14 = `${API_URL}/accounting/profit-or-cost-center/`;
5787
- var COST_URI7 = `${API_URL}/accounting/cost-center/`;
5894
+ var URI2 = `${API_URL}/accounting/profit-or-cost-center/`;
5895
+ var COST_URI = `${API_URL}/accounting/cost-center/`;
5788
5896
  var CostServices = {
5789
- create: (data) => FetchApi.post(`${COST_URI7}`, data),
5790
- get: (id) => FetchApi.get(`${COST_URI7}${id}/`),
5791
- list: (params) => FetchApi.get(`${COST_URI7}?${new URLSearchParams(params).toString()}`),
5792
- update: (id, data) => FetchApi.put(`${COST_URI7}${id}/`, data),
5793
- delete: (id) => FetchApi.delete(`${COST_URI7}${id}/`)
5897
+ create: (data) => FetchApi.post(`${COST_URI}`, data),
5898
+ get: (id) => FetchApi.get(`${COST_URI}${id}/`),
5899
+ list: (params) => FetchApi.get(`${COST_URI}?${new URLSearchParams(params).toString()}`),
5900
+ update: (id, data) => FetchApi.put(`${COST_URI}${id}/`, data),
5901
+ delete: (id) => FetchApi.delete(`${COST_URI}${id}/`)
5794
5902
  };
5795
- var PROFIT_URI7 = `${API_URL}/accounting/profit-center/`;
5903
+ var PROFIT_URI = `${API_URL}/accounting/profit-center/`;
5796
5904
 
5797
5905
  // src/components/common/CommonSelect.tsx
5798
- var import_jsx_runtime147 = require("react/jsx-runtime");
5906
+ var import_jsx_runtime18 = require("react/jsx-runtime");
5799
5907
  var SelectVendor = ({
5800
5908
  value,
5801
5909
  onSelect
5802
5910
  }) => {
5803
- const [showModal, setShowModal] = (0, import_react102.useState)(false);
5804
- const [selectedVendor, setSelectedVendor] = (0, import_react102.useState)(null);
5911
+ const [showModal, setShowModal] = (0, import_react13.useState)(false);
5912
+ const [selectedVendor, setSelectedVendor] = (0, import_react13.useState)(null);
5805
5913
  const { token, activeBusinessEntity } = useSession();
5806
- const [vendors, setVendors] = (0, import_react102.useState)(() => {
5914
+ const [vendors, setVendors] = (0, import_react13.useState)(() => {
5807
5915
  const cacheKey = `vendors_cache_${activeBusinessEntity?.id || "default"}`;
5808
5916
  const cached = sessionStorage.getItem(cacheKey);
5809
5917
  return cached ? JSON.parse(cached) : [];
5810
5918
  });
5811
- const [loadingVendors, setLoadingVendors] = (0, import_react102.useState)(false);
5812
- (0, import_react102.useEffect)(() => {
5919
+ const [loadingVendors, setLoadingVendors] = (0, import_react13.useState)(false);
5920
+ (0, import_react13.useEffect)(() => {
5813
5921
  const cacheKey = `vendors_cache_${activeBusinessEntity?.id || "default"}`;
5814
5922
  const cached = sessionStorage.getItem(cacheKey);
5815
5923
  if (!cached) {
@@ -5847,9 +5955,9 @@ var SelectVendor = ({
5847
5955
  sessionStorage.removeItem(cacheKey);
5848
5956
  loadVendors();
5849
5957
  };
5850
- return /* @__PURE__ */ (0, import_jsx_runtime147.jsxs)("div", { children: [
5851
- /* @__PURE__ */ (0, import_jsx_runtime147.jsx)("div", { className: "flex justify-between ", children: /* @__PURE__ */ (0, import_jsx_runtime147.jsx)("label", { className: "block text-sm font-medium text-gray-700 mb-2", children: "Ajouter un fournisseur" }) }),
5852
- /* @__PURE__ */ (0, import_jsx_runtime147.jsx)(
5958
+ return /* @__PURE__ */ (0, import_jsx_runtime18.jsxs)("div", { children: [
5959
+ /* @__PURE__ */ (0, import_jsx_runtime18.jsx)("div", { className: "flex justify-between ", children: /* @__PURE__ */ (0, import_jsx_runtime18.jsx)("label", { className: "block text-sm font-medium text-gray-700 mb-2", children: "Ajouter un fournisseur" }) }),
5960
+ /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(
5853
5961
  SearchableSelect,
5854
5962
  {
5855
5963
  value,
@@ -5865,8 +5973,8 @@ var SelectVendor = ({
5865
5973
  },
5866
5974
  "fourni" + value
5867
5975
  ),
5868
- loadingVendors && /* @__PURE__ */ (0, import_jsx_runtime147.jsx)("p", { className: "text-sm text-gray-500 mt-2", children: "Chargement des fournisseurs..." }),
5869
- showModal && /* @__PURE__ */ (0, import_jsx_runtime147.jsx)(
5976
+ loadingVendors && /* @__PURE__ */ (0, import_jsx_runtime18.jsx)("p", { className: "text-sm text-gray-500 mt-2", children: "Chargement des fournisseurs..." }),
5977
+ showModal && /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(
5870
5978
  MinimalVendorForm,
5871
5979
  {
5872
5980
  object: selectedVendor,
@@ -5883,13 +5991,13 @@ var SelectUser = ({
5883
5991
  onSelect
5884
5992
  }) => {
5885
5993
  const { token, activeBusinessEntity } = useSession();
5886
- const [users, setUsers] = (0, import_react102.useState)(() => {
5994
+ const [users, setUsers] = (0, import_react13.useState)(() => {
5887
5995
  const cacheKey = `users_cache_${activeBusinessEntity?.id || "default"}`;
5888
5996
  const cached = sessionStorage.getItem(cacheKey);
5889
5997
  return cached ? JSON.parse(cached) : [];
5890
5998
  });
5891
- const [loading, setLoading] = (0, import_react102.useState)(false);
5892
- (0, import_react102.useEffect)(() => {
5999
+ const [loading, setLoading] = (0, import_react13.useState)(false);
6000
+ (0, import_react13.useEffect)(() => {
5893
6001
  const cacheKey = `users_cache_${activeBusinessEntity?.id || "default"}`;
5894
6002
  const cached = sessionStorage.getItem(cacheKey);
5895
6003
  if (!cached) {
@@ -5925,19 +6033,19 @@ var SelectUser = ({
5925
6033
  return users.map((user) => ({
5926
6034
  value: user.id,
5927
6035
  label: `${user.first_name} ${user.last_name}`,
5928
- content: /* @__PURE__ */ (0, import_jsx_runtime147.jsx)("div", { className: "flex items-center space-x-3", children: /* @__PURE__ */ (0, import_jsx_runtime147.jsxs)("div", { className: "flex-1", children: [
5929
- /* @__PURE__ */ (0, import_jsx_runtime147.jsxs)("div", { className: "font-medium text-gray-900", children: [
6036
+ content: /* @__PURE__ */ (0, import_jsx_runtime18.jsx)("div", { className: "flex items-center space-x-3", children: /* @__PURE__ */ (0, import_jsx_runtime18.jsxs)("div", { className: "flex-1", children: [
6037
+ /* @__PURE__ */ (0, import_jsx_runtime18.jsxs)("div", { className: "font-medium text-gray-900", children: [
5930
6038
  user.first_name,
5931
6039
  " ",
5932
6040
  user.last_name
5933
6041
  ] }),
5934
- /* @__PURE__ */ (0, import_jsx_runtime147.jsx)("div", { className: "text-sm text-gray-500", children: user.email })
6042
+ /* @__PURE__ */ (0, import_jsx_runtime18.jsx)("div", { className: "text-sm text-gray-500", children: user.email })
5935
6043
  ] }) })
5936
6044
  }));
5937
6045
  };
5938
- return /* @__PURE__ */ (0, import_jsx_runtime147.jsxs)("div", { children: [
5939
- /* @__PURE__ */ (0, import_jsx_runtime147.jsx)("div", { className: "flex justify-between ", children: /* @__PURE__ */ (0, import_jsx_runtime147.jsx)("label", { className: "block text-sm font-medium text-gray-700 mb-2", children: "S\xE9lectionner un utilisateur" }) }),
5940
- /* @__PURE__ */ (0, import_jsx_runtime147.jsx)(
6046
+ return /* @__PURE__ */ (0, import_jsx_runtime18.jsxs)("div", { children: [
6047
+ /* @__PURE__ */ (0, import_jsx_runtime18.jsx)("div", { className: "flex justify-between ", children: /* @__PURE__ */ (0, import_jsx_runtime18.jsx)("label", { className: "block text-sm font-medium text-gray-700 mb-2", children: "S\xE9lectionner un utilisateur" }) }),
6048
+ /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(
5941
6049
  SearchableSelect,
5942
6050
  {
5943
6051
  value,
@@ -5950,7 +6058,7 @@ var SelectUser = ({
5950
6058
  },
5951
6059
  "user" + value
5952
6060
  ),
5953
- loading && /* @__PURE__ */ (0, import_jsx_runtime147.jsx)("p", { className: "text-sm text-gray-500 mt-2", children: "Chargement des utilisateurs..." })
6061
+ loading && /* @__PURE__ */ (0, import_jsx_runtime18.jsx)("p", { className: "text-sm text-gray-500 mt-2", children: "Chargement des utilisateurs..." })
5954
6062
  ] });
5955
6063
  };
5956
6064
  var SelectDepartment = ({
@@ -5958,13 +6066,13 @@ var SelectDepartment = ({
5958
6066
  onSelect
5959
6067
  }) => {
5960
6068
  const { token, activeBusinessEntity } = useSession();
5961
- const [departments, setDepartments] = (0, import_react102.useState)(() => {
6069
+ const [departments, setDepartments] = (0, import_react13.useState)(() => {
5962
6070
  const cacheKey = `departments_cache_${activeBusinessEntity?.id || "default"}`;
5963
6071
  const cached = sessionStorage.getItem(cacheKey);
5964
6072
  return cached ? JSON.parse(cached) : [];
5965
6073
  });
5966
- const [loading, setLoading] = (0, import_react102.useState)(false);
5967
- (0, import_react102.useEffect)(() => {
6074
+ const [loading, setLoading] = (0, import_react13.useState)(false);
6075
+ (0, import_react13.useEffect)(() => {
5968
6076
  const cacheKey = `departments_cache_${activeBusinessEntity?.id || "default"}`;
5969
6077
  const cached = sessionStorage.getItem(cacheKey);
5970
6078
  if (!cached) {
@@ -6000,9 +6108,9 @@ var SelectDepartment = ({
6000
6108
  label: dept.name
6001
6109
  }));
6002
6110
  };
6003
- return /* @__PURE__ */ (0, import_jsx_runtime147.jsxs)("div", { children: [
6004
- /* @__PURE__ */ (0, import_jsx_runtime147.jsx)("div", { className: "flex justify-between ", children: /* @__PURE__ */ (0, import_jsx_runtime147.jsx)("label", { className: "block text-sm font-medium text-gray-700 mb-2", children: "S\xE9lectionner un d\xE9partement" }) }),
6005
- /* @__PURE__ */ (0, import_jsx_runtime147.jsx)(
6111
+ return /* @__PURE__ */ (0, import_jsx_runtime18.jsxs)("div", { children: [
6112
+ /* @__PURE__ */ (0, import_jsx_runtime18.jsx)("div", { className: "flex justify-between ", children: /* @__PURE__ */ (0, import_jsx_runtime18.jsx)("label", { className: "block text-sm font-medium text-gray-700 mb-2", children: "S\xE9lectionner un d\xE9partement" }) }),
6113
+ /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(
6006
6114
  SearchableSelect,
6007
6115
  {
6008
6116
  value,
@@ -6015,7 +6123,7 @@ var SelectDepartment = ({
6015
6123
  },
6016
6124
  "dept" + value
6017
6125
  ),
6018
- loading && /* @__PURE__ */ (0, import_jsx_runtime147.jsx)("p", { className: "text-sm text-gray-500 mt-2", children: "Chargement des d\xE9partements..." })
6126
+ loading && /* @__PURE__ */ (0, import_jsx_runtime18.jsx)("p", { className: "text-sm text-gray-500 mt-2", children: "Chargement des d\xE9partements..." })
6019
6127
  ] });
6020
6128
  };
6021
6129
  var SelectCostCenter = ({
@@ -6023,13 +6131,13 @@ var SelectCostCenter = ({
6023
6131
  onSelect
6024
6132
  }) => {
6025
6133
  const { token, activeBusinessEntity } = useSession();
6026
- const [costCenters, setCostCenters] = (0, import_react102.useState)(() => {
6134
+ const [costCenters, setCostCenters] = (0, import_react13.useState)(() => {
6027
6135
  const cacheKey = `cost_centers_cache_${activeBusinessEntity?.id || "default"}`;
6028
6136
  const cached = sessionStorage.getItem(cacheKey);
6029
6137
  return cached ? JSON.parse(cached) : [];
6030
6138
  });
6031
- const [loading, setLoading] = (0, import_react102.useState)(false);
6032
- (0, import_react102.useEffect)(() => {
6139
+ const [loading, setLoading] = (0, import_react13.useState)(false);
6140
+ (0, import_react13.useEffect)(() => {
6033
6141
  const cacheKey = `cost_centers_cache_${activeBusinessEntity?.id || "default"}`;
6034
6142
  const cached = sessionStorage.getItem(cacheKey);
6035
6143
  if (!cached) {
@@ -6063,18 +6171,18 @@ var SelectCostCenter = ({
6063
6171
  return costCenters.map((center) => ({
6064
6172
  value: center.id,
6065
6173
  label: `${center.code ? `[${center.code}] ` : ""}${center.name}`,
6066
- content: /* @__PURE__ */ (0, import_jsx_runtime147.jsx)("div", { className: "flex items-center space-x-3", children: /* @__PURE__ */ (0, import_jsx_runtime147.jsxs)("div", { className: "flex-1", children: [
6067
- /* @__PURE__ */ (0, import_jsx_runtime147.jsx)("div", { className: "font-medium text-gray-900", children: center.name }),
6068
- center.code && /* @__PURE__ */ (0, import_jsx_runtime147.jsxs)("div", { className: "text-sm text-gray-500", children: [
6174
+ content: /* @__PURE__ */ (0, import_jsx_runtime18.jsx)("div", { className: "flex items-center space-x-3", children: /* @__PURE__ */ (0, import_jsx_runtime18.jsxs)("div", { className: "flex-1", children: [
6175
+ /* @__PURE__ */ (0, import_jsx_runtime18.jsx)("div", { className: "font-medium text-gray-900", children: center.name }),
6176
+ center.code && /* @__PURE__ */ (0, import_jsx_runtime18.jsxs)("div", { className: "text-sm text-gray-500", children: [
6069
6177
  "Code: ",
6070
6178
  center.code
6071
6179
  ] })
6072
6180
  ] }) })
6073
6181
  }));
6074
6182
  };
6075
- return /* @__PURE__ */ (0, import_jsx_runtime147.jsxs)("div", { children: [
6076
- /* @__PURE__ */ (0, import_jsx_runtime147.jsx)("div", { className: "flex justify-between ", children: /* @__PURE__ */ (0, import_jsx_runtime147.jsx)("label", { className: "block text-sm font-medium text-gray-700 mb-2", children: "S\xE9lectionner un centre de co\xFBt" }) }),
6077
- /* @__PURE__ */ (0, import_jsx_runtime147.jsx)(
6183
+ return /* @__PURE__ */ (0, import_jsx_runtime18.jsxs)("div", { children: [
6184
+ /* @__PURE__ */ (0, import_jsx_runtime18.jsx)("div", { className: "flex justify-between ", children: /* @__PURE__ */ (0, import_jsx_runtime18.jsx)("label", { className: "block text-sm font-medium text-gray-700 mb-2", children: "S\xE9lectionner un centre de co\xFBt" }) }),
6185
+ /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(
6078
6186
  SearchableSelect,
6079
6187
  {
6080
6188
  value,
@@ -6087,12 +6195,12 @@ var SelectCostCenter = ({
6087
6195
  },
6088
6196
  "cost" + value
6089
6197
  ),
6090
- loading && /* @__PURE__ */ (0, import_jsx_runtime147.jsx)("p", { className: "text-sm text-gray-500 mt-2", children: "Chargement des centres de co\xFBt..." })
6198
+ loading && /* @__PURE__ */ (0, import_jsx_runtime18.jsx)("p", { className: "text-sm text-gray-500 mt-2", children: "Chargement des centres de co\xFBt..." })
6091
6199
  ] });
6092
6200
  };
6093
6201
 
6094
6202
  // src/components/common/Choices.tsx
6095
- var import_jsx_runtime148 = require("react/jsx-runtime");
6203
+ var import_jsx_runtime19 = require("react/jsx-runtime");
6096
6204
  var CHOICES = {
6097
6205
  INVOICE_TYPES: [
6098
6206
  { value: "sale", label: { fr: "Vente", en: "Sale", default: "Sale" } },
@@ -6350,7 +6458,7 @@ var InvoiceTypeSelector = ({
6350
6458
  value: item.value,
6351
6459
  label: item.label[language]
6352
6460
  }));
6353
- return /* @__PURE__ */ (0, import_jsx_runtime148.jsx)(
6461
+ return /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(
6354
6462
  SearchableSelect,
6355
6463
  {
6356
6464
  value,
@@ -6373,7 +6481,7 @@ var PaymentMethodSelector = ({
6373
6481
  value: item.value,
6374
6482
  label: item.label[language]
6375
6483
  }));
6376
- return /* @__PURE__ */ (0, import_jsx_runtime148.jsx)(
6484
+ return /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(
6377
6485
  SearchableSelect,
6378
6486
  {
6379
6487
  value,
@@ -6396,7 +6504,7 @@ var TemplateFNESelector = ({
6396
6504
  value: item.value,
6397
6505
  label: item.label[language]
6398
6506
  }));
6399
- return /* @__PURE__ */ (0, import_jsx_runtime148.jsx)(
6507
+ return /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(
6400
6508
  SearchableSelect,
6401
6509
  {
6402
6510
  value,
@@ -6419,7 +6527,7 @@ var ForeignCurrencySelector = ({
6419
6527
  value: item.value,
6420
6528
  label: item.label[language]
6421
6529
  }));
6422
- return /* @__PURE__ */ (0, import_jsx_runtime148.jsx)(
6530
+ return /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(
6423
6531
  SearchableSelect,
6424
6532
  {
6425
6533
  value,
@@ -6443,7 +6551,7 @@ var TaxSelector = ({
6443
6551
  value: item.value,
6444
6552
  label: item.label[language]
6445
6553
  }));
6446
- return /* @__PURE__ */ (0, import_jsx_runtime148.jsx)(
6554
+ return /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(
6447
6555
  SearchableSelect,
6448
6556
  {
6449
6557
  value,
@@ -6471,7 +6579,7 @@ var LegalFormSelector = ({
6471
6579
  value: item.value,
6472
6580
  label: item.label[language] ?? item.label.default
6473
6581
  }));
6474
- return /* @__PURE__ */ (0, import_jsx_runtime148.jsx)(
6582
+ return /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(
6475
6583
  SearchableSelect,
6476
6584
  {
6477
6585
  value,
@@ -6494,7 +6602,7 @@ var CountrySelector = ({
6494
6602
  value: item.value,
6495
6603
  label: item.label[language]
6496
6604
  }));
6497
- return /* @__PURE__ */ (0, import_jsx_runtime148.jsx)(
6605
+ return /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(
6498
6606
  SearchableSelect,
6499
6607
  {
6500
6608
  value,