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