@burdenoff/microfe-notification 2026.1124.1 → 2026.1127.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 (132) hide show
  1. package/dist/AdminNotificationRoutes.js +59 -51
  2. package/dist/AdminNotificationRoutes.js.map +1 -1
  3. package/dist/NotificationRoutes.js +76 -68
  4. package/dist/NotificationRoutes.js.map +1 -1
  5. package/dist/UserNotificationRoutes.js +39 -31
  6. package/dist/UserNotificationRoutes.js.map +1 -1
  7. package/dist/components/NotificationListFooter.js +1 -1
  8. package/dist/components/NotificationListFooter.js.map +1 -1
  9. package/dist/components/NotificationPanel.js +0 -1
  10. package/dist/components/NotificationPanel.js.map +1 -1
  11. package/dist/components/loadingSystem.d.ts +64 -0
  12. package/dist/components/loadingSystem.js +34 -0
  13. package/dist/components/loadingSystem.js.map +1 -0
  14. package/dist/graphql/global-client.js +34 -34
  15. package/dist/index.js +9 -11
  16. package/dist/navigation-v2/AdminPageV2.js +23 -16
  17. package/dist/navigation-v2/AdminPageV2.js.map +1 -1
  18. package/dist/navigation-v2/NotificationArchivedV2.js +104 -98
  19. package/dist/navigation-v2/NotificationArchivedV2.js.map +1 -1
  20. package/dist/navigation-v2/NotificationInboxV2.js +133 -127
  21. package/dist/navigation-v2/NotificationInboxV2.js.map +1 -1
  22. package/dist/navigation-v2/NotificationSettingsV2.js +91 -85
  23. package/dist/navigation-v2/NotificationSettingsV2.js.map +1 -1
  24. package/dist/navigation-v2/NotificationsV2Landing.js +31 -23
  25. package/dist/navigation-v2/NotificationsV2Landing.js.map +1 -1
  26. package/dist/pages/CreateNotificationPage.js +442 -432
  27. package/dist/pages/CreateNotificationPage.js.map +1 -1
  28. package/dist/pages/NotificationCenterPage.js +93 -87
  29. package/dist/pages/NotificationCenterPage.js.map +1 -1
  30. package/dist/pages/NotificationHistoryAdminPage.js +231 -225
  31. package/dist/pages/NotificationHistoryAdminPage.js.map +1 -1
  32. package/dist/pages/NotificationHistoryPage.js +72 -66
  33. package/dist/pages/NotificationHistoryPage.js.map +1 -1
  34. package/dist/pages/NotificationLandingPage.js +42 -34
  35. package/dist/pages/NotificationLandingPage.js.map +1 -1
  36. package/dist/pages/NotificationPreferencesPage.js +80 -71
  37. package/dist/pages/NotificationPreferencesPage.js.map +1 -1
  38. package/dist/pages/NotificationTemplatesPage.js +192 -181
  39. package/dist/pages/NotificationTemplatesPage.js.map +1 -1
  40. package/dist/pages/NotificationTopicsPage.js +124 -118
  41. package/dist/pages/NotificationTopicsPage.js.map +1 -1
  42. package/dist/pages/TemplateEditorPage.js +248 -233
  43. package/dist/pages/TemplateEditorPage.js.map +1 -1
  44. package/package.json +5 -2
  45. package/dist/components/index.js +0 -4
  46. package/dist/hooks/index.js +0 -8
  47. package/dist/node_modules/@apollo/client/errors/CombinedGraphQLErrors.js +0 -23
  48. package/dist/node_modules/@apollo/client/errors/CombinedGraphQLErrors.js.map +0 -1
  49. package/dist/node_modules/@apollo/client/errors/utils.js +0 -15
  50. package/dist/node_modules/@apollo/client/errors/utils.js.map +0 -1
  51. package/dist/node_modules/@apollo/client/link/core/ApolloLink.js +0 -51
  52. package/dist/node_modules/@apollo/client/link/core/ApolloLink.js.map +0 -1
  53. package/dist/node_modules/@apollo/client/link/subscriptions/index.js +0 -40
  54. package/dist/node_modules/@apollo/client/link/subscriptions/index.js.map +0 -1
  55. package/dist/node_modules/@apollo/client/link/utils/createOperation.js +0 -33
  56. package/dist/node_modules/@apollo/client/link/utils/createOperation.js.map +0 -1
  57. package/dist/node_modules/@apollo/client/utilities/caching/sizes.js +0 -5
  58. package/dist/node_modules/@apollo/client/utilities/caching/sizes.js.map +0 -1
  59. package/dist/node_modules/@apollo/client/utilities/graphql/print.js +0 -15
  60. package/dist/node_modules/@apollo/client/utilities/graphql/print.js.map +0 -1
  61. package/dist/node_modules/@apollo/client/utilities/internal/caches.js +0 -18
  62. package/dist/node_modules/@apollo/client/utilities/internal/caches.js.map +0 -1
  63. package/dist/node_modules/@apollo/client/utilities/internal/checkDocument.js +0 -20
  64. package/dist/node_modules/@apollo/client/utilities/internal/checkDocument.js.map +0 -1
  65. package/dist/node_modules/@apollo/client/utilities/internal/getMainDefinition.js +0 -16
  66. package/dist/node_modules/@apollo/client/utilities/internal/getMainDefinition.js.map +0 -1
  67. package/dist/node_modules/@apollo/client/utilities/internal/getMemoryInternals.js +0 -8
  68. package/dist/node_modules/@apollo/client/utilities/internal/getMemoryInternals.js.map +0 -1
  69. package/dist/node_modules/@apollo/client/utilities/internal/getOperationDefinition.js +0 -8
  70. package/dist/node_modules/@apollo/client/utilities/internal/getOperationDefinition.js.map +0 -1
  71. package/dist/node_modules/@apollo/client/utilities/internal/getOperationName.js +0 -7
  72. package/dist/node_modules/@apollo/client/utilities/internal/getOperationName.js.map +0 -1
  73. package/dist/node_modules/@apollo/client/utilities/internal/globals/global.js +0 -8
  74. package/dist/node_modules/@apollo/client/utilities/internal/globals/global.js.map +0 -1
  75. package/dist/node_modules/@apollo/client/utilities/internal/globals/maybe.js +0 -9
  76. package/dist/node_modules/@apollo/client/utilities/internal/globals/maybe.js.map +0 -1
  77. package/dist/node_modules/@apollo/client/utilities/internal/isNonNullObject.js +0 -7
  78. package/dist/node_modules/@apollo/client/utilities/internal/isNonNullObject.js.map +0 -1
  79. package/dist/node_modules/@apollo/client/utilities/internal/makeUniqueId.js +0 -9
  80. package/dist/node_modules/@apollo/client/utilities/internal/makeUniqueId.js.map +0 -1
  81. package/dist/node_modules/@apollo/client/utilities/internal/memoize.js +0 -22
  82. package/dist/node_modules/@apollo/client/utilities/internal/memoize.js.map +0 -1
  83. package/dist/node_modules/@apollo/client/utilities/internal/stringifyForDisplay.js +0 -9
  84. package/dist/node_modules/@apollo/client/utilities/internal/stringifyForDisplay.js.map +0 -1
  85. package/dist/node_modules/@apollo/client/utilities/invariant/index.js +0 -56
  86. package/dist/node_modules/@apollo/client/utilities/invariant/index.js.map +0 -1
  87. package/dist/node_modules/@apollo/client/version.js +0 -5
  88. package/dist/node_modules/@apollo/client/version.js.map +0 -1
  89. package/dist/node_modules/@wry/caches/lib/weak.js +0 -66
  90. package/dist/node_modules/@wry/caches/lib/weak.js.map +0 -1
  91. package/dist/node_modules/@wry/trie/lib/index.js +0 -52
  92. package/dist/node_modules/@wry/trie/lib/index.js.map +0 -1
  93. package/dist/node_modules/graphql-ws/dist/client.js +0 -279
  94. package/dist/node_modules/graphql-ws/dist/client.js.map +0 -1
  95. package/dist/node_modules/graphql-ws/dist/common-CGW11Fyb.js +0 -61
  96. package/dist/node_modules/graphql-ws/dist/common-CGW11Fyb.js.map +0 -1
  97. package/dist/node_modules/rxjs/dist/esm5/internal/NotificationFactories.js +0 -20
  98. package/dist/node_modules/rxjs/dist/esm5/internal/NotificationFactories.js.map +0 -1
  99. package/dist/node_modules/rxjs/dist/esm5/internal/Observable.js +0 -77
  100. package/dist/node_modules/rxjs/dist/esm5/internal/Observable.js.map +0 -1
  101. package/dist/node_modules/rxjs/dist/esm5/internal/Subscriber.js +0 -116
  102. package/dist/node_modules/rxjs/dist/esm5/internal/Subscriber.js.map +0 -1
  103. package/dist/node_modules/rxjs/dist/esm5/internal/Subscription.js +0 -96
  104. package/dist/node_modules/rxjs/dist/esm5/internal/Subscription.js.map +0 -1
  105. package/dist/node_modules/rxjs/dist/esm5/internal/config.js +0 -11
  106. package/dist/node_modules/rxjs/dist/esm5/internal/config.js.map +0 -1
  107. package/dist/node_modules/rxjs/dist/esm5/internal/observable/empty.js +0 -8
  108. package/dist/node_modules/rxjs/dist/esm5/internal/observable/empty.js.map +0 -1
  109. package/dist/node_modules/rxjs/dist/esm5/internal/scheduler/timeoutProvider.js +0 -15
  110. package/dist/node_modules/rxjs/dist/esm5/internal/scheduler/timeoutProvider.js.map +0 -1
  111. package/dist/node_modules/rxjs/dist/esm5/internal/symbol/observable.js +0 -7
  112. package/dist/node_modules/rxjs/dist/esm5/internal/symbol/observable.js.map +0 -1
  113. package/dist/node_modules/rxjs/dist/esm5/internal/util/UnsubscriptionError.js +0 -12
  114. package/dist/node_modules/rxjs/dist/esm5/internal/util/UnsubscriptionError.js.map +0 -1
  115. package/dist/node_modules/rxjs/dist/esm5/internal/util/arrRemove.js +0 -10
  116. package/dist/node_modules/rxjs/dist/esm5/internal/util/arrRemove.js.map +0 -1
  117. package/dist/node_modules/rxjs/dist/esm5/internal/util/createErrorClass.js +0 -10
  118. package/dist/node_modules/rxjs/dist/esm5/internal/util/createErrorClass.js.map +0 -1
  119. package/dist/node_modules/rxjs/dist/esm5/internal/util/errorContext.js +0 -21
  120. package/dist/node_modules/rxjs/dist/esm5/internal/util/errorContext.js.map +0 -1
  121. package/dist/node_modules/rxjs/dist/esm5/internal/util/identity.js +0 -7
  122. package/dist/node_modules/rxjs/dist/esm5/internal/util/identity.js.map +0 -1
  123. package/dist/node_modules/rxjs/dist/esm5/internal/util/isFunction.js +0 -7
  124. package/dist/node_modules/rxjs/dist/esm5/internal/util/isFunction.js.map +0 -1
  125. package/dist/node_modules/rxjs/dist/esm5/internal/util/noop.js +0 -5
  126. package/dist/node_modules/rxjs/dist/esm5/internal/util/noop.js.map +0 -1
  127. package/dist/node_modules/rxjs/dist/esm5/internal/util/pipe.js +0 -12
  128. package/dist/node_modules/rxjs/dist/esm5/internal/util/pipe.js.map +0 -1
  129. package/dist/node_modules/rxjs/dist/esm5/internal/util/reportUnhandledError.js +0 -13
  130. package/dist/node_modules/rxjs/dist/esm5/internal/util/reportUnhandledError.js.map +0 -1
  131. package/dist/node_modules/tslib/tslib.es6.js +0 -51
  132. package/dist/node_modules/tslib/tslib.es6.js.map +0 -1
