@burdenoff/microfe-notification 2026.1029.2 → 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 (261) hide show
  1. package/dist/AdminNotificationRoot.d.ts +33 -0
  2. package/dist/AdminNotificationRoot.js +9 -6
  3. package/dist/AdminNotificationRoot.js.map +1 -1
  4. package/dist/AdminNotificationRoutes.d.ts +1 -0
  5. package/dist/AdminNotificationRoutes.js +22 -23
  6. package/dist/AdminNotificationRoutes.js.map +1 -1
  7. package/dist/NotificationRoot.d.ts +29 -0
  8. package/dist/NotificationRoot.js +9 -6
  9. package/dist/NotificationRoot.js.map +1 -1
  10. package/dist/NotificationRoutes.d.ts +18 -0
  11. package/dist/NotificationRoutes.js +109 -38
  12. package/dist/NotificationRoutes.js.map +1 -1
  13. package/dist/UserNotificationRoot.d.ts +32 -0
  14. package/dist/UserNotificationRoot.js +9 -6
  15. package/dist/UserNotificationRoot.js.map +1 -1
  16. package/dist/UserNotificationRoutes.d.ts +16 -0
  17. package/dist/UserNotificationRoutes.js +9 -10
  18. package/dist/UserNotificationRoutes.js.map +1 -1
  19. package/dist/components/ConfirmDeleteDialog.d.ts +17 -0
  20. package/dist/components/ConfirmDeleteDialog.js +22 -0
  21. package/dist/components/ConfirmDeleteDialog.js.map +1 -0
  22. package/dist/components/FeatureDisabledPage.d.ts +6 -0
  23. package/dist/components/FeatureDisabledPage.js +1 -2
  24. package/dist/components/FeatureDisabledPage.js.map +1 -1
  25. package/dist/components/NotificationBell.d.ts +13 -0
  26. package/dist/components/NotificationBell.js +6 -7
  27. package/dist/components/NotificationBell.js.map +1 -1
  28. package/dist/components/NotificationCard.d.ts +27 -0
  29. package/dist/components/NotificationCard.js +106 -76
  30. package/dist/components/NotificationCard.js.map +1 -1
  31. package/dist/components/NotificationPanel.d.ts +10 -0
  32. package/dist/components/NotificationPanel.js +5 -6
  33. package/dist/components/NotificationPanel.js.map +1 -1
  34. package/dist/components/RecipientSelector.d.ts +32 -0
  35. package/dist/components/RecipientSelector.js +2 -3
  36. package/dist/components/RecipientSelector.js.map +1 -1
  37. package/dist/components/TemplatePreview.d.ts +21 -0
  38. package/dist/components/TemplatePreview.js +3 -4
  39. package/dist/components/TemplatePreview.js.map +1 -1
  40. package/dist/components/VariableInserter.d.ts +11 -0
  41. package/dist/components/index.d.ts +3 -0
  42. package/dist/components/index.js +4 -3
  43. package/dist/constants/permissions.d.ts +23 -0
  44. package/dist/constants/permissions.js +1 -2
  45. package/dist/constants/permissions.js.map +1 -1
  46. package/dist/dev/main.d.ts +0 -0
  47. package/dist/generated/global-operations.d.ts +2119 -0
  48. package/dist/generated/global-operations.js +80 -69
  49. package/dist/generated/global-operations.js.map +1 -1
  50. package/dist/generated/global-types.d.ts +23507 -0
  51. package/dist/generated/wspace-operations.d.ts +4 -0
  52. package/dist/generated/wspace-types.d.ts +57831 -0
  53. package/dist/graphql/global-client.d.ts +32 -0
  54. package/dist/graphql/global-client.js +23 -30
  55. package/dist/graphql/global-client.js.map +1 -1
  56. package/dist/hooks/index.d.ts +7 -0
  57. package/dist/hooks/index.js +7 -6
  58. package/dist/hooks/useNotificationAdmin.d.ts +46 -0
  59. package/dist/hooks/useNotificationAdmin.js +18 -17
  60. package/dist/hooks/useNotificationAdmin.js.map +1 -1
  61. package/dist/hooks/useNotificationAnalytics.d.ts +65 -0
  62. package/dist/hooks/useNotificationAnalytics.js +1 -2
  63. package/dist/hooks/useNotificationAnalytics.js.map +1 -1
  64. package/dist/hooks/useNotificationPreferences.d.ts +10 -0
  65. package/dist/hooks/useNotificationPreferences.js +7 -7
  66. package/dist/hooks/useNotificationPreferences.js.map +1 -1
  67. package/dist/hooks/useNotificationTemplates.d.ts +131 -0
  68. package/dist/hooks/useNotificationTemplates.js +1 -2
  69. package/dist/hooks/useNotificationTemplates.js.map +1 -1
  70. package/dist/hooks/useNotificationTopics.d.ts +35 -0
  71. package/dist/hooks/useNotificationTopics.js +22 -22
  72. package/dist/hooks/useNotificationTopics.js.map +1 -1
  73. package/dist/hooks/useNotifications.d.ts +39 -0
  74. package/dist/hooks/useNotifications.js +6 -4
  75. package/dist/hooks/useNotifications.js.map +1 -1
  76. package/dist/hooks/usePreferenceToggles.d.ts +27 -0
  77. package/dist/hooks/usePreferenceToggles.js +84 -0
  78. package/dist/hooks/usePreferenceToggles.js.map +1 -0
  79. package/dist/hooks/useSendNotification.d.ts +158 -0
  80. package/dist/hooks/useSendNotification.js +12 -10
  81. package/dist/hooks/useSendNotification.js.map +1 -1
  82. package/dist/hooks/useUserSearch.d.ts +26 -0
  83. package/dist/hooks/useUserSearch.js +8 -10
  84. package/dist/hooks/useUserSearch.js.map +1 -1
  85. package/dist/index.d.ts +36 -0
  86. package/dist/index.js +8 -8
  87. package/dist/navigation-v2/AdminPageV2.d.ts +14 -0
  88. package/dist/navigation-v2/AdminPageV2.js +51 -0
  89. package/dist/navigation-v2/AdminPageV2.js.map +1 -0
  90. package/dist/navigation-v2/AdminToolsMenu.d.ts +6 -0
  91. package/dist/navigation-v2/AdminToolsMenu.js +32 -0
  92. package/dist/navigation-v2/AdminToolsMenu.js.map +1 -0
  93. package/dist/navigation-v2/BackToNotifications.d.ts +2 -0
  94. package/dist/navigation-v2/BackToNotifications.js +20 -0
  95. package/dist/navigation-v2/BackToNotifications.js.map +1 -0
  96. package/dist/navigation-v2/FilterControls.d.ts +25 -0
  97. package/dist/navigation-v2/FilterControls.js +64 -0
  98. package/dist/navigation-v2/FilterControls.js.map +1 -0
  99. package/dist/navigation-v2/NotificationArchivedV2.d.ts +9 -0
  100. package/dist/navigation-v2/NotificationArchivedV2.js +174 -0
  101. package/dist/navigation-v2/NotificationArchivedV2.js.map +1 -0
  102. package/dist/navigation-v2/NotificationInboxV2.d.ts +9 -0
  103. package/dist/navigation-v2/NotificationInboxV2.js +309 -0
  104. package/dist/navigation-v2/NotificationInboxV2.js.map +1 -0
  105. package/dist/navigation-v2/NotificationSettingsV2.d.ts +9 -0
  106. package/dist/navigation-v2/NotificationSettingsV2.js +203 -0
  107. package/dist/navigation-v2/NotificationSettingsV2.js.map +1 -0
  108. package/dist/navigation-v2/NotificationsV2Landing.d.ts +9 -0
  109. package/dist/navigation-v2/NotificationsV2Landing.js +37 -0
  110. package/dist/navigation-v2/NotificationsV2Landing.js.map +1 -0
  111. package/dist/navigation-v2/__tests__/uiMocks.d.ts +71 -0
  112. package/dist/navigation-v2/inboxFilters.d.ts +8 -0
  113. package/dist/navigation-v2/inboxFilters.js +10 -0
  114. package/dist/navigation-v2/inboxFilters.js.map +1 -0
  115. package/dist/navigation-v2/paths.d.ts +24 -0
  116. package/dist/navigation-v2/paths.js +31 -0
  117. package/dist/navigation-v2/paths.js.map +1 -0
  118. package/dist/navigation-v2/settingsOptions.d.ts +12 -0
  119. package/dist/navigation-v2/settingsOptions.js +58 -0
  120. package/dist/navigation-v2/settingsOptions.js.map +1 -0
  121. package/dist/navigation-v2/useAdminTools.d.ts +22 -0
  122. package/dist/navigation-v2/useAdminTools.js +76 -0
  123. package/dist/navigation-v2/useAdminTools.js.map +1 -0
  124. package/dist/node_modules/@apollo/client/errors/CombinedGraphQLErrors.js +1 -2
  125. package/dist/node_modules/@apollo/client/errors/CombinedGraphQLErrors.js.map +1 -1
  126. package/dist/node_modules/@apollo/client/errors/utils.js +1 -2
  127. package/dist/node_modules/@apollo/client/errors/utils.js.map +1 -1
  128. package/dist/node_modules/@apollo/client/link/core/ApolloLink.js +7 -8
  129. package/dist/node_modules/@apollo/client/link/core/ApolloLink.js.map +1 -1
  130. package/dist/node_modules/@apollo/client/link/subscriptions/index.js +9 -10
  131. package/dist/node_modules/@apollo/client/link/subscriptions/index.js.map +1 -1
  132. package/dist/node_modules/@apollo/client/link/utils/createOperation.js +5 -6
  133. package/dist/node_modules/@apollo/client/link/utils/createOperation.js.map +1 -1
  134. package/dist/node_modules/@apollo/client/utilities/caching/sizes.js +0 -1
  135. package/dist/node_modules/@apollo/client/utilities/caching/sizes.js.map +1 -1
  136. package/dist/node_modules/@apollo/client/utilities/graphql/print.js +4 -5
  137. package/dist/node_modules/@apollo/client/utilities/graphql/print.js.map +1 -1
  138. package/dist/node_modules/@apollo/client/utilities/internal/caches.js +1 -2
  139. package/dist/node_modules/@apollo/client/utilities/internal/caches.js.map +1 -1
  140. package/dist/node_modules/@apollo/client/utilities/internal/checkDocument.js +1 -2
  141. package/dist/node_modules/@apollo/client/utilities/internal/checkDocument.js.map +1 -1
  142. package/dist/node_modules/@apollo/client/utilities/internal/getMainDefinition.js +2 -3
  143. package/dist/node_modules/@apollo/client/utilities/internal/getMainDefinition.js.map +1 -1
  144. package/dist/node_modules/@apollo/client/utilities/internal/getMemoryInternals.js +1 -2
  145. package/dist/node_modules/@apollo/client/utilities/internal/getMemoryInternals.js.map +1 -1
  146. package/dist/node_modules/@apollo/client/utilities/internal/getOperationDefinition.js +1 -2
  147. package/dist/node_modules/@apollo/client/utilities/internal/getOperationDefinition.js.map +1 -1
  148. package/dist/node_modules/@apollo/client/utilities/internal/getOperationName.js +1 -2
  149. package/dist/node_modules/@apollo/client/utilities/internal/getOperationName.js.map +1 -1
  150. package/dist/node_modules/@apollo/client/utilities/internal/globals/global.js +1 -2
  151. package/dist/node_modules/@apollo/client/utilities/internal/globals/global.js.map +1 -1
  152. package/dist/node_modules/@apollo/client/utilities/internal/globals/maybe.js +1 -2
  153. package/dist/node_modules/@apollo/client/utilities/internal/globals/maybe.js.map +1 -1
  154. package/dist/node_modules/@apollo/client/utilities/internal/isNonNullObject.js +1 -2
  155. package/dist/node_modules/@apollo/client/utilities/internal/isNonNullObject.js.map +1 -1
  156. package/dist/node_modules/@apollo/client/utilities/internal/makeUniqueId.js +1 -2
  157. package/dist/node_modules/@apollo/client/utilities/internal/makeUniqueId.js.map +1 -1
  158. package/dist/node_modules/@apollo/client/utilities/internal/memoize.js +1 -2
  159. package/dist/node_modules/@apollo/client/utilities/internal/memoize.js.map +1 -1
  160. package/dist/node_modules/@apollo/client/utilities/internal/stringifyForDisplay.js +1 -2
  161. package/dist/node_modules/@apollo/client/utilities/internal/stringifyForDisplay.js.map +1 -1
  162. package/dist/node_modules/@apollo/client/utilities/invariant/index.js +2 -3
  163. package/dist/node_modules/@apollo/client/utilities/invariant/index.js.map +1 -1
  164. package/dist/node_modules/@apollo/client/version.js +2 -3
  165. package/dist/node_modules/@apollo/client/version.js.map +1 -1
  166. package/dist/node_modules/@wry/caches/lib/weak.js +1 -2
  167. package/dist/node_modules/@wry/caches/lib/weak.js.map +1 -1
  168. package/dist/node_modules/@wry/trie/lib/index.js +2 -3
  169. package/dist/node_modules/@wry/trie/lib/index.js.map +1 -1
  170. package/dist/node_modules/graphql-ws/dist/client.js +76 -69
  171. package/dist/node_modules/graphql-ws/dist/client.js.map +1 -1
  172. package/dist/node_modules/graphql-ws/dist/common-CGW11Fyb.js +2 -3
  173. package/dist/node_modules/graphql-ws/dist/common-CGW11Fyb.js.map +1 -1
  174. package/dist/node_modules/rxjs/dist/esm5/internal/NotificationFactories.js +2 -3
  175. package/dist/node_modules/rxjs/dist/esm5/internal/NotificationFactories.js.map +1 -1
  176. package/dist/node_modules/rxjs/dist/esm5/internal/Observable.js +41 -42
  177. package/dist/node_modules/rxjs/dist/esm5/internal/Observable.js.map +1 -1
  178. package/dist/node_modules/rxjs/dist/esm5/internal/Subscriber.js +14 -15
  179. package/dist/node_modules/rxjs/dist/esm5/internal/Subscriber.js.map +1 -1
  180. package/dist/node_modules/rxjs/dist/esm5/internal/Subscription.js +21 -18
  181. package/dist/node_modules/rxjs/dist/esm5/internal/Subscription.js.map +1 -1
  182. package/dist/node_modules/rxjs/dist/esm5/internal/config.js +1 -2
  183. package/dist/node_modules/rxjs/dist/esm5/internal/config.js.map +1 -1
  184. package/dist/node_modules/rxjs/dist/esm5/internal/observable/empty.js +1 -2
  185. package/dist/node_modules/rxjs/dist/esm5/internal/observable/empty.js.map +1 -1
  186. package/dist/node_modules/rxjs/dist/esm5/internal/scheduler/timeoutProvider.js +2 -3
  187. package/dist/node_modules/rxjs/dist/esm5/internal/scheduler/timeoutProvider.js.map +1 -1
  188. package/dist/node_modules/rxjs/dist/esm5/internal/symbol/observable.js +1 -2
  189. package/dist/node_modules/rxjs/dist/esm5/internal/symbol/observable.js.map +1 -1
  190. package/dist/node_modules/rxjs/dist/esm5/internal/util/UnsubscriptionError.js +1 -2
  191. package/dist/node_modules/rxjs/dist/esm5/internal/util/UnsubscriptionError.js.map +1 -1
  192. package/dist/node_modules/rxjs/dist/esm5/internal/util/arrRemove.js +1 -2
  193. package/dist/node_modules/rxjs/dist/esm5/internal/util/arrRemove.js.map +1 -1
  194. package/dist/node_modules/rxjs/dist/esm5/internal/util/createErrorClass.js +1 -2
  195. package/dist/node_modules/rxjs/dist/esm5/internal/util/createErrorClass.js.map +1 -1
  196. package/dist/node_modules/rxjs/dist/esm5/internal/util/errorContext.js +1 -2
  197. package/dist/node_modules/rxjs/dist/esm5/internal/util/errorContext.js.map +1 -1
  198. package/dist/node_modules/rxjs/dist/esm5/internal/util/identity.js +1 -2
  199. package/dist/node_modules/rxjs/dist/esm5/internal/util/identity.js.map +1 -1
  200. package/dist/node_modules/rxjs/dist/esm5/internal/util/isFunction.js +1 -2
  201. package/dist/node_modules/rxjs/dist/esm5/internal/util/isFunction.js.map +1 -1
  202. package/dist/node_modules/rxjs/dist/esm5/internal/util/noop.js +1 -2
  203. package/dist/node_modules/rxjs/dist/esm5/internal/util/noop.js.map +1 -1
  204. package/dist/node_modules/rxjs/dist/esm5/internal/util/pipe.js +1 -2
  205. package/dist/node_modules/rxjs/dist/esm5/internal/util/pipe.js.map +1 -1
  206. package/dist/node_modules/rxjs/dist/esm5/internal/util/reportUnhandledError.js +1 -2
  207. package/dist/node_modules/rxjs/dist/esm5/internal/util/reportUnhandledError.js.map +1 -1
  208. package/dist/node_modules/{rxjs/node_modules/tslib → tslib}/tslib.es6.js +1 -2
  209. package/dist/node_modules/tslib/tslib.es6.js.map +1 -0
  210. package/dist/pages/CreateNotificationPage.d.ts +5 -0
  211. package/dist/pages/CreateNotificationPage.js +591 -573
  212. package/dist/pages/CreateNotificationPage.js.map +1 -1
  213. package/dist/pages/NotificationCenterPage.d.ts +8 -0
  214. package/dist/pages/NotificationCenterPage.js +87 -83
  215. package/dist/pages/NotificationCenterPage.js.map +1 -1
  216. package/dist/pages/NotificationHistoryAdminPage.d.ts +2 -0
  217. package/dist/pages/NotificationHistoryAdminPage.js +7 -8
  218. package/dist/pages/NotificationHistoryAdminPage.js.map +1 -1
  219. package/dist/pages/NotificationHistoryPage.d.ts +6 -0
  220. package/dist/pages/NotificationHistoryPage.js +59 -55
  221. package/dist/pages/NotificationHistoryPage.js.map +1 -1
  222. package/dist/pages/NotificationLandingPage.d.ts +10 -0
  223. package/dist/pages/NotificationLandingPage.js +5 -6
  224. package/dist/pages/NotificationLandingPage.js.map +1 -1
  225. package/dist/pages/NotificationPreferencesPage.d.ts +5 -0
  226. package/dist/pages/NotificationPreferencesPage.js +97 -159
  227. package/dist/pages/NotificationPreferencesPage.js.map +1 -1
  228. package/dist/pages/NotificationTemplatesPage.d.ts +7 -0
  229. package/dist/pages/NotificationTemplatesPage.js +192 -172
  230. package/dist/pages/NotificationTemplatesPage.js.map +1 -1
  231. package/dist/pages/NotificationTopicsPage.d.ts +1 -0
  232. package/dist/pages/NotificationTopicsPage.js +126 -112
  233. package/dist/pages/NotificationTopicsPage.js.map +1 -1
  234. package/dist/pages/TemplateEditorPage.d.ts +12 -0
  235. package/dist/pages/TemplateEditorPage.js +381 -341
  236. package/dist/pages/TemplateEditorPage.js.map +1 -1
  237. package/dist/providers/NotificationProvider.d.ts +11 -0
  238. package/dist/providers/NotificationProvider.js +7 -7
  239. package/dist/providers/NotificationProvider.js.map +1 -1
  240. package/dist/shared/hooks/useTr.d.ts +13 -0
  241. package/dist/shared/hooks/useTr.js +1 -2
  242. package/dist/shared/hooks/useTr.js.map +1 -1
  243. package/dist/store/notificationStore.d.ts +30 -0
  244. package/dist/store/notificationStore.js +1 -2
  245. package/dist/store/notificationStore.js.map +1 -1
  246. package/dist/test/happydom.d.ts +1 -0
  247. package/dist/translations/en.d.ts +468 -0
  248. package/dist/types/index.d.ts +257 -0
  249. package/dist/utils/inAppNavigation.d.ts +37 -0
  250. package/dist/utils/inAppNavigation.js +2 -3
  251. package/dist/utils/inAppNavigation.js.map +1 -1
  252. package/dist/utils/index.d.ts +68 -0
  253. package/dist/utils/index.js +1 -2
  254. package/dist/utils/index.js.map +1 -1
  255. package/dist/utils/nativeBridge.d.ts +2 -0
  256. package/dist/utils/nativeBridge.js +1 -2
  257. package/dist/utils/notificationHistoryExport.d.ts +12 -0
  258. package/dist/utils/notificationHistoryExport.js +1 -2
  259. package/dist/utils/notificationHistoryExport.js.map +1 -1
  260. package/package.json +67 -49
  261. package/dist/node_modules/rxjs/node_modules/tslib/tslib.es6.js.map +0 -1
