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