ptechcore_ui 1.0.77 → 1.0.79

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.cjs CHANGED
@@ -191,9 +191,9 @@ __export(index_exports, {
191
191
  fileManagerApi: () => fileManagerApi,
192
192
  findFolderById: () => findFolderById2,
193
193
  formatCurrency: () => formatCurrency,
194
- formatDate: () => formatDate,
194
+ formatDate: () => formatDate2,
195
195
  formatDateFR: () => formatDateFR,
196
- formatDateTime: () => formatDateTime,
196
+ formatDateTime: () => formatDateTime2,
197
197
  formatFileSize: () => formatFileSize,
198
198
  getAllFolders: () => getAllFolders,
199
199
  getAllSLATemplates: () => getAllSLATemplates,
@@ -700,6 +700,25 @@ function formatCurrency(amount, currency = "XAF") {
700
700
  }
701
701
  return new Intl.NumberFormat("fr-FR").format(amount) + " " + currency;
702
702
  }
703
+ function formatDateTime(date) {
704
+ if (!date) return "Non d\xE9fini";
705
+ try {
706
+ const dateObj = typeof date === "string" ? new Date(date) : date;
707
+ if (isNaN(dateObj.getTime())) {
708
+ return "Date invalide";
709
+ }
710
+ return dateObj.toLocaleDateString("fr-FR", {
711
+ year: "numeric",
712
+ month: "long",
713
+ day: "numeric",
714
+ hour: "2-digit",
715
+ minute: "2-digit",
716
+ second: "2-digit"
717
+ });
718
+ } catch (error) {
719
+ return "Erreur de format";
720
+ }
721
+ }
703
722
 
704
723
  // src/contexts/ThemeContext.tsx
705
724
  var import_react2 = require("react");
@@ -1175,6 +1194,96 @@ var FetchApi = class {
1175
1194
  if (!res.ok) throw new Error(await res.text());
1176
1195
  return res.json();
1177
1196
  }
1197
+ static async postFile(url, payload, token) {
1198
+ const headers = {};
1199
+ const local_token = localStorage.getItem("token");
1200
+ if (local_token) {
1201
+ headers["Authorization"] = `Token ${local_token}`;
1202
+ }
1203
+ let body;
1204
+ const business_entity_id = localStorage.getItem("active_center_id");
1205
+ if (payload instanceof FormData) {
1206
+ if (business_entity_id) {
1207
+ payload.append("business_entity_id", business_entity_id);
1208
+ payload.append("business_entity", business_entity_id);
1209
+ }
1210
+ body = payload;
1211
+ } else if (payload) {
1212
+ const hasFile = Object.values(payload).some((v) => v instanceof File || v instanceof Blob);
1213
+ if (hasFile) {
1214
+ const formData = new FormData();
1215
+ Object.entries(payload).forEach(([key, value]) => {
1216
+ if (value instanceof File || value instanceof Blob) {
1217
+ formData.append(key, value);
1218
+ } else if (Array.isArray(value)) {
1219
+ formData.append(key, JSON.stringify(value));
1220
+ } else if (value !== null && value !== void 0) {
1221
+ formData.append(key, String(value));
1222
+ }
1223
+ });
1224
+ if (business_entity_id) {
1225
+ formData.append("business_entity_id", business_entity_id);
1226
+ formData.append("business_entity", business_entity_id);
1227
+ }
1228
+ body = formData;
1229
+ } else {
1230
+ headers["Content-Type"] = "application/json";
1231
+ body = JSON.stringify({ ...payload, business_entity_id, business_entity: business_entity_id });
1232
+ }
1233
+ }
1234
+ const res = await fetch(url, {
1235
+ method: "POST",
1236
+ headers,
1237
+ body
1238
+ });
1239
+ if (!res.ok) throw new Error(await res.text());
1240
+ return res.json();
1241
+ }
1242
+ static async putFile(url, payload, token) {
1243
+ const headers = {};
1244
+ const local_token = localStorage.getItem("token");
1245
+ if (local_token) {
1246
+ headers["Authorization"] = `Token ${local_token}`;
1247
+ }
1248
+ let body;
1249
+ const business_entity_id = localStorage.getItem("active_center_id");
1250
+ if (payload instanceof FormData) {
1251
+ if (business_entity_id) {
1252
+ payload.append("business_entity_id", business_entity_id);
1253
+ payload.append("business_entity", business_entity_id);
1254
+ }
1255
+ body = payload;
1256
+ } else if (payload) {
1257
+ const hasFile = Object.values(payload).some((v) => v instanceof File || v instanceof Blob);
1258
+ if (hasFile) {
1259
+ const formData = new FormData();
1260
+ Object.entries(payload).forEach(([key, value]) => {
1261
+ if (value instanceof File || value instanceof Blob) {
1262
+ formData.append(key, value);
1263
+ } else if (Array.isArray(value)) {
1264
+ formData.append(key, JSON.stringify(value));
1265
+ } else if (value !== null && value !== void 0) {
1266
+ formData.append(key, String(value));
1267
+ }
1268
+ });
1269
+ if (business_entity_id) {
1270
+ formData.append("business_entity_id", business_entity_id);
1271
+ formData.append("business_entity", business_entity_id);
1272
+ }
1273
+ body = formData;
1274
+ } else {
1275
+ headers["Content-Type"] = "application/json";
1276
+ body = JSON.stringify({ ...payload, business_entity_id, business_entity: business_entity_id });
1277
+ }
1278
+ }
1279
+ const res = await fetch(url, {
1280
+ method: "PUT",
1281
+ headers,
1282
+ body
1283
+ });
1284
+ if (!res.ok) throw new Error(await res.text());
1285
+ return res.json();
1286
+ }
1178
1287
  static async patch(url, payload, token) {
1179
1288
  const headers = {
1180
1289
  "Content-Type": "application/json"
@@ -1196,14 +1305,18 @@ var FetchApi = class {
1196
1305
  var apiClient = {
1197
1306
  get: (path) => FetchApi.get(`${API_URL}${path}`),
1198
1307
  post: (path, data) => FetchApi.post(`${API_URL}${path}`, data),
1308
+ postFile: (path, data) => FetchApi.postFile(`${API_URL}${path}`, data),
1199
1309
  put: (path, data) => FetchApi.put(`${API_URL}${path}`, data),
1310
+ putFile: (path, data) => FetchApi.putFile(`${API_URL}${path}`, data),
1200
1311
  patch: (path, data) => FetchApi.patch(`${API_URL}${path}`, data),
1201
1312
  delete: (path) => FetchApi.delete(`${API_URL}${path}`)
1202
1313
  };
1203
1314
  var coreApiClient = {
1204
1315
  get: (path) => FetchApi.get(`${API_URL}/core${path}`),
1205
1316
  post: (path, data) => FetchApi.post(`${API_URL}/core${path}`, data),
1317
+ postFile: (path, data) => FetchApi.postFile(`${API_URL}/core${path}`, data),
1206
1318
  put: (path, data) => FetchApi.put(`${API_URL}/core${path}`, data),
1319
+ putFile: (path, data) => FetchApi.putFile(`${API_URL}/core${path}`, data),
1207
1320
  patch: (path, data) => FetchApi.patch(`${API_URL}/core${path}`, data),
1208
1321
  delete: (path) => FetchApi.delete(`${API_URL}/core${path}`)
1209
1322
  };
@@ -1430,7 +1543,7 @@ var UserServices = {
1430
1543
  // Obtenir toutes les notifications de l'utilisateur
1431
1544
  getUsersNotifications: () => FetchApi.get(`${USERS_API_URL}notifications/`),
1432
1545
  // Marquer une notification comme lue
1433
- markNotificationAsRead: (notificationId) => FetchApi.post(`${USERS_API_URL}notifications/${notificationId}/mark-read/`, {}),
1546
+ markNotificationAsRead: (notificationId) => FetchApi.post(`${API_URL}/core/notifications/${notificationId}/mark-read/`, {}),
1434
1547
  // Obtenir un utilisateur par ID
1435
1548
  getUser: (id, token) => FetchApi.get(`${USERS_API_URL}${id}/`, token),
1436
1549
  // Mettre à jour un utilisateur
@@ -2984,11 +3097,11 @@ var RewiseLayout = ({ children, module_name = "Rewise", module_description = "",
2984
3097
  {
2985
3098
  className: "relative p-2 hover:bg-[var(--color-surface-hover)] rounded-lg transition-colors",
2986
3099
  onClick: () => setShowNotifications(!showNotifications),
2987
- "aria-label": `Notifications ${notifications.filter((n) => !n.read).length > 0 ? `(${notifications.filter((n) => !n.read).length} non lues)` : ""}`,
3100
+ 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)` : ""}`,
2988
3101
  "aria-expanded": showNotifications,
2989
3102
  children: [
2990
3103
  /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(import_lucide_react3.Bell, { className: "w-5 h-5 text-[var(--color-text-secondary)]" }),
2991
- notifications.filter((n) => !n.read).length > 0 && /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("span", { className: "absolute top-1 right-1 w-2 h-2 bg-[var(--color-error)] rounded-full" })
3104
+ notifications.filter((n) => !n.is_read && !["approved"].includes(n?.object_detail?.answer)).length > 0 && /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("span", { className: "absolute top-1 right-1 w-2 h-2 bg-[var(--color-error)] rounded-full" })
2992
3105
  ]
2993
3106
  }
2994
3107
  ),
@@ -3000,31 +3113,29 @@ var RewiseLayout = ({ children, module_name = "Rewise", module_description = "",
3000
3113
  "aria-label": "Centre de notifications",
3001
3114
  children: [
3002
3115
  /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("div", { className: "p-4 border-b border-[var(--color-border)]", children: /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("h3", { className: "font-semibold text-[var(--color-text-primary)]", children: "Notifications" }) }),
3003
- /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("div", { className: "divide-y divide-[var(--color-border)]", children: notifications.map((notif) => /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
3004
- "div",
3005
- {
3006
- className: cn(
3007
- "p-4 hover:bg-[var(--color-surface-hover)] cursor-pointer",
3008
- !notif.read && "bg-[var(--color-primary-light)] bg-opacity-10"
3009
- ),
3010
- onClick: () => markNotificationAsRead(notif.id),
3011
- children: /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)("div", { className: "flex items-start gap-3", children: [
3012
- /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("div", { className: cn(
3013
- "w-2 h-2 rounded-full mt-2",
3014
- notif.type === "error" && "bg-[var(--color-error)]",
3015
- notif.type === "warning" && "bg-[var(--color-warning)]",
3016
- notif.type === "success" && "bg-[var(--color-success)]",
3017
- notif.type === "info" && "bg-[var(--color-info)]"
3018
- ) }),
3019
- /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)("div", { className: "flex-1", children: [
3020
- /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("p", { className: "text-sm font-medium text-[var(--color-text-primary)]", children: notif.title }),
3021
- /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("p", { className: "text-xs text-[var(--color-text-secondary)] mt-1", children: notif.message }),
3022
- /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("p", { className: "text-xs text-[var(--color-text-tertiary)] mt-2" })
3023
- ] })
3024
- ] })
3025
- },
3026
- notif.id
3027
- )) })
3116
+ /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("div", { className: "divide-y divide-[var(--color-border)]", children: notifications.map(
3117
+ (notif) => {
3118
+ const is_read = notif.is_read || ["approved"].includes(notif?.object_detail?.answer);
3119
+ return /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
3120
+ "div",
3121
+ {
3122
+ className: cn(
3123
+ "p-4 hover:bg-[var(--color-surface-hover)] cursor-pointer"
3124
+ ),
3125
+ onClick: () => markNotificationAsRead(notif.id),
3126
+ children: /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)("div", { className: "flex items-start gap-3", children: [
3127
+ /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("div", { className: "mt-2", children: !is_read ? /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(import_lucide_react3.Mail, { size: 15, className: "text-[var(--color-primary)]" }) : /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(import_lucide_react3.MailOpen, { size: 15, className: "text-gray-500" }) }),
3128
+ /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)("div", { className: "flex-1", children: [
3129
+ /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("p", { className: `text-sm ${!is_read ? "text-black font-bold" : " font-normal text-[var(--color-text-primary)]"}`, children: /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("div", { className: "flex items-center gap-2", children: notif.title }) }),
3130
+ /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("p", { className: "text-xs text-[var(--color-text-secondary)] mt-1", children: notif.message }),
3131
+ /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("p", { className: "text-xs text-[var(--color-text-tertiary)] mt-2", children: formatDateTime(notif?.created_at) ?? "-" })
3132
+ ] })
3133
+ ] })
3134
+ },
3135
+ notif.id
3136
+ );
3137
+ }
3138
+ ) })
3028
3139
  ]
3029
3140
  }
