@webx-ui/module-blog 0.2.2 → 0.4.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,16 +1,16 @@
1
- import { provide as ct, inject as vt, defineComponent as ee, computed as v, openBlock as p, createElementBlock as Z, createVNode as n, unref as e, withCtx as l, createBlock as C, createTextVNode as w, toDisplayString as b, createCommentVNode as H, useModel as qe, mergeModels as Me, ref as z, watch as ue, onMounted as Ne, onBeforeUnmount as Je, Fragment as be, createElementVNode as j, renderList as Be, normalizeClass as Pe, useTemplateRef as De, nextTick as Ze, isRef as Ie, withKeys as ze, resolveDynamicComponent as tt, mergeProps as pt, useId as ft, withModifiers as at } from "vue";
2
- import { useAdmin as ne, useTranslate as Q, useDates as mt, useErrorText as ge, WxScreenHead as bt, WxScreen as gt, WxSaveState as ht, WxDate as je, rowMenuWidth as st, WxListScreen as Qe, WxRowMenu as Re, WxFilterChips as yt } from "@webx-ui/module-admin";
3
- import { useLocales as Xe, WxFormItem as ie, WxText as G, WxAlert as We, WxSelect as _e, localizedValue as wt, confirm as me, WxSkeleton as Ue, WxBadge as oe, WxBreadcrumb as _t, WxBreadcrumbItem as lt, WxButton as J, WxActionBar as rt, toast as L, WxEmpty as Ge, WxSortableList as Ye, WxAction as Oe, useModal as Ee, WxDialog as Fe, WxInput as Ae, WxSpace as Le, useElementWidth as xt, createModal as Ce, WxTable as ot, WxEntityCard as kt, WxIcon as we, WxTooltip as et, WxHeading as $t, WxTextarea as Tt, WxSwitch as Vt, WxCard as At, WxListDetail as St, WxCheckbox as Wt } from "@webx-ui/core";
4
- import { useRoute as He, useRouter as Ke, onBeforeRouteLeave as Ct } from "vue-router";
5
- import { provideBlocksPreview as zt } from "@webx-ui/module-blocks";
6
- const ut = /* @__PURE__ */ Symbol("wx-article-editor");
7
- function Rt(f) {
8
- ct(ut, f);
1
+ import { provide as vt, inject as pt, defineComponent as X, useModel as Ie, computed as p, openBlock as h, createBlock as M, unref as e, mergeModels as Pe, ref as U, watch as ue, onMounted as Be, onBeforeUnmount as je, createElementBlock as G, Fragment as _e, createVNode as s, withCtx as i, createTextVNode as z, toDisplayString as T, createCommentVNode as j, createElementVNode as H, renderList as De, normalizeClass as Ge, normalizeProps as ft, guardReactiveProps as gt, useTemplateRef as Ee, nextTick as Je, isRef as Ue, withKeys as qe, resolveDynamicComponent as et, mergeProps as bt, useId as mt, withModifiers as tt } from "vue";
2
+ import { useAdmin as ne, useTranslate as Q, useDates as ht, useErrorText as pe, WxScreenHead as yt, WxScreen as wt, WxSaveState as _t, WxDate as He, rowMenuWidth as nt, WxListScreen as Ze, WxRowMenu as ze, WxFilterChips as xt, WxRichTextField as kt } from "@webx-ui/module-admin";
3
+ import { WxSelect as ye, useLocales as Qe, localizedValue as $t, confirm as ve, WxSkeleton as Ne, WxCard as Tt, WxBadge as se, WxBreadcrumb as Vt, WxBreadcrumbItem as at, WxAlert as we, WxButton as J, WxActionBar as st, toast as F, WxEmpty as rt, WxText as le, WxSortableList as Xe, WxAction as ot, WxInput as Ve, WxFormItem as ie, useModal as Re, WxDialog as Me, WxSpace as Oe, useElementWidth as At, createModal as Ce, WxTable as ut, WxEntityCard as St, WxIcon as Te, WxTooltip as Ye, WxTabs as Wt, WxTab as Ke, WxSwitch as Ct, WxCheckbox as zt } from "@webx-ui/core";
4
+ import { useRoute as Le, useRouter as Fe, onBeforeRouteLeave as Ut } from "vue-router";
5
+ import { provideBlocksPreview as Rt } from "@webx-ui/module-blocks";
6
+ const ct = /* @__PURE__ */ Symbol("wx-article-editor");
7
+ function Mt(g) {
8
+ vt(ct, g);
9
9
  }
10
- function Se() {
11
- return vt(ut, null);
10
+ function Ae() {
11
+ return pt(ct, null);
12
12
  }
13
- const Ut = {
13
+ const qt = {
14
14
  module: {
15
15
  group: "Blog",
16
16
  articles: "Articles",
@@ -76,7 +76,7 @@ const Ut = {
76
76
  article: {
77
77
  trail: "Where this article sits",
78
78
  untitled: "Untitled",
79
- save: "Save draft",
79
+ save: "Save",
80
80
  "save-failed": "The article was not saved.",
81
81
  schedule: "Schedule",
82
82
  scheduled: "The article is scheduled.",
@@ -99,13 +99,12 @@ const Ut = {
99
99
  leave: "Leave",
100
100
  "leave-title": "Leave without saving?",
101
101
  "leave-text": "The article could not be saved, and what you wrote is not on the server.",
102
- "live-never": "Never published",
103
102
  "live-scheduled": "Goes out :date",
104
103
  "live-since": "On the site since :date",
105
- "live-edited": "edits waiting",
106
- "live-off": "Off the site",
107
- address: "Address",
108
- "no-address": "No address in this language",
104
+ "unpublish-title": "Take “:title” off the site?",
105
+ "unpublish-text": "It stops answering at its address. The draft, the history and the rubrics stay — publishing puts it back.",
106
+ "unpublish-waiting": "It has not gone out yet. The day it was set for will pass without it.",
107
+ "unpublish-help": "Takes the article off the site without deleting it.",
109
108
  "address-moving": "The address is changing. The old one keeps working and leads to the new one.",
110
109
  author: "Author",
111
110
  "no-author": "Nobody",
@@ -141,24 +140,24 @@ const Ut = {
141
140
  new: "New rubric",
142
141
  empty: "No rubrics yet.",
143
142
  "empty-help": "A rubric is a section of the blog. An article can be in several of them.",
144
- choose: "Pick a rubric to edit it.",
145
143
  order: "The order here is the order on the site",
146
144
  hidden: "Hidden from the site",
147
145
  "no-address": "No address in this language",
148
- back: "Rubrics",
149
146
  articles: ":count articles",
150
147
  "show-articles": "Show its articles",
148
+ edit: "Edit",
149
+ "tab-content": "Content",
150
+ "tab-cover": "Image",
151
+ "tab-seo": "SEO",
151
152
  "field-title": "Name",
152
153
  "field-slug": "Address",
153
- "field-lead": "Introduction",
154
- "lead-help": "Printed above the list of articles.",
155
- "field-cover": "Cover",
156
154
  visible: "Show on the site",
157
155
  "visible-help": "Hidden, it drops out of the menu and answers 404. Its articles go on answering at their own addresses.",
156
+ "field-lead": "Introduction",
157
+ "lead-help": "Printed above the list of articles.",
158
+ "cover-help": "Shown wherever the site lists the sections.",
158
159
  "address-moving": "The address is changing. The old one keeps working and leads to the new one.",
159
- seo: "SEO for this rubric",
160
- "seo-help": "The title and the description of this page come from the SEO rules.",
161
- "seo-override": "Write them for “:name”",
160
+ "seo-help": "Left empty, the title and the description of this page come from the SEO rules.",
162
161
  delete: "Delete",
163
162
  "delete-blocked": "While it holds articles it cannot go — move them first.",
164
163
  "delete-title": "Delete “:name”?",
@@ -225,345 +224,305 @@ const Ut = {
225
224
  "merge-warning": ":count articles will carry “:tag” instead. :merged tags will be deleted, and there is no undoing it.",
226
225
  "merge-confirm": "Merge"
227
226
  }
228
- }, it = /* @__PURE__ */ new WeakSet();
229
- function te() {
227
+ }, lt = /* @__PURE__ */ new WeakSet();
228
+ function Y() {
230
229
  try {
231
- const { i18n: f } = ne();
232
- it.has(f) || (f.defaults("webx-blog", Ut), it.add(f));
230
+ const { i18n: g } = ne();
231
+ lt.has(g) || (g.defaults("webx-blog", qt), lt.add(g));
233
232
  } catch {
234
233
  }
235
234
  }
236
- const qt = { class: "wx-article-address" }, Mt = /* @__PURE__ */ ee({
237
- name: "WxArticleAddress",
238
- __name: "ArticleAddress",
239
- setup(f) {
240
- const m = Se(), r = Xe();
241
- te();
242
- const y = Q("webx-blog"), u = v(() => {
243
- const s = m?.values.value.slug;
244
- return typeof s == "string" ? s : s?.[r.active.value] ?? "";
245
- }), a = v(() => u.value === "" ? null : `/${[m?.prefix.value ?? "", u.value].filter(Boolean).join("/")}`), t = v(() => {
246
- const s = m?.article.value?.path;
247
- return typeof s == "string" && a.value !== null && a.value !== `/${s}`;
248
- });
249
- return (s, i) => (p(), Z("div", qt, [
250
- n(e(ie), {
251
- label: e(y)("article.address")
252
- }, {
253
- default: l(() => [
254
- a.value ? (p(), C(e(G), {
255
- key: 0,
256
- mono: "",
257
- class: "wx-article-address__value"
258
- }, {
259
- default: l(() => [
260
- w(b(a.value), 1)
261
- ]),
262
- _: 1
263
- })) : (p(), C(e(G), {
264
- key: 1,
265
- size: "sm",
266
- tone: "muted"
267
- }, {
268
- default: l(() => [
269
- w(b(e(y)("article.no-address")), 1)
270
- ]),
271
- _: 1
272
- }))
273
- ]),
274
- _: 1
275
- }, 8, ["label"]),
276
- t.value ? (p(), C(e(We), {
277
- key: 0,
278
- type: "info",
279
- variant: "soft",
280
- description: e(y)("article.address-moving")
281
- }, null, 8, ["description"])) : H("", !0)
282
- ]));
283
- }
284
- }), ve = (f, m) => {
285
- const r = f.__vccOpts || f;
286
- for (const [y, u] of m)
287
- r[y] = u;
288
- return r;
289
- }, Nt = /* @__PURE__ */ ve(Mt, [["__scopeId", "data-v-2ee0dcfe"]]), Bt = /* @__PURE__ */ ee({
235
+ const Nt = /* @__PURE__ */ X({
290
236
  name: "WxArticleAuthor",
291
237
  __name: "ArticleAuthor",
292
- props: /* @__PURE__ */ Me({
238
+ props: /* @__PURE__ */ Pe({
293
239
  disabled: { type: Boolean, default: !1 }
294
240
  }, {
295
241
  modelValue: { default: null },
296
242
  modelModifiers: {}
297
243
  }),
298
244
  emits: ["update:modelValue"],
299
- setup(f) {
300
- const m = f, r = qe(f, "modelValue"), y = Se();
301
- te();
302
- const u = Q("webx-blog"), a = v(() => m.disabled || y?.disabled.value === !0), t = v(
303
- () => (y?.options.value.authors ?? []).map((i) => ({
304
- label: i.title,
305
- value: i.id
245
+ setup(g) {
246
+ const o = g, c = Ie(g, "modelValue"), w = Ae();
247
+ Y();
248
+ const n = Q("webx-blog"), l = p(() => o.disabled || w?.disabled.value === !0), t = p(
249
+ () => (w?.options.value.authors ?? []).map((a) => ({
250
+ label: a.title,
251
+ value: a.id
306
252
  }))
307
- ), s = v({
308
- get: () => r.value,
309
- set: (i) => {
310
- r.value = typeof i == "number" ? i : null;
253
+ ), u = p({
254
+ get: () => c.value,
255
+ set: (a) => {
256
+ c.value = typeof a == "number" ? a : null;
311
257
  }
312
258
  });
313
- return (i, x) => (p(), C(e(_e), {
314
- modelValue: s.value,
315
- "onUpdate:modelValue": x[0] || (x[0] = (T) => s.value = T),
259
+ return (a, x) => (h(), M(e(ye), {
260
+ modelValue: u.value,
261
+ "onUpdate:modelValue": x[0] || (x[0] = (b) => u.value = b),
316
262
  options: t.value,
317
- placeholder: e(u)("article.no-author"),
318
- disabled: a.value,
263
+ placeholder: e(n)("article.no-author"),
264
+ disabled: l.value,
319
265
  clearable: "",
320
266
  filterable: "",
321
267
  teleport: "",
322
- "aria-label": e(u)("article.author")
268
+ "aria-label": e(n)("article.author")
323
269
  }, null, 8, ["modelValue", "options", "placeholder", "disabled", "aria-label"]));
324
270
  }
325
271
  });
326
- function de(f) {
327
- const m = `${f.apiPath}/blog/articles`, r = `${f.apiPath}/blog/rubrics`, y = `${f.apiPath}/blog/tags`, u = (a) => a.data;
272
+ function re(g) {
273
+ const o = `${g.apiPath}/blog/articles`, c = `${g.apiPath}/blog/rubrics`, w = `${g.apiPath}/blog/tags`, n = (l) => l.data;
328
274
  return {
329
- articles: (a = {}) => {
275
+ articles: (l = {}) => {
330
276
  const t = new URLSearchParams();
331
- a.q && t.set("q", a.q), a.rubric != null && t.set("rubric", String(a.rubric)), a.tag != null && t.set("tag", String(a.tag)), a.author != null && t.set("author", String(a.author)), a.status && t.set("status", a.status), a.sort && t.set("sort", a.sort), a.trashed && t.set("trashed", "1"), a.page && a.page > 1 && t.set("page", String(a.page)), a.per_page && t.set("per_page", String(a.per_page));
332
- const s = t.size > 0 ? `?${t}` : "";
333
- return f.http.get(`${m}${s}`).then((i) => ({ ...i.meta, data: i.data, filters: i.filters }));
277
+ l.q && t.set("q", l.q), l.rubric != null && t.set("rubric", String(l.rubric)), l.tag != null && t.set("tag", String(l.tag)), l.author != null && t.set("author", String(l.author)), l.status && t.set("status", l.status), l.sort && t.set("sort", l.sort), l.trashed && t.set("trashed", "1"), l.page && l.page > 1 && t.set("page", String(l.page)), l.per_page && t.set("per_page", String(l.per_page));
278
+ const u = t.size > 0 ? `?${t}` : "";
279
+ return g.http.get(`${o}${u}`).then((a) => ({ ...a.meta, data: a.data, filters: a.filters }));
334
280
  },
335
- get: (a) => f.http.get(`${m}/${a}`).then(u),
336
- create: (a) => f.http.post(m, a).then(u),
337
- save: (a, t) => f.http.put(`${m}/${a}`, t).then(u),
338
- discard: (a) => f.http.post(`${m}/${a}/discard`, {}).then(u),
339
- versions: (a) => f.http.get(`${m}/${a}/versions`).then(u),
340
- restoreVersion: (a, t) => f.http.post(`${m}/${a}/versions/${t}/restore`, {}).then(u),
341
- tags: (a = "") => {
342
- const t = a.trim() === "" ? "" : `?q=${encodeURIComponent(a.trim())}`;
343
- return f.http.get(`${y}${t}`).then(u);
281
+ get: (l) => g.http.get(`${o}/${l}`).then(n),
282
+ create: (l) => g.http.post(o, l).then(n),
283
+ save: (l, t) => g.http.put(`${o}/${l}`, t).then(n),
284
+ discard: (l) => g.http.post(`${o}/${l}/discard`, {}).then(n),
285
+ versions: (l) => g.http.get(`${o}/${l}/versions`).then(n),
286
+ restoreVersion: (l, t) => g.http.post(`${o}/${l}/versions/${t}/restore`, {}).then(n),
287
+ tags: (l = "") => {
288
+ const t = l.trim() === "" ? "" : `?q=${encodeURIComponent(l.trim())}`;
289
+ return g.http.get(`${w}${t}`).then(n);
344
290
  },
345
- createTag: (a) => f.http.post(y, a).then(u),
346
- publish: (a, t) => f.http.post(`${m}/${a}/publish`, t == null ? {} : { at: t }).then(u),
347
- unpublish: (a) => f.http.post(`${m}/${a}/unpublish`, {}).then(u),
348
- remove: (a) => f.http.delete(`${m}/${a}`).then(() => {
291
+ createTag: (l) => g.http.post(w, l).then(n),
292
+ publish: (l, t) => g.http.post(`${o}/${l}/publish`, t == null ? {} : { at: t }).then(n),
293
+ unpublish: (l) => g.http.post(`${o}/${l}/unpublish`, {}).then(n),
294
+ remove: (l) => g.http.delete(`${o}/${l}`).then(() => {
349
295
  }),
350
- restore: (a) => f.http.post(`${m}/${a}/restore`, {}).then(u),
351
- rubrics: () => f.http.get(r),
352
- createRubric: (a) => f.http.post(r, a).then(u),
353
- saveRubric: (a, t) => f.http.put(`${r}/${a}`, t).then(u),
354
- removeRubric: (a) => f.http.delete(`${r}/${a}`).then(() => {
296
+ restore: (l) => g.http.post(`${o}/${l}/restore`, {}).then(n),
297
+ rubrics: () => g.http.get(c),
298
+ createRubric: (l) => g.http.post(c, l).then(n),
299
+ saveRubric: (l, t) => g.http.put(`${c}/${l}`, t).then(n),
300
+ removeRubric: (l) => g.http.delete(`${c}/${l}`).then(() => {
355
301
  }),
356
- sortRubrics: (a) => f.http.post(`${r}/reorder`, { ids: a }).then(() => {
302
+ sortRubrics: (l) => g.http.post(`${c}/reorder`, { ids: l }).then(() => {
357
303
  }),
358
- tagsPage: (a = {}) => {
304
+ tagsPage: (l = {}) => {
359
305
  const t = new URLSearchParams();
360
- a.q && t.set("q", a.q), a.empty && t.set("empty", "1"), a.noindex && t.set("noindex", "1"), a.sort && t.set("sort", a.sort), a.page && a.page > 1 && t.set("page", String(a.page)), a.per_page && t.set("per_page", String(a.per_page));
361
- const s = t.size > 0 ? `?${t}` : "";
362
- return f.http.get(`${y}${s}`).then((i) => ({ ...i.meta, data: i.data, filters: i.filters }));
306
+ l.q && t.set("q", l.q), l.empty && t.set("empty", "1"), l.noindex && t.set("noindex", "1"), l.sort && t.set("sort", l.sort), l.page && l.page > 1 && t.set("page", String(l.page)), l.per_page && t.set("per_page", String(l.per_page));
307
+ const u = t.size > 0 ? `?${t}` : "";
308
+ return g.http.get(`${w}${u}`).then((a) => ({ ...a.meta, data: a.data, filters: a.filters }));
363
309
  },
364
- saveTag: (a, t) => f.http.put(`${y}/${a}`, t).then(u),
365
- removeTag: (a) => f.http.delete(`${y}/${a}`).then(() => {
310
+ saveTag: (l, t) => g.http.put(`${w}/${l}`, t).then(n),
311
+ removeTag: (l) => g.http.delete(`${w}/${l}`).then(() => {
366
312
  }),
367
- massTags: (a, t) => f.http.post(`${y}/mass`, { ids: a, action: t }).then((s) => s.data.affected),
368
- mergeTags: (a, t, s) => f.http.post(`${y}/merge`, { ids: a, keep: t, redirect: s }).then(u)
313
+ massTags: (l, t) => g.http.post(`${w}/mass`, { ids: l, action: t }).then((u) => u.data.affected),
314
+ mergeTags: (l, t, u) => g.http.post(`${w}/merge`, { ids: l, keep: t, redirect: u }).then(n)
369
315
  };
370
316
  }
371
- const Pt = { class: "wx-article-editor__screen" }, Dt = 1200, It = /* @__PURE__ */ ee({
317
+ const It = { class: "wx-article-editor__screen" }, Pt = 1200, Bt = /* @__PURE__ */ X({
372
318
  __name: "ArticleEditorPage",
373
319
  props: {
374
320
  base: { default: "/blog" }
375
321
  },
376
- setup(f) {
377
- const m = f, r = ne(), y = de(r), u = He(), a = Ke(), t = Xe(), s = mt();
378
- te();
379
- const i = Q("webx-blog"), x = ge(), T = v(() => Number(u.params.id)), c = v(() => `${m.base}/articles`), o = z(null), _ = z({}), W = z(""), S = z(""), E = z(null), F = z({ rubrics: [], authors: [] }), $ = z([]), U = z(!0), R = z(!1), M = z(!1), A = z({}), I = z(null), K = z(""), P = z(0), q = v(() => r.can("blog.articles.manage")), k = v(() => !q.value || M.value), le = v(() => JSON.stringify(_.value)), O = v(() => K.value !== "" && le.value !== K.value), se = v(() => R.value ? "saving" : O.value ? "unsaved" : "saved"), xe = v(() => {
380
- const V = _.value.title;
381
- return wt(V, t.active.value, o.value?.title ?? "");
382
- }), ce = v(() => {
383
- const V = _.value.published_at;
322
+ setup(g) {
323
+ const o = g, c = ne(), w = re(c), n = Le(), l = Fe(), t = Qe(), u = ht();
324
+ Y();
325
+ const a = Q("webx-blog"), x = pe(), b = p(() => Number(n.params.id)), d = p(() => `${o.base}/articles`), f = U(null), v = U({}), S = U(""), W = U(""), O = U(null), L = U({ rubrics: [], authors: [] }), $ = U([]), C = U(!0), q = U(!1), N = U(!1), A = U({}), E = U(null), y = U(""), K = U(0), k = p(() => c.can("blog.articles.manage")), P = p(() => !k.value || N.value), B = p(() => JSON.stringify(v.value)), Z = p(() => y.value !== "" && B.value !== y.value), be = p(() => q.value ? "saving" : Z.value ? "unsaved" : "saved"), xe = p(() => {
326
+ const V = v.value.title;
327
+ return $t(V, t.active.value, f.value?.title ?? "");
328
+ }), de = p(() => {
329
+ const V = v.value.published_at;
384
330
  return typeof V == "string" && V !== "" ? V : null;
385
- }), he = v(() => {
386
- if (ce.value === null) return !1;
387
- const V = new Date(ce.value.replace(" ", "T"));
331
+ }), me = p(() => {
332
+ if (de.value === null) return !1;
333
+ const V = new Date(de.value.replace(" ", "T"));
388
334
  return !Number.isNaN(V.valueOf()) && V.valueOf() > Date.now();
389
- }), Te = v(() => {
390
- const V = o.value;
335
+ }), We = p(() => {
336
+ const V = f.value;
391
337
  if (!V) return "";
392
- const Y = s.short(V.published_at);
338
+ const te = u.short(V.published_at);
393
339
  return {
394
- draft: i("article.live-never"),
395
- scheduled: i("article.live-scheduled", { date: Y }),
396
- published: i("article.live-since", { date: Y }),
397
- modified: `${i("article.live-since", { date: Y })} · ${i("article.live-edited")}`,
398
- unpublished: i("article.live-off")
340
+ scheduled: a("article.live-scheduled", { date: te }),
341
+ published: a("article.live-since", { date: te }),
342
+ modified: a("article.live-since", { date: te })
399
343
  }[V.status] ?? "";
400
344
  });
401
- zt({ url: v(() => E.value), reload: P }), Rt({
402
- article: o,
403
- values: _,
404
- options: F,
345
+ Rt({ url: p(() => O.value), reload: K }), Mt({
346
+ article: f,
347
+ values: v,
348
+ options: L,
405
349
  related: $,
406
- prefix: S,
407
- base: m.base,
408
- canManage: q.value,
409
- disabled: k,
410
- reload: () => pe(!0),
411
- save: () => N()
350
+ prefix: W,
351
+ base: o.base,
352
+ canManage: k.value,
353
+ disabled: P,
354
+ reload: () => fe(!0),
355
+ save: () => R()
412
356
  });
413
357
  function ke(V) {
414
- o.value = V.article, _.value = V.values, W.value = V.revision, S.value = V.prefix, E.value = V.preview_url, F.value = V.options, $.value = V.related, K.value = JSON.stringify(V.values), I.value = null;
358
+ f.value = V.article, v.value = V.values, S.value = V.revision, W.value = V.prefix, O.value = V.preview_url, L.value = V.options, $.value = V.related, y.value = JSON.stringify(V.values), E.value = null;
415
359
  }
416
- async function pe(V = !1) {
417
- V || (U.value = !0);
360
+ async function fe(V = !1) {
361
+ V || (C.value = !0);
418
362
  try {
419
- ke(await y.get(T.value));
420
- } catch (Y) {
421
- L.danger(x(Y)), a.push(c.value);
363
+ ke(await w.get(b.value));
364
+ } catch (te) {
365
+ F.danger(x(te)), l.push(d.value);
422
366
  } finally {
423
- U.value = !1;
367
+ C.value = !1;
424
368
  }
425
369
  }
426
- let re;
427
- function fe() {
428
- !q.value || I.value || !O.value || (clearTimeout(re), re = setTimeout(() => {
429
- N();
430
- }, Dt));
370
+ let oe;
371
+ function ge() {
372
+ !k.value || E.value || !Z.value || (clearTimeout(oe), oe = setTimeout(() => {
373
+ R();
374
+ }, Pt));
431
375
  }
432
- function g() {
433
- !q.value || I.value || !O.value || R.value || (clearTimeout(re), N());
376
+ function m() {
377
+ !k.value || E.value || !Z.value || q.value || (clearTimeout(oe), R());
434
378
  }
435
- async function N() {
436
- if (!o.value || R.value || !q.value) return;
437
- clearTimeout(re);
438
- const V = le.value, Y = _.value;
439
- R.value = !0, A.value = {};
379
+ async function R() {
380
+ if (!f.value || q.value || !k.value) return;
381
+ clearTimeout(oe);
382
+ const V = B.value, te = v.value;
383
+ q.value = !0, A.value = {};
440
384
  try {
441
- const ae = await y.save(o.value.id, { values: Y, revision: W.value });
442
- o.value = ae.article, W.value = ae.revision, S.value = ae.prefix, E.value = ae.preview_url, F.value = ae.options, $.value = ae.related, I.value = null, le.value === V && (K.value = V), P.value += 1;
385
+ const ae = await w.save(f.value.id, { values: te, revision: S.value });
386
+ f.value = ae.article, S.value = ae.revision, W.value = ae.prefix, O.value = ae.preview_url, L.value = ae.options, $.value = ae.related, E.value = null, B.value === V && (y.value = V), K.value += 1;
443
387
  } catch (ae) {
444
- const Ve = ae;
445
- Ve.status === 409 && Ve.body?.data ? I.value = Ve.body : Ve.body?.errors ? (A.value = Ve.body.errors, L.danger(i("article.save-failed"))) : L.danger(x(ae));
388
+ const Se = ae;
389
+ Se.status === 409 && Se.body?.data ? E.value = Se.body : Se.body?.errors ? (A.value = Se.body.errors, F.danger(a("article.save-failed"))) : F.danger(x(ae));
446
390
  } finally {
447
- R.value = !1;
391
+ q.value = !1;
448
392
  }
449
393
  }
450
- async function B() {
451
- await me({
452
- title: i("article.conflict-theirs-title"),
453
- message: i("article.conflict-theirs-text"),
454
- confirmText: i("article.conflict-theirs"),
455
- cancelText: i("panel.cancel"),
394
+ async function I() {
395
+ await ve({
396
+ title: a("article.conflict-theirs-title"),
397
+ message: a("article.conflict-theirs-text"),
398
+ confirmText: a("article.conflict-theirs"),
399
+ cancelText: a("panel.cancel"),
456
400
  tone: "danger"
457
- }) && await pe(!0);
458
- }
459
- async function X() {
460
- const V = I.value;
461
- V && (W.value = V.data.revision, I.value = null, await N());
462
- }
463
- async function ye() {
464
- if (!(!o.value || !await me({
465
- title: i("article.discard-title"),
466
- message: i("article.discard-text"),
467
- confirmText: i("article.discard"),
468
- cancelText: i("panel.cancel"),
401
+ }) && await fe(!0);
402
+ }
403
+ async function ee() {
404
+ const V = E.value;
405
+ V && (S.value = V.data.revision, E.value = null, await R());
406
+ }
407
+ async function he() {
408
+ if (!(!f.value || !await ve({
409
+ title: a("article.discard-title"),
410
+ message: a("article.discard-text"),
411
+ confirmText: a("article.discard"),
412
+ cancelText: a("panel.cancel"),
469
413
  tone: "danger"
470
414
  }))) {
471
- M.value = !0;
415
+ N.value = !0;
472
416
  try {
473
- ke(await y.discard(o.value.id)), L.success(i("article.discarded"));
474
- } catch (Y) {
475
- L.danger(x(Y));
417
+ ke(await w.discard(f.value.id)), F.success(a("article.discarded"));
418
+ } catch (te) {
419
+ F.danger(x(te));
476
420
  } finally {
477
- M.value = !1;
421
+ N.value = !1;
478
422
  }
479
423
  }
480
424
  }
481
- async function d() {
482
- const V = o.value;
425
+ async function r() {
426
+ const V = f.value;
483
427
  if (!V) return;
484
- const Y = V.path === null ? null : `/${V.path}`, ae = ce.value === null ? i("article.publish-now") : s.short(ce.value);
485
- if (await me({
486
- title: i("article.publish-title", { title: V.title }),
487
- message: he.value ? i("article.publish-later", { date: ae }) : Y === null ? i("article.publish-nowhere") : i("article.publish-text", { address: Y }),
488
- confirmText: he.value ? i("article.schedule") : i("panel.publish"),
489
- cancelText: i("panel.cancel")
490
- }) && (O.value && await N(), !I.value)) {
491
- M.value = !0;
428
+ const te = V.path === null ? null : `/${V.path}`, ae = de.value === null ? a("article.publish-now") : u.short(de.value);
429
+ if (await ve({
430
+ title: a("article.publish-title", { title: V.title }),
431
+ message: me.value ? a("article.publish-later", { date: ae }) : te === null ? a("article.publish-nowhere") : a("article.publish-text", { address: te }),
432
+ confirmText: me.value ? a("article.schedule") : a("panel.publish"),
433
+ cancelText: a("panel.cancel")
434
+ }) && (Z.value && await R(), !E.value)) {
435
+ N.value = !0;
492
436
  try {
493
- await y.publish(V.id, ce.value), await pe(!0), L.success(he.value ? i("article.scheduled") : i("panel.published"));
437
+ await w.publish(V.id, de.value), await fe(!0), F.success(me.value ? a("article.scheduled") : a("panel.published"));
494
438
  } catch (dt) {
495
- L.danger(x(dt));
439
+ F.danger(x(dt));
496
440
  } finally {
497
- M.value = !1;
441
+ N.value = !1;
498
442
  }
499
443
  }
500
444
  }
501
445
  function D() {
502
- const V = o.value?.status;
446
+ const V = f.value?.status;
503
447
  return V === "published" ? "success" : V === "modified" ? "warning" : V === "scheduled" ? "primary" : "default";
504
448
  }
505
- function h(V) {
506
- O.value && V.preventDefault();
507
- }
508
- ue(le, fe), ue(T, () => {
509
- pe();
510
- }), Ne(() => {
511
- pe(), window.addEventListener("beforeunload", h);
512
- }), Je(() => {
513
- clearTimeout(re), window.removeEventListener("beforeunload", h);
514
- }), Ct(async () => !O.value || !q.value || (await N(), !O.value) ? !0 : await me({
515
- title: i("article.leave-title"),
516
- message: i("article.leave-text"),
517
- confirmText: i("article.leave"),
518
- cancelText: i("panel.cancel"),
449
+ function _(V) {
450
+ Z.value && V.preventDefault();
451
+ }
452
+ ue(B, ge), ue(b, () => {
453
+ fe();
454
+ }), Be(() => {
455
+ fe(), window.addEventListener("beforeunload", _);
456
+ }), je(() => {
457
+ clearTimeout(oe), window.removeEventListener("beforeunload", _);
458
+ }), Ut(async () => !Z.value || !k.value || (await R(), !Z.value) ? !0 : await ve({
459
+ title: a("article.leave-title"),
460
+ message: a("article.leave-text"),
461
+ confirmText: a("article.leave"),
462
+ cancelText: a("panel.cancel"),
519
463
  tone: "danger"
520
464
  }));
521
- const $e = v(() => {
465
+ const $e = p(() => {
522
466
  const V = [];
523
- return E.value && V.push({ key: "preview", label: i("article.preview"), icon: "eye", href: E.value }), o.value?.url && o.value.status !== "draft" && V.push({
467
+ return O.value && V.push({ key: "preview", label: a("article.preview"), icon: "eye", href: O.value }), f.value?.url && f.value.status !== "draft" && V.push({
524
468
  key: "site",
525
- label: i("panel.open-on-site"),
469
+ label: a("panel.open-on-site"),
526
470
  icon: "link",
527
- href: o.value.url
471
+ href: f.value.url
472
+ }), f.value?.status === "modified" && V.push({
473
+ key: "discard",
474
+ label: a("article.discard"),
475
+ icon: "refresh",
476
+ danger: !0,
477
+ menu: !0,
478
+ run: () => {
479
+ he();
480
+ }
528
481
  }), V;
529
482
  });
530
- return (V, Y) => (p(), Z("div", {
483
+ return (V, te) => (h(), G("div", {
531
484
  class: "wx-article-editor",
532
- onFocusout: g
485
+ onFocusout: m
533
486
  }, [
534
- U.value || !o.value ? (p(), Z(be, { key: 0 }, [
535
- n(e(Ue), {
487
+ C.value || !f.value ? (h(), G(_e, { key: 0 }, [
488
+ s(e(Ne), {
536
489
  class: "wx-article-editor__ghost",
537
490
  title: "",
538
491
  rows: 1
539
492
  }),
540
- n(e(Ue), { rows: 8 })
541
- ], 64)) : (p(), Z(be, { key: 1 }, [
542
- n(e(bt), {
493
+ s(e(Tt), null, {
494
+ default: i(() => [
495
+ s(e(Ne), { rows: 8 })
496
+ ]),
497
+ _: 1
498
+ })
499
+ ], 64)) : (h(), G(_e, { key: 1 }, [
500
+ s(e(yt), {
543
501
  divider: "",
544
- back: c.value,
545
- "back-label": e(i)("module.articles"),
546
- title: xe.value || e(i)("article.untitled"),
502
+ back: d.value,
503
+ "back-label": e(a)("module.articles"),
504
+ title: xe.value || e(a)("article.untitled"),
505
+ subtitle: We.value,
547
506
  actions: $e.value
548
507
  }, {
549
- trail: l(() => [
550
- n(e(_t), {
508
+ trail: i(() => [
509
+ s(e(Vt), {
551
510
  size: "sm",
552
- label: e(i)("article.trail")
511
+ label: e(a)("article.trail")
553
512
  }, {
554
- default: l(() => [
555
- n(e(lt), {
513
+ default: i(() => [
514
+ s(e(at), {
556
515
  as: "router-link",
557
- to: c.value
516
+ to: d.value
558
517
  }, {
559
- default: l(() => [
560
- w(b(e(i)("module.articles")), 1)
518
+ default: i(() => [
519
+ z(T(e(a)("module.articles")), 1)
561
520
  ]),
562
521
  _: 1
563
522
  }, 8, ["to"]),
564
- n(e(lt), { current: "" }, {
565
- default: l(() => [
566
- w(b(xe.value || e(i)("article.untitled")), 1)
523
+ s(e(at), { current: "" }, {
524
+ default: i(() => [
525
+ z(T(xe.value || e(a)("article.untitled")), 1)
567
526
  ]),
568
527
  _: 1
569
528
  })
@@ -571,581 +530,653 @@ const Pt = { class: "wx-article-editor__screen" }, Dt = 1200, It = /* @__PURE__
571
530
  _: 1
572
531
  }, 8, ["label"])
573
532
  ]),
574
- "title-after": l(() => [
575
- n(e(oe), {
533
+ "title-after": i(() => [
534
+ s(e(se), {
576
535
  type: D(),
577
536
  dot: ""
578
537
  }, {
579
- default: l(() => [
580
- w(b(e(i)(`panel.status-${o.value.status}`)), 1)
538
+ default: i(() => [
539
+ z(T(e(a)(`panel.status-${f.value.status}`)), 1)
581
540
  ]),
582
541
  _: 1
583
- }, 8, ["type"])
542
+ }, 8, ["type"]),
543
+ f.value.status === "modified" ? (h(), M(e(se), {
544
+ key: 0,
545
+ type: "primary",
546
+ round: ""
547
+ }, {
548
+ default: i(() => [
549
+ z(T(e(a)("panel.edits")), 1)
550
+ ]),
551
+ _: 1
552
+ })) : j("", !0)
584
553
  ]),
585
554
  _: 1
586
- }, 8, ["back", "back-label", "title", "actions"]),
587
- I.value ? (p(), C(e(We), {
555
+ }, 8, ["back", "back-label", "title", "subtitle", "actions"]),
556
+ E.value ? (h(), M(e(we), {
588
557
  key: 0,
589
558
  type: "warning",
590
- title: e(i)("article.conflict-title"),
591
- description: I.value.message
559
+ title: e(a)("article.conflict-title"),
560
+ description: E.value.message
592
561
  }, {
593
- actions: l(() => [
594
- n(e(J), {
562
+ actions: i(() => [
563
+ s(e(J), {
595
564
  size: "sm",
596
565
  variant: "outline",
597
- onClick: B
566
+ onClick: I
598
567
  }, {
599
- default: l(() => [
600
- w(b(e(i)("article.conflict-theirs")), 1)
568
+ default: i(() => [
569
+ z(T(e(a)("article.conflict-theirs")), 1)
601
570
  ]),
602
571
  _: 1
603
572
  }),
604
- n(e(J), {
573
+ s(e(J), {
605
574
  size: "sm",
606
575
  type: "primary",
607
- onClick: X
576
+ onClick: ee
608
577
  }, {
609
- default: l(() => [
610
- w(b(e(i)("article.conflict-mine")), 1)
578
+ default: i(() => [
579
+ z(T(e(a)("article.conflict-mine")), 1)
611
580
  ]),
612
581
  _: 1
613
582
  })
614
583
  ]),
615
584
  _: 1
616
- }, 8, ["title", "description"])) : H("", !0),
617
- j("div", Pt, [
618
- n(e(gt), {
619
- modelValue: _.value,
620
- "onUpdate:modelValue": Y[0] || (Y[0] = (ae) => _.value = ae),
585
+ }, 8, ["title", "description"])) : j("", !0),
586
+ H("div", It, [
587
+ s(e(wt), {
588
+ modelValue: v.value,
589
+ "onUpdate:modelValue": te[0] || (te[0] = (ae) => v.value = ae),
621
590
  name: "blog.article-form",
622
591
  errors: A.value,
623
- disabled: k.value
592
+ disabled: P.value
624
593
  }, null, 8, ["modelValue", "errors", "disabled"])
625
594
  ]),
626
- q.value ? (p(), C(e(rt), { key: 1 }, {
627
- state: l(() => [
628
- n(e(ht), { state: se.value }, null, 8, ["state"]),
629
- Te.value ? (p(), C(e(G), {
630
- key: 0,
631
- size: "sm",
632
- tone: "muted"
633
- }, {
634
- default: l(() => [
635
- w(b(Te.value), 1)
636
- ]),
637
- _: 1
638
- })) : H("", !0)
595
+ k.value ? (h(), M(e(st), { key: 1 }, {
596
+ state: i(() => [
597
+ s(e(_t), { state: be.value }, null, 8, ["state"])
639
598
  ]),
640
- default: l(() => [
641
- o.value.status === "modified" ? (p(), C(e(J), {
642
- key: 0,
643
- variant: "text",
644
- loading: M.value,
645
- onClick: ye
646
- }, {
647
- default: l(() => [
648
- w(b(e(i)("article.discard")), 1)
649
- ]),
650
- _: 1
651
- }, 8, ["loading"])) : H("", !0),
652
- n(e(J), {
599
+ default: i(() => [
600
+ s(e(J), {
653
601
  variant: "outline",
654
- loading: R.value,
655
- disabled: !O.value,
656
- onClick: N
602
+ loading: q.value,
603
+ disabled: !Z.value,
604
+ onClick: R
657
605
  }, {
658
- default: l(() => [
659
- w(b(e(i)("article.save")), 1)
606
+ default: i(() => [
607
+ z(T(e(a)("article.save")), 1)
660
608
  ]),
661
609
  _: 1
662
610
  }, 8, ["loading", "disabled"]),
663
- n(e(J), {
611
+ s(e(J), {
664
612
  type: "primary",
665
- loading: M.value,
666
- disabled: o.value.status === "published" && !O.value,
667
- onClick: d
613
+ loading: N.value,
614
+ disabled: f.value.status === "published" && !Z.value,
615
+ onClick: r
668
616
  }, {
669
- default: l(() => [
670
- w(b(he.value ? e(i)("article.schedule") : e(i)("panel.publish")), 1)
617
+ default: i(() => [
618
+ z(T(me.value ? e(a)("article.schedule") : e(a)("panel.publish")), 1)
671
619
  ]),
672
620
  _: 1
673
621
  }, 8, ["loading", "disabled"])
674
622
  ]),
675
623
  _: 1
676
- })) : H("", !0)
624
+ })) : j("", !0)
677
625
  ], 64))
678
626
  ], 32));
679
627
  }
680
- }), Ot = /* @__PURE__ */ ve(It, [["__scopeId", "data-v-45a48838"]]), Et = { class: "wx-article-history" }, Ft = { class: "wx-article-history__number" }, Lt = { class: "wx-article-history__who" }, Ht = /* @__PURE__ */ ee({
628
+ }), ce = (g, o) => {
629
+ const c = g.__vccOpts || g;
630
+ for (const [w, n] of o)
631
+ c[w] = n;
632
+ return c;
633
+ }, Dt = /* @__PURE__ */ ce(Bt, [["__scopeId", "data-v-d3973be7"]]), Et = { class: "wx-article-history" }, Ot = { class: "wx-article-history__number" }, Lt = { class: "wx-article-history__who" }, Ft = /* @__PURE__ */ X({
681
634
  name: "WxArticleHistory",
682
635
  __name: "ArticleHistory",
683
- setup(f) {
684
- const m = ne(), r = de(m), y = Se();
685
- te();
686
- const u = Q("webx-blog"), a = ge(), t = z(null), s = z(!1), i = v(() => y?.article.value ?? null), x = v(() => m.can("blog.articles.manage")), T = v(
687
- () => i.value?.status === "published" || i.value?.status === "modified" ? t.value?.[0]?.number ?? null : null
636
+ setup(g) {
637
+ const o = ne(), c = re(o), w = Ae();
638
+ Y();
639
+ const n = Q("webx-blog"), l = pe(), t = U(null), u = U(!1), a = p(() => w?.article.value ?? null), x = p(() => o.can("blog.articles.manage")), b = p(
640
+ () => a.value?.status === "published" || a.value?.status === "modified" ? t.value?.[0]?.number ?? null : null
688
641
  );
689
- async function c() {
690
- const _ = i.value;
691
- if (_)
642
+ async function d() {
643
+ const v = a.value;
644
+ if (v)
692
645
  try {
693
- t.value = await r.versions(_.id);
694
- } catch (W) {
695
- t.value = [], L.danger(a(W));
646
+ t.value = await c.versions(v.id);
647
+ } catch (S) {
648
+ t.value = [], F.danger(l(S));
696
649
  }
697
650
  }
698
- async function o(_) {
699
- const W = i.value;
700
- if (!(!W || !await me({
701
- title: u("article.restore-title", { number: _.number }),
702
- message: u("article.restore-text"),
703
- confirmText: u("article.restore-version"),
704
- cancelText: u("panel.cancel")
651
+ async function f(v) {
652
+ const S = a.value;
653
+ if (!(!S || !await ve({
654
+ title: n("article.restore-title", { number: v.number }),
655
+ message: n("article.restore-text"),
656
+ confirmText: n("article.restore-version"),
657
+ cancelText: n("panel.cancel")
705
658
  }))) {
706
- s.value = !0;
659
+ u.value = !0;
707
660
  try {
708
- await r.restoreVersion(W.id, _.number), await y?.reload(), L.success(u("article.restored-version", { number: _.number }));
709
- } catch (E) {
710
- L.danger(a(E));
661
+ await c.restoreVersion(S.id, v.number), await w?.reload(), F.success(n("article.restored-version", { number: v.number }));
662
+ } catch (O) {
663
+ F.danger(l(O));
711
664
  } finally {
712
- s.value = !1;
665
+ u.value = !1;
713
666
  }
714
667
  }
715
668
  }
716
669
  return ue(
717
- () => [i.value?.id, i.value?.published_at, i.value?.updated_at],
670
+ () => [a.value?.id, a.value?.published_at, a.value?.updated_at],
718
671
  () => {
719
- c();
672
+ d();
720
673
  },
721
674
  { immediate: !0 }
722
- ), (_, W) => (p(), Z("div", Et, [
723
- t.value === null ? (p(), C(e(Ue), {
675
+ ), (v, S) => (h(), G("div", Et, [
676
+ t.value === null ? (h(), M(e(Ne), {
724
677
  key: 0,
725
678
  class: "wx-article-history__ghost",
726
679
  rows: 3
727
- })) : t.value.length === 0 ? (p(), C(e(Ge), {
680
+ })) : t.value.length === 0 ? (h(), M(e(rt), {
728
681
  key: 1,
729
- description: e(u)("article.history-empty")
730
- }, null, 8, ["description"])) : (p(!0), Z(be, { key: 2 }, Be(t.value, (S) => (p(), Z("div", {
731
- key: S.number,
732
- class: Pe(["wx-article-history__row", { "is-live": S.number === T.value }])
682
+ description: e(n)("article.history-empty")
683
+ }, null, 8, ["description"])) : (h(!0), G(_e, { key: 2 }, De(t.value, (W) => (h(), G("div", {
684
+ key: W.number,
685
+ class: Ge(["wx-article-history__row", { "is-live": W.number === b.value }])
733
686
  }, [
734
- j("code", Ft, b(e(u)("article.version", { number: S.number })), 1),
735
- j("div", Lt, [
736
- S.created_at ? (p(), C(e(je), {
687
+ H("code", Ot, T(e(n)("article.version", { number: W.number })), 1),
688
+ H("div", Lt, [
689
+ W.created_at ? (h(), M(e(He), {
737
690
  key: 0,
738
- value: S.created_at,
691
+ value: W.created_at,
739
692
  size: "md",
740
693
  tone: "default"
741
- }, null, 8, ["value"])) : H("", !0),
742
- n(e(G), {
694
+ }, null, 8, ["value"])) : j("", !0),
695
+ s(e(le), {
743
696
  size: "sm",
744
697
  tone: "muted"
745
698
  }, {
746
- default: l(() => [
747
- w(b(S.author ?? e(u)(`article.source-${S.source}`)) + " ", 1),
748
- S.comment ? (p(), Z(be, { key: 0 }, [
749
- w(" · " + b(S.comment), 1)
750
- ], 64)) : H("", !0)
699
+ default: i(() => [
700
+ z(T(W.author ?? e(n)(`article.source-${W.source}`)) + " ", 1),
701
+ W.comment ? (h(), G(_e, { key: 0 }, [
702
+ z(" · " + T(W.comment), 1)
703
+ ], 64)) : j("", !0)
751
704
  ]),
752
705
  _: 2
753
706
  }, 1024)
754
707
  ]),
755
- S.number === T.value ? (p(), C(e(oe), {
708
+ W.number === b.value ? (h(), M(e(se), {
756
709
  key: 0,
757
710
  type: "success",
758
711
  dot: ""
759
712
  }, {
760
- default: l(() => [
761
- w(b(e(u)("article.version-live")), 1)
713
+ default: i(() => [
714
+ z(T(e(n)("article.version-live")), 1)
762
715
  ]),
763
716
  _: 1
764
- })) : H("", !0),
765
- x.value && S.number !== T.value ? (p(), C(e(J), {
717
+ })) : j("", !0),
718
+ x.value && W.number !== b.value ? (h(), M(e(J), {
766
719
  key: 1,
767
720
  size: "sm",
768
721
  variant: "outline",
769
- loading: s.value,
770
- onClick: (E) => o(S)
722
+ loading: u.value,
723
+ onClick: (O) => f(W)
771
724
  }, {
772
- default: l(() => [
773
- w(b(e(u)("article.restore-version")), 1)
725
+ default: i(() => [
726
+ z(T(e(n)("article.restore-version")), 1)
774
727
  ]),
775
728
  _: 1
776
- }, 8, ["loading", "onClick"])) : H("", !0)
729
+ }, 8, ["loading", "onClick"])) : j("", !0)
777
730
  ], 2))), 128))
778
731
  ]));
779
732
  }
780
- }), Kt = /* @__PURE__ */ ve(Ht, [["__scopeId", "data-v-0a997938"]]), jt = { class: "wx-article-related" }, Gt = { class: "wx-article-related__name" }, Jt = 250, Zt = 10, Qt = /* @__PURE__ */ ee({
733
+ }), Kt = /* @__PURE__ */ ce(Ft, [["__scopeId", "data-v-0a997938"]]), Ht = { class: "wx-article-related" }, jt = { class: "wx-article-related__name" }, Gt = 250, Jt = 10, Zt = /* @__PURE__ */ X({
781
734
  name: "WxArticleRelated",
782
735
  __name: "ArticleRelated",
783
- props: /* @__PURE__ */ Me({
736
+ props: /* @__PURE__ */ Pe({
784
737
  disabled: { type: Boolean, default: !1 }
785
738
  }, {
786
739
  modelValue: { default: () => [] },
787
740
  modelModifiers: {}
788
741
  }),
789
742
  emits: ["update:modelValue"],
790
- setup(f) {
791
- const m = f, r = qe(f, "modelValue"), y = ne(), u = de(y), a = Se();
792
- te();
793
- const t = Q("webx-blog"), s = ge(), i = v(() => m.disabled || a?.disabled.value === !0), x = z(/* @__PURE__ */ new Map()), T = z([]);
794
- let c;
743
+ setup(g) {
744
+ const o = g, c = Ie(g, "modelValue"), w = ne(), n = re(w), l = Ae();
745
+ Y();
746
+ const t = Q("webx-blog"), u = pe(), a = p(() => o.disabled || l?.disabled.value === !0), x = U(/* @__PURE__ */ new Map()), b = U([]);
747
+ let d;
795
748
  ue(
796
- () => a?.related.value,
749
+ () => l?.related.value,
797
750
  ($) => {
798
- const U = new Map(x.value);
799
- for (const R of $ ?? []) U.set(R.id, R.title);
800
- x.value = U;
751
+ const C = new Map(x.value);
752
+ for (const q of $ ?? []) C.set(q.id, q.title);
753
+ x.value = C;
801
754
  },
802
755
  { immediate: !0, deep: !0 }
803
756
  );
804
- const o = v({
805
- get: () => r.value.map(($) => ({ id: $, title: x.value.get($) ?? `#${$}` })),
757
+ const f = p({
758
+ get: () => c.value.map(($) => ({ id: $, title: x.value.get($) ?? `#${$}` })),
806
759
  set: ($) => {
807
- r.value = $.map((U) => U.id);
760
+ c.value = $.map((C) => C.id);
808
761
  }
809
- }), _ = v(
810
- () => T.value.filter(($) => !r.value.includes($.id)).map(($) => ({ label: $.title, value: $.id }))
762
+ }), v = p(
763
+ () => b.value.filter(($) => !c.value.includes($.id)).map(($) => ({ label: $.title, value: $.id }))
811
764
  );
812
- async function W($) {
813
- const U = a?.article.value?.id;
765
+ async function S($) {
766
+ const C = l?.article.value?.id;
814
767
  try {
815
- const R = await u.articles({ q: $, per_page: Zt });
816
- T.value = R.data.filter((A) => A.id !== U).map((A) => ({ id: A.id, title: A.title }));
817
- const M = new Map(x.value);
818
- for (const A of T.value) M.set(A.id, A.title);
819
- x.value = M;
820
- } catch (R) {
821
- L.danger(s(R));
768
+ const q = await n.articles({ q: $, per_page: Jt });
769
+ b.value = q.data.filter((A) => A.id !== C).map((A) => ({ id: A.id, title: A.title }));
770
+ const N = new Map(x.value);
771
+ for (const A of b.value) N.set(A.id, A.title);
772
+ x.value = N;
773
+ } catch (q) {
774
+ F.danger(u(q));
822
775
  }
823
776
  }
824
- function S($) {
825
- clearTimeout(c), c = setTimeout(() => {
826
- W($);
827
- }, Jt);
777
+ function W($) {
778
+ clearTimeout(d), d = setTimeout(() => {
779
+ S($);
780
+ }, Gt);
828
781
  }
829
- function E($) {
830
- typeof $ != "number" || r.value.includes($) || (r.value = [...r.value, $]);
782
+ function O($) {
783
+ typeof $ != "number" || c.value.includes($) || (c.value = [...c.value, $]);
831
784
  }
832
- function F($) {
833
- r.value = r.value.filter((U) => U !== $);
785
+ function L($) {
786
+ c.value = c.value.filter((C) => C !== $);
834
787
  }
835
788
  return ue(
836
- () => a?.article.value?.id,
789
+ () => l?.article.value?.id,
837
790
  () => {
838
- W("");
791
+ S("");
839
792
  },
840
793
  { immediate: !0 }
841
- ), Je(() => clearTimeout(c)), ($, U) => (p(), Z("div", jt, [
842
- n(e(Ye), {
843
- modelValue: o.value,
844
- "onUpdate:modelValue": U[0] || (U[0] = (R) => o.value = R),
794
+ ), je(() => clearTimeout(d)), ($, C) => (h(), G("div", Ht, [
795
+ s(e(Xe), {
796
+ modelValue: f.value,
797
+ "onUpdate:modelValue": C[0] || (C[0] = (q) => f.value = q),
845
798
  plain: "",
846
799
  size: "sm",
847
800
  "item-key": "id",
848
801
  "item-label": "title",
849
- disabled: i.value,
802
+ disabled: a.value,
850
803
  "empty-text": e(t)("article.related-empty"),
851
804
  "aria-label": e(t)("article.related")
852
805
  }, {
853
- default: l(({ item: R }) => [
854
- j("span", Gt, b(R.title), 1)
806
+ default: i(({ item: q }) => [
807
+ H("span", jt, T(q.title), 1)
855
808
  ]),
856
- actions: l(({ item: R }) => [
857
- n(e(Oe), {
809
+ actions: i(({ item: q }) => [
810
+ s(e(ot), {
858
811
  type: "remove",
859
812
  size: "sm",
860
- disabled: i.value,
813
+ disabled: a.value,
861
814
  title: e(t)("article.related-remove"),
862
- onClick: (M) => F(R.id)
815
+ onClick: (N) => L(q.id)
863
816
  }, null, 8, ["disabled", "title", "onClick"])
864
817
  ]),
865
818
  _: 1
866
819
  }, 8, ["modelValue", "disabled", "empty-text", "aria-label"]),
867
- n(e(_e), {
820
+ s(e(ye), {
868
821
  "model-value": null,
869
- options: _.value,
822
+ options: v.value,
870
823
  placeholder: e(t)("article.related-add"),
871
824
  "empty-text": e(t)("article.related-nothing"),
872
- disabled: i.value,
825
+ disabled: a.value,
873
826
  filterable: "",
874
827
  teleport: "",
875
828
  "aria-label": e(t)("article.related-add"),
876
- onSearch: S,
877
- "onUpdate:modelValue": E
829
+ onSearch: W,
830
+ "onUpdate:modelValue": O
878
831
  }, null, 8, ["options", "placeholder", "empty-text", "disabled", "aria-label"])
879
832
  ]));
880
833
  }
881
- }), Xt = /* @__PURE__ */ ve(Qt, [["__scopeId", "data-v-164e86fe"]]), Yt = { class: "wx-article-rubrics" }, ea = { class: "wx-article-rubrics__name" }, ta = /* @__PURE__ */ ee({
834
+ }), Qt = /* @__PURE__ */ ce(Zt, [["__scopeId", "data-v-164e86fe"]]), Xt = { class: "wx-article-rubrics" }, Yt = { class: "wx-article-rubrics__name" }, ea = /* @__PURE__ */ X({
882
835
  name: "WxArticleRubrics",
883
836
  __name: "ArticleRubrics",
884
- props: /* @__PURE__ */ Me({
837
+ props: /* @__PURE__ */ Pe({
885
838
  disabled: { type: Boolean, default: !1 }
886
839
  }, {
887
840
  modelValue: { default: () => [] },
888
841
  modelModifiers: {}
889
842
  }),
890
843
  emits: ["update:modelValue"],
891
- setup(f) {
892
- const m = f, r = qe(f, "modelValue"), y = Se();
893
- te();
894
- const u = Q("webx-blog"), a = v(() => m.disabled || y?.disabled.value === !0), t = v(() => {
895
- const c = /* @__PURE__ */ new Map();
896
- for (const o of y?.options.value.rubrics ?? []) c.set(o.id, o.title);
897
- return c;
898
- }), s = v({
899
- get: () => r.value.map((c) => ({ id: c, title: t.value.get(c) ?? `#${c}` })),
900
- set: (c) => {
901
- r.value = c.map((o) => o.id);
844
+ setup(g) {
845
+ const o = g, c = Ie(g, "modelValue"), w = Ae();
846
+ Y();
847
+ const n = Q("webx-blog"), l = p(() => o.disabled || w?.disabled.value === !0), t = p(() => {
848
+ const d = /* @__PURE__ */ new Map();
849
+ for (const f of w?.options.value.rubrics ?? []) d.set(f.id, f.title);
850
+ return d;
851
+ }), u = p({
852
+ get: () => c.value.map((d) => ({ id: d, title: t.value.get(d) ?? `#${d}` })),
853
+ set: (d) => {
854
+ c.value = d.map((f) => f.id);
902
855
  }
903
- }), i = v(
904
- () => (y?.options.value.rubrics ?? []).filter((c) => !r.value.includes(c.id)).map((c) => ({ label: c.title, value: c.id }))
856
+ }), a = p(
857
+ () => (w?.options.value.rubrics ?? []).filter((d) => !c.value.includes(d.id)).map((d) => ({ label: d.title, value: d.id }))
905
858
  );
906
- function x(c) {
907
- typeof c != "number" || r.value.includes(c) || (r.value = [...r.value, c]);
859
+ function x(d) {
860
+ typeof d != "number" || c.value.includes(d) || (c.value = [...c.value, d]);
908
861
  }
909
- function T(c) {
910
- r.value = r.value.filter((o) => o !== c);
862
+ function b(d) {
863
+ c.value = c.value.filter((f) => f !== d);
911
864
  }
912
- return (c, o) => (p(), Z("div", Yt, [
913
- n(e(Ye), {
914
- modelValue: s.value,
915
- "onUpdate:modelValue": o[0] || (o[0] = (_) => s.value = _),
865
+ return (d, f) => (h(), G("div", Xt, [
866
+ s(e(Xe), {
867
+ modelValue: u.value,
868
+ "onUpdate:modelValue": f[0] || (f[0] = (v) => u.value = v),
916
869
  plain: "",
917
870
  size: "sm",
918
871
  "item-key": "id",
919
872
  "item-label": "title",
920
- disabled: a.value,
921
- "empty-text": e(u)("article.rubrics-empty"),
922
- "aria-label": e(u)("article.rubrics")
873
+ disabled: l.value,
874
+ "empty-text": e(n)("article.rubrics-empty"),
875
+ "aria-label": e(n)("article.rubrics")
923
876
  }, {
924
- default: l(({ item: _, index: W }) => [
925
- j("span", ea, b(_.title), 1),
926
- W === 0 ? (p(), C(e(oe), {
877
+ default: i(({ item: v, index: S }) => [
878
+ H("span", Yt, T(v.title), 1),
879
+ S === 0 ? (h(), M(e(se), {
927
880
  key: 0,
928
881
  type: "primary"
929
882
  }, {
930
- default: l(() => [
931
- w(b(e(u)("article.rubric-main")), 1)
883
+ default: i(() => [
884
+ z(T(e(n)("article.rubric-main")), 1)
932
885
  ]),
933
886
  _: 1
934
- })) : H("", !0)
887
+ })) : j("", !0)
935
888
  ]),
936
- actions: l(({ item: _ }) => [
937
- n(e(Oe), {
889
+ actions: i(({ item: v }) => [
890
+ s(e(ot), {
938
891
  type: "remove",
939
892
  size: "sm",
940
- disabled: a.value,
941
- title: e(u)("article.rubric-remove"),
942
- onClick: (W) => T(_.id)
893
+ disabled: l.value,
894
+ title: e(n)("article.rubric-remove"),
895
+ onClick: (S) => b(v.id)
943
896
  }, null, 8, ["disabled", "title", "onClick"])
944
897
  ]),
945
898
  _: 1
946
899
  }, 8, ["modelValue", "disabled", "empty-text", "aria-label"]),
947
- n(e(_e), {
900
+ s(e(ye), {
948
901
  "model-value": null,
949
- options: i.value,
950
- placeholder: e(u)("article.rubric-add"),
951
- disabled: a.value || i.value.length === 0,
952
- "empty-text": e(u)("article.rubric-none-left"),
902
+ options: a.value,
903
+ placeholder: e(n)("article.rubric-add"),
904
+ disabled: l.value || a.value.length === 0,
905
+ "empty-text": e(n)("article.rubric-none-left"),
953
906
  filterable: "",
954
907
  teleport: "",
955
- "aria-label": e(u)("article.rubric-add"),
908
+ "aria-label": e(n)("article.rubric-add"),
956
909
  "onUpdate:modelValue": x
957
910
  }, null, 8, ["options", "placeholder", "disabled", "empty-text", "aria-label"])
958
911
  ]));
959
912
  }
960
- }), aa = /* @__PURE__ */ ve(ta, [["__scopeId", "data-v-db8c5bc8"]]), la = { class: "wx-article-tags" }, ia = {
913
+ }), ta = /* @__PURE__ */ ce(ea, [["__scopeId", "data-v-76ca7a6f"]]), aa = { class: "wx-article-slug" }, la = { class: "wx-article-slug__prefix" }, ia = /* @__PURE__ */ X({
914
+ name: "WxArticleSlug",
915
+ inheritAttrs: !1,
916
+ __name: "ArticleSlug",
917
+ setup(g) {
918
+ const o = Ae(), c = Qe();
919
+ Y();
920
+ const w = Q("webx-blog"), n = p(() => {
921
+ const u = o?.prefix.value ?? "";
922
+ return u === "" ? "/" : `/${u}/`;
923
+ }), l = p(() => {
924
+ const u = o?.values.value.slug;
925
+ return typeof u == "string" ? u : u?.[c.active.value] ?? "";
926
+ }), t = p(() => {
927
+ const u = o?.article.value?.path;
928
+ return typeof u == "string" && l.value !== "" && `${n.value}${l.value}` != `/${u}`;
929
+ });
930
+ return (u, a) => (h(), G("div", aa, [
931
+ s(e(Ve), ft(gt(u.$attrs)), {
932
+ prefix: i(() => [
933
+ H("span", la, T(n.value), 1)
934
+ ]),
935
+ _: 1
936
+ }, 16),
937
+ t.value ? (h(), M(e(we), {
938
+ key: 0,
939
+ type: "info",
940
+ variant: "soft",
941
+ description: e(w)("article.address-moving")
942
+ }, null, 8, ["description"])) : j("", !0)
943
+ ]));
944
+ }
945
+ }), na = /* @__PURE__ */ ce(ia, [["__scopeId", "data-v-5da20e5e"]]), sa = { class: "wx-article-tags" }, ra = {
961
946
  key: 0,
962
947
  class: "wx-article-tags__chips"
963
- }, na = { class: "wx-article-tags__pick" }, sa = 250, ra = /* @__PURE__ */ ee({
948
+ }, oa = { class: "wx-article-tags__pick" }, ua = 250, ca = /* @__PURE__ */ X({
964
949
  name: "WxArticleTags",
965
950
  __name: "ArticleTags",
966
- props: /* @__PURE__ */ Me({
951
+ props: /* @__PURE__ */ Pe({
967
952
  disabled: { type: Boolean, default: !1 }
968
953
  }, {
969
954
  modelValue: { default: () => [] },
970
955
  modelModifiers: {}
971
956
  }),
972
957
  emits: ["update:modelValue"],
973
- setup(f) {
974
- const m = f, r = qe(f, "modelValue"), y = ne(), u = de(y), a = Se();
975
- te();
976
- const t = Q("webx-blog"), s = ge(), i = v(() => m.disabled || a?.disabled.value === !0), x = z(/* @__PURE__ */ new Map()), T = z([]), c = z(""), o = z(!1);
977
- let _;
958
+ setup(g) {
959
+ const o = g, c = Ie(g, "modelValue"), w = ne(), n = re(w), l = Ae();
960
+ Y();
961
+ const t = Q("webx-blog"), u = pe(), a = p(() => o.disabled || l?.disabled.value === !0), x = U(/* @__PURE__ */ new Map()), b = U([]), d = U(""), f = U(!1);
962
+ let v;
978
963
  ue(
979
- () => a?.article.value?.tags,
964
+ () => l?.article.value?.tags,
980
965
  (A) => {
981
- const I = new Map(x.value);
982
- for (const K of A ?? []) I.set(K.id, K.title);
983
- x.value = I;
966
+ const E = new Map(x.value);
967
+ for (const y of A ?? []) E.set(y.id, y.title);
968
+ x.value = E;
984
969
  },
985
970
  { immediate: !0, deep: !0 }
986
971
  );
987
- const W = v(
988
- () => r.value.map((A) => ({ id: A, title: x.value.get(A) ?? `#${A}` }))
989
- ), S = v(
990
- () => T.value.filter((A) => !r.value.includes(A.id)).map((A) => ({
972
+ const S = p(
973
+ () => c.value.map((A) => ({ id: A, title: x.value.get(A) ?? `#${A}` }))
974
+ ), W = p(
975
+ () => b.value.filter((A) => !c.value.includes(A.id)).map((A) => ({
991
976
  // The count is part of the label rather than a column: a select draws a line of text, and
992
977
  // the number is what the reader is choosing between two near-identical words on.
993
978
  label: t("article.tag-option", { title: A.title, count: A.articles_count }),
994
979
  value: A.id
995
980
  }))
996
- ), E = v(() => {
997
- const A = c.value.trim();
981
+ ), O = p(() => {
982
+ const A = d.value.trim();
998
983
  if (A === "") return null;
999
- const I = (K) => K.toLowerCase() === A.toLowerCase();
1000
- return T.value.some((K) => I(K.title)) ? null : A;
984
+ const E = (y) => y.toLowerCase() === A.toLowerCase();
985
+ return b.value.some((y) => E(y.title)) ? null : A;
1001
986
  });
1002
- async function F() {
987
+ async function L() {
1003
988
  try {
1004
- T.value = await u.tags(c.value);
989
+ b.value = await n.tags(d.value);
1005
990
  const A = new Map(x.value);
1006
- for (const I of T.value) A.set(I.id, I.title);
991
+ for (const E of b.value) A.set(E.id, E.title);
1007
992
  x.value = A;
1008
993
  } catch (A) {
1009
- L.danger(s(A));
994
+ F.danger(u(A));
1010
995
  }
1011
996
  }
1012
997
  function $(A) {
1013
- c.value = A, clearTimeout(_), _ = setTimeout(() => {
1014
- F();
1015
- }, sa);
998
+ d.value = A, clearTimeout(v), v = setTimeout(() => {
999
+ L();
1000
+ }, ua);
1016
1001
  }
1017
- function U(A) {
1018
- typeof A != "number" || r.value.includes(A) || (r.value = [...r.value, A], c.value = "");
1002
+ function C(A) {
1003
+ typeof A != "number" || c.value.includes(A) || (c.value = [...c.value, A], d.value = "");
1019
1004
  }
1020
- function R(A) {
1021
- r.value = r.value.filter((I) => I !== A);
1005
+ function q(A) {
1006
+ c.value = c.value.filter((E) => E !== A);
1022
1007
  }
1023
- async function M() {
1024
- const A = E.value;
1025
- if (!(A === null || o.value)) {
1026
- o.value = !0;
1008
+ async function N() {
1009
+ const A = O.value;
1010
+ if (!(A === null || f.value)) {
1011
+ f.value = !0;
1027
1012
  try {
1028
- const I = await u.createTag({ title: A });
1029
- x.value = new Map(x.value).set(I.id, I.title), T.value = [I, ...T.value], U(I.id);
1030
- } catch (I) {
1031
- L.danger(s(I));
1013
+ const E = await n.createTag({ title: A });
1014
+ x.value = new Map(x.value).set(E.id, E.title), b.value = [E, ...b.value], C(E.id);
1015
+ } catch (E) {
1016
+ F.danger(u(E));
1032
1017
  } finally {
1033
- o.value = !1;
1018
+ f.value = !1;
1034
1019
  }
1035
1020
  }
1036
1021
  }
1037
1022
  return ue(
1038
- () => a?.article.value?.id,
1023
+ () => l?.article.value?.id,
1039
1024
  () => {
1040
- F();
1025
+ L();
1041
1026
  },
1042
1027
  { immediate: !0 }
1043
- ), Je(() => clearTimeout(_)), (A, I) => (p(), Z("div", la, [
1044
- W.value.length > 0 ? (p(), Z("div", ia, [
1045
- (p(!0), Z(be, null, Be(W.value, (K) => (p(), C(e(oe), {
1046
- key: K.id,
1028
+ ), je(() => clearTimeout(v)), (A, E) => (h(), G("div", sa, [
1029
+ S.value.length > 0 ? (h(), G("div", ra, [
1030
+ (h(!0), G(_e, null, De(S.value, (y) => (h(), M(e(se), {
1031
+ key: y.id,
1047
1032
  type: "default",
1048
- class: "wx-article-tags__chip"
1033
+ closable: !a.value,
1034
+ "close-label": e(t)("article.tag-remove"),
1035
+ onClose: (K) => q(y.id)
1049
1036
  }, {
1050
- default: l(() => [
1051
- w(b(K.title) + " ", 1),
1052
- n(e(Oe), {
1053
- icon: "close",
1054
- tone: "neutral",
1055
- size: "sm",
1056
- disabled: i.value,
1057
- title: e(t)("article.tag-remove"),
1058
- onClick: (P) => R(K.id)
1059
- }, null, 8, ["disabled", "title", "onClick"])
1037
+ default: i(() => [
1038
+ z(T(y.title), 1)
1060
1039
  ]),
1061
1040
  _: 2
1062
- }, 1024))), 128))
1063
- ])) : (p(), C(e(G), {
1041
+ }, 1032, ["closable", "close-label", "onClose"]))), 128))
1042
+ ])) : (h(), M(e(le), {
1064
1043
  key: 1,
1065
1044
  size: "sm",
1066
1045
  tone: "muted"
1067
1046
  }, {
1068
- default: l(() => [
1069
- w(b(e(t)("article.tags-empty")), 1)
1047
+ default: i(() => [
1048
+ z(T(e(t)("article.tags-empty")), 1)
1070
1049
  ]),
1071
1050
  _: 1
1072
1051
  })),
1073
- j("div", na, [
1074
- n(e(_e), {
1052
+ H("div", oa, [
1053
+ s(e(ye), {
1075
1054
  "model-value": null,
1076
- options: S.value,
1055
+ options: W.value,
1077
1056
  placeholder: e(t)("article.tag-add"),
1078
1057
  "empty-text": e(t)("article.tag-nothing"),
1079
- disabled: i.value,
1058
+ disabled: a.value,
1080
1059
  filterable: "",
1081
1060
  teleport: "",
1082
1061
  "aria-label": e(t)("article.tag-add"),
1083
1062
  onSearch: $,
1084
- "onUpdate:modelValue": U
1063
+ "onUpdate:modelValue": C
1085
1064
  }, null, 8, ["options", "placeholder", "empty-text", "disabled", "aria-label"]),
1086
- E.value ? (p(), C(e(J), {
1065
+ O.value ? (h(), M(e(J), {
1087
1066
  key: 0,
1088
1067
  variant: "outline",
1089
1068
  icon: "plus",
1090
- loading: o.value,
1091
- disabled: i.value,
1092
- onClick: M
1069
+ loading: f.value,
1070
+ disabled: a.value,
1071
+ onClick: N
1093
1072
  }, {
1094
- default: l(() => [
1095
- w(b(e(t)("article.tag-create", { title: E.value })), 1)
1073
+ default: i(() => [
1074
+ z(T(e(t)("article.tag-create", { title: O.value })), 1)
1096
1075
  ]),
1097
1076
  _: 1
1098
- }, 8, ["loading", "disabled"])) : H("", !0)
1077
+ }, 8, ["loading", "disabled"])) : j("", !0)
1099
1078
  ])
1100
1079
  ]));
1101
1080
  }
1102
- }), oa = /* @__PURE__ */ ve(ra, [["__scopeId", "data-v-ce095e37"]]), ua = /* @__PURE__ */ ee({
1081
+ }), da = /* @__PURE__ */ ce(ca, [["__scopeId", "data-v-faf5adec"]]), va = /* @__PURE__ */ X({
1082
+ name: "WxArticleUnpublish",
1083
+ __name: "ArticleUnpublish",
1084
+ setup(g) {
1085
+ const o = ne(), c = re(o), w = Ae();
1086
+ Y();
1087
+ const n = Q("webx-blog"), l = pe(), t = U(!1), u = p(() => {
1088
+ const b = w?.article.value?.status;
1089
+ return b === "published" || b === "modified" || b === "scheduled";
1090
+ }), a = p(() => w?.disabled.value === !0 || t.value);
1091
+ async function x() {
1092
+ const b = w?.article.value;
1093
+ if (!(!b || !await ve({
1094
+ title: n("article.unpublish-title", { title: b.title }),
1095
+ message: b.status === "scheduled" ? n("article.unpublish-waiting") : n("article.unpublish-text"),
1096
+ confirmText: n("panel.unpublish"),
1097
+ cancelText: n("panel.cancel"),
1098
+ tone: "danger"
1099
+ }))) {
1100
+ t.value = !0;
1101
+ try {
1102
+ await c.unpublish(b.id), await w?.reload(), F.success(n("panel.unpublished-done"));
1103
+ } catch (f) {
1104
+ F.danger(l(f));
1105
+ } finally {
1106
+ t.value = !1;
1107
+ }
1108
+ }
1109
+ }
1110
+ return (b, d) => u.value && e(w)?.canManage ? (h(), M(e(ie), {
1111
+ key: 0,
1112
+ class: "wx-article-unpublish",
1113
+ help: e(n)("article.unpublish-help")
1114
+ }, {
1115
+ default: i(() => [
1116
+ s(e(J), {
1117
+ variant: "outline",
1118
+ type: "danger",
1119
+ icon: "eye-off",
1120
+ loading: t.value,
1121
+ disabled: a.value,
1122
+ onClick: x
1123
+ }, {
1124
+ default: i(() => [
1125
+ z(T(e(n)("panel.unpublish")), 1)
1126
+ ]),
1127
+ _: 1
1128
+ }, 8, ["loading", "disabled"])
1129
+ ]),
1130
+ _: 1
1131
+ }, 8, ["help"])) : j("", !0);
1132
+ }
1133
+ }), pa = /* @__PURE__ */ ce(va, [["__scopeId", "data-v-c311cff2"]]), fa = /* @__PURE__ */ X({
1103
1134
  __name: "ArticleCreateDialog",
1104
- setup(f) {
1105
- const { open: m, resolve: r, dismiss: y } = Ee(), u = ne(), a = de(u);
1106
- te();
1107
- const t = Q("webx-blog"), s = z(""), i = z(!1), x = z({}), T = De("field");
1108
- Ne(async () => {
1109
- await Ze(), T.value?.querySelector("input")?.focus();
1135
+ setup(g) {
1136
+ const { open: o, resolve: c, dismiss: w } = Re(), n = ne(), l = re(n);
1137
+ Y();
1138
+ const t = Q("webx-blog"), u = U(""), a = U(!1), x = U({}), b = Ee("field");
1139
+ Be(async () => {
1140
+ await Je(), b.value?.querySelector("input")?.focus();
1110
1141
  });
1111
- async function c() {
1112
- if (!(s.value.trim() === "" || i.value)) {
1113
- i.value = !0, x.value = {};
1142
+ async function d() {
1143
+ if (!(u.value.trim() === "" || a.value)) {
1144
+ a.value = !0, x.value = {};
1114
1145
  try {
1115
- r(await a.create({ title: s.value.trim() }));
1116
- } catch (o) {
1117
- x.value = o.body?.errors ?? {};
1146
+ c(await l.create({ title: u.value.trim() }));
1147
+ } catch (f) {
1148
+ x.value = f.body?.errors ?? {};
1118
1149
  } finally {
1119
- i.value = !1;
1150
+ a.value = !1;
1120
1151
  }
1121
1152
  }
1122
1153
  }
1123
- return (o, _) => (p(), C(e(Fe), {
1124
- open: e(m),
1125
- "onUpdate:open": _[2] || (_[2] = (W) => Ie(m) ? m.value = W : null),
1154
+ return (f, v) => (h(), M(e(Me), {
1155
+ open: e(o),
1156
+ "onUpdate:open": v[2] || (v[2] = (S) => Ue(o) ? o.value = S : null),
1126
1157
  title: e(t)("panel.new-title"),
1127
1158
  width: 440
1128
1159
  }, {
1129
- footer: l(() => [
1130
- n(e(Le), { size: "sm" }, {
1131
- default: l(() => [
1132
- n(e(J), {
1160
+ footer: i(() => [
1161
+ s(e(Oe), { size: "sm" }, {
1162
+ default: i(() => [
1163
+ s(e(J), {
1133
1164
  variant: "outline",
1134
- onClick: _[1] || (_[1] = (W) => e(y)())
1165
+ onClick: v[1] || (v[1] = (S) => e(w)())
1135
1166
  }, {
1136
- default: l(() => [
1137
- w(b(e(t)("panel.cancel")), 1)
1167
+ default: i(() => [
1168
+ z(T(e(t)("panel.cancel")), 1)
1138
1169
  ]),
1139
1170
  _: 1
1140
1171
  }),
1141
- n(e(J), {
1172
+ s(e(J), {
1142
1173
  type: "primary",
1143
- loading: i.value,
1144
- disabled: s.value.trim() === "",
1145
- onClick: c
1174
+ loading: a.value,
1175
+ disabled: u.value.trim() === "",
1176
+ onClick: d
1146
1177
  }, {
1147
- default: l(() => [
1148
- w(b(e(t)("panel.create")), 1)
1178
+ default: i(() => [
1179
+ z(T(e(t)("panel.create")), 1)
1149
1180
  ]),
1150
1181
  _: 1
1151
1182
  }, 8, ["loading", "disabled"])
@@ -1153,22 +1184,22 @@ const Pt = { class: "wx-article-editor__screen" }, Dt = 1200, It = /* @__PURE__
1153
1184
  _: 1
1154
1185
  })
1155
1186
  ]),
1156
- default: l(() => [
1157
- n(e(ie), {
1187
+ default: i(() => [
1188
+ s(e(ie), {
1158
1189
  label: e(t)("panel.field-title"),
1159
1190
  error: x.value.title?.[0] ?? x.value.slug?.[0],
1160
1191
  required: ""
1161
1192
  }, {
1162
- default: l(() => [
1163
- j("div", {
1193
+ default: i(() => [
1194
+ H("div", {
1164
1195
  ref_key: "field",
1165
- ref: T
1196
+ ref: b
1166
1197
  }, [
1167
- n(e(Ae), {
1168
- modelValue: s.value,
1169
- "onUpdate:modelValue": _[0] || (_[0] = (W) => s.value = W),
1198
+ s(e(Ve), {
1199
+ modelValue: u.value,
1200
+ "onUpdate:modelValue": v[0] || (v[0] = (S) => u.value = S),
1170
1201
  "aria-label": e(t)("panel.field-title"),
1171
- onKeyup: ze(c, ["enter"])
1202
+ onKeyup: qe(d, ["enter"])
1172
1203
  }, null, 8, ["modelValue", "aria-label"])
1173
1204
  ], 512)
1174
1205
  ]),
@@ -1178,42 +1209,42 @@ const Pt = { class: "wx-article-editor__screen" }, Dt = 1200, It = /* @__PURE__
1178
1209
  _: 1
1179
1210
  }, 8, ["open", "title"]));
1180
1211
  }
1181
- }), da = ["src"], ca = { class: "wx-articles__name" }, va = { class: "wx-articles__name-text" }, pa = { class: "wx-articles__title" }, fa = { class: "wx-articles__address" }, ma = { class: "wx-articles__chips" }, ba = { class: "wx-articles__state" }, nt = 640, ga = /* @__PURE__ */ ee({
1212
+ }), ga = ["src"], ba = { class: "wx-articles__name" }, ma = { class: "wx-articles__name-text" }, ha = { class: "wx-articles__title" }, ya = { class: "wx-articles__address" }, wa = { class: "wx-articles__chips" }, _a = { class: "wx-articles__state" }, it = 640, xa = /* @__PURE__ */ X({
1182
1213
  __name: "ArticlesPage",
1183
1214
  props: {
1184
1215
  base: { default: "/blog" }
1185
1216
  },
1186
- setup(f) {
1187
- const m = f, r = ne(), y = de(r), u = He(), a = Ke();
1188
- te();
1189
- const t = Q("webx-blog"), s = Q("webx-admin"), i = ge(), x = De("root"), T = xt(x), c = z(null), o = z(!0), _ = Ce(ua), W = v(() => r.can("blog.articles.manage")), S = v(
1190
- () => r.state.manifest?.modules.find((d) => d.id === "articles")?.title ?? t("module.articles")
1191
- ), E = v({
1192
- get: () => typeof u.query.view == "string" ? u.query.view : "",
1193
- set: (d) => {
1194
- a.replace({
1195
- query: { ...u.query, view: d === "" ? void 0 : String(d), page: void 0 }
1217
+ setup(g) {
1218
+ const o = g, c = ne(), w = re(c), n = Le(), l = Fe();
1219
+ Y();
1220
+ const t = Q("webx-blog"), u = Q("webx-admin"), a = pe(), x = Ee("root"), b = At(x), d = U(null), f = U(!0), v = Ce(fa), S = p(() => c.can("blog.articles.manage")), W = p(
1221
+ () => c.state.manifest?.modules.find((r) => r.id === "articles")?.title ?? t("module.articles")
1222
+ ), O = p({
1223
+ get: () => typeof n.query.view == "string" ? n.query.view : "",
1224
+ set: (r) => {
1225
+ l.replace({
1226
+ query: { ...n.query, view: r === "" ? void 0 : String(r), page: void 0 }
1196
1227
  });
1197
1228
  }
1198
- }), F = v(() => E.value === "trashed"), $ = v(() => ({
1199
- q: typeof u.query.q == "string" ? u.query.q : "",
1200
- rubric: U(u.query.rubric),
1201
- tag: U(u.query.tag),
1202
- author: U(u.query.author),
1203
- sort: typeof u.query.sort == "string" ? u.query.sort : null,
1204
- page: Number(u.query.page ?? 1) || 1
1229
+ }), L = p(() => O.value === "trashed"), $ = p(() => ({
1230
+ q: typeof n.query.q == "string" ? n.query.q : "",
1231
+ rubric: C(n.query.rubric),
1232
+ tag: C(n.query.tag),
1233
+ author: C(n.query.author),
1234
+ sort: typeof n.query.sort == "string" ? n.query.sort : null,
1235
+ page: Number(n.query.page ?? 1) || 1
1205
1236
  }));
1206
- function U(d) {
1207
- return typeof d == "string" && d !== "" && Number(d) || null;
1237
+ function C(r) {
1238
+ return typeof r == "string" && r !== "" && Number(r) || null;
1208
1239
  }
1209
- const R = v(() => [
1240
+ const q = p(() => [
1210
1241
  { value: "", label: t("panel.view-all") },
1211
1242
  { value: "published", label: t("panel.view-published") },
1212
1243
  { value: "scheduled", label: t("panel.view-scheduled") },
1213
1244
  { value: "draft", label: t("panel.view-draft") },
1214
1245
  { value: "unpublished", label: t("panel.view-unpublished") },
1215
1246
  { value: "trashed", label: t("panel.bin"), icon: "trash" }
1216
- ]), M = v(() => c.value?.filters ?? { rubrics: [], tags: [], authors: [] }), A = v(() => T.value > 0 && T.value < nt), I = v(() => A.value ? [{ key: "card", label: "" }] : [
1247
+ ]), N = p(() => d.value?.filters ?? { rubrics: [], tags: [], authors: [] }), A = p(() => b.value > 0 && b.value < it), E = p(() => A.value ? [{ key: "card", label: "" }] : [
1217
1248
  { key: "cover", label: "", width: 68 },
1218
1249
  /* The one that takes what the others leave, and the only one without a number. */
1219
1250
  { key: "title", label: t("panel.column-title"), minWidth: 220 },
@@ -1221,7 +1252,7 @@ const Pt = { class: "wx-article-editor__screen" }, Dt = 1200, It = /* @__PURE__
1221
1252
  { key: "author", label: t("panel.column-author"), width: 160, hideBelow: 1200 },
1222
1253
  {
1223
1254
  key: "date",
1224
- label: F.value ? t("panel.column-deleted") : t("panel.column-date"),
1255
+ label: L.value ? t("panel.column-deleted") : t("panel.column-date"),
1225
1256
  width: 120,
1226
1257
  hideBelow: 700,
1227
1258
  // "today at 16:22" is three words the table will break over two lines given half a
@@ -1229,31 +1260,31 @@ const Pt = { class: "wx-article-editor__screen" }, Dt = 1200, It = /* @__PURE__
1229
1260
  cellClass: "wx-articles__when"
1230
1261
  },
1231
1262
  { key: "status", label: t("panel.column-status"), width: 170 },
1232
- { key: "actions", label: "", width: st, align: "right" }
1233
- ]), K = v(() => $.value.q !== "" ? t("panel.empty-search") : F.value ? t("panel.empty-bin") : t("panel.empty")), P = v(() => {
1234
- const d = [], D = M.value.rubrics.find((V) => V.id === $.value.rubric);
1235
- D && d.push({
1263
+ { key: "actions", label: "", width: nt, align: "right" }
1264
+ ]), y = p(() => $.value.q !== "" ? t("panel.empty-search") : L.value ? t("panel.empty-bin") : t("panel.empty")), K = p(() => {
1265
+ const r = [], D = N.value.rubrics.find((V) => V.id === $.value.rubric);
1266
+ D && r.push({
1236
1267
  key: "rubric",
1237
1268
  label: `${t("panel.filter-rubric")}: ${D.title}`,
1238
- clear: () => O("rubric", void 0)
1269
+ clear: () => Z("rubric", void 0)
1239
1270
  });
1240
- const h = M.value.tags.find((V) => V.id === $.value.tag);
1241
- h && d.push({
1271
+ const _ = N.value.tags.find((V) => V.id === $.value.tag);
1272
+ _ && r.push({
1242
1273
  key: "tag",
1243
- label: `${t("panel.filter-tag")}: ${h.title}`,
1244
- clear: () => O("tag", void 0)
1274
+ label: `${t("panel.filter-tag")}: ${_.title}`,
1275
+ clear: () => Z("tag", void 0)
1245
1276
  });
1246
- const $e = M.value.authors.find((V) => V.id === $.value.author);
1247
- return $e && d.push({
1277
+ const $e = N.value.authors.find((V) => V.id === $.value.author);
1278
+ return $e && r.push({
1248
1279
  key: "author",
1249
1280
  label: `${t("panel.filter-author")}: ${$e.title}`,
1250
- clear: () => O("author", void 0)
1251
- }), d;
1281
+ clear: () => Z("author", void 0)
1282
+ }), r;
1252
1283
  });
1253
- function q() {
1254
- a.replace({
1284
+ function k() {
1285
+ l.replace({
1255
1286
  query: {
1256
- ...u.query,
1287
+ ...n.query,
1257
1288
  rubric: void 0,
1258
1289
  tag: void 0,
1259
1290
  author: void 0,
@@ -1261,107 +1292,107 @@ const Pt = { class: "wx-article-editor__screen" }, Dt = 1200, It = /* @__PURE__
1261
1292
  }
1262
1293
  });
1263
1294
  }
1264
- async function k(d) {
1265
- o.value = !0;
1295
+ async function P(r) {
1296
+ f.value = !0;
1266
1297
  try {
1267
- c.value = await y.articles({
1268
- q: d?.search ?? $.value.q,
1269
- status: F.value ? "" : E.value,
1270
- trashed: F.value,
1298
+ d.value = await w.articles({
1299
+ q: r?.search ?? $.value.q,
1300
+ status: L.value ? "" : O.value,
1301
+ trashed: L.value,
1271
1302
  rubric: $.value.rubric,
1272
1303
  tag: $.value.tag,
1273
1304
  author: $.value.author,
1274
- sort: d?.sort ? `${d.sort.order === "desc" ? "-" : ""}${d.sort.key}` : null,
1275
- page: d?.page ?? $.value.page,
1276
- per_page: d?.perPage
1305
+ sort: r?.sort ? `${r.sort.order === "desc" ? "-" : ""}${r.sort.key}` : null,
1306
+ page: r?.page ?? $.value.page,
1307
+ per_page: r?.perPage
1277
1308
  });
1278
1309
  } catch (D) {
1279
- L.danger(i(D));
1310
+ F.danger(a(D));
1280
1311
  } finally {
1281
- o.value = !1;
1312
+ f.value = !1;
1282
1313
  }
1283
1314
  }
1284
- function le(d) {
1315
+ function B(r) {
1285
1316
  const D = {
1286
- ...u.query,
1287
- q: d.search === "" ? void 0 : d.search,
1288
- sort: d.sort === null ? void 0 : `${d.sort.order === "desc" ? "-" : ""}${d.sort.key}`,
1289
- page: d.page === 1 ? void 0 : String(d.page)
1317
+ ...n.query,
1318
+ q: r.search === "" ? void 0 : r.search,
1319
+ sort: r.sort === null ? void 0 : `${r.sort.order === "desc" ? "-" : ""}${r.sort.key}`,
1320
+ page: r.page === 1 ? void 0 : String(r.page)
1290
1321
  };
1291
- a.replace({ query: D }), k(d);
1322
+ l.replace({ query: D }), P(r);
1292
1323
  }
1293
- function O(d, D) {
1294
- a.replace({
1324
+ function Z(r, D) {
1325
+ l.replace({
1295
1326
  query: {
1296
- ...u.query,
1297
- [d]: typeof D == "number" ? String(D) : void 0,
1327
+ ...n.query,
1328
+ [r]: typeof D == "number" ? String(D) : void 0,
1298
1329
  page: void 0
1299
1330
  }
1300
1331
  });
1301
1332
  }
1302
1333
  ue(
1303
- () => [E.value, $.value.rubric, $.value.tag, $.value.author],
1334
+ () => [O.value, $.value.rubric, $.value.tag, $.value.author],
1304
1335
  () => {
1305
- k();
1336
+ P();
1306
1337
  }
1307
- ), k();
1308
- function se(d) {
1309
- const D = `${m.base}/articles/${d.id}`;
1310
- a.resolve(D).matched.length > 0 && a.push({ path: D, query: { ...u.query } });
1338
+ ), P();
1339
+ function be(r) {
1340
+ const D = `${o.base}/articles/${r.id}`;
1341
+ l.resolve(D).matched.length > 0 && l.push({ path: D, query: { ...n.query } });
1311
1342
  }
1312
1343
  async function xe() {
1313
- const d = await _({});
1314
- d && (await k(), se(d));
1344
+ const r = await v({});
1345
+ r && (await P(), be(r));
1315
1346
  }
1316
- function ce(d) {
1317
- if (!W.value) return [];
1318
- if (F.value)
1347
+ function de(r) {
1348
+ if (!S.value) return [];
1349
+ if (L.value)
1319
1350
  return [
1320
1351
  {
1321
1352
  key: "restore",
1322
1353
  icon: "refresh",
1323
1354
  label: t("panel.restore"),
1324
1355
  run: () => {
1325
- re(d);
1356
+ oe(r);
1326
1357
  }
1327
1358
  }
1328
1359
  ];
1329
1360
  const D = [
1330
- { key: "open", icon: "edit", label: t("panel.open"), run: () => se(d) }
1361
+ { key: "open", icon: "edit", label: t("panel.open"), run: () => be(r) }
1331
1362
  ];
1332
- return d.url && d.status !== "draft" && D.push({
1363
+ return r.url && r.status !== "draft" && D.push({
1333
1364
  key: "site",
1334
1365
  icon: "external-link",
1335
1366
  label: t("panel.open-on-site"),
1336
- href: d.url
1337
- }), d.path !== null && D.push({
1367
+ href: r.url
1368
+ }), r.path !== null && D.push({
1338
1369
  key: "copy",
1339
1370
  icon: "copy",
1340
1371
  label: t("panel.copy-address"),
1341
1372
  run: () => {
1342
- g(d);
1373
+ m(r);
1343
1374
  }
1344
1375
  }), D.push({
1345
1376
  key: "pin",
1346
1377
  icon: "star",
1347
- label: d.pinned ? t("panel.unpin") : t("panel.pin"),
1378
+ label: r.pinned ? t("panel.unpin") : t("panel.pin"),
1348
1379
  run: () => {
1349
- ke(d, !d.pinned);
1380
+ ke(r, !r.pinned);
1350
1381
  }
1351
1382
  }), D.push(
1352
- d.status === "published" || d.status === "modified" || d.status === "scheduled" ? {
1383
+ r.status === "published" || r.status === "modified" || r.status === "scheduled" ? {
1353
1384
  key: "unpublish",
1354
1385
  icon: "eye-off",
1355
1386
  label: t("panel.unpublish"),
1356
1387
  run: () => {
1357
- Te(d);
1388
+ We(r);
1358
1389
  }
1359
1390
  } : {
1360
1391
  key: "publish",
1361
1392
  icon: "upload",
1362
1393
  label: t("panel.publish"),
1363
1394
  run: () => {
1364
- he(d);
1395
+ me(r);
1365
1396
  }
1366
1397
  }
1367
1398
  ), D.push({
@@ -1370,324 +1401,324 @@ const Pt = { class: "wx-article-editor__screen" }, Dt = 1200, It = /* @__PURE__
1370
1401
  label: t("panel.delete"),
1371
1402
  danger: !0,
1372
1403
  run: () => {
1373
- pe(d);
1404
+ fe(r);
1374
1405
  }
1375
1406
  }), D;
1376
1407
  }
1377
- async function he(d) {
1378
- await fe(() => y.publish(d.id), t("panel.published"));
1408
+ async function me(r) {
1409
+ await ge(() => w.publish(r.id), t("panel.published"));
1379
1410
  }
1380
- async function Te(d) {
1381
- await fe(() => y.unpublish(d.id), t("panel.unpublished-done"));
1411
+ async function We(r) {
1412
+ await ge(() => w.unpublish(r.id), t("panel.unpublished-done"));
1382
1413
  }
1383
- async function ke(d, D) {
1384
- await fe(
1385
- () => y.save(d.id, { values: { pinned: D }, revision: d.revision }),
1414
+ async function ke(r, D) {
1415
+ await ge(
1416
+ () => w.save(r.id, { values: { pinned: D }, revision: r.revision }),
1386
1417
  t(D ? "panel.pinned-done" : "panel.unpinned")
1387
1418
  );
1388
1419
  }
1389
- async function pe(d) {
1390
- await me({
1391
- title: t("panel.delete-title", { title: d.title }),
1420
+ async function fe(r) {
1421
+ await ve({
1422
+ title: t("panel.delete-title", { title: r.title }),
1392
1423
  message: t("panel.delete-text"),
1393
1424
  confirmText: t("panel.delete"),
1394
1425
  cancelText: t("panel.cancel"),
1395
1426
  tone: "danger"
1396
- }) && await fe(() => y.remove(d.id), t("panel.deleted"));
1427
+ }) && await ge(() => w.remove(r.id), t("panel.deleted"));
1397
1428
  }
1398
- async function re(d) {
1399
- await fe(() => y.restore(d.id), t("panel.restored"));
1429
+ async function oe(r) {
1430
+ await ge(() => w.restore(r.id), t("panel.restored"));
1400
1431
  }
1401
- async function fe(d, D) {
1432
+ async function ge(r, D) {
1402
1433
  try {
1403
- await d(), L.success(D);
1404
- } catch (h) {
1405
- L.danger(i(h));
1434
+ await r(), F.success(D);
1435
+ } catch (_) {
1436
+ F.danger(a(_));
1406
1437
  } finally {
1407
- await k();
1438
+ await P();
1408
1439
  }
1409
1440
  }
1410
- async function g(d) {
1411
- if (d.url)
1441
+ async function m(r) {
1442
+ if (r.url)
1412
1443
  try {
1413
- await navigator.clipboard.writeText(d.url), L.success(t("panel.address-copied"));
1444
+ await navigator.clipboard.writeText(r.url), F.success(t("panel.address-copied"));
1414
1445
  } catch {
1415
1446
  }
1416
1447
  }
1417
- function N(d) {
1418
- return d === "published" || d === "modified" ? "success" : d === "scheduled" ? "warning" : "default";
1448
+ function R(r) {
1449
+ return r === "published" || r === "modified" ? "success" : r === "scheduled" ? "warning" : "default";
1419
1450
  }
1420
- function B(d) {
1421
- return F.value ? "—" : d.path === null ? t("panel.no-address") : `/${d.path}`;
1451
+ function I(r) {
1452
+ return L.value ? "—" : r.path === null ? t("panel.no-address") : `/${r.path}`;
1422
1453
  }
1423
- function X(d) {
1424
- return F.value ? d.deleted_at : d.published_at;
1454
+ function ee(r) {
1455
+ return L.value ? r.deleted_at : r.published_at;
1425
1456
  }
1426
- const ye = v(
1427
- () => W.value ? [{ key: "new", label: t("panel.new"), icon: "plus", primary: !0, run: () => {
1457
+ const he = p(
1458
+ () => S.value ? [{ key: "new", label: t("panel.new"), icon: "plus", primary: !0, run: () => {
1428
1459
  xe();
1429
1460
  } }] : []
1430
1461
  );
1431
- return (d, D) => (p(), Z("div", {
1462
+ return (r, D) => (h(), G("div", {
1432
1463
  ref_key: "root",
1433
1464
  ref: x,
1434
1465
  class: "wx-articles"
1435
1466
  }, [
1436
- n(e(Qe), {
1437
- view: E.value,
1438
- "onUpdate:view": D[3] || (D[3] = (h) => E.value = h),
1439
- title: S.value,
1440
- views: R.value,
1441
- actions: ye.value
1467
+ s(e(Ze), {
1468
+ view: O.value,
1469
+ "onUpdate:view": D[3] || (D[3] = (_) => O.value = _),
1470
+ title: W.value,
1471
+ views: q.value,
1472
+ actions: he.value
1442
1473
  }, {
1443
- default: l(() => [
1444
- n(e(ot), {
1445
- data: c.value,
1446
- columns: I.value,
1474
+ default: i(() => [
1475
+ s(e(ut), {
1476
+ data: d.value,
1477
+ columns: E.value,
1447
1478
  "row-key": "id",
1448
1479
  searchable: "",
1449
- clickable: !F.value,
1450
- hover: !F.value,
1480
+ clickable: !L.value,
1481
+ hover: !L.value,
1451
1482
  flush: "",
1452
- loading: o.value,
1483
+ loading: f.value,
1453
1484
  layout: "fixed",
1454
- "cards-below": nt,
1455
- "filters-count": P.value.length,
1456
- "filters-label": e(s)("filters.title"),
1485
+ "cards-below": it,
1486
+ "filters-count": K.value.length,
1487
+ "filters-label": e(u)("filters.title"),
1457
1488
  "search-placeholder": e(t)("panel.search"),
1458
- "empty-text": K.value,
1459
- "aria-label": S.value,
1460
- onRowClick: se,
1461
- onStateChange: le
1489
+ "empty-text": y.value,
1490
+ "aria-label": W.value,
1491
+ onRowClick: be,
1492
+ onStateChange: B
1462
1493
  }, {
1463
- filters: l(() => [
1464
- n(e(ie), {
1494
+ filters: i(() => [
1495
+ s(e(ie), {
1465
1496
  label: e(t)("panel.filter-rubric")
1466
1497
  }, {
1467
- default: l(() => [
1468
- n(e(_e), {
1498
+ default: i(() => [
1499
+ s(e(ye), {
1469
1500
  "model-value": $.value.rubric,
1470
- options: M.value.rubrics.map((h) => ({ value: h.id, label: h.title })),
1501
+ options: N.value.rubrics.map((_) => ({ value: _.id, label: _.title })),
1471
1502
  placeholder: e(t)("panel.any-rubric"),
1472
1503
  clearable: "",
1473
1504
  size: "sm",
1474
- "onUpdate:modelValue": D[0] || (D[0] = (h) => O("rubric", h))
1505
+ "onUpdate:modelValue": D[0] || (D[0] = (_) => Z("rubric", _))
1475
1506
  }, null, 8, ["model-value", "options", "placeholder"])
1476
1507
  ]),
1477
1508
  _: 1
1478
1509
  }, 8, ["label"]),
1479
- n(e(ie), {
1510
+ s(e(ie), {
1480
1511
  label: e(t)("panel.filter-tag")
1481
1512
  }, {
1482
- default: l(() => [
1483
- n(e(_e), {
1513
+ default: i(() => [
1514
+ s(e(ye), {
1484
1515
  "model-value": $.value.tag,
1485
- options: M.value.tags.map((h) => ({ value: h.id, label: h.title })),
1516
+ options: N.value.tags.map((_) => ({ value: _.id, label: _.title })),
1486
1517
  placeholder: e(t)("panel.any-tag"),
1487
1518
  clearable: "",
1488
1519
  filterable: "",
1489
1520
  size: "sm",
1490
- "onUpdate:modelValue": D[1] || (D[1] = (h) => O("tag", h))
1521
+ "onUpdate:modelValue": D[1] || (D[1] = (_) => Z("tag", _))
1491
1522
  }, null, 8, ["model-value", "options", "placeholder"])
1492
1523
  ]),
1493
1524
  _: 1
1494
1525
  }, 8, ["label"]),
1495
- n(e(ie), {
1526
+ s(e(ie), {
1496
1527
  label: e(t)("panel.filter-author")
1497
1528
  }, {
1498
- default: l(() => [
1499
- n(e(_e), {
1529
+ default: i(() => [
1530
+ s(e(ye), {
1500
1531
  "model-value": $.value.author,
1501
- options: M.value.authors.map((h) => ({ value: h.id, label: h.title })),
1532
+ options: N.value.authors.map((_) => ({ value: _.id, label: _.title })),
1502
1533
  placeholder: e(t)("panel.any-author"),
1503
1534
  clearable: "",
1504
1535
  size: "sm",
1505
- "onUpdate:modelValue": D[2] || (D[2] = (h) => O("author", h))
1536
+ "onUpdate:modelValue": D[2] || (D[2] = (_) => Z("author", _))
1506
1537
  }, null, 8, ["model-value", "options", "placeholder"])
1507
1538
  ]),
1508
1539
  _: 1
1509
1540
  }, 8, ["label"]),
1510
- P.value.length > 0 ? (p(), C(e(J), {
1541
+ K.value.length > 0 ? (h(), M(e(J), {
1511
1542
  key: 0,
1512
1543
  variant: "text",
1513
1544
  size: "sm",
1514
1545
  block: "",
1515
- onClick: q
1546
+ onClick: k
1516
1547
  }, {
1517
- icon: l(() => [
1518
- n(e(we), { name: "close" })
1548
+ icon: i(() => [
1549
+ s(e(Te), { name: "close" })
1519
1550
  ]),
1520
- default: l(() => [
1521
- w(" " + b(e(s)("filters.reset")), 1)
1551
+ default: i(() => [
1552
+ z(" " + T(e(u)("filters.reset")), 1)
1522
1553
  ]),
1523
1554
  _: 1
1524
- })) : H("", !0)
1555
+ })) : j("", !0)
1525
1556
  ]),
1526
- applied: l(() => [
1527
- n(e(yt), { filters: P.value }, null, 8, ["filters"])
1557
+ applied: i(() => [
1558
+ s(e(xt), { filters: K.value }, null, 8, ["filters"])
1528
1559
  ]),
1529
- "cell-cover": l(({ row: h }) => [
1530
- j("span", {
1531
- class: Pe(["wx-articles__cover", { "is-empty": !h.cover }])
1560
+ "cell-cover": i(({ row: _ }) => [
1561
+ H("span", {
1562
+ class: Ge(["wx-articles__cover", { "is-empty": !_.cover }])
1532
1563
  }, [
1533
- h.cover?.thumb ? (p(), Z("img", {
1564
+ _.cover?.thumb ? (h(), G("img", {
1534
1565
  key: 0,
1535
- src: h.cover.thumb,
1566
+ src: _.cover.thumb,
1536
1567
  alt: "",
1537
1568
  loading: "lazy"
1538
- }, null, 8, da)) : (p(), C(e(we), {
1569
+ }, null, 8, ga)) : (h(), M(e(Te), {
1539
1570
  key: 1,
1540
1571
  name: "image",
1541
1572
  size: "sm"
1542
1573
  }))
1543
1574
  ], 2)
1544
1575
  ]),
1545
- "cell-title": l(({ row: h }) => [
1546
- j("div", ca, [
1547
- h.pinned ? (p(), C(e(et), {
1576
+ "cell-title": i(({ row: _ }) => [
1577
+ H("div", ba, [
1578
+ _.pinned ? (h(), M(e(Ye), {
1548
1579
  key: 0,
1549
1580
  content: e(t)("panel.pinned")
1550
1581
  }, {
1551
- default: l(() => [
1552
- n(e(we), {
1582
+ default: i(() => [
1583
+ s(e(Te), {
1553
1584
  class: "wx-articles__pin",
1554
1585
  name: "star",
1555
1586
  size: "sm"
1556
1587
  })
1557
1588
  ]),
1558
1589
  _: 1
1559
- }, 8, ["content"])) : H("", !0),
1560
- j("div", va, [
1561
- j("span", pa, b(h.title), 1),
1562
- j("span", fa, b(B(h)), 1)
1590
+ }, 8, ["content"])) : j("", !0),
1591
+ H("div", ma, [
1592
+ H("span", ha, T(_.title), 1),
1593
+ H("span", ya, T(I(_)), 1)
1563
1594
  ])
1564
1595
  ])
1565
1596
  ]),
1566
- "cell-rubrics": l(({ row: h }) => [
1567
- j("span", ma, [
1568
- (p(!0), Z(be, null, Be(h.rubrics, ($e) => (p(), C(e(oe), {
1597
+ "cell-rubrics": i(({ row: _ }) => [
1598
+ H("span", wa, [
1599
+ (h(!0), G(_e, null, De(_.rubrics, ($e) => (h(), M(e(se), {
1569
1600
  key: $e.id,
1570
1601
  size: "sm",
1571
1602
  round: ""
1572
1603
  }, {
1573
- default: l(() => [
1574
- w(b($e.title), 1)
1604
+ default: i(() => [
1605
+ z(T($e.title), 1)
1575
1606
  ]),
1576
1607
  _: 2
1577
1608
  }, 1024))), 128))
1578
1609
  ])
1579
1610
  ]),
1580
- "cell-author": l(({ row: h }) => [
1581
- n(e(G), {
1611
+ "cell-author": i(({ row: _ }) => [
1612
+ s(e(le), {
1582
1613
  size: "sm",
1583
1614
  tone: "muted",
1584
1615
  truncate: ""
1585
1616
  }, {
1586
- default: l(() => [
1587
- w(b(h.author ? h.author.name : "—"), 1)
1617
+ default: i(() => [
1618
+ z(T(_.author ? _.author.name : "—"), 1)
1588
1619
  ]),
1589
1620
  _: 2
1590
1621
  }, 1024)
1591
1622
  ]),
1592
- "cell-date": l(({ row: h }) => [
1593
- X(h) ? (p(), C(e(je), {
1623
+ "cell-date": i(({ row: _ }) => [
1624
+ ee(_) ? (h(), M(e(He), {
1594
1625
  key: 0,
1595
- value: X(h),
1626
+ value: ee(_),
1596
1627
  compact: ""
1597
- }, null, 8, ["value"])) : (p(), C(e(G), {
1628
+ }, null, 8, ["value"])) : (h(), M(e(le), {
1598
1629
  key: 1,
1599
1630
  size: "sm",
1600
1631
  tone: "muted"
1601
1632
  }, {
1602
- default: l(() => [...D[4] || (D[4] = [
1603
- w("—", -1)
1633
+ default: i(() => [...D[4] || (D[4] = [
1634
+ z("—", -1)
1604
1635
  ])]),
1605
1636
  _: 1
1606
1637
  }))
1607
1638
  ]),
1608
- "cell-status": l(({ row: h }) => [
1609
- j("span", ba, [
1610
- n(e(oe), {
1611
- type: N(h.status),
1639
+ "cell-status": i(({ row: _ }) => [
1640
+ H("span", _a, [
1641
+ s(e(se), {
1642
+ type: R(_.status),
1612
1643
  dot: "",
1613
1644
  size: "sm"
1614
1645
  }, {
1615
- default: l(() => [
1616
- w(b(e(t)(`panel.status-${h.status}`)), 1)
1646
+ default: i(() => [
1647
+ z(T(e(t)(`panel.status-${_.status}`)), 1)
1617
1648
  ]),
1618
1649
  _: 2
1619
1650
  }, 1032, ["type"]),
1620
- h.status === "modified" ? (p(), C(e(oe), {
1651
+ _.status === "modified" ? (h(), M(e(se), {
1621
1652
  key: 0,
1622
1653
  type: "primary",
1623
1654
  size: "sm",
1624
1655
  round: ""
1625
1656
  }, {
1626
- default: l(() => [
1627
- w(b(e(t)("panel.edits")), 1)
1657
+ default: i(() => [
1658
+ z(T(e(t)("panel.edits")), 1)
1628
1659
  ]),
1629
1660
  _: 1
1630
- })) : H("", !0)
1661
+ })) : j("", !0)
1631
1662
  ])
1632
1663
  ]),
1633
- "cell-card": l(({ row: h }) => [
1634
- n(e(kt), {
1664
+ "cell-card": i(({ row: _ }) => [
1665
+ s(e(St), {
1635
1666
  class: "wx-articles__entity",
1636
1667
  variant: "plain",
1637
- title: h.title,
1638
- image: h.cover?.thumb ?? void 0,
1668
+ title: _.title,
1669
+ image: _.cover?.thumb ?? void 0,
1639
1670
  "image-size": "56px",
1640
1671
  "title-lines": 2,
1641
- subtitle: B(h)
1672
+ subtitle: I(_)
1642
1673
  }, {
1643
- title: l(() => [
1644
- h.pinned ? (p(), C(e(we), {
1674
+ title: i(() => [
1675
+ _.pinned ? (h(), M(e(Te), {
1645
1676
  key: 0,
1646
1677
  class: "wx-articles__pin",
1647
1678
  name: "star",
1648
1679
  size: "sm"
1649
- })) : H("", !0),
1650
- w(" " + b(h.title), 1)
1680
+ })) : j("", !0),
1681
+ z(" " + T(_.title), 1)
1651
1682
  ]),
1652
- meta: l(() => [
1653
- h.rubrics[0] ? (p(), C(e(oe), {
1683
+ meta: i(() => [
1684
+ _.rubrics[0] ? (h(), M(e(se), {
1654
1685
  key: 0,
1655
1686
  size: "sm",
1656
1687
  round: ""
1657
1688
  }, {
1658
- default: l(() => [
1659
- w(b(h.rubrics[0].title), 1)
1689
+ default: i(() => [
1690
+ z(T(_.rubrics[0].title), 1)
1660
1691
  ]),
1661
1692
  _: 2
1662
- }, 1024)) : H("", !0),
1663
- n(e(oe), {
1664
- type: N(h.status),
1693
+ }, 1024)) : j("", !0),
1694
+ s(e(se), {
1695
+ type: R(_.status),
1665
1696
  dot: "",
1666
1697
  size: "sm"
1667
1698
  }, {
1668
- default: l(() => [
1669
- w(b(e(t)(`panel.status-${h.status}`)), 1)
1699
+ default: i(() => [
1700
+ z(T(e(t)(`panel.status-${_.status}`)), 1)
1670
1701
  ]),
1671
1702
  _: 2
1672
1703
  }, 1032, ["type"]),
1673
- X(h) ? (p(), C(e(je), {
1704
+ ee(_) ? (h(), M(e(He), {
1674
1705
  key: 1,
1675
- value: X(h)
1676
- }, null, 8, ["value"])) : H("", !0)
1706
+ value: ee(_)
1707
+ }, null, 8, ["value"])) : j("", !0)
1677
1708
  ]),
1678
1709
  _: 2
1679
1710
  }, 1032, ["title", "image", "subtitle"])
1680
1711
  ]),
1681
- "card-actions": l(({ row: h }) => [
1682
- n(e(Re), {
1683
- actions: ce(h),
1684
- label: h.title
1712
+ "card-actions": i(({ row: _ }) => [
1713
+ s(e(ze), {
1714
+ actions: de(_),
1715
+ label: _.title
1685
1716
  }, null, 8, ["actions", "label"])
1686
1717
  ]),
1687
- "cell-actions": l(({ row: h }) => [
1688
- n(e(Re), {
1689
- actions: ce(h),
1690
- label: h.title
1718
+ "cell-actions": i(({ row: _ }) => [
1719
+ s(e(ze), {
1720
+ actions: de(_),
1721
+ label: _.title
1691
1722
  }, null, 8, ["actions", "label"])
1692
1723
  ]),
1693
1724
  _: 1
@@ -1697,25 +1728,20 @@ const Pt = { class: "wx-article-editor__screen" }, Dt = 1200, It = /* @__PURE__
1697
1728
  }, 8, ["view", "title", "views", "actions"])
1698
1729
  ], 512));
1699
1730
  }
1700
- }), ha = /* @__PURE__ */ ve(ga, [["__scopeId", "data-v-2d93df26"]]), ya = { class: "wx-rubric-form__head" }, wa = { class: "wx-rubric-form__body" }, _a = { class: "wx-rubric-form__row" }, xa = { class: "wx-rubric-form__row" }, ka = { class: "wx-rubric-form__side" }, $a = {
1701
- key: 1,
1702
- class: "wx-rubric-form__seo"
1703
- }, Ta = { class: "wx-rubric-form__foot" }, Va = /* @__PURE__ */ ee({
1704
- __name: "RubricForm",
1731
+ }), ka = /* @__PURE__ */ ce(xa, [["__scopeId", "data-v-2d93df26"]]), $a = { class: "wx-rubric-dialog__panel" }, Ta = { class: "wx-rubric-dialog__row" }, Va = { class: "wx-rubric-dialog__panel" }, Aa = { class: "wx-rubric-dialog__panel" }, Sa = /* @__PURE__ */ X({
1732
+ __name: "RubricDialog",
1705
1733
  props: {
1706
- rubric: {},
1734
+ rubric: { default: null },
1707
1735
  prefix: { default: "" },
1708
- inline: { type: Boolean, default: !0 },
1709
1736
  disabled: { type: Boolean, default: !1 }
1710
1737
  },
1711
- emits: ["back", "saved", "deleted", "articles"],
1712
- setup(f, { emit: m }) {
1713
- const r = f, y = m, u = ne(), a = de(u), t = Xe();
1714
- te();
1715
- const s = Q("webx-blog"), i = ge(), x = v(() => u.types["wx-media"]?.component), T = v(() => u.types["wx-seo"]?.component), c = v(
1716
- () => u.types["wx-seo"]?.bind?.({ id: "seo", type: "wx-seo" }) ?? {}
1717
- ), o = z(E()), _ = z({}), W = z(!1), S = z(!1);
1718
- function E() {
1738
+ setup(g) {
1739
+ const o = g, { open: c, resolve: w, dismiss: n } = Re(), l = ne(), t = re(l), u = Qe();
1740
+ Y();
1741
+ const a = Q("webx-blog"), x = pe(), b = p(() => l.types["wx-media"]?.component), d = p(() => l.types["wx-seo"]?.component), f = p(
1742
+ () => l.types["wx-seo"]?.bind?.({ id: "seo", type: "wx-seo" }) ?? {}
1743
+ ), v = U(L()), S = U({}), W = U(!1), O = U("content");
1744
+ function L() {
1719
1745
  return {
1720
1746
  title: {},
1721
1747
  slug: {},
@@ -1726,538 +1752,512 @@ const Pt = { class: "wx-article-editor__screen" }, Dt = 1200, It = /* @__PURE__
1726
1752
  };
1727
1753
  }
1728
1754
  ue(
1729
- () => r.rubric,
1730
- (P) => {
1731
- if (_.value = {}, S.value = !1, P === null) {
1732
- o.value = E();
1755
+ () => o.rubric,
1756
+ (k) => {
1757
+ if (S.value = {}, O.value = "content", k === null) {
1758
+ v.value = L();
1733
1759
  return;
1734
1760
  }
1735
- o.value = {
1736
- title: { ...P.title },
1737
- slug: { ...P.slug },
1738
- lead: { ...P.lead },
1739
- cover: P.cover ? { path: P.cover.path, url: P.cover.url } : null,
1740
- is_visible: P.is_visible,
1741
- seo: { ...P.seo }
1742
- }, S.value = Object.keys(P.seo ?? {}).length > 0;
1761
+ v.value = {
1762
+ title: { ...k.title },
1763
+ slug: { ...k.slug },
1764
+ lead: { ...k.lead },
1765
+ cover: k.cover ? { path: k.cover.path, url: k.cover.url } : null,
1766
+ is_visible: k.is_visible,
1767
+ seo: { ...k.seo }
1768
+ };
1743
1769
  },
1744
1770
  { immediate: !0 }
1745
1771
  );
1746
- const F = v(
1747
- () => o.value.title[t.active.value] || r.rubric?.name || s("rubric.new")
1748
- ), $ = v(() => {
1749
- const P = o.value.slug[t.active.value] ?? "";
1750
- return P === "" ? null : `/${[r.prefix, P].filter(Boolean).join("/")}`;
1751
- }), U = v(() => {
1752
- const P = r.rubric?.path;
1753
- return typeof P == "string" && $.value !== null && $.value !== `/${P}`;
1754
- }), R = v(() => r.rubric?.articles_count ?? 0);
1755
- function M(P) {
1756
- const q = Object.keys(_.value).find(
1757
- (k) => k === P || k.startsWith(`${P}.`)
1772
+ const $ = p(
1773
+ () => v.value.title[u.active.value] || o.rubric?.name || a("rubric.new")
1774
+ ), C = p(() => {
1775
+ const k = v.value.slug[u.active.value] ?? "";
1776
+ return k === "" ? null : `/${[o.prefix, k].filter(Boolean).join("/")}`;
1777
+ }), q = p(() => {
1778
+ const k = o.rubric?.path;
1779
+ return typeof k == "string" && C.value !== null && C.value !== `/${k}`;
1780
+ }), N = {
1781
+ title: "content",
1782
+ slug: "content",
1783
+ lead: "content",
1784
+ cover: "cover",
1785
+ seo: "seo"
1786
+ };
1787
+ function A(k) {
1788
+ const P = Object.keys(S.value).find(
1789
+ (B) => B === k || B.startsWith(`${k}.`)
1790
+ );
1791
+ return P === void 0 ? void 0 : S.value[P]?.[0];
1792
+ }
1793
+ function E() {
1794
+ const k = ["content", "cover", "seo"], P = new Set(
1795
+ Object.keys(S.value).map((B) => N[B.split(".")[0] ?? ""]).filter((B) => B !== void 0)
1758
1796
  );
1759
- return q === void 0 ? void 0 : _.value[q]?.[0];
1797
+ return k.find((B) => P.has(B)) ?? null;
1760
1798
  }
1761
- function A() {
1799
+ function y() {
1762
1800
  return {
1763
- title: o.value.title,
1764
- slug: o.value.slug,
1765
- lead: o.value.lead,
1766
- cover: o.value.cover === null ? null : { path: o.value.cover.path },
1767
- is_visible: o.value.is_visible,
1768
- // Only when it was opened: a save of the rest of the form must not empty a card nobody
1769
- // looked at, and an untouched card is the rules being left in charge (§12).
1770
- ...S.value ? { seo: o.value.seo } : {}
1801
+ title: v.value.title,
1802
+ slug: v.value.slug,
1803
+ lead: v.value.lead,
1804
+ cover: v.value.cover === null ? null : { path: v.value.cover.path },
1805
+ is_visible: v.value.is_visible,
1806
+ // Always, now that the card is a tab of its own: an empty one is the rules being left in
1807
+ // charge, which is what the server stores it as (§12).
1808
+ seo: v.value.seo
1771
1809
  };
1772
1810
  }
1773
- async function I() {
1774
- W.value = !0, _.value = {};
1811
+ async function K() {
1812
+ W.value = !0, S.value = {};
1775
1813
  try {
1776
- const P = r.rubric === null ? await a.createRubric(A()) : await a.saveRubric(r.rubric.id, A());
1777
- L.success(r.rubric === null ? s("rubric.created") : s("rubric.saved")), y("saved", P);
1778
- } catch (P) {
1779
- const q = P.body;
1780
- q?.errors && (_.value = q.errors), L.danger(i(P));
1814
+ const k = o.rubric === null ? await t.createRubric(y()) : await t.saveRubric(o.rubric.id, y());
1815
+ F.success(o.rubric === null ? a("rubric.created") : a("rubric.saved")), w(k);
1816
+ } catch (k) {
1817
+ const P = k.body;
1818
+ P?.errors && (S.value = P.errors);
1819
+ const B = E();
1820
+ B !== null && (O.value = B), F.danger(x(k));
1781
1821
  } finally {
1782
1822
  W.value = !1;
1783
1823
  }
1784
1824
  }
1785
- async function K() {
1786
- if (!(r.rubric === null || !await me({
1787
- title: s("rubric.delete-title", { name: r.rubric.name }),
1788
- message: s("rubric.delete-text"),
1789
- confirmText: s("rubric.delete"),
1790
- cancelText: s("rubric.cancel"),
1791
- tone: "danger"
1792
- })))
1793
- try {
1794
- await a.removeRubric(r.rubric.id), L.success(s("rubric.deleted")), y("deleted");
1795
- } catch (q) {
1796
- L.danger(i(q));
1797
- }
1798
- }
1799
- return (P, q) => (p(), Z("div", {
1800
- class: Pe(["wx-rubric-form", { "is-pane": r.inline }])
1801
- }, [
1802
- j("div", ya, [
1803
- r.inline ? H("", !0) : (p(), C(e(Oe), {
1804
- key: 0,
1805
- icon: "arrow-left",
1806
- title: e(s)("rubric.back"),
1807
- onClick: q[0] || (q[0] = (k) => y("back"))
1808
- }, null, 8, ["title"])),
1809
- n(e($t), {
1810
- level: 3,
1811
- truncate: ""
1812
- }, {
1813
- default: l(() => [
1814
- w(b(F.value), 1)
1815
- ]),
1816
- _: 1
1817
- }),
1818
- r.rubric ? (p(), C(e(G), {
1819
- key: 1,
1820
- size: "sm",
1821
- tone: "muted"
1825
+ return (k, P) => (h(), M(e(Me), {
1826
+ open: e(c),
1827
+ "onUpdate:open": P[7] || (P[7] = (B) => Ue(c) ? c.value = B : null),
1828
+ class: "wx-rubric-dialog",
1829
+ title: $.value,
1830
+ width: 880,
1831
+ closable: "",
1832
+ onClose: e(n)
1833
+ }, {
1834
+ footer: i(() => [
1835
+ s(e(J), {
1836
+ variant: "outline",
1837
+ onClick: e(n)
1822
1838
  }, {
1823
- default: l(() => [
1824
- w(b(e(s)("rubric.articles", { count: R.value })), 1)
1839
+ default: i(() => [
1840
+ z(T(e(a)("rubric.cancel")), 1)
1825
1841
  ]),
1826
1842
  _: 1
1827
- })) : H("", !0),
1828
- q[10] || (q[10] = j("span", { class: "wx-rubric-form__spacer" }, null, -1)),
1829
- r.rubric && R.value > 0 ? (p(), C(e(J), {
1830
- key: 2,
1831
- variant: "text",
1832
- size: "sm",
1833
- onClick: q[1] || (q[1] = (k) => y("articles", r.rubric))
1843
+ }, 8, ["onClick"]),
1844
+ s(e(J), {
1845
+ type: "primary",
1846
+ loading: W.value,
1847
+ disabled: o.disabled,
1848
+ onClick: K
1834
1849
  }, {
1835
- default: l(() => [
1836
- w(b(e(s)("rubric.show-articles")), 1)
1850
+ default: i(() => [
1851
+ z(T(e(a)("rubric.save")), 1)
1837
1852
  ]),
1838
1853
  _: 1
1839
- })) : H("", !0)
1854
+ }, 8, ["loading", "disabled"])
1840
1855
  ]),
1841
- j("div", wa, [
1842
- j("div", _a, [
1843
- n(e(ie), {
1844
- class: "wx-rubric-form__title",
1845
- label: e(s)("rubric.field-title"),
1846
- error: M("title"),
1847
- required: ""
1848
- }, {
1849
- default: l(() => [
1850
- n(e(Ae), {
1851
- modelValue: o.value.title,
1852
- "onUpdate:modelValue": q[2] || (q[2] = (k) => o.value.title = k),
1853
- localized: "",
1854
- disabled: r.disabled
1855
- }, null, 8, ["modelValue", "disabled"])
1856
- ]),
1857
- _: 1
1858
- }, 8, ["label", "error"]),
1859
- n(e(ie), {
1860
- class: "wx-rubric-form__slug",
1861
- label: e(s)("rubric.field-slug"),
1862
- error: M("slug"),
1863
- help: $.value ?? e(s)("rubric.no-address")
1864
- }, {
1865
- default: l(() => [
1866
- n(e(Ae), {
1867
- modelValue: o.value.slug,
1868
- "onUpdate:modelValue": q[3] || (q[3] = (k) => o.value.slug = k),
1869
- localized: "",
1870
- disabled: r.disabled
1871
- }, null, 8, ["modelValue", "disabled"])
1872
- ]),
1873
- _: 1
1874
- }, 8, ["label", "error", "help"])
1875
- ]),
1876
- U.value ? (p(), C(e(We), {
1877
- key: 0,
1878
- type: "info",
1879
- variant: "soft",
1880
- description: e(s)("rubric.address-moving")
1881
- }, null, 8, ["description"])) : H("", !0),
1882
- n(e(ie), {
1883
- label: e(s)("rubric.field-lead"),
1884
- help: e(s)("rubric.lead-help"),
1885
- wide: ""
1856
+ default: i(() => [
1857
+ s(e(Wt), {
1858
+ modelValue: O.value,
1859
+ "onUpdate:modelValue": P[6] || (P[6] = (B) => O.value = B),
1860
+ "keep-alive": ""
1886
1861
  }, {
1887
- default: l(() => [
1888
- n(e(Tt), {
1889
- modelValue: o.value.lead,
1890
- "onUpdate:modelValue": q[4] || (q[4] = (k) => o.value.lead = k),
1891
- localized: "",
1892
- rows: 3,
1893
- disabled: r.disabled
1894
- }, null, 8, ["modelValue", "disabled"])
1895
- ]),
1896
- _: 1
1897
- }, 8, ["label", "help"]),
1898
- j("div", xa, [
1899
- x.value ? (p(), C(tt(x.value), {
1900
- key: 0,
1901
- modelValue: o.value.cover,
1902
- "onUpdate:modelValue": q[5] || (q[5] = (k) => o.value.cover = k),
1903
- class: "wx-rubric-form__cover",
1904
- label: e(s)("rubric.field-cover"),
1905
- accept: "image",
1906
- captions: !1,
1907
- aspect: "16/9",
1908
- disabled: r.disabled
1909
- }, null, 8, ["modelValue", "label", "disabled"])) : H("", !0),
1910
- j("div", ka, [
1911
- n(e(Vt), {
1912
- modelValue: o.value.is_visible,
1913
- "onUpdate:modelValue": q[6] || (q[6] = (k) => o.value.is_visible = k),
1914
- label: e(s)("rubric.visible"),
1915
- disabled: r.disabled
1916
- }, null, 8, ["modelValue", "label", "disabled"]),
1917
- n(e(G), {
1918
- size: "sm",
1919
- tone: "muted"
1862
+ default: i(() => [
1863
+ s(e(Ke), {
1864
+ value: "content",
1865
+ label: e(a)("rubric.tab-content")
1920
1866
  }, {
1921
- default: l(() => [
1922
- w(b(e(s)("rubric.visible-help")), 1)
1923
- ]),
1924
- _: 1
1925
- })
1926
- ])
1927
- ]),
1928
- T.value ? (p(), Z("div", $a, [
1929
- S.value ? (p(), C(tt(T.value), pt({
1930
- key: 1,
1931
- modelValue: o.value.seo,
1932
- "onUpdate:modelValue": q[8] || (q[8] = (k) => o.value.seo = k)
1933
- }, c.value, {
1934
- "structured-data": !1,
1935
- disabled: r.disabled
1936
- }), null, 16, ["modelValue", "disabled"])) : (p(), Z(be, { key: 0 }, [
1937
- n(e(G), {
1938
- size: "sm",
1939
- weight: "medium"
1940
- }, {
1941
- default: l(() => [
1942
- w(b(e(s)("rubric.seo")), 1)
1867
+ default: i(() => [
1868
+ H("div", $a, [
1869
+ H("div", Ta, [
1870
+ s(e(ie), {
1871
+ class: "wx-rubric-dialog__field",
1872
+ label: e(a)("rubric.field-title"),
1873
+ error: A("title"),
1874
+ required: ""
1875
+ }, {
1876
+ default: i(() => [
1877
+ s(e(Ve), {
1878
+ modelValue: v.value.title,
1879
+ "onUpdate:modelValue": P[0] || (P[0] = (B) => v.value.title = B),
1880
+ localized: "",
1881
+ disabled: o.disabled
1882
+ }, null, 8, ["modelValue", "disabled"])
1883
+ ]),
1884
+ _: 1
1885
+ }, 8, ["label", "error"]),
1886
+ s(e(ie), {
1887
+ class: "wx-rubric-dialog__field",
1888
+ label: e(a)("rubric.field-slug"),
1889
+ error: A("slug"),
1890
+ help: C.value ?? void 0
1891
+ }, {
1892
+ default: i(() => [
1893
+ s(e(Ve), {
1894
+ modelValue: v.value.slug,
1895
+ "onUpdate:modelValue": P[1] || (P[1] = (B) => v.value.slug = B),
1896
+ localized: "",
1897
+ disabled: o.disabled
1898
+ }, null, 8, ["modelValue", "disabled"])
1899
+ ]),
1900
+ _: 1
1901
+ }, 8, ["label", "error", "help"])
1902
+ ]),
1903
+ q.value ? (h(), M(e(we), {
1904
+ key: 0,
1905
+ type: "info",
1906
+ variant: "soft",
1907
+ description: e(a)("rubric.address-moving")
1908
+ }, null, 8, ["description"])) : j("", !0),
1909
+ s(e(ie), {
1910
+ help: e(a)("rubric.visible-help"),
1911
+ wide: ""
1912
+ }, {
1913
+ default: i(() => [
1914
+ s(e(Ct), {
1915
+ modelValue: v.value.is_visible,
1916
+ "onUpdate:modelValue": P[2] || (P[2] = (B) => v.value.is_visible = B),
1917
+ label: e(a)("rubric.visible"),
1918
+ disabled: o.disabled
1919
+ }, null, 8, ["modelValue", "label", "disabled"])
1920
+ ]),
1921
+ _: 1
1922
+ }, 8, ["help"]),
1923
+ s(e(ie), {
1924
+ label: e(a)("rubric.field-lead"),
1925
+ error: A("lead"),
1926
+ help: e(a)("rubric.lead-help"),
1927
+ wide: ""
1928
+ }, {
1929
+ default: i(() => [
1930
+ s(e(kt), {
1931
+ modelValue: v.value.lead,
1932
+ "onUpdate:modelValue": P[3] || (P[3] = (B) => v.value.lead = B),
1933
+ localized: "",
1934
+ disabled: o.disabled
1935
+ }, null, 8, ["modelValue", "disabled"])
1936
+ ]),
1937
+ _: 1
1938
+ }, 8, ["label", "error", "help"])
1939
+ ])
1943
1940
  ]),
1944
1941
  _: 1
1945
- }),
1946
- n(e(G), {
1947
- size: "sm",
1948
- tone: "muted"
1942
+ }, 8, ["label"]),
1943
+ b.value ? (h(), M(e(Ke), {
1944
+ key: 0,
1945
+ value: "cover",
1946
+ label: e(a)("rubric.tab-cover")
1949
1947
  }, {
1950
- default: l(() => [
1951
- w(b(e(s)("rubric.seo-help")), 1)
1948
+ default: i(() => [
1949
+ H("div", Va, [
1950
+ (h(), M(et(b.value), {
1951
+ modelValue: v.value.cover,
1952
+ "onUpdate:modelValue": P[4] || (P[4] = (B) => v.value.cover = B),
1953
+ class: "wx-rubric-dialog__cover",
1954
+ accept: "image",
1955
+ captions: !1,
1956
+ aspect: "16/9",
1957
+ disabled: o.disabled
1958
+ }, null, 8, ["modelValue", "disabled"])),
1959
+ s(e(we), {
1960
+ type: "info",
1961
+ description: e(a)("rubric.cover-help")
1962
+ }, null, 8, ["description"])
1963
+ ])
1952
1964
  ]),
1953
1965
  _: 1
1954
- }),
1955
- n(e(J), {
1956
- variant: "text",
1957
- size: "sm",
1958
- disabled: r.disabled,
1959
- onClick: q[7] || (q[7] = (k) => S.value = !0)
1966
+ }, 8, ["label"])) : j("", !0),
1967
+ d.value ? (h(), M(e(Ke), {
1968
+ key: 1,
1969
+ value: "seo",
1970
+ label: e(a)("rubric.tab-seo")
1960
1971
  }, {
1961
- default: l(() => [
1962
- w(b(e(s)("rubric.seo-override", { name: F.value })), 1)
1972
+ default: i(() => [
1973
+ H("div", Aa, [
1974
+ s(e(we), {
1975
+ type: "info",
1976
+ description: e(a)("rubric.seo-help")
1977
+ }, null, 8, ["description"]),
1978
+ (h(), M(et(d.value), bt({
1979
+ modelValue: v.value.seo,
1980
+ "onUpdate:modelValue": P[5] || (P[5] = (B) => v.value.seo = B)
1981
+ }, f.value, {
1982
+ "structured-data": !1,
1983
+ disabled: o.disabled
1984
+ }), null, 16, ["modelValue", "disabled"]))
1985
+ ])
1963
1986
  ]),
1964
1987
  _: 1
1965
- }, 8, ["disabled"])
1966
- ], 64))
1967
- ])) : H("", !0)
1968
- ]),
1969
- j("div", Ta, [
1970
- r.rubric ? (p(), Z(be, { key: 0 }, [
1971
- n(e(J), {
1972
- variant: "outline",
1973
- type: "danger",
1974
- disabled: r.disabled || R.value > 0,
1975
- onClick: K
1976
- }, {
1977
- icon: l(() => [
1978
- n(e(we), { name: "trash" })
1979
- ]),
1980
- default: l(() => [
1981
- w(" " + b(e(s)("rubric.delete")), 1)
1982
- ]),
1983
- _: 1
1984
- }, 8, ["disabled"]),
1985
- R.value > 0 ? (p(), C(e(G), {
1986
- key: 0,
1987
- size: "sm",
1988
- tone: "muted"
1989
- }, {
1990
- default: l(() => [
1991
- w(b(e(s)("rubric.delete-blocked")), 1)
1992
- ]),
1993
- _: 1
1994
- })) : H("", !0)
1995
- ], 64)) : H("", !0),
1996
- q[11] || (q[11] = j("span", { class: "wx-rubric-form__spacer" }, null, -1)),
1997
- n(e(J), {
1998
- variant: "outline",
1999
- onClick: q[9] || (q[9] = (k) => y("back"))
2000
- }, {
2001
- default: l(() => [
2002
- w(b(e(s)("rubric.cancel")), 1)
1988
+ }, 8, ["label"])) : j("", !0)
2003
1989
  ]),
2004
1990
  _: 1
2005
- }),
2006
- n(e(J), {
2007
- type: "primary",
2008
- loading: W.value,
2009
- disabled: r.disabled,
2010
- onClick: I
2011
- }, {
2012
- default: l(() => [
2013
- w(b(e(s)("rubric.save")), 1)
2014
- ]),
2015
- _: 1
2016
- }, 8, ["loading", "disabled"])
2017
- ])
2018
- ], 2));
1991
+ }, 8, ["modelValue"])
1992
+ ]),
1993
+ _: 1
1994
+ }, 8, ["open", "title", "onClose"]));
2019
1995
  }
2020
- }), Aa = /* @__PURE__ */ ve(Va, [["__scopeId", "data-v-ace40cf4"]]), Sa = ["onClick"], Wa = { class: "wx-rubric-row__name" }, Ca = /* @__PURE__ */ ee({
1996
+ }), Wa = /* @__PURE__ */ ce(Sa, [["__scopeId", "data-v-ff50aaf6"]]), Ca = ["onClick"], za = { class: "wx-rubric-row__name" }, Ua = /* @__PURE__ */ X({
2021
1997
  __name: "RubricsPage",
2022
1998
  props: {
2023
1999
  base: { default: "/blog" }
2024
2000
  },
2025
- setup(f) {
2026
- const m = f, r = ne(), y = de(r), u = He(), a = Ke();
2027
- te();
2028
- const t = Q("webx-blog"), s = ge(), i = z([]), x = z(""), T = z(!0), c = z(!1), o = z(!1), _ = v(() => r.can("blog.taxonomy.manage")), W = v(
2029
- () => r.state.manifest?.modules.find((k) => k.id === "rubrics")?.title ?? t("module.rubrics")
2030
- ), S = v(() => {
2031
- const k = u.query.rubric;
2032
- return typeof k == "string" && k !== "" ? Number(k) : null;
2033
- }), E = v(() => i.value.find((k) => k.id === S.value) ?? null);
2034
- async function F() {
2035
- T.value = !0;
2001
+ setup(g) {
2002
+ const o = g, c = ne(), w = re(c), n = Le(), l = Fe();
2003
+ Y();
2004
+ const t = Q("webx-blog"), u = pe(), a = U([]), x = U(""), b = U(!0), d = p(() => c.can("blog.taxonomy.manage")), f = p(
2005
+ () => c.state.manifest?.modules.find((y) => y.id === "rubrics")?.title ?? t("module.rubrics")
2006
+ ), v = Ce(Wa), S = p(
2007
+ () => d.value ? [
2008
+ {
2009
+ key: "new",
2010
+ label: t("rubric.new"),
2011
+ icon: "plus",
2012
+ primary: !0,
2013
+ run: () => {
2014
+ C(null);
2015
+ }
2016
+ }
2017
+ ] : []
2018
+ );
2019
+ async function W() {
2020
+ b.value = !0;
2036
2021
  try {
2037
- const k = await y.rubrics();
2038
- i.value = k.data, x.value = k.prefix;
2039
- } catch (k) {
2040
- L.danger(s(k));
2022
+ const y = await w.rubrics();
2023
+ a.value = y.data, x.value = y.prefix;
2024
+ } catch (y) {
2025
+ F.danger(u(y));
2041
2026
  } finally {
2042
- T.value = !1;
2027
+ b.value = !1;
2043
2028
  }
2044
2029
  }
2045
- F(), ue(E, (k) => {
2046
- k !== null && (c.value = !0);
2047
- });
2048
- function $(k) {
2049
- o.value = !1, a.replace({ query: { ...u.query, rubric: String(k.id) } }), c.value = !0;
2050
- }
2051
- function U() {
2052
- o.value = !0, R(), c.value = !0;
2053
- }
2054
- function R() {
2055
- const k = { ...u.query };
2056
- delete k.rubric, a.replace({ query: k });
2030
+ W();
2031
+ let O = !1, L = null;
2032
+ ue(
2033
+ [() => n.query.rubric, b],
2034
+ ([y, K]) => {
2035
+ const k = typeof y == "string" && y !== "" ? y : null;
2036
+ if (k === null) {
2037
+ L = null;
2038
+ return;
2039
+ }
2040
+ if (K || O || k === L) return;
2041
+ const P = a.value.find((B) => B.id === Number(k));
2042
+ P && C(P);
2043
+ },
2044
+ { immediate: !0 }
2045
+ );
2046
+ function $(y) {
2047
+ const K = { ...n.query };
2048
+ y === null ? delete K.rubric : K.rubric = String(y), l.replace({ query: K });
2057
2049
  }
2058
- async function M(k) {
2059
- o.value = !1, await F(), a.replace({ query: { ...u.query, rubric: String(k.id) } });
2050
+ async function C(y) {
2051
+ if (!O) {
2052
+ O = !0, L = y === null ? null : String(y.id), $(y?.id ?? null);
2053
+ try {
2054
+ const K = await v({ rubric: y, prefix: x.value, disabled: !d.value });
2055
+ if (K === void 0) {
2056
+ $(null);
2057
+ return;
2058
+ }
2059
+ await W(), L = String(K.id), $(K.id);
2060
+ } finally {
2061
+ O = !1;
2062
+ }
2063
+ }
2060
2064
  }
2061
- async function A() {
2062
- o.value = !1, R(), c.value = !1, await F();
2065
+ function q(y) {
2066
+ l.push({ path: `${o.base}/articles`, query: { rubric: String(y.id) } });
2063
2067
  }
2064
- function I() {
2065
- o.value = !1, R(), c.value = !1;
2068
+ async function N(y) {
2069
+ if (y.articles_count > 0) {
2070
+ F.warning(t("rubric.delete-blocked"));
2071
+ return;
2072
+ }
2073
+ if (await ve({
2074
+ title: t("rubric.delete-title", { name: y.name }),
2075
+ message: t("rubric.delete-text"),
2076
+ confirmText: t("rubric.delete"),
2077
+ cancelText: t("rubric.cancel"),
2078
+ tone: "danger"
2079
+ }))
2080
+ try {
2081
+ await w.removeRubric(y.id), F.success(t("rubric.deleted")), $(null), await W();
2082
+ } catch (k) {
2083
+ F.danger(u(k));
2084
+ }
2066
2085
  }
2067
- function K(k) {
2068
- a.push({ path: `${m.base}/articles`, query: { rubric: String(k.id) } });
2086
+ function A(y) {
2087
+ const K = [
2088
+ { key: "edit", label: t("rubric.edit"), icon: "edit", run: () => {
2089
+ C(y);
2090
+ } }
2091
+ ];
2092
+ return y.articles_count > 0 && K.push({
2093
+ key: "articles",
2094
+ label: t("rubric.show-articles"),
2095
+ icon: "file-text",
2096
+ run: () => q(y)
2097
+ }), d.value && K.push({
2098
+ key: "delete",
2099
+ label: t("rubric.delete"),
2100
+ icon: "trash",
2101
+ danger: !0,
2102
+ run: () => {
2103
+ N(y);
2104
+ }
2105
+ }), K;
2069
2106
  }
2070
- const P = v(
2071
- () => _.value ? [{ key: "new", label: t("rubric.new"), icon: "plus", primary: !0, run: () => {
2072
- U();
2073
- } }] : []
2074
- );
2075
- async function q() {
2107
+ async function E() {
2076
2108
  try {
2077
- await y.sortRubrics(i.value.map((k) => k.id));
2078
- } catch (k) {
2079
- L.danger(s(k, t("rubric.reorder-failed"))), await F();
2109
+ await w.sortRubrics(a.value.map((y) => y.id));
2110
+ } catch (y) {
2111
+ F.danger(u(y, t("rubric.reorder-failed"))), await W();
2080
2112
  }
2081
2113
  }
2082
- return (k, le) => (p(), C(e(Qe), {
2083
- title: W.value,
2084
- actions: P.value,
2085
- card: !1,
2086
- fill: ""
2114
+ return (y, K) => (h(), M(e(Ze), {
2115
+ class: "wx-rubrics",
2116
+ title: f.value,
2117
+ actions: S.value,
2118
+ padding: "sm"
2087
2119
  }, {
2088
- default: l(() => [
2089
- n(e(At), {
2090
- class: "wx-rubrics",
2091
- padding: "none"
2092
- }, {
2093
- default: l(() => [
2094
- n(e(St), {
2095
- open: c.value,
2096
- "onUpdate:open": le[1] || (le[1] = (O) => c.value = O),
2097
- class: "wx-rubrics__panes",
2098
- "list-width": 320,
2099
- "detail-min": 440,
2100
- "detail-label": E.value ? E.value.name : e(t)("rubric.new")
2101
- }, {
2102
- list: l(() => [
2103
- T.value ? (p(), C(e(Ue), {
2104
- key: 0,
2105
- class: "wx-rubrics__loading",
2106
- rows: 5
2107
- })) : i.value.length === 0 ? (p(), C(e(Ge), {
2108
- key: 1,
2109
- title: e(t)("rubric.empty"),
2110
- description: e(t)("rubric.empty-help")
2111
- }, null, 8, ["title", "description"])) : (p(), C(e(Ye), {
2112
- key: 2,
2113
- modelValue: i.value,
2114
- "onUpdate:modelValue": le[0] || (le[0] = (O) => i.value = O),
2115
- class: "wx-rubrics__list",
2116
- plain: "",
2120
+ default: i(() => [
2121
+ b.value ? (h(), M(e(Ne), {
2122
+ key: 0,
2123
+ class: "wx-rubrics__loading",
2124
+ rows: 5
2125
+ })) : a.value.length === 0 ? (h(), M(e(rt), {
2126
+ key: 1,
2127
+ title: e(t)("rubric.empty"),
2128
+ description: e(t)("rubric.empty-help")
2129
+ }, null, 8, ["title", "description"])) : (h(), G(_e, { key: 2 }, [
2130
+ s(e(Xe), {
2131
+ modelValue: a.value,
2132
+ "onUpdate:modelValue": K[0] || (K[0] = (k) => a.value = k),
2133
+ class: "wx-rubrics__list",
2134
+ plain: "",
2135
+ "item-key": "id",
2136
+ "item-label": (k) => k.name,
2137
+ disabled: !d.value,
2138
+ onMove: E
2139
+ }, {
2140
+ default: i(({ item: k }) => [
2141
+ H("button", {
2142
+ type: "button",
2143
+ class: Ge(["wx-rubric-row", { "is-hidden": !k.is_visible }]),
2144
+ onClick: (P) => C(k)
2145
+ }, [
2146
+ H("span", za, [
2147
+ s(e(le), {
2148
+ truncate: "",
2149
+ weight: "medium"
2150
+ }, {
2151
+ default: i(() => [
2152
+ z(T(k.name), 1)
2153
+ ]),
2154
+ _: 2
2155
+ }, 1024),
2156
+ k.is_visible ? j("", !0) : (h(), M(e(Ye), {
2157
+ key: 0,
2158
+ content: e(t)("rubric.hidden")
2159
+ }, {
2160
+ default: i(() => [
2161
+ s(e(Te), {
2162
+ name: "eye-off",
2163
+ size: "sm"
2164
+ })
2165
+ ]),
2166
+ _: 1
2167
+ }, 8, ["content"]))
2168
+ ]),
2169
+ s(e(le), {
2117
2170
  size: "sm",
2118
- "item-key": "id",
2119
- "item-label": (O) => O.name,
2120
- disabled: !_.value,
2121
- title: e(t)("rubric.order"),
2122
- onMove: q
2171
+ tone: "muted",
2172
+ truncate: ""
2123
2173
  }, {
2124
- default: l(({ item: O }) => [
2125
- j("button", {
2126
- type: "button",
2127
- class: Pe(["wx-rubric-row", { "is-current": O.id === S.value, "is-hidden": !O.is_visible }]),
2128
- onClick: (se) => $(O)
2129
- }, [
2130
- j("span", Wa, [
2131
- n(e(G), {
2132
- truncate: "",
2133
- weight: "medium"
2134
- }, {
2135
- default: l(() => [
2136
- w(b(O.name), 1)
2137
- ]),
2138
- _: 2
2139
- }, 1024),
2140
- O.is_visible ? H("", !0) : (p(), C(e(et), {
2141
- key: 0,
2142
- content: e(t)("rubric.hidden")
2143
- }, {
2144
- default: l(() => [
2145
- n(e(we), {
2146
- name: "eye-off",
2147
- size: "sm"
2148
- })
2149
- ]),
2150
- _: 1
2151
- }, 8, ["content"]))
2152
- ]),
2153
- n(e(G), {
2154
- size: "sm",
2155
- tone: "muted",
2156
- truncate: ""
2157
- }, {
2158
- default: l(() => [
2159
- w(b(O.path === null ? e(t)("rubric.no-address") : `/${O.path}`), 1)
2160
- ]),
2161
- _: 2
2162
- }, 1024)
2163
- ], 10, Sa)
2174
+ default: i(() => [
2175
+ z(T(k.path === null ? e(t)("rubric.no-address") : `/${k.path}`), 1)
2164
2176
  ]),
2165
- actions: l(({ item: O }) => [
2166
- n(e(G), {
2167
- class: "wx-rubric-row__count",
2168
- size: "sm",
2169
- tone: "muted"
2170
- }, {
2171
- default: l(() => [
2172
- w(b(O.articles_count), 1)
2173
- ]),
2174
- _: 2
2175
- }, 1024)
2176
- ]),
2177
- _: 1
2178
- }, 8, ["modelValue", "item-label", "disabled", "title"]))
2179
- ]),
2180
- empty: l(() => [
2181
- n(e(Ge), {
2182
- description: e(t)("rubric.choose")
2183
- }, null, 8, ["description"])
2184
- ]),
2185
- detail: l(({ inline: O, back: se }) => [
2186
- o.value || E.value ? (p(), C(Aa, {
2187
- key: o.value ? "new" : String(E.value?.id),
2188
- rubric: o.value ? null : E.value,
2189
- prefix: x.value,
2190
- inline: O,
2191
- disabled: !_.value,
2192
- onBack: () => {
2193
- se(), I();
2194
- },
2195
- onArticles: K,
2196
- onSaved: M,
2197
- onDeleted: A
2198
- }, null, 8, ["rubric", "prefix", "inline", "disabled", "onBack"])) : H("", !0)
2199
- ]),
2200
- _: 1
2201
- }, 8, ["open", "detail-label"])
2202
- ]),
2203
- _: 1
2204
- })
2177
+ _: 2
2178
+ }, 1024)
2179
+ ], 10, Ca)
2180
+ ]),
2181
+ actions: i(({ item: k }) => [
2182
+ s(e(le), {
2183
+ class: "wx-rubric-row__count",
2184
+ size: "sm",
2185
+ tone: "muted"
2186
+ }, {
2187
+ default: i(() => [
2188
+ z(T(e(t)("rubric.articles", { count: k.articles_count })), 1)
2189
+ ]),
2190
+ _: 2
2191
+ }, 1024),
2192
+ s(e(ze), {
2193
+ actions: A(k),
2194
+ label: k.name
2195
+ }, null, 8, ["actions", "label"])
2196
+ ]),
2197
+ _: 1
2198
+ }, 8, ["modelValue", "item-label", "disabled"]),
2199
+ s(e(we), {
2200
+ class: "wx-rubrics__note",
2201
+ type: "info",
2202
+ description: e(t)("rubric.order")
2203
+ }, null, 8, ["description"])
2204
+ ], 64))
2205
2205
  ]),
2206
2206
  _: 1
2207
2207
  }, 8, ["title", "actions"]));
2208
2208
  }
2209
- }), za = /* @__PURE__ */ ee({
2209
+ }), Ra = /* @__PURE__ */ X({
2210
2210
  __name: "TagCreateDialog",
2211
- setup(f) {
2212
- const { open: m, resolve: r, dismiss: y } = Ee(), u = ne(), a = de(u);
2213
- te();
2214
- const t = Q("webx-blog"), s = z(""), i = z(""), x = z(!1), T = z({}), c = De("field");
2215
- Ne(async () => {
2216
- await Ze(), c.value?.querySelector("input")?.focus();
2211
+ setup(g) {
2212
+ const { open: o, resolve: c, dismiss: w } = Re(), n = ne(), l = re(n);
2213
+ Y();
2214
+ const t = Q("webx-blog"), u = U(""), a = U(""), x = U(!1), b = U({}), d = Ee("field");
2215
+ Be(async () => {
2216
+ await Je(), d.value?.querySelector("input")?.focus();
2217
2217
  });
2218
- async function o() {
2219
- if (!(s.value.trim() === "" || x.value)) {
2220
- x.value = !0, T.value = {};
2218
+ async function f() {
2219
+ if (!(u.value.trim() === "" || x.value)) {
2220
+ x.value = !0, b.value = {};
2221
2221
  try {
2222
- r(
2223
- await a.createTag({
2224
- title: s.value.trim(),
2225
- ...i.value.trim() === "" ? {} : { slug: i.value.trim() }
2222
+ c(
2223
+ await l.createTag({
2224
+ title: u.value.trim(),
2225
+ ...a.value.trim() === "" ? {} : { slug: a.value.trim() }
2226
2226
  })
2227
2227
  );
2228
- } catch (_) {
2229
- T.value = _.body?.errors ?? {};
2228
+ } catch (v) {
2229
+ b.value = v.body?.errors ?? {};
2230
2230
  } finally {
2231
2231
  x.value = !1;
2232
2232
  }
2233
2233
  }
2234
2234
  }
2235
- return (_, W) => (p(), C(e(Fe), {
2236
- open: e(m),
2237
- "onUpdate:open": W[3] || (W[3] = (S) => Ie(m) ? m.value = S : null),
2235
+ return (v, S) => (h(), M(e(Me), {
2236
+ open: e(o),
2237
+ "onUpdate:open": S[3] || (S[3] = (W) => Ue(o) ? o.value = W : null),
2238
2238
  title: e(t)("tag.new-title"),
2239
2239
  width: 440
2240
2240
  }, {
2241
- footer: l(() => [
2242
- n(e(Le), { size: "sm" }, {
2243
- default: l(() => [
2244
- n(e(J), {
2241
+ footer: i(() => [
2242
+ s(e(Oe), { size: "sm" }, {
2243
+ default: i(() => [
2244
+ s(e(J), {
2245
2245
  variant: "outline",
2246
- onClick: W[2] || (W[2] = (S) => e(y)())
2246
+ onClick: S[2] || (S[2] = (W) => e(w)())
2247
2247
  }, {
2248
- default: l(() => [
2249
- w(b(e(t)("tag.cancel")), 1)
2248
+ default: i(() => [
2249
+ z(T(e(t)("tag.cancel")), 1)
2250
2250
  ]),
2251
2251
  _: 1
2252
2252
  }),
2253
- n(e(J), {
2253
+ s(e(J), {
2254
2254
  type: "primary",
2255
2255
  loading: x.value,
2256
- disabled: s.value.trim() === "",
2257
- onClick: o
2256
+ disabled: u.value.trim() === "",
2257
+ onClick: f
2258
2258
  }, {
2259
- default: l(() => [
2260
- w(b(e(t)("tag.create")), 1)
2259
+ default: i(() => [
2260
+ z(T(e(t)("tag.create")), 1)
2261
2261
  ]),
2262
2262
  _: 1
2263
2263
  }, 8, ["loading", "disabled"])
@@ -2265,38 +2265,38 @@ const Pt = { class: "wx-article-editor__screen" }, Dt = 1200, It = /* @__PURE__
2265
2265
  _: 1
2266
2266
  })
2267
2267
  ]),
2268
- default: l(() => [
2269
- n(e(ie), {
2268
+ default: i(() => [
2269
+ s(e(ie), {
2270
2270
  label: e(t)("tag.field-title"),
2271
- error: T.value.title?.[0],
2271
+ error: b.value.title?.[0],
2272
2272
  required: ""
2273
2273
  }, {
2274
- default: l(() => [
2275
- j("div", {
2274
+ default: i(() => [
2275
+ H("div", {
2276
2276
  ref_key: "field",
2277
- ref: c
2277
+ ref: d
2278
2278
  }, [
2279
- n(e(Ae), {
2280
- modelValue: s.value,
2281
- "onUpdate:modelValue": W[0] || (W[0] = (S) => s.value = S),
2279
+ s(e(Ve), {
2280
+ modelValue: u.value,
2281
+ "onUpdate:modelValue": S[0] || (S[0] = (W) => u.value = W),
2282
2282
  "aria-label": e(t)("tag.field-title"),
2283
- onKeyup: ze(o, ["enter"])
2283
+ onKeyup: qe(f, ["enter"])
2284
2284
  }, null, 8, ["modelValue", "aria-label"])
2285
2285
  ], 512)
2286
2286
  ]),
2287
2287
  _: 1
2288
2288
  }, 8, ["label", "error"]),
2289
- n(e(ie), {
2289
+ s(e(ie), {
2290
2290
  label: e(t)("tag.field-slug"),
2291
- error: T.value.slug?.[0],
2291
+ error: b.value.slug?.[0],
2292
2292
  help: e(t)("tag.field-slug-help")
2293
2293
  }, {
2294
- default: l(() => [
2295
- n(e(Ae), {
2296
- modelValue: i.value,
2297
- "onUpdate:modelValue": W[1] || (W[1] = (S) => i.value = S),
2294
+ default: i(() => [
2295
+ s(e(Ve), {
2296
+ modelValue: a.value,
2297
+ "onUpdate:modelValue": S[1] || (S[1] = (W) => a.value = W),
2298
2298
  "aria-label": e(t)("tag.field-slug"),
2299
- onKeyup: ze(o, ["enter"])
2299
+ onKeyup: qe(f, ["enter"])
2300
2300
  }, null, 8, ["modelValue", "aria-label"])
2301
2301
  ]),
2302
2302
  _: 1
@@ -2305,54 +2305,54 @@ const Pt = { class: "wx-article-editor__screen" }, Dt = 1200, It = /* @__PURE__
2305
2305
  _: 1
2306
2306
  }, 8, ["open", "title"]));
2307
2307
  }
2308
- }), Ra = ["id"], Ua = /* @__PURE__ */ ee({
2308
+ }), Ma = ["id"], qa = /* @__PURE__ */ X({
2309
2309
  __name: "TagRenameDialog",
2310
2310
  props: {
2311
2311
  name: {}
2312
2312
  },
2313
- setup(f) {
2314
- const m = f, { open: r, resolve: y, dismiss: u } = Ee();
2315
- te();
2316
- const a = Q("webx-blog"), t = Q("webx-admin"), s = ft(), i = z(m.name), x = De("field");
2317
- Ne(async () => {
2318
- await Ze();
2319
- const c = x.value?.querySelector("input");
2320
- c?.focus(), c?.select();
2313
+ setup(g) {
2314
+ const o = g, { open: c, resolve: w, dismiss: n } = Re();
2315
+ Y();
2316
+ const l = Q("webx-blog"), t = Q("webx-admin"), u = mt(), a = U(o.name), x = Ee("field");
2317
+ Be(async () => {
2318
+ await Je();
2319
+ const d = x.value?.querySelector("input");
2320
+ d?.focus(), d?.select();
2321
2321
  });
2322
- function T() {
2323
- const c = i.value.trim();
2324
- if (c === "" || c === m.name) {
2325
- u();
2322
+ function b() {
2323
+ const d = a.value.trim();
2324
+ if (d === "" || d === o.name) {
2325
+ n();
2326
2326
  return;
2327
2327
  }
2328
- y(c);
2328
+ w(d);
2329
2329
  }
2330
- return (c, o) => (p(), C(e(Fe), {
2331
- open: e(r),
2332
- "onUpdate:open": o[2] || (o[2] = (_) => Ie(r) ? r.value = _ : null),
2333
- title: e(a)("tag.rename"),
2330
+ return (d, f) => (h(), M(e(Me), {
2331
+ open: e(c),
2332
+ "onUpdate:open": f[2] || (f[2] = (v) => Ue(c) ? c.value = v : null),
2333
+ title: e(l)("tag.rename"),
2334
2334
  width: 420
2335
2335
  }, {
2336
- footer: l(() => [
2337
- n(e(Le), { size: "sm" }, {
2338
- default: l(() => [
2339
- n(e(J), {
2336
+ footer: i(() => [
2337
+ s(e(Oe), { size: "sm" }, {
2338
+ default: i(() => [
2339
+ s(e(J), {
2340
2340
  variant: "outline",
2341
- onClick: o[1] || (o[1] = (_) => e(u)())
2341
+ onClick: f[1] || (f[1] = (v) => e(n)())
2342
2342
  }, {
2343
- default: l(() => [
2344
- w(b(e(a)("tag.cancel")), 1)
2343
+ default: i(() => [
2344
+ z(T(e(l)("tag.cancel")), 1)
2345
2345
  ]),
2346
2346
  _: 1
2347
2347
  }),
2348
- n(e(J), {
2348
+ s(e(J), {
2349
2349
  type: "primary",
2350
2350
  "native-type": "submit",
2351
- form: e(s),
2352
- disabled: i.value.trim() === ""
2351
+ form: e(u),
2352
+ disabled: a.value.trim() === ""
2353
2353
  }, {
2354
- default: l(() => [
2355
- w(b(e(t)("editor.save")), 1)
2354
+ default: i(() => [
2355
+ z(T(e(t)("editor.save")), 1)
2356
2356
  ]),
2357
2357
  _: 1
2358
2358
  }, 8, ["form", "disabled"])
@@ -2360,89 +2360,89 @@ const Pt = { class: "wx-article-editor__screen" }, Dt = 1200, It = /* @__PURE__
2360
2360
  _: 1
2361
2361
  })
2362
2362
  ]),
2363
- default: l(() => [
2364
- j("form", {
2365
- id: e(s),
2363
+ default: i(() => [
2364
+ H("form", {
2365
+ id: e(u),
2366
2366
  ref_key: "field",
2367
2367
  ref: x,
2368
- onSubmit: at(T, ["prevent"])
2368
+ onSubmit: tt(b, ["prevent"])
2369
2369
  }, [
2370
- n(e(ie), {
2371
- label: e(a)("tag.field-title"),
2370
+ s(e(ie), {
2371
+ label: e(l)("tag.field-title"),
2372
2372
  required: ""
2373
2373
  }, {
2374
- default: l(() => [
2375
- n(e(Ae), {
2376
- modelValue: i.value,
2377
- "onUpdate:modelValue": o[0] || (o[0] = (_) => i.value = _),
2378
- "aria-label": e(a)("tag.field-title"),
2379
- onKeydown: ze(at(T, ["prevent"]), ["enter"])
2374
+ default: i(() => [
2375
+ s(e(Ve), {
2376
+ modelValue: a.value,
2377
+ "onUpdate:modelValue": f[0] || (f[0] = (v) => a.value = v),
2378
+ "aria-label": e(l)("tag.field-title"),
2379
+ onKeydown: qe(tt(b, ["prevent"]), ["enter"])
2380
2380
  }, null, 8, ["modelValue", "aria-label", "onKeydown"])
2381
2381
  ]),
2382
2382
  _: 1
2383
2383
  }, 8, ["label"])
2384
- ], 40, Ra)
2384
+ ], 40, Ma)
2385
2385
  ]),
2386
2386
  _: 1
2387
2387
  }, 8, ["open", "title"]));
2388
2388
  }
2389
- }), qa = { class: "wx-tag-merge" }, Ma = { class: "wx-tag-merge__chips" }, Na = { class: "wx-tag-merge__redirect" }, Ba = /* @__PURE__ */ ee({
2389
+ }), Na = { class: "wx-tag-merge" }, Ia = { class: "wx-tag-merge__chips" }, Pa = { class: "wx-tag-merge__redirect" }, Ba = /* @__PURE__ */ X({
2390
2390
  __name: "TagMergeDialog",
2391
2391
  props: {
2392
2392
  tags: {}
2393
2393
  },
2394
- setup(f) {
2395
- const m = f, { open: r, resolve: y, dismiss: u } = Ee(), a = ne(), t = de(a);
2396
- te();
2397
- const s = Q("webx-blog"), i = ge(), x = z(
2398
- [...m.tags].sort((U, R) => R.articles_count - U.articles_count)[0]?.id ?? 0
2399
- ), T = z(!1), c = z(!0), o = z(null), _ = v(
2400
- () => m.tags.map((U) => ({ value: U.id, label: `${U.title} · ${U.articles_count}` }))
2401
- ), W = v(() => m.tags.find((U) => U.id === x.value) ?? null), S = v(() => m.tags.filter((U) => U.id !== x.value)), E = v(() => S.value.reduce((U, R) => U + R.articles_count, 0)), F = v(() => S.value.map((U) => U.path).filter(Boolean));
2394
+ setup(g) {
2395
+ const o = g, { open: c, resolve: w, dismiss: n } = Re(), l = ne(), t = re(l);
2396
+ Y();
2397
+ const u = Q("webx-blog"), a = pe(), x = U(
2398
+ [...o.tags].sort((C, q) => q.articles_count - C.articles_count)[0]?.id ?? 0
2399
+ ), b = U(!1), d = U(!0), f = U(null), v = p(
2400
+ () => o.tags.map((C) => ({ value: C.id, label: `${C.title} · ${C.articles_count}` }))
2401
+ ), S = p(() => o.tags.find((C) => C.id === x.value) ?? null), W = p(() => o.tags.filter((C) => C.id !== x.value)), O = p(() => W.value.reduce((C, q) => C + q.articles_count, 0)), L = p(() => W.value.map((C) => C.path).filter(Boolean));
2402
2402
  async function $() {
2403
- if (!(W.value === null || S.value.length === 0 || T.value)) {
2404
- T.value = !0, o.value = null;
2403
+ if (!(S.value === null || W.value.length === 0 || b.value)) {
2404
+ b.value = !0, f.value = null;
2405
2405
  try {
2406
- y(
2406
+ w(
2407
2407
  await t.mergeTags(
2408
- S.value.map((U) => U.id),
2408
+ W.value.map((C) => C.id),
2409
2409
  x.value,
2410
- c.value
2410
+ d.value
2411
2411
  )
2412
2412
  );
2413
- } catch (U) {
2414
- o.value = i(U);
2413
+ } catch (C) {
2414
+ f.value = a(C);
2415
2415
  } finally {
2416
- T.value = !1;
2416
+ b.value = !1;
2417
2417
  }
2418
2418
  }
2419
2419
  }
2420
- return (U, R) => (p(), C(e(Fe), {
2421
- open: e(r),
2422
- "onUpdate:open": R[3] || (R[3] = (M) => Ie(r) ? r.value = M : null),
2423
- title: e(s)("tag.merge-title"),
2420
+ return (C, q) => (h(), M(e(Me), {
2421
+ open: e(c),
2422
+ "onUpdate:open": q[3] || (q[3] = (N) => Ue(c) ? c.value = N : null),
2423
+ title: e(u)("tag.merge-title"),
2424
2424
  width: 520
2425
2425
  }, {
2426
- footer: l(() => [
2427
- n(e(Le), { size: "sm" }, {
2428
- default: l(() => [
2429
- n(e(J), {
2426
+ footer: i(() => [
2427
+ s(e(Oe), { size: "sm" }, {
2428
+ default: i(() => [
2429
+ s(e(J), {
2430
2430
  variant: "outline",
2431
- onClick: R[2] || (R[2] = (M) => e(u)())
2431
+ onClick: q[2] || (q[2] = (N) => e(n)())
2432
2432
  }, {
2433
- default: l(() => [
2434
- w(b(e(s)("tag.cancel")), 1)
2433
+ default: i(() => [
2434
+ z(T(e(u)("tag.cancel")), 1)
2435
2435
  ]),
2436
2436
  _: 1
2437
2437
  }),
2438
- n(e(J), {
2438
+ s(e(J), {
2439
2439
  type: "primary",
2440
- loading: T.value,
2441
- disabled: S.value.length === 0,
2440
+ loading: b.value,
2441
+ disabled: W.value.length === 0,
2442
2442
  onClick: $
2443
2443
  }, {
2444
- default: l(() => [
2445
- w(b(e(s)("tag.merge-confirm")), 1)
2444
+ default: i(() => [
2445
+ z(T(e(u)("tag.merge-confirm")), 1)
2446
2446
  ]),
2447
2447
  _: 1
2448
2448
  }, 8, ["loading", "disabled"])
@@ -2450,106 +2450,106 @@ const Pt = { class: "wx-article-editor__screen" }, Dt = 1200, It = /* @__PURE__
2450
2450
  _: 1
2451
2451
  })
2452
2452
  ]),
2453
- default: l(() => [
2454
- j("div", qa, [
2455
- j("div", Ma, [
2456
- (p(!0), Z(be, null, Be(S.value, (M) => (p(), C(e(oe), {
2457
- key: M.id,
2453
+ default: i(() => [
2454
+ H("div", Na, [
2455
+ H("div", Ia, [
2456
+ (h(!0), G(_e, null, De(W.value, (N) => (h(), M(e(se), {
2457
+ key: N.id,
2458
2458
  size: "sm",
2459
2459
  round: ""
2460
2460
  }, {
2461
- default: l(() => [
2462
- w(b(M.title) + " · " + b(M.articles_count), 1)
2461
+ default: i(() => [
2462
+ z(T(N.title) + " · " + T(N.articles_count), 1)
2463
2463
  ]),
2464
2464
  _: 2
2465
2465
  }, 1024))), 128)),
2466
- n(e(we), {
2466
+ s(e(Te), {
2467
2467
  name: "arrow-right",
2468
2468
  size: "sm"
2469
2469
  }),
2470
- W.value ? (p(), C(e(oe), {
2470
+ S.value ? (h(), M(e(se), {
2471
2471
  key: 0,
2472
2472
  type: "primary",
2473
2473
  size: "sm",
2474
2474
  round: ""
2475
2475
  }, {
2476
- default: l(() => [
2477
- w(b(W.value.title) + " · " + b(W.value.articles_count), 1)
2476
+ default: i(() => [
2477
+ z(T(S.value.title) + " · " + T(S.value.articles_count), 1)
2478
2478
  ]),
2479
2479
  _: 1
2480
- })) : H("", !0)
2480
+ })) : j("", !0)
2481
2481
  ]),
2482
- n(e(ie), {
2483
- label: e(s)("tag.merge-keep")
2482
+ s(e(ie), {
2483
+ label: e(u)("tag.merge-keep")
2484
2484
  }, {
2485
- default: l(() => [
2486
- n(e(_e), {
2485
+ default: i(() => [
2486
+ s(e(ye), {
2487
2487
  modelValue: x.value,
2488
- "onUpdate:modelValue": R[0] || (R[0] = (M) => x.value = M),
2489
- options: _.value,
2490
- "aria-label": e(s)("tag.merge-keep")
2488
+ "onUpdate:modelValue": q[0] || (q[0] = (N) => x.value = N),
2489
+ options: v.value,
2490
+ "aria-label": e(u)("tag.merge-keep")
2491
2491
  }, null, 8, ["modelValue", "options", "aria-label"])
2492
2492
  ]),
2493
2493
  _: 1
2494
2494
  }, 8, ["label"]),
2495
- j("div", Na, [
2496
- n(e(Wt), {
2497
- modelValue: c.value,
2498
- "onUpdate:modelValue": R[1] || (R[1] = (M) => c.value = M),
2499
- label: e(s)("tag.merge-redirect")
2495
+ H("div", Pa, [
2496
+ s(e(zt), {
2497
+ modelValue: d.value,
2498
+ "onUpdate:modelValue": q[1] || (q[1] = (N) => d.value = N),
2499
+ label: e(u)("tag.merge-redirect")
2500
2500
  }, null, 8, ["modelValue", "label"]),
2501
- n(e(G), {
2501
+ s(e(le), {
2502
2502
  size: "sm",
2503
2503
  tone: "muted"
2504
2504
  }, {
2505
- default: l(() => [
2506
- w(b(F.value.length === 0 ? e(s)("tag.merge-redirect-none") : e(s)("tag.merge-redirect-help", { addresses: F.value.join(", ") })), 1)
2505
+ default: i(() => [
2506
+ z(T(L.value.length === 0 ? e(u)("tag.merge-redirect-none") : e(u)("tag.merge-redirect-help", { addresses: L.value.join(", ") })), 1)
2507
2507
  ]),
2508
2508
  _: 1
2509
2509
  })
2510
2510
  ]),
2511
- n(e(We), {
2511
+ s(e(we), {
2512
2512
  type: "warning",
2513
2513
  variant: "soft",
2514
- description: e(s)("tag.merge-warning", {
2515
- count: E.value,
2516
- tag: W.value?.title ?? "",
2517
- merged: S.value.length
2514
+ description: e(u)("tag.merge-warning", {
2515
+ count: O.value,
2516
+ tag: S.value?.title ?? "",
2517
+ merged: W.value.length
2518
2518
  })
2519
2519
  }, null, 8, ["description"]),
2520
- o.value ? (p(), C(e(We), {
2520
+ f.value ? (h(), M(e(we), {
2521
2521
  key: 0,
2522
2522
  type: "danger",
2523
2523
  variant: "soft",
2524
- description: o.value
2525
- }, null, 8, ["description"])) : H("", !0)
2524
+ description: f.value
2525
+ }, null, 8, ["description"])) : j("", !0)
2526
2526
  ])
2527
2527
  ]),
2528
2528
  _: 1
2529
2529
  }, 8, ["open", "title"]));
2530
2530
  }
2531
- }), Pa = /* @__PURE__ */ ve(Ba, [["__scopeId", "data-v-aa68b3a8"]]), Da = { class: "wx-tags" }, Ia = /* @__PURE__ */ ee({
2531
+ }), Da = /* @__PURE__ */ ce(Ba, [["__scopeId", "data-v-aa68b3a8"]]), Ea = { class: "wx-tags" }, Oa = /* @__PURE__ */ X({
2532
2532
  __name: "TagsPage",
2533
2533
  props: {
2534
2534
  base: { default: "/blog" }
2535
2535
  },
2536
- setup(f) {
2537
- const m = f, r = ne(), y = de(r), u = He(), a = Ke();
2538
- te();
2539
- const t = Q("webx-blog"), s = ge(), i = z(null), x = z(!0), T = z([]), c = z(!1), o = Ce(Ua), _ = Ce(za), W = Ce(Pa), S = v(() => r.can("blog.taxonomy.manage")), E = v(
2540
- () => r.state.manifest?.modules.find((g) => g.id === "tags")?.title ?? t("module.tags")
2541
- ), F = v({
2542
- get: () => typeof u.query.view == "string" ? u.query.view : "",
2543
- set: (g) => {
2544
- a.replace({
2545
- query: { ...u.query, view: g === "" ? void 0 : String(g), page: void 0 }
2536
+ setup(g) {
2537
+ const o = g, c = ne(), w = re(c), n = Le(), l = Fe();
2538
+ Y();
2539
+ const t = Q("webx-blog"), u = pe(), a = U(null), x = U(!0), b = U([]), d = U(!1), f = Ce(qa), v = Ce(Ra), S = Ce(Da), W = p(() => c.can("blog.taxonomy.manage")), O = p(
2540
+ () => c.state.manifest?.modules.find((m) => m.id === "tags")?.title ?? t("module.tags")
2541
+ ), L = p({
2542
+ get: () => typeof n.query.view == "string" ? n.query.view : "",
2543
+ set: (m) => {
2544
+ l.replace({
2545
+ query: { ...n.query, view: m === "" ? void 0 : String(m), page: void 0 }
2546
2546
  });
2547
2547
  }
2548
- }), $ = v(() => i.value?.filters ?? { total: 0, empty: 0, noindex: 0 }), U = v(() => [
2548
+ }), $ = p(() => a.value?.filters ?? { total: 0, empty: 0, noindex: 0 }), C = p(() => [
2549
2549
  { value: "", label: t("tag.view-all"), badge: $.value.total },
2550
2550
  { value: "empty", label: t("tag.view-empty"), badge: $.value.empty },
2551
2551
  { value: "noindex", label: t("tag.view-noindex"), badge: $.value.noindex }
2552
- ]), R = v(() => i.value?.data ?? []), M = v(() => R.value.filter((g) => T.value.includes(g.id))), A = v(() => [
2552
+ ]), q = p(() => a.value?.data ?? []), N = p(() => q.value.filter((m) => b.value.includes(m.id))), A = p(() => [
2553
2553
  { key: "title", label: t("tag.column-title"), minWidth: 150, sortable: !0 },
2554
2554
  // The number is what the other columns and the narrowest the title may be add up to without
2555
2555
  // this one: below it the address is what does not fit, and a fixed table does not shrink —
@@ -2567,106 +2567,106 @@ const Pt = { class: "wx-article-editor__screen" }, Dt = 1200, It = /* @__PURE__
2567
2567
  // at 180px of text, and a cell keeps 32 of its own. Narrower, the ruled row wrapped and
2568
2568
  // stood eighteen pixels taller than the ones around it.
2569
2569
  { key: "indexing", label: t("tag.column-indexing"), width: 230, hideBelow: 560 },
2570
- { key: "actions", label: "", width: st, align: "right" }
2570
+ { key: "actions", label: "", width: nt, align: "right" }
2571
2571
  ]);
2572
- function I(g) {
2572
+ function E(m) {
2573
2573
  return {
2574
- q: g?.search ?? (typeof u.query.q == "string" ? u.query.q : ""),
2575
- empty: F.value === "empty",
2576
- noindex: F.value === "noindex",
2574
+ q: m?.search ?? (typeof n.query.q == "string" ? n.query.q : ""),
2575
+ empty: L.value === "empty",
2576
+ noindex: L.value === "noindex",
2577
2577
  // Only when it is not the default: most used first is what the list is, and a query
2578
2578
  // string that repeats the default is a link that outlives a change of mind about it.
2579
- sort: P(g),
2580
- page: g?.page ?? (Number(u.query.page ?? 1) || 1),
2581
- per_page: g?.perPage
2579
+ sort: K(m),
2580
+ page: m?.page ?? (Number(n.query.page ?? 1) || 1),
2581
+ per_page: m?.perPage
2582
2582
  };
2583
2583
  }
2584
- async function K(g) {
2584
+ async function y(m) {
2585
2585
  x.value = !0;
2586
2586
  try {
2587
- i.value = await y.tagsPage(I(g));
2588
- } catch (N) {
2589
- L.danger(s(N));
2587
+ a.value = await w.tagsPage(E(m));
2588
+ } catch (R) {
2589
+ F.danger(u(R));
2590
2590
  } finally {
2591
2591
  x.value = !1;
2592
2592
  }
2593
2593
  }
2594
- function P(g) {
2595
- const N = g?.sort ?? q();
2596
- if (!N) return;
2597
- const B = N.key === "title" ? "name" : "articles", X = `${N.order === "desc" ? "-" : ""}${B}`;
2598
- return X === "articles" ? void 0 : X;
2599
- }
2600
- function q() {
2601
- const g = typeof u.query.sort == "string" ? u.query.sort : "";
2602
- if (g === "") return null;
2603
- const N = g.startsWith("-");
2604
- return { key: (N ? g.slice(1) : g) === "name" ? "title" : "articles_count", order: N ? "desc" : "asc" };
2605
- }
2606
- function k(g) {
2607
- const N = {
2608
- ...u.query,
2609
- q: g.search === "" ? void 0 : g.search,
2610
- sort: P(g),
2611
- page: g.page === 1 ? void 0 : String(g.page)
2594
+ function K(m) {
2595
+ const R = m?.sort ?? k();
2596
+ if (!R) return;
2597
+ const I = R.key === "title" ? "name" : "articles", ee = `${R.order === "desc" ? "-" : ""}${I}`;
2598
+ return ee === "articles" ? void 0 : ee;
2599
+ }
2600
+ function k() {
2601
+ const m = typeof n.query.sort == "string" ? n.query.sort : "";
2602
+ if (m === "") return null;
2603
+ const R = m.startsWith("-");
2604
+ return { key: (R ? m.slice(1) : m) === "name" ? "title" : "articles_count", order: R ? "desc" : "asc" };
2605
+ }
2606
+ function P(m) {
2607
+ const R = {
2608
+ ...n.query,
2609
+ q: m.search === "" ? void 0 : m.search,
2610
+ sort: K(m),
2611
+ page: m.page === 1 ? void 0 : String(m.page)
2612
2612
  };
2613
- a.replace({ query: N }), K(g);
2613
+ l.replace({ query: R }), y(m);
2614
2614
  }
2615
- ue(F, () => {
2616
- T.value = [], K();
2617
- }), K();
2618
- async function le() {
2619
- await _({}) && await K();
2615
+ ue(L, () => {
2616
+ b.value = [], y();
2617
+ }), y();
2618
+ async function B() {
2619
+ await v({}) && await y();
2620
2620
  }
2621
- async function O(g) {
2622
- const N = await o({ name: g.title });
2623
- N && await xe(g, { title: N }, t("tag.renamed"));
2621
+ async function Z(m) {
2622
+ const R = await f({ name: m.title });
2623
+ R && await xe(m, { title: R }, t("tag.renamed"));
2624
2624
  }
2625
- async function se(g, N) {
2626
- await xe(g, { noindex: N }, t(N ? "tag.kept-out" : "tag.indexed"));
2625
+ async function be(m, R) {
2626
+ await xe(m, { noindex: R }, t(R ? "tag.kept-out" : "tag.indexed"));
2627
2627
  }
2628
- async function xe(g, N, B) {
2628
+ async function xe(m, R, I) {
2629
2629
  try {
2630
- const X = await y.saveTag(g.id, N);
2631
- i.value && (i.value = {
2632
- ...i.value,
2633
- data: i.value.data.map((ye) => ye.id === X.id ? X : ye)
2634
- }), L.success(B);
2635
- } catch (X) {
2636
- L.danger(s(X));
2630
+ const ee = await w.saveTag(m.id, R);
2631
+ a.value && (a.value = {
2632
+ ...a.value,
2633
+ data: a.value.data.map((he) => he.id === ee.id ? ee : he)
2634
+ }), F.success(I);
2635
+ } catch (ee) {
2636
+ F.danger(u(ee));
2637
2637
  }
2638
2638
  }
2639
- async function ce(g) {
2640
- if (await me({
2641
- title: t("tag.delete-title", { title: g.title }),
2642
- message: g.articles_count > 0 ? t("tag.delete-text-used", { count: g.articles_count }) : t("tag.delete-text"),
2639
+ async function de(m) {
2640
+ if (await ve({
2641
+ title: t("tag.delete-title", { title: m.title }),
2642
+ message: m.articles_count > 0 ? t("tag.delete-text-used", { count: m.articles_count }) : t("tag.delete-text"),
2643
2643
  confirmText: t("tag.delete"),
2644
2644
  cancelText: t("tag.cancel"),
2645
2645
  tone: "danger"
2646
2646
  }))
2647
2647
  try {
2648
- await y.removeTag(g.id), L.success(t("tag.deleted")), T.value = T.value.filter((B) => B !== g.id), await K();
2649
- } catch (B) {
2650
- L.danger(s(B));
2648
+ await w.removeTag(m.id), F.success(t("tag.deleted")), b.value = b.value.filter((I) => I !== m.id), await y();
2649
+ } catch (I) {
2650
+ F.danger(u(I));
2651
2651
  }
2652
2652
  }
2653
- const he = v(() => [
2653
+ const me = p(() => [
2654
2654
  {
2655
2655
  key: "index",
2656
2656
  icon: "eye",
2657
2657
  label: t("tag.index"),
2658
- disabled: c.value,
2658
+ disabled: d.value,
2659
2659
  run: () => {
2660
- re("index");
2660
+ oe("index");
2661
2661
  }
2662
2662
  },
2663
2663
  {
2664
2664
  key: "noindex",
2665
2665
  icon: "eye-off",
2666
2666
  label: t("tag.noindex"),
2667
- disabled: c.value,
2667
+ disabled: d.value,
2668
2668
  run: () => {
2669
- re("noindex");
2669
+ oe("noindex");
2670
2670
  }
2671
2671
  },
2672
2672
  {
@@ -2674,109 +2674,109 @@ const Pt = { class: "wx-article-editor__screen" }, Dt = 1200, It = /* @__PURE__
2674
2674
  icon: "trash",
2675
2675
  label: t("tag.delete"),
2676
2676
  danger: !0,
2677
- disabled: c.value,
2677
+ disabled: d.value,
2678
2678
  run: () => {
2679
- re("delete");
2679
+ oe("delete");
2680
2680
  }
2681
2681
  }
2682
2682
  ]);
2683
- function Te(g) {
2684
- if (!S.value) return [];
2685
- const N = [
2683
+ function We(m) {
2684
+ if (!W.value) return [];
2685
+ const R = [
2686
2686
  { key: "rename", icon: "edit", label: t("tag.rename"), run: () => {
2687
- O(g);
2687
+ Z(m);
2688
2688
  } }
2689
2689
  ];
2690
- return g.url && N.push({
2690
+ return m.url && R.push({
2691
2691
  key: "site",
2692
2692
  icon: "external-link",
2693
2693
  label: t("tag.open-on-site"),
2694
- href: g.url
2695
- }), N.push({
2694
+ href: m.url
2695
+ }), R.push({
2696
2696
  key: "articles",
2697
2697
  icon: "list",
2698
2698
  label: t("tag.show-articles"),
2699
2699
  run: () => {
2700
- a.push({ path: `${m.base}/articles`, query: { tag: String(g.id) } });
2700
+ l.push({ path: `${o.base}/articles`, query: { tag: String(m.id) } });
2701
2701
  }
2702
- }), N.push(
2703
- g.noindex ? {
2702
+ }), R.push(
2703
+ m.noindex ? {
2704
2704
  key: "index",
2705
2705
  icon: "eye",
2706
2706
  label: t("tag.index"),
2707
2707
  run: () => {
2708
- se(g, !1);
2708
+ be(m, !1);
2709
2709
  }
2710
2710
  } : {
2711
2711
  key: "noindex",
2712
2712
  icon: "eye-off",
2713
2713
  label: t("tag.noindex"),
2714
2714
  run: () => {
2715
- se(g, !0);
2715
+ be(m, !0);
2716
2716
  }
2717
2717
  }
2718
- ), N.push({
2718
+ ), R.push({
2719
2719
  key: "delete",
2720
2720
  icon: "trash",
2721
2721
  label: t("tag.delete"),
2722
2722
  danger: !0,
2723
2723
  run: () => {
2724
- ce(g);
2724
+ de(m);
2725
2725
  }
2726
- }), N;
2727
- }
2728
- function ke(g) {
2729
- return g === "noindex" ? "muted" : "success";
2730
- }
2731
- async function pe() {
2732
- if (M.value.length < 2) return;
2733
- const g = await W({ tags: M.value });
2734
- g && (L.success(t("tag.merged", { tag: g.tag.title, count: g.articles_count })), T.value = [], await K());
2735
- }
2736
- async function re(g) {
2737
- const N = M.value.map((B) => B.id);
2738
- if (!(N.length === 0 || c.value)) {
2739
- if (g === "delete") {
2740
- const B = M.value.reduce((ye, d) => ye + d.articles_count, 0);
2741
- if (!await me({
2742
- title: t("tag.delete-many-title", { count: N.length }),
2743
- message: B > 0 ? t("tag.delete-many-text-used", { count: B }) : t("tag.delete-many-text"),
2726
+ }), R;
2727
+ }
2728
+ function ke(m) {
2729
+ return m === "noindex" ? "muted" : "success";
2730
+ }
2731
+ async function fe() {
2732
+ if (N.value.length < 2) return;
2733
+ const m = await S({ tags: N.value });
2734
+ m && (F.success(t("tag.merged", { tag: m.tag.title, count: m.articles_count })), b.value = [], await y());
2735
+ }
2736
+ async function oe(m) {
2737
+ const R = N.value.map((I) => I.id);
2738
+ if (!(R.length === 0 || d.value)) {
2739
+ if (m === "delete") {
2740
+ const I = N.value.reduce((he, r) => he + r.articles_count, 0);
2741
+ if (!await ve({
2742
+ title: t("tag.delete-many-title", { count: R.length }),
2743
+ message: I > 0 ? t("tag.delete-many-text-used", { count: I }) : t("tag.delete-many-text"),
2744
2744
  confirmText: t("tag.delete"),
2745
2745
  cancelText: t("tag.cancel"),
2746
2746
  tone: "danger"
2747
2747
  })) return;
2748
2748
  }
2749
- c.value = !0;
2749
+ d.value = !0;
2750
2750
  try {
2751
- const B = await y.massTags(N, g);
2752
- L.success(
2753
- g === "delete" ? t("tag.deleted-many", { count: B }) : g === "index" ? t("tag.indexed-many", { count: B }) : t("tag.kept-out-many", { count: B })
2754
- ), T.value = [], await K();
2755
- } catch (B) {
2756
- L.danger(s(B));
2751
+ const I = await w.massTags(R, m);
2752
+ F.success(
2753
+ m === "delete" ? t("tag.deleted-many", { count: I }) : m === "index" ? t("tag.indexed-many", { count: I }) : t("tag.kept-out-many", { count: I })
2754
+ ), b.value = [], await y();
2755
+ } catch (I) {
2756
+ F.danger(u(I));
2757
2757
  } finally {
2758
- c.value = !1;
2758
+ d.value = !1;
2759
2759
  }
2760
2760
  }
2761
2761
  }
2762
- const fe = v(
2763
- () => S.value ? [{ key: "new", label: t("tag.new"), icon: "plus", primary: !0, run: () => {
2764
- le();
2762
+ const ge = p(
2763
+ () => W.value ? [{ key: "new", label: t("tag.new"), icon: "plus", primary: !0, run: () => {
2764
+ B();
2765
2765
  } }] : []
2766
2766
  );
2767
- return (g, N) => (p(), Z("div", Da, [
2768
- n(e(Qe), {
2769
- view: F.value,
2770
- "onUpdate:view": N[1] || (N[1] = (B) => F.value = B),
2771
- title: E.value,
2772
- views: U.value,
2773
- actions: fe.value
2767
+ return (m, R) => (h(), G("div", Ea, [
2768
+ s(e(Ze), {
2769
+ view: L.value,
2770
+ "onUpdate:view": R[1] || (R[1] = (I) => L.value = I),
2771
+ title: O.value,
2772
+ views: C.value,
2773
+ actions: ge.value
2774
2774
  }, {
2775
- default: l(() => [
2776
- n(e(ot), {
2777
- selected: T.value,
2778
- "onUpdate:selected": N[0] || (N[0] = (B) => T.value = B),
2779
- data: i.value,
2775
+ default: i(() => [
2776
+ s(e(ut), {
2777
+ selected: b.value,
2778
+ "onUpdate:selected": R[0] || (R[0] = (I) => b.value = I),
2779
+ data: a.value,
2780
2780
  columns: A.value,
2781
2781
  "row-key": "id",
2782
2782
  searchable: "",
@@ -2784,76 +2784,76 @@ const Pt = { class: "wx-article-editor__screen" }, Dt = 1200, It = /* @__PURE__
2784
2784
  flush: "",
2785
2785
  layout: "fixed",
2786
2786
  loading: x.value,
2787
- selectable: S.value,
2787
+ selectable: W.value,
2788
2788
  "cards-below": 0,
2789
2789
  "search-placeholder": e(t)("tag.search"),
2790
- "empty-text": R.value.length === 0 && !x.value ? e(t)("tag.empty") : void 0,
2791
- "aria-label": E.value,
2792
- onStateChange: k
2790
+ "empty-text": q.value.length === 0 && !x.value ? e(t)("tag.empty") : void 0,
2791
+ "aria-label": O.value,
2792
+ onStateChange: P
2793
2793
  }, {
2794
- "cell-title": l(({ row: B }) => [
2795
- n(e(G), { truncate: "" }, {
2796
- default: l(() => [
2797
- w(b(B.title), 1)
2794
+ "cell-title": i(({ row: I }) => [
2795
+ s(e(le), { truncate: "" }, {
2796
+ default: i(() => [
2797
+ z(T(I.title), 1)
2798
2798
  ]),
2799
2799
  _: 2
2800
2800
  }, 1024)
2801
2801
  ]),
2802
- "cell-path": l(({ row: B }) => [
2803
- n(e(G), {
2802
+ "cell-path": i(({ row: I }) => [
2803
+ s(e(le), {
2804
2804
  size: "sm",
2805
2805
  tone: "muted",
2806
2806
  mono: "",
2807
2807
  truncate: ""
2808
2808
  }, {
2809
- default: l(() => [
2810
- w(b(B.path ?? e(t)("tag.no-address")), 1)
2809
+ default: i(() => [
2810
+ z(T(I.path ?? e(t)("tag.no-address")), 1)
2811
2811
  ]),
2812
2812
  _: 2
2813
2813
  }, 1024)
2814
2814
  ]),
2815
- "cell-articles_count": l(({ row: B }) => [
2816
- n(e(G), {
2817
- tone: B.articles_count === 0 ? "muted" : "default"
2815
+ "cell-articles_count": i(({ row: I }) => [
2816
+ s(e(le), {
2817
+ tone: I.articles_count === 0 ? "muted" : "default"
2818
2818
  }, {
2819
- default: l(() => [
2820
- w(b(B.articles_count), 1)
2819
+ default: i(() => [
2820
+ z(T(I.articles_count), 1)
2821
2821
  ]),
2822
2822
  _: 2
2823
2823
  }, 1032, ["tone"])
2824
2824
  ]),
2825
- "cell-indexing": l(({ row: B }) => [
2826
- B.indexing === "rule" ? (p(), C(e(et), {
2825
+ "cell-indexing": i(({ row: I }) => [
2826
+ I.indexing === "rule" ? (h(), M(e(Ye), {
2827
2827
  key: 0,
2828
2828
  content: e(t)("tag.indexing-rule-help")
2829
2829
  }, {
2830
- default: l(() => [
2831
- n(e(G), {
2830
+ default: i(() => [
2831
+ s(e(le), {
2832
2832
  size: "sm",
2833
- tone: ke(B.indexing)
2833
+ tone: ke(I.indexing)
2834
2834
  }, {
2835
- default: l(() => [
2836
- w(b(e(t)("tag.indexing-rule")), 1)
2835
+ default: i(() => [
2836
+ z(T(e(t)("tag.indexing-rule")), 1)
2837
2837
  ]),
2838
2838
  _: 1
2839
2839
  }, 8, ["tone"])
2840
2840
  ]),
2841
2841
  _: 2
2842
- }, 1032, ["content"])) : (p(), C(e(G), {
2842
+ }, 1032, ["content"])) : (h(), M(e(le), {
2843
2843
  key: 1,
2844
2844
  size: "sm",
2845
- tone: ke(B.indexing)
2845
+ tone: ke(I.indexing)
2846
2846
  }, {
2847
- default: l(() => [
2848
- w(b(e(t)(`tag.indexing-${B.indexing}`)), 1)
2847
+ default: i(() => [
2848
+ z(T(e(t)(`tag.indexing-${I.indexing}`)), 1)
2849
2849
  ]),
2850
2850
  _: 2
2851
2851
  }, 1032, ["tone"]))
2852
2852
  ]),
2853
- "cell-actions": l(({ row: B }) => [
2854
- n(e(Re), {
2855
- actions: Te(B),
2856
- label: B.title
2853
+ "cell-actions": i(({ row: I }) => [
2854
+ s(e(ze), {
2855
+ actions: We(I),
2856
+ label: I.title
2857
2857
  }, null, 8, ["actions", "label"])
2858
2858
  ]),
2859
2859
  _: 1
@@ -2861,64 +2861,64 @@ const Pt = { class: "wx-article-editor__screen" }, Dt = 1200, It = /* @__PURE__
2861
2861
  ]),
2862
2862
  _: 1
2863
2863
  }, 8, ["view", "title", "views", "actions"]),
2864
- M.value.length > 0 ? (p(), C(e(rt), {
2864
+ N.value.length > 0 ? (h(), M(e(st), {
2865
2865
  key: 0,
2866
2866
  class: "wx-tags__bar",
2867
2867
  sticky: ""
2868
2868
  }, {
2869
- state: l(() => [
2870
- n(e(G), { weight: "medium" }, {
2871
- default: l(() => [
2872
- w(b(e(t)("tag.selected", { count: M.value.length })), 1)
2869
+ state: i(() => [
2870
+ s(e(le), { weight: "medium" }, {
2871
+ default: i(() => [
2872
+ z(T(e(t)("tag.selected", { count: N.value.length })), 1)
2873
2873
  ]),
2874
2874
  _: 1
2875
2875
  })
2876
2876
  ]),
2877
- default: l(() => [
2878
- n(e(J), {
2877
+ default: i(() => [
2878
+ s(e(J), {
2879
2879
  type: "primary",
2880
- disabled: M.value.length < 2 || c.value,
2881
- onClick: pe
2880
+ disabled: N.value.length < 2 || d.value,
2881
+ onClick: fe
2882
2882
  }, {
2883
- icon: l(() => [
2884
- n(e(we), { name: "link" })
2883
+ icon: i(() => [
2884
+ s(e(Te), { name: "link" })
2885
2885
  ]),
2886
- default: l(() => [
2887
- w(" " + b(e(t)("tag.merge")), 1)
2886
+ default: i(() => [
2887
+ z(" " + T(e(t)("tag.merge")), 1)
2888
2888
  ]),
2889
2889
  _: 1
2890
2890
  }, 8, ["disabled"]),
2891
- n(e(Re), {
2891
+ s(e(ze), {
2892
2892
  size: "lg",
2893
- actions: he.value,
2894
- label: e(t)("tag.selected", { count: M.value.length })
2893
+ actions: me.value,
2894
+ label: e(t)("tag.selected", { count: N.value.length })
2895
2895
  }, null, 8, ["actions", "label"])
2896
2896
  ]),
2897
2897
  _: 1
2898
- })) : H("", !0)
2898
+ })) : j("", !0)
2899
2899
  ]));
2900
2900
  }
2901
- }), Oa = /* @__PURE__ */ ve(Ia, [["__scopeId", "data-v-beb86d88"]]);
2902
- function ja(f = {}) {
2903
- const m = f.path ?? "/blog";
2901
+ }), La = /* @__PURE__ */ ce(Oa, [["__scopeId", "data-v-beb86d88"]]);
2902
+ function Ja(g = {}) {
2903
+ const o = g.path ?? "/blog";
2904
2904
  return [
2905
2905
  {
2906
2906
  id: "articles",
2907
- path: `${m}/articles`,
2907
+ path: `${o}/articles`,
2908
2908
  routes: [
2909
2909
  // The section's own path travels as a prop, so a panel that mounted the blog somewhere
2910
2910
  // else still links between its screens correctly.
2911
2911
  {
2912
- path: `${m}/articles`,
2912
+ path: `${o}/articles`,
2913
2913
  name: "webx.blog.articles",
2914
- component: ha,
2915
- props: { base: m }
2914
+ component: ka,
2915
+ props: { base: o }
2916
2916
  },
2917
2917
  {
2918
- path: `${m}/articles/:id(\\d+)`,
2918
+ path: `${o}/articles/:id(\\d+)`,
2919
2919
  name: "webx.blog.articles.edit",
2920
- component: Ot,
2921
- props: { base: m }
2920
+ component: Dt,
2921
+ props: { base: o }
2922
2922
  }
2923
2923
  ],
2924
2924
  /*
@@ -2930,62 +2930,68 @@ function ja(f = {}) {
2930
2930
  * box that makes a tag — and two only draw. Each reads the article from the editor above
2931
2931
  * it rather than from the description, because a screen is a description and not a
2932
2932
  * binding.
2933
+ *
2934
+ * The slug is here for a different reason: what it edits is an ordinary string, but the
2935
+ * whole address is the prefix of the blog and that string, and the prefix is not in the
2936
+ * description — it is configuration the editor was handed with the record.
2933
2937
  */
2934
2938
  types: {
2935
- "wx-article-address": { component: Nt, kind: "display" },
2936
- "wx-article-author": { component: Bt, kind: "field" },
2937
- "wx-article-rubrics": { component: aa, kind: "field" },
2938
- "wx-article-tags": { component: oa, kind: "field" },
2939
- "wx-article-related": { component: Xt, kind: "field" },
2939
+ "wx-article-slug": { component: na, kind: "field" },
2940
+ "wx-article-author": { component: Nt, kind: "field" },
2941
+ "wx-article-rubrics": { component: ta, kind: "field" },
2942
+ "wx-article-tags": { component: da, kind: "field" },
2943
+ "wx-article-related": { component: Qt, kind: "field" },
2944
+ "wx-article-unpublish": { component: pa, kind: "display" },
2940
2945
  "wx-article-history": { component: Kt, kind: "display" }
2941
2946
  }
2942
2947
  },
2943
2948
  {
2944
2949
  id: "rubrics",
2945
- path: `${m}/rubrics`,
2950
+ path: `${o}/rubrics`,
2946
2951
  routes: [
2947
2952
  {
2948
- path: `${m}/rubrics`,
2953
+ path: `${o}/rubrics`,
2949
2954
  name: "webx.blog.rubrics",
2950
- component: Ca,
2951
- props: { base: m }
2955
+ component: Ua,
2956
+ props: { base: o }
2952
2957
  }
2953
2958
  ]
2954
2959
  },
2955
2960
  {
2956
2961
  id: "tags",
2957
- path: `${m}/tags`,
2962
+ path: `${o}/tags`,
2958
2963
  routes: [
2959
2964
  {
2960
- path: `${m}/tags`,
2965
+ path: `${o}/tags`,
2961
2966
  name: "webx.blog.tags",
2962
- component: Oa,
2963
- props: { base: m }
2967
+ component: La,
2968
+ props: { base: o }
2964
2969
  }
2965
2970
  ]
2966
2971
  }
2967
2972
  ];
2968
2973
  }
2969
2974
  export {
2970
- Nt as WxArticleAddress,
2971
- Bt as WxArticleAuthorField,
2972
- ua as WxArticleCreateDialog,
2973
- Ot as WxArticleEditorPage,
2975
+ Nt as WxArticleAuthorField,
2976
+ fa as WxArticleCreateDialog,
2977
+ Dt as WxArticleEditorPage,
2974
2978
  Kt as WxArticleHistory,
2975
- Xt as WxArticleRelated,
2976
- aa as WxArticleRubrics,
2977
- oa as WxArticleTags,
2978
- ha as WxArticlesPage,
2979
- Aa as WxRubricForm,
2980
- Ca as WxRubricsPage,
2981
- za as WxTagCreateDialog,
2982
- Pa as WxTagMergeDialog,
2983
- Oa as WxTagsPage,
2984
- ut as articleEditorKey,
2985
- ja as blog,
2986
- Ut as blogMessages,
2987
- de as createBlogApi,
2988
- Rt as provideArticleEditor,
2989
- Se as useArticleEditor
2979
+ Qt as WxArticleRelated,
2980
+ ta as WxArticleRubrics,
2981
+ na as WxArticleSlug,
2982
+ da as WxArticleTags,
2983
+ pa as WxArticleUnpublish,
2984
+ ka as WxArticlesPage,
2985
+ Wa as WxRubricDialog,
2986
+ Ua as WxRubricsPage,
2987
+ Ra as WxTagCreateDialog,
2988
+ Da as WxTagMergeDialog,
2989
+ La as WxTagsPage,
2990
+ ct as articleEditorKey,
2991
+ Ja as blog,
2992
+ qt as blogMessages,
2993
+ re as createBlogApi,
2994
+ Mt as provideArticleEditor,
2995
+ Ae as useArticleEditor
2990
2996
  };
2991
2997
  //# sourceMappingURL=index.js.map