@webx-ui/module-admin 0.8.0 → 0.11.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.js CHANGED
@@ -1,17 +1,275 @@
1
- import { defineComponent as U, useModel as he, openBlock as f, createElementBlock as x, normalizeClass as le, createBlock as b, unref as d, withCtx as g, createTextVNode as C, toDisplayString as E, createCommentVNode as W, renderSlot as L, Fragment as R, mergeModels as se, inject as G, reactive as oe, computed as S, watch as J, resolveComponent as z, renderList as j, ref as A, watchEffect as $e, onUnmounted as Se, createVNode as y, createElementVNode as M, isRef as Te, createApp as ze, h as O, withModifiers as pe, nextTick as Ee, withKeys as Ae } from "vue";
2
- import { useRouter as we, useRoute as Ce, createRouter as Le, createWebHistory as We, RouterLink as Ue } from "vue-router";
3
- import { WxHeading as Re, WxTabs as Me, WxCard as me, WxResult as Ne, useResponsiveShell as Pe, shellLayoutFor as Ve, WxToaster as De, WebxUI as Ie, localesKey as Be, WxAlert as je, WxSkeleton as ge, WxActions as He, WxDropdownItem as Oe, WxAction as ue, WxPopover as Fe, WxInput as Ke, WxButton as X, WxDialog as qe, WxTooltip as Xe, WxText as Y, WxEmpty as Ye, WxAvatar as Ge, WxTextarea as fe, toast as I, confirm as Je } from "@webx-ui/core";
4
- import { WxScreenRenderer as Qe } from "@webx-ui/schema";
5
- const Ze = ["data-wx-fill"], et = {
1
+ import { inject as ee, reactive as se, defineComponent as U, computed as x, openBlock as v, createBlock as y, unref as r, withModifiers as pe, withCtx as b, createElementBlock as k, Fragment as B, renderList as N, createCommentVNode as W, createVNode as _, createTextVNode as z, toDisplayString as C, useSlots as Ce, useTemplateRef as Le, normalizeClass as j, renderSlot as L, createElementVNode as M, createSlots as be, useModel as ge, mergeModels as ie, mergeProps as ze, watch as te, resolveComponent as R, ref as E, watchEffect as We, onUnmounted as Ae, isRef as Re, createApp as Ee, h as X, nextTick as Ue, withKeys as Be } from "vue";
2
+ import { RouterLink as Ie, useRouter as we, useRoute as Me, createRouter as De, createWebHistory as Ne } from "vue-router";
3
+ import { WxAction as Y, WxActions as Pe, WxDropdownItem as Ve, useElementWidth as Fe, WxHeading as He, WxText as q, WxButton as O, WxIcon as Oe, WxTabs as je, WxCard as me, WxRichText as qe, WxResult as Ye, useResponsiveShell as Ke, shellLayoutFor as Xe, WxToaster as Ge, WebxUI as Je, dateLocaleKey as Qe, localesKey as Ze, WxAlert as et, WxSkeleton as ye, WxBadge as tt, WxPopover as nt, WxInput as at, WxDialog as lt, WxTooltip as ot, WxEmpty as st, WxAvatar as it, WxTextarea as fe, toast as F, confirm as rt } from "@webx-ui/core";
4
+ import { WxScreenRenderer as ut } from "@webx-ui/schema";
5
+ const ne = /* @__PURE__ */ Symbol("webx-i18n");
6
+ function Tn() {
7
+ const e = ee(ne, null);
8
+ if (e === null)
9
+ throw new Error("useI18n() was called outside a panel created by createAdmin().");
10
+ return e;
11
+ }
12
+ function I(e) {
13
+ const n = ee(ne, null);
14
+ return n === null ? de().scope(e) : n.scope(e);
15
+ }
16
+ function dt(e, n) {
17
+ e.provide(ne, n);
18
+ }
19
+ function de(e = {}) {
20
+ const n = e.fallback ?? "en", t = se({
21
+ locale: e.locale ?? n,
22
+ fallback: n,
23
+ panelLocales: [],
24
+ contentLocales: []
25
+ }), a = {}, u = se({ value: {} });
26
+ function o(s, i, m) {
27
+ let h = s[i]?.[m[0] ?? ""];
28
+ for (const f of m.slice(1)) {
29
+ if (typeof h != "object" || h === null)
30
+ return null;
31
+ h = h[f];
32
+ }
33
+ return typeof h == "string" ? h : null;
34
+ }
35
+ function l(s, i, m) {
36
+ const [h, f] = i.includes("::") ? i.split("::", 2) : [s, i], d = f.split("."), p = o(u.value, h, d) ?? o(a, h, d) ?? // Not an empty string: a key on screen is ugly, but it says which key, and a blank
37
+ // label says nothing to anybody trying to fix it.
38
+ i;
39
+ return m === void 0 ? p : ct(p, m);
40
+ }
41
+ return {
42
+ state: t,
43
+ defaults(s, i) {
44
+ a[s] = { ...a[s], ...i };
45
+ },
46
+ load(s, i, m) {
47
+ u.value = s ?? {}, t.locale = i ?? t.locale, m !== void 0 && (t.fallback = m);
48
+ },
49
+ scope(s) {
50
+ return (i, m) => l(s, i, m);
51
+ },
52
+ t: (s, i) => l("", s, i)
53
+ };
54
+ }
55
+ function ct(e, n) {
56
+ let t = e;
57
+ for (const [a, u] of Object.entries(n))
58
+ t = t.replaceAll(`:${a}`, String(u));
59
+ return t;
60
+ }
61
+ const mt = /* @__PURE__ */ U({
62
+ __name: "BackButton",
63
+ props: {
64
+ to: {},
65
+ label: { default: void 0 },
66
+ size: { default: "sm" }
67
+ },
68
+ setup(e) {
69
+ const n = e, t = I("webx-admin"), a = x(() => n.label ?? t("editor.back"));
70
+ return (u, o) => (v(), y(r(Y), {
71
+ icon: "arrow-left",
72
+ class: "wx-back-button",
73
+ as: r(Ie),
74
+ to: e.to,
75
+ title: a.value,
76
+ size: e.size,
77
+ "tooltip-side": "bottom"
78
+ }, null, 8, ["as", "to", "title", "size"]));
79
+ }
80
+ }), ft = {
6
81
  key: 0,
7
- class: "wx-list-screen__head"
8
- }, tt = {
9
- key: 1,
10
- class: "wx-list-screen__actions"
11
- }, nt = /* @__PURE__ */ U({
82
+ class: "wx-dropdown__divider"
83
+ }, ht = /* @__PURE__ */ U({
84
+ __name: "RowMenu",
85
+ props: {
86
+ actions: {},
87
+ label: { default: void 0 },
88
+ size: { default: "sm" }
89
+ },
90
+ setup(e) {
91
+ const n = I("webx-admin"), t = e, a = x(() => [
92
+ ...t.actions.filter((o) => !o.danger),
93
+ ...t.actions.filter((o) => o.danger)
94
+ ]), u = x(() => {
95
+ const o = a.value.find((l) => l.danger);
96
+ return o && a.value[0] !== o ? o.key : null;
97
+ });
98
+ return (o, l) => a.value.length > 0 ? (v(), y(r(Pe), {
99
+ key: 0,
100
+ class: "wx-row-menu",
101
+ collapse: "always",
102
+ align: "end",
103
+ size: e.size,
104
+ "aria-label": e.label,
105
+ onClick: l[0] || (l[0] = pe(() => {
106
+ }, ["stop"]))
107
+ }, {
108
+ trigger: b(() => [
109
+ _(r(Y), {
110
+ type: "more",
111
+ size: e.size,
112
+ title: r(n)("editor.more")
113
+ }, null, 8, ["size", "title"])
114
+ ]),
115
+ collapsed: b(() => [
116
+ (v(!0), k(B, null, N(a.value, (s) => (v(), k(B, {
117
+ key: s.key
118
+ }, [
119
+ s.key === u.value ? (v(), k("hr", ft)) : W("", !0),
120
+ _(r(Ve), {
121
+ icon: s.icon,
122
+ tone: s.danger ? "danger" : "default",
123
+ href: s.href,
124
+ target: s.href ? s.target ?? "_blank" : void 0,
125
+ disabled: s.disabled,
126
+ onClick: (i) => s.run?.()
127
+ }, {
128
+ default: b(() => [
129
+ z(C(s.label), 1)
130
+ ]),
131
+ _: 2
132
+ }, 1032, ["icon", "tone", "href", "target", "disabled", "onClick"])
133
+ ], 64))), 128))
134
+ ]),
135
+ _: 1
136
+ }, 8, ["size", "aria-label"])) : W("", !0);
137
+ }
138
+ }), P = (e, n) => {
139
+ const t = e.__vccOpts || e;
140
+ for (const [a, u] of n)
141
+ t[a] = u;
142
+ return t;
143
+ }, xe = /* @__PURE__ */ P(ht, [["__scopeId", "data-v-cab01f7f"]]), vt = ["data-level"], pt = {
144
+ key: 0,
145
+ class: "wx-screen-head__trail"
146
+ }, bt = { class: "wx-screen-head__name" }, gt = {
147
+ key: 4,
148
+ class: "wx-screen-head__actions"
149
+ }, wt = /* @__PURE__ */ U({
150
+ __name: "ScreenHead",
151
+ props: {
152
+ title: { default: void 0 },
153
+ subtitle: { default: void 0 },
154
+ back: { type: Boolean, default: void 0 },
155
+ backLabel: { default: void 0 },
156
+ level: { default: 2 },
157
+ actions: { default: void 0 },
158
+ collapseBelow: { default: 720 },
159
+ divider: { type: Boolean, default: !1 }
160
+ },
161
+ emits: ["back"],
162
+ setup(e, { emit: n }) {
163
+ const t = e, a = n, u = I("webx-admin"), o = Ce(), l = Le("root"), s = Fe(l), i = x(() => s.value > 0 && s.value < t.collapseBelow), m = x(() => t.actions ?? []), h = x(
164
+ () => m.value.find((c) => c.primary) ?? null
165
+ ), f = x(() => i.value ? h.value ? [h.value] : [] : m.value.filter((c) => !c.menu && !c.danger)), d = x(() => i.value ? m.value.filter((c) => c !== h.value) : m.value.filter((c) => c.menu || c.danger)), p = x(
166
+ () => t.back && t.back !== !0 ? t.back : null
167
+ ), g = x(
168
+ () => f.value.length > 0 || d.value.length > 0 || !!o.extra
169
+ );
170
+ return (c, w) => (v(), k("div", {
171
+ ref_key: "root",
172
+ ref: l,
173
+ class: j(["wx-screen-head", {
174
+ "is-narrow": i.value,
175
+ "has-button": f.value.length > 0,
176
+ "has-trail": !!c.$slots.trail,
177
+ "has-divider": e.divider
178
+ }]),
179
+ "data-level": e.level
180
+ }, [
181
+ c.$slots.trail ? (v(), k("div", pt, [
182
+ L(c.$slots, "trail", {}, void 0, !0)
183
+ ])) : W("", !0),
184
+ p.value ? (v(), y(mt, {
185
+ key: 1,
186
+ class: "wx-screen-head__back",
187
+ to: p.value,
188
+ label: e.backLabel,
189
+ "tooltip-side": "bottom"
190
+ }, null, 8, ["to", "label"])) : e.back ? (v(), y(r(Y), {
191
+ key: 2,
192
+ class: "wx-screen-head__back",
193
+ icon: "arrow-left",
194
+ size: "sm",
195
+ "tooltip-side": "bottom",
196
+ title: e.backLabel ?? r(u)("editor.back"),
197
+ onClick: w[0] || (w[0] = ($) => a("back"))
198
+ }, null, 8, ["title"])) : W("", !0),
199
+ M("div", bt, [
200
+ e.title ? (v(), y(r(He), {
201
+ key: 0,
202
+ level: e.level,
203
+ truncate: "",
204
+ class: "wx-screen-head__title"
205
+ }, {
206
+ default: b(() => [
207
+ z(C(e.title), 1)
208
+ ]),
209
+ _: 1
210
+ }, 8, ["level"])) : W("", !0),
211
+ L(c.$slots, "title-after", {}, void 0, !0)
212
+ ]),
213
+ e.subtitle || c.$slots.subtitle ? (v(), y(r(q), {
214
+ key: 3,
215
+ class: "wx-screen-head__subtitle",
216
+ size: "sm",
217
+ tone: "muted",
218
+ truncate: ""
219
+ }, {
220
+ default: b(() => [
221
+ L(c.$slots, "subtitle", {}, () => [
222
+ z(C(e.subtitle), 1)
223
+ ], !0)
224
+ ]),
225
+ _: 3
226
+ })) : W("", !0),
227
+ g.value ? (v(), k("div", gt, [
228
+ L(c.$slots, "extra", {}, void 0, !0),
229
+ (v(!0), k(B, null, N(f.value, ($) => (v(), y(r(O), {
230
+ key: $.key,
231
+ class: j(["wx-screen-head__button", { "is-primary": $.primary }]),
232
+ type: $.primary ? "primary" : "default",
233
+ variant: $.primary ? "solid" : $.variant ?? "outline",
234
+ loading: $.loading,
235
+ disabled: $.disabled,
236
+ href: $.href,
237
+ target: $.href ? $.target ?? "_blank" : void 0,
238
+ rel: $.href ? "noopener" : void 0,
239
+ onClick: (K) => $.run?.()
240
+ }, be({
241
+ default: b(() => [
242
+ z(" " + C($.label), 1)
243
+ ]),
244
+ _: 2
245
+ }, [
246
+ $.icon ? {
247
+ name: "icon",
248
+ fn: b(() => [
249
+ _(r(Oe), {
250
+ name: $.icon
251
+ }, null, 8, ["name"])
252
+ ]),
253
+ key: "0"
254
+ } : void 0
255
+ ]), 1032, ["class", "type", "variant", "loading", "disabled", "href", "target", "rel", "onClick"]))), 128)),
256
+ d.value.length > 0 ? (v(), y(xe, {
257
+ key: 0,
258
+ actions: d.value,
259
+ size: "lg",
260
+ label: e.title ?? r(u)("editor.more")
261
+ }, null, 8, ["actions", "label"])) : W("", !0)
262
+ ])) : W("", !0)
263
+ ], 10, vt));
264
+ }
265
+ }), yt = /* @__PURE__ */ P(wt, [["__scopeId", "data-v-e27d184e"]]), xt = ["data-wx-fill"], kt = /* @__PURE__ */ U({
12
266
  __name: "ListScreen",
13
- props: /* @__PURE__ */ se({
267
+ props: /* @__PURE__ */ ie({
14
268
  title: { default: void 0 },
269
+ subtitle: { default: void 0 },
270
+ back: { default: void 0 },
271
+ backLabel: { default: void 0 },
272
+ actions: { default: void 0 },
15
273
  views: { default: void 0 },
16
274
  card: { type: Boolean, default: !0 },
17
275
  padding: { default: void 0 },
@@ -23,388 +281,378 @@ const Ze = ["data-wx-fill"], et = {
23
281
  }),
24
282
  emits: ["update:view"],
25
283
  setup(e) {
26
- const t = he(e, "view");
27
- return (n, a) => (f(), x("div", {
28
- class: le(["wx-list-screen", { "is-fill": e.fill }]),
284
+ const n = ge(e, "view");
285
+ return (t, a) => (v(), k("div", {
286
+ class: j(["wx-list-screen", { "is-fill": e.fill }]),
29
287
  "data-wx-fill": e.fill ? "" : void 0
30
288
  }, [
31
- e.title || n.$slots.actions ? (f(), x("div", et, [
32
- e.title ? (f(), b(d(Re), {
33
- key: 0,
34
- level: 2,
35
- class: "wx-list-screen__title"
36
- }, {
37
- default: g(() => [
38
- C(E(e.title), 1)
289
+ e.title || e.actions || t.$slots.actions ? (v(), y(yt, {
290
+ key: 0,
291
+ class: "wx-list-screen__head",
292
+ title: e.title,
293
+ subtitle: e.subtitle,
294
+ back: e.back,
295
+ "back-label": e.backLabel,
296
+ actions: e.actions,
297
+ "collapse-below": 480
298
+ }, be({ _: 2 }, [
299
+ t.$slots.actions ? {
300
+ name: "extra",
301
+ fn: b(() => [
302
+ L(t.$slots, "actions", {}, void 0, !0)
39
303
  ]),
40
- _: 1
41
- })) : W("", !0),
42
- n.$slots.actions ? (f(), x("div", tt, [
43
- L(n.$slots, "actions", {}, void 0, !0)
44
- ])) : W("", !0)
45
- ])) : W("", !0),
46
- e.views && e.views.length > 0 ? (f(), b(d(Me), {
304
+ key: "0"
305
+ } : void 0
306
+ ]), 1032, ["title", "subtitle", "back", "back-label", "actions"])) : W("", !0),
307
+ e.views && e.views.length > 0 ? (v(), y(r(je), {
47
308
  key: 1,
48
- modelValue: t.value,
49
- "onUpdate:modelValue": a[0] || (a[0] = (r) => t.value = r),
309
+ modelValue: n.value,
310
+ "onUpdate:modelValue": a[0] || (a[0] = (u) => n.value = u),
50
311
  class: "wx-list-screen__views",
51
312
  items: e.views,
52
313
  "collapse-below": e.collapseBelow,
53
314
  "aria-label": e.title
54
315
  }, {
55
- default: g(() => [
56
- e.card ? (f(), b(d(me), {
316
+ default: b(() => [
317
+ e.card ? (v(), y(r(me), {
57
318
  key: 0,
58
319
  class: "wx-list-screen__card",
59
320
  padding: e.padding
60
321
  }, {
61
- default: g(() => [
62
- L(n.$slots, "default", {}, void 0, !0)
322
+ default: b(() => [
323
+ L(t.$slots, "default", {}, void 0, !0)
63
324
  ]),
64
325
  _: 3
65
- }, 8, ["padding"])) : L(n.$slots, "default", {}, void 0, !0, 1)
326
+ }, 8, ["padding"])) : L(t.$slots, "default", {}, void 0, !0, 1)
66
327
  ]),
67
328
  _: 3
68
- }, 8, ["modelValue", "items", "collapse-below", "aria-label"])) : (f(), x(R, { key: 2 }, [
69
- e.card ? (f(), b(d(me), {
329
+ }, 8, ["modelValue", "items", "collapse-below", "aria-label"])) : (v(), k(B, { key: 2 }, [
330
+ e.card ? (v(), y(r(me), {
70
331
  key: 0,
71
332
  class: "wx-list-screen__card",
72
333
  padding: e.padding
73
334
  }, {
74
- default: g(() => [
75
- L(n.$slots, "default", {}, void 0, !0)
335
+ default: b(() => [
336
+ L(t.$slots, "default", {}, void 0, !0)
76
337
  ]),
77
338
  _: 3
78
- }, 8, ["padding"])) : L(n.$slots, "default", {}, void 0, !0, 1)
339
+ }, 8, ["padding"])) : L(t.$slots, "default", {}, void 0, !0, 1)
79
340
  ], 64))
80
- ], 10, Ze));
341
+ ], 10, xt));
342
+ }
343
+ }), _t = /* @__PURE__ */ P(kt, [["__scopeId", "data-v-8c7e5ad1"]]), $t = /* @__PURE__ */ U({
344
+ name: "WxRichTextField",
345
+ inheritAttrs: !1,
346
+ __name: "RichTextField",
347
+ setup(e) {
348
+ const n = H(), t = I("webx-admin"), a = x(() => n.pickImage ?? void 0), u = x(() => ({
349
+ bold: t("rich-text.bold"),
350
+ italic: t("rich-text.italic"),
351
+ strike: t("rich-text.strike"),
352
+ code: t("rich-text.code"),
353
+ h2: t("rich-text.h2"),
354
+ h3: t("rich-text.h3"),
355
+ h4: t("rich-text.h4"),
356
+ bulletList: t("rich-text.bullet-list"),
357
+ orderedList: t("rich-text.ordered-list"),
358
+ blockquote: t("rich-text.blockquote"),
359
+ hr: t("rich-text.hr"),
360
+ link: t("rich-text.link"),
361
+ table: t("rich-text.table"),
362
+ image: t("rich-text.image"),
363
+ youtube: t("rich-text.youtube"),
364
+ undo: t("rich-text.undo"),
365
+ redo: t("rich-text.redo"),
366
+ addRowAfter: t("rich-text.row-below"),
367
+ addRowBefore: t("rich-text.row-above"),
368
+ addColumnAfter: t("rich-text.column-after"),
369
+ addColumnBefore: t("rich-text.column-before"),
370
+ deleteRow: t("rich-text.delete-row"),
371
+ deleteColumn: t("rich-text.delete-column"),
372
+ mergeOrSplit: t("rich-text.merge-cells"),
373
+ deleteTable: t("rich-text.delete-table"),
374
+ toolbar: t("rich-text.toolbar"),
375
+ linkAddress: t("rich-text.link-address"),
376
+ youtubeAddress: t("rich-text.youtube-address"),
377
+ apply: t("rich-text.apply"),
378
+ cancel: t("rich-text.cancel"),
379
+ uploading: t("rich-text.uploading")
380
+ }));
381
+ return (o, l) => (v(), y(r(qe), ze(o.$attrs, {
382
+ labels: u.value,
383
+ "pick-image": a.value
384
+ }), null, 16, ["labels", "pick-image"]));
81
385
  }
82
- }), B = (e, t) => {
83
- const n = e.__vccOpts || e;
84
- for (const [a, r] of t)
85
- n[a] = r;
86
- return n;
87
- }, at = /* @__PURE__ */ B(nt, [["__scopeId", "data-v-7586ed04"]]), lt = {
88
- "wx-list": { component: at, kind: "layout", labelProp: "title" }
89
- }, ye = /* @__PURE__ */ Symbol("webx-admin");
386
+ }), Tt = {
387
+ "wx-list": { component: _t, kind: "layout", labelProp: "title" },
388
+ // Full width: an editor shares a row with nothing, and a form of two columns would give it
389
+ // half a line to write a page of text in.
390
+ "wx-rich-text": { component: $t, kind: "field", wide: !0 }
391
+ }, ke = /* @__PURE__ */ Symbol("webx-admin");
90
392
  function H() {
91
- const e = G(ye, null);
393
+ const e = ee(ke, null);
92
394
  if (e === null)
93
395
  throw new Error("useAdmin() was called outside a panel created by createAdmin().");
94
396
  return e;
95
397
  }
96
- function st(e) {
97
- const t = oe({
398
+ function St(e) {
399
+ const n = se({
98
400
  status: "loading",
99
401
  manifest: null,
100
402
  user: null,
101
403
  error: null
102
- }), n = S(() => {
103
- const l = t.manifest;
104
- if (l === null)
404
+ }), t = x(() => {
405
+ const d = n.manifest;
406
+ if (d === null)
105
407
  return [];
106
- const v = [];
107
- for (const h of l.modules) {
108
- const w = e.modules.find((_) => _.id === h.id);
109
- if (w === void 0)
408
+ const p = [];
409
+ for (const g of d.modules) {
410
+ const c = e.modules.find(($) => $.id === g.id);
411
+ if (c === void 0)
110
412
  continue;
111
- const p = w.path ?? w.routes?.[0]?.path;
112
- p !== void 0 && v.push({
113
- id: h.id,
114
- title: h.title,
115
- icon: h.icon,
116
- path: p,
117
- group: h.group ?? null
413
+ const w = c.path ?? c.routes?.[0]?.path;
414
+ w !== void 0 && p.push({
415
+ id: g.id,
416
+ title: g.title,
417
+ icon: g.icon,
418
+ path: w,
419
+ group: g.group ?? null
118
420
  });
119
421
  }
120
- return v;
121
- }), a = S(() => {
122
- const l = t.manifest?.groups ?? [], v = [], h = /* @__PURE__ */ new Map();
123
- for (const w of n.value)
124
- if (w.group !== null && l.some((p) => p.id === w.group)) {
125
- const p = h.get(w.group) ?? [];
126
- p.push(w), h.set(w.group, p);
422
+ return p;
423
+ }), a = x(() => {
424
+ const d = n.manifest?.groups ?? [], p = [], g = /* @__PURE__ */ new Map();
425
+ for (const c of t.value)
426
+ if (c.group !== null && d.some((w) => w.id === c.group)) {
427
+ const w = g.get(c.group) ?? [];
428
+ w.push(c), g.set(c.group, w);
127
429
  } else
128
- v.push(w);
430
+ p.push(c);
129
431
  return {
130
- top: v,
131
- groups: l.filter((w) => h.has(w.id)).map((w) => ({
132
- id: w.id,
133
- title: w.title,
134
- entries: h.get(w.id) ?? []
432
+ top: p,
433
+ groups: d.filter((c) => g.has(c.id)).map((c) => ({
434
+ id: c.id,
435
+ title: c.title,
436
+ icon: c.icon ?? null,
437
+ entries: g.get(c.id) ?? []
135
438
  }))
136
439
  };
137
- }), r = { ...lt };
138
- for (const l of e.modules)
139
- Object.assign(r, l.types);
140
- Object.assign(r, e.types);
141
- const o = /* @__PURE__ */ new Map();
142
- async function s(l) {
143
- const v = `${e.i18n.state.locale}:${l}`;
144
- let h = o.get(v);
145
- return h === void 0 && (h = e.http.get(`${e.apiPath}/screens/${l}`).then((w) => w.data.root).catch((w) => {
146
- throw o.delete(v), w;
147
- }), o.set(v, h)), h;
440
+ }), u = { ...Tt };
441
+ for (const d of e.modules)
442
+ Object.assign(u, d.types);
443
+ Object.assign(u, e.types);
444
+ const o = e.modules.find((d) => d.pickImage !== void 0)?.pickImage, l = /* @__PURE__ */ new Map();
445
+ async function s(d) {
446
+ const p = `${e.i18n.state.locale}:${d}`;
447
+ let g = l.get(p);
448
+ return g === void 0 && (g = e.http.get(`${e.apiPath}/screens/${d}`).then((c) => c.data.root).catch((c) => {
449
+ throw l.delete(p), c;
450
+ }), l.set(p, g)), g;
148
451
  }
149
- let u = null;
150
- async function i() {
151
- t.status = "loading", t.error = null;
452
+ let i = null;
453
+ async function m() {
454
+ n.status = "loading", n.error = null;
152
455
  try {
153
- if (u !== null && (t.user = await u(), t.user === null)) {
154
- t.manifest = null, t.status = "unauthenticated";
456
+ if (i !== null && (n.user = await i(), n.user === null)) {
457
+ n.manifest = null, n.status = "unauthenticated";
155
458
  return;
156
459
  }
157
- const l = await e.loadManifest();
158
- t.manifest = l, e.i18n.state.contentLocales = l.locales ?? [], e.i18n.state.panelLocales = l.panelLocales ?? e.i18n.state.panelLocales, l.locale !== void 0 && l.locale !== e.i18n.state.locale && await m(l.locale), t.status = "ready";
159
- } catch (l) {
160
- if (it(l)) {
161
- t.manifest = null, t.user = null, t.status = "unauthenticated";
460
+ const d = await e.loadManifest();
461
+ n.manifest = d, e.i18n.state.contentLocales = d.locales ?? [], e.i18n.state.panelLocales = d.panelLocales ?? e.i18n.state.panelLocales, d.locale !== void 0 && d.locale !== e.i18n.state.locale && await f(d.locale), n.status = "ready";
462
+ } catch (d) {
463
+ if (Lt(d)) {
464
+ n.manifest = null, n.user = null, n.status = "unauthenticated";
162
465
  return;
163
466
  }
164
- t.error = l instanceof Error ? l.message : String(l), t.status = "error";
467
+ n.error = d instanceof Error ? d.message : String(d), n.status = "error";
165
468
  }
166
469
  }
167
- async function c() {
168
- if (t.manifest !== null)
470
+ async function h() {
471
+ if (n.manifest !== null)
169
472
  try {
170
- t.manifest = await e.loadManifest();
473
+ n.manifest = await e.loadManifest();
171
474
  } catch {
172
475
  }
173
476
  }
174
- async function m(l) {
477
+ async function f(d) {
175
478
  if (e.loadDictionary === void 0) {
176
- e.i18n.state.locale = l;
479
+ e.i18n.state.locale = d;
177
480
  return;
178
481
  }
179
- await e.loadDictionary(l), await c();
482
+ await e.loadDictionary(d), await h();
180
483
  }
181
484
  return {
182
485
  http: e.http,
183
486
  basePath: e.basePath,
184
487
  apiPath: e.apiPath,
185
- state: t,
488
+ state: n,
186
489
  i18n: e.i18n,
187
490
  modules: e.modules,
188
- nav: n,
491
+ nav: t,
189
492
  groups: a,
190
- types: r,
191
- reload: i,
192
- refreshManifest: c,
193
- setLocale: m,
194
- setUser(l) {
195
- t.user = l;
493
+ types: u,
494
+ pickImage: o ?? null,
495
+ reload: m,
496
+ refreshManifest: h,
497
+ setLocale: f,
498
+ setUser(d) {
499
+ n.user = d;
196
500
  },
197
- useSessionLoader(l) {
198
- u = l;
501
+ useSessionLoader(d) {
502
+ i = d;
199
503
  },
200
- can(l) {
201
- const v = t.user;
202
- return v === null ? !1 : v.isSuper || v.permissions.includes(l);
504
+ can(d) {
505
+ const p = n.user;
506
+ return p === null ? !1 : p.isSuper || p.permissions.includes(d);
203
507
  },
204
508
  loadScreen: s,
205
- screenPatch(l) {
206
- return e.screens?.[l] ?? [];
509
+ screenPatch(d) {
510
+ return e.screens?.[d] ?? [];
207
511
  }
208
512
  };
209
513
  }
210
- function ot(e, t) {
211
- e.provide(ye, t);
514
+ function Ct(e, n) {
515
+ e.provide(ke, n);
212
516
  }
213
- function it(e) {
517
+ function Lt(e) {
214
518
  return typeof e == "object" && e !== null && "status" in e && e.status === 401;
215
519
  }
216
- const Q = /* @__PURE__ */ Symbol("webx-i18n");
217
- function dn() {
218
- const e = G(Q, null);
219
- if (e === null)
220
- throw new Error("useI18n() was called outside a panel created by createAdmin().");
221
- return e;
222
- }
223
- function N(e) {
224
- const t = G(Q, null);
225
- return t === null ? de().scope(e) : t.scope(e);
226
- }
227
- function rt(e, t) {
228
- e.provide(Q, t);
229
- }
230
- function de(e = {}) {
231
- const t = e.fallback ?? "en", n = oe({
232
- locale: e.locale ?? t,
233
- fallback: t,
234
- panelLocales: [],
235
- contentLocales: []
236
- }), a = {}, r = oe({ value: {} });
237
- function o(u, i, c) {
238
- let m = u[i]?.[c[0] ?? ""];
239
- for (const l of c.slice(1)) {
240
- if (typeof m != "object" || m === null)
241
- return null;
242
- m = m[l];
243
- }
244
- return typeof m == "string" ? m : null;
245
- }
246
- function s(u, i, c) {
247
- const [m, l] = i.includes("::") ? i.split("::", 2) : [u, i], v = l.split("."), h = o(r.value, m, v) ?? o(a, m, v) ?? // Not an empty string: a key on screen is ugly, but it says which key, and a blank
248
- // label says nothing to anybody trying to fix it.
249
- i;
250
- return c === void 0 ? h : ut(h, c);
251
- }
252
- return {
253
- state: n,
254
- defaults(u, i) {
255
- a[u] = { ...a[u], ...i };
256
- },
257
- load(u, i, c) {
258
- r.value = u ?? {}, n.locale = i ?? n.locale, c !== void 0 && (n.fallback = c);
259
- },
260
- scope(u) {
261
- return (i, c) => s(u, i, c);
262
- },
263
- t: (u, i) => s("", u, i)
264
- };
265
- }
266
- function ut(e, t) {
267
- let n = e;
268
- for (const [a, r] of Object.entries(t))
269
- n = n.replaceAll(`:${a}`, String(r));
270
- return n;
271
- }
272
- const dt = /* @__PURE__ */ U({
520
+ const zt = /* @__PURE__ */ U({
273
521
  __name: "AdminLanding",
274
522
  props: {
275
523
  landing: { default: null }
276
524
  },
277
525
  setup(e) {
278
- const t = e, n = H(), a = we(), r = N("webx-admin"), o = S(() => {
279
- const s = n.nav.value;
280
- return s.length === 0 ? null : ((t.landing === null ? void 0 : s.find((i) => i.path === t.landing)) ?? s[0])?.path ?? null;
526
+ const n = e, t = H(), a = we(), u = I("webx-admin"), o = x(() => {
527
+ const l = t.nav.value;
528
+ return l.length === 0 ? null : ((n.landing === null ? void 0 : l.find((i) => i.path === n.landing)) ?? l[0])?.path ?? null;
281
529
  });
282
- return J(
530
+ return te(
283
531
  o,
284
- (s) => {
285
- s !== null && a.replace(s);
532
+ (l) => {
533
+ l !== null && a.replace(l);
286
534
  },
287
535
  { immediate: !0 }
288
- ), (s, u) => o.value === null && d(n).state.status === "ready" ? (f(), b(d(Ne), {
536
+ ), (l, s) => o.value === null && r(t).state.status === "ready" ? (v(), y(r(Ye), {
289
537
  key: 0,
290
538
  status: "info",
291
- title: d(r)("shell.empty-title"),
292
- description: d(r)("shell.empty-description")
539
+ title: r(u)("shell.empty-title"),
540
+ description: r(u)("shell.empty-description")
293
541
  }, null, 8, ["title", "description"])) : W("", !0);
294
542
  }
295
- }), ct = /* @__PURE__ */ U({
543
+ }), Wt = /* @__PURE__ */ U({
296
544
  __name: "AdminNav",
297
545
  props: {
298
546
  collapsed: { type: Boolean }
299
547
  },
300
548
  emits: ["select"],
301
- setup(e, { emit: t }) {
302
- const n = t, a = H(), r = N("webx-admin"), o = we(), s = Ce(), u = S({
303
- get: () => a.nav.value.find((c) => s.path.startsWith(c.path))?.id ?? "",
549
+ setup(e, { emit: n }) {
550
+ const t = n, a = H(), u = I("webx-admin"), o = we(), l = Me(), s = x({
551
+ get: () => a.nav.value.find((m) => l.path.startsWith(m.path))?.id ?? "",
304
552
  set: (i) => {
305
- const c = a.nav.value.find((m) => m.id === i);
306
- c !== void 0 && o.push(c.path);
553
+ const m = a.nav.value.find((h) => h.id === i);
554
+ m !== void 0 && o.push(m.path);
307
555
  }
308
556
  });
309
- return (i, c) => {
310
- const m = z("wx-menu-item"), l = z("wx-submenu"), v = z("wx-menu");
311
- return f(), b(v, {
312
- modelValue: u.value,
313
- "onUpdate:modelValue": c[0] || (c[0] = (h) => u.value = h),
557
+ return (i, m) => {
558
+ const h = R("wx-menu-item"), f = R("wx-submenu"), d = R("wx-menu");
559
+ return v(), y(d, {
560
+ modelValue: s.value,
561
+ "onUpdate:modelValue": m[0] || (m[0] = (p) => s.value = p),
314
562
  collapsed: e.collapsed,
315
- label: d(r)("nav.sections"),
316
- onSelect: c[1] || (c[1] = (h) => n("select"))
563
+ label: r(u)("nav.sections"),
564
+ onSelect: m[1] || (m[1] = (p) => t("select"))
317
565
  }, {
318
- default: g(() => [
319
- (f(!0), x(R, null, j(d(a).groups.value.top, (h) => (f(), b(m, {
320
- key: h.id,
321
- value: h.id,
322
- icon: h.icon ?? void 0,
323
- label: h.title
566
+ default: b(() => [
567
+ (v(!0), k(B, null, N(r(a).groups.value.top, (p) => (v(), y(h, {
568
+ key: p.id,
569
+ value: p.id,
570
+ icon: p.icon ?? void 0,
571
+ label: p.title
324
572
  }, null, 8, ["value", "icon", "label"]))), 128)),
325
- (f(!0), x(R, null, j(d(a).groups.value.groups, (h) => (f(), b(l, {
326
- key: h.id,
327
- value: `group:${h.id}`,
328
- title: h.title,
329
- icon: "gear"
573
+ (v(!0), k(B, null, N(r(a).groups.value.groups, (p) => (v(), y(f, {
574
+ key: p.id,
575
+ value: `group:${p.id}`,
576
+ title: p.title,
577
+ icon: p.icon ?? "gear"
330
578
  }, {
331
- default: g(() => [
332
- (f(!0), x(R, null, j(h.entries, (w) => (f(), b(m, {
333
- key: w.id,
334
- value: w.id,
335
- icon: w.icon ?? void 0,
336
- label: w.title
579
+ default: b(() => [
580
+ (v(!0), k(B, null, N(p.entries, (g) => (v(), y(h, {
581
+ key: g.id,
582
+ value: g.id,
583
+ icon: g.icon ?? void 0,
584
+ label: g.title
337
585
  }, null, 8, ["value", "icon", "label"]))), 128))
338
586
  ]),
339
587
  _: 2
340
- }, 1032, ["value", "title"]))), 128))
588
+ }, 1032, ["value", "title", "icon"]))), 128))
341
589
  ]),
342
590
  _: 1
343
591
  }, 8, ["modelValue", "collapsed", "label"]);
344
592
  };
345
593
  }
346
- }), mt = {
594
+ }), At = {
347
595
  key: 0,
348
596
  class: "wx-root wx-admin-plain"
349
- }, ft = {
597
+ }, Rt = {
350
598
  key: 1,
351
599
  class: "wx-root wx-admin-plain"
352
- }, vt = {
600
+ }, Et = {
353
601
  key: 2,
354
602
  class: "wx-root wx-admin-plain"
355
- }, ht = ["src", "alt", "width", "height"], pt = ["src", "alt", "width", "height"], wt = ["src", "alt"], gt = { class: "wx-admin__user" }, yt = { class: "wx-admin__user wx-admin__user--drawer" }, xt = /* @__PURE__ */ U({
603
+ }, Ut = ["src", "alt", "width", "height"], Bt = ["src", "alt", "width", "height"], It = ["src", "alt"], Mt = { class: "wx-admin__user" }, Dt = { class: "wx-admin__user wx-admin__user--drawer" }, Nt = /* @__PURE__ */ U({
356
604
  __name: "AdminShell",
357
605
  setup(e) {
358
- const t = H(), n = N("webx-admin"), a = A(null), { width: r, layout: o, collapsed: s, showAside: u, drawerOpen: i, toggle: c, close: m } = Pe(
606
+ const n = H(), t = I("webx-admin"), a = E(null), { width: u, layout: o, collapsed: l, showAside: s, drawerOpen: i, toggle: m, close: h } = Ke(
359
607
  a,
360
608
  { persist: "webx-admin-shell" }
361
- ), l = S(() => t.state.manifest?.title ?? ""), v = S(() => t.state.manifest?.branding?.logo ?? null), h = S(() => t.state.manifest?.branding?.mark ?? null), w = S(() => Ve(r.value, null));
362
- return $e(() => {
363
- typeof document > "u" || (document.documentElement.dataset.wxShell = w.value);
364
- }), Se(() => {
609
+ ), f = x(() => n.state.manifest?.title ?? ""), d = x(() => n.state.manifest?.branding?.logo ?? null), p = x(() => n.state.manifest?.branding?.mark ?? null), g = x(() => Xe(u.value, null));
610
+ return We(() => {
611
+ typeof document > "u" || (document.documentElement.dataset.wxShell = g.value);
612
+ }), Ae(() => {
365
613
  typeof document < "u" && delete document.documentElement.dataset.wxShell;
366
- }), (p, _) => {
367
- const V = z("router-view"), Z = z("wx-loading"), ee = z("wx-button"), te = z("wx-result"), D = z("wx-action"), k = z("wx-text"), T = z("wx-header"), $ = z("wx-aside"), P = z("wx-main"), _e = z("wx-container"), ke = z("wx-drawer");
368
- return f(), x(R, null, [
369
- y(d(De)),
370
- d(t).state.status === "unauthenticated" ? (f(), x("div", mt, [
371
- y(V)
372
- ])) : d(t).state.status === "loading" ? (f(), x("div", ft, [
373
- y(Z, {
374
- label: d(n)("shell.loading")
614
+ }), (c, w) => {
615
+ const $ = R("router-view"), K = R("wx-loading"), ae = R("wx-button"), le = R("wx-result"), V = R("wx-action"), T = R("wx-text"), A = R("wx-header"), S = R("wx-aside"), D = R("wx-main"), Te = R("wx-container"), Se = R("wx-drawer");
616
+ return v(), k(B, null, [
617
+ _(r(Ge)),
618
+ r(n).state.status === "unauthenticated" ? (v(), k("div", At, [
619
+ _($)
620
+ ])) : r(n).state.status === "loading" ? (v(), k("div", Rt, [
621
+ _(K, {
622
+ label: r(t)("shell.loading")
375
623
  }, null, 8, ["label"])
376
- ])) : d(t).state.status === "error" ? (f(), x("div", vt, [
377
- y(te, {
624
+ ])) : r(n).state.status === "error" ? (v(), k("div", Et, [
625
+ _(le, {
378
626
  status: "error",
379
- title: d(n)("shell.error-title"),
380
- description: d(t).state.error
627
+ title: r(t)("shell.error-title"),
628
+ description: r(n).state.error
381
629
  }, {
382
- default: g(() => [
383
- y(ee, {
630
+ default: b(() => [
631
+ _(ae, {
384
632
  type: "primary",
385
- onClick: _[0] || (_[0] = (ce) => d(t).reload())
633
+ onClick: w[0] || (w[0] = (ce) => r(n).reload())
386
634
  }, {
387
- default: g(() => [
388
- C(E(d(n)("shell.retry")), 1)
635
+ default: b(() => [
636
+ z(C(r(t)("shell.retry")), 1)
389
637
  ]),
390
638
  _: 1
391
639
  })
392
640
  ]),
393
641
  _: 1
394
642
  }, 8, ["title", "description"])
395
- ])) : (f(), x("div", {
643
+ ])) : (v(), k("div", {
396
644
  key: 3,
397
645
  ref_key: "shellEl",
398
646
  ref: a,
399
- class: le(["wx-root wx-admin", `wx-admin--${w.value}`])
647
+ class: j(["wx-root wx-admin", `wx-admin--${g.value}`])
400
648
  }, [
401
- y(_e, {
402
- direction: d(o) === "drawer" ? "vertical" : "horizontal",
649
+ _(Te, {
650
+ direction: r(o) === "drawer" ? "vertical" : "horizontal",
403
651
  "full-height": "",
404
652
  class: "wx-admin__frame"
405
653
  }, {
406
- default: g(() => [
407
- d(o) === "drawer" ? (f(), b(T, {
654
+ default: b(() => [
655
+ r(o) === "drawer" ? (v(), y(A, {
408
656
  key: 0,
409
657
  class: "wx-admin__header",
410
658
  floating: "",
@@ -413,30 +661,30 @@ const dt = /* @__PURE__ */ U({
413
661
  padding: "sm",
414
662
  height: "var(--wx-admin-header-height)"
415
663
  }, {
416
- end: g(() => [
417
- L(p.$slots, "user", { expanded: !1 }, void 0, !0)
664
+ end: b(() => [
665
+ L(c.$slots, "user", { expanded: !1 }, void 0, !0)
418
666
  ]),
419
- default: g(() => [
420
- y(D, {
667
+ default: b(() => [
668
+ _(V, {
421
669
  icon: "menu",
422
- title: d(n)("nav.menu"),
423
- onClick: d(c)
670
+ title: r(t)("nav.menu"),
671
+ onClick: r(m)
424
672
  }, null, 8, ["title", "onClick"]),
425
- L(p.$slots, "brand", {}, () => [
426
- v.value ? (f(), x("img", {
673
+ L(c.$slots, "brand", {}, () => [
674
+ d.value ? (v(), k("img", {
427
675
  key: 0,
428
676
  class: "wx-admin__logo",
429
- src: v.value.url,
430
- alt: l.value,
431
- width: v.value.width ?? void 0,
432
- height: v.value.height ?? void 0
433
- }, null, 8, ht)) : (f(), b(k, {
677
+ src: d.value.url,
678
+ alt: f.value,
679
+ width: d.value.width ?? void 0,
680
+ height: d.value.height ?? void 0
681
+ }, null, 8, Ut)) : (v(), y(T, {
434
682
  key: 1,
435
683
  weight: "semibold",
436
684
  truncate: ""
437
685
  }, {
438
- default: g(() => [
439
- C(E(l.value), 1)
686
+ default: b(() => [
687
+ z(C(f.value), 1)
440
688
  ]),
441
689
  _: 1
442
690
  }))
@@ -444,96 +692,96 @@ const dt = /* @__PURE__ */ U({
444
692
  ]),
445
693
  _: 3
446
694
  })) : W("", !0),
447
- d(u) ? (f(), b($, {
695
+ r(s) ? (v(), y(S, {
448
696
  key: 1,
449
697
  class: "wx-admin__aside",
450
698
  sticky: "",
451
699
  floating: "",
452
700
  scroll: "",
453
701
  bordered: !1,
454
- collapsed: d(s),
702
+ collapsed: r(l),
455
703
  width: 220,
456
704
  "collapsed-width": 56
457
705
  }, {
458
- top: g(() => [
706
+ top: b(() => [
459
707
  M("div", {
460
- class: le(["wx-admin__brand", { "wx-admin__brand--stacked": d(s) && h.value }])
708
+ class: j(["wx-admin__brand", { "wx-admin__brand--stacked": r(l) && p.value }])
461
709
  }, [
462
- d(s) ? h.value ? (f(), x("img", {
710
+ r(l) ? p.value ? (v(), k("img", {
463
711
  key: 1,
464
712
  class: "wx-admin__mark",
465
- src: h.value.url,
466
- alt: l.value
467
- }, null, 8, wt)) : W("", !0) : L(p.$slots, "brand", {}, () => [
468
- v.value ? (f(), x("img", {
713
+ src: p.value.url,
714
+ alt: f.value
715
+ }, null, 8, It)) : W("", !0) : L(c.$slots, "brand", {}, () => [
716
+ d.value ? (v(), k("img", {
469
717
  key: 0,
470
718
  class: "wx-admin__logo",
471
- src: v.value.url,
472
- alt: l.value,
473
- width: v.value.width ?? void 0,
474
- height: v.value.height ?? void 0
475
- }, null, 8, pt)) : (f(), b(k, {
719
+ src: d.value.url,
720
+ alt: f.value,
721
+ width: d.value.width ?? void 0,
722
+ height: d.value.height ?? void 0
723
+ }, null, 8, Bt)) : (v(), y(T, {
476
724
  key: 1,
477
725
  weight: "semibold",
478
726
  truncate: "",
479
727
  class: "wx-admin__title"
480
728
  }, {
481
- default: g(() => [
482
- C(E(l.value), 1)
729
+ default: b(() => [
730
+ z(C(f.value), 1)
483
731
  ]),
484
732
  _: 1
485
733
  }))
486
734
  ], !0, 0),
487
- y(D, {
735
+ _(V, {
488
736
  icon: "sidebar",
489
- title: d(s) ? d(n)("nav.expand") : d(n)("nav.collapse"),
490
- onClick: d(c)
737
+ title: r(l) ? r(t)("nav.expand") : r(t)("nav.collapse"),
738
+ onClick: r(m)
491
739
  }, null, 8, ["title", "onClick"])
492
740
  ], 2)
493
741
  ]),
494
- bottom: g(() => [
495
- M("div", gt, [
496
- L(p.$slots, "user", {
497
- expanded: !d(s)
742
+ bottom: b(() => [
743
+ M("div", Mt, [
744
+ L(c.$slots, "user", {
745
+ expanded: !r(l)
498
746
  }, void 0, !0)
499
747
  ])
500
748
  ]),
501
- default: g(() => [
502
- L(p.$slots, "nav", { collapsed: d(s) }, void 0, !0)
749
+ default: b(() => [
750
+ L(c.$slots, "nav", { collapsed: r(l) }, void 0, !0)
503
751
  ]),
504
752
  _: 3
505
753
  }, 8, ["collapsed"])) : W("", !0),
506
- y(P, {
754
+ _(D, {
507
755
  padding: "none",
508
756
  class: "wx-admin__screen"
509
757
  }, {
510
- default: g(() => [
511
- y(V)
758
+ default: b(() => [
759
+ _($)
512
760
  ]),
513
761
  _: 1
514
762
  })
515
763
  ]),
516
764
  _: 3
517
765
  }, 8, ["direction"]),
518
- y(ke, {
519
- open: d(i),
520
- "onUpdate:open": _[1] || (_[1] = (ce) => Te(i) ? i.value = ce : null),
766
+ _(Se, {
767
+ open: r(i),
768
+ "onUpdate:open": w[1] || (w[1] = (ce) => Re(i) ? i.value = ce : null),
521
769
  class: "wx-admin__drawer",
522
- title: l.value === "" ? d(n)("nav.menu") : l.value,
770
+ title: f.value === "" ? r(t)("nav.menu") : f.value,
523
771
  side: "left",
524
772
  size: 260,
525
773
  "full-screen": !1,
526
774
  closable: ""
527
775
  }, {
528
- footer: g(() => [
529
- M("div", yt, [
530
- L(p.$slots, "user", { expanded: !0 }, void 0, !0)
776
+ footer: b(() => [
777
+ M("div", Dt, [
778
+ L(c.$slots, "user", { expanded: !0 }, void 0, !0)
531
779
  ])
532
780
  ]),
533
- default: g(() => [
534
- L(p.$slots, "nav", {
781
+ default: b(() => [
782
+ L(c.$slots, "nav", {
535
783
  collapsed: !1,
536
- select: d(m)
784
+ select: r(h)
537
785
  }, void 0, !0)
538
786
  ]),
539
787
  _: 3
@@ -542,10 +790,10 @@ const dt = /* @__PURE__ */ U({
542
790
  ], 64);
543
791
  };
544
792
  }
545
- }), bt = /* @__PURE__ */ B(xt, [["__scopeId", "data-v-5baa6cbf"]]);
546
- class ie extends Error {
547
- constructor(t, n, a = {}, r = null, o = null) {
548
- super(t), this.status = n, this.errors = a, this.retryAfter = r, this.body = o, this.name = "HttpError";
793
+ }), Pt = /* @__PURE__ */ P(Nt, [["__scopeId", "data-v-5baa6cbf"]]);
794
+ class re extends Error {
795
+ constructor(n, t, a = {}, u = null, o = null) {
796
+ super(n), this.status = t, this.errors = a, this.retryAfter = u, this.body = o, this.name = "HttpError";
549
797
  }
550
798
  status;
551
799
  errors;
@@ -562,86 +810,86 @@ class ie extends Error {
562
810
  return this.status === 429;
563
811
  }
564
812
  }
565
- const _t = /* @__PURE__ */ new Set(["POST", "PUT", "PATCH", "DELETE"]);
566
- function kt(e = {}) {
567
- const t = (e.baseUrl ?? "").replace(/\/$/, ""), n = e.csrfUrl ?? "/sanctum/csrf-cookie", a = e.fetch ?? globalThis.fetch.bind(globalThis), r = e.onUnauthenticated, o = e.headers;
568
- let s = !1;
569
- async function u(c = !1) {
570
- s && !c && ve("XSRF-TOKEN") !== null || (await a(n, { credentials: "same-origin" }), s = !0);
813
+ const Vt = /* @__PURE__ */ new Set(["POST", "PUT", "PATCH", "DELETE"]);
814
+ function Ft(e = {}) {
815
+ const n = (e.baseUrl ?? "").replace(/\/$/, ""), t = e.csrfUrl ?? "/sanctum/csrf-cookie", a = e.fetch ?? globalThis.fetch.bind(globalThis), u = e.onUnauthenticated, o = e.headers;
816
+ let l = !1;
817
+ async function s(m = !1) {
818
+ l && !m && he("XSRF-TOKEN") !== null || (await a(t, { credentials: "same-origin" }), l = !0);
571
819
  }
572
- async function i(c, m, l, v = {}, h = !1) {
573
- const w = _t.has(c);
574
- w && await u();
575
- const p = {
820
+ async function i(m, h, f, d = {}, p = !1) {
821
+ const g = Vt.has(m);
822
+ g && await s();
823
+ const c = {
576
824
  Accept: "application/json",
577
825
  "X-Requested-With": "XMLHttpRequest",
578
826
  // Standing headers first, so a caller can still override one for a single request.
579
827
  ...o?.(),
580
- ...v.headers
828
+ ...d.headers
581
829
  };
582
- if (w) {
583
- const V = ve("XSRF-TOKEN");
584
- V !== null && (p["X-XSRF-TOKEN"] = V);
830
+ if (g) {
831
+ const $ = he("XSRF-TOKEN");
832
+ $ !== null && (c["X-XSRF-TOKEN"] = $);
585
833
  }
586
- l !== void 0 && (p["Content-Type"] = "application/json");
587
- const _ = await a(St(t, m, v.query), {
588
- method: c,
834
+ f !== void 0 && (c["Content-Type"] = "application/json");
835
+ const w = await a(Ot(n, h, d.query), {
836
+ method: m,
589
837
  credentials: "same-origin",
590
- headers: p,
591
- signal: v.signal,
592
- body: l === void 0 ? void 0 : JSON.stringify(l)
838
+ headers: c,
839
+ signal: d.signal,
840
+ body: f === void 0 ? void 0 : JSON.stringify(f)
593
841
  });
594
- if (_.status === 419 && w && !h)
595
- return await u(!0), i(c, m, l, v, !0);
596
- if (_.status === 401 && r?.(), !_.ok)
597
- throw await $t(_);
598
- if (_.status !== 204)
599
- return await _.json();
842
+ if (w.status === 419 && g && !p)
843
+ return await s(!0), i(m, h, f, d, !0);
844
+ if (w.status === 401 && u?.(), !w.ok)
845
+ throw await Ht(w);
846
+ if (w.status !== 204)
847
+ return await w.json();
600
848
  }
601
849
  return {
602
- get: (c, m) => i("GET", c, void 0, m),
603
- post: (c, m, l) => i("POST", c, m, l),
604
- put: (c, m, l) => i("PUT", c, m, l),
605
- patch: (c, m, l) => i("PATCH", c, m, l),
606
- delete: (c, m) => i("DELETE", c, void 0, m)
850
+ get: (m, h) => i("GET", m, void 0, h),
851
+ post: (m, h, f) => i("POST", m, h, f),
852
+ put: (m, h, f) => i("PUT", m, h, f),
853
+ patch: (m, h, f) => i("PATCH", m, h, f),
854
+ delete: (m, h) => i("DELETE", m, void 0, h)
607
855
  };
608
856
  }
609
- async function $t(e) {
610
- let t = null;
857
+ async function Ht(e) {
858
+ let n = null;
611
859
  try {
612
- t = await e.json();
860
+ n = await e.json();
613
861
  } catch {
614
862
  }
615
- const n = t ?? {}, a = typeof n.message == "string" && n.message !== "" ? n.message : e.statusText || `Request failed with ${e.status}`, r = n.errors !== null && typeof n.errors == "object" ? n.errors : {}, o = e.headers.get("Retry-After"), s = o === null ? null : Number.parseInt(o, 10);
616
- return new ie(
863
+ const t = n ?? {}, a = typeof t.message == "string" && t.message !== "" ? t.message : e.statusText || `Request failed with ${e.status}`, u = t.errors !== null && typeof t.errors == "object" ? t.errors : {}, o = e.headers.get("Retry-After"), l = o === null ? null : Number.parseInt(o, 10);
864
+ return new re(
617
865
  a,
618
866
  e.status,
619
- r,
620
- Number.isFinite(s) ? s : null,
621
- t
867
+ u,
868
+ Number.isFinite(l) ? l : null,
869
+ n
622
870
  );
623
871
  }
624
- function St(e, t, n) {
625
- const r = /^https?:\/\//i.test(t) ? t : `${e}/${t.replace(/^\//, "")}`;
626
- if (n === void 0)
627
- return r;
872
+ function Ot(e, n, t) {
873
+ const u = /^https?:\/\//i.test(n) ? n : `${e}/${n.replace(/^\//, "")}`;
874
+ if (t === void 0)
875
+ return u;
628
876
  const o = new URLSearchParams();
629
- for (const [u, i] of Object.entries(n))
630
- i != null && o.set(u, String(i));
631
- const s = o.toString();
632
- return s === "" ? r : `${r}${r.includes("?") ? "&" : "?"}${s}`;
877
+ for (const [s, i] of Object.entries(t))
878
+ i != null && o.set(s, String(i));
879
+ const l = o.toString();
880
+ return l === "" ? u : `${u}${u.includes("?") ? "&" : "?"}${l}`;
633
881
  }
634
- function ve(e) {
882
+ function he(e) {
635
883
  if (typeof document > "u")
636
884
  return null;
637
- for (const t of document.cookie.split(";")) {
638
- const [n, ...a] = t.trim().split("=");
639
- if (n === e)
885
+ for (const n of document.cookie.split(";")) {
886
+ const [t, ...a] = n.trim().split("=");
887
+ if (t === e)
640
888
  return decodeURIComponent(a.join("="));
641
889
  }
642
890
  return null;
643
891
  }
644
- const xe = {
892
+ const _e = {
645
893
  shell: {
646
894
  loading: "Loading the panel…",
647
895
  "error-title": "The panel could not start",
@@ -662,6 +910,8 @@ const xe = {
662
910
  // the way to rename it. A module that opens an editor should not be inventing these.
663
911
  editor: {
664
912
  back: "Back",
913
+ // The head's ··· on a screen that has no name to give the menu.
914
+ more: "More",
665
915
  rename: "Rename",
666
916
  save: "Save"
667
917
  },
@@ -672,6 +922,13 @@ const xe = {
672
922
  },
673
923
  // When something happened, said the way a person would. The month names and the order of
674
924
  // the parts come from `Intl` — only the words that no formatter knows are here.
925
+ // The two words every list needs the moment it has filters: what the funnel is called,
926
+ // and the way out of all of them at once. The names of the filters themselves belong to
927
+ // whatever is being filtered, and travel with that module's own words.
928
+ filters: {
929
+ title: "Filters",
930
+ reset: "Reset all"
931
+ },
675
932
  dates: {
676
933
  today: "today at :time",
677
934
  yesterday: "yesterday at :time",
@@ -692,6 +949,41 @@ const xe = {
692
949
  offline: "The server did not answer. Check the connection and try again.",
693
950
  unknown: "That did not work."
694
951
  },
952
+ // The toolbar of `wx-rich-text`. The editor is a component of the design system and carries
953
+ // English defaults; these are what the panel calls the same buttons.
954
+ "rich-text": {
955
+ bold: "Bold",
956
+ italic: "Italic",
957
+ strike: "Strikethrough",
958
+ code: "Inline code",
959
+ h2: "Heading 2",
960
+ h3: "Heading 3",
961
+ h4: "Heading 4",
962
+ "bullet-list": "Bulleted list",
963
+ "ordered-list": "Numbered list",
964
+ blockquote: "Quote",
965
+ hr: "Divider",
966
+ link: "Link",
967
+ table: "Table",
968
+ image: "Image",
969
+ youtube: "YouTube video",
970
+ undo: "Undo",
971
+ redo: "Redo",
972
+ "row-below": "Row below",
973
+ "row-above": "Row above",
974
+ "column-after": "Column after",
975
+ "column-before": "Column before",
976
+ "delete-row": "Delete row",
977
+ "delete-column": "Delete column",
978
+ "merge-cells": "Merge or split cells",
979
+ "delete-table": "Delete table",
980
+ toolbar: "Text formatting",
981
+ "link-address": "Link address",
982
+ "youtube-address": "YouTube URL",
983
+ apply: "Apply",
984
+ cancel: "Cancel",
985
+ uploading: "Uploading…"
986
+ },
695
987
  // What one administrator writes on a record for the next one. Not the property of any
696
988
  // section: the same feed hangs off a submission, an order and a client, so the words are
697
989
  // the panel's own.
@@ -715,197 +1007,200 @@ const xe = {
715
1007
  forbidden: "You may not read the notes of this record.",
716
1008
  "not-yours": "A note is edited by whoever wrote it."
717
1009
  }
718
- }, be = "webx.locale";
719
- function cn(e = {}) {
720
- const t = e.manifestUrl ?? Lt() ?? "/api/cms/manifest", n = e.apiPath ?? t.replace(/\/manifest\/?$/, ""), a = e.basePath ?? "/cms", r = e.modules ?? [], o = [...e.routes ?? []];
721
- for (const p of r)
722
- o.push(...p.routes ?? []);
723
- if (!o.some((p) => p.path === "/")) {
724
- const p = r.find((_) => _.landing === !0);
1010
+ }, $e = "webx.locale";
1011
+ function Sn(e = {}) {
1012
+ const n = e.manifestUrl ?? Gt() ?? "/api/cms/manifest", t = e.apiPath ?? n.replace(/\/manifest\/?$/, ""), a = e.basePath ?? "/cms", u = e.modules ?? [], o = [...e.routes ?? []];
1013
+ for (const c of u)
1014
+ o.push(...c.routes ?? []);
1015
+ if (!o.some((c) => c.path === "/")) {
1016
+ const c = u.find((w) => w.landing === !0);
725
1017
  o.push({
726
1018
  path: "/",
727
1019
  name: "webx.home",
728
- component: dt,
729
- props: { landing: p?.path ?? p?.routes?.[0]?.path ?? null }
1020
+ component: zt,
1021
+ props: { landing: c?.path ?? c?.routes?.[0]?.path ?? null }
730
1022
  });
731
1023
  }
732
- const s = Le({
733
- history: We(a),
1024
+ const l = De({
1025
+ history: Ne(a),
734
1026
  routes: o
735
- }), u = de({ locale: e.locale ?? zt() }), i = e.http ?? kt({
1027
+ }), s = de({ locale: e.locale ?? qt() }), i = e.http ?? Ft({
736
1028
  baseUrl: "",
737
1029
  onUnauthenticated: () => {
738
- m.setUser(null), m.state.status = "unauthenticated";
1030
+ h.setUser(null), h.state.status = "unauthenticated";
739
1031
  },
740
1032
  // Every request says which language the panel is currently showing. It decides what
741
1033
  // the server writes its own messages in — a 422 under a field — for anybody who has
742
1034
  // not stored a preference yet, which is everybody until they choose one. Without it,
743
1035
  // signing in on a Russian sign-in screen lands in an English panel.
744
- headers: () => ({ "X-Webx-Locale": u.state.locale })
1036
+ headers: () => ({ "X-Webx-Locale": s.state.locale })
745
1037
  });
746
- u.defaults("webx-admin", xe);
747
- async function c(p) {
748
- const _ = await i.get(`${n}/translations/${p}`);
749
- u.load(_.data.namespaces, _.data.locale, _.data.fallback), Et(_.data.locale), Ct(_.data.locale, u.state.panelLocales);
1038
+ s.defaults("webx-admin", _e);
1039
+ async function m(c) {
1040
+ const w = await i.get(`${t}/translations/${c}`);
1041
+ s.load(w.data.namespaces, w.data.locale, w.data.fallback), Yt(w.data.locale), Xt(w.data.locale, s.state.panelLocales);
750
1042
  }
751
- const m = st({
1043
+ const h = St({
752
1044
  http: i,
753
1045
  basePath: a,
754
- apiPath: n,
755
- modules: r,
756
- i18n: u,
757
- loadDictionary: c,
1046
+ apiPath: t,
1047
+ modules: u,
1048
+ i18n: s,
1049
+ loadDictionary: m,
758
1050
  types: e.types,
759
1051
  screens: e.screens,
760
- loadManifest: async () => (await i.get(t)).data
761
- }), l = ze(Tt(e));
762
- l.use(Ie), ot(l, m), rt(l, u);
763
- const v = A("");
764
- l.provide(Be, {
765
- list: S(
766
- () => u.state.contentLocales.map((p) => ({
767
- code: p.code,
768
- label: p.code.toUpperCase()
1052
+ loadManifest: async () => (await i.get(n)).data
1053
+ }), f = Ee(jt(e));
1054
+ f.use(Je), Ct(f, h), dt(f, s);
1055
+ const d = E("");
1056
+ f.provide(
1057
+ Qe,
1058
+ x(() => s.state.locale)
1059
+ ), f.provide(Ze, {
1060
+ list: x(
1061
+ () => s.state.contentLocales.map((c) => ({
1062
+ code: c.code,
1063
+ label: c.code.toUpperCase()
769
1064
  }))
770
1065
  ),
771
- active: S({
772
- get: () => v.value || (u.state.contentLocales[0]?.code ?? ""),
773
- set: (p) => {
774
- v.value = p;
1066
+ active: x({
1067
+ get: () => d.value || (s.state.contentLocales[0]?.code ?? ""),
1068
+ set: (c) => {
1069
+ d.value = c;
775
1070
  }
776
1071
  })
777
1072
  });
778
- const h = {
779
- app: l,
780
- router: s,
781
- context: m,
782
- i18n: u,
1073
+ const p = {
1074
+ app: f,
1075
+ router: l,
1076
+ context: h,
1077
+ i18n: s,
783
1078
  async mount() {
784
- await Promise.all([w(), c(u.state.locale)]).catch(() => {
785
- }), l.mount(e.el ?? "#webx-app"), await m.reload();
1079
+ await Promise.all([g(), m(s.state.locale)]).catch(() => {
1080
+ }), f.mount(e.el ?? "#webx-app"), await h.reload();
786
1081
  }
787
1082
  };
788
- async function w() {
789
- const p = await i.get(`${n}/locales`);
790
- u.state.panelLocales = p.data.panel, u.state.contentLocales = p.data.content;
1083
+ async function g() {
1084
+ const c = await i.get(`${t}/locales`);
1085
+ s.state.panelLocales = c.data.panel, s.state.contentLocales = c.data.content;
791
1086
  }
792
- for (const p of e.plugins ?? [])
793
- p.install(h);
794
- return l.use(s), h;
1087
+ for (const c of e.plugins ?? [])
1088
+ c.install(p);
1089
+ return f.use(l), p;
795
1090
  }
796
- function Tt(e) {
797
- const t = {
1091
+ function jt(e) {
1092
+ const n = {
798
1093
  // The menu is the panel's own: it is the manifest, drawn.
799
1094
  // The shell hands in what a choice means where it drew the menu — in the drawer it is what
800
1095
  // closes it, and a drawer that stays open over the section it just opened is a drawer the
801
1096
  // reader has to dismiss by hand.
802
- nav: (n) => O(ct, { collapsed: n.collapsed === !0, onSelect: n.select })
1097
+ nav: (t) => X(Wt, { collapsed: t.collapsed === !0, onSelect: t.select })
803
1098
  };
804
- return e.brand !== void 0 && (t.brand = () => O(e.brand)), e.userMenu !== void 0 && (t.user = (n) => O(e.userMenu, { expanded: n.expanded === !0 })), { render: () => O(bt, null, t) };
1099
+ return e.brand !== void 0 && (n.brand = () => X(e.brand)), e.userMenu !== void 0 && (n.user = (t) => X(e.userMenu, { expanded: t.expanded === !0 })), { render: () => X(Pt, null, n) };
805
1100
  }
806
- function zt() {
807
- const e = At(be);
1101
+ function qt() {
1102
+ const e = Kt($e);
808
1103
  return e !== null ? e : typeof document < "u" && document.documentElement.lang !== "" ? document.documentElement.lang : typeof navigator > "u" ? "en" : navigator.language;
809
1104
  }
810
- function Et(e) {
1105
+ function Yt(e) {
811
1106
  try {
812
- localStorage.setItem(be, e);
1107
+ localStorage.setItem($e, e);
813
1108
  } catch {
814
1109
  }
815
1110
  }
816
- function At(e) {
1111
+ function Kt(e) {
817
1112
  try {
818
1113
  return localStorage.getItem(e);
819
1114
  } catch {
820
1115
  return null;
821
1116
  }
822
1117
  }
823
- function Ct(e, t) {
824
- typeof document > "u" || (document.documentElement.lang = e, document.documentElement.dir = t.find((n) => n.code === e)?.direction ?? "ltr");
1118
+ function Xt(e, n) {
1119
+ typeof document > "u" || (document.documentElement.lang = e, document.documentElement.dir = n.find((t) => t.code === e)?.direction ?? "ltr");
825
1120
  }
826
- function Lt() {
1121
+ function Gt() {
827
1122
  return typeof document > "u" ? null : document.querySelector('meta[name="webx-manifest"]')?.getAttribute("content") ?? null;
828
1123
  }
829
- function Wt(e) {
830
- const t = e.replace(/\r\n?/g, `
1124
+ function Jt(e) {
1125
+ const n = e.replace(/\r\n?/g, `
831
1126
  `).split(`
832
- `), n = [];
1127
+ `), t = [];
833
1128
  let a = 0;
834
- for (; a < t.length; ) {
835
- const r = t[a] ?? "";
836
- if (r.trim() === "") {
1129
+ for (; a < n.length; ) {
1130
+ const u = n[a] ?? "";
1131
+ if (u.trim() === "") {
837
1132
  a += 1;
838
1133
  continue;
839
1134
  }
840
- if (/^```([\w-]*)\s*$/.exec(r)) {
1135
+ if (/^```([\w-]*)\s*$/.exec(u)) {
841
1136
  const i = [];
842
- for (a += 1; a < t.length && !/^```\s*$/.test(t[a] ?? ""); )
843
- i.push(t[a] ?? ""), a += 1;
844
- a += 1, n.push(`<pre><code>${re(i.join(`
1137
+ for (a += 1; a < n.length && !/^```\s*$/.test(n[a] ?? ""); )
1138
+ i.push(n[a] ?? ""), a += 1;
1139
+ a += 1, t.push(`<pre><code>${ue(i.join(`
845
1140
  `))}</code></pre>`);
846
1141
  continue;
847
1142
  }
848
- const s = /^(#{1,4})\s+(.*)$/.exec(r);
849
- if (s) {
850
- const i = Math.min(s[1].length + 1, 5);
851
- n.push(`<h${i}>${ne(s[2] ?? "")}</h${i}>`), a += 1;
1143
+ const l = /^(#{1,4})\s+(.*)$/.exec(u);
1144
+ if (l) {
1145
+ const i = Math.min(l[1].length + 1, 5);
1146
+ t.push(`<h${i}>${oe(l[2] ?? "")}</h${i}>`), a += 1;
852
1147
  continue;
853
1148
  }
854
- if (K(r)) {
855
- const i = /^\s*\d+[.)]\s+/.test(r), c = [];
856
- for (; a < t.length && K(t[a] ?? ""); )
857
- for (c.push((t[a] ?? "").replace(/^\s*(?:[-*+]|\d+[.)])\s+/, "")), a += 1; a < t.length; ) {
858
- const l = t[a] ?? "";
859
- if (l.trim() === "" || K(l) || /^(#{1,4})\s/.test(l) || /^```/.test(l))
1149
+ if (J(u)) {
1150
+ const i = /^\s*\d+[.)]\s+/.test(u), m = [];
1151
+ for (; a < n.length && J(n[a] ?? ""); )
1152
+ for (m.push((n[a] ?? "").replace(/^\s*(?:[-*+]|\d+[.)])\s+/, "")), a += 1; a < n.length; ) {
1153
+ const f = n[a] ?? "";
1154
+ if (f.trim() === "" || J(f) || /^(#{1,4})\s/.test(f) || /^```/.test(f))
860
1155
  break;
861
- c[c.length - 1] += ` ${l.trim()}`, a += 1;
1156
+ m[m.length - 1] += ` ${f.trim()}`, a += 1;
862
1157
  }
863
- const m = i ? "ol" : "ul";
864
- n.push(`<${m}>${c.map((l) => `<li>${ne(l)}</li>`).join("")}</${m}>`);
1158
+ const h = i ? "ol" : "ul";
1159
+ t.push(`<${h}>${m.map((f) => `<li>${oe(f)}</li>`).join("")}</${h}>`);
865
1160
  continue;
866
1161
  }
867
- const u = [];
868
- for (; a < t.length; ) {
869
- const i = t[a] ?? "";
870
- if (i.trim() === "" || K(i) || /^(#{1,4})\s/.test(i) || /^```/.test(i)) break;
871
- u.push(i.trim()), a += 1;
1162
+ const s = [];
1163
+ for (; a < n.length; ) {
1164
+ const i = n[a] ?? "";
1165
+ if (i.trim() === "" || J(i) || /^(#{1,4})\s/.test(i) || /^```/.test(i)) break;
1166
+ s.push(i.trim()), a += 1;
872
1167
  }
873
- n.push(`<p>${ne(u.join(" "))}</p>`);
1168
+ t.push(`<p>${oe(s.join(" "))}</p>`);
874
1169
  }
875
- return n.join("");
1170
+ return t.join("");
876
1171
  }
877
- const F = "\0";
878
- function K(e) {
1172
+ const G = "\0";
1173
+ function J(e) {
879
1174
  return /^\s*(?:[-*+]|\d+[.)])\s+/.test(e);
880
1175
  }
881
- function ne(e) {
882
- const t = [], n = e.replace(/`([^`]+)`/g, (r, o) => (t.push(`<code>${re(o)}</code>`), `${F}${t.length - 1}${F}`));
883
- return re(n).replace(
1176
+ function oe(e) {
1177
+ const n = [], t = e.replace(/`([^`]+)`/g, (u, o) => (n.push(`<code>${ue(o)}</code>`), `${G}${n.length - 1}${G}`));
1178
+ return ue(t).replace(
884
1179
  /\[([^\]]+)\]\((https?:\/\/[^\s)]+)\)/g,
885
1180
  '<a href="$2" target="_blank" rel="noopener">$1</a>'
886
1181
  ).replace(/\*\*([^*]+)\*\*/g, "<strong>$1</strong>").replace(
887
- new RegExp(`${F}(\\d+)${F}`, "g"),
888
- (r, o) => t[Number(o)] ?? ""
1182
+ new RegExp(`${G}(\\d+)${G}`, "g"),
1183
+ (u, o) => n[Number(o)] ?? ""
889
1184
  );
890
1185
  }
891
- function re(e) {
1186
+ function ue(e) {
892
1187
  return e.replace(/&/g, "&amp;").replace(/</g, "&lt;").replace(/>/g, "&gt;").replace(/"/g, "&quot;");
893
1188
  }
894
- function Ut(e) {
895
- const t = e.scope("webx-admin"), n = /* @__PURE__ */ new Map();
896
- function a(o, s, u) {
897
- const i = e.state.locale, c = `${i}:${o}`;
898
- let m = n.get(c);
899
- return m === void 0 && (m = new Intl.DateTimeFormat(i, s), n.set(c, m)), m.format(u);
1189
+ function Qt(e) {
1190
+ const n = e.scope("webx-admin"), t = /* @__PURE__ */ new Map();
1191
+ function a(o, l, s) {
1192
+ const i = e.state.locale, m = `${i}:${o}`;
1193
+ let h = t.get(m);
1194
+ return h === void 0 && (h = new Intl.DateTimeFormat(i, l), t.set(m, h)), h.format(s);
900
1195
  }
901
- const r = (o) => a("time", { hour: "2-digit", minute: "2-digit", hourCycle: "h23" }, o);
1196
+ const u = (o) => a("time", { hour: "2-digit", minute: "2-digit", hourCycle: "h23" }, o);
902
1197
  return {
903
1198
  short(o) {
904
- const s = ae(o);
905
- if (s === null)
906
- return t("dates.never");
907
- const u = /* @__PURE__ */ new Date(), i = Nt(s, u);
908
- return i === 0 ? t("dates.today", { time: r(s) }) : i === -1 ? t("dates.yesterday", { time: r(s) }) : s.getFullYear() === u.getFullYear() ? a(
1199
+ const l = Z(o);
1200
+ if (l === null)
1201
+ return n("dates.never");
1202
+ const s = /* @__PURE__ */ new Date(), i = ve(l, s);
1203
+ return i === 0 ? n("dates.today", { time: u(l) }) : i === -1 ? n("dates.yesterday", { time: u(l) }) : l.getFullYear() === s.getFullYear() ? a(
909
1204
  "this-year",
910
1205
  {
911
1206
  day: "numeric",
@@ -914,76 +1209,83 @@ function Ut(e) {
914
1209
  minute: "2-digit",
915
1210
  hourCycle: "h23"
916
1211
  },
917
- s
918
- ) : a("earlier", { day: "numeric", month: "long", year: "numeric" }, s);
1212
+ l
1213
+ ) : a("earlier", { day: "numeric", month: "long", year: "numeric" }, l);
1214
+ },
1215
+ compact(o) {
1216
+ const l = Z(o);
1217
+ if (l === null)
1218
+ return n("dates.never");
1219
+ const s = /* @__PURE__ */ new Date();
1220
+ return ve(l, s) === 0 ? u(l) : l.getFullYear() === s.getFullYear() ? a("compact", { day: "numeric", month: "short" }, l) : a("compact-earlier", { dateStyle: "short" }, l);
919
1221
  },
920
1222
  exact(o) {
921
- const s = ae(o);
922
- return s === null ? "" : a("exact", { dateStyle: "long", timeStyle: "medium", hourCycle: "h23" }, s);
1223
+ const l = Z(o);
1224
+ return l === null ? "" : a("exact", { dateStyle: "long", timeStyle: "medium", hourCycle: "h23" }, l);
923
1225
  },
924
1226
  iso(o) {
925
- const s = ae(o);
926
- return s === null ? "" : s.toISOString();
1227
+ const l = Z(o);
1228
+ return l === null ? "" : l.toISOString();
927
1229
  }
928
1230
  };
929
1231
  }
930
- function Rt() {
931
- const e = G(Q, null);
932
- return Ut(e ?? Mt());
1232
+ function Zt() {
1233
+ const e = ee(ne, null);
1234
+ return Qt(e ?? en());
933
1235
  }
934
- let q = null;
935
- function Mt() {
936
- return q === null && (q = de(), q.defaults("webx-admin", xe)), q;
1236
+ let Q = null;
1237
+ function en() {
1238
+ return Q === null && (Q = de(), Q.defaults("webx-admin", _e)), Q;
937
1239
  }
938
- function ae(e) {
1240
+ function Z(e) {
939
1241
  if (e == null || e === "")
940
1242
  return null;
941
- const t = e instanceof Date ? e : new Date(e);
942
- return Number.isNaN(t.getTime()) ? null : t;
1243
+ const n = e instanceof Date ? e : new Date(e);
1244
+ return Number.isNaN(n.getTime()) ? null : n;
943
1245
  }
944
- function Nt(e, t) {
945
- const n = (a) => Date.UTC(a.getFullYear(), a.getMonth(), a.getDate());
946
- return Math.round((n(e) - n(t)) / 864e5);
1246
+ function ve(e, n) {
1247
+ const t = (a) => Date.UTC(a.getFullYear(), a.getMonth(), a.getDate());
1248
+ return Math.round((t(e) - t(n)) / 864e5);
947
1249
  }
948
- function Pt(e, t, n) {
949
- const a = e instanceof ie ? e.status : Dt(e);
1250
+ function tn(e, n, t) {
1251
+ const a = e instanceof re ? e.status : an(e);
950
1252
  if (a === 422)
951
- return It(e) ?? n ?? t("errors.unknown");
952
- if (a === 401) return t("errors.signed-out");
953
- if (a === 403) return t("errors.forbidden");
954
- if (a === 404) return t("errors.gone");
955
- if (a === 409) return t("errors.conflict");
1253
+ return ln(e) ?? t ?? n("errors.unknown");
1254
+ if (a === 401) return n("errors.signed-out");
1255
+ if (a === 403) return n("errors.forbidden");
1256
+ if (a === 404) return n("errors.gone");
1257
+ if (a === 409) return n("errors.conflict");
956
1258
  if (a === 429) {
957
- const r = e instanceof ie ? e.retryAfter : null;
958
- return r === null ? t("errors.throttled") : t("errors.throttled-in", { seconds: r });
1259
+ const u = e instanceof re ? e.retryAfter : null;
1260
+ return u === null ? n("errors.throttled") : n("errors.throttled-in", { seconds: u });
959
1261
  }
960
- return a !== null && a >= 500 ? t("errors.server") : a === null ? t("errors.offline") : n ?? t("errors.unknown");
1262
+ return a !== null && a >= 500 ? n("errors.server") : a === null ? n("errors.offline") : t ?? n("errors.unknown");
961
1263
  }
962
- function Vt() {
963
- const e = N("webx-admin");
964
- return (t, n) => Pt(t, e, n);
1264
+ function nn() {
1265
+ const e = I("webx-admin");
1266
+ return (n, t) => tn(n, e, t);
965
1267
  }
966
- function Dt(e) {
967
- const t = e?.status;
968
- return typeof t == "number" ? t : null;
1268
+ function an(e) {
1269
+ const n = e?.status;
1270
+ return typeof n == "number" ? n : null;
969
1271
  }
970
- function It(e) {
971
- const n = e?.body?.message;
972
- return typeof n == "string" && n !== "" ? n : null;
1272
+ function ln(e) {
1273
+ const t = e?.body?.message;
1274
+ return typeof t == "string" && t !== "" ? t : null;
973
1275
  }
974
- function Bt(e, t, n) {
975
- const a = `${e.apiPath}/entities/${t}/${n}/notes`, r = (s) => `${e.apiPath}/notes/${s}`, o = (s) => s.data;
1276
+ function on(e, n, t) {
1277
+ const a = `${e.apiPath}/entities/${n}/${t}/notes`, u = (l) => `${e.apiPath}/notes/${l}`, o = (l) => l.data;
976
1278
  return {
977
1279
  list: () => e.http.get(a).then(o),
978
- add: (s) => e.http.post(a, { body: s }).then(o),
979
- save: (s, u) => e.http.put(r(s), { body: u }).then(o),
980
- remove: (s) => e.http.delete(r(s)).then(() => {
1280
+ add: (l) => e.http.post(a, { body: l }).then(o),
1281
+ save: (l, s) => e.http.put(u(l), { body: s }).then(o),
1282
+ remove: (l) => e.http.delete(u(l)).then(() => {
981
1283
  })
982
1284
  };
983
1285
  }
984
- const jt = { class: "wx-screen-host" }, mn = /* @__PURE__ */ U({
1286
+ const sn = { class: "wx-screen-host" }, Cn = /* @__PURE__ */ U({
985
1287
  __name: "Screen",
986
- props: /* @__PURE__ */ se({
1288
+ props: /* @__PURE__ */ ie({
987
1289
  name: {},
988
1290
  errors: { default: void 0 },
989
1291
  disabled: { type: Boolean, default: !1 },
@@ -994,39 +1296,39 @@ const jt = { class: "wx-screen-host" }, mn = /* @__PURE__ */ U({
994
1296
  modelValue: { default: () => ({}) },
995
1297
  modelModifiers: {}
996
1298
  }),
997
- emits: /* @__PURE__ */ se(["loaded"], ["update:modelValue"]),
998
- setup(e, { expose: t, emit: n }) {
999
- const a = e, r = n, o = he(e, "modelValue"), s = H(), u = N("webx-admin"), i = A(null), c = A(null);
1000
- async function m() {
1001
- i.value = null, c.value = null;
1299
+ emits: /* @__PURE__ */ ie(["loaded"], ["update:modelValue"]),
1300
+ setup(e, { expose: n, emit: t }) {
1301
+ const a = e, u = t, o = ge(e, "modelValue"), l = H(), s = I("webx-admin"), i = E(null), m = E(null);
1302
+ async function h() {
1303
+ i.value = null, m.value = null;
1002
1304
  try {
1003
- const l = await s.loadScreen(a.name);
1004
- i.value = l, r("loaded", l);
1005
- } catch (l) {
1006
- c.value = l instanceof Error ? l.message : String(l);
1305
+ const f = await l.loadScreen(a.name);
1306
+ i.value = f, u("loaded", f);
1307
+ } catch (f) {
1308
+ m.value = f instanceof Error ? f.message : String(f);
1007
1309
  }
1008
1310
  }
1009
- return J([() => a.name, () => s.i18n.state.locale], () => {
1010
- m();
1011
- }, { immediate: !0 }), t({ reload: m }), (l, v) => (f(), x("div", jt, [
1012
- c.value ? (f(), b(d(je), {
1311
+ return te([() => a.name, () => l.i18n.state.locale], () => {
1312
+ h();
1313
+ }, { immediate: !0 }), n({ reload: h }), (f, d) => (v(), k("div", sn, [
1314
+ m.value ? (v(), y(r(et), {
1013
1315
  key: 0,
1014
1316
  type: "danger",
1015
- title: d(u)("shell.error-title"),
1016
- description: c.value
1017
- }, null, 8, ["title", "description"])) : i.value === null ? (f(), b(d(ge), {
1317
+ title: r(s)("shell.error-title"),
1318
+ description: m.value
1319
+ }, null, 8, ["title", "description"])) : i.value === null ? (v(), y(r(ye), {
1018
1320
  key: 1,
1019
1321
  rows: 4
1020
- })) : (f(), b(d(Qe), {
1322
+ })) : (v(), y(r(ut), {
1021
1323
  key: 2,
1022
1324
  modelValue: o.value,
1023
- "onUpdate:modelValue": v[0] || (v[0] = (h) => o.value = h),
1325
+ "onUpdate:modelValue": d[0] || (d[0] = (p) => o.value = p),
1024
1326
  root: i.value,
1025
- patch: d(s).screenPatch(e.name),
1026
- types: d(s).types,
1327
+ patch: r(l).screenPatch(e.name),
1328
+ types: r(l).types,
1027
1329
  errors: e.errors,
1028
- translate: d(s).i18n.t,
1029
- can: d(s).can,
1330
+ translate: r(l).i18n.t,
1331
+ can: r(l).can,
1030
1332
  disabled: e.disabled,
1031
1333
  "label-position": e.labelPosition,
1032
1334
  "label-width": e.labelWidth,
@@ -1034,77 +1336,27 @@ const jt = { class: "wx-screen-host" }, mn = /* @__PURE__ */ U({
1034
1336
  }, null, 8, ["modelValue", "root", "patch", "types", "errors", "translate", "can", "disabled", "label-position", "label-width", "size"]))
1035
1337
  ]));
1036
1338
  }
1037
- }), Ht = {
1038
- key: 0,
1039
- class: "wx-dropdown__divider"
1040
- }, Ot = /* @__PURE__ */ U({
1041
- __name: "RowMenu",
1339
+ }), Ln = 76, zn = /* @__PURE__ */ U({
1340
+ __name: "FilterChips",
1042
1341
  props: {
1043
- actions: {},
1044
- label: { default: void 0 },
1045
- size: { default: "sm" }
1342
+ filters: {}
1046
1343
  },
1047
1344
  setup(e) {
1048
- const t = e, n = S(() => [
1049
- ...t.actions.filter((r) => !r.danger),
1050
- ...t.actions.filter((r) => r.danger)
1051
- ]), a = S(() => {
1052
- const r = n.value.find((o) => o.danger);
1053
- return r && n.value[0] !== r ? r.key : null;
1054
- });
1055
- return (r, o) => n.value.length > 0 ? (f(), b(d(He), {
1056
- key: 0,
1057
- class: "wx-row-menu",
1058
- collapse: "always",
1059
- align: "end",
1060
- size: e.size,
1061
- "aria-label": e.label,
1062
- onClick: o[0] || (o[0] = pe(() => {
1063
- }, ["stop"]))
1345
+ return (n, t) => (v(!0), k(B, null, N(e.filters, (a) => (v(), y(r(tt), {
1346
+ key: a.key,
1347
+ class: "wx-filter-chip",
1348
+ size: "sm",
1349
+ round: "",
1350
+ closable: "",
1351
+ onClose: (u) => a.clear()
1064
1352
  }, {
1065
- collapsed: g(() => [
1066
- (f(!0), x(R, null, j(n.value, (s) => (f(), x(R, {
1067
- key: s.key
1068
- }, [
1069
- s.key === a.value ? (f(), x("hr", Ht)) : W("", !0),
1070
- y(d(Oe), {
1071
- icon: s.icon,
1072
- tone: s.danger ? "danger" : "default",
1073
- href: s.href,
1074
- target: s.href ? s.target ?? "_blank" : void 0,
1075
- disabled: s.disabled,
1076
- onClick: (u) => s.run?.()
1077
- }, {
1078
- default: g(() => [
1079
- C(E(s.label), 1)
1080
- ]),
1081
- _: 2
1082
- }, 1032, ["icon", "tone", "href", "target", "disabled", "onClick"])
1083
- ], 64))), 128))
1353
+ default: b(() => [
1354
+ z(C(a.label), 1)
1084
1355
  ]),
1085
- _: 1
1086
- }, 8, ["size", "aria-label"])) : W("", !0);
1087
- }
1088
- }), Ft = /* @__PURE__ */ B(Ot, [["__scopeId", "data-v-4a08eb39"]]), fn = /* @__PURE__ */ U({
1089
- __name: "BackButton",
1090
- props: {
1091
- to: {},
1092
- label: { default: void 0 },
1093
- size: { default: "sm" }
1094
- },
1095
- setup(e) {
1096
- const t = e, n = N("webx-admin"), a = S(() => t.label ?? n("editor.back"));
1097
- return (r, o) => (f(), b(d(ue), {
1098
- icon: "arrow-left",
1099
- class: "wx-back-button",
1100
- as: d(Ue),
1101
- to: e.to,
1102
- title: a.value,
1103
- size: e.size,
1104
- "tooltip-side": "bottom"
1105
- }, null, 8, ["as", "to", "title", "size"]));
1356
+ _: 2
1357
+ }, 1032, ["onClose"]))), 128));
1106
1358
  }
1107
- }), Kt = { class: "wx-rename__footer" }, qt = /* @__PURE__ */ U({
1359
+ }), rn = { class: "wx-rename__footer" }, un = /* @__PURE__ */ U({
1108
1360
  __name: "RenameButton",
1109
1361
  props: {
1110
1362
  name: { default: "" },
@@ -1114,58 +1366,58 @@ const jt = { class: "wx-screen-host" }, mn = /* @__PURE__ */ U({
1114
1366
  size: { default: "sm" }
1115
1367
  },
1116
1368
  emits: ["rename"],
1117
- setup(e, { emit: t }) {
1118
- const n = e, a = t, r = N("webx-admin"), o = A(!1), s = A(n.name), u = A(null), i = S(() => n.label ?? r("editor.rename"));
1119
- J(o, async (m) => {
1120
- m && (s.value = n.name, await Ee(), u.value?.focus(), u.value?.select());
1369
+ setup(e, { emit: n }) {
1370
+ const t = e, a = n, u = I("webx-admin"), o = E(!1), l = E(t.name), s = E(null), i = x(() => t.label ?? u("editor.rename"));
1371
+ te(o, async (h) => {
1372
+ h && (l.value = t.name, await Ue(), s.value?.focus(), s.value?.select());
1121
1373
  });
1122
- function c() {
1123
- const m = s.value.trim();
1124
- if (m === "" || m === n.name) {
1374
+ function m() {
1375
+ const h = l.value.trim();
1376
+ if (h === "" || h === t.name) {
1125
1377
  o.value = !1;
1126
1378
  return;
1127
1379
  }
1128
- a("rename", m), o.value = !1;
1380
+ a("rename", h), o.value = !1;
1129
1381
  }
1130
- return (m, l) => (f(), b(d(Fe), {
1382
+ return (h, f) => (v(), y(r(nt), {
1131
1383
  open: o.value,
1132
- "onUpdate:open": l[2] || (l[2] = (v) => o.value = v),
1384
+ "onUpdate:open": f[2] || (f[2] = (d) => o.value = d),
1133
1385
  title: i.value,
1134
1386
  width: 320,
1135
1387
  side: "bottom",
1136
1388
  align: "start",
1137
1389
  teleport: ""
1138
1390
  }, {
1139
- trigger: g(() => [
1140
- y(d(ue), {
1391
+ trigger: b(() => [
1392
+ _(r(Y), {
1141
1393
  type: "edit",
1142
1394
  title: i.value,
1143
1395
  size: e.size,
1144
1396
  disabled: e.disabled
1145
1397
  }, null, 8, ["title", "size", "disabled"])
1146
1398
  ]),
1147
- default: g(() => [
1399
+ default: b(() => [
1148
1400
  M("form", {
1149
1401
  class: "wx-rename",
1150
- onSubmit: pe(c, ["prevent"])
1402
+ onSubmit: pe(m, ["prevent"])
1151
1403
  }, [
1152
- y(d(Ke), {
1404
+ _(r(at), {
1153
1405
  ref_key: "field",
1154
- ref: u,
1155
- modelValue: s.value,
1156
- "onUpdate:modelValue": l[0] || (l[0] = (v) => s.value = v),
1406
+ ref: s,
1407
+ modelValue: l.value,
1408
+ "onUpdate:modelValue": f[0] || (f[0] = (d) => l.value = d),
1157
1409
  "aria-label": i.value,
1158
1410
  placeholder: e.placeholder,
1159
- onKeydown: l[1] || (l[1] = Ae((v) => o.value = !1, ["esc"]))
1411
+ onKeydown: f[1] || (f[1] = Be((d) => o.value = !1, ["esc"]))
1160
1412
  }, null, 8, ["modelValue", "aria-label", "placeholder"]),
1161
- M("div", Kt, [
1162
- y(d(X), {
1413
+ M("div", rn, [
1414
+ _(r(O), {
1163
1415
  type: "primary",
1164
1416
  size: "sm",
1165
1417
  "native-type": "submit"
1166
1418
  }, {
1167
- default: g(() => [
1168
- C(E(d(r)("editor.save")), 1)
1419
+ default: b(() => [
1420
+ z(C(r(u)("editor.save")), 1)
1169
1421
  ]),
1170
1422
  _: 1
1171
1423
  })
@@ -1175,7 +1427,7 @@ const jt = { class: "wx-screen-host" }, mn = /* @__PURE__ */ U({
1175
1427
  _: 1
1176
1428
  }, 8, ["open", "title"]));
1177
1429
  }
1178
- }), vn = /* @__PURE__ */ B(qt, [["__scopeId", "data-v-d879e8d3"]]), Xt = ["innerHTML"], Yt = /* @__PURE__ */ U({
1430
+ }), Wn = /* @__PURE__ */ P(un, [["__scopeId", "data-v-d879e8d3"]]), dn = ["innerHTML"], cn = /* @__PURE__ */ U({
1179
1431
  __name: "HelpButton",
1180
1432
  props: {
1181
1433
  body: {},
@@ -1185,81 +1437,82 @@ const jt = { class: "wx-screen-host" }, mn = /* @__PURE__ */ U({
1185
1437
  width: { default: 720 }
1186
1438
  },
1187
1439
  setup(e) {
1188
- const t = e, n = N("webx-admin"), a = A(!1), r = S(() => t.title ?? n("help.title")), o = S(() => Wt(t.body));
1189
- return (s, u) => (f(), x(R, null, [
1190
- y(d(ue), {
1440
+ const n = e, t = I("webx-admin"), a = E(!1), u = x(() => n.title ?? t("help.title")), o = x(() => Jt(n.body));
1441
+ return (l, s) => (v(), k(B, null, [
1442
+ _(r(Y), {
1191
1443
  type: "details",
1192
1444
  icon: "question",
1193
1445
  tone: "neutral",
1194
1446
  size: e.size,
1195
- title: e.label ?? r.value,
1196
- onClick: u[0] || (u[0] = (i) => a.value = !0)
1447
+ title: e.label ?? u.value,
1448
+ onClick: s[0] || (s[0] = (i) => a.value = !0)
1197
1449
  }, null, 8, ["size", "title"]),
1198
- y(d(qe), {
1450
+ _(r(lt), {
1199
1451
  open: a.value,
1200
- "onUpdate:open": u[1] || (u[1] = (i) => a.value = i),
1201
- title: r.value,
1452
+ "onUpdate:open": s[1] || (s[1] = (i) => a.value = i),
1453
+ title: u.value,
1202
1454
  width: e.width
1203
1455
  }, {
1204
- default: g(() => [
1456
+ default: b(() => [
1205
1457
  M("div", {
1206
1458
  class: "wx-help",
1207
1459
  innerHTML: o.value
1208
- }, null, 8, Xt)
1460
+ }, null, 8, dn)
1209
1461
  ]),
1210
1462
  _: 1
1211
1463
  }, 8, ["open", "title", "width"])
1212
1464
  ], 64));
1213
1465
  }
1214
- }), hn = /* @__PURE__ */ B(Yt, [["__scopeId", "data-v-6c280d42"]]), Gt = /* @__PURE__ */ U({
1466
+ }), An = /* @__PURE__ */ P(cn, [["__scopeId", "data-v-6c280d42"]]), mn = /* @__PURE__ */ U({
1215
1467
  name: "WxDate",
1216
1468
  __name: "DateText",
1217
1469
  props: {
1218
1470
  value: {},
1471
+ compact: { type: Boolean, default: !1 },
1219
1472
  size: { default: "sm" },
1220
1473
  tone: { default: "muted" }
1221
1474
  },
1222
1475
  setup(e) {
1223
- const t = e, n = Rt(), a = S(() => n.short(t.value)), r = S(() => n.exact(t.value)), o = S(() => n.iso(t.value));
1224
- return (s, u) => r.value ? (f(), b(d(Xe), {
1476
+ const n = e, t = Zt(), a = x(() => n.compact ? t.compact(n.value) : t.short(n.value)), u = x(() => t.exact(n.value)), o = x(() => t.iso(n.value));
1477
+ return (l, s) => u.value ? (v(), y(r(ot), {
1225
1478
  key: 0,
1226
- content: r.value
1479
+ content: u.value
1227
1480
  }, {
1228
- default: g(() => [
1229
- y(d(Y), {
1481
+ default: b(() => [
1482
+ _(r(q), {
1230
1483
  as: "time",
1231
1484
  datetime: o.value,
1232
1485
  size: e.size,
1233
1486
  tone: e.tone
1234
1487
  }, {
1235
- default: g(() => [
1236
- C(E(a.value), 1)
1488
+ default: b(() => [
1489
+ z(C(a.value), 1)
1237
1490
  ]),
1238
1491
  _: 1
1239
1492
  }, 8, ["datetime", "size", "tone"])
1240
1493
  ]),
1241
1494
  _: 1
1242
- }, 8, ["content"])) : (f(), b(d(Y), {
1495
+ }, 8, ["content"])) : (v(), y(r(q), {
1243
1496
  key: 1,
1244
1497
  size: e.size,
1245
1498
  tone: e.tone
1246
1499
  }, {
1247
- default: g(() => [
1248
- C(E(a.value), 1)
1500
+ default: b(() => [
1501
+ z(C(a.value), 1)
1249
1502
  ]),
1250
1503
  _: 1
1251
1504
  }, 8, ["size", "tone"]));
1252
1505
  }
1253
- }), Jt = { class: "wx-notes" }, Qt = {
1506
+ }), fn = { class: "wx-notes" }, hn = {
1254
1507
  key: 3,
1255
1508
  class: "wx-notes__list"
1256
- }, Zt = { class: "wx-note__body" }, en = { class: "wx-note__head" }, tn = { class: "wx-note__buttons" }, nn = {
1509
+ }, vn = { class: "wx-note__body" }, pn = { class: "wx-note__head" }, bn = { class: "wx-note__buttons" }, gn = {
1257
1510
  key: 1,
1258
1511
  class: "wx-note__text"
1259
- }, an = {
1512
+ }, wn = {
1260
1513
  key: 4,
1261
1514
  class: "wx-notes__new"
1262
- }, ln = /* @__PURE__ */ U({
1515
+ }, yn = /* @__PURE__ */ U({
1263
1516
  name: "WxNotes",
1264
1517
  __name: "NotesFeed",
1265
1518
  props: {
@@ -1269,53 +1522,53 @@ const jt = { class: "wx-screen-host" }, mn = /* @__PURE__ */ U({
1269
1522
  title: { default: void 0 }
1270
1523
  },
1271
1524
  emits: ["change"],
1272
- setup(e, { emit: t }) {
1273
- const n = e, a = t, r = H(), o = N("webx-admin"), s = Vt(), u = A([]), i = A(!0), c = A(""), m = A(!1), l = A(null), v = A(""), h = S(() => Bt(r, n.type, n.id)), w = S(() => n.title ?? o("notes.title"));
1274
- async function p() {
1525
+ setup(e, { emit: n }) {
1526
+ const t = e, a = n, u = H(), o = I("webx-admin"), l = nn(), s = E([]), i = E(!0), m = E(""), h = E(!1), f = E(null), d = E(""), p = x(() => on(u, t.type, t.id)), g = x(() => t.title ?? o("notes.title"));
1527
+ async function c() {
1275
1528
  i.value = !0;
1276
1529
  try {
1277
- u.value = await h.value.list();
1278
- } catch (k) {
1279
- I.danger(s(k));
1530
+ s.value = await p.value.list();
1531
+ } catch (T) {
1532
+ F.danger(l(T));
1280
1533
  } finally {
1281
1534
  i.value = !1;
1282
1535
  }
1283
1536
  }
1284
- J(
1285
- () => [n.type, n.id],
1537
+ te(
1538
+ () => [t.type, t.id],
1286
1539
  () => {
1287
- l.value = null, c.value = "", p();
1540
+ f.value = null, m.value = "", c();
1288
1541
  },
1289
1542
  { immediate: !0 }
1290
1543
  );
1291
- async function _() {
1292
- const k = c.value.trim();
1293
- if (!(k === "" || m.value)) {
1294
- m.value = !0;
1544
+ async function w() {
1545
+ const T = m.value.trim();
1546
+ if (!(T === "" || h.value)) {
1547
+ h.value = !0;
1295
1548
  try {
1296
- u.value = [...u.value, await h.value.add(k)], c.value = "", a("change");
1297
- } catch (T) {
1298
- I.danger(s(T));
1549
+ s.value = [...s.value, await p.value.add(T)], m.value = "", a("change");
1550
+ } catch (A) {
1551
+ F.danger(l(A));
1299
1552
  } finally {
1300
- m.value = !1;
1553
+ h.value = !1;
1301
1554
  }
1302
1555
  }
1303
1556
  }
1304
- function V(k) {
1305
- l.value = k.id, v.value = k.body;
1557
+ function $(T) {
1558
+ f.value = T.id, d.value = T.body;
1306
1559
  }
1307
- async function Z(k) {
1308
- const T = v.value.trim();
1309
- if (T !== "")
1560
+ async function K(T) {
1561
+ const A = d.value.trim();
1562
+ if (A !== "")
1310
1563
  try {
1311
- const $ = await h.value.save(k.id, T);
1312
- u.value = u.value.map((P) => P.id === $.id ? $ : P), l.value = null, I.success(o("notes.saved")), a("change");
1313
- } catch ($) {
1314
- I.danger(s($));
1564
+ const S = await p.value.save(T.id, A);
1565
+ s.value = s.value.map((D) => D.id === S.id ? S : D), f.value = null, F.success(o("notes.saved")), a("change");
1566
+ } catch (S) {
1567
+ F.danger(l(S));
1315
1568
  }
1316
1569
  }
1317
- async function ee(k) {
1318
- if (await Je({
1570
+ async function ae(T) {
1571
+ if (await rt({
1319
1572
  title: o("notes.delete-title"),
1320
1573
  message: o("notes.delete-text"),
1321
1574
  confirmText: o("notes.delete"),
@@ -1323,163 +1576,167 @@ const jt = { class: "wx-screen-host" }, mn = /* @__PURE__ */ U({
1323
1576
  tone: "danger"
1324
1577
  }))
1325
1578
  try {
1326
- await h.value.remove(k.id), u.value = u.value.filter(($) => $.id !== k.id), I.success(o("notes.deleted")), a("change");
1327
- } catch ($) {
1328
- I.danger(s($));
1579
+ await p.value.remove(T.id), s.value = s.value.filter((S) => S.id !== T.id), F.success(o("notes.deleted")), a("change");
1580
+ } catch (S) {
1581
+ F.danger(l(S));
1329
1582
  }
1330
1583
  }
1331
- function te(k) {
1332
- return !n.can || !k.is_mine ? [] : [
1333
- { key: "edit", icon: "edit", label: o("notes.edit"), run: () => V(k) },
1584
+ function le(T) {
1585
+ return !t.can || !T.is_mine ? [] : [
1586
+ { key: "edit", icon: "edit", label: o("notes.edit"), run: () => $(T) },
1334
1587
  {
1335
1588
  key: "delete",
1336
1589
  icon: "trash",
1337
1590
  label: o("notes.delete"),
1338
1591
  danger: !0,
1339
1592
  run: () => {
1340
- ee(k);
1593
+ ae(T);
1341
1594
  }
1342
1595
  }
1343
1596
  ];
1344
1597
  }
1345
- function D(k) {
1346
- return k.author?.name ?? o("notes.unknown-author");
1598
+ function V(T) {
1599
+ return T.author?.name ?? o("notes.unknown-author");
1347
1600
  }
1348
- return (k, T) => (f(), x("section", Jt, [
1349
- w.value ? (f(), b(d(Y), {
1601
+ return (T, A) => (v(), k("section", fn, [
1602
+ g.value ? (v(), y(r(q), {
1350
1603
  key: 0,
1351
1604
  weight: "medium",
1352
1605
  class: "wx-notes__title"
1353
1606
  }, {
1354
- default: g(() => [
1355
- C(E(w.value), 1)
1607
+ default: b(() => [
1608
+ z(C(g.value), 1)
1356
1609
  ]),
1357
1610
  _: 1
1358
1611
  })) : W("", !0),
1359
- i.value ? (f(), b(d(ge), {
1612
+ i.value ? (v(), y(r(ye), {
1360
1613
  key: 1,
1361
1614
  rows: 2
1362
- })) : u.value.length === 0 ? (f(), b(d(Ye), {
1615
+ })) : s.value.length === 0 ? (v(), y(r(st), {
1363
1616
  key: 2,
1364
1617
  size: "sm",
1365
- description: d(o)("notes.empty")
1366
- }, null, 8, ["description"])) : (f(), x("ul", Qt, [
1367
- (f(!0), x(R, null, j(u.value, ($) => (f(), x("li", {
1368
- key: $.id,
1618
+ description: r(o)("notes.empty")
1619
+ }, null, 8, ["description"])) : (v(), k("ul", hn, [
1620
+ (v(!0), k(B, null, N(s.value, (S) => (v(), k("li", {
1621
+ key: S.id,
1369
1622
  class: "wx-note"
1370
1623
  }, [
1371
- y(d(Ge), {
1372
- name: D($),
1624
+ _(r(it), {
1625
+ name: V(S),
1373
1626
  size: "sm",
1374
1627
  tone: "auto"
1375
1628
  }, null, 8, ["name"]),
1376
- M("div", Zt, [
1377
- M("div", en, [
1378
- y(d(Y), {
1629
+ M("div", vn, [
1630
+ M("div", pn, [
1631
+ _(r(q), {
1379
1632
  size: "sm",
1380
1633
  weight: "medium",
1381
1634
  truncate: ""
1382
1635
  }, {
1383
- default: g(() => [
1384
- C(E(D($)), 1)
1636
+ default: b(() => [
1637
+ z(C(V(S)), 1)
1385
1638
  ]),
1386
1639
  _: 2
1387
1640
  }, 1024),
1388
- y(Gt, {
1389
- value: $.created_at
1641
+ _(mn, {
1642
+ value: S.created_at
1390
1643
  }, null, 8, ["value"]),
1391
- y(Ft, {
1392
- actions: te($),
1393
- label: D($)
1644
+ _(xe, {
1645
+ actions: le(S),
1646
+ label: V(S)
1394
1647
  }, null, 8, ["actions", "label"])
1395
1648
  ]),
1396
- l.value === $.id ? (f(), x(R, { key: 0 }, [
1397
- y(d(fe), {
1398
- modelValue: v.value,
1399
- "onUpdate:modelValue": T[0] || (T[0] = (P) => v.value = P),
1649
+ f.value === S.id ? (v(), k(B, { key: 0 }, [
1650
+ _(r(fe), {
1651
+ modelValue: d.value,
1652
+ "onUpdate:modelValue": A[0] || (A[0] = (D) => d.value = D),
1400
1653
  autosize: { minRows: 2, maxRows: 10 }
1401
1654
  }, null, 8, ["modelValue"]),
1402
- M("div", tn, [
1403
- y(d(X), {
1655
+ M("div", bn, [
1656
+ _(r(O), {
1404
1657
  size: "sm",
1405
1658
  type: "primary",
1406
- onClick: (P) => Z($)
1659
+ onClick: (D) => K(S)
1407
1660
  }, {
1408
- default: g(() => [
1409
- C(E(d(o)("notes.save")), 1)
1661
+ default: b(() => [
1662
+ z(C(r(o)("notes.save")), 1)
1410
1663
  ]),
1411
1664
  _: 1
1412
1665
  }, 8, ["onClick"]),
1413
- y(d(X), {
1666
+ _(r(O), {
1414
1667
  size: "sm",
1415
1668
  variant: "text",
1416
- onClick: T[1] || (T[1] = (P) => l.value = null)
1669
+ onClick: A[1] || (A[1] = (D) => f.value = null)
1417
1670
  }, {
1418
- default: g(() => [
1419
- C(E(d(o)("notes.cancel")), 1)
1671
+ default: b(() => [
1672
+ z(C(r(o)("notes.cancel")), 1)
1420
1673
  ]),
1421
1674
  _: 1
1422
1675
  })
1423
1676
  ])
1424
- ], 64)) : (f(), x("p", nn, E($.body), 1))
1677
+ ], 64)) : (v(), k("p", gn, C(S.body), 1))
1425
1678
  ])
1426
1679
  ]))), 128))
1427
1680
  ])),
1428
- e.can ? (f(), x("div", an, [
1429
- y(d(fe), {
1430
- modelValue: c.value,
1431
- "onUpdate:modelValue": T[2] || (T[2] = ($) => c.value = $),
1432
- placeholder: d(o)("notes.placeholder"),
1681
+ e.can ? (v(), k("div", wn, [
1682
+ _(r(fe), {
1683
+ modelValue: m.value,
1684
+ "onUpdate:modelValue": A[2] || (A[2] = (S) => m.value = S),
1685
+ placeholder: r(o)("notes.placeholder"),
1433
1686
  autosize: { minRows: 2, maxRows: 8 }
1434
1687
  }, null, 8, ["modelValue", "placeholder"]),
1435
- y(d(X), {
1688
+ _(r(O), {
1436
1689
  size: "sm",
1437
1690
  type: "primary",
1438
- disabled: c.value.trim() === "",
1439
- loading: m.value,
1440
- onClick: _
1691
+ disabled: m.value.trim() === "",
1692
+ loading: h.value,
1693
+ onClick: w
1441
1694
  }, {
1442
- default: g(() => [
1443
- C(E(d(o)("notes.add")), 1)
1695
+ default: b(() => [
1696
+ z(C(r(o)("notes.add")), 1)
1444
1697
  ]),
1445
1698
  _: 1
1446
1699
  }, 8, ["disabled", "loading"])
1447
1700
  ])) : W("", !0)
1448
1701
  ]));
1449
1702
  }
1450
- }), pn = /* @__PURE__ */ B(ln, [["__scopeId", "data-v-71004c1a"]]);
1703
+ }), Rn = /* @__PURE__ */ P(yn, [["__scopeId", "data-v-71004c1a"]]);
1451
1704
  export {
1452
- dt as AdminLanding,
1453
- ct as AdminNav,
1454
- bt as AdminShell,
1455
- ie as HttpError,
1456
- fn as WxBackButton,
1457
- Gt as WxDate,
1458
- hn as WxHelpButton,
1459
- at as WxListScreen,
1460
- pn as WxNotes,
1461
- vn as WxRenameButton,
1462
- Ft as WxRowMenu,
1463
- mn as WxScreen,
1464
- ye as adminKey,
1465
- xe as adminMessages,
1466
- lt as adminTypes,
1467
- cn as createAdmin,
1468
- st as createAdminContext,
1469
- Ut as createDates,
1470
- kt as createHttp,
1705
+ zt as AdminLanding,
1706
+ Wt as AdminNav,
1707
+ Pt as AdminShell,
1708
+ re as HttpError,
1709
+ mt as WxBackButton,
1710
+ mn as WxDate,
1711
+ zn as WxFilterChips,
1712
+ An as WxHelpButton,
1713
+ _t as WxListScreen,
1714
+ Rn as WxNotes,
1715
+ Wn as WxRenameButton,
1716
+ $t as WxRichTextField,
1717
+ xe as WxRowMenu,
1718
+ Cn as WxScreen,
1719
+ yt as WxScreenHead,
1720
+ ke as adminKey,
1721
+ _e as adminMessages,
1722
+ Tt as adminTypes,
1723
+ Sn as createAdmin,
1724
+ St as createAdminContext,
1725
+ Qt as createDates,
1726
+ Ft as createHttp,
1471
1727
  de as createI18n,
1472
- Bt as createNotesApi,
1473
- Pt as errorText,
1474
- Q as i18nKey,
1475
- ot as provideAdmin,
1476
- rt as provideI18n,
1477
- ve as readCookie,
1478
- Wt as renderMarkdown,
1728
+ on as createNotesApi,
1729
+ tn as errorText,
1730
+ ne as i18nKey,
1731
+ Ct as provideAdmin,
1732
+ dt as provideI18n,
1733
+ he as readCookie,
1734
+ Jt as renderMarkdown,
1735
+ Ln as rowMenuWidth,
1479
1736
  H as useAdmin,
1480
- Rt as useDates,
1481
- Vt as useErrorText,
1482
- dn as useI18n,
1483
- N as useTranslate
1737
+ Zt as useDates,
1738
+ nn as useErrorText,
1739
+ Tn as useI18n,
1740
+ I as useTranslate
1484
1741
  };
1485
1742
  //# sourceMappingURL=index.js.map