mind-elixir 5.9.3 → 5.10.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,4 +1,4 @@
1
- const Jo = 0, Zo = 1, Qo = 2, be = {
1
+ const qo = 0, Uo = 1, Jo = 2, ve = {
2
2
  name: "Latte",
3
3
  type: "light",
4
4
  palette: ["#dd7878", "#ea76cb", "#8839ef", "#e64553", "#fe640b", "#df8e1d", "#40a02b", "#209fb5", "#1e66f5", "#7287fd"],
@@ -67,10 +67,10 @@ const le = function(e, t) {
67
67
  return null;
68
68
  } else
69
69
  return null;
70
- }, G = (e, t) => {
70
+ }, V = (e, t) => {
71
71
  if (e.parent = t, e.children)
72
72
  for (let n = 0; n < e.children.length; n++)
73
- G(e.children[n], e);
73
+ V(e.children[n], e);
74
74
  }, U = (e, t, n) => {
75
75
  if (e.expanded = t, e.children)
76
76
  if (n === void 0 || n > 0) {
@@ -84,7 +84,7 @@ const le = function(e, t) {
84
84
  });
85
85
  };
86
86
  function xe(e) {
87
- if (e.id = V(), e.children)
87
+ if (e.id = z(), e.children)
88
88
  for (let t = 0; t < e.children.length; t++)
89
89
  xe(e.children[t]);
90
90
  }
@@ -97,17 +97,17 @@ function ce(e, t, n, o) {
97
97
  y2: o + Math.sin(h) * r
98
98
  };
99
99
  }
