@billtaofbj/fishbone 1.1.0 → 1.2.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
@@ -3,30 +3,30 @@ import { BrandWatermark as A } from "@billtaofbj/core";
3
3
  import { useRoute as te, useRouter as j } from "vue-router";
4
4
  import { ElMessage as M, ElMessageBox as ne } from "element-plus";
5
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";
6
+ import { ArrowLeft as re, Bell as ie, Brush as ae, Check as P, Clock as oe, Close as se, Delete as ce, Document as F, Download as I, Edit as L, FullScreen as le, InfoFilled as ue, Link as de, Loading as fe, MagicStick as pe, Monitor as R, 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 z } from "@element-plus/icons-vue";
7
+ import * as B from "yjs";
8
+ import { HocuspocusProvider as Ce } from "@hocuspocus/provider";
9
9
  //#region \0plugin-vue:export-helper
10
- var B = (e, t) => {
10
+ var V = (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
- }, 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 = {
14
+ }, H = { class: "chat-header" }, U = { class: "chat-header-left" }, W = { class: "chat-title" }, we = { class: "online-users-list" }, Te = { class: "online-user-item" }, Ee = { class: "online-user-name" }, G = { key: 1 }, K = { class: "online-user-name" }, De = { class: "chat-header-right" }, Oe = {
15
15
  key: 0,
16
16
  class: "chat-empty"
17
- }, Ae = { class: "chat-empty-hint" }, je = { key: 1 }, Me = { class: "message-content" }, K = {
17
+ }, ke = { class: "chat-empty-hint" }, Ae = { key: 1 }, je = { class: "message-content" }, q = {
18
18
  key: 0,
19
19
  class: "message-meta"
20
- }, q = {
20
+ }, Me = {
21
21
  key: 0,
22
22
  class: "message-mention"
23
- }, J = ["innerHTML"], Ne = { class: "message-time" }, Pe = {
23
+ }, J = ["innerHTML"], Y = { class: "message-time" }, Ne = {
24
24
  key: 1,
25
25
  class: "chat-message chat-message-ai"
26
- }, Fe = { class: "message-avatar ai" }, Ie = { class: "chat-input-area" }, Le = {
26
+ }, Pe = { class: "message-avatar ai" }, Fe = { class: "chat-input-area" }, Ie = {
27
27
  key: 0,
28
28
  class: "mention-popup"
29
- }, Re = ["onClick", "onMouseenter"], ze = { key: 1 }, Be = /*#__PURE__*/ B({
29
+ }, Le = ["onClick", "onMouseenter"], Re = { key: 1 }, ze = /*#__PURE__*/ V({
30
30
  __name: "AiChatPanel",
31
31
  props: {
32
32
  visible: {
@@ -103,18 +103,18 @@ var B = (e, t) => {
103
103
  C.value = !1;
104
104
  }, oe = () => {
105
105
  C.value && (D.value = Math.min(D.value + 1, w.value.length - 1));
106
- }, I = () => {
106
+ }, F = () => {
107
107
  C.value && (D.value = Math.max(D.value - 1, 0));
108
- }, L = (e) => {
108
+ }, I = (e) => {
109
109
  let t = h.value.slice(0, te), n = h.value.slice(te + A.length + 1);
110
110
  h.value = `${t}@${e.name} ${n}`, C.value = !1;
111
- }, ce = (e) => {
111
+ }, L = (e) => {
112
112
  if (e) {
113
113
  if (e.shiftKey) return;
114
114
  if (C.value) {
115
115
  let t = w.value[D.value];
116
116
  if (t) {
117
- e.preventDefault(), L(t);
117
+ e.preventDefault(), I(t);
118
118
  return;
119
119
  }
120
120
  }
@@ -140,15 +140,15 @@ var B = (e, t) => {
140
140
  class: "ai-chat-panel",
141
141
  style: f({ width: c.panelWidth + "px" })
142
142
  }, [
143
- a("div", V, [a("div", H, [
143
+ a("div", H, [a("div", U, [
144
144
  s(u, {
145
145
  size: 18,
146
146
  color: "#409EFF"
147
147
  }, {
148
- default: E(() => [s(S(me))]),
148
+ default: E(() => [s(S(R))]),
149
149
  _: 1
150
150
  }),
151
- a("span", U, x(c.isCollab ? "协作聊天" : "AI 助手"), 1),
151
+ a("span", W, x(c.isCollab ? "协作聊天" : "AI 助手"), 1),
152
152
  c.isCollab ? (g(), n(v, {
153
153
  key: 0,
154
154
  width: 200,
@@ -164,12 +164,12 @@ var B = (e, t) => {
164
164
  default: E(() => [o(x(ne.value) + "人在线 ", 1)]),
165
165
  _: 1
166
166
  })]),
167
- default: E(() => [a("div", Te, [a("div", Ee, [
167
+ default: E(() => [a("div", we, [a("div", Te, [
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", W, x(c.currentUser.name || "我"), 1),
172
+ a("span", Ee, x(c.currentUser.name || "我"), 1),
173
173
  s(p, {
174
174
  size: "small",
175
175
  type: c.isOwner ? "warning" : "success",
@@ -191,10 +191,10 @@ var B = (e, t) => {
191
191
  key: 0,
192
192
  size: 14
193
193
  }, {
194
- default: E(() => [s(S(me))]),
194
+ default: E(() => [s(S(R))]),
195
195
  _: 1
196
- })) : (g(), i("span", De, x((e.name || "U").charAt(0)), 1))], 4),
197
- a("span", G, x(e.name || "未知用户"), 1),
196
+ })) : (g(), i("span", G, x((e.name || "U").charAt(0)), 1))], 4),
197
+ a("span", K, x(e.name || "未知用户"), 1),
198
198
  e.isAi ? (g(), n(p, {
199
199
  key: 0,
200
200
  size: "small",
@@ -217,7 +217,7 @@ var B = (e, t) => {
217
217
  ]))), 128))])]),
218
218
  _: 1
219
219
  })) : r("", !0)
220
- ]), a("div", Oe, [
220
+ ]), a("div", De, [
221
221
  c.isCollab && c.unreadMention ? (g(), i("div", {
222
222
  key: 0,
223
223
  class: "mention-bell",
@@ -238,7 +238,7 @@ var B = (e, t) => {
238
238
  title: "清空对话"
239
239
  }, {
240
240
  default: E(() => [s(u, null, {
241
- default: E(() => [s(S(se))]),
241
+ default: E(() => [s(S(ce))]),
242
242
  _: 1
243
243
  })]),
244
244
  _: 1
@@ -251,7 +251,7 @@ var B = (e, t) => {
251
251
  title: "关闭"
252
252
  }, {
253
253
  default: E(() => [s(u, null, {
254
- default: E(() => [s(S(F))]),
254
+ default: E(() => [s(S(se))]),
255
255
  _: 1
256
256
  })]),
257
257
  _: 1
@@ -262,16 +262,16 @@ var B = (e, t) => {
262
262
  ref_key: "messagesRef",
263
263
  ref: _
264
264
  }, [
265
- c.messages.length === 0 ? (g(), i("div", ke, [
265
+ c.messages.length === 0 ? (g(), i("div", Oe, [
266
266
  s(u, {
267
267
  size: 40,
268
268
  color: "#c0c4cc"
269
269
  }, {
270
- default: E(() => [s(S(me))]),
270
+ default: E(() => [s(S(R))]),
271
271
  _: 1
272
272
  }),
273
273
  a("p", null, x(c.isCollab ? "协作聊天室" : "你好!我是 AI 助手"), 1),
274
- a("p", Ae, x(c.isCollab ? "与团队成员和AI助手实时聊天" : "可以问我任何关于文档编辑的问题"), 1)
274
+ a("p", ke, 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,
@@ -283,21 +283,21 @@ var B = (e, t) => {
283
283
  key: 0,
284
284
  size: 16
285
285
  }, {
286
- default: E(() => [s(S(me))]),
286
+ default: E(() => [s(S(R))]),
287
287
  _: 1
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", {
288
+ })) : (g(), i("span", Ae, x(ae(e)), 1))], 4), a("div", je, [
289
+ c.isCollab && e.role === "user" ? (g(), i("div", q, [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", q, "@" + x(e.mentioned_user), 1)) : r("", !0)])) : r("", !0),
292
+ }, x(e.user_name || "用户"), 5), e.mentioned_user ? (g(), i("span", Me, "@" + x(e.mentioned_user), 1)) : r("", !0)])) : r("", !0),
293
293
  a("div", {
294
294
  class: "message-text",
295
295
  innerHTML: e.content
296
296
  }, null, 8, J),
297
- a("div", Ne, x(e.time), 1)
297
+ a("div", Y, x(e.time), 1)
298
298
  ])], 2))), 128)),
299
- c.loading ? (g(), i("div", Pe, [a("div", Fe, [s(u, { size: 16 }, {
300
- default: E(() => [s(S(me))]),
299
+ c.loading ? (g(), i("div", Ne, [a("div", Pe, [s(u, { size: 16 }, {
300
+ default: E(() => [s(S(R))]),
301
301
  _: 1
302
302
  })]), l[7] ||= a("div", { class: "message-content" }, [a("div", { class: "message-text typing-indicator" }, [
303
303
  a("span"),
@@ -305,7 +305,7 @@ var B = (e, t) => {
305
305
  a("span")
306
306
  ])], -1)])) : r("", !0)
307
307
  ], 512),
308
- a("div", Ie, [a("div", {
308
+ a("div", Fe, [a("div", {
309
309
  class: "chat-input-wrapper",
310
310
  ref_key: "inputWrapperRef",
311
311
  ref: ee
@@ -320,9 +320,9 @@ var B = (e, t) => {
320
320
  },
321
321
  placeholder: c.isCollab ? "输入消息... @提及成员" : "输入消息...",
322
322
  onKeydown: [
323
- O(k(ce, ["exact"]), ["enter"]),
323
+ O(k(L, ["exact"]), ["enter"]),
324
324
  O(k(oe, ["prevent"]), ["down"]),
325
- O(k(I, ["prevent"]), ["up"])
325
+ O(k(F, ["prevent"]), ["up"])
326
326
  ],
327
327
  onInput: P,
328
328
  resize: "none"
@@ -331,10 +331,10 @@ var B = (e, t) => {
331
331
  "placeholder",
332
332
  "onKeydown"
333
333
  ]),
334
- C.value ? (g(), i("div", Le, [(g(!0), i(e, null, y(w.value, (e, t) => (g(), i("div", {
334
+ C.value ? (g(), i("div", Ie, [(g(!0), i(e, null, y(w.value, (e, t) => (g(), i("div", {
335
335
  key: e.id || e.clientId,
336
336
  class: d(["mention-item", { active: t === D.value }]),
337
- onClick: (t) => L(e),
337
+ onClick: (t) => I(e),
338
338
  onMouseenter: (e) => D.value = t
339
339
  }, [a("div", {
340
340
  class: "mention-avatar",
@@ -343,18 +343,18 @@ var B = (e, t) => {
343
343
  key: 0,
344
344
  size: 12
345
345
  }, {
346
- default: E(() => [s(S(me))]),
346
+ default: E(() => [s(S(R))]),
347
347
  _: 1
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),
348
+ })) : (g(), i("span", Re, x((e.name || "U").charAt(0)), 1))], 4), a("span", null, x(e.name), 1)], 42, Le))), 128))])) : r("", !0),
349
349
  s(T, {
350
350
  class: "send-btn",
351
351
  type: "primary",
352
352
  circle: "",
353
353
  disabled: !h.value.trim() || c.loading,
354
- onClick: ce
354
+ onClick: L
355
355
  }, {
356
356
  default: E(() => [s(u, null, {
357
- default: E(() => [s(S(ve))]),
357
+ default: E(() => [s(S(_e))]),
358
358
  _: 1
359
359
  })]),
360
360
  _: 1
@@ -366,7 +366,7 @@ var B = (e, t) => {
366
366
  }, [["__scopeId", "data-v-01960100"]]);
367
367
  //#endregion
368
368
  //#region ../../src/composables/useChat.js
369
- function Ve() {
369
+ function Be() {
370
370
  let e = v([]), t = v(!1), n = v(!1), r = v([]), i = v({
371
371
  id: "",
372
372
  name: "",
@@ -513,8 +513,119 @@ function Ve() {
513
513
  };
514
514
  }
515
515
  //#endregion
516
+ //#region ../../src/composables/useAiApi.js
517
+ var Ve = [
518
+ "我可以帮您优化流程图布局、检查节点逻辑,或者提供流程设计建议。请问有什么需要帮助的?",
519
+ "这个流程图的节点连接看起来很清晰。建议检查一下是否有遗漏的分支或异常处理路径。",
520
+ "根据当前的流程结构,我建议在关键决策节点后添加明确的条件标注,使流程更易理解。",
521
+ "流程图中的泳道划分很合理。如果需要,我可以帮您分析各角色的职责分配是否均衡。",
522
+ "我可以帮您检查流程中是否存在循环依赖或死锁风险。需要我逐条分析吗?",
523
+ "建议在流程开始和结束节点使用统一的样式,这样可以让读者更快识别流程的起止点。",
524
+ "这个执行图的逻辑链路比较长,建议在中间添加一些检查点节点,便于流程监控和调试。",
525
+ "我可以帮您生成流程图的文字说明文档,方便团队成员理解流程细节。"
526
+ ];
527
+ function He() {
528
+ return Ve[Math.floor(Math.random() * Ve.length)];
529
+ }
530
+ async function Ue(e, t, n) {
531
+ let r = { "Content-Type": "application/json" };
532
+ e.apiKey && (r.Authorization = `Bearer ${e.apiKey}`);
533
+ let i = await fetch(e.url, {
534
+ method: "POST",
535
+ headers: r,
536
+ body: JSON.stringify({
537
+ model: e.model || "gpt-4o-mini",
538
+ messages: t,
539
+ temperature: e.temperature ?? .7,
540
+ max_tokens: e.maxTokens ?? 4096
541
+ }),
542
+ signal: n
543
+ });
544
+ if (!i.ok) {
545
+ let e = await i.text().catch(() => "");
546
+ throw Error(`AI API error ${i.status}: ${e}`);
547
+ }
548
+ return (await i.json()).choices?.[0]?.message?.content || "";
549
+ }
550
+ function We(e) {
551
+ let t = v(!1), n = null, r = () => {
552
+ let t = typeof e == "function" ? e() : e;
553
+ return !!(t && t.url);
554
+ }, i = () => typeof e == "function" ? e() : e || {};
555
+ return {
556
+ loading: t,
557
+ isAvailable: r,
558
+ chat: async (e, r = []) => {
559
+ let a = i();
560
+ if (!a.url) return He();
561
+ t.value = !0, n && n.abort(), n = new AbortController();
562
+ try {
563
+ return await Ue(a, [
564
+ {
565
+ role: "system",
566
+ content: a.chatPrompt || "你是一个有帮助的AI助手,擅长文档编辑和流程设计。请简洁回答用户问题。"
567
+ },
568
+ ...r.map((e) => ({
569
+ role: e.role === "ai" ? "assistant" : "user",
570
+ content: e.content
571
+ })),
572
+ {
573
+ role: "user",
574
+ content: e
575
+ }
576
+ ], n.signal);
577
+ } catch (e) {
578
+ return e.name === "AbortError" ? "" : (console.warn("[useAiApi] Chat error, falling back to mock:", e), He());
579
+ } finally {
580
+ t.value = !1;
581
+ }
582
+ },
583
+ generate: async (e, r) => {
584
+ let a = i();
585
+ if (!a.url) return {
586
+ success: !1,
587
+ message: "AI生成功能开发中,敬请期待..."
588
+ };
589
+ t.value = !0, n && n.abort(), n = new AbortController();
590
+ try {
591
+ let t = await Ue(a, [{
592
+ role: "system",
593
+ content: a.generatePrompt || `你是一个专业的${r || "流程图"}生成助手。根据用户的描述,生成对应的JSON数据结构。只返回JSON,不要包含其他文字或markdown代码块标记。`
594
+ }, {
595
+ role: "user",
596
+ content: e
597
+ }], n.signal), i = null;
598
+ try {
599
+ let e = t.replace(/^```(?:json)?\s*/i, "").replace(/\s*```$/i, "").trim();
600
+ i = JSON.parse(e);
601
+ } catch {
602
+ i = null;
603
+ }
604
+ return {
605
+ success: !0,
606
+ content: t,
607
+ parsed: i
608
+ };
609
+ } catch (e) {
610
+ return e.name === "AbortError" ? {
611
+ success: !1,
612
+ message: "已取消"
613
+ } : (console.warn("[useAiApi] Generate error:", e), {
614
+ success: !1,
615
+ message: `AI生成失败: ${e.message}`
616
+ });
617
+ } finally {
618
+ t.value = !1;
619
+ }
620
+ },
621
+ abort: () => {
622
+ n &&= (n.abort(), null);
623
+ }
624
+ };
625
+ }
626
+ //#endregion
516
627
  //#region ../../src/composables/useVersionHistory.js
517
- var He = "/api/document-versions", Ue = 5e3, We = () => {
628
+ var Ge = "/api/document-versions", Ke = 5e3, qe = () => {
518
629
  let e = v([]), t = v(!1);
519
630
  return {
520
631
  versions: e,
@@ -522,13 +633,13 @@ var He = "/api/document-versions", Ue = 5e3, We = () => {
522
633
  saveVersion: async ({ documentId: e, docType: t, content: n, userId: r, userName: i }) => {
523
634
  if (!e || !t || !n) return null;
524
635
  try {
525
- let { data: a } = await N.post(He, {
636
+ let { data: a } = await N.post(Ge, {
526
637
  document_id: e,
527
638
  doc_type: t,
528
639
  content: typeof n == "string" ? n : JSON.stringify(n),
529
640
  user_id: r || null,
530
641
  user_name: i || null
531
- }, { timeout: Ue });
642
+ }, { timeout: Ke });
532
643
  return a;
533
644
  } catch (e) {
534
645
  return console.warn("[useVersionHistory] Failed to save version:", e), null;
@@ -538,9 +649,9 @@ var He = "/api/document-versions", Ue = 5e3, We = () => {
538
649
  if (!n) return [];
539
650
  t.value = !0;
540
651
  try {
541
- let { data: t } = await N.get(He, {
652
+ let { data: t } = await N.get(Ge, {
542
653
  params: { document_id: n },
543
- timeout: Ue
654
+ timeout: Ke
544
655
  });
545
656
  return e.value = t, t;
546
657
  } catch (t) {
@@ -551,26 +662,26 @@ var He = "/api/document-versions", Ue = 5e3, We = () => {
551
662
  },
552
663
  getVersionContent: async (e) => {
553
664
  try {
554
- let { data: t } = await N.get(`${He}/${e}`, { timeout: Ue });
665
+ let { data: t } = await N.get(`${Ge}/${e}`, { timeout: Ke });
555
666
  return t;
556
667
  } catch (e) {
557
668
  return console.warn("[useVersionHistory] Failed to get version content:", e), null;
558
669
  }
559
670
  }
560
671
  };
561
- }, Ge = { class: "version-history-panel" }, Ke = {
672
+ }, Je = { class: "version-history-panel" }, Ye = {
562
673
  key: 0,
563
674
  class: "loading-state"
564
- }, qe = {
675
+ }, Xe = {
565
676
  key: 1,
566
677
  class: "empty-state"
567
- }, Je = {
678
+ }, Ze = {
568
679
  key: 2,
569
680
  class: "version-list"
570
- }, Ye = {
681
+ }, Qe = {
571
682
  key: 0,
572
683
  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__*/ B({
684
+ }, $e = { class: "current-version-header" }, et = { class: "version-number" }, tt = ["onClick"], nt = { class: "version-number" }, rt = { class: "version-user" }, it = { class: "panel-footer" }, at = /*#__PURE__*/ V({
574
685
  __name: "VersionHistoryPanel",
575
686
  props: {
576
687
  modelValue: {
@@ -584,7 +695,7 @@ var He = "/api/document-versions", Ue = 5e3, We = () => {
584
695
  },
585
696
  emits: ["update:modelValue", "apply"],
586
697
  setup(t, { expose: c, emit: l }) {
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);
698
+ let u = t, f = l, { versions: p, loading: m, loadVersions: h, getVersionContent: _ } = qe(), ee = v(!1), C = v(null), w = v(!1), D = v(null);
588
699
  T(() => u.modelValue, (e) => {
589
700
  ee.value = e, e && u.documentId && (C.value = null, h(u.documentId).then((e) => {
590
701
  e && e.length > 0 && (D.value = e[0]);
@@ -621,7 +732,7 @@ var He = "/api/document-versions", Ue = 5e3, We = () => {
621
732
  size: "420px",
622
733
  "before-close": A
623
734
  }, {
624
- footer: E(() => [a("div", tt, [s(_, {
735
+ footer: E(() => [a("div", it, [s(_, {
625
736
  type: "primary",
626
737
  disabled: !C.value,
627
738
  loading: w.value,
@@ -630,22 +741,22 @@ var He = "/api/document-versions", Ue = 5e3, We = () => {
630
741
  default: E(() => [...c[4] ||= [o(" 切换到此版本 ", -1)]]),
631
742
  _: 1
632
743
  }, 8, ["disabled", "loading"])])]),
633
- default: E(() => [a("div", Ge, [S(m) ? (g(), i("div", Ke, [s(l, { class: "is-loading" }, {
744
+ default: E(() => [a("div", Je, [S(m) ? (g(), i("div", Ye, [s(l, { class: "is-loading" }, {
634
745
  default: E(() => [s(S(fe))]),
635
746
  _: 1
636
- }), c[1] ||= a("span", null, "加载中...", -1)])) : S(p).length === 0 ? (g(), i("div", qe, [s(l, {
747
+ }), c[1] ||= a("span", null, "加载中...", -1)])) : S(p).length === 0 ? (g(), i("div", Xe, [s(l, {
637
748
  size: 48,
638
749
  color: "#c0c4cc"
639
750
  }, {
640
751
  default: E(() => [s(S(oe))]),
641
752
  _: 1
642
- }), c[2] ||= a("p", null, "暂无历史版本", -1)])) : (g(), i("div", Je, [D.value ? (g(), i("div", Ye, [a("div", Xe, [s(u, {
753
+ }), c[2] ||= a("p", null, "暂无历史版本", -1)])) : (g(), i("div", Ze, [D.value ? (g(), i("div", Qe, [a("div", $e, [s(u, {
643
754
  type: "success",
644
755
  size: "small"
645
756
  }, {
646
757
  default: E(() => [...c[3] ||= [o("当前版本", -1)]]),
647
758
  _: 1
648
- }), a("span", Ze, "v" + x(D.value.version_number), 1)])])) : r("", !0), s(h, null, {
759
+ }), a("span", et, "v" + x(D.value.version_number), 1)])])) : r("", !0), s(h, null, {
649
760
  default: E(() => [(g(!0), i(e, null, y(S(p), (e) => (g(), n(f, {
650
761
  key: e.id,
651
762
  timestamp: te(e.created_at),
@@ -656,7 +767,7 @@ var He = "/api/document-versions", Ue = 5e3, We = () => {
656
767
  default: E(() => [a("div", {
657
768
  class: d(["version-item", { active: C.value?.id === e.id }]),
658
769
  onClick: (t) => O(e)
659
- }, [a("span", $e, "版本号:v" + x(e.version_number), 1), a("span", et, "提交人:" + x(e.user_name || "未知用户"), 1)], 10, Qe)]),
770
+ }, [a("span", nt, "版本号:v" + x(e.version_number), 1), a("span", rt, "提交人:" + x(e.user_name || "未知用户"), 1)], 10, tt)]),
660
771
  _: 2
661
772
  }, 1032, [
662
773
  "timestamp",
@@ -669,7 +780,7 @@ var He = "/api/document-versions", Ue = 5e3, We = () => {
669
780
  }, 8, ["modelValue"]);
670
781
  };
671
782
  }
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({
783
+ }, [["__scopeId", "data-v-87924b7c"]]), ot = { class: "theme-picker" }, st = { class: "theme-header" }, ct = { class: "theme-count" }, lt = { class: "theme-grid" }, ut = ["onClick", "title"], dt = { class: "theme-name" }, ft = /*#__PURE__*/ V({
673
784
  __name: "ThemePicker",
674
785
  props: {
675
786
  currentTheme: {
@@ -884,7 +995,7 @@ var He = "/api/document-versions", Ue = 5e3, We = () => {
884
995
  })]),
885
996
  _: 1
886
997
  }, 8, ["disabled"])]),
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", {
998
+ default: E(() => [a("div", ot, [a("div", st, [o[1] ||= a("h4", null, "选择主题", -1), a("span", ct, x(c.length) + " 种配色", 1)]), a("div", lt, [(g(), i(e, null, y(c, (e) => a("div", {
888
999
  key: e.id,
889
1000
  class: d(["theme-item", { active: t.currentTheme === e.id }]),
890
1001
  onClick: (t) => l(e.id),
@@ -896,12 +1007,12 @@ var He = "/api/document-versions", Ue = 5e3, We = () => {
896
1007
  }, [a("div", {
897
1008
  class: "theme-spine",
898
1009
  style: f({ background: e.spine })
899
- }, null, 4)], 4), a("span", ct, x(e.name), 1)], 42, st)), 64))])])]),
1010
+ }, null, 4)], 4), a("span", dt, x(e.name), 1)], 42, ut)), 64))])])]),
900
1011
  _: 1
901
1012
  });
902
1013
  };
903
1014
  }
904
- }, [["__scopeId", "data-v-49d0deee"]]), ut = [
1015
+ }, [["__scopeId", "data-v-49d0deee"]]), pt = [
905
1016
  {
906
1017
  id: "default",
907
1018
  name: "默认",
@@ -1436,36 +1547,36 @@ var He = "/api/document-versions", Ue = 5e3, We = () => {
1436
1547
  verticalGap: 140,
1437
1548
  fontFamily: "Arial"
1438
1549
  }
1439
- ], dt = { class: "style-picker" }, ft = { class: "style-header" }, pt = { class: "style-count" }, mt = { class: "style-grid" }, ht = ["onClick"], gt = { class: "style-preview" }, _t = {
1550
+ ], mt = { class: "style-picker" }, ht = { class: "style-header" }, gt = { class: "style-count" }, _t = { class: "style-grid" }, vt = ["onClick"], yt = { class: "style-preview" }, bt = {
1440
1551
  viewBox: "0 0 80 40",
1441
1552
  class: "style-svg"
1442
- }, vt = ["stroke", "stroke-width"], yt = [
1553
+ }, xt = ["stroke", "stroke-width"], X = [
1443
1554
  "y2",
1444
1555
  "stroke",
1445
1556
  "stroke-width",
1446
1557
  "opacity",
1447
1558
  "stroke-dasharray"
1448
- ], bt = [
1559
+ ], St = [
1449
1560
  "y2",
1450
1561
  "stroke",
1451
1562
  "stroke-width",
1452
1563
  "opacity",
1453
1564
  "stroke-dasharray"
1454
- ], Y = [
1565
+ ], Ct = [
1455
1566
  "y",
1456
1567
  "height",
1457
1568
  "rx",
1458
1569
  "fill"
1459
- ], xt = [
1570
+ ], wt = [
1460
1571
  "y",
1461
1572
  "height",
1462
1573
  "rx",
1463
1574
  "fill"
1464
- ], St = [
1575
+ ], Tt = [
1465
1576
  "rx",
1466
1577
  "ry",
1467
1578
  "fill"
1468
- ], Ct = { class: "style-name" }, wt = /*#__PURE__*/ B({
1579
+ ], Et = { class: "style-name" }, Dt = /*#__PURE__*/ V({
1469
1580
  __name: "StylePicker",
1470
1581
  props: {
1471
1582
  currentStyle: {
@@ -1476,7 +1587,7 @@ var He = "/api/document-versions", Ue = 5e3, We = () => {
1476
1587
  },
1477
1588
  emits: ["selectStyle"],
1478
1589
  setup(t) {
1479
- let r = ut;
1590
+ let r = pt;
1480
1591
  return (o, c) => {
1481
1592
  let l = b("el-icon"), u = b("el-button"), f = b("el-popover");
1482
1593
  return g(), n(f, {
@@ -1496,12 +1607,12 @@ var He = "/api/document-versions", Ue = 5e3, We = () => {
1496
1607
  })]),
1497
1608
  _: 1
1498
1609
  }, 8, ["disabled"])]),
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", {
1610
+ default: E(() => [a("div", mt, [a("div", ht, [c[1] ||= a("h4", null, "鱼骨图样式", -1), a("span", gt, x(S(r).length) + " 种", 1)]), a("div", _t, [(g(!0), i(e, null, y(S(r), (e) => (g(), i("div", {
1500
1611
  key: e.id,
1501
1612
  class: d(["style-item", { active: t.currentStyle === e.id }]),
1502
1613
  onClick: (t) => o.$emit("selectStyle", e.id),
1503
1614
  onMousedown: c[0] ||= k(() => {}, ["prevent"])
1504
- }, [a("div", gt, [(g(), i("svg", _t, [
1615
+ }, [a("div", yt, [(g(), i("svg", bt, [
1505
1616
  a("line", {
1506
1617
  x1: "10",
1507
1618
  y1: "20",
@@ -1510,7 +1621,7 @@ var He = "/api/document-versions", Ue = 5e3, We = () => {
1510
1621
  stroke: e.spineColor,
1511
1622
  "stroke-width": e.spineWidth * .4,
1512
1623
  "stroke-linecap": "round"
1513
- }, null, 8, vt),
1624
+ }, null, 8, xt),
1514
1625
  a("line", {
1515
1626
  x1: "30",
1516
1627
  y1: "20",
@@ -1520,7 +1631,7 @@ var He = "/api/document-versions", Ue = 5e3, We = () => {
1520
1631
  "stroke-width": e.branchWidth * .4,
1521
1632
  opacity: e.branchOpacity,
1522
1633
  "stroke-dasharray": e.branchDashed ? "3,2" : "none"
1523
- }, null, 8, yt),
1634
+ }, null, 8, X),
1524
1635
  a("line", {
1525
1636
  x1: "45",
1526
1637
  y1: "20",
@@ -1530,7 +1641,7 @@ var He = "/api/document-versions", Ue = 5e3, We = () => {
1530
1641
  "stroke-width": e.branchWidth * .4,
1531
1642
  opacity: e.branchOpacity,
1532
1643
  "stroke-dasharray": e.branchDashed ? "3,2" : "none"
1533
- }, null, 8, bt),
1644
+ }, null, 8, St),
1534
1645
  a("rect", {
1535
1646
  x: "34",
1536
1647
  y: 20 - e.branchAngle * .4 - e.nodeHeight * .15,
@@ -1539,7 +1650,7 @@ var He = "/api/document-versions", Ue = 5e3, We = () => {
1539
1650
  rx: e.nodeRadius * .15,
1540
1651
  fill: e.spineColor,
1541
1652
  opacity: "0.8"
1542
- }, null, 8, Y),
1653
+ }, null, 8, Ct),
1543
1654
  a("rect", {
1544
1655
  x: "49",
1545
1656
  y: 20 + e.branchAngle * .4 - e.nodeHeight * .15,
@@ -1548,7 +1659,7 @@ var He = "/api/document-versions", Ue = 5e3, We = () => {
1548
1659
  rx: e.nodeRadius * .15,
1549
1660
  fill: e.spineColor,
1550
1661
  opacity: "0.8"
1551
- }, null, 8, xt),
1662
+ }, null, 8, wt),
1552
1663
  a("ellipse", {
1553
1664
  cx: "70",
1554
1665
  cy: "20",
@@ -1556,19 +1667,19 @@ var He = "/api/document-versions", Ue = 5e3, We = () => {
1556
1667
  ry: e.headRy * .15,
1557
1668
  fill: e.spineColor,
1558
1669
  opacity: "0.9"
1559
- }, null, 8, St)
1560
- ]))]), a("span", Ct, x(e.name), 1)], 42, ht))), 128))])])]),
1670
+ }, null, 8, Tt)
1671
+ ]))]), a("span", Et, x(e.name), 1)], 42, vt))), 128))])])]),
1561
1672
  _: 1
1562
1673
  });
1563
1674
  };
1564
1675
  }
1565
- }, [["__scopeId", "data-v-0387ce0f"]]), Tt = { class: "toolbar-left" }, Et = { class: "toolbar-center" }, Dt = { class: "zoom-value" }, Ot = { class: "toolbar-right" }, X = {
1676
+ }, [["__scopeId", "data-v-0387ce0f"]]), Ot = { class: "toolbar-left" }, kt = { class: "toolbar-center" }, At = { class: "zoom-value" }, jt = { class: "toolbar-right" }, Mt = {
1566
1677
  key: 1,
1567
1678
  class: "online-users"
1568
- }, kt = {
1679
+ }, Nt = {
1569
1680
  key: 0,
1570
1681
  class: "more-users"
1571
- }, At = /*#__PURE__*/ B({
1682
+ }, Pt = /*#__PURE__*/ V({
1572
1683
  __name: "Toolbar",
1573
1684
  props: {
1574
1685
  title: String,
@@ -1650,7 +1761,7 @@ var He = "/api/document-versions", Ue = 5e3, We = () => {
1650
1761
  class: "toolbar",
1651
1762
  onMousedown: k
1652
1763
  }, [
1653
- a("div", Tt, [
1764
+ a("div", Ot, [
1654
1765
  t.backButton === "hide" ? r("", !0) : (g(), n(v, {
1655
1766
  key: 0,
1656
1767
  size: "small",
@@ -1699,7 +1810,7 @@ var He = "/api/document-versions", Ue = 5e3, We = () => {
1699
1810
  disabled: t.readonly || !t.authorEditable
1700
1811
  }, null, 8, ["modelValue", "disabled"])
1701
1812
  ]),
1702
- a("div", Et, [
1813
+ a("div", kt, [
1703
1814
  s(v, {
1704
1815
  size: "small",
1705
1816
  circle: "",
@@ -1724,7 +1835,7 @@ var He = "/api/document-versions", Ue = 5e3, We = () => {
1724
1835
  title: "文本框"
1725
1836
  }, {
1726
1837
  default: E(() => [s(u, null, {
1727
- default: E(() => [s(S(ce))]),
1838
+ default: E(() => [s(S(L))]),
1728
1839
  _: 1
1729
1840
  })]),
1730
1841
  _: 1
@@ -1737,7 +1848,7 @@ var He = "/api/document-versions", Ue = 5e3, We = () => {
1737
1848
  disabled: !t.canAddArrow
1738
1849
  }, {
1739
1850
  default: E(() => [s(u, null, {
1740
- default: E(() => [s(S(xe))]),
1851
+ default: E(() => [s(S(be))]),
1741
1852
  _: 1
1742
1853
  })]),
1743
1854
  _: 1
@@ -1750,7 +1861,7 @@ var He = "/api/document-versions", Ue = 5e3, We = () => {
1750
1861
  disabled: !t.canUndo
1751
1862
  }, {
1752
1863
  default: E(() => [s(u, null, {
1753
- default: E(() => [s(S(ye))]),
1864
+ default: E(() => [s(S(ve))]),
1754
1865
  _: 1
1755
1866
  })]),
1756
1867
  _: 1
@@ -1762,7 +1873,7 @@ var He = "/api/document-versions", Ue = 5e3, We = () => {
1762
1873
  disabled: !t.canRedo
1763
1874
  }, {
1764
1875
  default: E(() => [s(u, null, {
1765
- default: E(() => [s(S(be))]),
1876
+ default: E(() => [s(S(ye))]),
1766
1877
  _: 1
1767
1878
  })]),
1768
1879
  _: 1
@@ -1774,19 +1885,19 @@ var He = "/api/document-versions", Ue = 5e3, We = () => {
1774
1885
  onClick: l[12] ||= (e) => c.$emit("zoomOut")
1775
1886
  }, {
1776
1887
  default: E(() => [s(u, null, {
1777
- default: E(() => [s(S(R))]),
1888
+ default: E(() => [s(S(z))]),
1778
1889
  _: 1
1779
1890
  })]),
1780
1891
  _: 1
1781
1892
  }),
1782
- a("span", Dt, x(t.zoom) + "%", 1),
1893
+ a("span", At, x(t.zoom) + "%", 1),
1783
1894
  s(v, {
1784
1895
  size: "small",
1785
1896
  circle: "",
1786
1897
  onClick: l[13] ||= (e) => c.$emit("zoomIn")
1787
1898
  }, {
1788
1899
  default: E(() => [s(u, null, {
1789
- default: E(() => [s(S(Ce))]),
1900
+ default: E(() => [s(S(Se))]),
1790
1901
  _: 1
1791
1902
  })]),
1792
1903
  _: 1
@@ -1804,13 +1915,13 @@ var He = "/api/document-versions", Ue = 5e3, We = () => {
1804
1915
  _: 1
1805
1916
  })
1806
1917
  ]),
1807
- a("div", Ot, [
1808
- s(lt, {
1918
+ a("div", jt, [
1919
+ s(ft, {
1809
1920
  "current-theme": t.currentTheme,
1810
1921
  onSelectTheme: l[15] ||= (e) => c.$emit("selectTheme", e),
1811
1922
  disabled: t.readonly
1812
1923
  }, null, 8, ["current-theme", "disabled"]),
1813
- s(wt, {
1924
+ s(Dt, {
1814
1925
  "current-style": t.currentDiagramStyle,
1815
1926
  onSelectStyle: l[16] ||= (e) => c.$emit("selectStyle", e),
1816
1927
  disabled: t.readonly
@@ -1850,21 +1961,21 @@ var He = "/api/document-versions", Ue = 5e3, We = () => {
1850
1961
  default: E(() => [
1851
1962
  s(j, { command: "svg" }, {
1852
1963
  default: E(() => [s(u, null, {
1853
- default: E(() => [s(S(he))]),
1964
+ default: E(() => [s(S(me))]),
1854
1965
  _: 1
1855
1966
  }), l[26] ||= o(" SVG 矢量图 ", -1)]),
1856
1967
  _: 1
1857
1968
  }),
1858
1969
  s(j, { command: "png" }, {
1859
1970
  default: E(() => [s(u, null, {
1860
- default: E(() => [s(S(ge))]),
1971
+ default: E(() => [s(S(he))]),
1861
1972
  _: 1
1862
1973
  }), l[27] ||= o(" PNG 图片 ", -1)]),
1863
1974
  _: 1
1864
1975
  }),
1865
1976
  s(j, { command: "jpg" }, {
1866
1977
  default: E(() => [s(u, null, {
1867
- default: E(() => [s(S(ge))]),
1978
+ default: E(() => [s(S(he))]),
1868
1979
  _: 1
1869
1980
  }), l[28] ||= o(" JPG 图片 ", -1)]),
1870
1981
  _: 1
@@ -1874,14 +1985,14 @@ var He = "/api/document-versions", Ue = 5e3, We = () => {
1874
1985
  command: "json"
1875
1986
  }, {
1876
1987
  default: E(() => [s(u, null, {
1877
- default: E(() => [s(S(I))]),
1988
+ default: E(() => [s(S(F))]),
1878
1989
  _: 1
1879
1990
  }), l[29] ||= o(" JSON 数据 ", -1)]),
1880
1991
  _: 1
1881
1992
  }),
1882
1993
  s(j, { command: "xml" }, {
1883
1994
  default: E(() => [s(u, null, {
1884
- default: E(() => [s(S(I))]),
1995
+ default: E(() => [s(S(F))]),
1885
1996
  _: 1
1886
1997
  }), l[30] ||= o(" XML 格式 ", -1)]),
1887
1998
  _: 1
@@ -1896,7 +2007,7 @@ var He = "/api/document-versions", Ue = 5e3, We = () => {
1896
2007
  title: "导出"
1897
2008
  }, {
1898
2009
  default: E(() => [s(u, null, {
1899
- default: E(() => [s(S(L))]),
2010
+ default: E(() => [s(S(I))]),
1900
2011
  _: 1
1901
2012
  })]),
1902
2013
  _: 1
@@ -1904,7 +2015,7 @@ var He = "/api/document-versions", Ue = 5e3, We = () => {
1904
2015
  _: 1
1905
2016
  }),
1906
2017
  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, {
2018
+ t.onlineCount > 0 ? (g(), i("div", Mt, [(g(!0), i(e, null, y(t.onlineUsers.slice(0, 3), (e, t) => (g(), n(N, {
1908
2019
  key: e.id || t,
1909
2020
  size: 24,
1910
2021
  style: f({
@@ -1915,7 +2026,7 @@ var He = "/api/document-versions", Ue = 5e3, We = () => {
1915
2026
  }, {
1916
2027
  default: E(() => [o(x(e.name?.charAt(0) || "?"), 1)]),
1917
2028
  _: 2
1918
- }, 1032, ["style", "title"]))), 128)), t.onlineCount > 3 ? (g(), i("span", kt, "+" + x(t.onlineCount - 3), 1)) : r("", !0)])) : r("", !0),
2029
+ }, 1032, ["style", "title"]))), 128)), t.onlineCount > 3 ? (g(), i("span", Nt, "+" + x(t.onlineCount - 3), 1)) : r("", !0)])) : r("", !0),
1919
2030
  t.readonly ? r("", !0) : (g(), n(v, {
1920
2031
  key: 2,
1921
2032
  size: "small",
@@ -1924,7 +2035,7 @@ var He = "/api/document-versions", Ue = 5e3, We = () => {
1924
2035
  title: "协作"
1925
2036
  }, {
1926
2037
  default: E(() => [s(u, null, {
1927
- default: E(() => [s(S(Se))]),
2038
+ default: E(() => [s(S(xe))]),
1928
2039
  _: 1
1929
2040
  }), a("span", null, x(t.isConnected ? "协作中" : "协作"), 1)]),
1930
2041
  _: 1
@@ -1978,12 +2089,12 @@ var He = "/api/document-versions", Ue = 5e3, We = () => {
1978
2089
  }, 8, ["modelValue"])], 64);
1979
2090
  };
1980
2091
  }
1981
- }, [["__scopeId", "data-v-554e46a6"]]), jt = (e, t) => !e || e.length <= t ? e || "" : e.substring(0, t - 1) + "...", Mt = (e, t = 14) => {
2092
+ }, [["__scopeId", "data-v-554e46a6"]]), Ft = (e, t) => !e || e.length <= t ? e || "" : e.substring(0, t - 1) + "...", It = (e, t = 14) => {
1982
2093
  if (!e) return 0;
1983
2094
  let n = 0;
1984
2095
  for (let r of e) r.charCodeAt(0) > 127 ? n += t : n += t * .6;
1985
2096
  return n;
1986
- }, Nt = (e, t = "cause") => {
2097
+ }, Lt = (e, t = "cause") => {
1987
2098
  let n = {
1988
2099
  category: 100,
1989
2100
  cause: 80,
@@ -1992,29 +2103,29 @@ var He = "/api/document-versions", Ue = 5e3, We = () => {
1992
2103
  category: 180,
1993
2104
  cause: 140,
1994
2105
  child: 100
1995
- }, i = Mt(e);
2106
+ }, i = It(e);
1996
2107
  return Math.max(n[t] || n.cause, Math.min(r[t] || r.cause, i + 30));
1997
- }, Pt = { class: "fishbone-wrapper" }, Ft = [
2108
+ }, Z = { class: "fishbone-wrapper" }, Rt = [
1998
2109
  "viewBox",
1999
2110
  "width",
2000
2111
  "height"
2001
- ], Z = ["width", "height"], It = ["transform"], Lt = ["width", "height"], Rt = ["width", "height"], zt = {
2112
+ ], zt = ["width", "height"], Bt = ["transform"], Vt = ["width", "height"], Ht = ["width", "height"], Ut = {
2002
2113
  xmlns: "http://www.w3.org/1999/xhtml",
2003
2114
  class: "tooltip-content"
2004
- }, Bt = [
2115
+ }, Wt = [
2005
2116
  "x2",
2006
2117
  "stroke",
2007
2118
  "stroke-width"
2008
- ], Vt = ["d", "fill"], Ht = [
2119
+ ], Gt = ["d", "fill"], Kt = [
2009
2120
  "cx",
2010
2121
  "rx",
2011
2122
  "ry",
2012
2123
  "fill"
2013
- ], Ut = ["cx", "cy"], Wt = ["cx", "cy"], Gt = ["cx", "cy"], Kt = [
2124
+ ], qt = ["cx", "cy"], Jt = ["cx", "cy"], Yt = ["cx", "cy"], Xt = [
2014
2125
  "x",
2015
2126
  "y",
2016
2127
  "font-family"
2017
- ], qt = [
2128
+ ], Zt = [
2018
2129
  "x1",
2019
2130
  "x2",
2020
2131
  "y2",
@@ -2022,24 +2133,24 @@ var He = "/api/document-versions", Ue = 5e3, We = () => {
2022
2133
  "stroke-width",
2023
2134
  "opacity",
2024
2135
  "stroke-dasharray"
2025
- ], Jt = ["cx", "fill"], Yt = [
2136
+ ], Qt = ["cx", "fill"], $t = [
2026
2137
  "cx",
2027
2138
  "r",
2028
2139
  "fill",
2029
2140
  "stroke",
2030
2141
  "onMousedown"
2031
- ], Xt = [
2142
+ ], en = [
2032
2143
  "transform",
2033
2144
  "onClick",
2034
2145
  "onMousedown",
2035
2146
  "onMouseenter"
2036
- ], Zt = [
2147
+ ], tn = [
2037
2148
  "x",
2038
2149
  "y",
2039
2150
  "width",
2040
2151
  "height",
2041
2152
  "rx"
2042
- ], Qt = [
2153
+ ], nn = [
2043
2154
  "x",
2044
2155
  "y",
2045
2156
  "width",
@@ -2049,33 +2160,33 @@ var He = "/api/document-versions", Ue = 5e3, We = () => {
2049
2160
  "opacity",
2050
2161
  "stroke",
2051
2162
  "stroke-width"
2052
- ], $t = [
2163
+ ], rn = [
2053
2164
  "text-anchor",
2054
2165
  "x",
2055
2166
  "fill",
2056
2167
  "font-size",
2057
2168
  "font-family"
2058
- ], en = ["onMouseenter"], tn = ["onClick"], nn = ["cx", "cy"], rn = [
2169
+ ], an = ["onMouseenter"], on = ["onClick"], sn = ["cx", "cy"], cn = [
2059
2170
  "x1",
2060
2171
  "y1",
2061
2172
  "x2",
2062
2173
  "y2"
2063
- ], an = [
2174
+ ], ln = [
2064
2175
  "x1",
2065
2176
  "y1",
2066
2177
  "x2",
2067
2178
  "y2"
2068
- ], on = ["onClick"], sn = ["cx", "cy"], cn = [
2179
+ ], un = ["onClick"], dn = ["cx", "cy"], fn = [
2069
2180
  "x1",
2070
2181
  "y1",
2071
2182
  "x2",
2072
2183
  "y2"
2073
- ], ln = [
2184
+ ], pn = [
2074
2185
  "x1",
2075
2186
  "y1",
2076
2187
  "x2",
2077
2188
  "y2"
2078
- ], un = [
2189
+ ], mn = [
2079
2190
  "cx",
2080
2191
  "cy",
2081
2192
  "r",
@@ -2083,24 +2194,24 @@ var He = "/api/document-versions", Ue = 5e3, We = () => {
2083
2194
  "stroke",
2084
2195
  "onMousedown",
2085
2196
  "onClick"
2086
- ], dn = [
2197
+ ], hn = [
2087
2198
  "x1",
2088
2199
  "y1",
2089
2200
  "x2",
2090
2201
  "y2",
2091
2202
  "stroke"
2092
- ], fn = [
2203
+ ], gn = [
2093
2204
  "transform",
2094
2205
  "onClick",
2095
2206
  "onMousedown",
2096
2207
  "onMouseenter"
2097
- ], pn = [
2208
+ ], _n = [
2098
2209
  "x",
2099
2210
  "y",
2100
2211
  "width",
2101
2212
  "height",
2102
2213
  "rx"
2103
- ], mn = [
2214
+ ], vn = [
2104
2215
  "x",
2105
2216
  "y",
2106
2217
  "width",
@@ -2110,33 +2221,33 @@ var He = "/api/document-versions", Ue = 5e3, We = () => {
2110
2221
  "opacity",
2111
2222
  "stroke",
2112
2223
  "stroke-width"
2113
- ], hn = [
2224
+ ], yn = [
2114
2225
  "text-anchor",
2115
2226
  "x",
2116
2227
  "fill",
2117
2228
  "font-size",
2118
2229
  "font-family"
2119
- ], gn = ["onMouseenter"], _n = ["onClick"], vn = ["cx", "cy"], yn = [
2230
+ ], bn = ["onMouseenter"], xn = ["onClick"], Sn = ["cx", "cy"], Cn = [
2120
2231
  "x1",
2121
2232
  "y1",
2122
2233
  "x2",
2123
2234
  "y2"
2124
- ], bn = [
2235
+ ], wn = [
2125
2236
  "x1",
2126
2237
  "y1",
2127
2238
  "x2",
2128
2239
  "y2"
2129
- ], xn = ["onClick"], Sn = ["cx", "cy"], Cn = [
2240
+ ], Tn = ["onClick"], En = ["cx", "cy"], Dn = [
2130
2241
  "x1",
2131
2242
  "y1",
2132
2243
  "x2",
2133
2244
  "y2"
2134
- ], wn = [
2245
+ ], On = [
2135
2246
  "x1",
2136
2247
  "y1",
2137
2248
  "x2",
2138
2249
  "y2"
2139
- ], Tn = [
2250
+ ], kn = [
2140
2251
  "x1",
2141
2252
  "x2",
2142
2253
  "y2",
@@ -2144,18 +2255,18 @@ var He = "/api/document-versions", Ue = 5e3, We = () => {
2144
2255
  "stroke-width",
2145
2256
  "opacity",
2146
2257
  "stroke-dasharray"
2147
- ], En = [
2258
+ ], An = [
2148
2259
  "transform",
2149
2260
  "onClick",
2150
2261
  "onMousedown",
2151
2262
  "onMouseenter"
2152
- ], Dn = [
2263
+ ], jn = [
2153
2264
  "x",
2154
2265
  "y",
2155
2266
  "width",
2156
2267
  "height",
2157
2268
  "rx"
2158
- ], On = [
2269
+ ], Mn = [
2159
2270
  "x",
2160
2271
  "y",
2161
2272
  "width",
@@ -2165,43 +2276,43 @@ var He = "/api/document-versions", Ue = 5e3, We = () => {
2165
2276
  "opacity",
2166
2277
  "stroke",
2167
2278
  "stroke-width"
2168
- ], kn = [
2279
+ ], Nn = [
2169
2280
  "text-anchor",
2170
2281
  "x",
2171
2282
  "fill",
2172
2283
  "font-size",
2173
2284
  "font-family"
2174
- ], An = ["onMouseenter"], jn = ["onClick"], Mn = ["cx", "cy"], Nn = ["cx", "cy"], Pn = [
2285
+ ], Pn = ["onMouseenter"], Fn = ["onClick"], In = ["cx", "cy"], Q = ["cx", "cy"], Ln = [
2175
2286
  "x1",
2176
2287
  "y1",
2177
2288
  "x2",
2178
2289
  "y2"
2179
- ], Q = [
2290
+ ], Rn = [
2180
2291
  "x1",
2181
2292
  "y1",
2182
2293
  "x2",
2183
2294
  "y2"
2184
- ], Fn = [
2295
+ ], zn = [
2185
2296
  "x1",
2186
2297
  "y1",
2187
2298
  "x2",
2188
2299
  "y2"
2189
- ], In = [
2300
+ ], Bn = [
2190
2301
  "x1",
2191
2302
  "y1",
2192
2303
  "x2",
2193
2304
  "y2"
2194
- ], Ln = ["cx", "cy"], Rn = ["cx", "cy"], zn = ["cx", "cy"], Bn = ["cx", "cy"], Vn = ["onClick"], Hn = ["cx", "cy"], Un = [
2305
+ ], Vn = ["cx", "cy"], Hn = ["cx", "cy"], Un = ["cx", "cy"], Wn = ["cx", "cy"], Gn = ["onClick"], Kn = ["cx", "cy"], qn = [
2195
2306
  "x1",
2196
2307
  "y1",
2197
2308
  "x2",
2198
2309
  "y2"
2199
- ], Wn = [
2310
+ ], Jn = [
2200
2311
  "x1",
2201
2312
  "y1",
2202
2313
  "x2",
2203
2314
  "y2"
2204
- ], Gn = 150, $ = 250, Kn = 60, qn = /*#__PURE__*/ B({
2315
+ ], Yn = 150, $ = 250, Xn = 60, Zn = /*#__PURE__*/ V({
2205
2316
  __name: "FishboneRenderer",
2206
2317
  props: {
2207
2318
  categories: {
@@ -2295,22 +2406,22 @@ var He = "/api/document-versions", Ue = 5e3, We = () => {
2295
2406
  w.value = {
2296
2407
  show: !0,
2297
2408
  text: e,
2298
- x: Math.max(10, Math.min(t - a / 2, Te.value - a - 10)),
2409
+ x: Math.max(10, Math.min(t - a / 2, we.value - a - 10)),
2299
2410
  y: n - o - 20,
2300
2411
  w: a,
2301
2412
  h: o
2302
2413
  };
2303
2414
  }, E = () => {
2304
2415
  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(() => {
2416
+ }, D = t(() => d.theme.primary || "#546E7A"), O = t(() => d.theme.primary || "#37474F"), A = t(() => pt.find((e) => e.id === d.diagramStyle) || pt[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(() => Ft(d.effect || "问题", 8)), ae = t(() => {
2306
2417
  let e = $;
2307
2418
  return `M 70 ${e} Q 20 ${e - 30} 35 ${e - 65} Q 55 ${e} 35 315 Q 20 280 70 ${e} Z`;
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) => ({
2419
+ }), P = (e) => 150 + N.value * (e + 1), oe = (e) => e % 2 == 0 ? $ - Yn : 400, se = (e) => e % 2 == 0 ? $ - Yn - (A.value.nodeHeight / 2 + 8) : 400 + (A.value.nodeHeight / 2 + 8), ce = (e) => P(e) + q("anchor", e).dx, F = (e) => $, I = (e) => P(e) + 30 + q("cat", e).dx, L = (e) => oe(e) + q("cat", e).dy, le = (e) => ({
2309
2420
  dx: (e.direction || "left") === "left" ? -35 : 35,
2310
2421
  dy: 0
2311
2422
  }), ue = (e, t, n) => {
2312
2423
  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;
2424
+ let r = Oe(e), i = ce(t), a = F(t), o = I(t), s = L(t), c = d.categories?.[t]?.causes || [], l = c.length === 1 ? .5 : (n + 1) / (c.length + 1), u = c[n]?.style?.anchorT ?? l;
2314
2425
  de.value = {
2315
2426
  i: t,
2316
2427
  ci: n,
@@ -2342,57 +2453,57 @@ var He = "/api/document-versions", Ue = 5e3, We = () => {
2342
2453
  x: 0,
2343
2454
  y: $
2344
2455
  };
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);
2456
+ let i = n.length === 1 ? .5 : (t + 1) / (n.length + 1), a = r?.style?.anchorT ?? i, o = ce(e), s = F(e), c = I(e), l = L(e);
2346
2457
  return {
2347
2458
  x: o + (c - o) * a,
2348
2459
  y: s + (l - s) * a
2349
2460
  };
2350
- }, me = (e, t) => pe(e, t).x, he = (e, t) => pe(e, t).y, ge = (e, t, n) => {
2351
- let r = n.direction || "left", i = z(n.text) / 2;
2352
- return me(e, t) + le(n).dx + (r === "left" ? -i : i);
2353
- }, _e = (e, t) => he(e, t), ve = (e, t, n) => {
2461
+ }, R = (e, t) => pe(e, t).x, me = (e, t) => pe(e, t).y, he = (e, t, n) => {
2462
+ let r = n.direction || "left", i = B(n.text) / 2;
2463
+ return R(e, t) + le(n).dx + (r === "left" ? -i : i);
2464
+ }, ge = (e, t) => me(e, t), _e = (e, t, n) => {
2354
2465
  let r = d.categories?.[e]?.causes?.[t];
2355
2466
  if (!r) return 0;
2356
- let i = r.direction || "left", a = ge(e, t, r);
2467
+ let i = r.direction || "left", a = he(e, t, r);
2357
2468
  return i === "left" ? a - (25 + n * 45) : a + (25 + n * 45);
2358
- }, ye = (e, t, n) => _e(e, t) + n * 25, be = (e, t) => {
2469
+ }, ve = (e, t, n) => ge(e, t) + n * 25, ye = (e, t) => {
2359
2470
  let n = d.categories?.[e], r = n?.causes?.[t];
2360
2471
  return !n || !r ? "#ffffff" : r.style?.color ? r.style.color : u(n.color, 2);
2361
- }, xe = (e, t) => {
2472
+ }, be = (e, t) => {
2362
2473
  let n = d.categories?.[e], r = n?.causes?.[t];
2363
2474
  return n ? r?.style?.fontSize ? r.style.fontSize : (n.style?.fontSize ?? 12) - 2 : 11;
2475
+ }, xe = (e, t, n) => {
2476
+ let r = ye(e, t), i = d.categories?.[e]?.causes?.[t]?.children?.[n];
2477
+ return i?.style?.color ? i.style.color : u(r, 2);
2364
2478
  }, Se = (e, t, n) => {
2365
2479
  let r = be(e, t), i = d.categories?.[e]?.causes?.[t]?.children?.[n];
2366
- return i?.style?.color ? i.style.color : u(r, 2);
2367
- }, Ce = (e, t, n) => {
2368
- let r = xe(e, t), i = d.categories?.[e]?.causes?.[t]?.children?.[n];
2369
2480
  return i?.style?.fontSize ? i.style.fontSize : Math.max(8, r - 2);
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(() => {
2481
+ }, z = (e) => Lt(e, "category"), B = (e) => Lt(e, "cause"), Ce = (e, t) => Ft(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, W = t(() => {
2371
2482
  let e = 30, t = 100, n = $, r = $;
2372
2483
  n = Math.min(n, $ - 70), r = Math.max(r, 320), t = Math.max(t, re.value + 120);
2373
2484
  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;
2485
+ let a = P(i), o = oe(i), s = se(i), c = (z(d.categories?.[i]?.name || "test") || 80) / 2 + 20;
2375
2486
  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);
2376
2487
  }
2377
2488
  for (let i = 0; i < M.value; i++) {
2378
2489
  let a = d.categories?.[i]?.causes || [];
2379
2490
  for (let o = 0; o < a.length; o++) {
2380
- let s = H(me(i, o)), c = H(he(i, o), $), l = H(z(a[o]?.text || "test"), 80) / 2 + 20;
2491
+ let s = U(R(i, o)), c = U(me(i, o), $), l = U(B(a[o]?.text || "test"), 80) / 2 + 20;
2381
2492
  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);
2382
2493
  let u = a[o]?.children || [];
2383
2494
  for (let a = 0; a < u.length; a++) {
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;
2495
+ let s = U(_e(i, o, a)), l = U(ve(i, o, a), c), d = U(B(u[a]?.text || "test"), 60) / 2 + 15;
2385
2496
  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);
2386
2497
  }
2387
2498
  }
2388
2499
  }
2389
2500
  return {
2390
- minX: H(e, 0),
2391
- maxX: H(t, 800),
2392
- minY: H(n, 0),
2393
- maxY: H(r, 500)
2501
+ minX: U(e, 0),
2502
+ maxX: U(t, 800),
2503
+ minY: U(n, 0),
2504
+ maxY: U(r, 500)
2394
2505
  };
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) => {
2506
+ }), we = t(() => U(W.value.maxX - W.value.minX + Xn * 2, 800)), Te = t(() => U(W.value.maxY - W.value.minY + Xn * 2, 500)), Ee = t(() => U(W.value.minX - Xn, 0)), G = t(() => U(W.value.minY - Xn, 0)), K = v(null), De = v({}), Oe = (e) => {
2396
2507
  if (!m.value) return {
2397
2508
  x: 0,
2398
2509
  y: 0
@@ -2409,10 +2520,10 @@ var He = "/api/document-versions", Ue = 5e3, We = () => {
2409
2520
  x: i.x,
2410
2521
  y: i.y
2411
2522
  };
2412
- }, Ae = (e, t, n, r, i) => {
2523
+ }, ke = (e, t, n, r, i) => {
2413
2524
  e.preventDefault(), e.stopPropagation(), E(), h.value = null;
2414
- let a = ke(e), o = K(t, n, r, i);
2415
- G.value = {
2525
+ let a = Oe(e), o = q(t, n, r, i);
2526
+ K.value = {
2416
2527
  type: t,
2417
2528
  ci: n,
2418
2529
  cii: r,
@@ -2422,45 +2533,45 @@ var He = "/api/document-versions", Ue = 5e3, We = () => {
2422
2533
  baseDx: o.dx,
2423
2534
  baseDy: o.dy
2424
2535
  }, setTimeout(() => {
2425
- document.addEventListener("mouseup", Me, { once: !0 });
2536
+ document.addEventListener("mouseup", je, { once: !0 });
2426
2537
  }, 0);
2427
- }, je = (e) => {
2538
+ }, Ae = (e) => {
2428
2539
  if (!e.buttons) {
2429
- G.value && Me(), de.value && fe();
2540
+ K.value && je(), de.value && fe();
2430
2541
  return;
2431
2542
  }
2432
2543
  if (de.value) {
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);
2544
+ let t = de.value, n = Oe(e), r = n.x - t.smx, i = n.y - t.smy, a = Math.sqrt((t.ex - t.sx) ** 2 + (t.ey - t.sy) ** 2);
2434
2545
  if (a > 0) {
2435
2546
  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];
2436
2547
  o && (o.style ||= {}, o.style.anchorT = n);
2437
2548
  }
2438
2549
  return;
2439
2550
  }
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] = {
2551
+ if (!K.value) return;
2552
+ let t = Oe(e), n = K.value.baseDx + (t.x - K.value.smx), r = K.value.baseDy + (t.y - K.value.smy);
2553
+ K.value.type === "anchor" && (r = 0);
2554
+ let i = `${K.value.type}-${K.value.ci}-${K.value.cii ?? ""}-${K.value.mii ?? ""}`;
2555
+ De.value[i] = {
2445
2556
  dx: n,
2446
2557
  dy: r
2447
2558
  };
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];
2559
+ }, je = () => {
2560
+ if (K.value) {
2561
+ let e = `${K.value.type}-${K.value.ci}-${K.value.cii ?? ""}-${K.value.mii ?? ""}`, t = De.value[e];
2451
2562
  t && p("nodeDragged", {
2452
- type: G.value.type,
2453
- catIndex: G.value.ci,
2454
- causeIndex: G.value.cii,
2455
- measureIndex: G.value.mii,
2563
+ type: K.value.type,
2564
+ catIndex: K.value.ci,
2565
+ causeIndex: K.value.cii,
2566
+ measureIndex: K.value.mii,
2456
2567
  dx: t.dx,
2457
2568
  dy: t.dy
2458
2569
  });
2459
2570
  }
2460
- G.value = null, Oe.value = {};
2461
- }, K = (e, t, n, r) => {
2571
+ K.value = null, De.value = {};
2572
+ }, q = (e, t, n, r) => {
2462
2573
  let i = `${e}-${t}-${n ?? ""}-${r ?? ""}`;
2463
- if (Oe.value[i]) return Oe.value[i];
2574
+ if (De.value[i]) return De.value[i];
2464
2575
  if (e === "cat") {
2465
2576
  let e = d.categories?.[t];
2466
2577
  return {
@@ -2487,32 +2598,32 @@ var He = "/api/document-versions", Ue = 5e3, We = () => {
2487
2598
  dx: 0,
2488
2599
  dy: 0
2489
2600
  };
2490
- }, q = () => {
2601
+ }, Me = () => {
2491
2602
  h.value = null, E();
2492
2603
  }, J = () => {
2493
- Me(), fe();
2494
- }, Ne = () => {
2495
- G.value && Me(), document.activeElement?.blur(), p("clearSelection");
2496
- }, Pe = (e) => {
2497
- !e.target.closest("[style*=\"cursor: grab\"]") && G.value && Me(), e.target.closest("[style*=\"cursor: grab\"]") || p("clearSelection");
2498
- }, Fe = (e, t) => {
2604
+ je(), fe();
2605
+ }, Y = () => {
2606
+ K.value && je(), document.activeElement?.blur(), p("clearSelection");
2607
+ }, Ne = (e) => {
2608
+ !e.target.closest("[style*=\"cursor: grab\"]") && K.value && je(), e.target.closest("[style*=\"cursor: grab\"]") || p("clearSelection");
2609
+ }, Pe = (e, t) => {
2499
2610
  h.value = {
2500
2611
  type: "category",
2501
2612
  id: t.id,
2502
2613
  catIndex: e
2503
2614
  };
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);
2506
- }, Ie = (e, t, n) => {
2615
+ let n = q("anchor", e), r = q("cat", e);
2616
+ T(t.name, P(e) + 30 + n.dx + r.dx, se(e) + r.dy);
2617
+ }, Fe = (e, t, n) => {
2507
2618
  h.value = {
2508
2619
  type: "cause",
2509
2620
  id: n.id,
2510
2621
  catIndex: e,
2511
2622
  causeIndex: t
2512
2623
  };
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;
2624
+ let r = q("cause", e, t), i = R(e, t) + le(n).dx + r.dx, a = me(e, t) + le(n).dy + r.dy;
2514
2625
  T(n.text, i, a);
2515
- }, Le = (e, t, n, r) => {
2626
+ }, Ie = (e, t, n, r) => {
2516
2627
  h.value = {
2517
2628
  type: "measure",
2518
2629
  id: r.id,
@@ -2520,44 +2631,44 @@ var He = "/api/document-versions", Ue = 5e3, We = () => {
2520
2631
  causeIndex: t,
2521
2632
  measureIndex: n
2522
2633
  };
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);
2634
+ let i = q("cause", e, t), a = q("measure", e, t, n);
2635
+ T(r.text, _e(e, t, n) + i.dx + a.dx, ve(e, t, n) + i.dy + a.dy);
2525
2636
  };
2526
2637
  return o({
2527
2638
  getSvgElement: () => m.value,
2528
2639
  getViewBox: () => ({
2529
- x: W.value,
2530
- y: De.value,
2531
- w: Te.value,
2532
- h: Ee.value
2640
+ x: Ee.value,
2641
+ y: G.value,
2642
+ w: we.value,
2643
+ h: Te.value
2533
2644
  })
2534
- }), (t, o) => (g(), i("div", Pt, [(g(), i("svg", {
2645
+ }), (t, o) => (g(), i("div", Z, [(g(), i("svg", {
2535
2646
  ref_key: "svgRef",
2536
2647
  ref: m,
2537
2648
  xmlns: "http://www.w3.org/2000/svg",
2538
- viewBox: `${W.value} ${De.value} ${Te.value} ${Ee.value}`,
2539
- width: Te.value,
2540
- height: Ee.value,
2649
+ viewBox: `${Ee.value} ${G.value} ${we.value} ${Te.value}`,
2650
+ width: we.value,
2651
+ height: Te.value,
2541
2652
  preserveAspectRatio: "xMidYMid meet",
2542
2653
  class: "fishbone-svg",
2543
2654
  style: f({
2544
2655
  background: n.theme.bg || "#fafbfc",
2545
- cursor: G.value ? "grabbing" : "default"
2656
+ cursor: K.value ? "grabbing" : "default"
2546
2657
  }),
2547
2658
  onClick: k(C, ["self"]),
2548
- onMousedown: Pe,
2549
- onMousemove: je,
2550
- onMouseup: Me,
2659
+ onMousedown: Ne,
2660
+ onMousemove: Ae,
2661
+ onMouseup: je,
2551
2662
  onMouseleave: J
2552
2663
  }, [
2553
2664
  a("rect", {
2554
2665
  x: "0",
2555
2666
  y: "0",
2556
- width: Te.value,
2557
- height: Ee.value,
2667
+ width: we.value,
2668
+ height: Te.value,
2558
2669
  fill: "transparent",
2559
- onClick: Ne
2560
- }, null, 8, Z),
2670
+ onClick: Y
2671
+ }, null, 8, zt),
2561
2672
  w.value.show ? (g(), i("g", {
2562
2673
  key: 0,
2563
2674
  transform: `translate(${w.value.x}, ${w.value.y})`
@@ -2569,12 +2680,12 @@ var He = "/api/document-versions", Ue = 5e3, We = () => {
2569
2680
  rx: "6",
2570
2681
  fill: "#303236",
2571
2682
  opacity: "0.4"
2572
- }, null, 8, Lt), (g(), i("foreignObject", {
2683
+ }, null, 8, Vt), (g(), i("foreignObject", {
2573
2684
  x: "8",
2574
2685
  y: "6",
2575
2686
  width: w.value.w - 16,
2576
2687
  height: w.value.h - 12
2577
- }, [a("div", zt, x(w.value.text), 1)], 8, Rt))], 8, It)) : r("", !0),
2688
+ }, [a("div", Ut, x(w.value.text), 1)], 8, Ht))], 8, Bt)) : r("", !0),
2578
2689
  (g(), i("g", { key: n.styleTick }, [
2579
2690
  a("line", {
2580
2691
  x1: 100,
@@ -2584,12 +2695,12 @@ var He = "/api/document-versions", Ue = 5e3, We = () => {
2584
2695
  stroke: A.value.spineColor || D.value,
2585
2696
  "stroke-width": A.value.spineWidth,
2586
2697
  "stroke-linecap": "round"
2587
- }, null, 8, Bt),
2698
+ }, null, 8, Wt),
2588
2699
  a("path", {
2589
2700
  d: ae.value,
2590
2701
  fill: A.value.spineColor || D.value,
2591
2702
  opacity: "0.5"
2592
- }, null, 8, Vt),
2703
+ }, null, 8, Gt),
2593
2704
  a("g", null, [
2594
2705
  a("ellipse", {
2595
2706
  cx: re.value + 55,
@@ -2598,28 +2709,28 @@ var He = "/api/document-versions", Ue = 5e3, We = () => {
2598
2709
  ry: A.value.headRy,
2599
2710
  fill: A.value.spineColor || O.value,
2600
2711
  style: { "pointer-events": "none" }
2601
- }, null, 8, Ht),
2712
+ }, null, 8, Kt),
2602
2713
  a("circle", {
2603
2714
  cx: re.value + 45,
2604
2715
  cy: $ - 7,
2605
2716
  r: "6",
2606
2717
  fill: "white",
2607
2718
  style: { "pointer-events": "none" }
2608
- }, null, 8, Ut),
2719
+ }, null, 8, qt),
2609
2720
  a("circle", {
2610
2721
  cx: re.value + 47,
2611
2722
  cy: $ - 7,
2612
2723
  r: "3.5",
2613
2724
  fill: "#263238",
2614
2725
  style: { "pointer-events": "none" }
2615
- }, null, 8, Wt),
2726
+ }, null, 8, Jt),
2616
2727
  a("circle", {
2617
2728
  cx: re.value + 49,
2618
2729
  cy: $ - 9,
2619
2730
  r: "1.2",
2620
2731
  fill: "white",
2621
2732
  style: { "pointer-events": "none" }
2622
- }, null, 8, Gt),
2733
+ }, null, 8, Yt),
2623
2734
  a("text", {
2624
2735
  x: re.value + 55,
2625
2736
  y: 268,
@@ -2629,78 +2740,78 @@ var He = "/api/document-versions", Ue = 5e3, We = () => {
2629
2740
  "font-size": "12",
2630
2741
  "font-family": A.value.fontFamily + ", sans-serif",
2631
2742
  style: { "pointer-events": "none" }
2632
- }, x(ie.value), 9, Kt)
2743
+ }, x(ie.value), 9, Xt)
2633
2744
  ]),
2634
2745
  (g(!0), i(e, null, y(n.categories, (t, s) => (g(), i("g", { key: t.id }, [
2635
2746
  a("line", {
2636
- x1: P(s) + K("anchor", s).dx,
2747
+ x1: P(s) + q("anchor", s).dx,
2637
2748
  y1: $,
2638
- x2: P(s) + 30 + K("cat", s).dx,
2639
- y2: oe(s) + K("cat", s).dy,
2749
+ x2: P(s) + 30 + q("cat", s).dx,
2750
+ y2: oe(s) + q("cat", s).dy,
2640
2751
  stroke: t.style?.lineColor || A.value.spineColor || t.color,
2641
2752
  "stroke-width": A.value.branchWidth,
2642
2753
  "stroke-linecap": "round",
2643
2754
  opacity: (t.style?.lineOpacity ?? A.value.branchOpacity * 100) / 100,
2644
2755
  "stroke-dasharray": t.style?.lineStyle === "dashed" ? "6,3" : "none"
2645
- }, null, 8, qt),
2756
+ }, null, 8, Zt),
2646
2757
  A.value.showDots ? (g(), i("circle", {
2647
2758
  key: 0,
2648
- cx: P(s) + K("anchor", s).dx,
2759
+ cx: P(s) + q("anchor", s).dx,
2649
2760
  cy: $,
2650
2761
  r: "4",
2651
2762
  fill: A.value.spineColor || t.color
2652
- }, null, 8, Jt)) : r("", !0),
2763
+ }, null, 8, Qt)) : r("", !0),
2653
2764
  a("circle", {
2654
- cx: P(s) + K("anchor", s).dx,
2765
+ cx: P(s) + q("anchor", s).dx,
2655
2766
  cy: $,
2656
2767
  r: n.selectedNode?.id === t.id ? 6 : 4,
2657
2768
  fill: n.selectedNode?.id === t.id ? "#409EFF" : "transparent",
2658
2769
  stroke: n.selectedNode?.id === t.id ? "#409EFF" : "#909399",
2659
2770
  "stroke-width": 1.5,
2660
2771
  style: { cursor: "ew-resize" },
2661
- onMousedown: k((e) => Ae(e, "anchor", s), ["stop"]),
2662
- onMouseup: Me
2663
- }, null, 40, Yt),
2772
+ onMousedown: k((e) => ke(e, "anchor", s), ["stop"]),
2773
+ onMouseup: je
2774
+ }, null, 40, $t),
2664
2775
  a("g", {
2665
- transform: `translate(${P(s) + 30 + K("cat", s).dx}, ${F(s) + K("cat", s).dy})`,
2776
+ transform: `translate(${P(s) + 30 + q("cat", s).dx}, ${se(s) + q("cat", s).dy})`,
2666
2777
  onClick: k((e) => _("category", t.id, s), ["stop"]),
2667
- onMousedown: (e) => Ae(e, "cat", s),
2668
- onMouseup: Me,
2669
- onMouseleave: q,
2670
- onMouseenter: (e) => Fe(s, t),
2778
+ onMousedown: (e) => ke(e, "cat", s),
2779
+ onMouseup: je,
2780
+ onMouseleave: Me,
2781
+ onMouseenter: (e) => Pe(s, t),
2671
2782
  style: { cursor: "grab" }
2672
2783
  }, [
2673
2784
  n.selectedNode?.id === t.id ? (g(), i("rect", {
2674
2785
  key: 0,
2675
- x: -R(t.name) / 2 - 4,
2676
- y: -(B(t) / 2 + 4),
2677
- width: R(t.name) + 8,
2678
- height: B(t) + 8,
2786
+ x: -z(t.name) / 2 - 4,
2787
+ y: -(V(t) / 2 + 4),
2788
+ width: z(t.name) + 8,
2789
+ height: V(t) + 8,
2679
2790
  rx: A.value.nodeRadius + 4,
2680
2791
  fill: "none",
2681
2792
  stroke: "#409EFF",
2682
2793
  "stroke-width": "3"
2683
- }, null, 8, Zt)) : r("", !0),
2794
+ }, null, 8, tn)) : r("", !0),
2684
2795
  a("rect", {
2685
- x: -R(t.name) / 2,
2686
- y: -B(t) / 2,
2687
- width: R(t.name),
2688
- height: B(t),
2796
+ x: -z(t.name) / 2,
2797
+ y: -V(t) / 2,
2798
+ width: z(t.name),
2799
+ height: V(t),
2689
2800
  rx: A.value.nodeRadius,
2690
2801
  fill: t.color,
2691
2802
  opacity: (t.style?.opacity ?? 100) / 100,
2692
2803
  stroke: n.selectedNode?.id === t.id ? "#409EFF" : t.style?.borderStyle === "none" ? "none" : t.style?.borderColor || t.color,
2693
2804
  "stroke-width": n.selectedNode?.id === t.id ? 3 : t.style?.borderStyle === "none" ? 0 : t.style?.borderWidth ?? 1.5
2694
- }, null, 8, Qt),
2805
+ }, null, 8, nn),
2695
2806
  a("text", {
2696
2807
  "text-anchor": te(t.style?.textAlign),
2697
2808
  "dominant-baseline": "middle",
2698
- x: j(t.style?.textAlign, R(t.name)),
2809
+ x: j(t.style?.textAlign, z(t.name)),
2699
2810
  fill: t.style?.textColor || "white",
2700
2811
  "font-size": t.style?.fontSize ?? 12,
2701
2812
  "font-family": (t.style?.fontFamily || A.value.fontFamily) + ", sans-serif",
2702
2813
  style: { "pointer-events": "none" }
2703
- }, x(we(t.name, t.style?.maxChars ?? 15)), 9, $t),
2814
+ }, x(Ce(t.name, t.style?.maxChars ?? 15)), 9, rn),
2704
2815
  h.value?.id === t.id ? (g(), i("g", {
2705
2816
  key: 1,
2706
2817
  style: { "pointer-events": "auto" },
@@ -2716,124 +2827,124 @@ var He = "/api/document-versions", Ue = 5e3, We = () => {
2716
2827
  style: { cursor: "pointer" }
2717
2828
  }, [
2718
2829
  a("circle", {
2719
- cx: R(t.name) / 2 - 24,
2720
- cy: -B(t) / 2 - 6,
2830
+ cx: z(t.name) / 2 - 24,
2831
+ cy: -V(t) / 2 - 6,
2721
2832
  r: "7",
2722
2833
  fill: "#409EFF",
2723
2834
  opacity: "0.9"
2724
- }, null, 8, nn),
2835
+ }, null, 8, sn),
2725
2836
  a("line", {
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,
2837
+ x1: z(t.name) / 2 - 27,
2838
+ y1: -V(t) / 2 - 6,
2839
+ x2: z(t.name) / 2 - 21,
2840
+ y2: -V(t) / 2 - 6,
2730
2841
  stroke: "white",
2731
2842
  "stroke-width": "1.5",
2732
2843
  "stroke-linecap": "round"
2733
- }, null, 8, rn),
2844
+ }, null, 8, cn),
2734
2845
  a("line", {
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,
2846
+ x1: z(t.name) / 2 - 24,
2847
+ y1: -V(t) / 2 - 9,
2848
+ x2: z(t.name) / 2 - 24,
2849
+ y2: -V(t) / 2 - 3,
2739
2850
  stroke: "white",
2740
2851
  "stroke-width": "1.5",
2741
2852
  "stroke-linecap": "round"
2742
- }, null, 8, an)
2743
- ], 40, tn), a("g", {
2853
+ }, null, 8, ln)
2854
+ ], 40, on), a("g", {
2744
2855
  onClick: k((e) => S("category", t.id, s), ["stop"]),
2745
2856
  onMousedown: o[1] ||= k(() => {}, ["stop"]),
2746
2857
  style: { cursor: "pointer" }
2747
2858
  }, [
2748
2859
  a("circle", {
2749
- cx: R(t.name) / 2 - 8,
2750
- cy: -B(t) / 2 - 6,
2860
+ cx: z(t.name) / 2 - 8,
2861
+ cy: -V(t) / 2 - 6,
2751
2862
  r: "7",
2752
2863
  fill: "#F56C6C",
2753
2864
  opacity: "0.9"
2754
- }, null, 8, sn),
2865
+ }, null, 8, dn),
2755
2866
  a("line", {
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,
2867
+ x1: z(t.name) / 2 - 11,
2868
+ y1: -V(t) / 2 - 9,
2869
+ x2: z(t.name) / 2 - 5,
2870
+ y2: -V(t) / 2 - 3,
2760
2871
  stroke: "white",
2761
2872
  "stroke-width": "1.5",
2762
2873
  "stroke-linecap": "round"
2763
- }, null, 8, cn),
2874
+ }, null, 8, fn),
2764
2875
  a("line", {
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,
2876
+ x1: z(t.name) / 2 - 5,
2877
+ y1: -V(t) / 2 - 9,
2878
+ x2: z(t.name) / 2 - 11,
2879
+ y2: -V(t) / 2 - 3,
2769
2880
  stroke: "white",
2770
2881
  "stroke-width": "1.5",
2771
2882
  "stroke-linecap": "round"
2772
- }, null, 8, ln)
2773
- ], 40, on)], 40, en)) : r("", !0)
2774
- ], 40, Xt),
2883
+ }, null, 8, pn)
2884
+ ], 40, un)], 40, an)) : r("", !0)
2885
+ ], 40, en),
2775
2886
  (g(!0), i(e, null, y(t.causes || [], (c, l) => (g(), i("g", { key: c.id }, [
2776
2887
  a("circle", {
2777
- cx: me(s, l),
2778
- cy: he(s, l),
2888
+ cx: R(s, l),
2889
+ cy: me(s, l),
2779
2890
  r: n.selectedNode?.id === c.id ? 5 : 3.5,
2780
2891
  fill: n.selectedNode?.id === c.id ? "#409EFF" : t.color,
2781
2892
  stroke: n.selectedNode?.id === c.id ? "#409EFF" : "#fff",
2782
2893
  "stroke-width": 1.5,
2783
2894
  style: { cursor: "ew-resize" },
2784
2895
  onMousedown: k((e) => ue(e, s, l), ["stop"]),
2785
- onMouseup: Me,
2896
+ onMouseup: je,
2786
2897
  onClick: k((e) => _("cause", c.id, s, l), ["stop"])
2787
- }, null, 40, un),
2898
+ }, null, 40, mn),
2788
2899
  a("line", {
2789
- x1: me(s, l),
2790
- y1: he(s, l),
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,
2900
+ x1: R(s, l),
2901
+ y1: me(s, l),
2902
+ x2: R(s, l) + le(c).dx + q("cause", s, l).dx,
2903
+ y2: me(s, l) + le(c).dy + q("cause", s, l).dy,
2793
2904
  stroke: t.color,
2794
2905
  "stroke-width": 1,
2795
2906
  opacity: .4
2796
- }, null, 8, dn),
2907
+ }, null, 8, hn),
2797
2908
  a("g", {
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})`,
2909
+ transform: `translate(${R(s, l) + le(c).dx + q("cause", s, l).dx}, ${me(s, l) + le(c).dy + q("cause", s, l).dy})`,
2799
2910
  onClick: k((e) => _("cause", c.id, s, l), ["stop"]),
2800
- onMousedown: (e) => Ae(e, "cause", s, l),
2801
- onMouseup: Me,
2802
- onMouseleave: q,
2803
- onMouseenter: (e) => Ie(s, l, c),
2911
+ onMousedown: (e) => ke(e, "cause", s, l),
2912
+ onMouseup: je,
2913
+ onMouseleave: Me,
2914
+ onMouseenter: (e) => Fe(s, l, c),
2804
2915
  style: { cursor: "grab" }
2805
2916
  }, [
2806
2917
  n.selectedNode?.id === c.id ? (g(), i("rect", {
2807
2918
  key: 0,
2808
- x: -z(c.text) / 2 - 4,
2809
- y: -(V(c) / 2 + 4),
2810
- width: z(c.text) + 8,
2811
- height: V(c) + 8,
2919
+ x: -B(c.text) / 2 - 4,
2920
+ y: -(H(c) / 2 + 4),
2921
+ width: B(c.text) + 8,
2922
+ height: H(c) + 8,
2812
2923
  rx: A.value.causeRadius + 4,
2813
2924
  fill: "none",
2814
2925
  stroke: "#409EFF",
2815
2926
  "stroke-width": "3"
2816
- }, null, 8, pn)) : r("", !0),
2927
+ }, null, 8, _n)) : r("", !0),
2817
2928
  a("rect", {
2818
- x: -z(c.text) / 2,
2819
- y: -V(c) / 2,
2820
- width: z(c.text),
2821
- height: V(c),
2929
+ x: -B(c.text) / 2,
2930
+ y: -H(c) / 2,
2931
+ width: B(c.text),
2932
+ height: H(c),
2822
2933
  rx: A.value.causeRadius,
2823
- fill: be(s, l),
2934
+ fill: ye(s, l),
2824
2935
  opacity: (c.style?.opacity ?? 100) / 100,
2825
2936
  stroke: n.selectedNode?.id === c.id ? "#409EFF" : c.style?.borderStyle === "none" ? "none" : c.style?.borderColor || t.color,
2826
2937
  "stroke-width": n.selectedNode?.id === c.id ? 3 : c.style?.borderStyle === "none" ? 0 : c.style?.borderWidth ?? 1.5
2827
- }, null, 8, mn),
2938
+ }, null, 8, vn),
2828
2939
  a("text", {
2829
2940
  "text-anchor": te(c.style?.textAlign),
2830
2941
  "dominant-baseline": "middle",
2831
- x: j(c.style?.textAlign, z(c.text)),
2942
+ x: j(c.style?.textAlign, B(c.text)),
2832
2943
  fill: c.style?.textColor || "#263238",
2833
- "font-size": xe(s, l),
2944
+ "font-size": be(s, l),
2834
2945
  "font-family": (c.style?.fontFamily || A.value.fontFamily) + ", sans-serif",
2835
2946
  style: { "pointer-events": "none" }
2836
- }, x(we(c.text, c.style?.maxChars ?? 20)), 9, hn),
2947
+ }, x(Ce(c.text, c.style?.maxChars ?? 20)), 9, yn),
2837
2948
  h.value?.id === c.id ? (g(), i("g", {
2838
2949
  key: 1,
2839
2950
  style: { "pointer-events": "auto" },
@@ -2850,110 +2961,110 @@ var He = "/api/document-versions", Ue = 5e3, We = () => {
2850
2961
  style: { cursor: "pointer" }
2851
2962
  }, [
2852
2963
  a("circle", {
2853
- cx: z(c.text) / 2 - 30,
2854
- cy: -V(c) / 2 - 6,
2964
+ cx: B(c.text) / 2 - 30,
2965
+ cy: -H(c) / 2 - 6,
2855
2966
  r: "6",
2856
2967
  fill: "#409EFF",
2857
2968
  opacity: "0.9"
2858
- }, null, 8, vn),
2969
+ }, null, 8, Sn),
2859
2970
  a("line", {
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,
2971
+ x1: B(c.text) / 2 - 33,
2972
+ y1: -H(c) / 2 - 6,
2973
+ x2: B(c.text) / 2 - 27,
2974
+ y2: -H(c) / 2 - 6,
2864
2975
  stroke: "white",
2865
2976
  "stroke-width": "1.5",
2866
2977
  "stroke-linecap": "round"
2867
- }, null, 8, yn),
2978
+ }, null, 8, Cn),
2868
2979
  a("line", {
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,
2980
+ x1: B(c.text) / 2 - 30,
2981
+ y1: -H(c) / 2 - 9,
2982
+ x2: B(c.text) / 2 - 30,
2983
+ y2: -H(c) / 2 - 3,
2873
2984
  stroke: "white",
2874
2985
  "stroke-width": "1.5",
2875
2986
  "stroke-linecap": "round"
2876
- }, null, 8, bn)
2877
- ], 40, _n), a("g", {
2987
+ }, null, 8, wn)
2988
+ ], 40, xn), a("g", {
2878
2989
  onClick: k((e) => S("cause", c.id, s), ["stop"]),
2879
2990
  onMousedown: o[4] ||= k(() => {}, ["stop"]),
2880
2991
  style: { cursor: "pointer" }
2881
2992
  }, [
2882
2993
  a("circle", {
2883
- cx: z(c.text) / 2 - 14,
2884
- cy: -V(c) / 2 - 6,
2994
+ cx: B(c.text) / 2 - 14,
2995
+ cy: -H(c) / 2 - 6,
2885
2996
  r: "6",
2886
2997
  fill: "#F56C6C",
2887
2998
  opacity: "0.9"
2888
- }, null, 8, Sn),
2999
+ }, null, 8, En),
2889
3000
  a("line", {
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,
3001
+ x1: B(c.text) / 2 - 17,
3002
+ y1: -H(c) / 2 - 9,
3003
+ x2: B(c.text) / 2 - 11,
3004
+ y2: -H(c) / 2 - 3,
2894
3005
  stroke: "white",
2895
3006
  "stroke-width": "1.5",
2896
3007
  "stroke-linecap": "round"
2897
- }, null, 8, Cn),
3008
+ }, null, 8, Dn),
2898
3009
  a("line", {
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,
3010
+ x1: B(c.text) / 2 - 11,
3011
+ y1: -H(c) / 2 - 9,
3012
+ x2: B(c.text) / 2 - 17,
3013
+ y2: -H(c) / 2 - 3,
2903
3014
  stroke: "white",
2904
3015
  "stroke-width": "1.5",
2905
3016
  "stroke-linecap": "round"
2906
- }, null, 8, wn)
2907
- ], 40, xn)], 40, gn)) : r("", !0),
3017
+ }, null, 8, On)
3018
+ ], 40, Tn)], 40, bn)) : r("", !0),
2908
3019
  (g(!0), i(e, null, y(c.children || [], (e, u) => (g(), i("g", { key: e.id }, [a("line", {
2909
- x1: ge(s, l, c) - (me(s, l) + le(c).dx),
3020
+ x1: he(s, l, c) - (R(s, l) + le(c).dx),
2910
3021
  y1: 0,
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,
3022
+ x2: _e(s, l, u) - (R(s, l) + le(c).dx) + q("measure", s, l, u).dx,
3023
+ y2: ve(s, l, u) - me(s, l) + q("measure", s, l, u).dy,
2913
3024
  stroke: e.style?.lineColor || A.value.spineColor || t.color,
2914
3025
  "stroke-width": A.value.branchWidth * .4,
2915
3026
  opacity: (e.style?.lineOpacity ?? A.value.branchOpacity * 40) / 100,
2916
3027
  "stroke-dasharray": e.style?.lineStyle === "dashed" ? "3,2" : "none"
2917
- }, null, 8, Tn), a("g", {
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})`,
3028
+ }, null, 8, kn), a("g", {
3029
+ transform: `translate(${_e(s, l, u) - (R(s, l) + le(c).dx) + q("measure", s, l, u).dx}, ${ve(s, l, u) - me(s, l) + q("measure", s, l, u).dy})`,
2919
3030
  onClick: k((t) => _("measure", e.id, s, l, u), ["stop"]),
2920
- onMousedown: (e) => Ae(e, "measure", s, l, u),
2921
- onMouseup: Me,
2922
- onMouseenter: (t) => Le(s, l, u, e),
2923
- onMouseleave: q,
3031
+ onMousedown: (e) => ke(e, "measure", s, l, u),
3032
+ onMouseup: je,
3033
+ onMouseenter: (t) => Ie(s, l, u, e),
3034
+ onMouseleave: Me,
2924
3035
  style: { cursor: "grab" }
2925
3036
  }, [
2926
3037
  n.selectedNode?.id === e.id ? (g(), i("rect", {
2927
3038
  key: 0,
2928
- x: -z(e.text) / 2 - 3,
2929
- y: -(V(e) / 2 + 3),
2930
- width: z(e.text) + 6,
2931
- height: V(e) + 6,
3039
+ x: -B(e.text) / 2 - 3,
3040
+ y: -(H(e) / 2 + 3),
3041
+ width: B(e.text) + 6,
3042
+ height: H(e) + 6,
2932
3043
  rx: A.value.causeRadius + 3,
2933
3044
  fill: "none",
2934
3045
  stroke: "#409EFF",
2935
3046
  "stroke-width": "2.5"
2936
- }, null, 8, Dn)) : r("", !0),
3047
+ }, null, 8, jn)) : r("", !0),
2937
3048
  a("rect", {
2938
- x: -z(e.text) / 2,
2939
- y: -V(e) / 2,
2940
- width: z(e.text),
2941
- height: V(e),
3049
+ x: -B(e.text) / 2,
3050
+ y: -H(e) / 2,
3051
+ width: B(e.text),
3052
+ height: H(e),
2942
3053
  rx: A.value.causeRadius,
2943
- fill: Se(s, l, u),
3054
+ fill: xe(s, l, u),
2944
3055
  opacity: (e.style?.opacity ?? 100) / 100,
2945
3056
  stroke: n.selectedNode?.id === e.id ? "#409EFF" : e.style?.borderStyle === "none" ? "none" : e.style?.borderColor || t.color,
2946
3057
  "stroke-width": n.selectedNode?.id === e.id ? 2.5 : e.style?.borderStyle === "none" ? 0 : e.style?.borderWidth ?? 1
2947
- }, null, 8, On),
3058
+ }, null, 8, Mn),
2948
3059
  a("text", {
2949
3060
  "text-anchor": te(e.style?.textAlign),
2950
3061
  "dominant-baseline": "middle",
2951
- x: j(e.style?.textAlign, z(e.text)),
3062
+ x: j(e.style?.textAlign, B(e.text)),
2952
3063
  fill: e.style?.textColor || "#263238",
2953
- "font-size": Ce(s, l, u),
3064
+ "font-size": Se(s, l, u),
2954
3065
  "font-family": (e.style?.fontFamily || A.value.fontFamily) + ", sans-serif",
2955
3066
  style: { "pointer-events": "none" }
2956
- }, x(we(e.text, e.style?.maxChars ?? 15)), 9, kn),
3067
+ }, x(Ce(e.text, e.style?.maxChars ?? 15)), 9, Nn),
2957
3068
  h.value?.id === e.id ? (g(), i("g", {
2958
3069
  key: 1,
2959
3070
  style: { "pointer-events": "auto" },
@@ -2971,117 +3082,117 @@ var He = "/api/document-versions", Ue = 5e3, We = () => {
2971
3082
  style: { cursor: "pointer" }
2972
3083
  }, [
2973
3084
  a("circle", {
2974
- cx: z(e.text) / 2 - 28,
2975
- cy: -V(e) / 2 - 6,
3085
+ cx: B(e.text) / 2 - 28,
3086
+ cy: -H(e) / 2 - 6,
2976
3087
  r: "6",
2977
3088
  fill: "#67C23A",
2978
3089
  opacity: "0.9"
2979
- }, null, 8, Mn),
3090
+ }, null, 8, In),
2980
3091
  a("circle", {
2981
- cx: z(e.text) / 2 - 28,
2982
- cy: -V(e) / 2 - 6,
3092
+ cx: B(e.text) / 2 - 28,
3093
+ cy: -H(e) / 2 - 6,
2983
3094
  r: "2",
2984
3095
  fill: "white"
2985
- }, null, 8, Nn),
3096
+ }, null, 8, Q),
2986
3097
  a("line", {
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,
3098
+ x1: B(e.text) / 2 - 28,
3099
+ y1: -H(e) / 2 - 6,
3100
+ x2: B(e.text) / 2 - 32,
3101
+ y2: -H(e) / 2 - 9,
2991
3102
  stroke: "white",
2992
3103
  "stroke-width": "1",
2993
3104
  "stroke-linecap": "round"
2994
- }, null, 8, Pn),
3105
+ }, null, 8, Ln),
2995
3106
  a("line", {
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,
3107
+ x1: B(e.text) / 2 - 28,
3108
+ y1: -H(e) / 2 - 6,
3109
+ x2: B(e.text) / 2 - 32,
3110
+ y2: -H(e) / 2 - 3,
3000
3111
  stroke: "white",
3001
3112
  "stroke-width": "1",
3002
3113
  "stroke-linecap": "round"
3003
- }, null, 8, Q),
3114
+ }, null, 8, Rn),
3004
3115
  a("line", {
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,
3116
+ x1: B(e.text) / 2 - 28,
3117
+ y1: -H(e) / 2 - 6,
3118
+ x2: B(e.text) / 2 - 24,
3119
+ y2: -H(e) / 2 - 9,
3009
3120
  stroke: "white",
3010
3121
  "stroke-width": "1",
3011
3122
  "stroke-linecap": "round"
3012
- }, null, 8, Fn),
3123
+ }, null, 8, zn),
3013
3124
  a("line", {
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,
3125
+ x1: B(e.text) / 2 - 28,
3126
+ y1: -H(e) / 2 - 6,
3127
+ x2: B(e.text) / 2 - 24,
3128
+ y2: -H(e) / 2 - 3,
3018
3129
  stroke: "white",
3019
3130
  "stroke-width": "1",
3020
3131
  "stroke-linecap": "round"
3021
- }, null, 8, In),
3132
+ }, null, 8, Bn),
3022
3133
  a("circle", {
3023
- cx: z(e.text) / 2 - 32,
3024
- cy: -V(e) / 2 - 9,
3134
+ cx: B(e.text) / 2 - 32,
3135
+ cy: -H(e) / 2 - 9,
3025
3136
  r: "1",
3026
3137
  fill: "white"
3027
- }, null, 8, Ln),
3138
+ }, null, 8, Vn),
3028
3139
  a("circle", {
3029
- cx: z(e.text) / 2 - 32,
3030
- cy: -V(e) / 2 - 3,
3140
+ cx: B(e.text) / 2 - 32,
3141
+ cy: -H(e) / 2 - 3,
3031
3142
  r: "1",
3032
3143
  fill: "white"
3033
- }, null, 8, Rn),
3144
+ }, null, 8, Hn),
3034
3145
  a("circle", {
3035
- cx: z(e.text) / 2 - 24,
3036
- cy: -V(e) / 2 - 9,
3146
+ cx: B(e.text) / 2 - 24,
3147
+ cy: -H(e) / 2 - 9,
3037
3148
  r: "1",
3038
3149
  fill: "white"
3039
- }, null, 8, zn),
3150
+ }, null, 8, Un),
3040
3151
  a("circle", {
3041
- cx: z(e.text) / 2 - 24,
3042
- cy: -V(e) / 2 - 3,
3152
+ cx: B(e.text) / 2 - 24,
3153
+ cy: -H(e) / 2 - 3,
3043
3154
  r: "1",
3044
3155
  fill: "white"
3045
- }, null, 8, Bn)
3046
- ], 40, jn), a("g", {
3156
+ }, null, 8, Wn)
3157
+ ], 40, Fn), a("g", {
3047
3158
  onClick: k((t) => S("measure", e.id, s), ["stop"]),
3048
3159
  onMousedown: o[7] ||= k(() => {}, ["stop"]),
3049
3160
  style: { cursor: "pointer" }
3050
3161
  }, [
3051
3162
  a("circle", {
3052
- cx: z(e.text) / 2 - 12,
3053
- cy: -V(e) / 2 - 6,
3163
+ cx: B(e.text) / 2 - 12,
3164
+ cy: -H(e) / 2 - 6,
3054
3165
  r: "6",
3055
3166
  fill: "#F56C6C",
3056
3167
  opacity: "0.9"
3057
- }, null, 8, Hn),
3168
+ }, null, 8, Kn),
3058
3169
  a("line", {
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,
3170
+ x1: B(e.text) / 2 - 15,
3171
+ y1: -H(e) / 2 - 9,
3172
+ x2: B(e.text) / 2 - 9,
3173
+ y2: -H(e) / 2 - 3,
3063
3174
  stroke: "white",
3064
3175
  "stroke-width": "1.5",
3065
3176
  "stroke-linecap": "round"
3066
- }, null, 8, Un),
3177
+ }, null, 8, qn),
3067
3178
  a("line", {
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,
3179
+ x1: B(e.text) / 2 - 9,
3180
+ y1: -H(e) / 2 - 9,
3181
+ x2: B(e.text) / 2 - 15,
3182
+ y2: -H(e) / 2 - 3,
3072
3183
  stroke: "white",
3073
3184
  "stroke-width": "1.5",
3074
3185
  "stroke-linecap": "round"
3075
- }, null, 8, Wn)
3076
- ], 40, Vn)], 40, An)) : r("", !0)
3077
- ], 40, En)]))), 128))
3078
- ], 40, fn)
3186
+ }, null, 8, Jn)
3187
+ ], 40, Gn)], 40, Pn)) : r("", !0)
3188
+ ], 40, An)]))), 128))
3189
+ ], 40, gn)
3079
3190
  ]))), 128))
