labull-framework 0.1.28 → 0.1.29

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.
@@ -1,8 +1,8 @@
1
- import { defineComponent as Pe, ref as x, computed as j, watch as Pt, nextTick as Qe, onMounted as rn, onBeforeUnmount as dn, openBlock as d, createElementBlock as p, normalizeStyle as pn, normalizeClass as K, unref as it, createElementVNode as l, toDisplayString as b, createCommentVNode as k, Fragment as M, renderList as N, withModifiers as Ee, createBlock as cs, createTextVNode as $, withDirectives as vt, vModelCheckbox as rs, vModelText as Xt, withKeys as ds, vShow as Qt } from "vue";
2
- import { useRouter as bn, useRoute as ps } from "vue-router";
3
- import { A as bs, b as at, c as ne, u as fn } from "./chunk-index-BWpDbB19.js";
4
- import { u as fs, o as Te, b as mn, _ as vn, d as ms } from "./chunk-ProductShell.vue_vue_type_style_index_0_scoped_06035587_lang-BpRKKThg.js";
5
- const bt = "__mb", hn = "call", Be = "reply", _n = "host-ready", gn = "height", vs = "html, body { overflow: hidden !important; }", hs = `
1
+ import { defineComponent as Pe, ref as x, computed as j, watch as Pt, nextTick as Qe, onMounted as dn, onBeforeUnmount as pn, openBlock as p, createElementBlock as f, normalizeStyle as fn, normalizeClass as K, unref as it, createElementVNode as a, toDisplayString as b, createCommentVNode as k, Fragment as M, renderList as N, withModifiers as Se, getCurrentInstance as fs, createBlock as bs, createTextVNode as $, withDirectives as vt, vModelCheckbox as ms, vModelText as Xt, withKeys as vs, vShow as Qt } from "vue";
2
+ import { useRouter as bn, useRoute as hs } from "vue-router";
3
+ import { A as gs, b as at, c as ne, u as mn } from "./chunk-index-BWpDbB19.js";
4
+ import { u as _s, o as Te, b as vn, _ as hn, d as ys } from "./chunk-ProductShell.vue_vue_type_style_index_0_scoped_06035587_lang-Fky1ghd2.js";
5
+ const ft = "__mb", gn = "call", Be = "reply", _n = "host-ready", yn = "height", ks = "html, body { overflow: hidden !important; }", $s = `
6
6
  (function () {
7
7
  var seq = 0, waiting = {}, queue = [], ready = false, last = -1;
8
8
  function call(method, args) {
@@ -10,16 +10,16 @@ const bt = "__mb", hn = "call", Be = "reply", _n = "host-ready", gn = "height",
10
10
  function run() {
11
11
  var id = ++seq;
12
12
  waiting[id] = { resolve: resolve, reject: reject };
13
- parent.postMessage({ '${bt}': '${hn}', id: id, method: method, args: args }, '*');
13
+ parent.postMessage({ '${ft}': '${gn}', id: id, method: method, args: args }, '*');
14
14
  }
15
15
  if (ready) run(); else queue.push(run);
16
16
  });
17
17
  }
18
18
  window.addEventListener('message', function (event) {
19
19
  var data = event.data, pending;
20
- if (!data || data['${bt}'] === undefined) return;
21
- if (data['${bt}'] === '${_n}') { ready = true; queue.splice(0).forEach(function (run) { run(); }); return; }
22
- if (data['${bt}'] !== '${Be}') return;
20
+ if (!data || data['${ft}'] === undefined) return;
21
+ if (data['${ft}'] === '${_n}') { ready = true; queue.splice(0).forEach(function (run) { run(); }); return; }
22
+ if (data['${ft}'] !== '${Be}') return;
23
23
  if (!(pending = waiting[data.id])) return;
24
24
  delete waiting[data.id];
25
25
  if (data.ok) pending.resolve(data.value); else pending.reject(new Error(data.error || '调用失败'));
@@ -60,7 +60,7 @@ const bt = "__mb", hn = "call", Be = "reply", _n = "host-ready", gn = "height",
60
60
  if (height > 0) height += 1;
61
61
  if (height === last) return; /* 一样高就不再发:否则「宿主改高度 → 触发观察 → 又发一次」会转个不停 */
62
62
  last = height;
63
- parent.postMessage({ '${bt}': '${gn}', height: height }, '*');
63
+ parent.postMessage({ '${ft}': '${yn}', height: height }, '*');
64
64
  }
65
65
  function start() {
66
66
  report();
@@ -69,108 +69,108 @@ const bt = "__mb", hn = "call", Be = "reply", _n = "host-ready", gn = "height",
69
69
  if (document.readyState === 'loading') document.addEventListener('DOMContentLoaded', start); else start();
70
70
  setInterval(report, 500);
71
71
  })();
72
- `, _s = /^[A-Za-z_$][\w$]*(?:\.[A-Za-z_$][\w$]*)+$/;
73
- function yn(o) {
72
+ `, ws = /^[A-Za-z_$][\w$]*(?:\.[A-Za-z_$][\w$]*)+$/;
73
+ function kn(o) {
74
74
  const s = typeof window > "u" ? "http://localhost" : window.location.href;
75
- return new URL(`${bs}${o}`, s);
75
+ return new URL(`${gs}${o}`, s);
76
76
  }
77
77
  const tn = (() => {
78
78
  try {
79
- return yn("").origin;
79
+ return kn("").origin;
80
80
  } catch {
81
81
  return typeof window > "u" ? "" : window.location.origin;
82
82
  }
83
83
  })();
