@burdenoff/microfe-notification 2026.1125.1 → 2026.1129.1

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 (161) hide show
  1. package/dist/NotificationRoutes.d.ts +10 -0
  2. package/dist/NotificationRoutes.js +76 -71
  3. package/dist/NotificationRoutes.js.map +1 -1
  4. package/dist/components/NotificationPanel.js +0 -1
  5. package/dist/components/NotificationPanel.js.map +1 -1
  6. package/dist/generated/global-operations.d.ts +58 -3
  7. package/dist/generated/global-operations.js +31 -23
  8. package/dist/generated/global-operations.js.map +1 -1
  9. package/dist/generated/global-types.d.ts +10933 -581
  10. package/dist/graphql/global-client.js +34 -34
  11. package/dist/hooks/useNotificationAnalytics.d.ts +1 -1
  12. package/dist/hooks/useNotificationAnalytics.js.map +1 -1
  13. package/dist/hooks/useNotifications.d.ts +7 -0
  14. package/dist/hooks/useNotifications.js +1 -1
  15. package/dist/hooks/useNotifications.js.map +1 -1
  16. package/dist/index.js +9 -11
  17. package/dist/navigation-v2/NotificationArchivedV2.js +7 -8
  18. package/dist/navigation-v2/NotificationArchivedV2.js.map +1 -1
  19. package/dist/navigation-v2/NotificationInboxV2.js +8 -9
  20. package/dist/navigation-v2/NotificationInboxV2.js.map +1 -1
  21. package/dist/navigation-v2/NotificationSettingsV2.js +0 -1
  22. package/dist/navigation-v2/NotificationSettingsV2.js.map +1 -1
  23. package/dist/pages/NotificationCenterPage.js +5 -6
  24. package/dist/pages/NotificationCenterPage.js.map +1 -1
  25. package/dist/pages/NotificationHistoryAdminPage.js +9 -10
  26. package/dist/pages/NotificationHistoryAdminPage.js.map +1 -1
  27. package/dist/pages/NotificationHistoryPage.js +5 -6
  28. package/dist/pages/NotificationHistoryPage.js.map +1 -1
  29. package/dist/pages/NotificationPreferencesPage.js +0 -1
  30. package/dist/pages/NotificationPreferencesPage.js.map +1 -1
  31. package/dist/pages/NotificationTopicsPage.js +0 -1
  32. package/dist/pages/NotificationTopicsPage.js.map +1 -1
  33. package/dist/translations/en.d.ts +80 -0
  34. package/dist/types/index.d.ts +2 -1
  35. package/dist/v2/ArchivedRedirect.d.ts +1 -0
  36. package/dist/v2/ArchivedRedirect.js +14 -0
  37. package/dist/v2/ArchivedRedirect.js.map +1 -0
  38. package/dist/v2/InboxPage.d.ts +1 -0
  39. package/dist/v2/InboxPage.js +191 -0
  40. package/dist/v2/InboxPage.js.map +1 -0
  41. package/dist/v2/InboxRows.d.ts +10 -0
  42. package/dist/v2/InboxRows.js +101 -0
  43. package/dist/v2/InboxRows.js.map +1 -0
  44. package/dist/v2/KindIcon.d.ts +4 -0
  45. package/dist/v2/KindIcon.js +33 -0
  46. package/dist/v2/KindIcon.js.map +1 -0
  47. package/dist/v2/NotificationDetailPanel.d.ts +7 -0
  48. package/dist/v2/NotificationDetailPanel.js +200 -0
  49. package/dist/v2/NotificationDetailPanel.js.map +1 -0
  50. package/dist/v2/PreferencesPage.d.ts +1 -0
  51. package/dist/v2/PreferencesPage.js +139 -0
  52. package/dist/v2/PreferencesPage.js.map +1 -0
  53. package/dist/v2/__tests__/routeShapes.d.ts +13 -0
  54. package/dist/v2/model/days.d.ts +9 -0
  55. package/dist/v2/model/days.js +25 -0
  56. package/dist/v2/model/days.js.map +1 -0
  57. package/dist/v2/model/events.d.ts +17 -0
  58. package/dist/v2/model/events.js +72 -0
  59. package/dist/v2/model/events.js.map +1 -0
  60. package/dist/v2/model/icons.d.ts +6 -0
  61. package/dist/v2/model/icons.js +19 -0
  62. package/dist/v2/model/icons.js.map +1 -0
  63. package/dist/v2/model/inbox.d.ts +15 -0
  64. package/dist/v2/model/inbox.js +22 -0
  65. package/dist/v2/model/inbox.js.map +1 -0
  66. package/dist/v2/model/thing.d.ts +16 -0
  67. package/dist/v2/model/thing.js +41 -0
  68. package/dist/v2/model/thing.js.map +1 -0
  69. package/dist/v2/model/tr.d.ts +2 -0
  70. package/dist/v2/useNotificationDetail.d.ts +19 -0
  71. package/dist/v2/useNotificationDetail.js +65 -0
  72. package/dist/v2/useNotificationDetail.js.map +1 -0
  73. package/package.json +5 -2
  74. package/dist/components/index.js +0 -4
  75. package/dist/hooks/index.js +0 -8
  76. package/dist/node_modules/@apollo/client/errors/CombinedGraphQLErrors.js +0 -23
  77. package/dist/node_modules/@apollo/client/errors/CombinedGraphQLErrors.js.map +0 -1
  78. package/dist/node_modules/@apollo/client/errors/utils.js +0 -15
  79. package/dist/node_modules/@apollo/client/errors/utils.js.map +0 -1
  80. package/dist/node_modules/@apollo/client/link/core/ApolloLink.js +0 -51
  81. package/dist/node_modules/@apollo/client/link/core/ApolloLink.js.map +0 -1
  82. package/dist/node_modules/@apollo/client/link/subscriptions/index.js +0 -40
  83. package/dist/node_modules/@apollo/client/link/subscriptions/index.js.map +0 -1
  84. package/dist/node_modules/@apollo/client/link/utils/createOperation.js +0 -33
  85. package/dist/node_modules/@apollo/client/link/utils/createOperation.js.map +0 -1
  86. package/dist/node_modules/@apollo/client/utilities/caching/sizes.js +0 -5
  87. package/dist/node_modules/@apollo/client/utilities/caching/sizes.js.map +0 -1
  88. package/dist/node_modules/@apollo/client/utilities/graphql/print.js +0 -15
  89. package/dist/node_modules/@apollo/client/utilities/graphql/print.js.map +0 -1
  90. package/dist/node_modules/@apollo/client/utilities/internal/caches.js +0 -18
  91. package/dist/node_modules/@apollo/client/utilities/internal/caches.js.map +0 -1
  92. package/dist/node_modules/@apollo/client/utilities/internal/checkDocument.js +0 -20
  93. package/dist/node_modules/@apollo/client/utilities/internal/checkDocument.js.map +0 -1
  94. package/dist/node_modules/@apollo/client/utilities/internal/getMainDefinition.js +0 -16
  95. package/dist/node_modules/@apollo/client/utilities/internal/getMainDefinition.js.map +0 -1
  96. package/dist/node_modules/@apollo/client/utilities/internal/getMemoryInternals.js +0 -8
  97. package/dist/node_modules/@apollo/client/utilities/internal/getMemoryInternals.js.map +0 -1
  98. package/dist/node_modules/@apollo/client/utilities/internal/getOperationDefinition.js +0 -8
  99. package/dist/node_modules/@apollo/client/utilities/internal/getOperationDefinition.js.map +0 -1
  100. package/dist/node_modules/@apollo/client/utilities/internal/getOperationName.js +0 -7
  101. package/dist/node_modules/@apollo/client/utilities/internal/getOperationName.js.map +0 -1
  102. package/dist/node_modules/@apollo/client/utilities/internal/globals/global.js +0 -8
  103. package/dist/node_modules/@apollo/client/utilities/internal/globals/global.js.map +0 -1
  104. package/dist/node_modules/@apollo/client/utilities/internal/globals/maybe.js +0 -9
  105. package/dist/node_modules/@apollo/client/utilities/internal/globals/maybe.js.map +0 -1
  106. package/dist/node_modules/@apollo/client/utilities/internal/isNonNullObject.js +0 -7
  107. package/dist/node_modules/@apollo/client/utilities/internal/isNonNullObject.js.map +0 -1
  108. package/dist/node_modules/@apollo/client/utilities/internal/makeUniqueId.js +0 -9
  109. package/dist/node_modules/@apollo/client/utilities/internal/makeUniqueId.js.map +0 -1
  110. package/dist/node_modules/@apollo/client/utilities/internal/memoize.js +0 -22
  111. package/dist/node_modules/@apollo/client/utilities/internal/memoize.js.map +0 -1
  112. package/dist/node_modules/@apollo/client/utilities/internal/stringifyForDisplay.js +0 -9
  113. package/dist/node_modules/@apollo/client/utilities/internal/stringifyForDisplay.js.map +0 -1
  114. package/dist/node_modules/@apollo/client/utilities/invariant/index.js +0 -56
  115. package/dist/node_modules/@apollo/client/utilities/invariant/index.js.map +0 -1
  116. package/dist/node_modules/@apollo/client/version.js +0 -5
  117. package/dist/node_modules/@apollo/client/version.js.map +0 -1
  118. package/dist/node_modules/@wry/caches/lib/weak.js +0 -66
  119. package/dist/node_modules/@wry/caches/lib/weak.js.map +0 -1
  120. package/dist/node_modules/@wry/trie/lib/index.js +0 -52
  121. package/dist/node_modules/@wry/trie/lib/index.js.map +0 -1
  122. package/dist/node_modules/graphql-ws/dist/client.js +0 -279
  123. package/dist/node_modules/graphql-ws/dist/client.js.map +0 -1
  124. package/dist/node_modules/graphql-ws/dist/common-CGW11Fyb.js +0 -61
  125. package/dist/node_modules/graphql-ws/dist/common-CGW11Fyb.js.map +0 -1
  126. package/dist/node_modules/rxjs/dist/esm5/internal/NotificationFactories.js +0 -20
  127. package/dist/node_modules/rxjs/dist/esm5/internal/NotificationFactories.js.map +0 -1
  128. package/dist/node_modules/rxjs/dist/esm5/internal/Observable.js +0 -77
  129. package/dist/node_modules/rxjs/dist/esm5/internal/Observable.js.map +0 -1
  130. package/dist/node_modules/rxjs/dist/esm5/internal/Subscriber.js +0 -116
  131. package/dist/node_modules/rxjs/dist/esm5/internal/Subscriber.js.map +0 -1
  132. package/dist/node_modules/rxjs/dist/esm5/internal/Subscription.js +0 -96
  133. package/dist/node_modules/rxjs/dist/esm5/internal/Subscription.js.map +0 -1
  134. package/dist/node_modules/rxjs/dist/esm5/internal/config.js +0 -11
  135. package/dist/node_modules/rxjs/dist/esm5/internal/config.js.map +0 -1
  136. package/dist/node_modules/rxjs/dist/esm5/internal/observable/empty.js +0 -8
  137. package/dist/node_modules/rxjs/dist/esm5/internal/observable/empty.js.map +0 -1
  138. package/dist/node_modules/rxjs/dist/esm5/internal/scheduler/timeoutProvider.js +0 -15
  139. package/dist/node_modules/rxjs/dist/esm5/internal/scheduler/timeoutProvider.js.map +0 -1
  140. package/dist/node_modules/rxjs/dist/esm5/internal/symbol/observable.js +0 -7
  141. package/dist/node_modules/rxjs/dist/esm5/internal/symbol/observable.js.map +0 -1
  142. package/dist/node_modules/rxjs/dist/esm5/internal/util/UnsubscriptionError.js +0 -12
  143. package/dist/node_modules/rxjs/dist/esm5/internal/util/UnsubscriptionError.js.map +0 -1
  144. package/dist/node_modules/rxjs/dist/esm5/internal/util/arrRemove.js +0 -10
  145. package/dist/node_modules/rxjs/dist/esm5/internal/util/arrRemove.js.map +0 -1
  146. package/dist/node_modules/rxjs/dist/esm5/internal/util/createErrorClass.js +0 -10
  147. package/dist/node_modules/rxjs/dist/esm5/internal/util/createErrorClass.js.map +0 -1
  148. package/dist/node_modules/rxjs/dist/esm5/internal/util/errorContext.js +0 -21
  149. package/dist/node_modules/rxjs/dist/esm5/internal/util/errorContext.js.map +0 -1
  150. package/dist/node_modules/rxjs/dist/esm5/internal/util/identity.js +0 -7
  151. package/dist/node_modules/rxjs/dist/esm5/internal/util/identity.js.map +0 -1
  152. package/dist/node_modules/rxjs/dist/esm5/internal/util/isFunction.js +0 -7
  153. package/dist/node_modules/rxjs/dist/esm5/internal/util/isFunction.js.map +0 -1
  154. package/dist/node_modules/rxjs/dist/esm5/internal/util/noop.js +0 -5
  155. package/dist/node_modules/rxjs/dist/esm5/internal/util/noop.js.map +0 -1
  156. package/dist/node_modules/rxjs/dist/esm5/internal/util/pipe.js +0 -12
  157. package/dist/node_modules/rxjs/dist/esm5/internal/util/pipe.js.map +0 -1
  158. package/dist/node_modules/rxjs/dist/esm5/internal/util/reportUnhandledError.js +0 -13
  159. package/dist/node_modules/rxjs/dist/esm5/internal/util/reportUnhandledError.js.map +0 -1
  160. package/dist/node_modules/tslib/tslib.es6.js +0 -51
  161. package/dist/node_modules/tslib/tslib.es6.js.map +0 -1