3080
3191
  ]))), 128))
3081
3192
  ]))
3082
- ], 44, Ft))]));
3193
+ ], 44, Rt))]));
3083
3194
  }
3084
- }, [["__scopeId", "data-v-52439ed0"]]), Jn = [
3195
+ }, [["__scopeId", "data-v-52439ed0"]]), Qn = [
3085
3196
  {
3086
3197
  label: "1x (标准)",
3087
3198
  value: 1
@@ -3098,11 +3209,11 @@ var He = "/api/document-versions", Ue = 5e3, We = () => {
3098
3209
  label: "4x (极清)",
3099
3210
  value: 4
3100
3211
  }
3101
- ], Yn = (e) => {
3212
+ ], $n = (e) => {
3102
3213
  let t = new XMLSerializer().serializeToString(e);
3103
3214
  return new Blob([t], { type: "image/svg+xml" });
3104
- }, Xn = async (e, t = 2) => {
3105
- let n = document.createElement("canvas"), r = n.getContext("2d"), i = Yn(e), a = URL.createObjectURL(i);
3215
+ }, er = async (e, t = 2) => {
3216
+ let n = document.createElement("canvas"), r = n.getContext("2d"), i = $n(e), a = URL.createObjectURL(i);
3106
3217
  return new Promise((e, i) => {
3107
3218
  let o = new Image();
3108
3219
  o.onload = () => {
@@ -3111,8 +3222,8 @@ var He = "/api/document-versions", Ue = 5e3, We = () => {
3111
3222
  }, "image/png");
3112
3223
  }, o.onerror = i, o.src = a;
3113
3224
  });
3114
- }, Zn = async (e, t = 2, n = .92) => {
3115
- let r = document.createElement("canvas"), i = r.getContext("2d"), a = Yn(e), o = URL.createObjectURL(a);
3225
+ }, tr = async (e, t = 2, n = .92) => {
3226
+ let r = document.createElement("canvas"), i = r.getContext("2d"), a = $n(e), o = URL.createObjectURL(a);
3116
3227
  return new Promise((e, a) => {
3117
3228
  let s = new Image();
3118
3229
  s.onload = () => {
@@ -3121,26 +3232,26 @@ var He = "/api/document-versions", Ue = 5e3, We = () => {
3121
3232
  }, "image/jpeg", n);
3122
3233
  }, s.onerror = a, s.src = o;
3123
3234
  });