84
- async function gs(o, s, a) {
85
- if (!_s.test(s)) throw new Error(`路由名不合法:${s}(要写成 类名.方法名,例如 Customer.create)`);
86
- const i = yn(`/bx/${o}/${s}`);
84
+ async function xs(o, s, l) {
85
+ if (!ws.test(s)) throw new Error(`路由名不合法:${s}(要写成 类名.方法名,例如 Customer.create)`);
86
+ const i = kn(`/bx/${o}/${s}`);
87
87
  if (i.origin !== tn) throw new Error(`后端地址必须是本应用的(${tn}):${i.origin}`);
88
- const u = a instanceof Blob ? a : null, m = await fetch(i.toString(), {
88
+ const u = l instanceof Blob ? l : null, m = await fetch(i.toString(), {
89
89
  method: "POST",
90
90
  credentials: "include",
91
91
  // 带上 HttpOnly 会话 cookie;authHeaders('POST') 给 CSRF 头(缺了 403)
92
92
  headers: u ? { "Content-Type": u.type || "application/octet-stream", ...ne("POST") } : { "Content-Type": "application/json", ...ne("POST") },
93
- body: u ?? JSON.stringify(a ?? {})
94
- }), f = await m.text().catch(() => "");
93
+ body: u ?? JSON.stringify(l ?? {})
94
+ }), d = await m.text().catch(() => "");
95
95
  if (m.ok) {
96
- if (!f) return null;
96
+ if (!d) return null;
97
97
  try {
98
- return JSON.parse(f);
98
+ return JSON.parse(d);
99
99
  } catch {
100
- return f;
100
+ return d;
101
101
  }
102
102
  }
103
- let c = f;
103
+ let c = d;
104
104
  try {
105
- const h = JSON.parse(f);
105
+ const h = JSON.parse(d);
106
106
  typeof h?.message == "string" && (c = h.message);
107
107
  } catch {
108
- c = f;
108
+ c = d;
109
109
  }
110
110
  throw new Error(c ? `${s} 调用失败:${c.slice(0, 300)}` : `${s} 调用失败(${m.status})`);
111
111
  }
112
- function ys(o, s) {
113
- const a = (f) => {
112
+ function Cs(o, s) {
113
+ const l = (d) => {
114
114
  try {
115
- o.contentWindow?.postMessage(f, "*");
115
+ o.contentWindow?.postMessage(d, "*");
116
116
  } catch (c) {
117
117
  console.warn("[magic-block] 有一条宿主消息没能发给块(协议继续走):", c);
118
118
  }
119
119
  };
120
- async function i(f, c) {
121
- if (f === "getMe") return await at("/auth/me");
122
- if (f === "navigateTab") {
120
+ async function i(d, c) {
121
+ if (d === "getMe") return await at("/auth/me");
122
+ if (d === "navigateTab") {
123
123
  const h = typeof c[0] == "string" ? c[0].trim() : "";
124
124
  if (!h || !s.onNavigateTab) throw new Error(`跳不了 ${h || "(空地址)"}:这个页面没有把宿主接到路由上`);
125
125
  return await s.onNavigateTab(h);
126
126
  }
127
- if (f === "context") return s.context ? s.context() : {};
128
- if (f === "setTabTitle") {
127
+ if (d === "context") return s.context ? s.context() : {};
128
+ if (d === "setTabTitle") {
129
129
  const h = typeof c[0] == "string" ? c[0].trim() : "", v = typeof c[1] == "string" ? c[1].trim() : "";
130
130
  if (!h) throw new Error("setTabTitle 要给一个非空的名字");
131
131
  return s.onTabTitle?.(h, v || void 0), !0;
132
132
  }
133
- if (f === "backend") {
133
+ if (d === "backend") {
134
134
  const h = typeof c[0] == "string" ? c[0].trim() : "", v = c[1];
135
135
  if (!h) throw new Error("后端调用的路由名是空的:要写成 magicBackendApi.类名.方法名(参数)");
136
136
  if (!v || typeof v != "object" || Array.isArray(v)) throw new Error(`magicBackendApi.${h}(params) 的参数要么是一个对象,要么是一个文件(File / Blob)`);
137
- return await gs(s.uuid, h, v);
137
+ return await xs(s.uuid, h, v);
138
138
  }
139
- throw new Error(`不认识的方法:${String(f)}(这块桥只有 getMe / navigateTab / context / setTabTitle / backend 五个)`);
139
+ throw new Error(`不认识的方法:${String(d)}(这块桥只有 getMe / navigateTab / context / setTabTitle / backend 五个)`);
140
140
  }
141
- const u = (f) => {
142
- if (f.source !== o.contentWindow) return;
143
- const c = f.data;
141
+ const u = (d) => {
142
+ if (d.source !== o.contentWindow) return;
143
+ const c = d.data;
144
144
  if (!c) return;
145
- if (c[bt] === gn) {
145
+ if (c[ft] === yn) {
146
146
  const v = typeof c.height == "number" ? c.height : NaN;
147
147
  Number.isFinite(v) && v > 0 && s.onHeight?.(v);
148
148
  return;
149
149
  }
150
- if (c[bt] !== hn) return;
150
+ if (c[ft] !== gn) return;
151
151
  const h = c.id;
152
152
  (async () => {
153
153
  try {
154
- a({ [bt]: Be, id: h, ok: !0, value: await i(String(c.method), c.args ?? []) });
154
+ l({ [ft]: Be, id: h, ok: !0, value: await i(String(c.method), c.args ?? []) });
155
155
  } catch (v) {
156
- a({ [bt]: Be, id: h, ok: !1, error: v instanceof Error ? v.message : String(v) });
156
+ l({ [ft]: Be, id: h, ok: !1, error: v instanceof Error ? v.message : String(v) });
157
157
  }
158
158
  })();
159
159
  };
160
160
  window.addEventListener("message", u);
161
- const m = () => a({ [bt]: _n });
161
+ const m = () => l({ [ft]: _n });
162
162
  return m(), o.addEventListener("load", m), () => {
163
163
  window.removeEventListener("message", u), o.removeEventListener("load", m);
164
164
  };
165
165
  }
166
- const Ht = "index.open.html", ye = "magic-block.open.yaml", ke = ["id", "module", "name", "brief", "detail"], en = ["id", "module", "name", "brief"], je = 40, ks = /^(?![A-Za-z]:)(?!\/)[A-Za-z0-9._\-/]+$/, $s = /^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i, ws = /^[a-z][a-z0-9]*$/, xs = /^[A-Za-z_][A-Za-z0-9_]*$/, Cs = /^([|>])([-+]?)$/, Ss = "_";
166
+ const Ht = "index.open.html", ye = "magic-block.open.yaml", ke = ["id", "module", "name", "brief", "detail"], en = ["id", "module", "name", "brief"], je = 40, Es = /^(?![A-Za-z]:)(?!\/)[A-Za-z0-9._\-/]+$/, Ss = /^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i, Ts = /^[a-z][a-z0-9]*$/, Bs = /^[A-Za-z_][A-Za-z0-9_]*$/, Ms = /^([|>])([-+]?)$/, As = "_";
167
167
  function nn(o) {
168
- return String(o ?? "").split("/").some((s) => s.startsWith(Ss));
168
+ return String(o ?? "").split("/").some((s) => s.startsWith(As));
169
169
  }
170
- function Es(o) {
170
+ function Rs(o) {
171
171
  return o.length > 0 && o.length <= je && !/[\u0000-\u001f\u007f]/.test(o);
172
172
  }
173
- const Ts = {
173
+ const Os = {
174
174
  id: "块的 uuid,必须与页面里挂载它时写死的那个 uuid 逐字一致",
175
175
  module: "模块名(小写字母与数字,必须以字母开头),例如 home",
176
176
  name: `可读名:可以用中文,不超过 ${je} 个字符`,
@@ -183,105 +183,105 @@ function sn(o) {
183
183
  const s = Object.keys(o);
184
184
  return s.length > 0 ? `现在包里有:${s.join(" / ")}` : "现在这个包是空的";
185
185
  }
186
- function Bs(o) {
186
+ function Ps(o) {
187
187
  let s = "";
188
- for (let a = 0; a < o.length; a += 1) {
189
- const i = o[a];
188
+ for (let l = 0; l < o.length; l += 1) {
189
+ const i = o[l];
190
190
  if (s)
191
191
  i === s && (s = "");
192
192
  else if (i === '"' || i === "'") s = i;
193
- else if (i === "#") return o.slice(0, a);
193
+ else if (i === "#") return o.slice(0, l);
194
194
  }
195
195
  return o;
196
196
  }
197
- function Ms(o) {
197
+ function js(o) {
198
198
  let s = "";
199
- for (let a = 0; a < o.length; a += 1) {
200
- const i = o[a];
199
+ for (let l = 0; l < o.length; l += 1) {
200
+ const i = o[l];
201
201
  if (s)
202
202
  i === s && (s = "");
203
203
  else if (i === '"' || i === "'") s = i;
204
- else if (i === ":") return a;
204
+ else if (i === ":") return l;
205
205
  }
206
206
  return -1;
207
207
  }
208
- function As(o) {
208
+ function Ls(o) {
209
209
  return !o || o[0] !== '"' && o[0] !== "'" ? o : o.length >= 2 && o[o.length - 1] === o[0] ? o.slice(1, -1).trim() : o;
210
210
  }
211
- function Rs(o) {
211
+ function Is(o) {
212
212
  const s = [...o];
213
213
  for (; s.length > 0 && !s[0].trim(); ) s.shift();
214
214
  for (; s.length > 0 && !s[s.length - 1].trim(); ) s.pop();
215
- const a = s.filter((u) => u.trim()).map((u) => u.length - u.trimStart().length), i = a.length > 0 ? Math.min(...a) : 0;
215
+ const l = s.filter((u) => u.trim()).map((u) => u.length - u.trimStart().length), i = l.length > 0 ? Math.min(...l) : 0;
216
216
  return s.map((u) => u.trim() ? u.slice(i) : "").join(`
217
217
  `);
218
218
  }
219
- function Os(o) {
220
- const s = [], a = {}, i = {}, u = o.split(/\r?\n/);
219
+ function Ds(o) {
220
+ const s = [], l = {}, i = {}, u = o.split(/\r?\n/);
221
221
  let m = 0;
222
222
  for (; m < u.length; ) {
223
- const f = u[m], c = m + 1;
223
+ const d = u[m], c = m + 1;
224
224
  m += 1;
225
- const h = Bs(f).trim();
225
+ const h = Ps(d).trim();
226
226
  if (!h) continue;
227
227
  if (h.startsWith("-")) {
228
228
  s.push(`第 ${c} 行是列表写法(${h}):清单只认「键: 值」,每个键各占一行 —— 例如 name: 客户档案(长文本用 detail: | 起一个块,块里想写几行就写几行)`);
229
229
  continue;
230
230
  }
231
- const v = Ms(h);
231
+ const v = js(h);
232
232
  if (v < 0) {
233
233
  s.push(`第 ${c} 行不是「键: 值」(${h}):清单只认「键: 值」与 # 注释 —— 要么删掉这一行,要么照 name: 客户档案 写(长文本用 detail: | 起一个块,块的正文是**缩进**的几行)`);
234
234
  continue;
235
235
  }
236
- const g = h.slice(0, v).trim();
237
- if (!xs.test(g)) {
238
- s.push(`第 ${c} 行的键名不合法(${g}):键名只许字母或下划线开头,认得的键只有 ${ke.join(" / ")}`);
236
+ const _ = h.slice(0, v).trim();
237
+ if (!Bs.test(_)) {
238
+ s.push(`第 ${c} 行的键名不合法(${_}):键名只许字母或下划线开头,认得的键只有 ${ke.join(" / ")}`);
239
239
  continue;
240
240
  }
241
- if (!ke.includes(g)) {
241
+ if (!ke.includes(_)) {
242
242
  s.push(
243
- `第 ${c} 行的键不认识(${g}):清单只有 ${ke.join(" / ")} 这几个键(其中 ${en.join(" / ")} 必填,detail 可以不写)`
243
+ `第 ${c} 行的键不认识(${_}):清单只有 ${ke.join(" / ")} 这几个键(其中 ${en.join(" / ")} 必填,detail 可以不写)`
244
244
  );
245
245
  continue;
246
246
  }
247
- if (g in i) {
248
- s.push(`第 ${c} 行重复写了 ${g}(第 ${i[g]} 行已经写过):一个键只许出现一次`);
247
+ if (_ in i) {
248
+ s.push(`第 ${c} 行重复写了 ${_}(第 ${i[_]} 行已经写过):一个键只许出现一次`);
249
249
  continue;
250
250
  }
251
- i[g] = c;
252
- const _ = h.slice(v + 1).trim(), y = Cs.exec(_);
251
+ i[_] = c;
252
+ const g = h.slice(v + 1).trim(), y = Ms.exec(g);
253
253
  if (y) {
254
- const E = [];
254
+ const S = [];
255
255
  for (; m < u.length; ) {
256
256
  const C = u[m];
257
257
  if (C.trim() && !/^\s/.test(C)) break;
258
- E.push(C), m += 1;
258
+ S.push(C), m += 1;
259
259
  }
260
- let A = Rs(E);
260
+ let A = Is(S);
261
261
  y[1] === ">" && (A = A.split(`
262
- `).map((C) => C.trim()).filter(Boolean).join(" ")), a[g] = A;
262
+ `).map((C) => C.trim()).filter(Boolean).join(" ")), l[_] = A;
263
263
  continue;
264
264
  }
265
- a[g] = As(_);
265
+ l[_] = Ls(g);
266
266
  }
267
- for (const f of en) {
268
- const c = a[f] ?? "";
267
+ for (const d of en) {
268
+ const c = l[d] ?? "";
269
269
  if (c === "") {
270
- s.push(`清单里缺少 ${f}(或者是空的):${Ts[f]}`);
270
+ s.push(`清单里缺少 ${d}(或者是空的):${Os[d]}`);
271
271
  continue;
272
272
  }
273
- f === "id" && !$s.test(c) ? s.push(`清单里的 id 不是 uuid:${c} —— 要 8-4-4-4-12 那种十六进制`) : f === "module" && !ws.test(c) ? s.push(
273
+ d === "id" && !Ss.test(c) ? s.push(`清单里的 id 不是 uuid:${c} —— 要 8-4-4-4-12 那种十六进制`) : d === "module" && !Ts.test(c) ? s.push(
274
274
  `清单里的 module 不合法:${c} —— 它同时是 Django 的 app label,所以只许小写字母与数字、必须以字母开头(不能有横线与下划线),例如 home / orders`
275
- ) : f === "name" && !Es(c) && s.push(`清单里的 name 不合法:${c} —— 不能超过 ${je} 个字符、不能含控制字符(中文可以)`);
275
+ ) : d === "name" && !Rs(c) && s.push(`清单里的 name 不合法:${c} —— 不能超过 ${je} 个字符、不能含控制字符(中文可以)`);
276
276
  }
277
- return [a, s];
277
+ return [l, s];
278
278
  }
279
- function Ps(o) {
280
- return ks.test(o) && !o.split("/").includes("..");
279
+ function Ns(o) {
280
+ return Es.test(o) && !o.split("/").includes("..");
281
281
  }
282
- function js(o) {
283
- const s = [], a = o[Ht];
284
- a === void 0 ? s.push(`包里缺入口:必须有 ${Ht}(${sn(o)})`) : a.trim() || s.push(`${Ht} 不能是空文件`);
282
+ function Fs(o) {
283
+ const s = [], l = o[Ht];
284
+ l === void 0 ? s.push(`包里缺入口:必须有 ${Ht}(${sn(o)})`) : l.trim() || s.push(`${Ht} 不能是空文件`);
285
285
  const i = o[ye];
286
286
  let u = {};
287
287
  if (i === void 0)
@@ -289,123 +289,123 @@ function js(o) {
289
289
  else if (!i.trim())
290
290
  s.push(`${ye} 不能是空文件`);
291
291
  else {
292
- const [m, f] = Os(i);
293
- u = m, s.push(...f);
292
+ const [m, d] = Ds(i);
293
+ u = m, s.push(...d);
294
294
  }
295
295
  for (const m of Object.keys(o))
296
- Ps(m) || s.push(`文件名不合法:${m}(只许字母数字与 . _ - /,且不许 .. 与绝对路径)`);
296
+ Ns(m) || s.push(`文件名不合法:${m}(只许字母数字与 . _ - /,且不许 .. 与绝对路径)`);
297
297
  return { manifest: u, issues: s };
298
298
  }
299
- function Ls(o) {
299
+ function Us(o) {
300
300
  const s = [];
301
301
  if (o.length === 0)
302
302
  return s.push("一个块都没勾:请在「读回改动」的结果里勾上要保存的块"), { selected: 0, issues: s };
303
- for (const a of o) {
304
- const i = a.name?.trim() || "(没有名字的块)";
305
- for (const u of js(a.files ?? {}).issues) s.push(`${i}:${u}`);
303
+ for (const l of o) {
304
+ const i = l.name?.trim() || "(没有名字的块)";
305
+ for (const u of Fs(l.files ?? {}).issues) s.push(`${i}:${u}`);
306
306
  }
307
307
  return { selected: o.length, issues: s };
308
308
  }
309
- const Ds = "backend_open.py", Is = /^(?:[a-z][a-z0-9+.-]*:|\/\/)/i;
309
+ const zs = "backend_open.py", Hs = /^(?:[a-z][a-z0-9+.-]*:|\/\/)/i;
310
310
  function on(o, s) {
311
- if (Is.test(o)) return;
312
- const a = (o.split(/[?#]/)[0] ?? "").replace(/^\.\//, "").replace(/^\/+/, "");
313
- if (a in s) return nn(a) ? void 0 : a;
314
- const i = a.split("/").pop() ?? "";
311
+ if (Hs.test(o)) return;
312
+ const l = (o.split(/[?#]/)[0] ?? "").replace(/^\.\//, "").replace(/^\/+/, "");
313
+ if (l in s) return nn(l) ? void 0 : l;
314
+ const i = l.split("/").pop() ?? "";
315
315
  return i ? Object.keys(s).find((u) => !nn(u) && (u.split("/").pop() ?? "") === i) : void 0;
316
316
  }
317
- const kn = "\0mb:";
318
- function Ns(o) {
319
- return `${kn}${o}\0`;
320
- }
321
- const Fs = /<script\b([^>]*?)\bsrc\s*=\s*(["'])(.*?)\2([^>]*)>\s*<\/script\s*>/gi, zs = /<link\b([^>]*?)\bhref\s*=\s*(["'])(.*?)\2([^>]*?)\/?>/gi;
322
- function Us(o, s) {
323
- const a = [], i = (f) => (a.push(f), Ns(a.length - 1));
324
- return { html: o.replace(Fs, (f, c, h, v, g) => {
325
- const _ = on(v, s);
326
- return _ === void 0 ? f : i(`<script${c}${g}>
327
- ${$n(s[_] ?? "")}
317
+ const $n = "\0mb:";
318
+ function Ks(o) {
319
+ return `${$n}${o}\0`;
320
+ }
321
+ const qs = /<script\b([^>]*?)\bsrc\s*=\s*(["'])(.*?)\2([^>]*)>\s*<\/script\s*>/gi, Vs = /<link\b([^>]*?)\bhref\s*=\s*(["'])(.*?)\2([^>]*?)\/?>/gi;
322
+ function Js(o, s) {
323
+ const l = [], i = (d) => (l.push(d), Ks(l.length - 1));
324
+ return { html: o.replace(qs, (d, c, h, v, _) => {
325
+ const g = on(v, s);
326
+ return g === void 0 ? d : i(`<script${c}${_}>
327
+ ${wn(s[g] ?? "")}
328
328
  <\/script>`);
329
- }).replace(zs, (f, c, h, v, g) => {
330
- if (!/\brel\s*=\s*(?:"|')?stylesheet/i.test(`${c}${g}`)) return f;
331
- const _ = on(v, s);
332
- return _ === void 0 ? f : i(`<style>
333
- ${s[_]}
329
+ }).replace(Vs, (d, c, h, v, _) => {
330
+ if (!/\brel\s*=\s*(?:"|')?stylesheet/i.test(`${c}${_}`)) return d;
331
+ const g = on(v, s);
332
+ return g === void 0 ? d : i(`<style>
333
+ ${s[g]}
334
334
  </style>`);
335
- }), slots: a };
335
+ }), slots: l };
336
336
  }
337
- function $n(o) {
337
+ function wn(o) {
338
338
  return o.replace(/<\/(script)/gi, "<\\/$1");
339
339
  }
340
- function wn(o, s) {
341
- const a = /<\/head\s*>/i.exec(o);
342
- return a ? `${o.slice(0, a.index)}${s}${o.slice(a.index)}` : `${s}${o}`;
340
+ function xn(o, s) {
341
+ const l = /<\/head\s*>/i.exec(o);
342
+ return l ? `${o.slice(0, l.index)}${s}${o.slice(l.index)}` : `${s}${o}`;
343
343
  }
344
- function Hs(o, s) {
345
- return s ? wn(o, `<script>
346
- ${$n(s)}
344
+ function Gs(o, s) {
345
+ return s ? xn(o, `<script>
346
+ ${wn(s)}
347
347
  <\/script>
348
348
  `) : o;
349
349
  }
350
350
  function ln(o, s) {
351
- return s ? wn(o, `<style data-magic-block="host">
351
+ return s ? xn(o, `<style data-magic-block="host">
352
352
  ${s}
353
353
  </style>
354
354
  `) : o;
355
355
  }
356
- function Ks(o, s = {}) {
357
- const a = s.bootstrap ?? "", i = s.css ?? "", u = s.themeCss ?? "", m = o[Ht];
356
+ function Ws(o, s = {}) {
357
+ const l = s.bootstrap ?? "", i = s.css ?? "", u = s.themeCss ?? "", m = o[Ht];
358
358
  if (m === void 0) return "";
359
- const { html: f, slots: c } = Us(m, o), h = Hs(ln(ln(f, u), i), a), v = h.split(kn);
359
+ const { html: d, slots: c } = Js(m, o), h = Gs(ln(ln(d, u), i), l), v = h.split($n);
360
360
  if (v.length === 1) return h;
361
- let g = v[0] ?? "";
362
- for (let _ = 1; _ < v.length; _ += 1) {
363
- const y = v[_] ?? "", E = y.indexOf("\0"), A = Number(y.slice(0, E));
364
- g += (c[A] ?? "") + y.slice(E + 1);
361
+ let _ = v[0] ?? "";
362
+ for (let g = 1; g < v.length; g += 1) {
363
+ const y = v[g] ?? "", S = y.indexOf("\0"), A = Number(y.slice(0, S));
364
+ _ += (c[A] ?? "") + y.slice(S + 1);
365
365
  }
366
- return g;
366
+ return _;
367
367
  }
368
- const Ut = /* @__PURE__ */ new Map();
368
+ const zt = /* @__PURE__ */ new Map();
369
369
  let jt = null;
370
370
  const Me = /* @__PURE__ */ new Set();
371
- function qs(o) {
371
+ function Ys(o) {
372
372
  return Me.add(o), () => {
373
373
  Me.delete(o);
374
374
  };
375
375
  }
376
- function Vs() {
377
- Ut.clear(), jt = null;
376
+ function Zs() {
377
+ zt.clear(), jt = null;
378
378
  for (const o of Me) o();
379
379
  }
380
- async function Js(o) {
380
+ async function Xs(o) {
381
381
  const s = [...new Set(o)].filter(Boolean);
382
- if (s.some((a) => !Ut.has(a))) {
382
+ if (s.some((l) => !zt.has(l))) {
383
383
  jt && await jt.catch(() => {
384
384
  });
385
- const a = s.filter((i) => !Ut.has(i));
386
- a.length > 0 && (jt = at(`/magic-blocks/render?ids=${a.map(encodeURIComponent).join(",")}`).then((i) => {
387
- for (const u of i) u?.id && Ut.set(u.id, u);
385
+ const l = s.filter((i) => !zt.has(i));
386
+ l.length > 0 && (jt = at(`/magic-blocks/render?ids=${l.map(encodeURIComponent).join(",")}`).then((i) => {
387
+ for (const u of i) u?.id && zt.set(u.id, u);
388
388
  return i;
389
389
  }).catch(() => []).finally(() => {
390
390
  jt = null;
391
391
  }), await jt.catch(() => {
392
392
  }));
393
393
  }
394
- return s.map((a) => Ut.get(a)).filter((a) => !!a);
394
+ return s.map((l) => zt.get(l)).filter((l) => !!l);
395
395
  }
396
396
  const Bt = "labull.css", ee = "CONTROLS.lock.html";
397
- function Gs(o, s) {
398
- const a = String(s || "");
399
- if (/@font-face|@keyframes/i.test(a)) return !0;
397
+ function Qs(o, s) {
398
+ const l = String(s || "");
399
+ if (/@font-face|@keyframes/i.test(l)) return !0;
400
400
  const i = String(o || "");
401
- return /(^|[\s,>+~])(\.p-|\.pi(?![a-z])|\.pi-|\.labull-|:root|html(?![a-z-])|body(?![a-z-])|\*|:where\()/.test(i) ? !0 : /--(?:sp|surface|primary|text-color|content|highlight|focus-ring|p-)/.test(a);
401
+ return /(^|[\s,>+~])(\.p-|\.pi(?![a-z])|\.pi-|\.labull-|:root|html(?![a-z-])|body(?![a-z-])|\*|:where\()/.test(i) ? !0 : /--(?:sp|surface|primary|text-color|content|highlight|focus-ring|p-)/.test(l);
402
402
  }
403
- function xn(o, s, a) {
403
+ function Cn(o, s, l) {
404
404
  for (let i = 0; i < o.length; i += 1) {
405
- const u = o[i], m = String(u.cssText || ""), f = String(u.selectorText || "");
405
+ const u = o[i], m = String(u.cssText || ""), d = String(u.selectorText || "");
406
406
  if (u.cssRules && u.cssRules.length > 0) {
407
407
  const c = [];
408
- if (xn(u.cssRules, c, a), c.length === 0) continue;
408
+ if (Cn(u.cssRules, c, l), c.length === 0) continue;
409
409
  const h = m.slice(0, m.indexOf("{")).trim();
410
410
  s.push(`${h} {
411
411
  ${c.map((v) => " " + v).join(`
@@ -413,31 +413,31 @@ ${c.map((v) => " " + v).join(`
413
413
  }`);
414
414
  continue;
415
415
  }
416
- Gs(f, m) && (s.push(m), a.n += 1);
416
+ Qs(d, m) && (s.push(m), l.n += 1);
417
417
  }
418
418
  }
419
- function Cn() {
420
- const o = [], s = [], a = { n: 0 };
419
+ function En() {
420
+ const o = [], s = [], l = { n: 0 };
421
421
  let i = 0;
422
422
  const u = typeof document > "u" ? [] : Array.from(document.styleSheets);
423
- for (const f of u) {
424
- const c = f.href || "(内联 <style>)";
423
+ for (const d of u) {
424
+ const c = d.href || "(内联 <style>)";
425
425
  let h = null;
426
426
  try {
427
- h = f.cssRules;
427
+ h = d.cssRules;
428
428
  } catch {
429
429
  s.push(c);
430
430
  continue;
431
431
  }
432
432
  if (!h || h.length === 0) continue;
433
433
  const v = [];
434
- xn(h, v, a), v.length !== 0 && (i += 1, o.push(`/* ── ${c} ── */`, ...v));
434
+ Cn(h, v, l), v.length !== 0 && (i += 1, o.push(`/* ── ${c} ── */`, ...v));
435
435
  }
436
436
  return { css: [
437
437
  "/* 生成物:每次导出都会重写,别手改。",
438
438
  " *",
439
439
  " * 这是这个应用此刻真正在用的 **labull 主题 + 控件样式**(token / PrimeVue 控件 / 结构类 / 图标)。",
440
- ` * 收自 ${i} 张样式表、${a.n} 条规则。`,
440
+ ` * 收自 ${i} 张样式表、${l.n} 条规则。`,
441
441
  s.length > 0 ? ` * ⚠️ 有 ${s.length} 张样式表读不到规则(跨源,浏览器不让读):${s.join(" / ")} —— 需要的话手动补一份。` : " * (没有读不到的样式表:收全了。)",
442
442
  " *",
443
443
  " * 怎么用(块里):**什么都不用加** —— 宿主会把这一份注入每个块的 iframe(`MagicBlockHost` 的 `theme` prop),",
@@ -451,17 +451,17 @@ function Cn() {
451
451
  ].join(`
452
452
  `) + o.join(`
453
453
  `) + `
454
- `, sheets: i, skipped: s, rules: a.n };
454
+ `, sheets: i, skipped: s, rules: l.n };
455
455
  }
456
- function Ws() {
457
- const o = '<button class="p-button" type="button">主要按钮</button>', s = (f, c, h) => ` <li class="labull-step${f ? ` ${f}` : ""}">
456
+ function to() {
457
+ const o = '<button class="p-button" type="button">主要按钮</button>', s = (d, c, h) => ` <li class="labull-step${d ? ` ${d}` : ""}">
458
458
  <span class="labull-step-node"></span>
459
459
  <span class="labull-step-label">${c}</span>
460
460
  <span class="labull-step-desc">${h}</span>
461
- </li>`, a = (f, c = "") => `<ol class="labull-steps${c ? ` ${c}` : ""}">
462
- ` + f.map(([h, v, g]) => s(h, v, g)).join(`
461
+ </li>`, l = (d, c = "") => `<ol class="labull-steps${c ? ` ${c}` : ""}">
462
+ ` + d.map(([h, v, _]) => s(h, v, _)).join(`
463
463
  `) + `
464
- </ol>`, i = a([
464
+ </ol>`, i = l([
465
465
  ["is-done", "草稿", "需求已创建"],
466
466
  ["is-current", "待审批", "等管理员审批"],
467
467
  ["", "审批通过", "待处理"],
@@ -485,19 +485,19 @@ function Ws() {
485
485
  /* 🔴 流程链条:**纯 CSS**(没有 JS),状态加在 `<li>` 上;桌面横向、手机自动转纵向。
486
486
  * 三行分别是:默认那条链 / 强制纵向那个参数 / 四个状态各长什么样。 */
487
487
  ["流程链条(工作流步骤条):桌面横向、手机自动纵向;节点空着会自动编号,已完成自动显示 ✓", i],
488
- ["流程链条 · 参数 <code>labull-steps--vertical</code>(强制纵向:手机那一套,侧栏那种窄容器也用它)", a([
488
+ ["流程链条 · 参数 <code>labull-steps--vertical</code>(强制纵向:手机那一套,侧栏那种窄容器也用它)", l([
489
489
  ["is-done", "草稿", "需求已创建"],
490
490
  ["is-current", "待审批", "等管理员审批"],
491
491
  ["", "审批通过", "待处理"],
492
492
  ["", "开发完成", "待处理"],
493
493
  ["", "验收完成", "待处理"]
494
494
  ], "labull-steps--vertical")],
495
- ["流程链条 · 参数 <code>labull-steps--horizontal</code>(强制横向:在手机上也横着排;⚠️ 手机上只适合 2-4 步,5 步以上用默认或 --vertical)", a([
495
+ ["流程链条 · 参数 <code>labull-steps--horizontal</code>(强制横向:在手机上也横着排;⚠️ 手机上只适合 2-4 步,5 步以上用默认或 --vertical)", l([
496
496
  ["is-done", "提交", "10-05"],
497
497
  ["is-current", "审批", "进行中"],
498
498
  ["", "完成", "待处理"]
499
499
  ], "labull-steps--horizontal")],
500
- ["流程链条 · 状态:<code>is-done</code> / <code>is-current</code> / 不写(待处理)/ <code>is-danger</code>(退回 · 终止)", a([
500
+ ["流程链条 · 状态:<code>is-done</code> / <code>is-current</code> / 不写(待处理)/ <code>is-danger</code>(退回 · 终止)", l([
501
501
  ["is-done", "已修复", "张三 10-05"],
502
502
  ["is-current", "待验收", "等提出人确认"],
503
503
  ["is-danger", "被退回", "原因:信息不全"],
@@ -505,8 +505,8 @@ function Ws() {
505
505
  ])],
506
506
  ["表格", "<table><thead><tr><th>列 A</th><th>列 B</th></tr></thead><tbody><tr><td>值</td><td>值</td></tr></tbody></table>"]
507
507
  ].map(
508
- ([f, c]) => ` <section>
509
- <h3>${f}</h3>
508
+ ([d, c]) => ` <section>
509
+ <h3>${d}</h3>
510
510
  <div class="demo">${c}</div>
511
511
  <pre>${c.replace(/&/g, "&amp;").replace(/</g, "&lt;")}</pre>
512
512
  </section>`
@@ -548,12 +548,12 @@ ${m}
548
548
  </html>
549
549
  `;
550
550
  }
551
- const Mt = /* @__PURE__ */ new Map(), Ae = /* @__PURE__ */ new Set(), Ys = 4e3;
551
+ const Mt = /* @__PURE__ */ new Map(), Ae = /* @__PURE__ */ new Set(), eo = 4e3;
552
552
  let Re = "", te = null;
553
553
  function an() {
554
554
  for (const o of Ae) o();
555
555
  }
556
- function Zs(o) {
556
+ function no(o) {
557
557
  return Ae.add(o), () => {
558
558
  Ae.delete(o);
559
559
  };
@@ -561,47 +561,47 @@ function Zs(o) {
561
561
  function $e() {
562
562
  return Re;
563
563
  }
564
- function Xs(o, s) {
565
- const a = String(o || "").trim(), i = String(s || "").trim();
566
- if (!a || !i) return () => {
564
+ function so(o, s) {
565
+ const l = String(o || "").trim(), i = String(s || "").trim();
566
+ if (!l || !i) return () => {
567
567
  };
568
- let u = Mt.get(a);
569
- return u || (u = /* @__PURE__ */ new Set(), Mt.set(a, u)), u.add(i), () => {
570
- const m = Mt.get(a);
571
- m && (m.delete(i), m.size === 0 && Mt.delete(a));
568
+ let u = Mt.get(l);
569
+ return u || (u = /* @__PURE__ */ new Set(), Mt.set(l, u)), u.add(i), () => {
570
+ const m = Mt.get(l);
571
+ m && (m.delete(i), m.size === 0 && Mt.delete(l));
572
572
  };
573
573
  }
574
- function Oe(o, s, a) {
574
+ function Oe(o, s, l) {
575
575
  const i = Mt.get(String(o || ""));
576
576
  if (!i) return null;
577
577
  for (const u of i)
578
- if (u !== s && !(a && !a(u)))
578
+ if (u !== s && !(l && !l(u)))
579
579
  return u;
580
580
  return null;
581
581
  }
582
- function Qs(o) {
582
+ function oo(o) {
583
583
  return [...Mt.get(String(o || "")) ?? []];
584
584
  }
585
- function to(o, s, a) {
585
+ function lo(o, s, l) {
586
586
  const i = Mt.get(String(o || ""));
587
- return !i || i.size === 0 || i.has(s) ? null : Oe(o, s, a);
587
+ return !i || i.size === 0 || i.has(s) ? null : Oe(o, s, l);
588
588
  }
589
- function Sn(o, s = Ys) {
589
+ function Sn(o, s = eo) {
590
590
  Re = String(o || ""), te !== null && clearTimeout(te), te = setTimeout(() => {
591
591
  te = null, Re = "", an();
592
592
  }, Math.max(1, s)), an();
593
593
  }
594
- const eo = ["data-magic-block", "data-magic-module"], no = ["srcdoc", "title"], so = { class: "mb__state" }, oo = { class: "mb__brief" }, lo = {
594
+ const ao = ["data-magic-block", "data-magic-module"], io = ["srcdoc", "title"], uo = { class: "mb__state" }, co = { class: "mb__brief" }, ro = {
595
595
  key: 0,
596
596
  class: "mb__reason"
597
- }, ao = {
597
+ }, po = {
598
598
  key: 1,
599
599
  class: "mb__issues"
600
- }, io = {
600
+ }, fo = {
601
601
  key: 2,
602
602
  class: "mb__ring",
603
603
  "aria-hidden": "true"
604
- }, uo = ["title", "aria-label"], co = ["title", "aria-label"], ro = ["title", "aria-label"], po = ["title", "aria-label"], bo = /* @__PURE__ */ Pe({
604
+ }, bo = ["title", "aria-label"], mo = ["title", "aria-label"], vo = ["title", "aria-label"], ho = ["title", "aria-label"], go = /* @__PURE__ */ Pe({
605
605
  __name: "MagicBlockHost",
606
606
  props: {
607
607
  uuid: {},
@@ -610,44 +610,44 @@ const eo = ["data-magic-block", "data-magic-module"], no = ["srcdoc", "title"],
610
610
  theme: { type: Boolean, default: !0 }
611
611
  },
612
612
  setup(o) {
613
- const s = o, a = fs(), i = bn(), { isStaff: u } = fn(), m = x(null), f = x(null), c = x(null), h = x(!1), v = x(0), g = x(0);
614
- let _ = null, y = null, E = null, A = null, C = null, R = null;
615
- const P = j(() => s.name.trim() || s.uuid), z = j(() => c.value?.state ?? ""), Z = j(() => z.value === "invalid" ? "校验不通过" : z.value === "draft" ? "未开发" : P.value), X = j(() => (c.value?.brief ?? "").trim() || (c.value?.name ?? "").trim() || P.value), yt = j(() => (c.value?.reason ?? "").trim()), kt = j(() => c.value?.issues ?? []), S = j(() => Math.max(g.value, v.value, 1)), Dt = j(() => ({ height: `${S.value}px` })), ut = j(() => {
613
+ const s = o, l = _s(), i = bn(), { isStaff: u } = mn(), m = x(null), d = x(null), c = x(null), h = x(!1), v = x(0), _ = x(0);
614
+ let g = null, y = null, S = null, A = null, C = null, R = null;
615
+ const P = j(() => s.name.trim() || s.uuid), U = j(() => c.value?.state ?? ""), Z = j(() => U.value === "invalid" ? "校验不通过" : U.value === "draft" ? "未开发" : P.value), X = j(() => (c.value?.brief ?? "").trim() || (c.value?.name ?? "").trim() || P.value), yt = j(() => (c.value?.reason ?? "").trim()), kt = j(() => c.value?.issues ?? []), E = j(() => Math.max(_.value, v.value, 1)), It = j(() => ({ height: `${E.value}px` })), ut = j(() => {
616
616
  const w = {};
617
- for (const [T, D] of Object.entries(c.value?.files ?? {})) T !== Ds && (w[T] = D);
617
+ for (const [T, I] of Object.entries(c.value?.files ?? {})) T !== zs && (w[T] = I);
618
618
  return w;
619
- }), $t = j(() => z.value === "ok" && typeof ut.value[Ht] == "string");
619
+ }), $t = j(() => U.value === "ok" && typeof ut.value[Ht] == "string");
620
620
  let st = null;
621
621
  function q() {
622
622
  if (!s.theme) return "";
623
623
  if (st !== null || (st = "", typeof document > "u")) return st;
624
624
  try {
625
- st = Cn().css;
625
+ st = En().css;
626
626
  } catch {
627
627
  st = "";
628
628
  }
629
629
  return st;
630
630
  }
631
- const U = j(() => {
631
+ const z = j(() => {
632
632
  if (!$t.value) return "";
633
- const w = { bootstrap: hs, css: vs }, T = q();
634
- return T && (w.themeCss = T), Ks(ut.value, w);
633
+ const w = { bootstrap: $s, css: ks }, T = q();
634
+ return T && (w.themeCss = T), Ws(ut.value, w);
635
635
  });
636
636
  function Q() {
637
- return { key: a.key, path: a.path, params: a.params, query: a.query };
637
+ return { key: l.key, path: l.path, params: l.params, query: l.query };
638
638
  }
639
639
  async function wt(w) {
640
640
  const T = i.resolve(w);
641
641
  if (T.matched.length === 0) {
642
- const D = i.getRoutes().map((rt) => rt.path);
643
- throw new Error(`这个应用里没有页面 ${w}。能跳的页面只有:${D.length > 0 ? D.join(" / ") : "(还没有配路由)"}`);
642
+ const I = i.getRoutes().map((rt) => rt.path);
643
+ throw new Error(`这个应用里没有页面 ${w}。能跳的页面只有:${I.length > 0 ? I.join(" / ") : "(还没有配路由)"}`);
644
644
  }
645
645
  return Te(w) || T.fullPath;
646
646
  }
647
- function ft() {
648
- E?.(), E = null;
649
- const w = f.value;
650
- w && (E = ys(w, {
647
+ function bt() {
648
+ S?.(), S = null;
649
+ const w = d.value;
650
+ w && (S = Cs(w, {
651
651
  uuid: s.uuid,
652
652
  onHeight: (T) => {
653
653
  v.value = T;
@@ -656,27 +656,27 @@ const eo = ["data-magic-block", "data-magic-module"], no = ["srcdoc", "title"],
656
656
  context: Q,
657
657
  /* 🔴 块给**自己所属那条标签**起名:整页就是一个块时(`MagicBlockPage`),标签栏上那条
658
658
  * 默认只有路由的 `meta.title`("订单详情"),而"订单 SO-42"只有块自己知道。 */
659
- onTabTitle: (T, D) => a.setTitle(T, D)
659
+ onTabTitle: (T, I) => l.setTitle(T, I)
660
660
  }));
661
661
  }
662
662
  async function xt() {
663
- const w = s.uuid, T = await Js([w]);
664
- w === s.uuid && (c.value = T.find((D) => D.id === w) ?? null);
663
+ const w = s.uuid, T = await Xs([w]);
664
+ w === s.uuid && (c.value = T.find((I) => I.id === w) ?? null);
665
665
  }
666
666
  function Kt() {
667
667
  window.dispatchEvent(new CustomEvent("magic-block:open-console", { detail: { uuid: s.uuid } }));
668
668
  }
669
669
  function qt(w = !1) {
670
- w && C?.(), C = Xs(s.uuid, a.key);
670
+ w && C?.(), C = so(s.uuid, l.key);
671
671
  }
672
- const tt = (w) => !mn(w, i), V = j(() => {
672
+ const tt = (w) => !vn(w, i), V = j(() => {
673
673
  if (!u.value) return "";
674
- const w = Oe(s.uuid, a.key, tt);
674
+ const w = Oe(s.uuid, l.key, tt);
675
675
  return w ? `管理员:切到还挂着这个块的标签 ${w}(点一下这一块会亮红框)` : "管理员:这个块只在这一条标签里挂着 —— 点一下会亮几秒红框";
676
676
  });
677
677
  function O() {
678
678
  if (!u.value) return;
679
- const w = Oe(s.uuid, a.key, tt);
679
+ const w = Oe(s.uuid, l.key, tt);
680
680
  Sn(s.uuid), w && Te(w);
681
681
  }
682
682
  function ct(w) {
@@ -690,24 +690,24 @@ const eo = ["data-magic-block", "data-magic-module"], no = ["srcdoc", "title"],
690
690
  function W() {
691
691
  const w = m.value;
692
692
  if (!w) return 0;
693
- const T = ct(w), D = getComputedStyle(T), rt = parseFloat(D.paddingTop) || 0, It = parseFloat(D.paddingBottom) || 0, H = parseFloat(D.borderTopWidth) || 0, Nt = T === document.documentElement, oe = Nt ? Math.max(0, window.innerHeight - rt - It) : Math.max(0, T.clientHeight - rt - It), le = Nt ? rt : T.getBoundingClientRect().top + H + rt, ae = Nt ? window.scrollY || 0 : T.scrollTop, J = w.getBoundingClientRect().top - le + ae;
693
+ const T = ct(w), I = getComputedStyle(T), rt = parseFloat(I.paddingTop) || 0, Dt = parseFloat(I.paddingBottom) || 0, H = parseFloat(I.borderTopWidth) || 0, Nt = T === document.documentElement, oe = Nt ? Math.max(0, window.innerHeight - rt - Dt) : Math.max(0, T.clientHeight - rt - Dt), le = Nt ? rt : T.getBoundingClientRect().top + H + rt, ae = Nt ? window.scrollY || 0 : T.scrollTop, J = w.getBoundingClientRect().top - le + ae;
694
694
  return Math.max(0, Math.floor(oe - J));
695
695
  }
696
696
  function Y() {
697
- if (!a.active.value || !m.value) return;
697
+ if (!l.active.value || !m.value) return;
698
698
  const w = W();
699
- w > 0 && Math.abs(w - g.value) > 1 && (g.value = w);
699
+ w > 0 && Math.abs(w - _.value) > 1 && (_.value = w);
700
700
  }
701
701
  function ot() {
702
702
  if (!m.value) return;
703
703
  const w = ct(m.value);
704
- _ !== w && (_ = w, y?.disconnect(), y = null), Y(), !(y || typeof ResizeObserver > "u") && (y = new ResizeObserver(() => Y()), y.observe(w));
704
+ g !== w && (g = w, y?.disconnect(), y = null), Y(), !(y || typeof ResizeObserver > "u") && (y = new ResizeObserver(() => Y()), y.observe(w));
705
705
  }
706
- return Pt(f, () => ft()), Pt(U, () => {
707
- v.value = 0, g.value = 0, ot();
706
+ return Pt(d, () => bt()), Pt(z, () => {
707
+ v.value = 0, _.value = 0, ot();
708
708
  }, { flush: "post" }), Pt(() => s.uuid, () => {
709
709
  Qe().then(() => ot());
710
- }), Pt(() => a.active.value, (w) => {
710
+ }), Pt(() => l.active.value, (w) => {
711
711
  w && Qe().then(() => {
712
712
  ot();
713
713
  const T = m.value;
@@ -715,83 +715,147 @@ const eo = ["data-magic-block", "data-magic-module"], no = ["srcdoc", "title"],
715
715
  });
716
716
  }), Pt(() => s.uuid, () => {
717
717
  v.value = 0, c.value = null, qt(!0), h.value = $e() === s.uuid, xt();
718
- }), rn(() => {
719
- A = qs(() => void xt()), R = Zs(() => {
718
+ }), dn(() => {
719
+ A = Ys(() => void xt()), R = no(() => {
720
720
  h.value = $e() === s.uuid;
721
721
  }), h.value = $e() === s.uuid, qt(), ot(), xt();
722
- }), dn(() => {
723
- y?.disconnect(), y = null, A?.(), A = null, R?.(), R = null, C?.(), C = null, E?.(), E = null;
724
- }), (w, T) => (d(), p("div", {
722
+ }), pn(() => {
723
+ y?.disconnect(), y = null, A?.(), A = null, R?.(), R = null, C?.(), C = null, S?.(), S = null;
724
+ }), (w, T) => (p(), f("div", {
725
725
  ref_key: "el",
726
726
  ref: m,
727
727
  class: K(["mb", { "mb--admin": it(u), "mb--lit": it(u) && h.value }]),
728
- style: pn(Dt.value),
728
+ style: fn(It.value),
729
729
  "data-magic-block": o.uuid,
730
730
  "data-magic-module": o.module
731
731
  }, [
732
- $t.value ? (d(), p("iframe", {
732
+ $t.value ? (p(), f("iframe", {
733
733
  key: 0,
734
734
  ref_key: "frame",
735
- ref: f,
735
+ ref: d,
736
736
  class: "mb__frame",
737
- srcdoc: U.value,
737
+ srcdoc: z.value,
738
738
  title: P.value,
739
739
  scrolling: "no",
740
740
  sandbox: "allow-scripts allow-forms allow-modals allow-popups allow-downloads"
741
- }, null, 8, no)) : (d(), p("div", {
741
+ }, null, 8, io)) : (p(), f("div", {
742
742
  key: 1,
743
- class: K(["mb__empty", { "mb__empty--off": z.value === "invalid", "mb__empty--draft": z.value === "draft" }]),
743
+ class: K(["mb__empty", { "mb__empty--off": U.value === "invalid", "mb__empty--draft": U.value === "draft" }]),
744
744
  onClick: O
745
745
  }, [
746
- l("p", so, b(Z.value), 1),
747
- l("p", oo, b(X.value), 1),
748
- z.value === "invalid" && yt.value ? (d(), p("p", lo, b(yt.value), 1)) : k("", !0),
749
- z.value === "invalid" && kt.value.length > 0 ? (d(), p("ul", ao, [
750
- (d(!0), p(M, null, N(kt.value, (D, rt) => (d(), p("li", {
746
+ a("p", uo, b(Z.value), 1),
747
+ a("p", co, b(X.value), 1),
748
+ U.value === "invalid" && yt.value ? (p(), f("p", ro, b(yt.value), 1)) : k("", !0),
749
+ U.value === "invalid" && kt.value.length > 0 ? (p(), f("ul", po, [
750
+ (p(!0), f(M, null, N(kt.value, (I, rt) => (p(), f("li", {
751
751
  key: rt,
752
752
  class: "mb__issue"
753
- }, b(D.message), 1))), 128))
753
+ }, b(I.message), 1))), 128))
754
754
  ])) : k("", !0),
755
- l("button", {
755
+ a("button", {
756
756
  class: "mb__go",
757
757
  type: "button",
758
- onClick: Ee(Kt, ["stop"])
758
+ onClick: Se(Kt, ["stop"])
759
759
  }, "去控制台")
760
760
  ], 2)),
761
- it(u) ? (d(), p("span", io)) : k("", !0),
762
- it(u) && $t.value ? (d(), p(M, { key: 3 }, [
763
- l("button", {
761
+ it(u) ? (p(), f("span", fo)) : k("", !0),
762
+ it(u) && $t.value ? (p(), f(M, { key: 3 }, [
763
+ a("button", {
764
764
  class: "mb__grab mb__grab--top",
765
765
  type: "button",
766
766
  title: V.value,
767
767
  "aria-label": V.value,
768
768
  onClick: O
769
- }, null, 8, uo),
770
- l("button", {
769
+ }, null, 8, bo),
770
+ a("button", {
771
771
  class: "mb__grab mb__grab--right",
772
772
  type: "button",
773
773
  title: V.value,
774
774
  "aria-label": V.value,
775
775
  onClick: O
776
- }, null, 8, co),
777
- l("button", {
776
+ }, null, 8, mo),
777
+ a("button", {
778
778
  class: "mb__grab mb__grab--bottom",
779
779
  type: "button",
780
780
  title: V.value,
781
781
  "aria-label": V.value,
782
782
  onClick: O
783
- }, null, 8, ro),
784
- l("button", {
783
+ }, null, 8, vo),
784
+ a("button", {
785
785
  class: "mb__grab mb__grab--left",
786
786
  type: "button",
787
787
  title: V.value,
788
788
  "aria-label": V.value,
789
789
  onClick: O
790
- }, null, 8, po)
790
+ }, null, 8, ho)
791
791
  ], 64)) : k("", !0)
792
- ], 14, eo));
792
+ ], 14, ao));
793
+ }
794
+ }), _o = /* @__PURE__ */ hn(go, [["__scopeId", "data-v-8e1e849f"]]);
795
+ function ht(o) {
796
+ return typeof o == "string" ? o.trim() : "";
797
+ }
798
+ function Tn(o) {
799
+ const s = ht(o?.meta?.blockUuid);
800
+ if (s) return s;
801
+ const l = o?.props;
802
+ if (!l || typeof l != "object" || Array.isArray(l)) return "";
803
+ const i = l.default;
804
+ return !i || typeof i != "object" || Array.isArray(i) ? "" : ht(i.uuid);
805
+ }
806
+ function yo(o, s) {
807
+ const l = [], i = /* @__PURE__ */ new Set();
808
+ for (const u of o ?? []) {
809
+ if (!u || u.redirect || u.components?.default !== s) continue;
810
+ const m = Tn(u);
811
+ if (!m || i.has(m)) continue;
812
+ i.add(m);
813
+ const d = ht(u.path), c = ht(u.meta?.title) || ht(u.meta?.sub) || d;
814
+ l.push({ uuid: m, path: d, title: c, module: ht(u.meta?.module), brief: ht(u.meta?.brief) });
793
815
  }
794
- }), fo = /* @__PURE__ */ vn(bo, [["__scopeId", "data-v-8e1e849f"]]), mo = /* @__PURE__ */ Pe({
816
+ return l;
817
+ }
818
+ function ko(o, s, l) {
819
+ const i = /* @__PURE__ */ new Set();
820
+ for (const u of l ?? []) i.add(ht(u));
821
+ return yo(o, s).filter((u) => !i.has(u.uuid));
822
+ }
823
+ const Bn = "__labullBlockPage";
824
+ function $o(o) {
825
+ return typeof o == "object" && o !== null && o[Bn] === !0;
826
+ }
827
+ const un = '块标签里的东西(标题 / 按钮 / 参数展示 / 第二块区域)全部写进块自己的 index.open.html:页面这一层只回答"哪条地址是哪个块"。';
828
+ function wo(o, s) {
829
+ const l = o?.components?.default;
830
+ return l == null ? !1 : $o(l) ? !0 : s != null && l === s;
831
+ }
832
+ function xo(o, s) {
833
+ const l = [];
834
+ if (!o || o.length === 0) return l;
835
+ const i = o[o.length - 1], u = ht(i?.path);
836
+ if (o.findIndex((c) => wo(c, s)) !== o.length - 1)
837
+ return l.push({
838
+ code: "wrapped",
839
+ path: u,
840
+ message: `这条路由(${u || "拿不到路径"})渲染的不是块页本身:块页被包在别的组件里(包装页 / 渲染函数),或者被当成了某一层的布局。${un}`
841
+ }), l;
842
+ o.length > 1 && l.push({
843
+ code: "nested",
844
+ path: u,
845
+ message: `块路由(${u})挂在别的路由下面:父级 template 里除了 <RouterView> 还有别的东西。块路由必须是顶层那一条。`
846
+ });
847
+ const d = Object.keys(i?.components ?? {}).filter((c) => c !== "default");
848
+ return d.length > 0 && l.push({
849
+ code: "extra-views",
850
+ path: u,
851
+ message: `这条路由(${u})除了默认视图还挂了具名视图(${d.join(" / ")})—— 那正是"在块旁边摆第二块内容"。${un}`
852
+ }), Tn(i) || l.push({
853
+ code: "no-uuid",
854
+ path: u,
855
+ message: `这条路由(${u})挂了块页却没说这是哪个块:写 meta.blockUuid(推荐)或 props: { uuid },否则这一页渲染出来是"未开发"。`
856
+ }), l;
857
+ }
858
+ const Mn = /* @__PURE__ */ Pe({
795
859
  __name: "MagicBlockPage",
796
860
  props: {
797
861
  uuid: { default: "" },
@@ -800,11 +864,16 @@ const eo = ["data-magic-block", "data-magic-module"], no = ["srcdoc", "title"],
800
864
  theme: { type: Boolean, default: !0 }
801
865
  },
802
866
  setup(o) {
803
- const s = o, a = ps(), i = j(() => {
804
- const u = a.meta?.blockUuid;
805
- return typeof u == "string" && u.trim() ? u.trim() : s.uuid;
806
- });
807
- return (u, m) => (d(), cs(fo, {
867
+ const s = o, l = hs(), i = j(() => {
868
+ const d = l.meta?.blockUuid;
869
+ return typeof d == "string" && d.trim() ? d.trim() : s.uuid;
870
+ }), u = fs()?.type, m = xo(l.matched, u);
871
+ if (m.length > 0) {
872
+ const d = m.map((c) => `[labull] ${c.message}`).join(`
873
+ `);
874
+ console.error(d);
875
+ }
876
+ return (d, c) => (p(), bs(_o, {
808
877
  uuid: i.value,
809
878
  name: o.name,
810
879
  module: o.module,
@@ -815,159 +884,131 @@ const eo = ["data-magic-block", "data-magic-module"], no = ["srcdoc", "title"],
815
884
  function _t(o) {
816
885
  return String(o ?? "").replace(/&/g, "&amp;").replace(/</g, "&lt;").replace(/>/g, "&gt;").replace(/"/g, "&quot;");
817
886
  }
818
- function vo(o) {
887
+ function Co(o) {
819
888
  return /^(https?:\/\/|mailto:|\/(?!\/))/i.test(String(o ?? "").trim());
820
889
  }
821
890
  function Lt(o) {
822
891
  const s = String(o ?? "");
823
- let a = "", i = 0;
892
+ let l = "", i = 0;
824
893
  for (; i < s.length; ) {
825
894
  const u = s.slice(i), m = /^`([^`]+)`/.exec(u);
826
895
  if (m) {
827
- a += `<code>${_t(m[1])}</code>`, i += m[0].length;
896
+ l += `<code>${_t(m[1])}</code>`, i += m[0].length;
828
897
  continue;
829
898
  }
830
- const f = /^!\[[^\]]*\]\([^)\s]*\)/.exec(u);
831
- if (f) {
832
- a += _t(f[0]), i += f[0].length;
899
+ const d = /^!\[[^\]]*\]\([^)\s]*\)/.exec(u);
900
+ if (d) {
901
+ l += _t(d[0]), i += d[0].length;
833
902
  continue;
834
903
  }
835
904
  const c = /^\[([^\]]*)\]\(([^)\s]*)\)/.exec(u);
836
- if (c && vo(c[2])) {
837
- a += `<a href="${_t(c[2])}" target="_blank" rel="noopener noreferrer">${Lt(c[1])}</a>`, i += c[0].length;
905
+ if (c && Co(c[2])) {
906
+ l += `<a href="${_t(c[2])}" target="_blank" rel="noopener noreferrer">${Lt(c[1])}</a>`, i += c[0].length;
838
907
  continue;
839
908
  }
840
909
  const h = /^\*\*([^*]+)\*\*/.exec(u);
841
910
  if (h) {
842
- a += `<strong>${_t(h[1])}</strong>`, i += h[0].length;
911
+ l += `<strong>${_t(h[1])}</strong>`, i += h[0].length;
843
912
  continue;
844
913
  }
845
914
  const v = /^\*([^*\n]+)\*/.exec(u) ?? /^_([^_\n]+)_/.exec(u);
846
915
  if (v) {
847
- a += `<em>${_t(v[1])}</em>`, i += v[0].length;
916
+ l += `<em>${_t(v[1])}</em>`, i += v[0].length;
848
917
  continue;
849
918
  }
850
- a += _t(s[i]), i += 1;
919
+ l += _t(s[i]), i += 1;
851
920
  }
852
- return a;
921
+ return l;
853
922
  }
854
- function ho(o) {
923
+ function Eo(o) {
855
924
  const s = String(o ?? "").replace(/\r\n?/g, `
856
925
  `).split(`
857
- `), a = [];
858
- let i = "", u = [], m = [], f = !1, c = [];
926
+ `), l = [];
927
+ let i = "", u = [], m = [], d = !1, c = [];
859
928
  const h = () => {
860
- u.length > 0 && (a.push(`<p>${u.map((E) => Lt(E)).join("<br>")}</p>`), u = []);
929
+ u.length > 0 && (l.push(`<p>${u.map((S) => Lt(S)).join("<br>")}</p>`), u = []);
861
930
  }, v = () => {
862
- m.length > 0 && (a.push(`<blockquote>${m.map((E) => Lt(E)).join("<br>")}</blockquote>`), m = []);
863
- }, g = () => {
864
- i && (a.push(`</${i}>`), i = "");
931
+ m.length > 0 && (l.push(`<blockquote>${m.map((S) => Lt(S)).join("<br>")}</blockquote>`), m = []);
865
932
  }, _ = () => {
866
- h(), v(), g();
867
- }, y = (E) => {
868
- i !== E && (g(), a.push(`<${E}>`), i = E);
933
+ i && (l.push(`</${i}>`), i = "");
934
+ }, g = () => {
935
+ h(), v(), _();
936
+ }, y = (S) => {
937
+ i !== S && (_(), l.push(`<${S}>`), i = S);
869
938
  };
870
- for (const E of s) {
871
- const A = E.replace(/\s+$/, "");
939
+ for (const S of s) {
940
+ const A = S.replace(/\s+$/, "");
872
941
  if (/^\s*```/.test(A)) {
873
- f ? (a.push(`<pre><code>${_t(c.join(`
874
- `))}</code></pre>`), c = [], f = !1) : (_(), f = !0);
942
+ d ? (l.push(`<pre><code>${_t(c.join(`
943
+ `))}</code></pre>`), c = [], d = !1) : (g(), d = !0);
875
944
  continue;
876
945
  }
877
- if (f) {
878
- c.push(E);
946
+ if (d) {
947
+ c.push(S);
879
948
  continue;
880
949
  }
881
950
  if (!A.trim()) {
882
- _();
951
+ g();
883
952
  continue;
884
953
  }
885
954
  const C = /^(#{1,6})\s+(.*)$/.exec(A);
886
955
  if (C) {
887
- _();
956
+ g();
888
957
  const Z = C[1].length;
889
- a.push(`<h${Z}>${Lt(C[2])}</h${Z}>`);
958
+ l.push(`<h${Z}>${Lt(C[2])}</h${Z}>`);
890
959
  continue;
891
960
  }
892
961
  if (/^\s*(-{3,}|\*{3,}|_{3,})\s*$/.test(A)) {
893
- _(), a.push("<hr>");
962
+ g(), l.push("<hr>");
894
963
  continue;
895
964
  }
896
965
  const R = /^\s*[-*+]\s+(.*)$/.exec(A);
897
966
  if (R) {
898
- h(), v(), y("ul"), a.push(`<li>${Lt(R[1])}</li>`);
967
+ h(), v(), y("ul"), l.push(`<li>${Lt(R[1])}</li>`);
899
968
  continue;
900
969
  }
901
970
  const P = /^\s*\d+[.)]\s+(.*)$/.exec(A);
902
971
  if (P) {
903
- h(), v(), y("ol"), a.push(`<li>${Lt(P[1])}</li>`);
972
+ h(), v(), y("ol"), l.push(`<li>${Lt(P[1])}</li>`);
904
973
  continue;
905
974
  }
906
- const z = /^\s*>\s?(.*)$/.exec(A);
907
- if (z) {
908
- h(), g(), m.push(z[1]);
975
+ const U = /^\s*>\s?(.*)$/.exec(A);
976
+ if (U) {
977
+ h(), _(), m.push(U[1]);
909
978
  continue;
910
979
  }
911
- v(), g(), u.push(A);
980
+ v(), _(), u.push(A);
912
981
  }
913
- return f && a.push(`<pre><code>${_t(c.join(`
914
- `))}</code></pre>`), _(), a.join("");
982
+ return d && l.push(`<pre><code>${_t(c.join(`
983
+ `))}</code></pre>`), g(), l.join("");
915
984
  }
916
- function un(o, s = 120) {
985
+ function cn(o, s = 120) {
917
986
  const i = (String(o ?? "").replace(/\r\n?/g, `
918
987
  `).split(`
919
988
  `).map((u) => u.trim()).find((u) => u.length > 0) ?? "").replace(/^#{1,6}\s+/, "").replace(/^\s*[-*+]\s+/, "").replace(/^\s*\d+[.)]\s+/, "").replace(/^>\s?/, "").replace(/!?\[([^\]]*)\]\([^)]*\)/g, "$1").replace(/`([^`]+)`/g, "$1").replace(/\*\*([^*]+)\*\*/g, "$1").replace(/\*([^*]+)\*/g, "$1").replace(/_([^_]+)_/g, "$1").replace(/\s+/g, " ").trim();
920
989
  return i.length > s ? `${i.slice(0, s)}…` : i;
921
990
  }
922
- function gt(o) {
923
- return typeof o == "string" ? o.trim() : "";
924
- }
925
- function _o(o) {
926
- const s = gt(o?.meta?.blockUuid);
927
- if (s) return s;
928
- const a = o?.props;
929
- if (!a || typeof a != "object" || Array.isArray(a)) return "";
930
- const i = a.default;
931
- return !i || typeof i != "object" || Array.isArray(i) ? "" : gt(i.uuid);
932
- }
933
- function go(o, s) {
934
- const a = [], i = /* @__PURE__ */ new Set();
935
- for (const u of o ?? []) {
936
- if (!u || u.redirect || u.components?.default !== s) continue;
937
- const m = _o(u);
938
- if (!m || i.has(m)) continue;
939
- i.add(m);
940
- const f = gt(u.path), c = gt(u.meta?.title) || gt(u.meta?.sub) || f;
941
- a.push({ uuid: m, path: f, title: c, module: gt(u.meta?.module), brief: gt(u.meta?.brief) });
942
- }
943
- return a;
944
- }
945
- function yo(o, s, a) {
946
- const i = /* @__PURE__ */ new Set();
947
- for (const u of a ?? []) i.add(gt(u));
948
- return go(o, s).filter((u) => !i.has(u.uuid));
949
- }
950
991
  const we = "pages.lock.ts";
951
- function ko(o, s) {
952
- const a = String(o || "").split(/[^A-Za-z0-9]+/).filter(Boolean);
953
- if (a.length === 0) return `Page${s + 1}`;
954
- const i = a.map((u) => u[0].toUpperCase() + u.slice(1)).join("");
992
+ function So(o, s) {
993
+ const l = String(o || "").split(/[^A-Za-z0-9]+/).filter(Boolean);
994
+ if (l.length === 0) return `Page${s + 1}`;
995
+ const i = l.map((u) => u[0].toUpperCase() + u.slice(1)).join("");
955
996
  return /^[0-9]/.test(i) ? `P${i}` : i;
956
997
  }
957
- function $o(o, s) {
998
+ function To(o, s) {
958
999
  if (!s.has(o))
959
1000
  return s.add(o), o;
960
- let a = 2;
961
- for (; s.has(`${o}${a}`); ) a += 1;
962
- const i = `${o}${a}`;
1001
+ let l = 2;
1002
+ for (; s.has(`${o}${l}`); ) l += 1;
1003
+ const i = `${o}${l}`;
963
1004
  return s.add(i), i;
964
1005
  }
965
- function wo(o) {
966
- const s = (o ?? []).filter((m) => m && typeof m.path == "string" && m.path.trim() !== ""), a = /* @__PURE__ */ new Set(), i = [];
967
- s.forEach((m, f) => {
1006
+ function Bo(o) {
1007
+ const s = (o ?? []).filter((m) => m && typeof m.path == "string" && m.path.trim() !== ""), l = /* @__PURE__ */ new Set(), i = [];
1008
+ s.forEach((m, d) => {
968
1009
  const c = m.group?.trim() || "(没写 meta.group)";
969
1010
  let h = i.find((v) => v.title === c);
970
- h || (h = { title: c, rows: [] }, i.push(h)), h.rows.push({ key: $o(ko(m.path, f), a), row: m });
1011
+ h || (h = { title: c, rows: [] }, i.push(h)), h.rows.push({ key: To(So(m.path, d), l), row: m });
971
1012
  });
972
1013
  const u = [
973
1014
  "/* 生成物:**每次导出都会重写**,别手改 —— 改了下次导出就没了。",
@@ -1000,8 +1041,8 @@ function wo(o) {
1000
1041
  u.push("export const Page = {");
1001
1042
  for (const m of i) {
1002
1043
  u.push(` // ── ${m.title} ──`);
1003
- for (const f of m.rows)
1004
- u.push(` /** ${f.row.title?.trim() || f.row.path}(${f.row.path}) */`), u.push(` ${f.key}: '${f.row.path}',`);
1044
+ for (const d of m.rows)
1045
+ u.push(` /** ${d.row.title?.trim() || d.row.path}(${d.row.path}) */`), u.push(` ${d.key}: '${d.row.path}',`);
1005
1046
  }
1006
1047
  u.push("} as const", "");
1007
1048
  }
@@ -1060,12 +1101,12 @@ function wo(o) {
1060
1101
  ), u.join(`
1061
1102
  `);
1062
1103
  }
1063
- function En() {
1104
+ function An() {
1064
1105
  return typeof window < "u" && typeof window.showDirectoryPicker == "function";
1065
1106
  }
1066
- const xo = "这个浏览器没法直接写你本机的文件夹(少了 File System Access API):请用 Chrome / Edge,并且从 https 或 http://localhost 打开这个页面(内网 http 会更少 API)。";
1107
+ const Mo = "这个浏览器没法直接写你本机的文件夹(少了 File System Access API):请用 Chrome / Edge,并且从 https 或 http://localhost 打开这个页面(内网 http 会更少 API)。";
1067
1108
  async function xe() {
1068
- if (!En()) throw new Error(xo);
1109
+ if (!An()) throw new Error(Mo);
1069
1110
  try {
1070
1111
  const o = await window.showDirectoryPicker({ mode: "readwrite", id: "labull-magic-block" });
1071
1112
  return { name: o.name, handle: o };
@@ -1079,66 +1120,66 @@ function se(o) {
1079
1120
  }
1080
1121
  function Le(o) {
1081
1122
  const s = String(o ?? "").split("/");
1082
- for (const a of s)
1083
- if (!a || a === "." || a === ".." || a.includes("\\") || /^[A-Za-z]:/.test(a))
1123
+ for (const l of s)
1124
+ if (!l || l === "." || l === ".." || l.includes("\\") || /^[A-Za-z]:/.test(l))
1084
1125
  throw new Error(`路径不合法:${o}(要相对路径,不许 .. / 盘符 / 反斜杠)`);
1085
1126
  return s;
1086
1127
  }
1087
- function Co(o) {
1128
+ function Ao(o) {
1088
1129
  const s = String(o ?? "");
1089
- let a = 3735928559, i = 1103547991;
1130
+ let l = 3735928559, i = 1103547991;
1090
1131
  for (let u = 0; u < s.length; u += 1) {
1091
1132
  const m = s.charCodeAt(u);
1092
- a = Math.imul(a ^ m, 2654435761), i = Math.imul(i ^ m, 1597334677);
1133
+ l = Math.imul(l ^ m, 2654435761), i = Math.imul(i ^ m, 1597334677);
1093
1134
  }
1094
- return a = Math.imul(a ^ a >>> 16, 2246822507) ^ Math.imul(i ^ i >>> 13, 3266489909), i = Math.imul(i ^ i >>> 16, 2246822507) ^ Math.imul(a ^ a >>> 13, 3266489909), `${(4294967296 * (2097151 & i) + (a >>> 0)).toString(36)}:${s.length}`;
1135
+ return l = Math.imul(l ^ l >>> 16, 2246822507) ^ Math.imul(i ^ i >>> 13, 3266489909), i = Math.imul(i ^ i >>> 16, 2246822507) ^ Math.imul(l ^ l >>> 13, 3266489909), `${(4294967296 * (2097151 & i) + (l >>> 0)).toString(36)}:${s.length}`;
1095
1136
  }
1096
- const So = 8;
1097
- async function ht(o, s) {
1098
- let a = 0;
1137
+ const Ro = 8;
1138
+ async function gt(o, s) {
1139
+ let l = 0;
1099
1140
  const i = async () => {
1100
1141
  for (; ; ) {
1101
- const u = a;
1102
- if (a += 1, u >= o.length) return;
1142
+ const u = l;
1143
+ if (l += 1, u >= o.length) return;
1103
1144
  await s(o[u], u);
1104
1145
  }
1105
1146
  };
1106
- await Promise.all(Array.from({ length: Math.max(1, Math.min(So, o.length)) }, () => i()));
1147
+ await Promise.all(Array.from({ length: Math.max(1, Math.min(Ro, o.length)) }, () => i()));
1107
1148
  }
1108
- function Eo(o) {
1149
+ function Oo(o) {
1109
1150
  const s = /* @__PURE__ */ new Map();
1110
- return (a) => {
1111
- const i = a.join("\0"), u = s.get(i);
1151
+ return (l) => {
1152
+ const i = l.join("\0"), u = s.get(i);
1112
1153
  if (u) return u;
1113
1154
  let m = Promise.resolve(o);
1114
- for (let f = 0; f < a.length; f += 1) {
1115
- const c = a[f], h = a.slice(0, f + 1).join("\0"), v = s.get(h);
1116
- m = v ?? m.then((g) => g.getDirectoryHandle(c, { create: !0 })), v || s.set(h, m);
1155
+ for (let d = 0; d < l.length; d += 1) {
1156
+ const c = l[d], h = l.slice(0, d + 1).join("\0"), v = s.get(h);
1157
+ m = v ?? m.then((_) => _.getDirectoryHandle(c, { create: !0 })), v || s.set(h, m);
1117
1158
  }
1118
1159
  return m;
1119
1160
  };
1120
1161
  }
1121
- async function To(o, s, a) {
1162
+ async function Po(o, s, l) {
1122
1163
  try {
1123
- return await (await (await o.getFileHandle(s)).getFile()).text() === a;
1164
+ return await (await (await o.getFileHandle(s)).getFile()).text() === l;
1124
1165
  } catch {
1125
1166
  return !1;
1126
1167
  }
1127
1168
  }
1128
- async function Bo(o, s, a, i = {}) {
1169
+ async function jo(o, s, l, i = {}) {
1129
1170
  const u = Object.entries(s ?? {}).map(([C, R]) => {
1130
1171
  const P = String(R ?? "");
1131
- return { path: C, parts: Le(C), body: P, digest: Co(P) };
1132
- }), m = u.length, f = [], c = Eo(o.handle), h = i.verify === !0, v = i.trust, g = i.existing, _ = /* @__PURE__ */ new Map();
1133
- let y = 0, E = 0, A = 0;
1134
- return a?.(0, m), await ht(u, async (C) => {
1172
+ return { path: C, parts: Le(C), body: P, digest: Ao(P) };
1173
+ }), m = u.length, d = [], c = Oo(o.handle), h = i.verify === !0, v = i.trust, _ = i.existing, g = /* @__PURE__ */ new Map();
1174
+ let y = 0, S = 0, A = 0;
1175
+ return l?.(0, m), await gt(u, async (C) => {
1135
1176
  try {
1136
- if (v?.get(C.path) === C.digest && (g?.has(C.path) ?? !1))
1137
- A += 1, _.set(C.path, C.digest);
1177
+ if (v?.get(C.path) === C.digest && (_?.has(C.path) ?? !1))
1178
+ A += 1, g.set(C.path, C.digest);
1138
1179
  else {
1139
1180
  const R = await c(C.parts.slice(0, -1)), P = C.parts[C.parts.length - 1];
1140
- if (h && await To(R, P, C.body))
1141
- E += 1, _.set(C.path, C.digest);
1181
+ if (h && await Po(R, P, C.body))
1182
+ S += 1, g.set(C.path, C.digest);
1142
1183
  else {
1143
1184
  const Z = await (await R.getFileHandle(P, { create: !0 })).createWritable();
1144
1185
  try {
@@ -1146,87 +1187,87 @@ async function Bo(o, s, a, i = {}) {
1146
1187
  } finally {
1147
1188
  await Z.close();
1148
1189
  }
1149
- y += 1, _.set(C.path, C.digest);
1190
+ y += 1, g.set(C.path, C.digest);
1150
1191
  }
1151
1192
  }
1152
1193
  } catch (R) {
1153
- f.push({ path: C.path, message: se(R) });
1194
+ d.push({ path: C.path, message: se(R) });
1154
1195
  }
1155
- a?.(y + E + A + f.length, m);
1156
- }), f.sort((C, R) => C.path < R.path ? -1 : C.path > R.path ? 1 : 0), { written: y, failed: f, total: m, skipped: E, trusted: A, fingerprints: _ };
1196
+ l?.(y + S + A + d.length, m);
1197
+ }), d.sort((C, R) => C.path < R.path ? -1 : C.path > R.path ? 1 : 0), { written: y, failed: d, total: m, skipped: S, trusted: A, fingerprints: g };
1157
1198
  }
1158
1199
  async function Ce(o, s) {
1159
- const a = { items: [], topCount: 0, files: 0, dirs: 0 }, i = async (f, c) => {
1200
+ const l = { items: [], topCount: 0, files: 0, dirs: 0 }, i = async (d, c) => {
1160
1201
  const h = [];
1161
- for (const v of await At(f)) {
1202
+ for (const v of await At(d)) {
1162
1203
  if (v.kind === "file") {
1163
- a.files += 1;
1204
+ l.files += 1;
1164
1205
  continue;
1165
1206
  }
1166
- a.dirs += 1, !(c >= s.maxDepth) && (s.skipDirs.includes(v.name) || h.push(v));
1207
+ l.dirs += 1, !(c >= s.maxDepth) && (s.skipDirs.includes(v.name) || h.push(v));
1167
1208
  }
1168
- await ht(h, (v) => i(v, c + 1));
1209
+ await gt(h, (v) => i(v, c + 1));
1169
1210
  }, u = await At(o.handle), m = [];
1170
- for (const f of u)
1171
- if (a.items.push({ name: f.name, dir: f.kind === "directory" }), f.kind === "file") a.files += 1;
1211
+ for (const d of u)
1212
+ if (l.items.push({ name: d.name, dir: d.kind === "directory" }), d.kind === "file") l.files += 1;
1172
1213
  else {
1173
- if (a.dirs += 1, s.skipDirs.includes(f.name) || s.maxDepth <= 0) continue;
1174
- m.push(f);
1214
+ if (l.dirs += 1, s.skipDirs.includes(d.name) || s.maxDepth <= 0) continue;
1215
+ m.push(d);
1175
1216
  }
1176
- return await ht(m, (f) => i(f, 1)), a.topCount = a.items.length, a;
1217
+ return await gt(m, (d) => i(d, 1)), l.topCount = l.items.length, l;
1177
1218
  }
1178
- async function Mo(o) {
1219
+ async function Lo(o) {
1179
1220
  const s = [];
1180
1221
  for (const i of await At(o.handle)) s.push(i.name);
1181
- let a = 0;
1182
- return await ht(s, async (i) => {
1183
- await o.handle.removeEntry(i, { recursive: !0 }), a += 1;
1184
- }), a;
1222
+ let l = 0;
1223
+ return await gt(s, async (i) => {
1224
+ await o.handle.removeEntry(i, { recursive: !0 }), l += 1;
1225
+ }), l;
1185
1226
  }
1186
- async function Ao(o, s) {
1187
- const { wantedFiles: a, wantedDirs: i } = Tn(s), u = /* @__PURE__ */ new Set();
1227
+ async function Io(o, s) {
1228
+ const { wantedFiles: l, wantedDirs: i } = Rn(s), u = /* @__PURE__ */ new Set();
1188
1229
  let m = 0;
1189
- const f = async (c, h) => {
1190
- const v = [], g = [];
1191
- for (const _ of await At(c)) {
1192
- const y = h ? `${h}/${_.name}` : _.name;
1193
- if (_.kind === "file") {
1194
- a.has(y) ? u.add(y) : v.push(_.name);
1230
+ const d = async (c, h) => {
1231
+ const v = [], _ = [];
1232
+ for (const g of await At(c)) {
1233
+ const y = h ? `${h}/${g.name}` : g.name;
1234
+ if (g.kind === "file") {
1235
+ l.has(y) ? u.add(y) : v.push(g.name);
1195
1236
  continue;
1196
1237
  }
1197
- i.has(y) ? g.push([y, _]) : v.push(_.name);
1238
+ i.has(y) ? _.push([y, g]) : v.push(g.name);
1198
1239
  }
1199
- await ht(v, async (_) => {
1200
- await c.removeEntry(_, { recursive: !0 }), m += 1;
1201
- }), await ht(g, ([_, y]) => f(y, _));
1240
+ await gt(v, async (g) => {
1241
+ await c.removeEntry(g, { recursive: !0 }), m += 1;
1242
+ }), await gt(_, ([g, y]) => d(y, g));
1202
1243
  };
1203
- return await f(o.handle, ""), { removed: m, existing: u };
1244
+ return await d(o.handle, ""), { removed: m, existing: u };
1204
1245
  }
1205
- function Tn(o) {
1206
- const s = /* @__PURE__ */ new Set(), a = /* @__PURE__ */ new Set();
1246
+ function Rn(o) {
1247
+ const s = /* @__PURE__ */ new Set(), l = /* @__PURE__ */ new Set();
1207
1248
  for (const i of Object.keys(o ?? {})) {
1208
1249
  const u = Le(i);
1209
1250
  s.add(u.join("/"));
1210
- for (let m = 1; m < u.length; m += 1) a.add(u.slice(0, m).join("/"));
1251
+ for (let m = 1; m < u.length; m += 1) l.add(u.slice(0, m).join("/"));
1211
1252
  }
1212
- return { wantedFiles: s, wantedDirs: a };
1253
+ return { wantedFiles: s, wantedDirs: l };
1213
1254
  }
1214
- async function Ro(o, s) {
1215
- const { wantedFiles: a, wantedDirs: i } = Tn(s), u = /* @__PURE__ */ new Set(), m = async (f, c) => {
1255
+ async function Do(o, s) {
1256
+ const { wantedFiles: l, wantedDirs: i } = Rn(s), u = /* @__PURE__ */ new Set(), m = async (d, c) => {
1216
1257
  const h = [];
1217
- for (const v of await At(f)) {
1218
- const g = c ? `${c}/${v.name}` : v.name;
1258
+ for (const v of await At(d)) {
1259
+ const _ = c ? `${c}/${v.name}` : v.name;
1219
1260
  if (v.kind === "file") {
1220
- a.has(g) && u.add(g);
1261
+ l.has(_) && u.add(_);
1221
1262
  continue;
1222
1263
  }
1223
- i.has(g) && h.push([g, v]);
1264
+ i.has(_) && h.push([_, v]);
1224
1265
  }
1225
- await ht(h, ([v, g]) => m(g, v));
1266
+ await gt(h, ([v, _]) => m(_, v));
1226
1267
  };
1227
1268
  return await m(o.handle, ""), u;
1228
1269
  }
1229
- function Oo(o, s) {
1270
+ function No(o, s) {
1230
1271
  if (o.name === s.blocksDir)
1231
1272
  throw new Error(
1232
1273
  `你选中的是「${s.blocksDir}」这一层(它就是放代码的那一层):导出会铺成 ${s.blocksDir}/${s.blocksDir}/…。请选它**上面**那一层 —— 也就是开发目录本身。`
@@ -1234,239 +1275,239 @@ function Oo(o, s) {
1234
1275
  }
1235
1276
  async function At(o) {
1236
1277
  const s = [];
1237
- for await (const a of o.values()) s.push(a);
1238
- return s.sort((a, i) => a.name < i.name ? -1 : a.name > i.name ? 1 : 0), s;
1278
+ for await (const l of o.values()) s.push(l);
1279
+ return s.sort((l, i) => l.name < i.name ? -1 : l.name > i.name ? 1 : 0), s;
1239
1280
  }
1240
- function Po(o) {
1281
+ function Fo(o) {
1241
1282
  return o.charCodeAt(0) === 65279 ? o.slice(1) : o;
1242
1283
  }
1243
- function jo(o) {
1284
+ function Uo(o) {
1244
1285
  const s = o.lastIndexOf(".");
1245
1286
  return s <= 0 ? "" : o.slice(s).toLowerCase();
1246
1287
  }
1247
- const Lo = { folders: [], failures: [], truncated: !1 };
1248
- async function Bn(o, s, a) {
1288
+ const zo = { folders: [], failures: [], truncated: !1 };
1289
+ async function On(o, s, l) {
1249
1290
  const i = await At(o), u = new Array(i.length);
1250
- await ht(i, async (c, h) => {
1251
- const v = s ? `${s}/${c.name}` : c.name, g = { files: {}, failures: [] };
1252
- if (u[h] = g, c.kind === "directory") {
1253
- if (a.skipDirs.includes(c.name)) return;
1254
- const y = await Bn(c, v, a);
1255
- for (const [E, A] of Object.entries(y.files))
1256
- g.files[`${c.name}/${E}`] = A;
1257
- g.failures.push(...y.failures);
1291
+ await gt(i, async (c, h) => {
1292
+ const v = s ? `${s}/${c.name}` : c.name, _ = { files: {}, failures: [] };
1293
+ if (u[h] = _, c.kind === "directory") {
1294
+ if (l.skipDirs.includes(c.name)) return;
1295
+ const y = await On(c, v, l);
1296
+ for (const [S, A] of Object.entries(y.files))
1297
+ _.files[`${c.name}/${S}`] = A;
1298
+ _.failures.push(...y.failures);
1258
1299
  return;
1259
1300
  }
1260
- if (!a.platformFiles.includes(c.name)) {
1261
- if (!a.textExt.includes(jo(c.name))) {
1262
- g.failures.push({
1301
+ if (!l.platformFiles.includes(c.name)) {
1302
+ if (!l.textExt.includes(Uo(c.name))) {
1303
+ _.failures.push({
1263
1304
  kind: "file",
1264
1305
  where: v,
1265
- message: `不是文本文件(认得的扩展名:${a.textExt.join(" ")}),已跳过`
1306
+ message: `不是文本文件(认得的扩展名:${l.textExt.join(" ")}),已跳过`
1266
1307
  });
1267
1308
  return;
1268
1309
  }
1269
1310
  try {
1270
- const _ = await c.getFile();
1271
- if (_.size > a.maxFileBytes) {
1272
- g.failures.push({
1311
+ const g = await c.getFile();
1312
+ if (g.size > l.maxFileBytes) {
1313
+ _.failures.push({
1273
1314
  kind: "file",
1274
1315
  where: v,
1275
- message: `文件 ${Math.round(_.size / 1024)} KB 超过上限 ${Math.floor(a.maxFileBytes / 1024)} KB,已跳过`
1316
+ message: `文件 ${Math.round(g.size / 1024)} KB 超过上限 ${Math.floor(l.maxFileBytes / 1024)} KB,已跳过`
1276
1317
  });
1277
1318
  return;
1278
1319
  }
1279
- g.files[c.name] = Po(await _.text());
1280
- } catch (_) {
1281
- g.failures.push({ kind: "file", where: v, message: `读不了这个文件:${se(_)}` });
1320
+ _.files[c.name] = Fo(await g.text());
1321
+ } catch (g) {
1322
+ _.failures.push({ kind: "file", where: v, message: `读不了这个文件:${se(g)}` });
1282
1323
  }
1283
1324
  }
1284
1325
  });
1285
- const m = {}, f = [];
1326
+ const m = {}, d = [];
1286
1327
  for (const c of u)
1287
- c && (Object.assign(m, c.files), f.push(...c.failures));
1288
- return { files: m, failures: f };
1289
- }
1290
- async function Mn(o, s, a, i) {
1291
- const u = await At(o), m = u.filter((_) => _.kind === "directory"), f = u.filter((_) => _.kind === "file"), c = s.join("/"), h = { folders: [], failures: [], truncated: !1 };
1292
- if (m.length === 0 || f.some((_) => _.name === i.entry)) {
1293
- const _ = await Bn(o, c, i);
1294
- return h.folders.push({ where: c, files: _.files }), h.failures.push(..._.failures), h;
1328
+ c && (Object.assign(m, c.files), d.push(...c.failures));
1329
+ return { files: m, failures: d };
1330
+ }
1331
+ async function Pn(o, s, l, i) {
1332
+ const u = await At(o), m = u.filter((g) => g.kind === "directory"), d = u.filter((g) => g.kind === "file"), c = s.join("/"), h = { folders: [], failures: [], truncated: !1 };
1333
+ if (m.length === 0 || d.some((g) => g.name === i.entry)) {
1334
+ const g = await On(o, c, i);
1335
+ return h.folders.push({ where: c, files: g.files }), h.failures.push(...g.failures), h;
1295
1336
  }
1296
- for (const _ of f)
1297
- s.length === 0 && i.rootSkipFiles.includes(_.name.toLowerCase()) || h.failures.push({
1337
+ for (const g of d)
1338
+ s.length === 0 && i.rootSkipFiles.includes(g.name.toLowerCase()) || h.failures.push({
1298
1339
  kind: "file",
1299
- where: [...s, _.name].join("/"),
1340
+ where: [...s, g.name].join("/"),
1300
1341
  message: `这一层直接放着一份文件,但它自己不是块文件夹、也没有 ${i.entry},文件没有归属`
1301
1342
  });
1302
- const v = m.map((_) => async () => i.skipDirs.includes(_.name) ? Lo : a >= i.maxDepth ? {
1343
+ const v = m.map((g) => async () => i.skipDirs.includes(g.name) ? zo : l >= i.maxDepth ? {
1303
1344
  folders: [],
1304
1345
  failures: [{
1305
1346
  kind: "dir",
1306
- where: [...s, _.name].join("/"),
1347
+ where: [...s, g.name].join("/"),
1307
1348
  message: `超过最大层数 ${i.maxDepth} 层还没见到 ${i.entry},没有继续往下找`
1308
1349
  }],
1309
1350
  truncated: !0
1310
- } : Mn(_, [...s, _.name], a + 1, i)), g = new Array(v.length);
1311
- await ht(v, async (_, y) => {
1312
- g[y] = await _();
1351
+ } : Pn(g, [...s, g.name], l + 1, i)), _ = new Array(v.length);
1352
+ await gt(v, async (g, y) => {
1353
+ _[y] = await g();
1313
1354
  });
1314
- for (const _ of g)
1315
- _ && (h.folders.push(..._.folders), h.failures.push(..._.failures), _.truncated && (h.truncated = !0));
1355
+ for (const g of _)
1356
+ g && (h.folders.push(...g.folders), h.failures.push(...g.failures), g.truncated && (h.truncated = !0));
1316
1357
  return h;
1317
1358
  }
1318
- function cn(o) {
1359
+ function rn(o) {
1319
1360
  return o >= 1024 * 1024 ? `${(o / 1024 / 1024).toFixed(1)} MB` : `${Math.max(1, Math.round(o / 1024))} KB`;
1320
1361
  }
1321
- async function Do(o, s) {
1322
- const a = await Mn(o.handle, [], 0, s), i = {
1362
+ async function Ho(o, s) {
1363
+ const l = await Pn(o.handle, [], 0, s), i = {
1323
1364
  root: o.name,
1324
- folders: a.folders,
1325
- failures: a.failures,
1326
- truncated: a.truncated
1365
+ folders: l.folders,
1366
+ failures: l.failures,
1367
+ truncated: l.truncated
1327
1368
  }, u = i.folders.reduce(
1328
- (m, f) => m + Object.values(f.files).reduce((c, h) => c + h.length, 0),
1369
+ (m, d) => m + Object.values(d.files).reduce((c, h) => c + h.length, 0),
1329
1370
  0
1330
1371
  );
1331
1372
  if (u > s.maxBodyBytes)
1332
1373
  throw new Error(
1333
- `这个目录读到的正文有 ${cn(u)},超过一次读回的上限 ${cn(s.maxBodyBytes)}:请先只留要改的那几个块,或者把大文件挪走。`
1374
+ `这个目录读到的正文有 ${rn(u)},超过一次读回的上限 ${rn(s.maxBodyBytes)}:请先只留要改的那几个块,或者把大文件挪走。`
1334
1375
  );
1335
1376
  return i;
1336
1377
  }
1337
- const Io = { class: "mbc__head" }, No = ["title"], Fo = ["title"], zo = {
1378
+ const Ko = { class: "mbc__head" }, qo = ["title"], Vo = ["title"], Jo = {
1338
1379
  class: "mbc__tabs",
1339
1380
  role: "tablist"
1340
- }, Uo = ["aria-selected"], Ho = { class: "mbc__count" }, Ko = ["title"], qo = ["aria-selected"], Vo = ["title"], Jo = {
1381
+ }, Go = ["aria-selected"], Wo = { class: "mbc__count" }, Yo = ["title"], Zo = ["aria-selected"], Xo = ["title"], Qo = {
1341
1382
  key: 1,
1342
1383
  class: "mbc__chip is-ok"
1343
- }, Go = { class: "mbc__body" }, Wo = {
1384
+ }, tl = { class: "mbc__body" }, el = {
1344
1385
  key: 0,
1345
1386
  class: "mbc__running"
1346
- }, Yo = ["aria-valuenow"], Zo = {
1387
+ }, nl = ["aria-valuenow"], sl = {
1347
1388
  key: 1,
1348
1389
  class: "mbc__confirm"
1349
- }, Xo = { class: "mbc__confirm-title" }, Qo = { class: "mbc__confirm-body" }, tl = {
1390
+ }, ol = { class: "mbc__confirm-title" }, ll = { class: "mbc__confirm-body" }, al = {
1350
1391
  key: 0,
1351
1392
  class: "mbc__mono"
1352
- }, el = { class: "mbc__confirm-check" }, nl = { class: "mbc__actions" }, sl = ["disabled"], ol = ["disabled"], ll = ["disabled"], al = {
1393
+ }, il = { class: "mbc__confirm-check" }, ul = { class: "mbc__actions" }, cl = ["disabled"], rl = ["disabled"], dl = ["disabled"], pl = {
1353
1394
  key: 2,
1354
1395
  class: "mbc__confirm"
1355
- }, il = { class: "mbc__confirm-title" }, ul = { class: "mbc__confirm-body" }, cl = { class: "mbc__mono" }, rl = { class: "mbc__actions" }, dl = ["disabled"], pl = ["disabled"], bl = { class: "mbc__panel mbc__panel--blocks" }, fl = { class: "mbc__title" }, ml = { class: "mbc__count" }, vl = {
1396
+ }, fl = { class: "mbc__confirm-title" }, bl = { class: "mbc__confirm-body" }, ml = { class: "mbc__mono" }, vl = { class: "mbc__actions" }, hl = ["disabled"], gl = ["disabled"], _l = { class: "mbc__panel mbc__panel--blocks" }, yl = { class: "mbc__title" }, kl = { class: "mbc__count" }, $l = {
1356
1397
  key: 0,
1357
1398
  class: "mbc__count mbc__count--tag"
1358
- }, hl = {
1399
+ }, wl = {
1359
1400
  key: 0,
1360
1401
  class: "mbc__tagbar"
1361
- }, _l = ["title", "onClick"], gl = { class: "mbc__list" }, yl = ["title", "onClick"], kl = { class: "mbc__module" }, $l = { class: "mbc__name" }, wl = ["title"], xl = {
1402
+ }, xl = ["title", "onClick"], Cl = { class: "mbc__list" }, El = ["title", "onClick"], Sl = { class: "mbc__module" }, Tl = { class: "mbc__name" }, Bl = ["title"], Ml = {
1362
1403
  key: 0,
1363
1404
  class: "mbc__where"
1364
- }, Cl = ["title"], Sl = {
1405
+ }, Al = ["title"], Rl = {
1365
1406
  key: 0,
1366
1407
  class: "mbc__detail"
1367
- }, El = {
1408
+ }, Ol = {
1368
1409
  key: 0,
1369
1410
  class: "mbc__hint"
1370
- }, Tl = { class: "mbc__meta" }, Bl = ["innerHTML"], Ml = {
1411
+ }, Pl = { class: "mbc__meta" }, jl = ["innerHTML"], Ll = {
1371
1412
  key: 1,
1372
1413
  class: "mbc__hint"
1373
- }, Al = ["disabled", "onClick"], Rl = ["disabled", "onClick"], Ol = ["disabled"], Pl = { class: "mbc__hint" }, jl = {
1414
+ }, Il = ["disabled", "onClick"], Dl = ["disabled", "onClick"], Nl = ["disabled"], Fl = { class: "mbc__hint" }, Ul = {
1374
1415
  key: 0,
1375
1416
  class: "mbc__hint"
1376
- }, Ll = ["disabled", "onClick"], Dl = ["onKeyup"], Il = ["disabled", "onClick"], Nl = ["disabled"], Fl = {
1417
+ }, zl = ["disabled", "onClick"], Hl = ["onKeyup"], Kl = ["disabled", "onClick"], ql = ["disabled"], Vl = {
1377
1418
  key: 0,
1378
1419
  class: "mbc__tagbar"
1379
- }, zl = ["title", "onClick"], Ul = {
1420
+ }, Jl = ["title", "onClick"], Gl = {
1380
1421
  key: 1,
1381
1422
  class: "mbc__tagbar"
1382
- }, Hl = ["title", "onClick"], Kl = { class: "mbc__mono" }, ql = { class: "mbc__actions mbc__actions--row" }, Vl = ["disabled", "onClick"], Jl = { class: "mbc__versions" }, Gl = { class: "mbc__versions-head" }, Wl = ["disabled", "onClick"], Yl = {
1423
+ }, Wl = ["title", "onClick"], Yl = { class: "mbc__mono" }, Zl = { class: "mbc__actions mbc__actions--row" }, Xl = ["disabled", "onClick"], Ql = { class: "mbc__versions" }, ta = { class: "mbc__versions-head" }, ea = ["disabled", "onClick"], na = {
1383
1424
  key: 0,
1384
1425
  class: "mbc__hint"
1385
- }, Zl = {
1426
+ }, sa = {
1386
1427
  key: 1,
1387
1428
  class: "mbc__versions-list"
1388
- }, Xl = { class: "mbc__mono" }, Ql = { class: "mbc__hint" }, ta = { class: "mbc__actions" }, ea = ["disabled", "onClick", "title"], na = ["disabled", "onClick", "title"], sa = ["disabled", "onClick", "title"], oa = ["disabled", "onClick", "title"], la = {
1429
+ }, oa = { class: "mbc__mono" }, la = { class: "mbc__hint" }, aa = { class: "mbc__actions" }, ia = ["disabled", "onClick", "title"], ua = ["disabled", "onClick", "title"], ca = ["disabled", "onClick", "title"], ra = ["disabled", "onClick", "title"], da = {
1389
1430
  key: 2,
1390
1431
  class: "mbc__hint"
1391
- }, aa = {
1432
+ }, pa = {
1392
1433
  key: 3,
1393
1434
  class: "mbc__viewer"
1394
- }, ia = { class: "mbc__versions-head" }, ua = { class: "mbc__mono" }, ca = { class: "mbc__viewer-body" }, ra = { class: "mbc__panel mbc__panel--export" }, da = { class: "mbc__field" }, pa = ["disabled"], ba = { class: "mbc__field" }, fa = { class: "mbc__radio" }, ma = ["checked"], va = { class: "mbc__radio" }, ha = ["checked"], _a = ["value", "disabled"], ga = {
1435
+ }, fa = { class: "mbc__versions-head" }, ba = { class: "mbc__mono" }, ma = { class: "mbc__viewer-body" }, va = { class: "mbc__panel mbc__panel--export" }, ha = { class: "mbc__field" }, ga = ["disabled"], _a = { class: "mbc__field" }, ya = { class: "mbc__radio" }, ka = ["checked"], $a = { class: "mbc__radio" }, wa = ["checked"], xa = ["value", "disabled"], Ca = {
1395
1436
  key: 0,
1396
1437
  value: ""
1397
- }, ya = ["value"], ka = { class: "mbc__field" }, $a = ["value"], wa = ["disabled"], xa = ["disabled", "title"], Ca = { class: "mbc__hint" }, Sa = {
1438
+ }, Ea = ["value"], Sa = { class: "mbc__field" }, Ta = ["value"], Ba = ["disabled"], Ma = ["disabled", "title"], Aa = { class: "mbc__hint" }, Ra = {
1398
1439
  key: 0,
1399
1440
  class: "mbc__hint"
1400
- }, Ea = { class: "mbc__panel mbc__panel--read" }, Ta = { class: "mbc__field" }, Ba = ["value"], Ma = ["disabled"], Aa = ["disabled"], Ra = {
1441
+ }, Oa = { class: "mbc__panel mbc__panel--read" }, Pa = { class: "mbc__field" }, ja = ["value"], La = ["disabled"], Ia = ["disabled"], Da = {
1401
1442
  key: 0,
1402
1443
  class: "mbc__hint"
1403
- }, Oa = {
1444
+ }, Na = {
1404
1445
  key: 1,
1405
1446
  class: "mbc__hint"
1406
- }, Pa = {
1447
+ }, Fa = {
1407
1448
  key: 0,
1408
1449
  class: "mbc__hint"
1409
- }, ja = { class: "mbc__ok-text" }, La = ["disabled"], Da = ["disabled"], Ia = {
1450
+ }, Ua = { class: "mbc__ok-text" }, za = ["disabled"], Ha = ["disabled"], Ka = {
1410
1451
  key: 1,
1411
1452
  class: "mbc__scan"
1412
- }, Na = { class: "mbc__pick" }, Fa = ["disabled", "checked", "onChange"], za = { class: "mbc__name" }, Ua = { class: "mbc__module" }, Ha = { class: "mbc__hint" }, Ka = { class: "mbc__mono" }, qa = {
1453
+ }, qa = { class: "mbc__pick" }, Va = ["disabled", "checked", "onChange"], Ja = { class: "mbc__name" }, Ga = { class: "mbc__module" }, Wa = { class: "mbc__hint" }, Ya = { class: "mbc__mono" }, Za = {
1413
1454
  key: 0,
1414
1455
  class: "mbc__problem"
1415
- }, Va = { class: "mbc__hint mbc__mono" }, Ja = {
1456
+ }, Xa = { class: "mbc__hint mbc__mono" }, Qa = {
1416
1457
  key: 2,
1417
1458
  class: "mbc__hint"
1418
- }, Ga = { class: "mbc__field" }, Wa = ["title"], Ya = {
1459
+ }, ti = { class: "mbc__field" }, ei = ["title"], ni = {
1419
1460
  key: 1,
1420
1461
  class: "mbc__chip is-ok"
1421
- }, Za = ["title"], Xa = {
1462
+ }, si = ["title"], oi = {
1422
1463
  key: 3,
1423
1464
  class: "mbc__hint"
1424
- }, Qa = { class: "mbc__field mbc__field--end" }, ti = ["disabled"], ei = { class: "mbc__panel mbc__panel--declared" }, ni = { class: "mbc__title" }, si = { class: "p-tag p-tag-info" }, oi = { class: "mbc__count" }, li = {
1465
+ }, li = { class: "mbc__field mbc__field--end" }, ai = ["disabled"], ii = { class: "mbc__panel mbc__panel--declared" }, ui = { class: "mbc__title" }, ci = { class: "p-tag p-tag-info" }, ri = { class: "mbc__count" }, di = {
1425
1466
  key: 0,
1426
1467
  class: "mbc__hint"
1427
- }, ai = { class: "mbc__hint" }, ii = { class: "mbc__scan" }, ui = { class: "mbc__pick" }, ci = { class: "mbc__name" }, ri = { class: "p-tag p-tag-info" }, di = { class: "mbc__module" }, pi = { class: "mbc__hint" }, bi = { class: "mbc__mono" }, fi = { class: "mbc__hint mbc__mono" }, mi = {
1468
+ }, pi = { class: "mbc__hint" }, fi = { class: "mbc__scan" }, bi = { class: "mbc__pick" }, mi = { class: "mbc__name" }, vi = { class: "p-tag p-tag-info" }, hi = { class: "mbc__module" }, gi = { class: "mbc__hint" }, _i = { class: "mbc__mono" }, yi = { class: "mbc__hint mbc__mono" }, ki = {
1428
1469
  key: 3,
1429
1470
  class: "mbc__panel mbc__panel--result"
1430
- }, vi = { class: "mbc__summary" }, hi = { class: "mbc__chip is-ok" }, _i = {
1471
+ }, $i = { class: "mbc__summary" }, wi = { class: "mbc__chip is-ok" }, xi = {
1431
1472
  key: 0,
1432
1473
  class: "mbc__chip is-bad"
1433
- }, gi = {
1474
+ }, Ci = {
1434
1475
  key: 1,
1435
1476
  class: "mbc__chip is-bad"
1436
- }, yi = {
1477
+ }, Ei = {
1437
1478
  key: 2,
1438
1479
  class: "mbc__hint"
1439
- }, ki = { class: "mbc__actions" }, $i = { class: "mbc__foot" }, wi = ["title"], xi = {
1480
+ }, Si = { class: "mbc__actions" }, Ti = { class: "mbc__foot" }, Bi = ["title"], Mi = {
1440
1481
  key: 1,
1441
1482
  class: "mbc__error"
1442
- }, Ci = {
1483
+ }, Ai = {
1443
1484
  key: 2,
1444
1485
  class: "mbc__notice"
1445
- }, Si = {
1486
+ }, Ri = {
1446
1487
  key: 3,
1447
1488
  class: "mbc__hint mbc__foot-idle"
1448
- }, Ei = { class: "mbc__modal-box" }, Ti = { class: "mbc__modal-head" }, Bi = { class: "mbc__modal-body" }, Mi = {
1489
+ }, Oi = { class: "mbc__modal-box" }, Pi = { class: "mbc__modal-head" }, ji = { class: "mbc__modal-body" }, Li = {
1449
1490
  key: 0,
1450
1491
  class: "mbc__issues-group"
1451
- }, Ai = { class: "mbc__title" }, Ri = { class: "mbc__failures" }, Oi = {
1492
+ }, Ii = { class: "mbc__title" }, Di = { class: "mbc__failures" }, Ni = {
1452
1493
  key: 1,
1453
1494
  class: "mbc__issues-group"
1454
- }, Pi = { class: "mbc__title" }, ji = { class: "mbc__failures" }, Li = { class: "mbc__kind" }, Di = { class: "mbc__mono" }, Ii = {
1495
+ }, Fi = { class: "mbc__title" }, Ui = { class: "mbc__failures" }, zi = { class: "mbc__kind" }, Hi = { class: "mbc__mono" }, Ki = {
1455
1496
  key: 2,
1456
1497
  class: "mbc__issues-group"
1457
- }, Ni = { class: "mbc__title" }, Fi = { class: "mbc__failures" }, zi = { class: "mbc__mono" }, Ui = {
1498
+ }, qi = { class: "mbc__title" }, Vi = { class: "mbc__failures" }, Ji = { class: "mbc__mono" }, Gi = {
1458
1499
  key: 3,
1459
1500
  class: "mbc__issues-group"
1460
- }, Hi = { class: "mbc__title" }, Ki = { class: "mbc__failures" }, qi = { key: 0 }, Vi = {
1501
+ }, Wi = { class: "mbc__title" }, Yi = { class: "mbc__failures" }, Zi = { key: 0 }, Xi = {
1461
1502
  key: 1,
1462
1503
  class: "mbc__failures mbc__failures--nested"
1463
- }, Ji = {
1504
+ }, Qi = {
1464
1505
  key: 4,
1465
1506
  class: "mbc__hint"
1466
- }, Gi = { class: "mbc__modal-foot" }, Wi = { class: "mbc__modal-box" }, Yi = { class: "mbc__modal-head" }, Zi = { class: "mbc__modal-body" }, Xi = { class: "mbc__reports" }, Qi = { class: "mbc__report-head" }, tu = { class: "mbc__mono" }, eu = { class: "mbc__report-text" }, nu = {
1507
+ }, tu = { class: "mbc__modal-foot" }, eu = { class: "mbc__modal-box" }, nu = { class: "mbc__modal-head" }, su = { class: "mbc__modal-body" }, ou = { class: "mbc__reports" }, lu = { class: "mbc__report-head" }, au = { class: "mbc__mono" }, iu = { class: "mbc__report-text" }, uu = {
1467
1508
  key: 0,
1468
1509
  class: "mbc__hint"
1469
- }, su = { class: "mbc__modal-foot" }, Se = 2, ou = 100, lu = 250, au = /* @__PURE__ */ Pe({
1510
+ }, cu = { class: "mbc__modal-foot" }, Ee = 2, ru = 100, du = 250, pu = /* @__PURE__ */ Pe({
1470
1511
  __name: "MagicBlockConsole",
1471
1512
  setup(o) {
1472
1513
  const s = {
@@ -1477,7 +1518,7 @@ const Io = { class: "mbc__head" }, No = ["title"], Fo = ["title"], zo = {
1477
1518
  两种情形共用它(前端声明了、手里却还没有那个文件夹 / 手里那个文件夹的清单 id 库里没有)
1478
1519
  —— 对用户是同一件事:这个块不在库里。 */
1479
1520
  "not-in-db": "不在数据库"
1480
- }, a = s["not-in-db"], { isStaff: i } = fn(), u = bn(), { active: m } = ms(), f = (n) => !mn(n, u), c = x(!1), h = x(""), v = x([]), g = x(""), _ = x(""), y = x(""), E = x([]), A = x(!1), C = x(!1), R = x("blocks"), P = x(""), z = x([]), Z = x(""), X = x(""), yt = x(""), kt = x(""), S = x(!1), Dt = x(!1), ut = x(!1), $t = x(!1), st = x(!1), q = x(null), U = x(null), Q = x("one"), wt = x(qt()), ft = j(() => v.value.find((n) => n.id === wt.value) ?? null), xt = () => Q.value === "all" ? {} : { blocks: [wt.value] };
1521
+ }, l = s["not-in-db"], { isStaff: i } = mn(), u = bn(), { active: m } = ys(), d = (n) => !vn(n, u), c = x(!1), h = x(""), v = x([]), _ = x(""), g = x(""), y = x(""), S = x([]), A = x(!1), C = x(!1), R = x("blocks"), P = x(""), U = x([]), Z = x(""), X = x(""), yt = x(""), kt = x(""), E = x(!1), It = x(!1), ut = x(!1), $t = x(!1), st = x(!1), q = x(null), z = x(null), Q = x("one"), wt = x(qt()), bt = j(() => v.value.find((n) => n.id === wt.value) ?? null), xt = () => Q.value === "all" ? {} : { blocks: [wt.value] };
1481
1522
  function Kt(n) {
1482
1523
  wt.value = n;
1483
1524
  try {
@@ -1496,13 +1537,13 @@ const Io = { class: "mbc__head" }, No = ["title"], Fo = ["title"], zo = {
1496
1537
  n.length !== 0 && (n.some((t) => t.id === wt.value) || Kt(n[0].id));
1497
1538
  });
1498
1539
  const tt = x(null), V = x(""), O = x(null), ct = x({}), W = x([]), Y = x([]), ot = x({}), w = x(""), T = x(null);
1499
- async function D(n) {
1540
+ async function I(n) {
1500
1541
  w.value = n;
1501
1542
  try {
1502
1543
  const t = await at(`/magic-blocks/${encodeURIComponent(n)}/versions`);
1503
1544
  ot.value = { ...ot.value, [n]: t.versions ?? [] };
1504
1545
  } catch (t) {
1505
- zt(t, "读版本列表");
1546
+ Ut(t, "读版本列表");
1506
1547
  } finally {
1507
1548
  w.value = "";
1508
1549
  }
@@ -1511,7 +1552,7 @@ const Io = { class: "mbc__head" }, No = ["title"], Fo = ["title"], zo = {
1511
1552
  const t = [n.current ? "当前" : "", n.empty ? "空包(代码被删过)" : ""].filter(Boolean).join("、");
1512
1553
  return `v${n.number}${t ? ` · ${t}` : ""}`;
1513
1554
  }
1514
- function It(n) {
1555
+ function Dt(n) {
1515
1556
  return n < 1024 ? `${n} B` : n < 1024 * 1024 ? `${Math.round(n / 1024)} KB` : `${(n / 1024 / 1024).toFixed(1)} MB`;
1516
1557
  }
1517
1558
  const H = x(null);
@@ -1523,20 +1564,20 @@ const Io = { class: "mbc__head" }, No = ["title"], Fo = ["title"], zo = {
1523
1564
  let e = q.value, r = null;
1524
1565
  if (e)
1525
1566
  try {
1526
- r = await Ce(e, tt.value ?? await fe());
1567
+ r = await Ce(e, tt.value ?? await be());
1527
1568
  } catch {
1528
1569
  e = null, r = null;
1529
1570
  }
1530
1571
  H.value = { row: n, target: e, folder: t, inventory: r };
1531
- }, S), le = () => G(async () => {
1572
+ }, E), le = () => G(async () => {
1532
1573
  const n = H.value;
1533
1574
  if (H.value = null, !n) return;
1534
1575
  const t = `「${n.row.module} / ${n.row.name || n.row.id}」`;
1535
- Ie(), F.value = { active: !0, percent: 0, stage: "清本机那个文件夹…", failed: !1 };
1576
+ De(), F.value = { active: !0, percent: 0, stage: "清本机那个文件夹…", failed: !1 };
1536
1577
  let e = "";
1537
1578
  if (n.target)
1538
1579
  try {
1539
- const r = await ae(n.target, n.folder), B = await Mo(r);
1580
+ const r = await ae(n.target, n.folder), B = await Lo(r);
1540
1581
  e = `清掉了本机「${n.target.name}/${n.folder}」里的 ${B} 项`;
1541
1582
  } catch (r) {
1542
1583
  e = `本机那份没清成(${Ot(r)})`;
@@ -1549,22 +1590,22 @@ const Io = { class: "mbc__head" }, No = ["title"], Fo = ["title"], zo = {
1549
1590
  } catch (r) {
1550
1591
  throw Ct(!1, "本机清了,但库里那份代码没清成"), new Error(`${e};但**库里那份代码没清成**(${Ot(r)})—— 再点一次「删除代码文件」`);
1551
1592
  }
1552
- await Et(), V.value = `${t}的代码文件已删除:${e};库里那一份也清空了 ——**块还在**(页面上会显示成占位框)。想找回来:上面「块」那一屏点开这一块 → 版本史 → 对上一版点「切回」`, y.value = `删掉了${t}的代码文件(块本身还在)`, Ct(!0, "完成");
1553
- }, S);
1593
+ await St(), V.value = `${t}的代码文件已删除:${e};库里那一份也清空了 ——**块还在**(页面上会显示成占位框)。想找回来:上面「块」那一屏点开这一块 → 版本史 → 对上一版点「切回」`, y.value = `删掉了${t}的代码文件(块本身还在)`, Ct(!0, "完成");
1594
+ }, E);
1554
1595
  async function ae(n, t) {
1555
1596
  let e = n.handle;
1556
1597
  for (const r of Le(t))
1557
1598
  e = await e.getDirectoryHandle(r, { create: !0 });
1558
1599
  return { handle: e, name: `${n.name}/${t}` };
1559
1600
  }
1560
- const J = x(null), Vt = x(!1), F = x({ active: !1, percent: 0, stage: "", failed: !1 }), An = j(() => ({
1601
+ const J = x(null), Vt = x(!1), F = x({ active: !1, percent: 0, stage: "", failed: !1 }), jn = j(() => ({
1561
1602
  width: `${Math.max(0, Math.min(100, F.value.percent))}%`,
1562
1603
  background: F.value.failed ? "var(--sp-color-danger)" : "var(--sp-color-primary, var(--primary-color))"
1563
1604
  }));
1564
- let ie = [], De = 0;
1605
+ let ie = [], Ie = 0;
1565
1606
  function ue(n = !1) {
1566
- if (!(!n && performance.now() - De < lu)) {
1567
- De = performance.now();
1607
+ if (!(!n && performance.now() - Ie < du)) {
1608
+ Ie = performance.now();
1568
1609
  try {
1569
1610
  window.localStorage.setItem("mb:progress", JSON.stringify(ie));
1570
1611
  } catch {
@@ -1577,12 +1618,12 @@ const Io = { class: "mbc__head" }, No = ["title"], Fo = ["title"], zo = {
1577
1618
  function Ct(n, t) {
1578
1619
  lt(n ? 100 : F.value.percent, t), F.value = { active: !n, percent: n ? 100 : F.value.percent, stage: t, failed: !n }, ue(!0);
1579
1620
  }
1580
- function Ie() {
1621
+ function De() {
1581
1622
  ie = [], ue(!0);
1582
1623
  }
1583
- const Ne = (n) => (n.disabledReason ?? "").trim(), ce = (n) => (n.issues ?? []).map((t) => String(t?.message ?? "")).filter(Boolean), Jt = (n) => Qs(n.id);
1584
- function Rn(n) {
1585
- g.value = g.value === n.id ? "" : n.id, g.value === n.id && D(n.id);
1624
+ const Ne = (n) => (n.disabledReason ?? "").trim(), ce = (n) => (n.issues ?? []).map((t) => String(t?.message ?? "")).filter(Boolean), Jt = (n) => oo(n.id);
1625
+ function Ln(n) {
1626
+ _.value = _.value === n.id ? "" : n.id, _.value === n.id && I(n.id);
1586
1627
  const t = m.value;
1587
1628
  Sn(n.id);
1588
1629
  const e = n.name || n.id, r = Jt(n);
@@ -1594,27 +1635,27 @@ const Io = { class: "mbc__head" }, No = ["title"], Fo = ["title"], zo = {
1594
1635
  y.value = `「${e}」就在这一条标签上(${r.join(" / ")}):已经把它标红`;
1595
1636
  return;
1596
1637
  }
1597
- const B = to(n.id, t, f);
1638
+ const B = lo(n.id, t, d);
1598
1639
  if (B) {
1599
1640
  y.value = `「${e}」不在这一条标签上:正在切到 ${B} 那条标签`, Te(B);
1600
1641
  return;
1601
1642
  }
1602
1643
  y.value = `「${e}」只挂在带参数的实例标签上(${r.join(" / ")}):不替你挑一单 —— 自己打开要看的那一页再点`;
1603
1644
  }
1604
- const On = (n, t) => G(async () => {
1645
+ const In = (n, t) => G(async () => {
1605
1646
  const e = await at(
1606
1647
  `/magic-blocks/${encodeURIComponent(n.id)}/versions/${t}`
1607
1648
  );
1608
1649
  T.value = { id: n.id, number: t, files: e.files ?? {} }, y.value = `正在看「${n.name || n.id}」的 v${t}(只读:不会改库里任何东西)`;
1609
- }, S), Pn = (n, t) => G(async () => {
1650
+ }, E), Dn = (n, t) => G(async () => {
1610
1651
  window.confirm(`把「${n.name || n.id}」切回 v${t}?
1611
1652
 
1612
- 这会把那一版的代码变成**当前版**,并且记成一个**新版本**(号继续 +1):历史只追加,旧版本一个都不会没。`) && (await St(`/magic-blocks/${encodeURIComponent(n.id)}/versions/${t}`, { updatedBy: "" }), y.value = `「${n.name || n.id}」已切回 v${t}(并记成了一个新版本)`, await Et(), await D(n.id));
1613
- }, S), jn = (n, t) => G(async () => {
1653
+ 这会把那一版的代码变成**当前版**,并且记成一个**新版本**(号继续 +1):历史只追加,旧版本一个都不会没。`) && (await Et(`/magic-blocks/${encodeURIComponent(n.id)}/versions/${t}`, { updatedBy: "" }), y.value = `「${n.name || n.id}」已切回 v${t}(并记成了一个新版本)`, await St(), await I(n.id));
1654
+ }, E), Nn = (n, t) => G(async () => {
1614
1655
  window.confirm(`删掉「${n.name || n.id}」的 v${t}?
1615
1656
 
1616
- 这一版的代码就找不回来了(别的版本不受影响)。`) && (await at(`/magic-blocks/${encodeURIComponent(n.id)}/versions/${t}`, { method: "DELETE" }), y.value = `删掉了「${n.name || n.id}」的 v${t}`, await D(n.id));
1617
- }, S), Ln = (n, t) => G(async () => {
1657
+ 这一版的代码就找不回来了(别的版本不受影响)。`) && (await at(`/magic-blocks/${encodeURIComponent(n.id)}/versions/${t}`, { method: "DELETE" }), y.value = `删掉了「${n.name || n.id}」的 v${t}`, await I(n.id));
1658
+ }, E), Fn = (n, t) => G(async () => {
1618
1659
  const e = await fetch(
1619
1660
  `http://localhost:3000/magic-blocks/${encodeURIComponent(n.id)}/versions/${t}?download=1`,
1620
1661
  { credentials: "include", headers: ne("GET", !1) }
@@ -1622,100 +1663,100 @@ const Io = { class: "mbc__head" }, No = ["title"], Fo = ["title"], zo = {
1622
1663
  if (!e.ok) throw new Error(`下载失败(HTTP ${e.status})`);
1623
1664
  const r = await e.blob(), B = URL.createObjectURL(r);
1624
1665
  try {
1625
- const I = document.createElement("a");
1626
- I.href = B, I.download = `magic-block-${n.name || n.id}-v${t}.zip`, document.body.appendChild(I), I.click(), I.remove();
1666
+ const D = document.createElement("a");
1667
+ D.href = B, D.download = `magic-block-${n.name || n.id}-v${t}.zip`, document.body.appendChild(D), D.click(), D.remove();
1627
1668
  } finally {
1628
1669
  setTimeout(() => URL.revokeObjectURL(B), 0);
1629
1670
  }
1630
1671
  y.value = `已下载「${n.name || n.id}」的 v${t}`;
1631
- }, S);
1632
- function Dn(n) {
1672
+ }, E);
1673
+ function Un(n) {
1633
1674
  Z.value = n.id, X.value = (n.tags ?? []).join(", ");
1634
1675
  }
1635
1676
  const Fe = (n) => G(async () => {
1636
- const t = X.value.split(/[,,\s]+/).map((r) => r.trim()).filter(Boolean), e = await St(`/magic-blocks/${encodeURIComponent(n.id)}/tags`, { tags: t });
1637
- Z.value = "", y.value = `「${n.name || n.id}」的标签已存:${(e.tags ?? []).join(" / ") || "(一个都不剩)"}`, await Et();
1638
- }, S, "存标签"), In = (n) => G(async () => {
1639
- const t = await St(`/magic-blocks/${encodeURIComponent(n.id)}/detail`, { detail: kt.value });
1640
- yt.value = "", y.value = `「${n.name || n.id}」的详情已存${(t.detail ?? "").trim() ? "" : "(清掉了)"};下次导出会写进它的 magic-block.open.yaml`, await Et();
1641
- }, S, "存详情");
1642
- function Nn(n) {
1677
+ const t = X.value.split(/[,,\s]+/).map((r) => r.trim()).filter(Boolean), e = await Et(`/magic-blocks/${encodeURIComponent(n.id)}/tags`, { tags: t });
1678
+ Z.value = "", y.value = `「${n.name || n.id}」的标签已存:${(e.tags ?? []).join(" / ") || "(一个都不剩)"}`, await St();
1679
+ }, E, "存标签"), zn = (n) => G(async () => {
1680
+ const t = await Et(`/magic-blocks/${encodeURIComponent(n.id)}/detail`, { detail: kt.value });
1681
+ yt.value = "", y.value = `「${n.name || n.id}」的详情已存${(t.detail ?? "").trim() ? "" : "(清掉了)"};下次导出会写进它的 magic-block.open.yaml`, await St();
1682
+ }, E, "存详情");
1683
+ function Hn(n) {
1643
1684
  yt.value = n.id, kt.value = (n.detail ?? "").trim();
1644
1685
  }
1645
- function Fn(n) {
1686
+ function Kn(n) {
1646
1687
  const t = X.value.split(/[,,\s]+/).map((e) => e.trim()).filter(Boolean);
1647
1688
  t.some((e) => e.toLowerCase() === n.toLowerCase()) || t.push(n), X.value = t.join(", ");
1648
1689
  }
1649
- function zn(n) {
1690
+ function qn(n) {
1650
1691
  X.value = X.value.split(/[,,\s]+/).map((t) => t.trim()).filter((t) => t && t.toLowerCase() !== n.toLowerCase()).join(", ");
1651
1692
  }
1652
- function Un(n) {
1693
+ function Vn(n) {
1653
1694
  const t = P.value.trim().toLowerCase();
1654
1695
  return t ? (n.tags ?? []).some((e) => e.toLowerCase().includes(t)) : !0;
1655
1696
  }
1656
- function Hn(n) {
1697
+ function Jn(n) {
1657
1698
  const t = Jt(n), e = t.length === 0 ? "点一下:这次会话里它还没在哪条标签上露过面" : `点一下:把「${n.name || n.id}」标红,并在需要时切到挂着它的标签(${t.join(" / ")})`, r = Ne(n);
1658
1699
  return r ? `${r}
1659
1700
  ${e}` : e;
1660
1701
  }
1661
- const ze = j(() => {
1702
+ const Ue = j(() => {
1662
1703
  const n = h.value.trim().toLowerCase();
1663
- return v.value.filter((t) => Un(t) ? n ? `${t.module} ${t.name} ${t.brief} ${t.detail ?? ""} ${t.id} v${t.version ?? ""} ${(t.tags ?? []).join(" ")}`.toLowerCase().includes(n) : !0 : !1);
1704
+ return v.value.filter((t) => Vn(t) ? n ? `${t.module} ${t.name} ${t.brief} ${t.detail ?? ""} ${t.id} v${t.version ?? ""} ${(t.tags ?? []).join(" ")}`.toLowerCase().includes(n) : !0 : !1);
1664
1705
  }), Gt = j(() => (O.value?.blocks ?? []).filter((n) => n.canApply)), Wt = j(() => Gt.value.filter((n) => ct.value[n.id] === !0)), Rt = x(!1), dt = j(() => W.value.length + (O.value?.failures ?? []).length + Y.value.filter((n) => !n.ok).length), Ft = j(() => Y.value.filter((n) => !n.ok)), re = j(() => Y.value.filter((n) => n.ok).length), de = j(() => v.value.filter((n) => n.enabled === !1).length);
1665
- function Kn() {
1706
+ function Gn() {
1666
1707
  const n = /* @__PURE__ */ new Set(), t = [];
1667
- for (const e of Ue()) {
1708
+ for (const e of ze()) {
1668
1709
  const r = typeof e?.path == "string" ? e.path.trim() : "";
1669
1710
  if (!r || n.has(r) || r.includes(":") || r.includes("*") || e.redirect || !e.components?.default || e.meta?.tab === !1) continue;
1670
1711
  n.add(r);
1671
- const B = e.meta?.title ?? e.meta?.sub, I = e.meta?.group;
1712
+ const B = e.meta?.title ?? e.meta?.sub, D = e.meta?.group;
1672
1713
  t.push({
1673
1714
  path: r,
1674
1715
  title: typeof B == "string" && B.trim() ? B.trim() : r,
1675
- group: typeof I == "string" ? I.trim() : ""
1716
+ group: typeof D == "string" ? D.trim() : ""
1676
1717
  });
1677
1718
  }
1678
1719
  return t;
1679
1720
  }
1680
- function Ue() {
1721
+ function ze() {
1681
1722
  return u?.getRoutes?.() ?? [];
1682
1723
  }
1683
- const pe = j(() => yo(Ue(), mo, v.value.map((n) => n.id)));
1724
+ const pe = j(() => ko(ze(), Mn, v.value.map((n) => n.id)));
1684
1725
  function Ot(n) {
1685
1726
  return (n instanceof Error ? n.message.trim() : String(n)) || "请求没有到达后端(网络或登录态的问题),请重试";
1686
1727
  }
1687
- function qn(n) {
1728
+ function Wn(n) {
1688
1729
  const t = n?.issues;
1689
1730
  return Array.isArray(t) ? t.map((e) => typeof e == "string" ? e : String(e?.message ?? "")).filter(Boolean) : [];
1690
1731
  }
1691
- async function St(n, t) {
1732
+ async function Et(n, t) {
1692
1733
  const e = JSON.stringify(t);
1693
1734
  try {
1694
1735
  return await at(n, { method: "POST", body: e });
1695
1736
  } catch (r) {
1696
- const B = Ot(r), I = await fetch(`http://localhost:3000${n}`, {
1737
+ const B = Ot(r), D = await fetch(`http://localhost:3000${n}`, {
1697
1738
  method: "POST",
1698
1739
  credentials: "include",
1699
1740
  headers: { "Content-Type": "application/json", ...ne("POST", !0) },
1700
1741
  body: e
1701
- }).then((mt) => mt.json()).catch(() => null), L = qn(I);
1702
- throw L.length === 0 ? new Error(B) : new Error(`${String(I?.message ?? B)}
1742
+ }).then((mt) => mt.json()).catch(() => null), L = Wn(D);
1743
+ throw L.length === 0 ? new Error(B) : new Error(`${String(D?.message ?? B)}
1703
1744
  - ${L.join(`
1704
1745
  - `)}`);
1705
1746
  }
1706
1747
  }
1707
- async function Vn() {
1708
- const n = E.value.map((t) => `[${t.at}] ${t.where}
1748
+ async function Yn() {
1749
+ const n = S.value.map((t) => `[${t.at}] ${t.where}
1709
1750
  ${t.text}`).join(`
1710
1751
 
1711
1752
  `);
1712
1753
  try {
1713
- await navigator.clipboard.writeText(n), y.value = `已复制 ${E.value.length} 条报错`;
1754
+ await navigator.clipboard.writeText(n), y.value = `已复制 ${S.value.length} 条报错`;
1714
1755
  } catch (t) {
1715
- zt(t, "复制报错");
1756
+ Ut(t, "复制报错");
1716
1757
  }
1717
1758
  }
1718
- function Jn() {
1759
+ function Zn() {
1719
1760
  const n = [];
1720
1761
  W.value.length > 0 && n.push("【前端校验拦下的】", ...W.value.map((t) => `- ${t}`), "");
1721
1762
  for (const t of O.value?.failures ?? [])
@@ -1730,67 +1771,67 @@ ${t.text}`).join(`
1730
1771
  return n.join(`
1731
1772
  `).trim() || "这一趟没有问题。";
1732
1773
  }
1733
- async function Gn() {
1774
+ async function Xn() {
1734
1775
  try {
1735
- await navigator.clipboard.writeText(Jn()), y.value = `已复制这一趟的 ${dt.value} 条问题`;
1776
+ await navigator.clipboard.writeText(Zn()), y.value = `已复制这一趟的 ${dt.value} 条问题`;
1736
1777
  } catch (n) {
1737
- zt(n, "复制问题");
1778
+ Ut(n, "复制问题");
1738
1779
  }
1739
1780
  }
1740
- function zt(n, t) {
1781
+ function Ut(n, t) {
1741
1782
  const e = Ot(n);
1742
- _.value = e, E.value = [...E.value, { at: (/* @__PURE__ */ new Date()).toLocaleTimeString(), where: t, text: e }];
1783
+ g.value = e, S.value = [...S.value, { at: (/* @__PURE__ */ new Date()).toLocaleTimeString(), where: t, text: e }];
1743
1784
  }
1744
- function be() {
1745
- _.value = "", E.value = [];
1785
+ function fe() {
1786
+ g.value = "", S.value = [];
1746
1787
  }
1747
- async function Et() {
1788
+ async function St() {
1748
1789
  try {
1749
1790
  const n = await at("/magic-blocks/index");
1750
- v.value = n.blocks ?? [], z.value = n.tags ?? [];
1791
+ v.value = n.blocks ?? [], U.value = n.tags ?? [];
1751
1792
  } catch (n) {
1752
- zt(n, "读块清单");
1793
+ Ut(n, "读块清单");
1753
1794
  }
1754
1795
  }
1755
1796
  async function G(n, t, e = "") {
1756
- t.value = !0, be();
1797
+ t.value = !0, fe();
1757
1798
  try {
1758
- await n(), Vs();
1799
+ await n(), Zs();
1759
1800
  } catch (r) {
1760
- zt(r, e || "这个动作");
1801
+ Ut(r, e || "这个动作");
1761
1802
  } finally {
1762
1803
  t.value = !1;
1763
1804
  }
1764
1805
  }
1765
- const Wn = () => G(async () => {
1766
- Dt.value = !0;
1806
+ const Qn = () => G(async () => {
1807
+ It.value = !0;
1767
1808
  try {
1768
- await at("/magic-blocks/check", { method: "POST", body: JSON.stringify({}) }), y.value = "全部魔法块重新校验完了", await Et();
1809
+ await at("/magic-blocks/check", { method: "POST", body: JSON.stringify({}) }), y.value = "全部魔法块重新校验完了", await St();
1769
1810
  } finally {
1770
- Dt.value = !1;
1811
+ It.value = !1;
1771
1812
  }
1772
- }, S), He = (n) => G(async () => {
1813
+ }, E), He = (n) => G(async () => {
1773
1814
  const t = await xe();
1774
- n === "export" ? (q.value = t, U.value || (U.value = t)) : (U.value = t, q.value || (q.value = t)), y.value = n === "export" ? `导出目录:${t.name}${U.value === t ? "(读回目录也填成它了)" : ""}` : `读回目录:${t.name}`;
1775
- }, S);
1776
- async function fe() {
1815
+ n === "export" ? (q.value = t, z.value || (z.value = t)) : (z.value = t, q.value || (q.value = t)), y.value = n === "export" ? `导出目录:${t.name}${z.value === t ? "(读回目录也填成它了)" : ""}` : `读回目录:${t.name}`;
1816
+ }, E);
1817
+ async function be() {
1777
1818
  if (tt.value) return tt.value;
1778
1819
  const n = await at("/magic-blocks/rules");
1779
1820
  return tt.value = n.rules, n.rules;
1780
1821
  }
1781
- const Yn = () => G(async () => {
1782
- if (!En()) throw new Error("这个浏览器没法直接写你本机的文件夹:请用 Chrome / Edge,并从 https 或 localhost 打开");
1783
- if (Q.value === "one" && !ft.value)
1822
+ const ts = () => G(async () => {
1823
+ if (!An()) throw new Error("这个浏览器没法直接写你本机的文件夹:请用 Chrome / Edge,并从 https 或 localhost 打开");
1824
+ if (Q.value === "one" && !bt.value)
1784
1825
  throw new Error("还没挑块:上面选「仅这一个块」时要先在下拉里挑一个块(或者把范围改成「全部块」)");
1785
- ut.value = !0, y.value = "", V.value = "", be(), Ie(), Yt.length = 0, F.value = { active: !0, percent: 0, stage: "准备…", failed: !1 };
1826
+ ut.value = !0, y.value = "", V.value = "", fe(), De(), Yt.length = 0, F.value = { active: !0, percent: 0, stage: "准备…", failed: !1 };
1786
1827
  try {
1787
1828
  const n = q.value ?? await xe();
1788
- q.value = n, U.value || (U.value = n);
1789
- const t = St("/magic-blocks/export", xt()), e = me(), r = tt.value ? Ce(n, tt.value) : null, B = await Tt("取包", t);
1790
- tt.value = B.rules, Oo(n, B.rules);
1791
- const I = r ? await Tt("数目录", r) : await Tt("数目录", Ce(n, B.rules));
1792
- if (I.topCount > 0) {
1793
- lt(5, "等你确认要不要先清空"), J.value = { target: n, inventory: I };
1829
+ q.value = n, z.value || (z.value = n);
1830
+ const t = Et("/magic-blocks/export", xt()), e = me(), r = tt.value ? Ce(n, tt.value) : null, B = await Tt("取包", t);
1831
+ tt.value = B.rules, No(n, B.rules);
1832
+ const D = r ? await Tt("数目录", r) : await Tt("数目录", Ce(n, B.rules));
1833
+ if (D.topCount > 0) {
1834
+ lt(5, "等你确认要不要先清空"), J.value = { target: n, inventory: D };
1794
1835
  return;
1795
1836
  }
1796
1837
  await ve(n, B, { clean: !1, verify: !1, front: e });
@@ -1799,7 +1840,7 @@ ${t.text}`).join(`
1799
1840
  } finally {
1800
1841
  ut.value = !1;
1801
1842
  }
1802
- }, S), Ke = /* @__PURE__ */ new WeakMap(), Yt = [];
1843
+ }, E), Ke = /* @__PURE__ */ new WeakMap(), Yt = [];
1803
1844
  function qe(n, t) {
1804
1845
  Yt.push([n, Math.round(performance.now() - t)]);
1805
1846
  }
@@ -1811,15 +1852,15 @@ ${t.text}`).join(`
1811
1852
  qe(n, e);
1812
1853
  }
1813
1854
  }
1814
- function Zn() {
1855
+ function es() {
1815
1856
  return Yt.length > 0 ? `;耗时:${Yt.map(([n, t]) => `${n} ${t}ms`).join(" · ")}` : "";
1816
1857
  }
1817
1858
  function me() {
1818
1859
  try {
1819
- const n = Cn();
1860
+ const n = En();
1820
1861
  return {
1821
1862
  css: n.css,
1822
- controls: Ws(),
1863
+ controls: to(),
1823
1864
  note: n.skipped.length > 0 ? `;⚠️ 有 ${n.skipped.length} 张样式表读不到规则(跨源):${n.skipped.join(" / ")}` : ""
1824
1865
  };
1825
1866
  } catch (n) {
@@ -1827,50 +1868,50 @@ ${t.text}`).join(`
1827
1868
  }
1828
1869
  }
1829
1870
  async function ve(n, t, e) {
1830
- const { clean: r, verify: B, thorough: I, front: L } = e;
1871
+ const { clean: r, verify: B, thorough: D, front: L } = e;
1831
1872
  try {
1832
1873
  lt(20, "准备写盘…");
1833
- const mt = wo(Kn()), pt = { ...t.files };
1874
+ const mt = Bo(Gn()), pt = { ...t.files };
1834
1875
  pt[we] = mt, L.css && (pt[Bt] = L.css), L.controls && (pt[ee] = L.controls), t.exampleDir && (pt[`${t.exampleDir}/${we}`] = mt, L.css && (pt[`${t.exampleDir}/${Bt}`] = L.css), L.controls && (pt[`${t.exampleDir}/${ee}`] = L.controls));
1835
- const ss = L.note;
1876
+ const is = L.note;
1836
1877
  await new Promise((nt) => {
1837
1878
  setTimeout(nt, 0);
1838
1879
  });
1839
1880
  let Ye = "", he;
1840
1881
  if (r) {
1841
1882
  lt(35, "清掉这一包不要的东西…");
1842
- const nt = await Tt("清多余", Ao(n, pt));
1883
+ const nt = await Tt("清多余", Io(n, pt));
1843
1884
  he = nt.existing, Ye = nt.removed > 0 ? `,先清掉了 ${nt.removed} 项` : ",没有多余的东西要清";
1844
1885
  } else
1845
- lt(35, "看一眼目录里有什么…"), he = await Tt("看目录", Ro(n, pt));
1846
- const os = Ke.get(n.handle), ls = Object.keys(pt).length, _e = r ? 45 : 30;
1847
- lt(_e, `写文件 0/${ls}…`);
1886
+ lt(35, "看一眼目录里有什么…"), he = await Tt("看目录", Do(n, pt));
1887
+ const us = Ke.get(n.handle), cs = Object.keys(pt).length, ge = r ? 45 : 30;
1888
+ lt(ge, `写文件 0/${cs}…`);
1848
1889
  let Ze = 0;
1849
- const as = performance.now(), et = await Bo(n, pt, (nt, ge) => {
1890
+ const rs = performance.now(), et = await jo(n, pt, (nt, _e) => {
1850
1891
  const Xe = Date.now();
1851
- nt < ge && Xe - Ze < ou || (Ze = Xe, lt(_e + Math.round(nt / Math.max(1, ge) * (95 - _e)), `写文件 ${nt}/${ge}…`));
1892
+ nt < _e && Xe - Ze < ru || (Ze = Xe, lt(ge + Math.round(nt / Math.max(1, _e) * (95 - ge)), `写文件 ${nt}/${_e}…`));
1852
1893
  }, {
1853
1894
  verify: B,
1854
1895
  // 🔴 账本:勾了「逐个核对磁盘」就不给它 —— 那样连上一趟铺过的也重新核对一遍。
1855
- trust: I ? void 0 : os,
1896
+ trust: D ? void 0 : us,
1856
1897
  existing: he
1857
1898
  });
1858
- qe("写盘", as), Ke.set(n.handle, et.fingerprints), lt(98, "收尾…");
1859
- const is = et.failed.length > 0 ? `;⚠️ ${et.failed.length} 个文件没写成:${et.failed.slice(0, 3).map((nt) => `${nt.path}(${nt.message})`).join("、")}` + (et.failed.length > 3 ? ` 等 ${et.failed.length} 条` : "") : "", Zt = [];
1899
+ qe("写盘", rs), Ke.set(n.handle, et.fingerprints), lt(98, "收尾…");
1900
+ const ds = et.failed.length > 0 ? `;⚠️ ${et.failed.length} 个文件没写成:${et.failed.slice(0, 3).map((nt) => `${nt.path}(${nt.message})`).join("、")}` + (et.failed.length > 3 ? ` 等 ${et.failed.length} 条` : "") : "", Zt = [];
1860
1901
  et.skipped > 0 && Zt.push(`${et.skipped} 个与库里一字不差(逐字节比过)`), et.trusted > 0 && Zt.push(`${et.trusted} 个按上一趟的账本跳过(没再碰磁盘)`);
1861
- const us = Zt.length > 0 ? `,跳过 ${Zt.join(" / ")}` : "";
1862
- V.value = `铺到「${n.name}」:${t.blocks} 个块、写了 ${et.written} 个文件${us}(含 ${we} / ${Bt} / ${ee})${Ye}${is}${ss}${Zn()}`, y.value = et.failed.length > 0 ? "导出完了,但有文件没写成(见下面那句)" : "导出完了:用你自己的编辑器改,改完回这里「读回改动」", Ct(!0, "完成");
1902
+ const ps = Zt.length > 0 ? `,跳过 ${Zt.join(" / ")}` : "";
1903
+ V.value = `铺到「${n.name}」:${t.blocks} 个块、写了 ${et.written} 个文件${ps}(含 ${we} / ${Bt} / ${ee})${Ye}${ds}${is}${es()}`, y.value = et.failed.length > 0 ? "导出完了,但有文件没写成(见下面那句)" : "导出完了:用你自己的编辑器改,改完回这里「读回改动」", Ct(!0, "完成");
1863
1904
  } catch (mt) {
1864
1905
  throw Ct(!1, "导出中途失败(已经铺进去的文件不会自己删掉)"), mt;
1865
1906
  }
1866
1907
  }
1867
- const Xn = () => G(async () => {
1908
+ const ns = () => G(async () => {
1868
1909
  const n = J.value;
1869
1910
  if (J.value = null, !!n) {
1870
1911
  ut.value = !0;
1871
1912
  try {
1872
1913
  lt(15, "重新取一份开发包…");
1873
- const t = St("/magic-blocks/export", xt()), e = me(), r = await Tt("取包", t);
1914
+ const t = Et("/magic-blocks/export", xt()), e = me(), r = await Tt("取包", t);
1874
1915
  tt.value = r.rules, await ve(n.target, r, { clean: !0, verify: !0, thorough: Vt.value, front: e });
1875
1916
  } catch (t) {
1876
1917
  throw Ct(!1, "导出失败"), t;
@@ -1878,13 +1919,13 @@ ${t.text}`).join(`
1878
1919
  ut.value = !1;
1879
1920
  }
1880
1921
  }
1881
- }, S), Qn = () => G(async () => {
1922
+ }, E), ss = () => G(async () => {
1882
1923
  const n = J.value;
1883
1924
  if (J.value = null, !!n) {
1884
1925
  ut.value = !0;
1885
1926
  try {
1886
1927
  lt(15, "重新取一份开发包…");
1887
- const t = St("/magic-blocks/export", xt()), e = me(), r = await Tt("取包", t);
1928
+ const t = Et("/magic-blocks/export", xt()), e = me(), r = await Tt("取包", t);
1888
1929
  tt.value = r.rules, await ve(n.target, r, { clean: !1, verify: !0, thorough: Vt.value, front: e });
1889
1930
  } catch (t) {
1890
1931
  throw Ct(!1, "导出失败"), t;
@@ -1892,17 +1933,17 @@ ${t.text}`).join(`
1892
1933
  ut.value = !1;
1893
1934
  }
1894
1935
  }
1895
- }, S);
1896
- function ts() {
1936
+ }, E);
1937
+ function os() {
1897
1938
  J.value = null, F.value = { active: !1, percent: 0, stage: "", failed: !1 }, y.value = "这次没有导出(目录里的东西一个字节都没动)", V.value = "";
1898
1939
  }
1899
1940
  const Ve = () => G(async () => {
1900
- const n = U.value ?? await xe();
1901
- U.value = n, q.value || (q.value = n), $t.value = !0, y.value = "", W.value = [], Y.value = [];
1941
+ const n = z.value ?? await xe();
1942
+ z.value = n, q.value || (q.value = n), $t.value = !0, y.value = "", W.value = [], Y.value = [];
1902
1943
  try {
1903
- const t = await fe().catch((L) => {
1944
+ const t = await be().catch((L) => {
1904
1945
  throw new Error(`取不到扫描规则(GET /magic-blocks/rules):${Ot(L)}`);
1905
- }), e = await Do(n, t), r = await at("/magic-blocks/read", {
1946
+ }), e = await Ho(n, t), r = await at("/magic-blocks/read", {
1906
1947
  method: "POST",
1907
1948
  body: JSON.stringify({ ...e, includeMissing: !1 })
1908
1949
  });
@@ -1910,28 +1951,28 @@ ${t.text}`).join(`
1910
1951
  const B = {};
1911
1952
  for (const L of r.blocks ?? []) B[L.id] = L.status === "modified" && L.canApply;
1912
1953
  ct.value = B;
1913
- const I = (r.blocks ?? []).reduce((L, mt) => ({ ...L, [mt.status]: (L[mt.status] ?? 0) + 1 }), {});
1914
- y.value = `扫到 ${r.folders} 个文件夹、${r.files} 个文件:有改动 ${I.modified ?? 0} / 没改动 ${I.unchanged ?? 0}` + (r.complete ? "" : "(层数到了上限,没走完,可能还有块没扫到)");
1954
+ const D = (r.blocks ?? []).reduce((L, mt) => ({ ...L, [mt.status]: (L[mt.status] ?? 0) + 1 }), {});
1955
+ y.value = `扫到 ${r.folders} 个文件夹、${r.files} 个文件:有改动 ${D.modified ?? 0} / 没改动 ${D.unchanged ?? 0}` + (r.complete ? "" : "(层数到了上限,没走完,可能还有块没扫到)");
1915
1956
  } finally {
1916
1957
  $t.value = !1;
1917
1958
  }
1918
- }, S), es = () => G(async () => {
1919
- const n = Wt.value, t = Ls(n);
1959
+ }, E), ls = () => G(async () => {
1960
+ const n = Wt.value, t = Us(n);
1920
1961
  if (W.value = t.issues, Y.value = [], t.issues.length > 0)
1921
1962
  throw y.value = "", new Error(`前端校验没过(${t.issues.length} 条),没有发请求:
1922
1963
  - ${t.issues.join(`
1923
1964
  - `)}`);
1924
1965
  st.value = !0, y.value = "";
1925
1966
  try {
1926
- const e = await St("/magic-blocks/import", { updatedBy: "", blocks: n });
1927
- Y.value = e.results ?? [], y.value = `保存:成功 ${e.saved} 个、失败 ${e.failed} 个`, await Et();
1967
+ const e = await Et("/magic-blocks/import", { updatedBy: "", blocks: n });
1968
+ Y.value = e.results ?? [], y.value = `保存:成功 ${e.saved} 个、失败 ${e.failed} 个`, await St();
1928
1969
  const r = y.value;
1929
1970
  await Ve(), y.value = `${r};已重新读回该目录`;
1930
1971
  } finally {
1931
1972
  st.value = !1;
1932
1973
  }
1933
- }, S);
1934
- function ns(n, t) {
1974
+ }, E);
1975
+ function as(n, t) {
1935
1976
  const e = t.target;
1936
1977
  ct.value[n] = e?.checked === !0;
1937
1978
  }
@@ -1942,51 +1983,51 @@ ${t.text}`).join(`
1942
1983
  }
1943
1984
  function Ge(n) {
1944
1985
  const t = n.detail?.uuid ?? "";
1945
- c.value = !0, g.value = t;
1986
+ c.value = !0, _.value = t;
1946
1987
  }
1947
1988
  function We(n) {
1948
1989
  n.key === "Escape" && c.value && (c.value = !1);
1949
1990
  }
1950
- return rn(() => {
1951
- window.addEventListener("magic-block:open-console", Ge), window.addEventListener("keydown", We), Et(), fe().catch(() => {
1991
+ return dn(() => {
1992
+ window.addEventListener("magic-block:open-console", Ge), window.addEventListener("keydown", We), St(), be().catch(() => {
1952
1993
  });
1953
- }), dn(() => {
1994
+ }), pn(() => {
1954
1995
  window.removeEventListener("magic-block:open-console", Ge), window.removeEventListener("keydown", We);
1955
- }), (n, t) => it(i) ? (d(), p("div", {
1996
+ }), (n, t) => it(i) ? (p(), f("div", {
1956
1997
  key: 0,
1957
1998
  class: K(["mbc__shell", { "is-wide": C.value }])
1958
1999
  }, [
1959
- l("button", {
2000
+ a("button", {
1960
2001
  class: "fab",
1961
2002
  type: "button",
1962
2003
  title: "magic block 控制台",
1963
2004
  onClick: t[0] || (t[0] = (e) => c.value = !0)
1964
2005
  }, "块"),
1965
- c.value ? (d(), p("aside", {
2006
+ c.value ? (p(), f("aside", {
1966
2007
  key: 0,
1967
2008
  class: K(["mbc", { "is-wide": C.value }])
1968
2009
  }, [
1969
- l("header", Io, [
1970
- t[43] || (t[43] = l("strong", { class: "mbc__brand" }, "magic block", -1)),
1971
- l("span", {
2010
+ a("header", Ko, [
2011
+ t[43] || (t[43] = a("strong", { class: "mbc__brand" }, "magic block", -1)),
2012
+ a("span", {
1972
2013
  class: "mbc__count",
1973
2014
  title: `库里一共 ${v.value.length} 个块`
1974
- }, b(v.value.length) + " 个块", 9, No),
1975
- t[44] || (t[44] = l("span", { class: "mbc__grow" }, null, -1)),
1976
- l("button", {
2015
+ }, b(v.value.length) + " 个块", 9, qo),
2016
+ t[44] || (t[44] = a("span", { class: "mbc__grow" }, null, -1)),
2017
+ a("button", {
1977
2018
  class: "p-button p-button-sm p-button-text",
1978
2019
  type: "button",
1979
2020
  title: C.value ? "收起(回到右侧那条窄抽屉)" : "展开:整屏(块 / 工作区两个页签)",
1980
2021
  onClick: t[1] || (t[1] = (e) => C.value = !C.value)
1981
- }, b(C.value ? "收起" : "展开全屏"), 9, Fo),
1982
- l("button", {
2022
+ }, b(C.value ? "收起" : "展开全屏"), 9, Vo),
2023
+ a("button", {
1983
2024
  class: "p-button p-button-sm p-button-text",
1984
2025
  type: "button",
1985
2026
  onClick: t[2] || (t[2] = (e) => c.value = !1)
1986
2027
  }, "关闭")
1987
2028
  ]),
1988
- l("div", zo, [
1989
- l("button", {
2029
+ a("div", Jo, [
2030
+ a("button", {
1990
2031
  class: K(["mbc__tab", { "is-on": R.value === "blocks" }]),
1991
2032
  type: "button",
1992
2033
  role: "tab",
@@ -1994,14 +2035,14 @@ ${t.text}`).join(`
1994
2035
  onClick: t[3] || (t[3] = (e) => R.value = "blocks")
1995
2036
  }, [
1996
2037
  t[45] || (t[45] = $(" 块 ", -1)),
1997
- l("span", Ho, b(v.value.length), 1),
1998
- de.value > 0 ? (d(), p("span", {
2038
+ a("span", Wo, b(v.value.length), 1),
2039
+ de.value > 0 ? (p(), f("span", {
1999
2040
  key: 0,
2000
2041
  class: "mbc__chip is-bad",
2001
2042
  title: `${de.value} 个块被停用(体检没过)`
2002
- }, b(de.value) + " 停用", 9, Ko)) : k("", !0)
2003
- ], 10, Uo),
2004
- l("button", {
2043
+ }, b(de.value) + " 停用", 9, Yo)) : k("", !0)
2044
+ ], 10, Go),
2045
+ a("button", {
2005
2046
  class: K(["mbc__tab", { "is-on": R.value === "workspace" }]),
2006
2047
  type: "button",
2007
2048
  role: "tab",
@@ -2009,126 +2050,126 @@ ${t.text}`).join(`
2009
2050
  onClick: t[4] || (t[4] = (e) => R.value = "workspace")
2010
2051
  }, [
2011
2052
  t[46] || (t[46] = $(" 工作区(导出 / 读回 / 校验) ", -1)),
2012
- dt.value > 0 ? (d(), p("span", {
2053
+ dt.value > 0 ? (p(), f("span", {
2013
2054
  key: 0,
2014
2055
  class: "mbc__chip is-bad",
2015
2056
  title: `这一趟有 ${dt.value} 条问题`
2016
- }, b(dt.value), 9, Vo)) : Y.value.length > 0 ? (d(), p("span", Jo, b(re.value) + " 存成", 1)) : k("", !0)
2017
- ], 10, qo)
2057
+ }, b(dt.value), 9, Xo)) : Y.value.length > 0 ? (p(), f("span", Qo, b(re.value) + " 存成", 1)) : k("", !0)
2058
+ ], 10, Zo)
2018
2059
  ]),
2019
- l("div", Go, [
2020
- F.value.active ? (d(), p("div", Wo, [
2021
- l("div", {
2060
+ a("div", tl, [
2061
+ F.value.active ? (p(), f("div", el, [
2062
+ a("div", {
2022
2063
  class: K(["mbc__progress", { "is-failed": F.value.failed }]),
2023
2064
  role: "progressbar",
2024
2065
  "aria-valuenow": F.value.percent,
2025
2066
  "aria-valuemin": "0",
2026
2067
  "aria-valuemax": "100"
2027
2068
  }, [
2028
- l("div", {
2069
+ a("div", {
2029
2070
  class: "mbc__progress-bar",
2030
- style: pn(An.value)
2071
+ style: fn(jn.value)
2031
2072
  }, null, 4)
2032
- ], 10, Yo),
2033
- l("p", {
2073
+ ], 10, nl),
2074
+ a("p", {
2034
2075
  class: K(["mbc__hint", { "mbc__progress-note": F.value.failed }])
2035
2076
  }, b(F.value.failed ? "✗" : "") + " " + b(F.value.percent) + "% · " + b(F.value.stage), 3)
2036
2077
  ])) : k("", !0),
2037
- J.value ? (d(), p("div", Zo, [
2038
- l("p", Xo, "「" + b(J.value.target.name) + "」里现在有 " + b(J.value.inventory.dirs) + " 个文件夹 / " + b(J.value.inventory.files) + " 个文件", 1),
2039
- l("p", Qo, [
2040
- t[47] || (t[47] = l("b", null, "只覆盖", -1)),
2078
+ J.value ? (p(), f("div", sl, [
2079
+ a("p", ol, "「" + b(J.value.target.name) + "」里现在有 " + b(J.value.inventory.dirs) + " 个文件夹 / " + b(J.value.inventory.files) + " 个文件", 1),
2080
+ a("p", ll, [
2081
+ t[47] || (t[47] = a("b", null, "只覆盖", -1)),
2041
2082
  t[48] || (t[48] = $("(天天用这个):只把库里", -1)),
2042
- t[49] || (t[49] = l("b", null, "改过 / 缺了", -1)),
2083
+ t[49] || (t[49] = a("b", null, "改过 / 缺了", -1)),
2043
2084
  t[50] || (t[50] = $("的那些写下去 —— 上一趟铺过、 这一趟一字没变的**一概不碰**(所以很快;代价是你自己在编辑器里改过、还没读回库的那些 ", -1)),
2044
- t[51] || (t[51] = l("b", null, "会留着", -1)),
2085
+ t[51] || (t[51] = a("b", null, "会留着", -1)),
2045
2086
  t[52] || (t[52] = $(")。 ", -1)),
2046
- t[53] || (t[53] = l("b", null, "清空并导出", -1)),
2087
+ t[53] || (t[53] = a("b", null, "清空并导出", -1)),
2047
2088
  t[54] || (t[54] = $(":先删掉这一包没有的东西,其余同上。 两种都只动这个目录", -1)),
2048
- t[55] || (t[55] = l("b", null, "里面", -1)),
2089
+ t[55] || (t[55] = a("b", null, "里面", -1)),
2049
2090
  t[56] || (t[56] = $("的子项:目录本身、以及它外面的任何东西都不会被碰。", -1)),
2050
- J.value.inventory.items.length > 0 ? (d(), p("span", tl, "(" + b(J.value.inventory.items.slice(0, 6).map((e) => e.name).join(" / ")) + b(J.value.inventory.items.length > 6 ? " …" : "") + ")", 1)) : k("", !0)
2091
+ J.value.inventory.items.length > 0 ? (p(), f("span", al, "(" + b(J.value.inventory.items.slice(0, 6).map((e) => e.name).join(" / ")) + b(J.value.inventory.items.length > 6 ? " …" : "") + ")", 1)) : k("", !0)
2051
2092
  ]),
2052
- l("label", el, [
2053
- vt(l("input", {
2093
+ a("label", il, [
2094
+ vt(a("input", {
2054
2095
  "onUpdate:modelValue": t[5] || (t[5] = (e) => Vt.value = e),
2055
2096
  type: "checkbox"
2056
2097
  }, null, 512), [
2057
- [rs, Vt.value]
2098
+ [ms, Vt.value]
2058
2099
  ]),
2059
- t[57] || (t[57] = l("span", null, [
2100
+ t[57] || (t[57] = a("span", null, [
2060
2101
  $("逐个核对磁盘(慢):把上一趟铺过的也重新读一遍比对,"),
2061
- l("b", null, "你在编辑器里改过、还没读回库的那些会被库里的那份盖掉")
2102
+ a("b", null, "你在编辑器里改过、还没读回库的那些会被库里的那份盖掉")
2062
2103
  ], -1))
2063
2104
  ]),
2064
- l("div", nl, [
2065
- l("button", {
2105
+ a("div", ul, [
2106
+ a("button", {
2066
2107
  class: "p-button p-button-sm",
2067
2108
  type: "button",
2068
- disabled: S.value,
2069
- onClick: t[6] || (t[6] = (e) => Xn())
2070
- }, "清空并导出", 8, sl),
2071
- l("button", {
2109
+ disabled: E.value,
2110
+ onClick: t[6] || (t[6] = (e) => ns())
2111
+ }, "清空并导出", 8, cl),
2112
+ a("button", {
2072
2113
  class: "p-button p-button-sm p-button-outlined",
2073
2114
  type: "button",
2074
- disabled: S.value,
2075
- onClick: t[7] || (t[7] = (e) => Qn())
2076
- }, "只覆盖", 8, ol),
2077
- l("button", {
2115
+ disabled: E.value,
2116
+ onClick: t[7] || (t[7] = (e) => ss())
2117
+ }, "只覆盖", 8, rl),
2118
+ a("button", {
2078
2119
  class: "p-button p-button-sm p-button-text",
2079
2120
  type: "button",
2080
- disabled: S.value,
2081
- onClick: t[8] || (t[8] = (e) => ts())
2082
- }, "取消", 8, ll)
2121
+ disabled: E.value,
2122
+ onClick: t[8] || (t[8] = (e) => os())
2123
+ }, "取消", 8, dl)
2083
2124
  ])
2084
2125
  ])) : k("", !0),
2085
- H.value ? (d(), p("div", al, [
2086
- l("p", il, "删掉「" + b(H.value.row.module) + " / " + b(H.value.row.name || H.value.row.id) + "」的代码文件", 1),
2087
- l("p", ul, [
2088
- t[66] || (t[66] = l("b", null, "库里那一份代码正文会被清空", -1)),
2126
+ H.value ? (p(), f("div", pl, [
2127
+ a("p", fl, "删掉「" + b(H.value.row.module) + " / " + b(H.value.row.name || H.value.row.id) + "」的代码文件", 1),
2128
+ a("p", bl, [
2129
+ t[66] || (t[66] = a("b", null, "库里那一份代码正文会被清空", -1)),
2089
2130
  t[67] || (t[67] = $("(入口 / 清单 / 后端一起); ", -1)),
2090
- H.value.target ? (d(), p(M, { key: 0 }, [
2131
+ H.value.target ? (p(), f(M, { key: 0 }, [
2091
2132
  t[58] || (t[58] = $(" 同时清掉你本机那个块文件夹 ", -1)),
2092
- l("span", cl, b(H.value.target.name) + "/" + b(H.value.folder), 1),
2093
- H.value.inventory && H.value.inventory.items.some((e) => e.name === H.value?.folder) ? (d(), p(M, { key: 0 }, [
2133
+ a("span", ml, b(H.value.target.name) + "/" + b(H.value.folder), 1),
2134
+ H.value.inventory && H.value.inventory.items.some((e) => e.name === H.value?.folder) ? (p(), f(M, { key: 0 }, [
2094
2135
  $(" (它现在在顶层,里面有东西:本次会先清空)。 ")
2095
2136
  ], 64)) : k("", !0),
2096
- t[59] || (t[59] = l("b", null, "只动这一个块的文件夹", -1)),
2137
+ t[59] || (t[59] = a("b", null, "只动这一个块的文件夹", -1)),
2097
2138
  t[60] || (t[60] = $(":别的块、", -1)),
2098
- t[61] || (t[61] = l("span", { class: "mbc__mono" }, "example/", -1)),
2139
+ t[61] || (t[61] = a("span", { class: "mbc__mono" }, "example/", -1)),
2099
2140
  t[62] || (t[62] = $("、以及目录外面的一切都不会被碰。 ", -1))
2100
- ], 64)) : (d(), p(M, { key: 1 }, [
2141
+ ], 64)) : (p(), f(M, { key: 1 }, [
2101
2142
  t[63] || (t[63] = $(" 现在没有选中开发目录 / 或者读不到它,所以", -1)),
2102
- t[64] || (t[64] = l("b", null, "本机那份不动", -1)),
2143
+ t[64] || (t[64] = a("b", null, "本机那份不动", -1)),
2103
2144
  t[65] || (t[65] = $(",只清库里那份。 ", -1))
2104
2145
  ], 64)),
2105
- t[68] || (t[68] = l("br", null, null, -1)),
2146
+ t[68] || (t[68] = a("br", null, null, -1)),
2106
2147
  t[69] || (t[69] = $(" 🔴 ", -1)),
2107
- t[70] || (t[70] = l("b", null, "块本身留着", -1)),
2148
+ t[70] || (t[70] = a("b", null, "块本身留着", -1)),
2108
2149
  t[71] || (t[71] = $('(这一行不动):页面上那块会显示成占位框,而不是"库里没有这个块"; 删错了也能救回来:展开这一块 → 版本史 → 「切回」删之前那一版。 ', -1))
2109
2150
  ]),
2110
- l("div", rl, [
2111
- l("button", {
2151
+ a("div", vl, [
2152
+ a("button", {
2112
2153
  class: "p-button p-button-sm",
2113
2154
  type: "button",
2114
- disabled: S.value,
2155
+ disabled: E.value,
2115
2156
  onClick: t[9] || (t[9] = (e) => le())
2116
- }, "确认删除代码文件", 8, dl),
2117
- l("button", {
2157
+ }, "确认删除代码文件", 8, hl),
2158
+ a("button", {
2118
2159
  class: "p-button p-button-sm p-button-text",
2119
2160
  type: "button",
2120
- disabled: S.value,
2161
+ disabled: E.value,
2121
2162
  onClick: t[10] || (t[10] = (e) => H.value = null)
2122
- }, "取消", 8, pl)
2163
+ }, "取消", 8, gl)
2123
2164
  ])
2124
2165
  ])) : k("", !0),
2125
- vt(l("section", bl, [
2126
- l("h3", fl, [
2166
+ vt(a("section", _l, [
2167
+ a("h3", yl, [
2127
2168
  t[72] || (t[72] = $(" 库里的块 ", -1)),
2128
- l("span", ml, b(ze.value.length) + " / " + b(v.value.length), 1),
2129
- P.value.trim() ? (d(), p("span", vl, "标签:" + b(P.value), 1)) : k("", !0)
2169
+ a("span", kl, b(Ue.value.length) + " / " + b(v.value.length), 1),
2170
+ P.value.trim() ? (p(), f("span", $l, "标签:" + b(P.value), 1)) : k("", !0)
2130
2171
  ]),
2131
- vt(l("input", {
2172
+ vt(a("input", {
2132
2173
  "onUpdate:modelValue": t[11] || (t[11] = (e) => h.value = e),
2133
2174
  class: "p-inputtext p-component mbc__search",
2134
2175
  type: "search",
@@ -2136,9 +2177,9 @@ ${t.text}`).join(`
2136
2177
  }, null, 512), [
2137
2178
  [Xt, h.value]
2138
2179
  ]),
2139
- z.value.length > 0 ? (d(), p("div", hl, [
2140
- t[73] || (t[73] = l("span", { class: "mbc__label" }, "标签", -1)),
2141
- vt(l("input", {
2180
+ U.value.length > 0 ? (p(), f("div", wl, [
2181
+ t[73] || (t[73] = a("span", { class: "mbc__label" }, "标签", -1)),
2182
+ vt(a("input", {
2142
2183
  "onUpdate:modelValue": t[12] || (t[12] = (e) => P.value = e),
2143
2184
  class: "p-inputtext p-component mbc__tagfilter",
2144
2185
  type: "search",
@@ -2146,78 +2187,78 @@ ${t.text}`).join(`
2146
2187
  }, null, 512), [
2147
2188
  [Xt, P.value]
2148
2189
  ]),
2149
- (d(!0), p(M, null, N(z.value.slice(0, 24), (e) => (d(), p("button", {
2190
+ (p(!0), f(M, null, N(U.value.slice(0, 24), (e) => (p(), f("button", {
2150
2191
  key: e.tag,
2151
2192
  class: K(["p-tag mbc__tag", { "is-on": P.value.trim().toLowerCase() === e.tag.toLowerCase() }]),
2152
2193
  type: "button",
2153
2194
  title: `只看贴了「${e.tag}」的块(${e.count} 个)`,
2154
2195
  onClick: (r) => P.value = P.value.trim().toLowerCase() === e.tag.toLowerCase() ? "" : e.tag
2155
- }, b(e.tag) + " " + b(e.count), 11, _l))), 128)),
2156
- P.value ? (d(), p("button", {
2196
+ }, b(e.tag) + " " + b(e.count), 11, xl))), 128)),
2197
+ P.value ? (p(), f("button", {
2157
2198
  key: 0,
2158
2199
  class: "p-button p-button-sm p-button-text",
2159
2200
  type: "button",
2160
2201
  onClick: t[13] || (t[13] = (e) => P.value = "")
2161
2202
  }, "清掉标签筛选")) : k("", !0)
2162
2203
  ])) : k("", !0),
2163
- l("ul", gl, [
2164
- (d(!0), p(M, null, N(ze.value, (e) => (d(), p("li", {
2204
+ a("ul", Cl, [
2205
+ (p(!0), f(M, null, N(Ue.value, (e) => (p(), f("li", {
2165
2206
  key: e.id
2166
2207
  }, [
2167
- l("button", {
2208
+ a("button", {
2168
2209
  type: "button",
2169
- class: K(["mbc__row", { "is-active": e.id === g.value, "is-off": e.enabled === !1 }]),
2170
- title: Hn(e),
2171
- onClick: (r) => Rn(e)
2210
+ class: K(["mbc__row", { "is-active": e.id === _.value, "is-off": e.enabled === !1 }]),
2211
+ title: Jn(e),
2212
+ onClick: (r) => Ln(e)
2172
2213
  }, [
2173
- l("span", kl, b(e.module || "unassigned"), 1),
2174
- l("span", $l, b(e.name || e.id), 1),
2175
- l("span", {
2214
+ a("span", Sl, b(e.module || "unassigned"), 1),
2215
+ a("span", Tl, b(e.name || e.id), 1),
2216
+ a("span", {
2176
2217
  class: "mbc__version-badge",
2177
2218
  title: `当前是第 ${e.version || 1} 版,一共留着 ${e.versionCount ?? 1} 版`
2178
2219
  }, [
2179
2220
  $("v" + b(e.version || 1), 1),
2180
- (e.versionCount ?? 1) > 1 ? (d(), p(M, { key: 0 }, [
2221
+ (e.versionCount ?? 1) > 1 ? (p(), f(M, { key: 0 }, [
2181
2222
  $("/" + b(e.versionCount), 1)
2182
2223
  ], 64)) : k("", !0)
2183
- ], 8, wl),
2184
- (d(!0), p(M, null, N(e.tags ?? [], (r) => (d(), p("span", {
2224
+ ], 8, Bl),
2225
+ (p(!0), f(M, null, N(e.tags ?? [], (r) => (p(), f("span", {
2185
2226
  key: r,
2186
2227
  class: "p-tag mbc__tag mbc__tag--on-row"
2187
2228
  }, b(r), 1))), 128)),
2188
- Jt(e).length > 0 ? (d(), p("span", xl, b(Jt(e).join(" / ")), 1)) : k("", !0),
2189
- l("em", {
2229
+ Jt(e).length > 0 ? (p(), f("span", Ml, b(Jt(e).join(" / ")), 1)) : k("", !0),
2230
+ a("em", {
2190
2231
  class: K({ "is-off": e.enabled === !1 })
2191
2232
  }, b(e.enabled === !1 ? Ne(e) || "校验失败已停用" : "可用"), 3),
2192
- (e.detail ?? "").trim() ? (d(), p("span", {
2233
+ (e.detail ?? "").trim() ? (p(), f("span", {
2193
2234
  key: 1,
2194
2235
  class: "mbc__detail-line",
2195
- title: it(un)(e.detail ?? "", 240)
2196
- }, b(it(un)(e.detail ?? "")), 9, Cl)) : k("", !0)
2197
- ], 10, yl),
2198
- g.value === e.id ? (d(), p("div", Sl, [
2199
- (d(!0), p(M, null, N(ce(e).slice(0, Se), (r, B) => (d(), p("p", {
2236
+ title: it(cn)(e.detail ?? "", 240)
2237
+ }, b(it(cn)(e.detail ?? "")), 9, Al)) : k("", !0)
2238
+ ], 10, El),
2239
+ _.value === e.id ? (p(), f("div", Rl, [
2240
+ (p(!0), f(M, null, N(ce(e).slice(0, Ee), (r, B) => (p(), f("p", {
2200
2241
  key: B,
2201
2242
  class: "mbc__problem"
2202
2243
  }, b(r), 1))), 128)),
2203
- ce(e).length > Se ? (d(), p("p", El, "还有 " + b(ce(e).length - Se) + " 条问题没显示出来:点上面的「校验全部魔法块」重算一遍(这几条是上次校验的结论)", 1)) : k("", !0),
2204
- l("dl", Tl, [
2205
- t[76] || (t[76] = l("dt", null, "详情", -1)),
2206
- l("dd", null, [
2207
- yt.value !== e.id ? (d(), p(M, { key: 0 }, [
2208
- (e.detail ?? "").trim() ? (d(), p("div", {
2244
+ ce(e).length > Ee ? (p(), f("p", Ol, "还有 " + b(ce(e).length - Ee) + " 条问题没显示出来:点上面的「校验全部魔法块」重算一遍(这几条是上次校验的结论)", 1)) : k("", !0),
2245
+ a("dl", Pl, [
2246
+ t[76] || (t[76] = a("dt", null, "详情", -1)),
2247
+ a("dd", null, [
2248
+ yt.value !== e.id ? (p(), f(M, { key: 0 }, [
2249
+ (e.detail ?? "").trim() ? (p(), f("div", {
2209
2250
  key: 0,
2210
2251
  class: "mbc__blockdetail",
2211
- innerHTML: it(ho)(e.detail ?? "")
2212
- }, null, 8, Bl)) : (d(), p("span", Ml, "(这一块没写详情 —— 点右边「写详情」写一段**业务功能说明**:谁能用、什么场景、解决什么、输入输出是什么业务含义;用 Markdown 写,**别写路由 / 字段 / 实现方式**)")),
2213
- l("button", {
2252
+ innerHTML: it(Eo)(e.detail ?? "")
2253
+ }, null, 8, jl)) : (p(), f("span", Ll, "(这一块没写详情 —— 点右边「写详情」写一段**业务功能说明**:谁能用、什么场景、解决什么、输入输出是什么业务含义;用 Markdown 写,**别写路由 / 字段 / 实现方式**)")),
2254
+ a("button", {
2214
2255
  class: "p-button p-button-sm p-button-text",
2215
2256
  type: "button",
2216
- disabled: S.value,
2217
- onClick: (r) => Nn(e)
2218
- }, b((e.detail ?? "").trim() ? "改详情" : "写详情"), 9, Al)
2219
- ], 64)) : (d(), p(M, { key: 1 }, [
2220
- vt(l("textarea", {
2257
+ disabled: E.value,
2258
+ onClick: (r) => Hn(e)
2259
+ }, b((e.detail ?? "").trim() ? "改详情" : "写详情"), 9, Il)
2260
+ ], 64)) : (p(), f(M, { key: 1 }, [
2261
+ vt(a("textarea", {
2221
2262
  "onUpdate:modelValue": t[14] || (t[14] = (r) => kt.value = r),
2222
2263
  class: "p-inputtext p-component mbc__detailinput",
2223
2264
  rows: "6",
@@ -2232,169 +2273,169 @@ ${t.text}`).join(`
2232
2273
  }, null, 512), [
2233
2274
  [Xt, kt.value]
2234
2275
  ]),
2235
- l("button", {
2276
+ a("button", {
2236
2277
  class: "p-button p-button-sm",
2237
2278
  type: "button",
2238
- disabled: S.value,
2239
- onClick: (r) => In(e)
2240
- }, "存详情", 8, Rl),
2241
- l("button", {
2279
+ disabled: E.value,
2280
+ onClick: (r) => zn(e)
2281
+ }, "存详情", 8, Dl),
2282
+ a("button", {
2242
2283
  class: "p-button p-button-sm p-button-text",
2243
2284
  type: "button",
2244
- disabled: S.value,
2285
+ disabled: E.value,
2245
2286
  onClick: t[15] || (t[15] = (r) => yt.value = "")
2246
- }, "取消", 8, Ol)
2287
+ }, "取消", 8, Nl)
2247
2288
  ], 64))
2248
2289
  ]),
2249
- t[77] || (t[77] = l("dt", null, "文件", -1)),
2250
- l("dd", null, b((e.fileNames || []).join(" / ") || "(没有文件)"), 1),
2251
- t[78] || (t[78] = l("dt", null, "版本", -1)),
2252
- l("dd", null, [
2290
+ t[77] || (t[77] = a("dt", null, "文件", -1)),
2291
+ a("dd", null, b((e.fileNames || []).join(" / ") || "(没有文件)"), 1),
2292
+ t[78] || (t[78] = a("dt", null, "版本", -1)),
2293
+ a("dd", null, [
2253
2294
  $("v" + b(e.version || 1), 1),
2254
- l("span", Pl, "(一共留着 " + b(e.versionCount ?? ot.value[e.id]?.length ?? 1) + " 版)", 1)
2295
+ a("span", Fl, "(一共留着 " + b(e.versionCount ?? ot.value[e.id]?.length ?? 1) + " 版)", 1)
2255
2296
  ]),
2256
- t[79] || (t[79] = l("dt", null, "标签", -1)),
2257
- l("dd", null, [
2258
- Z.value !== e.id ? (d(), p(M, { key: 0 }, [
2259
- (d(!0), p(M, null, N(e.tags ?? [], (r) => (d(), p("span", {
2297
+ t[79] || (t[79] = a("dt", null, "标签", -1)),
2298
+ a("dd", null, [
2299
+ Z.value !== e.id ? (p(), f(M, { key: 0 }, [
2300
+ (p(!0), f(M, null, N(e.tags ?? [], (r) => (p(), f("span", {
2260
2301
  key: r,
2261
2302
  class: "p-tag mbc__tag"
2262
2303
  }, b(r), 1))), 128)),
2263
- (e.tags ?? []).length === 0 ? (d(), p("span", jl, "(没贴标签)")) : k("", !0),
2264
- l("button", {
2304
+ (e.tags ?? []).length === 0 ? (p(), f("span", Ul, "(没贴标签)")) : k("", !0),
2305
+ a("button", {
2265
2306
  class: "p-button p-button-sm p-button-text",
2266
2307
  type: "button",
2267
- disabled: S.value,
2268
- onClick: (r) => Dn(e)
2269
- }, "改标签", 8, Ll)
2270
- ], 64)) : (d(), p(M, { key: 1 }, [
2271
- vt(l("input", {
2308
+ disabled: E.value,
2309
+ onClick: (r) => Un(e)
2310
+ }, "改标签", 8, zl)
2311
+ ], 64)) : (p(), f(M, { key: 1 }, [
2312
+ vt(a("input", {
2272
2313
  "onUpdate:modelValue": t[16] || (t[16] = (r) => X.value = r),
2273
2314
  class: "p-inputtext p-component mbc__taginput",
2274
2315
  type: "text",
2275
2316
  placeholder: "逗号分隔,例如:订单, 报表",
2276
- onKeyup: ds((r) => Fe(e), ["enter"])
2277
- }, null, 40, Dl), [
2317
+ onKeyup: vs((r) => Fe(e), ["enter"])
2318
+ }, null, 40, Hl), [
2278
2319
  [Xt, X.value]
2279
2320
  ]),
2280
- l("button", {
2321
+ a("button", {
2281
2322
  class: "p-button p-button-sm",
2282
2323
  type: "button",
2283
- disabled: S.value,
2324
+ disabled: E.value,
2284
2325
  onClick: (r) => Fe(e)
2285
- }, "存标签", 8, Il),
2286
- l("button", {
2326
+ }, "存标签", 8, Kl),
2327
+ a("button", {
2287
2328
  class: "p-button p-button-sm p-button-text",
2288
2329
  type: "button",
2289
- disabled: S.value,
2330
+ disabled: E.value,
2290
2331
  onClick: t[17] || (t[17] = (r) => Z.value = "")
2291
- }, "取消", 8, Nl),
2292
- z.value.length > 0 ? (d(), p("div", Fl, [
2293
- t[74] || (t[74] = l("span", { class: "mbc__hint" }, "点现成的加进去:", -1)),
2294
- (d(!0), p(M, null, N(z.value.slice(0, 16), (r) => (d(), p("button", {
2332
+ }, "取消", 8, ql),
2333
+ U.value.length > 0 ? (p(), f("div", Vl, [
2334
+ t[74] || (t[74] = a("span", { class: "mbc__hint" }, "点现成的加进去:", -1)),
2335
+ (p(!0), f(M, null, N(U.value.slice(0, 16), (r) => (p(), f("button", {
2295
2336
  key: r.tag,
2296
2337
  class: "p-tag mbc__tag",
2297
2338
  type: "button",
2298
2339
  title: `把「${r.tag}」加进去`,
2299
- onClick: (B) => Fn(r.tag)
2300
- }, b(r.tag), 9, zl))), 128))
2340
+ onClick: (B) => Kn(r.tag)
2341
+ }, b(r.tag), 9, Jl))), 128))
2301
2342
  ])) : k("", !0),
2302
- X.value.trim() ? (d(), p("div", Ul, [
2303
- t[75] || (t[75] = l("span", { class: "mbc__hint" }, "这一块会贴:", -1)),
2304
- (d(!0), p(M, null, N(X.value.split(/[,,\s]+/).filter(Boolean), (r) => (d(), p("button", {
2343
+ X.value.trim() ? (p(), f("div", Gl, [
2344
+ t[75] || (t[75] = a("span", { class: "mbc__hint" }, "这一块会贴:", -1)),
2345
+ (p(!0), f(M, null, N(X.value.split(/[,,\s]+/).filter(Boolean), (r) => (p(), f("button", {
2305
2346
  key: r,
2306
2347
  class: "p-tag mbc__tag",
2307
2348
  type: "button",
2308
2349
  title: `从这一块上摘掉「${r}」`,
2309
- onClick: (B) => zn(r)
2310
- }, b(r) + " ×", 9, Hl))), 128))
2350
+ onClick: (B) => qn(r)
2351
+ }, b(r) + " ×", 9, Wl))), 128))
2311
2352
  ])) : k("", !0)
2312
2353
  ], 64))
2313
2354
  ]),
2314
- t[80] || (t[80] = l("dt", null, "更新", -1)),
2315
- l("dd", null, b(e.updatedAt || "—"), 1),
2316
- t[81] || (t[81] = l("dt", null, "id", -1)),
2317
- l("dd", Kl, b(e.id), 1)
2355
+ t[80] || (t[80] = a("dt", null, "更新", -1)),
2356
+ a("dd", null, b(e.updatedAt || "—"), 1),
2357
+ t[81] || (t[81] = a("dt", null, "id", -1)),
2358
+ a("dd", Yl, b(e.id), 1)
2318
2359
  ]),
2319
- l("div", ql, [
2320
- l("button", {
2360
+ a("div", Zl, [
2361
+ a("button", {
2321
2362
  class: "p-button p-button-sm p-button-outlined",
2322
2363
  type: "button",
2323
- disabled: S.value,
2364
+ disabled: E.value,
2324
2365
  onClick: (r) => oe(e),
2325
2366
  title: "删掉这一块的代码文件:本机的文件夹 + 库里那份代码正文(点下去会先问你确认)。块本身留着,页面上会显示成占位框"
2326
- }, "删除代码文件", 8, Vl)
2367
+ }, "删除代码文件", 8, Xl)
2327
2368
  ]),
2328
- l("div", Jl, [
2329
- l("div", Gl, [
2330
- t[82] || (t[82] = l("strong", null, "版本(每次上传 +1,旧的都留着)", -1)),
2331
- l("button", {
2369
+ a("div", Ql, [
2370
+ a("div", ta, [
2371
+ t[82] || (t[82] = a("strong", null, "版本(每次上传 +1,旧的都留着)", -1)),
2372
+ a("button", {
2332
2373
  class: "p-button p-button-sm p-button-text",
2333
2374
  type: "button",
2334
- disabled: S.value,
2335
- onClick: (r) => D(e.id)
2336
- }, b(w.value === e.id ? "读版本中…" : "刷新版本"), 9, Wl)
2375
+ disabled: E.value,
2376
+ onClick: (r) => I(e.id)
2377
+ }, b(w.value === e.id ? "读版本中…" : "刷新版本"), 9, ea)
2337
2378
  ]),
2338
- ot.value[e.id] ? ot.value[e.id].length > 0 ? (d(), p("ul", Zl, [
2339
- (d(!0), p(M, null, N(ot.value[e.id], (r) => (d(), p("li", {
2379
+ ot.value[e.id] ? ot.value[e.id].length > 0 ? (p(), f("ul", sa, [
2380
+ (p(!0), f(M, null, N(ot.value[e.id], (r) => (p(), f("li", {
2340
2381
  key: r.number,
2341
2382
  class: K({ "is-current": r.current })
2342
2383
  }, [
2343
- l("span", Xl, b(rt(r)), 1),
2344
- l("span", Ql, [
2345
- $(b(r.fileCount) + " 个文件 · " + b(It(r.sizeBytes)), 1),
2346
- r.createdBy ? (d(), p(M, { key: 0 }, [
2384
+ a("span", oa, b(rt(r)), 1),
2385
+ a("span", la, [
2386
+ $(b(r.fileCount) + " 个文件 · " + b(Dt(r.sizeBytes)), 1),
2387
+ r.createdBy ? (p(), f(M, { key: 0 }, [
2347
2388
  $(" · " + b(r.createdBy), 1)
2348
2389
  ], 64)) : k("", !0),
2349
2390
  $(" · " + b(r.createdAt || "—"), 1)
2350
2391
  ]),
2351
- l("span", ta, [
2352
- l("button", {
2392
+ a("span", aa, [
2393
+ a("button", {
2353
2394
  class: "p-button p-button-sm p-button-text",
2354
2395
  type: "button",
2355
- disabled: S.value || r.empty,
2356
- onClick: (B) => On(e, r.number),
2396
+ disabled: E.value || r.empty,
2397
+ onClick: (B) => In(e, r.number),
2357
2398
  title: r.empty ? "这一版是空包(代码被删过),没有正文可看" : "看这一版的正文(只读)"
2358
- }, "查看", 8, ea),
2359
- l("button", {
2399
+ }, "查看", 8, ia),
2400
+ a("button", {
2360
2401
  class: "p-button p-button-sm p-button-text",
2361
2402
  type: "button",
2362
- disabled: S.value || r.current || r.empty,
2363
- onClick: (B) => Pn(e, r.number),
2403
+ disabled: E.value || r.current || r.empty,
2404
+ onClick: (B) => Dn(e, r.number),
2364
2405
  title: r.current ? "这一版正在跑" : "把这一版变成当前版(会记成一个新版本)"
2365
- }, "切回", 8, na),
2366
- l("button", {
2406
+ }, "切回", 8, ua),
2407
+ a("button", {
2367
2408
  class: "p-button p-button-sm p-button-text",
2368
2409
  type: "button",
2369
- disabled: S.value || r.empty,
2370
- onClick: (B) => Ln(e, r.number),
2410
+ disabled: E.value || r.empty,
2411
+ onClick: (B) => Fn(e, r.number),
2371
2412
  title: r.empty ? "空包没什么可下的" : "下载这一版(一个 zip)"
2372
- }, "下载", 8, sa),
2373
- l("button", {
2413
+ }, "下载", 8, ca),
2414
+ a("button", {
2374
2415
  class: "p-button p-button-sm p-button-text",
2375
2416
  type: "button",
2376
- disabled: S.value || r.current,
2377
- onClick: (B) => jn(e, r.number),
2417
+ disabled: E.value || r.current,
2418
+ onClick: (B) => Nn(e, r.number),
2378
2419
  title: r.current ? "当前那一版不许删:先切到别的版本" : "删掉这一版(别的版本不受影响)"
2379
- }, "删", 8, oa)
2420
+ }, "删", 8, ra)
2380
2421
  ])
2381
2422
  ], 2))), 128))
2382
- ])) : (d(), p("p", la, "这个块还没有版本记录(它从没被保存过)。")) : (d(), p("p", Yl, "正在读版本…(没读到时点「刷新版本」)")),
2383
- T.value && T.value.id === e.id ? (d(), p("div", aa, [
2384
- l("div", ia, [
2385
- l("strong", null, "看 v" + b(T.value.number) + " 的正文(只读)", 1),
2386
- l("button", {
2423
+ ])) : (p(), f("p", da, "这个块还没有版本记录(它从没被保存过)。")) : (p(), f("p", na, "正在读版本…(没读到时点「刷新版本」)")),
2424
+ T.value && T.value.id === e.id ? (p(), f("div", pa, [
2425
+ a("div", fa, [
2426
+ a("strong", null, "看 v" + b(T.value.number) + " 的正文(只读)", 1),
2427
+ a("button", {
2387
2428
  class: "p-button p-button-sm p-button-text",
2388
2429
  type: "button",
2389
2430
  onClick: t[18] || (t[18] = (r) => T.value = null)
2390
2431
  }, "收起")
2391
2432
  ]),
2392
- (d(!0), p(M, null, N(T.value.files, (r, B) => (d(), p("details", {
2433
+ (p(!0), f(M, null, N(T.value.files, (r, B) => (p(), f("details", {
2393
2434
  key: B,
2394
2435
  class: "mbc__viewer-file"
2395
2436
  }, [
2396
- l("summary", ua, b(B) + "(" + b(It(r.length)) + ")", 1),
2397
- l("pre", ca, b(r), 1)
2437
+ a("summary", ba, b(B) + "(" + b(Dt(r.length)) + ")", 1),
2438
+ a("pre", ma, b(r), 1)
2398
2439
  ]))), 128))
2399
2440
  ])) : k("", !0)
2400
2441
  ])
@@ -2404,350 +2445,350 @@ ${t.text}`).join(`
2404
2445
  ], 512), [
2405
2446
  [Qt, R.value === "blocks"]
2406
2447
  ]),
2407
- vt(l("section", ra, [
2408
- t[92] || (t[92] = l("h3", { class: "mbc__title" }, "导出去改(用你自己的编辑器)", -1)),
2409
- l("div", da, [
2410
- t[83] || (t[83] = l("span", { class: "mbc__label" }, "体检", -1)),
2411
- l("button", {
2448
+ vt(a("section", va, [
2449
+ t[92] || (t[92] = a("h3", { class: "mbc__title" }, "导出去改(用你自己的编辑器)", -1)),
2450
+ a("div", ha, [
2451
+ t[83] || (t[83] = a("span", { class: "mbc__label" }, "体检", -1)),
2452
+ a("button", {
2412
2453
  class: "p-button p-button-sm",
2413
2454
  type: "button",
2414
- disabled: S.value,
2415
- onClick: t[19] || (t[19] = (e) => Wn())
2416
- }, b(Dt.value ? "校验中…" : "校验全部魔法块"), 9, pa),
2417
- t[84] || (t[84] = l("span", { class: "mbc__hint" }, "重新跑一遍逐块判据(试加载 + 引用深检),过不了的整块停用;改好再点一次就恢复。", -1))
2455
+ disabled: E.value,
2456
+ onClick: t[19] || (t[19] = (e) => Qn())
2457
+ }, b(It.value ? "校验中…" : "校验全部魔法块"), 9, ga),
2458
+ t[84] || (t[84] = a("span", { class: "mbc__hint" }, "重新跑一遍逐块判据(试加载 + 引用深检),过不了的整块停用;改好再点一次就恢复。", -1))
2418
2459
  ]),
2419
- t[93] || (t[93] = l("hr", { class: "mbc__rule" }, null, -1)),
2420
- l("div", ba, [
2421
- t[86] || (t[86] = l("span", { class: "mbc__label" }, "导出范围", -1)),
2422
- l("label", fa, [
2423
- l("input", {
2460
+ t[93] || (t[93] = a("hr", { class: "mbc__rule" }, null, -1)),
2461
+ a("div", _a, [
2462
+ t[86] || (t[86] = a("span", { class: "mbc__label" }, "导出范围", -1)),
2463
+ a("label", ya, [
2464
+ a("input", {
2424
2465
  type: "radio",
2425
2466
  name: "mbc-scope",
2426
2467
  value: "one",
2427
2468
  checked: Q.value === "one",
2428
2469
  onChange: t[20] || (t[20] = (e) => Q.value = "one")
2429
- }, null, 40, ma),
2470
+ }, null, 40, ka),
2430
2471
  t[85] || (t[85] = $(" 仅这一个块 ", -1))
2431
2472
  ]),
2432
- l("label", va, [
2433
- l("input", {
2473
+ a("label", $a, [
2474
+ a("input", {
2434
2475
  type: "radio",
2435
2476
  name: "mbc-scope",
2436
2477
  value: "all",
2437
2478
  checked: Q.value === "all",
2438
2479
  onChange: t[21] || (t[21] = (e) => Q.value = "all")
2439
- }, null, 40, ha),
2480
+ }, null, 40, wa),
2440
2481
  $(" 全部块(" + b(v.value.length) + " 个) ", 1)
2441
2482
  ]),
2442
- Q.value === "one" ? (d(), p("select", {
2483
+ Q.value === "one" ? (p(), f("select", {
2443
2484
  key: 0,
2444
2485
  class: "p-inputtext p-component mbc__grow",
2445
2486
  value: wt.value,
2446
- disabled: S.value || v.value.length === 0,
2487
+ disabled: E.value || v.value.length === 0,
2447
2488
  onChange: t[22] || (t[22] = (e) => Kt(e.target.value))
2448
2489
  }, [
2449
- v.value.length === 0 ? (d(), p("option", ga, "(库里还没有块)")) : k("", !0),
2450
- (d(!0), p(M, null, N(v.value, (e) => (d(), p("option", {
2490
+ v.value.length === 0 ? (p(), f("option", Ca, "(库里还没有块)")) : k("", !0),
2491
+ (p(!0), f(M, null, N(v.value, (e) => (p(), f("option", {
2451
2492
  key: e.id,
2452
2493
  value: e.id
2453
- }, b(e.module) + " / " + b(e.name || e.id), 9, ya))), 128))
2454
- ], 40, _a)) : k("", !0)
2494
+ }, b(e.module) + " / " + b(e.name || e.id), 9, Ea))), 128))
2495
+ ], 40, xa)) : k("", !0)
2455
2496
  ]),
2456
- l("div", ka, [
2457
- t[87] || (t[87] = l("label", { for: "mbc-dir" }, "导出目录", -1)),
2458
- l("input", {
2497
+ a("div", Sa, [
2498
+ t[87] || (t[87] = a("label", { for: "mbc-dir" }, "导出目录", -1)),
2499
+ a("input", {
2459
2500
  id: "mbc-dir",
2460
2501
  class: "p-inputtext p-component mbc__grow mbc__mono",
2461
2502
  type: "text",
2462
2503
  readonly: "",
2463
2504
  value: q.value ? q.value.name : "(还没选:点右边那个按钮选一个文件夹)"
2464
- }, null, 8, $a),
2465
- l("button", {
2505
+ }, null, 8, Ta),
2506
+ a("button", {
2466
2507
  class: "p-button p-button-sm p-button-outlined",
2467
2508
  type: "button",
2468
- disabled: S.value,
2509
+ disabled: E.value,
2469
2510
  onClick: t[23] || (t[23] = (e) => He("export"))
2470
- }, "选择文件夹", 8, wa),
2471
- l("button", {
2511
+ }, "选择文件夹", 8, Ba),
2512
+ a("button", {
2472
2513
  class: "p-button p-button-sm mbc__act-export",
2473
2514
  type: "button",
2474
- disabled: S.value || Q.value === "one" && !ft.value,
2475
- title: Q.value === "one" && !ft.value ? "先在左边挑一个块(或者把范围改成「全部块」)" : "把库里的块铺到你选的文件夹",
2476
- onClick: t[24] || (t[24] = (e) => Yn())
2477
- }, b(ut.value ? "导出中…" : "导出"), 9, xa)
2515
+ disabled: E.value || Q.value === "one" && !bt.value,
2516
+ title: Q.value === "one" && !bt.value ? "先在左边挑一个块(或者把范围改成「全部块」)" : "把库里的块铺到你选的文件夹",
2517
+ onClick: t[24] || (t[24] = (e) => ts())
2518
+ }, b(ut.value ? "导出中…" : "导出"), 9, Ma)
2478
2519
  ]),
2479
- l("p", Ca, [
2480
- $(b(Q.value === "all" ? `这一趟铺全部 ${v.value.length} 个块` : ft.value ? `这一趟只铺「${ft.value.module} / ${ft.value.name || ft.value.id}」` : "先挑一个块") + " ⇒ ", 1),
2481
- t[88] || (t[88] = l("span", { class: "mbc__mono" }, "workspace/<可读名>-<块 uuid>/", -1)),
2520
+ a("p", Aa, [
2521
+ $(b(Q.value === "all" ? `这一趟铺全部 ${v.value.length} 个块` : bt.value ? `这一趟只铺「${bt.value.module} / ${bt.value.name || bt.value.id}」` : "先挑一个块") + " ⇒ ", 1),
2522
+ t[88] || (t[88] = a("span", { class: "mbc__mono" }, "workspace/<可读名>-<块 uuid>/", -1)),
2482
2523
  t[89] || (t[89] = $(",顶层另附开发说明与 ", -1)),
2483
- t[90] || (t[90] = l("span", { class: "mbc__mono" }, "example/", -1)),
2524
+ t[90] || (t[90] = a("span", { class: "mbc__mono" }, "example/", -1)),
2484
2525
  t[91] || (t[91] = $("。 ", -1))
2485
2526
  ]),
2486
- V.value ? (d(), p("p", Sa, b(V.value), 1)) : k("", !0)
2527
+ V.value ? (p(), f("p", Ra, b(V.value), 1)) : k("", !0)
2487
2528
  ], 512), [
2488
2529
  [Qt, R.value === "workspace"]
2489
2530
  ]),
2490
- vt(l("section", Ea, [
2491
- t[102] || (t[102] = l("h3", { class: "mbc__title" }, "读回改动", -1)),
2492
- l("div", Ta, [
2493
- t[94] || (t[94] = l("label", { for: "mbc-read-dir" }, "读回目录", -1)),
2494
- l("input", {
2531
+ vt(a("section", Oa, [
2532
+ t[102] || (t[102] = a("h3", { class: "mbc__title" }, "读回改动", -1)),
2533
+ a("div", Pa, [
2534
+ t[94] || (t[94] = a("label", { for: "mbc-read-dir" }, "读回目录", -1)),
2535
+ a("input", {
2495
2536
  id: "mbc-read-dir",
2496
2537
  class: "p-inputtext p-component mbc__grow mbc__mono",
2497
2538
  type: "text",
2498
2539
  readonly: "",
2499
- value: U.value ? U.value.name : "(还没选:导出会自动填上,也可以自己选一个)"
2500
- }, null, 8, Ba),
2501
- l("button", {
2540
+ value: z.value ? z.value.name : "(还没选:导出会自动填上,也可以自己选一个)"
2541
+ }, null, 8, ja),
2542
+ a("button", {
2502
2543
  class: "p-button p-button-sm p-button-outlined",
2503
2544
  type: "button",
2504
- disabled: S.value,
2545
+ disabled: E.value,
2505
2546
  onClick: t[25] || (t[25] = (e) => He("read"))
2506
- }, "选择文件夹", 8, Ma),
2507
- l("button", {
2547
+ }, "选择文件夹", 8, La),
2548
+ a("button", {
2508
2549
  class: "p-button p-button-sm p-button-outlined",
2509
2550
  type: "button",
2510
- disabled: S.value,
2551
+ disabled: E.value,
2511
2552
  onClick: t[26] || (t[26] = (e) => Ve())
2512
- }, b($t.value ? "读回中…" : "读回改动"), 9, Aa)
2553
+ }, b($t.value ? "读回中…" : "读回改动"), 9, Ia)
2513
2554
  ]),
2514
- U.value && q.value && U.value.name !== q.value.name ? (d(), p("p", Ra, " 读回的是「" + b(U.value.name) + "」(与导出目录「" + b(q.value.name) + "」不是同一个 —— 想同步就再选一次)。 ", 1)) : (d(), p("p", Oa, "读回目录默认跟着导出目录;要读别的文件夹就点「选择文件夹」单独选一个。")),
2515
- O.value ? (d(), p(M, { key: 2 }, [
2516
- Gt.value.length > 0 ? (d(), p("p", Pa, [
2555
+ z.value && q.value && z.value.name !== q.value.name ? (p(), f("p", Da, " 读回的是「" + b(z.value.name) + "」(与导出目录「" + b(q.value.name) + "」不是同一个 —— 想同步就再选一次)。 ", 1)) : (p(), f("p", Na, "读回目录默认跟着导出目录;要读别的文件夹就点「选择文件夹」单独选一个。")),
2556
+ O.value ? (p(), f(M, { key: 2 }, [
2557
+ Gt.value.length > 0 ? (p(), f("p", Fa, [
2517
2558
  t[95] || (t[95] = $(" 扫到 ", -1)),
2518
- l("b", null, b(O.value.blocks.length), 1),
2559
+ a("b", null, b(O.value.blocks.length), 1),
2519
2560
  t[96] || (t[96] = $(" 个块,其中 ", -1)),
2520
- l("b", ja, b(Gt.value.length), 1),
2561
+ a("b", Ua, b(Gt.value.length), 1),
2521
2562
  t[97] || (t[97] = $(" 个可以存;已经勾了 ", -1)),
2522
- l("b", null, b(Wt.value.length), 1),
2563
+ a("b", null, b(Wt.value.length), 1),
2523
2564
  t[98] || (t[98] = $(" 个。 ", -1)),
2524
- l("button", {
2565
+ a("button", {
2525
2566
  class: "p-button p-button-sm p-button-text",
2526
2567
  type: "button",
2527
- disabled: S.value,
2568
+ disabled: E.value,
2528
2569
  onClick: t[27] || (t[27] = (e) => Je(!0))
2529
- }, "全选可存的", 8, La),
2530
- l("button", {
2570
+ }, "全选可存的", 8, za),
2571
+ a("button", {
2531
2572
  class: "p-button p-button-sm p-button-text",
2532
2573
  type: "button",
2533
- disabled: S.value || Wt.value.length === 0,
2574
+ disabled: E.value || Wt.value.length === 0,
2534
2575
  onClick: t[28] || (t[28] = (e) => Je(!1))
2535
- }, "全不选", 8, Da)
2576
+ }, "全不选", 8, Ha)
2536
2577
  ])) : k("", !0),
2537
- O.value.blocks.length > 0 ? (d(), p("ul", Ia, [
2538
- (d(!0), p(M, null, N(O.value.blocks, (e) => (d(), p("li", {
2578
+ O.value.blocks.length > 0 ? (p(), f("ul", Ka, [
2579
+ (p(!0), f(M, null, N(O.value.blocks, (e) => (p(), f("li", {
2539
2580
  key: e.id,
2540
2581
  class: K(["mbc__block", { "is-picked": ct.value[e.id] === !0, "is-blocked": !e.canApply }])
2541
2582
  }, [
2542
- l("label", Na, [
2543
- l("span", {
2583
+ a("label", qa, [
2584
+ a("span", {
2544
2585
  class: K(["p-checkbox p-component", { "p-disabled": !e.canApply }])
2545
2586
  }, [
2546
- l("input", {
2587
+ a("input", {
2547
2588
  class: "p-checkbox-input",
2548
2589
  type: "checkbox",
2549
2590
  disabled: !e.canApply,
2550
2591
  checked: ct.value[e.id] === !0,
2551
- onChange: (r) => ns(e.id, r)
2552
- }, null, 40, Fa),
2553
- t[99] || (t[99] = l("span", { class: "p-checkbox-box" }, null, -1))
2592
+ onChange: (r) => as(e.id, r)
2593
+ }, null, 40, Va),
2594
+ t[99] || (t[99] = a("span", { class: "p-checkbox-box" }, null, -1))
2554
2595
  ], 2),
2555
- l("span", za, b(e.name || e.id), 1),
2556
- l("span", {
2596
+ a("span", Ja, b(e.name || e.id), 1),
2597
+ a("span", {
2557
2598
  class: K(["p-tag", e.status === "modified" ? "p-tag-success" : e.status === "missing" ? "p-tag-warning" : e.status === "not-in-db" ? "p-tag-info" : ""])
2558
2599
  }, b(s[e.status]), 3),
2559
- l("span", Ua, b(e.module || "—"), 1)
2600
+ a("span", Ga, b(e.module || "—"), 1)
2560
2601
  ]),
2561
- l("p", Ha, [
2562
- e.status === "missing" ? (d(), p(M, { key: 0 }, [
2602
+ a("p", Wa, [
2603
+ e.status === "missing" ? (p(), f(M, { key: 0 }, [
2563
2604
  $("目录里没有这一块,勾不上")
2564
- ], 64)) : e.status === "not-in-db" ? (d(), p(M, { key: 1 }, [
2605
+ ], 64)) : e.status === "not-in-db" ? (p(), f(M, { key: 1 }, [
2565
2606
  $("库里还没有这一块 —— 勾上它保存,就是按这一包新建")
2566
- ], 64)) : e.changedFiles.length > 0 ? (d(), p(M, { key: 2 }, [
2607
+ ], 64)) : e.changedFiles.length > 0 ? (p(), f(M, { key: 2 }, [
2567
2608
  t[100] || (t[100] = $("改了:", -1)),
2568
- l("span", Ka, b(e.changedFiles.join(" / ")), 1)
2569
- ], 64)) : (d(), p(M, { key: 3 }, [
2609
+ a("span", Ya, b(e.changedFiles.join(" / ")), 1)
2610
+ ], 64)) : (p(), f(M, { key: 3 }, [
2570
2611
  $("内容与库里一致")
2571
2612
  ], 64))
2572
2613
  ]),
2573
- e.blockedWhy ? (d(), p("p", qa, "不能存:" + b(e.blockedWhy), 1)) : k("", !0),
2574
- l("p", Va, b(e.folder || e.where), 1)
2614
+ e.blockedWhy ? (p(), f("p", Za, "不能存:" + b(e.blockedWhy), 1)) : k("", !0),
2615
+ a("p", Xa, b(e.folder || e.where), 1)
2575
2616
  ], 2))), 128))
2576
- ])) : (d(), p("p", Ja, "这个目录里没有认出任何块(点上面那个按钮再扫一次,或者确认文件夹名里有那个块的 uuid)。")),
2577
- l("div", Ga, [
2578
- dt.value > 0 ? (d(), p("button", {
2617
+ ])) : (p(), f("p", Qa, "这个目录里没有认出任何块(点上面那个按钮再扫一次,或者确认文件夹名里有那个块的 uuid)。")),
2618
+ a("div", ti, [
2619
+ dt.value > 0 ? (p(), f("button", {
2579
2620
  key: 0,
2580
2621
  class: "p-button p-button-sm mbc__report-btn",
2581
2622
  type: "button",
2582
2623
  title: "点开看这一趟的全部问题(" + dt.value + " 条)",
2583
2624
  onClick: t[29] || (t[29] = (e) => Rt.value = !0)
2584
- }, "查看问题(" + b(dt.value) + ")⚠", 9, Wa)) : (d(), p("span", Ya, "这一趟没有问题")),
2585
- O.value.unmatched.length > 0 ? (d(), p("span", {
2625
+ }, "查看问题(" + b(dt.value) + ")⚠", 9, ei)) : (p(), f("span", ni, "这一趟没有问题")),
2626
+ O.value.unmatched.length > 0 ? (p(), f("span", {
2586
2627
  key: 2,
2587
2628
  class: "mbc__chip is-bad",
2588
2629
  title: O.value.unmatched.join(" / ")
2589
- }, "认不出归属的文件夹 " + b(O.value.unmatched.length), 9, Za)) : k("", !0)
2630
+ }, "认不出归属的文件夹 " + b(O.value.unmatched.length), 9, si)) : k("", !0)
2590
2631
  ]),
2591
- (O.value.skipped ?? []).length > 0 ? (d(), p("p", Xa, [
2632
+ (O.value.skipped ?? []).length > 0 ? (p(), f("p", oi, [
2592
2633
  $(" 忽略了 " + b((O.value.skipped ?? []).length) + " 个文件夹(名字里没有 uuid,当测试文件处理 —— 与忽略 ", 1),
2593
- t[101] || (t[101] = l("span", { class: "mbc__mono" }, "example/", -1)),
2634
+ t[101] || (t[101] = a("span", { class: "mbc__mono" }, "example/", -1)),
2594
2635
  $(" 同一个规矩):" + b((O.value.skipped ?? []).join(" / ")), 1)
2595
2636
  ])) : k("", !0),
2596
- l("div", Qa, [
2597
- l("button", {
2637
+ a("div", li, [
2638
+ a("button", {
2598
2639
  class: "p-button p-button-sm mbc__act-import",
2599
2640
  type: "button",
2600
- disabled: S.value,
2601
- onClick: t[30] || (t[30] = (e) => es())
2602
- }, b(st.value ? "保存中…" : `保存选中的块(${Wt.value.length})`), 9, ti)
2641
+ disabled: E.value,
2642
+ onClick: t[30] || (t[30] = (e) => ls())
2643
+ }, b(st.value ? "保存中…" : `保存选中的块(${Wt.value.length})`), 9, ai)
2603
2644
  ])
2604
2645
  ], 64)) : k("", !0)
2605
2646
  ], 512), [
2606
2647
  [Qt, R.value === "workspace"]
2607
2648
  ]),
2608
- vt(l("section", ei, [
2609
- l("h3", ni, [
2649
+ vt(a("section", ii, [
2650
+ a("h3", ui, [
2610
2651
  t[103] || (t[103] = $(" 不在数据库 ", -1)),
2611
- l("span", si, b(it(a)), 1),
2612
- l("span", oi, b(pe.value.length), 1)
2652
+ a("span", ci, b(it(l)), 1),
2653
+ a("span", ri, b(pe.value.length), 1)
2613
2654
  ]),
2614
- pe.value.length === 0 ? (d(), p("p", li, "路由表里声明的块,库里都有那一行。")) : (d(), p(M, { key: 1 }, [
2615
- l("p", ai, [
2655
+ pe.value.length === 0 ? (p(), f("p", di, "路由表里声明的块,库里都有那一行。")) : (p(), f(M, { key: 1 }, [
2656
+ a("p", pi, [
2616
2657
  t[104] || (t[104] = $(" 这些页面的路由(", -1)),
2617
- t[105] || (t[105] = l("span", { class: "mbc__mono" }, "component: MagicBlockPage", -1)),
2658
+ t[105] || (t[105] = a("span", { class: "mbc__mono" }, "component: MagicBlockPage", -1)),
2618
2659
  t[106] || (t[106] = $(")声明了块的 uuid, ", -1)),
2619
- t[107] || (t[107] = l("span", { class: "mbc__mono" }, "/magic-blocks/index", -1)),
2660
+ t[107] || (t[107] = a("span", { class: "mbc__mono" }, "/magic-blocks/index", -1)),
2620
2661
  t[108] || (t[108] = $(" 里却没有这一行 —— 页面上那一块现在是占位框。 ", -1)),
2621
- t[109] || (t[109] = l("b", null, "要建进库", -1)),
2622
- $(":在上面「读回改动」里选中放这一块的文件夹(文件夹名里有 uuid), 扫出来就是一条标签写着「" + b(it(a)) + "」、能勾能存的条目。 ", 1)
2662
+ t[109] || (t[109] = a("b", null, "要建进库", -1)),
2663
+ $(":在上面「读回改动」里选中放这一块的文件夹(文件夹名里有 uuid), 扫出来就是一条标签写着「" + b(it(l)) + "」、能勾能存的条目。 ", 1)
2623
2664
  ]),
2624
- l("ul", ii, [
2625
- (d(!0), p(M, null, N(pe.value, (e) => (d(), p("li", {
2665
+ a("ul", fi, [
2666
+ (p(!0), f(M, null, N(pe.value, (e) => (p(), f("li", {
2626
2667
  key: e.uuid,
2627
2668
  class: "mbc__block is-blocked"
2628
2669
  }, [
2629
- l("label", ui, [
2630
- t[110] || (t[110] = l("span", { class: "p-checkbox p-component p-disabled" }, [
2631
- l("input", {
2670
+ a("label", bi, [
2671
+ t[110] || (t[110] = a("span", { class: "p-checkbox p-component p-disabled" }, [
2672
+ a("input", {
2632
2673
  class: "p-checkbox-input",
2633
2674
  type: "checkbox",
2634
2675
  disabled: ""
2635
2676
  }),
2636
- l("span", { class: "p-checkbox-box" })
2677
+ a("span", { class: "p-checkbox-box" })
2637
2678
  ], -1)),
2638
- l("span", ci, b(e.title || e.uuid), 1),
2639
- l("span", ri, b(it(a)), 1),
2640
- l("span", di, b(e.module || "—"), 1)
2679
+ a("span", mi, b(e.title || e.uuid), 1),
2680
+ a("span", vi, b(it(l)), 1),
2681
+ a("span", hi, b(e.module || "—"), 1)
2641
2682
  ]),
2642
- l("p", pi, [
2683
+ a("p", gi, [
2643
2684
  t[111] || (t[111] = $(" 路由 ", -1)),
2644
- l("span", bi, b(e.path), 1),
2685
+ a("span", _i, b(e.path), 1),
2645
2686
  t[112] || (t[112] = $(" 声明了它,库里没有这个块 —— 手里还没有放这个块的文件夹,所以这里勾不上(勾上了也没有正文可存)。 ", -1))
2646
2687
  ]),
2647
- l("p", fi, b(e.uuid), 1)
2688
+ a("p", yi, b(e.uuid), 1)
2648
2689
  ]))), 128))
2649
2690
  ])
2650
2691
  ], 64))
2651
2692
  ], 512), [
2652
2693
  [Qt, R.value === "workspace"]
2653
2694
  ]),
2654
- R.value === "workspace" && (W.value.length > 0 || Y.value.length > 0) ? (d(), p("section", mi, [
2655
- t[113] || (t[113] = l("h3", { class: "mbc__title" }, "保存结果", -1)),
2656
- l("p", vi, [
2657
- l("span", hi, "存成 " + b(re.value), 1),
2658
- Ft.value.length > 0 ? (d(), p("span", _i, "没存成 " + b(Ft.value.length), 1)) : k("", !0),
2659
- W.value.length > 0 ? (d(), p("span", gi, "前端拦下 " + b(W.value.length), 1)) : k("", !0),
2660
- Ft.value.length === 0 && W.value.length === 0 ? (d(), p("span", yi, "明细在下面那个「查看问题」里(没问题时是空的)。")) : k("", !0)
2695
+ R.value === "workspace" && (W.value.length > 0 || Y.value.length > 0) ? (p(), f("section", ki, [
2696
+ t[113] || (t[113] = a("h3", { class: "mbc__title" }, "保存结果", -1)),
2697
+ a("p", $i, [
2698
+ a("span", wi, "存成 " + b(re.value), 1),
2699
+ Ft.value.length > 0 ? (p(), f("span", xi, "没存成 " + b(Ft.value.length), 1)) : k("", !0),
2700
+ W.value.length > 0 ? (p(), f("span", Ci, "前端拦下 " + b(W.value.length), 1)) : k("", !0),
2701
+ Ft.value.length === 0 && W.value.length === 0 ? (p(), f("span", Ei, "明细在下面那个「查看问题」里(没问题时是空的)。")) : k("", !0)
2661
2702
  ]),
2662
- l("div", ki, [
2663
- l("button", {
2703
+ a("div", Si, [
2704
+ a("button", {
2664
2705
  class: "p-button p-button-sm mbc__report-btn",
2665
2706
  type: "button",
2666
2707
  onClick: t[31] || (t[31] = (e) => Rt.value = !0)
2667
2708
  }, "查看问题(" + b(dt.value) + ")⚠", 1)
2668
2709
  ])
2669
2710
  ])) : k("", !0),
2670
- t[114] || (t[114] = l("div", {
2711
+ t[114] || (t[114] = a("div", {
2671
2712
  class: "mbc__tailspace",
2672
2713
  "aria-hidden": "true"
2673
2714
  }, null, -1))
2674
2715
  ]),
2675
- l("footer", $i, [
2676
- E.value.length > 0 ? (d(), p("button", {
2716
+ a("footer", Ti, [
2717
+ S.value.length > 0 ? (p(), f("button", {
2677
2718
  key: 0,
2678
2719
  class: "p-button p-button-sm mbc__report-btn",
2679
2720
  type: "button",
2680
- title: "点开看全部报错(" + E.value.length + " 条)",
2721
+ title: "点开看全部报错(" + S.value.length + " 条)",
2681
2722
  onClick: t[32] || (t[32] = (e) => A.value = !0)
2682
- }, "查看报错(" + b(E.value.length) + " 条)⚠", 9, wi)) : k("", !0),
2683
- _.value ? (d(), p("p", xi, b(_.value), 1)) : y.value ? (d(), p("p", Ci, b(y.value), 1)) : (d(), p("p", Si, "—"))
2723
+ }, "查看报错(" + b(S.value.length) + " 条)⚠", 9, Bi)) : k("", !0),
2724
+ g.value ? (p(), f("p", Mi, b(g.value), 1)) : y.value ? (p(), f("p", Ai, b(y.value), 1)) : (p(), f("p", Ri, "—"))
2684
2725
  ])
2685
2726
  ], 2)) : k("", !0),
2686
- c.value && Rt.value ? (d(), p("div", {
2727
+ c.value && Rt.value ? (p(), f("div", {
2687
2728
  key: 1,
2688
2729
  class: "mbc__modal",
2689
2730
  role: "dialog",
2690
2731
  "aria-modal": "true",
2691
- onClick: t[36] || (t[36] = Ee((e) => Rt.value = !1, ["self"]))
2732
+ onClick: t[36] || (t[36] = Se((e) => Rt.value = !1, ["self"]))
2692
2733
  }, [
2693
- l("div", Ei, [
2694
- l("header", Ti, [
2695
- l("strong", null, "读回 / 保存的问题(" + b(dt.value) + " 条)", 1),
2696
- l("button", {
2734
+ a("div", Oi, [
2735
+ a("header", Pi, [
2736
+ a("strong", null, "读回 / 保存的问题(" + b(dt.value) + " 条)", 1),
2737
+ a("button", {
2697
2738
  class: "p-button p-button-sm p-button-text",
2698
2739
  type: "button",
2699
2740
  onClick: t[33] || (t[33] = (e) => Rt.value = !1)
2700
2741
  }, "收起")
2701
2742
  ]),
2702
- l("div", Bi, [
2703
- W.value.length > 0 ? (d(), p("section", Mi, [
2704
- l("h4", Ai, "前端校验拦下的(" + b(W.value.length) + ")", 1),
2705
- l("ul", Ri, [
2706
- (d(!0), p(M, null, N(W.value, (e, r) => (d(), p("li", { key: r }, b(e), 1))), 128))
2743
+ a("div", ji, [
2744
+ W.value.length > 0 ? (p(), f("section", Li, [
2745
+ a("h4", Ii, "前端校验拦下的(" + b(W.value.length) + ")", 1),
2746
+ a("ul", Di, [
2747
+ (p(!0), f(M, null, N(W.value, (e, r) => (p(), f("li", { key: r }, b(e), 1))), 128))
2707
2748
  ])
2708
2749
  ])) : k("", !0),
2709
- (O.value?.failures ?? []).length > 0 ? (d(), p("section", Oi, [
2710
- l("h4", Pi, "读回时逐条回的(" + b((O.value?.failures ?? []).length) + ")", 1),
2711
- l("ul", ji, [
2712
- (d(!0), p(M, null, N(O.value?.failures ?? [], (e, r) => (d(), p("li", { key: r }, [
2713
- l("span", Li, b(e.kind || "问题"), 1),
2714
- l("span", Di, b(e.where), 1),
2750
+ (O.value?.failures ?? []).length > 0 ? (p(), f("section", Ni, [
2751
+ a("h4", Fi, "读回时逐条回的(" + b((O.value?.failures ?? []).length) + ")", 1),
2752
+ a("ul", Ui, [
2753
+ (p(!0), f(M, null, N(O.value?.failures ?? [], (e, r) => (p(), f("li", { key: r }, [
2754
+ a("span", zi, b(e.kind || "问题"), 1),
2755
+ a("span", Hi, b(e.where), 1),
2715
2756
  $(" " + b(e.message), 1)
2716
2757
  ]))), 128))
2717
2758
  ])
2718
2759
  ])) : k("", !0),
2719
- (O.value?.unmatched ?? []).length > 0 ? (d(), p("section", Ii, [
2720
- l("h4", Ni, "认不出归属的文件夹(" + b((O.value?.unmatched ?? []).length) + ")", 1),
2721
- l("ul", Fi, [
2722
- (d(!0), p(M, null, N(O.value?.unmatched ?? [], (e, r) => (d(), p("li", { key: r }, [
2723
- l("span", zi, b(e), 1)
2760
+ (O.value?.unmatched ?? []).length > 0 ? (p(), f("section", Ki, [
2761
+ a("h4", qi, "认不出归属的文件夹(" + b((O.value?.unmatched ?? []).length) + ")", 1),
2762
+ a("ul", Vi, [
2763
+ (p(!0), f(M, null, N(O.value?.unmatched ?? [], (e, r) => (p(), f("li", { key: r }, [
2764
+ a("span", Ji, b(e), 1)
2724
2765
  ]))), 128))
2725
2766
  ])
2726
2767
  ])) : k("", !0),
2727
- Y.value.length > 0 ? (d(), p("section", Ui, [
2728
- l("h4", Hi, "保存结果(" + b(Y.value.length) + ":存成 " + b(re.value) + ",没存成 " + b(Ft.value.length) + ")", 1),
2729
- l("ul", Ki, [
2730
- (d(!0), p(M, null, N(Y.value, (e) => (d(), p("li", {
2768
+ Y.value.length > 0 ? (p(), f("section", Gi, [
2769
+ a("h4", Wi, "保存结果(" + b(Y.value.length) + ":存成 " + b(re.value) + ",没存成 " + b(Ft.value.length) + ")", 1),
2770
+ a("ul", Yi, [
2771
+ (p(!0), f(M, null, N(Y.value, (e) => (p(), f("li", {
2731
2772
  key: e.id,
2732
2773
  class: K({ "is-ok": e.ok })
2733
2774
  }, [
2734
- l("strong", null, b(e.name || e.id) + ":" + b(e.ok ? "已保存" : "没保存"), 1),
2735
- !e.ok && e.error ? (d(), p("span", qi, b(e.error), 1)) : k("", !0),
2736
- !e.ok && (e.issues ?? []).length > 0 ? (d(), p("ul", Vi, [
2737
- (d(!0), p(M, null, N(e.issues, (r, B) => (d(), p("li", { key: B }, b(r), 1))), 128))
2775
+ a("strong", null, b(e.name || e.id) + ":" + b(e.ok ? "已保存" : "没保存"), 1),
2776
+ !e.ok && e.error ? (p(), f("span", Zi, b(e.error), 1)) : k("", !0),
2777
+ !e.ok && (e.issues ?? []).length > 0 ? (p(), f("ul", Xi, [
2778
+ (p(!0), f(M, null, N(e.issues, (r, B) => (p(), f("li", { key: B }, b(r), 1))), 128))
2738
2779
  ])) : k("", !0)
2739
2780
  ], 2))), 128))
2740
2781
  ])
2741
2782
  ])) : k("", !0),
2742
- dt.value === 0 ? (d(), p("p", Ji, "这一趟没有问题。")) : k("", !0)
2783
+ dt.value === 0 ? (p(), f("p", Qi, "这一趟没有问题。")) : k("", !0)
2743
2784
  ]),
2744
- l("footer", Gi, [
2745
- l("button", {
2785
+ a("footer", tu, [
2786
+ a("button", {
2746
2787
  class: "p-button p-button-sm p-button-outlined",
2747
2788
  type: "button",
2748
- onClick: t[34] || (t[34] = (e) => Gn())
2789
+ onClick: t[34] || (t[34] = (e) => Xn())
2749
2790
  }, "复制全部"),
2750
- l("button", {
2791
+ a("button", {
2751
2792
  class: "p-button p-button-sm",
2752
2793
  type: "button",
2753
2794
  onClick: t[35] || (t[35] = (e) => Rt.value = !1)
@@ -2755,46 +2796,46 @@ ${t.text}`).join(`
2755
2796
  ])
2756
2797
  ])
2757
2798
  ])) : k("", !0),
2758
- c.value && A.value ? (d(), p("div", {
2799
+ c.value && A.value ? (p(), f("div", {
2759
2800
  key: 2,
2760
2801
  class: "mbc__modal",
2761
2802
  role: "dialog",
2762
2803
  "aria-modal": "true",
2763
- onClick: t[41] || (t[41] = Ee((e) => A.value = !1, ["self"]))
2804
+ onClick: t[41] || (t[41] = Se((e) => A.value = !1, ["self"]))
2764
2805
  }, [
2765
- l("div", Wi, [
2766
- l("header", Yi, [
2767
- l("strong", null, "报错(" + b(E.value.length) + " 条)", 1),
2768
- l("button", {
2806
+ a("div", eu, [
2807
+ a("header", nu, [
2808
+ a("strong", null, "报错(" + b(S.value.length) + " 条)", 1),
2809
+ a("button", {
2769
2810
  class: "p-button p-button-sm p-button-text",
2770
2811
  type: "button",
2771
2812
  onClick: t[37] || (t[37] = (e) => A.value = !1)
2772
2813
  }, "收起")
2773
2814
  ]),
2774
- l("div", Zi, [
2775
- l("ol", Xi, [
2776
- (d(!0), p(M, null, N(E.value, (e, r) => (d(), p("li", { key: r }, [
2777
- l("div", Qi, [
2778
- l("span", tu, b(e.at), 1),
2815
+ a("div", su, [
2816
+ a("ol", ou, [
2817
+ (p(!0), f(M, null, N(S.value, (e, r) => (p(), f("li", { key: r }, [
2818
+ a("div", lu, [
2819
+ a("span", au, b(e.at), 1),
2779
2820
  $(" · " + b(e.where), 1)
2780
2821
  ]),
2781
- l("pre", eu, b(e.text), 1)
2822
+ a("pre", iu, b(e.text), 1)
2782
2823
  ]))), 128))
2783
2824
  ]),
2784
- E.value.length === 0 ? (d(), p("p", nu, "这一轮没有报错。")) : k("", !0)
2825
+ S.value.length === 0 ? (p(), f("p", uu, "这一轮没有报错。")) : k("", !0)
2785
2826
  ]),
2786
- l("footer", su, [
2787
- l("button", {
2827
+ a("footer", cu, [
2828
+ a("button", {
2788
2829
  class: "p-button p-button-sm p-button-outlined",
2789
2830
  type: "button",
2790
- onClick: t[38] || (t[38] = (e) => Vn())
2831
+ onClick: t[38] || (t[38] = (e) => Yn())
2791
2832
  }, "复制全部"),
2792
- l("button", {
2833
+ a("button", {
2793
2834
  class: "p-button p-button-sm p-button-text",
2794
2835
  type: "button",
2795
- onClick: t[39] || (t[39] = (e) => be())
2836
+ onClick: t[39] || (t[39] = (e) => fe())
2796
2837
  }, "清空报错"),
2797
- l("button", {
2838
+ a("button", {
2798
2839
  class: "p-button p-button-sm",
2799
2840
  type: "button",
2800
2841
  onClick: t[40] || (t[40] = (e) => A.value = !1)
@@ -2802,7 +2843,7 @@ ${t.text}`).join(`
2802
2843
  ])
2803
2844
  ])
2804
2845
  ])) : k("", !0),
2805
- c.value ? (d(), p("button", {
2846
+ c.value ? (p(), f("button", {
2806
2847
  key: 3,
2807
2848
  class: "mbc__close",
2808
2849
  type: "button",
@@ -2811,29 +2852,33 @@ ${t.text}`).join(`
2811
2852
  }, "×")) : k("", !0)
2812
2853
  ], 2)) : k("", !0);
2813
2854
  }
2814
- }), du = /* @__PURE__ */ vn(au, [["__scopeId", "data-v-98b797e3"]]);
2855
+ }), hu = /* @__PURE__ */ hn(pu, [["__scopeId", "data-v-98b797e3"]]);
2856
+ Object.assign(Mn, { [Bn]: !0 });
2815
2857
  export {
2816
- bs as API_BASE,
2817
- Ds as BLOCK_BACKEND_FILE,
2858
+ gs as API_BASE,
2859
+ zs as BLOCK_BACKEND_FILE,
2818
2860
  Ht as BLOCK_ENTRY,
2819
2861
  ye as BLOCK_MANIFEST,
2820
- hs as CLIENT_SOURCE,
2862
+ Bn as BLOCK_PAGE_MARK,
2863
+ $s as CLIENT_SOURCE,
2821
2864
  ke as MANIFEST_KEYS,
2822
2865
  en as MANIFEST_REQUIRED,
2823
- du as MagicBlockConsole,
2824
- mo as MagicBlockPage,
2866
+ hu as MagicBlockConsole,
2867
+ Mn as MagicBlockPage,
2825
2868
  je as NAME_MAX,
2826
- Ks as buildPreview,
2827
- Ls as checkSelection,
2828
- yo as declaredMissing,
2829
- _o as declaredUuidOf,
2830
- go as declaredUuidsOf,
2831
- ys as installBridge,
2832
- Js as loadBlockRender,
2833
- qs as onBlockRenderRefresh,
2834
- Os as parseManifest,
2835
- Vs as refreshBlockRender,
2836
- Ps as validFileName,
2837
- Es as validName,
2838
- js as validateBlock
2869
+ xo as blockPlacementProblems,
2870
+ Ws as buildPreview,
2871
+ Us as checkSelection,
2872
+ ko as declaredMissing,
2873
+ Tn as declaredUuidOf,
2874
+ yo as declaredUuidsOf,
2875
+ Cs as installBridge,
2876
+ $o as isBlockPage,
2877
+ Xs as loadBlockRender,
2878
+ Ys as onBlockRenderRefresh,
2879
+ Ds as parseManifest,
2880
+ Zs as refreshBlockRender,
2881
+ Ns as validFileName,
2882
+ Rs as validName,
2883
+ Fs as validateBlock
2839
2884
  };