@webx-ui/module-blocks 0.8.1 → 0.8.3

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,31 +1,31 @@
1
- import { defineComponent as ae, computed as V, openBlock as u, createElementBlock as C, createVNode as f, unref as l, createElementVNode as B, createTextVNode as z, toDisplayString as S, Fragment as F, createCommentVNode as N, renderList as le, ref as I, onMounted as Ue, watch as te, createBlock as M, withCtx as b, onBeforeUnmount as Qe, normalizeStyle as xe, reactive as nt, normalizeClass as $e, withDirectives as nl, vShow as sl, resolveComponent as Vt, isRef as Bt, nextTick as ol, withKeys as vt, withModifiers as mt, provide as At, inject as Ye, useModel as al, getCurrentInstance as il, resolveDynamicComponent as rl, mergeProps as ul, mergeModels as cl } from "vue";
2
- import { useRoute as dl, useRouter as Lt } from "vue-router";
3
- import { useTranslate as de, useAdmin as Re, useErrorText as je, WxDate as pl, WxScreenHead as fl, WxRenameButton as vl, WxHelpButton as ml, WxRowMenu as hl, adminKey as bl, WxListScreen as gl } from "@webx-ui/module-admin";
4
- import { WxIcon as he, WxSkeleton as Le, WxText as q, WxBadge as ue, WxButton as ce, confirm as Ze, toast as Z, useElementWidth as Xe, WxSegmented as Wt, WxCard as Be, WxPopover as yl, WxAlert as zt, WxTabs as kl, WxTab as Ae, WxCodeEditor as qe, WxFormItem as oe, WxInput as Oe, WxSelect as Dt, WxTextarea as wl, WxIconPicker as _l, WxInputNumber as ht, WxTagsInput as bt, WxSwitch as xl, WxActionBar as $l, useModal as Mt, WxDialog as Nt, WxEmpty as It, WxAction as Ne, WxSortableList as Sl, createModal as Pt, WxDrawer as El, WxSpace as Tl, WxSkeletonItem as Ke } from "@webx-ui/core";
5
- import { WxScreenRenderer as Ot, coreTypes as Je } from "@webx-ui/schema";
6
- import { autocompletion as Cl, snippetCompletion as me, pickedCompletion as ut, startCompletion as Vl } from "@codemirror/autocomplete";
7
- import { EditorState as Bl } from "@codemirror/state";
8
- function ze(e) {
9
- const n = `${e.apiPath}/blocks`, t = (s) => s.data;
1
+ import { defineComponent as ae, computed as V, openBlock as c, createElementBlock as C, createVNode as m, unref as n, createElementVNode as A, createTextVNode as M, toDisplayString as S, Fragment as F, createCommentVNode as D, renderList as le, ref as I, onMounted as Re, watch as te, createBlock as N, withCtx as b, onBeforeUnmount as Xe, normalizeStyle as xe, reactive as st, normalizeClass as $e, withDirectives as al, vShow as il, inject as De, watchEffect as rl, resolveComponent as At, isRef as Lt, nextTick as ul, withKeys as ht, withModifiers as bt, provide as Bt, useModel as cl, getCurrentInstance as dl, resolveDynamicComponent as pl, mergeProps as fl, mergeModels as ml } from "vue";
2
+ import { useRoute as vl, useRouter as Wt } from "vue-router";
3
+ import { useTranslate as de, useAdmin as je, useErrorText as Fe, WxDate as hl, WxScreenHead as bl, WxRenameButton as gl, WxHelpButton as yl, adminKey as Mt, WxRowMenu as kl, WxListScreen as wl } from "@webx-ui/module-admin";
4
+ import { WxIcon as he, WxSkeleton as Be, WxText as q, WxBadge as ue, WxButton as ce, confirm as Qe, toast as Z, useElementWidth as et, WxSegmented as zt, WxCard as Ae, WxPopover as _l, WxAlert as Nt, WxTabs as xl, WxTab as Le, WxCodeEditor as Ke, WxFormItem as oe, WxInput as Ue, WxSelect as Dt, WxTextarea as $l, WxIconPicker as Sl, WxInputNumber as gt, WxTagsInput as yt, WxSwitch as El, WxActionBar as Tl, useModal as It, WxDialog as Pt, WxEmpty as Ot, WxAction as Ie, WxSortableList as Cl, createModal as Ut, WxDrawer as Vl, WxSpace as Al, WxSkeletonItem as Ye } from "@webx-ui/core";
5
+ import { WxScreenRenderer as Rt, coreTypes as Je } from "@webx-ui/schema";
6
+ import { autocompletion as Ll, snippetCompletion as ve, pickedCompletion as dt, startCompletion as Bl } from "@codemirror/autocomplete";
7
+ import { EditorState as Wl } from "@codemirror/state";
8
+ function Me(e) {
9
+ const l = `${e.apiPath}/blocks`, t = (s) => s.data;
10
10
  return {
11
- list: () => e.http.get(n).then(t),
12
- catalog: () => e.http.get(`${n}/catalog`).then(t),
13
- get: (s) => e.http.get(`${n}/${s}`).then(t),
14
- create: (s) => e.http.post(n, s).then(t),
15
- update: (s, a) => e.http.put(`${n}/${s}`, a).then(t),
16
- remove: (s) => e.http.delete(`${n}/${s}`),
17
- publish: (s) => e.http.post(`${n}/${s}/publish`, {}).then(t),
18
- render: (s, a = {}) => e.http.post(`${n}/${s}/render`, a).then(t),
19
- usage: (s) => e.http.get(`${n}/${s}/usage`).then(t),
20
- versions: (s) => e.http.get(`${n}/${s}/versions`).then(t),
21
- version: (s, a) => e.http.get(`${n}/${s}/versions/${a}`).then(t),
22
- restore: (s, a) => e.http.post(`${n}/${s}/versions/${a}/restore`, {}).then(t)
11
+ list: () => e.http.get(l).then(t),
12
+ catalog: () => e.http.get(`${l}/catalog`).then(t),
13
+ get: (s) => e.http.get(`${l}/${s}`).then(t),
14
+ create: (s) => e.http.post(l, s).then(t),
15
+ update: (s, a) => e.http.put(`${l}/${s}`, a).then(t),
16
+ remove: (s) => e.http.delete(`${l}/${s}`),
17
+ publish: (s) => e.http.post(`${l}/${s}/publish`, {}).then(t),
18
+ render: (s, a = {}) => e.http.post(`${l}/${s}/render`, a).then(t),
19
+ usage: (s) => e.http.get(`${l}/${s}/usage`).then(t),
20
+ versions: (s) => e.http.get(`${l}/${s}/versions`).then(t),
21
+ version: (s, a) => e.http.get(`${l}/${s}/versions/${a}`).then(t),
22
+ restore: (s, a) => e.http.post(`${l}/${s}/versions/${a}/restore`, {}).then(t)
23
23
  };
24
24
  }
25
- const Al = { class: "wx-block-checks" }, Ll = {
25
+ const Ml = { class: "wx-block-checks" }, zl = {
26
26
  key: 0,
27
27
  class: "wx-block-checks__line is-error"
28
- }, Wl = /* @__PURE__ */ ae({
28
+ }, Nl = /* @__PURE__ */ ae({
29
29
  __name: "BlockChecks",
30
30
  props: {
31
31
  file: {},
@@ -34,66 +34,66 @@ const Al = { class: "wx-block-checks" }, Ll = {
34
34
  error: {}
35
35
  },
36
36
  setup(e) {
37
- const n = e, t = de("webx-blocks"), s = V(() => n.lints.filter((i) => i.file === n.file)), a = V(() => {
37
+ const l = e, t = de("webx-blocks"), s = V(() => l.lints.filter((i) => i.file === l.file)), a = V(() => {
38
38
  const i = new Set(s.value.map((r) => r.code)), o = [];
39
- return n.file === "template" && (i.has("no-marker") || o.push(t("checks.ok-marker")), i.has("variables-missing") || o.push(t("checks.ok-variables"))), n.file === "styles" && (i.has("stray-selectors") || o.push(t("checks.ok-prefix", { slug: n.slug })), i.has("bare-selectors") || o.push(t("checks.ok-bare")), i.has("media-query") || o.push(t("checks.ok-container"))), o;
39
+ return l.file === "template" && (i.has("no-marker") || o.push(t("checks.ok-marker")), i.has("variables-missing") || o.push(t("checks.ok-variables"))), l.file === "styles" && (i.has("stray-selectors") || o.push(t("checks.ok-prefix", { slug: l.slug })), i.has("bare-selectors") || o.push(t("checks.ok-bare")), i.has("media-query") || o.push(t("checks.ok-container"))), o;
40
40
  });
41
- return (i, o) => (u(), C("div", Al, [
42
- e.error ? (u(), C("div", Ll, [
43
- f(l(he), { name: "close-circle" }),
44
- B("span", null, [
45
- z(S(e.error.message) + " ", 1),
46
- e.error.line !== null ? (u(), C(F, { key: 0 }, [
47
- z(" · " + S(l(t)("page.line", { line: e.error.line })), 1)
48
- ], 64)) : N("", !0),
49
- e.error.where ? (u(), C(F, { key: 1 }, [
50
- z(" · " + S(e.error.where), 1)
51
- ], 64)) : N("", !0)
41
+ return (i, o) => (c(), C("div", Ml, [
42
+ e.error ? (c(), C("div", zl, [
43
+ m(n(he), { name: "close-circle" }),
44
+ A("span", null, [
45
+ M(S(e.error.message) + " ", 1),
46
+ e.error.line !== null ? (c(), C(F, { key: 0 }, [
47
+ M(" · " + S(n(t)("page.line", { line: e.error.line })), 1)
48
+ ], 64)) : D("", !0),
49
+ e.error.where ? (c(), C(F, { key: 1 }, [
50
+ M(" · " + S(e.error.where), 1)
51
+ ], 64)) : D("", !0)
52
52
  ])
53
- ])) : N("", !0),
54
- (u(!0), C(F, null, le(s.value, (r) => (u(), C("div", {
53
+ ])) : D("", !0),
54
+ (c(!0), C(F, null, le(s.value, (r) => (c(), C("div", {
55
55
  key: r.code,
56
56
  class: "wx-block-checks__line is-warning"
57
57
  }, [
58
- f(l(he), { name: "warning" }),
59
- B("span", null, [
60
- z(S(r.message) + " ", 1),
61
- r.line !== null ? (u(), C(F, { key: 0 }, [
62
- z(" · " + S(l(t)("page.line", { line: r.line })), 1)
63
- ], 64)) : N("", !0)
58
+ m(n(he), { name: "warning" }),
59
+ A("span", null, [
60
+ M(S(r.message) + " ", 1),
61
+ r.line !== null ? (c(), C(F, { key: 0 }, [
62
+ M(" · " + S(n(t)("page.line", { line: r.line })), 1)
63
+ ], 64)) : D("", !0)
64
64
  ])
65
65
  ]))), 128)),
66
- (u(!0), C(F, null, le(a.value, (r) => (u(), C("div", {
66
+ (c(!0), C(F, null, le(a.value, (r) => (c(), C("div", {
67
67
  key: r,
68
68
  class: "wx-block-checks__line is-ok"
69
69
  }, [
70
- f(l(he), { name: "check" }),
71
- B("span", null, S(r), 1)
70
+ m(n(he), { name: "check" }),
71
+ A("span", null, S(r), 1)
72
72
  ]))), 128))
73
73
  ]));
74
74
  }
75
- }), ie = (e, n) => {
75
+ }), ie = (e, l) => {
76
76
  const t = e.__vccOpts || e;
77
- for (const [s, a] of n)
77
+ for (const [s, a] of l)
78
78
  t[s] = a;
79
79
  return t;
80
- }, gt = /* @__PURE__ */ ie(Wl, [["__scopeId", "data-v-e56947a8"]]), zl = { class: "wx-block-history" }, Dl = { class: "wx-block-history__number" }, Ml = { class: "wx-block-history__who" }, Nl = /* @__PURE__ */ ae({
80
+ }, kt = /* @__PURE__ */ ie(Nl, [["__scopeId", "data-v-e56947a8"]]), Dl = { class: "wx-block-history" }, Il = { class: "wx-block-history__number" }, Pl = { class: "wx-block-history__who" }, Ol = /* @__PURE__ */ ae({
81
81
  __name: "BlockHistory",
82
82
  props: {
83
83
  block: {},
84
84
  canManage: { type: Boolean }
85
85
  },
86
86
  emits: ["restored"],
87
- setup(e, { emit: n }) {
88
- const t = e, s = n, a = Re(), i = ze(a), o = de("webx-blocks"), r = je(), m = I(null);
89
- async function c() {
90
- m.value = await i.versions(t.block.id);
87
+ setup(e, { emit: l }) {
88
+ const t = e, s = l, a = je(), i = Me(a), o = de("webx-blocks"), r = Fe(), f = I(null);
89
+ async function u() {
90
+ f.value = await i.versions(t.block.id);
91
91
  }
92
92
  function d(v) {
93
93
  return t.block.draft?.number === v.number ? "draft" : t.block.published?.number === v.number ? "live" : "replaced";
94
94
  }
95
95
  async function p(v) {
96
- if (await Ze({
96
+ if (await Qe({
97
97
  title: o("page.restore-title", { number: v.number }),
98
98
  message: o("page.restore-text"),
99
99
  confirmText: o("page.restore"),
@@ -101,85 +101,85 @@ const Al = { class: "wx-block-checks" }, Ll = {
101
101
  }))
102
102
  try {
103
103
  const x = await i.restore(t.block.id, v.number);
104
- Z.success(o("page.restored", { number: x.draft?.number ?? v.number })), s("restored", x), await c();
104
+ Z.success(o("page.restored", { number: x.draft?.number ?? v.number })), s("restored", x), await u();
105
105
  } catch (x) {
106
106
  Z.danger(r(x));
107
107
  }
108
108
  }
109
- return Ue(c), te(
109
+ return Re(u), te(
110
110
  () => [t.block.draft?.number, t.block.published?.number],
111
111
  () => {
112
- c();
112
+ u();
113
113
  }
114
- ), (v, g) => (u(), C("div", zl, [
115
- m.value === null ? (u(), M(l(Le), {
114
+ ), (v, g) => (c(), C("div", Dl, [
115
+ f.value === null ? (c(), N(n(Be), {
116
116
  key: 0,
117
117
  class: "wx-block-history__ghost",
118
118
  rows: 3
119
- })) : (u(!0), C(F, { key: 1 }, le(m.value, (x) => (u(), C("div", {
119
+ })) : (c(!0), C(F, { key: 1 }, le(f.value, (x) => (c(), C("div", {
120
120
  key: x.number,
121
121
  class: "wx-block-history__row"
122
122
  }, [
123
- B("code", Dl, S(l(o)("page.version", { number: x.number })), 1),
124
- B("div", Ml, [
125
- f(l(q), null, {
123
+ A("code", Il, S(n(o)("page.version", { number: x.number })), 1),
124
+ A("div", Pl, [
125
+ m(n(q), null, {
126
126
  default: b(() => [
127
- z(S(l(o)(`page.version-${d(x)}`)), 1)
127
+ M(S(n(o)(`page.version-${d(x)}`)), 1)
128
128
  ]),
129
129
  _: 2
130
130
  }, 1024),
131
- f(l(q), {
131
+ m(n(q), {
132
132
  size: "sm",
133
133
  tone: "muted"
134
134
  }, {
135
135
  default: b(() => [
136
- x.created_at ? (u(), M(l(pl), {
136
+ x.created_at ? (c(), N(n(hl), {
137
137
  key: 0,
138
138
  value: x.created_at
139
- }, null, 8, ["value"])) : N("", !0),
140
- z(" · " + S(x.author ?? l(o)(`page.source-${x.source}`)) + " ", 1),
141
- x.comment ? (u(), C(F, { key: 1 }, [
142
- z(" · " + S(x.comment), 1)
143
- ], 64)) : N("", !0)
139
+ }, null, 8, ["value"])) : D("", !0),
140
+ M(" · " + S(x.author ?? n(o)(`page.source-${x.source}`)) + " ", 1),
141
+ x.comment ? (c(), C(F, { key: 1 }, [
142
+ M(" · " + S(x.comment), 1)
143
+ ], 64)) : D("", !0)
144
144
  ]),
145
145
  _: 2
146
146
  }, 1024)
147
147
  ]),
148
- d(x) === "draft" ? (u(), M(l(ue), {
148
+ d(x) === "draft" ? (c(), N(n(ue), {
149
149
  key: 0,
150
150
  type: "warning",
151
151
  dot: ""
152
152
  }, {
153
153
  default: b(() => [
154
- z(S(l(o)("page.version-draft")), 1)
154
+ M(S(n(o)("page.version-draft")), 1)
155
155
  ]),
156
156
  _: 1
157
- })) : d(x) === "live" ? (u(), M(l(ue), {
157
+ })) : d(x) === "live" ? (c(), N(n(ue), {
158
158
  key: 1,
159
159
  type: "success",
160
160
  dot: ""
161
161
  }, {
162
162
  default: b(() => [
163
- z(S(l(o)("page.version-live")), 1)
163
+ M(S(n(o)("page.version-live")), 1)
164
164
  ]),
165
165
  _: 1
166
- })) : N("", !0),
167
- e.canManage && d(x) === "replaced" ? (u(), M(l(ce), {
166
+ })) : D("", !0),
167
+ e.canManage && d(x) === "replaced" ? (c(), N(n(ce), {
168
168
  key: 2,
169
169
  size: "sm",
170
170
  variant: "outline",
171
171
  onClick: (T) => p(x)
172
172
  }, {
173
173
  default: b(() => [
174
- z(S(l(o)("page.restore")), 1)
174
+ M(S(n(o)("page.restore")), 1)
175
175
  ]),
176
176
  _: 1
177
- }, 8, ["onClick"])) : N("", !0)
177
+ }, 8, ["onClick"])) : D("", !0)
178
178
  ]))), 128))
179
179
  ]));
180
180
  }
181
- }), Il = /* @__PURE__ */ ie(Nl, [["__scopeId", "data-v-42c6b7ad"]]), Ie = "wx-preview-selected", Ge = "wx-preview-hover", yt = "wx-preview-style";
182
- function Ut(e, n) {
181
+ }), Ul = /* @__PURE__ */ ie(Ol, [["__scopeId", "data-v-42c6b7ad"]]), Pe = "wx-preview-selected", Ge = "wx-preview-hover", wt = "wx-preview-style";
182
+ function jt(e, l) {
183
183
  const s = (e.ownerDocument ?? e).createTreeWalker(
184
184
  e,
185
185
  128
@@ -188,15 +188,15 @@ function Ut(e, n) {
188
188
  let a = null;
189
189
  for (let i = s.nextNode(); i; i = s.nextNode()) {
190
190
  const o = i.data.trim();
191
- if (a === null && o === `wx:${n}`)
191
+ if (a === null && o === `wx:${l}`)
192
192
  a = i;
193
- else if (a !== null && o === `/wx:${n}`)
193
+ else if (a !== null && o === `/wx:${l}`)
194
194
  return { start: a, end: i };
195
195
  }
196
196
  return null;
197
197
  }
198
- function Rt(e, n, t) {
199
- const s = Ut(e, n);
198
+ function Ft(e, l, t) {
199
+ const s = jt(e, l);
200
200
  if (!s) return !1;
201
201
  const a = s.start.parentNode;
202
202
  if (!a) return !1;
@@ -209,40 +209,40 @@ function Rt(e, n, t) {
209
209
  if (a.removeChild(r), v) break;
210
210
  r = p;
211
211
  }
212
- const m = i.content, c = Array.from(m.childNodes);
213
- a.insertBefore(m, o);
212
+ const f = i.content, u = Array.from(f.childNodes);
213
+ a.insertBefore(f, o);
214
214
  const d = e.defaultView?.webx;
215
215
  if (d?.mount)
216
- for (const p of c)
216
+ for (const p of u)
217
217
  p.nodeType === 1 && d.mount(p);
218
218
  return !0;
219
219
  }
220
- function ct(e, n) {
221
- const t = Ut(e, n);
220
+ function pt(e, l) {
221
+ const t = jt(e, l);
222
222
  if (!t) return null;
223
223
  for (let s = t.start.nextSibling; s && s !== t.end; s = s.nextSibling)
224
224
  if (s.nodeType === 1) return s;
225
225
  return null;
226
226
  }
227
- function st(e, n) {
228
- dt(e);
229
- for (const s of Array.from(e.querySelectorAll(`.${Ie}`)))
230
- s.classList.remove(Ie);
231
- if (n === null) return null;
232
- const t = ct(e, n);
233
- return t?.classList.add(Ie), t;
227
+ function ot(e, l) {
228
+ ft(e);
229
+ for (const s of Array.from(e.querySelectorAll(`.${Pe}`)))
230
+ s.classList.remove(Pe);
231
+ if (l === null) return null;
232
+ const t = pt(e, l);
233
+ return t?.classList.add(Pe), t;
234
234
  }
235
- function kt(e, n) {
236
- dt(e);
235
+ function _t(e, l) {
236
+ ft(e);
237
237
  for (const t of Array.from(e.querySelectorAll(`.${Ge}`)))
238
238
  t.classList.remove(Ge);
239
- n !== null && ct(e, n)?.classList.add(Ge);
239
+ l !== null && pt(e, l)?.classList.add(Ge);
240
240
  }
241
- function wt(e) {
242
- let n = e?.nodeType === 1 ? e : e?.parentElement ?? null;
243
- for (; n; ) {
241
+ function xt(e) {
242
+ let l = e?.nodeType === 1 ? e : e?.parentElement ?? null;
243
+ for (; l; ) {
244
244
  let t = 0;
245
- for (let s = n.previousSibling; s; s = s.previousSibling) {
245
+ for (let s = l.previousSibling; s; s = s.previousSibling) {
246
246
  if (s.nodeType !== 8) continue;
247
247
  const a = s.data.trim();
248
248
  if (a.startsWith("/wx:"))
@@ -252,75 +252,106 @@ function wt(e) {
252
252
  t -= 1;
253
253
  }
254
254
  }
255
- n = n.parentElement;
255
+ l = l.parentElement;
256
256
  }
257
257
  return null;
258
258
  }
259
- function Pl(e, n) {
260
- dt(e);
259
+ function Rl(e, l) {
260
+ ft(e);
261
261
  let t = null;
262
262
  function s(o) {
263
- const r = wt(o.target);
264
- r === null ? Pe(o) : _e(o), n.select(r);
263
+ const r = xt(o.target);
264
+ r === null ? Oe(o) : _e(o), l.select(r);
265
265
  }
266
266
  function a(o) {
267
- const r = wt(o.target);
268
- r !== t && (t = r, kt(e, r));
267
+ const r = xt(o.target);
268
+ r !== t && (t = r, _t(e, r));
269
269
  }
270
270
  function i() {
271
- t = null, kt(e, null);
271
+ t = null, _t(e, null);
272
272
  }
273
- return e.addEventListener("click", s, !0), e.addEventListener("auxclick", Pe, !0), e.addEventListener("submit", _e, !0), e.addEventListener("dragstart", _e, !0), e.addEventListener("mousemove", a, !0), e.addEventListener("mouseleave", i), {
273
+ return e.addEventListener("click", s, !0), e.addEventListener("auxclick", Oe, !0), e.addEventListener("submit", _e, !0), e.addEventListener("dragstart", _e, !0), e.addEventListener("mousemove", a, !0), e.addEventListener("mouseleave", i), {
274
274
  release() {
275
- e.removeEventListener("click", s, !0), e.removeEventListener("auxclick", Pe, !0), e.removeEventListener("submit", _e, !0), e.removeEventListener("dragstart", _e, !0), e.removeEventListener("mousemove", a, !0), e.removeEventListener("mouseleave", i);
275
+ e.removeEventListener("click", s, !0), e.removeEventListener("auxclick", Oe, !0), e.removeEventListener("submit", _e, !0), e.removeEventListener("dragstart", _e, !0), e.removeEventListener("mousemove", a, !0), e.removeEventListener("mouseleave", i);
276
276
  }
277
277
  };
278
278
  }
279
279
  function _e(e) {
280
280
  e.preventDefault(), e.stopPropagation();
281
281
  }
282
- function Pe(e) {
283
- const n = e.target;
284
- (n?.nodeType === Node.ELEMENT_NODE ? n : n?.parentElement ?? null)?.closest("a[href], area[href]") && e.preventDefault();
282
+ function Oe(e) {
283
+ const l = e.target;
284
+ (l?.nodeType === Node.ELEMENT_NODE ? l : l?.parentElement ?? null)?.closest("a[href], area[href]") && e.preventDefault();
285
285
  }
286
- function Ol(e) {
287
- const n = [
288
- ["click", Pe],
289
- ["auxclick", Pe],
286
+ function jl(e) {
287
+ const l = [
288
+ ["click", Oe],
289
+ ["auxclick", Oe],
290
290
  ["submit", _e],
291
291
  ["dragstart", _e]
292
292
  ];
293
- for (const [t, s] of n) e.addEventListener(t, s, !0);
293
+ for (const [t, s] of l) e.addEventListener(t, s, !0);
294
294
  return {
295
295
  release() {
296
- for (const [t, s] of n) e.removeEventListener(t, s, !0);
296
+ for (const [t, s] of l) e.removeEventListener(t, s, !0);
297
297
  }
298
298
  };
299
299
  }
300
- const ot = "sample", _t = "wx-stage-styles";
301
- function Ul(e, n) {
302
- let t = e.getElementById(_t);
303
- t === null && (t = e.createElement("style"), t.id = _t, (e.head ?? e.documentElement).appendChild(t)), t.textContent = n.styles;
304
- const s = `<!--wx:${ot}-->`, a = n.html.trimStart().startsWith(s) ? n.html : `${s}${n.html}<!--/wx:${ot}-->`;
305
- return Rt(e, ot, a);
300
+ const Ze = "sample", it = "wx-stage-styles";
301
+ function Fl(e, l) {
302
+ let t = e.getElementById(it);
303
+ t === null && (t = e.createElement("style"), t.id = it, (e.head ?? e.documentElement).appendChild(t)), t.textContent = l.styles;
304
+ const s = `<!--wx:${Ze}-->`, a = l.html.trimStart().startsWith(s) ? l.html : `${s}${l.html}<!--/wx:${Ze}-->`;
305
+ return Ft(e, Ze, a);
306
306
  }
307
- function Rl(e, n) {
307
+ function Hl(e, l) {
308
308
  const t = e.createElement("script");
309
- t.textContent = n, e.body.appendChild(t);
309
+ t.textContent = l, e.body.appendChild(t);
310
+ }
311
+ function ft(e) {
312
+ if (e.getElementById(wt)) return;
313
+ const l = e.createElement("style");
314
+ l.id = wt, l.textContent = `.${Pe}{outline:2px solid #427edd;outline-offset:-2px;}.${Ge}:not(.${Pe}){outline:1px solid #427edd;outline-offset:-1px;cursor:pointer;}`, (e.head ?? e.documentElement).appendChild(l);
315
+ }
316
+ function Ht(e) {
317
+ const l = e.base ? `<base href="${rt(e.base)}">` : "", t = e.frame ? `<style>${e.frame}</style>` : "", s = e.script && e.runtime ? `<script src="${rt(e.runtime)}"><\/script><script>${e.script}<\/script>` : "";
318
+ return `<!doctype html><html><head><meta charset="utf-8"><meta name="viewport" content="width=device-width,initial-scale=1">${l}<style>html,body{margin:0}body{container-type:inline-size}</style>${t}<style>${e.styles}</style></head><body>${e.html}${s}</body></html>`;
319
+ }
320
+ const qt = "<!--wx-thumb-->";
321
+ function ql(e, l) {
322
+ const t = new DOMParser().parseFromString(e, "text/html"), s = Yl(t, `wx:${Ze}`);
323
+ if (s === null) return null;
324
+ const a = (u) => u === null ? null : new URL(u, new URL(l, location.href)).href, i = [];
325
+ for (const u of Array.from(t.head.children)) {
326
+ const d = u.tagName.toLowerCase(), p = (u.getAttribute("rel") ?? "").toLowerCase().split(/\s+/);
327
+ if (d === "style" && u.id !== it)
328
+ i.push(u.outerHTML);
329
+ else if (d === "link" && (p.includes("stylesheet") || p.includes("preload") && u.getAttribute("as") === "font")) {
330
+ const v = u.cloneNode(!1);
331
+ v.setAttribute("href", a(u.getAttribute("href")) ?? ""), i.push(v.outerHTML);
332
+ }
333
+ }
334
+ let o = qt, r = s.parentElement;
335
+ for (; r !== null && r !== t.body && r !== t.documentElement; ) {
336
+ const u = r.cloneNode(!1);
337
+ u.innerHTML = o, o = u.outerHTML, r = r.parentElement;
338
+ }
339
+ const f = (u) => Array.from(u.attributes).map((d) => ` ${d.name}="${rt(d.value)}"`).join("");
340
+ return `<!doctype html><html${f(t.documentElement)}><head><meta charset="utf-8"><meta name="viewport" content="width=device-width,initial-scale=1">${i.join("")}</head><body${f(t.body)}>${o}</body></html>`;
310
341
  }
311
- function dt(e) {
312
- if (e.getElementById(yt)) return;
313
- const n = e.createElement("style");
314
- n.id = yt, n.textContent = `.${Ie}{outline:2px solid #427edd;outline-offset:-2px;}.${Ge}:not(.${Ie}){outline:1px solid #427edd;outline-offset:-1px;cursor:pointer;}`, (e.head ?? e.documentElement).appendChild(n);
342
+ function Kl(e, l) {
343
+ return e.replace("</head>", () => `<style>${l.styles}</style></head>`).replace(qt, () => l.html);
315
344
  }
316
- function jt(e) {
317
- const n = e.base ? `<base href="${xt(e.base)}">` : "", t = e.frame ? `<style>${e.frame}</style>` : "", s = e.script && e.runtime ? `<script src="${xt(e.runtime)}"><\/script><script>${e.script}<\/script>` : "";
318
- return `<!doctype html><html><head><meta charset="utf-8"><meta name="viewport" content="width=device-width,initial-scale=1">${n}<style>html,body{margin:0}body{container-type:inline-size}</style>${t}<style>${e.styles}</style></head><body>${e.html}${s}</body></html>`;
345
+ function Yl(e, l) {
346
+ const t = e.createTreeWalker(e.body ?? e.documentElement, NodeFilter.SHOW_COMMENT);
347
+ for (let s = t.nextNode(); s !== null; s = t.nextNode())
348
+ if (s.data.trim() === l) return s;
349
+ return null;
319
350
  }
320
- function xt(e) {
351
+ function rt(e) {
321
352
  return e.replace(/&/g, "&amp;").replace(/"/g, "&quot;").replace(/</g, "&lt;");
322
353
  }
323
- const jl = { class: "wx-block-stage" }, Fl = { class: "wx-block-stage__bar" }, Hl = ["src", "srcdoc", "title"], ql = /* @__PURE__ */ ae({
354
+ const Jl = { class: "wx-block-stage" }, Gl = { class: "wx-block-stage__bar" }, Zl = ["src", "srcdoc", "title"], Ql = /* @__PURE__ */ ae({
324
355
  __name: "BlockStage",
325
356
  props: {
326
357
  html: {},
@@ -331,97 +362,97 @@ const jl = { class: "wx-block-stage" }, Fl = { class: "wx-block-stage__bar" }, H
331
362
  loading: { type: Boolean, default: !1 }
332
363
  },
333
364
  setup(e) {
334
- const n = e, t = de("webx-blocks"), s = V(() => [
365
+ const l = e, t = de("webx-blocks"), s = V(() => [
335
366
  { value: 1280, icon: "monitor", ariaLabel: t("page.width-desktop") },
336
367
  { value: 834, icon: "tablet", ariaLabel: t("page.width-tablet") },
337
368
  { value: 390, icon: "smartphone", ariaLabel: t("page.width-phone") }
338
- ]), a = I(1280), i = I(null), o = I(null), r = Xe(i), m = I(360), c = I(!1);
369
+ ]), a = I(1280), i = I(null), o = I(null), r = et(i), f = I(360), u = I(!1);
339
370
  te([r, s], () => {
340
- if (c.value || r.value === 0) return;
341
- const h = s.value.find((A) => r.value / A.value >= 0.45);
371
+ if (u.value || r.value === 0) return;
372
+ const h = s.value.find((L) => r.value / L.value >= 0.45);
342
373
  a.value = (h ?? s.value[s.value.length - 1]).value;
343
374
  });
344
375
  function d(h) {
345
- c.value = !0, a.value = h;
376
+ u.value = !0, a.value = h;
346
377
  }
347
378
  const p = V(() => r.value === 0 ? 1 : Math.min(1, r.value / a.value)), v = V(
348
- () => n.stage ? void 0 : jt({
349
- html: n.html,
350
- styles: n.styles,
351
- script: n.script,
352
- runtime: n.runtime,
379
+ () => l.stage ? void 0 : Ht({
380
+ html: l.html,
381
+ styles: l.styles,
382
+ script: l.script,
383
+ runtime: l.runtime,
353
384
  base: typeof location > "u" ? null : location.origin + "/"
354
385
  })
355
386
  ), g = I(0);
356
387
  let x = null;
357
388
  te(
358
- () => n.script,
389
+ () => l.script,
359
390
  (h) => {
360
- n.stage && h !== x && (g.value += 1);
391
+ l.stage && h !== x && (g.value += 1);
361
392
  }
362
393
  );
363
394
  function T() {
364
395
  const h = o.value?.contentDocument?.body;
365
396
  if (!h) return;
366
- const A = h.ownerDocument.defaultView, P = A && parseFloat(A.getComputedStyle(h).marginBottom) || 0, J = h.getBoundingClientRect().bottom + P + (A?.scrollY ?? 0);
367
- m.value = Math.max(120, Math.ceil(Math.max(h.scrollHeight, J)));
397
+ const L = h.ownerDocument.defaultView, P = L && parseFloat(L.getComputedStyle(h).marginBottom) || 0, J = h.getBoundingClientRect().bottom + P + (L?.scrollY ?? 0);
398
+ f.value = Math.max(120, Math.ceil(Math.max(h.scrollHeight, J)));
368
399
  }
369
400
  let w = null, y = null;
370
401
  function _() {
371
402
  w?.release(), w = null, y?.disconnect(), y = null;
372
403
  }
373
404
  function R(h) {
374
- n.stage && (n.script && x !== n.script && (x = n.script, Rl(h, n.script)), Ul(h, { html: n.html, styles: n.styles }));
405
+ l.stage && (l.script && x !== l.script && (x = l.script, Hl(h, l.script)), Fl(h, { html: l.html, styles: l.styles }));
375
406
  }
376
407
  function K() {
377
408
  _();
378
409
  const h = o.value?.contentDocument;
379
410
  if (!h?.body) return;
380
- n.stage && (x = null, w = Ol(h), R(h)), T();
381
- const A = h.defaultView?.ResizeObserver;
382
- A && (y = new A(() => T()), y.observe(h.body));
411
+ l.stage && (x = null, w = jl(h), R(h)), T();
412
+ const L = h.defaultView?.ResizeObserver;
413
+ L && (y = new L(() => T()), y.observe(h.body));
383
414
  }
384
415
  te(
385
- () => [n.html, n.styles],
416
+ () => [l.html, l.styles],
386
417
  () => {
387
418
  const h = o.value?.contentDocument;
388
- n.stage && h?.body && w !== null && R(h);
419
+ l.stage && h?.body && w !== null && R(h);
389
420
  }
390
- ), te(r, (h, A) => {
391
- h > 0 && A === 0 && setTimeout(T, 50);
392
- }), te(a, () => setTimeout(T, 50)), Qe(_);
421
+ ), te(r, (h, L) => {
422
+ h > 0 && L === 0 && setTimeout(T, 50);
423
+ }), te(a, () => setTimeout(T, 50)), Xe(_);
393
424
  const Y = V(() => ({
394
425
  width: `${a.value}px`,
395
- height: `${m.value}px`,
426
+ height: `${f.value}px`,
396
427
  transform: `scale(${p.value})`
397
428
  })), X = V(() => ({
398
429
  width: `${Math.round(a.value * p.value)}px`,
399
- height: `${Math.round(m.value * p.value)}px`
430
+ height: `${Math.round(f.value * p.value)}px`
400
431
  }));
401
- return (h, A) => (u(), C("div", jl, [
402
- B("div", Fl, [
403
- f(l(Wt), {
432
+ return (h, L) => (c(), C("div", Jl, [
433
+ A("div", Gl, [
434
+ m(n(zt), {
404
435
  "model-value": a.value,
405
436
  options: s.value,
406
437
  size: "sm",
407
- "aria-label": l(t)("page.width"),
408
- "onUpdate:modelValue": A[0] || (A[0] = (P) => d(Number(P)))
438
+ "aria-label": n(t)("page.width"),
439
+ "onUpdate:modelValue": L[0] || (L[0] = (P) => d(Number(P)))
409
440
  }, null, 8, ["model-value", "options", "aria-label"])
410
441
  ]),
411
- B("div", {
442
+ A("div", {
412
443
  ref_key: "box",
413
444
  ref: i,
414
445
  class: "wx-block-stage__ground"
415
446
  }, [
416
- e.loading && !e.html ? (u(), M(l(Le), {
447
+ e.loading && !e.html ? (c(), N(n(Be), {
417
448
  key: 0,
418
449
  rows: 3
419
- })) : (u(), C("div", {
450
+ })) : (c(), C("div", {
420
451
  key: 1,
421
452
  class: "wx-block-stage__clip",
422
453
  style: xe(X.value)
423
454
  }, [
424
- (u(), C("iframe", {
455
+ (c(), C("iframe", {
425
456
  ref_key: "frame",
426
457
  ref: o,
427
458
  key: g.value,
@@ -430,111 +461,111 @@ const jl = { class: "wx-block-stage" }, Fl = { class: "wx-block-stage__bar" }, H
430
461
  srcdoc: v.value,
431
462
  style: xe(Y.value),
432
463
  sandbox: "allow-same-origin allow-scripts",
433
- title: l(t)("page.preview"),
464
+ title: n(t)("page.preview"),
434
465
  onLoad: K
435
- }, null, 44, Hl))
466
+ }, null, 44, Zl))
436
467
  ], 4))
437
468
  ], 512)
438
469
  ]));
439
470
  }
440
- }), Kl = /* @__PURE__ */ ie(ql, [["__scopeId", "data-v-3185ee45"]]);
441
- function Ft(e) {
471
+ }), Xl = /* @__PURE__ */ ie(Ql, [["__scopeId", "data-v-3185ee45"]]);
472
+ function Kt(e) {
442
473
  return typeof e == "object" && e !== null && typeof e.type == "string" && e.type !== "";
443
474
  }
444
- function et(e) {
445
- return Array.isArray(e) && e.length > 0 && e.every(Ft);
475
+ function tt(e) {
476
+ return Array.isArray(e) && e.length > 0 && e.every(Kt);
446
477
  }
447
- function it() {
478
+ function ut() {
448
479
  return (typeof crypto < "u" && "randomUUID" in crypto ? crypto.randomUUID().replace(/-/g, "") : Math.random().toString(36).slice(2) + Math.random().toString(36).slice(2)).slice(0, 12);
449
480
  }
450
- function Yl(e, n = {}) {
451
- return { key: it(), type: e, values: n };
481
+ function en(e, l = {}) {
482
+ return { key: ut(), type: e, values: l };
452
483
  }
453
- function re(e, n) {
454
- return Ht(e, n, null, null);
484
+ function re(e, l) {
485
+ return Yt(e, l, null, null);
455
486
  }
456
- function Ht(e, n, t, s) {
487
+ function Yt(e, l, t, s) {
457
488
  for (let a = 0; a < e.length; a++) {
458
489
  const i = e[a];
459
- if (i.key === n) return { node: i, parent: t, field: s, list: e, index: a };
490
+ if (i.key === l) return { node: i, parent: t, field: s, list: e, index: a };
460
491
  for (const [o, r] of Object.entries(i.values ?? {}))
461
- if (et(r)) {
462
- const m = Ht(r, n, i, o);
463
- if (m) return m;
492
+ if (tt(r)) {
493
+ const f = Yt(r, l, i, o);
494
+ if (f) return f;
464
495
  }
465
496
  }
466
497
  return null;
467
498
  }
468
- function Fe(e, n, t = 0, s = null) {
499
+ function He(e, l, t = 0, s = null) {
469
500
  for (const a of e)
470
- if (Ft(a)) {
471
- n(a, t, s);
501
+ if (Kt(a)) {
502
+ l(a, t, s);
472
503
  for (const i of Object.values(a.values ?? {}))
473
- et(i) && Fe(i, n, t + 1, a);
504
+ tt(i) && He(i, l, t + 1, a);
474
505
  }
475
506
  }
476
- function Jl(e, n) {
507
+ function tn(e, l) {
477
508
  let t = 0;
478
- return Fe(e, (s) => {
479
- s.type === n && t++;
509
+ return He(e, (s) => {
510
+ s.type === l && t++;
480
511
  }), t;
481
512
  }
482
- function Gl(e) {
483
- let n = 0;
513
+ function ln(e) {
514
+ let l = 0;
484
515
  for (const t of Object.values(e.values ?? {}))
485
- et(t) && Fe(t, () => n++);
486
- return n;
516
+ tt(t) && He(t, () => l++);
517
+ return l;
487
518
  }
488
- function lo(e) {
489
- const n = [];
490
- return Fe(e, (t) => {
491
- n.includes(t.type) || n.push(t.type);
492
- }), n;
519
+ function co(e) {
520
+ const l = [];
521
+ return He(e, (t) => {
522
+ l.includes(t.type) || l.push(t.type);
523
+ }), l;
493
524
  }
494
- function qt(e) {
495
- const n = [];
525
+ function Jt(e) {
526
+ const l = [];
496
527
  for (const t of e)
497
- t.type === "wx-blocks" && n.push(t), t.children && n.push(...qt(t.children));
498
- return n;
528
+ t.type === "wx-blocks" && l.push(t), t.children && l.push(...Jt(t.children));
529
+ return l;
499
530
  }
500
- function Kt(e) {
501
- const n = {};
531
+ function Gt(e) {
532
+ const l = {};
502
533
  for (const [t, s] of Object.entries(e.values ?? {}))
503
- n[t] = et(s) ? s.map(Kt) : be(s);
504
- return e.hidden === !0 ? { key: it(), type: e.type, hidden: !0, values: n } : { key: it(), type: e.type, values: n };
534
+ l[t] = tt(s) ? s.map(Gt) : be(s);
535
+ return e.hidden === !0 ? { key: ut(), type: e.type, hidden: !0, values: l } : { key: ut(), type: e.type, values: l };
505
536
  }
506
- function Zl(e, n, t) {
507
- const s = be(e), a = re(s, n);
537
+ function nn(e, l, t) {
538
+ const s = be(e), a = re(s, l);
508
539
  return a ? (t ? a.node.hidden = !0 : delete a.node.hidden, s) : e;
509
540
  }
510
- function Ql(e, n, t) {
511
- if (n === null) return e;
512
- const s = re(e, n);
541
+ function sn(e, l, t) {
542
+ if (l === null) return e;
543
+ const s = re(e, l);
513
544
  if (!s || t === null) return null;
514
545
  const a = s.node.values[t];
515
546
  return Array.isArray(a) || (s.node.values[t] = []), s.node.values[t];
516
547
  }
517
- function $t(e, n, t, s, a) {
518
- const i = be(e), o = Ql(i, n, t);
548
+ function $t(e, l, t, s, a) {
549
+ const i = be(e), o = sn(i, l, t);
519
550
  return o ? (o.splice(Math.max(0, Math.min(s, o.length)), 0, a), i) : e;
520
551
  }
521
- function Xl(e, n) {
522
- const t = be(e), s = re(t, n);
552
+ function on(e, l) {
553
+ const t = be(e), s = re(t, l);
523
554
  return s ? (s.list.splice(s.index, 1), t) : e;
524
555
  }
525
- function en(e, n, t) {
526
- const s = be(e), a = re(s, n);
556
+ function an(e, l, t) {
557
+ const s = be(e), a = re(s, l);
527
558
  return a ? (a.node.values = t, s) : e;
528
559
  }
529
- function tn(e, n, t, s) {
530
- if (n === null) return be(s);
531
- const a = be(e), i = re(a, n);
560
+ function rn(e, l, t, s) {
561
+ if (l === null) return be(s);
562
+ const a = be(e), i = re(a, l);
532
563
  return !i || t === null ? e : (i.node.values[t] = be(s), a);
533
564
  }
534
565
  function be(e) {
535
566
  return e === void 0 ? e : JSON.parse(JSON.stringify(e));
536
567
  }
537
- const ln = {
568
+ const un = {
538
569
  module: {
539
570
  title: "Blocks"
540
571
  },
@@ -691,82 +722,82 @@ const ln = {
691
722
  "ok-variables": "Every variable of the template is a field of the schema."
692
723
  }
693
724
  }, St = /* @__PURE__ */ new WeakSet();
694
- function He() {
725
+ function qe() {
695
726
  try {
696
- const { i18n: e } = Re();
697
- St.has(e) || (e.defaults("webx-blocks", ln), St.add(e));
727
+ const { i18n: e } = je();
728
+ St.has(e) || (e.defaults("webx-blocks", un), St.add(e));
698
729
  } catch {
699
730
  }
700
731
  }
701
732
  function at(e) {
702
733
  return [
703
- Cl({ icons: !1 }),
704
- Bl.languageData.of(() => [{ autocomplete: e }])
734
+ Ll({ icons: !1 }),
735
+ Wl.languageData.of(() => [{ autocomplete: e }])
705
736
  ];
706
737
  }
707
- const nn = [
738
+ const cn = [
708
739
  ["block", "key, type, version, depth, value()"],
709
740
  ["entity", "the page or article the block stands on"]
710
- ], sn = ["key", "type", "version", "depth"], Yt = ["url", "alt", "title", "path"], on = [...Yt, "thumb", "name", "extension", "mime", "size", "width", "height"], an = ["wx-media"], rn = ["wx-gallery", "wx-files"];
711
- function un({ schema: e, styles: n }) {
741
+ ], dn = ["key", "type", "version", "depth"], Zt = ["url", "alt", "title", "path"], pn = [...Zt, "thumb", "name", "extension", "mime", "size", "width", "height"], fn = ["wx-media"], mn = ["wx-gallery", "wx-files"];
742
+ function vn({ schema: e, styles: l }) {
712
743
  return (t) => {
713
744
  const s = t.state.sliceDoc(Math.max(0, t.pos - 200), t.pos), a = /\$block->(\w*)$/.exec(s);
714
- if (a) return pn(t, a[1]);
745
+ if (a) return gn(t, a[1]);
715
746
  const i = /\$(\w+)\[\s*(['"]?)(\w*)$/.exec(s);
716
- if (i) return fn(t, i[1], i[2], i[3], e());
747
+ if (i) return yn(t, i[1], i[2], i[3], e());
717
748
  const o = /\$(\w*)$/.exec(s);
718
749
  if (o)
719
750
  return {
720
751
  from: t.pos - o[0].length,
721
- options: cn(e(), t.state.doc.toString()),
752
+ options: hn(e(), t.state.doc.toString()),
722
753
  validFor: /^\$\w*$/
723
754
  };
724
755
  const r = /(\{\{|\{!!)(\s*)(\w*)$/.exec(s);
725
- if (r) return dn(t, r[1], r[2], r[3], e());
726
- const m = /\bclass\s*=\s*"([^"]*)$/.exec(s);
727
- if (m) return mn(t, m[1], n());
728
- const c = /(?:^|[\s>(])@(\w*)$/.exec(s);
729
- return c ? {
730
- from: t.pos - c[1].length - 1,
731
- options: hn(e()),
756
+ if (r) return bn(t, r[1], r[2], r[3], e());
757
+ const f = /\bclass\s*=\s*"([^"]*)$/.exec(s);
758
+ if (f) return wn(t, f[1], l());
759
+ const u = /(?:^|[\s>(])@(\w*)$/.exec(s);
760
+ return u ? {
761
+ from: t.pos - u[1].length - 1,
762
+ options: _n(e()),
732
763
  validFor: /^@\w*$/
733
764
  } : null;
734
765
  };
735
766
  }
736
- function cn(e, n) {
737
- const t = Zt(e).map((s, a) => ({
767
+ function hn(e, l) {
768
+ const t = el(e).map((s, a) => ({
738
769
  label: `$${s.id}`,
739
770
  detail: s.type,
740
771
  info: s.label,
741
772
  type: "variable",
742
773
  boost: 50 - a
743
774
  }));
744
- for (const s of Jt(n).keys())
775
+ for (const s of Qt(l).keys())
745
776
  t.push({ label: `$${s}`, detail: "loop", type: "variable" });
746
- for (const [s, a] of nn)
777
+ for (const [s, a] of cn)
747
778
  t.push({ label: `$${s}`, detail: "given", info: a, type: "variable", boost: -10 });
748
779
  return t.push({ label: "$loop", detail: "given", info: "inside @foreach", boost: -20 }), t;
749
780
  }
750
- function dn(e, n, t, s, a) {
751
- const i = Zt(a);
781
+ function bn(e, l, t, s, a) {
782
+ const i = el(a);
752
783
  if (i.length === 0) return null;
753
- const o = n === "{{" ? "}}" : "!!}";
784
+ const o = l === "{{" ? "}}" : "!!}";
754
785
  return {
755
786
  from: e.pos - s.length,
756
- options: i.map((r, m) => ({
787
+ options: i.map((r, f) => ({
757
788
  label: r.id,
758
789
  displayLabel: `$${r.id}`,
759
790
  detail: r.type,
760
791
  info: r.label,
761
792
  type: "variable",
762
- boost: 50 - m,
763
- apply: (c, d, p, v) => {
764
- const g = c.state.sliceDoc(v, v + 8), x = new RegExp(`^\\s*${xn(o)}`).exec(g), T = x ? /^\s/.test(g) ? "" : " " : ` ${o}`, w = `${t === "" ? " " : ""}$${r.id}${T}`;
765
- c.dispatch({
793
+ boost: 50 - f,
794
+ apply: (u, d, p, v) => {
795
+ const g = u.state.sliceDoc(v, v + 8), x = new RegExp(`^\\s*${Vn(o)}`).exec(g), T = x ? /^\s/.test(g) ? "" : " " : ` ${o}`, w = `${t === "" ? " " : ""}$${r.id}${T}`;
796
+ u.dispatch({
766
797
  changes: { from: p, to: v, insert: w },
767
798
  // Past the closing braces: the echo is finished, the next thing is the markup.
768
799
  selection: { anchor: p + w.length + (x ? x[0].length : 0) },
769
- annotations: ut.of(d),
800
+ annotations: dt.of(d),
770
801
  userEvent: "input.complete"
771
802
  });
772
803
  }
@@ -774,12 +805,12 @@ function dn(e, n, t, s, a) {
774
805
  validFor: /^\w*$/
775
806
  };
776
807
  }
777
- function pn(e, n) {
808
+ function gn(e, l) {
778
809
  return {
779
- from: e.pos - n.length,
810
+ from: e.pos - l.length,
780
811
  options: [
781
- ...sn.map((t) => ({ label: t, type: "property" })),
782
- me("value('${name}', ${default})", {
812
+ ...dn.map((t) => ({ label: t, type: "property" })),
813
+ ve("value('${name}', ${default})", {
783
814
  label: "value",
784
815
  detail: "('name', default)",
785
816
  type: "method"
@@ -788,20 +819,20 @@ function pn(e, n) {
788
819
  validFor: /^\w*$/
789
820
  };
790
821
  }
791
- function fn(e, n, t, s, a) {
792
- const i = vn(n, a, e.state.doc.toString());
822
+ function yn(e, l, t, s, a) {
823
+ const i = kn(l, a, e.state.doc.toString());
793
824
  return i.length === 0 ? null : {
794
825
  from: e.pos - s.length,
795
826
  options: i.map(([o, r]) => ({
796
827
  label: o,
797
828
  detail: r,
798
829
  type: "property",
799
- apply: (m, c, d, p) => {
800
- const v = t ? d - 1 : d, g = m.state.sliceDoc(p, p + 2), x = t || "'", T = p + (g.startsWith(x) ? 1 : 0), w = m.state.sliceDoc(T, T + 1) === "]", y = `${x}${o}${x}${w ? "" : "]"}`;
801
- m.dispatch({
830
+ apply: (f, u, d, p) => {
831
+ const v = t ? d - 1 : d, g = f.state.sliceDoc(p, p + 2), x = t || "'", T = p + (g.startsWith(x) ? 1 : 0), w = f.state.sliceDoc(T, T + 1) === "]", y = `${x}${o}${x}${w ? "" : "]"}`;
832
+ f.dispatch({
802
833
  changes: { from: v, to: T, insert: y },
803
834
  selection: { anchor: v + y.length + (w ? 1 : 0) },
804
- annotations: ut.of(c),
835
+ annotations: dt.of(u),
805
836
  userEvent: "input.complete"
806
837
  });
807
838
  }
@@ -809,47 +840,47 @@ function fn(e, n, t, s, a) {
809
840
  validFor: /^\w*$/
810
841
  };
811
842
  }
812
- function vn(e, n, t) {
813
- const s = We(n).find((o) => o.id === e);
814
- if (s && an.includes(s.type)) return Yt.map((o) => [o, s.type]);
815
- const a = Jt(t).get(e), i = a ? We(n).find((o) => o.id === a) : void 0;
816
- return i ? rn.includes(i.type) ? on.map((o) => [o, i.type]) : i.type === "wx-repeater" ? We(i.children ?? []).map((o) => [o.id, o.type]) : [] : [];
843
+ function kn(e, l, t) {
844
+ const s = We(l).find((o) => o.id === e);
845
+ if (s && fn.includes(s.type)) return Zt.map((o) => [o, s.type]);
846
+ const a = Qt(t).get(e), i = a ? We(l).find((o) => o.id === a) : void 0;
847
+ return i ? mn.includes(i.type) ? pn.map((o) => [o, i.type]) : i.type === "wx-repeater" ? We(i.children ?? []).map((o) => [o.id, o.type]) : [] : [];
817
848
  }
818
- function Jt(e) {
819
- const n = /* @__PURE__ */ new Map();
849
+ function Qt(e) {
850
+ const l = /* @__PURE__ */ new Map();
820
851
  for (const t of e.matchAll(/\$(\w+)\s+as\s+\$(\w+)(?:\s*=>\s*\$(\w+))?/g))
821
- n.set(t[3] ?? t[2], t[1]);
822
- return n;
852
+ l.set(t[3] ?? t[2], t[1]);
853
+ return l;
823
854
  }
824
- function mn(e, n, t) {
825
- const s = /[\w-]*$/.exec(n)[0], a = new Set(n.split(/\s+/));
855
+ function wn(e, l, t) {
856
+ const s = /[\w-]*$/.exec(l)[0], a = new Set(l.split(/\s+/));
826
857
  return {
827
858
  from: e.pos - s.length,
828
- options: Gt(t).filter((i) => !a.has(i) || i === s).map((i) => ({ label: i, detail: "styles", type: "class" })),
859
+ options: Xt(t).filter((i) => !a.has(i) || i === s).map((i) => ({ label: i, detail: "styles", type: "class" })),
829
860
  validFor: /^[\w-]*$/
830
861
  };
831
862
  }
832
- function hn(e) {
833
- const n = We(e).filter((t) => t.type === "wx-blocks");
863
+ function _n(e) {
864
+ const l = We(e).filter((t) => t.type === "wx-blocks");
834
865
  return [
835
- me("@if (${condition})\n ${}\n@endif", { label: "@if", type: "keyword" }),
836
- me("@isset(${value})\n ${}\n@endisset", { label: "@isset", type: "keyword" }),
837
- me("@foreach (${items} as ${item})\n ${}\n@endforeach", {
866
+ ve("@if (${condition})\n ${}\n@endif", { label: "@if", type: "keyword" }),
867
+ ve("@isset(${value})\n ${}\n@endisset", { label: "@isset", type: "keyword" }),
868
+ ve("@foreach (${items} as ${item})\n ${}\n@endforeach", {
838
869
  label: "@foreach",
839
870
  type: "keyword"
840
871
  }),
841
- me("@forelse (${items} as ${item})\n ${}\n@empty\n ${}\n@endforelse", {
872
+ ve("@forelse (${items} as ${item})\n ${}\n@empty\n ${}\n@endforelse", {
842
873
  label: "@forelse",
843
874
  type: "keyword"
844
875
  }),
845
- me("@unless (${condition})\n ${}\n@endunless", {
876
+ ve("@unless (${condition})\n ${}\n@endunless", {
846
877
  label: "@unless",
847
878
  type: "keyword"
848
879
  }),
849
- me("@class([${}])", { label: "@class", type: "keyword" }),
850
- me("@style([${}])", { label: "@style", type: "keyword" }),
851
- ...n.map(
852
- (t) => me(`@blocks('${t.id}')`, {
880
+ ve("@class([${}])", { label: "@class", type: "keyword" }),
881
+ ve("@style([${}])", { label: "@style", type: "keyword" }),
882
+ ...l.map(
883
+ (t) => ve(`@blocks('${t.id}')`, {
853
884
  label: "@blocks",
854
885
  detail: `('${t.id}')`,
855
886
  type: "keyword",
@@ -861,13 +892,13 @@ function hn(e) {
861
892
  )
862
893
  ];
863
894
  }
864
- function bn({ slug: e, template: n }) {
895
+ function xn({ slug: e, template: l }) {
865
896
  return (t) => {
866
897
  const s = t.state.sliceDoc(Math.max(0, t.pos - 200), t.pos), a = /(?:^|[\s,>+~(}{])\.([\w-]*)$/.exec(s);
867
898
  if (!a) return null;
868
899
  const i = /[^{};]*$/.exec(s)[0];
869
900
  if (/^\s*[\w-]+\s*:\s/.test(i)) return null;
870
- const o = `b-${e()}`, r = new Set(Gt(t.state.doc.toString())), m = gn(n()), c = [o, ...m.filter((p) => p !== o)], d = c.map((p, v) => ({
901
+ const o = `b-${e()}`, r = new Set(Xt(t.state.doc.toString())), f = $n(l()), u = [o, ...f.filter((p) => p !== o)], d = u.map((p, v) => ({
871
902
  label: `.${p}`,
872
903
  // A class the template uses and nothing styles yet is the likeliest thing to write.
873
904
  detail: r.has(p) ? "template" : "template · no rule yet",
@@ -875,34 +906,34 @@ function bn({ slug: e, template: n }) {
875
906
  boost: (r.has(p) ? 0 : 20) + (p === o ? 30 : 0) - v / 100
876
907
  }));
877
908
  for (const p of r)
878
- c.includes(p) || d.push({ label: `.${p}`, detail: "styles", type: "class" });
909
+ u.includes(p) || d.push({ label: `.${p}`, detail: "styles", type: "class" });
879
910
  return { from: t.pos - a[1].length - 1, options: d, validFor: /^\.[\w-]*$/ };
880
911
  };
881
912
  }
882
- function Gt(e) {
883
- const n = e.replace(/\/\*[\s\S]*?\*\//g, ""), t = /* @__PURE__ */ new Set(), s = [];
913
+ function Xt(e) {
914
+ const l = e.replace(/\/\*[\s\S]*?\*\//g, ""), t = /* @__PURE__ */ new Set(), s = [];
884
915
  let a = "";
885
- for (const i of n)
916
+ for (const i of l)
886
917
  if (i === "{") {
887
- const o = s.at(-1) ?? [""], r = a.split(",").map((m) => m.trim()).filter((m) => m !== "" && !m.startsWith("@")).flatMap(
888
- (m) => m.includes("&") ? o.map((c) => m.replaceAll("&", c)) : o.map((c) => c ? `${c} ${m}` : m)
918
+ const o = s.at(-1) ?? [""], r = a.split(",").map((f) => f.trim()).filter((f) => f !== "" && !f.startsWith("@")).flatMap(
919
+ (f) => f.includes("&") ? o.map((u) => f.replaceAll("&", u)) : o.map((u) => u ? `${u} ${f}` : f)
889
920
  );
890
- for (const m of r)
891
- for (const c of m.matchAll(/\.(-?[a-zA-Z_][\w-]*)/g)) t.add(c[1]);
921
+ for (const f of r)
922
+ for (const u of f.matchAll(/\.(-?[a-zA-Z_][\w-]*)/g)) t.add(u[1]);
892
923
  s.push(a.trim().startsWith("@") ? o : r.length ? r : o), a = "";
893
924
  } else i === "}" ? (s.pop(), a = "") : i === ";" ? a = "" : a += i;
894
925
  return [...t];
895
926
  }
896
- function gn(e) {
897
- const n = /* @__PURE__ */ new Set();
927
+ function $n(e) {
928
+ const l = /* @__PURE__ */ new Set();
898
929
  for (const t of e.matchAll(/\bclass\s*=\s*"([^"]*)"/g)) {
899
930
  const s = t[1].replace(/\{\{[\s\S]*?\}\}|\{!![\s\S]*?!!\}|@\w+(\([^)]*\))?/g, " ");
900
931
  for (const a of s.split(/\s+/))
901
- /^-?[a-zA-Z_][\w-]*$/.test(a) && n.add(a);
932
+ /^-?[a-zA-Z_][\w-]*$/.test(a) && l.add(a);
902
933
  }
903
- return [...n];
934
+ return [...l];
904
935
  }
905
- const yn = [
936
+ const Sn = [
906
937
  { key: "id", value: '""', info: "The variable the template gets, in snake_case." },
907
938
  { key: "type", value: '""', info: "A type from the registry." },
908
939
  { key: "label", value: '""', info: "What the editor sees above the field." },
@@ -914,104 +945,104 @@ const yn = [
914
945
  { key: "slot", value: '""', info: "The parent's named slot to land in." },
915
946
  { key: "can", value: '""', info: "The permission the node needs." }
916
947
  ];
917
- function kn({ types: e }) {
918
- return (n) => {
919
- const t = wn(n.state.doc.toString(), n.pos);
948
+ function En({ types: e }) {
949
+ return (l) => {
950
+ const t = Tn(l.state.doc.toString(), l.pos);
920
951
  if (!t || !t.node) return null;
921
- const s = t.string ? n.state.sliceDoc(t.string, n.pos) : /[\w-]*$/.exec(n.state.sliceDoc(Math.max(0, n.pos - 60), n.pos))[0];
922
- if (!t.string && s === "" && !n.explicit) return null;
923
- const a = n.pos - s.length, i = t.string !== null;
952
+ const s = t.string ? l.state.sliceDoc(t.string, l.pos) : /[\w-]*$/.exec(l.state.sliceDoc(Math.max(0, l.pos - 60), l.pos))[0];
953
+ if (!t.string && s === "" && !l.explicit) return null;
954
+ const a = l.pos - s.length, i = t.string !== null;
924
955
  if (t.phase === "key") {
925
- const o = yn.filter(({ key: r }) => !t.keys.has(r) || r === s).map(
926
- ({ key: r, value: m, info: c }, d) => ({
956
+ const o = Sn.filter(({ key: r }) => !t.keys.has(r) || r === s).map(
957
+ ({ key: r, value: f, info: u }, d) => ({
927
958
  label: r,
928
- info: c,
959
+ info: u,
929
960
  type: "property",
930
961
  boost: -d,
931
- apply: (p, v, g, x) => Et(p, v, g, x, i, `"${r}": ${m}`, m)
962
+ apply: (p, v, g, x) => Et(p, v, g, x, i, `"${r}": ${f}`, f)
932
963
  })
933
964
  );
934
965
  return { from: a, options: o, validFor: /^[\w-]*$/ };
935
966
  }
936
967
  if (t.phase === "value" && t.key === "type") {
937
- const o = Object.entries(e()).map(([r, m]) => ({
968
+ const o = Object.entries(e()).map(([r, f]) => ({
938
969
  label: r,
939
- detail: m.kind,
970
+ detail: f.kind,
940
971
  type: "type",
941
972
  // Fields first: a block's schema is mostly fields, the layout only groups them.
942
- boost: m.kind === "field" ? 1 : 0,
943
- apply: (c, d, p, v) => Et(c, d, p, v, i, `"${r}"`, "")
973
+ boost: f.kind === "field" ? 1 : 0,
974
+ apply: (u, d, p, v) => Et(u, d, p, v, i, `"${r}"`, "")
944
975
  }));
945
976
  return { from: a, options: o, validFor: /^[\w-]*$/ };
946
977
  }
947
978
  return null;
948
979
  };
949
980
  }
950
- function Et(e, n, t, s, a, i, o) {
951
- const r = a ? t - 1 : t, m = /^[\w-]*"?/.exec(e.state.sliceDoc(s, s + 60))[0], c = s + (a ? m.length : /^[\w-]*/.exec(m)[0].length), d = o === '""' || o === "{}" || o === "[]" ? 1 : 0;
981
+ function Et(e, l, t, s, a, i, o) {
982
+ const r = a ? t - 1 : t, f = /^[\w-]*"?/.exec(e.state.sliceDoc(s, s + 60))[0], u = s + (a ? f.length : /^[\w-]*/.exec(f)[0].length), d = o === '""' || o === "{}" || o === "[]" ? 1 : 0;
952
983
  e.dispatch({
953
- changes: { from: r, to: c, insert: i },
984
+ changes: { from: r, to: u, insert: i },
954
985
  selection: { anchor: r + i.length - d },
955
- annotations: ut.of(n),
986
+ annotations: dt.of(l),
956
987
  userEvent: "input.complete"
957
- }), i.startsWith('"type"') && Vl(e);
988
+ }), i.startsWith('"type"') && Bl(e);
958
989
  }
959
- function wn(e, n) {
990
+ function Tn(e, l) {
960
991
  let t = null, s = null, a = null, i = !1;
961
992
  const o = (r) => r?.kind === "object" && r.parent?.kind === "array" && (r.parent.parent === null || r.parent.under === "children");
962
- for (let r = 0; r <= e.length && (r === n && (s = t?.kind === "object" ? {
993
+ for (let r = 0; r <= e.length && (r === l && (s = t?.kind === "object" ? {
963
994
  node: o(t),
964
995
  phase: a?.key ? "key" : t.phase,
965
996
  key: t.key,
966
997
  keys: t.keys,
967
998
  string: a ? a.start + 1 : null
968
999
  } : null), r !== e.length); r++) {
969
- const m = e[r];
1000
+ const f = e[r];
970
1001
  if (a) {
971
1002
  if (i) i = !1;
972
- else if (m === "\\") i = !0;
973
- else if (m === '"' || m === `
1003
+ else if (f === "\\") i = !0;
1004
+ else if (f === '"' || f === `
974
1005
  `) {
975
- const c = e.slice(a.start + 1, r);
976
- t?.kind === "object" && (a.key ? (t.keys.add(c), t.key = c, t.phase = "colon") : t.phase === "value" && (t.phase = "after")), a = null;
1006
+ const u = e.slice(a.start + 1, r);
1007
+ t?.kind === "object" && (a.key ? (t.keys.add(u), t.key = u, t.phase = "colon") : t.phase === "value" && (t.phase = "after")), a = null;
977
1008
  }
978
1009
  continue;
979
1010
  }
980
- if (!/\s/.test(m))
981
- if (m === '"')
1011
+ if (!/\s/.test(f))
1012
+ if (f === '"')
982
1013
  a = { start: r, key: t?.kind === "object" && t.phase === "key" };
983
- else if (m === "{" || m === "[") {
984
- const c = {
985
- kind: m === "{" ? "object" : "array",
1014
+ else if (f === "{" || f === "[") {
1015
+ const u = {
1016
+ kind: f === "{" ? "object" : "array",
986
1017
  parent: t,
987
1018
  under: t?.kind === "object" ? t.key : null,
988
1019
  keys: /* @__PURE__ */ new Set(),
989
1020
  phase: "key",
990
1021
  key: null
991
1022
  };
992
- t?.kind === "object" && (t.phase = "after"), t = c;
993
- } else m === "}" || m === "]" ? t = t?.parent ?? null : m === ":" ? t?.kind === "object" && (t.phase = "value") : m === "," && t?.kind === "object" && (t.phase = "key", t.key = null);
1023
+ t?.kind === "object" && (t.phase = "after"), t = u;
1024
+ } else f === "}" || f === "]" ? t = t?.parent ?? null : f === ":" ? t?.kind === "object" && (t.phase = "value") : f === "," && t?.kind === "object" && (t.phase = "key", t.key = null);
994
1025
  }
995
1026
  return s;
996
1027
  }
997
1028
  function We(e) {
998
- const n = [];
1029
+ const l = [];
999
1030
  for (const t of e)
1000
- !t || typeof t != "object" || (_n.has(t.type) ? n.push(...We(t.children ?? [])) : typeof t.id == "string" && t.id !== "" && n.push(t));
1001
- return n;
1031
+ !t || typeof t != "object" || (Cn.has(t.type) ? l.push(...We(t.children ?? [])) : typeof t.id == "string" && t.id !== "" && l.push(t));
1032
+ return l;
1002
1033
  }
1003
- function Zt(e) {
1004
- return We(e).filter((n) => n.type !== "wx-blocks");
1034
+ function el(e) {
1035
+ return We(e).filter((l) => l.type !== "wx-blocks");
1005
1036
  }
1006
- const _n = /* @__PURE__ */ new Set(["wx-card", "wx-tabs", "wx-tab", "wx-row", "wx-col", "wx-divider"]);
1007
- function xn(e) {
1037
+ const Cn = /* @__PURE__ */ new Set(["wx-card", "wx-tabs", "wx-tab", "wx-row", "wx-col", "wx-divider"]);
1038
+ function Vn(e) {
1008
1039
  return e.replace(/[.*+?^${}()|[\]\\!]/g, "\\$&");
1009
1040
  }
1010
- const $n = ["block", "entity", "loop", "__env", "errors", "app"];
1011
- function Sn(e, n, t) {
1041
+ const An = ["block", "entity", "loop", "__env", "errors", "app"];
1042
+ function Ln(e, l, t) {
1012
1043
  const s = [];
1013
- /data-wx-block\s*=/.test(n.template) || s.push({ file: "template", code: "no-marker", line: null, message: t("checks.no-marker") });
1014
- const a = En(n.template, n.schema);
1044
+ /data-wx-block\s*=/.test(l.template) || s.push({ file: "template", code: "no-marker", line: null, message: t("checks.no-marker") });
1045
+ const a = Bn(l.template, l.schema);
1015
1046
  a.length > 0 && s.push({
1016
1047
  file: "template",
1017
1048
  code: "variables-missing",
@@ -1021,7 +1052,7 @@ function Sn(e, n, t) {
1021
1052
  })
1022
1053
  });
1023
1054
  const i = [], o = [], r = `.b-${e}`;
1024
- for (const [d, p] of Tn(n.styles))
1055
+ for (const [d, p] of Wn(l.styles))
1025
1056
  d.startsWith(r) || d.startsWith("&") || (/^[a-z][a-z0-9-]*/i.test(d) ? o.push([d, p]) : i.push([d, p]));
1026
1057
  i.length > 0 && s.push({
1027
1058
  file: "styles",
@@ -1034,22 +1065,22 @@ function Sn(e, n, t) {
1034
1065
  line: o[0][1],
1035
1066
  message: t("checks.bare-selectors", { selectors: Tt(o) })
1036
1067
  });
1037
- const m = Xt(n.styles), c = /@media\b/.exec(m);
1038
- return c && s.push({
1068
+ const f = ll(l.styles), u = /@media\b/.exec(f);
1069
+ return u && s.push({
1039
1070
  file: "styles",
1040
1071
  code: "media-query",
1041
- line: el(m, c.index),
1072
+ line: nl(f, u.index),
1042
1073
  message: t("checks.media-query")
1043
1074
  }), s;
1044
1075
  }
1045
- function Qt(e) {
1046
- const n = [];
1076
+ function tl(e) {
1077
+ const l = [];
1047
1078
  for (const t of e)
1048
- t.id && n.push(t.id), t.children && n.push(...Qt(t.children));
1049
- return n;
1079
+ t.id && l.push(t.id), t.children && l.push(...tl(t.children));
1080
+ return l;
1050
1081
  }
1051
- function En(e, n) {
1052
- const t = /* @__PURE__ */ new Set([...Qt(n), ...$n]);
1082
+ function Bn(e, l) {
1083
+ const t = /* @__PURE__ */ new Set([...tl(l), ...An]);
1053
1084
  for (const a of e.matchAll(/\bas\s+\$([a-zA-Z_]\w*)(?:\s*=>\s*\$([a-zA-Z_]\w*))?/g))
1054
1085
  t.add(a[1]), a[2] && t.add(a[2]);
1055
1086
  for (const a of e.matchAll(/\$([a-zA-Z_]\w*)\s*(?:=[^=]|\+\+|--|\.=|\+=|-=)/g))
@@ -1061,68 +1092,68 @@ function En(e, n) {
1061
1092
  }
1062
1093
  return s;
1063
1094
  }
1064
- function Tn(e) {
1065
- const n = Xt(e), t = [];
1066
- for (const s of n.matchAll(/([^{};]+)\{/g)) {
1095
+ function Wn(e) {
1096
+ const l = ll(e), t = [];
1097
+ for (const s of l.matchAll(/([^{};]+)\{/g)) {
1067
1098
  const a = s[1], i = a.trim();
1068
1099
  if (!(i === "" || i.startsWith("@")))
1069
1100
  for (const o of a.split(",")) {
1070
1101
  const r = o.trim();
1071
- r === "" || r === "from" || r === "to" || r.endsWith("%") || t.push([r, el(n, s.index + a.indexOf(r))]);
1102
+ r === "" || r === "from" || r === "to" || r.endsWith("%") || t.push([r, nl(l, s.index + a.indexOf(r))]);
1072
1103
  }
1073
1104
  }
1074
1105
  return t;
1075
1106
  }
1076
- function Xt(e) {
1077
- return e.replace(/\/\*[\s\S]*?\*\//g, (n) => n.replace(/[^\n]/g, " "));
1107
+ function ll(e) {
1108
+ return e.replace(/\/\*[\s\S]*?\*\//g, (l) => l.replace(/[^\n]/g, " "));
1078
1109
  }
1079
- function el(e, n) {
1080
- return e.slice(0, Math.max(0, n)).split(`
1110
+ function nl(e, l) {
1111
+ return e.slice(0, Math.max(0, l)).split(`
1081
1112
  `).length;
1082
1113
  }
1083
1114
  function Tt(e) {
1084
- const n = [...new Set(e.map(([t]) => t))];
1085
- return n.slice(0, 3).join(", ") + (n.length > 3 ? ", …" : "");
1086
- }
1087
- function pt(e) {
1088
- return e.map((n) => ({
1089
- ...n,
1090
- name: n.name ?? n.id,
1091
- children: n.children ? pt(n.children) : n.children
1115
+ const l = [...new Set(e.map(([t]) => t))];
1116
+ return l.slice(0, 3).join(", ") + (l.length > 3 ? ", …" : "");
1117
+ }
1118
+ function mt(e) {
1119
+ return e.map((l) => ({
1120
+ ...l,
1121
+ name: l.name ?? l.id,
1122
+ children: l.children ? mt(l.children) : l.children
1092
1123
  }));
1093
1124
  }
1094
- function rt(e, n) {
1095
- return e === 0 ? n("page.not-used") : e === 1 ? n("page.on-page") : n("page.on-pages", { count: e });
1125
+ function ct(e, l) {
1126
+ return e === 0 ? l("page.not-used") : e === 1 ? l("page.on-page") : l("page.on-pages", { count: e });
1096
1127
  }
1097
- function De(e, n) {
1098
- const t = `groups.${e}`, s = n(t);
1128
+ function ze(e, l) {
1129
+ const t = `groups.${e}`, s = l(t);
1099
1130
  return s === t || s === `webx-blocks::${t}` ? e.charAt(0).toUpperCase() + e.slice(1) : s;
1100
1131
  }
1101
- const Cn = { class: "wx-block-editor" }, Vn = { class: "wx-block-editor__split" }, Bn = {
1132
+ const Mn = { class: "wx-block-editor" }, zn = { class: "wx-block-editor__split" }, Nn = {
1102
1133
  type: "button",
1103
1134
  class: "wx-block-editor__uses"
1104
- }, An = { class: "wx-block-editor__usage" }, Ln = { class: "wx-block-editor__pane" }, Wn = {
1135
+ }, Dn = { class: "wx-block-editor__usage" }, In = { class: "wx-block-editor__pane" }, Pn = {
1105
1136
  key: 0,
1106
1137
  class: "wx-block-editor__pills"
1107
- }, zn = ["disabled", "onClick", "textContent"], Dn = { class: "wx-block-editor__pane" }, Mn = { class: "wx-block-editor__pane" }, Nn = { class: "wx-block-editor__note" }, In = { class: "wx-block-editor__split" }, Pn = { class: "wx-block-editor__pane" }, On = { class: "wx-block-editor__note" }, Un = { class: "wx-block-editor__settings" }, Rn = {
1138
+ }, On = ["disabled", "onClick", "textContent"], Un = { class: "wx-block-editor__pane" }, Rn = { class: "wx-block-editor__pane" }, jn = { class: "wx-block-editor__note" }, Fn = { class: "wx-block-editor__split" }, Hn = { class: "wx-block-editor__pane" }, qn = { class: "wx-block-editor__note" }, Kn = { class: "wx-block-editor__settings" }, Yn = {
1108
1139
  key: 0,
1109
1140
  class: "is-wide wx-block-editor__danger"
1110
- }, jn = /* @__PURE__ */ ae({
1141
+ }, Jn = /* @__PURE__ */ ae({
1111
1142
  __name: "BlockEditorPage",
1112
1143
  props: {
1113
1144
  base: { default: "/blocks" }
1114
1145
  },
1115
1146
  setup(e) {
1116
- const n = e, t = Re(), s = ze(t), a = dl(), i = Lt();
1117
- He();
1118
- const o = de("webx-blocks"), r = je(), m = V(() => Number(a.params.id)), c = I(null), d = I([]), p = I(!0), v = I(!1), g = I(!1), x = I("template"), T = V(() => {
1119
- const L = t.state.manifest?.modules.find((k) => k.id === "blocks")?.meta;
1147
+ const l = e, t = je(), s = Me(t), a = vl(), i = Wt();
1148
+ qe();
1149
+ const o = de("webx-blocks"), r = Fe(), f = V(() => Number(a.params.id)), u = I(null), d = I([]), p = I(!0), v = I(!1), g = I(!1), x = I("template"), T = V(() => {
1150
+ const B = t.state.manifest?.modules.find((k) => k.id === "blocks")?.meta;
1120
1151
  return {
1121
- groups: L?.groups ?? [],
1122
- editing: L?.editing ?? !0,
1123
- provides: L?.provides ?? []
1152
+ groups: B?.groups ?? [],
1153
+ editing: B?.editing ?? !0,
1154
+ provides: B?.provides ?? []
1124
1155
  };
1125
- }), w = V(() => t.can("blocks.manage") && T.value.editing), y = nt({
1156
+ }), w = V(() => t.can("blocks.manage") && T.value.editing), y = st({
1126
1157
  slug: "",
1127
1158
  title: "",
1128
1159
  description: "",
@@ -1133,59 +1164,59 @@ const Cn = { class: "wx-block-editor" }, Vn = { class: "wx-block-editor__split"
1133
1164
  allowed_in: [],
1134
1165
  max_per_entity: null,
1135
1166
  is_enabled: !0
1136
- }), _ = nt({
1167
+ }), _ = st({
1137
1168
  schema: [],
1138
1169
  template: "",
1139
1170
  styles: "",
1140
1171
  script: null,
1141
1172
  sample: {}
1142
- }), R = I("[]"), K = I(null), Y = I(""), X = I({}), h = I(null), A = nt({
1173
+ }), R = I("[]"), K = I(null), Y = I(""), X = I({}), h = I(null), L = st({
1143
1174
  html: "",
1144
1175
  styles: "",
1145
1176
  script: null,
1146
1177
  runtime: null,
1147
1178
  stage: null,
1148
1179
  loading: !1
1149
- }), P = V(() => JSON.stringify({ settings: y, content: _ })), J = V(() => Y.value !== "" && P.value !== Y.value), Se = V(() => Sn(y.slug, _, o)), ne = {
1180
+ }), P = V(() => JSON.stringify({ settings: y, content: _ })), J = V(() => Y.value !== "" && P.value !== Y.value), Se = V(() => Ln(y.slug, _, o)), ne = {
1150
1181
  template: [
1151
1182
  at(
1152
- un({ schema: () => _.schema, styles: () => _.styles })
1183
+ vn({ schema: () => _.schema, styles: () => _.styles })
1153
1184
  )
1154
1185
  ],
1155
1186
  styles: [
1156
- at(bn({ slug: () => y.slug, template: () => _.template }))
1187
+ at(xn({ slug: () => y.slug, template: () => _.template }))
1157
1188
  ],
1158
1189
  // The renderer's own types under the panel's, the same merge the sample form is drawn with.
1159
- schema: [at(kn({ types: () => ({ ...Je, ...t.types }) }))]
1190
+ schema: [at(En({ types: () => ({ ...Je, ...t.types }) }))]
1160
1191
  }, pe = V(() => {
1161
- const L = [...T.value.groups];
1162
- return L.includes(y.group) || L.push(y.group), L.map((k) => ({ value: k, label: De(k, o) }));
1192
+ const B = [...T.value.groups];
1193
+ return B.includes(y.group) || B.push(y.group), B.map((k) => ({ value: k, label: ze(k, o) }));
1163
1194
  }), ye = V({
1164
1195
  get: () => _.sample,
1165
- set: (L) => {
1166
- _.sample = L;
1196
+ set: (B) => {
1197
+ _.sample = B;
1167
1198
  }
1168
1199
  }), Ee = V(() => Te(_.schema));
1169
- function Te(L) {
1200
+ function Te(B) {
1170
1201
  const k = [];
1171
- for (const E of L)
1202
+ for (const E of B)
1172
1203
  E.type !== "wx-blocks" && !(E.children?.length && !E.name) && k.push(E.id), E.children && k.push(...Te(E.children));
1173
1204
  return k;
1174
1205
  }
1175
- function Q(L) {
1176
- c.value = L, Object.assign(y, {
1177
- slug: L.slug,
1178
- title: L.title,
1179
- description: L.description,
1180
- icon: L.icon,
1181
- group: L.group,
1182
- sort: L.sort,
1183
- allow: L.allow ?? [],
1184
- allowed_in: L.allowed_in ?? [],
1185
- max_per_entity: L.max_per_entity,
1186
- is_enabled: L.is_enabled
1206
+ function Q(B) {
1207
+ u.value = B, Object.assign(y, {
1208
+ slug: B.slug,
1209
+ title: B.title,
1210
+ description: B.description,
1211
+ icon: B.icon,
1212
+ group: B.group,
1213
+ sort: B.sort,
1214
+ allow: B.allow ?? [],
1215
+ allowed_in: B.allowed_in ?? [],
1216
+ max_per_entity: B.max_per_entity,
1217
+ is_enabled: B.is_enabled
1187
1218
  });
1188
- const k = L.content ?? {
1219
+ const k = B.content ?? {
1189
1220
  schema: [],
1190
1221
  template: "",
1191
1222
  styles: "",
@@ -1197,17 +1228,17 @@ const Cn = { class: "wx-block-editor" }, Vn = { class: "wx-block-editor__split"
1197
1228
  async function ke() {
1198
1229
  p.value = !0;
1199
1230
  try {
1200
- Q(await s.get(m.value)), d.value = await s.usage(m.value);
1201
- } catch (L) {
1202
- Z.danger(r(L));
1231
+ Q(await s.get(f.value)), d.value = await s.usage(f.value);
1232
+ } catch (B) {
1233
+ Z.danger(r(B));
1203
1234
  } finally {
1204
1235
  p.value = !1;
1205
1236
  }
1206
1237
  }
1207
- function Ce(L) {
1208
- R.value = L;
1238
+ function Ce(B) {
1239
+ R.value = B;
1209
1240
  try {
1210
- const k = JSON.parse(L);
1241
+ const k = JSON.parse(B);
1211
1242
  if (!Array.isArray(k)) throw new Error("not a list");
1212
1243
  _.schema = k, K.value = null;
1213
1244
  } catch (k) {
@@ -1221,11 +1252,11 @@ const Cn = { class: "wx-block-editor" }, Vn = { class: "wx-block-editor__split"
1221
1252
  }, 250);
1222
1253
  }
1223
1254
  async function j() {
1224
- if (!c.value) return;
1225
- const L = ++W;
1226
- A.loading = !0;
1255
+ if (!u.value) return;
1256
+ const B = ++W;
1257
+ L.loading = !0;
1227
1258
  try {
1228
- const k = await s.render(c.value.id, {
1259
+ const k = await s.render(u.value.id, {
1229
1260
  values: _.sample,
1230
1261
  content: w.value ? {
1231
1262
  template: _.template,
@@ -1234,12 +1265,12 @@ const Cn = { class: "wx-block-editor" }, Vn = { class: "wx-block-editor__split"
1234
1265
  schema: _.schema
1235
1266
  } : void 0
1236
1267
  });
1237
- if (L !== W) return;
1238
- A.html = k.html, A.styles = k.styles, A.script = k.script, A.runtime = k.runtime, A.stage = k.stage ?? null;
1268
+ if (B !== W) return;
1269
+ L.html = k.html, L.styles = k.styles, L.script = k.script, L.runtime = k.runtime, L.stage = k.stage ?? null;
1239
1270
  } catch (k) {
1240
- L === W && Z.danger(r(k));
1271
+ B === W && Z.danger(r(k));
1241
1272
  } finally {
1242
- L === W && (A.loading = !1);
1273
+ B === W && (L.loading = !1);
1243
1274
  }
1244
1275
  }
1245
1276
  te(
@@ -1248,23 +1279,23 @@ const Cn = { class: "wx-block-editor" }, Vn = { class: "wx-block-editor__split"
1248
1279
  { deep: !0 }
1249
1280
  );
1250
1281
  const G = I(null);
1251
- function fe(L) {
1252
- return `{{ $${L} }}`;
1282
+ function fe(B) {
1283
+ return `{{ $${B} }}`;
1253
1284
  }
1254
- function we(L) {
1285
+ function we(B) {
1255
1286
  const E = G.value?.view?.value;
1256
1287
  if (!E) {
1257
- _.template += `{{ $${L} }}`;
1288
+ _.template += `{{ $${B} }}`;
1258
1289
  return;
1259
1290
  }
1260
- E.dispatch(E.state.replaceSelection(`{{ $${L} }}`)), E.focus();
1291
+ E.dispatch(E.state.replaceSelection(`{{ $${B} }}`)), E.focus();
1261
1292
  }
1262
1293
  async function se() {
1263
- if (!c.value) return;
1294
+ if (!u.value) return;
1264
1295
  v.value = !0, X.value = {}, h.value = null;
1265
- const L = c.value.draft?.number ?? null;
1296
+ const B = u.value.draft?.number ?? null;
1266
1297
  try {
1267
- const k = await s.update(c.value.id, {
1298
+ const k = await s.update(u.value.id, {
1268
1299
  ...y,
1269
1300
  allow: y.allow.length ? y.allow : null,
1270
1301
  allowed_in: y.allowed_in.length ? y.allowed_in : null,
@@ -1273,7 +1304,7 @@ const Cn = { class: "wx-block-editor" }, Vn = { class: "wx-block-editor__split"
1273
1304
  content: K.value ? { ..._, schema: void 0 } : _
1274
1305
  });
1275
1306
  Q(k), Z.success(
1276
- k.draft && k.draft.number !== L ? o("page.saved", { number: k.draft.number }) : o("page.unchanged")
1307
+ k.draft && k.draft.number !== B ? o("page.saved", { number: k.draft.number }) : o("page.unchanged")
1277
1308
  );
1278
1309
  } catch (k) {
1279
1310
  const E = k.body;
@@ -1282,16 +1313,16 @@ const Cn = { class: "wx-block-editor" }, Vn = { class: "wx-block-editor__split"
1282
1313
  v.value = !1;
1283
1314
  }
1284
1315
  }
1285
- async function ve() {
1286
- if (!(!c.value?.draft || (J.value && await se(), !c.value.draft) || !await Ze({
1287
- title: o("page.publish-title", { number: c.value.draft.number }),
1288
- message: o("page.publish-text", { count: c.value.usage_count }),
1316
+ async function me() {
1317
+ if (!(!u.value?.draft || (J.value && await se(), !u.value.draft) || !await Qe({
1318
+ title: o("page.publish-title", { number: u.value.draft.number }),
1319
+ message: o("page.publish-text", { count: u.value.usage_count }),
1289
1320
  confirmText: o("page.publish"),
1290
1321
  cancelText: o("page.cancel")
1291
1322
  }))) {
1292
1323
  g.value = !0, h.value = null;
1293
1324
  try {
1294
- Q(await s.publish(c.value.id)), Z.success(o("page.published", { number: c.value.published?.number ?? 0 }));
1325
+ Q(await s.publish(u.value.id)), Z.success(o("page.published", { number: u.value.published?.number ?? 0 }));
1295
1326
  } catch (k) {
1296
1327
  const E = k.body;
1297
1328
  E?.errors ? (h.value = E, x.value = "template", Z.danger(o("page.publish-failed"))) : Z.danger(r(k, o("page.publish-failed")));
@@ -1301,20 +1332,20 @@ const Cn = { class: "wx-block-editor" }, Vn = { class: "wx-block-editor__split"
1301
1332
  }
1302
1333
  }
1303
1334
  async function Ve() {
1304
- if (!(!c.value || !await Ze({
1305
- title: o("page.delete-title", { title: c.value.title }),
1335
+ if (!(!u.value || !await Qe({
1336
+ title: o("page.delete-title", { title: u.value.title }),
1306
1337
  message: o("page.delete-text"),
1307
1338
  confirmText: o("page.delete"),
1308
1339
  cancelText: o("page.cancel"),
1309
1340
  tone: "danger"
1310
1341
  })))
1311
1342
  try {
1312
- await s.remove(c.value.id), Z.success(o("page.deleted")), i.push(n.base);
1343
+ await s.remove(u.value.id), Z.success(o("page.deleted")), i.push(l.base);
1313
1344
  } catch (k) {
1314
1345
  Z.danger(r(k));
1315
1346
  }
1316
1347
  }
1317
- const Me = V(
1348
+ const Ne = V(
1318
1349
  () => h.value ? {
1319
1350
  message: h.value.errors.template?.[0] ?? h.value.message,
1320
1351
  line: h.value.line,
@@ -1322,7 +1353,7 @@ const Cn = { class: "wx-block-editor" }, Vn = { class: "wx-block-editor__split"
1322
1353
  title: h.value.entity.title ?? `#${h.value.entity.id}`
1323
1354
  }) : null
1324
1355
  } : null
1325
- ), $ = V(() => x.value === "template" || x.value === "styles"), D = V(() => [
1356
+ ), $ = V(() => x.value === "template" || x.value === "styles"), z = V(() => [
1326
1357
  {
1327
1358
  title: o("page.example-handler"),
1328
1359
  code: `el.querySelector('.b-hero__button')?.addEventListener('click', (event) => {
@@ -1346,20 +1377,20 @@ setInterval(() => el.classList.toggle('is-second'), seconds * 1000)`
1346
1377
  new Swiper(el.querySelector('.b-slider__viewport'), { loop: true })`
1347
1378
  }
1348
1379
  ]), U = V(() => d.value.slice(0, 5));
1349
- function H(L) {
1350
- return X.value[L]?.[0];
1380
+ function H(B) {
1381
+ return X.value[B]?.[0];
1351
1382
  }
1352
- function ee(L) {
1353
- J.value && L.preventDefault();
1383
+ function ee(B) {
1384
+ J.value && B.preventDefault();
1354
1385
  }
1355
- Ue(() => {
1386
+ Re(() => {
1356
1387
  ke(), window.addEventListener("beforeunload", ee);
1357
- }), Qe(() => {
1388
+ }), Xe(() => {
1358
1389
  clearTimeout(ge), window.removeEventListener("beforeunload", ee);
1359
- }), te(m, () => {
1390
+ }), te(f, () => {
1360
1391
  ke();
1361
1392
  });
1362
- const tt = V(
1393
+ const lt = V(
1363
1394
  () => w.value ? [
1364
1395
  { key: "save", label: o("page.save"), loading: v.value, run: () => {
1365
1396
  se();
@@ -1369,158 +1400,158 @@ new Swiper(el.querySelector('.b-slider__viewport'), { loop: true })`
1369
1400
  label: o("page.publish"),
1370
1401
  primary: !0,
1371
1402
  loading: g.value,
1372
- disabled: !c.value?.draft && !J.value,
1403
+ disabled: !u.value?.draft && !J.value,
1373
1404
  run: () => {
1374
- ve();
1405
+ me();
1375
1406
  }
1376
1407
  }
1377
1408
  ] : []
1378
1409
  );
1379
- return (L, k) => (u(), C("div", Cn, [
1380
- p.value || !c.value ? (u(), C(F, { key: 0 }, [
1381
- f(l(Le), {
1410
+ return (B, k) => (c(), C("div", Mn, [
1411
+ p.value || !u.value ? (c(), C(F, { key: 0 }, [
1412
+ m(n(Be), {
1382
1413
  class: "wx-block-editor__ghost-head",
1383
1414
  title: "",
1384
1415
  rows: 1
1385
1416
  }),
1386
- B("div", Vn, [
1387
- f(l(Be), null, {
1417
+ A("div", zn, [
1418
+ m(n(Ae), null, {
1388
1419
  default: b(() => [
1389
- f(l(Le), { rows: 8 })
1420
+ m(n(Be), { rows: 8 })
1390
1421
  ]),
1391
1422
  _: 1
1392
1423
  }),
1393
- f(l(Be), null, {
1424
+ m(n(Ae), null, {
1394
1425
  default: b(() => [
1395
- f(l(Le), { rows: 4 })
1426
+ m(n(Be), { rows: 4 })
1396
1427
  ]),
1397
1428
  _: 1
1398
1429
  })
1399
1430
  ])
1400
- ], 64)) : (u(), C(F, { key: 1 }, [
1401
- f(l(fl), {
1431
+ ], 64)) : (c(), C(F, { key: 1 }, [
1432
+ m(n(bl), {
1402
1433
  title: y.title,
1403
1434
  back: e.base,
1404
- "back-label": l(o)("page.back"),
1405
- actions: tt.value
1435
+ "back-label": n(o)("page.back"),
1436
+ actions: lt.value
1406
1437
  }, {
1407
1438
  "title-after": b(() => [
1408
- w.value ? (u(), M(l(vl), {
1439
+ w.value ? (c(), N(n(gl), {
1409
1440
  key: 0,
1410
1441
  name: y.title,
1411
- placeholder: l(o)("page.title"),
1442
+ placeholder: n(o)("page.title"),
1412
1443
  onRename: k[0] || (k[0] = (E) => y.title = E)
1413
- }, null, 8, ["name", "placeholder"])) : N("", !0),
1414
- J.value ? (u(), M(l(ue), {
1444
+ }, null, 8, ["name", "placeholder"])) : D("", !0),
1445
+ J.value ? (c(), N(n(ue), {
1415
1446
  key: 1,
1416
1447
  type: "primary",
1417
1448
  dot: ""
1418
1449
  }, {
1419
1450
  default: b(() => [
1420
- z(S(l(o)("page.unsaved")), 1)
1451
+ M(S(n(o)("page.unsaved")), 1)
1421
1452
  ]),
1422
1453
  _: 1
1423
- })) : N("", !0),
1424
- c.value.draft ? (u(), M(l(ue), {
1454
+ })) : D("", !0),
1455
+ u.value.draft ? (c(), N(n(ue), {
1425
1456
  key: 2,
1426
1457
  type: "warning",
1427
1458
  dot: ""
1428
1459
  }, {
1429
1460
  default: b(() => [
1430
- z(S(l(o)("page.draft", { number: c.value.draft.number })), 1)
1461
+ M(S(n(o)("page.draft", { number: u.value.draft.number })), 1)
1431
1462
  ]),
1432
1463
  _: 1
1433
- })) : N("", !0),
1434
- c.value.published ? (u(), M(l(ue), {
1464
+ })) : D("", !0),
1465
+ u.value.published ? (c(), N(n(ue), {
1435
1466
  key: 3,
1436
1467
  type: "success",
1437
1468
  dot: ""
1438
1469
  }, {
1439
1470
  default: b(() => [
1440
- z(S(l(o)("page.live", { number: c.value.published.number })), 1)
1471
+ M(S(n(o)("page.live", { number: u.value.published.number })), 1)
1441
1472
  ]),
1442
1473
  _: 1
1443
- })) : (u(), M(l(ue), {
1474
+ })) : (c(), N(n(ue), {
1444
1475
  key: 4,
1445
1476
  type: "default"
1446
1477
  }, {
1447
1478
  default: b(() => [
1448
- z(S(l(o)("page.never-published")), 1)
1479
+ M(S(n(o)("page.never-published")), 1)
1449
1480
  ]),
1450
1481
  _: 1
1451
1482
  }))
1452
1483
  ]),
1453
1484
  subtitle: b(() => [
1454
- B("code", null, S(y.slug), 1),
1455
- z(" · " + S(l(De)(y.group, l(o))) + " · ", 1),
1456
- c.value.usage_count > 0 ? (u(), M(l(yl), {
1485
+ A("code", null, S(y.slug), 1),
1486
+ M(" · " + S(n(ze)(y.group, n(o))) + " · ", 1),
1487
+ u.value.usage_count > 0 ? (c(), N(n(_l), {
1457
1488
  key: 0,
1458
- title: l(o)("page.usage"),
1489
+ title: n(o)("page.usage"),
1459
1490
  width: 260,
1460
1491
  align: "start"
1461
1492
  }, {
1462
1493
  trigger: b(() => [
1463
- B("button", Bn, S(l(rt)(c.value.usage_count, l(o))), 1)
1494
+ A("button", Nn, S(n(ct)(u.value.usage_count, n(o))), 1)
1464
1495
  ]),
1465
1496
  default: b(() => [
1466
- B("div", An, [
1467
- (u(!0), C(F, null, le(U.value, (E) => (u(), C("div", {
1497
+ A("div", Dn, [
1498
+ (c(!0), C(F, null, le(U.value, (E) => (c(), C("div", {
1468
1499
  key: `${E.model}:${E.id}`,
1469
1500
  class: "wx-block-editor__use"
1470
1501
  }, [
1471
- B("span", null, S(E.title ?? `#${E.id}`), 1),
1472
- E.published ? N("", !0) : (u(), M(l(ue), {
1502
+ A("span", null, S(E.title ?? `#${E.id}`), 1),
1503
+ E.published ? D("", !0) : (c(), N(n(ue), {
1473
1504
  key: 0,
1474
1505
  type: "warning",
1475
1506
  size: "sm"
1476
1507
  }, {
1477
1508
  default: b(() => [
1478
- z(S(l(o)("page.unpublished-page")), 1)
1509
+ M(S(n(o)("page.unpublished-page")), 1)
1479
1510
  ]),
1480
1511
  _: 1
1481
1512
  }))
1482
1513
  ]))), 128)),
1483
- d.value.length > U.value.length ? (u(), M(l(q), {
1514
+ d.value.length > U.value.length ? (c(), N(n(q), {
1484
1515
  key: 0,
1485
1516
  size: "sm",
1486
1517
  tone: "muted"
1487
1518
  }, {
1488
1519
  default: b(() => [
1489
- z(S(l(o)("page.usage-more", { count: d.value.length - U.value.length })), 1)
1520
+ M(S(n(o)("page.usage-more", { count: d.value.length - U.value.length })), 1)
1490
1521
  ]),
1491
1522
  _: 1
1492
- })) : N("", !0)
1523
+ })) : D("", !0)
1493
1524
  ])
1494
1525
  ]),
1495
1526
  _: 1
1496
- }, 8, ["title"])) : (u(), C(F, { key: 1 }, [
1497
- z(S(l(rt)(c.value.usage_count, l(o))), 1)
1527
+ }, 8, ["title"])) : (c(), C(F, { key: 1 }, [
1528
+ M(S(n(ct)(u.value.usage_count, n(o))), 1)
1498
1529
  ], 64))
1499
1530
  ]),
1500
1531
  _: 1
1501
1532
  }, 8, ["title", "back", "back-label", "actions"]),
1502
- T.value.editing ? N("", !0) : (u(), M(l(zt), {
1533
+ T.value.editing ? D("", !0) : (c(), N(n(Nt), {
1503
1534
  key: 0,
1504
1535
  type: "info",
1505
1536
  variant: "soft",
1506
- description: l(o)("page.editing-off")
1537
+ description: n(o)("page.editing-off")
1507
1538
  }, null, 8, ["description"])),
1508
- B("div", {
1539
+ A("div", {
1509
1540
  class: $e(["wx-block-editor__columns", { "is-alone": !$.value }])
1510
1541
  }, [
1511
- f(l(kl), {
1542
+ m(n(xl), {
1512
1543
  modelValue: x.value,
1513
1544
  "onUpdate:modelValue": k[14] || (k[14] = (E) => x.value = E),
1514
1545
  "keep-alive": ""
1515
1546
  }, {
1516
1547
  default: b(() => [
1517
- f(l(Ae), {
1548
+ m(n(Le), {
1518
1549
  value: "template",
1519
- label: l(o)("page.tab-template")
1550
+ label: n(o)("page.tab-template")
1520
1551
  }, {
1521
1552
  default: b(() => [
1522
- B("div", Ln, [
1523
- f(l(qe), {
1553
+ A("div", In, [
1554
+ m(n(Ke), {
1524
1555
  ref_key: "templateEditor",
1525
1556
  ref: G,
1526
1557
  modelValue: _.template,
@@ -1532,42 +1563,42 @@ new Swiper(el.querySelector('.b-slider__viewport'), { loop: true })`
1532
1563
  "max-height": "70vh",
1533
1564
  "line-wrapping": ""
1534
1565
  }, null, 8, ["modelValue", "extensions", "readonly"]),
1535
- Ee.value.length ? (u(), C("div", Wn, [
1536
- f(l(q), {
1566
+ Ee.value.length ? (c(), C("div", Pn, [
1567
+ m(n(q), {
1537
1568
  size: "sm",
1538
1569
  tone: "muted"
1539
1570
  }, {
1540
1571
  default: b(() => [
1541
- z(S(l(o)("page.insert-field")), 1)
1572
+ M(S(n(o)("page.insert-field")), 1)
1542
1573
  ]),
1543
1574
  _: 1
1544
1575
  }),
1545
- (u(!0), C(F, null, le(Ee.value, (E) => (u(), C("button", {
1576
+ (c(!0), C(F, null, le(Ee.value, (E) => (c(), C("button", {
1546
1577
  key: E,
1547
1578
  type: "button",
1548
1579
  class: "wx-block-editor__pill",
1549
1580
  disabled: !w.value,
1550
- onClick: (lt) => we(E),
1581
+ onClick: (nt) => we(E),
1551
1582
  textContent: S(fe(E))
1552
- }, null, 8, zn))), 128))
1553
- ])) : N("", !0),
1554
- f(gt, {
1583
+ }, null, 8, On))), 128))
1584
+ ])) : D("", !0),
1585
+ m(kt, {
1555
1586
  file: "template",
1556
1587
  lints: Se.value,
1557
1588
  slug: y.slug,
1558
- error: Me.value
1589
+ error: Ne.value
1559
1590
  }, null, 8, ["lints", "slug", "error"])
1560
1591
  ])
1561
1592
  ]),
1562
1593
  _: 1
1563
1594
  }, 8, ["label"]),
1564
- f(l(Ae), {
1595
+ m(n(Le), {
1565
1596
  value: "styles",
1566
- label: l(o)("page.tab-styles")
1597
+ label: n(o)("page.tab-styles")
1567
1598
  }, {
1568
1599
  default: b(() => [
1569
- B("div", Dn, [
1570
- f(l(qe), {
1600
+ A("div", Un, [
1601
+ m(n(Ke), {
1571
1602
  modelValue: _.styles,
1572
1603
  "onUpdate:modelValue": k[2] || (k[2] = (E) => _.styles = E),
1573
1604
  language: "css",
@@ -1576,7 +1607,7 @@ new Swiper(el.querySelector('.b-slider__viewport'), { loop: true })`
1576
1607
  "min-height": "340px",
1577
1608
  "max-height": "70vh"
1578
1609
  }, null, 8, ["modelValue", "extensions", "readonly"]),
1579
- f(gt, {
1610
+ m(kt, {
1580
1611
  file: "styles",
1581
1612
  lints: Se.value,
1582
1613
  slug: y.slug
@@ -1585,13 +1616,13 @@ new Swiper(el.querySelector('.b-slider__viewport'), { loop: true })`
1585
1616
  ]),
1586
1617
  _: 1
1587
1618
  }, 8, ["label"]),
1588
- f(l(Ae), {
1619
+ m(n(Le), {
1589
1620
  value: "script",
1590
- label: l(o)("page.tab-script")
1621
+ label: n(o)("page.tab-script")
1591
1622
  }, {
1592
1623
  default: b(() => [
1593
- B("div", Mn, [
1594
- f(l(qe), {
1624
+ A("div", Rn, [
1625
+ m(n(Ke), {
1595
1626
  "model-value": _.script ?? "",
1596
1627
  language: "javascript",
1597
1628
  readonly: !w.value,
@@ -1599,47 +1630,47 @@ new Swiper(el.querySelector('.b-slider__viewport'), { loop: true })`
1599
1630
  "max-height": "70vh",
1600
1631
  "onUpdate:modelValue": k[3] || (k[3] = (E) => _.script = E || null)
1601
1632
  }, null, 8, ["model-value", "readonly"]),
1602
- B("div", Nn, [
1603
- f(l(q), {
1633
+ A("div", jn, [
1634
+ m(n(q), {
1604
1635
  size: "sm",
1605
1636
  tone: "muted"
1606
1637
  }, {
1607
1638
  default: b(() => [
1608
- z(S(l(o)("page.script-help")), 1)
1639
+ M(S(n(o)("page.script-help")), 1)
1609
1640
  ]),
1610
1641
  _: 1
1611
1642
  }),
1612
- f(l(q), {
1643
+ m(n(q), {
1613
1644
  size: "sm",
1614
1645
  tone: "muted"
1615
1646
  }, {
1616
1647
  default: b(() => [
1617
- z(S(T.value.provides.length ? l(o)("page.provides", { names: T.value.provides.join(", ") }) : l(o)("page.provides-none")), 1)
1648
+ M(S(T.value.provides.length ? n(o)("page.provides", { names: T.value.provides.join(", ") }) : n(o)("page.provides-none")), 1)
1618
1649
  ]),
1619
1650
  _: 1
1620
1651
  })
1621
1652
  ])
1622
1653
  ]),
1623
- f(l(Be), {
1654
+ m(n(Ae), {
1624
1655
  class: "wx-block-editor__examples",
1625
- title: l(o)("page.examples")
1656
+ title: n(o)("page.examples")
1626
1657
  }, {
1627
1658
  default: b(() => [
1628
- (u(!0), C(F, null, le(D.value, (E) => (u(), C("div", {
1659
+ (c(!0), C(F, null, le(z.value, (E) => (c(), C("div", {
1629
1660
  key: E.title,
1630
1661
  class: "wx-block-editor__example"
1631
1662
  }, [
1632
- f(l(q), {
1663
+ m(n(q), {
1633
1664
  size: "sm",
1634
1665
  tone: "muted"
1635
1666
  }, {
1636
1667
  default: b(() => [
1637
- z(S(E.title), 1)
1668
+ M(S(E.title), 1)
1638
1669
  ]),
1639
1670
  _: 2
1640
1671
  }, 1024),
1641
- B("pre", null, [
1642
- B("code", null, S(E.code), 1)
1672
+ A("pre", null, [
1673
+ A("code", null, S(E.code), 1)
1643
1674
  ])
1644
1675
  ]))), 128))
1645
1676
  ]),
@@ -1648,14 +1679,14 @@ new Swiper(el.querySelector('.b-slider__viewport'), { loop: true })`
1648
1679
  ]),
1649
1680
  _: 1
1650
1681
  }, 8, ["label"]),
1651
- f(l(Ae), {
1682
+ m(n(Le), {
1652
1683
  value: "fields",
1653
- label: l(o)("page.tab-fields")
1684
+ label: n(o)("page.tab-fields")
1654
1685
  }, {
1655
1686
  default: b(() => [
1656
- B("div", In, [
1657
- B("div", Pn, [
1658
- f(l(qe), {
1687
+ A("div", Fn, [
1688
+ A("div", Hn, [
1689
+ m(n(Ke), {
1659
1690
  "model-value": R.value,
1660
1691
  language: "json",
1661
1692
  extensions: ne.schema,
@@ -1665,57 +1696,57 @@ new Swiper(el.querySelector('.b-slider__viewport'), { loop: true })`
1665
1696
  "max-height": "70vh",
1666
1697
  "onUpdate:modelValue": Ce
1667
1698
  }, null, 8, ["model-value", "extensions", "readonly"]),
1668
- B("div", On, [
1669
- K.value ? (u(), M(l(q), {
1699
+ A("div", qn, [
1700
+ K.value ? (c(), N(n(q), {
1670
1701
  key: 0,
1671
1702
  size: "sm",
1672
1703
  tone: "danger"
1673
1704
  }, {
1674
1705
  default: b(() => [
1675
- z(S(K.value), 1)
1706
+ M(S(K.value), 1)
1676
1707
  ]),
1677
1708
  _: 1
1678
- })) : H("content.schema") ? (u(), M(l(q), {
1709
+ })) : H("content.schema") ? (c(), N(n(q), {
1679
1710
  key: 1,
1680
1711
  size: "sm",
1681
1712
  tone: "danger"
1682
1713
  }, {
1683
1714
  default: b(() => [
1684
- z(S(H("content.schema")), 1)
1715
+ M(S(H("content.schema")), 1)
1685
1716
  ]),
1686
1717
  _: 1
1687
- })) : (u(), M(l(q), {
1718
+ })) : (c(), N(n(q), {
1688
1719
  key: 2,
1689
1720
  size: "sm",
1690
1721
  tone: "muted"
1691
1722
  }, {
1692
1723
  default: b(() => [
1693
- z(S(l(o)("page.fields-help")), 1)
1724
+ M(S(n(o)("page.fields-help")), 1)
1694
1725
  ]),
1695
1726
  _: 1
1696
1727
  })),
1697
- f(l(ml), {
1698
- title: l(o)("help.schema-title"),
1699
- body: l(o)("help.schema")
1728
+ m(n(yl), {
1729
+ title: n(o)("help.schema-title"),
1730
+ body: n(o)("help.schema")
1700
1731
  }, null, 8, ["title", "body"])
1701
1732
  ])
1702
1733
  ]),
1703
- f(l(Be), {
1734
+ m(n(Ae), {
1704
1735
  class: "wx-block-editor__sample",
1705
- title: l(o)("page.sample")
1736
+ title: n(o)("page.sample")
1706
1737
  }, {
1707
1738
  default: b(() => [
1708
- _.schema.length ? (u(), M(l(Ot), {
1739
+ _.schema.length ? (c(), N(n(Rt), {
1709
1740
  key: 0,
1710
1741
  modelValue: ye.value,
1711
1742
  "onUpdate:modelValue": k[4] || (k[4] = (E) => ye.value = E),
1712
- root: l(pt)(_.schema),
1713
- types: l(t).types,
1714
- translate: l(t).i18n.t,
1715
- can: l(t).can,
1743
+ root: n(mt)(_.schema),
1744
+ types: n(t).types,
1745
+ translate: n(t).i18n.t,
1746
+ can: n(t).can,
1716
1747
  disabled: !w.value,
1717
1748
  size: "sm"
1718
- }, null, 8, ["modelValue", "root", "types", "translate", "can", "disabled"])) : N("", !0)
1749
+ }, null, 8, ["modelValue", "root", "types", "translate", "can", "disabled"])) : D("", !0)
1719
1750
  ]),
1720
1751
  _: 1
1721
1752
  }, 8, ["title"])
@@ -1723,36 +1754,36 @@ new Swiper(el.querySelector('.b-slider__viewport'), { loop: true })`
1723
1754
  ]),
1724
1755
  _: 1
1725
1756
  }, 8, ["label"]),
1726
- f(l(Ae), {
1757
+ m(n(Le), {
1727
1758
  value: "settings",
1728
- label: l(o)("page.tab-settings")
1759
+ label: n(o)("page.tab-settings")
1729
1760
  }, {
1730
1761
  default: b(() => [
1731
- f(l(Be), { class: "wx-block-editor__sheet" }, {
1762
+ m(n(Ae), { class: "wx-block-editor__sheet" }, {
1732
1763
  default: b(() => [
1733
- B("div", Un, [
1734
- f(l(oe), {
1735
- label: l(o)("page.identifier"),
1736
- help: l(o)("page.identifier-help"),
1764
+ A("div", Kn, [
1765
+ m(n(oe), {
1766
+ label: n(o)("page.identifier"),
1767
+ help: n(o)("page.identifier-help"),
1737
1768
  error: H("slug"),
1738
1769
  disabled: !w.value
1739
1770
  }, {
1740
1771
  default: b(() => [
1741
- f(l(Oe), {
1772
+ m(n(Ue), {
1742
1773
  modelValue: y.slug,
1743
1774
  "onUpdate:modelValue": k[5] || (k[5] = (E) => y.slug = E)
1744
1775
  }, null, 8, ["modelValue"])
1745
1776
  ]),
1746
1777
  _: 1
1747
1778
  }, 8, ["label", "help", "error", "disabled"]),
1748
- f(l(oe), {
1749
- label: l(o)("page.group"),
1750
- help: l(o)("page.group-help"),
1779
+ m(n(oe), {
1780
+ label: n(o)("page.group"),
1781
+ help: n(o)("page.group-help"),
1751
1782
  error: H("group"),
1752
1783
  disabled: !w.value
1753
1784
  }, {
1754
1785
  default: b(() => [
1755
- f(l(Dt), {
1786
+ m(n(Dt), {
1756
1787
  modelValue: y.group,
1757
1788
  "onUpdate:modelValue": k[6] || (k[6] = (E) => y.group = E),
1758
1789
  options: pe.value
@@ -1760,15 +1791,15 @@ new Swiper(el.querySelector('.b-slider__viewport'), { loop: true })`
1760
1791
  ]),
1761
1792
  _: 1
1762
1793
  }, 8, ["label", "help", "error", "disabled"]),
1763
- f(l(oe), {
1794
+ m(n(oe), {
1764
1795
  class: "is-wide",
1765
- label: l(o)("page.description"),
1766
- help: l(o)("page.description-help"),
1796
+ label: n(o)("page.description"),
1797
+ help: n(o)("page.description-help"),
1767
1798
  error: H("description"),
1768
1799
  disabled: !w.value
1769
1800
  }, {
1770
1801
  default: b(() => [
1771
- f(l(wl), {
1802
+ m(n($l), {
1772
1803
  "model-value": y.description ?? "",
1773
1804
  rows: 2,
1774
1805
  "onUpdate:modelValue": k[7] || (k[7] = (E) => y.description = String(E ?? ""))
@@ -1776,46 +1807,46 @@ new Swiper(el.querySelector('.b-slider__viewport'), { loop: true })`
1776
1807
  ]),
1777
1808
  _: 1
1778
1809
  }, 8, ["label", "help", "error", "disabled"]),
1779
- f(l(oe), {
1780
- label: l(o)("page.icon"),
1810
+ m(n(oe), {
1811
+ label: n(o)("page.icon"),
1781
1812
  error: H("icon"),
1782
1813
  disabled: !w.value
1783
1814
  }, {
1784
1815
  default: b(() => [
1785
- f(l(_l), {
1816
+ m(n(Sl), {
1786
1817
  "model-value": y.icon,
1787
1818
  clearable: "",
1788
- placeholder: l(o)("page.icon-search"),
1789
- "empty-text": l(o)("page.icon-none"),
1790
- "unknown-text": l(o)("page.icon-unknown"),
1791
- "clear-label": l(o)("page.icon-clear"),
1819
+ placeholder: n(o)("page.icon-search"),
1820
+ "empty-text": n(o)("page.icon-none"),
1821
+ "unknown-text": n(o)("page.icon-unknown"),
1822
+ "clear-label": n(o)("page.icon-clear"),
1792
1823
  "onUpdate:modelValue": k[8] || (k[8] = (E) => y.icon = E)
1793
1824
  }, null, 8, ["model-value", "placeholder", "empty-text", "unknown-text", "clear-label"])
1794
1825
  ]),
1795
1826
  _: 1
1796
1827
  }, 8, ["label", "error", "disabled"]),
1797
- f(l(oe), {
1798
- label: l(o)("page.sort"),
1799
- help: l(o)("page.sort-help"),
1828
+ m(n(oe), {
1829
+ label: n(o)("page.sort"),
1830
+ help: n(o)("page.sort-help"),
1800
1831
  error: H("sort"),
1801
1832
  disabled: !w.value
1802
1833
  }, {
1803
1834
  default: b(() => [
1804
- f(l(ht), {
1835
+ m(n(gt), {
1805
1836
  modelValue: y.sort,
1806
1837
  "onUpdate:modelValue": k[9] || (k[9] = (E) => y.sort = E)
1807
1838
  }, null, 8, ["modelValue"])
1808
1839
  ]),
1809
1840
  _: 1
1810
1841
  }, 8, ["label", "help", "error", "disabled"]),
1811
- f(l(oe), {
1812
- label: l(o)("page.allow"),
1813
- help: l(o)("page.allow-help"),
1842
+ m(n(oe), {
1843
+ label: n(o)("page.allow"),
1844
+ help: n(o)("page.allow-help"),
1814
1845
  error: H("allow"),
1815
1846
  disabled: !w.value
1816
1847
  }, {
1817
1848
  default: b(() => [
1818
- f(l(bt), {
1849
+ m(n(yt), {
1819
1850
  modelValue: y.allow,
1820
1851
  "onUpdate:modelValue": k[10] || (k[10] = (E) => y.allow = E),
1821
1852
  "allow-create": ""
@@ -1823,14 +1854,14 @@ new Swiper(el.querySelector('.b-slider__viewport'), { loop: true })`
1823
1854
  ]),
1824
1855
  _: 1
1825
1856
  }, 8, ["label", "help", "error", "disabled"]),
1826
- f(l(oe), {
1827
- label: l(o)("page.allowed-in"),
1828
- help: l(o)("page.allowed-in-help"),
1857
+ m(n(oe), {
1858
+ label: n(o)("page.allowed-in"),
1859
+ help: n(o)("page.allowed-in-help"),
1829
1860
  error: H("allowed_in"),
1830
1861
  disabled: !w.value
1831
1862
  }, {
1832
1863
  default: b(() => [
1833
- f(l(bt), {
1864
+ m(n(yt), {
1834
1865
  modelValue: y.allowed_in,
1835
1866
  "onUpdate:modelValue": k[11] || (k[11] = (E) => y.allowed_in = E),
1836
1867
  "allow-create": "",
@@ -1839,14 +1870,14 @@ new Swiper(el.querySelector('.b-slider__viewport'), { loop: true })`
1839
1870
  ]),
1840
1871
  _: 1
1841
1872
  }, 8, ["label", "help", "error", "disabled"]),
1842
- f(l(oe), {
1843
- label: l(o)("page.max-per-entity"),
1844
- help: l(o)("page.max-per-entity-help"),
1873
+ m(n(oe), {
1874
+ label: n(o)("page.max-per-entity"),
1875
+ help: n(o)("page.max-per-entity-help"),
1845
1876
  error: H("max_per_entity"),
1846
1877
  disabled: !w.value
1847
1878
  }, {
1848
1879
  default: b(() => [
1849
- f(l(ht), {
1880
+ m(n(gt), {
1850
1881
  "model-value": y.max_per_entity ?? void 0,
1851
1882
  min: 1,
1852
1883
  "onUpdate:modelValue": k[12] || (k[12] = (E) => y.max_per_entity = E ?? null)
@@ -1854,42 +1885,42 @@ new Swiper(el.querySelector('.b-slider__viewport'), { loop: true })`
1854
1885
  ]),
1855
1886
  _: 1
1856
1887
  }, 8, ["label", "help", "error", "disabled"]),
1857
- f(l(oe), {
1858
- label: l(o)("page.enabled"),
1859
- help: l(o)("page.enabled-help"),
1888
+ m(n(oe), {
1889
+ label: n(o)("page.enabled"),
1890
+ help: n(o)("page.enabled-help"),
1860
1891
  disabled: !w.value
1861
1892
  }, {
1862
1893
  default: b(() => [
1863
- f(l(xl), {
1894
+ m(n(El), {
1864
1895
  modelValue: y.is_enabled,
1865
1896
  "onUpdate:modelValue": k[13] || (k[13] = (E) => y.is_enabled = E)
1866
1897
  }, null, 8, ["modelValue"])
1867
1898
  ]),
1868
1899
  _: 1
1869
1900
  }, 8, ["label", "help", "disabled"]),
1870
- w.value ? (u(), C("div", Rn, [
1871
- f(l(ce), {
1901
+ w.value ? (c(), C("div", Yn, [
1902
+ m(n(ce), {
1872
1903
  type: "danger",
1873
1904
  variant: "outline",
1874
- disabled: c.value.usage_count > 0,
1905
+ disabled: u.value.usage_count > 0,
1875
1906
  onClick: Ve
1876
1907
  }, {
1877
1908
  default: b(() => [
1878
- z(S(l(o)("page.delete")), 1)
1909
+ M(S(n(o)("page.delete")), 1)
1879
1910
  ]),
1880
1911
  _: 1
1881
1912
  }, 8, ["disabled"]),
1882
- c.value.usage_count > 0 ? (u(), M(l(q), {
1913
+ u.value.usage_count > 0 ? (c(), N(n(q), {
1883
1914
  key: 0,
1884
1915
  size: "sm",
1885
1916
  tone: "muted"
1886
1917
  }, {
1887
1918
  default: b(() => [
1888
- z(S(c.value.usage_count === 1 ? l(o)("page.delete-used-one") : l(o)("page.delete-used", { count: c.value.usage_count })), 1)
1919
+ M(S(u.value.usage_count === 1 ? n(o)("page.delete-used-one") : n(o)("page.delete-used", { count: u.value.usage_count })), 1)
1889
1920
  ]),
1890
1921
  _: 1
1891
- })) : N("", !0)
1892
- ])) : N("", !0)
1922
+ })) : D("", !0)
1923
+ ])) : D("", !0)
1893
1924
  ])
1894
1925
  ]),
1895
1926
  _: 1
@@ -1897,18 +1928,18 @@ new Swiper(el.querySelector('.b-slider__viewport'), { loop: true })`
1897
1928
  ]),
1898
1929
  _: 1
1899
1930
  }, 8, ["label"]),
1900
- f(l(Ae), {
1931
+ m(n(Le), {
1901
1932
  value: "history",
1902
- label: l(o)("page.tab-history")
1933
+ label: n(o)("page.tab-history")
1903
1934
  }, {
1904
1935
  default: b(() => [
1905
- f(l(Be), {
1936
+ m(n(Ae), {
1906
1937
  class: "wx-block-editor__sheet",
1907
1938
  padding: "none"
1908
1939
  }, {
1909
1940
  default: b(() => [
1910
- f(Il, {
1911
- block: c.value,
1941
+ m(Ul, {
1942
+ block: u.value,
1912
1943
  "can-manage": w.value,
1913
1944
  onRestored: Q
1914
1945
  }, null, 8, ["block", "can-manage"])
@@ -1921,51 +1952,68 @@ new Swiper(el.querySelector('.b-slider__viewport'), { loop: true })`
1921
1952
  ]),
1922
1953
  _: 1
1923
1954
  }, 8, ["modelValue"]),
1924
- nl(f(Kl, {
1955
+ al(m(Xl, {
1925
1956
  class: "wx-block-editor__stage",
1926
- html: A.html,
1927
- styles: A.styles,
1928
- script: A.script,
1929
- runtime: A.runtime,
1930
- stage: A.stage,
1931
- loading: A.loading
1957
+ html: L.html,
1958
+ styles: L.styles,
1959
+ script: L.script,
1960
+ runtime: L.runtime,
1961
+ stage: L.stage,
1962
+ loading: L.loading
1932
1963
  }, null, 8, ["html", "styles", "script", "runtime", "stage", "loading"]), [
1933
- [sl, $.value]
1964
+ [il, $.value]
1934
1965
  ])
1935
1966
  ], 2),
1936
- w.value ? (u(), M(l($l), { key: 1 }, {
1967
+ w.value ? (c(), N(n(Tl), { key: 1 }, {
1937
1968
  default: b(() => [
1938
- f(l(ce), {
1969
+ m(n(ce), {
1939
1970
  variant: "outline",
1940
1971
  loading: v.value,
1941
1972
  onClick: se
1942
1973
  }, {
1943
1974
  default: b(() => [
1944
- z(S(l(o)("page.save")), 1)
1975
+ M(S(n(o)("page.save")), 1)
1945
1976
  ]),
1946
1977
  _: 1
1947
1978
  }, 8, ["loading"]),
1948
- f(l(ce), {
1979
+ m(n(ce), {
1949
1980
  type: "primary",
1950
1981
  loading: g.value,
1951
- disabled: !c.value.draft && !J.value,
1952
- onClick: ve
1982
+ disabled: !u.value.draft && !J.value,
1983
+ onClick: me
1953
1984
  }, {
1954
1985
  default: b(() => [
1955
- z(S(l(o)("page.publish")), 1)
1986
+ M(S(n(o)("page.publish")), 1)
1956
1987
  ]),
1957
1988
  _: 1
1958
1989
  }, 8, ["loading", "disabled"])
1959
1990
  ]),
1960
1991
  _: 1
1961
- })) : N("", !0)
1992
+ })) : D("", !0)
1962
1993
  ], 64))
1963
1994
  ]));
1964
1995
  }
1965
- }), Fn = /* @__PURE__ */ ie(jn, [["__scopeId", "data-v-22e5f784"]]), Hn = ["srcdoc"], qn = {
1996
+ }), Gn = /* @__PURE__ */ ie(Jn, [["__scopeId", "data-v-22e5f784"]]), Ct = /* @__PURE__ */ new Map();
1997
+ function Zn(e) {
1998
+ let l = Ct.get(e);
1999
+ return l === void 0 && (l = fetch(e, { credentials: "same-origin", headers: { Accept: "text/html" } }).then((t) => t.ok ? t.text() : null).then((t) => t === null ? null : ql(t, e)).catch(() => null), Ct.set(e, l)), l;
2000
+ }
2001
+ function Qn() {
2002
+ const e = De(Mt, null), l = I(null), t = V(() => {
2003
+ const a = e?.state.manifest?.modules.find((i) => i.id === "blocks")?.meta?.stage;
2004
+ return typeof a == "string" && a !== "" ? a : null;
2005
+ });
2006
+ return rl(() => {
2007
+ const s = t.value;
2008
+ s !== null && Zn(s).then((a) => {
2009
+ t.value === s && (l.value = a);
2010
+ });
2011
+ }), l;
2012
+ }
2013
+ const Xn = ["srcdoc"], es = {
1966
2014
  key: 1,
1967
2015
  class: "wx-block-thumb__empty"
1968
- }, Kn = /* @__PURE__ */ ae({
2016
+ }, ts = /* @__PURE__ */ ae({
1969
2017
  __name: "BlockThumb",
1970
2018
  props: {
1971
2019
  thumbnail: {},
@@ -1973,36 +2021,38 @@ new Swiper(el.querySelector('.b-slider__viewport'), { loop: true })`
1973
2021
  height: { default: 120 }
1974
2022
  },
1975
2023
  setup(e) {
1976
- const n = e, t = I(null), s = Xe(t), a = V(() => s.value > 0 ? s.value / n.width : 0.2), i = V(
1977
- () => n.thumbnail ? jt({ html: n.thumbnail.html, styles: n.thumbnail.styles }) : ""
1978
- ), o = V(() => ({
1979
- width: `${n.width}px`,
1980
- height: `${Math.round(n.height / a.value)}px`,
2024
+ const l = e, t = I(null), s = et(t), a = V(() => s.value > 0 ? s.value / l.width : 0.2), i = Qn(), o = V(() => {
2025
+ if (!l.thumbnail) return "";
2026
+ const f = { html: l.thumbnail.html, styles: l.thumbnail.styles };
2027
+ return i.value ? Kl(i.value, f) : Ht(f);
2028
+ }), r = V(() => ({
2029
+ width: `${l.width}px`,
2030
+ height: `${Math.round(l.height / a.value)}px`,
1981
2031
  transform: `scale(${a.value})`
1982
2032
  }));
1983
- return (r, m) => (u(), C("div", {
2033
+ return (f, u) => (c(), C("div", {
1984
2034
  ref_key: "box",
1985
2035
  ref: t,
1986
2036
  class: "wx-block-thumb",
1987
2037
  style: xe({ height: `${e.height}px` })
1988
2038
  }, [
1989
- e.thumbnail ? (u(), C("iframe", {
2039
+ e.thumbnail ? (c(), C("iframe", {
1990
2040
  key: 0,
1991
2041
  class: "wx-block-thumb__frame",
1992
- srcdoc: i.value,
1993
- style: xe(o.value),
2042
+ srcdoc: o.value,
2043
+ style: xe(r.value),
1994
2044
  sandbox: "allow-same-origin",
1995
2045
  tabindex: "-1",
1996
2046
  "aria-hidden": "true"
1997
- }, null, 12, Hn)) : (u(), C("div", qn, [
1998
- f(l(he), { name: "grid" })
2047
+ }, null, 12, Xn)) : (c(), C("div", es, [
2048
+ m(n(he), { name: "grid" })
1999
2049
  ]))
2000
2050
  ], 4));
2001
2051
  }
2002
- }), tl = /* @__PURE__ */ ie(Kn, [["__scopeId", "data-v-615b818a"]]), Yn = { class: "wx-block-picker" }, Jn = {
2052
+ }), sl = /* @__PURE__ */ ie(ts, [["__scopeId", "data-v-5ca74656"]]), ls = { class: "wx-block-picker" }, ns = {
2003
2053
  key: 0,
2004
2054
  class: "wx-block-picker__group-title"
2005
- }, Gn = { class: "wx-block-picker__cards" }, Zn = ["disabled", "title", "onClick"], Qn = { class: "wx-block-picker__body" }, Xn = { class: "wx-block-picker__title" }, es = /* @__PURE__ */ ae({
2055
+ }, ss = { class: "wx-block-picker__cards" }, os = ["disabled", "title", "onClick"], as = { class: "wx-block-picker__body" }, is = { class: "wx-block-picker__title" }, rs = /* @__PURE__ */ ae({
2006
2056
  __name: "BlockPicker",
2007
2057
  props: {
2008
2058
  catalog: {},
@@ -2013,134 +2063,134 @@ new Swiper(el.querySelector('.b-slider__viewport'), { loop: true })`
2013
2063
  blocksPath: { default: null }
2014
2064
  },
2015
2065
  setup(e) {
2016
- const n = e, { resolve: t, dismiss: s, open: a } = Mt();
2017
- He();
2066
+ const l = e, { resolve: t, dismiss: s, open: a } = It();
2067
+ qe();
2018
2068
  const i = de("webx-blocks"), o = I("");
2019
2069
  function r(v) {
2020
- if (n.parent === null)
2070
+ if (l.parent === null)
2021
2071
  return v.allowed_in === null || v.allowed_in.includes("root");
2022
- const g = n.allow ? n.allow.includes(v.slug) : n.parent.allow?.includes(v.slug) === !0, x = v.allowed_in === null || v.allowed_in.includes(n.parent.slug);
2072
+ const g = l.allow ? l.allow.includes(v.slug) : l.parent.allow?.includes(v.slug) === !0, x = v.allowed_in === null || v.allowed_in.includes(l.parent.slug);
2023
2073
  return g && x;
2024
2074
  }
2025
- const m = V(
2026
- () => n.catalog.filter((v) => v.is_enabled && v.published !== null && r(v)).map((v) => {
2027
- const g = Jl(n.tree, v.slug), x = v.max_per_entity !== null && g >= v.max_per_entity;
2075
+ const f = V(
2076
+ () => l.catalog.filter((v) => v.is_enabled && v.published !== null && r(v)).map((v) => {
2077
+ const g = tn(l.tree, v.slug), x = v.max_per_entity !== null && g >= v.max_per_entity;
2028
2078
  return { type: v, reason: x ? i("field.limit-reached", { count: g }) : null };
2029
2079
  })
2030
- ), c = V(() => {
2080
+ ), u = V(() => {
2031
2081
  const v = o.value.trim().toLowerCase();
2032
- return v === "" ? m.value : m.value.filter(
2082
+ return v === "" ? f.value : f.value.filter(
2033
2083
  ({ type: g }) => g.title.toLowerCase().includes(v) || g.slug.includes(v) || (g.description ?? "").toLowerCase().includes(v)
2034
2084
  );
2035
2085
  }), d = V(() => {
2036
- const v = [...n.groups];
2037
- for (const { type: T } of c.value)
2086
+ const v = [...l.groups];
2087
+ for (const { type: T } of u.value)
2038
2088
  v.includes(T.group) || v.push(T.group);
2039
2089
  const g = v.map((T) => ({
2040
2090
  id: T,
2041
- label: De(T, i),
2042
- options: c.value.filter((w) => w.type.group === T)
2091
+ label: ze(T, i),
2092
+ options: u.value.filter((w) => w.type.group === T)
2043
2093
  })).filter((T) => T.options.length > 0);
2044
- return c.value.length <= 5 || o.value.trim() !== "" || g.length < 2 ? [{ id: "", label: "", options: c.value }] : g;
2094
+ return u.value.length <= 5 || o.value.trim() !== "" || g.length < 2 ? [{ id: "", label: "", options: u.value }] : g;
2045
2095
  }), p = V(() => {
2046
- if (n.catalog.length === 0) return i("field.pick-none");
2047
- if (m.value.length === 0 && n.parent) {
2048
- const v = (n.allow ?? n.parent.allow ?? []).filter(
2049
- (g) => n.catalog.some((x) => x.slug === g)
2096
+ if (l.catalog.length === 0) return i("field.pick-none");
2097
+ if (f.value.length === 0 && l.parent) {
2098
+ const v = (l.allow ?? l.parent.allow ?? []).filter(
2099
+ (g) => l.catalog.some((x) => x.slug === g)
2050
2100
  );
2051
- return v.length === 0 ? i("field.pick-nothing-allowed", { parent: n.parent.title }) : i("field.pick-limited", { parent: n.parent.title, types: v.join(", ") });
2101
+ return v.length === 0 ? i("field.pick-nothing-allowed", { parent: l.parent.title }) : i("field.pick-limited", { parent: l.parent.title, types: v.join(", ") });
2052
2102
  }
2053
2103
  return i("field.pick-empty");
2054
2104
  });
2055
2105
  return (v, g) => {
2056
- const x = Vt("router-link");
2057
- return u(), M(l(Nt), {
2058
- open: l(a),
2059
- "onUpdate:open": g[2] || (g[2] = (T) => Bt(a) ? a.value = T : null),
2060
- title: l(i)("field.pick"),
2106
+ const x = At("router-link");
2107
+ return c(), N(n(Pt), {
2108
+ open: n(a),
2109
+ "onUpdate:open": g[2] || (g[2] = (T) => Lt(a) ? a.value = T : null),
2110
+ title: n(i)("field.pick"),
2061
2111
  width: 860
2062
2112
  }, {
2063
2113
  footer: b(() => [
2064
- f(l(ce), {
2114
+ m(n(ce), {
2065
2115
  variant: "outline",
2066
- onClick: g[1] || (g[1] = (T) => l(s)())
2116
+ onClick: g[1] || (g[1] = (T) => n(s)())
2067
2117
  }, {
2068
2118
  default: b(() => [
2069
- z(S(l(i)("field.close")), 1)
2119
+ M(S(n(i)("field.close")), 1)
2070
2120
  ]),
2071
2121
  _: 1
2072
2122
  })
2073
2123
  ]),
2074
2124
  default: b(() => [
2075
- B("div", Yn, [
2076
- m.value.length > 0 ? (u(), M(l(Oe), {
2125
+ A("div", ls, [
2126
+ f.value.length > 0 ? (c(), N(n(Ue), {
2077
2127
  key: 0,
2078
2128
  modelValue: o.value,
2079
2129
  "onUpdate:modelValue": g[0] || (g[0] = (T) => o.value = T),
2080
- placeholder: l(i)("field.search"),
2130
+ placeholder: n(i)("field.search"),
2081
2131
  clearable: "",
2082
2132
  autofocus: ""
2083
- }, null, 8, ["modelValue", "placeholder"])) : N("", !0),
2084
- c.value.length === 0 ? (u(), M(l(It), {
2133
+ }, null, 8, ["modelValue", "placeholder"])) : D("", !0),
2134
+ u.value.length === 0 ? (c(), N(n(Ot), {
2085
2135
  key: 1,
2086
2136
  icon: "grid",
2087
2137
  title: p.value,
2088
2138
  size: "sm"
2089
2139
  }, {
2090
2140
  default: b(() => [
2091
- e.catalog.length === 0 && e.blocksPath ? (u(), M(x, {
2141
+ e.catalog.length === 0 && e.blocksPath ? (c(), N(x, {
2092
2142
  key: 0,
2093
2143
  to: e.blocksPath
2094
2144
  }, {
2095
2145
  default: b(() => [
2096
- z(S(l(i)("field.pick-none-link")), 1)
2146
+ M(S(n(i)("field.pick-none-link")), 1)
2097
2147
  ]),
2098
2148
  _: 1
2099
- }, 8, ["to"])) : N("", !0)
2149
+ }, 8, ["to"])) : D("", !0)
2100
2150
  ]),
2101
2151
  _: 1
2102
- }, 8, ["title"])) : N("", !0),
2103
- (u(!0), C(F, null, le(d.value, (T) => (u(), C("section", {
2152
+ }, 8, ["title"])) : D("", !0),
2153
+ (c(!0), C(F, null, le(d.value, (T) => (c(), C("section", {
2104
2154
  key: T.id,
2105
2155
  class: "wx-block-picker__group"
2106
2156
  }, [
2107
- T.label ? (u(), C("div", Jn, S(T.label), 1)) : N("", !0),
2108
- B("div", Gn, [
2109
- (u(!0), C(F, null, le(T.options, (w) => (u(), C("button", {
2157
+ T.label ? (c(), C("div", ns, S(T.label), 1)) : D("", !0),
2158
+ A("div", ss, [
2159
+ (c(!0), C(F, null, le(T.options, (w) => (c(), C("button", {
2110
2160
  key: w.type.id,
2111
2161
  type: "button",
2112
2162
  class: $e(["wx-block-picker__card", { "is-disabled": w.reason !== null }]),
2113
2163
  disabled: w.reason !== null,
2114
2164
  title: w.reason ?? void 0,
2115
- onClick: (y) => l(t)(w.type)
2165
+ onClick: (y) => n(t)(w.type)
2116
2166
  }, [
2117
- f(tl, {
2167
+ m(sl, {
2118
2168
  thumbnail: w.type.thumbnail,
2119
2169
  height: 96
2120
2170
  }, null, 8, ["thumbnail"]),
2121
- B("div", Qn, [
2122
- B("div", Xn, S(w.type.title), 1),
2123
- w.reason ? (u(), M(l(q), {
2171
+ A("div", as, [
2172
+ A("div", is, S(w.type.title), 1),
2173
+ w.reason ? (c(), N(n(q), {
2124
2174
  key: 0,
2125
2175
  size: "sm",
2126
2176
  tone: "warning"
2127
2177
  }, {
2128
2178
  default: b(() => [
2129
- z(S(w.reason), 1)
2179
+ M(S(w.reason), 1)
2130
2180
  ]),
2131
2181
  _: 2
2132
- }, 1024)) : w.type.description ? (u(), M(l(q), {
2182
+ }, 1024)) : w.type.description ? (c(), N(n(q), {
2133
2183
  key: 1,
2134
2184
  size: "sm",
2135
2185
  tone: "muted"
2136
2186
  }, {
2137
2187
  default: b(() => [
2138
- z(S(w.type.description), 1)
2188
+ M(S(w.type.description), 1)
2139
2189
  ]),
2140
2190
  _: 2
2141
- }, 1024)) : N("", !0)
2191
+ }, 1024)) : D("", !0)
2142
2192
  ])
2143
- ], 10, Zn))), 128))
2193
+ ], 10, os))), 128))
2144
2194
  ])
2145
2195
  ]))), 128))
2146
2196
  ])
@@ -2149,7 +2199,7 @@ new Swiper(el.querySelector('.b-slider__viewport'), { loop: true })`
2149
2199
  }, 8, ["open", "title"]);
2150
2200
  };
2151
2201
  }
2152
- }), ts = /* @__PURE__ */ ie(es, [["__scopeId", "data-v-99f4090e"]]), ls = { class: "wx-blocks-preview__tools" }, ns = ["src", "title"], ss = /* @__PURE__ */ ae({
2202
+ }), us = /* @__PURE__ */ ie(rs, [["__scopeId", "data-v-99f4090e"]]), cs = { class: "wx-blocks-preview__tools" }, ds = ["src", "title"], ps = /* @__PURE__ */ ae({
2153
2203
  __name: "BlocksPreview",
2154
2204
  props: {
2155
2205
  url: {},
@@ -2158,12 +2208,12 @@ new Swiper(el.querySelector('.b-slider__viewport'), { loop: true })`
2158
2208
  compact: { type: Boolean, default: !1 }
2159
2209
  },
2160
2210
  emits: ["select", "edit"],
2161
- setup(e, { expose: n, emit: t }) {
2162
- const s = e, a = t, i = de("webx-blocks"), o = I(null), r = I(null), m = I(null), c = Xe(m), d = I(!1), p = I(!1), v = I(null), g = I(0), x = V(() => g.value > 0), T = V(() => [
2211
+ setup(e, { expose: l, emit: t }) {
2212
+ const s = e, a = t, i = de("webx-blocks"), o = I(null), r = I(null), f = I(null), u = et(f), d = I(!1), p = I(!1), v = I(null), g = I(0), x = V(() => g.value > 0), T = V(() => [
2163
2213
  { value: 1280, icon: "monitor", ariaLabel: i("field.width-desktop") },
2164
2214
  { value: 834, icon: "tablet", ariaLabel: i("field.width-tablet") },
2165
2215
  { value: 390, icon: "smartphone", ariaLabel: i("field.width-phone") }
2166
- ]), w = V(() => v.value !== null ? v.value : s.compact ? c.value > 0 && c.value < 560 ? 390 : 834 : 1280), y = V(() => c.value === 0 ? 1 : Math.min(1, c.value / w.value)), _ = V(() => ({
2216
+ ]), w = V(() => v.value !== null ? v.value : s.compact ? u.value > 0 && u.value < 560 ? 390 : 834 : 1280), y = V(() => u.value === 0 ? 1 : Math.min(1, u.value / w.value)), _ = V(() => ({
2167
2217
  width: `${w.value}px`,
2168
2218
  transform: `scale(${y.value})`,
2169
2219
  ...x.value ? { height: `${g.value}px` } : {}
@@ -2186,15 +2236,15 @@ new Swiper(el.querySelector('.b-slider__viewport'), { loop: true })`
2186
2236
  }
2187
2237
  }
2188
2238
  let X = null, h = null;
2189
- function A(W) {
2239
+ function L(W) {
2190
2240
  W.documentElement.scrollTop !== 0 && (W.documentElement.scrollTop = 0);
2191
2241
  }
2192
2242
  function P() {
2193
2243
  const W = Y(), O = W?.body;
2194
2244
  if (!O || !W?.defaultView) return;
2195
- A(W);
2245
+ L(W);
2196
2246
  const j = W.defaultView.getComputedStyle(O), G = (parseFloat(j.marginTop) || 0) + (parseFloat(j.marginBottom) || 0), fe = Math.ceil(O.scrollHeight + G);
2197
- fe !== g.value && (g.value = fe, ne !== null && ol(() => requestAnimationFrame(Q)));
2247
+ fe !== g.value && (g.value = fe, ne !== null && ul(() => requestAnimationFrame(Q)));
2198
2248
  }
2199
2249
  function J(W) {
2200
2250
  h?.disconnect();
@@ -2204,12 +2254,12 @@ new Swiper(el.querySelector('.b-slider__viewport'), { loop: true })`
2204
2254
  function Se() {
2205
2255
  p.value = !0;
2206
2256
  const W = Y();
2207
- W && (J(W), X?.release(), X = Pl(W, {
2257
+ W && (J(W), X?.release(), X = Rl(W, {
2208
2258
  /* No guard against answering a click with a scroll: `bring` moves nothing that is already
2209
2259
  readable, and a block clicked at the very bottom of the window, half under the action
2210
2260
  bar, is exactly the one worth moving. */
2211
2261
  select: (O) => a("select", O)
2212
- }), st(W, s.selected ?? null), ye(s.selected ?? null));
2262
+ }), ot(W, s.selected ?? null), ye(s.selected ?? null));
2213
2263
  }
2214
2264
  let ne = null, pe = null;
2215
2265
  function ye(W) {
@@ -2236,20 +2286,20 @@ new Swiper(el.querySelector('.b-slider__viewport'), { loop: true })`
2236
2286
  function Q() {
2237
2287
  const W = Y();
2238
2288
  if (ne === null || !W) return;
2239
- A(W);
2240
- const O = ct(W, ne), j = O ? Ee(O) : null;
2289
+ L(W);
2290
+ const O = pt(W, ne), j = O ? Ee(O) : null;
2241
2291
  if (!j) return;
2242
2292
  const G = Te(), fe = G?.getBoundingClientRect(), we = r.value?.getBoundingClientRect().height ?? 0, se = {
2243
2293
  top: (fe?.top ?? 0) + we,
2244
2294
  bottom: (fe ? fe.bottom : window.innerHeight) - we
2245
- }, ve = j.top + j.height, Ve = j.top < se.top, Me = j.height > se.bottom - se.top, $ = Ve || Me ? j.top - se.top : ve > se.bottom ? ve - se.bottom : 0;
2295
+ }, me = j.top + j.height, Ve = j.top < se.top, Ne = j.height > se.bottom - se.top, $ = Ve || Ne ? j.top - se.top : me > se.bottom ? me - se.bottom : 0;
2246
2296
  $ !== 0 && (G ?? window).scrollBy({ top: $, behavior: "smooth" });
2247
2297
  }
2248
2298
  function ke(W, O) {
2249
2299
  const j = Y();
2250
2300
  if (!j || !p.value) return !1;
2251
- const G = Rt(j, W, O);
2252
- return G && st(j, s.selected ?? null), G;
2301
+ const G = Ft(j, W, O);
2302
+ return G && ot(j, s.selected ?? null), G;
2253
2303
  }
2254
2304
  function Ce() {
2255
2305
  p.value = !1, h?.disconnect(), h = null, o.value && s.url && (o.value.src = s.url);
@@ -2261,96 +2311,96 @@ new Swiper(el.querySelector('.b-slider__viewport'), { loop: true })`
2261
2311
  () => s.selected,
2262
2312
  (W) => {
2263
2313
  const O = Y();
2264
- !O || !p.value || (st(O, W ?? null), ye(W ?? null));
2314
+ !O || !p.value || (ot(O, W ?? null), ye(W ?? null));
2265
2315
  }
2266
2316
  ), te(() => s.reload, Ce), te(
2267
2317
  () => s.url,
2268
2318
  () => p.value = !1
2269
- ), Ue(() => window.addEventListener("keydown", ge)), Qe(() => {
2319
+ ), Re(() => window.addEventListener("keydown", ge)), Xe(() => {
2270
2320
  window.removeEventListener("keydown", ge), pe !== null && clearTimeout(pe), h?.disconnect(), X?.release();
2271
- }), n({ replace: ke, refresh: Ce, open: () => d.value = !0 }), (W, O) => (u(), C("div", {
2321
+ }), l({ replace: ke, refresh: Ce, open: () => d.value = !0 }), (W, O) => (c(), C("div", {
2272
2322
  class: $e(["wx-blocks-preview", { "is-fullscreen": d.value, "is-grown": x.value, "is-compact": e.compact }]),
2273
2323
  style: xe({ "--wx-preview-scale": y.value })
2274
2324
  }, [
2275
- B("div", {
2325
+ A("div", {
2276
2326
  ref_key: "bar",
2277
2327
  ref: r,
2278
2328
  class: "wx-blocks-preview__bar"
2279
2329
  }, [
2280
- f(l(q), {
2330
+ m(n(q), {
2281
2331
  size: "xs",
2282
2332
  tone: "muted",
2283
2333
  class: "wx-blocks-preview__label",
2284
2334
  truncate: ""
2285
2335
  }, {
2286
2336
  default: b(() => [
2287
- z(S(K.value), 1)
2337
+ M(S(K.value), 1)
2288
2338
  ]),
2289
2339
  _: 1
2290
2340
  }),
2291
- f(l(Wt), {
2341
+ m(n(zt), {
2292
2342
  class: "wx-blocks-preview__widths",
2293
2343
  "model-value": w.value,
2294
2344
  options: T.value,
2295
2345
  size: "sm",
2296
- "aria-label": l(i)("field.width"),
2346
+ "aria-label": n(i)("field.width"),
2297
2347
  "onUpdate:modelValue": O[0] || (O[0] = (j) => v.value = Number(j))
2298
2348
  }, null, 8, ["model-value", "options", "aria-label"]),
2299
- B("div", ls, [
2300
- e.compact ? (u(), M(l(Ne), {
2349
+ A("div", cs, [
2350
+ e.compact ? (c(), N(n(Ie), {
2301
2351
  key: 0,
2302
2352
  size: "sm",
2303
2353
  tone: "primary",
2304
2354
  icon: "edit",
2305
- title: l(i)("field.blocks"),
2355
+ title: n(i)("field.blocks"),
2306
2356
  onClick: O[1] || (O[1] = (j) => a("edit"))
2307
- }, null, 8, ["title"])) : N("", !0),
2308
- e.url ? (u(), M(l(Ne), {
2357
+ }, null, 8, ["title"])) : D("", !0),
2358
+ e.url ? (c(), N(n(Ie), {
2309
2359
  key: 1,
2310
2360
  size: "sm",
2311
2361
  icon: "external-link",
2312
2362
  tone: "neutral",
2313
- title: l(i)("field.open-site"),
2363
+ title: n(i)("field.open-site"),
2314
2364
  href: e.url,
2315
2365
  target: "_blank",
2316
2366
  rel: "noopener"
2317
- }, null, 8, ["title", "href"])) : N("", !0),
2318
- f(l(Ne), {
2367
+ }, null, 8, ["title", "href"])) : D("", !0),
2368
+ m(n(Ie), {
2319
2369
  size: "sm",
2320
2370
  icon: d.value ? "minimize" : "maximize",
2321
2371
  tone: "neutral",
2322
- title: d.value ? l(i)("field.close") : l(i)("field.fullscreen"),
2372
+ title: d.value ? n(i)("field.close") : n(i)("field.fullscreen"),
2323
2373
  onClick: O[2] || (O[2] = (j) => d.value = !d.value)
2324
2374
  }, null, 8, ["icon", "title"])
2325
2375
  ])
2326
2376
  ], 512),
2327
- B("div", {
2377
+ A("div", {
2328
2378
  ref_key: "box",
2329
- ref: m,
2379
+ ref: f,
2330
2380
  class: "wx-blocks-preview__ground"
2331
2381
  }, [
2332
- B("div", {
2382
+ A("div", {
2333
2383
  class: "wx-blocks-preview__clip",
2334
2384
  style: xe(R.value)
2335
2385
  }, [
2336
- e.url ? (u(), C("iframe", {
2386
+ e.url ? (c(), C("iframe", {
2337
2387
  key: 0,
2338
2388
  ref_key: "frame",
2339
2389
  ref: o,
2340
2390
  class: "wx-blocks-preview__frame",
2341
2391
  src: e.url,
2342
2392
  style: xe(_.value),
2343
- title: l(i)("field.preview"),
2393
+ title: n(i)("field.preview"),
2344
2394
  onLoad: Se
2345
- }, null, 44, ns)) : N("", !0)
2395
+ }, null, 44, ds)) : D("", !0)
2346
2396
  ], 4)
2347
2397
  ], 512)
2348
2398
  ], 6));
2349
2399
  }
2350
- }), os = /* @__PURE__ */ ie(ss, [["__scopeId", "data-v-398e4cef"]]), as = { class: "wx-blocks-tree__node" }, is = ["onClick", "onKeydown"], rs = { class: "wx-blocks-tree__name" }, us = ["title"], cs = ["title"], ds = ["title"], ps = ["title"], fs = {
2400
+ }), fs = /* @__PURE__ */ ie(ps, [["__scopeId", "data-v-398e4cef"]]), ms = { class: "wx-blocks-tree__node" }, vs = ["onClick", "onKeydown"], hs = { class: "wx-blocks-tree__name" }, bs = ["title"], gs = ["title"], ys = ["title"], ks = ["title"], ws = {
2351
2401
  key: 4,
2352
2402
  class: "wx-blocks-tree__actions"
2353
- }, vs = ["onClick"], ms = /* @__PURE__ */ ae({
2403
+ }, _s = ["onClick"], xs = /* @__PURE__ */ ae({
2354
2404
  __name: "BlocksTree",
2355
2405
  props: {
2356
2406
  nodes: {},
@@ -2362,8 +2412,8 @@ new Swiper(el.querySelector('.b-slider__viewport'), { loop: true })`
2362
2412
  depth: { default: 0 }
2363
2413
  },
2364
2414
  emits: ["select", "add", "remove", "duplicate", "visibility", "reorder"],
2365
- setup(e, { emit: n }) {
2366
- const t = e, s = n, a = de("webx-blocks");
2415
+ setup(e, { emit: l }) {
2416
+ const t = e, s = l, a = de("webx-blocks");
2367
2417
  function i(d) {
2368
2418
  return t.catalog.find((p) => p.slug === d.type) ?? null;
2369
2419
  }
@@ -2372,13 +2422,13 @@ new Swiper(el.querySelector('.b-slider__viewport'), { loop: true })`
2372
2422
  }
2373
2423
  function r(d) {
2374
2424
  const p = i(d);
2375
- return p?.content ? qt(p.content.schema) : [];
2425
+ return p?.content ? Jt(p.content.schema) : [];
2376
2426
  }
2377
- function m(d, p) {
2427
+ function f(d, p) {
2378
2428
  const v = d.values[p.id];
2379
2429
  return Array.isArray(v) ? v : [];
2380
2430
  }
2381
- function c(d) {
2431
+ function u(d) {
2382
2432
  return [
2383
2433
  {
2384
2434
  key: "visibility",
@@ -2402,70 +2452,70 @@ new Swiper(el.querySelector('.b-slider__viewport'), { loop: true })`
2402
2452
  ];
2403
2453
  }
2404
2454
  return (d, p) => {
2405
- const v = Vt("blocks-tree", !0);
2406
- return u(), M(l(Sl), {
2455
+ const v = At("blocks-tree", !0);
2456
+ return c(), N(n(Cl), {
2407
2457
  "model-value": e.nodes,
2408
2458
  "item-key": "key",
2409
2459
  "item-label": (g) => o(g),
2410
2460
  disabled: e.disabled,
2411
2461
  plain: "",
2412
2462
  size: "sm",
2413
- "empty-text": e.depth === 0 ? l(a)("field.empty") : "",
2463
+ "empty-text": e.depth === 0 ? n(a)("field.empty") : "",
2414
2464
  class: $e(["wx-blocks-tree", { "is-nested": e.depth > 0 }]),
2415
2465
  "onUpdate:modelValue": p[6] || (p[6] = (g) => s("reorder", e.parentKey, e.field, g))
2416
2466
  }, {
2417
2467
  default: b(({ item: g }) => [
2418
- B("div", as, [
2419
- B("div", {
2468
+ A("div", ms, [
2469
+ A("div", {
2420
2470
  class: $e(["wx-blocks-tree__row", { "is-selected": e.selected === g.key, "is-hidden": g.hidden === !0 }]),
2421
2471
  role: "button",
2422
2472
  tabindex: "0",
2423
2473
  onClick: (x) => s("select", g.key),
2424
2474
  onKeydown: [
2425
- vt(mt((x) => s("select", g.key), ["prevent"]), ["enter"]),
2426
- vt(mt((x) => s("select", g.key), ["prevent"]), ["space"])
2475
+ ht(bt((x) => s("select", g.key), ["prevent"]), ["enter"]),
2476
+ ht(bt((x) => s("select", g.key), ["prevent"]), ["space"])
2427
2477
  ]
2428
2478
  }, [
2429
- B("span", rs, S(o(g)), 1),
2430
- i(g) ? i(g)?.draft ? (u(), C("span", {
2479
+ A("span", hs, S(o(g)), 1),
2480
+ i(g) ? i(g)?.draft ? (c(), C("span", {
2431
2481
  key: 1,
2432
2482
  class: "wx-blocks-tree__flag is-warning",
2433
- title: l(a)("field.draft-type")
2483
+ title: n(a)("field.draft-type")
2434
2484
  }, [
2435
- f(l(he), { name: "warning" })
2436
- ], 8, cs)) : i(g)?.is_enabled === !1 ? (u(), C("span", {
2485
+ m(n(he), { name: "warning" })
2486
+ ], 8, gs)) : i(g)?.is_enabled === !1 ? (c(), C("span", {
2437
2487
  key: 2,
2438
2488
  class: "wx-blocks-tree__flag",
2439
- title: l(a)("field.disabled-type")
2489
+ title: n(a)("field.disabled-type")
2440
2490
  }, [
2441
- f(l(he), { name: "lock" })
2442
- ], 8, ds)) : N("", !0) : (u(), C("span", {
2491
+ m(n(he), { name: "lock" })
2492
+ ], 8, ys)) : D("", !0) : (c(), C("span", {
2443
2493
  key: 0,
2444
2494
  class: "wx-blocks-tree__flag is-danger",
2445
- title: l(a)("field.unknown-type", { type: g.type })
2495
+ title: n(a)("field.unknown-type", { type: g.type })
2446
2496
  }, [
2447
- f(l(he), { name: "close-circle" })
2448
- ], 8, us)),
2449
- g.hidden === !0 ? (u(), C("span", {
2497
+ m(n(he), { name: "close-circle" })
2498
+ ], 8, bs)),
2499
+ g.hidden === !0 ? (c(), C("span", {
2450
2500
  key: 3,
2451
2501
  class: "wx-blocks-tree__flag",
2452
- title: l(a)("field.hidden-note")
2502
+ title: n(a)("field.hidden-note")
2453
2503
  }, [
2454
- f(l(he), { name: "eye-off" })
2455
- ], 8, ps)) : N("", !0),
2456
- e.disabled ? N("", !0) : (u(), C("span", fs, [
2457
- f(l(hl), {
2458
- actions: c(g),
2504
+ m(n(he), { name: "eye-off" })
2505
+ ], 8, ks)) : D("", !0),
2506
+ e.disabled ? D("", !0) : (c(), C("span", ws, [
2507
+ m(n(kl), {
2508
+ actions: u(g),
2459
2509
  label: o(g)
2460
2510
  }, null, 8, ["actions", "label"])
2461
2511
  ]))
2462
- ], 42, is),
2463
- (u(!0), C(F, null, le(r(g), (x) => (u(), C("div", {
2512
+ ], 42, vs),
2513
+ (c(!0), C(F, null, le(r(g), (x) => (c(), C("div", {
2464
2514
  key: x.id,
2465
2515
  class: "wx-blocks-tree__kids"
2466
2516
  }, [
2467
- f(v, {
2468
- nodes: m(g, x),
2517
+ m(v, {
2518
+ nodes: f(g, x),
2469
2519
  catalog: e.catalog,
2470
2520
  "parent-key": g.key,
2471
2521
  field: x.id,
@@ -2479,17 +2529,17 @@ new Swiper(el.querySelector('.b-slider__viewport'), { loop: true })`
2479
2529
  onVisibility: p[4] || (p[4] = (T, w) => s("visibility", T, w)),
2480
2530
  onReorder: p[5] || (p[5] = (T, w, y) => s("reorder", T, w, y))
2481
2531
  }, null, 8, ["nodes", "catalog", "parent-key", "field", "selected", "disabled", "depth"]),
2482
- e.disabled ? N("", !0) : (u(), C("button", {
2532
+ e.disabled ? D("", !0) : (c(), C("button", {
2483
2533
  key: 0,
2484
2534
  type: "button",
2485
2535
  class: "wx-blocks-tree__add is-inner",
2486
2536
  onClick: (T) => s("add", g.key, x.id, x)
2487
2537
  }, [
2488
- z(" + " + S(l(a)("field.add-inside")), 1),
2489
- r(g).length > 1 ? (u(), C(F, { key: 0 }, [
2490
- z(" · " + S(x.label ?? x.id), 1)
2491
- ], 64)) : N("", !0)
2492
- ], 8, vs))
2538
+ M(" + " + S(n(a)("field.add-inside")), 1),
2539
+ r(g).length > 1 ? (c(), C(F, { key: 0 }, [
2540
+ M(" · " + S(x.label ?? x.id), 1)
2541
+ ], 64)) : D("", !0)
2542
+ ], 8, _s))
2493
2543
  ]))), 128))
2494
2544
  ])
2495
2545
  ]),
@@ -2497,33 +2547,33 @@ new Swiper(el.querySelector('.b-slider__viewport'), { loop: true })`
2497
2547
  }, 8, ["model-value", "item-label", "disabled", "empty-text", "class"]);
2498
2548
  };
2499
2549
  }
2500
- }), hs = /* @__PURE__ */ ie(ms, [["__scopeId", "data-v-590fa1d6"]]), ft = /* @__PURE__ */ Symbol("wx-blocks-preview");
2501
- function no(e) {
2502
- At(ft, e);
2550
+ }), $s = /* @__PURE__ */ ie(xs, [["__scopeId", "data-v-590fa1d6"]]), vt = /* @__PURE__ */ Symbol("wx-blocks-preview");
2551
+ function po(e) {
2552
+ Bt(vt, e);
2503
2553
  }
2504
- function so() {
2505
- return Ye(ft, null);
2554
+ function fo() {
2555
+ return De(vt, null);
2506
2556
  }
2507
- const Ct = /* @__PURE__ */ Symbol("wx-blocks-root"), bs = {
2557
+ const Vt = /* @__PURE__ */ Symbol("wx-blocks-root"), Ss = {
2508
2558
  key: 0,
2509
2559
  class: "wx-blocks-nested"
2510
- }, gs = {
2560
+ }, Es = {
2511
2561
  key: 0,
2512
2562
  class: "wx-blocks__tree"
2513
- }, ys = { class: "wx-blocks__panel-head" }, ks = { class: "wx-blocks__panel-title" }, ws = { class: "wx-blocks__tools" }, _s = {
2563
+ }, Ts = { class: "wx-blocks__panel-head" }, Cs = { class: "wx-blocks__panel-title" }, Vs = { class: "wx-blocks__tools" }, As = {
2514
2564
  key: 1,
2515
2565
  class: "wx-blocks__fields"
2516
- }, xs = { class: "wx-blocks__panel-head" }, $s = { class: "wx-blocks__panel-title" }, Ss = {
2566
+ }, Ls = { class: "wx-blocks__panel-head" }, Bs = { class: "wx-blocks__panel-title" }, Ws = {
2517
2567
  key: 0,
2518
2568
  class: "wx-blocks__trail"
2519
- }, Es = ["onClick"], Ts = { class: "wx-blocks__panel-name" }, Cs = { class: "wx-blocks__panel-extra" }, Vs = { key: 0 }, Bs = { class: "wx-blocks__form" }, As = {
2569
+ }, Ms = ["onClick"], zs = { class: "wx-blocks__panel-name" }, Ns = { class: "wx-blocks__panel-extra" }, Ds = { key: 0 }, Is = { class: "wx-blocks__form" }, Ps = {
2520
2570
  key: 0,
2521
2571
  class: "wx-blocks__preview"
2522
- }, Ls = /* @__PURE__ */ ae({
2572
+ }, Os = /* @__PURE__ */ ae({
2523
2573
  name: "WxBlocks",
2524
2574
  inheritAttrs: !1,
2525
2575
  __name: "BlocksField",
2526
- props: /* @__PURE__ */ cl({
2576
+ props: /* @__PURE__ */ ml({
2527
2577
  node: { default: void 0 },
2528
2578
  context: { default: void 0 },
2529
2579
  name: { default: void 0 },
@@ -2539,19 +2589,19 @@ const Ct = /* @__PURE__ */ Symbol("wx-blocks-root"), bs = {
2539
2589
  }),
2540
2590
  emits: ["update:modelValue"],
2541
2591
  setup(e) {
2542
- const n = e, t = al(e, "modelValue"), s = Ye(Ct, !1);
2543
- At(Ct, !0), He();
2544
- const a = de("webx-blocks"), i = je(), o = Ye(bl, null);
2592
+ const l = e, t = cl(e, "modelValue"), s = De(Vt, !1);
2593
+ Bt(Vt, !0), qe();
2594
+ const a = de("webx-blocks"), i = Fe(), o = De(Mt, null);
2545
2595
  let r = null;
2546
- const m = I([]), c = V(() => n.catalog ?? m.value), d = V(() => Array.isArray(t.value) ? t.value : []), p = I(null), v = V(() => p.value ? re(d.value, p.value) : null), g = V(
2547
- () => v.value ? c.value.find(($) => $.slug === v.value?.node.type) ?? null : null
2596
+ const f = I([]), u = V(() => l.catalog ?? f.value), d = V(() => Array.isArray(t.value) ? t.value : []), p = I(null), v = V(() => p.value ? re(d.value, p.value) : null), g = V(
2597
+ () => v.value ? u.value.find(($) => $.slug === v.value?.node.type) ?? null : null
2548
2598
  );
2549
2599
  function x($) {
2550
- return c.value.find((D) => D.slug === $.type)?.title ?? $.type;
2600
+ return u.value.find((z) => z.slug === $.type)?.title ?? $.type;
2551
2601
  }
2552
2602
  const T = V(() => {
2553
2603
  const $ = [];
2554
- return Fe(d.value, (D) => $.push(D.key)), $;
2604
+ return He(d.value, (z) => $.push(z.key)), $;
2555
2605
  }), w = V(() => {
2556
2606
  const $ = p.value ? T.value.indexOf(p.value) : -1;
2557
2607
  return {
@@ -2560,14 +2610,14 @@ const Ct = /* @__PURE__ */ Symbol("wx-blocks-root"), bs = {
2560
2610
  };
2561
2611
  }), y = V(() => {
2562
2612
  const $ = [];
2563
- let D = v.value?.parent ?? null;
2564
- for (; D; )
2565
- $.unshift({ key: D.key, title: x(D) }), D = re(d.value, D.key)?.parent ?? null;
2613
+ let z = v.value?.parent ?? null;
2614
+ for (; z; )
2615
+ $.unshift({ key: z.key, title: x(z) }), z = re(d.value, z.key)?.parent ?? null;
2566
2616
  return $;
2567
- }), _ = Ye(ft, null), R = I(null), K = I(null), Y = Xe(K), X = V(() => _ !== null && _.url.value !== null), h = V(() => X.value && Y.value > 0 && Y.value <= 900), A = I(!1), P = V(() => {
2617
+ }), _ = De(vt, null), R = I(null), K = I(null), Y = et(K), X = V(() => _ !== null && _.url.value !== null), h = V(() => X.value && Y.value > 0 && Y.value <= 900), L = I(!1), P = V(() => {
2568
2618
  if (!v.value) return;
2569
2619
  const $ = g.value?.title ?? v.value.node.type;
2570
- return [...y.value.map((D) => D.title), $].join(" / ");
2620
+ return [...y.value.map((z) => z.title), $].join(" / ");
2571
2621
  }), J = V(
2572
2622
  () => h.value ? {
2573
2623
  /* Up from the bottom, and not all the way: the strip of page left above it is what
@@ -2587,83 +2637,83 @@ const Ct = /* @__PURE__ */ Symbol("wx-blocks-root"), bs = {
2587
2637
  in the column is part of the heading this replaces. The tree keeps its own heading,
2588
2638
  which already says what it is and how many. */
2589
2639
  title: P.value,
2590
- open: A.value,
2591
- "onUpdate:open": ($) => A.value = $
2640
+ open: L.value,
2641
+ "onUpdate:open": ($) => L.value = $
2592
2642
  } : {}
2593
2643
  ), Se = V(
2594
2644
  () => o?.state.manifest?.modules.find(($) => $.id === "blocks")?.meta?.groups ?? []
2595
- ), ne = il()?.type, pe = V(() => n.context?.types ? n.context.types : o?.types ? { ...Je, ...o.types } : ne ? { ...Je, "wx-blocks": { component: ne, kind: "field", nested: !0 } } : Je), ye = V(
2596
- () => n.context?.translate ?? o?.i18n.t ?? (($) => $)
2597
- ), Ee = V(() => n.context?.can ?? o?.can ?? (() => !0)), Te = Pt(ts);
2645
+ ), ne = dl()?.type, pe = V(() => l.context?.types ? l.context.types : o?.types ? { ...Je, ...o.types } : ne ? { ...Je, "wx-blocks": { component: ne, kind: "field", nested: !0 } } : Je), ye = V(
2646
+ () => l.context?.translate ?? o?.i18n.t ?? (($) => $)
2647
+ ), Ee = V(() => l.context?.can ?? o?.can ?? (() => !0)), Te = Ut(us);
2598
2648
  function Q($) {
2599
2649
  t.value = $;
2600
2650
  }
2601
- async function ke($, D, U) {
2602
- const H = $ ? re(d.value, $) : null, ee = H ? c.value.find((ll) => ll.slug === H.node.type) ?? null : null, tt = $ === null ? n.allow : U?.props?.allow ?? null, L = $ === null ? n.max : U?.props?.max ?? null, k = $ === null ? d.value : H && D ? H.node.values[D] ?? [] : [];
2603
- if (L != null && k.length >= L) return;
2651
+ async function ke($, z, U) {
2652
+ const H = $ ? re(d.value, $) : null, ee = H ? u.value.find((ol) => ol.slug === H.node.type) ?? null : null, lt = $ === null ? l.allow : U?.props?.allow ?? null, B = $ === null ? l.max : U?.props?.max ?? null, k = $ === null ? d.value : H && z ? H.node.values[z] ?? [] : [];
2653
+ if (B != null && k.length >= B) return;
2604
2654
  const E = await Te({
2605
- catalog: c.value,
2655
+ catalog: u.value,
2606
2656
  parent: ee,
2607
- allow: tt,
2657
+ allow: lt,
2608
2658
  tree: d.value,
2609
2659
  groups: Se.value,
2610
- blocksPath: n.blocksPath
2660
+ blocksPath: l.blocksPath
2611
2661
  });
2612
2662
  if (!E) return;
2613
- const lt = Yl(E.slug, Ce(E));
2614
- Q($t(d.value, $, D, k.length, lt)), p.value = lt.key;
2663
+ const nt = en(E.slug, Ce(E));
2664
+ Q($t(d.value, $, z, k.length, nt)), p.value = nt.key;
2615
2665
  }
2616
2666
  function Ce($) {
2617
- const D = $.content?.sample ?? {}, U = {};
2618
- for (const [H, ee] of Object.entries(D))
2667
+ const z = $.content?.sample ?? {}, U = {};
2668
+ for (const [H, ee] of Object.entries(z))
2619
2669
  (!Array.isArray(ee) || ee.length === 0 || typeof ee[0] != "object") && (U[H] = ee);
2620
2670
  return U;
2621
2671
  }
2622
2672
  async function ge($) {
2623
- const D = re(d.value, $);
2624
- if (!D) return;
2625
- const U = Gl(D.node);
2626
- await Ze({
2673
+ const z = re(d.value, $);
2674
+ if (!z) return;
2675
+ const U = ln(z.node);
2676
+ await Qe({
2627
2677
  title: a("field.remove-title", {
2628
- title: c.value.find((ee) => ee.slug === D.node.type)?.title ?? D.node.type
2678
+ title: u.value.find((ee) => ee.slug === z.node.type)?.title ?? z.node.type
2629
2679
  }),
2630
2680
  message: U > 0 ? a("field.remove-text", { count: U }) : a("field.remove-alone"),
2631
2681
  confirmText: a("field.remove"),
2632
2682
  cancelText: a("page.cancel"),
2633
2683
  tone: "danger"
2634
- }) && (p.value === $ && (p.value = null), Q(Xl(d.value, $)));
2684
+ }) && (p.value === $ && (p.value = null), Q(on(d.value, $)));
2635
2685
  }
2636
2686
  function W($) {
2637
- const D = re(d.value, $);
2638
- if (!D) return;
2639
- const U = Kt(D.node);
2640
- Q($t(d.value, D.parent?.key ?? null, D.field, D.index + 1, U)), p.value = U.key;
2687
+ const z = re(d.value, $);
2688
+ if (!z) return;
2689
+ const U = Gt(z.node);
2690
+ Q($t(d.value, z.parent?.key ?? null, z.field, z.index + 1, U)), p.value = U.key;
2641
2691
  }
2642
- function O($, D) {
2643
- Q(Zl(d.value, $, D));
2692
+ function O($, z) {
2693
+ Q(nn(d.value, $, z));
2644
2694
  }
2645
- function j($, D, U) {
2646
- Q(tn(d.value, $, D, U));
2695
+ function j($, z, U) {
2696
+ Q(rn(d.value, $, z, U));
2647
2697
  }
2648
2698
  function G($) {
2649
2699
  p.value = p.value === $ ? null : $;
2650
2700
  }
2651
2701
  function fe($) {
2652
- $ === null || !re(d.value, $) || (p.value = $, h.value && (A.value = !0));
2702
+ $ === null || !re(d.value, $) || (p.value = $, h.value && (L.value = !0));
2653
2703
  }
2654
2704
  function we() {
2655
2705
  p.value = null;
2656
2706
  }
2657
2707
  function se($) {
2658
- p.value && Q(en(d.value, p.value, $));
2708
+ p.value && Q(an(d.value, p.value, $));
2659
2709
  }
2660
- let ve;
2710
+ let me;
2661
2711
  te(
2662
2712
  () => v.value?.node.values,
2663
- ($, D) => {
2664
- if (!$ || !D || !g.value || !r || !_) return;
2713
+ ($, z) => {
2714
+ if (!$ || !z || !g.value || !r || !_) return;
2665
2715
  const U = p.value, H = g.value.id;
2666
- clearTimeout(ve), ve = setTimeout(() => {
2716
+ clearTimeout(me), me = setTimeout(() => {
2667
2717
  !U || !r || r.render(H, { values: $, key: U }).then((ee) => {
2668
2718
  R.value?.replace(U, ee.html) || R.value?.refresh();
2669
2719
  }).catch(() => {
@@ -2675,61 +2725,61 @@ const Ct = /* @__PURE__ */ Symbol("wx-blocks-root"), bs = {
2675
2725
  function Ve($) {
2676
2726
  $.key === "Escape" && p.value && we();
2677
2727
  }
2678
- Ue(async () => {
2679
- if (window.addEventListener("keydown", Ve), n.catalog === null && o) {
2680
- r = ze(o);
2728
+ Re(async () => {
2729
+ if (window.addEventListener("keydown", Ve), l.catalog === null && o) {
2730
+ r = Me(o);
2681
2731
  try {
2682
- m.value = await r.catalog();
2732
+ f.value = await r.catalog();
2683
2733
  } catch ($) {
2684
2734
  Z.danger(i($));
2685
2735
  }
2686
- } else o && (r = ze(o));
2687
- }), Qe(() => {
2688
- clearTimeout(ve), window.removeEventListener("keydown", Ve);
2736
+ } else o && (r = Me(o));
2737
+ }), Xe(() => {
2738
+ clearTimeout(me), window.removeEventListener("keydown", Ve);
2689
2739
  });
2690
- const Me = V(
2691
- () => g.value?.content ? pt(g.value.content.schema) : []
2740
+ const Ne = V(
2741
+ () => g.value?.content ? mt(g.value.content.schema) : []
2692
2742
  );
2693
- return ($, D) => l(s) ? (u(), C("div", bs, [
2694
- f(l(q), {
2743
+ return ($, z) => n(s) ? (c(), C("div", Ss, [
2744
+ m(n(q), {
2695
2745
  size: "sm",
2696
2746
  tone: "muted"
2697
2747
  }, {
2698
2748
  default: b(() => [
2699
- z(S(l(a)("field.nested-note")), 1)
2749
+ M(S(n(a)("field.nested-note")), 1)
2700
2750
  ]),
2701
2751
  _: 1
2702
2752
  })
2703
- ])) : (u(), C("div", {
2753
+ ])) : (c(), C("div", {
2704
2754
  key: 1,
2705
2755
  ref_key: "host",
2706
2756
  ref: K,
2707
2757
  class: $e(["wx-blocks-host", { "is-compact": h.value }])
2708
2758
  }, [
2709
- B("div", {
2759
+ A("div", {
2710
2760
  class: $e(["wx-blocks", {
2711
2761
  "is-editing": v.value !== null,
2712
- "has-preview": l(_) !== null && l(_).url.value !== null
2762
+ "has-preview": n(_) !== null && n(_).url.value !== null
2713
2763
  }])
2714
2764
  }, [
2715
- (u(), M(rl(h.value ? l(El) : "div"), ul(J.value, { class: "wx-blocks__side" }), {
2765
+ (c(), N(pl(h.value ? n(Vl) : "div"), fl(J.value, { class: "wx-blocks__side" }), {
2716
2766
  default: b(() => [
2717
- v.value ? N("", !0) : (u(), C("div", gs, [
2718
- B("div", ys, [
2719
- B("span", ks, S(l(a)("field.blocks")), 1),
2720
- f(l(q), {
2767
+ v.value ? D("", !0) : (c(), C("div", Es, [
2768
+ A("div", Ts, [
2769
+ A("span", Cs, S(n(a)("field.blocks")), 1),
2770
+ m(n(q), {
2721
2771
  size: "sm",
2722
2772
  tone: "muted"
2723
2773
  }, {
2724
2774
  default: b(() => [
2725
- z(S(d.value.length), 1)
2775
+ M(S(d.value.length), 1)
2726
2776
  ]),
2727
2777
  _: 1
2728
2778
  })
2729
2779
  ]),
2730
- f(hs, {
2780
+ m($s, {
2731
2781
  nodes: d.value,
2732
- catalog: c.value,
2782
+ catalog: u.value,
2733
2783
  selected: p.value,
2734
2784
  disabled: e.disabled,
2735
2785
  onSelect: G,
@@ -2739,194 +2789,194 @@ const Ct = /* @__PURE__ */ Symbol("wx-blocks-root"), bs = {
2739
2789
  onVisibility: O,
2740
2790
  onReorder: j
2741
2791
  }, null, 8, ["nodes", "catalog", "selected", "disabled"]),
2742
- B("div", ws, [
2743
- !e.disabled && (e.max === null || d.value.length < e.max) ? (u(), M(l(ce), {
2792
+ A("div", Vs, [
2793
+ !e.disabled && (e.max === null || d.value.length < e.max) ? (c(), N(n(ce), {
2744
2794
  key: 0,
2745
2795
  variant: "outline",
2746
2796
  icon: "plus",
2747
2797
  class: "wx-blocks__add",
2748
- onClick: D[0] || (D[0] = (U) => ke(null, null, null))
2798
+ onClick: z[0] || (z[0] = (U) => ke(null, null, null))
2749
2799
  }, {
2750
2800
  default: b(() => [
2751
- z(S(l(a)("field.add")), 1)
2801
+ M(S(n(a)("field.add")), 1)
2752
2802
  ]),
2753
2803
  _: 1
2754
- })) : N("", !0),
2755
- !h.value && l(_) && l(_).url.value ? (u(), M(l(ce), {
2804
+ })) : D("", !0),
2805
+ !h.value && n(_) && n(_).url.value ? (c(), N(n(ce), {
2756
2806
  key: 1,
2757
2807
  variant: "outline",
2758
2808
  icon: "eye",
2759
2809
  class: "wx-blocks__preview-button",
2760
- onClick: D[1] || (D[1] = (U) => R.value?.open())
2810
+ onClick: z[1] || (z[1] = (U) => R.value?.open())
2761
2811
  }, {
2762
2812
  default: b(() => [
2763
- z(S(l(a)("field.preview")), 1)
2813
+ M(S(n(a)("field.preview")), 1)
2764
2814
  ]),
2765
2815
  _: 1
2766
- })) : N("", !0)
2816
+ })) : D("", !0)
2767
2817
  ])
2768
2818
  ])),
2769
- v.value ? (u(), C("div", _s, [
2770
- B("div", xs, [
2771
- B("span", $s, [
2772
- y.value.length ? (u(), C("span", Ss, [
2773
- (u(!0), C(F, null, le(y.value, (U) => (u(), C(F, {
2819
+ v.value ? (c(), C("div", As, [
2820
+ A("div", Ls, [
2821
+ A("span", Bs, [
2822
+ y.value.length ? (c(), C("span", Ws, [
2823
+ (c(!0), C(F, null, le(y.value, (U) => (c(), C(F, {
2774
2824
  key: U.key
2775
2825
  }, [
2776
- B("button", {
2826
+ A("button", {
2777
2827
  type: "button",
2778
2828
  class: "wx-blocks__trail-step",
2779
2829
  onClick: (H) => G(U.key)
2780
- }, S(U.title), 9, Es),
2781
- f(l(he), { name: "chevron-right" })
2830
+ }, S(U.title), 9, Ms),
2831
+ m(n(he), { name: "chevron-right" })
2782
2832
  ], 64))), 128))
2783
- ])) : N("", !0),
2784
- B("span", Ts, S(g.value?.title ?? v.value.node.type), 1)
2833
+ ])) : D("", !0),
2834
+ A("span", zs, S(g.value?.title ?? v.value.node.type), 1)
2785
2835
  ]),
2786
- B("span", Cs, [
2787
- h.value ? N("", !0) : (u(), C("code", Vs, S(v.value.node.type), 1)),
2788
- f(l(Ne), {
2836
+ A("span", Ns, [
2837
+ h.value ? D("", !0) : (c(), C("code", Ds, S(v.value.node.type), 1)),
2838
+ m(n(Ie), {
2789
2839
  size: "sm",
2790
2840
  tone: "neutral",
2791
2841
  icon: "chevron-up",
2792
- title: l(a)("field.previous"),
2842
+ title: n(a)("field.previous"),
2793
2843
  disabled: w.value.previous === null,
2794
- onClick: D[2] || (D[2] = (U) => w.value.previous && G(w.value.previous))
2844
+ onClick: z[2] || (z[2] = (U) => w.value.previous && G(w.value.previous))
2795
2845
  }, null, 8, ["title", "disabled"]),
2796
- f(l(Ne), {
2846
+ m(n(Ie), {
2797
2847
  size: "sm",
2798
2848
  tone: "neutral",
2799
2849
  icon: "chevron-down",
2800
- title: l(a)("field.next"),
2850
+ title: n(a)("field.next"),
2801
2851
  disabled: w.value.next === null,
2802
- onClick: D[3] || (D[3] = (U) => w.value.next && G(w.value.next))
2852
+ onClick: z[3] || (z[3] = (U) => w.value.next && G(w.value.next))
2803
2853
  }, null, 8, ["title", "disabled"]),
2804
- !h.value && l(_) && l(_).url.value ? (u(), M(l(ce), {
2854
+ !h.value && n(_) && n(_).url.value ? (c(), N(n(ce), {
2805
2855
  key: 1,
2806
2856
  size: "sm",
2807
2857
  variant: "outline",
2808
2858
  icon: "eye",
2809
2859
  class: "wx-blocks__preview-button",
2810
- "aria-label": l(a)("field.preview"),
2811
- onClick: D[4] || (D[4] = (U) => R.value?.open())
2812
- }, null, 8, ["aria-label"])) : N("", !0),
2813
- f(l(ce), {
2860
+ "aria-label": n(a)("field.preview"),
2861
+ onClick: z[4] || (z[4] = (U) => R.value?.open())
2862
+ }, null, 8, ["aria-label"])) : D("", !0),
2863
+ m(n(ce), {
2814
2864
  size: "sm",
2815
2865
  variant: "outline",
2816
2866
  onClick: we
2817
2867
  }, {
2818
2868
  default: b(() => [
2819
- z(S(h.value ? l(a)("field.done") : `${l(a)("field.done")} · Esc`), 1)
2869
+ M(S(h.value ? n(a)("field.done") : `${n(a)("field.done")} · Esc`), 1)
2820
2870
  ]),
2821
2871
  _: 1
2822
2872
  })
2823
2873
  ])
2824
2874
  ]),
2825
- B("div", Bs, [
2826
- g.value?.content ? (u(), M(l(Ot), {
2875
+ A("div", Is, [
2876
+ g.value?.content ? (c(), N(n(Rt), {
2827
2877
  key: v.value.node.key,
2828
2878
  "model-value": v.value.node.values,
2829
- root: Me.value,
2879
+ root: Ne.value,
2830
2880
  types: pe.value,
2831
2881
  translate: ye.value,
2832
2882
  can: Ee.value,
2833
2883
  disabled: e.disabled,
2834
2884
  "onUpdate:modelValue": se
2835
- }, null, 8, ["model-value", "root", "types", "translate", "can", "disabled"])) : (u(), M(l(q), {
2885
+ }, null, 8, ["model-value", "root", "types", "translate", "can", "disabled"])) : (c(), N(n(q), {
2836
2886
  key: 1,
2837
2887
  size: "sm",
2838
2888
  tone: "danger"
2839
2889
  }, {
2840
2890
  default: b(() => [
2841
- z(S(l(a)("field.unknown-type", { type: v.value.node.type })), 1)
2891
+ M(S(n(a)("field.unknown-type", { type: v.value.node.type })), 1)
2842
2892
  ]),
2843
2893
  _: 1
2844
2894
  }))
2845
2895
  ])
2846
- ])) : N("", !0)
2896
+ ])) : D("", !0)
2847
2897
  ]),
2848
2898
  _: 1
2849
2899
  }, 16)),
2850
- l(_) && l(_).url.value ? (u(), C("div", As, [
2851
- f(os, {
2900
+ n(_) && n(_).url.value ? (c(), C("div", Ps, [
2901
+ m(fs, {
2852
2902
  ref_key: "previewEl",
2853
2903
  ref: R,
2854
- url: l(_).url.value,
2904
+ url: n(_).url.value,
2855
2905
  selected: p.value,
2856
- reload: l(_).reload?.value ?? 0,
2906
+ reload: n(_).reload?.value ?? 0,
2857
2907
  compact: h.value,
2858
2908
  onSelect: fe,
2859
- onEdit: D[5] || (D[5] = (U) => A.value = !0)
2909
+ onEdit: z[5] || (z[5] = (U) => L.value = !0)
2860
2910
  }, null, 8, ["url", "selected", "reload", "compact"])
2861
- ])) : N("", !0)
2911
+ ])) : D("", !0)
2862
2912
  ], 2)
2863
2913
  ], 2));
2864
2914
  }
2865
- }), Ws = /* @__PURE__ */ ie(Ls, [["__scopeId", "data-v-613ad857"]]), zs = { class: "wx-block-card__body" }, Ds = { class: "wx-block-card__title" }, Ms = { class: "wx-block-card__chips" }, Ns = /* @__PURE__ */ ae({
2915
+ }), Us = /* @__PURE__ */ ie(Os, [["__scopeId", "data-v-1c5bc971"]]), Rs = { class: "wx-block-card__body" }, js = { class: "wx-block-card__title" }, Fs = { class: "wx-block-card__chips" }, Hs = /* @__PURE__ */ ae({
2866
2916
  __name: "BlockCard",
2867
2917
  props: {
2868
2918
  block: {}
2869
2919
  },
2870
2920
  emits: ["open"],
2871
- setup(e, { emit: n }) {
2872
- const t = n, s = de("webx-blocks");
2873
- return (a, i) => (u(), C("button", {
2921
+ setup(e, { emit: l }) {
2922
+ const t = l, s = de("webx-blocks");
2923
+ return (a, i) => (c(), C("button", {
2874
2924
  type: "button",
2875
2925
  class: "wx-block-card",
2876
2926
  onClick: i[0] || (i[0] = (o) => t("open", e.block))
2877
2927
  }, [
2878
- f(tl, {
2928
+ m(sl, {
2879
2929
  thumbnail: e.block.thumbnail,
2880
2930
  height: 120
2881
2931
  }, null, 8, ["thumbnail"]),
2882
- B("div", zs, [
2883
- B("div", Ds, S(e.block.title), 1),
2884
- f(l(q), {
2932
+ A("div", Rs, [
2933
+ A("div", js, S(e.block.title), 1),
2934
+ m(n(q), {
2885
2935
  size: "sm",
2886
2936
  tone: "muted"
2887
2937
  }, {
2888
2938
  default: b(() => [
2889
- B("code", null, S(e.block.slug), 1),
2890
- z(" · " + S(l(rt)(e.block.usage_count, l(s))), 1)
2939
+ A("code", null, S(e.block.slug), 1),
2940
+ M(" · " + S(n(ct)(e.block.usage_count, n(s))), 1)
2891
2941
  ]),
2892
2942
  _: 1
2893
2943
  }),
2894
- B("div", Ms, [
2895
- e.block.draft ? (u(), M(l(ue), {
2944
+ A("div", Fs, [
2945
+ e.block.draft ? (c(), N(n(ue), {
2896
2946
  key: 0,
2897
2947
  type: "warning",
2898
2948
  dot: ""
2899
2949
  }, {
2900
2950
  default: b(() => [
2901
- z(S(l(s)("page.draft", { number: e.block.draft.number })), 1)
2951
+ M(S(n(s)("page.draft", { number: e.block.draft.number })), 1)
2902
2952
  ]),
2903
2953
  _: 1
2904
- })) : N("", !0),
2905
- e.block.published ? (u(), M(l(ue), {
2954
+ })) : D("", !0),
2955
+ e.block.published ? (c(), N(n(ue), {
2906
2956
  key: 1,
2907
2957
  type: "success",
2908
2958
  dot: ""
2909
2959
  }, {
2910
2960
  default: b(() => [
2911
- z(S(l(s)("page.live", { number: e.block.published.number })), 1)
2961
+ M(S(n(s)("page.live", { number: e.block.published.number })), 1)
2912
2962
  ]),
2913
2963
  _: 1
2914
- })) : (u(), M(l(ue), {
2964
+ })) : (c(), N(n(ue), {
2915
2965
  key: 2,
2916
2966
  type: "default"
2917
2967
  }, {
2918
2968
  default: b(() => [
2919
- z(S(l(s)("page.never-published")), 1)
2969
+ M(S(n(s)("page.never-published")), 1)
2920
2970
  ]),
2921
2971
  _: 1
2922
2972
  })),
2923
- e.block.is_enabled ? N("", !0) : (u(), M(l(ue), {
2973
+ e.block.is_enabled ? D("", !0) : (c(), N(n(ue), {
2924
2974
  key: 3,
2925
2975
  type: "default",
2926
2976
  variant: "outline"
2927
2977
  }, {
2928
2978
  default: b(() => [
2929
- z(S(l(s)("page.hidden")), 1)
2979
+ M(S(n(s)("page.hidden")), 1)
2930
2980
  ]),
2931
2981
  _: 1
2932
2982
  }))
@@ -2934,21 +2984,21 @@ const Ct = /* @__PURE__ */ Symbol("wx-blocks-root"), bs = {
2934
2984
  ])
2935
2985
  ]));
2936
2986
  }
2937
- }), Is = /* @__PURE__ */ ie(Ns, [["__scopeId", "data-v-3d94f339"]]), Ps = { class: "wx-block-create" }, Os = /* @__PURE__ */ ae({
2987
+ }), qs = /* @__PURE__ */ ie(Hs, [["__scopeId", "data-v-3d94f339"]]), Ks = { class: "wx-block-create" }, Ys = /* @__PURE__ */ ae({
2938
2988
  __name: "BlockCreateDialog",
2939
2989
  setup(e) {
2940
- const { resolve: n, dismiss: t, open: s } = Mt(), a = Re(), i = ze(a);
2941
- He();
2942
- const o = de("webx-blocks"), r = je(), m = V(() => a.state.manifest?.modules.find((_) => _.id === "blocks")?.meta?.groups ?? ["content"]), c = I({ title: "", slug: "", group: m.value[0] ?? "content" }), d = I({}), p = I(!1), v = I(!1), g = V(
2943
- () => m.value.map((y) => ({ value: y, label: De(y, o) }))
2990
+ const { resolve: l, dismiss: t, open: s } = It(), a = je(), i = Me(a);
2991
+ qe();
2992
+ const o = de("webx-blocks"), r = Fe(), f = V(() => a.state.manifest?.modules.find((_) => _.id === "blocks")?.meta?.groups ?? ["content"]), u = I({ title: "", slug: "", group: f.value[0] ?? "content" }), d = I({}), p = I(!1), v = I(!1), g = V(
2993
+ () => f.value.map((y) => ({ value: y, label: ze(y, o) }))
2944
2994
  );
2945
2995
  function x(y) {
2946
2996
  return y.toLowerCase().replace(/[^a-z0-9]+/g, "-").replace(/^-+|-+$/g, "").replace(/^[^a-z]+/, "").slice(0, 64);
2947
2997
  }
2948
2998
  te(
2949
- () => c.value.title,
2999
+ () => u.value.title,
2950
3000
  (y) => {
2951
- v.value || (c.value.slug = x(y));
3001
+ v.value || (u.value.slug = x(y));
2952
3002
  }
2953
3003
  );
2954
3004
  function T(y) {
@@ -2957,7 +3007,7 @@ const Ct = /* @__PURE__ */ Symbol("wx-blocks-root"), bs = {
2957
3007
  async function w() {
2958
3008
  p.value = !0, d.value = {};
2959
3009
  try {
2960
- n(await i.create(c.value));
3010
+ l(await i.create(u.value));
2961
3011
  } catch (y) {
2962
3012
  const _ = y.body;
2963
3013
  _?.errors ? d.value = _.errors : Z.danger(r(y, o("page.failed")));
@@ -2965,31 +3015,31 @@ const Ct = /* @__PURE__ */ Symbol("wx-blocks-root"), bs = {
2965
3015
  p.value = !1;
2966
3016
  }
2967
3017
  }
2968
- return (y, _) => (u(), M(l(Nt), {
2969
- open: l(s),
2970
- "onUpdate:open": _[5] || (_[5] = (R) => Bt(s) ? s.value = R : null),
2971
- title: l(o)("page.new"),
3018
+ return (y, _) => (c(), N(n(Pt), {
3019
+ open: n(s),
3020
+ "onUpdate:open": _[5] || (_[5] = (R) => Lt(s) ? s.value = R : null),
3021
+ title: n(o)("page.new"),
2972
3022
  width: 520
2973
3023
  }, {
2974
3024
  footer: b(() => [
2975
- f(l(Tl), { size: "sm" }, {
3025
+ m(n(Al), { size: "sm" }, {
2976
3026
  default: b(() => [
2977
- f(l(ce), {
3027
+ m(n(ce), {
2978
3028
  variant: "outline",
2979
- onClick: _[4] || (_[4] = (R) => l(t)())
3029
+ onClick: _[4] || (_[4] = (R) => n(t)())
2980
3030
  }, {
2981
3031
  default: b(() => [
2982
- z(S(l(o)("page.cancel")), 1)
3032
+ M(S(n(o)("page.cancel")), 1)
2983
3033
  ]),
2984
3034
  _: 1
2985
3035
  }),
2986
- f(l(ce), {
3036
+ m(n(ce), {
2987
3037
  type: "primary",
2988
3038
  loading: p.value,
2989
3039
  onClick: w
2990
3040
  }, {
2991
3041
  default: b(() => [
2992
- z(S(l(o)("page.create")), 1)
3042
+ M(S(n(o)("page.create")), 1)
2993
3043
  ]),
2994
3044
  _: 1
2995
3045
  }, 8, ["loading"])
@@ -2998,44 +3048,44 @@ const Ct = /* @__PURE__ */ Symbol("wx-blocks-root"), bs = {
2998
3048
  })
2999
3049
  ]),
3000
3050
  default: b(() => [
3001
- B("div", Ps, [
3002
- f(l(oe), {
3003
- label: l(o)("page.title"),
3051
+ A("div", Ks, [
3052
+ m(n(oe), {
3053
+ label: n(o)("page.title"),
3004
3054
  error: T("title")
3005
3055
  }, {
3006
3056
  default: b(() => [
3007
- f(l(Oe), {
3008
- modelValue: c.value.title,
3009
- "onUpdate:modelValue": _[0] || (_[0] = (R) => c.value.title = R),
3057
+ m(n(Ue), {
3058
+ modelValue: u.value.title,
3059
+ "onUpdate:modelValue": _[0] || (_[0] = (R) => u.value.title = R),
3010
3060
  autofocus: ""
3011
3061
  }, null, 8, ["modelValue"])
3012
3062
  ]),
3013
3063
  _: 1
3014
3064
  }, 8, ["label", "error"]),
3015
- f(l(oe), {
3016
- label: l(o)("page.identifier"),
3017
- help: l(o)("page.identifier-help"),
3065
+ m(n(oe), {
3066
+ label: n(o)("page.identifier"),
3067
+ help: n(o)("page.identifier-help"),
3018
3068
  error: T("slug")
3019
3069
  }, {
3020
3070
  default: b(() => [
3021
- f(l(Oe), {
3022
- modelValue: c.value.slug,
3023
- "onUpdate:modelValue": _[1] || (_[1] = (R) => c.value.slug = R),
3071
+ m(n(Ue), {
3072
+ modelValue: u.value.slug,
3073
+ "onUpdate:modelValue": _[1] || (_[1] = (R) => u.value.slug = R),
3024
3074
  placeholder: "hero",
3025
3075
  onInput: _[2] || (_[2] = (R) => v.value = !0)
3026
3076
  }, null, 8, ["modelValue"])
3027
3077
  ]),
3028
3078
  _: 1
3029
3079
  }, 8, ["label", "help", "error"]),
3030
- f(l(oe), {
3031
- label: l(o)("page.group"),
3032
- help: l(o)("page.group-help"),
3080
+ m(n(oe), {
3081
+ label: n(o)("page.group"),
3082
+ help: n(o)("page.group-help"),
3033
3083
  error: T("group")
3034
3084
  }, {
3035
3085
  default: b(() => [
3036
- f(l(Dt), {
3037
- modelValue: c.value.group,
3038
- "onUpdate:modelValue": _[3] || (_[3] = (R) => c.value.group = R),
3086
+ m(n(Dt), {
3087
+ modelValue: u.value.group,
3088
+ "onUpdate:modelValue": _[3] || (_[3] = (R) => u.value.group = R),
3039
3089
  options: g.value
3040
3090
  }, null, 8, ["modelValue", "options"])
3041
3091
  ]),
@@ -3046,22 +3096,22 @@ const Ct = /* @__PURE__ */ Symbol("wx-blocks-root"), bs = {
3046
3096
  _: 1
3047
3097
  }, 8, ["open", "title"]));
3048
3098
  }
3049
- }), Us = /* @__PURE__ */ ie(Os, [["__scopeId", "data-v-a4c0d44c"]]), Rs = {
3099
+ }), Js = /* @__PURE__ */ ie(Ys, [["__scopeId", "data-v-a4c0d44c"]]), Gs = {
3050
3100
  key: 1,
3051
3101
  class: "wx-blocks-page__toolbar"
3052
- }, js = { class: "wx-blocks-page__cards" }, Fs = { class: "wx-blocks-page__ghost-body" }, Hs = {
3102
+ }, Zs = { class: "wx-blocks-page__cards" }, Qs = { class: "wx-blocks-page__ghost-body" }, Xs = {
3053
3103
  key: 0,
3054
3104
  class: "wx-blocks-page__group-title"
3055
- }, qs = { class: "wx-blocks-page__cards" }, Ks = /* @__PURE__ */ ae({
3105
+ }, eo = { class: "wx-blocks-page__cards" }, to = /* @__PURE__ */ ae({
3056
3106
  __name: "BlocksPage",
3057
3107
  props: {
3058
3108
  base: { default: "/blocks" }
3059
3109
  },
3060
3110
  setup(e) {
3061
- const n = e, t = Re(), s = ze(t), a = Lt();
3062
- He();
3063
- const i = de("webx-blocks"), o = je(), r = I([]), m = I(!0), c = I(""), d = I(""), p = Pt(Us), v = V(() => {
3064
- const h = t.state.manifest?.modules.find((A) => A.id === "blocks")?.meta;
3111
+ const l = e, t = je(), s = Me(t), a = Wt();
3112
+ qe();
3113
+ const i = de("webx-blocks"), o = Fe(), r = I([]), f = I(!0), u = I(""), d = I(""), p = Ut(Js), v = V(() => {
3114
+ const h = t.state.manifest?.modules.find((L) => L.id === "blocks")?.meta;
3065
3115
  return {
3066
3116
  groups: h?.groups ?? [],
3067
3117
  editing: h?.editing ?? !0,
@@ -3070,97 +3120,97 @@ const Ct = /* @__PURE__ */ Symbol("wx-blocks-root"), bs = {
3070
3120
  }), g = V(() => t.can("blocks.manage") && v.value.editing), x = V(
3071
3121
  () => t.state.manifest?.modules.find((h) => h.id === "blocks")?.title ?? i("module.title")
3072
3122
  ), T = V(() => {
3073
- const h = c.value.trim().toLowerCase(), A = d.value === "" ? r.value : r.value.filter((P) => P.group === d.value);
3074
- return h === "" ? A : A.filter(
3123
+ const h = u.value.trim().toLowerCase(), L = d.value === "" ? r.value : r.value.filter((P) => P.group === d.value);
3124
+ return h === "" ? L : L.filter(
3075
3125
  (P) => P.title.toLowerCase().includes(h) || P.slug.includes(h) || (P.description ?? "").toLowerCase().includes(h)
3076
3126
  );
3077
3127
  }), w = V(() => {
3078
3128
  const h = [...v.value.groups];
3079
- for (const A of r.value)
3080
- h.includes(A.group) || h.push(A.group);
3081
- return h.filter((A) => r.value.some((P) => P.group === A));
3129
+ for (const L of r.value)
3130
+ h.includes(L.group) || h.push(L.group);
3131
+ return h.filter((L) => r.value.some((P) => P.group === L));
3082
3132
  }), y = V(
3083
3133
  () => w.value.length < 2 ? [] : [
3084
3134
  { value: "", label: i("page.all-groups") },
3085
- ...w.value.map((h) => ({ value: h, label: De(h, i) }))
3135
+ ...w.value.map((h) => ({ value: h, label: ze(h, i) }))
3086
3136
  ]
3087
3137
  ), _ = V(() => {
3088
3138
  const h = w.value.map((P) => ({
3089
3139
  id: P,
3090
- label: De(P, i),
3140
+ label: ze(P, i),
3091
3141
  blocks: T.value.filter((J) => J.group === P)
3092
3142
  })).filter((P) => P.blocks.length > 0);
3093
- return d.value !== "" || T.value.length <= 5 || c.value.trim() !== "" || h.length < 2 ? [{ id: "", label: "", blocks: T.value }] : h;
3143
+ return d.value !== "" || T.value.length <= 5 || u.value.trim() !== "" || h.length < 2 ? [{ id: "", label: "", blocks: T.value }] : h;
3094
3144
  });
3095
3145
  async function R() {
3096
- m.value = !0;
3146
+ f.value = !0;
3097
3147
  try {
3098
3148
  r.value = await s.list();
3099
3149
  } catch (h) {
3100
3150
  Z.danger(o(h));
3101
3151
  } finally {
3102
- m.value = !1;
3152
+ f.value = !1;
3103
3153
  }
3104
3154
  }
3105
3155
  function K(h) {
3106
- a.push(`${n.base}/${h.id}`);
3156
+ a.push(`${l.base}/${h.id}`);
3107
3157
  }
3108
3158
  async function Y() {
3109
3159
  const h = await p({});
3110
3160
  h && K(h);
3111
3161
  }
3112
- Ue(R);
3162
+ Re(R);
3113
3163
  const X = V(
3114
3164
  () => g.value ? [{ key: "new", label: i("page.new"), icon: "plus", primary: !0, run: () => {
3115
3165
  Y();
3116
3166
  } }] : []
3117
3167
  );
3118
- return (h, A) => (u(), M(l(gl), {
3168
+ return (h, L) => (c(), N(n(wl), {
3119
3169
  view: d.value,
3120
- "onUpdate:view": A[1] || (A[1] = (P) => d.value = P),
3170
+ "onUpdate:view": L[1] || (L[1] = (P) => d.value = P),
3121
3171
  class: "wx-blocks-page",
3122
3172
  title: x.value,
3123
3173
  views: y.value,
3124
3174
  actions: X.value
3125
3175
  }, {
3126
3176
  default: b(() => [
3127
- v.value.editing ? N("", !0) : (u(), M(l(zt), {
3177
+ v.value.editing ? D("", !0) : (c(), N(n(Nt), {
3128
3178
  key: 0,
3129
3179
  type: "info",
3130
3180
  variant: "soft",
3131
- description: l(i)("page.editing-off")
3181
+ description: n(i)("page.editing-off")
3132
3182
  }, null, 8, ["description"])),
3133
- m.value || r.value.length > 0 ? (u(), C("div", Rs, [
3134
- f(l(Oe), {
3135
- modelValue: c.value,
3136
- "onUpdate:modelValue": A[0] || (A[0] = (P) => c.value = P),
3183
+ f.value || r.value.length > 0 ? (c(), C("div", Gs, [
3184
+ m(n(Ue), {
3185
+ modelValue: u.value,
3186
+ "onUpdate:modelValue": L[0] || (L[0] = (P) => u.value = P),
3137
3187
  class: "wx-blocks-page__search",
3138
- placeholder: l(i)("page.search"),
3188
+ placeholder: n(i)("page.search"),
3139
3189
  clearable: ""
3140
3190
  }, null, 8, ["modelValue", "placeholder"])
3141
- ])) : N("", !0),
3142
- m.value ? (u(), M(l(Le), { key: 2 }, {
3191
+ ])) : D("", !0),
3192
+ f.value ? (c(), N(n(Be), { key: 2 }, {
3143
3193
  template: b(() => [
3144
- B("div", js, [
3145
- (u(), C(F, null, le(4, (P) => B("div", {
3194
+ A("div", Zs, [
3195
+ (c(), C(F, null, le(4, (P) => A("div", {
3146
3196
  key: P,
3147
3197
  class: "wx-blocks-page__ghost"
3148
3198
  }, [
3149
- f(l(Ke), {
3199
+ m(n(Ye), {
3150
3200
  variant: "image",
3151
3201
  height: 120,
3152
3202
  class: "wx-blocks-page__ghost-thumb"
3153
3203
  }),
3154
- B("div", Fs, [
3155
- f(l(Ke), {
3204
+ A("div", Qs, [
3205
+ m(n(Ye), {
3156
3206
  variant: "title",
3157
3207
  width: "45%"
3158
3208
  }),
3159
- f(l(Ke), {
3209
+ m(n(Ye), {
3160
3210
  variant: "text",
3161
3211
  width: "70%"
3162
3212
  }),
3163
- f(l(Ke), {
3213
+ m(n(Ye), {
3164
3214
  variant: "button",
3165
3215
  width: "64px",
3166
3216
  height: "22px"
@@ -3170,18 +3220,18 @@ const Ct = /* @__PURE__ */ Symbol("wx-blocks-root"), bs = {
3170
3220
  ])
3171
3221
  ]),
3172
3222
  _: 1
3173
- })) : r.value.length === 0 ? (u(), M(l(It), {
3223
+ })) : r.value.length === 0 ? (c(), N(n(Ot), {
3174
3224
  key: 3,
3175
3225
  icon: "grid",
3176
- title: l(i)("page.empty"),
3177
- description: l(i)("page.empty-help")
3178
- }, null, 8, ["title", "description"])) : (u(!0), C(F, { key: 4 }, le(_.value, (P) => (u(), C("section", {
3226
+ title: n(i)("page.empty"),
3227
+ description: n(i)("page.empty-help")
3228
+ }, null, 8, ["title", "description"])) : (c(!0), C(F, { key: 4 }, le(_.value, (P) => (c(), C("section", {
3179
3229
  key: P.id,
3180
3230
  class: "wx-blocks-page__group"
3181
3231
  }, [
3182
- P.label ? (u(), C("div", Hs, S(P.label), 1)) : N("", !0),
3183
- B("div", qs, [
3184
- (u(!0), C(F, null, le(P.blocks, (J) => (u(), M(Is, {
3232
+ P.label ? (c(), C("div", Xs, S(P.label), 1)) : D("", !0),
3233
+ A("div", eo, [
3234
+ (c(!0), C(F, null, le(P.blocks, (J) => (c(), N(qs, {
3185
3235
  key: J.id,
3186
3236
  block: J,
3187
3237
  onOpen: K
@@ -3192,19 +3242,19 @@ const Ct = /* @__PURE__ */ Symbol("wx-blocks-root"), bs = {
3192
3242
  _: 1
3193
3243
  }, 8, ["view", "title", "views", "actions"]));
3194
3244
  }
3195
- }), Ys = /* @__PURE__ */ ie(Ks, [["__scopeId", "data-v-553b680f"]]);
3196
- function oo(e = {}) {
3197
- const n = e.path ?? "/blocks";
3245
+ }), lo = /* @__PURE__ */ ie(to, [["__scopeId", "data-v-553b680f"]]);
3246
+ function mo(e = {}) {
3247
+ const l = e.path ?? "/blocks";
3198
3248
  return {
3199
3249
  id: "blocks",
3200
- path: n,
3250
+ path: l,
3201
3251
  routes: [
3202
- { path: n, name: "webx.blocks", component: Ys, props: { base: n } },
3252
+ { path: l, name: "webx.blocks", component: lo, props: { base: l } },
3203
3253
  {
3204
- path: `${n}/:id(\\d+)`,
3254
+ path: `${l}/:id(\\d+)`,
3205
3255
  name: "webx.blocks.edit",
3206
- component: Fn,
3207
- props: { base: n }
3256
+ component: Gn,
3257
+ props: { base: l }
3208
3258
  }
3209
3259
  ],
3210
3260
  // What a screen means by `wx-blocks`: the content of an entity as a tree of blocks. A
@@ -3212,47 +3262,47 @@ function oo(e = {}) {
3212
3262
  // draws its children through the renderer; it needs the node for `props.allow` alone.
3213
3263
  types: {
3214
3264
  "wx-blocks": {
3215
- component: Ws,
3265
+ component: Us,
3216
3266
  kind: "field",
3217
3267
  nested: !0,
3218
3268
  wide: !0,
3219
- bind: () => ({ blocksPath: n })
3269
+ bind: () => ({ blocksPath: l })
3220
3270
  }
3221
3271
  }
3222
3272
  };
3223
3273
  }
3224
3274
  export {
3225
- Fn as WxBlockEditorPage,
3226
- ts as WxBlockPicker,
3227
- Kl as WxBlockStage,
3228
- tl as WxBlockThumb,
3229
- Ws as WxBlocks,
3230
- Ys as WxBlocksPage,
3231
- oo as blocks,
3232
- ln as blocksMessages,
3233
- ft as blocksPreviewKey,
3234
- Kt as cloneNode,
3235
- Jl as countType,
3236
- ze as createBlocksApi,
3237
- Ut as findRange,
3238
- pt as formSchema,
3239
- st as highlightBlock,
3275
+ Gn as WxBlockEditorPage,
3276
+ us as WxBlockPicker,
3277
+ Xl as WxBlockStage,
3278
+ sl as WxBlockThumb,
3279
+ Us as WxBlocks,
3280
+ lo as WxBlocksPage,
3281
+ mo as blocks,
3282
+ un as blocksMessages,
3283
+ vt as blocksPreviewKey,
3284
+ Gt as cloneNode,
3285
+ tn as countType,
3286
+ Me as createBlocksApi,
3287
+ jt as findRange,
3288
+ mt as formSchema,
3289
+ ot as highlightBlock,
3240
3290
  $t as insertNode,
3241
- Ft as isNode,
3242
- et as isNodeList,
3243
- Sn as lintBlock,
3291
+ Kt as isNode,
3292
+ tt as isNodeList,
3293
+ Ln as lintBlock,
3244
3294
  re as locate,
3245
- Yl as makeNode,
3246
- it as newKey,
3247
- no as provideBlocksPreview,
3248
- Xl as removeNode,
3249
- Rt as replaceBlock,
3250
- tn as replaceList,
3251
- jt as stageDocument,
3252
- lo as typesIn,
3253
- En as undeclared,
3254
- en as updateValues,
3255
- so as useBlocksPreview,
3256
- Fe as walk
3295
+ en as makeNode,
3296
+ ut as newKey,
3297
+ po as provideBlocksPreview,
3298
+ on as removeNode,
3299
+ Ft as replaceBlock,
3300
+ rn as replaceList,
3301
+ Ht as stageDocument,
3302
+ co as typesIn,
3303
+ Bn as undeclared,
3304
+ an as updateValues,
3305
+ fo as useBlocksPreview,
3306
+ He as walk
3257
3307
  };
3258
3308
  //# sourceMappingURL=index.js.map