flow-mindmap 0.3.4 → 0.3.6

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,4 +1,4 @@
1
- import { defineComponent as Kn, openBlock as C, createElementBlock as T, Fragment as J, createElementVNode as h, createStaticVNode as Re, createCommentVNode as ge, ref as oe, reactive as Un, onMounted as st, onBeforeUnmount as En, computed as we, withModifiers as Z, normalizeStyle as Pe, createVNode as ne, toDisplayString as Ie, normalizeClass as $e, watch as Ln, nextTick as xe, unref as K, renderList as vn, withDirectives as $t, vModelText as Pt, withKeys as Dn, createBlock as Ut } from "vue";
1
+ import { defineComponent as Kn, openBlock as C, createElementBlock as T, Fragment as J, createElementVNode as h, createStaticVNode as Re, createCommentVNode as ge, ref as oe, reactive as Un, onMounted as st, onBeforeUnmount as En, computed as ke, withModifiers as Z, normalizeStyle as Fe, createVNode as ne, toDisplayString as Ie, normalizeClass as $e, watch as Ln, nextTick as xe, unref as K, renderList as vn, withDirectives as $t, vModelText as Pt, withKeys as Dn, createBlock as Ut } from "vue";
2
2
  const Eo = ["width", "height", "stroke-width"], xo = {
3
3
  key: 4,
4
4
  points: "6 9 12 15 18 9"
@@ -285,25 +285,25 @@ function Po(e, r, n) {
285
285
  return Math.min(n, Math.max(r, e));
286
286
  }
287
287
  function Uo(e, r, n, o, a) {
288
- const d = Yn(r), s = ut(r, n), l = Math.min(Io(e.text || "", s, No[d]), $o), c = Ao(r, n), f = Math.ceil(l + c * 2), b = !!(e.richContent && (e.richContent.kind === "code" || e.richContent.kind === "table")) ? Math.ceil(s * 1.2) + 6 : Ro(r, n);
288
+ const d = Yn(r), s = ut(r, n), l = Math.min(Io(e.text || "", s, No[d]), $o), c = Ao(r, n), g = Math.ceil(l + c * 2), b = !!(e.richContent && (e.richContent.kind === "code" || e.richContent.kind === "table")) ? Math.ceil(s * 1.2) + 6 : Ro(r, n);
289
289
  let x = 0;
290
290
  if (e.link && (x += Wt), e.note && (x += Wt), x > 0) {
291
- const z = (e.link ? 1 : 0) + (e.note ? 1 : 0);
292
- x += zo * z;
291
+ const B = (e.link ? 1 : 0) + (e.note ? 1 : 0);
292
+ x += zo * B;
293
293
  }
294
- const p = f + x, g = (() => {
295
- const z = Math.round(Mo[d] * n / 14);
294
+ const p = g + x, f = (() => {
295
+ const B = Math.round(Mo[d] * n / 14);
296
296
  if (e.richContent && (e.richContent.kind === "code" || e.richContent.kind === "table")) {
297
297
  const re = a == null ? void 0 : a[e.id];
298
- return Math.max(z, re ?? 240);
298
+ return Math.max(B, re ?? 240);
299
299
  }
300
- return z;
301
- })(), L = !!(e.richContent && (e.richContent.kind === "code" || e.richContent.kind === "table")), M = o == null ? void 0 : o[e.id], w = L ? Math.max(24, M ?? Math.max(70, Math.ceil(s * 5))) : 0, Y = w > 0 ? 10 : 0;
300
+ return B;
301
+ })(), k = !!(e.richContent && (e.richContent.kind === "code" || e.richContent.kind === "table")), z = o == null ? void 0 : o[e.id], _ = k ? Math.max(24, z ?? Math.max(70, Math.ceil(s * 5))) : 0, Y = _ > 0 ? 10 : 0;
302
302
  if (!e.image) {
303
- const z = Math.max(g, p), re = Math.ceil(b + Y + w);
304
- return { w: z, h: re };
303
+ const B = Math.max(f, p), re = Math.ceil(b + Y + _);
304
+ return { w: B, h: re };
305
305
  }
306
- const D = Po(e.image.width, Lo, Do), H = Math.max(g, p, Math.ceil(D + c * 2)), P = Math.ceil(e.image.height + Bo + b + Y + w);
306
+ const D = Po(e.image.width, Lo, Do), H = Math.max(f, p, Math.ceil(D + c * 2)), P = Math.ceil(e.image.height + Bo + b + Y + _);
307
307
  return { w: H, h: P };
308
308
  }
309
309
  function Ho(e, r = {}) {
@@ -317,11 +317,11 @@ function Wo(e, r, n = !1) {
317
317
  o[0]._dir = "right", o[0].side = 1, o[0]._dirRight = 1;
318
318
  else {
319
319
  const l = o.reduce((b, x) => b + x._subtreeH, 0);
320
- let c = 1, f = Math.abs(o[0]._subtreeH - (l - o[0]._subtreeH)), E = 0;
320
+ let c = 1, g = Math.abs(o[0]._subtreeH - (l - o[0]._subtreeH)), E = 0;
321
321
  for (let b = 0; b < o.length - 1; b++) {
322
322
  E += o[b]._subtreeH;
323
323
  const x = Math.abs(E - (l - E));
324
- x < f && (f = x, c = b + 1);
324
+ x < g && (g = x, c = b + 1);
325
325
  }
326
326
  for (let b = 0; b < c; b++)
327
327
  o[b]._dir = "right", o[b].side = 1, o[b]._dirRight = 1;
@@ -329,8 +329,8 @@ function Wo(e, r, n = !1) {
329
329
  o[b]._dir = "left", o[b].side = -1, o[b]._dirRight = -1;
330
330
  }
331
331
  const a = e.children.filter((l) => l.side === 1), d = e.children.filter((l) => l.side === -1), s = (l, c) => {
332
- const f = c === "right" ? 1 : -1;
333
- l._dir = c, l.side = f, l._dirRight = f;
332
+ const g = c === "right" ? 1 : -1;
333
+ l._dir = c, l.side = g, l._dirRight = g;
334
334
  for (const E of l.children) s(E, c);
335
335
  };
336
336
  for (const l of a) s(l, "right");
@@ -358,12 +358,12 @@ function Wo(e, r, n = !1) {
358
358
  function Hn(e, r, n, o, a = !1) {
359
359
  if (e.children.length === 0) return;
360
360
  const d = e.children.reduce(
361
- (f, E, b) => f + E._subtreeH + (b > 0 ? ln : 0),
361
+ (g, E, b) => g + E._subtreeH + (b > 0 ? ln : 0),
362
362
  0
363
363
  ), s = r === "right" ? 1 : -1, l = o ? s : 1;
364
364
  let c = e.y - l * d / 2;
365
- e.children.forEach((f) => {
366
- a || (f.x = e.x + s * (e.width / 2 + n + f.width / 2), f.y = c + l * f._subtreeH / 2), f._dir = r, c += l * (f._subtreeH + ln), Hn(f, r, n, !1, a);
365
+ e.children.forEach((g) => {
366
+ a || (g.x = e.x + s * (e.width / 2 + n + g.width / 2), g.y = c + l * g._subtreeH / 2), g._dir = r, c += l * (g._subtreeH + ln), Hn(g, r, n, !1, a);
367
367
  });
368
368
  }
369
369
  function di(e, r, n = !1) {
@@ -378,7 +378,7 @@ function di(e, r, n = !1) {
378
378
  });
379
379
  }
380
380
  function fi(e, r, n, o, a, d, s, l) {
381
- const c = Uo(e, r, d, s, l), f = {
381
+ const c = Uo(e, r, d, s, l), g = {
382
382
  id: e.id,
383
383
  text: e.text,
384
384
  depth: r,
@@ -404,12 +404,12 @@ function fi(e, r, n, o, a, d, s, l) {
404
404
  children: [],
405
405
  parent: n
406
406
  };
407
- if (e.collapsed) return f;
407
+ if (e.collapsed) return g;
408
408
  const E = e.children.length, b = Math.ceil(E / 2);
409
- return f.children = e.children.map((x, p) => {
410
- const g = r === 0 ? p < b ? 1 : -1 : o;
411
- return fi(x, r + 1, f, g, a, d, s, l);
412
- }), f;
409
+ return g.children = e.children.map((x, p) => {
410
+ const f = r === 0 ? p < b ? 1 : -1 : o;
411
+ return fi(x, r + 1, g, f, a, d, s, l);
412
+ }), g;
413
413
  }
414
414
  function Fo(e) {
415
415
  const r = [e];
@@ -433,8 +433,8 @@ function Go(e, r = !1) {
433
433
  const n = [e];
434
434
  let o = 1 / 0, a = -1 / 0, d = 1 / 0, s = -1 / 0;
435
435
  for (; n.length; ) {
436
- const f = n.pop(), E = f.width / 2, b = f.height / 2;
437
- f.x - E < o && (o = f.x - E), f.x + E > a && (a = f.x + E), f.y - b < d && (d = f.y - b), f.y + b > s && (s = f.y + b), n.push(...f.children);
436
+ const g = n.pop(), E = g.width / 2, b = g.height / 2;
437
+ g.x - E < o && (o = g.x - E), g.x + E > a && (a = g.x + E), g.y - b < d && (d = g.y - b), g.y + b > s && (s = g.y + b), n.push(...g.children);
438
438
  }
439
439
  if (r)
440
440
  return {
@@ -448,8 +448,8 @@ function Go(e, r = !1) {
448
448
  };
449
449
  const l = Oe - d, c = [e];
450
450
  for (; c.length; ) {
451
- const f = c.pop();
452
- f.y += l, c.push(...f.children);
451
+ const g = c.pop();
452
+ g.y += l, c.push(...g.children);
453
453
  }
454
454
  return d += l, s += l, {
455
455
  root: e,
@@ -550,10 +550,10 @@ function V(e, r) {
550
550
  }
551
551
  return null;
552
552
  }
553
- function Ue(e, r, n = null) {
553
+ function Pe(e, r, n = null) {
554
554
  if (e.id === r) return n;
555
555
  for (const o of e.children) {
556
- const a = Ue(o, r, e);
556
+ const a = Pe(o, r, e);
557
557
  if (a !== null) return a;
558
558
  }
559
559
  return null;
@@ -571,18 +571,18 @@ function Yo(e, r, n) {
571
571
  return !o || o.text === n ? !1 : (o.text = n, !0);
572
572
  }
573
573
  function Zo(e, r, n, o) {
574
- if (!Ue(e, r) || r === n || V(V(e, r), n)) return !1;
575
- const a = Ue(e, r), d = a.children.findIndex((f) => f.id === r);
574
+ if (!Pe(e, r) || r === n || V(V(e, r), n)) return !1;
575
+ const a = Pe(e, r), d = a.children.findIndex((g) => g.id === r);
576
576
  if (d < 0) return !1;
577
577
  const [s] = a.children.splice(d, 1);
578
578
  if (o === "child") {
579
- const f = V(e, n);
580
- return f ? (f.children.push(s), !0) : (a.children.splice(d, 0, s), !1);
579
+ const g = V(e, n);
580
+ return g ? (g.children.push(s), !0) : (a.children.splice(d, 0, s), !1);
581
581
  }
582
- const l = Ue(e, n);
582
+ const l = Pe(e, n);
583
583
  if (!l)
584
584
  return a.children.splice(d, 0, s), !1;
585
- let c = l.children.findIndex((f) => f.id === n);
585
+ let c = l.children.findIndex((g) => g.id === n);
586
586
  return c < 0 ? (a.children.splice(d, 0, s), !1) : (o === "after" && (c += 1), l.children.splice(c, 0, s), !0);
587
587
  }
588
588
  function mi(e) {
@@ -606,7 +606,7 @@ function Xo(e, r, n) {
606
606
  return o.children.push(a), a;
607
607
  }
608
608
  function qo(e, r, n) {
609
- const o = Ue(e, r);
609
+ const o = Pe(e, r);
610
610
  if (!o) return null;
611
611
  const a = o.children.findIndex((s) => s.id === r);
612
612
  if (a < 0) return null;
@@ -614,7 +614,7 @@ function qo(e, r, n) {
614
614
  return o.children.splice(a + 1, 0, d), d;
615
615
  }
616
616
  function Vo(e, r, n) {
617
- const o = Ue(e, r);
617
+ const o = Pe(e, r);
618
618
  if (!o) return null;
619
619
  const a = o.children.findIndex((s) => s.id === r);
620
620
  if (a < 0) return null;
@@ -622,7 +622,7 @@ function Vo(e, r, n) {
622
622
  return o.children.splice(a, 0, d), d;
623
623
  }
624
624
  function Jo(e, r) {
625
- const n = Ue(e, r);
625
+ const n = Pe(e, r);
626
626
  if (!n) return null;
627
627
  const o = n.children.findIndex((s) => s.id === r);
628
628
  if (o < 0) return null;
@@ -635,73 +635,73 @@ function pi(e) {
635
635
  }
636
636
  const Wn = "新节点";
637
637
  function Ft(e, r = "导入的导图") {
638
- const n = e.split(/\r?\n/), o = { id: Ge(), text: r, children: [] }, a = [o], d = [-1 / 0], s = [], l = /^(#{1,6})\s+(.+?)\s*#*\s*$/, c = /^!\[([^\]]*)\]\((\S+?)(?:\s+"[^"]*")?\)\s*$/, f = /^\[([^\]]+)\]\((\S+?)(?:\s+"[^"]*")?\)\s*$/, E = /^(`{3,}|~{3,})\s*(\S+)?\s*$/;
638
+ const n = e.split(/\r?\n/), o = { id: Ge(), text: r, children: [] }, a = [o], d = [-1 / 0], s = [], l = /^(#{1,6})\s+(.+?)\s*#*\s*$/, c = /^!\[([^\]]*)\]\((\S+?)(?:\s+"[^"]*")?\)\s*$/, g = /^\[([^\]]+)\]\((\S+?)(?:\s+"[^"]*")?\)\s*$/, E = /^(`{3,}|~{3,})\s*(\S+)?\s*$/;
639
639
  let b = !1, x = [], p = null;
640
- function g(w) {
641
- x.push(w);
640
+ function f(_) {
641
+ x.push(_);
642
642
  }
643
- function L() {
643
+ function k() {
644
644
  if (p && x.length > 0) {
645
645
  for (; x.length > 0 && x[0].trim() === ""; ) x.shift();
646
646
  for (; x.length > 0 && x[x.length - 1].trim() === ""; ) x.pop();
647
- const w = x.join(`
647
+ const _ = x.join(`
648
648
  `);
649
- w && (p.note = { text: w });
649
+ _ && (p.note = { text: _ });
650
650
  }
651
651
  b = !1, x = [];
652
652
  }
653
- for (const w of n) {
653
+ for (const _ of n) {
654
654
  if (b) {
655
- const z = w.match(E);
656
- if (z && z[1][0] === "`") {
657
- L();
655
+ const B = _.match(E);
656
+ if (B && B[1][0] === "`") {
657
+ k();
658
658
  continue;
659
659
  }
660
- g(w);
660
+ f(_);
661
661
  continue;
662
662
  }
663
- const Y = w.match(l);
663
+ const Y = _.match(l);
664
664
  if (Y) {
665
- const z = Y[1].length, re = Y[2].trim();
666
- s.push({ level: z, text: re, body: "" }), p = s[s.length - 1];
665
+ const B = Y[1].length, re = Y[2].trim();
666
+ s.push({ level: B, text: re, body: "" }), p = s[s.length - 1];
667
667
  continue;
668
668
  }
669
- const D = w.match(E);
669
+ const D = _.match(E);
670
670
  if (D && D[2] === "note") {
671
671
  b = !0, x = [];
672
672
  continue;
673
673
  }
674
- const H = w.match(c);
674
+ const H = _.match(c);
675
675
  if (H && p) {
676
- const z = H[2], re = 160, se = 120;
677
- p.image = { src: z, naturalW: re, naturalH: se, width: re, height: se };
676
+ const B = H[2], re = 160, se = 120;
677
+ p.image = { src: B, naturalW: re, naturalH: se, width: re, height: se };
678
678
  continue;
679
679
  }
680
- const P = w.match(f);
680
+ const P = _.match(g);
681
681
  if (P && p) {
682
682
  p.link = { url: P[2] }, p.text = P[1];
683
683
  continue;
684
684
  }
685
- if (w.trim().length > 0 && p) {
686
- const z = w.trim();
685
+ if (_.trim().length > 0 && p) {
686
+ const B = _.trim();
687
687
  p.body = p.body ? p.body + `
688
- ` + z : z;
688
+ ` + B : B;
689
689
  }
690
690
  }
691
- b && L();
692
- function M(w) {
691
+ b && k();
692
+ function z(_) {
693
693
  for (; a.length > 1; ) {
694
- const P = a.length - 1, z = d[P];
695
- if (z !== void 0 && z < w.level) break;
694
+ const P = a.length - 1, B = d[P];
695
+ if (B !== void 0 && B < _.level) break;
696
696
  a.pop(), d.pop();
697
697
  }
698
- const Y = a[a.length - 1], D = w.text, H = { id: Ge(), text: D, children: [] };
699
- w.image && (H.image = { ...w.image }), w.link && (H.link = { url: w.link.url }), w.note && (H.note = { text: w.note.text }), w.body && (H.note = { text: w.body }), Y.children.push(H), a.push(H), d.push(w.level);
698
+ const Y = a[a.length - 1], D = _.text, H = { id: Ge(), text: D, children: [] };
699
+ _.image && (H.image = { ..._.image }), _.link && (H.link = { url: _.link.url }), _.note && (H.note = { text: _.note.text }), _.body && (H.note = { text: _.body }), Y.children.push(H), a.push(H), d.push(_.level);
700
700
  }
701
- for (const w of s) M(w);
701
+ for (const _ of s) z(_);
702
702
  if (s.length > 0 && s[0].level === 1) {
703
- const w = o.children[0];
704
- w && (o.text = w.text, o.id = w.id, w.image && (o.image = { ...w.image }), w.link && (o.link = { url: w.link.url }), w.note && (o.note = { text: w.note.text }), o.children = w.children);
703
+ const _ = o.children[0];
704
+ _ && (o.text = _.text, o.id = _.id, _.image && (o.image = { ..._.image }), _.link && (o.link = { url: _.link.url }), _.note && (o.note = { text: _.note.text }), o.children = _.children);
705
705
  }
706
706
  return o;
707
707
  }
@@ -716,7 +716,7 @@ function lt(e, r = 1) {
716
716
  return n;
717
717
  }
718
718
  function jo(e) {
719
- var f, E;
719
+ var g, E;
720
720
  const r = e.split(/\r?\n/), n = [];
721
721
  let o = 0;
722
722
  const a = /^(#{1,6})\s+(.+?)\s*#*\s*$/, d = /^(`{3,}|~{3,})\s*(\S+)?\s*$/, s = /^\s*\|?\s*(:?-+:?\s*\|\s*)+(:?-+:?)(\s*\|)?\s*$/, l = /^(\s*)[-*+]\s+(.*)$/, c = /^(\s*)\d+\.\s+(.*)$/;
@@ -732,12 +732,12 @@ function jo(e) {
732
732
  }
733
733
  P.push(r[o]), o++;
734
734
  }
735
- const z = P.slice(1, -1).join(`
735
+ const B = P.slice(1, -1).join(`
736
736
  `).trim();
737
737
  n.push({
738
738
  kind: "code",
739
- text: ((f = z.split(`
740
- `)[0]) == null ? void 0 : f.slice(0, 80)) || "(空代码块)",
739
+ text: ((g = B.split(`
740
+ `)[0]) == null ? void 0 : g.slice(0, 80)) || "(空代码块)",
741
741
  raw: P.join(`
742
742
  `),
743
743
  lang: H
@@ -764,16 +764,16 @@ function jo(e) {
764
764
  continue;
765
765
  }
766
766
  }
767
- const g = b.match(l), L = b.match(c);
768
- if (g || L) {
767
+ const f = b.match(l), k = b.match(c);
768
+ if (f || k) {
769
769
  let D = o;
770
770
  for (; D < r.length; ) {
771
771
  const H = r[D].match(l), P = r[D].match(c);
772
772
  if (!(H || P)) break;
773
- const z = r[D].replace(/^\s*[-*+]\s+/, "").replace(/^\s*\d+\.\s+/, "").trim();
774
- z.length > 0 && n.push({
773
+ const B = r[D].replace(/^\s*[-*+]\s+/, "").replace(/^\s*\d+\.\s+/, "").trim();
774
+ B.length > 0 && n.push({
775
775
  kind: "list",
776
- text: z.slice(0, 80) || "(列表项)",
776
+ text: B.slice(0, 80) || "(列表项)",
777
777
  raw: r[D]
778
778
  }), D++;
779
779
  }
@@ -784,20 +784,20 @@ function jo(e) {
784
784
  o++;
785
785
  continue;
786
786
  }
787
- const M = [b];
788
- let w = o + 1;
789
- for (; w < r.length; ) {
790
- const D = r[w];
787
+ const z = [b];
788
+ let _ = o + 1;
789
+ for (; _ < r.length; ) {
790
+ const D = r[_];
791
791
  if (D.trim() === "" || a.test(D) || d.test(D) || l.test(D) || c.test(D) || /^\s*\|/.test(D)) break;
792
- M.push(D), w++;
792
+ z.push(D), _++;
793
793
  }
794
- const Y = M.join(" ").trim();
794
+ const Y = z.join(" ").trim();
795
795
  n.push({
796
796
  kind: "paragraph",
797
797
  text: Y.slice(0, 80) || "(空段落)",
798
- raw: M.join(`
798
+ raw: z.join(`
799
799
  `)
800
- }), o = w;
800
+ }), o = _;
801
801
  }
802
802
  return n;
803
803
  }
@@ -817,13 +817,13 @@ function Ka(e, r = "导入的导图") {
817
817
  a[a.length - 1].children.push(b), a.push(b), d.push(E);
818
818
  return;
819
819
  }
820
- const f = {
820
+ const g = {
821
821
  id: Ge(),
822
822
  text: c.text,
823
823
  children: [],
824
824
  richContent: { kind: c.kind, raw: c.raw, lang: c.lang }
825
825
  };
826
- a[a.length - 1].children.push(f);
826
+ a[a.length - 1].children.push(g);
827
827
  }
828
828
  for (const c of n) l(c);
829
829
  return o;
@@ -838,22 +838,22 @@ function Qo(e) {
838
838
  y: 0,
839
839
  ox: 0,
840
840
  oy: 0
841
- }), f = oe(!1), E = Un({ x: 0, y: 0 }), b = Un({ x: 0, y: 0, width: 0, height: 0 }), x = oe(0);
841
+ }), g = oe(!1), E = Un({ x: 0, y: 0 }), b = Un({ x: 0, y: 0, width: 0, height: 0 }), x = oe(0);
842
842
  let p = null;
843
- function g(X) {
843
+ function f(X) {
844
844
  p = X;
845
845
  }
846
- function L(X) {
846
+ function k(X) {
847
847
  X.preventDefault();
848
848
  const ae = e.getContainer();
849
849
  if (!ae) return;
850
- const fe = -X.deltaY * 1e-3, ve = Math.min(n, Math.max(r, a.value * (1 + fe))), ue = ae.getBoundingClientRect(), ye = X.clientX - ue.left, y = X.clientY - ue.top, A = (ye - d.value) / a.value, S = (y - s.value) / a.value;
851
- a.value = ve, d.value = ye - A * ve, s.value = y - S * ve;
850
+ const fe = -X.deltaY * 1e-3, ve = Math.min(n, Math.max(r, a.value * (1 + fe))), ue = ae.getBoundingClientRect(), ye = X.clientX - ue.left, y = X.clientY - ue.top, A = (ye - d.value) / a.value, M = (y - s.value) / a.value;
851
+ a.value = ve, d.value = ye - A * ve, s.value = y - M * ve;
852
852
  }
853
- function M() {
853
+ function z() {
854
854
  a.value = Math.min(n, a.value * o);
855
855
  }
856
- function w() {
856
+ function _() {
857
857
  a.value = Math.max(r, a.value / o);
858
858
  }
859
859
  function Y(X) {
@@ -867,44 +867,44 @@ function Qo(e) {
867
867
  l.value = !1, window.removeEventListener("mousemove", D), window.removeEventListener("mouseup", H);
868
868
  }
869
869
  function P(X, ae) {
870
- f.value = !0, E.x = X, E.y = ae, b.x = X, b.y = ae, b.width = 0, b.height = 0, x.value++, window.addEventListener("mousemove", se), window.addEventListener("mouseup", re);
870
+ g.value = !0, E.x = X, E.y = ae, b.x = X, b.y = ae, b.width = 0, b.height = 0, x.value++, window.addEventListener("mousemove", se), window.addEventListener("mouseup", re);
871
871
  }
872
- function z(X, ae) {
873
- if (!f.value) return;
872
+ function B(X, ae) {
873
+ if (!g.value) return;
874
874
  const fe = Math.min(E.x, X), ve = Math.min(E.y, ae), ue = Math.max(E.x, X), ye = Math.max(E.y, ae);
875
875
  b.x = fe, b.y = ve, b.width = ue - fe, b.height = ye - ve, x.value++;
876
876
  }
877
877
  function re() {
878
- f.value = !1, window.removeEventListener("mousemove", se), window.removeEventListener("mouseup", re), p && p();
878
+ g.value = !1, window.removeEventListener("mousemove", se), window.removeEventListener("mouseup", re), p && p();
879
879
  }
880
880
  function se(X) {
881
- if (!f.value) return;
881
+ if (!g.value) return;
882
882
  const ae = e.getContainer();
883
883
  if (!ae) return;
884
884
  const fe = ae.getBoundingClientRect(), ve = (X.clientX - fe.left - d.value) / a.value, ue = (X.clientY - fe.top - s.value) / a.value;
885
- z(ve, ue);
885
+ B(ve, ue);
886
886
  }
887
887
  function me(X, ae, fe, ve = 60) {
888
888
  const ue = e.getContainer();
889
889
  if (!ue) return;
890
- const ye = ue.getBoundingClientRect(), y = (ye.width - ve * 2) / X, A = (ye.height - ve * 2) / ae, S = Math.min(1, Math.max(0.3, Math.min(y, A)));
891
- a.value = S, d.value = ye.width / 2, s.value = ye.height / 2 - fe * S;
890
+ const ye = ue.getBoundingClientRect(), y = (ye.width - ve * 2) / X, A = (ye.height - ve * 2) / ae, M = Math.min(1, Math.max(0.3, Math.min(y, A)));
891
+ a.value = M, d.value = ye.width / 2, s.value = ye.height / 2 - fe * M;
892
892
  }
893
893
  return {
894
894
  scale: a,
895
895
  offsetX: d,
896
896
  offsetY: s,
897
897
  isPanning: l,
898
- onWheel: L,
899
- zoomIn: M,
900
- zoomOut: w,
898
+ onWheel: k,
899
+ zoomIn: z,
900
+ zoomOut: _,
901
901
  startPan: Y,
902
902
  startMarquee: P,
903
- updateMarquee: z,
904
- isMarquee: f,
903
+ updateMarquee: B,
904
+ isMarquee: g,
905
905
  marquee: b,
906
906
  marqueeVersion: x,
907
- setOnMarqueeEnd: g,
907
+ setOnMarqueeEnd: f,
908
908
  resetView: me
909
909
  };
910
910
  }
@@ -962,8 +962,8 @@ function tr(e = 100) {
962
962
  function a() {
963
963
  return n < r.value.length - 1;
964
964
  }
965
- function d(f) {
966
- const E = JSON.stringify(f);
965
+ function d(g) {
966
+ const E = JSON.stringify(g);
967
967
  for (n < r.value.length - 1 && (r.value = r.value.slice(0, n + 1)), r.value.push(E), n = r.value.length - 1; r.value.length > e; )
968
968
  r.value.shift(), n--;
969
969
  }
@@ -999,39 +999,39 @@ const ir = /* @__PURE__ */ Kn({
999
999
  },
1000
1000
  emits: ["pickImage", "setLink", "removeLink", "editNote", "removeNote", "removeImage", "addCode", "editCode", "removeCode", "addTable", "editTable", "removeTable", "close"],
1001
1001
  setup(e, { emit: r }) {
1002
- const n = e, o = r, a = we(() => {
1002
+ const n = e, o = r, a = ke(() => {
1003
1003
  let x = n.x + 2, p = n.y + 2;
1004
1004
  if (n.container) {
1005
- const g = n.container.getBoundingClientRect(), L = 180, w = 4 + (3 + (n.hasImage ? 1 : 0) + (n.hasLink ? 1 : 0) + (n.hasNote ? 1 : 0) + 1 + (n.hasCode ? 1 : 0) + 1 + (n.hasTable ? 1 : 0)) * 28;
1006
- x + L > g.right && (x = Math.max(g.left + 4, n.x - L - 2)), p + w > g.bottom && (p = Math.max(g.top + 4, n.y - w - 2)), x < g.left + 2 && (x = g.left + 2), p < g.top + 2 && (p = g.top + 2);
1005
+ const f = n.container.getBoundingClientRect(), k = 180, _ = 4 + (3 + (n.hasImage ? 1 : 0) + (n.hasLink ? 1 : 0) + (n.hasNote ? 1 : 0) + 1 + (n.hasCode ? 1 : 0) + 1 + (n.hasTable ? 1 : 0)) * 28;
1006
+ x + k > f.right && (x = Math.max(f.left + 4, n.x - k - 2)), p + _ > f.bottom && (p = Math.max(f.top + 4, n.y - _ - 2)), x < f.left + 2 && (x = f.left + 2), p < f.top + 2 && (p = f.top + 2);
1007
1007
  }
1008
1008
  return { left: x, top: p };
1009
- }), d = we(() => n.hasImage), s = we(() => n.hasLink), l = we(() => n.hasNote);
1009
+ }), d = ke(() => n.hasImage), s = ke(() => n.hasLink), l = ke(() => n.hasNote);
1010
1010
  function c(x) {
1011
1011
  const p = x.target;
1012
1012
  p && p.closest(".zm-node-menu") || o("close");
1013
1013
  }
1014
- function f(x) {
1014
+ function g(x) {
1015
1015
  x.key === "Escape" && o("close");
1016
1016
  }
1017
1017
  function E() {
1018
1018
  o("close");
1019
1019
  }
1020
- window.addEventListener("mousedown", c, !0), window.addEventListener("keydown", f, !0), window.addEventListener("wheel", E, !0), window.addEventListener("scroll", E, !0), En(() => {
1021
- window.removeEventListener("mousedown", c, !0), window.removeEventListener("keydown", f, !0), window.removeEventListener("wheel", E, !0), window.removeEventListener("scroll", E, !0);
1020
+ window.addEventListener("mousedown", c, !0), window.addEventListener("keydown", g, !0), window.addEventListener("wheel", E, !0), window.addEventListener("scroll", E, !0), En(() => {
1021
+ window.removeEventListener("mousedown", c, !0), window.removeEventListener("keydown", g, !0), window.removeEventListener("wheel", E, !0), window.removeEventListener("scroll", E, !0);
1022
1022
  });
1023
1023
  function b(x) {
1024
1024
  x(), o("close");
1025
1025
  }
1026
1026
  return (x, p) => (C(), T("div", {
1027
1027
  class: "zm-node-menu",
1028
- style: Pe({ left: a.value.left + "px", top: a.value.top + "px" }),
1028
+ style: Fe({ left: a.value.left + "px", top: a.value.top + "px" }),
1029
1029
  onContextmenu: p[10] || (p[10] = Z(() => {
1030
1030
  }, ["prevent"]))
1031
1031
  }, [
1032
1032
  h("button", {
1033
1033
  class: "zm-node-menu-item",
1034
- onClick: p[0] || (p[0] = Z((g) => b(() => o("pickImage")), ["stop"]))
1034
+ onClick: p[0] || (p[0] = Z((f) => b(() => o("pickImage")), ["stop"]))
1035
1035
  }, [
1036
1036
  ne(te, {
1037
1037
  name: "image",
@@ -1042,7 +1042,7 @@ const ir = /* @__PURE__ */ Kn({
1042
1042
  d.value ? (C(), T("button", {
1043
1043
  key: 0,
1044
1044
  class: "zm-node-menu-item",
1045
- onClick: p[1] || (p[1] = Z((g) => b(() => o("removeImage")), ["stop"]))
1045
+ onClick: p[1] || (p[1] = Z((f) => b(() => o("removeImage")), ["stop"]))
1046
1046
  }, [
1047
1047
  ne(te, {
1048
1048
  name: "x",
@@ -1052,7 +1052,7 @@ const ir = /* @__PURE__ */ Kn({
1052
1052
  ])) : ge("", !0),
1053
1053
  h("button", {
1054
1054
  class: "zm-node-menu-item",
1055
- onClick: p[2] || (p[2] = Z((g) => b(() => o("setLink")), ["stop"]))
1055
+ onClick: p[2] || (p[2] = Z((f) => b(() => o("setLink")), ["stop"]))
1056
1056
  }, [
1057
1057
  ne(te, {
1058
1058
  name: "link",
@@ -1063,7 +1063,7 @@ const ir = /* @__PURE__ */ Kn({
1063
1063
  s.value ? (C(), T("button", {
1064
1064
  key: 1,
1065
1065
  class: "zm-node-menu-item",
1066
- onClick: p[3] || (p[3] = Z((g) => b(() => o("removeLink")), ["stop"]))
1066
+ onClick: p[3] || (p[3] = Z((f) => b(() => o("removeLink")), ["stop"]))
1067
1067
  }, [
1068
1068
  ne(te, {
1069
1069
  name: "x",
@@ -1073,7 +1073,7 @@ const ir = /* @__PURE__ */ Kn({
1073
1073
  ])) : ge("", !0),
1074
1074
  h("button", {
1075
1075
  class: "zm-node-menu-item",
1076
- onClick: p[4] || (p[4] = Z((g) => b(() => o("addCode")), ["stop"]))
1076
+ onClick: p[4] || (p[4] = Z((f) => b(() => o("addCode")), ["stop"]))
1077
1077
  }, [
1078
1078
  p[13] || (p[13] = h("span", {
1079
1079
  class: "zm-node-menu-icon zm-node-menu-icon-code",
@@ -1084,7 +1084,7 @@ const ir = /* @__PURE__ */ Kn({
1084
1084
  e.hasCode ? (C(), T("button", {
1085
1085
  key: 2,
1086
1086
  class: "zm-node-menu-item",
1087
- onClick: p[5] || (p[5] = Z((g) => b(() => o("removeCode")), ["stop"]))
1087
+ onClick: p[5] || (p[5] = Z((f) => b(() => o("removeCode")), ["stop"]))
1088
1088
  }, [
1089
1089
  ne(te, {
1090
1090
  name: "x",
@@ -1094,7 +1094,7 @@ const ir = /* @__PURE__ */ Kn({
1094
1094
  ])) : ge("", !0),
1095
1095
  h("button", {
1096
1096
  class: "zm-node-menu-item",
1097
- onClick: p[6] || (p[6] = Z((g) => b(() => o("addTable")), ["stop"]))
1097
+ onClick: p[6] || (p[6] = Z((f) => b(() => o("addTable")), ["stop"]))
1098
1098
  }, [
1099
1099
  p[15] || (p[15] = h("span", {
1100
1100
  class: "zm-node-menu-icon zm-node-menu-icon-table",
@@ -1105,7 +1105,7 @@ const ir = /* @__PURE__ */ Kn({
1105
1105
  e.hasTable ? (C(), T("button", {
1106
1106
  key: 3,
1107
1107
  class: "zm-node-menu-item",
1108
- onClick: p[7] || (p[7] = Z((g) => b(() => o("removeTable")), ["stop"]))
1108
+ onClick: p[7] || (p[7] = Z((f) => b(() => o("removeTable")), ["stop"]))
1109
1109
  }, [
1110
1110
  ne(te, {
1111
1111
  name: "x",
@@ -1115,7 +1115,7 @@ const ir = /* @__PURE__ */ Kn({
1115
1115
  ])) : ge("", !0),
1116
1116
  h("button", {
1117
1117
  class: "zm-node-menu-item",
1118
- onClick: p[8] || (p[8] = Z((g) => b(() => o("editNote")), ["stop"]))
1118
+ onClick: p[8] || (p[8] = Z((f) => b(() => o("editNote")), ["stop"]))
1119
1119
  }, [
1120
1120
  ne(te, {
1121
1121
  name: "note",
@@ -1126,7 +1126,7 @@ const ir = /* @__PURE__ */ Kn({
1126
1126
  l.value ? (C(), T("button", {
1127
1127
  key: 4,
1128
1128
  class: "zm-node-menu-item",
1129
- onClick: p[9] || (p[9] = Z((g) => b(() => o("removeNote")), ["stop"]))
1129
+ onClick: p[9] || (p[9] = Z((f) => b(() => o("removeNote")), ["stop"]))
1130
1130
  }, [
1131
1131
  ne(te, {
1132
1132
  name: "x",
@@ -1145,13 +1145,13 @@ const ir = /* @__PURE__ */ Kn({
1145
1145
  },
1146
1146
  emits: ["openSettings", "openData", "openImport", "close"],
1147
1147
  setup(e, { emit: r }) {
1148
- const n = e, o = r, a = we(() => {
1149
- let L = n.x + 2, M = n.y + 2;
1148
+ const n = e, o = r, a = ke(() => {
1149
+ let f = n.x + 2, k = n.y + 2;
1150
1150
  if (n.container) {
1151
- const w = n.container.getBoundingClientRect(), Y = 184, D = 4 + 3 * 28;
1152
- L + Y > w.right && (L = Math.max(w.left + 4, n.x - Y - 2)), M + D > w.bottom && (M = Math.max(w.top + 4, n.y - D - 2)), L < w.left + 2 && (L = w.left + 2), M < w.top + 2 && (M = w.top + 2);
1151
+ const z = n.container.getBoundingClientRect(), _ = 160, Y = 4 + 3 * 28;
1152
+ f + _ > z.right && (f = Math.max(z.left + 4, n.x - _ - 2)), k + Y > z.bottom && (k = Math.max(z.top + 4, n.y - Y - 2)), f < z.left + 2 && (f = z.left + 2), k < z.top + 2 && (k = z.top + 2);
1153
1153
  }
1154
- return { left: L, top: M };
1154
+ return { left: f, top: k };
1155
1155
  }), d = oe(!1);
1156
1156
  let s = null, l = null;
1157
1157
  function c() {
@@ -1159,7 +1159,7 @@ const ir = /* @__PURE__ */ Kn({
1159
1159
  d.value = !0;
1160
1160
  }, 60);
1161
1161
  }
1162
- function f() {
1162
+ function g() {
1163
1163
  s && (clearTimeout(s), s = null), l = setTimeout(() => {
1164
1164
  d.value = !1;
1165
1165
  }, 120);
@@ -1167,104 +1167,109 @@ const ir = /* @__PURE__ */ Kn({
1167
1167
  En(() => {
1168
1168
  s && clearTimeout(s), l && clearTimeout(l);
1169
1169
  });
1170
- const E = we(() => ({
1171
- left: a.value.left + 184 + 4 + "px",
1172
- top: a.value.top + 32 + "px"
1173
- }));
1174
- function b(L) {
1175
- const M = L.target;
1176
- M && M.closest(".zm-canvas-menu") || o("close");
1170
+ function E(f) {
1171
+ const k = f.target;
1172
+ k && k.closest(".zm-canvas-menu") || o("close");
1177
1173
  }
1178
- function x(L) {
1179
- L.key === "Escape" && o("close");
1174
+ function b(f) {
1175
+ f.key === "Escape" && o("close");
1180
1176
  }
1181
- function p() {
1177
+ function x() {
1182
1178
  o("close");
1183
1179
  }
1184
- window.addEventListener("mousedown", b, !0), window.addEventListener("keydown", x, !0), window.addEventListener("wheel", p, !0), window.addEventListener("scroll", p, !0), En(() => {
1185
- window.removeEventListener("mousedown", b, !0), window.removeEventListener("keydown", x, !0), window.removeEventListener("wheel", p, !0), window.removeEventListener("scroll", p, !0);
1180
+ window.addEventListener("mousedown", E, !0), window.addEventListener("keydown", b, !0), window.addEventListener("wheel", x, !0), window.addEventListener("scroll", x, !0), En(() => {
1181
+ window.removeEventListener("mousedown", E, !0), window.removeEventListener("keydown", b, !0), window.removeEventListener("wheel", x, !0), window.removeEventListener("scroll", x, !0);
1186
1182
  });
1187
- function g(L) {
1188
- L(), o("close");
1183
+ function p(f) {
1184
+ f(), o("close");
1189
1185
  }
1190
- return (L, M) => (C(), T("div", {
1186
+ return (f, k) => (C(), T("div", {
1191
1187
  class: "zm-canvas-menu",
1192
- style: Pe({ left: a.value.left + "px", top: a.value.top + "px" }),
1193
- onContextmenu: M[5] || (M[5] = Z(() => {
1188
+ style: Fe({ left: a.value.left + "px", top: a.value.top + "px" }),
1189
+ onContextmenu: k[5] || (k[5] = Z(() => {
1194
1190
  }, ["prevent"]))
1195
1191
  }, [
1196
1192
  h("button", {
1197
1193
  class: "zm-canvas-menu-item",
1198
- onClick: M[0] || (M[0] = Z((w) => g(() => o("openData")), ["stop"]))
1194
+ onClick: k[0] || (k[0] = Z((z) => p(() => o("openData")), ["stop"]))
1199
1195
  }, [
1200
1196
  ne(te, {
1201
1197
  name: "data",
1202
1198
  size: 13
1203
1199
  }),
1204
- M[6] || (M[6] = h("span", null, "查看数据", -1))
1200
+ k[6] || (k[6] = h("span", null, "查看数据", -1))
1205
1201
  ]),
1206
1202
  h("div", {
1207
1203
  class: $e(["zm-canvas-menu-item zm-canvas-menu-item-has-submenu", { "is-open": d.value }]),
1208
1204
  onMouseenter: c,
1209
- onMouseleave: f
1205
+ onMouseleave: g
1210
1206
  }, [
1211
1207
  ne(te, {
1212
1208
  name: "import",
1213
1209
  size: 13
1214
1210
  }),
1215
- M[10] || (M[10] = h("span", null, "导入", -1)),
1216
- M[11] || (M[11] = h("span", {
1211
+ k[10] || (k[10] = h("span", null, "导入", -1)),
1212
+ k[11] || (k[11] = h("svg", {
1217
1213
  class: "zm-canvas-menu-caret",
1214
+ width: "8",
1215
+ height: "8",
1216
+ viewBox: "0 0 8 8",
1217
+ fill: "none",
1218
+ stroke: "currentColor",
1219
+ "stroke-width": "1.4",
1220
+ "stroke-linecap": "round",
1221
+ "stroke-linejoin": "round",
1218
1222
  "aria-hidden": "true"
1219
- }, "›", -1)),
1223
+ }, [
1224
+ h("polyline", { points: "2.5 1.8 5.2 4 2.5 6.2" })
1225
+ ], -1)),
1220
1226
  d.value ? (C(), T("div", {
1221
1227
  key: 0,
1222
1228
  class: "zm-canvas-submenu",
1223
- style: Pe(E.value),
1224
1229
  onMouseenter: c,
1225
- onMouseleave: f
1230
+ onMouseleave: g
1226
1231
  }, [
1227
1232
  h("button", {
1228
1233
  class: "zm-canvas-menu-item",
1229
- onClick: M[1] || (M[1] = Z((w) => g(() => o("openImport", "markdown")), ["stop"]))
1234
+ onClick: k[1] || (k[1] = Z((z) => p(() => o("openImport", "markdown")), ["stop"]))
1230
1235
  }, [
1231
1236
  ne(te, {
1232
1237
  name: "markdown",
1233
1238
  size: 13
1234
1239
  }),
1235
- M[7] || (M[7] = h("span", null, "Markdown 导入", -1))
1240
+ k[7] || (k[7] = h("span", null, "Markdown 导入", -1))
1236
1241
  ]),
1237
1242
  h("button", {
1238
1243
  class: "zm-canvas-menu-item",
1239
- onClick: M[2] || (M[2] = Z((w) => g(() => o("openImport", "json")), ["stop"]))
1244
+ onClick: k[2] || (k[2] = Z((z) => p(() => o("openImport", "json")), ["stop"]))
1240
1245
  }, [
1241
1246
  ne(te, {
1242
1247
  name: "data",
1243
1248
  size: 13
1244
1249
  }),
1245
- M[8] || (M[8] = h("span", null, "JSON 文件导入", -1))
1250
+ k[8] || (k[8] = h("span", null, "JSON 文件导入", -1))
1246
1251
  ]),
1247
1252
  h("button", {
1248
1253
  class: "zm-canvas-menu-item",
1249
- onClick: M[3] || (M[3] = Z((w) => g(() => o("openImport", "txt")), ["stop"]))
1254
+ onClick: k[3] || (k[3] = Z((z) => p(() => o("openImport", "txt")), ["stop"]))
1250
1255
  }, [
1251
1256
  ne(te, {
1252
1257
  name: "note",
1253
1258
  size: 13
1254
1259
  }),
1255
- M[9] || (M[9] = h("span", null, "TXT 文件导入", -1))
1260
+ k[9] || (k[9] = h("span", null, "TXT 文件导入", -1))
1256
1261
  ])
1257
- ], 36)) : ge("", !0)
1262
+ ], 32)) : ge("", !0)
1258
1263
  ], 34),
1259
1264
  h("button", {
1260
1265
  class: "zm-canvas-menu-item",
1261
- onClick: M[4] || (M[4] = Z((w) => g(() => o("openSettings")), ["stop"]))
1266
+ onClick: k[4] || (k[4] = Z((z) => p(() => o("openSettings")), ["stop"]))
1262
1267
  }, [
1263
1268
  ne(te, {
1264
1269
  name: "settings",
1265
1270
  size: 13
1266
1271
  }),
1267
- M[12] || (M[12] = h("span", null, "设置", -1))
1272
+ k[12] || (k[12] = h("span", null, "设置", -1))
1268
1273
  ])
1269
1274
  ], 36));
1270
1275
  }
@@ -1820,8 +1825,8 @@ function Zr(e) {
1820
1825
  const c = this.matcherRe.exec(l);
1821
1826
  if (!c)
1822
1827
  return null;
1823
- const f = c.findIndex((b, x) => x > 0 && b !== void 0), E = this.matchIndexes[f];
1824
- return c.splice(0, f), Object.assign(c, E);
1828
+ const g = c.findIndex((b, x) => x > 0 && b !== void 0), E = this.matchIndexes[g];
1829
+ return c.splice(0, g), Object.assign(c, E);
1825
1830
  }
1826
1831
  }
1827
1832
  class o {
@@ -1832,7 +1837,7 @@ function Zr(e) {
1832
1837
  getMatcher(l) {
1833
1838
  if (this.multiRegexes[l]) return this.multiRegexes[l];
1834
1839
  const c = new n();
1835
- return this.rules.slice(l).forEach(([f, E]) => c.addRule(f, E)), c.compile(), this.multiRegexes[l] = c, c;
1840
+ return this.rules.slice(l).forEach(([g, E]) => c.addRule(g, E)), c.compile(), this.multiRegexes[l] = c, c;
1836
1841
  }
1837
1842
  resumingScanAtSamePosition() {
1838
1843
  return this.regexIndex !== 0;
@@ -1848,12 +1853,12 @@ function Zr(e) {
1848
1853
  exec(l) {
1849
1854
  const c = this.getMatcher(this.regexIndex);
1850
1855
  c.lastIndex = this.lastIndex;
1851
- let f = c.exec(l);
1852
- if (this.resumingScanAtSamePosition() && !(f && f.index === this.lastIndex)) {
1856
+ let g = c.exec(l);
1857
+ if (this.resumingScanAtSamePosition() && !(g && g.index === this.lastIndex)) {
1853
1858
  const E = this.getMatcher(0);
1854
- E.lastIndex = this.lastIndex + 1, f = E.exec(l);
1859
+ E.lastIndex = this.lastIndex + 1, g = E.exec(l);
1855
1860
  }
1856
- return f && (this.regexIndex += f.position + 1, this.regexIndex === this.count && this.considerAll()), f;
1861
+ return g && (this.regexIndex += g.position + 1, this.regexIndex === this.count && this.considerAll()), g;
1857
1862
  }
1858
1863
  }
1859
1864
  function a(s) {
@@ -1881,8 +1886,8 @@ function Zr(e) {
1881
1886
  // default to 1 relevance if not specified
1882
1887
  zr
1883
1888
  ].forEach((E) => E(s, l)), s.isCompiled = !0;
1884
- let f = null;
1885
- return typeof s.keywords == "object" && s.keywords.$pattern && (s.keywords = Object.assign({}, s.keywords), f = s.keywords.$pattern, delete s.keywords.$pattern), f = f || /\w+/, s.keywords && (s.keywords = _i(s.keywords, e.case_insensitive)), c.keywordPatternRe = r(f, !0), l && (s.begin || (s.begin = /\B|\b/), c.beginRe = r(c.begin), !s.end && !s.endsWithParent && (s.end = /\B|\b/), s.end && (c.endRe = r(c.end)), c.terminatorEnd = xn(c.end) || "", s.endsWithParent && l.terminatorEnd && (c.terminatorEnd += (s.end ? "|" : "") + l.terminatorEnd)), s.illegal && (c.illegalRe = r(
1889
+ let g = null;
1890
+ return typeof s.keywords == "object" && s.keywords.$pattern && (s.keywords = Object.assign({}, s.keywords), g = s.keywords.$pattern, delete s.keywords.$pattern), g = g || /\w+/, s.keywords && (s.keywords = _i(s.keywords, e.case_insensitive)), c.keywordPatternRe = r(g, !0), l && (s.begin || (s.begin = /\B|\b/), c.beginRe = r(c.begin), !s.end && !s.endsWithParent && (s.end = /\B|\b/), s.end && (c.endRe = r(c.end)), c.terminatorEnd = xn(c.end) || "", s.endsWithParent && l.terminatorEnd && (c.terminatorEnd += (s.end ? "|" : "") + l.terminatorEnd)), s.illegal && (c.illegalRe = r(
1886
1891
  /** @type {RegExp | string} */
1887
1892
  s.illegal
1888
1893
  )), s.contains || (s.contains = []), s.contains = [].concat(...s.contains.map(function(E) {
@@ -1935,43 +1940,43 @@ const rt = bi, Vt = Ze, Jt = Symbol("nomatch"), Jr = 7, Mi = function(e) {
1935
1940
  function c(y) {
1936
1941
  return l.noHighlightRe.test(y);
1937
1942
  }
1938
- function f(y) {
1943
+ function g(y) {
1939
1944
  let A = y.className + " ";
1940
1945
  A += y.parentNode ? y.parentNode.className : "";
1941
- const S = l.languageDetectRe.exec(A);
1942
- if (S) {
1943
- const R = se(S[1]);
1944
- return R || (qt(d.replace("{}", S[1])), qt("Falling back to no-highlight mode for this block.", y)), R ? S[1] : "no-highlight";
1946
+ const M = l.languageDetectRe.exec(A);
1947
+ if (M) {
1948
+ const R = se(M[1]);
1949
+ return R || (qt(d.replace("{}", M[1])), qt("Falling back to no-highlight mode for this block.", y)), R ? M[1] : "no-highlight";
1945
1950
  }
1946
1951
  return A.split(/\s+/).find((R) => c(R) || se(R));
1947
1952
  }
1948
- function E(y, A, S) {
1953
+ function E(y, A, M) {
1949
1954
  let R = "", F = "";
1950
- typeof A == "object" ? (R = y, S = A.ignoreIllegals, F = A.language) : (rn("10.7.0", "highlight(lang, code, ...args) has been deprecated."), rn("10.7.0", `Please use highlight(code, options) instead.
1951
- https://github.com/highlightjs/highlight.js/issues/2277`), F = y, R = A), S === void 0 && (S = !0);
1955
+ typeof A == "object" ? (R = y, M = A.ignoreIllegals, F = A.language) : (rn("10.7.0", "highlight(lang, code, ...args) has been deprecated."), rn("10.7.0", `Please use highlight(code, options) instead.
1956
+ https://github.com/highlightjs/highlight.js/issues/2277`), F = y, R = A), M === void 0 && (M = !0);
1952
1957
  const ce = {
1953
1958
  code: R,
1954
1959
  language: F
1955
1960
  };
1956
1961
  ue("before:highlight", ce);
1957
- const Ee = ce.result ? ce.result : b(ce.language, ce.code, S);
1962
+ const Ee = ce.result ? ce.result : b(ce.language, ce.code, M);
1958
1963
  return Ee.code = ce.code, ue("after:highlight", Ee), Ee;
1959
1964
  }
1960
- function b(y, A, S, R) {
1965
+ function b(y, A, M, R) {
1961
1966
  const F = /* @__PURE__ */ Object.create(null);
1962
- function ce(N, I) {
1963
- return N.keywords[I];
1967
+ function ce(S, I) {
1968
+ return S.keywords[I];
1964
1969
  }
1965
1970
  function Ee() {
1966
1971
  if (!$.keywords) {
1967
1972
  pe.addText(j);
1968
1973
  return;
1969
1974
  }
1970
- let N = 0;
1975
+ let S = 0;
1971
1976
  $.keywordPatternRe.lastIndex = 0;
1972
1977
  let I = $.keywordPatternRe.exec(j), W = "";
1973
1978
  for (; I; ) {
1974
- W += j.substring(N, I.index);
1979
+ W += j.substring(S, I.index);
1975
1980
  const Q = Te.case_insensitive ? I[0].toLowerCase() : I[0], he = ce($, Q);
1976
1981
  if (he) {
1977
1982
  const [Ne, De] = he;
@@ -1983,93 +1988,93 @@ https://github.com/highlightjs/highlight.js/issues/2277`), F = y, R = A), S ===
1983
1988
  }
1984
1989
  } else
1985
1990
  W += I[0];
1986
- N = $.keywordPatternRe.lastIndex, I = $.keywordPatternRe.exec(j);
1991
+ S = $.keywordPatternRe.lastIndex, I = $.keywordPatternRe.exec(j);
1987
1992
  }
1988
- W += j.substring(N), pe.addText(W);
1993
+ W += j.substring(S), pe.addText(W);
1989
1994
  }
1990
1995
  function Me() {
1991
1996
  if (j === "") return;
1992
- let N = null;
1997
+ let S = null;
1993
1998
  if (typeof $.subLanguage == "string") {
1994
1999
  if (!r[$.subLanguage]) {
1995
2000
  pe.addText(j);
1996
2001
  return;
1997
2002
  }
1998
- N = b($.subLanguage, j, !0, Mn[$.subLanguage]), Mn[$.subLanguage] = /** @type {CompiledMode} */
1999
- N._top;
2003
+ S = b($.subLanguage, j, !0, Mn[$.subLanguage]), Mn[$.subLanguage] = /** @type {CompiledMode} */
2004
+ S._top;
2000
2005
  } else
2001
- N = p(j, $.subLanguage.length ? $.subLanguage : null);
2002
- $.relevance > 0 && (Qe += N.relevance), pe.__addSublanguage(N._emitter, N.language);
2006
+ S = p(j, $.subLanguage.length ? $.subLanguage : null);
2007
+ $.relevance > 0 && (Qe += S.relevance), pe.__addSublanguage(S._emitter, S.language);
2003
2008
  }
2004
- function ke() {
2009
+ function we() {
2005
2010
  $.subLanguage != null ? Me() : Ee(), j = "";
2006
2011
  }
2007
- function Ce(N, I) {
2008
- N !== "" && (pe.startScope(I), pe.addText(N), pe.endScope());
2012
+ function Ce(S, I) {
2013
+ S !== "" && (pe.startScope(I), pe.addText(S), pe.endScope());
2009
2014
  }
2010
- function kn(N, I) {
2015
+ function kn(S, I) {
2011
2016
  let W = 1;
2012
2017
  const Q = I.length - 1;
2013
2018
  for (; W <= Q; ) {
2014
- if (!N._emit[W]) {
2019
+ if (!S._emit[W]) {
2015
2020
  W++;
2016
2021
  continue;
2017
2022
  }
2018
- const he = Te.classNameAliases[N[W]] || N[W], Ne = I[W];
2023
+ const he = Te.classNameAliases[S[W]] || S[W], Ne = I[W];
2019
2024
  he ? Ce(Ne, he) : (j = Ne, Ee(), j = ""), W++;
2020
2025
  }
2021
2026
  }
2022
- function _n(N, I) {
2023
- return N.scope && typeof N.scope == "string" && pe.openNode(Te.classNameAliases[N.scope] || N.scope), N.beginScope && (N.beginScope._wrap ? (Ce(j, Te.classNameAliases[N.beginScope._wrap] || N.beginScope._wrap), j = "") : N.beginScope._multi && (kn(N.beginScope, I), j = "")), $ = Object.create(N, { parent: { value: $ } }), $;
2027
+ function _n(S, I) {
2028
+ return S.scope && typeof S.scope == "string" && pe.openNode(Te.classNameAliases[S.scope] || S.scope), S.beginScope && (S.beginScope._wrap ? (Ce(j, Te.classNameAliases[S.beginScope._wrap] || S.beginScope._wrap), j = "") : S.beginScope._multi && (kn(S.beginScope, I), j = "")), $ = Object.create(S, { parent: { value: $ } }), $;
2024
2029
  }
2025
- function Nn(N, I, W) {
2026
- let Q = gr(N.endRe, W);
2030
+ function Nn(S, I, W) {
2031
+ let Q = gr(S.endRe, W);
2027
2032
  if (Q) {
2028
- if (N["on:end"]) {
2029
- const he = new Kt(N);
2030
- N["on:end"](I, he), he.isMatchIgnored && (Q = !1);
2033
+ if (S["on:end"]) {
2034
+ const he = new Kt(S);
2035
+ S["on:end"](I, he), he.isMatchIgnored && (Q = !1);
2031
2036
  }
2032
2037
  if (Q) {
2033
- for (; N.endsParent && N.parent; )
2034
- N = N.parent;
2035
- return N;
2038
+ for (; S.endsParent && S.parent; )
2039
+ S = S.parent;
2040
+ return S;
2036
2041
  }
2037
2042
  }
2038
- if (N.endsWithParent)
2039
- return Nn(N.parent, I, W);
2043
+ if (S.endsWithParent)
2044
+ return Nn(S.parent, I, W);
2040
2045
  }
2041
- function Xn(N) {
2042
- return $.matcher.regexIndex === 0 ? (j += N[0], 1) : (nn = !0, 0);
2046
+ function Xn(S) {
2047
+ return $.matcher.regexIndex === 0 ? (j += S[0], 1) : (nn = !0, 0);
2043
2048
  }
2044
- function qn(N) {
2045
- const I = N[0], W = N.rule, Q = new Kt(W), he = [W.__beforeBegin, W["on:begin"]];
2049
+ function qn(S) {
2050
+ const I = S[0], W = S.rule, Q = new Kt(W), he = [W.__beforeBegin, W["on:begin"]];
2046
2051
  for (const Ne of he)
2047
- if (Ne && (Ne(N, Q), Q.isMatchIgnored))
2052
+ if (Ne && (Ne(S, Q), Q.isMatchIgnored))
2048
2053
  return Xn(I);
2049
- return W.skip ? j += I : (W.excludeBegin && (j += I), ke(), !W.returnBegin && !W.excludeBegin && (j = I)), _n(W, N), W.returnBegin ? 0 : I.length;
2054
+ return W.skip ? j += I : (W.excludeBegin && (j += I), we(), !W.returnBegin && !W.excludeBegin && (j = I)), _n(W, S), W.returnBegin ? 0 : I.length;
2050
2055
  }
2051
- function Vn(N) {
2052
- const I = N[0], W = A.substring(N.index), Q = Nn($, N, W);
2056
+ function Vn(S) {
2057
+ const I = S[0], W = A.substring(S.index), Q = Nn($, S, W);
2053
2058
  if (!Q)
2054
2059
  return Jt;
2055
2060
  const he = $;
2056
- $.endScope && $.endScope._wrap ? (ke(), Ce(I, $.endScope._wrap)) : $.endScope && $.endScope._multi ? (ke(), kn($.endScope, N)) : he.skip ? j += I : (he.returnEnd || he.excludeEnd || (j += I), ke(), he.excludeEnd && (j = I));
2061
+ $.endScope && $.endScope._wrap ? (we(), Ce(I, $.endScope._wrap)) : $.endScope && $.endScope._multi ? (we(), kn($.endScope, S)) : he.skip ? j += I : (he.returnEnd || he.excludeEnd || (j += I), we(), he.excludeEnd && (j = I));
2057
2062
  do
2058
2063
  $.scope && pe.closeNode(), !$.skip && !$.subLanguage && (Qe += $.relevance), $ = $.parent;
2059
2064
  while ($ !== Q.parent);
2060
- return Q.starts && _n(Q.starts, N), he.returnEnd ? 0 : I.length;
2065
+ return Q.starts && _n(Q.starts, S), he.returnEnd ? 0 : I.length;
2061
2066
  }
2062
2067
  function Jn() {
2063
- const N = [];
2068
+ const S = [];
2064
2069
  for (let I = $; I !== Te; I = I.parent)
2065
- I.scope && N.unshift(I.scope);
2066
- N.forEach((I) => pe.openNode(I));
2070
+ I.scope && S.unshift(I.scope);
2071
+ S.forEach((I) => pe.openNode(I));
2067
2072
  }
2068
2073
  let je = {};
2069
- function un(N, I) {
2074
+ function un(S, I) {
2070
2075
  const W = I && I[0];
2071
- if (j += N, W == null)
2072
- return ke(), 0;
2076
+ if (j += S, W == null)
2077
+ return we(), 0;
2073
2078
  if (je.type === "begin" && I.type === "end" && je.index === I.index && W === "") {
2074
2079
  if (j += A.slice(I.index, I.index + 1), !a) {
2075
2080
  const Q = new Error(`0 width match regex (${y})`);
@@ -2079,7 +2084,7 @@ https://github.com/highlightjs/highlight.js/issues/2277`), F = y, R = A), S ===
2079
2084
  }
2080
2085
  if (je = I, I.type === "begin")
2081
2086
  return qn(I);
2082
- if (I.type === "illegal" && !S) {
2087
+ if (I.type === "illegal" && !M) {
2083
2088
  const Q = new Error('Illegal lexeme "' + W + '" for mode "' + ($.scope || "<unnamed>") + '"');
2084
2089
  throw Q.mode = $, Q;
2085
2090
  } else if (I.type === "end") {
@@ -2101,19 +2106,19 @@ https://github.com/highlightjs/highlight.js/issues/2277`), F = y, R = A), S ===
2101
2106
  let dn = "", $ = R || Sn;
2102
2107
  const Mn = {}, pe = new l.__emitter(l);
2103
2108
  Jn();
2104
- let j = "", Qe = 0, He = 0, en = 0, nn = !1;
2109
+ let j = "", Qe = 0, Ue = 0, en = 0, nn = !1;
2105
2110
  try {
2106
2111
  if (Te.__emitTokens)
2107
2112
  Te.__emitTokens(A, pe);
2108
2113
  else {
2109
2114
  for ($.matcher.considerAll(); ; ) {
2110
- en++, nn ? nn = !1 : $.matcher.considerAll(), $.matcher.lastIndex = He;
2111
- const N = $.matcher.exec(A);
2112
- if (!N) break;
2113
- const I = A.substring(He, N.index), W = un(I, N);
2114
- He = N.index + W;
2115
+ en++, nn ? nn = !1 : $.matcher.considerAll(), $.matcher.lastIndex = Ue;
2116
+ const S = $.matcher.exec(A);
2117
+ if (!S) break;
2118
+ const I = A.substring(Ue, S.index), W = un(I, S);
2119
+ Ue = S.index + W;
2115
2120
  }
2116
- un(A.substring(He));
2121
+ un(A.substring(Ue));
2117
2122
  }
2118
2123
  return pe.finalize(), dn = pe.toHTML(), {
2119
2124
  language: y,
@@ -2123,18 +2128,18 @@ https://github.com/highlightjs/highlight.js/issues/2277`), F = y, R = A), S ===
2123
2128
  _emitter: pe,
2124
2129
  _top: $
2125
2130
  };
2126
- } catch (N) {
2127
- if (N.message && N.message.includes("Illegal"))
2131
+ } catch (S) {
2132
+ if (S.message && S.message.includes("Illegal"))
2128
2133
  return {
2129
2134
  language: y,
2130
2135
  value: rt(A),
2131
2136
  illegal: !0,
2132
2137
  relevance: 0,
2133
2138
  _illegalBy: {
2134
- message: N.message,
2135
- index: He,
2136
- context: A.slice(He - 100, He + 100),
2137
- mode: N.mode,
2139
+ message: S.message,
2140
+ index: Ue,
2141
+ context: A.slice(Ue - 100, Ue + 100),
2142
+ mode: S.mode,
2138
2143
  resultSoFar: dn
2139
2144
  },
2140
2145
  _emitter: pe
@@ -2145,11 +2150,11 @@ https://github.com/highlightjs/highlight.js/issues/2277`), F = y, R = A), S ===
2145
2150
  value: rt(A),
2146
2151
  illegal: !1,
2147
2152
  relevance: 0,
2148
- errorRaised: N,
2153
+ errorRaised: S,
2149
2154
  _emitter: pe,
2150
2155
  _top: $
2151
2156
  };
2152
- throw N;
2157
+ throw S;
2153
2158
  }
2154
2159
  }
2155
2160
  function x(y) {
@@ -2164,33 +2169,33 @@ https://github.com/highlightjs/highlight.js/issues/2277`), F = y, R = A), S ===
2164
2169
  }
2165
2170
  function p(y, A) {
2166
2171
  A = A || l.languages || Object.keys(r);
2167
- const S = x(y), R = A.filter(se).filter(X).map(
2168
- (ke) => b(ke, y, !1)
2172
+ const M = x(y), R = A.filter(se).filter(X).map(
2173
+ (we) => b(we, y, !1)
2169
2174
  );
2170
- R.unshift(S);
2171
- const F = R.sort((ke, Ce) => {
2172
- if (ke.relevance !== Ce.relevance) return Ce.relevance - ke.relevance;
2173
- if (ke.language && Ce.language) {
2174
- if (se(ke.language).supersetOf === Ce.language)
2175
+ R.unshift(M);
2176
+ const F = R.sort((we, Ce) => {
2177
+ if (we.relevance !== Ce.relevance) return Ce.relevance - we.relevance;
2178
+ if (we.language && Ce.language) {
2179
+ if (se(we.language).supersetOf === Ce.language)
2175
2180
  return 1;
2176
- if (se(Ce.language).supersetOf === ke.language)
2181
+ if (se(Ce.language).supersetOf === we.language)
2177
2182
  return -1;
2178
2183
  }
2179
2184
  return 0;
2180
2185
  }), [ce, Ee] = F, Me = ce;
2181
2186
  return Me.secondBest = Ee, Me;
2182
2187
  }
2183
- function g(y, A, S) {
2184
- const R = A && n[A] || S;
2188
+ function f(y, A, M) {
2189
+ const R = A && n[A] || M;
2185
2190
  y.classList.add("hljs"), y.classList.add(`language-${R}`);
2186
2191
  }
2187
- function L(y) {
2192
+ function k(y) {
2188
2193
  let A = null;
2189
- const S = f(y);
2190
- if (c(S)) return;
2194
+ const M = g(y);
2195
+ if (c(M)) return;
2191
2196
  if (ue(
2192
2197
  "before:highlightElement",
2193
- { el: y, language: S }
2198
+ { el: y, language: M }
2194
2199
  ), y.dataset.highlighted) {
2195
2200
  console.log("Element previously highlighted. To highlight again, first unset `dataset.highlighted`.", y);
2196
2201
  return;
@@ -2201,8 +2206,8 @@ https://github.com/highlightjs/highlight.js/issues/2277`), F = y, R = A), S ===
2201
2206
  y.innerHTML
2202
2207
  );
2203
2208
  A = y;
2204
- const R = A.textContent, F = S ? E(R, { language: S, ignoreIllegals: !0 }) : p(R);
2205
- y.innerHTML = F.value, y.dataset.highlighted = "yes", g(y, S, F.language), y.result = {
2209
+ const R = A.textContent, F = M ? E(R, { language: M, ignoreIllegals: !0 }) : p(R);
2210
+ y.innerHTML = F.value, y.dataset.highlighted = "yes", f(y, M, F.language), y.result = {
2206
2211
  language: F.language,
2207
2212
  // TODO: remove with version 11.0
2208
2213
  re: F.relevance,
@@ -2212,10 +2217,10 @@ https://github.com/highlightjs/highlight.js/issues/2277`), F = y, R = A), S ===
2212
2217
  relevance: F.secondBest.relevance
2213
2218
  }), ue("after:highlightElement", { el: y, result: F, text: R });
2214
2219
  }
2215
- function M(y) {
2220
+ function z(y) {
2216
2221
  l = Vt(l, y);
2217
2222
  }
2218
- const w = () => {
2223
+ const _ = () => {
2219
2224
  H(), rn("10.6.0", "initHighlighting() deprecated. Use highlightAll() now.");
2220
2225
  };
2221
2226
  function Y() {
@@ -2230,22 +2235,22 @@ https://github.com/highlightjs/highlight.js/issues/2277`), F = y, R = A), S ===
2230
2235
  D || window.addEventListener("DOMContentLoaded", y, !1), D = !0;
2231
2236
  return;
2232
2237
  }
2233
- document.querySelectorAll(l.cssSelector).forEach(L);
2238
+ document.querySelectorAll(l.cssSelector).forEach(k);
2234
2239
  }
2235
2240
  function P(y, A) {
2236
- let S = null;
2241
+ let M = null;
2237
2242
  try {
2238
- S = A(e);
2243
+ M = A(e);
2239
2244
  } catch (R) {
2240
2245
  if (Ve("Language definition for '{}' could not be registered.".replace("{}", y)), a)
2241
2246
  Ve(R);
2242
2247
  else
2243
2248
  throw R;
2244
- S = s;
2249
+ M = s;
2245
2250
  }
2246
- S.name || (S.name = y), r[y] = S, S.rawDefinition = A.bind(null, e), S.aliases && me(S.aliases, { languageName: y });
2251
+ M.name || (M.name = y), r[y] = M, M.rawDefinition = A.bind(null, e), M.aliases && me(M.aliases, { languageName: y });
2247
2252
  }
2248
- function z(y) {
2253
+ function B(y) {
2249
2254
  delete r[y];
2250
2255
  for (const A of Object.keys(n))
2251
2256
  n[A] === y && delete n[A];
@@ -2257,8 +2262,8 @@ https://github.com/highlightjs/highlight.js/issues/2277`), F = y, R = A), S ===
2257
2262
  return y = (y || "").toLowerCase(), r[y] || r[n[y]];
2258
2263
  }
2259
2264
  function me(y, { languageName: A }) {
2260
- typeof y == "string" && (y = [y]), y.forEach((S) => {
2261
- n[S.toLowerCase()] = A;
2265
+ typeof y == "string" && (y = [y]), y.forEach((M) => {
2266
+ n[M.toLowerCase()] = A;
2262
2267
  });
2263
2268
  }
2264
2269
  function X(y) {
@@ -2284,26 +2289,26 @@ https://github.com/highlightjs/highlight.js/issues/2277`), F = y, R = A), S ===
2284
2289
  A !== -1 && o.splice(A, 1);
2285
2290
  }
2286
2291
  function ue(y, A) {
2287
- const S = y;
2292
+ const M = y;
2288
2293
  o.forEach(function(R) {
2289
- R[S] && R[S](A);
2294
+ R[M] && R[M](A);
2290
2295
  });
2291
2296
  }
2292
2297
  function ye(y) {
2293
- return rn("10.7.0", "highlightBlock will be removed entirely in v12.0"), rn("10.7.0", "Please use highlightElement now."), L(y);
2298
+ return rn("10.7.0", "highlightBlock will be removed entirely in v12.0"), rn("10.7.0", "Please use highlightElement now."), k(y);
2294
2299
  }
2295
2300
  Object.assign(e, {
2296
2301
  highlight: E,
2297
2302
  highlightAuto: p,
2298
2303
  highlightAll: H,
2299
- highlightElement: L,
2304
+ highlightElement: k,
2300
2305
  // TODO: Remove with v12 API
2301
2306
  highlightBlock: ye,
2302
- configure: M,
2303
- initHighlighting: w,
2307
+ configure: z,
2308
+ initHighlighting: _,
2304
2309
  initHighlightingOnLoad: Y,
2305
2310
  registerLanguage: P,
2306
- unregisterLanguage: z,
2311
+ unregisterLanguage: B,
2307
2312
  listLanguages: re,
2308
2313
  getLanguage: se,
2309
2314
  registerAliases: me,
@@ -2394,7 +2399,7 @@ function at(e) {
2394
2399
  a.contains.push(l);
2395
2400
  const c = {
2396
2401
  match: /\\"/
2397
- }, f = {
2402
+ }, g = {
2398
2403
  className: "string",
2399
2404
  begin: /'/,
2400
2405
  end: /'/
@@ -2424,13 +2429,13 @@ function at(e) {
2424
2429
  ], p = e.SHEBANG({
2425
2430
  binary: `(${x.join("|")})`,
2426
2431
  relevance: 10
2427
- }), g = {
2432
+ }), f = {
2428
2433
  className: "function",
2429
2434
  begin: /\w[\w\d_]*\s*\(\s*\)\s*\{/,
2430
2435
  returnBegin: !0,
2431
2436
  contains: [e.inherit(e.TITLE_MODE, { begin: /\w[\w\d_]*/ })],
2432
2437
  relevance: 0
2433
- }, L = [
2438
+ }, k = [
2434
2439
  "if",
2435
2440
  "then",
2436
2441
  "else",
@@ -2448,10 +2453,10 @@ function at(e) {
2448
2453
  "coproc",
2449
2454
  "function",
2450
2455
  "select"
2451
- ], M = [
2456
+ ], z = [
2452
2457
  "true",
2453
2458
  "false"
2454
- ], w = { match: /(\/[a-z._-]+)+/ }, Y = [
2459
+ ], _ = { match: /(\/[a-z._-]+)+/ }, Y = [
2455
2460
  "break",
2456
2461
  "cd",
2457
2462
  "continue",
@@ -2675,8 +2680,8 @@ function at(e) {
2675
2680
  ],
2676
2681
  keywords: {
2677
2682
  $pattern: /\b[a-z][a-z0-9._-]+\b/,
2678
- keyword: L,
2679
- literal: M,
2683
+ keyword: k,
2684
+ literal: z,
2680
2685
  built_in: [
2681
2686
  ...Y,
2682
2687
  ...D,
@@ -2692,14 +2697,14 @@ function at(e) {
2692
2697
  // to catch known shells and boost relevancy
2693
2698
  e.SHEBANG(),
2694
2699
  // to catch unknown shells but still highlight the shebang
2695
- g,
2700
+ f,
2696
2701
  b,
2697
2702
  d,
2698
2703
  s,
2699
- w,
2704
+ _,
2700
2705
  l,
2701
2706
  c,
2702
- f,
2707
+ g,
2703
2708
  E,
2704
2709
  n
2705
2710
  ]
@@ -3866,7 +3871,7 @@ function la(e) {
3866
3871
  "super",
3867
3872
  "this"
3868
3873
  ]
3869
- }, f = {
3874
+ }, g = {
3870
3875
  className: "meta",
3871
3876
  begin: "@" + n,
3872
3877
  contains: [
@@ -3994,7 +3999,7 @@ function la(e) {
3994
3999
  keywords: c,
3995
4000
  relevance: 0,
3996
4001
  contains: [
3997
- f,
4002
+ g,
3998
4003
  e.APOS_STRING_MODE,
3999
4004
  e.QUOTE_STRING_MODE,
4000
4005
  Qt,
@@ -4006,7 +4011,7 @@ function la(e) {
4006
4011
  ]
4007
4012
  },
4008
4013
  Qt,
4009
- f
4014
+ g
4010
4015
  ]
4011
4016
  };
4012
4017
  }
@@ -4157,9 +4162,9 @@ const ei = "[A-Za-z$_][0-9A-Za-z$_]*", ca = [
4157
4162
  Ai
4158
4163
  );
4159
4164
  function ni(e) {
4160
- const r = e.regex, n = (S, { after: R }) => {
4161
- const F = "</" + S[0].slice(1);
4162
- return S.input.indexOf(F, R) !== -1;
4165
+ const r = e.regex, n = (M, { after: R }) => {
4166
+ const F = "</" + M[0].slice(1);
4167
+ return M.input.indexOf(F, R) !== -1;
4163
4168
  }, o = ei, a = {
4164
4169
  begin: "<>",
4165
4170
  end: "</>"
@@ -4170,8 +4175,8 @@ function ni(e) {
4170
4175
  * @param {RegExpMatchArray} match
4171
4176
  * @param {CallbackResponse} response
4172
4177
  */
4173
- isTrulyOpeningTag: (S, R) => {
4174
- const F = S[0].length + S.index, ce = S.input[F];
4178
+ isTrulyOpeningTag: (M, R) => {
4179
+ const F = M[0].length + M.index, ce = M.input[F];
4175
4180
  if (
4176
4181
  // HTML should not include another raw `<` inside a tag
4177
4182
  // nested type?
@@ -4183,9 +4188,9 @@ function ni(e) {
4183
4188
  R.ignoreMatch();
4184
4189
  return;
4185
4190
  }
4186
- ce === ">" && (n(S, { after: F }) || R.ignoreMatch());
4191
+ ce === ">" && (n(M, { after: F }) || R.ignoreMatch());
4187
4192
  let Ee;
4188
- const Me = S.input.substring(F);
4193
+ const Me = M.input.substring(F);
4189
4194
  if (Ee = Me.match(/^\s*=/)) {
4190
4195
  R.ignoreMatch();
4191
4196
  return;
@@ -4201,12 +4206,12 @@ function ni(e) {
4201
4206
  literal: ua,
4202
4207
  built_in: fa,
4203
4208
  "variable.language": da
4204
- }, c = "[0-9](_?[0-9])*", f = `\\.(${c})`, E = "0|[1-9](_?[0-9])*|0[0-7]*[89][0-9]*", b = {
4209
+ }, c = "[0-9](_?[0-9])*", g = `\\.(${c})`, E = "0|[1-9](_?[0-9])*|0[0-7]*[89][0-9]*", b = {
4205
4210
  className: "number",
4206
4211
  variants: [
4207
4212
  // DecimalLiteral
4208
- { begin: `(\\b(${E})((${f})|\\.)?|(${f}))[eE][+-]?(${c})\\b` },
4209
- { begin: `\\b(${E})\\b((${f})\\b|\\.)?|(${f})\\b` },
4213
+ { begin: `(\\b(${E})((${g})|\\.)?|(${g}))[eE][+-]?(${c})\\b` },
4214
+ { begin: `\\b(${E})\\b((${g})\\b|\\.)?|(${g})\\b` },
4210
4215
  // DecimalBigIntegerLiteral
4211
4216
  { begin: "\\b(0|[1-9](_?[0-9])*)n\\b" },
4212
4217
  // NonDecimalIntegerLiteral
@@ -4237,7 +4242,7 @@ function ni(e) {
4237
4242
  ],
4238
4243
  subLanguage: "xml"
4239
4244
  }
4240
- }, g = {
4245
+ }, f = {
4241
4246
  begin: ".?css`",
4242
4247
  end: "",
4243
4248
  starts: {
@@ -4249,7 +4254,7 @@ function ni(e) {
4249
4254
  ],
4250
4255
  subLanguage: "css"
4251
4256
  }
4252
- }, L = {
4257
+ }, k = {
4253
4258
  begin: ".?gql`",
4254
4259
  end: "",
4255
4260
  starts: {
@@ -4261,7 +4266,7 @@ function ni(e) {
4261
4266
  ],
4262
4267
  subLanguage: "graphql"
4263
4268
  }
4264
- }, M = {
4269
+ }, z = {
4265
4270
  className: "string",
4266
4271
  begin: "`",
4267
4272
  end: "`",
@@ -4318,9 +4323,9 @@ function ni(e) {
4318
4323
  e.APOS_STRING_MODE,
4319
4324
  e.QUOTE_STRING_MODE,
4320
4325
  p,
4321
- g,
4322
- L,
4323
- M,
4326
+ f,
4327
+ k,
4328
+ z,
4324
4329
  // Skip numbers when they are part of a variable name
4325
4330
  { match: /\$\d+/ },
4326
4331
  b
@@ -4346,7 +4351,7 @@ function ni(e) {
4346
4351
  keywords: l,
4347
4352
  contains: ["self"].concat(H)
4348
4353
  }
4349
- ]), z = {
4354
+ ]), B = {
4350
4355
  className: "params",
4351
4356
  // convert this to negative lookbehind in v12
4352
4357
  begin: /(\s*)\(/,
@@ -4441,15 +4446,15 @@ function ni(e) {
4441
4446
  3: "title.function"
4442
4447
  },
4443
4448
  label: "func.def",
4444
- contains: [z],
4449
+ contains: [B],
4445
4450
  illegal: /%/
4446
4451
  }, ae = {
4447
4452
  relevance: 0,
4448
4453
  match: /\b[A-Z][A-Z_0-9]+\b/,
4449
4454
  className: "variable.constant"
4450
4455
  };
4451
- function fe(S) {
4452
- return r.concat("(?!", S.join("|"), ")");
4456
+ function fe(M) {
4457
+ return r.concat("(?!", M.join("|"), ")");
4453
4458
  }
4454
4459
  const ve = {
4455
4460
  match: r.concat(
@@ -4458,7 +4463,7 @@ function ni(e) {
4458
4463
  ...Ri,
4459
4464
  "super",
4460
4465
  "import"
4461
- ].map((S) => `${S}\\s*\\(`)),
4466
+ ].map((M) => `${M}\\s*\\(`)),
4462
4467
  o,
4463
4468
  r.lookahead(/\s*\(/)
4464
4469
  ),
@@ -4489,7 +4494,7 @@ function ni(e) {
4489
4494
  // eat to avoid empty params
4490
4495
  begin: /\(\)/
4491
4496
  },
4492
- z
4497
+ B
4493
4498
  ]
4494
4499
  }, y = "(\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)|" + e.UNDERSCORE_IDENT_RE + ")\\s*=>", A = {
4495
4500
  match: [
@@ -4508,7 +4513,7 @@ function ni(e) {
4508
4513
  3: "title.function"
4509
4514
  },
4510
4515
  contains: [
4511
- z
4516
+ B
4512
4517
  ]
4513
4518
  };
4514
4519
  return {
@@ -4528,9 +4533,9 @@ function ni(e) {
4528
4533
  e.APOS_STRING_MODE,
4529
4534
  e.QUOTE_STRING_MODE,
4530
4535
  p,
4531
- g,
4532
- L,
4533
- M,
4536
+ f,
4537
+ k,
4538
+ z,
4534
4539
  Y,
4535
4540
  // Skip numbers when they are part of a variable name
4536
4541
  { match: /\$\d+/ },
@@ -4632,7 +4637,7 @@ function ni(e) {
4632
4637
  returnBegin: !0,
4633
4638
  label: "func.def",
4634
4639
  contains: [
4635
- z,
4640
+ B,
4636
4641
  e.inherit(e.TITLE_MODE, { begin: o, className: "title.function" })
4637
4642
  ]
4638
4643
  },
@@ -4652,7 +4657,7 @@ function ni(e) {
4652
4657
  {
4653
4658
  match: [/\bconstructor(?=\s*\()/],
4654
4659
  className: { 1: "title.function" },
4655
- contains: [z]
4660
+ contains: [B]
4656
4661
  },
4657
4662
  ve,
4658
4663
  ae,
@@ -4820,7 +4825,7 @@ function ti(e) {
4820
4825
  excludeEnd: !0
4821
4826
  }
4822
4827
  ]
4823
- }, f = {
4828
+ }, g = {
4824
4829
  className: "strong",
4825
4830
  contains: [],
4826
4831
  // defined later
@@ -4849,20 +4854,20 @@ function ti(e) {
4849
4854
  relevance: 0
4850
4855
  }
4851
4856
  ]
4852
- }, b = e.inherit(f, { contains: [] }), x = e.inherit(E, { contains: [] });
4853
- f.contains.push(x), E.contains.push(b);
4857
+ }, b = e.inherit(g, { contains: [] }), x = e.inherit(E, { contains: [] });
4858
+ g.contains.push(x), E.contains.push(b);
4854
4859
  let p = [
4855
4860
  n,
4856
4861
  c
4857
4862
  ];
4858
4863
  return [
4859
- f,
4864
+ g,
4860
4865
  E,
4861
4866
  b,
4862
4867
  x
4863
- ].forEach((w) => {
4864
- w.contains = w.contains.concat(p);
4865
- }), p = p.concat(f, E), {
4868
+ ].forEach((_) => {
4869
+ _.contains = _.contains.concat(p);
4870
+ }), p = p.concat(g, E), {
4866
4871
  name: "Markdown",
4867
4872
  aliases: [
4868
4873
  "md",
@@ -4893,7 +4898,7 @@ function ti(e) {
4893
4898
  },
4894
4899
  n,
4895
4900
  d,
4896
- f,
4901
+ g,
4897
4902
  E,
4898
4903
  {
4899
4904
  className: "quote",
@@ -5049,7 +5054,7 @@ function ii(e) {
5049
5054
  }, c = {
5050
5055
  className: "meta",
5051
5056
  begin: /^(>>>|\.\.\.) /
5052
- }, f = {
5057
+ }, g = {
5053
5058
  className: "subst",
5054
5059
  begin: /\{/,
5055
5060
  end: /\}/,
@@ -5087,7 +5092,7 @@ function ii(e) {
5087
5092
  e.BACKSLASH_ESCAPE,
5088
5093
  c,
5089
5094
  E,
5090
- f
5095
+ g
5091
5096
  ]
5092
5097
  },
5093
5098
  {
@@ -5097,7 +5102,7 @@ function ii(e) {
5097
5102
  e.BACKSLASH_ESCAPE,
5098
5103
  c,
5099
5104
  E,
5100
- f
5105
+ g
5101
5106
  ]
5102
5107
  },
5103
5108
  {
@@ -5124,7 +5129,7 @@ function ii(e) {
5124
5129
  contains: [
5125
5130
  e.BACKSLASH_ESCAPE,
5126
5131
  E,
5127
- f
5132
+ g
5128
5133
  ]
5129
5134
  },
5130
5135
  {
@@ -5133,13 +5138,13 @@ function ii(e) {
5133
5138
  contains: [
5134
5139
  e.BACKSLASH_ESCAPE,
5135
5140
  E,
5136
- f
5141
+ g
5137
5142
  ]
5138
5143
  },
5139
5144
  e.APOS_STRING_MODE,
5140
5145
  e.QUOTE_STRING_MODE
5141
5146
  ]
5142
- }, x = "[0-9](_?[0-9])*", p = `(\\b(${x}))?\\.(${x})|\\b(${x})\\.`, g = `\\b|${o.join("|")}`, L = {
5147
+ }, x = "[0-9](_?[0-9])*", p = `(\\b(${x}))?\\.(${x})|\\b(${x})\\.`, f = `\\b|${o.join("|")}`, k = {
5143
5148
  className: "number",
5144
5149
  relevance: 0,
5145
5150
  variants: [
@@ -5154,7 +5159,7 @@ function ii(e) {
5154
5159
  // because both MUST contain a decimal point and so cannot be confused with
5155
5160
  // the interior part of an identifier
5156
5161
  {
5157
- begin: `(\\b(${x})|(${p}))[eE][+-]?(${x})[jJ]?(?=${g})`
5162
+ begin: `(\\b(${x})|(${p}))[eE][+-]?(${x})[jJ]?(?=${f})`
5158
5163
  },
5159
5164
  {
5160
5165
  begin: `(${p})[jJ]?`
@@ -5166,24 +5171,24 @@ function ii(e) {
5166
5171
  // decinteger is optionally imaginary
5167
5172
  // https://docs.python.org/3.9/reference/lexical_analysis.html#imaginary-literals
5168
5173
  {
5169
- begin: `\\b([1-9](_?[0-9])*|0+(_?0)*)[lLjJ]?(?=${g})`
5174
+ begin: `\\b([1-9](_?[0-9])*|0+(_?0)*)[lLjJ]?(?=${f})`
5170
5175
  },
5171
5176
  {
5172
- begin: `\\b0[bB](_?[01])+[lL]?(?=${g})`
5177
+ begin: `\\b0[bB](_?[01])+[lL]?(?=${f})`
5173
5178
  },
5174
5179
  {
5175
- begin: `\\b0[oO](_?[0-7])+[lL]?(?=${g})`
5180
+ begin: `\\b0[oO](_?[0-7])+[lL]?(?=${f})`
5176
5181
  },
5177
5182
  {
5178
- begin: `\\b0[xX](_?[0-9a-fA-F])+[lL]?(?=${g})`
5183
+ begin: `\\b0[xX](_?[0-9a-fA-F])+[lL]?(?=${f})`
5179
5184
  },
5180
5185
  // imagnumber (digitpart-based)
5181
5186
  // https://docs.python.org/3.9/reference/lexical_analysis.html#imaginary-literals
5182
5187
  {
5183
- begin: `\\b(${x})[jJ](?=${g})`
5188
+ begin: `\\b(${x})[jJ](?=${f})`
5184
5189
  }
5185
5190
  ]
5186
- }, M = {
5191
+ }, z = {
5187
5192
  className: "comment",
5188
5193
  begin: r.lookahead(/# type:/),
5189
5194
  end: /$/,
@@ -5200,7 +5205,7 @@ function ii(e) {
5200
5205
  endsWithParent: !0
5201
5206
  }
5202
5207
  ]
5203
- }, w = {
5208
+ }, _ = {
5204
5209
  className: "params",
5205
5210
  variants: [
5206
5211
  // Exclude params in functions without params
@@ -5218,16 +5223,16 @@ function ii(e) {
5218
5223
  contains: [
5219
5224
  "self",
5220
5225
  c,
5221
- L,
5226
+ k,
5222
5227
  b,
5223
5228
  e.HASH_COMMENT_MODE
5224
5229
  ]
5225
5230
  }
5226
5231
  ]
5227
5232
  };
5228
- return f.contains = [
5233
+ return g.contains = [
5229
5234
  b,
5230
- L,
5235
+ k,
5231
5236
  c
5232
5237
  ], {
5233
5238
  name: "Python",
@@ -5241,7 +5246,7 @@ function ii(e) {
5241
5246
  illegal: /(<\/|\?)|=>/,
5242
5247
  contains: [
5243
5248
  c,
5244
- L,
5249
+ k,
5245
5250
  {
5246
5251
  // very common convention
5247
5252
  scope: "variable.language",
@@ -5255,7 +5260,7 @@ function ii(e) {
5255
5260
  },
5256
5261
  { match: /\bor\b/, scope: "keyword" },
5257
5262
  b,
5258
- M,
5263
+ z,
5259
5264
  e.HASH_COMMENT_MODE,
5260
5265
  {
5261
5266
  match: [
@@ -5267,7 +5272,7 @@ function ii(e) {
5267
5272
  1: "keyword",
5268
5273
  3: "title.function"
5269
5274
  },
5270
- contains: [w]
5275
+ contains: [_]
5271
5276
  },
5272
5277
  {
5273
5278
  variants: [
@@ -5301,8 +5306,8 @@ function ii(e) {
5301
5306
  begin: /^[\t ]*@/,
5302
5307
  end: /(?=#)|$/,
5303
5308
  contains: [
5304
- L,
5305
- w,
5309
+ k,
5310
+ _,
5306
5311
  b
5307
5312
  ]
5308
5313
  }
@@ -5379,7 +5384,7 @@ function oi(e) {
5379
5384
  "None",
5380
5385
  "Ok",
5381
5386
  "Err"
5382
- ], f = [
5387
+ ], g = [
5383
5388
  // functions
5384
5389
  "drop ",
5385
5390
  // traits
@@ -5478,7 +5483,7 @@ function oi(e) {
5478
5483
  type: E,
5479
5484
  keyword: l,
5480
5485
  literal: c,
5481
- built_in: f
5486
+ built_in: g
5482
5487
  },
5483
5488
  illegal: "</",
5484
5489
  contains: [
@@ -5599,7 +5604,7 @@ function oi(e) {
5599
5604
  begin: e.IDENT_RE + "::",
5600
5605
  keywords: {
5601
5606
  keyword: "Self",
5602
- built_in: f,
5607
+ built_in: g,
5603
5608
  type: E
5604
5609
  }
5605
5610
  },
@@ -5674,7 +5679,7 @@ function ma(e) {
5674
5679
  "first",
5675
5680
  "last",
5676
5681
  "view"
5677
- ], f = [
5682
+ ], g = [
5678
5683
  "abs",
5679
5684
  "acos",
5680
5685
  "all",
@@ -6160,17 +6165,17 @@ function ma(e) {
6160
6165
  "nulls last",
6161
6166
  "depth first",
6162
6167
  "breadth first"
6163
- ], p = E, g = [
6164
- ...f,
6168
+ ], p = E, f = [
6169
+ ...g,
6165
6170
  ...c
6166
- ].filter((P) => !E.includes(P)), L = {
6171
+ ].filter((P) => !E.includes(P)), k = {
6167
6172
  scope: "variable",
6168
6173
  match: /@[a-z0-9][a-z0-9_]*/
6169
- }, M = {
6174
+ }, z = {
6170
6175
  scope: "operator",
6171
6176
  match: /[-+*/=%^~]|&&?|\|\|?|!=?|<(?:=>?|<|>)?|>[>=]?/,
6172
6177
  relevance: 0
6173
- }, w = {
6178
+ }, _ = {
6174
6179
  match: r.concat(/\b/, r.either(...p), /\s*\(/),
6175
6180
  relevance: 0,
6176
6181
  keywords: { built_in: p }
@@ -6178,7 +6183,7 @@ function ma(e) {
6178
6183
  function Y(P) {
6179
6184
  return r.concat(
6180
6185
  /\b/,
6181
- r.either(...P.map((z) => z.replace(/\s+/, "\\s+"))),
6186
+ r.either(...P.map((B) => B.replace(/\s+/, "\\s+"))),
6182
6187
  /\b/
6183
6188
  );
6184
6189
  }
@@ -6188,11 +6193,11 @@ function ma(e) {
6188
6193
  relevance: 0
6189
6194
  };
6190
6195
  function H(P, {
6191
- exceptions: z,
6196
+ exceptions: B,
6192
6197
  when: re
6193
6198
  } = {}) {
6194
6199
  const se = re;
6195
- return z = z || [], P.map((me) => me.match(/\|\d+$/) || z.includes(me) ? me : se(me) ? `${me}|0` : me);
6200
+ return B = B || [], P.map((me) => me.match(/\|\d+$/) || B.includes(me) ? me : se(me) ? `${me}|0` : me);
6196
6201
  }
6197
6202
  return {
6198
6203
  name: "SQL",
@@ -6201,7 +6206,7 @@ function ma(e) {
6201
6206
  illegal: /[{}]|<\//,
6202
6207
  keywords: {
6203
6208
  $pattern: /\b[\w\.]+/,
6204
- keyword: H(g, { when: (P) => P.length < 3 }),
6209
+ keyword: H(f, { when: (P) => P.length < 3 }),
6205
6210
  literal: d,
6206
6211
  type: l,
6207
6212
  built_in: b
@@ -6212,14 +6217,14 @@ function ma(e) {
6212
6217
  match: Y(s)
6213
6218
  },
6214
6219
  D,
6215
- w,
6216
- L,
6220
+ _,
6221
+ k,
6217
6222
  o,
6218
6223
  a,
6219
6224
  e.C_NUMBER_MODE,
6220
6225
  e.C_BLOCK_COMMENT_MODE,
6221
6226
  n,
6222
- M
6227
+ z
6223
6228
  ]
6224
6229
  };
6225
6230
  }
@@ -6370,9 +6375,9 @@ const Gn = "[A-Za-z$_][0-9A-Za-z$_]*", Oi = [
6370
6375
  Di
6371
6376
  );
6372
6377
  function pa(e) {
6373
- const r = e.regex, n = (S, { after: R }) => {
6374
- const F = "</" + S[0].slice(1);
6375
- return S.input.indexOf(F, R) !== -1;
6378
+ const r = e.regex, n = (M, { after: R }) => {
6379
+ const F = "</" + M[0].slice(1);
6380
+ return M.input.indexOf(F, R) !== -1;
6376
6381
  }, o = Gn, a = {
6377
6382
  begin: "<>",
6378
6383
  end: "</>"
@@ -6383,8 +6388,8 @@ function pa(e) {
6383
6388
  * @param {RegExpMatchArray} match
6384
6389
  * @param {CallbackResponse} response
6385
6390
  */
6386
- isTrulyOpeningTag: (S, R) => {
6387
- const F = S[0].length + S.index, ce = S.input[F];
6391
+ isTrulyOpeningTag: (M, R) => {
6392
+ const F = M[0].length + M.index, ce = M.input[F];
6388
6393
  if (
6389
6394
  // HTML should not include another raw `<` inside a tag
6390
6395
  // nested type?
@@ -6396,9 +6401,9 @@ function pa(e) {
6396
6401
  R.ignoreMatch();
6397
6402
  return;
6398
6403
  }
6399
- ce === ">" && (n(S, { after: F }) || R.ignoreMatch());
6404
+ ce === ">" && (n(M, { after: F }) || R.ignoreMatch());
6400
6405
  let Ee;
6401
- const Me = S.input.substring(F);
6406
+ const Me = M.input.substring(F);
6402
6407
  if (Ee = Me.match(/^\s*=/)) {
6403
6408
  R.ignoreMatch();
6404
6409
  return;
@@ -6414,12 +6419,12 @@ function pa(e) {
6414
6419
  literal: Ii,
6415
6420
  built_in: $i,
6416
6421
  "variable.language": zi
6417
- }, c = "[0-9](_?[0-9])*", f = `\\.(${c})`, E = "0|[1-9](_?[0-9])*|0[0-7]*[89][0-9]*", b = {
6422
+ }, c = "[0-9](_?[0-9])*", g = `\\.(${c})`, E = "0|[1-9](_?[0-9])*|0[0-7]*[89][0-9]*", b = {
6418
6423
  className: "number",
6419
6424
  variants: [
6420
6425
  // DecimalLiteral
6421
- { begin: `(\\b(${E})((${f})|\\.)?|(${f}))[eE][+-]?(${c})\\b` },
6422
- { begin: `\\b(${E})\\b((${f})\\b|\\.)?|(${f})\\b` },
6426
+ { begin: `(\\b(${E})((${g})|\\.)?|(${g}))[eE][+-]?(${c})\\b` },
6427
+ { begin: `\\b(${E})\\b((${g})\\b|\\.)?|(${g})\\b` },
6423
6428
  // DecimalBigIntegerLiteral
6424
6429
  { begin: "\\b(0|[1-9](_?[0-9])*)n\\b" },
6425
6430
  // NonDecimalIntegerLiteral
@@ -6450,7 +6455,7 @@ function pa(e) {
6450
6455
  ],
6451
6456
  subLanguage: "xml"
6452
6457
  }
6453
- }, g = {
6458
+ }, f = {
6454
6459
  begin: ".?css`",
6455
6460
  end: "",
6456
6461
  starts: {
@@ -6462,7 +6467,7 @@ function pa(e) {
6462
6467
  ],
6463
6468
  subLanguage: "css"
6464
6469
  }
6465
- }, L = {
6470
+ }, k = {
6466
6471
  begin: ".?gql`",
6467
6472
  end: "",
6468
6473
  starts: {
@@ -6474,7 +6479,7 @@ function pa(e) {
6474
6479
  ],
6475
6480
  subLanguage: "graphql"
6476
6481
  }
6477
- }, M = {
6482
+ }, z = {
6478
6483
  className: "string",
6479
6484
  begin: "`",
6480
6485
  end: "`",
@@ -6531,9 +6536,9 @@ function pa(e) {
6531
6536
  e.APOS_STRING_MODE,
6532
6537
  e.QUOTE_STRING_MODE,
6533
6538
  p,
6534
- g,
6535
- L,
6536
- M,
6539
+ f,
6540
+ k,
6541
+ z,
6537
6542
  // Skip numbers when they are part of a variable name
6538
6543
  { match: /\$\d+/ },
6539
6544
  b
@@ -6559,7 +6564,7 @@ function pa(e) {
6559
6564
  keywords: l,
6560
6565
  contains: ["self"].concat(H)
6561
6566
  }
6562
- ]), z = {
6567
+ ]), B = {
6563
6568
  className: "params",
6564
6569
  // convert this to negative lookbehind in v12
6565
6570
  begin: /(\s*)\(/,
@@ -6654,15 +6659,15 @@ function pa(e) {
6654
6659
  3: "title.function"
6655
6660
  },
6656
6661
  label: "func.def",
6657
- contains: [z],
6662
+ contains: [B],
6658
6663
  illegal: /%/
6659
6664
  }, ae = {
6660
6665
  relevance: 0,
6661
6666
  match: /\b[A-Z][A-Z_0-9]+\b/,
6662
6667
  className: "variable.constant"
6663
6668
  };
6664
- function fe(S) {
6665
- return r.concat("(?!", S.join("|"), ")");
6669
+ function fe(M) {
6670
+ return r.concat("(?!", M.join("|"), ")");
6666
6671
  }
6667
6672
  const ve = {
6668
6673
  match: r.concat(
@@ -6671,7 +6676,7 @@ function pa(e) {
6671
6676
  ...Bi,
6672
6677
  "super",
6673
6678
  "import"
6674
- ].map((S) => `${S}\\s*\\(`)),
6679
+ ].map((M) => `${M}\\s*\\(`)),
6675
6680
  o,
6676
6681
  r.lookahead(/\s*\(/)
6677
6682
  ),
@@ -6702,7 +6707,7 @@ function pa(e) {
6702
6707
  // eat to avoid empty params
6703
6708
  begin: /\(\)/
6704
6709
  },
6705
- z
6710
+ B
6706
6711
  ]
6707
6712
  }, y = "(\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)|" + e.UNDERSCORE_IDENT_RE + ")\\s*=>", A = {
6708
6713
  match: [
@@ -6721,7 +6726,7 @@ function pa(e) {
6721
6726
  3: "title.function"
6722
6727
  },
6723
6728
  contains: [
6724
- z
6729
+ B
6725
6730
  ]
6726
6731
  };
6727
6732
  return {
@@ -6741,9 +6746,9 @@ function pa(e) {
6741
6746
  e.APOS_STRING_MODE,
6742
6747
  e.QUOTE_STRING_MODE,
6743
6748
  p,
6744
- g,
6745
- L,
6746
- M,
6749
+ f,
6750
+ k,
6751
+ z,
6747
6752
  Y,
6748
6753
  // Skip numbers when they are part of a variable name
6749
6754
  { match: /\$\d+/ },
@@ -6845,7 +6850,7 @@ function pa(e) {
6845
6850
  returnBegin: !0,
6846
6851
  label: "func.def",
6847
6852
  contains: [
6848
- z,
6853
+ B,
6849
6854
  e.inherit(e.TITLE_MODE, { begin: o, className: "title.function" })
6850
6855
  ]
6851
6856
  },
@@ -6865,7 +6870,7 @@ function pa(e) {
6865
6870
  {
6866
6871
  match: [/\bconstructor(?=\s*\()/],
6867
6872
  className: { 1: "title.function" },
6868
- contains: [z]
6873
+ contains: [B]
6869
6874
  },
6870
6875
  ve,
6871
6876
  ae,
@@ -6927,7 +6932,7 @@ function ri(e) {
6927
6932
  "enum",
6928
6933
  "override",
6929
6934
  "satisfies"
6930
- ], f = {
6935
+ ], g = {
6931
6936
  $pattern: Gn,
6932
6937
  keyword: Oi.concat(c),
6933
6938
  literal: Ii,
@@ -6936,14 +6941,14 @@ function ri(e) {
6936
6941
  }, E = {
6937
6942
  className: "meta",
6938
6943
  begin: "@" + o
6939
- }, b = (L, M, w) => {
6940
- const Y = L.contains.findIndex((D) => D.label === M);
6944
+ }, b = (k, z, _) => {
6945
+ const Y = k.contains.findIndex((D) => D.label === z);
6941
6946
  if (Y === -1)
6942
6947
  throw new Error("can not find mode to replace");
6943
- L.contains.splice(Y, 1, w);
6948
+ k.contains.splice(Y, 1, _);
6944
6949
  };
6945
- Object.assign(n.keywords, f), n.exports.PARAMS_CONTAINS.push(E);
6946
- const x = n.contains.find((L) => L.scope === "attr"), p = Object.assign(
6950
+ Object.assign(n.keywords, g), n.exports.PARAMS_CONTAINS.push(E);
6951
+ const x = n.contains.find((k) => k.scope === "attr"), p = Object.assign(
6947
6952
  {},
6948
6953
  x,
6949
6954
  { match: r.concat(o, r.lookahead(/\s*\?:/)) }
@@ -6962,8 +6967,8 @@ function ri(e) {
6962
6967
  p
6963
6968
  // Added for optional property assignment highlighting
6964
6969
  ]), b(n, "shebang", e.SHEBANG()), b(n, "use_strict", l);
6965
- const g = n.contains.find((L) => L.label === "func.def");
6966
- return g.relevance = 0, Object.assign(n, {
6970
+ const f = n.contains.find((k) => k.label === "func.def");
6971
+ return f.relevance = 0, Object.assign(n, {
6967
6972
  name: "TypeScript",
6968
6973
  aliases: [
6969
6974
  "ts",
@@ -6989,7 +6994,7 @@ function ai(e) {
6989
6994
  }, s = e.inherit(d, {
6990
6995
  begin: /\(/,
6991
6996
  end: /\)/
6992
- }), l = e.inherit(e.APOS_STRING_MODE, { className: "string" }), c = e.inherit(e.QUOTE_STRING_MODE, { className: "string" }), f = {
6997
+ }), l = e.inherit(e.APOS_STRING_MODE, { className: "string" }), c = e.inherit(e.QUOTE_STRING_MODE, { className: "string" }), g = {
6993
6998
  endsWithParent: !0,
6994
6999
  illegal: /</,
6995
7000
  relevance: 0,
@@ -7108,7 +7113,7 @@ function ai(e) {
7108
7113
  begin: /<style(?=\s|>)/,
7109
7114
  end: />/,
7110
7115
  keywords: { name: "style" },
7111
- contains: [f],
7116
+ contains: [g],
7112
7117
  starts: {
7113
7118
  end: /<\/style>/,
7114
7119
  returnEnd: !0,
@@ -7124,7 +7129,7 @@ function ai(e) {
7124
7129
  begin: /<script(?=\s|>)/,
7125
7130
  end: />/,
7126
7131
  keywords: { name: "script" },
7127
- contains: [f],
7132
+ contains: [g],
7128
7133
  starts: {
7129
7134
  end: /<\/script>/,
7130
7135
  returnEnd: !0,
@@ -7159,7 +7164,7 @@ function ai(e) {
7159
7164
  className: "name",
7160
7165
  begin: n,
7161
7166
  relevance: 0,
7162
- starts: f
7167
+ starts: g
7163
7168
  }
7164
7169
  ]
7165
7170
  },
@@ -7269,19 +7274,19 @@ function si(e) {
7269
7274
  excludeEnd: !0,
7270
7275
  keywords: r,
7271
7276
  relevance: 0
7272
- }, g = {
7277
+ }, f = {
7273
7278
  begin: /\{/,
7274
7279
  end: /\}/,
7275
7280
  contains: [p],
7276
7281
  illegal: "\\n",
7277
7282
  relevance: 0
7278
- }, L = {
7283
+ }, k = {
7279
7284
  begin: "\\[",
7280
7285
  end: "\\]",
7281
7286
  contains: [p],
7282
7287
  illegal: "\\n",
7283
7288
  relevance: 0
7284
- }, M = [
7289
+ }, z = [
7285
7290
  o,
7286
7291
  {
7287
7292
  className: "meta",
@@ -7357,16 +7362,16 @@ function si(e) {
7357
7362
  begin: e.C_NUMBER_RE + "\\b",
7358
7363
  relevance: 0
7359
7364
  },
7360
- g,
7361
- L,
7365
+ f,
7366
+ k,
7362
7367
  d,
7363
7368
  s
7364
- ], w = [...M];
7365
- return w.pop(), w.push(l), p.contains = w, {
7369
+ ], _ = [...z];
7370
+ return _.pop(), _.push(l), p.contains = _, {
7366
7371
  name: "YAML",
7367
7372
  case_insensitive: !0,
7368
7373
  aliases: ["yml"],
7369
- contains: M
7374
+ contains: z
7370
7375
  };
7371
7376
  }
7372
7377
  const pt = {
@@ -7426,8 +7431,8 @@ function va(e) {
7426
7431
  }
7427
7432
  function ya(e, r, n) {
7428
7433
  if (e.length <= 1) return e.slice();
7429
- const [o, ...a] = e, d = a.map((f) => f[r] ?? ""), s = d.length > 0 && d.every((f) => f.trim() !== "" && !Number.isNaN(Number(f))), l = n === "asc" ? 1 : -1, c = a.slice().sort((f, E) => {
7430
- const b = f[r] ?? "", x = E[r] ?? "";
7434
+ const [o, ...a] = e, d = a.map((g) => g[r] ?? ""), s = d.length > 0 && d.every((g) => g.trim() !== "" && !Number.isNaN(Number(g))), l = n === "asc" ? 1 : -1, c = a.slice().sort((g, E) => {
7435
+ const b = g[r] ?? "", x = E[r] ?? "";
7431
7436
  return s ? (Number(b) - Number(x)) * l : b.localeCompare(x, "zh-Hans-CN", { numeric: !0 }) * l;
7432
7437
  });
7433
7438
  return [o, ...c];
@@ -7455,30 +7460,30 @@ const Ea = ["viewBox", "width", "height"], xa = { class: "zm-edges" }, wa = ["d"
7455
7460
  },
7456
7461
  emits: ["change", "select", "edit-note", "markdownChange", "canvas-settings", "canvas-data", "canvas-import"],
7457
7462
  setup(e, { expose: r, emit: n }) {
7458
- const o = e, a = n, d = oe(null), s = oe(null), l = oe(""), c = oe(null), f = oe(/* @__PURE__ */ new Set()), E = oe(!1), b = oe(null), x = oe(""), p = oe(/* @__PURE__ */ new Map()), g = oe(Ye(o.data)), L = oe({}), M = oe({}), w = oe(o.markdown !== void 0);
7463
+ const o = e, a = n, d = oe(null), s = oe(null), l = oe(""), c = oe(null), g = oe(/* @__PURE__ */ new Set()), E = oe(!1), b = oe(null), x = oe(""), p = oe(/* @__PURE__ */ new Map()), f = oe(Ye(o.data)), k = oe({}), z = oe({}), _ = oe(o.markdown !== void 0);
7459
7464
  let Y = !1;
7460
7465
  Ln(
7461
7466
  () => o.markdown,
7462
7467
  (t) => {
7463
7468
  if (t === void 0) {
7464
- w.value = !1;
7469
+ _.value = !1;
7465
7470
  return;
7466
7471
  }
7467
- w.value = !0;
7472
+ _.value = !0;
7468
7473
  const i = Ft(t || "");
7469
- Y = !0, g.value = Ye(i), c.value = null, f.value = /* @__PURE__ */ new Set(), le(), xe(() => {
7470
- Y = !1, We();
7474
+ Y = !0, f.value = Ye(i), c.value = null, g.value = /* @__PURE__ */ new Set(), le(), xe(() => {
7475
+ Y = !1, He();
7471
7476
  });
7472
7477
  }
7473
7478
  ), Ln(
7474
- g,
7479
+ f,
7475
7480
  () => {
7476
- w.value && !Y && a("markdownChange", lt(g.value));
7481
+ _.value && !Y && a("markdownChange", lt(f.value));
7477
7482
  },
7478
7483
  { deep: !0 }
7479
7484
  );
7480
- const D = we(() => B.showOrderBadge === !0), H = oe(/* @__PURE__ */ new Map()), P = H.value;
7481
- function z(t, i) {
7485
+ const D = ke(() => L.showOrderBadge === !0), H = oe(/* @__PURE__ */ new Map()), P = H.value;
7486
+ function B(t, i) {
7482
7487
  const u = {};
7483
7488
  i.bg && (u.bg = i.bg), i.textColor && (u.textColor = i.textColor), i.borderColor && (u.borderColor = i.borderColor), i.fontWeight && (u.fontWeight = i.fontWeight), Object.keys(u).length === 0 ? P.delete(t) : P.set(t, u), H.value = new Map(P);
7484
7489
  }
@@ -7486,42 +7491,42 @@ const Ea = ["viewBox", "width", "height"], xa = { class: "zm-edges" }, wa = ["d"
7486
7491
  return P.get(t) ?? {};
7487
7492
  }
7488
7493
  function se(t, i) {
7489
- const u = V(g.value, t);
7494
+ const u = V(f.value, t);
7490
7495
  u && (u.image = {
7491
7496
  src: i.src,
7492
7497
  naturalW: i.naturalW,
7493
7498
  naturalH: i.naturalH,
7494
7499
  width: ae(i.width, qe, an),
7495
7500
  height: ae(i.height, qe, an)
7496
- }, be(), le(), a("change", g.value));
7501
+ }, be(), le(), a("change", f.value));
7497
7502
  }
7498
7503
  function me(t) {
7499
- const i = V(g.value, t);
7500
- !i || !i.image || (delete i.image, be(), le(), a("change", g.value));
7504
+ const i = V(f.value, t);
7505
+ !i || !i.image || (delete i.image, be(), le(), a("change", f.value));
7501
7506
  }
7502
7507
  function X(t, i) {
7503
7508
  const u = i.trim();
7504
- if (!V(g.value, t)) return;
7509
+ if (!V(f.value, t)) return;
7505
7510
  if (!u) {
7506
7511
  me(t);
7507
7512
  return;
7508
7513
  }
7509
7514
  const v = new Image();
7510
7515
  v.onload = () => {
7511
- const _ = V(g.value, t);
7512
- if (!_) return;
7516
+ const N = V(f.value, t);
7517
+ if (!N) return;
7513
7518
  const O = v.naturalWidth && v.naturalHeight ? v.naturalWidth / v.naturalHeight : 1, U = ae(
7514
7519
  v.naturalWidth || Ke,
7515
7520
  qe,
7516
7521
  an
7517
7522
  ), ie = Math.round(U / O);
7518
- _.image = {
7523
+ N.image = {
7519
7524
  src: u,
7520
7525
  naturalW: v.naturalWidth || U,
7521
7526
  naturalH: v.naturalHeight || ie,
7522
7527
  width: U,
7523
7528
  height: ie
7524
- }, be(), le(), a("change", g.value);
7529
+ }, be(), le(), a("change", f.value);
7525
7530
  }, v.onerror = () => {
7526
7531
  }, v.src = u;
7527
7532
  }
@@ -7532,44 +7537,44 @@ const Ea = ["viewBox", "width", "height"], xa = { class: "zm-edges" }, wa = ["d"
7532
7537
  const u = new FileReader();
7533
7538
  u.onload = () => {
7534
7539
  if (typeof u.result != "string") return;
7535
- const k = u.result, v = new window.Image();
7540
+ const w = u.result, v = new window.Image();
7536
7541
  v.onload = () => {
7537
- const _ = v.naturalWidth || Ke, O = v.naturalHeight || Ke, U = ae(_, qe, Ke), ie = ae(Math.round(O * U / _), qe, an);
7538
- i({ src: k, naturalW: _, naturalH: O, width: U, height: ie });
7542
+ const N = v.naturalWidth || Ke, O = v.naturalHeight || Ke, U = ae(N, qe, Ke), ie = ae(Math.round(O * U / N), qe, an);
7543
+ i({ src: w, naturalW: N, naturalH: O, width: U, height: ie });
7539
7544
  }, v.onerror = () => {
7540
- i({ src: k, naturalW: Ke, naturalH: Ke, width: Ke, height: Ke });
7541
- }, v.src = k;
7545
+ i({ src: w, naturalW: Ke, naturalH: Ke, width: Ke, height: Ke });
7546
+ }, v.src = w;
7542
7547
  }, u.readAsDataURL(t);
7543
7548
  }
7544
7549
  function ve(t) {
7545
7550
  const i = document.createElement("input");
7546
7551
  i.type = "file", i.accept = "image/*", i.style.display = "none", i.onchange = () => {
7547
- var k;
7548
- const u = (k = i.files) == null ? void 0 : k[0];
7552
+ var w;
7553
+ const u = (w = i.files) == null ? void 0 : w[0];
7549
7554
  u && (fe(u, (v) => se(t, v)), document.body.removeChild(i));
7550
7555
  }, document.body.appendChild(i), i.click();
7551
7556
  }
7552
7557
  function ue(t, i) {
7553
- const u = i.trim(), k = V(g.value, t);
7554
- k && (u ? k.link = { url: u } : delete k.link, be(), le(), a("change", g.value));
7558
+ const u = i.trim(), w = V(f.value, t);
7559
+ w && (u ? w.link = { url: u } : delete w.link, be(), le(), a("change", f.value));
7555
7560
  }
7556
7561
  function ye(t) {
7557
7562
  ue(t, "");
7558
7563
  }
7559
7564
  function y(t, i) {
7560
- const u = V(g.value, t);
7561
- u && (i ? u.note = { text: i } : delete u.note, be(), le(), a("change", g.value));
7565
+ const u = V(f.value, t);
7566
+ u && (i ? u.note = { text: i } : delete u.note, be(), le(), a("change", f.value));
7562
7567
  }
7563
7568
  function A(t) {
7564
7569
  y(t, "");
7565
7570
  }
7566
- function S(t, i) {
7567
- const u = V(g.value, t);
7568
- u && (i ? u.richContent = i : delete u.richContent, be(), le(), a("change", g.value));
7571
+ function M(t, i) {
7572
+ const u = V(f.value, t);
7573
+ u && (i ? u.richContent = i : delete u.richContent, be(), le(), a("change", f.value));
7569
7574
  }
7570
7575
  const R = oe(null), F = oe(null);
7571
7576
  function ce(t, i) {
7572
- o.previewMode || (t.preventDefault(), t.stopPropagation(), c.value = i.id, a("select", V(g.value, i.id)), R.value = { nodeId: i.id, x: t.clientX, y: t.clientY });
7577
+ o.previewMode || (t.preventDefault(), t.stopPropagation(), c.value = i.id, a("select", V(f.value, i.id)), R.value = { nodeId: i.id, x: t.clientX, y: t.clientY });
7573
7578
  }
7574
7579
  function Ee() {
7575
7580
  R.value = null;
@@ -7577,7 +7582,7 @@ const Ea = ["viewBox", "width", "height"], xa = { class: "zm-edges" }, wa = ["d"
7577
7582
  function Me(t) {
7578
7583
  o.previewMode || (t.preventDefault(), R.value = null, F.value = { x: t.clientX, y: t.clientY });
7579
7584
  }
7580
- function ke() {
7585
+ function we() {
7581
7586
  F.value = null;
7582
7587
  }
7583
7588
  function Ce() {
@@ -7595,10 +7600,10 @@ const Ea = ["viewBox", "width", "height"], xa = { class: "zm-edges" }, wa = ["d"
7595
7600
  t && ve(t);
7596
7601
  }
7597
7602
  function Xn() {
7598
- var k, v, _;
7599
- const t = (k = R.value) == null ? void 0 : k.nodeId;
7603
+ var w, v, N;
7604
+ const t = (w = R.value) == null ? void 0 : w.nodeId;
7600
7605
  if (!t) return;
7601
- const i = ((_ = (v = V(g.value, t)) == null ? void 0 : v.link) == null ? void 0 : _.url) ?? "", u = window.prompt("输入链接 URL(留空取消)", i);
7606
+ const i = ((N = (v = V(f.value, t)) == null ? void 0 : v.link) == null ? void 0 : N.url) ?? "", u = window.prompt("输入链接 URL(留空取消)", i);
7602
7607
  u !== null && ue(t, u);
7603
7608
  }
7604
7609
  function qn() {
@@ -7625,7 +7630,7 @@ const Ea = ["viewBox", "width", "height"], xa = { class: "zm-edges" }, wa = ["d"
7625
7630
  var q, Ae;
7626
7631
  const t = (q = R.value) == null ? void 0 : q.nodeId;
7627
7632
  if (!t) return;
7628
- const i = (Ae = V(g.value, t)) == null ? void 0 : Ae.richContent, u = (i == null ? void 0 : i.kind) === "code" ? li(i.raw) : "", k = (i == null ? void 0 : i.kind) === "code" && i.lang || "", v = k ? "```" + k + `
7633
+ const i = (Ae = V(f.value, t)) == null ? void 0 : Ae.richContent, u = (i == null ? void 0 : i.kind) === "code" ? li(i.raw) : "", w = (i == null ? void 0 : i.kind) === "code" && i.lang || "", v = w ? "```" + w + `
7629
7634
  ` : "```\n", O = window.prompt(
7630
7635
  "输入代码块内容(用 ```lang 包裹;留空取消)",
7631
7636
  u ? v + u + (u.endsWith("```") ? "" : "\n```") : v + "// 你的代码" + "\n```"
@@ -7633,39 +7638,39 @@ const Ea = ["viewBox", "width", "height"], xa = { class: "zm-edges" }, wa = ["d"
7633
7638
  if (O === null) return;
7634
7639
  const U = O.trim();
7635
7640
  if (!U) {
7636
- S(t, null);
7641
+ M(t, null);
7637
7642
  return;
7638
7643
  }
7639
7644
  const ie = /^```([^\s`]*)/.exec(U), m = ie ? ie[1] : void 0;
7640
- S(t, { kind: "code", raw: U, lang: m });
7645
+ M(t, { kind: "code", raw: U, lang: m });
7641
7646
  }
7642
7647
  function Te() {
7643
7648
  var i;
7644
7649
  const t = (i = R.value) == null ? void 0 : i.nodeId;
7645
- t && S(t, null);
7650
+ t && M(t, null);
7646
7651
  }
7647
7652
  function Sn() {
7648
7653
  var O, U;
7649
7654
  const t = (O = R.value) == null ? void 0 : O.nodeId;
7650
7655
  if (!t) return;
7651
- const i = (U = V(g.value, t)) == null ? void 0 : U.richContent, u = (i == null ? void 0 : i.kind) === "table" ? i.raw : "", v = window.prompt(
7656
+ const i = (U = V(f.value, t)) == null ? void 0 : U.richContent, u = (i == null ? void 0 : i.kind) === "table" ? i.raw : "", v = window.prompt(
7652
7657
  "输入 markdown 表格(每行以 | 分隔;留空取消)",
7653
7658
  u || `| 列1 | 列2 | 列3 |
7654
7659
  | --- | --- | --- |
7655
7660
  | a | b | c |`
7656
7661
  );
7657
7662
  if (v === null) return;
7658
- const _ = v.trim();
7659
- if (!_) {
7660
- S(t, null);
7663
+ const N = v.trim();
7664
+ if (!N) {
7665
+ M(t, null);
7661
7666
  return;
7662
7667
  }
7663
- S(t, { kind: "table", raw: _ });
7668
+ M(t, { kind: "table", raw: N });
7664
7669
  }
7665
7670
  function dn() {
7666
7671
  var i;
7667
7672
  const t = (i = R.value) == null ? void 0 : i.nodeId;
7668
- t && S(t, null);
7673
+ t && M(t, null);
7669
7674
  }
7670
7675
  function $(t) {
7671
7676
  o.previewMode || a("edit-note", t);
@@ -7682,15 +7687,15 @@ const Ea = ["viewBox", "width", "height"], xa = { class: "zm-edges" }, wa = ["d"
7682
7687
  return;
7683
7688
  const u = c.value;
7684
7689
  if (!u) return;
7685
- const k = (v = t.clipboardData) == null ? void 0 : v.items;
7686
- if (k)
7687
- for (let _ = 0; _ < k.length; _++) {
7688
- const O = k[_];
7690
+ const w = (v = t.clipboardData) == null ? void 0 : v.items;
7691
+ if (w)
7692
+ for (let N = 0; N < w.length; N++) {
7693
+ const O = w[N];
7689
7694
  if (O.kind === "file" && O.type.startsWith("image/")) {
7690
7695
  const U = O.getAsFile();
7691
7696
  if (!U) continue;
7692
7697
  t.preventDefault();
7693
- const ie = V(g.value, u);
7698
+ const ie = V(f.value, u);
7694
7699
  if (ie != null && ie.image && !window.confirm("该节点已有图片,要用剪贴板里的图片替换吗?"))
7695
7700
  return;
7696
7701
  fe(U, (m) => se(u, m));
@@ -7703,14 +7708,14 @@ const Ea = ["viewBox", "width", "height"], xa = { class: "zm-edges" }, wa = ["d"
7703
7708
  }), En(() => {
7704
7709
  window.removeEventListener("paste", pe);
7705
7710
  });
7706
- const j = oe(null), Qe = we(() => {
7711
+ const j = oe(null), Qe = ke(() => {
7707
7712
  var t;
7708
7713
  return ((t = j.value) == null ? void 0 : t.nodeId) ?? null;
7709
7714
  });
7710
- function He(t, i) {
7715
+ function Ue(t, i) {
7711
7716
  if (!i.image) return;
7712
7717
  t.preventDefault(), t.stopPropagation();
7713
- const u = i.image.naturalW || i.image.width, k = i.image.naturalH || i.image.height, v = k > 0 ? k / u : 1;
7718
+ const u = i.image.naturalW || i.image.width, w = i.image.naturalH || i.image.height, v = w > 0 ? w / u : 1;
7714
7719
  j.value = {
7715
7720
  nodeId: i.id,
7716
7721
  startX: t.clientX,
@@ -7718,7 +7723,7 @@ const Ea = ["viewBox", "width", "height"], xa = { class: "zm-edges" }, wa = ["d"
7718
7723
  startW: i.image.width,
7719
7724
  startH: i.image.height,
7720
7725
  naturalW: u,
7721
- naturalH: k,
7726
+ naturalH: w,
7722
7727
  ratio: v,
7723
7728
  pendingW: i.image.width,
7724
7729
  pendingH: i.image.height
@@ -7728,21 +7733,21 @@ const Ea = ["viewBox", "width", "height"], xa = { class: "zm-edges" }, wa = ["d"
7728
7733
  var ie, m;
7729
7734
  const i = j.value;
7730
7735
  if (!i) return;
7731
- const u = G.scale.value || 1, k = t.clientX - i.startX, v = ae(i.startW + k / u, qe, an), _ = ae(v * i.ratio, qe, an);
7732
- i.pendingW = v, i.pendingH = _;
7736
+ const u = G.scale.value || 1, w = t.clientX - i.startX, v = ae(i.startW + w / u, qe, an), N = ae(v * i.ratio, qe, an);
7737
+ i.pendingW = v, i.pendingH = N;
7733
7738
  const O = (ie = d.value) == null ? void 0 : ie.querySelector(
7734
7739
  `[data-node-id="${i.nodeId}"] .zm-node-img`
7735
7740
  );
7736
- O && (O.style.width = `${v}px`, O.style.height = `${_}px`);
7741
+ O && (O.style.width = `${v}px`, O.style.height = `${N}px`);
7737
7742
  const U = (m = d.value) == null ? void 0 : m.querySelector(
7738
7743
  `[data-node-id="${i.nodeId}"]`
7739
7744
  );
7740
- U && (U.style.minWidth = `${Math.max(80, Math.ceil(v + 28))}px`, U.style.height = `${Math.ceil(_ + 8 + 30)}px`);
7745
+ U && (U.style.minWidth = `${Math.max(80, Math.ceil(v + 28))}px`, U.style.height = `${Math.ceil(N + 8 + 30)}px`);
7741
7746
  }
7742
7747
  function nn() {
7743
7748
  const t = j.value;
7744
7749
  if (window.removeEventListener("mousemove", en), window.removeEventListener("mouseup", nn), j.value = null, !t) return;
7745
- const i = V(g.value, t.nodeId);
7750
+ const i = V(f.value, t.nodeId);
7746
7751
  !i || !i.image || (se(t.nodeId, {
7747
7752
  src: i.image.src,
7748
7753
  naturalW: i.image.naturalW,
@@ -7751,49 +7756,49 @@ const Ea = ["viewBox", "width", "height"], xa = { class: "zm-edges" }, wa = ["d"
7751
7756
  height: t.pendingH
7752
7757
  }), c.value = t.nodeId, a("select", i), I = !0);
7753
7758
  }
7754
- const N = oe(null);
7759
+ const S = oe(null);
7755
7760
  let I = !1;
7756
7761
  function W(t) {
7757
- N.value = t;
7762
+ S.value = t;
7758
7763
  }
7759
7764
  function Q(t) {
7760
- N.value === t && (N.value = null);
7765
+ S.value === t && (S.value = null);
7761
7766
  }
7762
7767
  const he = oe(0), Ne = oe(!1), De = tr(100);
7763
7768
  function be() {
7764
- De.record({ data: g.value });
7769
+ De.record({ data: f.value });
7765
7770
  }
7766
7771
  function le() {
7767
- f.value = new Set(f.value), he.value++, xe().then(() => xe()).then(() => Pi()).then(() => {
7772
+ g.value = new Set(g.value), he.value++, xe().then(() => xe()).then(() => Pi()).then(() => {
7768
7773
  he.value++;
7769
7774
  });
7770
7775
  }
7771
7776
  function Pi() {
7772
7777
  const t = document.querySelectorAll(".zm-rich"), i = {}, u = {};
7773
- t.forEach((k) => {
7774
- let v = k, _ = null;
7775
- for (; v && !_; )
7776
- _ = v.getAttribute("data-node-id"), v = v.parentElement;
7777
- if (!_) return;
7778
- const O = k.offsetHeight, U = k.scrollWidth, ie = Math.round(O * 2) / 2, m = Math.round(U * 2) / 2;
7779
- i[_] = ie, u[_] = m, L.value[_], M.value[_];
7780
- }), L.value = i, M.value = u;
7781
- }
7782
- const Le = we(() => {
7783
- var t, i, u, k, v, _, O, U, ie, m;
7778
+ t.forEach((w) => {
7779
+ let v = w, N = null;
7780
+ for (; v && !N; )
7781
+ N = v.getAttribute("data-node-id"), v = v.parentElement;
7782
+ if (!N) return;
7783
+ const O = w.offsetHeight, U = w.scrollWidth, ie = Math.round(O * 2) / 2, m = Math.round(U * 2) / 2;
7784
+ i[N] = ie, u[N] = m, k.value[N], z.value[N];
7785
+ }), k.value = i, z.value = u;
7786
+ }
7787
+ const Le = ke(() => {
7788
+ var t, i, u, w, v, N, O, U, ie, m;
7784
7789
  return {
7785
7790
  rootBg: ((t = o.theme) == null ? void 0 : t.rootBg) ?? "#1f2937",
7786
7791
  rootText: ((i = o.theme) == null ? void 0 : i.rootText) ?? "#ffffff",
7787
7792
  branchBg: ((u = o.theme) == null ? void 0 : u.branchBg) ?? "#ffffff",
7788
- branchText: ((k = o.theme) == null ? void 0 : k.branchText) ?? "#1f2937",
7793
+ branchText: ((w = o.theme) == null ? void 0 : w.branchText) ?? "#1f2937",
7789
7794
  lineColor: ((v = o.theme) == null ? void 0 : v.lineColor) ?? "#94a3b8",
7790
- bgColor: ((_ = o.theme) == null ? void 0 : _.bgColor) ?? "#f8fafc",
7795
+ bgColor: ((N = o.theme) == null ? void 0 : N.bgColor) ?? "#f8fafc",
7791
7796
  fontSize: ((O = o.theme) == null ? void 0 : O.fontSize) ?? 14,
7792
7797
  lineWidthStart: ((U = o.theme) == null ? void 0 : U.lineWidthStart) ?? 2.2,
7793
7798
  lineWidthEnd: ((ie = o.theme) == null ? void 0 : ie.lineWidthEnd) ?? 0.8,
7794
7799
  rainbowBranch: ((m = o.theme) == null ? void 0 : m.rainbowBranch) ?? !1
7795
7800
  };
7796
- }), B = Un({
7801
+ }), L = Un({
7797
7802
  autoBalanceOnChange: !0,
7798
7803
  lineWidthStart: 12,
7799
7804
  lineWidthEnd: 3.6,
@@ -7806,44 +7811,44 @@ const Ea = ["viewBox", "width", "height"], xa = { class: "zm-edges" }, wa = ["d"
7806
7811
  showOrderBadge: !1
7807
7812
  });
7808
7813
  function ht(t) {
7809
- return B.taperedEdge ? Ui(t) : vt(t);
7814
+ return L.taperedEdge ? Ui(t) : vt(t);
7810
7815
  }
7811
7816
  function bt(t) {
7812
- return B.taperedEdge ? B.lineWidthEnd : vt(t);
7817
+ return L.taperedEdge ? L.lineWidthEnd : vt(t);
7813
7818
  }
7814
7819
  function Ui(t) {
7815
- return t <= 0 ? B.lineWidthStart : t === 1 ? Math.max(1.5, B.lineWidthStart * 0.67) : t === 2 ? Math.max(0.8, B.lineWidthStart * 0.42) : B.lineWidthEnd;
7820
+ return t <= 0 ? L.lineWidthStart : t === 1 ? Math.max(1.5, L.lineWidthStart * 0.67) : t === 2 ? Math.max(0.8, L.lineWidthStart * 0.42) : L.lineWidthEnd;
7816
7821
  }
7817
7822
  function vt(t) {
7818
- if (t <= 0) return B.lineWidthStart;
7819
- if (t >= 3) return B.lineWidthEnd;
7823
+ if (t <= 0) return L.lineWidthStart;
7824
+ if (t >= 3) return L.lineWidthEnd;
7820
7825
  const i = t / 3;
7821
- return B.lineWidthStart + (B.lineWidthEnd - B.lineWidthStart) * i;
7826
+ return L.lineWidthStart + (L.lineWidthEnd - L.lineWidthStart) * i;
7822
7827
  }
7823
- function Hi(t, i, u, k) {
7824
- const v = 1 - t, _ = v * v * v * i.x + 3 * v * v * t * u.x1 + 3 * v * t * t * u.x2 + t * t * t * k.x, O = v * v * v * i.y + 3 * v * v * t * u.y1 + 3 * v * t * t * u.y2 + t * t * t * k.y;
7825
- return { x: _, y: O };
7828
+ function Hi(t, i, u, w) {
7829
+ const v = 1 - t, N = v * v * v * i.x + 3 * v * v * t * u.x1 + 3 * v * t * t * u.x2 + t * t * t * w.x, O = v * v * v * i.y + 3 * v * v * t * u.y1 + 3 * v * t * t * u.y2 + t * t * t * w.y;
7830
+ return { x: N, y: O };
7826
7831
  }
7827
- function Wi(t, i, u, k, v = 32, _ = "curve", O = "right") {
7828
- if (_ === "curve") {
7832
+ function Wi(t, i, u, w, v = 32, N = "curve", O = "right") {
7833
+ if (N === "curve") {
7829
7834
  let ze;
7830
7835
  if (O === "right" || O === "left") {
7831
- const de = Math.abs(i.x - t.x) * 0.45, Fe = O === "right" ? 1 : -1;
7832
- ze = { x1: t.x + Fe * de, y1: t.y, x2: i.x - Fe * de, y2: i.y };
7836
+ const de = Math.abs(i.x - t.x) * 0.45, We = O === "right" ? 1 : -1;
7837
+ ze = { x1: t.x + We * de, y1: t.y, x2: i.x - We * de, y2: i.y };
7833
7838
  } else {
7834
7839
  const de = Math.abs(i.y - t.y) * 0.45;
7835
7840
  ze = { x1: t.x, y1: t.y + de, x2: i.x, y2: i.y - de };
7836
7841
  }
7837
7842
  const Dt = (ee) => {
7838
- const de = 1 - ee, Fe = -3 * de * de * t.x + 3 * (de * de - 2 * de * ee) * ze.x1 + 3 * (2 * de * ee - ee * ee) * ze.x2 + 3 * ee * ee * i.x, on = -3 * de * de * t.y + 3 * (de * de - 2 * de * ee) * ze.y1 + 3 * (2 * de * ee - ee * ee) * ze.y2 + 3 * ee * ee * i.y;
7839
- return { dx: Fe, dy: on };
7843
+ const de = 1 - ee, We = -3 * de * de * t.x + 3 * (de * de - 2 * de * ee) * ze.x1 + 3 * (2 * de * ee - ee * ee) * ze.x2 + 3 * ee * ee * i.x, on = -3 * de * de * t.y + 3 * (de * de - 2 * de * ee) * ze.y1 + 3 * (2 * de * ee - ee * ee) * ze.y2 + 3 * ee * ee * i.y;
7844
+ return { dx: We, dy: on };
7840
7845
  }, bn = [], it = [];
7841
7846
  for (let ee = 0; ee <= v; ee++) {
7842
- const de = ee / v, Fe = ee === 0 ? t : ee === v ? i : Hi(de, t, ze, i), on = Dt(de);
7847
+ const de = ee / v, We = ee === 0 ? t : ee === v ? i : Hi(de, t, ze, i), on = Dt(de);
7843
7848
  let On = Math.hypot(on.dx, on.dy);
7844
7849
  On < 1e-6 && (On = 1);
7845
- const Bt = -on.dy / On, zt = on.dx / On, In = (u + (k - u) * de) / 2;
7846
- bn.push({ x: Fe.x + Bt * In, y: Fe.y + zt * In }), it.push({ x: Fe.x - Bt * In, y: Fe.y - zt * In });
7850
+ const Bt = -on.dy / On, zt = on.dx / On, In = (u + (w - u) * de) / 2;
7851
+ bn.push({ x: We.x + Bt * In, y: We.y + zt * In }), it.push({ x: We.x - Bt * In, y: We.y - zt * In });
7847
7852
  }
7848
7853
  let Rn = `M ${bn[0].x.toFixed(2)} ${bn[0].y.toFixed(2)}`;
7849
7854
  for (let ee = 1; ee <= v; ee++) Rn += ` L ${bn[ee].x.toFixed(2)} ${bn[ee].y.toFixed(2)}`;
@@ -7853,37 +7858,37 @@ const Ea = ["viewBox", "width", "height"], xa = { class: "zm-edges" }, wa = ["d"
7853
7858
  const U = i.x - t.x, ie = i.y - t.y;
7854
7859
  let m = Math.hypot(U, ie);
7855
7860
  m < 1e-6 && (m = 1);
7856
- const q = -ie / m, Ae = U / m, Be = u / 2, _e = k / 2, gn = { x: t.x + q * Be, y: t.y + Ae * Be }, mn = { x: t.x - q * Be, y: t.y - Ae * Be }, pn = { x: i.x - q * _e, y: i.y - Ae * _e }, hn = { x: i.x + q * _e, y: i.y + Ae * _e };
7861
+ const q = -ie / m, Ae = U / m, Be = u / 2, _e = w / 2, gn = { x: t.x + q * Be, y: t.y + Ae * Be }, mn = { x: t.x - q * Be, y: t.y - Ae * Be }, pn = { x: i.x - q * _e, y: i.y - Ae * _e }, hn = { x: i.x + q * _e, y: i.y + Ae * _e };
7857
7862
  return `M ${gn.x.toFixed(2)} ${gn.y.toFixed(2)} L ${hn.x.toFixed(2)} ${hn.y.toFixed(2)} L ${pn.x.toFixed(2)} ${pn.y.toFixed(2)} L ${mn.x.toFixed(2)} ${mn.y.toFixed(2)} Z`;
7858
7863
  }
7859
- const Cn = we(() => Se.value.root.children), Fi = yn[0].colors, yt = we(
7860
- () => Ko(B.branchPaletteId, B.customPalettes)
7861
- ), Xe = we(() => {
7864
+ const Cn = ke(() => Se.value.root.children), Fi = yn[0].colors, yt = ke(
7865
+ () => Ko(L.branchPaletteId, L.customPalettes)
7866
+ ), Xe = ke(() => {
7862
7867
  const t = /* @__PURE__ */ new Map();
7863
- if (!B.rainbowBranch) return t;
7868
+ if (!L.rainbowBranch) return t;
7864
7869
  const i = o.lineColors, u = i && i.length > 0 ? i : yt.value.colors.length > 0 ? yt.value.colors : Fi;
7865
7870
  for (let v = 0; v < Cn.value.length; v++) {
7866
- const _ = Cn.value[v];
7867
- t.set(_.id, u[v % u.length]);
7871
+ const N = Cn.value[v];
7872
+ t.set(N.id, u[v % u.length]);
7868
7873
  }
7869
- const k = (v, _) => {
7870
- t.set(v.id, _);
7871
- for (const O of v.children) k(O, _);
7874
+ const w = (v, N) => {
7875
+ t.set(v.id, N);
7876
+ for (const O of v.children) w(O, N);
7872
7877
  };
7873
7878
  for (let v = 0; v < Cn.value.length; v++) {
7874
- const _ = Cn.value[v];
7875
- k(_, u[v % u.length]);
7879
+ const N = Cn.value[v];
7880
+ w(N, u[v % u.length]);
7876
7881
  }
7877
7882
  return t;
7878
7883
  });
7879
7884
  function Gi(t, i) {
7880
- return B.rainbowBranch ? Xe.value.get(i.id) ?? Le.value.lineColor : Le.value.lineColor;
7885
+ return L.rainbowBranch ? Xe.value.get(i.id) ?? Le.value.lineColor : Le.value.lineColor;
7881
7886
  }
7882
7887
  function Ki(t) {
7883
7888
  const i = re(t.id);
7884
7889
  if (i.bg) return i.bg;
7885
7890
  if (t.isRoot) return Le.value.rootBg;
7886
- if (B.rainbowBranch) {
7891
+ if (L.rainbowBranch) {
7887
7892
  const u = Xe.value.get(t.id);
7888
7893
  if (u) return qi(u, 0.18);
7889
7894
  }
@@ -7893,7 +7898,7 @@ const Ea = ["viewBox", "width", "height"], xa = { class: "zm-edges" }, wa = ["d"
7893
7898
  const i = re(t.id);
7894
7899
  if (i.textColor) return i.textColor;
7895
7900
  if (t.isRoot) return Le.value.rootText;
7896
- if (B.rainbowBranch) {
7901
+ if (L.rainbowBranch) {
7897
7902
  const u = Xe.value.get(t.id);
7898
7903
  if (u) return Et(u, 0.55);
7899
7904
  }
@@ -7903,7 +7908,7 @@ const Ea = ["viewBox", "width", "height"], xa = { class: "zm-edges" }, wa = ["d"
7903
7908
  const i = re(t.id);
7904
7909
  if (i.borderColor) return i.borderColor;
7905
7910
  if (t.isRoot) return Le.value.rootBg;
7906
- if (B.rainbowBranch) {
7911
+ if (L.rainbowBranch) {
7907
7912
  const u = Xe.value.get(t.id);
7908
7913
  if (u) return Et(u, 0.3);
7909
7914
  }
@@ -7913,22 +7918,22 @@ const Ea = ["viewBox", "width", "height"], xa = { class: "zm-edges" }, wa = ["d"
7913
7918
  return re(t.id).fontWeight ?? (t.isRoot ? 600 : 400);
7914
7919
  }
7915
7920
  function qi(t, i) {
7916
- const u = t.replace("#", ""), k = u.length === 6 ? u : u.split("").map((U) => U + U).join(""), v = parseInt(k.slice(0, 2), 16), _ = parseInt(k.slice(2, 4), 16), O = parseInt(k.slice(4, 6), 16);
7917
- return `rgba(${v}, ${_}, ${O}, ${i})`;
7921
+ const u = t.replace("#", ""), w = u.length === 6 ? u : u.split("").map((U) => U + U).join(""), v = parseInt(w.slice(0, 2), 16), N = parseInt(w.slice(2, 4), 16), O = parseInt(w.slice(4, 6), 16);
7922
+ return `rgba(${v}, ${N}, ${O}, ${i})`;
7918
7923
  }
7919
7924
  function Et(t, i) {
7920
- const u = t.replace("#", ""), k = u.length === 6 ? u : u.split("").map((U) => U + U).join(""), v = Math.round(parseInt(k.slice(0, 2), 16) * (1 - i)), _ = Math.round(parseInt(k.slice(2, 4), 16) * (1 - i)), O = Math.round(parseInt(k.slice(4, 6), 16) * (1 - i));
7921
- return `rgb(${v}, ${_}, ${O})`;
7925
+ const u = t.replace("#", ""), w = u.length === 6 ? u : u.split("").map((U) => U + U).join(""), v = Math.round(parseInt(w.slice(0, 2), 16) * (1 - i)), N = Math.round(parseInt(w.slice(2, 4), 16) * (1 - i)), O = Math.round(parseInt(w.slice(4, 6), 16) * (1 - i));
7926
+ return `rgb(${v}, ${N}, ${O})`;
7922
7927
  }
7923
7928
  const G = Qo({ getContainer: () => d.value });
7924
7929
  G.setOnMarqueeEnd(po), nr({
7925
7930
  isEditing: () => s.value !== null,
7926
7931
  isReadonly: () => o.previewMode,
7927
7932
  getSelectedId: () => c.value,
7928
- getRootId: () => g.value.id,
7933
+ getRootId: () => f.value.id,
7929
7934
  // If nothing is selected, default Tab/Enter to the root so the user
7930
7935
  // can build a tree from scratch without first clicking somewhere.
7931
- defaultTargetId: () => g.value.id,
7936
+ defaultTargetId: () => f.value.id,
7932
7937
  onAddChild: tn,
7933
7938
  onAddSibling: An,
7934
7939
  onAddSiblingBefore: _t,
@@ -7942,42 +7947,42 @@ const Ea = ["viewBox", "width", "height"], xa = { class: "zm-edges" }, wa = ["d"
7942
7947
  onRedo: et,
7943
7948
  onNavigate: ao,
7944
7949
  onSelectRoot: () => {
7945
- c.value = g.value.id;
7946
- const t = V(g.value, g.value.id);
7950
+ c.value = f.value.id;
7951
+ const t = V(f.value, f.value.id);
7947
7952
  t && a("select", t);
7948
7953
  }
7949
7954
  });
7950
- const Se = we(() => {
7951
- const t = Ye(g.value);
7955
+ const Se = ke(() => {
7956
+ const t = Ye(f.value);
7952
7957
  return wt(t), Ho(t, {
7953
- mode: B.layoutMode,
7958
+ mode: L.layoutMode,
7954
7959
  baseFontSize: Le.value.fontSize,
7955
- richHeights: L.value,
7956
- richWidths: M.value
7960
+ richHeights: k.value,
7961
+ richWidths: z.value
7957
7962
  });
7958
- }), xt = oe([]), jn = we(() => (he.value, xt.value));
7963
+ }), xt = oe([]), jn = ke(() => (he.value, xt.value));
7959
7964
  Ln(
7960
7965
  Se,
7961
7966
  (t) => {
7962
- const i = [], u = (k) => {
7963
- i.push(k);
7964
- for (const v of k.children) u(v);
7967
+ const i = [], u = (w) => {
7968
+ i.push(w);
7969
+ for (const v of w.children) u(v);
7965
7970
  };
7966
7971
  u(t.root), xt.value = i;
7967
7972
  },
7968
7973
  { immediate: !0 }
7969
7974
  );
7970
- const Vi = we(() => {
7975
+ const Vi = ke(() => {
7971
7976
  const t = [];
7972
7977
  for (const i of jn.value)
7973
7978
  for (const u of i.children)
7974
7979
  t.push({ from: i, to: u, key: `${i.id}->${u.id}` });
7975
7980
  return t;
7976
- }), Ji = we(
7981
+ }), Ji = ke(
7977
7982
  () => `${Se.value.vbX} ${Se.value.vbY} ${Se.value.vbW} ${Se.value.vbH}`
7978
7983
  );
7979
7984
  function wt(t) {
7980
- if (f.value.has(t.id)) {
7985
+ if (g.value.has(t.id)) {
7981
7986
  t.children = [], t.collapsed = !0;
7982
7987
  return;
7983
7988
  }
@@ -7985,7 +7990,7 @@ const Ea = ["viewBox", "width", "height"], xa = { class: "zm-edges" }, wa = ["d"
7985
7990
  for (const i of t.children) wt(i);
7986
7991
  }
7987
7992
  function fn(t) {
7988
- const i = V(g.value, t);
7993
+ const i = V(f.value, t);
7989
7994
  i && (s.value = t, l.value = i.text, xe(() => {
7990
7995
  const u = document.querySelector(".zm-input");
7991
7996
  u == null || u.focus(), u == null || u.select();
@@ -7993,8 +7998,8 @@ const Ea = ["viewBox", "width", "height"], xa = { class: "zm-edges" }, wa = ["d"
7993
7998
  }
7994
7999
  function Tn(t = {}) {
7995
8000
  if (!s.value) return;
7996
- const i = V(g.value, s.value);
7997
- i && i.text !== (l.value.trim() || " ") && (i.text = l.value.trim() || " ", be(), a("change", g.value));
8001
+ const i = V(f.value, s.value);
8002
+ i && i.text !== (l.value.trim() || " ") && (i.text = l.value.trim() || " ", be(), a("change", f.value));
7998
8003
  const u = s.value;
7999
8004
  s.value = null, t.addChild ? xe(() => tn(u)) : t.addSibling === "after" ? xe(() => An(u)) : t.addSibling === "before" && xe(() => _t(u));
8000
8005
  }
@@ -8003,7 +8008,7 @@ const Ea = ["viewBox", "width", "height"], xa = { class: "zm-edges" }, wa = ["d"
8003
8008
  }
8004
8009
  function Qi(t) {
8005
8010
  if (o.previewMode) return;
8006
- const i = V(g.value, t);
8011
+ const i = V(f.value, t);
8007
8012
  i != null && i.richContent && (b.value = t, x.value = i.richContent.raw, xe(() => {
8008
8013
  const u = document.querySelector(
8009
8014
  ".zm-node .zm-rich textarea"
@@ -8013,13 +8018,13 @@ const Ea = ["viewBox", "width", "height"], xa = { class: "zm-edges" }, wa = ["d"
8013
8018
  }
8014
8019
  function kt() {
8015
8020
  if (!b.value) return;
8016
- const t = b.value, i = V(g.value, t), u = x.value;
8021
+ const t = b.value, i = V(f.value, t), u = x.value;
8017
8022
  if (i && i.richContent && i.richContent.raw !== u)
8018
8023
  if (i.richContent.kind === "code") {
8019
- const k = ci(u) || void 0;
8020
- S(t, { kind: "code", raw: u, lang: k });
8024
+ const w = ci(u) || void 0;
8025
+ M(t, { kind: "code", raw: u, lang: w });
8021
8026
  } else
8022
- S(t, { kind: "table", raw: u });
8027
+ M(t, { kind: "table", raw: u });
8023
8028
  b.value = null;
8024
8029
  }
8025
8030
  function eo() {
@@ -8045,101 +8050,101 @@ const Ea = ["viewBox", "width", "height"], xa = { class: "zm-edges" }, wa = ["d"
8045
8050
  i && (t.key === "z" || t.key === "Z") && !t.shiftKey ? (t.preventDefault(), Qn()) : (i && t.shiftKey && (t.key === "z" || t.key === "Z") || i && (t.key === "y" || t.key === "Y") && !t.shiftKey) && (t.preventDefault(), et());
8046
8051
  }
8047
8052
  function tn(t) {
8048
- const i = Xo(g.value, t, Wn);
8049
- i && (be(), le(), a("change", g.value), xe(() => fn(i.id)));
8053
+ const i = Xo(f.value, t, Wn);
8054
+ i && (be(), le(), a("change", f.value), xe(() => fn(i.id)));
8050
8055
  }
8051
8056
  function An(t) {
8052
- if (t === g.value.id) {
8057
+ if (t === f.value.id) {
8053
8058
  tn(t);
8054
8059
  return;
8055
8060
  }
8056
- const i = qo(g.value, t, Wn);
8057
- i && (be(), le(), a("change", g.value), xe(() => fn(i.id)));
8061
+ const i = qo(f.value, t, Wn);
8062
+ i && (be(), le(), a("change", f.value), xe(() => fn(i.id)));
8058
8063
  }
8059
8064
  function _t(t) {
8060
- if (t === g.value.id) {
8065
+ if (t === f.value.id) {
8061
8066
  tn(t);
8062
8067
  return;
8063
8068
  }
8064
- const i = Vo(g.value, t, Wn);
8065
- i && (be(), le(), a("change", g.value), xe(() => fn(i.id)));
8069
+ const i = Vo(f.value, t, Wn);
8070
+ i && (be(), le(), a("change", f.value), xe(() => fn(i.id)));
8066
8071
  }
8067
8072
  function Nt(t) {
8068
- if (t === g.value.id) return;
8069
- const i = Jo(g.value, t);
8070
- i && (be(), c.value = i.id, a("change", g.value), le());
8073
+ if (t === f.value.id) return;
8074
+ const i = Jo(f.value, t);
8075
+ i && (be(), c.value = i.id, a("change", f.value), le());
8071
8076
  }
8072
8077
  function Qn() {
8073
8078
  const t = De.undo();
8074
- t && (g.value = t.data, c.value = null, a("select", null), le(), a("change", g.value));
8079
+ t && (f.value = t.data, c.value = null, a("select", null), le(), a("change", f.value));
8075
8080
  }
8076
8081
  function et() {
8077
8082
  const t = De.redo();
8078
- t && (g.value = t.data, c.value = null, a("select", null), le(), a("change", g.value));
8083
+ t && (f.value = t.data, c.value = null, a("select", null), le(), a("change", f.value));
8079
8084
  }
8080
8085
  function ao(t, i) {
8081
- const u = c.value ?? g.value.id, k = V(g.value, u);
8082
- if (!k) return;
8086
+ const u = c.value ?? f.value.id, w = V(f.value, u);
8087
+ if (!w) return;
8083
8088
  let v = null;
8084
8089
  if (i === 1) {
8085
- const _ = Ue(g.value, k.id);
8086
- if (_) {
8087
- const O = _.children.findIndex((U) => U.id === k.id);
8088
- O >= 0 && O < _.children.length - 1 && (v = _.children[O + 1].id);
8090
+ const N = Pe(f.value, w.id);
8091
+ if (N) {
8092
+ const O = N.children.findIndex((U) => U.id === w.id);
8093
+ O >= 0 && O < N.children.length - 1 && (v = N.children[O + 1].id);
8089
8094
  }
8090
8095
  } else if (i === -1) {
8091
- const _ = Ue(g.value, k.id);
8092
- if (_) {
8093
- const O = _.children.findIndex((U) => U.id === k.id);
8094
- O > 0 && (v = _.children[O - 1].id);
8096
+ const N = Pe(f.value, w.id);
8097
+ if (N) {
8098
+ const O = N.children.findIndex((U) => U.id === w.id);
8099
+ O > 0 && (v = N.children[O - 1].id);
8095
8100
  }
8096
8101
  } else if (t === 1) {
8097
- const _ = Ue(g.value, k.id);
8098
- _ && (v = _.id);
8099
- } else t === -1 && k.children.length > 0 && (v = k.children[0].id);
8102
+ const N = Pe(f.value, w.id);
8103
+ N && (v = N.id);
8104
+ } else t === -1 && w.children.length > 0 && (v = w.children[0].id);
8100
8105
  if (v) {
8101
8106
  c.value = v;
8102
- const _ = V(g.value, v);
8103
- _ && a("select", _);
8107
+ const N = V(f.value, v);
8108
+ N && a("select", N);
8104
8109
  }
8105
8110
  }
8106
8111
  function St(t) {
8107
- t !== g.value.id && gi(g.value, t) && (be(), c.value === t && (c.value = null), le(), a("change", g.value));
8112
+ t !== f.value.id && gi(f.value, t) && (be(), c.value === t && (c.value = null), le(), a("change", f.value));
8108
8113
  }
8109
8114
  function Mt(t) {
8110
- f.value.has(t) ? f.value.delete(t) : f.value.add(t), le();
8115
+ g.value.has(t) ? g.value.delete(t) : g.value.add(t), le();
8111
8116
  }
8112
8117
  function Ct(t) {
8113
- const i = [{ n: g.value, depth: 1 }];
8118
+ const i = [{ n: f.value, depth: 1 }];
8114
8119
  for (; i.length; ) {
8115
- const { n: u, depth: k } = i.pop();
8116
- t(u, k);
8120
+ const { n: u, depth: w } = i.pop();
8121
+ t(u, w);
8117
8122
  for (let v = u.children.length - 1; v >= 0; v--)
8118
- i.push({ n: u.children[v], depth: k + 1 });
8123
+ i.push({ n: u.children[v], depth: w + 1 });
8119
8124
  }
8120
8125
  }
8121
8126
  function so() {
8122
- f.value = /* @__PURE__ */ new Set(), Ct((t) => {
8123
- t.children.length > 0 && f.value.add(t.id);
8127
+ g.value = /* @__PURE__ */ new Set(), Ct((t) => {
8128
+ t.children.length > 0 && g.value.add(t.id);
8124
8129
  }), le();
8125
8130
  }
8126
8131
  function Tt(t) {
8127
- f.value = /* @__PURE__ */ new Set(), Ct((i, u) => {
8128
- u > t && i.children.length > 0 && f.value.add(i.id);
8132
+ g.value = /* @__PURE__ */ new Set(), Ct((i, u) => {
8133
+ u > t && i.children.length > 0 && g.value.add(i.id);
8129
8134
  }), le();
8130
8135
  }
8131
8136
  function lo() {
8132
- f.value = /* @__PURE__ */ new Set(), le();
8137
+ g.value = /* @__PURE__ */ new Set(), le();
8133
8138
  }
8134
8139
  function co(t, i) {
8135
- Yo(g.value, t, i) && (be(), le(), a("change", g.value));
8140
+ Yo(f.value, t, i) && (be(), le(), a("change", f.value));
8136
8141
  }
8137
8142
  function uo(t, i, u) {
8138
- return Zo(g.value, t, i, u) ? (be(), le(), a("change", g.value), !0) : !1;
8143
+ return Zo(f.value, t, i, u) ? (be(), le(), a("change", f.value), !0) : !1;
8139
8144
  }
8140
8145
  function fo(t, i) {
8141
8146
  t.stopPropagation(), c.value = i.id;
8142
- const u = V(g.value, i.id);
8147
+ const u = V(f.value, i.id);
8143
8148
  a("select", u);
8144
8149
  }
8145
8150
  function go(t) {
@@ -8150,8 +8155,8 @@ const Ea = ["viewBox", "width", "height"], xa = { class: "zm-edges" }, wa = ["d"
8150
8155
  return;
8151
8156
  }
8152
8157
  if (t.button !== 0) return;
8153
- const u = d.value.getBoundingClientRect(), k = (t.clientX - u.left - G.offsetX.value) / G.scale.value, v = (t.clientY - u.top - G.offsetY.value) / G.scale.value;
8154
- G.startMarquee(k, v);
8158
+ const u = d.value.getBoundingClientRect(), w = (t.clientX - u.left - G.offsetX.value) / G.scale.value, v = (t.clientY - u.top - G.offsetY.value) / G.scale.value;
8159
+ G.startMarquee(w, v);
8155
8160
  }
8156
8161
  function mo(t) {
8157
8162
  if (I) {
@@ -8167,63 +8172,63 @@ const Ea = ["viewBox", "width", "height"], xa = { class: "zm-edges" }, wa = ["d"
8167
8172
  const t = G.marquee;
8168
8173
  if (t.width < 4 && t.height < 4)
8169
8174
  return;
8170
- const i = t.x, u = t.y, k = t.x + t.width, v = t.y + t.height, _ = [];
8175
+ const i = t.x, u = t.y, w = t.x + t.width, v = t.y + t.height, N = [];
8171
8176
  for (const O of jn.value) {
8172
8177
  const U = O.width / 2, ie = O.height / 2, m = O.x - U, q = O.x + U, Ae = O.y - ie, Be = O.y + ie;
8173
- m <= k && q >= i && Ae <= v && Be >= u && _.push(O.id);
8178
+ m <= w && q >= i && Ae <= v && Be >= u && N.push(O.id);
8174
8179
  }
8175
- if (_.length > 0) {
8176
- c.value = _[0];
8177
- const O = V(g.value, _[0]);
8180
+ if (N.length > 0) {
8181
+ c.value = N[0];
8182
+ const O = V(f.value, N[0]);
8178
8183
  O && a("select", O);
8179
8184
  }
8180
8185
  }
8181
8186
  function At(t) {
8182
- return f.value.has(t);
8187
+ return g.value.has(t);
8183
8188
  }
8184
8189
  function ho(t) {
8185
- const i = V(g.value, t.id);
8190
+ const i = V(f.value, t.id);
8186
8191
  return !!i && i.children.length > 0;
8187
8192
  }
8188
8193
  function nt(t) {
8189
- const i = V(g.value, t);
8194
+ const i = V(f.value, t);
8190
8195
  return i ? i.children.length : 0;
8191
8196
  }
8192
8197
  function Rt(t) {
8193
- if (!V(g.value, t)) return 0;
8194
- const k = [g.value];
8195
- for (; k.length; ) {
8196
- const v = k.pop(), _ = v.children.findIndex((O) => O.id === t);
8197
- if (_ >= 0) return _;
8198
- for (const O of v.children) k.push(O);
8198
+ if (!V(f.value, t)) return 0;
8199
+ const w = [f.value];
8200
+ for (; w.length; ) {
8201
+ const v = w.pop(), N = v.children.findIndex((O) => O.id === t);
8202
+ if (N >= 0) return N;
8203
+ for (const O of v.children) w.push(O);
8199
8204
  }
8200
8205
  return 0;
8201
8206
  }
8202
- function Ot(t, i, u, k) {
8203
- if (((k == null ? void 0 : k._dir) ?? t._dir) === "down")
8207
+ function Ot(t, i, u, w) {
8208
+ if (((w == null ? void 0 : w._dir) ?? t._dir) === "down")
8204
8209
  return i === "out" ? { x: t.x, y: t.y + t.height / 2 } : { x: t.x, y: t.y - t.height / 2 };
8205
- let _;
8206
- i === "in" ? _ = -t.side : u !== void 0 ? _ = u : _ = t.side;
8210
+ let N;
8211
+ i === "in" ? N = -t.side : u !== void 0 ? N = u : N = t.side;
8207
8212
  const O = i === "in" ? t._richInsetX ?? 0 : 0;
8208
- return { x: t.x + _ * (t.width / 2 - O), y: t.y };
8213
+ return { x: t.x + N * (t.width / 2 - O), y: t.y };
8209
8214
  }
8210
- function We() {
8215
+ function He() {
8211
8216
  const t = Se.value;
8212
8217
  G.resetView(t.width, t.height, t.root.y);
8213
8218
  }
8214
8219
  function bo() {
8215
- Ne.value = !0, be(), le(), xe(() => We());
8220
+ Ne.value = !0, be(), le(), xe(() => He());
8216
8221
  }
8217
8222
  function tt(t) {
8218
- B.layoutMode !== t && (B.layoutMode = t, le(), xe(() => We()));
8223
+ L.layoutMode !== t && (L.layoutMode = t, le(), xe(() => He()));
8219
8224
  }
8220
8225
  function It() {
8221
- return JSON.stringify(g.value, null, 2);
8226
+ return JSON.stringify(f.value, null, 2);
8222
8227
  }
8223
8228
  function Lt(t) {
8224
8229
  try {
8225
8230
  const i = JSON.parse(t);
8226
- return !i.id || !Array.isArray(i.children) ? !1 : (De.reset(), g.value = Ye(i), c.value = null, f.value = /* @__PURE__ */ new Set(), le(), xe(() => We()), a("change", g.value), !0);
8231
+ return !i.id || !Array.isArray(i.children) ? !1 : (De.reset(), f.value = Ye(i), c.value = null, g.value = /* @__PURE__ */ new Set(), le(), xe(() => He()), a("change", f.value), !0);
8227
8232
  } catch {
8228
8233
  return !1;
8229
8234
  }
@@ -8231,8 +8236,8 @@ const Ea = ["viewBox", "width", "height"], xa = { class: "zm-edges" }, wa = ["d"
8231
8236
  function vo() {
8232
8237
  const t = document.createElement("input");
8233
8238
  t.type = "file", t.accept = "application/json", t.onchange = () => {
8234
- var k;
8235
- const i = (k = t.files) == null ? void 0 : k[0];
8239
+ var w;
8240
+ const i = (w = t.files) == null ? void 0 : w[0];
8236
8241
  if (!i) return;
8237
8242
  const u = new FileReader();
8238
8243
  u.onload = () => {
@@ -8242,7 +8247,7 @@ const Ea = ["viewBox", "width", "height"], xa = { class: "zm-edges" }, wa = ["d"
8242
8247
  }
8243
8248
  function yo() {
8244
8249
  const t = new Blob([It()], { type: "application/json" }), i = URL.createObjectURL(t), u = document.createElement("a");
8245
- u.href = i, u.download = `${g.value.text || "mindmap"}.json`, u.click(), URL.revokeObjectURL(i);
8250
+ u.href = i, u.download = `${f.value.text || "mindmap"}.json`, u.click(), URL.revokeObjectURL(i);
8246
8251
  }
8247
8252
  return r({
8248
8253
  addChild: (t) => tn(t),
@@ -8253,25 +8258,25 @@ const Ea = ["viewBox", "width", "height"], xa = { class: "zm-edges" }, wa = ["d"
8253
8258
  moveNode: (t, i, u) => uo(t, i, u),
8254
8259
  lineWidthForDepth: ht,
8255
8260
  endWidthForDepth: bt,
8256
- getData: () => g.value,
8261
+ getData: () => f.value,
8257
8262
  setData: (t) => {
8258
- De.reset(), g.value = Ye(t), c.value = null, f.value = /* @__PURE__ */ new Set(), le(), be(), xe(() => We());
8263
+ De.reset(), f.value = Ye(t), c.value = null, g.value = /* @__PURE__ */ new Set(), le(), be(), xe(() => He());
8259
8264
  },
8260
- resetView: () => We(),
8265
+ resetView: () => He(),
8261
8266
  exportData: It,
8262
8267
  importData: Lt,
8263
8268
  /** Serialize the current data tree as markdown. Always available
8264
8269
  * — the same serializer is used to emit `markdownChange`. */
8265
- getMarkdown: () => lt(g.value),
8270
+ getMarkdown: () => lt(f.value),
8266
8271
  /** Replace the data tree with the result of parsing `md`. The
8267
8272
  * flag `emitMarkdownChange` (default true) controls whether the
8268
8273
  * change is also echoed via `markdownChange` (use false when
8269
8274
  * the host just set the same value back from the prop). */
8270
8275
  setMarkdown: (t, i = !0) => {
8271
8276
  const u = Ft(t || "");
8272
- i && (w.value = !0), Y = !i, De.reset(), g.value = Ye(u), c.value = null, f.value = /* @__PURE__ */ new Set(), le(), be(), xe(() => {
8273
- Y = !1, We();
8274
- }), a("change", g.value);
8277
+ i && (_.value = !0), Y = !i, De.reset(), f.value = Ye(u), c.value = null, g.value = /* @__PURE__ */ new Set(), le(), be(), xe(() => {
8278
+ Y = !1, He();
8279
+ }), a("change", f.value);
8275
8280
  },
8276
8281
  // Make balanced the active layout (sticky). Subsequent data changes
8277
8282
  // and additions stay in balanced mode. Pass `false` to revert to the
@@ -8284,7 +8289,7 @@ const Ea = ["viewBox", "width", "height"], xa = { class: "zm-edges" }, wa = ["d"
8284
8289
  // layout, and re-center the view. This is the action tied to the
8285
8290
  // "balance" toolbar button.
8286
8291
  balance: () => bo(),
8287
- applyNodeStyle: (t, i) => z(t, i),
8292
+ applyNodeStyle: (t, i) => B(t, i),
8288
8293
  getNodeStyle: (t) => re(t),
8289
8294
  applyNodeImage: (t, i) => se(t, i),
8290
8295
  applyNodeImageByUrl: (t, i) => X(t, i),
@@ -8293,46 +8298,46 @@ const Ea = ["viewBox", "width", "height"], xa = { class: "zm-edges" }, wa = ["d"
8293
8298
  removeNodeLink: (t) => ye(t),
8294
8299
  applyNodeNote: (t, i) => y(t, i),
8295
8300
  removeNodeNote: (t) => A(t),
8296
- applyNodeRichContent: (t, i) => S(t, i),
8301
+ applyNodeRichContent: (t, i) => M(t, i),
8297
8302
  undo: () => Qn(),
8298
8303
  redo: () => et(),
8299
8304
  canUndo: () => De.canUndo(),
8300
8305
  canRedo: () => De.canRedo(),
8301
8306
  // Settings panel / external mutation hooks
8302
8307
  applySettings: (t) => {
8303
- t.autoBalanceOnChange !== void 0 && (B.autoBalanceOnChange = t.autoBalanceOnChange), t.lineWidthStart !== void 0 && (B.lineWidthStart = Math.max(0.5, Math.min(20, t.lineWidthStart))), t.lineWidthEnd !== void 0 && (B.lineWidthEnd = Math.max(0.3, Math.min(10, t.lineWidthEnd))), t.rainbowBranch !== void 0 && (B.rainbowBranch = t.rainbowBranch), t.branchPaletteId !== void 0 && (B.branchPaletteId = t.branchPaletteId), t.customPalettes !== void 0 && (B.customPalettes = t.customPalettes), t.lineStyle !== void 0 && (B.lineStyle = t.lineStyle), t.taperedEdge !== void 0 && (B.taperedEdge = t.taperedEdge), t.showOrderBadge !== void 0 && (B.showOrderBadge = t.showOrderBadge);
8308
+ t.autoBalanceOnChange !== void 0 && (L.autoBalanceOnChange = t.autoBalanceOnChange), t.lineWidthStart !== void 0 && (L.lineWidthStart = Math.max(0.5, Math.min(20, t.lineWidthStart))), t.lineWidthEnd !== void 0 && (L.lineWidthEnd = Math.max(0.3, Math.min(10, t.lineWidthEnd))), t.rainbowBranch !== void 0 && (L.rainbowBranch = t.rainbowBranch), t.branchPaletteId !== void 0 && (L.branchPaletteId = t.branchPaletteId), t.customPalettes !== void 0 && (L.customPalettes = t.customPalettes), t.lineStyle !== void 0 && (L.lineStyle = t.lineStyle), t.taperedEdge !== void 0 && (L.taperedEdge = t.taperedEdge), t.showOrderBadge !== void 0 && (L.showOrderBadge = t.showOrderBadge);
8304
8309
  },
8305
8310
  getSettings: () => ({
8306
- autoBalanceOnChange: B.autoBalanceOnChange,
8307
- lineWidthStart: B.lineWidthStart,
8308
- lineWidthEnd: B.lineWidthEnd,
8309
- rainbowBranch: B.rainbowBranch,
8310
- branchPaletteId: B.branchPaletteId,
8311
- customPalettes: B.customPalettes,
8312
- lineStyle: B.lineStyle,
8313
- layoutMode: B.layoutMode,
8314
- taperedEdge: B.taperedEdge,
8315
- showOrderBadge: B.showOrderBadge
8311
+ autoBalanceOnChange: L.autoBalanceOnChange,
8312
+ lineWidthStart: L.lineWidthStart,
8313
+ lineWidthEnd: L.lineWidthEnd,
8314
+ rainbowBranch: L.rainbowBranch,
8315
+ branchPaletteId: L.branchPaletteId,
8316
+ customPalettes: L.customPalettes,
8317
+ lineStyle: L.lineStyle,
8318
+ layoutMode: L.layoutMode,
8319
+ taperedEdge: L.taperedEdge,
8320
+ showOrderBadge: L.showOrderBadge
8316
8321
  }),
8317
8322
  setBranchPalette: (t) => {
8318
8323
  if (!t) return;
8319
- [...yn, ...B.customPalettes].find((u) => u.id === t) && (B.branchPaletteId = t);
8324
+ [...yn, ...L.customPalettes].find((u) => u.id === t) && (L.branchPaletteId = t);
8320
8325
  },
8321
- getBranchPalette: () => B.branchPaletteId,
8322
- getBranchPalettes: () => [...yn, ...B.customPalettes]
8326
+ getBranchPalette: () => L.branchPaletteId,
8327
+ getBranchPalettes: () => [...yn, ...L.customPalettes]
8323
8328
  }), Ln(
8324
8329
  () => o.data,
8325
8330
  (t) => {
8326
- g.value = Ye(t), le();
8331
+ f.value = Ye(t), le();
8327
8332
  },
8328
8333
  { deep: !1 }
8329
8334
  ), st(() => {
8330
- be(), xe(() => We());
8335
+ be(), xe(() => He());
8331
8336
  }), (t, i) => {
8332
- var u, k, v, _, O, U, ie;
8337
+ var u, w, v, N, O, U, ie;
8333
8338
  return C(), T("div", {
8334
8339
  class: "zm-mindmap",
8335
- style: Pe({ background: Le.value.bgColor, fontSize: Le.value.fontSize + "px" })
8340
+ style: Fe({ background: Le.value.bgColor, fontSize: Le.value.fontSize + "px" })
8336
8341
  }, [
8337
8342
  h("div", {
8338
8343
  ref_key: "wrapperRef",
@@ -8348,7 +8353,7 @@ const Ea = ["viewBox", "width", "height"], xa = { class: "zm-edges" }, wa = ["d"
8348
8353
  }, [
8349
8354
  h("div", {
8350
8355
  class: "zm-svg-layer",
8351
- style: Pe({
8356
+ style: Fe({
8352
8357
  left: Se.value.vbX * K(G).scale.value + K(G).offsetX.value + "px",
8353
8358
  top: Se.value.vbY * K(G).scale.value + K(G).offsetY.value + "px",
8354
8359
  width: Se.value.vbW * K(G).scale.value + "px",
@@ -8365,7 +8370,7 @@ const Ea = ["viewBox", "width", "height"], xa = { class: "zm-edges" }, wa = ["d"
8365
8370
  h("g", xa, [
8366
8371
  (C(!0), T(J, null, vn(Vi.value, (m) => (C(), T("path", {
8367
8372
  key: m.key,
8368
- d: Wi(Ot(m.from, "out", m.to.side, m.to), Ot(m.to, "in"), ht(m.from.depth), bt(m.to.depth), 32, B.lineStyle, m.to._dir),
8373
+ d: Wi(Ot(m.from, "out", m.to.side, m.to), Ot(m.to, "in"), ht(m.from.depth), bt(m.to.depth), 32, L.lineStyle, m.to._dir),
8369
8374
  fill: Gi(m.from, m.to),
8370
8375
  stroke: "none"
8371
8376
  }, null, 8, wa))), 128))
@@ -8375,7 +8380,7 @@ const Ea = ["viewBox", "width", "height"], xa = { class: "zm-edges" }, wa = ["d"
8375
8380
  K(G).isMarquee.value ? (C(), T("div", {
8376
8381
  key: 0,
8377
8382
  class: "zm-marquee",
8378
- style: Pe({
8383
+ style: Fe({
8379
8384
  left: K(G).marquee.x * K(G).scale.value + K(G).offsetX.value + "px",
8380
8385
  top: K(G).marquee.y * K(G).scale.value + K(G).offsetY.value + "px",
8381
8386
  width: K(G).marquee.width * K(G).scale.value + "px",
@@ -8384,7 +8389,7 @@ const Ea = ["viewBox", "width", "height"], xa = { class: "zm-edges" }, wa = ["d"
8384
8389
  }, null, 4)) : ge("", !0),
8385
8390
  h("div", {
8386
8391
  class: "zm-world",
8387
- style: Pe({
8392
+ style: Fe({
8388
8393
  transform: `translate(${K(G).offsetX.value}px, ${K(G).offsetY.value}px) scale(${K(G).scale.value})`
8389
8394
  })
8390
8395
  }, [
@@ -8398,7 +8403,7 @@ const Ea = ["viewBox", "width", "height"], xa = { class: "zm-edges" }, wa = ["d"
8398
8403
  "is-resizing": Qe.value === m.id
8399
8404
  }]),
8400
8405
  "data-node-id": m.id,
8401
- style: Pe({
8406
+ style: Fe({
8402
8407
  left: m.x + "px",
8403
8408
  top: m.y + "px",
8404
8409
  // Pin the box to the layout's reserved width so the
@@ -8545,7 +8550,7 @@ const Ea = ["viewBox", "width", "height"], xa = { class: "zm-edges" }, wa = ["d"
8545
8550
  At(m.id) && nt(m.id) > 0 ? (C(), T("span", {
8546
8551
  key: 5,
8547
8552
  class: $e(["zm-collapse-badge", { "is-on-left": m.side === -1 }]),
8548
- style: Pe({ background: Xe.value.get(m.id) ?? "#64748b" }),
8553
+ style: Fe({ background: Xe.value.get(m.id) ?? "#64748b" }),
8549
8554
  title: `展开 ${nt(m.id)} 个子节点`,
8550
8555
  onMousedown: i[13] || (i[13] = Z(() => {
8551
8556
  }, ["stop"])),
@@ -8554,7 +8559,7 @@ const Ea = ["viewBox", "width", "height"], xa = { class: "zm-edges" }, wa = ["d"
8554
8559
  ho(m) && !At(m.id) ? (C(), T("button", {
8555
8560
  key: 6,
8556
8561
  class: $e(["zm-btn zm-collapse", { "is-on-left": m.side === -1 }]),
8557
- style: Pe({ color: Xe.value.get(m.id) ?? "#64748b", borderColor: Xe.value.get(m.id) ?? "#64748b" }),
8562
+ style: Fe({ color: Xe.value.get(m.id) ?? "#64748b", borderColor: Xe.value.get(m.id) ?? "#64748b" }),
8558
8563
  title: "折叠",
8559
8564
  onMousedown: i[14] || (i[14] = Z(() => {
8560
8565
  }, ["stop"])),
@@ -8570,7 +8575,7 @@ const Ea = ["viewBox", "width", "height"], xa = { class: "zm-edges" }, wa = ["d"
8570
8575
  key: 7,
8571
8576
  class: "zm-img-resize-handle",
8572
8577
  title: "拖动调整图片大小",
8573
- onMousedown: Z((q) => He(q, m), ["stop"])
8578
+ onMousedown: Z((q) => Ue(q, m), ["stop"])
8574
8579
  }, null, 40, $a)) : ge("", !0),
8575
8580
  m.image && c.value === m.id && s.value !== m.id ? (C(), T("button", {
8576
8581
  key: 8,
@@ -8593,11 +8598,11 @@ const Ea = ["viewBox", "width", "height"], xa = { class: "zm-edges" }, wa = ["d"
8593
8598
  x: R.value.x,
8594
8599
  y: R.value.y,
8595
8600
  container: d.value,
8596
- "has-image": !!((u = K(V)(g.value, R.value.nodeId)) != null && u.image),
8597
- "has-link": !!((k = K(V)(g.value, R.value.nodeId)) != null && k.link),
8598
- "has-note": !!((v = K(V)(g.value, R.value.nodeId)) != null && v.note),
8599
- "has-code": ((O = (_ = K(V)(g.value, R.value.nodeId)) == null ? void 0 : _.richContent) == null ? void 0 : O.kind) === "code",
8600
- "has-table": ((ie = (U = K(V)(g.value, R.value.nodeId)) == null ? void 0 : U.richContent) == null ? void 0 : ie.kind) === "table",
8601
+ "has-image": !!((u = K(V)(f.value, R.value.nodeId)) != null && u.image),
8602
+ "has-link": !!((w = K(V)(f.value, R.value.nodeId)) != null && w.link),
8603
+ "has-note": !!((v = K(V)(f.value, R.value.nodeId)) != null && v.note),
8604
+ "has-code": ((O = (N = K(V)(f.value, R.value.nodeId)) == null ? void 0 : N.richContent) == null ? void 0 : O.kind) === "code",
8605
+ "has-table": ((ie = (U = K(V)(f.value, R.value.nodeId)) == null ? void 0 : U.richContent) == null ? void 0 : ie.kind) === "table",
8601
8606
  onPickImage: Nn,
8602
8607
  onRemoveImage: je,
8603
8608
  onSetLink: Xn,
@@ -8620,7 +8625,7 @@ const Ea = ["viewBox", "width", "height"], xa = { class: "zm-edges" }, wa = ["d"
8620
8625
  onOpenData: kn,
8621
8626
  onOpenImport: _n,
8622
8627
  onOpenSettings: Ce,
8623
- onClose: ke
8628
+ onClose: we
8624
8629
  }, null, 8, ["x", "y", "container"])) : ge("", !0),
8625
8630
  h("div", {
8626
8631
  class: $e(["zm-toolbar", { "is-preview-only": o.previewMode, "is-hovered": E.value }])
@@ -8645,7 +8650,7 @@ const Ea = ["viewBox", "width", "height"], xa = { class: "zm-edges" }, wa = ["d"
8645
8650
  h("button", {
8646
8651
  class: "zm-tb-btn",
8647
8652
  title: "重置视图",
8648
- onClick: We
8653
+ onClick: He
8649
8654
  }, [
8650
8655
  ne(te, { name: "reset" })
8651
8656
  ]),
@@ -8716,21 +8721,21 @@ const Ea = ["viewBox", "width", "height"], xa = { class: "zm-edges" }, wa = ["d"
8716
8721
  ]),
8717
8722
  i[29] || (i[29] = h("span", { class: "zm-tb-divider" }, null, -1)),
8718
8723
  h("button", {
8719
- class: $e(["zm-tb-btn", { active: B.layoutMode === "mindmap" }]),
8724
+ class: $e(["zm-tb-btn", { active: L.layoutMode === "mindmap" }]),
8720
8725
  title: "思维导图布局 (中心辐射)",
8721
8726
  onClick: i[22] || (i[22] = (m) => tt("mindmap"))
8722
8727
  }, [
8723
8728
  ne(te, { name: "mindmap" })
8724
8729
  ], 2),
8725
8730
  h("button", {
8726
- class: $e(["zm-tb-btn", { active: B.layoutMode === "tree" }]),
8731
+ class: $e(["zm-tb-btn", { active: L.layoutMode === "tree" }]),
8727
8732
  title: "树形布局 (向右展开)",
8728
8733
  onClick: i[23] || (i[23] = (m) => tt("tree"))
8729
8734
  }, [
8730
8735
  ne(te, { name: "tree" })
8731
8736
  ], 2),
8732
8737
  h("button", {
8733
- class: $e(["zm-tb-btn", { active: B.layoutMode === "org" }]),
8738
+ class: $e(["zm-tb-btn", { active: L.layoutMode === "org" }]),
8734
8739
  title: "组织结构布局 (向下展开)",
8735
8740
  onClick: i[24] || (i[24] = (m) => tt("org"))
8736
8741
  }, [
@@ -8762,7 +8767,7 @@ export {
8762
8767
  Ye as clone,
8763
8768
  Za as default,
8764
8769
  V as findNode,
8765
- Ue as findParent,
8770
+ Pe as findParent,
8766
8771
  Ft as markdownToMindMap,
8767
8772
  Ka as markdownToRichMindMap,
8768
8773
  lt as mindMapToMarkdown,