@@ -1 +1 @@
1
- {"version":3,"file":"NotificationHistoryAdminPage.js","names":["_Fragment","formatDateTime","value","NotificationHistoryAdminPage","tr","useTr","permissionsLoading","usePermissions","useNotificationTopics","useNotificationAdmin","rescheduleAt","setRescheduleAt","useState","SectionLoaderOr","CompactMarkOr","hasPermission","NOTIFICATION_PERMISSIONS","PagePurpose","CalendarClock","NextSteps","notifications","loadNotification","setFilters","prev","exportNotificationsAsCsv","Button","Download","GlassCard","Search","filters","event","ThemedSelect","topics","topic","EmphasisPanel","isLoading","RefreshCw","IllustratedEmptyState","notification","NotificationCard","scheduledNotifications","scheduled","cancelScheduledNotification","selectedNotification","clearSelection","item","action","Fragment","rescheduleNotification","unarchiveNotification","archiveNotification","events","ShowMore"],"sources":["../../src/pages/NotificationHistoryAdminPage.tsx"],"sourcesContent":["import { useState } from 'react';\nimport { CalendarClock, Download, RefreshCw, Search } from 'lucide-react';\nimport { usePermissions } from '@burdenoff/fe-libs/shared/providers/shell';\nimport {\n Button,\n EmphasisPanel,\n GlassCard,\n IllustratedEmptyState,\n NextSteps,\n PagePurpose,\n ShowMore,\n ThemedSelect,\n} from '@burdenoff/fe-libs/ui';\nimport { NotificationCard } from '../components/NotificationCard';\nimport { useNotificationAdmin, useNotificationTopics } from '../hooks';\nimport { NOTIFICATION_PERMISSIONS } from '../constants/permissions';\nimport { useTr } from '../shared/hooks/useTr';\nimport { exportNotificationsAsCsv } from '../utils/notificationHistoryExport';\nimport { CompactMarkOr, SectionLoaderOr } from '../components/loadingSystem';\n\nfunction formatDateTime(value?: string | null) {\n if (!value) return '—';\n return new Date(value).toLocaleString();\n}\n\n/** Admin Notification History — scheduled ops, delivery inspector, event timeline. */\nexport function NotificationHistoryAdminPage() {\n const tr = useTr();\n const { hasPermission, isLoading: permissionsLoading } = usePermissions();\n const { topics } = useNotificationTopics();\n const {\n filters,\n setFilters,\n notifications,\n scheduledNotifications,\n selectedNotification,\n events,\n isLoading,\n loadNotification,\n archiveNotification,\n unarchiveNotification,\n cancelScheduledNotification,\n rescheduleNotification,\n clearSelection,\n } = useNotificationAdmin();\n const [rescheduleAt, setRescheduleAt] = useState('');\n\n if (permissionsLoading) {\n return (\n <SectionLoaderOr\n minHeight=\"16rem\"\n today={\n <div className=\"flex h-64 items-center justify-center\">\n <CompactMarkOr\n className=\"h-8 w-8\"\n today={\n <div className=\"h-8 w-8 animate-spin rounded-full border-4 border-primary border-t-transparent\" />\n }\n />\n </div>\n }\n />\n );\n }\n\n if (!hasPermission(NOTIFICATION_PERMISSIONS.NOTIFICATION_LIST)) {\n return (\n <div className=\"p-8 text-center text-text-secondary\">\n {tr(\n 'notifications.noPermissionHistory',\n \"You don't have permission to view notification history.\"\n )}\n </div>\n );\n }\n\n return (\n <div className=\"space-y-4 sm:space-y-6\">\n <PagePurpose icon={<CalendarClock size={16} />}>\n {tr(\n 'notifications.adminHistoryPurpose',\n 'The operations console for everything your team has sent. Audit delivery outcomes (delivered, opened, clicked, failed, unsubscribed), inspect a single notification’s full event timeline, and manage the schedule — reschedule or cancel anything still pending. Use it to debug a campaign or prove a notification went out.'\n )}\n </PagePurpose>\n\n <NextSteps\n storageKey=\"notification-admin-history\"\n steps={[\n {\n id: 'inspect',\n label: tr('notifications.nextInspectLabel', 'Inspect a delivery'),\n description: tr(\n 'notifications.nextInspectDesc',\n 'Click any notification to see its receipts, opens, clicks and full event timeline.'\n ),\n onClick: () => {\n if (notifications[0]) {\n loadNotification(notifications[0].id);\n }\n },\n },\n {\n id: 'failed',\n label: tr('notifications.nextFailedLabel', 'Find failed deliveries'),\n description: tr(\n 'notifications.nextFailedDesc',\n 'Filter by a FAILED delivery state to triage what did not reach recipients.'\n ),\n onClick: () => setFilters((prev) => ({ ...prev, deliveryStatus: 'FAILED' })),\n },\n {\n id: 'export',\n label: tr('notifications.nextExportLabel', 'Export the current view'),\n description: tr(\n 'notifications.nextExportDesc',\n 'Download the filtered results as CSV for reporting or an external audit.'\n ),\n onClick: () => {\n if (notifications.length > 0) {\n exportNotificationsAsCsv(tr, notifications);\n }\n },\n },\n ]}\n />\n\n <div className=\"flex flex-col gap-4 sm:flex-row sm:items-center sm:justify-between\">\n <div>\n <h1 className=\"text-xl sm:text-2xl font-bold text-primary\">\n {tr('notifications.adminHistoryTitle', 'Notification Operations')}\n </h1>\n <p className=\"text-sm text-text-secondary mt-1\">\n {tr(\n 'notifications.adminHistorySubtitle',\n 'Review sent and scheduled notifications, delivery outcomes, opens, clicks, and user activity.'\n )}\n </p>\n </div>\n <Button\n type=\"button\"\n variant=\"outline\"\n onClick={() => exportNotificationsAsCsv(tr, notifications)}\n disabled={notifications.length === 0}\n className=\"gap-2\"\n >\n <Download size={16} />\n {tr('notifications.export', 'Export')}\n </Button>\n </div>\n\n <GlassCard treatment=\"plain\" className=\"grid gap-3 border-border-seam p-4 lg:grid-cols-6\">\n <label className=\"relative lg:col-span-2\">\n <Search size={16} className=\"absolute left-3 top-1/2 -translate-y-1/2 text-tertiary\" />\n <input\n type=\"text\"\n value={filters.search}\n onChange={(event) => setFilters((prev) => ({ ...prev, search: event.target.value }))}\n placeholder={tr(\n 'notifications.searchByTitleOrContent',\n 'Search by title or content...'\n )}\n className=\"w-full rounded-md border border-default bg-bg-canvas py-2 pl-9 pr-3 text-sm text-primary focus:outline-none focus:ring-2 focus:ring-accent\"\n />\n </label>\n\n <ThemedSelect\n value={filters.status}\n onChange={(event) => setFilters((prev) => ({ ...prev, status: event.target.value }))}\n className=\"rounded-md border border-default bg-bg-canvas px-3 py-2 text-sm text-primary scheme-normal dark:scheme-dark [&_option]:bg-bg-surface [&_option]:text-text-primary\"\n >\n <option value=\"all\">{tr('notifications.allStatuses', 'All Statuses')}</option>\n <option value=\"PENDING\">PENDING</option>\n <option value=\"TRIGGERED\">TRIGGERED</option>\n <option value=\"SENT\">SENT</option>\n <option value=\"FAILED\">FAILED</option>\n <option value=\"CANCELLED\">CANCELLED</option>\n </ThemedSelect>\n\n <ThemedSelect\n value={filters.channel}\n onChange={(event) => setFilters((prev) => ({ ...prev, channel: event.target.value }))}\n className=\"rounded-md border border-default bg-bg-canvas px-3 py-2 text-sm text-primary scheme-normal dark:scheme-dark [&_option]:bg-bg-surface [&_option]:text-text-primary\"\n >\n <option value=\"all\">{tr('notifications.allChannels', 'All Channels')}</option>\n <option value=\"EMAIL\">EMAIL</option>\n <option value=\"SMS\">SMS</option>\n <option value=\"PUSH\">PUSH</option>\n <option value=\"WHATSAPP\">WHATSAPP</option>\n <option value=\"IN_APP\">IN_APP</option>\n </ThemedSelect>\n\n <ThemedSelect\n value={filters.deliveryStatus}\n onChange={(event) =>\n setFilters((prev) => ({ ...prev, deliveryStatus: event.target.value }))\n }\n className=\"rounded-md border border-default bg-bg-canvas px-3 py-2 text-sm text-primary scheme-normal dark:scheme-dark [&_option]:bg-bg-surface [&_option]:text-text-primary\"\n >\n <option value=\"all\">{tr('notifications.allDeliveryStates', 'All Delivery')}</option>\n <option value=\"DELIVERED\">DELIVERED</option>\n <option value=\"OPENED\">OPENED</option>\n <option value=\"CLICKED\">CLICKED</option>\n <option value=\"FAILED\">FAILED</option>\n <option value=\"UNSUBSCRIBED\">UNSUBSCRIBED</option>\n </ThemedSelect>\n\n <ThemedSelect\n value={filters.topicId}\n onChange={(event) => setFilters((prev) => ({ ...prev, topicId: event.target.value }))}\n className=\"rounded-md border border-default bg-bg-canvas px-3 py-2 text-sm text-primary scheme-normal dark:scheme-dark [&_option]:bg-bg-surface [&_option]:text-text-primary\"\n >\n <option value=\"\">{tr('notifications.allTopics', 'All Topics')}</option>\n {topics.map((topic) => (\n <option key={topic.id} value={topic.id}>\n {topic.name}\n </option>\n ))}\n </ThemedSelect>\n\n <ThemedSelect\n value={filters.archived}\n onChange={(event) =>\n setFilters((prev) => ({\n ...prev,\n archived: event.target.value as typeof prev.archived,\n }))\n }\n className=\"rounded-md border border-default bg-bg-canvas px-3 py-2 text-sm text-primary scheme-normal dark:scheme-dark [&_option]:bg-bg-surface [&_option]:text-text-primary\"\n >\n <option value=\"all\">{tr('notifications.activeAndArchived', 'Active + Archived')}</option>\n <option value=\"active\">{tr('notifications.activeOnly', 'Active Only')}</option>\n <option value=\"archived\">{tr('notifications.archivedOnly', 'Archived Only')}</option>\n </ThemedSelect>\n </GlassCard>\n\n <div className=\"grid gap-6 xl:grid-cols-[minmax(0,1fr),420px]\">\n <div className=\"space-y-6\">\n {/* Single emphasis zone — the live results list is the heart of this console. */}\n <EmphasisPanel className=\"p-4\">\n <div className=\"mb-4 flex items-center justify-between\">\n <div>\n <h2 className=\"text-base font-semibold text-primary\">\n {tr('notifications.sentNotifications', 'Notifications')}\n </h2>\n <p className=\"text-sm text-text-secondary\">\n {notifications.length} {tr('notifications.resultsFoundShort', 'results')}\n </p>\n </div>\n {isLoading && (\n <CompactMarkOr\n today={<RefreshCw size={16} className=\"animate-spin text-tertiary\" />}\n />\n )}\n </div>\n\n <div className=\"space-y-3\">\n {notifications.length === 0 ? (\n <IllustratedEmptyState\n illustration=\"empty-search\"\n title={tr('notifications.noNotificationsFound', 'No notifications found')}\n description={tr(\n 'notifications.adjustSearchOrDateRange',\n 'Try adjusting your filters'\n )}\n kind=\"filtered\"\n />\n ) : (\n notifications.map((notification) => (\n <button\n key={notification.id}\n type=\"button\"\n onClick={() => loadNotification(notification.id)}\n className=\"block w-full text-left\"\n >\n <NotificationCard\n notification={notification}\n compact\n showArchivedState\n analyticsSource=\"admin_history\"\n />\n </button>\n ))\n )}\n </div>\n </EmphasisPanel>\n\n <section className=\"rounded-lg border border-border-seam bg-gloss-card p-4\">\n <div className=\"mb-4 flex items-center gap-2\">\n <CalendarClock size={18} className=\"text-accent-primary\" />\n <h2 className=\"text-base font-semibold text-primary\">\n {tr('notifications.scheduledNotifications', 'Scheduled Notifications')}\n </h2>\n </div>\n\n <div className=\"space-y-3\">\n {scheduledNotifications.length === 0 ? (\n <IllustratedEmptyState\n illustration=\"empty-data\"\n title={tr('notifications.noScheduledNotifications', 'No scheduled notifications')}\n description={tr(\n 'notifications.noScheduledDescription',\n 'Notifications queued for a future send time will appear here, ready to reschedule or cancel.'\n )}\n glassIllustration=\"calendar\"\n size=\"panel\"\n />\n ) : (\n scheduledNotifications.map((scheduled) => (\n <div\n key={scheduled.id}\n className=\"rounded-md border border-default bg-bg-canvas p-4\"\n >\n <div className=\"flex flex-col gap-3 sm:flex-row sm:items-center sm:justify-between\">\n <div>\n <h3 className=\"text-sm font-semibold text-primary\">\n {scheduled.notification.title}\n </h3>\n <p className=\"text-xs text-text-secondary\">\n {scheduled.notification.channel} • {scheduled.notification.type} •{' '}\n {formatDateTime(scheduled.scheduledFor)}\n </p>\n </div>\n <div className=\"flex items-center gap-2\">\n <button\n type=\"button\"\n onClick={() => loadNotification(scheduled.notification.id)}\n className=\"rounded-md border border-default px-3 py-2 text-xs text-text-secondary hover:bg-bg-sunken\"\n >\n {tr('notifications.view', 'View')}\n </button>\n {scheduled.status === 'PENDING' && (\n <button\n type=\"button\"\n onClick={() => cancelScheduledNotification(scheduled.id)}\n className=\"rounded-md border border-status-error-border px-3 py-2 text-xs text-status-error-text hover:bg-status-error-bg-subtle\"\n >\n {tr('notifications.cancel', 'Cancel')}\n </button>\n )}\n </div>\n </div>\n </div>\n ))\n )}\n </div>\n </section>\n </div>\n\n <aside className=\"rounded-lg border border-border-seam bg-gloss-card p-4 xl:sticky xl:top-4 xl:max-h-[calc(100vh-2rem)] xl:self-start xl:overflow-y-auto\">\n {selectedNotification ? (\n <div className=\"space-y-4\">\n <div className=\"flex items-start justify-between gap-3\">\n <div>\n <h2 className=\"text-lg font-semibold text-primary\">\n {selectedNotification.title}\n </h2>\n <p className=\"text-sm text-text-secondary\">{selectedNotification.body}</p>\n </div>\n <button\n type=\"button\"\n onClick={clearSelection}\n className=\"rounded-md border border-default px-3 py-2 text-xs text-text-secondary hover:bg-bg-sunken\"\n >\n {tr('notifications.close', 'Close')}\n </button>\n </div>\n\n <div className=\"grid gap-2 rounded-md border border-default bg-bg-canvas p-3 text-sm text-text-secondary\">\n <div>\n <strong>{tr('notifications.detail.status', 'Status')}:</strong>{' '}\n {selectedNotification.status}\n </div>\n <div>\n <strong>{tr('notifications.detail.delivery', 'Delivery')}:</strong>{' '}\n {selectedNotification.deliveryStatus || '—'}\n </div>\n <div>\n <strong>{tr('notifications.detail.topic', 'Topic')}:</strong>{' '}\n {selectedNotification.topic?.name || '—'}\n </div>\n <div>\n <strong>{tr('notifications.detail.created', 'Created')}:</strong>{' '}\n {formatDateTime(selectedNotification.createdAt)}\n </div>\n <div>\n <strong>{tr('notifications.detail.sent', 'Sent')}:</strong>{' '}\n {formatDateTime(selectedNotification.sentAt)}\n </div>\n <div>\n <strong>{tr('notifications.detail.delivered', 'Delivered')}:</strong>{' '}\n {formatDateTime(selectedNotification.deliveredAt)}\n </div>\n <div>\n <strong>{tr('notifications.detail.opened', 'Opened')}:</strong>{' '}\n {formatDateTime(selectedNotification.openedAt)}\n </div>\n <div>\n <strong>{tr('notifications.detail.clicked', 'Clicked')}:</strong>{' '}\n {formatDateTime(selectedNotification.clickedAt)}\n </div>\n <div>\n <strong>{tr('notifications.detail.read', 'Read')}:</strong>{' '}\n {formatDateTime(selectedNotification.readAt)}\n </div>\n <div>\n <strong>{tr('notifications.detail.recipient', 'Recipient')}:</strong>{' '}\n {selectedNotification.recipientEmail ||\n selectedNotification.recipientPhone ||\n selectedNotification.id}\n </div>\n </div>\n\n {selectedNotification.media.length > 0 && (\n <div className=\"space-y-2\">\n <h3 className=\"text-sm font-semibold text-primary\">\n {tr('notifications.media', 'Media')}\n </h3>\n <div className=\"grid gap-3\">\n {selectedNotification.media.map((item) => (\n <a\n key={item.url}\n href={item.url}\n target=\"_blank\"\n rel=\"noreferrer\"\n className=\"rounded-md border border-default bg-bg-canvas p-3 text-sm text-accent-primary hover:underline\"\n >\n {item.label || item.url}\n </a>\n ))}\n </div>\n </div>\n )}\n\n {selectedNotification.actions.length > 0 && (\n <div className=\"space-y-2\">\n <h3 className=\"text-sm font-semibold text-primary\">\n {tr('notifications.actions', 'Actions')}\n </h3>\n <div className=\"grid gap-2\">\n {selectedNotification.actions.map((action) => (\n <div\n key={action.id}\n className=\"rounded-md border border-default bg-bg-canvas p-3 text-sm text-text-secondary\"\n >\n <div className=\"font-medium text-primary\">{action.label}</div>\n <div className=\"truncate text-xs\">{action.url}</div>\n </div>\n ))}\n </div>\n </div>\n )}\n\n {selectedNotification.scheduledNotification && (\n <div className=\"space-y-3 rounded-md border border-default bg-bg-canvas p-3\">\n <div className=\"text-sm font-semibold text-primary\">\n {tr('notifications.scheduling', 'Scheduling')}\n </div>\n <div className=\"text-sm text-text-secondary\">\n {formatDateTime(selectedNotification.scheduledNotification.scheduledFor)}\n </div>\n {selectedNotification.scheduledNotification.status === 'PENDING' && (\n <>\n <input\n type=\"datetime-local\"\n value={rescheduleAt}\n onChange={(event) => setRescheduleAt(event.target.value)}\n className=\"w-full rounded-md border border-default bg-surface px-3 py-2 text-sm text-primary\"\n />\n <div className=\"flex items-center gap-2\">\n <button\n type=\"button\"\n onClick={() =>\n rescheduleAt &&\n rescheduleNotification(\n selectedNotification.scheduledNotification!.id,\n new Date(rescheduleAt).toISOString()\n )\n }\n className=\"rounded-md bg-accent-primary px-3 py-2 text-xs font-medium text-text-inverse hover:opacity-90\"\n >\n {tr('notifications.reschedule', 'Reschedule')}\n </button>\n <button\n type=\"button\"\n onClick={() =>\n cancelScheduledNotification(\n selectedNotification.scheduledNotification!.id\n )\n }\n className=\"rounded-md border border-status-error-border px-3 py-2 text-xs text-status-error-text hover:bg-status-error-bg-subtle\"\n >\n {tr('notifications.cancel', 'Cancel')}\n </button>\n </div>\n </>\n )}\n </div>\n )}\n\n <div className=\"flex items-center gap-2\">\n {selectedNotification.archivedAt ? (\n <button\n type=\"button\"\n onClick={() => unarchiveNotification(selectedNotification.id)}\n className=\"rounded-md border border-default px-3 py-2 text-xs text-text-secondary hover:bg-bg-sunken\"\n >\n {tr('notifications.restore', 'Restore')}\n </button>\n ) : (\n <button\n type=\"button\"\n onClick={() => archiveNotification(selectedNotification.id)}\n className=\"rounded-md border border-default px-3 py-2 text-xs text-text-secondary hover:bg-bg-sunken\"\n >\n {tr('notifications.archive', 'Archive')}\n </button>\n )}\n </div>\n\n <div className=\"space-y-2\">\n <h3 className=\"text-sm font-semibold text-primary\">\n {tr('notifications.eventTimeline', 'Event Timeline')}\n </h3>\n {events.length === 0 ? (\n <div className=\"rounded-md border border-dashed border-border-seam p-4 text-sm text-text-secondary\">\n {tr('notifications.noEvents', 'No events recorded yet.')}\n </div>\n ) : (\n <ShowMore collapsedHeight={180}>\n <div className=\"space-y-2\">\n {events.map((event) => (\n <div\n key={event.id}\n className=\"rounded-md border border-border-seam bg-surface p-3 text-sm text-text-secondary\"\n >\n <div className=\"font-medium text-primary\">{event.eventType}</div>\n <div>{formatDateTime(event.timestamp)}</div>\n {event.deliveryStatus && (\n <div>\n {tr('notifications.detail.delivery', 'Delivery')}:{' '}\n {event.deliveryStatus}\n </div>\n )}\n </div>\n ))}\n </div>\n </ShowMore>\n )}\n </div>\n </div>\n ) : (\n <div className=\"flex h-full min-h-[360px] items-center justify-center\">\n <IllustratedEmptyState\n illustration=\"empty-search\"\n title={tr('notifications.selectNotificationTitle', 'Nothing selected')}\n description={tr(\n 'notifications.selectNotificationForDetails',\n 'Select a notification to inspect details, delivery receipts, and activity.'\n )}\n glassIllustration=\"notifications\"\n size=\"panel\"\n />\n </div>\n )}\n </aside>\n </div>\n </div>\n );\n}\n"],"mappings":";;;;;;;;;;;;;;AAoBA,SAASC,EAAe,GAAuB;CAE7C,OADKC,IACE,IAAI,KAAKA,CAAK,CAAC,CAAC,eAAe,IADnB;AAErB;AAGA,SAAgBC,IAA+B;CAC7C,IAAMC,IAAKC,EAAM,GACX,EAAE,kBAAe,WAAWC,MAAuBC,EAAe,GAClE,EAAE,cAAWC,EAAsB,GACnC,EACJ,YACA,eACA,kBACA,2BACA,yBACA,WACA,cACA,qBACA,wBACA,0BACA,gCACA,2BACA,sBACEC,EAAqB,GACnB,CAACC,GAAcC,KAAmBC,EAAS,EAAE;CA+BnD,OA7BIN,IAEA,kBAACO,GAAD;EACE,WAAU;EACV,OACE,kBAAC,OAAD;GAAK,WAAU;GACb,UAAA,kBAACC,GAAD;IACE,WAAU;IACV,OACE,kBAAC,OAAD,EAAK,WAAU,iFAAkF,CAAA;GAEpG,CAAA;EACE,CAAA;CAER,CAAA,IAIAC,EAAcC,EAAyB,iBAAiB,IAY3D,kBAAC,OAAD;EAAK,WAAU;EAAf,UAAA;GACE,kBAACC,GAAD;IAAa,MAAM,kBAACC,GAAD,EAAe,MAAM,GAAK,CAAA;IAC1C,UAAAd,EACC,qCACA,gUACF;GACW,CAAA;GAEb,kBAACe,GAAD;IACE,YAAW;IACX,OAAO;KACL;MACE,IAAI;MACJ,OAAOf,EAAG,kCAAkC,oBAAoB;MAChE,aAAaA,EACX,iCACA,oFACF;MACA,eAAe;OACb,AAAIgB,EAAc,MAChBC,EAAiBD,EAAc,EAAE,CAAC,EAAE;MAExC;KACF;KACA;M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kBAAC,OAAD;UAAK,WAAU;UACZ,UAAAD,EAAO,KAAK,MACX,kBAAC,OAAD;WAEE,WAAU;WAFZ,UAAA;YAIE,kBAAC,OAAD;aAAK,WAAU;aAA4B,UAAArB,EAAM;YAAe,CAAA;YAChE,kBAAC,OAAD,EAAA,UAAM7B,EAAe6B,EAAM,SAAS,EAAO,CAAA;YAC1CA,EAAM,kBACL,kBAAC,OAAD,EAAA,UAAA;aACG1B,EAAG,iCAAiC,UAAU;aAAE;aAAE;aAClD0B,EAAM;YACJ,EAAA,CAAA;WAEJ;UAXE,GAAAA,EAAM,EAWR,CACN;SACE,CAAA;QACG,CAAA,CAET;;MACF;KAEL,CAAA,IAAA,kBAAC,OAAD;MAAK,WAAU;MACb,UAAA,kBAACO,GAAD;OACE,cAAa;OACb,OAAOjC,EAAG,yCAAyC,kBAAkB;OACrE,aAAaA,EACX,8CACA,4EACF;OACA,mBAAkB;OAClB,MAAK;MACN,CAAA;KACE,CAAA;IAEF,CAAA,CACJ;;EACF;C,KAnfH,kBAAC,OAAD;EAAK,WAAU;EACZ,UAAAA,EACC,qCACA,yDACF;CACG,CAAA;AAgfX"}
1
+ {"version":3,"file":"NotificationHistoryAdminPage.js","names":["_Fragment","formatDateTime","value","NotificationHistoryAdminPage","tr","useTr","permissionsLoading","usePermissions","useNotificationTopics","useNotificationAdmin","rescheduleAt","setRescheduleAt","useState","SectionLoaderOr","CompactMarkOr","hasPermission","NOTIFICATION_PERMISSIONS","PagePurpose","CalendarClock","NextSteps","notifications","loadNotification","setFilters","prev","exportNotificationsAsCsv","Button","Download","GlassCard","Search","filters","event","ThemedSelect","topics","topic","EmphasisPanel","isLoading","RefreshCw","IllustratedEmptyState","notification","NotificationCard","scheduledNotifications","scheduled","cancelScheduledNotification","selectedNotification","clearSelection","item","action","Fragment","rescheduleNotification","unarchiveNotification","archiveNotification","events","ShowMore"],"sources":["../../src/pages/NotificationHistoryAdminPage.tsx"],"sourcesContent":["import { useState } from 'react';\nimport { CalendarClock, Download, RefreshCw, Search } from 'lucide-react';\nimport { usePermissions } from '@burdenoff/fe-libs/shared/providers/shell';\nimport {\n Button,\n EmphasisPanel,\n GlassCard,\n IllustratedEmptyState,\n NextSteps,\n PagePurpose,\n ShowMore,\n ThemedSelect,\n} from '@burdenoff/fe-libs/ui';\nimport { NotificationCard } from '../components/NotificationCard';\nimport { useNotificationAdmin, useNotificationTopics } from '../hooks';\nimport { NOTIFICATION_PERMISSIONS } from '../constants/permissions';\nimport { useTr } from '../shared/hooks/useTr';\nimport { exportNotificationsAsCsv } from '../utils/notificationHistoryExport';\nimport { CompactMarkOr, SectionLoaderOr } from '../components/loadingSystem';\n\nfunction formatDateTime(value?: string | null) {\n if (!value) return '—';\n return new Date(value).toLocaleString();\n}\n\n/** Admin Notification History — scheduled ops, delivery inspector, event timeline. */\nexport function NotificationHistoryAdminPage() {\n const tr = useTr();\n const { hasPermission, isLoading: permissionsLoading } = usePermissions();\n const { topics } = useNotificationTopics();\n const {\n filters,\n setFilters,\n notifications,\n scheduledNotifications,\n selectedNotification,\n events,\n isLoading,\n loadNotification,\n archiveNotification,\n unarchiveNotification,\n cancelScheduledNotification,\n rescheduleNotification,\n clearSelection,\n } = useNotificationAdmin();\n const [rescheduleAt, setRescheduleAt] = useState('');\n\n if (permissionsLoading) {\n return (\n <SectionLoaderOr\n minHeight=\"16rem\"\n today={\n <div className=\"flex h-64 items-center justify-center\">\n <CompactMarkOr\n className=\"h-8 w-8\"\n today={\n <div className=\"h-8 w-8 animate-spin rounded-full border-4 border-primary border-t-transparent\" />\n }\n />\n </div>\n }\n />\n );\n }\n\n if (!hasPermission(NOTIFICATION_PERMISSIONS.NOTIFICATION_LIST)) {\n return (\n <div className=\"p-8 text-center text-text-secondary\">\n {tr(\n 'notifications.noPermissionHistory',\n \"You don't have permission to view notification history.\"\n )}\n </div>\n );\n }\n\n return (\n <div className=\"space-y-4 sm:space-y-6\">\n <PagePurpose icon={<CalendarClock size={16} />}>\n {tr(\n 'notifications.adminHistoryPurpose',\n 'The operations console for everything your team has sent. Audit delivery outcomes (delivered, opened, clicked, failed, unsubscribed), inspect a single notification’s full event timeline, and manage the schedule — reschedule or cancel anything still pending. Use it to debug a campaign or prove a notification went out.'\n )}\n </PagePurpose>\n\n <NextSteps\n storageKey=\"notification-admin-history\"\n steps={[\n {\n id: 'inspect',\n label: tr('notifications.nextInspectLabel', 'Inspect a delivery'),\n description: tr(\n 'notifications.nextInspectDesc',\n 'Click any notification to see its receipts, opens, clicks and full event timeline.'\n ),\n onClick: () => {\n if (notifications[0]) {\n loadNotification(notifications[0].id);\n }\n },\n },\n {\n id: 'failed',\n label: tr('notifications.nextFailedLabel', 'Find failed deliveries'),\n description: tr(\n 'notifications.nextFailedDesc',\n 'Filter by a FAILED delivery state to triage what did not reach recipients.'\n ),\n onClick: () => setFilters((prev) => ({ ...prev, deliveryStatus: 'FAILED' })),\n },\n {\n id: 'export',\n label: tr('notifications.nextExportLabel', 'Export the current view'),\n description: tr(\n 'notifications.nextExportDesc',\n 'Download the filtered results as CSV for reporting or an external audit.'\n ),\n onClick: () => {\n if (notifications.length > 0) {\n exportNotificationsAsCsv(tr, notifications);\n }\n },\n },\n ]}\n />\n\n <div className=\"flex flex-col gap-4 sm:flex-row sm:items-center sm:justify-between\">\n <div>\n <h1 className=\"text-xl sm:text-2xl font-bold text-primary\">\n {tr('notifications.adminHistoryTitle', 'Notification Operations')}\n </h1>\n <p className=\"text-sm text-text-secondary mt-1\">\n {tr(\n 'notifications.adminHistorySubtitle',\n 'Review sent and scheduled notifications, delivery outcomes, opens, clicks, and user activity.'\n )}\n </p>\n </div>\n <Button\n type=\"button\"\n variant=\"outline\"\n onClick={() => exportNotificationsAsCsv(tr, notifications)}\n disabled={notifications.length === 0}\n className=\"gap-2\"\n >\n <Download size={16} />\n {tr('notifications.export', 'Export')}\n </Button>\n </div>\n\n <GlassCard treatment=\"plain\" className=\"grid gap-3 border-border-seam p-4 lg:grid-cols-6\">\n <label className=\"relative lg:col-span-2\">\n <Search size={16} className=\"absolute left-3 top-1/2 -translate-y-1/2 text-tertiary\" />\n <input\n type=\"text\"\n value={filters.search}\n onChange={(event) => setFilters((prev) => ({ ...prev, search: event.target.value }))}\n placeholder={tr(\n 'notifications.searchByTitleOrContent',\n 'Search by title or content...'\n )}\n className=\"w-full rounded-md border border-default bg-bg-canvas py-2 pl-9 pr-3 text-sm text-primary focus:outline-none focus:ring-2 focus:ring-accent\"\n />\n </label>\n\n <ThemedSelect\n value={filters.status}\n onChange={(event) => setFilters((prev) => ({ ...prev, status: event.target.value }))}\n className=\"rounded-md border border-default bg-bg-canvas px-3 py-2 text-sm text-primary scheme-normal dark:scheme-dark [&_option]:bg-bg-surface [&_option]:text-text-primary\"\n >\n <option value=\"all\">{tr('notifications.allStatuses', 'All Statuses')}</option>\n <option value=\"PENDING\">PENDING</option>\n <option value=\"TRIGGERED\">TRIGGERED</option>\n <option value=\"SENT\">SENT</option>\n <option value=\"FAILED\">FAILED</option>\n <option value=\"CANCELLED\">CANCELLED</option>\n </ThemedSelect>\n\n <ThemedSelect\n value={filters.channel}\n onChange={(event) => setFilters((prev) => ({ ...prev, channel: event.target.value }))}\n className=\"rounded-md border border-default bg-bg-canvas px-3 py-2 text-sm text-primary scheme-normal dark:scheme-dark [&_option]:bg-bg-surface [&_option]:text-text-primary\"\n >\n <option value=\"all\">{tr('notifications.allChannels', 'All Channels')}</option>\n <option value=\"EMAIL\">EMAIL</option>\n <option value=\"SMS\">SMS</option>\n <option value=\"PUSH\">PUSH</option>\n <option value=\"WHATSAPP\">WHATSAPP</option>\n <option value=\"IN_APP\">IN_APP</option>\n </ThemedSelect>\n\n <ThemedSelect\n value={filters.deliveryStatus}\n onChange={(event) =>\n setFilters((prev) => ({ ...prev, deliveryStatus: event.target.value }))\n }\n className=\"rounded-md border border-default bg-bg-canvas px-3 py-2 text-sm text-primary scheme-normal dark:scheme-dark [&_option]:bg-bg-surface [&_option]:text-text-primary\"\n >\n <option value=\"all\">{tr('notifications.allDeliveryStates', 'All Delivery')}</option>\n <option value=\"DELIVERED\">DELIVERED</option>\n <option value=\"OPENED\">OPENED</option>\n <option value=\"CLICKED\">CLICKED</option>\n <option value=\"FAILED\">FAILED</option>\n <option value=\"UNSUBSCRIBED\">UNSUBSCRIBED</option>\n </ThemedSelect>\n\n <ThemedSelect\n value={filters.topicId}\n onChange={(event) => setFilters((prev) => ({ ...prev, topicId: event.target.value }))}\n className=\"rounded-md border border-default bg-bg-canvas px-3 py-2 text-sm text-primary scheme-normal dark:scheme-dark [&_option]:bg-bg-surface [&_option]:text-text-primary\"\n >\n <option value=\"\">{tr('notifications.allTopics', 'All Topics')}</option>\n {topics.map((topic) => (\n <option key={topic.id} value={topic.id}>\n {topic.name}\n </option>\n ))}\n </ThemedSelect>\n\n <ThemedSelect\n value={filters.archived}\n onChange={(event) =>\n setFilters((prev) => ({\n ...prev,\n archived: event.target.value as typeof prev.archived,\n }))\n }\n className=\"rounded-md border border-default bg-bg-canvas px-3 py-2 text-sm text-primary scheme-normal dark:scheme-dark [&_option]:bg-bg-surface [&_option]:text-text-primary\"\n >\n <option value=\"all\">{tr('notifications.activeAndArchived', 'Active + Archived')}</option>\n <option value=\"active\">{tr('notifications.activeOnly', 'Active Only')}</option>\n <option value=\"archived\">{tr('notifications.archivedOnly', 'Archived Only')}</option>\n </ThemedSelect>\n </GlassCard>\n\n <div className=\"grid gap-6 xl:grid-cols-[minmax(0,1fr),420px]\">\n <div className=\"space-y-6\">\n {/* Single emphasis zone — the live results list is the heart of this console. */}\n <EmphasisPanel className=\"p-4\">\n <div className=\"mb-4 flex items-center justify-between\">\n <div>\n <h2 className=\"text-base font-semibold text-primary\">\n {tr('notifications.sentNotifications', 'Notifications')}\n </h2>\n <p className=\"text-sm text-text-secondary\">\n {notifications.length} {tr('notifications.resultsFoundShort', 'results')}\n </p>\n </div>\n {isLoading && (\n <CompactMarkOr\n today={<RefreshCw size={16} className=\"animate-spin text-tertiary\" />}\n />\n )}\n </div>\n\n <div className=\"space-y-3\">\n {notifications.length === 0 ? (\n <IllustratedEmptyState\n illustration=\"empty-search\"\n title={tr('notifications.noNotificationsFound', 'No notifications found')}\n description={tr(\n 'notifications.adjustSearchOrDateRange',\n 'Try adjusting your filters'\n )}\n kind=\"filtered\"\n />\n ) : (\n notifications.map((notification) => (\n <button\n key={notification.id}\n type=\"button\"\n onClick={() => loadNotification(notification.id)}\n className=\"block w-full text-left\"\n >\n <NotificationCard\n notification={notification}\n compact\n showArchivedState\n analyticsSource=\"admin_history\"\n />\n </button>\n ))\n )}\n </div>\n </EmphasisPanel>\n\n <section className=\"rounded-lg border border-border-seam bg-gloss-card p-4\">\n <div className=\"mb-4 flex items-center gap-2\">\n <CalendarClock size={18} className=\"text-accent-primary\" />\n <h2 className=\"text-base font-semibold text-primary\">\n {tr('notifications.scheduledNotifications', 'Scheduled Notifications')}\n </h2>\n </div>\n\n <div className=\"space-y-3\">\n {scheduledNotifications.length === 0 ? (\n <IllustratedEmptyState\n illustration=\"empty-data\"\n title={tr('notifications.noScheduledNotifications', 'No scheduled notifications')}\n description={tr(\n 'notifications.noScheduledDescription',\n 'Notifications queued for a future send time will appear here, ready to reschedule or cancel.'\n )}\n glassIllustration=\"calendar\"\n size=\"panel\"\n />\n ) : (\n scheduledNotifications.map((scheduled) => (\n <div\n key={scheduled.id}\n className=\"rounded-md border border-default bg-bg-canvas p-4\"\n >\n <div className=\"flex flex-col gap-3 sm:flex-row sm:items-center sm:justify-between\">\n <div>\n <h3 className=\"text-sm font-semibold text-primary\">\n {scheduled.notification.title}\n </h3>\n <p className=\"text-xs text-text-secondary\">\n {scheduled.notification.channel} • {scheduled.notification.type} •{' '}\n {formatDateTime(scheduled.scheduledFor)}\n </p>\n </div>\n <div className=\"flex items-center gap-2\">\n <button\n type=\"button\"\n onClick={() => loadNotification(scheduled.notification.id)}\n className=\"rounded-md border border-default px-3 py-2 text-xs text-text-secondary hover:bg-bg-sunken\"\n >\n {tr('notifications.view', 'View')}\n </button>\n {scheduled.status === 'PENDING' && (\n <button\n type=\"button\"\n onClick={() => cancelScheduledNotification(scheduled.id)}\n className=\"rounded-md border border-status-error-border px-3 py-2 text-xs text-status-error-text hover:bg-status-error-bg-subtle\"\n >\n {tr('notifications.cancel', 'Cancel')}\n </button>\n )}\n </div>\n </div>\n </div>\n ))\n )}\n </div>\n </section>\n </div>\n\n <aside className=\"rounded-lg border border-border-seam bg-gloss-card p-4 xl:sticky xl:top-4 xl:max-h-[calc(100vh-2rem)] xl:self-start xl:overflow-y-auto\">\n {selectedNotification ? (\n <div className=\"space-y-4\">\n <div className=\"flex items-start justify-between gap-3\">\n <div>\n <h2 className=\"text-lg font-semibold text-primary\">\n {selectedNotification.title}\n </h2>\n <p className=\"text-sm text-text-secondary\">{selectedNotification.body}</p>\n </div>\n <button\n type=\"button\"\n onClick={clearSelection}\n className=\"rounded-md border border-default px-3 py-2 text-xs text-text-secondary hover:bg-bg-sunken\"\n >\n {tr('notifications.close', 'Close')}\n </button>\n </div>\n\n <div className=\"grid gap-2 rounded-md border border-default bg-bg-canvas p-3 text-sm text-text-secondary\">\n <div>\n <strong>{tr('notifications.detail.status', 'Status')}:</strong>{' '}\n {selectedNotification.status}\n </div>\n <div>\n <strong>{tr('notifications.detail.delivery', 'Delivery')}:</strong>{' '}\n {selectedNotification.deliveryStatus || '—'}\n </div>\n <div>\n <strong>{tr('notifications.detail.topic', 'Topic')}:</strong>{' '}\n {selectedNotification.topic?.name || '—'}\n </div>\n <div>\n <strong>{tr('notifications.detail.created', 'Created')}:</strong>{' '}\n {formatDateTime(selectedNotification.createdAt)}\n </div>\n <div>\n <strong>{tr('notifications.detail.sent', 'Sent')}:</strong>{' '}\n {formatDateTime(selectedNotification.sentAt)}\n </div>\n <div>\n <strong>{tr('notifications.detail.delivered', 'Delivered')}:</strong>{' '}\n {formatDateTime(selectedNotification.deliveredAt)}\n </div>\n <div>\n <strong>{tr('notifications.detail.opened', 'Opened')}:</strong>{' '}\n {formatDateTime(selectedNotification.openedAt)}\n </div>\n <div>\n <strong>{tr('notifications.detail.clicked', 'Clicked')}:</strong>{' '}\n {formatDateTime(selectedNotification.clickedAt)}\n </div>\n <div>\n <strong>{tr('notifications.detail.read', 'Read')}:</strong>{' '}\n {formatDateTime(selectedNotification.readAt)}\n </div>\n <div>\n <strong>{tr('notifications.detail.recipient', 'Recipient')}:</strong>{' '}\n {selectedNotification.recipientEmail ||\n selectedNotification.recipientPhone ||\n selectedNotification.id}\n </div>\n </div>\n\n {selectedNotification.media.length > 0 && (\n <div className=\"space-y-2\">\n <h3 className=\"text-sm font-semibold text-primary\">\n {tr('notifications.media', 'Media')}\n </h3>\n <div className=\"grid gap-3\">\n {selectedNotification.media.map((item) => (\n <a\n key={item.url}\n href={item.url}\n target=\"_blank\"\n rel=\"noreferrer\"\n className=\"rounded-md border border-default bg-bg-canvas p-3 text-sm text-accent-primary hover:underline\"\n >\n {item.label || item.url}\n </a>\n ))}\n </div>\n </div>\n )}\n\n {selectedNotification.actions.length > 0 && (\n <div className=\"space-y-2\">\n <h3 className=\"text-sm font-semibold text-primary\">\n {tr('notifications.actions', 'Actions')}\n </h3>\n <div className=\"grid gap-2\">\n {selectedNotification.actions.map((action) => (\n <div\n key={action.id}\n className=\"rounded-md border border-default bg-bg-canvas p-3 text-sm text-text-secondary\"\n >\n <div className=\"font-medium text-primary\">{action.label}</div>\n <div className=\"truncate text-xs\">{action.url}</div>\n </div>\n ))}\n </div>\n </div>\n )}\n\n {selectedNotification.scheduledNotification && (\n <div className=\"space-y-3 rounded-md border border-default bg-bg-canvas p-3\">\n <div className=\"text-sm font-semibold text-primary\">\n {tr('notifications.scheduling', 'Scheduling')}\n </div>\n <div className=\"text-sm text-text-secondary\">\n {formatDateTime(selectedNotification.scheduledNotification.scheduledFor)}\n </div>\n {selectedNotification.scheduledNotification.status === 'PENDING' && (\n <>\n <input\n type=\"datetime-local\"\n value={rescheduleAt}\n onChange={(event) => setRescheduleAt(event.target.value)}\n className=\"w-full rounded-md border border-default bg-surface px-3 py-2 text-sm text-primary\"\n />\n <div className=\"flex items-center gap-2\">\n <button\n type=\"button\"\n onClick={() =>\n rescheduleAt &&\n rescheduleNotification(\n selectedNotification.scheduledNotification!.id,\n new Date(rescheduleAt).toISOString()\n )\n }\n className=\"rounded-md bg-accent-primary px-3 py-2 text-xs font-medium text-text-inverse hover:opacity-90\"\n >\n {tr('notifications.reschedule', 'Reschedule')}\n </button>\n <button\n type=\"button\"\n onClick={() =>\n cancelScheduledNotification(\n selectedNotification.scheduledNotification!.id\n )\n }\n className=\"rounded-md border border-status-error-border px-3 py-2 text-xs text-status-error-text hover:bg-status-error-bg-subtle\"\n >\n {tr('notifications.cancel', 'Cancel')}\n </button>\n </div>\n </>\n )}\n </div>\n )}\n\n <div className=\"flex items-center gap-2\">\n {selectedNotification.archivedAt ? (\n <button\n type=\"button\"\n onClick={() => unarchiveNotification(selectedNotification.id)}\n className=\"rounded-md border border-default px-3 py-2 text-xs text-text-secondary hover:bg-bg-sunken\"\n >\n {tr('notifications.restore', 'Restore')}\n </button>\n ) : (\n <button\n type=\"button\"\n onClick={() => archiveNotification(selectedNotification.id)}\n className=\"rounded-md border border-default px-3 py-2 text-xs text-text-secondary hover:bg-bg-sunken\"\n >\n {tr('notifications.archive', 'Archive')}\n </button>\n )}\n </div>\n\n <div className=\"space-y-2\">\n <h3 className=\"text-sm font-semibold text-primary\">\n {tr('notifications.eventTimeline', 'Event Timeline')}\n </h3>\n {events.length === 0 ? (\n <div className=\"rounded-md border border-dashed border-border-seam p-4 text-sm text-text-secondary\">\n {tr('notifications.noEvents', 'No events recorded yet.')}\n </div>\n ) : (\n <ShowMore collapsedHeight={180}>\n <div className=\"space-y-2\">\n {events.map((event) => (\n <div\n key={event.id}\n className=\"rounded-md border border-border-seam bg-surface p-3 text-sm text-text-secondary\"\n >\n <div className=\"font-medium text-primary\">{event.eventType}</div>\n <div>{formatDateTime(event.timestamp)}</div>\n {event.deliveryStatus && (\n <div>\n {tr('notifications.detail.delivery', 'Delivery')}:{' '}\n {event.deliveryStatus}\n </div>\n )}\n </div>\n ))}\n </div>\n </ShowMore>\n )}\n </div>\n </div>\n ) : (\n <div className=\"flex h-full min-h-[360px] items-center justify-center\">\n <IllustratedEmptyState\n illustration=\"empty-search\"\n title={tr('notifications.selectNotificationTitle', 'Nothing selected')}\n description={tr(\n 'notifications.selectNotificationForDetails',\n 'Select a notification to inspect details, delivery receipts, and activity.'\n )}\n glassIllustration=\"notifications\"\n size=\"panel\"\n />\n </div>\n )}\n </aside>\n </div>\n </div>\n );\n}\n"],"mappings":";;;;;;;;;;;;;AAoBA,SAASC,EAAe,GAAuB;CAE7C,OADKC,IACE,IAAI,KAAKA,CAAK,CAAC,CAAC,eAAe,IADnB;AAErB;AAGA,SAAgBC,IAA+B;CAC7C,IAAMC,IAAKC,EAAM,GACX,EAAE,kBAAe,WAAWC,MAAuBC,EAAe,GAClE,EAAE,cAAWC,EAAsB,GACnC,EACJ,YACA,eACA,kBACA,2BACA,yBACA,WACA,cACA,qBACA,wBACA,0BACA,gCACA,2BACA,sBACEC,EAAqB,GACnB,CAACC,GAAcC,KAAmBC,EAAS,EAAE;CA+BnD,OA7BIN,IAEA,kBAACO,GAAD;EACE,WAAU;EACV,OACE,kBAAC,OAAD;GAAK,WAAU;GACb,UAAA,kBAACC,GAAD;IACE,WAAU;IACV,OACE,kBAAC,OAAD,EAAK,WAAU,iFAAkF,CAAA;GAEpG,CAAA;EACE,CAAA;CAER,CAAA,IAIAC,EAAcC,EAAyB,iBAAiB,IAY3D,kBAAC,OAAD;EAAK,WAAU;EAAf,UAAA;GACE,kBAACC,GAAD;IAAa,MAAM,kBAACC,GAAD,EAAe,MAAM,GAAK,CAAA;IAC1C,UAAAd,EACC,qCACA,gUACF;GACW,CAAA;GAEb,kBAACe,GAAD;IACE,YAAW;IACX,OAAO;KACL;MACE,IAAI;MACJ,OAAOf,EAAG,kCAAkC,oBAAoB;MAChE,aAAaA,EACX,iCACA,oFACF;MACA,eAA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G,0BAA0B,yBAAyB;QACpD,CAAA,IAEL,kBAACgD,GAAD;SAAU,iBAAiB;SACzB,UAAA,kBAAC,OAAD;UAAK,WAAU;UACZ,UAAAD,EAAO,KAAK,MACX,kBAAC,OAAD;WAEE,WAAU;WAFZ,UAAA;YAIE,kBAAC,OAAD;aAAK,WAAU;aAA4B,UAAArB,EAAM;YAAe,CAAA;YAChE,kBAAC,OAAD,EAAA,UAAM7B,EAAe6B,EAAM,SAAS,EAAO,CAAA;YAC1CA,EAAM,kBACL,kBAAC,OAAD,EAAA,UAAA;aACG1B,EAAG,iCAAiC,UAAU;aAAE;aAAE;aAClD0B,EAAM;YACJ,EAAA,CAAA;WAEJ;UAXE,GAAAA,EAAM,EAWR,CACN;SACE,CAAA;QACG,CAAA,CAET;;MACF;KAEL,CAAA,IAAA,kBAAC,OAAD;MAAK,WAAU;MACb,UAAA,kBAACO,GAAD;OACE,cAAa;OACb,OAAOjC,EAAG,yCAAyC,kBAAkB;OACrE,aAAaA,EACX,8CACA,4EACF;OACA,mBAAkB;OAClB,MAAK;MACN,CAAA;KACE,CAAA;IAEF,CAAA,CACJ;;EACF;C,KAnfH,kBAAC,OAAD;EAAK,WAAU;EACZ,UAAAA,EACC,qCACA,yDACF;CACG,CAAA;AAgfX"}
@@ -1,8 +1,7 @@
1
1
  import { NotificationCard as e } from "../components/NotificationCard.js";
