@webx-ui/module-inbox 0.5.7 → 0.6.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.
package/dist/index.js CHANGED
@@ -1,10 +1,10 @@
1
- import { defineComponent as ae, useModel as Ue, computed as S, unref as e, openBlock as u, createBlock as w, withCtx as a, createVNode as t, mergeModels as Le, ref as F, watch as Ce, isRef as ne, createElementVNode as G, createElementBlock as j, Fragment as ee, createCommentVNode as H, createTextVNode as z, toDisplayString as V, renderList as ke, createSlots as Ne, onMounted as fl, reactive as bl, useTemplateRef as il, normalizeClass as ll } from "vue";
2
- import { useRoute as Oe, useRouter as Pe } from "vue-router";
3
- import { useAdmin as oe, useTranslate as te, useErrorText as be, WxRowMenu as Fe, WxScreenHead as Qe, rowMenuWidth as hl, WxDate as De, WxFilterChips as yl, WxListScreen as ul, WxNotes as gl } from "@webx-ui/module-admin";
4
- import { useLocales as xe, WxLocales as xl, WxRichText as tl, useModal as Ee, WxDialog as Re, WxFormItem as B, WxSelect as ve, WxInput as X, WxText as J, WxAction as Ve, WxButton as le, WxIcon as $e, WxInputNumber as we, WxDatePicker as Ze, WxTagsInput as _l, WxCheckbox as he, WxSpace as qe, toast as P, createModal as Be, WxCard as se, WxEmpty as He, WxSortableList as Je, WxBadge as Se, localizedValue as fe, confirm as ze, WxSwitch as rl, WxTable as dl, WxAlert as Me, WxSkeleton as We, WxTabs as Xe, WxTab as ge, WxActionBar as wl, WxTextarea as kl, WxRadioGroup as Vl, WxCheckboxGroup as $l, useElementWidth as Ul, WxEntityCard as Sl, WxAvatar as al, WxTooltip as Cl, WxListDetail as zl, WxIndicator as nl, WxDescriptions as sl, WxDescriptionsItem as Ie, WxFileCard as Tl, WxTimeline as Fl, WxTimelineItem as Wl } from "@webx-ui/core";
5
- const cl = /* @__PURE__ */ ae({
1
+ import { defineComponent as ne, useModel as Se, computed as U, unref as e, openBlock as o, createBlock as w, withCtx as a, createVNode as t, mergeModels as Ee, ref as q, watch as Te, isRef as se, createElementVNode as K, createElementBlock as G, Fragment as ee, createCommentVNode as P, createTextVNode as S, toDisplayString as V, renderList as ge, createSlots as Oe, onMounted as yl, reactive as hl, useTemplateRef as cl, normalizeClass as sl } from "vue";
2
+ import { useRoute as Re, useRouter as Be } from "vue-router";
3
+ import { useAdmin as ie, useTranslate as ae, useErrorText as ye, WxRowMenu as ze, WxScreenHead as tl, rowMenuWidth as gl, WxDate as Pe, WxFilterChips as xl, WxListScreen as pl, WxNotes as _l } from "@webx-ui/module-admin";
4
+ import { useLocales as we, WxLocales as wl, WxRichText as ol, useModal as He, WxDialog as Ge, WxFormItem as H, WxSelect as fe, WxInput as le, WxText as Q, WxAction as $e, WxButton as te, WxIcon as _e, WxInputNumber as Ve, WxDatePicker as ll, WxTagsInput as kl, WxCheckbox as he, WxSpace as Ae, toast as L, createModal as je, WxCard as oe, WxEmpty as Ke, WxSortableList as al, WxBadge as Ue, localizedValue as be, confirm as Ce, WxSwitch as ml, WxTable as vl, WxAlert as Fe, WxSkeleton as We, WxTabs as nl, WxTab as xe, WxActionBar as Vl, WxTextarea as $l, WxRadioGroup as Ul, WxCheckboxGroup as Sl, useElementWidth as Tl, WxEntityCard as Cl, WxAvatar as il, WxTooltip as ql, WxListDetail as zl, WxIndicator as ul, WxDescriptions as rl, WxDescriptionsItem as Me, WxFileCard as Fl, WxTimeline as Wl, WxTimelineItem as Al } from "@webx-ui/core";
5
+ const fl = /* @__PURE__ */ ne({
6
6
  __name: "LocalizedRichText",
7
- props: /* @__PURE__ */ Le({
7
+ props: /* @__PURE__ */ Ee({
8
8
  placeholder: { default: void 0 },
9
9
  minHeight: { default: "160px" }
10
10
  }, {
@@ -12,99 +12,100 @@ const cl = /* @__PURE__ */ ae({
12
12
  modelModifiers: {}
13
13
  }),
14
14
  emits: ["update:modelValue"],
15
- setup(r) {
16
- const s = Ue(r, "modelValue"), o = r, f = xe(), n = S(() => {
17
- const m = f.active.value;
18
- return f.list.value.some((U) => U.code === m) ? m : f.list.value[0]?.code ?? "";
19
- }), d = S({
15
+ setup(i) {
16
+ const s = Se(i, "modelValue"), u = i, v = we(), n = U(() => {
17
+ const f = v.active.value;
18
+ return v.list.value.some((T) => T.code === f) ? f : v.list.value[0]?.code ?? "";
19
+ }), c = U({
20
20
  get: () => {
21
- const m = s.value;
22
- return typeof m == "string" ? n.value === "" || n.value === f.list.value[0]?.code ? m : "" : m[n.value] ?? "";
21
+ const f = s.value;
22
+ return typeof f == "string" ? n.value === "" || n.value === v.list.value[0]?.code ? f : "" : f[n.value] ?? "";
23
23
  },
24
- set: (m) => {
24
+ set: (f) => {
25
25
  if (n.value === "") {
26
- s.value = m;
26
+ s.value = f;
27
27
  return;
28
28
  }
29
29
  const l = typeof s.value == "string" ? { [n.value]: s.value } : s.value;
30
- s.value = { ...l, [n.value]: m };
30
+ s.value = { ...l, [n.value]: f };
31
31
  }
32
32
  });
33
- return (m, l) => e(f).list.value.length > 0 ? (u(), w(e(xl), { key: 0 }, {
33
+ return (f, l) => e(v).list.value.length > 0 ? (o(), w(e(wl), { key: 0 }, {
34
34
  default: a(() => [
35
- t(e(tl), {
36
- modelValue: d.value,
37
- "onUpdate:modelValue": l[0] || (l[0] = (U) => d.value = U),
38
- placeholder: o.placeholder,
39
- "min-height": o.minHeight
35
+ t(e(ol), {
36
+ modelValue: c.value,
37
+ "onUpdate:modelValue": l[0] || (l[0] = (T) => c.value = T),
38
+ placeholder: u.placeholder,
39
+ "min-height": u.minHeight
40
40
  }, null, 8, ["modelValue", "placeholder", "min-height"])
41
41
  ]),
42
42
  _: 1
43
- })) : (u(), w(e(tl), {
43
+ })) : (o(), w(e(ol), {
44
44
  key: 1,
45
- modelValue: d.value,
46
- "onUpdate:modelValue": l[1] || (l[1] = (U) => d.value = U),
47
- placeholder: o.placeholder,
48
- "min-height": o.minHeight
45
+ modelValue: c.value,
46
+ "onUpdate:modelValue": l[1] || (l[1] = (T) => c.value = T),
47
+ placeholder: u.placeholder,
48
+ "min-height": u.minHeight
49
49
  }, null, 8, ["modelValue", "placeholder", "min-height"]));
50
50
  }
51
51
  });
52
- function de(r) {
53
- const s = `${r.apiPath}/inbox`, o = (n) => n.data, f = () => {
52
+ function ce(i) {
53
+ const s = `${i.apiPath}/inbox`, u = (n) => n.data, v = () => {
54
54
  };
55
55
  return {
56
- forms: () => r.http.get(`${s}/forms`).then(o),
57
- form: (n) => r.http.get(`${s}/forms/${n}`).then(o),
58
- createForm: (n) => r.http.post(`${s}/forms`, n).then(o),
59
- saveForm: (n, d) => r.http.put(`${s}/forms/${n}`, d).then(o),
60
- removeForm: (n) => r.http.delete(`${s}/forms/${n}`).then(f),
61
- duplicateForm: (n) => r.http.post(`${s}/forms/${n}/duplicate`, {}).then(o),
62
- sortForms: (n) => r.http.post(`${s}/forms/sorting`, { ids: n }).then(f),
63
- fields: (n) => r.http.get(`${s}/forms/${n}/fields`).then(o),
64
- createField: (n, d) => r.http.post(`${s}/forms/${n}/fields`, d).then(o),
65
- saveField: (n, d) => r.http.put(`${s}/fields/${n}`, d).then(o),
66
- removeField: (n) => r.http.delete(`${s}/fields/${n}`).then(f),
67
- sortFields: (n, d) => r.http.post(`${s}/forms/${n}/fields/sorting`, { ids: d }).then(f),
68
- statuses: () => r.http.get(`${s}/statuses`).then(o),
69
- createStatus: (n) => r.http.post(`${s}/statuses`, n).then(o),
70
- saveStatus: (n, d) => r.http.put(`${s}/statuses/${n}`, d).then(o),
71
- removeStatus: (n) => r.http.delete(`${s}/statuses/${n}`).then(f),
72
- sortStatuses: (n) => r.http.post(`${s}/statuses/sorting`, { ids: n }).then(f),
73
- recipients: () => r.http.get(`${s}/recipients`).then(o),
74
- submissions: (n, d = {}) => r.http.get(`${s}/forms/${n}/submissions`, { query: Ye(d) }).then((m) => ({
75
- ...m.meta,
76
- data: m.data,
77
- columns: m.columns,
78
- counts: m.counts,
56
+ forms: () => i.http.get(`${s}/forms`).then(u),
57
+ form: (n) => i.http.get(`${s}/forms/${n}`).then(u),
58
+ createForm: (n) => i.http.post(`${s}/forms`, n).then(u),
59
+ saveForm: (n, c) => i.http.put(`${s}/forms/${n}`, c).then(u),
60
+ removeForm: (n) => i.http.delete(`${s}/forms/${n}`).then(v),
61
+ duplicateForm: (n) => i.http.post(`${s}/forms/${n}/duplicate`, {}).then(u),
62
+ sortForms: (n) => i.http.post(`${s}/forms/sorting`, { ids: n }).then(v),
63
+ fields: (n) => i.http.get(`${s}/forms/${n}/fields`).then(u),
64
+ createField: (n, c) => i.http.post(`${s}/forms/${n}/fields`, c).then(u),
65
+ saveField: (n, c) => i.http.put(`${s}/fields/${n}`, c).then(u),
66
+ removeField: (n) => i.http.delete(`${s}/fields/${n}`).then(v),
67
+ sortFields: (n, c) => i.http.post(`${s}/forms/${n}/fields/sorting`, { ids: c }).then(v),
68
+ statuses: () => i.http.get(`${s}/statuses`).then(u),
69
+ createStatus: (n) => i.http.post(`${s}/statuses`, n).then(u),
70
+ saveStatus: (n, c) => i.http.put(`${s}/statuses/${n}`, c).then(u),
71
+ removeStatus: (n) => i.http.delete(`${s}/statuses/${n}`).then(v),
72
+ sortStatuses: (n) => i.http.post(`${s}/statuses/sorting`, { ids: n }).then(v),
73
+ recipients: () => i.http.get(`${s}/recipients`).then(u),
74
+ submissions: (n, c = {}) => i.http.get(`${s}/forms/${n}/submissions`, { query: el(c) }).then((f) => ({
75
+ ...f.meta,
76
+ data: f.data,
77
+ columns: f.columns,
78
+ counts: f.counts,
79
79
  // Optional on the wire: a server from before placements answers without them.
80
- placements: m.placements ?? []
80
+ placements: f.placements ?? []
81
81
  })),
82
- submission: (n, d = {}) => r.http.get(`${s}/submissions/${n}`, { query: Ye(d) }).then(o),
83
- createSubmission: (n, d) => r.http.post(`${s}/forms/${n}/submissions`, { fields: d }).then(o),
84
- saveSubmission: (n, d) => r.http.put(`${s}/submissions/${n}`, d).then(o),
85
- removeSubmission: (n) => r.http.delete(`${s}/submissions/${n}`).then(f),
86
- massSubmissions: (n) => r.http.post(`${s}/submissions/mass`, n).then(o),
87
- exportUrl: (n, d = {}) => {
88
- const m = new URLSearchParams();
89
- for (const [U, p] of Object.entries(Ye(d)))
90
- p != null && p !== "" && m.set(U, String(p));
91
- const l = m.toString();
82
+ submission: (n, c = {}) => i.http.get(`${s}/submissions/${n}`, { query: el(c) }).then(u),
83
+ createSubmission: (n, c) => i.http.post(`${s}/forms/${n}/submissions`, { fields: c }).then(u),
84
+ saveSubmission: (n, c) => i.http.put(`${s}/submissions/${n}`, c).then(u),
85
+ removeSubmission: (n) => i.http.delete(`${s}/submissions/${n}`).then(v),
86
+ notifySubmission: (n) => i.http.post(`${s}/submissions/${n}/notify`).then(u),
87
+ massSubmissions: (n) => i.http.post(`${s}/submissions/mass`, n).then(u),
88
+ exportUrl: (n, c = {}) => {
89
+ const f = new URLSearchParams();
90
+ for (const [T, p] of Object.entries(el(c)))
91
+ p != null && p !== "" && f.set(T, String(p));
92
+ const l = f.toString();
92
93
  return `${s}/forms/${n}/submissions/export${l === "" ? "" : `?${l}`}`;
93
94
  }
94
95
  };
95
96
  }
96
- function Ye(r) {
97
+ function el(i) {
97
98
  return {
98
- view: r.view === void 0 || r.view === "" ? void 0 : r.view,
99
- search: r.search === void 0 || r.search === "" ? void 0 : r.search,
100
- assignee: r.assignee ?? void 0,
101
- placement: r.placement ?? void 0,
102
- sort: r.sort ?? void 0,
103
- page: r.page,
104
- per_page: r.per_page
99
+ view: i.view === void 0 || i.view === "" ? void 0 : i.view,
100
+ search: i.search === void 0 || i.search === "" ? void 0 : i.search,
101
+ assignee: i.assignee ?? void 0,
102
+ placement: i.placement ?? void 0,
103
+ sort: i.sort ?? void 0,
104
+ page: i.page,
105
+ per_page: i.per_page
105
106
  };
106
107
  }
107
- const ql = {
108
+ const Nl = {
108
109
  module: {
109
110
  title: "Inbox"
110
111
  },
@@ -242,11 +243,29 @@ const ql = {
242
243
  "event-unassigned": "Left to nobody",
243
244
  "event-note": "A note was added",
244
245
  "event-notified": "The notification went out",
246
+ "event-handled": "Handed to :name",
247
+ "event-handler-error": ":name failed: :error",
245
248
  system: "System",
246
249
  "no-answers": "Nothing was filled in.",
247
250
  download: "Download",
248
251
  "no-files-by-hand": "A file cannot be attached by hand: the files a submission carries are what was posted with it.",
249
- "submissions-none": "Nothing here under this filter."
252
+ "submissions-none": "Nothing here under this filter.",
253
+ "notifies-nobody": "Nobody is told about this form",
254
+ "notifies-nobody-text": "Every submission is kept here, but no letter goes out. Add a recipient on the Notifications tab.",
255
+ "notifies-nobody-short": "Nobody is told",
256
+ "recipient-admin_deleted": "This administrator no longer exists and gets no letter.",
257
+ "recipient-admin_inactive": "This administrator is switched off and gets no letter.",
258
+ "recipient-invalid_email": "This is not an e-mail address.",
259
+ "event-no-recipients": "Nobody was told: the form names no recipients",
260
+ "notified-nobody": "No notification: the form names nobody to tell",
261
+ "notify-queued": "The notification is waiting in the queue",
262
+ "notify-again": "Send the notification again",
263
+ "notify-sent-again": "The notification has been sent again",
264
+ "notify-recipient-queued": "waiting",
265
+ "notify-recipient-delivered": "sent",
266
+ "notify-recipient-failed": "failed",
267
+ "event-notify-queued": "The notification was queued",
268
+ "event-notify-failed": "The notification to :to failed"
250
269
  },
251
270
  fields: {
252
271
  field: "Field",
@@ -301,15 +320,15 @@ const ql = {
301
320
  "type-file": "File",
302
321
  "type-hidden": "Hidden"
303
322
  }
304
- }, ol = /* @__PURE__ */ new WeakSet();
305
- function ce() {
323
+ }, dl = /* @__PURE__ */ new WeakSet();
324
+ function pe() {
306
325
  try {
307
- const { i18n: r } = oe();
308
- ol.has(r) || (r.defaults("webx-inbox", ql), ol.add(r));
326
+ const { i18n: i } = ie();
327
+ dl.has(i) || (i.defaults("webx-inbox", Nl), dl.add(i));
309
328
  } catch {
310
329
  }
311
330
  }
312
- const Al = [
331
+ const Il = [
313
332
  "text",
314
333
  "email",
315
334
  "tel",
@@ -321,108 +340,108 @@ const Al = [
321
340
  "date",
322
341
  "file",
323
342
  "hidden"
324
- ], Il = ["default", "primary", "success", "warning", "info", "danger"], Nl = { class: "wx-inbox-field-form" }, Dl = { class: "wx-inbox-field-form__row" }, Ml = {
343
+ ], Dl = ["default", "primary", "success", "warning", "info", "danger"], Ml = { class: "wx-inbox-field-form" }, Ll = { class: "wx-inbox-field-form__row" }, Ol = {
325
344
  key: 2,
326
345
  class: "wx-inbox-choices"
327
- }, Ll = { class: "wx-inbox-field-form__row" }, Ol = { class: "wx-inbox-field-form__checks" }, Pl = /* @__PURE__ */ ae({
346
+ }, Pl = { class: "wx-inbox-field-form__row" }, El = { class: "wx-inbox-field-form__checks" }, Rl = /* @__PURE__ */ ne({
328
347
  __name: "FieldDialog",
329
348
  props: {
330
349
  field: {},
331
350
  form: {}
332
351
  },
333
- setup(r) {
334
- const s = r, { resolve: o, dismiss: f, open: n } = Ee(), d = oe(), m = de(d);
335
- ce();
336
- const l = te("webx-inbox"), U = be(), p = F(!1), i = F({}), L = F(""), C = F("text"), T = F({}), b = F({}), W = F({}), c = F({}), $ = F(!0), h = F(!1), O = F(!0), _ = F(!1);
337
- Ce(
352
+ setup(i) {
353
+ const s = i, { resolve: u, dismiss: v, open: n } = He(), c = ie(), f = ce(c);
354
+ pe();
355
+ const l = ae("webx-inbox"), T = ye(), p = q(!1), d = q({}), D = q(""), C = q("text"), z = q({}), b = q({}), F = q({}), m = q({}), $ = q(!0), h = q(!1), I = q(!0), x = q(!1);
356
+ Te(
338
357
  () => s.field,
339
- (I) => {
340
- L.value = I?.name ?? "", C.value = I?.type ?? "text", T.value = { ...I?.title ?? {} }, b.value = { ...I?.placeholder ?? {} }, W.value = { ...I?.help ?? {} }, c.value = { ...I?.options ?? {} }, $.value = I?.is_enabled ?? !0, h.value = I?.is_required ?? !1, O.value = I?.is_fullsize ?? !0, _.value = I?.in_table ?? !1, i.value = {};
358
+ (W) => {
359
+ D.value = W?.name ?? "", C.value = W?.type ?? "text", z.value = { ...W?.title ?? {} }, b.value = { ...W?.placeholder ?? {} }, F.value = { ...W?.help ?? {} }, m.value = { ...W?.options ?? {} }, $.value = W?.is_enabled ?? !0, h.value = W?.is_required ?? !1, I.value = W?.is_fullsize ?? !0, x.value = W?.in_table ?? !1, d.value = {};
341
360
  },
342
361
  { immediate: !0 }
343
362
  );
344
- const E = S(
345
- () => Al.map((I) => ({ value: I, label: l(`fields.type-${I}`) }))
346
- ), N = S(() => ["select", "radio", "checkbox"].includes(C.value)), q = S(
347
- () => Array.isArray(c.value.choices) ? c.value.choices : []
348
- ), M = S({
349
- get: () => Array.isArray(c.value.extensions) ? c.value.extensions : [],
350
- set: (I) => v(
363
+ const E = U(
364
+ () => Il.map((W) => ({ value: W, label: l(`fields.type-${W}`) }))
365
+ ), j = U(() => ["select", "radio", "checkbox"].includes(C.value)), R = U(
366
+ () => Array.isArray(m.value.choices) ? m.value.choices : []
367
+ ), B = U({
368
+ get: () => Array.isArray(m.value.extensions) ? m.value.extensions : [],
369
+ set: (W) => r(
351
370
  "extensions",
352
- I.map((k) => k.replace(/^\./, ""))
371
+ W.map((k) => k.replace(/^\./, ""))
353
372
  )
354
373
  });
355
- function v(I, k) {
356
- c.value = { ...c.value, [I]: k };
374
+ function r(W, k) {
375
+ m.value = { ...m.value, [W]: k };
357
376
  }
358
- function Y() {
359
- v("choices", [...q.value, { value: "", label: {} }]);
377
+ function O() {
378
+ r("choices", [...R.value, { value: "", label: {} }]);
360
379
  }
361
- function ye(I) {
362
- v(
380
+ function J(W) {
381
+ r(
363
382
  "choices",
364
- q.value.filter((k, y) => y !== I)
383
+ R.value.filter((k, g) => g !== W)
365
384
  );
366
385
  }
367
- function pe(I, k) {
368
- v(
386
+ function me(W, k) {
387
+ r(
369
388
  "choices",
370
- q.value.map((y, ue) => ue === I ? { ...y, ...k } : y)
389
+ R.value.map((g, re) => re === W ? { ...g, ...k } : g)
371
390
  );
372
391
  }
373
- function A(I) {
374
- return i.value[I]?.[0];
392
+ function A(W) {
393
+ return d.value[W]?.[0];
375
394
  }
376
- async function Q() {
377
- p.value = !0, i.value = {};
378
- const I = {
379
- name: L.value.trim() === "" ? null : L.value.trim(),
395
+ async function X() {
396
+ p.value = !0, d.value = {};
397
+ const W = {
398
+ name: D.value.trim() === "" ? null : D.value.trim(),
380
399
  type: C.value,
381
- title: T.value,
400
+ title: z.value,
382
401
  placeholder: b.value,
383
- help: W.value,
384
- options: c.value,
402
+ help: F.value,
403
+ options: m.value,
385
404
  is_enabled: $.value,
386
405
  is_required: h.value,
387
- is_fullsize: O.value,
388
- in_table: _.value
406
+ is_fullsize: I.value,
407
+ in_table: x.value
389
408
  };
390
409
  try {
391
- o(
392
- s.field === null ? await m.createField(s.form.id, I) : await m.saveField(s.field.id, I)
410
+ u(
411
+ s.field === null ? await f.createField(s.form.id, W) : await f.saveField(s.field.id, W)
393
412
  );
394
413
  } catch (k) {
395
- const y = k.body;
396
- y?.errors ? (i.value = y.errors, P.danger(l("panel.failed"))) : P.danger(U(k));
414
+ const g = k.body;
415
+ g?.errors ? (d.value = g.errors, L.danger(l("panel.failed"))) : L.danger(T(k));
397
416
  } finally {
398
417
  p.value = !1;
399
418
  }
400
419
  }
401
- return (I, k) => (u(), w(e(Re), {
420
+ return (W, k) => (o(), w(e(Ge), {
402
421
  open: e(n),
403
- "onUpdate:open": k[21] || (k[21] = (y) => ne(n) ? n.value = y : null),
404
- title: r.field ? e(l)("fields.edit-field") : e(l)("fields.new-field"),
422
+ "onUpdate:open": k[21] || (k[21] = (g) => se(n) ? n.value = g : null),
423
+ title: i.field ? e(l)("fields.edit-field") : e(l)("fields.new-field"),
405
424
  width: 720
406
425
  }, {
407
426
  footer: a(() => [
408
- t(e(qe), { size: "sm" }, {
427
+ t(e(Ae), { size: "sm" }, {
409
428
  default: a(() => [
410
- t(e(le), {
429
+ t(e(te), {
411
430
  variant: "outline",
412
- onClick: k[20] || (k[20] = (y) => e(f)())
431
+ onClick: k[20] || (k[20] = (g) => e(v)())
413
432
  }, {
414
433
  default: a(() => [
415
- z(V(e(l)("fields.cancel")), 1)
434
+ S(V(e(l)("fields.cancel")), 1)
416
435
  ]),
417
436
  _: 1
418
437
  }),
419
- t(e(le), {
438
+ t(e(te), {
420
439
  type: "primary",
421
440
  loading: p.value,
422
- onClick: Q
441
+ onClick: X
423
442
  }, {
424
443
  default: a(() => [
425
- z(V(e(l)("fields.save")), 1)
444
+ S(V(e(l)("fields.save")), 1)
426
445
  ]),
427
446
  _: 1
428
447
  }, 8, ["loading"])
@@ -431,292 +450,292 @@ const Al = [
431
450
  })
432
451
  ]),
433
452
  default: a(() => [
434
- G("div", Nl, [
435
- G("div", Dl, [
436
- t(e(B), {
453
+ K("div", Ml, [
454
+ K("div", Ll, [
455
+ t(e(H), {
437
456
  label: e(l)("fields.type")
438
457
  }, {
439
458
  default: a(() => [
440
- t(e(ve), {
459
+ t(e(fe), {
441
460
  modelValue: C.value,
442
- "onUpdate:modelValue": k[0] || (k[0] = (y) => C.value = y),
461
+ "onUpdate:modelValue": k[0] || (k[0] = (g) => C.value = g),
443
462
  options: E.value
444
463
  }, null, 8, ["modelValue", "options"])
445
464
  ]),
446
465
  _: 1
447
466
  }, 8, ["label"]),
448
- t(e(B), {
467
+ t(e(H), {
449
468
  label: e(l)("fields.name"),
450
469
  help: e(l)("fields.name-help"),
451
470
  error: A("name")
452
471
  }, {
453
472
  default: a(() => [
454
- t(e(X), {
455
- modelValue: L.value,
456
- "onUpdate:modelValue": k[1] || (k[1] = (y) => L.value = y),
473
+ t(e(le), {
474
+ modelValue: D.value,
475
+ "onUpdate:modelValue": k[1] || (k[1] = (g) => D.value = g),
457
476
  placeholder: "email"
458
477
  }, null, 8, ["modelValue"])
459
478
  ]),
460
479
  _: 1
461
480
  }, 8, ["label", "help", "error"])
462
481
  ]),
463
- t(e(B), {
482
+ t(e(H), {
464
483
  label: e(l)("fields.title"),
465
484
  error: A("title"),
466
485
  required: ""
467
486
  }, {
468
487
  default: a(() => [
469
- t(e(X), {
470
- modelValue: T.value,
471
- "onUpdate:modelValue": k[2] || (k[2] = (y) => T.value = y),
488
+ t(e(le), {
489
+ modelValue: z.value,
490
+ "onUpdate:modelValue": k[2] || (k[2] = (g) => z.value = g),
472
491
  localized: ""
473
492
  }, null, 8, ["modelValue"])
474
493
  ]),
475
494
  _: 1
476
495
  }, 8, ["label", "error"]),
477
- C.value !== "hidden" ? (u(), j(ee, { key: 0 }, [
478
- C.value !== "consent" ? (u(), w(e(B), {
496
+ C.value !== "hidden" ? (o(), G(ee, { key: 0 }, [
497
+ C.value !== "consent" ? (o(), w(e(H), {
479
498
  key: 0,
480
499
  label: e(l)("fields.placeholder")
481
500
  }, {
482
501
  default: a(() => [
483
- t(e(X), {
502
+ t(e(le), {
484
503
  modelValue: b.value,
485
- "onUpdate:modelValue": k[3] || (k[3] = (y) => b.value = y),
504
+ "onUpdate:modelValue": k[3] || (k[3] = (g) => b.value = g),
486
505
  localized: ""
487
506
  }, null, 8, ["modelValue"])
488
507
  ]),
489
508
  _: 1
490
- }, 8, ["label"])) : H("", !0),
491
- t(e(B), {
509
+ }, 8, ["label"])) : P("", !0),
510
+ t(e(H), {
492
511
  label: e(l)("fields.help")
493
512
  }, {
494
513
  default: a(() => [
495
- t(e(X), {
496
- modelValue: W.value,
497
- "onUpdate:modelValue": k[4] || (k[4] = (y) => W.value = y),
514
+ t(e(le), {
515
+ modelValue: F.value,
516
+ "onUpdate:modelValue": k[4] || (k[4] = (g) => F.value = g),
498
517
  localized: ""
499
518
  }, null, 8, ["modelValue"])
500
519
  ]),
501
520
  _: 1
502
521
  }, 8, ["label"])
503
- ], 64)) : H("", !0),
504
- C.value === "consent" ? (u(), w(e(B), {
522
+ ], 64)) : P("", !0),
523
+ C.value === "consent" ? (o(), w(e(H), {
505
524
  key: 1,
506
525
  label: e(l)("fields.consent-text"),
507
526
  help: e(l)("fields.consent-text-help")
508
527
  }, {
509
528
  default: a(() => [
510
- t(cl, {
511
- "model-value": c.value.text ?? {},
529
+ t(fl, {
530
+ "model-value": m.value.text ?? {},
512
531
  "min-height": "100px",
513
- "onUpdate:modelValue": k[5] || (k[5] = (y) => v("text", y))
532
+ "onUpdate:modelValue": k[5] || (k[5] = (g) => r("text", g))
514
533
  }, null, 8, ["model-value"])
515
534
  ]),
516
535
  _: 1
517
- }, 8, ["label", "help"])) : H("", !0),
518
- N.value ? (u(), j("div", Ml, [
519
- t(e(J), {
536
+ }, 8, ["label", "help"])) : P("", !0),
537
+ j.value ? (o(), G("div", Ol, [
538
+ t(e(Q), {
520
539
  size: "sm",
521
540
  weight: "medium"
522
541
  }, {
523
542
  default: a(() => [
524
- z(V(e(l)("fields.choices")), 1)
543
+ S(V(e(l)("fields.choices")), 1)
525
544
  ]),
526
545
  _: 1
527
546
  }),
528
- q.value.length === 0 ? (u(), w(e(J), {
547
+ R.value.length === 0 ? (o(), w(e(Q), {
529
548
  key: 0,
530
549
  size: "sm",
531
550
  tone: "placeholder"
532
551
  }, {
533
552
  default: a(() => [
534
- z(V(e(l)("fields.no-choices")), 1)
553
+ S(V(e(l)("fields.no-choices")), 1)
535
554
  ]),
536
555
  _: 1
537
- })) : H("", !0),
538
- (u(!0), j(ee, null, ke(q.value, (y, ue) => (u(), j("div", {
539
- key: ue,
556
+ })) : P("", !0),
557
+ (o(!0), G(ee, null, ge(R.value, (g, re) => (o(), G("div", {
558
+ key: re,
540
559
  class: "wx-inbox-choices__row"
541
560
  }, [
542
- t(e(X), {
543
- "model-value": y.value,
561
+ t(e(le), {
562
+ "model-value": g.value,
544
563
  placeholder: e(l)("fields.choice-value"),
545
- "onUpdate:modelValue": (re) => pe(ue, { value: String(re) })
564
+ "onUpdate:modelValue": (de) => me(re, { value: String(de) })
546
565
  }, null, 8, ["model-value", "placeholder", "onUpdate:modelValue"]),
547
- t(e(X), {
548
- "model-value": y.label,
566
+ t(e(le), {
567
+ "model-value": g.label,
549
568
  localized: "",
550
569
  placeholder: e(l)("fields.choice-label"),
551
- "onUpdate:modelValue": (re) => pe(ue, { label: re })
570
+ "onUpdate:modelValue": (de) => me(re, { label: de })
552
571
  }, null, 8, ["model-value", "placeholder", "onUpdate:modelValue"]),
553
- t(e(Ve), {
572
+ t(e($e), {
554
573
  icon: "trash",
555
574
  title: e(l)("fields.delete"),
556
- onClick: (re) => ye(ue)
575
+ onClick: (de) => J(re)
557
576
  }, null, 8, ["title", "onClick"])
558
577
  ]))), 128)),
559
- t(e(le), {
578
+ t(e(te), {
560
579
  variant: "outline",
561
580
  size: "sm",
562
- onClick: Y
581
+ onClick: O
563
582
  }, {
564
583
  icon: a(() => [
565
- t(e($e), { name: "plus" })
584
+ t(e(_e), { name: "plus" })
566
585
  ]),
567
586
  default: a(() => [
568
- z(" " + V(e(l)("fields.add-choice")), 1)
587
+ S(" " + V(e(l)("fields.add-choice")), 1)
569
588
  ]),
570
589
  _: 1
571
590
  })
572
- ])) : H("", !0),
573
- G("div", Ll, [
574
- C.value === "textarea" ? (u(), w(e(B), {
591
+ ])) : P("", !0),
592
+ K("div", Pl, [
593
+ C.value === "textarea" ? (o(), w(e(H), {
575
594
  key: 0,
576
595
  label: e(l)("fields.rows")
577
596
  }, {
578
597
  default: a(() => [
579
- t(e(we), {
580
- "model-value": c.value.rows ?? 5,
598
+ t(e(Ve), {
599
+ "model-value": m.value.rows ?? 5,
581
600
  min: 2,
582
601
  max: 30,
583
- "onUpdate:modelValue": k[6] || (k[6] = (y) => v("rows", y))
602
+ "onUpdate:modelValue": k[6] || (k[6] = (g) => r("rows", g))
584
603
  }, null, 8, ["model-value"])
585
604
  ]),
586
605
  _: 1
587
- }, 8, ["label"])) : H("", !0),
588
- ["text", "email", "textarea"].includes(C.value) ? (u(), w(e(B), {
606
+ }, 8, ["label"])) : P("", !0),
607
+ ["text", "email", "textarea"].includes(C.value) ? (o(), w(e(H), {
589
608
  key: 1,
590
609
  label: e(l)("fields.maxlength")
591
610
  }, {
592
611
  default: a(() => [
593
- t(e(we), {
594
- "model-value": c.value.maxlength ?? null,
612
+ t(e(Ve), {
613
+ "model-value": m.value.maxlength ?? null,
595
614
  min: 1,
596
615
  max: 2e4,
597
- "onUpdate:modelValue": k[7] || (k[7] = (y) => v("maxlength", y))
616
+ "onUpdate:modelValue": k[7] || (k[7] = (g) => r("maxlength", g))
598
617
  }, null, 8, ["model-value"])
599
618
  ]),
600
619
  _: 1
601
- }, 8, ["label"])) : H("", !0),
602
- C.value === "tel" ? (u(), w(e(B), {
620
+ }, 8, ["label"])) : P("", !0),
621
+ C.value === "tel" ? (o(), w(e(H), {
603
622
  key: 2,
604
623
  label: e(l)("fields.pattern"),
605
624
  help: e(l)("fields.pattern-help")
606
625
  }, {
607
626
  default: a(() => [
608
- t(e(X), {
609
- "model-value": c.value.pattern ?? "",
610
- "onUpdate:modelValue": k[8] || (k[8] = (y) => v("pattern", y))
627
+ t(e(le), {
628
+ "model-value": m.value.pattern ?? "",
629
+ "onUpdate:modelValue": k[8] || (k[8] = (g) => r("pattern", g))
611
630
  }, null, 8, ["model-value"])
612
631
  ]),
613
632
  _: 1
614
- }, 8, ["label", "help"])) : H("", !0),
615
- C.value === "date" ? (u(), j(ee, { key: 3 }, [
616
- t(e(B), {
633
+ }, 8, ["label", "help"])) : P("", !0),
634
+ C.value === "date" ? (o(), G(ee, { key: 3 }, [
635
+ t(e(H), {
617
636
  label: e(l)("fields.earliest")
618
637
  }, {
619
638
  default: a(() => [
620
- t(e(Ze), {
639
+ t(e(ll), {
621
640
  clearable: "",
622
- "model-value": c.value.min ?? null,
623
- "onUpdate:modelValue": k[9] || (k[9] = (y) => v("min", y))
641
+ "model-value": m.value.min ?? null,
642
+ "onUpdate:modelValue": k[9] || (k[9] = (g) => r("min", g))
624
643
  }, null, 8, ["model-value"])
625
644
  ]),
626
645
  _: 1
627
646
  }, 8, ["label"]),
628
- t(e(B), {
647
+ t(e(H), {
629
648
  label: e(l)("fields.latest")
630
649
  }, {
631
650
  default: a(() => [
632
- t(e(Ze), {
651
+ t(e(ll), {
633
652
  clearable: "",
634
- "model-value": c.value.max ?? null,
635
- "onUpdate:modelValue": k[10] || (k[10] = (y) => v("max", y))
653
+ "model-value": m.value.max ?? null,
654
+ "onUpdate:modelValue": k[10] || (k[10] = (g) => r("max", g))
636
655
  }, null, 8, ["model-value"])
637
656
  ]),
638
657
  _: 1
639
658
  }, 8, ["label"])
640
- ], 64)) : H("", !0),
641
- C.value === "checkbox" ? (u(), j(ee, { key: 4 }, [
642
- t(e(B), {
659
+ ], 64)) : P("", !0),
660
+ C.value === "checkbox" ? (o(), G(ee, { key: 4 }, [
661
+ t(e(H), {
643
662
  label: e(l)("fields.min-choices")
644
663
  }, {
645
664
  default: a(() => [
646
- t(e(we), {
647
- "model-value": c.value.min ?? null,
665
+ t(e(Ve), {
666
+ "model-value": m.value.min ?? null,
648
667
  min: 0,
649
- "onUpdate:modelValue": k[11] || (k[11] = (y) => v("min", y))
668
+ "onUpdate:modelValue": k[11] || (k[11] = (g) => r("min", g))
650
669
  }, null, 8, ["model-value"])
651
670
  ]),
652
671
  _: 1
653
672
  }, 8, ["label"]),
654
- t(e(B), {
673
+ t(e(H), {
655
674
  label: e(l)("fields.max-choices")
656
675
  }, {
657
676
  default: a(() => [
658
- t(e(we), {
659
- "model-value": c.value.max ?? null,
677
+ t(e(Ve), {
678
+ "model-value": m.value.max ?? null,
660
679
  min: 0,
661
- "onUpdate:modelValue": k[12] || (k[12] = (y) => v("max", y))
680
+ "onUpdate:modelValue": k[12] || (k[12] = (g) => r("max", g))
662
681
  }, null, 8, ["model-value"])
663
682
  ]),
664
683
  _: 1
665
684
  }, 8, ["label"])
666
- ], 64)) : H("", !0),
667
- C.value === "file" ? (u(), w(e(B), {
685
+ ], 64)) : P("", !0),
686
+ C.value === "file" ? (o(), w(e(H), {
668
687
  key: 5,
669
688
  label: e(l)("fields.max-size")
670
689
  }, {
671
690
  default: a(() => [
672
- t(e(we), {
673
- "model-value": c.value.max_size ?? null,
691
+ t(e(Ve), {
692
+ "model-value": m.value.max_size ?? null,
674
693
  min: 1,
675
- "onUpdate:modelValue": k[13] || (k[13] = (y) => v("max_size", y))
694
+ "onUpdate:modelValue": k[13] || (k[13] = (g) => r("max_size", g))
676
695
  }, null, 8, ["model-value"])
677
696
  ]),
678
697
  _: 1
679
- }, 8, ["label"])) : H("", !0)
698
+ }, 8, ["label"])) : P("", !0)
680
699
  ]),
681
- C.value === "file" ? (u(), j(ee, { key: 3 }, [
682
- t(e(B), {
700
+ C.value === "file" ? (o(), G(ee, { key: 3 }, [
701
+ t(e(H), {
683
702
  label: e(l)("fields.extensions"),
684
703
  help: e(l)("fields.extensions-help")
685
704
  }, {
686
705
  default: a(() => [
687
- t(e(_l), {
688
- modelValue: M.value,
689
- "onUpdate:modelValue": k[14] || (k[14] = (y) => M.value = y)
706
+ t(e(kl), {
707
+ modelValue: B.value,
708
+ "onUpdate:modelValue": k[14] || (k[14] = (g) => B.value = g)
690
709
  }, null, 8, ["modelValue"])
691
710
  ]),
692
711
  _: 1
693
712
  }, 8, ["label", "help"]),
694
713
  t(e(he), {
695
- "model-value": !!c.value.multiple,
714
+ "model-value": !!m.value.multiple,
696
715
  label: e(l)("fields.multiple"),
697
- "onUpdate:modelValue": k[15] || (k[15] = (y) => v("multiple", y))
716
+ "onUpdate:modelValue": k[15] || (k[15] = (g) => r("multiple", g))
698
717
  }, null, 8, ["model-value", "label"])
699
- ], 64)) : H("", !0),
700
- G("div", Ol, [
718
+ ], 64)) : P("", !0),
719
+ K("div", El, [
701
720
  t(e(he), {
702
721
  modelValue: $.value,
703
- "onUpdate:modelValue": k[16] || (k[16] = (y) => $.value = y),
722
+ "onUpdate:modelValue": k[16] || (k[16] = (g) => $.value = g),
704
723
  label: e(l)("fields.is-enabled")
705
724
  }, null, 8, ["modelValue", "label"]),
706
725
  t(e(he), {
707
726
  modelValue: h.value,
708
- "onUpdate:modelValue": k[17] || (k[17] = (y) => h.value = y),
727
+ "onUpdate:modelValue": k[17] || (k[17] = (g) => h.value = g),
709
728
  label: e(l)("fields.is-required")
710
729
  }, null, 8, ["modelValue", "label"]),
711
- C.value !== "hidden" ? (u(), w(e(he), {
730
+ C.value !== "hidden" ? (o(), w(e(he), {
712
731
  key: 0,
713
- modelValue: O.value,
714
- "onUpdate:modelValue": k[18] || (k[18] = (y) => O.value = y),
732
+ modelValue: I.value,
733
+ "onUpdate:modelValue": k[18] || (k[18] = (g) => I.value = g),
715
734
  label: e(l)("fields.is-fullsize")
716
- }, null, 8, ["modelValue", "label"])) : H("", !0),
735
+ }, null, 8, ["modelValue", "label"])) : P("", !0),
717
736
  t(e(he), {
718
- modelValue: _.value,
719
- "onUpdate:modelValue": k[19] || (k[19] = (y) => _.value = y),
737
+ modelValue: x.value,
738
+ "onUpdate:modelValue": k[19] || (k[19] = (g) => x.value = g),
720
739
  label: e(l)("fields.in-table")
721
740
  }, null, 8, ["modelValue", "label"])
722
741
  ])
@@ -725,14 +744,14 @@ const Al = [
725
744
  _: 1
726
745
  }, 8, ["open", "title"]));
727
746
  }
728
- }), ie = (r, s) => {
729
- const o = r.__vccOpts || r;
730
- for (const [f, n] of s)
731
- o[f] = n;
732
- return o;
733
- }, El = /* @__PURE__ */ ie(Pl, [["__scopeId", "data-v-6696bbc1"]]), Rl = { class: "wx-inbox-field" }, Bl = { class: "wx-inbox-field__name" }, Hl = /* @__PURE__ */ ae({
747
+ }), ue = (i, s) => {
748
+ const u = i.__vccOpts || i;
749
+ for (const [v, n] of s)
750
+ u[v] = n;
751
+ return u;
752
+ }, Bl = /* @__PURE__ */ ue(Rl, [["__scopeId", "data-v-6696bbc1"]]), Hl = { class: "wx-inbox-field" }, Gl = { class: "wx-inbox-field__name" }, jl = /* @__PURE__ */ ne({
734
753
  __name: "FieldList",
735
- props: /* @__PURE__ */ Le({
754
+ props: /* @__PURE__ */ Ee({
736
755
  form: {},
737
756
  canManage: { type: Boolean }
738
757
  }, {
@@ -740,122 +759,122 @@ const Al = [
740
759
  modelModifiers: {}
741
760
  }),
742
761
  emits: ["update:modelValue"],
743
- setup(r) {
744
- const s = r, o = Ue(r, "modelValue"), f = oe(), n = de(f), d = xe();
745
- ce();
746
- const m = te("webx-inbox"), l = be(), U = Be(El);
747
- function p(c) {
748
- return fe(c.title, d.active.value, c.key);
749
- }
750
- function i(c) {
762
+ setup(i) {
763
+ const s = i, u = Se(i, "modelValue"), v = ie(), n = ce(v), c = we();
764
+ pe();
765
+ const f = ae("webx-inbox"), l = ye(), T = je(Bl);
766
+ function p(m) {
767
+ return be(m.title, c.active.value, m.key);
768
+ }
769
+ function d(m) {
751
770
  return [
752
- m(`fields.type-${c.type}`),
753
- ...c.is_required ? [m("fields.is-required")] : [],
754
- ...c.in_table ? [m("fields.in-table")] : [],
755
- ...c.is_fullsize ? [] : [m("fields.is-fullsize")]
771
+ f(`fields.type-${m.type}`),
772
+ ...m.is_required ? [f("fields.is-required")] : [],
773
+ ...m.in_table ? [f("fields.in-table")] : [],
774
+ ...m.is_fullsize ? [] : [f("fields.is-fullsize")]
756
775
  ];
757
776
  }
758
- const L = S(() => o.value.length === 0);
759
- async function C(c) {
760
- const $ = await U({ field: c, form: s.form });
761
- $ && (o.value = c === null ? [...o.value, $] : o.value.map((h) => h.id === $.id ? $ : h));
762
- }
763
- async function T(c) {
764
- if (await ze({
765
- title: m("fields.delete-title", { field: p(c) }),
766
- message: m("fields.delete-text"),
767
- confirmText: m("fields.delete"),
768
- cancelText: m("fields.cancel"),
777
+ const D = U(() => u.value.length === 0);
778
+ async function C(m) {
779
+ const $ = await T({ field: m, form: s.form });
780
+ $ && (u.value = m === null ? [...u.value, $] : u.value.map((h) => h.id === $.id ? $ : h));
781
+ }
782
+ async function z(m) {
783
+ if (await Ce({
784
+ title: f("fields.delete-title", { field: p(m) }),
785
+ message: f("fields.delete-text"),
786
+ confirmText: f("fields.delete"),
787
+ cancelText: f("fields.cancel"),
769
788
  tone: "danger"
770
789
  }))
771
790
  try {
772
- await n.removeField(c.id), o.value = o.value.filter((h) => h.id !== c.id), P.success(m("panel.deleted"));
791
+ await n.removeField(m.id), u.value = u.value.filter((h) => h.id !== m.id), L.success(f("panel.deleted"));
773
792
  } catch (h) {
774
- P.danger(l(h));
793
+ L.danger(l(h));
775
794
  }
776
795
  }
777
- function b(c) {
796
+ function b(m) {
778
797
  return s.canManage ? [
779
- { key: "edit", icon: "edit", label: m("fields.edit-field"), run: () => {
780
- C(c);
798
+ { key: "edit", icon: "edit", label: f("fields.edit-field"), run: () => {
799
+ C(m);
781
800
  } },
782
801
  {
783
802
  key: "delete",
784
803
  icon: "trash",
785
- label: m("fields.delete"),
804
+ label: f("fields.delete"),
786
805
  danger: !0,
787
806
  run: () => {
788
- T(c);
807
+ z(m);
789
808
  }
790
809
  }
791
810
  ] : [];
792
811
  }
793
- async function W() {
812
+ async function F() {
794
813
  try {
795
814
  await n.sortFields(
796
815
  s.form.id,
797
- o.value.map((c) => c.id)
816
+ u.value.map((m) => m.id)
798
817
  );
799
- } catch (c) {
800
- P.danger(l(c, m("panel.reorder-failed")));
818
+ } catch (m) {
819
+ L.danger(l(m, f("panel.reorder-failed")));
801
820
  }
802
821
  }
803
- return (c, $) => (u(), w(e(se), {
804
- title: e(m)("panel.tab-fields")
805
- }, Ne({
822
+ return (m, $) => (o(), w(e(oe), {
823
+ title: e(f)("panel.tab-fields")
824
+ }, Oe({
806
825
  default: a(() => [
807
- L.value ? (u(), w(e(He), {
826
+ D.value ? (o(), w(e(Ke), {
808
827
  key: 0,
809
- title: e(m)("fields.no-fields"),
810
- description: e(m)("fields.no-fields-help")
811
- }, null, 8, ["title", "description"])) : (u(), w(e(Je), {
828
+ title: e(f)("fields.no-fields"),
829
+ description: e(f)("fields.no-fields-help")
830
+ }, null, 8, ["title", "description"])) : (o(), w(e(al), {
812
831
  key: 1,
813
- modelValue: o.value,
814
- "onUpdate:modelValue": $[1] || ($[1] = (h) => o.value = h),
832
+ modelValue: u.value,
833
+ "onUpdate:modelValue": $[1] || ($[1] = (h) => u.value = h),
815
834
  plain: "",
816
835
  "item-key": "id",
817
836
  "item-label": p,
818
- disabled: !r.canManage,
819
- "aria-label": e(m)("panel.tab-fields"),
820
- onMove: W
837
+ disabled: !i.canManage,
838
+ "aria-label": e(f)("panel.tab-fields"),
839
+ onMove: F
821
840
  }, {
822
841
  default: a(({ item: h }) => [
823
- G("div", Rl, [
824
- G("div", Bl, [
825
- t(e(J), {
842
+ K("div", Hl, [
843
+ K("div", Gl, [
844
+ t(e(Q), {
826
845
  weight: "medium",
827
846
  truncate: ""
828
847
  }, {
829
848
  default: a(() => [
830
- z(V(p(h)), 1)
849
+ S(V(p(h)), 1)
831
850
  ]),
832
851
  _: 2
833
852
  }, 1024),
834
- h.is_enabled ? H("", !0) : (u(), w(e(Se), {
853
+ h.is_enabled ? P("", !0) : (o(), w(e(Ue), {
835
854
  key: 0,
836
855
  type: "default"
837
856
  }, {
838
857
  default: a(() => [
839
- z(V(e(m)("panel.off")), 1)
858
+ S(V(e(f)("panel.off")), 1)
840
859
  ]),
841
860
  _: 1
842
861
  }))
843
862
  ]),
844
- t(e(J), {
863
+ t(e(Q), {
845
864
  size: "sm",
846
865
  tone: "muted",
847
866
  truncate: ""
848
867
  }, {
849
868
  default: a(() => [
850
- G("code", null, "fields[" + V(h.key) + "]", 1),
851
- z(" · " + V(i(h).join(" · ")), 1)
869
+ K("code", null, "fields[" + V(h.key) + "]", 1),
870
+ S(" · " + V(d(h).join(" · ")), 1)
852
871
  ]),
853
872
  _: 2
854
873
  }, 1024)
855
874
  ])
856
875
  ]),
857
876
  actions: a(({ item: h }) => [
858
- t(e(Fe), {
877
+ t(e(ze), {
859
878
  actions: b(h),
860
879
  label: p(h)
861
880
  }, null, 8, ["actions", "label"])
@@ -865,19 +884,19 @@ const Al = [
865
884
  ]),
866
885
  _: 2
867
886
  }, [
868
- r.canManage ? {
887
+ i.canManage ? {
869
888
  name: "extra",
870
889
  fn: a(() => [
871
- t(e(le), {
890
+ t(e(te), {
872
891
  type: "primary",
873
892
  size: "sm",
874
893
  onClick: $[0] || ($[0] = (h) => C(null))
875
894
  }, {
876
895
  icon: a(() => [
877
- t(e($e), { name: "plus" })
896
+ t(e(_e), { name: "plus" })
878
897
  ]),
879
898
  default: a(() => [
880
- z(" " + V(e(m)("fields.new-field")), 1)
899
+ S(" " + V(e(f)("fields.new-field")), 1)
881
900
  ]),
882
901
  _: 1
883
902
  })
@@ -886,79 +905,79 @@ const Al = [
886
905
  } : void 0
887
906
  ]), 1032, ["title"]));
888
907
  }
889
- }), Gl = /* @__PURE__ */ ie(Hl, [["__scopeId", "data-v-421ed0af"]]);
890
- function me(r, s, o) {
891
- return S({
892
- get: () => r.value[s] ?? o,
893
- set: (f) => {
894
- const n = { ...r.value };
895
- f === "" || f === null || f === void 0 ? delete n[s] : n[s] = f, r.value = n;
908
+ }), Kl = /* @__PURE__ */ ue(jl, [["__scopeId", "data-v-421ed0af"]]);
909
+ function ve(i, s, u) {
910
+ return U({
911
+ get: () => i.value[s] ?? u,
912
+ set: (v) => {
913
+ const n = { ...i.value };
914
+ v === "" || v === null || v === void 0 ? delete n[s] : n[s] = v, i.value = n;
896
915
  }
897
916
  });
898
917
  }
899
- const jl = /* @__PURE__ */ ae({
918
+ const Yl = /* @__PURE__ */ ne({
900
919
  __name: "FormAntispam",
901
920
  props: {
902
921
  modelValue: { required: !0 },
903
922
  modelModifiers: {}
904
923
  },
905
924
  emits: ["update:modelValue"],
906
- setup(r) {
907
- const s = Ue(r, "modelValue"), o = te("webx-inbox"), f = me(s, "antispam.honeypot", !0), n = me(s, "antispam.min_seconds", 3), d = me(s, "antispam.throttle", 5), m = me(s, "antispam.captcha", "off"), l = S(() => [
908
- { value: "off", label: o("panel.captcha-off") },
909
- { value: "recaptcha", label: o("panel.captcha-recaptcha") },
910
- { value: "turnstile", label: o("panel.captcha-turnstile") }
925
+ setup(i) {
926
+ const s = Se(i, "modelValue"), u = ae("webx-inbox"), v = ve(s, "antispam.honeypot", !0), n = ve(s, "antispam.min_seconds", 3), c = ve(s, "antispam.throttle", 5), f = ve(s, "antispam.captcha", "off"), l = U(() => [
927
+ { value: "off", label: u("panel.captcha-off") },
928
+ { value: "recaptcha", label: u("panel.captcha-recaptcha") },
929
+ { value: "turnstile", label: u("panel.captcha-turnstile") }
911
930
  ]);
912
- return (U, p) => (u(), w(e(se), null, {
931
+ return (T, p) => (o(), w(e(oe), null, {
913
932
  default: a(() => [
914
- t(e(B), {
915
- label: e(o)("panel.honeypot"),
916
- help: e(o)("panel.honeypot-help")
933
+ t(e(H), {
934
+ label: e(u)("panel.honeypot"),
935
+ help: e(u)("panel.honeypot-help")
917
936
  }, {
918
937
  default: a(() => [
919
- t(e(rl), {
920
- modelValue: e(f),
921
- "onUpdate:modelValue": p[0] || (p[0] = (i) => ne(f) ? f.value = i : null)
938
+ t(e(ml), {
939
+ modelValue: e(v),
940
+ "onUpdate:modelValue": p[0] || (p[0] = (d) => se(v) ? v.value = d : null)
922
941
  }, null, 8, ["modelValue"])
923
942
  ]),
924
943
  _: 1
925
944
  }, 8, ["label", "help"]),
926
- t(e(B), {
927
- label: e(o)("panel.min-seconds"),
928
- help: e(o)("panel.min-seconds-help")
945
+ t(e(H), {
946
+ label: e(u)("panel.min-seconds"),
947
+ help: e(u)("panel.min-seconds-help")
929
948
  }, {
930
949
  default: a(() => [
931
- t(e(we), {
950
+ t(e(Ve), {
932
951
  modelValue: e(n),
933
- "onUpdate:modelValue": p[1] || (p[1] = (i) => ne(n) ? n.value = i : null),
952
+ "onUpdate:modelValue": p[1] || (p[1] = (d) => se(n) ? n.value = d : null),
934
953
  min: 0,
935
954
  max: 120
936
955
  }, null, 8, ["modelValue"])
937
956
  ]),
938
957
  _: 1
939
958
  }, 8, ["label", "help"]),
940
- t(e(B), {
941
- label: e(o)("panel.throttle"),
942
- help: e(o)("panel.throttle-help")
959
+ t(e(H), {
960
+ label: e(u)("panel.throttle"),
961
+ help: e(u)("panel.throttle-help")
943
962
  }, {
944
963
  default: a(() => [
945
- t(e(we), {
946
- modelValue: e(d),
947
- "onUpdate:modelValue": p[2] || (p[2] = (i) => ne(d) ? d.value = i : null),
964
+ t(e(Ve), {
965
+ modelValue: e(c),
966
+ "onUpdate:modelValue": p[2] || (p[2] = (d) => se(c) ? c.value = d : null),
948
967
  min: 0,
949
968
  max: 120
950
969
  }, null, 8, ["modelValue"])
951
970
  ]),
952
971
  _: 1
953
972
  }, 8, ["label", "help"]),
954
- t(e(B), {
955
- label: e(o)("panel.captcha"),
956
- help: e(o)("panel.captcha-help")
973
+ t(e(H), {
974
+ label: e(u)("panel.captcha"),
975
+ help: e(u)("panel.captcha-help")
957
976
  }, {
958
977
  default: a(() => [
959
- t(e(ve), {
960
- modelValue: e(m),
961
- "onUpdate:modelValue": p[3] || (p[3] = (i) => ne(m) ? m.value = i : null),
978
+ t(e(fe), {
979
+ modelValue: e(f),
980
+ "onUpdate:modelValue": p[3] || (p[3] = (d) => se(f) ? f.value = d : null),
962
981
  options: l.value
963
982
  }, null, 8, ["modelValue", "options"])
964
983
  ]),
@@ -968,115 +987,115 @@ const jl = /* @__PURE__ */ ae({
968
987
  _: 1
969
988
  }));
970
989
  }
971
- }), Kl = { class: "wx-inbox-embed" }, Yl = { class: "wx-inbox-embed__snippet" }, Zl = { class: "wx-inbox-embed__snippet" }, Ql = /* @__PURE__ */ ae({
990
+ }), Zl = { class: "wx-inbox-embed" }, Ql = { class: "wx-inbox-embed__snippet" }, Jl = { class: "wx-inbox-embed__snippet" }, Xl = /* @__PURE__ */ ne({
972
991
  __name: "FormEmbed",
973
992
  props: {
974
993
  form: {},
975
994
  slug: {},
976
995
  fields: {}
977
996
  },
978
- setup(r) {
979
- const s = r;
980
- ce();
981
- const o = te("webx-inbox"), f = S(() => `<x-webx-inbox::form slug="${s.slug}" />`), n = S(
997
+ setup(i) {
998
+ const s = i;
999
+ pe();
1000
+ const u = ae("webx-inbox"), v = U(() => `<x-webx-inbox::form slug="${s.slug}" />`), n = U(
982
1001
  () => `{{-- resources/views/blocks/contact.blade.php --}}
983
1002
  <x-webx-inbox::form slug="${s.slug}" />`
984
- ), d = S(() => [
985
- { key: "key", label: o("fields.name") },
986
- { key: "title", label: o("fields.title") },
987
- { key: "type", label: o("fields.type"), hideBelow: 520 }
988
- ]), m = S(() => s.fields.filter((U) => U.is_enabled));
989
- async function l(U) {
1003
+ ), c = U(() => [
1004
+ { key: "key", label: u("fields.name") },
1005
+ { key: "title", label: u("fields.title") },
1006
+ { key: "type", label: u("fields.type"), hideBelow: 520 }
1007
+ ]), f = U(() => s.fields.filter((T) => T.is_enabled));
1008
+ async function l(T) {
990
1009
  try {
991
- await navigator.clipboard.writeText(U), P.success(o("panel.copied"));
1010
+ await navigator.clipboard.writeText(T), L.success(u("panel.copied"));
992
1011
  } catch {
993
1012
  }
994
1013
  }
995
- return (U, p) => (u(), j("div", Kl, [
996
- t(e(se), {
997
- title: e(o)("panel.embed-blade")
1014
+ return (T, p) => (o(), G("div", Zl, [
1015
+ t(e(oe), {
1016
+ title: e(u)("panel.embed-blade")
998
1017
  }, {
999
1018
  default: a(() => [
1000
- t(e(J), {
1019
+ t(e(Q), {
1001
1020
  size: "sm",
1002
1021
  tone: "muted"
1003
1022
  }, {
1004
1023
  default: a(() => [
1005
- z(V(e(o)("panel.embed-blade-help")), 1)
1024
+ S(V(e(u)("panel.embed-blade-help")), 1)
1006
1025
  ]),
1007
1026
  _: 1
1008
1027
  }),
1009
- G("div", Yl, [
1010
- G("code", null, V(f.value), 1),
1011
- t(e(Ve), {
1028
+ K("div", Ql, [
1029
+ K("code", null, V(v.value), 1),
1030
+ t(e($e), {
1012
1031
  icon: "copy",
1013
- title: e(o)("panel.copy"),
1014
- onClick: p[0] || (p[0] = (i) => l(f.value))
1032
+ title: e(u)("panel.copy"),
1033
+ onClick: p[0] || (p[0] = (d) => l(v.value))
1015
1034
  }, null, 8, ["title"])
1016
1035
  ])
1017
1036
  ]),
1018
1037
  _: 1
1019
1038
  }, 8, ["title"]),
1020
- t(e(se), {
1021
- title: e(o)("panel.embed-block")
1039
+ t(e(oe), {
1040
+ title: e(u)("panel.embed-block")
1022
1041
  }, {
1023
1042
  default: a(() => [
1024
- t(e(J), {
1043
+ t(e(Q), {
1025
1044
  size: "sm",
1026
1045
  tone: "muted"
1027
1046
  }, {
1028
1047
  default: a(() => [
1029
- z(V(e(o)("panel.embed-block-help")), 1)
1048
+ S(V(e(u)("panel.embed-block-help")), 1)
1030
1049
  ]),
1031
1050
  _: 1
1032
1051
  }),
1033
- G("div", Zl, [
1034
- G("code", null, V(n.value), 1),
1035
- t(e(Ve), {
1052
+ K("div", Jl, [
1053
+ K("code", null, V(n.value), 1),
1054
+ t(e($e), {
1036
1055
  icon: "copy",
1037
- title: e(o)("panel.copy"),
1038
- onClick: p[1] || (p[1] = (i) => l(n.value))
1056
+ title: e(u)("panel.copy"),
1057
+ onClick: p[1] || (p[1] = (d) => l(n.value))
1039
1058
  }, null, 8, ["title"])
1040
1059
  ])
1041
1060
  ]),
1042
1061
  _: 1
1043
1062
  }, 8, ["title"]),
1044
- t(e(se), {
1045
- title: e(o)("panel.embed-names")
1063
+ t(e(oe), {
1064
+ title: e(u)("panel.embed-names")
1046
1065
  }, {
1047
1066
  default: a(() => [
1048
- t(e(J), {
1067
+ t(e(Q), {
1049
1068
  size: "sm",
1050
1069
  tone: "muted"
1051
1070
  }, {
1052
1071
  default: a(() => [
1053
- z(V(e(o)("panel.embed-names-help")), 1)
1072
+ S(V(e(u)("panel.embed-names-help")), 1)
1054
1073
  ]),
1055
1074
  _: 1
1056
1075
  }),
1057
- t(e(dl), {
1058
- data: m.value,
1059
- columns: d.value,
1076
+ t(e(vl), {
1077
+ data: f.value,
1078
+ columns: c.value,
1060
1079
  "row-key": "id",
1061
1080
  flush: "",
1062
- "empty-text": e(o)("fields.no-fields")
1081
+ "empty-text": e(u)("fields.no-fields")
1063
1082
  }, {
1064
- "cell-key": a(({ row: i }) => [
1065
- t(e(J), {
1083
+ "cell-key": a(({ row: d }) => [
1084
+ t(e(Q), {
1066
1085
  mono: "",
1067
1086
  size: "sm"
1068
1087
  }, {
1069
1088
  default: a(() => [
1070
- z("fields[" + V(i.key) + "]", 1)
1089
+ S("fields[" + V(d.key) + "]", 1)
1071
1090
  ]),
1072
1091
  _: 2
1073
1092
  }, 1024)
1074
1093
  ]),
1075
- "cell-title": a(({ row: i }) => [
1076
- z(V(Object.values(i.title)[0] ?? i.key), 1)
1094
+ "cell-title": a(({ row: d }) => [
1095
+ S(V(Object.values(d.title)[0] ?? d.key), 1)
1077
1096
  ]),
1078
- "cell-type": a(({ row: i }) => [
1079
- z(V(e(o)(`fields.type-${i.type}`)), 1)
1097
+ "cell-type": a(({ row: d }) => [
1098
+ S(V(e(u)(`fields.type-${d.type}`)), 1)
1080
1099
  ]),
1081
1100
  _: 1
1082
1101
  }, 8, ["data", "columns", "empty-text"])
@@ -1085,9 +1104,9 @@ const jl = /* @__PURE__ */ ae({
1085
1104
  }, 8, ["title"])
1086
1105
  ]));
1087
1106
  }
1088
- }), Jl = /* @__PURE__ */ ie(Ql, [["__scopeId", "data-v-e415689b"]]), Xl = { class: "wx-inbox-general" }, et = /* @__PURE__ */ ae({
1107
+ }), et = /* @__PURE__ */ ue(Xl, [["__scopeId", "data-v-e415689b"]]), lt = { class: "wx-inbox-general" }, tt = /* @__PURE__ */ ne({
1089
1108
  __name: "FormGeneral",
1090
- props: /* @__PURE__ */ Le({
1109
+ props: /* @__PURE__ */ Ee({
1091
1110
  errors: {}
1092
1111
  }, {
1093
1112
  settings: { required: !0 },
@@ -1096,51 +1115,51 @@ const jl = /* @__PURE__ */ ae({
1096
1115
  optionsModifiers: {}
1097
1116
  }),
1098
1117
  emits: ["update:settings", "update:options"],
1099
- setup(r) {
1100
- const s = Ue(
1101
- r,
1118
+ setup(i) {
1119
+ const s = Se(
1120
+ i,
1102
1121
  "settings"
1103
- ), o = Ue(r, "options"), f = te("webx-inbox"), n = me(o, "thank-you.heading", {}), d = me(o, "thank-you.text", {}), m = me(o, "design.submit-text", {}), l = me(o, "redirect", "");
1104
- return (U, p) => (u(), j("div", Xl, [
1105
- t(e(se), null, {
1122
+ ), u = Se(i, "options"), v = ae("webx-inbox"), n = ve(u, "thank-you.heading", {}), c = ve(u, "thank-you.text", {}), f = ve(u, "design.submit-text", {}), l = ve(u, "redirect", "");
1123
+ return (T, p) => (o(), G("div", lt, [
1124
+ t(e(oe), null, {
1106
1125
  default: a(() => [
1107
- t(e(B), {
1108
- label: e(f)("panel.title"),
1109
- error: r.errors.title?.[0],
1126
+ t(e(H), {
1127
+ label: e(v)("panel.title"),
1128
+ error: i.errors.title?.[0],
1110
1129
  required: ""
1111
1130
  }, {
1112
1131
  default: a(() => [
1113
- t(e(X), {
1132
+ t(e(le), {
1114
1133
  modelValue: s.value.title,
1115
- "onUpdate:modelValue": p[0] || (p[0] = (i) => s.value.title = i),
1134
+ "onUpdate:modelValue": p[0] || (p[0] = (d) => s.value.title = d),
1116
1135
  localized: ""
1117
1136
  }, null, 8, ["modelValue"])
1118
1137
  ]),
1119
1138
  _: 1
1120
1139
  }, 8, ["label", "error"]),
1121
- t(e(B), {
1122
- label: e(f)("panel.slug"),
1123
- help: e(f)("panel.slug-help"),
1124
- error: r.errors.slug?.[0],
1140
+ t(e(H), {
1141
+ label: e(v)("panel.slug"),
1142
+ help: e(v)("panel.slug-help"),
1143
+ error: i.errors.slug?.[0],
1125
1144
  required: ""
1126
1145
  }, {
1127
1146
  default: a(() => [
1128
- t(e(X), {
1147
+ t(e(le), {
1129
1148
  modelValue: s.value.slug,
1130
- "onUpdate:modelValue": p[1] || (p[1] = (i) => s.value.slug = i),
1149
+ "onUpdate:modelValue": p[1] || (p[1] = (d) => s.value.slug = d),
1131
1150
  placeholder: "contact"
1132
1151
  }, null, 8, ["modelValue"])
1133
1152
  ]),
1134
1153
  _: 1
1135
1154
  }, 8, ["label", "help", "error"]),
1136
- t(e(B), {
1137
- label: e(f)("panel.is-enabled"),
1138
- help: e(f)("panel.is-enabled-help")
1155
+ t(e(H), {
1156
+ label: e(v)("panel.is-enabled"),
1157
+ help: e(v)("panel.is-enabled-help")
1139
1158
  }, {
1140
1159
  default: a(() => [
1141
- t(e(rl), {
1160
+ t(e(ml), {
1142
1161
  modelValue: s.value.is_enabled,
1143
- "onUpdate:modelValue": p[2] || (p[2] = (i) => s.value.is_enabled = i)
1162
+ "onUpdate:modelValue": p[2] || (p[2] = (d) => s.value.is_enabled = d)
1144
1163
  }, null, 8, ["modelValue"])
1145
1164
  ]),
1146
1165
  _: 1
@@ -1148,53 +1167,53 @@ const jl = /* @__PURE__ */ ae({
1148
1167
  ]),
1149
1168
  _: 1
1150
1169
  }),
1151
- t(e(se), {
1152
- title: e(f)("panel.after-sending")
1170
+ t(e(oe), {
1171
+ title: e(v)("panel.after-sending")
1153
1172
  }, {
1154
1173
  default: a(() => [
1155
- t(e(B), {
1156
- label: e(f)("panel.submit-text")
1174
+ t(e(H), {
1175
+ label: e(v)("panel.submit-text")
1157
1176
  }, {
1158
1177
  default: a(() => [
1159
- t(e(X), {
1160
- modelValue: e(m),
1161
- "onUpdate:modelValue": p[3] || (p[3] = (i) => ne(m) ? m.value = i : null),
1178
+ t(e(le), {
1179
+ modelValue: e(f),
1180
+ "onUpdate:modelValue": p[3] || (p[3] = (d) => se(f) ? f.value = d : null),
1162
1181
  localized: ""
1163
1182
  }, null, 8, ["modelValue"])
1164
1183
  ]),
1165
1184
  _: 1
1166
1185
  }, 8, ["label"]),
1167
- t(e(B), {
1168
- label: e(f)("panel.thank-you-heading")
1186
+ t(e(H), {
1187
+ label: e(v)("panel.thank-you-heading")
1169
1188
  }, {
1170
1189
  default: a(() => [
1171
- t(e(X), {
1190
+ t(e(le), {
1172
1191
  modelValue: e(n),
1173
- "onUpdate:modelValue": p[4] || (p[4] = (i) => ne(n) ? n.value = i : null),
1192
+ "onUpdate:modelValue": p[4] || (p[4] = (d) => se(n) ? n.value = d : null),
1174
1193
  localized: ""
1175
1194
  }, null, 8, ["modelValue"])
1176
1195
  ]),
1177
1196
  _: 1
1178
1197
  }, 8, ["label"]),
1179
- t(e(B), {
1180
- label: e(f)("panel.thank-you-text")
1198
+ t(e(H), {
1199
+ label: e(v)("panel.thank-you-text")
1181
1200
  }, {
1182
1201
  default: a(() => [
1183
- t(cl, {
1184
- modelValue: e(d),
1185
- "onUpdate:modelValue": p[5] || (p[5] = (i) => ne(d) ? d.value = i : null)
1202
+ t(fl, {
1203
+ modelValue: e(c),
1204
+ "onUpdate:modelValue": p[5] || (p[5] = (d) => se(c) ? c.value = d : null)
1186
1205
  }, null, 8, ["modelValue"])
1187
1206
  ]),
1188
1207
  _: 1
1189
1208
  }, 8, ["label"]),
1190
- t(e(B), {
1191
- label: e(f)("panel.redirect"),
1192
- help: e(f)("panel.redirect-help")
1209
+ t(e(H), {
1210
+ label: e(v)("panel.redirect"),
1211
+ help: e(v)("panel.redirect-help")
1193
1212
  }, {
1194
1213
  default: a(() => [
1195
- t(e(X), {
1214
+ t(e(le), {
1196
1215
  modelValue: e(l),
1197
- "onUpdate:modelValue": p[6] || (p[6] = (i) => ne(l) ? l.value = i : null),
1216
+ "onUpdate:modelValue": p[6] || (p[6] = (d) => se(l) ? l.value = d : null),
1198
1217
  placeholder: "/thank-you"
1199
1218
  }, null, 8, ["modelValue"])
1200
1219
  ]),
@@ -1205,143 +1224,170 @@ const jl = /* @__PURE__ */ ae({
1205
1224
  }, 8, ["title"])
1206
1225
  ]));
1207
1226
  }
1208
- }), lt = /* @__PURE__ */ ie(et, [["__scopeId", "data-v-35e56e3d"]]), tt = { class: "wx-inbox-recipients" }, at = /* @__PURE__ */ ae({
1227
+ }), at = /* @__PURE__ */ ue(tt, [["__scopeId", "data-v-35e56e3d"]]), nt = /^[^\s@]+@[^\s@]+$/;
1228
+ function Le(i) {
1229
+ return "admin_id" in i;
1230
+ }
1231
+ function bl(i, s = []) {
1232
+ return Le(i) ? s.find(
1233
+ (v) => v.type === "admin" && v.admin_id === i.admin_id
1234
+ )?.problem ?? null : nt.test((i.email ?? "").trim()) ? null : "invalid_email";
1235
+ }
1236
+ function st(i, s = []) {
1237
+ return (i ?? []).some((u) => bl(u, s) === null);
1238
+ }
1239
+ const ot = { class: "wx-inbox-recipients" }, it = { class: "wx-inbox-recipients__row" }, ut = /* @__PURE__ */ ne({
1209
1240
  __name: "FormNotifications",
1210
- props: /* @__PURE__ */ Le({
1241
+ props: /* @__PURE__ */ Ee({
1211
1242
  fields: {},
1212
- errors: {}
1243
+ errors: {},
1244
+ reported: {}
1213
1245
  }, {
1214
1246
  modelValue: { required: !0 },
1215
1247
  modelModifiers: {}
1216
1248
  }),
1217
1249
  emits: ["update:modelValue"],
1218
- setup(r) {
1219
- const s = r, o = Ue(r, "modelValue"), f = oe(), n = de(f), d = te("webx-inbox"), m = F([]), l = me(o, "recipients", []), U = me(o, "email_field", "");
1220
- fl(async () => {
1250
+ setup(i) {
1251
+ const s = i, u = Se(i, "modelValue"), v = ie(), n = ce(v), c = ae("webx-inbox"), f = q([]), l = ve(u, "recipients", []), T = ve(u, "email_field", "");
1252
+ yl(async () => {
1221
1253
  try {
1222
- m.value = await n.recipients();
1254
+ f.value = await n.recipients();
1223
1255
  } catch {
1224
1256
  }
1225
1257
  });
1226
- const p = S(
1227
- () => m.value.map((c) => ({ value: c.id, label: `${c.name} · ${c.email}` }))
1228
- ), i = S(() => [
1229
- { value: "", label: d("panel.no-email-field") },
1230
- ...s.fields.filter((c) => c.type === "email").map((c) => ({ value: c.key, label: c.key }))
1258
+ const p = U(
1259
+ () => f.value.map((m) => ({ value: m.id, label: `${m.name} · ${m.email}` }))
1260
+ ), d = U(() => [
1261
+ { value: "", label: c("panel.no-email-field") },
1262
+ ...s.fields.filter((m) => m.type === "email").map((m) => ({ value: m.key, label: m.key }))
1231
1263
  ]);
1232
- function L(c) {
1233
- return "admin_id" in c;
1234
- }
1235
- function C(c) {
1236
- l.value = [...l.value, c];
1237
- }
1238
- async function T(c) {
1239
- const $ = l.value[c];
1240
- $ !== void 0 && (L($) || ($.email ?? "").trim() !== "") && !await ze({
1241
- title: d("panel.remove-recipient-title"),
1242
- message: d("panel.remove-recipient-text"),
1243
- confirmText: d("panel.remove"),
1244
- cancelText: d("panel.cancel"),
1264
+ function D(m) {
1265
+ if (!Le(m)) return null;
1266
+ const $ = bl(m, s.reported);
1267
+ return $ === null ? null : c(`panel.recipient-${$}`);
1268
+ }
1269
+ function C(m) {
1270
+ l.value = [...l.value, m];
1271
+ }
1272
+ async function z(m) {
1273
+ const $ = l.value[m];
1274
+ $ !== void 0 && (Le($) || ($.email ?? "").trim() !== "") && !await Ce({
1275
+ title: c("panel.remove-recipient-title"),
1276
+ message: c("panel.remove-recipient-text"),
1277
+ confirmText: c("panel.remove"),
1278
+ cancelText: c("panel.cancel"),
1245
1279
  tone: "danger"
1246
- }) || (l.value = l.value.filter((O, _) => _ !== c));
1280
+ }) || (l.value = l.value.filter((I, x) => x !== m));
1247
1281
  }
1248
- function b(c, $) {
1249
- l.value = l.value.map((h, O) => O === c ? { admin_id: $ } : h);
1282
+ function b(m, $) {
1283
+ l.value = l.value.map((h, I) => I === m ? { admin_id: $ } : h);
1250
1284
  }
1251
- function W(c, $) {
1252
- l.value = l.value.map((h, O) => O === c ? { email: $ } : h);
1285
+ function F(m, $) {
1286
+ l.value = l.value.map((h, I) => I === m ? { email: $ } : h);
1253
1287
  }
1254
- return (c, $) => (u(), w(e(se), {
1255
- title: e(d)("panel.recipients")
1288
+ return (m, $) => (o(), w(e(oe), {
1289
+ title: e(c)("panel.recipients")
1256
1290
  }, {
1257
1291
  default: a(() => [
1258
- t(e(J), {
1292
+ t(e(Q), {
1259
1293
  size: "sm",
1260
1294
  tone: "muted"
1261
1295
  }, {
1262
1296
  default: a(() => [
1263
- z(V(e(d)("panel.recipients-help")), 1)
1297
+ S(V(e(c)("panel.recipients-help")), 1)
1264
1298
  ]),
1265
1299
  _: 1
1266
1300
  }),
1267
- r.errors["options.recipients"] ? (u(), w(e(Me), {
1301
+ i.errors["options.recipients"] ? (o(), w(e(Fe), {
1268
1302
  key: 0,
1269
1303
  type: "danger",
1270
1304
  variant: "soft",
1271
- description: r.errors["options.recipients"]?.[0]
1272
- }, null, 8, ["description"])) : H("", !0),
1273
- G("div", tt, [
1274
- e(l).length === 0 ? (u(), w(e(J), {
1305
+ description: i.errors["options.recipients"]?.[0]
1306
+ }, null, 8, ["description"])) : P("", !0),
1307
+ K("div", ot, [
1308
+ e(l).length === 0 ? (o(), w(e(Q), {
1275
1309
  key: 0,
1276
1310
  size: "sm",
1277
1311
  tone: "placeholder"
1278
1312
  }, {
1279
1313
  default: a(() => [
1280
- z(V(e(d)("panel.no-recipients")), 1)
1314
+ S(V(e(c)("panel.no-recipients")), 1)
1281
1315
  ]),
1282
1316
  _: 1
1283
- })) : H("", !0),
1284
- (u(!0), j(ee, null, ke(e(l), (h, O) => (u(), j("div", {
1285
- key: O,
1286
- class: "wx-inbox-recipients__row"
1317
+ })) : P("", !0),
1318
+ (o(!0), G(ee, null, ge(e(l), (h, I) => (o(), G("div", {
1319
+ key: I,
1320
+ class: "wx-inbox-recipients__item"
1287
1321
  }, [
1288
- L(h) ? (u(), w(e(ve), {
1322
+ K("div", it, [
1323
+ e(Le)(h) ? (o(), w(e(fe), {
1324
+ key: 0,
1325
+ "model-value": h.admin_id,
1326
+ options: p.value,
1327
+ "onUpdate:modelValue": (x) => b(I, Number(x))
1328
+ }, null, 8, ["model-value", "options", "onUpdate:modelValue"])) : (o(), w(e(le), {
1329
+ key: 1,
1330
+ "model-value": h.email,
1331
+ type: "email",
1332
+ placeholder: "sales@example.com",
1333
+ "onUpdate:modelValue": (x) => F(I, String(x))
1334
+ }, null, 8, ["model-value", "onUpdate:modelValue"])),
1335
+ t(e($e), {
1336
+ icon: "trash",
1337
+ tone: "danger",
1338
+ title: e(c)("panel.remove"),
1339
+ onClick: (x) => z(I)
1340
+ }, null, 8, ["title", "onClick"])
1341
+ ]),
1342
+ D(h) ? (o(), w(e(Q), {
1289
1343
  key: 0,
1290
- "model-value": h.admin_id,
1291
- options: p.value,
1292
- "onUpdate:modelValue": (_) => b(O, Number(_))
1293
- }, null, 8, ["model-value", "options", "onUpdate:modelValue"])) : (u(), w(e(X), {
1294
- key: 1,
1295
- "model-value": h.email,
1296
- type: "email",
1297
- placeholder: "sales@example.com",
1298
- "onUpdate:modelValue": (_) => W(O, String(_))
1299
- }, null, 8, ["model-value", "onUpdate:modelValue"])),
1300
- t(e(Ve), {
1301
- icon: "trash",
1302
- tone: "danger",
1303
- title: e(d)("panel.remove"),
1304
- onClick: (_) => T(O)
1305
- }, null, 8, ["title", "onClick"])
1344
+ size: "sm",
1345
+ tone: "danger"
1346
+ }, {
1347
+ default: a(() => [
1348
+ S(V(D(h)), 1)
1349
+ ]),
1350
+ _: 2
1351
+ }, 1024)) : P("", !0)
1306
1352
  ]))), 128))
1307
1353
  ]),
1308
- t(e(qe), { size: "sm" }, {
1354
+ t(e(Ae), { size: "sm" }, {
1309
1355
  default: a(() => [
1310
- t(e(le), {
1356
+ t(e(te), {
1311
1357
  variant: "outline",
1312
1358
  icon: "user",
1313
1359
  disabled: p.value.length === 0,
1314
1360
  onClick: $[0] || ($[0] = (h) => C({ admin_id: Number(p.value[0]?.value) }))
1315
1361
  }, {
1316
1362
  default: a(() => [
1317
- z(V(e(d)("panel.add-admin")), 1)
1363
+ S(V(e(c)("panel.add-admin")), 1)
1318
1364
  ]),
1319
1365
  _: 1
1320
1366
  }, 8, ["disabled"]),
1321
- t(e(le), {
1367
+ t(e(te), {
1322
1368
  variant: "outline",
1323
1369
  onClick: $[1] || ($[1] = (h) => C({ email: "" }))
1324
1370
  }, {
1325
1371
  icon: a(() => [
1326
- t(e($e), { name: "mail" })
1372
+ t(e(_e), { name: "mail" })
1327
1373
  ]),
1328
1374
  default: a(() => [
1329
- z(" " + V(e(d)("panel.add-email")), 1)
1375
+ S(" " + V(e(c)("panel.add-email")), 1)
1330
1376
  ]),
1331
1377
  _: 1
1332
1378
  })
1333
1379
  ]),
1334
1380
  _: 1
1335
1381
  }),
1336
- t(e(B), {
1337
- label: e(d)("panel.email-field"),
1338
- help: e(d)("panel.email-field-help")
1382
+ t(e(H), {
1383
+ label: e(c)("panel.email-field"),
1384
+ help: e(c)("panel.email-field-help")
1339
1385
  }, {
1340
1386
  default: a(() => [
1341
- t(e(ve), {
1342
- modelValue: e(U),
1343
- "onUpdate:modelValue": $[2] || ($[2] = (h) => ne(U) ? U.value = h : null),
1344
- options: i.value
1387
+ t(e(fe), {
1388
+ modelValue: e(T),
1389
+ "onUpdate:modelValue": $[2] || ($[2] = (h) => se(T) ? T.value = h : null),
1390
+ options: d.value
1345
1391
  }, null, 8, ["modelValue", "options"])
1346
1392
  ]),
1347
1393
  _: 1
@@ -1350,56 +1396,58 @@ const jl = /* @__PURE__ */ ae({
1350
1396
  _: 1
1351
1397
  }, 8, ["title"]));
1352
1398
  }
1353
- }), nt = /* @__PURE__ */ ie(at, [["__scopeId", "data-v-a5998eb4"]]), st = { class: "wx-inbox-editor" }, ot = /* @__PURE__ */ ae({
1399
+ }), rt = /* @__PURE__ */ ue(ut, [["__scopeId", "data-v-2ce96844"]]), dt = { class: "wx-inbox-editor" }, ct = /* @__PURE__ */ ne({
1354
1400
  __name: "FormEditorPage",
1355
1401
  props: {
1356
1402
  base: { default: "/inbox" }
1357
1403
  },
1358
- setup(r) {
1359
- const s = r, o = oe(), f = de(o), n = Oe(), d = Pe(), m = xe();
1360
- ce();
1361
- const l = te("webx-inbox"), U = be(), p = F(null), i = F([]), L = F(!0), C = F(!1), T = F({});
1362
- let b = bl({
1404
+ setup(i) {
1405
+ const s = i, u = ie(), v = ce(u), n = Re(), c = Be(), f = we();
1406
+ pe();
1407
+ const l = ae("webx-inbox"), T = ye(), p = q(null), d = q([]), D = q(!0), C = q(!1), z = q({});
1408
+ let b = hl({
1363
1409
  slug: "",
1364
1410
  title: {},
1365
1411
  is_enabled: !0
1366
1412
  });
1367
- const W = F({}), c = S(() => o.can("inbox.manage")), $ = S(() => Number(n.params.id)), h = S(
1368
- () => p.value === null ? "" : fe(b.title, m.active.value, b.slug)
1369
- ), O = S(() => `${s.base}?form=${$.value}`);
1370
- async function _() {
1371
- L.value = !0;
1413
+ const F = q({}), $ = q(["general", "fields", "notifications", "antispam", "embed"].includes(String(n.query.tab)) ? String(n.query.tab) : "general"), h = U(
1414
+ () => b.is_enabled && !st(F.value.recipients, p.value?.recipients)
1415
+ ), I = U(() => u.can("inbox.manage")), x = U(() => Number(n.params.id)), E = U(
1416
+ () => p.value === null ? "" : be(b.title, f.active.value, b.slug)
1417
+ ), j = U(() => `${s.base}?form=${x.value}`);
1418
+ async function R() {
1419
+ D.value = !0;
1372
1420
  try {
1373
- const N = await f.form($.value);
1374
- p.value = N, i.value = N.fields ?? [], b.slug = N.slug, b.title = { ...N.title }, b.is_enabled = N.is_enabled, W.value = { ...N.options };
1375
- } catch (N) {
1376
- P.danger(U(N)), d.replace(s.base);
1421
+ const r = await v.form(x.value);
1422
+ p.value = r, d.value = r.fields ?? [], b.slug = r.slug, b.title = { ...r.title }, b.is_enabled = r.is_enabled, F.value = { ...r.options };
1423
+ } catch (r) {
1424
+ L.danger(T(r)), c.replace(s.base);
1377
1425
  } finally {
1378
- L.value = !1;
1426
+ D.value = !1;
1379
1427
  }
1380
1428
  }
1381
- Ce($, () => {
1382
- _();
1429
+ Te(x, () => {
1430
+ R();
1383
1431
  }, { immediate: !0 });
1384
- async function E() {
1385
- C.value = !0, T.value = {};
1432
+ async function B() {
1433
+ C.value = !0, z.value = {};
1386
1434
  try {
1387
- const N = await f.saveForm($.value, {
1435
+ const r = await v.saveForm(x.value, {
1388
1436
  slug: b.slug.trim(),
1389
1437
  title: b.title,
1390
1438
  is_enabled: b.is_enabled,
1391
- options: W.value
1439
+ options: F.value
1392
1440
  });
1393
- p.value = N, P.success(l("panel.saved"));
1394
- } catch (N) {
1395
- const q = N.body;
1396
- q?.errors ? (T.value = q.errors, P.danger(l("panel.failed"))) : P.danger(U(N));
1441
+ p.value = r, L.success(l("panel.saved"));
1442
+ } catch (r) {
1443
+ const O = r.body;
1444
+ O?.errors ? (z.value = O.errors, L.danger(l("panel.failed"))) : L.danger(T(r));
1397
1445
  } finally {
1398
1446
  C.value = !1;
1399
1447
  }
1400
1448
  }
1401
- return (N, q) => (u(), j("div", st, [
1402
- L.value ? (u(), w(e(se), { key: 0 }, {
1449
+ return (r, O) => (o(), G("div", dt, [
1450
+ D.value ? (o(), w(e(oe), { key: 0 }, {
1403
1451
  default: a(() => [
1404
1452
  t(e(We), {
1405
1453
  title: "",
@@ -1407,173 +1455,185 @@ const jl = /* @__PURE__ */ ae({
1407
1455
  })
1408
1456
  ]),
1409
1457
  _: 1
1410
- })) : p.value ? (u(), j(ee, { key: 1 }, [
1411
- t(e(Qe), {
1458
+ })) : p.value ? (o(), G(ee, { key: 1 }, [
1459
+ t(e(tl), {
1412
1460
  class: "wx-inbox-editor__head",
1413
- title: h.value,
1461
+ title: E.value,
1414
1462
  subtitle: p.value.slug,
1415
- back: O.value,
1463
+ back: j.value,
1416
1464
  "back-label": e(l)("panel.forms")
1417
1465
  }, {
1418
1466
  "title-after": a(() => [
1419
- e(b).is_enabled ? H("", !0) : (u(), w(e(Se), {
1467
+ e(b).is_enabled ? P("", !0) : (o(), w(e(Ue), {
1420
1468
  key: 0,
1421
1469
  type: "default"
1422
1470
  }, {
1423
1471
  default: a(() => [
1424
- z(V(e(l)("panel.off")), 1)
1472
+ S(V(e(l)("panel.off")), 1)
1425
1473
  ]),
1426
1474
  _: 1
1427
1475
  }))
1428
1476
  ]),
1429
1477
  _: 1
1430
1478
  }, 8, ["title", "subtitle", "back", "back-label"]),
1431
- t(e(Xe), {
1479
+ h.value ? (o(), w(e(Fe), {
1480
+ key: 0,
1481
+ class: "wx-inbox-editor__silent",
1482
+ type: "warning",
1483
+ variant: "soft",
1484
+ closable: !1,
1485
+ title: e(l)("panel.notifies-nobody"),
1486
+ description: e(l)("panel.notifies-nobody-text")
1487
+ }, null, 8, ["title", "description"])) : P("", !0),
1488
+ t(e(nl), {
1489
+ modelValue: $.value,
1490
+ "onUpdate:modelValue": O[5] || (O[5] = (J) => $.value = J),
1432
1491
  class: "wx-inbox-editor__tabs",
1433
1492
  "keep-alive": ""
1434
1493
  }, {
1435
1494
  default: a(() => [
1436
- t(e(ge), {
1495
+ t(e(xe), {
1437
1496
  value: "general",
1438
1497
  label: e(l)("panel.tab-general")
1439
1498
  }, {
1440
1499
  default: a(() => [
1441
- t(lt, {
1500
+ t(at, {
1442
1501
  settings: e(b),
1443
- "onUpdate:settings": q[0] || (q[0] = (M) => ne(b) ? b.value = M : b = M),
1444
- options: W.value,
1445
- "onUpdate:options": q[1] || (q[1] = (M) => W.value = M),
1446
- errors: T.value
1502
+ "onUpdate:settings": O[0] || (O[0] = (J) => se(b) ? b.value = J : b = J),
1503
+ options: F.value,
1504
+ "onUpdate:options": O[1] || (O[1] = (J) => F.value = J),
1505
+ errors: z.value
1447
1506
  }, null, 8, ["settings", "options", "errors"])
1448
1507
  ]),
1449
1508
  _: 1
1450
1509
  }, 8, ["label"]),
1451
- t(e(ge), {
1510
+ t(e(xe), {
1452
1511
  value: "fields",
1453
1512
  label: e(l)("panel.tab-fields")
1454
1513
  }, {
1455
1514
  default: a(() => [
1456
- t(Gl, {
1457
- modelValue: i.value,
1458
- "onUpdate:modelValue": q[2] || (q[2] = (M) => i.value = M),
1515
+ t(Kl, {
1516
+ modelValue: d.value,
1517
+ "onUpdate:modelValue": O[2] || (O[2] = (J) => d.value = J),
1459
1518
  form: p.value,
1460
- "can-manage": c.value
1519
+ "can-manage": I.value
1461
1520
  }, null, 8, ["modelValue", "form", "can-manage"])
1462
1521
  ]),
1463
1522
  _: 1
1464
1523
  }, 8, ["label"]),
1465
- t(e(ge), {
1524
+ t(e(xe), {
1466
1525
  value: "notifications",
1467
1526
  label: e(l)("panel.tab-notifications")
1468
1527
  }, {
1469
1528
  default: a(() => [
1470
- t(nt, {
1471
- modelValue: W.value,
1472
- "onUpdate:modelValue": q[3] || (q[3] = (M) => W.value = M),
1473
- fields: i.value,
1474
- errors: T.value
1475
- }, null, 8, ["modelValue", "fields", "errors"])
1529
+ t(rt, {
1530
+ modelValue: F.value,
1531
+ "onUpdate:modelValue": O[3] || (O[3] = (J) => F.value = J),
1532
+ fields: d.value,
1533
+ errors: z.value,
1534
+ reported: p.value.recipients
1535
+ }, null, 8, ["modelValue", "fields", "errors", "reported"])
1476
1536
  ]),
1477
1537
  _: 1
1478
1538
  }, 8, ["label"]),
1479
- t(e(ge), {
1539
+ t(e(xe), {
1480
1540
  value: "antispam",
1481
1541
  label: e(l)("panel.tab-antispam")
1482
1542
  }, {
1483
1543
  default: a(() => [
1484
- t(jl, {
1485
- modelValue: W.value,
1486
- "onUpdate:modelValue": q[4] || (q[4] = (M) => W.value = M)
1544
+ t(Yl, {
1545
+ modelValue: F.value,
1546
+ "onUpdate:modelValue": O[4] || (O[4] = (J) => F.value = J)
1487
1547
  }, null, 8, ["modelValue"])
1488
1548
  ]),
1489
1549
  _: 1
1490
1550
  }, 8, ["label"]),
1491
- t(e(ge), {
1551
+ t(e(xe), {
1492
1552
  value: "embed",
1493
1553
  label: e(l)("panel.tab-embed")
1494
1554
  }, {
1495
1555
  default: a(() => [
1496
- t(Jl, {
1556
+ t(et, {
1497
1557
  form: p.value,
1498
1558
  slug: e(b).slug,
1499
- fields: i.value
1559
+ fields: d.value
1500
1560
  }, null, 8, ["form", "slug", "fields"])
1501
1561
  ]),
1502
1562
  _: 1
1503
1563
  }, 8, ["label"])
1504
1564
  ]),
1505
1565
  _: 1
1506
- }),
1507
- c.value ? (u(), w(e(wl), { key: 0 }, {
1566
+ }, 8, ["modelValue"]),
1567
+ I.value ? (o(), w(e(Vl), { key: 1 }, {
1508
1568
  default: a(() => [
1509
- t(e(le), {
1569
+ t(e(te), {
1510
1570
  type: "primary",
1511
1571
  loading: C.value,
1512
- onClick: E
1572
+ onClick: B
1513
1573
  }, {
1514
1574
  default: a(() => [
1515
- z(V(e(l)("panel.save")), 1)
1575
+ S(V(e(l)("panel.save")), 1)
1516
1576
  ]),
1517
1577
  _: 1
1518
1578
  }, 8, ["loading"])
1519
1579
  ]),
1520
1580
  _: 1
1521
- })) : H("", !0)
1522
- ], 64)) : H("", !0)
1581
+ })) : P("", !0)
1582
+ ], 64)) : P("", !0)
1523
1583
  ]));
1524
1584
  }
1525
- }), it = /* @__PURE__ */ ie(ot, [["__scopeId", "data-v-11c10bb6"]]), ut = { class: "wx-inbox-create" }, rt = /* @__PURE__ */ ae({
1585
+ }), pt = /* @__PURE__ */ ue(ct, [["__scopeId", "data-v-8e53184e"]]), mt = { class: "wx-inbox-create" }, vt = /* @__PURE__ */ ne({
1526
1586
  __name: "FormCreateDialog",
1527
- setup(r) {
1528
- const { resolve: s, dismiss: o, open: f } = Ee(), n = oe(), d = de(n);
1529
- ce();
1530
- const m = te("webx-inbox"), l = be(), U = F({}), p = F(""), i = F(!1), L = F({});
1587
+ setup(i) {
1588
+ const { resolve: s, dismiss: u, open: v } = He(), n = ie(), c = ce(n);
1589
+ pe();
1590
+ const f = ae("webx-inbox"), l = ye(), T = q({}), p = q(""), d = q(!1), D = q({});
1531
1591
  function C(b) {
1532
- return L.value[b]?.[0];
1592
+ return D.value[b]?.[0];
1533
1593
  }
1534
- async function T() {
1535
- i.value = !0, L.value = {};
1594
+ async function z() {
1595
+ d.value = !0, D.value = {};
1536
1596
  try {
1537
1597
  s(
1538
- await d.createForm({
1539
- title: U.value,
1598
+ await c.createForm({
1599
+ title: T.value,
1540
1600
  slug: p.value.trim(),
1541
1601
  is_enabled: !0,
1542
1602
  options: {}
1543
1603
  })
1544
1604
  );
1545
1605
  } catch (b) {
1546
- const W = b.body;
1547
- W?.errors ? (L.value = W.errors, P.danger(m("panel.failed"))) : P.danger(l(b));
1606
+ const F = b.body;
1607
+ F?.errors ? (D.value = F.errors, L.danger(f("panel.failed"))) : L.danger(l(b));
1548
1608
  } finally {
1549
- i.value = !1;
1609
+ d.value = !1;
1550
1610
  }
1551
1611
  }
1552
- return (b, W) => (u(), w(e(Re), {
1553
- open: e(f),
1554
- "onUpdate:open": W[3] || (W[3] = (c) => ne(f) ? f.value = c : null),
1555
- title: e(m)("panel.new-form-title"),
1612
+ return (b, F) => (o(), w(e(Ge), {
1613
+ open: e(v),
1614
+ "onUpdate:open": F[3] || (F[3] = (m) => se(v) ? v.value = m : null),
1615
+ title: e(f)("panel.new-form-title"),
1556
1616
  width: 520
1557
1617
  }, {
1558
1618
  footer: a(() => [
1559
- t(e(qe), { size: "sm" }, {
1619
+ t(e(Ae), { size: "sm" }, {
1560
1620
  default: a(() => [
1561
- t(e(le), {
1621
+ t(e(te), {
1562
1622
  variant: "outline",
1563
- onClick: W[2] || (W[2] = (c) => e(o)())
1623
+ onClick: F[2] || (F[2] = (m) => e(u)())
1564
1624
  }, {
1565
1625
  default: a(() => [
1566
- z(V(e(m)("panel.cancel")), 1)
1626
+ S(V(e(f)("panel.cancel")), 1)
1567
1627
  ]),
1568
1628
  _: 1
1569
1629
  }),
1570
- t(e(le), {
1630
+ t(e(te), {
1571
1631
  type: "primary",
1572
- loading: i.value,
1573
- onClick: T
1632
+ loading: d.value,
1633
+ onClick: z
1574
1634
  }, {
1575
1635
  default: a(() => [
1576
- z(V(e(m)("panel.save")), 1)
1636
+ S(V(e(f)("panel.save")), 1)
1577
1637
  ]),
1578
1638
  _: 1
1579
1639
  }, 8, ["loading"])
@@ -1582,31 +1642,31 @@ const jl = /* @__PURE__ */ ae({
1582
1642
  })
1583
1643
  ]),
1584
1644
  default: a(() => [
1585
- G("div", ut, [
1586
- t(e(B), {
1587
- label: e(m)("panel.title"),
1645
+ K("div", mt, [
1646
+ t(e(H), {
1647
+ label: e(f)("panel.title"),
1588
1648
  error: C("title"),
1589
1649
  required: ""
1590
1650
  }, {
1591
1651
  default: a(() => [
1592
- t(e(X), {
1593
- modelValue: U.value,
1594
- "onUpdate:modelValue": W[0] || (W[0] = (c) => U.value = c),
1652
+ t(e(le), {
1653
+ modelValue: T.value,
1654
+ "onUpdate:modelValue": F[0] || (F[0] = (m) => T.value = m),
1595
1655
  localized: "",
1596
1656
  autofocus: ""
1597
1657
  }, null, 8, ["modelValue"])
1598
1658
  ]),
1599
1659
  _: 1
1600
1660
  }, 8, ["label", "error"]),
1601
- t(e(B), {
1602
- label: e(m)("panel.slug"),
1603
- help: e(m)("panel.slug-help"),
1661
+ t(e(H), {
1662
+ label: e(f)("panel.slug"),
1663
+ help: e(f)("panel.slug-help"),
1604
1664
  error: C("slug")
1605
1665
  }, {
1606
1666
  default: a(() => [
1607
- t(e(X), {
1667
+ t(e(le), {
1608
1668
  modelValue: p.value,
1609
- "onUpdate:modelValue": W[1] || (W[1] = (c) => p.value = c),
1669
+ "onUpdate:modelValue": F[1] || (F[1] = (m) => p.value = m),
1610
1670
  placeholder: "contact"
1611
1671
  }, null, 8, ["modelValue"])
1612
1672
  ]),
@@ -1617,84 +1677,84 @@ const jl = /* @__PURE__ */ ae({
1617
1677
  _: 1
1618
1678
  }, 8, ["open", "title"]));
1619
1679
  }
1620
- }), dt = /* @__PURE__ */ ie(rt, [["__scopeId", "data-v-55fb40d8"]]), ct = { class: "wx-inbox-by-hand" }, pt = /* @__PURE__ */ ae({
1680
+ }), ft = /* @__PURE__ */ ue(vt, [["__scopeId", "data-v-55fb40d8"]]), bt = { class: "wx-inbox-by-hand" }, yt = /* @__PURE__ */ ne({
1621
1681
  __name: "SubmissionCreateDialog",
1622
1682
  props: {
1623
1683
  form: {}
1624
1684
  },
1625
- setup(r) {
1626
- const s = r, { resolve: o, dismiss: f, open: n } = Ee(), d = oe(), m = de(d), l = xe();
1627
- ce();
1628
- const U = te("webx-inbox"), p = be(), i = F([]), L = F(!0), C = F(!1), T = F({}), b = F({}), W = S(() => i.value.filter((q) => q.type !== "file")), c = S(() => i.value.some((q) => q.type === "file"));
1629
- function $(q) {
1630
- return b.value[`fields.${q.key}`]?.[0];
1631
- }
1632
- function h(q) {
1633
- return fe(q.title, l.active.value, q.key);
1634
- }
1635
- function O(q, M = "") {
1636
- return fe(
1637
- q,
1685
+ setup(i) {
1686
+ const s = i, { resolve: u, dismiss: v, open: n } = He(), c = ie(), f = ce(c), l = we();
1687
+ pe();
1688
+ const T = ae("webx-inbox"), p = ye(), d = q([]), D = q(!0), C = q(!1), z = q({}), b = q({}), F = U(() => d.value.filter((R) => R.type !== "file")), m = U(() => d.value.some((R) => R.type === "file"));
1689
+ function $(R) {
1690
+ return b.value[`fields.${R.key}`]?.[0];
1691
+ }
1692
+ function h(R) {
1693
+ return be(R.title, l.active.value, R.key);
1694
+ }
1695
+ function I(R, B = "") {
1696
+ return be(
1697
+ R,
1638
1698
  l.active.value,
1639
- M
1699
+ B
1640
1700
  );
1641
1701
  }
1642
- function _(q) {
1643
- return (q.options.choices ?? []).map((M) => ({
1644
- value: M.value,
1645
- label: O(M.label, M.value)
1702
+ function x(R) {
1703
+ return (R.options.choices ?? []).map((B) => ({
1704
+ value: B.value,
1705
+ label: I(B.label, B.value)
1646
1706
  }));
1647
1707
  }
1648
1708
  async function E() {
1649
1709
  try {
1650
- const q = await m.form(s.form.id);
1651
- i.value = (q.fields ?? []).filter((M) => M.is_enabled);
1652
- for (const M of i.value)
1653
- T.value[M.key] = M.type === "checkbox" ? [] : M.type === "consent" ? !1 : "";
1654
- } catch (q) {
1655
- P.danger(p(q));
1710
+ const R = await f.form(s.form.id);
1711
+ d.value = (R.fields ?? []).filter((B) => B.is_enabled);
1712
+ for (const B of d.value)
1713
+ z.value[B.key] = B.type === "checkbox" ? [] : B.type === "consent" ? !1 : "";
1714
+ } catch (R) {
1715
+ L.danger(p(R));
1656
1716
  } finally {
1657
- L.value = !1;
1717
+ D.value = !1;
1658
1718
  }
1659
1719
  }
1660
1720
  E();
1661
- async function N() {
1721
+ async function j() {
1662
1722
  C.value = !0, b.value = {};
1663
1723
  try {
1664
- o(await m.createSubmission(s.form.id, T.value));
1665
- } catch (q) {
1666
- const M = q.body;
1667
- M?.errors ? (b.value = M.errors, P.danger(U("panel.failed"))) : P.danger(p(q));
1724
+ u(await f.createSubmission(s.form.id, z.value));
1725
+ } catch (R) {
1726
+ const B = R.body;
1727
+ B?.errors ? (b.value = B.errors, L.danger(T("panel.failed"))) : L.danger(p(R));
1668
1728
  } finally {
1669
1729
  C.value = !1;
1670
1730
  }
1671
1731
  }
1672
- return (q, M) => (u(), w(e(Re), {
1732
+ return (R, B) => (o(), w(e(Ge), {
1673
1733
  open: e(n),
1674
- "onUpdate:open": M[1] || (M[1] = (v) => ne(n) ? n.value = v : null),
1675
- title: e(U)("panel.new-submission-title"),
1734
+ "onUpdate:open": B[1] || (B[1] = (r) => se(n) ? n.value = r : null),
1735
+ title: e(T)("panel.new-submission-title"),
1676
1736
  width: 560
1677
1737
  }, {
1678
1738
  footer: a(() => [
1679
- t(e(qe), { size: "sm" }, {
1739
+ t(e(Ae), { size: "sm" }, {
1680
1740
  default: a(() => [
1681
- t(e(le), {
1741
+ t(e(te), {
1682
1742
  variant: "outline",
1683
- onClick: M[0] || (M[0] = (v) => e(f)())
1743
+ onClick: B[0] || (B[0] = (r) => e(v)())
1684
1744
  }, {
1685
1745
  default: a(() => [
1686
- z(V(e(U)("panel.cancel")), 1)
1746
+ S(V(e(T)("panel.cancel")), 1)
1687
1747
  ]),
1688
1748
  _: 1
1689
1749
  }),
1690
- t(e(le), {
1750
+ t(e(te), {
1691
1751
  type: "primary",
1692
1752
  loading: C.value,
1693
- disabled: L.value,
1694
- onClick: N
1753
+ disabled: D.value,
1754
+ onClick: j
1695
1755
  }, {
1696
1756
  default: a(() => [
1697
- z(V(e(U)("panel.save")), 1)
1757
+ S(V(e(T)("panel.save")), 1)
1698
1758
  ]),
1699
1759
  _: 1
1700
1760
  }, 8, ["loading", "disabled"])
@@ -1703,169 +1763,169 @@ const jl = /* @__PURE__ */ ae({
1703
1763
  })
1704
1764
  ]),
1705
1765
  default: a(() => [
1706
- G("div", ct, [
1707
- t(e(Me), {
1766
+ K("div", bt, [
1767
+ t(e(Fe), {
1708
1768
  type: "info",
1709
1769
  closable: !1
1710
1770
  }, {
1711
1771
  default: a(() => [
1712
- z(V(e(U)("panel.new-submission-help")), 1)
1772
+ S(V(e(T)("panel.new-submission-help")), 1)
1713
1773
  ]),
1714
1774
  _: 1
1715
1775
  }),
1716
- L.value ? (u(), w(e(We), {
1776
+ D.value ? (o(), w(e(We), {
1717
1777
  key: 0,
1718
1778
  rows: 4
1719
- })) : (u(), j(ee, { key: 1 }, [
1720
- (u(!0), j(ee, null, ke(W.value, (v) => (u(), w(e(B), {
1721
- key: v.id,
1722
- label: h(v),
1723
- help: O(v.help),
1724
- error: $(v),
1725
- required: v.is_required
1779
+ })) : (o(), G(ee, { key: 1 }, [
1780
+ (o(!0), G(ee, null, ge(F.value, (r) => (o(), w(e(H), {
1781
+ key: r.id,
1782
+ label: h(r),
1783
+ help: I(r.help),
1784
+ error: $(r),
1785
+ required: r.is_required
1726
1786
  }, {
1727
1787
  default: a(() => [
1728
- v.type === "textarea" ? (u(), w(e(kl), {
1788
+ r.type === "textarea" ? (o(), w(e($l), {
1729
1789
  key: 0,
1730
- modelValue: T.value[v.key],
1731
- "onUpdate:modelValue": (Y) => T.value[v.key] = Y,
1732
- rows: v.options.rows ?? 4,
1733
- placeholder: O(v.placeholder)
1734
- }, null, 8, ["modelValue", "onUpdate:modelValue", "rows", "placeholder"])) : v.type === "select" ? (u(), w(e(ve), {
1790
+ modelValue: z.value[r.key],
1791
+ "onUpdate:modelValue": (O) => z.value[r.key] = O,
1792
+ rows: r.options.rows ?? 4,
1793
+ placeholder: I(r.placeholder)
1794
+ }, null, 8, ["modelValue", "onUpdate:modelValue", "rows", "placeholder"])) : r.type === "select" ? (o(), w(e(fe), {
1735
1795
  key: 1,
1736
- modelValue: T.value[v.key],
1737
- "onUpdate:modelValue": (Y) => T.value[v.key] = Y,
1738
- options: _(v),
1796
+ modelValue: z.value[r.key],
1797
+ "onUpdate:modelValue": (O) => z.value[r.key] = O,
1798
+ options: x(r),
1739
1799
  clearable: "",
1740
- placeholder: O(v.placeholder)
1741
- }, null, 8, ["modelValue", "onUpdate:modelValue", "options", "placeholder"])) : v.type === "radio" ? (u(), w(e(Vl), {
1800
+ placeholder: I(r.placeholder)
1801
+ }, null, 8, ["modelValue", "onUpdate:modelValue", "options", "placeholder"])) : r.type === "radio" ? (o(), w(e(Ul), {
1742
1802
  key: 2,
1743
- modelValue: T.value[v.key],
1744
- "onUpdate:modelValue": (Y) => T.value[v.key] = Y,
1745
- options: _(v)
1746
- }, null, 8, ["modelValue", "onUpdate:modelValue", "options"])) : v.type === "checkbox" ? (u(), w(e($l), {
1803
+ modelValue: z.value[r.key],
1804
+ "onUpdate:modelValue": (O) => z.value[r.key] = O,
1805
+ options: x(r)
1806
+ }, null, 8, ["modelValue", "onUpdate:modelValue", "options"])) : r.type === "checkbox" ? (o(), w(e(Sl), {
1747
1807
  key: 3,
1748
- modelValue: T.value[v.key],
1749
- "onUpdate:modelValue": (Y) => T.value[v.key] = Y,
1750
- options: _(v)
1751
- }, null, 8, ["modelValue", "onUpdate:modelValue", "options"])) : v.type === "consent" ? (u(), w(e(he), {
1808
+ modelValue: z.value[r.key],
1809
+ "onUpdate:modelValue": (O) => z.value[r.key] = O,
1810
+ options: x(r)
1811
+ }, null, 8, ["modelValue", "onUpdate:modelValue", "options"])) : r.type === "consent" ? (o(), w(e(he), {
1752
1812
  key: 4,
1753
- modelValue: T.value[v.key],
1754
- "onUpdate:modelValue": (Y) => T.value[v.key] = Y,
1755
- label: O(v.options.text, h(v))
1756
- }, null, 8, ["modelValue", "onUpdate:modelValue", "label"])) : v.type === "date" ? (u(), w(e(Ze), {
1813
+ modelValue: z.value[r.key],
1814
+ "onUpdate:modelValue": (O) => z.value[r.key] = O,
1815
+ label: I(r.options.text, h(r))
1816
+ }, null, 8, ["modelValue", "onUpdate:modelValue", "label"])) : r.type === "date" ? (o(), w(e(ll), {
1757
1817
  key: 5,
1758
- modelValue: T.value[v.key],
1759
- "onUpdate:modelValue": (Y) => T.value[v.key] = Y,
1760
- placeholder: O(v.placeholder)
1761
- }, null, 8, ["modelValue", "onUpdate:modelValue", "placeholder"])) : (u(), w(e(X), {
1818
+ modelValue: z.value[r.key],
1819
+ "onUpdate:modelValue": (O) => z.value[r.key] = O,
1820
+ placeholder: I(r.placeholder)
1821
+ }, null, 8, ["modelValue", "onUpdate:modelValue", "placeholder"])) : (o(), w(e(le), {
1762
1822
  key: 6,
1763
- modelValue: T.value[v.key],
1764
- "onUpdate:modelValue": (Y) => T.value[v.key] = Y,
1765
- type: v.type === "email" ? "email" : v.type === "tel" ? "tel" : "text",
1766
- placeholder: O(v.placeholder),
1767
- maxlength: v.options.maxlength
1823
+ modelValue: z.value[r.key],
1824
+ "onUpdate:modelValue": (O) => z.value[r.key] = O,
1825
+ type: r.type === "email" ? "email" : r.type === "tel" ? "tel" : "text",
1826
+ placeholder: I(r.placeholder),
1827
+ maxlength: r.options.maxlength
1768
1828
  }, null, 8, ["modelValue", "onUpdate:modelValue", "type", "placeholder", "maxlength"]))
1769
1829
  ]),
1770
1830
  _: 2
1771
1831
  }, 1032, ["label", "help", "error", "required"]))), 128)),
1772
- c.value ? (u(), w(e(Me), {
1832
+ m.value ? (o(), w(e(Fe), {
1773
1833
  key: 0,
1774
1834
  type: "warning",
1775
1835
  closable: !1
1776
1836
  }, {
1777
1837
  default: a(() => [
1778
- z(V(e(U)("panel.no-files-by-hand")), 1)
1838
+ S(V(e(T)("panel.no-files-by-hand")), 1)
1779
1839
  ]),
1780
1840
  _: 1
1781
- })) : H("", !0)
1841
+ })) : P("", !0)
1782
1842
  ], 64))
1783
1843
  ])
1784
1844
  ]),
1785
1845
  _: 1
1786
1846
  }, 8, ["open", "title"]));
1787
1847
  }
1788
- }), mt = /* @__PURE__ */ ie(pt, [["__scopeId", "data-v-72006299"]]), vt = { class: "wx-submissions__mass" }, ft = { class: "wx-submissions__state" }, bt = 640, ht = /* @__PURE__ */ ae({
1848
+ }), ht = /* @__PURE__ */ ue(yt, [["__scopeId", "data-v-72006299"]]), gt = { class: "wx-submissions__mass" }, xt = { class: "wx-submissions__state" }, _t = 640, wt = /* @__PURE__ */ ne({
1789
1849
  __name: "SubmissionList",
1790
1850
  props: {
1791
1851
  form: {},
1792
1852
  base: { default: "/inbox" }
1793
1853
  },
1794
1854
  emits: ["changed"],
1795
- setup(r, { expose: s, emit: o }) {
1796
- const f = r, n = o, d = oe(), m = de(d), l = Oe(), U = Pe(), p = xe();
1797
- ce();
1798
- const i = il("root"), L = Ul(i), C = S(() => L.value > 0 && L.value < bt), T = S(() => C.value ? Number.POSITIVE_INFINITY : 0), b = te("webx-inbox"), W = te("webx-admin"), c = be(), $ = F(null), h = F([]), O = F(!1), _ = F([]), E = F(!1), N = S(() => d.can("inbox.update")), q = Be(mt), M = S({
1855
+ setup(i, { expose: s, emit: u }) {
1856
+ const v = i, n = u, c = ie(), f = ce(c), l = Re(), T = Be(), p = we();
1857
+ pe();
1858
+ const d = cl("root"), D = Tl(d), C = U(() => D.value > 0 && D.value < _t), z = U(() => C.value ? Number.POSITIVE_INFINITY : 0), b = ae("webx-inbox"), F = ae("webx-admin"), m = ye(), $ = q(null), h = q([]), I = q(!1), x = q([]), E = q(!1), j = U(() => c.can("inbox.update")), R = je(ht), B = U({
1799
1859
  get: () => typeof l.query.view == "string" && l.query.view !== "" ? l.query.view : "all",
1800
- set: (x) => {
1801
- U.replace({
1802
- query: { ...l.query, view: x === "all" ? void 0 : x, page: void 0 }
1860
+ set: (_) => {
1861
+ T.replace({
1862
+ query: { ...l.query, view: _ === "all" ? void 0 : _, page: void 0 }
1803
1863
  });
1804
1864
  }
1805
- }), v = S(() => ({
1806
- view: M.value,
1865
+ }), r = U(() => ({
1866
+ view: B.value,
1807
1867
  search: typeof l.query.search == "string" ? l.query.search : "",
1808
1868
  assignee: typeof l.query.assignee == "string" ? l.query.assignee : null,
1809
1869
  placement: typeof l.query.placement == "string" ? l.query.placement : null,
1810
1870
  sort: typeof l.query.sort == "string" ? l.query.sort : null,
1811
1871
  page: Number(l.query.page ?? 1) || 1
1812
- })), Y = S(
1872
+ })), O = U(
1813
1873
  () => ($.value?.placements ?? []).map(
1814
- (x) => x === null ? { value: "none", label: b("panel.placement-none") } : { value: x, label: x }
1874
+ (_) => _ === null ? { value: "none", label: b("panel.placement-none") } : { value: _, label: _ }
1815
1875
  )
1816
- ), ye = S(
1817
- () => Y.value.length > 1 || v.value.placement !== null
1818
- ), pe = S(() => {
1819
- const x = v.value.placement;
1820
- if (x === null) return [];
1821
- const K = Y.value.find((D) => D.value === x)?.label ?? (x === "none" ? b("panel.placement-none") : x);
1876
+ ), J = U(
1877
+ () => O.value.length > 1 || r.value.placement !== null
1878
+ ), me = U(() => {
1879
+ const _ = r.value.placement;
1880
+ if (_ === null) return [];
1881
+ const Z = O.value.find((N) => N.value === _)?.label ?? (_ === "none" ? b("panel.placement-none") : _);
1822
1882
  return [
1823
1883
  {
1824
1884
  key: "placement",
1825
- label: `${b("panel.meta-placement")}: ${K}`,
1885
+ label: `${b("panel.meta-placement")}: ${Z}`,
1826
1886
  clear: () => A(void 0)
1827
1887
  }
1828
1888
  ];
1829
1889
  });
1830
- function A(x) {
1831
- U.replace({
1890
+ function A(_) {
1891
+ T.replace({
1832
1892
  query: {
1833
1893
  ...l.query,
1834
- placement: typeof x == "string" && x !== "" ? x : void 0,
1894
+ placement: typeof _ == "string" && _ !== "" ? _ : void 0,
1835
1895
  page: void 0
1836
1896
  }
1837
1897
  });
1838
1898
  }
1839
- const Q = S(() => {
1840
- const x = $.value?.counts, K = [
1841
- { value: "all", label: b("panel.view-all"), badge: x?.all || void 0 },
1842
- { value: "unread", label: b("panel.view-unread"), badge: x?.unread || void 0 }
1899
+ const X = U(() => {
1900
+ const _ = $.value?.counts, Z = [
1901
+ { value: "all", label: b("panel.view-all"), badge: _?.all || void 0 },
1902
+ { value: "unread", label: b("panel.view-unread"), badge: _?.unread || void 0 }
1843
1903
  ];
1844
- for (const D of h.value)
1845
- K.push({
1846
- value: D.key,
1847
- label: re(D),
1848
- badge: x?.statuses[D.key] || void 0
1904
+ for (const N of h.value)
1905
+ Z.push({
1906
+ value: N.key,
1907
+ label: de(N),
1908
+ badge: _?.statuses[N.key] || void 0
1849
1909
  });
1850
- return K;
1910
+ return Z;
1851
1911
  });
1852
- function I(x, K) {
1853
- const D = $.value?.columns?.[K];
1854
- return D ? x.values[D.key] ?? "" : "";
1912
+ function W(_, Z) {
1913
+ const N = $.value?.columns?.[Z];
1914
+ return N ? _.values[N.key] ?? "" : "";
1855
1915
  }
1856
- const k = S(() => {
1857
- const x = $.value?.columns ?? [];
1916
+ const k = U(() => {
1917
+ const _ = $.value?.columns ?? [];
1858
1918
  return C.value ? [{ key: "card", label: "" }] : [
1859
- ...x.map((K, D) => ({
1860
- key: `values.${K.key}`,
1861
- label: K.label,
1919
+ ..._.map((Z, N) => ({
1920
+ key: `values.${Z.key}`,
1921
+ label: Z.label,
1862
1922
  sortable: !0,
1863
1923
  // The first answer is what the row is recognised by and stays at any width; every one
1864
1924
  // after it is worth less than the room it takes, so it goes a step sooner. The steps are
1865
1925
  // wide — 640, 960 — because an answer is a sentence and not a number: two of them plus
1866
1926
  // the status and the date is already what a 755px pane holds without scrolling sideways,
1867
1927
  // which is what the pane beside the forms actually is on a 1280 screen (§11).
1868
- hideBelow: D === 0 ? void 0 : 320 + D * 320
1928
+ hideBelow: N === 0 ? void 0 : 320 + N * 320
1869
1929
  })),
1870
1930
  // A floor rather than a width: the cell holds a badge, sometimes an avatar and sometimes
1871
1931
  // a paperclip, and a fixed width that any of them overflows makes the whole table scroll
@@ -1883,67 +1943,67 @@ const jl = /* @__PURE__ */ ae({
1883
1943
  // Kept on the card, unlike most dates: "when did this come in" is one of the two
1884
1944
  // questions a submission is looked at for, and the other one is who sent it.
1885
1945
  },
1886
- { key: "actions", label: "", width: hl, align: "right", hideOnCards: !0 }
1946
+ { key: "actions", label: "", width: gl, align: "right", hideOnCards: !0 }
1887
1947
  ];
1888
- }), y = S(
1889
- () => v.value.view === "all" && v.value.search === "" && v.value.assignee === null && v.value.placement === null ? b("panel.submissions-empty") : b("panel.submissions-none")
1890
- ), ue = S(
1891
- () => h.value.map((x) => ({ value: x.id, label: re(x) }))
1948
+ }), g = U(
1949
+ () => r.value.view === "all" && r.value.search === "" && r.value.assignee === null && r.value.placement === null ? b("panel.submissions-empty") : b("panel.submissions-none")
1950
+ ), re = U(
1951
+ () => h.value.map((_) => ({ value: _.id, label: de(_) }))
1892
1952
  );
1893
- function re(x) {
1894
- return fe(x.title, p.active.value, x.key);
1953
+ function de(_) {
1954
+ return be(_.title, p.active.value, _.key);
1895
1955
  }
1896
- function Ge() {
1897
- return fe(f.form.title, p.active.value, f.form.slug);
1956
+ function Ne() {
1957
+ return be(v.form.title, p.active.value, v.form.slug);
1898
1958
  }
1899
- async function _e(x) {
1900
- O.value = !0;
1959
+ async function ke(_) {
1960
+ I.value = !0;
1901
1961
  try {
1902
- $.value = await m.submissions(f.form.id, {
1903
- view: v.value.view,
1904
- search: x?.search ?? v.value.search,
1905
- assignee: v.value.assignee,
1906
- placement: v.value.placement,
1907
- sort: x?.sort ? `${x.sort.order === "desc" ? "-" : ""}${x.sort.key}` : null,
1908
- page: x?.page ?? v.value.page,
1909
- per_page: x?.perPage
1962
+ $.value = await f.submissions(v.form.id, {
1963
+ view: r.value.view,
1964
+ search: _?.search ?? r.value.search,
1965
+ assignee: r.value.assignee,
1966
+ placement: r.value.placement,
1967
+ sort: _?.sort ? `${_.sort.order === "desc" ? "-" : ""}${_.sort.key}` : null,
1968
+ page: _?.page ?? r.value.page,
1969
+ per_page: _?.perPage
1910
1970
  });
1911
- } catch (K) {
1912
- P.danger(c(K));
1971
+ } catch (Z) {
1972
+ L.danger(m(Z));
1913
1973
  } finally {
1914
- O.value = !1;
1974
+ I.value = !1;
1915
1975
  }
1916
1976
  }
1917
- function g(x) {
1918
- const K = {
1977
+ function Ye(_) {
1978
+ const Z = {
1919
1979
  ...l.query,
1920
- search: x.search === "" ? void 0 : x.search,
1921
- sort: x.sort === null ? void 0 : `${x.sort.order === "desc" ? "-" : ""}${x.sort.key}`,
1922
- page: x.page === 1 ? void 0 : String(x.page)
1980
+ search: _.search === "" ? void 0 : _.search,
1981
+ sort: _.sort === null ? void 0 : `${_.sort.order === "desc" ? "-" : ""}${_.sort.key}`,
1982
+ page: _.page === 1 ? void 0 : String(_.page)
1923
1983
  };
1924
- U.replace({ query: K }), _e(x);
1984
+ T.replace({ query: Z }), ke(_);
1925
1985
  }
1926
- Ce([() => f.form.id, M, () => v.value.assignee, () => v.value.placement], () => {
1927
- _.value = [], _e();
1928
- }), _e(), Z();
1929
- async function Z() {
1986
+ Te([() => v.form.id, B, () => r.value.assignee, () => r.value.placement], () => {
1987
+ x.value = [], ke();
1988
+ }), ke(), Ze();
1989
+ async function Ze() {
1930
1990
  try {
1931
- h.value = await m.statuses();
1932
- } catch (x) {
1933
- P.danger(c(x));
1991
+ h.value = await f.statuses();
1992
+ } catch (_) {
1993
+ L.danger(m(_));
1934
1994
  }
1935
1995
  }
1936
- function R(x) {
1937
- U.push({ path: `${f.base}/submissions/${x.id}`, query: { ...l.query } });
1996
+ function Ie(_) {
1997
+ T.push({ path: `${v.base}/submissions/${_.id}`, query: { ...l.query } });
1938
1998
  }
1939
- function Ae(x) {
1940
- return N.value ? [
1999
+ function De(_) {
2000
+ return j.value ? [
1941
2001
  {
1942
2002
  key: "read",
1943
- icon: x.is_read ? "eye-off" : "eye",
1944
- label: x.is_read ? b("panel.mark-unread") : b("panel.mark-read"),
2003
+ icon: _.is_read ? "eye-off" : "eye",
2004
+ label: _.is_read ? b("panel.mark-unread") : b("panel.mark-read"),
1945
2005
  run: () => {
1946
- Ke([x.id], x.is_read ? "unread" : "read");
2006
+ Y([_.id], _.is_read ? "unread" : "read");
1947
2007
  }
1948
2008
  },
1949
2009
  {
@@ -1952,72 +2012,72 @@ const jl = /* @__PURE__ */ ae({
1952
2012
  label: b("panel.delete"),
1953
2013
  danger: !0,
1954
2014
  run: () => {
1955
- el([x.id]);
2015
+ y([_.id]);
1956
2016
  }
1957
2017
  }
1958
2018
  ] : [];
1959
2019
  }
1960
- async function je(x) {
1961
- typeof x == "number" && (E.value = !0, await Ke(
1962
- _.value.map((K) => K.id),
2020
+ async function Qe(_) {
2021
+ typeof _ == "number" && (E.value = !0, await Y(
2022
+ x.value.map((Z) => Z.id),
1963
2023
  "status",
1964
- x
2024
+ _
1965
2025
  ), E.value = !1);
1966
2026
  }
1967
- async function el(x) {
1968
- await ze({
1969
- title: x.length === 1 ? b("panel.delete-submission-title") : b("panel.delete-selected-title", { count: x.length }),
2027
+ async function y(_) {
2028
+ await Ce({
2029
+ title: _.length === 1 ? b("panel.delete-submission-title") : b("panel.delete-selected-title", { count: _.length }),
1970
2030
  message: b("panel.delete-submission-text"),
1971
2031
  confirmText: b("panel.delete"),
1972
2032
  cancelText: b("panel.cancel"),
1973
2033
  tone: "danger"
1974
- }) && await Ke(x, "delete");
2034
+ }) && await Y(_, "delete");
1975
2035
  }
1976
- async function Ke(x, K, D) {
1977
- if (x.length !== 0)
2036
+ async function Y(_, Z, N) {
2037
+ if (_.length !== 0)
1978
2038
  try {
1979
- await m.massSubmissions({ ids: x, action: K, status_id: D }), _.value = [], await _e(), n("changed");
1980
- } catch (Te) {
1981
- P.danger(c(Te));
2039
+ await f.massSubmissions({ ids: _, action: Z, status_id: N }), x.value = [], await ke(), n("changed");
2040
+ } catch (qe) {
2041
+ L.danger(m(qe));
1982
2042
  }
1983
2043
  }
1984
- async function pl() {
1985
- const x = await q({ form: f.form });
1986
- x && (P.success(b("panel.created")), await _e(), n("changed"), U.push({ path: `${f.base}/submissions/${x.id}`, query: { ...l.query } }));
1987
- }
1988
- const ml = S(
1989
- () => m.exportUrl(f.form.id, {
1990
- view: v.value.view,
1991
- search: v.value.search,
1992
- assignee: v.value.assignee,
1993
- placement: v.value.placement,
1994
- sort: v.value.sort
2044
+ async function M() {
2045
+ const _ = await R({ form: v.form });
2046
+ _ && (L.success(b("panel.created")), await ke(), n("changed"), T.push({ path: `${v.base}/submissions/${_.id}`, query: { ...l.query } }));
2047
+ }
2048
+ const Je = U(
2049
+ () => f.exportUrl(v.form.id, {
2050
+ view: r.value.view,
2051
+ search: r.value.search,
2052
+ assignee: r.value.assignee,
2053
+ placement: r.value.placement,
2054
+ sort: r.value.sort
1995
2055
  })
1996
- ), vl = S(() => [
1997
- { key: "export", label: b("panel.export"), icon: "download", href: ml.value }
2056
+ ), Xe = U(() => [
2057
+ { key: "export", label: b("panel.export"), icon: "download", href: Je.value }
1998
2058
  ]);
1999
- return s({ create: pl }), (x, K) => (u(), j("div", {
2059
+ return s({ create: M }), (_, Z) => (o(), G("div", {
2000
2060
  ref_key: "root",
2001
- ref: i,
2061
+ ref: d,
2002
2062
  class: "wx-submissions"
2003
2063
  }, [
2004
- t(e(Qe), {
2064
+ t(e(tl), {
2005
2065
  class: "wx-submissions__head",
2006
2066
  level: 3,
2007
- title: Ge(),
2008
- subtitle: r.form.slug,
2009
- actions: vl.value
2067
+ title: Ne(),
2068
+ subtitle: i.form.slug,
2069
+ actions: Xe.value
2010
2070
  }, null, 8, ["title", "subtitle", "actions"]),
2011
- t(e(Xe), {
2012
- modelValue: M.value,
2013
- "onUpdate:modelValue": K[2] || (K[2] = (D) => M.value = D),
2071
+ t(e(nl), {
2072
+ modelValue: B.value,
2073
+ "onUpdate:modelValue": Z[2] || (Z[2] = (N) => B.value = N),
2014
2074
  class: "wx-submissions__views",
2015
- items: Q.value,
2075
+ items: X.value,
2016
2076
  "collapse-below": 560,
2017
2077
  "aria-label": e(b)("panel.status")
2018
2078
  }, {
2019
2079
  default: a(() => [
2020
- t(e(dl), {
2080
+ t(e(vl), {
2021
2081
  data: $.value,
2022
2082
  columns: k.value,
2023
2083
  "row-key": "id",
@@ -2025,141 +2085,141 @@ const jl = /* @__PURE__ */ ae({
2025
2085
  clickable: "",
2026
2086
  hover: "",
2027
2087
  flush: "",
2028
- loading: O.value,
2029
- selectable: N.value,
2030
- "select-row-label": e(W)("filters.select-row"),
2031
- "select-all-label": e(W)("filters.select-all"),
2032
- "row-class": (D) => D.is_read ? void 0 : "is-unread",
2088
+ loading: I.value,
2089
+ selectable: j.value,
2090
+ "select-row-label": e(F)("filters.select-row"),
2091
+ "select-all-label": e(F)("filters.select-all"),
2092
+ "row-class": (N) => N.is_read ? void 0 : "is-unread",
2033
2093
  "search-placeholder": e(b)("panel.search-submissions"),
2034
- "empty-text": y.value,
2035
- "cards-below": T.value,
2036
- "filters-count": pe.value.length,
2037
- onRowClick: R,
2038
- onStateChange: g,
2039
- onSelectionChange: K[1] || (K[1] = (D, Te) => _.value = Te)
2040
- }, Ne({
2041
- "cell-status": a(({ row: D }) => [
2042
- G("div", ft, [
2043
- D.status ? (u(), w(e(Se), {
2094
+ "empty-text": g.value,
2095
+ "cards-below": z.value,
2096
+ "filters-count": me.value.length,
2097
+ onRowClick: Ie,
2098
+ onStateChange: Ye,
2099
+ onSelectionChange: Z[1] || (Z[1] = (N, qe) => x.value = qe)
2100
+ }, Oe({
2101
+ "cell-status": a(({ row: N }) => [
2102
+ K("div", xt, [
2103
+ N.status ? (o(), w(e(Ue), {
2044
2104
  key: 0,
2045
- type: D.status.color
2105
+ type: N.status.color
2046
2106
  }, {
2047
2107
  default: a(() => [
2048
- z(V(re(D.status)), 1)
2108
+ S(V(de(N.status)), 1)
2049
2109
  ]),
2050
2110
  _: 2
2051
- }, 1032, ["type"])) : H("", !0),
2052
- D.assignee ? (u(), w(e(al), {
2111
+ }, 1032, ["type"])) : P("", !0),
2112
+ N.assignee ? (o(), w(e(il), {
2053
2113
  key: 1,
2054
- name: D.assignee.name,
2055
- title: D.assignee.name,
2114
+ name: N.assignee.name,
2115
+ title: N.assignee.name,
2056
2116
  size: "xs",
2057
2117
  tone: "auto"
2058
- }, null, 8, ["name", "title"])) : H("", !0),
2059
- D.files_count > 0 ? (u(), w(e(Cl), {
2118
+ }, null, 8, ["name", "title"])) : P("", !0),
2119
+ N.files_count > 0 ? (o(), w(e(ql), {
2060
2120
  key: 2,
2061
2121
  content: e(b)("panel.attachments")
2062
2122
  }, {
2063
2123
  default: a(() => [
2064
- t(e($e), {
2124
+ t(e(_e), {
2065
2125
  name: "file",
2066
2126
  size: "sm"
2067
2127
  })
2068
2128
  ]),
2069
2129
  _: 1
2070
- }, 8, ["content"])) : H("", !0)
2130
+ }, 8, ["content"])) : P("", !0)
2071
2131
  ])
2072
2132
  ]),
2073
- "cell-created_at": a(({ row: D }) => [
2074
- t(e(De), {
2075
- value: D.created_at,
2133
+ "cell-created_at": a(({ row: N }) => [
2134
+ t(e(Pe), {
2135
+ value: N.created_at,
2076
2136
  compact: ""
2077
2137
  }, null, 8, ["value"])
2078
2138
  ]),
2079
- "cell-card": a(({ row: D }) => [
2080
- t(e(Sl), {
2139
+ "cell-card": a(({ row: N }) => [
2140
+ t(e(Cl), {
2081
2141
  variant: "plain",
2082
2142
  shape: "circle",
2083
- title: I(D, 0)
2143
+ title: W(N, 0)
2084
2144
  }, {
2085
2145
  subtitle: a(() => [
2086
- z(V(I(D, 1)), 1)
2146
+ S(V(W(N, 1)), 1)
2087
2147
  ]),
2088
2148
  meta: a(() => [
2089
- D.status ? (u(), w(e(Se), {
2149
+ N.status ? (o(), w(e(Ue), {
2090
2150
  key: 0,
2091
- type: D.status.color,
2151
+ type: N.status.color,
2092
2152
  size: "sm"
2093
2153
  }, {
2094
2154
  default: a(() => [
2095
- z(V(re(D.status)), 1)
2155
+ S(V(de(N.status)), 1)
2096
2156
  ]),
2097
2157
  _: 2
2098
- }, 1032, ["type"])) : H("", !0),
2099
- D.assignee ? (u(), w(e(al), {
2158
+ }, 1032, ["type"])) : P("", !0),
2159
+ N.assignee ? (o(), w(e(il), {
2100
2160
  key: 1,
2101
- name: D.assignee.name,
2102
- title: D.assignee.name,
2161
+ name: N.assignee.name,
2162
+ title: N.assignee.name,
2103
2163
  size: "xs",
2104
2164
  tone: "auto"
2105
- }, null, 8, ["name", "title"])) : H("", !0),
2106
- D.files_count > 0 ? (u(), w(e($e), {
2165
+ }, null, 8, ["name", "title"])) : P("", !0),
2166
+ N.files_count > 0 ? (o(), w(e(_e), {
2107
2167
  key: 2,
2108
2168
  name: "file",
2109
2169
  size: "sm"
2110
- })) : H("", !0),
2111
- t(e(De), {
2112
- value: D.created_at
2170
+ })) : P("", !0),
2171
+ t(e(Pe), {
2172
+ value: N.created_at
2113
2173
  }, null, 8, ["value"])
2114
2174
  ]),
2115
2175
  _: 2
2116
2176
  }, 1032, ["title"])
2117
2177
  ]),
2118
- "card-actions": a(({ row: D }) => [
2119
- t(e(Fe), {
2120
- actions: Ae(D),
2121
- label: String(D.id)
2178
+ "card-actions": a(({ row: N }) => [
2179
+ t(e(ze), {
2180
+ actions: De(N),
2181
+ label: String(N.id)
2122
2182
  }, null, 8, ["actions", "label"])
2123
2183
  ]),
2124
- "cell-actions": a(({ row: D }) => [
2125
- t(e(Fe), {
2126
- actions: Ae(D),
2127
- label: String(D.id)
2184
+ "cell-actions": a(({ row: N }) => [
2185
+ t(e(ze), {
2186
+ actions: De(N),
2187
+ label: String(N.id)
2128
2188
  }, null, 8, ["actions", "label"])
2129
2189
  ]),
2130
2190
  _: 2
2131
2191
  }, [
2132
- _.value.length > 0 ? {
2192
+ x.value.length > 0 ? {
2133
2193
  name: "actions",
2134
2194
  fn: a(() => [
2135
- G("div", vt, [
2136
- t(e(J), {
2195
+ K("div", gt, [
2196
+ t(e(Q), {
2137
2197
  size: "sm",
2138
2198
  weight: "medium"
2139
2199
  }, {
2140
2200
  default: a(() => [
2141
- z(V(e(b)("panel.selected", { count: _.value.length })), 1)
2201
+ S(V(e(b)("panel.selected", { count: x.value.length })), 1)
2142
2202
  ]),
2143
2203
  _: 1
2144
2204
  }),
2145
- t(e(ve), {
2205
+ t(e(fe), {
2146
2206
  "model-value": null,
2147
- options: ue.value,
2207
+ options: re.value,
2148
2208
  placeholder: e(b)("panel.move-to"),
2149
2209
  disabled: E.value,
2150
2210
  size: "sm",
2151
2211
  style: { width: "180px" },
2152
- "onUpdate:modelValue": je
2212
+ "onUpdate:modelValue": Qe
2153
2213
  }, null, 8, ["options", "placeholder", "disabled"]),
2154
- t(e(le), {
2214
+ t(e(te), {
2155
2215
  size: "sm",
2156
2216
  variant: "outline",
2157
2217
  type: "danger",
2158
2218
  icon: "trash",
2159
- onClick: K[0] || (K[0] = (D) => el(_.value.map((Te) => Te.id)))
2219
+ onClick: Z[0] || (Z[0] = (N) => y(x.value.map((qe) => qe.id)))
2160
2220
  }, {
2161
2221
  default: a(() => [
2162
- z(V(e(b)("panel.delete")), 1)
2222
+ S(V(e(b)("panel.delete")), 1)
2163
2223
  ]),
2164
2224
  _: 1
2165
2225
  })
@@ -2167,16 +2227,16 @@ const jl = /* @__PURE__ */ ae({
2167
2227
  ]),
2168
2228
  key: "0"
2169
2229
  } : void 0,
2170
- ye.value ? {
2230
+ J.value ? {
2171
2231
  name: "filters",
2172
2232
  fn: a(() => [
2173
- t(e(B), {
2233
+ t(e(H), {
2174
2234
  label: e(b)("panel.meta-placement")
2175
2235
  }, {
2176
2236
  default: a(() => [
2177
- t(e(ve), {
2178
- "model-value": v.value.placement,
2179
- options: Y.value,
2237
+ t(e(fe), {
2238
+ "model-value": r.value.placement,
2239
+ options: O.value,
2180
2240
  placeholder: e(b)("panel.any-placement"),
2181
2241
  clearable: "",
2182
2242
  size: "sm",
@@ -2188,10 +2248,10 @@ const jl = /* @__PURE__ */ ae({
2188
2248
  ]),
2189
2249
  key: "1"
2190
2250
  } : void 0,
2191
- pe.value.length > 0 ? {
2251
+ me.value.length > 0 ? {
2192
2252
  name: "applied",
2193
2253
  fn: a(() => [
2194
- t(e(yl), { filters: pe.value }, null, 8, ["filters"])
2254
+ t(e(xl), { filters: me.value }, null, 8, ["filters"])
2195
2255
  ]),
2196
2256
  key: "2"
2197
2257
  } : void 0
@@ -2201,46 +2261,46 @@ const jl = /* @__PURE__ */ ae({
2201
2261
  }, 8, ["modelValue", "items", "aria-label"])
2202
2262
  ], 512));
2203
2263
  }
2204
- }), yt = /* @__PURE__ */ ie(ht, [["__scopeId", "data-v-6bb4ef13"]]), gt = ["onClick"], xt = { class: "wx-inbox-form__name" }, _t = /* @__PURE__ */ ae({
2264
+ }), kt = /* @__PURE__ */ ue(wt, [["__scopeId", "data-v-6bb4ef13"]]), Vt = ["onClick"], $t = { class: "wx-inbox-form__name" }, Ut = /* @__PURE__ */ ne({
2205
2265
  __name: "InboxPage",
2206
2266
  props: {
2207
2267
  base: { default: "/inbox" }
2208
2268
  },
2209
- setup(r) {
2210
- const s = r, o = oe(), f = de(o), n = Oe(), d = Pe(), m = xe();
2211
- ce();
2212
- const l = te("webx-inbox"), U = be(), p = F([]), i = F(!0), L = il("pane"), C = F(!0), T = F(!1), b = S(() => o.can("inbox.manage")), W = Be(dt), c = S(
2213
- () => o.state.manifest?.modules.find((A) => A.id === "inbox")?.title ?? l("module.title")
2214
- ), $ = S(() => {
2269
+ setup(i) {
2270
+ const s = i, u = ie(), v = ce(u), n = Re(), c = Be(), f = we();
2271
+ pe();
2272
+ const l = ae("webx-inbox"), T = ye(), p = q([]), d = q(!0), D = cl("pane"), C = q(!0), z = q(!1), b = U(() => u.can("inbox.manage")), F = je(ft), m = U(
2273
+ () => u.state.manifest?.modules.find((A) => A.id === "inbox")?.title ?? l("module.title")
2274
+ ), $ = U(() => {
2215
2275
  const A = n.query.form;
2216
2276
  return typeof A == "string" && A !== "" ? Number(A) : null;
2217
- }), h = S(() => p.value.find((A) => A.id === $.value) ?? null);
2218
- function O(A) {
2219
- return fe(A.title, m.active.value, A.slug);
2277
+ }), h = U(() => p.value.find((A) => A.id === $.value) ?? null);
2278
+ function I(A) {
2279
+ return be(A.title, f.active.value, A.slug);
2220
2280
  }
2221
- async function _() {
2222
- i.value = !0;
2281
+ async function x() {
2282
+ d.value = !0;
2223
2283
  try {
2224
- p.value = await f.forms();
2284
+ p.value = await v.forms();
2225
2285
  } catch (A) {
2226
- P.danger(U(A));
2286
+ L.danger(T(A));
2227
2287
  } finally {
2228
- i.value = !1;
2288
+ d.value = !1;
2229
2289
  }
2230
2290
  }
2231
- _(), Ce([p, h], () => {
2232
- p.value.length === 0 || h.value !== null || d.replace({ query: { ...n.query, form: String(p.value[0].id) } });
2291
+ x(), Te([p, h], () => {
2292
+ p.value.length === 0 || h.value !== null || c.replace({ query: { ...n.query, form: String(p.value[0].id) } });
2233
2293
  });
2234
- function E(A, Q) {
2235
- d.replace({ query: { ...n.query, form: String(A.id) } }), Q();
2294
+ function E(A, X) {
2295
+ c.replace({ query: { ...n.query, form: String(A.id) } }), X();
2236
2296
  }
2237
- function N(A) {
2238
- d.push(`${s.base}/forms/${A.id}`);
2297
+ function j(A) {
2298
+ c.push(`${s.base}/forms/${A.id}`);
2239
2299
  }
2240
- function q(A) {
2300
+ function R(A) {
2241
2301
  return b.value ? [
2242
- { key: "settings", icon: "settings", label: l("panel.settings"), run: () => N(A) },
2243
- { key: "duplicate", icon: "copy", label: l("panel.duplicate"), run: () => v(A) },
2302
+ { key: "settings", icon: "settings", label: l("panel.settings"), run: () => j(A) },
2303
+ { key: "duplicate", icon: "copy", label: l("panel.duplicate"), run: () => r(A) },
2244
2304
  // A form that has taken submissions is switched off, never deleted (§2.4). The line is
2245
2305
  // left out rather than greyed: a menu is a list of what is possible.
2246
2306
  ...A.submissions_count === 0 ? [
@@ -2249,179 +2309,186 @@ const jl = /* @__PURE__ */ ae({
2249
2309
  icon: "trash",
2250
2310
  label: l("panel.delete"),
2251
2311
  danger: !0,
2252
- run: () => Y(A)
2312
+ run: () => O(A)
2253
2313
  }
2254
2314
  ] : []
2255
2315
  ] : [];
2256
2316
  }
2257
- async function M() {
2258
- const A = await W({});
2259
- A && (await _(), N(A));
2317
+ async function B() {
2318
+ const A = await F({});
2319
+ A && (await x(), j(A));
2260
2320
  }
2261
- async function v(A) {
2321
+ async function r(A) {
2262
2322
  try {
2263
- const Q = await f.duplicateForm(A.id);
2264
- P.success(l("panel.duplicated")), await _(), N(Q);
2265
- } catch (Q) {
2266
- P.danger(U(Q));
2323
+ const X = await v.duplicateForm(A.id);
2324
+ L.success(l("panel.duplicated")), await x(), j(X);
2325
+ } catch (X) {
2326
+ L.danger(T(X));
2267
2327
  }
2268
2328
  }
2269
- async function Y(A) {
2270
- if (await ze({
2271
- title: l("panel.delete-form-title", { form: O(A) }),
2329
+ async function O(A) {
2330
+ if (await Ce({
2331
+ title: l("panel.delete-form-title", { form: I(A) }),
2272
2332
  message: l("panel.delete-form-text"),
2273
2333
  confirmText: l("panel.delete"),
2274
2334
  cancelText: l("panel.cancel"),
2275
2335
  tone: "danger"
2276
2336
  }))
2277
2337
  try {
2278
- if (await f.removeForm(A.id), P.success(l("panel.deleted")), $.value === A.id) {
2279
- const I = { ...n.query };
2280
- delete I.form, d.replace({ query: I });
2338
+ if (await v.removeForm(A.id), L.success(l("panel.deleted")), $.value === A.id) {
2339
+ const W = { ...n.query };
2340
+ delete W.form, c.replace({ query: W });
2281
2341
  }
2282
- await _();
2283
- } catch (I) {
2284
- P.danger(U(I));
2342
+ await x();
2343
+ } catch (W) {
2344
+ L.danger(T(W));
2285
2345
  }
2286
2346
  }
2287
- async function ye() {
2347
+ async function J() {
2288
2348
  try {
2289
- await f.sortForms(p.value.map((A) => A.id));
2349
+ await v.sortForms(p.value.map((A) => A.id));
2290
2350
  } catch (A) {
2291
- P.danger(U(A, l("panel.reorder-failed"))), await _();
2351
+ L.danger(T(A, l("panel.reorder-failed"))), await x();
2292
2352
  }
2293
2353
  }
2294
- const pe = S(() => {
2354
+ const me = U(() => {
2295
2355
  const A = [];
2296
2356
  return b.value && A.push({
2297
2357
  key: "statuses",
2298
2358
  label: l("panel.statuses"),
2299
2359
  icon: "tag",
2300
2360
  run: () => {
2301
- d.push(`${s.base}/statuses`);
2361
+ c.push(`${s.base}/statuses`);
2302
2362
  }
2303
- }), o.can("inbox.update") && h.value !== null && A.push({
2363
+ }), u.can("inbox.update") && h.value !== null && A.push({
2304
2364
  key: "new-submission",
2305
2365
  label: l("panel.new-submission"),
2306
2366
  icon: "plus",
2307
2367
  primary: !0,
2308
2368
  run: () => {
2309
- L.value?.create();
2369
+ D.value?.create();
2310
2370
  }
2311
2371
  }), A;
2312
2372
  });
2313
- return (A, Q) => (u(), w(e(ul), {
2314
- title: c.value,
2315
- actions: pe.value,
2373
+ return (A, X) => (o(), w(e(pl), {
2374
+ title: m.value,
2375
+ actions: me.value,
2316
2376
  card: !1
2317
- }, Ne({
2377
+ }, Oe({
2318
2378
  default: a(() => [
2319
- t(e(se), {
2379
+ t(e(oe), {
2320
2380
  class: "wx-inbox",
2321
2381
  padding: "none"
2322
2382
  }, {
2323
2383
  default: a(() => [
2324
2384
  t(e(zl), {
2325
- "filters-open": T.value,
2326
- "onUpdate:filtersOpen": Q[2] || (Q[2] = (I) => T.value = I),
2385
+ "filters-open": z.value,
2386
+ "onUpdate:filtersOpen": X[2] || (X[2] = (W) => z.value = W),
2327
2387
  class: "wx-inbox__panes",
2328
2388
  "filters-width": 270,
2329
2389
  "detail-min": 420,
2330
2390
  "filters-title": e(l)("panel.forms"),
2331
- onFiltersInline: Q[3] || (Q[3] = (I) => C.value = I)
2391
+ onFiltersInline: X[3] || (X[3] = (W) => C.value = W)
2332
2392
  }, {
2333
- filters: a(({ inline: I, close: k }) => [
2334
- i.value ? (u(), w(e(We), {
2393
+ filters: a(({ inline: W, close: k }) => [
2394
+ d.value ? (o(), w(e(We), {
2335
2395
  key: 0,
2336
2396
  class: "wx-inbox__loading",
2337
2397
  rows: 5
2338
- })) : (u(), j(ee, { key: 1 }, [
2339
- !I && b.value ? (u(), w(e(le), {
2398
+ })) : (o(), G(ee, { key: 1 }, [
2399
+ !W && b.value ? (o(), w(e(te), {
2340
2400
  key: 0,
2341
2401
  class: "wx-inbox__new-form",
2342
2402
  variant: "outline",
2343
2403
  block: "",
2344
- onClick: M
2404
+ onClick: B
2345
2405
  }, {
2346
2406
  icon: a(() => [
2347
- t(e($e), { name: "plus" })
2407
+ t(e(_e), { name: "plus" })
2348
2408
  ]),
2349
2409
  default: a(() => [
2350
- z(" " + V(e(l)("panel.new-form")), 1)
2410
+ S(" " + V(e(l)("panel.new-form")), 1)
2351
2411
  ]),
2352
2412
  _: 1
2353
- })) : H("", !0),
2354
- t(e(Je), {
2413
+ })) : P("", !0),
2414
+ t(e(al), {
2355
2415
  modelValue: p.value,
2356
- "onUpdate:modelValue": Q[1] || (Q[1] = (y) => p.value = y),
2357
- class: ll(["wx-inbox__forms", { "is-panel": !I }]),
2416
+ "onUpdate:modelValue": X[1] || (X[1] = (g) => p.value = g),
2417
+ class: sl(["wx-inbox__forms", { "is-panel": !W }]),
2358
2418
  plain: "",
2359
2419
  size: "sm",
2360
2420
  "item-key": "id",
2361
- "item-label": O,
2421
+ "item-label": I,
2362
2422
  disabled: !b.value,
2363
- title: I ? e(l)("panel.forms") : void 0,
2364
- onMove: ye
2365
- }, Ne({
2366
- default: a(({ item: y }) => [
2367
- G("button", {
2423
+ title: W ? e(l)("panel.forms") : void 0,
2424
+ onMove: J
2425
+ }, Oe({
2426
+ default: a(({ item: g }) => [
2427
+ K("button", {
2368
2428
  type: "button",
2369
- class: ll(["wx-inbox-form", { "is-current": y.id === $.value, "is-off": !y.is_enabled }]),
2370
- onClick: (ue) => E(y, k)
2429
+ class: sl(["wx-inbox-form", { "is-current": g.id === $.value, "is-off": !g.is_enabled }]),
2430
+ onClick: (re) => E(g, k)
2371
2431
  }, [
2372
- G("span", xt, [
2373
- t(e(J), {
2432
+ K("span", $t, [
2433
+ t(e(Q), {
2374
2434
  truncate: "",
2375
2435
  weight: "medium",
2376
- tone: y.is_enabled ? "default" : "muted"
2436
+ tone: g.is_enabled ? "default" : "muted"
2377
2437
  }, {
2378
2438
  default: a(() => [
2379
- z(V(O(y)), 1)
2439
+ S(V(I(g)), 1)
2380
2440
  ]),
2381
2441
  _: 2
2382
2442
  }, 1032, ["tone"]),
2383
- y.unread_count ? (u(), w(e(nl), {
2443
+ g.is_enabled && g.notifies === !1 ? (o(), w(e(_e), {
2384
2444
  key: 0,
2445
+ class: "wx-inbox-form__silent",
2446
+ name: "warning",
2447
+ label: e(l)("panel.notifies-nobody-short"),
2448
+ title: e(l)("panel.notifies-nobody-short")
2449
+ }, null, 8, ["label", "title"])) : P("", !0),
2450
+ g.unread_count ? (o(), w(e(ul), {
2451
+ key: 1,
2385
2452
  class: "wx-inbox-form__count",
2386
2453
  type: "primary",
2387
- value: y.unread_count,
2454
+ value: g.unread_count,
2388
2455
  label: e(l)("panel.unread")
2389
- }, null, 8, ["value", "label"])) : y.submissions_count ? (u(), w(e(nl), {
2390
- key: 1,
2456
+ }, null, 8, ["value", "label"])) : g.submissions_count ? (o(), w(e(ul), {
2457
+ key: 2,
2391
2458
  class: "wx-inbox-form__count",
2392
2459
  type: "neutral",
2393
- value: y.submissions_count,
2460
+ value: g.submissions_count,
2394
2461
  label: e(l)("panel.submissions")
2395
- }, null, 8, ["value", "label"])) : H("", !0)
2462
+ }, null, 8, ["value", "label"])) : P("", !0)
2396
2463
  ]),
2397
- t(e(J), {
2464
+ t(e(Q), {
2398
2465
  size: "sm",
2399
2466
  tone: "muted",
2400
2467
  truncate: ""
2401
2468
  }, {
2402
2469
  default: a(() => [
2403
- z(V(y.slug), 1)
2470
+ S(V(g.slug), 1)
2404
2471
  ]),
2405
2472
  _: 2
2406
2473
  }, 1024)
2407
- ], 10, gt)
2474
+ ], 10, Vt)
2408
2475
  ]),
2409
- actions: a(({ item: y }) => [
2410
- t(e(Fe), {
2411
- actions: q(y),
2412
- label: O(y)
2476
+ actions: a(({ item: g }) => [
2477
+ t(e(ze), {
2478
+ actions: R(g),
2479
+ label: I(g)
2413
2480
  }, null, 8, ["actions", "label"])
2414
2481
  ]),
2415
2482
  _: 2
2416
2483
  }, [
2417
- I && b.value ? {
2484
+ W && b.value ? {
2418
2485
  name: "extra",
2419
2486
  fn: a(() => [
2420
- t(e(Ve), {
2487
+ t(e($e), {
2421
2488
  icon: "plus",
2422
2489
  size: "sm",
2423
2490
  title: e(l)("panel.new-form"),
2424
- onClick: M
2491
+ onClick: B
2425
2492
  }, null, 8, ["title"])
2426
2493
  ]),
2427
2494
  key: "0"
@@ -2430,18 +2497,18 @@ const jl = /* @__PURE__ */ ae({
2430
2497
  ], 64))
2431
2498
  ]),
2432
2499
  list: a(() => [
2433
- i.value ? (u(), w(e(We), {
2500
+ d.value ? (o(), w(e(We), {
2434
2501
  key: 0,
2435
2502
  class: "wx-inbox__loading",
2436
2503
  rows: 6
2437
- })) : h.value ? (u(), w(yt, {
2504
+ })) : h.value ? (o(), w(kt, {
2438
2505
  ref_key: "pane",
2439
- ref: L,
2506
+ ref: D,
2440
2507
  key: h.value.id,
2441
2508
  form: h.value,
2442
2509
  base: s.base,
2443
- onChanged: _
2444
- }, null, 8, ["form", "base"])) : (u(), w(e(He), {
2510
+ onChanged: x
2511
+ }, null, 8, ["form", "base"])) : (o(), w(e(Ke), {
2445
2512
  key: 2,
2446
2513
  title: e(l)("panel.no-forms"),
2447
2514
  description: e(l)("panel.no-forms-help")
@@ -2458,15 +2525,15 @@ const jl = /* @__PURE__ */ ae({
2458
2525
  C.value ? void 0 : {
2459
2526
  name: "actions",
2460
2527
  fn: a(() => [
2461
- t(e(le), {
2528
+ t(e(te), {
2462
2529
  variant: "outline",
2463
- onClick: Q[0] || (Q[0] = (I) => T.value = !0)
2530
+ onClick: X[0] || (X[0] = (W) => z.value = !0)
2464
2531
  }, {
2465
2532
  icon: a(() => [
2466
- t(e($e), { name: "list" })
2533
+ t(e(_e), { name: "list" })
2467
2534
  ]),
2468
2535
  default: a(() => [
2469
- z(" " + V(e(l)("panel.forms")), 1)
2536
+ S(" " + V(e(l)("panel.forms")), 1)
2470
2537
  ]),
2471
2538
  _: 1
2472
2539
  })
@@ -2475,74 +2542,74 @@ const jl = /* @__PURE__ */ ae({
2475
2542
  }
2476
2543
  ]), 1032, ["title", "actions"]));
2477
2544
  }
2478
- }), wt = { class: "wx-inbox-status-form" }, kt = { class: "wx-inbox-status-form__checks" }, Vt = /* @__PURE__ */ ae({
2545
+ }), St = { class: "wx-inbox-status-form" }, Tt = { class: "wx-inbox-status-form__checks" }, Ct = /* @__PURE__ */ ne({
2479
2546
  __name: "StatusDialog",
2480
2547
  props: {
2481
2548
  status: {}
2482
2549
  },
2483
- setup(r) {
2484
- const s = r, { resolve: o, dismiss: f, open: n } = Ee(), d = oe(), m = de(d);
2485
- ce();
2486
- const l = te("webx-inbox"), U = be(), p = F(""), i = F({}), L = F("default"), C = F(!1), T = F(!1), b = F(!1), W = F(!1), c = F({});
2487
- Ce(
2550
+ setup(i) {
2551
+ const s = i, { resolve: u, dismiss: v, open: n } = He(), c = ie(), f = ce(c);
2552
+ pe();
2553
+ const l = ae("webx-inbox"), T = ye(), p = q(""), d = q({}), D = q("default"), C = q(!1), z = q(!1), b = q(!1), F = q(!1), m = q({});
2554
+ Te(
2488
2555
  () => s.status,
2489
- (_) => {
2490
- p.value = _?.key ?? "", i.value = { ..._?.title ?? {} }, L.value = _?.color ?? "default", C.value = _?.is_default ?? !1, T.value = _?.is_spam ?? !1, b.value = _?.is_closed ?? !1, c.value = {};
2556
+ (x) => {
2557
+ p.value = x?.key ?? "", d.value = { ...x?.title ?? {} }, D.value = x?.color ?? "default", C.value = x?.is_default ?? !1, z.value = x?.is_spam ?? !1, b.value = x?.is_closed ?? !1, m.value = {};
2491
2558
  },
2492
2559
  { immediate: !0 }
2493
2560
  );
2494
- const $ = S(
2495
- () => Il.map((_) => ({ value: _, label: l(`panel.color-${_}`) }))
2561
+ const $ = U(
2562
+ () => Dl.map((x) => ({ value: x, label: l(`panel.color-${x}`) }))
2496
2563
  );
2497
- function h(_) {
2498
- return c.value[_]?.[0];
2564
+ function h(x) {
2565
+ return m.value[x]?.[0];
2499
2566
  }
2500
- async function O() {
2501
- W.value = !0, c.value = {};
2502
- const _ = {
2567
+ async function I() {
2568
+ F.value = !0, m.value = {};
2569
+ const x = {
2503
2570
  key: p.value.trim(),
2504
- title: i.value,
2505
- color: L.value,
2571
+ title: d.value,
2572
+ color: D.value,
2506
2573
  is_default: C.value,
2507
- is_spam: T.value,
2574
+ is_spam: z.value,
2508
2575
  is_closed: b.value
2509
2576
  };
2510
2577
  try {
2511
- o(
2512
- s.status === null ? await m.createStatus(_) : await m.saveStatus(s.status.id, _)
2578
+ u(
2579
+ s.status === null ? await f.createStatus(x) : await f.saveStatus(s.status.id, x)
2513
2580
  );
2514
2581
  } catch (E) {
2515
- const N = E.body;
2516
- N?.errors ? (c.value = N.errors, P.danger(l("panel.failed"))) : P.danger(U(E));
2582
+ const j = E.body;
2583
+ j?.errors ? (m.value = j.errors, L.danger(l("panel.failed"))) : L.danger(T(E));
2517
2584
  } finally {
2518
- W.value = !1;
2585
+ F.value = !1;
2519
2586
  }
2520
2587
  }
2521
- return (_, E) => (u(), w(e(Re), {
2588
+ return (x, E) => (o(), w(e(Ge), {
2522
2589
  open: e(n),
2523
- "onUpdate:open": E[7] || (E[7] = (N) => ne(n) ? n.value = N : null),
2524
- title: r.status ? e(l)("panel.settings") : e(l)("panel.new-status"),
2590
+ "onUpdate:open": E[7] || (E[7] = (j) => se(n) ? n.value = j : null),
2591
+ title: i.status ? e(l)("panel.settings") : e(l)("panel.new-status"),
2525
2592
  width: 520
2526
2593
  }, {
2527
2594
  footer: a(() => [
2528
- t(e(qe), { size: "sm" }, {
2595
+ t(e(Ae), { size: "sm" }, {
2529
2596
  default: a(() => [
2530
- t(e(le), {
2597
+ t(e(te), {
2531
2598
  variant: "outline",
2532
- onClick: E[6] || (E[6] = (N) => e(f)())
2599
+ onClick: E[6] || (E[6] = (j) => e(v)())
2533
2600
  }, {
2534
2601
  default: a(() => [
2535
- z(V(e(l)("panel.cancel")), 1)
2602
+ S(V(e(l)("panel.cancel")), 1)
2536
2603
  ]),
2537
2604
  _: 1
2538
2605
  }),
2539
- t(e(le), {
2606
+ t(e(te), {
2540
2607
  type: "primary",
2541
- loading: W.value,
2542
- onClick: O
2608
+ loading: F.value,
2609
+ onClick: I
2543
2610
  }, {
2544
2611
  default: a(() => [
2545
- z(V(e(l)("panel.save")), 1)
2612
+ S(V(e(l)("panel.save")), 1)
2546
2613
  ]),
2547
2614
  _: 1
2548
2615
  }, 8, ["loading"])
@@ -2551,63 +2618,63 @@ const jl = /* @__PURE__ */ ae({
2551
2618
  })
2552
2619
  ]),
2553
2620
  default: a(() => [
2554
- G("div", wt, [
2555
- t(e(B), {
2621
+ K("div", St, [
2622
+ t(e(H), {
2556
2623
  label: e(l)("panel.title"),
2557
2624
  error: h("title"),
2558
2625
  required: ""
2559
2626
  }, {
2560
2627
  default: a(() => [
2561
- t(e(X), {
2562
- modelValue: i.value,
2563
- "onUpdate:modelValue": E[0] || (E[0] = (N) => i.value = N),
2628
+ t(e(le), {
2629
+ modelValue: d.value,
2630
+ "onUpdate:modelValue": E[0] || (E[0] = (j) => d.value = j),
2564
2631
  localized: ""
2565
2632
  }, null, 8, ["modelValue"])
2566
2633
  ]),
2567
2634
  _: 1
2568
2635
  }, 8, ["label", "error"]),
2569
- t(e(B), {
2636
+ t(e(H), {
2570
2637
  label: e(l)("panel.status-key"),
2571
2638
  error: h("key"),
2572
2639
  required: ""
2573
2640
  }, {
2574
2641
  default: a(() => [
2575
- t(e(X), {
2642
+ t(e(le), {
2576
2643
  modelValue: p.value,
2577
- "onUpdate:modelValue": E[1] || (E[1] = (N) => p.value = N),
2644
+ "onUpdate:modelValue": E[1] || (E[1] = (j) => p.value = j),
2578
2645
  placeholder: "in-progress"
2579
2646
  }, null, 8, ["modelValue"])
2580
2647
  ]),
2581
2648
  _: 1
2582
2649
  }, 8, ["label", "error"]),
2583
- t(e(B), {
2650
+ t(e(H), {
2584
2651
  label: e(l)("panel.status-color"),
2585
2652
  error: h("color")
2586
2653
  }, {
2587
2654
  default: a(() => [
2588
- t(e(ve), {
2589
- modelValue: L.value,
2590
- "onUpdate:modelValue": E[2] || (E[2] = (N) => L.value = N),
2655
+ t(e(fe), {
2656
+ modelValue: D.value,
2657
+ "onUpdate:modelValue": E[2] || (E[2] = (j) => D.value = j),
2591
2658
  options: $.value
2592
2659
  }, null, 8, ["modelValue", "options"])
2593
2660
  ]),
2594
2661
  _: 1
2595
2662
  }, 8, ["label", "error"]),
2596
- G("div", kt, [
2663
+ K("div", Tt, [
2597
2664
  t(e(he), {
2598
2665
  modelValue: C.value,
2599
- "onUpdate:modelValue": E[3] || (E[3] = (N) => C.value = N),
2666
+ "onUpdate:modelValue": E[3] || (E[3] = (j) => C.value = j),
2600
2667
  label: e(l)("panel.status-default")
2601
2668
  }, null, 8, ["modelValue", "label"]),
2602
2669
  t(e(he), {
2603
- modelValue: T.value,
2604
- "onUpdate:modelValue": E[4] || (E[4] = (N) => T.value = N),
2670
+ modelValue: z.value,
2671
+ "onUpdate:modelValue": E[4] || (E[4] = (j) => z.value = j),
2605
2672
  label: e(l)("panel.status-spam")
2606
2673
  }, null, 8, ["modelValue", "label"]),
2607
2674
  t(e(he), {
2608
2675
  modelValue: b.value,
2609
- "onUpdate:modelValue": E[5] || (E[5] = (N) => b.value = N),
2610
- disabled: T.value,
2676
+ "onUpdate:modelValue": E[5] || (E[5] = (j) => b.value = j),
2677
+ disabled: z.value,
2611
2678
  label: e(l)("panel.status-closed")
2612
2679
  }, null, 8, ["modelValue", "disabled", "label"])
2613
2680
  ])
@@ -2616,50 +2683,50 @@ const jl = /* @__PURE__ */ ae({
2616
2683
  _: 1
2617
2684
  }, 8, ["open", "title"]));
2618
2685
  }
2619
- }), $t = /* @__PURE__ */ ie(Vt, [["__scopeId", "data-v-b520b53b"]]), Ut = { class: "wx-inbox-statuses" }, St = { class: "wx-inbox-status" }, Ct = /* @__PURE__ */ ae({
2686
+ }), qt = /* @__PURE__ */ ue(Ct, [["__scopeId", "data-v-b520b53b"]]), zt = { class: "wx-inbox-statuses" }, Ft = { class: "wx-inbox-status" }, Wt = /* @__PURE__ */ ne({
2620
2687
  __name: "StatusesPage",
2621
2688
  props: {
2622
2689
  base: { default: "/inbox" }
2623
2690
  },
2624
- setup(r) {
2625
- const s = r, o = oe(), f = de(o), n = xe();
2626
- ce();
2627
- const d = te("webx-inbox"), m = be(), l = F([]), U = F(!0), p = o.can("inbox.manage"), i = Be($t);
2628
- function L(h) {
2629
- return fe(h.title, n.active.value, h.key);
2691
+ setup(i) {
2692
+ const s = i, u = ie(), v = ce(u), n = we();
2693
+ pe();
2694
+ const c = ae("webx-inbox"), f = ye(), l = q([]), T = q(!0), p = u.can("inbox.manage"), d = je(qt);
2695
+ function D(h) {
2696
+ return be(h.title, n.active.value, h.key);
2630
2697
  }
2631
2698
  async function C() {
2632
- U.value = !0;
2699
+ T.value = !0;
2633
2700
  try {
2634
- l.value = await f.statuses();
2701
+ l.value = await v.statuses();
2635
2702
  } catch (h) {
2636
- P.danger(m(h));
2703
+ L.danger(f(h));
2637
2704
  } finally {
2638
- U.value = !1;
2705
+ T.value = !1;
2639
2706
  }
2640
2707
  }
2641
2708
  C();
2642
- async function T(h) {
2643
- await i({ status: h }) && await C();
2709
+ async function z(h) {
2710
+ await d({ status: h }) && await C();
2644
2711
  }
2645
2712
  async function b(h) {
2646
- if (await ze({
2647
- title: d("panel.delete-status-title", { status: L(h) }),
2648
- message: d("panel.delete-status-text"),
2649
- confirmText: d("panel.delete"),
2650
- cancelText: d("panel.cancel"),
2713
+ if (await Ce({
2714
+ title: c("panel.delete-status-title", { status: D(h) }),
2715
+ message: c("panel.delete-status-text"),
2716
+ confirmText: c("panel.delete"),
2717
+ cancelText: c("panel.cancel"),
2651
2718
  tone: "danger"
2652
2719
  }))
2653
2720
  try {
2654
- await f.removeStatus(h.id), P.success(d("panel.deleted")), await C();
2655
- } catch (_) {
2656
- P.danger(m(_));
2721
+ await v.removeStatus(h.id), L.success(c("panel.deleted")), await C();
2722
+ } catch (x) {
2723
+ L.danger(f(x));
2657
2724
  }
2658
2725
  }
2659
- function W(h) {
2726
+ function F(h) {
2660
2727
  return p ? [
2661
- { key: "edit", icon: "edit", label: d("panel.settings"), run: () => {
2662
- T(h);
2728
+ { key: "edit", icon: "edit", label: c("panel.settings"), run: () => {
2729
+ z(h);
2663
2730
  } },
2664
2731
  // A status with submissions in them cannot go: they would have nothing to be in. The
2665
2732
  // line is left out rather than greyed, the way every list of the panel does it.
@@ -2667,7 +2734,7 @@ const jl = /* @__PURE__ */ ae({
2667
2734
  {
2668
2735
  key: "delete",
2669
2736
  icon: "trash",
2670
- label: d("panel.delete"),
2737
+ label: c("panel.delete"),
2671
2738
  danger: !0,
2672
2739
  run: () => {
2673
2740
  b(h);
@@ -2676,85 +2743,85 @@ const jl = /* @__PURE__ */ ae({
2676
2743
  ] : []
2677
2744
  ] : [];
2678
2745
  }
2679
- const c = S(
2746
+ const m = U(
2680
2747
  () => p ? [
2681
2748
  {
2682
2749
  key: "new",
2683
- label: d("panel.new-status"),
2750
+ label: c("panel.new-status"),
2684
2751
  icon: "plus",
2685
2752
  primary: !0,
2686
2753
  run: () => {
2687
- T(null);
2754
+ z(null);
2688
2755
  }
2689
2756
  }
2690
2757
  ] : []
2691
2758
  );
2692
2759
  async function $() {
2693
2760
  try {
2694
- await f.sortStatuses(l.value.map((h) => h.id));
2761
+ await v.sortStatuses(l.value.map((h) => h.id));
2695
2762
  } catch (h) {
2696
- P.danger(m(h, d("panel.reorder-failed"))), await C();
2763
+ L.danger(f(h, c("panel.reorder-failed"))), await C();
2697
2764
  }
2698
2765
  }
2699
- return (h, O) => (u(), j("div", Ut, [
2700
- t(e(ul), {
2701
- title: e(d)("panel.statuses"),
2766
+ return (h, I) => (o(), G("div", zt, [
2767
+ t(e(pl), {
2768
+ title: e(c)("panel.statuses"),
2702
2769
  back: s.base,
2703
- "back-label": e(d)("panel.forms"),
2704
- actions: c.value
2770
+ "back-label": e(c)("panel.forms"),
2771
+ actions: m.value
2705
2772
  }, {
2706
2773
  default: a(() => [
2707
- !U.value && l.value.length === 0 ? (u(), w(e(He), {
2774
+ !T.value && l.value.length === 0 ? (o(), w(e(Ke), {
2708
2775
  key: 0,
2709
- title: e(d)("panel.no-statuses")
2710
- }, null, 8, ["title"])) : (u(), w(e(Je), {
2776
+ title: e(c)("panel.no-statuses")
2777
+ }, null, 8, ["title"])) : (o(), w(e(al), {
2711
2778
  key: 1,
2712
2779
  modelValue: l.value,
2713
- "onUpdate:modelValue": O[0] || (O[0] = (_) => l.value = _),
2780
+ "onUpdate:modelValue": I[0] || (I[0] = (x) => l.value = x),
2714
2781
  plain: "",
2715
2782
  "item-key": "id",
2716
- "item-label": L,
2783
+ "item-label": D,
2717
2784
  disabled: !e(p),
2718
- "aria-label": e(d)("panel.statuses"),
2785
+ "aria-label": e(c)("panel.statuses"),
2719
2786
  onMove: $
2720
2787
  }, {
2721
- default: a(({ item: _ }) => [
2722
- G("div", St, [
2723
- t(e(Se), {
2724
- type: _.color
2788
+ default: a(({ item: x }) => [
2789
+ K("div", Ft, [
2790
+ t(e(Ue), {
2791
+ type: x.color
2725
2792
  }, {
2726
2793
  default: a(() => [
2727
- z(V(L(_)), 1)
2794
+ S(V(D(x)), 1)
2728
2795
  ]),
2729
2796
  _: 2
2730
2797
  }, 1032, ["type"]),
2731
- t(e(J), {
2798
+ t(e(Q), {
2732
2799
  size: "sm",
2733
2800
  tone: "muted",
2734
2801
  truncate: ""
2735
2802
  }, {
2736
2803
  default: a(() => [
2737
- G("code", null, V(_.key), 1),
2738
- _.is_default ? (u(), j(ee, { key: 0 }, [
2739
- z(" · " + V(e(d)("panel.status-default")), 1)
2740
- ], 64)) : H("", !0),
2741
- _.is_spam ? (u(), j(ee, { key: 1 }, [
2742
- z(" · " + V(e(d)("panel.status-spam")), 1)
2743
- ], 64)) : _.is_closed ? (u(), j(ee, { key: 2 }, [
2744
- z(" · " + V(e(d)("panel.status-closed")), 1)
2745
- ], 64)) : H("", !0),
2746
- _.submissions_count ? (u(), j(ee, { key: 3 }, [
2747
- z(" · " + V(e(d)("panel.in-use")) + " (" + V(_.submissions_count) + ") ", 1)
2748
- ], 64)) : H("", !0)
2804
+ K("code", null, V(x.key), 1),
2805
+ x.is_default ? (o(), G(ee, { key: 0 }, [
2806
+ S(" · " + V(e(c)("panel.status-default")), 1)
2807
+ ], 64)) : P("", !0),
2808
+ x.is_spam ? (o(), G(ee, { key: 1 }, [
2809
+ S(" · " + V(e(c)("panel.status-spam")), 1)
2810
+ ], 64)) : x.is_closed ? (o(), G(ee, { key: 2 }, [
2811
+ S(" · " + V(e(c)("panel.status-closed")), 1)
2812
+ ], 64)) : P("", !0),
2813
+ x.submissions_count ? (o(), G(ee, { key: 3 }, [
2814
+ S(" · " + V(e(c)("panel.in-use")) + " (" + V(x.submissions_count) + ") ", 1)
2815
+ ], 64)) : P("", !0)
2749
2816
  ]),
2750
2817
  _: 2
2751
2818
  }, 1024)
2752
2819
  ])
2753
2820
  ]),
2754
- actions: a(({ item: _ }) => [
2755
- t(e(Fe), {
2756
- actions: W(_),
2757
- label: L(_)
2821
+ actions: a(({ item: x }) => [
2822
+ t(e(ze), {
2823
+ actions: F(x),
2824
+ label: D(x)
2758
2825
  }, null, 8, ["actions", "label"])
2759
2826
  ]),
2760
2827
  _: 1
@@ -2764,90 +2831,102 @@ const jl = /* @__PURE__ */ ae({
2764
2831
  }, 8, ["title", "back", "back-label", "actions"])
2765
2832
  ]));
2766
2833
  }
2767
- }), zt = /* @__PURE__ */ ie(Ct, [["__scopeId", "data-v-f94bf140"]]), Tt = { class: "wx-submission" }, Ft = {
2834
+ }), At = /* @__PURE__ */ ue(Wt, [["__scopeId", "data-v-f94bf140"]]), Nt = { class: "wx-submission" }, It = {
2768
2835
  key: 1,
2769
2836
  class: "wx-submission__panes"
2770
- }, Wt = { class: "wx-submission__main" }, qt = { class: "wx-submission__value" }, At = { class: "wx-submission__files" }, It = { class: "wx-submission__by" }, Nt = { class: "wx-submission__fields" }, Dt = ["href"], Mt = {
2837
+ }, Dt = { class: "wx-submission__main" }, Mt = { class: "wx-submission__value" }, Lt = { class: "wx-submission__files" }, Ot = { class: "wx-submission__by" }, Pt = { class: "wx-submission__fields" }, Et = ["href"], Rt = {
2771
2838
  key: 1,
2772
2839
  class: "wx-submission__detail"
2773
- }, Lt = { class: "wx-submission__aside" }, Ot = { class: "wx-submission__fields" }, Pt = { class: "wx-submission__field" }, Et = { class: "wx-submission__field" }, Rt = /* @__PURE__ */ ae({
2840
+ }, Bt = { class: "wx-submission__detail" }, Ht = {
2841
+ key: 5,
2842
+ class: "wx-submission__recipients"
2843
+ }, Gt = { key: 6 }, jt = { class: "wx-submission__aside" }, Kt = { class: "wx-submission__fields" }, Yt = { class: "wx-submission__field" }, Zt = { class: "wx-submission__field" }, Qt = /* @__PURE__ */ ne({
2774
2844
  __name: "SubmissionPage",
2775
2845
  props: {
2776
2846
  base: { default: "/inbox" }
2777
2847
  },
2778
- setup(r) {
2779
- const s = r, o = oe(), f = de(o), n = Oe(), d = Pe(), m = xe();
2780
- ce();
2781
- const l = te("webx-inbox"), U = te("webx-admin"), p = be(), i = F(null), L = F([]), C = F([]), T = F(!0), b = S(() => o.can("inbox.update")), W = S(() => Number(n.params.id)), c = S(() => ({
2848
+ setup(i) {
2849
+ const s = i, u = ie(), v = ce(u), n = Re(), c = Be(), f = we();
2850
+ pe();
2851
+ const l = ae("webx-inbox"), T = ae("webx-admin"), p = ye(), d = q(null), D = q([]), C = q([]), z = q(!0), b = U(() => u.can("inbox.update")), F = U(() => Number(n.params.id)), m = U(() => ({
2782
2852
  view: typeof n.query.view == "string" ? n.query.view : void 0,
2783
2853
  search: typeof n.query.search == "string" ? n.query.search : void 0,
2784
2854
  assignee: typeof n.query.assignee == "string" ? n.query.assignee : void 0
2785
- })), $ = S(() => ({ path: s.base, query: { ...n.query } })), h = S(
2786
- () => L.value.map((g) => ({ value: g.id, label: _(g) }))
2787
- ), O = S(
2788
- () => C.value.map((g) => ({ value: g.id, label: g.name }))
2855
+ })), $ = U(() => ({ path: s.base, query: { ...n.query } })), h = U(
2856
+ () => D.value.map((y) => ({ value: y.id, label: x(y) }))
2857
+ ), I = U(
2858
+ () => C.value.map((y) => ({ value: y.id, label: y.name }))
2789
2859
  );
2790
- function _(g) {
2791
- return fe(g.title, m.active.value, g.key);
2792
- }
2793
- const E = S(() => l("panel.submission", { id: String(W.value) })), N = S(() => {
2794
- const g = i.value?.form;
2795
- return g === void 0 ? "" : fe(g.title ?? {}, m.active.value, g.slug ?? "");
2796
- }), q = S(() => (i.value?.values ?? []).find((R) => R.type === "email" && (R.value ?? "") !== "")?.value ?? null), M = S(() => {
2797
- if (q.value === null) return null;
2798
- const g = encodeURIComponent(`${N.value} — ${E.value}`);
2799
- return `mailto:${q.value}?subject=${g}`;
2860
+ function x(y) {
2861
+ return be(y.title, f.active.value, y.key);
2862
+ }
2863
+ const E = U(() => l("panel.submission", { id: String(F.value) })), j = U(() => {
2864
+ const y = d.value?.form;
2865
+ return y === void 0 ? "" : be(y.title ?? {}, f.active.value, y.slug ?? "");
2866
+ }), R = U(() => (d.value?.values ?? []).find((M) => M.type === "email" && (M.value ?? "") !== "")?.value ?? null), B = U(() => {
2867
+ if (R.value === null) return null;
2868
+ const y = encodeURIComponent(`${j.value} — ${E.value}`);
2869
+ return `mailto:${R.value}?subject=${y}`;
2800
2870
  });
2801
- async function v() {
2802
- T.value = !0;
2871
+ async function r() {
2872
+ z.value = !0;
2803
2873
  try {
2804
- i.value = await f.submission(W.value, c.value);
2805
- } catch (g) {
2806
- P.danger(p(g)), d.replace($.value);
2874
+ d.value = await v.submission(F.value, m.value);
2875
+ } catch (y) {
2876
+ L.danger(p(y)), c.replace($.value);
2807
2877
  } finally {
2808
- T.value = !1;
2878
+ z.value = !1;
2809
2879
  }
2810
2880
  }
2811
- async function Y() {
2881
+ async function O() {
2812
2882
  try {
2813
- L.value = await f.statuses(), b.value && (C.value = await f.recipients());
2814
- } catch (g) {
2815
- P.danger(p(g));
2883
+ D.value = await v.statuses(), b.value && (C.value = await v.recipients());
2884
+ } catch (y) {
2885
+ L.danger(p(y));
2816
2886
  }
2817
2887
  }
2818
- Ce(W, () => {
2819
- v();
2820
- }, { immediate: !0 }), Y();
2821
- async function ye(g) {
2888
+ Te(F, () => {
2889
+ r();
2890
+ }, { immediate: !0 }), O();
2891
+ async function J(y) {
2822
2892
  try {
2823
- i.value = await f.saveSubmission(W.value, g), P.success(l("panel.saved"));
2824
- } catch (Z) {
2825
- P.danger(p(Z)), await v();
2893
+ d.value = await v.saveSubmission(F.value, y), L.success(l("panel.saved"));
2894
+ } catch (Y) {
2895
+ L.danger(p(Y)), await r();
2826
2896
  }
2827
2897
  }
2828
- function pe(g) {
2829
- typeof g == "number" && ye({ status_id: g });
2898
+ function me(y) {
2899
+ typeof y == "number" && J({ status_id: y });
2830
2900
  }
2831
- function A(g) {
2832
- ye({ assignee_id: typeof g == "number" ? g : null });
2901
+ function A(y) {
2902
+ J({ assignee_id: typeof y == "number" ? y : null });
2833
2903
  }
2834
- const Q = S(() => {
2835
- const g = [];
2836
- return M.value && g.push({
2904
+ const X = U(() => {
2905
+ const y = [];
2906
+ return B.value && y.push({
2837
2907
  key: "reply",
2838
2908
  label: l("panel.reply"),
2839
2909
  icon: "mail",
2840
2910
  primary: !0,
2841
- href: M.value,
2911
+ href: B.value,
2842
2912
  target: "_self"
2843
- }), b.value && i.value !== null && g.push(
2913
+ }), b.value && d.value !== null && y.push(
2844
2914
  {
2845
2915
  key: "unread",
2846
2916
  icon: "eye-off",
2847
2917
  label: l("panel.mark-unread"),
2848
2918
  menu: !0,
2849
2919
  run: () => {
2850
- I();
2920
+ re();
2921
+ }
2922
+ },
2923
+ {
2924
+ key: "notify",
2925
+ icon: "mail",
2926
+ label: l("panel.notify-again"),
2927
+ menu: !0,
2928
+ run: () => {
2929
+ W();
2851
2930
  }
2852
2931
  },
2853
2932
  {
@@ -2856,20 +2935,31 @@ const jl = /* @__PURE__ */ ae({
2856
2935
  label: l("panel.delete"),
2857
2936
  danger: !0,
2858
2937
  run: () => {
2859
- k();
2938
+ de();
2860
2939
  }
2861
2940
  }
2862
- ), g;
2941
+ ), y;
2863
2942
  });
2864
- async function I() {
2943
+ async function W() {
2865
2944
  try {
2866
- await f.massSubmissions({ ids: [W.value], action: "unread" }), d.push($.value);
2867
- } catch (g) {
2868
- P.danger(p(g));
2945
+ d.value = await v.notifySubmission(F.value), L.success(l("panel.notify-sent-again"));
2946
+ } catch (y) {
2947
+ L.danger(p(y));
2869
2948
  }
2870
2949
  }
2871
- async function k() {
2872
- if (await ze({
2950
+ const k = U(() => d.value?.notification ?? null);
2951
+ function g(y) {
2952
+ return l(`panel.notify-recipient-${y}`);
2953
+ }
2954
+ async function re() {
2955
+ try {
2956
+ await v.massSubmissions({ ids: [F.value], action: "unread" }), c.push($.value);
2957
+ } catch (y) {
2958
+ L.danger(p(y));
2959
+ }
2960
+ }
2961
+ async function de() {
2962
+ if (await Ce({
2873
2963
  title: l("panel.delete-submission-title"),
2874
2964
  message: l("panel.delete-submission-text"),
2875
2965
  confirmText: l("panel.delete"),
@@ -2877,96 +2967,116 @@ const jl = /* @__PURE__ */ ae({
2877
2967
  tone: "danger"
2878
2968
  }))
2879
2969
  try {
2880
- await f.removeSubmission(W.value), P.success(l("panel.deleted")), d.push($.value);
2881
- } catch (Z) {
2882
- P.danger(p(Z));
2970
+ await v.removeSubmission(F.value), L.success(l("panel.deleted")), c.push($.value);
2971
+ } catch (Y) {
2972
+ L.danger(p(Y));
2883
2973
  }
2884
2974
  }
2885
- function y(g) {
2886
- g !== null && d.push({ path: `${s.base}/submissions/${g}`, query: { ...n.query } });
2975
+ function Ne(y) {
2976
+ y !== null && c.push({ path: `${s.base}/submissions/${y}`, query: { ...n.query } });
2887
2977
  }
2888
- function ue(g) {
2889
- const Z = L.value.find((R) => R.key === g);
2890
- return Z === void 0 ? g : _(Z);
2978
+ function ke(y) {
2979
+ const Y = D.value.find((M) => M.key === y);
2980
+ return Y === void 0 ? y : x(Y);
2891
2981
  }
2892
- function re(g) {
2893
- switch (g.type) {
2982
+ const Ye = U(
2983
+ () => d.value?.events?.some((y) => y.type === "no_recipients") ?? !1
2984
+ );
2985
+ function Ze(y) {
2986
+ switch (y.type) {
2894
2987
  case "created":
2895
2988
  return l("panel.event-created");
2896
2989
  case "status":
2897
- return l("panel.event-status", { to: ue(g.to ?? "") });
2990
+ return l("panel.event-status", { to: ke(y.to ?? "") });
2898
2991
  case "assignee":
2899
- return g.to === null || g.to === "" ? l("panel.event-unassigned") : l("panel.event-assignee", { to: g.to });
2992
+ return y.to === null || y.to === "" ? l("panel.event-unassigned") : l("panel.event-assignee", { to: y.to });
2900
2993
  case "note":
2901
2994
  return l("panel.event-note");
2902
2995
  case "notified":
2903
2996
  return l("panel.event-notified");
2997
+ // A handler of `webx-inbox.handlers`: `from` is its class, shown by its own short name.
2998
+ case "handled":
2999
+ return l("panel.event-handled", { name: Ie(y.from) });
3000
+ case "handler_error":
3001
+ return l("panel.event-handler-error", {
3002
+ name: Ie(y.from),
3003
+ error: y.to ?? ""
3004
+ });
3005
+ case "no_recipients":
3006
+ return l("panel.event-no-recipients");
3007
+ case "notify_queued":
3008
+ return l("panel.event-notify-queued");
3009
+ case "notify_failed":
3010
+ return l("panel.event-notify-failed", { to: y.to ?? "" });
2904
3011
  default:
2905
- return g.type;
3012
+ return y.type;
2906
3013
  }
2907
3014
  }
2908
- function Ge(g) {
2909
- return `${Math.max(1, Math.round(g / 1024))} KB`;
2910
- }
2911
- const _e = S(() => {
2912
- const g = i.value?.meta ?? {}, Z = [];
2913
- typeof g.page == "string" && g.page !== "" && Z.push({ label: l("panel.meta-page"), value: g.page, link: !0 });
2914
- const R = i.value?.placement;
2915
- typeof R == "string" && R !== "" && Z.push({ label: l("panel.meta-placement"), value: R }), typeof g.referrer == "string" && g.referrer !== "" && Z.push({ label: l("panel.meta-referrer"), value: g.referrer, link: !0 });
2916
- for (const [Ae, je] of Object.entries(g.utm ?? {}))
2917
- Z.push({ label: Ae, value: String(je) });
2918
- return typeof g.locale == "string" && g.locale !== "" && Z.push({ label: l("panel.meta-locale"), value: g.locale }), typeof g.ip == "string" && g.ip !== "" && Z.push({ label: l("panel.meta-ip"), value: g.ip }), typeof g.user_agent == "string" && g.user_agent !== "" && Z.push({ label: l("panel.meta-agent"), value: g.user_agent }), Z;
3015
+ function Ie(y) {
3016
+ return (y ?? "").split("\\").pop() ?? "";
3017
+ }
3018
+ function De(y) {
3019
+ return `${Math.max(1, Math.round(y / 1024))} KB`;
3020
+ }
3021
+ const Qe = U(() => {
3022
+ const y = d.value?.meta ?? {}, Y = [];
3023
+ typeof y.page == "string" && y.page !== "" && Y.push({ label: l("panel.meta-page"), value: y.page, link: !0 });
3024
+ const M = d.value?.placement;
3025
+ typeof M == "string" && M !== "" && Y.push({ label: l("panel.meta-placement"), value: M }), typeof y.referrer == "string" && y.referrer !== "" && Y.push({ label: l("panel.meta-referrer"), value: y.referrer, link: !0 });
3026
+ for (const [Je, Xe] of Object.entries(y.utm ?? {}))
3027
+ Y.push({ label: Je, value: String(Xe) });
3028
+ return typeof y.locale == "string" && y.locale !== "" && Y.push({ label: l("panel.meta-locale"), value: y.locale }), typeof y.ip == "string" && y.ip !== "" && Y.push({ label: l("panel.meta-ip"), value: y.ip }), typeof y.user_agent == "string" && y.user_agent !== "" && Y.push({ label: l("panel.meta-agent"), value: y.user_agent }), Y;
2919
3029
  });
2920
- return (g, Z) => (u(), j("div", Tt, [
2921
- t(e(Qe), {
3030
+ return (y, Y) => (o(), G("div", Nt, [
3031
+ t(e(tl), {
2922
3032
  title: E.value,
2923
- subtitle: N.value,
3033
+ subtitle: j.value,
2924
3034
  back: $.value,
2925
- actions: Q.value
3035
+ actions: X.value
2926
3036
  }, {
2927
3037
  extra: a(() => [
2928
- t(e(Ve), {
3038
+ t(e($e), {
2929
3039
  icon: "chevron-left",
2930
3040
  size: "lg",
2931
3041
  title: e(l)("panel.previous"),
2932
- disabled: !i.value?.previous_id,
2933
- onClick: Z[0] || (Z[0] = (R) => y(i.value?.previous_id ?? null))
3042
+ disabled: !d.value?.previous_id,
3043
+ onClick: Y[0] || (Y[0] = (M) => Ne(d.value?.previous_id ?? null))
2934
3044
  }, null, 8, ["title", "disabled"]),
2935
- t(e(Ve), {
3045
+ t(e($e), {
2936
3046
  icon: "chevron-right",
2937
3047
  size: "lg",
2938
3048
  title: e(l)("panel.next"),
2939
- disabled: !i.value?.next_id,
2940
- onClick: Z[1] || (Z[1] = (R) => y(i.value?.next_id ?? null))
3049
+ disabled: !d.value?.next_id,
3050
+ onClick: Y[1] || (Y[1] = (M) => Ne(d.value?.next_id ?? null))
2941
3051
  }, null, 8, ["title", "disabled"])
2942
3052
  ]),
2943
3053
  _: 1
2944
3054
  }, 8, ["title", "subtitle", "back", "actions"]),
2945
- T.value ? (u(), w(e(We), {
3055
+ z.value ? (o(), w(e(We), {
2946
3056
  key: 0,
2947
3057
  rows: 6
2948
- })) : i.value ? (u(), j("div", Ft, [
2949
- G("div", Wt, [
2950
- t(e(se), {
3058
+ })) : d.value ? (o(), G("div", It, [
3059
+ K("div", Dt, [
3060
+ t(e(oe), {
2951
3061
  title: e(l)("panel.answers")
2952
3062
  }, {
2953
3063
  default: a(() => [
2954
- i.value.values.length === 0 ? (u(), w(e(He), {
3064
+ d.value.values.length === 0 ? (o(), w(e(Ke), {
2955
3065
  key: 0,
2956
3066
  size: "sm",
2957
3067
  description: e(l)("panel.no-answers")
2958
- }, null, 8, ["description"])) : (u(), w(e(sl), {
3068
+ }, null, 8, ["description"])) : (o(), w(e(rl), {
2959
3069
  key: 1,
2960
3070
  columns: 1,
2961
3071
  layout: "vertical"
2962
3072
  }, {
2963
3073
  default: a(() => [
2964
- (u(!0), j(ee, null, ke(i.value.values, (R) => (u(), w(e(Ie), {
2965
- key: R.id,
2966
- label: R.label ?? R.name
3074
+ (o(!0), G(ee, null, ge(d.value.values, (M) => (o(), w(e(Me), {
3075
+ key: M.id,
3076
+ label: M.label ?? M.name
2967
3077
  }, {
2968
3078
  default: a(() => [
2969
- G("p", qt, V(R.value || "—"), 1)
3079
+ K("p", Mt, V(M.value || "—"), 1)
2970
3080
  ]),
2971
3081
  _: 2
2972
3082
  }, 1032, ["label"]))), 128))
@@ -2976,84 +3086,84 @@ const jl = /* @__PURE__ */ ae({
2976
3086
  ]),
2977
3087
  _: 1
2978
3088
  }, 8, ["title"]),
2979
- i.value.files.length > 0 ? (u(), w(e(se), {
3089
+ d.value.files.length > 0 ? (o(), w(e(oe), {
2980
3090
  key: 0,
2981
3091
  title: e(l)("panel.attachments")
2982
3092
  }, {
2983
3093
  default: a(() => [
2984
- G("div", At, [
2985
- (u(!0), j(ee, null, ke(i.value.files, (R) => (u(), w(e(Tl), {
2986
- key: R.id,
2987
- name: R.name,
2988
- type: R.mime ?? void 0,
2989
- "download-url": R.url,
3094
+ K("div", Lt, [
3095
+ (o(!0), G(ee, null, ge(d.value.files, (M) => (o(), w(e(Fl), {
3096
+ key: M.id,
3097
+ name: M.name,
3098
+ type: M.mime ?? void 0,
3099
+ "download-url": M.url,
2990
3100
  "download-label": e(l)("panel.download"),
2991
3101
  size: "sm"
2992
3102
  }, {
2993
3103
  meta: a(() => [
2994
- z(V(Ge(R.size)), 1)
3104
+ S(V(De(M.size)), 1)
2995
3105
  ]),
2996
3106
  _: 2
2997
3107
  }, 1032, ["name", "type", "download-url", "download-label"]))), 128))
2998
3108
  ])
2999
3109
  ]),
3000
3110
  _: 1
3001
- }, 8, ["title"])) : H("", !0),
3002
- t(e(se), { class: "wx-submission__more" }, {
3111
+ }, 8, ["title"])) : P("", !0),
3112
+ t(e(oe), { class: "wx-submission__more" }, {
3003
3113
  default: a(() => [
3004
- t(e(Xe), {
3114
+ t(e(nl), {
3005
3115
  variant: "pill",
3006
3116
  "aria-label": E.value
3007
3117
  }, {
3008
3118
  default: a(() => [
3009
- t(e(ge), {
3119
+ t(e(xe), {
3010
3120
  value: "notes",
3011
- label: e(U)("notes.title")
3121
+ label: e(T)("notes.title")
3012
3122
  }, {
3013
3123
  default: a(() => [
3014
- t(e(gl), {
3015
- id: i.value.id,
3124
+ t(e(_l), {
3125
+ id: d.value.id,
3016
3126
  type: "inbox_submission",
3017
3127
  title: "",
3018
3128
  can: b.value,
3019
- onChange: v
3129
+ onChange: r
3020
3130
  }, null, 8, ["id", "can"])
3021
3131
  ]),
3022
3132
  _: 1
3023
3133
  }, 8, ["label"]),
3024
- t(e(ge), {
3134
+ t(e(xe), {
3025
3135
  value: "log",
3026
3136
  label: e(l)("panel.log")
3027
3137
  }, {
3028
3138
  default: a(() => [
3029
- t(e(Fl), { size: "sm" }, {
3139
+ t(e(Wl), { size: "sm" }, {
3030
3140
  default: a(() => [
3031
- (u(!0), j(ee, null, ke(i.value.events, (R) => (u(), w(e(Wl), {
3032
- key: R.id
3141
+ (o(!0), G(ee, null, ge(d.value.events, (M) => (o(), w(e(Al), {
3142
+ key: M.id
3033
3143
  }, {
3034
3144
  default: a(() => [
3035
- t(e(J), {
3145
+ t(e(Q), {
3036
3146
  size: "sm",
3037
3147
  as: "p",
3038
3148
  class: "wx-submission__event"
3039
3149
  }, {
3040
3150
  default: a(() => [
3041
- z(V(re(R)), 1)
3151
+ S(V(Ze(M)), 1)
3042
3152
  ]),
3043
3153
  _: 2
3044
3154
  }, 1024),
3045
- G("p", It, [
3046
- t(e(J), {
3155
+ K("p", Ot, [
3156
+ t(e(Q), {
3047
3157
  size: "sm",
3048
3158
  tone: "muted"
3049
3159
  }, {
3050
3160
  default: a(() => [
3051
- z(V(R.author?.name ?? e(l)("panel.system")), 1)
3161
+ S(V(M.author?.name ?? e(l)("panel.system")), 1)
3052
3162
  ]),
3053
3163
  _: 2
3054
3164
  }, 1024),
3055
- t(e(De), {
3056
- value: R.created_at
3165
+ t(e(Pe), {
3166
+ value: M.created_at
3057
3167
  }, null, 8, ["value"])
3058
3168
  ])
3059
3169
  ]),
@@ -3065,89 +3175,139 @@ const jl = /* @__PURE__ */ ae({
3065
3175
  ]),
3066
3176
  _: 1
3067
3177
  }, 8, ["label"]),
3068
- t(e(ge), {
3178
+ t(e(xe), {
3069
3179
  value: "details",
3070
3180
  label: e(l)("panel.details")
3071
3181
  }, {
3072
3182
  default: a(() => [
3073
- G("div", Nt, [
3074
- t(e(sl), {
3183
+ K("div", Pt, [
3184
+ t(e(rl), {
3075
3185
  columns: 1,
3076
3186
  layout: "vertical",
3077
3187
  size: "sm"
3078
3188
  }, {
3079
3189
  default: a(() => [
3080
- t(e(Ie), {
3190
+ t(e(Me), {
3081
3191
  label: e(l)("panel.received")
3082
3192
  }, {
3083
3193
  default: a(() => [
3084
- t(e(De), {
3085
- value: i.value.created_at,
3194
+ t(e(Pe), {
3195
+ value: d.value.created_at,
3086
3196
  tone: "default"
3087
3197
  }, null, 8, ["value"])
3088
3198
  ]),
3089
3199
  _: 1
3090
3200
  }, 8, ["label"]),
3091
- t(e(Ie), {
3201
+ t(e(Me), {
3092
3202
  label: e(l)("panel.meta-source")
3093
3203
  }, {
3094
3204
  default: a(() => [
3095
- t(e(Se), {
3096
- type: i.value.source === "panel" ? "info" : "default"
3205
+ t(e(Ue), {
3206
+ type: d.value.source === "panel" ? "info" : "default"
3097
3207
  }, {
3098
3208
  default: a(() => [
3099
- z(V(i.value.source === "panel" ? e(l)("panel.source-panel") : e(l)("panel.source-web")), 1)
3209
+ S(V(d.value.source === "panel" ? e(l)("panel.source-panel") : e(l)("panel.source-web")), 1)
3100
3210
  ]),
3101
3211
  _: 1
3102
3212
  }, 8, ["type"])
3103
3213
  ]),
3104
3214
  _: 1
3105
3215
  }, 8, ["label"]),
3106
- (u(!0), j(ee, null, ke(_e.value, (R) => (u(), w(e(Ie), {
3107
- key: R.label,
3108
- label: R.label
3216
+ (o(!0), G(ee, null, ge(Qe.value, (M) => (o(), w(e(Me), {
3217
+ key: M.label,
3218
+ label: M.label
3109
3219
  }, {
3110
3220
  default: a(() => [
3111
- R.link ? (u(), j("a", {
3221
+ M.link ? (o(), G("a", {
3112
3222
  key: 0,
3113
- href: R.value,
3223
+ href: M.value,
3114
3224
  target: "_blank",
3115
3225
  rel: "noreferrer"
3116
- }, V(R.value), 9, Dt)) : (u(), j("span", Mt, V(R.value), 1))
3226
+ }, V(M.value), 9, Et)) : (o(), G("span", Rt, V(M.value), 1))
3117
3227
  ]),
3118
3228
  _: 2
3119
3229
  }, 1032, ["label"]))), 128))
3120
3230
  ]),
3121
3231
  _: 1
3122
3232
  }),
3123
- i.value.notify_error ? (u(), w(e(Me), {
3233
+ k.value?.state === "failed" ? (o(), w(e(Fe), {
3124
3234
  key: 0,
3125
3235
  type: "warning",
3126
- closable: !1
3236
+ closable: !1,
3237
+ title: e(l)("panel.notify-failed")
3127
3238
  }, {
3128
3239
  default: a(() => [
3129
- z(V(e(l)("panel.notify-failed")), 1)
3240
+ K("span", Bt, V(k.value.error), 1)
3130
3241
  ]),
3131
3242
  _: 1
3132
- })) : i.value.notified_at ? (u(), w(e(J), {
3243
+ }, 8, ["title"])) : k.value?.state === "queued" ? (o(), w(e(Q), {
3133
3244
  key: 1,
3134
3245
  size: "sm",
3135
3246
  tone: "muted"
3136
3247
  }, {
3137
3248
  default: a(() => [
3138
- z(V(e(l)("panel.notified")), 1)
3249
+ S(V(e(l)("panel.notify-queued")), 1)
3139
3250
  ]),
3140
3251
  _: 1
3141
- })) : (u(), w(e(J), {
3252
+ })) : k.value?.state === "delivered" ? (o(), w(e(Q), {
3142
3253
  key: 2,
3143
3254
  size: "sm",
3144
3255
  tone: "muted"
3145
3256
  }, {
3146
3257
  default: a(() => [
3147
- z(V(e(l)("panel.not-notified")), 1)
3258
+ S(V(e(l)("panel.notified")), 1)
3148
3259
  ]),
3149
3260
  _: 1
3150
- }))
3261
+ })) : Ye.value ? (o(), w(e(Q), {
3262
+ key: 3,
3263
+ size: "sm",
3264
+ tone: "muted"
3265
+ }, {
3266
+ default: a(() => [
3267
+ S(V(e(l)("panel.notified-nobody")), 1)
3268
+ ]),
3269
+ _: 1
3270
+ })) : (o(), w(e(Q), {
3271
+ key: 4,
3272
+ size: "sm",
3273
+ tone: "muted"
3274
+ }, {
3275
+ default: a(() => [
3276
+ S(V(e(l)("panel.not-notified")), 1)
3277
+ ]),
3278
+ _: 1
3279
+ })),
3280
+ k.value && k.value.recipients.length > 0 ? (o(), G("ul", Ht, [
3281
+ (o(!0), G(ee, null, ge(k.value.recipients, (M) => (o(), G("li", {
3282
+ key: M.address
3283
+ }, [
3284
+ t(e(Q), { size: "sm" }, {
3285
+ default: a(() => [
3286
+ S(V(M.address), 1)
3287
+ ]),
3288
+ _: 2
3289
+ }, 1024),
3290
+ t(e(Ue), {
3291
+ type: M.state === "failed" ? "danger" : M.state === "delivered" ? "success" : "default"
3292
+ }, {
3293
+ default: a(() => [
3294
+ S(V(g(M.state)), 1)
3295
+ ]),
3296
+ _: 2
3297
+ }, 1032, ["type"])
3298
+ ]))), 128))
3299
+ ])) : P("", !0),
3300
+ b.value && (k.value?.state === "failed" || k.value?.state === "queued") ? (o(), G("div", Gt, [
3301
+ t(e(te), {
3302
+ size: "sm",
3303
+ onClick: W
3304
+ }, {
3305
+ default: a(() => [
3306
+ S(V(e(l)("panel.notify-again")), 1)
3307
+ ]),
3308
+ _: 1
3309
+ })
3310
+ ])) : P("", !0)
3151
3311
  ])
3152
3312
  ]),
3153
3313
  _: 1
@@ -3159,40 +3319,40 @@ const jl = /* @__PURE__ */ ae({
3159
3319
  _: 1
3160
3320
  })
3161
3321
  ]),
3162
- G("aside", Lt, [
3163
- t(e(se), null, {
3322
+ K("aside", jt, [
3323
+ t(e(oe), null, {
3164
3324
  default: a(() => [
3165
- G("div", Ot, [
3166
- G("label", Pt, [
3167
- t(e(J), {
3325
+ K("div", Kt, [
3326
+ K("label", Yt, [
3327
+ t(e(Q), {
3168
3328
  size: "sm",
3169
3329
  tone: "muted"
3170
3330
  }, {
3171
3331
  default: a(() => [
3172
- z(V(e(l)("panel.status")), 1)
3332
+ S(V(e(l)("panel.status")), 1)
3173
3333
  ]),
3174
3334
  _: 1
3175
3335
  }),
3176
- t(e(ve), {
3177
- "model-value": i.value.status?.id ?? null,
3336
+ t(e(fe), {
3337
+ "model-value": d.value.status?.id ?? null,
3178
3338
  options: h.value,
3179
3339
  disabled: !b.value,
3180
- "onUpdate:modelValue": pe
3340
+ "onUpdate:modelValue": me
3181
3341
  }, null, 8, ["model-value", "options", "disabled"])
3182
3342
  ]),
3183
- G("label", Et, [
3184
- t(e(J), {
3343
+ K("label", Zt, [
3344
+ t(e(Q), {
3185
3345
  size: "sm",
3186
3346
  tone: "muted"
3187
3347
  }, {
3188
3348
  default: a(() => [
3189
- z(V(e(l)("panel.assignee")), 1)
3349
+ S(V(e(l)("panel.assignee")), 1)
3190
3350
  ]),
3191
3351
  _: 1
3192
3352
  }),
3193
- t(e(ve), {
3194
- "model-value": i.value.assignee?.id ?? null,
3195
- options: O.value,
3353
+ t(e(fe), {
3354
+ "model-value": d.value.assignee?.id ?? null,
3355
+ options: I.value,
3196
3356
  disabled: !b.value,
3197
3357
  clearable: "",
3198
3358
  placeholder: e(l)("panel.unassigned"),
@@ -3204,30 +3364,30 @@ const jl = /* @__PURE__ */ ae({
3204
3364
  _: 1
3205
3365
  })
3206
3366
  ])
3207
- ])) : H("", !0)
3367
+ ])) : P("", !0)
3208
3368
  ]));
3209
3369
  }
3210
- }), Bt = /* @__PURE__ */ ie(Rt, [["__scopeId", "data-v-4ef3ff2d"]]);
3211
- function Yt(r = {}) {
3212
- const s = r.path ?? "/inbox";
3370
+ }), Jt = /* @__PURE__ */ ue(Qt, [["__scopeId", "data-v-3d8c60d4"]]);
3371
+ function aa(i = {}) {
3372
+ const s = i.path ?? "/inbox";
3213
3373
  return {
3214
3374
  id: "inbox",
3215
3375
  path: s,
3216
- landing: r.landing ?? !0,
3376
+ landing: i.landing ?? !0,
3217
3377
  routes: [
3218
3378
  // The section's own path travels as a prop, so a panel that mounted it somewhere else
3219
3379
  // still links between its screens correctly.
3220
- { path: s, name: "webx.inbox", component: _t, props: { base: s } },
3380
+ { path: s, name: "webx.inbox", component: Ut, props: { base: s } },
3221
3381
  {
3222
3382
  path: `${s}/statuses`,
3223
3383
  name: "webx.inbox.statuses",
3224
- component: zt,
3384
+ component: At,
3225
3385
  props: { base: s }
3226
3386
  },
3227
3387
  {
3228
3388
  path: `${s}/forms/:id(\\d+)`,
3229
3389
  name: "webx.inbox.form",
3230
- component: it,
3390
+ component: pt,
3231
3391
  props: { base: s }
3232
3392
  },
3233
3393
  // A submission has an address of its own, not a dialog over the list (§11): it goes in
@@ -3235,24 +3395,24 @@ function Yt(r = {}) {
3235
3395
  {
3236
3396
  path: `${s}/submissions/:id(\\d+)`,
3237
3397
  name: "webx.inbox.submission",
3238
- component: Bt,
3398
+ component: Jt,
3239
3399
  props: { base: s }
3240
3400
  }
3241
3401
  ]
3242
3402
  };
3243
3403
  }
3244
3404
  export {
3245
- Al as FIELD_TYPES,
3246
- Il as STATUS_COLORS,
3247
- Gl as WxInboxFieldList,
3248
- it as WxInboxFormEditor,
3249
- _t as WxInboxPage,
3250
- zt as WxInboxStatusesPage,
3251
- yt as WxInboxSubmissionList,
3252
- Bt as WxInboxSubmissionPage,
3253
- de as createInboxApi,
3254
- Yt as inbox,
3255
- ql as inboxMessages,
3256
- me as option
3405
+ Il as FIELD_TYPES,
3406
+ Dl as STATUS_COLORS,
3407
+ Kl as WxInboxFieldList,
3408
+ pt as WxInboxFormEditor,
3409
+ Ut as WxInboxPage,
3410
+ At as WxInboxStatusesPage,
3411
+ kt as WxInboxSubmissionList,
3412
+ Jt as WxInboxSubmissionPage,
3413
+ ce as createInboxApi,
3414
+ aa as inbox,
3415
+ Nl as inboxMessages,
3416
+ ve as option
3257
3417
  };
3258
3418
  //# sourceMappingURL=index.js.map