3030
3141
  )
@@ -7209,7 +7320,7 @@ var formatFileSize = (bytes) => {
7209
7320
  const i = Math.floor(Math.log(bytes) / Math.log(k));
7210
7321
  return `${parseFloat((bytes / Math.pow(k, i)).toFixed(1))} ${units[i]}`;
7211
7322
  };
7212
- var formatDate = (date) => {
7323
+ var formatDate2 = (date) => {
7213
7324
  if (!date) {
7214
7325
  return "-";
7215
7326
  }
@@ -7223,7 +7334,7 @@ var formatDate = (date) => {
7223
7334
  year: "numeric"
7224
7335
  });
7225
7336
  };
7226
- var formatDateTime = (date) => {
7337
+ var formatDateTime2 = (date) => {
7227
7338
  if (!date) {
7228
7339
  return "-";
7229
7340
  }
@@ -7379,7 +7490,7 @@ var FileCard = ({ item, variant = "grid" }) => {
7379
7490
  }
7380
7491
  ) : /* @__PURE__ */ (0, import_jsx_runtime20.jsx)("span", { className: "block truncate text-sm text-gray-900 dark:text-gray-100", children: item.name }) }),
7381
7492
  /* @__PURE__ */ (0, import_jsx_runtime20.jsx)("span", { className: "text-xs text-gray-500 dark:text-gray-400 w-20 text-right", children: !isFolder && formatFileSize(item.size) }),
7382
- /* @__PURE__ */ (0, import_jsx_runtime20.jsx)("span", { className: "text-xs text-gray-500 dark:text-gray-400 w-24 text-right", children: formatDate(item.updatedAt || item.createdAt) })
7493
+ /* @__PURE__ */ (0, import_jsx_runtime20.jsx)("span", { className: "text-xs text-gray-500 dark:text-gray-400 w-24 text-right", children: formatDate2(item.updatedAt || item.createdAt) })
7383
7494
  ]
