@webx-ui/module-notifications 0.2.1 → 0.3.0

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.
@@ -1,9 +1,9 @@
1
- import { defineComponent as le, ref as v, computed as p, openBlock as o, createBlock as f, unref as a, isRef as Se, withCtx as m, createVNode as g, createTextVNode as V, toDisplayString as B, createCommentVNode as _, createElementBlock as j, Fragment as L, renderList as ie, onMounted as We, onBeforeUnmount as $e, createSlots as Ne, createElementVNode as Ce } from "vue";
2
- import { useRoute as Te, useRouter as Ve, onBeforeRouteLeave as Be } from "vue-router";
3
- import { useModal as Ae, WxDialog as Me, WxText as te, WxFormItem as je, WxSelect as De, WxAlert as W, WxSpace as Le, WxButton as P, useLocales as qe, createModal as Ee, confirm as ne, WxSkeleton as Oe, WxBadge as Pe, WxActionBar as Ke, toast as y } from "@webx-ui/core";
4
- import { useAdmin as re, useTranslate as se, useErrorText as oe, provideHistorySubject as Re, useBodyKeys as Ue, WxScreenHead as ze, WxScreen as Je, WxSaveState as Fe } from "@webx-ui/module-admin";
5
- import { c as ue, u as ce, p as He, M as Ie, _ as Ge } from "./index-DIeEPPSh.js";
6
- const Qe = /* @__PURE__ */ le({
1
+ import { defineComponent as ne, ref as v, computed as f, openBlock as o, createBlock as m, unref as a, isRef as xe, withCtx as y, createVNode as b, createTextVNode as B, toDisplayString as A, createCommentVNode as _, createElementBlock as O, Fragment as D, renderList as le, onMounted as Se, onBeforeUnmount as We, createSlots as $e, createElementVNode as Ne } from "vue";
2
+ import { useRoute as Ce, useRouter as Te, onBeforeRouteLeave as Ve } from "vue-router";
3
+ import { useModal as Be, WxDialog as Ae, WxText as ae, WxFormItem as Me, WxSelect as je, WxAlert as W, WxSpace as Oe, WxButton as K, useLocales as De, createModal as Ee, confirm as te, WxSkeleton as Le, WxBadge as qe, WxActionBar as Pe, toast as p } from "@webx-ui/core";
4
+ import { useAdmin as ie, useTranslate as se, useErrorText as re, provideHistorySubject as Ke, useBodyKeys as Re, WxScreenHead as Ue, WxScreen as ze, WxSaveState as Je } from "@webx-ui/module-admin";
5
+ import { c as oe, u as ue, p as Fe, f as He, M as Ie, s as Ge, _ as Qe } from "./index-Bki9dkMd.js";
6
+ const Xe = /* @__PURE__ */ ne({
7
7
  name: "WxNotificationsTestDialog",
8
8
  __name: "TestDialog",
9
9
  props: {
@@ -11,20 +11,20 @@ const Qe = /* @__PURE__ */ le({
11
11
  values: {},
12
12
  recipients: { default: () => [] }
13
13
  },
14
- setup(q) {
15
- const w = q, { open: C, dismiss: h } = Ae(), k = ue(re());
16
- ce();
17
- const d = se("webx-notifications"), E = oe(), t = v(""), x = v(!1), r = v(null), S = v(null), l = p(() => [
14
+ setup(E) {
15
+ const w = E, { open: C, dismiss: h } = Be(), k = oe(ie());
16
+ ue();
17
+ const d = se("webx-notifications"), L = re(), t = v(""), x = v(!1), s = v(null), S = v(null), l = f(() => [
18
18
  { value: "", label: d("panel.test-everybody") },
19
19
  ...w.recipients
20
20
  ]);
21
21
  async function i() {
22
22
  x.value = !0, S.value = null;
23
23
  try {
24
- r.value = await k.test(w.channel, w.values, t.value === "" ? null : t.value);
24
+ s.value = await k.test(w.channel, w.values, t.value === "" ? null : t.value);
25
25
  } catch (u) {
26
26
  const c = u.body;
27
- S.value = c?.errors ? Object.values(c.errors).flat().join(" ") : E(u);
27
+ S.value = c?.errors ? Object.values(c.errors).flat().join(" ") : L(u);
28
28
  } finally {
29
29
  x.value = !1;
30
30
  }
@@ -36,31 +36,31 @@ const Qe = /* @__PURE__ */ le({
36
36
  error: u.error ?? (u.reason ? d(`module.reasons.${u.reason}`) : u.status)
37
37
  });
38
38
  }
39
- return (u, c) => (o(), f(a(Me), {
39
+ return (u, c) => (o(), m(a(Ae), {
40
40
  open: a(C),
41
- "onUpdate:open": c[2] || (c[2] = (b) => Se(C) ? C.value = b : null),
41
+ "onUpdate:open": c[2] || (c[2] = (g) => xe(C) ? C.value = g : null),
42
42
  title: a(d)("panel.test-title"),
43
43
  width: 480
44
44
  }, {
45
- footer: m(() => [
46
- g(a(Le), { size: "sm" }, {
47
- default: m(() => [
48
- g(a(P), {
45
+ footer: y(() => [
46
+ b(a(Oe), { size: "sm" }, {
47
+ default: y(() => [
48
+ b(a(K), {
49
49
  variant: "outline",
50
- onClick: c[1] || (c[1] = (b) => a(h)())
50
+ onClick: c[1] || (c[1] = (g) => a(h)())
51
51
  }, {
52
- default: m(() => [
53
- V(B(a(d)("panel.cancel")), 1)
52
+ default: y(() => [
53
+ B(A(a(d)("panel.cancel")), 1)
54
54
  ]),
55
55
  _: 1
56
56
  }),
57
- g(a(P), {
57
+ b(a(K), {
58
58
  type: "primary",
59
59
  loading: x.value,
60
60
  onClick: i
61
61
  }, {
62
- default: m(() => [
63
- V(B(a(d)("panel.test-send")), 1)
62
+ default: y(() => [
63
+ B(A(a(d)("panel.test-send")), 1)
64
64
  ]),
65
65
  _: 1
66
66
  }, 8, ["loading"])
@@ -68,80 +68,80 @@ const Qe = /* @__PURE__ */ le({
68
68
  _: 1
69
69
  })
70
70
  ]),
71
- default: m(() => [
72
- g(a(te), {
71
+ default: y(() => [
72
+ b(a(ae), {
73
73
  size: "sm",
74
74
  tone: "muted"
75
75
  }, {
76
- default: m(() => [
77
- V(B(a(d)("panel.test-help")), 1)
76
+ default: y(() => [
77
+ B(A(a(d)("panel.test-help")), 1)
78
78
  ]),
79
79
  _: 1
80
80
  }),
81
- g(a(je), {
81
+ b(a(Me), {
82
82
  label: a(d)("panel.test-to")
83
83
  }, {
84
- default: m(() => [
85
- g(a(De), {
84
+ default: y(() => [
85
+ b(a(je), {
86
86
  modelValue: t.value,
87
- "onUpdate:modelValue": c[0] || (c[0] = (b) => t.value = b),
87
+ "onUpdate:modelValue": c[0] || (c[0] = (g) => t.value = g),
88
88
  options: l.value,
89
89
  disabled: x.value
90
90
  }, null, 8, ["modelValue", "options", "disabled"])
91
91
  ]),
92
92
  _: 1
93
93
  }, 8, ["label"]),
94
- S.value ? (o(), f(a(W), {
94
+ S.value ? (o(), m(a(W), {
95
95
  key: 0,
96
96
  type: "danger",
97
97
  variant: "soft",
98
98
  description: S.value
99
99
  }, null, 8, ["description"])) : _("", !0),
100
- r.value ? (o(), j(L, { key: 1 }, [
101
- r.value.length === 0 ? (o(), f(a(te), {
100
+ s.value ? (o(), O(D, { key: 1 }, [
101
+ s.value.length === 0 ? (o(), m(a(ae), {
102
102
  key: 0,
103
103
  size: "sm",
104
104
  tone: "muted"
105
105
  }, {
106
- default: m(() => [
107
- V(B(a(d)("panel.test-none")), 1)
106
+ default: y(() => [
107
+ B(A(a(d)("panel.test-none")), 1)
108
108
  ]),
109
109
  _: 1
110
110
  })) : _("", !0),
111
- (o(!0), j(L, null, ie(r.value, (b, $) => (o(), f(a(W), {
111
+ (o(!0), O(D, null, le(s.value, (g, $) => (o(), m(a(W), {
112
112
  key: $,
113
- type: b.status === "sent" ? "success" : "danger",
113
+ type: g.status === "sent" ? "success" : "danger",
114
114
  variant: "soft",
115
- description: N(b)
115
+ description: N(g)
116
116
  }, null, 8, ["type", "description"]))), 128))
117
117
  ], 64)) : _("", !0)
118
118
  ]),
119
119
  _: 1
120
120
  }, 8, ["open", "title"]));
121
121
  }
122
- }), Xe = { class: "wx-notifications-channel__body" }, Ye = /* @__PURE__ */ le({
122
+ }), Ye = { class: "wx-notifications-channel__body" }, Ze = /* @__PURE__ */ ne({
123
123
  __name: "ChannelPage",
124
124
  props: {
125
125
  base: { default: "/notifications" }
126
126
  },
127
- setup(q) {
128
- const w = q, C = re(), h = ue(C), k = Te(), d = Ve(), E = qe();
129
- ce();
130
- const t = se("webx-notifications"), x = oe(), r = v(
127
+ setup(E) {
128
+ const w = E, C = ie(), h = oe(C), k = Ce(), d = Te(), L = De();
129
+ ue();
130
+ const t = se("webx-notifications"), x = re(), s = v(
131
131
  typeof k.params.id == "string" && k.params.id !== "" ? Number(k.params.id) : null
132
- ), S = v(null), l = v(null), i = v({}), N = v(""), u = v([]), c = v({}), b = v(!0), $ = v(!1), O = v(!1), K = He(S, i, r);
133
- Re({ id: p(() => l.value?.id ?? null) });
134
- const T = p(() => C.can("notifications.manage")), R = p(() => JSON.stringify(i.value)), A = p(() => N.value !== "" && R.value !== N.value), de = p(() => $.value ? "saving" : A.value || r.value === null ? "unsaved" : "saved"), U = p(() => {
132
+ ), S = v(null), l = v(null), i = v({}), N = v(""), u = v([]), c = v({}), g = v(!0), $ = v(!1), q = v(!1), P = Fe(S, i, s);
133
+ Ke({ id: f(() => l.value?.id ?? null) });
134
+ const T = f(() => C.can("notifications.manage")), R = f(() => JSON.stringify(i.value)), M = f(() => N.value !== "" && R.value !== N.value), ce = f(() => $.value ? "saving" : M.value || s.value === null ? "unsaved" : "saved"), U = f(() => {
135
135
  const e = typeof i.value.name == "string" ? i.value.name.trim() : "";
136
- return e !== "" ? e : r.value === null ? t("panel.new") : t("panel.untitled");
137
- }), z = p(
136
+ return e !== "" ? e : s.value === null ? t("panel.new") : t("panel.untitled");
137
+ }), z = f(
138
138
  () => Array.isArray(i.value.forget) ? i.value.forget : []
139
- ), J = p(
140
- () => (K.provider.value?.fields ?? []).filter((e) => e.secret).map((e) => ({
139
+ ), J = f(
140
+ () => (P.provider.value?.fields ?? []).filter((e) => e.secret).map((e) => ({
141
141
  field: e,
142
142
  set: l.value?.credentials_set[e.name] === !0 && !z.value.includes(e.name)
143
143
  }))
144
- ), ve = p(() => [
144
+ ), de = f(() => [
145
145
  { op: "set", target: "provider", props: { disabled: !0 } },
146
146
  ...J.value.filter((e) => e.set).map((e) => ({
147
147
  op: "set",
@@ -153,52 +153,56 @@ const Qe = /* @__PURE__ */ le({
153
153
  function F(e) {
154
154
  l.value = e.channel, i.value = e.values, N.value = JSON.stringify(e.values), u.value = e.warnings;
155
155
  }
156
- function pe(e) {
157
- const n = typeof k.query.provider == "string" ? k.query.provider : "email", s = typeof k.query.event == "string" && k.query.event !== "" ? k.query.event : null, D = e.events.find((M) => M.key === s), Z = D?.sample[n] ?? D?.sample["*"], ee = E.list.value[0]?.code ?? "en", ae = {};
158
- for (const M of e.providers.find((xe) => xe.key === n)?.fields ?? [])
159
- ae[M.name] = M.secret ? "" : M.default ?? "";
156
+ function ve(e) {
157
+ const n = typeof k.query.provider == "string" ? k.query.provider : "email", r = typeof k.query.event == "string" && k.query.event !== "" ? k.query.event : null, V = Ge(
158
+ e.events.find((j) => j.key === r),
159
+ n
160
+ ), Z = L.list.value[0]?.code ?? "en", ee = {};
161
+ for (const j of e.providers.find((we) => we.key === n)?.fields ?? [])
162
+ ee[j.name] = j.secret ? "" : j.default ?? "";
160
163
  return {
161
164
  name: "",
162
165
  provider: n,
163
- event: s,
166
+ event: r,
164
167
  enabled: !1,
165
168
  recipients: [],
166
- ...ae,
167
- template: { [ee]: Z?.template ?? "" },
168
- subject: { [ee]: Z?.subject ?? "" }
169
+ ...ee,
170
+ template: V ? { ...V.template } : { [Z]: "" },
171
+ subject: V?.subject ? { ...V.subject } : { [Z]: "" }
169
172
  };
170
173
  }
174
+ He(P, g, () => p.info(t("panel.default-inserted")));
171
175
  const H = v([]);
172
- async function fe() {
173
- b.value = !0;
176
+ async function pe() {
177
+ g.value = !0;
174
178
  try {
175
179
  const [e, n] = await Promise.all([
176
180
  h.meta(),
177
- r.value === null ? Promise.resolve(null) : h.get(r.value)
181
+ s.value === null ? Promise.resolve(null) : h.get(s.value)
178
182
  ]);
179
183
  if (S.value = e, n === null) {
180
- const s = pe(e);
181
- i.value = s, N.value = JSON.stringify(s);
184
+ const r = ve(e);
185
+ i.value = r, N.value = JSON.stringify(r);
182
186
  } else
183
187
  F(n);
184
188
  } catch (e) {
185
- y.danger(x(e)), d.push(w.base);
189
+ p.danger(x(e)), d.push(w.base);
186
190
  } finally {
187
- b.value = !1;
191
+ g.value = !1;
188
192
  }
189
193
  i.value.provider === "email" && T.value && h.administrators().then((e) => H.value = e).catch(() => {
190
194
  });
191
195
  }
192
196
  function I(e) {
193
197
  const n = e.body;
194
- n?.errors ? (c.value = n.errors, y.danger(t("panel.save-failed"))) : y.danger(x(e));
198
+ n?.errors ? (c.value = n.errors, p.danger(t("panel.save-failed"))) : p.danger(x(e));
195
199
  }
196
200
  async function G() {
197
201
  if (!($.value || !T.value)) {
198
202
  $.value = !0, c.value = {};
199
203
  try {
200
- const e = r.value === null, n = e ? await h.create(i.value) : await h.save(r.value, i.value);
201
- F(n), n.warnings.length > 0 ? y.warning(t("panel.saved-warning", { warning: n.warnings.join(" ") })) : y.success(t("panel.saved")), e && (r.value = n.channel.id, d.replace(`${w.base}/channels/${n.channel.id}`));
204
+ const e = s.value === null, n = e ? await h.create(i.value) : await h.save(s.value, i.value);
205
+ F(n), n.warnings.length > 0 ? p.warning(t("panel.saved-warning", { warning: n.warnings.join(" ") })) : p.success(t("panel.saved")), e && (s.value = n.channel.id, d.replace(`${w.base}/channels/${n.channel.id}`));
202
206
  } catch (e) {
203
207
  I(e);
204
208
  } finally {
@@ -206,41 +210,41 @@ const Qe = /* @__PURE__ */ le({
206
210
  }
207
211
  }
208
212
  }
209
- async function me() {
210
- O.value = !0;
213
+ async function fe() {
214
+ q.value = !0;
211
215
  try {
212
- const e = await h.check(r.value, i.value);
213
- e.ok ? y.success(e.message || t("panel.check-ok")) : y.warning(e.message);
216
+ const e = await h.check(s.value, i.value);
217
+ e.ok ? p.success(e.message || t("panel.check-ok")) : p.warning(e.message);
214
218
  } catch (e) {
215
219
  I(e);
216
220
  } finally {
217
- O.value = !1;
221
+ q.value = !1;
218
222
  }
219
223
  }
220
- const ye = Ee(Qe), ge = p(() => (Array.isArray(i.value.recipients) ? i.value.recipients : []).flatMap((n) => {
224
+ const me = Ee(Xe), ye = f(() => (Array.isArray(i.value.recipients) ? i.value.recipients : []).flatMap((n) => {
221
225
  if (n.chat_id)
222
226
  return [
223
227
  { value: n.chat_id, label: n.label ? `${n.label} · ${n.chat_id}` : n.chat_id }
224
228
  ];
225
229
  if (n.email) return [{ value: n.email, label: n.email }];
226
- const s = H.value.find((D) => D.id === n.admin_id);
227
- return s ? [{ value: s.email, label: `${s.name} · ${s.email}` }] : [];
230
+ const r = H.value.find((V) => V.id === n.admin_id);
231
+ return r ? [{ value: r.email, label: `${r.name} · ${r.email}` }] : [];
228
232
  }));
229
- async function be() {
230
- await ye({ channel: r.value, values: i.value, recipients: ge.value });
233
+ async function ge() {
234
+ await me({ channel: s.value, values: i.value, recipients: ye.value });
231
235
  }
232
- async function he() {
233
- if (r.value !== null)
236
+ async function be() {
237
+ if (s.value !== null)
234
238
  try {
235
- const e = await h.copy(r.value);
236
- y.success(t("panel.copied", { name: e.channel.name })), d.push(`${w.base}/channels/${e.channel.id}`);
239
+ const e = await h.copy(s.value);
240
+ p.success(t("panel.copied", { name: e.channel.name })), d.push(`${w.base}/channels/${e.channel.id}`);
237
241
  } catch (e) {
238
- y.danger(x(e));
242
+ p.danger(x(e));
239
243
  }
240
244
  }
241
- async function ke() {
245
+ async function he() {
242
246
  const e = l.value;
243
- if (!(!e || !await ne({
247
+ if (!(!e || !await te({
244
248
  title: t("panel.delete-title", { title: U.value }),
245
249
  message: t("panel.delete-text"),
246
250
  confirmText: t("panel.delete"),
@@ -248,45 +252,45 @@ const Qe = /* @__PURE__ */ le({
248
252
  tone: "danger"
249
253
  })))
250
254
  try {
251
- await h.remove(e.id), y.success(t("panel.deleted")), N.value = R.value, d.push(w.base);
252
- } catch (s) {
253
- y.danger(x(s));
255
+ await h.remove(e.id), p.success(t("panel.deleted")), N.value = R.value, d.push(w.base);
256
+ } catch (r) {
257
+ p.danger(x(r));
254
258
  }
255
259
  }
256
- function _e(e, n) {
257
- i.value = { ...i.value, forget: [...z.value, e], [e]: "" }, y.info(t("panel.forgotten", { field: n }));
260
+ function ke(e, n) {
261
+ i.value = { ...i.value, forget: [...z.value, e], [e]: "" }, p.info(t("panel.forgotten", { field: n }));
258
262
  }
259
263
  function Q(e) {
260
- A.value && e.preventDefault();
264
+ M.value && e.preventDefault();
261
265
  }
262
266
  function X(e) {
263
- (e.ctrlKey || e.metaKey) && e.key.toLowerCase() === "s" && (e.preventDefault(), (A.value || r.value === null) && G());
267
+ (e.ctrlKey || e.metaKey) && e.key.toLowerCase() === "s" && (e.preventDefault(), (M.value || s.value === null) && G());
264
268
  }
265
- Ue(X), We(() => {
266
- fe(), window.addEventListener("beforeunload", Q);
267
- }), $e(() => {
269
+ Re(X), Se(() => {
270
+ pe(), window.addEventListener("beforeunload", Q);
271
+ }), We(() => {
268
272
  window.removeEventListener("beforeunload", Q);
269
- }), Be(async () => !A.value || !T.value ? !0 : await ne({
273
+ }), Ve(async () => !M.value || !T.value ? !0 : await te({
270
274
  title: t("panel.leave-title"),
271
275
  message: t("panel.leave-text"),
272
276
  confirmText: t("panel.leave"),
273
277
  cancelText: t("panel.cancel"),
274
278
  tone: "danger"
275
279
  }));
276
- const we = p(() => {
280
+ const _e = f(() => {
277
281
  if (!T.value) return [];
278
282
  const e = [
279
283
  {
280
284
  key: "check",
281
285
  label: t("panel.check"),
282
286
  icon: "check-circle",
283
- loading: O.value,
287
+ loading: q.value,
284
288
  run: () => {
285
- me();
289
+ fe();
286
290
  }
287
291
  },
288
292
  { key: "test", label: t("panel.test"), icon: "send", run: () => {
289
- be();
293
+ ge();
290
294
  } }
291
295
  ];
292
296
  l.value !== null && e.push({
@@ -295,16 +299,16 @@ const Qe = /* @__PURE__ */ le({
295
299
  icon: "copy",
296
300
  menu: !0,
297
301
  run: () => {
298
- he();
302
+ be();
299
303
  }
300
304
  });
301
- for (const n of J.value.filter((s) => s.set))
305
+ for (const n of J.value.filter((r) => r.set))
302
306
  e.push({
303
307
  key: `forget-${n.field.name}`,
304
308
  label: t("panel.forget", { field: n.field.label }),
305
309
  icon: "unlock",
306
310
  menu: !0,
307
- run: () => _e(n.field.name, n.field.label)
311
+ run: () => ke(n.field.name, n.field.label)
308
312
  });
309
313
  return l.value !== null && e.push({
310
314
  key: "delete",
@@ -312,33 +316,33 @@ const Qe = /* @__PURE__ */ le({
312
316
  icon: "trash",
313
317
  danger: !0,
314
318
  run: () => {
315
- ke();
319
+ he();
316
320
  }
317
321
  }), e;
318
- }), Y = p(() => S.value?.environment ?? "production");
319
- return (e, n) => (o(), j("div", {
322
+ }), Y = f(() => S.value?.environment ?? "production");
323
+ return (e, n) => (o(), O("div", {
320
324
  class: "wx-notifications-channel",
321
325
  onKeydown: X
322
326
  }, [
323
- b.value ? (o(), f(a(Oe), {
327
+ g.value ? (o(), m(a(Le), {
324
328
  key: 0,
325
329
  class: "wx-notifications-channel__ghost",
326
330
  title: "",
327
331
  rows: 8
328
- })) : (o(), j(L, { key: 1 }, [
329
- g(a(ze), {
332
+ })) : (o(), O(D, { key: 1 }, [
333
+ b(a(Ue), {
330
334
  back: w.base,
331
335
  "back-label": a(t)("panel.channels"),
332
336
  title: U.value,
333
- subtitle: l.value?.provider_label ?? a(K).provider.value?.label,
334
- actions: we.value
335
- }, Ne({ _: 2 }, [
337
+ subtitle: l.value?.provider_label ?? a(P).provider.value?.label,
338
+ actions: _e.value
339
+ }, $e({ _: 2 }, [
336
340
  l.value && !l.value.enabled ? {
337
341
  name: "title-after",
338
- fn: m(() => [
339
- g(a(Pe), { dot: "" }, {
340
- default: m(() => [
341
- V(B(a(t)("panel.off")), 1)
342
+ fn: y(() => [
343
+ b(a(qe), { dot: "" }, {
344
+ default: y(() => [
345
+ B(A(a(t)("panel.off")), 1)
342
346
  ]),
343
347
  _: 1
344
348
  })
@@ -346,71 +350,71 @@ const Qe = /* @__PURE__ */ le({
346
350
  key: "0"
347
351
  } : void 0
348
352
  ]), 1032, ["back", "back-label", "title", "subtitle", "actions"]),
349
- Y.value !== "production" ? (o(), f(a(W), {
353
+ Y.value !== "production" ? (o(), m(a(W), {
350
354
  key: 0,
351
355
  type: "info",
352
356
  variant: "soft",
353
357
  description: a(t)("panel.environment", { environment: Y.value })
354
358
  }, null, 8, ["description"])) : _("", !0),
355
- S.value?.mode === "after_response" ? (o(), f(a(W), {
359
+ S.value?.mode === "after_response" ? (o(), m(a(W), {
356
360
  key: 1,
357
361
  type: "warning",
358
362
  variant: "soft",
359
363
  description: a(t)("panel.mode-after-response")
360
364
  }, null, 8, ["description"])) : _("", !0),
361
- l.value && !l.value.provider_declared ? (o(), f(a(W), {
365
+ l.value && !l.value.provider_declared ? (o(), m(a(W), {
362
366
  key: 2,
363
367
  type: "danger",
364
368
  title: a(t)("panel.provider-undeclared"),
365
369
  description: a(t)("panel.provider-undeclared-text", { provider: l.value.provider })
366
370
  }, null, 8, ["title", "description"])) : _("", !0),
367
- l.value && !l.value.event_declared ? (o(), f(a(W), {
371
+ l.value && !l.value.event_declared ? (o(), m(a(W), {
368
372
  key: 3,
369
373
  type: "warning",
370
374
  title: a(t)("panel.event-undeclared"),
371
375
  description: a(t)("panel.event-undeclared-text", { event: l.value.event ?? "" })
372
376
  }, null, 8, ["title", "description"])) : _("", !0),
373
- l.value && !l.value.credentials_readable ? (o(), f(a(W), {
377
+ l.value && !l.value.credentials_readable ? (o(), m(a(W), {
374
378
  key: 4,
375
379
  type: "danger",
376
380
  description: a(t)("panel.unreadable")
377
381
  }, null, 8, ["description"])) : _("", !0),
378
- l.value?.copied_from ? (o(), f(a(W), {
382
+ l.value?.copied_from ? (o(), m(a(W), {
379
383
  key: 5,
380
384
  type: "info",
381
385
  variant: "soft",
382
386
  description: a(t)("panel.copied-from", { id: String(l.value.copied_from) })
383
387
  }, null, 8, ["description"])) : _("", !0),
384
- (o(!0), j(L, null, ie(u.value, (s) => (o(), f(a(W), {
385
- key: s,
388
+ (o(!0), O(D, null, le(u.value, (r) => (o(), m(a(W), {
389
+ key: r,
386
390
  type: "warning",
387
- description: s
391
+ description: r
388
392
  }, null, 8, ["description"]))), 128)),
389
- Ce("div", Xe, [
390
- g(a(Je), {
393
+ Ne("div", Ye, [
394
+ b(a(ze), {
391
395
  modelValue: i.value,
392
- "onUpdate:modelValue": n[0] || (n[0] = (s) => i.value = s),
396
+ "onUpdate:modelValue": n[0] || (n[0] = (r) => i.value = r),
393
397
  class: "wx-notifications-channel__form",
394
398
  name: "notifications.channel",
395
399
  errors: c.value,
396
- patch: ve.value,
400
+ patch: de.value,
397
401
  disabled: !T.value || $.value
398
402
  }, null, 8, ["modelValue", "errors", "patch", "disabled"]),
399
- g(Ie, { class: "wx-notifications-channel__preview" })
403
+ b(Ie, { class: "wx-notifications-channel__preview" })
400
404
  ]),
401
- T.value ? (o(), f(a(Ke), { key: 6 }, {
402
- state: m(() => [
403
- g(a(Fe), { state: de.value }, null, 8, ["state"])
405
+ T.value ? (o(), m(a(Pe), { key: 6 }, {
406
+ state: y(() => [
407
+ b(a(Je), { state: ce.value }, null, 8, ["state"])
404
408
  ]),
405
- default: m(() => [
406
- g(a(P), {
409
+ default: y(() => [
410
+ b(a(K), {
407
411
  type: "primary",
408
412
  loading: $.value,
409
- disabled: !A.value && r.value !== null,
413
+ disabled: !M.value && s.value !== null,
410
414
  onClick: G
411
415
  }, {
412
- default: m(() => [
413
- V(B(a(t)("panel.save")), 1)
416
+ default: y(() => [
417
+ B(A(a(t)("panel.save")), 1)
414
418
  ]),
415
419
  _: 1
416
420
  }, 8, ["loading", "disabled"])
@@ -420,8 +424,8 @@ const Qe = /* @__PURE__ */ le({
420
424
  ], 64))
421
425
  ], 32));
422
426
  }
423
- }), la = /* @__PURE__ */ Ge(Ye, [["__scopeId", "data-v-b5c7b69a"]]);
427
+ }), ia = /* @__PURE__ */ Qe(Ze, [["__scopeId", "data-v-d3c11d46"]]);
424
428
  export {
425
- la as default
429
+ ia as default
426
430
  };
427
- //# sourceMappingURL=ChannelPage-C47YoMPO.js.map
431
+ //# sourceMappingURL=ChannelPage-DB6cyt1W.js.map