@burdenoff/microfe-support 2026.510.52

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 (137) hide show
  1. package/README.md +290 -0
  2. package/dist/generated/global-operations.js +1118 -0
  3. package/dist/generated/global-operations.js.map +1 -0
  4. package/dist/generated/global-types.js +20 -0
  5. package/dist/generated/global-types.js.map +1 -0
  6. package/dist/index.js +11 -0
  7. package/dist/microfe-support.css +2 -0
  8. package/dist/node_modules/clsx/dist/clsx.js +18 -0
  9. package/dist/node_modules/clsx/dist/clsx.js.map +1 -0
  10. package/dist/node_modules/dompurify/dist/purify.es.js +555 -0
  11. package/dist/node_modules/dompurify/dist/purify.es.js.map +1 -0
  12. package/dist/node_modules/marked/lib/marked.esm.js +1430 -0
  13. package/dist/node_modules/marked/lib/marked.esm.js.map +1 -0
  14. package/dist/node_modules/tailwind-merge/dist/bundle-mjs.js +1674 -0
  15. package/dist/node_modules/tailwind-merge/dist/bundle-mjs.js.map +1 -0
  16. package/dist/support/SupportAdminRoot.js +69 -0
  17. package/dist/support/SupportAdminRoot.js.map +1 -0
  18. package/dist/support/SupportAdminRoutes.js +73 -0
  19. package/dist/support/SupportAdminRoutes.js.map +1 -0
  20. package/dist/support/SupportUserRoot.js +42 -0
  21. package/dist/support/SupportUserRoot.js.map +1 -0
  22. package/dist/support/SupportUserRoutes.js +49 -0
  23. package/dist/support/SupportUserRoutes.js.map +1 -0
  24. package/dist/support/components/NotificationToast.js +34 -0
  25. package/dist/support/components/NotificationToast.js.map +1 -0
  26. package/dist/support/components/PageLayout.js +87 -0
  27. package/dist/support/components/PageLayout.js.map +1 -0
  28. package/dist/support/components/RouteHelpers.js +22 -0
  29. package/dist/support/components/RouteHelpers.js.map +1 -0
  30. package/dist/support/components/analytics/CategoryBreakdown.js +63 -0
  31. package/dist/support/components/analytics/CategoryBreakdown.js.map +1 -0
  32. package/dist/support/components/analytics/MetricCard.js +31 -0
  33. package/dist/support/components/analytics/MetricCard.js.map +1 -0
  34. package/dist/support/components/analytics/PriorityBreakdown.js +59 -0
  35. package/dist/support/components/analytics/PriorityBreakdown.js.map +1 -0
  36. package/dist/support/components/analytics/SLAReport.js +110 -0
  37. package/dist/support/components/analytics/SLAReport.js.map +1 -0
  38. package/dist/support/components/analytics/SatisfactionDistribution.js +150 -0
  39. package/dist/support/components/analytics/SatisfactionDistribution.js.map +1 -0
  40. package/dist/support/components/analytics/TopAgents.js +70 -0
  41. package/dist/support/components/analytics/TopAgents.js.map +1 -0
  42. package/dist/support/components/analytics/TrendChart.js +48 -0
  43. package/dist/support/components/analytics/TrendChart.js.map +1 -0
  44. package/dist/support/components/kb/ArticleForm.js +244 -0
  45. package/dist/support/components/kb/ArticleForm.js.map +1 -0
  46. package/dist/support/components/kb/index.js +1 -0
  47. package/dist/support/components/settings/CannedResponsesSettings.js +84 -0
  48. package/dist/support/components/settings/CannedResponsesSettings.js.map +1 -0
  49. package/dist/support/components/settings/SLAPoliciesSettings.js +249 -0
  50. package/dist/support/components/settings/SLAPoliciesSettings.js.map +1 -0
  51. package/dist/support/components/settings/TicketCategoriesSettings.js +360 -0
  52. package/dist/support/components/settings/TicketCategoriesSettings.js.map +1 -0
  53. package/dist/support/components/tickets/AttachmentList.js +54 -0
  54. package/dist/support/components/tickets/AttachmentList.js.map +1 -0
  55. package/dist/support/components/tickets/MarkdownContent.js +11 -0
  56. package/dist/support/components/tickets/MarkdownContent.js.map +1 -0
  57. package/dist/support/components/tickets/MessageComposer.js +137 -0
  58. package/dist/support/components/tickets/MessageComposer.js.map +1 -0
  59. package/dist/support/components/tickets/MessageThread.js +88 -0
  60. package/dist/support/components/tickets/MessageThread.js.map +1 -0
  61. package/dist/support/components/tickets/TicketDetailHeader.js +123 -0
  62. package/dist/support/components/tickets/TicketDetailHeader.js.map +1 -0
  63. package/dist/support/components/tickets/TicketHeader.js +191 -0
  64. package/dist/support/components/tickets/TicketHeader.js.map +1 -0
  65. package/dist/support/components/tickets/TicketSidebar.js +271 -0
  66. package/dist/support/components/tickets/TicketSidebar.js.map +1 -0
  67. package/dist/support/components/ui.js +2 -0
  68. package/dist/support/constants.js +6 -0
  69. package/dist/support/constants.js.map +1 -0
  70. package/dist/support/hooks/index.js +5 -0
  71. package/dist/support/hooks/useAnalyticsOperations.js +61 -0
  72. package/dist/support/hooks/useAnalyticsOperations.js.map +1 -0
  73. package/dist/support/hooks/useAttachmentsFailedToast.js +22 -0
  74. package/dist/support/hooks/useAttachmentsFailedToast.js.map +1 -0
  75. package/dist/support/hooks/useChatOperations.js +146 -0
  76. package/dist/support/hooks/useChatOperations.js.map +1 -0
  77. package/dist/support/hooks/useKnowledgeBaseOperations.js +194 -0
  78. package/dist/support/hooks/useKnowledgeBaseOperations.js.map +1 -0
  79. package/dist/support/hooks/useNotification.js +26 -0
  80. package/dist/support/hooks/useNotification.js.map +1 -0
  81. package/dist/support/hooks/useRegisterFooter.js +17 -0
  82. package/dist/support/hooks/useRegisterFooter.js.map +1 -0
  83. package/dist/support/hooks/useSettingsOperations.js +145 -0
  84. package/dist/support/hooks/useSettingsOperations.js.map +1 -0
  85. package/dist/support/hooks/useSupportAttachments.js +37 -0
  86. package/dist/support/hooks/useSupportAttachments.js.map +1 -0
  87. package/dist/support/hooks/useTicketOperations.js +222 -0
  88. package/dist/support/hooks/useTicketOperations.js.map +1 -0
  89. package/dist/support/index.js +10 -0
  90. package/dist/support/pages/AnalyticsPage.js +206 -0
  91. package/dist/support/pages/AnalyticsPage.js.map +1 -0
  92. package/dist/support/pages/ArticleDetailAdminPage.js +350 -0
  93. package/dist/support/pages/ArticleDetailAdminPage.js.map +1 -0
  94. package/dist/support/pages/ArticleDetailUserPage.js +150 -0
  95. package/dist/support/pages/ArticleDetailUserPage.js.map +1 -0
  96. package/dist/support/pages/ContactInquiriesPage.js +314 -0
  97. package/dist/support/pages/ContactInquiriesPage.js.map +1 -0
  98. package/dist/support/pages/ContactInquiryDetailPage.js +481 -0
  99. package/dist/support/pages/ContactInquiryDetailPage.js.map +1 -0
  100. package/dist/support/pages/CreateArticlePage.js +120 -0
  101. package/dist/support/pages/CreateArticlePage.js.map +1 -0
  102. package/dist/support/pages/CreateTicketPage.js +281 -0
  103. package/dist/support/pages/CreateTicketPage.js.map +1 -0
  104. package/dist/support/pages/EditArticlePage.js +151 -0
  105. package/dist/support/pages/EditArticlePage.js.map +1 -0
  106. package/dist/support/pages/KnowledgeBaseAdminPage.js +208 -0
  107. package/dist/support/pages/KnowledgeBaseAdminPage.js.map +1 -0
  108. package/dist/support/pages/KnowledgeBaseUserPage.js +188 -0
  109. package/dist/support/pages/KnowledgeBaseUserPage.js.map +1 -0
  110. package/dist/support/pages/SettingsPage.js +215 -0
  111. package/dist/support/pages/SettingsPage.js.map +1 -0
  112. package/dist/support/pages/TicketDetailAdminPage.js +157 -0
  113. package/dist/support/pages/TicketDetailAdminPage.js.map +1 -0
  114. package/dist/support/pages/TicketDetailUserPage.js +292 -0
  115. package/dist/support/pages/TicketDetailUserPage.js.map +1 -0
  116. package/dist/support/pages/TicketListPage.js +337 -0
  117. package/dist/support/pages/TicketListPage.js.map +1 -0
  118. package/dist/support/providers/SupportProvider.js +40 -0
  119. package/dist/support/providers/SupportProvider.js.map +1 -0
  120. package/dist/support/store/supportStore.js +102 -0
  121. package/dist/support/store/supportStore.js.map +1 -0
  122. package/dist/support/utils/cn.js +10 -0
  123. package/dist/support/utils/cn.js.map +1 -0
  124. package/dist/support/utils/context.js +32 -0
  125. package/dist/support/utils/context.js.map +1 -0
  126. package/dist/support/utils/errors.js +13 -0
  127. package/dist/support/utils/errors.js.map +1 -0
  128. package/dist/support/utils/i18n.js +9 -0
  129. package/dist/support/utils/i18n.js.map +1 -0
  130. package/dist/support/utils/index.js +105 -0
  131. package/dist/support/utils/index.js.map +1 -0
  132. package/dist/support/utils/markdown.js +47 -0
  133. package/dist/support/utils/markdown.js.map +1 -0
  134. package/dist/support/utils/supportFiles.js +116 -0
  135. package/dist/support/utils/supportFiles.js.map +1 -0
  136. package/dist/utils/nativeBridge.js +2 -0
  137. package/package.json +145 -0
