@burdenoff/microfe-notification 2026.625.1 → 2026.626.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,15 +4,15 @@ import { isPermissionError as n } from "../utils/index.js";
4
4
  import { NOTIFICATION_PERMISSIONS as r } from "../constants/permissions.js";
5
5
  import { useNotificationTemplate as i, useNotificationTemplates as ee } from "../hooks/useNotificationTemplates.js";
6
6
  import { TemplatePreview as te } from "../components/TemplatePreview.js";
7
- import { useCallback as a, useEffect as o, useMemo as s, useRef as c, useState as l } from "react";
8
- import { useGlobalUi as ne, usePermissions as re } from "@burdenoff/fe-libs/shared/providers/shell";
9
- import { AlertCircle as u, ArrowLeft as ie, Code as ae, Eye as d, EyeOff as f, Loader2 as p, Plus as oe, Save as m, Trash2 as se, Type as ce, Variable as le } from "lucide-react";
10
- import { useNavigate as ue, useParams as de } from "react-router-dom";
11
- import { jsx as h, jsxs as g } from "react/jsx-runtime";
12
- import { Button as fe } from "@burdenoff/fe-libs/ui";
13
- import { useI18n as pe } from "@burdenoff/fe-libs/shared/providers/shell/I18nProvider";
7
+ import { useCallback as a, useEffect as o, useMemo as s, useRef as ne, useState as c } from "react";
8
+ import { useGlobalUi as re, usePermissions as ie } from "@burdenoff/fe-libs/shared/providers/shell";
9
+ import { AlertCircle as l, ArrowLeft as ae, Code as oe, Eye as u, EyeOff as d, Loader2 as f, Plus as se, Save as p, Trash2 as ce, Type as le, Variable as ue } from "lucide-react";
10
+ import { useNavigate as de, useParams as fe } from "react-router-dom";
11
+ import { jsx as m, jsxs as h } from "react/jsx-runtime";
12
+ import { Button as pe, NextSteps as me, PagePurpose as he } from "@burdenoff/fe-libs/ui";
13
+ import { useI18n as ge } from "@burdenoff/fe-libs/shared/providers/shell/I18nProvider";
14
14
  //#region src/pages/TemplateEditorPage.tsx
