mind-elixir 5.10.1-beta.1 → 5.11.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,4 +1,4 @@
1
- const Hn = 0, In = 1, On = 2, rt = {
1
+ const Wn = 0, Rn = 1, Xn = 2, rt = {
2
2
  name: "Latte",
3
3
  type: "light",
4
4
  palette: ["#dd7878", "#ea76cb", "#8839ef", "#e64553", "#fe640b", "#df8e1d", "#40a02b", "#209fb5", "#1e66f5", "#7287fd"],
@@ -53,15 +53,15 @@ const Hn = 0, In = 1, On = 2, rt = {
53
53
  "--map-padding": "50px 80px"
54
54
  }
55
55
  };
56
- function Ht(t) {
56
+ function $t(t) {
57
57
  return t.replace(/&/g, "&amp;").replace(/</g, "&lt;").replace(/"/g, "&quot;");
58
58
  }
59
- const K = function(t, e) {
59
+ const J = function(t, e) {
60
60
  if (e.id === t)
61
61
  return e;
62
62
  if (e.children && e.children.length) {
63
63
  for (let n = 0; n < e.children.length; n++) {
64
- const o = K(t, e.children[n]);
64
+ const o = J(t, e.children[n]);
65
65
  if (o) return o;
66
66
  }
67
67
  return null;
@@ -71,25 +71,25 @@ const K = function(t, e) {
71
71
  if (t.parent = e, t.children)
72
72
  for (let n = 0; n < t.children.length; n++)
73
73
  lt(t.children[n], t);
74
- }, xt = (t, e, n) => {
74
+ }, bt = (t, e, n) => {
75
75
  t.expanded = e, t.children && t.children.forEach((o) => {
76
- xt(o, e);
76
+ bt(o, e);
77
77
  });
78
78
  };
79
- function J(t, e, n, o) {
80
- const s = n - t, i = o - e, c = Math.atan2(i, s) * 180 / Math.PI, a = 12, l = 30, h = (c + 180 - l) * Math.PI / 180, f = (c + 180 + l) * Math.PI / 180;
79
+ function Z(t, e, n, o) {
80
+ const s = n - t, i = o - e, c = Math.atan2(i, s) * 180 / Math.PI, d = 12, a = 30, h = (c + 180 - a) * Math.PI / 180, f = (c + 180 + a) * Math.PI / 180;
81
81
  return {
82
- x1: n + Math.cos(h) * a,
83
- y1: o + Math.sin(h) * a,
84
- x2: n + Math.cos(f) * a,
85
- y2: o + Math.sin(f) * a
82
+ x1: n + Math.cos(h) * d,
83
+ y1: o + Math.sin(h) * d,
84
+ x2: n + Math.cos(f) * d,
85
+ y2: o + Math.sin(f) * d
86
86
  };
87
87
  }
88
- function F() {
88
+ function _() {
89
89
  return ((/* @__PURE__ */ new Date()).getTime().toString(16) + Math.random().toString(16).substring(2)).substring(2, 18);
90
90
  }
91
- const It = function() {
92
- const t = F();
91
+ const Ht = function() {
92
+ const t = _();
93
93
  return {
94
94
  topic: this.newTopicName,
95
95
  id: t
@@ -99,13 +99,13 @@ const It = function() {
99
99
  for (; e && e !== t; )
100
100
  n += e.offsetLeft, o += e.offsetTop, e = e.offsetParent;
101
101
  return { offsetLeft: n, offsetTop: o };
102
- }, D = (t, e) => {
102
+ }, M = (t, e) => {
103
103
  for (const n in e)
104
104
  t.setAttribute(n, e[n]);
105
- }, nt = (t) => t ? t.tagName === "ME-TPC" : !1, at = (t) => {
105
+ }, q = (t) => t ? t.tagName === "ME-TPC" : !1, at = (t) => {
106
106
  const e = /translate3d\(([^,]+),\s*([^,]+)/, n = t.match(e);
107
107
  return n ? { x: parseFloat(n[1]), y: parseFloat(n[2]) } : { x: 0, y: 0 };
108
- }, Ct = function(t) {
108
+ }, xt = function(t) {
109
109
  for (let e = 0; e < t.length; e++) {
110
110
  const { dom: n, evt: o, func: s } = t[e];
111
111
  n.addEventListener(o, s);
@@ -119,13 +119,122 @@ const It = function() {
119
119
  }, ut = (t, e) => {
120
120
  const n = t.x - e.x, o = t.y - e.y;
121
121
  return Math.sqrt(n * n + o * o);
122
- }, V = {
122
+ }, It = function(t, e) {
123
+ if (!e)
124
+ return tt(t), t;
125
+ let n = t.querySelector(".insert-preview");
126
+ const o = `insert-preview ${e} show`;
127
+ return n || (n = document.createElement("div"), t.appendChild(n)), n.className = o, t;
128
+ }, tt = function(t) {
129
+ if (!t) return;
130
+ const e = t.querySelectorAll(".insert-preview");
131
+ for (const n of e || [])
132
+ n.remove();
133
+ }, pt = function(t, e) {
134
+ for (const n of e) {
135
+ const o = n.parentElement.parentElement.contains(t);
136
+ if (!(t && t.tagName === "ME-TPC" && t !== n && !o && t.nodeObj.parent)) return !1;
137
+ }
138
+ return !0;
139
+ }, Ot = function(t) {
140
+ const e = document.createElement("div");
141
+ return e.className = "mind-elixir-ghost", t.container.appendChild(e), e;
142
+ };
143
+ class Yt {
144
+ mind;
145
+ isMoving = !1;
146
+ interval = null;
147
+ speed = 20;
148
+ constructor(e) {
149
+ this.mind = e;
150
+ }
151
+ move(e, n) {
152
+ this.isMoving || (this.isMoving = !0, this.interval = setInterval(() => {
153
+ this.mind.move(e * this.speed * this.mind.scaleVal, n * this.speed * this.mind.scaleVal);
154
+ }, 100));
155
+ }
156
+ stop() {
157
+ this.isMoving = !1, this.interval && (clearInterval(this.interval), this.interval = null);
158
+ }
159
+ }
160
+ function Bt(t) {
161
+ return {
162
+ isDragging: !1,
163
+ insertType: null,
164
+ meet: null,
165
+ ghost: Ot(t),
166
+ edgeMoveController: new Yt(t),
167
+ startX: 0,
168
+ startY: 0,
169
+ pointerId: null
170
+ };
171
+ }
172
+ const Wt = 5;
173
+ function gt(t, e, n, o = !1) {
174
+ if (t.spacePressed) return !1;
175
+ const s = n.target;
176
+ return s?.tagName !== "ME-TPC" || !s.nodeObj.parent ? !1 : (e.startX = n.clientX, e.startY = n.clientY, e.pointerId = n.pointerId, t.dragged = t.currentNodes, o && Et(t, e), !0);
177
+ }
178
+ function Ct(t, e, n) {
179
+ t.style.transform = `translate(${e - 10}px, ${n - 10}px)`, t.style.display = "block";
180
+ }
181
+ function Et(t, e) {
182
+ const { dragged: n } = t;
183
+ if (!n) return;
184
+ const o = document.activeElement;
185
+ o && o.isContentEditable && o.blur(), e.isDragging = !0, n.length > 1 ? e.ghost.innerHTML = n.length + "" : e.ghost.innerHTML = n[0].innerHTML;
186
+ for (const s of n)
187
+ s.parentElement.parentElement.style.opacity = "0.5";
188
+ t.panHelper.clear();
189
+ }
190
+ function Rt(t, e, n) {
191
+ const { dragged: o } = t;
192
+ if (!o || e.pointerId !== n.pointerId) return;
193
+ const s = n.clientX - e.startX, i = n.clientY - e.startY, r = Math.sqrt(s * s + i * i);
194
+ if (!e.isDragging && r > Wt && Et(t, e), !e.isDragging) return;
195
+ const c = t.container.getBoundingClientRect();
196
+ Ct(e.ghost, n.clientX - c.x, n.clientY - c.y), n.clientX < c.x + 50 ? e.edgeMoveController.move(1, 0) : n.clientX > c.x + c.width - 50 ? e.edgeMoveController.move(-1, 0) : n.clientY < c.y + 50 ? e.edgeMoveController.move(0, 1) : n.clientY > c.y + c.height - 50 ? e.edgeMoveController.move(0, -1) : e.edgeMoveController.stop(), tt(e.meet);
197
+ const d = 12 * t.scaleVal, a = document.elementFromPoint(n.clientX, n.clientY - d);
198
+ if (pt(a, o)) {
199
+ e.meet = a;
200
+ const h = a.getBoundingClientRect(), f = h.y;
201
+ n.clientY > f + h.height ? e.insertType = "after" : e.insertType = "in";
202
+ } else {
203
+ const h = document.elementFromPoint(n.clientX, n.clientY + d);
204
+ if (pt(h, o)) {
205
+ e.meet = h;
206
+ const p = h.getBoundingClientRect().y;
207
+ n.clientY < p ? e.insertType = "before" : e.insertType = "in";
208
+ } else
209
+ e.insertType = null, e.meet = null;
210
+ }
211
+ e.meet && It(e.meet, e.insertType);
212
+ }
213
+ function Xt(t, e, n) {
214
+ const { dragged: o } = t;
215
+ if (!(!o || e.pointerId !== n.pointerId)) {
216
+ e.edgeMoveController.stop();
217
+ for (const s of o)
218
+ s.parentElement.parentElement.style.opacity = "1";
219
+ e.ghost.style.display = "none", e.ghost.innerHTML = "", e.isDragging && e.meet && (tt(e.meet), e.insertType === "before" ? t.moveNodeBefore(o, e.meet) : e.insertType === "after" ? t.moveNodeAfter(o, e.meet) : e.insertType === "in" && t.moveNodeIn(o, e.meet)), t.dragged = null, e.isDragging = !1, e.insertType = null, e.meet = null, e.pointerId = null;
220
+ }
221
+ }
222
+ function ot(t, e) {
223
+ const { dragged: n } = t;
224
+ if (n) {
225
+ e.edgeMoveController.stop();
226
+ for (const o of n)
227
+ o.parentElement.parentElement.style.opacity = "1";
228
+ e.meet && tt(e.meet), e.ghost.style.display = "none", e.ghost.innerHTML = "", t.dragged = null, e.isDragging = !1, e.insertType = null, e.meet = null, e.pointerId = null;
229
+ }
230
+ }
231
+ const G = {
123
232
  LHS: "lhs",
124
233
  RHS: "rhs"
125
- }, Ot = function() {
234
+ }, Gt = function() {
126
235
  this.nodes.innerHTML = "";
127
236
  const t = this.createTopic(this.nodeData);
128
- St.call(this, t, this.nodeData), t.draggable = !1;
237
+ Tt.call(this, t, this.nodeData), t.draggable = !1;
129
238
  const e = document.createElement("me-root");
130
239
  e.appendChild(t);
131
240
  const n = this.nodeData.children || [];
@@ -135,29 +244,29 @@ const It = function() {
135
244
  i.direction === 0 ? o += 1 : i.direction === 1 ? s += 1 : o <= s ? (i.direction = 0, o += 1) : (i.direction = 1, s += 1);
136
245
  });
137
246
  }
138
- Yt(this, n, e);
139
- }, Yt = function(t, e, n) {
247
+ Vt(this, n, e);
248
+ }, Vt = function(t, e, n) {
140
249
  const o = document.createElement("me-main");
141
- o.className = V.LHS;
250
+ o.className = G.LHS;
142
251
  const s = document.createElement("me-main");
143
- s.className = V.RHS;
252
+ s.className = G.RHS;
144
253
  for (let i = 0; i < e.length; i++) {
145
254
  const r = e[i], { grp: c } = t.createWrapper(r);
146
255
  t.direction === 2 ? r.direction === 0 ? o.appendChild(c) : s.appendChild(c) : t.direction === 0 ? o.appendChild(c) : s.appendChild(c);
147
256
  }
148
257
  t.nodes.appendChild(o), t.nodes.appendChild(n), t.nodes.appendChild(s), t.nodes.appendChild(t.lines), t.nodes.appendChild(t.labelContainer);
149
- }, Bt = function(t, e) {
258
+ }, zt = function(t, e) {
150
259
  const n = document.createElement("me-children");
151
260
  for (let o = 0; o < e.length; o++) {
152
261
  const s = e[o], { grp: i } = t.createWrapper(s);
153
262
  n.appendChild(i);
154
263
  }
155
264
  return n;
156
- }, Et = function(t, e) {
265
+ }, St = function(t, e) {
157
266
  const o = (this?.el ? this.el : e || document).querySelector(`[data-nodeid="me${t}"]`);
158
267
  if (!o) throw new Error(`FindEle: Node ${t} not found, maybe it's collapsed.`);
159
268
  return o;
160
- }, St = function(t, e) {
269
+ }, Tt = function(t, e) {
161
270
  if (t.innerHTML = "", e.style) {
162
271
  const n = e.style;
163
272
  for (const o in n)
@@ -184,7 +293,7 @@ const It = function() {
184
293
  } else t.link && (t.link = void 0);
185
294
  if (e.icons && e.icons.length) {
186
295
  const n = document.createElement("span");
187
- n.className = "icons", n.innerHTML = e.icons.map((o) => `<span>${Ht(o)}</span>`).join(""), t.appendChild(n), t.icons = n;
296
+ n.className = "icons", n.innerHTML = e.icons.map((o) => `<span>${$t(o)}</span>`).join(""), t.appendChild(n), t.icons = n;
188
297
  } else t.icons && (t.icons = void 0);
189
298
  if (e.tags && e.tags.length) {
190
299
  const n = document.createElement("div");
@@ -193,33 +302,33 @@ const It = function() {
193
302
  typeof o == "string" ? s.textContent = o : (s.textContent = o.text, o.className && (s.className = o.className), o.style && Object.assign(s.style, o.style)), n.appendChild(s);
194
303
  }), t.appendChild(n), t.tags = n;
195
304
  } else t.tags && (t.tags = void 0);
196
- }, Rt = function(t, e) {
305
+ }, Ft = function(t, e) {
197
306
  const n = document.createElement("me-wrapper"), { p: o, tpc: s } = this.createParent(t);
198
307
  if (n.appendChild(o), !e && t.children && t.children.length > 0) {
199
- const i = zt(t.expanded);
308
+ const i = Kt(t.expanded);
200
309
  if (o.appendChild(i), t.expanded !== !1) {
201
- const r = Bt(this, t.children);
310
+ const r = zt(this, t.children);
202
311
  n.appendChild(r);
203
312
  }
204
313
  }
205
314
  return { grp: n, top: o, tpc: s };
206
- }, Wt = function(t) {
315
+ }, _t = function(t) {
207
316
  const e = document.createElement("me-parent"), n = this.createTopic(t);
208
- return St.call(this, n, t), e.appendChild(n), { p: e, tpc: n };
209
- }, Xt = function(t) {
317
+ return Tt.call(this, n, t), e.appendChild(n), { p: e, tpc: n };
318
+ }, qt = function(t) {
210
319
  const e = document.createElement("me-children");
211
320
  return e.append(...t), e;
212
- }, Vt = function(t) {
321
+ }, jt = function(t) {
213
322
  const e = document.createElement("me-tpc");
214
323
  return e.nodeObj = t, e.dataset.nodeid = "me" + t.id, e;
215
324
  };
216
- function Tt(t) {
325
+ function Lt(t) {
217
326
  const e = document.createRange();
218
327
  e.selectNodeContents(t);
219
328
  const n = window.getSelection();
220
329
  n && (n.removeAllRanges(), n.addRange(e));
221
330
  }
222
- const Gt = function(t) {
331
+ const Ut = function(t) {
223
332
  if (!t) return;
224
333
  const e = document.createElement("div"), n = t.nodeObj, o = n.topic, { offsetLeft: s, offsetTop: i } = H(this.nodes, t);
225
334
  this.nodes.appendChild(e), e.id = "input-box", e.textContent = o, e.contentEditable = "plaintext-only", e.spellcheck = !1;
@@ -234,16 +343,16 @@ const Gt = function(t) {
234
343
  margin:${r.margin};
235
344
  background-color:${r.backgroundColor !== "rgba(0, 0, 0, 0)" && r.backgroundColor};
236
345
  border: ${r.border};
237
- border-radius:${r.borderRadius}; `, this.direction === 0 && (e.style.right = "0"), Tt(e), this.bus.fire("operation", {
346
+ border-radius:${r.borderRadius}; `, this.direction === 0 && (e.style.right = "0"), Lt(e), this.bus.fire("operation", {
238
347
  name: "beginEdit",
239
348
  obj: t.nodeObj
240
349
  }), e.addEventListener("keydown", (c) => {
241
350
  c.stopPropagation();
242
- const a = c.key;
243
- if (a === "Enter" || a === "Tab") {
351
+ const d = c.key;
352
+ if (d === "Enter" || d === "Tab") {
244
353
  if (c.shiftKey) return;
245
354
  c.preventDefault(), e.blur(), this.container.focus();
246
- } else a === "Escape" && (c.preventDefault(), e.textContent = o, e.blur(), this.container.focus());
355
+ } else d === "Escape" && (c.preventDefault(), e.textContent = o, e.blur(), this.container.focus());
247
356
  }), e.addEventListener("blur", () => {
248
357
  if (!e) return;
249
358
  e.remove();
@@ -254,14 +363,14 @@ const Gt = function(t) {
254
363
  origin: o
255
364
  }));
256
365
  });
257
- }, zt = function(t) {
366
+ }, Kt = function(t) {
258
367
  const e = document.createElement("me-epd");
259
368
  return e.expanded = t !== !1, e.className = t !== !1 ? "minus" : "", e;
260
- }, Ft = function(t) {
369
+ }, Jt = function(t) {
261
370
  const n = t.parentElement.parentElement.lastElementChild;
262
371
  n?.tagName === "svg" && n?.remove();
263
372
  };
264
- function qt(t) {
373
+ function Zt(t) {
265
374
  return {
266
375
  nodeData: t.isFocusMode ? t.nodeDataBackup : t.nodeData,
267
376
  arrows: t.arrows,
@@ -270,301 +379,194 @@ function qt(t) {
270
379
  theme: t.theme
271
380
  };
272
381
  }
273
- const jt = function(t) {
382
+ const Qt = function(t) {
274
383
  const e = this.container, n = t.getBoundingClientRect(), o = e.getBoundingClientRect();
275
384
  if (n.top > o.bottom - 50 || n.bottom < o.top + 50 || n.left > o.right - 50 || n.right < o.left + 50) {
276
- const i = n.left + n.width / 2, r = n.top + n.height / 2, c = o.left + o.width / 2, a = o.top + o.height / 2, l = i - c, h = r - a;
277
- this.move(-l, -h, !0);
385
+ const i = n.left + n.width / 2, r = n.top + n.height / 2, c = o.left + o.width / 2, d = o.top + o.height / 2, a = i - c, h = r - d;
386
+ this.move(-a, -h, !0);
278
387
  }
279
- }, _t = function(t, e, n) {
388
+ }, te = function(t, e, n) {
280
389
  this.clearSelection(), this.scrollIntoView(t), this.selection?.select(t), e && this.bus.fire("selectNewNode", t.nodeObj);
281
- }, Ut = function(t) {
390
+ }, ee = function(t) {
282
391
  this.selection?.select(t);
283
- }, Kt = function(t) {
392
+ }, ne = function(t) {
284
393
  this.selection?.deselect(t);
285
- }, Jt = function() {
394
+ }, oe = function() {
286
395
  this.unselectNodes(this.currentNodes), this.unselectSummary(), this.unselectArrow();
287
- }, Lt = function(t) {
396
+ }, Dt = function(t) {
288
397
  return JSON.stringify(t, (e, n) => {
289
398
  if (!(e === "parent" && typeof n != "string"))
290
399
  return n;
291
400
  });
292
- }, Qt = function() {
293
- const t = qt(this);
294
- return Lt(t);
295
- }, Zt = function() {
401
+ }, se = function() {
402
+ const t = Zt(this);
403
+ return Dt(t);
404
+ }, ie = function() {
296
405
  return JSON.parse(this.getDataString());
297
- }, te = function() {
406
+ }, re = function() {
298
407
  this.editable = !0;
299
- }, ee = function() {
408
+ }, ce = function() {
300
409
  this.editable = !1;
301
- }, ne = function(t, e = { x: 0, y: 0 }) {
410
+ }, le = function(t, e = { x: 0, y: 0 }) {
302
411
  if (t < this.scaleMin && t < this.scaleVal || t > this.scaleMax && t > this.scaleVal) return;
303
- const n = this.container.getBoundingClientRect(), o = e.x ? e.x - n.left - n.width / 2 : 0, s = e.y ? e.y - n.top - n.height / 2 : 0, { dx: i, dy: r } = dt(this), c = this.map.style.transform, { x: a, y: l } = at(c), h = a - i, f = l - r, u = this.scaleVal, y = (-o + h) * (1 - t / u), m = (-s + f) * (1 - t / u);
304
- this.map.style.transform = `translate3d(${a - y}px, ${l - m}px, 0) scale(${t})`, this.scaleVal = t, this.bus.fire("scale", t);
305
- }, oe = function() {
412
+ const n = this.container.getBoundingClientRect(), o = e.x ? e.x - n.left - n.width / 2 : 0, s = e.y ? e.y - n.top - n.height / 2 : 0, { dx: i, dy: r } = dt(this), c = this.map.style.transform, { x: d, y: a } = at(c), h = d - i, f = a - r, p = this.scaleVal, m = (-o + h) * (1 - t / p), y = (-s + f) * (1 - t / p);
413
+ this.map.style.transform = `translate3d(${d - m}px, ${a - y}px, 0) scale(${t})`, this.scaleVal = t, this.bus.fire("scale", t);
414
+ }, ae = function() {
306
415
  const t = this.nodes.offsetHeight / this.container.offsetHeight, e = this.nodes.offsetWidth / this.container.offsetWidth, n = 1 / Math.max(1, Math.max(t, e));
307
416
  this.scaleVal = n;
308
417
  const { dx: o, dy: s } = dt(this, !0);
309
418
  this.map.style.transform = `translate3d(${o}px, ${s}px, 0) scale(${n})`, this.bus.fire("scale", n);
310
- }, se = function(t, e, n = !1) {
419
+ }, de = function(t, e, n = !1) {
311
420
  const { map: o, scaleVal: s, bus: i, container: r, nodes: c } = this;
312
421
  if (n && o.style.transition === "transform 0.3s")
313
422
  return;
314
- const a = o.style.transform;
315
- let { x: l, y: h } = at(a);
316
- const f = r.getBoundingClientRect(), u = c.getBoundingClientRect(), y = u.left < f.right && u.right > f.left, m = u.top < f.bottom && u.bottom > f.top;
317
- if (y) {
318
- const p = u.left + t, g = u.right + t;
319
- (p >= f.right || g <= f.left) && (t = 0);
320
- }
423
+ const d = o.style.transform;
424
+ let { x: a, y: h } = at(d);
425
+ const f = r.getBoundingClientRect(), p = c.getBoundingClientRect(), m = p.left < f.right && p.right > f.left, y = p.top < f.bottom && p.bottom > f.top;
321
426
  if (m) {
322
- const p = u.top + e, g = u.bottom + e;
323
- (p >= f.bottom || g <= f.top) && (e = 0);
427
+ const u = p.left + t, g = p.right + t;
428
+ (u >= f.right || g <= f.left) && (t = 0);
429
+ }
430
+ if (y) {
431
+ const u = p.top + e, g = p.bottom + e;
432
+ (u >= f.bottom || g <= f.top) && (e = 0);
324
433
  }
325
- l += t, h += e, n && (o.style.transition = "transform 0.3s", setTimeout(() => {
434
+ a += t, h += e, n && (o.style.transition = "transform 0.3s", setTimeout(() => {
326
435
  o.style.transition = "none";
327
- }, 300)), o.style.transform = `translate3d(${l}px, ${h}px, 0) scale(${s})`, i.fire("move", { dx: t, dy: e });
436
+ }, 300)), o.style.transform = `translate3d(${a}px, ${h}px, 0) scale(${s})`, i.fire("move", { dx: t, dy: e });
328
437
  }, dt = (t, e = !1) => {
329
438
  const { container: n, map: o, nodes: s } = t;
330
439
  let i, r;
331
440
  if (t.alignment === "nodes" || e)
332
441
  i = (n.offsetWidth - s.offsetWidth) / 2, r = (n.offsetHeight - s.offsetHeight) / 2, o.style.transformOrigin = "50% 50%";
333
442
  else {
334
- const c = o.querySelector("me-root"), a = c.offsetTop, l = c.offsetLeft, h = c.offsetWidth, f = c.offsetHeight;
335
- i = n.offsetWidth / 2 - l - h / 2, r = n.offsetHeight / 2 - a - f / 2, o.style.transformOrigin = `${l + h / 2}px 50%`;
443
+ const c = o.querySelector("me-root"), d = c.offsetTop, a = c.offsetLeft, h = c.offsetWidth, f = c.offsetHeight;
444
+ i = n.offsetWidth / 2 - a - h / 2, r = n.offsetHeight / 2 - d - f / 2, o.style.transformOrigin = `${a + h / 2}px 50%`;
336
445
  }
337
446
  return { dx: i, dy: r };
338
- }, ie = function() {
447
+ }, he = function() {
339
448
  const { map: t, container: e } = this, { dx: n, dy: o } = dt(this);
340
449
  e.scrollTop = 0, e.scrollLeft = 0, t.style.transform = `translate3d(${n}px, ${o}px, 0) scale(${this.scaleVal})`;
341
- }, re = function(t) {
450
+ }, fe = function(t) {
342
451
  t(this);
343
- }, ce = function(t) {
452
+ }, ue = function(t) {
344
453
  t.nodeObj.parent && (this.clearSelection(), this.tempDirection === null && (this.tempDirection = this.direction), this.isFocusMode || (this.nodeDataBackup = this.nodeData, this.isFocusMode = !0), this.nodeData = t.nodeObj, this.initRight(), this.toCenter());
345
- }, le = function() {
454
+ }, pe = function() {
346
455
  this.isFocusMode = !1, this.tempDirection !== null && (this.nodeData = this.nodeDataBackup, this.direction = this.tempDirection, this.tempDirection = null, this.refresh(), this.toCenter());
347
- }, ae = function() {
456
+ }, ge = function() {
348
457
  this.direction = 0, this.refresh(), this.toCenter(), this.bus.fire("changeDirection", this.direction);
349
- }, de = function() {
458
+ }, me = function() {
350
459
  this.direction = 1, this.refresh(), this.toCenter(), this.bus.fire("changeDirection", this.direction);
351
- }, he = function() {
460
+ }, ye = function() {
352
461
  this.direction = 2, this.refresh(), this.toCenter(), this.bus.fire("changeDirection", this.direction);
353
- }, fe = function(t, e) {
462
+ }, we = function(t, e) {
354
463
  const n = t.nodeObj;
355
464
  typeof e == "boolean" ? n.expanded = e : n.expanded !== !1 ? n.expanded = !1 : n.expanded = !0;
356
465
  const o = t.getBoundingClientRect(), s = {
357
466
  x: o.left,
358
467
  y: o.top
359
468
  }, i = t.parentNode, r = i.children[1];
360
- if (r.expanded = n.expanded, r.className = n.expanded ? "minus" : "", Ft(t), n.expanded) {
469
+ if (r.expanded = n.expanded, r.className = n.expanded ? "minus" : "", Jt(t), n.expanded) {
361
470
  const f = this.createChildren(
362
- n.children.map((u) => this.createWrapper(u).grp)
471
+ n.children.map((p) => this.createWrapper(p).grp)
363
472
  );
364
473
  i.parentNode.appendChild(f);
365
474
  } else
366
475
  i.parentNode.children[1].remove();
367
476
  this.linkDiv(t.closest("me-main > me-wrapper"));
368
- const c = t.getBoundingClientRect(), a = {
477
+ const c = t.getBoundingClientRect(), d = {
369
478
  x: c.left,
370
479
  y: c.top
371
- }, l = s.x - a.x, h = s.y - a.y;
372
- this.move(l, h), this.bus.fire("expandNode", n);
373
- }, ue = function(t, e) {
480
+ }, a = s.x - d.x, h = s.y - d.y;
481
+ this.move(a, h), this.bus.fire("expandNode", n);
482
+ }, ve = function(t, e) {
374
483
  const n = t.nodeObj, o = t.getBoundingClientRect(), s = {
375
484
  x: o.left,
376
485
  y: o.top
377
486
  };
378
- xt(n, e ?? !n.expanded), this.refresh();
487
+ bt(n, e ?? !n.expanded), this.refresh();
379
488
  const i = this.findEle(n.id).getBoundingClientRect(), r = {
380
489
  x: i.left,
381
490
  y: i.top
382
- }, c = s.x - r.x, a = s.y - r.y;
383
- this.move(c, a);
384
- }, pe = function(t) {
491
+ }, c = s.x - r.x, d = s.y - r.y;
492
+ this.move(c, d);
493
+ }, be = function(t) {
385
494
  this.clearSelection(), t && (t = JSON.parse(JSON.stringify(t)), this.nodeData = t.nodeData, this.arrows = t.arrows || [], this.summaries = t.summaries || [], t.theme && this.changeTheme(t.theme)), lt(this.nodeData), this.layout(), this.linkDiv();
386
- }, ge = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
495
+ }, xe = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
387
496
  __proto__: null,
388
- cancelFocus: le,
389
- clearSelection: Jt,
390
- disableEdit: ee,
391
- enableEdit: te,
392
- expandNode: fe,
393
- expandNodeAll: ue,
394
- focusNode: ce,
395
- getData: Zt,
396
- getDataString: Qt,
397
- initLeft: ae,
398
- initRight: de,
399
- initSide: he,
400
- install: re,
401
- move: se,
402
- refresh: pe,
403
- scale: ne,
404
- scaleFit: oe,
405
- scrollIntoView: jt,
406
- selectNode: _t,
407
- selectNodes: Ut,
408
- stringifyData: Lt,
409
- toCenter: ie,
410
- unselectNodes: Kt
411
- }, Symbol.toStringTag, { value: "Module" })), pt = function(t, e, n) {
412
- const { scaleVal: o, scaleSensitivity: s } = t;
413
- switch (e) {
414
- case "in":
415
- t.scale(o + s, n);
416
- break;
417
- case "out":
418
- t.scale(o - s, n);
419
- }
420
- }, me = function(t, e) {
421
- if (!e)
422
- return Z(t), t;
423
- let n = t.querySelector(".insert-preview");
424
- const o = `insert-preview ${e} show`;
425
- return n || (n = document.createElement("div"), t.appendChild(n)), n.className = o, t;
426
- }, Z = function(t) {
427
- if (!t) return;
428
- const e = t.querySelectorAll(".insert-preview");
429
- for (const n of e || [])
430
- n.remove();
431
- }, gt = function(t, e) {
432
- for (const n of e) {
433
- const o = n.parentElement.parentElement.contains(t);
434
- if (!(t && t.tagName === "ME-TPC" && t !== n && !o && t.nodeObj.parent)) return !1;
435
- }
436
- return !0;
437
- }, ye = function(t) {
438
- const e = document.createElement("div");
439
- return e.className = "mind-elixir-ghost", t.container.appendChild(e), e;
497
+ cancelFocus: pe,
498
+ clearSelection: oe,
499
+ disableEdit: ce,
500
+ enableEdit: re,
501
+ expandNode: we,
502
+ expandNodeAll: ve,
503
+ focusNode: ue,
504
+ getData: ie,
505
+ getDataString: se,
506
+ initLeft: ge,
507
+ initRight: me,
508
+ initSide: ye,
509
+ install: fe,
510
+ move: de,
511
+ refresh: be,
512
+ scale: le,
513
+ scaleFit: ae,
514
+ scrollIntoView: Qt,
515
+ selectNode: te,
516
+ selectNodes: ee,
517
+ stringifyData: Dt,
518
+ toCenter: he,
519
+ unselectNodes: ne
520
+ }, Symbol.toStringTag, { value: "Module" })), Ce = 40, Ee = 10, Se = ({ deltaMode: t, deltaY: e, viewportHeight: n }) => t === WheelEvent.DOM_DELTA_LINE ? e * Ce : t === WheelEvent.DOM_DELTA_PAGE ? e * n : e, Te = ({ deltaMode: t, deltaY: e, scaleSensitivity: n, viewportHeight: o }) => {
521
+ const i = -Se({ deltaMode: t, deltaY: e, viewportHeight: o }) / Ee * n;
522
+ return Math.max(-n, Math.min(n, i));
523
+ }, Le = (t, e, n) => {
524
+ e !== 0 && t.scale(t.scaleVal + e, n);
525
+ }, De = (t, e) => {
526
+ const n = Te({
527
+ deltaMode: e.deltaMode,
528
+ deltaY: e.deltaY,
529
+ scaleSensitivity: t.scaleSensitivity,
530
+ viewportHeight: t.container.clientHeight || window.innerHeight
531
+ });
532
+ Le(t, n, { x: e.clientX, y: e.clientY });
440
533
  };
441
- class ve {
442
- mind;
443
- isMoving = !1;
444
- interval = null;
445
- speed = 20;
446
- constructor(e) {
447
- this.mind = e;
448
- }
449
- move(e, n) {
450
- this.isMoving || (this.isMoving = !0, this.interval = setInterval(() => {
451
- this.mind.move(e * this.speed * this.mind.scaleVal, n * this.speed * this.mind.scaleVal);
452
- }, 100));
453
- }
454
- stop() {
455
- this.isMoving = !1, this.interval && (clearInterval(this.interval), this.interval = null);
456
- }
457
- }
458
- function we(t) {
459
- return {
460
- isDragging: !1,
461
- insertType: null,
462
- meet: null,
463
- ghost: ye(t),
464
- edgeMoveController: new ve(t),
465
- startX: 0,
466
- startY: 0,
467
- pointerId: null
468
- };
469
- }
470
- const be = 5;
471
- function mt(t, e, n, o = !1) {
472
- if (t.spacePressed) return !1;
473
- const s = n.target;
474
- if (s?.tagName !== "ME-TPC" || !s.nodeObj.parent) return !1;
475
- e.startX = n.clientX, e.startY = n.clientY, e.pointerId = n.pointerId, t.selection?.cancel();
476
- let i = t.currentNodes;
477
- return i?.includes(s) || (t.selectNode(s), i = t.currentNodes), t.dragged = i, o && Mt(t, e), !0;
478
- }
479
- function Dt(t, e, n) {
480
- t.style.transform = `translate(${e - 10}px, ${n - 10}px)`, t.style.display = "block";
481
- }
482
- function Mt(t, e) {
483
- const { dragged: n } = t;
484
- if (!n) return;
485
- const o = document.activeElement;
486
- o && o.isContentEditable && o.blur(), e.isDragging = !0, n.length > 1 ? e.ghost.innerHTML = n.length + "" : e.ghost.innerHTML = n[0].innerHTML;
487
- for (const s of n)
488
- s.parentElement.parentElement.style.opacity = "0.5";
489
- t.dragMoveHelper.clear();
490
- }
491
- function xe(t, e, n) {
492
- const { dragged: o } = t;
493
- if (!o || e.pointerId !== n.pointerId) return;
494
- const s = n.clientX - e.startX, i = n.clientY - e.startY, r = Math.sqrt(s * s + i * i);
495
- if (!e.isDragging && r > be && Mt(t, e), !e.isDragging) return;
496
- const c = t.container.getBoundingClientRect();
497
- Dt(e.ghost, n.clientX - c.x, n.clientY - c.y), n.clientX < c.x + 50 ? e.edgeMoveController.move(1, 0) : n.clientX > c.x + c.width - 50 ? e.edgeMoveController.move(-1, 0) : n.clientY < c.y + 50 ? e.edgeMoveController.move(0, 1) : n.clientY > c.y + c.height - 50 ? e.edgeMoveController.move(0, -1) : e.edgeMoveController.stop(), Z(e.meet);
498
- const a = 12 * t.scaleVal, l = document.elementFromPoint(n.clientX, n.clientY - a);
499
- if (gt(l, o)) {
500
- e.meet = l;
501
- const h = l.getBoundingClientRect(), f = h.y;
502
- n.clientY > f + h.height ? e.insertType = "after" : e.insertType = "in";
503
- } else {
504
- const h = document.elementFromPoint(n.clientX, n.clientY + a);
505
- if (gt(h, o)) {
506
- e.meet = h;
507
- const u = h.getBoundingClientRect().y;
508
- n.clientY < u ? e.insertType = "before" : e.insertType = "in";
509
- } else
510
- e.insertType = null, e.meet = null;
511
- }
512
- e.meet && me(e.meet, e.insertType);
513
- }
514
- function Ce(t, e, n) {
515
- const { dragged: o } = t;
516
- if (!(!o || e.pointerId !== n.pointerId)) {
517
- e.edgeMoveController.stop();
518
- for (const s of o)
519
- s.parentElement.parentElement.style.opacity = "1";
520
- e.ghost.style.display = "none", e.ghost.innerHTML = "", e.isDragging && e.meet && (Z(e.meet), e.insertType === "before" ? t.moveNodeBefore(o, e.meet) : e.insertType === "after" ? t.moveNodeAfter(o, e.meet) : e.insertType === "in" && t.moveNodeIn(o, e.meet)), t.dragged = null, e.isDragging = !1, e.insertType = null, e.meet = null, e.pointerId = null;
521
- }
522
- }
523
- function ot(t, e) {
524
- const { dragged: n } = t;
525
- if (n) {
526
- e.edgeMoveController.stop();
527
- for (const o of n)
528
- o.parentElement.parentElement.style.opacity = "1";
529
- e.meet && Z(e.meet), e.ghost.style.display = "none", e.ghost.innerHTML = "", t.dragged = null, e.isDragging = !1, e.insertType = null, e.meet = null, e.pointerId = null;
530
- }
531
- }
532
- function Ee(t) {
533
- const { dragMoveHelper: e } = t;
534
- let n = 0;
534
+ function Me(t) {
535
+ const { panHelper: e } = t;
536
+ let n = 0, o = null;
535
537
  t.spacePressed = !1;
536
- let o = null;
537
- const s = /* @__PURE__ */ new Map(), i = we(t);
538
- let r = null, c = null, a = null, l = null;
539
- const h = 500, f = 10, u = () => {
540
- r !== null && (clearTimeout(r), r = null, c = null, a = null, l = null);
541
- }, y = (d, v) => {
542
- d.hasPointerCapture && d.hasPointerCapture(v) && d.releasePointerCapture(v);
543
- }, m = (d, v) => {
544
- if (d.id === "input-box" || d.closest("#input-box")) return !1;
545
- const E = d.closest(".svg-label");
538
+ let s = null;
539
+ const i = /* @__PURE__ */ new Map(), r = Bt(t);
540
+ let c = null, d = null, a = null, h = null;
541
+ const f = 500, p = 10, m = () => {
542
+ c !== null && (clearTimeout(c), c = null, d = null, a = null, h = null);
543
+ }, y = (l, w) => {
544
+ l.hasPointerCapture && l.hasPointerCapture(w) && l.releasePointerCapture(w);
545
+ }, u = (l, w) => {
546
+ if (l.id === "input-box" || l.closest("#input-box")) return !1;
547
+ const E = l.closest(".svg-label");
546
548
  if (E) {
547
- const $ = E.dataset.svgId, q = E.dataset.type, G = document.getElementById($);
548
- if (G) {
549
- if (q === "arrow")
550
- return v ? t.editArrowLabel(G) : t.selectArrow(G), !0;
551
- if (q === "summary")
552
- return v ? t.editSummary(G) : t.selectSummary(G), !0;
549
+ const D = E.dataset.svgId, V = E.dataset.type, z = document.getElementById(D);
550
+ if (z) {
551
+ if (V === "arrow")
552
+ return w ? t.editArrowLabel(z) : t.selectArrow(z), !0;
553
+ if (V === "summary")
554
+ return w ? t.editSummary(z) : t.selectSummary(z), !0;
553
555
  }
554
556
  }
555
- if (d.closest(".topiclinks")) {
556
- const $ = d.closest("g");
557
- if ($)
558
- return v ? t.editArrowLabel($) : t.selectArrow($), !0;
557
+ if (l.closest(".topiclinks")) {
558
+ const D = l.closest("g");
559
+ if (D)
560
+ return w ? t.editArrowLabel(D) : t.selectArrow(D), !0;
559
561
  }
560
- if (d.closest(".summary")) {
561
- const $ = d.closest("g");
562
- if ($)
563
- return v ? t.editSummary($) : t.selectSummary($), !0;
562
+ if (l.closest(".summary")) {
563
+ const D = l.closest("g");
564
+ if (D)
565
+ return w ? t.editSummary(D) : t.selectSummary(D), !0;
564
566
  }
565
567
  return !1;
566
- }, p = (d) => {
567
- if (d.button !== 0) return;
568
+ }, g = (l) => {
569
+ if (l.pointerType === "mouse" && l.button !== 0) return;
568
570
  if (t.helper1?.moved) {
569
571
  t.helper1.clear();
570
572
  return;
@@ -577,116 +579,125 @@ function Ee(t) {
577
579
  e.clear();
578
580
  return;
579
581
  }
580
- if (i?.isDragging)
582
+ if (r?.isDragging)
581
583
  return;
582
- const v = d.target;
583
- if (v.tagName === "ME-EPD")
584
- d.ctrlKey || d.metaKey ? t.expandNodeAll(v.previousSibling) : t.expandNode(v.previousSibling);
585
- else if (v.tagName === "ME-TPC" && t.currentNodes.length > 1)
586
- t.selectNode(v);
584
+ const w = l.target;
585
+ if (w.tagName === "ME-EPD")
586
+ l.ctrlKey || l.metaKey ? t.expandNodeAll(w.previousSibling) : t.expandNode(w.previousSibling);
587
587
  else if (!t.editable)
588
588
  return;
589
- m(v, !1);
590
- }, g = (d) => {
589
+ u(w, !1);
590
+ }, b = (l) => {
591
591
  if (!t.editable) return;
592
- const v = d.target;
593
- nt(v) && t.beginEdit(v), m(v, !0);
594
- }, b = (d) => {
595
- if (d.pointerType === "mouse" || s.size > 1) return;
596
- const v = (/* @__PURE__ */ new Date()).getTime(), E = v - n;
597
- E < 300 && E > 0 && g(d), n = v;
598
- }, w = (d) => {
599
- d.code === "Space" && (t.spacePressed = !0, t.container.classList.add("space-pressed"));
600
- }, x = (d) => {
601
- d.code === "Space" && (t.spacePressed = !1, t.container.classList.remove("space-pressed"));
602
- }, S = (d) => {
603
- if (d.pointerType === "touch" && (s.set(d.pointerId, { x: d.clientX, y: d.clientY }), s.size === 2)) {
604
- const [$, q] = Array.from(s.values());
605
- o = ut($, q), u();
592
+ const w = l.target;
593
+ q(w) && t.beginEdit(w), u(w, !0);
594
+ }, v = (l) => {
595
+ l.code === "Space" && (t.spacePressed = !0, t.container.classList.add("space-pressed"));
596
+ }, x = (l) => {
597
+ l.code === "Space" && (t.spacePressed = !1, t.container.classList.remove("space-pressed"));
598
+ }, S = (l) => {
599
+ if (l.pointerType === "touch" && (i.set(l.pointerId, { x: l.clientX, y: l.clientY }), i.size === 2)) {
600
+ const [D, V] = Array.from(i.values());
601
+ s = ut(D, V), m();
606
602
  }
607
603
  e.moved = !1;
608
- const v = d.target, E = t.mouseSelectionButton === 0 ? 2 : 0;
609
- if (t.editable && i && (d.button === 0 || d.pointerType === "touch")) {
610
- if (d.pointerType === "touch" && s.size > 1)
611
- (i.isDragging || i.pointerId !== null) && ot(t, i);
612
- else if (d.pointerType === "touch" && s.size === 1)
613
- (nt(v) || v.closest("me-tpc")) && (c = { x: d.clientX, y: d.clientY }, a = v, l = d.pointerId, r = window.setTimeout(() => {
614
- mt(t, i, d, !0) && (a && a.setPointerCapture(d.pointerId), Dt(i.ghost, d.clientX, d.clientY)), r = null, c = null, a = null, l = null;
615
- }, h));
616
- else if (d.pointerType === "mouse" && mt(t, i, d, !1)) {
617
- v.setPointerCapture(d.pointerId);
604
+ const w = l.target, E = t.mouseSelectionButton === 0 ? 2 : 0;
605
+ if (t.editable && (l.button === 0 || l.pointerType === "touch") && q(w)) {
606
+ t.selection?.cancel();
607
+ const D = t.currentNodes || [];
608
+ if (l.ctrlKey || l.metaKey)
609
+ if (D.includes(w)) {
610
+ t.selection?.deselect(w);
611
+ return;
612
+ } else
613
+ t.selection?.select(w);
614
+ else D.includes(w) || t.selectNode(w);
615
+ }
616
+ if (t.editable && (l.button === 0 || l.pointerType === "touch")) {
617
+ if (l.pointerType === "touch" && i.size > 1)
618
+ (r.isDragging || r.pointerId !== null) && ot(t, r);
619
+ else if (l.pointerType === "touch" && i.size === 1)
620
+ (q(w) || w.closest("me-tpc")) && (d = { x: l.clientX, y: l.clientY }, a = w, h = l.pointerId, c = window.setTimeout(() => {
621
+ gt(t, r, l, !0) && (a && a.setPointerCapture(l.pointerId), Ct(r.ghost, l.clientX, l.clientY)), c = null, d = null, a = null, h = null;
622
+ }, f));
623
+ else if (l.pointerType === "mouse" && gt(t, r, l, !1)) {
624
+ w.setPointerCapture(l.pointerId);
618
625
  return;
619
626
  }
620
627
  }
621
- const P = t.spacePressed && d.button === 0 && d.pointerType === "mouse", B = !t.editable || d.button === E && d.pointerType === "mouse" || d.pointerType === "touch";
622
- !P && !B || (e.x = d.clientX, e.y = d.clientY, v.className !== "circle" && v.contentEditable !== "plaintext-only" && (e.mousedown = !0, v.setPointerCapture(d.pointerId)));
623
- }, T = (d) => {
624
- if (d.pointerType === "touch" && s.has(d.pointerId)) {
625
- if (s.set(d.pointerId, { x: d.clientX, y: d.clientY }), r !== null && c !== null && d.pointerId === l) {
626
- const v = d.clientX - c.x, E = d.clientY - c.y;
627
- Math.sqrt(v * v + E * E) > f && u();
628
+ const N = t.spacePressed && l.button === 0 && l.pointerType === "mouse", B = !t.editable || l.button === E && l.pointerType === "mouse" || l.pointerType === "touch";
629
+ !N && !B || (e.x = l.clientX, e.y = l.clientY, w.className !== "circle" && w.contentEditable !== "plaintext-only" && (e.mousedown = !0, w.setPointerCapture(l.pointerId)));
630
+ }, T = (l) => {
631
+ if (l.pointerType === "touch" && i.has(l.pointerId)) {
632
+ if (i.set(l.pointerId, { x: l.clientX, y: l.clientY }), c !== null && d !== null && l.pointerId === h) {
633
+ const w = l.clientX - d.x, E = l.clientY - d.y;
634
+ Math.sqrt(w * w + E * E) > p && m();
628
635
  }
629
- if (s.size >= 2) {
630
- const [v, E] = Array.from(s.values()), P = ut(v, E);
631
- if (o == null)
632
- o = P;
636
+ if (i.size >= 2) {
637
+ const [w, E] = Array.from(i.values()), N = ut(w, E);
638
+ if (s == null)
639
+ s = N;
633
640
  else {
634
- if (o > 0) {
635
- const B = P / o;
641
+ if (s > 0) {
642
+ const B = N / s;
636
643
  t.scale(t.scaleVal * B, {
637
- x: (v.x + E.x) / 2,
638
- y: (v.y + E.y) / 2
644
+ x: (w.x + E.x) / 2,
645
+ y: (w.y + E.y) / 2
639
646
  });
640
647
  }
641
- o = P;
648
+ s = N;
642
649
  }
643
650
  return;
644
651
  }
645
652
  }
646
- if (!(i && i.pointerId !== null && (xe(t, i, d), i.isDragging))) {
647
- if (d.target.contentEditable !== "plaintext-only" || t.spacePressed && e.mousedown) {
648
- const v = d.clientX - e.x, E = d.clientY - e.y;
649
- e.onMove(v, E);
653
+ if (!(r && r.pointerId !== null && (Rt(t, r, l), r.isDragging))) {
654
+ if (l.target.contentEditable !== "plaintext-only" || t.spacePressed && e.mousedown) {
655
+ const w = l.clientX - e.x, E = l.clientY - e.y;
656
+ e.onMove(w, E);
650
657
  }
651
- e.x = d.clientX, e.y = d.clientY;
658
+ e.x = l.clientX, e.y = l.clientY;
652
659
  }
653
- }, L = (d) => {
654
- if (d.pointerType === "touch" && (s.delete(d.pointerId), s.size < 2 && (o = null), u()), i && i.pointerId !== null) {
655
- const v = i.isDragging;
656
- if (Ce(t, i, d), y(d.target, d.pointerId), v)
660
+ }, L = (l) => {
661
+ if (l.pointerType === "touch" && (i.delete(l.pointerId), i.size < 2 && (s = null), m()), r && r.pointerId !== null) {
662
+ const E = r.isDragging;
663
+ if (Xt(t, r, l), y(l.target, l.pointerId), E)
657
664
  return;
658
665
  }
659
- e.mousedown && (y(d.target, d.pointerId), e.clear());
666
+ if (l.pointerType === "touch" && i.size === 0 && !e.moved) {
667
+ const E = (/* @__PURE__ */ new Date()).getTime(), N = E - n;
668
+ N < 300 && N > 0 && o === l.target && b(l), n = E, o = l.target;
669
+ }
670
+ e.mousedown && (y(l.target, l.pointerId), e.clear());
660
671
  }, C = () => {
661
- u(), e.mousedown && e.clear(), i && (i.isDragging || i.pointerId !== null) && ot(t, i);
662
- }, N = (d) => {
663
- d.pointerType === "touch" && (s.delete(d.pointerId), s.size < 2 && (o = null), u()), i && i.pointerId === d.pointerId && ot(t, i), L(d);
664
- }, M = (d) => {
665
- if (d.preventDefault(), d.button !== 2 || !t.editable) return;
666
- const v = d.target;
667
- nt(v) && !v.classList.contains("selected") && t.selectNode(v), setTimeout(() => {
668
- t.dragMoveHelper.moved || t.bus.fire("showContextMenu", d);
672
+ m(), e.mousedown && e.clear(), r && (r.isDragging || r.pointerId !== null) && ot(t, r);
673
+ }, P = (l) => {
674
+ l.pointerType === "touch" && (i.delete(l.pointerId), i.size < 2 && (s = null), m()), r && r.pointerId === l.pointerId && ot(t, r), L(l);
675
+ }, k = (l) => {
676
+ if (l.preventDefault(), l.button !== 2 || !t.editable) return;
677
+ const w = l.target;
678
+ q(w) && !w.classList.contains("selected") && t.selectNode(w), setTimeout(() => {
679
+ t.panHelper.moved || t.bus.fire("showContextMenu", l);
669
680
  }, 200);
670
- }, Y = (d) => {
671
- d.stopPropagation(), d.preventDefault(), d.ctrlKey || d.metaKey ? d.deltaY < 0 ? pt(t, "in", t.dragMoveHelper) : t.scaleVal - t.scaleSensitivity > 0 && pt(t, "out", t.dragMoveHelper) : d.shiftKey ? t.move(-d.deltaY, 0) : t.move(-d.deltaX, -d.deltaY);
672
- }, { container: k } = t;
673
- return Ct([
674
- { dom: k, evt: "pointerdown", func: S },
675
- { dom: k, evt: "pointermove", func: T },
676
- { dom: k, evt: "pointerup", func: L },
677
- { dom: k, evt: "pointercancel", func: N },
678
- // Using pointerdown might cause iOS IME jitter, making it uneditable?
679
- { dom: k, evt: "pointerup", func: b },
680
- { dom: k, evt: "click", func: p },
681
- { dom: k, evt: "dblclick", func: g },
682
- { dom: k, evt: "contextmenu", func: M },
683
- { dom: k, evt: "wheel", func: typeof t.handleWheel == "function" ? t.handleWheel : Y },
684
- { dom: k, evt: "blur", func: C },
685
- { dom: k, evt: "keydown", func: w },
686
- { dom: k, evt: "keyup", func: x }
681
+ }, Y = (l) => {
682
+ if (l.stopPropagation(), l.preventDefault(), l.ctrlKey || l.metaKey) return De(t, l);
683
+ if (l.shiftKey) return t.move(-l.deltaY, 0);
684
+ t.move(-l.deltaX, -l.deltaY);
685
+ }, { container: A } = t;
686
+ return xt([
687
+ { dom: A, evt: "pointerdown", func: S },
688
+ { dom: A, evt: "pointermove", func: T },
689
+ { dom: A, evt: "pointerup", func: L },
690
+ { dom: A, evt: "pointercancel", func: P },
691
+ { dom: A, evt: "click", func: g },
692
+ { dom: A, evt: "dblclick", func: b },
693
+ { dom: A, evt: "contextmenu", func: k },
694
+ { dom: A, evt: "wheel", func: typeof t.handleWheel == "function" ? t.handleWheel : Y },
695
+ { dom: A, evt: "blur", func: C },
696
+ { dom: A, evt: "keydown", func: v },
697
+ { dom: A, evt: "keyup", func: x }
687
698
  ]);
688
699
  }
689
- function Se() {
700
+ function ke() {
690
701
  return {
691
702
  handlers: {},
692
703
  addListener: function(t, e) {
@@ -710,30 +721,30 @@ function Se() {
710
721
  }
711
722
  };
712
723
  }
713
- const I = "http://www.w3.org/2000/svg", tt = function(t) {
724
+ const I = "http://www.w3.org/2000/svg", et = function(t) {
714
725
  const e = t.clientWidth, n = t.clientHeight, o = t.dataset, s = Number(o.x), i = Number(o.y), r = o.anchor;
715
726
  let c = s;
716
727
  r === "middle" ? c = s - e / 2 : r === "end" && (c = s - e), t.style.left = `${c}px`, t.style.top = `${i - n / 2}px`, t.style.visibility = "visible";
717
728
  }, it = function(t, e, n, o) {
718
- const { anchor: s = "middle", color: i, dataType: r, svgId: c } = o, a = document.createElement("div");
719
- a.className = "svg-label", a.style.color = i || "#666";
720
- const l = "label-" + c;
721
- return a.id = l, a.innerHTML = t, a.dataset.type = r, a.dataset.svgId = c, a.dataset.x = e.toString(), a.dataset.y = n.toString(), a.dataset.anchor = s, a;
722
- }, kt = function(t, e, n) {
729
+ const { anchor: s = "middle", color: i, dataType: r, svgId: c } = o, d = document.createElement("div");
730
+ d.className = "svg-label", d.style.color = i || "#666";
731
+ const a = "label-" + c;
732
+ return d.id = a, d.innerHTML = t, d.dataset.type = r, d.dataset.svgId = c, d.dataset.x = e.toString(), d.dataset.y = n.toString(), d.dataset.anchor = s, d;
733
+ }, Mt = function(t, e, n) {
723
734
  const o = document.createElementNS(I, "path");
724
- return D(o, {
735
+ return M(o, {
725
736
  d: t,
726
737
  stroke: e || "#666",
727
738
  fill: "none",
728
739
  "stroke-width": n
729
740
  }), o;
730
- }, z = function(t) {
741
+ }, F = function(t) {
731
742
  const e = document.createElementNS(I, "svg");
732
743
  return e.setAttribute("class", t), e.setAttribute("overflow", "visible"), e;
733
- }, yt = function() {
744
+ }, mt = function() {
734
745
  const t = document.createElementNS(I, "line");
735
746
  return t.setAttribute("stroke", "#4dc4ff"), t.setAttribute("fill", "none"), t.setAttribute("stroke-width", "2"), t.setAttribute("opacity", "0.45"), t;
736
- }, Te = function(t, e, n, o) {
747
+ }, Ne = function(t, e, n, o) {
737
748
  const s = document.createElementNS(I, "g");
738
749
  return [
739
750
  {
@@ -749,30 +760,30 @@ const I = "http://www.w3.org/2000/svg", tt = function(t) {
749
760
  d: n
750
761
  }
751
762
  ].forEach((r, c) => {
752
- const a = r.d, l = document.createElementNS(I, "path"), h = {
753
- d: a,
763
+ const d = r.d, a = document.createElementNS(I, "path"), h = {
764
+ d,
754
765
  stroke: o?.stroke || "rgb(227, 125, 116)",
755
766
  fill: "none",
756
767
  "stroke-linecap": o?.strokeLinecap || "cap",
757
768
  "stroke-width": String(o?.strokeWidth || "2")
758
769
  };
759
- o?.opacity !== void 0 && (h.opacity = String(o.opacity)), D(l, h), c === 0 && l.setAttribute("stroke-dasharray", o?.strokeDasharray || "8,2");
770
+ o?.opacity !== void 0 && (h.opacity = String(o.opacity)), M(a, h), c === 0 && a.setAttribute("stroke-dasharray", o?.strokeDasharray || "8,2");
760
771
  const f = document.createElementNS(I, "path");
761
- D(f, {
762
- d: a,
772
+ M(f, {
773
+ d,
763
774
  stroke: "transparent",
764
775
  fill: "none",
765
776
  "stroke-width": "15"
766
- }), s.appendChild(f), s.appendChild(l), s[r.name] = l;
777
+ }), s.appendChild(f), s.appendChild(a), s[r.name] = a;
767
778
  }), s;
768
- }, Nt = function(t, e, n) {
779
+ }, kt = function(t, e, n) {
769
780
  if (!e) return;
770
781
  const o = n.label, s = e.cloneNode(!0);
771
782
  t.nodes.appendChild(s), s.id = "input-box", s.textContent = o, s.contentEditable = "plaintext-only", s.spellcheck = !1, s.style.cssText = `
772
783
  left:${e.style.left};
773
784
  top:${e.style.top};
774
785
  max-width: 200px;
775
- `, Tt(s), t.scrollIntoView(s), s.addEventListener("keydown", (i) => {
786
+ `, Lt(s), t.scrollIntoView(s), s.addEventListener("keydown", (i) => {
776
787
  i.stopPropagation();
777
788
  const r = i.key;
778
789
  if (r === "Enter" || r === "Tab") {
@@ -782,7 +793,7 @@ const I = "http://www.w3.org/2000/svg", tt = function(t) {
782
793
  }), s.addEventListener("blur", () => {
783
794
  if (!s) return;
784
795
  const i = s.innerText?.trim() || "";
785
- i === "" ? n.label = o : n.label = i, s.remove(), i !== o && (t.markdown ? e.innerHTML = t.markdown(n.label, n) : e.textContent = n.label, tt(e), "parent" in n ? t.bus.fire("operation", {
796
+ i === "" ? n.label = o : n.label = i, s.remove(), i !== o && (t.markdown ? e.innerHTML = t.markdown(n.label, n) : e.textContent = n.label, et(e), "parent" in n ? t.bus.fire("operation", {
786
797
  name: "finishEditSummary",
787
798
  obj: n
788
799
  }) : t.bus.fire("operation", {
@@ -790,62 +801,62 @@ const I = "http://www.w3.org/2000/svg", tt = function(t) {
790
801
  obj: n
791
802
  }));
792
803
  });
793
- }, Le = function(t) {
804
+ }, Pe = function(t) {
794
805
  const e = this.map.querySelector("me-root"), n = e.offsetTop, o = e.offsetLeft, s = e.offsetWidth, i = e.offsetHeight, r = this.map.querySelectorAll("me-main > me-wrapper");
795
806
  this.lines.innerHTML = "";
796
807
  for (let c = 0; c < r.length; c++) {
797
- const a = r[c], l = a.querySelector("me-tpc"), { offsetLeft: h, offsetTop: f } = H(this.nodes, l), u = l.offsetWidth, y = l.offsetHeight, m = a.parentNode.className, p = this.generateMainBranch({ pT: n, pL: o, pW: s, pH: i, cT: f, cL: h, cW: u, cH: y, direction: m, containerHeight: this.nodes.offsetHeight }), g = this.theme.palette, b = l.nodeObj.branchColor || g[c % g.length];
798
- if (l.style.borderColor = b, this.lines.appendChild(kt(p, b, "3")), t && t !== a)
808
+ const d = r[c], a = d.querySelector("me-tpc"), { offsetLeft: h, offsetTop: f } = H(this.nodes, a), p = a.offsetWidth, m = a.offsetHeight, y = d.parentNode.className, u = this.generateMainBranch({ pT: n, pL: o, pW: s, pH: i, cT: f, cL: h, cW: p, cH: m, direction: y, containerHeight: this.nodes.offsetHeight }), g = this.theme.palette, b = a.nodeObj.branchColor || g[c % g.length];
809
+ if (a.style.borderColor = b, this.lines.appendChild(Mt(u, b, "3")), t && t !== d)
799
810
  continue;
800
- const w = z("subLines"), x = a.lastChild;
801
- x.tagName === "svg" && x.remove(), a.appendChild(w), $t(this, w, b, a, m, !0);
811
+ const v = F("subLines"), x = d.lastChild;
812
+ x.tagName === "svg" && x.remove(), d.appendChild(v), Nt(this, v, b, d, y, !0);
802
813
  }
803
814
  this.labelContainer.innerHTML = "", this.renderArrow(), this.renderSummary(), this.bus.fire("linkDiv");
804
- }, $t = function(t, e, n, o, s, i) {
815
+ }, Nt = function(t, e, n, o, s, i) {
805
816
  const r = o.firstChild, c = o.children[1].children;
806
817
  if (c.length === 0) return;
807
- const a = r.offsetTop, l = r.offsetLeft, h = r.offsetWidth, f = r.offsetHeight;
808
- for (let u = 0; u < c.length; u++) {
809
- const y = c[u], m = y.firstChild, p = m.offsetTop, g = m.offsetLeft, b = m.offsetWidth, w = m.offsetHeight, x = m.firstChild.nodeObj.branchColor || n, S = t.generateSubBranch({ pT: a, pL: l, pW: h, pH: f, cT: p, cL: g, cW: b, cH: w, direction: s, isFirst: i });
810
- e.appendChild(kt(S, x, "2"));
811
- const T = m.children[1];
818
+ const d = r.offsetTop, a = r.offsetLeft, h = r.offsetWidth, f = r.offsetHeight;
819
+ for (let p = 0; p < c.length; p++) {
820
+ const m = c[p], y = m.firstChild, u = y.offsetTop, g = y.offsetLeft, b = y.offsetWidth, v = y.offsetHeight, x = y.firstChild.nodeObj.branchColor || n, S = t.generateSubBranch({ pT: d, pL: a, pW: h, pH: f, cT: u, cL: g, cW: b, cH: v, direction: s, isFirst: i });
821
+ e.appendChild(Mt(S, x, "2"));
822
+ const T = y.children[1];
812
823
  if (T) {
813
824
  if (!T.expanded) continue;
814
825
  } else
815
826
  continue;
816
- $t(t, e, x, y, s);
827
+ Nt(t, e, x, m, s);
817
828
  }
818
- }, De = '<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg t="1750169394918" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="2021" xmlns:xlink="http://www.w3.org/1999/xlink" width="200" height="200"><path d="M851.91168 328.45312c-59.97056 0-108.6208 48.47104-108.91264 108.36992l-137.92768 38.4a109.14304 109.14304 0 0 0-63.46752-46.58688l1.39264-137.11872c47.29344-11.86816 82.31936-54.66624 82.31936-105.64096 0-60.15488-48.76288-108.91776-108.91776-108.91776s-108.91776 48.76288-108.91776 108.91776c0 49.18784 32.60928 90.75712 77.38368 104.27392l-1.41312 138.87488a109.19936 109.19936 0 0 0-63.50336 48.55808l-138.93632-39.48544 0.01024-0.72704c0-60.15488-48.76288-108.91776-108.91776-108.91776s-108.91776 48.75776-108.91776 108.91776c0 60.15488 48.76288 108.91264 108.91776 108.91264 39.3984 0 73.91232-20.92032 93.03552-52.2496l139.19232 39.552-0.00512 0.2304c0 25.8304 9.00096 49.5616 24.02816 68.23424l-90.14272 132.63872a108.7488 108.7488 0 0 0-34.2528-5.504c-60.15488 0-108.91776 48.768-108.91776 108.91776 0 60.16 48.76288 108.91776 108.91776 108.91776 60.16 0 108.92288-48.75776 108.92288-108.91776 0-27.14624-9.9328-51.968-26.36288-71.04l89.04704-131.03104a108.544 108.544 0 0 0 37.6832 6.70208 108.672 108.672 0 0 0 36.48512-6.272l93.13792 132.57216a108.48256 108.48256 0 0 0-24.69888 69.0688c0 60.16 48.768 108.92288 108.91776 108.92288 60.16 0 108.91776-48.76288 108.91776-108.92288 0-60.14976-48.75776-108.91776-108.91776-108.91776a108.80512 108.80512 0 0 0-36.69504 6.3488l-93.07136-132.48a108.48768 108.48768 0 0 0 24.79616-72.22784l136.09984-37.888c18.99008 31.93856 53.84192 53.3504 93.69088 53.3504 60.16 0 108.92288-48.75776 108.92288-108.91264-0.00512-60.15488-48.77312-108.92288-108.92288-108.92288z" p-id="2022"></path></svg>', Me = '<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg t="1750169375313" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="1775" xmlns:xlink="http://www.w3.org/1999/xlink" width="200" height="200"><path d="M639 463.30000001L639 285.1c0-36.90000001-26.4-68.5-61.3-68.5l-150.2 0c-1.5 0-3 0.1-4.5 0.3-10.2-38.7-45.5-67.3-87.5-67.3-50 0-90.5 40.5-90.5 90.5s40.5 90.5 90.5 90.5c42 0 77.3-28.6 87.5-67.39999999 1.4 0.3 2.9 0.4 4.5 0.39999999L577.7 263.6c6.8 0 14.3 8.9 14.3 21.49999999l0 427.00000001c0 12.7-7.40000001 21.5-14.30000001 21.5l-150.19999999 0c-1.5 0-3 0.2-4.5 0.4-10.2-38.8-45.5-67.3-87.5-67.3-50 0-90.5 40.5-90.5 90.4 0 49.9 40.5 90.6 90.5 90.59999999 42 0 77.3-28.6 87.5-67.39999999 1.4 0.2 2.9 0.4 4.49999999 0.4L577.7 780.7c34.80000001 0 61.3-31.6 61.3-68.50000001L639 510.3l79.1 0c10.4 38.5 45.49999999 67 87.4 67 50 0 90.5-40.5 90.5-90.5s-40.5-90.5-90.5-90.5c-41.79999999 0-77.00000001 28.4-87.4 67L639 463.30000001z" fill="currentColor" p-id="1776"></path></svg>', ke = '<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg t="1750169667709" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="3037" xmlns:xlink="http://www.w3.org/1999/xlink" width="200" height="200"><path d="M385 560.69999999L385 738.9c0 36.90000001 26.4 68.5 61.3 68.5l150.2 0c1.5 0 3-0.1 4.5-0.3 10.2 38.7 45.5 67.3 87.5 67.3 50 0 90.5-40.5 90.5-90.5s-40.5-90.5-90.5-90.5c-42 0-77.3 28.6-87.5 67.39999999-1.4-0.3-2.9-0.4-4.5-0.39999999L446.3 760.4c-6.8 0-14.3-8.9-14.3-21.49999999l0-427.00000001c0-12.7 7.40000001-21.5 14.30000001-21.5l150.19999999 0c1.5 0 3-0.2 4.5-0.4 10.2 38.8 45.5 67.3 87.5 67.3 50 0 90.5-40.5 90.5-90.4 0-49.9-40.5-90.6-90.5-90.59999999-42 0-77.3 28.6-87.5 67.39999999-1.4-0.2-2.9-0.4-4.49999999-0.4L446.3 243.3c-34.80000001 0-61.3 31.6-61.3 68.50000001L385 513.7l-79.1 0c-10.4-38.5-45.49999999-67-87.4-67-50 0-90.5 40.5-90.5 90.5s40.5 90.5 90.5 90.5c41.79999999 0 77.00000001-28.4 87.4-67L385 560.69999999z" fill="currentColor" p-id="3038"></path></svg>', Ne = '<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg t="1750169402629" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="2170" xmlns:xlink="http://www.w3.org/1999/xlink" width="200" height="200"><path d="M639.328 416c8.032 0 16.096-3.008 22.304-9.056l202.624-197.184-0.8 143.808c-0.096 17.696 14.144 32.096 31.808 32.192 0.064 0 0.128 0 0.192 0 17.6 0 31.904-14.208 32-31.808l1.248-222.208c0-0.672-0.352-1.248-0.384-1.92 0.032-0.512 0.288-0.896 0.288-1.408 0.032-17.664-14.272-32-31.968-32.032L671.552 96l-0.032 0c-17.664 0-31.968 14.304-32 31.968C639.488 145.632 653.824 160 671.488 160l151.872 0.224-206.368 200.8c-12.672 12.32-12.928 32.608-0.64 45.248C622.656 412.736 630.976 416 639.328 416z" p-id="2171"></path><path d="M896.032 639.552 896.032 639.552c-17.696 0-32 14.304-32.032 31.968l-0.224 151.872-200.832-206.4c-12.32-12.64-32.576-12.96-45.248-0.64-12.672 12.352-12.928 32.608-0.64 45.248l197.184 202.624-143.808-0.8c-0.064 0-0.128 0-0.192 0-17.6 0-31.904 14.208-32 31.808-0.096 17.696 14.144 32.096 31.808 32.192l222.24 1.248c0.064 0 0.128 0 0.192 0 0.64 0 1.12-0.32 1.76-0.352 0.512 0.032 0.896 0.288 1.408 0.288l0.032 0c17.664 0 31.968-14.304 32-31.968L928 671.584C928.032 653.952 913.728 639.584 896.032 639.552z" p-id="2172"></path><path d="M209.76 159.744l143.808 0.8c0.064 0 0.128 0 0.192 0 17.6 0 31.904-14.208 32-31.808 0.096-17.696-14.144-32.096-31.808-32.192L131.68 95.328c-0.064 0-0.128 0-0.192 0-0.672 0-1.248 0.352-1.888 0.384-0.448 0-0.8-0.256-1.248-0.256 0 0-0.032 0-0.032 0-17.664 0-31.968 14.304-32 31.968L96 352.448c-0.032 17.664 14.272 32 31.968 32.032 0 0 0.032 0 0.032 0 17.664 0 31.968-14.304 32-31.968l0.224-151.936 200.832 206.4c6.272 6.464 14.624 9.696 22.944 9.696 8.032 0 16.096-3.008 22.304-9.056 12.672-12.32 12.96-32.608 0.64-45.248L209.76 159.744z" p-id="2173"></path><path d="M362.368 617.056l-202.624 197.184 0.8-143.808c0.096-17.696-14.144-32.096-31.808-32.192-0.064 0-0.128 0-0.192 0-17.6 0-31.904 14.208-32 31.808l-1.248 222.24c0 0.704 0.352 1.312 0.384 2.016 0 0.448-0.256 0.832-0.256 1.312-0.032 17.664 14.272 32 31.968 32.032L352.448 928c0 0 0.032 0 0.032 0 17.664 0 31.968-14.304 32-31.968s-14.272-32-31.968-32.032l-151.936-0.224 206.4-200.832c12.672-12.352 12.96-32.608 0.64-45.248S375.008 604.704 362.368 617.056z" p-id="2174"></path></svg>', $e = '<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg t="1750169573443" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="2883" xmlns:xlink="http://www.w3.org/1999/xlink" width="200" height="200"><path d="M514.133333 488.533333m-106.666666 0a106.666667 106.666667 0 1 0 213.333333 0 106.666667 106.666667 0 1 0-213.333333 0Z" fill="currentColor" p-id="2884"></path><path d="M512 64C264.533333 64 64 264.533333 64 512c0 236.8 183.466667 428.8 416 445.866667v-134.4c-53.333333-59.733333-200.533333-230.4-200.533333-334.933334 0-130.133333 104.533333-234.666667 234.666666-234.666666s234.666667 104.533333 234.666667 234.666666c0 61.866667-49.066667 153.6-145.066667 270.933334l-59.733333 68.266666V960C776.533333 942.933333 960 748.8 960 512c0-247.466667-200.533333-448-448-448z" fill="currentColor" p-id="2885"></path></svg>', Ae = '<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg t="1750169419447" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="2480" xmlns:xlink="http://www.w3.org/1999/xlink" width="200" height="200"><path d="M863.328 482.56l-317.344-1.12L545.984 162.816c0-17.664-14.336-32-32-32s-32 14.336-32 32l0 318.4L159.616 480.064c-0.032 0-0.064 0-0.096 0-17.632 0-31.936 14.24-32 31.904C127.424 529.632 141.728 544 159.392 544.064l322.592 1.152 0 319.168c0 17.696 14.336 32 32 32s32-14.304 32-32l0-318.944 317.088 1.12c0.064 0 0.096 0 0.128 0 17.632 0 31.936-14.24 32-31.904C895.264 496.992 880.96 482.624 863.328 482.56z" p-id="2481"></path></svg>', Pe = '<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg t="1750169426515" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="2730" xmlns:xlink="http://www.w3.org/1999/xlink" width="200" height="200"><path d="M863.744 544 163.424 544c-17.664 0-32-14.336-32-32s14.336-32 32-32l700.32 0c17.696 0 32 14.336 32 32S881.44 544 863.744 544z" p-id="2731"></path></svg>', He = {
819
- side: De,
820
- left: Me,
821
- right: ke,
822
- full: Ne,
823
- living: $e,
824
- zoomin: Ae,
825
- zoomout: Pe
826
- }, R = (t, e) => {
829
+ }, Ae = '<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg t="1750169394918" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="2021" xmlns:xlink="http://www.w3.org/1999/xlink" width="200" height="200"><path d="M851.91168 328.45312c-59.97056 0-108.6208 48.47104-108.91264 108.36992l-137.92768 38.4a109.14304 109.14304 0 0 0-63.46752-46.58688l1.39264-137.11872c47.29344-11.86816 82.31936-54.66624 82.31936-105.64096 0-60.15488-48.76288-108.91776-108.91776-108.91776s-108.91776 48.76288-108.91776 108.91776c0 49.18784 32.60928 90.75712 77.38368 104.27392l-1.41312 138.87488a109.19936 109.19936 0 0 0-63.50336 48.55808l-138.93632-39.48544 0.01024-0.72704c0-60.15488-48.76288-108.91776-108.91776-108.91776s-108.91776 48.75776-108.91776 108.91776c0 60.15488 48.76288 108.91264 108.91776 108.91264 39.3984 0 73.91232-20.92032 93.03552-52.2496l139.19232 39.552-0.00512 0.2304c0 25.8304 9.00096 49.5616 24.02816 68.23424l-90.14272 132.63872a108.7488 108.7488 0 0 0-34.2528-5.504c-60.15488 0-108.91776 48.768-108.91776 108.91776 0 60.16 48.76288 108.91776 108.91776 108.91776 60.16 0 108.92288-48.75776 108.92288-108.91776 0-27.14624-9.9328-51.968-26.36288-71.04l89.04704-131.03104a108.544 108.544 0 0 0 37.6832 6.70208 108.672 108.672 0 0 0 36.48512-6.272l93.13792 132.57216a108.48256 108.48256 0 0 0-24.69888 69.0688c0 60.16 48.768 108.92288 108.91776 108.92288 60.16 0 108.91776-48.76288 108.91776-108.92288 0-60.14976-48.75776-108.91776-108.91776-108.91776a108.80512 108.80512 0 0 0-36.69504 6.3488l-93.07136-132.48a108.48768 108.48768 0 0 0 24.79616-72.22784l136.09984-37.888c18.99008 31.93856 53.84192 53.3504 93.69088 53.3504 60.16 0 108.92288-48.75776 108.92288-108.91264-0.00512-60.15488-48.77312-108.92288-108.92288-108.92288z" p-id="2022"></path></svg>', $e = '<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg t="1750169375313" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="1775" xmlns:xlink="http://www.w3.org/1999/xlink" width="200" height="200"><path d="M639 463.30000001L639 285.1c0-36.90000001-26.4-68.5-61.3-68.5l-150.2 0c-1.5 0-3 0.1-4.5 0.3-10.2-38.7-45.5-67.3-87.5-67.3-50 0-90.5 40.5-90.5 90.5s40.5 90.5 90.5 90.5c42 0 77.3-28.6 87.5-67.39999999 1.4 0.3 2.9 0.4 4.5 0.39999999L577.7 263.6c6.8 0 14.3 8.9 14.3 21.49999999l0 427.00000001c0 12.7-7.40000001 21.5-14.30000001 21.5l-150.19999999 0c-1.5 0-3 0.2-4.5 0.4-10.2-38.8-45.5-67.3-87.5-67.3-50 0-90.5 40.5-90.5 90.4 0 49.9 40.5 90.6 90.5 90.59999999 42 0 77.3-28.6 87.5-67.39999999 1.4 0.2 2.9 0.4 4.49999999 0.4L577.7 780.7c34.80000001 0 61.3-31.6 61.3-68.50000001L639 510.3l79.1 0c10.4 38.5 45.49999999 67 87.4 67 50 0 90.5-40.5 90.5-90.5s-40.5-90.5-90.5-90.5c-41.79999999 0-77.00000001 28.4-87.4 67L639 463.30000001z" fill="currentColor" p-id="1776"></path></svg>', He = '<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg t="1750169667709" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="3037" xmlns:xlink="http://www.w3.org/1999/xlink" width="200" height="200"><path d="M385 560.69999999L385 738.9c0 36.90000001 26.4 68.5 61.3 68.5l150.2 0c1.5 0 3-0.1 4.5-0.3 10.2 38.7 45.5 67.3 87.5 67.3 50 0 90.5-40.5 90.5-90.5s-40.5-90.5-90.5-90.5c-42 0-77.3 28.6-87.5 67.39999999-1.4-0.3-2.9-0.4-4.5-0.39999999L446.3 760.4c-6.8 0-14.3-8.9-14.3-21.49999999l0-427.00000001c0-12.7 7.40000001-21.5 14.30000001-21.5l150.19999999 0c1.5 0 3-0.2 4.5-0.4 10.2 38.8 45.5 67.3 87.5 67.3 50 0 90.5-40.5 90.5-90.4 0-49.9-40.5-90.6-90.5-90.59999999-42 0-77.3 28.6-87.5 67.39999999-1.4-0.2-2.9-0.4-4.49999999-0.4L446.3 243.3c-34.80000001 0-61.3 31.6-61.3 68.50000001L385 513.7l-79.1 0c-10.4-38.5-45.49999999-67-87.4-67-50 0-90.5 40.5-90.5 90.5s40.5 90.5 90.5 90.5c41.79999999 0 77.00000001-28.4 87.4-67L385 560.69999999z" fill="currentColor" p-id="3038"></path></svg>', Ie = '<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg t="1750169402629" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="2170" xmlns:xlink="http://www.w3.org/1999/xlink" width="200" height="200"><path d="M639.328 416c8.032 0 16.096-3.008 22.304-9.056l202.624-197.184-0.8 143.808c-0.096 17.696 14.144 32.096 31.808 32.192 0.064 0 0.128 0 0.192 0 17.6 0 31.904-14.208 32-31.808l1.248-222.208c0-0.672-0.352-1.248-0.384-1.92 0.032-0.512 0.288-0.896 0.288-1.408 0.032-17.664-14.272-32-31.968-32.032L671.552 96l-0.032 0c-17.664 0-31.968 14.304-32 31.968C639.488 145.632 653.824 160 671.488 160l151.872 0.224-206.368 200.8c-12.672 12.32-12.928 32.608-0.64 45.248C622.656 412.736 630.976 416 639.328 416z" p-id="2171"></path><path d="M896.032 639.552 896.032 639.552c-17.696 0-32 14.304-32.032 31.968l-0.224 151.872-200.832-206.4c-12.32-12.64-32.576-12.96-45.248-0.64-12.672 12.352-12.928 32.608-0.64 45.248l197.184 202.624-143.808-0.8c-0.064 0-0.128 0-0.192 0-17.6 0-31.904 14.208-32 31.808-0.096 17.696 14.144 32.096 31.808 32.192l222.24 1.248c0.064 0 0.128 0 0.192 0 0.64 0 1.12-0.32 1.76-0.352 0.512 0.032 0.896 0.288 1.408 0.288l0.032 0c17.664 0 31.968-14.304 32-31.968L928 671.584C928.032 653.952 913.728 639.584 896.032 639.552z" p-id="2172"></path><path d="M209.76 159.744l143.808 0.8c0.064 0 0.128 0 0.192 0 17.6 0 31.904-14.208 32-31.808 0.096-17.696-14.144-32.096-31.808-32.192L131.68 95.328c-0.064 0-0.128 0-0.192 0-0.672 0-1.248 0.352-1.888 0.384-0.448 0-0.8-0.256-1.248-0.256 0 0-0.032 0-0.032 0-17.664 0-31.968 14.304-32 31.968L96 352.448c-0.032 17.664 14.272 32 31.968 32.032 0 0 0.032 0 0.032 0 17.664 0 31.968-14.304 32-31.968l0.224-151.936 200.832 206.4c6.272 6.464 14.624 9.696 22.944 9.696 8.032 0 16.096-3.008 22.304-9.056 12.672-12.32 12.96-32.608 0.64-45.248L209.76 159.744z" p-id="2173"></path><path d="M362.368 617.056l-202.624 197.184 0.8-143.808c0.096-17.696-14.144-32.096-31.808-32.192-0.064 0-0.128 0-0.192 0-17.6 0-31.904 14.208-32 31.808l-1.248 222.24c0 0.704 0.352 1.312 0.384 2.016 0 0.448-0.256 0.832-0.256 1.312-0.032 17.664 14.272 32 31.968 32.032L352.448 928c0 0 0.032 0 0.032 0 17.664 0 31.968-14.304 32-31.968s-14.272-32-31.968-32.032l-151.936-0.224 206.4-200.832c12.672-12.352 12.96-32.608 0.64-45.248S375.008 604.704 362.368 617.056z" p-id="2174"></path></svg>', Oe = '<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg t="1750169573443" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="2883" xmlns:xlink="http://www.w3.org/1999/xlink" width="200" height="200"><path d="M514.133333 488.533333m-106.666666 0a106.666667 106.666667 0 1 0 213.333333 0 106.666667 106.666667 0 1 0-213.333333 0Z" fill="currentColor" p-id="2884"></path><path d="M512 64C264.533333 64 64 264.533333 64 512c0 236.8 183.466667 428.8 416 445.866667v-134.4c-53.333333-59.733333-200.533333-230.4-200.533333-334.933334 0-130.133333 104.533333-234.666667 234.666666-234.666666s234.666667 104.533333 234.666667 234.666666c0 61.866667-49.066667 153.6-145.066667 270.933334l-59.733333 68.266666V960C776.533333 942.933333 960 748.8 960 512c0-247.466667-200.533333-448-448-448z" fill="currentColor" p-id="2885"></path></svg>', Ye = '<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg t="1750169419447" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="2480" xmlns:xlink="http://www.w3.org/1999/xlink" width="200" height="200"><path d="M863.328 482.56l-317.344-1.12L545.984 162.816c0-17.664-14.336-32-32-32s-32 14.336-32 32l0 318.4L159.616 480.064c-0.032 0-0.064 0-0.096 0-17.632 0-31.936 14.24-32 31.904C127.424 529.632 141.728 544 159.392 544.064l322.592 1.152 0 319.168c0 17.696 14.336 32 32 32s32-14.304 32-32l0-318.944 317.088 1.12c0.064 0 0.096 0 0.128 0 17.632 0 31.936-14.24 32-31.904C895.264 496.992 880.96 482.624 863.328 482.56z" p-id="2481"></path></svg>', Be = '<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg t="1750169426515" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="2730" xmlns:xlink="http://www.w3.org/1999/xlink" width="200" height="200"><path d="M863.744 544 163.424 544c-17.664 0-32-14.336-32-32s14.336-32 32-32l700.32 0c17.696 0 32 14.336 32 32S881.44 544 863.744 544z" p-id="2731"></path></svg>', We = {
830
+ side: Ae,
831
+ left: $e,
832
+ right: He,
833
+ full: Ie,
834
+ living: Oe,
835
+ zoomin: Ye,
836
+ zoomout: Be
837
+ }, W = (t, e) => {
827
838
  const n = document.createElement("span");
828
- return n.id = t, n.innerHTML = He[e], n;
839
+ return n.id = t, n.innerHTML = We[e], n;
829
840
  };
830
- function Ie(t) {
831
- const e = document.createElement("div"), n = R("fullscreen", "full"), o = R("toCenter", "living"), s = R("zoomout", "zoomout"), i = R("zoomin", "zoomin");
841
+ function Re(t) {
842
+ const e = document.createElement("div"), n = W("fullscreen", "full"), o = W("toCenter", "living"), s = W("zoomout", "zoomout"), i = W("zoomin", "zoomin");
832
843
  e.appendChild(n), e.appendChild(o), e.appendChild(s), e.appendChild(i), e.className = "mind-elixir-toolbar rb";
833
844
  let r = null;
834
845
  const c = () => {
835
- const l = t.container.getBoundingClientRect(), h = at(t.map.style.transform), f = l.width / 2, u = l.height / 2, y = (f - h.x) / t.scaleVal, m = (u - h.y) / t.scaleVal;
846
+ const a = t.container.getBoundingClientRect(), h = at(t.map.style.transform), f = a.width / 2, p = a.height / 2, m = (f - h.x) / t.scaleVal, y = (p - h.y) / t.scaleVal;
836
847
  r = {
837
- containerRect: l,
848
+ containerRect: a,
838
849
  currentTransform: h,
839
- mapCenterX: y,
840
- mapCenterY: m
850
+ mapCenterX: m,
851
+ mapCenterY: y
841
852
  };
842
- }, a = () => {
853
+ }, d = () => {
843
854
  if (r) {
844
- const l = t.container.getBoundingClientRect(), h = l.width / 2, f = l.height / 2, u = h - r.mapCenterX * t.scaleVal, y = f - r.mapCenterY * t.scaleVal, m = u - r.currentTransform.x, p = y - r.currentTransform.y;
845
- t.move(m, p);
855
+ const a = t.container.getBoundingClientRect(), h = a.width / 2, f = a.height / 2, p = h - r.mapCenterX * t.scaleVal, m = f - r.mapCenterY * t.scaleVal, y = p - r.currentTransform.x, u = m - r.currentTransform.y;
856
+ t.move(y, u);
846
857
  }
847
858
  };
848
- return t.el.addEventListener("fullscreenchange", a), n.onclick = () => {
859
+ return t.el.addEventListener("fullscreenchange", d), n.onclick = () => {
849
860
  c(), document.fullscreenElement !== t.el ? t.el.requestFullscreen() : document.exitFullscreen();
850
861
  }, o.onclick = () => {
851
862
  t.toCenter();
@@ -855,8 +866,8 @@ function Ie(t) {
855
866
  t.scale(t.scaleVal + t.scaleSensitivity);
856
867
  }, e;
857
868
  }
858
- function Oe(t) {
859
- const e = document.createElement("div"), n = R("tbltl", "left"), o = R("tbltr", "right"), s = R("tblts", "side");
869
+ function Xe(t) {
870
+ const e = document.createElement("div"), n = W("tbltl", "left"), o = W("tbltr", "right"), s = W("tblts", "side");
860
871
  return e.appendChild(n), e.appendChild(o), e.appendChild(s), e.className = "mind-elixir-toolbar lt", n.onclick = () => {
861
872
  t.initLeft();
862
873
  }, o.onclick = () => {
@@ -865,10 +876,10 @@ function Oe(t) {
865
876
  t.initSide();
866
877
  }, e;
867
878
  }
868
- function Ye(t) {
869
- t.container.append(Ie(t)), t.container.append(Oe(t));
879
+ function Ge(t) {
880
+ t.container.append(Re(t)), t.container.append(Xe(t));
870
881
  }
871
- const Be = function(t, e = !0) {
882
+ const Ve = function(t, e = !0) {
872
883
  this.theme = t;
873
884
  const o = {
874
885
  ...(t.type === "dark" ? ct : rt).cssVar,
@@ -879,7 +890,7 @@ const Be = function(t, e = !0) {
879
890
  this.container.style.setProperty(r, o[r]);
880
891
  }
881
892
  e && this.refresh();
882
- }, Re = function(t) {
893
+ }, ze = function(t) {
883
894
  return {
884
895
  dom: t,
885
896
  moved: !1,
@@ -902,7 +913,7 @@ const Be = function(t, e = !0) {
902
913
  },
903
914
  cb: null,
904
915
  init(e, n) {
905
- this.cb = n, this.handleClear = this.handleClear.bind(this), this.handlePointerMove = this.handlePointerMove.bind(this), this.handlePointerDown = this.handlePointerDown.bind(this), this.destroy = Ct([
916
+ this.cb = n, this.handleClear = this.handleClear.bind(this), this.handlePointerMove = this.handlePointerMove.bind(this), this.handlePointerDown = this.handlePointerDown.bind(this), this.destroy = xt([
906
917
  { dom: e, evt: "pointermove", func: this.handlePointerMove },
907
918
  { dom: e, evt: "pointerleave", func: this.handleClear },
908
919
  { dom: e, evt: "pointerup", func: this.handleClear },
@@ -914,67 +925,67 @@ const Be = function(t, e = !0) {
914
925
  this.moved = !1, this.pointerdown = !1;
915
926
  }
916
927
  };
917
- }, vt = {
918
- create: Re
919
- }, We = "#4dc4ff";
920
- function At(t, e, n, o, s, i, r, c) {
928
+ }, yt = {
929
+ create: ze
930
+ }, Fe = "#4dc4ff";
931
+ function Pt(t, e, n, o, s, i, r, c) {
921
932
  return {
922
933
  x: t / 8 + n * 3 / 8 + s * 3 / 8 + r / 8,
923
934
  y: e / 8 + o * 3 / 8 + i * 3 / 8 + c / 8
924
935
  };
925
936
  }
926
- function Xe(t, e, n) {
927
- t && (t.dataset.x = e.toString(), t.dataset.y = n.toString(), tt(t));
937
+ function _e(t, e, n) {
938
+ t && (t.dataset.x = e.toString(), t.dataset.y = n.toString(), et(t));
928
939
  }
929
940
  function j(t, e, n, o, s) {
930
- D(t, {
941
+ M(t, {
931
942
  x1: e + "",
932
943
  y1: n + "",
933
944
  x2: o + "",
934
945
  y2: s + ""
935
946
  });
936
947
  }
937
- function wt(t, e, n, o, s, i, r, c, a, l) {
938
- const h = `M ${e} ${n} C ${o} ${s} ${i} ${r} ${c} ${a}`;
939
- if (t.line.setAttribute("d", h), l.style) {
940
- const p = l.style;
941
- p.stroke && t.line.setAttribute("stroke", p.stroke), p.strokeWidth && t.line.setAttribute("stroke-width", String(p.strokeWidth)), p.strokeDasharray && t.line.setAttribute("stroke-dasharray", p.strokeDasharray), p.strokeLinecap && t.line.setAttribute("stroke-linecap", p.strokeLinecap), p.opacity !== void 0 && t.line.setAttribute("opacity", String(p.opacity));
948
+ function wt(t, e, n, o, s, i, r, c, d, a) {
949
+ const h = `M ${e} ${n} C ${o} ${s} ${i} ${r} ${c} ${d}`;
950
+ if (t.line.setAttribute("d", h), a.style) {
951
+ const u = a.style;
952
+ u.stroke && t.line.setAttribute("stroke", u.stroke), u.strokeWidth && t.line.setAttribute("stroke-width", String(u.strokeWidth)), u.strokeDasharray && t.line.setAttribute("stroke-dasharray", u.strokeDasharray), u.strokeLinecap && t.line.setAttribute("stroke-linecap", u.strokeLinecap), u.opacity !== void 0 && t.line.setAttribute("opacity", String(u.opacity));
942
953
  }
943
954
  const f = t.querySelectorAll('path[stroke="transparent"]');
944
955
  f.length > 0 && f[0].setAttribute("d", h);
945
- const u = J(i, r, c, a);
946
- if (u) {
947
- const p = `M ${u.x1} ${u.y1} L ${c} ${a} L ${u.x2} ${u.y2}`;
948
- if (t.arrow1.setAttribute("d", p), f.length > 1 && f[1].setAttribute("d", p), l.style) {
949
- const g = l.style;
956
+ const p = Z(i, r, c, d);
957
+ if (p) {
958
+ const u = `M ${p.x1} ${p.y1} L ${c} ${d} L ${p.x2} ${p.y2}`;
959
+ if (t.arrow1.setAttribute("d", u), f.length > 1 && f[1].setAttribute("d", u), a.style) {
960
+ const g = a.style;
950
961
  g.stroke && t.arrow1.setAttribute("stroke", g.stroke), g.strokeWidth && t.arrow1.setAttribute("stroke-width", String(g.strokeWidth)), g.strokeLinecap && t.arrow1.setAttribute("stroke-linecap", g.strokeLinecap), g.opacity !== void 0 && t.arrow1.setAttribute("opacity", String(g.opacity));
951
962
  }
952
963
  }
953
- if (l.bidirectional) {
954
- const p = J(o, s, e, n);
955
- if (p) {
956
- const g = `M ${p.x1} ${p.y1} L ${e} ${n} L ${p.x2} ${p.y2}`;
957
- if (t.arrow2.setAttribute("d", g), f.length > 2 && f[2].setAttribute("d", g), l.style) {
958
- const b = l.style;
964
+ if (a.bidirectional) {
965
+ const u = Z(o, s, e, n);
966
+ if (u) {
967
+ const g = `M ${u.x1} ${u.y1} L ${e} ${n} L ${u.x2} ${u.y2}`;
968
+ if (t.arrow2.setAttribute("d", g), f.length > 2 && f[2].setAttribute("d", g), a.style) {
969
+ const b = a.style;
959
970
  b.stroke && t.arrow2.setAttribute("stroke", b.stroke), b.strokeWidth && t.arrow2.setAttribute("stroke-width", String(b.strokeWidth)), b.strokeLinecap && t.arrow2.setAttribute("stroke-linecap", b.strokeLinecap), b.opacity !== void 0 && t.arrow2.setAttribute("opacity", String(b.opacity));
960
971
  }
961
972
  }
962
973
  }
963
- const { x: y, y: m } = At(e, n, o, s, i, r, c, a);
964
- if (t.labelEl && Xe(t.labelEl, y, m), l.style?.labelColor) {
965
- const p = t.labelEl;
966
- p && (p.style.color = l.style.labelColor);
974
+ const { x: m, y } = Pt(e, n, o, s, i, r, c, d);
975
+ if (t.labelEl && _e(t.labelEl, m, y), a.style?.labelColor) {
976
+ const u = t.labelEl;
977
+ u && (u.style.color = a.style.labelColor);
967
978
  }
968
- Ke(t);
979
+ en(t);
969
980
  }
970
981
  function Q(t, e, n) {
971
- const { offsetLeft: o, offsetTop: s } = H(t.nodes, e), i = e.offsetWidth, r = e.offsetHeight, c = o + i / 2, a = s + r / 2, l = c + n.x, h = a + n.y;
982
+ const { offsetLeft: o, offsetTop: s } = H(t.nodes, e), i = e.offsetWidth, r = e.offsetHeight, c = o + i / 2, d = s + r / 2, a = c + n.x, h = d + n.y;
972
983
  return {
973
984
  w: i,
974
985
  h: r,
975
986
  cx: c,
976
- cy: a,
977
- ctrlX: l,
987
+ cy: d,
988
+ ctrlX: a,
978
989
  ctrlY: h
979
990
  };
980
991
  }
@@ -986,51 +997,54 @@ function X(t) {
986
997
  y: n
987
998
  };
988
999
  }
989
- const Ve = function(t, e, n) {
990
- const o = H(t.nodes, e), s = H(t.nodes, n), i = o.offsetLeft + e.offsetWidth / 2, r = o.offsetTop + e.offsetHeight / 2, c = s.offsetLeft + n.offsetWidth / 2, a = s.offsetTop + n.offsetHeight / 2, l = c - i, h = a - r, f = Math.sqrt(l * l + h * h), u = Math.max(50, Math.min(200, f * 0.3)), y = Math.abs(l), m = Math.abs(h);
991
- let p, g;
1000
+ const qe = function(t, e, n) {
1001
+ const o = H(t.nodes, e), s = H(t.nodes, n), i = o.offsetLeft + e.offsetWidth / 2, r = o.offsetTop + e.offsetHeight / 2, c = s.offsetLeft + n.offsetWidth / 2, d = s.offsetTop + n.offsetHeight / 2, a = c - i, h = d - r, f = Math.sqrt(a * a + h * h), p = Math.max(50, Math.min(200, f * 0.3)), m = Math.abs(a), y = Math.abs(h);
1002
+ let u, g;
992
1003
  if (f < 150) {
993
- const w = e.closest("me-main").className === "lhs" ? -1 : 1;
994
- p = { x: 200 * w, y: 0 }, g = { x: 200 * w, y: 0 };
995
- } else if (y > m * 1.5) {
996
- const w = l > 0 ? e.offsetWidth / 2 : -e.offsetWidth / 2, x = l > 0 ? -n.offsetWidth / 2 : n.offsetWidth / 2;
997
- p = { x: w + (l > 0 ? u : -u), y: 0 }, g = { x: x + (l > 0 ? -u : u), y: 0 };
1004
+ const v = e.closest("me-main").className === "lhs" ? -1 : 1;
1005
+ u = { x: 200 * v, y: 0 }, g = { x: 200 * v, y: 0 };
998
1006
  } else if (m > y * 1.5) {
999
- const w = h > 0 ? e.offsetHeight / 2 : -e.offsetHeight / 2, x = h > 0 ? -n.offsetHeight / 2 : n.offsetHeight / 2;
1000
- p = { x: 0, y: w + (h > 0 ? u : -u) }, g = { x: 0, y: x + (h > 0 ? -u : u) };
1007
+ const v = a > 0 ? e.offsetWidth / 2 : -e.offsetWidth / 2, x = a > 0 ? -n.offsetWidth / 2 : n.offsetWidth / 2;
1008
+ u = { x: v + (a > 0 ? p : -p), y: 0 }, g = { x: x + (a > 0 ? -p : p), y: 0 };
1009
+ } else if (y > m * 1.5) {
1010
+ const v = h > 0 ? e.offsetHeight / 2 : -e.offsetHeight / 2, x = h > 0 ? -n.offsetHeight / 2 : n.offsetHeight / 2;
1011
+ u = { x: 0, y: v + (h > 0 ? p : -p) }, g = { x: 0, y: x + (h > 0 ? -p : p) };
1001
1012
  } else {
1002
- const w = Math.atan2(h, l), x = e.offsetWidth / 2 * Math.cos(w), S = e.offsetHeight / 2 * Math.sin(w), T = -(n.offsetWidth / 2) * Math.cos(w), L = -(n.offsetHeight / 2) * Math.sin(w), C = u * 0.7 * (l > 0 ? 1 : -1), N = u * 0.7 * (h > 0 ? 1 : -1);
1003
- p = { x: x + C, y: S + N }, g = { x: T - C, y: L - N };
1013
+ const v = Math.atan2(h, a), x = e.offsetWidth / 2 * Math.cos(v), S = e.offsetHeight / 2 * Math.sin(v), T = -(n.offsetWidth / 2) * Math.cos(v), L = -(n.offsetHeight / 2) * Math.sin(v), C = p * 0.7 * (a > 0 ? 1 : -1), P = p * 0.7 * (h > 0 ? 1 : -1);
1014
+ u = { x: x + C, y: S + P }, g = { x: T - C, y: L - P };
1004
1015
  }
1005
- return { delta1: p, delta2: g };
1016
+ return {
1017
+ delta1: { x: Math.round(u.x), y: Math.round(u.y) },
1018
+ delta2: { x: Math.round(g.x), y: Math.round(g.y) }
1019
+ };
1006
1020
  }, ht = function(t, e, n, o, s) {
1007
1021
  if (!e || !n)
1008
1022
  return;
1009
1023
  if (!o.delta1 || !o.delta2) {
1010
- const M = Ve(t, e, n);
1011
- o.delta1 = M.delta1, o.delta2 = M.delta2;
1024
+ const k = qe(t, e, n);
1025
+ o.delta1 = k.delta1, o.delta2 = k.delta2;
1012
1026
  }
1013
- const i = Q(t, e, o.delta1), r = Q(t, n, o.delta2), { x: c, y: a } = X(i), { ctrlX: l, ctrlY: h } = i, { ctrlX: f, ctrlY: u } = r, { x: y, y: m } = X(r), p = J(f, u, y, m);
1014
- if (!p) return;
1015
- const g = `M ${p.x1} ${p.y1} L ${y} ${m} L ${p.x2} ${p.y2}`;
1027
+ const i = Q(t, e, o.delta1), r = Q(t, n, o.delta2), { x: c, y: d } = X(i), { ctrlX: a, ctrlY: h } = i, { ctrlX: f, ctrlY: p } = r, { x: m, y } = X(r), u = Z(f, p, m, y);
1028
+ if (!u) return;
1029
+ const g = `M ${u.x1} ${u.y1} L ${m} ${y} L ${u.x2} ${u.y2}`;
1016
1030
  let b = "";
1017
1031
  if (o.bidirectional) {
1018
- const M = J(l, h, c, a);
1019
- if (!M) return;
1020
- b = `M ${M.x1} ${M.y1} L ${c} ${a} L ${M.x2} ${M.y2}`;
1032
+ const k = Z(a, h, c, d);
1033
+ if (!k) return;
1034
+ b = `M ${k.x1} ${k.y1} L ${c} ${d} L ${k.x2} ${k.y2}`;
1021
1035
  }
1022
- const w = Te(`M ${c} ${a} C ${l} ${h} ${f} ${u} ${y} ${m}`, g, b, o.style), { x, y: S } = At(c, a, l, h, f, u, y, m), T = o.style?.labelColor || "rgb(235, 95, 82)", L = "arrow-" + o.id;
1023
- w.id = L;
1024
- const C = t.markdown ? t.markdown(o.label, o) : o.label, N = it(C, x, S, {
1036
+ const v = Ne(`M ${c} ${d} C ${a} ${h} ${f} ${p} ${m} ${y}`, g, b, o.style), { x, y: S } = Pt(c, d, a, h, f, p, m, y), T = o.style?.labelColor || "rgb(235, 95, 82)", L = "arrow-" + o.id;
1037
+ v.id = L;
1038
+ const C = t.markdown ? t.markdown(o.label, o) : o.label, P = it(C, x, S, {
1025
1039
  anchor: "middle",
1026
1040
  color: T,
1027
1041
  dataType: "arrow",
1028
1042
  svgId: L
1029
1043
  });
1030
- w.labelEl = N, w.arrowObj = o, w.dataset.linkid = o.id, t.labelContainer.appendChild(N), t.linkSvgGroup.appendChild(w), tt(N), s || (t.arrows.push(o), t.currentArrow = w, Pt(t, o, i, r));
1031
- }, Ge = function(t, e, n = {}) {
1044
+ v.labelEl = P, v.arrowObj = o, v.dataset.linkid = o.id, t.labelContainer.appendChild(P), t.linkSvgGroup.appendChild(v), et(P), s || (t.arrows.push(o), t.currentArrow = v, At(t, o, i, r));
1045
+ }, je = function(t, e, n = {}) {
1032
1046
  const o = {
1033
- id: F(),
1047
+ id: _(),
1034
1048
  label: "Custom Link",
1035
1049
  from: t.nodeObj.id,
1036
1050
  to: e.nodeObj.id,
@@ -1040,17 +1054,17 @@ const Ve = function(t, e, n) {
1040
1054
  name: "createArrow",
1041
1055
  obj: o
1042
1056
  });
1043
- }, ze = function(t) {
1044
- et(this);
1045
- const e = { ...t, id: F() };
1057
+ }, Ue = function(t) {
1058
+ nt(this);
1059
+ const e = { ...t, id: _() };
1046
1060
  ht(this, this.findEle(e.from), this.findEle(e.to), e), this.bus.fire("operation", {
1047
1061
  name: "createArrow",
1048
1062
  obj: e
1049
1063
  });
1050
- }, Fe = function(t) {
1064
+ }, Ke = function(t) {
1051
1065
  let e;
1052
1066
  if (t ? e = t : e = this.currentArrow, !e) return;
1053
- et(this);
1067
+ nt(this);
1054
1068
  const n = e.arrowObj.id;
1055
1069
  this.arrows = this.arrows.filter((o) => o.id !== n), e.labelEl?.remove(), e.remove(), this.bus.fire("operation", {
1056
1070
  name: "removeArrow",
@@ -1058,15 +1072,15 @@ const Ve = function(t, e, n) {
1058
1072
  id: n
1059
1073
  }
1060
1074
  });
1061
- }, qe = function(t) {
1075
+ }, Je = function(t) {
1062
1076
  this.currentArrow = t;
1063
1077
  const e = t.arrowObj, n = this.findEle(e.from), o = this.findEle(e.to), s = Q(this, n, e.delta1), i = Q(this, o, e.delta2);
1064
- Pt(this, e, s, i);
1065
- }, je = function() {
1066
- et(this), this.currentArrow = null;
1078
+ At(this, e, s, i);
1079
+ }, Ze = function() {
1080
+ nt(this), this.currentArrow = null;
1067
1081
  }, st = function(t, e) {
1068
1082
  const n = document.createElementNS(I, "path");
1069
- return D(n, {
1083
+ return M(n, {
1070
1084
  d: t,
1071
1085
  stroke: e,
1072
1086
  fill: "none",
@@ -1074,7 +1088,7 @@ const Ve = function(t, e, n) {
1074
1088
  "stroke-linecap": "round",
1075
1089
  "stroke-linejoin": "round"
1076
1090
  }), n;
1077
- }, _e = function(t, e) {
1091
+ }, Qe = function(t, e) {
1078
1092
  const n = document.createElementNS(I, "g");
1079
1093
  n.setAttribute("class", "arrow-highlight"), n.setAttribute("opacity", "0.45");
1080
1094
  const o = st(t.line.getAttribute("d"), e);
@@ -1085,32 +1099,32 @@ const Ve = function(t, e, n) {
1085
1099
  n.appendChild(i);
1086
1100
  }
1087
1101
  t.insertBefore(n, t.firstChild);
1088
- }, Ue = function(t) {
1102
+ }, tn = function(t) {
1089
1103
  const e = t.querySelector(".arrow-highlight");
1090
1104
  e && e.remove();
1091
- }, Ke = function(t) {
1105
+ }, en = function(t) {
1092
1106
  const e = t.querySelector(".arrow-highlight");
1093
1107
  if (!e) return;
1094
1108
  const n = e.querySelectorAll("path");
1095
1109
  n.length >= 1 && n[0].setAttribute("d", t.line.getAttribute("d")), n.length >= 2 && n[1].setAttribute("d", t.arrow1.getAttribute("d")), n.length >= 3 && t.arrow2.getAttribute("d") && n[2].setAttribute("d", t.arrow2.getAttribute("d"));
1096
- }, et = function(t) {
1097
- t.helper1?.destroy(), t.helper2?.destroy(), t.linkController.style.display = "none", t.P2.style.display = "none", t.P3.style.display = "none", t.currentArrow && Ue(t.currentArrow);
1098
- }, Pt = function(t, e, n, o) {
1099
- const { linkController: s, P2: i, P3: r, line1: c, line2: a, nodes: l, map: h, currentArrow: f, bus: u } = t;
1110
+ }, nt = function(t) {
1111
+ t.helper1?.destroy(), t.helper2?.destroy(), t.linkController.style.display = "none", t.P2.style.display = "none", t.P3.style.display = "none", t.currentArrow && tn(t.currentArrow);
1112
+ }, At = function(t, e, n, o) {
1113
+ const { linkController: s, P2: i, P3: r, line1: c, line2: d, nodes: a, map: h, currentArrow: f, bus: p } = t;
1100
1114
  if (!f) return;
1101
- s.style.display = "initial", i.style.display = "initial", r.style.display = "initial", l.appendChild(s), l.appendChild(i), l.appendChild(r), _e(f, We);
1102
- let { x: y, y: m } = X(n), { ctrlX: p, ctrlY: g } = n, { ctrlX: b, ctrlY: w } = o, { x, y: S } = X(o);
1103
- i.style.cssText = `top:${g}px;left:${p}px;`, r.style.cssText = `top:${w}px;left:${b}px;`, j(c, y, m, p, g), j(a, b, w, x, S), t.helper1 = vt.create(i), t.helper2 = vt.create(r), t.helper1.init(h, (T, L) => {
1104
- p = p + T / t.scaleVal, g = g + L / t.scaleVal;
1105
- const C = X({ ...n, ctrlX: p, ctrlY: g });
1106
- y = C.x, m = C.y, i.style.top = g + "px", i.style.left = p + "px", wt(f, y, m, p, g, b, w, x, S, e), j(c, y, m, p, g), e.delta1.x = p - n.cx, e.delta1.y = g - n.cy, u.fire("updateArrowDelta", e);
1115
+ s.style.display = "initial", i.style.display = "initial", r.style.display = "initial", a.appendChild(s), a.appendChild(i), a.appendChild(r), Qe(f, Fe);
1116
+ let { x: m, y } = X(n), { ctrlX: u, ctrlY: g } = n, { ctrlX: b, ctrlY: v } = o, { x, y: S } = X(o);
1117
+ i.style.cssText = `top:${g}px;left:${u}px;`, r.style.cssText = `top:${v}px;left:${b}px;`, j(c, m, y, u, g), j(d, b, v, x, S), t.helper1 = yt.create(i), t.helper2 = yt.create(r), t.helper1.init(h, (T, L) => {
1118
+ u = u + T / t.scaleVal, g = g + L / t.scaleVal;
1119
+ const C = X({ ...n, ctrlX: u, ctrlY: g });
1120
+ m = C.x, y = C.y, i.style.top = g + "px", i.style.left = u + "px", wt(f, m, y, u, g, b, v, x, S, e), j(c, m, y, u, g), e.delta1.x = Math.round(u - n.cx), e.delta1.y = Math.round(g - n.cy), p.fire("updateArrowDelta", e);
1107
1121
  }), t.helper2.init(h, (T, L) => {
1108
- b = b + T / t.scaleVal, w = w + L / t.scaleVal;
1109
- const C = X({ ...o, ctrlX: b, ctrlY: w });
1110
- x = C.x, S = C.y, r.style.top = w + "px", r.style.left = b + "px", wt(f, y, m, p, g, b, w, x, S, e), j(a, b, w, x, S), e.delta2.x = b - o.cx, e.delta2.y = w - o.cy, u.fire("updateArrowDelta", e);
1122
+ b = b + T / t.scaleVal, v = v + L / t.scaleVal;
1123
+ const C = X({ ...o, ctrlX: b, ctrlY: v });
1124
+ x = C.x, S = C.y, r.style.top = v + "px", r.style.left = b + "px", wt(f, m, y, u, g, b, v, x, S, e), j(d, b, v, x, S), e.delta2.x = Math.round(b - o.cx), e.delta2.y = Math.round(v - o.cy), p.fire("updateArrowDelta", e);
1111
1125
  });
1112
1126
  };
1113
- function Je() {
1127
+ function nn() {
1114
1128
  this.linkSvgGroup.innerHTML = "", this.labelContainer.querySelectorAll('.svg-label[data-type="arrow"]').forEach((e) => e.remove());
1115
1129
  for (let e = 0; e < this.arrows.length; e++) {
1116
1130
  const n = this.arrows[e];
@@ -1121,181 +1135,181 @@ function Je() {
1121
1135
  }
1122
1136
  this.nodes.appendChild(this.linkSvgGroup);
1123
1137
  }
1124
- function Qe(t) {
1125
- et(this), t && t.labelEl && Nt(this, t.labelEl, t.arrowObj);
1138
+ function on(t) {
1139
+ nt(this), t && t.labelEl && kt(this, t.labelEl, t.arrowObj);
1126
1140
  }
1127
- function Ze() {
1128
- this.arrows = this.arrows.filter((t) => K(t.from, this.nodeData) && K(t.to, this.nodeData));
1141
+ function sn() {
1142
+ this.arrows = this.arrows.filter((t) => J(t.from, this.nodeData) && J(t.to, this.nodeData));
1129
1143
  }
1130
- const tn = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
1144
+ const rn = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
1131
1145
  __proto__: null,
1132
- createArrow: Ge,
1133
- createArrowFrom: ze,
1134
- editArrowLabel: Qe,
1135
- removeArrow: Fe,
1136
- renderArrow: Je,
1137
- selectArrow: qe,
1138
- tidyArrow: Ze,
1139
- unselectArrow: je
1140
- }, Symbol.toStringTag, { value: "Module" })), en = function(t) {
1146
+ createArrow: je,
1147
+ createArrowFrom: Ue,
1148
+ editArrowLabel: on,
1149
+ removeArrow: Ke,
1150
+ renderArrow: nn,
1151
+ selectArrow: Je,
1152
+ tidyArrow: sn,
1153
+ unselectArrow: Ze
1154
+ }, Symbol.toStringTag, { value: "Module" })), cn = function(t) {
1141
1155
  if (t.length === 0) throw new Error("No selected node.");
1142
1156
  if (t.length === 1) {
1143
- const a = t[0].nodeObj, l = t[0].nodeObj.parent;
1144
- if (!l) throw new Error("Can not select root node.");
1145
- const h = l.children.findIndex((f) => a === f);
1157
+ const d = t[0].nodeObj, a = t[0].nodeObj.parent;
1158
+ if (!a) throw new Error("Can not select root node.");
1159
+ const h = a.children.findIndex((f) => d === f);
1146
1160
  return {
1147
- parent: l.id,
1161
+ parent: a.id,
1148
1162
  start: h,
1149
1163
  end: h
1150
1164
  };
1151
1165
  }
1152
1166
  let e = 0;
1153
- const n = t.map((a) => {
1154
- let l = a.nodeObj;
1167
+ const n = t.map((d) => {
1168
+ let a = d.nodeObj;
1155
1169
  const h = [];
1156
- for (; l.parent; ) {
1157
- const f = l.parent, y = f.children?.indexOf(l);
1158
- l = f, h.unshift({ node: l, index: y });
1170
+ for (; a.parent; ) {
1171
+ const f = a.parent, m = f.children?.indexOf(a);
1172
+ a = f, h.unshift({ node: a, index: m });
1159
1173
  }
1160
1174
  return h.length > e && (e = h.length), h;
1161
1175
  });
1162
1176
  let o = 0;
1163
1177
  t: for (; o < e; o++) {
1164
- const a = n[0][o]?.node;
1165
- for (let l = 1; l < n.length; l++)
1166
- if (n[l][o]?.node !== a)
1178
+ const d = n[0][o]?.node;
1179
+ for (let a = 1; a < n.length; a++)
1180
+ if (n[a][o]?.node !== d)
1167
1181
  break t;
1168
1182
  }
1169
1183
  if (!o) throw new Error("Can not select root node.");
1170
- const s = n.map((a) => a[o - 1].index).sort(), i = s[0] || 0, r = s[s.length - 1] || 0, c = n[0][o - 1].node;
1184
+ const s = n.map((d) => d[o - 1].index).sort(), i = s[0] || 0, r = s[s.length - 1] || 0, c = n[0][o - 1].node;
1171
1185
  if (!c.parent) throw new Error("Please select nodes in the same main topic.");
1172
1186
  return {
1173
1187
  parent: c.id,
1174
1188
  start: i,
1175
1189
  end: r
1176
1190
  };
1177
- }, nn = function(t) {
1191
+ }, ln = function(t) {
1178
1192
  const e = document.createElementNS(I, "g");
1179
1193
  return e.setAttribute("id", t), e;
1180
- }, bt = function(t, e) {
1194
+ }, vt = function(t, e) {
1181
1195
  const n = document.createElementNS(I, "path");
1182
- return D(n, {
1196
+ return M(n, {
1183
1197
  d: t,
1184
1198
  stroke: e || "#666",
1185
1199
  fill: "none",
1186
1200
  "stroke-linecap": "round",
1187
1201
  "stroke-width": "2"
1188
1202
  }), n;
1189
- }, on = (t) => t.parentElement.parentElement, sn = function(t, { parent: e, start: n }) {
1203
+ }, an = (t) => t.parentElement.parentElement, dn = function(t, { parent: e, start: n }) {
1190
1204
  const o = t.findEle(e), s = o.nodeObj;
1191
1205
  let i;
1192
1206
  return s.parent ? i = o.closest("me-main").className : i = t.findEle(s.children[n].id).closest("me-main").className, i;
1193
1207
  }, ft = function(t, e) {
1194
- const { id: n, label: o, parent: s, start: i, end: r, style: c } = e, { nodes: a, theme: l, summarySvg: h } = t, u = t.findEle(s).nodeObj, y = sn(t, e);
1195
- let m = 1 / 0, p = 0, g = 0, b = 0;
1196
- for (let d = i; d <= r; d++) {
1197
- const v = u.children?.[d];
1198
- if (!v)
1208
+ const { id: n, label: o, parent: s, start: i, end: r, style: c } = e, { nodes: d, theme: a, summarySvg: h } = t, p = t.findEle(s).nodeObj, m = dn(t, e);
1209
+ let y = 1 / 0, u = 0, g = 0, b = 0;
1210
+ for (let l = i; l <= r; l++) {
1211
+ const w = p.children?.[l];
1212
+ if (!w)
1199
1213
  return t.removeSummary(n), null;
1200
- const E = on(t.findEle(v.id)), { offsetLeft: P, offsetTop: B } = H(a, E), $ = i === r ? 10 : 20;
1201
- d === i && (g = B + $), d === r && (b = B + E.offsetHeight - $), P < m && (m = P), E.offsetWidth + P > p && (p = E.offsetWidth + P);
1214
+ const E = an(t.findEle(w.id)), { offsetLeft: N, offsetTop: B } = H(d, E), D = i === r ? 10 : 20;
1215
+ l === i && (g = B + D), l === r && (b = B + E.offsetHeight - D), N < y && (y = N), E.offsetWidth + N > u && (u = E.offsetWidth + N);
1202
1216
  }
1203
- let w, x;
1204
- const S = u.parent ? 10 : 0, T = g + S, L = b + S, C = (T + L) / 2, N = c?.stroke || l.cssVar["--color"], M = c?.labelColor || l.cssVar["--color"], Y = "s-" + n, k = t.markdown ? t.markdown(o, e) : o;
1205
- y === V.LHS ? (w = bt(`M ${m + 10} ${T} c -5 0 -10 5 -10 10 L ${m} ${L - 10} c 0 5 5 10 10 10 M ${m} ${C} h -10`, N), x = it(k, m - 20, C, { anchor: "end", color: M, dataType: "summary", svgId: Y })) : (w = bt(`M ${p - 10} ${T} c 5 0 10 5 10 10 L ${p} ${L - 10} c 0 5 -5 10 -10 10 M ${p} ${C} h 10`, N), x = it(k, p + 20, C, { anchor: "start", color: M, dataType: "summary", svgId: Y }));
1206
- const W = nn(Y);
1207
- return W.appendChild(w), t.labelContainer.appendChild(x), tt(x), W.summaryObj = e, W.labelEl = x, h.appendChild(W), W;
1208
- }, rn = function(t = {}) {
1217
+ let v, x;
1218
+ const S = p.parent ? 10 : 0, T = g + S, L = b + S, C = (T + L) / 2, P = c?.stroke || a.cssVar["--color"], k = c?.labelColor || a.cssVar["--color"], Y = "s-" + n, A = t.markdown ? t.markdown(o, e) : o;
1219
+ m === G.LHS ? (v = vt(`M ${y + 10} ${T} c -5 0 -10 5 -10 10 L ${y} ${L - 10} c 0 5 5 10 10 10 M ${y} ${C} h -10`, P), x = it(A, y - 20, C, { anchor: "end", color: k, dataType: "summary", svgId: Y })) : (v = vt(`M ${u - 10} ${T} c 5 0 10 5 10 10 L ${u} ${L - 10} c 0 5 -5 10 -10 10 M ${u} ${C} h 10`, P), x = it(A, u + 20, C, { anchor: "start", color: k, dataType: "summary", svgId: Y }));
1220
+ const R = ln(Y);
1221
+ return R.appendChild(v), t.labelContainer.appendChild(x), et(x), R.summaryObj = e, R.labelEl = x, h.appendChild(R), R;
1222
+ }, hn = function(t = {}) {
1209
1223
  if (!this.currentNodes) return;
1210
- const { currentNodes: e, summaries: n, bus: o } = this, { parent: s, start: i, end: r } = en(e), c = { id: F(), parent: s, start: i, end: r, label: "summary", style: t.style }, a = ft(this, c);
1211
- n.push(c), this.editSummary(a), o.fire("operation", {
1224
+ const { currentNodes: e, summaries: n, bus: o } = this, { parent: s, start: i, end: r } = cn(e), c = { id: _(), parent: s, start: i, end: r, label: "summary", style: t.style }, d = ft(this, c);
1225
+ n.push(c), this.editSummary(d), o.fire("operation", {
1212
1226
  name: "createSummary",
1213
1227
  obj: c
1214
1228
  });
1215
- }, cn = function(t) {
1216
- const e = F(), n = { ...t, id: e };
1229
+ }, fn = function(t) {
1230
+ const e = _(), n = { ...t, id: e };
1217
1231
  ft(this, n), this.summaries.push(n), this.bus.fire("operation", {
1218
1232
  name: "createSummary",
1219
1233
  obj: n
1220
1234
  });
1221
- }, ln = function(t) {
1235
+ }, un = function(t) {
1222
1236
  const e = this.summaries.findIndex((n) => n.id === t);
1223
1237
  e > -1 && (this.summaries.splice(e, 1), this.nodes.querySelector("#s-" + t)?.remove(), this.nodes.querySelector("#label-s-" + t)?.remove()), this.bus.fire("operation", {
1224
1238
  name: "removeSummary",
1225
1239
  obj: { id: t }
1226
1240
  });
1227
- }, an = function(t) {
1241
+ }, pn = function(t) {
1228
1242
  const e = t.labelEl;
1229
1243
  e && e.classList.add("selected"), this.currentSummary = t;
1230
- }, dn = function() {
1244
+ }, gn = function() {
1231
1245
  this.currentSummary?.labelEl?.classList.remove("selected"), this.currentSummary = null;
1232
- }, hn = function() {
1246
+ }, mn = function() {
1233
1247
  this.summarySvg.innerHTML = "", this.summaries.forEach((t) => {
1234
1248
  try {
1235
1249
  ft(this, t);
1236
1250
  } catch {
1237
1251
  }
1238
1252
  }), this.nodes.insertAdjacentElement("beforeend", this.summarySvg);
1239
- }, fn = function(t) {
1240
- t && t.labelEl && Nt(this, t.labelEl, t.summaryObj);
1241
- }, un = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
1253
+ }, yn = function(t) {
1254
+ t && t.labelEl && kt(this, t.labelEl, t.summaryObj);
1255
+ }, wn = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
1242
1256
  __proto__: null,
1243
- createSummary: rn,
1244
- createSummaryFrom: cn,
1245
- editSummary: fn,
1246
- removeSummary: ln,
1247
- renderSummary: hn,
1248
- selectSummary: an,
1249
- unselectSummary: dn
1250
- }, Symbol.toStringTag, { value: "Module" })), A = "http://www.w3.org/2000/svg";
1251
- function pn(t, e) {
1252
- const n = document.createElementNS(A, "svg");
1253
- return D(n, {
1257
+ createSummary: hn,
1258
+ createSummaryFrom: fn,
1259
+ editSummary: yn,
1260
+ removeSummary: un,
1261
+ renderSummary: mn,
1262
+ selectSummary: pn,
1263
+ unselectSummary: gn
1264
+ }, Symbol.toStringTag, { value: "Module" })), $ = "http://www.w3.org/2000/svg";
1265
+ function vn(t, e) {
1266
+ const n = document.createElementNS($, "svg");
1267
+ return M(n, {
1254
1268
  version: "1.1",
1255
- xmlns: A,
1269
+ xmlns: $,
1256
1270
  height: t,
1257
1271
  width: e
1258
1272
  }), n;
1259
1273
  }
1260
- function gn(t, e) {
1274
+ function bn(t, e) {
1261
1275
  return (parseInt(t) - parseInt(e)) / 2;
1262
1276
  }
1263
- function mn(t, e, n, o) {
1264
- const s = document.createElementNS(A, "g");
1277
+ function xn(t, e, n, o) {
1278
+ const s = document.createElementNS($, "g");
1265
1279
  let i = "";
1266
1280
  return t.text ? i = t.text.textContent : i = t.childNodes[0].textContent, i.split(`
1267
- `).forEach((c, a) => {
1268
- const l = document.createElementNS(A, "text");
1269
- D(l, {
1281
+ `).forEach((c, d) => {
1282
+ const a = document.createElementNS($, "text");
1283
+ M(a, {
1270
1284
  x: n + parseInt(e.paddingLeft) + "",
1271
- y: o + parseInt(e.paddingTop) + gn(e.lineHeight, e.fontSize) * (a + 1) + parseFloat(e.fontSize) * (a + 1) + "",
1285
+ y: o + parseInt(e.paddingTop) + bn(e.lineHeight, e.fontSize) * (d + 1) + parseFloat(e.fontSize) * (d + 1) + "",
1272
1286
  "text-anchor": "start",
1273
1287
  "font-family": e.fontFamily,
1274
1288
  "font-size": `${e.fontSize}`,
1275
1289
  "font-weight": `${e.fontWeight}`,
1276
1290
  fill: `${e.color}`
1277
- }), l.innerHTML = c, s.appendChild(l);
1291
+ }), a.innerHTML = c, s.appendChild(a);
1278
1292
  }), s;
1279
1293
  }
1280
- function yn(t, e, n, o) {
1294
+ function Cn(t, e, n, o) {
1281
1295
  let s = "";
1282
1296
  t.nodeObj?.dangerouslySetInnerHTML ? s = t.nodeObj.dangerouslySetInnerHTML : t.text ? s = t.text.textContent : s = t.childNodes[0].textContent;
1283
- const i = document.createElementNS(A, "foreignObject");
1284
- D(i, {
1297
+ const i = document.createElementNS($, "foreignObject");
1298
+ M(i, {
1285
1299
  x: n + parseInt(e.paddingLeft) + "",
1286
1300
  y: o + parseInt(e.paddingTop) + "",
1287
1301
  width: e.width,
1288
1302
  height: e.height
1289
1303
  });
1290
1304
  const r = document.createElement("div");
1291
- return D(r, {
1305
+ return M(r, {
1292
1306
  xmlns: "http://www.w3.org/1999/xhtml",
1293
1307
  style: `font-family: ${e.fontFamily}; font-size: ${e.fontSize}; font-weight: ${e.fontWeight}; color: ${e.color}; white-space: pre-wrap;`
1294
1308
  }), r.innerHTML = s, i.appendChild(r), i;
1295
1309
  }
1296
- function vn(t, e) {
1297
- const n = getComputedStyle(e), { offsetLeft: o, offsetTop: s } = H(t.nodes, e), i = document.createElementNS(A, "rect");
1298
- return D(i, {
1310
+ function En(t, e) {
1311
+ const n = getComputedStyle(e), { offsetLeft: o, offsetTop: s } = H(t.nodes, e), i = document.createElementNS($, "rect");
1312
+ return M(i, {
1299
1313
  x: o + "",
1300
1314
  y: s + "",
1301
1315
  rx: n.borderRadius,
@@ -1307,9 +1321,9 @@ function vn(t, e) {
1307
1321
  "stroke-width": n.borderWidth
1308
1322
  }), i;
1309
1323
  }
1310
- function _(t, e, n = !1) {
1311
- const o = getComputedStyle(e), { offsetLeft: s, offsetTop: i } = H(t.nodes, e), r = document.createElementNS(A, "rect");
1312
- D(r, {
1324
+ function U(t, e, n = !1) {
1325
+ const o = getComputedStyle(e), { offsetLeft: s, offsetTop: i } = H(t.nodes, e), r = document.createElementNS($, "rect");
1326
+ M(r, {
1313
1327
  x: s + "",
1314
1328
  y: i + "",
1315
1329
  rx: o.borderRadius,
@@ -1320,14 +1334,14 @@ function _(t, e, n = !1) {
1320
1334
  stroke: o.borderColor,
1321
1335
  "stroke-width": o.borderWidth
1322
1336
  });
1323
- const c = document.createElementNS(A, "g");
1337
+ const c = document.createElementNS($, "g");
1324
1338
  c.appendChild(r);
1325
- let a;
1326
- return n ? a = yn(e, o, s, i) : a = mn(e, o, s, i), c.appendChild(a), c;
1339
+ let d;
1340
+ return n ? d = Cn(e, o, s, i) : d = xn(e, o, s, i), c.appendChild(d), c;
1327
1341
  }
1328
- function wn(t, e) {
1329
- const n = getComputedStyle(e), { offsetLeft: o, offsetTop: s } = H(t.nodes, e), i = document.createElementNS(A, "a"), r = document.createElementNS(A, "text");
1330
- return D(r, {
1342
+ function Sn(t, e) {
1343
+ const n = getComputedStyle(e), { offsetLeft: o, offsetTop: s } = H(t.nodes, e), i = document.createElementNS($, "a"), r = document.createElementNS($, "text");
1344
+ return M(r, {
1331
1345
  x: o + "",
1332
1346
  y: s + parseInt(n.fontSize) + "",
1333
1347
  "text-anchor": "start",
@@ -1337,9 +1351,9 @@ function wn(t, e) {
1337
1351
  fill: `${n.color}`
1338
1352
  }), r.innerHTML = e.textContent, i.appendChild(r), i.setAttribute("href", e.href), i;
1339
1353
  }
1340
- function bn(t, e) {
1341
- const n = getComputedStyle(e), { offsetLeft: o, offsetTop: s } = H(t.nodes, e), i = document.createElementNS(A, "image");
1342
- return D(i, {
1354
+ function Tn(t, e) {
1355
+ const n = getComputedStyle(e), { offsetLeft: o, offsetTop: s } = H(t.nodes, e), i = document.createElementNS($, "image");
1356
+ return M(i, {
1343
1357
  x: o + "",
1344
1358
  y: s + "",
1345
1359
  width: n.width + "",
@@ -1347,40 +1361,40 @@ function bn(t, e) {
1347
1361
  href: e.src
1348
1362
  }), i;
1349
1363
  }
1350
- const U = 100, xn = '<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">', Cn = (t, e = !1) => {
1351
- const n = t.nodes, o = n.offsetHeight + U * 2, s = n.offsetWidth + U * 2, i = pn(o + "px", s + "px"), r = document.createElementNS(A, "svg"), c = document.createElementNS(A, "rect");
1352
- D(c, {
1364
+ const K = 100, Ln = '<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">', Dn = (t, e = !1) => {
1365
+ const n = t.nodes, o = n.offsetHeight + K * 2, s = n.offsetWidth + K * 2, i = vn(o + "px", s + "px"), r = document.createElementNS($, "svg"), c = document.createElementNS($, "rect");
1366
+ M(c, {
1353
1367
  x: "0",
1354
1368
  y: "0",
1355
1369
  width: `${s}`,
1356
1370
  height: `${o}`,
1357
1371
  fill: t.theme.cssVar["--bgcolor"]
1358
1372
  }), i.appendChild(c), n.querySelectorAll(".subLines").forEach((f) => {
1359
- const u = f.cloneNode(!0), { offsetLeft: y, offsetTop: m } = H(n, f.parentElement);
1360
- u.setAttribute("x", `${y}`), u.setAttribute("y", `${m}`), r.appendChild(u);
1373
+ const p = f.cloneNode(!0), { offsetLeft: m, offsetTop: y } = H(n, f.parentElement);
1374
+ p.setAttribute("x", `${m}`), p.setAttribute("y", `${y}`), r.appendChild(p);
1361
1375
  });
1362
- const a = n.querySelector(".lines")?.cloneNode(!0);
1376
+ const d = n.querySelector(".lines")?.cloneNode(!0);
1377
+ d && r.appendChild(d);
1378
+ const a = n.querySelector(".topiclinks")?.cloneNode(!0);
1363
1379
  a && r.appendChild(a);
1364
- const l = n.querySelector(".topiclinks")?.cloneNode(!0);
1365
- l && r.appendChild(l);
1366
1380
  const h = n.querySelector(".summary")?.cloneNode(!0);
1367
1381
  return h && r.appendChild(h), n.querySelectorAll("me-tpc").forEach((f) => {
1368
- f.nodeObj.dangerouslySetInnerHTML ? r.appendChild(_(t, f, !e)) : (r.appendChild(vn(t, f)), r.appendChild(_(t, f.text, !e)));
1382
+ f.nodeObj.dangerouslySetInnerHTML ? r.appendChild(U(t, f, !e)) : (r.appendChild(En(t, f)), r.appendChild(U(t, f.text, !e)));
1369
1383
  }), n.querySelectorAll(".tags > span").forEach((f) => {
1370
- r.appendChild(_(t, f));
1384
+ r.appendChild(U(t, f));
1371
1385
  }), n.querySelectorAll(".icons > span").forEach((f) => {
1372
- r.appendChild(_(t, f));
1386
+ r.appendChild(U(t, f));
1373
1387
  }), n.querySelectorAll(".hyper-link").forEach((f) => {
1374
- r.appendChild(wn(t, f));
1388
+ r.appendChild(Sn(t, f));
1375
1389
  }), n.querySelectorAll("img").forEach((f) => {
1376
- r.appendChild(bn(t, f));
1377
- }), D(r, {
1378
- x: U + "",
1379
- y: U + "",
1390
+ r.appendChild(Tn(t, f));
1391
+ }), M(r, {
1392
+ x: K + "",
1393
+ y: K + "",
1380
1394
  overflow: "visible"
1381
1395
  }), i.appendChild(r), i;
1382
- }, En = (t, e) => (e && t.insertAdjacentHTML("afterbegin", "<style>" + e + "</style>"), xn + t.outerHTML);
1383
- function Sn(t) {
1396
+ }, Mn = (t, e) => (e && t.insertAdjacentHTML("afterbegin", "<style>" + e + "</style>"), Ln + t.outerHTML);
1397
+ function kn(t) {
1384
1398
  return new Promise((e, n) => {
1385
1399
  const o = new FileReader();
1386
1400
  o.onload = (s) => {
@@ -1390,11 +1404,11 @@ function Sn(t) {
1390
1404
  }, o.readAsDataURL(t);
1391
1405
  });
1392
1406
  }
1393
- const Tn = function(t = !1, e) {
1394
- const n = Cn(this, t), o = En(n, e);
1407
+ const Nn = function(t = !1, e) {
1408
+ const n = Dn(this, t), o = Mn(n, e);
1395
1409
  return new Blob([o], { type: "image/svg+xml" });
1396
- }, Ln = async function(t = !1, e) {
1397
- const n = this.exportSvg(t, e), o = await Sn(n);
1410
+ }, Pn = async function(t = !1, e) {
1411
+ const n = this.exportSvg(t, e), o = await kn(n);
1398
1412
  return new Promise((s, i) => {
1399
1413
  const r = new Image();
1400
1414
  r.setAttribute("crossOrigin", "anonymous"), r.onload = () => {
@@ -1402,54 +1416,54 @@ const Tn = function(t = !1, e) {
1402
1416
  c.width = r.width, c.height = r.height, c.getContext("2d").drawImage(r, 0, 0), c.toBlob(s, "image/png", 1);
1403
1417
  }, r.src = o, r.onerror = i;
1404
1418
  });
1405
- }, Dn = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
1419
+ }, An = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
1406
1420
  __proto__: null,
1407
- exportPng: Ln,
1408
- exportSvg: Tn
1409
- }, Symbol.toStringTag, { value: "Module" })), Mn = {}, kn = {
1410
- getObjById: K,
1411
- generateNewObj: It,
1412
- layout: Ot,
1413
- linkDiv: Le,
1414
- editTopic: Gt,
1415
- createWrapper: Rt,
1416
- createParent: Wt,
1417
- createChildren: Xt,
1418
- createTopic: Vt,
1419
- findEle: Et,
1420
- changeTheme: Be,
1421
- ...ge,
1422
- ...Mn,
1423
- ...tn,
1424
- ...un,
1425
- ...Dn,
1421
+ exportPng: Pn,
1422
+ exportSvg: Nn
1423
+ }, Symbol.toStringTag, { value: "Module" })), $n = {}, Hn = {
1424
+ getObjById: J,
1425
+ generateNewObj: Ht,
1426
+ layout: Gt,
1427
+ linkDiv: Pe,
1428
+ editTopic: Ut,
1429
+ createWrapper: Ft,
1430
+ createParent: _t,
1431
+ createChildren: qt,
1432
+ createTopic: jt,
1433
+ findEle: St,
1434
+ changeTheme: Ve,
1435
+ ...xe,
1436
+ ...$n,
1437
+ ...rn,
1438
+ ...wn,
1439
+ ...An,
1426
1440
  init(t) {
1427
1441
  if (t = JSON.parse(JSON.stringify(t)), !t || !t.nodeData) return new Error("MindElixir: `data` is required");
1428
- t.direction !== void 0 && (this.direction = t.direction), this.changeTheme(t.theme || this.theme, !1), this.nodeData = t.nodeData, lt(this.nodeData), this.arrows = t.arrows || [], this.summaries = t.summaries || [], this.tidyArrow(), this.toolBar && Ye(this), this.layout(), this.linkDiv(), this.toCenter();
1442
+ t.direction !== void 0 && (this.direction = t.direction), this.changeTheme(t.theme || this.theme, !1), this.nodeData = t.nodeData, lt(this.nodeData), this.arrows = t.arrows || [], this.summaries = t.summaries || [], this.tidyArrow(), this.toolBar && Ge(this), this.layout(), this.linkDiv(), this.toCenter();
1429
1443
  },
1430
1444
  destroy() {
1431
1445
  this.disposable.forEach((t) => t()), this.el && (this.el.innerHTML = ""), this.el = void 0, this.nodeData = void 0, this.arrows = void 0, this.summaries = void 0, this.currentArrow = void 0, this.currentNodes = void 0, this.currentSummary = void 0, this.theme = void 0, this.direction = void 0, this.bus = void 0, this.container = void 0, this.map = void 0, this.lines = void 0, this.linkController = void 0, this.linkSvgGroup = void 0, this.P2 = void 0, this.P3 = void 0, this.line1 = void 0, this.line2 = void 0, this.nodes = void 0, this.selection?.destroy(), this.selection = void 0;
1432
1446
  }
1433
1447
  };
1434
- function Nn({ pT: t, pL: e, pW: n, pH: o, cT: s, cL: i, cW: r, cH: c, direction: a, containerHeight: l }) {
1448
+ function In({ pT: t, pL: e, pW: n, pH: o, cT: s, cL: i, cW: r, cH: c, direction: d, containerHeight: a }) {
1435
1449
  let h = e + n / 2;
1436
1450
  const f = t + o / 2;
1437
- let u;
1438
- a === V.LHS ? u = i + r : u = i;
1439
- const y = s + c / 2, p = (1 - Math.abs(y - f) / l) * 0.25 * (n / 2);
1440
- return a === V.LHS ? h = h - n / 10 - p : h = h + n / 10 + p, `M ${h} ${f} Q ${h} ${y} ${u} ${y}`;
1451
+ let p;
1452
+ d === G.LHS ? p = i + r : p = i;
1453
+ const m = s + c / 2, u = (1 - Math.abs(m - f) / a) * 0.25 * (n / 2);
1454
+ return d === G.LHS ? h = h - n / 10 - u : h = h + n / 10 + u, `M ${h} ${f} Q ${h} ${m} ${p} ${m}`;
1441
1455
  }
1442
- function $n({ pT: t, pL: e, pW: n, pH: o, cT: s, cL: i, cW: r, cH: c, direction: a, isFirst: l }) {
1456
+ function On({ pT: t, pL: e, pW: n, pH: o, cT: s, cL: i, cW: r, cH: c, direction: d, isFirst: a }) {
1443
1457
  const h = parseInt(this.container.style.getPropertyValue("--node-gap-x"));
1444
- let f = 0, u = 0;
1445
- l ? f = t + o / 2 : f = t + o;
1446
- const y = s + c;
1447
- let m = 0, p = 0, g = 0;
1448
- const b = Math.abs(f - y) / 300 * h;
1449
- return a === V.LHS ? (g = e, m = g + h, p = g - h, u = i + h, `M ${m} ${f} C ${g} ${f} ${g + b} ${y} ${p} ${y} H ${u}`) : (g = e + n, m = g - h, p = g + h, u = i + r - h, `M ${m} ${f} C ${g} ${f} ${g - b} ${y} ${p} ${y} H ${u}`);
1458
+ let f = 0, p = 0;
1459
+ a ? f = t + o / 2 : f = t + o;
1460
+ const m = s + c;
1461
+ let y = 0, u = 0, g = 0;
1462
+ const b = Math.abs(f - m) / 300 * h;
1463
+ return d === G.LHS ? (g = e, y = g + h, u = g - h, p = i + h, `M ${y} ${f} C ${g} ${f} ${g + b} ${m} ${u} ${m} H ${p}`) : (g = e + n, y = g - h, u = g + h, p = i + r - h, `M ${y} ${f} C ${g} ${f} ${g - b} ${m} ${u} ${m} H ${p}`);
1450
1464
  }
1451
- const An = "5.10.1-beta.1";
1452
- function Pn(t) {
1465
+ const Yn = "5.11.0";
1466
+ function Bn(t) {
1453
1467
  return {
1454
1468
  x: 0,
1455
1469
  y: 0,
@@ -1473,32 +1487,32 @@ function O({
1473
1487
  keypress: i,
1474
1488
  mouseSelectionButton: r,
1475
1489
  selectionContainer: c,
1476
- before: a,
1477
- newTopicName: l,
1490
+ before: d,
1491
+ newTopicName: a,
1478
1492
  allowUndo: h,
1479
1493
  generateMainBranch: f,
1480
- generateSubBranch: u,
1481
- overflowHidden: y,
1482
- theme: m,
1483
- alignment: p,
1494
+ generateSubBranch: p,
1495
+ overflowHidden: m,
1496
+ theme: y,
1497
+ alignment: u,
1484
1498
  scaleSensitivity: g,
1485
1499
  scaleMax: b,
1486
- scaleMin: w,
1500
+ scaleMin: v,
1487
1501
  handleWheel: x,
1488
1502
  markdown: S,
1489
1503
  imageProxy: T,
1490
1504
  pasteHandler: L
1491
1505
  }) {
1492
1506
  let C = null;
1493
- const N = Object.prototype.toString.call(t);
1494
- if (N === "[object HTMLDivElement]" ? C = t : N === "[object String]" && (C = document.querySelector(t)), !C) throw new Error("MindElixir: el is not a valid element");
1495
- C.style.position = "relative", C.innerHTML = "", this.el = C, this.disposable = [], this.before = a || {}, this.newTopicName = l || "New Node", this.contextMenu = o ?? !0, this.toolBar = s ?? !0, this.keypress = i ?? !0, this.mouseSelectionButton = r ?? 0, this.direction = e ?? 1, this.editable = n ?? !0, this.allowUndo = h ?? !0, this.scaleSensitivity = g ?? 0.1, this.scaleMax = b ?? 1.4, this.scaleMin = w ?? 0.2, this.generateMainBranch = f || Nn, this.generateSubBranch = u || $n, this.overflowHidden = y ?? !1, this.alignment = p ?? "root", this.handleWheel = x ?? !0, this.markdown = S || void 0, this.imageProxy = T || void 0, this.currentNodes = [], this.currentArrow = null, this.scaleVal = 1, this.tempDirection = null, this.dragMoveHelper = Pn(this), this.bus = Se(), this.container = document.createElement("div"), this.selectionContainer = c || this.container, this.container.className = "map-container";
1496
- const M = window.matchMedia("(prefers-color-scheme: dark)");
1497
- this.theme = m || (M.matches ? ct : rt);
1507
+ const P = Object.prototype.toString.call(t);
1508
+ if (P === "[object HTMLDivElement]" ? C = t : P === "[object String]" && (C = document.querySelector(t)), !C) throw new Error("MindElixir: el is not a valid element");
1509
+ C.style.position = "relative", C.innerHTML = "", this.el = C, this.disposable = [], this.before = d || {}, this.newTopicName = a || "New Node", this.contextMenu = o ?? !0, this.toolBar = s ?? !0, this.keypress = i ?? !0, this.mouseSelectionButton = r ?? 0, this.direction = e ?? 1, this.editable = n ?? !0, this.allowUndo = h ?? !0, this.scaleSensitivity = g ?? 0.1, this.scaleMax = b ?? 1.4, this.scaleMin = v ?? 0.2, this.generateMainBranch = f || In, this.generateSubBranch = p || On, this.overflowHidden = m ?? !1, this.alignment = u ?? "root", this.handleWheel = x ?? !0, this.markdown = S || void 0, this.imageProxy = T || void 0, this.currentNodes = [], this.currentArrow = null, this.scaleVal = 1, this.tempDirection = null, this.panHelper = Bn(this), this.bus = ke(), this.container = document.createElement("div"), this.selectionContainer = c || this.container, this.container.className = "map-container";
1510
+ const k = window.matchMedia("(prefers-color-scheme: dark)");
1511
+ this.theme = y || (k.matches ? ct : rt);
1498
1512
  const Y = document.createElement("div");
1499
- Y.className = "map-canvas", this.map = Y, this.container.setAttribute("tabindex", "0"), this.container.appendChild(this.map), this.el.appendChild(this.container), this.nodes = document.createElement("me-nodes"), this.lines = z("lines"), this.summarySvg = z("summary"), this.linkController = z("linkcontroller"), this.P2 = document.createElement("div"), this.P3 = document.createElement("div"), this.P2.className = this.P3.className = "circle", this.P2.style.display = this.P3.style.display = "none", this.line1 = yt(), this.line2 = yt(), this.linkController.appendChild(this.line1), this.linkController.appendChild(this.line2), this.linkSvgGroup = z("topiclinks"), this.labelContainer = document.createElement("div"), this.labelContainer.className = "label-container", this.map.appendChild(this.nodes), this.overflowHidden ? this.container.style.overflow = "hidden" : this.disposable.push(Ee(this)), L && (this.pasteHandler = L);
1513
+ Y.className = "map-canvas", this.map = Y, this.container.setAttribute("tabindex", "0"), this.container.appendChild(this.map), this.el.appendChild(this.container), this.nodes = document.createElement("me-nodes"), this.lines = F("lines"), this.summarySvg = F("summary"), this.linkController = F("linkcontroller"), this.P2 = document.createElement("div"), this.P3 = document.createElement("div"), this.P2.className = this.P3.className = "circle", this.P2.style.display = this.P3.style.display = "none", this.line1 = mt(), this.line2 = mt(), this.linkController.appendChild(this.line1), this.linkController.appendChild(this.line2), this.linkSvgGroup = F("topiclinks"), this.labelContainer = document.createElement("div"), this.labelContainer.className = "label-container", this.map.appendChild(this.nodes), this.overflowHidden ? this.container.style.overflow = "hidden" : this.disposable.push(Me(this)), L && (this.pasteHandler = L);
1500
1514
  }
1501
- O.prototype = kn;
1515
+ O.prototype = Hn;
1502
1516
  Object.defineProperty(O.prototype, "currentNode", {
1503
1517
  get() {
1504
1518
  return this.currentNodes[this.currentNodes.length - 1];
@@ -1510,13 +1524,13 @@ O.RIGHT = 1;
1510
1524
  O.SIDE = 2;
1511
1525
  O.THEME = rt;
1512
1526
  O.DARK_THEME = ct;
1513
- O.version = An;
1514
- O.E = Et;
1527
+ O.version = Yn;
1528
+ O.E = St;
1515
1529
  export {
1516
1530
  ct as DARK_THEME,
1517
- Hn as LEFT,
1518
- In as RIGHT,
1519
- On as SIDE,
1531
+ Wn as LEFT,
1532
+ Rn as RIGHT,
1533
+ Xn as SIDE,
1520
1534
  rt as THEME,
1521
1535
  O as default
1522
1536
  };