@@ -1,182 +1,188 @@
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 { NOTIFICATION_PERMISSIONS as i } from "../constants/permissions.js";
6
- import "../hooks/index.js";
2
+ import { NotificationListFooter as t } from "../components/NotificationListFooter.js";
3
+ import { NOTIFICATION_PERMISSIONS as n } from "../constants/permissions.js";
4
+ import { useNotifications as r } from "../hooks/useNotifications.js";
5
+ import { useNotificationTopics as i } from "../hooks/useNotificationTopics.js";
7
6
  import { useNotification as a } from "../providers/NotificationProvider.js";
8
7
  import { useTr as o } from "../shared/hooks/useTr.js";
9
8
  import { inArchivedView as s } from "./inboxFilters.js";
10
9
  import { exportNotificationsAsCsv as c } from "../utils/notificationHistoryExport.js";
11
10
  import { BackToNotifications as l } from "./BackToNotifications.js";
12
11
  import { MoreFiltersButton as u, SearchField as d, ViewChips as f } from "./FilterControls.js";
13
- import { useMemo as p, useState as m } from "react";
14
- import { usePermissions as h } from "@burdenoff/fe-libs/shared/providers/shell";
15
- import { Download as g, MoreHorizontal as _ } from "lucide-react";
16
- import { jsx as v, jsxs as y } from "react/jsx-runtime";
17
- import { Button as b, DropdownMenu as x, DropdownMenuContent as S, DropdownMenuItem as C, DropdownMenuTrigger as w, IllustratedEmptyState as T, Input as E, NativeSelect as D, useRememberedOpen as O } from "@burdenoff/fe-libs/ui";
12
+ import { CompactMarkOr as p, SectionLoaderOr as ee } from "../components/loadingSystem.js";
13
+ import { useMemo as m, useState as h } from "react";
14
+ import { usePermissions as g } from "@burdenoff/fe-libs/shared/providers/shell";
15
+ import { Download as _, MoreHorizontal as v } from "lucide-react";
16
+ import { jsx as y, jsxs as b } from "react/jsx-runtime";
17
+ import { Button as x, DropdownMenu as S, DropdownMenuContent as C, DropdownMenuItem as w, DropdownMenuTrigger as T, IllustratedEmptyState as E, Input as D, NativeSelect as O, useRememberedOpen as k } from "@burdenoff/fe-libs/ui";
18
18
  // src/navigation-v2/NotificationArchivedV2.tsx