7384
7495
  }
7385
7496
  );
@@ -10835,7 +10946,7 @@ var ApprovalWorkflow = ({
10835
10946
  email: v.user_detail?.email || "",
10836
10947
  role: v.user_detail?.phonenumber || "-",
10837
10948
  status: v.answer === "approved" /* APPROVED */ ? "approved" : v.answer === "refused" /* REFUSED */ ? "rejected" : "pending",
10838
- answer: v.answer === "approved" /* APPROVED */ ? 2 : v.answer === "waiting" /* WAITING */ ? 1 : v.answer === "refused" /* REFUSED */ ? -1 : 0,
10949
+ answer: v.answer === "approved" /* APPROVED */ ? 2 : v.answer === "waiting" /* WAITING */ ? 1 : v.answer === "refused" /* REFUSED */ ? -1 : v.answer === "suggest-correction" /* SUGGEST_CORRECTION */ ? -2 : 0,
10839
10950
  rank: v.rank,
10840
10951
  note: v.note
10841
10952
  })));
@@ -10850,7 +10961,7 @@ var ApprovalWorkflow = ({
10850
10961
  email: v.user_detail?.email || "",
10851
10962
  role: v.user_detail?.phonenumber || "-",
10852
10963
  status: v.answer === "approved" /* APPROVED */ ? "approved" : v.answer === "refused" /* REFUSED */ ? "rejected" : "pending",
10853
- answer: v.answer === "approved" /* APPROVED */ ? 2 : v.answer === "waiting" /* WAITING */ ? 1 : v.answer === "refused" /* REFUSED */ ? -1 : 0,
10964
+ answer: v.answer === "approved" /* APPROVED */ ? 2 : v.answer === "waiting" /* WAITING */ ? 1 : v.answer === "refused" /* REFUSED */ ? -1 : v.answer === "suggest-correction" /* SUGGEST_CORRECTION */ ? -2 : 0,
10854
10965
  rank: v.rank,
10855
10966
  note: v.note
10856
10967
  })));
