mind-elixir 5.0.3 → 5.0.5

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,7 +1,7 @@
1
- var ct = Object.defineProperty;
2
- var at = (e, t, n) => t in e ? ct(e, t, { enumerable: !0, configurable: !0, writable: !0, value: n }) : e[t] = n;
3
- var q = (e, t, n) => (at(e, typeof t != "symbol" ? t + "" : t, n), n);
4
- const pe = {
1
+ var at = Object.defineProperty;
2
+ var dt = (e, t, n) => t in e ? at(e, t, { enumerable: !0, configurable: !0, writable: !0, value: n }) : e[t] = n;
3
+ var z = (e, t, n) => (dt(e, typeof t != "symbol" ? t + "" : t, n), n);
4
+ const me = {
5
5
  name: "Latte",
6
6
  type: "light",
7
7
  palette: ["#dd7878", "#ea76cb", "#8839ef", "#e64553", "#fe640b", "#df8e1d", "#40a02b", "#209fb5", "#1e66f5", "#7287fd"],
@@ -26,7 +26,7 @@ const pe = {
26
26
  "--panel-border-color": "#eaeaea",
27
27
  "--map-padding": "50px"
28
28
  }
29
- }, ge = {
29
+ }, ve = {
30
30
  name: "Dark",
31
31
  type: "dark",
32
32
  palette: ["#848FA0", "#748BE9", "#D2F9FE", "#4145A5", "#789AFA", "#706CF4", "#EF987F", "#775DD5", "#FCEECF", "#DA7FBC"],
@@ -52,56 +52,67 @@ const pe = {
52
52
  "--map-padding": "50px 80px"
53
53
  }
54
54
  };
55
- function te(e) {
55
+ function ne(e) {
56
56
  return e.replace(/&/g, "&amp;").replace(/</g, "&lt;").replace(/"/g, "&quot;");
57
57
  }
58
- const ne = function(e, t) {
58
+ const oe = function(e, t) {
59
59
  if (t.id === e)
60
60
  return t;
61
61
  if (t.children && t.children.length) {
62
62
  for (let n = 0; n < t.children.length; n++) {
63
- const o = ne(e, t.children[n]);
63
+ const o = oe(e, t.children[n]);
64
64
  if (o)
65
65
  return o;
66
66
  }
67
67
  return null;
68
68
  } else
69
69
  return null;
70
- }, $ = (e, t) => {
70
+ }, j = (e, t) => {
71
71
  if (e.parent = t, e.children)
72
72
  for (let n = 0; n < e.children.length; n++)
73
- $(e.children[n], e);
73
+ j(e.children[n], e);
74
+ }, V = (e, t, n) => {
75
+ if (e.expanded = t, e.children)
76
+ if (n === void 0 || n > 0) {
77
+ const o = n !== void 0 ? n - 1 : void 0;
78
+ e.children.forEach((i) => {
79
+ V(i, t, o);
80
+ });
81
+ } else
82
+ e.children.forEach((o) => {
83
+ V(o, !1);
84
+ });
74
85
  };
75
- function me(e) {
76
- if (e.id = V(), e.children)
86
+ function be(e) {
87
+ if (e.id = K(), e.children)
77
88
  for (let t = 0; t < e.children.length; t++)
78
- me(e.children[t]);
89
+ be(e.children[t]);
79
90
  }
80
- function oe(e, t, n, o) {
91
+ function ie(e, t, n, o) {
81
92
  const i = o - t, s = e - n;
82
93
  let r = Math.atan(Math.abs(i) / Math.abs(s)) / 3.14 * 180;
83
94
  if (isNaN(r))
84
95
  return;
85
96
  s < 0 && i > 0 && (r = 180 - r), s < 0 && i < 0 && (r = 180 + r), s > 0 && i < 0 && (r = 360 - r);
86
- const l = 12, u = 30, a = r + u, f = r - u;
97
+ const l = 12, c = 30, d = r + c, f = r - c;
87
98
  return {
88
- x1: n + Math.cos(Math.PI * a / 180) * l,
89
- y1: o - Math.sin(Math.PI * a / 180) * l,
99
+ x1: n + Math.cos(Math.PI * d / 180) * l,
100
+ y1: o - Math.sin(Math.PI * d / 180) * l,
90
101
  x2: n + Math.cos(Math.PI * f / 180) * l,
91
102
  y2: o - Math.sin(Math.PI * f / 180) * l
92
103
  };
93
104
  }
94
- function V() {
105
+ function K() {
95
106
  return ((/* @__PURE__ */ new Date()).getTime().toString(16) + Math.random().toString(16).substr(2)).substr(2, 16);
96
107
  }
97
- const dt = function() {
98
- const e = V();
108
+ const ht = function() {
109
+ const e = K();
99
110
  return {
100
111
  topic: this.newTopicName,
101
112
  id: e
102
113
  };
103
114
  };
104
- function ve(e) {
115
+ function ye(e) {
105
116
  return JSON.parse(
106
117
  JSON.stringify(e, (n, o) => {
107
118
  if (n !== "parent")
@@ -114,10 +125,10 @@ const H = (e, t) => {
114
125
  for (; t && t !== e; )
115
126
  n += t.offsetLeft, o += t.offsetTop, t = t.offsetParent;
116
127
  return { offsetLeft: n, offsetTop: o };
117
- }, S = (e, t) => {
128
+ }, N = (e, t) => {
118
129
  for (const n in t)
119
130
  e.setAttribute(n, t[n]);
120
- }, de = (e) => e ? e.tagName === "ME-TPC" : !1, le = (e) => e.filter((t) => t.nodeObj.parent).filter((t, n, o) => {
131
+ }, he = (e) => e ? e.tagName === "ME-TPC" : !1, ce = (e) => e.filter((t) => t.nodeObj.parent).filter((t, n, o) => {
121
132
  for (let i = 0; i < o.length; i++) {
122
133
  if (t === o[i])
123
134
  continue;
@@ -126,10 +137,10 @@ const H = (e, t) => {
126
137
  return !1;
127
138
  }
128
139
  return !0;
129
- }), Ye = (e) => {
140
+ }), Ge = (e) => {
130
141
  const t = /translate\(([^,]+),\s*([^)]+)\)/, n = e.match(t);
131
142
  return n ? { x: parseFloat(n[1]), y: parseFloat(n[2]) } : { x: 0, y: 0 };
132
- }, be = function(e) {
143
+ }, we = function(e) {
133
144
  for (let t = 0; t < e.length; t++) {
134
145
  const { dom: n, evt: o, func: i } = e[t];
135
146
  n.addEventListener(o, i);
@@ -142,60 +153,70 @@ const H = (e, t) => {
142
153
  };
143
154
  };
144
155
  var M = /* @__PURE__ */ ((e) => (e.LHS = "lhs", e.RHS = "rhs", e))(M || {});
145
- const ht = (e) => {
156
+ const ut = (e) => {
146
157
  const t = e.map.querySelectorAll(".lhs>me-wrapper>me-parent>me-tpc");
147
158
  e.selectNode(t[Math.ceil(t.length / 2) - 1]);
148
- }, ut = (e) => {
159
+ }, ft = (e) => {
149
160
  const t = e.map.querySelectorAll(".rhs>me-wrapper>me-parent>me-tpc");
150
161
  e.selectNode(t[Math.ceil(t.length / 2) - 1]);
151
- }, ft = (e) => {
162
+ }, pt = (e) => {
152
163
  e.selectNode(e.map.querySelector("me-root>me-tpc"));
153
- }, pt = function(e, t) {
164
+ }, gt = function(e, t) {
154
165
  const n = t.parentElement.parentElement.parentElement.previousSibling;
155
166
  if (n) {
156
167
  const o = n.firstChild;
157
168
  e.selectNode(o);
158
169
  }
159
- }, gt = function(e, t) {
170
+ }, mt = function(e, t) {
160
171
  const n = t.parentElement.nextSibling;
161
172
  if (n && n.firstChild) {
162
173
  const o = n.firstChild.firstChild.firstChild;
163
174
  e.selectNode(o);
164
175
  }
165
- }, ke = function(e, t) {
176
+ }, Te = function(e, t) {
166
177
  var s, r;
167
178
  const n = e.currentNode || ((s = e.currentNodes) == null ? void 0 : s[0]);
168
179
  if (!n)
169
180
  return;
170
181
  const o = n.nodeObj, i = n.offsetParent.offsetParent.parentElement;
171
- o.parent ? i.className === t ? gt(e, n) : (r = o.parent) != null && r.parent ? pt(e, n) : ft(e) : t === M.LHS ? ht(e) : ut(e);
172
- }, _e = function(e, t) {
182
+ o.parent ? i.className === t ? mt(e, n) : (r = o.parent) != null && r.parent ? gt(e, n) : pt(e) : t === M.LHS ? ut(e) : ft(e);
183
+ }, Le = function(e, t) {
173
184
  const n = e.currentNode;
174
185
  if (!n || !n.nodeObj.parent)
175
186
  return;
176
187
  const i = t + "Sibling", s = n.parentElement.parentElement[i];
177
188
  s ? e.selectNode(s.firstChild.firstChild) : e.selectNode(n);
178
- }, ie = function(e, t, n) {
189
+ }, se = function(e, t, n) {
179
190
  const { scaleVal: o, scaleSensitivity: i } = e;
180
191
  switch (t) {
181
192
  case "in":
182
- if (o > 1.6)
183
- return;
184
193
  e.scale(o + i, n);
185
194
  break;
186
195
  case "out":
187
- if (o < 0.6)
188
- return;
189
196
  e.scale(o - i, n);
190
197
  }
191
198
  };
192
- function mt(e, t) {
199
+ function vt(e, t) {
193
200
  t = t === !0 ? {} : t;
194
201
  const n = () => {
195
202
  e.currentArrow ? e.removeArrow() : e.currentSummary ? e.removeSummary(e.currentSummary.summaryObj.id) : e.currentNodes && e.removeNodes(e.currentNodes);
196
- }, o = {
197
- Enter: (i) => {
198
- i.shiftKey ? e.insertSibling("before") : i.ctrlKey ? e.insertParent() : e.insertSibling("after");
203
+ };
204
+ let o = !1, i = null;
205
+ const s = (l) => {
206
+ const c = e.nodeData;
207
+ if (l.key === "0")
208
+ for (const d of c.children)
209
+ V(d, !1);
210
+ if (l.key === "=")
211
+ for (const d of c.children)
212
+ V(d, !0);
213
+ if (["1", "2", "3", "4", "5", "6", "7", "8", "9"].includes(l.key))
214
+ for (const d of c.children)
215
+ V(d, !0, Number(l.key) - 1);
216
+ e.refresh(), e.toCenter(), o = !1, i && (clearTimeout(i), i = null, e.container.removeEventListener("keydown", s));
217
+ }, r = {
218
+ Enter: (l) => {
219
+ l.shiftKey ? e.insertSibling("before") : l.ctrlKey ? e.insertParent() : e.insertSibling("after");
199
220
  },
200
221
  Tab: () => {
201
222
  e.addChild();
@@ -206,65 +227,74 @@ function mt(e, t) {
206
227
  F2: () => {
207
228
  e.beginEdit();
208
229
  },
209
- ArrowUp: (i) => {
210
- if (i.altKey)
230
+ ArrowUp: (l) => {
231
+ if (l.altKey)
211
232
  e.moveUpNode();
212
233
  else {
213
- if (i.metaKey || i.ctrlKey)
234
+ if (l.metaKey || l.ctrlKey)
214
235
  return e.initSide();
215
- _e(e, "previous");
236
+ Le(e, "previous");
216
237
  }
217
238
  },
218
- ArrowDown: (i) => {
219
- i.altKey ? e.moveDownNode() : _e(e, "next");
239
+ ArrowDown: (l) => {
240
+ l.altKey ? e.moveDownNode() : Le(e, "next");
220
241
  },
221
- ArrowLeft: (i) => {
222
- if (i.metaKey || i.ctrlKey)
242
+ ArrowLeft: (l) => {
243
+ if (l.metaKey || l.ctrlKey)
223
244
  return e.initLeft();
224
- ke(e, M.LHS);
245
+ Te(e, M.LHS);
225
246
  },
226
- ArrowRight: (i) => {
227
- if (i.metaKey || i.ctrlKey)
247
+ ArrowRight: (l) => {
248
+ if (l.metaKey || l.ctrlKey)
228
249
  return e.initRight();
229
- ke(e, M.RHS);
250
+ Te(e, M.RHS);
230
251
  },
231
252
  PageUp: () => e.moveUpNode(),
232
253
  PageDown: () => {
233
254
  e.moveDownNode();
234
255
  },
235
- c: (i) => {
236
- (i.metaKey || i.ctrlKey) && (e.waitCopy = e.currentNodes);
256
+ c: (l) => {
257
+ (l.metaKey || l.ctrlKey) && (e.waitCopy = e.currentNodes);
258
+ },
259
+ x: (l) => {
260
+ (l.metaKey || l.ctrlKey) && (e.waitCopy = e.currentNodes, n());
237
261
  },
238
- x: (i) => {
239
- (i.metaKey || i.ctrlKey) && (e.waitCopy = e.currentNodes, n());
262
+ v: (l) => {
263
+ !e.waitCopy || !e.currentNode || (l.metaKey || l.ctrlKey) && (e.waitCopy.length === 1 ? e.copyNode(e.waitCopy[0], e.currentNode) : e.copyNodes(e.waitCopy, e.currentNode));
240
264
  },
241
- v: (i) => {
242
- !e.waitCopy || !e.currentNode || (i.metaKey || i.ctrlKey) && (e.waitCopy.length === 1 ? e.copyNode(e.waitCopy[0], e.currentNode) : e.copyNodes(e.waitCopy, e.currentNode));
265
+ "=": (l) => {
266
+ (l.metaKey || l.ctrlKey) && se(e, "in");
243
267
  },
244
- "=": (i) => {
245
- (i.metaKey || i.ctrlKey) && ie(e, "in");
268
+ "-": (l) => {
269
+ (l.metaKey || l.ctrlKey) && se(e, "out");
246
270
  },
247
- "-": (i) => {
248
- (i.metaKey || i.ctrlKey) && ie(e, "out");
271
+ 0: (l) => {
272
+ if (l.metaKey || l.ctrlKey) {
273
+ if (o)
274
+ return;
275
+ e.scale(1);
276
+ }
249
277
  },
250
- 0: (i) => {
251
- (i.metaKey || i.ctrlKey) && e.scale(1);
278
+ k: (l) => {
279
+ (l.metaKey || l.ctrlKey) && (o = !0, i && (clearTimeout(i), e.container.removeEventListener("keydown", s)), i = window.setTimeout(() => {
280
+ o = !1, i = null;
281
+ }, 2e3), e.container.addEventListener("keydown", s));
252
282
  },
253
283
  Delete: n,
254
284
  Backspace: n,
255
285
  ...t
256
286
  };
257
- e.container.onkeydown = (i) => {
258
- if (i.preventDefault(), !e.editable)
287
+ e.container.onkeydown = (l) => {
288
+ if (l.preventDefault(), !e.editable)
259
289
  return;
260
- const s = o[i.key];
261
- s && s(i);
290
+ const c = r[l.key];
291
+ c && c(l);
262
292
  };
263
293
  }
264
- function vt(e) {
265
- const { dragMoveHelper: t } = e, n = (d) => {
294
+ function bt(e) {
295
+ const { dragMoveHelper: t } = e, n = (u) => {
266
296
  var m, v, b;
267
- if (d.button !== 0)
297
+ if (u.button !== 0)
268
298
  return;
269
299
  if ((m = e.helper1) != null && m.moved) {
270
300
  e.helper1.clear();
@@ -278,72 +308,72 @@ function vt(e) {
278
308
  t.clear();
279
309
  return;
280
310
  }
281
- const c = d.target;
282
- if (c.tagName === "ME-EPD")
283
- d.ctrlKey || d.metaKey ? e.expandNodeAll(c.previousSibling) : e.expandNode(c.previousSibling);
284
- else if (c.tagName === "ME-TPC" && e.currentNodes.length > 1)
285
- e.selectNode(c);
311
+ const a = u.target;
312
+ if (a.tagName === "ME-EPD")
313
+ u.ctrlKey || u.metaKey ? e.expandNodeAll(a.previousSibling) : e.expandNode(a.previousSibling);
314
+ else if (a.tagName === "ME-TPC" && e.currentNodes.length > 1)
315
+ e.selectNode(a);
286
316
  else if (!e.editable)
287
317
  return;
288
- const p = (b = c.parentElement) == null ? void 0 : b.parentElement;
289
- p.getAttribute("class") === "topiclinks" ? e.selectArrow(c.parentElement) : p.getAttribute("class") === "summary" && e.selectSummary(c.parentElement);
290
- }, o = (d) => {
318
+ const p = (b = a.parentElement) == null ? void 0 : b.parentElement;
319
+ p.getAttribute("class") === "topiclinks" ? e.selectArrow(a.parentElement) : p.getAttribute("class") === "summary" && e.selectSummary(a.parentElement);
320
+ }, o = (u) => {
291
321
  var m;
292
322
  if (!e.editable)
293
323
  return;
294
- const c = d.target;
295
- de(c) && e.beginEdit(c);
296
- const p = (m = c.parentElement) == null ? void 0 : m.parentElement;
297
- p.getAttribute("class") === "topiclinks" ? e.editArrowLabel(c.parentElement) : p.getAttribute("class") === "summary" && e.editSummary(c.parentElement);
324
+ const a = u.target;
325
+ he(a) && e.beginEdit(a);
326
+ const p = (m = a.parentElement) == null ? void 0 : m.parentElement;
327
+ p.getAttribute("class") === "topiclinks" ? e.editArrowLabel(a.parentElement) : p.getAttribute("class") === "summary" && e.editSummary(a.parentElement);
298
328
  };
299
329
  let i = 0;
300
- const s = (d) => {
301
- if (d.pointerType === "mouse")
330
+ const s = (u) => {
331
+ if (u.pointerType === "mouse")
302
332
  return;
303
- const c = (/* @__PURE__ */ new Date()).getTime(), p = c - i;
304
- p < 300 && p > 0 && o(d), i = c;
305
- }, r = (d) => {
333
+ const a = (/* @__PURE__ */ new Date()).getTime(), p = a - i;
334
+ p < 300 && p > 0 && o(u), i = a;
335
+ }, r = (u) => {
306
336
  t.moved = !1;
307
- const c = e.mouseSelectionButton === 0 ? 2 : 0;
308
- if (d.button !== c && d.pointerType === "mouse")
337
+ const a = e.mouseSelectionButton === 0 ? 2 : 0;
338
+ if (u.button !== a && u.pointerType === "mouse")
309
339
  return;
310
- t.x = d.clientX, t.y = d.clientY;
311
- const p = d.target;
312
- p.className !== "circle" && p.contentEditable !== "plaintext-only" && (t.mousedown = !0, e.map.style.transition = "none", p.setPointerCapture(d.pointerId));
313
- }, l = (d) => {
314
- if (d.target.contentEditable !== "plaintext-only") {
315
- const c = d.clientX - t.x, p = d.clientY - t.y;
316
- t.onMove(c, p);
340
+ t.x = u.clientX, t.y = u.clientY;
341
+ const p = u.target;
342
+ p.className !== "circle" && p.contentEditable !== "plaintext-only" && (t.mousedown = !0, e.map.style.transition = "none", p.setPointerCapture(u.pointerId));
343
+ }, l = (u) => {
344
+ if (u.target.contentEditable !== "plaintext-only") {
345
+ const a = u.clientX - t.x, p = u.clientY - t.y;
346
+ t.onMove(a, p);
317
347
  }
318
- t.x = d.clientX, t.y = d.clientY;
319
- }, u = (d) => {
320
- const c = e.mouseSelectionButton === 0 ? 2 : 0;
321
- if (d.button !== c && d.pointerType === "mouse")
348
+ t.x = u.clientX, t.y = u.clientY;
349
+ }, c = (u) => {
350
+ const a = e.mouseSelectionButton === 0 ? 2 : 0;
351
+ if (u.button !== a && u.pointerType === "mouse")
322
352
  return;
323
- const p = d.target;
324
- p.hasPointerCapture && p.hasPointerCapture(d.pointerId) && p.releasePointerCapture(d.pointerId), t.clear();
325
- }, a = (d) => {
326
- if (d.preventDefault(), d.button !== 2 || !e.editable)
353
+ const p = u.target;
354
+ p.hasPointerCapture && p.hasPointerCapture(u.pointerId) && p.releasePointerCapture(u.pointerId), t.clear();
355
+ }, d = (u) => {
356
+ if (u.preventDefault(), u.button !== 2 || !e.editable)
327
357
  return;
328
- const c = d.target;
329
- de(c) && !c.classList.contains("selected") && e.selectNode(c), setTimeout(() => {
330
- e.dragMoveHelper.moved || e.bus.fire("showContextMenu", d);
358
+ const a = u.target;
359
+ he(a) && !a.classList.contains("selected") && e.selectNode(a), setTimeout(() => {
360
+ e.dragMoveHelper.moved || e.bus.fire("showContextMenu", u);
331
361
  }, 200);
332
- }, f = (d) => {
333
- d.stopPropagation(), d.preventDefault(), d.ctrlKey || d.metaKey ? d.deltaY < 0 ? ie(e, "in", e.dragMoveHelper) : e.scaleVal - e.scaleSensitivity > 0 && ie(e, "out", e.dragMoveHelper) : d.shiftKey ? e.move(-d.deltaY, 0) : (e.map.style.transition = "none", e.move(-d.deltaX, -d.deltaY), e.map.style.transition = "transform 0.3s");
362
+ }, f = (u) => {
363
+ u.stopPropagation(), u.preventDefault(), u.ctrlKey || u.metaKey ? u.deltaY < 0 ? se(e, "in", e.dragMoveHelper) : e.scaleVal - e.scaleSensitivity > 0 && se(e, "out", e.dragMoveHelper) : u.shiftKey ? e.move(-u.deltaY, 0) : (e.map.style.transition = "none", e.move(-u.deltaX, -u.deltaY), e.map.style.transition = "transform 0.3s");
334
364
  }, { container: h } = e;
335
- return be([
365
+ return we([
336
366
  { dom: h, evt: "pointerdown", func: r },
337
367
  { dom: h, evt: "pointermove", func: l },
338
- { dom: h, evt: "pointerup", func: u },
368
+ { dom: h, evt: "pointerup", func: c },
339
369
  { dom: h, evt: "pointerup", func: s },
340
370
  { dom: h, evt: "click", func: n },
341
371
  { dom: h, evt: "dblclick", func: o },
342
- { dom: h, evt: "contextmenu", func: a },
372
+ { dom: h, evt: "contextmenu", func: d },
343
373
  { dom: h, evt: "wheel", func: typeof e.handleWheel == "function" ? e.handleWheel : f }
344
374
  ]);
345
375
  }
346
- function bt() {
376
+ function yt() {
347
377
  return {
348
378
  handlers: {},
349
379
  addListener: function(e, t) {
@@ -368,11 +398,11 @@ function bt() {
368
398
  }
369
399
  };
370
400
  }
371
- const se = document, yt = function() {
401
+ const re = document, wt = function() {
372
402
  this.nodes.innerHTML = "";
373
403
  const e = this.createTopic(this.nodeData);
374
- ye(e, this.nodeData), e.draggable = !1;
375
- const t = se.createElement("me-root");
404
+ xe(e, this.nodeData), e.draggable = !1;
405
+ const t = re.createElement("me-root");
376
406
  t.appendChild(e);
377
407
  const n = this.nodeData.children || [];
378
408
  if (this.direction === 2) {
@@ -381,30 +411,30 @@ const se = document, yt = function() {
381
411
  s.direction === 0 ? o += 1 : s.direction === 1 ? i += 1 : o <= i ? (s.direction = 0, o += 1) : (s.direction = 1, i += 1);
382
412
  });
383
413
  }
384
- wt(this, n, t);
385
- }, wt = function(e, t, n) {
386
- const o = se.createElement("me-main");
414
+ xt(this, n, t);
415
+ }, xt = function(e, t, n) {
416
+ const o = re.createElement("me-main");
387
417
  o.className = M.LHS;
388
- const i = se.createElement("me-main");
418
+ const i = re.createElement("me-main");
389
419
  i.className = M.RHS;
390
420
  for (let s = 0; s < t.length; s++) {
391
421
  const r = t[s], { grp: l } = e.createWrapper(r);
392
422
  e.direction === 2 ? r.direction === 0 ? o.appendChild(l) : i.appendChild(l) : e.direction === 0 ? o.appendChild(l) : i.appendChild(l);
393
423
  }
394
424
  e.nodes.appendChild(o), e.nodes.appendChild(n), e.nodes.appendChild(i), e.nodes.appendChild(e.lines);
395
- }, xt = function(e, t) {
396
- const n = se.createElement("me-children");
425
+ }, Et = function(e, t) {
426
+ const n = re.createElement("me-children");
397
427
  for (let o = 0; o < t.length; o++) {
398
428
  const i = t[o], { grp: s } = e.createWrapper(i);
399
429
  n.appendChild(s);
400
430
  }
401
431
  return n;
402
- }, L = document, Ge = function(e, t) {
432
+ }, T = document, Ve = function(e, t) {
403
433
  const o = (this != null && this.el ? this.el : t || document).querySelector(`[data-nodeid="me${e}"]`);
404
434
  if (!o)
405
435
  throw new Error(`FindEle: Node ${e} not found, maybe it's collapsed.`);
406
436
  return o;
407
- }, ye = function(e, t) {
437
+ }, xe = function(e, t) {
408
438
  if (e.innerHTML = "", t.style) {
409
439
  const n = t.style;
410
440
  for (const o in n)
@@ -417,60 +447,60 @@ const se = document, yt = function() {
417
447
  if (t.image) {
418
448
  const n = t.image;
419
449
  if (n.url && n.width && n.height) {
420
- const o = L.createElement("img");
450
+ const o = T.createElement("img");
421
451
  o.src = n.url, o.style.width = n.width + "px", o.style.height = n.height + "px", n.fit && (o.style.objectFit = n.fit), e.appendChild(o), e.image = o;
422
452
  }
423
453
  } else
424
454
  e.image && (e.image = void 0);
425
455
  {
426
- const n = L.createElement("span");
456
+ const n = T.createElement("span");
427
457
  n.className = "text", n.textContent = t.topic, e.appendChild(n), e.text = n;
428
458
  }
429
459
  if (t.hyperLink) {
430
- const n = L.createElement("a");
460
+ const n = T.createElement("a");
431
461
  n.className = "hyper-link", n.target = "_blank", n.innerText = "🔗", n.href = t.hyperLink, e.appendChild(n), e.link = n;
432
462
  } else
433
463
  e.link && (e.link = void 0);
434
464
  if (t.icons && t.icons.length) {
435
- const n = L.createElement("span");
436
- n.className = "icons", n.innerHTML = t.icons.map((o) => `<span>${te(o)}</span>`).join(""), e.appendChild(n), e.icons = n;
465
+ const n = T.createElement("span");
466
+ n.className = "icons", n.innerHTML = t.icons.map((o) => `<span>${ne(o)}</span>`).join(""), e.appendChild(n), e.icons = n;
437
467
  } else
438
468
  e.icons && (e.icons = void 0);
439
469
  if (t.tags && t.tags.length) {
440
- const n = L.createElement("div");
441
- n.className = "tags", n.innerHTML = t.tags.map((o) => `<span>${te(o)}</span>`).join(""), e.appendChild(n), e.tags = n;
470
+ const n = T.createElement("div");
471
+ n.className = "tags", n.innerHTML = t.tags.map((o) => `<span>${ne(o)}</span>`).join(""), e.appendChild(n), e.tags = n;
442
472
  } else
443
473
  e.tags && (e.tags = void 0);
444
- }, Et = function(e, t) {
445
- const n = L.createElement("me-wrapper"), { p: o, tpc: i } = this.createParent(e);
474
+ }, Ct = function(e, t) {
475
+ const n = T.createElement("me-wrapper"), { p: o, tpc: i } = this.createParent(e);
446
476
  if (n.appendChild(o), !t && e.children && e.children.length > 0) {
447
- const s = we(e.expanded);
477
+ const s = Ee(e.expanded);
448
478
  if (o.appendChild(s), e.expanded !== !1) {
449
- const r = xt(this, e.children);
479
+ const r = Et(this, e.children);
450
480
  n.appendChild(r);
451
481
  }
452
482
  }
453
483
  return { grp: n, top: o, tpc: i };
454
- }, Ct = function(e) {
455
- const t = L.createElement("me-parent"), n = this.createTopic(e);
456
- return ye(n, e), t.appendChild(n), { p: t, tpc: n };
457
484
  }, St = function(e) {
458
- const t = L.createElement("me-children");
459
- return t.append(...e), t;
485
+ const t = T.createElement("me-parent"), n = this.createTopic(e);
486
+ return xe(n, e), t.appendChild(n), { p: t, tpc: n };
460
487
  }, Nt = function(e) {
461
- const t = L.createElement("me-tpc");
488
+ const t = T.createElement("me-children");
489
+ return t.append(...e), t;
490
+ }, kt = function(e) {
491
+ const t = T.createElement("me-tpc");
462
492
  return t.nodeObj = e, t.dataset.nodeid = "me" + e.id, t.draggable = this.draggable, t;
463
493
  };
464
- function Ke(e) {
465
- const t = L.createRange();
494
+ function qe(e) {
495
+ const t = T.createRange();
466
496
  t.selectNodeContents(e);
467
497
  const n = window.getSelection();
468
498
  n && (n.removeAllRanges(), n.addRange(t));
469
499
  }
470
- const kt = function(e) {
500
+ const _t = function(e) {
471
501
  if (!e)
472
502
  return;
473
- const t = L.createElement("div"), n = e.text.textContent;
503
+ const t = T.createElement("div"), n = e.text.textContent;
474
504
  e.appendChild(t), t.id = "input-box", t.textContent = n, t.contentEditable = "plaintext-only", t.spellcheck = !1;
475
505
  const o = getComputedStyle(e);
476
506
  t.style.cssText = `min-width:${e.offsetWidth - 8}px;
@@ -479,7 +509,7 @@ const kt = function(e) {
479
509
  margin:${o.margin};
480
510
  font:${o.font};
481
511
  background-color:${o.backgroundColor !== "rgba(0, 0, 0, 0)" && o.backgroundColor};
482
- border-radius:${o.borderRadius};`, this.direction === 0 && (t.style.right = "0"), Ke(t), this.bus.fire("operation", {
512
+ border-radius:${o.borderRadius};`, this.direction === 0 && (t.style.right = "0"), qe(t), this.bus.fire("operation", {
483
513
  name: "beginEdit",
484
514
  obj: e.nodeObj
485
515
  }), t.addEventListener("keydown", (i) => {
@@ -501,25 +531,33 @@ const kt = function(e) {
501
531
  origin: n
502
532
  }));
503
533
  });
504
- }, we = function(e) {
505
- const t = L.createElement("me-epd");
534
+ }, Ee = function(e) {
535
+ const t = T.createElement("me-epd");
506
536
  return t.expanded = e !== !1, t.className = e !== !1 ? "minus" : "", t;
507
- }, W = document, _ = "http://www.w3.org/2000/svg", qe = function(e, t, n) {
508
- const o = W.createElementNS(_, "path");
509
- return S(o, {
537
+ }, W = document, L = "http://www.w3.org/2000/svg", ue = function(e, t, n, o = {}) {
538
+ const { anchor: i = "middle", color: s, dataType: r } = o, l = document.createElementNS(L, "text");
539
+ return N(l, {
540
+ "text-anchor": i,
541
+ x: t + "",
542
+ y: n + "",
543
+ fill: s || (i === "middle" ? "rgb(235, 95, 82)" : "#666")
544
+ }), r && (l.dataset.type = r), l.innerHTML = e, l;
545
+ }, ze = function(e, t, n) {
546
+ const o = W.createElementNS(L, "path");
547
+ return N(o, {
510
548
  d: e,
511
549
  stroke: t || "#666",
512
550
  fill: "none",
513
551
  "stroke-width": n
514
552
  }), o;
515
- }, U = function(e) {
516
- const t = W.createElementNS(_, "svg");
553
+ }, X = function(e) {
554
+ const t = W.createElementNS(L, "svg");
517
555
  return t.setAttribute("class", e), t.setAttribute("overflow", "visible"), t;
518
- }, Te = function() {
519
- const e = W.createElementNS(_, "line");
556
+ }, Ae = function() {
557
+ const e = W.createElementNS(L, "line");
520
558
  return e.setAttribute("stroke", "#4dc4ff"), e.setAttribute("fill", "none"), e.setAttribute("stroke-width", "2"), e.setAttribute("opacity", "0.45"), e;
521
- }, _t = function(e, t, n, o) {
522
- const i = W.createElementNS(_, "g");
559
+ }, Tt = function(e, t, n, o) {
560
+ const i = W.createElementNS(L, "g");
523
561
  return [
524
562
  {
525
563
  name: "line",
@@ -534,23 +572,23 @@ const kt = function(e) {
534
572
  d: n
535
573
  }
536
574
  ].forEach((r, l) => {
537
- const u = r.d, a = W.createElementNS(_, "path"), f = {
538
- d: u,
575
+ const c = r.d, d = W.createElementNS(L, "path"), f = {
576
+ d: c,
539
577
  stroke: (o == null ? void 0 : o.stroke) || "rgb(235, 95, 82)",
540
578
  fill: "none",
541
579
  "stroke-linecap": (o == null ? void 0 : o.strokeLinecap) || "cap",
542
580
  "stroke-width": String((o == null ? void 0 : o.strokeWidth) || "2")
543
581
  };
544
- (o == null ? void 0 : o.opacity) !== void 0 && (f.opacity = String(o.opacity)), S(a, f), l === 0 && a.setAttribute("stroke-dasharray", (o == null ? void 0 : o.strokeDasharray) || "8,2");
545
- const h = W.createElementNS(_, "path");
546
- S(h, {
547
- d: u,
582
+ (o == null ? void 0 : o.opacity) !== void 0 && (f.opacity = String(o.opacity)), N(d, f), l === 0 && d.setAttribute("stroke-dasharray", (o == null ? void 0 : o.strokeDasharray) || "8,2");
583
+ const h = W.createElementNS(L, "path");
584
+ N(h, {
585
+ d: c,
548
586
  stroke: "transparent",
549
587
  fill: "none",
550
588
  "stroke-width": "15"
551
- }), i.appendChild(h), i.appendChild(a), i[r.name] = a;
589
+ }), i.appendChild(h), i.appendChild(d), i[r.name] = d;
552
590
  }), i;
553
- }, ze = function(e, t, n) {
591
+ }, Ue = function(e, t, n) {
554
592
  if (!t)
555
593
  return;
556
594
  const o = W.createElement("div");
@@ -565,7 +603,7 @@ const kt = function(e) {
565
603
  top:${s.y}px;
566
604
  padding: 2px 4px;
567
605
  margin: -2px -4px;
568
- `, Ke(o), e.scrollIntoView(o), o.addEventListener("keydown", (r) => {
606
+ `, qe(o), e.scrollIntoView(o), o.addEventListener("keydown", (r) => {
569
607
  r.stopPropagation();
570
608
  const l = r.key;
571
609
  if (l === "Enter" || l === "Tab") {
@@ -586,34 +624,34 @@ const kt = function(e) {
586
624
  obj: n
587
625
  }));
588
626
  });
589
- }, Tt = function(e) {
627
+ }, Lt = function(e) {
590
628
  const t = this.map.querySelector("me-root"), n = t.offsetTop, o = t.offsetLeft, i = t.offsetWidth, s = t.offsetHeight, r = this.map.querySelectorAll("me-main > me-wrapper");
591
629
  this.lines.innerHTML = "";
592
630
  for (let l = 0; l < r.length; l++) {
593
- const u = r[l], a = u.querySelector("me-tpc"), { offsetLeft: f, offsetTop: h } = H(this.nodes, a), g = a.offsetWidth, d = a.offsetHeight, c = u.parentNode.className, p = this.generateMainBranch({ pT: n, pL: o, pW: i, pH: s, cT: h, cL: f, cW: g, cH: d, direction: c, containerHeight: this.nodes.offsetHeight }), m = this.theme.palette, v = a.nodeObj.branchColor || m[l % m.length];
594
- if (a.style.borderColor = v, this.lines.appendChild(qe(p, v, "3")), e && e !== u)
631
+ const c = r[l], d = c.querySelector("me-tpc"), { offsetLeft: f, offsetTop: h } = H(this.nodes, d), g = d.offsetWidth, u = d.offsetHeight, a = c.parentNode.className, p = this.generateMainBranch({ pT: n, pL: o, pW: i, pH: s, cT: h, cL: f, cW: g, cH: u, direction: a, containerHeight: this.nodes.offsetHeight }), m = this.theme.palette, v = d.nodeObj.branchColor || m[l % m.length];
632
+ if (d.style.borderColor = v, this.lines.appendChild(ze(p, v, "3")), e && e !== c)
595
633
  continue;
596
- const b = U("subLines"), w = u.lastChild;
597
- w.tagName === "svg" && w.remove(), u.appendChild(b), Ue(this, b, v, u, c, !0);
634
+ const b = X("subLines"), x = c.lastChild;
635
+ x.tagName === "svg" && x.remove(), c.appendChild(b), Xe(this, b, v, c, a, !0);
598
636
  }
599
637
  this.renderArrow(), this.renderSummary(), this.bus.fire("linkDiv");
600
- }, Ue = function(e, t, n, o, i, s) {
638
+ }, Xe = function(e, t, n, o, i, s) {
601
639
  const r = o.firstChild, l = o.children[1].children;
602
640
  if (l.length === 0)
603
641
  return;
604
- const u = r.offsetTop, a = r.offsetLeft, f = r.offsetWidth, h = r.offsetHeight;
642
+ const c = r.offsetTop, d = r.offsetLeft, f = r.offsetWidth, h = r.offsetHeight;
605
643
  for (let g = 0; g < l.length; g++) {
606
- const d = l[g], c = d.firstChild, p = c.offsetTop, m = c.offsetLeft, v = c.offsetWidth, b = c.offsetHeight, w = c.firstChild.nodeObj.branchColor || n, E = e.generateSubBranch({ pT: u, pL: a, pW: f, pH: h, cT: p, cL: m, cW: v, cH: b, direction: i, isFirst: s });
607
- t.appendChild(qe(E, w, "2"));
608
- const N = c.children[1];
609
- if (N) {
610
- if (!N.expanded)
644
+ const u = l[g], a = u.firstChild, p = a.offsetTop, m = a.offsetLeft, v = a.offsetWidth, b = a.offsetHeight, x = a.firstChild.nodeObj.branchColor || n, S = e.generateSubBranch({ pT: c, pL: d, pW: f, pH: h, cT: p, cL: m, cW: v, cH: b, direction: i, isFirst: s });
645
+ t.appendChild(ze(S, x, "2"));
646
+ const k = a.children[1];
647
+ if (k) {
648
+ if (!k.expanded)
611
649
  continue;
612
650
  } else
613
651
  continue;
614
- Ue(e, t, w, d, i);
652
+ Xe(e, t, x, u, i);
615
653
  }
616
- }, Le = {
654
+ }, Me = {
617
655
  addChild: "插入子节点",
618
656
  addParent: "插入父节点",
619
657
  addSibling: "插入同级节点",
@@ -626,9 +664,9 @@ const kt = function(e) {
626
664
  linkBidirectional: "双向连接",
627
665
  clickTips: "请点击目标节点",
628
666
  summary: "摘要"
629
- }, Ae = {
630
- cn: Le,
631
- zh_CN: Le,
667
+ }, De = {
668
+ cn: Me,
669
+ zh_CN: Me,
632
670
  zh_TW: {
633
671
  addChild: "插入子節點",
634
672
  addParent: "插入父節點",
@@ -756,105 +794,105 @@ const kt = function(e) {
756
794
  summary: "요약"
757
795
  }
758
796
  };
759
- function Lt(e, t) {
797
+ function At(e, t) {
760
798
  t = t === !0 ? {
761
799
  focus: !0,
762
800
  link: !0
763
801
  } : t;
764
- const n = (x) => {
765
- const y = document.createElement("div");
766
- return y.innerText = x, y.className = "tips", y;
767
- }, o = (x, y, C) => {
768
- const k = document.createElement("li");
769
- return k.id = x, k.innerHTML = `<span>${te(y)}</span><span ${C ? 'class="key"' : ""}>${te(C)}</span>`, k;
770
- }, i = Ae[e.locale] ? e.locale : "en", s = Ae[i], r = o("cm-add_child", s.addChild, "Tab"), l = o("cm-add_parent", s.addParent, "Ctrl + Enter"), u = o("cm-add_sibling", s.addSibling, "Enter"), a = o("cm-remove_child", s.removeNode, "Delete"), f = o("cm-fucus", s.focus, ""), h = o("cm-unfucus", s.cancelFocus, ""), g = o("cm-up", s.moveUp, "PgUp"), d = o("cm-down", s.moveDown, "Pgdn"), c = o("cm-link", s.link, ""), p = o("cm-link-bidirectional", s.linkBidirectional, ""), m = o("cm-summary", s.summary, ""), v = document.createElement("ul");
771
- if (v.className = "menu-list", v.appendChild(r), v.appendChild(l), v.appendChild(u), v.appendChild(a), t.focus && (v.appendChild(f), v.appendChild(h)), v.appendChild(g), v.appendChild(d), v.appendChild(m), t.link && (v.appendChild(c), v.appendChild(p)), t && t.extend)
772
- for (let x = 0; x < t.extend.length; x++) {
773
- const y = t.extend[x], C = o(y.name, y.name, y.key || "");
774
- v.appendChild(C), C.onclick = (k) => {
775
- y.onclick(k);
802
+ const n = (y) => {
803
+ const w = document.createElement("div");
804
+ return w.innerText = y, w.className = "tips", w;
805
+ }, o = (y, w, E) => {
806
+ const C = document.createElement("li");
807
+ return C.id = y, C.innerHTML = `<span>${ne(w)}</span><span ${E ? 'class="key"' : ""}>${ne(E)}</span>`, C;
808
+ }, i = De[e.locale] ? e.locale : "en", s = De[i], r = o("cm-add_child", s.addChild, "Tab"), l = o("cm-add_parent", s.addParent, "Ctrl + Enter"), c = o("cm-add_sibling", s.addSibling, "Enter"), d = o("cm-remove_child", s.removeNode, "Delete"), f = o("cm-fucus", s.focus, ""), h = o("cm-unfucus", s.cancelFocus, ""), g = o("cm-up", s.moveUp, "PgUp"), u = o("cm-down", s.moveDown, "Pgdn"), a = o("cm-link", s.link, ""), p = o("cm-link-bidirectional", s.linkBidirectional, ""), m = o("cm-summary", s.summary, ""), v = document.createElement("ul");
809
+ if (v.className = "menu-list", v.appendChild(r), v.appendChild(l), v.appendChild(c), v.appendChild(d), t.focus && (v.appendChild(f), v.appendChild(h)), v.appendChild(g), v.appendChild(u), v.appendChild(m), t.link && (v.appendChild(a), v.appendChild(p)), t && t.extend)
810
+ for (let y = 0; y < t.extend.length; y++) {
811
+ const w = t.extend[y], E = o(w.name, w.name, w.key || "");
812
+ v.appendChild(E), E.onclick = (C) => {
813
+ w.onclick(C);
776
814
  };
777
815
  }
778
816
  const b = document.createElement("div");
779
817
  b.className = "context-menu", b.appendChild(v), b.hidden = !0, e.container.append(b);
780
- let w = !0;
781
- const E = (x) => {
782
- const y = x.target;
783
- if (de(y)) {
784
- y.parentElement.tagName === "ME-ROOT" ? w = !0 : w = !1, w ? (f.className = "disabled", g.className = "disabled", d.className = "disabled", l.className = "disabled", u.className = "disabled", a.className = "disabled") : (f.className = "", g.className = "", d.className = "", l.className = "", u.className = "", a.className = ""), b.hidden = !1, v.style.top = "", v.style.bottom = "", v.style.left = "", v.style.right = "";
785
- const C = v.getBoundingClientRect(), k = v.offsetHeight, O = v.offsetWidth, B = x.clientY - C.top, R = x.clientX - C.left;
786
- k + B > window.innerHeight ? (v.style.top = "", v.style.bottom = "0px") : (v.style.bottom = "", v.style.top = B + 15 + "px"), O + R > window.innerWidth ? (v.style.left = "", v.style.right = "0px") : (v.style.right = "", v.style.left = R + 10 + "px");
818
+ let x = !0;
819
+ const S = (y) => {
820
+ const w = y.target;
821
+ if (he(w)) {
822
+ w.parentElement.tagName === "ME-ROOT" ? x = !0 : x = !1, x ? (f.className = "disabled", g.className = "disabled", u.className = "disabled", l.className = "disabled", c.className = "disabled", d.className = "disabled") : (f.className = "", g.className = "", u.className = "", l.className = "", c.className = "", d.className = ""), b.hidden = !1, v.style.top = "", v.style.bottom = "", v.style.left = "", v.style.right = "";
823
+ const E = v.getBoundingClientRect(), C = v.offsetHeight, O = v.offsetWidth, B = y.clientY - E.top, R = y.clientX - E.left;
824
+ C + B > window.innerHeight ? (v.style.top = "", v.style.bottom = "0px") : (v.style.bottom = "", v.style.top = B + 15 + "px"), O + R > window.innerWidth ? (v.style.left = "", v.style.right = "0px") : (v.style.right = "", v.style.left = R + 10 + "px");
787
825
  }
788
826
  };
789
- e.bus.addListener("showContextMenu", E), b.onclick = (x) => {
790
- x.target === b && (b.hidden = !0);
827
+ e.bus.addListener("showContextMenu", S), b.onclick = (y) => {
828
+ y.target === b && (b.hidden = !0);
791
829
  }, r.onclick = () => {
792
830
  e.addChild(), b.hidden = !0;
793
831
  }, l.onclick = () => {
794
832
  e.insertParent(), b.hidden = !0;
795
- }, u.onclick = () => {
796
- w || (e.insertSibling("after"), b.hidden = !0);
797
- }, a.onclick = () => {
798
- w || (e.removeNodes(e.currentNodes || []), b.hidden = !0);
833
+ }, c.onclick = () => {
834
+ x || (e.insertSibling("after"), b.hidden = !0);
835
+ }, d.onclick = () => {
836
+ x || (e.removeNodes(e.currentNodes || []), b.hidden = !0);
799
837
  }, f.onclick = () => {
800
- w || (e.focusNode(e.currentNode), b.hidden = !0);
838
+ x || (e.focusNode(e.currentNode), b.hidden = !0);
801
839
  }, h.onclick = () => {
802
840
  e.cancelFocus(), b.hidden = !0;
803
841
  }, g.onclick = () => {
804
- w || (e.moveUpNode(), b.hidden = !0);
805
- }, d.onclick = () => {
806
- w || (e.moveDownNode(), b.hidden = !0);
842
+ x || (e.moveUpNode(), b.hidden = !0);
843
+ }, u.onclick = () => {
844
+ x || (e.moveDownNode(), b.hidden = !0);
807
845
  };
808
- const N = (x) => {
846
+ const k = (y) => {
809
847
  b.hidden = !0;
810
- const y = e.currentNode, C = n(s.clickTips);
811
- e.container.appendChild(C), e.map.addEventListener(
848
+ const w = e.currentNode, E = n(s.clickTips);
849
+ e.container.appendChild(E), e.map.addEventListener(
812
850
  "click",
813
- (k) => {
814
- k.preventDefault(), C.remove();
815
- const O = k.target;
816
- (O.parentElement.tagName === "ME-PARENT" || O.parentElement.tagName === "ME-ROOT") && e.createArrow(y, O, x);
851
+ (C) => {
852
+ C.preventDefault(), E.remove();
853
+ const O = C.target;
854
+ (O.parentElement.tagName === "ME-PARENT" || O.parentElement.tagName === "ME-ROOT") && e.createArrow(w, O, y);
817
855
  },
818
856
  {
819
857
  once: !0
820
858
  }
821
859
  );
822
860
  };
823
- return c.onclick = () => N(), p.onclick = () => N({ bidirectional: !0 }), m.onclick = () => {
861
+ return a.onclick = () => k(), p.onclick = () => k({ bidirectional: !0 }), m.onclick = () => {
824
862
  b.hidden = !0, e.createSummary(), e.unselectNodes(e.currentNodes);
825
863
  }, () => {
826
- r.onclick = null, l.onclick = null, u.onclick = null, a.onclick = null, f.onclick = null, h.onclick = null, g.onclick = null, d.onclick = null, c.onclick = null, m.onclick = null, b.onclick = null, e.container.oncontextmenu = null;
864
+ r.onclick = null, l.onclick = null, c.onclick = null, d.onclick = null, f.onclick = null, h.onclick = null, g.onclick = null, u.onclick = null, a.onclick = null, m.onclick = null, b.onclick = null, e.container.oncontextmenu = null;
827
865
  };
828
866
  }
829
- const he = document, At = function(e, t) {
867
+ const fe = document, Mt = function(e, t) {
830
868
  if (!t)
831
- return ue(e), e;
869
+ return pe(e), e;
832
870
  let n = e.querySelector(".insert-preview");
833
871
  const o = `insert-preview ${t} show`;
834
- return n || (n = he.createElement("div"), e.appendChild(n)), n.className = o, e;
835
- }, ue = function(e) {
872
+ return n || (n = fe.createElement("div"), e.appendChild(n)), n.className = o, e;
873
+ }, pe = function(e) {
836
874
  if (!e)
837
875
  return;
838
876
  const t = e.querySelectorAll(".insert-preview");
839
877
  for (const n of t || [])
840
878
  n.remove();
841
- }, Me = function(e, t) {
879
+ }, Oe = function(e, t) {
842
880
  for (const n of t) {
843
881
  const o = n.parentElement.parentElement.contains(e);
844
882
  if (!(e && e.tagName === "ME-TPC" && e !== n && !o && e.nodeObj.parent))
845
883
  return !1;
846
884
  }
847
885
  return !0;
848
- }, Mt = function(e) {
886
+ }, Dt = function(e) {
849
887
  const t = document.createElement("div");
850
888
  return t.className = "mind-elixir-ghost", e.container.appendChild(t), t;
851
889
  };
852
- class Dt {
890
+ class Ot {
853
891
  constructor(t) {
854
- q(this, "mind");
855
- q(this, "isMoving", !1);
856
- q(this, "interval", null);
857
- q(this, "speed", 20);
892
+ z(this, "mind");
893
+ z(this, "isMoving", !1);
894
+ z(this, "interval", null);
895
+ z(this, "speed", 20);
858
896
  this.mind = t;
859
897
  }
860
898
  move(t, n) {
@@ -866,59 +904,59 @@ class Dt {
866
904
  this.isMoving = !1, clearInterval(this.interval);
867
905
  }
868
906
  }
869
- function Ot(e) {
907
+ function Pt(e) {
870
908
  let t = null, n = null;
871
- const o = Mt(e), i = new Dt(e), s = (a) => {
909
+ const o = Dt(e), i = new Ot(e), s = (d) => {
872
910
  e.selection.cancel();
873
- const f = a.target;
911
+ const f = d.target;
874
912
  if ((f == null ? void 0 : f.tagName) !== "ME-TPC") {
875
- a.preventDefault();
913
+ d.preventDefault();
876
914
  return;
877
915
  }
878
916
  let h = e.currentNodes;
879
917
  h != null && h.includes(f) || (e.selectNode(f), h = e.currentNodes), e.dragged = h, h.length > 1 ? o.innerHTML = h.length + "" : o.innerHTML = f.innerHTML;
880
918
  for (const g of h)
881
919
  g.parentElement.parentElement.style.opacity = "0.5";
882
- a.dataTransfer.setDragImage(o, 0, 0), a.dataTransfer.dropEffect = "move", e.dragMoveHelper.clear();
883
- }, r = (a) => {
920
+ d.dataTransfer.setDragImage(o, 0, 0), d.dataTransfer.dropEffect = "move", e.dragMoveHelper.clear();
921
+ }, r = (d) => {
884
922
  const { dragged: f } = e;
885
923
  if (!f)
886
924
  return;
887
925
  i.stop();
888
926
  for (const g of f)
889
927
  g.parentElement.parentElement.style.opacity = "1";
890
- const h = a.target;
891
- h.style.opacity = "", n && (ue(n), t === "before" ? e.moveNodeBefore(f, n) : t === "after" ? e.moveNodeAfter(f, n) : t === "in" && e.moveNodeIn(f, n), e.dragged = null);
892
- }, l = (a) => {
893
- a.preventDefault();
928
+ const h = d.target;
929
+ h.style.opacity = "", n && (pe(n), t === "before" ? e.moveNodeBefore(f, n) : t === "after" ? e.moveNodeAfter(f, n) : t === "in" && e.moveNodeIn(f, n), e.dragged = null, o.innerHTML = "");
930
+ }, l = (d) => {
931
+ d.preventDefault();
894
932
  const f = 12 * e.scaleVal, { dragged: h } = e;
895
933
  if (!h)
896
934
  return;
897
935
  const g = e.container.getBoundingClientRect();
898
- a.clientX < g.x + 50 ? i.move(1, 0) : a.clientX > g.x + g.width - 50 ? i.move(-1, 0) : a.clientY < g.y + 50 ? i.move(0, 1) : a.clientY > g.y + g.height - 50 ? i.move(0, -1) : i.stop(), ue(n);
899
- const d = he.elementFromPoint(a.clientX, a.clientY - f);
900
- if (Me(d, h)) {
901
- n = d;
902
- const c = d.getBoundingClientRect(), p = c.y;
903
- a.clientY > p + c.height ? t = "after" : t = "in";
936
+ d.clientX < g.x + 50 ? i.move(1, 0) : d.clientX > g.x + g.width - 50 ? i.move(-1, 0) : d.clientY < g.y + 50 ? i.move(0, 1) : d.clientY > g.y + g.height - 50 ? i.move(0, -1) : i.stop(), pe(n);
937
+ const u = fe.elementFromPoint(d.clientX, d.clientY - f);
938
+ if (Oe(u, h)) {
939
+ n = u;
940
+ const a = u.getBoundingClientRect(), p = a.y;
941
+ d.clientY > p + a.height ? t = "after" : t = "in";
904
942
  } else {
905
- const c = he.elementFromPoint(a.clientX, a.clientY + f), p = c.getBoundingClientRect();
906
- if (Me(c, h)) {
907
- n = c;
943
+ const a = fe.elementFromPoint(d.clientX, d.clientY + f), p = a.getBoundingClientRect();
944
+ if (Oe(a, h)) {
945
+ n = a;
908
946
  const m = p.y;
909
- a.clientY < m ? t = "before" : t = "in";
947
+ d.clientY < m ? t = "before" : t = "in";
910
948
  } else
911
949
  t = n = null;
912
950
  }
913
- n && At(n, t);
951
+ n && Mt(n, t);
914
952
  };
915
- return be([
953
+ return we([
916
954
  { dom: e.map, evt: "dragstart", func: s },
917
955
  { dom: e.map, evt: "dragend", func: r },
918
956
  { dom: e.map, evt: "dragover", func: l }
919
957
  ]);
920
958
  }
921
- const jt = function(e) {
959
+ const $t = function(e) {
922
960
  return ["createSummary", "removeSummary", "finishEditSummary"].includes(e.name) ? {
923
961
  type: "summary",
924
962
  value: e.obj.id
@@ -929,18 +967,18 @@ const jt = function(e) {
929
967
  type: "nodes",
930
968
  value: e.objs.map((t) => t.id)
931
969
  } : {
932
- type: "node",
933
- value: e.obj.id
970
+ type: "nodes",
971
+ value: [e.obj.id]
934
972
  };
935
973
  };
936
- function Pt(e) {
937
- let t = [], n = -1, o = e.getData();
974
+ function jt(e) {
975
+ let t = [], n = -1, o = e.getData(), i = [];
938
976
  e.undo = function() {
939
977
  if (n > -1) {
940
- const r = t[n];
941
- o = r.prev, e.refresh(r.prev);
978
+ const c = t[n];
979
+ o = c.prev, e.refresh(c.prev);
942
980
  try {
943
- r.currentObject.type === "node" ? e.selectNode(this.findEle(r.currentObject.value)) : r.currentObject.type === "nodes" && e.selectNodes(r.currentObject.value.map((l) => this.findEle(l)));
981
+ c.currentTarget.type === "nodes" && (c.operation === "removeNodes" ? e.selectNodes(c.currentTarget.value.map((d) => this.findEle(d))) : e.selectNodes(c.currentSelected.map((d) => this.findEle(d))));
944
982
  } catch {
945
983
  } finally {
946
984
  n--;
@@ -949,49 +987,61 @@ function Pt(e) {
949
987
  }, e.redo = function() {
950
988
  if (n < t.length - 1) {
951
989
  n++;
952
- const r = t[n];
953
- o = r.next, e.refresh(r.next), r.currentObject.type === "node" ? e.selectNode(this.findEle(r.currentObject.value)) : r.currentObject.type === "nodes" && (e.unselectNodes(this.currentNodes), e.selectNodes(r.currentObject.value.map((l) => this.findEle(l))));
990
+ const c = t[n];
991
+ o = c.next, e.refresh(c.next);
992
+ try {
993
+ c.currentTarget.type === "nodes" && (c.operation === "removeNodes" ? e.selectNodes(c.currentSelected.map((d) => this.findEle(d))) : e.selectNodes(c.currentTarget.value.map((d) => this.findEle(d))));
994
+ } catch {
995
+ }
954
996
  }
955
997
  };
956
- const i = function(r) {
957
- if (r.name === "beginEdit")
998
+ const s = function(c) {
999
+ if (c.name === "beginEdit")
958
1000
  return;
959
1001
  t = t.slice(0, n + 1);
960
- const l = e.getData();
961
- t.push({ prev: o, currentObject: jt(r), next: l }), o = l, n = t.length - 1;
962
- }, s = function(r) {
963
- (r.metaKey || r.ctrlKey) && (r.shiftKey && r.key === "Z" || r.key === "y") ? e.redo() : (r.metaKey || r.ctrlKey) && r.key === "z" && e.undo();
1002
+ const d = e.getData(), f = {
1003
+ prev: o,
1004
+ operation: c.name,
1005
+ currentSelected: i.map((h) => h.id),
1006
+ currentTarget: $t(c),
1007
+ next: d
1008
+ };
1009
+ t.push(f), o = d, n = t.length - 1;
1010
+ }, r = function(c) {
1011
+ (c.metaKey || c.ctrlKey) && (c.shiftKey && c.key === "Z" || c.key === "y") ? e.redo() : (c.metaKey || c.ctrlKey) && c.key === "z" && e.undo();
1012
+ }, l = function(c) {
1013
+ i = e.currentNodes.map((d) => d.nodeObj);
964
1014
  };
965
- return e.bus.addListener("operation", i), e.map.addEventListener("keydown", s), () => {
966
- e.bus.removeListener("operation", i), e.map.removeEventListener("keydown", s);
1015
+ return e.bus.addListener("operation", s), e.bus.addListener("selectNodes", l), e.container.addEventListener("keydown", r), () => {
1016
+ e.bus.removeListener("operation", s), e.bus.removeListener("selectNodes", l), e.container.removeEventListener("keydown", r);
967
1017
  };
968
1018
  }
969
- const $t = '<?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>', Ht = '<?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>', Bt = '<?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>', Rt = '<?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>', Ft = '<?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>', It = '<?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>', Wt = '<?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>';
970
- const Vt = {
971
- side: $t,
972
- left: Ht,
973
- right: Bt,
974
- full: Rt,
975
- living: Ft,
976
- zoomin: It,
977
- zoomout: Wt
1019
+ const Ht = '<?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>', Bt = '<?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>', Rt = '<?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>', Ft = '<?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>', It = '<?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>', Wt = '<?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>', Kt = '<?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>';
1020
+ const Yt = {
1021
+ side: Ht,
1022
+ left: Bt,
1023
+ right: Rt,
1024
+ full: Ft,
1025
+ living: It,
1026
+ zoomin: Wt,
1027
+ zoomout: Kt
978
1028
  }, I = (e, t) => {
979
1029
  const n = document.createElement("span");
980
- return n.id = e, n.innerHTML = Vt[t], n;
1030
+ return n.id = e, n.innerHTML = Yt[t], n;
981
1031
  };
982
- function Yt(e) {
1032
+ function Gt(e) {
983
1033
  const t = document.createElement("div"), n = I("fullscreen", "full"), o = I("toCenter", "living"), i = I("zoomout", "zoomout"), s = I("zoomin", "zoomin"), r = document.createElement("span");
984
1034
  return r.innerText = "100%", t.appendChild(n), t.appendChild(o), t.appendChild(i), t.appendChild(s), t.className = "mind-elixir-toolbar rb", n.onclick = () => {
985
1035
  document.fullscreenElement === e.el ? document.exitFullscreen() : e.el.requestFullscreen();
986
1036
  }, o.onclick = () => {
987
1037
  e.toCenter();
988
1038
  }, i.onclick = () => {
989
- e.scaleVal < 0.6 || e.scale(e.scaleVal - e.scaleSensitivity);
1039
+ e.scale(e.scaleVal - e.scaleSensitivity);
990
1040
  }, s.onclick = () => {
991
- e.scaleVal > 1.6 || e.scale(e.scaleVal + e.scaleSensitivity);
1041
+ e.scale(e.scaleVal + e.scaleSensitivity);
992
1042
  }, t;
993
1043
  }
994
- function Gt(e) {
1044
+ function Vt(e) {
995
1045
  const t = document.createElement("div"), n = I("tbltl", "left"), o = I("tbltr", "right"), i = I("tblts", "side");
996
1046
  return t.appendChild(n), t.appendChild(o), t.appendChild(i), t.className = "mind-elixir-toolbar lt", n.onclick = () => {
997
1047
  e.initLeft();
@@ -1001,11 +1051,11 @@ function Gt(e) {
1001
1051
  e.initSide();
1002
1052
  }, t;
1003
1053
  }
1004
- function Kt(e) {
1005
- e.container.append(Yt(e)), e.container.append(Gt(e));
1054
+ function qt(e) {
1055
+ e.container.append(Gt(e)), e.container.append(Vt(e));
1006
1056
  }
1007
1057
  /*! @viselect/vanilla v3.9.0 MIT | https://github.com/Simonwep/selection/tree/master/packages/vanilla */
1008
- class qt {
1058
+ class zt {
1009
1059
  constructor() {
1010
1060
  this._listeners = /* @__PURE__ */ new Map(), this.on = this.addEventListener, this.off = this.removeEventListener, this.emit = this.dispatchEvent;
1011
1061
  }
@@ -1027,16 +1077,16 @@ class qt {
1027
1077
  this._listeners.clear();
1028
1078
  }
1029
1079
  }
1030
- const De = (e, t = "px") => typeof e == "number" ? e + t : e, j = ({ style: e }, t, n) => {
1080
+ const Pe = (e, t = "px") => typeof e == "number" ? e + t : e, P = ({ style: e }, t, n) => {
1031
1081
  if (typeof t == "object")
1032
1082
  for (const [o, i] of Object.entries(t))
1033
- i !== void 0 && (e[o] = De(i));
1083
+ i !== void 0 && (e[o] = Pe(i));
1034
1084
  else
1035
- n !== void 0 && (e[t] = De(n));
1036
- }, Oe = (e = 0, t = 0, n = 0, o = 0) => {
1085
+ n !== void 0 && (e[t] = Pe(n));
1086
+ }, $e = (e = 0, t = 0, n = 0, o = 0) => {
1037
1087
  const i = { x: e, y: t, width: n, height: o, top: t, left: e, right: e + n, bottom: t + o };
1038
1088
  return { ...i, toJSON: () => JSON.stringify(i) };
1039
- }, zt = (e) => {
1089
+ }, Ut = (e) => {
1040
1090
  let t, n = -1, o = !1;
1041
1091
  return {
1042
1092
  next: (...i) => {
@@ -1059,19 +1109,19 @@ const De = (e, t = "px") => typeof e == "number" ? e + t : e, j = ({ style: e },
1059
1109
  case "touch":
1060
1110
  return e.right >= t.left && e.left <= t.right && e.bottom >= t.top && e.top <= t.bottom;
1061
1111
  }
1062
- }, Ut = () => matchMedia("(hover: none), (pointer: coarse)").matches, Xt = () => "safari" in window, fe = (e) => Array.isArray(e) ? e : [e], Xe = (e) => (t, n, o, i = {}) => {
1063
- (t instanceof HTMLCollection || t instanceof NodeList) && (t = Array.from(t)), n = fe(n), t = fe(t);
1112
+ }, Xt = () => matchMedia("(hover: none), (pointer: coarse)").matches, Jt = () => "safari" in window, ge = (e) => Array.isArray(e) ? e : [e], Je = (e) => (t, n, o, i = {}) => {
1113
+ (t instanceof HTMLCollection || t instanceof NodeList) && (t = Array.from(t)), n = ge(n), t = ge(t);
1064
1114
  for (const s of t)
1065
1115
  if (s)
1066
1116
  for (const r of n)
1067
1117
  s[e](r, o, { capture: !1, ...i });
1068
- }, P = Xe("addEventListener"), A = Xe("removeEventListener"), J = (e) => {
1118
+ }, $ = Je("addEventListener"), A = Je("removeEventListener"), Z = (e) => {
1069
1119
  var t;
1070
1120
  const { clientX: n, clientY: o, target: i } = ((t = e.touches) == null ? void 0 : t[0]) ?? e;
1071
1121
  return { x: n, y: o, target: i };
1072
- }, Y = (e, t = document) => fe(e).map(
1122
+ }, Y = (e, t = document) => ge(e).map(
1073
1123
  (n) => typeof n == "string" ? Array.from(t.querySelectorAll(n)) : n instanceof Element ? n : null
1074
- ).flat().filter(Boolean), Jt = (e, t) => t.some((n) => typeof n == "number" ? e.button === n : typeof n == "object" ? n.button !== e.button ? !1 : n.modifiers.every((o) => {
1124
+ ).flat().filter(Boolean), Zt = (e, t) => t.some((n) => typeof n == "number" ? e.button === n : typeof n == "object" ? n.button !== e.button ? !1 : n.modifiers.every((o) => {
1075
1125
  switch (o) {
1076
1126
  case "alt":
1077
1127
  return e.altKey;
@@ -1080,15 +1130,15 @@ const De = (e, t = "px") => typeof e == "number" ? e + t : e, j = ({ style: e },
1080
1130
  case "shift":
1081
1131
  return e.shiftKey;
1082
1132
  }
1083
- }) : !1), { abs: F, max: Pe, min: $e, ceil: He } = Math, Be = (e = []) => ({
1133
+ }) : !1), { abs: F, max: He, min: Be, ceil: Re } = Math, Fe = (e = []) => ({
1084
1134
  stored: e,
1085
1135
  selected: [],
1086
1136
  touched: [],
1087
1137
  changed: { added: [], removed: [] }
1088
- }), Je = class extends qt {
1138
+ }), Ze = class extends zt {
1089
1139
  constructor(t) {
1090
1140
  var n, o, i, s, r;
1091
- super(), this._selection = Be(), this._targetBoundaryScrolled = !0, this._selectables = [], this._areaLocation = { y1: 0, x2: 0, y2: 0, x1: 0 }, this._areaRect = Oe(), this._singleClick = !0, this._scrollAvailable = !0, this._scrollingActive = !1, this._scrollSpeed = { x: 0, y: 0 }, this._scrollDelta = { x: 0, y: 0 }, this._lastMousePosition = { x: 0, y: 0 }, this.enable = this._toggleStartEvents, this.disable = this._toggleStartEvents.bind(this, !1), this._options = {
1141
+ super(), this._selection = Fe(), this._targetBoundaryScrolled = !0, this._selectables = [], this._areaLocation = { y1: 0, x2: 0, y2: 0, x1: 0 }, this._areaRect = $e(), this._singleClick = !0, this._scrollAvailable = !0, this._scrollingActive = !1, this._scrollSpeed = { x: 0, y: 0 }, this._scrollDelta = { x: 0, y: 0 }, this._lastMousePosition = { x: 0, y: 0 }, this.enable = this._toggleStartEvents, this.disable = this._toggleStartEvents.bind(this, !1), this._options = {
1092
1142
  selectionAreaClass: "selection-area",
1093
1143
  selectionContainerClass: void 0,
1094
1144
  selectables: [],
@@ -1128,53 +1178,53 @@ const De = (e, t = "px") => typeof e == "number" ? e + t : e, j = ({ style: e },
1128
1178
  };
1129
1179
  for (const f of Object.getOwnPropertyNames(Object.getPrototypeOf(this)))
1130
1180
  typeof this[f] == "function" && (this[f] = this[f].bind(this));
1131
- const { document: l, selectionAreaClass: u, selectionContainerClass: a } = this._options;
1132
- this._area = l.createElement("div"), this._clippingElement = l.createElement("div"), this._clippingElement.appendChild(this._area), this._area.classList.add(u), a && this._clippingElement.classList.add(a), j(this._area, {
1181
+ const { document: l, selectionAreaClass: c, selectionContainerClass: d } = this._options;
1182
+ this._area = l.createElement("div"), this._clippingElement = l.createElement("div"), this._clippingElement.appendChild(this._area), this._area.classList.add(c), d && this._clippingElement.classList.add(d), P(this._area, {
1133
1183
  willChange: "top, left, bottom, right, width, height",
1134
1184
  top: 0,
1135
1185
  left: 0,
1136
1186
  position: "fixed"
1137
- }), j(this._clippingElement, {
1187
+ }), P(this._clippingElement, {
1138
1188
  overflow: "hidden",
1139
1189
  position: "fixed",
1140
1190
  transform: "translate3d(0, 0, 0)",
1141
1191
  // https://stackoverflow.com/a/38268846
1142
1192
  pointerEvents: "none",
1143
1193
  zIndex: "1"
1144
- }), this._frame = zt((f) => {
1194
+ }), this._frame = Ut((f) => {
1145
1195
  this._recalculateSelectionAreaRect(), this._updateElementSelection(), this._emitEvent("move", f), this._redrawSelectionArea();
1146
1196
  }), this.enable();
1147
1197
  }
1148
1198
  _toggleStartEvents(t = !0) {
1149
- const { document: n, features: o } = this._options, i = t ? P : A;
1199
+ const { document: n, features: o } = this._options, i = t ? $ : A;
1150
1200
  i(n, "mousedown", this._onTapStart), o.touch && i(n, "touchstart", this._onTapStart, { passive: !1 });
1151
1201
  }
1152
1202
  _onTapStart(t, n = !1) {
1153
- const { x: o, y: i, target: s } = J(t), { document: r, startAreas: l, boundaries: u, features: a, behaviour: f } = this._options, h = s.getBoundingClientRect();
1154
- if (t instanceof MouseEvent && !Jt(t, f.triggers))
1203
+ const { x: o, y: i, target: s } = Z(t), { document: r, startAreas: l, boundaries: c, features: d, behaviour: f } = this._options, h = s.getBoundingClientRect();
1204
+ if (t instanceof MouseEvent && !Zt(t, f.triggers))
1155
1205
  return;
1156
- const g = Y(l, r), d = Y(u, r);
1157
- this._targetElement = d.find(
1206
+ const g = Y(l, r), u = Y(c, r);
1207
+ this._targetElement = u.find(
1158
1208
  (v) => je(v.getBoundingClientRect(), h)
1159
1209
  );
1160
- const c = t.composedPath(), p = g.find((v) => c.includes(v));
1161
- if (this._targetBoundary = d.find((v) => c.includes(v)), !this._targetElement || !p || !this._targetBoundary || !n && this._emitEvent("beforestart", t) === !1)
1210
+ const a = t.composedPath(), p = g.find((v) => a.includes(v));
1211
+ if (this._targetBoundary = u.find((v) => a.includes(v)), !this._targetElement || !p || !this._targetBoundary || !n && this._emitEvent("beforestart", t) === !1)
1162
1212
  return;
1163
1213
  this._areaLocation = { x1: o, y1: i, x2: 0, y2: 0 };
1164
1214
  const m = r.scrollingElement ?? r.body;
1165
- this._scrollDelta = { x: m.scrollLeft, y: m.scrollTop }, this._singleClick = !0, this.clearSelection(!1, !0), P(r, ["touchmove", "mousemove"], this._delayedTapMove, { passive: !1 }), P(r, ["mouseup", "touchcancel", "touchend"], this._onTapStop), P(r, "scroll", this._onScroll), a.deselectOnBlur && (this._targetBoundaryScrolled = !1, P(this._targetBoundary, "scroll", this._onStartAreaScroll));
1215
+ this._scrollDelta = { x: m.scrollLeft, y: m.scrollTop }, this._singleClick = !0, this.clearSelection(!1, !0), $(r, ["touchmove", "mousemove"], this._delayedTapMove, { passive: !1 }), $(r, ["mouseup", "touchcancel", "touchend"], this._onTapStop), $(r, "scroll", this._onScroll), d.deselectOnBlur && (this._targetBoundaryScrolled = !1, $(this._targetBoundary, "scroll", this._onStartAreaScroll));
1166
1216
  }
1167
1217
  _onSingleTap(t) {
1168
- const { singleTap: { intersect: n }, range: o } = this._options.features, i = J(t);
1218
+ const { singleTap: { intersect: n }, range: o } = this._options.features, i = Z(t);
1169
1219
  let s;
1170
1220
  if (n === "native")
1171
1221
  s = i.target;
1172
1222
  else if (n === "touch") {
1173
1223
  this.resolveSelectables();
1174
- const { x: l, y: u } = i;
1175
- s = this._selectables.find((a) => {
1176
- const { right: f, left: h, top: g, bottom: d } = a.getBoundingClientRect();
1177
- return l < f && l > h && u < d && u > g;
1224
+ const { x: l, y: c } = i;
1225
+ s = this._selectables.find((d) => {
1226
+ const { right: f, left: h, top: g, bottom: u } = d.getBoundingClientRect();
1227
+ return l < f && l > h && c < u && c > g;
1178
1228
  });
1179
1229
  }
1180
1230
  if (!s)
@@ -1188,51 +1238,51 @@ const De = (e, t = "px") => typeof e == "number" ? e + t : e, j = ({ style: e },
1188
1238
  }
1189
1239
  const { stored: r } = this._selection;
1190
1240
  if (this._emitEvent("start", t), t.shiftKey && o && this._latestElement) {
1191
- const l = this._latestElement, [u, a] = l.compareDocumentPosition(s) & 4 ? [s, l] : [l, s], f = [...this._selectables.filter(
1192
- (h) => h.compareDocumentPosition(u) & 4 && h.compareDocumentPosition(a) & 2
1193
- ), u, a];
1241
+ const l = this._latestElement, [c, d] = l.compareDocumentPosition(s) & 4 ? [s, l] : [l, s], f = [...this._selectables.filter(
1242
+ (h) => h.compareDocumentPosition(c) & 4 && h.compareDocumentPosition(d) & 2
1243
+ ), c, d];
1194
1244
  this.select(f), this._latestElement = l;
1195
1245
  } else
1196
1246
  r.includes(s) && (r.length === 1 || t.ctrlKey || r.every((l) => this._selection.stored.includes(l))) ? this.deselect(s) : (this.select(s), this._latestElement = s);
1197
1247
  }
1198
1248
  _delayedTapMove(t) {
1199
- const { container: n, document: o, behaviour: { startThreshold: i } } = this._options, { x1: s, y1: r } = this._areaLocation, { x: l, y: u } = J(t);
1249
+ const { container: n, document: o, behaviour: { startThreshold: i } } = this._options, { x1: s, y1: r } = this._areaLocation, { x: l, y: c } = Z(t);
1200
1250
  if (
1201
1251
  // Single number for both coordinates
1202
- typeof i == "number" && F(l + u - (s + r)) >= i || // Different x and y threshold
1203
- typeof i == "object" && F(l - s) >= i.x || F(u - r) >= i.y
1252
+ typeof i == "number" && F(l + c - (s + r)) >= i || // Different x and y threshold
1253
+ typeof i == "object" && F(l - s) >= i.x || F(c - r) >= i.y
1204
1254
  ) {
1205
1255
  if (A(o, ["mousemove", "touchmove"], this._delayedTapMove, { passive: !1 }), this._emitEvent("beforedrag", t) === !1) {
1206
1256
  A(o, ["mouseup", "touchcancel", "touchend"], this._onTapStop);
1207
1257
  return;
1208
1258
  }
1209
- P(o, ["mousemove", "touchmove"], this._onTapMove, { passive: !1 }), j(this._area, "display", "block"), Y(n, o)[0].appendChild(this._clippingElement), this.resolveSelectables(), this._singleClick = !1, this._targetRect = this._targetElement.getBoundingClientRect(), this._scrollAvailable = this._targetElement.scrollHeight !== this._targetElement.clientHeight || this._targetElement.scrollWidth !== this._targetElement.clientWidth, this._scrollAvailable && (P(this._targetElement, "wheel", this._wheelScroll, { passive: !1 }), P(this._options.document, "keydown", this._keyboardScroll, { passive: !1 }), this._selectables = this._selectables.filter((a) => this._targetElement.contains(a))), this._setupSelectionArea(), this._emitEvent("start", t), this._onTapMove(t);
1259
+ $(o, ["mousemove", "touchmove"], this._onTapMove, { passive: !1 }), P(this._area, "display", "block"), Y(n, o)[0].appendChild(this._clippingElement), this.resolveSelectables(), this._singleClick = !1, this._targetRect = this._targetElement.getBoundingClientRect(), this._scrollAvailable = this._targetElement.scrollHeight !== this._targetElement.clientHeight || this._targetElement.scrollWidth !== this._targetElement.clientWidth, this._scrollAvailable && ($(this._targetElement, "wheel", this._wheelScroll, { passive: !1 }), $(this._options.document, "keydown", this._keyboardScroll, { passive: !1 }), this._selectables = this._selectables.filter((d) => this._targetElement.contains(d))), this._setupSelectionArea(), this._emitEvent("start", t), this._onTapMove(t);
1210
1260
  }
1211
1261
  this._handleMoveEvent(t);
1212
1262
  }
1213
1263
  _setupSelectionArea() {
1214
1264
  const { _clippingElement: t, _targetElement: n, _area: o } = this, i = this._targetRect = n.getBoundingClientRect();
1215
- this._scrollAvailable ? (j(t, {
1265
+ this._scrollAvailable ? (P(t, {
1216
1266
  top: i.top,
1217
1267
  left: i.left,
1218
1268
  width: i.width,
1219
1269
  height: i.height
1220
- }), j(o, {
1270
+ }), P(o, {
1221
1271
  marginTop: -i.top,
1222
1272
  marginLeft: -i.left
1223
- })) : (j(t, {
1273
+ })) : (P(t, {
1224
1274
  top: 0,
1225
1275
  left: 0,
1226
1276
  width: "100%",
1227
1277
  height: "100%"
1228
- }), j(o, {
1278
+ }), P(o, {
1229
1279
  marginTop: 0,
1230
1280
  marginLeft: 0
1231
1281
  }));
1232
1282
  }
1233
1283
  _onTapMove(t) {
1234
- const { _scrollSpeed: n, _areaLocation: o, _options: i, _frame: s } = this, { speedDivider: r } = i.behaviour.scrolling, l = this._targetElement, { x: u, y: a } = J(t);
1235
- if (o.x2 = u, o.y2 = a, this._lastMousePosition.x = u, this._lastMousePosition.y = a, this._scrollAvailable && !this._scrollingActive && (n.y || n.x)) {
1284
+ const { _scrollSpeed: n, _areaLocation: o, _options: i, _frame: s } = this, { speedDivider: r } = i.behaviour.scrolling, l = this._targetElement, { x: c, y: d } = Z(t);
1285
+ if (o.x2 = c, o.y2 = d, this._lastMousePosition.x = c, this._lastMousePosition.y = d, this._scrollAvailable && !this._scrollingActive && (n.y || n.x)) {
1236
1286
  this._scrollingActive = !0;
1237
1287
  const f = () => {
1238
1288
  if (!n.x && !n.y) {
@@ -1240,7 +1290,7 @@ const De = (e, t = "px") => typeof e == "number" ? e + t : e, j = ({ style: e },
1240
1290
  return;
1241
1291
  }
1242
1292
  const { scrollTop: h, scrollLeft: g } = l;
1243
- n.y && (l.scrollTop += He(n.y / r), o.y1 -= l.scrollTop - h), n.x && (l.scrollLeft += He(n.x / r), o.x1 -= l.scrollLeft - g), s.next(t), requestAnimationFrame(f);
1293
+ n.y && (l.scrollTop += Re(n.y / r), o.y1 -= l.scrollTop - h), n.x && (l.scrollLeft += Re(n.x / r), o.x1 -= l.scrollLeft - g), s.next(t), requestAnimationFrame(f);
1244
1294
  };
1245
1295
  requestAnimationFrame(f);
1246
1296
  } else
@@ -1249,7 +1299,7 @@ const De = (e, t = "px") => typeof e == "number" ? e + t : e, j = ({ style: e },
1249
1299
  }
1250
1300
  _handleMoveEvent(t) {
1251
1301
  const { features: n } = this._options;
1252
- (n.touch && Ut() || this._scrollAvailable && Xt()) && t.preventDefault();
1302
+ (n.touch && Xt() || this._scrollAvailable && Jt()) && t.preventDefault();
1253
1303
  }
1254
1304
  _onScroll() {
1255
1305
  const { _scrollDelta: t, _options: { document: n } } = this, { scrollTop: o, scrollLeft: i } = n.scrollingElement ?? n.body;
@@ -1272,12 +1322,12 @@ const De = (e, t = "px") => typeof e == "number" ? e + t : e, j = ({ style: e },
1272
1322
  });
1273
1323
  }
1274
1324
  _recalculateSelectionAreaRect() {
1275
- const { _scrollSpeed: t, _areaLocation: n, _targetElement: o, _options: i } = this, { scrollTop: s, scrollHeight: r, clientHeight: l, scrollLeft: u, scrollWidth: a, clientWidth: f } = o, h = this._targetRect, { x1: g, y1: d } = n;
1276
- let { x2: c, y2: p } = n;
1325
+ const { _scrollSpeed: t, _areaLocation: n, _targetElement: o, _options: i } = this, { scrollTop: s, scrollHeight: r, clientHeight: l, scrollLeft: c, scrollWidth: d, clientWidth: f } = o, h = this._targetRect, { x1: g, y1: u } = n;
1326
+ let { x2: a, y2: p } = n;
1277
1327
  const { behaviour: { scrolling: { startScrollMargins: m } } } = i;
1278
- c < h.left + m.x ? (t.x = u ? -F(h.left - c + m.x) : 0, c = c < h.left ? h.left : c) : c > h.right - m.x ? (t.x = a - u - f ? F(h.left + h.width - c - m.x) : 0, c = c > h.right ? h.right : c) : t.x = 0, p < h.top + m.y ? (t.y = s ? -F(h.top - p + m.y) : 0, p = p < h.top ? h.top : p) : p > h.bottom - m.y ? (t.y = r - s - l ? F(h.top + h.height - p - m.y) : 0, p = p > h.bottom ? h.bottom : p) : t.y = 0;
1279
- const v = $e(g, c), b = $e(d, p), w = Pe(g, c), E = Pe(d, p);
1280
- this._areaRect = Oe(v, b, w - v, E - b);
1328
+ a < h.left + m.x ? (t.x = c ? -F(h.left - a + m.x) : 0, a = a < h.left ? h.left : a) : a > h.right - m.x ? (t.x = d - c - f ? F(h.left + h.width - a - m.x) : 0, a = a > h.right ? h.right : a) : t.x = 0, p < h.top + m.y ? (t.y = s ? -F(h.top - p + m.y) : 0, p = p < h.top ? h.top : p) : p > h.bottom - m.y ? (t.y = r - s - l ? F(h.top + h.height - p - m.y) : 0, p = p > h.bottom ? h.bottom : p) : t.y = 0;
1329
+ const v = Be(g, a), b = Be(u, p), x = He(g, a), S = He(u, p);
1330
+ this._areaRect = $e(v, b, x - v, S - b);
1281
1331
  }
1282
1332
  _redrawSelectionArea() {
1283
1333
  const { x: t, y: n, width: o, height: i } = this._areaRect, { style: s } = this._area;
@@ -1286,17 +1336,17 @@ const De = (e, t = "px") => typeof e == "number" ? e + t : e, j = ({ style: e },
1286
1336
  _onTapStop(t, n) {
1287
1337
  var o;
1288
1338
  const { document: i, features: s } = this._options, { _singleClick: r } = this;
1289
- A(this._targetElement, "scroll", this._onStartAreaScroll), A(i, ["mousemove", "touchmove"], this._delayedTapMove), A(i, ["touchmove", "mousemove"], this._onTapMove), A(i, ["mouseup", "touchcancel", "touchend"], this._onTapStop), A(i, "scroll", this._onScroll), this._keepSelection(), t && r && s.singleTap.allow ? this._onSingleTap(t) : !r && !n && (this._updateElementSelection(), this._emitEvent("stop", t)), this._scrollSpeed.x = 0, this._scrollSpeed.y = 0, A(this._targetElement, "wheel", this._wheelScroll, { passive: !0 }), A(this._options.document, "keydown", this._keyboardScroll, { passive: !0 }), this._clippingElement.remove(), (o = this._frame) == null || o.cancel(), j(this._area, "display", "none");
1339
+ A(this._targetElement, "scroll", this._onStartAreaScroll), A(i, ["mousemove", "touchmove"], this._delayedTapMove), A(i, ["touchmove", "mousemove"], this._onTapMove), A(i, ["mouseup", "touchcancel", "touchend"], this._onTapStop), A(i, "scroll", this._onScroll), this._keepSelection(), t && r && s.singleTap.allow ? this._onSingleTap(t) : !r && !n && (this._updateElementSelection(), this._emitEvent("stop", t)), this._scrollSpeed.x = 0, this._scrollSpeed.y = 0, A(this._targetElement, "wheel", this._wheelScroll, { passive: !0 }), A(this._options.document, "keydown", this._keyboardScroll, { passive: !0 }), this._clippingElement.remove(), (o = this._frame) == null || o.cancel(), P(this._area, "display", "none");
1290
1340
  }
1291
1341
  _updateElementSelection() {
1292
- const { _selectables: t, _options: n, _selection: o, _areaRect: i } = this, { stored: s, selected: r, touched: l } = o, { intersect: u, overlap: a } = n.behaviour, f = a === "invert", h = [], g = [], d = [];
1342
+ const { _selectables: t, _options: n, _selection: o, _areaRect: i } = this, { stored: s, selected: r, touched: l } = o, { intersect: c, overlap: d } = n.behaviour, f = d === "invert", h = [], g = [], u = [];
1293
1343
  for (let p = 0; p < t.length; p++) {
1294
1344
  const m = t[p];
1295
- if (je(i, m.getBoundingClientRect(), u)) {
1345
+ if (je(i, m.getBoundingClientRect(), c)) {
1296
1346
  if (r.includes(m))
1297
1347
  s.includes(m) && !l.includes(m) && l.push(m);
1298
1348
  else if (f && s.includes(m)) {
1299
- d.push(m);
1349
+ u.push(m);
1300
1350
  continue;
1301
1351
  } else
1302
1352
  g.push(m);
@@ -1304,14 +1354,14 @@ const De = (e, t = "px") => typeof e == "number" ? e + t : e, j = ({ style: e },
1304
1354
  }
1305
1355
  }
1306
1356
  f && g.push(...s.filter((p) => !r.includes(p)));
1307
- const c = a === "keep";
1357
+ const a = d === "keep";
1308
1358
  for (let p = 0; p < r.length; p++) {
1309
1359
  const m = r[p];
1310
1360
  !h.includes(m) && !// Check if the user wants to keep previously selected elements, e.g.,
1311
1361
  // not make them part of the current selection as soon as they're touched.
1312
- (c && s.includes(m)) && d.push(m);
1362
+ (a && s.includes(m)) && u.push(m);
1313
1363
  }
1314
- o.selected = h, o.changed = { added: g, removed: d }, this._latestElement = void 0;
1364
+ o.selected = h, o.changed = { added: g, removed: u }, this._latestElement = void 0;
1315
1365
  }
1316
1366
  _emitEvent(t, n) {
1317
1367
  return this.emit(t, {
@@ -1321,12 +1371,12 @@ const De = (e, t = "px") => typeof e == "number" ? e + t : e, j = ({ style: e },
1321
1371
  });
1322
1372
  }
1323
1373
  _keepSelection() {
1324
- const { _options: t, _selection: n } = this, { selected: o, changed: i, touched: s, stored: r } = n, l = o.filter((u) => !r.includes(u));
1374
+ const { _options: t, _selection: n } = this, { selected: o, changed: i, touched: s, stored: r } = n, l = o.filter((c) => !r.includes(c));
1325
1375
  switch (t.behaviour.overlap) {
1326
1376
  case "drop": {
1327
1377
  n.stored = [
1328
1378
  ...l,
1329
- ...r.filter((u) => !s.includes(u))
1379
+ ...r.filter((c) => !s.includes(c))
1330
1380
  // Elements not touched
1331
1381
  ];
1332
1382
  break;
@@ -1334,7 +1384,7 @@ const De = (e, t = "px") => typeof e == "number" ? e + t : e, j = ({ style: e },
1334
1384
  case "invert": {
1335
1385
  n.stored = [
1336
1386
  ...l,
1337
- ...r.filter((u) => !i.removed.includes(u))
1387
+ ...r.filter((c) => !i.removed.includes(c))
1338
1388
  // Elements not removed from selection
1339
1389
  ];
1340
1390
  break;
@@ -1342,7 +1392,7 @@ const De = (e, t = "px") => typeof e == "number" ? e + t : e, j = ({ style: e },
1342
1392
  case "keep": {
1343
1393
  n.stored = [
1344
1394
  ...r,
1345
- ...o.filter((u) => !r.includes(u))
1395
+ ...o.filter((c) => !r.includes(c))
1346
1396
  // Newly added
1347
1397
  ];
1348
1398
  break;
@@ -1374,7 +1424,7 @@ const De = (e, t = "px") => typeof e == "number" ? e + t : e, j = ({ style: e },
1374
1424
  s.added = [], s.removed.push(
1375
1425
  ...o,
1376
1426
  ...t ? i : []
1377
- ), n || (this._emitEvent("move", null), this._emitEvent("stop", null)), this._selection = Be(t ? [] : i);
1427
+ ), n || (this._emitEvent("move", null), this._emitEvent("stop", null)), this._selection = Fe(t ? [] : i);
1378
1428
  }
1379
1429
  /**
1380
1430
  * @returns {Array} Selected elements
@@ -1445,10 +1495,10 @@ const De = (e, t = "px") => typeof e == "number" ? e + t : e, j = ({ style: e },
1445
1495
  ), this._latestElement = void 0, n || (this._emitEvent("move", null), this._emitEvent("stop", null));
1446
1496
  }
1447
1497
  };
1448
- Je.version = "3.9.0";
1449
- let Zt = Je;
1450
- function Qt(e) {
1451
- const t = e.mouseSelectionButton === 2 ? [2] : [0], n = new Zt({
1498
+ Ze.version = "3.9.0";
1499
+ let Qt = Ze;
1500
+ function en(e) {
1501
+ const t = e.mouseSelectionButton === 2 ? [2] : [0], n = new Qt({
1452
1502
  selectables: [".map-container me-tpc"],
1453
1503
  boundaries: [e.container],
1454
1504
  container: e.selectionContainer,
@@ -1511,10 +1561,10 @@ function Qt(e) {
1511
1561
  );
1512
1562
  e.selection = n;
1513
1563
  }
1514
- const en = function(e, t = !0) {
1564
+ const tn = function(e, t = !0) {
1515
1565
  this.theme = e;
1516
1566
  const o = {
1517
- ...(e.type === "dark" ? ge : pe).cssVar,
1567
+ ...(e.type === "dark" ? ve : me).cssVar,
1518
1568
  ...e.cssVar
1519
1569
  }, i = Object.keys(o);
1520
1570
  for (let s = 0; s < i.length; s++) {
@@ -1522,50 +1572,50 @@ const en = function(e, t = !0) {
1522
1572
  this.container.style.setProperty(r, o[r]);
1523
1573
  }
1524
1574
  t && this.refresh();
1525
- }, K = (e) => {
1575
+ }, q = (e) => {
1526
1576
  var o;
1527
1577
  const t = (o = e.parent) == null ? void 0 : o.children, n = (t == null ? void 0 : t.indexOf(e)) ?? 0;
1528
1578
  return { siblings: t, index: n };
1529
1579
  };
1530
- function tn(e) {
1531
- const { siblings: t, index: n } = K(e);
1580
+ function nn(e) {
1581
+ const { siblings: t, index: n } = q(e);
1532
1582
  if (t === void 0)
1533
1583
  return;
1534
1584
  const o = t[n];
1535
1585
  n === 0 ? (t[n] = t[t.length - 1], t[t.length - 1] = o) : (t[n] = t[n - 1], t[n - 1] = o);
1536
1586
  }
1537
- function nn(e) {
1538
- const { siblings: t, index: n } = K(e);
1587
+ function on(e) {
1588
+ const { siblings: t, index: n } = q(e);
1539
1589
  if (t === void 0)
1540
1590
  return;
1541
1591
  const o = t[n];
1542
1592
  n === t.length - 1 ? (t[n] = t[0], t[0] = o) : (t[n] = t[n + 1], t[n + 1] = o);
1543
1593
  }
1544
- function Ze(e) {
1545
- const { siblings: t, index: n } = K(e);
1594
+ function Qe(e) {
1595
+ const { siblings: t, index: n } = q(e);
1546
1596
  return t === void 0 ? 0 : (t.splice(n, 1), t.length);
1547
1597
  }
1548
- function on(e, t, n) {
1549
- const { siblings: o, index: i } = K(n);
1598
+ function sn(e, t, n) {
1599
+ const { siblings: o, index: i } = q(n);
1550
1600
  o !== void 0 && (t === "before" ? o.splice(i, 0, e) : o.splice(i + 1, 0, e));
1551
1601
  }
1552
- function sn(e, t) {
1553
- const { siblings: n, index: o } = K(e);
1602
+ function rn(e, t) {
1603
+ const { siblings: n, index: o } = q(e);
1554
1604
  n !== void 0 && (n[o] = t, t.children = [e]);
1555
1605
  }
1556
- function Qe(e, t, n) {
1606
+ function et(e, t, n) {
1557
1607
  var o;
1558
- if (Ze(t), (o = n.parent) != null && o.parent || (t.direction = n.direction), e === "in")
1608
+ if (Qe(t), (o = n.parent) != null && o.parent || (t.direction = n.direction), e === "in")
1559
1609
  n.children ? n.children.push(t) : n.children = [t];
1560
1610
  else {
1561
1611
  t.direction !== void 0 && (t.direction = n.direction);
1562
- const { siblings: i, index: s } = K(n);
1612
+ const { siblings: i, index: s } = q(n);
1563
1613
  if (i === void 0)
1564
1614
  return;
1565
1615
  e === "before" ? i.splice(s, 0, t) : i.splice(s + 1, 0, t);
1566
1616
  }
1567
1617
  }
1568
- const rn = function({ map: e, direction: t }, n) {
1618
+ const ln = function({ map: e, direction: t }, n) {
1569
1619
  var o, i;
1570
1620
  if (t === 0)
1571
1621
  return 0;
@@ -1575,58 +1625,58 @@ const rn = function({ map: e, direction: t }, n) {
1575
1625
  const s = ((o = e.querySelector(".lhs")) == null ? void 0 : o.childElementCount) || 0, r = ((i = e.querySelector(".rhs")) == null ? void 0 : i.childElementCount) || 0;
1576
1626
  return s <= r ? (n.direction = 0, 0) : (n.direction = 1, 1);
1577
1627
  }
1578
- }, et = function(e, t, n) {
1628
+ }, tt = function(e, t, n) {
1579
1629
  var s, r;
1580
1630
  const o = n.children[0].children[0], i = t.parentElement;
1581
1631
  if (i.tagName === "ME-PARENT") {
1582
- if (X(o), i.children[1])
1632
+ if (J(o), i.children[1])
1583
1633
  i.nextSibling.appendChild(n);
1584
1634
  else {
1585
1635
  const l = e.createChildren([n]);
1586
- i.appendChild(we(!0)), i.insertAdjacentElement("afterend", l);
1636
+ i.appendChild(Ee(!0)), i.insertAdjacentElement("afterend", l);
1587
1637
  }
1588
1638
  e.linkDiv(n.offsetParent);
1589
1639
  } else
1590
- i.tagName === "ME-ROOT" && (rn(e, o.nodeObj) === 0 ? (s = e.container.querySelector(".lhs")) == null || s.appendChild(n) : (r = e.container.querySelector(".rhs")) == null || r.appendChild(n), e.linkDiv());
1591
- }, ln = function(e, t) {
1640
+ i.tagName === "ME-ROOT" && (ln(e, o.nodeObj) === 0 ? (s = e.container.querySelector(".lhs")) == null || s.appendChild(n) : (r = e.container.querySelector(".rhs")) == null || r.appendChild(n), e.linkDiv());
1641
+ }, cn = function(e, t) {
1592
1642
  const n = e.parentNode;
1593
1643
  if (t === 0) {
1594
1644
  const o = n.parentNode.parentNode;
1595
1645
  o.tagName !== "ME-MAIN" && (o.previousSibling.children[1].remove(), o.remove());
1596
1646
  }
1597
1647
  n.parentNode.remove();
1598
- }, tt = {
1648
+ }, nt = {
1599
1649
  before: "beforebegin",
1600
1650
  after: "afterend"
1601
- }, X = function(e) {
1651
+ }, J = function(e) {
1602
1652
  const n = e.parentElement.parentElement.lastElementChild;
1603
1653
  (n == null ? void 0 : n.tagName) === "svg" && (n == null || n.remove());
1604
- }, cn = function(e, t) {
1605
- const n = e.nodeObj, o = ve(n);
1654
+ }, an = function(e, t) {
1655
+ const n = e.nodeObj, o = ye(n);
1606
1656
  o.style && t.style && (t.style = Object.assign(o.style, t.style));
1607
1657
  const i = Object.assign(n, t);
1608
- ye(e, i), this.linkDiv(), this.bus.fire("operation", {
1658
+ xe(e, i), this.linkDiv(), this.bus.fire("operation", {
1609
1659
  name: "reshapeNode",
1610
1660
  obj: i,
1611
1661
  origin: o
1612
1662
  });
1613
- }, xe = function(e, t, n) {
1663
+ }, Ce = function(e, t, n) {
1614
1664
  if (!t)
1615
1665
  return null;
1616
1666
  const o = t.nodeObj;
1617
1667
  o.expanded === !1 && (e.expandNode(t, !0), t = e.findEle(o.id));
1618
1668
  const i = n || e.generateNewObj();
1619
- o.children ? o.children.push(i) : o.children = [i], $(e.nodeData);
1669
+ o.children ? o.children.push(i) : o.children = [i], j(e.nodeData);
1620
1670
  const { grp: s, top: r } = e.createWrapper(i);
1621
- return et(e, t, s), { newTop: r, newNodeObj: i };
1622
- }, an = function(e, t, n) {
1623
- var a, f, h, g;
1671
+ return tt(e, t, s), { newTop: r, newNodeObj: i };
1672
+ }, dn = function(e, t, n) {
1673
+ var d, f, h, g;
1624
1674
  const o = t || this.currentNode;
1625
1675
  if (!o)
1626
1676
  return;
1627
1677
  const i = o.nodeObj;
1628
1678
  if (i.parent) {
1629
- if (!((a = i.parent) != null && a.parent) && ((h = (f = i.parent) == null ? void 0 : f.children) == null ? void 0 : h.length) === 1 && this.direction === 2) {
1679
+ if (!((d = i.parent) != null && d.parent) && ((h = (f = i.parent) == null ? void 0 : f.children) == null ? void 0 : h.length) === 1 && this.direction === 2) {
1630
1680
  this.addChild(this.findEle(i.parent.id), n);
1631
1681
  return;
1632
1682
  }
@@ -1636,38 +1686,38 @@ const rn = function({ map: e, direction: t }, n) {
1636
1686
  }
1637
1687
  const s = n || this.generateNewObj();
1638
1688
  if (!((g = i.parent) != null && g.parent)) {
1639
- const d = o.closest("me-main").className === M.LHS ? 0 : 1;
1640
- s.direction = d;
1689
+ const u = o.closest("me-main").className === M.LHS ? 0 : 1;
1690
+ s.direction = u;
1641
1691
  }
1642
- on(s, e, i), $(this.nodeData);
1643
- const r = o.parentElement, { grp: l, top: u } = this.createWrapper(s);
1644
- r.parentElement.insertAdjacentElement(tt[e], l), this.linkDiv(l.offsetParent), n || this.editTopic(u.firstChild), this.selectNode(u.firstChild, !0), this.bus.fire("operation", {
1692
+ sn(s, e, i), j(this.nodeData);
1693
+ const r = o.parentElement, { grp: l, top: c } = this.createWrapper(s);
1694
+ r.parentElement.insertAdjacentElement(nt[e], l), this.linkDiv(l.offsetParent), n || this.editTopic(c.firstChild), this.bus.fire("operation", {
1645
1695
  name: "insertSibling",
1646
1696
  type: e,
1647
1697
  obj: s
1648
- });
1649
- }, dn = function(e, t) {
1698
+ }), this.selectNode(c.firstChild, !0);
1699
+ }, hn = function(e, t) {
1650
1700
  const n = e || this.currentNode;
1651
1701
  if (!n)
1652
1702
  return;
1653
- X(n);
1703
+ J(n);
1654
1704
  const o = n.nodeObj;
1655
1705
  if (!o.parent)
1656
1706
  return;
1657
1707
  const i = t || this.generateNewObj();
1658
- sn(o, i), $(this.nodeData);
1708
+ rn(o, i), j(this.nodeData);
1659
1709
  const s = n.parentElement.parentElement, { grp: r, top: l } = this.createWrapper(i, !0);
1660
- l.appendChild(we(!0)), s.insertAdjacentElement("afterend", r);
1661
- const u = this.createChildren([s]);
1662
- l.insertAdjacentElement("afterend", u), this.linkDiv(), t || this.editTopic(l.firstChild), this.selectNode(l.firstChild, !0), this.bus.fire("operation", {
1710
+ l.appendChild(Ee(!0)), s.insertAdjacentElement("afterend", r);
1711
+ const c = this.createChildren([s]);
1712
+ l.insertAdjacentElement("afterend", c), this.linkDiv(), t || this.editTopic(l.firstChild), this.selectNode(l.firstChild, !0), this.bus.fire("operation", {
1663
1713
  name: "insertParent",
1664
1714
  obj: i
1665
1715
  });
1666
- }, hn = function(e, t) {
1716
+ }, un = function(e, t) {
1667
1717
  const n = e || this.currentNode;
1668
1718
  if (!n)
1669
1719
  return;
1670
- const o = xe(this, n, t);
1720
+ const o = Ce(this, n, t);
1671
1721
  if (!o)
1672
1722
  return;
1673
1723
  const { newTop: i, newNodeObj: s } = o;
@@ -1675,10 +1725,10 @@ const rn = function({ map: e, direction: t }, n) {
1675
1725
  name: "addChild",
1676
1726
  obj: s
1677
1727
  }), t || this.editTopic(i.firstChild), this.selectNode(i.firstChild, !0);
1678
- }, un = function(e, t) {
1679
- const n = ve(e.nodeObj);
1680
- me(n);
1681
- const o = xe(this, t, n);
1728
+ }, fn = function(e, t) {
1729
+ const n = ye(e.nodeObj);
1730
+ be(n);
1731
+ const o = Ce(this, t, n);
1682
1732
  if (!o)
1683
1733
  return;
1684
1734
  const { newNodeObj: i } = o;
@@ -1686,13 +1736,13 @@ const rn = function({ map: e, direction: t }, n) {
1686
1736
  name: "copyNode",
1687
1737
  obj: i
1688
1738
  });
1689
- }, fn = function(e, t) {
1690
- e = le(e);
1739
+ }, pn = function(e, t) {
1740
+ e = ce(e);
1691
1741
  const n = [];
1692
1742
  for (let o = 0; o < e.length; o++) {
1693
- const i = e[o], s = ve(i.nodeObj);
1694
- me(s);
1695
- const r = xe(this, t, s);
1743
+ const i = e[o], s = ye(i.nodeObj);
1744
+ be(s);
1745
+ const r = Ce(this, t, s);
1696
1746
  if (!r)
1697
1747
  return;
1698
1748
  const { newNodeObj: l } = r;
@@ -1702,64 +1752,64 @@ const rn = function({ map: e, direction: t }, n) {
1702
1752
  name: "copyNodes",
1703
1753
  objs: n
1704
1754
  });
1705
- }, pn = function(e) {
1755
+ }, gn = function(e) {
1706
1756
  const t = e || this.currentNode;
1707
1757
  if (!t)
1708
1758
  return;
1709
1759
  const n = t.nodeObj;
1710
- tn(n);
1760
+ nn(n);
1711
1761
  const o = t.parentNode.parentNode;
1712
1762
  o.parentNode.insertBefore(o, o.previousSibling), this.linkDiv(), this.bus.fire("operation", {
1713
1763
  name: "moveUpNode",
1714
1764
  obj: n
1715
1765
  });
1716
- }, gn = function(e) {
1766
+ }, mn = function(e) {
1717
1767
  const t = e || this.currentNode;
1718
1768
  if (!t)
1719
1769
  return;
1720
1770
  const n = t.nodeObj;
1721
- nn(n);
1771
+ on(n);
1722
1772
  const o = t.parentNode.parentNode;
1723
1773
  o.nextSibling ? o.nextSibling.insertAdjacentElement("afterend", o) : o.parentNode.prepend(o), this.linkDiv(), this.bus.fire("operation", {
1724
1774
  name: "moveDownNode",
1725
1775
  obj: n
1726
1776
  });
1727
- }, mn = function(e) {
1777
+ }, vn = function(e) {
1728
1778
  if (e.length === 0)
1729
1779
  return;
1730
- e = le(e);
1780
+ e = ce(e);
1731
1781
  for (const n of e) {
1732
- const o = n.nodeObj, i = Ze(o);
1733
- ln(n, i);
1782
+ const o = n.nodeObj, i = Qe(o);
1783
+ cn(n, i);
1734
1784
  }
1735
1785
  const t = e[e.length - 1];
1736
1786
  this.selectNode(this.findEle(t.nodeObj.parent.id)), this.linkDiv(), this.bus.fire("operation", {
1737
1787
  name: "removeNodes",
1738
1788
  objs: e.map((n) => n.nodeObj)
1739
1789
  });
1740
- }, vn = function(e, t) {
1741
- e = le(e);
1790
+ }, bn = function(e, t) {
1791
+ e = ce(e);
1742
1792
  const n = t.nodeObj;
1743
1793
  n.expanded === !1 && (this.expandNode(t, !0), t = this.findEle(n.id));
1744
1794
  for (const o of e) {
1745
1795
  const i = o.nodeObj;
1746
- Qe("in", i, n), $(this.nodeData);
1796
+ et("in", i, n), j(this.nodeData);
1747
1797
  const s = o.parentElement;
1748
- et(this, t, s.parentElement);
1798
+ tt(this, t, s.parentElement);
1749
1799
  }
1750
1800
  this.linkDiv(), this.bus.fire("operation", {
1751
1801
  name: "moveNodeIn",
1752
1802
  objs: e.map((o) => o.nodeObj),
1753
1803
  toObj: n
1754
1804
  });
1755
- }, nt = (e, t, n, o) => {
1756
- e = le(e), t === "after" && (e = e.reverse());
1805
+ }, ot = (e, t, n, o) => {
1806
+ e = ce(e), t === "after" && (e = e.reverse());
1757
1807
  const i = n.nodeObj, s = [];
1758
1808
  for (const r of e) {
1759
1809
  const l = r.nodeObj;
1760
- Qe(t, l, i), $(o.nodeData), X(r);
1761
- const u = r.parentElement.parentNode;
1762
- s.includes(u.parentElement) || s.push(u.parentElement), n.parentElement.parentNode.insertAdjacentElement(tt[t], u);
1810
+ et(t, l, i), j(o.nodeData), J(r);
1811
+ const c = r.parentElement.parentNode;
1812
+ s.includes(c.parentElement) || s.push(c.parentElement), n.parentElement.parentNode.insertAdjacentElement(nt[t], c);
1763
1813
  }
1764
1814
  for (const r of s)
1765
1815
  r.childElementCount === 0 && r.tagName !== "ME-MAIN" && (r.previousSibling.children[1].remove(), r.remove());
@@ -1768,34 +1818,34 @@ const rn = function({ map: e, direction: t }, n) {
1768
1818
  objs: e.map((r) => r.nodeObj),
1769
1819
  toObj: i
1770
1820
  });
1771
- }, bn = function(e, t) {
1772
- nt(e, "before", t, this);
1773
1821
  }, yn = function(e, t) {
1774
- nt(e, "after", t, this);
1775
- }, wn = function(e) {
1822
+ ot(e, "before", t, this);
1823
+ }, wn = function(e, t) {
1824
+ ot(e, "after", t, this);
1825
+ }, xn = function(e) {
1776
1826
  const t = e || this.currentNode;
1777
1827
  t && (t.nodeObj.dangerouslySetInnerHTML || this.editTopic(t));
1778
- }, xn = function(e, t) {
1828
+ }, En = function(e, t) {
1779
1829
  e.text.textContent = t, e.nodeObj.topic = t, this.linkDiv();
1780
- }, ot = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
1830
+ }, it = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
1781
1831
  __proto__: null,
1782
- addChild: hn,
1783
- beginEdit: wn,
1784
- copyNode: un,
1785
- copyNodes: fn,
1786
- insertParent: dn,
1787
- insertSibling: an,
1788
- moveDownNode: gn,
1789
- moveNodeAfter: yn,
1790
- moveNodeBefore: bn,
1791
- moveNodeIn: vn,
1792
- moveUpNode: pn,
1793
- removeNodes: mn,
1794
- reshapeNode: cn,
1795
- rmSubline: X,
1796
- setNodeTopic: xn
1832
+ addChild: un,
1833
+ beginEdit: xn,
1834
+ copyNode: fn,
1835
+ copyNodes: pn,
1836
+ insertParent: hn,
1837
+ insertSibling: dn,
1838
+ moveDownNode: mn,
1839
+ moveNodeAfter: wn,
1840
+ moveNodeBefore: yn,
1841
+ moveNodeIn: bn,
1842
+ moveUpNode: gn,
1843
+ removeNodes: vn,
1844
+ reshapeNode: an,
1845
+ rmSubline: J,
1846
+ setNodeTopic: En
1797
1847
  }, Symbol.toStringTag, { value: "Module" }));
1798
- function En(e) {
1848
+ function Cn(e) {
1799
1849
  return {
1800
1850
  nodeData: e.isFocusMode ? e.nodeDataBackup : e.nodeData,
1801
1851
  arrows: e.arrows,
@@ -1804,112 +1854,110 @@ function En(e) {
1804
1854
  theme: e.theme
1805
1855
  };
1806
1856
  }
1807
- const Cn = function(e) {
1857
+ const Sn = function(e) {
1808
1858
  const t = this.container, n = e.getBoundingClientRect(), o = t.getBoundingClientRect();
1809
1859
  if (n.top > o.bottom || n.bottom < o.top || n.left > o.right || n.right < o.left) {
1810
- const s = n.left + n.width / 2, r = n.top + n.height / 2, l = o.left + o.width / 2, u = o.top + o.height / 2, a = s - l, f = r - u;
1811
- this.move(-a, -f);
1860
+ const s = n.left + n.width / 2, r = n.top + n.height / 2, l = o.left + o.width / 2, c = o.top + o.height / 2, d = s - l, f = r - c;
1861
+ this.move(-d, -f);
1812
1862
  }
1813
- }, Sn = function(e, t, n) {
1863
+ }, Nn = function(e, t, n) {
1814
1864
  this.clearSelection(), this.scrollIntoView(e), this.selection.select(e), t && this.bus.fire("selectNewNode", e.nodeObj);
1815
- }, Nn = function(e) {
1816
- this.selection.select(e);
1817
1865
  }, kn = function(e) {
1866
+ this.selection.select(e);
1867
+ }, _n = function(e) {
1818
1868
  this.selection.deselect(e);
1819
- }, _n = function() {
1820
- this.unselectNodes(this.currentNodes), this.unselectSummary(), this.unselectArrow();
1821
1869
  }, Tn = function() {
1822
- const e = En(this);
1870
+ this.unselectNodes(this.currentNodes), this.unselectSummary(), this.unselectArrow();
1871
+ }, Ln = function() {
1872
+ const e = Cn(this);
1823
1873
  return JSON.stringify(e, (t, n) => {
1824
1874
  if (!(t === "parent" && typeof n != "string"))
1825
1875
  return n;
1826
1876
  });
1827
- }, Ln = function() {
1828
- return JSON.parse(this.getDataString());
1829
1877
  }, An = function() {
1830
- this.editable = !0;
1878
+ return JSON.parse(this.getDataString());
1831
1879
  }, Mn = function() {
1880
+ this.editable = !0;
1881
+ }, Dn = function() {
1832
1882
  this.editable = !1;
1833
- }, Dn = function(e, t = { x: 0, y: 0 }) {
1834
- const n = this.container.getBoundingClientRect(), o = t.x ? t.x - n.left - n.width / 2 : 0, i = t.y ? t.y - n.top - n.height / 2 : 0, { dx: s, dy: r } = it(this), l = this.map.style.transform, { x: u, y: a } = Ye(l), f = u - s, h = a - r, g = this.scaleVal, d = (-o + f) * (1 - e / g), c = (-i + h) * (1 - e / g);
1835
- this.map.style.transform = `translate(${u - d}px, ${a - c}px) scale(${e})`, this.scaleVal = e, this.bus.fire("scale", e);
1836
- }, On = function() {
1883
+ }, On = function(e, t = { x: 0, y: 0 }) {
1884
+ if (e < this.scaleMin || e > this.scaleMax)
1885
+ return;
1886
+ const n = this.container.getBoundingClientRect(), o = t.x ? t.x - n.left - n.width / 2 : 0, i = t.y ? t.y - n.top - n.height / 2 : 0, { dx: s, dy: r } = st(this), l = this.map.style.transform, { x: c, y: d } = Ge(l), f = c - s, h = d - r, g = this.scaleVal, u = (-o + f) * (1 - e / g), a = (-i + h) * (1 - e / g);
1887
+ this.map.style.transform = `translate(${c - u}px, ${d - a}px) scale(${e})`, this.scaleVal = e, this.bus.fire("scale", e);
1888
+ }, Pn = function() {
1837
1889
  const e = this.nodes.offsetHeight / this.container.offsetHeight, t = this.nodes.offsetWidth / this.container.offsetWidth, n = 1 / Math.max(1, Math.max(e, t));
1838
1890
  this.scaleVal = n, this.map.style.transform = "scale(" + n + ")", this.bus.fire("scale", n);
1839
- }, jn = function(e, t) {
1891
+ }, $n = function(e, t) {
1840
1892
  const { map: n, scaleVal: o, bus: i } = this, s = n.style.transform;
1841
- let { x: r, y: l } = Ye(s);
1893
+ let { x: r, y: l } = Ge(s);
1842
1894
  r += e, l += t, n.style.transform = `translate(${r}px, ${l}px) scale(${o})`, i.fire("move", { dx: e, dy: t });
1843
- }, it = (e) => {
1844
- const { container: t, map: n, nodes: o } = e, i = n.querySelector("me-root"), s = i.offsetTop, r = i.offsetLeft, l = i.offsetWidth, u = i.offsetHeight;
1845
- let a, f;
1846
- return e.alignment === "root" ? (a = t.offsetWidth / 2 - r - l / 2, f = t.offsetHeight / 2 - s - u / 2, n.style.transformOrigin = `${r + l / 2}px 50%`) : (a = (t.offsetWidth - o.offsetWidth) / 2, f = (t.offsetHeight - o.offsetHeight) / 2, n.style.transformOrigin = "50% 50%"), { dx: a, dy: f };
1847
- }, Pn = function() {
1848
- const { map: e } = this, { dx: t, dy: n } = it(this);
1895
+ }, st = (e) => {
1896
+ const { container: t, map: n, nodes: o } = e, i = n.querySelector("me-root"), s = i.offsetTop, r = i.offsetLeft, l = i.offsetWidth, c = i.offsetHeight;
1897
+ let d, f;
1898
+ return e.alignment === "root" ? (d = t.offsetWidth / 2 - r - l / 2, f = t.offsetHeight / 2 - s - c / 2, n.style.transformOrigin = `${r + l / 2}px 50%`) : (d = (t.offsetWidth - o.offsetWidth) / 2, f = (t.offsetHeight - o.offsetHeight) / 2, n.style.transformOrigin = "50% 50%"), { dx: d, dy: f };
1899
+ }, jn = function() {
1900
+ const { map: e } = this, { dx: t, dy: n } = st(this);
1849
1901
  e.style.transform = `translate(${t}px, ${n}px) scale(${this.scaleVal})`;
1850
- }, $n = function(e) {
1851
- e(this);
1852
1902
  }, Hn = function(e) {
1903
+ e(this);
1904
+ }, Bn = function(e) {
1853
1905
  e.nodeObj.parent && (this.clearSelection(), this.tempDirection === null && (this.tempDirection = this.direction), this.isFocusMode || (this.nodeDataBackup = this.nodeData, this.isFocusMode = !0), this.nodeData = e.nodeObj, this.initRight(), this.toCenter());
1854
- }, Bn = function() {
1855
- this.isFocusMode = !1, this.tempDirection !== null && (this.nodeData = this.nodeDataBackup, this.direction = this.tempDirection, this.tempDirection = null, this.refresh(), this.toCenter());
1856
1906
  }, Rn = function() {
1857
- this.direction = 0, this.refresh(), this.toCenter();
1907
+ this.isFocusMode = !1, this.tempDirection !== null && (this.nodeData = this.nodeDataBackup, this.direction = this.tempDirection, this.tempDirection = null, this.refresh(), this.toCenter());
1858
1908
  }, Fn = function() {
1859
- this.direction = 1, this.refresh(), this.toCenter();
1909
+ this.direction = 0, this.refresh(), this.toCenter();
1860
1910
  }, In = function() {
1911
+ this.direction = 1, this.refresh(), this.toCenter();
1912
+ }, Wn = function() {
1861
1913
  this.direction = 2, this.refresh(), this.toCenter();
1862
- }, Wn = function(e) {
1914
+ }, Kn = function(e) {
1863
1915
  this.locale = e, this.refresh();
1864
- }, Vn = function(e, t) {
1916
+ }, Yn = function(e, t) {
1865
1917
  const n = e.nodeObj;
1866
1918
  typeof t == "boolean" ? n.expanded = t : n.expanded !== !1 ? n.expanded = !1 : n.expanded = !0;
1867
1919
  const o = e.parentNode, i = o.children[1];
1868
- if (i.expanded = n.expanded, i.className = n.expanded ? "minus" : "", X(e), n.expanded) {
1869
- const u = this.createChildren(
1870
- n.children.map((a) => this.createWrapper(a).grp)
1920
+ if (i.expanded = n.expanded, i.className = n.expanded ? "minus" : "", J(e), n.expanded) {
1921
+ const c = this.createChildren(
1922
+ n.children.map((d) => this.createWrapper(d).grp)
1871
1923
  );
1872
- o.parentNode.appendChild(u);
1924
+ o.parentNode.appendChild(c);
1873
1925
  } else
1874
1926
  o.parentNode.children[1].remove();
1875
1927
  this.linkDiv(e.closest("me-main > me-wrapper"));
1876
1928
  const s = e.getBoundingClientRect(), r = this.container.getBoundingClientRect();
1877
1929
  (s.bottom > r.bottom || s.top < r.top || s.right > r.right || s.left < r.left) && this.scrollIntoView(e), this.bus.fire("expandNode", n);
1878
- }, Yn = function(e, t) {
1879
- const n = e.nodeObj, o = (i, s) => {
1880
- i.expanded = s, i.children && i.children.forEach((r) => {
1881
- o(r, s);
1882
- });
1883
- };
1884
- typeof t == "boolean" ? o(n, t) : n.expanded !== !1 ? o(n, !1) : o(n, !0), this.refresh();
1885
- }, Gn = function(e) {
1886
- e && (e = JSON.parse(JSON.stringify(e)), this.nodeData = e.nodeData, this.arrows = e.arrows || [], this.summaries = e.summaries || [], e.theme && this.changeTheme(e.theme)), $(this.nodeData), this.layout(), this.linkDiv();
1887
- }, Kn = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
1930
+ }, Gn = function(e, t) {
1931
+ const n = e.nodeObj;
1932
+ V(n, t ?? !n.expanded), this.refresh();
1933
+ }, Vn = function(e) {
1934
+ this.clearSelection(), e && (e = JSON.parse(JSON.stringify(e)), this.nodeData = e.nodeData, this.arrows = e.arrows || [], this.summaries = e.summaries || [], e.theme && this.changeTheme(e.theme)), j(this.nodeData), this.layout(), this.linkDiv();
1935
+ }, qn = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
1888
1936
  __proto__: null,
1889
- cancelFocus: Bn,
1890
- clearSelection: _n,
1891
- disableEdit: Mn,
1892
- enableEdit: An,
1893
- expandNode: Vn,
1894
- expandNodeAll: Yn,
1895
- focusNode: Hn,
1896
- getData: Ln,
1897
- getDataString: Tn,
1898
- initLeft: Rn,
1899
- initRight: Fn,
1900
- initSide: In,
1901
- install: $n,
1902
- move: jn,
1903
- refresh: Gn,
1904
- scale: Dn,
1905
- scaleFit: On,
1906
- scrollIntoView: Cn,
1907
- selectNode: Sn,
1908
- selectNodes: Nn,
1909
- setLocale: Wn,
1910
- toCenter: Pn,
1911
- unselectNodes: kn
1912
- }, Symbol.toStringTag, { value: "Module" })), qn = function(e) {
1937
+ cancelFocus: Rn,
1938
+ clearSelection: Tn,
1939
+ disableEdit: Dn,
1940
+ enableEdit: Mn,
1941
+ expandNode: Yn,
1942
+ expandNodeAll: Gn,
1943
+ focusNode: Bn,
1944
+ getData: An,
1945
+ getDataString: Ln,
1946
+ initLeft: Fn,
1947
+ initRight: In,
1948
+ initSide: Wn,
1949
+ install: Hn,
1950
+ move: $n,
1951
+ refresh: Vn,
1952
+ scale: On,
1953
+ scaleFit: Pn,
1954
+ scrollIntoView: Sn,
1955
+ selectNode: Nn,
1956
+ selectNodes: kn,
1957
+ setLocale: Kn,
1958
+ toCenter: jn,
1959
+ unselectNodes: _n
1960
+ }, Symbol.toStringTag, { value: "Module" })), zn = function(e) {
1913
1961
  return {
1914
1962
  dom: e,
1915
1963
  moved: !1,
@@ -1932,7 +1980,7 @@ const Cn = function(e) {
1932
1980
  },
1933
1981
  cb: null,
1934
1982
  init(t, n) {
1935
- this.cb = n, this.handleClear = this.handleClear.bind(this), this.handlePointerMove = this.handlePointerMove.bind(this), this.handlePointerDown = this.handlePointerDown.bind(this), this.destroy = be([
1983
+ this.cb = n, this.handleClear = this.handleClear.bind(this), this.handlePointerMove = this.handlePointerMove.bind(this), this.handlePointerDown = this.handlePointerDown.bind(this), this.destroy = we([
1936
1984
  { dom: t, evt: "pointermove", func: this.handlePointerMove },
1937
1985
  { dom: t, evt: "pointerleave", func: this.handleClear },
1938
1986
  { dom: t, evt: "pointerup", func: this.handleClear },
@@ -1944,58 +1992,58 @@ const Cn = function(e) {
1944
1992
  this.moved = !1, this.pointerdown = !1;
1945
1993
  }
1946
1994
  };
1947
- }, Re = {
1948
- create: qn
1949
- }, zn = "#4dc4ff";
1950
- function st(e, t, n, o, i, s, r, l) {
1995
+ }, Ie = {
1996
+ create: zn
1997
+ }, Un = "#4dc4ff";
1998
+ function rt(e, t, n, o, i, s, r, l) {
1951
1999
  return {
1952
2000
  x: e / 8 + n * 3 / 8 + i * 3 / 8 + r / 8,
1953
2001
  y: t / 8 + o * 3 / 8 + s * 3 / 8 + l / 8
1954
2002
  };
1955
2003
  }
1956
- function Un(e, t, n) {
1957
- S(e, {
2004
+ function Xn(e, t, n) {
2005
+ N(e, {
1958
2006
  x: t + "",
1959
2007
  y: n + ""
1960
2008
  });
1961
2009
  }
1962
- function Z(e, t, n, o, i) {
1963
- S(e, {
2010
+ function Q(e, t, n, o, i) {
2011
+ N(e, {
1964
2012
  x1: t + "",
1965
2013
  y1: n + "",
1966
2014
  x2: o + "",
1967
2015
  y2: i + ""
1968
2016
  });
1969
2017
  }
1970
- function Fe(e, t, n, o, i, s, r, l, u, a) {
1971
- var d;
1972
- if (e.line.setAttribute("d", `M ${t} ${n} C ${o} ${i} ${s} ${r} ${l} ${u}`), a.style) {
1973
- const c = a.style;
1974
- c.stroke && e.line.setAttribute("stroke", c.stroke), c.strokeWidth && e.line.setAttribute("stroke-width", String(c.strokeWidth)), c.strokeDasharray && e.line.setAttribute("stroke-dasharray", c.strokeDasharray), c.strokeLinecap && e.line.setAttribute("stroke-linecap", c.strokeLinecap), c.opacity !== void 0 && e.line.setAttribute("opacity", String(c.opacity));
1975
- }
1976
- const f = oe(s, r, l, u);
1977
- if (f && (e.arrow1.setAttribute("d", `M ${f.x1} ${f.y1} L ${l} ${u} L ${f.x2} ${f.y2}`), a.style)) {
1978
- const c = a.style;
1979
- c.stroke && e.arrow1.setAttribute("stroke", c.stroke), c.strokeWidth && e.arrow1.setAttribute("stroke-width", String(c.strokeWidth)), c.strokeLinecap && e.arrow1.setAttribute("stroke-linecap", c.strokeLinecap), c.opacity !== void 0 && e.arrow1.setAttribute("opacity", String(c.opacity));
1980
- }
1981
- if (a.bidirectional) {
1982
- const c = oe(o, i, t, n);
1983
- if (c && (e.arrow2.setAttribute("d", `M ${c.x1} ${c.y1} L ${t} ${n} L ${c.x2} ${c.y2}`), a.style)) {
1984
- const p = a.style;
2018
+ function We(e, t, n, o, i, s, r, l, c, d) {
2019
+ var u;
2020
+ if (e.line.setAttribute("d", `M ${t} ${n} C ${o} ${i} ${s} ${r} ${l} ${c}`), d.style) {
2021
+ const a = d.style;
2022
+ a.stroke && e.line.setAttribute("stroke", a.stroke), a.strokeWidth && e.line.setAttribute("stroke-width", String(a.strokeWidth)), a.strokeDasharray && e.line.setAttribute("stroke-dasharray", a.strokeDasharray), a.strokeLinecap && e.line.setAttribute("stroke-linecap", a.strokeLinecap), a.opacity !== void 0 && e.line.setAttribute("opacity", String(a.opacity));
2023
+ }
2024
+ const f = ie(s, r, l, c);
2025
+ if (f && (e.arrow1.setAttribute("d", `M ${f.x1} ${f.y1} L ${l} ${c} L ${f.x2} ${f.y2}`), d.style)) {
2026
+ const a = d.style;
2027
+ a.stroke && e.arrow1.setAttribute("stroke", a.stroke), a.strokeWidth && e.arrow1.setAttribute("stroke-width", String(a.strokeWidth)), a.strokeLinecap && e.arrow1.setAttribute("stroke-linecap", a.strokeLinecap), a.opacity !== void 0 && e.arrow1.setAttribute("opacity", String(a.opacity));
2028
+ }
2029
+ if (d.bidirectional) {
2030
+ const a = ie(o, i, t, n);
2031
+ if (a && (e.arrow2.setAttribute("d", `M ${a.x1} ${a.y1} L ${t} ${n} L ${a.x2} ${a.y2}`), d.style)) {
2032
+ const p = d.style;
1985
2033
  p.stroke && e.arrow2.setAttribute("stroke", p.stroke), p.strokeWidth && e.arrow2.setAttribute("stroke-width", String(p.strokeWidth)), p.strokeLinecap && e.arrow2.setAttribute("stroke-linecap", p.strokeLinecap), p.opacity !== void 0 && e.arrow2.setAttribute("opacity", String(p.opacity));
1986
2034
  }
1987
2035
  }
1988
- const { x: h, y: g } = st(t, n, o, i, s, r, l, u);
1989
- Un(e.label, h, g), (d = a.style) != null && d.labelColor && e.label.setAttribute("fill", a.style.labelColor), io(e);
2036
+ const { x: h, y: g } = rt(t, n, o, i, s, r, l, c);
2037
+ Xn(e.label, h, g), (u = d.style) != null && u.labelColor && e.label.setAttribute("fill", d.style.labelColor), io(e);
1990
2038
  }
1991
- function re(e, t, n) {
1992
- const { offsetLeft: o, offsetTop: i } = H(e.nodes, t), s = t.offsetWidth, r = t.offsetHeight, l = o + s / 2, u = i + r / 2, a = l + n.x, f = u + n.y;
2039
+ function le(e, t, n) {
2040
+ const { offsetLeft: o, offsetTop: i } = H(e.nodes, t), s = t.offsetWidth, r = t.offsetHeight, l = o + s / 2, c = i + r / 2, d = l + n.x, f = c + n.y;
1993
2041
  return {
1994
2042
  w: s,
1995
2043
  h: r,
1996
2044
  cx: l,
1997
- cy: u,
1998
- ctrlX: a,
2045
+ cy: c,
2046
+ ctrlX: d,
1999
2047
  ctrlY: f
2000
2048
  };
2001
2049
  }
@@ -2007,34 +2055,30 @@ function G(e) {
2007
2055
  y: n
2008
2056
  };
2009
2057
  }
2010
- const Xn = function(e, t, n, o) {
2011
- const i = document.createElementNS(_, "text");
2012
- return S(i, {
2013
- "text-anchor": "middle",
2014
- x: t + "",
2015
- y: n + "",
2016
- fill: o || "rgb(235, 95, 82)"
2017
- }), i.dataset.type = "custom-link", i.innerHTML = e, i;
2018
- }, Ee = function(e, t, n, o, i) {
2019
- var y;
2058
+ const Se = function(e, t, n, o, i) {
2059
+ var w;
2020
2060
  if (!t || !n)
2021
2061
  return;
2022
- const s = re(e, t, o.delta1), r = re(e, n, o.delta2), { x: l, y: u } = G(s), { ctrlX: a, ctrlY: f } = s, { ctrlX: h, ctrlY: g } = r, { x: d, y: c } = G(r), p = oe(h, g, d, c);
2062
+ const s = le(e, t, o.delta1), r = le(e, n, o.delta2), { x: l, y: c } = G(s), { ctrlX: d, ctrlY: f } = s, { ctrlX: h, ctrlY: g } = r, { x: u, y: a } = G(r), p = ie(h, g, u, a);
2023
2063
  if (!p)
2024
2064
  return;
2025
- const m = `M ${p.x1} ${p.y1} L ${d} ${c} L ${p.x2} ${p.y2}`;
2065
+ const m = `M ${p.x1} ${p.y1} L ${u} ${a} L ${p.x2} ${p.y2}`;
2026
2066
  let v = "";
2027
2067
  if (o.bidirectional) {
2028
- const C = oe(a, f, l, u);
2029
- if (!C)
2068
+ const E = ie(d, f, l, c);
2069
+ if (!E)
2030
2070
  return;
2031
- v = `M ${C.x1} ${C.y1} L ${l} ${u} L ${C.x2} ${C.y2}`;
2071
+ v = `M ${E.x1} ${E.y1} L ${l} ${c} L ${E.x2} ${E.y2}`;
2032
2072
  }
2033
- const b = _t(`M ${l} ${u} C ${a} ${f} ${h} ${g} ${d} ${c}`, m, v, o.style), { x: w, y: E } = st(l, u, a, f, h, g, d, c), N = (y = o.style) == null ? void 0 : y.labelColor, x = Xn(o.label, w, E, N);
2034
- b.appendChild(x), b.label = x, b.arrowObj = o, b.dataset.linkid = o.id, e.linkSvgGroup.appendChild(b), i || (e.arrows.push(o), e.currentArrow = b, rt(e, o, s, r));
2073
+ const b = Tt(`M ${l} ${c} C ${d} ${f} ${h} ${g} ${u} ${a}`, m, v, o.style), { x, y: S } = rt(l, c, d, f, h, g, u, a), k = (w = o.style) == null ? void 0 : w.labelColor, y = ue(o.label, x, S, {
2074
+ anchor: "middle",
2075
+ color: k,
2076
+ dataType: "custom-link"
2077
+ });
2078
+ b.appendChild(y), b.label = y, b.arrowObj = o, b.dataset.linkid = o.id, e.linkSvgGroup.appendChild(b), i || (e.arrows.push(o), e.currentArrow = b, lt(e, o, s, r));
2035
2079
  }, Jn = function(e, t, n = {}) {
2036
2080
  const o = {
2037
- id: V(),
2081
+ id: K(),
2038
2082
  label: "Custom Link",
2039
2083
  from: e.nodeObj.id,
2040
2084
  to: t.nodeObj.id,
@@ -2048,14 +2092,14 @@ const Xn = function(e, t, n, o) {
2048
2092
  },
2049
2093
  ...n
2050
2094
  };
2051
- Ee(this, e, t, o), this.bus.fire("operation", {
2095
+ Se(this, e, t, o), this.bus.fire("operation", {
2052
2096
  name: "createArrow",
2053
2097
  obj: o
2054
2098
  });
2055
2099
  }, Zn = function(e) {
2056
- ce(this);
2057
- const t = { ...e, id: V() };
2058
- Ee(this, this.findEle(t.from), this.findEle(t.to), t), this.bus.fire("operation", {
2100
+ ae(this);
2101
+ const t = { ...e, id: K() };
2102
+ Se(this, this.findEle(t.from), this.findEle(t.to), t), this.bus.fire("operation", {
2059
2103
  name: "createArrow",
2060
2104
  obj: t
2061
2105
  });
@@ -2063,7 +2107,7 @@ const Xn = function(e, t, n, o) {
2063
2107
  let t;
2064
2108
  if (e ? t = e : t = this.currentArrow, !t)
2065
2109
  return;
2066
- ce(this);
2110
+ ae(this);
2067
2111
  const n = t.arrowObj.id;
2068
2112
  this.arrows = this.arrows.filter((o) => o.id !== n), t.remove(), this.bus.fire("operation", {
2069
2113
  name: "removeArrow",
@@ -2073,13 +2117,13 @@ const Xn = function(e, t, n, o) {
2073
2117
  });
2074
2118
  }, eo = function(e) {
2075
2119
  this.currentArrow = e;
2076
- const t = e.arrowObj, n = this.findEle(t.from), o = this.findEle(t.to), i = re(this, n, t.delta1), s = re(this, o, t.delta2);
2077
- rt(this, t, i, s);
2120
+ const t = e.arrowObj, n = this.findEle(t.from), o = this.findEle(t.to), i = le(this, n, t.delta1), s = le(this, o, t.delta2);
2121
+ lt(this, t, i, s);
2078
2122
  }, to = function() {
2079
- ce(this), this.currentArrow = null;
2080
- }, ae = function(e, t) {
2081
- const n = document.createElementNS(_, "path");
2082
- return S(n, {
2123
+ ae(this), this.currentArrow = null;
2124
+ }, de = function(e, t) {
2125
+ const n = document.createElementNS(L, "path");
2126
+ return N(n, {
2083
2127
  d: e,
2084
2128
  stroke: t,
2085
2129
  fill: "none",
@@ -2088,13 +2132,13 @@ const Xn = function(e, t, n, o) {
2088
2132
  "stroke-linejoin": "round"
2089
2133
  }), n;
2090
2134
  }, no = function(e, t) {
2091
- const n = document.createElementNS(_, "g");
2135
+ const n = document.createElementNS(L, "g");
2092
2136
  n.setAttribute("class", "arrow-highlight"), n.setAttribute("opacity", "0.45");
2093
- const o = ae(e.line.getAttribute("d"), t);
2137
+ const o = de(e.line.getAttribute("d"), t);
2094
2138
  n.appendChild(o);
2095
- const i = ae(e.arrow1.getAttribute("d"), t);
2139
+ const i = de(e.arrow1.getAttribute("d"), t);
2096
2140
  if (n.appendChild(i), e.arrow2.getAttribute("d")) {
2097
- const s = ae(e.arrow2.getAttribute("d"), t);
2141
+ const s = de(e.arrow2.getAttribute("d"), t);
2098
2142
  n.appendChild(s);
2099
2143
  }
2100
2144
  e.insertBefore(n, e.firstChild);
@@ -2107,23 +2151,23 @@ const Xn = function(e, t, n, o) {
2107
2151
  return;
2108
2152
  const n = t.querySelectorAll("path");
2109
2153
  n.length >= 1 && n[0].setAttribute("d", e.line.getAttribute("d")), n.length >= 2 && n[1].setAttribute("d", e.arrow1.getAttribute("d")), n.length >= 3 && e.arrow2.getAttribute("d") && n[2].setAttribute("d", e.arrow2.getAttribute("d"));
2110
- }, ce = function(e) {
2154
+ }, ae = function(e) {
2111
2155
  var t, n;
2112
2156
  (t = e.helper1) == null || t.destroy(), (n = e.helper2) == null || n.destroy(), e.linkController.style.display = "none", e.P2.style.display = "none", e.P3.style.display = "none", e.currentArrow && oo(e.currentArrow);
2113
- }, rt = function(e, t, n, o) {
2114
- const { linkController: i, P2: s, P3: r, line1: l, line2: u, nodes: a, map: f, currentArrow: h, bus: g } = e;
2157
+ }, lt = function(e, t, n, o) {
2158
+ const { linkController: i, P2: s, P3: r, line1: l, line2: c, nodes: d, map: f, currentArrow: h, bus: g } = e;
2115
2159
  if (!h)
2116
2160
  return;
2117
- i.style.display = "initial", s.style.display = "initial", r.style.display = "initial", a.appendChild(i), a.appendChild(s), a.appendChild(r), no(h, zn);
2118
- let { x: d, y: c } = G(n), { ctrlX: p, ctrlY: m } = n, { ctrlX: v, ctrlY: b } = o, { x: w, y: E } = G(o);
2119
- s.style.cssText = `top:${m}px;left:${p}px;`, r.style.cssText = `top:${b}px;left:${v}px;`, Z(l, d, c, p, m), Z(u, v, b, w, E), e.helper1 = Re.create(s), e.helper2 = Re.create(r), e.helper1.init(f, (N, x) => {
2120
- p = p + N / e.scaleVal, m = m + x / e.scaleVal;
2121
- const y = G({ ...n, ctrlX: p, ctrlY: m });
2122
- d = y.x, c = y.y, s.style.top = m + "px", s.style.left = p + "px", Fe(h, d, c, p, m, v, b, w, E, t), Z(l, d, c, p, m), t.delta1.x = p - n.cx, t.delta1.y = m - n.cy, g.fire("updateArrowDelta", t);
2123
- }), e.helper2.init(f, (N, x) => {
2124
- v = v + N / e.scaleVal, b = b + x / e.scaleVal;
2125
- const y = G({ ...o, ctrlX: v, ctrlY: b });
2126
- w = y.x, E = y.y, r.style.top = b + "px", r.style.left = v + "px", Fe(h, d, c, p, m, v, b, w, E, t), Z(u, v, b, w, E), t.delta2.x = v - o.cx, t.delta2.y = b - o.cy, g.fire("updateArrowDelta", t);
2161
+ i.style.display = "initial", s.style.display = "initial", r.style.display = "initial", d.appendChild(i), d.appendChild(s), d.appendChild(r), no(h, Un);
2162
+ let { x: u, y: a } = G(n), { ctrlX: p, ctrlY: m } = n, { ctrlX: v, ctrlY: b } = o, { x, y: S } = G(o);
2163
+ s.style.cssText = `top:${m}px;left:${p}px;`, r.style.cssText = `top:${b}px;left:${v}px;`, Q(l, u, a, p, m), Q(c, v, b, x, S), e.helper1 = Ie.create(s), e.helper2 = Ie.create(r), e.helper1.init(f, (k, y) => {
2164
+ p = p + k / e.scaleVal, m = m + y / e.scaleVal;
2165
+ const w = G({ ...n, ctrlX: p, ctrlY: m });
2166
+ u = w.x, a = w.y, s.style.top = m + "px", s.style.left = p + "px", We(h, u, a, p, m, v, b, x, S, t), Q(l, u, a, p, m), t.delta1.x = p - n.cx, t.delta1.y = m - n.cy, g.fire("updateArrowDelta", t);
2167
+ }), e.helper2.init(f, (k, y) => {
2168
+ v = v + k / e.scaleVal, b = b + y / e.scaleVal;
2169
+ const w = G({ ...o, ctrlX: v, ctrlY: b });
2170
+ x = w.x, S = w.y, r.style.top = b + "px", r.style.left = v + "px", We(h, u, a, p, m, v, b, x, S, t), Q(c, v, b, x, S), t.delta2.x = v - o.cx, t.delta2.y = b - o.cy, g.fire("updateArrowDelta", t);
2127
2171
  });
2128
2172
  };
2129
2173
  function so() {
@@ -2131,20 +2175,20 @@ function so() {
2131
2175
  for (let e = 0; e < this.arrows.length; e++) {
2132
2176
  const t = this.arrows[e];
2133
2177
  try {
2134
- Ee(this, this.findEle(t.from), this.findEle(t.to), t, !0);
2178
+ Se(this, this.findEle(t.from), this.findEle(t.to), t, !0);
2135
2179
  } catch {
2136
2180
  }
2137
2181
  }
2138
2182
  this.nodes.appendChild(this.linkSvgGroup);
2139
2183
  }
2140
2184
  function ro(e) {
2141
- if (ce(this), !e)
2185
+ if (ae(this), !e)
2142
2186
  return;
2143
2187
  const t = e.label;
2144
- ze(this, t, e.arrowObj);
2188
+ Ue(this, t, e.arrowObj);
2145
2189
  }
2146
2190
  function lo() {
2147
- this.arrows = this.arrows.filter((e) => ne(e.from, this.nodeData) && ne(e.to, this.nodeData));
2191
+ this.arrows = this.arrows.filter((e) => oe(e.from, this.nodeData) && oe(e.to, this.nodeData));
2148
2192
  }
2149
2193
  const co = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
2150
2194
  __proto__: null,
@@ -2157,14 +2201,14 @@ const co = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
2157
2201
  tidyArrow: lo,
2158
2202
  unselectArrow: to
2159
2203
  }, Symbol.toStringTag, { value: "Module" })), ao = function(e) {
2160
- var u, a;
2204
+ var c, d;
2161
2205
  if (e.length === 0)
2162
2206
  throw new Error("No selected node.");
2163
2207
  if (e.length === 1) {
2164
2208
  const f = e[0].nodeObj, h = e[0].nodeObj.parent;
2165
2209
  if (!h)
2166
2210
  throw new Error("Can not select root node.");
2167
- const g = h.children.findIndex((d) => f === d);
2211
+ const g = h.children.findIndex((u) => f === u);
2168
2212
  return {
2169
2213
  parent: h.id,
2170
2214
  start: g,
@@ -2176,17 +2220,17 @@ const co = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
2176
2220
  let h = f.nodeObj;
2177
2221
  const g = [];
2178
2222
  for (; h.parent; ) {
2179
- const d = h.parent, c = d.children, p = c == null ? void 0 : c.indexOf(h);
2180
- h = d, g.unshift({ node: h, index: p });
2223
+ const u = h.parent, a = u.children, p = a == null ? void 0 : a.indexOf(h);
2224
+ h = u, g.unshift({ node: h, index: p });
2181
2225
  }
2182
2226
  return g.length > t && (t = g.length), g;
2183
2227
  });
2184
2228
  let o = 0;
2185
2229
  e:
2186
2230
  for (; o < t; o++) {
2187
- const f = (u = n[0][o]) == null ? void 0 : u.node;
2231
+ const f = (c = n[0][o]) == null ? void 0 : c.node;
2188
2232
  for (let h = 1; h < n.length; h++)
2189
- if (((a = n[h][o]) == null ? void 0 : a.node) !== f)
2233
+ if (((d = n[h][o]) == null ? void 0 : d.node) !== f)
2190
2234
  break e;
2191
2235
  }
2192
2236
  if (!o)
@@ -2200,56 +2244,48 @@ const co = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
2200
2244
  end: r
2201
2245
  };
2202
2246
  }, ho = function(e) {
2203
- const t = document.createElementNS(_, "g");
2247
+ const t = document.createElementNS(L, "g");
2204
2248
  return t.setAttribute("id", e), t;
2205
- }, Ie = function(e, t) {
2206
- const n = document.createElementNS(_, "path");
2207
- return S(n, {
2249
+ }, Ke = function(e, t) {
2250
+ const n = document.createElementNS(L, "path");
2251
+ return N(n, {
2208
2252
  d: e,
2209
2253
  stroke: t || "#666",
2210
2254
  fill: "none",
2211
2255
  "stroke-linecap": "round",
2212
2256
  "stroke-width": "2"
2213
2257
  }), n;
2214
- }, We = function(e, t, n, o, i) {
2215
- const s = document.createElementNS(_, "text");
2216
- return S(s, {
2217
- "text-anchor": o,
2218
- x: t + "",
2219
- y: n + "",
2220
- fill: i || "#666"
2221
- }), s.innerHTML = e, s;
2222
2258
  }, uo = (e) => e.parentElement.parentElement, fo = function(e, { parent: t, start: n }) {
2223
2259
  const o = e.findEle(t), i = o.nodeObj;
2224
2260
  let s;
2225
2261
  return i.parent ? s = o.closest("me-main").className : s = e.findEle(i.children[n].id).closest("me-main").className, s;
2226
- }, Ce = function(e, t) {
2227
- var C;
2228
- const { id: n, label: o, parent: i, start: s, end: r } = t, { nodes: l, theme: u, summarySvg: a } = e, h = e.findEle(i).nodeObj, g = fo(e, t);
2229
- let d = 1 / 0, c = 0, p = 0, m = 0;
2230
- for (let k = s; k <= r; k++) {
2231
- const O = (C = h.children) == null ? void 0 : C[k];
2262
+ }, Ne = function(e, t) {
2263
+ var E;
2264
+ const { id: n, label: o, parent: i, start: s, end: r } = t, { nodes: l, theme: c, summarySvg: d } = e, h = e.findEle(i).nodeObj, g = fo(e, t);
2265
+ let u = 1 / 0, a = 0, p = 0, m = 0;
2266
+ for (let C = s; C <= r; C++) {
2267
+ const O = (E = h.children) == null ? void 0 : E[C];
2232
2268
  if (!O)
2233
2269
  return e.removeSummary(n), null;
2234
- const B = uo(e.findEle(O.id)), { offsetLeft: R, offsetTop: Se } = H(l, B), Ne = s === r ? 10 : 20;
2235
- k === s && (p = Se + Ne), k === r && (m = Se + B.offsetHeight - Ne), R < d && (d = R), B.offsetWidth + R > c && (c = B.offsetWidth + R);
2270
+ const B = uo(e.findEle(O.id)), { offsetLeft: R, offsetTop: ke } = H(l, B), _e = s === r ? 10 : 20;
2271
+ C === s && (p = ke + _e), C === r && (m = ke + B.offsetHeight - _e), R < u && (u = R), B.offsetWidth + R > a && (a = B.offsetWidth + R);
2236
2272
  }
2237
2273
  let v, b;
2238
- const w = p + 10, E = m + 10, N = (w + E) / 2, x = u.cssVar["--color"];
2239
- g === M.LHS ? (v = Ie(`M ${d + 10} ${w} c -5 0 -10 5 -10 10 L ${d} ${E - 10} c 0 5 5 10 10 10 M ${d} ${N} h -10`, x), b = We(o, d - 20, N + 6, "end", x)) : (v = Ie(`M ${c - 10} ${w} c 5 0 10 5 10 10 L ${c} ${E - 10} c 0 5 -5 10 -10 10 M ${c} ${N} h 10`, x), b = We(o, c + 20, N + 6, "start", x));
2240
- const y = ho("s-" + n);
2241
- return y.appendChild(v), y.appendChild(b), y.summaryObj = t, a.appendChild(y), y;
2274
+ const x = p + 10, S = m + 10, k = (x + S) / 2, y = c.cssVar["--color"];
2275
+ g === M.LHS ? (v = Ke(`M ${u + 10} ${x} c -5 0 -10 5 -10 10 L ${u} ${S - 10} c 0 5 5 10 10 10 M ${u} ${k} h -10`, y), b = ue(o, u - 20, k + 6, { anchor: "end", color: y })) : (v = Ke(`M ${a - 10} ${x} c 5 0 10 5 10 10 L ${a} ${S - 10} c 0 5 -5 10 -10 10 M ${a} ${k} h 10`, y), b = ue(o, a + 20, k + 6, { anchor: "start", color: y }));
2276
+ const w = ho("s-" + n);
2277
+ return w.appendChild(v), w.appendChild(b), w.summaryObj = t, d.appendChild(w), w;
2242
2278
  }, po = function() {
2243
2279
  if (!this.currentNodes)
2244
2280
  return;
2245
- const { currentNodes: e, summaries: t, bus: n } = this, { parent: o, start: i, end: s } = ao(e), r = { id: V(), parent: o, start: i, end: s, label: "summary" }, l = Ce(this, r);
2281
+ const { currentNodes: e, summaries: t, bus: n } = this, { parent: o, start: i, end: s } = ao(e), r = { id: K(), parent: o, start: i, end: s, label: "summary" }, l = Ne(this, r);
2246
2282
  t.push(r), this.editSummary(l), n.fire("operation", {
2247
2283
  name: "createSummary",
2248
2284
  obj: r
2249
2285
  });
2250
2286
  }, go = function(e) {
2251
- const t = V(), n = { ...e, id: t };
2252
- Ce(this, n), this.summaries.push(n), this.bus.fire("operation", {
2287
+ const t = K(), n = { ...e, id: t };
2288
+ Ne(this, n), this.summaries.push(n), this.bus.fire("operation", {
2253
2289
  name: "createSummary",
2254
2290
  obj: n
2255
2291
  });
@@ -2261,8 +2297,8 @@ const co = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
2261
2297
  obj: { id: e }
2262
2298
  });
2263
2299
  }, vo = function(e) {
2264
- const t = e.children[1].getBBox(), n = 6, o = 3, i = document.createElementNS(_, "rect");
2265
- S(i, {
2300
+ const t = e.children[1].getBBox(), n = 6, o = 3, i = document.createElementNS(L, "rect");
2301
+ N(i, {
2266
2302
  x: t.x - n + "",
2267
2303
  y: t.y - n + "",
2268
2304
  width: t.width + n * 2 + "",
@@ -2278,7 +2314,7 @@ const co = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
2278
2314
  }, yo = function() {
2279
2315
  this.summarySvg.innerHTML = "", this.summaries.forEach((e) => {
2280
2316
  try {
2281
- Ce(this, e);
2317
+ Ne(this, e);
2282
2318
  } catch {
2283
2319
  }
2284
2320
  }), this.nodes.insertAdjacentElement("beforeend", this.summarySvg);
@@ -2286,7 +2322,7 @@ const co = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
2286
2322
  if (!e)
2287
2323
  return;
2288
2324
  const t = e.childNodes[1];
2289
- ze(this, t, e.summaryObj);
2325
+ Ue(this, t, e.summaryObj);
2290
2326
  }, xo = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
2291
2327
  __proto__: null,
2292
2328
  createSummary: po,
@@ -2296,12 +2332,12 @@ const co = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
2296
2332
  renderSummary: yo,
2297
2333
  selectSummary: vo,
2298
2334
  unselectSummary: bo
2299
- }, Symbol.toStringTag, { value: "Module" })), T = "http://www.w3.org/2000/svg";
2335
+ }, Symbol.toStringTag, { value: "Module" })), _ = "http://www.w3.org/2000/svg";
2300
2336
  function Eo(e, t) {
2301
- const n = document.createElementNS(T, "svg");
2302
- return S(n, {
2337
+ const n = document.createElementNS(_, "svg");
2338
+ return N(n, {
2303
2339
  version: "1.1",
2304
- xmlns: T,
2340
+ xmlns: _,
2305
2341
  height: e,
2306
2342
  width: t
2307
2343
  }), n;
@@ -2310,42 +2346,42 @@ function Co(e, t) {
2310
2346
  return (parseInt(e) - parseInt(t)) / 2;
2311
2347
  }
2312
2348
  function So(e, t, n, o) {
2313
- const i = document.createElementNS(T, "g");
2349
+ const i = document.createElementNS(_, "g");
2314
2350
  let s = "";
2315
2351
  return e.text ? s = e.text.textContent : s = e.childNodes[0].textContent, s.split(`
2316
- `).forEach((l, u) => {
2317
- const a = document.createElementNS(T, "text");
2318
- S(a, {
2352
+ `).forEach((l, c) => {
2353
+ const d = document.createElementNS(_, "text");
2354
+ N(d, {
2319
2355
  x: n + parseInt(t.paddingLeft) + "",
2320
- y: o + parseInt(t.paddingTop) + Co(t.lineHeight, t.fontSize) * (u + 1) + parseFloat(t.fontSize) * (u + 1) + "",
2356
+ y: o + parseInt(t.paddingTop) + Co(t.lineHeight, t.fontSize) * (c + 1) + parseFloat(t.fontSize) * (c + 1) + "",
2321
2357
  "text-anchor": "start",
2322
2358
  "font-family": t.fontFamily,
2323
2359
  "font-size": `${t.fontSize}`,
2324
2360
  "font-weight": `${t.fontWeight}`,
2325
2361
  fill: `${t.color}`
2326
- }), a.innerHTML = l, i.appendChild(a);
2362
+ }), d.innerHTML = l, i.appendChild(d);
2327
2363
  }), i;
2328
2364
  }
2329
2365
  function No(e, t, n, o) {
2330
2366
  var l;
2331
2367
  let i = "";
2332
2368
  (l = e.nodeObj) != null && l.dangerouslySetInnerHTML ? i = e.nodeObj.dangerouslySetInnerHTML : e.text ? i = e.text.textContent : i = e.childNodes[0].textContent;
2333
- const s = document.createElementNS(T, "foreignObject");
2334
- S(s, {
2369
+ const s = document.createElementNS(_, "foreignObject");
2370
+ N(s, {
2335
2371
  x: n + parseInt(t.paddingLeft) + "",
2336
2372
  y: o + parseInt(t.paddingTop) + "",
2337
2373
  width: t.width,
2338
2374
  height: t.height
2339
2375
  });
2340
2376
  const r = document.createElement("div");
2341
- return S(r, {
2377
+ return N(r, {
2342
2378
  xmlns: "http://www.w3.org/1999/xhtml",
2343
2379
  style: `font-family: ${t.fontFamily}; font-size: ${t.fontSize}; font-weight: ${t.fontWeight}; color: ${t.color}; white-space: pre-wrap;`
2344
2380
  }), r.innerHTML = i, s.appendChild(r), s;
2345
2381
  }
2346
2382
  function ko(e, t) {
2347
- const n = getComputedStyle(t), { offsetLeft: o, offsetTop: i } = H(e.nodes, t), s = document.createElementNS(T, "rect");
2348
- return S(s, {
2383
+ const n = getComputedStyle(t), { offsetLeft: o, offsetTop: i } = H(e.nodes, t), s = document.createElementNS(_, "rect");
2384
+ return N(s, {
2349
2385
  x: o + "",
2350
2386
  y: i + "",
2351
2387
  rx: n.borderRadius,
@@ -2357,9 +2393,9 @@ function ko(e, t) {
2357
2393
  "stroke-width": n.borderWidth
2358
2394
  }), s;
2359
2395
  }
2360
- function Q(e, t, n = !1) {
2361
- const o = getComputedStyle(t), { offsetLeft: i, offsetTop: s } = H(e.nodes, t), r = document.createElementNS(T, "rect");
2362
- S(r, {
2396
+ function ee(e, t, n = !1) {
2397
+ const o = getComputedStyle(t), { offsetLeft: i, offsetTop: s } = H(e.nodes, t), r = document.createElementNS(_, "rect");
2398
+ N(r, {
2363
2399
  x: i + "",
2364
2400
  y: s + "",
2365
2401
  rx: o.borderRadius,
@@ -2370,14 +2406,14 @@ function Q(e, t, n = !1) {
2370
2406
  stroke: o.borderColor,
2371
2407
  "stroke-width": o.borderWidth
2372
2408
  });
2373
- const l = document.createElementNS(T, "g");
2409
+ const l = document.createElementNS(_, "g");
2374
2410
  l.appendChild(r);
2375
- let u;
2376
- return n ? u = No(t, o, i, s) : u = So(t, o, i, s), l.appendChild(u), l;
2411
+ let c;
2412
+ return n ? c = No(t, o, i, s) : c = So(t, o, i, s), l.appendChild(c), l;
2377
2413
  }
2378
2414
  function _o(e, t) {
2379
- const n = getComputedStyle(t), { offsetLeft: o, offsetTop: i } = H(e.nodes, t), s = document.createElementNS(T, "a"), r = document.createElementNS(T, "text");
2380
- return S(r, {
2415
+ const n = getComputedStyle(t), { offsetLeft: o, offsetTop: i } = H(e.nodes, t), s = document.createElementNS(_, "a"), r = document.createElementNS(_, "text");
2416
+ return N(r, {
2381
2417
  x: o + "",
2382
2418
  y: i + parseInt(n.fontSize) + "",
2383
2419
  "text-anchor": "start",
@@ -2388,8 +2424,8 @@ function _o(e, t) {
2388
2424
  }), r.innerHTML = t.textContent, s.appendChild(r), s.setAttribute("href", t.href), s;
2389
2425
  }
2390
2426
  function To(e, t) {
2391
- const n = getComputedStyle(t), { offsetLeft: o, offsetTop: i } = H(e.nodes, t), s = document.createElementNS(T, "image");
2392
- return S(s, {
2427
+ const n = getComputedStyle(t), { offsetLeft: o, offsetTop: i } = H(e.nodes, t), s = document.createElementNS(_, "image");
2428
+ return N(s, {
2393
2429
  x: o + "",
2394
2430
  y: i + "",
2395
2431
  width: n.width + "",
@@ -2397,37 +2433,37 @@ function To(e, t) {
2397
2433
  href: t.src
2398
2434
  }), s;
2399
2435
  }
2400
- const ee = 100, Lo = '<?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">', Ao = (e, t = !1) => {
2401
- var h, g, d;
2402
- const n = e.nodes, o = n.offsetHeight + ee * 2, i = n.offsetWidth + ee * 2, s = Eo(o + "px", i + "px"), r = document.createElementNS(T, "svg"), l = document.createElementNS(T, "rect");
2403
- S(l, {
2436
+ const te = 100, Lo = '<?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">', Ao = (e, t = !1) => {
2437
+ var h, g, u;
2438
+ const n = e.nodes, o = n.offsetHeight + te * 2, i = n.offsetWidth + te * 2, s = Eo(o + "px", i + "px"), r = document.createElementNS(_, "svg"), l = document.createElementNS(_, "rect");
2439
+ N(l, {
2404
2440
  x: "0",
2405
2441
  y: "0",
2406
2442
  width: `${i}`,
2407
2443
  height: `${o}`,
2408
2444
  fill: e.theme.cssVar["--bgcolor"]
2409
- }), s.appendChild(l), n.querySelectorAll(".subLines").forEach((c) => {
2410
- const p = c.cloneNode(!0), { offsetLeft: m, offsetTop: v } = H(n, c.parentElement);
2445
+ }), s.appendChild(l), n.querySelectorAll(".subLines").forEach((a) => {
2446
+ const p = a.cloneNode(!0), { offsetLeft: m, offsetTop: v } = H(n, a.parentElement);
2411
2447
  p.setAttribute("x", `${m}`), p.setAttribute("y", `${v}`), r.appendChild(p);
2412
2448
  });
2413
- const u = (h = n.querySelector(".lines")) == null ? void 0 : h.cloneNode(!0);
2414
- u && r.appendChild(u);
2415
- const a = (g = n.querySelector(".topiclinks")) == null ? void 0 : g.cloneNode(!0);
2416
- a && r.appendChild(a);
2417
- const f = (d = n.querySelector(".summary")) == null ? void 0 : d.cloneNode(!0);
2418
- return f && r.appendChild(f), n.querySelectorAll("me-tpc").forEach((c) => {
2419
- c.nodeObj.dangerouslySetInnerHTML ? r.appendChild(Q(e, c, !t)) : (r.appendChild(ko(e, c)), r.appendChild(Q(e, c.text, !t)));
2420
- }), n.querySelectorAll(".tags > span").forEach((c) => {
2421
- r.appendChild(Q(e, c));
2422
- }), n.querySelectorAll(".icons > span").forEach((c) => {
2423
- r.appendChild(Q(e, c));
2424
- }), n.querySelectorAll(".hyper-link").forEach((c) => {
2425
- r.appendChild(_o(e, c));
2426
- }), n.querySelectorAll("img").forEach((c) => {
2427
- r.appendChild(To(e, c));
2428
- }), S(r, {
2429
- x: ee + "",
2430
- y: ee + "",
2449
+ const c = (h = n.querySelector(".lines")) == null ? void 0 : h.cloneNode(!0);
2450
+ c && r.appendChild(c);
2451
+ const d = (g = n.querySelector(".topiclinks")) == null ? void 0 : g.cloneNode(!0);
2452
+ d && r.appendChild(d);
2453
+ const f = (u = n.querySelector(".summary")) == null ? void 0 : u.cloneNode(!0);
2454
+ return f && r.appendChild(f), n.querySelectorAll("me-tpc").forEach((a) => {
2455
+ a.nodeObj.dangerouslySetInnerHTML ? r.appendChild(ee(e, a, !t)) : (r.appendChild(ko(e, a)), r.appendChild(ee(e, a.text, !t)));
2456
+ }), n.querySelectorAll(".tags > span").forEach((a) => {
2457
+ r.appendChild(ee(e, a));
2458
+ }), n.querySelectorAll(".icons > span").forEach((a) => {
2459
+ r.appendChild(ee(e, a));
2460
+ }), n.querySelectorAll(".hyper-link").forEach((a) => {
2461
+ r.appendChild(_o(e, a));
2462
+ }), n.querySelectorAll("img").forEach((a) => {
2463
+ r.appendChild(To(e, a));
2464
+ }), N(r, {
2465
+ x: te + "",
2466
+ y: te + "",
2431
2467
  overflow: "visible"
2432
2468
  }), s.appendChild(r), s;
2433
2469
  }, Mo = (e, t) => (t && e.insertAdjacentHTML("afterbegin", "<style>" + t + "</style>"), Lo + e.outerHTML);
@@ -2444,7 +2480,7 @@ function Do(e) {
2444
2480
  const Oo = function(e = !1, t) {
2445
2481
  const n = Ao(this, e), o = Mo(n, t);
2446
2482
  return new Blob([o], { type: "image/svg+xml" });
2447
- }, jo = async function(e = !1, t) {
2483
+ }, Po = async function(e = !1, t) {
2448
2484
  const n = this.exportSvg(e, t), o = await Do(n);
2449
2485
  return new Promise((i, s) => {
2450
2486
  const r = new Image();
@@ -2453,67 +2489,67 @@ const Oo = function(e = !1, t) {
2453
2489
  l.width = r.width, l.height = r.height, l.getContext("2d").drawImage(r, 0, 0), l.toBlob(i, "image/png", 1);
2454
2490
  }, r.src = o, r.onerror = s;
2455
2491
  });
2456
- }, Po = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
2492
+ }, $o = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
2457
2493
  __proto__: null,
2458
- exportPng: jo,
2494
+ exportPng: Po,
2459
2495
  exportSvg: Oo
2460
2496
  }, Symbol.toStringTag, { value: "Module" }));
2461
- function $o(e, t) {
2497
+ function jo(e, t) {
2462
2498
  return async function(...n) {
2463
2499
  const o = this.before[t];
2464
2500
  o && !await o.apply(this, n) || e.apply(this, n);
2465
2501
  };
2466
2502
  }
2467
- const Ve = Object.keys(ot), lt = {};
2468
- for (let e = 0; e < Ve.length; e++) {
2469
- const t = Ve[e];
2470
- lt[t] = $o(ot[t], t);
2503
+ const Ye = Object.keys(it), ct = {};
2504
+ for (let e = 0; e < Ye.length; e++) {
2505
+ const t = Ye[e];
2506
+ ct[t] = jo(it[t], t);
2471
2507
  }
2472
2508
  const Ho = {
2473
- getObjById: ne,
2474
- generateNewObj: dt,
2475
- layout: yt,
2476
- linkDiv: Tt,
2477
- editTopic: kt,
2478
- createWrapper: Et,
2479
- createParent: Ct,
2480
- createChildren: St,
2481
- createTopic: Nt,
2482
- findEle: Ge,
2483
- changeTheme: en,
2484
- ...Kn,
2485
- ...lt,
2509
+ getObjById: oe,
2510
+ generateNewObj: ht,
2511
+ layout: wt,
2512
+ linkDiv: Lt,
2513
+ editTopic: _t,
2514
+ createWrapper: Ct,
2515
+ createParent: St,
2516
+ createChildren: Nt,
2517
+ createTopic: kt,
2518
+ findEle: Ve,
2519
+ changeTheme: tn,
2520
+ ...qn,
2521
+ ...ct,
2486
2522
  ...co,
2487
2523
  ...xo,
2488
- ...Po,
2524
+ ...$o,
2489
2525
  init(e) {
2490
2526
  if (e = JSON.parse(JSON.stringify(e)), !e || !e.nodeData)
2491
2527
  return new Error("MindElixir: `data` is required");
2492
- e.direction !== void 0 && (this.direction = e.direction), this.changeTheme(e.theme || this.theme, !1), this.nodeData = e.nodeData, $(this.nodeData), this.arrows = e.arrows || [], this.summaries = e.summaries || [], this.tidyArrow(), this.toolBar && Kt(this), this.keypress && mt(this, this.keypress), this.editable && Qt(this), this.contextMenu && this.disposable.push(Lt(this, this.contextMenu)), this.draggable && this.disposable.push(Ot(this)), this.allowUndo && this.disposable.push(Pt(this)), this.layout(), this.linkDiv(), this.toCenter();
2528
+ e.direction !== void 0 && (this.direction = e.direction), this.changeTheme(e.theme || this.theme, !1), this.nodeData = e.nodeData, j(this.nodeData), this.arrows = e.arrows || [], this.summaries = e.summaries || [], this.tidyArrow(), this.toolBar && qt(this), this.keypress && vt(this, this.keypress), this.editable && en(this), this.contextMenu && this.disposable.push(At(this, this.contextMenu)), this.draggable && this.disposable.push(Pt(this)), this.allowUndo && this.disposable.push(jt(this)), this.layout(), this.linkDiv(), this.toCenter();
2493
2529
  },
2494
2530
  destroy() {
2495
2531
  var e;
2496
2532
  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.waitCopy = 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, (e = this.selection) == null || e.destroy(), this.selection = void 0;
2497
2533
  }
2498
2534
  };
2499
- function Bo({ pT: e, pL: t, pW: n, pH: o, cT: i, cL: s, cW: r, cH: l, direction: u, containerHeight: a }) {
2535
+ function Bo({ pT: e, pL: t, pW: n, pH: o, cT: i, cL: s, cW: r, cH: l, direction: c, containerHeight: d }) {
2500
2536
  let f = t + n / 2;
2501
2537
  const h = e + o / 2;
2502
2538
  let g;
2503
- u === M.LHS ? g = s + r : g = s;
2504
- const d = i + l / 2, p = (1 - Math.abs(d - h) / a) * 0.25 * (n / 2);
2505
- return u === M.LHS ? f = f - n / 10 - p : f = f + n / 10 + p, `M ${f} ${h} Q ${f} ${d} ${g} ${d}`;
2539
+ c === M.LHS ? g = s + r : g = s;
2540
+ const u = i + l / 2, p = (1 - Math.abs(u - h) / d) * 0.25 * (n / 2);
2541
+ return c === M.LHS ? f = f - n / 10 - p : f = f + n / 10 + p, `M ${f} ${h} Q ${f} ${u} ${g} ${u}`;
2506
2542
  }
2507
- function Ro({ pT: e, pL: t, pW: n, pH: o, cT: i, cL: s, cW: r, cH: l, direction: u, isFirst: a }) {
2543
+ function Ro({ pT: e, pL: t, pW: n, pH: o, cT: i, cL: s, cW: r, cH: l, direction: c, isFirst: d }) {
2508
2544
  const f = parseInt(this.container.style.getPropertyValue("--node-gap-x"));
2509
2545
  let h = 0, g = 0;
2510
- a ? h = e + o / 2 : h = e + o;
2511
- const d = i + l;
2512
- let c = 0, p = 0, m = 0;
2513
- const v = Math.abs(h - d) / 300 * f;
2514
- return u === M.LHS ? (m = t, c = m + f, p = m - f, g = s + f, `M ${c} ${h} C ${m} ${h} ${m + v} ${d} ${p} ${d} H ${g}`) : (m = t + n, c = m - f, p = m + f, g = s + r - f, `M ${c} ${h} C ${m} ${h} ${m - v} ${d} ${p} ${d} H ${g}`);
2546
+ d ? h = e + o / 2 : h = e + o;
2547
+ const u = i + l;
2548
+ let a = 0, p = 0, m = 0;
2549
+ const v = Math.abs(h - u) / 300 * f;
2550
+ return c === M.LHS ? (m = t, a = m + f, p = m - f, g = s + f, `M ${a} ${h} C ${m} ${h} ${m + v} ${u} ${p} ${u} H ${g}`) : (m = t + n, a = m - f, p = m + f, g = s + r - f, `M ${a} ${h} C ${m} ${h} ${m - v} ${u} ${p} ${u} H ${g}`);
2515
2551
  }
2516
- const Fo = "5.0.3";
2552
+ const Fo = "5.0.5";
2517
2553
  function Io(e) {
2518
2554
  return {
2519
2555
  x: 0,
@@ -2529,7 +2565,7 @@ function Io(e) {
2529
2565
  }
2530
2566
  };
2531
2567
  }
2532
- const z = document;
2568
+ const U = document;
2533
2569
  function D({
2534
2570
  el: e,
2535
2571
  direction: t,
@@ -2539,30 +2575,32 @@ function D({
2539
2575
  contextMenu: s,
2540
2576
  toolBar: r,
2541
2577
  keypress: l,
2542
- mouseSelectionButton: u,
2543
- selectionContainer: a,
2578
+ mouseSelectionButton: c,
2579
+ selectionContainer: d,
2544
2580
  before: f,
2545
2581
  newTopicName: h,
2546
2582
  allowUndo: g,
2547
- generateMainBranch: d,
2548
- generateSubBranch: c,
2583
+ generateMainBranch: u,
2584
+ generateSubBranch: a,
2549
2585
  overflowHidden: p,
2550
2586
  theme: m,
2551
2587
  alignment: v,
2552
2588
  scaleSensitivity: b,
2553
- handleWheel: w
2589
+ scaleMax: x,
2590
+ scaleMin: S,
2591
+ handleWheel: k
2554
2592
  }) {
2555
- let E = null;
2556
- const N = Object.prototype.toString.call(e);
2557
- if (N === "[object HTMLDivElement]" ? E = e : N === "[object String]" && (E = document.querySelector(e)), !E)
2593
+ let y = null;
2594
+ const w = Object.prototype.toString.call(e);
2595
+ if (w === "[object HTMLDivElement]" ? y = e : w === "[object String]" && (y = document.querySelector(e)), !y)
2558
2596
  throw new Error("MindElixir: el is not a valid element");
2559
- E.style.position = "relative", E.innerHTML = "", this.el = E, this.disposable = [], this.before = f || {}, this.locale = n || "en", this.newTopicName = h || "new node", this.contextMenu = s ?? !0, this.toolBar = r ?? !0, this.keypress = l ?? !0, this.mouseSelectionButton = u ?? 0, this.direction = t ?? 1, this.draggable = o ?? !0, this.editable = i ?? !0, this.allowUndo = g ?? !1, this.scaleSensitivity = b ?? 0.2, this.generateMainBranch = d || Bo, this.generateSubBranch = c || Ro, this.overflowHidden = p ?? !1, this.alignment = v ?? "root", this.handleWheel = w ?? !0, this.currentNodes = [], this.currentArrow = null, this.scaleVal = 1, this.tempDirection = null, this.dragMoveHelper = Io(this), this.bus = bt(), this.container = z.createElement("div"), this.selectionContainer = a || this.container, this.container.className = "map-container";
2560
- const x = window.matchMedia("(prefers-color-scheme: dark)");
2561
- this.theme = m || (x.matches ? ge : pe);
2562
- const y = z.createElement("div");
2563
- y.className = "map-canvas", setTimeout(() => {
2564
- y.style.transition = "all 0.3s";
2565
- }, 300), this.map = y, this.container.setAttribute("tabindex", "0"), this.container.appendChild(this.map), this.el.appendChild(this.container), this.nodes = z.createElement("me-nodes"), this.lines = U("lines"), this.summarySvg = U("summary"), this.linkController = U("linkcontroller"), this.P2 = z.createElement("div"), this.P3 = z.createElement("div"), this.P2.className = this.P3.className = "circle", this.P2.style.display = this.P3.style.display = "none", this.line1 = Te(), this.line2 = Te(), this.linkController.appendChild(this.line1), this.linkController.appendChild(this.line2), this.linkSvgGroup = U("topiclinks"), this.map.appendChild(this.nodes), this.overflowHidden ? this.container.style.overflow = "hidden" : this.disposable.push(vt(this));
2597
+ y.style.position = "relative", y.innerHTML = "", this.el = y, this.disposable = [], this.before = f || {}, this.locale = n || "en", this.newTopicName = h || "New Node", this.contextMenu = s ?? !0, this.toolBar = r ?? !0, this.keypress = l ?? !0, this.mouseSelectionButton = c ?? 0, this.direction = t ?? 1, this.draggable = o ?? !0, this.editable = i ?? !0, this.allowUndo = g ?? !0, this.scaleSensitivity = b ?? 0.1, this.scaleMax = x ?? 1.4, this.scaleMin = S ?? 0.2, this.generateMainBranch = u || Bo, this.generateSubBranch = a || Ro, this.overflowHidden = p ?? !1, this.alignment = v ?? "root", this.handleWheel = k ?? !0, this.currentNodes = [], this.currentArrow = null, this.scaleVal = 1, this.tempDirection = null, this.dragMoveHelper = Io(this), this.bus = yt(), this.container = U.createElement("div"), this.selectionContainer = d || this.container, this.container.className = "map-container";
2598
+ const E = window.matchMedia("(prefers-color-scheme: dark)");
2599
+ this.theme = m || (E.matches ? ve : me);
2600
+ const C = U.createElement("div");
2601
+ C.className = "map-canvas", setTimeout(() => {
2602
+ C.style.transition = "all 0.3s";
2603
+ }, 300), this.map = C, this.container.setAttribute("tabindex", "0"), this.container.appendChild(this.map), this.el.appendChild(this.container), this.nodes = U.createElement("me-nodes"), this.lines = X("lines"), this.summarySvg = X("summary"), this.linkController = X("linkcontroller"), this.P2 = U.createElement("div"), this.P3 = U.createElement("div"), this.P2.className = this.P3.className = "circle", this.P2.style.display = this.P3.style.display = "none", this.line1 = Ae(), this.line2 = Ae(), this.linkController.appendChild(this.line1), this.linkController.appendChild(this.line2), this.linkSvgGroup = X("topiclinks"), this.map.appendChild(this.nodes), this.overflowHidden ? this.container.style.overflow = "hidden" : this.disposable.push(bt(this));
2566
2604
  }
2567
2605
  D.prototype = Ho;
2568
2606
  Object.defineProperty(D.prototype, "currentNode", {
@@ -2574,13 +2612,13 @@ Object.defineProperty(D.prototype, "currentNode", {
2574
2612
  D.LEFT = 0;
2575
2613
  D.RIGHT = 1;
2576
2614
  D.SIDE = 2;
2577
- D.THEME = pe;
2578
- D.DARK_THEME = ge;
2615
+ D.THEME = me;
2616
+ D.DARK_THEME = ve;
2579
2617
  D.version = Fo;
2580
- D.E = Ge;
2618
+ D.E = Ve;
2581
2619
  D.new = (e) => ({
2582
2620
  nodeData: {
2583
- id: V(),
2621
+ id: K(),
2584
2622
  topic: e || "new topic",
2585
2623
  children: []
2586
2624
  }