19
- var k = {
19
+ var A = {
20
20
  archived: null,
21
21
  channel: "ALL"
22
- }, A = "ALL";
23
- function j(e) {
22
+ }, j = "ALL";
23
+ function M(e) {
24
24
  return e ? e.toISOString().split("T")[0] : "";
25
25
  }
26
- function M() {
27
- let M = o(), { hasPermission: N, isLoading: ee } = h(), { currentUser: P } = a(), { topics: F } = n({ isActive: !0 }), { notifications: I, hasMore: L, isLoadingMore: R, loadMore: z, notificationFilter: B, updateFilter: V, archiveNotification: H, unarchiveNotification: U, recordAction: W } = t({ baseFilter: k }), [G, K] = m("archived"), [q, J] = O("notifications.archived.moreFilters", !1), Y = p(() => I.filter((e) => s(e, G)), [I, G]), X = !!(B.topicId || B.dateRange.start || B.dateRange.end), Z = !!B.search || X;
28
- if (ee) return /* @__PURE__ */ v("div", {
29
- className: "flex h-64 items-center justify-center",
30
- children: /* @__PURE__ */ v("div", { className: "h-8 w-8 animate-spin rounded-full border-4 border-primary border-t-transparent" })
26
+ function N() {
27
+ let N = o(), { hasPermission: P, isLoading: F } = g(), { currentUser: I } = a(), { topics: L } = i({ isActive: !0 }), { notifications: R, hasMore: z, isLoadingMore: B, loadMore: V, notificationFilter: H, updateFilter: U, archiveNotification: W, unarchiveNotification: G, recordAction: K } = r({ baseFilter: A }), [q, J] = h("archived"), [Y, X] = k("notifications.archived.moreFilters", !1), Z = m(() => R.filter((e) => s(e, q)), [R, q]), Q = !!(H.topicId || H.dateRange.start || H.dateRange.end), $ = !!H.search || Q;
28
+ if (F) return /* @__PURE__ */ y(ee, {
29
+ minHeight: "16rem",
30
+ today: /* @__PURE__ */ y("div", {
31
+ className: "flex h-64 items-center justify-center",
32
+ children: /* @__PURE__ */ y(p, {
33
+ className: "h-8 w-8",
34
+ today: /* @__PURE__ */ y("div", { className: "h-8 w-8 animate-spin rounded-full border-4 border-primary border-t-transparent" })
35
+ })
36
+ })
31
37
  });
32
- if (!N(i.NOTIFICATION_LIST) && !P?.id) return /* @__PURE__ */ v("div", {
38
+ if (!P(n.NOTIFICATION_LIST) && !I?.id) return /* @__PURE__ */ y("div", {
33
39
  className: "p-8 text-center text-text-secondary",
34
- children: M("notifications.noPermissionHistory", "You don't have permission to view notification history.")
40
+ children: N("notifications.noPermissionHistory", "You don't have permission to view notification history.")
35
41
  });
36
- let Q = [{
42
+ let te = [{
37
43
  id: "archived",
38
- label: M("notifications.v2.archived", "Archived")
44
+ label: N("notifications.v2.archived", "Archived")
39
45
  }, {
40
46
  id: "everything",
41
- label: M("notifications.v2.everything", "Everything")
42
- }], $ = [{
43
- value: A,
44
- label: M("notifications.allTopics", "All Topics")
45
- }, ...F.map((e) => ({
47
+ label: N("notifications.v2.everything", "Everything")
48
+ }], ne = [{
49
+ value: j,
50
+ label: N("notifications.allTopics", "All Topics")
51
+ }, ...L.map((e) => ({
46
52
  value: e.id,
47
53
  label: e.name
48
54
  }))];
49
- return /* @__PURE__ */ y("div", {
55
+ return /* @__PURE__ */ b("div", {
50
56
  className: "mx-auto w-full max-w-5xl space-y-4 p-3 animate-in fade-in duration-200 sm:space-y-5 sm:p-6",
51
57
  children: [
52
- /* @__PURE__ */ v(l, {}),
53
- /* @__PURE__ */ y("header", {
58
+ /* @__PURE__ */ y(l, {}),
59
+ /* @__PURE__ */ b("header", {
54
60
  "data-tour": "notification-history-header",
55
61
  className: "flex flex-col gap-3 sm:flex-row sm:items-start sm:justify-between",
56
- children: [/* @__PURE__ */ y("div", { children: [/* @__PURE__ */ v("h1", {
62
+ children: [/* @__PURE__ */ b("div", { children: [/* @__PURE__ */ y("h1", {
57
63
  className: "text-xl font-semibold text-text-primary sm:text-2xl",
58
- children: M("notifications.v2.archivedTitle", "Archived")
59
- }), /* @__PURE__ */ v("p", {
64
+ children: N("notifications.v2.archivedTitle", "Archived")
65
+ }), /* @__PURE__ */ y("p", {
60
66
  className: "mt-1 text-sm text-text-secondary",
61
- children: M("notifications.v2.archivedSubtitle", "Notifications you archived. Restore one to put it back in your inbox.")
62
- })] }), /* @__PURE__ */ y(x, { children: [/* @__PURE__ */ v(w, {
67
+ children: N("notifications.v2.archivedSubtitle", "Notifications you archived. Restore one to put it back in your inbox.")
68
+ })] }), /* @__PURE__ */ b(S, { children: [/* @__PURE__ */ y(T, {
63
69
  asChild: !0,
64
- children: /* @__PURE__ */ v(b, {
70
+ children: /* @__PURE__ */ y(x, {
65
71
  variant: "ghost",
66
72
  size: "icon",
67
- "aria-label": M("notifications.v2.moreActions", "More actions"),
73
+ "aria-label": N("notifications.v2.moreActions", "More actions"),
68
74
  "data-testid": "notifications-archived-overflow",
69
- children: /* @__PURE__ */ v(_, {
75
+ children: /* @__PURE__ */ y(v, {
70
76
  size: 18,
71
77
  "aria-hidden": "true"
72
78
  })
73
79
  })
74
- }), /* @__PURE__ */ v(S, {
80
+ }), /* @__PURE__ */ y(C, {
75
81
  align: "end",
76
- children: /* @__PURE__ */ y(C, {
82
+ children: /* @__PURE__ */ b(w, {
77
83
  "data-tour": "notification-history-export",
78
- disabled: I.length === 0,
79
- onSelect: () => c(M, I),
80
- children: [/* @__PURE__ */ v(g, {
84
+ disabled: R.length === 0,
85
+ onSelect: () => c(N, R),
86
+ children: [/* @__PURE__ */ y(_, {
81
87
  size: 16,
82
88
  "aria-hidden": "true"
83
- }), M("notifications.v2.downloadSpreadsheet", "Download as spreadsheet")]
89
+ }), N("notifications.v2.downloadSpreadsheet", "Download as spreadsheet")]
84
90
  })
85
91
  })] })]
86
92
  }),
87
- /* @__PURE__ */ y("section", {
88
- "aria-label": M("notifications.v2.filters", "Filters"),
93
+ /* @__PURE__ */ b("section", {
94
+ "aria-label": N("notifications.v2.filters", "Filters"),
89
95
  className: "space-y-3",
90
- children: [/* @__PURE__ */ y("div", {
96
+ children: [/* @__PURE__ */ b("div", {
91
97
  className: "flex flex-col gap-3 sm:flex-row sm:items-center",
92
- children: [/* @__PURE__ */ v(d, {
93
- label: M("notifications.searchByTitleOrContent", "Search by title or content..."),
94
- value: B.search,
95
- onChange: (e) => V({ search: e })
96
- }), /* @__PURE__ */ y("div", {
98
+ children: [/* @__PURE__ */ y(d, {
99
+ label: N("notifications.searchByTitleOrContent", "Search by title or content..."),
100
+ value: H.search,
101
+ onChange: (e) => U({ search: e })
102
+ }), /* @__PURE__ */ b("div", {
97
103
  className: "flex flex-wrap items-center gap-2",
98
- children: [/* @__PURE__ */ v(f, {
99
- chips: Q,
100
- value: G,
101
- onChange: K,
104
+ children: [/* @__PURE__ */ y(f, {
105
+ chips: te,
106
+ value: q,
107
+ onChange: J,
102
108
  testIdPrefix: "notifications-archived-view"
103
- }), /* @__PURE__ */ v(u, {
104
- open: q,
105
- active: X,
109
+ }), /* @__PURE__ */ y(u, {
110
+ open: Y,
111
+ active: Q,
106
112
  controls: "notifications-archived-more-filters",
107
- onToggle: () => J(!q)
113
+ onToggle: () => X(!Y)
108
114
  })]
109
115
  })]
110
- }), /* @__PURE__ */ y("div", {
116
+ }), /* @__PURE__ */ b("div", {
111
117
  id: "notifications-archived-more-filters",
112
- hidden: !q,
118
+ hidden: !Y,
113
119
  className: "grid gap-3 rounded-lg border border-border-seam bg-bg-surface p-3 sm:grid-cols-3",
114
120
  children: [
115
- /* @__PURE__ */ v(D, {
116
- "aria-label": M("notifications.v2.topicFilter", "Topic"),
117
- options: $,
118
- value: B.topicId || A,
119
- onValueChange: (e) => V({ topicId: e === A ? void 0 : e })
121
+ /* @__PURE__ */ y(O, {
122
+ "aria-label": N("notifications.v2.topicFilter", "Topic"),
123
+ options: ne,
124
+ value: H.topicId || j,
125
+ onValueChange: (e) => U({ topicId: e === j ? void 0 : e })
120
126
  }),
121
- /* @__PURE__ */ v(E, {
127
+ /* @__PURE__ */ y(D, {
122
128
  type: "date",
123
- "aria-label": M("notifications.startDate", "Start date"),
124
- value: j(B.dateRange.start),
125
- onChange: (e) => V({ dateRange: {
126
- ...B.dateRange,
129
+ "aria-label": N("notifications.startDate", "Start date"),
130
+ value: M(H.dateRange.start),
131
+ onChange: (e) => U({ dateRange: {
132
+ ...H.dateRange,
127
133
  start: e.target.value ? new Date(e.target.value) : null
128
134
  } })
129
135
  }),
130
- /* @__PURE__ */ v(E, {
136
+ /* @__PURE__ */ y(D, {
131
137
  type: "date",
132
- "aria-label": M("notifications.endDate", "End date"),
133
- value: j(B.dateRange.end),
134
- onChange: (e) => V({ dateRange: {
135
- ...B.dateRange,
138
+ "aria-label": N("notifications.endDate", "End date"),
139
+ value: M(H.dateRange.end),
140
+ onChange: (e) => U({ dateRange: {
141
+ ...H.dateRange,
136
142
  end: e.target.value ? new Date(e.target.value) : null
137
143
  } })
138
144
  })
139
145
  ]
140
146
  })]
141
147
  }),
142
- /* @__PURE__ */ v("div", {
148
+ /* @__PURE__ */ y("div", {
143
149
  className: "space-y-2",
144
- children: Y.length > 0 ? Y.map((t) => /* @__PURE__ */ y("div", {
150
+ children: Z.length > 0 ? Z.map((t) => /* @__PURE__ */ b("div", {
145
151
  className: "space-y-2",
146
- children: [/* @__PURE__ */ v(e, {
152
+ children: [/* @__PURE__ */ y(e, {
147
153
  notification: t,
148
- onArchive: t.archivedAt ? void 0 : H,
149
- onAction: W,
154
+ onArchive: t.archivedAt ? void 0 : W,
155
+ onAction: K,
150
156
  showArchivedState: !0,
151
157
  analyticsSource: "history",
152
158
  navigationV2: !0,
153
- showTopic: q
154
- }), t.archivedAt && /* @__PURE__ */ v("div", {
159
+ showTopic: Y
160
+ }), t.archivedAt && /* @__PURE__ */ y("div", {
155
161
  className: "flex justify-end",
156
- children: /* @__PURE__ */ v(b, {
162
+ children: /* @__PURE__ */ y(x, {
157
163
  type: "button",
158
164
  variant: "outline",
159
165
  size: "sm",
160
- onClick: () => U(t.id),
161
- children: M("notifications.restore", "Restore")
166
+ onClick: () => G(t.id),
167
+ children: N("notifications.restore", "Restore")
162
168
  })
163
169
  })]
164
- }, t.id)) : /* @__PURE__ */ v(T, {
165
- illustration: Z ? "empty-search" : "empty-notifications",
166
- title: Z ? M("notifications.noNotificationsFound", "No notifications found") : G === "archived" ? M("notifications.v2.archivedEmptyTitle", "Nothing archived") : M("notifications.historyEmptyTitle", "No history yet"),
167
- description: Z ? M("notifications.adjustSearchOrDateRange", "Try adjusting your filters") : G === "archived" ? M("notifications.v2.archivedEmptyDescription", "Archive a notification from your inbox and it moves here.") : M("notifications.historyEmptyDescription", "Notifications you receive will be archived here so you can always find them again."),
168
- kind: B.search ? "no-results" : Z ? "filtered" : "first-use"
170
+ }, t.id)) : /* @__PURE__ */ y(E, {
171
+ illustration: $ ? "empty-search" : "empty-notifications",
172
+ title: $ ? N("notifications.noNotificationsFound", "No notifications found") : q === "archived" ? N("notifications.v2.archivedEmptyTitle", "Nothing archived") : N("notifications.historyEmptyTitle", "No history yet"),
173
+ description: $ ? N("notifications.adjustSearchOrDateRange", "Try adjusting your filters") : q === "archived" ? N("notifications.v2.archivedEmptyDescription", "Archive a notification from your inbox and it moves here.") : N("notifications.historyEmptyDescription", "Notifications you receive will be archived here so you can always find them again."),
174
+ kind: H.search ? "no-results" : $ ? "filtered" : "first-use"
169
175
  })
170
176
  }),
171
- /* @__PURE__ */ v(r, {
172
- hasMore: L,
173
- isLoadingMore: R,
174
- onLoadMore: z,
175
- shownCount: Y.length
177
+ /* @__PURE__ */ y(t, {
178
+ hasMore: z,
179
+ isLoadingMore: B,
180
+ onLoadMore: V,
181
+ shownCount: Z.length
176
182
  })
177
183
  ]
178
184
  });
179
185
  }
180
- export { M as NotificationArchivedV2 };
186
+ export { N as NotificationArchivedV2 };
181
187
 
182
188
  //# sourceMappingURL=NotificationArchivedV2.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"NotificationArchivedV2.js","names":["HISTORY_FILTER","ALL","toDateInput","value","NotificationArchivedV2","tr","useTr","permissionsLoading","usePermissions","useNotification","useNotificationTopics","useNotifications","view","setView","useState","moreFiltersOpen","setMoreFiltersOpen","useRememberedOpen","visible","useMemo","notifications","inArchivedView","notification","moreFiltersActive","notificationFilter","hasActiveFilters","hasPermission","NOTIFICATION_PERMISSIONS","currentUser","chips","topicOptions","topics","topic","BackToNotifications","DropdownMenu","DropdownMenuTrigger","Button","MoreHorizontal","DropdownMenuContent","DropdownMenuItem","exportNotificationsAsCsv","Download","SearchField","updateFilter","ViewChips","MoreFiltersButton","NativeSelect","Input","NotificationCard","archiveNotification","recordAction","unarchiveNotification","IllustratedEmptyState","NotificationListFooter","loadMore"],"sources":["../../src/navigation-v2/NotificationArchivedV2.tsx"],"sourcesContent":["import { useMemo, useState } from 'react';\nimport { Download, MoreHorizontal } from 'lucide-react';\nimport { usePermissions } from '@burdenoff/fe-libs/shared/providers/shell';\nimport {\n Button,\n DropdownMenu,\n DropdownMenuContent,\n DropdownMenuItem,\n DropdownMenuTrigger,\n IllustratedEmptyState,\n Input,\n NativeSelect,\n useRememberedOpen,\n} from '@burdenoff/fe-libs/ui';\nimport { NotificationCard } from '../components/NotificationCard';\nimport { NotificationListFooter } from '../components/NotificationListFooter';\nimport { NOTIFICATION_PERMISSIONS } from '../constants/permissions';\nimport { useNotifications, useNotificationTopics } from '../hooks';\nimport { useNotification } from '../providers/NotificationProvider';\nimport { useTr } from '../shared/hooks/useTr';\nimport { inArchivedView, type ArchivedView } from './inboxFilters';\nimport { exportNotificationsAsCsv } from '../utils/notificationHistoryExport';\nimport { BackToNotifications } from './BackToNotifications';\nimport { MoreFiltersButton, SearchField, ViewChips } from './FilterControls';\n\nconst HISTORY_FILTER = { archived: null, channel: 'ALL' as const };\nconst ALL = 'ALL';\n\nfunction toDateInput(value: Date | null): string {\n return value ? value.toISOString().split('T')[0] : '';\n}\n\n/**\n * Archived, Navigation v2 (BOFF-11872; today's personal Notification\n * History). Same query as the classic page (every channel, archived or\n * not); the \"Archived\" chip, on by default, shows what you archived and\n * \"Everything\" shows the full history. Restore on each archived row, search\n * at level 1, topic and dates under \"More filters\", and \"Download as\n * spreadsheet\" in \"⋯\".\n */\nexport function NotificationArchivedV2() {\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 const [view, setView] = useState<ArchivedView>('archived');\n const [moreFiltersOpen, setMoreFiltersOpen] = useRememberedOpen(\n 'notifications.archived.moreFilters',\n false\n );\n\n const visible = useMemo(\n () => notifications.filter((notification) => inArchivedView(notification, view)),\n [notifications, view]\n );\n\n const moreFiltersActive = Boolean(\n notificationFilter.topicId ||\n notificationFilter.dateRange.start ||\n notificationFilter.dateRange.end\n );\n const hasActiveFilters = Boolean(notificationFilter.search) || moreFiltersActive;\n\n if (permissionsLoading) {\n return (\n <div className=\"flex h-64 items-center justify-center\">\n <div className=\"h-8 w-8 animate-spin rounded-full border-4 border-primary border-t-transparent\" />\n </div>\n );\n }\n\n 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 const chips: Array<{ id: ArchivedView; label: string }> = [\n { id: 'archived', label: tr('notifications.v2.archived', 'Archived') },\n { id: 'everything', label: tr('notifications.v2.everything', 'Everything') },\n ];\n const topicOptions = [\n { value: ALL, label: tr('notifications.allTopics', 'All Topics') },\n ...topics.map((topic) => ({ value: topic.id, label: topic.name })),\n ];\n\n return (\n <div className=\"mx-auto w-full max-w-5xl space-y-4 p-3 animate-in fade-in duration-200 sm:space-y-5 sm:p-6\">\n <BackToNotifications />\n <header\n data-tour=\"notification-history-header\"\n className=\"flex flex-col gap-3 sm:flex-row sm:items-start sm:justify-between\"\n >\n <div>\n <h1 className=\"text-xl font-semibold text-text-primary sm:text-2xl\">\n {tr('notifications.v2.archivedTitle', 'Archived')}\n </h1>\n <p className=\"mt-1 text-sm text-text-secondary\">\n {tr(\n 'notifications.v2.archivedSubtitle',\n 'Notifications you archived. Restore one to put it back in your inbox.'\n )}\n </p>\n </div>\n <DropdownMenu>\n <DropdownMenuTrigger asChild>\n <Button\n variant=\"ghost\"\n size=\"icon\"\n aria-label={tr('notifications.v2.moreActions', 'More actions')}\n data-testid=\"notifications-archived-overflow\"\n >\n <MoreHorizontal size={18} aria-hidden=\"true\" />\n </Button>\n </DropdownMenuTrigger>\n <DropdownMenuContent align=\"end\">\n <DropdownMenuItem\n data-tour=\"notification-history-export\"\n disabled={notifications.length === 0}\n onSelect={() => exportNotificationsAsCsv(tr, notifications)}\n >\n <Download size={16} aria-hidden=\"true\" />\n {tr('notifications.v2.downloadSpreadsheet', 'Download as spreadsheet')}\n </DropdownMenuItem>\n </DropdownMenuContent>\n </DropdownMenu>\n </header>\n\n <section aria-label={tr('notifications.v2.filters', 'Filters')} className=\"space-y-3\">\n <div className=\"flex flex-col gap-3 sm:flex-row sm:items-center\">\n <SearchField\n label={tr('notifications.searchByTitleOrContent', 'Search by title or content...')}\n value={notificationFilter.search}\n onChange={(search) => updateFilter({ search })}\n />\n <div className=\"flex flex-wrap items-center gap-2\">\n <ViewChips\n chips={chips}\n value={view}\n onChange={setView}\n testIdPrefix=\"notifications-archived-view\"\n />\n <MoreFiltersButton\n open={moreFiltersOpen}\n active={moreFiltersActive}\n controls=\"notifications-archived-more-filters\"\n onToggle={() => setMoreFiltersOpen(!moreFiltersOpen)}\n />\n </div>\n </div>\n <div\n id=\"notifications-archived-more-filters\"\n hidden={!moreFiltersOpen}\n className=\"grid gap-3 rounded-lg border border-border-seam bg-bg-surface p-3 sm:grid-cols-3\"\n >\n <NativeSelect\n aria-label={tr('notifications.v2.topicFilter', 'Topic')}\n options={topicOptions}\n value={notificationFilter.topicId || ALL}\n onValueChange={(value) => updateFilter({ topicId: value === ALL ? undefined : value })}\n />\n <Input\n type=\"date\"\n aria-label={tr('notifications.startDate', 'Start date')}\n value={toDateInput(notificationFilter.dateRange.start)}\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 />\n <Input\n type=\"date\"\n aria-label={tr('notifications.endDate', 'End date')}\n value={toDateInput(notificationFilter.dateRange.end)}\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 />\n </div>\n </section>\n\n <div className=\"space-y-2\">\n {visible.length > 0 ? (\n visible.map((notification) => (\n <div key={notification.id} className=\"space-y-2\">\n <NotificationCard\n notification={notification}\n onArchive={notification.archivedAt ? undefined : archiveNotification}\n onAction={recordAction}\n showArchivedState\n analyticsSource=\"history\"\n navigationV2\n showTopic={moreFiltersOpen}\n />\n {notification.archivedAt && (\n <div className=\"flex justify-end\">\n <Button\n type=\"button\"\n variant=\"outline\"\n size=\"sm\"\n onClick={() => unarchiveNotification(notification.id)}\n >\n {tr('notifications.restore', 'Restore')}\n </Button>\n </div>\n )}\n </div>\n ))\n ) : (\n <IllustratedEmptyState\n illustration={hasActiveFilters ? 'empty-search' : 'empty-notifications'}\n title={\n hasActiveFilters\n ? tr('notifications.noNotificationsFound', 'No notifications found')\n : view === 'archived'\n ? tr('notifications.v2.archivedEmptyTitle', 'Nothing archived')\n : tr('notifications.historyEmptyTitle', 'No history yet')\n }\n description={\n hasActiveFilters\n ? tr('notifications.adjustSearchOrDateRange', 'Try adjusting your filters')\n : view === 'archived'\n ? tr(\n 'notifications.v2.archivedEmptyDescription',\n 'Archive a notification from your inbox and it moves here.'\n )\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 ? 'no-results' : hasActiveFilters ? 'filtered' : 'first-use'\n }\n />\n )}\n </div>\n\n <NotificationListFooter\n hasMore={hasMore}\n isLoadingMore={isLoadingMore}\n onLoadMore={loadMore}\n shownCount={visible.length}\n />\n </div>\n );\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;AAyBA,IAAMA,IAAiB;CAAE,UAAU;CAAM,SAAS;AAAe,GAC3DC,IAAM;AAEZ,SAASC,EAAY,GAA4B;CAC/C,OAAOC,IAAQA,EAAM,YAAY,CAAC,CAAC,MAAM,GAAG,CAAC,CAAC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D,UAAAjB,EAAG,yBAAyB,SAAS;MAChC,CAAA;KACL,CAAA,CAEJ;IAtBK,GAAAiB,EAAa,EAsBlB,CACN,IAED,kBAAC8B,GAAD;KACE,cAAc3B,IAAmB,iBAAiB;KAClD,OACEA,IACIpB,EAAG,sCAAsC,wBAAwB,IACjEO,MAAS,aACPP,EAAG,uCAAuC,kBAAkB,IAC5DA,EAAG,mCAAmC,gBAAgB;KAE9D,aACEoB,IACIpB,EAAG,yCAAyC,4BAA4B,IACxEO,MAAS,aACPP,EACE,6CACA,2DACF,IACAA,EACE,yCACA,oFACF;KAER,MACEmB,EAAmB,SAAS,eAAeC,IAAmB,aAAa;IAE9E,CAAA;GAEA,CAAA;GAEL,kBAAC4B,GAAD;IACW;IACM;IACf,YAAYC;IACZ,YAAYpC,EAAQ;GACrB,CAAA;EACE;;AAET"}
1
+ {"version":3,"file":"NotificationArchivedV2.js","names":["HISTORY_FILTER","ALL","toDateInput","value","NotificationArchivedV2","tr","useTr","permissionsLoading","usePermissions","useNotification","useNotificationTopics","useNotifications","view","setView","useState","moreFiltersOpen","setMoreFiltersOpen","useRememberedOpen","visible","useMemo","notifications","inArchivedView","notification","moreFiltersActive","notificationFilter","hasActiveFilters","SectionLoaderOr","CompactMarkOr","hasPermission","NOTIFICATION_PERMISSIONS","currentUser","chips","topicOptions","topics","topic","BackToNotifications","DropdownMenu","DropdownMenuTrigger","Button","MoreHorizontal","DropdownMenuContent","DropdownMenuItem","exportNotificationsAsCsv","Download","SearchField","updateFilter","ViewChips","MoreFiltersButton","NativeSelect","Input","NotificationCard","archiveNotification","recordAction","unarchiveNotification","IllustratedEmptyState","NotificationListFooter","loadMore"],"sources":["../../src/navigation-v2/NotificationArchivedV2.tsx"],"sourcesContent":["import { useMemo, useState } from 'react';\nimport { Download, MoreHorizontal } from 'lucide-react';\nimport { usePermissions } from '@burdenoff/fe-libs/shared/providers/shell';\nimport {\n Button,\n DropdownMenu,\n DropdownMenuContent,\n DropdownMenuItem,\n DropdownMenuTrigger,\n IllustratedEmptyState,\n Input,\n NativeSelect,\n useRememberedOpen,\n} from '@burdenoff/fe-libs/ui';\nimport { NotificationCard } from '../components/NotificationCard';\nimport { NotificationListFooter } from '../components/NotificationListFooter';\nimport { NOTIFICATION_PERMISSIONS } from '../constants/permissions';\nimport { useNotifications, useNotificationTopics } from '../hooks';\nimport { useNotification } from '../providers/NotificationProvider';\nimport { useTr } from '../shared/hooks/useTr';\nimport { inArchivedView, type ArchivedView } from './inboxFilters';\nimport { exportNotificationsAsCsv } from '../utils/notificationHistoryExport';\nimport { BackToNotifications } from './BackToNotifications';\nimport { MoreFiltersButton, SearchField, ViewChips } from './FilterControls';\nimport { CompactMarkOr, SectionLoaderOr } from '../components/loadingSystem';\n\nconst HISTORY_FILTER = { archived: null, channel: 'ALL' as const };\nconst ALL = 'ALL';\n\nfunction toDateInput(value: Date | null): string {\n return value ? value.toISOString().split('T')[0] : '';\n}\n\n/**\n * Archived, Navigation v2 (BOFF-11872; today's personal Notification\n * History). Same query as the classic page (every channel, archived or\n * not); the \"Archived\" chip, on by default, shows what you archived and\n * \"Everything\" shows the full history. Restore on each archived row, search\n * at level 1, topic and dates under \"More filters\", and \"Download as\n * spreadsheet\" in \"⋯\".\n */\nexport function NotificationArchivedV2() {\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 const [view, setView] = useState<ArchivedView>('archived');\n const [moreFiltersOpen, setMoreFiltersOpen] = useRememberedOpen(\n 'notifications.archived.moreFilters',\n false\n );\n\n const visible = useMemo(\n () => notifications.filter((notification) => inArchivedView(notification, view)),\n [notifications, view]\n );\n\n const moreFiltersActive = Boolean(\n notificationFilter.topicId ||\n notificationFilter.dateRange.start ||\n notificationFilter.dateRange.end\n );\n const hasActiveFilters = Boolean(notificationFilter.search) || moreFiltersActive;\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 const chips: Array<{ id: ArchivedView; label: string }> = [\n { id: 'archived', label: tr('notifications.v2.archived', 'Archived') },\n { id: 'everything', label: tr('notifications.v2.everything', 'Everything') },\n ];\n const topicOptions = [\n { value: ALL, label: tr('notifications.allTopics', 'All Topics') },\n ...topics.map((topic) => ({ value: topic.id, label: topic.name })),\n ];\n\n return (\n <div className=\"mx-auto w-full max-w-5xl space-y-4 p-3 animate-in fade-in duration-200 sm:space-y-5 sm:p-6\">\n <BackToNotifications />\n <header\n data-tour=\"notification-history-header\"\n className=\"flex flex-col gap-3 sm:flex-row sm:items-start sm:justify-between\"\n >\n <div>\n <h1 className=\"text-xl font-semibold text-text-primary sm:text-2xl\">\n {tr('notifications.v2.archivedTitle', 'Archived')}\n </h1>\n <p className=\"mt-1 text-sm text-text-secondary\">\n {tr(\n 'notifications.v2.archivedSubtitle',\n 'Notifications you archived. Restore one to put it back in your inbox.'\n )}\n </p>\n </div>\n <DropdownMenu>\n <DropdownMenuTrigger asChild>\n <Button\n variant=\"ghost\"\n size=\"icon\"\n aria-label={tr('notifications.v2.moreActions', 'More actions')}\n data-testid=\"notifications-archived-overflow\"\n >\n <MoreHorizontal size={18} aria-hidden=\"true\" />\n </Button>\n </DropdownMenuTrigger>\n <DropdownMenuContent align=\"end\">\n <DropdownMenuItem\n data-tour=\"notification-history-export\"\n disabled={notifications.length === 0}\n onSelect={() => exportNotificationsAsCsv(tr, notifications)}\n >\n <Download size={16} aria-hidden=\"true\" />\n {tr('notifications.v2.downloadSpreadsheet', 'Download as spreadsheet')}\n </DropdownMenuItem>\n </DropdownMenuContent>\n </DropdownMenu>\n </header>\n\n <section aria-label={tr('notifications.v2.filters', 'Filters')} className=\"space-y-3\">\n <div className=\"flex flex-col gap-3 sm:flex-row sm:items-center\">\n <SearchField\n label={tr('notifications.searchByTitleOrContent', 'Search by title or content...')}\n value={notificationFilter.search}\n onChange={(search) => updateFilter({ search })}\n />\n <div className=\"flex flex-wrap items-center gap-2\">\n <ViewChips\n chips={chips}\n value={view}\n onChange={setView}\n testIdPrefix=\"notifications-archived-view\"\n />\n <MoreFiltersButton\n open={moreFiltersOpen}\n active={moreFiltersActive}\n controls=\"notifications-archived-more-filters\"\n onToggle={() => setMoreFiltersOpen(!moreFiltersOpen)}\n />\n </div>\n </div>\n <div\n id=\"notifications-archived-more-filters\"\n hidden={!moreFiltersOpen}\n className=\"grid gap-3 rounded-lg border border-border-seam bg-bg-surface p-3 sm:grid-cols-3\"\n >\n <NativeSelect\n aria-label={tr('notifications.v2.topicFilter', 'Topic')}\n options={topicOptions}\n value={notificationFilter.topicId || ALL}\n onValueChange={(value) => updateFilter({ topicId: value === ALL ? undefined : value })}\n />\n <Input\n type=\"date\"\n aria-label={tr('notifications.startDate', 'Start date')}\n value={toDateInput(notificationFilter.dateRange.start)}\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 />\n <Input\n type=\"date\"\n aria-label={tr('notifications.endDate', 'End date')}\n value={toDateInput(notificationFilter.dateRange.end)}\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 />\n </div>\n </section>\n\n <div className=\"space-y-2\">\n {visible.length > 0 ? (\n visible.map((notification) => (\n <div key={notification.id} className=\"space-y-2\">\n <NotificationCard\n notification={notification}\n onArchive={notification.archivedAt ? undefined : archiveNotification}\n onAction={recordAction}\n showArchivedState\n analyticsSource=\"history\"\n navigationV2\n showTopic={moreFiltersOpen}\n />\n {notification.archivedAt && (\n <div className=\"flex justify-end\">\n <Button\n type=\"button\"\n variant=\"outline\"\n size=\"sm\"\n onClick={() => unarchiveNotification(notification.id)}\n >\n {tr('notifications.restore', 'Restore')}\n </Button>\n </div>\n )}\n </div>\n ))\n ) : (\n <IllustratedEmptyState\n illustration={hasActiveFilters ? 'empty-search' : 'empty-notifications'}\n title={\n hasActiveFilters\n ? tr('notifications.noNotificationsFound', 'No notifications found')\n : view === 'archived'\n ? tr('notifications.v2.archivedEmptyTitle', 'Nothing archived')\n : tr('notifications.historyEmptyTitle', 'No history yet')\n }\n description={\n hasActiveFilters\n ? tr('notifications.adjustSearchOrDateRange', 'Try adjusting your filters')\n : view === 'archived'\n ? tr(\n 'notifications.v2.archivedEmptyDescription',\n 'Archive a notification from your inbox and it moves here.'\n )\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 ? 'no-results' : hasActiveFilters ? 'filtered' : 'first-use'\n }\n />\n )}\n </div>\n\n <NotificationListFooter\n hasMore={hasMore}\n isLoadingMore={isLoadingMore}\n onLoadMore={loadMore}\n shownCount={visible.length}\n />\n </div>\n );\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;AA0BA,IAAMA,IAAiB;CAAE,UAAU;CAAM,SAAS;AAAe,GAC3DC,IAAM;AAEZ,SAASC,EAAY,GAA4B;CAC/C,OAAOC,IAAQA,EAAM,YAAY,CAAC,CAAC,MAAM,GAAG,CAAC,CAAC,KAAK;AACrD;AAUA,SAAgBC,IAAyB;CACvC,IAAMC,IAAKC,EAAM,GACX,EAAE,kBAAe,WAAWC,MAAuBC,EAAe,GAClE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