@webx-ui/module-inbox 0.2.0 → 0.3.1

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