@@ -0,0 +1,49 @@
1
+ import { CatchAllRedirect as e, PageLoader as t } from "./components/RouteHelpers.js";
2
+ import { TicketListPage as n } from "./pages/TicketListPage.js";
3
+ import { Suspense as r, lazy as i } from "react";
4
+ import { Navigate as a, Route as o, Routes as s } from "react-router-dom";
5
+ import { jsx as c, jsxs as l } from "react/jsx-runtime";
6
+ //#region src/support/SupportUserRoutes.tsx
7
+ var u = i(() => import("./pages/TicketDetailUserPage.js").then((e) => ({ default: e.TicketDetailUserPage }))), d = i(() => import("./pages/CreateTicketPage.js").then((e) => ({ default: e.CreateTicketPage }))), f = i(() => import("./pages/KnowledgeBaseUserPage.js").then((e) => ({ default: e.KnowledgeBaseUserPage }))), p = i(() => import("./pages/ArticleDetailUserPage.js").then((e) => ({ default: e.ArticleDetailUserPage })));
8
+ function m() {
9
+ return /* @__PURE__ */ c(r, {
10
+ fallback: /* @__PURE__ */ c(t, {}),
11
+ children: /* @__PURE__ */ l(s, { children: [
12
+ /* @__PURE__ */ c(o, {
13
+ index: !0,
14
+ element: /* @__PURE__ */ c(a, {
15
+ to: "tickets",
16
+ replace: !0
17
+ })
18
+ }),
19
+ /* @__PURE__ */ c(o, {
20
+ path: "tickets",
21
+ element: /* @__PURE__ */ c(n, {})
22
+ }),
23
+ /* @__PURE__ */ c(o, {
24
+ path: "tickets/new",
25
+ element: /* @__PURE__ */ c(d, {})
26
+ }),
27
+ /* @__PURE__ */ c(o, {
28
+ path: "tickets/:ticketId",
29
+ element: /* @__PURE__ */ c(u, {})
30
+ }),
31
+ /* @__PURE__ */ c(o, {
32
+ path: "kb",
33
+ element: /* @__PURE__ */ c(f, {})
34
+ }),
35
+ /* @__PURE__ */ c(o, {
36
+ path: "kb/articles/:slug",
37
+ element: /* @__PURE__ */ c(p, {})
38
+ }),
39
+ /* @__PURE__ */ c(o, {
40
+ path: "*",
41
+ element: /* @__PURE__ */ c(e, {})
42
+ })
43
+ ] })
44
+ });
45
+ }
46
+ //#endregion
47
+ export { m as SupportUserRoutes };
48
+
49
+ //# sourceMappingURL=SupportUserRoutes.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"SupportUserRoutes.js","names":[],"sources":["../../src/support/SupportUserRoutes.tsx"],"sourcesContent":["import { lazy, Suspense } from 'react';\nimport { Routes, Route, Navigate } from 'react-router-dom';\nimport { PageLoader, CatchAllRedirect } from './components/RouteHelpers';\n\n// TicketListPage is eagerly imported — it's the default landing page after redirect,\n// so lazy-loading would cause a visible loading flash on every initial navigation.\nimport { TicketListPage } from './pages/TicketListPage';\n\n// Lazy loaded pages — user-specific variants for mixed pages\nconst TicketDetailUserPage = lazy(() =>\n import('./pages/TicketDetailUserPage').then((m) => ({ default: m.TicketDetailUserPage }))\n);\nconst CreateTicketPage = lazy(() =>\n import('./pages/CreateTicketPage').then((m) => ({ default: m.CreateTicketPage }))\n);\nconst KnowledgeBaseUserPage = lazy(() =>\n import('./pages/KnowledgeBaseUserPage').then((m) => ({ default: m.KnowledgeBaseUserPage }))\n);\nconst ArticleDetailUserPage = lazy(() =>\n import('./pages/ArticleDetailUserPage').then((m) => ({ default: m.ArticleDetailUserPage }))\n);\n/**\n * User-facing routes for the Support microfrontend.\n *\n * Only includes routes relevant to end users:\n * - Ticket management (list, create, view)\n * - Knowledge base browsing (read-only, published articles)\n *\n * Admin-only features (inquiries, analytics, settings, KB authoring)\n * are excluded — see SupportAdminRoutes for those.\n */\nexport function SupportUserRoutes() {\n return (\n <Suspense fallback={<PageLoader />}>\n <Routes>\n {/* Default redirect */}\n <Route index element={<Navigate to=\"tickets\" replace />} />\n\n {/* Tickets */}\n <Route path=\"tickets\" element={<TicketListPage />} />\n <Route path=\"tickets/new\" element={<CreateTicketPage />} />\n <Route path=\"tickets/:ticketId\" element={<TicketDetailUserPage />} />\n\n {/* Knowledge Base (read-only for users — user-specific pages omit admin buttons,\n so the KB redirect routes from BOFF-2169 are no longer needed) */}\n <Route path=\"kb\" element={<KnowledgeBaseUserPage />} />\n <Route path=\"kb/articles/:slug\" element={<ArticleDetailUserPage />} />\n\n {/* Catch-all redirect */}\n <Route path=\"*\" element={<CatchAllRedirect />} />\n </Routes>\n </Suspense>\n );\n}\n"],"mappings":";;;;;;AASA,IAAM,IAAuB,QAC3B,OAAO,mCAAgC,MAAM,OAAO,EAAE,SAAS,EAAE,sBAAsB,EAAE,CAC1F,EACK,IAAmB,QACvB,OAAO,+BAA4B,MAAM,OAAO,EAAE,SAAS,EAAE,kBAAkB,EAAE,CAClF,EACK,IAAwB,QAC5B,OAAO,oCAAiC,MAAM,OAAO,EAAE,SAAS,EAAE,uBAAuB,EAAE,CAC5F,EACK,IAAwB,QAC5B,OAAO,oCAAiC,MAAM,OAAO,EAAE,SAAS,EAAE,uBAAuB,EAAE,CAC5F;AAWD,SAAgB,IAAoB;AAClC,QACE,kBAAC,GAAD;EAAU,UAAU,kBAAC,GAAD,EAAc,CAAA;YAChC,kBAAC,GAAD,EAAA,UAAA;GAEE,kBAAC,GAAD;IAAO,OAAA;IAAM,SAAS,kBAAC,GAAD;KAAU,IAAG;KAAU,SAAA;KAAU,CAAA;IAAI,CAAA;GAG3D,kBAAC,GAAD;IAAO,MAAK;IAAU,SAAS,kBAAC,GAAD,EAAkB,CAAA;IAAI,CAAA;GACrD,kBAAC,GAAD;IAAO,MAAK;IAAc,SAAS,kBAAC,GAAD,EAAoB,CAAA;IAAI,CAAA;GAC3D,kBAAC,GAAD;IAAO,MAAK;IAAoB,SAAS,kBAAC,GAAD,EAAwB,CAAA;IAAI,CAAA;GAIrE,kBAAC,GAAD;IAAO,MAAK;IAAK,SAAS,kBAAC,GAAD,EAAyB,CAAA;IAAI,CAAA;GACvD,kBAAC,GAAD;IAAO,MAAK;IAAoB,SAAS,kBAAC,GAAD,EAAyB,CAAA;IAAI,CAAA;GAGtE,kBAAC,GAAD;IAAO,MAAK;IAAI,SAAS,kBAAC,GAAD,EAAoB,CAAA;IAAI,CAAA;GAC1C,EAAA,CAAA;EACA,CAAA"}
@@ -0,0 +1,34 @@
1
+ import { AlertCircle as e, CheckCircle as t, Info as n } from "lucide-react";
2
+ import { jsx as r, jsxs as i } from "react/jsx-runtime";
3
+ //#region src/support/components/NotificationToast.tsx
4
+ var a = 20;
5
+ function o({ notification: o }) {
6
+ if (!o) return null;
7
+ let s = o.type === "error", c = o.type === "success";
8
+ return /* @__PURE__ */ i("div", {
9
+ role: s ? "alert" : "status",
10
+ "aria-live": s ? "assertive" : "polite",
11
+ "aria-atomic": "true",
12
+ className: `fixed top-4 right-4 z-50 flex items-center gap-3 px-5 py-3 rounded-xl shadow-2xl border-2 animate-in slide-in-from-top-4 duration-300 ${c ? "bg-success/10 text-success border-success/30" : s ? "bg-error/10 text-error border-error/30" : "bg-info/10 text-info border-info/30"}`,
13
+ children: [c ? /* @__PURE__ */ r(t, {
14
+ size: a,
15
+ className: "text-success",
16
+ "aria-hidden": "true"
17
+ }) : s ? /* @__PURE__ */ r(e, {
18
+ size: a,
19
+ className: "text-error",
20
+ "aria-hidden": "true"
21
+ }) : /* @__PURE__ */ r(n, {
22
+ size: a,
23
+ className: "text-info",
24
+ "aria-hidden": "true"
25
+ }), /* @__PURE__ */ r("span", {
26
+ className: "font-medium",
27
+ children: o.message
28
+ })]
29
+ });
30
+ }
31
+ //#endregion
32
+ export { o as NotificationToast };
33
+
34
+ //# sourceMappingURL=NotificationToast.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"NotificationToast.js","names":[],"sources":["../../../src/support/components/NotificationToast.tsx"],"sourcesContent":["import type { ReactElement } from 'react';\nimport { AlertCircle, CheckCircle, Info } from 'lucide-react';\n\nimport type { NotificationState } from '../hooks/useNotification';\n\ninterface NotificationToastProps {\n notification: NotificationState | null;\n}\n\nconst ICON_SIZE = 20;\n\n/**\n * Shared fixed-corner toast for CreateTicketPage + TicketDetail* pages.\n *\n * ARIA: `alert` + `assertive` for errors so a screen reader interrupts; `status`\n * + `polite` for success/info so it's announced without cutting off other\n * speech. `aria-atomic` so the full message reads as one unit.\n *\n * Icon choice: `Info` for the `'info'` variant — `AlertCircle` incorrectly\n * implies failure/warning in sighted UX.\n */\nexport function NotificationToast({ notification }: NotificationToastProps): ReactElement | null {\n if (!notification) return null;\n\n const isError = notification.type === 'error';\n const isSuccess = notification.type === 'success';\n\n return (\n <div\n role={isError ? 'alert' : 'status'}\n aria-live={isError ? 'assertive' : 'polite'}\n aria-atomic=\"true\"\n className={`fixed top-4 right-4 z-50 flex items-center gap-3 px-5 py-3 rounded-xl shadow-2xl border-2 animate-in slide-in-from-top-4 duration-300 ${\n isSuccess\n ? 'bg-success/10 text-success border-success/30'\n : isError\n ? 'bg-error/10 text-error border-error/30'\n : 'bg-info/10 text-info border-info/30'\n }`}\n >\n {isSuccess ? (\n <CheckCircle size={ICON_SIZE} className=\"text-success\" aria-hidden=\"true\" />\n ) : isError ? (\n <AlertCircle size={ICON_SIZE} className=\"text-error\" aria-hidden=\"true\" />\n ) : (\n <Info size={ICON_SIZE} className=\"text-info\" aria-hidden=\"true\" />\n )}\n <span className=\"font-medium\">{notification.message}</span>\n </div>\n );\n}\n"],"mappings":";;;AASA,IAAM,IAAY;AAYlB,SAAgB,EAAkB,EAAE,mBAA6D;AAC/F,KAAI,CAAC,EAAc,QAAO;CAE1B,IAAM,IAAU,EAAa,SAAS,SAChC,IAAY,EAAa,SAAS;AAExC,QACE,kBAAC,OAAD;EACE,MAAM,IAAU,UAAU;EAC1B,aAAW,IAAU,cAAc;EACnC,eAAY;EACZ,WAAW,yIACT,IACI,iDACA,IACE,2CACA;YATV,CAYG,IACC,kBAAC,GAAD;GAAa,MAAM;GAAW,WAAU;GAAe,eAAY;GAAS,CAAA,GAC1E,IACF,kBAAC,GAAD;GAAa,MAAM;GAAW,WAAU;GAAa,eAAY;GAAS,CAAA,GAE1E,kBAAC,GAAD;GAAM,MAAM;GAAW,WAAU;GAAY,eAAY;GAAS,CAAA,EAEpE,kBAAC,QAAD;GAAM,WAAU;aAAe,EAAa;GAAe,CAAA,CACvD"}
@@ -0,0 +1,87 @@
1
+ import { cn as e } from "../utils/cn.js";
2
+ import { jsx as t, jsxs as n } from "react/jsx-runtime";
3
+ //#region src/support/components/PageLayout.tsx
4
+ var r = {
5
+ sm: "max-w-screen-sm",
6
+ md: "max-w-screen-md",
7
+ lg: "max-w-screen-lg",
8
+ xl: "max-w-screen-xl",
9
+ "2xl": "max-w-screen-2xl",
10
+ "3xl": "max-w-[1600px]",
11
+ full: "max-w-full"
12
+ };
13
+ function i({ children: i, title: a, subtitle: o, icon: s, headerActions: c, headerContent: l, maxWidth: u = "xl", showHeader: d = !0, className: f, contentClassName: p }) {
14
+ return /* @__PURE__ */ t("div", {
15
+ className: e("min-h-full w-full", "px-4 sm:px-6 lg:px-8 xl:px-12", "py-6 sm:py-8 lg:py-10", "animate-in fade-in-0 slide-in-from-bottom-4 duration-500", f),
16
+ children: /* @__PURE__ */ n("div", {
17
+ className: e("mx-auto w-full", r[u], p),
18
+ children: [d && (a || c) && /* @__PURE__ */ n("header", {
19
+ className: "mb-6 sm:mb-8",
20
+ children: [/* @__PURE__ */ n("div", {
21
+ className: "flex flex-col gap-4 sm:flex-row sm:items-start sm:justify-between",
22
+ children: [/* @__PURE__ */ n("div", {
23
+ className: "space-y-1",
24
+ children: [(a || s) && /* @__PURE__ */ n("div", {
25
+ className: "flex items-center gap-3",
26
+ children: [s && /* @__PURE__ */ t("div", {
27
+ className: "flex-shrink-0 p-2.5 rounded-xl bg-primary/10 text-primary",
28
+ children: s
29
+ }), a && /* @__PURE__ */ t("h1", {
30
+ className: "text-2xl sm:text-3xl font-bold tracking-tight text-foreground",
31
+ children: a
32
+ })]
33
+ }), o && /* @__PURE__ */ t("p", {
34
+ className: "text-sm sm:text-base text-muted-foreground max-w-2xl",
35
+ children: o
36
+ })]
37
+ }), c && /* @__PURE__ */ t("div", {
38
+ className: "flex items-center gap-2 flex-shrink-0",
39
+ children: c
40
+ })]
41
+ }), l && /* @__PURE__ */ t("div", {
42
+ className: "mt-4",
43
+ children: l
44
+ })]
45
+ }), /* @__PURE__ */ t("div", {
46
+ className: "space-y-6",
47
+ children: i
48
+ })]
49
+ })
50
+ });
51
+ }
52
+ function a({ icon: r, title: i, description: a, action: o, className: s }) {
53
+ return /* @__PURE__ */ n("div", {
54
+ className: e("flex flex-col items-center justify-center", "py-12 sm:py-16 px-4", "text-center", "animate-in fade-in-0 zoom-in-95 duration-300", s),
55
+ children: [
56
+ r && /* @__PURE__ */ t("div", {
57
+ className: "mb-4 p-4 rounded-2xl bg-muted/50 text-muted-foreground",
58
+ children: r
59
+ }),
60
+ /* @__PURE__ */ t("h3", {
61
+ className: "text-lg font-semibold text-foreground mb-1",
62
+ children: i
63
+ }),
64
+ a && /* @__PURE__ */ t("p", {
65
+ className: "text-sm text-muted-foreground max-w-sm mb-4",
66
+ children: a
67
+ }),
68
+ o
69
+ ]
70
+ });
71
+ }
72
+ function o({ message: r = "Loading...", className: i }) {
73
+ return /* @__PURE__ */ n("div", {
74
+ className: e("flex flex-col items-center justify-center py-20", i),
75
+ children: [/* @__PURE__ */ n("div", {
76
+ className: "relative",
77
+ children: [/* @__PURE__ */ t("div", { className: "absolute inset-0 bg-primary/20 rounded-full blur-xl animate-pulse" }), /* @__PURE__ */ t("div", { className: "relative w-12 h-12 border-4 border-primary/30 border-t-primary rounded-full animate-spin" })]
78
+ }), /* @__PURE__ */ t("span", {
79
+ className: "mt-6 text-sm font-medium text-muted-foreground",
80
+ children: r
81
+ })]
82
+ });
83
+ }
84
+ //#endregion
85
+ export { a as EmptyState, o as LoadingState, i as PageLayout };
86
+
87
+ //# sourceMappingURL=PageLayout.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"PageLayout.js","names":[],"sources":["../../../src/support/components/PageLayout.tsx"],"sourcesContent":["import type { ReactNode } from 'react';\nimport { cn } from '../utils/cn';\n\ninterface PageLayoutProps {\n children: ReactNode;\n /** Page title */\n title?: string;\n /** Page subtitle/description */\n subtitle?: string;\n /** Icon component to display next to title */\n icon?: ReactNode;\n /** Actions to display in header (buttons, etc.) */\n headerActions?: ReactNode;\n /** Additional header content below title */\n headerContent?: ReactNode;\n /** Maximum width of content: 'sm' | 'md' | 'lg' | 'xl' | '2xl' | '3xl' | 'full' */\n maxWidth?: 'sm' | 'md' | 'lg' | 'xl' | '2xl' | '3xl' | 'full';\n /** Whether to show the header section */\n showHeader?: boolean;\n /** Additional CSS classes for the container */\n className?: string;\n /** Additional CSS classes for the content area */\n contentClassName?: string;\n}\n\nconst maxWidthClasses = {\n sm: 'max-w-screen-sm', // 640px\n md: 'max-w-screen-md', // 768px\n lg: 'max-w-screen-lg', // 1024px\n xl: 'max-w-screen-xl', // 1280px\n '2xl': 'max-w-screen-2xl', // 1536px\n '3xl': 'max-w-[1600px]',\n full: 'max-w-full',\n};\n\n/**\n * PageLayout - A consistent page wrapper with responsive design for Support module\n *\n * Features:\n * - Proper max-width constraints\n * - Responsive padding\n * - Animated entrance\n * - Consistent header styling\n */\nexport function PageLayout({\n children,\n title,\n subtitle,\n icon,\n headerActions,\n headerContent,\n maxWidth = 'xl',\n showHeader = true,\n className,\n contentClassName,\n}: PageLayoutProps) {\n return (\n <div\n className={cn(\n // Base styles - full width container with padding\n 'min-h-full w-full',\n // Responsive horizontal padding\n 'px-4 sm:px-6 lg:px-8 xl:px-12',\n // Responsive vertical padding\n 'py-6 sm:py-8 lg:py-10',\n // Entrance animation\n 'animate-in fade-in-0 slide-in-from-bottom-4 duration-500',\n className\n )}\n >\n {/* Max-width constrained content container */}\n <div className={cn('mx-auto w-full', maxWidthClasses[maxWidth], contentClassName)}>\n {/* Page Header */}\n {showHeader && (title || headerActions) && (\n <header className=\"mb-6 sm:mb-8\">\n <div className=\"flex flex-col gap-4 sm:flex-row sm:items-start sm:justify-between\">\n {/* Title Section */}\n <div className=\"space-y-1\">\n {(title || icon) && (\n <div className=\"flex items-center gap-3\">\n {icon && (\n <div className=\"flex-shrink-0 p-2.5 rounded-xl bg-primary/10 text-primary\">\n {icon}\n </div>\n )}\n {title && (\n <h1 className=\"text-2xl sm:text-3xl font-bold tracking-tight text-foreground\">\n {title}\n </h1>\n )}\n </div>\n )}\n {subtitle && (\n <p className=\"text-sm sm:text-base text-muted-foreground max-w-2xl\">{subtitle}</p>\n )}\n </div>\n\n {/* Header Actions */}\n {headerActions && (\n <div className=\"flex items-center gap-2 flex-shrink-0\">{headerActions}</div>\n )}\n </div>\n\n {/* Additional Header Content */}\n {headerContent && <div className=\"mt-4\">{headerContent}</div>}\n </header>\n )}\n\n {/* Page content — must not use a <main> landmark here because the\n host shell (AppShellLayout) already renders one; nesting <main>\n elements is invalid HTML and an a11y violation. */}\n <div className=\"space-y-6\">{children}</div>\n </div>\n </div>\n );\n}\n\n/**\n * PageSection - A section within a page with consistent spacing\n */\nexport function PageSection({\n children,\n title,\n description,\n actions,\n className,\n}: {\n children: ReactNode;\n title?: string;\n description?: string;\n actions?: ReactNode;\n className?: string;\n}) {\n return (\n <section className={cn('space-y-4', className)}>\n {(title || actions) && (\n <div className=\"flex items-center justify-between\">\n <div>\n {title && <h2 className=\"text-lg font-semibold text-foreground\">{title}</h2>}\n {description && <p className=\"text-sm text-muted-foreground\">{description}</p>}\n </div>\n {actions && <div className=\"flex items-center gap-2\">{actions}</div>}\n </div>\n )}\n {children}\n </section>\n );\n}\n\n/**\n * EmptyState - A consistent empty state component\n */\nexport function EmptyState({\n icon,\n title,\n description,\n action,\n className,\n}: {\n icon?: ReactNode;\n title: string;\n description?: string;\n action?: ReactNode;\n className?: string;\n}) {\n return (\n <div\n className={cn(\n 'flex flex-col items-center justify-center',\n 'py-12 sm:py-16 px-4',\n 'text-center',\n 'animate-in fade-in-0 zoom-in-95 duration-300',\n className\n )}\n >\n {icon && <div className=\"mb-4 p-4 rounded-2xl bg-muted/50 text-muted-foreground\">{icon}</div>}\n <h3 className=\"text-lg font-semibold text-foreground mb-1\">{title}</h3>\n {description && <p className=\"text-sm text-muted-foreground max-w-sm mb-4\">{description}</p>}\n {action}\n </div>\n );\n}\n\n/**\n * LoadingState - A consistent loading state component\n */\nexport function LoadingState({\n message = 'Loading...',\n className,\n}: {\n message?: string;\n className?: string;\n}) {\n return (\n <div className={cn('flex flex-col items-center justify-center py-20', className)}>\n <div className=\"relative\">\n <div className=\"absolute inset-0 bg-primary/20 rounded-full blur-xl animate-pulse\" />\n <div className=\"relative w-12 h-12 border-4 border-primary/30 border-t-primary rounded-full animate-spin\" />\n </div>\n <span className=\"mt-6 text-sm font-medium text-muted-foreground\">{message}</span>\n </div>\n );\n}\n"],"mappings":";;;AAyBA,IAAM,IAAkB;CACtB,IAAI;CACJ,IAAI;CACJ,IAAI;CACJ,IAAI;CACJ,OAAO;CACP,OAAO;CACP,MAAM;CACP;AAWD,SAAgB,EAAW,EACzB,aACA,UACA,aACA,SACA,kBACA,kBACA,cAAW,MACX,gBAAa,IACb,cACA,uBACkB;AAClB,QACE,kBAAC,OAAD;EACE,WAAW,EAET,qBAEA,iCAEA,yBAEA,4DACA,EACD;YAGD,kBAAC,OAAD;GAAK,WAAW,EAAG,kBAAkB,EAAgB,IAAW,EAAiB;aAAjF,CAEG,MAAe,KAAS,MACvB,kBAAC,UAAD;IAAQ,WAAU;cAAlB,CACE,kBAAC,OAAD;KAAK,WAAU;eAAf,CAEE,kBAAC,OAAD;MAAK,WAAU;gBAAf,EACI,KAAS,MACT,kBAAC,OAAD;OAAK,WAAU;iBAAf,CACG,KACC,kBAAC,OAAD;QAAK,WAAU;kBACZ;QACG,CAAA,EAEP,KACC,kBAAC,MAAD;QAAI,WAAU;kBACX;QACE,CAAA,CAEH;UAEP,KACC,kBAAC,KAAD;OAAG,WAAU;iBAAwD;OAAa,CAAA,CAEhF;SAGL,KACC,kBAAC,OAAD;MAAK,WAAU;gBAAyC;MAAoB,CAAA,CAE1E;QAGL,KAAiB,kBAAC,OAAD;KAAK,WAAU;eAAQ;KAAoB,CAAA,CACtD;OAMX,kBAAC,OAAD;IAAK,WAAU;IAAa;IAAe,CAAA,CACvC;;EACF,CAAA;;AAuCV,SAAgB,EAAW,EACzB,SACA,UACA,gBACA,WACA,gBAOC;AACD,QACE,kBAAC,OAAD;EACE,WAAW,EACT,6CACA,uBACA,eACA,gDACA,EACD;YAPH;GASG,KAAQ,kBAAC,OAAD;IAAK,WAAU;cAA0D;IAAW,CAAA;GAC7F,kBAAC,MAAD;IAAI,WAAU;cAA8C;IAAW,CAAA;GACtE,KAAe,kBAAC,KAAD;IAAG,WAAU;cAA+C;IAAgB,CAAA;GAC3F;GACG;;;AAOV,SAAgB,EAAa,EAC3B,aAAU,cACV,gBAIC;AACD,QACE,kBAAC,OAAD;EAAK,WAAW,EAAG,mDAAmD,EAAU;YAAhF,CACE,kBAAC,OAAD;GAAK,WAAU;aAAf,CACE,kBAAC,OAAD,EAAK,WAAU,qEAAsE,CAAA,EACrF,kBAAC,OAAD,EAAK,WAAU,4FAA6F,CAAA,CACxG;MACN,kBAAC,QAAD;GAAM,WAAU;aAAkD;GAAe,CAAA,CAC7E"}
@@ -0,0 +1,22 @@
1
+ import { useSupport as e } from "../providers/SupportProvider.js";
2
+ import { joinPath as t } from "../utils/index.js";
3
+ import { useEffect as n } from "react";
4
+ import { useNavigate as r } from "react-router-dom";
5
+ import { jsx as i } from "react/jsx-runtime";
6
+ //#region src/support/components/RouteHelpers.tsx
7
+ function a() {
8
+ return /* @__PURE__ */ i("div", {
9
+ className: "flex h-64 items-center justify-center",
10
+ children: /* @__PURE__ */ i("div", { className: "h-8 w-8 animate-spin rounded-full border-4 border-primary border-t-transparent" })
11
+ });
12
+ }
13
+ function o() {
14
+ let { basePath: i = "/" } = e(), a = r();
15
+ return n(() => {
16
+ a(t(i, "tickets"), { replace: !0 });
17
+ }, [i, a]), null;
18
+ }
19
+ //#endregion
20
+ export { o as CatchAllRedirect, a as PageLoader };
21
+
22
+ //# sourceMappingURL=RouteHelpers.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"RouteHelpers.js","names":[],"sources":["../../../src/support/components/RouteHelpers.tsx"],"sourcesContent":["import { useEffect } from 'react';\nimport { useNavigate } from 'react-router-dom';\nimport { useSupport } from '../providers/SupportProvider';\nimport { joinPath } from '../utils';\n\n/**\n * Shared loading fallback for lazy-loaded route pages.\n */\nexport function PageLoader() {\n return (\n <div className=\"flex h-64 items-center justify-center\">\n <div className=\"h-8 w-8 animate-spin rounded-full border-4 border-primary border-t-transparent\" />\n </div>\n );\n}\n\n/**\n * Catch-all redirect that sends unknown paths to the tickets page.\n * Uses basePath from SupportProvider context and joinPath to avoid double-slashes.\n */\nexport function CatchAllRedirect() {\n const { basePath = '/' } = useSupport();\n const navigate = useNavigate();\n useEffect(() => {\n navigate(joinPath(basePath, 'tickets'), { replace: true });\n }, [basePath, navigate]);\n return null;\n}\n"],"mappings":";;;;;;AAQA,SAAgB,IAAa;AAC3B,QACE,kBAAC,OAAD;EAAK,WAAU;YACb,kBAAC,OAAD,EAAK,WAAU,kFAAmF,CAAA;EAC9F,CAAA;;AAQV,SAAgB,IAAmB;CACjC,IAAM,EAAE,cAAW,QAAQ,GAAY,EACjC,IAAW,GAAa;AAI9B,QAHA,QAAgB;AACd,IAAS,EAAS,GAAU,UAAU,EAAE,EAAE,SAAS,IAAM,CAAC;IACzD,CAAC,GAAU,EAAS,CAAC,EACjB"}
@@ -0,0 +1,63 @@
1
+ import { FolderOpen as e } from "lucide-react";
2
+ import { jsx as t, jsxs as n } from "react/jsx-runtime";
3
+ //#region src/support/components/analytics/CategoryBreakdown.tsx
4
+ var r = [
5
+ "#3b82f6",
6
+ "#8b5cf6",
7
+ "#ec4899",
8
+ "#f97316",
9
+ "#eab308",
10
+ "#84cc16",
11
+ "#10b981",
12
+ "#06b6d4"
13
+ ];
14
+ function i({ data: i }) {
15
+ let a = i.reduce((e, t) => e + t.count, 0), o = i.slice(0, 8);
16
+ return /* @__PURE__ */ n("div", {
17
+ className: "p-6 rounded-lg border border-default bg-surface transition-all duration-200 hover:shadow-sm animate-in fade-in-0 slide-in-from-bottom-2",
18
+ children: [/* @__PURE__ */ n("h2", {
19
+ className: "text-xl font-semibold mb-4 flex items-center gap-2 text-primary",
20
+ children: [/* @__PURE__ */ t(e, { size: 20 }), "Top Categories"]
21
+ }), /* @__PURE__ */ t("div", {
22
+ className: "space-y-3",
23
+ children: o.map((e, i) => {
24
+ let o = a > 0 ? e.count / a * 100 : 0, s = r[i % r.length];
25
+ return /* @__PURE__ */ n("div", {
26
+ className: "flex items-center justify-between transition-colors duration-200 hover:bg-muted/50 p-1 rounded",
27
+ children: [/* @__PURE__ */ n("div", {
28
+ className: "flex items-center gap-2 flex-1",
29
+ children: [/* @__PURE__ */ t("div", {
30
+ className: "w-3 h-3 rounded-full flex-shrink-0",
31
+ style: { backgroundColor: s }
32
+ }), /* @__PURE__ */ t("span", {
33
+ className: "text-sm truncate text-primary",
34
+ children: e.category
35
+ })]
36
+ }), /* @__PURE__ */ n("div", {
37
+ className: "flex items-center gap-3 ml-4",
38
+ children: [/* @__PURE__ */ t("div", {
39
+ className: "w-20",
40
+ children: /* @__PURE__ */ t("div", {
41
+ className: "h-2 rounded-full bg-muted",
42
+ children: /* @__PURE__ */ t("div", {
43
+ className: "h-full rounded-full transition-all duration-300",
44
+ style: {
45
+ width: `${o}%`,
46
+ backgroundColor: s
47
+ }
48
+ })
49
+ })
50
+ }), /* @__PURE__ */ t("span", {
51
+ className: "text-sm font-semibold w-12 text-right text-primary",
52
+ children: e.count
53
+ })]
54
+ })]
55
+ }, e.category);
56
+ })
57
+ })]
58
+ });
59
+ }
60
+ //#endregion
61
+ export { i as CategoryBreakdown };
62
+
63
+ //# sourceMappingURL=CategoryBreakdown.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"CategoryBreakdown.js","names":[],"sources":["../../../../src/support/components/analytics/CategoryBreakdown.tsx"],"sourcesContent":["import { FolderOpen } from 'lucide-react';\n\ninterface CategoryCount {\n category: string;\n count: number;\n}\n\ninterface CategoryBreakdownProps {\n data: CategoryCount[];\n}\n\nconst categoryColors = [\n '#3b82f6',\n '#8b5cf6',\n '#ec4899',\n '#f97316',\n '#eab308',\n '#84cc16',\n '#10b981',\n '#06b6d4',\n];\n\nexport function CategoryBreakdown({ data }: CategoryBreakdownProps) {\n const total = data.reduce((sum, item) => sum + item.count, 0);\n const topCategories = data.slice(0, 8);\n\n return (\n <div className=\"p-6 rounded-lg border border-default bg-surface transition-all duration-200 hover:shadow-sm animate-in fade-in-0 slide-in-from-bottom-2\">\n <h2 className=\"text-xl font-semibold mb-4 flex items-center gap-2 text-primary\">\n <FolderOpen size={20} />\n Top Categories\n </h2>\n\n <div className=\"space-y-3\">\n {topCategories.map((item, index) => {\n const percentage = total > 0 ? (item.count / total) * 100 : 0;\n const color = categoryColors[index % categoryColors.length];\n\n return (\n <div\n key={item.category}\n className=\"flex items-center justify-between transition-colors duration-200 hover:bg-muted/50 p-1 rounded\"\n >\n <div className=\"flex items-center gap-2 flex-1\">\n <div\n className=\"w-3 h-3 rounded-full flex-shrink-0\"\n style={{ backgroundColor: color }}\n />\n <span className=\"text-sm truncate text-primary\">{item.category}</span>\n </div>\n <div className=\"flex items-center gap-3 ml-4\">\n <div className=\"w-20\">\n <div className=\"h-2 rounded-full bg-muted\">\n <div\n className=\"h-full rounded-full transition-all duration-300\"\n style={{\n width: `${percentage}%`,\n backgroundColor: color,\n }}\n />\n </div>\n </div>\n <span className=\"text-sm font-semibold w-12 text-right text-primary\">\n {item.count}\n </span>\n </div>\n </div>\n );\n })}\n </div>\n </div>\n );\n}\n"],"mappings":";;;AAWA,IAAM,IAAiB;CACrB;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACD;AAED,SAAgB,EAAkB,EAAE,WAAgC;CAClE,IAAM,IAAQ,EAAK,QAAQ,GAAK,MAAS,IAAM,EAAK,OAAO,EAAE,EACvD,IAAgB,EAAK,MAAM,GAAG,EAAE;AAEtC,QACE,kBAAC,OAAD;EAAK,WAAU;YAAf,CACE,kBAAC,MAAD;GAAI,WAAU;aAAd,CACE,kBAAC,GAAD,EAAY,MAAM,IAAM,CAAA,EAAA,iBAErB;MAEL,kBAAC,OAAD;GAAK,WAAU;aACZ,EAAc,KAAK,GAAM,MAAU;IAClC,IAAM,IAAa,IAAQ,IAAK,EAAK,QAAQ,IAAS,MAAM,GACtD,IAAQ,EAAe,IAAQ,EAAe;AAEpD,WACE,kBAAC,OAAD;KAEE,WAAU;eAFZ,CAIE,kBAAC,OAAD;MAAK,WAAU;gBAAf,CACE,kBAAC,OAAD;OACE,WAAU;OACV,OAAO,EAAE,iBAAiB,GAAO;OACjC,CAAA,EACF,kBAAC,QAAD;OAAM,WAAU;iBAAiC,EAAK;OAAgB,CAAA,CAClE;SACN,kBAAC,OAAD;MAAK,WAAU;gBAAf,CACE,kBAAC,OAAD;OAAK,WAAU;iBACb,kBAAC,OAAD;QAAK,WAAU;kBACb,kBAAC,OAAD;SACE,WAAU;SACV,OAAO;UACL,OAAO,GAAG,EAAW;UACrB,iBAAiB;UAClB;SACD,CAAA;QACE,CAAA;OACF,CAAA,EACN,kBAAC,QAAD;OAAM,WAAU;iBACb,EAAK;OACD,CAAA,CACH;QACF;OA1BC,EAAK,SA0BN;KAER;GACE,CAAA,CACF"}
@@ -0,0 +1,31 @@
1
+ import { jsx as e, jsxs as t } from "react/jsx-runtime";
2
+ //#region src/support/components/analytics/MetricCard.tsx
3
+ function n({ title: n, value: r, icon: i, iconColor: a, subtitle: o }) {
4
+ return /* @__PURE__ */ t("div", {
5
+ className: "p-6 rounded-lg border border-default bg-surface transition-all duration-200 hover:shadow-sm hover:border-primary/30 animate-in fade-in-0 slide-in-from-bottom-2",
6
+ children: [
7
+ /* @__PURE__ */ t("div", {
8
+ className: "flex items-center justify-between mb-3",
9
+ children: [/* @__PURE__ */ e("span", {
10
+ className: "text-sm font-medium text-secondary",
11
+ children: n
12
+ }), /* @__PURE__ */ e(i, {
13
+ size: 20,
14
+ className: a
15
+ })]
16
+ }),
17
+ /* @__PURE__ */ e("p", {
18
+ className: "text-3xl font-bold mb-1 text-primary",
19
+ children: r
20
+ }),
21
+ o && /* @__PURE__ */ e("p", {
22
+ className: "text-xs text-tertiary",
23
+ children: o
24
+ })
25
+ ]
26
+ });
27
+ }
28
+ //#endregion
29
+ export { n as MetricCard };
30
+
31
+ //# sourceMappingURL=MetricCard.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"MetricCard.js","names":[],"sources":["../../../../src/support/components/analytics/MetricCard.tsx"],"sourcesContent":["import { LucideIcon } from 'lucide-react';\n\ninterface MetricCardProps {\n title: string;\n value: string;\n icon: LucideIcon;\n iconColor: string;\n subtitle?: string;\n}\n\nexport function MetricCard({ title, value, icon: Icon, iconColor, subtitle }: MetricCardProps) {\n return (\n <div className=\"p-6 rounded-lg border border-default bg-surface transition-all duration-200 hover:shadow-sm hover:border-primary/30 animate-in fade-in-0 slide-in-from-bottom-2\">\n <div className=\"flex items-center justify-between mb-3\">\n <span className=\"text-sm font-medium text-secondary\">{title}</span>\n <Icon size={20} className={iconColor} />\n </div>\n <p className=\"text-3xl font-bold mb-1 text-primary\">{value}</p>\n {subtitle && <p className=\"text-xs text-tertiary\">{subtitle}</p>}\n </div>\n );\n}\n"],"mappings":";;AAUA,SAAgB,EAAW,EAAE,UAAO,UAAO,MAAM,GAAM,cAAW,eAA6B;AAC7F,QACE,kBAAC,OAAD;EAAK,WAAU;YAAf;GACE,kBAAC,OAAD;IAAK,WAAU;cAAf,CACE,kBAAC,QAAD;KAAM,WAAU;eAAsC;KAAa,CAAA,EACnE,kBAAC,GAAD;KAAM,MAAM;KAAI,WAAW;KAAa,CAAA,CACpC;;GACN,kBAAC,KAAD;IAAG,WAAU;cAAwC;IAAU,CAAA;GAC9D,KAAY,kBAAC,KAAD;IAAG,WAAU;cAAyB;IAAa,CAAA;GAC5D"}
@@ -0,0 +1,59 @@
1
+ import { AlertCircle as e } from "lucide-react";
2
+ import { jsx as t, jsxs as n } from "react/jsx-runtime";
3
+ //#region src/support/components/analytics/PriorityBreakdown.tsx
4
+ var r = {
5
+ URGENT: "#ef4444",
6
+ HIGH: "#f97316",
7
+ MEDIUM: "#eab308",
8
+ LOW: "#84cc16"
9
+ };
10
+ function i({ data: i }) {
11
+ let a = i.reduce((e, t) => e + t.count, 0);
12
+ return /* @__PURE__ */ n("div", {
13
+ className: "p-6 rounded-lg border border-default bg-surface transition-all duration-200 hover:shadow-sm animate-in fade-in-0 slide-in-from-bottom-2",
14
+ children: [/* @__PURE__ */ n("h2", {
15
+ className: "text-xl font-semibold mb-4 flex items-center gap-2 text-primary",
16
+ children: [/* @__PURE__ */ t(e, { size: 20 }), "Tickets by Priority"]
17
+ }), /* @__PURE__ */ t("div", {
18
+ className: "space-y-4",
19
+ children: i.map((e) => {
20
+ let i = a > 0 ? e.count / a * 100 : 0, o = r[e.priority] || void 0;
21
+ return /* @__PURE__ */ n("div", { children: [/* @__PURE__ */ n("div", {
22
+ className: "flex items-center justify-between mb-2",
23
+ children: [/* @__PURE__ */ n("div", {
24
+ className: "flex items-center gap-2",
25
+ children: [/* @__PURE__ */ t("div", {
26
+ className: "w-3 h-3 rounded-full",
27
+ style: { backgroundColor: o }
28
+ }), /* @__PURE__ */ t("span", {
29
+ className: "font-medium text-primary",
30
+ children: e.priority
31
+ })]
32
+ }), /* @__PURE__ */ n("div", {
33
+ className: "flex items-center gap-2",
34
+ children: [/* @__PURE__ */ n("span", {
35
+ className: "text-sm text-tertiary",
36
+ children: [i.toFixed(0), "%"]
37
+ }), /* @__PURE__ */ t("span", {
38
+ className: "font-semibold text-primary",
39
+ children: e.count
40
+ })]
41
+ })]
42
+ }), /* @__PURE__ */ t("div", {
43
+ className: "h-2 rounded-full bg-muted",
44
+ children: /* @__PURE__ */ t("div", {
45
+ className: "h-full rounded-full transition-all duration-300",
46
+ style: {
47
+ width: `${i}%`,
48
+ backgroundColor: o
49
+ }
50
+ })
51
+ })] }, e.priority);
52
+ })
53
+ })]
54
+ });
55
+ }
56
+ //#endregion
57
+ export { i as PriorityBreakdown };
58
+
59
+ //# sourceMappingURL=PriorityBreakdown.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"PriorityBreakdown.js","names":[],"sources":["../../../../src/support/components/analytics/PriorityBreakdown.tsx"],"sourcesContent":["import { AlertCircle } from 'lucide-react';\n\ninterface PriorityCount {\n priority: string;\n count: number;\n}\n\ninterface PriorityBreakdownProps {\n data: PriorityCount[];\n}\n\nconst priorityColors: Record<string, string> = {\n URGENT: '#ef4444',\n HIGH: '#f97316',\n MEDIUM: '#eab308',\n LOW: '#84cc16',\n};\n\nexport function PriorityBreakdown({ data }: PriorityBreakdownProps) {\n const total = data.reduce((sum, item) => sum + item.count, 0);\n\n return (\n <div className=\"p-6 rounded-lg border border-default bg-surface transition-all duration-200 hover:shadow-sm animate-in fade-in-0 slide-in-from-bottom-2\">\n <h2 className=\"text-xl font-semibold mb-4 flex items-center gap-2 text-primary\">\n <AlertCircle size={20} />\n Tickets by Priority\n </h2>\n\n <div className=\"space-y-4\">\n {data.map((item) => {\n const percentage = total > 0 ? (item.count / total) * 100 : 0;\n const color = priorityColors[item.priority] || undefined;\n\n return (\n <div key={item.priority}>\n <div className=\"flex items-center justify-between mb-2\">\n <div className=\"flex items-center gap-2\">\n <div className=\"w-3 h-3 rounded-full\" style={{ backgroundColor: color }} />\n <span className=\"font-medium text-primary\">{item.priority}</span>\n </div>\n <div className=\"flex items-center gap-2\">\n <span className=\"text-sm text-tertiary\">{percentage.toFixed(0)}%</span>\n <span className=\"font-semibold text-primary\">{item.count}</span>\n </div>\n </div>\n <div className=\"h-2 rounded-full bg-muted\">\n <div\n className=\"h-full rounded-full transition-all duration-300\"\n style={{\n width: `${percentage}%`,\n backgroundColor: color,\n }}\n />\n </div>\n </div>\n );\n })}\n </div>\n </div>\n );\n}\n"],"mappings":";;;AAWA,IAAM,IAAyC;CAC7C,QAAQ;CACR,MAAM;CACN,QAAQ;CACR,KAAK;CACN;AAED,SAAgB,EAAkB,EAAE,WAAgC;CAClE,IAAM,IAAQ,EAAK,QAAQ,GAAK,MAAS,IAAM,EAAK,OAAO,EAAE;AAE7D,QACE,kBAAC,OAAD;EAAK,WAAU;YAAf,CACE,kBAAC,MAAD;GAAI,WAAU;aAAd,CACE,kBAAC,GAAD,EAAa,MAAM,IAAM,CAAA,EAAA,sBAEtB;MAEL,kBAAC,OAAD;GAAK,WAAU;aACZ,EAAK,KAAK,MAAS;IAClB,IAAM,IAAa,IAAQ,IAAK,EAAK,QAAQ,IAAS,MAAM,GACtD,IAAQ,EAAe,EAAK,aAAa,KAAA;AAE/C,WACE,kBAAC,OAAD,EAAA,UAAA,CACE,kBAAC,OAAD;KAAK,WAAU;eAAf,CACE,kBAAC,OAAD;MAAK,WAAU;gBAAf,CACE,kBAAC,OAAD;OAAK,WAAU;OAAuB,OAAO,EAAE,iBAAiB,GAAO;OAAI,CAAA,EAC3E,kBAAC,QAAD;OAAM,WAAU;iBAA4B,EAAK;OAAgB,CAAA,CAC7D;SACN,kBAAC,OAAD;MAAK,WAAU;gBAAf,CACE,kBAAC,QAAD;OAAM,WAAU;iBAAhB,CAAyC,EAAW,QAAQ,EAAE,EAAC,IAAQ;UACvE,kBAAC,QAAD;OAAM,WAAU;iBAA8B,EAAK;OAAa,CAAA,CAC5D;QACF;QACN,kBAAC,OAAD;KAAK,WAAU;eACb,kBAAC,OAAD;MACE,WAAU;MACV,OAAO;OACL,OAAO,GAAG,EAAW;OACrB,iBAAiB;OAClB;MACD,CAAA;KACE,CAAA,CACF,EAAA,EApBI,EAAK,SAoBT;KAER;GACE,CAAA,CACF"}
@@ -0,0 +1,110 @@
1
+ import { AlertTriangle as e, Shield as t } from "lucide-react";
2
+ import { jsx as n, jsxs as r } from "react/jsx-runtime";
3
+ //#region src/support/components/analytics/SLAReport.tsx
4
+ function i({ report: i }) {
5
+ return /* @__PURE__ */ r("div", {
6
+ className: "p-6 rounded-lg border border-default bg-surface transition-all duration-200 hover:shadow-sm animate-in fade-in-0 slide-in-from-bottom-2",
7
+ children: [
8
+ /* @__PURE__ */ r("h2", {
9
+ className: "text-xl font-semibold mb-4 flex items-center gap-2 text-primary",
10
+ children: [/* @__PURE__ */ n(t, { size: 20 }), "SLA Compliance Report"]
11
+ }),
12
+ /* @__PURE__ */ r("div", {
13
+ className: "grid grid-cols-1 md:grid-cols-2 lg:grid-cols-4 gap-4 mb-6",
14
+ children: [
15
+ /* @__PURE__ */ r("div", {
16
+ className: "p-4 rounded-lg bg-muted transition-colors duration-200",
17
+ children: [
18
+ /* @__PURE__ */ n("p", {
19
+ className: "text-xs font-medium mb-1 text-tertiary",
20
+ children: "First Response"
21
+ }),
22
+ /* @__PURE__ */ r("p", {
23
+ className: `text-2xl font-bold ${i.firstResponseCompliance >= 90 ? "text-success" : "text-warning"}`,
24
+ children: [i.firstResponseCompliance.toFixed(1), "%"]
25
+ }),
26
+ /* @__PURE__ */ r("p", {
27
+ className: "text-xs mt-1 text-tertiary",
28
+ children: [
29
+ "Avg: ",
30
+ (i.avgFirstResponseTime / 60).toFixed(1),
31
+ "h"
32
+ ]
33
+ })
34
+ ]
35
+ }),
36
+ /* @__PURE__ */ r("div", {
37
+ className: "p-4 rounded-lg bg-muted transition-colors duration-200",
38
+ children: [
39
+ /* @__PURE__ */ n("p", {
40
+ className: "text-xs font-medium mb-1 text-tertiary",
41
+ children: "Resolution"
42
+ }),
43
+ /* @__PURE__ */ r("p", {
44
+ className: `text-2xl font-bold ${i.resolutionCompliance >= 90 ? "text-success" : "text-warning"}`,
45
+ children: [i.resolutionCompliance.toFixed(1), "%"]
46
+ }),
47
+ /* @__PURE__ */ r("p", {
48
+ className: "text-xs mt-1 text-tertiary",
49
+ children: [
50
+ "Avg: ",
51
+ (i.avgResolutionTime / 60).toFixed(1),
52
+ "h"
53
+ ]
54
+ })
55
+ ]
56
+ }),
57
+ /* @__PURE__ */ r("div", {
58
+ className: "p-4 rounded-lg bg-muted transition-colors duration-200",
59
+ children: [/* @__PURE__ */ n("p", {
60
+ className: "text-xs font-medium mb-1 text-tertiary",
61
+ children: "Total Tickets"
62
+ }), /* @__PURE__ */ n("p", {
63
+ className: "text-2xl font-bold text-primary",
64
+ children: i.totalTickets
65
+ })]
66
+ }),
67
+ /* @__PURE__ */ r("div", {
68
+ className: `p-4 rounded-lg flex items-center gap-2 transition-colors duration-200 ${i.breachedTickets > 0 ? "bg-error/10" : "bg-muted"}`,
69
+ children: [/* @__PURE__ */ n(e, {
70
+ size: 20,
71
+ className: i.breachedTickets > 0 ? "text-error" : "text-tertiary"
72
+ }), /* @__PURE__ */ r("div", { children: [/* @__PURE__ */ n("p", {
73
+ className: "text-xs font-medium text-tertiary",
74
+ children: "Breached"
75
+ }), /* @__PURE__ */ n("p", {
76
+ className: `text-2xl font-bold ${i.breachedTickets > 0 ? "text-error" : "text-primary"}`,
77
+ children: i.breachedTickets
78
+ })] })]
79
+ })
80
+ ]
81
+ }),
82
+ /* @__PURE__ */ r("div", { children: [/* @__PURE__ */ n("h3", {
83
+ className: "text-sm font-semibold mb-3 text-secondary",
84
+ children: "Compliance by Priority"
85
+ }), /* @__PURE__ */ n("div", {
86
+ className: "space-y-2",
87
+ children: i.byPriority.map((e) => /* @__PURE__ */ r("div", {
88
+ className: "flex items-center justify-between py-2 px-3 rounded bg-muted transition-colors duration-200 hover:bg-muted/80",
89
+ children: [/* @__PURE__ */ r("div", {
90
+ className: "flex items-center gap-3",
91
+ children: [/* @__PURE__ */ n("span", {
92
+ className: "text-sm font-medium text-primary",
93
+ children: e.priority
94
+ }), /* @__PURE__ */ r("span", {
95
+ className: "text-xs text-tertiary",
96
+ children: [e.tickets, " tickets"]
97
+ })]
98
+ }), /* @__PURE__ */ r("span", {
99
+ className: `text-sm font-semibold ${e.compliance >= 90 ? "text-success" : e.compliance >= 70 ? "text-warning" : "text-error"}`,
100
+ children: [e.compliance.toFixed(1), "%"]
101
+ })]
102
+ }, e.priority))
103
+ })] })
104
+ ]
105
+ });
106
+ }
107
+ //#endregion
108
+ export { i as SLAReport };
109
+
110
+ //# sourceMappingURL=SLAReport.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"SLAReport.js","names":[],"sources":["../../../../src/support/components/analytics/SLAReport.tsx"],"sourcesContent":["import { Shield, AlertTriangle } from 'lucide-react';\n\ninterface SLAComplianceByPriority {\n priority: string;\n tickets: number;\n compliance: number;\n}\n\ninterface SLAReportProps {\n report: {\n period: {\n startDate: string;\n endDate: string;\n label: string;\n };\n totalTickets: number;\n firstResponseCompliance: number;\n resolutionCompliance: number;\n avgFirstResponseTime: number;\n avgResolutionTime: number;\n breachedTickets: number;\n byPriority: SLAComplianceByPriority[];\n };\n}\n\nexport function SLAReport({ report }: SLAReportProps) {\n return (\n <div className=\"p-6 rounded-lg border border-default bg-surface transition-all duration-200 hover:shadow-sm animate-in fade-in-0 slide-in-from-bottom-2\">\n <h2 className=\"text-xl font-semibold mb-4 flex items-center gap-2 text-primary\">\n <Shield size={20} />\n SLA Compliance Report\n </h2>\n\n <div className=\"grid grid-cols-1 md:grid-cols-2 lg:grid-cols-4 gap-4 mb-6\">\n <div className=\"p-4 rounded-lg bg-muted transition-colors duration-200\">\n <p className=\"text-xs font-medium mb-1 text-tertiary\">First Response</p>\n <p\n className={`text-2xl font-bold ${\n report.firstResponseCompliance >= 90 ? 'text-success' : 'text-warning'\n }`}\n >\n {report.firstResponseCompliance.toFixed(1)}%\n </p>\n <p className=\"text-xs mt-1 text-tertiary\">\n Avg: {(report.avgFirstResponseTime / 60).toFixed(1)}h\n </p>\n </div>\n\n <div className=\"p-4 rounded-lg bg-muted transition-colors duration-200\">\n <p className=\"text-xs font-medium mb-1 text-tertiary\">Resolution</p>\n <p\n className={`text-2xl font-bold ${\n report.resolutionCompliance >= 90 ? 'text-success' : 'text-warning'\n }`}\n >\n {report.resolutionCompliance.toFixed(1)}%\n </p>\n <p className=\"text-xs mt-1 text-tertiary\">\n Avg: {(report.avgResolutionTime / 60).toFixed(1)}h\n </p>\n </div>\n\n <div className=\"p-4 rounded-lg bg-muted transition-colors duration-200\">\n <p className=\"text-xs font-medium mb-1 text-tertiary\">Total Tickets</p>\n <p className=\"text-2xl font-bold text-primary\">{report.totalTickets}</p>\n </div>\n\n <div\n className={`p-4 rounded-lg flex items-center gap-2 transition-colors duration-200 ${\n report.breachedTickets > 0 ? 'bg-error/10' : 'bg-muted'\n }`}\n >\n <AlertTriangle\n size={20}\n className={report.breachedTickets > 0 ? 'text-error' : 'text-tertiary'}\n />\n <div>\n <p className=\"text-xs font-medium text-tertiary\">Breached</p>\n <p\n className={`text-2xl font-bold ${\n report.breachedTickets > 0 ? 'text-error' : 'text-primary'\n }`}\n >\n {report.breachedTickets}\n </p>\n </div>\n </div>\n </div>\n\n <div>\n <h3 className=\"text-sm font-semibold mb-3 text-secondary\">Compliance by Priority</h3>\n <div className=\"space-y-2\">\n {report.byPriority.map((item) => (\n <div\n key={item.priority}\n className=\"flex items-center justify-between py-2 px-3 rounded bg-muted transition-colors duration-200 hover:bg-muted/80\"\n >\n <div className=\"flex items-center gap-3\">\n <span className=\"text-sm font-medium text-primary\">{item.priority}</span>\n <span className=\"text-xs text-tertiary\">{item.tickets} tickets</span>\n </div>\n <span\n className={`text-sm font-semibold ${\n item.compliance >= 90\n ? 'text-success'\n : item.compliance >= 70\n ? 'text-warning'\n : 'text-error'\n }`}\n >\n {item.compliance.toFixed(1)}%\n </span>\n </div>\n ))}\n </div>\n </div>\n </div>\n );\n}\n"],"mappings":";;;AAyBA,SAAgB,EAAU,EAAE,aAA0B;AACpD,QACE,kBAAC,OAAD;EAAK,WAAU;YAAf;GACE,kBAAC,MAAD;IAAI,WAAU;cAAd,CACE,kBAAC,GAAD,EAAQ,MAAM,IAAM,CAAA,EAAA,wBAEjB;;GAEL,kBAAC,OAAD;IAAK,WAAU;cAAf;KACE,kBAAC,OAAD;MAAK,WAAU;gBAAf;OACE,kBAAC,KAAD;QAAG,WAAU;kBAAyC;QAAkB,CAAA;OACxE,kBAAC,KAAD;QACE,WAAW,sBACT,EAAO,2BAA2B,KAAK,iBAAiB;kBAF5D,CAKG,EAAO,wBAAwB,QAAQ,EAAE,EAAC,IACzC;;OACJ,kBAAC,KAAD;QAAG,WAAU;kBAAb;SAA0C;UACjC,EAAO,uBAAuB,IAAI,QAAQ,EAAE;SAAC;SAClD;;OACA;;KAEN,kBAAC,OAAD;MAAK,WAAU;gBAAf;OACE,kBAAC,KAAD;QAAG,WAAU;kBAAyC;QAAc,CAAA;OACpE,kBAAC,KAAD;QACE,WAAW,sBACT,EAAO,wBAAwB,KAAK,iBAAiB;kBAFzD,CAKG,EAAO,qBAAqB,QAAQ,EAAE,EAAC,IACtC;;OACJ,kBAAC,KAAD;QAAG,WAAU;kBAAb;SAA0C;UACjC,EAAO,oBAAoB,IAAI,QAAQ,EAAE;SAAC;SAC/C;;OACA;;KAEN,kBAAC,OAAD;MAAK,WAAU;gBAAf,CACE,kBAAC,KAAD;OAAG,WAAU;iBAAyC;OAAiB,CAAA,EACvE,kBAAC,KAAD;OAAG,WAAU;iBAAmC,EAAO;OAAiB,CAAA,CACpE;;KAEN,kBAAC,OAAD;MACE,WAAW,yEACT,EAAO,kBAAkB,IAAI,gBAAgB;gBAFjD,CAKE,kBAAC,GAAD;OACE,MAAM;OACN,WAAW,EAAO,kBAAkB,IAAI,eAAe;OACvD,CAAA,EACF,kBAAC,OAAD,EAAA,UAAA,CACE,kBAAC,KAAD;OAAG,WAAU;iBAAoC;OAAY,CAAA,EAC7D,kBAAC,KAAD;OACE,WAAW,sBACT,EAAO,kBAAkB,IAAI,eAAe;iBAG7C,EAAO;OACN,CAAA,CACA,EAAA,CAAA,CACF;;KACF;;GAEN,kBAAC,OAAD,EAAA,UAAA,CACE,kBAAC,MAAD;IAAI,WAAU;cAA4C;IAA2B,CAAA,EACrF,kBAAC,OAAD;IAAK,WAAU;cACZ,EAAO,WAAW,KAAK,MACtB,kBAAC,OAAD;KAEE,WAAU;eAFZ,CAIE,kBAAC,OAAD;MAAK,WAAU;gBAAf,CACE,kBAAC,QAAD;OAAM,WAAU;iBAAoC,EAAK;OAAgB,CAAA,EACzE,kBAAC,QAAD;OAAM,WAAU;iBAAhB,CAAyC,EAAK,SAAQ,WAAe;SACjE;SACN,kBAAC,QAAD;MACE,WAAW,yBACT,EAAK,cAAc,KACf,iBACA,EAAK,cAAc,KACjB,iBACA;gBANV,CASG,EAAK,WAAW,QAAQ,EAAE,EAAC,IACvB;QACH;OAlBC,EAAK,SAkBN,CACN;IACE,CAAA,CACF,EAAA,CAAA;GACF"}