@@ -10925,14 +11036,24 @@ var ApprovalWorkflow = ({
10925
11036
  }
10926
11037
  setTransmitting(true);
10927
11038
  try {
10928
- await handleSave();
10929
- if (caseData?.id) {
10930
- const response = await ApprovalServices.start(caseData.id, token);
11039
+ if (formData.status === "suggest-correction" /* SUGGEST_CORRECTION */ && caseData?.id) {
11040
+ const response = await ApprovalServices.restart(caseData.id, token);
10931
11041
  if (response.success) {
10932
- showSuccess("Demande de validation transmise avec succ\xE8s");
11042
+ showSuccess("Nouvelle version cr\xE9\xE9e et transmise avec succ\xE8s");
10933
11043
  await loadCase();
10934
11044
  } else {
10935
- showError("Erreur lors de la transmission");
11045
+ showError("Erreur lors de la re-transmission");
11046
+ }
11047
+ } else {
11048
+ await handleSave();
11049
+ if (caseData?.id) {
11050
+ const response = await ApprovalServices.start(caseData.id, token);
11051
+ if (response.success) {
11052
+ showSuccess("Demande de validation transmise avec succ\xE8s");
11053
+ await loadCase();
11054
+ } else {
11055
+ showError("Erreur lors de la transmission");
11056
+ }
10936
11057
  }
10937
11058
  }
10938
11059
  } catch (error) {
@@ -11091,12 +11212,19 @@ var ApprovalWorkflow = ({
11091
11212
  switch (activeTab) {
11092
11213
  case "workflow":
11093
11214
  return /* @__PURE__ */ (0, import_jsx_runtime32.jsxs)("div", { className: "space-y-6", children: [
11215
+ formData.status === "suggest-correction" /* SUGGEST_CORRECTION */ && /* @__PURE__ */ (0, import_jsx_runtime32.jsxs)("div", { className: "p-4 rounded-lg border border-[var(--color-warning)] bg-[var(--color-warning-light)] flex items-start gap-3", children: [
11216
+ /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(import_lucide_react21.Edit, { className: "w-5 h-5 flex-shrink-0 mt-0.5", style: { color: "var(--color-warning)" } }),
11217
+ /* @__PURE__ */ (0, import_jsx_runtime32.jsxs)("div", { children: [
11218
+ /* @__PURE__ */ (0, import_jsx_runtime32.jsx)("p", { className: "text-sm font-medium", style: { color: "var(--color-warning)" }, children: "Une modification a \xE9t\xE9 sugg\xE9r\xE9e sur cette demande" }),
11219
+ /* @__PURE__ */ (0, import_jsx_runtime32.jsx)("p", { className: "text-xs text-gray-500 mt-1", children: "Veuillez prendre en compte les commentaires et re-transmettre la demande." })
11220
+ ] })
11221
+ ] }),
11094
11222
  renderStageSection("Verification", verification, setVerification, "verification"),
11095
11223
  renderStageSection("Validation", validation, setValidation, "validation"),
11096
11224
  !readOnly && /* @__PURE__ */ (0, import_jsx_runtime32.jsxs)("div", { className: "flex justify-between pt-4 border-t border-[#D9D9D9]", children: [
11097
11225
  /* @__PURE__ */ (0, import_jsx_runtime32.jsx)("div", { className: "flex gap-3" }),
11098
11226
  /* @__PURE__ */ (0, import_jsx_runtime32.jsxs)("div", { className: "flex gap-3", children: [
11099
- formData.status == "not-send" /* NOT_SEND */ && /* @__PURE__ */ (0, import_jsx_runtime32.jsxs)(
11227
+ (formData.status === "not-send" /* NOT_SEND */ || formData.status === "suggest-correction" /* SUGGEST_CORRECTION */) && /* @__PURE__ */ (0, import_jsx_runtime32.jsxs)(
11100
11228
  Buttons_default,
11101
11229
  {
11102
11230
  onClick: handleSave,
@@ -11108,13 +11236,13 @@ var ApprovalWorkflow = ({
11108
11236
  ]
11109
11237
  }
11110
11238
  ),
11111
- formData.status === "not-send" /* NOT_SEND */ && /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(
11239
+ (formData.status === "not-send" /* NOT_SEND */ || formData.status === "suggest-correction" /* SUGGEST_CORRECTION */) && /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(
11112
11240
  Buttons_default,
11113
11241
  {
11114
11242
  onClick: handleTransmit,
11115
11243
  disabled: transmitting || saving,
11116
11244
  type: "button",
11117
- children: transmitting ? "Transmission..." : "Transmettre"
11245
+ children: transmitting ? "Transmission..." : formData.status === "suggest-correction" /* SUGGEST_CORRECTION */ ? "Re-transmettre" : "Transmettre"
11118
11246
  }
11119
11247
  )
11120
11248
  ] })
@@ -11319,71 +11447,81 @@ var StageRow = ({
11319
11447
  return /* @__PURE__ */ (0, import_jsx_runtime32.jsx)("span", { className: "inline-flex items-center justify-center w-6 h-6 bg-gray-300 rounded-full", children: /* @__PURE__ */ (0, import_jsx_runtime32.jsx)("span", { className: "text-white text-xs", children: "\u23F1" }) });
11320
11448
  } else if (answer === -1) {
11321
11449
  return /* @__PURE__ */ (0, import_jsx_runtime32.jsx)("span", { className: "inline-flex items-center justify-center w-6 h-6 bg-[var(--color-error)] rounded-full", children: /* @__PURE__ */ (0, import_jsx_runtime32.jsx)("svg", { className: "w-4 h-4 text-white", fill: "currentColor", viewBox: "0 0 20 20", children: /* @__PURE__ */ (0, import_jsx_runtime32.jsx)("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" }) }) });
11450
+ } else if (answer === -2) {
11451
+ return /* @__PURE__ */ (0, import_jsx_runtime32.jsx)("span", { className: "inline-flex items-center justify-center w-6 h-6 bg-[var(--color-warning)] rounded-full", children: /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(import_lucide_react21.Edit, { className: "w-4 h-4 text-white" }) });
11322
11452
  }
11323
11453
  return /* @__PURE__ */ (0, import_jsx_runtime32.jsx)("span", { className: "text-gray-400 text-xs", children: "-" });
11324
11454
  };
11325
- return /* @__PURE__ */ (0, import_jsx_runtime32.jsxs)("tr", { className: "hover:bg-gray-50", children: [
11326
- /* @__PURE__ */ (0, import_jsx_runtime32.jsx)("td", { className: "border border-gray-300 px-2 py-2 text-center", children: !readOnly && /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(
11327
- "button",
11328
- {
11329
- type: "button",
11330
- onClick: onRemove,
11331
- className: "text-[#B85450] hover:text-[var(--color-error)] transition-colors",
11332
- title: "Supprimer",
11333
- children: /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(import_lucide_react21.Trash2, { className: "w-4 h-4" })
11334
- }
11335
- ) }),
11336
- /* @__PURE__ */ (0, import_jsx_runtime32.jsx)("td", { className: "border border-gray-300 px-4 py-2 text-center", children: index + 1 }),
11337
- /* @__PURE__ */ (0, import_jsx_runtime32.jsx)("td", { className: "border border-gray-300 px-2 py-2", children: /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(
11338
- SelectInput,
11339
- {
11340
- value: stage.space_answer,
11341
- onChange: (e) => handleSpaceAnswerChange(e),
11342
- disabled: readOnly,
11343
- options: [
11344
- { value: "internal", label: "Interne" },
11345
- { value: "external", label: "Externe" }
11346
- ]
11347
- }
11348
- ) }),
11349
- /* @__PURE__ */ (0, import_jsx_runtime32.jsx)("td", { className: "border border-gray-300 px-2 py-2", children: stage.space_answer === "internal" ? /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(
11350
- SearchableSelect,
11351
- {
11352
- options: userOptions,
11353
- value: stage.user,
11354
- placeholder: "S\xE9lectionner...",
11355
- searchPlaceholder: "Rechercher...",
11356
- onSelect: handleUserSelect,
11357
- disabled: readOnly || loadingUsers,
11358
- filterFunction: userFilterFunction
11359
- }
11360
- ) : /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(
11361
- TextInput,
11362
- {
11363
- value: stage.name,
11364
- onChange: (e) => onUpdate({ name: e.target.value }),
11365
- disabled: readOnly
11366
- }
11367
- ) }),
11368
- /* @__PURE__ */ (0, import_jsx_runtime32.jsx)("td", { className: "border border-gray-300 px-2 py-2", children: /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(
11369
- TextInput,
11370
- {
11371
- type: "email",
11372
- value: stage.email,
11373
- onChange: (e) => onUpdate({ email: e.target.value }),
11374
- disabled: readOnly || stage.space_answer === "internal"
11375
- }
11376
- ) }),
11377
- /* @__PURE__ */ (0, import_jsx_runtime32.jsx)("td", { className: "border border-gray-300 px-2 py-2", children: /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(
11378
- "input",
11379
- {
11380
- type: "text",
11381
- value: stage.role,
11382
- disabled: true,
11383
- className: "w-full px-2 py-1 border border-gray-300 rounded text-sm bg-gray-100"
11384
- }
11385
- ) }),
11386
- /* @__PURE__ */ (0, import_jsx_runtime32.jsx)("td", { className: "border border-gray-300 px-4 py-2 text-center", children: getStatusIcon(stage.answer) })
11455
+ return /* @__PURE__ */ (0, import_jsx_runtime32.jsxs)(import_jsx_runtime32.Fragment, { children: [
11456
+ /* @__PURE__ */ (0, import_jsx_runtime32.jsxs)("tr", { className: "hover:bg-gray-50", children: [
11457
+ /* @__PURE__ */ (0, import_jsx_runtime32.jsx)("td", { className: "border border-gray-300 px-2 py-2 text-center", children: !readOnly && /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(
11458
+ "button",
11459
+ {
11460
+ type: "button",
11461
+ onClick: onRemove,
11462
+ className: "text-[#B85450] hover:text-[var(--color-error)] transition-colors",
11463
+ title: "Supprimer",
11464
+ children: /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(import_lucide_react21.Trash2, { className: "w-4 h-4" })
11465
+ }
11466
+ ) }),
11467
+ /* @__PURE__ */ (0, import_jsx_runtime32.jsx)("td", { className: "border border-gray-300 px-4 py-2 text-center", children: index + 1 }),
11468
+ /* @__PURE__ */ (0, import_jsx_runtime32.jsx)("td", { className: "border border-gray-300 px-2 py-2", children: /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(
11469
+ SelectInput,
11470
+ {
11471
+ value: stage.space_answer,
11472
+ onChange: (e) => handleSpaceAnswerChange(e),
11473
+ disabled: readOnly,
11474
+ options: [
11475
+ { value: "internal", label: "Interne" },
11476
+ { value: "external", label: "Externe" }
11477
+ ]
11478
+ }
11479
+ ) }),
11480
+ /* @__PURE__ */ (0, import_jsx_runtime32.jsx)("td", { className: "border border-gray-300 px-2 py-2", children: stage.space_answer === "internal" ? /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(
11481
+ SearchableSelect,
11482
+ {
11483
+ options: userOptions,
11484
+ value: stage.user,
11485
+ placeholder: "S\xE9lectionner...",
11486
+ searchPlaceholder: "Rechercher...",
11487
+ onSelect: handleUserSelect,
11488
+ disabled: readOnly || loadingUsers,
11489
+ filterFunction: userFilterFunction
11490
+ }
11491
+ ) : /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(
11492
+ TextInput,
11493
+ {
11494
+ value: stage.name,
11495
+ onChange: (e) => onUpdate({ name: e.target.value }),
11496
+ disabled: readOnly
11497
+ }
11498
+ ) }),
11499
+ /* @__PURE__ */ (0, import_jsx_runtime32.jsx)("td", { className: "border border-gray-300 px-2 py-2", children: /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(
11500
+ TextInput,
11501
+ {
11502
+ type: "email",
11503
+ value: stage.email,
11504
+ onChange: (e) => onUpdate({ email: e.target.value }),
11505
+ disabled: readOnly || stage.space_answer === "internal"
11506
+ }
11507
+ ) }),
11508
+ /* @__PURE__ */ (0, import_jsx_runtime32.jsx)("td", { className: "border border-gray-300 px-2 py-2", children: /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(
11509
+ "input",
11510
+ {
11511
+ type: "text",
11512
+ value: stage.role,
11513
+ disabled: true,
11514
+ className: "w-full px-2 py-1 border border-gray-300 rounded text-sm bg-gray-100"
11515
+ }
11516
+ ) }),
11517
+ /* @__PURE__ */ (0, import_jsx_runtime32.jsx)("td", { className: "border border-gray-300 px-4 py-2 text-center", children: getStatusIcon(stage.answer) })
11518
+ ] }),
11519
+ stage.note && /* @__PURE__ */ (0, import_jsx_runtime32.jsx)("tr", { children: /* @__PURE__ */ (0, import_jsx_runtime32.jsx)("td", { colSpan: 7, className: "border border-gray-300 px-4 py-2 bg-[var(--color-warning-light)]", children: /* @__PURE__ */ (0, import_jsx_runtime32.jsxs)("p", { className: "text-xs text-gray-600 italic flex items-center gap-1", children: [
11520
+ /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(import_lucide_react21.MessageSquare, { className: "w-3 h-3" }),
11521
+ ' Note : "',
11522
+ stage.note,
11523
+ '"'
11524
+ ] }) }) })
11387
11525
  ] });
11388
11526
  };
11389
11527
  var AddStageButton = ({
@@ -11934,7 +12072,7 @@ var getRole = (a, center_id) => {
11934
12072
  console.log(a.user_detail, center_id);
11935
12073
  return a.user_detail?.centers_access?.find((c) => c.id === center_id)?.fonction ?? "";
11936
12074
  };
11937
- var formatDate2 = (date) => date ? formatDateFR(date) : "-";
12075
+ var formatDate3 = (date) => date ? formatDateFR(date) : "-";
11938
12076
  var borderStyle = { borderColor: "var(--color-border)" };
11939
12077
  var cellClass = "border px-2 py-1";
11940
12078
  var headerStyle = { ...borderStyle, color: "var(--color-text-secondary)" };
@@ -11969,7 +12107,7 @@ var ApprovalRecap = ({ process, object_id }) => {
11969
12107
  return /* @__PURE__ */ (0, import_jsx_runtime34.jsxs)("tr", { children: [
11970
12108
  /* @__PURE__ */ (0, import_jsx_runtime34.jsx)("td", { className: `${cellClass} uppercase`, style: { ...borderStyle, color: "var(--color-text)" }, children: getName(item) }),
11971
12109
  /* @__PURE__ */ (0, import_jsx_runtime34.jsx)("td", { className: `${cellClass} uppercase`, style: { ...borderStyle, color: "var(--color-text)" }, children: getRole(item, activeBusinessEntity?.id ?? null) }),
11972
- /* @__PURE__ */ (0, import_jsx_runtime34.jsx)("td", { className: cellClass, style: borderStyle, children: formatDate2(item.answered_at) }),
12110
+ /* @__PURE__ */ (0, import_jsx_runtime34.jsx)("td", { className: cellClass, style: borderStyle, children: formatDate3(item.answered_at) }),
11973
12111
  /* @__PURE__ */ (0, import_jsx_runtime34.jsx)("td", { className: cellClass, style: borderStyle, children: /* @__PURE__ */ (0, import_jsx_runtime34.jsx)("span", { className: "inline-flex items-center gap-1", style: { color: s.color }, children: s.icon }) }),
11974
12112
  /* @__PURE__ */ (0, import_jsx_runtime34.jsx)("td", { className: cellClass, style: borderStyle })
11975
12113
  ] }, i);
@@ -11990,7 +12128,7 @@ var ApprovalRecap = ({ process, object_id }) => {
11990
12128
  /* @__PURE__ */ (0, import_jsx_runtime34.jsx)("td", { className: cellClass, style: borderStyle, children: "Demand\xE9 par" }),
11991
12129
  /* @__PURE__ */ (0, import_jsx_runtime34.jsx)("td", { className: `${cellClass} uppercase`, style: { ...borderStyle, color: "var(--color-text)" }, children: `${requester.first_name} ${requester.last_name}`.trim() }),
11992
12130
  /* @__PURE__ */ (0, import_jsx_runtime34.jsx)("td", { className: `${cellClass} uppercase`, style: { ...borderStyle, color: "var(--color-text)" }, children: requester?.centers_access?.find((c) => c.id === activeBusinessEntity?.id)?.fonction ?? "" }),
11993
- /* @__PURE__ */ (0, import_jsx_runtime34.jsx)("td", { className: cellClass, style: borderStyle, children: formatDate2(caseData.created_at) }),
12131
+ /* @__PURE__ */ (0, import_jsx_runtime34.jsx)("td", { className: cellClass, style: borderStyle, children: formatDate3(caseData.created_at) }),
11994
12132
  /* @__PURE__ */ (0, import_jsx_runtime34.jsx)("td", { className: cellClass, style: borderStyle, children: /* @__PURE__ */ (0, import_jsx_runtime34.jsx)("span", { className: "inline-flex items-center gap-1", style: { color: "var(--color-primary)" }, children: /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(import_lucide_react23.CheckCircle, { className: "w-3.5 h-3.5" }) }) }),
11995
12133
  /* @__PURE__ */ (0, import_jsx_runtime34.jsx)("td", { className: cellClass, style: borderStyle })
11996
12134
  ] }),
@@ -12712,7 +12850,7 @@ var DetailField = ({ label, value }) => value ? /* @__PURE__ */ (0, import_jsx_r
12712
12850
  /* @__PURE__ */ (0, import_jsx_runtime39.jsx)("p", { className: "text-xs text-[var(--color-text-tertiary)]", children: label }),
12713
12851
  /* @__PURE__ */ (0, import_jsx_runtime39.jsx)("p", { className: "text-sm font-medium text-[var(--color-text-primary)]", children: typeof value === "string" || typeof value === "number" ? value : value })
12714
12852
  ] }) : null;
12715
- var formatDate3 = (d) => d ? new Date(d).toLocaleString("fr-FR", { day: "2-digit", month: "long", year: "numeric", hour: "2-digit", minute: "2-digit" }) : "-";
12853
+ var formatDate4 = (d) => d ? new Date(d).toLocaleString("fr-FR", { day: "2-digit", month: "long", year: "numeric", hour: "2-digit", minute: "2-digit" }) : "-";
12716
12854
  var ActivityDetailModal = ({ activity }) => {
12717
12855
  const d = activity.detail;
12718
12856
  if (!d) return /* @__PURE__ */ (0, import_jsx_runtime39.jsx)("p", { className: "text-sm text-[var(--color-text-secondary)]", children: "Aucun d\xE9tail disponible." });
@@ -12735,7 +12873,7 @@ var ActivityDetailModal = ({ activity }) => {
12735
12873
  /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(DetailField, { label: "Adresse de livraison", value: d.delivery_address }),
12736
12874
  /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(DetailField, { label: "Contact livraison", value: d.delivery_contact }),
12737
12875
  /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(DetailField, { label: "T\xE9l. livraison", value: d.delivery_phone }),
12738
- /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(DetailField, { label: "Cr\xE9\xE9 le", value: formatDate3(d.created_at) }),
12876
+ /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(DetailField, { label: "Cr\xE9\xE9 le", value: formatDate4(d.created_at) }),
12739
12877
  /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(DetailField, { label: "Commentaires", value: d.comments })
12740
12878
  ] }),
12741
12879
  d.items?.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime39.jsxs)("div", { children: [
@@ -12790,7 +12928,7 @@ var ActivityDetailModal = ({ activity }) => {
12790
12928
  /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(DetailField, { label: "Prix final", value: d.final_price ? `${d.final_price.toLocaleString("fr-FR")} FCFA` : void 0 }),
12791
12929
  /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(DetailField, { label: "Remise", value: d.global_discount ? `${d.global_discount}${d.global_discount_type === "percentage" ? "%" : " FCFA"}` : void 0 }),
12792
12930
  /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(DetailField, { label: "Observations", value: d.observations }),
12793
- /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(DetailField, { label: "Cr\xE9\xE9 le", value: formatDate3(d.created_at) })
12931
+ /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(DetailField, { label: "Cr\xE9\xE9 le", value: formatDate4(d.created_at) })
12794
12932
  ] }),
12795
12933
  d.items?.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime39.jsxs)("div", { children: [
12796
12934
  /* @__PURE__ */ (0, import_jsx_runtime39.jsxs)("h4", { className: "text-sm font-semibold text-[var(--color-text-primary)] mb-2", children: [
@@ -12837,9 +12975,9 @@ var ActivityDetailModal = ({ activity }) => {
12837
12975
  /* @__PURE__ */ (0, import_jsx_runtime39.jsxs)("div", { className: "grid grid-cols-2 md:grid-cols-3 gap-4 bg-[var(--color-surface-hover)] rounded-lg p-4", children: [
12838
12976
  /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(DetailField, { label: "Type de r\xE9ception", value: d.type_of_receipt }),
12839
12977
  /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(DetailField, { label: "Adresse de r\xE9ception", value: d.receipt_address }),
12840
- /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(DetailField, { label: "Date de r\xE9ception", value: formatDate3(d.received_at) }),
12978
+ /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(DetailField, { label: "Date de r\xE9ception", value: formatDate4(d.received_at) }),
12841
12979
  /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(DetailField, { label: "Commentaires", value: d.comments }),
12842
- /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(DetailField, { label: "Cr\xE9\xE9 le", value: formatDate3(d.created_at) })
12980
+ /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(DetailField, { label: "Cr\xE9\xE9 le", value: formatDate4(d.created_at) })
12843
12981
  ] }),
12844
12982
  d.items?.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime39.jsxs)("div", { children: [
12845
12983
  /* @__PURE__ */ (0, import_jsx_runtime39.jsxs)("h4", { className: "text-sm font-semibold text-[var(--color-text-primary)] mb-2", children: [
@@ -27571,7 +27709,7 @@ var ViewContractContent = ({
27571
27709
  };
27572
27710
  }, [contract]);
27573
27711
  if (!contract) return null;
27574
- const formatDate4 = (dateString) => {
27712
+ const formatDate5 = (dateString) => {
27575
27713
  if (!dateString) return "Non d\xE9fini";
27576
27714
  return new Date(dateString).toLocaleDateString("fr-FR");
27577
27715
  };
@@ -27850,19 +27988,19 @@ var ViewContractContent = ({
27850
27988
  /* @__PURE__ */ (0, import_jsx_runtime133.jsxs)("dl", { className: "space-y-3", children: [
27851
27989
  /* @__PURE__ */ (0, import_jsx_runtime133.jsxs)("div", { className: "flex justify-between", children: [
27852
27990
  /* @__PURE__ */ (0, import_jsx_runtime133.jsx)("dt", { className: "text-sm font-medium text-gray-500", children: "Date de cr\xE9ation" }),
27853
- /* @__PURE__ */ (0, import_jsx_runtime133.jsx)("dd", { className: "text-sm text-gray-900", children: formatDate4(contract.created_at || contract.created_at) })
27991
+ /* @__PURE__ */ (0, import_jsx_runtime133.jsx)("dd", { className: "text-sm text-gray-900", children: formatDate5(contract.created_at || contract.created_at) })
27854
27992
  ] }),
27855
27993
  /* @__PURE__ */ (0, import_jsx_runtime133.jsxs)("div", { className: "flex justify-between", children: [
27856
27994
  /* @__PURE__ */ (0, import_jsx_runtime133.jsx)("dt", { className: "text-sm font-medium text-gray-500", children: "Date de signature" }),
27857
- /* @__PURE__ */ (0, import_jsx_runtime133.jsx)("dd", { className: "text-sm text-gray-900", children: formatDate4(contract.signature_date || "") })
27995
+ /* @__PURE__ */ (0, import_jsx_runtime133.jsx)("dd", { className: "text-sm text-gray-900", children: formatDate5(contract.signature_date || "") })
27858
27996
  ] }),
27859
27997
  /* @__PURE__ */ (0, import_jsx_runtime133.jsxs)("div", { className: "flex justify-between", children: [
27860
27998
  /* @__PURE__ */ (0, import_jsx_runtime133.jsx)("dt", { className: "text-sm font-medium text-gray-500", children: "D\xE9but" }),
27861
- /* @__PURE__ */ (0, import_jsx_runtime133.jsx)("dd", { className: "text-sm text-gray-900", children: formatDate4(contract.start_date) })
27999
+ /* @__PURE__ */ (0, import_jsx_runtime133.jsx)("dd", { className: "text-sm text-gray-900", children: formatDate5(contract.start_date) })
27862
28000
  ] }),
27863
28001
  /* @__PURE__ */ (0, import_jsx_runtime133.jsxs)("div", { className: "flex justify-between", children: [
27864
28002
  /* @__PURE__ */ (0, import_jsx_runtime133.jsx)("dt", { className: "text-sm font-medium text-gray-500", children: "Fin" }),
27865
- /* @__PURE__ */ (0, import_jsx_runtime133.jsx)("dd", { className: "text-sm text-gray-900 font-medium", children: formatDate4(contract.end_date) })
28003
+ /* @__PURE__ */ (0, import_jsx_runtime133.jsx)("dd", { className: "text-sm text-gray-900 font-medium", children: formatDate5(contract.end_date) })
27866
28004
  ] }),
27867
28005
  /* @__PURE__ */ (0, import_jsx_runtime133.jsxs)("div", { className: "flex justify-between", children: [
27868
28006
  /* @__PURE__ */ (0, import_jsx_runtime133.jsx)("dt", { className: "text-sm font-medium text-gray-500", children: "Pr\xE9avis de r\xE9siliation" }),
@@ -27980,11 +28118,11 @@ var ViewContractContent = ({
27980
28118
  /* @__PURE__ */ (0, import_jsx_runtime133.jsxs)("div", { className: "grid grid-cols-1 md:grid-cols-3 gap-6", children: [
27981
28119
  /* @__PURE__ */ (0, import_jsx_runtime133.jsxs)("div", { className: "p-4 bg-[var(--color-success-light)] rounded-lg", children: [
27982
28120
  /* @__PURE__ */ (0, import_jsx_runtime133.jsx)("p", { className: "text-sm font-medium text-[var(--color-success)]", children: "Date de d\xE9but" }),
27983
- /* @__PURE__ */ (0, import_jsx_runtime133.jsx)("p", { className: "text-xl font-bold text-gray-900 mt-1", children: formatDate4(contract.start_date) })
28121
+ /* @__PURE__ */ (0, import_jsx_runtime133.jsx)("p", { className: "text-xl font-bold text-gray-900 mt-1", children: formatDate5(contract.start_date) })
27984
28122
  ] }),
27985
28123
  /* @__PURE__ */ (0, import_jsx_runtime133.jsxs)("div", { className: "p-4 bg-[var(--color-error-light)] rounded-lg", children: [
27986
28124
  /* @__PURE__ */ (0, import_jsx_runtime133.jsx)("p", { className: "text-sm font-medium text-[var(--color-error)]", children: "Date de fin" }),
27987
- /* @__PURE__ */ (0, import_jsx_runtime133.jsx)("p", { className: "text-xl font-bold text-gray-900 mt-1", children: formatDate4(contract.end_date) })
28125
+ /* @__PURE__ */ (0, import_jsx_runtime133.jsx)("p", { className: "text-xl font-bold text-gray-900 mt-1", children: formatDate5(contract.end_date) })
27988
28126
  ] }),
27989
28127
  /* @__PURE__ */ (0, import_jsx_runtime133.jsxs)("div", { className: "p-4 bg-[var(--color-info-light)] rounded-lg", children: [
27990
28128
  /* @__PURE__ */ (0, import_jsx_runtime133.jsx)("p", { className: "text-sm font-medium text-[var(--color-info)]", children: "Jours restants" }),
@@ -28017,7 +28155,7 @@ var ViewContractContent = ({
28017
28155
  ] }),
28018
28156
  contract.renewal_date && /* @__PURE__ */ (0, import_jsx_runtime133.jsxs)("div", { className: "flex justify-between", children: [
28019
28157
  /* @__PURE__ */ (0, import_jsx_runtime133.jsx)("dt", { className: "text-sm font-medium text-gray-500", children: "Date de renouvellement" }),
28020
- /* @__PURE__ */ (0, import_jsx_runtime133.jsx)("dd", { className: "text-sm text-gray-900", children: formatDate4(contract.renewal_date) })
28158
+ /* @__PURE__ */ (0, import_jsx_runtime133.jsx)("dd", { className: "text-sm text-gray-900", children: formatDate5(contract.renewal_date) })
28021
28159
  ] }),
28022
28160
  contract.duration && /* @__PURE__ */ (0, import_jsx_runtime133.jsxs)("div", { className: "flex justify-between", children: [
28023
28161
  /* @__PURE__ */ (0, import_jsx_runtime133.jsx)("dt", { className: "text-sm font-medium text-gray-500", children: "Dur\xE9e" }),
@@ -28158,7 +28296,7 @@ var ViewContractContent = ({
28158
28296
  milestone.percentage,
28159
28297
  "%"
28160
28298
  ] }),
28161
- /* @__PURE__ */ (0, import_jsx_runtime133.jsx)("td", { className: "py-3 text-center", children: formatDate4(milestone.dueDate) }),
28299
+ /* @__PURE__ */ (0, import_jsx_runtime133.jsx)("td", { className: "py-3 text-center", children: formatDate5(milestone.dueDate) }),
28162
28300
  /* @__PURE__ */ (0, import_jsx_runtime133.jsx)("td", { className: "py-3 text-center", children: /* @__PURE__ */ (0, import_jsx_runtime133.jsx)(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" }) })
28163
28301
  ] }, milestone.id)) })
28164
28302
  ] }) })
@@ -28427,11 +28565,11 @@ var ViewContractContent = ({
28427
28565
  ] }),
28428
28566
  /* @__PURE__ */ (0, import_jsx_runtime133.jsxs)("div", { children: [
28429
28567
  /* @__PURE__ */ (0, import_jsx_runtime133.jsx)("p", { className: "text-gray-500", children: "Date d'\xE9mission" }),
28430
- /* @__PURE__ */ (0, import_jsx_runtime133.jsx)("p", { className: "font-medium", children: formatDate4(guarantee.issueDate) })
28568
+ /* @__PURE__ */ (0, import_jsx_runtime133.jsx)("p", { className: "font-medium", children: formatDate5(guarantee.issueDate) })
28431
28569
  ] }),
28432
28570
  /* @__PURE__ */ (0, import_jsx_runtime133.jsxs)("div", { children: [
28433
28571
  /* @__PURE__ */ (0, import_jsx_runtime133.jsx)("p", { className: "text-gray-500", children: "Date d'expiration" }),
28434
- /* @__PURE__ */ (0, import_jsx_runtime133.jsx)("p", { className: `font-medium ${new Date(guarantee.expiryDate) < /* @__PURE__ */ new Date() ? "text-[var(--color-error)]" : ""}`, children: formatDate4(guarantee.expiryDate) })
28572
+ /* @__PURE__ */ (0, import_jsx_runtime133.jsx)("p", { className: `font-medium ${new Date(guarantee.expiryDate) < /* @__PURE__ */ new Date() ? "text-[var(--color-error)]" : ""}`, children: formatDate5(guarantee.expiryDate) })
28435
28573
  ] })
28436
28574
  ] }),
28437
28575
  guarantee.releaseConditions && /* @__PURE__ */ (0, import_jsx_runtime133.jsxs)("div", { className: "mt-3 p-3 bg-gray-50 rounded-lg", children: [
@@ -28471,7 +28609,7 @@ var ViewContractContent = ({
28471
28609
  ] }),
28472
28610
  insurance.validUntil && /* @__PURE__ */ (0, import_jsx_runtime133.jsxs)("div", { children: [
28473
28611
  /* @__PURE__ */ (0, import_jsx_runtime133.jsx)("p", { className: "text-gray-500", children: "Valide jusqu'au" }),
28474
- /* @__PURE__ */ (0, import_jsx_runtime133.jsx)("p", { className: `font-medium ${new Date(insurance.validUntil) < /* @__PURE__ */ new Date() ? "text-[var(--color-error)]" : ""}`, children: formatDate4(insurance.validUntil) })
28612
+ /* @__PURE__ */ (0, import_jsx_runtime133.jsx)("p", { className: `font-medium ${new Date(insurance.validUntil) < /* @__PURE__ */ new Date() ? "text-[var(--color-error)]" : ""}`, children: formatDate5(insurance.validUntil) })
28475
28613
  ] })
28476
28614
  ] })
28477
28615
  ] }, insurance.id)) }) : /* @__PURE__ */ (0, import_jsx_runtime133.jsxs)("div", { className: "text-center py-8 text-gray-500", children: [
@@ -28542,7 +28680,7 @@ var ViewContractContent = ({
28542
28680
  ] }),
28543
28681
  /* @__PURE__ */ (0, import_jsx_runtime133.jsxs)("div", { className: "text-right", children: [
28544
28682
  /* @__PURE__ */ (0, import_jsx_runtime133.jsx)(Badge2, { variant: approver.status === "approved" ? "success" : approver.status === "rejected" ? "error" : "default", children: approver.status === "approved" ? "Approuv\xE9" : approver.status === "rejected" ? "Rejet\xE9" : "En attente" }),
28545
- approver.approvalDate && /* @__PURE__ */ (0, import_jsx_runtime133.jsx)("p", { className: "text-xs text-gray-500 mt-1", children: formatDate4(approver.approvalDate) })
28683
+ approver.approvalDate && /* @__PURE__ */ (0, import_jsx_runtime133.jsx)("p", { className: "text-xs text-gray-500 mt-1", children: formatDate5(approver.approvalDate) })
28546
28684
  ] })
28547
28685
  ] }, index)) })
28548
28686
  ] }),
@@ -28596,11 +28734,11 @@ var ViewContractContent = ({
28596
28734
  ] }),
28597
28735
  contract.governance.steeringCommittee.lastMeetingDate && /* @__PURE__ */ (0, import_jsx_runtime133.jsxs)("div", { className: "flex justify-between", children: [
28598
28736
  /* @__PURE__ */ (0, import_jsx_runtime133.jsx)("dt", { className: "text-gray-500", children: "Derni\xE8re r\xE9union" }),
28599
- /* @__PURE__ */ (0, import_jsx_runtime133.jsx)("dd", { className: "text-gray-900", children: formatDate4(contract.governance.steeringCommittee.lastMeetingDate) })
28737
+ /* @__PURE__ */ (0, import_jsx_runtime133.jsx)("dd", { className: "text-gray-900", children: formatDate5(contract.governance.steeringCommittee.lastMeetingDate) })
28600
28738
  ] }),
28601
28739
  contract.governance.steeringCommittee.nextMeetingDate && /* @__PURE__ */ (0, import_jsx_runtime133.jsxs)("div", { className: "flex justify-between", children: [
28602
28740
  /* @__PURE__ */ (0, import_jsx_runtime133.jsx)("dt", { className: "text-gray-500", children: "Prochaine r\xE9union" }),
28603
- /* @__PURE__ */ (0, import_jsx_runtime133.jsx)("dd", { className: "text-gray-900 font-medium", children: formatDate4(contract.governance.steeringCommittee.nextMeetingDate) })
28741
+ /* @__PURE__ */ (0, import_jsx_runtime133.jsx)("dd", { className: "text-gray-900 font-medium", children: formatDate5(contract.governance.steeringCommittee.nextMeetingDate) })
28604
28742
  ] })
28605
28743
  ] })
28606
28744
  ] })
@@ -28673,7 +28811,7 @@ var ViewContractContent = ({
28673
28811
  ] }),
28674
28812
  contract.regulatoryCompliance.sanctionsScreening?.lastScreeningDate && /* @__PURE__ */ (0, import_jsx_runtime133.jsxs)("p", { className: "text-sm text-gray-500", children: [
28675
28813
  "Dernier contr\xF4le: ",
28676
- formatDate4(contract.regulatoryCompliance.sanctionsScreening.lastScreeningDate)
28814
+ formatDate5(contract.regulatoryCompliance.sanctionsScreening.lastScreeningDate)
28677
28815
  ] })
28678
28816
  ] })
28679
28817
  ] })
@@ -28729,7 +28867,7 @@ var ViewContractContent = ({
28729
28867
  ] }),
28730
28868
  /* @__PURE__ */ (0, import_jsx_runtime133.jsxs)("p", { className: "text-xs text-[var(--color-success)] mt-1", children: [
28731
28869
  "\xC9valu\xE9 le ",
28732
- formatDate4(contract.esgCriteria.lastAssessmentDate)
28870
+ formatDate5(contract.esgCriteria.lastAssessmentDate)
28733
28871
  ] })
28734
28872
  ] }),
