@burdenoff/microfe-notification 2026.1109.1 → 2026.1113.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 (70) hide show
  1. package/dist/NotificationRoutes.js +108 -36
  2. package/dist/NotificationRoutes.js.map +1 -1
  3. package/dist/components/ConfirmDeleteDialog.d.ts +17 -0
  4. package/dist/components/ConfirmDeleteDialog.js +22 -0
  5. package/dist/components/ConfirmDeleteDialog.js.map +1 -0
  6. package/dist/components/NotificationCard.d.ts +10 -1
  7. package/dist/components/NotificationCard.js +103 -72
  8. package/dist/components/NotificationCard.js.map +1 -1
  9. package/dist/hooks/index.js +5 -5
  10. package/dist/hooks/usePreferenceToggles.d.ts +27 -0
  11. package/dist/hooks/usePreferenceToggles.js +84 -0
  12. package/dist/hooks/usePreferenceToggles.js.map +1 -0
  13. package/dist/navigation-v2/AdminPageV2.d.ts +14 -0
  14. package/dist/navigation-v2/AdminPageV2.js +51 -0
  15. package/dist/navigation-v2/AdminPageV2.js.map +1 -0
  16. package/dist/navigation-v2/AdminToolsMenu.d.ts +6 -0
  17. package/dist/navigation-v2/AdminToolsMenu.js +32 -0
  18. package/dist/navigation-v2/AdminToolsMenu.js.map +1 -0
  19. package/dist/navigation-v2/BackToNotifications.d.ts +2 -0
  20. package/dist/navigation-v2/BackToNotifications.js +20 -0
  21. package/dist/navigation-v2/BackToNotifications.js.map +1 -0
  22. package/dist/navigation-v2/FilterControls.d.ts +25 -0
  23. package/dist/navigation-v2/FilterControls.js +64 -0
  24. package/dist/navigation-v2/FilterControls.js.map +1 -0
  25. package/dist/navigation-v2/NotificationArchivedV2.d.ts +9 -0
  26. package/dist/navigation-v2/NotificationArchivedV2.js +174 -0
  27. package/dist/navigation-v2/NotificationArchivedV2.js.map +1 -0
  28. package/dist/navigation-v2/NotificationInboxV2.d.ts +9 -0
  29. package/dist/navigation-v2/NotificationInboxV2.js +309 -0
  30. package/dist/navigation-v2/NotificationInboxV2.js.map +1 -0
  31. package/dist/navigation-v2/NotificationSettingsV2.d.ts +9 -0
  32. package/dist/navigation-v2/NotificationSettingsV2.js +203 -0
  33. package/dist/navigation-v2/NotificationSettingsV2.js.map +1 -0
  34. package/dist/navigation-v2/NotificationsV2Landing.d.ts +9 -0
  35. package/dist/navigation-v2/NotificationsV2Landing.js +37 -0
  36. package/dist/navigation-v2/NotificationsV2Landing.js.map +1 -0
  37. package/dist/navigation-v2/__tests__/uiMocks.d.ts +71 -0
  38. package/dist/navigation-v2/inboxFilters.d.ts +8 -0
  39. package/dist/navigation-v2/inboxFilters.js +10 -0
  40. package/dist/navigation-v2/inboxFilters.js.map +1 -0
  41. package/dist/navigation-v2/paths.d.ts +24 -0
  42. package/dist/navigation-v2/paths.js +31 -0
  43. package/dist/navigation-v2/paths.js.map +1 -0
  44. package/dist/navigation-v2/settingsOptions.d.ts +12 -0
  45. package/dist/navigation-v2/settingsOptions.js +58 -0
  46. package/dist/navigation-v2/settingsOptions.js.map +1 -0
  47. package/dist/navigation-v2/useAdminTools.d.ts +22 -0
  48. package/dist/navigation-v2/useAdminTools.js +76 -0
  49. package/dist/navigation-v2/useAdminTools.js.map +1 -0
  50. package/dist/pages/CreateNotificationPage.js +577 -558
  51. package/dist/pages/CreateNotificationPage.js.map +1 -1
  52. package/dist/pages/NotificationCenterPage.d.ts +3 -1
  53. package/dist/pages/NotificationCenterPage.js +79 -74
  54. package/dist/pages/NotificationCenterPage.js.map +1 -1
  55. package/dist/pages/NotificationHistoryPage.d.ts +5 -1
  56. package/dist/pages/NotificationHistoryPage.js +52 -47
  57. package/dist/pages/NotificationHistoryPage.js.map +1 -1
  58. package/dist/pages/NotificationPreferencesPage.d.ts +4 -0
  59. package/dist/pages/NotificationPreferencesPage.js +97 -158
  60. package/dist/pages/NotificationPreferencesPage.js.map +1 -1
  61. package/dist/pages/NotificationTemplatesPage.js +184 -166
  62. package/dist/pages/NotificationTemplatesPage.js.map +1 -1
  63. package/dist/pages/NotificationTopicsPage.js +123 -108
  64. package/dist/pages/NotificationTopicsPage.js.map +1 -1
  65. package/dist/pages/TemplateEditorPage.js +339 -308
  66. package/dist/pages/TemplateEditorPage.js.map +1 -1
  67. package/dist/providers/NotificationProvider.js +6 -5
  68. package/dist/providers/NotificationProvider.js.map +1 -1
  69. package/dist/types/index.d.ts +8 -0
  70. package/package.json +2 -2
