labull-framework 0.1.21 → 0.1.22

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