2
- import { useNotifications as t } from "../hooks/useNotifications.js";
3
- import { useNotificationTopics as n } from "../hooks/useNotificationTopics.js";
4
- import { NotificationListFooter as r } from "../components/NotificationListFooter.js";
5
- import "../hooks/index.js";
2
+ import { NotificationListFooter as t } from "../components/NotificationListFooter.js";
3
+ import { useNotifications as n } from "../hooks/useNotifications.js";
4
+ import { useNotificationTopics as r } from "../hooks/useNotificationTopics.js";
6
5
  import { NOTIFICATION_PERMISSIONS as i } from "../constants/permissions.js";
7
6
  import { useNotification as a } from "../providers/NotificationProvider.js";
8
7
  import { useTr as o } from "../shared/hooks/useTr.js";
@@ -23,7 +22,7 @@ function w() {
23
22
  return h(e ? c : T, {});
24
23
  }
25
24
  function T() {
26
- let c = o(), { hasPermission: w, isLoading: T } = d(), { currentUser: E } = a(), { topics: D } = n({ isActive: !0 }), { notifications: O, hasMore: k, isLoadingMore: A, loadMore: j, notificationFilter: M, updateFilter: N, archiveNotification: P, unarchiveNotification: F, recordAction: I } = t({ baseFilter: C }), L = !!(M.search || M.topicId || M.dateRange.start || M.dateRange.end);
25
+ let c = o(), { hasPermission: w, isLoading: T } = d(), { currentUser: E } = a(), { topics: D } = r({ isActive: !0 }), { notifications: O, hasMore: k, isLoadingMore: A, loadMore: j, notificationFilter: M, updateFilter: N, archiveNotification: P, unarchiveNotification: F, recordAction: I } = n({ baseFilter: C }), L = !!(M.search || M.topicId || M.dateRange.start || M.dateRange.end);
27
26
  return T ? /* @__PURE__ */ h(u, {
28
27
  minHeight: "16rem",
29
28
  today: /* @__PURE__ */ h("div", {
@@ -140,7 +139,7 @@ function T() {
140
139
  })
141
140
  })
142
141
  }),
