ptechcore_ui 1.0.77 → 1.0.78

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.
package/dist/index.js CHANGED
@@ -405,7 +405,8 @@ import {
405
405
  Save,
406
406
  Loader2,
407
407
  Check as Check2,
408
- Trash2
408
+ Trash2,
409
+ MailOpen
409
410
  } from "lucide-react";
410
411
 
411
412
  // src/assets/modules-icons/crm-blue.svg
@@ -507,6 +508,25 @@ function formatCurrency(amount, currency = "XAF") {
507
508
  }
508
509
  return new Intl.NumberFormat("fr-FR").format(amount) + " " + currency;
509
510
  }
511
+ function formatDateTime(date) {
512
+ if (!date) return "Non d\xE9fini";
513
+ try {
514
+ const dateObj = typeof date === "string" ? new Date(date) : date;
515
+ if (isNaN(dateObj.getTime())) {
516
+ return "Date invalide";
517
+ }
518
+ return dateObj.toLocaleDateString("fr-FR", {
519
+ year: "numeric",
520
+ month: "long",
521
+ day: "numeric",
522
+ hour: "2-digit",
523
+ minute: "2-digit",
524
+ second: "2-digit"
525
+ });
526
+ } catch (error) {
527
+ return "Erreur de format";
528
+ }
529
+ }
510
530
 
511
531
  // src/contexts/ThemeContext.tsx
512
532
  import { createContext, useContext, useState as useState2, useEffect as useEffect2 } from "react";
@@ -982,6 +1002,80 @@ var FetchApi = class {
982
1002
  if (!res.ok) throw new Error(await res.text());
983
1003
  return res.json();
984
1004
  }