100
- function V() {
100
+ function z() {
101
101
  return ((/* @__PURE__ */ new Date()).getTime().toString(16) + Math.random().toString(16).substring(2)).substring(2, 18);
102
102
  }
103
- const gt = function() {
104
- const e = V();
103
+ const ut = function() {
104
+ const e = z();
105
105
  return {
106
106
  topic: this.newTopicName,
107
107
  id: e
108
108
  };
109
109
  };
110
- function Ce(e) {
110
+ function Ee(e) {
111
111
  return JSON.parse(
112
112
  JSON.stringify(e, (n, o) => {
113
113
  if (n !== "parent")
@@ -115,15 +115,15 @@ function Ce(e) {
115
115
  })
116
116
  );
117
117
  }
118
- const j = (e, t) => {
118
+ const H = (e, t) => {
119
119
  let n = 0, o = 0;
120
120
  for (; t && t !== e; )
121
121
  n += t.offsetLeft, o += t.offsetTop, t = t.offsetParent;
122
122
  return { offsetLeft: n, offsetTop: o };
123
- }, A = (e, t) => {
123
+ }, D = (e, t) => {
124
124
  for (const n in t)
125
125
  e.setAttribute(n, t[n]);
126
- }, re = (e) => e ? e.tagName === "ME-TPC" : !1, Ee = (e) => e.filter((t) => t.nodeObj.parent).filter((t, n, o) => {
126
+ }, re = (e) => e ? e.tagName === "ME-TPC" : !1, Ce = (e) => e.filter((t) => t.nodeObj.parent).filter((t, n, o) => {
127
127
  for (let s = 0; s < o.length; s++) {
128
128
  if (t === o[s]) continue;
129
129
  const { parent: i } = t.nodeObj;
@@ -134,7 +134,7 @@ const j = (e, t) => {
134
134
  }), Se = (e) => {
135
135
  const t = /translate3d\(([^,]+),\s*([^,]+)/, n = e.match(t);
136
136
  return n ? { x: parseFloat(n[1]), y: parseFloat(n[2]) } : { x: 0, y: 0 };
137
- }, Qe = function(e) {
137
+ }, Je = function(e) {
138
138
  for (let t = 0; t < e.length; t++) {
139
139
  const { dom: n, evt: o, func: s } = e[t];
140
140
  n.addEventListener(o, s);
@@ -151,7 +151,7 @@ const j = (e, t) => {
151
151
  }, B = {
152
152
  LHS: "lhs",
153
153
  RHS: "rhs"
154
- }, mt = function() {
154
+ }, pt = function() {
155
155
  this.nodes.innerHTML = "";
156
156
  const e = this.createTopic(this.nodeData);
157
157
  Ne.call(this, e, this.nodeData), e.draggable = !1;
@@ -164,8 +164,8 @@ const j = (e, t) => {
164
164
  i.direction === 0 ? o += 1 : i.direction === 1 ? s += 1 : o <= s ? (i.direction = 0, o += 1) : (i.direction = 1, s += 1);
165
165
  });
166
166
  }
167
- yt(this, n, t);
168
- }, yt = function(e, t, n) {
167
+ gt(this, n, t);
168
+ }, gt = function(e, t, n) {
169
169
  const o = document.createElement("me-main");
170
170
  o.className = B.LHS;
171
171
  const s = document.createElement("me-main");
@@ -175,14 +175,14 @@ const j = (e, t) => {
175
175
  e.direction === 2 ? l.direction === 0 ? o.appendChild(c) : s.appendChild(c) : e.direction === 0 ? o.appendChild(c) : s.appendChild(c);
176
176
  }
177
177
  e.nodes.appendChild(o), e.nodes.appendChild(n), e.nodes.appendChild(s), e.nodes.appendChild(e.lines), e.nodes.appendChild(e.labelContainer);
178
- }, vt = function(e, t) {
178
+ }, mt = function(e, t) {
179
179
  const n = document.createElement("me-children");
180
180
  for (let o = 0; o < t.length; o++) {
181
181
  const s = t[o], { grp: i } = e.createWrapper(s);
182
182
  n.appendChild(i);
183
183
  }
184
184
  return n;
185
- }, et = function(e, t) {
185
+ }, Ze = function(e, t) {
186
186
  const o = (this?.el ? this.el : t || document).querySelector(`[data-nodeid="me${e}"]`);
187
187
  if (!o) throw new Error(`FindEle: Node ${e} not found, maybe it's collapsed.`);
188
188
  return o;
@@ -222,35 +222,35 @@ const j = (e, t) => {
222
222
  typeof o == "string" ? s.textContent = o : (s.textContent = o.text, o.className && (s.className = o.className), o.style && Object.assign(s.style, o.style)), n.appendChild(s);
223
223
  }), e.appendChild(n), e.tags = n;
224
224
  } else e.tags && (e.tags = void 0);
225
- }, bt = function(e, t) {
225
+ }, yt = function(e, t) {
226
226
  const n = document.createElement("me-wrapper"), { p: o, tpc: s } = this.createParent(e);
227
227
  if (n.appendChild(o), !t && e.children && e.children.length > 0) {
228
- const i = ke(e.expanded);
228
+ const i = Te(e.expanded);
229
229
  if (o.appendChild(i), e.expanded !== !1) {
230
- const l = vt(this, e.children);
230
+ const l = mt(this, e.children);
231
231
  n.appendChild(l);
232
232
  }
233
233
  }
234
234
  return { grp: n, top: o, tpc: s };
235
- }, wt = function(e) {
235
+ }, bt = function(e) {
236
236
  const t = document.createElement("me-parent"), n = this.createTopic(e);
237
237
  return Ne.call(this, n, e), t.appendChild(n), { p: t, tpc: n };
238
- }, xt = function(e) {
238
+ }, vt = function(e) {
239
239
  const t = document.createElement("me-children");
240
240
  return t.append(...e), t;
241
- }, Ct = function(e) {
241
+ }, wt = function(e) {
242
242
  const t = document.createElement("me-tpc");
243
243
  return t.nodeObj = e, t.dataset.nodeid = "me" + e.id, t;
244
244
  };
245
- function tt(e) {
245
+ function Qe(e) {
246
246
  const t = document.createRange();
247
247
  t.selectNodeContents(e);
248
248
  const n = window.getSelection();
249
249
  n && (n.removeAllRanges(), n.addRange(t));
250
250
  }
251
- const Et = function(e) {
251
+ const xt = function(e) {
252
252
  if (!e) return;
253
- const t = document.createElement("div"), n = e.nodeObj, o = n.topic, { offsetLeft: s, offsetTop: i } = j(this.nodes, e);
253
+ const t = document.createElement("div"), n = e.nodeObj, o = n.topic, { offsetLeft: s, offsetTop: i } = H(this.nodes, e);
254
254
  this.nodes.appendChild(t), t.id = "input-box", t.textContent = o, t.contentEditable = "plaintext-only", t.spellcheck = !1;
255
255
  const l = getComputedStyle(e);
256
256
  t.style.cssText = `
@@ -263,7 +263,7 @@ const Et = function(e) {
263
263
  margin:${l.margin};
264
264
  background-color:${l.backgroundColor !== "rgba(0, 0, 0, 0)" && l.backgroundColor};
265
265
  border: ${l.border};
266
- border-radius:${l.borderRadius}; `, this.direction === 0 && (t.style.right = "0"), tt(t), this.bus.fire("operation", {
266
+ border-radius:${l.borderRadius}; `, this.direction === 0 && (t.style.right = "0"), Qe(t), this.bus.fire("operation", {
267
267
  name: "beginEdit",
268
268
  obj: e.nodeObj
269
269
  }), t.addEventListener("keydown", (c) => {
@@ -283,39 +283,39 @@ const Et = function(e) {
283
283
  origin: o
284
284
  }));
285
285
  });
286
- }, ke = function(e) {
286
+ }, Te = function(e) {
287
287
  const t = document.createElement("me-epd");
288
288
  return t.expanded = e !== !1, t.className = e !== !1 ? "minus" : "", t;
289
289
  }, J = (e) => {
290
290
  const t = e.parent?.children, n = t?.indexOf(e) ?? 0;
291
291
  return { siblings: t, index: n };
292
292
  };
293
- function St(e) {
293
+ function Et(e) {
294
294
  const { siblings: t, index: n } = J(e);
295
295
  if (t === void 0) return;
296
296
  const o = t[n];
297
297
  n === 0 ? (t[n] = t[t.length - 1], t[t.length - 1] = o) : (t[n] = t[n - 1], t[n - 1] = o);
298
298
  }
299
- function Nt(e) {
299
+ function Ct(e) {
300
300
  const { siblings: t, index: n } = J(e);
301
301
  if (t === void 0) return;
302
302
  const o = t[n];
303
303
  n === t.length - 1 ? (t[n] = t[0], t[0] = o) : (t[n] = t[n + 1], t[n + 1] = o);
304
304
  }
305
- function nt(e) {
305
+ function et(e) {
306
306
  const { siblings: t, index: n } = J(e);
307
307
  return t === void 0 ? 0 : (t.splice(n, 1), t.length);
308
308
  }
309
- function kt(e, t, n) {
309
+ function St(e, t, n) {
310
310
  const { siblings: o, index: s } = J(n);
311
311
  o !== void 0 && (t === "before" ? o.splice(s, 0, e) : o.splice(s + 1, 0, e));
312
312
  }
313
- function Tt(e, t) {
313
+ function Nt(e, t) {
314
314
  const { siblings: n, index: o } = J(e);
315
315
  n !== void 0 && (n[o] = t, t.children = [e]);
316
316
  }
317
- function _t(e, t, n) {
318
- if (nt(t), n.parent?.parent || (t.direction = n.direction), e === "in")
317
+ function Tt(e, t, n) {
318
+ if (et(t), n.parent?.parent || (t.direction = n.direction), e === "in")
319
319
  n.children ? n.children.push(t) : n.children = [t];
320
320
  else {
321
321
  t.direction !== void 0 && (t.direction = n.direction);
@@ -324,7 +324,7 @@ function _t(e, t, n) {
324
324
  e === "before" ? o.splice(s, 0, t) : o.splice(s + 1, 0, t);
325
325
  }
326
326
  }
327
- const Lt = function({ map: e, direction: t }, n) {
327
+ const _t = function({ map: e, direction: t }, n) {
328
328
  if (t === 0)
329
329
  return 0;
330
330
  if (t === 1)
@@ -333,32 +333,32 @@ const Lt = function({ map: e, direction: t }, n) {
333
333
  const o = e.querySelector(".lhs")?.childElementCount || 0, s = e.querySelector(".rhs")?.childElementCount || 0;
334
334
  return o <= s ? (n.direction = 0, 0) : (n.direction = 1, 1);
335
335
  }
336
- }, ot = function(e, t, n) {
336
+ }, tt = function(e, t, n) {
337
337
  const o = n.children[0].children[0], s = t.parentElement;
338
338
  if (s.tagName === "ME-PARENT") {
339
339
  if (ee(o), s.children[1])
340
340
  s.nextSibling.appendChild(n);
341
341
  else {
342
342
  const i = e.createChildren([n]);
343
- s.appendChild(ke(!0)), s.insertAdjacentElement("afterend", i);
343
+ s.appendChild(Te(!0)), s.insertAdjacentElement("afterend", i);
344
344
  }
345
345
  e.linkDiv(n.offsetParent);
346
- } else s.tagName === "ME-ROOT" && (Lt(e, o.nodeObj) === 0 ? e.container.querySelector(".lhs")?.appendChild(n) : e.container.querySelector(".rhs")?.appendChild(n), e.linkDiv());
347
- }, At = function(e, t) {
346
+ } else s.tagName === "ME-ROOT" && (_t(e, o.nodeObj) === 0 ? e.container.querySelector(".lhs")?.appendChild(n) : e.container.querySelector(".rhs")?.appendChild(n), e.linkDiv());
347
+ }, kt = function(e, t) {
348
348
  const n = e.parentNode;
349
349
  if (t === 0) {
350
350
  const o = n.parentNode.parentNode;
351
351
  o.tagName !== "ME-MAIN" && (o.previousSibling.children[1].remove(), o.remove());
352
352
  }
353
353
  n.parentNode.remove();
354
- }, st = {
354
+ }, nt = {
355
355
  before: "beforebegin",
356
356
  after: "afterend"
357
357
  }, ee = function(e) {
358
358
  const n = e.parentElement.parentElement.lastElementChild;
359
359
  n?.tagName === "svg" && n?.remove();
360
- }, Dt = function(e, t) {
361
- const n = e.nodeObj, o = Ce(n);
360
+ }, Lt = function(e, t) {
361
+ const n = e.nodeObj, o = Ee(n);
362
362
  o.style && t.style && (t.style = Object.assign(o.style, t.style));
363
363
  const s = Object.assign(n, t);
364
364
  Ne.call(this, e, s), this.linkDiv(), this.bus.fire("operation", {
@@ -366,15 +366,15 @@ const Lt = function({ map: e, direction: t }, n) {
366
366
  obj: s,
367
367
  origin: o
368
368
  });
369
- }, Te = function(e, t, n) {
369
+ }, _e = function(e, t, n) {
370
370
  if (!t) return null;
371
371
  const o = t.nodeObj;
372
372
  o.expanded === !1 && (e.expandNode(t, !0), t = e.findEle(o.id));
373
373
  const s = n || e.generateNewObj();
374
- o.children ? o.children.push(s) : o.children = [s], G(e.nodeData);
374
+ o.children ? o.children.push(s) : o.children = [s], V(e.nodeData);
375
375
  const { grp: i, top: l } = e.createWrapper(s);
376
- return ot(e, t, i), { newTop: l, newNodeObj: s };
377
- }, Mt = function(e, t, n) {
376
+ return tt(e, t, i), { newTop: l, newNodeObj: s };
377
+ }, Dt = function(e, t, n) {
378
378
  const o = t || this.currentNode;
379
379
  if (!o) return;
380
380
  const s = o.nodeObj;
@@ -395,14 +395,14 @@ const Lt = function({ map: e, direction: t }, n) {
395
395
  const a = o.closest("me-main").className === B.LHS ? 0 : 1;
396
396
  i.direction = a;
397
397
  }
398
- kt(i, e, s), G(this.nodeData);
398
+ St(i, e, s), V(this.nodeData);
399
399
  const l = o.parentElement, { grp: c, top: r } = this.createWrapper(i);
400
- l.parentElement.insertAdjacentElement(st[e], c), this.linkDiv(c.offsetParent), n || this.editTopic(r.firstChild), this.bus.fire("operation", {
400
+ l.parentElement.insertAdjacentElement(nt[e], c), this.linkDiv(c.offsetParent), n || this.editTopic(r.firstChild), this.bus.fire("operation", {
401
401
  name: "insertSibling",
402
402
  type: e,
403
403
  obj: i
404
404
  }), this.selectNode(r.firstChild, !0);
405
- }, Pt = function(e, t) {
405
+ }, At = function(e, t) {
406
406
  const n = e || this.currentNode;
407
407
  if (!n) return;
408
408
  ee(n);
@@ -410,40 +410,40 @@ const Lt = function({ map: e, direction: t }, n) {
410
410
  if (!o.parent)
411
411
  return;
412
412
  const s = t || this.generateNewObj();
413
- Tt(o, s), G(this.nodeData);
413
+ Nt(o, s), V(this.nodeData);
414
414
  const i = n.parentElement.parentElement, { grp: l, top: c } = this.createWrapper(s, !0);
415
- c.appendChild(ke(!0)), i.insertAdjacentElement("afterend", l);
415
+ c.appendChild(Te(!0)), i.insertAdjacentElement("afterend", l);
416
416
  const r = this.createChildren([i]);
417
417
  c.insertAdjacentElement("afterend", r), this.linkDiv(), t || this.editTopic(c.firstChild), this.selectNode(c.firstChild, !0), this.bus.fire("operation", {
418
418
  name: "insertParent",
419
419
  obj: s
420
420
  });
421
- }, Ot = function(e, t) {
421
+ }, Mt = function(e, t) {
422
422
  const n = e || this.currentNode;
423
423
  if (!n) return;
424
- const o = Te(this, n, t);
424
+ const o = _e(this, n, t);
425
425
  if (!o) return;
426
426
  const { newTop: s, newNodeObj: i } = o;
427
427
  this.bus.fire("operation", {
428
428
  name: "addChild",
429
429
  obj: i
430
430
  }), t || this.editTopic(s.firstChild), this.selectNode(s.firstChild, !0);
431
- }, $t = function(e, t) {
432
- const n = Ce(e.nodeObj);
431
+ }, Pt = function(e, t) {
432
+ const n = Ee(e.nodeObj);
433
433
  xe(n);
434
- const o = Te(this, t, n);
434
+ const o = _e(this, t, n);
435
435
  if (!o) return;
436
436
  const { newNodeObj: s } = o;
437
437
  this.selectNode(this.findEle(s.id)), this.bus.fire("operation", {
438
438
  name: "copyNode",
439
439
  obj: s
440
440
  });
441
- }, jt = function(e, t) {
441
+ }, Ot = function(e, t) {
442
442
  const n = [];
443
443
  for (let o = 0; o < e.length; o++) {
444
- const s = e[o], i = Ce(s.nodeObj);
444
+ const s = e[o], i = Ee(s.nodeObj);
445
445
  xe(i);
446
- const l = Te(this, t, i);
446
+ const l = _e(this, t, i);
447
447
  if (!l) return;
448
448
  const { newNodeObj: c } = l;
449
449
  n.push(c);
@@ -452,51 +452,51 @@ const Lt = function({ map: e, direction: t }, n) {
452
452
  name: "copyNodes",
453
453
  objs: n
454
454
  });
455
- }, Ht = function(e) {
455
+ }, $t = function(e) {
456
456
  const t = e || this.currentNode;
457
457
  if (!t) return;
458
458
  const n = t.nodeObj;
459
- St(n);
459
+ Et(n);
460
460
  const o = t.parentNode.parentNode;
461
461
  o.parentNode.insertBefore(o, o.previousSibling), this.linkDiv(), this.bus.fire("operation", {
462
462
  name: "moveUpNode",
463
463
  obj: n
464
464
  });
465
- }, It = function(e) {
465
+ }, Ht = function(e) {
466
466
  const t = e || this.currentNode;
467
467
  if (!t) return;
468
468
  const n = t.nodeObj;
469
- Nt(n);
469
+ Ct(n);
470
470
  const o = t.parentNode.parentNode;
471
471
  o.nextSibling ? o.nextSibling.insertAdjacentElement("afterend", o) : o.parentNode.prepend(o), this.linkDiv(), this.bus.fire("operation", {
472
472
  name: "moveDownNode",
473
473
  obj: n
474
474
  });
475
- }, Rt = function(e) {
476
- if (e = Ee(e), e.length === 0) return;
475
+ }, jt = function(e) {
476
+ if (e = Ce(e), e.length === 0) return;
477
477
  for (const n of e) {
478
- const o = n.nodeObj, s = nt(o);
479
- At(n, s);
478
+ const o = n.nodeObj, s = et(o);
479
+ kt(n, s);
480
480
  }
481
481
  const t = e[e.length - 1];
482
482
  this.selectNode(this.findEle(t.nodeObj.parent.id)), this.linkDiv(), this.bus.fire("operation", {
483
483
  name: "removeNodes",
484
484
  objs: e.map((n) => n.nodeObj)
485
485
  });
486
- }, _e = (e, t, n, o) => {
487
- e = Ee(e);
486
+ }, ke = (e, t, n, o) => {
487
+ e = Ce(e);
488
488
  let s = n.nodeObj;
489
489
  t === "in" && s.expanded === !1 && (o.expandNode(n, !0), n = o.findEle(s.id), s = n.nodeObj), t === "after" && (e = e.reverse());
490
490
  const i = [];
491
491
  for (const c of e) {
492
492
  const r = c.nodeObj;
493
- if (_t(t, r, s), G(o.nodeData), t === "in") {
493
+ if (Tt(t, r, s), V(o.nodeData), t === "in") {
494
494
  const a = c.parentElement;
495
- ot(o, n, a.parentElement);
495
+ tt(o, n, a.parentElement);
496
496
  } else {
497
497
  ee(c);
498
498
  const a = c.parentElement.parentNode;
499
- i.includes(a.parentElement) || i.push(a.parentElement), n.parentElement.parentNode.insertAdjacentElement(st[t], a);
499
+ i.includes(a.parentElement) || i.push(a.parentElement), n.parentElement.parentNode.insertAdjacentElement(nt[t], a);
500
500
  }
501
501
  }
502
502
  for (const c of i)
@@ -508,36 +508,36 @@ const Lt = function({ map: e, direction: t }, n) {
508
508
  objs: e.map((c) => c.nodeObj),
509
509
  toObj: s
510
510
  });
511
+ }, It = function(e, t) {
512
+ ke(e, "in", t, this);
513
+ }, Rt = function(e, t) {
514
+ ke(e, "before", t, this);
511
515
  }, Bt = function(e, t) {
512
- _e(e, "in", t, this);
513
- }, Ft = function(e, t) {
514
- _e(e, "before", t, this);
515
- }, Yt = function(e, t) {
516
- _e(e, "after", t, this);
517
- }, Wt = function(e) {
516
+ ke(e, "after", t, this);
517
+ }, Yt = function(e) {
518
518
  const t = e || this.currentNode;
519
519
  t && (t.nodeObj.dangerouslySetInnerHTML || this.editTopic(t));
520
- }, Xt = function(e, t) {
520
+ }, Wt = function(e, t) {
521
521
  e.text.textContent = t, e.nodeObj.topic = t, this.linkDiv();
522
- }, it = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
522
+ }, ot = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
523
523
  __proto__: null,
524
- addChild: Ot,
525
- beginEdit: Wt,
526
- copyNode: $t,
527
- copyNodes: jt,
528
- insertParent: Pt,
529
- insertSibling: Mt,
530
- moveDownNode: It,
531
- moveNodeAfter: Yt,
532
- moveNodeBefore: Ft,
533
- moveNodeIn: Bt,
534
- moveUpNode: Ht,
535
- removeNodes: Rt,
536
- reshapeNode: Dt,
524
+ addChild: Mt,
525
+ beginEdit: Yt,
526
+ copyNode: Pt,
527
+ copyNodes: Ot,
528
+ insertParent: At,
529
+ insertSibling: Dt,
530
+ moveDownNode: Ht,
531
+ moveNodeAfter: Bt,
532
+ moveNodeBefore: Rt,
533
+ moveNodeIn: It,
534
+ moveUpNode: $t,
535
+ removeNodes: jt,
536
+ reshapeNode: Lt,
537
537
  rmSubline: ee,
538
- setNodeTopic: Xt
538
+ setNodeTopic: Wt
539
539
  }, Symbol.toStringTag, { value: "Module" }));
540
- function zt(e) {
540
+ function Xt(e) {
541
541
  return {
542
542
  nodeData: e.isFocusMode ? e.nodeDataBackup : e.nodeData,
543
543
  arrows: e.arrows,
@@ -546,62 +546,62 @@ function zt(e) {
546
546
  theme: e.theme
547
547
  };
548
548
  }
549
- const Gt = function(e) {
549
+ const Ft = function(e) {
550
550
  const t = this.container, n = e.getBoundingClientRect(), o = t.getBoundingClientRect();
551
551
  if (n.top > o.bottom - 50 || n.bottom < o.top + 50 || n.left > o.right - 50 || n.right < o.left + 50) {
552
552
  const i = n.left + n.width / 2, l = n.top + n.height / 2, c = o.left + o.width / 2, r = o.top + o.height / 2, a = i - c, d = l - r;
553
553
  this.move(-a, -d, !0);
554
554
  }
555
- }, Vt = function(e, t, n) {
555
+ }, Gt = function(e, t, n) {
556
556
  this.clearSelection(), this.scrollIntoView(e), this.selection?.select(e), t && this.bus.fire("selectNewNode", e.nodeObj);
557
- }, qt = function(e) {
557
+ }, Vt = function(e) {
558
558
  this.selection?.select(e);
559
- }, Kt = function(e) {
559
+ }, zt = function(e) {
560
560
  this.selection?.deselect(e);
561
- }, Ut = function() {
561
+ }, Kt = function() {
562
562
  this.unselectNodes(this.currentNodes), this.unselectSummary(), this.unselectArrow();
563
563
  }, Le = function(e) {
564
564
  return JSON.stringify(e, (t, n) => {
565
565
  if (!(t === "parent" && typeof n != "string"))
566
566
  return n;
567
567
  });
568
- }, Jt = function() {
569
- const e = zt(this);
568
+ }, qt = function() {
569
+ const e = Xt(this);
570
570
  return Le(e);
571
- }, Zt = function() {
571
+ }, Ut = function() {
572
572
  return JSON.parse(this.getDataString());
573
- }, Qt = function() {
573
+ }, Jt = function() {
574
574
  this.editable = !0;
575
- }, en = function() {
575
+ }, Zt = function() {
576
576
  this.editable = !1;
577
- }, tn = function(e, t = { x: 0, y: 0 }) {
577
+ }, Qt = function(e, t = { x: 0, y: 0 }) {
578
578
  if (e < this.scaleMin && e < this.scaleVal || e > this.scaleMax && e > this.scaleVal) return;
579
- const n = this.container.getBoundingClientRect(), o = t.x ? t.x - n.left - n.width / 2 : 0, s = t.y ? t.y - n.top - n.height / 2 : 0, { dx: i, dy: l } = Ae(this), c = this.map.style.transform, { x: r, y: a } = Se(c), d = r - i, h = a - l, u = this.scaleVal, y = (-o + d) * (1 - e / u), v = (-s + h) * (1 - e / u);
580
- this.map.style.transform = `translate3d(${r - y}px, ${a - v}px, 0) scale(${e})`, this.scaleVal = e, this.bus.fire("scale", e);
581
- }, nn = function() {
579
+ const n = this.container.getBoundingClientRect(), o = t.x ? t.x - n.left - n.width / 2 : 0, s = t.y ? t.y - n.top - n.height / 2 : 0, { dx: i, dy: l } = De(this), c = this.map.style.transform, { x: r, y: a } = Se(c), d = r - i, h = a - l, u = this.scaleVal, y = (-o + d) * (1 - e / u), b = (-s + h) * (1 - e / u);
580
+ this.map.style.transform = `translate3d(${r - y}px, ${a - b}px, 0) scale(${e})`, this.scaleVal = e, this.bus.fire("scale", e);
581
+ }, en = function() {
582
582
  const e = this.nodes.offsetHeight / this.container.offsetHeight, t = this.nodes.offsetWidth / this.container.offsetWidth, n = 1 / Math.max(1, Math.max(e, t));
583
583
  this.scaleVal = n;
584
- const { dx: o, dy: s } = Ae(this, !0);
584
+ const { dx: o, dy: s } = De(this, !0);
585
585
  this.map.style.transform = `translate3d(${o}px, ${s}px, 0) scale(${n})`, this.bus.fire("scale", n);
586
- }, on = function(e, t, n = !1) {
586
+ }, tn = function(e, t, n = !1) {
587
587
  const { map: o, scaleVal: s, bus: i, container: l, nodes: c } = this;
588
588
  if (n && o.style.transition === "transform 0.3s")
589
589
  return;
590
590
  const r = o.style.transform;
591
591
  let { x: a, y: d } = Se(r);
592
- const h = l.getBoundingClientRect(), u = c.getBoundingClientRect(), y = u.left < h.right && u.right > h.left, v = u.top < h.bottom && u.bottom > h.top;
592
+ const h = l.getBoundingClientRect(), u = c.getBoundingClientRect(), y = u.left < h.right && u.right > h.left, b = u.top < h.bottom && u.bottom > h.top;
593
593
  if (y) {
594
594
  const p = u.left + e, g = u.right + e;
595
595
  (p >= h.right || g <= h.left) && (e = 0);
596
596
  }
597
- if (v) {
597
+ if (b) {
598
598
  const p = u.top + t, g = u.bottom + t;
599
599
  (p >= h.bottom || g <= h.top) && (t = 0);
600
600
  }
601
601
  a += e, d += t, n && (o.style.transition = "transform 0.3s", setTimeout(() => {
602
602
  o.style.transition = "none";
603
603
  }, 300)), o.style.transform = `translate3d(${a}px, ${d}px, 0) scale(${s})`, i.fire("move", { dx: e, dy: t });
604
- }, Ae = (e, t = !1) => {
604
+ }, De = (e, t = !1) => {
605
605
  const { container: n, map: o, nodes: s } = e;
606
606
  let i, l;
607
607
  if (e.alignment === "nodes" || t)
@@ -611,24 +611,22 @@ const Gt = function(e) {
611
611
  i = n.offsetWidth / 2 - a - d / 2, l = n.offsetHeight / 2 - r - h / 2, o.style.transformOrigin = `${a + d / 2}px 50%`;
612
612
  }
613
613
  return { dx: i, dy: l };
614
- }, sn = function() {
615
- const { map: e, container: t } = this, { dx: n, dy: o } = Ae(this);
614
+ }, nn = function() {
615
+ const { map: e, container: t } = this, { dx: n, dy: o } = De(this);
616
616
  t.scrollTop = 0, t.scrollLeft = 0, e.style.transform = `translate3d(${n}px, ${o}px, 0) scale(${this.scaleVal})`;
617
- }, rn = function(e) {
617
+ }, on = function(e) {
618
618
  e(this);
619
- }, ln = function(e) {
619
+ }, sn = function(e) {
620
620
  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());
621
- }, cn = function() {
621
+ }, rn = function() {
622
622
  this.isFocusMode = !1, this.tempDirection !== null && (this.nodeData = this.nodeDataBackup, this.direction = this.tempDirection, this.tempDirection = null, this.refresh(), this.toCenter());
623
- }, an = function() {
623
+ }, ln = function() {
624
624
  this.direction = 0, this.refresh(), this.toCenter(), this.bus.fire("changeDirection", this.direction);
625
- }, dn = function() {
625
+ }, cn = function() {
626
626
  this.direction = 1, this.refresh(), this.toCenter(), this.bus.fire("changeDirection", this.direction);
627
- }, hn = function() {
627
+ }, an = function() {
628
628
  this.direction = 2, this.refresh(), this.toCenter(), this.bus.fire("changeDirection", this.direction);
629
- }, fn = function(e) {
630
- this.locale = e, this.refresh();
631
- }, un = function(e, t) {
629
+ }, dn = function(e, t) {
632
630
  const n = e.nodeObj;
633
631
  typeof t == "boolean" ? n.expanded = t : n.expanded !== !1 ? n.expanded = !1 : n.expanded = !0;
634
632
  const o = e.getBoundingClientRect(), s = {
@@ -648,7 +646,7 @@ const Gt = function(e) {
648
646
  y: c.top
649
647
  }, a = s.x - r.x, d = s.y - r.y;
650
648
  this.move(a, d), this.bus.fire("expandNode", n);
651
- }, pn = function(e, t) {
649
+ }, hn = function(e, t) {
652
650
  const n = e.nodeObj, o = e.getBoundingClientRect(), s = {
653
651
  x: o.left,
654
652
  y: o.top
@@ -659,46 +657,45 @@ const Gt = function(e) {
659
657
  y: i.top
660
658
  }, c = s.x - l.x, r = s.y - l.y;
661
659
  this.move(c, r);
662
- }, gn = function(e) {
663
- 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)), G(this.nodeData), this.layout(), this.linkDiv();
664
- }, mn = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
660
+ }, fn = function(e) {
661
+ 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)), V(this.nodeData), this.layout(), this.linkDiv();
662
+ }, un = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
665
663
  __proto__: null,
666
- cancelFocus: cn,
667
- clearSelection: Ut,
668
- disableEdit: en,
669
- enableEdit: Qt,
670
- expandNode: un,
671
- expandNodeAll: pn,
672
- focusNode: ln,
673
- getData: Zt,
674
- getDataString: Jt,
675
- initLeft: an,
676
- initRight: dn,
677
- initSide: hn,
678
- install: rn,
679
- move: on,
680
- refresh: gn,
681
- scale: tn,
682
- scaleFit: nn,
683
- scrollIntoView: Gt,
684
- selectNode: Vt,
685
- selectNodes: qt,
686
- setLocale: fn,
664
+ cancelFocus: rn,
665
+ clearSelection: Kt,
666
+ disableEdit: Zt,
667
+ enableEdit: Jt,
668
+ expandNode: dn,
669
+ expandNodeAll: hn,
670
+ focusNode: sn,
671
+ getData: Ut,
672
+ getDataString: qt,
673
+ initLeft: ln,
674
+ initRight: cn,
675
+ initSide: an,
676
+ install: on,
677
+ move: tn,
678
+ refresh: fn,
679
+ scale: Qt,
680
+ scaleFit: en,
681
+ scrollIntoView: Ft,
682
+ selectNode: Gt,
683
+ selectNodes: Vt,
687
684
  stringifyData: Le,
688
- toCenter: sn,
689
- unselectNodes: Kt
690
- }, Symbol.toStringTag, { value: "Module" })), Oe = "MIND-ELIXIR-WAIT-COPY", yn = (e, t) => {
685
+ toCenter: nn,
686
+ unselectNodes: zt
687
+ }, Symbol.toStringTag, { value: "Module" })), Oe = "MIND-ELIXIR-WAIT-COPY", pn = (e, t) => {
691
688
  const n = e.map.querySelectorAll(`.${t}>me-wrapper>me-parent>me-tpc`);
692
689
  n.length !== 0 && e.selectNode(n[Math.ceil(n.length / 2) - 1]);
693
- }, vn = (e) => {
690
+ }, gn = (e) => {
694
691
  e.selectNode(e.map.querySelector("me-root>me-tpc"));
695
- }, bn = function(e, t) {
692
+ }, mn = function(e, t) {
696
693
  const n = t.parentElement.parentElement.parentElement.previousSibling;
697
694
  if (n) {
698
695
  const o = n.firstChild;
699
696
  e.selectNode(o);
700
697
  }
701
- }, wn = function(e, t) {
698
+ }, yn = function(e, t) {
702
699
  const n = t.parentElement.nextSibling;
703
700
  if (n && n.firstChild) {
704
701
  const o = n.firstChild.firstChild.firstChild;
@@ -708,8 +705,8 @@ const Gt = function(e) {
708
705
  const n = e.currentNode || e.currentNodes?.[0];
709
706
  if (!n) return;
710
707
  const o = n.nodeObj, s = n.offsetParent.offsetParent.parentElement;
711
- o.parent ? s.className === t ? wn(e, n) : o.parent?.parent ? bn(e, n) : vn(e) : yn(e, t);
712
- }, je = function(e, t) {
708
+ o.parent ? s.className === t ? yn(e, n) : o.parent?.parent ? mn(e, n) : gn(e) : pn(e, t);
709
+ }, He = function(e, t) {
713
710
  const n = e.currentNode;
714
711
  if (!n || !n.nodeObj.parent) return;
715
712
  const s = t + "Sibling", i = n.parentElement.parentElement[s];
@@ -724,7 +721,7 @@ const Gt = function(e) {
724
721
  e.scale(o - s, n);
725
722
  }
726
723
  };
727
- function xn(e, t) {
724
+ function bn(e, t) {
728
725
  t = t === !0 ? {} : t;
729
726
  const n = () => {
730
727
  e.currentArrow ? e.removeArrow() : e.currentSummary ? e.removeSummary(e.currentSummary.summaryObj.id) : e.currentNodes && e.removeNodes(e.currentNodes);
@@ -761,11 +758,11 @@ function xn(e, t) {
761
758
  else {
762
759
  if (r.metaKey || r.ctrlKey)
763
760
  return e.initSide();
764
- je(e, "previous");
761
+ He(e, "previous");
765
762
  }
766
763
  },
767
764
  ArrowDown: (r) => {
768
- r.altKey ? e.moveDownNode() : je(e, "next");
765
+ r.altKey ? e.moveDownNode() : He(e, "next");
769
766
  },
770
767
  ArrowLeft: (r) => {
771
768
  if (r.metaKey || r.ctrlKey)
@@ -811,7 +808,7 @@ function xn(e, t) {
811
808
  const c = (r) => {
812
809
  if (r.target instanceof HTMLElement && r.target.id === "input-box" || e.currentNodes.length === 0) return !1;
813
810
  if (r.clipboardData) {
814
- const a = Ee(e.currentNodes).map((h) => h.nodeObj), d = Le({
811
+ const a = Ce(e.currentNodes).map((h) => h.nodeObj), d = Le({
815
812
  magic: Oe,
816
813
  data: a
817
814
  });
@@ -836,7 +833,7 @@ function xn(e, t) {
836
833
  e.pasteHandler && e.pasteHandler(r);
837
834
  });
838
835
  }
839
- const Cn = function(e, t) {
836
+ const vn = function(e, t) {
840
837
  if (!t)
841
838
  return he(e), e;
842
839
  let n = e.querySelector(".insert-preview");
@@ -847,17 +844,17 @@ const Cn = function(e, t) {
847
844
  const t = e.querySelectorAll(".insert-preview");
848
845
  for (const n of t || [])
849
846
  n.remove();
850
- }, He = function(e, t) {
847
+ }, je = function(e, t) {
851
848
  for (const n of t) {
852
849
  const o = n.parentElement.parentElement.contains(e);
853
850
  if (!(e && e.tagName === "ME-TPC" && e !== n && !o && e.nodeObj.parent)) return !1;
854
851
  }
855
852
  return !0;
856
- }, En = function(e) {
853
+ }, wn = function(e) {
857
854
  const t = document.createElement("div");
858
855
  return t.className = "mind-elixir-ghost", e.container.appendChild(t), t;
859
856
  };
860
- class Sn {
857
+ class xn {
861
858
  mind;
862
859
  isMoving = !1;
863
860
  interval = null;
@@ -874,31 +871,31 @@ class Sn {
874
871
  this.isMoving = !1, this.interval && (clearInterval(this.interval), this.interval = null);
875
872
  }
876
873
  }
877
- function Nn(e) {
874
+ function En(e) {
878
875
  return {
879
876
  isDragging: !1,
880
877
  insertType: null,
881
878
  meet: null,
882
- ghost: En(e),
883
- edgeMoveController: new Sn(e),
879
+ ghost: wn(e),
880
+ edgeMoveController: new xn(e),
884
881
  startX: 0,
885
882
  startY: 0,
886
883
  pointerId: null
887
884
  };
888
885
  }
889
- const kn = 5;
886
+ const Cn = 5;
890
887
  function Ie(e, t, n, o = !1) {
891
888
  if (e.spacePressed) return !1;
892
889
  const s = n.target;
893
890
  if (s?.tagName !== "ME-TPC" || !s.nodeObj.parent) return !1;
894
891
  t.startX = n.clientX, t.startY = n.clientY, t.pointerId = n.pointerId, e.selection?.cancel();
895
892
  let i = e.currentNodes;
896
- return i?.includes(s) || (e.selectNode(s), i = e.currentNodes), e.dragged = i, o && lt(e, t), !0;
893
+ return i?.includes(s) || (e.selectNode(s), i = e.currentNodes), e.dragged = i, o && it(e, t), !0;
897
894
  }
898
- function rt(e, t, n) {
895
+ function st(e, t, n) {
899
896
  e.style.transform = `translate(${t - 10}px, ${n - 10}px)`, e.style.display = "block";
900
897
  }
901
- function lt(e, t) {
898
+ function it(e, t) {
902
899
  const { dragged: n } = e;
903
900
  if (!n) return;
904
901
  const o = document.activeElement;
@@ -907,30 +904,30 @@ function lt(e, t) {
907
904
  s.parentElement.parentElement.style.opacity = "0.5";
908
905
  e.dragMoveHelper.clear();
909
906
  }
910
- function Tn(e, t, n) {
907
+ function Sn(e, t, n) {
911
908
  const { dragged: o } = e;
912
909
  if (!o || t.pointerId !== n.pointerId) return;
913
910
  const s = n.clientX - t.startX, i = n.clientY - t.startY, l = Math.sqrt(s * s + i * i);
914
- if (!t.isDragging && l > kn && lt(e, t), !t.isDragging) return;
911
+ if (!t.isDragging && l > Cn && it(e, t), !t.isDragging) return;
915
912
  const c = e.container.getBoundingClientRect();
916
- rt(t.ghost, n.clientX - c.x, n.clientY - c.y), n.clientX < c.x + 50 ? t.edgeMoveController.move(1, 0) : n.clientX > c.x + c.width - 50 ? t.edgeMoveController.move(-1, 0) : n.clientY < c.y + 50 ? t.edgeMoveController.move(0, 1) : n.clientY > c.y + c.height - 50 ? t.edgeMoveController.move(0, -1) : t.edgeMoveController.stop(), he(t.meet);
913
+ st(t.ghost, n.clientX - c.x, n.clientY - c.y), n.clientX < c.x + 50 ? t.edgeMoveController.move(1, 0) : n.clientX > c.x + c.width - 50 ? t.edgeMoveController.move(-1, 0) : n.clientY < c.y + 50 ? t.edgeMoveController.move(0, 1) : n.clientY > c.y + c.height - 50 ? t.edgeMoveController.move(0, -1) : t.edgeMoveController.stop(), he(t.meet);
917
914
  const r = 12 * e.scaleVal, a = document.elementFromPoint(n.clientX, n.clientY - r);
918
- if (He(a, o)) {
915
+ if (je(a, o)) {
919
916
  t.meet = a;
920
917
  const d = a.getBoundingClientRect(), h = d.y;
921
918
  n.clientY > h + d.height ? t.insertType = "after" : t.insertType = "in";
922
919
  } else {
923
920
  const d = document.elementFromPoint(n.clientX, n.clientY + r);
924
- if (He(d, o)) {
921
+ if (je(d, o)) {
925
922
  t.meet = d;
926
923
  const u = d.getBoundingClientRect().y;
927
924
  n.clientY < u ? t.insertType = "before" : t.insertType = "in";
928
925
  } else
929
926
  t.insertType = null, t.meet = null;
930
927
  }
931
- t.meet && Cn(t.meet, t.insertType);
928
+ t.meet && vn(t.meet, t.insertType);
932
929
  }
933
- function _n(e, t, n) {
930
+ function Nn(e, t, n) {
934
931
  const { dragged: o } = e;
935
932
  if (!(!o || t.pointerId !== n.pointerId)) {
936
933
  t.edgeMoveController.stop();
@@ -948,26 +945,26 @@ function pe(e, t) {
948
945
  t.meet && he(t.meet), t.ghost.style.display = "none", t.ghost.innerHTML = "", e.dragged = null, t.isDragging = !1, t.insertType = null, t.meet = null, t.pointerId = null;
949
946
  }
950
947
  }
951
- function Ln(e) {
948
+ function Tn(e) {
952
949
  return () => {
953
950
  };
954
951
  }
955
- function An(e) {
952
+ function _n(e) {
956
953
  const { dragMoveHelper: t } = e;
957
954
  let n = 0;
958
955
  e.spacePressed = !1;
959
956
  let o = null;
960
- const s = /* @__PURE__ */ new Map(), i = Nn(e);
957
+ const s = /* @__PURE__ */ new Map(), i = En(e);
961
958
  let l = null, c = null, r = null, a = null;
962
959
  const d = 500, h = 10, u = () => {
963
960
  l !== null && (clearTimeout(l), l = null, c = null, r = null, a = null);
964
961
  }, y = (f, w) => {
965
962
  f.hasPointerCapture && f.hasPointerCapture(w) && f.releasePointerCapture(w);
966
- }, v = (f, w) => {
963
+ }, b = (f, w) => {
967
964
  if (f.id === "input-box" || f.closest("#input-box")) return !1;
968
- const k = f.closest(".svg-label");
969
- if (k) {
970
- const M = k.dataset.svgId, te = k.dataset.type, Z = document.getElementById(M);
965
+ const T = f.closest(".svg-label");
966
+ if (T) {
967
+ const M = T.dataset.svgId, te = T.dataset.type, Z = document.getElementById(M);
971
968
  if (Z) {
972
969
  if (te === "arrow")
973
970
  return w ? e.editArrowLabel(Z) : e.selectArrow(Z), !0;
@@ -1009,56 +1006,56 @@ function An(e) {
1009
1006
  e.selectNode(w);
1010
1007
  else if (!e.editable)
1011
1008
  return;
1012
- v(w, !1);
1009
+ b(w, !1);
1013
1010
  }, g = (f) => {
1014
1011
  if (!e.editable) return;
1015
1012
  const w = f.target;
1016
- re(w) && e.beginEdit(w), v(w, !0);
1013
+ re(w) && e.beginEdit(w), b(w, !0);
1017
1014
  }, m = (f) => {
1018
1015
  if (f.pointerType === "mouse" || s.size > 1) return;
1019
- const w = (/* @__PURE__ */ new Date()).getTime(), k = w - n;
1020
- k < 300 && k > 0 && g(f), n = w;
1021
- }, b = (f) => {
1016
+ const w = (/* @__PURE__ */ new Date()).getTime(), T = w - n;
1017
+ T < 300 && T > 0 && g(f), n = w;
1018
+ }, v = (f) => {
1022
1019
  f.code === "Space" && (e.spacePressed = !0, e.container.classList.add("space-pressed"));
1023
- }, x = (f) => {
1020
+ }, E = (f) => {
1024
1021
  f.code === "Space" && (e.spacePressed = !1, e.container.classList.remove("space-pressed"));
1025
- }, L = (f) => {
1022
+ }, k = (f) => {
1026
1023
  if (f.pointerType === "touch" && (s.set(f.pointerId, { x: f.clientX, y: f.clientY }), s.size === 2)) {
1027
1024
  const [M, te] = Array.from(s.values());
1028
1025
  o = Pe(M, te), u();
1029
1026
  }
1030
1027
  t.moved = !1;
1031
- const w = f.target, k = e.mouseSelectionButton === 0 ? 2 : 0;
1028
+ const w = f.target, T = e.mouseSelectionButton === 0 ? 2 : 0;
1032
1029
  if (e.editable && i && (f.button === 0 || f.pointerType === "touch")) {
1033
1030
  if (f.pointerType === "touch" && s.size > 1)
1034
1031
  (i.isDragging || i.pointerId !== null) && pe(e, i);
1035
1032
  else if (f.pointerType === "touch" && s.size === 1)
1036
1033
  (re(w) || w.closest("me-tpc")) && (c = { x: f.clientX, y: f.clientY }, r = w, a = f.pointerId, l = window.setTimeout(() => {
1037
- Ie(e, i, f, !0) && (r && r.setPointerCapture(f.pointerId), rt(i.ghost, f.clientX, f.clientY)), l = null, c = null, r = null, a = null;
1034
+ Ie(e, i, f, !0) && (r && r.setPointerCapture(f.pointerId), st(i.ghost, f.clientX, f.clientY)), l = null, c = null, r = null, a = null;
1038
1035
  }, d));
1039
1036
  else if (f.pointerType === "mouse" && Ie(e, i, f, !1)) {
1040
1037
  w.setPointerCapture(f.pointerId);
1041
1038
  return;
1042
1039
  }
1043
1040
  }
1044
- const O = e.spacePressed && f.button === 0 && f.pointerType === "mouse", W = !e.editable || f.button === k && f.pointerType === "mouse" || f.pointerType === "touch";
1045
- !O && !W || (t.x = f.clientX, t.y = f.clientY, w.className !== "circle" && w.contentEditable !== "plaintext-only" && (t.mousedown = !0, w.setPointerCapture(f.pointerId)));
1046
- }, T = (f) => {
1041
+ const O = e.spacePressed && f.button === 0 && f.pointerType === "mouse", X = !e.editable || f.button === T && f.pointerType === "mouse" || f.pointerType === "touch";
1042
+ !O && !X || (t.x = f.clientX, t.y = f.clientY, w.className !== "circle" && w.contentEditable !== "plaintext-only" && (t.mousedown = !0, w.setPointerCapture(f.pointerId)));
1043
+ }, _ = (f) => {
1047
1044
  if (f.pointerType === "touch" && s.has(f.pointerId)) {
1048
1045
  if (s.set(f.pointerId, { x: f.clientX, y: f.clientY }), l !== null && c !== null && f.pointerId === a) {
1049
- const w = f.clientX - c.x, k = f.clientY - c.y;
1050
- Math.sqrt(w * w + k * k) > h && u();
1046
+ const w = f.clientX - c.x, T = f.clientY - c.y;
1047
+ Math.sqrt(w * w + T * T) > h && u();
1051
1048
  }
1052
1049
  if (s.size >= 2) {
1053
- const [w, k] = Array.from(s.values()), O = Pe(w, k);
1050
+ const [w, T] = Array.from(s.values()), O = Pe(w, T);
1054
1051
  if (o == null)
1055
1052
  o = O;
1056
1053
  else {
1057
1054
  if (o > 0) {
1058
- const W = O / o;
1059
- e.scale(e.scaleVal * W, {
1060
- x: (w.x + k.x) / 2,
1061
- y: (w.y + k.y) / 2
1055
+ const X = O / o;
1056
+ e.scale(e.scaleVal * X, {
1057
+ x: (w.x + T.x) / 2,
1058
+ y: (w.y + T.y) / 2
1062
1059
  });
1063
1060
  }
1064
1061
  o = O;
@@ -1066,49 +1063,49 @@ function An(e) {
1066
1063
  return;
1067
1064
  }
1068
1065
  }
1069
- if (!(i && i.pointerId !== null && (Tn(e, i, f), i.isDragging))) {
1066
+ if (!(i && i.pointerId !== null && (Sn(e, i, f), i.isDragging))) {
1070
1067
  if (f.target.contentEditable !== "plaintext-only" || e.spacePressed && t.mousedown) {
1071
- const w = f.clientX - t.x, k = f.clientY - t.y;
1072
- t.onMove(w, k);
1068
+ const w = f.clientX - t.x, T = f.clientY - t.y;
1069
+ t.onMove(w, T);
1073
1070
  }
1074
1071
  t.x = f.clientX, t.y = f.clientY;
1075
1072
  }
1076
- }, E = (f) => {
1073
+ }, C = (f) => {
1077
1074
  if (f.pointerType === "touch" && (s.delete(f.pointerId), s.size < 2 && (o = null), u()), i && i.pointerId !== null) {
1078
1075
  const w = i.isDragging;
1079
- if (_n(e, i, f), y(f.target, f.pointerId), w)
1076
+ if (Nn(e, i, f), y(f.target, f.pointerId), w)
1080
1077
  return;
1081
1078
  }
1082
1079
  t.mousedown && (y(f.target, f.pointerId), t.clear());
1083
- }, C = () => {
1080
+ }, x = () => {
1084
1081
  u(), t.mousedown && t.clear(), i && (i.isDragging || i.pointerId !== null) && pe(e, i);
1085
- }, S = (f) => {
1086
- f.pointerType === "touch" && (s.delete(f.pointerId), s.size < 2 && (o = null), u()), i && i.pointerId === f.pointerId && pe(e, i), E(f);
1087
1082
  }, N = (f) => {
1083
+ f.pointerType === "touch" && (s.delete(f.pointerId), s.size < 2 && (o = null), u()), i && i.pointerId === f.pointerId && pe(e, i), C(f);
1084
+ }, S = (f) => {
1088
1085
  if (f.preventDefault(), f.button !== 2 || !e.editable) return;
1089
1086
  const w = f.target;
1090
1087
  re(w) && !w.classList.contains("selected") && e.selectNode(w), setTimeout(() => {
1091
1088
  e.dragMoveHelper.moved || e.bus.fire("showContextMenu", f);
1092
1089
  }, 200);
1093
- }, D = (f) => {
1090
+ }, A = (f) => {
1094
1091
  f.stopPropagation(), f.preventDefault(), f.ctrlKey || f.metaKey ? f.deltaY < 0 ? ae(e, "in", e.dragMoveHelper) : e.scaleVal - e.scaleSensitivity > 0 && ae(e, "out", e.dragMoveHelper) : f.shiftKey ? e.move(-f.deltaY, 0) : e.move(-f.deltaX, -f.deltaY);
1095
- }, { container: _ } = e;
1096
- return Qe([
1097
- { dom: _, evt: "pointerdown", func: L },
1098
- { dom: _, evt: "pointermove", func: T },
1099
- { dom: _, evt: "pointerup", func: E },
1100
- { dom: _, evt: "pointercancel", func: S },
1101
- { dom: _, evt: "pointerdown", func: m },
1102
- { dom: _, evt: "click", func: p },
1103
- { dom: _, evt: "dblclick", func: g },
1104
- { dom: _, evt: "contextmenu", func: N },
1105
- { dom: _, evt: "wheel", func: typeof e.handleWheel == "function" ? e.handleWheel : D },
1106
- { dom: _, evt: "blur", func: C },
1107
- { dom: _, evt: "keydown", func: b },
1108
- { dom: _, evt: "keyup", func: x }
1092
+ }, { container: L } = e;
1093
+ return Je([
1094
+ { dom: L, evt: "pointerdown", func: k },
1095
+ { dom: L, evt: "pointermove", func: _ },
1096
+ { dom: L, evt: "pointerup", func: C },
1097
+ { dom: L, evt: "pointercancel", func: N },
1098
+ { dom: L, evt: "pointerdown", func: m },
1099
+ { dom: L, evt: "click", func: p },
1100
+ { dom: L, evt: "dblclick", func: g },
1101
+ { dom: L, evt: "contextmenu", func: S },
1102
+ { dom: L, evt: "wheel", func: typeof e.handleWheel == "function" ? e.handleWheel : A },
1103
+ { dom: L, evt: "blur", func: x },
1104
+ { dom: L, evt: "keydown", func: v },
1105
+ { dom: L, evt: "keyup", func: E }
1109
1106
  ]);
1110
1107
  }
1111
- function Dn() {
1108
+ function kn() {
1112
1109
  return {
1113
1110
  handlers: {},
1114
1111
  addListener: function(e, t) {
@@ -1132,7 +1129,7 @@ function Dn() {
1132
1129
  }
1133
1130
  };
1134
1131
  }
1135
- const H = "http://www.w3.org/2000/svg", fe = function(e) {
1132
+ const j = "http://www.w3.org/2000/svg", fe = function(e) {
1136
1133
  const t = e.clientWidth, n = e.clientHeight, o = e.dataset, s = Number(o.x), i = Number(o.y), l = o.anchor;
1137
1134
  let c = s;
1138
1135
  l === "middle" ? c = s - t / 2 : l === "end" && (c = s - t), e.style.left = `${c}px`, e.style.top = `${i - n / 2}px`, e.style.visibility = "visible";
@@ -1141,22 +1138,22 @@ const H = "http://www.w3.org/2000/svg", fe = function(e) {
1141
1138
  r.className = "svg-label", r.style.color = i || "#666";
1142
1139
  const a = "label-" + c;
1143
1140
  return r.id = a, r.innerHTML = e, r.dataset.type = l, r.dataset.svgId = c, r.dataset.x = t.toString(), r.dataset.y = n.toString(), r.dataset.anchor = s, r;
1144
- }, ct = function(e, t, n) {
1145
- const o = document.createElementNS(H, "path");
1146
- return A(o, {
1141
+ }, rt = function(e, t, n) {
1142
+ const o = document.createElementNS(j, "path");
1143
+ return D(o, {
1147
1144
  d: e,
1148
1145
  stroke: t || "#666",
1149
1146
  fill: "none",
1150
1147
  "stroke-width": n
1151
1148
  }), o;
1152
1149
  }, Q = function(e) {
1153
- const t = document.createElementNS(H, "svg");
1150
+ const t = document.createElementNS(j, "svg");
1154
1151
  return t.setAttribute("class", e), t.setAttribute("overflow", "visible"), t;
1155
1152
  }, Re = function() {
1156
- const e = document.createElementNS(H, "line");
1153
+ const e = document.createElementNS(j, "line");
1157
1154
  return e.setAttribute("stroke", "#4dc4ff"), e.setAttribute("fill", "none"), e.setAttribute("stroke-width", "2"), e.setAttribute("opacity", "0.45"), e;
1158
- }, Mn = function(e, t, n, o) {
1159
- const s = document.createElementNS(H, "g");
1155
+ }, Ln = function(e, t, n, o) {
1156
+ const s = document.createElementNS(j, "g");
1160
1157
  return [
1161
1158
  {
1162
1159
  name: "line",
@@ -1171,30 +1168,30 @@ const H = "http://www.w3.org/2000/svg", fe = function(e) {
1171
1168
  d: n
1172
1169
  }
1173
1170
  ].forEach((l, c) => {
1174
- const r = l.d, a = document.createElementNS(H, "path"), d = {
1171
+ const r = l.d, a = document.createElementNS(j, "path"), d = {
1175
1172
  d: r,
1176
1173
  stroke: o?.stroke || "rgb(227, 125, 116)",
1177
1174
  fill: "none",
1178
1175
  "stroke-linecap": o?.strokeLinecap || "cap",
1179
1176
  "stroke-width": String(o?.strokeWidth || "2")
1180
1177
  };
1181
- o?.opacity !== void 0 && (d.opacity = String(o.opacity)), A(a, d), c === 0 && a.setAttribute("stroke-dasharray", o?.strokeDasharray || "8,2");
1182
- const h = document.createElementNS(H, "path");
1183
- A(h, {
1178
+ o?.opacity !== void 0 && (d.opacity = String(o.opacity)), D(a, d), c === 0 && a.setAttribute("stroke-dasharray", o?.strokeDasharray || "8,2");
1179
+ const h = document.createElementNS(j, "path");
1180
+ D(h, {
1184
1181
  d: r,
1185
1182
  stroke: "transparent",
1186
1183
  fill: "none",
1187
1184
  "stroke-width": "15"
1188
1185
  }), s.appendChild(h), s.appendChild(a), s[l.name] = a;
1189
1186
  }), s;
1190
- }, at = function(e, t, n) {
1187
+ }, lt = function(e, t, n) {
1191
1188
  if (!t) return;
1192
1189
  const o = n.label, s = t.cloneNode(!0);
1193
1190
  e.nodes.appendChild(s), s.id = "input-box", s.textContent = o, s.contentEditable = "plaintext-only", s.spellcheck = !1, s.style.cssText = `
1194
1191
  left:${t.style.left};
1195
1192
  top:${t.style.top};
1196
1193
  max-width: 200px;
1197
- `, tt(s), e.scrollIntoView(s), s.addEventListener("keydown", (i) => {
1194
+ `, Qe(s), e.scrollIntoView(s), s.addEventListener("keydown", (i) => {
1198
1195
  i.stopPropagation();
1199
1196
  const l = i.key;
1200
1197
  if (l === "Enter" || l === "Tab") {
@@ -1212,259 +1209,118 @@ const H = "http://www.w3.org/2000/svg", fe = function(e) {
1212
1209
  obj: n
1213
1210
  }));
1214
1211
  });
1215
- }, Pn = function(e) {
1212
+ }, Dn = function(e) {
1216
1213
  const t = this.map.querySelector("me-root"), n = t.offsetTop, o = t.offsetLeft, s = t.offsetWidth, i = t.offsetHeight, l = this.map.querySelectorAll("me-main > me-wrapper");
1217
1214
  this.lines.innerHTML = "";
1218
1215
  for (let c = 0; c < l.length; c++) {
1219
- const r = l[c], a = r.querySelector("me-tpc"), { offsetLeft: d, offsetTop: h } = j(this.nodes, a), u = a.offsetWidth, y = a.offsetHeight, v = r.parentNode.className, p = this.generateMainBranch({ pT: n, pL: o, pW: s, pH: i, cT: h, cL: d, cW: u, cH: y, direction: v, containerHeight: this.nodes.offsetHeight }), g = this.theme.palette, m = a.nodeObj.branchColor || g[c % g.length];
1220
- if (a.style.borderColor = m, this.lines.appendChild(ct(p, m, "3")), e && e !== r)
1216
+ const r = l[c], a = r.querySelector("me-tpc"), { offsetLeft: d, offsetTop: h } = H(this.nodes, a), u = a.offsetWidth, y = a.offsetHeight, b = r.parentNode.className, p = this.generateMainBranch({ pT: n, pL: o, pW: s, pH: i, cT: h, cL: d, cW: u, cH: y, direction: b, containerHeight: this.nodes.offsetHeight }), g = this.theme.palette, m = a.nodeObj.branchColor || g[c % g.length];
1217
+ if (a.style.borderColor = m, this.lines.appendChild(rt(p, m, "3")), e && e !== r)
1221
1218
  continue;
1222
- const b = Q("subLines"), x = r.lastChild;
1223
- x.tagName === "svg" && x.remove(), r.appendChild(b), dt(this, b, m, r, v, !0);
1219
+ const v = Q("subLines"), E = r.lastChild;
1220
+ E.tagName === "svg" && E.remove(), r.appendChild(v), ct(this, v, m, r, b, !0);
1224
1221
  }
1225
1222
  this.labelContainer.innerHTML = "", this.renderArrow(), this.renderSummary(), this.bus.fire("linkDiv");
1226
- }, dt = function(e, t, n, o, s, i) {
1223
+ }, ct = function(e, t, n, o, s, i) {
1227
1224
  const l = o.firstChild, c = o.children[1].children;
1228
1225
  if (c.length === 0) return;
1229
1226
  const r = l.offsetTop, a = l.offsetLeft, d = l.offsetWidth, h = l.offsetHeight;
1230
1227
  for (let u = 0; u < c.length; u++) {
1231
- const y = c[u], v = y.firstChild, p = v.offsetTop, g = v.offsetLeft, m = v.offsetWidth, b = v.offsetHeight, x = v.firstChild.nodeObj.branchColor || n, L = e.generateSubBranch({ pT: r, pL: a, pW: d, pH: h, cT: p, cL: g, cW: m, cH: b, direction: s, isFirst: i });
1232
- t.appendChild(ct(L, x, "2"));
1233
- const T = v.children[1];
1234
- if (T) {
1235
- if (!T.expanded) continue;
1228
+ const y = c[u], b = y.firstChild, p = b.offsetTop, g = b.offsetLeft, m = b.offsetWidth, v = b.offsetHeight, E = b.firstChild.nodeObj.branchColor || n, k = e.generateSubBranch({ pT: r, pL: a, pW: d, pH: h, cT: p, cL: g, cW: m, cH: v, direction: s, isFirst: i });
1229
+ t.appendChild(rt(k, E, "2"));
1230
+ const _ = b.children[1];
1231
+ if (_) {
1232
+ if (!_.expanded) continue;
1236
1233
  } else
1237
1234
  continue;
1238
- dt(e, t, x, y, s);
1239
- }
1240
- }, Be = {
1241
- addChild: "插入子节点",
1242
- addParent: "插入父节点",
1243
- addSibling: "插入同级节点",
1244
- removeNode: "删除节点",
1245
- focus: "专注",
1246
- cancelFocus: "取消专注",
1247
- moveUp: "上移",
1248
- moveDown: "下移",
1249
- link: "连接",
1250
- linkBidirectional: "双向连接",
1251
- clickTips: "请点击目标节点",
1252
- summary: "摘要"
1253
- }, Fe = {
1254
- cn: Be,
1255
- zh_CN: Be,
1256
- zh_TW: {
1257
- addChild: "插入子節點",
1258
- addParent: "插入父節點",
1259
- addSibling: "插入同級節點",
1260
- removeNode: "刪除節點",
1261
- focus: "專注",
1262
- cancelFocus: "取消專注",
1263
- moveUp: "上移",
1264
- moveDown: "下移",
1265
- link: "連接",
1266
- linkBidirectional: "雙向連接",
1267
- clickTips: "請點擊目標節點",
1268
- summary: "摘要"
1269
- },
1270
- en: {
1271
- addChild: "Add child",
1272
- addParent: "Add parent",
1273
- addSibling: "Add sibling",
1274
- removeNode: "Remove node",
1275
- focus: "Focus Mode",
1276
- cancelFocus: "Cancel Focus Mode",
1277
- moveUp: "Move up",
1278
- moveDown: "Move down",
1279
- link: "Link",
1280
- linkBidirectional: "Bidirectional Link",
1281
- clickTips: "Please click the target node",
1282
- summary: "Summary"
1283
- },
1284
- ru: {
1285
- addChild: "Добавить дочерний элемент",
1286
- addParent: "Добавить родительский элемент",
1287
- addSibling: "Добавить на этом уровне",
1288
- removeNode: "Удалить узел",
1289
- focus: "Режим фокусировки",
1290
- cancelFocus: "Отменить режим фокусировки",
1291
- moveUp: "Поднять выше",
1292
- moveDown: "Опустить ниже",
1293
- link: "Ссылка",
1294
- linkBidirectional: "Двунаправленная ссылка",
1295
- clickTips: "Пожалуйста, нажмите на целевой узел",
1296
- summary: "Описание"
1297
- },
1298
- ja: {
1299
- addChild: "子ノードを追加する",
1300
- addParent: "親ノードを追加します",
1301
- addSibling: "兄弟ノードを追加する",
1302
- removeNode: "ノードを削除",
1303
- focus: "集中",
1304
- cancelFocus: "集中解除",
1305
- moveUp: "上へ移動",
1306
- moveDown: "下へ移動",
1307
- link: "コネクト",
1308
- linkBidirectional: "双方向リンク",
1309
- clickTips: "ターゲットノードをクリックしてください",
1310
- summary: "概要"
1311
- },
1312
- pt: {
1313
- addChild: "Adicionar item filho",
1314
- addParent: "Adicionar item pai",
1315
- addSibling: "Adicionar item irmao",
1316
- removeNode: "Remover item",
1317
- focus: "Modo Foco",
1318
- cancelFocus: "Cancelar Modo Foco",
1319
- moveUp: "Mover para cima",
1320
- moveDown: "Mover para baixo",
1321
- link: "Link",
1322
- linkBidirectional: "Link bidirecional",
1323
- clickTips: "Favor clicar no item alvo",
1324
- summary: "Resumo"
1325
- },
1326
- it: {
1327
- addChild: "Aggiungi figlio",
1328
- addParent: "Aggiungi genitore",
1329
- addSibling: "Aggiungi fratello",
1330
- removeNode: "Rimuovi nodo",
1331
- focus: "Modalità Focus",
1332
- cancelFocus: "Annulla Modalità Focus",
1333
- moveUp: "Sposta su",
1334
- moveDown: "Sposta giù",
1335
- link: "Collega",
1336
- linkBidirectional: "Collegamento bidirezionale",
1337
- clickTips: "Si prega di fare clic sul nodo di destinazione",
1338
- summary: "Unisci nodi"
1339
- },
1340
- es: {
1341
- addChild: "Agregar hijo",
1342
- addParent: "Agregar padre",
1343
- addSibling: "Agregar hermano",
1344
- removeNode: "Eliminar nodo",
1345
- focus: "Modo Enfoque",
1346
- cancelFocus: "Cancelar Modo Enfoque",
1347
- moveUp: "Mover hacia arriba",
1348
- moveDown: "Mover hacia abajo",
1349
- link: "Enlace",
1350
- linkBidirectional: "Enlace bidireccional",
1351
- clickTips: "Por favor haga clic en el nodo de destino",
1352
- summary: "Resumen"
1353
- },
1354
- fr: {
1355
- addChild: "Ajout enfant",
1356
- addParent: "Ajout parent",
1357
- addSibling: "Ajout voisin",
1358
- removeNode: "Supprimer",
1359
- focus: "Cibler",
1360
- cancelFocus: "Retour",
1361
- moveUp: "Monter",
1362
- moveDown: "Descendre",
1363
- link: "Lier",
1364
- linkBidirectional: "Lien bidirectionnel",
1365
- clickTips: "Cliquer sur le noeud cible",
1366
- summary: "Annoter"
1367
- },
1368
- ko: {
1369
- addChild: "자식 추가",
1370
- addParent: "부모 추가",
1371
- addSibling: "형제 추가",
1372
- removeNode: "노드 삭제",
1373
- focus: "포커스 모드",
1374
- cancelFocus: "포커스 모드 취소",
1375
- moveUp: "위로 이동",
1376
- moveDown: "아래로 이동",
1377
- link: "연결",
1378
- linkBidirectional: "양방향 연결",
1379
- clickTips: "대상 노드를 클릭하십시오",
1380
- summary: "요약"
1381
- },
1382
- ro: {
1383
- addChild: "Adaugă sub-nod",
1384
- addParent: "Adaugă nod părinte",
1385
- addSibling: "Adaugă nod la același nivel",
1386
- removeNode: "Șterge nodul",
1387
- focus: "Focalizare",
1388
- cancelFocus: "Anulează focalizarea",
1389
- moveUp: "Mută în sus",
1390
- moveDown: "Mută în jos",
1391
- link: "Creează legătură",
1392
- linkBidirectional: "Creează legătură bidirecțională",
1393
- clickTips: "Click pe nodul țintă",
1394
- summary: "Rezumat"
1395
- }
1235
+ ct(e, t, E, y, s);
1236
+ }
1237
+ }, An = {
1238
+ addChild: "Add child",
1239
+ addParent: "Add parent",
1240
+ addSibling: "Add sibling",
1241
+ removeNode: "Remove node",
1242
+ focus: "Focus Mode",
1243
+ cancelFocus: "Cancel Focus Mode",
1244
+ moveUp: "Move up",
1245
+ moveDown: "Move down",
1246
+ link: "Link",
1247
+ linkBidirectional: "Bidirectional Link",
1248
+ clickTips: "Please click the target node",
1249
+ summary: "Summary"
1396
1250
  };
1397
- function On(e, t) {
1398
- t = t === !0 ? {
1251
+ function Mn(e, t) {
1252
+ const n = {
1399
1253
  focus: !0,
1400
- link: !0
1401
- } : t;
1402
- const n = (E) => {
1403
- const C = document.createElement("div");
1404
- return C.innerText = E, C.className = "tips", C;
1405
- }, o = (E, C, S) => {
1406
- const N = document.createElement("li");
1407
- return N.id = E, N.innerHTML = `<span>${me(C)}</span><span ${S ? 'class="key"' : ""}>${me(S)}</span>`, N;
1408
- }, s = Fe[e.locale] ? e.locale : "en", i = Fe[s], l = o("cm-add_child", i.addChild, "Tab"), c = o("cm-add_parent", i.addParent, "Ctrl + Enter"), r = o("cm-add_sibling", i.addSibling, "Enter"), a = o("cm-remove_child", i.removeNode, "Delete"), d = o("cm-fucus", i.focus, ""), h = o("cm-unfucus", i.cancelFocus, ""), u = o("cm-up", i.moveUp, "PgUp"), y = o("cm-down", i.moveDown, "Pgdn"), v = o("cm-link", i.link, ""), p = o("cm-link-bidirectional", i.linkBidirectional, ""), g = o("cm-summary", i.summary, ""), m = document.createElement("ul");
1409
- if (m.className = "menu-list", m.appendChild(l), m.appendChild(c), m.appendChild(r), m.appendChild(a), t.focus && (m.appendChild(d), m.appendChild(h)), m.appendChild(u), m.appendChild(y), m.appendChild(g), t.link && (m.appendChild(v), m.appendChild(p)), t && t.extend)
1410
- for (let E = 0; E < t.extend.length; E++) {
1411
- const C = t.extend[E], S = o(C.name, C.name, C.key || "");
1412
- m.appendChild(S), S.onclick = (N) => {
1413
- C.onclick(N);
1254
+ link: !0,
1255
+ locale: An
1256
+ };
1257
+ t = t === !0 ? n : Object.assign(n, t);
1258
+ const o = (C) => {
1259
+ const x = document.createElement("div");
1260
+ return x.innerText = C, x.className = "tips", x;
1261
+ }, s = (C, x, N) => {
1262
+ const S = document.createElement("li");
1263
+ return S.id = C, S.innerHTML = `<span>${me(x)}</span><span ${N ? 'class="key"' : ""}>${me(N)}</span>`, S;
1264
+ }, i = t.locale, l = s("cm-add_child", i.addChild, "Tab"), c = s("cm-add_parent", i.addParent, "Ctrl + Enter"), r = s("cm-add_sibling", i.addSibling, "Enter"), a = s("cm-remove_child", i.removeNode, "Delete"), d = s("cm-fucus", i.focus, ""), h = s("cm-unfucus", i.cancelFocus, ""), u = s("cm-up", i.moveUp, "PgUp"), y = s("cm-down", i.moveDown, "Pgdn"), b = s("cm-link", i.link, ""), p = s("cm-link-bidirectional", i.linkBidirectional, ""), g = s("cm-summary", i.summary, ""), m = document.createElement("ul");
1265
+ if (m.className = "menu-list", m.appendChild(l), m.appendChild(c), m.appendChild(r), m.appendChild(a), t.focus && (m.appendChild(d), m.appendChild(h)), m.appendChild(u), m.appendChild(y), m.appendChild(g), t.link && (m.appendChild(b), m.appendChild(p)), t && t.extend)
1266
+ for (let C = 0; C < t.extend.length; C++) {
1267
+ const x = t.extend[C], N = s(x.name, x.name, x.key || "");
1268
+ m.appendChild(N), N.onclick = (S) => {
1269
+ x.onclick(S);
1414
1270
  };
1415
1271
  }
1416
- const b = document.createElement("div");
1417
- b.className = "context-menu", b.appendChild(m), b.hidden = !0, e.container.append(b);
1418
- let x = !0;
1419
- const L = (E) => {
1420
- const C = E.target;
1421
- if (re(C)) {
1422
- C.parentElement.tagName === "ME-ROOT" ? x = !0 : x = !1, x ? (d.className = "disabled", u.className = "disabled", y.className = "disabled", c.className = "disabled", r.className = "disabled", a.className = "disabled") : (d.className = "", u.className = "", y.className = "", c.className = "", r.className = "", a.className = ""), b.hidden = !1, m.style.top = "", m.style.bottom = "", m.style.left = "", m.style.right = "";
1423
- const S = m.offsetHeight, N = m.offsetWidth, D = m.getBoundingClientRect(), _ = E.clientY - D.top, R = E.clientX - D.left;
1424
- S + _ > window.innerHeight ? (m.style.top = "", m.style.bottom = "0px") : (m.style.bottom = "", m.style.top = _ + 15 + "px"), N + R > window.innerWidth ? (m.style.left = "", m.style.right = "0px") : (m.style.right = "", m.style.left = R + 10 + "px");
1272
+ const v = document.createElement("div");
1273
+ v.className = "context-menu", v.appendChild(m), v.hidden = !0, e.container.append(v);
1274
+ let E = !0;
1275
+ const k = (C) => {
1276
+ const x = C.target;
1277
+ if (re(x)) {
1278
+ x.parentElement.tagName === "ME-ROOT" ? E = !0 : E = !1, E ? (d.className = "disabled", u.className = "disabled", y.className = "disabled", c.className = "disabled", r.className = "disabled", a.className = "disabled") : (d.className = "", u.className = "", y.className = "", c.className = "", r.className = "", a.className = ""), v.hidden = !1, m.style.top = "", m.style.bottom = "", m.style.left = "", m.style.right = "";
1279
+ const N = m.offsetHeight, S = m.offsetWidth, A = m.getBoundingClientRect(), L = C.clientY - A.top, R = C.clientX - A.left;
1280
+ N + L > window.innerHeight ? (m.style.top = "", m.style.bottom = "0px") : (m.style.bottom = "", m.style.top = L + 15 + "px"), S + R > window.innerWidth ? (m.style.left = "", m.style.right = "0px") : (m.style.right = "", m.style.left = R + 10 + "px");
1425
1281
  }
1426
1282
  };
1427
- e.bus.addListener("showContextMenu", L), b.onclick = (E) => {
1428
- E.target === b && (b.hidden = !0);
1283
+ e.bus.addListener("showContextMenu", k), v.onclick = (C) => {
1284
+ C.target === v && (v.hidden = !0);
1429
1285
  }, l.onclick = () => {
1430
- e.addChild(), b.hidden = !0;
1286
+ e.addChild(), v.hidden = !0;
1431
1287
  }, c.onclick = () => {
1432
- e.insertParent(), b.hidden = !0;
1288
+ e.insertParent(), v.hidden = !0;
1433
1289
  }, r.onclick = () => {
1434
- x || (e.insertSibling("after"), b.hidden = !0);
1290
+ E || (e.insertSibling("after"), v.hidden = !0);
1435
1291
  }, a.onclick = () => {
1436
- x || (e.removeNodes(e.currentNodes || []), b.hidden = !0);
1292
+ E || (e.removeNodes(e.currentNodes || []), v.hidden = !0);
1437
1293
  }, d.onclick = () => {
1438
- x || (e.focusNode(e.currentNode), b.hidden = !0);
1294
+ E || (e.focusNode(e.currentNode), v.hidden = !0);
1439
1295
  }, h.onclick = () => {
1440
- e.cancelFocus(), b.hidden = !0;
1296
+ e.cancelFocus(), v.hidden = !0;
1441
1297
  }, u.onclick = () => {
1442
- x || (e.moveUpNode(), b.hidden = !0);
1298
+ E || (e.moveUpNode(), v.hidden = !0);
1443
1299
  }, y.onclick = () => {
1444
- x || (e.moveDownNode(), b.hidden = !0);
1300
+ E || (e.moveDownNode(), v.hidden = !0);
1445
1301
  };
1446
- const T = (E) => {
1447
- b.hidden = !0;
1448
- const C = e.currentNode, S = n(i.clickTips);
1449
- e.container.appendChild(S), e.map.addEventListener(
1302
+ const _ = (C) => {
1303
+ v.hidden = !0;
1304
+ const x = e.currentNode, N = o(i.clickTips);
1305
+ e.container.appendChild(N), e.map.addEventListener(
1450
1306
  "click",
1451
- (N) => {
1452
- N.preventDefault(), S.remove();
1453
- const D = N.target;
1454
- (D.parentElement.tagName === "ME-PARENT" || D.parentElement.tagName === "ME-ROOT") && e.createArrow(C, D, E);
1307
+ (S) => {
1308
+ S.preventDefault(), N.remove();
1309
+ const A = S.target;
1310
+ (A.parentElement.tagName === "ME-PARENT" || A.parentElement.tagName === "ME-ROOT") && e.createArrow(x, A, C);
1455
1311
  },
1456
1312
  {
1457
1313
  once: !0
1458
1314
  }
1459
1315
  );
1460
1316
  };
1461
- return v.onclick = () => T(), p.onclick = () => T({ bidirectional: !0 }), g.onclick = () => {
1462
- b.hidden = !0, e.createSummary(), e.unselectNodes(e.currentNodes);
1317
+ return b.onclick = () => _(), p.onclick = () => _({ bidirectional: !0 }), g.onclick = () => {
1318
+ v.hidden = !0, e.createSummary(), e.unselectNodes(e.currentNodes);
1463
1319
  }, () => {
1464
- l.onclick = null, c.onclick = null, r.onclick = null, a.onclick = null, d.onclick = null, h.onclick = null, u.onclick = null, y.onclick = null, v.onclick = null, g.onclick = null, b.onclick = null, e.container.oncontextmenu = null;
1320
+ l.onclick = null, c.onclick = null, r.onclick = null, a.onclick = null, d.onclick = null, h.onclick = null, u.onclick = null, y.onclick = null, b.onclick = null, g.onclick = null, v.onclick = null, e.container.oncontextmenu = null;
1465
1321
  };
1466
1322
  }
1467
- const $n = function(e) {
1323
+ const Pn = function(e) {
1468
1324
  return ["createSummary", "removeSummary", "finishEditSummary"].includes(e.name) ? {
1469
1325
  type: "summary",
1470
1326
  value: e.obj.id
@@ -1479,7 +1335,7 @@ const $n = function(e) {
1479
1335
  value: [e.obj.id]
1480
1336
  };
1481
1337
  };
1482
- function jn(e) {
1338
+ function On(e) {
1483
1339
  let t = [], n = -1, o = e.getData(), s = [];
1484
1340
  e.undo = function() {
1485
1341
  if (n > -1) {
@@ -1502,6 +1358,8 @@ function jn(e) {
1502
1358
  } catch {
1503
1359
  }
1504
1360
  }
1361
+ }, e.clearHistory = function() {
1362
+ t = [], n = -1, o = e.getData(), e.clearSelection();
1505
1363
  };
1506
1364
  const i = function(r) {
1507
1365
  if (r.name === "beginEdit") return;
@@ -1510,7 +1368,7 @@ function jn(e) {
1510
1368
  prev: o,
1511
1369
  operation: r.name,
1512
1370
  currentSelected: s.map((h) => h.id),
1513
- currentTarget: $n(r),
1371
+ currentTarget: Pn(r),
1514
1372
  next: a
1515
1373
  };
1516
1374
  t.push(d), o = a, n = t.length - 1;
@@ -1523,34 +1381,34 @@ function jn(e) {
1523
1381
  e.bus.removeListener("operation", i), e.bus.removeListener("selectNodes", c), e.container.removeEventListener("keydown", l);
1524
1382
  };
1525
1383
  }
1526
- const Hn = '<?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>', In = '<?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>', Rn = '<?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>', Bn = '<?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>', Fn = '<?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>', Yn = '<?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>', Wn = '<?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>', Xn = {
1527
- side: Hn,
1528
- left: In,
1529
- right: Rn,
1530
- full: Bn,
1531
- living: Fn,
1532
- zoomin: Yn,
1533
- zoomout: Wn
1534
- }, z = (e, t) => {
1384
+ const $n = '<?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>', Hn = '<?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>', jn = '<?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>', In = '<?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>', Rn = '<?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>', Bn = '<?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>', Yn = '<?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>', Wn = {
1385
+ side: $n,
1386
+ left: Hn,
1387
+ right: jn,
1388
+ full: In,
1389
+ living: Rn,
1390
+ zoomin: Bn,
1391
+ zoomout: Yn
1392
+ }, G = (e, t) => {
1535
1393
  const n = document.createElement("span");
1536
- return n.id = e, n.innerHTML = Xn[t], n;
1394
+ return n.id = e, n.innerHTML = Wn[t], n;
1537
1395
  };
1538
- function zn(e) {
1539
- const t = document.createElement("div"), n = z("fullscreen", "full"), o = z("toCenter", "living"), s = z("zoomout", "zoomout"), i = z("zoomin", "zoomin");
1396
+ function Xn(e) {
1397
+ const t = document.createElement("div"), n = G("fullscreen", "full"), o = G("toCenter", "living"), s = G("zoomout", "zoomout"), i = G("zoomin", "zoomin");
1540
1398
  t.appendChild(n), t.appendChild(o), t.appendChild(s), t.appendChild(i), t.className = "mind-elixir-toolbar rb";
1541
1399
  let l = null;
1542
1400
  const c = () => {
1543
- const a = e.container.getBoundingClientRect(), d = Se(e.map.style.transform), h = a.width / 2, u = a.height / 2, y = (h - d.x) / e.scaleVal, v = (u - d.y) / e.scaleVal;
1401
+ const a = e.container.getBoundingClientRect(), d = Se(e.map.style.transform), h = a.width / 2, u = a.height / 2, y = (h - d.x) / e.scaleVal, b = (u - d.y) / e.scaleVal;
1544
1402
  l = {
1545
1403
  containerRect: a,
1546
1404
  currentTransform: d,
1547
1405
  mapCenterX: y,
1548
- mapCenterY: v
1406
+ mapCenterY: b
1549
1407
  };
1550
1408
  }, r = () => {
1551
1409
  if (l) {
1552
- const a = e.container.getBoundingClientRect(), d = a.width / 2, h = a.height / 2, u = d - l.mapCenterX * e.scaleVal, y = h - l.mapCenterY * e.scaleVal, v = u - l.currentTransform.x, p = y - l.currentTransform.y;
1553
- e.move(v, p);
1410
+ const a = e.container.getBoundingClientRect(), d = a.width / 2, h = a.height / 2, u = d - l.mapCenterX * e.scaleVal, y = h - l.mapCenterY * e.scaleVal, b = u - l.currentTransform.x, p = y - l.currentTransform.y;
1411
+ e.move(b, p);
1554
1412
  }
1555
1413
  };
1556
1414
  return e.el.addEventListener("fullscreenchange", r), n.onclick = () => {
@@ -1563,8 +1421,8 @@ function zn(e) {
1563
1421
  e.scale(e.scaleVal + e.scaleSensitivity);
1564
1422
  }, t;
1565
1423
  }
1566
- function Gn(e) {
1567
- const t = document.createElement("div"), n = z("tbltl", "left"), o = z("tbltr", "right"), s = z("tblts", "side");
1424
+ function Fn(e) {
1425
+ const t = document.createElement("div"), n = G("tbltl", "left"), o = G("tbltr", "right"), s = G("tblts", "side");
1568
1426
  return t.appendChild(n), t.appendChild(o), t.appendChild(s), t.className = "mind-elixir-toolbar lt", n.onclick = () => {
1569
1427
  e.initLeft();
1570
1428
  }, o.onclick = () => {
@@ -1573,10 +1431,10 @@ function Gn(e) {
1573
1431
  e.initSide();
1574
1432
  }, t;
1575
1433
  }
1576
- function Vn(e) {
1577
- e.container.append(zn(e)), e.container.append(Gn(e));
1434
+ function Gn(e) {
1435
+ e.container.append(Xn(e)), e.container.append(Fn(e));
1578
1436
  }
1579
- class qn {
1437
+ class Vn {
1580
1438
  _listeners = /* @__PURE__ */ new Map();
1581
1439
  addEventListener(t, n) {
1582
1440
  const o = this._listeners.get(t) ?? /* @__PURE__ */ new Set();
@@ -1599,15 +1457,15 @@ class qn {
1599
1457
  off = this.removeEventListener;
1600
1458
  emit = this.dispatchEvent;
1601
1459
  }
1602
- const Ye = (e, t = "px") => typeof e == "number" ? e + t : e, F = ({ style: e }, t, n) => {
1460
+ const Be = (e, t = "px") => typeof e == "number" ? e + t : e, Y = ({ style: e }, t, n) => {
1603
1461
  if (typeof t == "object")
1604
1462
  for (const [o, s] of Object.entries(t))
1605
- s !== void 0 && (e[o] = Ye(s));
1606
- else n !== void 0 && (e[t] = Ye(n));
1607
- }, We = (e = 0, t = 0, n = 0, o = 0) => {
1463
+ s !== void 0 && (e[o] = Be(s));
1464
+ else n !== void 0 && (e[t] = Be(n));
1465
+ }, Ye = (e = 0, t = 0, n = 0, o = 0) => {
1608
1466
  const s = { x: e, y: t, width: n, height: o, top: t, left: e, right: e + n, bottom: t + o };
1609
1467
  return { ...s, toJSON: () => JSON.stringify(s) };
1610
- }, Kn = (e) => {
1468
+ }, zn = (e) => {
1611
1469
  let t, n = -1, o = !1;
1612
1470
  return {
1613
1471
  next: (...s) => {
@@ -1619,7 +1477,7 @@ const Ye = (e, t = "px") => typeof e == "number" ? e + t : e, F = ({ style: e },
1619
1477
  cancelAnimationFrame(n), o = !1;
1620
1478
  }
1621
1479
  };
1622
- }, Xe = (e, t, n = "touch") => {
1480
+ }, We = (e, t, n = "touch") => {
1623
1481
  switch (n) {
1624
1482
  case "center": {
1625
1483
  const o = t.left + t.width / 2, s = t.top + t.height / 2;
@@ -1630,16 +1488,16 @@ const Ye = (e, t = "px") => typeof e == "number" ? e + t : e, F = ({ style: e },
1630
1488
  case "touch":
1631
1489
  return e.right >= t.left && e.left <= t.right && e.bottom >= t.top && e.top <= t.bottom;
1632
1490
  }
1633
- }, Un = () => matchMedia("(hover: none), (pointer: coarse)").matches, Jn = () => "safari" in window, ve = (e) => Array.isArray(e) ? e : [e], ht = (e) => (t, n, o, s = {}) => {
1634
- (t instanceof HTMLCollection || t instanceof NodeList) && (t = Array.from(t)), n = ve(n), t = ve(t);
1491
+ }, Kn = () => matchMedia("(hover: none), (pointer: coarse)").matches, qn = () => "safari" in window, be = (e) => Array.isArray(e) ? e : [e], at = (e) => (t, n, o, s = {}) => {
1492
+ (t instanceof HTMLCollection || t instanceof NodeList) && (t = Array.from(t)), n = be(n), t = be(t);
1635
1493
  for (const i of t)
1636
1494
  if (i)
1637
1495
  for (const l of n)
1638
1496
  i[e](l, o, { capture: !1, ...s });
1639
- }, Y = ht("addEventListener"), $ = ht("removeEventListener"), ne = (e) => {
1497
+ }, W = at("addEventListener"), $ = at("removeEventListener"), ne = (e) => {
1640
1498
  const { clientX: t, clientY: n, target: o } = e.touches?.[0] ?? e;
1641
1499
  return { x: t, y: n, target: o };
1642
- }, q = (e, t = document) => ve(e).map((n) => typeof n == "string" ? Array.from(t.querySelectorAll(n)) : n instanceof Element ? n : null).flat().filter(Boolean), Zn = (e, t) => t.some((n) => typeof n == "number" ? e.button === n : typeof n == "object" ? n.button !== e.button ? !1 : n.modifiers.every((o) => {
1500
+ }, K = (e, t = document) => be(e).map((n) => typeof n == "string" ? Array.from(t.querySelectorAll(n)) : n instanceof Element ? n : null).flat().filter(Boolean), Un = (e, t) => t.some((n) => typeof n == "number" ? e.button === n : typeof n == "object" ? n.button !== e.button ? !1 : n.modifiers.every((o) => {
1643
1501
  switch (o) {
1644
1502
  case "alt":
1645
1503
  return e.altKey;
@@ -1648,18 +1506,18 @@ const Ye = (e, t = "px") => typeof e == "number" ? e + t : e, F = ({ style: e },
1648
1506
  case "shift":
1649
1507
  return e.shiftKey;
1650
1508
  }
1651
- }) : !1), { abs: X, max: ze, min: Ge, ceil: Ve } = Math, qe = (e = []) => ({
1509
+ }) : !1), { abs: F, max: Xe, min: Fe, ceil: Ge } = Math, Ve = (e = []) => ({
1652
1510
  stored: e,
1653
1511
  selected: [],
1654
1512
  touched: [],
1655
1513
  changed: { added: [], removed: [] }
1656
1514
  });
1657
- class Qn extends qn {
1515
+ class Jn extends Vn {
1658
1516
  static version = "mind-elixir-fork";
1659
1517
  // Options
1660
1518
  _options;
1661
1519
  // Selection store
1662
- _selection = qe();
1520
+ _selection = Ve();
1663
1521
  // Area element and clipping element
1664
1522
  _area;
1665
1523
  _clippingElement;
@@ -1672,7 +1530,7 @@ class Qn extends qn {
1672
1530
  _latestElement;
1673
1531
  // Dynamically constructed area rect
1674
1532
  _areaLocation = { y1: 0, x2: 0, y2: 0, x1: 0 };
1675
- _areaRect = We();
1533
+ _areaRect = Ye();
1676
1534
  // If a single click is being performed, it's a single-click until the user dragged the mouse
1677
1535
  _singleClick = !0;
1678
1536
  _frame;
@@ -1727,38 +1585,38 @@ class Qn extends qn {
1727
1585
  for (const i of Object.getOwnPropertyNames(Object.getPrototypeOf(this)))
1728
1586
  typeof this[i] == "function" && (this[i] = this[i].bind(this));
1729
1587
  const { document: n, selectionAreaClass: o, selectionContainerClass: s } = this._options;
1730
- this._area = n.createElement("div"), this._clippingElement = n.createElement("div"), this._clippingElement.appendChild(this._area), this._area.classList.add(o), s && this._clippingElement.classList.add(s), F(this._area, {
1588
+ this._area = n.createElement("div"), this._clippingElement = n.createElement("div"), this._clippingElement.appendChild(this._area), this._area.classList.add(o), s && this._clippingElement.classList.add(s), Y(this._area, {
1731
1589
  willChange: "top, left, bottom, right, width, height",
1732
1590
  top: 0,
1733
1591
  left: 0,
1734
1592
  position: "fixed"
1735
- }), F(this._clippingElement, {
1593
+ }), Y(this._clippingElement, {
1736
1594
  overflow: "hidden",
1737
1595
  position: "fixed",
1738
1596
  transform: "translate3d(0, 0, 0)",
1739
1597
  // https://stackoverflow.com/a/38268846
1740
1598
  pointerEvents: "none",
1741
1599
  zIndex: "1"
1742
- }), this._frame = Kn((i) => {
1600
+ }), this._frame = zn((i) => {
1743
1601
  this._recalculateSelectionAreaRect(), this._updateElementSelection(), this._emitEvent("move", i), this._redrawSelectionArea();
1744
1602
  }), this.enable();
1745
1603
  }
1746
1604
  _toggleStartEvents(t = !0) {
1747
- const { document: n, features: o } = this._options, s = t ? Y : $;
1605
+ const { document: n, features: o } = this._options, s = t ? W : $;
1748
1606
  s(n, "mousedown", this._onTapStart), o.touch && s(n, "touchstart", this._onTapStart, { passive: !1 });
1749
1607
  }
1750
1608
  _onTapStart(t, n = !1) {
1751
1609
  const { x: o, y: s, target: i } = ne(t), { document: l, startAreas: c, boundaries: r, features: a, behaviour: d } = this._options, h = i.getBoundingClientRect();
1752
- if (t instanceof MouseEvent && !Zn(t, d.triggers))
1610
+ if (t instanceof MouseEvent && !Un(t, d.triggers))
1753
1611
  return;
1754
- const u = q(c, l), y = q(r, l);
1755
- this._targetElement = y.find((m) => Xe(m.getBoundingClientRect(), h));
1756
- const v = t.composedPath(), p = u.find((m) => v.includes(m));
1757
- if (this._targetBoundary = y.find((m) => v.includes(m)), !this._targetElement || !p || !this._targetBoundary || !n && this._emitEvent("beforestart", t) === !1)
1612
+ const u = K(c, l), y = K(r, l);
1613
+ this._targetElement = y.find((m) => We(m.getBoundingClientRect(), h));
1614
+ const b = t.composedPath(), p = u.find((m) => b.includes(m));
1615
+ if (this._targetBoundary = y.find((m) => b.includes(m)), !this._targetElement || !p || !this._targetBoundary || !n && this._emitEvent("beforestart", t) === !1)
1758
1616
  return;
1759
1617
  this._areaLocation = { x1: o, y1: s, x2: 0, y2: 0 };
1760
1618
  const g = l.scrollingElement ?? l.body;
1761
- this._scrollDelta = { x: g.scrollLeft, y: g.scrollTop }, this._singleClick = !0, this.clearSelection(!1, !0), Y(l, ["touchmove", "mousemove"], this._delayedTapMove, { passive: !1 }), Y(l, ["mouseup", "touchcancel", "touchend"], this._onTapStop), Y(l, "scroll", this._onScroll), a.deselectOnBlur && (this._targetBoundaryScrolled = !1, Y(this._targetBoundary, "scroll", this._onStartAreaScroll));
1619
+ this._scrollDelta = { x: g.scrollLeft, y: g.scrollTop }, this._singleClick = !0, this.clearSelection(!1, !0), W(l, ["touchmove", "mousemove"], this._delayedTapMove, { passive: !1 }), W(l, ["mouseup", "touchcancel", "touchend"], this._onTapStop), W(l, "scroll", this._onScroll), a.deselectOnBlur && (this._targetBoundaryScrolled = !1, W(this._targetBoundary, "scroll", this._onStartAreaScroll));
1762
1620
  }
1763
1621
  _onSingleTap(t) {
1764
1622
  const {
@@ -1803,33 +1661,33 @@ class Qn extends qn {
1803
1661
  } = this._options, { x1: i, y1: l } = this._areaLocation, { x: c, y: r } = ne(t);
1804
1662
  if (
1805
1663
  // Single number for both coordinates
1806
- typeof s == "number" && X(c + r - (i + l)) >= s || // Different x and y threshold
1807
- typeof s == "object" && X(c - i) >= s.x || X(r - l) >= s.y
1664
+ typeof s == "number" && F(c + r - (i + l)) >= s || // Different x and y threshold
1665
+ typeof s == "object" && F(c - i) >= s.x || F(r - l) >= s.y
1808
1666
  ) {
1809
1667
  if ($(o, ["mousemove", "touchmove"], this._delayedTapMove, { passive: !1 }), this._emitEvent("beforedrag", t) === !1) {
1810
1668
  $(o, ["mouseup", "touchcancel", "touchend"], this._onTapStop);
1811
1669
  return;
1812
1670
  }
1813
- Y(o, ["mousemove", "touchmove"], this._onTapMove, { passive: !1 }), F(this._area, "display", "block"), q(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 && (Y(this._targetElement, "wheel", this._wheelScroll, { passive: !1 }), Y(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);
1671
+ W(o, ["mousemove", "touchmove"], this._onTapMove, { passive: !1 }), Y(this._area, "display", "block"), K(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 && (W(this._targetElement, "wheel", this._wheelScroll, { passive: !1 }), W(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);
1814
1672
  }
1815
1673
  this._handleMoveEvent(t);
1816
1674
  }
1817
1675
  _setupSelectionArea() {
1818
1676
  const { _clippingElement: t, _targetElement: n, _area: o } = this, s = this._targetRect = n.getBoundingClientRect();
1819
- this._scrollAvailable ? (F(t, {
1677
+ this._scrollAvailable ? (Y(t, {
1820
1678
  top: s.top,
1821
1679
  left: s.left,
1822
1680
  width: s.width,
1823
1681
  height: s.height
1824
- }), F(o, {
1682
+ }), Y(o, {
1825
1683
  marginTop: -s.top,
1826
1684
  marginLeft: -s.left
1827
- })) : (F(t, {
1685
+ })) : (Y(t, {
1828
1686
  top: 0,
1829
1687
  left: 0,
1830
1688
  width: "100%",
1831
1689
  height: "100%"
1832
- }), F(o, {
1690
+ }), Y(o, {
1833
1691
  marginTop: 0,
1834
1692
  marginLeft: 0
1835
1693
  }));
@@ -1847,7 +1705,7 @@ class Qn extends qn {
1847
1705
  }
1848
1706
  const d = this._options.mindElixirInstance;
1849
1707
  if (d && d.move) {
1850
- const h = n.x ? Ve(n.x / l) : 0, u = n.y ? Ve(n.y / l) : 0;
1708
+ const h = n.x ? Ge(n.x / l) : 0, u = n.y ? Ge(n.y / l) : 0;
1851
1709
  (h || u) && (d.move(-h, -u), o.x1 -= h, o.y1 -= u);
1852
1710
  }
1853
1711
  i.next(t), requestAnimationFrame(a);
@@ -1859,7 +1717,7 @@ class Qn extends qn {
1859
1717
  }
1860
1718
  _handleMoveEvent(t) {
1861
1719
  const { features: n } = this._options;
1862
- (n.touch && Un() || this._scrollAvailable && Jn()) && t.preventDefault();
1720
+ (n.touch && Kn() || this._scrollAvailable && qn()) && t.preventDefault();
1863
1721
  }
1864
1722
  _onScroll() {
1865
1723
  const {
@@ -1892,9 +1750,9 @@ class Qn extends qn {
1892
1750
  scrolling: { startScrollMargins: d }
1893
1751
  }
1894
1752
  } = s;
1895
- r < i.left + d.x ? (t.x = -X(i.left - r + d.x), r = r < i.left ? i.left : r) : r > i.right - d.x ? (t.x = X(i.left + i.width - r - d.x), r = r > i.right ? i.right : r) : t.x = 0, a < i.top + d.y ? (t.y = -X(i.top - a + d.y), a = a < i.top ? i.top : a) : a > i.bottom - d.y ? (t.y = X(i.top + i.height - a - d.y), a = a > i.bottom ? i.bottom : a) : t.y = 0;
1896
- const h = Ge(l, r), u = Ge(c, a), y = ze(l, r), v = ze(c, a);
1897
- this._areaRect = We(h, u, y - h, v - u);
1753
+ r < i.left + d.x ? (t.x = -F(i.left - r + d.x), r = r < i.left ? i.left : r) : r > i.right - d.x ? (t.x = F(i.left + i.width - r - d.x), r = r > i.right ? i.right : r) : t.x = 0, a < i.top + d.y ? (t.y = -F(i.top - a + d.y), a = a < i.top ? i.top : a) : a > i.bottom - d.y ? (t.y = F(i.top + i.height - a - d.y), a = a > i.bottom ? i.bottom : a) : t.y = 0;
1754
+ const h = Fe(l, r), u = Fe(c, a), y = Xe(l, r), b = Xe(c, a);
1755
+ this._areaRect = Ye(h, u, y - h, b - u);
1898
1756
  }
1899
1757
  _redrawSelectionArea() {
1900
1758
  const { x: t, y: n, width: o, height: s } = this._areaRect, { style: i } = this._area;
@@ -1902,13 +1760,13 @@ class Qn extends qn {
1902
1760
  }
1903
1761
  _onTapStop(t, n) {
1904
1762
  const { document: o, features: s } = this._options, { _singleClick: i } = this;
1905
- $(this._targetElement, "scroll", this._onStartAreaScroll), $(o, ["mousemove", "touchmove"], this._delayedTapMove), $(o, ["touchmove", "mousemove"], this._onTapMove), $(o, ["mouseup", "touchcancel", "touchend"], this._onTapStop), $(o, "scroll", this._onScroll), this._keepSelection(), t && i && s.singleTap.allow ? this._onSingleTap(t) : !i && !n && (this._updateElementSelection(), this._emitEvent("stop", t)), this._scrollSpeed.x = 0, this._scrollSpeed.y = 0, $(this._targetElement, "wheel", this._wheelScroll, { passive: !0 }), $(this._options.document, "keydown", this._keyboardScroll, { passive: !0 }), this._clippingElement.remove(), this._frame?.cancel(), F(this._area, "display", "none");
1763
+ $(this._targetElement, "scroll", this._onStartAreaScroll), $(o, ["mousemove", "touchmove"], this._delayedTapMove), $(o, ["touchmove", "mousemove"], this._onTapMove), $(o, ["mouseup", "touchcancel", "touchend"], this._onTapStop), $(o, "scroll", this._onScroll), this._keepSelection(), t && i && s.singleTap.allow ? this._onSingleTap(t) : !i && !n && (this._updateElementSelection(), this._emitEvent("stop", t)), this._scrollSpeed.x = 0, this._scrollSpeed.y = 0, $(this._targetElement, "wheel", this._wheelScroll, { passive: !0 }), $(this._options.document, "keydown", this._keyboardScroll, { passive: !0 }), this._clippingElement.remove(), this._frame?.cancel(), Y(this._area, "display", "none");
1906
1764
  }
1907
1765
  _updateElementSelection() {
1908
1766
  const { _selectables: t, _options: n, _selection: o, _areaRect: s } = this, { stored: i, selected: l, touched: c } = o, { intersect: r, overlap: a } = n.behaviour, d = a === "invert", h = [], u = [], y = [];
1909
1767
  for (let p = 0; p < t.length; p++) {
1910
1768
  const g = t[p];
1911
- if (Xe(s, g.getBoundingClientRect(), r)) {
1769
+ if (We(s, g.getBoundingClientRect(), r)) {
1912
1770
  if (l.includes(g))
1913
1771
  i.includes(g) && !c.includes(g) && c.push(g);
1914
1772
  else if (d && i.includes(g)) {
@@ -1920,12 +1778,12 @@ class Qn extends qn {
1920
1778
  }
1921
1779
  }
1922
1780
  d && u.push(...i.filter((p) => !l.includes(p)));
1923
- const v = a === "keep";
1781
+ const b = a === "keep";
1924
1782
  for (let p = 0; p < l.length; p++) {
1925
1783
  const g = l[p];
1926
1784
  !h.includes(g) && !// Check if the user wants to keep previously selected elements, e.g.,
1927
1785
  // not make them part of the current selection as soon as they're touched.
1928
- (v && i.includes(g)) && y.push(g);
1786
+ (b && i.includes(g)) && y.push(g);
1929
1787
  }
1930
1788
  o.selected = h, o.changed = { added: u, removed: y }, this._latestElement = void 0;
1931
1789
  }
@@ -1978,7 +1836,7 @@ class Qn extends qn {
1978
1836
  * Will update everything that can be selected
1979
1837
  */
1980
1838
  resolveSelectables() {
1981
- this._selectables = q(this._options.selectables, this._options.document);
1839
+ this._selectables = K(this._options.selectables, this._options.document);
1982
1840
  }
1983
1841
  /**
1984
1842
  * Same as deselecting, but for all elements currently selected
@@ -1987,7 +1845,7 @@ class Qn extends qn {
1987
1845
  */
1988
1846
  clearSelection(t = !0, n = !1) {
1989
1847
  const { selected: o, stored: s, changed: i } = this._selection;
1990
- i.added = [], i.removed.push(...o, ...t ? s : []), n || (this._emitEvent("move", null), this._emitEvent("stop", null)), this._selection = qe(t ? [] : s);
1848
+ i.added = [], i.removed.push(...o, ...t ? s : []), n || (this._emitEvent("move", null), this._emitEvent("stop", null)), this._selection = Ve(t ? [] : s);
1991
1849
  }
1992
1850
  /**
1993
1851
  * @returns {Array} Selected elements
@@ -2047,7 +1905,7 @@ class Qn extends qn {
2047
1905
  * @param quiet If this should not trigger the move event
2048
1906
  */
2049
1907
  select(t, n = !1) {
2050
- const { changed: o, selected: s, stored: i } = this._selection, l = q(t, this._options.document).filter((c) => !s.includes(c) && !i.includes(c));
1908
+ const { changed: o, selected: s, stored: i } = this._selection, l = K(t, this._options.document).filter((c) => !s.includes(c) && !i.includes(c));
2051
1909
  return i.push(...l), s.push(...l), o.added.push(...l), o.removed = [], this._latestElement = void 0, n || (this._emitEvent("move", null), this._emitEvent("stop", null)), l;
2052
1910
  }
2053
1911
  /**
@@ -2056,12 +1914,12 @@ class Qn extends qn {
2056
1914
  * @param quiet If this should not trigger the move event
2057
1915
  */
2058
1916
  deselect(t, n = !1) {
2059
- const { selected: o, stored: s, changed: i } = this._selection, l = q(t, this._options.document).filter((c) => o.includes(c) || s.includes(c));
1917
+ const { selected: o, stored: s, changed: i } = this._selection, l = K(t, this._options.document).filter((c) => o.includes(c) || s.includes(c));
2060
1918
  this._selection.stored = s.filter((c) => !l.includes(c)), this._selection.selected = o.filter((c) => !l.includes(c)), this._selection.changed.added = [], this._selection.changed.removed.push(...l.filter((c) => !i.removed.includes(c))), this._latestElement = void 0, n || (this._emitEvent("move", null), this._emitEvent("stop", null));
2061
1919
  }
2062
1920
  }
2063
- function eo(e) {
2064
- const t = e.mouseSelectionButton === 2 ? [2] : [0], n = new Qn({
1921
+ function Zn(e) {
1922
+ const t = e.mouseSelectionButton === 2 ? [2] : [0], n = new Jn({
2065
1923
  selectables: [".map-container me-tpc"],
2066
1924
  boundaries: [e.container],
2067
1925
  container: e.selectionContainer,
@@ -2120,10 +1978,10 @@ function eo(e) {
2120
1978
  );
2121
1979
  e.selection = n;
2122
1980
  }
2123
- const to = function(e, t = !0) {
1981
+ const Qn = function(e, t = !0) {
2124
1982
  this.theme = e;
2125
1983
  const o = {
2126
- ...(e.type === "dark" ? we : be).cssVar,
1984
+ ...(e.type === "dark" ? we : ve).cssVar,
2127
1985
  ...e.cssVar
2128
1986
  }, s = Object.keys(o);
2129
1987
  for (let i = 0; i < s.length; i++) {
@@ -2131,7 +1989,7 @@ const to = function(e, t = !0) {
2131
1989
  this.container.style.setProperty(l, o[l]);
2132
1990
  }
2133
1991
  t && this.refresh();
2134
- }, no = function(e) {
1992
+ }, eo = function(e) {
2135
1993
  return {
2136
1994
  dom: e,
2137
1995
  moved: !1,
@@ -2154,7 +2012,7 @@ const to = function(e, t = !0) {
2154
2012
  },
2155
2013
  cb: null,
2156
2014
  init(t, n) {
2157
- this.cb = n, this.handleClear = this.handleClear.bind(this), this.handlePointerMove = this.handlePointerMove.bind(this), this.handlePointerDown = this.handlePointerDown.bind(this), this.destroy = Qe([
2015
+ this.cb = n, this.handleClear = this.handleClear.bind(this), this.handlePointerMove = this.handlePointerMove.bind(this), this.handlePointerDown = this.handlePointerDown.bind(this), this.destroy = Je([
2158
2016
  { dom: t, evt: "pointermove", func: this.handlePointerMove },
2159
2017
  { dom: t, evt: "pointerleave", func: this.handleClear },
2160
2018
  { dom: t, evt: "pointerup", func: this.handleClear },
@@ -2166,27 +2024,27 @@ const to = function(e, t = !0) {
2166
2024
  this.moved = !1, this.pointerdown = !1;
2167
2025
  }
2168
2026
  };
2169
- }, Ke = {
2170
- create: no
2171
- }, oo = "#4dc4ff";
2172
- function ft(e, t, n, o, s, i, l, c) {
2027
+ }, ze = {
2028
+ create: eo
2029
+ }, to = "#4dc4ff";
2030
+ function dt(e, t, n, o, s, i, l, c) {
2173
2031
  return {
2174
2032
  x: e / 8 + n * 3 / 8 + s * 3 / 8 + l / 8,
2175
2033
  y: t / 8 + o * 3 / 8 + i * 3 / 8 + c / 8
2176
2034
  };
2177
2035
  }
2178
- function so(e, t, n) {
2036
+ function no(e, t, n) {
2179
2037
  e && (e.dataset.x = t.toString(), e.dataset.y = n.toString(), fe(e));
2180
2038
  }
2181
2039
  function oe(e, t, n, o, s) {
2182
- A(e, {
2040
+ D(e, {
2183
2041
  x1: t + "",
2184
2042
  y1: n + "",
2185
2043
  x2: o + "",
2186
2044
  y2: s + ""
2187
2045
  });
2188
2046
  }
2189
- function Ue(e, t, n, o, s, i, l, c, r, a) {
2047
+ function Ke(e, t, n, o, s, i, l, c, r, a) {
2190
2048
  const d = `M ${t} ${n} C ${o} ${s} ${i} ${l} ${c} ${r}`;
2191
2049
  if (e.line.setAttribute("d", d), a.style) {
2192
2050
  const p = a.style;
@@ -2212,15 +2070,15 @@ function Ue(e, t, n, o, s, i, l, c, r, a) {
2212
2070
  }
2213
2071
  }
2214
2072
  }
2215
- const { x: y, y: v } = ft(t, n, o, s, i, l, c, r);
2216
- if (e.labelEl && so(e.labelEl, y, v), a.style?.labelColor) {
2073
+ const { x: y, y: b } = dt(t, n, o, s, i, l, c, r);
2074
+ if (e.labelEl && no(e.labelEl, y, b), a.style?.labelColor) {
2217
2075
  const p = e.labelEl;
2218
2076
  p && (p.style.color = a.style.labelColor);
2219
2077
  }
2220
- po(e);
2078
+ fo(e);
2221
2079
  }
2222
2080
  function de(e, t, n) {
2223
- const { offsetLeft: o, offsetTop: s } = j(e.nodes, t), i = t.offsetWidth, l = t.offsetHeight, c = o + i / 2, r = s + l / 2, a = c + n.x, d = r + n.y;
2081
+ const { offsetLeft: o, offsetTop: s } = H(e.nodes, t), i = t.offsetWidth, l = t.offsetHeight, c = o + i / 2, r = s + l / 2, a = c + n.x, d = r + n.y;
2224
2082
  return {
2225
2083
  w: i,
2226
2084
  h: l,
@@ -2230,7 +2088,7 @@ function de(e, t, n) {
2230
2088
  ctrlY: d
2231
2089
  };
2232
2090
  }
2233
- function K(e) {
2091
+ function q(e) {
2234
2092
  let t, n;
2235
2093
  const o = (e.cy - e.ctrlY) / (e.ctrlX - e.cx);
2236
2094
  return o > e.h / e.w || o < -e.h / e.w ? e.cy - e.ctrlY < 0 ? (t = e.cx - e.h / 2 / o, n = e.cy + e.h / 2) : (t = e.cx + e.h / 2 / o, n = e.cy - e.h / 2) : e.cx - e.ctrlX < 0 ? (t = e.cx + e.w / 2, n = e.cy - e.w * o / 2) : (t = e.cx - e.w / 2, n = e.cy + e.w * o / 2), {
@@ -2238,68 +2096,68 @@ function K(e) {
2238
2096
  y: n
2239
2097
  };
2240
2098
  }
2241
- const io = function(e, t, n) {
2242
- const o = j(e.nodes, t), s = j(e.nodes, n), i = o.offsetLeft + t.offsetWidth / 2, l = o.offsetTop + t.offsetHeight / 2, c = s.offsetLeft + n.offsetWidth / 2, r = s.offsetTop + n.offsetHeight / 2, a = c - i, d = r - l, h = Math.sqrt(a * a + d * d), u = Math.max(50, Math.min(200, h * 0.3)), y = Math.abs(a), v = Math.abs(d);
2099
+ const oo = function(e, t, n) {
2100
+ const o = H(e.nodes, t), s = H(e.nodes, n), i = o.offsetLeft + t.offsetWidth / 2, l = o.offsetTop + t.offsetHeight / 2, c = s.offsetLeft + n.offsetWidth / 2, r = s.offsetTop + n.offsetHeight / 2, a = c - i, d = r - l, h = Math.sqrt(a * a + d * d), u = Math.max(50, Math.min(200, h * 0.3)), y = Math.abs(a), b = Math.abs(d);
2243
2101
  let p, g;
2244
2102
  if (h < 150) {
2245
- const b = t.closest("me-main").className === "lhs" ? -1 : 1;
2246
- p = { x: 200 * b, y: 0 }, g = { x: 200 * b, y: 0 };
2247
- } else if (y > v * 1.5) {
2248
- const b = a > 0 ? t.offsetWidth / 2 : -t.offsetWidth / 2, x = a > 0 ? -n.offsetWidth / 2 : n.offsetWidth / 2;
2249
- p = { x: b + (a > 0 ? u : -u), y: 0 }, g = { x: x + (a > 0 ? -u : u), y: 0 };
2250
- } else if (v > y * 1.5) {
2251
- const b = d > 0 ? t.offsetHeight / 2 : -t.offsetHeight / 2, x = d > 0 ? -n.offsetHeight / 2 : n.offsetHeight / 2;
2252
- p = { x: 0, y: b + (d > 0 ? u : -u) }, g = { x: 0, y: x + (d > 0 ? -u : u) };
2103
+ const v = t.closest("me-main").className === "lhs" ? -1 : 1;
2104
+ p = { x: 200 * v, y: 0 }, g = { x: 200 * v, y: 0 };
2105
+ } else if (y > b * 1.5) {
2106
+ const v = a > 0 ? t.offsetWidth / 2 : -t.offsetWidth / 2, E = a > 0 ? -n.offsetWidth / 2 : n.offsetWidth / 2;
2107
+ p = { x: v + (a > 0 ? u : -u), y: 0 }, g = { x: E + (a > 0 ? -u : u), y: 0 };
2108
+ } else if (b > y * 1.5) {
2109
+ const v = d > 0 ? t.offsetHeight / 2 : -t.offsetHeight / 2, E = d > 0 ? -n.offsetHeight / 2 : n.offsetHeight / 2;
2110
+ p = { x: 0, y: v + (d > 0 ? u : -u) }, g = { x: 0, y: E + (d > 0 ? -u : u) };
2253
2111
  } else {
2254
- const b = Math.atan2(d, a), x = t.offsetWidth / 2 * Math.cos(b), L = t.offsetHeight / 2 * Math.sin(b), T = -(n.offsetWidth / 2) * Math.cos(b), E = -(n.offsetHeight / 2) * Math.sin(b), C = u * 0.7 * (a > 0 ? 1 : -1), S = u * 0.7 * (d > 0 ? 1 : -1);
2255
- p = { x: x + C, y: L + S }, g = { x: T - C, y: E - S };
2112
+ const v = Math.atan2(d, a), E = t.offsetWidth / 2 * Math.cos(v), k = t.offsetHeight / 2 * Math.sin(v), _ = -(n.offsetWidth / 2) * Math.cos(v), C = -(n.offsetHeight / 2) * Math.sin(v), x = u * 0.7 * (a > 0 ? 1 : -1), N = u * 0.7 * (d > 0 ? 1 : -1);
2113
+ p = { x: E + x, y: k + N }, g = { x: _ - x, y: C - N };
2256
2114
  }
2257
2115
  return { delta1: p, delta2: g };
2258
- }, De = function(e, t, n, o, s) {
2116
+ }, Ae = function(e, t, n, o, s) {
2259
2117
  if (!t || !n)
2260
2118
  return;
2261
2119
  if (!o.delta1 || !o.delta2) {
2262
- const N = io(e, t, n);
2263
- o.delta1 = N.delta1, o.delta2 = N.delta2;
2120
+ const S = oo(e, t, n);
2121
+ o.delta1 = S.delta1, o.delta2 = S.delta2;
2264
2122
  }
2265
- const i = de(e, t, o.delta1), l = de(e, n, o.delta2), { x: c, y: r } = K(i), { ctrlX: a, ctrlY: d } = i, { ctrlX: h, ctrlY: u } = l, { x: y, y: v } = K(l), p = ce(h, u, y, v);
2123
+ const i = de(e, t, o.delta1), l = de(e, n, o.delta2), { x: c, y: r } = q(i), { ctrlX: a, ctrlY: d } = i, { ctrlX: h, ctrlY: u } = l, { x: y, y: b } = q(l), p = ce(h, u, y, b);
2266
2124
  if (!p) return;
2267
- const g = `M ${p.x1} ${p.y1} L ${y} ${v} L ${p.x2} ${p.y2}`;
2125
+ const g = `M ${p.x1} ${p.y1} L ${y} ${b} L ${p.x2} ${p.y2}`;
2268
2126
  let m = "";
2269
2127
  if (o.bidirectional) {
2270
- const N = ce(a, d, c, r);
2271
- if (!N) return;
2272
- m = `M ${N.x1} ${N.y1} L ${c} ${r} L ${N.x2} ${N.y2}`;
2128
+ const S = ce(a, d, c, r);
2129
+ if (!S) return;
2130
+ m = `M ${S.x1} ${S.y1} L ${c} ${r} L ${S.x2} ${S.y2}`;
2273
2131
  }
2274
- const b = Mn(`M ${c} ${r} C ${a} ${d} ${h} ${u} ${y} ${v}`, g, m, o.style), { x, y: L } = ft(c, r, a, d, h, u, y, v), T = o.style?.labelColor || "rgb(235, 95, 82)", E = "arrow-" + o.id;
2275
- b.id = E;
2276
- const C = e.markdown ? e.markdown(o.label, o) : o.label, S = ye(C, x, L, {
2132
+ const v = Ln(`M ${c} ${r} C ${a} ${d} ${h} ${u} ${y} ${b}`, g, m, o.style), { x: E, y: k } = dt(c, r, a, d, h, u, y, b), _ = o.style?.labelColor || "rgb(235, 95, 82)", C = "arrow-" + o.id;
2133
+ v.id = C;
2134
+ const x = e.markdown ? e.markdown(o.label, o) : o.label, N = ye(x, E, k, {
2277
2135
  anchor: "middle",
2278
- color: T,
2136
+ color: _,
2279
2137
  dataType: "arrow",
2280
- svgId: E
2138
+ svgId: C
2281
2139
  });
2282
- b.labelEl = S, b.arrowObj = o, b.dataset.linkid = o.id, e.labelContainer.appendChild(S), e.linkSvgGroup.appendChild(b), fe(S), s || (e.arrows.push(o), e.currentArrow = b, ut(e, o, i, l));
2283
- }, ro = function(e, t, n = {}) {
2140
+ v.labelEl = N, v.arrowObj = o, v.dataset.linkid = o.id, e.labelContainer.appendChild(N), e.linkSvgGroup.appendChild(v), fe(N), s || (e.arrows.push(o), e.currentArrow = v, ht(e, o, i, l));
2141
+ }, so = function(e, t, n = {}) {
2284
2142
  const o = {
2285
- id: V(),
2143
+ id: z(),
2286
2144
  label: "Custom Link",
2287
2145
  from: e.nodeObj.id,
2288
2146
  to: t.nodeObj.id,
2289
2147
  ...n
2290
2148
  };
2291
- De(this, e, t, o), this.bus.fire("operation", {
2149
+ Ae(this, e, t, o), this.bus.fire("operation", {
2292
2150
  name: "createArrow",
2293
2151
  obj: o
2294
2152
  });
2295
- }, lo = function(e) {
2153
+ }, io = function(e) {
2296
2154
  ue(this);
2297
- const t = { ...e, id: V() };
2298
- De(this, this.findEle(t.from), this.findEle(t.to), t), this.bus.fire("operation", {
2155
+ const t = { ...e, id: z() };
2156
+ Ae(this, this.findEle(t.from), this.findEle(t.to), t), this.bus.fire("operation", {
2299
2157
  name: "createArrow",
2300
2158
  obj: t
2301
2159
  });
2302
- }, co = function(e) {
2160
+ }, ro = function(e) {
2303
2161
  let t;
2304
2162
  if (e ? t = e : t = this.currentArrow, !t) return;
2305
2163
  ue(this);
@@ -2310,15 +2168,15 @@ const io = function(e, t, n) {
2310
2168
  id: n
2311
2169
  }
2312
2170
  });
2313
- }, ao = function(e) {
2171
+ }, lo = function(e) {
2314
2172
  this.currentArrow = e;
2315
2173
  const t = e.arrowObj, n = this.findEle(t.from), o = this.findEle(t.to), s = de(this, n, t.delta1), i = de(this, o, t.delta2);
2316
- ut(this, t, s, i);
2317
- }, ho = function() {
2174
+ ht(this, t, s, i);
2175
+ }, co = function() {
2318
2176
  ue(this), this.currentArrow = null;
2319
2177
  }, ge = function(e, t) {
2320
- const n = document.createElementNS(H, "path");
2321
- return A(n, {
2178
+ const n = document.createElementNS(j, "path");
2179
+ return D(n, {
2322
2180
  d: e,
2323
2181
  stroke: t,
2324
2182
  fill: "none",
@@ -2326,8 +2184,8 @@ const io = function(e, t, n) {
2326
2184
  "stroke-linecap": "round",
2327
2185
  "stroke-linejoin": "round"
2328
2186
  }), n;
2329
- }, fo = function(e, t) {
2330
- const n = document.createElementNS(H, "g");
2187
+ }, ao = function(e, t) {
2188
+ const n = document.createElementNS(j, "g");
2331
2189
  n.setAttribute("class", "arrow-highlight"), n.setAttribute("opacity", "0.45");
2332
2190
  const o = ge(e.line.getAttribute("d"), t);
2333
2191
  n.appendChild(o);
@@ -2337,59 +2195,59 @@ const io = function(e, t, n) {
2337
2195
  n.appendChild(i);
2338
2196
  }
2339
2197
  e.insertBefore(n, e.firstChild);
2340
- }, uo = function(e) {
2198
+ }, ho = function(e) {
2341
2199
  const t = e.querySelector(".arrow-highlight");
2342
2200
  t && t.remove();
2343
- }, po = function(e) {
2201
+ }, fo = function(e) {
2344
2202
  const t = e.querySelector(".arrow-highlight");
2345
2203
  if (!t) return;
2346
2204
  const n = t.querySelectorAll("path");
2347
2205
  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"));
2348
2206
  }, ue = function(e) {
2349
- e.helper1?.destroy(), e.helper2?.destroy(), e.linkController.style.display = "none", e.P2.style.display = "none", e.P3.style.display = "none", e.currentArrow && uo(e.currentArrow);
2350
- }, ut = function(e, t, n, o) {
2207
+ e.helper1?.destroy(), e.helper2?.destroy(), e.linkController.style.display = "none", e.P2.style.display = "none", e.P3.style.display = "none", e.currentArrow && ho(e.currentArrow);
2208
+ }, ht = function(e, t, n, o) {
2351
2209
  const { linkController: s, P2: i, P3: l, line1: c, line2: r, nodes: a, map: d, currentArrow: h, bus: u } = e;
2352
2210
  if (!h) return;
2353
- s.style.display = "initial", i.style.display = "initial", l.style.display = "initial", a.appendChild(s), a.appendChild(i), a.appendChild(l), fo(h, oo);
2354
- let { x: y, y: v } = K(n), { ctrlX: p, ctrlY: g } = n, { ctrlX: m, ctrlY: b } = o, { x, y: L } = K(o);
2355
- i.style.cssText = `top:${g}px;left:${p}px;`, l.style.cssText = `top:${b}px;left:${m}px;`, oe(c, y, v, p, g), oe(r, m, b, x, L), e.helper1 = Ke.create(i), e.helper2 = Ke.create(l), e.helper1.init(d, (T, E) => {
2356
- p = p + T / e.scaleVal, g = g + E / e.scaleVal;
2357
- const C = K({ ...n, ctrlX: p, ctrlY: g });
2358
- y = C.x, v = C.y, i.style.top = g + "px", i.style.left = p + "px", Ue(h, y, v, p, g, m, b, x, L, t), oe(c, y, v, p, g), t.delta1.x = p - n.cx, t.delta1.y = g - n.cy, u.fire("updateArrowDelta", t);
2359
- }), e.helper2.init(d, (T, E) => {
2360
- m = m + T / e.scaleVal, b = b + E / e.scaleVal;
2361
- const C = K({ ...o, ctrlX: m, ctrlY: b });
2362
- x = C.x, L = C.y, l.style.top = b + "px", l.style.left = m + "px", Ue(h, y, v, p, g, m, b, x, L, t), oe(r, m, b, x, L), t.delta2.x = m - o.cx, t.delta2.y = b - o.cy, u.fire("updateArrowDelta", t);
2211
+ s.style.display = "initial", i.style.display = "initial", l.style.display = "initial", a.appendChild(s), a.appendChild(i), a.appendChild(l), ao(h, to);
2212
+ let { x: y, y: b } = q(n), { ctrlX: p, ctrlY: g } = n, { ctrlX: m, ctrlY: v } = o, { x: E, y: k } = q(o);
2213
+ i.style.cssText = `top:${g}px;left:${p}px;`, l.style.cssText = `top:${v}px;left:${m}px;`, oe(c, y, b, p, g), oe(r, m, v, E, k), e.helper1 = ze.create(i), e.helper2 = ze.create(l), e.helper1.init(d, (_, C) => {
2214
+ p = p + _ / e.scaleVal, g = g + C / e.scaleVal;
2215
+ const x = q({ ...n, ctrlX: p, ctrlY: g });
2216
+ y = x.x, b = x.y, i.style.top = g + "px", i.style.left = p + "px", Ke(h, y, b, p, g, m, v, E, k, t), oe(c, y, b, p, g), t.delta1.x = p - n.cx, t.delta1.y = g - n.cy, u.fire("updateArrowDelta", t);
2217
+ }), e.helper2.init(d, (_, C) => {
2218
+ m = m + _ / e.scaleVal, v = v + C / e.scaleVal;
2219
+ const x = q({ ...o, ctrlX: m, ctrlY: v });
2220
+ E = x.x, k = x.y, l.style.top = v + "px", l.style.left = m + "px", Ke(h, y, b, p, g, m, v, E, k, t), oe(r, m, v, E, k), t.delta2.x = m - o.cx, t.delta2.y = v - o.cy, u.fire("updateArrowDelta", t);
2363
2221
  });
2364
2222
  };
2365
- function go() {
2223
+ function uo() {
2366
2224
  this.linkSvgGroup.innerHTML = "", this.labelContainer.querySelectorAll('.svg-label[data-type="arrow"]').forEach((t) => t.remove());
2367
2225
  for (let t = 0; t < this.arrows.length; t++) {
2368
2226
  const n = this.arrows[t];
2369
2227
  try {
2370
- De(this, this.findEle(n.from), this.findEle(n.to), n, !0);
2228
+ Ae(this, this.findEle(n.from), this.findEle(n.to), n, !0);
2371
2229
  } catch {
2372
2230
  }
2373
2231
  }
2374
2232
  this.nodes.appendChild(this.linkSvgGroup);
2375
2233
  }
2376
- function mo(e) {
2377
- ue(this), e && e.labelEl && at(this, e.labelEl, e.arrowObj);
2234
+ function po(e) {
2235
+ ue(this), e && e.labelEl && lt(this, e.labelEl, e.arrowObj);
2378
2236
  }
2379
- function yo() {
2237
+ function go() {
2380
2238
  this.arrows = this.arrows.filter((e) => le(e.from, this.nodeData) && le(e.to, this.nodeData));
2381
2239
  }
2382
- const vo = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
2240
+ const mo = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
2383
2241
  __proto__: null,
2384
- createArrow: ro,
2385
- createArrowFrom: lo,
2386
- editArrowLabel: mo,
2387
- removeArrow: co,
2388
- renderArrow: go,
2389
- selectArrow: ao,
2390
- tidyArrow: yo,
2391
- unselectArrow: ho
2392
- }, Symbol.toStringTag, { value: "Module" })), bo = function(e) {
2242
+ createArrow: so,
2243
+ createArrowFrom: io,
2244
+ editArrowLabel: po,
2245
+ removeArrow: ro,
2246
+ renderArrow: uo,
2247
+ selectArrow: lo,
2248
+ tidyArrow: go,
2249
+ unselectArrow: co
2250
+ }, Symbol.toStringTag, { value: "Module" })), yo = function(e) {
2393
2251
  if (e.length === 0) throw new Error("No selected node.");
2394
2252
  if (e.length === 1) {
2395
2253
  const r = e[0].nodeObj, a = e[0].nodeObj.parent;
@@ -2426,101 +2284,101 @@ const vo = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
2426
2284
  start: i,
2427
2285
  end: l
2428
2286
  };
2429
- }, wo = function(e) {
2430
- const t = document.createElementNS(H, "g");
2287
+ }, bo = function(e) {
2288
+ const t = document.createElementNS(j, "g");
2431
2289
  return t.setAttribute("id", e), t;
2432
- }, Je = function(e, t) {
2433
- const n = document.createElementNS(H, "path");
2434
- return A(n, {
2290
+ }, qe = function(e, t) {
2291
+ const n = document.createElementNS(j, "path");
2292
+ return D(n, {
2435
2293
  d: e,
2436
2294
  stroke: t || "#666",
2437
2295
  fill: "none",
2438
2296
  "stroke-linecap": "round",
2439
2297
  "stroke-width": "2"
2440
2298
  }), n;
2441
- }, xo = (e) => e.parentElement.parentElement, Co = function(e, { parent: t, start: n }) {
2299
+ }, vo = (e) => e.parentElement.parentElement, wo = function(e, { parent: t, start: n }) {
2442
2300
  const o = e.findEle(t), s = o.nodeObj;
2443
2301
  let i;
2444
2302
  return s.parent ? i = o.closest("me-main").className : i = e.findEle(s.children[n].id).closest("me-main").className, i;
2445
2303
  }, Me = function(e, t) {
2446
- const { id: n, label: o, parent: s, start: i, end: l, style: c } = t, { nodes: r, theme: a, summarySvg: d } = e, u = e.findEle(s).nodeObj, y = Co(e, t);
2447
- let v = 1 / 0, p = 0, g = 0, m = 0;
2304
+ const { id: n, label: o, parent: s, start: i, end: l, style: c } = t, { nodes: r, theme: a, summarySvg: d } = e, u = e.findEle(s).nodeObj, y = wo(e, t);
2305
+ let b = 1 / 0, p = 0, g = 0, m = 0;
2448
2306
  for (let f = i; f <= l; f++) {
2449
2307
  const w = u.children?.[f];
2450
2308
  if (!w)
2451
2309
  return e.removeSummary(n), null;
2452
- const k = xo(e.findEle(w.id)), { offsetLeft: O, offsetTop: W } = j(r, k), M = i === l ? 10 : 20;
2453
- f === i && (g = W + M), f === l && (m = W + k.offsetHeight - M), O < v && (v = O), k.offsetWidth + O > p && (p = k.offsetWidth + O);
2454
- }
2455
- let b, x;
2456
- const L = u.parent ? 10 : 0, T = g + L, E = m + L, C = (T + E) / 2, S = c?.stroke || a.cssVar["--color"], N = c?.labelColor || a.cssVar["--color"], D = "s-" + n, _ = e.markdown ? e.markdown(o, t) : o;
2457
- y === B.LHS ? (b = Je(`M ${v + 10} ${T} c -5 0 -10 5 -10 10 L ${v} ${E - 10} c 0 5 5 10 10 10 M ${v} ${C} h -10`, S), x = ye(_, v - 20, C, { anchor: "end", color: N, dataType: "summary", svgId: D })) : (b = Je(`M ${p - 10} ${T} c 5 0 10 5 10 10 L ${p} ${E - 10} c 0 5 -5 10 -10 10 M ${p} ${C} h 10`, S), x = ye(_, p + 20, C, { anchor: "start", color: N, dataType: "summary", svgId: D }));
2458
- const R = wo(D);
2459
- return R.appendChild(b), e.labelContainer.appendChild(x), fe(x), R.summaryObj = t, R.labelEl = x, d.appendChild(R), R;
2460
- }, Eo = function(e = {}) {
2310
+ const T = vo(e.findEle(w.id)), { offsetLeft: O, offsetTop: X } = H(r, T), M = i === l ? 10 : 20;
2311
+ f === i && (g = X + M), f === l && (m = X + T.offsetHeight - M), O < b && (b = O), T.offsetWidth + O > p && (p = T.offsetWidth + O);
2312
+ }
2313
+ let v, E;
2314
+ const k = u.parent ? 10 : 0, _ = g + k, C = m + k, x = (_ + C) / 2, N = c?.stroke || a.cssVar["--color"], S = c?.labelColor || a.cssVar["--color"], A = "s-" + n, L = e.markdown ? e.markdown(o, t) : o;
2315
+ y === B.LHS ? (v = qe(`M ${b + 10} ${_} c -5 0 -10 5 -10 10 L ${b} ${C - 10} c 0 5 5 10 10 10 M ${b} ${x} h -10`, N), E = ye(L, b - 20, x, { anchor: "end", color: S, dataType: "summary", svgId: A })) : (v = qe(`M ${p - 10} ${_} c 5 0 10 5 10 10 L ${p} ${C - 10} c 0 5 -5 10 -10 10 M ${p} ${x} h 10`, N), E = ye(L, p + 20, x, { anchor: "start", color: S, dataType: "summary", svgId: A }));
2316
+ const R = bo(A);
2317
+ return R.appendChild(v), e.labelContainer.appendChild(E), fe(E), R.summaryObj = t, R.labelEl = E, d.appendChild(R), R;
2318
+ }, xo = function(e = {}) {
2461
2319
  if (!this.currentNodes) return;
2462
- const { currentNodes: t, summaries: n, bus: o } = this, { parent: s, start: i, end: l } = bo(t), c = { id: V(), parent: s, start: i, end: l, label: "summary", style: e.style }, r = Me(this, c);
2320
+ const { currentNodes: t, summaries: n, bus: o } = this, { parent: s, start: i, end: l } = yo(t), c = { id: z(), parent: s, start: i, end: l, label: "summary", style: e.style }, r = Me(this, c);
2463
2321
  n.push(c), this.editSummary(r), o.fire("operation", {
2464
2322
  name: "createSummary",
2465
2323
  obj: c
2466
2324
  });
2467
- }, So = function(e) {
2468
- const t = V(), n = { ...e, id: t };
2325
+ }, Eo = function(e) {
2326
+ const t = z(), n = { ...e, id: t };
2469
2327
  Me(this, n), this.summaries.push(n), this.bus.fire("operation", {
2470
2328
  name: "createSummary",
2471
2329
  obj: n
2472
2330
  });
2473
- }, No = function(e) {
2331
+ }, Co = function(e) {
2474
2332
  const t = this.summaries.findIndex((n) => n.id === e);
2475
2333
  t > -1 && (this.summaries.splice(t, 1), this.nodes.querySelector("#s-" + e)?.remove(), this.nodes.querySelector("#label-s-" + e)?.remove()), this.bus.fire("operation", {
2476
2334
  name: "removeSummary",
2477
2335
  obj: { id: e }
2478
2336
  });
2479
- }, ko = function(e) {
2337
+ }, So = function(e) {
2480
2338
  const t = e.labelEl;
2481
2339
  t && t.classList.add("selected"), this.currentSummary = e;
2482
- }, To = function() {
2340
+ }, No = function() {
2483
2341
  this.currentSummary?.labelEl?.classList.remove("selected"), this.currentSummary = null;
2484
- }, _o = function() {
2342
+ }, To = function() {
2485
2343
  this.summarySvg.innerHTML = "", this.summaries.forEach((e) => {
2486
2344
  try {
2487
2345
  Me(this, e);
2488
2346
  } catch {
2489
2347
  }
2490
2348
  }), this.nodes.insertAdjacentElement("beforeend", this.summarySvg);
2491
- }, Lo = function(e) {
2492
- e && e.labelEl && at(this, e.labelEl, e.summaryObj);
2493
- }, Ao = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
2349
+ }, _o = function(e) {
2350
+ e && e.labelEl && lt(this, e.labelEl, e.summaryObj);
2351
+ }, ko = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
2494
2352
  __proto__: null,
2495
- createSummary: Eo,
2496
- createSummaryFrom: So,
2497
- editSummary: Lo,
2498
- removeSummary: No,
2499
- renderSummary: _o,
2500
- selectSummary: ko,
2501
- unselectSummary: To
2353
+ createSummary: xo,
2354
+ createSummaryFrom: Eo,
2355
+ editSummary: _o,
2356
+ removeSummary: Co,
2357
+ renderSummary: To,
2358
+ selectSummary: So,
2359
+ unselectSummary: No
2502
2360
  }, Symbol.toStringTag, { value: "Module" })), P = "http://www.w3.org/2000/svg";
2503
- function Do(e, t) {
2361
+ function Lo(e, t) {
2504
2362
  const n = document.createElementNS(P, "svg");
2505
- return A(n, {
2363
+ return D(n, {
2506
2364
  version: "1.1",
2507
2365
  xmlns: P,
2508
2366
  height: e,
2509
2367
  width: t
2510
2368
  }), n;
2511
2369
  }
2512
- function Mo(e, t) {
2370
+ function Do(e, t) {
2513
2371
  return (parseInt(e) - parseInt(t)) / 2;
2514
2372
  }
2515
- function Po(e, t, n, o) {
2373
+ function Ao(e, t, n, o) {
2516
2374
  const s = document.createElementNS(P, "g");
2517
2375
  let i = "";
2518
2376
  return e.text ? i = e.text.textContent : i = e.childNodes[0].textContent, i.split(`
2519
2377
  `).forEach((c, r) => {
2520
2378
  const a = document.createElementNS(P, "text");
2521
- A(a, {
2379
+ D(a, {
2522
2380
  x: n + parseInt(t.paddingLeft) + "",
2523
- y: o + parseInt(t.paddingTop) + Mo(t.lineHeight, t.fontSize) * (r + 1) + parseFloat(t.fontSize) * (r + 1) + "",
2381
+ y: o + parseInt(t.paddingTop) + Do(t.lineHeight, t.fontSize) * (r + 1) + parseFloat(t.fontSize) * (r + 1) + "",
2524
2382
  "text-anchor": "start",
2525
2383
  "font-family": t.fontFamily,
2526
2384
  "font-size": `${t.fontSize}`,
@@ -2529,25 +2387,25 @@ function Po(e, t, n, o) {
2529
2387
  }), a.innerHTML = c, s.appendChild(a);
2530
2388
  }), s;
2531
2389
  }
2532
- function Oo(e, t, n, o) {
2390
+ function Mo(e, t, n, o) {
2533
2391
  let s = "";
2534
2392
  e.nodeObj?.dangerouslySetInnerHTML ? s = e.nodeObj.dangerouslySetInnerHTML : e.text ? s = e.text.textContent : s = e.childNodes[0].textContent;
2535
2393
  const i = document.createElementNS(P, "foreignObject");
2536
- A(i, {
2394
+ D(i, {
2537
2395
  x: n + parseInt(t.paddingLeft) + "",
2538
2396
  y: o + parseInt(t.paddingTop) + "",
2539
2397
  width: t.width,
2540
2398
  height: t.height
2541
2399
  });
2542
2400
  const l = document.createElement("div");
2543
- return A(l, {
2401
+ return D(l, {
2544
2402
  xmlns: "http://www.w3.org/1999/xhtml",
2545
2403
  style: `font-family: ${t.fontFamily}; font-size: ${t.fontSize}; font-weight: ${t.fontWeight}; color: ${t.color}; white-space: pre-wrap;`
2546
2404
  }), l.innerHTML = s, i.appendChild(l), i;
2547
2405
  }
2548
- function $o(e, t) {
2549
- const n = getComputedStyle(t), { offsetLeft: o, offsetTop: s } = j(e.nodes, t), i = document.createElementNS(P, "rect");
2550
- return A(i, {
2406
+ function Po(e, t) {
2407
+ const n = getComputedStyle(t), { offsetLeft: o, offsetTop: s } = H(e.nodes, t), i = document.createElementNS(P, "rect");
2408
+ return D(i, {
2551
2409
  x: o + "",
2552
2410
  y: s + "",
2553
2411
  rx: n.borderRadius,
@@ -2560,8 +2418,8 @@ function $o(e, t) {
2560
2418
  }), i;
2561
2419
  }
2562
2420
  function se(e, t, n = !1) {
2563
- const o = getComputedStyle(t), { offsetLeft: s, offsetTop: i } = j(e.nodes, t), l = document.createElementNS(P, "rect");
2564
- A(l, {
2421
+ const o = getComputedStyle(t), { offsetLeft: s, offsetTop: i } = H(e.nodes, t), l = document.createElementNS(P, "rect");
2422
+ D(l, {
2565
2423
  x: s + "",
2566
2424
  y: i + "",
2567
2425
  rx: o.borderRadius,
@@ -2575,11 +2433,11 @@ function se(e, t, n = !1) {
2575
2433
  const c = document.createElementNS(P, "g");
2576
2434
  c.appendChild(l);
2577
2435
  let r;
2578
- return n ? r = Oo(t, o, s, i) : r = Po(t, o, s, i), c.appendChild(r), c;
2436
+ return n ? r = Mo(t, o, s, i) : r = Ao(t, o, s, i), c.appendChild(r), c;
2579
2437
  }
2580
- function jo(e, t) {
2581
- const n = getComputedStyle(t), { offsetLeft: o, offsetTop: s } = j(e.nodes, t), i = document.createElementNS(P, "a"), l = document.createElementNS(P, "text");
2582
- return A(l, {
2438
+ function Oo(e, t) {
2439
+ const n = getComputedStyle(t), { offsetLeft: o, offsetTop: s } = H(e.nodes, t), i = document.createElementNS(P, "a"), l = document.createElementNS(P, "text");
2440
+ return D(l, {
2583
2441
  x: o + "",
2584
2442
  y: s + parseInt(n.fontSize) + "",
2585
2443
  "text-anchor": "start",
@@ -2589,9 +2447,9 @@ function jo(e, t) {
2589
2447
  fill: `${n.color}`
2590
2448
  }), l.innerHTML = t.textContent, i.appendChild(l), i.setAttribute("href", t.href), i;
2591
2449
  }
2592
- function Ho(e, t) {
2593
- const n = getComputedStyle(t), { offsetLeft: o, offsetTop: s } = j(e.nodes, t), i = document.createElementNS(P, "image");
2594
- return A(i, {
2450
+ function $o(e, t) {
2451
+ const n = getComputedStyle(t), { offsetLeft: o, offsetTop: s } = H(e.nodes, t), i = document.createElementNS(P, "image");
2452
+ return D(i, {
2595
2453
  x: o + "",
2596
2454
  y: s + "",
2597
2455
  width: n.width + "",
@@ -2599,17 +2457,17 @@ function Ho(e, t) {
2599
2457
  href: t.src
2600
2458
  }), i;
2601
2459
  }
2602
- const ie = 100, Io = '<?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">', Ro = (e, t = !1) => {
2603
- const n = e.nodes, o = n.offsetHeight + ie * 2, s = n.offsetWidth + ie * 2, i = Do(o + "px", s + "px"), l = document.createElementNS(P, "svg"), c = document.createElementNS(P, "rect");
2604
- A(c, {
2460
+ const ie = 100, Ho = '<?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">', jo = (e, t = !1) => {
2461
+ const n = e.nodes, o = n.offsetHeight + ie * 2, s = n.offsetWidth + ie * 2, i = Lo(o + "px", s + "px"), l = document.createElementNS(P, "svg"), c = document.createElementNS(P, "rect");
2462
+ D(c, {
2605
2463
  x: "0",
2606
2464
  y: "0",
2607
2465
  width: `${s}`,
2608
2466
  height: `${o}`,
2609
2467
  fill: e.theme.cssVar["--bgcolor"]
2610
2468
  }), i.appendChild(c), n.querySelectorAll(".subLines").forEach((h) => {
2611
- const u = h.cloneNode(!0), { offsetLeft: y, offsetTop: v } = j(n, h.parentElement);
2612
- u.setAttribute("x", `${y}`), u.setAttribute("y", `${v}`), l.appendChild(u);
2469
+ const u = h.cloneNode(!0), { offsetLeft: y, offsetTop: b } = H(n, h.parentElement);
2470
+ u.setAttribute("x", `${y}`), u.setAttribute("y", `${b}`), l.appendChild(u);
2613
2471
  });
2614
2472
  const r = n.querySelector(".lines")?.cloneNode(!0);
2615
2473
  r && l.appendChild(r);
@@ -2617,22 +2475,22 @@ const ie = 100, Io = '<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC
2617
2475
  a && l.appendChild(a);
2618
2476
  const d = n.querySelector(".summary")?.cloneNode(!0);
2619
2477
  return d && l.appendChild(d), n.querySelectorAll("me-tpc").forEach((h) => {
2620
- h.nodeObj.dangerouslySetInnerHTML ? l.appendChild(se(e, h, !t)) : (l.appendChild($o(e, h)), l.appendChild(se(e, h.text, !t)));
2478
+ h.nodeObj.dangerouslySetInnerHTML ? l.appendChild(se(e, h, !t)) : (l.appendChild(Po(e, h)), l.appendChild(se(e, h.text, !t)));
2621
2479
  }), n.querySelectorAll(".tags > span").forEach((h) => {
2622
2480
  l.appendChild(se(e, h));
2623
2481
  }), n.querySelectorAll(".icons > span").forEach((h) => {
2624
2482
  l.appendChild(se(e, h));
2625
2483
  }), n.querySelectorAll(".hyper-link").forEach((h) => {
2626
- l.appendChild(jo(e, h));
2484
+ l.appendChild(Oo(e, h));
2627
2485
  }), n.querySelectorAll("img").forEach((h) => {
2628
- l.appendChild(Ho(e, h));
2629
- }), A(l, {
2486
+ l.appendChild($o(e, h));
2487
+ }), D(l, {
2630
2488
  x: ie + "",
2631
2489
  y: ie + "",
2632
2490
  overflow: "visible"
2633
2491
  }), i.appendChild(l), i;
2634
- }, Bo = (e, t) => (t && e.insertAdjacentHTML("afterbegin", "<style>" + t + "</style>"), Io + e.outerHTML);
2635
- function Fo(e) {
2492
+ }, Io = (e, t) => (t && e.insertAdjacentHTML("afterbegin", "<style>" + t + "</style>"), Ho + e.outerHTML);
2493
+ function Ro(e) {
2636
2494
  return new Promise((t, n) => {
2637
2495
  const o = new FileReader();
2638
2496
  o.onload = (s) => {
@@ -2642,11 +2500,11 @@ function Fo(e) {
2642
2500
  }, o.readAsDataURL(e);
2643
2501
  });
2644
2502
  }
2645
- const Yo = function(e = !1, t) {
2646
- const n = Ro(this, e), o = Bo(n, t);
2503
+ const Bo = function(e = !1, t) {
2504
+ const n = jo(this, e), o = Io(n, t);
2647
2505
  return new Blob([o], { type: "image/svg+xml" });
2648
- }, Wo = async function(e = !1, t) {
2649
- const n = this.exportSvg(e, t), o = await Fo(n);
2506
+ }, Yo = async function(e = !1, t) {
2507
+ const n = this.exportSvg(e, t), o = await Ro(n);
2650
2508
  return new Promise((s, i) => {
2651
2509
  const l = new Image();
2652
2510
  l.setAttribute("crossOrigin", "anonymous"), l.onload = () => {
@@ -2654,48 +2512,48 @@ const Yo = function(e = !1, t) {
2654
2512
  c.width = l.width, c.height = l.height, c.getContext("2d").drawImage(l, 0, 0), c.toBlob(s, "image/png", 1);
2655
2513
  }, l.src = o, l.onerror = i;
2656
2514
  });
2657
- }, Xo = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
2515
+ }, Wo = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
2658
2516
  __proto__: null,
2659
- exportPng: Wo,
2660
- exportSvg: Yo
2517
+ exportPng: Yo,
2518
+ exportSvg: Bo
2661
2519
  }, Symbol.toStringTag, { value: "Module" }));
2662
- function zo(e, t) {
2520
+ function Xo(e, t) {
2663
2521
  return async function(...n) {
2664
2522
  const o = this.before[t];
2665
2523
  o && !await o.apply(this, n) || e.apply(this, n);
2666
2524
  };
2667
2525
  }
2668
- const Ze = Object.keys(it), pt = {};
2669
- for (let e = 0; e < Ze.length; e++) {
2670
- const t = Ze[e];
2671
- pt[t] = zo(it[t], t);
2526
+ const Ue = Object.keys(ot), ft = {};
2527
+ for (let e = 0; e < Ue.length; e++) {
2528
+ const t = Ue[e];
2529
+ ft[t] = Xo(ot[t], t);
2672
2530
  }
2673
- const Go = {
2531
+ const Fo = {
2674
2532
  getObjById: le,
2675
- generateNewObj: gt,
2676
- layout: mt,
2677
- linkDiv: Pn,
2678
- editTopic: Et,
2679
- createWrapper: bt,
2680
- createParent: wt,
2681
- createChildren: xt,
2682
- createTopic: Ct,
2683
- findEle: et,
2684
- changeTheme: to,
2685
- ...mn,
2686
- ...pt,
2687
- ...vo,
2688
- ...Ao,
2689
- ...Xo,
2533
+ generateNewObj: ut,
2534
+ layout: pt,
2535
+ linkDiv: Dn,
2536
+ editTopic: xt,
2537
+ createWrapper: yt,
2538
+ createParent: bt,
2539
+ createChildren: vt,
2540
+ createTopic: wt,
2541
+ findEle: Ze,
2542
+ changeTheme: Qn,
2543
+ ...un,
2544
+ ...ft,
2545
+ ...mo,
2546
+ ...ko,
2547
+ ...Wo,
2690
2548
  init(e) {
2691
2549
  if (e = JSON.parse(JSON.stringify(e)), !e || !e.nodeData) return new Error("MindElixir: `data` is required");
2692
- e.direction !== void 0 && (this.direction = e.direction), this.changeTheme(e.theme || this.theme, !1), this.nodeData = e.nodeData, G(this.nodeData), this.arrows = e.arrows || [], this.summaries = e.summaries || [], this.tidyArrow(), this.toolBar && Vn(this), this.keypress && xn(this, this.keypress), eo(this), this.disposable.push(Ln()), this.contextMenu && this.disposable.push(On(this, this.contextMenu)), this.allowUndo && this.disposable.push(jn(this)), this.layout(), this.linkDiv(), this.toCenter();
2550
+ e.direction !== void 0 && (this.direction = e.direction), this.changeTheme(e.theme || this.theme, !1), this.nodeData = e.nodeData, V(this.nodeData), this.arrows = e.arrows || [], this.summaries = e.summaries || [], this.tidyArrow(), this.toolBar && Gn(this), this.keypress && bn(this, this.keypress), Zn(this), this.disposable.push(Tn()), this.contextMenu && this.disposable.push(Mn(this, this.contextMenu)), this.allowUndo && this.disposable.push(On(this)), this.layout(), this.linkDiv(), this.toCenter();
2693
2551
  },
2694
2552
  destroy() {
2695
2553
  this.disposable.forEach((e) => e()), this.el && (this.el.innerHTML = ""), this.el = void 0, this.nodeData = void 0, this.arrows = void 0, this.summaries = void 0, this.currentArrow = void 0, this.currentNodes = void 0, this.currentSummary = void 0, this.theme = void 0, this.direction = void 0, this.bus = void 0, this.container = void 0, this.map = void 0, this.lines = void 0, this.linkController = void 0, this.linkSvgGroup = void 0, this.P2 = void 0, this.P3 = void 0, this.line1 = void 0, this.line2 = void 0, this.nodes = void 0, this.selection?.destroy(), this.selection = void 0;
2696
2554
  }
2697
2555
  };
2698
- function Vo({ pT: e, pL: t, pW: n, pH: o, cT: s, cL: i, cW: l, cH: c, direction: r, containerHeight: a }) {
2556
+ function Go({ pT: e, pL: t, pW: n, pH: o, cT: s, cL: i, cW: l, cH: c, direction: r, containerHeight: a }) {
2699
2557
  let d = t + n / 2;
2700
2558
  const h = e + o / 2;
2701
2559
  let u;
@@ -2703,17 +2561,17 @@ function Vo({ pT: e, pL: t, pW: n, pH: o, cT: s, cL: i, cW: l, cH: c, direction:
2703
2561
  const y = s + c / 2, p = (1 - Math.abs(y - h) / a) * 0.25 * (n / 2);
2704
2562
  return r === B.LHS ? d = d - n / 10 - p : d = d + n / 10 + p, `M ${d} ${h} Q ${d} ${y} ${u} ${y}`;
2705
2563
  }
2706
- function qo({ pT: e, pL: t, pW: n, pH: o, cT: s, cL: i, cW: l, cH: c, direction: r, isFirst: a }) {
2564
+ function Vo({ pT: e, pL: t, pW: n, pH: o, cT: s, cL: i, cW: l, cH: c, direction: r, isFirst: a }) {
2707
2565
  const d = parseInt(this.container.style.getPropertyValue("--node-gap-x"));
2708
2566
  let h = 0, u = 0;
2709
2567
  a ? h = e + o / 2 : h = e + o;
2710
2568
  const y = s + c;
2711
- let v = 0, p = 0, g = 0;
2569
+ let b = 0, p = 0, g = 0;
2712
2570
  const m = Math.abs(h - y) / 300 * d;
2713
- return r === B.LHS ? (g = t, v = g + d, p = g - d, u = i + d, `M ${v} ${h} C ${g} ${h} ${g + m} ${y} ${p} ${y} H ${u}`) : (g = t + n, v = g - d, p = g + d, u = i + l - d, `M ${v} ${h} C ${g} ${h} ${g - m} ${y} ${p} ${y} H ${u}`);
2571
+ return r === B.LHS ? (g = t, b = g + d, p = g - d, u = i + d, `M ${b} ${h} C ${g} ${h} ${g + m} ${y} ${p} ${y} H ${u}`) : (g = t + n, b = g - d, p = g + d, u = i + l - d, `M ${b} ${h} C ${g} ${h} ${g - m} ${y} ${p} ${y} H ${u}`);
2714
2572
  }
2715
- const Ko = "5.9.3";
2716
- function Uo(e) {
2573
+ const zo = "5.10.0";
2574
+ function Ko(e) {
2717
2575
  return {
2718
2576
  x: 0,
2719
2577
  y: 0,
@@ -2731,39 +2589,38 @@ function Uo(e) {
2731
2589
  function I({
2732
2590
  el: e,
2733
2591
  direction: t,
2734
- locale: n,
2735
- editable: o,
2736
- contextMenu: s,
2737
- toolBar: i,
2738
- keypress: l,
2739
- mouseSelectionButton: c,
2740
- selectionContainer: r,
2741
- before: a,
2742
- newTopicName: d,
2743
- allowUndo: h,
2744
- generateMainBranch: u,
2745
- generateSubBranch: y,
2746
- overflowHidden: v,
2747
- theme: p,
2748
- alignment: g,
2749
- scaleSensitivity: m,
2750
- scaleMax: b,
2751
- scaleMin: x,
2752
- handleWheel: L,
2753
- markdown: T,
2754
- imageProxy: E,
2592
+ editable: n,
2593
+ contextMenu: o,
2594
+ toolBar: s,
2595
+ keypress: i,
2596
+ mouseSelectionButton: l,
2597
+ selectionContainer: c,
2598
+ before: r,
2599
+ newTopicName: a,
2600
+ allowUndo: d,
2601
+ generateMainBranch: h,
2602
+ generateSubBranch: u,
2603
+ overflowHidden: y,
2604
+ theme: b,
2605
+ alignment: p,
2606
+ scaleSensitivity: g,
2607
+ scaleMax: m,
2608
+ scaleMin: v,
2609
+ handleWheel: E,
2610
+ markdown: k,
2611
+ imageProxy: _,
2755
2612
  pasteHandler: C
2756
2613
  }) {
2757
- let S = null;
2614
+ let x = null;
2758
2615
  const N = Object.prototype.toString.call(e);
2759
- if (N === "[object HTMLDivElement]" ? S = e : N === "[object String]" && (S = document.querySelector(e)), !S) throw new Error("MindElixir: el is not a valid element");
2760
- S.style.position = "relative", S.innerHTML = "", this.el = S, this.disposable = [], this.before = a || {}, this.locale = n || "en", this.newTopicName = d || "New Node", this.contextMenu = s ?? !0, this.toolBar = i ?? !0, this.keypress = l ?? !0, this.mouseSelectionButton = c ?? 0, this.direction = t ?? 1, this.editable = o ?? !0, this.allowUndo = h ?? !0, this.scaleSensitivity = m ?? 0.1, this.scaleMax = b ?? 1.4, this.scaleMin = x ?? 0.2, this.generateMainBranch = u || Vo, this.generateSubBranch = y || qo, this.overflowHidden = v ?? !1, this.alignment = g ?? "root", this.handleWheel = L ?? !0, this.markdown = T || void 0, this.imageProxy = E || void 0, this.currentNodes = [], this.currentArrow = null, this.scaleVal = 1, this.tempDirection = null, this.dragMoveHelper = Uo(this), this.bus = Dn(), this.container = document.createElement("div"), this.selectionContainer = r || this.container, this.container.className = "map-container";
2761
- const D = window.matchMedia("(prefers-color-scheme: dark)");
2762
- this.theme = p || (D.matches ? we : be);
2763
- const _ = document.createElement("div");
2764
- _.className = "map-canvas", this.map = _, this.container.setAttribute("tabindex", "0"), this.container.appendChild(this.map), this.el.appendChild(this.container), this.nodes = document.createElement("me-nodes"), this.lines = Q("lines"), this.summarySvg = Q("summary"), this.linkController = Q("linkcontroller"), this.P2 = document.createElement("div"), this.P3 = document.createElement("div"), this.P2.className = this.P3.className = "circle", this.P2.style.display = this.P3.style.display = "none", this.line1 = Re(), this.line2 = Re(), this.linkController.appendChild(this.line1), this.linkController.appendChild(this.line2), this.linkSvgGroup = Q("topiclinks"), this.labelContainer = document.createElement("div"), this.labelContainer.className = "label-container", this.map.appendChild(this.nodes), this.overflowHidden ? this.container.style.overflow = "hidden" : this.disposable.push(An(this)), C && (this.pasteHandler = C);
2616
+ if (N === "[object HTMLDivElement]" ? x = e : N === "[object String]" && (x = document.querySelector(e)), !x) throw new Error("MindElixir: el is not a valid element");
2617
+ x.style.position = "relative", x.innerHTML = "", this.el = x, this.disposable = [], this.before = r || {}, this.newTopicName = a || "New Node", this.contextMenu = o ?? !0, this.toolBar = s ?? !0, this.keypress = i ?? !0, this.mouseSelectionButton = l ?? 0, this.direction = t ?? 1, this.editable = n ?? !0, this.allowUndo = d ?? !0, this.scaleSensitivity = g ?? 0.1, this.scaleMax = m ?? 1.4, this.scaleMin = v ?? 0.2, this.generateMainBranch = h || Go, this.generateSubBranch = u || Vo, this.overflowHidden = y ?? !1, this.alignment = p ?? "root", this.handleWheel = E ?? !0, this.markdown = k || void 0, this.imageProxy = _ || void 0, this.currentNodes = [], this.currentArrow = null, this.scaleVal = 1, this.tempDirection = null, this.dragMoveHelper = Ko(this), this.bus = kn(), this.container = document.createElement("div"), this.selectionContainer = c || this.container, this.container.className = "map-container";
2618
+ const S = window.matchMedia("(prefers-color-scheme: dark)");
2619
+ this.theme = b || (S.matches ? we : ve);
2620
+ const A = document.createElement("div");
2621
+ A.className = "map-canvas", this.map = A, this.container.setAttribute("tabindex", "0"), this.container.appendChild(this.map), this.el.appendChild(this.container), this.nodes = document.createElement("me-nodes"), this.lines = Q("lines"), this.summarySvg = Q("summary"), this.linkController = Q("linkcontroller"), this.P2 = document.createElement("div"), this.P3 = document.createElement("div"), this.P2.className = this.P3.className = "circle", this.P2.style.display = this.P3.style.display = "none", this.line1 = Re(), this.line2 = Re(), this.linkController.appendChild(this.line1), this.linkController.appendChild(this.line2), this.linkSvgGroup = Q("topiclinks"), this.labelContainer = document.createElement("div"), this.labelContainer.className = "label-container", this.map.appendChild(this.nodes), this.overflowHidden ? this.container.style.overflow = "hidden" : this.disposable.push(_n(this)), C && (this.pasteHandler = C);
2765
2622
  }
2766
- I.prototype = Go;
2623
+ I.prototype = Fo;
2767
2624
  Object.defineProperty(I.prototype, "currentNode", {
2768
2625
  get() {
2769
2626
  return this.currentNodes[this.currentNodes.length - 1];
@@ -2773,22 +2630,22 @@ Object.defineProperty(I.prototype, "currentNode", {
2773
2630
  I.LEFT = 0;
2774
2631
  I.RIGHT = 1;
2775
2632
  I.SIDE = 2;
2776
- I.THEME = be;
2633
+ I.THEME = ve;
2777
2634
  I.DARK_THEME = we;
2778
- I.version = Ko;
2779
- I.E = et;
2635
+ I.version = zo;
2636
+ I.E = Ze;
2780
2637
  I.new = (e) => ({
2781
2638
  nodeData: {
2782
- id: V(),
2639
+ id: z(),
2783
2640
  topic: e || "new topic",
2784
2641
  children: []
2785
2642
  }
2786
2643
  });
2787
2644
  export {
2788
2645
  we as DARK_THEME,
2789
- Jo as LEFT,
2790
- Zo as RIGHT,
2791
- Qo as SIDE,
2792
- be as THEME,
2646
+ qo as LEFT,
2647
+ Uo as RIGHT,
2648
+ Jo as SIDE,
2649
+ ve as THEME,
2793
2650
  I as default
2794
2651
  };