28735
28873
  /* @__PURE__ */ (0, import_jsx_runtime133.jsx)(RewiseCard, { className: "p-4", children: /* @__PURE__ */ (0, import_jsx_runtime133.jsxs)("div", { className: "flex items-center space-x-3", children: [
@@ -28900,7 +29038,7 @@ var ViewContractContent = ({
28900
29038
  /* @__PURE__ */ (0, import_jsx_runtime133.jsx)("span", { children: "\u2022" }),
28901
29039
  /* @__PURE__ */ (0, import_jsx_runtime133.jsxs)("span", { children: [
28902
29040
  "\xC9ch\xE9ance: ",
28903
- formatDate4(obligation.dueDate)
29041
+ formatDate5(obligation.dueDate)
28904
29042
  ] })
28905
29043
  ] }),
28906
29044
  /* @__PURE__ */ (0, import_jsx_runtime133.jsx)("span", { children: "\u2022" }),
@@ -28966,7 +29104,7 @@ var ViewContractContent = ({
28966
29104
  ] }),
28967
29105
  sla.last_evaluation && /* @__PURE__ */ (0, import_jsx_runtime133.jsxs)("span", { children: [
28968
29106
  "Derni\xE8re mesure: ",
28969
- formatDate4(sla.last_evaluation)
29107
+ formatDate5(sla.last_evaluation)
28970
29108
  ] })
28971
29109
  ] })