@@ -1,18 +1,19 @@
1
- import { useNotificationAnalytics as e } from "../hooks/useNotificationAnalytics.js";
1
+ import { useNavigationV2 as e } from "../navigation-v2/paths.js";
2
2
  import { isPermissionError as t } from "../utils/index.js";
3
- import { useTr as n } from "../shared/hooks/useTr.js";
4
- import { NOTIFICATION_PERMISSIONS as r } from "../constants/permissions.js";
5
- import { useNotificationTemplate as i, useNotificationTemplates as ee } from "../hooks/useNotificationTemplates.js";
6
- import { TemplatePreview as te } from "../components/TemplatePreview.js";
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";
3
+ import { useNotificationTemplate as n, useNotificationTemplates as r } from "../hooks/useNotificationTemplates.js";
4
+ import { useNotificationAnalytics as i } from "../hooks/useNotificationAnalytics.js";
5
+ import { TemplatePreview as ee } from "../components/TemplatePreview.js";
6
+ import { NOTIFICATION_PERMISSIONS as te } from "../constants/permissions.js";
7
+ import { useTr as ne } from "../shared/hooks/useTr.js";
8
+ import { useCallback as a, useEffect as o, useMemo as s, useRef as re, useState as c } from "react";
9
+ import { useGlobalUi as ie, usePermissions as ae } from "@burdenoff/fe-libs/shared/providers/shell";
10
+ import { AlertCircle as l, ArrowLeft as oe, Code as se, Eye as u, EyeOff as d, Loader2 as f, Plus as ce, Save as p, Trash2 as le, Type as m, Variable as ue } from "lucide-react";
10
11
  import { useNavigate as de, useParams as fe } from "react-router";
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
- //#region src/pages/TemplateEditorPage.tsx
15
- var _e = [
12
+ import { Fragment as pe, jsx as h, jsxs as g } from "react/jsx-runtime";
13
+ import { Button as me, NextSteps as he, OptionalFields as ge, PagePurpose as _e } from "@burdenoff/fe-libs/ui";
14
+ import { useI18n as ve } from "@burdenoff/fe-libs/shared/providers/shell/I18nProvider";
15
+ // src/pages/TemplateEditorPage.tsx
16
+ var ye = [
16
17
  {
17
18
  value: "TRANSACTIONAL",
18
19
  label: "Transactional",
@@ -33,7 +34,7 @@ var _e = [
33
34
  label: "Alert",
34
35
  description: "Urgent alerts and warnings"
35
36
  }
36
- ], ve = [
37
+ ], be = [
37
38
  {
38
39
  value: "EMAIL",
39
40
  label: "Email"
@@ -70,7 +71,7 @@ var _e = [
70
71
  value: "TELEGRAM",
71
72
  label: "Telegram"
72
73
  }
73
- ], ye = [
74
+ ], xe = [
74
75
  {
75
76
  value: "string",
76
77
  label: "String"
@@ -88,10 +89,10 @@ var _e = [
88
89
  label: "Date"
89
90
  }
90
91
  ];
91
- function be(e) {
92
+ function Se(e) {
92
93
  return e.toLowerCase().replace(/[^a-z0-9\s-]/g, "").replace(/\s+/g, "-").replace(/-+/g, "-").replace(/^-|-$/g, "");
93
94
  }
94
- function g(e, t, n) {
95
+ function _(e, t, n) {
95
96
  return e ? e.replace(/\{\{(\w+)\}\}/g, (e, r) => {
96
97
  let i = t.find((e) => e.name === r);
97
98
  if (!i) return e;
@@ -104,7 +105,7 @@ function g(e, t, n) {
104
105
  }
105
106
  }) : "";
106
107
  }
107
- function _(e) {
108
+ function Ce(e) {
108
109
  let t = {};
109
110
  for (let n of e) {
110
111
  let e = n.name.trim();
@@ -116,51 +117,60 @@ function _(e) {
116
117
  }
117
118
  return t;
118
119
  }
119
- function xe(e) {
120
- return e ? Array.isArray(e) ? e.map((e) => ({
121
- name: e.name || "",
122
- type: e.type || "string",
123
- defaultValue: e.defaultValue || ""
124
- })) : typeof e == "object" ? Object.entries(e).map(([e, t]) => ({
120
+ function v(e) {
121
+ return typeof e == "object" && !!e;
122
+ }
123
+ function y(e) {
124
+ return e ? String(e) : "";
125
+ }
126
+ function b(e) {
127
+ return e === "number" || e === "boolean" || e === "date" ? e : "string";
128
+ }
129
+ function we(e) {
130
+ return e ? Array.isArray(e) ? e.filter(v).map((e) => ({
131
+ name: typeof e.name == "string" ? e.name : "",
132
+ type: b(e.type),
133
+ defaultValue: y(e.defaultValue)
134
+ })) : v(e) ? Object.entries(e).map(([e, t]) => ({
125
135
  name: e,
126
- type: t?.type || "string",
127
- defaultValue: t?.defaultValue || ""
136
+ type: b(v(t) ? t.type : void 0),
137
+ defaultValue: y(v(t) ? t.defaultValue : void 0)
128
138
  })) : [] : [];
129
139
  }
130
- function v() {
131
- let v = de(), y = n(), { 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");
140
+ function x() {
141
+ let v = de(), y = ne(), { locale: b } = ve(), { templateId: x } = fe(), S = !!x, { hasPermission: Te, isLoading: Ee, refreshPermissions: De } = ae(), { showToast: Oe } = ie(), { createTemplate: ke, updateTemplate: Ae, isCreating: je, isUpdating: Me } = r(), { trackTemplateSaved: C } = i(), { template: w, isLoading: Ne, error: T } = n(S ? x : void 0), [E, D] = c(""), [O, k] = c(""), [A, j] = c(!1), M = e(), [Pe, Fe] = c(!1), [N, P] = c(""), [F, I] = c("TRANSACTIONAL"), [L, Ie] = c(""), [Le, Re] = c("en"), [R, ze] = c(""), [z, B] = c(""), [V, H] = c(""), [U, W] = c([]), [G, K] = c("text"), Be = re(null), Ve = re(null), [He, q] = c(null), [Ue, J] = c(null), [Y, X] = c(!0), [We, Ge] = c("email");
132
142
  o(() => {
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"));
143
+ w && (D(w.name), k(w.slug), j(!0), P(w.description || ""), I(w.type), Re(w.locale || "en"), ze(w.subject || ""), B(w.bodyTemplate || ""), H(w.htmlTemplate || ""), W(we(w.variables)), w.htmlTemplate && K("html"));
134
144
  }, [w]), o(() => {
135
- !je && E && k(be(E));
136
- }, [E, je]);
137
- let Be = s(() => g(L, U, b), [
145
+ !A && E && k(Se(E));
146
+ }, [E, A]);
147
+ let Ke = s(() => _(R, U, b), [
138
148
  b,
139
- L,
149
+ R,
140
150
  U
141
- ]), Ve = s(() => g(z, U, b), [
151
+ ]), qe = s(() => _(z, U, b), [
142
152
  z,
143
153
  b,
144
154
  U
145
- ]), He = s(() => g(V, U, b), [
155
+ ]), Je = s(() => _(V, U, b), [
146
156
  b,
147
157
  V,
148
158
  U
149
- ]), Ue = a(() => {
159
+ ]), Ye = a(() => {
150
160
  W((e) => [...e, {
151
161
  name: "",
152
162
  type: "string",
153
163
  defaultValue: ""
154
164
  }]);
155
- }, []), We = a((e) => {
165
+ }, []), Xe = a((e) => {
156
166
  W((t) => t.filter((t, n) => n !== e));
157
167
  }, []), Z = a((e, t, n) => {
158
168
  W((r) => r.map((r, i) => i === e ? {
159
169
  ...r,
160
170
  [t]: n
161
171
  } : r));
162
- }, []), Ge = a((e) => {
163
- let t = `{{${e}}}`, n = G === "html", r = n ? Fe.current : Pe.current, i = n ? H : B;
172
+ }, []), Ze = a((e) => {
173
+ let t = `{{${e}}}`, n = G === "html", r = n ? Ve.current : Be.current, i = n ? H : B;
164
174
  if (r) {
165
175
  let e = r.selectionStart, n = r.selectionEnd;
166
176
  i((r) => r.substring(0, e) + t + r.substring(n)), requestAnimationFrame(() => {
@@ -187,165 +197,249 @@ function v() {
187
197
  return;
188
198
  }
189
199
  let n = U.map((e) => e.name.trim()), r = n.filter((e, t) => n.indexOf(e) !== t);
190
- if (r.length > 0) {
191
- q(`${y("notifTemplates.duplicateVariableName", "Duplicate variable name")}: ${r[0]}`);
192
- return;
193
- }
194
- try {
200
+ if (r.length > 0) q(`${y("notifTemplates.duplicateVariableName", "Duplicate variable name")}: ${r[0]}`);
201
+ else try {
195
202
  if (S && w) {
196
203
  let e = {
197
204
  name: E.trim(),
198
- description: A.trim() || void 0,
199
- subject: L.trim() || void 0,
205
+ description: N.trim() || void 0,
206
+ subject: R.trim() || void 0,
200
207
  bodyTemplate: z.trim(),
201
208
  htmlTemplate: V.trim() || void 0,
202
- variables: _(U)
209
+ variables: Ce(U)
203
210
  };
204
- await De(w.id, e), C({
211
+ await Ae(w.id, e), C({
205
212
  action: "update",
206
- channel: P || void 0,
213
+ channel: L || void 0,
207
214
  type: w.type,
208
215
  variableCount: U.length,
209
216
  hasHtml: !!V.trim()
210
217
  }), J(y("notifTemplates.updateSuccess", "Template updated successfully"));
211
- } else await Ee({
212
- slug: O.trim(),
213
- name: E.trim(),
214
- description: A.trim() || void 0,
215
- type: M,
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
- action: "create",
224
- channel: P || void 0,
225
- type: M,
226
- variableCount: U.length,
227
- hasHtml: !!V.trim()
228
- }), J(y("notifTemplates.createSuccess", "Template created successfully")), setTimeout(() => v("..", { relative: "path" }), 1200);
218
+ } else {
219
+ let e = {
220
+ slug: O.trim(),
221
+ name: E.trim(),
222
+ description: N.trim() || void 0,
223
+ type: F,
224
+ locale: Le || "en",
225
+ subject: R.trim() || void 0,
226
+ bodyTemplate: z.trim(),
227
+ htmlTemplate: V.trim() || void 0,
228
+ variables: Ce(U),
229
+ ...L ? { channel: L } : {}
230
+ };
231
+ await ke(e), C({
232
+ action: "create",
233
+ channel: L || void 0,
234
+ type: F,
235
+ variableCount: U.length,
236
+ hasHtml: !!V.trim()
237
+ }), J(y("notifTemplates.createSuccess", "Template created successfully")), setTimeout(() => v("..", { relative: "path" }), 1200);
238
+ }
229
239
  } catch (e) {
230
240
  if (t(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));
241
+ Oe(y("notifTemplates.permissionDeniedOnSave", "You don't have permission to save this template. Refreshing access…"), "warning"), De().catch((e) => console.warn("[permissions] refresh failed after template save denial:", e));
232
242
  return;
233
243
  }
234
- q(e instanceof Error ? e.message : y("notifTemplates.saveFailed", "Failed to save template"));
244
+ let n = e instanceof Error ? e.message : y("notifTemplates.saveFailed", "Failed to save template");
245
+ q(n);
235
246
  }
236
247
  };
237
- if (Ce) return /* @__PURE__ */ m("div", {
248
+ if (Ee) return /* @__PURE__ */ h("div", {
238
249
  className: "flex h-64 items-center justify-center",
239
- children: /* @__PURE__ */ m("div", { className: "h-8 w-8 animate-spin rounded-full border-4 border-primary border-t-transparent" })
250
+ children: /* @__PURE__ */ h("div", { className: "h-8 w-8 animate-spin rounded-full border-4 border-primary border-t-transparent" })
240
251
  });
241
- if (!Se(S ? r.TEMPLATE_UPDATE : r.TEMPLATE_CREATE)) return /* @__PURE__ */ m("div", {
252
+ if (!Te(S ? te.TEMPLATE_UPDATE : te.TEMPLATE_CREATE)) return /* @__PURE__ */ h("div", {
242
253
  className: "p-8 text-center text-text-secondary",
243
254
  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
255
  });
245
- if (S && Ae) return /* @__PURE__ */ h("div", {
256
+ if (S && Ne) return /* @__PURE__ */ g("div", {
246
257
  className: "flex flex-col items-center justify-center h-64 gap-3",
247
- children: [/* @__PURE__ */ m(f, {
258
+ children: [/* @__PURE__ */ h(f, {
248
259
  size: 28,
249
260
  className: "animate-spin text-accent-primary"
250
- }), /* @__PURE__ */ m("p", {
261
+ }), /* @__PURE__ */ h("p", {
251
262
  className: "text-sm text-secondary",
252
263
  children: y("notifTemplates.loadingTemplate", "Loading template...")
253
264
  })]
254
265
  });
255
- if (S && T) return /* @__PURE__ */ h("div", {
266
+ if (S && T) return /* @__PURE__ */ g("div", {
256
267
  className: "flex flex-col items-center justify-center h-64 gap-4",
257
268
  children: [
258
- /* @__PURE__ */ m(l, {
269
+ /* @__PURE__ */ h(l, {
259
270
  size: 28,
260
271
  className: "text-error"
261
272
  }),
262
- /* @__PURE__ */ m("p", {
273
+ /* @__PURE__ */ h("p", {
263
274
  className: "text-sm text-error",
264
275
  children: T
265
276
  }),
266
- /* @__PURE__ */ m("button", {
277
+ /* @__PURE__ */ h("button", {
267
278
  onClick: () => v("..", { relative: "path" }),
268
279
  className: "px-4 py-2 text-sm text-secondary hover:text-primary border border-default rounded-lg transition-all",
269
280
  children: y("notifTemplates.backToTemplates", "Back to Templates")
270
281
  })
271
282
  ]
272
283
  });
273
- let $ = Oe || ke;
274
- return /* @__PURE__ */ h("div", {
284
+ let $ = je || Me, Qe = /* @__PURE__ */ h(pe, { children: /* @__PURE__ */ g("div", { children: [/* @__PURE__ */ h("label", {
285
+ className: "block text-sm font-medium text-primary mb-1.5",
286
+ children: y("notifTemplates.descriptionLabel", "Description")
287
+ }), /* @__PURE__ */ h("textarea", {
288
+ value: N,
289
+ onChange: (e) => P(e.target.value),
290
+ rows: 2,
291
+ placeholder: y("notifTemplates.descriptionPlaceholder", "Brief description of this template"),
292
+ 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"
293
+ })] }) }), $e = /* @__PURE__ */ g(pe, { children: [/* @__PURE__ */ g("div", { children: [/* @__PURE__ */ h("label", {
294
+ className: "block text-sm font-medium text-primary mb-1.5",
295
+ children: y("notifTemplates.defaultChannel", "Default Channel")
296
+ }), /* @__PURE__ */ g("select", {
297
+ "aria-label": y("notifTemplates.defaultChannel", "Default Channel"),
298
+ value: L,
299
+ onChange: (e) => Ie(e.target.value),
300
+ disabled: S,
301
+ 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 scheme-normal dark:scheme-dark [&_option]:bg-bg-surface [&_option]:text-text-primary",
302
+ children: [/* @__PURE__ */ h("option", {
303
+ value: "",
304
+ children: y("notifTemplates.none", "None")
305
+ }), be.map((e) => /* @__PURE__ */ h("option", {
306
+ value: e.value,
307
+ children: y(`notifTemplates.channel.${e.value}`, e.label)
308
+ }, e.value))]
309
+ })] }), /* @__PURE__ */ g("div", { children: [/* @__PURE__ */ h("label", {
310
+ className: "block text-sm font-medium text-primary mb-1.5",
311
+ children: y("notifTemplates.localeLabel", "Locale")
312
+ }), /* @__PURE__ */ h("input", {
313
+ type: "text",
314
+ "aria-label": y("notifTemplates.localeLabel", "Locale"),
315
+ value: Le,
316
+ onChange: (e) => Re(e.target.value),
317
+ placeholder: "en",
318
+ disabled: S,
319
+ 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"
320
+ })] })] }), et = w ? /* @__PURE__ */ g("div", {
321
+ className: "text-[11px] text-tertiary space-y-1",
322
+ children: [
323
+ /* @__PURE__ */ g("p", { children: [
324
+ /* @__PURE__ */ g("span", {
325
+ className: "font-medium",
326
+ children: [y("notifTemplates.metaId", "ID"), ":"]
327
+ }),
328
+ " ",
329
+ /* @__PURE__ */ h("code", {
330
+ className: "text-[10px]",
331
+ children: w.id
332
+ })
333
+ ] }),
334
+ /* @__PURE__ */ g("p", { children: [
335
+ /* @__PURE__ */ g("span", {
336
+ className: "font-medium",
337
+ children: [y("notifTemplates.metaVersion", "Version"), ":"]
338
+ }),
339
+ " ",
340
+ w.version
341
+ ] }),
342
+ /* @__PURE__ */ g("p", { children: [
343
+ /* @__PURE__ */ g("span", {
344
+ className: "font-medium",
345
+ children: [y("notifTemplates.metaCreated", "Created"), ":"]
346
+ }),
347
+ " ",
348
+ new Date(w.createdAt).toLocaleString(b || "en-US")
349
+ ] }),
350
+ /* @__PURE__ */ g("p", { children: [
351
+ /* @__PURE__ */ g("span", {
352
+ className: "font-medium",
353
+ children: [y("notifTemplates.metaUpdated", "Updated"), ":"]
354
+ }),
355
+ " ",
356
+ new Date(w.updatedAt).toLocaleString(b || "en-US")
357
+ ] }),
358
+ /* @__PURE__ */ g("p", { children: [
359
+ /* @__PURE__ */ g("span", {
360
+ className: "font-medium",
361
+ children: [y("notifTemplates.metaEnabled", "Enabled"), ":"]
362
+ }),
363
+ " ",
364
+ w.enabled ? y("notifTemplates.yes", "Yes") : y("notifTemplates.no", "No")
365
+ ] })
366
+ ]
367
+ }) : null;
368
+ return /* @__PURE__ */ g("div", {
275
369
  className: "animate-in fade-in duration-200 h-full flex flex-col",
276
370
  children: [
277
- /* @__PURE__ */ h("div", {
371
+ /* @__PURE__ */ g("div", {
278
372
  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__ */ h("div", {
373
+ children: [/* @__PURE__ */ g("div", {
280
374
  className: "flex items-center gap-3",
281
- children: [/* @__PURE__ */ m("button", {
375
+ children: [/* @__PURE__ */ h("button", {
282
376
  onClick: () => v("..", { relative: "path" }),
283
377
  className: "p-2 hover:bg-bg-sunken rounded-lg transition-all duration-150",
284
- children: /* @__PURE__ */ m(ae, {
378
+ children: /* @__PURE__ */ h(oe, {
285
379
  size: 20,
286
380
  className: "text-primary"
287
381
  })
288
- }), /* @__PURE__ */ h("div", { children: [/* @__PURE__ */ m("h1", {
382
+ }), /* @__PURE__ */ g("div", { children: [/* @__PURE__ */ h("h1", {
289
383
  className: "text-lg font-bold text-primary",
290
384
  children: S ? y("notifTemplates.editTemplate", "Edit Template") : y("notifTemplates.createTemplate", "Create Template")
291
- }), S && w && /* @__PURE__ */ h("p", {
385
+ }), S && w && /* @__PURE__ */ g("p", {
292
386
  className: "text-xs text-tertiary",
293
387
  children: [
294
- /* @__PURE__ */ m("code", { children: w.slug }),
388
+ /* @__PURE__ */ h("code", { children: w.slug }),
295
389
  " · v",
296
390
  w.version
297
391
  ]
298
392
  })] })]
299
- }), /* @__PURE__ */ h(pe, {
393
+ }), /* @__PURE__ */ g(me, {
300
394
  onClick: Q,
301
395
  disabled: $,
302
396
  className: "gap-2",
303
- children: [$ ? /* @__PURE__ */ m(f, {
397
+ children: [$ ? /* @__PURE__ */ h(f, {
304
398
  size: 16,
305
399
  className: "animate-spin"
306
- }) : /* @__PURE__ */ m(p, { size: 16 }), S ? y("notifTemplates.saveChanges", "Save Changes") : y("notifTemplates.createTemplate", "Create Template")]
400
+ }) : /* @__PURE__ */ h(p, { size: 16 }), S ? y("notifTemplates.saveChanges", "Save Changes") : y("notifTemplates.createTemplate", "Create Template")]
307
401
  })]
308
402
  }),
309
- Ie && /* @__PURE__ */ h("div", {
403
+ He && /* @__PURE__ */ g("div", {
310
404
  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__ */ m(l, {
405
+ children: [/* @__PURE__ */ h(l, {
312
406
  size: 16,
313
407
  className: "text-error shrink-0"
314
- }), /* @__PURE__ */ m("p", {
408
+ }), /* @__PURE__ */ h("p", {
315
409
  className: "text-sm text-error",
316
- children: Ie
410
+ children: He
317
411
  })]
318
412
  }),
319
- Le && /* @__PURE__ */ h("div", {
413
+ Ue && /* @__PURE__ */ g("div", {
320
414
  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__ */ m(p, {
415
+ children: [/* @__PURE__ */ h(p, {
322
416
  size: 16,
323
417
  className: "text-success shrink-0"
324
- }), /* @__PURE__ */ m("p", {
418
+ }), /* @__PURE__ */ h("p", {
325
419
  className: "text-sm text-success",
326
- children: Le
420
+ children: Ue
327
421
  })]
328
422
  }),
329
- /* @__PURE__ */ h("div", {
423
+ /* @__PURE__ */ g("div", {
330
424
  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 }),
425
+ children: [/* @__PURE__ */ h(_e, {
426
+ icon: /* @__PURE__ */ h(m, { size: 16 }),
333
427
  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, {
428
+ }), /* @__PURE__ */ h(he, {
335
429
  storageKey: "notification-template-editor",
336
430
  steps: [
337
431
  {
338
432
  id: "add-variable",
339
433
  label: y("notifTemplates.nextAddVarLabel", "Add a variable"),
340
434
  description: y("notifTemplates.nextAddVarDesc", "Define a {{placeholder}} (e.g. userName) so the same template personalises every send."),
341
- onClick: Ue
435
+ onClick: Ye
342
436
  },
343
437
  {
344
438
  id: "preview-channel",
345
439
  label: y("notifTemplates.nextPreviewLabel", "Preview each channel"),
346
440
  description: y("notifTemplates.nextPreviewDesc", "Flip the live preview to SMS or push to confirm the template reads well everywhere."),
347
441
  onClick: () => {
348
- X(!0), ze("sms");
442
+ X(!0), Ge("sms");
349
443
  }
350
444
  },
351
445
  {
@@ -357,238 +451,221 @@ function v() {
357
451
  ]
358
452
  })]
359
453
  }),
360
- /* @__PURE__ */ h("div", {
454
+ /* @__PURE__ */ g("div", {
361
455
  className: "flex-1 overflow-hidden flex flex-col lg:flex-row",
362
- children: [/* @__PURE__ */ m("div", {
456
+ children: [/* @__PURE__ */ h("div", {
363
457
  className: "flex-1 overflow-y-auto p-3 sm:p-5 lg:border-r lg:border-border-seam",
364
- children: /* @__PURE__ */ h("form", {
458
+ children: /* @__PURE__ */ g("form", {
365
459
  onSubmit: Q,
366
460
  className: "space-y-5",
367
461
  children: [
368
- /* @__PURE__ */ h("section", {
462
+ /* @__PURE__ */ g("section", {
369
463
  className: "p-4 bg-gloss-card border border-border-seam rounded-lg space-y-4",
370
464
  children: [
371
- /* @__PURE__ */ m("h2", {
465
+ /* @__PURE__ */ h("h2", {
372
466
  className: "text-sm font-semibold text-primary uppercase tracking-wider",
373
467
  children: y("notifTemplates.basicInformation", "Basic Information")
374
468
  }),
375
- /* @__PURE__ */ h("div", {
469
+ /* @__PURE__ */ g("div", {
376
470
  className: "grid grid-cols-1 sm:grid-cols-2 gap-4",
377
- children: [/* @__PURE__ */ h("div", { children: [/* @__PURE__ */ h("label", {
471
+ children: [/* @__PURE__ */ g("div", { children: [/* @__PURE__ */ g("label", {
378
472
  className: "block text-sm font-medium text-primary mb-1.5",
379
473
  children: [
380
474
  y("notifTemplates.nameLabel", "Name"),
381
475
  " ",
382
- /* @__PURE__ */ m("span", {
476
+ /* @__PURE__ */ h("span", {
383
477
  className: "text-error",
384
478
  children: "*"
385
479
  })
386
480
  ]
387
- }), /* @__PURE__ */ m("input", {
481
+ }), /* @__PURE__ */ h("input", {
388
482
  type: "text",
389
483
  value: E,
390
484
  onChange: (e) => D(e.target.value),
391
485
  placeholder: y("notifTemplates.namePlaceholder", "e.g., Welcome Email"),
392
486
  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"
393
- })] }), /* @__PURE__ */ h("div", { children: [
394
- /* @__PURE__ */ h("label", {
487
+ })] }), /* @__PURE__ */ g("div", { children: [
488
+ /* @__PURE__ */ g("label", {
395
489
  className: "block text-sm font-medium text-primary mb-1.5",
396
490
  children: [
397
491
  y("notifTemplates.slugLabel", "Slug"),
398
492
  " ",
399
- /* @__PURE__ */ m("span", {
493
+ /* @__PURE__ */ h("span", {
400
494
  className: "text-error",
401
495
  children: "*"
402
496
  })
403
497
  ]
404
498
  }),
405
- /* @__PURE__ */ m("input", {
499
+ M && !Pe ? /* @__PURE__ */ g("div", {
500
+ className: "flex min-h-9 items-center gap-2",
501
+ children: [/* @__PURE__ */ h("code", {
502
+ className: "truncate font-mono text-sm text-text-primary",
503
+ children: O || "—"
504
+ }), !S && /* @__PURE__ */ h("button", {
505
+ type: "button",
506
+ onClick: () => Fe(!0),
507
+ className: "text-sm font-medium text-accent-primary hover:underline",
508
+ children: y("notifTemplates.editSlug", "Edit")
509
+ })]
510
+ }) : /* @__PURE__ */ h("input", {
406
511
  type: "text",
407
512
  value: O,
408
513
  onChange: (e) => {
409
- k(e.target.value), Me(!0);
514
+ k(e.target.value), j(!0);
410
515
  },
411
516
  placeholder: y("notifTemplates.slugPlaceholder", "e.g., welcome-email"),
412
517
  disabled: S,
413
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 disabled:opacity-60 disabled:cursor-not-allowed"
414
519
  }),
415
- !S && /* @__PURE__ */ m("p", {
520
+ !S && /* @__PURE__ */ h("p", {
416
521
  className: "mt-1 text-[11px] text-tertiary",
417
522
  children: y("notifTemplates.autoGeneratedFromName", "Auto-generated from name.")
418
523
  })
419
524
  ] })]
420
525
  }),
421
- /* @__PURE__ */ h("div", { children: [/* @__PURE__ */ m("label", {
422
- className: "block text-sm font-medium text-primary mb-1.5",
423
- children: y("notifTemplates.descriptionLabel", "Description")
424
- }), /* @__PURE__ */ m("textarea", {
425
- value: A,
426
- onChange: (e) => j(e.target.value),
427
- rows: 2,
428
- placeholder: y("notifTemplates.descriptionPlaceholder", "Brief description of this template"),
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"
430
- })] }),
431
- /* @__PURE__ */ h("div", {
432
- className: "grid grid-cols-1 sm:grid-cols-3 gap-4",
433
- children: [
434
- /* @__PURE__ */ h("div", { children: [/* @__PURE__ */ h("label", {
435
- className: "block text-sm font-medium text-primary mb-1.5",
436
- children: [
437
- y("notifTemplates.typeLabel", "Type"),
438
- " ",
439
- /* @__PURE__ */ m("span", {
440
- className: "text-error",
441
- children: "*"
442
- })
443
- ]
444
- }), /* @__PURE__ */ m("select", {
445
- value: M,
446
- onChange: (e) => N(e.target.value),
447
- disabled: S,
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 scheme-normal dark:scheme-dark [&_option]:bg-bg-surface [&_option]:text-text-primary",
449
- children: _e.map((e) => /* @__PURE__ */ m("option", {
450
- value: e.value,
451
- children: y(`notifTemplates.type.${e.value}`, e.label)
452
- }, e.value))
453
- })] }),
454
- /* @__PURE__ */ h("div", { children: [/* @__PURE__ */ m("label", {
455
- className: "block text-sm font-medium text-primary mb-1.5",
456
- children: y("notifTemplates.defaultChannel", "Default Channel")
457
- }), /* @__PURE__ */ h("select", {
458
- value: P,
459
- onChange: (e) => Ne(e.target.value),
460
- disabled: S,
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 scheme-normal dark:scheme-dark [&_option]:bg-bg-surface [&_option]:text-text-primary",
462
- children: [/* @__PURE__ */ m("option", {
463
- value: "",
464
- children: y("notifTemplates.none", "None")
465
- }), ve.map((e) => /* @__PURE__ */ m("option", {
466
- value: e.value,
467
- children: y(`notifTemplates.channel.${e.value}`, e.label)
468
- }, e.value))]
469
- })] }),
470
- /* @__PURE__ */ h("div", { children: [/* @__PURE__ */ m("label", {
471
- className: "block text-sm font-medium text-primary mb-1.5",
472
- children: y("notifTemplates.localeLabel", "Locale")
473
- }), /* @__PURE__ */ m("input", {
474
- type: "text",
475
- value: F,
476
- onChange: (e) => I(e.target.value),
477
- placeholder: "en",
478
- disabled: S,
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"
480
- })] })
481
- ]
526
+ !M && Qe,
527
+ /* @__PURE__ */ g("div", {
528
+ className: `grid grid-cols-1 gap-4 ${M ? "sm:grid-cols-2" : "sm:grid-cols-3"}`,
529
+ children: [/* @__PURE__ */ g("div", { children: [/* @__PURE__ */ g("label", {
530
+ className: "block text-sm font-medium text-primary mb-1.5",
531
+ children: [
532
+ y("notifTemplates.typeLabel", "Type"),
533
+ " ",
534
+ /* @__PURE__ */ h("span", {
535
+ className: "text-error",
536
+ children: "*"
537
+ })
538
+ ]
539
+ }), /* @__PURE__ */ h("select", {
540
+ value: F,
541
+ onChange: (e) => I(e.target.value),
542
+ disabled: S,
543
+ 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 scheme-normal dark:scheme-dark [&_option]:bg-bg-surface [&_option]:text-text-primary",
544
+ children: ye.map((e) => /* @__PURE__ */ h("option", {
545
+ value: e.value,
546
+ children: y(`notifTemplates.type.${e.value}`, e.label)
547
+ }, e.value))
548
+ })] }), !M && $e]
482
549
  })
483
550
  ]
484
551
  }),
485
- /* @__PURE__ */ h("section", {
552
+ M && /* @__PURE__ */ h(ge, {
553
+ storageKey: "notifications.templateEditor.more",
554
+ children: /* @__PURE__ */ g("div", {
555
+ className: "space-y-4",
556
+ children: [Qe, /* @__PURE__ */ h("div", {
557
+ className: "grid grid-cols-1 gap-4 sm:grid-cols-2",
558
+ children: $e
559
+ })]
560
+ })
561
+ }),
562
+ /* @__PURE__ */ g("section", {
486
563
  className: "p-4 bg-gloss-card border border-border-seam rounded-lg space-y-4",
487
564
  children: [
488
- /* @__PURE__ */ h("div", {
565
+ /* @__PURE__ */ g("div", {
489
566
  className: "flex items-center justify-between",
490
- children: [/* @__PURE__ */ m("h2", {
567
+ children: [/* @__PURE__ */ h("h2", {
491
568
  className: "text-sm font-semibold text-primary uppercase tracking-wider",
492
569
  children: y("notifTemplates.templateContent", "Template Content")
493
- }), /* @__PURE__ */ h("div", {
570
+ }), /* @__PURE__ */ g("div", {
494
571
  className: "flex items-center bg-bg-sunken rounded-lg p-0.5",
495
- children: [/* @__PURE__ */ h("button", {
572
+ children: [/* @__PURE__ */ g("button", {
496
573
  type: "button",
497
574
  onClick: () => K("text"),
498
575
  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", {
576
+ children: [/* @__PURE__ */ h(m, { size: 12 }), y("notifTemplates.contentMode.text", "Text")]
577
+ }), /* @__PURE__ */ g("button", {
501
578
  type: "button",
502
579
  onClick: () => K("html"),
503
580
  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")]
581
+ children: [/* @__PURE__ */ h(se, { size: 12 }), y("notifTemplates.contentMode.html", "HTML")]
505
582
  })]
506
583
  })]
507
584
  }),
508
- /* @__PURE__ */ h("div", { children: [
509
- /* @__PURE__ */ m("label", {
585
+ /* @__PURE__ */ g("div", { children: [
586
+ /* @__PURE__ */ h("label", {
510
587
  className: "block text-sm font-medium text-primary mb-1.5",
511
588
  children: y("notifTemplates.subjectLabel", "Subject")
512
589
  }),
513
- /* @__PURE__ */ m("input", {
590
+ /* @__PURE__ */ h("input", {
514
591
  type: "text",
515
- value: L,
516
- onChange: (e) => R(e.target.value),
592
+ value: R,
593
+ onChange: (e) => ze(e.target.value),
517
594
  placeholder: y("notifTemplates.subjectPlaceholder", "e.g., Welcome to {{appName}}, {{userName}}!"),
518
595
  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"
519
596
  }),
520
- /* @__PURE__ */ m("p", {
597
+ /* @__PURE__ */ h("p", {
521
598
  className: "mt-1 text-[11px] text-tertiary",
522
599
  children: y("notifTemplates.subjectHint", "Used for email subject lines. Supports {{variables}}.")
523
600
  })
524
601
  ] }),
525
- G === "text" && /* @__PURE__ */ h("div", { children: [/* @__PURE__ */ h("label", {
602
+ G === "text" && /* @__PURE__ */ g("div", { children: [/* @__PURE__ */ g("label", {
526
603
  className: "block text-sm font-medium text-primary mb-1.5",
527
604
  children: [
528
605
  y("notifTemplates.bodyTemplateLabel", "Body Template"),
529
606
  " ",
530
- /* @__PURE__ */ m("span", {
607
+ /* @__PURE__ */ h("span", {
531
608
  className: "text-error",
532
609
  children: "*"
533
610
  })
534
611
  ]
535
- }), /* @__PURE__ */ m("textarea", {
536
- ref: Pe,
612
+ }), /* @__PURE__ */ h("textarea", {
613
+ ref: Be,
537
614
  value: z,
538
615
  onChange: (e) => B(e.target.value),
539
616
  rows: 8,
540
617
  placeholder: y("notifTemplates.bodyPlaceholder", "Hello {{userName}},\n\nWelcome to {{appName}}! Your account has been created.\n\nBest regards,\nThe Team"),
541
618
  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"
542
619
  })] }),
543
- G === "html" && /* @__PURE__ */ h("div", { children: [
544
- /* @__PURE__ */ m("label", {
620
+ G === "html" && /* @__PURE__ */ g("div", { children: [
621
+ /* @__PURE__ */ h("label", {
545
622
  className: "block text-sm font-medium text-primary mb-1.5",
546
623
  children: y("notifTemplates.htmlTemplateLabel", "HTML Template")
547
624
  }),
548
- /* @__PURE__ */ m("textarea", {
549
- ref: Fe,
625
+ /* @__PURE__ */ h("textarea", {
626
+ ref: Ve,
550
627
  value: V,
551
628
  onChange: (e) => H(e.target.value),
552
629
  rows: 12,
553
630
  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>"),
554
631
  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"
555
632
  }),
556
- /* @__PURE__ */ m("p", {
633
+ /* @__PURE__ */ h("p", {
557
634
  className: "mt-1 text-[11px] text-tertiary",
558
635
  children: y("notifTemplates.htmlHint", "HTML content for email. Falls back to text body if not provided.")
559
636
  })
560
637
  ] }),
561
- U.length > 0 && /* @__PURE__ */ h("div", {
638
+ U.length > 0 && /* @__PURE__ */ g("div", {
562
639
  className: "flex items-center gap-2 flex-wrap",
563
- children: [/* @__PURE__ */ h("span", {
640
+ children: [/* @__PURE__ */ g("span", {
564
641
  className: "text-[11px] text-tertiary font-medium",
565
642
  children: [y("notifTemplates.insert", "Insert"), ":"]
566
- }), U.filter((e) => e.name.trim()).map((e, t) => /* @__PURE__ */ m("button", {
643
+ }), U.filter((e) => e.name.trim()).map((e, t) => /* @__PURE__ */ h("button", {
567
644
  type: "button",
568
- onClick: () => Ge(e.name),
645
+ onClick: () => Ze(e.name),
569
646
  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",
570
647
  children: `{{${e.name}}}`
571
648
  }, t))]
572
649
  })
573
650
  ]
574
651
  }),
575
- /* @__PURE__ */ h("section", {
652
+ /* @__PURE__ */ g("section", {
576
653
  className: "p-4 bg-gloss-card border border-border-seam rounded-lg space-y-4",
577
654
  children: [
578
- /* @__PURE__ */ h("div", {
655
+ /* @__PURE__ */ g("div", {
579
656
  className: "flex items-center justify-between",
580
- children: [/* @__PURE__ */ h("div", {
657
+ children: [/* @__PURE__ */ g("div", {
581
658
  className: "flex items-center gap-2",
582
659
  children: [
583
- /* @__PURE__ */ m(ue, {
660
+ /* @__PURE__ */ h(ue, {
584
661
  size: 16,
585
662
  className: "text-accent-primary"
586
663
  }),
587
- /* @__PURE__ */ m("h2", {
664
+ /* @__PURE__ */ h("h2", {
588
665
  className: "text-sm font-semibold text-primary uppercase tracking-wider",
589
666
  children: y("notifTemplates.variables", "Variables")
590
667
  }),
591
- /* @__PURE__ */ h("span", {
668
+ /* @__PURE__ */ g("span", {
592
669
  className: "text-[11px] text-tertiary",
593
670
  children: [
594
671
  "(",
@@ -597,33 +674,33 @@ function v() {
597
674
  ]
598
675
  })
599
676
  ]
600
- }), /* @__PURE__ */ h("button", {
677
+ }), /* @__PURE__ */ g("button", {
601
678
  type: "button",
602
- onClick: Ue,
679
+ onClick: Ye,
603
680
  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",
604
- children: [/* @__PURE__ */ m(se, { size: 12 }), y("notifTemplates.addVariable", "Add Variable")]
681
+ children: [/* @__PURE__ */ h(ce, { size: 12 }), y("notifTemplates.addVariable", "Add Variable")]
605
682
  })]
606
683
  }),
607
- U.length === 0 && /* @__PURE__ */ h("p", {
684
+ U.length === 0 && /* @__PURE__ */ g("p", {
608
685
  className: "text-sm text-tertiary text-center py-4",
609
686
  children: [
610
687
  y("notifTemplates.noVariables", "No variables defined. Add variables to use dynamic content like"),
611
688
  " ",
612
- /* @__PURE__ */ m("code", {
689
+ /* @__PURE__ */ h("code", {
613
690
  className: "px-1.5 py-0.5 bg-bg-sunken rounded text-[11px] font-mono",
614
691
  children: "{{userName}}"
615
692
  })
616
693
  ]
617
694
  }),
618
- U.map((e, t) => /* @__PURE__ */ h("div", {
695
+ U.map((e, t) => /* @__PURE__ */ g("div", {
619
696
  className: "flex items-start gap-3 p-3 bg-bg-sunken/50 rounded-lg border border-default/50",
620
697
  children: [
621
- /* @__PURE__ */ h("div", {
698
+ /* @__PURE__ */ g("div", {
622
699
  className: "flex-1",
623
- children: [/* @__PURE__ */ m("label", {
700
+ children: [/* @__PURE__ */ h("label", {
624
701
  className: "block text-[11px] font-medium text-tertiary mb-1",
625
702
  children: y("notifTemplates.variableName", "Name")
626
- }), /* @__PURE__ */ m("input", {
703
+ }), /* @__PURE__ */ h("input", {
627
704
  type: "text",
628
705
  value: e.name,
629
706
  onChange: (e) => Z(t, "name", e.target.value.replace(/[^a-zA-Z0-9_]/g, "")),
@@ -631,27 +708,27 @@ function v() {
631
708
  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"
632
709
  })]
633
710
  }),
634
- /* @__PURE__ */ h("div", {
711
+ /* @__PURE__ */ g("div", {
635
712
  className: "w-28",
636
- children: [/* @__PURE__ */ m("label", {
713
+ children: [/* @__PURE__ */ h("label", {
637
714
  className: "block text-[11px] font-medium text-tertiary mb-1",
638
715
  children: y("notifTemplates.variableType", "Type")
639
- }), /* @__PURE__ */ m("select", {
716
+ }), /* @__PURE__ */ h("select", {
640
717
  value: e.type,
641
718
  onChange: (e) => Z(t, "type", e.target.value),
642
719
  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 scheme-normal dark:scheme-dark [&_option]:bg-bg-surface [&_option]:text-text-primary",
643
- children: ye.map((e) => /* @__PURE__ */ m("option", {
720
+ children: xe.map((e) => /* @__PURE__ */ h("option", {
644
721
  value: e.value,
645
722
  children: y(`notifTemplates.variableType.${e.value}`, e.label)
646
723
  }, e.value))
647
724
  })]
648
725
  }),
649
- /* @__PURE__ */ h("div", {
726
+ /* @__PURE__ */ g("div", {
650
727
  className: "flex-1",
651
- children: [/* @__PURE__ */ m("label", {
728
+ children: [/* @__PURE__ */ h("label", {
652
729
  className: "block text-[11px] font-medium text-tertiary mb-1",
653
730
  children: y("notifTemplates.sampleValue", "Sample Value")
654
- }), /* @__PURE__ */ m("input", {
731
+ }), /* @__PURE__ */ h("input", {
655
732
  type: "text",
656
733
  value: e.defaultValue,
657
734
  onChange: (e) => Z(t, "defaultValue", e.target.value),
@@ -659,163 +736,127 @@ function v() {
659
736
  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"
660
737
  })]
661
738
  }),
662
- /* @__PURE__ */ m("button", {
739
+ /* @__PURE__ */ h("button", {
663
740
  type: "button",
664
- onClick: () => We(t),
741
+ onClick: () => Xe(t),
665
742
  className: "mt-5 p-1.5 text-tertiary hover:text-error rounded transition-colors",
666
- children: /* @__PURE__ */ m(ce, { size: 14 })
743
+ children: /* @__PURE__ */ h(le, { size: 14 })
667
744
  })
668
745
  ]
669
746
  }, t))
670
747
  ]
671
748
  }),
672
- /* @__PURE__ */ h("div", {
749
+ /* @__PURE__ */ g("div", {
673
750
  className: "flex justify-end gap-3 lg:hidden pb-4",
674
- children: [/* @__PURE__ */ m("button", {
751
+ children: [/* @__PURE__ */ h("button", {
675
752
  type: "button",
676
753
  onClick: () => v("..", { relative: "path" }),
677
754
  className: "px-4 py-2 text-sm font-medium text-tertiary hover:text-primary border border-default rounded-lg transition-all duration-150",
678
755
  children: y("notifTemplates.cancel", "Cancel")
679
- }), /* @__PURE__ */ h("button", {
756
+ }), /* @__PURE__ */ g("button", {
680
757
  type: "submit",
681
758
  disabled: $,
682
759
  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",
683
- children: [$ ? /* @__PURE__ */ m(f, {
760
+ children: [$ ? /* @__PURE__ */ h(f, {
684
761
  size: 16,
685
762
  className: "animate-spin"
686
- }) : /* @__PURE__ */ m(p, { size: 16 }), S ? y("notifTemplates.saveChanges", "Save Changes") : y("notifTemplates.createTemplate", "Create Template")]
763
+ }) : /* @__PURE__ */ h(p, { size: 16 }), S ? y("notifTemplates.saveChanges", "Save Changes") : y("notifTemplates.createTemplate", "Create Template")]
687
764
  })]
688
765
  })
689
766
  ]
690
767
  })
691
- }), /* @__PURE__ */ h("div", {
768
+ }), /* @__PURE__ */ g("div", {
692
769
  className: "hidden lg:flex lg:flex-col lg:w-[440px] xl:w-[500px] bg-bg-sunken/30",
693
- children: [/* @__PURE__ */ h("div", {
770
+ children: [/* @__PURE__ */ g("div", {
694
771
  className: "flex items-center gap-2 px-4 py-3 border-b border-border-seam bg-accent-wash shrink-0",
695
772
  children: [
696
- /* @__PURE__ */ m(u, {
773
+ /* @__PURE__ */ h(u, {
697
774
  size: 16,
698
775
  className: "text-primary"
699
776
  }),
700
- /* @__PURE__ */ m("span", {
777
+ /* @__PURE__ */ h("span", {
701
778
  className: "text-sm font-semibold text-primary",
702
779
  children: y("notifTemplates.livePreview", "Live Preview")
703
780
  }),
704
- /* @__PURE__ */ h("button", {
781
+ /* @__PURE__ */ g("button", {
705
782
  type: "button",
706
783
  onClick: () => X((e) => !e),
707
784
  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")]
785
+ children: [h(Y ? u : d, { size: 12 }), Y ? y("notifTemplates.previewOn", "On") : y("notifTemplates.previewOffShort", "Off")]
709
786
  })
710
787
  ]
711
- }), Y ? /* @__PURE__ */ h("div", {
788
+ }), Y ? /* @__PURE__ */ g("div", {
712
789
  className: "flex-1 flex flex-col overflow-hidden",
713
- children: [/* @__PURE__ */ m(te, {
714
- channel: Re,
715
- subject: Be,
716
- body: Ve,
717
- html: G === "html" && V ? He : "",
790
+ children: [/* @__PURE__ */ h(ee, {
791
+ channel: We,
792
+ subject: Ke,
793
+ body: qe,
794
+ html: G === "html" && V ? Je : "",
718
795
  appName: U.find((e) => e.name === "appName")?.defaultValue || "Burdenoff",
719
- onChannelChange: ze
720
- }), /* @__PURE__ */ h("div", {
796
+ onChannelChange: Ge
797
+ }), /* @__PURE__ */ g("div", {
721
798
  className: "shrink-0 border-t border-default overflow-y-auto max-h-[240px]",
722
- children: [U.length > 0 && /* @__PURE__ */ h("div", {
723
- className: "p-3 border-b border-default/50",
724
- children: [/* @__PURE__ */ h("p", {
725
- className: "text-[10px] font-medium text-tertiary uppercase tracking-wider mb-2",
726
- children: [
727
- y("notifTemplates.variables", "Variables"),
728
- " (",
729
- U.length,
730
- ")"
731
- ]
732
- }), /* @__PURE__ */ m("div", {
733
- className: "space-y-1.5",
734
- children: U.map((e, t) => /* @__PURE__ */ h("div", {
735
- className: "flex items-center justify-between text-xs",
736
- children: [/* @__PURE__ */ m("code", {
737
- className: "text-primary font-mono",
738
- children: `{{${e.name || "..."}}}`
739
- }), /* @__PURE__ */ h("span", {
740
- className: "text-tertiary",
741
- children: [
742
- e.type,
743
- " =",
744
- " ",
745
- e.defaultValue || /* @__PURE__ */ m("em", { children: y("notifTemplates.noDefault", "no default") })
746
- ]
747
- })]
748
- }, t))
749
- })]
750
- }), S && w && /* @__PURE__ */ h("div", {
751
- className: "p-3",
752
- children: [/* @__PURE__ */ m("p", {
753
- className: "text-[10px] font-medium text-tertiary uppercase tracking-wider mb-1",
754
- children: y("notifTemplates.metadata", "Metadata")
755
- }), /* @__PURE__ */ h("div", {
756
- className: "text-[11px] text-tertiary space-y-1",
757
- children: [
758
- /* @__PURE__ */ h("p", { children: [
759
- /* @__PURE__ */ h("span", {
760
- className: "font-medium",
761
- children: [y("notifTemplates.metaId", "ID"), ":"]
762
- }),
763
- " ",
764
- /* @__PURE__ */ m("code", {
765
- className: "text-[10px]",
766
- children: w.id
767
- })
768
- ] }),
769
- /* @__PURE__ */ h("p", { children: [
770
- /* @__PURE__ */ h("span", {
771
- className: "font-medium",
772
- children: [y("notifTemplates.metaVersion", "Version"), ":"]
773
- }),
774
- " ",
775
- w.version
776
- ] }),
777
- /* @__PURE__ */ h("p", { children: [
778
- /* @__PURE__ */ h("span", {
779
- className: "font-medium",
780
- children: [y("notifTemplates.metaCreated", "Created"), ":"]
781
- }),
782
- " ",
783
- new Date(w.createdAt).toLocaleString(b || "en-US")
784
- ] }),
785
- /* @__PURE__ */ h("p", { children: [
786
- /* @__PURE__ */ h("span", {
787
- className: "font-medium",
788
- children: [y("notifTemplates.metaUpdated", "Updated"), ":"]
789
- }),
790
- " ",
791
- new Date(w.updatedAt).toLocaleString(b || "en-US")
792
- ] }),
793
- /* @__PURE__ */ h("p", { children: [
794
- /* @__PURE__ */ h("span", {
795
- className: "font-medium",
796
- children: [y("notifTemplates.metaEnabled", "Enabled"), ":"]
797
- }),
798
- " ",
799
- w.enabled ? y("notifTemplates.yes", "Yes") : y("notifTemplates.no", "No")
800
- ] })
801
- ]
802
- })]
803
- })]
799
+ children: [
800
+ U.length > 0 && /* @__PURE__ */ g("div", {
801
+ className: "p-3 border-b border-default/50",
802
+ children: [/* @__PURE__ */ g("p", {
803
+ className: "text-[10px] font-medium text-tertiary uppercase tracking-wider mb-2",
804
+ children: [
805
+ y("notifTemplates.variables", "Variables"),
806
+ " (",
807
+ U.length,
808
+ ")"
809
+ ]
810
+ }), /* @__PURE__ */ h("div", {
811
+ className: "space-y-1.5",
812
+ children: U.map((e, t) => /* @__PURE__ */ g("div", {
813
+ className: "flex items-center justify-between text-xs",
814
+ children: [/* @__PURE__ */ h("code", {
815
+ className: "text-primary font-mono",
816
+ children: `{{${e.name || "..."}}}`
817
+ }), /* @__PURE__ */ g("span", {
818
+ className: "text-tertiary",
819
+ children: [
820
+ e.type,
821
+ " =",
822
+ " ",
823
+ e.defaultValue || /* @__PURE__ */ h("em", { children: y("notifTemplates.noDefault", "no default") })
824
+ ]
825
+ })]
826
+ }, t))
827
+ })]
828
+ }),
829
+ S && w && M && /* @__PURE__ */ h("div", {
830
+ className: "p-3",
831
+ children: /* @__PURE__ */ h(ge, {
832
+ storageKey: "notifications.templateEditor.details",
833
+ label: y("notifTemplates.details", "Details"),
834
+ children: et
835
+ })
836
+ }),
837
+ S && w && !M && /* @__PURE__ */ g("div", {
838
+ className: "p-3",
839
+ children: [/* @__PURE__ */ h("p", {
840
+ className: "text-[10px] font-medium text-tertiary uppercase tracking-wider mb-1",
841
+ children: y("notifTemplates.metadata", "Metadata")
842
+ }), et]
843
+ })
844
+ ]
804
845
  })]
805
- }) : /* @__PURE__ */ m("div", {
846
+ }) : /* @__PURE__ */ h("div", {
806
847
  className: "flex-1 flex items-center justify-center",
807
- children: /* @__PURE__ */ h("div", {
848
+ children: /* @__PURE__ */ g("div", {
808
849
  className: "text-center",
809
850
  children: [
810
- /* @__PURE__ */ m(d, {
851
+ /* @__PURE__ */ h(d, {
811
852
  size: 32,
812
853
  className: "mx-auto text-tertiary mb-3"
813
854
  }),
814
- /* @__PURE__ */ m("p", {
855
+ /* @__PURE__ */ h("p", {
815
856
  className: "text-sm text-tertiary",
816
857
  children: y("notifTemplates.previewOff", "Preview is off")
817
858
  }),
818
- /* @__PURE__ */ m("button", {
859
+ /* @__PURE__ */ h("button", {
819
860
  type: "button",
820
861
  onClick: () => X(!0),
821
862
  className: "mt-2 text-xs text-accent-primary hover:underline",
@@ -829,7 +870,6 @@ function v() {
829
870
  ]
830
871
  });
831
872
  }
832
- //#endregion
833
- export { v as TemplateEditorPage };
873
+ export { x as TemplateEditorPage };
834
874
 
835
875
  //# sourceMappingURL=TemplateEditorPage.js.map