15
- var me = [
15
+ var _e = [
16
16
  {
17
17
  value: "TRANSACTIONAL",
18
18
  label: "Transactional",
@@ -33,7 +33,7 @@ var me = [
33
33
  label: "Alert",
34
34
  description: "Urgent alerts and warnings"
35
35
  }
36
- ], he = [
36
+ ], ve = [
37
37
  {
38
38
  value: "EMAIL",
39
39
  label: "Email"
@@ -70,7 +70,7 @@ var me = [
70
70
  value: "TELEGRAM",
71
71
  label: "Telegram"
72
72
  }
73
- ], ge = [
73
+ ], ye = [
74
74
  {
75
75
  value: "string",
76
76
  label: "String"
@@ -88,10 +88,10 @@ var me = [
88
88
  label: "Date"
89
89
  }
90
90
  ];
91
- function _e(e) {
91
+ function be(e) {
92
92
  return e.toLowerCase().replace(/[^a-z0-9\s-]/g, "").replace(/\s+/g, "-").replace(/-+/g, "-").replace(/^-|-$/g, "");
93
93
  }
94
- function _(e, t, n) {
94
+ function g(e, t, n) {
95
95
  return e ? e.replace(/\{\{(\w+)\}\}/g, (e, r) => {
96
96
  let i = t.find((e) => e.name === r);
97
97
  if (!i) return e;
@@ -104,7 +104,7 @@ function _(e, t, n) {
104
104
  }
105
105
  }) : "";
106
106
  }
107
- function v(e) {
107
+ function _(e) {
108
108
  let t = {};
109
109
  for (let n of e) {
110
110
  let e = n.name.trim();
@@ -116,7 +116,7 @@ function v(e) {
116
116
  }
117
117
  return t;
118
118
  }
119
- function ve(e) {
119
+ function xe(e) {
120
120
  return e ? Array.isArray(e) ? e.map((e) => ({
121
121
  name: e.name || "",
122
122
  type: e.type || "string",
@@ -127,40 +127,40 @@ function ve(e) {
127
127
  defaultValue: t?.defaultValue || ""
128
128
  })) : [] : [];
129
129
  }
130
- function y() {
131
- let y = ue(), b = t(), { locale: x } = pe(), { templateId: ye } = de(), S = !!ye, { hasPermission: be, isLoading: xe, refreshPermissions: Se } = re(), { showToast: Ce } = ne(), { createTemplate: we, updateTemplate: Te, isCreating: Ee, isUpdating: De } = ee(), { trackTemplateSaved: Oe } = e(), { template: C, isLoading: ke, error: Ae } = i(S ? ye : void 0), [w, T] = l(""), [E, D] = l(""), [O, k] = l(!1), [A, j] = l(""), [M, je] = l("TRANSACTIONAL"), [N, Me] = l(""), [P, F] = l("en"), [I, L] = l(""), [R, z] = l(""), [B, V] = l(""), [H, U] = l([]), [W, G] = l("text"), K = c(null), q = c(null), [J, Y] = l(null), [Ne, X] = l(null), [Z, Pe] = l(!0), [Fe, Ie] = l("email");
130
+ function v() {
131
+ let v = de(), y = t(), { locale: b } = ge(), { templateId: x } = fe(), S = !!x, { hasPermission: Se, isLoading: Ce, refreshPermissions: we } = ie(), { showToast: Te } = re(), { createTemplate: Ee, updateTemplate: De, isCreating: Oe, isUpdating: ke } = ee(), { trackTemplateSaved: C } = e(), { template: w, isLoading: Ae, error: T } = i(S ? x : void 0), [E, D] = c(""), [O, k] = c(""), [je, Me] = c(!1), [A, j] = c(""), [M, N] = c("TRANSACTIONAL"), [P, Ne] = c(""), [F, I] = c("en"), [L, R] = c(""), [z, B] = c(""), [V, H] = c(""), [U, W] = c([]), [G, K] = c("text"), Pe = ne(null), Fe = ne(null), [Ie, q] = c(null), [Le, J] = c(null), [Y, X] = c(!0), [Re, ze] = c("email");
132
132
  o(() => {
133
- C && (T(C.name), D(C.slug), k(!0), j(C.description || ""), je(C.type), F(C.locale || "en"), L(C.subject || ""), z(C.bodyTemplate || ""), V(C.htmlTemplate || ""), U(ve(C.variables)), C.htmlTemplate && G("html"));
134
- }, [C]), o(() => {
135
- !O && w && D(_e(w));
136
- }, [w, O]);
137
- let Le = s(() => _(I, H, x), [
138
- x,
139
- I,
140
- H
141
- ]), Re = s(() => _(R, H, x), [
142
- R,
143
- x,
144
- H
145
- ]), ze = s(() => _(B, H, x), [
146
- x,
147
- B,
148
- H
149
- ]), Be = a(() => {
150
- U((e) => [...e, {
133
+ w && (D(w.name), k(w.slug), Me(!0), j(w.description || ""), N(w.type), I(w.locale || "en"), R(w.subject || ""), B(w.bodyTemplate || ""), H(w.htmlTemplate || ""), W(xe(w.variables)), w.htmlTemplate && K("html"));
134
+ }, [w]), o(() => {
135
+ !je && E && k(be(E));
136
+ }, [E, je]);
137
+ let Be = s(() => g(L, U, b), [
138
+ b,
139
+ L,
140
+ U
141
+ ]), Ve = s(() => g(z, U, b), [
142
+ z,
143
+ b,
144
+ U
145
+ ]), He = s(() => g(V, U, b), [
146
+ b,
147
+ V,
148
+ U
149
+ ]), Ue = a(() => {
150
+ W((e) => [...e, {
151
151
  name: "",
152
152
  type: "string",
153
153
  defaultValue: ""
154
154
  }]);
155
- }, []), Ve = a((e) => {
156
- U((t) => t.filter((t, n) => n !== e));
157
- }, []), Q = a((e, t, n) => {
158
- U((r) => r.map((r, i) => i === e ? {
155
+ }, []), We = a((e) => {
156
+ W((t) => t.filter((t, n) => n !== e));
157
+ }, []), Z = a((e, t, n) => {
158
+ W((r) => r.map((r, i) => i === e ? {
159
159
  ...r,
160
160
  [t]: n
161
161
  } : r));
162
- }, []), He = a((e) => {
163
- let t = `{{${e}}}`, n = W === "html", r = n ? q.current : K.current, i = n ? V : z;
162
+ }, []), Ge = a((e) => {
163
+ let t = `{{${e}}}`, n = G === "html", r = n ? Fe.current : Pe.current, i = n ? H : B;
164
164
  if (r) {
165
165
  let e = r.selectionStart, n = r.selectionEnd;
166
166
  i((r) => r.substring(0, e) + t + r.substring(n)), requestAnimationFrame(() => {
@@ -169,280 +169,311 @@ function y() {
169
169
  r.selectionStart = n, r.selectionEnd = n;
170
170
  });
171
171
  } else i((e) => e + t);
172
- }, [W]), Ue = async (e) => {
173
- if (e.preventDefault(), Y(null), X(null), !w.trim()) {
174
- Y(b("notifTemplates.nameRequired", "Template name is required"));
172
+ }, [G]), Q = async (e) => {
173
+ if (e?.preventDefault(), q(null), J(null), !E.trim()) {
174
+ q(y("notifTemplates.nameRequired", "Template name is required"));
175
175
  return;
176
176
  }
177
- if (!E.trim()) {
178
- Y(b("notifTemplates.slugRequired", "Template slug is required"));
177
+ if (!O.trim()) {
178
+ q(y("notifTemplates.slugRequired", "Template slug is required"));
179
179
  return;
180
180
  }
181
- if (!R.trim()) {
182
- Y(b("notifTemplates.bodyRequired", "Body template is required"));
181
+ if (!z.trim()) {
182
+ q(y("notifTemplates.bodyRequired", "Body template is required"));
183
183
  return;
184
184
  }
185
- if (H.filter((e) => !e.name.trim()).length > 0) {
186
- Y(b("notifTemplates.variablesNeedName", "All variables must have a name"));
185
+ if (U.filter((e) => !e.name.trim()).length > 0) {
186
+ q(y("notifTemplates.variablesNeedName", "All variables must have a name"));
187
187
  return;
188
188
  }
189
- let t = H.map((e) => e.name.trim()), r = t.filter((e, n) => t.indexOf(e) !== n);
189
+ let t = U.map((e) => e.name.trim()), r = t.filter((e, n) => t.indexOf(e) !== n);
190
190
  if (r.length > 0) {
191
- Y(`${b("notifTemplates.duplicateVariableName", "Duplicate variable name")}: ${r[0]}`);
191
+ q(`${y("notifTemplates.duplicateVariableName", "Duplicate variable name")}: ${r[0]}`);
192
192
  return;
193
193
  }
194
194
  try {
195
- if (S && C) {
195
+ if (S && w) {
196
196
  let e = {
197
- name: w.trim(),
197
+ name: E.trim(),
198
198
  description: A.trim() || void 0,
199
- subject: I.trim() || void 0,
200
- bodyTemplate: R.trim(),
201
- htmlTemplate: B.trim() || void 0,
202
- variables: v(H)
199
+ subject: L.trim() || void 0,
200
+ bodyTemplate: z.trim(),
201
+ htmlTemplate: V.trim() || void 0,
202
+ variables: _(U)
203
203
  };
204
- await Te(C.id, e), Oe({
204
+ await De(w.id, e), C({
205
205
  action: "update",
206
- channel: N || void 0,
207
- type: C.type,
208
- variableCount: H.length,
209
- hasHtml: !!B.trim()
210
- }), X(b("notifTemplates.updateSuccess", "Template updated successfully"));
211
- } else await we({
212
- slug: E.trim(),
213
- name: w.trim(),
206
+ channel: P || void 0,
207
+ type: w.type,
208
+ variableCount: U.length,
209
+ hasHtml: !!V.trim()
210
+ }), J(y("notifTemplates.updateSuccess", "Template updated successfully"));
211
+ } else await Ee({
212
+ slug: O.trim(),
213
+ name: E.trim(),
214
214
  description: A.trim() || void 0,
215
215
  type: M,
216
- locale: P || "en",
217
- subject: I.trim() || void 0,
218
- bodyTemplate: R.trim(),
219
- htmlTemplate: B.trim() || void 0,
220
- variables: v(H),
221
- ...N ? { channel: N } : {}
222
- }), Oe({
216
+ locale: F || "en",
217
+ subject: L.trim() || void 0,
218
+ bodyTemplate: z.trim(),
219
+ htmlTemplate: V.trim() || void 0,
220
+ variables: _(U),
221
+ ...P ? { channel: P } : {}
222
+ }), C({
223
223
  action: "create",
224
- channel: N || void 0,
224
+ channel: P || void 0,
225
225
  type: M,
226
- variableCount: H.length,
227
- hasHtml: !!B.trim()
228
- }), X(b("notifTemplates.createSuccess", "Template created successfully")), setTimeout(() => y("..", { relative: "path" }), 1200);
226
+ variableCount: U.length,
227
+ hasHtml: !!V.trim()
228
+ }), J(y("notifTemplates.createSuccess", "Template created successfully")), setTimeout(() => v("..", { relative: "path" }), 1200);
229
229
  } catch (e) {
230
230
  if (n(e)) {
231
- Ce(b("notifTemplates.permissionDeniedOnSave", "You don't have permission to save this template. Refreshing access…"), "warning"), Se().catch((e) => console.warn("[permissions] refresh failed after template save denial:", e));
231
+ Te(y("notifTemplates.permissionDeniedOnSave", "You don't have permission to save this template. Refreshing access…"), "warning"), we().catch((e) => console.warn("[permissions] refresh failed after template save denial:", e));
232
232
  return;
233
233
  }
234
- Y(e instanceof Error ? e.message : b("notifTemplates.saveFailed", "Failed to save template"));
234
+ q(e instanceof Error ? e.message : y("notifTemplates.saveFailed", "Failed to save template"));
235
235
  }
236
236
  };
237
- if (xe) return /* @__PURE__ */ h("div", {
237
+ if (Ce) return /* @__PURE__ */ m("div", {
238
238
  className: "flex h-64 items-center justify-center",
239
- children: /* @__PURE__ */ h("div", { className: "h-8 w-8 animate-spin rounded-full border-4 border-primary border-t-transparent" })
239
+ children: /* @__PURE__ */ m("div", { className: "h-8 w-8 animate-spin rounded-full border-4 border-primary border-t-transparent" })
240
240
  });
241
- if (!be(S ? r.TEMPLATE_UPDATE : r.TEMPLATE_CREATE)) return /* @__PURE__ */ h("div", {
241
+ if (!Se(S ? r.TEMPLATE_UPDATE : r.TEMPLATE_CREATE)) return /* @__PURE__ */ m("div", {
242
242
  className: "p-8 text-center text-text-secondary",
243
- children: S ? b("notifTemplates.noPermissionEdit", "You don't have permission to edit notification templates.") : b("notifTemplates.noPermissionCreate", "You don't have permission to create notification templates.")
243
+ children: S ? y("notifTemplates.noPermissionEdit", "You don't have permission to edit notification templates.") : y("notifTemplates.noPermissionCreate", "You don't have permission to create notification templates.")
244
244
  });
245
- if (S && ke) return /* @__PURE__ */ g("div", {
245
+ if (S && Ae) return /* @__PURE__ */ h("div", {
246
246
  className: "flex flex-col items-center justify-center h-64 gap-3",
247
- children: [/* @__PURE__ */ h(p, {
247
+ children: [/* @__PURE__ */ m(f, {
248
248
  size: 28,
249
249
  className: "animate-spin text-accent-primary"
250
- }), /* @__PURE__ */ h("p", {
250
+ }), /* @__PURE__ */ m("p", {
251
251
  className: "text-sm text-secondary",
252
- children: b("notifTemplates.loadingTemplate", "Loading template...")
252
+ children: y("notifTemplates.loadingTemplate", "Loading template...")
253
253
  })]
254
254
  });
255
- if (S && Ae) return /* @__PURE__ */ g("div", {
255
+ if (S && T) return /* @__PURE__ */ h("div", {
256
256
  className: "flex flex-col items-center justify-center h-64 gap-4",
257
257
  children: [
258
- /* @__PURE__ */ h(u, {
258
+ /* @__PURE__ */ m(l, {
259
259
  size: 28,
260
260
  className: "text-error"
261
261
  }),
262
- /* @__PURE__ */ h("p", {
262
+ /* @__PURE__ */ m("p", {
263
263
  className: "text-sm text-error",
264
- children: Ae
264
+ children: T
265
265
  }),
266
- /* @__PURE__ */ h("button", {
267
- onClick: () => y("..", { relative: "path" }),
266
+ /* @__PURE__ */ m("button", {
267
+ onClick: () => v("..", { relative: "path" }),
268
268
  className: "px-4 py-2 text-sm text-secondary hover:text-primary border border-default rounded-lg transition-all",
269
- children: b("notifTemplates.backToTemplates", "Back to Templates")
269
+ children: y("notifTemplates.backToTemplates", "Back to Templates")
270
270
  })
271
271
  ]
272
272
  });
273
- let $ = Ee || De;
274
- return /* @__PURE__ */ g("div", {
273
+ let $ = Oe || ke;
274
+ return /* @__PURE__ */ h("div", {
275
275
  className: "animate-in fade-in duration-200 h-full flex flex-col",
276
276
  children: [
277
- /* @__PURE__ */ g("div", {
277
+ /* @__PURE__ */ h("div", {
278
278
  className: "flex items-center justify-between gap-3 p-3 sm:px-6 sm:py-4 border-b border-border-seam bg-surface/50 shrink-0",
279
- children: [/* @__PURE__ */ g("div", {
279
+ children: [/* @__PURE__ */ h("div", {
280
280
  className: "flex items-center gap-3",
281
- children: [/* @__PURE__ */ h("button", {
282
- onClick: () => y("..", { relative: "path" }),
281
+ children: [/* @__PURE__ */ m("button", {
282
+ onClick: () => v("..", { relative: "path" }),
283
283
  className: "p-2 hover:bg-bg-sunken rounded-lg transition-all duration-150",
284
- children: /* @__PURE__ */ h(ie, {
284
+ children: /* @__PURE__ */ m(ae, {
285
285
  size: 20,
286
286
  className: "text-primary"
287
287
  })
288
- }), /* @__PURE__ */ g("div", { children: [/* @__PURE__ */ h("h1", {
288
+ }), /* @__PURE__ */ h("div", { children: [/* @__PURE__ */ m("h1", {
289
289
  className: "text-lg font-bold text-primary",
290
- children: S ? b("notifTemplates.editTemplate", "Edit Template") : b("notifTemplates.createTemplate", "Create Template")
291
- }), S && C && /* @__PURE__ */ g("p", {
290
+ children: S ? y("notifTemplates.editTemplate", "Edit Template") : y("notifTemplates.createTemplate", "Create Template")
291
+ }), S && w && /* @__PURE__ */ h("p", {
292
292
  className: "text-xs text-tertiary",
293
293
  children: [
294
- /* @__PURE__ */ h("code", { children: C.slug }),
294
+ /* @__PURE__ */ m("code", { children: w.slug }),
295
295
  " · v",
296
- C.version
296
+ w.version
297
297
  ]
298
298
  })] })]
299
- }), /* @__PURE__ */ g(fe, {
300
- onClick: Ue,
299
+ }), /* @__PURE__ */ h(pe, {
300
+ onClick: Q,
301
301
  disabled: $,
302
302
  className: "gap-2",
303
- children: [$ ? /* @__PURE__ */ h(p, {
303
+ children: [$ ? /* @__PURE__ */ m(f, {
304
304
  size: 16,
305
305
  className: "animate-spin"
306
- }) : /* @__PURE__ */ h(m, { size: 16 }), S ? b("notifTemplates.saveChanges", "Save Changes") : b("notifTemplates.createTemplate", "Create Template")]
306
+ }) : /* @__PURE__ */ m(p, { size: 16 }), S ? y("notifTemplates.saveChanges", "Save Changes") : y("notifTemplates.createTemplate", "Create Template")]
307
307
  })]
308
308
  }),
309
- J && /* @__PURE__ */ g("div", {
309
+ Ie && /* @__PURE__ */ h("div", {
310
310
  className: "mx-3 sm:mx-6 mt-3 flex items-center gap-3 p-3 bg-error/10 border border-error/30 rounded-lg",
311
- children: [/* @__PURE__ */ h(u, {
311
+ children: [/* @__PURE__ */ m(l, {
312
312
  size: 16,
313
313
  className: "text-error shrink-0"
314
- }), /* @__PURE__ */ h("p", {
314
+ }), /* @__PURE__ */ m("p", {
315
315
  className: "text-sm text-error",
316
- children: J
316
+ children: Ie
317
317
  })]
318
318
  }),
319
- Ne && /* @__PURE__ */ g("div", {
319
+ Le && /* @__PURE__ */ h("div", {
320
320
  className: "mx-3 sm:mx-6 mt-3 flex items-center gap-3 p-3 bg-success/10 border border-success/30 rounded-lg",
321
- children: [/* @__PURE__ */ h(m, {
321
+ children: [/* @__PURE__ */ m(p, {
322
322
  size: 16,
323
323
  className: "text-success shrink-0"
324
- }), /* @__PURE__ */ h("p", {
324
+ }), /* @__PURE__ */ m("p", {
325
325
  className: "text-sm text-success",
326
- children: Ne
326
+ children: Le
327
+ })]
328
+ }),
329
+ /* @__PURE__ */ h("div", {
330
+ className: "px-3 sm:px-6 pt-3 space-y-3 shrink-0",
331
+ children: [/* @__PURE__ */ m(he, {
332
+ icon: /* @__PURE__ */ m(le, { size: 16 }),
333
+ children: y("notifTemplates.editorPurpose", S ? "Refine this template’s content and {{variables}} placeholders. Switch the live preview between email, SMS and push to see how the same template renders per channel, then save a new version — existing scheduled sends keep using the version they were created with." : "Build a reusable message blueprint: write the subject and body with {{variables}} that get filled in at send time, define each variable with a type and default, and watch the live preview render it per channel. Once saved, anyone can pick this template from the Send page.")
334
+ }), /* @__PURE__ */ m(me, {
335
+ storageKey: "notification-template-editor",
336
+ steps: [
337
+ {
338
+ id: "add-variable",
339
+ label: y("notifTemplates.nextAddVarLabel", "Add a variable"),
340
+ description: y("notifTemplates.nextAddVarDesc", "Define a {{placeholder}} (e.g. userName) so the same template personalises every send."),
341
+ onClick: Ue
342
+ },
343
+ {
344
+ id: "preview-channel",
345
+ label: y("notifTemplates.nextPreviewLabel", "Preview each channel"),
346
+ description: y("notifTemplates.nextPreviewDesc", "Flip the live preview to SMS or push to confirm the template reads well everywhere."),
347
+ onClick: () => {
348
+ X(!0), ze("sms");
349
+ }
350
+ },
351
+ {
352
+ id: "save",
353
+ label: S ? y("notifTemplates.nextSaveLabel", "Save your changes") : y("notifTemplates.nextCreateLabel", "Create the template"),
354
+ description: y("notifTemplates.nextSaveDesc", "Persist the template so it becomes selectable on the Send page."),
355
+ onClick: () => Q()
356
+ }
357
+ ]
327
358
  })]
328
359
  }),
329
- /* @__PURE__ */ g("div", {
360
+ /* @__PURE__ */ h("div", {
330
361
  className: "flex-1 overflow-hidden flex flex-col lg:flex-row",
331
- children: [/* @__PURE__ */ h("div", {
362
+ children: [/* @__PURE__ */ m("div", {
332
363
  className: "flex-1 overflow-y-auto p-3 sm:p-5 lg:border-r lg:border-border-seam",
333
- children: /* @__PURE__ */ g("form", {
334
- onSubmit: Ue,
364
+ children: /* @__PURE__ */ h("form", {
365
+ onSubmit: Q,
335
366
  className: "space-y-5",
336
367
  children: [
337
- /* @__PURE__ */ g("section", {
368
+ /* @__PURE__ */ h("section", {
338
369
  className: "p-4 bg-gloss-card border border-border-seam rounded-lg space-y-4",
339
370
  children: [
340
- /* @__PURE__ */ h("h2", {
371
+ /* @__PURE__ */ m("h2", {
341
372
  className: "text-sm font-semibold text-primary uppercase tracking-wider",
342
- children: b("notifTemplates.basicInformation", "Basic Information")
373
+ children: y("notifTemplates.basicInformation", "Basic Information")
343
374
  }),
344
- /* @__PURE__ */ g("div", {
375
+ /* @__PURE__ */ h("div", {
345
376
  className: "grid grid-cols-1 sm:grid-cols-2 gap-4",
346
- children: [/* @__PURE__ */ g("div", { children: [/* @__PURE__ */ g("label", {
377
+ children: [/* @__PURE__ */ h("div", { children: [/* @__PURE__ */ h("label", {
347
378
  className: "block text-sm font-medium text-primary mb-1.5",
348
379
  children: [
349
- b("notifTemplates.nameLabel", "Name"),
380
+ y("notifTemplates.nameLabel", "Name"),
350
381
  " ",
351
- /* @__PURE__ */ h("span", {
382
+ /* @__PURE__ */ m("span", {
352
383
  className: "text-error",
353
384
  children: "*"
354
385
  })
355
386
  ]
356
- }), /* @__PURE__ */ h("input", {
387
+ }), /* @__PURE__ */ m("input", {
357
388
  type: "text",
358
- value: w,
359
- onChange: (e) => T(e.target.value),
360
- placeholder: b("notifTemplates.namePlaceholder", "e.g., Welcome Email"),
389
+ value: E,
390
+ onChange: (e) => D(e.target.value),
391
+ placeholder: y("notifTemplates.namePlaceholder", "e.g., Welcome Email"),
361
392
  className: "w-full px-3 py-2 text-sm text-primary bg-gloss-card border border-border-seam rounded-lg focus:outline-none focus:ring-2 focus:ring-accent transition-shadow duration-150"
362
- })] }), /* @__PURE__ */ g("div", { children: [
363
- /* @__PURE__ */ g("label", {
393
+ })] }), /* @__PURE__ */ h("div", { children: [
394
+ /* @__PURE__ */ h("label", {
364
395
  className: "block text-sm font-medium text-primary mb-1.5",
365
396
  children: [
366
- b("notifTemplates.slugLabel", "Slug"),
397
+ y("notifTemplates.slugLabel", "Slug"),
367
398
  " ",
368
- /* @__PURE__ */ h("span", {
399
+ /* @__PURE__ */ m("span", {
369
400
  className: "text-error",
370
401
  children: "*"
371
402
  })
372
403
  ]
373
404
  }),
374
- /* @__PURE__ */ h("input", {
405
+ /* @__PURE__ */ m("input", {
375
406
  type: "text",
376
- value: E,
407
+ value: O,
377
408
  onChange: (e) => {
378
- D(e.target.value), k(!0);
409
+ k(e.target.value), Me(!0);
379
410
  },
380
- placeholder: b("notifTemplates.slugPlaceholder", "e.g., welcome-email"),
411
+ placeholder: y("notifTemplates.slugPlaceholder", "e.g., welcome-email"),
381
412
  disabled: S,
382
413
  className: "w-full px-3 py-2 text-sm text-primary bg-gloss-card border border-border-seam rounded-lg focus:outline-none focus:ring-2 focus:ring-accent transition-shadow duration-150 font-mono disabled:opacity-60 disabled:cursor-not-allowed"
383
414
  }),
384
- !S && /* @__PURE__ */ h("p", {
415
+ !S && /* @__PURE__ */ m("p", {
385
416
  className: "mt-1 text-[11px] text-tertiary",
386
- children: b("notifTemplates.autoGeneratedFromName", "Auto-generated from name.")
417
+ children: y("notifTemplates.autoGeneratedFromName", "Auto-generated from name.")
387
418
  })
388
419
  ] })]
389
420
  }),
390
- /* @__PURE__ */ g("div", { children: [/* @__PURE__ */ h("label", {
421
+ /* @__PURE__ */ h("div", { children: [/* @__PURE__ */ m("label", {
391
422
  className: "block text-sm font-medium text-primary mb-1.5",
392
- children: b("notifTemplates.descriptionLabel", "Description")
393
- }), /* @__PURE__ */ h("textarea", {
423
+ children: y("notifTemplates.descriptionLabel", "Description")
424
+ }), /* @__PURE__ */ m("textarea", {
394
425
  value: A,
395
426
  onChange: (e) => j(e.target.value),
396
427
  rows: 2,
397
- placeholder: b("notifTemplates.descriptionPlaceholder", "Brief description of this template"),
428
+ placeholder: y("notifTemplates.descriptionPlaceholder", "Brief description of this template"),
398
429
  className: "w-full px-3 py-2 text-sm text-primary bg-gloss-card border border-border-seam rounded-lg focus:outline-none focus:ring-2 focus:ring-accent transition-shadow duration-150 resize-none"
399
430
  })] }),
400
- /* @__PURE__ */ g("div", {
431
+ /* @__PURE__ */ h("div", {
401
432
  className: "grid grid-cols-1 sm:grid-cols-3 gap-4",
402
433
  children: [
403
- /* @__PURE__ */ g("div", { children: [/* @__PURE__ */ g("label", {
434
+ /* @__PURE__ */ h("div", { children: [/* @__PURE__ */ h("label", {
404
435
  className: "block text-sm font-medium text-primary mb-1.5",
405
436
  children: [
406
- b("notifTemplates.typeLabel", "Type"),
437
+ y("notifTemplates.typeLabel", "Type"),
407
438
  " ",
408
- /* @__PURE__ */ h("span", {
439
+ /* @__PURE__ */ m("span", {
409
440
  className: "text-error",
410
441
  children: "*"
411
442
  })
412
443
  ]
413
- }), /* @__PURE__ */ h("select", {
444
+ }), /* @__PURE__ */ m("select", {
414
445
  value: M,
415
- onChange: (e) => je(e.target.value),
446
+ onChange: (e) => N(e.target.value),
416
447
  disabled: S,
417
448
  className: "w-full px-3 py-2 text-sm text-primary bg-gloss-card border border-border-seam rounded-lg focus:outline-none focus:ring-2 focus:ring-accent transition-shadow duration-150 disabled:opacity-60",
418
- children: me.map((e) => /* @__PURE__ */ h("option", {
449
+ children: _e.map((e) => /* @__PURE__ */ m("option", {
419
450
  value: e.value,
420
- children: b(`notifTemplates.type.${e.value}`, e.label)
451
+ children: y(`notifTemplates.type.${e.value}`, e.label)
421
452
  }, e.value))
422
453
  })] }),
423
- /* @__PURE__ */ g("div", { children: [/* @__PURE__ */ h("label", {
454
+ /* @__PURE__ */ h("div", { children: [/* @__PURE__ */ m("label", {
424
455
  className: "block text-sm font-medium text-primary mb-1.5",
425
- children: b("notifTemplates.defaultChannel", "Default Channel")
426
- }), /* @__PURE__ */ g("select", {
427
- value: N,
428
- onChange: (e) => Me(e.target.value),
456
+ children: y("notifTemplates.defaultChannel", "Default Channel")
457
+ }), /* @__PURE__ */ h("select", {
458
+ value: P,
459
+ onChange: (e) => Ne(e.target.value),
429
460
  disabled: S,
430
461
  className: "w-full px-3 py-2 text-sm text-primary bg-gloss-card border border-border-seam rounded-lg focus:outline-none focus:ring-2 focus:ring-accent transition-shadow duration-150 disabled:opacity-60",
431
- children: [/* @__PURE__ */ h("option", {
462
+ children: [/* @__PURE__ */ m("option", {
432
463
  value: "",
433
- children: b("notifTemplates.none", "None")
434
- }), he.map((e) => /* @__PURE__ */ h("option", {
464
+ children: y("notifTemplates.none", "None")
465
+ }), ve.map((e) => /* @__PURE__ */ m("option", {
435
466
  value: e.value,
436
- children: b(`notifTemplates.channel.${e.value}`, e.label)
467
+ children: y(`notifTemplates.channel.${e.value}`, e.label)
437
468
  }, e.value))]
438
469
  })] }),
439
- /* @__PURE__ */ g("div", { children: [/* @__PURE__ */ h("label", {
470
+ /* @__PURE__ */ h("div", { children: [/* @__PURE__ */ m("label", {
440
471
  className: "block text-sm font-medium text-primary mb-1.5",
441
- children: b("notifTemplates.localeLabel", "Locale")
442
- }), /* @__PURE__ */ h("input", {
472
+ children: y("notifTemplates.localeLabel", "Locale")
473
+ }), /* @__PURE__ */ m("input", {
443
474
  type: "text",
444
- value: P,
445
- onChange: (e) => F(e.target.value),
475
+ value: F,
476
+ onChange: (e) => I(e.target.value),
446
477
  placeholder: "en",
447
478
  disabled: S,
448
479
  className: "w-full px-3 py-2 text-sm text-primary bg-gloss-card border border-border-seam rounded-lg focus:outline-none focus:ring-2 focus:ring-accent transition-shadow duration-150 font-mono disabled:opacity-60"
@@ -451,344 +482,344 @@ function y() {
451
482
  })
452
483
  ]
453
484
  }),
454
- /* @__PURE__ */ g("section", {
485
+ /* @__PURE__ */ h("section", {
455
486
  className: "p-4 bg-gloss-card border border-border-seam rounded-lg space-y-4",
456
487
  children: [
457
- /* @__PURE__ */ g("div", {
488
+ /* @__PURE__ */ h("div", {
458
489
  className: "flex items-center justify-between",
459
- children: [/* @__PURE__ */ h("h2", {
490
+ children: [/* @__PURE__ */ m("h2", {
460
491
  className: "text-sm font-semibold text-primary uppercase tracking-wider",
461
- children: b("notifTemplates.templateContent", "Template Content")
462
- }), /* @__PURE__ */ g("div", {
492
+ children: y("notifTemplates.templateContent", "Template Content")
493
+ }), /* @__PURE__ */ h("div", {
463
494
  className: "flex items-center bg-bg-sunken rounded-lg p-0.5",
464
- children: [/* @__PURE__ */ g("button", {
495
+ children: [/* @__PURE__ */ h("button", {
465
496
  type: "button",
466
- onClick: () => G("text"),
467
- className: `flex items-center gap-1.5 px-3 py-1.5 text-xs font-medium rounded-md transition-all duration-150 ${W === "text" ? "bg-surface text-primary shadow-sm" : "text-tertiary hover:text-primary"}`,
468
- children: [/* @__PURE__ */ h(ce, { size: 12 }), b("notifTemplates.contentMode.text", "Text")]
469
- }), /* @__PURE__ */ g("button", {
497
+ onClick: () => K("text"),
498
+ className: `flex items-center gap-1.5 px-3 py-1.5 text-xs font-medium rounded-md transition-all duration-150 ${G === "text" ? "bg-surface text-primary shadow-sm" : "text-tertiary hover:text-primary"}`,
499
+ children: [/* @__PURE__ */ m(le, { size: 12 }), y("notifTemplates.contentMode.text", "Text")]
500
+ }), /* @__PURE__ */ h("button", {
470
501
  type: "button",
471
- onClick: () => G("html"),
472
- className: `flex items-center gap-1.5 px-3 py-1.5 text-xs font-medium rounded-md transition-all duration-150 ${W === "html" ? "bg-surface text-primary shadow-sm" : "text-tertiary hover:text-primary"}`,
473
- children: [/* @__PURE__ */ h(ae, { size: 12 }), b("notifTemplates.contentMode.html", "HTML")]
502
+ onClick: () => K("html"),
503
+ className: `flex items-center gap-1.5 px-3 py-1.5 text-xs font-medium rounded-md transition-all duration-150 ${G === "html" ? "bg-surface text-primary shadow-sm" : "text-tertiary hover:text-primary"}`,
504
+ children: [/* @__PURE__ */ m(oe, { size: 12 }), y("notifTemplates.contentMode.html", "HTML")]
474
505
  })]
475
506
  })]
476
507
  }),
477
- /* @__PURE__ */ g("div", { children: [
478
- /* @__PURE__ */ h("label", {
508
+ /* @__PURE__ */ h("div", { children: [
509
+ /* @__PURE__ */ m("label", {
479
510
  className: "block text-sm font-medium text-primary mb-1.5",
480
- children: b("notifTemplates.subjectLabel", "Subject")
511
+ children: y("notifTemplates.subjectLabel", "Subject")
481
512
  }),
482
- /* @__PURE__ */ h("input", {
513
+ /* @__PURE__ */ m("input", {
483
514
  type: "text",
484
- value: I,
485
- onChange: (e) => L(e.target.value),
486
- placeholder: b("notifTemplates.subjectPlaceholder", "e.g., Welcome to {{appName}}, {{userName}}!"),
515
+ value: L,
516
+ onChange: (e) => R(e.target.value),
517
+ placeholder: y("notifTemplates.subjectPlaceholder", "e.g., Welcome to {{appName}}, {{userName}}!"),
487
518
  className: "w-full px-3 py-2 text-sm text-primary bg-gloss-card border border-border-seam rounded-lg focus:outline-none focus:ring-2 focus:ring-accent transition-shadow duration-150 font-mono"
488
519
  }),
489
- /* @__PURE__ */ h("p", {
520
+ /* @__PURE__ */ m("p", {
490
521
  className: "mt-1 text-[11px] text-tertiary",
491
- children: b("notifTemplates.subjectHint", "Used for email subject lines. Supports {{variables}}.")
522
+ children: y("notifTemplates.subjectHint", "Used for email subject lines. Supports {{variables}}.")
492
523
  })
493
524
  ] }),
494
- W === "text" && /* @__PURE__ */ g("div", { children: [/* @__PURE__ */ g("label", {
525
+ G === "text" && /* @__PURE__ */ h("div", { children: [/* @__PURE__ */ h("label", {
495
526
  className: "block text-sm font-medium text-primary mb-1.5",
496
527
  children: [
497
- b("notifTemplates.bodyTemplateLabel", "Body Template"),
528
+ y("notifTemplates.bodyTemplateLabel", "Body Template"),
498
529
  " ",
499
- /* @__PURE__ */ h("span", {
530
+ /* @__PURE__ */ m("span", {
500
531
  className: "text-error",
501
532
  children: "*"
502
533
  })
503
534
  ]
504
- }), /* @__PURE__ */ h("textarea", {
505
- ref: K,
506
- value: R,
507
- onChange: (e) => z(e.target.value),
535
+ }), /* @__PURE__ */ m("textarea", {
536
+ ref: Pe,
537
+ value: z,
538
+ onChange: (e) => B(e.target.value),
508
539
  rows: 8,
509
- placeholder: b("notifTemplates.bodyPlaceholder", "Hello {{userName}},\n\nWelcome to {{appName}}! Your account has been created.\n\nBest regards,\nThe Team"),
540
+ placeholder: y("notifTemplates.bodyPlaceholder", "Hello {{userName}},\n\nWelcome to {{appName}}! Your account has been created.\n\nBest regards,\nThe Team"),
510
541
  className: "w-full px-3 py-2 text-sm text-primary bg-gloss-card border border-border-seam rounded-lg focus:outline-none focus:ring-2 focus:ring-accent transition-shadow duration-150 font-mono resize-y"
511
542
  })] }),
512
- W === "html" && /* @__PURE__ */ g("div", { children: [
513
- /* @__PURE__ */ h("label", {
543
+ G === "html" && /* @__PURE__ */ h("div", { children: [
544
+ /* @__PURE__ */ m("label", {
514
545
  className: "block text-sm font-medium text-primary mb-1.5",
515
- children: b("notifTemplates.htmlTemplateLabel", "HTML Template")
546
+ children: y("notifTemplates.htmlTemplateLabel", "HTML Template")
516
547
  }),
517
- /* @__PURE__ */ h("textarea", {
518
- ref: q,
519
- value: B,
520
- onChange: (e) => V(e.target.value),
548
+ /* @__PURE__ */ m("textarea", {
549
+ ref: Fe,
550
+ value: V,
551
+ onChange: (e) => H(e.target.value),
521
552
  rows: 12,
522
- placeholder: b("notifTemplates.htmlPlaceholder", "<div style=\"font-family: sans-serif; max-width: 600px; margin: 0 auto;\">\n <h1>Welcome, {{userName}}!</h1>\n <p>Thank you for joining {{appName}}.</p>\n</div>"),
553
+ placeholder: y("notifTemplates.htmlPlaceholder", "<div style=\"font-family: sans-serif; max-width: 600px; margin: 0 auto;\">\n <h1>Welcome, {{userName}}!</h1>\n <p>Thank you for joining {{appName}}.</p>\n</div>"),
523
554
  className: "w-full px-3 py-2 text-sm text-primary bg-gloss-card border border-border-seam rounded-lg focus:outline-none focus:ring-2 focus:ring-accent transition-shadow duration-150 font-mono resize-y"
524
555
  }),
525
- /* @__PURE__ */ h("p", {
556
+ /* @__PURE__ */ m("p", {
526
557
  className: "mt-1 text-[11px] text-tertiary",
527
- children: b("notifTemplates.htmlHint", "HTML content for email. Falls back to text body if not provided.")
558
+ children: y("notifTemplates.htmlHint", "HTML content for email. Falls back to text body if not provided.")
528
559
  })
529
560
  ] }),
530
- H.length > 0 && /* @__PURE__ */ g("div", {
561
+ U.length > 0 && /* @__PURE__ */ h("div", {
531
562
  className: "flex items-center gap-2 flex-wrap",
532
- children: [/* @__PURE__ */ g("span", {
563
+ children: [/* @__PURE__ */ h("span", {
533
564
  className: "text-[11px] text-tertiary font-medium",
534
- children: [b("notifTemplates.insert", "Insert"), ":"]
535
- }), H.filter((e) => e.name.trim()).map((e, t) => /* @__PURE__ */ h("button", {
565
+ children: [y("notifTemplates.insert", "Insert"), ":"]
566
+ }), U.filter((e) => e.name.trim()).map((e, t) => /* @__PURE__ */ m("button", {
536
567
  type: "button",
537
- onClick: () => He(e.name),
568
+ onClick: () => Ge(e.name),
538
569
  className: "px-2 py-1 text-[11px] font-mono text-primary bg-bg-sunken border border-default rounded hover:bg-bg-sunken/80 transition-colors",
539
570
  children: `{{${e.name}}}`
540
571
  }, t))]
541
572
  })
542
573
  ]
543
574
  }),
544
- /* @__PURE__ */ g("section", {
575
+ /* @__PURE__ */ h("section", {
545
576
  className: "p-4 bg-gloss-card border border-border-seam rounded-lg space-y-4",
546
577
  children: [
547
- /* @__PURE__ */ g("div", {
578
+ /* @__PURE__ */ h("div", {
548
579
  className: "flex items-center justify-between",
549
- children: [/* @__PURE__ */ g("div", {
580
+ children: [/* @__PURE__ */ h("div", {
550
581
  className: "flex items-center gap-2",
551
582
  children: [
552
- /* @__PURE__ */ h(le, {
583
+ /* @__PURE__ */ m(ue, {
553
584
  size: 16,
554
585
  className: "text-accent-primary"
555
586
  }),
556
- /* @__PURE__ */ h("h2", {
587
+ /* @__PURE__ */ m("h2", {
557
588
  className: "text-sm font-semibold text-primary uppercase tracking-wider",
558
- children: b("notifTemplates.variables", "Variables")
589
+ children: y("notifTemplates.variables", "Variables")
559
590
  }),
560
- /* @__PURE__ */ g("span", {
591
+ /* @__PURE__ */ h("span", {
561
592
  className: "text-[11px] text-tertiary",
562
593
  children: [
563
594
  "(",
564
- H.length,
595
+ U.length,
565
596
  ")"
566
597
  ]
567
598
  })
568
599
  ]
569
- }), /* @__PURE__ */ g("button", {
600
+ }), /* @__PURE__ */ h("button", {
570
601
  type: "button",
571
- onClick: Be,
602
+ onClick: Ue,
572
603
  className: "flex items-center gap-1.5 px-3 py-1.5 text-xs font-medium text-accent-primary bg-accent-primary/10 border border-accent-primary/20 rounded-lg hover:bg-accent-primary/20 transition-colors",
573
- children: [/* @__PURE__ */ h(oe, { size: 12 }), b("notifTemplates.addVariable", "Add Variable")]
604
+ children: [/* @__PURE__ */ m(se, { size: 12 }), y("notifTemplates.addVariable", "Add Variable")]
574
605
  })]
575
606
  }),
576
- H.length === 0 && /* @__PURE__ */ g("p", {
607
+ U.length === 0 && /* @__PURE__ */ h("p", {
577
608
  className: "text-sm text-tertiary text-center py-4",
578
609
  children: [
579
- b("notifTemplates.noVariables", "No variables defined. Add variables to use dynamic content like"),
610
+ y("notifTemplates.noVariables", "No variables defined. Add variables to use dynamic content like"),
580
611
  " ",
581
- /* @__PURE__ */ h("code", {
612
+ /* @__PURE__ */ m("code", {
582
613
  className: "px-1.5 py-0.5 bg-bg-sunken rounded text-[11px] font-mono",
583
614
  children: "{{userName}}"
584
615
  })
585
616
  ]
586
617
  }),
587
- H.map((e, t) => /* @__PURE__ */ g("div", {
618
+ U.map((e, t) => /* @__PURE__ */ h("div", {
588
619
  className: "flex items-start gap-3 p-3 bg-bg-sunken/50 rounded-lg border border-default/50",
589
620
  children: [
590
- /* @__PURE__ */ g("div", {
621
+ /* @__PURE__ */ h("div", {
591
622
  className: "flex-1",
592
- children: [/* @__PURE__ */ h("label", {
623
+ children: [/* @__PURE__ */ m("label", {
593
624
  className: "block text-[11px] font-medium text-tertiary mb-1",
594
- children: b("notifTemplates.variableName", "Name")
595
- }), /* @__PURE__ */ h("input", {
625
+ children: y("notifTemplates.variableName", "Name")
626
+ }), /* @__PURE__ */ m("input", {
596
627
  type: "text",
597
628
  value: e.name,
598
- onChange: (e) => Q(t, "name", e.target.value.replace(/[^a-zA-Z0-9_]/g, "")),
599
- placeholder: b("notifTemplates.variableNamePlaceholder", "e.g., userName"),
629
+ onChange: (e) => Z(t, "name", e.target.value.replace(/[^a-zA-Z0-9_]/g, "")),
630
+ placeholder: y("notifTemplates.variableNamePlaceholder", "e.g., userName"),
600
631
  className: "w-full px-2.5 py-1.5 text-xs text-primary bg-surface border border-default rounded-md focus:outline-none focus:ring-2 focus:ring-accent font-mono"
601
632
  })]
602
633
  }),
603
- /* @__PURE__ */ g("div", {
634
+ /* @__PURE__ */ h("div", {
604
635
  className: "w-28",
605
- children: [/* @__PURE__ */ h("label", {
636
+ children: [/* @__PURE__ */ m("label", {
606
637
  className: "block text-[11px] font-medium text-tertiary mb-1",
607
- children: b("notifTemplates.variableType", "Type")
608
- }), /* @__PURE__ */ h("select", {
638
+ children: y("notifTemplates.variableType", "Type")
639
+ }), /* @__PURE__ */ m("select", {
609
640
  value: e.type,
610
- onChange: (e) => Q(t, "type", e.target.value),
641
+ onChange: (e) => Z(t, "type", e.target.value),
611
642
  className: "w-full px-2.5 py-1.5 text-xs text-primary bg-surface border border-default rounded-md focus:outline-none focus:ring-2 focus:ring-accent",
612
- children: ge.map((e) => /* @__PURE__ */ h("option", {
643
+ children: ye.map((e) => /* @__PURE__ */ m("option", {
613
644
  value: e.value,
614
- children: b(`notifTemplates.variableType.${e.value}`, e.label)
645
+ children: y(`notifTemplates.variableType.${e.value}`, e.label)
615
646
  }, e.value))
616
647
  })]
617
648
  }),
618
- /* @__PURE__ */ g("div", {
649
+ /* @__PURE__ */ h("div", {
619
650
  className: "flex-1",
620
- children: [/* @__PURE__ */ h("label", {
651
+ children: [/* @__PURE__ */ m("label", {
621
652
  className: "block text-[11px] font-medium text-tertiary mb-1",
622
- children: b("notifTemplates.sampleValue", "Sample Value")
623
- }), /* @__PURE__ */ h("input", {
653
+ children: y("notifTemplates.sampleValue", "Sample Value")
654
+ }), /* @__PURE__ */ m("input", {
624
655
  type: "text",
625
656
  value: e.defaultValue,
626
- onChange: (e) => Q(t, "defaultValue", e.target.value),
627
- placeholder: b("notifTemplates.previewValue", "Preview value"),
657
+ onChange: (e) => Z(t, "defaultValue", e.target.value),
658
+ placeholder: y("notifTemplates.previewValue", "Preview value"),
628
659
  className: "w-full px-2.5 py-1.5 text-xs text-primary bg-surface border border-default rounded-md focus:outline-none focus:ring-2 focus:ring-accent"
629
660
  })]
630
661
  }),
631
- /* @__PURE__ */ h("button", {
662
+ /* @__PURE__ */ m("button", {
632
663
  type: "button",
633
- onClick: () => Ve(t),
664
+ onClick: () => We(t),
634
665
  className: "mt-5 p-1.5 text-tertiary hover:text-error rounded transition-colors",
635
- children: /* @__PURE__ */ h(se, { size: 14 })
666
+ children: /* @__PURE__ */ m(ce, { size: 14 })
636
667
  })
637
668
  ]
638
669
  }, t))
639
670
  ]
640
671
  }),
641
- /* @__PURE__ */ g("div", {
672
+ /* @__PURE__ */ h("div", {
642
673
  className: "flex justify-end gap-3 lg:hidden pb-4",
643
- children: [/* @__PURE__ */ h("button", {
674
+ children: [/* @__PURE__ */ m("button", {
644
675
  type: "button",
645
- onClick: () => y("..", { relative: "path" }),
676
+ onClick: () => v("..", { relative: "path" }),
646
677
  className: "px-4 py-2 text-sm font-medium text-tertiary hover:text-primary border border-default rounded-lg transition-all duration-150",
647
- children: b("notifTemplates.cancel", "Cancel")
648
- }), /* @__PURE__ */ g("button", {
678
+ children: y("notifTemplates.cancel", "Cancel")
679
+ }), /* @__PURE__ */ h("button", {
649
680
  type: "submit",
650
681
  disabled: $,
651
682
  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 disabled:opacity-50",
652
- children: [$ ? /* @__PURE__ */ h(p, {
683
+ children: [$ ? /* @__PURE__ */ m(f, {
653
684
  size: 16,
654
685
  className: "animate-spin"
655
- }) : /* @__PURE__ */ h(m, { size: 16 }), S ? b("notifTemplates.saveChanges", "Save Changes") : b("notifTemplates.createTemplate", "Create Template")]
686
+ }) : /* @__PURE__ */ m(p, { size: 16 }), S ? y("notifTemplates.saveChanges", "Save Changes") : y("notifTemplates.createTemplate", "Create Template")]
656
687
  })]
657
688
  })
658
689
  ]
659
690
  })
660
- }), /* @__PURE__ */ g("div", {
691
+ }), /* @__PURE__ */ h("div", {
661
692
  className: "hidden lg:flex lg:flex-col lg:w-[440px] xl:w-[500px] bg-bg-sunken/30",
662
- children: [/* @__PURE__ */ g("div", {
693
+ children: [/* @__PURE__ */ h("div", {
663
694
  className: "flex items-center gap-2 px-4 py-3 border-b border-border-seam bg-accent-wash shrink-0",
664
695
  children: [
665
- /* @__PURE__ */ h(d, {
696
+ /* @__PURE__ */ m(u, {
666
697
  size: 16,
667
698
  className: "text-primary"
668
699
  }),
669
- /* @__PURE__ */ h("span", {
700
+ /* @__PURE__ */ m("span", {
670
701
  className: "text-sm font-semibold text-primary",
671
- children: b("notifTemplates.livePreview", "Live Preview")
702
+ children: y("notifTemplates.livePreview", "Live Preview")
672
703
  }),
673
- /* @__PURE__ */ g("button", {
704
+ /* @__PURE__ */ h("button", {
674
705
  type: "button",
675
- onClick: () => Pe((e) => !e),
676
- className: `ml-auto flex items-center gap-1.5 px-2.5 py-1 text-[11px] font-medium rounded-md transition-all duration-150 ${Z ? "bg-accent-primary/10 text-accent-primary" : "bg-bg-sunken text-tertiary hover:text-primary"}`,
677
- children: [h(Z ? d : f, { size: 12 }), Z ? b("notifTemplates.previewOn", "On") : b("notifTemplates.previewOffShort", "Off")]
706
+ onClick: () => X((e) => !e),
707
+ className: `ml-auto flex items-center gap-1.5 px-2.5 py-1 text-[11px] font-medium rounded-md transition-all duration-150 ${Y ? "bg-accent-primary/10 text-accent-primary" : "bg-bg-sunken text-tertiary hover:text-primary"}`,
708
+ children: [m(Y ? u : d, { size: 12 }), Y ? y("notifTemplates.previewOn", "On") : y("notifTemplates.previewOffShort", "Off")]
678
709
  })
679
710
  ]
680
- }), Z ? /* @__PURE__ */ g("div", {
711
+ }), Y ? /* @__PURE__ */ h("div", {
681
712
  className: "flex-1 flex flex-col overflow-hidden",
682
- children: [/* @__PURE__ */ h(te, {
683
- channel: Fe,
684
- subject: Le,
685
- body: Re,
686
- html: W === "html" && B ? ze : "",
687
- appName: H.find((e) => e.name === "appName")?.defaultValue || "Burdenoff",
688
- onChannelChange: Ie
689
- }), /* @__PURE__ */ g("div", {
713
+ children: [/* @__PURE__ */ m(te, {
714
+ channel: Re,
715
+ subject: Be,
716
+ body: Ve,
717
+ html: G === "html" && V ? He : "",
718
+ appName: U.find((e) => e.name === "appName")?.defaultValue || "Burdenoff",
719
+ onChannelChange: ze
720
+ }), /* @__PURE__ */ h("div", {
690
721
  className: "shrink-0 border-t border-default overflow-y-auto max-h-[240px]",
691
- children: [H.length > 0 && /* @__PURE__ */ g("div", {
722
+ children: [U.length > 0 && /* @__PURE__ */ h("div", {
692
723
  className: "p-3 border-b border-default/50",
693
- children: [/* @__PURE__ */ g("p", {
724
+ children: [/* @__PURE__ */ h("p", {
694
725
  className: "text-[10px] font-medium text-tertiary uppercase tracking-wider mb-2",
695
726
  children: [
696
- b("notifTemplates.variables", "Variables"),
727
+ y("notifTemplates.variables", "Variables"),
697
728
  " (",
698
- H.length,
729
+ U.length,
699
730
  ")"
700
731
  ]
701
- }), /* @__PURE__ */ h("div", {
732
+ }), /* @__PURE__ */ m("div", {
702
733
  className: "space-y-1.5",
703
- children: H.map((e, t) => /* @__PURE__ */ g("div", {
734
+ children: U.map((e, t) => /* @__PURE__ */ h("div", {
704
735
  className: "flex items-center justify-between text-xs",
705
- children: [/* @__PURE__ */ h("code", {
736
+ children: [/* @__PURE__ */ m("code", {
706
737
  className: "text-primary font-mono",
707
738
  children: `{{${e.name || "..."}}}`
708
- }), /* @__PURE__ */ g("span", {
739
+ }), /* @__PURE__ */ h("span", {
709
740
  className: "text-tertiary",
710
741
  children: [
711
742
  e.type,
712
743
  " =",
713
744
  " ",
714
- e.defaultValue || /* @__PURE__ */ h("em", { children: b("notifTemplates.noDefault", "no default") })
745
+ e.defaultValue || /* @__PURE__ */ m("em", { children: y("notifTemplates.noDefault", "no default") })
715
746
  ]
716
747
  })]
717
748
  }, t))
718
749
  })]
719
- }), S && C && /* @__PURE__ */ g("div", {
750
+ }), S && w && /* @__PURE__ */ h("div", {
720
751
  className: "p-3",
721
- children: [/* @__PURE__ */ h("p", {
752
+ children: [/* @__PURE__ */ m("p", {
722
753
  className: "text-[10px] font-medium text-tertiary uppercase tracking-wider mb-1",
723
- children: b("notifTemplates.metadata", "Metadata")
724
- }), /* @__PURE__ */ g("div", {
754
+ children: y("notifTemplates.metadata", "Metadata")
755
+ }), /* @__PURE__ */ h("div", {
725
756
  className: "text-[11px] text-tertiary space-y-1",
726
757
  children: [
727
- /* @__PURE__ */ g("p", { children: [
728
- /* @__PURE__ */ g("span", {
758
+ /* @__PURE__ */ h("p", { children: [
759
+ /* @__PURE__ */ h("span", {
729
760
  className: "font-medium",
730
- children: [b("notifTemplates.metaId", "ID"), ":"]
761
+ children: [y("notifTemplates.metaId", "ID"), ":"]
731
762
  }),
732
763
  " ",
733
- /* @__PURE__ */ h("code", {
764
+ /* @__PURE__ */ m("code", {
734
765
  className: "text-[10px]",
735
- children: C.id
766
+ children: w.id
736
767
  })
737
768
  ] }),
738
- /* @__PURE__ */ g("p", { children: [
739
- /* @__PURE__ */ g("span", {
769
+ /* @__PURE__ */ h("p", { children: [
770
+ /* @__PURE__ */ h("span", {
740
771
  className: "font-medium",
741
- children: [b("notifTemplates.metaVersion", "Version"), ":"]
772
+ children: [y("notifTemplates.metaVersion", "Version"), ":"]
742
773
  }),
743
774
  " ",
744
- C.version
775
+ w.version
745
776
  ] }),
746
- /* @__PURE__ */ g("p", { children: [
747
- /* @__PURE__ */ g("span", {
777
+ /* @__PURE__ */ h("p", { children: [
778
+ /* @__PURE__ */ h("span", {
748
779
  className: "font-medium",
749
- children: [b("notifTemplates.metaCreated", "Created"), ":"]
780
+ children: [y("notifTemplates.metaCreated", "Created"), ":"]
750
781
  }),
751
782
  " ",
752
- new Date(C.createdAt).toLocaleString(x || "en-US")
783
+ new Date(w.createdAt).toLocaleString(b || "en-US")
753
784
  ] }),
754
- /* @__PURE__ */ g("p", { children: [
755
- /* @__PURE__ */ g("span", {
785
+ /* @__PURE__ */ h("p", { children: [
786
+ /* @__PURE__ */ h("span", {
756
787
  className: "font-medium",
757
- children: [b("notifTemplates.metaUpdated", "Updated"), ":"]
788
+ children: [y("notifTemplates.metaUpdated", "Updated"), ":"]
758
789
  }),
759
790
  " ",
760
- new Date(C.updatedAt).toLocaleString(x || "en-US")
791
+ new Date(w.updatedAt).toLocaleString(b || "en-US")
761
792
  ] }),
762
- /* @__PURE__ */ g("p", { children: [
763
- /* @__PURE__ */ g("span", {
793
+ /* @__PURE__ */ h("p", { children: [
794
+ /* @__PURE__ */ h("span", {
764
795
  className: "font-medium",
765
- children: [b("notifTemplates.metaEnabled", "Enabled"), ":"]
796
+ children: [y("notifTemplates.metaEnabled", "Enabled"), ":"]
766
797
  }),
767
798
  " ",
768
- C.enabled ? b("notifTemplates.yes", "Yes") : b("notifTemplates.no", "No")
799
+ w.enabled ? y("notifTemplates.yes", "Yes") : y("notifTemplates.no", "No")
769
800
  ] })
770
801
  ]
771
802
  })]
772
803
  })]
773
804
  })]
774
- }) : /* @__PURE__ */ h("div", {
805
+ }) : /* @__PURE__ */ m("div", {
775
806
  className: "flex-1 flex items-center justify-center",
776
- children: /* @__PURE__ */ g("div", {
807
+ children: /* @__PURE__ */ h("div", {
777
808
  className: "text-center",
778
809
  children: [
779
- /* @__PURE__ */ h(f, {
810
+ /* @__PURE__ */ m(d, {
780
811
  size: 32,
781
812
  className: "mx-auto text-tertiary mb-3"
782
813
  }),
783
- /* @__PURE__ */ h("p", {
814
+ /* @__PURE__ */ m("p", {
784
815
  className: "text-sm text-tertiary",
785
- children: b("notifTemplates.previewOff", "Preview is off")
816
+ children: y("notifTemplates.previewOff", "Preview is off")
786
817
  }),
787
- /* @__PURE__ */ h("button", {
818
+ /* @__PURE__ */ m("button", {
788
819
  type: "button",
789
- onClick: () => Pe(!0),
820
+ onClick: () => X(!0),
790
821
  className: "mt-2 text-xs text-accent-primary hover:underline",
791
- children: b("notifTemplates.turnOn", "Turn on")
822
+ children: y("notifTemplates.turnOn", "Turn on")
792
823
  })
793
824
  ]
794
825
  })
@@ -799,6 +830,6 @@ function y() {
799
830
  });
800
831
  }
801
832
  //#endregion
802
- export { y as TemplateEditorPage };
833
+ export { v as TemplateEditorPage };
803
834
 
804
835
  //# sourceMappingURL=TemplateEditorPage.js.map