@@ -2,354 +2,372 @@ import { useNotificationTemplates as e } from "../hooks/useNotificationTemplates
2
2
  import { NOTIFICATION_PERMISSIONS as t } from "../constants/permissions.js";
3
3
  import { useTr as n } from "../shared/hooks/useTr.js";
4
4
  import { nativeConfirm as r, nativeImpact as i, nativeNotify as a } from "../utils/nativeBridge.js";
5
- import { useMemo as o, useState as s } from "react";
6
- import { usePermissions as c } from "@burdenoff/fe-libs/shared/providers/shell";
7
- import { AlertCircle as l, FileText as u, Loader2 as d, Plus as f, RefreshCw as p, Search as m, Trash2 as h } from "lucide-react";
8
- import { useNavigate as g } from "react-router";
9
- import { jsx as _, jsxs as v } from "react/jsx-runtime";
10
- import { Button as y, EmphasisPanel as b, GlassCard as x, IllustratedEmptyState as S, NextSteps as C, PagePurpose as w } from "@burdenoff/fe-libs/ui";
11
- import { useI18n as ee } from "@burdenoff/fe-libs/shared/providers/shell/I18nProvider";
5
+ import { ConfirmDeleteDialog as o } from "../components/ConfirmDeleteDialog.js";
6
+ import { useNavigationV2 as s, useNotificationPaths as c } from "../navigation-v2/paths.js";
7
+ import { useMemo as ee, useState as l } from "react";
8
+ import { usePermissions as te } from "@burdenoff/fe-libs/shared/providers/shell";
9
+ import { AlertCircle as u, FileText as d, Loader2 as f, Plus as p, RefreshCw as ne, Search as re, Trash2 as m } from "lucide-react";
10
+ import { useNavigate as ie } from "react-router";
11
+ import { jsx as h, jsxs as g } from "react/jsx-runtime";
12
+ import { Button as _, EmphasisPanel as v, GlassCard as y, IllustratedEmptyState as b, NextSteps as ae, PagePurpose as oe } from "@burdenoff/fe-libs/ui";
13
+ import { useI18n as x } from "@burdenoff/fe-libs/shared/providers/shell/I18nProvider";
12
14
  // src/pages/NotificationTemplatesPage.tsx