3124
- }, Qn = (e) => {
3235
+ }, nr = (e) => {
3125
3236
  let t = {
3126
3237
  ...e,
3127
3238
  exportedAt: (/* @__PURE__ */ new Date()).toISOString(),
3128
3239
  version: "1.0"
3129
3240
  };
3130
3241
  return new Blob([JSON.stringify(t, null, 2)], { type: "application/json" });
3131
- }, $n = (e) => {
3242
+ }, rr = (e) => {
3132
3243
  let t = `<?xml version="1.0" encoding="UTF-8"?>
3133
3244
  <fishbone-diagram>
3134
- <title>${er(e.title || "")}</title>
3135
- <effect>${er(e.effect || "")}</effect>
3136
- <theme>${er(e.theme || "ocean")}</theme>
3245
+ <title>${ir(e.title || "")}</title>
3246
+ <effect>${ir(e.effect || "")}</effect>
3247
+ <theme>${ir(e.theme || "ocean")}</theme>
3137
3248
  <categories>
3138
3249
  ${(e.categories || []).map((e) => `
3139
- <category id="${e.id}" name="${er(e.name)}" color="${e.color}">
3250
+ <category id="${e.id}" name="${ir(e.name)}" color="${e.color}">
3140
3251
  <causes>
3141
3252
  ${(e.causes || []).map((e) => `
3142
- <cause id="${e.id}" text="${er(e.text)}">
3143
- ${(e.children || []).map((e) => `<child id="${e.id}" text="${er(e.text)}"/>`).join("")}
3253
+ <cause id="${e.id}" text="${ir(e.text)}">
3254
+ ${(e.children || []).map((e) => `<child id="${e.id}" text="${ir(e.text)}"/>`).join("")}
3144
3255
  </cause>
3145
3256
  `).join("")}
3146
3257
  </causes>
@@ -3155,34 +3266,34 @@ var He = "/api/document-versions", Ue = 5e3, We = () => {
3155
3266
  <exportedAt>${(/* @__PURE__ */ new Date()).toISOString()}</exportedAt>
3156
3267
  </fishbone-diagram>`;
3157
3268
  return new Blob([t], { type: "application/xml" });
3158
- }, er = (e) => e ? e.replace(/&/g, "&amp;").replace(/</g, "&lt;").replace(/>/g, "&gt;").replace(/"/g, "&quot;").replace(/'/g, "&apos;") : "", tr = (e, t) => {
3269
+ }, ir = (e) => e ? e.replace(/&/g, "&amp;").replace(/</g, "&lt;").replace(/>/g, "&gt;").replace(/"/g, "&quot;").replace(/'/g, "&apos;") : "", ar = (e, t) => {
3159
3270
  let n = URL.createObjectURL(e), r = document.createElement("a");
3160
3271
  r.href = n, r.download = t, document.body.appendChild(r), r.click(), document.body.removeChild(r), URL.revokeObjectURL(n);
3161
- }, nr = async (e, t, n, r = {}) => {
3272
+ }, or = async (e, t, n, r = {}) => {
3162
3273
  let { scale: i = 2, quality: a = .92 } = r, o, s = `fishbone-${n.title || "diagram"}-${Date.now()}`;
3163
3274
  switch (e) {
3164
3275
  case "svg":
3165
- o = Yn(t), s += ".svg";
3276
+ o = $n(t), s += ".svg";
3166
3277
  break;
3167
3278
  case "png":
3168
- o = await Xn(t, i), s += ".png";
3279
+ o = await er(t, i), s += ".png";
3169
3280
  break;
3170
3281
  case "jpg":
3171
- o = await Zn(t, i, a), s += ".jpg";
3282
+ o = await tr(t, i, a), s += ".jpg";
3172
3283
  break;
3173
3284
  case "json":
3174
- o = Qn(n), s += ".json";
3285
+ o = nr(n), s += ".json";
3175
3286
  break;
3176
3287
  case "xml":
3177
- o = $n(n), s += ".xml";
3288
+ o = rr(n), s += ".xml";
3178
3289
  break;
3179
3290
  default: throw Error(`不支持的导出格式: ${e}`);
3180
3291
  }
3181
- return tr(o, s), s;
3182
- }, rr = { style: {
3292
+ return ar(o, s), s;
3293
+ }, sr = { style: {
3183
3294
  "font-size": "12px",
3184
3295
  color: "#909399"
3185
- } }, ir = { class: "size-preview" }, ar = /*#__PURE__*/ B({
3296
+ } }, cr = { class: "size-preview" }, lr = /*#__PURE__*/ V({
3186
3297
  __name: "ExportDialog",
3187
3298
  props: {
3188
3299
  modelValue: Boolean,
@@ -3218,7 +3329,7 @@ var He = "/api/document-versions", Ue = 5e3, We = () => {
3218
3329
  if (!(!u.svgElement || !u.fishboneData)) {
3219
3330
  _.value = !0;
3220
3331
  try {
3221
- let e = await nr(p.value, u.svgElement, u.fishboneData, {
3332
+ let e = await or(p.value, u.svgElement, u.fishboneData, {
3222
3333
  scale: m.value,
3223
3334
  quality: h.value
3224
3335
  });
@@ -3253,7 +3364,7 @@ var He = "/api/document-versions", Ue = 5e3, We = () => {
3253
3364
  loading: _.value
3254
3365
  }, {
3255
3366
  default: E(() => [_.value ? r("", !0) : (g(), n(l, { key: 0 }, {
3256
- default: E(() => [s(S(L))]),
3367
+ default: E(() => [s(S(I))]),
3257
3368
  _: 1
3258
3369
  })), o(" " + x(_.value ? "导出中..." : "导出"), 1)]),
3259
3370
  _: 1
@@ -3272,35 +3383,35 @@ var He = "/api/document-versions", Ue = 5e3, We = () => {
3272
3383
  default: E(() => [
3273
3384
  s(u, { value: "svg" }, {
3274
3385
  default: E(() => [s(l, null, {
3275
- default: E(() => [s(S(he))]),
3386
+ default: E(() => [s(S(me))]),
3276
3387
  _: 1
3277
3388
  }), c[5] ||= o(" SVG ", -1)]),
3278
3389
  _: 1
3279
3390
  }),
3280
3391
  s(u, { value: "png" }, {
3281
3392
  default: E(() => [s(l, null, {
3282
- default: E(() => [s(S(ge))]),
3393
+ default: E(() => [s(S(he))]),
3283
3394
  _: 1
3284
3395
  }), c[6] ||= o(" PNG ", -1)]),
3285
3396
  _: 1
3286
3397
  }),
3287
3398
  s(u, { value: "jpg" }, {
3288
3399
  default: E(() => [s(l, null, {
3289
- default: E(() => [s(S(ge))]),
3400
+ default: E(() => [s(S(he))]),
3290
3401
  _: 1
3291
3402
  }), c[7] ||= o(" JPG ", -1)]),
3292
3403
  _: 1
3293
3404
  }),
3294
3405
  s(u, { value: "json" }, {
3295
3406
  default: E(() => [s(l, null, {
3296
- default: E(() => [s(S(I))]),
3407
+ default: E(() => [s(S(F))]),
3297
3408
  _: 1
3298
3409
  }), c[8] ||= o(" JSON ", -1)]),
3299
3410
  _: 1
3300
3411
  }),
3301
3412
  s(u, { value: "xml" }, {
3302
3413
  default: E(() => [s(l, null, {
3303
- default: E(() => [s(S(I))]),
3414
+ default: E(() => [s(S(F))]),
3304
3415
  _: 1
3305
3416
  }), c[9] ||= o(" XML ", -1)]),
3306
3417
  _: 1
@@ -3319,7 +3430,7 @@ var He = "/api/document-versions", Ue = 5e3, We = () => {
3319
3430
  "onUpdate:modelValue": c[1] ||= (e) => m.value = e,
3320
3431
  style: { width: "100%" }
3321
3432
  }, {
3322
- default: E(() => [(g(!0), i(e, null, y(S(Jn), (e) => (g(), n(T, {
3433
+ default: E(() => [(g(!0), i(e, null, y(S(Qn), (e) => (g(), n(T, {
3323
3434
  key: e.value,
3324
3435
  label: e.label,
3325
3436
  value: e.value
@@ -3340,14 +3451,14 @@ var He = "/api/document-versions", Ue = 5e3, We = () => {
3340
3451
  step: .1,
3341
3452
  "show-input": "",
3342
3453
  "format-tooltip": (e) => `${Math.round(e * 100)}%`
3343
- }, null, 8, ["modelValue", "format-tooltip"]), a("span", rr, x(Math.round(h.value * 100)) + "%", 1)]),
3454
+ }, null, 8, ["modelValue", "format-tooltip"]), a("span", sr, x(Math.round(h.value * 100)) + "%", 1)]),
3344
3455
  _: 1
3345
3456
  })) : r("", !0),
3346
3457
  ee.value ? (g(), n(v, {
3347
3458
  key: 2,
3348
3459
  label: "预览尺寸"
3349
3460
  }, {
3350
- default: E(() => [a("div", ir, [a("span", null, "宽度: " + x(C.value) + "px", 1), a("span", null, "高度: " + x(w.value) + "px", 1)])]),
3461
+ default: E(() => [a("div", cr, [a("span", null, "宽度: " + x(C.value) + "px", 1), a("span", null, "高度: " + x(w.value) + "px", 1)])]),
3351
3462
  _: 1
3352
3463
  })) : r("", !0)
3353
3464
  ]),
@@ -3357,7 +3468,7 @@ var He = "/api/document-versions", Ue = 5e3, We = () => {
3357
3468
  }, 8, ["modelValue"]);
3358
3469
  };
3359
3470
  }
3360
- }, [["__scopeId", "data-v-5a858b26"]]), or = () => ({
3471
+ }, [["__scopeId", "data-v-5a858b26"]]), ur = () => ({
3361
3472
  opacity: 100,
3362
3473
  borderColor: "",
3363
3474
  borderWidth: 1.5,
@@ -3370,7 +3481,7 @@ var He = "/api/document-versions", Ue = 5e3, We = () => {
3370
3481
  lineOpacity: 60,
3371
3482
  lineStyle: "solid",
3372
3483
  maxChars: 15
3373
- }), sr = () => {
3484
+ }), dr = () => {
3374
3485
  let e = [
3375
3486
  {
3376
3487
  id: "cat-1",
@@ -3378,7 +3489,7 @@ var He = "/api/document-versions", Ue = 5e3, We = () => {
3378
3489
  color: "#2979FF",
3379
3490
  icon: "User",
3380
3491
  position: 0,
3381
- style: or()
3492
+ style: ur()
3382
3493
  },
3383
3494
  {
3384
3495
  id: "cat-2",
@@ -3386,7 +3497,7 @@ var He = "/api/document-versions", Ue = 5e3, We = () => {
3386
3497
  color: "#1B8C3A",
3387
3498
  icon: "SetUp",
3388
3499
  position: 1,
3389
- style: or()
3500
+ style: ur()
3390
3501
  },
3391
3502
  {
3392
3503
  id: "cat-3",
@@ -3394,7 +3505,7 @@ var He = "/api/document-versions", Ue = 5e3, We = () => {
3394
3505
  color: "#D4850A",
3395
3506
  icon: "Box",
3396
3507
  position: 2,
3397
- style: or()
3508
+ style: ur()
3398
3509
  },
3399
3510
  {
3400
3511
  id: "cat-4",
@@ -3402,7 +3513,7 @@ var He = "/api/document-versions", Ue = 5e3, We = () => {
3402
3513
  color: "#D93A3A",
3403
3514
  icon: "Document",
3404
3515
  position: 3,
3405
- style: or()
3516
+ style: ur()
3406
3517
  },
3407
3518
  {
3408
3519
  id: "cat-5",
@@ -3410,7 +3521,7 @@ var He = "/api/document-versions", Ue = 5e3, We = () => {
3410
3521
  color: "#5C6B77",
3411
3522
  icon: "Sunny",
3412
3523
  position: 4,
3413
- style: or()
3524
+ style: ur()
3414
3525
  },
3415
3526
  {
3416
3527
  id: "cat-6",
@@ -3418,7 +3529,7 @@ var He = "/api/document-versions", Ue = 5e3, We = () => {
3418
3529
  color: "#7E3FA0",
3419
3530
  icon: "DataAnalysis",
3420
3531
  position: 5,
3421
- style: or()
3532
+ style: ur()
3422
3533
  }
3423
3534
  ], t = v({
3424
3535
  id: "",
@@ -3482,7 +3593,7 @@ var He = "/api/document-versions", Ue = 5e3, We = () => {
3482
3593
  priority: n.priority || "possible",
3483
3594
  direction: i,
3484
3595
  style: {
3485
- ...or(),
3596
+ ...ur(),
3486
3597
  anchorRatio: c
3487
3598
  },
3488
3599
  children: [],
@@ -3512,7 +3623,7 @@ var He = "/api/document-versions", Ue = 5e3, We = () => {
3512
3623
  text: r.text || "新措施",
3513
3624
  direction: c,
3514
3625
  style: {
3515
- ...or(),
3626
+ ...ur(),
3516
3627
  fontSize: 10,
3517
3628
  maxChars: 15
3518
3629
  },
@@ -3607,8 +3718,8 @@ var He = "/api/document-versions", Ue = 5e3, We = () => {
3607
3718
  };
3608
3719
  //#endregion
3609
3720
  //#region ../../src/composables/useCollaboration.js
3610
- function cr(e, t = {}) {
3611
- let n = new z.Doc(), r = v(!1), i = v(!1), a = v(null), o = v([]), s = v(!1), c = _({
3721
+ function fr(e, t = {}) {
3722
+ let n = new B.Doc(), r = v(!1), i = v(!1), a = v(null), o = v([]), s = v(!1), c = _({
3612
3723
  name: `用户${Math.floor(Math.random() * 1e3)}`,
3613
3724
  color: `#${Math.floor(Math.random() * 16777215).toString(16).padStart(6, "0")}`
3614
3725
  }), l = null, u = null, d = null, f = () => {
@@ -3622,7 +3733,7 @@ function cr(e, t = {}) {
3622
3733
  }, p = () => {
3623
3734
  u &&= (clearInterval(u), null);
3624
3735
  }, m = (t, c) => {
3625
- l && g(), l = new we({
3736
+ l && g(), l = new Ce({
3626
3737
  url: c || `ws://${window.location.hostname}:1234`,
3627
3738
  name: t || (typeof e == "object" ? e.value : e),
3628
3739
  document: n,
@@ -3734,17 +3845,17 @@ function cr(e, t = {}) {
3734
3845
  let r = n.getMap(e);
3735
3846
  return r.observe(t), () => r.unobserve(t);
3736
3847
  },
3737
- encodeState: () => z.encodeStateAsUpdate(n),
3848
+ encodeState: () => B.encodeStateAsUpdate(n),
3738
3849
  decodeState: (e) => {
3739
- z.applyUpdate(n, e);
3850
+ B.applyUpdate(n, e);
3740
3851
  },
3741
3852
  getDocId: () => n.clientID
3742
3853
  };
3743
3854
  }
3744
3855
  //#endregion
3745
3856
  //#region ../../src/composables/useFishboneSync.js
3746
- var lr = (e, n, r, i) => {
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 = {}) => {
3857
+ var pr = (e, n, r, i) => {
3858
+ 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: _ } = fr(e), v = s, y = c, b = !1, x = !1, S = null, ee = (e = {}) => {
3748
3859
  u({
3749
3860
  name: e.name || `用户${Math.floor(Math.random() * 1e3)}`,
3750
3861
  color: e.color || C(),
@@ -3834,7 +3945,7 @@ N.create({
3834
3945
  baseURL: "/api",
3835
3946
  timeout: 3e4
3836
3947
  });
3837
- function ur(e = "/api") {
3948
+ function mr(e = "/api") {
3838
3949
  let t = N.create({
3839
3950
  baseURL: e,
3840
3951
  timeout: 3e4
@@ -3849,7 +3960,7 @@ function ur(e = "/api") {
3849
3960
  listAttachments: (e) => t.get(`/documents/${e}/attachments`)
3850
3961
  };
3851
3962
  }
3852
- function dr(e = "/api") {
3963
+ function hr(e = "/api") {
3853
3964
  let t = N.create({
3854
3965
  baseURL: e,
3855
3966
  timeout: 3e4
@@ -3860,112 +3971,112 @@ function dr(e = "/api") {
3860
3971
  update: (e, n) => t.put(`/questionnaires/${e}`, n)
3861
3972
  };
3862
3973
  }
3863
- dr("/api");
3864
- var fr = ur("/api");
3974
+ hr("/api");
3975
+ var gr = mr("/api");
3865
3976
  (/* @__PURE__ */ new Date()).toISOString(), (/* @__PURE__ */ new Date()).toISOString();
3866
3977
  //#endregion
3867
3978
  //#region ../../src/views/FishboneEditor.vue
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 = {
3979
+ var _r = { class: "editor-main" }, vr = { class: "panel-toggle-icon" }, yr = { class: "panel-content" }, br = ["onClick"], xr = { class: "category-name" }, Sr = { class: "cause-count" }, Cr = {
3869
3980
  key: 0,
3870
3981
  class: "diagram-effect"
3871
- }, br = [
3982
+ }, wr = [
3872
3983
  "data-textbox-id",
3873
3984
  "onMousedown",
3874
3985
  "onDblclick"
3875
- ], xr = [
3986
+ ], Tr = [
3876
3987
  "onUpdate:modelValue",
3877
3988
  "readonly",
3878
3989
  "onBlur"
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 = [
3990
+ ], Er = ["onMousedown"], Dr = ["onMousedown"], Or = ["onMousedown"], kr = ["onMousedown"], Ar = ["onClick"], jr = ["viewBox"], Mr = ["id"], Nr = ["fill"], Pr = ["id"], Fr = ["fill"], Ir = { key: 0 }, Lr = [
3880
3991
  "cx",
3881
3992
  "cy",
3882
3993
  "onMouseenter",
3883
3994
  "onMousedown"
3884
- ], Pr = { key: 0 }, Fr = [
3995
+ ], Rr = { key: 0 }, zr = [
3885
3996
  "cx",
3886
3997
  "cy",
3887
3998
  "onMouseenter",
3888
3999
  "onMousedown"
3889
- ], Ir = [
4000
+ ], Br = [
3890
4001
  "d",
3891
4002
  "stroke",
3892
4003
  "stroke-width",
3893
4004
  "stroke-dasharray",
3894
4005
  "marker-end",
3895
4006
  "marker-start"
3896
- ], Lr = [
4007
+ ], Vr = [
3897
4008
  "d",
3898
4009
  "stroke-width",
3899
4010
  "onMousedown"
3900
- ], Rr = [
4011
+ ], Hr = [
3901
4012
  "cx",
3902
4013
  "cy",
3903
4014
  "onMousedown"
3904
- ], zr = [
4015
+ ], Ur = [
3905
4016
  "cx",
3906
4017
  "cy",
3907
4018
  "onMousedown"
3908
- ], Br = ["cx", "cy"], Vr = ["cx", "cy"], Hr = [
4019
+ ], Wr = ["cx", "cy"], Gr = ["cx", "cy"], Kr = [
3909
4020
  "x1",
3910
4021
  "y1",
3911
4022
  "x2",
3912
4023
  "y2"
3913
- ], Ur = [
4024
+ ], qr = [
3914
4025
  "x1",
3915
4026
  "y1",
3916
4027
  "x2",
3917
4028
  "y2"
3918
- ], Wr = [
4029
+ ], Jr = [
3919
4030
  "x1",
3920
4031
  "y1",
3921
4032
  "x2",
3922
4033
  "y2"
3923
- ], Gr = [
4034
+ ], Yr = [
3924
4035
  "cx",
3925
4036
  "cy",
3926
4037
  "onMousedown"
3927
- ], Kr = ["transform", "onClick"], qr = { class: "panel-content" }, Jr = {
4038
+ ], Xr = ["transform", "onClick"], Zr = { class: "panel-content" }, Qr = {
3928
4039
  key: 0,
3929
4040
  class: "detail-form"
3930
- }, Yr = {
4041
+ }, $r = {
3931
4042
  key: 1,
3932
4043
  class: "detail-form"
3933
- }, Xr = ["value"], Zr = { class: "children-list" }, Qr = {
4044
+ }, ei = ["value"], ti = { class: "children-list" }, ni = {
3934
4045
  key: 1,
3935
4046
  class: "detail-form"
3936
- }, $r = {
4047
+ }, ri = {
3937
4048
  key: 2,
3938
4049
  class: "detail-form"
3939
- }, ei = {
4050
+ }, ii = {
3940
4051
  key: 0,
3941
4052
  style: {
3942
4053
  display: "flex",
3943
4054
  "align-items": "center",
3944
4055
  gap: "8px"
3945
4056
  }
3946
- }, ti = {
4057
+ }, ai = {
3947
4058
  key: 1,
3948
4059
  style: {
3949
4060
  color: "#909399",
3950
4061
  "font-size": "12px"
3951
4062
  }
3952
- }, ni = {
4063
+ }, oi = {
3953
4064
  key: 0,
3954
4065
  style: {
3955
4066
  display: "flex",
3956
4067
  "align-items": "center",
3957
4068
  gap: "8px"
3958
4069
  }
3959
- }, ri = {
4070
+ }, si = {
3960
4071
  key: 1,
3961
4072
  style: {
3962
4073
  color: "#909399",
3963
4074
  "font-size": "12px"
3964
4075
  }
3965
- }, ii = {
4076
+ }, ci = {
3966
4077
  key: 3,
3967
4078
  class: "no-selection"
3968
- }, ai = "fishbone", oi = /*#__PURE__*/ B({
4079
+ }, li = "fishbone", ui = /*#__PURE__*/ V({
3969
4080
  __name: "FishboneEditor",
3970
4081
  props: {
3971
4082
  docId: {
@@ -3995,6 +4106,10 @@ var pr = { class: "editor-main" }, mr = { class: "panel-toggle-icon" }, hr = { c
3995
4106
  uiConfig: {
3996
4107
  type: Object,
3997
4108
  default: () => ({})
4109
+ },
4110
+ aiApi: {
4111
+ type: [String, Object],
4112
+ default: null
3998
4113
  }
3999
4114
  },
4000
4115
  setup(n) {
@@ -4003,36 +4118,36 @@ var pr = { class: "editor-main" }, mr = { class: "panel-toggle-icon" }, hr = { c
4003
4118
  titleEditable: !0,
4004
4119
  authorEditable: !0,
4005
4120
  ...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 = () => {
4121
+ })), O = t(() => h.docId ?? l.params.id), A = t(() => h.apiBase && h.apiBase !== "/api" ? mr(h.apiBase) : gr), re = v(!1), ie = v(!1), { saveVersion: ae } = qe(), P = Be(), oe = We(() => h.aiApi), se = v(O.value || `fishbone-${Date.now()}`), { fishboneData: F, selectedNode: I, selectedNodeType: L, history: le, historyIndex: de, addCategory: fe, updateCategory: pe, deleteCategory: me, addCause: he, updateCause: _e, deleteCause: ve, addChild: ye, updateChild: be, deleteChild: xe, selectNode: Se, clearSelection: z, undo: B, redo: Ce, saveHistory: V } = dr(), H = () => {
4122
+ z(), W.value = null, we.value = null, Y.value = null;
4123
+ }, U = v([]), W = v(null), we = v(null), Te = v(!1), Ee = v(!1), G = v(null), K = v(""), De = v(0), Oe = v(0), ke = v(0), Ae = v(0), je = v(0), q = v(0), Me = v(!1), J = v([]), Y = v(null), Ne = v(null), Pe = v(!1), Fe = v(!1), Ie = v(!1), Le = v(""), Re = v(0), Ve = v(0), { isConnected: He, isSynced: Ue, onlineUsers: Ge, doc: Ke, awareness: Je, initUser: Ye, connect: Xe, disconnect: Ze, closeCollaboration: Qe, checkCollaborationClosed: $e, collaborationClosed: et, startSync: tt, enableLocalPush: nt, stopSync: rt } = pr(se.value, F, U, J), it = v(!1), ot = v(!1), st = v(!1), ct = v([]), lt = null, ut = () => {
4009
4124
  if (!F.value.title?.trim()) {
4010
4125
  M.warning("请输入标题");
4011
4126
  return;
4012
4127
  }
4013
- let e = oe.value;
4014
- Ye(e, h.wsUrl || void 0);
4128
+ let e = se.value;
4129
+ Xe(e, h.wsUrl || void 0);
4015
4130
  let t = h.user?.name || `用户${Math.floor(Math.random() * 1e3)}`;
4016
- Je({ name: t });
4017
- let n = qe.value;
4131
+ Ye({ name: t });
4132
+ let n = Je.value;
4018
4133
  n.on("change", () => {
4019
- st.value = Array.from(n.getStates().entries()).filter(([e, t]) => t.user).map(([e, t]) => ({
4134
+ ct.value = Array.from(n.getStates().entries()).filter(([e, t]) => t.user).map(([e, t]) => ({
4020
4135
  clientId: e,
4021
4136
  ...t.user
4022
4137
  }));
4023
4138
  }), P.setCollabContext({
4024
4139
  ydoc: Ke,
4025
4140
  provider: null,
4026
- onlineUsers: st
4141
+ onlineUsers: ct
4027
4142
  }), P.setCurrentUser({
4028
4143
  id: n.clientID,
4029
4144
  name: t,
4030
4145
  color: `#${Math.floor(Math.random() * 16777215).toString(16).padStart(6, "0")}`
4031
- }), it.value = !0, at.value = !0, ot.value = !1, ct = setInterval(() => {
4146
+ }), it.value = !0, ot.value = !0, st.value = !1, lt = setInterval(() => {
4032
4147
  He.value && Ge.value;
4033
4148
  }, 5e3);
4034
4149
  let r = () => {
4035
- et();
4150
+ tt();
4036
4151
  };
4037
4152
  if (Ue.value) r();
4038
4153
  else {
@@ -4047,23 +4162,23 @@ var pr = { class: "editor-main" }, mr = { class: "panel-toggle-icon" }, hr = { c
4047
4162
  M.success("协作已开启");
4048
4163
  });
4049
4164
  }, dt = () => {
4050
- ct &&= (clearInterval(ct), null), rt(), Ze(), it.value = !1, at.value = !1, ot.value = !1, M.info("协作已关闭");
4165
+ lt &&= (clearInterval(lt), null), rt(), Qe(), it.value = !1, ot.value = !1, st.value = !1, M.info("协作已关闭");
4051
4166
  }, ft = async () => {
4052
4167
  let e = O.value;
4053
4168
  if (!e) return;
4054
- Ye(e, h.wsUrl || void 0);
4169
+ Xe(e, h.wsUrl || void 0);
4055
4170
  let t = h.user?.name || `协作人${Math.floor(Math.random() * 1e3)}`;
4056
- Je({ name: t });
4057
- let n = qe.value;
4171
+ Ye({ name: t });
4172
+ let n = Je.value;
4058
4173
  n.on("change", () => {
4059
- st.value = Array.from(n.getStates().entries()).filter(([e, t]) => t.user).map(([e, t]) => ({
4174
+ ct.value = Array.from(n.getStates().entries()).filter(([e, t]) => t.user).map(([e, t]) => ({
4060
4175
  clientId: e,
4061
4176
  ...t.user
4062
4177
  }));
4063
4178
  }), P.setCollabContext({
4064
4179
  ydoc: Ke,
4065
4180
  provider: null,
4066
- onlineUsers: st
4181
+ onlineUsers: ct
4067
4182
  }), P.setCurrentUser({
4068
4183
  id: n.clientID,
4069
4184
  name: t,
@@ -4071,8 +4186,8 @@ var pr = { class: "editor-main" }, mr = { class: "panel-toggle-icon" }, hr = { c
4071
4186
  });
4072
4187
  let r = (e) => {
4073
4188
  if (e) {
4074
- if (Qe()) return Xe(), it.value = !1, ot.value = !1, M.warning("该协作已关闭,无法加入"), !0;
4075
- tt();
4189
+ if ($e()) return Ze(), it.value = !1, st.value = !1, M.warning("该协作已关闭,无法加入"), !0;
4190
+ nt();
4076
4191
  }
4077
4192
  return !1;
4078
4193
  };
@@ -4082,28 +4197,28 @@ var pr = { class: "editor-main" }, mr = { class: "panel-toggle-icon" }, hr = { c
4082
4197
  e(), r(t);
4083
4198
  });
4084
4199
  }
4085
- it.value = !0, ot.value = !0, at.value = !1, ct = setInterval(() => {
4200
+ it.value = !0, st.value = !0, ot.value = !1, lt = setInterval(() => {
4086
4201
  He.value && Ge.value;
4087
4202
  }, 5e3);
4088
- }, pt = () => {
4089
- it.value ? dt() : lt();
4090
- }, mt = async () => {
4203
+ }, mt = () => {
4204
+ it.value ? dt() : ut();
4205
+ }, ht = async () => {
4091
4206
  if (!it.value) {
4092
- lt();
4207
+ ut();
4093
4208
  return;
4094
4209
  }
4095
- let e = `${window.location.origin}/fishbone-editor/${oe.value}?collab=1`;
4210
+ let e = `${window.location.origin}/fishbone-editor/${se.value}?collab=1`;
4096
4211
  try {
4097
4212
  await navigator.clipboard.writeText(e), M.success("分享链接已复制到剪贴板");
4098
4213
  } catch {
4099
4214
  M.info(`分享链接: ${e}`);
4100
4215
  }
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);
4216
+ }, gt = v(null), _t = v(null), vt = v(100), yt = v(!1), bt = v(null), xt = v("png"), X = t(() => Y.value && J.value.find((e) => e.id === Y.value) || null), St = v(!1);
4102
4217
  v("");
4103
- let St = v(!1), Ct = v(null), wt = t(() => {
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;
4218
+ let Ct = v(!1), wt = v(null), Tt = t(() => {
4219
+ let e = [], t = F.value.categories || [], n = Math.max(t.length, 1), r = Math.max(600, n * 130) / (n + 1), i = (pt.find((e) => e.id === F.value.diagramStyle) || pt[0]).nodeHeight || 36;
4105
4220
  return t.forEach((t, n) => {
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;
4221
+ let a = 150 + r * (n + 1), o = n % 2 == 0 ? 100 - (i / 2 + 8) : 400 + (i / 2 + 8), s = Lt(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;
4107
4222
  e.push({
4108
4223
  id: t.id,
4109
4224
  type: "node",
@@ -4133,7 +4248,7 @@ var pr = { class: "editor-main" }, mr = { class: "panel-toggle-icon" }, hr = { c
4133
4248
  });
4134
4249
  let m = t.causes || [], h = (t.style?.fontSize ?? 12) - 2, g = a + d, _ = a + 30 + l, v = n % 2 == 0 ? 100 : 400;
4135
4250
  m.forEach((t, n) => {
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;
4251
+ let r = Lt(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;
4137
4252
  e.push({
4138
4253
  id: t.id,
4139
4254
  type: "node",
@@ -4163,7 +4278,7 @@ var pr = { class: "editor-main" }, mr = { class: "panel-toggle-icon" }, hr = { c
4163
4278
  });
4164
4279
  let y = t.children || [], b = Math.max(8, h - 2);
4165
4280
  y.forEach((t, n) => {
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;
4281
+ let i = Lt(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;
4167
4282
  e.push({
4168
4283
  id: t.id,
4169
4284
  type: "node",
@@ -4194,33 +4309,33 @@ var pr = { class: "editor-main" }, mr = { class: "panel-toggle-icon" }, hr = { c
4194
4309
  });
4195
4310
  });
4196
4311
  }), e;
4197
- }), Tt = t(() => {
4198
- if (gt.value) {
4199
- let e = gt.value.getViewBox();
4312
+ }), Et = t(() => {
4313
+ if (_t.value) {
4314
+ let e = _t.value.getViewBox();
4200
4315
  if (e && e.w > 0 && e.h > 0) return `${e.x} ${e.y} ${e.w} ${e.h}`;
4201
4316
  }
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;
4317
+ let e = F.value.categories || [], t = Math.max(e.length, 1), n = Math.max(600, t * 130), r = 150 + n, i = pt.find((e) => e.id === F.value.diagramStyle) || pt[0], a = i.nodeHeight || 36;
4203
4318
  i.causeHeight;
4204
4319
  let o = 30, s = 100, c = 250, l = 250;
4205
4320
  return c = Math.min(c, 180), l = Math.max(l, 320), s = Math.max(s, r + 120), e.forEach((e, r) => {
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;
4321
+ let i = 150 + n / (t + 1) * (r + 1), u = r % 2 == 0 ? 100 - (a / 2 + 8) : 400 + (a / 2 + 8), d = Lt(e.name, "category") / 2 + 20, f = r % 2 == 0 ? 100 : 400;
4207
4322
  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);
4208
4323
  }), `${o - 60} ${c - 60} ${s - o + 120} ${l - c + 120}`;
4209
- }), Et = (e) => ln({
4324
+ }), Dt = (e) => dn({
4210
4325
  x: 0,
4211
4326
  y: 0,
4212
4327
  width: e.width,
4213
4328
  height: e.height
4214
- }, 60).map((t) => Ot(e.x + t.x, e.y + t.y)), Dt = t(() => {
4215
- let e = Tt.value.split(" ").map(Number);
4329
+ }, 60).map((t) => kt(e.x + t.x, e.y + t.y)), Ot = t(() => {
4330
+ let e = Et.value.split(" ").map(Number);
4216
4331
  return {
4217
4332
  x: e[0] || 0,
4218
4333
  y: e[1] || 0,
4219
4334
  w: e[2] || 800,
4220
4335
  h: e[3] || 500
4221
4336
  };
4222
- }), Ot = (e, t) => {
4223
- let n = gt.value?.getSvgElement(), r = ht.value?.querySelector(".canvas-wrapper");
4337
+ }), kt = (e, t) => {
4338
+ let n = _t.value?.getSvgElement(), r = gt.value?.querySelector(".canvas-wrapper");
4224
4339
  if (n && r) {
4225
4340
  let i = r.getBoundingClientRect(), a = e + i.left, o = t + i.top, s = n.createSVGPoint();
4226
4341
  s.x = a, s.y = o;
@@ -4233,19 +4348,19 @@ var pr = { class: "editor-main" }, mr = { class: "panel-toggle-icon" }, hr = { c
4233
4348
  };
4234
4349
  }
4235
4350
  }
4236
- let i = Dt.value;
4351
+ let i = Ot.value;
4237
4352
  return {
4238
- x: e / X.value.width * i.w + i.x,
4239
- y: t / X.value.height * i.h + i.y
4353
+ x: e / At.value.width * i.w + i.x,
4354
+ y: t / At.value.height * i.h + i.y
4240
4355
  };
4241
- }, X = v({
4356
+ }, At = v({
4242
4357
  width: 800,
4243
4358
  height: 600
4244
- }), kt = v({
4359
+ }), jt = v({
4245
4360
  width: 800,
4246
4361
  height: 600
4247
- }), jt = () => {
4248
- let e = ht.value?.querySelector(".canvas-wrapper");
4362
+ }), Mt = () => {
4363
+ let e = gt.value?.querySelector(".canvas-wrapper");
4249
4364
  return e ? {
4250
4365
  width: e.scrollWidth || e.offsetWidth || 800,
4251
4366
  height: e.scrollHeight || e.offsetHeight || 600
@@ -4253,7 +4368,7 @@ var pr = { class: "editor-main" }, mr = { class: "panel-toggle-icon" }, hr = { c
4253
4368
  width: 800,
4254
4369
  height: 600
4255
4370
  };
4256
- }, Mt = t(() => {
4371
+ }, Nt = t(() => {
4257
4372
  let e = {
4258
4373
  ocean: {
4259
4374
  primary: "#1E90FF",
@@ -4467,35 +4582,41 @@ var pr = { class: "editor-main" }, mr = { class: "panel-toggle-icon" }, hr = { c
4467
4582
  }
4468
4583
  };
4469
4584
  return e[F.value.theme] || e.ocean;
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(() => {
4585
+ }), Ft = v(!1), It = t(() => !!I.value || L.value === "title" || !!W.value || !!Y.value), Z = t(() => W.value && U.value.find((e) => e.id === W.value) || null), Rt = t(() => !!I.value || !!W.value), zt = t(() => {
4471
4586
  let e = F.value.titleStyle, t = { textAlign: e.textAlign }, n = e.bgColor, r = e.bgOpacity;
4472
4587
  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;
4473
- }), Rt = t(() => {
4588
+ }), Bt = t(() => {
4474
4589
  let e = F.value.titleStyle;
4475
4590
  return {
4476
4591
  fontFamily: e.fontFamily,
4477
4592
  fontSize: e.fontSize + "px",
4478
4593
  color: e.color
4479
4594
  };
4480
- }), zt = () => {
4595
+ }), Vt = () => {
4481
4596
  document.activeElement?.blur(), u(() => document.activeElement?.blur()), I.value = { ...F.value.titleStyle }, L.value = "title";
4482
- }, Bt = () => {
4483
- h.docId || c.push("/");
4484
- }, Vt = async (e) => {
4485
- M.info("AI生成功能开发中,敬请期待...");
4486
4597
  }, Ht = () => {
4487
- Se(de(), "category"), M.success("类别已添加");
4598
+ h.docId || c.push("/");
4488
4599
  }, Ut = async (e) => {
4600
+ let t = await oe.generate(e, "鱼骨图");
4601
+ if (t.success && t.parsed) try {
4602
+ Object.assign(F.value, t.parsed), M.success("AI生成成功");
4603
+ } catch {
4604
+ M.warning("AI返回的数据格式无法解析,请调整提示词后重试");
4605
+ }
4606
+ else M.info(t.message || "AI生成功能开发中,敬请期待...");
4607
+ }, Wt = () => {
4608
+ Se(fe(), "category"), M.success("类别已添加");
4609
+ }, Gt = async (e) => {
4489
4610
  try {
4490
- await ne.confirm("确定要删除此类别吗?", "提示", { type: "warning" }), pe(e), I.value?.id === e && Ce(), M.success("类别已删除");
4611
+ await ne.confirm("确定要删除此类别吗?", "提示", { type: "warning" }), me(e), I.value?.id === e && z(), M.success("类别已删除");
4491
4612
  } catch {}
4492
- }, Wt = () => {
4613
+ }, Kt = () => {
4493
4614
  !I.value || L.value !== "cause" || ye(I.value.categoryId, I.value.id, { direction: "left" }) && (M.success("措施已添加"), Q.value++);
4494
- }, Gt = (e) => {
4615
+ }, qt = (e) => {
4495
4616
  !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();
4617
+ }, Jt = (e) => {
4618
+ if (document.activeElement?.blur(), u(() => document.activeElement?.blur()), W.value = null, we.value = null, Y.value = null, e.type === "head") {
4619
+ z();
4499
4620
  return;
4500
4621
  }
4501
4622
  let t = null, n = e.type;
@@ -4520,7 +4641,7 @@ var pr = { class: "editor-main" }, mr = { class: "panel-toggle-icon" }, hr = { c
4520
4641
  lineOpacity: 60,
4521
4642
  lineStyle: "solid"
4522
4643
  }), t && Se(t, n);
4523
- }, qt = (e) => {
4644
+ }, Yt = (e) => {
4524
4645
  let t = e.style || {}, n = t.bgColor || "#FFEB3B", r = (t.bgOpacity ?? 90) / 100, i = "rgba(255, 235, 59, 0.9)";
4525
4646
  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})`), {
4526
4647
  position: "absolute",
@@ -4530,7 +4651,7 @@ var pr = { class: "editor-main" }, mr = { class: "panel-toggle-icon" }, hr = { c
4530
4651
  height: e.height + "px",
4531
4652
  background: i
4532
4653
  };
4533
- }, Jt = (e) => {
4654
+ }, Xt = (e) => {
4534
4655
  let t = e.style || {}, n = t.fontStyle || "normal", r = "normal", i = "normal", a = "none";
4535
4656
  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"), {
4536
4657
  color: t.textColor || "#303133",
@@ -4541,8 +4662,8 @@ var pr = { class: "editor-main" }, mr = { class: "panel-toggle-icon" }, hr = { c
4541
4662
  fontWeight: i,
4542
4663
  textDecoration: a
4543
4664
  };
4544
- }, Yt = () => {
4545
- let e = "textbox-" + Date.now(), t = X.value, n = t.width / 2 - 100, r = t.height / 2 - 40, i = {
4665
+ }, Zt = () => {
4666
+ let e = "textbox-" + Date.now(), t = At.value, n = t.width / 2 - 100, r = t.height / 2 - 40, i = {
4546
4667
  id: e,
4547
4668
  x: n,
4548
4669
  y: r,
@@ -4566,51 +4687,51 @@ var pr = { class: "editor-main" }, mr = { class: "panel-toggle-icon" }, hr = { c
4566
4687
  textDecoration: "none"
4567
4688
  }
4568
4689
  };
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());
4690
+ U.value.push(i);
4574
4691
  }, Qt = (e) => {
4575
- U.value = e.id, u(() => {
4692
+ we.value === e.id && (we.value = null);
4693
+ }, $t = (e, t) => {
4694
+ we.value === e.id && t.target.classList.contains("textbox-content") || (W.value = e.id, we.value = null, Y.value = null, z(), Te.value = !0, G.value = e, De.value = t.clientX, Oe.value = t.clientY, ke.value = e.x, Ae.value = e.y, Me.value = !1, document.addEventListener("mousemove", tn), document.addEventListener("mouseup", nn), t.preventDefault());
4695
+ }, en = (e) => {
4696
+ we.value = e.id, u(() => {
4576
4697
  let t = document.querySelector(`[data-textbox-id="${e.id}"] .textbox-content`);
4577
4698
  t && t.focus();
4578
4699
  });
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) {
4585
- let e = X.value;
4586
- W.value._xPercent = W.value.x / e.width, W.value._yPercent = W.value.y / e.height, W.value._hasPercent = !0;
4587
- }
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) {
4597
- let e = X.value;
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;
4700
+ }, tn = (e) => {
4701
+ if (!Te.value || !G.value) return;
4702
+ let t = (e.clientX - De.value) / (vt.value / 100), n = (e.clientY - Oe.value) / (vt.value / 100);
4703
+ !Me.value && Math.abs(t) < 3 && Math.abs(n) < 3 || (Me.value = !0, G.value.x = ke.value + t, G.value.y = Ae.value + n);
4704
+ }, nn = () => {
4705
+ if (Te.value = !1, G.value && Me.value) {
4706
+ let e = At.value;
4707
+ G.value._xPercent = G.value.x / e.width, G.value._yPercent = G.value.y / e.height, G.value._hasPercent = !0;
4599
4708
  }
4600
- W.value = null, document.removeEventListener("mousemove", nn), document.removeEventListener("mouseup", rn);
4709
+ Me.value = !1, G.value = null, document.removeEventListener("mousemove", tn), document.removeEventListener("mouseup", nn);
4710
+ }, rn = (e, t, n) => {
4711
+ Ee.value = !0, K.value = t, G.value = e, De.value = n.clientX, Oe.value = n.clientY, ke.value = e.x, Ae.value = e.y, je.value = e.width, q.value = e.height, document.addEventListener("mousemove", an), document.addEventListener("mouseup", on), n.preventDefault();
4601
4712
  }, 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);
4713
+ if (!Ee.value || !G.value) return;
4714
+ let t = (e.clientX - De.value) / (vt.value / 100), n = (e.clientY - Oe.value) / (vt.value / 100), r = K.value;
4715
+ r.includes("e") && (G.value.width = Math.max(50, je.value + t)), r.includes("w") && (G.value.x = ke.value + t, G.value.width = Math.max(50, je.value - t)), r.includes("s") && (G.value.height = Math.max(30, q.value + n)), r.includes("n") && (G.value.y = Ae.value + n, G.value.height = Math.max(30, q.value - n));
4604
4716
  }, on = () => {
4605
- if (!It.value) return;
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;
4717
+ if (Ee.value = !1, G.value) {
4718
+ let e = At.value;
4719
+ G.value._xPercent = G.value.x / e.width, G.value._yPercent = G.value.y / e.height, G.value._wPercent = G.value.width / e.width, G.value._hPercent = G.value.height / e.height, G.value._hasPercent = !0;
4720
+ }
4721
+ G.value = null, document.removeEventListener("mousemove", an), document.removeEventListener("mouseup", on);
4722
+ }, sn = (e) => {
4723
+ let t = U.value.findIndex((t) => t.id === e);
4724
+ t >= 0 && (U.value.splice(t, 1), W.value = null, we.value = null);
4725
+ }, cn = () => {
4726
+ if (!Rt.value) return;
4727
+ let e = Z.value, t = I.value, n = At.value, r = "arrow-" + Date.now(), i, a, o, s, c = null, l = null, u = null;
4607
4728
  if (e) {
4608
- let t = Ot(e.x + e.width, e.y + e.height / 2);
4729
+ let t = kt(e.x + e.width, e.y + e.height / 2);
4609
4730
  i = t.x, a = t.y, o = i + 150, s = a, c = e.id, l = "textbox", u = "border-15";
4610
4731
  } else if (t) {
4611
- let e = t.id, n = wt.value.find((t) => t.id === e);
4732
+ let e = t.id, n = Tt.value.find((t) => t.id === e);
4612
4733
  if (n) {
4613
- let t = un(n, "right", "node");
4734
+ let t = fn(n, "right", "node");
4614
4735
  i = t.x, a = t.y, o = i + 150, s = a, c = e, l = "node", u = "right";
4615
4736
  }
4616
4737
  }
@@ -4644,14 +4765,14 @@ var pr = { class: "editor-main" }, mr = { class: "panel-toggle-icon" }, hr = { c
4644
4765
  arrowEnd: !0
4645
4766
  }
4646
4767
  };
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) => {
4768
+ J.value.push(d), Y.value = r, W.value = null, I.value = null, L.value = null;
4769
+ }, ln = (e) => {
4770
+ let t = J.value.findIndex((t) => t.id === e);
4771
+ t >= 0 && (J.value.splice(t, 1), Y.value = null);
4772
+ }, un = (e) => {
4652
4773
  let { startX: t, startY: n, endX: r, endY: i, cpX: a, cpY: o, style: s } = e;
4653
4774
  return s.lineType === "curve" ? `M ${t} ${n} Q ${a} ${o} ${r} ${i}` : `M ${t} ${n} L ${r} ${i}`;
4654
- }, ln = (e, t = 30) => {
4775
+ }, dn = (e, t = 30) => {
4655
4776
  let { x: n, y: r, width: i, height: a } = e, o = [], s = 2 * (i + a);
4656
4777
  for (let e = 0; e < t; e++) {
4657
4778
  let c = e / t * s, l, u;
@@ -4662,16 +4783,16 @@ var pr = { class: "editor-main" }, mr = { class: "panel-toggle-icon" }, hr = { c
4662
4783
  });
4663
4784
  }
4664
4785
  return o;
4665
- }, un = (e, t, n) => {
4786
+ }, fn = (e, t, n) => {
4666
4787
  if (e.anchors && e.anchors[t]) return e.anchors[t];
4667
4788
  if (n === "textbox" && t && t.startsWith("border-")) {
4668
- let n = parseInt(t.split("-")[1]), r = ln({
4789
+ let n = parseInt(t.split("-")[1]), r = dn({
4669
4790
  x: 0,
4670
4791
  y: 0,
4671
4792
  width: e.width,
4672
4793
  height: e.height
4673
4794
  }, 60)[n];
4674
- return r ? Ot(e.x + r.x, e.y + r.y) : null;
4795
+ return r ? kt(e.x + r.x, e.y + r.y) : null;
4675
4796
  }
4676
4797
  if (t === "top") return {
4677
4798
  x: e.x + e.width / 2,
@@ -4691,30 +4812,30 @@ var pr = { class: "editor-main" }, mr = { class: "panel-toggle-icon" }, hr = { c
4691
4812
  };
4692
4813
  if (t && t.startsWith("border-")) {
4693
4814
  let n = parseInt(t.split("-")[1]);
4694
- return ln(e)[n] || null;
4815
+ return dn(e)[n] || null;
4695
4816
  }
4696
4817
  return {
4697
4818
  x: e.x,
4698
4819
  y: e.y
4699
4820
  };
4700
- }, dn = (e, t) => {
4821
+ }, pn = (e, t) => {
4701
4822
  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;
4702
- wt.value.forEach((e) => {
4703
- ln(e).forEach((t, l) => {
4823
+ Tt.value.forEach((e) => {
4824
+ dn(e).forEach((t, l) => {
4704
4825
  let u = Math.hypot(n - t.x, r - t.y);
4705
4826
  u < i && (i = u, a = t, o = e.id, s = "node", c = "border-" + l);
4706
4827
  });
4707
- }), V.value.forEach((e) => {
4708
- ln({
4828
+ }), U.value.forEach((e) => {
4829
+ dn({
4709
4830
  x: 0,
4710
4831
  y: 0,
4711
4832
  width: e.width,
4712
4833
  height: e.height
4713
4834
  }, 60).forEach((t, l) => {
4714
- let u = Ot(e.x + t.x, e.y + t.y), d = Math.hypot(n - u.x, r - u.y);
4835
+ let u = kt(e.x + t.x, e.y + t.y), d = Math.hypot(n - u.x, r - u.y);
4715
4836
  d < i && (i = d, a = u, o = e.id, s = "textbox", c = "border-" + l);
4716
4837
  });
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) => {
4838
+ }), 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), U.value.forEach((e) => {
4718
4839
  let t = {
4719
4840
  top: {
4720
4841
  x: e.x + e.width / 2,
@@ -4738,50 +4859,50 @@ var pr = { class: "editor-main" }, mr = { class: "panel-toggle-icon" }, hr = { c
4738
4859
  u < i && (i = u, a = l, o = e.id, s = "textbox", c = t);
4739
4860
  });
4740
4861
  }), 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);
4741
- }, fn = (e, t, n, r) => {
4742
- if (!Y.value) return;
4862
+ }, mn = (e, t, n, r) => {
4863
+ if (!X.value) return;
4743
4864
  let i = e;
4744
- t === "node" && (i = wt.value.find((t) => t.id === e.id) || e);
4745
- let a = un(i, n, t);
4865
+ t === "node" && (i = Tt.value.find((t) => t.id === e.id) || e);
4866
+ let a = fn(i, n, t);
4746
4867
  if (!a) return;
4747
- let o = Y.value;
4868
+ let o = X.value;
4748
4869
  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);
4749
- let s = X.value;
4870
+ let s = At.value;
4750
4871
  o._startXP = o.startX / s.width, o._startYP = o.startY / s.height, o._endXP = o.endX / s.width, o._endYP = o.endY / s.height;
4751
- }, pn = () => {
4752
- q.value.forEach((e) => {
4872
+ }, hn = () => {
4873
+ J.value.forEach((e) => {
4753
4874
  if (e.startConnectId) {
4754
4875
  let t = null;
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);
4876
+ if (e.startConnectType === "textbox" ? t = U.value.find((t) => t.id === e.startConnectId) : e.startConnectType === "node" && (t = Tt.value.find((t) => t.id === e.startConnectId)), t && e.startAnchor) {
4877
+ let n = fn(t, e.startAnchor, e.startConnectType);
4757
4878
  n && (e.startX = n.x, e.startY = n.y);
4758
4879
  }
4759
4880
  }
4760
4881
  if (e.endConnectId) {
4761
4882
  let t = null;
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);
4883
+ if (e.endConnectType === "textbox" ? t = U.value.find((t) => t.id === e.endConnectId) : e.endConnectType === "node" && (t = Tt.value.find((t) => t.id === e.endConnectId)), t && e.endAnchor) {
4884
+ let n = fn(t, e.endAnchor, e.endConnectType);
4764
4885
  n && (e.endX = n.x, e.endY = n.y);
4765
4886
  }
4766
4887
  }
4767
- let t = X.value;
4888
+ let t = At.value;
4768
4889
  e._startXP = e.startX / t.width, e._startYP = e.startY / t.height, e._endXP = e.endX / t.width, e._endYP = e.endY / t.height;
4769
4890
  });
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"));
4779
- let e = X.value;
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;
4891
+ }, gn = (e, t, n) => {
4892
+ Pe.value = !0, Ct.value = !0, Le.value = t, Y.value = e.id, Re.value = n.clientX, Ve.value = n.clientY, document.addEventListener("mousemove", _n), document.addEventListener("mouseup", vn), n.preventDefault(), n.stopPropagation();
4893
+ }, _n = (e) => {
4894
+ if (!Pe.value && !Fe.value && !Ie.value || !X.value) return;
4895
+ let t = (e.clientX - Re.value) / (vt.value / 100), n = (e.clientY - Ve.value) / (vt.value / 100);
4896
+ Fe.value ? (X.value.startX += t, X.value.startY += n, X.value.endX += t, X.value.endY += n, X.value.cpX += t, X.value.cpY += n) : Le.value === "start" ? (X.value.startX += t, X.value.startY += n) : Le.value === "end" ? (X.value.endX += t, X.value.endY += n) : Le.value === "cp" && (X.value.cpX += t, X.value.cpY += n), Re.value = e.clientX, Ve.value = e.clientY;
4897
+ }, vn = () => {
4898
+ if ((Pe.value || Fe.value || Ie.value) && X.value) {
4899
+ Pe.value && (Le.value === "start" ? pn(X.value, "start") : Le.value === "end" && pn(X.value, "end"));
4900
+ let e = At.value;
4901
+ X.value._startXP = X.value.startX / e.width, X.value._startYP = X.value.startY / e.height, X.value._endXP = X.value.endX / e.width, X.value._endYP = X.value.endY / e.height, X.value._cpXP = X.value.cpX / e.width, X.value._cpYP = X.value.cpY / e.height;
4781
4902
  }
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) => {
4903
+ Pe.value = !1, Fe.value = !1, Ie.value = !1, Ct.value = !1, Le.value = "", document.removeEventListener("mousemove", _n), document.removeEventListener("mouseup", vn);
4904
+ }, yn = (e, t) => {
4905
+ Fe.value = !0, Y.value = e.id, Re.value = t.clientX, Ve.value = t.clientY, document.addEventListener("mousemove", _n), document.addEventListener("mouseup", vn), t.preventDefault(), t.stopPropagation(), console.log("=== 选中箭头线,调试文本框锚点 ==="), U.value.forEach((e) => {
4785
4906
  console.log(`文本框 [${e.id}]: CSS x=${e.x}, y=${e.y}, w=${e.width}, h=${e.height}`), [
4786
4907
  {
4787
4908
  name: "左上",
@@ -4803,7 +4924,7 @@ var pr = { class: "editor-main" }, mr = { class: "panel-toggle-icon" }, hr = { c
4803
4924
  x: e.x,
4804
4925
  y: e.y + e.height
4805
4926
  }
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)})`));
4927
+ ].forEach((e) => console.log(` 角 ${e.name}: CSS(${e.x.toFixed(1)}, ${e.y.toFixed(1)}) → SVG(${kt(e.x, e.y).x.toFixed(1)}, ${kt(e.x, e.y).y.toFixed(1)})`));
4807
4928
  let t = {
4808
4929
  top: {
4809
4930
  x: e.x + e.width / 2,
@@ -4822,15 +4943,15 @@ var pr = { class: "editor-main" }, mr = { class: "panel-toggle-icon" }, hr = { c
4822
4943
  y: e.y + e.height / 2
4823
4944
  }
4824
4945
  };
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) => {
4946
+ Object.entries(t).forEach(([e, t]) => console.log(` 锚点 ${e}: CSS(${t.x.toFixed(1)}, ${t.y.toFixed(1)}) → SVG(${kt(t.x, t.y).x.toFixed(1)}, ${kt(t.x, t.y).y.toFixed(1)})`));
4947
+ }), console.log("viewBox:", Et.value), console.log("canvasSize:", At.value);
4948
+ }, bn = (e, t) => {
4949
+ Ie.value = !0, Le.value = "cp", Y.value = e.id, Re.value = t.clientX, Ve.value = t.clientY, document.addEventListener("mousemove", _n), document.addEventListener("mouseup", vn), t.preventDefault(), t.stopPropagation();
4950
+ }, xn = (e) => {
4830
4951
  F.value.theme = e, M.success("主题已切换");
4831
- }, bn = (e) => {
4952
+ }, Sn = (e) => {
4832
4953
  F.value.diagramStyle = e, Q.value++, M.success("样式已切换");
4833
- }, xn = async (e) => {
4954
+ }, Cn = async (e) => {
4834
4955
  let t = {
4835
4956
  category: "类别",
4836
4957
  cause: "原因",
@@ -4842,36 +4963,36 @@ var pr = { class: "editor-main" }, mr = { class: "panel-toggle-icon" }, hr = { c
4842
4963
  confirmButtonText: "确定",
4843
4964
  cancelButtonText: "取消",
4844
4965
  type: "warning"
4845
- }), e.type === "category") pe(e.id);
4966
+ }), e.type === "category") me(e.id);
4846
4967
  else if (e.type === "cause") ve(e.catIndex === void 0 ? "" : F.value.categories[e.catIndex]?.id, e.id);
4847
4968
  else if (e.type === "child") {
4848
- we();
4969
+ V();
4849
4970
  let t = F.value.categories[e.catIndex]?.causes?.[e.causeIndex];
4850
4971
  if (t?.children) {
4851
4972
  let n = t.children.findIndex((t) => t.id === e.id);
4852
4973
  n !== -1 && t.children.splice(n, 1);
4853
4974
  }
4854
4975
  } else if (e.type === "measure") {
4855
- we();
4976
+ V();
4856
4977
  let t = F.value.categories[e.catIndex]?.causes?.[e.causeIndex];
4857
4978
  if (t?.children) {
4858
4979
  let n = t.children.findIndex((t) => t.id === e.id);
4859
4980
  n !== -1 && t.children.splice(n, 1);
4860
4981
  }
4861
4982
  }
4862
- I.value?.id === e.id && Ce(), Q.value++, M.success("已删除");
4983
+ I.value?.id === e.id && z(), Q.value++, M.success("已删除");
4863
4984
  } catch {}
4864
- }, Sn = v(!1), Cn = v({
4985
+ }, wn = v(!1), Tn = v({
4865
4986
  text: "",
4866
4987
  direction: "left",
4867
4988
  parentType: "",
4868
4989
  parentId: "",
4869
4990
  catIndex: 0,
4870
4991
  causeIndex: 0
4871
- }), wn = (e) => {
4992
+ }), En = (e) => {
4872
4993
  let { type: t, catIndex: n, causeIndex: r, measureIndex: i, dx: a, dy: o } = e, s = F.value.categories[n];
4873
4994
  if (s) {
4874
- if (we(), t === "cat") s.style ||= {}, s.style.dragDx = a, s.style.dragDy = o;
4995
+ if (V(), t === "cat") s.style ||= {}, s.style.dragDx = a, s.style.dragDy = o;
4875
4996
  else if (t === "anchor") s.style ||= {}, s.style.anchorDx = a;
4876
4997
  else if (t === "cause") {
4877
4998
  let e = s.causes?.[r];
@@ -4880,27 +5001,27 @@ var pr = { class: "editor-main" }, mr = { class: "panel-toggle-icon" }, hr = { c
4880
5001
  let e = (s.causes?.[r])?.children?.[i];
4881
5002
  e && (e.style ||= {}, e.style.dragDx = a, e.style.dragDy = o);
4882
5003
  }
4883
- Q.value++, u(() => pn());
5004
+ Q.value++, u(() => hn());
4884
5005
  }
4885
- }, Tn = (e) => {
4886
- Cn.value = {
5006
+ }, Dn = (e) => {
5007
+ Tn.value = {
4887
5008
  text: "",
4888
5009
  direction: "left",
4889
5010
  parentType: e.type,
4890
5011
  parentId: e.id,
4891
5012
  catIndex: e.catIndex ?? 0,
4892
5013
  causeIndex: e.causeIndex ?? 0
4893
- }, Sn.value = !0;
4894
- }, En = () => {
4895
- if (!Cn.value.text.trim()) {
5014
+ }, wn.value = !0;
5015
+ }, On = () => {
5016
+ if (!Tn.value.text.trim()) {
4896
5017
  M.warning("请输入子节点名称");
4897
5018
  return;
4898
5019
  }
4899
- let { parentType: e, catIndex: t, causeIndex: n, text: r, direction: i } = Cn.value, a = F.value.categories[t];
5020
+ let { parentType: e, catIndex: t, causeIndex: n, text: r, direction: i } = Tn.value, a = F.value.categories[t];
4900
5021
  if (!a) return;
4901
5022
  let o = null, s = "";
4902
5023
  if (e === "category") {
4903
- we(), a.causes ||= [];
5024
+ V(), a.causes ||= [];
4904
5025
  let e = {
4905
5026
  id: `cause-${Date.now()}`,
4906
5027
  text: r,
@@ -4923,7 +5044,7 @@ var pr = { class: "editor-main" }, mr = { class: "panel-toggle-icon" }, hr = { c
4923
5044
  };
4924
5045
  a.causes.push(e), o = e, s = "cause";
4925
5046
  } else if (e === "cause") {
4926
- we();
5047
+ V();
4927
5048
  let e = a.causes?.[n];
4928
5049
  if (e) {
4929
5050
  e.children ||= [];
@@ -4948,15 +5069,15 @@ var pr = { class: "editor-main" }, mr = { class: "panel-toggle-icon" }, hr = { c
4948
5069
  e.children.push(t), o = t, s = "measure";
4949
5070
  }
4950
5071
  }
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);
5072
+ wn.value = !1, o && Se(o, s), Q.value++, M.success("已添加");
4956
5073
  }, kn = () => {
4957
- _t.value = 100;
4958
- }, An = async () => {
4959
- if (ot.value && $e.value) {
5074
+ vt.value = Math.min(200, vt.value + 10);
5075
+ }, An = () => {
5076
+ vt.value = Math.max(50, vt.value - 10);
5077
+ }, jn = () => {
5078
+ vt.value = 100;
5079
+ }, Mn = async () => {
5080
+ if (st.value && et.value) {
4960
5081
  M.error("协作已关闭,无法提交保存");
4961
5082
  return;
4962
5083
  }
@@ -4977,8 +5098,8 @@ var pr = { class: "editor-main" }, mr = { class: "panel-toggle-icon" }, hr = { c
4977
5098
  title: F.value.title,
4978
5099
  content: JSON.stringify({
4979
5100
  ...F.value,
4980
- textBoxes: V.value,
4981
- arrowLines: q.value
5101
+ textBoxes: U.value,
5102
+ arrowLines: J.value
4982
5103
  }),
4983
5104
  doc_type: "fishbone",
4984
5105
  status: 2
@@ -4996,8 +5117,8 @@ var pr = { class: "editor-main" }, mr = { class: "panel-toggle-icon" }, hr = { c
4996
5117
  docType: "fishbone",
4997
5118
  content: JSON.stringify({
4998
5119
  ...F.value,
4999
- textBoxes: V.value,
5000
- arrowLines: q.value
5120
+ textBoxes: U.value,
5121
+ arrowLines: J.value
5001
5122
  }),
5002
5123
  userId: String(P.currentUser.value?.id || ""),
5003
5124
  userName: P.currentUser.value?.name || "未知"
@@ -5005,27 +5126,27 @@ var pr = { class: "editor-main" }, mr = { class: "panel-toggle-icon" }, hr = { c
5005
5126
  } catch (e) {
5006
5127
  M.error("保存失败"), console.error(e);
5007
5128
  }
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
5129
  }, Nn = (e) => {
5130
+ xt.value = e || "png", bt.value = _t.value?.getSvgElement(), yt.value = !0;
5131
+ }, Pn = ({ format: e, filename: t }) => {
5132
+ M.success(`已导出: ${t}`);
5133
+ }, Fn = (e) => {
5013
5134
  let { catIndex: t, causeIndex: n, measureIndex: r } = e, i = (F.value.categories[t]?.causes?.[n])?.children?.[r];
5014
5135
  i && M.info(`思维导图功能开发中: ${i.text}`);
5015
- }, Pn = async () => {
5136
+ }, In = async () => {
5016
5137
  let e = O.value;
5017
5138
  if (e && !String(e).startsWith("fishbone-")) try {
5018
5139
  let t;
5019
5140
  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
5141
  let e = JSON.parse(t.data.content);
5021
- Object.assign(F.value, e), e.textBoxes && (V.value = e.textBoxes, u(() => {
5022
- let e = X.value;
5023
- V.value.forEach((t) => {
5142
+ Object.assign(F.value, e), e.textBoxes && (U.value = e.textBoxes, u(() => {
5143
+ let e = At.value;
5144
+ U.value.forEach((t) => {
5024
5145
  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);
5025
5146
  });
5026
- })), e.arrowLines && (q.value = e.arrowLines, u(() => {
5027
- let e = X.value;
5028
- q.value.forEach((t) => {
5147
+ })), e.arrowLines && (J.value = e.arrowLines, u(() => {
5148
+ let e = At.value;
5149
+ J.value.forEach((t) => {
5029
5150
  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);
5030
5151
  });
5031
5152
  }));
@@ -5041,60 +5162,53 @@ var pr = { class: "editor-main" }, mr = { class: "panel-toggle-icon" }, hr = { c
5041
5162
  let e = document.activeElement;
5042
5163
  e && e.tagName !== "BODY" && e.blur();
5043
5164
  });
5044
- }), T(V, () => {
5045
- pn();
5165
+ }), T(U, () => {
5166
+ hn();
5046
5167
  }, { deep: !0 }), T(() => F.value.categories, () => {
5047
- pn();
5048
- }, { deep: !0 }), T(wt, () => {
5049
- pn();
5168
+ hn();
5169
+ }, { deep: !0 }), T(Tt, () => {
5170
+ hn();
5050
5171
  }, { deep: !0 });
5051
- let Fn = () => {
5172
+ let Ln = () => {
5052
5173
  u(() => {
5053
- let e = jt();
5174
+ let e = Mt();
5054
5175
  if (e.width > 0 && e.height > 0) {
5055
- let t = X.value.width, n = X.value.height;
5056
- t > 0 && n > 0 && (Math.abs(e.width - t) > 1 || Math.abs(e.height - n) > 1) && (V.value.forEach((r) => {
5176
+ let t = At.value.width, n = At.value.height;
5177
+ t > 0 && n > 0 && (Math.abs(e.width - t) > 1 || Math.abs(e.height - n) > 1) && (U.value.forEach((r) => {
5057
5178
  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);
5058
- }), q.value.forEach((r) => {
5179
+ }), J.value.forEach((r) => {
5059
5180
  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;
5060
- })), X.value = {
5181
+ })), At.value = {
5061
5182
  width: e.width,
5062
5183
  height: e.height
5063
- }, pn();
5184
+ }, hn();
5064
5185
  }
5065
5186
  });
5066
- }, In = [
5067
- "我可以帮您分析鱼骨图结构、梳理因果关系,或者提供问题分析思路。请问有什么需要帮助的?",
5068
- "这个鱼骨图的分类很全面。建议检查每个主分支下的子原因是否充分,有没有遗漏的关键因素。",
5069
- "根据当前的问题定义,我建议从人、机、料、法、环、测六个维度全面分析可能的根本原因。",
5070
- "鱼骨图中的因果关系链条很清晰。如果需要,我可以帮您进一步深挖某些关键原因的深层因素。",
5071
- "我可以帮您检查鱼骨图中是否存在重复的原因或相互矛盾的因果关系。需要我逐条分析吗?",
5072
- "建议对每个主要原因添加权重或优先级标注,这样可以帮助团队聚焦最关键的问题。",
5073
- "这个鱼骨图的分析框架不错。建议在关键原因节点添加数据和证据支持,增强分析的说服力。",
5074
- "我可以帮您将鱼骨图的分析结果转化为改进计划或解决方案文档。"
5075
- ], Ln = async (e, t = {}) => {
5076
- let n = O.value ? `${ai}-${O.value}` : null;
5187
+ }, Rn = async (e, t = {}) => {
5188
+ let n = O.value ? `${li}-${O.value}` : null;
5077
5189
  await P.sendMessage(e, {
5078
5190
  ...t,
5079
5191
  roomId: n
5080
5192
  });
5081
5193
  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;
5084
- }, 800 + Math.random() * 1200));
5085
- }, Rn = () => {
5086
- let e = O.value ? `${ai}-${O.value}` : null;
5087
- P.clearMessages(e);
5194
+ if (!r || i || a.length === 0) {
5195
+ P.loading.value = !0;
5196
+ let t = await oe.chat(e, P.messages.value);
5197
+ P.sendAiMessage(t, n), P.loading.value = !1;
5198
+ }
5088
5199
  }, zn = () => {
5200
+ let e = O.value ? `${li}-${O.value}` : null;
5201
+ P.clearMessages(e);
5202
+ }, Bn = () => {
5089
5203
  if (!F.value.id) {
5090
5204
  M.warning("请先保存文档");
5091
5205
  return;
5092
5206
  }
5093
5207
  ie.value = !0;
5094
- }, Bn = (e) => {
5208
+ }, Vn = (e) => {
5095
5209
  try {
5096
5210
  let t = typeof e == "string" ? JSON.parse(e) : e;
5097
- Object.assign(F.value, t), t.textBoxes && (V.value = t.textBoxes), t.arrowLines && (q.value = t.arrowLines);
5211
+ Object.assign(F.value, t), t.textBoxes && (U.value = t.textBoxes), t.arrowLines && (J.value = t.arrowLines);
5098
5212
  } catch (e) {
5099
5213
  console.error("Version apply error:", e);
5100
5214
  }
@@ -5105,13 +5219,13 @@ var pr = { class: "editor-main" }, mr = { class: "panel-toggle-icon" }, hr = { c
5105
5219
  id: Date.now(),
5106
5220
  name: e,
5107
5221
  color: "#409eff"
5108
- }), Je({ name: e }), Pn().then(() => {
5222
+ }), Ye({ name: e }), In().then(() => {
5109
5223
  l.query.collab === "1" && O.value && ft();
5110
5224
  }), u(() => {
5111
- let e = jt();
5112
- X.value = { ...e }, kt.value = { ...e };
5113
- let t = ht.value;
5114
- t && new ResizeObserver(() => Fn()).observe(t);
5225
+ let e = Mt();
5226
+ At.value = { ...e }, jt.value = { ...e };
5227
+ let t = gt.value;
5228
+ t && new ResizeObserver(() => Ln()).observe(t);
5115
5229
  });
5116
5230
  }), m(() => {
5117
5231
  document.addEventListener("mousedown", (e) => {
@@ -5120,14 +5234,14 @@ var pr = { class: "editor-main" }, mr = { class: "panel-toggle-icon" }, hr = { c
5120
5234
  });
5121
5235
  }), m(() => {
5122
5236
  document.addEventListener("keydown", (e) => {
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);
5237
+ e.ctrlKey || e.metaKey ? e.key === "z" ? (e.preventDefault(), B()) : e.key === "y" ? (e.preventDefault(), Ce()) : e.key === "s" && (e.preventDefault(), Mn()) : (e.key === "Delete" || e.key === "Backspace") && I.value && L.value === "category" && Gt(I.value.id);
5124
5238
  });
5125
5239
  }), p(() => {
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);
5240
+ lt &&= (clearInterval(lt), null), document.removeEventListener("mousemove", tn), document.removeEventListener("mouseup", nn), document.removeEventListener("mousemove", an), document.removeEventListener("mouseup", on), document.removeEventListener("mousemove", _n), document.removeEventListener("mouseup", vn), Ln && window.removeEventListener("resize", Ln);
5127
5241
  }), (t, n) => {
5128
5242
  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");
5129
5243
  return g(), i("div", { class: d(["fishbone-editor", `theme-${S(F).theme}`]) }, [
5130
- s(At, {
5244
+ s(Pt, {
5131
5245
  title: S(F).title,
5132
5246
  "onUpdate:title": n[0] ||= (e) => S(F).title = e,
5133
5247
  effect: S(F).effect,
@@ -5136,35 +5250,35 @@ var pr = { class: "editor-main" }, mr = { class: "panel-toggle-icon" }, hr = { c
5136
5250
  "onUpdate:author": n[2] ||= (e) => S(F).author = e,
5137
5251
  "current-theme": S(F).theme,
5138
5252
  "current-diagram-style": S(F).diagramStyle,
5139
- zoom: _t.value,
5140
- "can-undo": S(le) > 0,
5141
- "can-redo": S(le) < S(ce).length - 1,
5253
+ zoom: vt.value,
5254
+ "can-undo": S(de) > 0,
5255
+ "can-redo": S(de) < S(le).length - 1,
5142
5256
  "can-add-cause": S(F).categories.length > 0,
5143
5257
  "is-connected": it.value,
5144
5258
  "online-users": S(Ge),
5145
5259
  "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,
5260
+ onBack: Ht,
5261
+ onAddTextBox: Zt,
5262
+ "can-add-arrow": Rt.value,
5263
+ onAddArrow: cn,
5264
+ onUndo: S(B),
5265
+ onRedo: S(Ce),
5266
+ onZoomIn: kn,
5267
+ onZoomOut: An,
5268
+ onFitView: jn,
5269
+ onSelectTheme: xn,
5270
+ onSelectStyle: Sn,
5271
+ onSave: Mn,
5272
+ onExport: Nn,
5273
+ onToggleCollab: mt,
5274
+ onShareCollab: ht,
5275
+ onAiGenerate: Ut,
5276
+ readonly: st.value && !ot.value,
5163
5277
  "back-button": _.value.backButton,
5164
5278
  "title-editable": _.value.titleEditable,
5165
5279
  "author-editable": _.value.authorEditable,
5166
5280
  "show-history": !!S(F).id,
5167
- onHistory: zn
5281
+ onHistory: Bn
5168
5282
  }, null, 8, [
5169
5283
  "title",
5170
5284
  "effect",
@@ -5187,12 +5301,12 @@ var pr = { class: "editor-main" }, mr = { class: "panel-toggle-icon" }, hr = { c
5187
5301
  "author-editable",
5188
5302
  "show-history"
5189
5303
  ]),
5190
- a("div", pr, [
5191
- a("div", { class: d(["side-panel left-panel", { collapsed: !Pt.value }]) }, [a("div", {
5304
+ a("div", _r, [
5305
+ a("div", { class: d(["side-panel left-panel", { collapsed: !Ft.value }]) }, [a("div", {
5192
5306
  class: "panel-header",
5193
- onClick: n[3] ||= (e) => Pt.value = !Pt.value,
5307
+ onClick: n[3] ||= (e) => Ft.value = !Ft.value,
5194
5308
  style: { cursor: "pointer" }
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", {
5309
+ }, [a("h4", null, x(Ft.value ? "类别列表" : ""), 1), a("span", vr, x(Ft.value ? "«" : "»"), 1)]), D(a("div", yr, [(g(!0), i(e, null, y(S(F).categories, (e) => (g(), i("div", {
5196
5310
  key: e.id,
5197
5311
  class: d(["category-item", { active: S(I)?.id === e.id }]),
5198
5312
  onClick: (t) => S(Se)(e, "category")
@@ -5201,66 +5315,66 @@ var pr = { class: "editor-main" }, mr = { class: "panel-toggle-icon" }, hr = { c
5201
5315
  class: "category-color",
5202
5316
  style: f({ background: e.color })
5203
5317
  }, null, 4),
5204
- a("span", _r, x(e.name), 1),
5205
- a("span", vr, x(e.causes?.length || 0), 1),
5318
+ a("span", xr, x(e.name), 1),
5319
+ a("span", Sr, x(e.causes?.length || 0), 1),
5206
5320
  s(l, {
5207
5321
  size: "small",
5208
5322
  circle: "",
5209
5323
  class: "delete-btn",
5210
- onClick: k((t) => Ut(e.id), ["stop"])
5324
+ onClick: k((t) => Gt(e.id), ["stop"])
5211
5325
  }, {
5212
5326
  default: E(() => [s(c, null, {
5213
- default: E(() => [s(S(se))]),
5327
+ default: E(() => [s(S(ce))]),
5214
5328
  _: 1
5215
5329
  })]),
5216
5330
  _: 1
5217
5331
  }, 8, ["onClick"])
5218
- ], 10, gr))), 128)), s(l, {
5332
+ ], 10, br))), 128)), s(l, {
5219
5333
  size: "small",
5220
5334
  type: "primary",
5221
5335
  class: "add-btn",
5222
- onClick: Ht
5336
+ onClick: Wt
5223
5337
  }, {
5224
5338
  default: E(() => [s(c, null, {
5225
- default: E(() => [s(S(_e))]),
5339
+ default: E(() => [s(S(ge))]),
5226
5340
  _: 1
5227
5341
  }), n[65] ||= o(" 添加类别 ", -1)]),
5228
5342
  _: 1
5229
- })], 512), [[w, Pt.value]])], 2),
5343
+ })], 512), [[w, Ft.value]])], 2),
5230
5344
  a("div", {
5231
5345
  class: "canvas-container",
5232
5346
  ref_key: "canvasContainer",
5233
- ref: ht,
5234
- onMousedown: k(B, ["self"])
5347
+ ref: gt,
5348
+ onMousedown: k(H, ["self"])
5235
5349
  }, [a("div", {
5236
5350
  class: d(["diagram-title-area", { "selected-title": S(L) === "title" }]),
5237
- style: f(Lt.value),
5238
- onClick: k(zt, ["stop"])
5351
+ style: f(zt.value),
5352
+ onClick: k(Vt, ["stop"])
5239
5353
  }, [a("h2", {
5240
5354
  class: "diagram-title",
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", {
5355
+ style: f(Bt.value)
5356
+ }, x(S(F).title || "鱼骨图分析"), 5), S(F).effect ? (g(), i("p", Cr, "问题:" + x(S(F).effect), 1)) : r("", !0)], 6), a("div", {
5243
5357
  class: "canvas-wrapper",
5244
- style: f({ transform: `scale(${_t.value / 100})` }),
5245
- onMousedown: k(B, ["self"])
5358
+ style: f({ transform: `scale(${vt.value / 100})` }),
5359
+ onMousedown: k(H, ["self"])
5246
5360
  }, [
5247
- s(qn, {
5361
+ s(Zn, {
5248
5362
  ref_key: "fishboneRenderer",
5249
- ref: gt,
5363
+ ref: _t,
5250
5364
  categories: S(F).categories,
5251
5365
  effect: S(F).effect,
5252
- theme: Mt.value,
5366
+ theme: Nt.value,
5253
5367
  "selected-node": S(I),
5254
5368
  "style-tick": Q.value,
5255
5369
  "diagram-style": S(F).diagramStyle,
5256
5370
  width: "100%",
5257
5371
  height: "100%",
5258
- onSelectNode: Kt,
5259
- onClearSelection: B,
5260
- onDeleteNode: xn,
5261
- onAddChild: Tn,
5262
- onNodeDragged: wn,
5263
- onOpenMindmap: Nn
5372
+ onSelectNode: Jt,
5373
+ onClearSelection: H,
5374
+ onDeleteNode: Cn,
5375
+ onAddChild: Dn,
5376
+ onNodeDragged: En,
5377
+ onOpenMindmap: Fn
5264
5378
  }, null, 8, [
5265
5379
  "categories",
5266
5380
  "effect",
@@ -5269,56 +5383,56 @@ var pr = { class: "editor-main" }, mr = { class: "panel-toggle-icon" }, hr = { c
5269
5383
  "style-tick",
5270
5384
  "diagram-style"
5271
5385
  ]),
5272
- (g(!0), i(e, null, y(V.value, (t) => (g(), i("div", {
5386
+ (g(!0), i(e, null, y(U.value, (t) => (g(), i("div", {
5273
5387
  key: t.id,
5274
5388
  class: d(["textbox-rect", {
5275
- selected: H.value === t.id,
5276
- editing: U.value === t.id,
5277
- "show-anchors": xt.value || St.value
5389
+ selected: W.value === t.id,
5390
+ editing: we.value === t.id,
5391
+ "show-anchors": St.value || Ct.value
5278
5392
  }]),
5279
5393
  "data-textbox-id": t.id,
5280
- style: f(qt(t)),
5281
- onMousedown: k((e) => Zt(t, e), ["stop"]),
5282
- onDblclick: k((e) => Qt(t), ["stop"])
5394
+ style: f(Yt(t)),
5395
+ onMousedown: k((e) => $t(t, e), ["stop"]),
5396
+ onDblclick: k((e) => en(t), ["stop"])
5283
5397
  }, [D(a("textarea", {
5284
5398
  class: "textbox-content",
5285
5399
  "onUpdate:modelValue": (e) => t.text = e,
5286
- style: f(Jt(t)),
5400
+ style: f(Xt(t)),
5287
5401
  placeholder: "输入文字...",
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 }, [
5402
+ readonly: we.value !== t.id,
5403
+ onBlur: (e) => Qt(t)
5404
+ }, null, 44, Tr), [[C, t.text]]), W.value === t.id || St.value || Ct.value ? (g(), i(e, { key: 0 }, [
5291
5405
  a("div", {
5292
5406
  class: "resize-handle resize-handle-se",
5293
- onMousedown: k((e) => tn(t, "se", e), ["stop"])
5294
- }, null, 40, Sr),
5407
+ onMousedown: k((e) => rn(t, "se", e), ["stop"])
5408
+ }, null, 40, Er),
5295
5409
  a("div", {
5296
5410
  class: "resize-handle resize-handle-sw",
5297
- onMousedown: k((e) => tn(t, "sw", e), ["stop"])
5298
- }, null, 40, Cr),
5411
+ onMousedown: k((e) => rn(t, "sw", e), ["stop"])
5412
+ }, null, 40, Dr),
5299
5413
  a("div", {
5300
5414
  class: "resize-handle resize-handle-ne",
5301
- onMousedown: k((e) => tn(t, "ne", e), ["stop"])
5302
- }, null, 40, wr),
5415
+ onMousedown: k((e) => rn(t, "ne", e), ["stop"])
5416
+ }, null, 40, Or),
5303
5417
  a("div", {
5304
5418
  class: "resize-handle resize-handle-nw",
5305
- onMousedown: k((e) => tn(t, "nw", e), ["stop"])
5306
- }, null, 40, Tr),
5419
+ onMousedown: k((e) => rn(t, "nw", e), ["stop"])
5420
+ }, null, 40, kr),
5307
5421
  a("div", {
5308
5422
  class: "textbox-delete-btn",
5309
- onClick: k((e) => an(t.id), ["stop"])
5310
- }, "×", 8, Er)
5311
- ], 64)) : r("", !0)], 46, br))), 128)),
5423
+ onClick: k((e) => sn(t.id), ["stop"])
5424
+ }, "×", 8, Ar)
5425
+ ], 64)) : r("", !0)], 46, wr))), 128)),
5312
5426
  (g(), i("svg", {
5313
5427
  ref_key: "arrowSvgRef",
5314
5428
  ref: Ne,
5315
5429
  class: "arrow-lines-svg",
5316
5430
  xmlns: "http://www.w3.org/2000/svg",
5317
- viewBox: Tt.value,
5431
+ viewBox: Et.value,
5318
5432
  preserveAspectRatio: "xMidYMid meet",
5319
5433
  "pointer-events": "none"
5320
5434
  }, [
5321
- a("defs", null, [(g(!0), i(e, null, y(q.value, (e) => (g(), i("marker", {
5435
+ a("defs", null, [(g(!0), i(e, null, y(J.value, (e) => (g(), i("marker", {
5322
5436
  key: "marker-end-" + e.id,
5323
5437
  id: "arrowhead-end-" + e.id,
5324
5438
  markerWidth: "10",
@@ -5329,7 +5443,7 @@ var pr = { class: "editor-main" }, mr = { class: "panel-toggle-icon" }, hr = { c
5329
5443
  }, [a("polygon", {
5330
5444
  points: "0 0, 10 3.5, 0 7",
5331
5445
  fill: e.style.lineColor
5332
- }, null, 8, kr)], 8, Or))), 128)), (g(!0), i(e, null, y(q.value, (e) => (g(), i("marker", {
5446
+ }, null, 8, Nr)], 8, Mr))), 128)), (g(!0), i(e, null, y(J.value, (e) => (g(), i("marker", {
5333
5447
  key: "marker-start-" + e.id,
5334
5448
  id: "arrowhead-start-" + e.id,
5335
5449
  markerWidth: "10",
@@ -5340,8 +5454,8 @@ var pr = { class: "editor-main" }, mr = { class: "panel-toggle-icon" }, hr = { c
5340
5454
  }, [a("polygon", {
5341
5455
  points: "10 0, 0 3.5, 10 7",
5342
5456
  fill: e.style.lineColor
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", {
5457
+ }, null, 8, Fr)], 8, Pr))), 128))]),
5458
+ Y.value || Pe.value || Fe.value || Ct.value ? (g(), i("g", Ir, [(g(!0), i(e, null, y(Tt.value, (t) => (g(), i(e, { key: "anchors-" + t.id }, [(g(!0), i(e, null, y(dn(t), (e, r) => (g(), i("circle", {
5345
5459
  key: "anchor-" + r,
5346
5460
  cx: e.x,
5347
5461
  cy: e.y,
@@ -5352,10 +5466,10 @@ var pr = { class: "editor-main" }, mr = { class: "panel-toggle-icon" }, hr = { c
5352
5466
  opacity: "0.6",
5353
5467
  "pointer-events": "auto",
5354
5468
  style: { cursor: "crosshair" },
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", {
5469
+ onMouseenter: (e) => wt.value = t.id,
5470
+ onMouseleave: n[4] ||= (e) => wt.value = null,
5471
+ onMousedown: k((e) => mn(t, "node", "border-" + r, e), ["stop"])
5472
+ }, null, 40, Lr))), 128))], 64))), 128)), (g(!0), i(e, null, y(U.value, (t) => (g(), i(e, { key: "tb-anchors-" + t.id }, [Y.value || Pe.value || Fe.value || Ct.value ? (g(), i("g", Rr, [(g(!0), i(e, null, y(Dt(t), (e, r) => (g(), i("circle", {
5359
5473
  key: "tb-anchor-" + r,
5360
5474
  cx: e.x,
5361
5475
  cy: e.y,
@@ -5366,31 +5480,31 @@ var pr = { class: "editor-main" }, mr = { class: "panel-toggle-icon" }, hr = { c
5366
5480
  opacity: "0.7",
5367
5481
  "pointer-events": "auto",
5368
5482
  style: { cursor: "crosshair" },
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 }, [
5483
+ onMouseenter: (e) => wt.value = t.id,
5484
+ onMouseleave: n[5] ||= (e) => wt.value = null,
5485
+ onMousedown: k((e) => mn(t, "textbox", "border-" + r, e), ["stop"])
5486
+ }, null, 40, zr))), 128))])) : r("", !0)], 64))), 128))])) : r("", !0),
5487
+ (g(!0), i(e, null, y(J.value, (t) => (g(), i("g", { key: t.id }, [
5374
5488
  a("path", {
5375
- d: cn(t),
5489
+ d: un(t),
5376
5490
  fill: "none",
5377
- stroke: J.value === t.id ? "#409EFF" : t.style.lineColor,
5491
+ stroke: Y.value === t.id ? "#409EFF" : t.style.lineColor,
5378
5492
  "stroke-width": t.style.lineWidth,
5379
5493
  "stroke-dasharray": t.style.lineStyle === "dashed" ? "8,4" : "none",
5380
5494
  "marker-end": t.style.arrowEnd ? `url(#arrowhead-end-${t.id})` : "",
5381
5495
  "marker-start": t.style.arrowStart ? `url(#arrowhead-start-${t.id})` : "",
5382
5496
  "pointer-events": "none"
5383
- }, null, 8, Ir),
5497
+ }, null, 8, Br),
5384
5498
  a("path", {
5385
- d: cn(t),
5499
+ d: un(t),
5386
5500
  fill: "none",
5387
5501
  stroke: "rgba(0,0,0,0.01)",
5388
5502
  "stroke-width": Math.max(t.style.lineWidth * 3, 12),
5389
5503
  "pointer-events": "auto",
5390
5504
  style: { cursor: "move" },
5391
- onMousedown: k((e) => _n(t, e), ["stop"])
5392
- }, null, 40, Lr),
5393
- J.value === t.id ? (g(), i("circle", {
5505
+ onMousedown: k((e) => yn(t, e), ["stop"])
5506
+ }, null, 40, Vr),
5507
+ Y.value === t.id ? (g(), i("circle", {
5394
5508
  key: 0,
5395
5509
  cx: t.startX,
5396
5510
  cy: t.startY,
@@ -5398,9 +5512,9 @@ var pr = { class: "editor-main" }, mr = { class: "panel-toggle-icon" }, hr = { c
5398
5512
  fill: "#409EFF",
5399
5513
  "pointer-events": "auto",
5400
5514
  style: { cursor: "move" },
5401
- onMousedown: k((e) => mn(t, "start", e), ["stop"])
5402
- }, null, 40, Rr)) : r("", !0),
5403
- J.value === t.id ? (g(), i("circle", {
5515
+ onMousedown: k((e) => gn(t, "start", e), ["stop"])
5516
+ }, null, 40, Hr)) : r("", !0),
5517
+ Y.value === t.id ? (g(), i("circle", {
5404
5518
  key: 1,
5405
5519
  cx: t.endX,
5406
5520
  cy: t.endY,
@@ -5408,23 +5522,23 @@ var pr = { class: "editor-main" }, mr = { class: "panel-toggle-icon" }, hr = { c
5408
5522
  fill: "#409EFF",
5409
5523
  "pointer-events": "auto",
5410
5524
  style: { cursor: "move" },
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 }, [
5525
+ onMousedown: k((e) => gn(t, "end", e), ["stop"])
5526
+ }, null, 40, Ur)) : r("", !0),
5527
+ Y.value === t.id ? (g(), i(e, { key: 2 }, [
5414
5528
  a("circle", {
5415
5529
  cx: t.startX,
5416
5530
  cy: t.startY,
5417
5531
  r: "4",
5418
5532
  fill: "#409EFF",
5419
5533
  "pointer-events": "none"
5420
- }, null, 8, Br),
5534
+ }, null, 8, Wr),
5421
5535
  a("circle", {
5422
5536
  cx: t.endX,
5423
5537
  cy: t.endY,
5424
5538
  r: "4",
5425
5539
  fill: "#409EFF",
5426
5540
  "pointer-events": "none"
5427
- }, null, 8, Vr),
5541
+ }, null, 8, Gr),
5428
5542
  t.style.lineType === "curve" ? (g(), i(e, { key: 0 }, [
5429
5543
  a("line", {
5430
5544
  x1: (t.startX + t.endX) / 2,
@@ -5436,7 +5550,7 @@ var pr = { class: "editor-main" }, mr = { class: "panel-toggle-icon" }, hr = { c
5436
5550
  "stroke-dasharray": "4,3",
5437
5551
  opacity: "0.5",
5438
5552
  "pointer-events": "none"
5439
- }, null, 8, Hr),
5553
+ }, null, 8, Kr),
5440
5554
  a("line", {
5441
5555
  x1: t.startX,
5442
5556
  y1: t.startY,
@@ -5447,7 +5561,7 @@ var pr = { class: "editor-main" }, mr = { class: "panel-toggle-icon" }, hr = { c
5447
5561
  "stroke-dasharray": "4,3",
5448
5562
  opacity: "0.3",
5449
5563
  "pointer-events": "none"
5450
- }, null, 8, Ur),
5564
+ }, null, 8, qr),
5451
5565
  a("line", {
5452
5566
  x1: t.endX,
5453
5567
  y1: t.endY,
@@ -5458,7 +5572,7 @@ var pr = { class: "editor-main" }, mr = { class: "panel-toggle-icon" }, hr = { c
5458
5572
  "stroke-dasharray": "4,3",
5459
5573
  opacity: "0.3",
5460
5574
  "pointer-events": "none"
5461
- }, null, 8, Wr),
5575
+ }, null, 8, Jr),
5462
5576
  a("circle", {
5463
5577
  cx: t.cpX,
5464
5578
  cy: t.cpY,
@@ -5467,13 +5581,13 @@ var pr = { class: "editor-main" }, mr = { class: "panel-toggle-icon" }, hr = { c
5467
5581
  stroke: "white",
5468
5582
  "stroke-width": "2",
5469
5583
  style: { cursor: "grab" },
5470
- onMousedown: k((e) => vn(t, e), ["stop"])
5471
- }, null, 40, Gr)
5584
+ onMousedown: k((e) => bn(t, e), ["stop"])
5585
+ }, null, 40, Yr)
5472
5586
  ], 64)) : r("", !0),
5473
5587
  a("g", {
5474
5588
  transform: `translate(${(t.startX + t.endX) / 2}, ${(t.startY + t.endY) / 2 - 16})`,
5475
5589
  style: { cursor: "pointer" },
5476
- onClick: k((e) => sn(t.id), ["stop"])
5590
+ onClick: k((e) => ln(t.id), ["stop"])
5477
5591
  }, [...n[66] ||= [
5478
5592
  a("circle", {
5479
5593
  r: "9",
@@ -5498,17 +5612,17 @@ var pr = { class: "editor-main" }, mr = { class: "panel-toggle-icon" }, hr = { c
5498
5612
  "stroke-width": "2",
5499
5613
  "stroke-linecap": "round"
5500
5614
  }, null, -1)
5501
- ]], 8, Kr)
5615
+ ]], 8, Xr)
5502
5616
  ], 64)) : r("", !0)
5503
5617
  ]))), 128))
5504
- ], 8, Dr))
5618
+ ], 8, jr))
5505
5619
  ], 36)], 544),
5506
- a("div", { class: d(["side-panel right-panel", { collapsed: !Ft.value }]) }, [a("div", {
5620
+ a("div", { class: d(["side-panel right-panel", { collapsed: !It.value }]) }, [a("div", {
5507
5621
  class: "panel-header",
5508
- onClick: n[6] ||= (e) => Ft.value = !Ft.value,
5622
+ onClick: n[6] ||= (e) => It.value = !It.value,
5509
5623
  style: { cursor: "pointer" }
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, {
5624
+ }, [a("h4", null, x(It.value ? S(L) === "title" ? "标题设置" : Z.value ? "文本框设置" : X.value ? "箭头线设置" : S(L) ? "节点详情" : "属性面板" : ""), 1)]), D(a("div", Zr, [
5625
+ S(I) ? (g(), i(e, { key: 0 }, [S(L) === "title" ? (g(), i("div", Qr, [s(te, {
5512
5626
  "label-position": "top",
5513
5627
  size: "small"
5514
5628
  }, {
@@ -5618,7 +5732,7 @@ var pr = { class: "editor-main" }, mr = { class: "panel-toggle-icon" }, hr = { c
5618
5732
  })
5619
5733
  ]),
5620
5734
  _: 1
5621
- })])) : (g(), i("div", Yr, [s(te, {
5735
+ })])) : (g(), i("div", $r, [s(te, {
5622
5736
  "label-position": "top",
5623
5737
  size: "small"
5624
5738
  }, {
@@ -5630,7 +5744,7 @@ var pr = { class: "editor-main" }, mr = { class: "panel-toggle-icon" }, hr = { c
5630
5744
  onInput: n[14] ||= (e) => S(L) === "category" ? S(I).name = e.target.value : S(I).text = e.target.value,
5631
5745
  onFocus: n[15] ||= (e) => e.target.select(),
5632
5746
  spellcheck: "false"
5633
- }, null, 40, Xr)]),
5747
+ }, null, 40, ei)]),
5634
5748
  _: 1
5635
5749
  }, 8, ["label"]),
5636
5750
  S(I).style ? (g(), i(e, { key: 0 }, [
@@ -5804,7 +5918,7 @@ var pr = { class: "editor-main" }, mr = { class: "panel-toggle-icon" }, hr = { c
5804
5918
  S(L) === "cause" ? (g(), i(e, { key: 1 }, [s(j, { "content-position": "left" }, {
5805
5919
  default: E(() => [...n[83] ||= [o("措施", -1)]]),
5806
5920
  _: 1
5807
- }), a("div", Zr, [(g(!0), i(e, null, y(S(I).children, (e) => (g(), i("div", {
5921
+ }), a("div", ti, [(g(!0), i(e, null, y(S(I).children, (e) => (g(), i("div", {
5808
5922
  key: e.id,
5809
5923
  class: "child-item"
5810
5924
  }, [s(u, {
@@ -5815,19 +5929,19 @@ var pr = { class: "editor-main" }, mr = { class: "panel-toggle-icon" }, hr = { c
5815
5929
  }, null, 8, ["modelValue", "onUpdate:modelValue"]), s(l, {
5816
5930
  size: "small",
5817
5931
  circle: "",
5818
- onClick: (t) => Gt(e.id)
5932
+ onClick: (t) => qt(e.id)
5819
5933
  }, {
5820
5934
  default: E(() => [s(c, null, {
5821
- default: E(() => [s(S(se))]),
5935
+ default: E(() => [s(S(ce))]),
5822
5936
  _: 1
5823
5937
  })]),
5824
5938
  _: 1
5825
5939
  }, 8, ["onClick"])]))), 128)), s(l, {
5826
5940
  size: "small",
5827
- onClick: Wt
5941
+ onClick: Kt
5828
5942
  }, {
5829
5943
  default: E(() => [s(c, null, {
5830
- default: E(() => [s(S(_e))]),
5944
+ default: E(() => [s(S(ge))]),
5831
5945
  _: 1
5832
5946
  }), n[84] ||= o(" 添加措施 ", -1)]),
5833
5947
  _: 1
@@ -5835,7 +5949,7 @@ var pr = { class: "editor-main" }, mr = { class: "panel-toggle-icon" }, hr = { c
5835
5949
  ]),
5836
5950
  _: 1
5837
5951
  })]))], 64)) : r("", !0),
5838
- Z.value ? (g(), i("div", Qr, [s(te, {
5952
+ Z.value ? (g(), i("div", ni, [s(te, {
5839
5953
  "label-position": "top",
5840
5954
  size: "small"
5841
5955
  }, {
@@ -5978,7 +6092,7 @@ var pr = { class: "editor-main" }, mr = { class: "panel-toggle-icon" }, hr = { c
5978
6092
  ]),
5979
6093
  _: 1
5980
6094
  })])) : r("", !0),
5981
- Y.value ? (g(), i("div", $r, [s(te, {
6095
+ X.value ? (g(), i("div", ri, [s(te, {
5982
6096
  "label-position": "top",
5983
6097
  size: "small"
5984
6098
  }, {
@@ -5989,15 +6103,15 @@ var pr = { class: "editor-main" }, mr = { class: "panel-toggle-icon" }, hr = { c
5989
6103
  }),
5990
6104
  s(p, { label: "线段颜色" }, {
5991
6105
  default: E(() => [s(T, {
5992
- modelValue: Y.value.style.lineColor,
5993
- "onUpdate:modelValue": n[47] ||= (e) => Y.value.style.lineColor = e
6106
+ modelValue: X.value.style.lineColor,
6107
+ "onUpdate:modelValue": n[47] ||= (e) => X.value.style.lineColor = e
5994
6108
  }, null, 8, ["modelValue"])]),
5995
6109
  _: 1
5996
6110
  }),
5997
6111
  s(p, { label: "线段粗细" }, {
5998
6112
  default: E(() => [s(v, {
5999
- modelValue: Y.value.style.lineWidth,
6000
- "onUpdate:modelValue": n[48] ||= (e) => Y.value.style.lineWidth = e,
6113
+ modelValue: X.value.style.lineWidth,
6114
+ "onUpdate:modelValue": n[48] ||= (e) => X.value.style.lineWidth = e,
6001
6115
  min: 1,
6002
6116
  max: 10,
6003
6117
  step: 1,
@@ -6007,8 +6121,8 @@ var pr = { class: "editor-main" }, mr = { class: "panel-toggle-icon" }, hr = { c
6007
6121
  }),
6008
6122
  s(p, { label: "线段样式" }, {
6009
6123
  default: E(() => [s(A, {
6010
- modelValue: Y.value.style.lineStyle,
6011
- "onUpdate:modelValue": n[49] ||= (e) => Y.value.style.lineStyle = e
6124
+ modelValue: X.value.style.lineStyle,
6125
+ "onUpdate:modelValue": n[49] ||= (e) => X.value.style.lineStyle = e
6012
6126
  }, {
6013
6127
  default: E(() => [s(O, { value: "solid" }, {
6014
6128
  default: E(() => [...n[90] ||= [o("实线", -1)]]),
@@ -6023,8 +6137,8 @@ var pr = { class: "editor-main" }, mr = { class: "panel-toggle-icon" }, hr = { c
6023
6137
  }),
6024
6138
  s(p, { label: "线段类型" }, {
6025
6139
  default: E(() => [s(A, {
6026
- modelValue: Y.value.style.lineType,
6027
- "onUpdate:modelValue": n[50] ||= (e) => Y.value.style.lineType = e
6140
+ modelValue: X.value.style.lineType,
6141
+ "onUpdate:modelValue": n[50] ||= (e) => X.value.style.lineType = e
6028
6142
  }, {
6029
6143
  default: E(() => [s(O, { value: "straight" }, {
6030
6144
  default: E(() => [...n[92] ||= [o("直线", -1)]]),
@@ -6039,14 +6153,14 @@ var pr = { class: "editor-main" }, mr = { class: "panel-toggle-icon" }, hr = { c
6039
6153
  }),
6040
6154
  s(p, { label: "箭头方向" }, {
6041
6155
  default: E(() => [s(M, {
6042
- modelValue: Y.value.style.arrowStart,
6043
- "onUpdate:modelValue": n[51] ||= (e) => Y.value.style.arrowStart = e
6156
+ modelValue: X.value.style.arrowStart,
6157
+ "onUpdate:modelValue": n[51] ||= (e) => X.value.style.arrowStart = e
6044
6158
  }, {
6045
6159
  default: E(() => [...n[94] ||= [o("起点箭头", -1)]]),
6046
6160
  _: 1
6047
6161
  }, 8, ["modelValue"]), s(M, {
6048
- modelValue: Y.value.style.arrowEnd,
6049
- "onUpdate:modelValue": n[52] ||= (e) => Y.value.style.arrowEnd = e
6162
+ modelValue: X.value.style.arrowEnd,
6163
+ "onUpdate:modelValue": n[52] ||= (e) => X.value.style.arrowEnd = e
6050
6164
  }, {
6051
6165
  default: E(() => [...n[95] ||= [o("终点箭头", -1)]]),
6052
6166
  _: 1
@@ -6058,53 +6172,53 @@ var pr = { class: "editor-main" }, mr = { class: "panel-toggle-icon" }, hr = { c
6058
6172
  _: 1
6059
6173
  }),
6060
6174
  s(p, { label: "起点连接" }, {
6061
- default: E(() => [Y.value.startConnectId ? (g(), i("div", ei, [s(ne, {
6175
+ default: E(() => [X.value.startConnectId ? (g(), i("div", ii, [s(ne, {
6062
6176
  size: "small",
6063
6177
  type: "success"
6064
6178
  }, {
6065
- default: E(() => [o(x(Y.value.startConnectType === "node" ? "节点" : "文本框"), 1)]),
6179
+ default: E(() => [o(x(X.value.startConnectType === "node" ? "节点" : "文本框"), 1)]),
6066
6180
  _: 1
6067
6181
  }), s(l, {
6068
6182
  size: "small",
6069
6183
  text: "",
6070
6184
  type: "danger",
6071
6185
  onClick: n[53] ||= (e) => {
6072
- Y.value.startConnectId = null, Y.value.startConnectType = null, Y.value.startAnchor = null;
6186
+ X.value.startConnectId = null, X.value.startConnectType = null, X.value.startAnchor = null;
6073
6187
  }
6074
6188
  }, {
6075
6189
  default: E(() => [...n[97] ||= [o("断开", -1)]]),
6076
6190
  _: 1
6077
- })])) : (g(), i("span", ti, "未连接(点击锚点连接)"))]),
6191
+ })])) : (g(), i("span", ai, "未连接(点击锚点连接)"))]),
6078
6192
  _: 1
6079
6193
  }),
6080
6194
  s(p, { label: "终点连接" }, {
6081
- default: E(() => [Y.value.endConnectId ? (g(), i("div", ni, [s(ne, {
6195
+ default: E(() => [X.value.endConnectId ? (g(), i("div", oi, [s(ne, {
6082
6196
  size: "small",
6083
6197
  type: "success"
6084
6198
  }, {
6085
- default: E(() => [o(x(Y.value.endConnectType === "node" ? "节点" : "文本框"), 1)]),
6199
+ default: E(() => [o(x(X.value.endConnectType === "node" ? "节点" : "文本框"), 1)]),
6086
6200
  _: 1
6087
6201
  }), s(l, {
6088
6202
  size: "small",
6089
6203
  text: "",
6090
6204
  type: "danger",
6091
6205
  onClick: n[54] ||= (e) => {
6092
- Y.value.endConnectId = null, Y.value.endConnectType = null, Y.value.endAnchor = null;
6206
+ X.value.endConnectId = null, X.value.endConnectType = null, X.value.endAnchor = null;
6093
6207
  }
6094
6208
  }, {
6095
6209
  default: E(() => [...n[98] ||= [o("断开", -1)]]),
6096
6210
  _: 1
6097
- })])) : (g(), i("span", ri, "未连接(点击锚点连接)"))]),
6211
+ })])) : (g(), i("span", si, "未连接(点击锚点连接)"))]),
6098
6212
  _: 1
6099
6213
  }),
6100
6214
  s(p, null, {
6101
6215
  default: E(() => [s(l, {
6102
6216
  type: "danger",
6103
6217
  size: "small",
6104
- onClick: n[55] ||= (e) => sn(Y.value.id)
6218
+ onClick: n[55] ||= (e) => ln(X.value.id)
6105
6219
  }, {
6106
6220
  default: E(() => [s(c, null, {
6107
- default: E(() => [s(S(se))]),
6221
+ default: E(() => [s(S(ce))]),
6108
6222
  _: 1
6109
6223
  }), n[99] ||= o(" 删除箭头线 ", -1)]),
6110
6224
  _: 1
@@ -6114,28 +6228,28 @@ var pr = { class: "editor-main" }, mr = { class: "panel-toggle-icon" }, hr = { c
6114
6228
  ]),
6115
6229
  _: 1
6116
6230
  })])) : r("", !0),
6117
- !S(I) && !Z.value && !Y.value ? (g(), i("div", ii, [s(c, {
6231
+ !S(I) && !Z.value && !X.value ? (g(), i("div", ci, [s(c, {
6118
6232
  size: 48,
6119
6233
  color: "#c0c4cc"
6120
6234
  }, {
6121
6235
  default: E(() => [s(S(ue))]),
6122
6236
  _: 1
6123
6237
  }), n[100] ||= a("p", null, "点击节点或标题进行编辑", -1)])) : r("", !0)
6124
- ], 512), [[w, Ft.value]])], 2)
6238
+ ], 512), [[w, It.value]])], 2)
6125
6239
  ]),
6126
6240
  s(N, {
6127
- modelValue: Sn.value,
6128
- "onUpdate:modelValue": n[59] ||= (e) => Sn.value = e,
6241
+ modelValue: wn.value,
6242
+ "onUpdate:modelValue": n[59] ||= (e) => wn.value = e,
6129
6243
  title: "添加子节点",
6130
6244
  width: "400px",
6131
6245
  "close-on-click-modal": !1
6132
6246
  }, {
6133
- footer: E(() => [s(l, { onClick: n[58] ||= (e) => Sn.value = !1 }, {
6247
+ footer: E(() => [s(l, { onClick: n[58] ||= (e) => wn.value = !1 }, {
6134
6248
  default: E(() => [...n[102] ||= [o("取消", -1)]]),
6135
6249
  _: 1
6136
6250
  }), s(l, {
6137
6251
  type: "primary",
6138
- onClick: En
6252
+ onClick: On
6139
6253
  }, {
6140
6254
  default: E(() => [...n[103] ||= [o("确定", -1)]]),
6141
6255
  _: 1
@@ -6147,28 +6261,28 @@ var pr = { class: "editor-main" }, mr = { class: "panel-toggle-icon" }, hr = { c
6147
6261
  default: E(() => [s(p, { label: "子节点名称" }, {
6148
6262
  default: E(() => [D(a("input", {
6149
6263
  class: "node-name-input",
6150
- "onUpdate:modelValue": n[56] ||= (e) => Cn.value.text = e,
6264
+ "onUpdate:modelValue": n[56] ||= (e) => Tn.value.text = e,
6151
6265
  placeholder: "请输入名称"
6152
- }, null, 512), [[C, Cn.value.text]])]),
6266
+ }, null, 512), [[C, Tn.value.text]])]),
6153
6267
  _: 1
6154
6268
  }), s(p, { label: "添加方向" }, {
6155
6269
  default: E(() => [D(a("select", {
6156
6270
  class: "node-font-select",
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]])]),
6271
+ "onUpdate:modelValue": n[57] ||= (e) => Tn.value.direction = e
6272
+ }, [...n[101] ||= [a("option", { value: "left" }, "左侧", -1), a("option", { value: "right" }, "右侧", -1)]], 512), [[ee, Tn.value.direction]])]),
6159
6273
  _: 1
6160
6274
  })]),
6161
6275
  _: 1
6162
6276
  })]),
6163
6277
  _: 1
6164
6278
  }, 8, ["modelValue"]),
6165
- s(ar, {
6166
- modelValue: vt.value,
6167
- "onUpdate:modelValue": n[60] ||= (e) => vt.value = e,
6168
- "svg-element": yt.value,
6279
+ s(lr, {
6280
+ modelValue: yt.value,
6281
+ "onUpdate:modelValue": n[60] ||= (e) => yt.value = e,
6282
+ "svg-element": bt.value,
6169
6283
  "fishbone-data": S(F),
6170
- "initial-format": bt.value,
6171
- onExported: Mn
6284
+ "initial-format": xt.value,
6285
+ onExported: Pn
6172
6286
  }, null, 8, [
6173
6287
  "modelValue",
6174
6288
  "svg-element",
@@ -6184,24 +6298,24 @@ var pr = { class: "editor-main" }, mr = { class: "panel-toggle-icon" }, hr = { c
6184
6298
  title: "AI助手"
6185
6299
  }, {
6186
6300
  default: E(() => [s(c, null, {
6187
- default: E(() => [s(S(me))]),
6301
+ default: E(() => [s(S(R))]),
6188
6302
  _: 1
6189
6303
  })]),
6190
6304
  _: 1
6191
6305
  }, 8, ["type"]),
6192
- s(Be, {
6306
+ s(ze, {
6193
6307
  visible: re.value,
6194
6308
  messages: S(P).messages.value,
6195
6309
  loading: S(P).loading.value,
6196
6310
  "is-collab": S(P).isCollabMode.value,
6197
6311
  "collab-users": S(P).collabUsers.value,
6198
6312
  "current-user": S(P).currentUser.value,
6199
- "is-owner": at.value,
6200
- onSend: Ln,
6313
+ "is-owner": ot.value,
6314
+ onSend: Rn,
6201
6315
  onClose: n[62] ||= (e) => re.value = !1,
6202
6316
  "unread-mention": S(P).unreadMention.value,
6203
6317
  onClearUnread: n[63] ||= (e) => S(P).clearUnreadMention(),
6204
- onClear: Rn
6318
+ onClear: zn
6205
6319
  }, null, 8, [
6206
6320
  "visible",
6207
6321
  "messages",
@@ -6212,16 +6326,16 @@ var pr = { class: "editor-main" }, mr = { class: "panel-toggle-icon" }, hr = { c
6212
6326
  "is-owner",
6213
6327
  "unread-mention"
6214
6328
  ]),
6215
- s(nt, {
6329
+ s(at, {
6216
6330
  modelValue: ie.value,
6217
6331
  "onUpdate:modelValue": n[64] ||= (e) => ie.value = e,
6218
6332
  "document-id": S(F).id,
6219
- onApply: Bn
6333
+ onApply: Vn
6220
6334
  }, null, 8, ["modelValue", "document-id"])
6221
6335
  ], 2);
6222
6336
  };
6223
6337
  }
6224
- }, [["__scopeId", "data-v-f4ad3ba7"]]), si = c({
6338
+ }, [["__scopeId", "data-v-5fb43dea"]]), di = c({
6225
6339
  name: "YourCompanyFishbone",
6226
6340
  props: {
6227
6341
  docId: {
@@ -6259,14 +6373,18 @@ var pr = { class: "editor-main" }, mr = { class: "panel-toggle-icon" }, hr = { c
6259
6373
  uiConfig: {
6260
6374
  type: Object,
6261
6375
  default: () => ({})
6376
+ },
6377
+ aiApi: {
6378
+ type: [String, Object],
6379
+ default: null
6262
6380
  }
6263
6381
  },
6264
6382
  setup(e, { slots: t }) {
6265
6383
  return () => l("div", {
6266
6384
  class: "yourcompany-fishbone-wrapper",
6267
6385
  style: "position:relative"
6268
- }, [l(oi, { ...e }), l(A)]);
6386
+ }, [l(ui, { ...e }), l(A)]);
6269
6387
  }
6270
6388
  });
6271
6389
  //#endregion
6272
- export { si as default };
6390
+ export { di as default };