@billtaofbj/fishbone 1.0.0 → 1.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.es.js CHANGED
@@ -1,32 +1,32 @@
1
- import { Fragment as e, computed as t, createBlock as n, createCommentVNode as r, createElementBlock as i, createElementVNode as a, createTextVNode as o, createVNode as s, defineComponent as c, h as l, nextTick as u, normalizeClass as d, normalizeStyle as f, onBeforeUnmount as p, onMounted as m, onUnmounted as h, openBlock as g, reactive as _, ref as v, renderList as y, resolveComponent as b, toDisplayString as x, unref as S, vModelSelect as C, vModelText as w, vShow as T, watch as E, withCtx as D, withDirectives as O, withKeys as k, withModifiers as A } from "vue";
2
- import { BrandWatermark as j } from "@billtaofbj/core";
3
- import { useRoute as M, useRouter as N } from "vue-router";
4
- import { ElMessage as P, ElMessageBox as ee } from "element-plus";
5
- import { ArrowLeft as te, Bell as F, Brush as I, Check as L, Clock as ne, Close as re, Delete as ie, Document as ae, Download as oe, Edit as se, FullScreen as ce, InfoFilled as le, Link as ue, Loading as de, MagicStick as fe, Monitor as pe, Picture as me, PictureFilled as he, Plus as ge, Promotion as _e, RefreshLeft as ve, RefreshRight as ye, Right as be, Share as xe, ZoomIn as Se, ZoomOut as R } from "@element-plus/icons-vue";
6
- import z from "axios";
7
- import * as B from "yjs";
8
- import { HocuspocusProvider as Ce } from "@hocuspocus/provider";
1
+ import { Fragment as e, computed as t, createBlock as n, createCommentVNode as r, createElementBlock as i, createElementVNode as a, createTextVNode as o, createVNode as s, defineComponent as c, h as l, nextTick as u, normalizeClass as d, normalizeStyle as f, onBeforeUnmount as p, onMounted as m, onUnmounted as h, openBlock as g, reactive as _, ref as v, renderList as y, resolveComponent as b, toDisplayString as x, unref as S, vModelSelect as ee, vModelText as C, vShow as w, watch as T, withCtx as E, withDirectives as D, withKeys as O, withModifiers as k } from "vue";
2
+ import { BrandWatermark as A } from "@billtaofbj/core";
3
+ import { useRoute as te, useRouter as j } from "vue-router";
4
+ import { ElMessage as M, ElMessageBox as ne } from "element-plus";
5
+ import N from "axios";
6
+ import { ArrowLeft as re, Bell as ie, Brush as ae, Check as P, Clock as oe, Close as F, Delete as se, Document as I, Download as L, Edit as ce, FullScreen as le, InfoFilled as ue, Link as de, Loading as fe, MagicStick as pe, Monitor as me, Picture as he, PictureFilled as ge, Plus as _e, Promotion as ve, RefreshLeft as ye, RefreshRight as be, Right as xe, Share as Se, ZoomIn as Ce, ZoomOut as R } from "@element-plus/icons-vue";
7
+ import * as z from "yjs";
8
+ import { HocuspocusProvider as we } from "@hocuspocus/provider";
9
9
  //#region \0plugin-vue:export-helper