13
- var te = {
15
+ var S = {
14
16
  TRANSACTIONAL: "text-status-info-text bg-status-info-bg-subtle border-status-info-bg-subtle",
15
17
  MARKETING: "text-accent-purple bg-accent-purple-subtle border-accent-purple-subtle",
16
18
  SYSTEM: "text-status-warning-text bg-status-warning-bg-subtle border-status-warning-bg-subtle",
17
19
  ALERT: "text-status-error-text bg-status-error-bg-subtle border-status-error-bg-subtle"
18
- }, T = {
20
+ }, se = {
19
21
  TRANSACTIONAL: "Transactional",
20
22
  MARKETING: "Marketing",
21
23
  SYSTEM: "System",
22
24
  ALERT: "Alert"
23
25
  };
24
- function E(e, t) {
26
+ function C(e, t) {
25
27
  return new Date(e).toLocaleDateString(t || "en-US", {
26
28
  month: "short",
27
29
  day: "numeric",
28
30
  year: "numeric"
29
31
  });
30
32
  }
31
- function D() {
32
- let D = g(), O = n(), { locale: k } = ee(), { hasPermission: A, isLoading: j } = c(), { templates: M, isLoading: N, isDeleting: P, error: F, total: I, hasMore: L, filter: R, refetch: z, loadMore: B, deleteTemplate: V, updateFilter: H } = e(), [U, W] = s(null), [G, K] = s(null), [q, J] = s(/* @__PURE__ */ new Set()), Y = o(() => M.filter((e) => q.has(e.id)), [q, M]), X = M.length > 0 && M.every((e) => q.has(e.id)), Z = M.some((e) => q.has(e.id)) && !X, Q = A(t.TEMPLATE_CREATE), $ = A(t.TEMPLATE_DELETE), ne = async (e, t) => {
33
+ function w() {
34
+ let w = ie(), T = n(), E = c(), D = s(), [O, k] = l(null), A = (e, t) => D ? new Promise((n) => k({
35
+ title: e,
36
+ message: t,
37
+ resolve: n
38
+ })) : Promise.resolve(window.confirm(t)), { locale: j } = x(), { hasPermission: M, isLoading: ce } = te(), { templates: N, isLoading: P, isDeleting: F, error: I, total: L, hasMore: R, filter: z, refetch: B, loadMore: V, deleteTemplate: H, updateFilter: U } = e(), [W, G] = l(null), [K, q] = l(null), [J, Y] = l(/* @__PURE__ */ new Set()), X = ee(() => N.filter((e) => J.has(e.id)), [J, N]), Z = N.length > 0 && N.every((e) => J.has(e.id)), le = N.some((e) => J.has(e.id)) && !Z, Q = M(t.TEMPLATE_CREATE), $ = M(t.TEMPLATE_DELETE), ue = async (e, t) => {
33
39
  e.stopPropagation(), i("medium");
34
- let n = O("notifTemplates.confirmDelete", `Delete template "${t.name}"? This cannot be undone.`), o = await r({
35
- title: O("notifTemplates.deleteTitle", "Delete template"),
40
+ let n = T("notifTemplates.confirmDelete", `Delete template "${t.name}"? This cannot be undone.`), o = await r({
41
+ title: T("notifTemplates.deleteTitle", "Delete template"),
36
42
  message: n,
37
- okButtonTitle: O("notifTemplates.delete", "Delete")
43
+ okButtonTitle: T("notifTemplates.delete", "Delete")
38
44
  });
39
- if (o === null ? confirm(n) : o) {
40
- W(t.id), K(null);
45
+ if (o === null ? await A(T("notifTemplates.deleteTitle", "Delete template"), n) : o) {
46
+ G(t.id), q(null);
41
47
  try {
42
- await V(t.id), a("success");
48
+ await H(t.id), a("success");
43
49
  } catch (e) {
44
- a("error"), K(e instanceof Error ? e.message : O("notifTemplates.deleteFailed", "Failed to delete template"));
50
+ a("error"), q(e instanceof Error ? e.message : T("notifTemplates.deleteFailed", "Failed to delete template"));
45
51
  } finally {
46
- W(null);
52
+ G(null);
47
53
  }
48
54
  }
49
- }, re = async () => {
50
- if (Y.length === 0) return;
55
+ }, de = async () => {
56
+ if (X.length === 0) return;
51
57
  i("medium");
52
- let e = O("notifTemplates.confirmBulkDelete", `Delete ${Y.length} selected template${Y.length === 1 ? "" : "s"}? This cannot be undone.`), t = await r({
53
- title: O("notifTemplates.bulkDeleteTitle", "Delete templates"),
58
+ let e = T("notifTemplates.confirmBulkDelete", `Delete ${X.length} selected template${X.length === 1 ? "" : "s"}? This cannot be undone.`), t = await r({
59
+ title: T("notifTemplates.bulkDeleteTitle", "Delete templates"),
54
60
  message: e,
55
- okButtonTitle: O("notifTemplates.delete", "Delete")
61
+ okButtonTitle: T("notifTemplates.delete", "Delete")
56
62
  });
57
- if (!(t === null ? window.confirm(e) : t)) return;
58
- K(null);
59
- let n = (await Promise.allSettled(Y.map((e) => V(e.id)))).some((e) => e.status === "rejected");
60
- a(n ? "error" : "success"), J(/* @__PURE__ */ new Set());
61
- }, ie = (e, t) => {
62
- J((n) => {
63
+ if (!(t === null ? await A(T("notifTemplates.bulkDeleteTitle", "Delete templates"), e) : t)) return;
64
+ q(null);
65
+ let n = (await Promise.allSettled(X.map((e) => H(e.id)))).some((e) => e.status === "rejected");
66
+ a(n ? "error" : "success"), Y(/* @__PURE__ */ new Set());
67
+ }, fe = (e, t) => {
68
+ Y((n) => {
63
69
  let r = new Set(n);
64
70
  return t ? r.add(e) : r.delete(e), r;
65
71
  });
66
- }, ae = (e) => {
67
- J((t) => {
72
+ }, pe = (e) => {
73
+ Y((t) => {
68
74
  let n = new Set(t);
69
- return M.forEach((t) => {
75
+ return N.forEach((t) => {
70
76
  e ? n.add(t.id) : n.delete(t.id);
71
77
  }), n;
72
78
  });
73
79
  };
74
- return j ? /* @__PURE__ */ _("div", {
80
+ return ce ? /* @__PURE__ */ h("div", {
75
81
  className: "flex h-64 items-center justify-center",
76
- children: /* @__PURE__ */ _("div", { className: "h-8 w-8 animate-spin rounded-full border-4 border-primary border-t-transparent" })
77
- }) : A(t.TEMPLATE_LIST) || Q || $ || A(t.TEMPLATE_UPDATE) ? N && M.length === 0 ? /* @__PURE__ */ v("div", {
82
+ children: /* @__PURE__ */ h("div", { className: "h-8 w-8 animate-spin rounded-full border-4 border-primary border-t-transparent" })
83
+ }) : M(t.TEMPLATE_LIST) || Q || $ || M(t.TEMPLATE_UPDATE) ? P && N.length === 0 ? /* @__PURE__ */ g("div", {
78
84
  className: "flex flex-col items-center justify-center h-64 gap-3",
79
- children: [/* @__PURE__ */ _(d, {
85
+ children: [/* @__PURE__ */ h(f, {
80
86
  size: 28,
81
87
  className: "animate-spin text-accent-primary"
82
- }), /* @__PURE__ */ _("p", {
88
+ }), /* @__PURE__ */ h("p", {
83
89
  className: "text-sm text-secondary",
84
- children: O("notifTemplates.loading", "Loading templates...")
90
+ children: T("notifTemplates.loading", "Loading templates...")
85
91
  })]
86
- }) : F && M.length === 0 ? /* @__PURE__ */ v("div", {
92
+ }) : I && N.length === 0 ? /* @__PURE__ */ g("div", {
87
93
  className: "flex flex-col items-center justify-center h-64 gap-4",
88
94
  children: [
89
- /* @__PURE__ */ _(l, {
95
+ /* @__PURE__ */ h(u, {
90
96
  size: 28,
91
97
  className: "text-error"
92
98
  }),
93
- /* @__PURE__ */ _("p", {
99
+ /* @__PURE__ */ h("p", {
94
100
  className: "text-sm text-error",
95
- children: F
101
+ children: I
96
102
  }),
97
- /* @__PURE__ */ v("button", {
98
- onClick: z,
103
+ /* @__PURE__ */ g("button", {
104
+ onClick: B,
99
105
  className: "flex items-center gap-2 px-4 py-2 text-sm font-medium text-white bg-accent-primary hover:bg-accent-primary/90 rounded-lg transition-all duration-150",
100
- children: [/* @__PURE__ */ _(p, { size: 14 }), O("notifTemplates.retry", "Retry")]
106
+ children: [/* @__PURE__ */ h(ne, { size: 14 }), T("notifTemplates.retry", "Retry")]
101
107
  })
102
108
  ]
103
- }) : /* @__PURE__ */ v("div", {
109
+ }) : /* @__PURE__ */ g("div", {
104
110
  className: "space-y-4 sm:space-y-6 p-3 sm:p-6 animate-in fade-in duration-200",
105
111
  children: [
106
- /* @__PURE__ */ _(w, {
107
- icon: /* @__PURE__ */ _(u, { size: 16 }),
108
- children: O("notifTemplates.purpose", "Reusable, versioned message blueprints — subject lines, bodies and channel layouts with {{variables}} you fill in at send time. Build a template once (e.g. a welcome email or a payment receipt) and reuse it from the Send page so every notification stays on-brand and consistent.")
112
+ /* @__PURE__ */ h(oe, {
113
+ icon: /* @__PURE__ */ h(d, { size: 16 }),
114
+ children: T("notifTemplates.purpose", "Reusable, versioned message blueprints — subject lines, bodies and channel layouts with {{variables}} you fill in at send time. Build a template once (e.g. a welcome email or a payment receipt) and reuse it from the Send page so every notification stays on-brand and consistent.")
109
115
  }),
110
- /* @__PURE__ */ v(b, {
116
+ /* @__PURE__ */ g(v, {
111
117
  className: "flex flex-col gap-4 p-5 sm:flex-row sm:items-center sm:justify-between sm:p-6",
112
- children: [/* @__PURE__ */ v("div", { children: [/* @__PURE__ */ _("h1", {
118
+ children: [/* @__PURE__ */ g("div", { children: [/* @__PURE__ */ h("h1", {
113
119
  className: "text-xl sm:text-2xl font-bold text-primary",
114
- children: O("notifTemplates.title", "Notification Templates")
115
- }), /* @__PURE__ */ v("p", {
120
+ children: T("notifTemplates.title", "Notification Templates")
121
+ }), /* @__PURE__ */ g("p", {
116
122
  className: "text-sm text-secondary mt-1",
117
123
  children: [
118
- I,
124
+ L,
119
125
  " ",
120
- O("notifTemplates.templateCount", "template"),
121
- I === 1 ? "" : "s",
126
+ T("notifTemplates.templateCount", "template"),
127
+ L === 1 ? "" : "s",
122
128
  " ",
123
- O("notifTemplates.total", "total")
129
+ T("notifTemplates.total", "total")
124
130
  ]
125
- })] }), Q && /* @__PURE__ */ v(y, {
126
- onClick: () => D("new"),
131
+ })] }), Q && /* @__PURE__ */ g(_, {
132
+ onClick: () => w(E.newTemplate),
127
133
  className: "gap-2",
128
- children: [/* @__PURE__ */ _(f, { size: 16 }), O("notifTemplates.createTemplate", "Create Template")]
134
+ children: [/* @__PURE__ */ h(p, { size: 16 }), T("notifTemplates.createTemplate", "Create Template")]
129
135
  })]
130
136
  }),
131
- /* @__PURE__ */ _(C, {
137
+ /* @__PURE__ */ h(ae, {
132
138
  storageKey: "notification-templates",
133
139
  steps: [
134
140
  ...Q ? [{
135
141
  id: "create-template",
136
- label: O("notifTemplates.nextCreateLabel", "Create your first template"),
137
- description: O("notifTemplates.nextCreateDesc", "Build a reusable message blueprint with {{variables}} you fill in at send time."),
138
- onClick: () => D("new")
142
+ label: T("notifTemplates.nextCreateLabel", "Create your first template"),
143
+ description: T("notifTemplates.nextCreateDesc", "Build a reusable message blueprint with {{variables}} you fill in at send time."),
144
+ onClick: () => w(E.newTemplate)
139
145
  }] : [],
140
146
  {
141
147
  id: "filter-type",
142
- label: O("notifTemplates.nextFilterLabel", "Filter by type"),
143
- description: O("notifTemplates.nextFilterDesc", "Narrow to Transactional, Marketing, System or Alert templates to find one fast."),
144
- onClick: () => H({ type: "TRANSACTIONAL" })
148
+ label: T("notifTemplates.nextFilterLabel", "Filter by type"),
149
+ description: T("notifTemplates.nextFilterDesc", "Narrow to Transactional, Marketing, System or Alert templates to find one fast."),
150
+ onClick: () => U({ type: "TRANSACTIONAL" })
145
151
  },
146
152
  {
147
153
  id: "use-on-send",
148
- label: O("notifTemplates.nextUseLabel", "Send with a template"),
149
- description: O("notifTemplates.nextUseDesc", "Pick any saved template from the Send page so every notification stays on-brand."),
150
- href: "../send"
154
+ label: T("notifTemplates.nextUseLabel", "Send with a template"),
155
+ description: T("notifTemplates.nextUseDesc", "Pick any saved template from the Send page so every notification stays on-brand."),
156
+ href: E.send
151
157
  }
152
158
  ]
153
159
  }),
154
- /* @__PURE__ */ v("div", {
160
+ /* @__PURE__ */ g("div", {
155
161
  className: "flex flex-col gap-3 sm:flex-row sm:items-center",
156
- children: [/* @__PURE__ */ v("div", {
162
+ children: [/* @__PURE__ */ g("div", {
157
163
  className: "relative flex-1",
158
- children: [/* @__PURE__ */ _(m, {
164
+ children: [/* @__PURE__ */ h(re, {
159
165
  size: 16,
160
166
  className: "absolute left-3 top-1/2 -translate-y-1/2 text-tertiary"
161
- }), /* @__PURE__ */ _("input", {
167
+ }), /* @__PURE__ */ h("input", {
162
168
  type: "text",
163
- value: R.search || "",
164
- onChange: (e) => H({ search: e.target.value }),
165
- placeholder: O("notifTemplates.searchPlaceholder", "Search templates..."),
169
+ value: z.search || "",
170
+ onChange: (e) => U({ search: e.target.value }),
171
+ placeholder: T("notifTemplates.searchPlaceholder", "Search templates..."),
166
172
  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"
167
173
  })]
168
- }), /* @__PURE__ */ v("select", {
169
- value: R.type || "",
170
- onChange: (e) => H({ type: e.target.value || void 0 }),
174
+ }), /* @__PURE__ */ g("select", {
175
+ value: z.type || "",
176
+ onChange: (e) => U({ type: e.target.value || void 0 }),
171
177
  className: "px-3 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 scheme-normal dark:scheme-dark [&_option]:bg-bg-surface [&_option]:text-text-primary",
172
178
  children: [
173
- /* @__PURE__ */ _("option", {
179
+ /* @__PURE__ */ h("option", {
174
180
  value: "",
175
- children: O("notifTemplates.allTypes", "All Types")
181
+ children: T("notifTemplates.allTypes", "All Types")
176
182
  }),
177
- /* @__PURE__ */ _("option", {
183
+ /* @__PURE__ */ h("option", {
178
184
  value: "TRANSACTIONAL",
179
- children: O("notifTemplates.typeTransactional", "Transactional")
185
+ children: T("notifTemplates.typeTransactional", "Transactional")
180
186
  }),
181
- /* @__PURE__ */ _("option", {
187
+ /* @__PURE__ */ h("option", {
182
188
  value: "MARKETING",
183
- children: O("notifTemplates.typeMarketing", "Marketing")
189
+ children: T("notifTemplates.typeMarketing", "Marketing")
184
190
  }),
185
- /* @__PURE__ */ _("option", {
191
+ /* @__PURE__ */ h("option", {
186
192
  value: "SYSTEM",
187
- children: O("notifTemplates.typeSystem", "System")
193
+ children: T("notifTemplates.typeSystem", "System")
188
194
  }),
189
- /* @__PURE__ */ _("option", {
195
+ /* @__PURE__ */ h("option", {
190
196
  value: "ALERT",
191
- children: O("notifTemplates.typeAlert", "Alert")
197
+ children: T("notifTemplates.typeAlert", "Alert")
192
198
  })
193
199
  ]
194
200
  })]
195
201
  }),
196
- M.length > 0 && /* @__PURE__ */ v(x, {
202
+ N.length > 0 && /* @__PURE__ */ g(y, {
197
203
  treatment: "plain",
198
204
  className: "flex flex-col gap-3 border-border-seam p-4 sm:flex-row sm:items-center sm:justify-between",
199
- children: [/* @__PURE__ */ v("label", {
205
+ children: [/* @__PURE__ */ g("label", {
200
206
  className: "flex items-center gap-2 text-sm text-primary",
201
- children: [/* @__PURE__ */ _("input", {
207
+ children: [/* @__PURE__ */ h("input", {
202
208
  type: "checkbox",
203
- checked: X,
209
+ checked: Z,
204
210
  ref: (e) => {
205
- e && (e.indeterminate = Z && !X);
211
+ e && (e.indeterminate = le && !Z);
206
212
  },
207
- onChange: (e) => ae(e.target.checked),
208
- "aria-label": O("notifTemplates.selectAllVisibleAria", "Select all notification templates"),
213
+ onChange: (e) => pe(e.target.checked),
214
+ "aria-label": T("notifTemplates.selectAllVisibleAria", "Select all notification templates"),
209
215
  className: "h-4 w-4 rounded border-default text-accent-primary"
210
- }), /* @__PURE__ */ _("span", { children: O("notifTemplates.selectAllVisible", "Select all visible") })]
211
- }), /* @__PURE__ */ v("div", {
216
+ }), /* @__PURE__ */ h("span", { children: T("notifTemplates.selectAllVisible", "Select all visible") })]
217
+ }), /* @__PURE__ */ g("div", {
212
218
  className: "flex items-center gap-2",
213
219
  children: [
214
- /* @__PURE__ */ v("span", {
220
+ /* @__PURE__ */ g("span", {
215
221
  className: "text-sm text-secondary",
216
222
  children: [
217
- q.size,
223
+ J.size,
218
224
  " ",
219
- O("notifTemplates.selected", "selected")
225
+ T("notifTemplates.selected", "selected")
220
226
  ]
221
227
  }),
222
- q.size > 0 && /* @__PURE__ */ _("button", {
223
- onClick: () => J(/* @__PURE__ */ new Set()),
228
+ J.size > 0 && /* @__PURE__ */ h("button", {
229
+ onClick: () => Y(/* @__PURE__ */ new Set()),
224
230
  className: "text-sm text-secondary hover:text-primary",
225
- children: O("notifTemplates.clearSelection", "Clear selection")
231
+ children: T("notifTemplates.clearSelection", "Clear selection")
226
232
  }),
227
- $ && /* @__PURE__ */ v("button", {
228
- onClick: re,
229
- disabled: Y.length === 0 || P,
233
+ $ && /* @__PURE__ */ g("button", {
234
+ onClick: de,
235
+ disabled: X.length === 0 || F,
230
236
  className: "flex items-center gap-2 px-3 py-2 text-sm font-medium text-error border border-error/30 hover:bg-error/10 rounded-lg transition-all duration-150 disabled:opacity-50",
231
237
  children: [
232
- /* @__PURE__ */ _(h, { size: 14 }),
233
- O("notifTemplates.deleteSelected", "Delete Selected"),
234
- Y.length > 0 ? ` (${Y.length})` : ""
238
+ /* @__PURE__ */ h(m, { size: 14 }),
239
+ T("notifTemplates.deleteSelected", "Delete Selected"),
240
+ X.length > 0 ? ` (${X.length})` : ""
235
241
  ]
236
242
  })
237
243
  ]
238
244
  })]
239
245
  }),
240
- G && /* @__PURE__ */ v("div", {
246
+ K && /* @__PURE__ */ g("div", {
241
247
  className: "flex items-center gap-3 p-3 bg-error/10 border border-error/30 rounded-lg",
242
- children: [/* @__PURE__ */ _(l, {
248
+ children: [/* @__PURE__ */ h(u, {
243
249
  size: 16,
244
250
  className: "text-error shrink-0"
245
- }), /* @__PURE__ */ _("p", {
251
+ }), /* @__PURE__ */ h("p", {
246
252
  className: "text-sm text-error",
247
- children: G
253
+ children: K
248
254
  })]
249
255
  }),
250
- M.length === 0 && !N && /* @__PURE__ */ _(S, {
251
- illustration: R.search || R.type ? "empty-search" : "empty-files",
252
- title: R.search || R.type ? O("notifTemplates.noMatchingTemplates", "No templates match your filters") : O("notifTemplates.noTemplatesYet", "No templates yet. Create your first one!"),
253
- description: R.search || R.type ? O("notifications.adjustSearchOrDateRange", "Try adjusting your filters") : O("notifTemplates.noTemplatesDescription", "Reusable templates let you send consistent notifications fast."),
254
- action: !R.search && !R.type && Q ? /* @__PURE__ */ v(y, {
255
- onClick: () => D("new"),
256
+ N.length === 0 && !P && /* @__PURE__ */ h(b, {
257
+ illustration: z.search || z.type ? "empty-search" : "empty-files",
258
+ title: z.search || z.type ? T("notifTemplates.noMatchingTemplates", "No templates match your filters") : T("notifTemplates.noTemplatesYet", "No templates yet. Create your first one!"),
259
+ description: z.search || z.type ? T("notifications.adjustSearchOrDateRange", "Try adjusting your filters") : T("notifTemplates.noTemplatesDescription", "Reusable templates let you send consistent notifications fast."),
260
+ action: !z.search && !z.type && Q ? /* @__PURE__ */ g(_, {
261
+ onClick: () => w(E.newTemplate),
256
262
  className: "gap-2",
257
- children: [/* @__PURE__ */ _(f, { size: 16 }), O("notifTemplates.createTemplate", "Create Template")]
263
+ children: [/* @__PURE__ */ h(p, { size: 16 }), T("notifTemplates.createTemplate", "Create Template")]
258
264
  }) : void 0
259
265
  }),
260
- /* @__PURE__ */ _("div", {
266
+ /* @__PURE__ */ h("div", {
261
267
  className: "grid gap-4 sm:grid-cols-2 lg:grid-cols-3",
262
- children: M.map((e) => /* @__PURE__ */ v("div", {
263
- onClick: () => D(e.slug),
264
- className: `group relative p-4 bg-gloss-card border rounded-lg cursor-pointer transition-[box-shadow,border-color] duration-200 hover:shadow-[var(--shadow-pop)] hover:border-accent-primary/30 ${q.has(e.id) ? "border-accent-primary/50 ring-1 ring-accent-primary/20" : "border-border-seam"}`,
268
+ children: N.map((e) => /* @__PURE__ */ g("div", {
269
+ onClick: () => w(E.template(e.slug)),
270
+ className: `group relative p-4 bg-gloss-card border rounded-lg cursor-pointer transition-[box-shadow,border-color] duration-200 hover:shadow-[var(--shadow-pop)] hover:border-accent-primary/30 ${J.has(e.id) ? "border-accent-primary/50 ring-1 ring-accent-primary/20" : "border-border-seam"}`,
265
271
  children: [
266
- /* @__PURE__ */ v("div", {
272
+ /* @__PURE__ */ g("div", {
267
273
  className: "flex items-start justify-between mb-3",
268
- children: [/* @__PURE__ */ v("div", {
274
+ children: [/* @__PURE__ */ g("div", {
269
275
  className: "flex items-center gap-2",
270
- children: [/* @__PURE__ */ _("input", {
276
+ children: [/* @__PURE__ */ h("input", {
271
277
  type: "checkbox",
272
- checked: q.has(e.id),
278
+ checked: J.has(e.id),
273
279
  onChange: (t) => {
274
- t.stopPropagation(), ie(e.id, t.target.checked);
280
+ t.stopPropagation(), fe(e.id, t.target.checked);
275
281
  },
276
282
  onClick: (e) => e.stopPropagation(),
277
- "aria-label": O("notifTemplates.selectTemplateAria", "Select template {{name}}").replace("{{name}}", e.name),
283
+ "aria-label": T("notifTemplates.selectTemplateAria", "Select template {{name}}").replace("{{name}}", e.name),
278
284
  className: "h-4 w-4 rounded border-default text-accent-primary"
279
- }), /* @__PURE__ */ _(u, {
285
+ }), /* @__PURE__ */ h(d, {
280
286
  size: 20,
281
287
  className: "text-accent-primary"
282
288
  })]
283
- }), /* @__PURE__ */ v("div", {
289
+ }), /* @__PURE__ */ g("div", {
284
290
  className: "flex items-center gap-2",
285
- children: [/* @__PURE__ */ _("span", {
286
- className: `px-2 py-0.5 text-[10px] font-semibold rounded-full border ${te[e.type] || "text-tertiary bg-bg-sunken border-default"}`,
287
- children: O(`notifTemplates.type.${e.type}`, T[e.type] || e.type)
288
- }), $ && /* @__PURE__ */ _("button", {
289
- onClick: (t) => ne(t, e),
290
- disabled: P && U === e.id,
291
+ children: [/* @__PURE__ */ h("span", {
292
+ className: `px-2 py-0.5 text-[10px] font-semibold rounded-full border ${S[e.type] || "text-tertiary bg-bg-sunken border-default"}`,
293
+ children: T(`notifTemplates.type.${e.type}`, se[e.type] || e.type)
294
+ }), $ && /* @__PURE__ */ h("button", {
295
+ onClick: (t) => ue(t, e),
296
+ disabled: F && W === e.id,
291
297
  className: "opacity-0 group-hover:opacity-100 p-1 text-tertiary hover:text-error rounded transition-all duration-150",
292
- title: O("notifTemplates.deleteTemplate", "Delete template"),
293
- children: P && U === e.id ? /* @__PURE__ */ _(d, {
298
+ title: T("notifTemplates.deleteTemplate", "Delete template"),
299
+ children: F && W === e.id ? /* @__PURE__ */ h(f, {
294
300
  size: 14,
295
301
  className: "animate-spin"
296
- }) : /* @__PURE__ */ _(h, { size: 14 })
302
+ }) : /* @__PURE__ */ h(m, { size: 14 })
297
303
  })]
298
304
  })]
299
305
  }),
300
- /* @__PURE__ */ _("h3", {
306
+ /* @__PURE__ */ h("h3", {
301
307
  className: "text-sm font-semibold text-primary mb-1 truncate",
302
308
  children: e.name
303
309
  }),
304
- e.description && /* @__PURE__ */ _("p", {
310
+ e.description && /* @__PURE__ */ h("p", {
305
311
  className: "text-xs text-secondary mb-2 line-clamp-2",
306
312
  children: e.description
307
313
  }),
308
- /* @__PURE__ */ v("div", {
314
+ /* @__PURE__ */ g("div", {
309
315
  className: "flex items-center gap-2 text-[11px] text-tertiary mt-auto pt-2 border-t border-default/50",
310
316
  children: [
311
- /* @__PURE__ */ _("code", {
317
+ /* @__PURE__ */ h("code", {
312
318
  className: "px-1.5 py-0.5 bg-bg-sunken rounded text-[10px]",
313
319
  children: e.slug
314
320
  }),
315
- /* @__PURE__ */ _("span", { children: "•" }),
316
- /* @__PURE__ */ _("span", { children: e.locale || "en" }),
317
- /* @__PURE__ */ _("span", { children: "•" }),
318
- /* @__PURE__ */ _("span", {
321
+ /* @__PURE__ */ h("span", { children: "•" }),
322
+ /* @__PURE__ */ h("span", { children: e.locale || "en" }),
323
+ /* @__PURE__ */ h("span", { children: "•" }),
324
+ /* @__PURE__ */ h("span", {
319
325
  className: e.enabled ? "text-success" : "text-tertiary",
320
- children: e.enabled ? O("notifTemplates.enabled", "Enabled") : O("notifTemplates.disabled", "Disabled")
326
+ children: e.enabled ? T("notifTemplates.enabled", "Enabled") : T("notifTemplates.disabled", "Disabled")
321
327
  })
322
328
  ]
323
329
  }),
324
- /* @__PURE__ */ v("p", {
330
+ /* @__PURE__ */ g("p", {
325
331
  className: "text-[10px] text-tertiary mt-1.5",
326
332
  children: [
327
- O("notifTemplates.updated", "Updated"),
333
+ T("notifTemplates.updated", "Updated"),
328
334
  " ",
329
- E(e.updatedAt, k)
335
+ C(e.updatedAt, j)
330
336
  ]
331
337
  })
332
338
  ]
333
339
  }, e.id))
334
340
  }),
335
- L && /* @__PURE__ */ _("div", {
341
+ R && /* @__PURE__ */ h("div", {
336
342
  className: "flex justify-center pt-2",
337
- children: /* @__PURE__ */ v("button", {
338
- onClick: B,
339
- disabled: N,
343
+ children: /* @__PURE__ */ g("button", {
344
+ onClick: V,
345
+ disabled: P,
340
346
  className: "flex items-center gap-2 px-4 py-2 text-sm text-secondary hover:text-primary border border-default rounded-lg transition-all duration-150 hover:shadow-sm",
341
- children: [N ? /* @__PURE__ */ _(d, {
347
+ children: [P ? /* @__PURE__ */ h(f, {
342
348
  size: 14,
343
349
  className: "animate-spin"
344
- }) : null, O("notifTemplates.loadMore", "Load More")]
350
+ }) : null, T("notifTemplates.loadMore", "Load More")]
345
351
  })
352
+ }),
353
+ D && /* @__PURE__ */ h(o, {
354
+ open: O !== null,
355
+ title: O?.title ?? "",
356
+ description: O?.message ?? "",
357
+ confirmLabel: T("notifTemplates.delete", "Delete"),
358
+ onCancel: () => {
359
+ O?.resolve(!1), k(null);
360
+ },
361
+ onConfirm: () => {
362
+ O?.resolve(!0), k(null);
363
+ }
346
364
  })
347
365
  ]
348
- }) : /* @__PURE__ */ _("div", {
366
+ }) : /* @__PURE__ */ h("div", {
349
367
  className: "p-8 text-center text-text-secondary",
350
- children: O("notifTemplates.noPermissionView", "You don't have permission to view notification templates.")
368
+ children: T("notifTemplates.noPermissionView", "You don't have permission to view notification templates.")
351
369
  });
352
370
  }
353
- export { D as NotificationTemplatesPage };
371
+ export { w as NotificationTemplatesPage };
354
372
 
355
373
  //# sourceMappingURL=NotificationTemplatesPage.js.map