@consilioweb/payload-support 0.6.2 → 0.6.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (65) hide show
  1. package/dist/components/TicketConversation/components/AISummaryPanel.cjs +77 -0
  2. package/dist/components/TicketConversation/components/AISummaryPanel.js +76 -0
  3. package/dist/components/TicketConversation/components/ActionPanels.cjs +121 -0
  4. package/dist/components/TicketConversation/components/ActionPanels.js +118 -0
  5. package/dist/components/TicketConversation/components/ActivityLog.cjs +24 -0
  6. package/dist/components/TicketConversation/components/ActivityLog.js +23 -0
  7. package/dist/components/TicketConversation/components/ClientBar.cjs +43 -0
  8. package/dist/components/TicketConversation/components/ClientBar.js +42 -0
  9. package/dist/components/TicketConversation/components/ClientHistory.cjs +138 -0
  10. package/dist/components/TicketConversation/components/ClientHistory.js +137 -0
  11. package/dist/components/TicketConversation/components/CodeBlock.cjs +154 -0
  12. package/dist/components/TicketConversation/components/CodeBlock.js +152 -0
  13. package/dist/components/TicketConversation/components/CodeBlockInserter.cjs +156 -0
  14. package/dist/components/TicketConversation/components/CodeBlockInserter.js +155 -0
  15. package/dist/components/TicketConversation/components/QuickActions.cjs +66 -0
  16. package/dist/components/TicketConversation/components/QuickActions.js +65 -0
  17. package/dist/components/TicketConversation/components/TicketHeader.cjs +93 -0
  18. package/dist/components/TicketConversation/components/TicketHeader.js +92 -0
  19. package/dist/components/TicketConversation/components/TimeTrackingPanel.cjs +134 -0
  20. package/dist/components/TicketConversation/components/TimeTrackingPanel.js +133 -0
  21. package/dist/components/TicketConversation/config.cjs +44 -0
  22. package/dist/components/TicketConversation/config.js +41 -0
  23. package/dist/components/TicketConversation/constants.cjs +100 -0
  24. package/dist/components/TicketConversation/constants.js +96 -0
  25. package/dist/components/TicketConversation/context.cjs +13 -0
  26. package/dist/components/TicketConversation/context.js +11 -0
  27. package/dist/components/TicketConversation/hooks/useAI.cjs +177 -0
  28. package/dist/components/TicketConversation/hooks/useAI.js +176 -0
  29. package/dist/components/TicketConversation/hooks/useMessageActions.cjs +136 -0
  30. package/dist/components/TicketConversation/hooks/useMessageActions.js +135 -0
  31. package/dist/components/TicketConversation/hooks/useReply.cjs +188 -0
  32. package/dist/components/TicketConversation/hooks/useReply.js +187 -0
  33. package/dist/components/TicketConversation/hooks/useTicketActions.cjs +231 -0
  34. package/dist/components/TicketConversation/hooks/useTicketActions.js +230 -0
  35. package/dist/components/TicketConversation/hooks/useTimeTracking.cjs +123 -0
  36. package/dist/components/TicketConversation/hooks/useTimeTracking.js +122 -0
  37. package/dist/components/TicketConversation/hooks/useTranslation.cjs +78 -0
  38. package/dist/components/TicketConversation/hooks/useTranslation.js +70 -0
  39. package/dist/components/TicketConversation/index.cjs +1128 -0
  40. package/dist/components/TicketConversation/index.js +1123 -0
  41. package/dist/components/TicketConversation/locales/en.json +878 -0
  42. package/dist/components/TicketConversation/locales/fr.json +878 -0
  43. package/dist/components/TicketConversation/types.cjs +2 -0
  44. package/dist/components/TicketConversation/types.js +2 -0
  45. package/dist/components/TicketConversation/utils.cjs +27 -0
  46. package/dist/components/TicketConversation/utils.js +25 -0
  47. package/dist/styles/BillingView.module.scss +311 -0
  48. package/dist/styles/ChatView.module.scss +438 -0
  49. package/dist/styles/CommandPalette.module.scss +160 -0
  50. package/dist/styles/CrmView.module.scss +554 -0
  51. package/dist/styles/EmailTracking.module.scss +238 -0
  52. package/dist/styles/ImportConversation.module.scss +267 -0
  53. package/dist/styles/Layout.module.scss +55 -0
  54. package/dist/styles/Logs.module.scss +164 -0
  55. package/dist/styles/NewTicket.module.scss +143 -0
  56. package/dist/styles/PendingEmails.module.scss +629 -0
  57. package/dist/styles/SupportDashboard.module.scss +649 -0
  58. package/dist/styles/TicketDetail.module.scss +1050 -0
  59. package/dist/styles/TicketInbox.module.scss +296 -0
  60. package/dist/styles/TicketingSettings.module.scss +358 -0
  61. package/dist/styles/TimeDashboard.module.scss +287 -0
  62. package/dist/styles/_tokens.scss +78 -0
  63. package/dist/{components/TicketConversation.css → styles/theme.css} +326 -13
  64. package/package.json +2 -2
  65. package/dist/components/TicketConversation.js +0 -3004