143
- /* @__PURE__ */ h(r, {
142
+ /* @__PURE__ */ h(t, {
144
143
  hasMore: k,
145
144
  isLoadingMore: A,
146
145
  onLoadMore: j,
@@ -1 +1 @@
1
- {"version":3,"file":"NotificationHistoryPage.js","names":["HISTORY_FILTER","NotificationHistoryPage","useNotification","jsx","navigationV2","NotificationArchivedV2","ClassicNotificationHistoryPage","tr","useTr","permissionsLoading","usePermissions","useNotificationTopics","useNotifications","hasActiveFilters","notificationFilter","SectionLoaderOr","CompactMarkOr","hasPermission","NOTIFICATION_PERMISSIONS","currentUser","PagePurpose","History","EmphasisPanel","Button","exportNotificationsAsCsv","notifications","Download","GlassCard","Search","updateFilter","ThemedSelect","event","topics","topic","NotificationCard","archiveNotification","recordAction","notification","unarchiveNotification","IllustratedEmptyState","NotificationListFooter","loadMore"],"sources":["../../src/pages/NotificationHistoryPage.tsx"],"sourcesContent":["import { Download, History, Search } from 'lucide-react';\nimport { usePermissions } from '@burdenoff/fe-libs/shared/providers/shell';\nimport {\n Button,\n EmphasisPanel,\n GlassCard,\n IllustratedEmptyState,\n PagePurpose,\n ThemedSelect,\n} from '@burdenoff/fe-libs/ui';\nimport { NotificationCard } from '../components/NotificationCard';\nimport { NotificationListFooter } from '../components/NotificationListFooter';\nimport { useNotifications, useNotificationTopics } from '../hooks';\nimport { NOTIFICATION_PERMISSIONS } from '../constants/permissions';\nimport { useNotification } from '../providers/NotificationProvider';\nimport { useTr } from '../shared/hooks/useTr';\nimport { exportNotificationsAsCsv } from '../utils/notificationHistoryExport';\nimport { NotificationArchivedV2 } from '../navigation-v2/NotificationArchivedV2';\nimport { CompactMarkOr, SectionLoaderOr } from '../components/loadingSystem';\n\nconst HISTORY_FILTER = { archived: null, channel: 'ALL' as const };\n\n/**\n * User Notification History — personal history, filter, CSV export,\n * archive/unarchive. Under FluidGrids' Navigation v2 (BOFF-11872) it is the\n * \"Archived\" view instead; every other app keeps this page.\n */\nexport function NotificationHistoryPage() {\n const { navigationV2 } = useNotification();\n return navigationV2 ? <NotificationArchivedV2 /> : <ClassicNotificationHistoryPage />;\n}\n\nfunction ClassicNotificationHistoryPage() {\n const tr = useTr();\n const { hasPermission, isLoading: permissionsLoading } = usePermissions();\n const { currentUser } = useNotification();\n const { topics } = useNotificationTopics({ isActive: true });\n const {\n notifications,\n hasMore,\n isLoadingMore,\n loadMore,\n notificationFilter,\n updateFilter,\n archiveNotification,\n unarchiveNotification,\n recordAction,\n } = useNotifications({ baseFilter: HISTORY_FILTER });\n\n const hasActiveFilters = Boolean(\n notificationFilter.search ||\n notificationFilter.topicId ||\n notificationFilter.dateRange.start ||\n notificationFilter.dateRange.end\n );\n\n if (permissionsLoading) {\n return (\n <SectionLoaderOr\n minHeight=\"16rem\"\n today={\n <div className=\"flex h-64 items-center justify-center\">\n <CompactMarkOr\n className=\"h-8 w-8\"\n today={\n <div className=\"h-8 w-8 animate-spin rounded-full border-4 border-primary border-t-transparent\" />\n }\n />\n </div>\n }\n />\n );\n }\n\n if (!hasPermission(NOTIFICATION_PERMISSIONS.NOTIFICATION_LIST) && !currentUser?.id) {\n return (\n <div className=\"p-8 text-center text-text-secondary\">\n {tr(\n 'notifications.noPermissionHistory',\n \"You don't have permission to view notification history.\"\n )}\n </div>\n );\n }\n\n return (\n <div className=\"space-y-4 sm:space-y-6 p-3 sm:p-6 animate-in fade-in duration-200\">\n <PagePurpose icon={<History size={16} />}>\n {tr(\n 'notifications.historyPurpose',\n 'A searchable archive of every notification you have ever received, across all channels (in-app, email, push and more). Look back through anything you read or archived, narrow by topic or date range, and export the results to CSV for your own records.'\n )}\n </PagePurpose>\n\n {/* Single emphasis zone — the header summary + the one export CTA. */}\n <EmphasisPanel\n data-tour=\"notification-history-header\"\n className=\"flex flex-col gap-4 p-5 sm:flex-row sm:items-center sm:justify-between sm:p-6\"\n >\n <div>\n <h1 className=\"text-xl sm:text-2xl font-bold text-primary\">\n {tr('notifications.historyTitle', 'Notification History')}\n </h1>\n <p className=\"text-sm text-text-secondary mt-1\">\n {tr('notifications.historySubtitle', 'View and search all your notifications')}\n </p>\n </div>\n\n <Button\n data-tour=\"notification-history-export\"\n variant=\"outline\"\n onClick={() => exportNotificationsAsCsv(tr, notifications)}\n disabled={notifications.length === 0}\n className=\"gap-2\"\n >\n <Download size={16} />\n {tr('notifications.export', 'Export')}\n </Button>\n </EmphasisPanel>\n\n <GlassCard\n treatment=\"plain\"\n className=\"grid gap-3 border-border-seam p-3 sm:grid-cols-2 sm:p-4 xl:grid-cols-5\"\n >\n <div className=\"relative sm:col-span-2 xl:col-span-2\">\n <Search size={16} className=\"absolute left-3 top-1/2 -translate-y-1/2 text-tertiary\" />\n <input\n type=\"text\"\n placeholder={tr(\n 'notifications.searchByTitleOrContent',\n 'Search by title or content...'\n )}\n value={notificationFilter.search}\n onChange={(e) => updateFilter({ search: e.target.value })}\n className=\"w-full pl-9 pr-4 py-2 text-sm text-primary bg-surface border border-default rounded-lg focus:outline-none focus:ring-2 focus:ring-accent transition-shadow duration-150\"\n />\n </div>\n\n <ThemedSelect\n value={notificationFilter.topicId || ''}\n onChange={(event) => updateFilter({ topicId: event.target.value || undefined })}\n className=\"rounded-lg border border-default bg-surface px-3 py-2 text-sm text-primary scheme-normal dark:scheme-dark [&_option]:bg-bg-surface [&_option]:text-text-primary\"\n >\n <option value=\"\">{tr('notifications.allTopics', 'All Topics')}</option>\n {topics.map((topic) => (\n <option key={topic.id} value={topic.id}>\n {topic.name}\n </option>\n ))}\n </ThemedSelect>\n\n <input\n type=\"date\"\n aria-label={tr('notifications.startDate', 'Start date')}\n value={\n notificationFilter.dateRange.start\n ? notificationFilter.dateRange.start.toISOString().split('T')[0]\n : ''\n }\n onChange={(e) =>\n updateFilter({\n dateRange: {\n ...notificationFilter.dateRange,\n start: e.target.value ? new Date(e.target.value) : null,\n },\n })\n }\n className=\"rounded-lg border border-default bg-surface px-3 py-2 text-sm text-primary\"\n />\n\n <input\n type=\"date\"\n aria-label={tr('notifications.endDate', 'End date')}\n value={\n notificationFilter.dateRange.end\n ? notificationFilter.dateRange.end.toISOString().split('T')[0]\n : ''\n }\n onChange={(e) =>\n updateFilter({\n dateRange: {\n ...notificationFilter.dateRange,\n end: e.target.value ? new Date(e.target.value) : null,\n },\n })\n }\n className=\"rounded-lg border border-default bg-surface px-3 py-2 text-sm text-primary\"\n />\n </GlassCard>\n\n <div className=\"space-y-2\">\n {notifications.length > 0 ? (\n notifications.map((notification) => (\n <div key={notification.id} className=\"space-y-2\">\n <NotificationCard\n notification={notification}\n onArchive={archiveNotification}\n onAction={recordAction}\n showArchivedState\n analyticsSource=\"history\"\n />\n {notification.archivedAt && (\n <div className=\"flex justify-end\">\n <button\n onClick={() => unarchiveNotification(notification.id)}\n className=\"rounded-md border border-default px-3 py-2 text-xs text-text-secondary hover:bg-bg-sunken\"\n >\n {tr('notifications.restore', 'Restore')}\n </button>\n </div>\n )}\n </div>\n ))\n ) : (\n <div className=\"animate-in fade-in duration-200\">\n <IllustratedEmptyState\n illustration={hasActiveFilters ? 'empty-search' : 'empty-notifications'}\n title={\n hasActiveFilters\n ? tr('notifications.noNotificationsFound', 'No notifications found')\n : tr('notifications.historyEmptyTitle', 'No history yet')\n }\n description={\n hasActiveFilters\n ? tr('notifications.adjustSearchOrDateRange', 'Try adjusting your filters')\n : tr(\n 'notifications.historyEmptyDescription',\n 'Notifications you receive will be archived here so you can always find them again.'\n )\n }\n kind={\n notificationFilter.search\n ? 'no-results'\n : hasActiveFilters\n ? 'filtered'\n : 'first-use'\n }\n />\n </div>\n )}\n </div>\n\n <NotificationListFooter\n hasMore={hasMore}\n isLoadingMore={isLoadingMore}\n onLoadMore={loadMore}\n shownCount={notifications.length}\n />\n </div>\n );\n}\n"],"mappings":";;;;;;;;;;;;;;;;AAoBA,IAAMA,IAAiB;CAAE,UAAU;CAAM,SAAS;AAAe;AAOjE,SAAgBC,IAA0B;CACxC,IAAM,EAAE,oBAAiBC,EAAgB;CACzC,OAAsBC,EAAfC,IAAgBC,IAA6BC,GAA9B,CAAyB,CAAqC;AACtF;AAEA,SAASA,IAAiC;CACxC,IAAMC,IAAKC,EAAM,GACX,EAAE,kBAAe,WAAWC,MAAuBC,EAAe,GAClE,EAAE,mBAAgBR,EAAgB,GAClC,EAAE,cAAWS,EAAsB,EAAE,UAAU,GAAK,CAAC,GACrD,EACJ,kBACA,YACA,kBACA,aACA,uBACA,iBACA,wBACA,0BACA,oBACEC,EAAiB,EAAE,YAAYZ,EAAe,CAAC,GAE7Ca,IAAmB,GACvBC,EAAmB,UACnBA,EAAmB,WACnBA,EAAmB,UAAU,SAC7BA,EAAmB,UAAU;CAgC/B,OA7BIL,IAEA,kBAACM,GAAD;EACE,WAAU;EACV,OACE,kBAAC,OAAD;GAAK,WAAU;GACb,UAAA,kBAACC,GAAD;IACE,WAAU;IACV,OACE,kBAAC,OAAD,EAAK,WAAU,iFAAkF,CAAA;GAEpG,CAAA;EACE,CAAA;CAER,CAAA,IAID,CAACC,EAAcC,EAAyB,iBAAiB,KAAK,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ED,kBAAC,OAAD;KAAK,WAAU;KACb,UAAA,kBAACE,GAAD;MACE,cAAc1B,IAAmB,iBAAiB;MAClD,OACEA,IACIN,EAAG,sCAAsC,wBAAwB,IACjEA,EAAG,mCAAmC,gBAAgB;MAE5D,aACEM,IACIN,EAAG,yCAAyC,4BAA4B,IACxEA,EACE,yCACA,oFACF;MAEN,MACEO,EAAmB,SACf,eACAD,IACE,aACA;KAET,CAAA;IACE,CAAA;GAEJ,CAAA;GAEL,kBAAC2B,GAAD;IACW;IACM;IACf,YAAYC;IACZ,YAAYhB,EAAc;GAC3B,CAAA;EACE;;AAET"}
1
+ {"version":3,"file":"NotificationHistoryPage.js","names":["HISTORY_FILTER","NotificationHistoryPage","useNotification","jsx","navigationV2","NotificationArchivedV2","ClassicNotificationHistoryPage","tr","useTr","permissionsLoading","usePermissions","useNotificationTopics","useNotifications","hasActiveFilters","notificationFilter","SectionLoaderOr","CompactMarkOr","hasPermission","NOTIFICATION_PERMISSIONS","currentUser","PagePurpose","History","EmphasisPanel","Button","exportNotificationsAsCsv","notifications","Download","GlassCard","Search","updateFilter","ThemedSelect","event","topics","topic","NotificationCard","archiveNotification","recordAction","notification","unarchiveNotification","IllustratedEmptyState","NotificationListFooter","loadMore"],"sources":["../../src/pages/NotificationHistoryPage.tsx"],"sourcesContent":["import { Download, History, Search } from 'lucide-react';\nimport { usePermissions } from '@burdenoff/fe-libs/shared/providers/shell';\nimport {\n Button,\n EmphasisPanel,\n GlassCard,\n IllustratedEmptyState,\n PagePurpose,\n ThemedSelect,\n} from '@burdenoff/fe-libs/ui';\nimport { NotificationCard } from '../components/NotificationCard';\nimport { NotificationListFooter } from '../components/NotificationListFooter';\nimport { useNotifications, useNotificationTopics } from '../hooks';\nimport { NOTIFICATION_PERMISSIONS } from '../constants/permissions';\nimport { useNotification } from '../providers/NotificationProvider';\nimport { useTr } from '../shared/hooks/useTr';\nimport { exportNotificationsAsCsv } from '../utils/notificationHistoryExport';\nimport { NotificationArchivedV2 } from '../navigation-v2/NotificationArchivedV2';\nimport { CompactMarkOr, SectionLoaderOr } from '../components/loadingSystem';\n\nconst HISTORY_FILTER = { archived: null, channel: 'ALL' as const };\n\n/**\n * User Notification History — personal history, filter, CSV export,\n * archive/unarchive. Under FluidGrids' Navigation v2 (BOFF-11872) it is the\n * \"Archived\" view instead; every other app keeps this page.\n */\nexport function NotificationHistoryPage() {\n const { navigationV2 } = useNotification();\n return navigationV2 ? <NotificationArchivedV2 /> : <ClassicNotificationHistoryPage />;\n}\n\nfunction ClassicNotificationHistoryPage() {\n const tr = useTr();\n const { hasPermission, isLoading: permissionsLoading } = usePermissions();\n const { currentUser } = useNotification();\n const { topics } = useNotificationTopics({ isActive: true });\n const {\n notifications,\n hasMore,\n isLoadingMore,\n loadMore,\n notificationFilter,\n updateFilter,\n archiveNotification,\n unarchiveNotification,\n recordAction,\n } = useNotifications({ baseFilter: HISTORY_FILTER });\n\n const hasActiveFilters = Boolean(\n notificationFilter.search ||\n notificationFilter.topicId ||\n notificationFilter.dateRange.start ||\n notificationFilter.dateRange.end\n );\n\n if (permissionsLoading) {\n return (\n <SectionLoaderOr\n minHeight=\"16rem\"\n today={\n <div className=\"flex h-64 items-center justify-center\">\n <CompactMarkOr\n className=\"h-8 w-8\"\n today={\n <div className=\"h-8 w-8 animate-spin rounded-full border-4 border-primary border-t-transparent\" />\n }\n />\n </div>\n }\n />\n );\n }\n\n if (!hasPermission(NOTIFICATION_PERMISSIONS.NOTIFICATION_LIST) && !currentUser?.id) {\n return (\n <div className=\"p-8 text-center text-text-secondary\">\n {tr(\n 'notifications.noPermissionHistory',\n \"You don't have permission to view notification history.\"\n )}\n </div>\n );\n }\n\n return (\n <div className=\"space-y-4 sm:space-y-6 p-3 sm:p-6 animate-in fade-in duration-200\">\n <PagePurpose icon={<History size={16} />}>\n {tr(\n 'notifications.historyPurpose',\n 'A searchable archive of every notification you have ever received, across all channels (in-app, email, push and more). Look back through anything you read or archived, narrow by topic or date range, and export the results to CSV for your own records.'\n )}\n </PagePurpose>\n\n {/* Single emphasis zone — the header summary + the one export CTA. */}\n <EmphasisPanel\n data-tour=\"notification-history-header\"\n className=\"flex flex-col gap-4 p-5 sm:flex-row sm:items-center sm:justify-between sm:p-6\"\n >\n <div>\n <h1 className=\"text-xl sm:text-2xl font-bold text-primary\">\n {tr('notifications.historyTitle', 'Notification History')}\n </h1>\n <p className=\"text-sm text-text-secondary mt-1\">\n {tr('notifications.historySubtitle', 'View and search all your notifications')}\n </p>\n </div>\n\n <Button\n data-tour=\"notification-history-export\"\n variant=\"outline\"\n onClick={() => exportNotificationsAsCsv(tr, notifications)}\n disabled={notifications.length === 0}\n className=\"gap-2\"\n >\n <Download size={16} />\n {tr('notifications.export', 'Export')}\n </Button>\n </EmphasisPanel>\n\n <GlassCard\n treatment=\"plain\"\n className=\"grid gap-3 border-border-seam p-3 sm:grid-cols-2 sm:p-4 xl:grid-cols-5\"\n >\n <div className=\"relative sm:col-span-2 xl:col-span-2\">\n <Search size={16} className=\"absolute left-3 top-1/2 -translate-y-1/2 text-tertiary\" />\n <input\n type=\"text\"\n placeholder={tr(\n 'notifications.searchByTitleOrContent',\n 'Search by title or content...'\n )}\n value={notificationFilter.search}\n onChange={(e) => updateFilter({ search: e.target.value })}\n className=\"w-full pl-9 pr-4 py-2 text-sm text-primary bg-surface border border-default rounded-lg focus:outline-none focus:ring-2 focus:ring-accent transition-shadow duration-150\"\n />\n </div>\n\n <ThemedSelect\n value={notificationFilter.topicId || ''}\n onChange={(event) => updateFilter({ topicId: event.target.value || undefined })}\n className=\"rounded-lg border border-default bg-surface px-3 py-2 text-sm text-primary scheme-normal dark:scheme-dark [&_option]:bg-bg-surface [&_option]:text-text-primary\"\n >\n <option value=\"\">{tr('notifications.allTopics', 'All Topics')}</option>\n {topics.map((topic) => (\n <option key={topic.id} value={topic.id}>\n {topic.name}\n </option>\n ))}\n </ThemedSelect>\n\n <input\n type=\"date\"\n aria-label={tr('notifications.startDate', 'Start date')}\n value={\n notificationFilter.dateRange.start\n ? notificationFilter.dateRange.start.toISOString().split('T')[0]\n : ''\n }\n onChange={(e) =>\n updateFilter({\n dateRange: {\n ...notificationFilter.dateRange,\n start: e.target.value ? new Date(e.target.value) : null,\n },\n })\n }\n className=\"rounded-lg border border-default bg-surface px-3 py-2 text-sm text-primary\"\n />\n\n <input\n type=\"date\"\n aria-label={tr('notifications.endDate', 'End date')}\n value={\n notificationFilter.dateRange.end\n ? notificationFilter.dateRange.end.toISOString().split('T')[0]\n : ''\n }\n onChange={(e) =>\n updateFilter({\n dateRange: {\n ...notificationFilter.dateRange,\n end: e.target.value ? new Date(e.target.value) : null,\n },\n })\n }\n className=\"rounded-lg border border-default bg-surface px-3 py-2 text-sm text-primary\"\n />\n </GlassCard>\n\n <div className=\"space-y-2\">\n {notifications.length > 0 ? (\n notifications.map((notification) => (\n <div key={notification.id} className=\"space-y-2\">\n <NotificationCard\n notification={notification}\n onArchive={archiveNotification}\n onAction={recordAction}\n showArchivedState\n analyticsSource=\"history\"\n />\n {notification.archivedAt && (\n <div className=\"flex justify-end\">\n <button\n onClick={() => unarchiveNotification(notification.id)}\n className=\"rounded-md border border-default px-3 py-2 text-xs text-text-secondary hover:bg-bg-sunken\"\n >\n {tr('notifications.restore', 'Restore')}\n </button>\n </div>\n )}\n </div>\n ))\n ) : (\n <div className=\"animate-in fade-in duration-200\">\n <IllustratedEmptyState\n illustration={hasActiveFilters ? 'empty-search' : 'empty-notifications'}\n title={\n hasActiveFilters\n ? tr('notifications.noNotificationsFound', 'No notifications found')\n : tr('notifications.historyEmptyTitle', 'No history yet')\n }\n description={\n hasActiveFilters\n ? tr('notifications.adjustSearchOrDateRange', 'Try adjusting your filters')\n : tr(\n 'notifications.historyEmptyDescription',\n 'Notifications you receive will be archived here so you can always find them again.'\n )\n }\n kind={\n notificationFilter.search\n ? 'no-results'\n : hasActiveFilters\n ? 'filtered'\n : 'first-use'\n }\n />\n </div>\n )}\n </div>\n\n <NotificationListFooter\n hasMore={hasMore}\n isLoadingMore={isLoadingMore}\n onLoadMore={loadMore}\n shownCount={notifications.length}\n />\n </div>\n );\n}\n"],"mappings":";;;;;;;;;;;;;;;AAoBA,IAAMA,IAAiB;CAAE,UAAU;CAAM,SAAS;AAAe;AAOjE,SAAgBC,IAA0B;CACxC,IAAM,EAAE,oBAAiBC,EAAgB;CACzC,OAAsBC,EAAfC,IAAgBC,IAA6BC,GAA9B,CAAyB,CAAqC;AACtF;AAEA,SAASA,IAAiC;CACxC,IAAMC,IAAKC,EAAM,GACX,EAAE,kBAAe,WAAWC,MAAuBC,EAAe,GAClE,EAAE,mBAAgBR,EAAgB,GAClC,EAAE,cAAWS,EAAsB,EAAE,UAAU,GAAK,CAAC,GACrD,EACJ,kBACA,YACA,kBACA,aACA,uBACA,iBACA,wBACA,0BACA,oBACEC,EAAiB,EAAE,YAAYZ,EAAe,CAAC,GAE7Ca,IAAmB,GACvBC,EAAmB,UACnBA,EAAmB,WACnBA,EAAmB,UAAU,SAC7BA,EAAmB,UAAU;CAgC/B,OA7BIL,IAEA,kBAACM,GAAD;EACE,WAAU;EACV,OACE,kBAAC,OAAD;GAAK,WAAU;GACb,UAAA,kBAACC,GAAD;IACE,WAAU;IACV,OACE,kBAAC,OAAD,EAAK,WAAU,iFAAkF,CAAA;GAEpG,CAAA;EACE,CAAA;CAER,CAAA,IAID,CAACC,EAAcC,EAAyB,iBAAiB,KAAK,CAACC,GAAa,KAE5E,kBAAC,OAAD;EAAK,WAAU;EACZ,UAAAZ,EACC,qCACA,yDACF;CACG,CAAA,IAKP,kBAAC,OAAD;EAAK,WAAU;EAAf,UAAA;GACE,kBAACa,GAAD;IAAa,MAAM,kBAACC,GAAD,EAAS,MAAM,GAAK,CAAA;IACpC,UAAAd,EACC,gCACA,4PACF;GACW,CAAA;GAGb,kBAACe,GAAD;IACE,aAAU;IACV,WAAU;IAFZ,UAAA,CAIE,kBAAC,OAAD,EAAA,UAAA,CACE,kBAAC,MAAD;KAAI,WAAU;KACX,UAAA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CAAA;EACE;;AAET"}
@@ -1,4 +1,3 @@
1
- import "../hooks/index.js";
2
1
  import { useNotificationTopics as e } from "../hooks/useNotificationTopics.js";
3
2
  import { usePreferenceToggles as t } from "../hooks/usePreferenceToggles.js";
4
3
  import { NOTIFICATION_PERMISSIONS as n } from "../constants/permissions.js";
@@ -1 +1 @@
1
- {"version":3,"file":"NotificationPreferencesPage.js","names":["CHANNEL_OPTIONS","TYPE_OPTIONS","NotificationPreferencesPage","useNotification","jsx","navigationV2","NotificationSettingsV2","ClassicNotificationPreferencesPage","PreferencesLoading","SectionLoaderOr","CompactMarkOr","tr","useTr","permissionsLoading","usePermissions","topicsLoading","topicsForbidden","useNotificationTopics","usePreferenceToggles","search","setSearch","useState","isLoading","preferencesLoading","filteredTopics","useMemo","topics","query","topic","renderPreferenceRow","existing","preferencesByKey","input","isEnabled","isSaving","savingKey","feedback","saveFeedback","BellRing","resetPreference","togglePreference","ToggleRight","ToggleLeft","hasPermission","NOTIFICATION_PERMISSIONS","currentUser","PagePurpose","EmphasisPanel","OptionalFields","channel","type","Search","event","IllustratedEmptyState"],"sources":["../../src/pages/NotificationPreferencesPage.tsx"],"sourcesContent":["import { useMemo, useState } from 'react';\nimport { BellRing, Search, ToggleLeft, ToggleRight } from 'lucide-react';\nimport { usePermissions } from '@burdenoff/fe-libs/shared/providers/shell';\nimport {\n EmphasisPanel,\n IllustratedEmptyState,\n OptionalFields,\n PagePurpose,\n} from '@burdenoff/fe-libs/ui';\nimport { useNotificationTopics } from '../hooks';\nimport { usePreferenceToggles } from '../hooks/usePreferenceToggles';\nimport { NOTIFICATION_PERMISSIONS } from '../constants/permissions';\nimport { useNotification } from '../providers/NotificationProvider';\nimport { useTr } from '../shared/hooks/useTr';\nimport type { NotificationChannel, NotificationPreferenceScope, NotificationType } from '../types';\nimport { NotificationSettingsV2 } from '../navigation-v2/NotificationSettingsV2';\nimport { CompactMarkOr, SectionLoaderOr } from '../components/loadingSystem';\n\nconst CHANNEL_OPTIONS: Array<{ value: NotificationChannel; labelKey: string; label: string }> = [\n { value: 'IN_APP', labelKey: 'notifications.channelInApp', label: 'In-app' },\n { value: 'EMAIL', labelKey: 'notifications.channelEmail', label: 'Email' },\n { value: 'PUSH', labelKey: 'notifications.channelPush', label: 'Push' },\n { value: 'SMS', labelKey: 'notifications.channelSms', label: 'SMS' },\n { value: 'WHATSAPP', labelKey: 'notifications.channelWhatsapp', label: 'WhatsApp' },\n { value: 'SLACK', labelKey: 'notifications.channelSlack', label: 'Slack' },\n];\n\nconst TYPE_OPTIONS: Array<{ value: NotificationType; labelKey: string; label: string }> = [\n { value: 'TRANSACTIONAL', labelKey: 'notifications.typeTransactional', label: 'Transactional' },\n { value: 'SYSTEM', labelKey: 'notifications.typeSystem', label: 'System' },\n { value: 'ALERT', labelKey: 'notifications.typeAlert', label: 'Alerts' },\n { value: 'MARKETING', labelKey: 'notifications.typeMarketing', label: 'Marketing' },\n];\n\n/**\n * Notification preferences. Under FluidGrids' Navigation v2 (BOFF-11872) it\n * is \"Notification settings\" instead; every other app keeps this page.\n */\nexport function NotificationPreferencesPage() {\n const { navigationV2 } = useNotification();\n return navigationV2 ? <NotificationSettingsV2 /> : <ClassicNotificationPreferencesPage />;\n}\n\n/** While the reader's permissions load: today's ring, or the loading system's section loader. */\nfunction PreferencesLoading() {\n return (\n <SectionLoaderOr\n minHeight=\"16rem\"\n today={\n <div className=\"flex h-64 items-center justify-center\">\n <CompactMarkOr\n className=\"h-8 w-8\"\n today={\n <div className=\"h-8 w-8 animate-spin rounded-full border-4 border-primary border-t-transparent\" />\n }\n />\n </div>\n }\n />\n );\n}\n\nfunction ClassicNotificationPreferencesPage() {\n const tr = useTr();\n const { hasPermission, isLoading: permissionsLoading } = usePermissions();\n const { currentUser } = useNotification();\n const {\n topics,\n isLoading: topicsLoading,\n isForbidden: topicsForbidden,\n } = useNotificationTopics({\n type: 'MARKETING',\n isActive: true,\n });\n const {\n preferencesByKey,\n preferencesLoading,\n savingKey,\n saveFeedback,\n togglePreference,\n resetPreference,\n } = usePreferenceToggles();\n const [search, setSearch] = useState('');\n\n const isLoading = topicsLoading || preferencesLoading;\n\n const filteredTopics = useMemo(() => {\n if (!search.trim()) {\n return topics;\n }\n\n const query = search.toLowerCase();\n return topics.filter(\n (topic) =>\n topic.name.toLowerCase().includes(query) ||\n topic.slug.toLowerCase().includes(query) ||\n topic.description?.toLowerCase().includes(query)\n );\n }, [search, topics]);\n\n const renderPreferenceRow = (input: {\n key: string;\n title: string;\n description: string;\n scope: NotificationPreferenceScope;\n channel?: NotificationChannel;\n type?: NotificationType;\n topicId?: string;\n }) => {\n const existing = preferencesByKey.get(input.key);\n const isEnabled = existing?.enabled ?? true;\n const isSaving = savingKey === input.key;\n const feedback = saveFeedback?.key === input.key ? saveFeedback : null;\n\n return (\n <div\n key={input.key}\n className=\"rounded-lg border border-border-seam bg-gloss-card p-4 transition-[box-shadow,border-color] duration-200 hover:shadow-[var(--shadow-pop)]\"\n >\n <div className=\"flex flex-col gap-3 sm:flex-row sm:items-center sm:justify-between\">\n <div className=\"space-y-1\">\n <div className=\"flex items-center gap-2\">\n <BellRing size={16} className=\"text-accent-primary\" />\n <h2 className=\"text-sm font-semibold text-primary\">{input.title}</h2>\n {existing && (\n <span className=\"rounded-full bg-bg-sunken px-2 py-0.5 text-xs text-text-secondary\">\n {existing.frequency.replace('_', ' ').toLowerCase()}\n </span>\n )}\n </div>\n <p className=\"text-sm text-text-secondary\">{input.description}</p>\n </div>\n\n <div className=\"flex items-center gap-2\">\n {existing && (\n <button\n type=\"button\"\n disabled={isSaving}\n onClick={() => resetPreference(input.key)}\n className=\"rounded-md border border-default px-3 py-2 text-sm text-text-secondary hover:bg-bg-sunken disabled:cursor-not-allowed disabled:opacity-50\"\n >\n {tr('notifications.reset', 'Reset')}\n </button>\n )}\n <button\n type=\"button\"\n aria-pressed={isEnabled}\n disabled={isSaving}\n onClick={() =>\n togglePreference({\n scope: input.scope,\n channel: input.channel,\n type: input.type,\n topicId: input.topicId,\n })\n }\n className={`inline-flex items-center gap-2 rounded-md border px-3 py-2 text-sm font-medium transition-colors ${\n isEnabled\n ? 'border-accent-primary bg-action-primary-bg text-text-inverse hover:opacity-90'\n : 'border-default bg-bg-sunken text-text-secondary hover:bg-bg-sunken/80'\n } disabled:cursor-not-allowed disabled:opacity-50`}\n >\n {isEnabled ? <ToggleRight size={18} /> : <ToggleLeft size={18} />}\n {isSaving\n ? tr('notifications.saving', 'Saving...')\n : isEnabled\n ? tr('notifications.enabled', 'Enabled')\n : tr('notifications.disabled', 'Disabled')}\n </button>\n </div>\n </div>\n <div className=\"mt-3 min-h-5\" aria-live=\"polite\">\n {feedback && (\n <p className={`text-xs ${feedback.type === 'success' ? 'text-success' : 'text-error'}`}>\n {feedback.message}\n </p>\n )}\n </div>\n </div>\n );\n };\n\n if (permissionsLoading) {\n return <PreferencesLoading />;\n }\n\n if (!hasPermission(NOTIFICATION_PERMISSIONS.NOTIFICATION_LIST) && !currentUser?.id) {\n return (\n <div className=\"p-8 text-center text-text-secondary\">\n {tr(\n 'notifications.noPermissionPreferences',\n \"You don't have permission to manage notification preferences.\"\n )}\n </div>\n );\n }\n\n return (\n <div data-tour=\"notification-preferences-page\" className=\"space-y-6 p-4 sm:p-6\">\n <div>\n <h1 className=\"text-2xl font-bold text-primary\">\n {tr('notifications.preferencesTitle', 'Notification Preferences')}\n </h1>\n <p className=\"mt-1 text-sm text-text-secondary\">\n {tr(\n 'notifications.preferencesSubtitle',\n 'Control global, channel, type, and topic-level notification delivery.'\n )}\n </p>\n </div>\n\n <PagePurpose icon={<BellRing size={16} />}>\n {tr(\n 'notifications.preferencesPurpose',\n 'Decide how and when we reach you. The Global switch is your master on/off, then you can fine-tune individual channels (email, push, SMS…), notification types and the marketing topics you have subscribed to. Settings cascade — turning a channel off silences it everywhere.'\n )}\n </PagePurpose>\n\n <EmphasisPanel data-tour=\"notification-preferences-global\" className=\"space-y-3 p-5 sm:p-6\">\n <h2 className=\"text-sm font-semibold uppercase tracking-wide text-tertiary\">\n {tr('notifications.globalPreferences', 'Global')}\n </h2>\n {renderPreferenceRow({\n key: 'GLOBAL',\n scope: 'GLOBAL',\n title: tr('notifications.allNotifications', 'All notifications'),\n description: tr(\n 'notifications.allNotificationsDescription',\n 'Master preference for notification delivery across all channels and types.'\n ),\n })}\n </EmphasisPanel>\n\n {/* Advanced: per-channel filter rules / quiet hours / custom templates — collapse the long-tail knobs */}\n <OptionalFields\n title={tr('notifications.advancedPreferences', 'Advanced settings')}\n description={tr(\n 'notifications.advancedPreferencesDescription',\n 'Per-channel filter rules, notification-type filters, and quiet-hour overrides.'\n )}\n >\n <section data-tour=\"notification-preferences-channels\" className=\"space-y-3\">\n <h2 className=\"text-sm font-semibold uppercase tracking-wide text-tertiary\">\n {tr('notifications.channelPreferences', 'Channels')}\n </h2>\n <div className=\"grid gap-3 lg:grid-cols-2\">\n {CHANNEL_OPTIONS.map((channel) =>\n renderPreferenceRow({\n key: `CHANNEL:${channel.value}`,\n scope: 'CHANNEL',\n channel: channel.value,\n title: tr(channel.labelKey, channel.label),\n description: tr(\n 'notifications.channelPreferenceDescription',\n 'Control delivery for this channel.'\n ),\n })\n )}\n </div>\n </section>\n\n <section data-tour=\"notification-preferences-types\" className=\"mt-6 space-y-3\">\n <h2 className=\"text-sm font-semibold uppercase tracking-wide text-tertiary\">\n {tr('notifications.typePreferences', 'Notification Types')}\n </h2>\n <div className=\"grid gap-3 lg:grid-cols-2\">\n {TYPE_OPTIONS.map((type) =>\n renderPreferenceRow({\n key: `TYPE:${type.value}`,\n scope: 'TYPE',\n type: type.value,\n title: tr(type.labelKey, type.label),\n description: tr(\n 'notifications.typePreferenceDescription',\n 'Control delivery for this notification type.'\n ),\n })\n )}\n </div>\n </section>\n </OptionalFields>\n\n <div className=\"relative max-w-xl\">\n <Search size={16} className=\"absolute left-3 top-1/2 -translate-y-1/2 text-tertiary\" />\n <input\n type=\"text\"\n value={search}\n onChange={(event) => setSearch(event.target.value)}\n aria-label={tr('notifications.searchTopics', 'Search topics...')}\n placeholder={tr('notifications.searchTopics', 'Search topics...')}\n className=\"w-full rounded-lg border border-default bg-surface py-2 pl-9 pr-4 text-sm text-primary focus:outline-none focus:ring-2 focus:ring-accent\"\n />\n </div>\n\n <section data-tour=\"notification-preferences-topics\" className=\"space-y-3\">\n <h2 className=\"text-sm font-semibold uppercase tracking-wide text-tertiary\">\n {tr('notifications.topicPreferences', 'Topics')}\n </h2>\n {isLoading ? (\n <div className=\"rounded-lg border border-default bg-surface p-6 text-sm text-text-secondary\">\n {tr('notifications.loadingPreferences', 'Loading preferences...')}\n </div>\n ) : topicsForbidden ? (\n <IllustratedEmptyState\n illustration=\"empty-generic\"\n title={tr(\n 'notifications.topicsNoAccessTitle',\n \"You don't have access to notification topics\"\n )}\n description={tr(\n 'notifications.topicsNoAccessDescription',\n \"Your role doesn't include permission to read notification topics. Ask a workspace admin if you need access.\"\n )}\n kind=\"no-access\"\n size=\"panel\"\n />\n ) : filteredTopics.length === 0 ? (\n <IllustratedEmptyState\n illustration={search.trim() ? 'empty-search' : 'empty-data'}\n title={\n search.trim()\n ? tr('notifications.noTopicsFound', 'No topics match your search')\n : tr('notifications.noTopicsAvailableTitle', 'No subscribable topics yet')\n }\n description={\n search.trim()\n ? tr('notifications.adjustSearchOrDateRange', 'Try adjusting your filters')\n : tr(\n 'notifications.noTopicsAvailableDescription',\n 'When marketing topics are published you can subscribe or unsubscribe from each one here.'\n )\n }\n kind={search.trim() ? 'no-results' : 'first-use'}\n glassIllustration=\"notifications\"\n size=\"panel\"\n />\n ) : (\n filteredTopics.map((topic) =>\n renderPreferenceRow({\n key: `TOPIC:${topic.id}`,\n scope: 'TOPIC',\n topicId: topic.id,\n title: topic.name,\n description: topic.description || topic.slug,\n })\n )\n )}\n </section>\n </div>\n );\n}\n"],"mappings":";;;;;;;;;;;;;;AAkBA,IAAMA,IAA0F;CAC9F;EAAE,OAAO;EAAU,UAAU;EAA8B,OAAO;CAAS;CAC3E;EAAE,O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U;IAA/D,UAAA,CACE,kBAAC,MAAD;KAAI,WAAU;KACX,UAAAA,EAAG,kCAAkC,QAAQ;IAC5C,CAAA,GACHW,IACC,kBAAC,OAAD;KAAK,WAAU;KACZ,UAAAX,EAAG,oCAAoC,wBAAwB;IAC7D,CAAA,IACHK,IACF,kBAACqC,GAAD;KACE,cAAa;KACb,OAAO1C,EACL,qCACA,8CACF;KACA,aAAaA,EACX,2CACA,6GACF;KACA,MAAK;KACL,MAAK;IACN,CAAA,IACCa,EAAe,WAAW,IAC5B,kBAAC6B,GAAD;KACE,cAAclC,EAAO,KAAK,IAAI,iBAAiB;KAC/C,OACEA,EAAO,KAAK,IACRR,EAAG,+BAA+B,6BAA6B,IAC/DA,EAAG,wCAAwC,4BAA4B;KAE7E,aACEQ,EAAO,KAAK,IACRR,EAAG,yCAAyC,4BAA4B,IACxEA,EACE,8CACA,0FACF;KAEN,MAAMQ,EAAO,KAAK,IAAI,eAAe;KACrC,mBAAkB;KAClB,MAAK;IACN,CAAA,IAEDK,EAAe,KAAK,MAClBK,EAAoB;KAClB,KAAK,SAASD,EAAM;KACpB,OAAO;KACP,SAASA,EAAM;KACf,OAAOA,EAAM;KACb,aAAaA,EAAM,eAAeA,EAAM;IAC1C,CAAC,CACH,CAEK;;EACN;;AAET"}
1
+ {"version":3,"file":"NotificationPreferencesPage.js","names":["CHANNEL_OPTIONS","TYPE_OPTIONS","NotificationPreferencesPage","useNotification","jsx","navigationV2","NotificationSettingsV2","ClassicNotificationPreferencesPage","PreferencesLoading","SectionLoaderOr","CompactMarkOr","tr","useTr","permissionsLoading","usePermissions","topicsLoading","topicsForbidden","useNotificationTopics","usePreferenceToggles","search","setSearch","useState","isLoading","preferencesLoading","filteredTopics","useMemo","topics","query","topic","renderPreferenceRow","existing","preferencesByKey","input","isEnabled","isSaving","savingKey","feedback","saveFeedback","BellRing","resetPreference","togglePreference","ToggleRight","ToggleLeft","hasPermission","NOTIFICATION_PERMISSIONS","currentUser","PagePurpose","EmphasisPanel","OptionalFields","channel","type","Search","event","IllustratedEmptyState"],"sources":["../../src/pages/NotificationPreferencesPage.tsx"],"sourcesContent":["import { useMemo, useState } from 'react';\nimport { BellRing, Search, ToggleLeft, ToggleRight } from 'lucide-react';\nimport { usePermissions } from '@burdenoff/fe-libs/shared/providers/shell';\nimport {\n EmphasisPanel,\n IllustratedEmptyState,\n OptionalFields,\n PagePurpose,\n} from '@burdenoff/fe-libs/ui';\nimport { useNotificationTopics } from '../hooks';\nimport { usePreferenceToggles } from '../hooks/usePreferenceToggles';\nimport { NOTIFICATION_PERMISSIONS } from '../constants/permissions';\nimport { useNotification } from '../providers/NotificationProvider';\nimport { useTr } from '../shared/hooks/useTr';\nimport type { NotificationChannel, NotificationPreferenceScope, NotificationType } from '../types';\nimport { NotificationSettingsV2 } from '../navigation-v2/NotificationSettingsV2';\nimport { CompactMarkOr, SectionLoaderOr } from '../components/loadingSystem';\n\nconst CHANNEL_OPTIONS: Array<{ value: NotificationChannel; labelKey: string; label: string }> = [\n { value: 'IN_APP', labelKey: 'notifications.channelInApp', label: 'In-app' },\n { value: 'EMAIL', labelKey: 'notifications.channelEmail', label: 'Email' },\n { value: 'PUSH', labelKey: 'notifications.channelPush', label: 'Push' },\n { value: 'SMS', labelKey: 'notifications.channelSms', label: 'SMS' },\n { value: 'WHATSAPP', labelKey: 'notifications.channelWhatsapp', label: 'WhatsApp' },\n { value: 'SLACK', labelKey: 'notifications.channelSlack', label: 'Slack' },\n];\n\nconst TYPE_OPTIONS: Array<{ value: NotificationType; labelKey: string; label: string }> = [\n { value: 'TRANSACTIONAL', labelKey: 'notifications.typeTransactional', label: 'Transactional' },\n { value: 'SYSTEM', labelKey: 'notifications.typeSystem', label: 'System' },\n { value: 'ALERT', labelKey: 'notifications.typeAlert', label: 'Alerts' },\n { value: 'MARKETING', labelKey: 'notifications.typeMarketing', label: 'Marketing' },\n];\n\n/**\n * Notification preferences. Under FluidGrids' Navigation v2 (BOFF-11872) it\n * is \"Notification settings\" instead; every other app keeps this page.\n */\nexport function NotificationPreferencesPage() {\n const { navigationV2 } = useNotification();\n return navigationV2 ? <NotificationSettingsV2 /> : <ClassicNotificationPreferencesPage />;\n}\n\n/** While the reader's permissions load: today's ring, or the loading system's section loader. */\nfunction PreferencesLoading() {\n return (\n <SectionLoaderOr\n minHeight=\"16rem\"\n today={\n <div className=\"flex h-64 items-center justify-center\">\n <CompactMarkOr\n className=\"h-8 w-8\"\n today={\n <div className=\"h-8 w-8 animate-spin rounded-full border-4 border-primary border-t-transparent\" />\n }\n />\n </div>\n }\n />\n );\n}\n\nfunction ClassicNotificationPreferencesPage() {\n const tr = useTr();\n const { hasPermission, isLoading: permissionsLoading } = usePermissions();\n const { currentUser } = useNotification();\n const {\n topics,\n isLoading: topicsLoading,\n isForbidden: topicsForbidden,\n } = useNotificationTopics({\n type: 'MARKETING',\n isActive: true,\n });\n const {\n preferencesByKey,\n preferencesLoading,\n savingKey,\n saveFeedback,\n togglePreference,\n resetPreference,\n } = usePreferenceToggles();\n const [search, setSearch] = useState('');\n\n const isLoading = topicsLoading || preferencesLoading;\n\n const filteredTopics = useMemo(() => {\n if (!search.trim()) {\n return topics;\n }\n\n const query = search.toLowerCase();\n return topics.filter(\n (topic) =>\n topic.name.toLowerCase().includes(query) ||\n topic.slug.toLowerCase().includes(query) ||\n topic.description?.toLowerCase().includes(query)\n );\n }, [search, topics]);\n\n const renderPreferenceRow = (input: {\n key: string;\n title: string;\n description: string;\n scope: NotificationPreferenceScope;\n channel?: NotificationChannel;\n type?: NotificationType;\n topicId?: string;\n }) => {\n const existing = preferencesByKey.get(input.key);\n const isEnabled = existing?.enabled ?? true;\n const isSaving = savingKey === input.key;\n const feedback = saveFeedback?.key === input.key ? saveFeedback : null;\n\n return (\n <div\n key={input.key}\n className=\"rounded-lg border border-border-seam bg-gloss-card p-4 transition-[box-shadow,border-color] duration-200 hover:shadow-[var(--shadow-pop)]\"\n >\n <div className=\"flex flex-col gap-3 sm:flex-row sm:items-center sm:justify-between\">\n <div className=\"space-y-1\">\n <div className=\"flex items-center gap-2\">\n <BellRing size={16} className=\"text-accent-primary\" />\n <h2 className=\"text-sm font-semibold text-primary\">{input.title}</h2>\n {existing && (\n <span className=\"rounded-full bg-bg-sunken px-2 py-0.5 text-xs text-text-secondary\">\n {existing.frequency.replace('_', ' ').toLowerCase()}\n </span>\n )}\n </div>\n <p className=\"text-sm text-text-secondary\">{input.description}</p>\n </div>\n\n <div className=\"flex items-center gap-2\">\n {existing && (\n <button\n type=\"button\"\n disabled={isSaving}\n onClick={() => resetPreference(input.key)}\n className=\"rounded-md border border-default px-3 py-2 text-sm text-text-secondary hover:bg-bg-sunken disabled:cursor-not-allowed disabled:opacity-50\"\n >\n {tr('notifications.reset', 'Reset')}\n </button>\n )}\n <button\n type=\"button\"\n aria-pressed={isEnabled}\n disabled={isSaving}\n onClick={() =>\n togglePreference({\n scope: input.scope,\n channel: input.channel,\n type: input.type,\n topicId: input.topicId,\n })\n }\n className={`inline-flex items-center gap-2 rounded-md border px-3 py-2 text-sm font-medium transition-colors ${\n isEnabled\n ? 'border-accent-primary bg-action-primary-bg text-text-inverse hover:opacity-90'\n : 'border-default bg-bg-sunken text-text-secondary hover:bg-bg-sunken/80'\n } disabled:cursor-not-allowed disabled:opacity-50`}\n >\n {isEnabled ? <ToggleRight size={18} /> : <ToggleLeft size={18} />}\n {isSaving\n ? tr('notifications.saving', 'Saving...')\n : isEnabled\n ? tr('notifications.enabled', 'Enabled')\n : tr('notifications.disabled', 'Disabled')}\n </button>\n </div>\n </div>\n <div className=\"mt-3 min-h-5\" aria-live=\"polite\">\n {feedback && (\n <p className={`text-xs ${feedback.type === 'success' ? 'text-success' : 'text-error'}`}>\n {feedback.message}\n </p>\n )}\n </div>\n </div>\n );\n };\n\n if (permissionsLoading) {\n return <PreferencesLoading />;\n }\n\n if (!hasPermission(NOTIFICATION_PERMISSIONS.NOTIFICATION_LIST) && !currentUser?.id) {\n return (\n <div className=\"p-8 text-center text-text-secondary\">\n {tr(\n 'notifications.noPermissionPreferences',\n \"You don't have permission to manage notification preferences.\"\n )}\n </div>\n );\n }\n\n return (\n <div data-tour=\"notification-preferences-page\" className=\"space-y-6 p-4 sm:p-6\">\n <div>\n <h1 className=\"text-2xl font-bold text-primary\">\n {tr('notifications.preferencesTitle', 'Notification Preferences')}\n </h1>\n <p className=\"mt-1 text-sm text-text-secondary\">\n {tr(\n 'notifications.preferencesSubtitle',\n 'Control global, channel, type, and topic-level notification delivery.'\n )}\n </p>\n </div>\n\n <PagePurpose icon={<BellRing size={16} />}>\n {tr(\n 'notifications.preferencesPurpose',\n 'Decide how and when we reach you. The Global switch is your master on/off, then you can fine-tune individual channels (email, push, SMS…), notification types and the marketing topics you have subscribed to. Settings cascade — turning a channel off silences it everywhere.'\n )}\n </PagePurpose>\n\n <EmphasisPanel data-tour=\"notification-preferences-global\" className=\"space-y-3 p-5 sm:p-6\">\n <h2 className=\"text-sm font-semibold uppercase tracking-wide text-tertiary\">\n {tr('notifications.globalPreferences', 'Global')}\n </h2>\n {renderPreferenceRow({\n key: 'GLOBAL',\n scope: 'GLOBAL',\n title: tr('notifications.allNotifications', 'All notifications'),\n description: tr(\n 'notifications.allNotificationsDescription',\n 'Master preference for notification delivery across all channels and types.'\n ),\n })}\n </EmphasisPanel>\n\n {/* Advanced: per-channel filter rules / quiet hours / custom templates — collapse the long-tail knobs */}\n <OptionalFields\n title={tr('notifications.advancedPreferences', 'Advanced settings')}\n description={tr(\n 'notifications.advancedPreferencesDescription',\n 'Per-channel filter rules, notification-type filters, and quiet-hour overrides.'\n )}\n >\n <section data-tour=\"notification-preferences-channels\" className=\"space-y-3\">\n <h2 className=\"text-sm font-semibold uppercase tracking-wide text-tertiary\">\n {tr('notifications.channelPreferences', 'Channels')}\n </h2>\n <div className=\"grid gap-3 lg:grid-cols-2\">\n {CHANNEL_OPTIONS.map((channel) =>\n renderPreferenceRow({\n key: `CHANNEL:${channel.value}`,\n scope: 'CHANNEL',\n channel: channel.value,\n title: tr(channel.labelKey, channel.label),\n description: tr(\n 'notifications.channelPreferenceDescription',\n 'Control delivery for this channel.'\n ),\n })\n )}\n </div>\n </section>\n\n <section data-tour=\"notification-preferences-types\" className=\"mt-6 space-y-3\">\n <h2 className=\"text-sm font-semibold uppercase tracking-wide text-tertiary\">\n {tr('notifications.typePreferences', 'Notification Types')}\n </h2>\n <div className=\"grid gap-3 lg:grid-cols-2\">\n {TYPE_OPTIONS.map((type) =>\n renderPreferenceRow({\n key: `TYPE:${type.value}`,\n scope: 'TYPE',\n type: type.value,\n title: tr(type.labelKey, type.label),\n description: tr(\n 'notifications.typePreferenceDescription',\n 'Control delivery for this notification type.'\n ),\n })\n )}\n </div>\n </section>\n </OptionalFields>\n\n <div className=\"relative max-w-xl\">\n <Search size={16} className=\"absolute left-3 top-1/2 -translate-y-1/2 text-tertiary\" />\n <input\n type=\"text\"\n value={search}\n onChange={(event) => setSearch(event.target.value)}\n aria-label={tr('notifications.searchTopics', 'Search topics...')}\n placeholder={tr('notifications.searchTopics', 'Search topics...')}\n className=\"w-full rounded-lg border border-default bg-surface py-2 pl-9 pr-4 text-sm text-primary focus:outline-none focus:ring-2 focus:ring-accent\"\n />\n </div>\n\n <section data-tour=\"notification-preferences-topics\" className=\"space-y-3\">\n <h2 className=\"text-sm font-semibold uppercase tracking-wide text-tertiary\">\n {tr('notifications.topicPreferences', 'Topics')}\n </h2>\n {isLoading ? (\n <div className=\"rounded-lg border border-default bg-surface p-6 text-sm text-text-secondary\">\n {tr('notifications.loadingPreferences', 'Loading preferences...')}\n </div>\n ) : topicsForbidden ? (\n <IllustratedEmptyState\n illustration=\"empty-generic\"\n title={tr(\n 'notifications.topicsNoAccessTitle',\n \"You don't have access to notification topics\"\n )}\n description={tr(\n 'notifications.topicsNoAccessDescription',\n \"Your role doesn't include permission to read notification topics. Ask a workspace admin if you need access.\"\n )}\n kind=\"no-access\"\n size=\"panel\"\n />\n ) : filteredTopics.length === 0 ? (\n <IllustratedEmptyState\n illustration={search.trim() ? 'empty-search' : 'empty-data'}\n title={\n search.trim()\n ? tr('notifications.noTopicsFound', 'No topics match your search')\n : tr('notifications.noTopicsAvailableTitle', 'No subscribable topics yet')\n }\n description={\n search.trim()\n ? tr('notifications.adjustSearchOrDateRange', 'Try adjusting your filters')\n : tr(\n 'notifications.noTopicsAvailableDescription',\n 'When marketing topics are published you can subscribe or unsubscribe from each one here.'\n )\n }\n kind={search.trim() ? 'no-results' : 'first-use'}\n glassIllustration=\"notifications\"\n size=\"panel\"\n />\n ) : (\n filteredTopics.map((topic) =>\n renderPreferenceRow({\n key: `TOPIC:${topic.id}`,\n scope: 'TOPIC',\n topicId: topic.id,\n title: topic.name,\n description: topic.description || topic.slug,\n })\n )\n )}\n </section>\n </div>\n );\n}\n"],"mappings":";;;;;;;;;;;;;AAkBA,IAAMA,IAA0F;CAC9F;EAAE,OAAO;EAAU,UAAU;EAA8B,OAAO;CAAS;CAC3E;EAAE,OAAO;EAAS,UAAU;EAA8B,OAAO;CAAQ;CACzE;EAAE,OAAO;EAAQ,UAAU;EAA6B,OAAO;CAAO;CACtE;EAAE,OAAO;EAAO,UAAU;EAA4B,OAAO;CAAM;CACnE;EAAE,OAAO;EAAY,UAAU;EAAiC,OAAO;CAAW;CAClF;EAAE,OAAO;EAAS,UAAU;EAA8B,OAAO;CAAQ;AAC3E,GAEMC,IAAoF;CACxF;EAAE,OAAO;EAAiB,UAAU;EAAmC,OAAO;CAAgB;CAC9F;EAAE,OAAO;EAAU,UAAU;EAA4B,OAAO;CAAS;CACzE;EAAE,OAAO;EAAS,UAAU;EAA2B,OAAO;CAAS;CACvE;EAAE,OAAO;EAAa,UAAU;EAA+B,OAAO;CAAY;AACpF;AAMA,SAAgBC,IAA8B;CAC5C,IAAM,EAAE,oBAAiBC,EAAgB;CACzC,OAAsBC,EAAfC,IAAgBC,IAA6BC,GAA9B,CAAyB,CAAyC;AAC1F;AAGA,SAASC,IAAqB;CAC5B,OACE,kBAACC,GAAD;EACE,WA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K,MAClBK,EAAoB;KAClB,KAAK,SAASD,EAAM;KACpB,OAAO;KACP,SAASA,EAAM;KACf,OAAOA,EAAM;KACb,aAAaA,EAAM,eAAeA,EAAM;IAC1C,CAAC,CACH,CAEK;;EACN;;AAET"}
@@ -1,5 +1,4 @@
1
1
  import { useNotificationTopics as e } from "../hooks/useNotificationTopics.js";
2
- import "../hooks/index.js";
3
2
  import { NOTIFICATION_PERMISSIONS as t } from "../constants/permissions.js";
4
3
  import { useTr as n } from "../shared/hooks/useTr.js";
5
4
  import { ConfirmDeleteDialog as r } from "../components/ConfirmDeleteDialog.js";
@@ -1 +1 @@
1
- {"version":3,"file":"NotificationTopicsPage.js","names":["topicTypeOptions","slugify","value","NotificationTopicsPage","tr","useTr","permissionsLoading","usePermissions","useNotificationTopics","paths","useNotificationPaths","search","setSearch","useState","pendingDelete","setPendingDelete","editingId","setEditingId","form","setForm","canManage","hasPermission","NOTIFICATION_PERMISSIONS","filteredTopics","useMemo","topics","query","topic","SectionLoaderOr","CompactMarkOr","PagePurpose","Plus","NextSteps","prev","EmphasisPanel","event","updateTopic","createTopic","ThemedSelect","option","Save","GlassCard","Search","isLoading","isForbidden","IllustratedEmptyState","Trash2","ConfirmDeleteDialog","target","deleteTopic"],"sources":["../../src/pages/NotificationTopicsPage.tsx"],"sourcesContent":["import { useMemo, useState } from 'react';\nimport { Plus, Save, Search, Trash2 } from 'lucide-react';\nimport { usePermissions } from '@burdenoff/fe-libs/shared/providers/shell';\nimport {\n EmphasisPanel,\n GlassCard,\n IllustratedEmptyState,\n NextSteps,\n PagePurpose,\n ThemedSelect,\n} from '@burdenoff/fe-libs/ui';\nimport { useNotificationTopics } from '../hooks';\nimport { NOTIFICATION_PERMISSIONS } from '../constants/permissions';\nimport { useTr } from '../shared/hooks/useTr';\nimport { ConfirmDeleteDialog } from '../components/ConfirmDeleteDialog';\nimport { useNotificationPaths } from '../navigation-v2/paths';\nimport { CompactMarkOr, SectionLoaderOr } from '../components/loadingSystem';\n\nconst topicTypeOptions = [\n { value: 'MARKETING', labelKey: 'notifications.topicType.marketing', label: 'Marketing' },\n {\n value: 'TRANSACTIONAL',\n labelKey: 'notifications.topicType.transactional',\n label: 'Transactional',\n },\n { value: 'SYSTEM', labelKey: 'notifications.topicType.system', label: 'System' },\n { value: 'ALERT', labelKey: 'notifications.topicType.alert', label: 'Alert' },\n];\n\nfunction slugify(value: string) {\n return value\n .toLowerCase()\n .trim()\n .replace(/[^a-z0-9\\s-]/g, '')\n .replace(/\\s+/g, '-')\n .replace(/-+/g, '-');\n}\n\nexport function NotificationTopicsPage() {\n const tr = useTr();\n const { hasPermission, isLoading: permissionsLoading } = usePermissions();\n const { topics, isLoading, isForbidden, createTopic, updateTopic, deleteTopic } =\n useNotificationTopics();\n const paths = useNotificationPaths();\n const [search, setSearch] = useState('');\n // The topic waiting for a \"Delete?\" answer (BOFF-11872 §8 item 7).\n const [pendingDelete, setPendingDelete] = useState<{ id: string; name: string } | null>(null);\n const [editingId, setEditingId] = useState<string | null>(null);\n const [form, setForm] = useState({\n name: '',\n slug: '',\n description: '',\n type: 'MARKETING',\n isActive: true,\n });\n\n // Topics live under the `notification` resource type in the backend (see\n // `global-notification-svc/src/modules/notification/schema/mutations.gql`),\n // and create/update/delete all require `notification:create` per the\n // @rbac directive. SUPER_ADMIN bypass is inherited from PermissionProvider.\n const canManage = hasPermission(NOTIFICATION_PERMISSIONS.NOTIFICATION_CREATE);\n\n const filteredTopics = useMemo(() => {\n if (!search.trim()) {\n return topics;\n }\n\n const query = search.toLowerCase();\n return topics.filter(\n (topic) =>\n topic.name.toLowerCase().includes(query) ||\n topic.slug.toLowerCase().includes(query) ||\n topic.description?.toLowerCase().includes(query)\n );\n }, [search, topics]);\n\n if (permissionsLoading) {\n return (\n <SectionLoaderOr\n minHeight=\"16rem\"\n today={\n <div className=\"flex h-64 items-center justify-center\">\n <CompactMarkOr\n className=\"h-8 w-8\"\n today={\n <div className=\"h-8 w-8 animate-spin rounded-full border-4 border-primary border-t-transparent\" />\n }\n />\n </div>\n }\n />\n );\n }\n\n if (!canManage) {\n return (\n <div className=\"p-8 text-center text-text-secondary\">\n {tr(\n 'notifications.noPermissionTopics',\n \"You don't have permission to manage notification topics.\"\n )}\n </div>\n );\n }\n\n return (\n <div className=\"space-y-6 p-4 sm:p-6\">\n <div>\n <h1 className=\"text-2xl font-bold text-primary\">\n {tr('notifications.topicsTitle', 'Notification Topics')}\n </h1>\n <p className=\"mt-1 text-sm text-text-secondary\">\n {tr(\n 'notifications.topicsSubtitle',\n 'Create topics for campaigns so users can subscribe or unsubscribe with precision.'\n )}\n </p>\n </div>\n\n <PagePurpose icon={<Plus size={16} />}>\n {tr(\n 'notifications.topicsPurpose',\n 'Topics group related notifications (e.g. \"Product updates\", \"Billing reminders\", \"Weekly digest\") so people can opt in or out of exactly what they care about. Create a topic here, then target it when sending a campaign and let users manage their own subscriptions in Preferences.'\n )}\n </PagePurpose>\n\n <NextSteps\n storageKey=\"notification-topics\"\n steps={[\n {\n id: 'name-topic',\n label: tr('notifications.topicsNextNameLabel', 'Name your first topic'),\n description: tr(\n 'notifications.topicsNextNameDesc',\n 'Use the form to add a clear topic like \"Product updates\" — the slug is generated for you.'\n ),\n onClick: () => {\n setEditingId(null);\n setForm((prev) => ({ ...prev, name: '', slug: '', type: 'MARKETING' }));\n document\n .getElementById('notification-topic-name')\n ?.scrollIntoView({ behavior: 'smooth', block: 'center' });\n document.getElementById('notification-topic-name')?.focus();\n },\n },\n {\n id: 'set-type',\n label: tr('notifications.topicsNextTypeLabel', 'Pick the right type'),\n description: tr(\n 'notifications.topicsNextTypeDesc',\n 'Marketing topics are opt-in for users; Transactional, System and Alert reach everyone.'\n ),\n onClick: () =>\n document\n .getElementById('notification-topic-type')\n ?.scrollIntoView({ behavior: 'smooth', block: 'center' }),\n },\n {\n id: 'let-subscribe',\n label: tr('notifications.topicsNextSubscribeLabel', 'Let people subscribe'),\n description: tr(\n 'notifications.topicsNextSubscribeDesc',\n 'Once a topic is active, users manage their own opt-ins from the Preferences page.'\n ),\n // Absolute: a relative href resolved against the page URL and\n // opened a page that does not exist (BOFF-11872 §8 item 4).\n href: paths.preferences,\n },\n ]}\n />\n\n <div className=\"grid gap-6 xl:grid-cols-[380px,1fr]\">\n {/* Single emphasis zone — the create/edit form is the primary action on this page. */}\n <EmphasisPanel className=\"p-4\">\n <form\n className=\"space-y-4\"\n onSubmit={async (event) => {\n event.preventDefault();\n\n if (!form.name.trim() || !form.slug.trim()) {\n return;\n }\n\n if (editingId) {\n await updateTopic(editingId, form);\n } else {\n await createTopic(form);\n }\n\n setEditingId(null);\n setForm({\n name: '',\n slug: '',\n description: '',\n type: 'MARKETING',\n isActive: true,\n });\n }}\n >\n <div className=\"flex items-center gap-2\">\n <Plus size={18} className=\"text-accent-primary\" />\n <h2 className=\"text-base font-semibold text-primary\">\n {editingId\n ? tr('notifications.editTopic', 'Edit Topic')\n : tr('notifications.createTopic', 'Create Topic')}\n </h2>\n </div>\n\n <label className=\"block space-y-1 text-sm text-text-secondary\">\n <span>{tr('notifications.topicName', 'Name')}</span>\n <input\n id=\"notification-topic-name\"\n type=\"text\"\n value={form.name}\n onChange={(event) =>\n setForm((prev) => ({\n ...prev,\n name: event.target.value,\n slug: editingId ? prev.slug : slugify(event.target.value),\n }))\n }\n className=\"w-full rounded-md border border-default bg-bg-canvas px-3 py-2 text-primary focus:outline-none focus:ring-2 focus:ring-accent\"\n />\n </label>\n\n <label className=\"block space-y-1 text-sm text-text-secondary\">\n <span>{tr('notifications.topicSlug', 'Slug')}</span>\n <input\n type=\"text\"\n value={form.slug}\n onChange={(event) =>\n setForm((prev) => ({ ...prev, slug: slugify(event.target.value) }))\n }\n className=\"w-full rounded-md border border-default bg-bg-canvas px-3 py-2 text-primary focus:outline-none focus:ring-2 focus:ring-accent\"\n />\n </label>\n\n <label className=\"block space-y-1 text-sm text-text-secondary\">\n <span>{tr('notifications.topicType', 'Type')}</span>\n <ThemedSelect\n id=\"notification-topic-type\"\n value={form.type}\n onChange={(event) => setForm((prev) => ({ ...prev, type: event.target.value }))}\n className=\"w-full rounded-md border border-default bg-bg-canvas px-3 py-2 text-primary focus:outline-none focus:ring-2 focus:ring-accent scheme-normal dark:scheme-dark [&_option]:bg-bg-surface [&_option]:text-text-primary\"\n >\n {topicTypeOptions.map((option) => (\n <option key={option.value} value={option.value}>\n {tr(option.labelKey, option.label)}\n </option>\n ))}\n </ThemedSelect>\n </label>\n\n <label className=\"block space-y-1 text-sm text-text-secondary\">\n <span>{tr('notifications.topicDescription', 'Description')}</span>\n <textarea\n value={form.description}\n onChange={(event) =>\n setForm((prev) => ({ ...prev, description: event.target.value }))\n }\n rows={4}\n className=\"w-full rounded-md border border-default bg-bg-canvas px-3 py-2 text-primary focus:outline-none focus:ring-2 focus:ring-accent\"\n />\n </label>\n\n <label className=\"flex items-center gap-2 text-sm text-text-secondary\">\n <input\n type=\"checkbox\"\n checked={form.isActive}\n onChange={(event) =>\n setForm((prev) => ({ ...prev, isActive: event.target.checked }))\n }\n />\n <span>{tr('notifications.topicIsActive', 'Active topic')}</span>\n </label>\n\n <div className=\"flex items-center gap-3\">\n <button\n type=\"submit\"\n className=\"inline-flex items-center gap-2 rounded-md bg-accent-primary px-4 py-2 text-sm font-medium text-white hover:opacity-90\"\n >\n <Save size={16} />\n {editingId\n ? tr('notifications.saveTopic', 'Save Topic')\n : tr('notifications.createTopicButton', 'Create Topic')}\n </button>\n\n {editingId && (\n <button\n type=\"button\"\n onClick={() => {\n setEditingId(null);\n setForm({\n name: '',\n slug: '',\n description: '',\n type: 'MARKETING',\n isActive: true,\n });\n }}\n className=\"rounded-md border border-default px-4 py-2 text-sm text-text-secondary hover:bg-bg-sunken\"\n >\n {tr('notifications.cancelTopicEdit', 'Cancel')}\n </button>\n )}\n </div>\n </form>\n </EmphasisPanel>\n\n <GlassCard treatment=\"plain\" className=\"space-y-4 border-border-seam p-4\">\n <div className=\"relative max-w-md\">\n <Search size={16} className=\"absolute left-3 top-1/2 -translate-y-1/2 text-tertiary\" />\n <input\n type=\"text\"\n value={search}\n onChange={(event) => setSearch(event.target.value)}\n placeholder={tr('notifications.searchTopics', 'Search topics...')}\n className=\"w-full rounded-md border border-default bg-bg-canvas py-2 pl-9 pr-4 text-sm text-primary focus:outline-none focus:ring-2 focus:ring-accent\"\n />\n </div>\n\n <div className=\"space-y-3\">\n {isLoading ? (\n <div className=\"text-sm text-text-secondary\">\n {tr('notifications.loadingTopics', 'Loading topics...')}\n </div>\n ) : isForbidden ? (\n <IllustratedEmptyState\n illustration=\"empty-generic\"\n title={tr(\n 'notifications.topicsNoAccessTitle',\n \"You don't have access to notification topics\"\n )}\n description={tr(\n 'notifications.topicsNoAccessDescription',\n \"Your role doesn't include permission to read notification topics. Ask a workspace admin if you need access.\"\n )}\n kind=\"no-access\"\n />\n ) : filteredTopics.length === 0 ? (\n <IllustratedEmptyState\n illustration={search.trim() ? 'empty-search' : 'empty-data'}\n title={tr('notifications.noTopicsFound', 'No topics found.')}\n description={\n search.trim()\n ? tr('notifications.adjustSearchOrDateRange', 'Try adjusting your filters')\n : tr(\n 'notifications.noTopicsYet',\n 'No notification topics have been created yet.'\n )\n }\n kind={search.trim() ? 'no-results' : 'first-use'}\n glassIllustration=\"notifications\"\n />\n ) : (\n filteredTopics.map((topic) => (\n <div\n key={topic.id}\n className=\"flex flex-col gap-3 rounded-lg border border-border-seam bg-surface p-4 transition-[box-shadow,border-color] duration-200 hover:shadow-[var(--shadow-pop)] sm:flex-row sm:items-start sm:justify-between\"\n >\n <div className=\"space-y-1\">\n <div className=\"flex flex-wrap items-center gap-2\">\n <h3 className=\"text-sm font-semibold text-primary\">{topic.name}</h3>\n <span className=\"rounded-full bg-bg-sunken px-2 py-0.5 text-xs text-text-secondary\">\n {topic.slug}\n </span>\n <span className=\"rounded-full bg-bg-sunken px-2 py-0.5 text-xs text-text-secondary\">\n {topic.type}\n </span>\n </div>\n {topic.description && (\n <p className=\"text-sm text-text-secondary\">{topic.description}</p>\n )}\n <p className=\"text-xs text-tertiary\">\n {tr('notifications.topicSubscribers', 'Subscribers')}: {topic.subscriberCount}\n </p>\n </div>\n\n <div className=\"flex items-center gap-2\">\n <button\n type=\"button\"\n onClick={() => {\n setEditingId(topic.id);\n setForm({\n name: topic.name,\n slug: topic.slug,\n description: topic.description || '',\n type: topic.type,\n isActive: topic.isActive,\n });\n }}\n className=\"rounded-md border border-default px-3 py-2 text-sm text-text-secondary hover:bg-bg-sunken\"\n >\n {tr('notifications.edit', 'Edit')}\n </button>\n <button\n type=\"button\"\n onClick={() => setPendingDelete({ id: topic.id, name: topic.name })}\n className=\"inline-flex items-center gap-2 rounded-md border border-status-error-border px-3 py-2 text-sm text-status-error-text hover:bg-status-error-bg-subtle\"\n >\n <Trash2 size={14} />\n {tr('notifications.delete', 'Delete')}\n </button>\n </div>\n </div>\n ))\n )}\n </div>\n </GlassCard>\n </div>\n\n <ConfirmDeleteDialog\n open={pendingDelete !== null}\n title={tr('notifications.deleteTopicTitle', 'Delete topic')}\n description={tr(\n 'notifications.deleteTopicConfirm',\n 'Delete the topic \"{{name}}\"? It is removed for everyone and this cannot be undone.',\n { name: pendingDelete?.name ?? '' }\n )}\n onCancel={() => setPendingDelete(null)}\n onConfirm={() => {\n const target = pendingDelete;\n setPendingDelete(null);\n if (target) void deleteTopic(target.id);\n }}\n />\n </div>\n );\n}\n"],"mappings":";;;;;;;;;;;;;AAkBA,IAAMA,IAAmB;CACvB;EAAE,OAAO;EAAa,UAAU;EAAqC,OAAO;CAAY;CACxF;EACE,OAAO;EACP,UAAU;EACV,OAAO;CACT;CACA;EAAE,OAAO;EAAU,UAAU;EAAkC,OAAO;CAAS;CAC/E;EAAE,OAAO;EAAS,UAAU;EAAiC,OAAO;CAAQ;AAC9E;AAEA,SAASC,EAAQ,GAAe;CAC9B,OAAOC,EACJ,YAAY,CAAC,CACb,KAAK,CAAC,CACN,QAAQ,iBAAiB,EAAE,CAAC,CAC5B,QAAQ,QAAQ,GAAG,CAAC,CACpB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EAAM;WACZ,MAAMA,EAAM;WACZ,aAAaA,EAAM,eAAe;WAClC,MAAMA,EAAM;WACZ,UAAUA,EAAM;UAClB,CAAC;SACH;SACA,WAAU;SAET,UAAAvB,EAAG,sBAAsB,MAAM;QAC1B,CAAA,GACR,kBAAC,UAAD;SACE,MAAK;SACL,eAAeW,EAAiB;UAAE,IAAIY,EAAM;UAAI,MAAMA,EAAM;SAAK,CAAC;SAClE,WAAU;SAHZ,UAAA,CAKE,kBAACmB,GAAD,EAAQ,MAAM,GAAK,CAAA,GAClB1C,EAAG,wBAAwB,QAAQ,CAC9B;QACL,CAAA,CAAA;OACF,CAAA,CAAA;MA/CE,GAAAuB,EAAM,EA+CR,CACN;KAEA,CAAA,CACI;IACR,CAAA,CAAA;;GAEL,kBAACoB,GAAD;IACE,MAAMjC,MAAkB;IACxB,OAAOV,EAAG,kCAAkC,cAAc;IAC1D,aAAaA,EACX,oCACA,wFACA,EAAE,MAAMU,GAAe,QAAQ,GAAG,CACpC;IACA,gBAAgBC,EAAiB,IAAI;IACrC,iBAAiB;KACf,IAAMiC,IAASlC;KAEf,AADAC,EAAiB,IAAI,GACjBiC,KAAQC,EAAiBD,EAAO,EAAE;IACxC;GACD,CAAA;EACE;C,KA1UH,kBAAC,OAAD;EAAK,WAAU;EACZ,UAAA5C,EACC,oCACA,0DACF;CACG,CAAA;AAuUX"}
1
+ {"version":3,"file":"NotificationTopicsPage.js","names":["topicTypeOptions","slugify","value","NotificationTopicsPage","tr","useTr","permissionsLoading","usePermissions","useNotificationTopics","paths","useNotificationPaths","search","setSearch","useState","pendingDelete","setPendingDelete","editingId","setEditingId","form","setForm","canManage","hasPermission","NOTIFICATION_PERMISSIONS","filteredTopics","useMemo","topics","query","topic","SectionLoaderOr","CompactMarkOr","PagePurpose","Plus","NextSteps","prev","EmphasisPanel","event","updateTopic","createTopic","ThemedSelect","option","Save","GlassCard","Search","isLoading","isForbidden","IllustratedEmptyState","Trash2","ConfirmDeleteDialog","target","deleteTopic"],"sources":["../../src/pages/NotificationTopicsPage.tsx"],"sourcesContent":["import { useMemo, useState } from 'react';\nimport { Plus, Save, Search, Trash2 } from 'lucide-react';\nimport { usePermissions } from '@burdenoff/fe-libs/shared/providers/shell';\nimport {\n EmphasisPanel,\n GlassCard,\n IllustratedEmptyState,\n NextSteps,\n PagePurpose,\n ThemedSelect,\n} from '@burdenoff/fe-libs/ui';\nimport { useNotificationTopics } from '../hooks';\nimport { NOTIFICATION_PERMISSIONS } from '../constants/permissions';\nimport { useTr } from '../shared/hooks/useTr';\nimport { ConfirmDeleteDialog } from '../components/ConfirmDeleteDialog';\nimport { useNotificationPaths } from '../navigation-v2/paths';\nimport { CompactMarkOr, SectionLoaderOr } from '../components/loadingSystem';\n\nconst topicTypeOptions = [\n { value: 'MARKETING', labelKey: 'notifications.topicType.marketing', label: 'Marketing' },\n {\n value: 'TRANSACTIONAL',\n labelKey: 'notifications.topicType.transactional',\n label: 'Transactional',\n },\n { value: 'SYSTEM', labelKey: 'notifications.topicType.system', label: 'System' },\n { value: 'ALERT', labelKey: 'notifications.topicType.alert', label: 'Alert' },\n];\n\nfunction slugify(value: string) {\n return value\n .toLowerCase()\n .trim()\n .replace(/[^a-z0-9\\s-]/g, '')\n .replace(/\\s+/g, '-')\n .replace(/-+/g, '-');\n}\n\nexport function NotificationTopicsPage() {\n const tr = useTr();\n const { hasPermission, isLoading: permissionsLoading } = usePermissions();\n const { topics, isLoading, isForbidden, createTopic, updateTopic, deleteTopic } =\n useNotificationTopics();\n const paths = useNotificationPaths();\n const [search, setSearch] = useState('');\n // The topic waiting for a \"Delete?\" answer (BOFF-11872 §8 item 7).\n const [pendingDelete, setPendingDelete] = useState<{ id: string; name: string } | null>(null);\n const [editingId, setEditingId] = useState<string | null>(null);\n const [form, setForm] = useState({\n name: '',\n slug: '',\n description: '',\n type: 'MARKETING',\n isActive: true,\n });\n\n // Topics live under the `notification` resource type in the backend (see\n // `global-notification-svc/src/modules/notification/schema/mutations.gql`),\n // and create/update/delete all require `notification:create` per the\n // @rbac directive. SUPER_ADMIN bypass is inherited from PermissionProvider.\n const canManage = hasPermission(NOTIFICATION_PERMISSIONS.NOTIFICATION_CREATE);\n\n const filteredTopics = useMemo(() => {\n if (!search.trim()) {\n return topics;\n }\n\n const query = search.toLowerCase();\n return topics.filter(\n (topic) =>\n topic.name.toLowerCase().includes(query) ||\n topic.slug.toLowerCase().includes(query) ||\n topic.description?.toLowerCase().includes(query)\n );\n }, [search, topics]);\n\n if (permissionsLoading) {\n return (\n <SectionLoaderOr\n minHeight=\"16rem\"\n today={\n <div className=\"flex h-64 items-center justify-center\">\n <CompactMarkOr\n className=\"h-8 w-8\"\n today={\n <div className=\"h-8 w-8 animate-spin rounded-full border-4 border-primary border-t-transparent\" />\n }\n />\n </div>\n }\n />\n );\n }\n\n if (!canManage) {\n return (\n <div className=\"p-8 text-center text-text-secondary\">\n {tr(\n 'notifications.noPermissionTopics',\n \"You don't have permission to manage notification topics.\"\n )}\n </div>\n );\n }\n\n return (\n <div className=\"space-y-6 p-4 sm:p-6\">\n <div>\n <h1 className=\"text-2xl font-bold text-primary\">\n {tr('notifications.topicsTitle', 'Notification Topics')}\n </h1>\n <p className=\"mt-1 text-sm text-text-secondary\">\n {tr(\n 'notifications.topicsSubtitle',\n 'Create topics for campaigns so users can subscribe or unsubscribe with precision.'\n )}\n </p>\n </div>\n\n <PagePurpose icon={<Plus size={16} />}>\n {tr(\n 'notifications.topicsPurpose',\n 'Topics group related notifications (e.g. \"Product updates\", \"Billing reminders\", \"Weekly digest\") so people can opt in or out of exactly what they care about. Create a topic here, then target it when sending a campaign and let users manage their own subscriptions in Preferences.'\n )}\n </PagePurpose>\n\n <NextSteps\n storageKey=\"notification-topics\"\n steps={[\n {\n id: 'name-topic',\n label: tr('notifications.topicsNextNameLabel', 'Name your first topic'),\n description: tr(\n 'notifications.topicsNextNameDesc',\n 'Use the form to add a clear topic like \"Product updates\" — the slug is generated for you.'\n ),\n onClick: () => {\n setEditingId(null);\n setForm((prev) => ({ ...prev, name: '', slug: '', type: 'MARKETING' }));\n document\n .getElementById('notification-topic-name')\n ?.scrollIntoView({ behavior: 'smooth', block: 'center' });\n document.getElementById('notification-topic-name')?.focus();\n },\n },\n {\n id: 'set-type',\n label: tr('notifications.topicsNextTypeLabel', 'Pick the right type'),\n description: tr(\n 'notifications.topicsNextTypeDesc',\n 'Marketing topics are opt-in for users; Transactional, System and Alert reach everyone.'\n ),\n onClick: () =>\n document\n .getElementById('notification-topic-type')\n ?.scrollIntoView({ behavior: 'smooth', block: 'center' }),\n },\n {\n id: 'let-subscribe',\n label: tr('notifications.topicsNextSubscribeLabel', 'Let people subscribe'),\n description: tr(\n 'notifications.topicsNextSubscribeDesc',\n 'Once a topic is active, users manage their own opt-ins from the Preferences page.'\n ),\n // Absolute: a relative href resolved against the page URL and\n // opened a page that does not exist (BOFF-11872 §8 item 4).\n href: paths.preferences,\n },\n ]}\n />\n\n <div className=\"grid gap-6 xl:grid-cols-[380px,1fr]\">\n {/* Single emphasis zone — the create/edit form is the primary action on this page. */}\n <EmphasisPanel className=\"p-4\">\n <form\n className=\"space-y-4\"\n onSubmit={async (event) => {\n event.preventDefault();\n\n if (!form.name.trim() || !form.slug.trim()) {\n return;\n }\n\n if (editingId) {\n await updateTopic(editingId, form);\n } else {\n await createTopic(form);\n }\n\n setEditingId(null);\n setForm({\n name: '',\n slug: '',\n description: '',\n type: 'MARKETING',\n isActive: true,\n });\n }}\n >\n <div className=\"flex items-center gap-2\">\n <Plus size={18} className=\"text-accent-primary\" />\n <h2 className=\"text-base font-semibold text-primary\">\n {editingId\n ? tr('notifications.editTopic', 'Edit Topic')\n : tr('notifications.createTopic', 'Create Topic')}\n </h2>\n </div>\n\n <label className=\"block space-y-1 text-sm text-text-secondary\">\n <span>{tr('notifications.topicName', 'Name')}</span>\n <input\n id=\"notification-topic-name\"\n type=\"text\"\n value={form.name}\n onChange={(event) =>\n setForm((prev) => ({\n ...prev,\n name: event.target.value,\n slug: editingId ? prev.slug : slugify(event.target.value),\n }))\n }\n className=\"w-full rounded-md border border-default bg-bg-canvas px-3 py-2 text-primary focus:outline-none focus:ring-2 focus:ring-accent\"\n />\n </label>\n\n <label className=\"block space-y-1 text-sm text-text-secondary\">\n <span>{tr('notifications.topicSlug', 'Slug')}</span>\n <input\n type=\"text\"\n value={form.slug}\n onChange={(event) =>\n setForm((prev) => ({ ...prev, slug: slugify(event.target.value) }))\n }\n className=\"w-full rounded-md border border-default bg-bg-canvas px-3 py-2 text-primary focus:outline-none focus:ring-2 focus:ring-accent\"\n />\n </label>\n\n <label className=\"block space-y-1 text-sm text-text-secondary\">\n <span>{tr('notifications.topicType', 'Type')}</span>\n <ThemedSelect\n id=\"notification-topic-type\"\n value={form.type}\n onChange={(event) => setForm((prev) => ({ ...prev, type: event.target.value }))}\n className=\"w-full rounded-md border border-default bg-bg-canvas px-3 py-2 text-primary focus:outline-none focus:ring-2 focus:ring-accent scheme-normal dark:scheme-dark [&_option]:bg-bg-surface [&_option]:text-text-primary\"\n >\n {topicTypeOptions.map((option) => (\n <option key={option.value} value={option.value}>\n {tr(option.labelKey, option.label)}\n </option>\n ))}\n </ThemedSelect>\n </label>\n\n <label className=\"block space-y-1 text-sm text-text-secondary\">\n <span>{tr('notifications.topicDescription', 'Description')}</span>\n <textarea\n value={form.description}\n onChange={(event) =>\n setForm((prev) => ({ ...prev, description: event.target.value }))\n }\n rows={4}\n className=\"w-full rounded-md border border-default bg-bg-canvas px-3 py-2 text-primary focus:outline-none focus:ring-2 focus:ring-accent\"\n />\n </label>\n\n <label className=\"flex items-center gap-2 text-sm text-text-secondary\">\n <input\n type=\"checkbox\"\n checked={form.isActive}\n onChange={(event) =>\n setForm((prev) => ({ ...prev, isActive: event.target.checked }))\n }\n />\n <span>{tr('notifications.topicIsActive', 'Active topic')}</span>\n </label>\n\n <div className=\"flex items-center gap-3\">\n <button\n type=\"submit\"\n className=\"inline-flex items-center gap-2 rounded-md bg-accent-primary px-4 py-2 text-sm font-medium text-white hover:opacity-90\"\n >\n <Save size={16} />\n {editingId\n ? tr('notifications.saveTopic', 'Save Topic')\n : tr('notifications.createTopicButton', 'Create Topic')}\n </button>\n\n {editingId && (\n <button\n type=\"button\"\n onClick={() => {\n setEditingId(null);\n setForm({\n name: '',\n slug: '',\n description: '',\n type: 'MARKETING',\n isActive: true,\n });\n }}\n className=\"rounded-md border border-default px-4 py-2 text-sm text-text-secondary hover:bg-bg-sunken\"\n >\n {tr('notifications.cancelTopicEdit', 'Cancel')}\n </button>\n )}\n </div>\n </form>\n </EmphasisPanel>\n\n <GlassCard treatment=\"plain\" className=\"space-y-4 border-border-seam p-4\">\n <div className=\"relative max-w-md\">\n <Search size={16} className=\"absolute left-3 top-1/2 -translate-y-1/2 text-tertiary\" />\n <input\n type=\"text\"\n value={search}\n onChange={(event) => setSearch(event.target.value)}\n placeholder={tr('notifications.searchTopics', 'Search topics...')}\n className=\"w-full rounded-md border border-default bg-bg-canvas py-2 pl-9 pr-4 text-sm text-primary focus:outline-none focus:ring-2 focus:ring-accent\"\n />\n </div>\n\n <div className=\"space-y-3\">\n {isLoading ? (\n <div className=\"text-sm text-text-secondary\">\n {tr('notifications.loadingTopics', 'Loading topics...')}\n </div>\n ) : isForbidden ? (\n <IllustratedEmptyState\n illustration=\"empty-generic\"\n title={tr(\n 'notifications.topicsNoAccessTitle',\n \"You don't have access to notification topics\"\n )}\n description={tr(\n 'notifications.topicsNoAccessDescription',\n \"Your role doesn't include permission to read notification topics. Ask a workspace admin if you need access.\"\n )}\n kind=\"no-access\"\n />\n ) : filteredTopics.length === 0 ? (\n <IllustratedEmptyState\n illustration={search.trim() ? 'empty-search' : 'empty-data'}\n title={tr('notifications.noTopicsFound', 'No topics found.')}\n description={\n search.trim()\n ? tr('notifications.adjustSearchOrDateRange', 'Try adjusting your filters')\n : tr(\n 'notifications.noTopicsYet',\n 'No notification topics have been created yet.'\n )\n }\n kind={search.trim() ? 'no-results' : 'first-use'}\n glassIllustration=\"notifications\"\n />\n ) : (\n filteredTopics.map((topic) => (\n <div\n key={topic.id}\n className=\"flex flex-col gap-3 rounded-lg border border-border-seam bg-surface p-4 transition-[box-shadow,border-color] duration-200 hover:shadow-[var(--shadow-pop)] sm:flex-row sm:items-start sm:justify-between\"\n >\n <div className=\"space-y-1\">\n <div className=\"flex flex-wrap items-center gap-2\">\n <h3 className=\"text-sm font-semibold text-primary\">{topic.name}</h3>\n <span className=\"rounded-full bg-bg-sunken px-2 py-0.5 text-xs text-text-secondary\">\n {topic.slug}\n </span>\n <span className=\"rounded-full bg-bg-sunken px-2 py-0.5 text-xs text-text-secondary\">\n {topic.type}\n </span>\n </div>\n {topic.description && (\n <p className=\"text-sm text-text-secondary\">{topic.description}</p>\n )}\n <p className=\"text-xs text-tertiary\">\n {tr('notifications.topicSubscribers', 'Subscribers')}: {topic.subscriberCount}\n </p>\n </div>\n\n <div className=\"flex items-center gap-2\">\n <button\n type=\"button\"\n onClick={() => {\n setEditingId(topic.id);\n setForm({\n name: topic.name,\n slug: topic.slug,\n description: topic.description || '',\n type: topic.type,\n isActive: topic.isActive,\n });\n }}\n className=\"rounded-md border border-default px-3 py-2 text-sm text-text-secondary hover:bg-bg-sunken\"\n >\n {tr('notifications.edit', 'Edit')}\n </button>\n <button\n type=\"button\"\n onClick={() => setPendingDelete({ id: topic.id, name: topic.name })}\n className=\"inline-flex items-center gap-2 rounded-md border border-status-error-border px-3 py-2 text-sm text-status-error-text hover:bg-status-error-bg-subtle\"\n >\n <Trash2 size={14} />\n {tr('notifications.delete', 'Delete')}\n </button>\n </div>\n </div>\n ))\n )}\n </div>\n </GlassCard>\n </div>\n\n <ConfirmDeleteDialog\n open={pendingDelete !== null}\n title={tr('notifications.deleteTopicTitle', 'Delete topic')}\n description={tr(\n 'notifications.deleteTopicConfirm',\n 'Delete the topic \"{{name}}\"? It is removed for everyone and this cannot be undone.',\n { name: pendingDelete?.name ?? '' }\n )}\n onCancel={() => setPendingDelete(null)}\n onConfirm={() => {\n const target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