28972
29110
  ] }, sla.id)) }) : /* @__PURE__ */ (0, import_jsx_runtime133.jsxs)(RewiseCard, { className: "p-8 text-center", children: [
@@ -29177,7 +29315,7 @@ var ViewContractContent = ({
29177
29315
  " MB \u2022 Version ",
29178
29316
  doc.version,
29179
29317
  " \u2022 Ajout\xE9 le ",
29180
- formatDate4(doc.uploadedAt)
29318
+ formatDate5(doc.uploadedAt)
29181
29319
  ] }),
29182
29320
  doc.description && /* @__PURE__ */ (0, import_jsx_runtime133.jsx)("p", { className: "text-sm text-gray-600 mt-1", children: doc.description })
29183
29321
  ] })
@@ -29208,7 +29346,7 @@ var ViewContractContent = ({
29208
29346
  ] }),
29209
29347
  /* @__PURE__ */ (0, import_jsx_runtime133.jsx)("p", { className: "text-sm text-gray-600 mb-2", children: amendment.description }),
29210
29348
  /* @__PURE__ */ (0, import_jsx_runtime133.jsxs)("p", { className: "text-xs text-gray-500", children: [
29211
- formatDate4(amendment.date),
29349
+ formatDate5(amendment.date),
29212
29350
  " \u2022 Raison: ",
29213
29351
  amendment.reason
29214
29352
  ] })