1005
+ static async postFile(url, payload, token) {
1006
+ const headers = {};
1007
+ const local_token = localStorage.getItem("token");
1008
+ if (local_token) {
1009
+ headers["Authorization"] = `Token ${local_token}`;
1010
+ }
1011
+ let body;
1012
+ const business_entity_id = localStorage.getItem("active_center_id");
1013
+ if (payload instanceof FormData) {
1014
+ if (business_entity_id) {
1015
+ payload.append("business_entity_id", business_entity_id);
1016
+ payload.append("business_entity", business_entity_id);
1017
+ }
1018
+ body = payload;
1019
+ } else if (payload) {
1020
+ const formData = new FormData();
1021
+ Object.entries(payload).forEach(([key, value]) => {
1022
+ if (Array.isArray(value)) {
1023
+ formData.append(key, value.join(","));
1024
+ } else if (value !== null && value !== void 0) {
1025
+ formData.append(key, value);
1026
+ }
1027
+ });
1028
+ if (business_entity_id) {
1029
+ formData.append("business_entity_id", business_entity_id);
1030
+ formData.append("business_entity", business_entity_id);
1031
+ }
1032
+ body = formData;
1033
+ }
1034
+ const res = await fetch(url, {
1035
+ method: "POST",
1036
+ headers,
1037
+ body
1038
+ });
1039
+ if (!res.ok) throw new Error(await res.text());
1040
+ return res.json();
1041
+ }
1042
+ static async putFile(url, payload, token) {
1043
+ const headers = {};
1044
+ const local_token = localStorage.getItem("token");
1045
+ if (local_token) {
1046
+ headers["Authorization"] = `Token ${local_token}`;
1047
+ }
1048
+ let body;
1049
+ const business_entity_id = localStorage.getItem("active_center_id");
1050
+ if (payload instanceof FormData) {
1051
+ if (business_entity_id) {
1052
+ payload.append("business_entity_id", business_entity_id);
1053
+ payload.append("business_entity", business_entity_id);
1054
+ }
1055
+ body = payload;
1056
+ } else if (payload) {
1057
+ const formData = new FormData();
1058
+ Object.entries(payload).forEach(([key, value]) => {
1059
+ if (Array.isArray(value)) {
1060
+ formData.append(key, value.join(","));
1061
+ } else if (value !== null && value !== void 0) {
1062
+ formData.append(key, value);
1063
+ }
1064
+ });
1065
+ if (business_entity_id) {
1066
+ formData.append("business_entity_id", business_entity_id);
1067
+ formData.append("business_entity", business_entity_id);
1068
+ }
1069
+ body = formData;
1070
+ }
1071
+ const res = await fetch(url, {
1072
+ method: "PUT",
1073
+ headers,
1074
+ body
1075
+ });
1076
+ if (!res.ok) throw new Error(await res.text());
1077
+ return res.json();
1078
+ }
985
1079
  static async patch(url, payload, token) {
986
1080
  const headers = {
987
1081
  "Content-Type": "application/json"
@@ -1003,14 +1097,18 @@ var FetchApi = class {
1003
1097
  var apiClient = {
1004
1098
  get: (path) => FetchApi.get(`${API_URL}${path}`),
1005
1099
  post: (path, data) => FetchApi.post(`${API_URL}${path}`, data),
1100
+ postFile: (path, data) => FetchApi.postFile(`${API_URL}${path}`, data),
1006
1101
  put: (path, data) => FetchApi.put(`${API_URL}${path}`, data),
1102
+ putFile: (path, data) => FetchApi.putFile(`${API_URL}${path}`, data),
1007
1103
  patch: (path, data) => FetchApi.patch(`${API_URL}${path}`, data),
1008
1104
  delete: (path) => FetchApi.delete(`${API_URL}${path}`)
1009
1105
  };
1010
1106
  var coreApiClient = {
1011
1107
  get: (path) => FetchApi.get(`${API_URL}/core${path}`),
1012
1108
  post: (path, data) => FetchApi.post(`${API_URL}/core${path}`, data),
1109
+ postFile: (path, data) => FetchApi.postFile(`${API_URL}/core${path}`, data),
1013
1110
  put: (path, data) => FetchApi.put(`${API_URL}/core${path}`, data),
1111
+ putFile: (path, data) => FetchApi.putFile(`${API_URL}/core${path}`, data),
1014
1112
  patch: (path, data) => FetchApi.patch(`${API_URL}/core${path}`, data),
1015
1113
  delete: (path) => FetchApi.delete(`${API_URL}/core${path}`)
1016
1114
  };
@@ -1237,7 +1335,7 @@ var UserServices = {
1237
1335
  // Obtenir toutes les notifications de l'utilisateur
1238
1336
  getUsersNotifications: () => FetchApi.get(`${USERS_API_URL}notifications/`),
1239
1337
  // Marquer une notification comme lue
1240
- markNotificationAsRead: (notificationId) => FetchApi.post(`${USERS_API_URL}notifications/${notificationId}/mark-read/`, {}),
1338
+ markNotificationAsRead: (notificationId) => FetchApi.post(`${API_URL}/core/notifications/${notificationId}/mark-read/`, {}),
1241
1339
  // Obtenir un utilisateur par ID
1242
1340
  getUser: (id, token) => FetchApi.get(`${USERS_API_URL}${id}/`, token),
1243
1341
  // Mettre à jour un utilisateur
@@ -2791,11 +2889,11 @@ var RewiseLayout = ({ children, module_name = "Rewise", module_description = "",
2791
2889
  {
2792
2890
  className: "relative p-2 hover:bg-[var(--color-surface-hover)] rounded-lg transition-colors",
2793
2891
  onClick: () => setShowNotifications(!showNotifications),
2794
- "aria-label": `Notifications ${notifications.filter((n) => !n.read).length > 0 ? `(${notifications.filter((n) => !n.read).length} non lues)` : ""}`,
2892
+ title: `Notifications ${notifications.filter((n) => !n.is_read && !["approved"].includes(n?.object_detail?.answer)).length > 0 ? `(${notifications.filter((n) => !n.is_read && !["approved"].includes(n?.object_detail?.answer)).length} non lues)` : ""}`,
2795
2893
  "aria-expanded": showNotifications,
2796
2894
  children: [
2797
2895
  /* @__PURE__ */ jsx9(Bell, { className: "w-5 h-5 text-[var(--color-text-secondary)]" }),
2798
- notifications.filter((n) => !n.read).length > 0 && /* @__PURE__ */ jsx9("span", { className: "absolute top-1 right-1 w-2 h-2 bg-[var(--color-error)] rounded-full" })
2896
+ notifications.filter((n) => !n.is_read && !["approved"].includes(n?.object_detail?.answer)).length > 0 && /* @__PURE__ */ jsx9("span", { className: "absolute top-1 right-1 w-2 h-2 bg-[var(--color-error)] rounded-full" })
2799
2897
  ]
2800
2898
  }
2801
2899
  ),
@@ -2807,31 +2905,29 @@ var RewiseLayout = ({ children, module_name = "Rewise", module_description = "",
2807
2905
  "aria-label": "Centre de notifications",
2808
2906
  children: [
2809
2907
  /* @__PURE__ */ jsx9("div", { className: "p-4 border-b border-[var(--color-border)]", children: /* @__PURE__ */ jsx9("h3", { className: "font-semibold text-[var(--color-text-primary)]", children: "Notifications" }) }),
2810
- /* @__PURE__ */ jsx9("div", { className: "divide-y divide-[var(--color-border)]", children: notifications.map((notif) => /* @__PURE__ */ jsx9(
2811
- "div",
2812
- {
2813
- className: cn(
2814
- "p-4 hover:bg-[var(--color-surface-hover)] cursor-pointer",
2815
- !notif.read && "bg-[var(--color-primary-light)] bg-opacity-10"
2816
- ),
2817
- onClick: () => markNotificationAsRead(notif.id),
2818
- children: /* @__PURE__ */ jsxs6("div", { className: "flex items-start gap-3", children: [
2819
- /* @__PURE__ */ jsx9("div", { className: cn(
2820
- "w-2 h-2 rounded-full mt-2",
2821
- notif.type === "error" && "bg-[var(--color-error)]",
2822
- notif.type === "warning" && "bg-[var(--color-warning)]",
2823
- notif.type === "success" && "bg-[var(--color-success)]",
2824
- notif.type === "info" && "bg-[var(--color-info)]"
2825
- ) }),
2826
- /* @__PURE__ */ jsxs6("div", { className: "flex-1", children: [
2827
- /* @__PURE__ */ jsx9("p", { className: "text-sm font-medium text-[var(--color-text-primary)]", children: notif.title }),
2828
- /* @__PURE__ */ jsx9("p", { className: "text-xs text-[var(--color-text-secondary)] mt-1", children: notif.message }),
2829
- /* @__PURE__ */ jsx9("p", { className: "text-xs text-[var(--color-text-tertiary)] mt-2" })
2830
- ] })
2831
- ] })
2832
- },
2833
- notif.id
2834
- )) })
2908
+ /* @__PURE__ */ jsx9("div", { className: "divide-y divide-[var(--color-border)]", children: notifications.map(
2909
+ (notif) => {
2910
+ const is_read = notif.is_read || ["approved"].includes(notif?.object_detail?.answer);
2911
+ return /* @__PURE__ */ jsx9(
2912
+ "div",
2913
+ {
2914
+ className: cn(
2915
+ "p-4 hover:bg-[var(--color-surface-hover)] cursor-pointer"
2916
+ ),
2917
+ onClick: () => markNotificationAsRead(notif.id),
2918
+ children: /* @__PURE__ */ jsxs6("div", { className: "flex items-start gap-3", children: [
2919
+ /* @__PURE__ */ jsx9("div", { className: "mt-2", children: !is_read ? /* @__PURE__ */ jsx9(Mail, { size: 15, className: "text-[var(--color-primary)]" }) : /* @__PURE__ */ jsx9(MailOpen, { size: 15, className: "text-gray-500" }) }),
2920
+ /* @__PURE__ */ jsxs6("div", { className: "flex-1", children: [
2921
+ /* @__PURE__ */ jsx9("p", { className: `text-sm ${!is_read ? "text-black font-bold" : " font-normal text-[var(--color-text-primary)]"}`, children: /* @__PURE__ */ jsx9("div", { className: "flex items-center gap-2", children: notif.title }) }),
2922
+ /* @__PURE__ */ jsx9("p", { className: "text-xs text-[var(--color-text-secondary)] mt-1", children: notif.message }),
2923
+ /* @__PURE__ */ jsx9("p", { className: "text-xs text-[var(--color-text-tertiary)] mt-2", children: formatDateTime(notif?.created_at) ?? "-" })
2924
+ ] })
2925
+ ] })
2926
+ },
2927
+ notif.id
2928
+ );
2929
+ }
2930
+ ) })
2835
2931
  ]
2836
2932
  }
2837
2933
  )
@@ -7029,7 +7125,7 @@ var formatFileSize = (bytes) => {
7029
7125
  const i = Math.floor(Math.log(bytes) / Math.log(k));
7030
7126
  return `${parseFloat((bytes / Math.pow(k, i)).toFixed(1))} ${units[i]}`;
7031
7127
  };
7032
- var formatDate = (date) => {
7128
+ var formatDate2 = (date) => {
7033
7129
  if (!date) {
7034
7130
  return "-";
7035
7131
  }
@@ -7043,7 +7139,7 @@ var formatDate = (date) => {
7043
7139
  year: "numeric"
7044
7140
  });
7045
7141
  };
7046
- var formatDateTime = (date) => {
7142
+ var formatDateTime2 = (date) => {
7047
7143
  if (!date) {
7048
7144
  return "-";
7049
7145
  }
@@ -7199,7 +7295,7 @@ var FileCard = ({ item, variant = "grid" }) => {
7199
7295
  }
7200
7296
  ) : /* @__PURE__ */ jsx20("span", { className: "block truncate text-sm text-gray-900 dark:text-gray-100", children: item.name }) }),
7201
7297
  /* @__PURE__ */ jsx20("span", { className: "text-xs text-gray-500 dark:text-gray-400 w-20 text-right", children: !isFolder && formatFileSize(item.size) }),
7202
- /* @__PURE__ */ jsx20("span", { className: "text-xs text-gray-500 dark:text-gray-400 w-24 text-right", children: formatDate(item.updatedAt || item.createdAt) })
7298
+ /* @__PURE__ */ jsx20("span", { className: "text-xs text-gray-500 dark:text-gray-400 w-24 text-right", children: formatDate2(item.updatedAt || item.createdAt) })
7203
7299
  ]
7204
7300
  }
7205
7301
  );
@@ -10597,7 +10693,7 @@ var FormClient = ({
10597
10693
 
10598
10694
  // src/components/common/ApprovalWorkflow.tsx
10599
10695
  import { useState as useState22, useEffect as useEffect15 } from "react";
10600
- import { X as X10, Plus as Plus3, Trash2 as Trash25, Users, Loader as Loader3, Eye as Eye4, FileText as FileText6, History } from "lucide-react";
10696
+ import { X as X10, Plus as Plus3, Trash2 as Trash25, Users, Loader as Loader3, Eye as Eye4, FileText as FileText6, History, Edit as Edit2, MessageSquare } from "lucide-react";
10601
10697
  import { Fragment as Fragment9, jsx as jsx32, jsxs as jsxs26 } from "react/jsx-runtime";
10602
10698
  var ApprovalWorkflow = ({
10603
10699
  process,
@@ -10690,7 +10786,7 @@ var ApprovalWorkflow = ({
10690
10786
  email: v.user_detail?.email || "",
10691
10787
  role: v.user_detail?.phonenumber || "-",
10692
10788
  status: v.answer === "approved" /* APPROVED */ ? "approved" : v.answer === "refused" /* REFUSED */ ? "rejected" : "pending",
10693
- answer: v.answer === "approved" /* APPROVED */ ? 2 : v.answer === "waiting" /* WAITING */ ? 1 : v.answer === "refused" /* REFUSED */ ? -1 : 0,
10789
+ answer: v.answer === "approved" /* APPROVED */ ? 2 : v.answer === "waiting" /* WAITING */ ? 1 : v.answer === "refused" /* REFUSED */ ? -1 : v.answer === "suggest-correction" /* SUGGEST_CORRECTION */ ? -2 : 0,
10694
10790
  rank: v.rank,
10695
10791
  note: v.note
10696
10792
  })));
@@ -10705,7 +10801,7 @@ var ApprovalWorkflow = ({
10705
10801
  email: v.user_detail?.email || "",
10706
10802
  role: v.user_detail?.phonenumber || "-",
10707
10803
  status: v.answer === "approved" /* APPROVED */ ? "approved" : v.answer === "refused" /* REFUSED */ ? "rejected" : "pending",
10708
- answer: v.answer === "approved" /* APPROVED */ ? 2 : v.answer === "waiting" /* WAITING */ ? 1 : v.answer === "refused" /* REFUSED */ ? -1 : 0,
10804
+ answer: v.answer === "approved" /* APPROVED */ ? 2 : v.answer === "waiting" /* WAITING */ ? 1 : v.answer === "refused" /* REFUSED */ ? -1 : v.answer === "suggest-correction" /* SUGGEST_CORRECTION */ ? -2 : 0,
10709
10805
  rank: v.rank,
10710
10806
  note: v.note
10711
10807
  })));
@@ -10780,14 +10876,24 @@ var ApprovalWorkflow = ({
10780
10876
  }
10781
10877
  setTransmitting(true);
10782
10878
  try {
10783
- await handleSave();
10784
- if (caseData?.id) {
10785
- const response = await ApprovalServices.start(caseData.id, token);
10879
+ if (formData.status === "suggest-correction" /* SUGGEST_CORRECTION */ && caseData?.id) {
10880
+ const response = await ApprovalServices.restart(caseData.id, token);
10786
10881
  if (response.success) {
10787
- showSuccess("Demande de validation transmise avec succ\xE8s");
10882
+ showSuccess("Nouvelle version cr\xE9\xE9e et transmise avec succ\xE8s");
10788
10883
  await loadCase();
10789
10884
  } else {
10790
- showError("Erreur lors de la transmission");
10885
+ showError("Erreur lors de la re-transmission");
10886
+ }
10887
+ } else {
10888
+ await handleSave();
10889
+ if (caseData?.id) {
10890
+ const response = await ApprovalServices.start(caseData.id, token);
10891
+ if (response.success) {
10892
+ showSuccess("Demande de validation transmise avec succ\xE8s");
10893
+ await loadCase();
10894
+ } else {
10895
+ showError("Erreur lors de la transmission");
10896
+ }
10791
10897
  }
10792
10898
  }
10793
10899
  } catch (error) {
@@ -10946,12 +11052,19 @@ var ApprovalWorkflow = ({
10946
11052
  switch (activeTab) {
10947
11053
  case "workflow":
10948
11054
  return /* @__PURE__ */ jsxs26("div", { className: "space-y-6", children: [
11055
+ formData.status === "suggest-correction" /* SUGGEST_CORRECTION */ && /* @__PURE__ */ jsxs26("div", { className: "p-4 rounded-lg border border-[var(--color-warning)] bg-[var(--color-warning-light)] flex items-start gap-3", children: [
11056
+ /* @__PURE__ */ jsx32(Edit2, { className: "w-5 h-5 flex-shrink-0 mt-0.5", style: { color: "var(--color-warning)" } }),
11057
+ /* @__PURE__ */ jsxs26("div", { children: [
11058
+ /* @__PURE__ */ jsx32("p", { className: "text-sm font-medium", style: { color: "var(--color-warning)" }, children: "Une modification a \xE9t\xE9 sugg\xE9r\xE9e sur cette demande" }),
11059
+ /* @__PURE__ */ jsx32("p", { className: "text-xs text-gray-500 mt-1", children: "Veuillez prendre en compte les commentaires et re-transmettre la demande." })
11060
+ ] })
11061
+ ] }),
10949
11062
  renderStageSection("Verification", verification, setVerification, "verification"),
10950
11063
  renderStageSection("Validation", validation, setValidation, "validation"),
10951
11064
  !readOnly && /* @__PURE__ */ jsxs26("div", { className: "flex justify-between pt-4 border-t border-[#D9D9D9]", children: [
10952
11065
  /* @__PURE__ */ jsx32("div", { className: "flex gap-3" }),
10953
11066
  /* @__PURE__ */ jsxs26("div", { className: "flex gap-3", children: [
10954
- formData.status == "not-send" /* NOT_SEND */ && /* @__PURE__ */ jsxs26(
11067
+ (formData.status === "not-send" /* NOT_SEND */ || formData.status === "suggest-correction" /* SUGGEST_CORRECTION */) && /* @__PURE__ */ jsxs26(
10955
11068
  Buttons_default,
10956
11069
  {
10957
11070
  onClick: handleSave,
@@ -10963,13 +11076,13 @@ var ApprovalWorkflow = ({
10963
11076
  ]
10964
11077
  }
10965
11078
  ),
10966
- formData.status === "not-send" /* NOT_SEND */ && /* @__PURE__ */ jsx32(
11079
+ (formData.status === "not-send" /* NOT_SEND */ || formData.status === "suggest-correction" /* SUGGEST_CORRECTION */) && /* @__PURE__ */ jsx32(
10967
11080
  Buttons_default,
10968
11081
  {
10969
11082
  onClick: handleTransmit,
10970
11083
  disabled: transmitting || saving,
10971
11084
  type: "button",
10972
- children: transmitting ? "Transmission..." : "Transmettre"
11085
+ children: transmitting ? "Transmission..." : formData.status === "suggest-correction" /* SUGGEST_CORRECTION */ ? "Re-transmettre" : "Transmettre"
10973
11086
  }
10974
11087
  )
10975
11088
  ] })
@@ -11174,71 +11287,81 @@ var StageRow = ({
11174
11287
  return /* @__PURE__ */ jsx32("span", { className: "inline-flex items-center justify-center w-6 h-6 bg-gray-300 rounded-full", children: /* @__PURE__ */ jsx32("span", { className: "text-white text-xs", children: "\u23F1" }) });
11175
11288
  } else if (answer === -1) {
11176
11289
  return /* @__PURE__ */ jsx32("span", { className: "inline-flex items-center justify-center w-6 h-6 bg-[var(--color-error)] rounded-full", children: /* @__PURE__ */ jsx32("svg", { className: "w-4 h-4 text-white", fill: "currentColor", viewBox: "0 0 20 20", children: /* @__PURE__ */ jsx32("path", { fillRule: "evenodd", d: "M4.293 4.293a1 1 0 011.414 0L10 8.586l4.293-4.293a1 1 0 111.414 1.414L11.414 10l4.293 4.293a1 1 0 01-1.414 1.414L10 11.414l-4.293 4.293a1 1 0 01-1.414-1.414L8.586 10 4.293 5.707a1 1 0 010-1.414z", clipRule: "evenodd" }) }) });
11290
+ } else if (answer === -2) {
11291
+ return /* @__PURE__ */ jsx32("span", { className: "inline-flex items-center justify-center w-6 h-6 bg-[var(--color-warning)] rounded-full", children: /* @__PURE__ */ jsx32(Edit2, { className: "w-4 h-4 text-white" }) });
11177
11292
  }
11178
11293
  return /* @__PURE__ */ jsx32("span", { className: "text-gray-400 text-xs", children: "-" });
11179
11294
  };
11180
- return /* @__PURE__ */ jsxs26("tr", { className: "hover:bg-gray-50", children: [
11181
- /* @__PURE__ */ jsx32("td", { className: "border border-gray-300 px-2 py-2 text-center", children: !readOnly && /* @__PURE__ */ jsx32(
11182
- "button",
11183
- {
11184
- type: "button",
11185
- onClick: onRemove,
11186
- className: "text-[#B85450] hover:text-[var(--color-error)] transition-colors",
11187
- title: "Supprimer",
11188
- children: /* @__PURE__ */ jsx32(Trash25, { className: "w-4 h-4" })
11189
- }
11190
- ) }),
11191
- /* @__PURE__ */ jsx32("td", { className: "border border-gray-300 px-4 py-2 text-center", children: index + 1 }),
11192
- /* @__PURE__ */ jsx32("td", { className: "border border-gray-300 px-2 py-2", children: /* @__PURE__ */ jsx32(
11193
- SelectInput,
11194
- {
11195
- value: stage.space_answer,
11196
- onChange: (e) => handleSpaceAnswerChange(e),
11197
- disabled: readOnly,
11198
- options: [
11199
- { value: "internal", label: "Interne" },
11200
- { value: "external", label: "Externe" }
11201
- ]
11202
- }
11203
- ) }),
11204
- /* @__PURE__ */ jsx32("td", { className: "border border-gray-300 px-2 py-2", children: stage.space_answer === "internal" ? /* @__PURE__ */ jsx32(
11205
- SearchableSelect,
11206
- {
11207
- options: userOptions,
11208
- value: stage.user,
11209
- placeholder: "S\xE9lectionner...",
11210
- searchPlaceholder: "Rechercher...",
11211
- onSelect: handleUserSelect,
11212
- disabled: readOnly || loadingUsers,
11213
- filterFunction: userFilterFunction
11214
- }
11215
- ) : /* @__PURE__ */ jsx32(
11216
- TextInput,
11217
- {
11218
- value: stage.name,
11219
- onChange: (e) => onUpdate({ name: e.target.value }),
11220
- disabled: readOnly
11221
- }
11222
- ) }),
11223
- /* @__PURE__ */ jsx32("td", { className: "border border-gray-300 px-2 py-2", children: /* @__PURE__ */ jsx32(
11224
- TextInput,
11225
- {
11226
- type: "email",
11227
- value: stage.email,
11228
- onChange: (e) => onUpdate({ email: e.target.value }),
11229
- disabled: readOnly || stage.space_answer === "internal"
11230
- }
11231
- ) }),
11232
- /* @__PURE__ */ jsx32("td", { className: "border border-gray-300 px-2 py-2", children: /* @__PURE__ */ jsx32(
11233
- "input",
11234
- {
11235
- type: "text",
11236
- value: stage.role,
11237
- disabled: true,
11238
- className: "w-full px-2 py-1 border border-gray-300 rounded text-sm bg-gray-100"
11239
- }
11240
- ) }),
11241
- /* @__PURE__ */ jsx32("td", { className: "border border-gray-300 px-4 py-2 text-center", children: getStatusIcon(stage.answer) })
11295
+ return /* @__PURE__ */ jsxs26(Fragment9, { children: [
11296
+ /* @__PURE__ */ jsxs26("tr", { className: "hover:bg-gray-50", children: [
11297
+ /* @__PURE__ */ jsx32("td", { className: "border border-gray-300 px-2 py-2 text-center", children: !readOnly && /* @__PURE__ */ jsx32(
11298
+ "button",
11299
+ {
11300
+ type: "button",
11301
+ onClick: onRemove,
11302
+ className: "text-[#B85450] hover:text-[var(--color-error)] transition-colors",
11303
+ title: "Supprimer",
11304
+ children: /* @__PURE__ */ jsx32(Trash25, { className: "w-4 h-4" })
11305
+ }
11306
+ ) }),
11307
+ /* @__PURE__ */ jsx32("td", { className: "border border-gray-300 px-4 py-2 text-center", children: index + 1 }),
11308
+ /* @__PURE__ */ jsx32("td", { className: "border border-gray-300 px-2 py-2", children: /* @__PURE__ */ jsx32(
11309
+ SelectInput,
11310
+ {
11311
+ value: stage.space_answer,
11312
+ onChange: (e) => handleSpaceAnswerChange(e),
11313
+ disabled: readOnly,
11314
+ options: [
11315
+ { value: "internal", label: "Interne" },
11316
+ { value: "external", label: "Externe" }
11317
+ ]
11318
+ }
11319
+ ) }),
11320
+ /* @__PURE__ */ jsx32("td", { className: "border border-gray-300 px-2 py-2", children: stage.space_answer === "internal" ? /* @__PURE__ */ jsx32(
11321
+ SearchableSelect,
11322
+ {
11323
+ options: userOptions,
11324
+ value: stage.user,
11325
+ placeholder: "S\xE9lectionner...",
11326
+ searchPlaceholder: "Rechercher...",
11327
+ onSelect: handleUserSelect,
11328
+ disabled: readOnly || loadingUsers,
11329
+ filterFunction: userFilterFunction
11330
+ }
11331
+ ) : /* @__PURE__ */ jsx32(
11332
+ TextInput,
11333
+ {
11334
+ value: stage.name,
11335
+ onChange: (e) => onUpdate({ name: e.target.value }),
11336
+ disabled: readOnly
11337
+ }
11338
+ ) }),
11339
+ /* @__PURE__ */ jsx32("td", { className: "border border-gray-300 px-2 py-2", children: /* @__PURE__ */ jsx32(
11340
+ TextInput,
11341
+ {
11342
+ type: "email",
11343
+ value: stage.email,
11344
+ onChange: (e) => onUpdate({ email: e.target.value }),
11345
+ disabled: readOnly || stage.space_answer === "internal"
11346
+ }
11347
+ ) }),
11348
+ /* @__PURE__ */ jsx32("td", { className: "border border-gray-300 px-2 py-2", children: /* @__PURE__ */ jsx32(
11349
+ "input",
11350
+ {
11351
+ type: "text",
11352
+ value: stage.role,
11353
+ disabled: true,
11354
+ className: "w-full px-2 py-1 border border-gray-300 rounded text-sm bg-gray-100"
11355
+ }
11356
+ ) }),
11357
+ /* @__PURE__ */ jsx32("td", { className: "border border-gray-300 px-4 py-2 text-center", children: getStatusIcon(stage.answer) })
11358
+ ] }),
11359
+ stage.note && /* @__PURE__ */ jsx32("tr", { children: /* @__PURE__ */ jsx32("td", { colSpan: 7, className: "border border-gray-300 px-4 py-2 bg-[var(--color-warning-light)]", children: /* @__PURE__ */ jsxs26("p", { className: "text-xs text-gray-600 italic flex items-center gap-1", children: [
11360
+ /* @__PURE__ */ jsx32(MessageSquare, { className: "w-3 h-3" }),
11361
+ ' Note : "',
11362
+ stage.note,
11363
+ '"'
11364
+ ] }) }) })
11242
11365
  ] });
11243
11366
  };
11244
11367
  var AddStageButton = ({
@@ -11789,7 +11912,7 @@ var getRole = (a, center_id) => {
11789
11912
  console.log(a.user_detail, center_id);
11790
11913
  return a.user_detail?.centers_access?.find((c) => c.id === center_id)?.fonction ?? "";
11791
11914
  };
11792
- var formatDate2 = (date) => date ? formatDateFR(date) : "-";
11915
+ var formatDate3 = (date) => date ? formatDateFR(date) : "-";
11793
11916
  var borderStyle = { borderColor: "var(--color-border)" };
11794
11917
  var cellClass = "border px-2 py-1";
11795
11918
  var headerStyle = { ...borderStyle, color: "var(--color-text-secondary)" };
@@ -11824,7 +11947,7 @@ var ApprovalRecap = ({ process, object_id }) => {
11824
11947
  return /* @__PURE__ */ jsxs28("tr", { children: [
11825
11948
  /* @__PURE__ */ jsx34("td", { className: `${cellClass} uppercase`, style: { ...borderStyle, color: "var(--color-text)" }, children: getName(item) }),
11826
11949
  /* @__PURE__ */ jsx34("td", { className: `${cellClass} uppercase`, style: { ...borderStyle, color: "var(--color-text)" }, children: getRole(item, activeBusinessEntity?.id ?? null) }),
11827
- /* @__PURE__ */ jsx34("td", { className: cellClass, style: borderStyle, children: formatDate2(item.answered_at) }),
11950
+ /* @__PURE__ */ jsx34("td", { className: cellClass, style: borderStyle, children: formatDate3(item.answered_at) }),
11828
11951
  /* @__PURE__ */ jsx34("td", { className: cellClass, style: borderStyle, children: /* @__PURE__ */ jsx34("span", { className: "inline-flex items-center gap-1", style: { color: s.color }, children: s.icon }) }),
11829
11952
  /* @__PURE__ */ jsx34("td", { className: cellClass, style: borderStyle })
11830
11953
  ] }, i);
@@ -11845,7 +11968,7 @@ var ApprovalRecap = ({ process, object_id }) => {
11845
11968
  /* @__PURE__ */ jsx34("td", { className: cellClass, style: borderStyle, children: "Demand\xE9 par" }),
11846
11969
  /* @__PURE__ */ jsx34("td", { className: `${cellClass} uppercase`, style: { ...borderStyle, color: "var(--color-text)" }, children: `${requester.first_name} ${requester.last_name}`.trim() }),
11847
11970
  /* @__PURE__ */ jsx34("td", { className: `${cellClass} uppercase`, style: { ...borderStyle, color: "var(--color-text)" }, children: requester?.centers_access?.find((c) => c.id === activeBusinessEntity?.id)?.fonction ?? "" }),
11848
- /* @__PURE__ */ jsx34("td", { className: cellClass, style: borderStyle, children: formatDate2(caseData.created_at) }),
11971
+ /* @__PURE__ */ jsx34("td", { className: cellClass, style: borderStyle, children: formatDate3(caseData.created_at) }),
11849
11972
  /* @__PURE__ */ jsx34("td", { className: cellClass, style: borderStyle, children: /* @__PURE__ */ jsx34("span", { className: "inline-flex items-center gap-1", style: { color: "var(--color-primary)" }, children: /* @__PURE__ */ jsx34(CheckCircle3, { className: "w-3.5 h-3.5" }) }) }),
11850
11973
  /* @__PURE__ */ jsx34("td", { className: cellClass, style: borderStyle })
11851
11974
  ] }),
@@ -12589,7 +12712,7 @@ var DetailField = ({ label, value }) => value ? /* @__PURE__ */ jsxs32("div", {
12589
12712
  /* @__PURE__ */ jsx39("p", { className: "text-xs text-[var(--color-text-tertiary)]", children: label }),
12590
12713
  /* @__PURE__ */ jsx39("p", { className: "text-sm font-medium text-[var(--color-text-primary)]", children: typeof value === "string" || typeof value === "number" ? value : value })
12591
12714
  ] }) : null;
12592
- var formatDate3 = (d) => d ? new Date(d).toLocaleString("fr-FR", { day: "2-digit", month: "long", year: "numeric", hour: "2-digit", minute: "2-digit" }) : "-";
12715
+ var formatDate4 = (d) => d ? new Date(d).toLocaleString("fr-FR", { day: "2-digit", month: "long", year: "numeric", hour: "2-digit", minute: "2-digit" }) : "-";
12593
12716
  var ActivityDetailModal = ({ activity }) => {
12594
12717
  const d = activity.detail;
12595
12718
  if (!d) return /* @__PURE__ */ jsx39("p", { className: "text-sm text-[var(--color-text-secondary)]", children: "Aucun d\xE9tail disponible." });
@@ -12612,7 +12735,7 @@ var ActivityDetailModal = ({ activity }) => {
12612
12735
  /* @__PURE__ */ jsx39(DetailField, { label: "Adresse de livraison", value: d.delivery_address }),
12613
12736
  /* @__PURE__ */ jsx39(DetailField, { label: "Contact livraison", value: d.delivery_contact }),
12614
12737
  /* @__PURE__ */ jsx39(DetailField, { label: "T\xE9l. livraison", value: d.delivery_phone }),
12615
- /* @__PURE__ */ jsx39(DetailField, { label: "Cr\xE9\xE9 le", value: formatDate3(d.created_at) }),
12738
+ /* @__PURE__ */ jsx39(DetailField, { label: "Cr\xE9\xE9 le", value: formatDate4(d.created_at) }),
12616
12739
  /* @__PURE__ */ jsx39(DetailField, { label: "Commentaires", value: d.comments })
12617
12740
  ] }),
12618
12741
  d.items?.length > 0 && /* @__PURE__ */ jsxs32("div", { children: [
@@ -12667,7 +12790,7 @@ var ActivityDetailModal = ({ activity }) => {
12667
12790
  /* @__PURE__ */ jsx39(DetailField, { label: "Prix final", value: d.final_price ? `${d.final_price.toLocaleString("fr-FR")} FCFA` : void 0 }),
12668
12791
  /* @__PURE__ */ jsx39(DetailField, { label: "Remise", value: d.global_discount ? `${d.global_discount}${d.global_discount_type === "percentage" ? "%" : " FCFA"}` : void 0 }),
12669
12792
  /* @__PURE__ */ jsx39(DetailField, { label: "Observations", value: d.observations }),
12670
- /* @__PURE__ */ jsx39(DetailField, { label: "Cr\xE9\xE9 le", value: formatDate3(d.created_at) })
12793
+ /* @__PURE__ */ jsx39(DetailField, { label: "Cr\xE9\xE9 le", value: formatDate4(d.created_at) })
12671
12794
  ] }),
12672
12795
  d.items?.length > 0 && /* @__PURE__ */ jsxs32("div", { children: [
12673
12796
  /* @__PURE__ */ jsxs32("h4", { className: "text-sm font-semibold text-[var(--color-text-primary)] mb-2", children: [
@@ -12714,9 +12837,9 @@ var ActivityDetailModal = ({ activity }) => {
12714
12837
  /* @__PURE__ */ jsxs32("div", { className: "grid grid-cols-2 md:grid-cols-3 gap-4 bg-[var(--color-surface-hover)] rounded-lg p-4", children: [
12715
12838
  /* @__PURE__ */ jsx39(DetailField, { label: "Type de r\xE9ception", value: d.type_of_receipt }),
12716
12839
  /* @__PURE__ */ jsx39(DetailField, { label: "Adresse de r\xE9ception", value: d.receipt_address }),
12717
- /* @__PURE__ */ jsx39(DetailField, { label: "Date de r\xE9ception", value: formatDate3(d.received_at) }),
12840
+ /* @__PURE__ */ jsx39(DetailField, { label: "Date de r\xE9ception", value: formatDate4(d.received_at) }),
12718
12841
  /* @__PURE__ */ jsx39(DetailField, { label: "Commentaires", value: d.comments }),
12719
- /* @__PURE__ */ jsx39(DetailField, { label: "Cr\xE9\xE9 le", value: formatDate3(d.created_at) })
12842
+ /* @__PURE__ */ jsx39(DetailField, { label: "Cr\xE9\xE9 le", value: formatDate4(d.created_at) })
12720
12843
  ] }),
12721
12844
  d.items?.length > 0 && /* @__PURE__ */ jsxs32("div", { children: [
12722
12845
  /* @__PURE__ */ jsxs32("h4", { className: "text-sm font-semibold text-[var(--color-text-primary)] mb-2", children: [
@@ -17883,7 +18006,7 @@ import { useState as useState34, useEffect as useEffect26, useCallback as useCal
17883
18006
  import {
17884
18007
  Plus as Plus6,
17885
18008
  MoreVertical as MoreVertical2,
17886
- MessageSquare,
18009
+ MessageSquare as MessageSquare2,
17887
18010
  Paperclip,
17888
18011
  Search as Search4,
17889
18012
  Filter as Filter2,
@@ -18185,7 +18308,7 @@ var TaskCard = ({ task, isDragging, onDragStart, onDragEnd, onEdit, onDelete })
18185
18308
  /* @__PURE__ */ jsx56("span", { children: new Date(task.end_date).toLocaleDateString("fr-FR") })
18186
18309
  ] }),
18187
18310
  /* @__PURE__ */ jsxs49("div", { className: "flex items-center gap-3", children: [
18188
- task.comment && /* @__PURE__ */ jsx56("div", { className: "flex items-center gap-1", children: /* @__PURE__ */ jsx56(MessageSquare, { className: "w-3.5 h-3.5" }) }),
18311
+ task.comment && /* @__PURE__ */ jsx56("div", { className: "flex items-center gap-1", children: /* @__PURE__ */ jsx56(MessageSquare2, { className: "w-3.5 h-3.5" }) }),
18189
18312
  task.file && /* @__PURE__ */ jsx56("div", { className: "flex items-center gap-1", children: /* @__PURE__ */ jsx56(Paperclip, { className: "w-3.5 h-3.5" }) })
18190
18313
  ] })
18191
18314
  ] })
@@ -20175,7 +20298,7 @@ import {
20175
20298
  Plus as Plus11,
20176
20299
  Search as Search7,
20177
20300
  MoreVertical as MoreVertical4,
20178
- Edit as Edit2,
20301
+ Edit as Edit4,
20179
20302
  Trash2 as Trash29,
20180
20303
  Eye as Eye8,
20181
20304
  Phone as Phone6,
@@ -20191,7 +20314,7 @@ import { useParams as useParams3, useNavigate as useNavigate11 } from "react-rou
20191
20314
  import {
20192
20315
  ArrowLeft as ArrowLeft2,
20193
20316
  Building2 as Building28,
20194
- Edit as Edit4,
20317
+ Edit as Edit5,
20195
20318
  Trash2 as Trash210,
20196
20319
  Plus as Plus12,
20197
20320
  MapPin as MapPin8,
@@ -20300,7 +20423,7 @@ import { useState as useState54, useEffect as useEffect40 } from "react";
20300
20423
  import { useNavigate as useNavigate17 } from "react-router-dom";
20301
20424
  import {
20302
20425
  Plus as Plus14,
20303
- Edit as Edit5,
20426
+ Edit as Edit6,
20304
20427
  Trash2 as Trash212
20305
20428
  } from "lucide-react";
20306
20429
  import { Fragment as Fragment17, jsx as jsx79, jsxs as jsxs72 } from "react/jsx-runtime";
@@ -20344,7 +20467,7 @@ import {
20344
20467
  Activity as Activity2,
20345
20468
  Briefcase as Briefcase4,
20346
20469
  Plus as Plus15,
20347
- Edit as Edit6,
20470
+ Edit as Edit7,
20348
20471
  Loader2 as Loader210
20349
20472
  } from "lucide-react";
20350
20473
  import { Fragment as Fragment18, jsx as jsx81, jsxs as jsxs74 } from "react/jsx-runtime";
@@ -20385,7 +20508,7 @@ import { jsx as jsx87, jsxs as jsxs80 } from "react/jsx-runtime";
20385
20508
  import { useState as useState60, useEffect as useEffect44 } from "react";
20386
20509
  import {
20387
20510
  Plus as Plus16,
20388
- Edit as Edit7,
20511
+ Edit as Edit8,
20389
20512
  Trash2 as Trash214
20390
20513
  } from "lucide-react";
20391
20514
  import { Fragment as Fragment20, jsx as jsx88, jsxs as jsxs81 } from "react/jsx-runtime";
@@ -20395,7 +20518,7 @@ import React55, { useState as useState61, useEffect as useEffect45, useRef as us
20395
20518
  import { useReactToPrint as useReactToPrint2 } from "react-to-print";
20396
20519
  import {
20397
20520
  Plus as Plus17,
20398
- Edit as Edit8,
20521
+ Edit as Edit9,
20399
20522
  Trash2 as Trash215,
20400
20523
  GripVertical as GripVertical2,
20401
20524
  X as X19,
@@ -20643,7 +20766,7 @@ var PrintableFormPreview = React55.forwardRef(
20643
20766
  import { useState as useState62, useEffect as useEffect46 } from "react";
20644
20767
  import {
20645
20768
  Plus as Plus18,
20646
- Edit as Edit9,
20769
+ Edit as Edit10,
20647
20770
  Trash2 as Trash217,
20648
20771
  Shield as Shield7,
20649
20772
  CheckCircle as CheckCircle13,
@@ -26253,7 +26376,7 @@ import {
26253
26376
  BarChart3 as BarChart37,
26254
26377
  Users as Users17,
26255
26378
  Target as Target6,
26256
- Edit as Edit13,
26379
+ Edit as Edit14,
26257
26380
  Trash2 as Trash223,
26258
26381
  TrendingUp as TrendingUp12,
26259
26382
  TrendingDown as TrendingDown4,
@@ -26269,7 +26392,7 @@ import {
26269
26392
  ChevronRight as ChevronRight7,
26270
26393
  ClipboardList as ClipboardList5,
26271
26394
  User as User5,
26272
- MessageSquare as MessageSquare2,
26395
+ MessageSquare as MessageSquare3,
26273
26396
  Zap as Zap5,
26274
26397
  Activity as Activity3,
26275
26398
  Filter as Filter5,
@@ -27476,7 +27599,7 @@ import {
27476
27599
  Calendar as Calendar10,
27477
27600
  Euro,
27478
27601
  Download as Download7,
27479
- Edit as Edit10,
27602
+ Edit as Edit11,
27480
27603
  Archive,
27481
27604
  RefreshCw as RefreshCw10,
27482
27605
  CheckCircle as CheckCircle14,
@@ -27771,7 +27894,7 @@ var ViewContractContent = ({
27771
27894
  };
27772
27895
  }, [contract]);
27773
27896
  if (!contract) return null;
27774
- const formatDate4 = (dateString) => {
27897
+ const formatDate5 = (dateString) => {
27775
27898
  if (!dateString) return "Non d\xE9fini";
27776
27899
  return new Date(dateString).toLocaleDateString("fr-FR");
27777
27900
  };
@@ -28050,19 +28173,19 @@ var ViewContractContent = ({
28050
28173
  /* @__PURE__ */ jsxs122("dl", { className: "space-y-3", children: [
28051
28174
  /* @__PURE__ */ jsxs122("div", { className: "flex justify-between", children: [
28052
28175
  /* @__PURE__ */ jsx133("dt", { className: "text-sm font-medium text-gray-500", children: "Date de cr\xE9ation" }),
28053
- /* @__PURE__ */ jsx133("dd", { className: "text-sm text-gray-900", children: formatDate4(contract.created_at || contract.created_at) })
28176
+ /* @__PURE__ */ jsx133("dd", { className: "text-sm text-gray-900", children: formatDate5(contract.created_at || contract.created_at) })
28054
28177
  ] }),
28055
28178
  /* @__PURE__ */ jsxs122("div", { className: "flex justify-between", children: [
28056
28179
  /* @__PURE__ */ jsx133("dt", { className: "text-sm font-medium text-gray-500", children: "Date de signature" }),
28057
- /* @__PURE__ */ jsx133("dd", { className: "text-sm text-gray-900", children: formatDate4(contract.signature_date || "") })
28180
+ /* @__PURE__ */ jsx133("dd", { className: "text-sm text-gray-900", children: formatDate5(contract.signature_date || "") })
28058
28181
  ] }),
28059
28182
  /* @__PURE__ */ jsxs122("div", { className: "flex justify-between", children: [
28060
28183
  /* @__PURE__ */ jsx133("dt", { className: "text-sm font-medium text-gray-500", children: "D\xE9but" }),
28061
- /* @__PURE__ */ jsx133("dd", { className: "text-sm text-gray-900", children: formatDate4(contract.start_date) })
28184
+ /* @__PURE__ */ jsx133("dd", { className: "text-sm text-gray-900", children: formatDate5(contract.start_date) })
28062
28185
  ] }),
28063
28186
  /* @__PURE__ */ jsxs122("div", { className: "flex justify-between", children: [
28064
28187
  /* @__PURE__ */ jsx133("dt", { className: "text-sm font-medium text-gray-500", children: "Fin" }),
28065
- /* @__PURE__ */ jsx133("dd", { className: "text-sm text-gray-900 font-medium", children: formatDate4(contract.end_date) })
28188
+ /* @__PURE__ */ jsx133("dd", { className: "text-sm text-gray-900 font-medium", children: formatDate5(contract.end_date) })
28066
28189
  ] }),
28067
28190
  /* @__PURE__ */ jsxs122("div", { className: "flex justify-between", children: [
28068
28191
  /* @__PURE__ */ jsx133("dt", { className: "text-sm font-medium text-gray-500", children: "Pr\xE9avis de r\xE9siliation" }),
@@ -28180,11 +28303,11 @@ var ViewContractContent = ({
28180
28303
  /* @__PURE__ */ jsxs122("div", { className: "grid grid-cols-1 md:grid-cols-3 gap-6", children: [
28181
28304
  /* @__PURE__ */ jsxs122("div", { className: "p-4 bg-[var(--color-success-light)] rounded-lg", children: [
28182
28305
  /* @__PURE__ */ jsx133("p", { className: "text-sm font-medium text-[var(--color-success)]", children: "Date de d\xE9but" }),
28183
- /* @__PURE__ */ jsx133("p", { className: "text-xl font-bold text-gray-900 mt-1", children: formatDate4(contract.start_date) })
28306
+ /* @__PURE__ */ jsx133("p", { className: "text-xl font-bold text-gray-900 mt-1", children: formatDate5(contract.start_date) })
28184
28307
  ] }),
28185
28308
  /* @__PURE__ */ jsxs122("div", { className: "p-4 bg-[var(--color-error-light)] rounded-lg", children: [
28186
28309
  /* @__PURE__ */ jsx133("p", { className: "text-sm font-medium text-[var(--color-error)]", children: "Date de fin" }),
28187
- /* @__PURE__ */ jsx133("p", { className: "text-xl font-bold text-gray-900 mt-1", children: formatDate4(contract.end_date) })
28310
+ /* @__PURE__ */ jsx133("p", { className: "text-xl font-bold text-gray-900 mt-1", children: formatDate5(contract.end_date) })
28188
28311
  ] }),
28189
28312
  /* @__PURE__ */ jsxs122("div", { className: "p-4 bg-[var(--color-info-light)] rounded-lg", children: [
28190
28313
  /* @__PURE__ */ jsx133("p", { className: "text-sm font-medium text-[var(--color-info)]", children: "Jours restants" }),
@@ -28217,7 +28340,7 @@ var ViewContractContent = ({
28217
28340
  ] }),
28218
28341
  contract.renewal_date && /* @__PURE__ */ jsxs122("div", { className: "flex justify-between", children: [
28219
28342
  /* @__PURE__ */ jsx133("dt", { className: "text-sm font-medium text-gray-500", children: "Date de renouvellement" }),
28220
- /* @__PURE__ */ jsx133("dd", { className: "text-sm text-gray-900", children: formatDate4(contract.renewal_date) })
28343
+ /* @__PURE__ */ jsx133("dd", { className: "text-sm text-gray-900", children: formatDate5(contract.renewal_date) })
28221
28344
  ] }),
28222
28345
  contract.duration && /* @__PURE__ */ jsxs122("div", { className: "flex justify-between", children: [
28223
28346
  /* @__PURE__ */ jsx133("dt", { className: "text-sm font-medium text-gray-500", children: "Dur\xE9e" }),
@@ -28358,7 +28481,7 @@ var ViewContractContent = ({
28358
28481
  milestone.percentage,
28359
28482
  "%"
28360
28483
  ] }),
28361
- /* @__PURE__ */ jsx133("td", { className: "py-3 text-center", children: formatDate4(milestone.dueDate) }),
28484
+ /* @__PURE__ */ jsx133("td", { className: "py-3 text-center", children: formatDate5(milestone.dueDate) }),
28362
28485
  /* @__PURE__ */ jsx133("td", { className: "py-3 text-center", children: /* @__PURE__ */ jsx133(Badge2, { variant: milestone.status === "paid" ? "success" : milestone.status === "overdue" ? "error" : milestone.status === "invoiced" ? "warning" : "default", children: milestone.status === "paid" ? "Pay\xE9" : milestone.status === "overdue" ? "En retard" : milestone.status === "invoiced" ? "Factur\xE9" : "En attente" }) })
28363
28486
  ] }, milestone.id)) })
28364
28487
  ] }) })
@@ -28627,11 +28750,11 @@ var ViewContractContent = ({
28627
28750
  ] }),
28628
28751
  /* @__PURE__ */ jsxs122("div", { children: [
28629
28752
  /* @__PURE__ */ jsx133("p", { className: "text-gray-500", children: "Date d'\xE9mission" }),
28630
- /* @__PURE__ */ jsx133("p", { className: "font-medium", children: formatDate4(guarantee.issueDate) })
28753
+ /* @__PURE__ */ jsx133("p", { className: "font-medium", children: formatDate5(guarantee.issueDate) })
28631
28754
  ] }),
28632
28755
  /* @__PURE__ */ jsxs122("div", { children: [
28633
28756
  /* @__PURE__ */ jsx133("p", { className: "text-gray-500", children: "Date d'expiration" }),
28634
- /* @__PURE__ */ jsx133("p", { className: `font-medium ${new Date(guarantee.expiryDate) < /* @__PURE__ */ new Date() ? "text-[var(--color-error)]" : ""}`, children: formatDate4(guarantee.expiryDate) })
28757
+ /* @__PURE__ */ jsx133("p", { className: `font-medium ${new Date(guarantee.expiryDate) < /* @__PURE__ */ new Date() ? "text-[var(--color-error)]" : ""}`, children: formatDate5(guarantee.expiryDate) })
28635
28758
  ] })
28636
28759
  ] }),
28637
28760
  guarantee.releaseConditions && /* @__PURE__ */ jsxs122("div", { className: "mt-3 p-3 bg-gray-50 rounded-lg", children: [
@@ -28671,7 +28794,7 @@ var ViewContractContent = ({
28671
28794
  ] }),
28672
28795
  insurance.validUntil && /* @__PURE__ */ jsxs122("div", { children: [
28673
28796
  /* @__PURE__ */ jsx133("p", { className: "text-gray-500", children: "Valide jusqu'au" }),
28674
- /* @__PURE__ */ jsx133("p", { className: `font-medium ${new Date(insurance.validUntil) < /* @__PURE__ */ new Date() ? "text-[var(--color-error)]" : ""}`, children: formatDate4(insurance.validUntil) })
28797
+ /* @__PURE__ */ jsx133("p", { className: `font-medium ${new Date(insurance.validUntil) < /* @__PURE__ */ new Date() ? "text-[var(--color-error)]" : ""}`, children: formatDate5(insurance.validUntil) })
28675
28798
  ] })
28676
28799
  ] })
28677
28800
  ] }, insurance.id)) }) : /* @__PURE__ */ jsxs122("div", { className: "text-center py-8 text-gray-500", children: [
@@ -28742,7 +28865,7 @@ var ViewContractContent = ({
28742
28865
  ] }),
28743
28866
  /* @__PURE__ */ jsxs122("div", { className: "text-right", children: [
28744
28867
  /* @__PURE__ */ jsx133(Badge2, { variant: approver.status === "approved" ? "success" : approver.status === "rejected" ? "error" : "default", children: approver.status === "approved" ? "Approuv\xE9" : approver.status === "rejected" ? "Rejet\xE9" : "En attente" }),
28745
- approver.approvalDate && /* @__PURE__ */ jsx133("p", { className: "text-xs text-gray-500 mt-1", children: formatDate4(approver.approvalDate) })
28868
+ approver.approvalDate && /* @__PURE__ */ jsx133("p", { className: "text-xs text-gray-500 mt-1", children: formatDate5(approver.approvalDate) })
28746
28869
  ] })
28747
28870
  ] }, index)) })
28748
28871
  ] }),
@@ -28796,11 +28919,11 @@ var ViewContractContent = ({
28796
28919
  ] }),
28797
28920
  contract.governance.steeringCommittee.lastMeetingDate && /* @__PURE__ */ jsxs122("div", { className: "flex justify-between", children: [
28798
28921
  /* @__PURE__ */ jsx133("dt", { className: "text-gray-500", children: "Derni\xE8re r\xE9union" }),
28799
- /* @__PURE__ */ jsx133("dd", { className: "text-gray-900", children: formatDate4(contract.governance.steeringCommittee.lastMeetingDate) })
28922
+ /* @__PURE__ */ jsx133("dd", { className: "text-gray-900", children: formatDate5(contract.governance.steeringCommittee.lastMeetingDate) })
28800
28923
  ] }),
28801
28924
  contract.governance.steeringCommittee.nextMeetingDate && /* @__PURE__ */ jsxs122("div", { className: "flex justify-between", children: [
28802
28925
  /* @__PURE__ */ jsx133("dt", { className: "text-gray-500", children: "Prochaine r\xE9union" }),
28803
- /* @__PURE__ */ jsx133("dd", { className: "text-gray-900 font-medium", children: formatDate4(contract.governance.steeringCommittee.nextMeetingDate) })
28926
+ /* @__PURE__ */ jsx133("dd", { className: "text-gray-900 font-medium", children: formatDate5(contract.governance.steeringCommittee.nextMeetingDate) })
28804
28927
  ] })
28805
28928
  ] })
28806
28929
  ] })
@@ -28873,7 +28996,7 @@ var ViewContractContent = ({
28873
28996
  ] }),
28874
28997
  contract.regulatoryCompliance.sanctionsScreening?.lastScreeningDate && /* @__PURE__ */ jsxs122("p", { className: "text-sm text-gray-500", children: [
28875
28998
  "Dernier contr\xF4le: ",
28876
- formatDate4(contract.regulatoryCompliance.sanctionsScreening.lastScreeningDate)
28999
+ formatDate5(contract.regulatoryCompliance.sanctionsScreening.lastScreeningDate)
28877
29000
  ] })
28878
29001
  ] })
28879
29002
  ] })
@@ -28929,7 +29052,7 @@ var ViewContractContent = ({
28929
29052
  ] }),
28930
29053
  /* @__PURE__ */ jsxs122("p", { className: "text-xs text-[var(--color-success)] mt-1", children: [
28931
29054
  "\xC9valu\xE9 le ",
28932
- formatDate4(contract.esgCriteria.lastAssessmentDate)
29055
+ formatDate5(contract.esgCriteria.lastAssessmentDate)
28933
29056
  ] })
28934
29057
  ] }),
28935
29058
  /* @__PURE__ */ jsx133(RewiseCard, { className: "p-4", children: /* @__PURE__ */ jsxs122("div", { className: "flex items-center space-x-3", children: [
@@ -29100,7 +29223,7 @@ var ViewContractContent = ({
29100
29223
  /* @__PURE__ */ jsx133("span", { children: "\u2022" }),
29101
29224
  /* @__PURE__ */ jsxs122("span", { children: [
29102
29225
  "\xC9ch\xE9ance: ",
29103
- formatDate4(obligation.dueDate)
29226
+ formatDate5(obligation.dueDate)
29104
29227
  ] })
29105
29228
  ] }),
29106
29229
  /* @__PURE__ */ jsx133("span", { children: "\u2022" }),
@@ -29166,7 +29289,7 @@ var ViewContractContent = ({
29166
29289
  ] }),
29167
29290
  sla.last_evaluation && /* @__PURE__ */ jsxs122("span", { children: [
29168
29291
  "Derni\xE8re mesure: ",
29169
- formatDate4(sla.last_evaluation)
29292
+ formatDate5(sla.last_evaluation)
29170
29293
  ] })
29171
29294
  ] })
29172
29295
  ] }, sla.id)) }) : /* @__PURE__ */ jsxs122(RewiseCard, { className: "p-8 text-center", children: [
@@ -29377,7 +29500,7 @@ var ViewContractContent = ({
29377
29500
  " MB \u2022 Version ",
29378
29501
  doc.version,
29379
29502
  " \u2022 Ajout\xE9 le ",
29380
- formatDate4(doc.uploadedAt)
29503
+ formatDate5(doc.uploadedAt)
29381
29504
  ] }),
29382
29505
  doc.description && /* @__PURE__ */ jsx133("p", { className: "text-sm text-gray-600 mt-1", children: doc.description })
29383
29506
  ] })
