@webx-ui/module-admin 0.16.1 → 0.18.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,90 +1,90 @@
1
- import { inject as ne, reactive as pe, defineComponent as R, useModel as de, ref as W, watch as ee, computed as x, openBlock as p, createElementBlock as T, createVNode as b, unref as n, withCtx as g, createElementVNode as O, toDisplayString as L, createBlock as $, createTextVNode as V, createCommentVNode as U, mergeModels as oe, onMounted as Le, Fragment as H, renderList as Q, mergeProps as Ke, withModifiers as qe, useSlots as gt, useTemplateRef as Ye, normalizeClass as ae, renderSlot as F, createSlots as Ae, provide as Xe, normalizeProps as yt, guardReactiveProps as bt, resolveComponent as j, watchEffect as wt, onUnmounted as xt, isRef as Ge, createApp as kt, h as re, nextTick as Je, withKeys as Qe, onBeforeUnmount as Ze } from "vue";
2
- import { RouterLink as _t, useRouter as ge, useRoute as et, createRouter as $t, createWebHistory as Tt, onBeforeRouteLeave as St } from "vue-router";
3
- import { WxSortableList as tt, WxAction as se, WxBadge as ze, WxSelect as at, WxSegmented as Ct, WxAutocomplete as Be, WxText as G, WxInput as ye, WxCheckbox as Ie, WxActions as Wt, WxDropdownItem as Lt, useElementWidth as At, WxHeading as zt, WxButton as Z, WxIcon as Ve, WxTabs as Vt, WxCard as Se, WxRichText as Et, useLocales as nt, WxAlert as be, WxResult as Ut, useResponsiveShell as Rt, shellLayoutFor as Nt, WxToaster as Bt, WebxUI as It, dateLocaleKey as Pt, localesKey as Dt, useModal as Mt, WxDialog as lt, WxFormItem as Ft, WxSpace as Ot, createModal as Ht, WxSkeleton as ue, WxEmpty as ot, WxTooltip as st, toast as D, confirm as he, localizedValue as jt, WxBreadcrumb as Kt, WxBreadcrumbItem as Pe, WxActionBar as qt, WxPopover as Yt, WxAvatar as Xt, WxTextarea as De } from "@webx-ui/core";
4
- import { watchSystemTheme as Gt, applyTheme as Jt, systemTheme as Qt } from "@webx-ui/tokens";
5
- import { WxScreenRenderer as Zt } from "@webx-ui/schema";
6
- const we = /* @__PURE__ */ Symbol("webx-i18n");
7
- function ea() {
8
- const e = ne(we, null);
1
+ import { inject as se, reactive as be, defineComponent as M, useModel as re, ref as L, watch as te, computed as g, openBlock as m, createElementBlock as $, createVNode as w, unref as a, withCtx as y, createElementVNode as B, toDisplayString as A, createBlock as S, createTextVNode as z, createCommentVNode as N, mergeModels as ne, provide as ze, normalizeClass as oe, createSlots as ke, nextTick as Ie, useId as Tt, Fragment as j, onMounted as Ee, renderList as ae, mergeProps as et, withModifiers as tt, useSlots as St, useTemplateRef as lt, renderSlot as Y, normalizeProps as Ct, guardReactiveProps as Wt, resolveComponent as X, watchEffect as At, onUnmounted as Vt, isRef as at, createApp as Lt, h as ce, withKeys as nt, onBeforeUnmount as ot } from "vue";
2
+ import { RouterLink as Nt, useRouter as _e, useRoute as st, createRouter as Rt, createWebHistory as Ut, onBeforeRouteLeave as zt } from "vue-router";
3
+ import { WxSortableList as Be, WxAction as ue, WxBadge as $e, WxSelect as we, WxAutocomplete as Ne, WxSwitch as Ae, WxInputNumber as It, WxButton as le, WxSegmented as Et, WxText as ee, WxInput as Te, WxCheckbox as He, WxActions as Bt, WxDropdownItem as Mt, useElementWidth as Pt, WxHeading as Ft, WxIcon as Me, WxTabs as Dt, WxCard as Re, WxRichText as Ot, useLocales as it, WxAlert as Se, WxResult as Ht, useResponsiveShell as jt, shellLayoutFor as Kt, WxToaster as qt, WebxUI as Yt, dateLocaleKey as Xt, localesKey as Gt, useModal as Jt, WxDialog as rt, WxFormItem as Qt, WxSpace as Zt, createModal as el, WxSkeleton as me, WxEmpty as ut, WxTooltip as dt, toast as K, confirm as xe, localizedValue as tl, WxBreadcrumb as ll, WxBreadcrumbItem as je, WxActionBar as al, WxPopover as nl, WxAvatar as ol, WxTextarea as Ke } from "@webx-ui/core";
4
+ import { watchSystemTheme as sl, applyTheme as il, systemTheme as rl } from "@webx-ui/tokens";
5
+ import { WxScreenRenderer as ul } from "@webx-ui/schema";
6
+ const Ce = /* @__PURE__ */ Symbol("webx-i18n");
7
+ function dl() {
8
+ const e = se(Ce, null);
9
9
  if (e === null)
10
10
  throw new Error("useI18n() was called outside a panel created by createAdmin().");
11
11
  return e;
12
12
  }
13
- function P(e) {
14
- const t = ne(we, null);
15
- return t === null ? Ee().scope(e) : t.scope(e);
13
+ function D(e) {
14
+ const t = se(Ce, null);
15
+ return t === null ? Pe().scope(e) : t.scope(e);
16
16
  }
17
- function ta(e, t) {
18
- e.provide(we, t);
17
+ function cl(e, t) {
18
+ e.provide(Ce, t);
19
19
  }
20
- function Ee(e = {}) {
21
- const t = e.fallback ?? "en", a = pe({
20
+ function Pe(e = {}) {
21
+ const t = e.fallback ?? "en", l = be({
22
22
  locale: e.locale ?? t,
23
23
  fallback: t,
24
24
  panelLocales: [],
25
25
  contentLocales: []
26
- }), l = {}, i = pe({ value: {} });
27
- function s(r, u, c) {
28
- let h = r[u]?.[c[0] ?? ""];
29
- for (const m of c.slice(1)) {
26
+ }), n = {}, o = be({ value: {} });
27
+ function i(r, u, d) {
28
+ let h = r[u]?.[d[0] ?? ""];
29
+ for (const f of d.slice(1)) {
30
30
  if (typeof h != "object" || h === null)
31
31
  return null;
32
- h = h[m];
32
+ h = h[f];
33
33
  }
34
34
  return typeof h == "string" ? h : null;
35
35
  }
36
- function o(r, u, c) {
37
- const [h, m] = u.includes("::") ? u.split("::", 2) : [r, u], v = m.split("."), d = s(i.value, h, v) ?? s(l, h, v) ?? // Not an empty string: a key on screen is ugly, but it says which key, and a blank
36
+ function s(r, u, d) {
37
+ const [h, f] = u.includes("::") ? u.split("::", 2) : [r, u], v = f.split("."), c = i(o.value, h, v) ?? i(n, h, v) ?? // Not an empty string: a key on screen is ugly, but it says which key, and a blank
38
38
  // label says nothing to anybody trying to fix it.
39
39
  u;
40
- return c === void 0 ? d : aa(d, c);
40
+ return d === void 0 ? c : ml(c, d);
41
41
  }
42
42
  return {
43
- state: a,
43
+ state: l,
44
44
  defaults(r, u) {
45
- l[r] = { ...l[r], ...u };
45
+ n[r] = { ...n[r], ...u };
46
46
  },
47
- load(r, u, c) {
48
- i.value = r ?? {}, a.locale = u ?? a.locale, c !== void 0 && (a.fallback = c);
47
+ load(r, u, d) {
48
+ o.value = r ?? {}, l.locale = u ?? l.locale, d !== void 0 && (l.fallback = d);
49
49
  },
50
50
  scope(r) {
51
- return (u, c) => o(r, u, c);
51
+ return (u, d) => s(r, u, d);
52
52
  },
53
- t: (r, u) => o("", r, u)
53
+ t: (r, u) => s("", r, u)
54
54
  };
55
55
  }
56
- function aa(e, t) {
57
- let a = e;
58
- for (const [l, i] of Object.entries(t))
59
- a = a.replaceAll(`:${l}`, String(i));
60
- return a;
56
+ function ml(e, t) {
57
+ let l = e;
58
+ for (const [n, o] of Object.entries(t))
59
+ l = l.replaceAll(`:${n}`, String(o));
60
+ return l;
61
61
  }
62
- function xe(e, t) {
63
- const a = `${e.apiPath}/${t.replace(/^\/+|\/+$/g, "")}`, l = (i) => i.data;
62
+ function ve(e, t) {
63
+ const l = `${e.apiPath}/${t.replace(/^\/+|\/+$/g, "")}`, n = (o) => o.data;
64
64
  return {
65
- list: (i = {}) => {
66
- const s = new URLSearchParams();
67
- return i.q && s.set("q", i.q), i.visible && s.set("visible", "1"), e.http.get(s.size > 0 ? `${a}?${s}` : a);
65
+ list: (o = {}) => {
66
+ const i = new URLSearchParams();
67
+ return o.q && i.set("q", o.q), o.visible && i.set("visible", "1"), e.http.get(i.size > 0 ? `${l}?${i}` : l);
68
68
  },
69
- create: (i) => e.http.post(a, i).then(l),
70
- get: (i) => e.http.get(`${a}/${i}`).then(l),
71
- save: (i, s) => e.http.put(`${a}/${i}`, { values: s }).then(l),
72
- remove: (i) => e.http.delete(`${a}/${i}`).then(() => {
69
+ create: (o) => e.http.post(l, o).then(n),
70
+ get: (o) => e.http.get(`${l}/${o}`).then(n),
71
+ save: (o, i) => e.http.put(`${l}/${o}`, { values: i }).then(n),
72
+ remove: (o) => e.http.delete(`${l}/${o}`).then(() => {
73
73
  }),
74
- restore: (i) => e.http.post(`${a}/${i}/restore`, {}).then(l),
75
- reorder: (i) => e.http.post(`${a}/reorder`, { ids: i }).then(() => {
74
+ restore: (o) => e.http.post(`${l}/${o}/restore`, {}).then(n),
75
+ reorder: (o) => e.http.post(`${l}/reorder`, { ids: o }).then(() => {
76
76
  })
77
77
  };
78
78
  }
79
- function na(e, t, a, l = null) {
80
- const i = `${e.apiPath}/${t.replace(/^\/+|\/+$/g, "")}`;
81
- return e.http.post(`${i}/reorder`, l === null ? { ids: a } : { ids: a, category: l }).then(() => {
79
+ function fl(e, t, l, n = null) {
80
+ const o = `${e.apiPath}/${t.replace(/^\/+|\/+$/g, "")}`;
81
+ return e.http.post(`${o}/reorder`, n === null ? { ids: l } : { ids: l, category: n }).then(() => {
82
82
  });
83
83
  }
84
- const la = { class: "wx-categories-field" }, oa = { class: "wx-categories-field__name" }, sa = /* @__PURE__ */ R({
84
+ const vl = { class: "wx-categories-field" }, pl = { class: "wx-categories-field__name" }, hl = /* @__PURE__ */ M({
85
85
  name: "WxCategoriesField",
86
86
  __name: "CategoriesField",
87
- props: /* @__PURE__ */ oe({
87
+ props: /* @__PURE__ */ ne({
88
88
  source: {},
89
89
  main: { type: Boolean, default: !0 },
90
90
  disabled: { type: Boolean, default: !1 },
@@ -99,87 +99,603 @@ const la = { class: "wx-categories-field" }, oa = { class: "wx-categories-field_
99
99
  }),
100
100
  emits: ["update:modelValue"],
101
101
  setup(e) {
102
- const t = e, a = de(e, "modelValue"), l = X(), i = P("webx-admin"), s = W([]);
103
- ee(
102
+ const t = e, l = re(e, "modelValue"), n = J(), o = D("webx-admin"), i = L([]);
103
+ te(
104
104
  () => t.source,
105
105
  async (v) => {
106
106
  try {
107
- const d = await xe(l, v).list();
108
- s.value = d.data.map((w) => ({ id: w.id, name: w.name }));
107
+ const c = await ve(n, v).list();
108
+ i.value = c.data.map((x) => ({ id: x.id, name: x.name }));
109
109
  } catch {
110
- s.value = [];
110
+ i.value = [];
111
111
  }
112
112
  },
113
113
  { immediate: !0 }
114
114
  );
115
- const o = x(() => Array.isArray(a.value) ? a.value : []), r = x(() => new Map(s.value.map((v) => [v.id, v.name]))), u = x({
116
- get: () => o.value.map((v) => ({ id: v, name: r.value.get(v) ?? `#${v}` })),
115
+ const s = g(() => Array.isArray(l.value) ? l.value : []), r = g(() => new Map(i.value.map((v) => [v.id, v.name]))), u = g({
116
+ get: () => s.value.map((v) => ({ id: v, name: r.value.get(v) ?? `#${v}` })),
117
117
  set: (v) => {
118
- a.value = v.map((d) => d.id);
118
+ l.value = v.map((c) => c.id);
119
119
  }
120
- }), c = x(
121
- () => s.value.filter((v) => !o.value.includes(v.id)).map((v) => ({ label: v.name, value: v.id }))
120
+ }), d = g(
121
+ () => i.value.filter((v) => !s.value.includes(v.id)).map((v) => ({ label: v.name, value: v.id }))
122
122
  );
123
123
  function h(v) {
124
- typeof v != "number" || o.value.includes(v) || (a.value = [...o.value, v]);
124
+ typeof v != "number" || s.value.includes(v) || (l.value = [...s.value, v]);
125
125
  }
126
- function m(v) {
127
- a.value = o.value.filter((d) => d !== v);
126
+ function f(v) {
127
+ l.value = s.value.filter((c) => c !== v);
128
128
  }
129
- return (v, d) => (p(), T("div", la, [
130
- b(n(tt), {
129
+ return (v, c) => (m(), $("div", vl, [
130
+ w(a(Be), {
131
131
  modelValue: u.value,
132
- "onUpdate:modelValue": d[0] || (d[0] = (w) => u.value = w),
132
+ "onUpdate:modelValue": c[0] || (c[0] = (x) => u.value = x),
133
133
  plain: "",
134
134
  size: "sm",
135
135
  "item-key": "id",
136
136
  "item-label": "name",
137
137
  disabled: t.disabled,
138
- "empty-text": t.emptyText ?? n(i)("categories.field-empty")
138
+ "empty-text": t.emptyText ?? a(o)("categories.field-empty")
139
139
  }, {
140
- default: g(({ item: w, index: f }) => [
141
- O("span", oa, L(w.name), 1),
142
- t.main && f === 0 ? (p(), $(n(ze), {
140
+ default: y(({ item: x, index: p }) => [
141
+ B("span", pl, A(x.name), 1),
142
+ t.main && p === 0 ? (m(), S(a($e), {
143
143
  key: 0,
144
144
  type: "primary"
145
145
  }, {
146
- default: g(() => [
147
- V(L(t.mainText ?? n(i)("categories.field-main")), 1)
146
+ default: y(() => [
147
+ z(A(t.mainText ?? a(o)("categories.field-main")), 1)
148
148
  ]),
149
149
  _: 1
150
- })) : U("", !0)
150
+ })) : N("", !0)
151
151
  ]),
152
- actions: g(({ item: w }) => [
153
- b(n(se), {
152
+ actions: y(({ item: x }) => [
153
+ w(a(ue), {
154
154
  type: "remove",
155
155
  size: "sm",
156
156
  disabled: t.disabled,
157
- title: t.removeText ?? n(i)("categories.field-remove"),
158
- onClick: (f) => m(w.id)
157
+ title: t.removeText ?? a(o)("categories.field-remove"),
158
+ onClick: (p) => f(x.id)
159
159
  }, null, 8, ["disabled", "title", "onClick"])
160
160
  ]),
161
161
  _: 1
162
162
  }, 8, ["modelValue", "disabled", "empty-text"]),
163
- b(n(at), {
163
+ w(a(we), {
164
164
  "model-value": null,
165
- options: c.value,
166
- placeholder: t.addText ?? n(i)("categories.field-add"),
167
- disabled: t.disabled || c.value.length === 0,
168
- "empty-text": t.noneLeftText ?? n(i)("categories.field-none-left"),
165
+ options: d.value,
166
+ placeholder: t.addText ?? a(o)("categories.field-add"),
167
+ disabled: t.disabled || d.value.length === 0,
168
+ "empty-text": t.noneLeftText ?? a(o)("categories.field-none-left"),
169
169
  filterable: "",
170
170
  teleport: "",
171
- "aria-label": t.addText ?? n(i)("categories.field-add"),
171
+ "aria-label": t.addText ?? a(o)("categories.field-add"),
172
172
  "onUpdate:modelValue": h
173
173
  }, null, 8, ["options", "placeholder", "disabled", "empty-text", "aria-label"])
174
174
  ]));
175
175
  }
176
- }), Y = (e, t) => {
177
- const a = e.__vccOpts || e;
178
- for (const [l, i] of t)
179
- a[l] = i;
180
- return a;
181
- }, ia = /* @__PURE__ */ Y(sa, [["__scopeId", "data-v-640cd836"]]);
182
- function ra() {
176
+ }), G = (e, t) => {
177
+ const l = e.__vccOpts || e;
178
+ for (const [n, o] of t)
179
+ l[n] = o;
180
+ return l;
181
+ }, gl = /* @__PURE__ */ G(hl, [["__scopeId", "data-v-640cd836"]]);
182
+ class fe extends Error {
183
+ constructor(t, l, n = {}, o = null, i = null) {
184
+ super(t), this.status = l, this.errors = n, this.retryAfter = o, this.body = i, this.name = "HttpError";
185
+ }
186
+ status;
187
+ errors;
188
+ retryAfter;
189
+ body;
190
+ /** A failed form rather than a failed request. */
191
+ get isValidation() {
192
+ return this.status === 422;
193
+ }
194
+ get isUnauthenticated() {
195
+ return this.status === 401;
196
+ }
197
+ get isThrottled() {
198
+ return this.status === 429;
199
+ }
200
+ }
201
+ const yl = /* @__PURE__ */ new Set(["POST", "PUT", "PATCH", "DELETE"]);
202
+ function bl(e = {}) {
203
+ const t = (e.baseUrl ?? "").replace(/\/$/, ""), l = e.csrfUrl ?? "/api/cms/auth/csrf-cookie", n = e.fetch ?? globalThis.fetch.bind(globalThis), o = e.onUnauthenticated, i = e.headers;
204
+ let s = !1;
205
+ async function r(d = !1) {
206
+ s && !d && qe("XSRF-TOKEN") !== null || (await n(l, { credentials: "same-origin" }), s = !0);
207
+ }
208
+ async function u(d, h, f, v = {}, c = !1) {
209
+ const x = yl.has(d);
210
+ x && await r();
211
+ const p = {
212
+ Accept: "application/json",
213
+ "X-Requested-With": "XMLHttpRequest",
214
+ // Standing headers first, so a caller can still override one for a single request.
215
+ ...i?.(),
216
+ ...v.headers
217
+ };
218
+ if (x) {
219
+ const T = qe("XSRF-TOKEN");
220
+ T !== null && (p["X-XSRF-TOKEN"] = T);
221
+ }
222
+ f !== void 0 && (p["Content-Type"] = "application/json");
223
+ const b = await n(xl(t, h, v.query), {
224
+ method: d,
225
+ credentials: "same-origin",
226
+ headers: p,
227
+ signal: v.signal,
228
+ body: f === void 0 ? void 0 : JSON.stringify(f)
229
+ });
230
+ if (b.status === 419 && x && !c)
231
+ return await r(!0), u(d, h, f, v, !0);
232
+ if (b.status === 401 && o?.(), !b.ok)
233
+ throw await wl(b);
234
+ if (b.status !== 204)
235
+ return await b.json();
236
+ }
237
+ return {
238
+ get: (d, h) => u("GET", d, void 0, h),
239
+ post: (d, h, f) => u("POST", d, h, f),
240
+ put: (d, h, f) => u("PUT", d, h, f),
241
+ patch: (d, h, f) => u("PATCH", d, h, f),
242
+ delete: (d, h) => u("DELETE", d, void 0, h)
243
+ };
244
+ }
245
+ async function wl(e) {
246
+ let t = null;
247
+ try {
248
+ t = await e.json();
249
+ } catch {
250
+ }
251
+ const l = t ?? {}, n = typeof l.message == "string" && l.message !== "" ? l.message : e.statusText || `Request failed with ${e.status}`, o = l.errors !== null && typeof l.errors == "object" ? l.errors : {}, i = e.headers.get("Retry-After"), s = i === null ? null : Number.parseInt(i, 10);
252
+ return new fe(
253
+ n,
254
+ e.status,
255
+ o,
256
+ Number.isFinite(s) ? s : null,
257
+ t
258
+ );
259
+ }
260
+ function xl(e, t, l) {
261
+ const o = /^https?:\/\//i.test(t) ? t : `${e}/${t.replace(/^\//, "")}`;
262
+ if (l === void 0)
263
+ return o;
264
+ const i = new URLSearchParams();
265
+ for (const [r, u] of Object.entries(l))
266
+ u != null && i.set(r, String(u));
267
+ const s = i.toString();
268
+ return s === "" ? o : `${o}${o.includes("?") ? "&" : "?"}${s}`;
269
+ }
270
+ function qe(e) {
271
+ if (typeof document > "u")
272
+ return null;
273
+ for (const t of document.cookie.split(";")) {
274
+ const [l, ...n] = t.trim().split("=");
275
+ if (l === e)
276
+ return decodeURIComponent(n.join("="));
277
+ }
278
+ return null;
279
+ }
280
+ function kl(e, t) {
281
+ const l = `${e.apiPath}/relations/${encodeURIComponent(t)}`;
282
+ return {
283
+ search: (n) => e.http.get(l, { query: { q: n } }).then((o) => o.data),
284
+ named: (n) => n.length === 0 ? Promise.resolve([]) : e.http.get(`${l}?${n.map((o) => `ids[]=${o}`).join("&")}`).then((o) => o.data)
285
+ };
286
+ }
287
+ function _l(e) {
288
+ return Array.isArray(e) ? [...new Set(e.map(Number).filter((t) => Number.isInteger(t) && t > 0))] : [];
289
+ }
290
+ const ct = /* @__PURE__ */ Symbol("wx-relation-owner");
291
+ function zn(e) {
292
+ ze(ct, e);
293
+ }
294
+ function $l() {
295
+ return se(ct, null);
296
+ }
297
+ const Tl = ["src"], Sl = { class: "wx-relations-field__text" }, Cl = { class: "wx-relations-field__title" }, Wl = {
298
+ key: 0,
299
+ class: "wx-relations-field__subtitle"
300
+ }, Al = {
301
+ key: 0,
302
+ class: "wx-relations-field__note"
303
+ }, Vl = {
304
+ key: 1,
305
+ class: "wx-relations-field__add"
306
+ }, Ll = /* @__PURE__ */ M({
307
+ name: "WxRelationsField",
308
+ __name: "RelationsField",
309
+ props: /* @__PURE__ */ ne({
310
+ target: {},
311
+ max: { default: null },
312
+ sortable: { type: Boolean, default: !0 },
313
+ disabled: { type: Boolean, default: !1 },
314
+ addText: { default: void 0 },
315
+ emptyText: { default: void 0 }
316
+ }, {
317
+ modelValue: { default: () => [] },
318
+ modelModifiers: {}
319
+ }),
320
+ emits: ["update:modelValue"],
321
+ setup(e) {
322
+ const t = e, l = re(e, "modelValue"), n = J(), o = $l(), i = D("webx-admin"), s = g(() => kl(n, t.target)), r = L(/* @__PURE__ */ new Map()), u = L(/* @__PURE__ */ new Set()), d = L(!1), h = L([]), f = L(!1), v = L(""), c = g(() => _l(l.value));
323
+ function x(R) {
324
+ const U = new Map(r.value);
325
+ for (const I of R) U.set(I.id, I);
326
+ r.value = U;
327
+ }
328
+ async function p(R) {
329
+ const U = R.filter((I) => !r.value.has(I) && !u.value.has(I));
330
+ if (!(U.length === 0 || d.value))
331
+ try {
332
+ const I = await s.value.named(U);
333
+ x(I);
334
+ const de = new Set(I.map((ie) => ie.id));
335
+ u.value = /* @__PURE__ */ new Set([...u.value, ...U.filter((ie) => !de.has(ie))]);
336
+ } catch (I) {
337
+ I instanceof fe && I.status === 403 && (d.value = !0);
338
+ }
339
+ }
340
+ te(
341
+ () => t.target,
342
+ () => {
343
+ r.value = /* @__PURE__ */ new Map(), u.value = /* @__PURE__ */ new Set(), d.value = !1, h.value = [], p(c.value);
344
+ }
345
+ ), te(c, (R) => {
346
+ p(R);
347
+ }, { immediate: !0 });
348
+ const b = g({
349
+ get: () => c.value.map((R) => {
350
+ const U = r.value.get(R) ?? null;
351
+ return { id: R, title: U?.title || `#${R}`, candidate: U };
352
+ }),
353
+ set: (R) => {
354
+ l.value = R.map((U) => U.id);
355
+ }
356
+ }), T = g(() => t.max !== null && c.value.length >= t.max), F = g(() => o !== null && o.type === t.target ? o.id.value : null), Q = g(
357
+ () => h.value.filter((R) => R.id !== F.value && !c.value.includes(R.id)).map((R) => ({
358
+ value: R.title,
359
+ description: [R.subtitle, R.visible ? null : i("relations.field-hidden")].filter((U) => typeof U == "string" && U !== "").join(" · "),
360
+ id: R.id
361
+ }))
362
+ );
363
+ async function H(R) {
364
+ f.value = !0;
365
+ try {
366
+ const U = await s.value.search(R);
367
+ h.value = U, x(U);
368
+ } catch (U) {
369
+ h.value = [], U instanceof fe && U.status === 403 && (d.value = !0);
370
+ } finally {
371
+ f.value = !1;
372
+ }
373
+ }
374
+ function V(R) {
375
+ const U = Number(R.id);
376
+ !Number.isInteger(U) || c.value.includes(U) || T.value || (l.value = [...c.value, U], Ie(() => {
377
+ v.value = "";
378
+ }));
379
+ }
380
+ function k(R) {
381
+ l.value = c.value.filter((U) => U !== R);
382
+ }
383
+ const C = g(() => t.disabled || d.value), _ = g(
384
+ () => T.value ? i("relations.field-full", { max: String(t.max) }) : t.addText ?? i("relations.field-add")
385
+ );
386
+ function q(R) {
387
+ return R.candidate === null ? u.value.has(R.id) ? i("relations.field-missing") : null : R.candidate.trashed === !0 ? i("relations.field-trashed") : R.candidate.visible ? null : i("relations.field-hidden");
388
+ }
389
+ return (R, U) => (m(), $("div", {
390
+ class: oe(["wx-relations-field", { "is-unordered": !t.sortable }])
391
+ }, [
392
+ w(a(Be), {
393
+ modelValue: b.value,
394
+ "onUpdate:modelValue": U[0] || (U[0] = (I) => b.value = I),
395
+ plain: "",
396
+ size: "sm",
397
+ "item-key": "id",
398
+ "item-label": "title",
399
+ disabled: C.value || !t.sortable,
400
+ "empty-text": t.emptyText ?? a(i)("relations.field-empty"),
401
+ "drag-label": a(i)("relations.field-drag")
402
+ }, ke({
403
+ default: y(({ item: I }) => [
404
+ I.candidate?.thumb ? (m(), $("img", {
405
+ key: 0,
406
+ class: "wx-relations-field__thumb",
407
+ src: I.candidate.thumb,
408
+ alt: ""
409
+ }, null, 8, Tl)) : N("", !0),
410
+ B("span", Sl, [
411
+ B("span", Cl, A(I.title), 1),
412
+ I.candidate?.subtitle ? (m(), $("span", Wl, A(I.candidate.subtitle), 1)) : N("", !0)
413
+ ]),
414
+ q(I) ? (m(), S(a($e), {
415
+ key: 1,
416
+ type: "warning"
417
+ }, {
418
+ default: y(() => [
419
+ z(A(q(I)), 1)
420
+ ]),
421
+ _: 2
422
+ }, 1024)) : N("", !0)
423
+ ]),
424
+ _: 2
425
+ }, [
426
+ C.value ? void 0 : {
427
+ name: "actions",
428
+ fn: y(({ item: I }) => [
429
+ w(a(ue), {
430
+ type: "remove",
431
+ size: "sm",
432
+ title: a(i)("relations.field-remove"),
433
+ onClick: (de) => k(I.id)
434
+ }, null, 8, ["title", "onClick"])
435
+ ]),
436
+ key: "0"
437
+ }
438
+ ]), 1032, ["modelValue", "disabled", "empty-text", "drag-label"]),
439
+ d.value ? (m(), $("p", Al, A(a(i)("relations.field-forbidden")), 1)) : (m(), $("div", Vl, [
440
+ w(a(Ne), {
441
+ modelValue: v.value,
442
+ "onUpdate:modelValue": U[1] || (U[1] = (I) => v.value = I),
443
+ options: Q.value,
444
+ remote: "",
445
+ teleport: "",
446
+ loading: f.value,
447
+ "loading-text": a(i)("relations.field-searching"),
448
+ "empty-text": a(i)("relations.field-nothing"),
449
+ placeholder: _.value,
450
+ "aria-label": _.value,
451
+ disabled: t.disabled || T.value,
452
+ onSearch: H,
453
+ onSelect: V
454
+ }, null, 8, ["modelValue", "options", "loading", "loading-text", "empty-text", "placeholder", "aria-label", "disabled"])
455
+ ]))
456
+ ], 2));
457
+ }
458
+ }), mt = /* @__PURE__ */ G(Ll, [["__scopeId", "data-v-5ecf0e47"]]), ft = 100, Ve = /* @__PURE__ */ new WeakMap();
459
+ function Nl(e) {
460
+ let t = Ve.get(e);
461
+ return t === void 0 && (t = e.http.get(`${e.apiPath}/collections`).then((l) => l.data.map((n) => ({ ...n, relations: Rl(n) }))), t.catch(() => Ve.delete(e)), Ve.set(e, t)), t;
462
+ }
463
+ function Rl(e) {
464
+ return Array.isArray(e.relations) ? e.relations.flatMap((t) => {
465
+ if (typeof t == "string") return t === "" ? [] : [{ key: t, title: t }];
466
+ if (typeof t == "object" && t !== null && typeof t.key == "string") {
467
+ const { key: l, title: n } = t;
468
+ return [{ key: l, title: typeof n == "string" && n !== "" ? n : l }];
469
+ }
470
+ return [];
471
+ }) : [];
472
+ }
473
+ function vt(e) {
474
+ return Array.isArray(e) ? [...new Set(e.map(Number).filter((t) => Number.isInteger(t) && t > 0))].sort(
475
+ (t, l) => t - l
476
+ ) : [];
477
+ }
478
+ function Ul(e) {
479
+ if (typeof e != "object" || e === null || Array.isArray(e)) return null;
480
+ const {
481
+ type: t,
482
+ ids: l,
483
+ current: n
484
+ } = e;
485
+ if (n === !0 && typeof t == "string" && t !== "")
486
+ return { type: t, ids: [], current: !0 };
487
+ const o = vt(l);
488
+ return typeof t == "string" && t !== "" && o.length > 0 ? { type: t, ids: o } : null;
489
+ }
490
+ function Ye(e) {
491
+ const t = typeof e == "object" && e !== null && !Array.isArray(e) ? e : {}, l = typeof t.limit == "number" && Number.isInteger(t.limit) ? t.limit : null;
492
+ return {
493
+ categories: vt(t.categories),
494
+ related: Ul(t.related),
495
+ limit: l !== null && l >= 1 ? Math.min(l, ft) : null,
496
+ filter: t.filter === !0,
497
+ markup: typeof t.markup == "boolean" ? t.markup : null
498
+ };
499
+ }
500
+ function Xe(e) {
501
+ return e.categories.length === 0 && e.related === null;
502
+ }
503
+ const zl = ["aria-busy"], Il = {
504
+ key: 0,
505
+ class: "wx-collection-field__note"
506
+ }, El = { class: "wx-collection-field__note" }, Bl = {
507
+ key: 0,
508
+ class: "wx-collection-field__row"
509
+ }, Ml = ["for"], Pl = {
510
+ key: 1,
511
+ class: "wx-collection-field__row"
512
+ }, Fl = { class: "wx-collection-field__label" }, Dl = { class: "wx-collection-field__hint" }, Ol = { class: "wx-collection-field__row" }, Hl = ["for"], jl = { class: "wx-collection-field__limit" }, Kl = {
513
+ key: 3,
514
+ class: "wx-collection-field__markup"
515
+ }, ql = { class: "wx-collection-field__hint" }, Yl = /* @__PURE__ */ M({
516
+ name: "WxCollectionField",
517
+ __name: "CollectionField",
518
+ props: /* @__PURE__ */ ne({
519
+ source: {},
520
+ disabled: { type: Boolean, default: !1 }
521
+ }, {
522
+ modelValue: { default: null },
523
+ modelModifiers: {}
524
+ }),
525
+ emits: ["update:modelValue"],
526
+ setup(e) {
527
+ const t = e, l = re(e, "modelValue"), n = J(), o = D("webx-admin"), i = Tt(), s = L(void 0), r = L([]);
528
+ te(
529
+ () => t.source,
530
+ async (k) => {
531
+ s.value = void 0, r.value = [];
532
+ try {
533
+ s.value = (await Nl(n)).find((C) => C.key === k) ?? null;
534
+ } catch {
535
+ s.value = null;
536
+ }
537
+ if (s.value?.categories)
538
+ try {
539
+ const C = await ve(n, s.value.categories).list();
540
+ r.value = C.data.map((_) => ({ label: _.name, value: _.id }));
541
+ } catch {
542
+ r.value = [];
543
+ }
544
+ },
545
+ { immediate: !0 }
546
+ );
547
+ const u = g(() => Ye(l.value));
548
+ function d(k) {
549
+ l.value = Ye({ ...u.value, ...k });
550
+ }
551
+ const h = g(() => {
552
+ const k = new Set(r.value.map((_) => _.value)), C = u.value.categories.filter((_) => !k.has(_)).map((_) => ({ label: `#${_}`, value: _ }));
553
+ return [...r.value, ...C];
554
+ });
555
+ function f(k) {
556
+ d({ categories: Array.isArray(k) ? k.map(Number) : [] });
557
+ }
558
+ function v(k) {
559
+ d({ limit: k ?? null });
560
+ }
561
+ const c = L(null), x = g(
562
+ () => (s.value?.relations ?? []).map((k) => ({ label: k.title, value: k.key }))
563
+ ), p = g(() => {
564
+ const k = s.value?.relations ?? [];
565
+ if (k.length === 1) return k[0];
566
+ const C = u.value.related?.type ?? c.value;
567
+ return k.find((_) => _.key === C) ?? null;
568
+ });
569
+ function b(k) {
570
+ c.value = typeof k == "string" ? k : null, d({ related: null });
571
+ }
572
+ function T(k) {
573
+ const C = p.value?.key;
574
+ d({ related: C && k && k.length > 0 ? { type: C, ids: k } : null });
575
+ }
576
+ function F(k) {
577
+ const C = p.value?.key;
578
+ d({ related: k && C ? { type: C, ids: [], current: !0 } : null });
579
+ }
580
+ const Q = g(() => u.value.markup ?? Xe(u.value));
581
+ function H(k) {
582
+ d({ markup: k === !0 });
583
+ }
584
+ const V = g(
585
+ () => o(
586
+ Xe(u.value) ? "collections.field-markup-auto-on" : "collections.field-markup-auto-off"
587
+ )
588
+ );
589
+ return (k, C) => (m(), $("div", {
590
+ class: "wx-collection-field",
591
+ "aria-busy": s.value === void 0
592
+ }, [
593
+ s.value === null ? (m(), $("p", Il, A(a(o)("collections.field-unavailable", { source: t.source })), 1)) : s.value ? (m(), $(j, { key: 1 }, [
594
+ B("p", El, A(a(o)("collections.field-source", { source: s.value.title })), 1),
595
+ s.value.categories ? (m(), $("div", Bl, [
596
+ B("label", {
597
+ class: "wx-collection-field__label",
598
+ for: `${a(i)}-categories`
599
+ }, A(a(o)("collections.field-categories")), 9, Ml),
600
+ w(a(we), {
601
+ id: `${a(i)}-categories`,
602
+ "model-value": u.value.categories,
603
+ options: h.value,
604
+ placeholder: u.value.categories.length === 0 ? a(o)("collections.field-all") : "",
605
+ "empty-text": a(o)("collections.field-no-categories"),
606
+ disabled: t.disabled,
607
+ multiple: "",
608
+ filterable: "",
609
+ clearable: "",
610
+ teleport: "",
611
+ "onUpdate:modelValue": f
612
+ }, null, 8, ["id", "model-value", "options", "placeholder", "empty-text", "disabled"])
613
+ ])) : N("", !0),
614
+ s.value.relations.length > 0 ? (m(), $("div", Pl, [
615
+ B("span", Fl, A(s.value.relations.length === 1 ? a(o)("relations.collection-related-to", { target: s.value.relations[0].title }) : a(o)("relations.collection-related")), 1),
616
+ s.value.relations.length > 1 ? (m(), S(a(we), {
617
+ key: 0,
618
+ "model-value": p.value?.key ?? null,
619
+ options: x.value,
620
+ placeholder: a(o)("relations.collection-related-type"),
621
+ "aria-label": a(o)("relations.collection-related-type"),
622
+ disabled: t.disabled,
623
+ clearable: "",
624
+ teleport: "",
625
+ "onUpdate:modelValue": b
626
+ }, null, 8, ["model-value", "options", "placeholder", "aria-label", "disabled"])) : N("", !0),
627
+ p.value ? (m(), $(j, { key: 1 }, [
628
+ w(a(Ae), {
629
+ "model-value": u.value.related?.current === !0,
630
+ label: a(o)("relations.collection-related-current"),
631
+ disabled: t.disabled,
632
+ "onUpdate:modelValue": C[0] || (C[0] = (_) => F(_ === !0))
633
+ }, null, 8, ["model-value", "label", "disabled"]),
634
+ B("p", Dl, A(a(o)("relations.collection-related-current-hint", { target: p.value.title })), 1)
635
+ ], 64)) : N("", !0),
636
+ p.value && u.value.related?.current !== !0 ? (m(), S(mt, {
637
+ key: 2,
638
+ "model-value": u.value.related?.ids ?? [],
639
+ target: p.value.key,
640
+ sortable: !1,
641
+ "empty-text": a(o)("relations.collection-related-any"),
642
+ disabled: t.disabled,
643
+ "onUpdate:modelValue": T
644
+ }, null, 8, ["model-value", "target", "empty-text", "disabled"])) : N("", !0)
645
+ ])) : N("", !0),
646
+ B("div", Ol, [
647
+ B("label", {
648
+ class: "wx-collection-field__label",
649
+ for: `${a(i)}-limit`
650
+ }, A(a(o)("collections.field-limit")), 9, Hl),
651
+ B("div", jl, [
652
+ w(a(It), {
653
+ id: `${a(i)}-limit`,
654
+ "model-value": u.value.limit,
655
+ min: 1,
656
+ max: a(ft),
657
+ step: 1,
658
+ precision: 0,
659
+ placeholder: a(o)("collections.field-limit-all"),
660
+ disabled: t.disabled,
661
+ "onUpdate:modelValue": v
662
+ }, null, 8, ["id", "model-value", "max", "placeholder", "disabled"])
663
+ ])
664
+ ]),
665
+ s.value.categories ? (m(), S(a(Ae), {
666
+ key: 2,
667
+ "model-value": u.value.filter,
668
+ label: a(o)("collections.field-filter"),
669
+ disabled: t.disabled,
670
+ "onUpdate:modelValue": C[1] || (C[1] = (_) => d({ filter: _ === !0 }))
671
+ }, null, 8, ["model-value", "label", "disabled"])) : N("", !0),
672
+ s.value.markup ? (m(), $("div", Kl, [
673
+ w(a(Ae), {
674
+ "model-value": Q.value,
675
+ label: a(o)("collections.field-markup"),
676
+ disabled: t.disabled,
677
+ "onUpdate:modelValue": H
678
+ }, null, 8, ["model-value", "label", "disabled"]),
679
+ B("p", ql, A(V.value), 1),
680
+ u.value.markup !== null ? (m(), S(a(le), {
681
+ key: 0,
682
+ class: "wx-collection-field__reset",
683
+ variant: "text",
684
+ size: "sm",
685
+ disabled: t.disabled,
686
+ onClick: C[2] || (C[2] = (_) => d({ markup: null }))
687
+ }, {
688
+ default: y(() => [
689
+ z(A(a(o)("collections.field-markup-reset")), 1)
690
+ ]),
691
+ _: 1
692
+ }, 8, ["disabled"])) : N("", !0)
693
+ ])) : N("", !0)
694
+ ], 64)) : N("", !0)
695
+ ], 8, zl));
696
+ }
697
+ }), Xl = /* @__PURE__ */ G(Yl, [["__scopeId", "data-v-023ad095"]]);
698
+ function Gl() {
183
699
  return {
184
700
  target: "entity",
185
701
  entity_type: null,
@@ -190,31 +706,31 @@ function ra() {
190
706
  rel: []
191
707
  };
192
708
  }
193
- function ua(e) {
194
- const t = `${e.apiPath}/links`, a = (l) => l.data;
709
+ function Jl(e) {
710
+ const t = `${e.apiPath}/links`, l = (n) => n.data;
195
711
  return {
196
- sources: () => e.http.get(`${t}/sources`).then(a),
197
- search: (l, i, s) => e.http.get(`${t}/search`, { query: { type: l, q: i, locale: s } }).then(a),
198
- resolve: (l, i) => e.http.post(`${t}/resolve`, { links: l, locale: i }).then(a),
199
- routes: () => e.http.get(`${t}/routes`).then(a)
712
+ sources: () => e.http.get(`${t}/sources`).then(l),
713
+ search: (n, o, i) => e.http.get(`${t}/search`, { query: { type: n, q: o, locale: i } }).then(l),
714
+ resolve: (n, o) => e.http.post(`${t}/resolve`, { links: n, locale: o }).then(l),
715
+ routes: () => e.http.get(`${t}/routes`).then(l)
200
716
  };
201
717
  }
202
- const da = { class: "wx-link-picker" }, ca = {
718
+ const Ql = { class: "wx-link-picker" }, Zl = {
203
719
  key: 0,
204
720
  class: "wx-link-picker__entity"
205
- }, ma = {
721
+ }, ea = {
206
722
  key: 1,
207
723
  class: "wx-link-picker__url"
208
- }, va = {
724
+ }, ta = {
209
725
  key: 2,
210
726
  class: "wx-link-picker__hash"
211
- }, fa = {
727
+ }, la = {
212
728
  key: 3,
213
729
  class: "wx-link-picker__attributes"
214
- }, pa = { class: "wx-link-picker__rel" }, ha = /* @__PURE__ */ R({
730
+ }, aa = { class: "wx-link-picker__rel" }, na = /* @__PURE__ */ M({
215
731
  name: "WxLinkPicker",
216
732
  __name: "LinkPicker",
217
- props: /* @__PURE__ */ oe({
733
+ props: /* @__PURE__ */ ne({
218
734
  allowNone: { type: Boolean, default: !0 },
219
735
  attributes: { type: Boolean, default: !0 },
220
736
  disabled: { type: Boolean, default: !1 }
@@ -224,207 +740,207 @@ const da = { class: "wx-link-picker" }, ca = {
224
740
  }),
225
741
  emits: ["update:modelValue"],
226
742
  setup(e) {
227
- const t = e, a = de(e, "modelValue"), l = X(), i = ea(), s = ua(l), o = P("webx-admin"), r = W([]), u = W([]), c = W([]), h = W(!1), m = W(null), v = W(""), d = W(null);
228
- let w = null;
229
- const f = x(() => a.value ?? ra()), y = x(() => {
230
- const _ = [
231
- { value: "entity", label: o("links.target-entity") },
232
- { value: "url", label: o("links.target-url") }
743
+ const t = e, l = re(e, "modelValue"), n = J(), o = dl(), i = Jl(n), s = D("webx-admin"), r = L([]), u = L([]), d = L([]), h = L(!1), f = L(null), v = L(""), c = L(null);
744
+ let x = null;
745
+ const p = g(() => l.value ?? Gl()), b = g(() => {
746
+ const W = [
747
+ { value: "entity", label: s("links.target-entity") },
748
+ { value: "url", label: s("links.target-url") }
233
749
  ];
234
- return t.allowNone ? [..._, { value: "none", label: o("links.target-none") }] : _;
235
- }), k = x(
236
- () => r.value.map((_) => ({ value: _.type, label: _.title }))
237
- ), M = x(
238
- () => u.value.map((_) => ({
239
- value: _.title,
240
- description: z(_),
241
- id: _.id
750
+ return t.allowNone ? [...W, { value: "none", label: s("links.target-none") }] : W;
751
+ }), T = g(
752
+ () => r.value.map((W) => ({ value: W.type, label: W.title }))
753
+ ), F = g(
754
+ () => u.value.map((W) => ({
755
+ value: W.title,
756
+ description: E(W),
757
+ id: W.id
242
758
  }))
243
- ), J = x(
244
- () => c.value.map((_) => ({ value: _.path, description: _.name }))
759
+ ), Q = g(
760
+ () => d.value.map((W) => ({ value: W.path, description: W.name }))
245
761
  );
246
- Le(async () => {
247
- r.value = await s.sources(), m.value = f.value.entity_type ?? r.value[0]?.type ?? null, await Promise.all([S(), B()]);
248
- }), ee(
249
- () => [f.value.entity_type, f.value.entity_id].join(":"),
762
+ Ee(async () => {
763
+ r.value = await i.sources(), f.value = p.value.entity_type ?? r.value[0]?.type ?? null, await Promise.all([H(), V()]);
764
+ }), te(
765
+ () => [p.value.entity_type, p.value.entity_id].join(":"),
250
766
  () => {
251
- S();
767
+ H();
252
768
  }
253
769
  );
254
- async function S() {
255
- const { entity_type: _, entity_id: N } = f.value;
256
- if (_ === null || N === null) {
257
- d.value = null, v.value = "";
770
+ async function H() {
771
+ const { entity_type: W, entity_id: P } = p.value;
772
+ if (W === null || P === null) {
773
+ c.value = null, v.value = "";
258
774
  return;
259
775
  }
260
- if (d.value?.id === N)
776
+ if (c.value?.id === P)
261
777
  return;
262
- const [I] = await s.resolve([{ type: _, id: N }], i.state.locale);
263
- d.value = I ?? null, v.value = I?.title ?? o("links.missing"), w = v.value;
778
+ const [O] = await i.resolve([{ type: W, id: P }], o.state.locale);
779
+ c.value = O ?? null, v.value = O?.title ?? s("links.missing"), x = v.value;
264
780
  }
265
- async function B() {
266
- c.value = await s.routes();
781
+ async function V() {
782
+ d.value = await i.routes();
267
783
  }
268
- async function C(_) {
269
- if (_ === w) {
270
- w = null;
784
+ async function k(W) {
785
+ if (W === x) {
786
+ x = null;
271
787
  return;
272
788
  }
273
- if (w = null, m.value !== null) {
789
+ if (x = null, f.value !== null) {
274
790
  h.value = !0;
275
791
  try {
276
- u.value = await s.search(m.value, _, i.state.locale);
792
+ u.value = await i.search(f.value, W, o.state.locale);
277
793
  } finally {
278
794
  h.value = !1;
279
795
  }
280
796
  }
281
797
  }
282
- function A(_) {
283
- _ !== void 0 && (a.value = { ...f.value, target: _ });
798
+ function C(W) {
799
+ W !== void 0 && (l.value = { ...p.value, target: W });
284
800
  }
285
- function E(_) {
286
- m.value = _ == null ? null : String(_), u.value = [], C("");
801
+ function _(W) {
802
+ f.value = W == null ? null : String(W), u.value = [], k("");
287
803
  }
288
- function K(_) {
289
- const N = u.value.find((I) => I.id === _.id);
290
- N === void 0 || m.value === null || (d.value = N, v.value = N.title, a.value = { ...f.value, entity_type: m.value, entity_id: N.id });
804
+ function q(W) {
805
+ const P = u.value.find((O) => O.id === W.id);
806
+ P === void 0 || f.value === null || (c.value = P, v.value = P.title, l.value = { ...p.value, entity_type: f.value, entity_id: P.id });
291
807
  }
292
- function le() {
293
- d.value = null, v.value = "", u.value = [], a.value = { ...f.value, entity_type: null, entity_id: null };
808
+ function R() {
809
+ c.value = null, v.value = "", u.value = [], l.value = { ...p.value, entity_type: null, entity_id: null };
294
810
  }
295
- function ie(_) {
296
- a.value = { ...f.value, url: _ === "" ? null : _ };
811
+ function U(W) {
812
+ l.value = { ...p.value, url: W === "" ? null : W };
297
813
  }
298
- function te(_) {
299
- const N = (typeof _ == "string" || typeof _ == "number" ? String(_) : "").replace(/^#+/, "").trim();
300
- a.value = { ...f.value, hash: N === "" ? null : N };
814
+ function I(W) {
815
+ const P = (typeof W == "string" || typeof W == "number" ? String(W) : "").replace(/^#+/, "").trim();
816
+ l.value = { ...p.value, hash: P === "" ? null : P };
301
817
  }
302
- function ke(_) {
303
- a.value = { ...f.value, new_tab: _ };
818
+ function de(W) {
819
+ l.value = { ...p.value, new_tab: W };
304
820
  }
305
- function _e(_, N) {
306
- const I = f.value.rel.filter(($e) => $e !== _);
307
- a.value = { ...f.value, rel: N ? [...I, _] : I };
821
+ function ie(W, P) {
822
+ const O = p.value.rel.filter((We) => We !== W);
823
+ l.value = { ...p.value, rel: P ? [...O, W] : O };
308
824
  }
309
- function z(_) {
310
- const N = [_.hint, _.url ?? void 0].filter(
311
- (I) => typeof I == "string" && I !== ""
825
+ function E(W) {
826
+ const P = [W.hint, W.url ?? void 0].filter(
827
+ (O) => typeof O == "string" && O !== ""
312
828
  );
313
- return _.available || N.push(o("links.unavailable")), N.join(" · ");
829
+ return W.available || P.push(s("links.unavailable")), P.join(" · ");
314
830
  }
315
- const q = ["nofollow", "sponsored", "ugc"];
316
- return (_, N) => (p(), T("div", da, [
317
- b(n(Ct), {
318
- options: y.value,
319
- "model-value": f.value.target,
831
+ const Z = ["nofollow", "sponsored", "ugc"];
832
+ return (W, P) => (m(), $("div", Ql, [
833
+ w(a(Et), {
834
+ options: b.value,
835
+ "model-value": p.value.target,
320
836
  disabled: t.disabled,
321
- "aria-label": n(o)("links.target-entity"),
322
- "onUpdate:modelValue": A
837
+ "aria-label": a(s)("links.target-entity"),
838
+ "onUpdate:modelValue": C
323
839
  }, null, 8, ["options", "model-value", "disabled", "aria-label"]),
324
- f.value.target === "entity" ? (p(), T("div", ca, [
325
- k.value.length > 1 ? (p(), $(n(at), {
840
+ p.value.target === "entity" ? (m(), $("div", Zl, [
841
+ T.value.length > 1 ? (m(), S(a(we), {
326
842
  key: 0,
327
843
  class: "wx-link-picker__section",
328
- options: k.value,
329
- "model-value": m.value,
844
+ options: T.value,
845
+ "model-value": f.value,
330
846
  disabled: t.disabled,
331
- "aria-label": n(o)("links.section"),
332
- "onUpdate:modelValue": E
333
- }, null, 8, ["options", "model-value", "disabled", "aria-label"])) : U("", !0),
334
- b(n(Be), {
847
+ "aria-label": a(s)("links.section"),
848
+ "onUpdate:modelValue": _
849
+ }, null, 8, ["options", "model-value", "disabled", "aria-label"])) : N("", !0),
850
+ w(a(Ne), {
335
851
  class: "wx-link-picker__search",
336
852
  "model-value": v.value,
337
- options: M.value,
853
+ options: F.value,
338
854
  remote: "",
339
855
  clearable: "",
340
856
  loading: h.value,
341
- "loading-text": n(o)("links.searching"),
342
- "empty-text": n(o)("links.empty"),
343
- placeholder: n(o)("links.search"),
344
- "aria-label": n(o)("links.search"),
857
+ "loading-text": a(s)("links.searching"),
858
+ "empty-text": a(s)("links.empty"),
859
+ placeholder: a(s)("links.search"),
860
+ "aria-label": a(s)("links.search"),
345
861
  disabled: t.disabled,
346
- "onUpdate:modelValue": N[0] || (N[0] = (I) => v.value = I),
347
- onSearch: C,
348
- onSelect: K,
349
- onClear: le
862
+ "onUpdate:modelValue": P[0] || (P[0] = (O) => v.value = O),
863
+ onSearch: k,
864
+ onSelect: q,
865
+ onClear: R
350
866
  }, null, 8, ["model-value", "options", "loading", "loading-text", "empty-text", "placeholder", "aria-label", "disabled"])
351
- ])) : f.value.target === "url" ? (p(), T("div", ma, [
352
- b(n(Be), {
353
- "model-value": f.value.url ?? "",
354
- options: J.value,
867
+ ])) : p.value.target === "url" ? (m(), $("div", ea, [
868
+ w(a(Ne), {
869
+ "model-value": p.value.url ?? "",
870
+ options: Q.value,
355
871
  clearable: "",
356
872
  "open-on-focus": "",
357
- "empty-text": n(o)("links.url-routes"),
358
- placeholder: n(o)("links.url-placeholder"),
359
- "aria-label": n(o)("links.url-label"),
873
+ "empty-text": a(s)("links.url-routes"),
874
+ placeholder: a(s)("links.url-placeholder"),
875
+ "aria-label": a(s)("links.url-label"),
360
876
  disabled: t.disabled,
361
- "onUpdate:modelValue": ie
877
+ "onUpdate:modelValue": U
362
878
  }, null, 8, ["model-value", "options", "empty-text", "placeholder", "aria-label", "disabled"])
363
- ])) : U("", !0),
364
- f.value.target !== "none" ? (p(), T("label", va, [
365
- b(n(G), {
879
+ ])) : N("", !0),
880
+ p.value.target !== "none" ? (m(), $("label", ta, [
881
+ w(a(ee), {
366
882
  size: "sm",
367
883
  tone: "muted"
368
884
  }, {
369
- default: g(() => [
370
- V(L(n(o)("links.hash")), 1)
885
+ default: y(() => [
886
+ z(A(a(s)("links.hash")), 1)
371
887
  ]),
372
888
  _: 1
373
889
  }),
374
- N[2] || (N[2] = O("span", {
890
+ P[2] || (P[2] = B("span", {
375
891
  class: "wx-link-picker__sign",
376
892
  "aria-hidden": "true"
377
893
  }, "#", -1)),
378
- b(n(ye), {
379
- "model-value": f.value.hash ?? "",
380
- placeholder: n(o)("links.hash-placeholder"),
381
- "aria-label": n(o)("links.hash"),
894
+ w(a(Te), {
895
+ "model-value": p.value.hash ?? "",
896
+ placeholder: a(s)("links.hash-placeholder"),
897
+ "aria-label": a(s)("links.hash"),
382
898
  disabled: t.disabled,
383
899
  clearable: "",
384
- "onUpdate:modelValue": te
900
+ "onUpdate:modelValue": I
385
901
  }, null, 8, ["model-value", "placeholder", "aria-label", "disabled"])
386
- ])) : U("", !0),
387
- t.attributes && f.value.target !== "none" ? (p(), T("div", fa, [
388
- b(n(Ie), {
389
- "model-value": f.value.new_tab,
902
+ ])) : N("", !0),
903
+ t.attributes && p.value.target !== "none" ? (m(), $("div", la, [
904
+ w(a(He), {
905
+ "model-value": p.value.new_tab,
390
906
  disabled: t.disabled,
391
- "onUpdate:modelValue": N[1] || (N[1] = (I) => ke(I))
907
+ "onUpdate:modelValue": P[1] || (P[1] = (O) => de(O))
392
908
  }, {
393
- default: g(() => [
394
- V(L(n(o)("links.new-tab")), 1)
909
+ default: y(() => [
910
+ z(A(a(s)("links.new-tab")), 1)
395
911
  ]),
396
912
  _: 1
397
913
  }, 8, ["model-value", "disabled"]),
398
- O("div", pa, [
399
- b(n(G), {
914
+ B("div", aa, [
915
+ w(a(ee), {
400
916
  size: "sm",
401
917
  tone: "muted"
402
918
  }, {
403
- default: g(() => [
404
- V(L(n(o)("links.rel")), 1)
919
+ default: y(() => [
920
+ z(A(a(s)("links.rel")), 1)
405
921
  ]),
406
922
  _: 1
407
923
  }),
408
- (p(), T(H, null, Q(q, (I) => b(n(Ie), {
409
- key: I,
410
- "model-value": f.value.rel.includes(I),
924
+ (m(), $(j, null, ae(Z, (O) => w(a(He), {
925
+ key: O,
926
+ "model-value": p.value.rel.includes(O),
411
927
  disabled: t.disabled,
412
- "onUpdate:modelValue": ($e) => _e(I, $e)
928
+ "onUpdate:modelValue": (We) => ie(O, We)
413
929
  }, {
414
- default: g(() => [
415
- V(L(n(o)(`links.rel-${I}`)), 1)
930
+ default: y(() => [
931
+ z(A(a(s)(`links.rel-${O}`)), 1)
416
932
  ]),
417
933
  _: 2
418
934
  }, 1032, ["model-value", "disabled", "onUpdate:modelValue"])), 64))
419
935
  ])
420
- ])) : U("", !0)
936
+ ])) : N("", !0)
421
937
  ]));
422
938
  }
423
- }), ga = /* @__PURE__ */ Y(ha, [["__scopeId", "data-v-e54022e5"]]), ya = /* @__PURE__ */ R({
939
+ }), oa = /* @__PURE__ */ G(na, [["__scopeId", "data-v-e54022e5"]]), sa = /* @__PURE__ */ M({
424
940
  name: "WxLinkField",
425
941
  inheritAttrs: !1,
426
942
  __name: "LinkField",
427
- props: /* @__PURE__ */ oe({
943
+ props: /* @__PURE__ */ ne({
428
944
  allowNone: { type: Boolean, default: !0 },
429
945
  attributes: { type: Boolean, default: !0 },
430
946
  disabled: { type: Boolean, default: !1 }
@@ -434,17 +950,17 @@ const da = { class: "wx-link-picker" }, ca = {
434
950
  }),
435
951
  emits: ["update:modelValue"],
436
952
  setup(e) {
437
- const t = e, a = de(e, "modelValue");
438
- return (l, i) => (p(), $(ga, Ke({
439
- modelValue: a.value,
440
- "onUpdate:modelValue": i[0] || (i[0] = (s) => a.value = s)
441
- }, l.$attrs, {
953
+ const t = e, l = re(e, "modelValue");
954
+ return (n, o) => (m(), S(oa, et({
955
+ modelValue: l.value,
956
+ "onUpdate:modelValue": o[0] || (o[0] = (i) => l.value = i)
957
+ }, n.$attrs, {
442
958
  "allow-none": t.allowNone,
443
959
  attributes: t.attributes,
444
960
  disabled: t.disabled
445
961
  }), null, 16, ["modelValue", "allow-none", "attributes", "disabled"]));
446
962
  }
447
- }), ba = /* @__PURE__ */ R({
963
+ }), ia = /* @__PURE__ */ M({
448
964
  __name: "BackButton",
449
965
  props: {
450
966
  to: {},
@@ -452,21 +968,21 @@ const da = { class: "wx-link-picker" }, ca = {
452
968
  size: { default: "sm" }
453
969
  },
454
970
  setup(e) {
455
- const t = e, a = P("webx-admin"), l = x(() => t.label ?? a("editor.back"));
456
- return (i, s) => (p(), $(n(se), {
971
+ const t = e, l = D("webx-admin"), n = g(() => t.label ?? l("editor.back"));
972
+ return (o, i) => (m(), S(a(ue), {
457
973
  icon: "arrow-left",
458
974
  class: "wx-back-button",
459
- as: n(_t),
975
+ as: a(Nt),
460
976
  to: e.to,
461
- title: l.value,
977
+ title: n.value,
462
978
  size: e.size,
463
979
  "tooltip-side": "bottom"
464
980
  }, null, 8, ["as", "to", "title", "size"]));
465
981
  }
466
- }), wa = {
982
+ }), ra = {
467
983
  key: 0,
468
984
  class: "wx-dropdown__divider"
469
- }, xa = /* @__PURE__ */ R({
985
+ }, ua = /* @__PURE__ */ M({
470
986
  __name: "RowMenu",
471
987
  props: {
472
988
  actions: {},
@@ -474,36 +990,36 @@ const da = { class: "wx-link-picker" }, ca = {
474
990
  size: { default: "sm" }
475
991
  },
476
992
  setup(e) {
477
- const t = P("webx-admin"), a = e, l = x(() => [
478
- ...a.actions.filter((s) => !s.danger),
479
- ...a.actions.filter((s) => s.danger)
480
- ]), i = x(() => {
481
- const s = l.value.find((o) => o.danger);
482
- return s && l.value[0] !== s ? s.key : null;
993
+ const t = D("webx-admin"), l = e, n = g(() => [
994
+ ...l.actions.filter((i) => !i.danger),
995
+ ...l.actions.filter((i) => i.danger)
996
+ ]), o = g(() => {
997
+ const i = n.value.find((s) => s.danger);
998
+ return i && n.value[0] !== i ? i.key : null;
483
999
  });
484
- return (s, o) => l.value.length > 0 ? (p(), $(n(Wt), {
1000
+ return (i, s) => n.value.length > 0 ? (m(), S(a(Bt), {
485
1001
  key: 0,
486
1002
  class: "wx-row-menu",
487
1003
  collapse: "always",
488
1004
  align: "end",
489
1005
  size: e.size,
490
1006
  "aria-label": e.label,
491
- onClick: o[0] || (o[0] = qe(() => {
1007
+ onClick: s[0] || (s[0] = tt(() => {
492
1008
  }, ["stop"]))
493
1009
  }, {
494
- trigger: g(() => [
495
- b(n(se), {
1010
+ trigger: y(() => [
1011
+ w(a(ue), {
496
1012
  type: "more",
497
1013
  size: e.size,
498
- title: n(t)("editor.more")
1014
+ title: a(t)("editor.more")
499
1015
  }, null, 8, ["size", "title"])
500
1016
  ]),
501
- collapsed: g(() => [
502
- (p(!0), T(H, null, Q(l.value, (r) => (p(), T(H, {
1017
+ collapsed: y(() => [
1018
+ (m(!0), $(j, null, ae(n.value, (r) => (m(), $(j, {
503
1019
  key: r.key
504
1020
  }, [
505
- r.key === i.value ? (p(), T("hr", wa)) : U("", !0),
506
- b(n(Lt), {
1021
+ r.key === o.value ? (m(), $("hr", ra)) : N("", !0),
1022
+ w(a(Mt), {
507
1023
  icon: r.icon,
508
1024
  tone: r.danger ? "danger" : "default",
509
1025
  href: r.href,
@@ -511,23 +1027,23 @@ const da = { class: "wx-link-picker" }, ca = {
511
1027
  disabled: r.disabled,
512
1028
  onClick: (u) => r.run?.()
513
1029
  }, {
514
- default: g(() => [
515
- V(L(r.label), 1)
1030
+ default: y(() => [
1031
+ z(A(r.label), 1)
516
1032
  ]),
517
1033
  _: 2
518
1034
  }, 1032, ["icon", "tone", "href", "target", "disabled", "onClick"])
519
1035
  ], 64))), 128))
520
1036
  ]),
521
1037
  _: 1
522
- }, 8, ["size", "aria-label"])) : U("", !0);
1038
+ }, 8, ["size", "aria-label"])) : N("", !0);
523
1039
  }
524
- }), Ue = /* @__PURE__ */ Y(xa, [["__scopeId", "data-v-cab01f7f"]]), ka = ["data-level"], _a = {
1040
+ }), Fe = /* @__PURE__ */ G(ua, [["__scopeId", "data-v-cab01f7f"]]), da = ["data-level"], ca = {
525
1041
  key: 0,
526
1042
  class: "wx-screen-head__trail"
527
- }, $a = { class: "wx-screen-head__name" }, Ta = {
1043
+ }, ma = { class: "wx-screen-head__name" }, fa = {
528
1044
  key: 4,
529
1045
  class: "wx-screen-head__actions"
530
- }, Sa = /* @__PURE__ */ R({
1046
+ }, va = /* @__PURE__ */ M({
531
1047
  __name: "ScreenHead",
532
1048
  props: {
533
1049
  title: { default: void 0 },
@@ -541,111 +1057,111 @@ const da = { class: "wx-link-picker" }, ca = {
541
1057
  },
542
1058
  emits: ["back"],
543
1059
  setup(e, { emit: t }) {
544
- const a = e, l = t, i = P("webx-admin"), s = gt(), o = Ye("root"), r = At(o), u = x(() => r.value > 0 && r.value < a.collapseBelow), c = x(() => a.actions ?? []), h = x(
545
- () => c.value.find((f) => f.primary) ?? null
546
- ), m = x(() => u.value ? h.value ? [h.value] : [] : c.value.filter((f) => !f.menu && !f.danger)), v = x(() => u.value ? c.value.filter((f) => f !== h.value) : c.value.filter((f) => f.menu || f.danger)), d = x(
547
- () => a.back && a.back !== !0 ? a.back : null
548
- ), w = x(
549
- () => m.value.length > 0 || v.value.length > 0 || !!s.extra
1060
+ const l = e, n = t, o = D("webx-admin"), i = St(), s = lt("root"), r = Pt(s), u = g(() => r.value > 0 && r.value < l.collapseBelow), d = g(() => l.actions ?? []), h = g(
1061
+ () => d.value.find((p) => p.primary) ?? null
1062
+ ), f = g(() => u.value ? h.value ? [h.value] : [] : d.value.filter((p) => !p.menu && !p.danger)), v = g(() => u.value ? d.value.filter((p) => p !== h.value) : d.value.filter((p) => p.menu || p.danger)), c = g(
1063
+ () => l.back && l.back !== !0 ? l.back : null
1064
+ ), x = g(
1065
+ () => f.value.length > 0 || v.value.length > 0 || !!i.extra
550
1066
  );
551
- return (f, y) => (p(), T("div", {
1067
+ return (p, b) => (m(), $("div", {
552
1068
  ref_key: "root",
553
- ref: o,
554
- class: ae(["wx-screen-head", {
1069
+ ref: s,
1070
+ class: oe(["wx-screen-head", {
555
1071
  "is-narrow": u.value,
556
- "has-button": m.value.length > 0,
557
- "has-trail": !!f.$slots.trail,
1072
+ "has-button": f.value.length > 0,
1073
+ "has-trail": !!p.$slots.trail,
558
1074
  "has-divider": e.divider
559
1075
  }]),
560
1076
  "data-level": e.level
561
1077
  }, [
562
- f.$slots.trail ? (p(), T("div", _a, [
563
- F(f.$slots, "trail", {}, void 0, !0)
564
- ])) : U("", !0),
565
- d.value ? (p(), $(ba, {
1078
+ p.$slots.trail ? (m(), $("div", ca, [
1079
+ Y(p.$slots, "trail", {}, void 0, !0)
1080
+ ])) : N("", !0),
1081
+ c.value ? (m(), S(ia, {
566
1082
  key: 1,
567
1083
  class: "wx-screen-head__back",
568
- to: d.value,
1084
+ to: c.value,
569
1085
  label: e.backLabel,
570
1086
  "tooltip-side": "bottom"
571
- }, null, 8, ["to", "label"])) : e.back ? (p(), $(n(se), {
1087
+ }, null, 8, ["to", "label"])) : e.back ? (m(), S(a(ue), {
572
1088
  key: 2,
573
1089
  class: "wx-screen-head__back",
574
1090
  icon: "arrow-left",
575
1091
  size: "sm",
576
1092
  "tooltip-side": "bottom",
577
- title: e.backLabel ?? n(i)("editor.back"),
578
- onClick: y[0] || (y[0] = (k) => l("back"))
579
- }, null, 8, ["title"])) : U("", !0),
580
- O("div", $a, [
581
- e.title ? (p(), $(n(zt), {
1093
+ title: e.backLabel ?? a(o)("editor.back"),
1094
+ onClick: b[0] || (b[0] = (T) => n("back"))
1095
+ }, null, 8, ["title"])) : N("", !0),
1096
+ B("div", ma, [
1097
+ e.title ? (m(), S(a(Ft), {
582
1098
  key: 0,
583
1099
  level: e.level,
584
1100
  truncate: "",
585
1101
  class: "wx-screen-head__title"
586
1102
  }, {
587
- default: g(() => [
588
- V(L(e.title), 1)
1103
+ default: y(() => [
1104
+ z(A(e.title), 1)
589
1105
  ]),
590
1106
  _: 1
591
- }, 8, ["level"])) : U("", !0),
592
- F(f.$slots, "title-after", {}, void 0, !0)
1107
+ }, 8, ["level"])) : N("", !0),
1108
+ Y(p.$slots, "title-after", {}, void 0, !0)
593
1109
  ]),
594
- e.subtitle || f.$slots.subtitle ? (p(), $(n(G), {
1110
+ e.subtitle || p.$slots.subtitle ? (m(), S(a(ee), {
595
1111
  key: 3,
596
1112
  class: "wx-screen-head__subtitle",
597
1113
  size: "sm",
598
1114
  tone: "muted",
599
1115
  truncate: ""
600
1116
  }, {
601
- default: g(() => [
602
- F(f.$slots, "subtitle", {}, () => [
603
- V(L(e.subtitle), 1)
1117
+ default: y(() => [
1118
+ Y(p.$slots, "subtitle", {}, () => [
1119
+ z(A(e.subtitle), 1)
604
1120
  ], !0)
605
1121
  ]),
606
1122
  _: 3
607
- })) : U("", !0),
608
- w.value ? (p(), T("div", Ta, [
609
- F(f.$slots, "extra", {}, void 0, !0),
610
- (p(!0), T(H, null, Q(m.value, (k) => (p(), $(n(Z), {
611
- key: k.key,
612
- class: ae(["wx-screen-head__button", { "is-primary": k.primary }]),
613
- type: k.primary ? "primary" : "default",
614
- variant: k.primary ? "solid" : k.variant ?? "outline",
615
- loading: k.loading,
616
- disabled: k.disabled,
617
- href: k.href,
618
- target: k.href ? k.target ?? "_blank" : void 0,
619
- rel: k.href ? "noopener" : void 0,
620
- onClick: (M) => k.run?.()
621
- }, Ae({
622
- default: g(() => [
623
- V(" " + L(k.label), 1)
1123
+ })) : N("", !0),
1124
+ x.value ? (m(), $("div", fa, [
1125
+ Y(p.$slots, "extra", {}, void 0, !0),
1126
+ (m(!0), $(j, null, ae(f.value, (T) => (m(), S(a(le), {
1127
+ key: T.key,
1128
+ class: oe(["wx-screen-head__button", { "is-primary": T.primary }]),
1129
+ type: T.primary ? "primary" : "default",
1130
+ variant: T.primary ? "solid" : T.variant ?? "outline",
1131
+ loading: T.loading,
1132
+ disabled: T.disabled,
1133
+ href: T.href,
1134
+ target: T.href ? T.target ?? "_blank" : void 0,
1135
+ rel: T.href ? "noopener" : void 0,
1136
+ onClick: (F) => T.run?.()
1137
+ }, ke({
1138
+ default: y(() => [
1139
+ z(" " + A(T.label), 1)
624
1140
  ]),
625
1141
  _: 2
626
1142
  }, [
627
- k.icon ? {
1143
+ T.icon ? {
628
1144
  name: "icon",
629
- fn: g(() => [
630
- b(n(Ve), {
631
- name: k.icon
1145
+ fn: y(() => [
1146
+ w(a(Me), {
1147
+ name: T.icon
632
1148
  }, null, 8, ["name"])
633
1149
  ]),
634
1150
  key: "0"
635
1151
  } : void 0
636
1152
  ]), 1032, ["class", "type", "variant", "loading", "disabled", "href", "target", "rel", "onClick"]))), 128)),
637
- v.value.length > 0 ? (p(), $(Ue, {
1153
+ v.value.length > 0 ? (m(), S(Fe, {
638
1154
  key: 0,
639
1155
  actions: v.value,
640
1156
  size: "lg",
641
- label: e.title ?? n(i)("editor.more")
642
- }, null, 8, ["actions", "label"])) : U("", !0)
643
- ])) : U("", !0)
644
- ], 10, ka));
1157
+ label: e.title ?? a(o)("editor.more")
1158
+ }, null, 8, ["actions", "label"])) : N("", !0)
1159
+ ])) : N("", !0)
1160
+ ], 10, da));
645
1161
  }
646
- }), it = /* @__PURE__ */ Y(Sa, [["__scopeId", "data-v-e27d184e"]]), Ca = ["data-wx-fill"], Wa = /* @__PURE__ */ R({
1162
+ }), pt = /* @__PURE__ */ G(va, [["__scopeId", "data-v-e27d184e"]]), pa = ["data-wx-fill"], ha = /* @__PURE__ */ M({
647
1163
  __name: "ListScreen",
648
- props: /* @__PURE__ */ oe({
1164
+ props: /* @__PURE__ */ ne({
649
1165
  title: { default: void 0 },
650
1166
  subtitle: { default: void 0 },
651
1167
  back: { default: void 0 },
@@ -662,12 +1178,12 @@ const da = { class: "wx-link-picker" }, ca = {
662
1178
  }),
663
1179
  emits: ["update:view"],
664
1180
  setup(e) {
665
- const t = de(e, "view");
666
- return (a, l) => (p(), T("div", {
667
- class: ae(["wx-list-screen", { "is-fill": e.fill }]),
1181
+ const t = re(e, "view");
1182
+ return (l, n) => (m(), $("div", {
1183
+ class: oe(["wx-list-screen", { "is-fill": e.fill }]),
668
1184
  "data-wx-fill": e.fill ? "" : void 0
669
1185
  }, [
670
- e.title || e.actions || a.$slots.actions ? (p(), $(it, {
1186
+ e.title || e.actions || l.$slots.actions ? (m(), S(pt, {
671
1187
  key: 0,
672
1188
  class: "wx-list-screen__head",
673
1189
  title: e.title,
@@ -676,219 +1192,224 @@ const da = { class: "wx-link-picker" }, ca = {
676
1192
  "back-label": e.backLabel,
677
1193
  actions: e.actions,
678
1194
  "collapse-below": 480
679
- }, Ae({ _: 2 }, [
680
- a.$slots.actions ? {
1195
+ }, ke({ _: 2 }, [
1196
+ l.$slots.actions ? {
681
1197
  name: "extra",
682
- fn: g(() => [
683
- F(a.$slots, "actions", {}, void 0, !0)
1198
+ fn: y(() => [
1199
+ Y(l.$slots, "actions", {}, void 0, !0)
684
1200
  ]),
685
1201
  key: "0"
686
1202
  } : void 0
687
- ]), 1032, ["title", "subtitle", "back", "back-label", "actions"])) : U("", !0),
688
- e.views && e.views.length > 0 ? (p(), $(n(Vt), {
1203
+ ]), 1032, ["title", "subtitle", "back", "back-label", "actions"])) : N("", !0),
1204
+ e.views && e.views.length > 0 ? (m(), S(a(Dt), {
689
1205
  key: 1,
690
1206
  modelValue: t.value,
691
- "onUpdate:modelValue": l[0] || (l[0] = (i) => t.value = i),
1207
+ "onUpdate:modelValue": n[0] || (n[0] = (o) => t.value = o),
692
1208
  class: "wx-list-screen__views",
693
1209
  items: e.views,
694
1210
  "collapse-below": e.collapseBelow,
695
1211
  "aria-label": e.title
696
1212
  }, {
697
- default: g(() => [
698
- e.card ? (p(), $(n(Se), {
1213
+ default: y(() => [
1214
+ e.card ? (m(), S(a(Re), {
699
1215
  key: 0,
700
1216
  class: "wx-list-screen__card",
701
1217
  padding: e.padding
702
1218
  }, {
703
- default: g(() => [
704
- F(a.$slots, "default", {}, void 0, !0)
1219
+ default: y(() => [
1220
+ Y(l.$slots, "default", {}, void 0, !0)
705
1221
  ]),
706
1222
  _: 3
707
- }, 8, ["padding"])) : F(a.$slots, "default", {}, void 0, !0, 1)
1223
+ }, 8, ["padding"])) : Y(l.$slots, "default", {}, void 0, !0, 1)
708
1224
  ]),
709
1225
  _: 3
710
- }, 8, ["modelValue", "items", "collapse-below", "aria-label"])) : (p(), T(H, { key: 2 }, [
711
- e.card ? (p(), $(n(Se), {
1226
+ }, 8, ["modelValue", "items", "collapse-below", "aria-label"])) : (m(), $(j, { key: 2 }, [
1227
+ e.card ? (m(), S(a(Re), {
712
1228
  key: 0,
713
1229
  class: "wx-list-screen__card",
714
1230
  padding: e.padding
715
1231
  }, {
716
- default: g(() => [
717
- F(a.$slots, "default", {}, void 0, !0)
1232
+ default: y(() => [
1233
+ Y(l.$slots, "default", {}, void 0, !0)
718
1234
  ]),
719
1235
  _: 3
720
- }, 8, ["padding"])) : F(a.$slots, "default", {}, void 0, !0, 1)
1236
+ }, 8, ["padding"])) : Y(l.$slots, "default", {}, void 0, !0, 1)
721
1237
  ], 64))
722
- ], 10, Ca));
1238
+ ], 10, pa));
723
1239
  }
724
- }), rt = /* @__PURE__ */ Y(Wa, [["__scopeId", "data-v-8c7e5ad1"]]), La = /* @__PURE__ */ R({
1240
+ }), ht = /* @__PURE__ */ G(ha, [["__scopeId", "data-v-8c7e5ad1"]]), ga = /* @__PURE__ */ M({
725
1241
  name: "WxRichTextField",
726
1242
  inheritAttrs: !1,
727
1243
  __name: "RichTextField",
728
1244
  setup(e) {
729
- const t = X(), a = P("webx-admin"), l = x(() => t.pickImage ?? void 0), i = x(() => ({
730
- bold: a("rich-text.bold"),
731
- italic: a("rich-text.italic"),
732
- strike: a("rich-text.strike"),
733
- code: a("rich-text.code"),
734
- h2: a("rich-text.h2"),
735
- h3: a("rich-text.h3"),
736
- h4: a("rich-text.h4"),
737
- bulletList: a("rich-text.bullet-list"),
738
- orderedList: a("rich-text.ordered-list"),
739
- blockquote: a("rich-text.blockquote"),
740
- hr: a("rich-text.hr"),
741
- link: a("rich-text.link"),
742
- table: a("rich-text.table"),
743
- image: a("rich-text.image"),
744
- youtube: a("rich-text.youtube"),
745
- undo: a("rich-text.undo"),
746
- redo: a("rich-text.redo"),
747
- addRowAfter: a("rich-text.row-below"),
748
- addRowBefore: a("rich-text.row-above"),
749
- addColumnAfter: a("rich-text.column-after"),
750
- addColumnBefore: a("rich-text.column-before"),
751
- deleteRow: a("rich-text.delete-row"),
752
- deleteColumn: a("rich-text.delete-column"),
753
- mergeOrSplit: a("rich-text.merge-cells"),
754
- deleteTable: a("rich-text.delete-table"),
755
- toolbar: a("rich-text.toolbar"),
756
- linkAddress: a("rich-text.link-address"),
757
- youtubeAddress: a("rich-text.youtube-address"),
758
- apply: a("rich-text.apply"),
759
- cancel: a("rich-text.cancel"),
760
- uploading: a("rich-text.uploading")
1245
+ const t = J(), l = D("webx-admin"), n = g(() => t.pickImage ?? void 0), o = g(() => ({
1246
+ bold: l("rich-text.bold"),
1247
+ italic: l("rich-text.italic"),
1248
+ strike: l("rich-text.strike"),
1249
+ code: l("rich-text.code"),
1250
+ h2: l("rich-text.h2"),
1251
+ h3: l("rich-text.h3"),
1252
+ h4: l("rich-text.h4"),
1253
+ bulletList: l("rich-text.bullet-list"),
1254
+ orderedList: l("rich-text.ordered-list"),
1255
+ blockquote: l("rich-text.blockquote"),
1256
+ hr: l("rich-text.hr"),
1257
+ link: l("rich-text.link"),
1258
+ table: l("rich-text.table"),
1259
+ image: l("rich-text.image"),
1260
+ youtube: l("rich-text.youtube"),
1261
+ undo: l("rich-text.undo"),
1262
+ redo: l("rich-text.redo"),
1263
+ addRowAfter: l("rich-text.row-below"),
1264
+ addRowBefore: l("rich-text.row-above"),
1265
+ addColumnAfter: l("rich-text.column-after"),
1266
+ addColumnBefore: l("rich-text.column-before"),
1267
+ deleteRow: l("rich-text.delete-row"),
1268
+ deleteColumn: l("rich-text.delete-column"),
1269
+ mergeOrSplit: l("rich-text.merge-cells"),
1270
+ deleteTable: l("rich-text.delete-table"),
1271
+ toolbar: l("rich-text.toolbar"),
1272
+ linkAddress: l("rich-text.link-address"),
1273
+ youtubeAddress: l("rich-text.youtube-address"),
1274
+ apply: l("rich-text.apply"),
1275
+ cancel: l("rich-text.cancel"),
1276
+ uploading: l("rich-text.uploading")
761
1277
  }));
762
- return (s, o) => (p(), $(n(Et), Ke(s.$attrs, {
763
- labels: i.value,
764
- "pick-image": l.value
1278
+ return (i, s) => (m(), S(a(Ot), et(i.$attrs, {
1279
+ labels: o.value,
1280
+ "pick-image": n.value
765
1281
  }), null, 16, ["labels", "pick-image"]));
766
1282
  }
767
- }), ut = /* @__PURE__ */ Symbol("wx-record-address");
768
- function Aa(e) {
769
- Xe(ut, e);
1283
+ }), gt = /* @__PURE__ */ Symbol("wx-record-address");
1284
+ function ya(e) {
1285
+ ze(gt, e);
770
1286
  }
771
- function za() {
772
- return ne(ut, null);
1287
+ function ba() {
1288
+ return se(gt, null);
773
1289
  }
774
- const Va = { class: "wx-slug" }, Ea = { class: "wx-slug__prefix" }, Ua = /* @__PURE__ */ R({
1290
+ const wa = { class: "wx-slug" }, xa = { class: "wx-slug__prefix" }, ka = /* @__PURE__ */ M({
775
1291
  name: "WxSlugField",
776
1292
  inheritAttrs: !1,
777
1293
  __name: "SlugField",
778
1294
  setup(e) {
779
- const t = za(), a = nt(), l = x(() => {
780
- const o = t?.prefix.value ?? "";
781
- return o === "" ? "/" : `/${o}/`;
782
- }), i = x(() => {
783
- const o = t?.values.value.slug;
784
- return typeof o == "string" ? o : o?.[a.active.value] ?? "";
785
- }), s = x(() => {
786
- const o = t?.path.value;
787
- return typeof o == "string" && i.value !== "" && `${l.value}${i.value}` != `/${o}`;
1295
+ const t = ba(), l = it(), n = g(() => {
1296
+ const s = t?.prefix.value ?? "";
1297
+ return s === "" ? "/" : `/${s}/`;
1298
+ }), o = g(() => {
1299
+ const s = t?.values.value.slug;
1300
+ return typeof s == "string" ? s : s?.[l.active.value] ?? "";
1301
+ }), i = g(() => {
1302
+ const s = t?.path.value;
1303
+ return typeof s == "string" && o.value !== "" && `${n.value}${o.value}` != `/${s}`;
788
1304
  });
789
- return (o, r) => (p(), T("div", Va, [
790
- b(n(ye), yt(bt(o.$attrs)), {
791
- prefix: g(() => [
792
- O("span", Ea, L(l.value), 1)
1305
+ return (s, r) => (m(), $("div", wa, [
1306
+ w(a(Te), Ct(Wt(s.$attrs)), {
1307
+ prefix: y(() => [
1308
+ B("span", xa, A(n.value), 1)
793
1309
  ]),
794
1310
  _: 1
795
1311
  }, 16),
796
- s.value && n(t) ? (p(), $(n(be), {
1312
+ i.value && a(t) ? (m(), S(a(Se), {
797
1313
  key: 0,
798
1314
  type: "info",
799
1315
  variant: "soft",
800
- description: n(t).moving()
801
- }, null, 8, ["description"])) : U("", !0)
1316
+ description: a(t).moving()
1317
+ }, null, 8, ["description"])) : N("", !0)
802
1318
  ]));
803
1319
  }
804
- }), Me = /* @__PURE__ */ Y(Ua, [["__scopeId", "data-v-5921c0dd"]]), Ra = {
805
- "wx-list": { component: rt, kind: "layout", labelProp: "title" },
1320
+ }), Ge = /* @__PURE__ */ G(ka, [["__scopeId", "data-v-5921c0dd"]]), _a = {
1321
+ "wx-list": { component: ht, kind: "layout", labelProp: "title" },
806
1322
  // Full width: an editor shares a row with nothing, and a form of two columns would give it
807
1323
  // half a line to write a page of text in.
808
- "wx-rich-text": { component: La, kind: "field", wide: !0 },
1324
+ "wx-rich-text": { component: ga, kind: "field", wide: !0 },
809
1325
  // Wide as well: a row of the picker is a segmented switch, a section and a search box, and half
810
1326
  // a form's width leaves the search box too narrow to read a page title in.
811
- "wx-link": { component: ya, kind: "field", wide: !0 },
812
- "wx-categories": { component: ia, kind: "field" },
813
- "wx-slug": { component: Me, kind: "field" },
814
- "wx-category-slug": { component: Me, kind: "field" }
815
- }, dt = /* @__PURE__ */ Symbol("webx-admin");
816
- function X() {
817
- const e = ne(dt, null);
1327
+ "wx-link": { component: sa, kind: "field", wide: !0 },
1328
+ "wx-categories": { component: gl, kind: "field" },
1329
+ // Wide: four controls in a column, and half a line leaves the category chips one to a row.
1330
+ "wx-collection": { component: Xl, kind: "field", wide: !0 },
1331
+ // Wide: a row carries a picture, a name with a line under it and a mark, and the search box
1332
+ // under the list reads titles.
1333
+ "wx-relations": { component: mt, kind: "field", wide: !0 },
1334
+ "wx-slug": { component: Ge, kind: "field" },
1335
+ "wx-category-slug": { component: Ge, kind: "field" }
1336
+ }, yt = /* @__PURE__ */ Symbol("webx-admin");
1337
+ function J() {
1338
+ const e = se(yt, null);
818
1339
  if (e === null)
819
1340
  throw new Error("useAdmin() was called outside a panel created by createAdmin().");
820
1341
  return e;
821
1342
  }
822
- function Na(e) {
823
- const t = pe({
1343
+ function $a(e) {
1344
+ const t = be({
824
1345
  status: "loading",
825
1346
  manifest: null,
826
1347
  user: null,
827
1348
  error: null
828
- }), a = x(() => {
829
- const d = t.manifest;
830
- if (d === null)
1349
+ }), l = g(() => {
1350
+ const c = t.manifest;
1351
+ if (c === null)
831
1352
  return [];
832
- const w = [];
833
- for (const f of d.modules) {
834
- const y = e.modules.find((M) => M.id === f.id);
835
- if (y === void 0)
1353
+ const x = [];
1354
+ for (const p of c.modules) {
1355
+ const b = e.modules.find((F) => F.id === p.id);
1356
+ if (b === void 0)
836
1357
  continue;
837
- const k = y.path ?? y.routes?.[0]?.path;
838
- k !== void 0 && w.push({
839
- id: f.id,
840
- title: f.title,
841
- icon: f.icon,
842
- path: k,
843
- group: f.group ?? null
1358
+ const T = b.path ?? b.routes?.[0]?.path;
1359
+ T !== void 0 && x.push({
1360
+ id: p.id,
1361
+ title: p.title,
1362
+ icon: p.icon,
1363
+ path: T,
1364
+ group: p.group ?? null
844
1365
  });
845
1366
  }
846
- return w;
847
- }), l = x(() => {
848
- const d = t.manifest?.groups ?? [], w = [], f = /* @__PURE__ */ new Map();
849
- for (const y of a.value)
850
- if (y.group !== null && d.some((k) => k.id === y.group)) {
851
- const k = f.get(y.group) ?? [];
852
- k.push(y), f.set(y.group, k);
1367
+ return x;
1368
+ }), n = g(() => {
1369
+ const c = t.manifest?.groups ?? [], x = [], p = /* @__PURE__ */ new Map();
1370
+ for (const b of l.value)
1371
+ if (b.group !== null && c.some((T) => T.id === b.group)) {
1372
+ const T = p.get(b.group) ?? [];
1373
+ T.push(b), p.set(b.group, T);
853
1374
  } else
854
- w.push(y);
1375
+ x.push(b);
855
1376
  return {
856
- top: w,
857
- groups: d.filter((y) => f.has(y.id)).map((y) => ({
858
- id: y.id,
859
- title: y.title,
860
- icon: y.icon ?? null,
861
- entries: f.get(y.id) ?? []
1377
+ top: x,
1378
+ groups: c.filter((b) => p.has(b.id)).map((b) => ({
1379
+ id: b.id,
1380
+ title: b.title,
1381
+ icon: b.icon ?? null,
1382
+ entries: p.get(b.id) ?? []
862
1383
  }))
863
1384
  };
864
- }), i = { ...Ra };
865
- for (const d of e.modules)
866
- Object.assign(i, d.types);
867
- Object.assign(i, e.types);
868
- const s = e.modules.find((d) => d.pickImage !== void 0)?.pickImage, o = /* @__PURE__ */ new Map();
869
- async function r(d) {
870
- const w = `${e.i18n.state.locale}:${d}`;
871
- let f = o.get(w);
872
- return f === void 0 && (f = e.http.get(`${e.apiPath}/screens/${d}`).then((y) => y.data.root).catch((y) => {
873
- throw o.delete(w), y;
874
- }), o.set(w, f)), f;
1385
+ }), o = { ..._a };
1386
+ for (const c of e.modules)
1387
+ Object.assign(o, c.types);
1388
+ Object.assign(o, e.types);
1389
+ const i = e.modules.find((c) => c.pickImage !== void 0)?.pickImage, s = /* @__PURE__ */ new Map();
1390
+ async function r(c) {
1391
+ const x = `${e.i18n.state.locale}:${c}`;
1392
+ let p = s.get(x);
1393
+ return p === void 0 && (p = e.http.get(`${e.apiPath}/screens/${c}`).then((b) => b.data.root).catch((b) => {
1394
+ throw s.delete(x), b;
1395
+ }), s.set(x, p)), p;
875
1396
  }
876
1397
  let u = null;
877
- async function c() {
1398
+ async function d() {
878
1399
  t.status = "loading", t.error = null;
879
1400
  try {
880
- if (u !== null && (t.user = await u(), m(t.user), t.user === null)) {
1401
+ if (u !== null && (t.user = await u(), f(t.user), t.user === null)) {
881
1402
  t.manifest = null, t.status = "unauthenticated";
882
1403
  return;
883
1404
  }
884
- const d = await e.loadManifest();
885
- t.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 v(d.locale), t.status = "ready";
886
- } catch (d) {
887
- if (Ia(d)) {
1405
+ const c = await e.loadManifest();
1406
+ t.manifest = c, e.i18n.state.contentLocales = c.locales ?? [], e.i18n.state.panelLocales = c.panelLocales ?? e.i18n.state.panelLocales, c.locale !== void 0 && c.locale !== e.i18n.state.locale && await v(c.locale), t.status = "ready";
1407
+ } catch (c) {
1408
+ if (Sa(c)) {
888
1409
  t.manifest = null, t.user = null, t.status = "unauthenticated";
889
1410
  return;
890
1411
  }
891
- t.error = d instanceof Error ? d.message : String(d), t.status = "error";
1412
+ t.error = c instanceof Error ? c.message : String(c), t.status = "error";
892
1413
  }
893
1414
  }
894
1415
  async function h() {
@@ -898,15 +1419,15 @@ function Na(e) {
898
1419
  } catch {
899
1420
  }
900
1421
  }
901
- function m(d) {
902
- d !== null && e.theme?.adopt(d.theme);
1422
+ function f(c) {
1423
+ c !== null && e.theme?.adopt(c.theme);
903
1424
  }
904
- async function v(d) {
1425
+ async function v(c) {
905
1426
  if (e.loadDictionary === void 0) {
906
- e.i18n.state.locale = d;
1427
+ e.i18n.state.locale = c;
907
1428
  return;
908
1429
  }
909
- await e.loadDictionary(d), await h();
1430
+ await e.loadDictionary(c), await h();
910
1431
  }
911
1432
  return {
912
1433
  http: e.http,
@@ -915,105 +1436,105 @@ function Na(e) {
915
1436
  state: t,
916
1437
  i18n: e.i18n,
917
1438
  modules: e.modules,
918
- nav: a,
919
- groups: l,
920
- types: i,
921
- pickImage: s ?? null,
922
- reload: c,
1439
+ nav: l,
1440
+ groups: n,
1441
+ types: o,
1442
+ pickImage: i ?? null,
1443
+ reload: d,
923
1444
  refreshManifest: h,
924
1445
  setLocale: v,
925
- setUser(d) {
926
- t.user = d, m(d);
1446
+ setUser(c) {
1447
+ t.user = c, f(c);
927
1448
  },
928
- useSessionLoader(d) {
929
- u = d;
1449
+ useSessionLoader(c) {
1450
+ u = c;
930
1451
  },
931
- can(d) {
932
- const w = t.user;
933
- return w === null ? !1 : w.isSuper || w.permissions.includes(d);
1452
+ can(c) {
1453
+ const x = t.user;
1454
+ return x === null ? !1 : x.isSuper || x.permissions.includes(c);
934
1455
  },
935
1456
  loadScreen: r,
936
- screenPatch(d) {
937
- return e.screens?.[d] ?? [];
1457
+ screenPatch(c) {
1458
+ return e.screens?.[c] ?? [];
938
1459
  }
939
1460
  };
940
1461
  }
941
- function Ba(e, t) {
942
- e.provide(dt, t);
1462
+ function Ta(e, t) {
1463
+ e.provide(yt, t);
943
1464
  }
944
- function Ia(e) {
1465
+ function Sa(e) {
945
1466
  return typeof e == "object" && e !== null && "status" in e && e.status === 401;
946
1467
  }
947
- const Pa = /* @__PURE__ */ R({
1468
+ const Ca = /* @__PURE__ */ M({
948
1469
  __name: "AdminLanding",
949
1470
  props: {
950
1471
  landing: { default: null }
951
1472
  },
952
1473
  setup(e) {
953
- const t = e, a = X(), l = ge(), i = P("webx-admin"), s = x(() => {
954
- const o = a.nav.value;
955
- return o.length === 0 ? null : ((t.landing === null ? void 0 : o.find((u) => u.path === t.landing)) ?? o[0])?.path ?? null;
1474
+ const t = e, l = J(), n = _e(), o = D("webx-admin"), i = g(() => {
1475
+ const s = l.nav.value;
1476
+ return s.length === 0 ? null : ((t.landing === null ? void 0 : s.find((u) => u.path === t.landing)) ?? s[0])?.path ?? null;
956
1477
  });
957
- return ee(
958
- s,
959
- (o) => {
960
- o !== null && l.replace(o);
1478
+ return te(
1479
+ i,
1480
+ (s) => {
1481
+ s !== null && n.replace(s);
961
1482
  },
962
1483
  { immediate: !0 }
963
- ), (o, r) => s.value === null && n(a).state.status === "ready" ? (p(), $(n(Ut), {
1484
+ ), (s, r) => i.value === null && a(l).state.status === "ready" ? (m(), S(a(Ht), {
964
1485
  key: 0,
965
1486
  status: "info",
966
- title: n(i)("shell.empty-title"),
967
- description: n(i)("shell.empty-description")
968
- }, null, 8, ["title", "description"])) : U("", !0);
1487
+ title: a(o)("shell.empty-title"),
1488
+ description: a(o)("shell.empty-description")
1489
+ }, null, 8, ["title", "description"])) : N("", !0);
969
1490
  }
970
- }), Da = /* @__PURE__ */ R({
1491
+ }), Wa = /* @__PURE__ */ M({
971
1492
  __name: "AdminNav",
972
1493
  props: {
973
1494
  collapsed: { type: Boolean }
974
1495
  },
975
1496
  emits: ["select"],
976
1497
  setup(e, { emit: t }) {
977
- const a = t, l = X(), i = P("webx-admin"), s = ge(), o = et(), r = x({
1498
+ const l = t, n = J(), o = D("webx-admin"), i = _e(), s = st(), r = g({
978
1499
  /*
979
1500
  * The longest path that contains this one, on a segment boundary: a section may live inside
980
1501
  * another's path (`/services/categories` under `/services`), and the first match in the order
981
1502
  * of the menu would light up the outer one.
982
1503
  */
983
- get: () => l.nav.value.filter((c) => o.path === c.path || o.path.startsWith(`${c.path}/`)).sort((c, h) => h.path.length - c.path.length)[0]?.id ?? "",
1504
+ get: () => n.nav.value.filter((d) => s.path === d.path || s.path.startsWith(`${d.path}/`)).sort((d, h) => h.path.length - d.path.length)[0]?.id ?? "",
984
1505
  set: (u) => {
985
- const c = l.nav.value.find((h) => h.id === u);
986
- c !== void 0 && s.push(c.path);
1506
+ const d = n.nav.value.find((h) => h.id === u);
1507
+ d !== void 0 && i.push(d.path);
987
1508
  }
988
1509
  });
989
- return (u, c) => {
990
- const h = j("wx-menu-item"), m = j("wx-submenu"), v = j("wx-menu");
991
- return p(), $(v, {
1510
+ return (u, d) => {
1511
+ const h = X("wx-menu-item"), f = X("wx-submenu"), v = X("wx-menu");
1512
+ return m(), S(v, {
992
1513
  modelValue: r.value,
993
- "onUpdate:modelValue": c[0] || (c[0] = (d) => r.value = d),
1514
+ "onUpdate:modelValue": d[0] || (d[0] = (c) => r.value = c),
994
1515
  collapsed: e.collapsed,
995
- label: n(i)("nav.sections"),
996
- onSelect: c[1] || (c[1] = (d) => a("select"))
1516
+ label: a(o)("nav.sections"),
1517
+ onSelect: d[1] || (d[1] = (c) => l("select"))
997
1518
  }, {
998
- default: g(() => [
999
- (p(!0), T(H, null, Q(n(l).groups.value.top, (d) => (p(), $(h, {
1000
- key: d.id,
1001
- value: d.id,
1002
- icon: d.icon ?? void 0,
1003
- label: d.title
1519
+ default: y(() => [
1520
+ (m(!0), $(j, null, ae(a(n).groups.value.top, (c) => (m(), S(h, {
1521
+ key: c.id,
1522
+ value: c.id,
1523
+ icon: c.icon ?? void 0,
1524
+ label: c.title
1004
1525
  }, null, 8, ["value", "icon", "label"]))), 128)),
1005
- (p(!0), T(H, null, Q(n(l).groups.value.groups, (d) => (p(), $(m, {
1006
- key: d.id,
1007
- value: `group:${d.id}`,
1008
- title: d.title,
1009
- icon: d.icon ?? "gear"
1526
+ (m(!0), $(j, null, ae(a(n).groups.value.groups, (c) => (m(), S(f, {
1527
+ key: c.id,
1528
+ value: `group:${c.id}`,
1529
+ title: c.title,
1530
+ icon: c.icon ?? "gear"
1010
1531
  }, {
1011
- default: g(() => [
1012
- (p(!0), T(H, null, Q(d.entries, (w) => (p(), $(h, {
1013
- key: w.id,
1014
- value: w.id,
1015
- icon: w.icon ?? void 0,
1016
- label: w.title
1532
+ default: y(() => [
1533
+ (m(!0), $(j, null, ae(c.entries, (x) => (m(), S(h, {
1534
+ key: x.id,
1535
+ value: x.id,
1536
+ icon: x.icon ?? void 0,
1537
+ label: x.title
1017
1538
  }, null, 8, ["value", "icon", "label"]))), 128))
1018
1539
  ]),
1019
1540
  _: 2
@@ -1023,68 +1544,68 @@ const Pa = /* @__PURE__ */ R({
1023
1544
  }, 8, ["modelValue", "collapsed", "label"]);
1024
1545
  };
1025
1546
  }
1026
- }), Ma = {
1547
+ }), Aa = {
1027
1548
  key: 0,
1028
1549
  class: "wx-root wx-admin-plain"
1029
- }, Fa = {
1550
+ }, Va = {
1030
1551
  key: 1,
1031
1552
  class: "wx-root wx-admin-plain"
1032
- }, Oa = {
1553
+ }, La = {
1033
1554
  key: 2,
1034
1555
  class: "wx-root wx-admin-plain"
1035
- }, Ha = ["src", "alt", "width", "height"], ja = ["src", "alt", "width", "height"], Ka = ["src", "alt"], qa = { class: "wx-admin__user" }, Ya = { class: "wx-admin__user wx-admin__user--drawer" }, Xa = /* @__PURE__ */ R({
1556
+ }, Na = ["src", "alt", "width", "height"], Ra = ["src", "alt", "width", "height"], Ua = ["src", "alt"], za = { class: "wx-admin__user" }, Ia = { class: "wx-admin__user wx-admin__user--drawer" }, Ea = /* @__PURE__ */ M({
1036
1557
  __name: "AdminShell",
1037
1558
  setup(e) {
1038
- const t = X(), a = P("webx-admin"), l = W(null), { width: i, layout: s, collapsed: o, showAside: r, drawerOpen: u, toggle: c, close: h } = Rt(
1039
- l,
1559
+ const t = J(), l = D("webx-admin"), n = L(null), { width: o, layout: i, collapsed: s, showAside: r, drawerOpen: u, toggle: d, close: h } = jt(
1560
+ n,
1040
1561
  { persist: "webx-admin-shell" }
1041
- ), m = x(() => t.state.manifest?.title ?? ""), v = x(() => t.state.manifest?.branding?.logo ?? null), d = x(() => t.state.manifest?.branding?.mark ?? null), w = x(() => Nt(i.value, null));
1042
- return wt(() => {
1043
- typeof document > "u" || (document.documentElement.dataset.wxShell = w.value);
1044
- }), xt(() => {
1562
+ ), f = g(() => t.state.manifest?.title ?? ""), v = g(() => t.state.manifest?.branding?.logo ?? null), c = g(() => t.state.manifest?.branding?.mark ?? null), x = g(() => Kt(o.value, null));
1563
+ return At(() => {
1564
+ typeof document > "u" || (document.documentElement.dataset.wxShell = x.value);
1565
+ }), Vt(() => {
1045
1566
  typeof document < "u" && delete document.documentElement.dataset.wxShell;
1046
- }), (f, y) => {
1047
- const k = j("router-view"), M = j("wx-loading"), J = j("wx-button"), S = j("wx-result"), B = j("wx-action"), C = j("wx-text"), A = j("wx-header"), E = j("wx-aside"), K = j("wx-main"), le = j("wx-container"), ie = j("wx-drawer");
1048
- return p(), T(H, null, [
1049
- b(n(Bt), { placement: "bottom-center" }),
1050
- n(t).state.status === "unauthenticated" ? (p(), T("div", Ma, [
1051
- b(k)
1052
- ])) : n(t).state.status === "loading" ? (p(), T("div", Fa, [
1053
- b(M, {
1054
- label: n(a)("shell.loading")
1567
+ }), (p, b) => {
1568
+ const T = X("router-view"), F = X("wx-loading"), Q = X("wx-button"), H = X("wx-result"), V = X("wx-action"), k = X("wx-text"), C = X("wx-header"), _ = X("wx-aside"), q = X("wx-main"), R = X("wx-container"), U = X("wx-drawer");
1569
+ return m(), $(j, null, [
1570
+ w(a(qt), { placement: "bottom-center" }),
1571
+ a(t).state.status === "unauthenticated" ? (m(), $("div", Aa, [
1572
+ w(T)
1573
+ ])) : a(t).state.status === "loading" ? (m(), $("div", Va, [
1574
+ w(F, {
1575
+ label: a(l)("shell.loading")
1055
1576
  }, null, 8, ["label"])
1056
- ])) : n(t).state.status === "error" ? (p(), T("div", Oa, [
1057
- b(S, {
1577
+ ])) : a(t).state.status === "error" ? (m(), $("div", La, [
1578
+ w(H, {
1058
1579
  status: "error",
1059
- title: n(a)("shell.error-title"),
1060
- description: n(t).state.error
1580
+ title: a(l)("shell.error-title"),
1581
+ description: a(t).state.error
1061
1582
  }, {
1062
- default: g(() => [
1063
- b(J, {
1583
+ default: y(() => [
1584
+ w(Q, {
1064
1585
  type: "primary",
1065
- onClick: y[0] || (y[0] = (te) => n(t).reload())
1586
+ onClick: b[0] || (b[0] = (I) => a(t).reload())
1066
1587
  }, {
1067
- default: g(() => [
1068
- V(L(n(a)("shell.retry")), 1)
1588
+ default: y(() => [
1589
+ z(A(a(l)("shell.retry")), 1)
1069
1590
  ]),
1070
1591
  _: 1
1071
1592
  })
1072
1593
  ]),
1073
1594
  _: 1
1074
1595
  }, 8, ["title", "description"])
1075
- ])) : (p(), T("div", {
1596
+ ])) : (m(), $("div", {
1076
1597
  key: 3,
1077
1598
  ref_key: "shellEl",
1078
- ref: l,
1079
- class: ae(["wx-root wx-admin", `wx-admin--${w.value}`])
1599
+ ref: n,
1600
+ class: oe(["wx-root wx-admin", `wx-admin--${x.value}`])
1080
1601
  }, [
1081
- b(le, {
1082
- direction: n(s) === "drawer" ? "vertical" : "horizontal",
1602
+ w(R, {
1603
+ direction: a(i) === "drawer" ? "vertical" : "horizontal",
1083
1604
  "full-height": "",
1084
1605
  class: "wx-admin__frame"
1085
1606
  }, {
1086
- default: g(() => [
1087
- n(s) === "drawer" ? (p(), $(A, {
1607
+ default: y(() => [
1608
+ a(i) === "drawer" ? (m(), S(C, {
1088
1609
  key: 0,
1089
1610
  class: "wx-admin__header",
1090
1611
  floating: "",
@@ -1093,127 +1614,127 @@ const Pa = /* @__PURE__ */ R({
1093
1614
  padding: "sm",
1094
1615
  height: "var(--wx-admin-header-height)"
1095
1616
  }, {
1096
- end: g(() => [
1097
- F(f.$slots, "user", { expanded: !1 }, void 0, !0)
1617
+ end: y(() => [
1618
+ Y(p.$slots, "user", { expanded: !1 }, void 0, !0)
1098
1619
  ]),
1099
- default: g(() => [
1100
- b(B, {
1620
+ default: y(() => [
1621
+ w(V, {
1101
1622
  icon: "menu",
1102
- title: n(a)("nav.menu"),
1103
- onClick: n(c)
1623
+ title: a(l)("nav.menu"),
1624
+ onClick: a(d)
1104
1625
  }, null, 8, ["title", "onClick"]),
1105
- F(f.$slots, "brand", {}, () => [
1106
- v.value ? (p(), T("img", {
1626
+ Y(p.$slots, "brand", {}, () => [
1627
+ v.value ? (m(), $("img", {
1107
1628
  key: 0,
1108
1629
  class: "wx-admin__logo",
1109
1630
  src: v.value.url,
1110
- alt: m.value,
1631
+ alt: f.value,
1111
1632
  width: v.value.width ?? void 0,
1112
1633
  height: v.value.height ?? void 0
1113
- }, null, 8, Ha)) : (p(), $(C, {
1634
+ }, null, 8, Na)) : (m(), S(k, {
1114
1635
  key: 1,
1115
1636
  weight: "semibold",
1116
1637
  truncate: ""
1117
1638
  }, {
1118
- default: g(() => [
1119
- V(L(m.value), 1)
1639
+ default: y(() => [
1640
+ z(A(f.value), 1)
1120
1641
  ]),
1121
1642
  _: 1
1122
1643
  }))
1123
1644
  ], !0)
1124
1645
  ]),
1125
1646
  _: 3
1126
- })) : U("", !0),
1127
- n(r) ? (p(), $(E, {
1647
+ })) : N("", !0),
1648
+ a(r) ? (m(), S(_, {
1128
1649
  key: 1,
1129
1650
  class: "wx-admin__aside",
1130
1651
  sticky: "",
1131
1652
  floating: "",
1132
1653
  scroll: "",
1133
1654
  bordered: !1,
1134
- collapsed: n(o),
1655
+ collapsed: a(s),
1135
1656
  width: 220,
1136
1657
  "collapsed-width": 56
1137
1658
  }, {
1138
- top: g(() => [
1139
- O("div", {
1140
- class: ae(["wx-admin__brand", { "wx-admin__brand--stacked": n(o) && d.value }])
1659
+ top: y(() => [
1660
+ B("div", {
1661
+ class: oe(["wx-admin__brand", { "wx-admin__brand--stacked": a(s) && c.value }])
1141
1662
  }, [
1142
- n(o) ? d.value ? (p(), T("img", {
1663
+ a(s) ? c.value ? (m(), $("img", {
1143
1664
  key: 1,
1144
1665
  class: "wx-admin__mark",
1145
- src: d.value.url,
1146
- alt: m.value
1147
- }, null, 8, Ka)) : U("", !0) : F(f.$slots, "brand", {}, () => [
1148
- v.value ? (p(), T("img", {
1666
+ src: c.value.url,
1667
+ alt: f.value
1668
+ }, null, 8, Ua)) : N("", !0) : Y(p.$slots, "brand", {}, () => [
1669
+ v.value ? (m(), $("img", {
1149
1670
  key: 0,
1150
1671
  class: "wx-admin__logo",
1151
1672
  src: v.value.url,
1152
- alt: m.value,
1673
+ alt: f.value,
1153
1674
  width: v.value.width ?? void 0,
1154
1675
  height: v.value.height ?? void 0
1155
- }, null, 8, ja)) : (p(), $(C, {
1676
+ }, null, 8, Ra)) : (m(), S(k, {
1156
1677
  key: 1,
1157
1678
  weight: "semibold",
1158
1679
  truncate: "",
1159
1680
  class: "wx-admin__title"
1160
1681
  }, {
1161
- default: g(() => [
1162
- V(L(m.value), 1)
1682
+ default: y(() => [
1683
+ z(A(f.value), 1)
1163
1684
  ]),
1164
1685
  _: 1
1165
1686
  }))
1166
1687
  ], !0, 0),
1167
- b(B, {
1688
+ w(V, {
1168
1689
  icon: "sidebar",
1169
- title: n(o) ? n(a)("nav.expand") : n(a)("nav.collapse"),
1170
- onClick: n(c)
1690
+ title: a(s) ? a(l)("nav.expand") : a(l)("nav.collapse"),
1691
+ onClick: a(d)
1171
1692
  }, null, 8, ["title", "onClick"])
1172
1693
  ], 2)
1173
1694
  ]),
1174
- bottom: g(() => [
1175
- O("div", qa, [
1176
- F(f.$slots, "user", {
1177
- expanded: !n(o)
1695
+ bottom: y(() => [
1696
+ B("div", za, [
1697
+ Y(p.$slots, "user", {
1698
+ expanded: !a(s)
1178
1699
  }, void 0, !0)
1179
1700
  ])
1180
1701
  ]),
1181
- default: g(() => [
1182
- F(f.$slots, "nav", { collapsed: n(o) }, void 0, !0)
1702
+ default: y(() => [
1703
+ Y(p.$slots, "nav", { collapsed: a(s) }, void 0, !0)
1183
1704
  ]),
1184
1705
  _: 3
1185
- }, 8, ["collapsed"])) : U("", !0),
1186
- b(K, {
1706
+ }, 8, ["collapsed"])) : N("", !0),
1707
+ w(q, {
1187
1708
  padding: "none",
1188
1709
  class: "wx-admin__screen"
1189
1710
  }, {
1190
- default: g(() => [
1191
- b(k)
1711
+ default: y(() => [
1712
+ w(T)
1192
1713
  ]),
1193
1714
  _: 1
1194
1715
  })
1195
1716
  ]),
1196
1717
  _: 3
1197
1718
  }, 8, ["direction"]),
1198
- b(ie, {
1199
- open: n(u),
1200
- "onUpdate:open": y[1] || (y[1] = (te) => Ge(u) ? u.value = te : null),
1719
+ w(U, {
1720
+ open: a(u),
1721
+ "onUpdate:open": b[1] || (b[1] = (I) => at(u) ? u.value = I : null),
1201
1722
  class: "wx-admin__drawer",
1202
- title: m.value === "" ? n(a)("nav.menu") : m.value,
1723
+ title: f.value === "" ? a(l)("nav.menu") : f.value,
1203
1724
  side: "left",
1204
1725
  size: 260,
1205
1726
  "full-screen": !1,
1206
1727
  closable: ""
1207
1728
  }, {
1208
- footer: g(() => [
1209
- O("div", Ya, [
1210
- F(f.$slots, "user", { expanded: !0 }, void 0, !0)
1729
+ footer: y(() => [
1730
+ B("div", Ia, [
1731
+ Y(p.$slots, "user", { expanded: !0 }, void 0, !0)
1211
1732
  ])
1212
1733
  ]),
1213
- default: g(() => [
1214
- F(f.$slots, "nav", {
1734
+ default: y(() => [
1735
+ Y(p.$slots, "nav", {
1215
1736
  collapsed: !1,
1216
- select: n(h)
1737
+ select: a(h)
1217
1738
  }, void 0, !0)
1218
1739
  ]),
1219
1740
  _: 3
@@ -1222,146 +1743,47 @@ const Pa = /* @__PURE__ */ R({
1222
1743
  ], 64);
1223
1744
  };
1224
1745
  }
1225
- }), Ga = /* @__PURE__ */ Y(Xa, [["__scopeId", "data-v-819885ab"]]);
1226
- class Ce extends Error {
1227
- constructor(t, a, l = {}, i = null, s = null) {
1228
- super(t), this.status = a, this.errors = l, this.retryAfter = i, this.body = s, this.name = "HttpError";
1229
- }
1230
- status;
1231
- errors;
1232
- retryAfter;
1233
- body;
1234
- /** A failed form rather than a failed request. */
1235
- get isValidation() {
1236
- return this.status === 422;
1237
- }
1238
- get isUnauthenticated() {
1239
- return this.status === 401;
1240
- }
1241
- get isThrottled() {
1242
- return this.status === 429;
1243
- }
1244
- }
1245
- const Ja = /* @__PURE__ */ new Set(["POST", "PUT", "PATCH", "DELETE"]);
1246
- function Qa(e = {}) {
1247
- const t = (e.baseUrl ?? "").replace(/\/$/, ""), a = e.csrfUrl ?? "/api/cms/auth/csrf-cookie", l = e.fetch ?? globalThis.fetch.bind(globalThis), i = e.onUnauthenticated, s = e.headers;
1248
- let o = !1;
1249
- async function r(c = !1) {
1250
- o && !c && Fe("XSRF-TOKEN") !== null || (await l(a, { credentials: "same-origin" }), o = !0);
1251
- }
1252
- async function u(c, h, m, v = {}, d = !1) {
1253
- const w = Ja.has(c);
1254
- w && await r();
1255
- const f = {
1256
- Accept: "application/json",
1257
- "X-Requested-With": "XMLHttpRequest",
1258
- // Standing headers first, so a caller can still override one for a single request.
1259
- ...s?.(),
1260
- ...v.headers
1261
- };
1262
- if (w) {
1263
- const k = Fe("XSRF-TOKEN");
1264
- k !== null && (f["X-XSRF-TOKEN"] = k);
1265
- }
1266
- m !== void 0 && (f["Content-Type"] = "application/json");
1267
- const y = await l(en(t, h, v.query), {
1268
- method: c,
1269
- credentials: "same-origin",
1270
- headers: f,
1271
- signal: v.signal,
1272
- body: m === void 0 ? void 0 : JSON.stringify(m)
1273
- });
1274
- if (y.status === 419 && w && !d)
1275
- return await r(!0), u(c, h, m, v, !0);
1276
- if (y.status === 401 && i?.(), !y.ok)
1277
- throw await Za(y);
1278
- if (y.status !== 204)
1279
- return await y.json();
1280
- }
1281
- return {
1282
- get: (c, h) => u("GET", c, void 0, h),
1283
- post: (c, h, m) => u("POST", c, h, m),
1284
- put: (c, h, m) => u("PUT", c, h, m),
1285
- patch: (c, h, m) => u("PATCH", c, h, m),
1286
- delete: (c, h) => u("DELETE", c, void 0, h)
1287
- };
1288
- }
1289
- async function Za(e) {
1290
- let t = null;
1291
- try {
1292
- t = await e.json();
1293
- } catch {
1294
- }
1295
- const a = t ?? {}, l = typeof a.message == "string" && a.message !== "" ? a.message : e.statusText || `Request failed with ${e.status}`, i = a.errors !== null && typeof a.errors == "object" ? a.errors : {}, s = e.headers.get("Retry-After"), o = s === null ? null : Number.parseInt(s, 10);
1296
- return new Ce(
1297
- l,
1298
- e.status,
1299
- i,
1300
- Number.isFinite(o) ? o : null,
1301
- t
1302
- );
1303
- }
1304
- function en(e, t, a) {
1305
- const i = /^https?:\/\//i.test(t) ? t : `${e}/${t.replace(/^\//, "")}`;
1306
- if (a === void 0)
1307
- return i;
1308
- const s = new URLSearchParams();
1309
- for (const [r, u] of Object.entries(a))
1310
- u != null && s.set(r, String(u));
1311
- const o = s.toString();
1312
- return o === "" ? i : `${i}${i.includes("?") ? "&" : "?"}${o}`;
1313
- }
1314
- function Fe(e) {
1315
- if (typeof document > "u")
1316
- return null;
1317
- for (const t of document.cookie.split(";")) {
1318
- const [a, ...l] = t.trim().split("=");
1319
- if (a === e)
1320
- return decodeURIComponent(l.join("="));
1321
- }
1322
- return null;
1323
- }
1324
- const tn = "webx.theme", ct = /* @__PURE__ */ Symbol("webx-theme");
1325
- function Jn() {
1326
- const e = ne(ct, null);
1746
+ }), Ba = /* @__PURE__ */ G(Ea, [["__scopeId", "data-v-819885ab"]]), Ma = "webx.theme", bt = /* @__PURE__ */ Symbol("webx-theme");
1747
+ function In() {
1748
+ const e = se(bt, null);
1327
1749
  if (e === null)
1328
1750
  throw new Error("useTheme() was called outside a panel created by createAdmin().");
1329
1751
  return e;
1330
1752
  }
1331
- function an(e, t) {
1332
- e.provide(ct, t);
1753
+ function Pa(e, t) {
1754
+ e.provide(bt, t);
1333
1755
  }
1334
- function nn(e = {}) {
1335
- const t = e.storageKey === void 0 ? tn : e.storageKey, a = pe({
1336
- preference: ln(t) ?? "system",
1756
+ function Fa(e = {}) {
1757
+ const t = e.storageKey === void 0 ? Ma : e.storageKey, l = be({
1758
+ preference: Da(t) ?? "system",
1337
1759
  resolved: "light"
1338
1760
  });
1339
- function l() {
1340
- Jt(a.preference), a.resolved = a.preference === "system" ? Qt() : a.preference;
1761
+ function n() {
1762
+ il(l.preference), l.resolved = l.preference === "system" ? rl() : l.preference;
1341
1763
  }
1342
- return l(), Gt((i) => {
1343
- a.preference === "system" && (a.resolved = i);
1764
+ return n(), sl((o) => {
1765
+ l.preference === "system" && (l.resolved = o);
1344
1766
  }), {
1345
- state: a,
1346
- set(i) {
1347
- a.preference = i, l(), Oe(t, i);
1767
+ state: l,
1768
+ set(o) {
1769
+ l.preference = o, n(), Je(t, o);
1348
1770
  },
1349
- adopt(i) {
1350
- if (i === void 0)
1771
+ adopt(o) {
1772
+ if (o === void 0)
1351
1773
  return;
1352
- const s = i ?? "system";
1353
- s !== a.preference && (a.preference = s, l(), Oe(t, s));
1774
+ const i = o ?? "system";
1775
+ i !== l.preference && (l.preference = i, n(), Je(t, i));
1354
1776
  }
1355
1777
  };
1356
1778
  }
1357
- function Oe(e, t) {
1779
+ function Je(e, t) {
1358
1780
  if (e !== null)
1359
1781
  try {
1360
1782
  localStorage.setItem(e, t);
1361
1783
  } catch {
1362
1784
  }
1363
1785
  }
1364
- function ln(e) {
1786
+ function Da(e) {
1365
1787
  if (e === null)
1366
1788
  return null;
1367
1789
  try {
@@ -1371,7 +1793,7 @@ function ln(e) {
1371
1793
  return null;
1372
1794
  }
1373
1795
  }
1374
- const mt = {
1796
+ const wt = {
1375
1797
  shell: {
1376
1798
  loading: "Loading the panel…",
1377
1799
  "error-title": "The panel could not start",
@@ -1585,29 +2007,73 @@ const mt = {
1585
2007
  "order-category": "Drag to change the order inside this category. The rest of the list keeps its own.",
1586
2008
  "order-locked": "Clear the search and the filters to change the order — only a whole list, or one category, can be dragged.",
1587
2009
  unknown: "One of the chosen categories is not there any more."
2010
+ },
2011
+ // What a block shows from another section (`wx-collection`): the server's refusals, then the
2012
+ // words of the field that makes the choice. The name of the section is the server's, translated.
2013
+ collections: {
2014
+ "unknown-source": "There is no “:source” on this site to show records from.",
2015
+ "unknown-category": "One of the chosen categories no longer exists.",
2016
+ limit: "How many to show: a whole number from 1 to :max, or empty for all.",
2017
+ flag: "This switch takes yes or no.",
2018
+ "unknown-relation": "Records of this section cannot be filtered by that.",
2019
+ "unknown-related": "One of the chosen related records no longer exists.",
2020
+ "field-source": "Shows records from “:source”.",
2021
+ "field-unavailable": "Records from “:source” cannot be chosen here: the section is not installed, or you have no access to it.",
2022
+ "field-categories": "Categories",
2023
+ "field-all": "All categories",
2024
+ "field-no-categories": "No such category.",
2025
+ "field-limit": "How many to show",
2026
+ "field-limit-all": "All",
2027
+ "field-filter": "A filter by category above the list",
2028
+ "field-markup": "Markup for search engines",
2029
+ "field-markup-auto-on": "By default it is on: the block shows every category.",
2030
+ "field-markup-auto-off": "By default it is off: search engines ask not to mark the same records up on several pages, and a chosen category usually stands on several.",
2031
+ "field-markup-reset": "Back to the default"
2032
+ },
2033
+ // The records of another section a record points at (`wx-relations`), and the same choice as a
2034
+ // block's filter ("only related to" in `wx-collection`). Kept apart from `collections` because
2035
+ // the field is a field of its own, on any screen.
2036
+ relations: {
2037
+ "field-add": "Add…",
2038
+ "field-searching": "Searching…",
2039
+ "field-nothing": "Nothing found.",
2040
+ "field-empty": "Nothing chosen yet.",
2041
+ "field-remove": "Remove",
2042
+ "field-drag": "Drag to change the order",
2043
+ "field-hidden": "Not on the site",
2044
+ "field-trashed": "In the bin",
2045
+ "field-missing": "Not found",
2046
+ "field-full": "No more than :max can be chosen.",
2047
+ "field-forbidden": "You cannot see these records, so the choice cannot be changed here.",
2048
+ "collection-related": "Only related to",
2049
+ "collection-related-to": "Only related to “:target”",
2050
+ "collection-related-type": "Which section",
2051
+ "collection-related-any": "Not narrowed: every record, related or not.",
2052
+ "collection-related-current": "The record of the page it stands on",
2053
+ "collection-related-current-hint": "On the page of a record of “:target” the block shows what is related to it; on any other page it shows nothing."
1588
2054
  }
1589
- }, vt = "webx.locale";
1590
- function Qn(e = {}) {
1591
- const t = e.manifestUrl ?? cn() ?? "/api/cms/manifest", a = e.apiPath ?? t.replace(/\/manifest\/?$/, ""), l = e.basePath ?? "/cms", i = e.modules ?? [], s = [...e.routes ?? []];
1592
- for (const y of i)
1593
- s.push(...y.routes ?? []);
1594
- if (!s.some((y) => y.path === "/")) {
1595
- const y = i.find((k) => k.landing === !0);
1596
- s.push({
2055
+ }, xt = "webx.locale";
2056
+ function En(e = {}) {
2057
+ const t = e.manifestUrl ?? Ya() ?? "/api/cms/manifest", l = e.apiPath ?? t.replace(/\/manifest\/?$/, ""), n = e.basePath ?? "/cms", o = e.modules ?? [], i = [...e.routes ?? []];
2058
+ for (const b of o)
2059
+ i.push(...b.routes ?? []);
2060
+ if (!i.some((b) => b.path === "/")) {
2061
+ const b = o.find((T) => T.landing === !0);
2062
+ i.push({
1597
2063
  path: "/",
1598
2064
  name: "webx.home",
1599
- component: Pa,
1600
- props: { landing: y?.path ?? y?.routes?.[0]?.path ?? null }
2065
+ component: Ca,
2066
+ props: { landing: b?.path ?? b?.routes?.[0]?.path ?? null }
1601
2067
  });
1602
2068
  }
1603
- const o = $t({
1604
- history: Tt(l),
1605
- routes: s
1606
- }), r = Ee({ locale: e.locale ?? sn() }), u = nn(), c = e.http ?? Qa({
2069
+ const s = Rt({
2070
+ history: Ut(n),
2071
+ routes: i
2072
+ }), r = Pe({ locale: e.locale ?? Ha() }), u = Fa(), d = e.http ?? bl({
1607
2073
  baseUrl: "",
1608
- csrfUrl: `${a}/auth/csrf-cookie`,
2074
+ csrfUrl: `${l}/auth/csrf-cookie`,
1609
2075
  onUnauthenticated: () => {
1610
- m.setUser(null), m.state.status = "unauthenticated";
2076
+ f.setUser(null), f.state.status = "unauthenticated";
1611
2077
  },
1612
2078
  // Every request says which language the panel is currently showing. It decides what
1613
2079
  // the server writes its own messages in — a 422 under a field — for anybody who has
@@ -1615,174 +2081,174 @@ function Qn(e = {}) {
1615
2081
  // signing in on a Russian sign-in screen lands in an English panel.
1616
2082
  headers: () => ({ "X-Webx-Locale": r.state.locale })
1617
2083
  });
1618
- r.defaults("webx-admin", mt);
1619
- async function h(y) {
1620
- const k = await c.get(`${a}/translations/${y}`);
1621
- r.load(k.data.namespaces, k.data.locale, k.data.fallback), rn(k.data.locale), dn(k.data.locale, r.state.panelLocales);
2084
+ r.defaults("webx-admin", wt);
2085
+ async function h(b) {
2086
+ const T = await d.get(`${l}/translations/${b}`);
2087
+ r.load(T.data.namespaces, T.data.locale, T.data.fallback), ja(T.data.locale), qa(T.data.locale, r.state.panelLocales);
1622
2088
  }
1623
- const m = Na({
1624
- http: c,
2089
+ const f = $a({
2090
+ http: d,
1625
2091
  theme: u,
1626
- basePath: l,
1627
- apiPath: a,
1628
- modules: i,
2092
+ basePath: n,
2093
+ apiPath: l,
2094
+ modules: o,
1629
2095
  i18n: r,
1630
2096
  loadDictionary: h,
1631
2097
  types: e.types,
1632
2098
  screens: e.screens,
1633
- loadManifest: async () => (await c.get(t)).data
1634
- }), v = kt(on(e));
1635
- v.use(It), Ba(v, m), ta(v, r), an(v, u);
1636
- const d = W("");
2099
+ loadManifest: async () => (await d.get(t)).data
2100
+ }), v = Lt(Oa(e));
2101
+ v.use(Yt), Ta(v, f), cl(v, r), Pa(v, u);
2102
+ const c = L("");
1637
2103
  v.provide(
1638
- Pt,
1639
- x(() => r.state.locale)
1640
- ), v.provide(Dt, {
1641
- list: x(
1642
- () => r.state.contentLocales.map((y) => ({
1643
- code: y.code,
1644
- label: y.code.toUpperCase()
2104
+ Xt,
2105
+ g(() => r.state.locale)
2106
+ ), v.provide(Gt, {
2107
+ list: g(
2108
+ () => r.state.contentLocales.map((b) => ({
2109
+ code: b.code,
2110
+ label: b.code.toUpperCase()
1645
2111
  }))
1646
2112
  ),
1647
- active: x({
1648
- get: () => d.value || (r.state.contentLocales[0]?.code ?? ""),
1649
- set: (y) => {
1650
- d.value = y;
2113
+ active: g({
2114
+ get: () => c.value || (r.state.contentLocales[0]?.code ?? ""),
2115
+ set: (b) => {
2116
+ c.value = b;
1651
2117
  }
1652
2118
  })
1653
2119
  });
1654
- const w = {
2120
+ const x = {
1655
2121
  app: v,
1656
- router: o,
1657
- context: m,
2122
+ router: s,
2123
+ context: f,
1658
2124
  i18n: r,
1659
2125
  theme: u,
1660
2126
  async mount() {
1661
- await Promise.all([f(), h(r.state.locale)]).catch(() => {
1662
- }), v.mount(e.el ?? "#webx-app"), await m.reload();
2127
+ await Promise.all([p(), h(r.state.locale)]).catch(() => {
2128
+ }), v.mount(e.el ?? "#webx-app"), await f.reload();
1663
2129
  }
1664
2130
  };
1665
- async function f() {
1666
- const y = await c.get(`${a}/locales`);
1667
- r.state.panelLocales = y.data.panel, r.state.contentLocales = y.data.content;
2131
+ async function p() {
2132
+ const b = await d.get(`${l}/locales`);
2133
+ r.state.panelLocales = b.data.panel, r.state.contentLocales = b.data.content;
1668
2134
  }
1669
- for (const y of e.plugins ?? [])
1670
- y.install(w);
1671
- return v.use(o), w;
2135
+ for (const b of e.plugins ?? [])
2136
+ b.install(x);
2137
+ return v.use(s), x;
1672
2138
  }
1673
- function on(e) {
2139
+ function Oa(e) {
1674
2140
  const t = {
1675
2141
  // The menu is the panel's own: it is the manifest, drawn.
1676
2142
  // The shell hands in what a choice means where it drew the menu — in the drawer it is what
1677
2143
  // closes it, and a drawer that stays open over the section it just opened is a drawer the
1678
2144
  // reader has to dismiss by hand.
1679
- nav: (a) => re(Da, { collapsed: a.collapsed === !0, onSelect: a.select })
2145
+ nav: (l) => ce(Wa, { collapsed: l.collapsed === !0, onSelect: l.select })
1680
2146
  };
1681
- return e.brand !== void 0 && (t.brand = () => re(e.brand)), e.userMenu !== void 0 && (t.user = (a) => re(e.userMenu, { expanded: a.expanded === !0 })), { render: () => re(Ga, null, t) };
2147
+ return e.brand !== void 0 && (t.brand = () => ce(e.brand)), e.userMenu !== void 0 && (t.user = (l) => ce(e.userMenu, { expanded: l.expanded === !0 })), { render: () => ce(Ba, null, t) };
1682
2148
  }
1683
- function sn() {
1684
- const e = un(vt);
2149
+ function Ha() {
2150
+ const e = Ka(xt);
1685
2151
  return e !== null ? e : typeof document < "u" && document.documentElement.lang !== "" ? document.documentElement.lang : typeof navigator > "u" ? "en" : navigator.language;
1686
2152
  }
1687
- function rn(e) {
2153
+ function ja(e) {
1688
2154
  try {
1689
- localStorage.setItem(vt, e);
2155
+ localStorage.setItem(xt, e);
1690
2156
  } catch {
1691
2157
  }
1692
2158
  }
1693
- function un(e) {
2159
+ function Ka(e) {
1694
2160
  try {
1695
2161
  return localStorage.getItem(e);
1696
2162
  } catch {
1697
2163
  return null;
1698
2164
  }
1699
2165
  }
1700
- function dn(e, t) {
1701
- typeof document > "u" || (document.documentElement.lang = e, document.documentElement.dir = t.find((a) => a.code === e)?.direction ?? "ltr");
2166
+ function qa(e, t) {
2167
+ typeof document > "u" || (document.documentElement.lang = e, document.documentElement.dir = t.find((l) => l.code === e)?.direction ?? "ltr");
1702
2168
  }
1703
- function cn() {
2169
+ function Ya() {
1704
2170
  return typeof document > "u" ? null : document.querySelector('meta[name="webx-manifest"]')?.getAttribute("content") ?? null;
1705
2171
  }
1706
- function mn(e) {
2172
+ function Xa(e) {
1707
2173
  const t = e.replace(/\r\n?/g, `
1708
2174
  `).split(`
1709
- `), a = [];
1710
- let l = 0;
1711
- for (; l < t.length; ) {
1712
- const i = t[l] ?? "";
1713
- if (i.trim() === "") {
1714
- l += 1;
2175
+ `), l = [];
2176
+ let n = 0;
2177
+ for (; n < t.length; ) {
2178
+ const o = t[n] ?? "";
2179
+ if (o.trim() === "") {
2180
+ n += 1;
1715
2181
  continue;
1716
2182
  }
1717
- if (/^```([\w-]*)\s*$/.exec(i)) {
2183
+ if (/^```([\w-]*)\s*$/.exec(o)) {
1718
2184
  const u = [];
1719
- for (l += 1; l < t.length && !/^```\s*$/.test(t[l] ?? ""); )
1720
- u.push(t[l] ?? ""), l += 1;
1721
- l += 1, a.push(`<pre><code>${We(u.join(`
2185
+ for (n += 1; n < t.length && !/^```\s*$/.test(t[n] ?? ""); )
2186
+ u.push(t[n] ?? ""), n += 1;
2187
+ n += 1, l.push(`<pre><code>${Ue(u.join(`
1722
2188
  `))}</code></pre>`);
1723
2189
  continue;
1724
2190
  }
1725
- const o = /^(#{1,4})\s+(.*)$/.exec(i);
1726
- if (o) {
1727
- const u = Math.min(o[1].length + 1, 5);
1728
- a.push(`<h${u}>${Te(o[2] ?? "")}</h${u}>`), l += 1;
2191
+ const s = /^(#{1,4})\s+(.*)$/.exec(o);
2192
+ if (s) {
2193
+ const u = Math.min(s[1].length + 1, 5);
2194
+ l.push(`<h${u}>${Le(s[2] ?? "")}</h${u}>`), n += 1;
1729
2195
  continue;
1730
2196
  }
1731
- if (me(i)) {
1732
- const u = /^\s*\d+[.)]\s+/.test(i), c = [];
1733
- for (; l < t.length && me(t[l] ?? ""); )
1734
- for (c.push((t[l] ?? "").replace(/^\s*(?:[-*+]|\d+[.)])\s+/, "")), l += 1; l < t.length; ) {
1735
- const m = t[l] ?? "";
1736
- if (m.trim() === "" || me(m) || /^(#{1,4})\s/.test(m) || /^```/.test(m))
2197
+ if (he(o)) {
2198
+ const u = /^\s*\d+[.)]\s+/.test(o), d = [];
2199
+ for (; n < t.length && he(t[n] ?? ""); )
2200
+ for (d.push((t[n] ?? "").replace(/^\s*(?:[-*+]|\d+[.)])\s+/, "")), n += 1; n < t.length; ) {
2201
+ const f = t[n] ?? "";
2202
+ if (f.trim() === "" || he(f) || /^(#{1,4})\s/.test(f) || /^```/.test(f))
1737
2203
  break;
1738
- c[c.length - 1] += ` ${m.trim()}`, l += 1;
2204
+ d[d.length - 1] += ` ${f.trim()}`, n += 1;
1739
2205
  }
1740
2206
  const h = u ? "ol" : "ul";
1741
- a.push(`<${h}>${c.map((m) => `<li>${Te(m)}</li>`).join("")}</${h}>`);
2207
+ l.push(`<${h}>${d.map((f) => `<li>${Le(f)}</li>`).join("")}</${h}>`);
1742
2208
  continue;
1743
2209
  }
1744
2210
  const r = [];
1745
- for (; l < t.length; ) {
1746
- const u = t[l] ?? "";
1747
- if (u.trim() === "" || me(u) || /^(#{1,4})\s/.test(u) || /^```/.test(u)) break;
1748
- r.push(u.trim()), l += 1;
2211
+ for (; n < t.length; ) {
2212
+ const u = t[n] ?? "";
2213
+ if (u.trim() === "" || he(u) || /^(#{1,4})\s/.test(u) || /^```/.test(u)) break;
2214
+ r.push(u.trim()), n += 1;
1749
2215
  }
1750
- a.push(`<p>${Te(r.join(" "))}</p>`);
2216
+ l.push(`<p>${Le(r.join(" "))}</p>`);
1751
2217
  }
1752
- return a.join("");
2218
+ return l.join("");
1753
2219
  }
1754
- const ce = "\0";
1755
- function me(e) {
2220
+ const pe = "\0";
2221
+ function he(e) {
1756
2222
  return /^\s*(?:[-*+]|\d+[.)])\s+/.test(e);
1757
2223
  }
1758
- function Te(e) {
1759
- const t = [], a = e.replace(/`([^`]+)`/g, (i, s) => (t.push(`<code>${We(s)}</code>`), `${ce}${t.length - 1}${ce}`));
1760
- return We(a).replace(
2224
+ function Le(e) {
2225
+ const t = [], l = e.replace(/`([^`]+)`/g, (o, i) => (t.push(`<code>${Ue(i)}</code>`), `${pe}${t.length - 1}${pe}`));
2226
+ return Ue(l).replace(
1761
2227
  /\[([^\]]+)\]\((https?:\/\/[^\s)]+)\)/g,
1762
2228
  '<a href="$2" target="_blank" rel="noopener">$1</a>'
1763
2229
  ).replace(/\*\*([^*]+)\*\*/g, "<strong>$1</strong>").replace(
1764
- new RegExp(`${ce}(\\d+)${ce}`, "g"),
1765
- (i, s) => t[Number(s)] ?? ""
2230
+ new RegExp(`${pe}(\\d+)${pe}`, "g"),
2231
+ (o, i) => t[Number(i)] ?? ""
1766
2232
  );
1767
2233
  }
1768
- function We(e) {
2234
+ function Ue(e) {
1769
2235
  return e.replace(/&/g, "&amp;").replace(/</g, "&lt;").replace(/>/g, "&gt;").replace(/"/g, "&quot;");
1770
2236
  }
1771
- function vn(e) {
1772
- const t = e.scope("webx-admin"), a = /* @__PURE__ */ new Map();
1773
- function l(s, o, r) {
1774
- const u = e.state.locale, c = `${u}:${s}`;
1775
- let h = a.get(c);
1776
- return h === void 0 && (h = new Intl.DateTimeFormat(u, o), a.set(c, h)), h.format(r);
2237
+ function Ga(e) {
2238
+ const t = e.scope("webx-admin"), l = /* @__PURE__ */ new Map();
2239
+ function n(i, s, r) {
2240
+ const u = e.state.locale, d = `${u}:${i}`;
2241
+ let h = l.get(d);
2242
+ return h === void 0 && (h = new Intl.DateTimeFormat(u, s), l.set(d, h)), h.format(r);
1777
2243
  }
1778
- const i = (s) => l("time", { hour: "2-digit", minute: "2-digit", hourCycle: "h23" }, s);
2244
+ const o = (i) => n("time", { hour: "2-digit", minute: "2-digit", hourCycle: "h23" }, i);
1779
2245
  return {
1780
- short(s) {
1781
- const o = fe(s);
1782
- if (o === null)
2246
+ short(i) {
2247
+ const s = ye(i);
2248
+ if (s === null)
1783
2249
  return t("dates.never");
1784
- const r = /* @__PURE__ */ new Date(), u = He(o, r);
1785
- return u === 0 ? t("dates.today", { time: i(o) }) : u === -1 ? t("dates.yesterday", { time: i(o) }) : o.getFullYear() === r.getFullYear() ? l(
2250
+ const r = /* @__PURE__ */ new Date(), u = Qe(s, r);
2251
+ return u === 0 ? t("dates.today", { time: o(s) }) : u === -1 ? t("dates.yesterday", { time: o(s) }) : s.getFullYear() === r.getFullYear() ? n(
1786
2252
  "this-year",
1787
2253
  {
1788
2254
  day: "numeric",
@@ -1791,156 +2257,156 @@ function vn(e) {
1791
2257
  minute: "2-digit",
1792
2258
  hourCycle: "h23"
1793
2259
  },
1794
- o
1795
- ) : l("earlier", { day: "numeric", month: "long", year: "numeric" }, o);
2260
+ s
2261
+ ) : n("earlier", { day: "numeric", month: "long", year: "numeric" }, s);
1796
2262
  },
1797
- compact(s) {
1798
- const o = fe(s);
1799
- if (o === null)
2263
+ compact(i) {
2264
+ const s = ye(i);
2265
+ if (s === null)
1800
2266
  return t("dates.never");
1801
2267
  const r = /* @__PURE__ */ new Date();
1802
- return He(o, r) === 0 ? i(o) : o.getFullYear() === r.getFullYear() ? l("compact", { day: "numeric", month: "short" }, o) : l("compact-earlier", { dateStyle: "short" }, o);
2268
+ return Qe(s, r) === 0 ? o(s) : s.getFullYear() === r.getFullYear() ? n("compact", { day: "numeric", month: "short" }, s) : n("compact-earlier", { dateStyle: "short" }, s);
1803
2269
  },
1804
- exact(s) {
1805
- const o = fe(s);
1806
- return o === null ? "" : l("exact", { dateStyle: "long", timeStyle: "medium", hourCycle: "h23" }, o);
2270
+ exact(i) {
2271
+ const s = ye(i);
2272
+ return s === null ? "" : n("exact", { dateStyle: "long", timeStyle: "medium", hourCycle: "h23" }, s);
1807
2273
  },
1808
- iso(s) {
1809
- const o = fe(s);
1810
- return o === null ? "" : o.toISOString();
2274
+ iso(i) {
2275
+ const s = ye(i);
2276
+ return s === null ? "" : s.toISOString();
1811
2277
  }
1812
2278
  };
1813
2279
  }
1814
- function ft() {
1815
- const e = ne(we, null);
1816
- return vn(e ?? fn());
2280
+ function kt() {
2281
+ const e = se(Ce, null);
2282
+ return Ga(e ?? Ja());
1817
2283
  }
1818
- let ve = null;
1819
- function fn() {
1820
- return ve === null && (ve = Ee(), ve.defaults("webx-admin", mt)), ve;
2284
+ let ge = null;
2285
+ function Ja() {
2286
+ return ge === null && (ge = Pe(), ge.defaults("webx-admin", wt)), ge;
1821
2287
  }
1822
- function fe(e) {
2288
+ function ye(e) {
1823
2289
  if (e == null || e === "")
1824
2290
  return null;
1825
2291
  const t = e instanceof Date ? e : new Date(e);
1826
2292
  return Number.isNaN(t.getTime()) ? null : t;
1827
2293
  }
1828
- function He(e, t) {
1829
- const a = (l) => Date.UTC(l.getFullYear(), l.getMonth(), l.getDate());
1830
- return Math.round((a(e) - a(t)) / 864e5);
2294
+ function Qe(e, t) {
2295
+ const l = (n) => Date.UTC(n.getFullYear(), n.getMonth(), n.getDate());
2296
+ return Math.round((l(e) - l(t)) / 864e5);
1831
2297
  }
1832
- function pn(e, t, a) {
1833
- const l = e instanceof Ce ? e.status : hn(e);
1834
- if (l === 422)
1835
- return gn(e) ?? a ?? t("errors.unknown");
1836
- if (l === 401) return t("errors.signed-out");
1837
- if (l === 403) return t("errors.forbidden");
1838
- if (l === 404) return t("errors.gone");
1839
- if (l === 409) return t("errors.conflict");
1840
- if (l === 429) {
1841
- const i = e instanceof Ce ? e.retryAfter : null;
1842
- return i === null ? t("errors.throttled") : t("errors.throttled-in", { seconds: i });
2298
+ function Qa(e, t, l) {
2299
+ const n = e instanceof fe ? e.status : Za(e);
2300
+ if (n === 422)
2301
+ return en(e) ?? l ?? t("errors.unknown");
2302
+ if (n === 401) return t("errors.signed-out");
2303
+ if (n === 403) return t("errors.forbidden");
2304
+ if (n === 404) return t("errors.gone");
2305
+ if (n === 409) return t("errors.conflict");
2306
+ if (n === 429) {
2307
+ const o = e instanceof fe ? e.retryAfter : null;
2308
+ return o === null ? t("errors.throttled") : t("errors.throttled-in", { seconds: o });
1843
2309
  }
1844
- return l !== null && l >= 500 ? t("errors.server") : l === null ? t("errors.offline") : a ?? t("errors.unknown");
2310
+ return n !== null && n >= 500 ? t("errors.server") : n === null ? t("errors.offline") : l ?? t("errors.unknown");
1845
2311
  }
1846
- function Re() {
1847
- const e = P("webx-admin");
1848
- return (t, a) => pn(t, e, a);
2312
+ function De() {
2313
+ const e = D("webx-admin");
2314
+ return (t, l) => Qa(t, e, l);
1849
2315
  }
1850
- function hn(e) {
2316
+ function Za(e) {
1851
2317
  const t = e?.status;
1852
2318
  return typeof t == "number" ? t : null;
1853
2319
  }
1854
- function gn(e) {
1855
- const a = e?.body?.message;
1856
- return typeof a == "string" && a !== "" ? a : null;
2320
+ function en(e) {
2321
+ const l = e?.body?.message;
2322
+ return typeof l == "string" && l !== "" ? l : null;
1857
2323
  }
1858
- function yn(e, t, a) {
1859
- const l = `${e.apiPath}/entities/${t}/${a}/notes`, i = (o) => `${e.apiPath}/notes/${o}`, s = (o) => o.data;
2324
+ function tn(e, t, l) {
2325
+ const n = `${e.apiPath}/entities/${t}/${l}/notes`, o = (s) => `${e.apiPath}/notes/${s}`, i = (s) => s.data;
1860
2326
  return {
1861
- list: () => e.http.get(l).then(s),
1862
- add: (o) => e.http.post(l, { body: o }).then(s),
1863
- save: (o, r) => e.http.put(i(o), { body: r }).then(s),
1864
- remove: (o) => e.http.delete(i(o)).then(() => {
2327
+ list: () => e.http.get(n).then(i),
2328
+ add: (s) => e.http.post(n, { body: s }).then(i),
2329
+ save: (s, r) => e.http.put(o(s), { body: r }).then(i),
2330
+ remove: (s) => e.http.delete(o(s)).then(() => {
1865
2331
  })
1866
2332
  };
1867
2333
  }
1868
- const pt = /* @__PURE__ */ Symbol("wx-category-editor");
1869
- function bn(e) {
1870
- Xe(pt, e);
2334
+ const _t = /* @__PURE__ */ Symbol("wx-category-editor");
2335
+ function ln(e) {
2336
+ ze(_t, e);
1871
2337
  }
1872
- function Zn() {
1873
- return ne(pt, null);
2338
+ function Bn() {
2339
+ return se(_t, null);
1874
2340
  }
1875
- function wn(e) {
2341
+ function an(e) {
1876
2342
  return (e.q ?? "").trim() !== "" || e.filtered ? "locked" : e.category == null ? "all" : "category";
1877
2343
  }
1878
- function el(e, t) {
1879
- const a = X(), l = P("webx-admin"), i = x(() => wn(t()));
2344
+ function Mn(e, t) {
2345
+ const l = J(), n = D("webx-admin"), o = g(() => an(t()));
1880
2346
  return {
1881
- mode: i,
1882
- sortable: x(() => i.value !== "locked"),
1883
- hint: x(() => l(`categories.order-${i.value}`)),
1884
- move: (s) => na(a, e, s, i.value === "category" ? t().category ?? null : null)
2347
+ mode: o,
2348
+ sortable: g(() => o.value !== "locked"),
2349
+ hint: g(() => n(`categories.order-${o.value}`)),
2350
+ move: (i) => fl(l, e, i, o.value === "category" ? t().category ?? null : null)
1885
2351
  };
1886
2352
  }
1887
- function Ne(e = {}) {
1888
- const t = P("webx-admin");
1889
- return (a, l) => t(e[a] ?? `webx-admin::categories.${a}`, l);
2353
+ function Oe(e = {}) {
2354
+ const t = D("webx-admin");
2355
+ return (l, n) => t(e[l] ?? `webx-admin::categories.${l}`, n);
1890
2356
  }
1891
- const xn = /* @__PURE__ */ R({
2357
+ const nn = /* @__PURE__ */ M({
1892
2358
  name: "WxCategoryCreateDialog",
1893
2359
  __name: "CategoryCreateDialog",
1894
2360
  props: {
1895
2361
  options: {}
1896
2362
  },
1897
2363
  setup(e) {
1898
- const t = e, { open: a, resolve: l, dismiss: i } = Mt(), s = xe(X(), t.options.api), o = Ne(t.options.words), r = W(""), u = W(!1), c = W({}), h = Ye("field");
1899
- Le(async () => {
1900
- await Je(), h.value?.querySelector("input")?.focus();
2364
+ const t = e, { open: l, resolve: n, dismiss: o } = Jt(), i = ve(J(), t.options.api), s = Oe(t.options.words), r = L(""), u = L(!1), d = L({}), h = lt("field");
2365
+ Ee(async () => {
2366
+ await Ie(), h.value?.querySelector("input")?.focus();
1901
2367
  });
1902
- function m(d) {
1903
- const w = Object.keys(c.value).find((f) => f === d || f.startsWith(`${d}.`));
1904
- return w === void 0 ? void 0 : c.value[w]?.[0];
2368
+ function f(c) {
2369
+ const x = Object.keys(d.value).find((p) => p === c || p.startsWith(`${c}.`));
2370
+ return x === void 0 ? void 0 : d.value[x]?.[0];
1905
2371
  }
1906
2372
  async function v() {
1907
2373
  if (!(r.value.trim() === "" || u.value)) {
1908
- u.value = !0, c.value = {};
2374
+ u.value = !0, d.value = {};
1909
2375
  try {
1910
- l(await s.create({ title: r.value.trim() }));
1911
- } catch (d) {
1912
- c.value = d.body?.errors ?? {};
2376
+ n(await i.create({ title: r.value.trim() }));
2377
+ } catch (c) {
2378
+ d.value = c.body?.errors ?? {};
1913
2379
  } finally {
1914
2380
  u.value = !1;
1915
2381
  }
1916
2382
  }
1917
2383
  }
1918
- return (d, w) => (p(), $(n(lt), {
1919
- open: n(a),
1920
- "onUpdate:open": w[2] || (w[2] = (f) => Ge(a) ? a.value = f : null),
1921
- title: n(o)("new"),
2384
+ return (c, x) => (m(), S(a(rt), {
2385
+ open: a(l),
2386
+ "onUpdate:open": x[2] || (x[2] = (p) => at(l) ? l.value = p : null),
2387
+ title: a(s)("new"),
1922
2388
  width: 440
1923
2389
  }, {
1924
- footer: g(() => [
1925
- b(n(Ot), { size: "sm" }, {
1926
- default: g(() => [
1927
- b(n(Z), {
2390
+ footer: y(() => [
2391
+ w(a(Zt), { size: "sm" }, {
2392
+ default: y(() => [
2393
+ w(a(le), {
1928
2394
  variant: "outline",
1929
- onClick: w[1] || (w[1] = (f) => n(i)())
2395
+ onClick: x[1] || (x[1] = (p) => a(o)())
1930
2396
  }, {
1931
- default: g(() => [
1932
- V(L(n(o)("cancel")), 1)
2397
+ default: y(() => [
2398
+ z(A(a(s)("cancel")), 1)
1933
2399
  ]),
1934
2400
  _: 1
1935
2401
  }),
1936
- b(n(Z), {
2402
+ w(a(le), {
1937
2403
  type: "primary",
1938
2404
  loading: u.value,
1939
2405
  disabled: r.value.trim() === "",
1940
2406
  onClick: v
1941
2407
  }, {
1942
- default: g(() => [
1943
- V(L(n(o)("create")), 1)
2408
+ default: y(() => [
2409
+ z(A(a(s)("create")), 1)
1944
2410
  ]),
1945
2411
  _: 1
1946
2412
  }, 8, ["loading", "disabled"])
@@ -1948,22 +2414,22 @@ const xn = /* @__PURE__ */ R({
1948
2414
  _: 1
1949
2415
  })
1950
2416
  ]),
1951
- default: g(() => [
1952
- b(n(Ft), {
1953
- label: n(o)("field-title"),
1954
- error: m("title") ?? m("slug"),
2417
+ default: y(() => [
2418
+ w(a(Qt), {
2419
+ label: a(s)("field-title"),
2420
+ error: f("title") ?? f("slug"),
1955
2421
  required: ""
1956
2422
  }, {
1957
- default: g(() => [
1958
- O("div", {
2423
+ default: y(() => [
2424
+ B("div", {
1959
2425
  ref_key: "field",
1960
2426
  ref: h
1961
2427
  }, [
1962
- b(n(ye), {
2428
+ w(a(Te), {
1963
2429
  modelValue: r.value,
1964
- "onUpdate:modelValue": w[0] || (w[0] = (f) => r.value = f),
1965
- "aria-label": n(o)("field-title"),
1966
- onKeyup: Qe(v, ["enter"])
2430
+ "onUpdate:modelValue": x[0] || (x[0] = (p) => r.value = p),
2431
+ "aria-label": a(s)("field-title"),
2432
+ onKeyup: nt(v, ["enter"])
1967
2433
  }, null, 8, ["modelValue", "aria-label"])
1968
2434
  ], 512)
1969
2435
  ]),
@@ -1973,135 +2439,136 @@ const xn = /* @__PURE__ */ R({
1973
2439
  _: 1
1974
2440
  }, 8, ["open", "title"]));
1975
2441
  }
1976
- }), kn = { class: "wx-category-row__name" }, _n = /* @__PURE__ */ R({
2442
+ }), on = { class: "wx-category-row__name" }, sn = /* @__PURE__ */ M({
1977
2443
  name: "WxCategoriesPage",
1978
2444
  __name: "CategoriesPage",
1979
2445
  props: {
1980
2446
  options: {}
1981
2447
  },
1982
2448
  setup(e) {
1983
- const t = e, a = X(), l = xe(a, t.options.api), i = ge(), s = Ne(t.options.words), o = Re(), r = W([]), u = W(!0), c = x(() => a.can(t.options.manage)), h = x(
1984
- () => a.state.manifest?.modules.find((S) => S.id === t.options.module)?.title ?? ""
1985
- ), m = Ht(xn), v = x(
1986
- () => c.value ? [{ key: "new", label: s("new"), icon: "plus", primary: !0, run: () => {
1987
- y();
2449
+ const t = e, l = J(), n = ve(l, t.options.api), o = _e(), i = Oe(t.options.words), s = De(), r = L([]), u = L(!0), d = L(!0), h = g(() => l.can(t.options.manage)), f = g(
2450
+ () => l.state.manifest?.modules.find((V) => V.id === t.options.module)?.title ?? ""
2451
+ ), v = el(nn), c = g(
2452
+ () => h.value ? [{ key: "new", label: i("new"), icon: "plus", primary: !0, run: () => {
2453
+ T();
1988
2454
  } }] : []
1989
2455
  );
1990
- function d(S) {
1991
- return Number(S[t.options.count] ?? 0);
2456
+ function x(V) {
2457
+ return Number(V[t.options.count] ?? 0);
1992
2458
  }
1993
- async function w() {
2459
+ async function p() {
1994
2460
  u.value = !0;
1995
2461
  try {
1996
- r.value = (await l.list()).data;
1997
- } catch (S) {
1998
- D.danger(o(S));
2462
+ const V = await n.list();
2463
+ r.value = V.data, d.value = V.prefix !== null;
2464
+ } catch (V) {
2465
+ K.danger(s(V));
1999
2466
  } finally {
2000
2467
  u.value = !1;
2001
2468
  }
2002
2469
  }
2003
- w();
2004
- function f(S) {
2005
- i.push(`${t.options.path}/${S.id}`);
2470
+ p();
2471
+ function b(V) {
2472
+ o.push(`${t.options.path}/${V.id}`);
2006
2473
  }
2007
- async function y() {
2008
- const S = await m({ options: t.options });
2009
- S !== void 0 && f(S);
2474
+ async function T() {
2475
+ const V = await v({ options: t.options });
2476
+ V !== void 0 && b(V);
2010
2477
  }
2011
- async function k(S) {
2012
- if (d(S) > 0) {
2013
- D.warning(s("delete-blocked"));
2478
+ async function F(V) {
2479
+ if (x(V) > 0) {
2480
+ K.warning(i("delete-blocked"));
2014
2481
  return;
2015
2482
  }
2016
- if (await he({
2017
- title: s("delete-title", { name: S.name }),
2018
- message: s("delete-text"),
2019
- confirmText: s("delete"),
2020
- cancelText: s("cancel"),
2483
+ if (await xe({
2484
+ title: i("delete-title", { name: V.name }),
2485
+ message: i("delete-text"),
2486
+ confirmText: i("delete"),
2487
+ cancelText: i("cancel"),
2021
2488
  tone: "danger"
2022
2489
  }))
2023
2490
  try {
2024
- await l.remove(S.id), D.success(s("deleted")), await w();
2491
+ await n.remove(V.id), K.success(i("deleted")), await p();
2025
2492
  } catch (C) {
2026
- D.danger(o(C));
2493
+ K.danger(s(C));
2027
2494
  }
2028
2495
  }
2029
- function M(S) {
2030
- const B = [{ key: "edit", label: s("edit"), icon: "edit", run: () => f(S) }], C = t.options.items;
2031
- return C && d(S) > 0 && B.push({
2496
+ function Q(V) {
2497
+ const k = [{ key: "edit", label: i("edit"), icon: "edit", run: () => b(V) }], C = t.options.items;
2498
+ return C && x(V) > 0 && k.push({
2032
2499
  key: "items",
2033
- label: s("show-items"),
2500
+ label: i("show-items"),
2034
2501
  icon: "file-txt",
2035
2502
  run: () => {
2036
- i.push(C(S.id));
2503
+ o.push(C(V.id));
2037
2504
  }
2038
- }), S.url && S.is_visible && B.push({ key: "site", label: s("open-on-site"), icon: "link", href: S.url }), c.value && B.push({
2505
+ }), V.url && V.is_visible && k.push({ key: "site", label: i("open-on-site"), icon: "link", href: V.url }), h.value && k.push({
2039
2506
  key: "delete",
2040
- label: s("delete"),
2507
+ label: i("delete"),
2041
2508
  icon: "trash",
2042
2509
  danger: !0,
2043
2510
  run: () => {
2044
- k(S);
2511
+ F(V);
2045
2512
  }
2046
- }), B;
2513
+ }), k;
2047
2514
  }
2048
- async function J() {
2515
+ async function H() {
2049
2516
  try {
2050
- await l.reorder(r.value.map((S) => S.id));
2051
- } catch (S) {
2052
- D.danger(o(S, s("reorder-failed"))), await w();
2517
+ await n.reorder(r.value.map((V) => V.id));
2518
+ } catch (V) {
2519
+ K.danger(s(V, i("reorder-failed"))), await p();
2053
2520
  }
2054
2521
  }
2055
- return (S, B) => {
2056
- const C = j("router-link");
2057
- return p(), $(rt, {
2522
+ return (V, k) => {
2523
+ const C = X("router-link");
2524
+ return m(), S(ht, {
2058
2525
  class: "wx-categories",
2059
- title: h.value,
2060
- actions: v.value,
2526
+ title: f.value,
2527
+ actions: c.value,
2061
2528
  padding: "sm"
2062
2529
  }, {
2063
- default: g(() => [
2064
- u.value ? (p(), $(n(ue), {
2530
+ default: y(() => [
2531
+ u.value ? (m(), S(a(me), {
2065
2532
  key: 0,
2066
2533
  class: "wx-categories__loading",
2067
2534
  rows: 5
2068
- })) : r.value.length === 0 ? (p(), $(n(ot), {
2535
+ })) : r.value.length === 0 ? (m(), S(a(ut), {
2069
2536
  key: 1,
2070
- title: n(s)("empty"),
2071
- description: n(s)("empty-help")
2072
- }, null, 8, ["title", "description"])) : (p(), T(H, { key: 2 }, [
2073
- b(n(tt), {
2537
+ title: a(i)("empty"),
2538
+ description: a(i)("empty-help")
2539
+ }, null, 8, ["title", "description"])) : (m(), $(j, { key: 2 }, [
2540
+ w(a(Be), {
2074
2541
  modelValue: r.value,
2075
- "onUpdate:modelValue": B[0] || (B[0] = (A) => r.value = A),
2542
+ "onUpdate:modelValue": k[0] || (k[0] = (_) => r.value = _),
2076
2543
  class: "wx-categories__list",
2077
2544
  plain: "",
2078
2545
  "item-key": "id",
2079
- "item-label": (A) => A.name,
2080
- disabled: !c.value,
2081
- onMove: J
2546
+ "item-label": (_) => _.name,
2547
+ disabled: !h.value,
2548
+ onMove: H
2082
2549
  }, {
2083
- default: g(({ item: A }) => [
2084
- b(C, {
2085
- class: ae(["wx-category-row", { "is-hidden": !A.is_visible }]),
2086
- to: `${t.options.path}/${A.id}`
2550
+ default: y(({ item: _ }) => [
2551
+ w(C, {
2552
+ class: oe(["wx-category-row", { "is-hidden": !_.is_visible }]),
2553
+ to: `${t.options.path}/${_.id}`
2087
2554
  }, {
2088
- default: g(() => [
2089
- O("span", kn, [
2090
- b(n(G), {
2555
+ default: y(() => [
2556
+ B("span", on, [
2557
+ w(a(ee), {
2091
2558
  truncate: "",
2092
2559
  weight: "medium"
2093
2560
  }, {
2094
- default: g(() => [
2095
- V(L(A.name), 1)
2561
+ default: y(() => [
2562
+ z(A(_.name), 1)
2096
2563
  ]),
2097
2564
  _: 2
2098
2565
  }, 1024),
2099
- A.is_visible ? U("", !0) : (p(), $(n(st), {
2566
+ _.is_visible ? N("", !0) : (m(), S(a(dt), {
2100
2567
  key: 0,
2101
- content: n(s)("hidden")
2568
+ content: a(i)("hidden")
2102
2569
  }, {
2103
- default: g(() => [
2104
- b(n(Ve), {
2570
+ default: y(() => [
2571
+ w(a(Me), {
2105
2572
  name: "eye-off",
2106
2573
  size: "sm"
2107
2574
  })
@@ -2109,42 +2576,43 @@ const xn = /* @__PURE__ */ R({
2109
2576
  _: 1
2110
2577
  }, 8, ["content"]))
2111
2578
  ]),
2112
- b(n(G), {
2579
+ d.value ? (m(), S(a(ee), {
2580
+ key: 0,
2113
2581
  size: "sm",
2114
2582
  tone: "muted",
2115
2583
  truncate: ""
2116
2584
  }, {
2117
- default: g(() => [
2118
- V(L(A.path === null ? n(s)("no-address") : `/${A.path}`), 1)
2585
+ default: y(() => [
2586
+ z(A(_.path === null ? a(i)("no-address") : `/${_.path}`), 1)
2119
2587
  ]),
2120
2588
  _: 2
2121
- }, 1024)
2589
+ }, 1024)) : N("", !0)
2122
2590
  ]),
2123
2591
  _: 2
2124
2592
  }, 1032, ["class", "to"])
2125
2593
  ]),
2126
- actions: g(({ item: A }) => [
2127
- b(n(G), {
2594
+ actions: y(({ item: _ }) => [
2595
+ w(a(ee), {
2128
2596
  class: "wx-category-row__count",
2129
2597
  size: "sm",
2130
2598
  tone: "muted"
2131
2599
  }, {
2132
- default: g(() => [
2133
- V(L(n(s)("count", { count: d(A) })), 1)
2600
+ default: y(() => [
2601
+ z(A(a(i)("count", { count: x(_) })), 1)
2134
2602
  ]),
2135
2603
  _: 2
2136
2604
  }, 1024),
2137
- b(Ue, {
2138
- actions: M(A),
2139
- label: A.name
2605
+ w(Fe, {
2606
+ actions: Q(_),
2607
+ label: _.name
2140
2608
  }, null, 8, ["actions", "label"])
2141
2609
  ]),
2142
2610
  _: 1
2143
2611
  }, 8, ["modelValue", "item-label", "disabled"]),
2144
- b(n(be), {
2612
+ w(a(Se), {
2145
2613
  class: "wx-categories__note",
2146
2614
  type: "info",
2147
- description: n(s)("order")
2615
+ description: a(i)("order")
2148
2616
  }, null, 8, ["description"])
2149
2617
  ], 64))
2150
2618
  ]),
@@ -2152,45 +2620,45 @@ const xn = /* @__PURE__ */ R({
2152
2620
  }, 8, ["title", "actions"]);
2153
2621
  };
2154
2622
  }
2155
- }), $n = {
2623
+ }), rn = {
2156
2624
  class: "wx-save-state",
2157
2625
  role: "status",
2158
2626
  "aria-live": "polite"
2159
- }, Tn = /* @__PURE__ */ R({
2627
+ }, un = /* @__PURE__ */ M({
2160
2628
  __name: "SaveState",
2161
2629
  props: {
2162
2630
  state: {},
2163
2631
  linger: { default: 2e3 }
2164
2632
  },
2165
2633
  setup(e) {
2166
- const t = e, a = P("webx-admin"), l = W(!1);
2167
- let i = null;
2168
- ee(
2634
+ const t = e, l = D("webx-admin"), n = L(!1);
2635
+ let o = null;
2636
+ te(
2169
2637
  () => t.state,
2170
- (o, r) => {
2171
- i !== null && clearTimeout(i), l.value = r === "saving" && o === "saved", l.value && (i = window.setTimeout(() => {
2172
- l.value = !1, i = null;
2638
+ (s, r) => {
2639
+ o !== null && clearTimeout(o), n.value = r === "saving" && s === "saved", n.value && (o = window.setTimeout(() => {
2640
+ n.value = !1, o = null;
2173
2641
  }, t.linger));
2174
2642
  }
2175
2643
  );
2176
- const s = x(
2177
- () => t.state === "saving" ? "saving" : l.value ? "saved" : null
2644
+ const i = g(
2645
+ () => t.state === "saving" ? "saving" : n.value ? "saved" : null
2178
2646
  );
2179
- return Ze(() => {
2180
- i !== null && clearTimeout(i);
2181
- }), (o, r) => (p(), T("span", $n, [
2182
- s.value ? (p(), $(n(Ve), {
2647
+ return ot(() => {
2648
+ o !== null && clearTimeout(o);
2649
+ }), (s, r) => (m(), $("span", rn, [
2650
+ i.value ? (m(), S(a(Me), {
2183
2651
  key: 0,
2184
- class: ae(["wx-save-state__mark", { "is-saved": s.value === "saved" }]),
2185
- name: s.value === "saving" ? "loader" : "check",
2186
- spin: s.value === "saving",
2187
- label: n(a)(`editor.${s.value}`)
2188
- }, null, 8, ["class", "name", "spin", "label"])) : U("", !0)
2652
+ class: oe(["wx-save-state__mark", { "is-saved": i.value === "saved" }]),
2653
+ name: i.value === "saving" ? "loader" : "check",
2654
+ spin: i.value === "saving",
2655
+ label: a(l)(`editor.${i.value}`)
2656
+ }, null, 8, ["class", "name", "spin", "label"])) : N("", !0)
2189
2657
  ]));
2190
2658
  }
2191
- }), Sn = /* @__PURE__ */ Y(Tn, [["__scopeId", "data-v-216e5e44"]]), Cn = { class: "wx-screen-host" }, Wn = /* @__PURE__ */ R({
2659
+ }), dn = /* @__PURE__ */ G(un, [["__scopeId", "data-v-216e5e44"]]), cn = { class: "wx-screen-host" }, mn = /* @__PURE__ */ M({
2192
2660
  __name: "Screen",
2193
- props: /* @__PURE__ */ oe({
2661
+ props: /* @__PURE__ */ ne({
2194
2662
  name: {},
2195
2663
  errors: { default: void 0 },
2196
2664
  disabled: { type: Boolean, default: !1 },
@@ -2201,39 +2669,39 @@ const xn = /* @__PURE__ */ R({
2201
2669
  modelValue: { default: () => ({}) },
2202
2670
  modelModifiers: {}
2203
2671
  }),
2204
- emits: /* @__PURE__ */ oe(["loaded"], ["update:modelValue"]),
2205
- setup(e, { expose: t, emit: a }) {
2206
- const l = e, i = a, s = de(e, "modelValue"), o = X(), r = P("webx-admin"), u = W(null), c = W(null);
2672
+ emits: /* @__PURE__ */ ne(["loaded"], ["update:modelValue"]),
2673
+ setup(e, { expose: t, emit: l }) {
2674
+ const n = e, o = l, i = re(e, "modelValue"), s = J(), r = D("webx-admin"), u = L(null), d = L(null);
2207
2675
  async function h() {
2208
- u.value = null, c.value = null;
2676
+ u.value = null, d.value = null;
2209
2677
  try {
2210
- const m = await o.loadScreen(l.name);
2211
- u.value = m, i("loaded", m);
2212
- } catch (m) {
2213
- c.value = m instanceof Error ? m.message : String(m);
2678
+ const f = await s.loadScreen(n.name);
2679
+ u.value = f, o("loaded", f);
2680
+ } catch (f) {
2681
+ d.value = f instanceof Error ? f.message : String(f);
2214
2682
  }
2215
2683
  }
2216
- return ee([() => l.name, () => o.i18n.state.locale], () => {
2684
+ return te([() => n.name, () => s.i18n.state.locale], () => {
2217
2685
  h();
2218
- }, { immediate: !0 }), t({ reload: h }), (m, v) => (p(), T("div", Cn, [
2219
- c.value ? (p(), $(n(be), {
2686
+ }, { immediate: !0 }), t({ reload: h }), (f, v) => (m(), $("div", cn, [
2687
+ d.value ? (m(), S(a(Se), {
2220
2688
  key: 0,
2221
2689
  type: "danger",
2222
- title: n(r)("shell.error-title"),
2223
- description: c.value
2224
- }, null, 8, ["title", "description"])) : u.value === null ? (p(), $(n(ue), {
2690
+ title: a(r)("shell.error-title"),
2691
+ description: d.value
2692
+ }, null, 8, ["title", "description"])) : u.value === null ? (m(), S(a(me), {
2225
2693
  key: 1,
2226
2694
  rows: 4
2227
- })) : (p(), $(n(Zt), {
2695
+ })) : (m(), S(a(ul), {
2228
2696
  key: 2,
2229
- modelValue: s.value,
2230
- "onUpdate:modelValue": v[0] || (v[0] = (d) => s.value = d),
2697
+ modelValue: i.value,
2698
+ "onUpdate:modelValue": v[0] || (v[0] = (c) => i.value = c),
2231
2699
  root: u.value,
2232
- patch: n(o).screenPatch(e.name),
2233
- types: n(o).types,
2700
+ patch: a(s).screenPatch(e.name),
2701
+ types: a(s).types,
2234
2702
  errors: e.errors,
2235
- translate: n(o).i18n.t,
2236
- can: n(o).can,
2703
+ translate: a(s).i18n.t,
2704
+ can: a(s).can,
2237
2705
  disabled: e.disabled,
2238
2706
  "label-position": e.labelPosition,
2239
2707
  "label-width": e.labelWidth,
@@ -2241,141 +2709,141 @@ const xn = /* @__PURE__ */ R({
2241
2709
  }, null, 8, ["modelValue", "root", "patch", "types", "errors", "translate", "can", "disabled", "label-position", "label-width", "size"]))
2242
2710
  ]));
2243
2711
  }
2244
- }), Ln = /* @__PURE__ */ R({
2712
+ }), fn = /* @__PURE__ */ M({
2245
2713
  name: "WxCategoryEditorPage",
2246
2714
  __name: "CategoryEditorPage",
2247
2715
  props: {
2248
2716
  options: {}
2249
2717
  },
2250
2718
  setup(e) {
2251
- const t = e, a = X(), l = xe(a, t.options.api), i = et(), s = ge(), o = nt(), r = Ne(t.options.words), u = Re(), c = x(() => Number(i.params.id)), h = x(() => t.options.path), m = W(null), v = W({}), d = W(null), w = W(""), f = W(!0), y = W(!1), k = W({}), M = x(() => a.can(t.options.manage)), J = x(() => JSON.stringify(v.value)), S = x(() => w.value !== "" && J.value !== w.value), B = x(() => y.value ? "saving" : S.value ? "unsaved" : "saved"), C = x(
2252
- () => a.state.manifest?.modules.find((z) => z.id === t.options.module)?.title ?? ""
2253
- ), A = x(() => {
2254
- const z = v.value.title;
2255
- return jt(z, o.active.value, m.value?.name ?? "") || r("untitled");
2719
+ const t = e, l = J(), n = ve(l, t.options.api), o = st(), i = _e(), s = it(), r = Oe(t.options.words), u = De(), d = g(() => Number(o.params.id)), h = g(() => t.options.path), f = L(null), v = L({}), c = L(null), x = L(""), p = L(!0), b = L(!1), T = L({}), F = g(() => l.can(t.options.manage)), Q = g(() => JSON.stringify(v.value)), H = g(() => x.value !== "" && Q.value !== x.value), V = g(() => b.value ? "saving" : H.value ? "unsaved" : "saved"), k = g(
2720
+ () => l.state.manifest?.modules.find((E) => E.id === t.options.module)?.title ?? ""
2721
+ ), C = g(() => {
2722
+ const E = v.value.title;
2723
+ return tl(E, s.active.value, f.value?.name ?? "") || r("untitled");
2256
2724
  });
2257
- bn({ category: m, values: v, prefix: d, moving: () => r("address-moving") }), Aa({
2725
+ ln({ category: f, values: v, prefix: c, moving: () => r("address-moving") }), ya({
2258
2726
  values: v,
2259
- prefix: d,
2260
- path: x(() => m.value?.path),
2727
+ prefix: c,
2728
+ path: g(() => f.value?.path),
2261
2729
  moving: () => r("address-moving")
2262
2730
  });
2263
- function E(z) {
2264
- m.value = z.category, v.value = z.values, d.value = z.prefix, w.value = JSON.stringify(z.values);
2731
+ function _(E) {
2732
+ f.value = E.category, v.value = E.values, c.value = E.prefix, x.value = JSON.stringify(E.values);
2265
2733
  }
2266
- async function K() {
2267
- f.value = !0;
2734
+ async function q() {
2735
+ p.value = !0;
2268
2736
  try {
2269
- E(await l.get(c.value));
2270
- } catch (z) {
2271
- D.danger(u(z)), s.push(h.value);
2737
+ _(await n.get(d.value));
2738
+ } catch (E) {
2739
+ K.danger(u(E)), i.push(h.value);
2272
2740
  } finally {
2273
- f.value = !1;
2741
+ p.value = !1;
2274
2742
  }
2275
2743
  }
2276
- async function le() {
2277
- if (!(!m.value || y.value || !M.value)) {
2278
- y.value = !0, k.value = {};
2744
+ async function R() {
2745
+ if (!(!f.value || b.value || !F.value)) {
2746
+ b.value = !0, T.value = {};
2279
2747
  try {
2280
- E(await l.save(m.value.id, v.value)), D.success(r("saved"));
2281
- } catch (z) {
2282
- const q = z.body;
2283
- q?.errors ? (k.value = q.errors, D.danger(r("save-failed"))) : D.danger(u(z));
2748
+ _(await n.save(f.value.id, v.value)), K.success(r("saved"));
2749
+ } catch (E) {
2750
+ const Z = E.body;
2751
+ Z?.errors ? (T.value = Z.errors, K.danger(r("save-failed"))) : K.danger(u(E));
2284
2752
  } finally {
2285
- y.value = !1;
2753
+ b.value = !1;
2286
2754
  }
2287
2755
  }
2288
2756
  }
2289
- async function ie() {
2290
- const z = m.value;
2291
- if (!(!z || !await he({
2292
- title: r("delete-title", { name: z.name }),
2757
+ async function U() {
2758
+ const E = f.value;
2759
+ if (!(!E || !await xe({
2760
+ title: r("delete-title", { name: E.name }),
2293
2761
  message: r("delete-text"),
2294
2762
  confirmText: r("delete"),
2295
2763
  cancelText: r("cancel"),
2296
2764
  tone: "danger"
2297
2765
  })))
2298
2766
  try {
2299
- await l.remove(z.id), D.success(r("deleted")), w.value = J.value, s.push(h.value);
2300
- } catch (_) {
2301
- D.danger(u(_));
2767
+ await n.remove(E.id), K.success(r("deleted")), x.value = Q.value, i.push(h.value);
2768
+ } catch (W) {
2769
+ K.danger(u(W));
2302
2770
  }
2303
2771
  }
2304
- function te(z) {
2305
- S.value && z.preventDefault();
2772
+ function I(E) {
2773
+ H.value && E.preventDefault();
2306
2774
  }
2307
- function ke(z) {
2308
- (z.ctrlKey || z.metaKey) && z.key.toLowerCase() === "s" && (z.preventDefault(), S.value && le());
2775
+ function de(E) {
2776
+ (E.ctrlKey || E.metaKey) && E.key.toLowerCase() === "s" && (E.preventDefault(), H.value && R());
2309
2777
  }
2310
- ee(c, () => {
2311
- K();
2312
- }), Le(() => {
2313
- K(), window.addEventListener("beforeunload", te);
2314
- }), Ze(() => {
2315
- window.removeEventListener("beforeunload", te);
2316
- }), St(async () => !S.value || !M.value ? !0 : await he({
2778
+ te(d, () => {
2779
+ q();
2780
+ }), Ee(() => {
2781
+ q(), window.addEventListener("beforeunload", I);
2782
+ }), ot(() => {
2783
+ window.removeEventListener("beforeunload", I);
2784
+ }), zt(async () => !H.value || !F.value ? !0 : await xe({
2317
2785
  title: r("leave-title"),
2318
2786
  message: r("leave-text"),
2319
2787
  confirmText: r("leave"),
2320
2788
  cancelText: r("cancel"),
2321
2789
  tone: "danger"
2322
2790
  }));
2323
- const _e = x(() => {
2324
- const z = m.value, q = [];
2325
- return z && (z.url && z.is_visible && q.push({ key: "site", label: r("open-on-site"), icon: "link", href: z.url }), M.value && q.push({
2791
+ const ie = g(() => {
2792
+ const E = f.value, Z = [];
2793
+ return E && (E.url && E.is_visible && Z.push({ key: "site", label: r("open-on-site"), icon: "link", href: E.url }), F.value && Z.push({
2326
2794
  key: "delete",
2327
2795
  label: r("delete"),
2328
2796
  icon: "trash",
2329
2797
  danger: !0,
2330
2798
  menu: !0,
2331
2799
  run: () => {
2332
- ie();
2800
+ U();
2333
2801
  }
2334
- })), q;
2802
+ })), Z;
2335
2803
  });
2336
- return (z, q) => (p(), T("div", {
2804
+ return (E, Z) => (m(), $("div", {
2337
2805
  class: "wx-category-editor",
2338
- onKeydown: ke
2806
+ onKeydown: de
2339
2807
  }, [
2340
- f.value || !m.value ? (p(), T(H, { key: 0 }, [
2341
- b(n(ue), {
2808
+ p.value || !f.value ? (m(), $(j, { key: 0 }, [
2809
+ w(a(me), {
2342
2810
  class: "wx-category-editor__ghost",
2343
2811
  title: "",
2344
2812
  rows: 1
2345
2813
  }),
2346
- b(n(Se), null, {
2347
- default: g(() => [
2348
- b(n(ue), { rows: 6 })
2814
+ w(a(Re), null, {
2815
+ default: y(() => [
2816
+ w(a(me), { rows: 6 })
2349
2817
  ]),
2350
2818
  _: 1
2351
2819
  })
2352
- ], 64)) : (p(), T(H, { key: 1 }, [
2353
- b(it, {
2820
+ ], 64)) : (m(), $(j, { key: 1 }, [
2821
+ w(pt, {
2354
2822
  divider: "",
2355
2823
  back: h.value,
2356
- "back-label": C.value,
2357
- title: A.value,
2358
- subtitle: m.value.path === null ? void 0 : `/${m.value.path}`,
2359
- actions: _e.value
2360
- }, Ae({
2361
- trail: g(() => [
2362
- b(n(Kt), {
2824
+ "back-label": k.value,
2825
+ title: C.value,
2826
+ subtitle: f.value.path === null ? void 0 : `/${f.value.path}`,
2827
+ actions: ie.value
2828
+ }, ke({
2829
+ trail: y(() => [
2830
+ w(a(ll), {
2363
2831
  size: "sm",
2364
- label: n(r)("trail")
2832
+ label: a(r)("trail")
2365
2833
  }, {
2366
- default: g(() => [
2367
- b(n(Pe), {
2834
+ default: y(() => [
2835
+ w(a(je), {
2368
2836
  as: "router-link",
2369
2837
  to: h.value
2370
2838
  }, {
2371
- default: g(() => [
2372
- V(L(C.value), 1)
2839
+ default: y(() => [
2840
+ z(A(k.value), 1)
2373
2841
  ]),
2374
2842
  _: 1
2375
2843
  }, 8, ["to"]),
2376
- b(n(Pe), { current: "" }, {
2377
- default: g(() => [
2378
- V(L(A.value), 1)
2844
+ w(a(je), { current: "" }, {
2845
+ default: y(() => [
2846
+ z(A(C.value), 1)
2379
2847
  ]),
2380
2848
  _: 1
2381
2849
  })
@@ -2385,12 +2853,12 @@ const xn = /* @__PURE__ */ R({
2385
2853
  ]),
2386
2854
  _: 2
2387
2855
  }, [
2388
- m.value.is_visible ? void 0 : {
2856
+ f.value.is_visible ? void 0 : {
2389
2857
  name: "title-after",
2390
- fn: g(() => [
2391
- b(n(ze), { dot: "" }, {
2392
- default: g(() => [
2393
- V(L(n(r)("hidden")), 1)
2858
+ fn: y(() => [
2859
+ w(a($e), { dot: "" }, {
2860
+ default: y(() => [
2861
+ z(A(a(r)("hidden")), 1)
2394
2862
  ]),
2395
2863
  _: 1
2396
2864
  })
@@ -2398,73 +2866,73 @@ const xn = /* @__PURE__ */ R({
2398
2866
  key: "0"
2399
2867
  }
2400
2868
  ]), 1032, ["back", "back-label", "title", "subtitle", "actions"]),
2401
- b(Wn, {
2869
+ w(mn, {
2402
2870
  modelValue: v.value,
2403
- "onUpdate:modelValue": q[0] || (q[0] = (_) => v.value = _),
2871
+ "onUpdate:modelValue": Z[0] || (Z[0] = (W) => v.value = W),
2404
2872
  name: t.options.screen,
2405
- errors: k.value,
2406
- disabled: !M.value || y.value
2873
+ errors: T.value,
2874
+ disabled: !F.value || b.value
2407
2875
  }, null, 8, ["modelValue", "name", "errors", "disabled"]),
2408
- M.value ? (p(), $(n(qt), { key: 0 }, {
2409
- state: g(() => [
2410
- b(Sn, { state: B.value }, null, 8, ["state"])
2876
+ F.value ? (m(), S(a(al), { key: 0 }, {
2877
+ state: y(() => [
2878
+ w(dn, { state: V.value }, null, 8, ["state"])
2411
2879
  ]),
2412
- default: g(() => [
2413
- b(n(Z), {
2880
+ default: y(() => [
2881
+ w(a(le), {
2414
2882
  type: "primary",
2415
- loading: y.value,
2416
- disabled: !S.value,
2417
- onClick: le
2883
+ loading: b.value,
2884
+ disabled: !H.value,
2885
+ onClick: R
2418
2886
  }, {
2419
- default: g(() => [
2420
- V(L(n(r)("save")), 1)
2887
+ default: y(() => [
2888
+ z(A(a(r)("save")), 1)
2421
2889
  ]),
2422
2890
  _: 1
2423
2891
  }, 8, ["loading", "disabled"])
2424
2892
  ]),
2425
2893
  _: 1
2426
- })) : U("", !0)
2894
+ })) : N("", !0)
2427
2895
  ], 64))
2428
2896
  ], 32));
2429
2897
  }
2430
- }), An = /* @__PURE__ */ Y(Ln, [["__scopeId", "data-v-86d85f8c"]]);
2431
- function je(e, t) {
2432
- return R({
2898
+ }), vn = /* @__PURE__ */ G(fn, [["__scopeId", "data-v-86d85f8c"]]);
2899
+ function Ze(e, t) {
2900
+ return M({
2433
2901
  name: "WxCategoriesView",
2434
- setup: () => () => re(e, { options: t })
2902
+ setup: () => () => ce(e, { options: t })
2435
2903
  });
2436
2904
  }
2437
- function tl(e) {
2905
+ function Pn(e) {
2438
2906
  return [
2439
- { path: e.path, name: e.name, component: je(_n, e) },
2907
+ { path: e.path, name: e.name, component: Ze(sn, e) },
2440
2908
  {
2441
2909
  path: `${e.path}/:id(\\d+)`,
2442
2910
  name: `${e.name}.edit`,
2443
- component: je(An, e)
2911
+ component: Ze(vn, e)
2444
2912
  }
2445
2913
  ];
2446
2914
  }
2447
- const al = 76, nl = /* @__PURE__ */ R({
2915
+ const Fn = 76, Dn = /* @__PURE__ */ M({
2448
2916
  __name: "FilterChips",
2449
2917
  props: {
2450
2918
  filters: {}
2451
2919
  },
2452
2920
  setup(e) {
2453
- return (t, a) => (p(!0), T(H, null, Q(e.filters, (l) => (p(), $(n(ze), {
2454
- key: l.key,
2921
+ return (t, l) => (m(!0), $(j, null, ae(e.filters, (n) => (m(), S(a($e), {
2922
+ key: n.key,
2455
2923
  class: "wx-filter-chip",
2456
2924
  size: "sm",
2457
2925
  round: "",
2458
2926
  closable: "",
2459
- onClose: (i) => l.clear()
2927
+ onClose: (o) => n.clear()
2460
2928
  }, {
2461
- default: g(() => [
2462
- V(L(l.label), 1)
2929
+ default: y(() => [
2930
+ z(A(n.label), 1)
2463
2931
  ]),
2464
2932
  _: 2
2465
2933
  }, 1032, ["onClose"]))), 128));
2466
2934
  }
2467
- }), zn = { class: "wx-rename__footer" }, Vn = /* @__PURE__ */ R({
2935
+ }), pn = { class: "wx-rename__footer" }, hn = /* @__PURE__ */ M({
2468
2936
  __name: "RenameButton",
2469
2937
  props: {
2470
2938
  name: { default: "" },
@@ -2475,57 +2943,57 @@ const al = 76, nl = /* @__PURE__ */ R({
2475
2943
  },
2476
2944
  emits: ["rename"],
2477
2945
  setup(e, { emit: t }) {
2478
- const a = e, l = t, i = P("webx-admin"), s = W(!1), o = W(a.name), r = W(null), u = x(() => a.label ?? i("editor.rename"));
2479
- ee(s, async (h) => {
2480
- h && (o.value = a.name, await Je(), r.value?.focus(), r.value?.select());
2946
+ const l = e, n = t, o = D("webx-admin"), i = L(!1), s = L(l.name), r = L(null), u = g(() => l.label ?? o("editor.rename"));
2947
+ te(i, async (h) => {
2948
+ h && (s.value = l.name, await Ie(), r.value?.focus(), r.value?.select());
2481
2949
  });
2482
- function c() {
2483
- const h = o.value.trim();
2484
- if (h === "" || h === a.name) {
2485
- s.value = !1;
2950
+ function d() {
2951
+ const h = s.value.trim();
2952
+ if (h === "" || h === l.name) {
2953
+ i.value = !1;
2486
2954
  return;
2487
2955
  }
2488
- l("rename", h), s.value = !1;
2956
+ n("rename", h), i.value = !1;
2489
2957
  }
2490
- return (h, m) => (p(), $(n(Yt), {
2491
- open: s.value,
2492
- "onUpdate:open": m[2] || (m[2] = (v) => s.value = v),
2958
+ return (h, f) => (m(), S(a(nl), {
2959
+ open: i.value,
2960
+ "onUpdate:open": f[2] || (f[2] = (v) => i.value = v),
2493
2961
  title: u.value,
2494
2962
  width: 320,
2495
2963
  side: "bottom",
2496
2964
  align: "start",
2497
2965
  teleport: ""
2498
2966
  }, {
2499
- trigger: g(() => [
2500
- b(n(se), {
2967
+ trigger: y(() => [
2968
+ w(a(ue), {
2501
2969
  type: "edit",
2502
2970
  title: u.value,
2503
2971
  size: e.size,
2504
2972
  disabled: e.disabled
2505
2973
  }, null, 8, ["title", "size", "disabled"])
2506
2974
  ]),
2507
- default: g(() => [
2508
- O("form", {
2975
+ default: y(() => [
2976
+ B("form", {
2509
2977
  class: "wx-rename",
2510
- onSubmit: qe(c, ["prevent"])
2978
+ onSubmit: tt(d, ["prevent"])
2511
2979
  }, [
2512
- b(n(ye), {
2980
+ w(a(Te), {
2513
2981
  ref_key: "field",
2514
2982
  ref: r,
2515
- modelValue: o.value,
2516
- "onUpdate:modelValue": m[0] || (m[0] = (v) => o.value = v),
2983
+ modelValue: s.value,
2984
+ "onUpdate:modelValue": f[0] || (f[0] = (v) => s.value = v),
2517
2985
  "aria-label": u.value,
2518
2986
  placeholder: e.placeholder,
2519
- onKeydown: m[1] || (m[1] = Qe((v) => s.value = !1, ["esc"]))
2987
+ onKeydown: f[1] || (f[1] = nt((v) => i.value = !1, ["esc"]))
2520
2988
  }, null, 8, ["modelValue", "aria-label", "placeholder"]),
2521
- O("div", zn, [
2522
- b(n(Z), {
2989
+ B("div", pn, [
2990
+ w(a(le), {
2523
2991
  type: "primary",
2524
2992
  size: "sm",
2525
2993
  "native-type": "submit"
2526
2994
  }, {
2527
- default: g(() => [
2528
- V(L(n(i)("editor.save")), 1)
2995
+ default: y(() => [
2996
+ z(A(a(o)("editor.save")), 1)
2529
2997
  ]),
2530
2998
  _: 1
2531
2999
  })
@@ -2535,7 +3003,7 @@ const al = 76, nl = /* @__PURE__ */ R({
2535
3003
  _: 1
2536
3004
  }, 8, ["open", "title"]));
2537
3005
  }
2538
- }), ll = /* @__PURE__ */ Y(Vn, [["__scopeId", "data-v-d879e8d3"]]), En = ["innerHTML"], Un = /* @__PURE__ */ R({
3006
+ }), On = /* @__PURE__ */ G(hn, [["__scopeId", "data-v-d879e8d3"]]), gn = ["innerHTML"], yn = /* @__PURE__ */ M({
2539
3007
  __name: "HelpButton",
2540
3008
  props: {
2541
3009
  body: {},
@@ -2545,33 +3013,33 @@ const al = 76, nl = /* @__PURE__ */ R({
2545
3013
  width: { default: 720 }
2546
3014
  },
2547
3015
  setup(e) {
2548
- const t = e, a = P("webx-admin"), l = W(!1), i = x(() => t.title ?? a("help.title")), s = x(() => mn(t.body));
2549
- return (o, r) => (p(), T(H, null, [
2550
- b(n(se), {
3016
+ const t = e, l = D("webx-admin"), n = L(!1), o = g(() => t.title ?? l("help.title")), i = g(() => Xa(t.body));
3017
+ return (s, r) => (m(), $(j, null, [
3018
+ w(a(ue), {
2551
3019
  type: "details",
2552
3020
  icon: "question",
2553
3021
  tone: "neutral",
2554
3022
  size: e.size,
2555
- title: e.label ?? i.value,
2556
- onClick: r[0] || (r[0] = (u) => l.value = !0)
3023
+ title: e.label ?? o.value,
3024
+ onClick: r[0] || (r[0] = (u) => n.value = !0)
2557
3025
  }, null, 8, ["size", "title"]),
2558
- b(n(lt), {
2559
- open: l.value,
2560
- "onUpdate:open": r[1] || (r[1] = (u) => l.value = u),
2561
- title: i.value,
3026
+ w(a(rt), {
3027
+ open: n.value,
3028
+ "onUpdate:open": r[1] || (r[1] = (u) => n.value = u),
3029
+ title: o.value,
2562
3030
  width: e.width
2563
3031
  }, {
2564
- default: g(() => [
2565
- O("div", {
3032
+ default: y(() => [
3033
+ B("div", {
2566
3034
  class: "wx-help",
2567
- innerHTML: s.value
2568
- }, null, 8, En)
3035
+ innerHTML: i.value
3036
+ }, null, 8, gn)
2569
3037
  ]),
2570
3038
  _: 1
2571
3039
  }, 8, ["open", "title", "width"])
2572
3040
  ], 64));
2573
3041
  }
2574
- }), ol = /* @__PURE__ */ Y(Un, [["__scopeId", "data-v-6c280d42"]]), ht = /* @__PURE__ */ R({
3042
+ }), Hn = /* @__PURE__ */ G(yn, [["__scopeId", "data-v-6c280d42"]]), $t = /* @__PURE__ */ M({
2575
3043
  name: "WxDate",
2576
3044
  __name: "DateText",
2577
3045
  props: {
@@ -2581,46 +3049,46 @@ const al = 76, nl = /* @__PURE__ */ R({
2581
3049
  tone: { default: "muted" }
2582
3050
  },
2583
3051
  setup(e) {
2584
- const t = e, a = ft(), l = x(() => t.compact ? a.compact(t.value) : a.short(t.value)), i = x(() => a.exact(t.value)), s = x(() => a.iso(t.value));
2585
- return (o, r) => i.value ? (p(), $(n(st), {
3052
+ const t = e, l = kt(), n = g(() => t.compact ? l.compact(t.value) : l.short(t.value)), o = g(() => l.exact(t.value)), i = g(() => l.iso(t.value));
3053
+ return (s, r) => o.value ? (m(), S(a(dt), {
2586
3054
  key: 0,
2587
- content: i.value
3055
+ content: o.value
2588
3056
  }, {
2589
- default: g(() => [
2590
- b(n(G), {
3057
+ default: y(() => [
3058
+ w(a(ee), {
2591
3059
  as: "time",
2592
- datetime: s.value,
3060
+ datetime: i.value,
2593
3061
  size: e.size,
2594
3062
  tone: e.tone
2595
3063
  }, {
2596
- default: g(() => [
2597
- V(L(l.value), 1)
3064
+ default: y(() => [
3065
+ z(A(n.value), 1)
2598
3066
  ]),
2599
3067
  _: 1
2600
3068
  }, 8, ["datetime", "size", "tone"])
2601
3069
  ]),
2602
3070
  _: 1
2603
- }, 8, ["content"])) : (p(), $(n(G), {
3071
+ }, 8, ["content"])) : (m(), S(a(ee), {
2604
3072
  key: 1,
2605
3073
  size: e.size,
2606
3074
  tone: e.tone
2607
3075
  }, {
2608
- default: g(() => [
2609
- V(L(l.value), 1)
3076
+ default: y(() => [
3077
+ z(A(n.value), 1)
2610
3078
  ]),
2611
3079
  _: 1
2612
3080
  }, 8, ["size", "tone"]));
2613
3081
  }
2614
- }), Rn = { class: "wx-notes" }, Nn = {
3082
+ }), bn = { class: "wx-notes" }, wn = {
2615
3083
  key: 3,
2616
3084
  class: "wx-notes__list"
2617
- }, Bn = { class: "wx-note__body" }, In = { class: "wx-note__head" }, Pn = { class: "wx-note__buttons" }, Dn = {
3085
+ }, xn = { class: "wx-note__body" }, kn = { class: "wx-note__head" }, _n = { class: "wx-note__buttons" }, $n = {
2618
3086
  key: 1,
2619
3087
  class: "wx-note__text"
2620
- }, Mn = {
3088
+ }, Tn = {
2621
3089
  key: 4,
2622
3090
  class: "wx-notes__new"
2623
- }, Fn = /* @__PURE__ */ R({
3091
+ }, Sn = /* @__PURE__ */ M({
2624
3092
  name: "WxNotes",
2625
3093
  __name: "NotesFeed",
2626
3094
  props: {
@@ -2631,304 +3099,315 @@ const al = 76, nl = /* @__PURE__ */ R({
2631
3099
  },
2632
3100
  emits: ["change"],
2633
3101
  setup(e, { emit: t }) {
2634
- const a = e, l = t, i = X(), s = P("webx-admin"), o = Re(), r = W([]), u = W(!0), c = W(""), h = W(!1), m = W(null), v = W(""), d = x(() => yn(i, a.type, a.id)), w = x(() => a.title ?? s("notes.title"));
2635
- async function f() {
3102
+ const l = e, n = t, o = J(), i = D("webx-admin"), s = De(), r = L([]), u = L(!0), d = L(""), h = L(!1), f = L(null), v = L(""), c = g(() => tn(o, l.type, l.id)), x = g(() => l.title ?? i("notes.title"));
3103
+ async function p() {
2636
3104
  u.value = !0;
2637
3105
  try {
2638
- r.value = await d.value.list();
2639
- } catch (C) {
2640
- D.danger(o(C));
3106
+ r.value = await c.value.list();
3107
+ } catch (k) {
3108
+ K.danger(s(k));
2641
3109
  } finally {
2642
3110
  u.value = !1;
2643
3111
  }
2644
3112
  }
2645
- ee(
2646
- () => [a.type, a.id],
3113
+ te(
3114
+ () => [l.type, l.id],
2647
3115
  () => {
2648
- m.value = null, c.value = "", f();
3116
+ f.value = null, d.value = "", p();
2649
3117
  },
2650
3118
  { immediate: !0 }
2651
3119
  );
2652
- async function y() {
2653
- const C = c.value.trim();
2654
- if (!(C === "" || h.value)) {
3120
+ async function b() {
3121
+ const k = d.value.trim();
3122
+ if (!(k === "" || h.value)) {
2655
3123
  h.value = !0;
2656
3124
  try {
2657
- r.value = [...r.value, await d.value.add(C)], c.value = "", l("change");
2658
- } catch (A) {
2659
- D.danger(o(A));
3125
+ r.value = [...r.value, await c.value.add(k)], d.value = "", n("change");
3126
+ } catch (C) {
3127
+ K.danger(s(C));
2660
3128
  } finally {
2661
3129
  h.value = !1;
2662
3130
  }
2663
3131
  }
2664
3132
  }
2665
- function k(C) {
2666
- m.value = C.id, v.value = C.body;
3133
+ function T(k) {
3134
+ f.value = k.id, v.value = k.body;
2667
3135
  }
2668
- async function M(C) {
2669
- const A = v.value.trim();
2670
- if (A !== "")
3136
+ async function F(k) {
3137
+ const C = v.value.trim();
3138
+ if (C !== "")
2671
3139
  try {
2672
- const E = await d.value.save(C.id, A);
2673
- r.value = r.value.map((K) => K.id === E.id ? E : K), m.value = null, D.success(s("notes.saved")), l("change");
2674
- } catch (E) {
2675
- D.danger(o(E));
3140
+ const _ = await c.value.save(k.id, C);
3141
+ r.value = r.value.map((q) => q.id === _.id ? _ : q), f.value = null, K.success(i("notes.saved")), n("change");
3142
+ } catch (_) {
3143
+ K.danger(s(_));
2676
3144
  }
2677
3145
  }
2678
- async function J(C) {
2679
- if (await he({
2680
- title: s("notes.delete-title"),
2681
- message: s("notes.delete-text"),
2682
- confirmText: s("notes.delete"),
2683
- cancelText: s("notes.cancel"),
3146
+ async function Q(k) {
3147
+ if (await xe({
3148
+ title: i("notes.delete-title"),
3149
+ message: i("notes.delete-text"),
3150
+ confirmText: i("notes.delete"),
3151
+ cancelText: i("notes.cancel"),
2684
3152
  tone: "danger"
2685
3153
  }))
2686
3154
  try {
2687
- await d.value.remove(C.id), r.value = r.value.filter((E) => E.id !== C.id), D.success(s("notes.deleted")), l("change");
2688
- } catch (E) {
2689
- D.danger(o(E));
3155
+ await c.value.remove(k.id), r.value = r.value.filter((_) => _.id !== k.id), K.success(i("notes.deleted")), n("change");
3156
+ } catch (_) {
3157
+ K.danger(s(_));
2690
3158
  }
2691
3159
  }
2692
- function S(C) {
2693
- return !a.can || !C.is_mine ? [] : [
2694
- { key: "edit", icon: "edit", label: s("notes.edit"), run: () => k(C) },
3160
+ function H(k) {
3161
+ return !l.can || !k.is_mine ? [] : [
3162
+ { key: "edit", icon: "edit", label: i("notes.edit"), run: () => T(k) },
2695
3163
  {
2696
3164
  key: "delete",
2697
3165
  icon: "trash",
2698
- label: s("notes.delete"),
3166
+ label: i("notes.delete"),
2699
3167
  danger: !0,
2700
3168
  run: () => {
2701
- J(C);
3169
+ Q(k);
2702
3170
  }
2703
3171
  }
2704
3172
  ];
2705
3173
  }
2706
- function B(C) {
2707
- return C.author?.name ?? s("notes.unknown-author");
3174
+ function V(k) {
3175
+ return k.author?.name ?? i("notes.unknown-author");
2708
3176
  }
2709
- return (C, A) => (p(), T("section", Rn, [
2710
- w.value ? (p(), $(n(G), {
3177
+ return (k, C) => (m(), $("section", bn, [
3178
+ x.value ? (m(), S(a(ee), {
2711
3179
  key: 0,
2712
3180
  weight: "medium",
2713
3181
  class: "wx-notes__title"
2714
3182
  }, {
2715
- default: g(() => [
2716
- V(L(w.value), 1)
3183
+ default: y(() => [
3184
+ z(A(x.value), 1)
2717
3185
  ]),
2718
3186
  _: 1
2719
- })) : U("", !0),
2720
- u.value ? (p(), $(n(ue), {
3187
+ })) : N("", !0),
3188
+ u.value ? (m(), S(a(me), {
2721
3189
  key: 1,
2722
3190
  rows: 2
2723
- })) : r.value.length === 0 ? (p(), $(n(ot), {
3191
+ })) : r.value.length === 0 ? (m(), S(a(ut), {
2724
3192
  key: 2,
2725
3193
  size: "sm",
2726
- description: n(s)("notes.empty")
2727
- }, null, 8, ["description"])) : (p(), T("ul", Nn, [
2728
- (p(!0), T(H, null, Q(r.value, (E) => (p(), T("li", {
2729
- key: E.id,
3194
+ description: a(i)("notes.empty")
3195
+ }, null, 8, ["description"])) : (m(), $("ul", wn, [
3196
+ (m(!0), $(j, null, ae(r.value, (_) => (m(), $("li", {
3197
+ key: _.id,
2730
3198
  class: "wx-note"
2731
3199
  }, [
2732
- b(n(Xt), {
2733
- name: B(E),
3200
+ w(a(ol), {
3201
+ name: V(_),
2734
3202
  size: "sm",
2735
3203
  tone: "auto"
2736
3204
  }, null, 8, ["name"]),
2737
- O("div", Bn, [
2738
- O("div", In, [
2739
- b(n(G), {
3205
+ B("div", xn, [
3206
+ B("div", kn, [
3207
+ w(a(ee), {
2740
3208
  size: "sm",
2741
3209
  weight: "medium",
2742
3210
  truncate: ""
2743
3211
  }, {
2744
- default: g(() => [
2745
- V(L(B(E)), 1)
3212
+ default: y(() => [
3213
+ z(A(V(_)), 1)
2746
3214
  ]),
2747
3215
  _: 2
2748
3216
  }, 1024),
2749
- b(ht, {
2750
- value: E.created_at
3217
+ w($t, {
3218
+ value: _.created_at
2751
3219
  }, null, 8, ["value"]),
2752
- b(Ue, {
2753
- actions: S(E),
2754
- label: B(E)
3220
+ w(Fe, {
3221
+ actions: H(_),
3222
+ label: V(_)
2755
3223
  }, null, 8, ["actions", "label"])
2756
3224
  ]),
2757
- m.value === E.id ? (p(), T(H, { key: 0 }, [
2758
- b(n(De), {
3225
+ f.value === _.id ? (m(), $(j, { key: 0 }, [
3226
+ w(a(Ke), {
2759
3227
  modelValue: v.value,
2760
- "onUpdate:modelValue": A[0] || (A[0] = (K) => v.value = K),
3228
+ "onUpdate:modelValue": C[0] || (C[0] = (q) => v.value = q),
2761
3229
  autosize: { minRows: 2, maxRows: 10 }
2762
3230
  }, null, 8, ["modelValue"]),
2763
- O("div", Pn, [
2764
- b(n(Z), {
3231
+ B("div", _n, [
3232
+ w(a(le), {
2765
3233
  size: "sm",
2766
3234
  type: "primary",
2767
- onClick: (K) => M(E)
3235
+ onClick: (q) => F(_)
2768
3236
  }, {
2769
- default: g(() => [
2770
- V(L(n(s)("notes.save")), 1)
3237
+ default: y(() => [
3238
+ z(A(a(i)("notes.save")), 1)
2771
3239
  ]),
2772
3240
  _: 1
2773
3241
  }, 8, ["onClick"]),
2774
- b(n(Z), {
3242
+ w(a(le), {
2775
3243
  size: "sm",
2776
3244
  variant: "text",
2777
- onClick: A[1] || (A[1] = (K) => m.value = null)
3245
+ onClick: C[1] || (C[1] = (q) => f.value = null)
2778
3246
  }, {
2779
- default: g(() => [
2780
- V(L(n(s)("notes.cancel")), 1)
3247
+ default: y(() => [
3248
+ z(A(a(i)("notes.cancel")), 1)
2781
3249
  ]),
2782
3250
  _: 1
2783
3251
  })
2784
3252
  ])
2785
- ], 64)) : (p(), T("p", Dn, L(E.body), 1))
3253
+ ], 64)) : (m(), $("p", $n, A(_.body), 1))
2786
3254
  ])
2787
3255
  ]))), 128))
2788
3256
  ])),
2789
- e.can ? (p(), T("div", Mn, [
2790
- b(n(De), {
2791
- modelValue: c.value,
2792
- "onUpdate:modelValue": A[2] || (A[2] = (E) => c.value = E),
2793
- placeholder: n(s)("notes.placeholder"),
3257
+ e.can ? (m(), $("div", Tn, [
3258
+ w(a(Ke), {
3259
+ modelValue: d.value,
3260
+ "onUpdate:modelValue": C[2] || (C[2] = (_) => d.value = _),
3261
+ placeholder: a(i)("notes.placeholder"),
2794
3262
  autosize: { minRows: 2, maxRows: 8 }
2795
3263
  }, null, 8, ["modelValue", "placeholder"]),
2796
- b(n(Z), {
3264
+ w(a(le), {
2797
3265
  size: "sm",
2798
3266
  type: "primary",
2799
- disabled: c.value.trim() === "",
3267
+ disabled: d.value.trim() === "",
2800
3268
  loading: h.value,
2801
- onClick: y
3269
+ onClick: b
2802
3270
  }, {
2803
- default: g(() => [
2804
- V(L(n(s)("notes.add")), 1)
3271
+ default: y(() => [
3272
+ z(A(a(i)("notes.add")), 1)
2805
3273
  ]),
2806
3274
  _: 1
2807
3275
  }, 8, ["disabled", "loading"])
2808
- ])) : U("", !0)
3276
+ ])) : N("", !0)
2809
3277
  ]));
2810
3278
  }
2811
- }), sl = /* @__PURE__ */ Y(Fn, [["__scopeId", "data-v-71004c1a"]]), On = {
3279
+ }), jn = /* @__PURE__ */ G(Sn, [["__scopeId", "data-v-71004c1a"]]), Cn = {
2812
3280
  key: 1,
2813
3281
  class: "wx-backup-note"
2814
- }, Hn = 48, jn = /* @__PURE__ */ R({
3282
+ }, Wn = 48, An = /* @__PURE__ */ M({
2815
3283
  name: "WxBackupNote",
2816
3284
  __name: "BackupNote",
2817
3285
  setup(e) {
2818
- const t = X(), a = ft(), l = P("webx-admin"), i = x(() => t.state.manifest?.backup ?? null), s = x(() => i.value !== null && t.can("settings.view")), o = x(() => {
2819
- const c = i.value?.at;
2820
- if (c == null) return !0;
2821
- const h = new Date(c).getTime();
2822
- return Number.isNaN(h) || Date.now() - h > Hn * 36e5;
2823
- }), r = x(() => {
2824
- const c = i.value?.bytes;
2825
- if (c == null) return "";
3286
+ const t = J(), l = kt(), n = D("webx-admin"), o = g(() => t.state.manifest?.backup ?? null), i = g(() => o.value !== null && t.can("settings.view")), s = g(() => {
3287
+ const d = o.value?.at;
3288
+ if (d == null) return !0;
3289
+ const h = new Date(d).getTime();
3290
+ return Number.isNaN(h) || Date.now() - h > Wn * 36e5;
3291
+ }), r = g(() => {
3292
+ const d = o.value?.bytes;
3293
+ if (d == null) return "";
2826
3294
  const h = ["byte", "kilobyte", "megabyte", "gigabyte", "terabyte"];
2827
- let m = c, v = 0;
2828
- for (; m >= 1024 && v < h.length - 1; )
2829
- m /= 1024, v++;
3295
+ let f = d, v = 0;
3296
+ for (; f >= 1024 && v < h.length - 1; )
3297
+ f /= 1024, v++;
2830
3298
  return new Intl.NumberFormat(t.i18n.state.locale, {
2831
3299
  style: "unit",
2832
3300
  unit: h[v],
2833
3301
  unitDisplay: "short",
2834
- maximumFractionDigits: m >= 10 || v === 0 ? 0 : 1
2835
- }).format(m);
2836
- }), u = x(
2837
- () => i.value?.at == null ? l("backup.never") : l("backup.stale", { date: a.short(i.value.at) })
3302
+ maximumFractionDigits: f >= 10 || v === 0 ? 0 : 1
3303
+ }).format(f);
3304
+ }), u = g(
3305
+ () => o.value?.at == null ? n("backup.never") : n("backup.stale", { date: l.short(o.value.at) })
2838
3306
  );
2839
- return (c, h) => s.value && o.value ? (p(), $(n(be), {
3307
+ return (d, h) => i.value && s.value ? (m(), S(a(Se), {
2840
3308
  key: 0,
2841
3309
  type: "warning",
2842
3310
  variant: "soft",
2843
3311
  description: u.value
2844
- }, null, 8, ["description"])) : s.value ? (p(), T("p", On, [
2845
- b(n(G), {
3312
+ }, null, 8, ["description"])) : i.value ? (m(), $("p", Cn, [
3313
+ w(a(ee), {
2846
3314
  size: "sm",
2847
3315
  tone: "muted"
2848
3316
  }, {
2849
- default: g(() => [
2850
- V(L(n(l)("backup.title")), 1)
3317
+ default: y(() => [
3318
+ z(A(a(n)("backup.title")), 1)
2851
3319
  ]),
2852
3320
  _: 1
2853
3321
  }),
2854
- b(ht, {
2855
- value: i.value?.at
3322
+ w($t, {
3323
+ value: o.value?.at
2856
3324
  }, null, 8, ["value"]),
2857
- r.value ? (p(), $(n(G), {
3325
+ r.value ? (m(), S(a(ee), {
2858
3326
  key: 0,
2859
3327
  size: "sm",
2860
3328
  tone: "muted"
2861
3329
  }, {
2862
- default: g(() => [
2863
- V("· " + L(r.value), 1)
3330
+ default: y(() => [
3331
+ z("· " + A(r.value), 1)
2864
3332
  ]),
2865
3333
  _: 1
2866
- })) : U("", !0)
2867
- ])) : U("", !0);
3334
+ })) : N("", !0)
3335
+ ])) : N("", !0);
2868
3336
  }
2869
- }), il = /* @__PURE__ */ Y(jn, [["__scopeId", "data-v-beeee67e"]]);
3337
+ }), Kn = /* @__PURE__ */ G(An, [["__scopeId", "data-v-beeee67e"]]);
2870
3338
  export {
2871
- Pa as AdminLanding,
2872
- Da as AdminNav,
2873
- Ga as AdminShell,
2874
- Ce as HttpError,
2875
- ba as WxBackButton,
2876
- il as WxBackupNote,
2877
- ia as WxCategoriesField,
2878
- _n as WxCategoriesPage,
2879
- xn as WxCategoryCreateDialog,
2880
- An as WxCategoryEditorPage,
2881
- Me as WxCategorySlug,
2882
- ht as WxDate,
2883
- nl as WxFilterChips,
2884
- ol as WxHelpButton,
2885
- ya as WxLinkField,
2886
- ga as WxLinkPicker,
2887
- rt as WxListScreen,
2888
- sl as WxNotes,
2889
- ll as WxRenameButton,
2890
- La as WxRichTextField,
2891
- Ue as WxRowMenu,
2892
- Sn as WxSaveState,
2893
- Wn as WxScreen,
2894
- it as WxScreenHead,
2895
- Me as WxSlugField,
2896
- dt as adminKey,
2897
- mt as adminMessages,
2898
- Ra as adminTypes,
2899
- tl as categoryRoutes,
2900
- Qn as createAdmin,
2901
- Na as createAdminContext,
2902
- xe as createCategoriesApi,
2903
- vn as createDates,
2904
- Qa as createHttp,
2905
- Ee as createI18n,
2906
- ua as createLinksApi,
2907
- yn as createNotesApi,
2908
- nn as createTheme,
2909
- ra as emptyLink,
2910
- pn as errorText,
2911
- we as i18nKey,
2912
- wn as itemOrderMode,
2913
- Ba as provideAdmin,
2914
- ta as provideI18n,
2915
- Aa as provideRecordAddress,
2916
- an as provideTheme,
2917
- Fe as readCookie,
2918
- ut as recordAddressKey,
2919
- mn as renderMarkdown,
2920
- na as reorderItems,
2921
- al as rowMenuWidth,
2922
- ct as themeKey,
2923
- X as useAdmin,
2924
- Zn as useCategoryEditor,
2925
- Ne as useCategoryWords,
2926
- ft as useDates,
2927
- Re as useErrorText,
2928
- ea as useI18n,
2929
- el as useItemOrder,
2930
- za as useRecordAddress,
2931
- Jn as useTheme,
2932
- P as useTranslate
3339
+ Ca as AdminLanding,
3340
+ Wa as AdminNav,
3341
+ Ba as AdminShell,
3342
+ ft as COLLECTION_MAX_LIMIT,
3343
+ fe as HttpError,
3344
+ ia as WxBackButton,
3345
+ Kn as WxBackupNote,
3346
+ gl as WxCategoriesField,
3347
+ sn as WxCategoriesPage,
3348
+ nn as WxCategoryCreateDialog,
3349
+ vn as WxCategoryEditorPage,
3350
+ Ge as WxCategorySlug,
3351
+ Xl as WxCollectionField,
3352
+ $t as WxDate,
3353
+ Dn as WxFilterChips,
3354
+ Hn as WxHelpButton,
3355
+ sa as WxLinkField,
3356
+ oa as WxLinkPicker,
3357
+ ht as WxListScreen,
3358
+ jn as WxNotes,
3359
+ mt as WxRelationsField,
3360
+ On as WxRenameButton,
3361
+ ga as WxRichTextField,
3362
+ Fe as WxRowMenu,
3363
+ dn as WxSaveState,
3364
+ mn as WxScreen,
3365
+ pt as WxScreenHead,
3366
+ Ge as WxSlugField,
3367
+ yt as adminKey,
3368
+ wt as adminMessages,
3369
+ _a as adminTypes,
3370
+ Pn as categoryRoutes,
3371
+ Nl as collectionSources,
3372
+ En as createAdmin,
3373
+ $a as createAdminContext,
3374
+ ve as createCategoriesApi,
3375
+ Ga as createDates,
3376
+ bl as createHttp,
3377
+ Pe as createI18n,
3378
+ Jl as createLinksApi,
3379
+ tn as createNotesApi,
3380
+ kl as createRelationsApi,
3381
+ Fa as createTheme,
3382
+ Xe as defaultMarkup,
3383
+ Gl as emptyLink,
3384
+ Qa as errorText,
3385
+ Ce as i18nKey,
3386
+ an as itemOrderMode,
3387
+ Ye as normaliseCollection,
3388
+ _l as normaliseRelations,
3389
+ Ta as provideAdmin,
3390
+ cl as provideI18n,
3391
+ ya as provideRecordAddress,
3392
+ zn as provideRelationOwner,
3393
+ Pa as provideTheme,
3394
+ qe as readCookie,
3395
+ gt as recordAddressKey,
3396
+ ct as relationOwnerKey,
3397
+ Xa as renderMarkdown,
3398
+ fl as reorderItems,
3399
+ Fn as rowMenuWidth,
3400
+ bt as themeKey,
3401
+ J as useAdmin,
3402
+ Bn as useCategoryEditor,
3403
+ Oe as useCategoryWords,
3404
+ kt as useDates,
3405
+ De as useErrorText,
3406
+ dl as useI18n,
3407
+ Mn as useItemOrder,
3408
+ ba as useRecordAddress,
3409
+ $l as useRelationOwner,
3410
+ In as useTheme,
3411
+ D as useTranslate
2933
3412
  };
2934
3413
  //# sourceMappingURL=index.js.map