@@ -0,0 +1,77 @@
1
+ 'use strict';
2
+
3
+ var jsxRuntime = require('react/jsx-runtime');
4
+ var constants = require('../constants');
5
+
6
+ function AISummaryPanel({
7
+ showAiSummary,
8
+ setShowAiSummary,
9
+ aiSummary,
10
+ aiGenerating,
11
+ aiSaving,
12
+ aiSaved,
13
+ handleAiGenerate,
14
+ handleAiSave
15
+ }) {
16
+ return /* @__PURE__ */ jsxRuntime.jsxs("div", { style: { marginBottom: "14px" }, children: [
17
+ /* @__PURE__ */ jsxRuntime.jsx(
18
+ "button",
19
+ {
20
+ onClick: () => {
21
+ setShowAiSummary(!showAiSummary);
22
+ if (!showAiSummary && !aiSummary) handleAiGenerate();
23
+ },
24
+ style: {
25
+ ...constants.s.ghostBtn("#7c3aed", false),
26
+ fontSize: "12px",
27
+ display: "inline-flex",
28
+ alignItems: "center",
29
+ gap: "6px"
30
+ },
31
+ children: showAiSummary ? "Masquer la synth\xE8se IA" : "Synth\xE8se IA"
32
+ }
33
+ ),
34
+ showAiSummary && /* @__PURE__ */ jsxRuntime.jsxs("div", { style: {
35
+ marginTop: "10px",
36
+ padding: "14px 18px",
37
+ borderRadius: "8px",
38
+ backgroundColor: "#faf5ff",
39
+ border: "1px solid #e9d5ff"
40
+ }, children: [
41
+ /* @__PURE__ */ jsxRuntime.jsxs("div", { style: { display: "flex", justifyContent: "space-between", alignItems: "center", marginBottom: "10px" }, children: [
42
+ /* @__PURE__ */ jsxRuntime.jsx("h4", { style: { fontSize: "13px", fontWeight: 600, color: "#7c3aed", margin: 0 }, children: "Synth\xE8se IA" }),
43
+ /* @__PURE__ */ jsxRuntime.jsxs("div", { style: { display: "flex", gap: "6px" }, children: [
44
+ /* @__PURE__ */ jsxRuntime.jsx(
45
+ "button",
46
+ {
47
+ onClick: handleAiGenerate,
48
+ disabled: aiGenerating,
49
+ style: { ...constants.s.outlineBtn("#7c3aed", aiGenerating), fontSize: "11px", padding: "4px 10px" },
50
+ children: aiGenerating ? "G\xE9n\xE9ration..." : "R\xE9g\xE9n\xE9rer"
51
+ }
52
+ ),
53
+ aiSummary && !aiGenerating && /* @__PURE__ */ jsxRuntime.jsx(
54
+ "button",
55
+ {
56
+ onClick: handleAiSave,
57
+ disabled: aiSaving || aiSaved,
58
+ style: { ...constants.s.btn(aiSaved ? "#16a34a" : "#2563eb", aiSaving), fontSize: "11px", padding: "4px 10px" },
59
+ children: aiSaved ? "Sauvegard\xE9" : aiSaving ? "Sauvegarde..." : "Sauvegarder (note interne)"
60
+ }
61
+ )
62
+ ] })
63
+ ] }),
64
+ aiGenerating ? /* @__PURE__ */ jsxRuntime.jsx("div", { style: { display: "flex", alignItems: "center", gap: "10px", color: "#7c3aed", fontSize: "13px" }, children: "Analyse de la conversation en cours..." }) : aiSummary ? /* @__PURE__ */ jsxRuntime.jsx(
65
+ "div",
66
+ {
67
+ style: { fontSize: "13px", lineHeight: "1.7", color: "#1e1b4b", whiteSpace: "pre-wrap" },
68
+ dangerouslySetInnerHTML: {
69
+ __html: aiSummary.replace(/\*\*(.*?)\*\*/g, "<strong>$1</strong>").replace(/\n/g, "<br/>")
70
+ }
71
+ }
72
+ ) : /* @__PURE__ */ jsxRuntime.jsx("p", { style: { color: "#999", fontStyle: "italic", fontSize: "13px", margin: 0 }, children: `Cliquez sur "R\xE9g\xE9n\xE9rer" pour lancer l'analyse` })
73
+ ] })
74
+ ] });
75
+ }
76
+
77
+ exports.AISummaryPanel = AISummaryPanel;
@@ -0,0 +1,76 @@
1
+ "use client";
2
+ import { jsxs, jsx } from 'react/jsx-runtime';
3
+ import { s } from '../constants';
4
+
5
+ function AISummaryPanel({
6
+ showAiSummary,
7
+ setShowAiSummary,
8
+ aiSummary,
9
+ aiGenerating,
10
+ aiSaving,
11
+ aiSaved,
12
+ handleAiGenerate,
13
+ handleAiSave
14
+ }) {
15
+ return /* @__PURE__ */ jsxs("div", { style: { marginBottom: "14px" }, children: [
16
+ /* @__PURE__ */ jsx(
17
+ "button",
18
+ {
19
+ onClick: () => {
20
+ setShowAiSummary(!showAiSummary);
21
+ if (!showAiSummary && !aiSummary) handleAiGenerate();
22
+ },
23
+ style: {
24
+ ...s.ghostBtn("#7c3aed", false),
25
+ fontSize: "12px",
26
+ display: "inline-flex",
27
+ alignItems: "center",
28
+ gap: "6px"
29
+ },
30
+ children: showAiSummary ? "Masquer la synth\xE8se IA" : "Synth\xE8se IA"
31
+ }
32
+ ),
33
+ showAiSummary && /* @__PURE__ */ jsxs("div", { style: {
34
+ marginTop: "10px",
35
+ padding: "14px 18px",
36
+ borderRadius: "8px",
37
+ backgroundColor: "#faf5ff",
38
+ border: "1px solid #e9d5ff"
39
+ }, children: [
40
+ /* @__PURE__ */ jsxs("div", { style: { display: "flex", justifyContent: "space-between", alignItems: "center", marginBottom: "10px" }, children: [
41
+ /* @__PURE__ */ jsx("h4", { style: { fontSize: "13px", fontWeight: 600, color: "#7c3aed", margin: 0 }, children: "Synth\xE8se IA" }),
42
+ /* @__PURE__ */ jsxs("div", { style: { display: "flex", gap: "6px" }, children: [
43
+ /* @__PURE__ */ jsx(
44
+ "button",
45
+ {
46
+ onClick: handleAiGenerate,
47
+ disabled: aiGenerating,
48
+ style: { ...s.outlineBtn("#7c3aed", aiGenerating), fontSize: "11px", padding: "4px 10px" },
49
+ children: aiGenerating ? "G\xE9n\xE9ration..." : "R\xE9g\xE9n\xE9rer"
50
+ }
51
+ ),
52
+ aiSummary && !aiGenerating && /* @__PURE__ */ jsx(
53
+ "button",
54
+ {
55
+ onClick: handleAiSave,
56
+ disabled: aiSaving || aiSaved,
57
+ style: { ...s.btn(aiSaved ? "#16a34a" : "#2563eb", aiSaving), fontSize: "11px", padding: "4px 10px" },
58
+ children: aiSaved ? "Sauvegard\xE9" : aiSaving ? "Sauvegarde..." : "Sauvegarder (note interne)"
59
+ }
60
+ )
61
+ ] })
62
+ ] }),
63
+ aiGenerating ? /* @__PURE__ */ jsx("div", { style: { display: "flex", alignItems: "center", gap: "10px", color: "#7c3aed", fontSize: "13px" }, children: "Analyse de la conversation en cours..." }) : aiSummary ? /* @__PURE__ */ jsx(
64
+ "div",
65
+ {
66
+ style: { fontSize: "13px", lineHeight: "1.7", color: "#1e1b4b", whiteSpace: "pre-wrap" },
67
+ dangerouslySetInnerHTML: {
68
+ __html: aiSummary.replace(/\*\*(.*?)\*\*/g, "<strong>$1</strong>").replace(/\n/g, "<br/>")
69
+ }
70
+ }
71
+ ) : /* @__PURE__ */ jsx("p", { style: { color: "#999", fontStyle: "italic", fontSize: "13px", margin: 0 }, children: `Cliquez sur "R\xE9g\xE9n\xE9rer" pour lancer l'analyse` })
72
+ ] })
73
+ ] });
74
+ }
75
+
76
+ export { AISummaryPanel };
@@ -0,0 +1,121 @@
1
+ 'use strict';
2
+
3
+ var jsxRuntime = require('react/jsx-runtime');
4
+ var react = require('react');
5
+ var constants = require('../constants');
6
+
7
+ function MergePanel({
8
+ mergeTarget,
9
+ setMergeTarget,
10
+ mergeTargetInfo,
11
+ setMergeTargetInfo,
12
+ mergeError,
13
+ setMergeError,
14
+ merging,
15
+ handleMergeLookup,
16
+ handleMerge
17
+ }) {
18
+ return /* @__PURE__ */ jsxRuntime.jsxs("div", { style: { padding: "14px 18px", borderRadius: "8px", backgroundColor: "#fdf2f8", border: "1px solid #fbcfe8", marginBottom: "14px" }, children: [
19
+ /* @__PURE__ */ jsxRuntime.jsx("h4", { style: { fontSize: "13px", fontWeight: 600, marginBottom: "10px", color: "#831843" }, children: "Fusionner ce ticket dans un autre" }),
20
+ /* @__PURE__ */ jsxRuntime.jsxs("div", { style: { display: "flex", gap: "8px", alignItems: "center", marginBottom: "8px" }, children: [
21
+ /* @__PURE__ */ jsxRuntime.jsx(
22
+ "input",
23
+ {
24
+ type: "text",
25
+ value: mergeTarget,
26
+ onChange: (e) => {
27
+ setMergeTarget(e.target.value);
28
+ setMergeTargetInfo(null);
29
+ setMergeError("");
30
+ },
31
+ placeholder: "TK-0001",
32
+ style: { ...constants.s.input, width: "130px" }
33
+ }
34
+ ),
35
+ /* @__PURE__ */ jsxRuntime.jsx("button", { onClick: handleMergeLookup, style: { ...constants.s.outlineBtn("#ec4899"), fontSize: "12px", padding: "6px 14px" }, children: "Rechercher" }),
36
+ mergeError && /* @__PURE__ */ jsxRuntime.jsx("span", { style: { fontSize: "12px", color: "#be185d", fontWeight: 600 }, children: mergeError })
37
+ ] }),
38
+ mergeTargetInfo && /* @__PURE__ */ jsxRuntime.jsxs("div", { style: { display: "flex", gap: "8px", alignItems: "center" }, children: [
39
+ /* @__PURE__ */ jsxRuntime.jsxs("span", { style: { fontSize: "13px", fontWeight: 600 }, children: [
40
+ mergeTargetInfo.ticketNumber,
41
+ " \u2014 ",
42
+ mergeTargetInfo.subject
43
+ ] }),
44
+ /* @__PURE__ */ jsxRuntime.jsx("button", { onClick: handleMerge, disabled: merging, style: { ...constants.s.btn("#ec4899", merging), color: "#fff", fontSize: "12px", padding: "6px 14px" }, children: merging ? "Fusion..." : "Confirmer la fusion" })
45
+ ] })
46
+ ] });
47
+ }
48
+ function ExtMessagePanel({
49
+ extMsgBody,
50
+ setExtMsgBody,
51
+ extMsgAuthor,
52
+ setExtMsgAuthor,
53
+ extMsgDate,
54
+ setExtMsgDate,
55
+ extMsgFiles,
56
+ setExtMsgFiles,
57
+ sendingExtMsg,
58
+ handleSendExtMsg,
59
+ handleExtFileChange
60
+ }) {
61
+ const extFileInputRef = react.useRef(null);
62
+ return /* @__PURE__ */ jsxRuntime.jsxs("div", { style: { padding: "14px 18px", borderRadius: "8px", backgroundColor: "#eef2ff", border: "1px solid #c7d2fe", marginBottom: "14px" }, children: [
63
+ /* @__PURE__ */ jsxRuntime.jsx("h4", { style: { fontSize: "13px", fontWeight: 600, marginBottom: "10px", color: "#312e81" }, children: "Ajouter un message re\xE7u (email, SMS, WhatsApp...)" }),
64
+ /* @__PURE__ */ jsxRuntime.jsx(
65
+ "textarea",
66
+ {
67
+ value: extMsgBody,
68
+ onChange: (e) => setExtMsgBody(e.target.value),
69
+ placeholder: "Coller le contenu du message re\xE7u...",
70
+ rows: 3,
71
+ style: { ...constants.s.input, width: "100%", resize: "vertical", marginBottom: "10px" }
72
+ }
73
+ ),
74
+ /* @__PURE__ */ jsxRuntime.jsxs("div", { style: { display: "flex", gap: "8px", alignItems: "center", flexWrap: "wrap", marginBottom: "10px" }, children: [
75
+ /* @__PURE__ */ jsxRuntime.jsxs("select", { value: extMsgAuthor, onChange: (e) => setExtMsgAuthor(e.target.value), style: { ...constants.s.input, fontSize: "12px" }, children: [
76
+ /* @__PURE__ */ jsxRuntime.jsx("option", { value: "client", children: "Envoy\xE9 par le client" }),
77
+ /* @__PURE__ */ jsxRuntime.jsx("option", { value: "admin", children: "Envoy\xE9 par le support" })
78
+ ] }),
79
+ /* @__PURE__ */ jsxRuntime.jsx(
80
+ "input",
81
+ {
82
+ type: "datetime-local",
83
+ value: extMsgDate,
84
+ onChange: (e) => setExtMsgDate(e.target.value),
85
+ style: { ...constants.s.input, fontSize: "12px" }
86
+ }
87
+ ),
88
+ /* @__PURE__ */ jsxRuntime.jsx("input", { ref: extFileInputRef, type: "file", multiple: true, onChange: handleExtFileChange, style: { display: "none" }, accept: "image/*,.pdf,.doc,.docx,.txt,.zip" }),
89
+ /* @__PURE__ */ jsxRuntime.jsx("button", { type: "button", onClick: () => extFileInputRef.current?.click(), style: { ...constants.s.ghostBtn("#6b7280"), fontSize: "12px", padding: "6px 12px" }, children: "+ PJ" })
90
+ ] }),
91
+ extMsgFiles.length > 0 && /* @__PURE__ */ jsxRuntime.jsx("div", { style: { marginBottom: "10px", display: "flex", gap: "6px", flexWrap: "wrap" }, children: extMsgFiles.map((file, i) => /* @__PURE__ */ jsxRuntime.jsxs("span", { style: { ...constants.s.badge("#f1f5f9", "#374151"), display: "inline-flex", alignItems: "center", gap: "4px" }, children: [
92
+ file.name,
93
+ /* @__PURE__ */ jsxRuntime.jsx("button", { type: "button", onClick: () => setExtMsgFiles((prev) => prev.filter((_, idx) => idx !== i)), style: { border: "none", background: "none", color: "#ef4444", fontWeight: 700, cursor: "pointer", fontSize: "14px", lineHeight: 1 }, children: "\xD7" })
94
+ ] }, i)) }),
95
+ /* @__PURE__ */ jsxRuntime.jsx("button", { onClick: handleSendExtMsg, disabled: sendingExtMsg || !extMsgBody.trim(), style: constants.s.btn("#818cf8", sendingExtMsg || !extMsgBody.trim()), children: sendingExtMsg ? "Ajout..." : "Ajouter (sans notification)" })
96
+ ] });
97
+ }
98
+ function SnoozePanel({ snoozeSaving, handleSnooze }) {
99
+ return /* @__PURE__ */ jsxRuntime.jsxs("div", { style: { padding: "14px 18px", borderRadius: "8px", backgroundColor: "#faf5ff", border: "1px solid #e9d5ff", marginBottom: "14px" }, children: [
100
+ /* @__PURE__ */ jsxRuntime.jsx("h4", { style: { fontSize: "13px", fontWeight: 600, marginBottom: "10px", color: "#5b21b6" }, children: "Snooze \u2014 masquer temporairement" }),
101
+ /* @__PURE__ */ jsxRuntime.jsxs("div", { style: { display: "flex", gap: "8px", flexWrap: "wrap", alignItems: "center" }, children: [
102
+ /* @__PURE__ */ jsxRuntime.jsx("button", { onClick: () => handleSnooze(1), disabled: snoozeSaving, style: { ...constants.s.outlineBtn("#8b5cf6", snoozeSaving), fontSize: "12px" }, children: "1 jour" }),
103
+ /* @__PURE__ */ jsxRuntime.jsx("button", { onClick: () => handleSnooze(3), disabled: snoozeSaving, style: { ...constants.s.outlineBtn("#8b5cf6", snoozeSaving), fontSize: "12px" }, children: "3 jours" }),
104
+ /* @__PURE__ */ jsxRuntime.jsx("button", { onClick: () => handleSnooze(7), disabled: snoozeSaving, style: { ...constants.s.outlineBtn("#8b5cf6", snoozeSaving), fontSize: "12px" }, children: "1 semaine" }),
105
+ /* @__PURE__ */ jsxRuntime.jsx(
106
+ "input",
107
+ {
108
+ type: "datetime-local",
109
+ onChange: (e) => {
110
+ if (e.target.value) handleSnooze(null, e.target.value);
111
+ },
112
+ style: { ...constants.s.input, fontSize: "12px" }
113
+ }
114
+ )
115
+ ] })
116
+ ] });
117
+ }
118
+
119
+ exports.ExtMessagePanel = ExtMessagePanel;
120
+ exports.MergePanel = MergePanel;
121
+ exports.SnoozePanel = SnoozePanel;
@@ -0,0 +1,118 @@
1
+ "use client";
2
+ import { jsxs, jsx } from 'react/jsx-runtime';
3
+ import { useRef } from 'react';
4
+ import { s } from '../constants';
5
+
6
+ function MergePanel({
7
+ mergeTarget,
8
+ setMergeTarget,
9
+ mergeTargetInfo,
10
+ setMergeTargetInfo,
11
+ mergeError,
12
+ setMergeError,
13
+ merging,
14
+ handleMergeLookup,
15
+ handleMerge
16
+ }) {
17
+ return /* @__PURE__ */ jsxs("div", { style: { padding: "14px 18px", borderRadius: "8px", backgroundColor: "#fdf2f8", border: "1px solid #fbcfe8", marginBottom: "14px" }, children: [
18
+ /* @__PURE__ */ jsx("h4", { style: { fontSize: "13px", fontWeight: 600, marginBottom: "10px", color: "#831843" }, children: "Fusionner ce ticket dans un autre" }),
19
+ /* @__PURE__ */ jsxs("div", { style: { display: "flex", gap: "8px", alignItems: "center", marginBottom: "8px" }, children: [
20
+ /* @__PURE__ */ jsx(
21
+ "input",
22
+ {
23
+ type: "text",
24
+ value: mergeTarget,
25
+ onChange: (e) => {
26
+ setMergeTarget(e.target.value);
27
+ setMergeTargetInfo(null);
28
+ setMergeError("");
29
+ },
30
+ placeholder: "TK-0001",
31
+ style: { ...s.input, width: "130px" }
32
+ }
33
+ ),
34
+ /* @__PURE__ */ jsx("button", { onClick: handleMergeLookup, style: { ...s.outlineBtn("#ec4899"), fontSize: "12px", padding: "6px 14px" }, children: "Rechercher" }),
35
+ mergeError && /* @__PURE__ */ jsx("span", { style: { fontSize: "12px", color: "#be185d", fontWeight: 600 }, children: mergeError })
36
+ ] }),
37
+ mergeTargetInfo && /* @__PURE__ */ jsxs("div", { style: { display: "flex", gap: "8px", alignItems: "center" }, children: [
38
+ /* @__PURE__ */ jsxs("span", { style: { fontSize: "13px", fontWeight: 600 }, children: [
39
+ mergeTargetInfo.ticketNumber,
40
+ " \u2014 ",
41
+ mergeTargetInfo.subject
42
+ ] }),
43
+ /* @__PURE__ */ jsx("button", { onClick: handleMerge, disabled: merging, style: { ...s.btn("#ec4899", merging), color: "#fff", fontSize: "12px", padding: "6px 14px" }, children: merging ? "Fusion..." : "Confirmer la fusion" })
44
+ ] })
45
+ ] });
46
+ }
47
+ function ExtMessagePanel({
48
+ extMsgBody,
49
+ setExtMsgBody,
50
+ extMsgAuthor,
51
+ setExtMsgAuthor,
52
+ extMsgDate,
53
+ setExtMsgDate,
54
+ extMsgFiles,
55
+ setExtMsgFiles,
56
+ sendingExtMsg,
57
+ handleSendExtMsg,
58
+ handleExtFileChange
59
+ }) {
60
+ const extFileInputRef = useRef(null);
61
+ return /* @__PURE__ */ jsxs("div", { style: { padding: "14px 18px", borderRadius: "8px", backgroundColor: "#eef2ff", border: "1px solid #c7d2fe", marginBottom: "14px" }, children: [
62
+ /* @__PURE__ */ jsx("h4", { style: { fontSize: "13px", fontWeight: 600, marginBottom: "10px", color: "#312e81" }, children: "Ajouter un message re\xE7u (email, SMS, WhatsApp...)" }),
63
+ /* @__PURE__ */ jsx(
64
+ "textarea",
65
+ {
66
+ value: extMsgBody,
67
+ onChange: (e) => setExtMsgBody(e.target.value),
68
+ placeholder: "Coller le contenu du message re\xE7u...",
69
+ rows: 3,
70
+ style: { ...s.input, width: "100%", resize: "vertical", marginBottom: "10px" }
71
+ }
72
+ ),
73
+ /* @__PURE__ */ jsxs("div", { style: { display: "flex", gap: "8px", alignItems: "center", flexWrap: "wrap", marginBottom: "10px" }, children: [
74
+ /* @__PURE__ */ jsxs("select", { value: extMsgAuthor, onChange: (e) => setExtMsgAuthor(e.target.value), style: { ...s.input, fontSize: "12px" }, children: [
75
+ /* @__PURE__ */ jsx("option", { value: "client", children: "Envoy\xE9 par le client" }),
76
+ /* @__PURE__ */ jsx("option", { value: "admin", children: "Envoy\xE9 par le support" })
77
+ ] }),
78
+ /* @__PURE__ */ jsx(
79
+ "input",
80
+ {
81
+ type: "datetime-local",
82
+ value: extMsgDate,
83
+ onChange: (e) => setExtMsgDate(e.target.value),
84
+ style: { ...s.input, fontSize: "12px" }
85
+ }
86
+ ),
87
+ /* @__PURE__ */ jsx("input", { ref: extFileInputRef, type: "file", multiple: true, onChange: handleExtFileChange, style: { display: "none" }, accept: "image/*,.pdf,.doc,.docx,.txt,.zip" }),
88
+ /* @__PURE__ */ jsx("button", { type: "button", onClick: () => extFileInputRef.current?.click(), style: { ...s.ghostBtn("#6b7280"), fontSize: "12px", padding: "6px 12px" }, children: "+ PJ" })
89
+ ] }),
90
+ extMsgFiles.length > 0 && /* @__PURE__ */ jsx("div", { style: { marginBottom: "10px", display: "flex", gap: "6px", flexWrap: "wrap" }, children: extMsgFiles.map((file, i) => /* @__PURE__ */ jsxs("span", { style: { ...s.badge("#f1f5f9", "#374151"), display: "inline-flex", alignItems: "center", gap: "4px" }, children: [
91
+ file.name,
92
+ /* @__PURE__ */ jsx("button", { type: "button", onClick: () => setExtMsgFiles((prev) => prev.filter((_, idx) => idx !== i)), style: { border: "none", background: "none", color: "#ef4444", fontWeight: 700, cursor: "pointer", fontSize: "14px", lineHeight: 1 }, children: "\xD7" })
93
+ ] }, i)) }),
94
+ /* @__PURE__ */ jsx("button", { onClick: handleSendExtMsg, disabled: sendingExtMsg || !extMsgBody.trim(), style: s.btn("#818cf8", sendingExtMsg || !extMsgBody.trim()), children: sendingExtMsg ? "Ajout..." : "Ajouter (sans notification)" })
95
+ ] });
96
+ }
97
+ function SnoozePanel({ snoozeSaving, handleSnooze }) {
98
+ return /* @__PURE__ */ jsxs("div", { style: { padding: "14px 18px", borderRadius: "8px", backgroundColor: "#faf5ff", border: "1px solid #e9d5ff", marginBottom: "14px" }, children: [
99
+ /* @__PURE__ */ jsx("h4", { style: { fontSize: "13px", fontWeight: 600, marginBottom: "10px", color: "#5b21b6" }, children: "Snooze \u2014 masquer temporairement" }),
100
+ /* @__PURE__ */ jsxs("div", { style: { display: "flex", gap: "8px", flexWrap: "wrap", alignItems: "center" }, children: [
101
+ /* @__PURE__ */ jsx("button", { onClick: () => handleSnooze(1), disabled: snoozeSaving, style: { ...s.outlineBtn("#8b5cf6", snoozeSaving), fontSize: "12px" }, children: "1 jour" }),
102
+ /* @__PURE__ */ jsx("button", { onClick: () => handleSnooze(3), disabled: snoozeSaving, style: { ...s.outlineBtn("#8b5cf6", snoozeSaving), fontSize: "12px" }, children: "3 jours" }),
103
+ /* @__PURE__ */ jsx("button", { onClick: () => handleSnooze(7), disabled: snoozeSaving, style: { ...s.outlineBtn("#8b5cf6", snoozeSaving), fontSize: "12px" }, children: "1 semaine" }),
104
+ /* @__PURE__ */ jsx(
105
+ "input",
106
+ {
107
+ type: "datetime-local",
108
+ onChange: (e) => {
109
+ if (e.target.value) handleSnooze(null, e.target.value);
110
+ },
111
+ style: { ...s.input, fontSize: "12px" }
112
+ }
113
+ )
114
+ ] })
115
+ ] });
116
+ }
117
+
118
+ export { ExtMessagePanel, MergePanel, SnoozePanel };
@@ -0,0 +1,24 @@
1
+ 'use strict';
2
+
3
+ var jsxRuntime = require('react/jsx-runtime');
4
+ var react = require('react');
5
+ var constants = require('../constants');
6
+
7
+ function ActivityLog({ activityLog }) {
8
+ const [showActivity, setShowActivity] = react.useState(false);
9
+ return /* @__PURE__ */ jsxRuntime.jsxs("div", { style: constants.s.section, children: [
10
+ /* @__PURE__ */ jsxRuntime.jsxs("h4", { style: { ...constants.s.sectionTitle, cursor: "pointer" }, onClick: () => setShowActivity(!showActivity), children: [
11
+ "Historique ",
12
+ /* @__PURE__ */ jsxRuntime.jsx("span", { style: constants.s.badge("#f1f5f9", "#475569"), children: activityLog.length }),
13
+ /* @__PURE__ */ jsxRuntime.jsx("span", { style: { fontSize: "12px", color: constants.C.textMuted, transition: "transform 0.2s", display: "inline-block", transform: showActivity ? "rotate(90deg)" : "none" }, children: "\u25B6" })
14
+ ] }),
15
+ showActivity && (activityLog.length === 0 ? /* @__PURE__ */ jsxRuntime.jsx("p", { style: { fontSize: "12px", color: constants.C.textMuted, fontStyle: "italic" }, children: "Aucune activit\xE9 enregistr\xE9e." }) : /* @__PURE__ */ jsxRuntime.jsx("div", { style: { fontSize: "12px", display: "flex", flexDirection: "column", gap: "2px", borderLeft: "2px solid #bfdbfe", paddingLeft: "14px", marginLeft: "4px" }, children: activityLog.map((entry) => /* @__PURE__ */ jsxRuntime.jsxs("div", { style: { display: "flex", gap: "10px", alignItems: "center", padding: "5px 0", borderBottom: "1px solid #f8fafc" }, children: [
16
+ /* @__PURE__ */ jsxRuntime.jsx("span", { style: { color: constants.C.textMuted, fontSize: "11px", whiteSpace: "nowrap", fontWeight: 500 }, children: new Date(entry.createdAt).toLocaleString("fr-FR", { day: "numeric", month: "short", hour: "2-digit", minute: "2-digit" }) }),
17
+ /* @__PURE__ */ jsxRuntime.jsx("span", { style: constants.s.badge(entry.actorType === "admin" ? "#eff6ff" : "#dcfce7", entry.actorType === "admin" ? "#1e40af" : "#166534"), children: entry.actorType || "system" }),
18
+ /* @__PURE__ */ jsxRuntime.jsx("span", { style: { color: "#374151", fontWeight: 500 }, children: (entry.detail || entry.action).replace(/\[object Object\]/g, "(utilisateur)") }),
19
+ /* @__PURE__ */ jsxRuntime.jsx("span", { style: { color: constants.C.textMuted, fontSize: "11px" }, children: entry.actorEmail })
20
+ ] }, entry.id)) }))
21
+ ] });
22
+ }
23
+
24
+ exports.ActivityLog = ActivityLog;
@@ -0,0 +1,23 @@
1
+ "use client";
2
+ import { jsxs, jsx } from 'react/jsx-runtime';
3
+ import { useState } from 'react';
4
+ import { s, C } from '../constants';
5
+
6
+ function ActivityLog({ activityLog }) {
7
+ const [showActivity, setShowActivity] = useState(false);
8
+ return /* @__PURE__ */ jsxs("div", { style: s.section, children: [
9
+ /* @__PURE__ */ jsxs("h4", { style: { ...s.sectionTitle, cursor: "pointer" }, onClick: () => setShowActivity(!showActivity), children: [
10
+ "Historique ",
11
+ /* @__PURE__ */ jsx("span", { style: s.badge("#f1f5f9", "#475569"), children: activityLog.length }),
12
+ /* @__PURE__ */ jsx("span", { style: { fontSize: "12px", color: C.textMuted, transition: "transform 0.2s", display: "inline-block", transform: showActivity ? "rotate(90deg)" : "none" }, children: "\u25B6" })
13
+ ] }),
14
+ showActivity && (activityLog.length === 0 ? /* @__PURE__ */ jsx("p", { style: { fontSize: "12px", color: C.textMuted, fontStyle: "italic" }, children: "Aucune activit\xE9 enregistr\xE9e." }) : /* @__PURE__ */ jsx("div", { style: { fontSize: "12px", display: "flex", flexDirection: "column", gap: "2px", borderLeft: "2px solid #bfdbfe", paddingLeft: "14px", marginLeft: "4px" }, children: activityLog.map((entry) => /* @__PURE__ */ jsxs("div", { style: { display: "flex", gap: "10px", alignItems: "center", padding: "5px 0", borderBottom: "1px solid #f8fafc" }, children: [
15
+ /* @__PURE__ */ jsx("span", { style: { color: C.textMuted, fontSize: "11px", whiteSpace: "nowrap", fontWeight: 500 }, children: new Date(entry.createdAt).toLocaleString("fr-FR", { day: "numeric", month: "short", hour: "2-digit", minute: "2-digit" }) }),
16
+ /* @__PURE__ */ jsx("span", { style: s.badge(entry.actorType === "admin" ? "#eff6ff" : "#dcfce7", entry.actorType === "admin" ? "#1e40af" : "#166534"), children: entry.actorType || "system" }),
17
+ /* @__PURE__ */ jsx("span", { style: { color: "#374151", fontWeight: 500 }, children: (entry.detail || entry.action).replace(/\[object Object\]/g, "(utilisateur)") }),
18
+ /* @__PURE__ */ jsx("span", { style: { color: C.textMuted, fontSize: "11px" }, children: entry.actorEmail })
19
+ ] }, entry.id)) }))
20
+ ] });
21
+ }
22
+
23
+ export { ActivityLog };
@@ -0,0 +1,43 @@
1
+ 'use strict';
2
+
3
+ var jsxRuntime = require('react/jsx-runtime');
4
+ var constants = require('../constants');
5
+
6
+ function ClientBar({ client }) {
7
+ return /* @__PURE__ */ jsxRuntime.jsxs("div", { style: {
8
+ display: "flex",
9
+ alignItems: "center",
10
+ gap: "12px",
11
+ padding: "10px 16px",
12
+ borderRadius: "8px",
13
+ backgroundColor: "var(--theme-elevation-100)",
14
+ marginBottom: "16px",
15
+ flexWrap: "wrap"
16
+ }, children: [
17
+ /* @__PURE__ */ jsxRuntime.jsx("span", { style: { fontSize: "16px" }, children: "\u{1F464}" }),
18
+ /* @__PURE__ */ jsxRuntime.jsx("span", { style: { fontWeight: 700, fontSize: "13px", color: constants.C.textPrimary }, children: client.company }),
19
+ /* @__PURE__ */ jsxRuntime.jsxs("span", { style: { color: constants.C.textSecondary, fontSize: "13px" }, children: [
20
+ client.firstName,
21
+ " ",
22
+ client.lastName
23
+ ] }),
24
+ /* @__PURE__ */ jsxRuntime.jsx("span", { style: { color: constants.C.textMuted, fontSize: "12px" }, children: "|" }),
25
+ /* @__PURE__ */ jsxRuntime.jsx("a", { href: `mailto:${client.email}`, style: { color: "#2563eb", fontSize: "12px", fontWeight: 600, textDecoration: "none" }, children: client.email }),
26
+ client.phone && /* @__PURE__ */ jsxRuntime.jsx("span", { style: { color: constants.C.textSecondary, fontSize: "12px" }, children: client.phone }),
27
+ /* @__PURE__ */ jsxRuntime.jsxs("span", { style: { marginLeft: "auto", display: "inline-flex", gap: "8px", alignItems: "center" }, children: [
28
+ /* @__PURE__ */ jsxRuntime.jsx("a", { href: `/admin/collections/support-clients/${client.id}`, style: { ...constants.s.ghostBtn("#475569"), fontSize: "11px", padding: "4px 10px", textDecoration: "none" }, children: "Fiche client" }),
29
+ /* @__PURE__ */ jsxRuntime.jsx(
30
+ "button",
31
+ {
32
+ type: "button",
33
+ onClick: () => window.open(`/api/admin/impersonate?clientId=${client.id}`, "_blank"),
34
+ style: { ...constants.s.ghostBtn("#7c3aed"), fontSize: "11px", padding: "4px 10px" },
35
+ title: "Se connecter au portail support en tant que ce client",
36
+ children: "Voir en tant que client"
37
+ }
38
+ )
39
+ ] })
40
+ ] });
41
+ }
42
+
43
+ exports.ClientBar = ClientBar;
@@ -0,0 +1,42 @@
1
+ "use client";
2
+ import { jsxs, jsx } from 'react/jsx-runtime';
3
+ import { C, s } from '../constants';
4
+
5
+ function ClientBar({ client }) {
6
+ return /* @__PURE__ */ jsxs("div", { style: {
7
+ display: "flex",
8
+ alignItems: "center",
9
+ gap: "12px",
10
+ padding: "10px 16px",
11
+ borderRadius: "8px",
12
+ backgroundColor: "var(--theme-elevation-100)",
13
+ marginBottom: "16px",
14
+ flexWrap: "wrap"
15
+ }, children: [
16
+ /* @__PURE__ */ jsx("span", { style: { fontSize: "16px" }, children: "\u{1F464}" }),
17
+ /* @__PURE__ */ jsx("span", { style: { fontWeight: 700, fontSize: "13px", color: C.textPrimary }, children: client.company }),
18
+ /* @__PURE__ */ jsxs("span", { style: { color: C.textSecondary, fontSize: "13px" }, children: [
19
+ client.firstName,
20
+ " ",
21
+ client.lastName
22
+ ] }),
23
+ /* @__PURE__ */ jsx("span", { style: { color: C.textMuted, fontSize: "12px" }, children: "|" }),
24
+ /* @__PURE__ */ jsx("a", { href: `mailto:${client.email}`, style: { color: "#2563eb", fontSize: "12px", fontWeight: 600, textDecoration: "none" }, children: client.email }),
25
+ client.phone && /* @__PURE__ */ jsx("span", { style: { color: C.textSecondary, fontSize: "12px" }, children: client.phone }),
26
+ /* @__PURE__ */ jsxs("span", { style: { marginLeft: "auto", display: "inline-flex", gap: "8px", alignItems: "center" }, children: [
27
+ /* @__PURE__ */ jsx("a", { href: `/admin/collections/support-clients/${client.id}`, style: { ...s.ghostBtn("#475569"), fontSize: "11px", padding: "4px 10px", textDecoration: "none" }, children: "Fiche client" }),
28
+ /* @__PURE__ */ jsx(
29
+ "button",
30
+ {
31
+ type: "button",
32
+ onClick: () => window.open(`/api/admin/impersonate?clientId=${client.id}`, "_blank"),
33
+ style: { ...s.ghostBtn("#7c3aed"), fontSize: "11px", padding: "4px 10px" },
34
+ title: "Se connecter au portail support en tant que ce client",
35
+ children: "Voir en tant que client"
36
+ }
37
+ )
38
+ ] })
39
+ ] });
40
+ }
41
+
42
+ export { ClientBar };