@@ -29408,7 +29531,7 @@ var ViewContractContent = ({
29408
29531
  ] }),
29409
29532
  /* @__PURE__ */ jsx133("p", { className: "text-sm text-gray-600 mb-2", children: amendment.description }),
29410
29533
  /* @__PURE__ */ jsxs122("p", { className: "text-xs text-gray-500", children: [
29411
- formatDate4(amendment.date),
29534
+ formatDate5(amendment.date),
29412
29535
  " \u2022 Raison: ",
29413
29536
  amendment.reason
29414
29537
  ] })
@@ -29418,7 +29541,7 @@ var ViewContractContent = ({
29418
29541
  const renderHistoryTab = () => /* @__PURE__ */ jsxs122("div", { className: "space-y-4", children: [
29419
29542
  /* @__PURE__ */ jsx133("h3", { className: "text-lg font-semibold text-gray-900", children: "Historique des actions" }),
29420
29543
  contract.auditTrail && contract.auditTrail.length > 0 ? /* @__PURE__ */ jsx133("div", { className: "space-y-4", children: contract.auditTrail.sort((a, b) => new Date(b.timestamp).getTime() - new Date(a.timestamp).getTime()).map((entry, index) => /* @__PURE__ */ jsxs122("div", { className: "flex space-x-4", children: [
29421
- /* @__PURE__ */ jsx133("div", { className: "flex-shrink-0", children: /* @__PURE__ */ jsx133("div", { className: `w-10 h-10 rounded-full flex items-center justify-center ${entry.action === "created" ? "bg-[var(--color-success-light)]" : entry.action === "approved" ? "bg-[var(--color-info-light)]" : entry.action === "rejected" ? "bg-[var(--color-error-light)]" : entry.action === "signed" ? "bg-[var(--color-info-light)]" : entry.action === "amended" ? "bg-[var(--color-warning-light)]" : "bg-gray-100"}`, children: entry.action === "created" ? /* @__PURE__ */ jsx133(FileText20, { className: "w-5 h-5 text-[var(--color-success)]" }) : entry.action === "approved" ? /* @__PURE__ */ jsx133(CheckCircle14, { className: "w-5 h-5 text-[var(--color-info)]" }) : entry.action === "rejected" ? /* @__PURE__ */ jsx133(AlertTriangle9, { className: "w-5 h-5 text-[var(--color-error)]" }) : entry.action === "signed" ? /* @__PURE__ */ jsx133(FileCheck3, { className: "w-5 h-5 text-[var(--color-info)]" }) : entry.action === "amended" ? /* @__PURE__ */ jsx133(Edit10, { className: "w-5 h-5 text-[var(--color-warning)]" }) : /* @__PURE__ */ jsx133(Clock11, { className: "w-5 h-5 text-gray-600" }) }) }),
29544
+ /* @__PURE__ */ jsx133("div", { className: "flex-shrink-0", children: /* @__PURE__ */ jsx133("div", { className: `w-10 h-10 rounded-full flex items-center justify-center ${entry.action === "created" ? "bg-[var(--color-success-light)]" : entry.action === "approved" ? "bg-[var(--color-info-light)]" : entry.action === "rejected" ? "bg-[var(--color-error-light)]" : entry.action === "signed" ? "bg-[var(--color-info-light)]" : entry.action === "amended" ? "bg-[var(--color-warning-light)]" : "bg-gray-100"}`, children: entry.action === "created" ? /* @__PURE__ */ jsx133(FileText20, { className: "w-5 h-5 text-[var(--color-success)]" }) : entry.action === "approved" ? /* @__PURE__ */ jsx133(CheckCircle14, { className: "w-5 h-5 text-[var(--color-info)]" }) : entry.action === "rejected" ? /* @__PURE__ */ jsx133(AlertTriangle9, { className: "w-5 h-5 text-[var(--color-error)]" }) : entry.action === "signed" ? /* @__PURE__ */ jsx133(FileCheck3, { className: "w-5 h-5 text-[var(--color-info)]" }) : entry.action === "amended" ? /* @__PURE__ */ jsx133(Edit11, { className: "w-5 h-5 text-[var(--color-warning)]" }) : /* @__PURE__ */ jsx133(Clock11, { className: "w-5 h-5 text-gray-600" }) }) }),
29422
29545
  /* @__PURE__ */ jsxs122("div", { className: "flex-1 min-w-0", children: [
29423
29546
  /* @__PURE__ */ jsxs122("div", { className: "flex items-center justify-between", children: [
29424
29547
  /* @__PURE__ */ jsx133("p", { className: "text-sm font-medium text-gray-900 capitalize", children: entry.action === "created" ? "Cr\xE9ation" : entry.action === "updated" ? "Mise \xE0 jour" : entry.action === "approved" ? "Approbation" : entry.action === "rejected" ? "Rejet" : entry.action === "signed" ? "Signature" : entry.action === "renewed" ? "Renouvellement" : entry.action === "terminated" ? "R\xE9siliation" : entry.action === "amended" ? "Avenant" : entry.action === "viewed" ? "Consultation" : entry.action === "exported" ? "Export" : entry.action }),
@@ -29466,7 +29589,7 @@ var ViewContractContent = ({
29466
29589
  size: "sm",
29467
29590
  onClick: () => handleAction("edit"),
29468
29591
  children: [
29469
- /* @__PURE__ */ jsx133(Edit10, { className: "w-4 h-4 mr-2" }),
29592
+ /* @__PURE__ */ jsx133(Edit11, { className: "w-4 h-4 mr-2" }),
29470
29593
  "Modifier"
29471
29594
  ]
29472
29595
  }
@@ -29506,7 +29629,7 @@ var ViewContractContent = ({
29506
29629
  "Ce contrat expire dans ",
29507
29630
  daysUntilExpiry,
29508
29631
  " jours (",
29509
- formatDate4(contract.end_date),
29632
+ formatDate5(contract.end_date),
29510
29633
  ")"
29511
29634
  ] })
29512
29635
  ] }),
@@ -29591,7 +29714,7 @@ import {
29591
29714
  Table as Table3,
29592
29715
  Plus as Plus22,
29593
29716
  Trash2 as Trash221,
29594
- Edit as Edit11,
29717
+ Edit as Edit12,
29595
29718
  CheckCircle as CheckCircle15,
29596
29719
  XCircle as XCircle6,
29597
29720
  AlertTriangle as AlertTriangle10,
@@ -30562,7 +30685,7 @@ var ContractForm = ({ contract, onSubmit, onCancel, onShowToast, isEdit = false
30562
30685
  type: "button",
30563
30686
  onClick: () => handleEditSLA(indicator),
30564
30687
  className: "p-1 text-[#78a6d2] hover:bg-[#78a6d2]/10 rounded",
30565
- children: /* @__PURE__ */ jsx134(Edit11, { className: "w-4 h-4" })
30688
+ children: /* @__PURE__ */ jsx134(Edit12, { className: "w-4 h-4" })
30566
30689
  }
30567
30690
  ),
30568
30691
  /* @__PURE__ */ jsx134(
@@ -32192,7 +32315,7 @@ import {
32192
32315
  Smartphone as Smartphone3,
32193
32316
  Filter as Filter4,
32194
32317
  Search as Search11,
32195
- Edit as Edit12,
32318
+ Edit as Edit13,
32196
32319
  Trash2 as Trash222,
32197
32320
  Eye as Eye15,
32198
32321
  EyeOff as EyeOff5
@@ -32528,7 +32651,7 @@ var AlertsManagementModal = ({
32528
32651
  ] })
32529
32652
  ] }),
32530
32653
  /* @__PURE__ */ jsxs125("div", { className: "flex items-center space-x-2", children: [
32531
- /* @__PURE__ */ jsx137(Button2, { variant: "text", size: "sm", children: /* @__PURE__ */ jsx137(Edit12, { className: "w-4 h-4" }) }),
32654
+ /* @__PURE__ */ jsx137(Button2, { variant: "text", size: "sm", children: /* @__PURE__ */ jsx137(Edit13, { className: "w-4 h-4" }) }),
32532
32655
  /* @__PURE__ */ jsx137(
32533
32656
  Button2,
32534
32657
  {
@@ -33850,7 +33973,7 @@ var SLAManagementModal = ({
33850
33973
  onShowToast("Indicateur SLA supprim\xE9", "success");
33851
33974
  }
33852
33975
  };
33853
- const formatDate4 = (dateString) => {
33976
+ const formatDate5 = (dateString) => {
33854
33977
  if (!dateString) return "N/A";
33855
33978
  return new Date(dateString).toLocaleDateString("fr-FR");
33856
33979
  };
@@ -34005,7 +34128,7 @@ var SLAManagementModal = ({
34005
34128
  /* @__PURE__ */ jsx139("p", { className: "text-sm", style: { color: colors.text.secondary }, children: indicator.description })
34006
34129
  ] }),
34007
34130
  /* @__PURE__ */ jsxs127("div", { className: "flex space-x-2", children: [
34008
- /* @__PURE__ */ jsx139(PrimaryButton, { variant: "outline", onClick: () => setEditingIndicator(indicator), children: /* @__PURE__ */ jsx139(Edit13, { className: "w-4 h-4" }) }),
34131
+ /* @__PURE__ */ jsx139(PrimaryButton, { variant: "outline", onClick: () => setEditingIndicator(indicator), children: /* @__PURE__ */ jsx139(Edit14, { className: "w-4 h-4" }) }),
34009
34132
  /* @__PURE__ */ jsx139(
34010
34133
  "button",
34011
34134
  {
@@ -34364,7 +34487,7 @@ var SLAManagementModal = ({
34364
34487
  ] }),
34365
34488
  /* @__PURE__ */ jsxs127("p", { className: "text-xs mt-1", style: { color: colors.text.tertiary }, children: [
34366
34489
  "D\xE9tect\xE9 le ",
34367
- formatDate4(incident.detected_date)
34490
+ formatDate5(incident.detected_date)
34368
34491
  ] })
34369
34492
  ] })
34370
34493
  ] }),
@@ -34489,7 +34612,7 @@ var SLAManagementModal = ({
34489
34612
  const getNoteTypeIcon = (type) => {
34490
34613
  switch (type) {
34491
34614
  case "comment":
34492
- return MessageSquare2;
34615
+ return MessageSquare3;
34493
34616
  case "decision":
34494
34617
  return CheckCircle18;
34495
34618
  case "action":
@@ -34497,7 +34620,7 @@ var SLAManagementModal = ({
34497
34620
  case "meeting":
34498
34621
  return Users17;
34499
34622
  default:
34500
- return MessageSquare2;
34623
+ return MessageSquare3;
34501
34624
  }
34502
34625
  };
34503
34626
  const getNoteTypeColor = (type) => {
@@ -34517,7 +34640,7 @@ var SLAManagementModal = ({
34517
34640
  return /* @__PURE__ */ jsxs127("div", { className: "space-y-4", children: [
34518
34641
  /* @__PURE__ */ jsxs127("div", { className: "flex items-center justify-between", children: [
34519
34642
  /* @__PURE__ */ jsxs127("h3", { className: "text-lg font-semibold flex items-center gap-2", style: { color: colors.text.primary }, children: [
34520
- /* @__PURE__ */ jsx139(MessageSquare2, { className: "w-5 h-5", style: { color: colors.primary } }),
34643
+ /* @__PURE__ */ jsx139(MessageSquare3, { className: "w-5 h-5", style: { color: colors.primary } }),
34521
34644
  "Notes et commentaires (",
34522
34645
  notes.length,
34523
34646
  ")"
@@ -34601,7 +34724,7 @@ var SLAManagementModal = ({
34601
34724
  ] })
34602
34725
  ] }),
34603
34726
  notesLoading ? /* @__PURE__ */ jsx139("div", { className: "flex items-center justify-center py-12", children: /* @__PURE__ */ jsx139(RefreshCw11, { className: "w-8 h-8 animate-spin", style: { color: colors.primary } }) }) : filteredNotes.length === 0 ? /* @__PURE__ */ jsxs127("div", { className: "text-center py-12", children: [
34604
- /* @__PURE__ */ jsx139(MessageSquare2, { className: "w-12 h-12 mx-auto mb-4", style: { color: colors.text.tertiary } }),
34727
+ /* @__PURE__ */ jsx139(MessageSquare3, { className: "w-12 h-12 mx-auto mb-4", style: { color: colors.text.tertiary } }),
34605
34728
  /* @__PURE__ */ jsx139("p", { style: { color: colors.text.secondary }, children: "Aucune note" })
34606
34729
  ] }) : /* @__PURE__ */ jsx139("div", { className: "space-y-3", children: filteredNotes.map((note) => {
34607
34730
  const Icon = getNoteTypeIcon(note.note_type);
@@ -34643,7 +34766,7 @@ var SLAManagementModal = ({
34643
34766
  { id: "evaluations", label: "Journal des \xE9valuations", icon: FileText23 },
34644
34767
  { id: "incidents", label: "Incidents", icon: AlertCircle10 },
34645
34768
  { id: "penalties", label: "P\xE9nalit\xE9s & Bonus", icon: DollarSign3 },
34646
- { id: "notes", label: "Notes", icon: MessageSquare2 }
34769
+ { id: "notes", label: "Notes", icon: MessageSquare3 }
34647
34770
  ];
34648
34771
  return /* @__PURE__ */ jsxs127(
34649
34772
  Modal,
@@ -35377,9 +35500,9 @@ export {
35377
35500
  fileManagerApi,
35378
35501
  findFolderById2 as findFolderById,
35379
35502
  formatCurrency,
35380
- formatDate,
35503
+ formatDate2 as formatDate,
35381
35504
  formatDateFR,
35382
- formatDateTime,
35505
+ formatDateTime2 as formatDateTime,
35383
35506
  formatFileSize,
35384
35507
  getAllFolders,
35385
35508
  getAllSLATemplates,