@@ -29306,7 +29444,7 @@ var ViewContractContent = ({
29306
29444
  "Ce contrat expire dans ",
29307
29445
  daysUntilExpiry,
29308
29446
  " jours (",
29309
- formatDate4(contract.end_date),
29447
+ formatDate5(contract.end_date),
29310
29448
  ")"
29311
29449
  ] })
29312
29450
  ] }),
@@ -33587,7 +33725,7 @@ var SLAManagementModal = ({
33587
33725
  onShowToast("Indicateur SLA supprim\xE9", "success");
33588
33726
  }
33589
33727
  };
33590
- const formatDate4 = (dateString) => {
33728
+ const formatDate5 = (dateString) => {
33591
33729
  if (!dateString) return "N/A";
33592
33730
  return new Date(dateString).toLocaleDateString("fr-FR");
33593
33731
  };
@@ -34101,7 +34239,7 @@ var SLAManagementModal = ({
34101
34239
  ] }),
34102
34240
  /* @__PURE__ */ (0, import_jsx_runtime139.jsxs)("p", { className: "text-xs mt-1", style: { color: colors.text.tertiary }, children: [
34103
34241
  "D\xE9tect\xE9 le ",
34104
- formatDate4(incident.detected_date)
34242
+ formatDate5(incident.detected_date)
34105
34243
  ] })
34106
34244
  ] })
34107
34245
  ] }),