10
- var V = (e, t) => {
10
+ var B = (e, t) => {
11
11
  let n = e.__vccOpts || e;
12
12
  for (let [e, r] of t) n[e] = r;
13
13
  return n;
14
- }, H = { class: "chat-header" }, U = { class: "chat-header-left" }, we = { class: "chat-title" }, Te = { class: "online-users-list" }, Ee = { class: "online-user-item" }, De = { class: "online-user-name" }, Oe = { key: 1 }, W = { class: "online-user-name" }, ke = { class: "chat-header-right" }, G = {
14
+ }, V = { class: "chat-header" }, H = { class: "chat-header-left" }, U = { class: "chat-title" }, Te = { class: "online-users-list" }, Ee = { class: "online-user-item" }, W = { class: "online-user-name" }, De = { key: 1 }, G = { class: "online-user-name" }, Oe = { class: "chat-header-right" }, ke = {
15
15
  key: 0,
16
16
  class: "chat-empty"
17
- }, K = { class: "chat-empty-hint" }, Ae = { key: 1 }, q = { class: "message-content" }, J = {
17
+ }, Ae = { class: "chat-empty-hint" }, je = { key: 1 }, Me = { class: "message-content" }, K = {
18
18
  key: 0,
19
19
  class: "message-meta"
20
- }, je = {
20
+ }, q = {
21
21
  key: 0,
22
22
  class: "message-mention"
23
- }, Me = ["innerHTML"], Ne = { class: "message-time" }, Pe = {
23
+ }, J = ["innerHTML"], Ne = { class: "message-time" }, Pe = {
24
24
  key: 1,
25
25
  class: "chat-message chat-message-ai"
26
26
  }, Fe = { class: "message-avatar ai" }, Ie = { class: "chat-input-area" }, Le = {
27
27
  key: 0,
28
28
  class: "mention-popup"
29
- }, Re = ["onClick", "onMouseenter"], ze = { key: 1 }, Be = /*#__PURE__*/ V({
29
+ }, Re = ["onClick", "onMouseenter"], ze = { key: 1 }, Be = /*#__PURE__*/ B({
30
30
  __name: "AiChatPanel",
31
31
  props: {
32
32
  visible: {
@@ -77,44 +77,44 @@ var V = (e, t) => {
77
77
  "clear-unread"
78
78
  ],
79
79
  setup(c, { emit: l }) {
80
- let p = c, m = l, h = v(""), _ = v(null), C = v(null), w = v(!1), T = v([]), O = v(0), j = "", M = -1, N = {
80
+ let p = c, m = l, h = v(""), _ = v(null), ee = v(null), C = v(!1), w = v([]), D = v(0), A = "", te = -1, j = {
81
81
  id: "ai-assistant",
82
82
  name: "AI助手",
83
83
  color: "#409EFF",
84
84
  isAi: !0
85
- }, P = t(() => {
85
+ }, M = t(() => {
86
86
  let e = p.currentUser.id, t = /* @__PURE__ */ new Set();
87
- return [N, ...p.collabUsers.filter((n) => {
87
+ return [j, ...p.collabUsers.filter((n) => {
88
88
  let r = n.clientId || n.id || "";
89
89
  if (r && r === e) return !1;
90
90
  let i = String(r || n.name || "");
91
91
  return t.has(i) ? !1 : (t.add(i), !0);
92
92
  })];
93
- }), ee = t(() => P.value.length + 1), te = (e) => e.role === "ai" ? "chat-message-ai" : p.isCollab && e.user_id && e.user_id !== p.currentUser.id ? "chat-message-other" : "chat-message-user", I = (e) => e.role === "ai" ? { background: "linear-gradient(135deg, #409EFF, #337ECC)" } : { background: e.user_color || "#67C23A" }, L = (e) => (e.user_name || "U").charAt(0), ne = (e) => {
93
+ }), ne = t(() => M.value.length + 1), N = (e) => e.role === "ai" ? "chat-message-ai" : p.isCollab && e.user_id && e.user_id !== p.currentUser.id ? "chat-message-other" : "chat-message-user", re = (e) => e.role === "ai" ? { background: "linear-gradient(135deg, #409EFF, #337ECC)" } : { background: e.user_color || "#67C23A" }, ae = (e) => (e.user_name || "U").charAt(0), P = (e) => {
94
94
  if (!p.isCollab) return;
95
95
  let t = typeof e == "string" ? e : e.target?.value || h.value, n = t.length, r = t.lastIndexOf("@", n);
96
96
  if (r !== -1 && r < n) {
97
97
  let e = t.slice(r + 1, n);
98
98
  if (!e.includes(" ") && !e.includes("\n")) {
99
- j = e, M = r, T.value = P.value.filter((t) => t.name && t.name.toLowerCase().includes(e.toLowerCase())), w.value = T.value.length > 0, O.value = 0;
99
+ A = e, te = r, w.value = M.value.filter((t) => t.name && t.name.toLowerCase().includes(e.toLowerCase())), C.value = w.value.length > 0, D.value = 0;
100
100
  return;
101
101
  }
102
102
  }
103
- w.value = !1;
104
- }, ae = () => {
105
- w.value && (O.value = Math.min(O.value + 1, T.value.length - 1));
103
+ C.value = !1;
106
104
  }, oe = () => {
107
- w.value && (O.value = Math.max(O.value - 1, 0));
108
- }, se = (e) => {
109
- let t = h.value.slice(0, M), n = h.value.slice(M + j.length + 1);
110
- h.value = `${t}@${e.name} ${n}`, w.value = !1;
105
+ C.value && (D.value = Math.min(D.value + 1, w.value.length - 1));
106
+ }, I = () => {
107
+ C.value && (D.value = Math.max(D.value - 1, 0));
108
+ }, L = (e) => {
109
+ let t = h.value.slice(0, te), n = h.value.slice(te + A.length + 1);
110
+ h.value = `${t}@${e.name} ${n}`, C.value = !1;
111
111
  }, ce = (e) => {
112
112
  if (e) {
113
113
  if (e.shiftKey) return;
114
- if (w.value) {
115
- let t = T.value[O.value];
114
+ if (C.value) {
115
+ let t = w.value[D.value];
116
116
  if (t) {
117
- e.preventDefault(), se(t);
117
+ e.preventDefault(), L(t);
118
118
  return;
119
119
  }
120
120
  }
@@ -127,60 +127,60 @@ var V = (e, t) => {
127
127
  let e = t.match(/@(\S+)/);
128
128
  e && (n = e[1]);
129
129
  }
130
- m("send", t, { mentionedUser: n }), h.value = "", w.value = !1;
130
+ m("send", t, { mentionedUser: n }), h.value = "", C.value = !1;
131
131
  }, le = () => {
132
132
  u(() => {
133
133
  _.value && (_.value.scrollTop = _.value.scrollHeight);
134
134
  });
135
135
  };
136
- return E(() => p.messages.length, le), E(() => p.messages, le, { deep: !0 }), (t, l) => {
137
- let u = b("el-icon"), p = b("el-tag"), v = b("el-popover"), E = b("el-button"), j = b("el-input");
136
+ return T(() => p.messages.length, le), T(() => p.messages, le, { deep: !0 }), (t, l) => {
137
+ let u = b("el-icon"), p = b("el-tag"), v = b("el-popover"), T = b("el-button"), A = b("el-input");
138
138
  return c.visible ? (g(), i("div", {
139
139
  key: 0,
140
140
  class: "ai-chat-panel",
141
141
  style: f({ width: c.panelWidth + "px" })
142
142
  }, [
143
- a("div", H, [a("div", U, [
143
+ a("div", V, [a("div", H, [
144
144
  s(u, {
145
145
  size: 18,
146
146
  color: "#409EFF"
147
147
  }, {
148
- default: D(() => [s(S(pe))]),
148
+ default: E(() => [s(S(me))]),
149
149
  _: 1
150
150
  }),
151
- a("span", we, x(c.isCollab ? "协作聊天" : "AI 助手"), 1),
151
+ a("span", U, x(c.isCollab ? "协作聊天" : "AI 助手"), 1),
152
152
  c.isCollab ? (g(), n(v, {
153
153
  key: 0,
154
154
  width: 200,
155
155
  placement: "bottom-start",
156
156
  trigger: "click"
157
157
  }, {
158
- reference: D(() => [s(p, {
158
+ reference: E(() => [s(p, {
159
159
  size: "small",
160
160
  type: "success",
161
161
  effect: "plain",
162
162
  class: "online-tag"
163
163
  }, {
164
- default: D(() => [o(x(ee.value) + "人在线 ", 1)]),
164
+ default: E(() => [o(x(ne.value) + "人在线 ", 1)]),
165
165
  _: 1
166
166
  })]),
167
- default: D(() => [a("div", Te, [a("div", Ee, [
167
+ default: E(() => [a("div", Te, [a("div", Ee, [
168
168
  a("div", {
169
169
  class: "online-user-avatar",
170
170
  style: f({ background: c.currentUser.color || "#409EFF" })
171
171
  }, x((c.currentUser.name || "U").charAt(0)), 5),
172
- a("span", De, x(c.currentUser.name || "我"), 1),
172
+ a("span", W, x(c.currentUser.name || "我"), 1),
173
173
  s(p, {
174
174
  size: "small",
175
175
  type: c.isOwner ? "warning" : "success",
176
176
  effect: "plain",
177
177
  class: "role-tag"
178
178
  }, {
179
- default: D(() => [o(x(c.isOwner ? "发起人" : "协作人"), 1)]),
179
+ default: E(() => [o(x(c.isOwner ? "发起人" : "协作人"), 1)]),
180
180
  _: 1
181
181
  }, 8, ["type"]),
182
182
  l[4] ||= a("span", { class: "self-tag" }, "(我)", -1)
183
- ]), (g(!0), i(e, null, y(P.value, (e) => (g(), i("div", {
183
+ ]), (g(!0), i(e, null, y(M.value, (e) => (g(), i("div", {
184
184
  key: e.id || e.clientId,
185
185
  class: "online-user-item"
186
186
  }, [
@@ -191,10 +191,10 @@ var V = (e, t) => {
191
191
  key: 0,
192
192
  size: 14
193
193
  }, {
194
- default: D(() => [s(S(pe))]),
194
+ default: E(() => [s(S(me))]),
195
195
  _: 1
196
- })) : (g(), i("span", Oe, x((e.name || "U").charAt(0)), 1))], 4),
197
- a("span", W, x(e.name || "未知用户"), 1),
196
+ })) : (g(), i("span", De, x((e.name || "U").charAt(0)), 1))], 4),
197
+ a("span", G, x(e.name || "未知用户"), 1),
198
198
  e.isAi ? (g(), n(p, {
199
199
  key: 0,
200
200
  size: "small",
@@ -202,7 +202,7 @@ var V = (e, t) => {
202
202
  effect: "plain",
203
203
  class: "role-tag"
204
204
  }, {
205
- default: D(() => [...l[5] ||= [o("AI助手", -1)]]),
205
+ default: E(() => [...l[5] ||= [o("AI助手", -1)]]),
206
206
  _: 1
207
207
  })) : (g(), n(p, {
208
208
  key: 1,
@@ -211,13 +211,13 @@ var V = (e, t) => {
211
211
  effect: "plain",
212
212
  class: "role-tag"
213
213
  }, {
214
- default: D(() => [...l[6] ||= [o("协作人", -1)]]),
214
+ default: E(() => [...l[6] ||= [o("协作人", -1)]]),
215
215
  _: 1
216
216
  }))
217
217
  ]))), 128))])]),
218
218
  _: 1
219
219
  })) : r("", !0)
220
- ]), a("div", ke, [
220
+ ]), a("div", Oe, [
221
221
  c.isCollab && c.unreadMention ? (g(), i("div", {
222
222
  key: 0,
223
223
  class: "mention-bell",
@@ -227,31 +227,31 @@ var V = (e, t) => {
227
227
  size: 18,
228
228
  color: "#F56C6C"
229
229
  }, {
230
- default: D(() => [s(S(F))]),
230
+ default: E(() => [s(S(ie))]),
231
231
  _: 1
232
232
  })])) : r("", !0),
233
- s(E, {
233
+ s(T, {
234
234
  text: "",
235
235
  circle: "",
236
236
  size: "small",
237
237
  onClick: l[1] ||= (e) => t.$emit("clear"),
238
238
  title: "清空对话"
239
239
  }, {
240
- default: D(() => [s(u, null, {
241
- default: D(() => [s(S(ie))]),
240
+ default: E(() => [s(u, null, {
241
+ default: E(() => [s(S(se))]),
242
242
  _: 1
243
243
  })]),
244
244
  _: 1
245
245
  }),
246
- s(E, {
246
+ s(T, {
247
247
  text: "",
248
248
  circle: "",
249
249
  size: "small",
250
250
  onClick: l[2] ||= (e) => t.$emit("close"),
251
251
  title: "关闭"
252
252
  }, {
253
- default: D(() => [s(u, null, {
254
- default: D(() => [s(S(re))]),
253
+ default: E(() => [s(u, null, {
254
+ default: E(() => [s(S(F))]),
255
255
  _: 1
256
256
  })]),
257
257
  _: 1
@@ -262,42 +262,42 @@ var V = (e, t) => {
262
262
  ref_key: "messagesRef",
263
263
  ref: _
264
264
  }, [
265
- c.messages.length === 0 ? (g(), i("div", G, [
265
+ c.messages.length === 0 ? (g(), i("div", ke, [
266
266
  s(u, {
267
267
  size: 40,
268
268
  color: "#c0c4cc"
269
269
  }, {
270
- default: D(() => [s(S(pe))]),
270
+ default: E(() => [s(S(me))]),
271
271
  _: 1
272
272
  }),
273
273
  a("p", null, x(c.isCollab ? "协作聊天室" : "你好!我是 AI 助手"), 1),
274
- a("p", K, x(c.isCollab ? "与团队成员和AI助手实时聊天" : "可以问我任何关于文档编辑的问题"), 1)
274
+ a("p", Ae, x(c.isCollab ? "与团队成员和AI助手实时聊天" : "可以问我任何关于文档编辑的问题"), 1)
275
275
  ])) : r("", !0),
276
276
  (g(!0), i(e, null, y(c.messages, (e) => (g(), i("div", {
277
277
  key: e._msgId || e.time + e.content,
278
- class: d(["chat-message", te(e)])
278
+ class: d(["chat-message", N(e)])
279
279
  }, [a("div", {
280
280
  class: "message-avatar",
281
- style: f(I(e))
281
+ style: f(re(e))
282
282
  }, [e.role === "ai" ? (g(), n(u, {
283
283
  key: 0,
284
284
  size: 16
285
285
  }, {
286
- default: D(() => [s(S(pe))]),
286
+ default: E(() => [s(S(me))]),
287
287
  _: 1
288
- })) : (g(), i("span", Ae, x(L(e)), 1))], 4), a("div", q, [
289
- c.isCollab && e.role === "user" ? (g(), i("div", J, [a("span", {
288
+ })) : (g(), i("span", je, x(ae(e)), 1))], 4), a("div", Me, [
289
+ c.isCollab && e.role === "user" ? (g(), i("div", K, [a("span", {
290
290
  class: "message-sender",
291
291
  style: f({ color: e.user_color || "#67C23A" })
292
- }, x(e.user_name || "用户"), 5), e.mentioned_user ? (g(), i("span", je, "@" + x(e.mentioned_user), 1)) : r("", !0)])) : r("", !0),
292
+ }, x(e.user_name || "用户"), 5), e.mentioned_user ? (g(), i("span", q, "@" + x(e.mentioned_user), 1)) : r("", !0)])) : r("", !0),
293
293
  a("div", {
294
294
  class: "message-text",
295
295
  innerHTML: e.content
296
- }, null, 8, Me),
296
+ }, null, 8, J),
297
297
  a("div", Ne, x(e.time), 1)
298
298
  ])], 2))), 128)),
299
299
  c.loading ? (g(), i("div", Pe, [a("div", Fe, [s(u, { size: 16 }, {
300
- default: D(() => [s(S(pe))]),
300
+ default: E(() => [s(S(me))]),
301
301
  _: 1
302
302
  })]), l[7] ||= a("div", { class: "message-content" }, [a("div", { class: "message-text typing-indicator" }, [
303
303
  a("span"),
@@ -308,9 +308,9 @@ var V = (e, t) => {
308
308
  a("div", Ie, [a("div", {
309
309
  class: "chat-input-wrapper",
310
310
  ref_key: "inputWrapperRef",
311
- ref: C
311
+ ref: ee
312
312
  }, [
313
- s(j, {
313
+ s(A, {
314
314
  modelValue: h.value,
315
315
  "onUpdate:modelValue": l[3] ||= (e) => h.value = e,
316
316
  type: "textarea",
@@ -320,22 +320,22 @@ var V = (e, t) => {
320
320
  },
321
321
  placeholder: c.isCollab ? "输入消息... @提及成员" : "输入消息...",
322
322
  onKeydown: [
323
- k(A(ce, ["exact"]), ["enter"]),
324
- k(A(ae, ["prevent"]), ["down"]),
325
- k(A(oe, ["prevent"]), ["up"])
323
+ O(k(ce, ["exact"]), ["enter"]),
324
+ O(k(oe, ["prevent"]), ["down"]),
325
+ O(k(I, ["prevent"]), ["up"])
326
326
  ],
327
- onInput: ne,
327
+ onInput: P,
328
328
  resize: "none"
329
329
  }, null, 8, [
330
330
  "modelValue",
331
331
  "placeholder",
332
332
  "onKeydown"
333
333
  ]),
334
- w.value ? (g(), i("div", Le, [(g(!0), i(e, null, y(T.value, (e, t) => (g(), i("div", {
334
+ C.value ? (g(), i("div", Le, [(g(!0), i(e, null, y(w.value, (e, t) => (g(), i("div", {
335
335
  key: e.id || e.clientId,
336
- class: d(["mention-item", { active: t === O.value }]),
337
- onClick: (t) => se(e),
338
- onMouseenter: (e) => O.value = t
336
+ class: d(["mention-item", { active: t === D.value }]),
337
+ onClick: (t) => L(e),
338
+ onMouseenter: (e) => D.value = t
339
339
  }, [a("div", {
340
340
  class: "mention-avatar",
341
341
  style: f({ background: e.color || "#909399" })
@@ -343,18 +343,18 @@ var V = (e, t) => {
343
343
  key: 0,
344
344
  size: 12
345
345
  }, {
346
- default: D(() => [s(S(pe))]),
346
+ default: E(() => [s(S(me))]),
347
347
  _: 1
348
348
  })) : (g(), i("span", ze, x((e.name || "U").charAt(0)), 1))], 4), a("span", null, x(e.name), 1)], 42, Re))), 128))])) : r("", !0),
349
- s(E, {
349
+ s(T, {
350
350
  class: "send-btn",
351
351
  type: "primary",
352
352
  circle: "",
353
353
  disabled: !h.value.trim() || c.loading,
354
354
  onClick: ce
355
355
  }, {
356
- default: D(() => [s(u, null, {
357
- default: D(() => [s(S(_e))]),
356
+ default: E(() => [s(u, null, {
357
+ default: E(() => [s(S(ve))]),
358
358
  _: 1
359
359
  })]),
360
360
  _: 1
@@ -373,7 +373,7 @@ function Ve() {
373
373
  color: ""
374
374
  }), a = v(!1), o = null, s = null, c = null, l = /* @__PURE__ */ new Set(), u = "/api/chat", d = null, f = ({ ydoc: t, provider: s, onlineUsers: u }) => {
375
375
  if (t) {
376
- n.value = !0, c = u, d && d(), d = E(c, (e) => {
376
+ n.value = !0, c = u, d && d(), d = T(c, (e) => {
377
377
  r.value = Array.isArray(e) ? e : [];
378
378
  }, {
379
379
  immediate: !0,
@@ -422,7 +422,7 @@ function Ve() {
422
422
  console.warn("[useChat] Failed to push to Y.Array:", e);
423
423
  }
424
424
  if (r.roomId) try {
425
- await z.post(u, {
425
+ await N.post(u, {
426
426
  room_id: r.roomId,
427
427
  role: "user",
428
428
  content: t,
@@ -448,7 +448,7 @@ function Ve() {
448
448
  console.warn("[useChat] Failed to push AI message to Y.Array:", e);
449
449
  }
450
450
  if (r) try {
451
- await z.post(u, {
451
+ await N.post(u, {
452
452
  room_id: r,
453
453
  role: "ai",
454
454
  content: t,
@@ -460,7 +460,7 @@ function Ve() {
460
460
  }
461
461
  }, b = async (t) => {
462
462
  if (t) try {
463
- let n = await z.get(u, { params: { room_id: t } });
463
+ let n = await N.get(u, { params: { room_id: t } });
464
464
  if (Array.isArray(n.data)) {
465
465
  let t = n.data.map((e) => ({
466
466
  _msgId: e._msgId || `hist-${e.id || Date.now()}`,
@@ -479,13 +479,13 @@ function Ve() {
479
479
  }
480
480
  }, x = async (t) => {
481
481
  if (e.value = [], l.clear(), t) try {
482
- await z.delete(u, { params: { room_id: t } });
482
+ await N.delete(u, { params: { room_id: t } });
483
483
  } catch (e) {
484
484
  console.warn("[useChat] Failed to clear messages on server:", e);
485
485
  }
486
- }, C = () => {
486
+ }, ee = () => {
487
487
  a.value = !1;
488
- }, w = () => {
488
+ }, C = () => {
489
489
  if (d &&= (d(), null), o && s) {
490
490
  try {
491
491
  o.unobserve(s);
@@ -494,7 +494,7 @@ function Ve() {
494
494
  }
495
495
  o = null, c = null, l.clear();
496
496
  };
497
- return h(() => w()), {
497
+ return h(() => C()), {
498
498
  messages: e,
499
499
  loading: t,
500
500
  isCollabMode: n,
@@ -508,8 +508,8 @@ function Ve() {
508
508
  sendAiMessage: y,
509
509
  loadHistory: b,
510
510
  clearMessages: x,
511
- clearUnreadMention: C,
512
- destroy: w
511
+ clearUnreadMention: ee,
512
+ destroy: C
513
513
  };
514
514
  }
515
515
  //#endregion
@@ -522,7 +522,7 @@ var He = "/api/document-versions", Ue = 5e3, We = () => {
522
522
  saveVersion: async ({ documentId: e, docType: t, content: n, userId: r, userName: i }) => {
523
523
  if (!e || !t || !n) return null;
524
524
  try {
525
- let { data: a } = await z.post(He, {
525
+ let { data: a } = await N.post(He, {
526
526
  document_id: e,
527
527
  doc_type: t,
528
528
  content: typeof n == "string" ? n : JSON.stringify(n),
@@ -538,7 +538,7 @@ var He = "/api/document-versions", Ue = 5e3, We = () => {
538
538
  if (!n) return [];
539
539
  t.value = !0;
540
540
  try {
541
- let { data: t } = await z.get(He, {
541
+ let { data: t } = await N.get(He, {
542
542
  params: { document_id: n },
543
543
  timeout: Ue
544
544
  });
@@ -551,7 +551,7 @@ var He = "/api/document-versions", Ue = 5e3, We = () => {
551
551
  },
552
552
  getVersionContent: async (e) => {
553
553
  try {
554
- let { data: t } = await z.get(`${He}/${e}`, { timeout: Ue });
554
+ let { data: t } = await N.get(`${He}/${e}`, { timeout: Ue });
555
555
  return t;
556
556
  } catch (e) {
557
557
  return console.warn("[useVersionHistory] Failed to get version content:", e), null;
@@ -570,7 +570,7 @@ var He = "/api/document-versions", Ue = 5e3, We = () => {
570
570
  }, Ye = {
571
571
  key: 0,
572
572
  class: "current-version"
573
- }, Xe = { class: "current-version-header" }, Ze = { class: "version-number" }, Qe = ["onClick"], $e = { class: "version-number" }, et = { class: "version-user" }, tt = { class: "panel-footer" }, nt = /*#__PURE__*/ V({
573
+ }, Xe = { class: "current-version-header" }, Ze = { class: "version-number" }, Qe = ["onClick"], $e = { class: "version-number" }, et = { class: "version-user" }, tt = { class: "panel-footer" }, nt = /*#__PURE__*/ B({
574
574
  __name: "VersionHistoryPanel",
575
575
  props: {
576
576
  modelValue: {
@@ -584,78 +584,78 @@ var He = "/api/document-versions", Ue = 5e3, We = () => {
584
584
  },
585
585
  emits: ["update:modelValue", "apply"],
586
586
  setup(t, { expose: c, emit: l }) {
587
- let u = t, f = l, { versions: p, loading: m, loadVersions: h, getVersionContent: _ } = We(), C = v(!1), w = v(null), T = v(!1), O = v(null);
588
- E(() => u.modelValue, (e) => {
589
- C.value = e, e && u.documentId && (w.value = null, h(u.documentId).then((e) => {
590
- e && e.length > 0 && (O.value = e[0]);
587
+ let u = t, f = l, { versions: p, loading: m, loadVersions: h, getVersionContent: _ } = We(), ee = v(!1), C = v(null), w = v(!1), D = v(null);
588
+ T(() => u.modelValue, (e) => {
589
+ ee.value = e, e && u.documentId && (C.value = null, h(u.documentId).then((e) => {
590
+ e && e.length > 0 && (D.value = e[0]);
591
591
  }));
592
- }), E(C, (e) => {
592
+ }), T(ee, (e) => {
593
593
  f("update:modelValue", e);
594
594
  });
595
- let k = (e) => {
596
- w.value = e;
597
- }, A = async () => {
598
- if (w.value) {
599
- T.value = !0;
595
+ let O = (e) => {
596
+ C.value = e;
597
+ }, k = async () => {
598
+ if (C.value) {
599
+ w.value = !0;
600
600
  try {
601
- let e = await _(w.value.id);
602
- e && e.content ? (O.value = w.value, w.value = null, f("apply", e.content), P.success("已切换到版本 v" + O.value.version_number)) : P.error("获取版本内容失败");
601
+ let e = await _(C.value.id);
602
+ e && e.content ? (D.value = C.value, C.value = null, f("apply", e.content), M.success("已切换到版本 v" + D.value.version_number)) : M.error("获取版本内容失败");
603
603
  } finally {
604
- T.value = !1;
604
+ w.value = !1;
605
605
  }
606
606
  }
607
- }, j = () => {
608
- C.value = !1;
609
- }, M = (e) => {
607
+ }, A = () => {
608
+ ee.value = !1;
609
+ }, te = (e) => {
610
610
  if (!e) return "";
611
611
  let t = new Date(e), n = (e) => String(e).padStart(2, "0");
612
612
  return `${t.getFullYear()}-${n(t.getMonth() + 1)}-${n(t.getDate())} ${n(t.getHours())}:${n(t.getMinutes())}:${n(t.getSeconds())}`;
613
613
  };
614
- return c({ currentVersion: O }), (t, c) => {
614
+ return c({ currentVersion: D }), (t, c) => {
615
615
  let l = b("el-icon"), u = b("el-tag"), f = b("el-timeline-item"), h = b("el-timeline"), _ = b("el-button"), v = b("el-drawer");
616
616
  return g(), n(v, {
617
- modelValue: C.value,
618
- "onUpdate:modelValue": c[0] ||= (e) => C.value = e,
617
+ modelValue: ee.value,
618
+ "onUpdate:modelValue": c[0] ||= (e) => ee.value = e,
619
619
  title: "更新履历",
620
620
  direction: "rtl",
621
621
  size: "420px",
622
- "before-close": j
622
+ "before-close": A
623
623
  }, {
624
- footer: D(() => [a("div", tt, [s(_, {
624
+ footer: E(() => [a("div", tt, [s(_, {
625
625
  type: "primary",
626
- disabled: !w.value,
627
- loading: T.value,
628
- onClick: A
626
+ disabled: !C.value,
627
+ loading: w.value,
628
+ onClick: k
629
629
  }, {
630
- default: D(() => [...c[4] ||= [o(" 切换到此版本 ", -1)]]),
630
+ default: E(() => [...c[4] ||= [o(" 切换到此版本 ", -1)]]),
631
631
  _: 1
632
632
  }, 8, ["disabled", "loading"])])]),
633
- default: D(() => [a("div", Ge, [S(m) ? (g(), i("div", Ke, [s(l, { class: "is-loading" }, {
634
- default: D(() => [s(S(de))]),
633
+ default: E(() => [a("div", Ge, [S(m) ? (g(), i("div", Ke, [s(l, { class: "is-loading" }, {
634
+ default: E(() => [s(S(fe))]),
635
635
  _: 1
636
636
  }), c[1] ||= a("span", null, "加载中...", -1)])) : S(p).length === 0 ? (g(), i("div", qe, [s(l, {
637
637
  size: 48,
638
638
  color: "#c0c4cc"
639
639
  }, {
640
- default: D(() => [s(S(ne))]),
640
+ default: E(() => [s(S(oe))]),
641
641
  _: 1
642
- }), c[2] ||= a("p", null, "暂无历史版本", -1)])) : (g(), i("div", Je, [O.value ? (g(), i("div", Ye, [a("div", Xe, [s(u, {
642
+ }), c[2] ||= a("p", null, "暂无历史版本", -1)])) : (g(), i("div", Je, [D.value ? (g(), i("div", Ye, [a("div", Xe, [s(u, {
643
643
  type: "success",
644
644
  size: "small"
645
645
  }, {
646
- default: D(() => [...c[3] ||= [o("当前版本", -1)]]),
646
+ default: E(() => [...c[3] ||= [o("当前版本", -1)]]),
647
647
  _: 1
648
- }), a("span", Ze, "v" + x(O.value.version_number), 1)])])) : r("", !0), s(h, null, {
649
- default: D(() => [(g(!0), i(e, null, y(S(p), (e) => (g(), n(f, {
648
+ }), a("span", Ze, "v" + x(D.value.version_number), 1)])])) : r("", !0), s(h, null, {
649
+ default: E(() => [(g(!0), i(e, null, y(S(p), (e) => (g(), n(f, {
650
650
  key: e.id,
651
- timestamp: M(e.created_at),
651
+ timestamp: te(e.created_at),
652
652
  placement: "top",
653
- type: w.value?.id === e.id ? "primary" : "",
654
- hollow: w.value?.id !== e.id
653
+ type: C.value?.id === e.id ? "primary" : "",
654
+ hollow: C.value?.id !== e.id
655
655
  }, {
656
- default: D(() => [a("div", {
657
- class: d(["version-item", { active: w.value?.id === e.id }]),
658
- onClick: (t) => k(e)
656
+ default: E(() => [a("div", {
657
+ class: d(["version-item", { active: C.value?.id === e.id }]),
658
+ onClick: (t) => O(e)
659
659
  }, [a("span", $e, "版本号:v" + x(e.version_number), 1), a("span", et, "提交人:" + x(e.user_name || "未知用户"), 1)], 10, Qe)]),
660
660
  _: 2
661
661
  }, 1032, [
@@ -669,7 +669,7 @@ var He = "/api/document-versions", Ue = 5e3, We = () => {
669
669
  }, 8, ["modelValue"]);
670
670
  };
671
671
  }
672
- }, [["__scopeId", "data-v-87924b7c"]]), rt = { class: "theme-picker" }, it = { class: "theme-header" }, at = { class: "theme-count" }, ot = { class: "theme-grid" }, st = ["onClick", "title"], ct = { class: "theme-name" }, lt = /*#__PURE__*/ V({
672
+ }, [["__scopeId", "data-v-87924b7c"]]), rt = { class: "theme-picker" }, it = { class: "theme-header" }, at = { class: "theme-count" }, ot = { class: "theme-grid" }, st = ["onClick", "title"], ct = { class: "theme-name" }, lt = /*#__PURE__*/ B({
673
673
  __name: "ThemePicker",
674
674
  props: {
675
675
  currentTheme: {
@@ -871,24 +871,24 @@ var He = "/api/document-versions", Ue = 5e3, We = () => {
871
871
  width: "340",
872
872
  placement: "bottom-end"
873
873
  }, {
874
- reference: D(() => [s(p, {
874
+ reference: E(() => [s(p, {
875
875
  size: "small",
876
876
  circle: "",
877
877
  tabindex: "-1",
878
878
  title: "主题",
879
879
  disabled: t.disabled
880
880
  }, {
881
- default: D(() => [s(u, null, {
882
- default: D(() => [s(S(I))]),
881
+ default: E(() => [s(u, null, {
882
+ default: E(() => [s(S(ae))]),
883
883
  _: 1
884
884
  })]),
885
885
  _: 1
886
886
  }, 8, ["disabled"])]),
887
- default: D(() => [a("div", rt, [a("div", it, [o[1] ||= a("h4", null, "选择主题", -1), a("span", at, x(c.length) + " 种配色", 1)]), a("div", ot, [(g(), i(e, null, y(c, (e) => a("div", {
887
+ default: E(() => [a("div", rt, [a("div", it, [o[1] ||= a("h4", null, "选择主题", -1), a("span", at, x(c.length) + " 种配色", 1)]), a("div", ot, [(g(), i(e, null, y(c, (e) => a("div", {
888
888
  key: e.id,
889
889
  class: d(["theme-item", { active: t.currentTheme === e.id }]),
890
890
  onClick: (t) => l(e.id),
891
- onMousedown: o[0] ||= A(() => {}, ["prevent"]),
891
+ onMousedown: o[0] ||= k(() => {}, ["prevent"]),
892
892
  title: e.name
893
893
  }, [a("div", {
894
894
  class: "theme-preview",
@@ -1436,22 +1436,22 @@ var He = "/api/document-versions", Ue = 5e3, We = () => {
1436
1436
  verticalGap: 140,
1437
1437
  fontFamily: "Arial"
1438
1438
  }
1439
- ], dt = { class: "style-picker" }, ft = { class: "style-header" }, pt = { class: "style-count" }, mt = { class: "style-grid" }, ht = ["onClick"], Y = { class: "style-preview" }, gt = {
1439
+ ], dt = { class: "style-picker" }, ft = { class: "style-header" }, pt = { class: "style-count" }, mt = { class: "style-grid" }, ht = ["onClick"], gt = { class: "style-preview" }, _t = {
1440
1440
  viewBox: "0 0 80 40",
1441
1441
  class: "style-svg"
1442
- }, _t = ["stroke", "stroke-width"], vt = [
1442
+ }, vt = ["stroke", "stroke-width"], yt = [
1443
1443
  "y2",
1444
1444
  "stroke",
1445
1445
  "stroke-width",
1446
1446
  "opacity",
1447
1447
  "stroke-dasharray"
1448
- ], yt = [
1448
+ ], bt = [
1449
1449
  "y2",
1450
1450
  "stroke",
1451
1451
  "stroke-width",
1452
1452
  "opacity",
1453
1453
  "stroke-dasharray"
1454
- ], bt = [
1454
+ ], Y = [
1455
1455
  "y",
1456
1456
  "height",
1457
1457
  "rx",
@@ -1465,7 +1465,7 @@ var He = "/api/document-versions", Ue = 5e3, We = () => {
1465
1465
  "rx",
1466
1466
  "ry",
1467
1467
  "fill"
1468
- ], Ct = { class: "style-name" }, X = /*#__PURE__*/ V({
1468
+ ], Ct = { class: "style-name" }, wt = /*#__PURE__*/ B({
1469
1469
  __name: "StylePicker",
1470
1470
  props: {
1471
1471
  currentStyle: {
@@ -1484,24 +1484,24 @@ var He = "/api/document-versions", Ue = 5e3, We = () => {
1484
1484
  width: "480",
1485
1485
  placement: "bottom-end"
1486
1486
  }, {
1487
- reference: D(() => [s(u, {
1487
+ reference: E(() => [s(u, {
1488
1488
  size: "small",
1489
1489
  circle: "",
1490
1490
  title: "样式",
1491
1491
  disabled: t.disabled
1492
1492
  }, {
1493
- default: D(() => [s(l, null, {
1494
- default: D(() => [s(S(fe))]),
1493
+ default: E(() => [s(l, null, {
1494
+ default: E(() => [s(S(pe))]),
1495
1495
  _: 1
1496
1496
  })]),
1497
1497
  _: 1
1498
1498
  }, 8, ["disabled"])]),
1499
- default: D(() => [a("div", dt, [a("div", ft, [c[1] ||= a("h4", null, "鱼骨图样式", -1), a("span", pt, x(S(r).length) + " 种", 1)]), a("div", mt, [(g(!0), i(e, null, y(S(r), (e) => (g(), i("div", {
1499
+ default: E(() => [a("div", dt, [a("div", ft, [c[1] ||= a("h4", null, "鱼骨图样式", -1), a("span", pt, x(S(r).length) + " 种", 1)]), a("div", mt, [(g(!0), i(e, null, y(S(r), (e) => (g(), i("div", {
1500
1500
  key: e.id,
1501
1501
  class: d(["style-item", { active: t.currentStyle === e.id }]),
1502
1502
  onClick: (t) => o.$emit("selectStyle", e.id),
1503
- onMousedown: c[0] ||= A(() => {}, ["prevent"])
1504
- }, [a("div", Y, [(g(), i("svg", gt, [
1503
+ onMousedown: c[0] ||= k(() => {}, ["prevent"])
1504
+ }, [a("div", gt, [(g(), i("svg", _t, [
1505
1505
  a("line", {
1506
1506
  x1: "10",
1507
1507
  y1: "20",
@@ -1510,7 +1510,7 @@ var He = "/api/document-versions", Ue = 5e3, We = () => {
1510
1510
  stroke: e.spineColor,
1511
1511
  "stroke-width": e.spineWidth * .4,
1512
1512
  "stroke-linecap": "round"
1513
- }, null, 8, _t),
1513
+ }, null, 8, vt),
1514
1514
  a("line", {
1515
1515
  x1: "30",
1516
1516
  y1: "20",
@@ -1520,7 +1520,7 @@ var He = "/api/document-versions", Ue = 5e3, We = () => {
1520
1520
  "stroke-width": e.branchWidth * .4,
1521
1521
  opacity: e.branchOpacity,
1522
1522
  "stroke-dasharray": e.branchDashed ? "3,2" : "none"
1523
- }, null, 8, vt),
1523
+ }, null, 8, yt),
1524
1524
  a("line", {
1525
1525
  x1: "45",
1526
1526
  y1: "20",
@@ -1530,7 +1530,7 @@ var He = "/api/document-versions", Ue = 5e3, We = () => {
1530
1530
  "stroke-width": e.branchWidth * .4,
1531
1531
  opacity: e.branchOpacity,
1532
1532
  "stroke-dasharray": e.branchDashed ? "3,2" : "none"
1533
- }, null, 8, yt),
1533
+ }, null, 8, bt),
1534
1534
  a("rect", {
1535
1535
  x: "34",
1536
1536
  y: 20 - e.branchAngle * .4 - e.nodeHeight * .15,
@@ -1539,7 +1539,7 @@ var He = "/api/document-versions", Ue = 5e3, We = () => {
1539
1539
  rx: e.nodeRadius * .15,
1540
1540
  fill: e.spineColor,
1541
1541
  opacity: "0.8"
1542
- }, null, 8, bt),
1542
+ }, null, 8, Y),
1543
1543
  a("rect", {
1544
1544
  x: "49",
1545
1545
  y: 20 + e.branchAngle * .4 - e.nodeHeight * .15,
@@ -1562,13 +1562,13 @@ var He = "/api/document-versions", Ue = 5e3, We = () => {
1562
1562
  });
1563
1563
  };
1564
1564
  }
1565
- }, [["__scopeId", "data-v-0387ce0f"]]), wt = { class: "toolbar-left" }, Tt = { class: "toolbar-center" }, Et = { class: "zoom-value" }, Dt = { class: "toolbar-right" }, Ot = {
1565
+ }, [["__scopeId", "data-v-0387ce0f"]]), Tt = { class: "toolbar-left" }, Et = { class: "toolbar-center" }, Dt = { class: "zoom-value" }, Ot = { class: "toolbar-right" }, X = {
1566
1566
  key: 1,
1567
1567
  class: "online-users"
1568
- }, Z = {
1568
+ }, kt = {
1569
1569
  key: 0,
1570
1570
  class: "more-users"
1571
- }, kt = /*#__PURE__*/ V({
1571
+ }, At = /*#__PURE__*/ B({
1572
1572
  __name: "Toolbar",
1573
1573
  props: {
1574
1574
  title: String,
@@ -1594,6 +1594,18 @@ var He = "/api/document-versions", Ue = 5e3, We = () => {
1594
1594
  showHistory: {
1595
1595
  type: Boolean,
1596
1596
  default: !1
1597
+ },
1598
+ backButton: {
1599
+ type: String,
1600
+ default: "show"
1601
+ },
1602
+ titleEditable: {
1603
+ type: Boolean,
1604
+ default: !0
1605
+ },
1606
+ authorEditable: {
1607
+ type: Boolean,
1608
+ default: !0
1597
1609
  }
1598
1610
  },
1599
1611
  emits: [
@@ -1618,39 +1630,42 @@ var He = "/api/document-versions", Ue = 5e3, We = () => {
1618
1630
  "history"
1619
1631
  ],
1620
1632
  setup(t, { emit: c }) {
1621
- let l = t, u = c, p = v(l.title), m = v(l.effect), h = v(l.author), _ = v(null), C = v(null), w = v(null), T = v(!1), O = v(""), k = () => {
1622
- O.value.trim() && (u("ai-generate", O.value.trim()), T.value = !1, O.value = "");
1633
+ let l = t, u = c, p = v(l.title), m = v(l.effect), h = v(l.author), _ = v(null), ee = v(null), C = v(null), w = v(!1), D = v(""), O = () => {
1634
+ D.value.trim() && (u("ai-generate", D.value.trim()), w.value = !1, D.value = "");
1623
1635
  };
1624
- E(() => l.title, (e) => {
1636
+ T(() => l.title, (e) => {
1625
1637
  p.value = e;
1626
- }), E(() => l.effect, (e) => {
1638
+ }), T(() => l.effect, (e) => {
1627
1639
  m.value = e;
1628
- }), E(() => l.author, (e) => {
1640
+ }), T(() => l.author, (e) => {
1629
1641
  h.value = e;
1630
1642
  });
1631
- let A = (e) => {
1643
+ let k = (e) => {
1632
1644
  let t = e.target?.tagName;
1633
- t !== "INPUT" && t !== "TEXTAREA" && (_.value?.blur(), C.value?.blur());
1645
+ t !== "INPUT" && t !== "TEXTAREA" && (_.value?.blur(), ee.value?.blur());
1634
1646
  };
1635
1647
  return (c, l) => {
1636
- let u = b("el-icon"), v = b("el-button"), E = b("el-input"), j = b("el-divider"), M = b("Clock"), N = b("el-dropdown-item"), P = b("el-dropdown-menu"), ee = b("el-dropdown"), F = b("el-avatar"), I = b("el-dialog");
1648
+ let u = b("el-icon"), v = b("el-button"), T = b("el-input"), A = b("el-divider"), te = b("Clock"), j = b("el-dropdown-item"), M = b("el-dropdown-menu"), ne = b("el-dropdown"), N = b("el-avatar"), ie = b("el-dialog");
1637
1649
  return g(), i(e, null, [a("div", {
1638
1650
  class: "toolbar",
1639
- onMousedown: A
1651
+ onMousedown: k
1640
1652
  }, [
1641
- a("div", wt, [
1642
- s(v, {
1643
- onClick: l[0] ||= (e) => c.$emit("back"),
1653
+ a("div", Tt, [
1654
+ t.backButton === "hide" ? r("", !0) : (g(), n(v, {
1655
+ key: 0,
1644
1656
  size: "small",
1645
- circle: ""
1657
+ circle: "",
1658
+ disabled: t.backButton === "disable",
1659
+ onClick: l[0] ||= (e) => c.$emit("back"),
1660
+ title: "返回"
1646
1661
  }, {
1647
- default: D(() => [s(u, null, {
1648
- default: D(() => [s(S(te))]),
1662
+ default: E(() => [s(u, null, {
1663
+ default: E(() => [s(S(re))]),
1649
1664
  _: 1
1650
1665
  })]),
1651
1666
  _: 1
1652
- }),
1653
- s(E, {
1667
+ }, 8, ["disabled"])),
1668
+ s(T, {
1654
1669
  ref_key: "titleInputRef",
1655
1670
  ref: _,
1656
1671
  modelValue: p.value,
@@ -1659,40 +1674,40 @@ var He = "/api/document-versions", Ue = 5e3, We = () => {
1659
1674
  placeholder: "标题 *",
1660
1675
  class: "title-input",
1661
1676
  size: "small",
1662
- disabled: t.readonly
1677
+ disabled: t.readonly || !t.titleEditable
1663
1678
  }, null, 8, ["modelValue", "disabled"]),
1664
- s(E, {
1679
+ s(T, {
1665
1680
  ref_key: "effectInputRef",
1666
- ref: C,
1681
+ ref: ee,
1667
1682
  modelValue: m.value,
1668
1683
  "onUpdate:modelValue": l[3] ||= (e) => m.value = e,
1669
1684
  onBlur: l[4] ||= (e) => c.$emit("update:effect", m.value),
1670
1685
  placeholder: "问题/结果 *",
1671
1686
  class: "effect-input",
1672
1687
  size: "small",
1673
- disabled: t.readonly
1688
+ disabled: t.readonly || !t.titleEditable
1674
1689
  }, null, 8, ["modelValue", "disabled"]),
1675
- s(E, {
1690
+ s(T, {
1676
1691
  ref_key: "authorInputRef",
1677
- ref: w,
1692
+ ref: C,
1678
1693
  modelValue: h.value,
1679
1694
  "onUpdate:modelValue": l[5] ||= (e) => h.value = e,
1680
1695
  onBlur: l[6] ||= (e) => c.$emit("update:author", h.value),
1681
1696
  placeholder: "作者 *",
1682
1697
  class: "author-input",
1683
1698
  size: "small",
1684
- disabled: t.readonly
1699
+ disabled: t.readonly || !t.authorEditable
1685
1700
  }, null, 8, ["modelValue", "disabled"])
1686
1701
  ]),
1687
- a("div", Tt, [
1702
+ a("div", Et, [
1688
1703
  s(v, {
1689
1704
  size: "small",
1690
1705
  circle: "",
1691
- onClick: l[7] ||= (e) => T.value = !0,
1706
+ onClick: l[7] ||= (e) => w.value = !0,
1692
1707
  title: "AI生成",
1693
1708
  disabled: t.readonly
1694
1709
  }, {
1695
- default: D(() => [...l[25] ||= [a("svg", {
1710
+ default: E(() => [...l[25] ||= [a("svg", {
1696
1711
  viewBox: "0 0 24 24",
1697
1712
  width: "14",
1698
1713
  height: "14",
@@ -1708,8 +1723,8 @@ var He = "/api/document-versions", Ue = 5e3, We = () => {
1708
1723
  onClick: l[8] ||= (e) => c.$emit("addTextBox"),
1709
1724
  title: "文本框"
1710
1725
  }, {
1711
- default: D(() => [s(u, null, {
1712
- default: D(() => [s(S(se))]),
1726
+ default: E(() => [s(u, null, {
1727
+ default: E(() => [s(S(ce))]),
1713
1728
  _: 1
1714
1729
  })]),
1715
1730
  _: 1
@@ -1721,21 +1736,21 @@ var He = "/api/document-versions", Ue = 5e3, We = () => {
1721
1736
  title: "箭头线",
1722
1737
  disabled: !t.canAddArrow
1723
1738
  }, {
1724
- default: D(() => [s(u, null, {
1725
- default: D(() => [s(S(be))]),
1739
+ default: E(() => [s(u, null, {
1740
+ default: E(() => [s(S(xe))]),
1726
1741
  _: 1
1727
1742
  })]),
1728
1743
  _: 1
1729
1744
  }, 8, ["disabled"]),
1730
- s(j, { direction: "vertical" }),
1745
+ s(A, { direction: "vertical" }),
1731
1746
  s(v, {
1732
1747
  size: "small",
1733
1748
  circle: "",
1734
1749
  onClick: l[10] ||= (e) => c.$emit("undo"),
1735
1750
  disabled: !t.canUndo
1736
1751
  }, {
1737
- default: D(() => [s(u, null, {
1738
- default: D(() => [s(S(ve))]),
1752
+ default: E(() => [s(u, null, {
1753
+ default: E(() => [s(S(ye))]),
1739
1754
  _: 1
1740
1755
  })]),
1741
1756
  _: 1
@@ -1746,32 +1761,32 @@ var He = "/api/document-versions", Ue = 5e3, We = () => {
1746
1761
  onClick: l[11] ||= (e) => c.$emit("redo"),
1747
1762
  disabled: !t.canRedo
1748
1763
  }, {
1749
- default: D(() => [s(u, null, {
1750
- default: D(() => [s(S(ye))]),
1764
+ default: E(() => [s(u, null, {
1765
+ default: E(() => [s(S(be))]),
1751
1766
  _: 1
1752
1767
  })]),
1753
1768
  _: 1
1754
1769
  }, 8, ["disabled"]),
1755
- s(j, { direction: "vertical" }),
1770
+ s(A, { direction: "vertical" }),
1756
1771
  s(v, {
1757
1772
  size: "small",
1758
1773
  circle: "",
1759
1774
  onClick: l[12] ||= (e) => c.$emit("zoomOut")
1760
1775
  }, {
1761
- default: D(() => [s(u, null, {
1762
- default: D(() => [s(S(R))]),
1776
+ default: E(() => [s(u, null, {
1777
+ default: E(() => [s(S(R))]),
1763
1778
  _: 1
1764
1779
  })]),
1765
1780
  _: 1
1766
1781
  }),
1767
- a("span", Et, x(t.zoom) + "%", 1),
1782
+ a("span", Dt, x(t.zoom) + "%", 1),
1768
1783
  s(v, {
1769
1784
  size: "small",
1770
1785
  circle: "",
1771
1786
  onClick: l[13] ||= (e) => c.$emit("zoomIn")
1772
1787
  }, {
1773
- default: D(() => [s(u, null, {
1774
- default: D(() => [s(S(Se))]),
1788
+ default: E(() => [s(u, null, {
1789
+ default: E(() => [s(S(Ce))]),
1775
1790
  _: 1
1776
1791
  })]),
1777
1792
  _: 1
@@ -1782,25 +1797,25 @@ var He = "/api/document-versions", Ue = 5e3, We = () => {
1782
1797
  onClick: l[14] ||= (e) => c.$emit("fitView"),
1783
1798
  title: "适应画布"
1784
1799
  }, {
1785
- default: D(() => [s(u, null, {
1786
- default: D(() => [s(S(ce))]),
1800
+ default: E(() => [s(u, null, {
1801
+ default: E(() => [s(S(le))]),
1787
1802
  _: 1
1788
1803
  })]),
1789
1804
  _: 1
1790
1805
  })
1791
1806
  ]),
1792
- a("div", Dt, [
1807
+ a("div", Ot, [
1793
1808
  s(lt, {
1794
1809
  "current-theme": t.currentTheme,
1795
1810
  onSelectTheme: l[15] ||= (e) => c.$emit("selectTheme", e),
1796
1811
  disabled: t.readonly
1797
1812
  }, null, 8, ["current-theme", "disabled"]),
1798
- s(X, {
1813
+ s(wt, {
1799
1814
  "current-style": t.currentDiagramStyle,
1800
1815
  onSelectStyle: l[16] ||= (e) => c.$emit("selectStyle", e),
1801
1816
  disabled: t.readonly
1802
1817
  }, null, 8, ["current-style", "disabled"]),
1803
- s(j, { direction: "vertical" }),
1818
+ s(A, { direction: "vertical" }),
1804
1819
  s(v, {
1805
1820
  size: "small",
1806
1821
  type: "primary",
@@ -1808,8 +1823,8 @@ var He = "/api/document-versions", Ue = 5e3, We = () => {
1808
1823
  onClick: l[17] ||= (e) => c.$emit("save"),
1809
1824
  title: "保存"
1810
1825
  }, {
1811
- default: D(() => [s(u, null, {
1812
- default: D(() => [s(S(L))]),
1826
+ default: E(() => [s(u, null, {
1827
+ default: E(() => [s(S(P))]),
1813
1828
  _: 1
1814
1829
  })]),
1815
1830
  _: 1
@@ -1821,52 +1836,52 @@ var He = "/api/document-versions", Ue = 5e3, We = () => {
1821
1836
  title: "更新履历",
1822
1837
  onClick: l[18] ||= (e) => c.$emit("history")
1823
1838
  }, {
1824
- default: D(() => [s(u, null, {
1825
- default: D(() => [s(M)]),
1839
+ default: E(() => [s(u, null, {
1840
+ default: E(() => [s(te)]),
1826
1841
  _: 1
1827
1842
  })]),
1828
1843
  _: 1
1829
1844
  })) : r("", !0),
1830
- s(ee, {
1845
+ s(ne, {
1831
1846
  trigger: "click",
1832
1847
  onCommand: l[19] ||= (e) => c.$emit("export", e)
1833
1848
  }, {
1834
- dropdown: D(() => [s(P, null, {
1835
- default: D(() => [
1836
- s(N, { command: "svg" }, {
1837
- default: D(() => [s(u, null, {
1838
- default: D(() => [s(S(me))]),
1849
+ dropdown: E(() => [s(M, null, {
1850
+ default: E(() => [
1851
+ s(j, { command: "svg" }, {
1852
+ default: E(() => [s(u, null, {
1853
+ default: E(() => [s(S(he))]),
1839
1854
  _: 1
1840
1855
  }), l[26] ||= o(" SVG 矢量图 ", -1)]),
1841
1856
  _: 1
1842
1857
  }),
1843
- s(N, { command: "png" }, {
1844
- default: D(() => [s(u, null, {
1845
- default: D(() => [s(S(he))]),
1858
+ s(j, { command: "png" }, {
1859
+ default: E(() => [s(u, null, {
1860
+ default: E(() => [s(S(ge))]),
1846
1861
  _: 1
1847
1862
  }), l[27] ||= o(" PNG 图片 ", -1)]),
1848
1863
  _: 1
1849
1864
  }),
1850
- s(N, { command: "jpg" }, {
1851
- default: D(() => [s(u, null, {
1852
- default: D(() => [s(S(he))]),
1865
+ s(j, { command: "jpg" }, {
1866
+ default: E(() => [s(u, null, {
1867
+ default: E(() => [s(S(ge))]),
1853
1868
  _: 1
1854
1869
  }), l[28] ||= o(" JPG 图片 ", -1)]),
1855
1870
  _: 1
1856
1871
  }),
1857
- s(N, {
1872
+ s(j, {
1858
1873
  divided: "",
1859
1874
  command: "json"
1860
1875
  }, {
1861
- default: D(() => [s(u, null, {
1862
- default: D(() => [s(S(ae))]),
1876
+ default: E(() => [s(u, null, {
1877
+ default: E(() => [s(S(I))]),
1863
1878
  _: 1
1864
1879
  }), l[29] ||= o(" JSON 数据 ", -1)]),
1865
1880
  _: 1
1866
1881
  }),
1867
- s(N, { command: "xml" }, {
1868
- default: D(() => [s(u, null, {
1869
- default: D(() => [s(S(ae))]),
1882
+ s(j, { command: "xml" }, {
1883
+ default: E(() => [s(u, null, {
1884
+ default: E(() => [s(S(I))]),
1870
1885
  _: 1
1871
1886
  }), l[30] ||= o(" XML 格式 ", -1)]),
1872
1887
  _: 1
@@ -1874,22 +1889,22 @@ var He = "/api/document-versions", Ue = 5e3, We = () => {
1874
1889
  ]),
1875
1890
  _: 1
1876
1891
  })]),
1877
- default: D(() => [s(v, {
1892
+ default: E(() => [s(v, {
1878
1893
  size: "small",
1879
1894
  type: "warning",
1880
1895
  circle: "",
1881
1896
  title: "导出"
1882
1897
  }, {
1883
- default: D(() => [s(u, null, {
1884
- default: D(() => [s(S(oe))]),
1898
+ default: E(() => [s(u, null, {
1899
+ default: E(() => [s(S(L))]),
1885
1900
  _: 1
1886
1901
  })]),
1887
1902
  _: 1
1888
1903
  })]),
1889
1904
  _: 1
1890
1905
  }),
1891
- s(j, { direction: "vertical" }),
1892
- t.onlineCount > 0 ? (g(), i("div", Ot, [(g(!0), i(e, null, y(t.onlineUsers.slice(0, 3), (e, t) => (g(), n(F, {
1906
+ s(A, { direction: "vertical" }),
1907
+ t.onlineCount > 0 ? (g(), i("div", X, [(g(!0), i(e, null, y(t.onlineUsers.slice(0, 3), (e, t) => (g(), n(N, {
1893
1908
  key: e.id || t,
1894
1909
  size: 24,
1895
1910
  style: f({
@@ -1898,9 +1913,9 @@ var He = "/api/document-versions", Ue = 5e3, We = () => {
1898
1913
  }),
1899
1914
  title: e.name
1900
1915
  }, {
1901
- default: D(() => [o(x(e.name?.charAt(0) || "?"), 1)]),
1916
+ default: E(() => [o(x(e.name?.charAt(0) || "?"), 1)]),
1902
1917
  _: 2
1903
- }, 1032, ["style", "title"]))), 128)), t.onlineCount > 3 ? (g(), i("span", Z, "+" + x(t.onlineCount - 3), 1)) : r("", !0)])) : r("", !0),
1918
+ }, 1032, ["style", "title"]))), 128)), t.onlineCount > 3 ? (g(), i("span", kt, "+" + x(t.onlineCount - 3), 1)) : r("", !0)])) : r("", !0),
1904
1919
  t.readonly ? r("", !0) : (g(), n(v, {
1905
1920
  key: 2,
1906
1921
  size: "small",
@@ -1908,8 +1923,8 @@ var He = "/api/document-versions", Ue = 5e3, We = () => {
1908
1923
  onClick: l[20] ||= (e) => c.$emit("toggle-collab"),
1909
1924
  title: "协作"
1910
1925
  }, {
1911
- default: D(() => [s(u, null, {
1912
- default: D(() => [s(S(xe))]),
1926
+ default: E(() => [s(u, null, {
1927
+ default: E(() => [s(S(Se))]),
1913
1928
  _: 1
1914
1929
  }), a("span", null, x(t.isConnected ? "协作中" : "协作"), 1)]),
1915
1930
  _: 1
@@ -1921,36 +1936,36 @@ var He = "/api/document-versions", Ue = 5e3, We = () => {
1921
1936
  onClick: l[21] ||= (e) => c.$emit("share-collab"),
1922
1937
  title: "分享链接"
1923
1938
  }, {
1924
- default: D(() => [s(u, null, {
1925
- default: D(() => [s(S(ue))]),
1939
+ default: E(() => [s(u, null, {
1940
+ default: E(() => [s(S(de))]),
1926
1941
  _: 1
1927
1942
  })]),
1928
1943
  _: 1
1929
1944
  })),
1930
1945
  a("div", { class: d(["connection-status", { connected: t.isConnected }]) }, [...l[31] ||= [a("span", { class: "status-dot" }, null, -1)]], 2)
1931
1946
  ])
1932
- ], 32), s(I, {
1933
- modelValue: T.value,
1934
- "onUpdate:modelValue": l[24] ||= (e) => T.value = e,
1947
+ ], 32), s(ie, {
1948
+ modelValue: w.value,
1949
+ "onUpdate:modelValue": l[24] ||= (e) => w.value = e,
1935
1950
  title: "AI生成鱼骨图",
1936
1951
  width: "70vw",
1937
1952
  top: "50px",
1938
1953
  center: "",
1939
1954
  class: "ai-dialog"
1940
1955
  }, {
1941
- footer: D(() => [s(v, { onClick: l[23] ||= (e) => T.value = !1 }, {
1942
- default: D(() => [...l[32] ||= [o("取消", -1)]]),
1956
+ footer: E(() => [s(v, { onClick: l[23] ||= (e) => w.value = !1 }, {
1957
+ default: E(() => [...l[32] ||= [o("取消", -1)]]),
1943
1958
  _: 1
1944
1959
  }), s(v, {
1945
1960
  type: "primary",
1946
- onClick: k
1961
+ onClick: O
1947
1962
  }, {
1948
- default: D(() => [...l[33] ||= [o("生成", -1)]]),
1963
+ default: E(() => [...l[33] ||= [o("生成", -1)]]),
1949
1964
  _: 1
1950
1965
  })]),
1951
- default: D(() => [s(E, {
1952
- modelValue: O.value,
1953
- "onUpdate:modelValue": l[22] ||= (e) => O.value = e,
1966
+ default: E(() => [s(T, {
1967
+ modelValue: D.value,
1968
+ "onUpdate:modelValue": l[22] ||= (e) => D.value = e,
1954
1969
  type: "textarea",
1955
1970
  autosize: {
1956
1971
  minRows: 27,
@@ -1963,12 +1978,12 @@ var He = "/api/document-versions", Ue = 5e3, We = () => {
1963
1978
  }, 8, ["modelValue"])], 64);
1964
1979
  };
1965
1980
  }
1966
- }, [["__scopeId", "data-v-7f095050"]]), At = (e, t) => !e || e.length <= t ? e || "" : e.substring(0, t - 1) + "...", jt = (e, t = 14) => {
1981
+ }, [["__scopeId", "data-v-554e46a6"]]), jt = (e, t) => !e || e.length <= t ? e || "" : e.substring(0, t - 1) + "...", Mt = (e, t = 14) => {
1967
1982
  if (!e) return 0;
1968
1983
  let n = 0;
1969
1984
  for (let r of e) r.charCodeAt(0) > 127 ? n += t : n += t * .6;
1970
1985
  return n;
1971
- }, Mt = (e, t = "cause") => {
1986
+ }, Nt = (e, t = "cause") => {
1972
1987
  let n = {
1973
1988
  category: 100,
1974
1989
  cause: 80,
@@ -1977,13 +1992,13 @@ var He = "/api/document-versions", Ue = 5e3, We = () => {
1977
1992
  category: 180,
1978
1993
  cause: 140,
1979
1994
  child: 100
1980
- }, i = jt(e);
1995
+ }, i = Mt(e);
1981
1996
  return Math.max(n[t] || n.cause, Math.min(r[t] || r.cause, i + 30));
1982
- }, Nt = { class: "fishbone-wrapper" }, Pt = [
1997
+ }, Pt = { class: "fishbone-wrapper" }, Ft = [
1983
1998
  "viewBox",
1984
1999
  "width",
1985
2000
  "height"
1986
- ], Ft = ["width", "height"], It = ["transform"], Lt = ["width", "height"], Rt = ["width", "height"], zt = {
2001
+ ], Z = ["width", "height"], It = ["transform"], Lt = ["width", "height"], Rt = ["width", "height"], zt = {
1987
2002
  xmlns: "http://www.w3.org/1999/xhtml",
1988
2003
  class: "tooltip-content"
1989
2004
  }, Bt = [
@@ -2156,12 +2171,12 @@ var He = "/api/document-versions", Ue = 5e3, We = () => {
2156
2171
  "fill",
2157
2172
  "font-size",
2158
2173
  "font-family"
2159
- ], Q = ["onMouseenter"], An = ["onClick"], jn = ["cx", "cy"], Mn = ["cx", "cy"], Nn = [
2174
+ ], An = ["onMouseenter"], jn = ["onClick"], Mn = ["cx", "cy"], Nn = ["cx", "cy"], Pn = [
2160
2175
  "x1",
2161
2176
  "y1",
2162
2177
  "x2",
2163
2178
  "y2"
2164
- ], Pn = [
2179
+ ], Q = [
2165
2180
  "x1",
2166
2181
  "y1",
2167
2182
  "x2",
@@ -2186,7 +2201,7 @@ var He = "/api/document-versions", Ue = 5e3, We = () => {
2186
2201
  "y1",
2187
2202
  "x2",
2188
2203
  "y2"
2189
- ], Gn = 150, $ = 250, Kn = 60, qn = /*#__PURE__*/ V({
2204
+ ], Gn = 150, $ = 250, Kn = 60, qn = /*#__PURE__*/ B({
2190
2205
  __name: "FishboneRenderer",
2191
2206
  props: {
2192
2207
  categories: {
@@ -2264,20 +2279,20 @@ var He = "/api/document-versions", Ue = 5e3, We = () => {
2264
2279
  type: e,
2265
2280
  id: t,
2266
2281
  catIndex: n
2267
- }), C = (e, t, n) => p("openMindmap", {
2282
+ }), ee = (e, t, n) => p("openMindmap", {
2268
2283
  catIndex: e,
2269
2284
  causeIndex: t,
2270
2285
  measureIndex: n
2271
- }), w = () => p("clearSelection"), T = v({
2286
+ }), C = () => p("clearSelection"), w = v({
2272
2287
  show: !1,
2273
2288
  text: "",
2274
2289
  x: 0,
2275
2290
  y: 0,
2276
2291
  w: 300,
2277
2292
  h: 200
2278
- }), E = (e, t, n) => {
2293
+ }), T = (e, t, n) => {
2279
2294
  let r = e.split("\n"), i = Math.max(...r.map((e) => e.length)), a = Math.max(120, Math.min(300, i * 14 + 24)), o = Math.max(40, Math.min(200, r.length * 22 + 20));
2280
- T.value = {
2295
+ w.value = {
2281
2296
  show: !0,
2282
2297
  text: e,
2283
2298
  x: Math.max(10, Math.min(t - a / 2, Te.value - a - 10)),
@@ -2285,17 +2300,17 @@ var He = "/api/document-versions", Ue = 5e3, We = () => {
2285
2300
  w: a,
2286
2301
  h: o
2287
2302
  };
2288
- }, D = () => {
2289
- T.value.show = !1;
2290
- }, O = t(() => d.theme.primary || "#546E7A"), k = t(() => d.theme.primary || "#37474F"), j = t(() => ut.find((e) => e.id === d.diagramStyle) || ut[0]), M = (e) => e === "left" ? "start" : e === "right" ? "end" : "middle", N = (e, t) => e === "left" ? -t / 2 : e === "right" ? t / 2 : 0, P = t(() => Math.max(d.categories.length, 1)), ee = t(() => Math.max(600, P.value * 130)), te = t(() => ee.value / (P.value + 1)), F = t(() => 150 + ee.value), I = t(() => At(d.effect || "问题", 8)), L = t(() => {
2303
+ }, E = () => {
2304
+ w.value.show = !1;
2305
+ }, D = t(() => d.theme.primary || "#546E7A"), O = t(() => d.theme.primary || "#37474F"), A = t(() => ut.find((e) => e.id === d.diagramStyle) || ut[0]), te = (e) => e === "left" ? "start" : e === "right" ? "end" : "middle", j = (e, t) => e === "left" ? -t / 2 : e === "right" ? t / 2 : 0, M = t(() => Math.max(d.categories.length, 1)), ne = t(() => Math.max(600, M.value * 130)), N = t(() => ne.value / (M.value + 1)), re = t(() => 150 + ne.value), ie = t(() => jt(d.effect || "问题", 8)), ae = t(() => {
2291
2306
  let e = $;
2292
2307
  return `M 70 ${e} Q 20 ${e - 30} 35 ${e - 65} Q 55 ${e} 35 315 Q 20 280 70 ${e} Z`;
2293
- }), ne = (e) => 150 + te.value * (e + 1), re = (e) => e % 2 == 0 ? $ - Gn : 400, ie = (e) => e % 2 == 0 ? $ - Gn - (j.value.nodeHeight / 2 + 8) : 400 + (j.value.nodeHeight / 2 + 8), ae = (e) => ne(e) + J("anchor", e).dx, oe = (e) => $, se = (e) => ne(e) + 30 + J("cat", e).dx, ce = (e) => re(e) + J("cat", e).dy, le = (e) => ({
2308
+ }), P = (e) => 150 + N.value * (e + 1), oe = (e) => e % 2 == 0 ? $ - Gn : 400, F = (e) => e % 2 == 0 ? $ - Gn - (A.value.nodeHeight / 2 + 8) : 400 + (A.value.nodeHeight / 2 + 8), se = (e) => P(e) + K("anchor", e).dx, I = (e) => $, L = (e) => P(e) + 30 + K("cat", e).dx, ce = (e) => oe(e) + K("cat", e).dy, le = (e) => ({
2294
2309
  dx: (e.direction || "left") === "left" ? -35 : 35,
2295
2310
  dy: 0
2296
2311
  }), ue = (e, t, n) => {
2297
- e.preventDefault(), e.stopPropagation(), D(), h.value = null;
2298
- let r = G(e), i = ae(t), a = oe(t), o = se(t), s = ce(t), c = d.categories?.[t]?.causes || [], l = c.length === 1 ? .5 : (n + 1) / (c.length + 1), u = c[n]?.style?.anchorT ?? l;
2312
+ e.preventDefault(), e.stopPropagation(), E(), h.value = null;
2313
+ let r = ke(e), i = se(t), a = I(t), o = L(t), s = ce(t), c = d.categories?.[t]?.causes || [], l = c.length === 1 ? .5 : (n + 1) / (c.length + 1), u = c[n]?.style?.anchorT ?? l;
2299
2314
  de.value = {
2300
2315
  i: t,
2301
2316
  ci: n,
@@ -2327,13 +2342,13 @@ var He = "/api/document-versions", Ue = 5e3, We = () => {
2327
2342
  x: 0,
2328
2343
  y: $
2329
2344
  };
2330
- let i = n.length === 1 ? .5 : (t + 1) / (n.length + 1), a = r?.style?.anchorT ?? i, o = ae(e), s = oe(e), c = se(e), l = ce(e);
2345
+ let i = n.length === 1 ? .5 : (t + 1) / (n.length + 1), a = r?.style?.anchorT ?? i, o = se(e), s = I(e), c = L(e), l = ce(e);
2331
2346
  return {
2332
2347
  x: o + (c - o) * a,
2333
2348
  y: s + (l - s) * a
2334
2349
  };
2335
2350
  }, me = (e, t) => pe(e, t).x, he = (e, t) => pe(e, t).y, ge = (e, t, n) => {
2336
- let r = n.direction || "left", i = B(n.text) / 2;
2351
+ let r = n.direction || "left", i = z(n.text) / 2;
2337
2352
  return me(e, t) + le(n).dx + (r === "left" ? -i : i);
2338
2353
  }, _e = (e, t) => he(e, t), ve = (e, t, n) => {
2339
2354
  let r = d.categories?.[e]?.causes?.[t];
@@ -2349,35 +2364,35 @@ var He = "/api/document-versions", Ue = 5e3, We = () => {
2349
2364
  }, Se = (e, t, n) => {
2350
2365
  let r = be(e, t), i = d.categories?.[e]?.causes?.[t]?.children?.[n];
2351
2366
  return i?.style?.color ? i.style.color : u(r, 2);
2352
- }, R = (e, t, n) => {
2367
+ }, Ce = (e, t, n) => {
2353
2368
  let r = xe(e, t), i = d.categories?.[e]?.causes?.[t]?.children?.[n];
2354
2369
  return i?.style?.fontSize ? i.style.fontSize : Math.max(8, r - 2);
2355
- }, z = (e) => Mt(e, "category"), B = (e) => Mt(e, "cause"), Ce = (e, t) => At(e, t), V = (e) => (e?.style?.fontSize ?? 12) * 2 + 8, H = (e) => (e?.style?.fontSize ?? 11) * 2 + 6, U = (e, t = 0) => isNaN(e) || !isFinite(e) ? t : e, we = t(() => {
2370
+ }, R = (e) => Nt(e, "category"), z = (e) => Nt(e, "cause"), we = (e, t) => jt(e, t), B = (e) => (e?.style?.fontSize ?? 12) * 2 + 8, V = (e) => (e?.style?.fontSize ?? 11) * 2 + 6, H = (e, t = 0) => isNaN(e) || !isFinite(e) ? t : e, U = t(() => {
2356
2371
  let e = 30, t = 100, n = $, r = $;
2357
- n = Math.min(n, $ - 70), r = Math.max(r, 320), t = Math.max(t, F.value + 120);
2358
- for (let i = 0; i < P.value; i++) {
2359
- let a = ne(i), o = re(i), s = ie(i), c = (z(d.categories?.[i]?.name || "test") || 80) / 2 + 20;
2360
- e = Math.min(e, a - c), t = Math.max(t, a + c + 40), n = Math.min(n, o, s - (j.value?.nodeHeight || 36) / 2), r = Math.max(r, o, s + (j.value?.nodeHeight || 36) / 2);
2372
+ n = Math.min(n, $ - 70), r = Math.max(r, 320), t = Math.max(t, re.value + 120);
2373
+ for (let i = 0; i < M.value; i++) {
2374
+ let a = P(i), o = oe(i), s = F(i), c = (R(d.categories?.[i]?.name || "test") || 80) / 2 + 20;
2375
+ e = Math.min(e, a - c), t = Math.max(t, a + c + 40), n = Math.min(n, o, s - (A.value?.nodeHeight || 36) / 2), r = Math.max(r, o, s + (A.value?.nodeHeight || 36) / 2);
2361
2376
  }
2362
- for (let i = 0; i < P.value; i++) {
2377
+ for (let i = 0; i < M.value; i++) {
2363
2378
  let a = d.categories?.[i]?.causes || [];
2364
2379
  for (let o = 0; o < a.length; o++) {
2365
- let s = U(me(i, o)), c = U(he(i, o), $), l = U(B(a[o]?.text || "test"), 80) / 2 + 20;
2366
- e = Math.min(e, s - l), t = Math.max(t, s + l + 30), n = Math.min(n, c - (j.value?.causeHeight || 26) / 2 - 10), r = Math.max(r, c + (j.value?.causeHeight || 26) / 2 + 10);
2380
+ let s = H(me(i, o)), c = H(he(i, o), $), l = H(z(a[o]?.text || "test"), 80) / 2 + 20;
2381
+ e = Math.min(e, s - l), t = Math.max(t, s + l + 30), n = Math.min(n, c - (A.value?.causeHeight || 26) / 2 - 10), r = Math.max(r, c + (A.value?.causeHeight || 26) / 2 + 10);
2367
2382
  let u = a[o]?.children || [];
2368
2383
  for (let a = 0; a < u.length; a++) {
2369
- let s = U(ve(i, o, a)), l = U(ye(i, o, a), c), d = U(B(u[a]?.text || "test"), 60) / 2 + 15;
2370
- e = Math.min(e, s - d), t = Math.max(t, s + d + 25), n = Math.min(n, l - (j.value?.causeHeight || 26) / 2 - 8), r = Math.max(r, l + (j.value?.causeHeight || 26) / 2 + 8);
2384
+ let s = H(ve(i, o, a)), l = H(ye(i, o, a), c), d = H(z(u[a]?.text || "test"), 60) / 2 + 15;
2385
+ e = Math.min(e, s - d), t = Math.max(t, s + d + 25), n = Math.min(n, l - (A.value?.causeHeight || 26) / 2 - 8), r = Math.max(r, l + (A.value?.causeHeight || 26) / 2 + 8);
2371
2386
  }
2372
2387
  }
2373
2388
  }
2374
2389
  return {
2375
- minX: U(e, 0),
2376
- maxX: U(t, 800),
2377
- minY: U(n, 0),
2378
- maxY: U(r, 500)
2390
+ minX: H(e, 0),
2391
+ maxX: H(t, 800),
2392
+ minY: H(n, 0),
2393
+ maxY: H(r, 500)
2379
2394
  };
2380
- }), Te = t(() => U(we.value.maxX - we.value.minX + Kn * 2, 800)), Ee = t(() => U(we.value.maxY - we.value.minY + Kn * 2, 500)), De = t(() => U(we.value.minX - Kn, 0)), Oe = t(() => U(we.value.minY - Kn, 0)), W = v(null), ke = v({}), G = (e) => {
2395
+ }), Te = t(() => H(U.value.maxX - U.value.minX + Kn * 2, 800)), Ee = t(() => H(U.value.maxY - U.value.minY + Kn * 2, 500)), W = t(() => H(U.value.minX - Kn, 0)), De = t(() => H(U.value.minY - Kn, 0)), G = v(null), Oe = v({}), ke = (e) => {
2381
2396
  if (!m.value) return {
2382
2397
  x: 0,
2383
2398
  y: 0
@@ -2394,10 +2409,10 @@ var He = "/api/document-versions", Ue = 5e3, We = () => {
2394
2409
  x: i.x,
2395
2410
  y: i.y
2396
2411
  };
2397
- }, K = (e, t, n, r, i) => {
2398
- e.preventDefault(), e.stopPropagation(), D(), h.value = null;
2399
- let a = G(e), o = J(t, n, r, i);
2400
- W.value = {
2412
+ }, Ae = (e, t, n, r, i) => {
2413
+ e.preventDefault(), e.stopPropagation(), E(), h.value = null;
2414
+ let a = ke(e), o = K(t, n, r, i);
2415
+ G.value = {
2401
2416
  type: t,
2402
2417
  ci: n,
2403
2418
  cii: r,
@@ -2407,45 +2422,45 @@ var He = "/api/document-versions", Ue = 5e3, We = () => {
2407
2422
  baseDx: o.dx,
2408
2423
  baseDy: o.dy
2409
2424
  }, setTimeout(() => {
2410
- document.addEventListener("mouseup", q, { once: !0 });
2425
+ document.addEventListener("mouseup", Me, { once: !0 });
2411
2426
  }, 0);
2412
- }, Ae = (e) => {
2427
+ }, je = (e) => {
2413
2428
  if (!e.buttons) {
2414
- W.value && q(), de.value && fe();
2429
+ G.value && Me(), de.value && fe();
2415
2430
  return;
2416
2431
  }
2417
2432
  if (de.value) {
2418
- let t = de.value, n = G(e), r = n.x - t.smx, i = n.y - t.smy, a = Math.sqrt((t.ex - t.sx) ** 2 + (t.ey - t.sy) ** 2);
2433
+ let t = de.value, n = ke(e), r = n.x - t.smx, i = n.y - t.smy, a = Math.sqrt((t.ex - t.sx) ** 2 + (t.ey - t.sy) ** 2);
2419
2434
  if (a > 0) {
2420
2435
  let e = (r * (t.ex - t.sx) + i * (t.ey - t.sy)) / (a * a), n = Math.max(.05, Math.min(.95, t.startT + e)), o = (d.categories?.[t.i]?.causes || [])[t.ci];
2421
2436
  o && (o.style ||= {}, o.style.anchorT = n);
2422
2437
  }
2423
2438
  return;
2424
2439
  }
2425
- if (!W.value) return;
2426
- let t = G(e), n = W.value.baseDx + (t.x - W.value.smx), r = W.value.baseDy + (t.y - W.value.smy);
2427
- W.value.type === "anchor" && (r = 0);
2428
- let i = `${W.value.type}-${W.value.ci}-${W.value.cii ?? ""}-${W.value.mii ?? ""}`;
2429
- ke.value[i] = {
2440
+ if (!G.value) return;
2441
+ let t = ke(e), n = G.value.baseDx + (t.x - G.value.smx), r = G.value.baseDy + (t.y - G.value.smy);
2442
+ G.value.type === "anchor" && (r = 0);
2443
+ let i = `${G.value.type}-${G.value.ci}-${G.value.cii ?? ""}-${G.value.mii ?? ""}`;
2444
+ Oe.value[i] = {
2430
2445
  dx: n,
2431
2446
  dy: r
2432
2447
  };
2433
- }, q = () => {
2434
- if (W.value) {
2435
- let e = `${W.value.type}-${W.value.ci}-${W.value.cii ?? ""}-${W.value.mii ?? ""}`, t = ke.value[e];
2448
+ }, Me = () => {
2449
+ if (G.value) {
2450
+ let e = `${G.value.type}-${G.value.ci}-${G.value.cii ?? ""}-${G.value.mii ?? ""}`, t = Oe.value[e];
2436
2451
  t && p("nodeDragged", {
2437
- type: W.value.type,
2438
- catIndex: W.value.ci,
2439
- causeIndex: W.value.cii,
2440
- measureIndex: W.value.mii,
2452
+ type: G.value.type,
2453
+ catIndex: G.value.ci,
2454
+ causeIndex: G.value.cii,
2455
+ measureIndex: G.value.mii,
2441
2456
  dx: t.dx,
2442
2457
  dy: t.dy
2443
2458
  });
2444
2459
  }
2445
- W.value = null, ke.value = {};
2446
- }, J = (e, t, n, r) => {
2460
+ G.value = null, Oe.value = {};
2461
+ }, K = (e, t, n, r) => {
2447
2462
  let i = `${e}-${t}-${n ?? ""}-${r ?? ""}`;
2448
- if (ke.value[i]) return ke.value[i];
2463
+ if (Oe.value[i]) return Oe.value[i];
2449
2464
  if (e === "cat") {
2450
2465
  let e = d.categories?.[t];
2451
2466
  return {
@@ -2472,22 +2487,22 @@ var He = "/api/document-versions", Ue = 5e3, We = () => {
2472
2487
  dx: 0,
2473
2488
  dy: 0
2474
2489
  };
2475
- }, je = () => {
2476
- h.value = null, D();
2477
- }, Me = () => {
2478
- q(), fe();
2490
+ }, q = () => {
2491
+ h.value = null, E();
2492
+ }, J = () => {
2493
+ Me(), fe();
2479
2494
  }, Ne = () => {
2480
- W.value && q(), document.activeElement?.blur(), p("clearSelection");
2495
+ G.value && Me(), document.activeElement?.blur(), p("clearSelection");
2481
2496
  }, Pe = (e) => {
2482
- !e.target.closest("[style*=\"cursor: grab\"]") && W.value && q(), e.target.closest("[style*=\"cursor: grab\"]") || p("clearSelection");
2497
+ !e.target.closest("[style*=\"cursor: grab\"]") && G.value && Me(), e.target.closest("[style*=\"cursor: grab\"]") || p("clearSelection");
2483
2498
  }, Fe = (e, t) => {
2484
2499
  h.value = {
2485
2500
  type: "category",
2486
2501
  id: t.id,
2487
2502
  catIndex: e
2488
2503
  };
2489
- let n = J("anchor", e), r = J("cat", e);
2490
- E(t.name, ne(e) + 30 + n.dx + r.dx, ie(e) + r.dy);
2504
+ let n = K("anchor", e), r = K("cat", e);
2505
+ T(t.name, P(e) + 30 + n.dx + r.dx, F(e) + r.dy);
2491
2506
  }, Ie = (e, t, n) => {
2492
2507
  h.value = {
2493
2508
  type: "cause",
@@ -2495,8 +2510,8 @@ var He = "/api/document-versions", Ue = 5e3, We = () => {
2495
2510
  catIndex: e,
2496
2511
  causeIndex: t
2497
2512
  };
2498
- let r = J("cause", e, t), i = me(e, t) + le(n).dx + r.dx, a = he(e, t) + le(n).dy + r.dy;
2499
- E(n.text, i, a);
2513
+ let r = K("cause", e, t), i = me(e, t) + le(n).dx + r.dx, a = he(e, t) + le(n).dy + r.dy;
2514
+ T(n.text, i, a);
2500
2515
  }, Le = (e, t, n, r) => {
2501
2516
  h.value = {
2502
2517
  type: "measure",
@@ -2505,35 +2520,35 @@ var He = "/api/document-versions", Ue = 5e3, We = () => {
2505
2520
  causeIndex: t,
2506
2521
  measureIndex: n
2507
2522
  };
2508
- let i = J("cause", e, t), a = J("measure", e, t, n);
2509
- E(r.text, ve(e, t, n) + i.dx + a.dx, ye(e, t, n) + i.dy + a.dy);
2523
+ let i = K("cause", e, t), a = K("measure", e, t, n);
2524
+ T(r.text, ve(e, t, n) + i.dx + a.dx, ye(e, t, n) + i.dy + a.dy);
2510
2525
  };
2511
2526
  return o({
2512
2527
  getSvgElement: () => m.value,
2513
2528
  getViewBox: () => ({
2514
- x: De.value,
2515
- y: Oe.value,
2529
+ x: W.value,
2530
+ y: De.value,
2516
2531
  w: Te.value,
2517
2532
  h: Ee.value
2518
2533
  })
2519
- }), (t, o) => (g(), i("div", Nt, [(g(), i("svg", {
2534
+ }), (t, o) => (g(), i("div", Pt, [(g(), i("svg", {
2520
2535
  ref_key: "svgRef",
2521
2536
  ref: m,
2522
2537
  xmlns: "http://www.w3.org/2000/svg",
2523
- viewBox: `${De.value} ${Oe.value} ${Te.value} ${Ee.value}`,
2538
+ viewBox: `${W.value} ${De.value} ${Te.value} ${Ee.value}`,
2524
2539
  width: Te.value,
2525
2540
  height: Ee.value,
2526
2541
  preserveAspectRatio: "xMidYMid meet",
2527
2542
  class: "fishbone-svg",
2528
2543
  style: f({
2529
2544
  background: n.theme.bg || "#fafbfc",
2530
- cursor: W.value ? "grabbing" : "default"
2545
+ cursor: G.value ? "grabbing" : "default"
2531
2546
  }),
2532
- onClick: A(w, ["self"]),
2547
+ onClick: k(C, ["self"]),
2533
2548
  onMousedown: Pe,
2534
- onMousemove: Ae,
2535
- onMouseup: q,
2536
- onMouseleave: Me
2549
+ onMousemove: je,
2550
+ onMouseup: Me,
2551
+ onMouseleave: J
2537
2552
  }, [
2538
2553
  a("rect", {
2539
2554
  x: "0",
@@ -2542,150 +2557,150 @@ var He = "/api/document-versions", Ue = 5e3, We = () => {
2542
2557
  height: Ee.value,
2543
2558
  fill: "transparent",
2544
2559
  onClick: Ne
2545
- }, null, 8, Ft),
2546
- T.value.show ? (g(), i("g", {
2560
+ }, null, 8, Z),
2561
+ w.value.show ? (g(), i("g", {
2547
2562
  key: 0,
2548
- transform: `translate(${T.value.x}, ${T.value.y})`
2563
+ transform: `translate(${w.value.x}, ${w.value.y})`
2549
2564
  }, [a("rect", {
2550
2565
  x: "0",
2551
2566
  y: "0",
2552
- width: T.value.w,
2553
- height: T.value.h,
2567
+ width: w.value.w,
2568
+ height: w.value.h,
2554
2569
  rx: "6",
2555
2570
  fill: "#303236",
2556
2571
  opacity: "0.4"
2557
2572
  }, null, 8, Lt), (g(), i("foreignObject", {
2558
2573
  x: "8",
2559
2574
  y: "6",
2560
- width: T.value.w - 16,
2561
- height: T.value.h - 12
2562
- }, [a("div", zt, x(T.value.text), 1)], 8, Rt))], 8, It)) : r("", !0),
2575
+ width: w.value.w - 16,
2576
+ height: w.value.h - 12
2577
+ }, [a("div", zt, x(w.value.text), 1)], 8, Rt))], 8, It)) : r("", !0),
2563
2578
  (g(), i("g", { key: n.styleTick }, [
2564
2579
  a("line", {
2565
2580
  x1: 100,
2566
2581
  y1: $,
2567
- x2: F.value,
2582
+ x2: re.value,
2568
2583
  y2: $,
2569
- stroke: j.value.spineColor || O.value,
2570
- "stroke-width": j.value.spineWidth,
2584
+ stroke: A.value.spineColor || D.value,
2585
+ "stroke-width": A.value.spineWidth,
2571
2586
  "stroke-linecap": "round"
2572
2587
  }, null, 8, Bt),
2573
2588
  a("path", {
2574
- d: L.value,
2575
- fill: j.value.spineColor || O.value,
2589
+ d: ae.value,
2590
+ fill: A.value.spineColor || D.value,
2576
2591
  opacity: "0.5"
2577
2592
  }, null, 8, Vt),
2578
2593
  a("g", null, [
2579
2594
  a("ellipse", {
2580
- cx: F.value + 55,
2595
+ cx: re.value + 55,
2581
2596
  cy: $,
2582
- rx: j.value.headRx,
2583
- ry: j.value.headRy,
2584
- fill: j.value.spineColor || k.value,
2597
+ rx: A.value.headRx,
2598
+ ry: A.value.headRy,
2599
+ fill: A.value.spineColor || O.value,
2585
2600
  style: { "pointer-events": "none" }
2586
2601
  }, null, 8, Ht),
2587
2602
  a("circle", {
2588
- cx: F.value + 45,
2603
+ cx: re.value + 45,
2589
2604
  cy: $ - 7,
2590
2605
  r: "6",
2591
2606
  fill: "white",
2592
2607
  style: { "pointer-events": "none" }
2593
2608
  }, null, 8, Ut),
2594
2609
  a("circle", {
2595
- cx: F.value + 47,
2610
+ cx: re.value + 47,
2596
2611
  cy: $ - 7,
2597
2612
  r: "3.5",
2598
2613
  fill: "#263238",
2599
2614
  style: { "pointer-events": "none" }
2600
2615
  }, null, 8, Wt),
2601
2616
  a("circle", {
2602
- cx: F.value + 49,
2617
+ cx: re.value + 49,
2603
2618
  cy: $ - 9,
2604
2619
  r: "1.2",
2605
2620
  fill: "white",
2606
2621
  style: { "pointer-events": "none" }
2607
2622
  }, null, 8, Gt),
2608
2623
  a("text", {
2609
- x: F.value + 55,
2624
+ x: re.value + 55,
2610
2625
  y: 268,
2611
2626
  "text-anchor": "middle",
2612
2627
  "dominant-baseline": "middle",
2613
2628
  fill: "white",
2614
2629
  "font-size": "12",
2615
- "font-family": j.value.fontFamily + ", sans-serif",
2630
+ "font-family": A.value.fontFamily + ", sans-serif",
2616
2631
  style: { "pointer-events": "none" }
2617
- }, x(I.value), 9, Kt)
2632
+ }, x(ie.value), 9, Kt)
2618
2633
  ]),
2619
2634
  (g(!0), i(e, null, y(n.categories, (t, s) => (g(), i("g", { key: t.id }, [
2620
2635
  a("line", {
2621
- x1: ne(s) + J("anchor", s).dx,
2636
+ x1: P(s) + K("anchor", s).dx,
2622
2637
  y1: $,
2623
- x2: ne(s) + 30 + J("cat", s).dx,
2624
- y2: re(s) + J("cat", s).dy,
2625
- stroke: t.style?.lineColor || j.value.spineColor || t.color,
2626
- "stroke-width": j.value.branchWidth,
2638
+ x2: P(s) + 30 + K("cat", s).dx,
2639
+ y2: oe(s) + K("cat", s).dy,
2640
+ stroke: t.style?.lineColor || A.value.spineColor || t.color,
2641
+ "stroke-width": A.value.branchWidth,
2627
2642
  "stroke-linecap": "round",
2628
- opacity: (t.style?.lineOpacity ?? j.value.branchOpacity * 100) / 100,
2643
+ opacity: (t.style?.lineOpacity ?? A.value.branchOpacity * 100) / 100,
2629
2644
  "stroke-dasharray": t.style?.lineStyle === "dashed" ? "6,3" : "none"
2630
2645
  }, null, 8, qt),
2631
- j.value.showDots ? (g(), i("circle", {
2646
+ A.value.showDots ? (g(), i("circle", {
2632
2647
  key: 0,
2633
- cx: ne(s) + J("anchor", s).dx,
2648
+ cx: P(s) + K("anchor", s).dx,
2634
2649
  cy: $,
2635
2650
  r: "4",
2636
- fill: j.value.spineColor || t.color
2651
+ fill: A.value.spineColor || t.color
2637
2652
  }, null, 8, Jt)) : r("", !0),
2638
2653
  a("circle", {
2639
- cx: ne(s) + J("anchor", s).dx,
2654
+ cx: P(s) + K("anchor", s).dx,
2640
2655
  cy: $,
2641
2656
  r: n.selectedNode?.id === t.id ? 6 : 4,
2642
2657
  fill: n.selectedNode?.id === t.id ? "#409EFF" : "transparent",
2643
2658
  stroke: n.selectedNode?.id === t.id ? "#409EFF" : "#909399",
2644
2659
  "stroke-width": 1.5,
2645
2660
  style: { cursor: "ew-resize" },
2646
- onMousedown: A((e) => K(e, "anchor", s), ["stop"]),
2647
- onMouseup: q
2661
+ onMousedown: k((e) => Ae(e, "anchor", s), ["stop"]),
2662
+ onMouseup: Me
2648
2663
  }, null, 40, Yt),
2649
2664
  a("g", {
2650
- transform: `translate(${ne(s) + 30 + J("cat", s).dx}, ${ie(s) + J("cat", s).dy})`,
2651
- onClick: A((e) => _("category", t.id, s), ["stop"]),
2652
- onMousedown: (e) => K(e, "cat", s),
2653
- onMouseup: q,
2654
- onMouseleave: je,
2665
+ transform: `translate(${P(s) + 30 + K("cat", s).dx}, ${F(s) + K("cat", s).dy})`,
2666
+ onClick: k((e) => _("category", t.id, s), ["stop"]),
2667
+ onMousedown: (e) => Ae(e, "cat", s),
2668
+ onMouseup: Me,
2669
+ onMouseleave: q,
2655
2670
  onMouseenter: (e) => Fe(s, t),
2656
2671
  style: { cursor: "grab" }
2657
2672
  }, [
2658
2673
  n.selectedNode?.id === t.id ? (g(), i("rect", {
2659
2674
  key: 0,
2660
- x: -z(t.name) / 2 - 4,
2661
- y: -(V(t) / 2 + 4),
2662
- width: z(t.name) + 8,
2663
- height: V(t) + 8,
2664
- rx: j.value.nodeRadius + 4,
2675
+ x: -R(t.name) / 2 - 4,
2676
+ y: -(B(t) / 2 + 4),
2677
+ width: R(t.name) + 8,
2678
+ height: B(t) + 8,
2679
+ rx: A.value.nodeRadius + 4,
2665
2680
  fill: "none",
2666
2681
  stroke: "#409EFF",
2667
2682
  "stroke-width": "3"
2668
2683
  }, null, 8, Zt)) : r("", !0),
2669
2684
  a("rect", {
2670
- x: -z(t.name) / 2,
2671
- y: -V(t) / 2,
2672
- width: z(t.name),
2673
- height: V(t),
2674
- rx: j.value.nodeRadius,
2685
+ x: -R(t.name) / 2,
2686
+ y: -B(t) / 2,
2687
+ width: R(t.name),
2688
+ height: B(t),
2689
+ rx: A.value.nodeRadius,
2675
2690
  fill: t.color,
2676
2691
  opacity: (t.style?.opacity ?? 100) / 100,
2677
2692
  stroke: n.selectedNode?.id === t.id ? "#409EFF" : t.style?.borderStyle === "none" ? "none" : t.style?.borderColor || t.color,
2678
2693
  "stroke-width": n.selectedNode?.id === t.id ? 3 : t.style?.borderStyle === "none" ? 0 : t.style?.borderWidth ?? 1.5
2679
2694
  }, null, 8, Qt),
2680
2695
  a("text", {
2681
- "text-anchor": M(t.style?.textAlign),
2696
+ "text-anchor": te(t.style?.textAlign),
2682
2697
  "dominant-baseline": "middle",
2683
- x: N(t.style?.textAlign, z(t.name)),
2698
+ x: j(t.style?.textAlign, R(t.name)),
2684
2699
  fill: t.style?.textColor || "white",
2685
2700
  "font-size": t.style?.fontSize ?? 12,
2686
- "font-family": (t.style?.fontFamily || j.value.fontFamily) + ", sans-serif",
2701
+ "font-family": (t.style?.fontFamily || A.value.fontFamily) + ", sans-serif",
2687
2702
  style: { "pointer-events": "none" }
2688
- }, x(Ce(t.name, t.style?.maxChars ?? 15)), 9, $t),
2703
+ }, x(we(t.name, t.style?.maxChars ?? 15)), 9, $t),
2689
2704
  h.value?.id === t.id ? (g(), i("g", {
2690
2705
  key: 1,
2691
2706
  style: { "pointer-events": "auto" },
@@ -2696,61 +2711,61 @@ var He = "/api/document-versions", Ue = 5e3, We = () => {
2696
2711
  },
2697
2712
  onMouseleave: o[2] ||= (e) => h.value = null
2698
2713
  }, [a("g", {
2699
- onClick: A((e) => b("category", t.id, s), ["stop"]),
2700
- onMousedown: o[0] ||= A(() => {}, ["stop"]),
2714
+ onClick: k((e) => b("category", t.id, s), ["stop"]),
2715
+ onMousedown: o[0] ||= k(() => {}, ["stop"]),
2701
2716
  style: { cursor: "pointer" }
2702
2717
  }, [
2703
2718
  a("circle", {
2704
- cx: z(t.name) / 2 - 24,
2705
- cy: -V(t) / 2 - 6,
2719
+ cx: R(t.name) / 2 - 24,
2720
+ cy: -B(t) / 2 - 6,
2706
2721
  r: "7",
2707
2722
  fill: "#409EFF",
2708
2723
  opacity: "0.9"
2709
2724
  }, null, 8, nn),
2710
2725
  a("line", {
2711
- x1: z(t.name) / 2 - 27,
2712
- y1: -V(t) / 2 - 6,
2713
- x2: z(t.name) / 2 - 21,
2714
- y2: -V(t) / 2 - 6,
2726
+ x1: R(t.name) / 2 - 27,
2727
+ y1: -B(t) / 2 - 6,
2728
+ x2: R(t.name) / 2 - 21,
2729
+ y2: -B(t) / 2 - 6,
2715
2730
  stroke: "white",
2716
2731
  "stroke-width": "1.5",
2717
2732
  "stroke-linecap": "round"
2718
2733
  }, null, 8, rn),
2719
2734
  a("line", {
2720
- x1: z(t.name) / 2 - 24,
2721
- y1: -V(t) / 2 - 9,
2722
- x2: z(t.name) / 2 - 24,
2723
- y2: -V(t) / 2 - 3,
2735
+ x1: R(t.name) / 2 - 24,
2736
+ y1: -B(t) / 2 - 9,
2737
+ x2: R(t.name) / 2 - 24,
2738
+ y2: -B(t) / 2 - 3,
2724
2739
  stroke: "white",
2725
2740
  "stroke-width": "1.5",
2726
2741
  "stroke-linecap": "round"
2727
2742
  }, null, 8, an)
2728
2743
  ], 40, tn), a("g", {
2729
- onClick: A((e) => S("category", t.id, s), ["stop"]),
2730
- onMousedown: o[1] ||= A(() => {}, ["stop"]),
2744
+ onClick: k((e) => S("category", t.id, s), ["stop"]),
2745
+ onMousedown: o[1] ||= k(() => {}, ["stop"]),
2731
2746
  style: { cursor: "pointer" }
2732
2747
  }, [
2733
2748
  a("circle", {
2734
- cx: z(t.name) / 2 - 8,
2735
- cy: -V(t) / 2 - 6,
2749
+ cx: R(t.name) / 2 - 8,
2750
+ cy: -B(t) / 2 - 6,
2736
2751
  r: "7",
2737
2752
  fill: "#F56C6C",
2738
2753
  opacity: "0.9"
2739
2754
  }, null, 8, sn),
2740
2755
  a("line", {
2741
- x1: z(t.name) / 2 - 11,
2742
- y1: -V(t) / 2 - 9,
2743
- x2: z(t.name) / 2 - 5,
2744
- y2: -V(t) / 2 - 3,
2756
+ x1: R(t.name) / 2 - 11,
2757
+ y1: -B(t) / 2 - 9,
2758
+ x2: R(t.name) / 2 - 5,
2759
+ y2: -B(t) / 2 - 3,
2745
2760
  stroke: "white",
2746
2761
  "stroke-width": "1.5",
2747
2762
  "stroke-linecap": "round"
2748
2763
  }, null, 8, cn),
2749
2764
  a("line", {
2750
- x1: z(t.name) / 2 - 5,
2751
- y1: -V(t) / 2 - 9,
2752
- x2: z(t.name) / 2 - 11,
2753
- y2: -V(t) / 2 - 3,
2765
+ x1: R(t.name) / 2 - 5,
2766
+ y1: -B(t) / 2 - 9,
2767
+ x2: R(t.name) / 2 - 11,
2768
+ y2: -B(t) / 2 - 3,
2754
2769
  stroke: "white",
2755
2770
  "stroke-width": "1.5",
2756
2771
  "stroke-linecap": "round"
@@ -2766,59 +2781,59 @@ var He = "/api/document-versions", Ue = 5e3, We = () => {
2766
2781
  stroke: n.selectedNode?.id === c.id ? "#409EFF" : "#fff",
2767
2782
  "stroke-width": 1.5,
2768
2783
  style: { cursor: "ew-resize" },
2769
- onMousedown: A((e) => ue(e, s, l), ["stop"]),
2770
- onMouseup: q,
2771
- onClick: A((e) => _("cause", c.id, s, l), ["stop"])
2784
+ onMousedown: k((e) => ue(e, s, l), ["stop"]),
2785
+ onMouseup: Me,
2786
+ onClick: k((e) => _("cause", c.id, s, l), ["stop"])
2772
2787
  }, null, 40, un),
2773
2788
  a("line", {
2774
2789
  x1: me(s, l),
2775
2790
  y1: he(s, l),
2776
- x2: me(s, l) + le(c).dx + J("cause", s, l).dx,
2777
- y2: he(s, l) + le(c).dy + J("cause", s, l).dy,
2791
+ x2: me(s, l) + le(c).dx + K("cause", s, l).dx,
2792
+ y2: he(s, l) + le(c).dy + K("cause", s, l).dy,
2778
2793
  stroke: t.color,
2779
2794
  "stroke-width": 1,
2780
2795
  opacity: .4
2781
2796
  }, null, 8, dn),
2782
2797
  a("g", {
2783
- transform: `translate(${me(s, l) + le(c).dx + J("cause", s, l).dx}, ${he(s, l) + le(c).dy + J("cause", s, l).dy})`,
2784
- onClick: A((e) => _("cause", c.id, s, l), ["stop"]),
2785
- onMousedown: (e) => K(e, "cause", s, l),
2786
- onMouseup: q,
2787
- onMouseleave: je,
2798
+ transform: `translate(${me(s, l) + le(c).dx + K("cause", s, l).dx}, ${he(s, l) + le(c).dy + K("cause", s, l).dy})`,
2799
+ onClick: k((e) => _("cause", c.id, s, l), ["stop"]),
2800
+ onMousedown: (e) => Ae(e, "cause", s, l),
2801
+ onMouseup: Me,
2802
+ onMouseleave: q,
2788
2803
  onMouseenter: (e) => Ie(s, l, c),
2789
2804
  style: { cursor: "grab" }
2790
2805
  }, [
2791
2806
  n.selectedNode?.id === c.id ? (g(), i("rect", {
2792
2807
  key: 0,
2793
- x: -B(c.text) / 2 - 4,
2794
- y: -(H(c) / 2 + 4),
2795
- width: B(c.text) + 8,
2796
- height: H(c) + 8,
2797
- rx: j.value.causeRadius + 4,
2808
+ x: -z(c.text) / 2 - 4,
2809
+ y: -(V(c) / 2 + 4),
2810
+ width: z(c.text) + 8,
2811
+ height: V(c) + 8,
2812
+ rx: A.value.causeRadius + 4,
2798
2813
  fill: "none",
2799
2814
  stroke: "#409EFF",
2800
2815
  "stroke-width": "3"
2801
2816
  }, null, 8, pn)) : r("", !0),
2802
2817
  a("rect", {
2803
- x: -B(c.text) / 2,
2804
- y: -H(c) / 2,
2805
- width: B(c.text),
2806
- height: H(c),
2807
- rx: j.value.causeRadius,
2818
+ x: -z(c.text) / 2,
2819
+ y: -V(c) / 2,
2820
+ width: z(c.text),
2821
+ height: V(c),
2822
+ rx: A.value.causeRadius,
2808
2823
  fill: be(s, l),
2809
2824
  opacity: (c.style?.opacity ?? 100) / 100,
2810
2825
  stroke: n.selectedNode?.id === c.id ? "#409EFF" : c.style?.borderStyle === "none" ? "none" : c.style?.borderColor || t.color,
2811
2826
  "stroke-width": n.selectedNode?.id === c.id ? 3 : c.style?.borderStyle === "none" ? 0 : c.style?.borderWidth ?? 1.5
2812
2827
  }, null, 8, mn),
2813
2828
  a("text", {
2814
- "text-anchor": M(c.style?.textAlign),
2829
+ "text-anchor": te(c.style?.textAlign),
2815
2830
  "dominant-baseline": "middle",
2816
- x: N(c.style?.textAlign, B(c.text)),
2831
+ x: j(c.style?.textAlign, z(c.text)),
2817
2832
  fill: c.style?.textColor || "#263238",
2818
2833
  "font-size": xe(s, l),
2819
- "font-family": (c.style?.fontFamily || j.value.fontFamily) + ", sans-serif",
2834
+ "font-family": (c.style?.fontFamily || A.value.fontFamily) + ", sans-serif",
2820
2835
  style: { "pointer-events": "none" }
2821
- }, x(Ce(c.text, c.style?.maxChars ?? 20)), 9, hn),
2836
+ }, x(we(c.text, c.style?.maxChars ?? 20)), 9, hn),
2822
2837
  h.value?.id === c.id ? (g(), i("g", {
2823
2838
  key: 1,
2824
2839
  style: { "pointer-events": "auto" },
@@ -2830,61 +2845,61 @@ var He = "/api/document-versions", Ue = 5e3, We = () => {
2830
2845
  },
2831
2846
  onMouseleave: o[5] ||= (e) => h.value = null
2832
2847
  }, [a("g", {
2833
- onClick: A((e) => b("cause", c.id, s, l), ["stop"]),
2834
- onMousedown: o[3] ||= A(() => {}, ["stop"]),
2848
+ onClick: k((e) => b("cause", c.id, s, l), ["stop"]),
2849
+ onMousedown: o[3] ||= k(() => {}, ["stop"]),
2835
2850
  style: { cursor: "pointer" }
2836
2851
  }, [
2837
2852
  a("circle", {
2838
- cx: B(c.text) / 2 - 30,
2839
- cy: -H(c) / 2 - 6,
2853
+ cx: z(c.text) / 2 - 30,
2854
+ cy: -V(c) / 2 - 6,
2840
2855
  r: "6",
2841
2856
  fill: "#409EFF",
2842
2857
  opacity: "0.9"
2843
2858
  }, null, 8, vn),
2844
2859
  a("line", {
2845
- x1: B(c.text) / 2 - 33,
2846
- y1: -H(c) / 2 - 6,
2847
- x2: B(c.text) / 2 - 27,
2848
- y2: -H(c) / 2 - 6,
2860
+ x1: z(c.text) / 2 - 33,
2861
+ y1: -V(c) / 2 - 6,
2862
+ x2: z(c.text) / 2 - 27,
2863
+ y2: -V(c) / 2 - 6,
2849
2864
  stroke: "white",
2850
2865
  "stroke-width": "1.5",
2851
2866
  "stroke-linecap": "round"
2852
2867
  }, null, 8, yn),
2853
2868
  a("line", {
2854
- x1: B(c.text) / 2 - 30,
2855
- y1: -H(c) / 2 - 9,
2856
- x2: B(c.text) / 2 - 30,
2857
- y2: -H(c) / 2 - 3,
2869
+ x1: z(c.text) / 2 - 30,
2870
+ y1: -V(c) / 2 - 9,
2871
+ x2: z(c.text) / 2 - 30,
2872
+ y2: -V(c) / 2 - 3,
2858
2873
  stroke: "white",
2859
2874
  "stroke-width": "1.5",
2860
2875
  "stroke-linecap": "round"
2861
2876
  }, null, 8, bn)
2862
2877
  ], 40, _n), a("g", {
2863
- onClick: A((e) => S("cause", c.id, s), ["stop"]),
2864
- onMousedown: o[4] ||= A(() => {}, ["stop"]),
2878
+ onClick: k((e) => S("cause", c.id, s), ["stop"]),
2879
+ onMousedown: o[4] ||= k(() => {}, ["stop"]),
2865
2880
  style: { cursor: "pointer" }
2866
2881
  }, [
2867
2882
  a("circle", {
2868
- cx: B(c.text) / 2 - 14,
2869
- cy: -H(c) / 2 - 6,
2883
+ cx: z(c.text) / 2 - 14,
2884
+ cy: -V(c) / 2 - 6,
2870
2885
  r: "6",
2871
2886
  fill: "#F56C6C",
2872
2887
  opacity: "0.9"
2873
2888
  }, null, 8, Sn),
2874
2889
  a("line", {
2875
- x1: B(c.text) / 2 - 17,
2876
- y1: -H(c) / 2 - 9,
2877
- x2: B(c.text) / 2 - 11,
2878
- y2: -H(c) / 2 - 3,
2890
+ x1: z(c.text) / 2 - 17,
2891
+ y1: -V(c) / 2 - 9,
2892
+ x2: z(c.text) / 2 - 11,
2893
+ y2: -V(c) / 2 - 3,
2879
2894
  stroke: "white",
2880
2895
  "stroke-width": "1.5",
2881
2896
  "stroke-linecap": "round"
2882
2897
  }, null, 8, Cn),
2883
2898
  a("line", {
2884
- x1: B(c.text) / 2 - 11,
2885
- y1: -H(c) / 2 - 9,
2886
- x2: B(c.text) / 2 - 17,
2887
- y2: -H(c) / 2 - 3,
2899
+ x1: z(c.text) / 2 - 11,
2900
+ y1: -V(c) / 2 - 9,
2901
+ x2: z(c.text) / 2 - 17,
2902
+ y2: -V(c) / 2 - 3,
2888
2903
  stroke: "white",
2889
2904
  "stroke-width": "1.5",
2890
2905
  "stroke-linecap": "round"
@@ -2893,52 +2908,52 @@ var He = "/api/document-versions", Ue = 5e3, We = () => {
2893
2908
  (g(!0), i(e, null, y(c.children || [], (e, u) => (g(), i("g", { key: e.id }, [a("line", {
2894
2909
  x1: ge(s, l, c) - (me(s, l) + le(c).dx),
2895
2910
  y1: 0,
2896
- x2: ve(s, l, u) - (me(s, l) + le(c).dx) + J("measure", s, l, u).dx,
2897
- y2: ye(s, l, u) - he(s, l) + J("measure", s, l, u).dy,
2898
- stroke: e.style?.lineColor || j.value.spineColor || t.color,
2899
- "stroke-width": j.value.branchWidth * .4,
2900
- opacity: (e.style?.lineOpacity ?? j.value.branchOpacity * 40) / 100,
2911
+ x2: ve(s, l, u) - (me(s, l) + le(c).dx) + K("measure", s, l, u).dx,
2912
+ y2: ye(s, l, u) - he(s, l) + K("measure", s, l, u).dy,
2913
+ stroke: e.style?.lineColor || A.value.spineColor || t.color,
2914
+ "stroke-width": A.value.branchWidth * .4,
2915
+ opacity: (e.style?.lineOpacity ?? A.value.branchOpacity * 40) / 100,
2901
2916
  "stroke-dasharray": e.style?.lineStyle === "dashed" ? "3,2" : "none"
2902
2917
  }, null, 8, Tn), a("g", {
2903
- transform: `translate(${ve(s, l, u) - (me(s, l) + le(c).dx) + J("measure", s, l, u).dx}, ${ye(s, l, u) - he(s, l) + J("measure", s, l, u).dy})`,
2904
- onClick: A((t) => _("measure", e.id, s, l, u), ["stop"]),
2905
- onMousedown: (e) => K(e, "measure", s, l, u),
2906
- onMouseup: q,
2918
+ transform: `translate(${ve(s, l, u) - (me(s, l) + le(c).dx) + K("measure", s, l, u).dx}, ${ye(s, l, u) - he(s, l) + K("measure", s, l, u).dy})`,
2919
+ onClick: k((t) => _("measure", e.id, s, l, u), ["stop"]),
2920
+ onMousedown: (e) => Ae(e, "measure", s, l, u),
2921
+ onMouseup: Me,
2907
2922
  onMouseenter: (t) => Le(s, l, u, e),
2908
- onMouseleave: je,
2923
+ onMouseleave: q,
2909
2924
  style: { cursor: "grab" }
2910
2925
  }, [
2911
2926
  n.selectedNode?.id === e.id ? (g(), i("rect", {
2912
2927
  key: 0,
2913
- x: -B(e.text) / 2 - 3,
2914
- y: -(H(e) / 2 + 3),
2915
- width: B(e.text) + 6,
2916
- height: H(e) + 6,
2917
- rx: j.value.causeRadius + 3,
2928
+ x: -z(e.text) / 2 - 3,
2929
+ y: -(V(e) / 2 + 3),
2930
+ width: z(e.text) + 6,
2931
+ height: V(e) + 6,
2932
+ rx: A.value.causeRadius + 3,
2918
2933
  fill: "none",
2919
2934
  stroke: "#409EFF",
2920
2935
  "stroke-width": "2.5"
2921
2936
  }, null, 8, Dn)) : r("", !0),
2922
2937
  a("rect", {
2923
- x: -B(e.text) / 2,
2924
- y: -H(e) / 2,
2925
- width: B(e.text),
2926
- height: H(e),
2927
- rx: j.value.causeRadius,
2938
+ x: -z(e.text) / 2,
2939
+ y: -V(e) / 2,
2940
+ width: z(e.text),
2941
+ height: V(e),
2942
+ rx: A.value.causeRadius,
2928
2943
  fill: Se(s, l, u),
2929
2944
  opacity: (e.style?.opacity ?? 100) / 100,
2930
2945
  stroke: n.selectedNode?.id === e.id ? "#409EFF" : e.style?.borderStyle === "none" ? "none" : e.style?.borderColor || t.color,
2931
2946
  "stroke-width": n.selectedNode?.id === e.id ? 2.5 : e.style?.borderStyle === "none" ? 0 : e.style?.borderWidth ?? 1
2932
2947
  }, null, 8, On),
2933
2948
  a("text", {
2934
- "text-anchor": M(e.style?.textAlign),
2949
+ "text-anchor": te(e.style?.textAlign),
2935
2950
  "dominant-baseline": "middle",
2936
- x: N(e.style?.textAlign, B(e.text)),
2951
+ x: j(e.style?.textAlign, z(e.text)),
2937
2952
  fill: e.style?.textColor || "#263238",
2938
- "font-size": R(s, l, u),
2939
- "font-family": (e.style?.fontFamily || j.value.fontFamily) + ", sans-serif",
2953
+ "font-size": Ce(s, l, u),
2954
+ "font-family": (e.style?.fontFamily || A.value.fontFamily) + ", sans-serif",
2940
2955
  style: { "pointer-events": "none" }
2941
- }, x(Ce(e.text, e.style?.maxChars ?? 15)), 9, kn),
2956
+ }, x(we(e.text, e.style?.maxChars ?? 15)), 9, kn),
2942
2957
  h.value?.id === e.id ? (g(), i("g", {
2943
2958
  key: 1,
2944
2959
  style: { "pointer-events": "auto" },
@@ -2951,120 +2966,120 @@ var He = "/api/document-versions", Ue = 5e3, We = () => {
2951
2966
  },
2952
2967
  onMouseleave: o[8] ||= (e) => h.value = null
2953
2968
  }, [a("g", {
2954
- onClick: A((e) => C(s, l, u), ["stop"]),
2955
- onMousedown: o[6] ||= A(() => {}, ["stop"]),
2969
+ onClick: k((e) => ee(s, l, u), ["stop"]),
2970
+ onMousedown: o[6] ||= k(() => {}, ["stop"]),
2956
2971
  style: { cursor: "pointer" }
2957
2972
  }, [
2958
2973
  a("circle", {
2959
- cx: B(e.text) / 2 - 28,
2960
- cy: -H(e) / 2 - 6,
2974
+ cx: z(e.text) / 2 - 28,
2975
+ cy: -V(e) / 2 - 6,
2961
2976
  r: "6",
2962
2977
  fill: "#67C23A",
2963
2978
  opacity: "0.9"
2964
- }, null, 8, jn),
2979
+ }, null, 8, Mn),
2965
2980
  a("circle", {
2966
- cx: B(e.text) / 2 - 28,
2967
- cy: -H(e) / 2 - 6,
2981
+ cx: z(e.text) / 2 - 28,
2982
+ cy: -V(e) / 2 - 6,
2968
2983
  r: "2",
2969
2984
  fill: "white"
2970
- }, null, 8, Mn),
2985
+ }, null, 8, Nn),
2971
2986
  a("line", {
2972
- x1: B(e.text) / 2 - 28,
2973
- y1: -H(e) / 2 - 6,
2974
- x2: B(e.text) / 2 - 32,
2975
- y2: -H(e) / 2 - 9,
2987
+ x1: z(e.text) / 2 - 28,
2988
+ y1: -V(e) / 2 - 6,
2989
+ x2: z(e.text) / 2 - 32,
2990
+ y2: -V(e) / 2 - 9,
2976
2991
  stroke: "white",
2977
2992
  "stroke-width": "1",
2978
2993
  "stroke-linecap": "round"
2979
- }, null, 8, Nn),
2994
+ }, null, 8, Pn),
2980
2995
  a("line", {
2981
- x1: B(e.text) / 2 - 28,
2982
- y1: -H(e) / 2 - 6,
2983
- x2: B(e.text) / 2 - 32,
2984
- y2: -H(e) / 2 - 3,
2996
+ x1: z(e.text) / 2 - 28,
2997
+ y1: -V(e) / 2 - 6,
2998
+ x2: z(e.text) / 2 - 32,
2999
+ y2: -V(e) / 2 - 3,
2985
3000
  stroke: "white",
2986
3001
  "stroke-width": "1",
2987
3002
  "stroke-linecap": "round"
2988
- }, null, 8, Pn),
3003
+ }, null, 8, Q),
2989
3004
  a("line", {
2990
- x1: B(e.text) / 2 - 28,
2991
- y1: -H(e) / 2 - 6,
2992
- x2: B(e.text) / 2 - 24,
2993
- y2: -H(e) / 2 - 9,
3005
+ x1: z(e.text) / 2 - 28,
3006
+ y1: -V(e) / 2 - 6,
3007
+ x2: z(e.text) / 2 - 24,
3008
+ y2: -V(e) / 2 - 9,
2994
3009
  stroke: "white",
2995
3010
  "stroke-width": "1",
2996
3011
  "stroke-linecap": "round"
2997
3012
  }, null, 8, Fn),
2998
3013
  a("line", {
2999
- x1: B(e.text) / 2 - 28,
3000
- y1: -H(e) / 2 - 6,
3001
- x2: B(e.text) / 2 - 24,
3002
- y2: -H(e) / 2 - 3,
3014
+ x1: z(e.text) / 2 - 28,
3015
+ y1: -V(e) / 2 - 6,
3016
+ x2: z(e.text) / 2 - 24,
3017
+ y2: -V(e) / 2 - 3,
3003
3018
  stroke: "white",
3004
3019
  "stroke-width": "1",
3005
3020
  "stroke-linecap": "round"
3006
3021
  }, null, 8, In),
3007
3022
  a("circle", {
3008
- cx: B(e.text) / 2 - 32,
3009
- cy: -H(e) / 2 - 9,
3023
+ cx: z(e.text) / 2 - 32,
3024
+ cy: -V(e) / 2 - 9,
3010
3025
  r: "1",
3011
3026
  fill: "white"
3012
3027
  }, null, 8, Ln),
3013
3028
  a("circle", {
3014
- cx: B(e.text) / 2 - 32,
3015
- cy: -H(e) / 2 - 3,
3029
+ cx: z(e.text) / 2 - 32,
3030
+ cy: -V(e) / 2 - 3,
3016
3031
  r: "1",
3017
3032
  fill: "white"
3018
3033
  }, null, 8, Rn),
3019
3034
  a("circle", {
3020
- cx: B(e.text) / 2 - 24,
3021
- cy: -H(e) / 2 - 9,
3035
+ cx: z(e.text) / 2 - 24,
3036
+ cy: -V(e) / 2 - 9,
3022
3037
  r: "1",
3023
3038
  fill: "white"
3024
3039
  }, null, 8, zn),
3025
3040
  a("circle", {
3026
- cx: B(e.text) / 2 - 24,
3027
- cy: -H(e) / 2 - 3,
3041
+ cx: z(e.text) / 2 - 24,
3042
+ cy: -V(e) / 2 - 3,
3028
3043
  r: "1",
3029
3044
  fill: "white"
3030
3045
  }, null, 8, Bn)
3031
- ], 40, An), a("g", {
3032
- onClick: A((t) => S("measure", e.id, s), ["stop"]),
3033
- onMousedown: o[7] ||= A(() => {}, ["stop"]),
3046
+ ], 40, jn), a("g", {
3047
+ onClick: k((t) => S("measure", e.id, s), ["stop"]),
3048
+ onMousedown: o[7] ||= k(() => {}, ["stop"]),
3034
3049
  style: { cursor: "pointer" }
3035
3050
  }, [
3036
3051
  a("circle", {
3037
- cx: B(e.text) / 2 - 12,
3038
- cy: -H(e) / 2 - 6,
3052
+ cx: z(e.text) / 2 - 12,
3053
+ cy: -V(e) / 2 - 6,
3039
3054
  r: "6",
3040
3055
  fill: "#F56C6C",
3041
3056
  opacity: "0.9"
3042
3057
  }, null, 8, Hn),
3043
3058
  a("line", {
3044
- x1: B(e.text) / 2 - 15,
3045
- y1: -H(e) / 2 - 9,
3046
- x2: B(e.text) / 2 - 9,
3047
- y2: -H(e) / 2 - 3,
3059
+ x1: z(e.text) / 2 - 15,
3060
+ y1: -V(e) / 2 - 9,
3061
+ x2: z(e.text) / 2 - 9,
3062
+ y2: -V(e) / 2 - 3,
3048
3063
  stroke: "white",
3049
3064
  "stroke-width": "1.5",
3050
3065
  "stroke-linecap": "round"
3051
3066
  }, null, 8, Un),
3052
3067
  a("line", {
3053
- x1: B(e.text) / 2 - 9,
3054
- y1: -H(e) / 2 - 9,
3055
- x2: B(e.text) / 2 - 15,
3056
- y2: -H(e) / 2 - 3,
3068
+ x1: z(e.text) / 2 - 9,
3069
+ y1: -V(e) / 2 - 9,
3070
+ x2: z(e.text) / 2 - 15,
3071
+ y2: -V(e) / 2 - 3,
3057
3072
  stroke: "white",
3058
3073
  "stroke-width": "1.5",
3059
3074
  "stroke-linecap": "round"
3060
3075
  }, null, 8, Wn)
3061
- ], 40, Vn)], 40, Q)) : r("", !0)
3076
+ ], 40, Vn)], 40, An)) : r("", !0)
3062
3077
  ], 40, En)]))), 128))
3063
3078
  ], 40, fn)
3064
3079
  ]))), 128))
3065
3080
  ]))), 128))
3066
3081
  ]))
3067
- ], 44, Pt))]));
3082
+ ], 44, Ft))]));
3068
3083
  }
3069
3084
  }, [["__scopeId", "data-v-52439ed0"]]), Jn = [
3070
3085
  {
@@ -3167,7 +3182,7 @@ var He = "/api/document-versions", Ue = 5e3, We = () => {
3167
3182
  }, rr = { style: {
3168
3183
  "font-size": "12px",
3169
3184
  color: "#909399"
3170
- } }, ir = { class: "size-preview" }, ar = /*#__PURE__*/ V({
3185
+ } }, ir = { class: "size-preview" }, ar = /*#__PURE__*/ B({
3171
3186
  __name: "ExportDialog",
3172
3187
  props: {
3173
3188
  modelValue: Boolean,
@@ -3184,22 +3199,22 @@ var He = "/api/document-versions", Ue = 5e3, We = () => {
3184
3199
  get: () => u.modelValue,
3185
3200
  set: (e) => d("update:modelValue", e)
3186
3201
  }), p = v(u.initialFormat);
3187
- E(() => u.initialFormat, (e) => {
3202
+ T(() => u.initialFormat, (e) => {
3188
3203
  p.value = e;
3189
3204
  });
3190
- let m = v(2), h = v(1), _ = v(!1), C = t(() => [
3205
+ let m = v(2), h = v(1), _ = v(!1), ee = t(() => [
3191
3206
  "svg",
3192
3207
  "png",
3193
3208
  "jpg"
3194
- ].includes(p.value)), w = t(() => {
3209
+ ].includes(p.value)), C = t(() => {
3195
3210
  if (!u.svgElement) return 0;
3196
3211
  let e = u.svgElement.viewBox?.baseVal?.width || 800;
3197
3212
  return Math.round(e * m.value);
3198
- }), T = t(() => {
3213
+ }), w = t(() => {
3199
3214
  if (!u.svgElement) return 0;
3200
3215
  let e = u.svgElement.viewBox?.baseVal?.height || 500;
3201
3216
  return Math.round(e * m.value);
3202
- }), O = async () => {
3217
+ }), D = async () => {
3203
3218
  if (!(!u.svgElement || !u.fishboneData)) {
3204
3219
  _.value = !0;
3205
3220
  try {
@@ -3218,74 +3233,74 @@ var He = "/api/document-versions", Ue = 5e3, We = () => {
3218
3233
  }
3219
3234
  }
3220
3235
  };
3221
- return E(() => u.modelValue, (e) => {
3236
+ return T(() => u.modelValue, (e) => {
3222
3237
  e && (p.value = u.initialFormat, m.value = 2, h.value = 1);
3223
3238
  }), (t, c) => {
3224
- let l = b("el-icon"), u = b("el-radio-button"), d = b("el-radio-group"), v = b("el-form-item"), E = b("el-option"), k = b("el-select"), A = b("el-slider"), j = b("el-form"), M = b("el-button"), N = b("el-dialog");
3225
- return g(), n(N, {
3239
+ let l = b("el-icon"), u = b("el-radio-button"), d = b("el-radio-group"), v = b("el-form-item"), T = b("el-option"), O = b("el-select"), k = b("el-slider"), A = b("el-form"), te = b("el-button"), j = b("el-dialog");
3240
+ return g(), n(j, {
3226
3241
  title: "导出鱼骨图",
3227
3242
  modelValue: f.value,
3228
3243
  "onUpdate:modelValue": c[4] ||= (e) => f.value = e,
3229
3244
  width: "480px",
3230
3245
  "close-on-click-modal": !1
3231
3246
  }, {
3232
- footer: D(() => [s(M, { onClick: c[3] ||= (e) => f.value = !1 }, {
3233
- default: D(() => [...c[10] ||= [o("取消", -1)]]),
3247
+ footer: E(() => [s(te, { onClick: c[3] ||= (e) => f.value = !1 }, {
3248
+ default: E(() => [...c[10] ||= [o("取消", -1)]]),
3234
3249
  _: 1
3235
- }), s(M, {
3250
+ }), s(te, {
3236
3251
  type: "primary",
3237
- onClick: O,
3252
+ onClick: D,
3238
3253
  loading: _.value
3239
3254
  }, {
3240
- default: D(() => [_.value ? r("", !0) : (g(), n(l, { key: 0 }, {
3241
- default: D(() => [s(S(oe))]),
3255
+ default: E(() => [_.value ? r("", !0) : (g(), n(l, { key: 0 }, {
3256
+ default: E(() => [s(S(L))]),
3242
3257
  _: 1
3243
3258
  })), o(" " + x(_.value ? "导出中..." : "导出"), 1)]),
3244
3259
  _: 1
3245
3260
  }, 8, ["loading"])]),
3246
- default: D(() => [s(j, {
3261
+ default: E(() => [s(A, {
3247
3262
  "label-width": "100px",
3248
3263
  "label-position": "left"
3249
3264
  }, {
3250
- default: D(() => [
3265
+ default: E(() => [
3251
3266
  s(v, { label: "导出格式" }, {
3252
- default: D(() => [s(d, {
3267
+ default: E(() => [s(d, {
3253
3268
  modelValue: p.value,
3254
3269
  "onUpdate:modelValue": c[0] ||= (e) => p.value = e,
3255
3270
  class: "format-group"
3256
3271
  }, {
3257
- default: D(() => [
3272
+ default: E(() => [
3258
3273
  s(u, { value: "svg" }, {
3259
- default: D(() => [s(l, null, {
3260
- default: D(() => [s(S(me))]),
3274
+ default: E(() => [s(l, null, {
3275
+ default: E(() => [s(S(he))]),
3261
3276
  _: 1
3262
3277
  }), c[5] ||= o(" SVG ", -1)]),
3263
3278
  _: 1
3264
3279
  }),
3265
3280
  s(u, { value: "png" }, {
3266
- default: D(() => [s(l, null, {
3267
- default: D(() => [s(S(he))]),
3281
+ default: E(() => [s(l, null, {
3282
+ default: E(() => [s(S(ge))]),
3268
3283
  _: 1
3269
3284
  }), c[6] ||= o(" PNG ", -1)]),
3270
3285
  _: 1
3271
3286
  }),
3272
3287
  s(u, { value: "jpg" }, {
3273
- default: D(() => [s(l, null, {
3274
- default: D(() => [s(S(he))]),
3288
+ default: E(() => [s(l, null, {
3289
+ default: E(() => [s(S(ge))]),
3275
3290
  _: 1
3276
3291
  }), c[7] ||= o(" JPG ", -1)]),
3277
3292
  _: 1
3278
3293
  }),
3279
3294
  s(u, { value: "json" }, {
3280
- default: D(() => [s(l, null, {
3281
- default: D(() => [s(S(ae))]),
3295
+ default: E(() => [s(l, null, {
3296
+ default: E(() => [s(S(I))]),
3282
3297
  _: 1
3283
3298
  }), c[8] ||= o(" JSON ", -1)]),
3284
3299
  _: 1
3285
3300
  }),
3286
3301
  s(u, { value: "xml" }, {
3287
- default: D(() => [s(l, null, {
3288
- default: D(() => [s(S(ae))]),
3302
+ default: E(() => [s(l, null, {
3303
+ default: E(() => [s(S(I))]),
3289
3304
  _: 1
3290
3305
  }), c[9] ||= o(" XML ", -1)]),
3291
3306
  _: 1
@@ -3295,16 +3310,16 @@ var He = "/api/document-versions", Ue = 5e3, We = () => {
3295
3310
  }, 8, ["modelValue"])]),
3296
3311
  _: 1
3297
3312
  }),
3298
- C.value ? (g(), n(v, {
3313
+ ee.value ? (g(), n(v, {
3299
3314
  key: 0,
3300
3315
  label: "分辨率"
3301
3316
  }, {
3302
- default: D(() => [s(k, {
3317
+ default: E(() => [s(O, {
3303
3318
  modelValue: m.value,
3304
3319
  "onUpdate:modelValue": c[1] ||= (e) => m.value = e,
3305
3320
  style: { width: "100%" }
3306
3321
  }, {
3307
- default: D(() => [(g(!0), i(e, null, y(S(Jn), (e) => (g(), n(E, {
3322
+ default: E(() => [(g(!0), i(e, null, y(S(Jn), (e) => (g(), n(T, {
3308
3323
  key: e.value,
3309
3324
  label: e.label,
3310
3325
  value: e.value
@@ -3317,7 +3332,7 @@ var He = "/api/document-versions", Ue = 5e3, We = () => {
3317
3332
  key: 1,
3318
3333
  label: "图片质量"
3319
3334
  }, {
3320
- default: D(() => [s(A, {
3335
+ default: E(() => [s(k, {
3321
3336
  modelValue: h.value,
3322
3337
  "onUpdate:modelValue": c[2] ||= (e) => h.value = e,
3323
3338
  min: .1,
@@ -3328,11 +3343,11 @@ var He = "/api/document-versions", Ue = 5e3, We = () => {
3328
3343
  }, null, 8, ["modelValue", "format-tooltip"]), a("span", rr, x(Math.round(h.value * 100)) + "%", 1)]),
3329
3344
  _: 1
3330
3345
  })) : r("", !0),
3331
- C.value ? (g(), n(v, {
3346
+ ee.value ? (g(), n(v, {
3332
3347
  key: 2,
3333
3348
  label: "预览尺寸"
3334
3349
  }, {
3335
- default: D(() => [a("div", ir, [a("span", null, "宽度: " + x(w.value) + "px", 1), a("span", null, "高度: " + x(T.value) + "px", 1)])]),
3350
+ default: E(() => [a("div", ir, [a("span", null, "宽度: " + x(C.value) + "px", 1), a("span", null, "高度: " + x(w.value) + "px", 1)])]),
3336
3351
  _: 1
3337
3352
  })) : r("", !0)
3338
3353
  ]),
@@ -3593,7 +3608,7 @@ var He = "/api/document-versions", Ue = 5e3, We = () => {
3593
3608
  //#endregion
3594
3609
  //#region ../../src/composables/useCollaboration.js
3595
3610
  function cr(e, t = {}) {
3596
- let n = new B.Doc(), r = v(!1), i = v(!1), a = v(null), o = v([]), s = v(!1), c = _({
3611
+ let n = new z.Doc(), r = v(!1), i = v(!1), a = v(null), o = v([]), s = v(!1), c = _({
3597
3612
  name: `用户${Math.floor(Math.random() * 1e3)}`,
3598
3613
  color: `#${Math.floor(Math.random() * 16777215).toString(16).padStart(6, "0")}`
3599
3614
  }), l = null, u = null, d = null, f = () => {
@@ -3607,7 +3622,7 @@ function cr(e, t = {}) {
3607
3622
  }, p = () => {
3608
3623
  u &&= (clearInterval(u), null);
3609
3624
  }, m = (t, c) => {
3610
- l && g(), l = new Ce({
3625
+ l && g(), l = new we({
3611
3626
  url: c || `ws://${window.location.hostname}:1234`,
3612
3627
  name: t || (typeof e == "object" ? e.value : e),
3613
3628
  document: n,
@@ -3719,9 +3734,9 @@ function cr(e, t = {}) {
3719
3734
  let r = n.getMap(e);
3720
3735
  return r.observe(t), () => r.unobserve(t);
3721
3736
  },
3722
- encodeState: () => B.encodeStateAsUpdate(n),
3737
+ encodeState: () => z.encodeStateAsUpdate(n),
3723
3738
  decodeState: (e) => {
3724
- B.applyUpdate(n, e);
3739
+ z.applyUpdate(n, e);
3725
3740
  },
3726
3741
  getDocId: () => n.clientID
3727
3742
  };
@@ -3729,13 +3744,13 @@ function cr(e, t = {}) {
3729
3744
  //#endregion
3730
3745
  //#region ../../src/composables/useFishboneSync.js
3731
3746
  var lr = (e, n, r, i) => {
3732
- let { doc: a, isConnected: o, isSynced: s, peers: c, awareness: l, setLocalUser: u, connect: d, disconnect: f, closeCollaboration: p, checkCollaborationClosed: m, collaborationClosed: h, syncToYjs: g, onRemoteChange: _ } = cr(e), v = s, y = c, b = !1, x = !1, S = null, C = (e = {}) => {
3747
+ let { doc: a, isConnected: o, isSynced: s, peers: c, awareness: l, setLocalUser: u, connect: d, disconnect: f, closeCollaboration: p, checkCollaborationClosed: m, collaborationClosed: h, syncToYjs: g, onRemoteChange: _ } = cr(e), v = s, y = c, b = !1, x = !1, S = null, ee = (e = {}) => {
3733
3748
  u({
3734
3749
  name: e.name || `用户${Math.floor(Math.random() * 1e3)}`,
3735
- color: e.color || w(),
3750
+ color: e.color || C(),
3736
3751
  ...e
3737
3752
  });
3738
- }, w = () => {
3753
+ }, C = () => {
3739
3754
  let e = [
3740
3755
  "#409EFF",
3741
3756
  "#67C23A",
@@ -3751,7 +3766,7 @@ var lr = (e, n, r, i) => {
3751
3766
  "#8E44AD"
3752
3767
  ];
3753
3768
  return e[Math.floor(Math.random() * e.length)];
3754
- }, T = () => {
3769
+ }, w = () => {
3755
3770
  let e = n.value;
3756
3771
  return {
3757
3772
  title: e.title,
@@ -3765,13 +3780,13 @@ var lr = (e, n, r, i) => {
3765
3780
  textBoxes: r ? r.value : [],
3766
3781
  arrowLines: i ? i.value : []
3767
3782
  };
3783
+ }, E = () => {
3784
+ b || x && o.value && g("fishbone", w());
3768
3785
  }, D = () => {
3769
- b || x && o.value && g("fishbone", T());
3786
+ S && clearTimeout(S), S = setTimeout(E, 100);
3770
3787
  }, O = () => {
3771
- S && clearTimeout(S), S = setTimeout(D, 100);
3788
+ T(() => n.value.title, () => D()), T(() => n.value.effect, () => D()), T(() => n.value.author, () => D()), T(() => n.value.theme, () => D()), T(() => n.value.diagramStyle, () => D()), T(() => n.value.categories, () => D(), { deep: !0 }), T(() => n.value.titleStyle, () => D(), { deep: !0 }), r && T(() => r.value, () => D(), { deep: !0 }), i && T(() => i.value, () => D(), { deep: !0 });
3772
3789
  }, k = () => {
3773
- E(() => n.value.title, () => O()), E(() => n.value.effect, () => O()), E(() => n.value.author, () => O()), E(() => n.value.theme, () => O()), E(() => n.value.diagramStyle, () => O()), E(() => n.value.categories, () => O(), { deep: !0 }), E(() => n.value.titleStyle, () => O(), { deep: !0 }), r && E(() => r.value, () => O(), { deep: !0 }), i && E(() => i.value, () => O(), { deep: !0 });
3774
- }, A = () => {
3775
3790
  _("fishbone", (e) => {
3776
3791
  e && (b = !0, Object.assign(n.value, {
3777
3792
  title: e.title,
@@ -3784,28 +3799,28 @@ var lr = (e, n, r, i) => {
3784
3799
  meta: e.meta
3785
3800
  }), r && e.textBoxes && (r.value = e.textBoxes), i && e.arrowLines && (i.value = e.arrowLines), b = !1);
3786
3801
  });
3787
- }, j = t(() => ({
3802
+ }, A = t(() => ({
3788
3803
  isConnected: o.value,
3789
3804
  isSynced: v.value,
3790
3805
  onlineCount: y.value.length
3791
3806
  }));
3792
- return k(), A(), {
3807
+ return O(), k(), {
3793
3808
  doc: a,
3794
3809
  isConnected: o,
3795
3810
  isSynced: s,
3796
3811
  awareness: l,
3797
3812
  syncStatus: v,
3798
3813
  onlineUsers: y,
3799
- connectionStatus: j,
3814
+ connectionStatus: A,
3800
3815
  collaborationClosed: h,
3801
- initUser: C,
3816
+ initUser: ee,
3802
3817
  connect: d,
3803
3818
  disconnect: f,
3804
3819
  closeCollaboration: p,
3805
3820
  checkCollaborationClosed: m,
3806
3821
  destroy: f,
3807
3822
  startSync: () => {
3808
- x = !0, g("fishbone", T());
3823
+ x = !0, g("fishbone", w());
3809
3824
  },
3810
3825
  enableLocalPush: () => {
3811
3826
  x = !0;
@@ -3814,225 +3829,281 @@ var lr = (e, n, r, i) => {
3814
3829
  x = !1, S &&= (clearTimeout(S), null);
3815
3830
  }
3816
3831
  };
3817
- }, ur = z.create({
3832
+ };
3833
+ N.create({
3818
3834
  baseURL: "/api",
3819
3835
  timeout: 3e4
3820
- }), dr = {
3821
- list: (e) => ur.get("/documents/", { params: e }),
3822
- get: (e) => ur.get(`/documents/${e}`),
3823
- create: (e) => ur.post("/documents/", e),
3824
- update: (e, t) => ur.put(`/documents/${e}`, t),
3825
- delete: (e) => ur.delete(`/documents/${e}`),
3826
- addAttachment: (e, t) => ur.post(`/documents/${e}/attachments`, t),
3827
- listAttachments: (e) => ur.get(`/documents/${e}/attachments`)
3828
- };
3836
+ });
3837
+ function ur(e = "/api") {
3838
+ let t = N.create({
3839
+ baseURL: e,
3840
+ timeout: 3e4
3841
+ });
3842
+ return {
3843
+ list: (e) => t.get("/documents/", { params: e }),
3844
+ get: (e) => t.get(`/documents/${e}`),
3845
+ create: (e) => t.post("/documents/", e),
3846
+ update: (e, n) => t.put(`/documents/${e}`, n),
3847
+ delete: (e) => t.delete(`/documents/${e}`),
3848
+ addAttachment: (e, n) => t.post(`/documents/${e}/attachments`, n),
3849
+ listAttachments: (e) => t.get(`/documents/${e}/attachments`)
3850
+ };
3851
+ }
3852
+ function dr(e = "/api") {
3853
+ let t = N.create({
3854
+ baseURL: e,
3855
+ timeout: 3e4
3856
+ });
3857
+ return {
3858
+ get: (e) => t.get(`/questionnaires/${e}`),
3859
+ create: (e) => t.post("/questionnaires/", e),
3860
+ update: (e, n) => t.put(`/questionnaires/${e}`, n)
3861
+ };
3862
+ }
3863
+ dr("/api");
3864
+ var fr = ur("/api");
3829
3865
  (/* @__PURE__ */ new Date()).toISOString(), (/* @__PURE__ */ new Date()).toISOString();
3830
3866
  //#endregion
3831
3867
  //#region ../../src/views/FishboneEditor.vue
3832
- var fr = { class: "editor-main" }, pr = { class: "panel-toggle-icon" }, mr = { class: "panel-content" }, hr = ["onClick"], gr = { class: "category-name" }, _r = { class: "cause-count" }, vr = {
3868
+ var pr = { class: "editor-main" }, mr = { class: "panel-toggle-icon" }, hr = { class: "panel-content" }, gr = ["onClick"], _r = { class: "category-name" }, vr = { class: "cause-count" }, yr = {
3833
3869
  key: 0,
3834
3870
  class: "diagram-effect"
3835
- }, yr = [
3871
+ }, br = [
3836
3872
  "data-textbox-id",
3837
3873
  "onMousedown",
3838
3874
  "onDblclick"
3839
- ], br = [
3875
+ ], xr = [
3840
3876
  "onUpdate:modelValue",
3841
3877
  "readonly",
3842
3878
  "onBlur"
3843
- ], xr = ["onMousedown"], Sr = ["onMousedown"], Cr = ["onMousedown"], wr = ["onMousedown"], Tr = ["onClick"], Er = ["viewBox"], Dr = ["id"], Or = ["fill"], kr = ["id"], Ar = ["fill"], jr = { key: 0 }, Mr = [
3879
+ ], Sr = ["onMousedown"], Cr = ["onMousedown"], wr = ["onMousedown"], Tr = ["onMousedown"], Er = ["onClick"], Dr = ["viewBox"], Or = ["id"], kr = ["fill"], Ar = ["id"], jr = ["fill"], Mr = { key: 0 }, Nr = [
3844
3880
  "cx",
3845
3881
  "cy",
3846
3882
  "onMouseenter",
3847
3883
  "onMousedown"
3848
- ], Nr = { key: 0 }, Pr = [
3884
+ ], Pr = { key: 0 }, Fr = [
3849
3885
  "cx",
3850
3886
  "cy",
3851
3887
  "onMouseenter",
3852
3888
  "onMousedown"
3853
- ], Fr = [
3889
+ ], Ir = [
3854
3890
  "d",
3855
3891
  "stroke",
3856
3892
  "stroke-width",
3857
3893
  "stroke-dasharray",
3858
3894
  "marker-end",
3859
3895
  "marker-start"
3860
- ], Ir = [
3896
+ ], Lr = [
3861
3897
  "d",
3862
3898
  "stroke-width",
3863
3899
  "onMousedown"
3864
- ], Lr = [
3900
+ ], Rr = [
3865
3901
  "cx",
3866
3902
  "cy",
3867
3903
  "onMousedown"
3868
- ], Rr = [
3904
+ ], zr = [
3869
3905
  "cx",
3870
3906
  "cy",
3871
3907
  "onMousedown"
3872
- ], zr = ["cx", "cy"], Br = ["cx", "cy"], Vr = [
3908
+ ], Br = ["cx", "cy"], Vr = ["cx", "cy"], Hr = [
3873
3909
  "x1",
3874
3910
  "y1",
3875
3911
  "x2",
3876
3912
  "y2"
3877
- ], Hr = [
3913
+ ], Ur = [
3878
3914
  "x1",
3879
3915
  "y1",
3880
3916
  "x2",
3881
3917
  "y2"
3882
- ], Ur = [
3918
+ ], Wr = [
3883
3919
  "x1",
3884
3920
  "y1",
3885
3921
  "x2",
3886
3922
  "y2"
3887
- ], Wr = [
3923
+ ], Gr = [
3888
3924
  "cx",
3889
3925
  "cy",
3890
3926
  "onMousedown"
3891
- ], Gr = ["transform", "onClick"], Kr = { class: "panel-content" }, qr = {
3927
+ ], Kr = ["transform", "onClick"], qr = { class: "panel-content" }, Jr = {
3892
3928
  key: 0,
3893
3929
  class: "detail-form"
3894
- }, Jr = {
3930
+ }, Yr = {
3895
3931
  key: 1,
3896
3932
  class: "detail-form"
3897
- }, Yr = ["value"], Xr = { class: "children-list" }, Zr = {
3933
+ }, Xr = ["value"], Zr = { class: "children-list" }, Qr = {
3898
3934
  key: 1,
3899
3935
  class: "detail-form"
3900
- }, Qr = {
3936
+ }, $r = {
3901
3937
  key: 2,
3902
3938
  class: "detail-form"
3903
- }, $r = {
3939
+ }, ei = {
3904
3940
  key: 0,
3905
3941
  style: {
3906
3942
  display: "flex",
3907
3943
  "align-items": "center",
3908
3944
  gap: "8px"
3909
3945
  }
3910
- }, ei = {
3946
+ }, ti = {
3911
3947
  key: 1,
3912
3948
  style: {
3913
3949
  color: "#909399",
3914
3950
  "font-size": "12px"
3915
3951
  }
3916
- }, ti = {
3952
+ }, ni = {
3917
3953
  key: 0,
3918
3954
  style: {
3919
3955
  display: "flex",
3920
3956
  "align-items": "center",
3921
3957
  gap: "8px"
3922
3958
  }
3923
- }, ni = {
3959
+ }, ri = {
3924
3960
  key: 1,
3925
3961
  style: {
3926
3962
  color: "#909399",
3927
3963
  "font-size": "12px"
3928
3964
  }
3929
- }, ri = {
3965
+ }, ii = {
3930
3966
  key: 3,
3931
3967
  class: "no-selection"
3932
- }, ii = "fishbone", ai = /*#__PURE__*/ V({
3968
+ }, ai = "fishbone", oi = /*#__PURE__*/ B({
3933
3969
  __name: "FishboneEditor",
3970
+ props: {
3971
+ docId: {
3972
+ type: [Number, String],
3973
+ default: null
3974
+ },
3975
+ apiBase: {
3976
+ type: String,
3977
+ default: "/api"
3978
+ },
3979
+ saveApi: {
3980
+ type: [String, Function],
3981
+ default: null
3982
+ },
3983
+ loadApi: {
3984
+ type: [String, Function],
3985
+ default: null
3986
+ },
3987
+ wsUrl: {
3988
+ type: String,
3989
+ default: ""
3990
+ },
3991
+ user: {
3992
+ type: Object,
3993
+ default: null
3994
+ },
3995
+ uiConfig: {
3996
+ type: Object,
3997
+ default: () => ({})
3998
+ }
3999
+ },
3934
4000
  setup(n) {
3935
- let c = N(), l = M(), h = v(!1), _ = v(!1), { saveVersion: k } = We(), j = Ve(), te = v(l.params.id || `fishbone-${Date.now()}`), { fishboneData: F, selectedNode: I, selectedNodeType: L, history: ne, historyIndex: re, addCategory: ae, updateCategory: oe, deleteCategory: se, addCause: ce, updateCause: ue, deleteCause: de, addChild: fe, updateChild: me, deleteChild: he, selectNode: _e, clearSelection: ve, undo: ye, redo: be, saveHistory: xe } = sr(), Se = () => {
3936
- ve(), z.value = null, B.value = null, K.value = null;
3937
- }, R = v([]), z = v(null), B = v(null), Ce = v(!1), V = v(!1), H = v(null), U = v(""), we = v(0), Te = v(0), Ee = v(0), De = v(0), Oe = v(0), W = v(0), ke = v(!1), G = v([]), K = v(null), Ae = v(null), q = v(!1), J = v(!1), je = v(!1), Me = v(""), Ne = v(0), Pe = v(0), { isConnected: Fe, isSynced: Ie, onlineUsers: Le, doc: Re, awareness: ze, initUser: He, connect: Ue, disconnect: Ge, closeCollaboration: Ke, checkCollaborationClosed: qe, collaborationClosed: Je, startSync: Ye, enableLocalPush: Xe, stopSync: Ze } = lr(te.value, F, R, G), Qe = v(!1), $e = v(!1), et = v(!1), tt = v([]), rt = null, it = () => {
4001
+ let c = j(), l = te(), h = n, _ = t(() => ({
4002
+ backButton: "show",
4003
+ titleEditable: !0,
4004
+ authorEditable: !0,
4005
+ ...h.uiConfig
4006
+ })), O = t(() => h.docId ?? l.params.id), A = t(() => h.apiBase && h.apiBase !== "/api" ? ur(h.apiBase) : fr), re = v(!1), ie = v(!1), { saveVersion: ae } = We(), P = Ve(), oe = v(O.value || `fishbone-${Date.now()}`), { fishboneData: F, selectedNode: I, selectedNodeType: L, history: ce, historyIndex: le, addCategory: de, updateCategory: fe, deleteCategory: pe, addCause: he, updateCause: ge, deleteCause: ve, addChild: ye, updateChild: be, deleteChild: xe, selectNode: Se, clearSelection: Ce, undo: R, redo: z, saveHistory: we } = sr(), B = () => {
4007
+ Ce(), H.value = null, U.value = null, J.value = null;
4008
+ }, V = v([]), H = v(null), U = v(null), Te = v(!1), Ee = v(!1), W = v(null), De = v(""), G = v(0), Oe = v(0), ke = v(0), Ae = v(0), je = v(0), Me = v(0), K = v(!1), q = v([]), J = v(null), Ne = v(null), Pe = v(!1), Fe = v(!1), Ie = v(!1), Le = v(""), Re = v(0), ze = v(0), { isConnected: He, isSynced: Ue, onlineUsers: Ge, doc: Ke, awareness: qe, initUser: Je, connect: Ye, disconnect: Xe, closeCollaboration: Ze, checkCollaborationClosed: Qe, collaborationClosed: $e, startSync: et, enableLocalPush: tt, stopSync: rt } = lr(oe.value, F, V, q), it = v(!1), at = v(!1), ot = v(!1), st = v([]), ct = null, lt = () => {
3938
4009
  if (!F.value.title?.trim()) {
3939
- P.warning("请输入标题");
4010
+ M.warning("请输入标题");
3940
4011
  return;
3941
4012
  }
3942
- let e = te.value;
3943
- Ue(e);
3944
- let t = `用户${Math.floor(Math.random() * 1e3)}`;
3945
- He({ name: t });
3946
- let n = ze.value;
4013
+ let e = oe.value;
4014
+ Ye(e, h.wsUrl || void 0);
4015
+ let t = h.user?.name || `用户${Math.floor(Math.random() * 1e3)}`;
4016
+ Je({ name: t });
4017
+ let n = qe.value;
3947
4018
  n.on("change", () => {
3948
- tt.value = Array.from(n.getStates().entries()).filter(([e, t]) => t.user).map(([e, t]) => ({
4019
+ st.value = Array.from(n.getStates().entries()).filter(([e, t]) => t.user).map(([e, t]) => ({
3949
4020
  clientId: e,
3950
4021
  ...t.user
3951
4022
  }));
3952
- }), j.setCollabContext({
3953
- ydoc: Re,
4023
+ }), P.setCollabContext({
4024
+ ydoc: Ke,
3954
4025
  provider: null,
3955
- onlineUsers: tt
3956
- }), j.setCurrentUser({
4026
+ onlineUsers: st
4027
+ }), P.setCurrentUser({
3957
4028
  id: n.clientID,
3958
4029
  name: t,
3959
4030
  color: `#${Math.floor(Math.random() * 16777215).toString(16).padStart(6, "0")}`
3960
- }), Qe.value = !0, $e.value = !0, et.value = !1, rt = setInterval(() => {
3961
- Fe.value && Le.value;
4031
+ }), it.value = !0, at.value = !0, ot.value = !1, ct = setInterval(() => {
4032
+ He.value && Ge.value;
3962
4033
  }, 5e3);
3963
4034
  let r = () => {
3964
- Ye();
4035
+ et();
3965
4036
  };
3966
- if (Ie.value) r();
4037
+ if (Ue.value) r();
3967
4038
  else {
3968
- let e = E(() => Ie.value, (t) => {
4039
+ let e = T(() => Ue.value, (t) => {
3969
4040
  t && (e(), r());
3970
4041
  });
3971
4042
  }
3972
4043
  let i = `${window.location.origin}/fishbone-editor/${e}?collab=1`;
3973
4044
  navigator.clipboard.writeText(i).then(() => {
3974
- P.success("协作已开启,分享链接已复制");
4045
+ M.success("协作已开启,分享链接已复制");
3975
4046
  }).catch(() => {
3976
- P.success("协作已开启");
4047
+ M.success("协作已开启");
3977
4048
  });
3978
- }, at = () => {
3979
- rt &&= (clearInterval(rt), null), Ze(), Ke(), Qe.value = !1, $e.value = !1, et.value = !1, P.info("协作已关闭");
3980
- }, ot = async () => {
3981
- let e = l.params.id;
4049
+ }, dt = () => {
4050
+ ct &&= (clearInterval(ct), null), rt(), Ze(), it.value = !1, at.value = !1, ot.value = !1, M.info("协作已关闭");
4051
+ }, ft = async () => {
4052
+ let e = O.value;
3982
4053
  if (!e) return;
3983
- Ue(e);
3984
- let t = `协作人${Math.floor(Math.random() * 1e3)}`;
3985
- He({ name: t });
3986
- let n = ze.value;
4054
+ Ye(e, h.wsUrl || void 0);
4055
+ let t = h.user?.name || `协作人${Math.floor(Math.random() * 1e3)}`;
4056
+ Je({ name: t });
4057
+ let n = qe.value;
3987
4058
  n.on("change", () => {
3988
- tt.value = Array.from(n.getStates().entries()).filter(([e, t]) => t.user).map(([e, t]) => ({
4059
+ st.value = Array.from(n.getStates().entries()).filter(([e, t]) => t.user).map(([e, t]) => ({
3989
4060
  clientId: e,
3990
4061
  ...t.user
3991
4062
  }));
3992
- }), j.setCollabContext({
3993
- ydoc: Re,
4063
+ }), P.setCollabContext({
4064
+ ydoc: Ke,
3994
4065
  provider: null,
3995
- onlineUsers: tt
3996
- }), j.setCurrentUser({
4066
+ onlineUsers: st
4067
+ }), P.setCurrentUser({
3997
4068
  id: n.clientID,
3998
4069
  name: t,
3999
4070
  color: `#${Math.floor(Math.random() * 16777215).toString(16).padStart(6, "0")}`
4000
4071
  });
4001
4072
  let r = (e) => {
4002
4073
  if (e) {
4003
- if (qe()) return Ge(), Qe.value = !1, et.value = !1, P.warning("该协作已关闭,无法加入"), !0;
4004
- Xe();
4074
+ if (Qe()) return Xe(), it.value = !1, ot.value = !1, M.warning("该协作已关闭,无法加入"), !0;
4075
+ tt();
4005
4076
  }
4006
4077
  return !1;
4007
4078
  };
4008
- if (Ie.value) r(!0);
4079
+ if (Ue.value) r(!0);
4009
4080
  else {
4010
- let e = E(() => Ie.value, (t) => {
4081
+ let e = T(() => Ue.value, (t) => {
4011
4082
  e(), r(t);
4012
4083
  });
4013
4084
  }
4014
- Qe.value = !0, et.value = !0, $e.value = !1, rt = setInterval(() => {
4015
- Fe.value && Le.value;
4085
+ it.value = !0, ot.value = !0, at.value = !1, ct = setInterval(() => {
4086
+ He.value && Ge.value;
4016
4087
  }, 5e3);
4017
- }, st = () => {
4018
- Qe.value ? at() : it();
4019
- }, ct = async () => {
4020
- if (!Qe.value) {
4021
- it();
4088
+ }, pt = () => {
4089
+ it.value ? dt() : lt();
4090
+ }, mt = async () => {
4091
+ if (!it.value) {
4092
+ lt();
4022
4093
  return;
4023
4094
  }
4024
- let e = `${window.location.origin}/fishbone-editor/${te.value}?collab=1`;
4095
+ let e = `${window.location.origin}/fishbone-editor/${oe.value}?collab=1`;
4025
4096
  try {
4026
- await navigator.clipboard.writeText(e), P.success("分享链接已复制到剪贴板");
4097
+ await navigator.clipboard.writeText(e), M.success("分享链接已复制到剪贴板");
4027
4098
  } catch {
4028
- P.info(`分享链接: ${e}`);
4099
+ M.info(`分享链接: ${e}`);
4029
4100
  }
4030
- }, lt = v(null), dt = v(null), ft = v(100), pt = v(!1), mt = v(null), ht = v("png"), Y = t(() => K.value && G.value.find((e) => e.id === K.value) || null), gt = v(!1);
4101
+ }, ht = v(null), gt = v(null), _t = v(100), vt = v(!1), yt = v(null), bt = v("png"), Y = t(() => J.value && q.value.find((e) => e.id === J.value) || null), xt = v(!1);
4031
4102
  v("");
4032
- let _t = v(!1), vt = v(null), yt = t(() => {
4103
+ let St = v(!1), Ct = v(null), wt = t(() => {
4033
4104
  let e = [], t = F.value.categories || [], n = Math.max(t.length, 1), r = Math.max(600, n * 130) / (n + 1), i = (ut.find((e) => e.id === F.value.diagramStyle) || ut[0]).nodeHeight || 36;
4034
4105
  return t.forEach((t, n) => {
4035
- let a = 150 + r * (n + 1), o = n % 2 == 0 ? 100 - (i / 2 + 8) : 400 + (i / 2 + 8), s = Mt(t.name, "category"), c = (t.style?.fontSize ?? 12) * 2 + 8, l = t.style?.dragDx || 0, u = t.style?.dragDy || 0, d = t.style?.anchorDx || 0, f = a + 30 + l, p = o + u;
4106
+ let a = 150 + r * (n + 1), o = n % 2 == 0 ? 100 - (i / 2 + 8) : 400 + (i / 2 + 8), s = Nt(t.name, "category"), c = (t.style?.fontSize ?? 12) * 2 + 8, l = t.style?.dragDx || 0, u = t.style?.dragDy || 0, d = t.style?.anchorDx || 0, f = a + 30 + l, p = o + u;
4036
4107
  e.push({
4037
4108
  id: t.id,
4038
4109
  type: "node",
@@ -4062,7 +4133,7 @@ var fr = { class: "editor-main" }, pr = { class: "panel-toggle-icon" }, mr = { c
4062
4133
  });
4063
4134
  let m = t.causes || [], h = (t.style?.fontSize ?? 12) - 2, g = a + d, _ = a + 30 + l, v = n % 2 == 0 ? 100 : 400;
4064
4135
  m.forEach((t, n) => {
4065
- let r = Mt(t.text, "cause"), i = h * 2 + 6, a = t.style?.dragDx || 0, o = t.style?.dragDy || 0, s = m.length === 1 ? .5 : (n + 1) / (m.length + 1), c = t.style?.anchorT ?? s, l = g + (_ - g) * c, u = 250 + (v - 250) * c, d = t.direction || "left", f = l + (d === "left" ? -35 : 35) + a, p = u + o;
4136
+ let r = Nt(t.text, "cause"), i = h * 2 + 6, a = t.style?.dragDx || 0, o = t.style?.dragDy || 0, s = m.length === 1 ? .5 : (n + 1) / (m.length + 1), c = t.style?.anchorT ?? s, l = g + (_ - g) * c, u = 250 + (v - 250) * c, d = t.direction || "left", f = l + (d === "left" ? -35 : 35) + a, p = u + o;
4066
4137
  e.push({
4067
4138
  id: t.id,
4068
4139
  type: "node",
@@ -4092,7 +4163,7 @@ var fr = { class: "editor-main" }, pr = { class: "panel-toggle-icon" }, mr = { c
4092
4163
  });
4093
4164
  let y = t.children || [], b = Math.max(8, h - 2);
4094
4165
  y.forEach((t, n) => {
4095
- let i = Mt(t.text, "cause"), a = b * 2 + 6, o = t.style?.dragDx || 0, s = t.style?.dragDy || 0, c = d === "left" ? f - r / 2 : f + r / 2, l = d === "left" ? c - (25 + n * 45) : c + (25 + n * 45), u = p + n * 25, m = l + o, h = u + s;
4166
+ let i = Nt(t.text, "cause"), a = b * 2 + 6, o = t.style?.dragDx || 0, s = t.style?.dragDy || 0, c = d === "left" ? f - r / 2 : f + r / 2, l = d === "left" ? c - (25 + n * 45) : c + (25 + n * 45), u = p + n * 25, m = l + o, h = u + s;
4096
4167
  e.push({
4097
4168
  id: t.id,
4098
4169
  type: "node",
@@ -4123,33 +4194,33 @@ var fr = { class: "editor-main" }, pr = { class: "panel-toggle-icon" }, mr = { c
4123
4194
  });
4124
4195
  });
4125
4196
  }), e;
4126
- }), bt = t(() => {
4127
- if (dt.value) {
4128
- let e = dt.value.getViewBox();
4197
+ }), Tt = t(() => {
4198
+ if (gt.value) {
4199
+ let e = gt.value.getViewBox();
4129
4200
  if (e && e.w > 0 && e.h > 0) return `${e.x} ${e.y} ${e.w} ${e.h}`;
4130
4201
  }
4131
4202
  let e = F.value.categories || [], t = Math.max(e.length, 1), n = Math.max(600, t * 130), r = 150 + n, i = ut.find((e) => e.id === F.value.diagramStyle) || ut[0], a = i.nodeHeight || 36;
4132
4203
  i.causeHeight;
4133
4204
  let o = 30, s = 100, c = 250, l = 250;
4134
4205
  return c = Math.min(c, 180), l = Math.max(l, 320), s = Math.max(s, r + 120), e.forEach((e, r) => {
4135
- let i = 150 + n / (t + 1) * (r + 1), u = r % 2 == 0 ? 100 - (a / 2 + 8) : 400 + (a / 2 + 8), d = Mt(e.name, "category") / 2 + 20, f = r % 2 == 0 ? 100 : 400;
4206
+ let i = 150 + n / (t + 1) * (r + 1), u = r % 2 == 0 ? 100 - (a / 2 + 8) : 400 + (a / 2 + 8), d = Nt(e.name, "category") / 2 + 20, f = r % 2 == 0 ? 100 : 400;
4136
4207
  o = Math.min(o, i + 30 - d), s = Math.max(s, i + 30 + d + 40), c = Math.min(c, f, u - a / 2), l = Math.max(l, f, u + a / 2);
4137
4208
  }), `${o - 60} ${c - 60} ${s - o + 120} ${l - c + 120}`;
4138
- }), xt = (e) => rn({
4209
+ }), Et = (e) => ln({
4139
4210
  x: 0,
4140
4211
  y: 0,
4141
4212
  width: e.width,
4142
4213
  height: e.height
4143
- }, 60).map((t) => Ct(e.x + t.x, e.y + t.y)), St = t(() => {
4144
- let e = bt.value.split(" ").map(Number);
4214
+ }, 60).map((t) => Ot(e.x + t.x, e.y + t.y)), Dt = t(() => {
4215
+ let e = Tt.value.split(" ").map(Number);
4145
4216
  return {
4146
4217
  x: e[0] || 0,
4147
4218
  y: e[1] || 0,
4148
4219
  w: e[2] || 800,
4149
4220
  h: e[3] || 500
4150
4221
  };
4151
- }), Ct = (e, t) => {
4152
- let n = dt.value?.getSvgElement(), r = lt.value?.querySelector(".canvas-wrapper");
4222
+ }), Ot = (e, t) => {
4223
+ let n = gt.value?.getSvgElement(), r = ht.value?.querySelector(".canvas-wrapper");
4153
4224
  if (n && r) {
4154
4225
  let i = r.getBoundingClientRect(), a = e + i.left, o = t + i.top, s = n.createSVGPoint();
4155
4226
  s.x = a, s.y = o;
@@ -4162,7 +4233,7 @@ var fr = { class: "editor-main" }, pr = { class: "panel-toggle-icon" }, mr = { c
4162
4233
  };
4163
4234
  }
4164
4235
  }
4165
- let i = St.value;
4236
+ let i = Dt.value;
4166
4237
  return {
4167
4238
  x: e / X.value.width * i.w + i.x,
4168
4239
  y: t / X.value.height * i.h + i.y
@@ -4170,11 +4241,11 @@ var fr = { class: "editor-main" }, pr = { class: "panel-toggle-icon" }, mr = { c
4170
4241
  }, X = v({
4171
4242
  width: 800,
4172
4243
  height: 600
4173
- }), wt = v({
4244
+ }), kt = v({
4174
4245
  width: 800,
4175
4246
  height: 600
4176
- }), Tt = () => {
4177
- let e = lt.value?.querySelector(".canvas-wrapper");
4247
+ }), jt = () => {
4248
+ let e = ht.value?.querySelector(".canvas-wrapper");
4178
4249
  return e ? {
4179
4250
  width: e.scrollWidth || e.offsetWidth || 800,
4180
4251
  height: e.scrollHeight || e.offsetHeight || 600
@@ -4182,7 +4253,7 @@ var fr = { class: "editor-main" }, pr = { class: "panel-toggle-icon" }, mr = { c
4182
4253
  width: 800,
4183
4254
  height: 600
4184
4255
  };
4185
- }, Et = t(() => {
4256
+ }, Mt = t(() => {
4186
4257
  let e = {
4187
4258
  ocean: {
4188
4259
  primary: "#1E90FF",
@@ -4396,35 +4467,35 @@ var fr = { class: "editor-main" }, pr = { class: "panel-toggle-icon" }, mr = { c
4396
4467
  }
4397
4468
  };
4398
4469
  return e[F.value.theme] || e.ocean;
4399
- }), Dt = v(!1), Ot = t(() => !!I.value || L.value === "title" || !!z.value || !!K.value), Z = t(() => z.value && R.value.find((e) => e.id === z.value) || null), At = t(() => !!I.value || !!z.value), jt = t(() => {
4470
+ }), Pt = v(!1), Ft = t(() => !!I.value || L.value === "title" || !!H.value || !!J.value), Z = t(() => H.value && V.value.find((e) => e.id === H.value) || null), It = t(() => !!I.value || !!H.value), Lt = t(() => {
4400
4471
  let e = F.value.titleStyle, t = { textAlign: e.textAlign }, n = e.bgColor, r = e.bgOpacity;
4401
4472
  return n && r > 0 && (n.startsWith("#") && n.length >= 7 ? t.backgroundColor = `rgba(${parseInt(n.slice(1, 3), 16)}, ${parseInt(n.slice(3, 5), 16)}, ${parseInt(n.slice(5, 7), 16)}, ${r / 100})` : n.startsWith("rgb") && (t.backgroundColor = n)), t;
4402
- }), Nt = t(() => {
4473
+ }), Rt = t(() => {
4403
4474
  let e = F.value.titleStyle;
4404
4475
  return {
4405
4476
  fontFamily: e.fontFamily,
4406
4477
  fontSize: e.fontSize + "px",
4407
4478
  color: e.color
4408
4479
  };
4409
- }), Pt = () => {
4480
+ }), zt = () => {
4410
4481
  document.activeElement?.blur(), u(() => document.activeElement?.blur()), I.value = { ...F.value.titleStyle }, L.value = "title";
4411
- }, Ft = () => {
4412
- c.push("/");
4413
- }, It = async (e) => {
4414
- P.info("AI生成功能开发中,敬请期待...");
4415
- }, Lt = () => {
4416
- _e(ae(), "category"), P.success("类别已添加");
4417
- }, Rt = async (e) => {
4482
+ }, Bt = () => {
4483
+ h.docId || c.push("/");
4484
+ }, Vt = async (e) => {
4485
+ M.info("AI生成功能开发中,敬请期待...");
4486
+ }, Ht = () => {
4487
+ Se(de(), "category"), M.success("类别已添加");
4488
+ }, Ut = async (e) => {
4418
4489
  try {
4419
- await ee.confirm("确定要删除此类别吗?", "提示", { type: "warning" }), se(e), I.value?.id === e && ve(), P.success("类别已删除");
4490
+ await ne.confirm("确定要删除此类别吗?", "提示", { type: "warning" }), pe(e), I.value?.id === e && Ce(), M.success("类别已删除");
4420
4491
  } catch {}
4421
- }, zt = () => {
4422
- !I.value || L.value !== "cause" || fe(I.value.categoryId, I.value.id, { direction: "left" }) && (P.success("措施已添加"), Q.value++);
4423
- }, Bt = (e) => {
4424
- !I.value || L.value !== "cause" || (he(I.value.categoryId, I.value.id, e), P.success("子原因已删除"));
4425
- }, Vt = (e) => {
4426
- if (document.activeElement?.blur(), u(() => document.activeElement?.blur()), z.value = null, B.value = null, K.value = null, e.type === "head") {
4427
- ve();
4492
+ }, Wt = () => {
4493
+ !I.value || L.value !== "cause" || ye(I.value.categoryId, I.value.id, { direction: "left" }) && (M.success("措施已添加"), Q.value++);
4494
+ }, Gt = (e) => {
4495
+ !I.value || L.value !== "cause" || (xe(I.value.categoryId, I.value.id, e), M.success("子原因已删除"));
4496
+ }, Kt = (e) => {
4497
+ if (document.activeElement?.blur(), u(() => document.activeElement?.blur()), H.value = null, U.value = null, J.value = null, e.type === "head") {
4498
+ Ce();
4428
4499
  return;
4429
4500
  }
4430
4501
  let t = null, n = e.type;
@@ -4448,8 +4519,8 @@ var fr = { class: "editor-main" }, pr = { class: "panel-toggle-icon" }, mr = { c
4448
4519
  lineColor: "",
4449
4520
  lineOpacity: 60,
4450
4521
  lineStyle: "solid"
4451
- }), t && _e(t, n);
4452
- }, Ht = (e) => {
4522
+ }), t && Se(t, n);
4523
+ }, qt = (e) => {
4453
4524
  let t = e.style || {}, n = t.bgColor || "#FFEB3B", r = (t.bgOpacity ?? 90) / 100, i = "rgba(255, 235, 59, 0.9)";
4454
4525
  return n.startsWith("#") && n.length >= 7 && (i = `rgba(${parseInt(n.slice(1, 3), 16)}, ${parseInt(n.slice(3, 5), 16)}, ${parseInt(n.slice(5, 7), 16)}, ${r})`), {
4455
4526
  position: "absolute",
@@ -4459,7 +4530,7 @@ var fr = { class: "editor-main" }, pr = { class: "panel-toggle-icon" }, mr = { c
4459
4530
  height: e.height + "px",
4460
4531
  background: i
4461
4532
  };
4462
- }, Ut = (e) => {
4533
+ }, Jt = (e) => {
4463
4534
  let t = e.style || {}, n = t.fontStyle || "normal", r = "normal", i = "normal", a = "none";
4464
4535
  return n === "bold" ? i = "bold" : n === "italic" ? r = "italic" : n === "bold italic" ? (i = "bold", r = "italic") : n === "underline" ? a = "underline" : n === "line-through" && (a = "line-through"), {
4465
4536
  color: t.textColor || "#303133",
@@ -4470,7 +4541,7 @@ var fr = { class: "editor-main" }, pr = { class: "panel-toggle-icon" }, mr = { c
4470
4541
  fontWeight: i,
4471
4542
  textDecoration: a
4472
4543
  };
4473
- }, Wt = () => {
4544
+ }, Yt = () => {
4474
4545
  let e = "textbox-" + Date.now(), t = X.value, n = t.width / 2 - 100, r = t.height / 2 - 40, i = {
4475
4546
  id: e,
4476
4547
  x: n,
@@ -4495,51 +4566,51 @@ var fr = { class: "editor-main" }, pr = { class: "panel-toggle-icon" }, mr = { c
4495
4566
  textDecoration: "none"
4496
4567
  }
4497
4568
  };
4498
- R.value.push(i);
4499
- }, Gt = (e) => {
4500
- B.value === e.id && (B.value = null);
4501
- }, Kt = (e, t) => {
4502
- B.value === e.id && t.target.classList.contains("textbox-content") || (z.value = e.id, B.value = null, K.value = null, ve(), Ce.value = !0, H.value = e, we.value = t.clientX, Te.value = t.clientY, Ee.value = e.x, De.value = e.y, ke.value = !1, document.addEventListener("mousemove", Jt), document.addEventListener("mouseup", Yt), t.preventDefault());
4503
- }, qt = (e) => {
4504
- B.value = e.id, u(() => {
4569
+ V.value.push(i);
4570
+ }, Xt = (e) => {
4571
+ U.value === e.id && (U.value = null);
4572
+ }, Zt = (e, t) => {
4573
+ U.value === e.id && t.target.classList.contains("textbox-content") || (H.value = e.id, U.value = null, J.value = null, Ce(), Te.value = !0, W.value = e, G.value = t.clientX, Oe.value = t.clientY, ke.value = e.x, Ae.value = e.y, K.value = !1, document.addEventListener("mousemove", $t), document.addEventListener("mouseup", en), t.preventDefault());
4574
+ }, Qt = (e) => {
4575
+ U.value = e.id, u(() => {
4505
4576
  let t = document.querySelector(`[data-textbox-id="${e.id}"] .textbox-content`);
4506
4577
  t && t.focus();
4507
4578
  });
4508
- }, Jt = (e) => {
4509
- if (!Ce.value || !H.value) return;
4510
- let t = (e.clientX - we.value) / (ft.value / 100), n = (e.clientY - Te.value) / (ft.value / 100);
4511
- !ke.value && Math.abs(t) < 3 && Math.abs(n) < 3 || (ke.value = !0, H.value.x = Ee.value + t, H.value.y = De.value + n);
4512
- }, Yt = () => {
4513
- if (Ce.value = !1, H.value && ke.value) {
4579
+ }, $t = (e) => {
4580
+ if (!Te.value || !W.value) return;
4581
+ let t = (e.clientX - G.value) / (_t.value / 100), n = (e.clientY - Oe.value) / (_t.value / 100);
4582
+ !K.value && Math.abs(t) < 3 && Math.abs(n) < 3 || (K.value = !0, W.value.x = ke.value + t, W.value.y = Ae.value + n);
4583
+ }, en = () => {
4584
+ if (Te.value = !1, W.value && K.value) {
4514
4585
  let e = X.value;
4515
- H.value._xPercent = H.value.x / e.width, H.value._yPercent = H.value.y / e.height, H.value._hasPercent = !0;
4586
+ W.value._xPercent = W.value.x / e.width, W.value._yPercent = W.value.y / e.height, W.value._hasPercent = !0;
4516
4587
  }
4517
- ke.value = !1, H.value = null, document.removeEventListener("mousemove", Jt), document.removeEventListener("mouseup", Yt);
4518
- }, Xt = (e, t, n) => {
4519
- V.value = !0, U.value = t, H.value = e, we.value = n.clientX, Te.value = n.clientY, Ee.value = e.x, De.value = e.y, Oe.value = e.width, W.value = e.height, document.addEventListener("mousemove", Zt), document.addEventListener("mouseup", Qt), n.preventDefault();
4520
- }, Zt = (e) => {
4521
- if (!V.value || !H.value) return;
4522
- let t = (e.clientX - we.value) / (ft.value / 100), n = (e.clientY - Te.value) / (ft.value / 100), r = U.value;
4523
- r.includes("e") && (H.value.width = Math.max(50, Oe.value + t)), r.includes("w") && (H.value.x = Ee.value + t, H.value.width = Math.max(50, Oe.value - t)), r.includes("s") && (H.value.height = Math.max(30, W.value + n)), r.includes("n") && (H.value.y = De.value + n, H.value.height = Math.max(30, W.value - n));
4524
- }, Qt = () => {
4525
- if (V.value = !1, H.value) {
4588
+ K.value = !1, W.value = null, document.removeEventListener("mousemove", $t), document.removeEventListener("mouseup", en);
4589
+ }, tn = (e, t, n) => {
4590
+ Ee.value = !0, De.value = t, W.value = e, G.value = n.clientX, Oe.value = n.clientY, ke.value = e.x, Ae.value = e.y, je.value = e.width, Me.value = e.height, document.addEventListener("mousemove", nn), document.addEventListener("mouseup", rn), n.preventDefault();
4591
+ }, nn = (e) => {
4592
+ if (!Ee.value || !W.value) return;
4593
+ let t = (e.clientX - G.value) / (_t.value / 100), n = (e.clientY - Oe.value) / (_t.value / 100), r = De.value;
4594
+ r.includes("e") && (W.value.width = Math.max(50, je.value + t)), r.includes("w") && (W.value.x = ke.value + t, W.value.width = Math.max(50, je.value - t)), r.includes("s") && (W.value.height = Math.max(30, Me.value + n)), r.includes("n") && (W.value.y = Ae.value + n, W.value.height = Math.max(30, Me.value - n));
4595
+ }, rn = () => {
4596
+ if (Ee.value = !1, W.value) {
4526
4597
  let e = X.value;
4527
- H.value._xPercent = H.value.x / e.width, H.value._yPercent = H.value.y / e.height, H.value._wPercent = H.value.width / e.width, H.value._hPercent = H.value.height / e.height, H.value._hasPercent = !0;
4598
+ W.value._xPercent = W.value.x / e.width, W.value._yPercent = W.value.y / e.height, W.value._wPercent = W.value.width / e.width, W.value._hPercent = W.value.height / e.height, W.value._hasPercent = !0;
4528
4599
  }
4529
- H.value = null, document.removeEventListener("mousemove", Zt), document.removeEventListener("mouseup", Qt);
4530
- }, $t = (e) => {
4531
- let t = R.value.findIndex((t) => t.id === e);
4532
- t >= 0 && (R.value.splice(t, 1), z.value = null, B.value = null);
4533
- }, en = () => {
4534
- if (!At.value) return;
4600
+ W.value = null, document.removeEventListener("mousemove", nn), document.removeEventListener("mouseup", rn);
4601
+ }, an = (e) => {
4602
+ let t = V.value.findIndex((t) => t.id === e);
4603
+ t >= 0 && (V.value.splice(t, 1), H.value = null, U.value = null);
4604
+ }, on = () => {
4605
+ if (!It.value) return;
4535
4606
  let e = Z.value, t = I.value, n = X.value, r = "arrow-" + Date.now(), i, a, o, s, c = null, l = null, u = null;
4536
4607
  if (e) {
4537
- let t = Ct(e.x + e.width, e.y + e.height / 2);
4608
+ let t = Ot(e.x + e.width, e.y + e.height / 2);
4538
4609
  i = t.x, a = t.y, o = i + 150, s = a, c = e.id, l = "textbox", u = "border-15";
4539
4610
  } else if (t) {
4540
- let e = t.id, n = yt.value.find((t) => t.id === e);
4611
+ let e = t.id, n = wt.value.find((t) => t.id === e);
4541
4612
  if (n) {
4542
- let t = an(n, "right", "node");
4613
+ let t = un(n, "right", "node");
4543
4614
  i = t.x, a = t.y, o = i + 150, s = a, c = e, l = "node", u = "right";
4544
4615
  }
4545
4616
  }
@@ -4573,14 +4644,14 @@ var fr = { class: "editor-main" }, pr = { class: "panel-toggle-icon" }, mr = { c
4573
4644
  arrowEnd: !0
4574
4645
  }
4575
4646
  };
4576
- G.value.push(d), K.value = r, z.value = null, I.value = null, L.value = null;
4577
- }, tn = (e) => {
4578
- let t = G.value.findIndex((t) => t.id === e);
4579
- t >= 0 && (G.value.splice(t, 1), K.value = null);
4580
- }, nn = (e) => {
4647
+ q.value.push(d), J.value = r, H.value = null, I.value = null, L.value = null;
4648
+ }, sn = (e) => {
4649
+ let t = q.value.findIndex((t) => t.id === e);
4650
+ t >= 0 && (q.value.splice(t, 1), J.value = null);
4651
+ }, cn = (e) => {
4581
4652
  let { startX: t, startY: n, endX: r, endY: i, cpX: a, cpY: o, style: s } = e;
4582
4653
  return s.lineType === "curve" ? `M ${t} ${n} Q ${a} ${o} ${r} ${i}` : `M ${t} ${n} L ${r} ${i}`;
4583
- }, rn = (e, t = 30) => {
4654
+ }, ln = (e, t = 30) => {
4584
4655
  let { x: n, y: r, width: i, height: a } = e, o = [], s = 2 * (i + a);
4585
4656
  for (let e = 0; e < t; e++) {
4586
4657
  let c = e / t * s, l, u;
@@ -4591,16 +4662,16 @@ var fr = { class: "editor-main" }, pr = { class: "panel-toggle-icon" }, mr = { c
4591
4662
  });
4592
4663
  }
4593
4664
  return o;
4594
- }, an = (e, t, n) => {
4665
+ }, un = (e, t, n) => {
4595
4666
  if (e.anchors && e.anchors[t]) return e.anchors[t];
4596
4667
  if (n === "textbox" && t && t.startsWith("border-")) {
4597
- let n = parseInt(t.split("-")[1]), r = rn({
4668
+ let n = parseInt(t.split("-")[1]), r = ln({
4598
4669
  x: 0,
4599
4670
  y: 0,
4600
4671
  width: e.width,
4601
4672
  height: e.height
4602
4673
  }, 60)[n];
4603
- return r ? Ct(e.x + r.x, e.y + r.y) : null;
4674
+ return r ? Ot(e.x + r.x, e.y + r.y) : null;
4604
4675
  }
4605
4676
  if (t === "top") return {
4606
4677
  x: e.x + e.width / 2,
@@ -4620,30 +4691,30 @@ var fr = { class: "editor-main" }, pr = { class: "panel-toggle-icon" }, mr = { c
4620
4691
  };
4621
4692
  if (t && t.startsWith("border-")) {
4622
4693
  let n = parseInt(t.split("-")[1]);
4623
- return rn(e)[n] || null;
4694
+ return ln(e)[n] || null;
4624
4695
  }
4625
4696
  return {
4626
4697
  x: e.x,
4627
4698
  y: e.y
4628
4699
  };
4629
- }, on = (e, t) => {
4700
+ }, dn = (e, t) => {
4630
4701
  let n = t === "start" ? e.startX : e.endX, r = t === "start" ? e.startY : e.endY, i = 30, a = null, o = null, s = null, c = null;
4631
- yt.value.forEach((e) => {
4632
- rn(e).forEach((t, l) => {
4702
+ wt.value.forEach((e) => {
4703
+ ln(e).forEach((t, l) => {
4633
4704
  let u = Math.hypot(n - t.x, r - t.y);
4634
4705
  u < i && (i = u, a = t, o = e.id, s = "node", c = "border-" + l);
4635
4706
  });
4636
- }), R.value.forEach((e) => {
4637
- rn({
4707
+ }), V.value.forEach((e) => {
4708
+ ln({
4638
4709
  x: 0,
4639
4710
  y: 0,
4640
4711
  width: e.width,
4641
4712
  height: e.height
4642
4713
  }, 60).forEach((t, l) => {
4643
- let u = Ct(e.x + t.x, e.y + t.y), d = Math.hypot(n - u.x, r - u.y);
4714
+ let u = Ot(e.x + t.x, e.y + t.y), d = Math.hypot(n - u.x, r - u.y);
4644
4715
  d < i && (i = d, a = u, o = e.id, s = "textbox", c = "border-" + l);
4645
4716
  });
4646
- }), a ? t === "start" ? (e.startX = a.x, e.startY = a.y, e.startConnectId = o, e.startConnectType = s, e.startAnchor = c) : (e.endX = a.x, e.endY = a.y, e.endConnectId = o, e.endConnectType = s, e.endAnchor = c) : t === "start" ? (e.startConnectId = null, e.startConnectType = null, e.startAnchor = null) : (e.endConnectId = null, e.endConnectType = null, e.endAnchor = null), R.value.forEach((e) => {
4717
+ }), a ? t === "start" ? (e.startX = a.x, e.startY = a.y, e.startConnectId = o, e.startConnectType = s, e.startAnchor = c) : (e.endX = a.x, e.endY = a.y, e.endConnectId = o, e.endConnectType = s, e.endAnchor = c) : t === "start" ? (e.startConnectId = null, e.startConnectType = null, e.startAnchor = null) : (e.endConnectId = null, e.endConnectType = null, e.endAnchor = null), V.value.forEach((e) => {
4647
4718
  let t = {
4648
4719
  top: {
4649
4720
  x: e.x + e.width / 2,
@@ -4667,50 +4738,50 @@ var fr = { class: "editor-main" }, pr = { class: "panel-toggle-icon" }, mr = { c
4667
4738
  u < i && (i = u, a = l, o = e.id, s = "textbox", c = t);
4668
4739
  });
4669
4740
  }), a ? t === "start" ? (e.startX = a.x, e.startY = a.y, e.startConnectId = o, e.startConnectType = s, e.startAnchor = c) : (e.endX = a.x, e.endY = a.y, e.endConnectId = o, e.endConnectType = s, e.endAnchor = c) : t === "start" ? (e.startConnectId = null, e.startConnectType = null, e.startAnchor = null) : (e.endConnectId = null, e.endConnectType = null, e.endAnchor = null);
4670
- }, sn = (e, t, n, r) => {
4741
+ }, fn = (e, t, n, r) => {
4671
4742
  if (!Y.value) return;
4672
4743
  let i = e;
4673
- t === "node" && (i = yt.value.find((t) => t.id === e.id) || e);
4674
- let a = an(i, n, t);
4744
+ t === "node" && (i = wt.value.find((t) => t.id === e.id) || e);
4745
+ let a = un(i, n, t);
4675
4746
  if (!a) return;
4676
4747
  let o = Y.value;
4677
4748
  Math.hypot(a.x - o.startX, a.y - o.startY) <= Math.hypot(a.x - o.endX, a.y - o.endY) ? (o.startX = a.x, o.startY = a.y, o.startConnectId = i.id, o.startConnectType = t, o.startAnchor = n) : (o.endX = a.x, o.endY = a.y, o.endConnectId = i.id, o.endConnectType = t, o.endAnchor = n);
4678
4749
  let s = X.value;
4679
4750
  o._startXP = o.startX / s.width, o._startYP = o.startY / s.height, o._endXP = o.endX / s.width, o._endYP = o.endY / s.height;
4680
- }, cn = () => {
4681
- G.value.forEach((e) => {
4751
+ }, pn = () => {
4752
+ q.value.forEach((e) => {
4682
4753
  if (e.startConnectId) {
4683
4754
  let t = null;
4684
- if (e.startConnectType === "textbox" ? t = R.value.find((t) => t.id === e.startConnectId) : e.startConnectType === "node" && (t = yt.value.find((t) => t.id === e.startConnectId)), t && e.startAnchor) {
4685
- let n = an(t, e.startAnchor, e.startConnectType);
4755
+ if (e.startConnectType === "textbox" ? t = V.value.find((t) => t.id === e.startConnectId) : e.startConnectType === "node" && (t = wt.value.find((t) => t.id === e.startConnectId)), t && e.startAnchor) {
4756
+ let n = un(t, e.startAnchor, e.startConnectType);
4686
4757
  n && (e.startX = n.x, e.startY = n.y);
4687
4758
  }
4688
4759
  }
4689
4760
  if (e.endConnectId) {
4690
4761
  let t = null;
4691
- if (e.endConnectType === "textbox" ? t = R.value.find((t) => t.id === e.endConnectId) : e.endConnectType === "node" && (t = yt.value.find((t) => t.id === e.endConnectId)), t && e.endAnchor) {
4692
- let n = an(t, e.endAnchor, e.endConnectType);
4762
+ if (e.endConnectType === "textbox" ? t = V.value.find((t) => t.id === e.endConnectId) : e.endConnectType === "node" && (t = wt.value.find((t) => t.id === e.endConnectId)), t && e.endAnchor) {
4763
+ let n = un(t, e.endAnchor, e.endConnectType);
4693
4764
  n && (e.endX = n.x, e.endY = n.y);
4694
4765
  }
4695
4766
  }
4696
4767
  let t = X.value;
4697
4768
  e._startXP = e.startX / t.width, e._startYP = e.startY / t.height, e._endXP = e.endX / t.width, e._endYP = e.endY / t.height;
4698
4769
  });
4699
- }, ln = (e, t, n) => {
4700
- q.value = !0, _t.value = !0, Me.value = t, K.value = e.id, Ne.value = n.clientX, Pe.value = n.clientY, document.addEventListener("mousemove", un), document.addEventListener("mouseup", dn), n.preventDefault(), n.stopPropagation();
4701
- }, un = (e) => {
4702
- if (!q.value && !J.value && !je.value || !Y.value) return;
4703
- let t = (e.clientX - Ne.value) / (ft.value / 100), n = (e.clientY - Pe.value) / (ft.value / 100);
4704
- J.value ? (Y.value.startX += t, Y.value.startY += n, Y.value.endX += t, Y.value.endY += n, Y.value.cpX += t, Y.value.cpY += n) : Me.value === "start" ? (Y.value.startX += t, Y.value.startY += n) : Me.value === "end" ? (Y.value.endX += t, Y.value.endY += n) : Me.value === "cp" && (Y.value.cpX += t, Y.value.cpY += n), Ne.value = e.clientX, Pe.value = e.clientY;
4705
- }, dn = () => {
4706
- if ((q.value || J.value || je.value) && Y.value) {
4707
- q.value && (Me.value === "start" ? on(Y.value, "start") : Me.value === "end" && on(Y.value, "end"));
4770
+ }, mn = (e, t, n) => {
4771
+ Pe.value = !0, St.value = !0, Le.value = t, J.value = e.id, Re.value = n.clientX, ze.value = n.clientY, document.addEventListener("mousemove", hn), document.addEventListener("mouseup", gn), n.preventDefault(), n.stopPropagation();
4772
+ }, hn = (e) => {
4773
+ if (!Pe.value && !Fe.value && !Ie.value || !Y.value) return;
4774
+ let t = (e.clientX - Re.value) / (_t.value / 100), n = (e.clientY - ze.value) / (_t.value / 100);
4775
+ Fe.value ? (Y.value.startX += t, Y.value.startY += n, Y.value.endX += t, Y.value.endY += n, Y.value.cpX += t, Y.value.cpY += n) : Le.value === "start" ? (Y.value.startX += t, Y.value.startY += n) : Le.value === "end" ? (Y.value.endX += t, Y.value.endY += n) : Le.value === "cp" && (Y.value.cpX += t, Y.value.cpY += n), Re.value = e.clientX, ze.value = e.clientY;
4776
+ }, gn = () => {
4777
+ if ((Pe.value || Fe.value || Ie.value) && Y.value) {
4778
+ Pe.value && (Le.value === "start" ? dn(Y.value, "start") : Le.value === "end" && dn(Y.value, "end"));
4708
4779
  let e = X.value;
4709
4780
  Y.value._startXP = Y.value.startX / e.width, Y.value._startYP = Y.value.startY / e.height, Y.value._endXP = Y.value.endX / e.width, Y.value._endYP = Y.value.endY / e.height, Y.value._cpXP = Y.value.cpX / e.width, Y.value._cpYP = Y.value.cpY / e.height;
4710
4781
  }
4711
- q.value = !1, J.value = !1, je.value = !1, _t.value = !1, Me.value = "", document.removeEventListener("mousemove", un), document.removeEventListener("mouseup", dn);
4712
- }, fn = (e, t) => {
4713
- J.value = !0, K.value = e.id, Ne.value = t.clientX, Pe.value = t.clientY, document.addEventListener("mousemove", un), document.addEventListener("mouseup", dn), t.preventDefault(), t.stopPropagation(), console.log("=== 选中箭头线,调试文本框锚点 ==="), R.value.forEach((e) => {
4782
+ Pe.value = !1, Fe.value = !1, Ie.value = !1, St.value = !1, Le.value = "", document.removeEventListener("mousemove", hn), document.removeEventListener("mouseup", gn);
4783
+ }, _n = (e, t) => {
4784
+ Fe.value = !0, J.value = e.id, Re.value = t.clientX, ze.value = t.clientY, document.addEventListener("mousemove", hn), document.addEventListener("mouseup", gn), t.preventDefault(), t.stopPropagation(), console.log("=== 选中箭头线,调试文本框锚点 ==="), V.value.forEach((e) => {
4714
4785
  console.log(`文本框 [${e.id}]: CSS x=${e.x}, y=${e.y}, w=${e.width}, h=${e.height}`), [
4715
4786
  {
4716
4787
  name: "左上",
@@ -4732,7 +4803,7 @@ var fr = { class: "editor-main" }, pr = { class: "panel-toggle-icon" }, mr = { c
4732
4803
  x: e.x,
4733
4804
  y: e.y + e.height
4734
4805
  }
4735
- ].forEach((e) => console.log(` 角 ${e.name}: CSS(${e.x.toFixed(1)}, ${e.y.toFixed(1)}) → SVG(${Ct(e.x, e.y).x.toFixed(1)}, ${Ct(e.x, e.y).y.toFixed(1)})`));
4806
+ ].forEach((e) => console.log(` 角 ${e.name}: CSS(${e.x.toFixed(1)}, ${e.y.toFixed(1)}) → SVG(${Ot(e.x, e.y).x.toFixed(1)}, ${Ot(e.x, e.y).y.toFixed(1)})`));
4736
4807
  let t = {
4737
4808
  top: {
4738
4809
  x: e.x + e.width / 2,
@@ -4751,15 +4822,15 @@ var fr = { class: "editor-main" }, pr = { class: "panel-toggle-icon" }, mr = { c
4751
4822
  y: e.y + e.height / 2
4752
4823
  }
4753
4824
  };
4754
- Object.entries(t).forEach(([e, t]) => console.log(` 锚点 ${e}: CSS(${t.x.toFixed(1)}, ${t.y.toFixed(1)}) → SVG(${Ct(t.x, t.y).x.toFixed(1)}, ${Ct(t.x, t.y).y.toFixed(1)})`));
4755
- }), console.log("viewBox:", bt.value), console.log("canvasSize:", X.value);
4756
- }, pn = (e, t) => {
4757
- je.value = !0, Me.value = "cp", K.value = e.id, Ne.value = t.clientX, Pe.value = t.clientY, document.addEventListener("mousemove", un), document.addEventListener("mouseup", dn), t.preventDefault(), t.stopPropagation();
4758
- }, mn = (e) => {
4759
- F.value.theme = e, P.success("主题已切换");
4760
- }, hn = (e) => {
4761
- F.value.diagramStyle = e, Q.value++, P.success("样式已切换");
4762
- }, gn = async (e) => {
4825
+ Object.entries(t).forEach(([e, t]) => console.log(` 锚点 ${e}: CSS(${t.x.toFixed(1)}, ${t.y.toFixed(1)}) → SVG(${Ot(t.x, t.y).x.toFixed(1)}, ${Ot(t.x, t.y).y.toFixed(1)})`));
4826
+ }), console.log("viewBox:", Tt.value), console.log("canvasSize:", X.value);
4827
+ }, vn = (e, t) => {
4828
+ Ie.value = !0, Le.value = "cp", J.value = e.id, Re.value = t.clientX, ze.value = t.clientY, document.addEventListener("mousemove", hn), document.addEventListener("mouseup", gn), t.preventDefault(), t.stopPropagation();
4829
+ }, yn = (e) => {
4830
+ F.value.theme = e, M.success("主题已切换");
4831
+ }, bn = (e) => {
4832
+ F.value.diagramStyle = e, Q.value++, M.success("样式已切换");
4833
+ }, xn = async (e) => {
4763
4834
  let t = {
4764
4835
  category: "类别",
4765
4836
  cause: "原因",
@@ -4767,40 +4838,40 @@ var fr = { class: "editor-main" }, pr = { class: "panel-toggle-icon" }, mr = { c
4767
4838
  measure: "措施"
4768
4839
  }[e.type] || "节点";
4769
4840
  try {
4770
- if (await ee.confirm(`确定要删除此${t}吗?`, "删除确认", {
4841
+ if (await ne.confirm(`确定要删除此${t}吗?`, "删除确认", {
4771
4842
  confirmButtonText: "确定",
4772
4843
  cancelButtonText: "取消",
4773
4844
  type: "warning"
4774
- }), e.type === "category") se(e.id);
4775
- else if (e.type === "cause") de(e.catIndex === void 0 ? "" : F.value.categories[e.catIndex]?.id, e.id);
4845
+ }), e.type === "category") pe(e.id);
4846
+ else if (e.type === "cause") ve(e.catIndex === void 0 ? "" : F.value.categories[e.catIndex]?.id, e.id);
4776
4847
  else if (e.type === "child") {
4777
- xe();
4848
+ we();
4778
4849
  let t = F.value.categories[e.catIndex]?.causes?.[e.causeIndex];
4779
4850
  if (t?.children) {
4780
4851
  let n = t.children.findIndex((t) => t.id === e.id);
4781
4852
  n !== -1 && t.children.splice(n, 1);
4782
4853
  }
4783
4854
  } else if (e.type === "measure") {
4784
- xe();
4855
+ we();
4785
4856
  let t = F.value.categories[e.catIndex]?.causes?.[e.causeIndex];
4786
4857
  if (t?.children) {
4787
4858
  let n = t.children.findIndex((t) => t.id === e.id);
4788
4859
  n !== -1 && t.children.splice(n, 1);
4789
4860
  }
4790
4861
  }
4791
- I.value?.id === e.id && ve(), Q.value++, P.success("已删除");
4862
+ I.value?.id === e.id && Ce(), Q.value++, M.success("已删除");
4792
4863
  } catch {}
4793
- }, _n = v(!1), vn = v({
4864
+ }, Sn = v(!1), Cn = v({
4794
4865
  text: "",
4795
4866
  direction: "left",
4796
4867
  parentType: "",
4797
4868
  parentId: "",
4798
4869
  catIndex: 0,
4799
4870
  causeIndex: 0
4800
- }), yn = (e) => {
4871
+ }), wn = (e) => {
4801
4872
  let { type: t, catIndex: n, causeIndex: r, measureIndex: i, dx: a, dy: o } = e, s = F.value.categories[n];
4802
4873
  if (s) {
4803
- if (xe(), t === "cat") s.style ||= {}, s.style.dragDx = a, s.style.dragDy = o;
4874
+ if (we(), t === "cat") s.style ||= {}, s.style.dragDx = a, s.style.dragDy = o;
4804
4875
  else if (t === "anchor") s.style ||= {}, s.style.anchorDx = a;
4805
4876
  else if (t === "cause") {
4806
4877
  let e = s.causes?.[r];
@@ -4809,27 +4880,27 @@ var fr = { class: "editor-main" }, pr = { class: "panel-toggle-icon" }, mr = { c
4809
4880
  let e = (s.causes?.[r])?.children?.[i];
4810
4881
  e && (e.style ||= {}, e.style.dragDx = a, e.style.dragDy = o);
4811
4882
  }
4812
- Q.value++, u(() => cn());
4883
+ Q.value++, u(() => pn());
4813
4884
  }
4814
- }, bn = (e) => {
4815
- vn.value = {
4885
+ }, Tn = (e) => {
4886
+ Cn.value = {
4816
4887
  text: "",
4817
4888
  direction: "left",
4818
4889
  parentType: e.type,
4819
4890
  parentId: e.id,
4820
4891
  catIndex: e.catIndex ?? 0,
4821
4892
  causeIndex: e.causeIndex ?? 0
4822
- }, _n.value = !0;
4823
- }, xn = () => {
4824
- if (!vn.value.text.trim()) {
4825
- P.warning("请输入子节点名称");
4893
+ }, Sn.value = !0;
4894
+ }, En = () => {
4895
+ if (!Cn.value.text.trim()) {
4896
+ M.warning("请输入子节点名称");
4826
4897
  return;
4827
4898
  }
4828
- let { parentType: e, catIndex: t, causeIndex: n, text: r, direction: i } = vn.value, a = F.value.categories[t];
4899
+ let { parentType: e, catIndex: t, causeIndex: n, text: r, direction: i } = Cn.value, a = F.value.categories[t];
4829
4900
  if (!a) return;
4830
4901
  let o = null, s = "";
4831
4902
  if (e === "category") {
4832
- xe(), a.causes ||= [];
4903
+ we(), a.causes ||= [];
4833
4904
  let e = {
4834
4905
  id: `cause-${Date.now()}`,
4835
4906
  text: r,
@@ -4852,7 +4923,7 @@ var fr = { class: "editor-main" }, pr = { class: "panel-toggle-icon" }, mr = { c
4852
4923
  };
4853
4924
  a.causes.push(e), o = e, s = "cause";
4854
4925
  } else if (e === "cause") {
4855
- xe();
4926
+ we();
4856
4927
  let e = a.causes?.[n];
4857
4928
  if (e) {
4858
4929
  e.children ||= [];
@@ -4877,28 +4948,28 @@ var fr = { class: "editor-main" }, pr = { class: "panel-toggle-icon" }, mr = { c
4877
4948
  e.children.push(t), o = t, s = "measure";
4878
4949
  }
4879
4950
  }
4880
- _n.value = !1, o && _e(o, s), Q.value++, P.success("已添加");
4881
- }, Sn = () => {
4882
- ft.value = Math.min(200, ft.value + 10);
4883
- }, Cn = () => {
4884
- ft.value = Math.max(50, ft.value - 10);
4885
- }, wn = () => {
4886
- ft.value = 100;
4887
- }, Tn = async () => {
4888
- if (et.value && Je.value) {
4889
- P.error("协作已关闭,无法提交保存");
4951
+ Sn.value = !1, o && Se(o, s), Q.value++, M.success("已添加");
4952
+ }, Dn = () => {
4953
+ _t.value = Math.min(200, _t.value + 10);
4954
+ }, On = () => {
4955
+ _t.value = Math.max(50, _t.value - 10);
4956
+ }, kn = () => {
4957
+ _t.value = 100;
4958
+ }, An = async () => {
4959
+ if (ot.value && $e.value) {
4960
+ M.error("协作已关闭,无法提交保存");
4890
4961
  return;
4891
4962
  }
4892
4963
  if (!F.value.title?.trim()) {
4893
- P.warning("请输入标题");
4964
+ M.warning("请输入标题");
4894
4965
  return;
4895
4966
  }
4896
4967
  if (!F.value.effect?.trim()) {
4897
- P.warning("请输入问题/结果");
4968
+ M.warning("请输入问题/结果");
4898
4969
  return;
4899
4970
  }
4900
4971
  if (!F.value.author?.trim()) {
4901
- P.warning("请输入作者");
4972
+ M.warning("请输入作者");
4902
4973
  return;
4903
4974
  }
4904
4975
  try {
@@ -4906,51 +4977,55 @@ var fr = { class: "editor-main" }, pr = { class: "panel-toggle-icon" }, mr = { c
4906
4977
  title: F.value.title,
4907
4978
  content: JSON.stringify({
4908
4979
  ...F.value,
4909
- textBoxes: R.value,
4910
- arrowLines: G.value
4980
+ textBoxes: V.value,
4981
+ arrowLines: q.value
4911
4982
  }),
4912
4983
  doc_type: "fishbone",
4913
4984
  status: 2
4914
- };
4915
- if (F.value.id) await dr.update(F.value.id, e);
4985
+ }, t = F.value.id || O.value, n = typeof h.saveApi == "function" ? h.saveApi : h.saveApi ? (e) => t ? N.put(`${h.saveApi}/${t}`, e) : N.post(h.saveApi, e) : null;
4986
+ if (n) {
4987
+ let r = await n(e, t);
4988
+ F.value.id = r.data?.id || t;
4989
+ } else if (t) await A.value.update(t, e), F.value.id = t;
4916
4990
  else {
4917
- let t = await dr.create(e);
4918
- F.value.id = t.data.id;
4991
+ let t = await A.value.create(e);
4992
+ F.value.id = t.data.id, h.docId || c.replace(`/fishbone-editor/${t.data.id}`);
4919
4993
  }
4920
- P.success("保存成功"), k({
4994
+ M.success("保存成功"), ae({
4921
4995
  documentId: F.value.id,
4922
4996
  docType: "fishbone",
4923
4997
  content: JSON.stringify({
4924
4998
  ...F.value,
4925
- textBoxes: R.value,
4926
- arrowLines: G.value
4999
+ textBoxes: V.value,
5000
+ arrowLines: q.value
4927
5001
  }),
4928
- userId: String(j.currentUser.value?.id || ""),
4929
- userName: j.currentUser.value?.name || "未知"
5002
+ userId: String(P.currentUser.value?.id || ""),
5003
+ userName: P.currentUser.value?.name || "未知"
4930
5004
  });
4931
5005
  } catch (e) {
4932
- P.error("保存失败"), console.error(e);
5006
+ M.error("保存失败"), console.error(e);
4933
5007
  }
4934
- }, En = (e) => {
4935
- ht.value = e || "png", mt.value = dt.value?.getSvgElement(), pt.value = !0;
4936
- }, Dn = ({ format: e, filename: t }) => {
4937
- P.success(`已导出: ${t}`);
4938
- }, On = (e) => {
5008
+ }, jn = (e) => {
5009
+ bt.value = e || "png", yt.value = gt.value?.getSvgElement(), vt.value = !0;
5010
+ }, Mn = ({ format: e, filename: t }) => {
5011
+ M.success(`已导出: ${t}`);
5012
+ }, Nn = (e) => {
4939
5013
  let { catIndex: t, causeIndex: n, measureIndex: r } = e, i = (F.value.categories[t]?.causes?.[n])?.children?.[r];
4940
- i && P.info(`思维导图功能开发中: ${i.text}`);
4941
- }, kn = async () => {
4942
- if (l.params.id && !l.params.id.startsWith("fishbone-")) try {
4943
- let e = await dr.get(l.params.id);
4944
- if (e.data?.content) {
4945
- let t = JSON.parse(e.data.content);
4946
- Object.assign(F.value, t), t.textBoxes && (R.value = t.textBoxes, u(() => {
5014
+ i && M.info(`思维导图功能开发中: ${i.text}`);
5015
+ }, Pn = async () => {
5016
+ let e = O.value;
5017
+ if (e && !String(e).startsWith("fishbone-")) try {
5018
+ let t;
5019
+ if (t = typeof h.loadApi == "function" ? await h.loadApi(e) : h.loadApi ? await N.get(`${h.loadApi}/${e}`) : await A.value.get(e), t.data?.content) {
5020
+ let e = JSON.parse(t.data.content);
5021
+ Object.assign(F.value, e), e.textBoxes && (V.value = e.textBoxes, u(() => {
4947
5022
  let e = X.value;
4948
- R.value.forEach((t) => {
5023
+ V.value.forEach((t) => {
4949
5024
  t._hasPercent ||= (t._xPercent = t.x / e.width, t._yPercent = t.y / e.height, t._wPercent = t.width / e.width, t._hPercent = t.height / e.height, !0);
4950
5025
  });
4951
- })), t.arrowLines && (G.value = t.arrowLines, u(() => {
5026
+ })), e.arrowLines && (q.value = e.arrowLines, u(() => {
4952
5027
  let e = X.value;
4953
- G.value.forEach((t) => {
5028
+ q.value.forEach((t) => {
4954
5029
  t._startXP === void 0 && (t._startXP = t.startX / e.width, t._startYP = t.startY / e.height, t._endXP = t.endX / e.width, t._endYP = t.endY / e.height), t._cpXP === void 0 && (t.cpX = t.cpX ?? (t.startX + t.endX) / 2, t.cpY = t.cpY ?? (t.startY + t.endY) / 2 - 60, t._cpXP = t.cpX / e.width, t._cpYP = t.cpY / e.height);
4955
5030
  });
4956
5031
  }));
@@ -4959,36 +5034,36 @@ var fr = { class: "editor-main" }, pr = { class: "panel-toggle-icon" }, mr = { c
4959
5034
  console.error("加载文档失败:", e);
4960
5035
  }
4961
5036
  }, Q = v(0);
4962
- E(() => F.value.categories, () => {
5037
+ T(() => F.value.categories, () => {
4963
5038
  Q.value++;
4964
- }, { deep: !0 }), E(I, () => {
5039
+ }, { deep: !0 }), T(I, () => {
4965
5040
  u(() => {
4966
5041
  let e = document.activeElement;
4967
5042
  e && e.tagName !== "BODY" && e.blur();
4968
5043
  });
4969
- }), E(R, () => {
4970
- cn();
4971
- }, { deep: !0 }), E(() => F.value.categories, () => {
4972
- cn();
4973
- }, { deep: !0 }), E(yt, () => {
4974
- cn();
5044
+ }), T(V, () => {
5045
+ pn();
5046
+ }, { deep: !0 }), T(() => F.value.categories, () => {
5047
+ pn();
5048
+ }, { deep: !0 }), T(wt, () => {
5049
+ pn();
4975
5050
  }, { deep: !0 });
4976
- let An = () => {
5051
+ let Fn = () => {
4977
5052
  u(() => {
4978
- let e = Tt();
5053
+ let e = jt();
4979
5054
  if (e.width > 0 && e.height > 0) {
4980
5055
  let t = X.value.width, n = X.value.height;
4981
- t > 0 && n > 0 && (Math.abs(e.width - t) > 1 || Math.abs(e.height - n) > 1) && (R.value.forEach((r) => {
5056
+ t > 0 && n > 0 && (Math.abs(e.width - t) > 1 || Math.abs(e.height - n) > 1) && (V.value.forEach((r) => {
4982
5057
  r._xPercent = r._xPercent ?? r.x / t, r._yPercent = r._yPercent ?? r.y / n, r._wPercent = r._wPercent ?? r.width / t, r._hPercent = r._hPercent ?? r.height / n, r._hasPercent = !0, r.x = r._xPercent * e.width, r.y = r._yPercent * e.height, r.width = Math.max(50, r._wPercent * e.width), r.height = Math.max(30, r._hPercent * e.height);
4983
- }), G.value.forEach((r) => {
5058
+ }), q.value.forEach((r) => {
4984
5059
  r._startXP = r._startXP ?? r.startX / t, r._startYP = r._startYP ?? r.startY / n, r._endXP = r._endXP ?? r.endX / t, r._endYP = r._endYP ?? r.endY / n, r._cpXP = r._cpXP ?? r.cpX / t, r._cpYP = r._cpYP ?? r.cpY / n, r.startX = r._startXP * e.width, r.startY = r._startYP * e.height, r.endX = r._endXP * e.width, r.endY = r._endYP * e.height, r.cpX = r._cpXP * e.width, r.cpY = r._cpYP * e.height;
4985
5060
  })), X.value = {
4986
5061
  width: e.width,
4987
5062
  height: e.height
4988
- }, cn();
5063
+ }, pn();
4989
5064
  }
4990
5065
  });
4991
- }, jn = [
5066
+ }, In = [
4992
5067
  "我可以帮您分析鱼骨图结构、梳理因果关系,或者提供问题分析思路。请问有什么需要帮助的?",
4993
5068
  "这个鱼骨图的分类很全面。建议检查每个主分支下的子原因是否充分,有没有遗漏的关键因素。",
4994
5069
  "根据当前的问题定义,我建议从人、机、料、法、环、测六个维度全面分析可能的根本原因。",
@@ -4997,46 +5072,46 @@ var fr = { class: "editor-main" }, pr = { class: "panel-toggle-icon" }, mr = { c
4997
5072
  "建议对每个主要原因添加权重或优先级标注,这样可以帮助团队聚焦最关键的问题。",
4998
5073
  "这个鱼骨图的分析框架不错。建议在关键原因节点添加数据和证据支持,增强分析的说服力。",
4999
5074
  "我可以帮您将鱼骨图的分析结果转化为改进计划或解决方案文档。"
5000
- ], Mn = async (e, t = {}) => {
5001
- let n = l.params.id ? `${ii}-${l.params.id}` : null;
5002
- await j.sendMessage(e, {
5075
+ ], Ln = async (e, t = {}) => {
5076
+ let n = O.value ? `${ai}-${O.value}` : null;
5077
+ await P.sendMessage(e, {
5003
5078
  ...t,
5004
5079
  roomId: n
5005
5080
  });
5006
- let r = t.mentionedUser, i = r && r.toLowerCase().includes("ai"), a = j.collabUsers.value.filter((e) => e.name !== j.currentUser.value.name);
5007
- (!r || i || a.length === 0) && (j.loading.value = !0, setTimeout(() => {
5008
- j.sendAiMessage(jn[Math.floor(Math.random() * jn.length)], n), j.loading.value = !1;
5081
+ let r = t.mentionedUser, i = r && r.toLowerCase().includes("ai"), a = P.collabUsers.value.filter((e) => e.name !== P.currentUser.value.name);
5082
+ (!r || i || a.length === 0) && (P.loading.value = !0, setTimeout(() => {
5083
+ P.sendAiMessage(In[Math.floor(Math.random() * In.length)], n), P.loading.value = !1;
5009
5084
  }, 800 + Math.random() * 1200));
5010
- }, Nn = () => {
5011
- let e = l.params.id ? `${ii}-${l.params.id}` : null;
5012
- j.clearMessages(e);
5013
- }, Pn = () => {
5085
+ }, Rn = () => {
5086
+ let e = O.value ? `${ai}-${O.value}` : null;
5087
+ P.clearMessages(e);
5088
+ }, zn = () => {
5014
5089
  if (!F.value.id) {
5015
- P.warning("请先保存文档");
5090
+ M.warning("请先保存文档");
5016
5091
  return;
5017
5092
  }
5018
- _.value = !0;
5019
- }, Fn = (e) => {
5093
+ ie.value = !0;
5094
+ }, Bn = (e) => {
5020
5095
  try {
5021
5096
  let t = typeof e == "string" ? JSON.parse(e) : e;
5022
- Object.assign(F.value, t), t.textBoxes && (R.value = t.textBoxes), t.arrowLines && (G.value = t.arrowLines);
5097
+ Object.assign(F.value, t), t.textBoxes && (V.value = t.textBoxes), t.arrowLines && (q.value = t.arrowLines);
5023
5098
  } catch (e) {
5024
5099
  console.error("Version apply error:", e);
5025
5100
  }
5026
5101
  };
5027
5102
  return m(() => {
5028
- let e = localStorage.getItem("editor-user-name") || `用户${Math.floor(Math.random() * 1e3)}`;
5029
- localStorage.setItem("editor-user-name", e), j.setCurrentUser({
5103
+ let e = h.user?.name || localStorage.getItem("editor-user-name") || `用户${Math.floor(Math.random() * 1e3)}`;
5104
+ localStorage.setItem("editor-user-name", e), P.setCurrentUser({
5030
5105
  id: Date.now(),
5031
5106
  name: e,
5032
5107
  color: "#409eff"
5033
- }), He({ name: e }), kn().then(() => {
5034
- l.query.collab === "1" && l.params.id && ot();
5108
+ }), Je({ name: e }), Pn().then(() => {
5109
+ l.query.collab === "1" && O.value && ft();
5035
5110
  }), u(() => {
5036
- let e = Tt();
5037
- X.value = { ...e }, wt.value = { ...e };
5038
- let t = lt.value;
5039
- t && new ResizeObserver(() => An()).observe(t);
5111
+ let e = jt();
5112
+ X.value = { ...e }, kt.value = { ...e };
5113
+ let t = ht.value;
5114
+ t && new ResizeObserver(() => Fn()).observe(t);
5040
5115
  });
5041
5116
  }), m(() => {
5042
5117
  document.addEventListener("mousedown", (e) => {
@@ -5045,14 +5120,14 @@ var fr = { class: "editor-main" }, pr = { class: "panel-toggle-icon" }, mr = { c
5045
5120
  });
5046
5121
  }), m(() => {
5047
5122
  document.addEventListener("keydown", (e) => {
5048
- e.ctrlKey || e.metaKey ? e.key === "z" ? (e.preventDefault(), ye()) : e.key === "y" ? (e.preventDefault(), be()) : e.key === "s" && (e.preventDefault(), Tn()) : (e.key === "Delete" || e.key === "Backspace") && I.value && L.value === "category" && Rt(I.value.id);
5123
+ e.ctrlKey || e.metaKey ? e.key === "z" ? (e.preventDefault(), R()) : e.key === "y" ? (e.preventDefault(), z()) : e.key === "s" && (e.preventDefault(), An()) : (e.key === "Delete" || e.key === "Backspace") && I.value && L.value === "category" && Ut(I.value.id);
5049
5124
  });
5050
5125
  }), p(() => {
5051
- rt &&= (clearInterval(rt), null), document.removeEventListener("mousemove", Jt), document.removeEventListener("mouseup", Yt), document.removeEventListener("mousemove", Zt), document.removeEventListener("mouseup", Qt), document.removeEventListener("mousemove", un), document.removeEventListener("mouseup", dn), An && window.removeEventListener("resize", An);
5126
+ ct &&= (clearInterval(ct), null), document.removeEventListener("mousemove", $t), document.removeEventListener("mouseup", en), document.removeEventListener("mousemove", nn), document.removeEventListener("mouseup", rn), document.removeEventListener("mousemove", hn), document.removeEventListener("mouseup", gn), Fn && window.removeEventListener("resize", Fn);
5052
5127
  }), (t, n) => {
5053
- let c = b("el-icon"), l = b("el-button"), u = b("el-input"), p = b("el-form-item"), m = b("el-option"), v = b("el-select"), E = b("el-slider"), k = b("el-color-picker"), M = b("el-radio-button"), N = b("el-radio-group"), P = b("el-form"), ee = b("el-divider"), te = b("el-checkbox"), ae = b("el-tag"), oe = b("el-dialog");
5128
+ let c = b("el-icon"), l = b("el-button"), u = b("el-input"), p = b("el-form-item"), m = b("el-option"), h = b("el-select"), v = b("el-slider"), T = b("el-color-picker"), O = b("el-radio-button"), A = b("el-radio-group"), te = b("el-form"), j = b("el-divider"), M = b("el-checkbox"), ne = b("el-tag"), N = b("el-dialog");
5054
5129
  return g(), i("div", { class: d(["fishbone-editor", `theme-${S(F).theme}`]) }, [
5055
- s(kt, {
5130
+ s(At, {
5056
5131
  title: S(F).title,
5057
5132
  "onUpdate:title": n[0] ||= (e) => S(F).title = e,
5058
5133
  effect: S(F).effect,
@@ -5061,32 +5136,35 @@ var fr = { class: "editor-main" }, pr = { class: "panel-toggle-icon" }, mr = { c
5061
5136
  "onUpdate:author": n[2] ||= (e) => S(F).author = e,
5062
5137
  "current-theme": S(F).theme,
5063
5138
  "current-diagram-style": S(F).diagramStyle,
5064
- zoom: ft.value,
5065
- "can-undo": S(re) > 0,
5066
- "can-redo": S(re) < S(ne).length - 1,
5139
+ zoom: _t.value,
5140
+ "can-undo": S(le) > 0,
5141
+ "can-redo": S(le) < S(ce).length - 1,
5067
5142
  "can-add-cause": S(F).categories.length > 0,
5068
- "is-connected": Qe.value,
5069
- "online-users": S(Le),
5070
- "online-count": S(Le).length,
5071
- onBack: Ft,
5072
- onAddTextBox: Wt,
5073
- "can-add-arrow": At.value,
5074
- onAddArrow: en,
5075
- onUndo: S(ye),
5076
- onRedo: S(be),
5077
- onZoomIn: Sn,
5078
- onZoomOut: Cn,
5079
- onFitView: wn,
5080
- onSelectTheme: mn,
5081
- onSelectStyle: hn,
5082
- onSave: Tn,
5083
- onExport: En,
5084
- onToggleCollab: st,
5085
- onShareCollab: ct,
5086
- onAiGenerate: It,
5087
- readonly: et.value && !$e.value,
5143
+ "is-connected": it.value,
5144
+ "online-users": S(Ge),
5145
+ "online-count": S(Ge).length,
5146
+ onBack: Bt,
5147
+ onAddTextBox: Yt,
5148
+ "can-add-arrow": It.value,
5149
+ onAddArrow: on,
5150
+ onUndo: S(R),
5151
+ onRedo: S(z),
5152
+ onZoomIn: Dn,
5153
+ onZoomOut: On,
5154
+ onFitView: kn,
5155
+ onSelectTheme: yn,
5156
+ onSelectStyle: bn,
5157
+ onSave: An,
5158
+ onExport: jn,
5159
+ onToggleCollab: pt,
5160
+ onShareCollab: mt,
5161
+ onAiGenerate: Vt,
5162
+ readonly: ot.value && !at.value,
5163
+ "back-button": _.value.backButton,
5164
+ "title-editable": _.value.titleEditable,
5165
+ "author-editable": _.value.authorEditable,
5088
5166
  "show-history": !!S(F).id,
5089
- onHistory: Pn
5167
+ onHistory: zn
5090
5168
  }, null, 8, [
5091
5169
  "title",
5092
5170
  "effect",
@@ -5104,82 +5182,85 @@ var fr = { class: "editor-main" }, pr = { class: "panel-toggle-icon" }, mr = { c
5104
5182
  "onUndo",
5105
5183
  "onRedo",
5106
5184
  "readonly",
5185
+ "back-button",
5186
+ "title-editable",
5187
+ "author-editable",
5107
5188
  "show-history"
5108
5189
  ]),
5109
- a("div", fr, [
5110
- a("div", { class: d(["side-panel left-panel", { collapsed: !Dt.value }]) }, [a("div", {
5190
+ a("div", pr, [
5191
+ a("div", { class: d(["side-panel left-panel", { collapsed: !Pt.value }]) }, [a("div", {
5111
5192
  class: "panel-header",
5112
- onClick: n[3] ||= (e) => Dt.value = !Dt.value,
5193
+ onClick: n[3] ||= (e) => Pt.value = !Pt.value,
5113
5194
  style: { cursor: "pointer" }
5114
- }, [a("h4", null, x(Dt.value ? "类别列表" : ""), 1), a("span", pr, x(Dt.value ? "«" : "»"), 1)]), O(a("div", mr, [(g(!0), i(e, null, y(S(F).categories, (e) => (g(), i("div", {
5195
+ }, [a("h4", null, x(Pt.value ? "类别列表" : ""), 1), a("span", mr, x(Pt.value ? "«" : "»"), 1)]), D(a("div", hr, [(g(!0), i(e, null, y(S(F).categories, (e) => (g(), i("div", {
5115
5196
  key: e.id,
5116
5197
  class: d(["category-item", { active: S(I)?.id === e.id }]),
5117
- onClick: (t) => S(_e)(e, "category")
5198
+ onClick: (t) => S(Se)(e, "category")
5118
5199
  }, [
5119
5200
  a("div", {
5120
5201
  class: "category-color",
5121
5202
  style: f({ background: e.color })
5122
5203
  }, null, 4),
5123
- a("span", gr, x(e.name), 1),
5124
- a("span", _r, x(e.causes?.length || 0), 1),
5204
+ a("span", _r, x(e.name), 1),
5205
+ a("span", vr, x(e.causes?.length || 0), 1),
5125
5206
  s(l, {
5126
5207
  size: "small",
5127
5208
  circle: "",
5128
5209
  class: "delete-btn",
5129
- onClick: A((t) => Rt(e.id), ["stop"])
5210
+ onClick: k((t) => Ut(e.id), ["stop"])
5130
5211
  }, {
5131
- default: D(() => [s(c, null, {
5132
- default: D(() => [s(S(ie))]),
5212
+ default: E(() => [s(c, null, {
5213
+ default: E(() => [s(S(se))]),
5133
5214
  _: 1
5134
5215
  })]),
5135
5216
  _: 1
5136
5217
  }, 8, ["onClick"])
5137
- ], 10, hr))), 128)), s(l, {
5218
+ ], 10, gr))), 128)), s(l, {
5138
5219
  size: "small",
5139
5220
  type: "primary",
5140
5221
  class: "add-btn",
5141
- onClick: Lt
5222
+ onClick: Ht
5142
5223
  }, {
5143
- default: D(() => [s(c, null, {
5144
- default: D(() => [s(S(ge))]),
5224
+ default: E(() => [s(c, null, {
5225
+ default: E(() => [s(S(_e))]),
5145
5226
  _: 1
5146
5227
  }), n[65] ||= o(" 添加类别 ", -1)]),
5147
5228
  _: 1
5148
- })], 512), [[T, Dt.value]])], 2),
5229
+ })], 512), [[w, Pt.value]])], 2),
5149
5230
  a("div", {
5150
5231
  class: "canvas-container",
5151
5232
  ref_key: "canvasContainer",
5152
- ref: lt,
5153
- onMousedown: A(Se, ["self"])
5233
+ ref: ht,
5234
+ onMousedown: k(B, ["self"])
5154
5235
  }, [a("div", {
5155
5236
  class: d(["diagram-title-area", { "selected-title": S(L) === "title" }]),
5156
- style: f(jt.value),
5157
- onClick: A(Pt, ["stop"])
5237
+ style: f(Lt.value),
5238
+ onClick: k(zt, ["stop"])
5158
5239
  }, [a("h2", {
5159
5240
  class: "diagram-title",
5160
- style: f(Nt.value)
5161
- }, x(S(F).title || "鱼骨图分析"), 5), S(F).effect ? (g(), i("p", vr, "问题:" + x(S(F).effect), 1)) : r("", !0)], 6), a("div", {
5241
+ style: f(Rt.value)
5242
+ }, x(S(F).title || "鱼骨图分析"), 5), S(F).effect ? (g(), i("p", yr, "问题:" + x(S(F).effect), 1)) : r("", !0)], 6), a("div", {
5162
5243
  class: "canvas-wrapper",
5163
- style: f({ transform: `scale(${ft.value / 100})` }),
5164
- onMousedown: A(Se, ["self"])
5244
+ style: f({ transform: `scale(${_t.value / 100})` }),
5245
+ onMousedown: k(B, ["self"])
5165
5246
  }, [
5166
5247
  s(qn, {
5167
5248
  ref_key: "fishboneRenderer",
5168
- ref: dt,
5249
+ ref: gt,
5169
5250
  categories: S(F).categories,
5170
5251
  effect: S(F).effect,
5171
- theme: Et.value,
5252
+ theme: Mt.value,
5172
5253
  "selected-node": S(I),
5173
5254
  "style-tick": Q.value,
5174
5255
  "diagram-style": S(F).diagramStyle,
5175
5256
  width: "100%",
5176
5257
  height: "100%",
5177
- onSelectNode: Vt,
5178
- onClearSelection: Se,
5179
- onDeleteNode: gn,
5180
- onAddChild: bn,
5181
- onNodeDragged: yn,
5182
- onOpenMindmap: On
5258
+ onSelectNode: Kt,
5259
+ onClearSelection: B,
5260
+ onDeleteNode: xn,
5261
+ onAddChild: Tn,
5262
+ onNodeDragged: wn,
5263
+ onOpenMindmap: Nn
5183
5264
  }, null, 8, [
5184
5265
  "categories",
5185
5266
  "effect",
@@ -5188,56 +5269,56 @@ var fr = { class: "editor-main" }, pr = { class: "panel-toggle-icon" }, mr = { c
5188
5269
  "style-tick",
5189
5270
  "diagram-style"
5190
5271
  ]),
5191
- (g(!0), i(e, null, y(R.value, (t) => (g(), i("div", {
5272
+ (g(!0), i(e, null, y(V.value, (t) => (g(), i("div", {
5192
5273
  key: t.id,
5193
5274
  class: d(["textbox-rect", {
5194
- selected: z.value === t.id,
5195
- editing: B.value === t.id,
5196
- "show-anchors": gt.value || _t.value
5275
+ selected: H.value === t.id,
5276
+ editing: U.value === t.id,
5277
+ "show-anchors": xt.value || St.value
5197
5278
  }]),
5198
5279
  "data-textbox-id": t.id,
5199
- style: f(Ht(t)),
5200
- onMousedown: A((e) => Kt(t, e), ["stop"]),
5201
- onDblclick: A((e) => qt(t), ["stop"])
5202
- }, [O(a("textarea", {
5280
+ style: f(qt(t)),
5281
+ onMousedown: k((e) => Zt(t, e), ["stop"]),
5282
+ onDblclick: k((e) => Qt(t), ["stop"])
5283
+ }, [D(a("textarea", {
5203
5284
  class: "textbox-content",
5204
5285
  "onUpdate:modelValue": (e) => t.text = e,
5205
- style: f(Ut(t)),
5286
+ style: f(Jt(t)),
5206
5287
  placeholder: "输入文字...",
5207
- readonly: B.value !== t.id,
5208
- onBlur: (e) => Gt(t)
5209
- }, null, 44, br), [[w, t.text]]), z.value === t.id || gt.value || _t.value ? (g(), i(e, { key: 0 }, [
5288
+ readonly: U.value !== t.id,
5289
+ onBlur: (e) => Xt(t)
5290
+ }, null, 44, xr), [[C, t.text]]), H.value === t.id || xt.value || St.value ? (g(), i(e, { key: 0 }, [
5210
5291
  a("div", {
5211
5292
  class: "resize-handle resize-handle-se",
5212
- onMousedown: A((e) => Xt(t, "se", e), ["stop"])
5213
- }, null, 40, xr),
5293
+ onMousedown: k((e) => tn(t, "se", e), ["stop"])
5294
+ }, null, 40, Sr),
5214
5295
  a("div", {
5215
5296
  class: "resize-handle resize-handle-sw",
5216
- onMousedown: A((e) => Xt(t, "sw", e), ["stop"])
5217
- }, null, 40, Sr),
5297
+ onMousedown: k((e) => tn(t, "sw", e), ["stop"])
5298
+ }, null, 40, Cr),
5218
5299
  a("div", {
5219
5300
  class: "resize-handle resize-handle-ne",
5220
- onMousedown: A((e) => Xt(t, "ne", e), ["stop"])
5221
- }, null, 40, Cr),
5301
+ onMousedown: k((e) => tn(t, "ne", e), ["stop"])
5302
+ }, null, 40, wr),
5222
5303
  a("div", {
5223
5304
  class: "resize-handle resize-handle-nw",
5224
- onMousedown: A((e) => Xt(t, "nw", e), ["stop"])
5225
- }, null, 40, wr),
5305
+ onMousedown: k((e) => tn(t, "nw", e), ["stop"])
5306
+ }, null, 40, Tr),
5226
5307
  a("div", {
5227
5308
  class: "textbox-delete-btn",
5228
- onClick: A((e) => $t(t.id), ["stop"])
5229
- }, "×", 8, Tr)
5230
- ], 64)) : r("", !0)], 46, yr))), 128)),
5309
+ onClick: k((e) => an(t.id), ["stop"])
5310
+ }, "×", 8, Er)
5311
+ ], 64)) : r("", !0)], 46, br))), 128)),
5231
5312
  (g(), i("svg", {
5232
5313
  ref_key: "arrowSvgRef",
5233
- ref: Ae,
5314
+ ref: Ne,
5234
5315
  class: "arrow-lines-svg",
5235
5316
  xmlns: "http://www.w3.org/2000/svg",
5236
- viewBox: bt.value,
5317
+ viewBox: Tt.value,
5237
5318
  preserveAspectRatio: "xMidYMid meet",
5238
5319
  "pointer-events": "none"
5239
5320
  }, [
5240
- a("defs", null, [(g(!0), i(e, null, y(G.value, (e) => (g(), i("marker", {
5321
+ a("defs", null, [(g(!0), i(e, null, y(q.value, (e) => (g(), i("marker", {
5241
5322
  key: "marker-end-" + e.id,
5242
5323
  id: "arrowhead-end-" + e.id,
5243
5324
  markerWidth: "10",
@@ -5248,7 +5329,7 @@ var fr = { class: "editor-main" }, pr = { class: "panel-toggle-icon" }, mr = { c
5248
5329
  }, [a("polygon", {
5249
5330
  points: "0 0, 10 3.5, 0 7",
5250
5331
  fill: e.style.lineColor
5251
- }, null, 8, Or)], 8, Dr))), 128)), (g(!0), i(e, null, y(G.value, (e) => (g(), i("marker", {
5332
+ }, null, 8, kr)], 8, Or))), 128)), (g(!0), i(e, null, y(q.value, (e) => (g(), i("marker", {
5252
5333
  key: "marker-start-" + e.id,
5253
5334
  id: "arrowhead-start-" + e.id,
5254
5335
  markerWidth: "10",
@@ -5259,8 +5340,8 @@ var fr = { class: "editor-main" }, pr = { class: "panel-toggle-icon" }, mr = { c
5259
5340
  }, [a("polygon", {
5260
5341
  points: "10 0, 0 3.5, 10 7",
5261
5342
  fill: e.style.lineColor
5262
- }, null, 8, Ar)], 8, kr))), 128))]),
5263
- K.value || q.value || J.value || _t.value ? (g(), i("g", jr, [(g(!0), i(e, null, y(yt.value, (t) => (g(), i(e, { key: "anchors-" + t.id }, [(g(!0), i(e, null, y(rn(t), (e, r) => (g(), i("circle", {
5343
+ }, null, 8, jr)], 8, Ar))), 128))]),
5344
+ J.value || Pe.value || Fe.value || St.value ? (g(), i("g", Mr, [(g(!0), i(e, null, y(wt.value, (t) => (g(), i(e, { key: "anchors-" + t.id }, [(g(!0), i(e, null, y(ln(t), (e, r) => (g(), i("circle", {
5264
5345
  key: "anchor-" + r,
5265
5346
  cx: e.x,
5266
5347
  cy: e.y,
@@ -5271,10 +5352,10 @@ var fr = { class: "editor-main" }, pr = { class: "panel-toggle-icon" }, mr = { c
5271
5352
  opacity: "0.6",
5272
5353
  "pointer-events": "auto",
5273
5354
  style: { cursor: "crosshair" },
5274
- onMouseenter: (e) => vt.value = t.id,
5275
- onMouseleave: n[4] ||= (e) => vt.value = null,
5276
- onMousedown: A((e) => sn(t, "node", "border-" + r, e), ["stop"])
5277
- }, null, 40, Mr))), 128))], 64))), 128)), (g(!0), i(e, null, y(R.value, (t) => (g(), i(e, { key: "tb-anchors-" + t.id }, [K.value || q.value || J.value || _t.value ? (g(), i("g", Nr, [(g(!0), i(e, null, y(xt(t), (e, r) => (g(), i("circle", {
5355
+ onMouseenter: (e) => Ct.value = t.id,
5356
+ onMouseleave: n[4] ||= (e) => Ct.value = null,
5357
+ onMousedown: k((e) => fn(t, "node", "border-" + r, e), ["stop"])
5358
+ }, null, 40, Nr))), 128))], 64))), 128)), (g(!0), i(e, null, y(V.value, (t) => (g(), i(e, { key: "tb-anchors-" + t.id }, [J.value || Pe.value || Fe.value || St.value ? (g(), i("g", Pr, [(g(!0), i(e, null, y(Et(t), (e, r) => (g(), i("circle", {
5278
5359
  key: "tb-anchor-" + r,
5279
5360
  cx: e.x,
5280
5361
  cy: e.y,
@@ -5285,31 +5366,31 @@ var fr = { class: "editor-main" }, pr = { class: "panel-toggle-icon" }, mr = { c
5285
5366
  opacity: "0.7",
5286
5367
  "pointer-events": "auto",
5287
5368
  style: { cursor: "crosshair" },
5288
- onMouseenter: (e) => vt.value = t.id,
5289
- onMouseleave: n[5] ||= (e) => vt.value = null,
5290
- onMousedown: A((e) => sn(t, "textbox", "border-" + r, e), ["stop"])
5291
- }, null, 40, Pr))), 128))])) : r("", !0)], 64))), 128))])) : r("", !0),
5292
- (g(!0), i(e, null, y(G.value, (t) => (g(), i("g", { key: t.id }, [
5369
+ onMouseenter: (e) => Ct.value = t.id,
5370
+ onMouseleave: n[5] ||= (e) => Ct.value = null,
5371
+ onMousedown: k((e) => fn(t, "textbox", "border-" + r, e), ["stop"])
5372
+ }, null, 40, Fr))), 128))])) : r("", !0)], 64))), 128))])) : r("", !0),
5373
+ (g(!0), i(e, null, y(q.value, (t) => (g(), i("g", { key: t.id }, [
5293
5374
  a("path", {
5294
- d: nn(t),
5375
+ d: cn(t),
5295
5376
  fill: "none",
5296
- stroke: K.value === t.id ? "#409EFF" : t.style.lineColor,
5377
+ stroke: J.value === t.id ? "#409EFF" : t.style.lineColor,
5297
5378
  "stroke-width": t.style.lineWidth,
5298
5379
  "stroke-dasharray": t.style.lineStyle === "dashed" ? "8,4" : "none",
5299
5380
  "marker-end": t.style.arrowEnd ? `url(#arrowhead-end-${t.id})` : "",
5300
5381
  "marker-start": t.style.arrowStart ? `url(#arrowhead-start-${t.id})` : "",
5301
5382
  "pointer-events": "none"
5302
- }, null, 8, Fr),
5383
+ }, null, 8, Ir),
5303
5384
  a("path", {
5304
- d: nn(t),
5385
+ d: cn(t),
5305
5386
  fill: "none",
5306
5387
  stroke: "rgba(0,0,0,0.01)",
5307
5388
  "stroke-width": Math.max(t.style.lineWidth * 3, 12),
5308
5389
  "pointer-events": "auto",
5309
5390
  style: { cursor: "move" },
5310
- onMousedown: A((e) => fn(t, e), ["stop"])
5311
- }, null, 40, Ir),
5312
- K.value === t.id ? (g(), i("circle", {
5391
+ onMousedown: k((e) => _n(t, e), ["stop"])
5392
+ }, null, 40, Lr),
5393
+ J.value === t.id ? (g(), i("circle", {
5313
5394
  key: 0,
5314
5395
  cx: t.startX,
5315
5396
  cy: t.startY,
@@ -5317,9 +5398,9 @@ var fr = { class: "editor-main" }, pr = { class: "panel-toggle-icon" }, mr = { c
5317
5398
  fill: "#409EFF",
5318
5399
  "pointer-events": "auto",
5319
5400
  style: { cursor: "move" },
5320
- onMousedown: A((e) => ln(t, "start", e), ["stop"])
5321
- }, null, 40, Lr)) : r("", !0),
5322
- K.value === t.id ? (g(), i("circle", {
5401
+ onMousedown: k((e) => mn(t, "start", e), ["stop"])
5402
+ }, null, 40, Rr)) : r("", !0),
5403
+ J.value === t.id ? (g(), i("circle", {
5323
5404
  key: 1,
5324
5405
  cx: t.endX,
5325
5406
  cy: t.endY,
@@ -5327,23 +5408,23 @@ var fr = { class: "editor-main" }, pr = { class: "panel-toggle-icon" }, mr = { c
5327
5408
  fill: "#409EFF",
5328
5409
  "pointer-events": "auto",
5329
5410
  style: { cursor: "move" },
5330
- onMousedown: A((e) => ln(t, "end", e), ["stop"])
5331
- }, null, 40, Rr)) : r("", !0),
5332
- K.value === t.id ? (g(), i(e, { key: 2 }, [
5411
+ onMousedown: k((e) => mn(t, "end", e), ["stop"])
5412
+ }, null, 40, zr)) : r("", !0),
5413
+ J.value === t.id ? (g(), i(e, { key: 2 }, [
5333
5414
  a("circle", {
5334
5415
  cx: t.startX,
5335
5416
  cy: t.startY,
5336
5417
  r: "4",
5337
5418
  fill: "#409EFF",
5338
5419
  "pointer-events": "none"
5339
- }, null, 8, zr),
5420
+ }, null, 8, Br),
5340
5421
  a("circle", {
5341
5422
  cx: t.endX,
5342
5423
  cy: t.endY,
5343
5424
  r: "4",
5344
5425
  fill: "#409EFF",
5345
5426
  "pointer-events": "none"
5346
- }, null, 8, Br),
5427
+ }, null, 8, Vr),
5347
5428
  t.style.lineType === "curve" ? (g(), i(e, { key: 0 }, [
5348
5429
  a("line", {
5349
5430
  x1: (t.startX + t.endX) / 2,
@@ -5355,7 +5436,7 @@ var fr = { class: "editor-main" }, pr = { class: "panel-toggle-icon" }, mr = { c
5355
5436
  "stroke-dasharray": "4,3",
5356
5437
  opacity: "0.5",
5357
5438
  "pointer-events": "none"
5358
- }, null, 8, Vr),
5439
+ }, null, 8, Hr),
5359
5440
  a("line", {
5360
5441
  x1: t.startX,
5361
5442
  y1: t.startY,
@@ -5366,7 +5447,7 @@ var fr = { class: "editor-main" }, pr = { class: "panel-toggle-icon" }, mr = { c
5366
5447
  "stroke-dasharray": "4,3",
5367
5448
  opacity: "0.3",
5368
5449
  "pointer-events": "none"
5369
- }, null, 8, Hr),
5450
+ }, null, 8, Ur),
5370
5451
  a("line", {
5371
5452
  x1: t.endX,
5372
5453
  y1: t.endY,
@@ -5377,7 +5458,7 @@ var fr = { class: "editor-main" }, pr = { class: "panel-toggle-icon" }, mr = { c
5377
5458
  "stroke-dasharray": "4,3",
5378
5459
  opacity: "0.3",
5379
5460
  "pointer-events": "none"
5380
- }, null, 8, Ur),
5461
+ }, null, 8, Wr),
5381
5462
  a("circle", {
5382
5463
  cx: t.cpX,
5383
5464
  cy: t.cpY,
@@ -5386,13 +5467,13 @@ var fr = { class: "editor-main" }, pr = { class: "panel-toggle-icon" }, mr = { c
5386
5467
  stroke: "white",
5387
5468
  "stroke-width": "2",
5388
5469
  style: { cursor: "grab" },
5389
- onMousedown: A((e) => pn(t, e), ["stop"])
5390
- }, null, 40, Wr)
5470
+ onMousedown: k((e) => vn(t, e), ["stop"])
5471
+ }, null, 40, Gr)
5391
5472
  ], 64)) : r("", !0),
5392
5473
  a("g", {
5393
5474
  transform: `translate(${(t.startX + t.endX) / 2}, ${(t.startY + t.endY) / 2 - 16})`,
5394
5475
  style: { cursor: "pointer" },
5395
- onClick: A((e) => tn(t.id), ["stop"])
5476
+ onClick: k((e) => sn(t.id), ["stop"])
5396
5477
  }, [...n[66] ||= [
5397
5478
  a("circle", {
5398
5479
  r: "9",
@@ -5417,23 +5498,23 @@ var fr = { class: "editor-main" }, pr = { class: "panel-toggle-icon" }, mr = { c
5417
5498
  "stroke-width": "2",
5418
5499
  "stroke-linecap": "round"
5419
5500
  }, null, -1)
5420
- ]], 8, Gr)
5501
+ ]], 8, Kr)
5421
5502
  ], 64)) : r("", !0)
5422
5503
  ]))), 128))
5423
- ], 8, Er))
5504
+ ], 8, Dr))
5424
5505
  ], 36)], 544),
5425
- a("div", { class: d(["side-panel right-panel", { collapsed: !Ot.value }]) }, [a("div", {
5506
+ a("div", { class: d(["side-panel right-panel", { collapsed: !Ft.value }]) }, [a("div", {
5426
5507
  class: "panel-header",
5427
- onClick: n[6] ||= (e) => Ot.value = !Ot.value,
5508
+ onClick: n[6] ||= (e) => Ft.value = !Ft.value,
5428
5509
  style: { cursor: "pointer" }
5429
- }, [a("h4", null, x(Ot.value ? S(L) === "title" ? "标题设置" : Z.value ? "文本框设置" : Y.value ? "箭头线设置" : S(L) ? "节点详情" : "属性面板" : ""), 1)]), O(a("div", Kr, [
5430
- S(I) ? (g(), i(e, { key: 0 }, [S(L) === "title" ? (g(), i("div", qr, [s(P, {
5510
+ }, [a("h4", null, x(Ft.value ? S(L) === "title" ? "标题设置" : Z.value ? "文本框设置" : Y.value ? "箭头线设置" : S(L) ? "节点详情" : "属性面板" : ""), 1)]), D(a("div", qr, [
5511
+ S(I) ? (g(), i(e, { key: 0 }, [S(L) === "title" ? (g(), i("div", Jr, [s(te, {
5431
5512
  "label-position": "top",
5432
5513
  size: "small"
5433
5514
  }, {
5434
- default: D(() => [
5515
+ default: E(() => [
5435
5516
  s(p, { label: "标题文本" }, {
5436
- default: D(() => [s(u, {
5517
+ default: E(() => [s(u, {
5437
5518
  modelValue: S(F).title,
5438
5519
  "onUpdate:modelValue": n[7] ||= (e) => S(F).title = e,
5439
5520
  tabindex: "-1"
@@ -5441,12 +5522,12 @@ var fr = { class: "editor-main" }, pr = { class: "panel-toggle-icon" }, mr = { c
5441
5522
  _: 1
5442
5523
  }),
5443
5524
  s(p, { label: "字体" }, {
5444
- default: D(() => [s(v, {
5525
+ default: E(() => [s(h, {
5445
5526
  modelValue: S(F).titleStyle.fontFamily,
5446
5527
  "onUpdate:modelValue": n[8] ||= (e) => S(F).titleStyle.fontFamily = e,
5447
5528
  style: { width: "100%" }
5448
5529
  }, {
5449
- default: D(() => [
5530
+ default: E(() => [
5450
5531
  s(m, {
5451
5532
  label: "微软雅黑",
5452
5533
  value: "Microsoft YaHei"
@@ -5477,7 +5558,7 @@ var fr = { class: "editor-main" }, pr = { class: "panel-toggle-icon" }, mr = { c
5477
5558
  _: 1
5478
5559
  }),
5479
5560
  s(p, { label: "字号" }, {
5480
- default: D(() => [s(E, {
5561
+ default: E(() => [s(v, {
5481
5562
  modelValue: S(F).titleStyle.fontSize,
5482
5563
  "onUpdate:modelValue": n[9] ||= (e) => S(F).titleStyle.fontSize = e,
5483
5564
  min: 12,
@@ -5488,21 +5569,21 @@ var fr = { class: "editor-main" }, pr = { class: "panel-toggle-icon" }, mr = { c
5488
5569
  _: 1
5489
5570
  }),
5490
5571
  s(p, { label: "文字颜色" }, {
5491
- default: D(() => [s(k, {
5572
+ default: E(() => [s(T, {
5492
5573
  modelValue: S(F).titleStyle.color,
5493
5574
  "onUpdate:modelValue": n[10] ||= (e) => S(F).titleStyle.color = e
5494
5575
  }, null, 8, ["modelValue"])]),
5495
5576
  _: 1
5496
5577
  }),
5497
5578
  s(p, { label: "标题背景色" }, {
5498
- default: D(() => [s(k, {
5579
+ default: E(() => [s(T, {
5499
5580
  modelValue: S(F).titleStyle.bgColor,
5500
5581
  "onUpdate:modelValue": n[11] ||= (e) => S(F).titleStyle.bgColor = e
5501
5582
  }, null, 8, ["modelValue"])]),
5502
5583
  _: 1
5503
5584
  }),
5504
5585
  s(p, { label: "背景透明度" }, {
5505
- default: D(() => [s(E, {
5586
+ default: E(() => [s(v, {
5506
5587
  modelValue: S(F).titleStyle.bgOpacity,
5507
5588
  "onUpdate:modelValue": n[12] ||= (e) => S(F).titleStyle.bgOpacity = e,
5508
5589
  min: 0,
@@ -5513,21 +5594,21 @@ var fr = { class: "editor-main" }, pr = { class: "panel-toggle-icon" }, mr = { c
5513
5594
  _: 1
5514
5595
  }),
5515
5596
  s(p, { label: "对齐方式" }, {
5516
- default: D(() => [s(N, {
5597
+ default: E(() => [s(A, {
5517
5598
  modelValue: S(F).titleStyle.textAlign,
5518
5599
  "onUpdate:modelValue": n[13] ||= (e) => S(F).titleStyle.textAlign = e
5519
5600
  }, {
5520
- default: D(() => [
5521
- s(M, { value: "left" }, {
5522
- default: D(() => [...n[67] ||= [o("左", -1)]]),
5601
+ default: E(() => [
5602
+ s(O, { value: "left" }, {
5603
+ default: E(() => [...n[67] ||= [o("左", -1)]]),
5523
5604
  _: 1
5524
5605
  }),
5525
- s(M, { value: "center" }, {
5526
- default: D(() => [...n[68] ||= [o("中", -1)]]),
5606
+ s(O, { value: "center" }, {
5607
+ default: E(() => [...n[68] ||= [o("中", -1)]]),
5527
5608
  _: 1
5528
5609
  }),
5529
- s(M, { value: "right" }, {
5530
- default: D(() => [...n[69] ||= [o("右", -1)]]),
5610
+ s(O, { value: "right" }, {
5611
+ default: E(() => [...n[69] ||= [o("右", -1)]]),
5531
5612
  _: 1
5532
5613
  })
5533
5614
  ]),
@@ -5537,35 +5618,35 @@ var fr = { class: "editor-main" }, pr = { class: "panel-toggle-icon" }, mr = { c
5537
5618
  })
5538
5619
  ]),
5539
5620
  _: 1
5540
- })])) : (g(), i("div", Jr, [s(P, {
5621
+ })])) : (g(), i("div", Yr, [s(te, {
5541
5622
  "label-position": "top",
5542
5623
  size: "small"
5543
5624
  }, {
5544
- default: D(() => [
5625
+ default: E(() => [
5545
5626
  s(p, { label: S(L) === "category" ? "类别名称" : "节点文本" }, {
5546
- default: D(() => [a("input", {
5627
+ default: E(() => [a("input", {
5547
5628
  class: "node-name-input",
5548
5629
  value: S(L) === "category" ? S(I).name : S(I).text,
5549
5630
  onInput: n[14] ||= (e) => S(L) === "category" ? S(I).name = e.target.value : S(I).text = e.target.value,
5550
5631
  onFocus: n[15] ||= (e) => e.target.select(),
5551
5632
  spellcheck: "false"
5552
- }, null, 40, Yr)]),
5633
+ }, null, 40, Xr)]),
5553
5634
  _: 1
5554
5635
  }, 8, ["label"]),
5555
5636
  S(I).style ? (g(), i(e, { key: 0 }, [
5556
- s(ee, { "content-position": "left" }, {
5557
- default: D(() => [...n[70] ||= [o("外观", -1)]]),
5637
+ s(j, { "content-position": "left" }, {
5638
+ default: E(() => [...n[70] ||= [o("外观", -1)]]),
5558
5639
  _: 1
5559
5640
  }),
5560
5641
  s(p, { label: "节点颜色" }, {
5561
- default: D(() => [s(k, {
5642
+ default: E(() => [s(T, {
5562
5643
  modelValue: S(I).color,
5563
5644
  "onUpdate:modelValue": [n[16] ||= (e) => S(I).color = e, n[17] ||= (e) => Q.value++]
5564
5645
  }, null, 8, ["modelValue"])]),
5565
5646
  _: 1
5566
5647
  }),
5567
5648
  s(p, { label: "节点透明度" }, {
5568
- default: D(() => [s(E, {
5649
+ default: E(() => [s(v, {
5569
5650
  modelValue: S(I).style.opacity,
5570
5651
  "onUpdate:modelValue": [n[18] ||= (e) => S(I).style.opacity = e, n[19] ||= (e) => Q.value++],
5571
5652
  min: 0,
@@ -5575,34 +5656,34 @@ var fr = { class: "editor-main" }, pr = { class: "panel-toggle-icon" }, mr = { c
5575
5656
  }, null, 8, ["modelValue"])]),
5576
5657
  _: 1
5577
5658
  }),
5578
- s(ee, { "content-position": "left" }, {
5579
- default: D(() => [...n[71] ||= [o("边框", -1)]]),
5659
+ s(j, { "content-position": "left" }, {
5660
+ default: E(() => [...n[71] ||= [o("边框", -1)]]),
5580
5661
  _: 1
5581
5662
  }),
5582
5663
  s(p, { label: "边框颜色" }, {
5583
- default: D(() => [s(k, {
5664
+ default: E(() => [s(T, {
5584
5665
  modelValue: S(I).style.borderColor,
5585
5666
  "onUpdate:modelValue": [n[20] ||= (e) => S(I).style.borderColor = e, n[21] ||= (e) => Q.value++]
5586
5667
  }, null, 8, ["modelValue"])]),
5587
5668
  _: 1
5588
5669
  }),
5589
5670
  s(p, { label: "边框样式" }, {
5590
- default: D(() => [s(N, {
5671
+ default: E(() => [s(A, {
5591
5672
  modelValue: S(I).style.borderStyle,
5592
5673
  "onUpdate:modelValue": n[22] ||= (e) => S(I).style.borderStyle = e,
5593
5674
  onChange: n[23] ||= (e) => Q.value++
5594
5675
  }, {
5595
- default: D(() => [
5596
- s(M, { value: "solid" }, {
5597
- default: D(() => [...n[72] ||= [o("实线", -1)]]),
5676
+ default: E(() => [
5677
+ s(O, { value: "solid" }, {
5678
+ default: E(() => [...n[72] ||= [o("实线", -1)]]),
5598
5679
  _: 1
5599
5680
  }),
5600
- s(M, { value: "dashed" }, {
5601
- default: D(() => [...n[73] ||= [o("虚线", -1)]]),
5681
+ s(O, { value: "dashed" }, {
5682
+ default: E(() => [...n[73] ||= [o("虚线", -1)]]),
5602
5683
  _: 1
5603
5684
  }),
5604
- s(M, { value: "none" }, {
5605
- default: D(() => [...n[74] ||= [o("无边框", -1)]]),
5685
+ s(O, { value: "none" }, {
5686
+ default: E(() => [...n[74] ||= [o("无边框", -1)]]),
5606
5687
  _: 1
5607
5688
  })
5608
5689
  ]),
@@ -5611,7 +5692,7 @@ var fr = { class: "editor-main" }, pr = { class: "panel-toggle-icon" }, mr = { c
5611
5692
  _: 1
5612
5693
  }),
5613
5694
  s(p, { label: "边框宽度" }, {
5614
- default: D(() => [s(E, {
5695
+ default: E(() => [s(v, {
5615
5696
  modelValue: S(I).style.borderWidth,
5616
5697
  "onUpdate:modelValue": [n[24] ||= (e) => S(I).style.borderWidth = e, n[25] ||= (e) => Q.value++],
5617
5698
  min: 0,
@@ -5621,19 +5702,19 @@ var fr = { class: "editor-main" }, pr = { class: "panel-toggle-icon" }, mr = { c
5621
5702
  }, null, 8, ["modelValue"])]),
5622
5703
  _: 1
5623
5704
  }),
5624
- s(ee, { "content-position": "left" }, {
5625
- default: D(() => [...n[75] ||= [o("文字", -1)]]),
5705
+ s(j, { "content-position": "left" }, {
5706
+ default: E(() => [...n[75] ||= [o("文字", -1)]]),
5626
5707
  _: 1
5627
5708
  }),
5628
5709
  s(p, { label: "文字颜色" }, {
5629
- default: D(() => [s(k, {
5710
+ default: E(() => [s(T, {
5630
5711
  modelValue: S(I).style.textColor,
5631
5712
  "onUpdate:modelValue": [n[26] ||= (e) => S(I).style.textColor = e, n[27] ||= (e) => Q.value++]
5632
5713
  }, null, 8, ["modelValue"])]),
5633
5714
  _: 1
5634
5715
  }),
5635
5716
  s(p, { label: "字号" }, {
5636
- default: D(() => [s(E, {
5717
+ default: E(() => [s(v, {
5637
5718
  modelValue: S(I).style.fontSize,
5638
5719
  "onUpdate:modelValue": [n[28] ||= (e) => S(I).style.fontSize = e, n[29] ||= (e) => Q.value++],
5639
5720
  min: 8,
@@ -5644,7 +5725,7 @@ var fr = { class: "editor-main" }, pr = { class: "panel-toggle-icon" }, mr = { c
5644
5725
  _: 1
5645
5726
  }),
5646
5727
  s(p, { label: "字体" }, {
5647
- default: D(() => [O(a("select", {
5728
+ default: E(() => [D(a("select", {
5648
5729
  class: "node-font-select",
5649
5730
  "onUpdate:modelValue": n[30] ||= (e) => S(I).style.fontFamily = e,
5650
5731
  onChange: n[31] ||= (e) => Q.value++
@@ -5653,26 +5734,26 @@ var fr = { class: "editor-main" }, pr = { class: "panel-toggle-icon" }, mr = { c
5653
5734
  a("option", { value: "SimSun" }, "宋体", -1),
5654
5735
  a("option", { value: "SimHei" }, "黑体", -1),
5655
5736
  a("option", { value: "Arial" }, "Arial", -1)
5656
- ]], 544), [[C, S(I).style.fontFamily]])]),
5737
+ ]], 544), [[ee, S(I).style.fontFamily]])]),
5657
5738
  _: 1
5658
5739
  }),
5659
5740
  s(p, { label: "对齐方式" }, {
5660
- default: D(() => [s(N, {
5741
+ default: E(() => [s(A, {
5661
5742
  modelValue: S(I).style.textAlign,
5662
5743
  "onUpdate:modelValue": n[32] ||= (e) => S(I).style.textAlign = e,
5663
5744
  onChange: n[33] ||= (e) => Q.value++
5664
5745
  }, {
5665
- default: D(() => [
5666
- s(M, { value: "left" }, {
5667
- default: D(() => [...n[77] ||= [o("左", -1)]]),
5746
+ default: E(() => [
5747
+ s(O, { value: "left" }, {
5748
+ default: E(() => [...n[77] ||= [o("左", -1)]]),
5668
5749
  _: 1
5669
5750
  }),
5670
- s(M, { value: "center" }, {
5671
- default: D(() => [...n[78] ||= [o("中", -1)]]),
5751
+ s(O, { value: "center" }, {
5752
+ default: E(() => [...n[78] ||= [o("中", -1)]]),
5672
5753
  _: 1
5673
5754
  }),
5674
- s(M, { value: "right" }, {
5675
- default: D(() => [...n[79] ||= [o("右", -1)]]),
5755
+ s(O, { value: "right" }, {
5756
+ default: E(() => [...n[79] ||= [o("右", -1)]]),
5676
5757
  _: 1
5677
5758
  })
5678
5759
  ]),
@@ -5680,19 +5761,19 @@ var fr = { class: "editor-main" }, pr = { class: "panel-toggle-icon" }, mr = { c
5680
5761
  }, 8, ["modelValue"])]),
5681
5762
  _: 1
5682
5763
  }),
5683
- s(ee, { "content-position": "left" }, {
5684
- default: D(() => [...n[80] ||= [o("连接线", -1)]]),
5764
+ s(j, { "content-position": "left" }, {
5765
+ default: E(() => [...n[80] ||= [o("连接线", -1)]]),
5685
5766
  _: 1
5686
5767
  }),
5687
5768
  s(p, { label: "连接线颜色" }, {
5688
- default: D(() => [s(k, {
5769
+ default: E(() => [s(T, {
5689
5770
  modelValue: S(I).style.lineColor,
5690
5771
  "onUpdate:modelValue": [n[34] ||= (e) => S(I).style.lineColor = e, n[35] ||= (e) => Q.value++]
5691
5772
  }, null, 8, ["modelValue"])]),
5692
5773
  _: 1
5693
5774
  }),
5694
5775
  s(p, { label: "连接线透明度" }, {
5695
- default: D(() => [s(E, {
5776
+ default: E(() => [s(v, {
5696
5777
  modelValue: S(I).style.lineOpacity,
5697
5778
  "onUpdate:modelValue": [n[36] ||= (e) => S(I).style.lineOpacity = e, n[37] ||= (e) => Q.value++],
5698
5779
  min: 0,
@@ -5703,16 +5784,16 @@ var fr = { class: "editor-main" }, pr = { class: "panel-toggle-icon" }, mr = { c
5703
5784
  _: 1
5704
5785
  }),
5705
5786
  s(p, { label: "连接线类型" }, {
5706
- default: D(() => [s(N, {
5787
+ default: E(() => [s(A, {
5707
5788
  modelValue: S(I).style.lineStyle,
5708
5789
  "onUpdate:modelValue": n[38] ||= (e) => S(I).style.lineStyle = e,
5709
5790
  onChange: n[39] ||= (e) => Q.value++
5710
5791
  }, {
5711
- default: D(() => [s(M, { value: "solid" }, {
5712
- default: D(() => [...n[81] ||= [o("实线", -1)]]),
5792
+ default: E(() => [s(O, { value: "solid" }, {
5793
+ default: E(() => [...n[81] ||= [o("实线", -1)]]),
5713
5794
  _: 1
5714
- }), s(M, { value: "dashed" }, {
5715
- default: D(() => [...n[82] ||= [o("虚线", -1)]]),
5795
+ }), s(O, { value: "dashed" }, {
5796
+ default: E(() => [...n[82] ||= [o("虚线", -1)]]),
5716
5797
  _: 1
5717
5798
  })]),
5718
5799
  _: 1
@@ -5720,10 +5801,10 @@ var fr = { class: "editor-main" }, pr = { class: "panel-toggle-icon" }, mr = { c
5720
5801
  _: 1
5721
5802
  })
5722
5803
  ], 64)) : r("", !0),
5723
- S(L) === "cause" ? (g(), i(e, { key: 1 }, [s(ee, { "content-position": "left" }, {
5724
- default: D(() => [...n[83] ||= [o("措施", -1)]]),
5804
+ S(L) === "cause" ? (g(), i(e, { key: 1 }, [s(j, { "content-position": "left" }, {
5805
+ default: E(() => [...n[83] ||= [o("措施", -1)]]),
5725
5806
  _: 1
5726
- }), a("div", Xr, [(g(!0), i(e, null, y(S(I).children, (e) => (g(), i("div", {
5807
+ }), a("div", Zr, [(g(!0), i(e, null, y(S(I).children, (e) => (g(), i("div", {
5727
5808
  key: e.id,
5728
5809
  class: "child-item"
5729
5810
  }, [s(u, {
@@ -5734,19 +5815,19 @@ var fr = { class: "editor-main" }, pr = { class: "panel-toggle-icon" }, mr = { c
5734
5815
  }, null, 8, ["modelValue", "onUpdate:modelValue"]), s(l, {
5735
5816
  size: "small",
5736
5817
  circle: "",
5737
- onClick: (t) => Bt(e.id)
5818
+ onClick: (t) => Gt(e.id)
5738
5819
  }, {
5739
- default: D(() => [s(c, null, {
5740
- default: D(() => [s(S(ie))]),
5820
+ default: E(() => [s(c, null, {
5821
+ default: E(() => [s(S(se))]),
5741
5822
  _: 1
5742
5823
  })]),
5743
5824
  _: 1
5744
5825
  }, 8, ["onClick"])]))), 128)), s(l, {
5745
5826
  size: "small",
5746
- onClick: zt
5827
+ onClick: Wt
5747
5828
  }, {
5748
- default: D(() => [s(c, null, {
5749
- default: D(() => [s(S(ge))]),
5829
+ default: E(() => [s(c, null, {
5830
+ default: E(() => [s(S(_e))]),
5750
5831
  _: 1
5751
5832
  }), n[84] ||= o(" 添加措施 ", -1)]),
5752
5833
  _: 1
@@ -5754,24 +5835,24 @@ var fr = { class: "editor-main" }, pr = { class: "panel-toggle-icon" }, mr = { c
5754
5835
  ]),
5755
5836
  _: 1
5756
5837
  })]))], 64)) : r("", !0),
5757
- Z.value ? (g(), i("div", Zr, [s(P, {
5838
+ Z.value ? (g(), i("div", Qr, [s(te, {
5758
5839
  "label-position": "top",
5759
5840
  size: "small"
5760
5841
  }, {
5761
- default: D(() => [
5762
- s(ee, { "content-position": "left" }, {
5763
- default: D(() => [...n[85] ||= [o("文本框设置", -1)]]),
5842
+ default: E(() => [
5843
+ s(j, { "content-position": "left" }, {
5844
+ default: E(() => [...n[85] ||= [o("文本框设置", -1)]]),
5764
5845
  _: 1
5765
5846
  }),
5766
5847
  s(p, { label: "背景颜色" }, {
5767
- default: D(() => [s(k, {
5848
+ default: E(() => [s(T, {
5768
5849
  modelValue: Z.value.style.bgColor,
5769
5850
  "onUpdate:modelValue": n[40] ||= (e) => Z.value.style.bgColor = e
5770
5851
  }, null, 8, ["modelValue"])]),
5771
5852
  _: 1
5772
5853
  }),
5773
5854
  s(p, { label: "背景透明度" }, {
5774
- default: D(() => [s(E, {
5855
+ default: E(() => [s(v, {
5775
5856
  modelValue: Z.value.style.bgOpacity,
5776
5857
  "onUpdate:modelValue": n[41] ||= (e) => Z.value.style.bgOpacity = e,
5777
5858
  min: 0,
@@ -5782,12 +5863,12 @@ var fr = { class: "editor-main" }, pr = { class: "panel-toggle-icon" }, mr = { c
5782
5863
  _: 1
5783
5864
  }),
5784
5865
  s(p, { label: "字体" }, {
5785
- default: D(() => [s(v, {
5866
+ default: E(() => [s(h, {
5786
5867
  modelValue: Z.value.style.fontFamily,
5787
5868
  "onUpdate:modelValue": n[42] ||= (e) => Z.value.style.fontFamily = e,
5788
5869
  style: { width: "100%" }
5789
5870
  }, {
5790
- default: D(() => [
5871
+ default: E(() => [
5791
5872
  s(m, {
5792
5873
  label: "微软雅黑",
5793
5874
  value: "Microsoft YaHei"
@@ -5818,7 +5899,7 @@ var fr = { class: "editor-main" }, pr = { class: "panel-toggle-icon" }, mr = { c
5818
5899
  _: 1
5819
5900
  }),
5820
5901
  s(p, { label: "字号" }, {
5821
- default: D(() => [s(E, {
5902
+ default: E(() => [s(v, {
5822
5903
  modelValue: Z.value.style.fontSize,
5823
5904
  "onUpdate:modelValue": n[43] ||= (e) => Z.value.style.fontSize = e,
5824
5905
  min: 10,
@@ -5829,28 +5910,28 @@ var fr = { class: "editor-main" }, pr = { class: "panel-toggle-icon" }, mr = { c
5829
5910
  _: 1
5830
5911
  }),
5831
5912
  s(p, { label: "字体颜色" }, {
5832
- default: D(() => [s(k, {
5913
+ default: E(() => [s(T, {
5833
5914
  modelValue: Z.value.style.textColor,
5834
5915
  "onUpdate:modelValue": n[44] ||= (e) => Z.value.style.textColor = e
5835
5916
  }, null, 8, ["modelValue"])]),
5836
5917
  _: 1
5837
5918
  }),
5838
5919
  s(p, { label: "对齐方式" }, {
5839
- default: D(() => [s(N, {
5920
+ default: E(() => [s(A, {
5840
5921
  modelValue: Z.value.style.textAlign,
5841
5922
  "onUpdate:modelValue": n[45] ||= (e) => Z.value.style.textAlign = e
5842
5923
  }, {
5843
- default: D(() => [
5844
- s(M, { value: "left" }, {
5845
- default: D(() => [...n[86] ||= [o("左对齐", -1)]]),
5924
+ default: E(() => [
5925
+ s(O, { value: "left" }, {
5926
+ default: E(() => [...n[86] ||= [o("左对齐", -1)]]),
5846
5927
  _: 1
5847
5928
  }),
5848
- s(M, { value: "center" }, {
5849
- default: D(() => [...n[87] ||= [o("居中", -1)]]),
5929
+ s(O, { value: "center" }, {
5930
+ default: E(() => [...n[87] ||= [o("居中", -1)]]),
5850
5931
  _: 1
5851
5932
  }),
5852
- s(M, { value: "right" }, {
5853
- default: D(() => [...n[88] ||= [o("右对齐", -1)]]),
5933
+ s(O, { value: "right" }, {
5934
+ default: E(() => [...n[88] ||= [o("右对齐", -1)]]),
5854
5935
  _: 1
5855
5936
  })
5856
5937
  ]),
@@ -5859,12 +5940,12 @@ var fr = { class: "editor-main" }, pr = { class: "panel-toggle-icon" }, mr = { c
5859
5940
  _: 1
5860
5941
  }),
5861
5942
  s(p, { label: "字体样式" }, {
5862
- default: D(() => [s(v, {
5943
+ default: E(() => [s(h, {
5863
5944
  modelValue: Z.value.style.fontStyle,
5864
5945
  "onUpdate:modelValue": n[46] ||= (e) => Z.value.style.fontStyle = e,
5865
5946
  style: { width: "100%" }
5866
5947
  }, {
5867
- default: D(() => [
5948
+ default: E(() => [
5868
5949
  s(m, {
5869
5950
  label: "正常",
5870
5951
  value: "normal"
@@ -5897,24 +5978,24 @@ var fr = { class: "editor-main" }, pr = { class: "panel-toggle-icon" }, mr = { c
5897
5978
  ]),
5898
5979
  _: 1
5899
5980
  })])) : r("", !0),
5900
- Y.value ? (g(), i("div", Qr, [s(P, {
5981
+ Y.value ? (g(), i("div", $r, [s(te, {
5901
5982
  "label-position": "top",
5902
5983
  size: "small"
5903
5984
  }, {
5904
- default: D(() => [
5905
- s(ee, { "content-position": "left" }, {
5906
- default: D(() => [...n[89] ||= [o("箭头线设置", -1)]]),
5985
+ default: E(() => [
5986
+ s(j, { "content-position": "left" }, {
5987
+ default: E(() => [...n[89] ||= [o("箭头线设置", -1)]]),
5907
5988
  _: 1
5908
5989
  }),
5909
5990
  s(p, { label: "线段颜色" }, {
5910
- default: D(() => [s(k, {
5991
+ default: E(() => [s(T, {
5911
5992
  modelValue: Y.value.style.lineColor,
5912
5993
  "onUpdate:modelValue": n[47] ||= (e) => Y.value.style.lineColor = e
5913
5994
  }, null, 8, ["modelValue"])]),
5914
5995
  _: 1
5915
5996
  }),
5916
5997
  s(p, { label: "线段粗细" }, {
5917
- default: D(() => [s(E, {
5998
+ default: E(() => [s(v, {
5918
5999
  modelValue: Y.value.style.lineWidth,
5919
6000
  "onUpdate:modelValue": n[48] ||= (e) => Y.value.style.lineWidth = e,
5920
6001
  min: 1,
@@ -5925,15 +6006,15 @@ var fr = { class: "editor-main" }, pr = { class: "panel-toggle-icon" }, mr = { c
5925
6006
  _: 1
5926
6007
  }),
5927
6008
  s(p, { label: "线段样式" }, {
5928
- default: D(() => [s(N, {
6009
+ default: E(() => [s(A, {
5929
6010
  modelValue: Y.value.style.lineStyle,
5930
6011
  "onUpdate:modelValue": n[49] ||= (e) => Y.value.style.lineStyle = e
5931
6012
  }, {
5932
- default: D(() => [s(M, { value: "solid" }, {
5933
- default: D(() => [...n[90] ||= [o("实线", -1)]]),
6013
+ default: E(() => [s(O, { value: "solid" }, {
6014
+ default: E(() => [...n[90] ||= [o("实线", -1)]]),
5934
6015
  _: 1
5935
- }), s(M, { value: "dashed" }, {
5936
- default: D(() => [...n[91] ||= [o("虚线", -1)]]),
6016
+ }), s(O, { value: "dashed" }, {
6017
+ default: E(() => [...n[91] ||= [o("虚线", -1)]]),
5937
6018
  _: 1
5938
6019
  })]),
5939
6020
  _: 1
@@ -5941,15 +6022,15 @@ var fr = { class: "editor-main" }, pr = { class: "panel-toggle-icon" }, mr = { c
5941
6022
  _: 1
5942
6023
  }),
5943
6024
  s(p, { label: "线段类型" }, {
5944
- default: D(() => [s(N, {
6025
+ default: E(() => [s(A, {
5945
6026
  modelValue: Y.value.style.lineType,
5946
6027
  "onUpdate:modelValue": n[50] ||= (e) => Y.value.style.lineType = e
5947
6028
  }, {
5948
- default: D(() => [s(M, { value: "straight" }, {
5949
- default: D(() => [...n[92] ||= [o("直线", -1)]]),
6029
+ default: E(() => [s(O, { value: "straight" }, {
6030
+ default: E(() => [...n[92] ||= [o("直线", -1)]]),
5950
6031
  _: 1
5951
- }), s(M, { value: "curve" }, {
5952
- default: D(() => [...n[93] ||= [o("曲线", -1)]]),
6032
+ }), s(O, { value: "curve" }, {
6033
+ default: E(() => [...n[93] ||= [o("曲线", -1)]]),
5953
6034
  _: 1
5954
6035
  })]),
5955
6036
  _: 1
@@ -5957,31 +6038,31 @@ var fr = { class: "editor-main" }, pr = { class: "panel-toggle-icon" }, mr = { c
5957
6038
  _: 1
5958
6039
  }),
5959
6040
  s(p, { label: "箭头方向" }, {
5960
- default: D(() => [s(te, {
6041
+ default: E(() => [s(M, {
5961
6042
  modelValue: Y.value.style.arrowStart,
5962
6043
  "onUpdate:modelValue": n[51] ||= (e) => Y.value.style.arrowStart = e
5963
6044
  }, {
5964
- default: D(() => [...n[94] ||= [o("起点箭头", -1)]]),
6045
+ default: E(() => [...n[94] ||= [o("起点箭头", -1)]]),
5965
6046
  _: 1
5966
- }, 8, ["modelValue"]), s(te, {
6047
+ }, 8, ["modelValue"]), s(M, {
5967
6048
  modelValue: Y.value.style.arrowEnd,
5968
6049
  "onUpdate:modelValue": n[52] ||= (e) => Y.value.style.arrowEnd = e
5969
6050
  }, {
5970
- default: D(() => [...n[95] ||= [o("终点箭头", -1)]]),
6051
+ default: E(() => [...n[95] ||= [o("终点箭头", -1)]]),
5971
6052
  _: 1
5972
6053
  }, 8, ["modelValue"])]),
5973
6054
  _: 1
5974
6055
  }),
5975
- s(ee, { "content-position": "left" }, {
5976
- default: D(() => [...n[96] ||= [o("连接状态", -1)]]),
6056
+ s(j, { "content-position": "left" }, {
6057
+ default: E(() => [...n[96] ||= [o("连接状态", -1)]]),
5977
6058
  _: 1
5978
6059
  }),
5979
6060
  s(p, { label: "起点连接" }, {
5980
- default: D(() => [Y.value.startConnectId ? (g(), i("div", $r, [s(ae, {
6061
+ default: E(() => [Y.value.startConnectId ? (g(), i("div", ei, [s(ne, {
5981
6062
  size: "small",
5982
6063
  type: "success"
5983
6064
  }, {
5984
- default: D(() => [o(x(Y.value.startConnectType === "node" ? "节点" : "文本框"), 1)]),
6065
+ default: E(() => [o(x(Y.value.startConnectType === "node" ? "节点" : "文本框"), 1)]),
5985
6066
  _: 1
5986
6067
  }), s(l, {
5987
6068
  size: "small",
@@ -5991,17 +6072,17 @@ var fr = { class: "editor-main" }, pr = { class: "panel-toggle-icon" }, mr = { c
5991
6072
  Y.value.startConnectId = null, Y.value.startConnectType = null, Y.value.startAnchor = null;
5992
6073
  }
5993
6074
  }, {
5994
- default: D(() => [...n[97] ||= [o("断开", -1)]]),
6075
+ default: E(() => [...n[97] ||= [o("断开", -1)]]),
5995
6076
  _: 1
5996
- })])) : (g(), i("span", ei, "未连接(点击锚点连接)"))]),
6077
+ })])) : (g(), i("span", ti, "未连接(点击锚点连接)"))]),
5997
6078
  _: 1
5998
6079
  }),
5999
6080
  s(p, { label: "终点连接" }, {
6000
- default: D(() => [Y.value.endConnectId ? (g(), i("div", ti, [s(ae, {
6081
+ default: E(() => [Y.value.endConnectId ? (g(), i("div", ni, [s(ne, {
6001
6082
  size: "small",
6002
6083
  type: "success"
6003
6084
  }, {
6004
- default: D(() => [o(x(Y.value.endConnectType === "node" ? "节点" : "文本框"), 1)]),
6085
+ default: E(() => [o(x(Y.value.endConnectType === "node" ? "节点" : "文本框"), 1)]),
6005
6086
  _: 1
6006
6087
  }), s(l, {
6007
6088
  size: "small",
@@ -6011,19 +6092,19 @@ var fr = { class: "editor-main" }, pr = { class: "panel-toggle-icon" }, mr = { c
6011
6092
  Y.value.endConnectId = null, Y.value.endConnectType = null, Y.value.endAnchor = null;
6012
6093
  }
6013
6094
  }, {
6014
- default: D(() => [...n[98] ||= [o("断开", -1)]]),
6095
+ default: E(() => [...n[98] ||= [o("断开", -1)]]),
6015
6096
  _: 1
6016
- })])) : (g(), i("span", ni, "未连接(点击锚点连接)"))]),
6097
+ })])) : (g(), i("span", ri, "未连接(点击锚点连接)"))]),
6017
6098
  _: 1
6018
6099
  }),
6019
6100
  s(p, null, {
6020
- default: D(() => [s(l, {
6101
+ default: E(() => [s(l, {
6021
6102
  type: "danger",
6022
6103
  size: "small",
6023
- onClick: n[55] ||= (e) => tn(Y.value.id)
6104
+ onClick: n[55] ||= (e) => sn(Y.value.id)
6024
6105
  }, {
6025
- default: D(() => [s(c, null, {
6026
- default: D(() => [s(S(ie))]),
6106
+ default: E(() => [s(c, null, {
6107
+ default: E(() => [s(S(se))]),
6027
6108
  _: 1
6028
6109
  }), n[99] ||= o(" 删除箭头线 ", -1)]),
6029
6110
  _: 1
@@ -6033,48 +6114,48 @@ var fr = { class: "editor-main" }, pr = { class: "panel-toggle-icon" }, mr = { c
6033
6114
  ]),
6034
6115
  _: 1
6035
6116
  })])) : r("", !0),
6036
- !S(I) && !Z.value && !Y.value ? (g(), i("div", ri, [s(c, {
6117
+ !S(I) && !Z.value && !Y.value ? (g(), i("div", ii, [s(c, {
6037
6118
  size: 48,
6038
6119
  color: "#c0c4cc"
6039
6120
  }, {
6040
- default: D(() => [s(S(le))]),
6121
+ default: E(() => [s(S(ue))]),
6041
6122
  _: 1
6042
6123
  }), n[100] ||= a("p", null, "点击节点或标题进行编辑", -1)])) : r("", !0)
6043
- ], 512), [[T, Ot.value]])], 2)
6124
+ ], 512), [[w, Ft.value]])], 2)
6044
6125
  ]),
6045
- s(oe, {
6046
- modelValue: _n.value,
6047
- "onUpdate:modelValue": n[59] ||= (e) => _n.value = e,
6126
+ s(N, {
6127
+ modelValue: Sn.value,
6128
+ "onUpdate:modelValue": n[59] ||= (e) => Sn.value = e,
6048
6129
  title: "添加子节点",
6049
6130
  width: "400px",
6050
6131
  "close-on-click-modal": !1
6051
6132
  }, {
6052
- footer: D(() => [s(l, { onClick: n[58] ||= (e) => _n.value = !1 }, {
6053
- default: D(() => [...n[102] ||= [o("取消", -1)]]),
6133
+ footer: E(() => [s(l, { onClick: n[58] ||= (e) => Sn.value = !1 }, {
6134
+ default: E(() => [...n[102] ||= [o("取消", -1)]]),
6054
6135
  _: 1
6055
6136
  }), s(l, {
6056
6137
  type: "primary",
6057
- onClick: xn
6138
+ onClick: En
6058
6139
  }, {
6059
- default: D(() => [...n[103] ||= [o("确定", -1)]]),
6140
+ default: E(() => [...n[103] ||= [o("确定", -1)]]),
6060
6141
  _: 1
6061
6142
  })]),
6062
- default: D(() => [s(P, {
6143
+ default: E(() => [s(te, {
6063
6144
  "label-position": "top",
6064
6145
  size: "small"
6065
6146
  }, {
6066
- default: D(() => [s(p, { label: "子节点名称" }, {
6067
- default: D(() => [O(a("input", {
6147
+ default: E(() => [s(p, { label: "子节点名称" }, {
6148
+ default: E(() => [D(a("input", {
6068
6149
  class: "node-name-input",
6069
- "onUpdate:modelValue": n[56] ||= (e) => vn.value.text = e,
6150
+ "onUpdate:modelValue": n[56] ||= (e) => Cn.value.text = e,
6070
6151
  placeholder: "请输入名称"
6071
- }, null, 512), [[w, vn.value.text]])]),
6152
+ }, null, 512), [[C, Cn.value.text]])]),
6072
6153
  _: 1
6073
6154
  }), s(p, { label: "添加方向" }, {
6074
- default: D(() => [O(a("select", {
6155
+ default: E(() => [D(a("select", {
6075
6156
  class: "node-font-select",
6076
- "onUpdate:modelValue": n[57] ||= (e) => vn.value.direction = e
6077
- }, [...n[101] ||= [a("option", { value: "left" }, "左侧", -1), a("option", { value: "right" }, "右侧", -1)]], 512), [[C, vn.value.direction]])]),
6157
+ "onUpdate:modelValue": n[57] ||= (e) => Cn.value.direction = e
6158
+ }, [...n[101] ||= [a("option", { value: "left" }, "左侧", -1), a("option", { value: "right" }, "右侧", -1)]], 512), [[ee, Cn.value.direction]])]),
6078
6159
  _: 1
6079
6160
  })]),
6080
6161
  _: 1
@@ -6082,12 +6163,12 @@ var fr = { class: "editor-main" }, pr = { class: "panel-toggle-icon" }, mr = { c
6082
6163
  _: 1
6083
6164
  }, 8, ["modelValue"]),
6084
6165
  s(ar, {
6085
- modelValue: pt.value,
6086
- "onUpdate:modelValue": n[60] ||= (e) => pt.value = e,
6087
- "svg-element": mt.value,
6166
+ modelValue: vt.value,
6167
+ "onUpdate:modelValue": n[60] ||= (e) => vt.value = e,
6168
+ "svg-element": yt.value,
6088
6169
  "fishbone-data": S(F),
6089
- "initial-format": ht.value,
6090
- onExported: Dn
6170
+ "initial-format": bt.value,
6171
+ onExported: Mn
6091
6172
  }, null, 8, [
6092
6173
  "modelValue",
6093
6174
  "svg-element",
@@ -6096,31 +6177,31 @@ var fr = { class: "editor-main" }, pr = { class: "panel-toggle-icon" }, mr = { c
6096
6177
  ]),
6097
6178
  s(l, {
6098
6179
  class: "ai-chat-fab",
6099
- type: h.value ? "primary" : "default",
6180
+ type: re.value ? "primary" : "default",
6100
6181
  circle: "",
6101
6182
  size: "large",
6102
- onClick: n[61] ||= (e) => h.value = !h.value,
6183
+ onClick: n[61] ||= (e) => re.value = !re.value,
6103
6184
  title: "AI助手"
6104
6185
  }, {
6105
- default: D(() => [s(c, null, {
6106
- default: D(() => [s(S(pe))]),
6186
+ default: E(() => [s(c, null, {
6187
+ default: E(() => [s(S(me))]),
6107
6188
  _: 1
6108
6189
  })]),
6109
6190
  _: 1
6110
6191
  }, 8, ["type"]),
6111
6192
  s(Be, {
6112
- visible: h.value,
6113
- messages: S(j).messages.value,
6114
- loading: S(j).loading.value,
6115
- "is-collab": S(j).isCollabMode.value,
6116
- "collab-users": S(j).collabUsers.value,
6117
- "current-user": S(j).currentUser.value,
6118
- "is-owner": $e.value,
6119
- onSend: Mn,
6120
- onClose: n[62] ||= (e) => h.value = !1,
6121
- "unread-mention": S(j).unreadMention.value,
6122
- onClearUnread: n[63] ||= (e) => S(j).clearUnreadMention(),
6123
- onClear: Nn
6193
+ visible: re.value,
6194
+ messages: S(P).messages.value,
6195
+ loading: S(P).loading.value,
6196
+ "is-collab": S(P).isCollabMode.value,
6197
+ "collab-users": S(P).collabUsers.value,
6198
+ "current-user": S(P).currentUser.value,
6199
+ "is-owner": at.value,
6200
+ onSend: Ln,
6201
+ onClose: n[62] ||= (e) => re.value = !1,
6202
+ "unread-mention": S(P).unreadMention.value,
6203
+ onClearUnread: n[63] ||= (e) => S(P).clearUnreadMention(),
6204
+ onClear: Rn
6124
6205
  }, null, 8, [
6125
6206
  "visible",
6126
6207
  "messages",
@@ -6132,15 +6213,15 @@ var fr = { class: "editor-main" }, pr = { class: "panel-toggle-icon" }, mr = { c
6132
6213
  "unread-mention"
6133
6214
  ]),
6134
6215
  s(nt, {
6135
- modelValue: _.value,
6136
- "onUpdate:modelValue": n[64] ||= (e) => _.value = e,
6216
+ modelValue: ie.value,
6217
+ "onUpdate:modelValue": n[64] ||= (e) => ie.value = e,
6137
6218
  "document-id": S(F).id,
6138
- onApply: Fn
6219
+ onApply: Bn
6139
6220
  }, null, 8, ["modelValue", "document-id"])
6140
6221
  ], 2);
6141
6222
  };
6142
6223
  }
6143
- }, [["__scopeId", "data-v-4ae43629"]]), oi = c({
6224
+ }, [["__scopeId", "data-v-f4ad3ba7"]]), si = c({
6144
6225
  name: "YourCompanyFishbone",
6145
6226
  props: {
6146
6227
  docId: {
@@ -6151,6 +6232,14 @@ var fr = { class: "editor-main" }, pr = { class: "panel-toggle-icon" }, mr = { c
6151
6232
  type: String,
6152
6233
  default: "/api"
6153
6234
  },
6235
+ saveApi: {
6236
+ type: [String, Function],
6237
+ default: null
6238
+ },
6239
+ loadApi: {
6240
+ type: [String, Function],
6241
+ default: null
6242
+ },
6154
6243
  wsUrl: {
6155
6244
  type: String,
6156
6245
  default: ""
@@ -6166,14 +6255,18 @@ var fr = { class: "editor-main" }, pr = { class: "panel-toggle-icon" }, mr = { c
6166
6255
  roomId: {
6167
6256
  type: String,
6168
6257
  default: ""
6258
+ },
6259
+ uiConfig: {
6260
+ type: Object,
6261
+ default: () => ({})
6169
6262
  }
6170
6263
  },
6171
6264
  setup(e, { slots: t }) {
6172
6265
  return () => l("div", {
6173
6266
  class: "yourcompany-fishbone-wrapper",
6174
6267
  style: "position:relative"
6175
- }, [l(ai, { ...e }), l(j)]);
6268
+ }, [l(oi, { ...e }), l(A)]);
6176
6269
  }
6177
6270
  });
6178
6271
  //#endregion
6179
- export { oi as default };
6272
+ export { si as default };