@metadev/daga-react 4.2.14 → 4.2.16

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/index.mjs CHANGED
@@ -1,7 +1,7 @@
1
- import { jsx as v, jsxs as T, Fragment as ho } from "react/jsx-runtime";
2
- import * as x from "d3";
3
- import { debounceTime as go, Subject as Wt, merge as fo, map as uo } from "rxjs";
4
- import { createContext as Fe, useState as D, useContext as Dt, useRef as rt, useEffect as Ct, useMemo as po } from "react";
1
+ import { jsx as y, jsxs as M, Fragment as ho } from "react/jsx-runtime";
2
+ import * as L from "d3";
3
+ import { debounceTime as go, Subject as jt, merge as fo, map as uo } from "rxjs";
4
+ import { createContext as Fe, useState as D, useContext as Dt, useRef as rt, useEffect as St, useMemo as po } from "react";
5
5
  var g = /* @__PURE__ */ ((s) => (s.Bottom = "bottom", s.Left = "left", s.Right = "right", s.Top = "top", s))(g || {}), Kt = /* @__PURE__ */ ((s) => (s.BottomLeft = "bottom-left", s.BottomRight = "bottom-right", s.TopLeft = "top-left", s.TopRight = "top-right", s))(Kt || {}), Lt = /* @__PURE__ */ ((s) => (s.Left = "left", s.Center = "center", s.Right = "right", s))(Lt || {}), Jt = /* @__PURE__ */ ((s) => (s.Top = "top", s.Center = "center", s.Bottom = "bottom", s))(Jt || {});
6
6
  const It = (s) => [Math.round(s[0]), Math.round(s[1])], ut = (s, t, e) => t < e ? t <= s && s <= e : e <= s && s <= t, Le = (s, t, e) => (s - t[0]) / (t[1] - t[0]) * (e[1] - e[0]) + e[0], Qt = (s, t, e, a, l, r, i) => {
7
7
  const n = (() => {
@@ -65,9 +65,9 @@ const It = (s) => [Math.round(s[0]), Math.round(s[1])], ut = (s, t, e) => t < e
65
65
  s[1][1],
66
66
  s[0][1]
67
67
  ));
68
- var $ = /* @__PURE__ */ ((s) => (s.Blur = "blur", s.Change = "change", s.Click = "click", s.ContextMenu = "contextmenu", s.DoubleClick = "dblclick", s.Focus = "focus", s.FocusIn = "focusin", s.FocusOut = "focusout", s.Input = "input", s.KeyDown = "keydown", s.KeyUp = "keyup", s.MouseDown = "mousedown", s.MouseEnter = "mouseenter", s.MouseLeave = "mouseleave", s.MouseMove = "mousemove", s.MouseOut = "mouseout", s.MouseOver = "mouseover", s.MouseUp = "mouseup", s.TouchStart = "touchstart", s.TouchEnd = "touchend", s.Wheel = "wheel", s))($ || {}), Z = /* @__PURE__ */ ((s) => (s.Alt = "Alt", s.AltGraph = "AltGraph", s.ArrowDown = "ArrowDown", s.ArrowLeft = "ArrowLeft", s.ArrowRight = "ArrowRight", s.ArrowUp = "ArrowUp", s.Backspace = "Backspace", s.Control = "Control", s.Delete = "Delete", s.End = "End", s.Enter = "Enter", s.Escape = "Escape", s.Home = "Home", s.OS = "OS", s.PageDown = "PageDown", s.PageUp = "PageUp", s.Shift = "Shift", s.Tab = "Tab", s))(Z || {}), A = /* @__PURE__ */ ((s) => (s.Drag = "drag", s.Start = "start", s.End = "end", s))(A || {}), ue = /* @__PURE__ */ ((s) => (s.Zoom = "zoom", s.Start = "start", s.End = "end", s))(ue || {});
69
- const pe = (s) => s.replace(/([!"#$%&'()*+,\-./:;<=>?@[\\\]^`{|}])/g, "\\$1");
70
- var De = /* @__PURE__ */ ((s) => (s.Straight = "straight", s.Bezier = "bezier", s.Square = "square", s))(De || {}), Se = /* @__PURE__ */ ((s) => (s.Solid = "solid", s.Dashed = "dashed", s.GappedDashes = "gapped-dashes", s.Dotted = "dotted", s))(Se || {});
68
+ var $ = /* @__PURE__ */ ((s) => (s.Blur = "blur", s.Change = "change", s.Click = "click", s.ContextMenu = "contextmenu", s.DoubleClick = "dblclick", s.Focus = "focus", s.FocusIn = "focusin", s.FocusOut = "focusout", s.Input = "input", s.KeyDown = "keydown", s.KeyUp = "keyup", s.MouseDown = "mousedown", s.MouseEnter = "mouseenter", s.MouseLeave = "mouseleave", s.MouseMove = "mousemove", s.MouseOut = "mouseout", s.MouseOver = "mouseover", s.MouseUp = "mouseup", s.TouchStart = "touchstart", s.TouchEnd = "touchend", s.Wheel = "wheel", s))($ || {}), K = /* @__PURE__ */ ((s) => (s.Alt = "Alt", s.AltGraph = "AltGraph", s.ArrowDown = "ArrowDown", s.ArrowLeft = "ArrowLeft", s.ArrowRight = "ArrowRight", s.ArrowUp = "ArrowUp", s.Backspace = "Backspace", s.Control = "Control", s.Delete = "Delete", s.End = "End", s.Enter = "Enter", s.Escape = "Escape", s.Home = "Home", s.OS = "OS", s.PageDown = "PageDown", s.PageUp = "PageUp", s.Shift = "Shift", s.Tab = "Tab", s))(K || {}), A = /* @__PURE__ */ ((s) => (s.Drag = "drag", s.Start = "start", s.End = "end", s))(A || {}), pe = /* @__PURE__ */ ((s) => (s.Zoom = "zoom", s.Start = "start", s.End = "end", s))(pe || {});
69
+ const me = (s) => s.replace(/([!"#$%&'()*+,\-./:;<=>?@[\\\]^`{|}])/g, "\\$1");
70
+ var De = /* @__PURE__ */ ((s) => (s.Straight = "straight", s.Bezier = "bezier", s.Square = "square", s))(De || {}), Ce = /* @__PURE__ */ ((s) => (s.Solid = "solid", s.Dashed = "dashed", s.GappedDashes = "gapped-dashes", s.Dotted = "dotted", s))(Ce || {});
71
71
  const vo = 20, yo = (s, t, e, a, l) => {
72
72
  if (typeof s == "function")
73
73
  return s(
@@ -270,7 +270,7 @@ const vo = 20, yo = (s, t, e, a, l) => {
270
270
  }
271
271
  return r;
272
272
  }
273
- }, me = (s, t) => {
273
+ }, ve = (s, t) => {
274
274
  switch (s) {
275
275
  case "dotted":
276
276
  return `${t}`;
@@ -286,7 +286,7 @@ const vo = 20, yo = (s, t, e, a, l) => {
286
286
  return e >= 0 && s.splice(e, 1), s;
287
287
  };
288
288
  var Mt = /* @__PURE__ */ ((s) => (s.Ellipse = "ellipse", s.Empty = "empty", s.Folder = "folder", s.Hexagon = "hexagon", s.Octagon = "octagon", s.Pill = "pill", s.Rectangle = "rectangle", s.Rhombus = "rhombus", s.RoundedRectangle = "rounded-rectangle", s.StickyNote = "sticky-note", s))(Mt || {});
289
- const ve = (s, t, e, a, l) => {
289
+ const ye = (s, t, e, a, l) => {
290
290
  if (typeof s == "function")
291
291
  return s(t, e, a, l);
292
292
  switch (s) {
@@ -314,23 +314,23 @@ const ve = (s, t, e, a, l) => {
314
314
  return Ee(t, e, a, l);
315
315
  }
316
316
  }, Ye = (s, t, e, a) => `M ${s + e / 2} ${t} A ${e / 2} ${a / 2} 0 0 0 ${s + e / 2} ${t + a} A ${e / 2} ${a / 2} 0 1 0 ${s + e / 2} ${t} Z`, bo = () => "Z", ko = (s, t, e, a) => `M ${s} ${t} L ${s + e / 3} ${t} L ${s + e / 2} ${t + a / 6} L ${s + e} ${t + a / 6} L ${s + e} ${t + a} L ${s} ${t + a} Z`, wo = (s, t, e, a) => `M ${s + e / 4} ${t} L ${s + 3 * e / 4} ${t} L ${s + e} ${t + a / 2} L ${s + 3 * e / 4} ${t + a} L ${s + e / 4} ${t + a} L ${s} ${t + a / 2} Z`, So = (s, t, e, a) => `M ${s + e / 4} ${t} L ${s + 3 * e / 4} ${t} L ${s + e} ${t + a / 4} L ${s + e} ${t + 3 * a / 4} L ${s + 3 * e / 4} ${t + a} L ${s + e / 4} ${t + a} L ${s} ${t + 3 * a / 4} L ${s} ${t + a / 4} L ${s + e / 4} ${t} Z`, qt = (s, t, e, a) => a < e ? `M ${s + a / 2} ${t} L ${s + e - a / 2} ${t} A ${a / 2} ${a / 2} 0 0 1 ${s + e} ${t + a / 2} A ${a / 2} ${a / 2} 0 0 1 ${s + e - a / 2} ${t + a} L ${s + a / 2} ${t + a} A ${a / 2} ${a / 2} 0 0 1 ${s} ${t + a / 2} A ${a / 2} ${a / 2} 0 0 1 ${s + a / 2} ${t} Z` : a > e ? `M ${s} ${t + e / 2} L ${s} ${t + a - e / 2} A ${e / 2} ${e / 2} 0 0 0 ${s + e / 2} ${t + a} A ${e / 2} ${e / 2} 0 0 0 ${s + e} ${t + a - e / 2} L ${s + e} ${t + e / 2} A ${e / 2} ${e / 2} 0 0 0 ${s + e / 2} ${t} A ${e / 2} ${e / 2} 0 0 0 ${s} ${t + e / 2} Z` : Ye(s, t, e, a), Ee = (s, t, e, a) => `M ${s} ${t} L ${s + e} ${t} L ${s + e} ${t + a} L ${s} ${t + a} Z`, Co = (s, t, e, a) => `M ${s + e / 2} ${t} L ${s + e} ${t + a / 2} L ${s + e / 2} ${t + a} L ${s} ${t + a / 2} Z`, $o = (s, t, e, a) => `M ${s + e / 4} ${t} L ${s + 3 * e / 4} ${t} A ${e / 4} ${a / 4} 0 0 1 ${s + e} ${t + a / 4} L ${s + e} ${t + 3 * a / 4} A ${e / 4} ${a / 4} 0 0 1 ${s + 3 * e / 4} ${t + a} L ${s + e / 4} ${t + a} A ${e / 4} ${a / 4} 0 0 1 ${s} ${t + 3 * a / 4} L ${s} ${t + a / 4} A ${e / 4} ${a / 4} 0 0 1 ${s + e / 4} ${t} Z`, Ao = (s, t, e, a) => `M ${s} ${t} L ${s + 3 * e / 4} ${t} L ${s + 3 * e / 4} ${t + a / 4} L ${s + 3 * e / 4} ${t} L ${s + e} ${t + a / 4} L ${s + 3 * e / 4} ${t + a / 4} L ${s + e} ${t + a / 4} L ${s + e} ${t + a} L ${s} ${t + a} Z`;
317
- var L = /* @__PURE__ */ ((s) => (s.AllScroll = "all-scroll", s.Auto = "auto", s.Crosshair = "crosshair", s.EWResize = "ew-resize", s.Grab = "grab", s.Grabbing = "grabbing", s.Move = "move", s.NoDrop = "no-drop", s.NSResize = "ns-resize", s.NotAllowed = "not-allowed", s.ZoomIn = "zoom-in", s.ZoomOut = "zoom-out", s))(L || {});
317
+ var E = /* @__PURE__ */ ((s) => (s.AllScroll = "all-scroll", s.Auto = "auto", s.Crosshair = "crosshair", s.EWResize = "ew-resize", s.Grab = "grab", s.Grabbing = "grabbing", s.Move = "move", s.NoDrop = "no-drop", s.NSResize = "ns-resize", s.NotAllowed = "not-allowed", s.ZoomIn = "zoom-in", s.ZoomOut = "zoom-out", s))(E || {});
318
318
  const Io = (s) => Math.max(...s.split(`
319
- `).map((t) => t.length)), xo = (s) => s.match(/\n/g)?.length || 0, W = [];
319
+ `).map((t) => t.length)), xo = (s) => s.match(/\n/g)?.length || 0, j = [];
320
320
  for (let s = 0; s < 256; ++s)
321
- W.push((s + 256).toString(16).slice(1));
321
+ j.push((s + 256).toString(16).slice(1));
322
322
  function Lo(s, t = 0) {
323
- return (W[s[t + 0]] + W[s[t + 1]] + W[s[t + 2]] + W[s[t + 3]] + "-" + W[s[t + 4]] + W[s[t + 5]] + "-" + W[s[t + 6]] + W[s[t + 7]] + "-" + W[s[t + 8]] + W[s[t + 9]] + "-" + W[s[t + 10]] + W[s[t + 11]] + W[s[t + 12]] + W[s[t + 13]] + W[s[t + 14]] + W[s[t + 15]]).toLowerCase();
323
+ return (j[s[t + 0]] + j[s[t + 1]] + j[s[t + 2]] + j[s[t + 3]] + "-" + j[s[t + 4]] + j[s[t + 5]] + "-" + j[s[t + 6]] + j[s[t + 7]] + "-" + j[s[t + 8]] + j[s[t + 9]] + "-" + j[s[t + 10]] + j[s[t + 11]] + j[s[t + 12]] + j[s[t + 13]] + j[s[t + 14]] + j[s[t + 15]]).toLowerCase();
324
324
  }
325
- let ae;
325
+ let le;
326
326
  const Eo = new Uint8Array(16);
327
327
  function To() {
328
- if (!ae) {
328
+ if (!le) {
329
329
  if (typeof crypto > "u" || !crypto.getRandomValues)
330
330
  throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");
331
- ae = crypto.getRandomValues.bind(crypto);
331
+ le = crypto.getRandomValues.bind(crypto);
332
332
  }
333
- return ae(Eo);
333
+ return le(Eo);
334
334
  }
335
335
  const Mo = typeof crypto < "u" && crypto.randomUUID && crypto.randomUUID.bind(crypto), Te = { randomUUID: Mo };
336
336
  function No(s, t, e) {
@@ -343,14 +343,16 @@ function No(s, t, e) {
343
343
  function Me(s, t, e) {
344
344
  return Te.randomUUID && !s ? Te.randomUUID() : No(s);
345
345
  }
346
- const Nt = (s) => {
346
+ const Ct = (s) => {
347
347
  if (typeof s != "object")
348
348
  return s;
349
+ if (Array.isArray(s))
350
+ return s.map(Ct);
349
351
  const t = {};
350
352
  for (const e of Object.entries(s))
351
- typeof e[1] == "object" ? t[e[0]] = Nt(e[1]) : t[e[0]] = e[1];
353
+ t[e[0]] = Ct(e[1]);
352
354
  return t;
353
- }, st = (s) => {
355
+ }, nt = (s) => {
354
356
  const { selected: t, highlighted: e, selectedAndHighlighted: a, ...l } = s, r = l, i = {
355
357
  ...r,
356
358
  ...t
@@ -481,7 +483,7 @@ class ee {
481
483
  yield t;
482
484
  }
483
485
  }
484
- const Pt = 0;
486
+ const Nt = 0;
485
487
  class At {
486
488
  constructor(t, e) {
487
489
  this.selfRemoved = !1, this.selfRemovedTimestamp = null, this.model = t, this._id = e;
@@ -511,7 +513,7 @@ class At {
511
513
  * @private
512
514
  */
513
515
  select() {
514
- return this.model.canvas?.selectCanvasView()?.select(`[id='${pe(this.id)}']`);
516
+ return this.model.canvas?.selectCanvasView()?.select(`[id='${me(this.id)}']`);
515
517
  }
516
518
  }
517
519
  class ft extends ee {
@@ -557,7 +559,7 @@ class Po {
557
559
  this.name = t, this.label = e, this.type = a, this.defaultValue = l, this.basic = r, this.editable = i, this.rootAttribute = n, this.options = void 0, this.properties = void 0;
558
560
  }
559
561
  }
560
- var M = /* @__PURE__ */ ((s) => (s.Boolean = "boolean", s.Color = "color", s.Date = "date", s.Datetime = "datetime", s.Number = "number", s.Object = "object", s.Option = "option", s.OptionList = "option-list", s.OptionSet = "option-set", s.Text = "text", s.TextArea = "text-area", s.TextList = "text-list", s.TextSet = "text-set", s.TextMap = "text-map", s.Time = "time", s.Url = "url", s))(M || {});
562
+ var N = /* @__PURE__ */ ((s) => (s.Boolean = "boolean", s.Color = "color", s.Date = "date", s.Datetime = "datetime", s.Number = "number", s.Object = "object", s.Option = "option", s.OptionList = "option-list", s.OptionSet = "option-set", s.Text = "text", s.TextArea = "text-area", s.TextList = "text-list", s.TextSet = "text-set", s.TextMap = "text-map", s.Time = "time", s.Url = "url", s))(N || {});
561
563
  class oe {
562
564
  constructor(t = []) {
563
565
  this.propertyList = t, this.propertyMap = {};
@@ -577,10 +579,10 @@ class oe {
577
579
  function kt(s, t) {
578
580
  return !t || s[0] > t[0] ? !0 : s[0] === t[0] ? s[1] >= t[1] : !1;
579
581
  }
580
- const Ne = (s) => s == null || s === "" || s instanceof Array && s.length === 0 || s instanceof Object && Object.keys(s).length === 0, St = (s, t) => s === t || JSON.stringify(s) === JSON.stringify(t), Be = (s, t, e) => {
582
+ const Ne = (s) => s == null || s === "" || s instanceof Array && s.length === 0 || s instanceof Object && Object.keys(s).length === 0, wt = (s, t) => s === t || JSON.stringify(s) === JSON.stringify(t), Be = (s, t, e) => {
581
583
  const a = {}, l = {};
582
584
  for (const r in e.propertySet.propertyMap)
583
- if (e.propertySet.propertyMap[r].type === M.Object) {
585
+ if (e.propertySet.propertyMap[r].type === N.Object) {
584
586
  const i = Be(
585
587
  s[r],
586
588
  t[r],
@@ -588,7 +590,7 @@ const Ne = (s) => s == null || s === "" || s instanceof Array && s.length === 0
588
590
  );
589
591
  Object.keys(i[0]).length > 0 && Object.keys(i[1]).length > 0 && (a[r] = i[0], l[r] = i[1]);
590
592
  } else
591
- St(s[r], t[r]) || (a[r] = s[r], l[r] = t[r]);
593
+ wt(s[r], t[r]) || (a[r] = s[r], l[r] = t[r]);
592
594
  return [a, l];
593
595
  }, zo = (s) => s != null && s.constructor === Object;
594
596
  class yt {
@@ -652,7 +654,7 @@ class yt {
652
654
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
653
655
  getValue(t) {
654
656
  const e = this.propertySet.getProperty(t)?.rootAttribute;
655
- return e != null && (this.values[t] = this.getRootElementValue(e)), this.propertySet.getProperty(t).type === M.Object ? this.valueSets[t].getValues() : this.values[t];
657
+ return e != null && (this.values[t] = this.getRootElementValue(e)), this.propertySet.getProperty(t).type === N.Object ? this.valueSets[t].getValues() : this.values[t];
656
658
  }
657
659
  /**
658
660
  * Obtains all the values in the set.
@@ -662,7 +664,7 @@ class yt {
662
664
  getValues() {
663
665
  const t = {};
664
666
  for (const e in this.propertySet.propertyMap)
665
- this.propertySet.getProperty(e).type === M.Object ? t[e] = this.valueSets[e].getValues() : t[e] = this.getValue(e);
667
+ this.propertySet.getProperty(e).type === N.Object ? t[e] = this.valueSets[e].getValues() : t[e] = this.getValue(e);
666
668
  return t;
667
669
  }
668
670
  /**
@@ -673,7 +675,7 @@ class yt {
673
675
  getValuesForKeys(t) {
674
676
  const e = {};
675
677
  for (const a in t)
676
- this.propertySet.getProperty(a).type === M.Object ? e[a] = this.valueSets[a].getValuesForKeys(
678
+ this.propertySet.getProperty(a).type === N.Object ? e[a] = this.valueSets[a].getValuesForKeys(
677
679
  t[a]
678
680
  ) : e[a] = this.getValue(a);
679
681
  return e;
@@ -686,7 +688,7 @@ class yt {
686
688
  getTimestamps() {
687
689
  const t = {};
688
690
  for (const e in this.propertySet.propertyMap)
689
- if (this.propertySet.getProperty(e).type === M.Object)
691
+ if (this.propertySet.getProperty(e).type === N.Object)
690
692
  t[e] = this.valueSets[e].getTimestamps();
691
693
  else {
692
694
  const l = this.ownTimestamps[e];
@@ -712,7 +714,7 @@ class yt {
712
714
  */
713
715
  hasSetValue(t) {
714
716
  const e = this.getValue(t), a = this.propertySet.getProperty(t);
715
- return a && a.type === M.Object ? this.getSubValueSet(t).hasAnySetValue() : !Ne(e) && !St(e, a?.defaultValue);
717
+ return a && a.type === N.Object ? this.getSubValueSet(t).hasAnySetValue() : !Ne(e) && !wt(e, a?.defaultValue);
716
718
  }
717
719
  /**
718
720
  * Checks if any of the values in the set are not empty or the default value.
@@ -734,7 +736,7 @@ class yt {
734
736
  setValue(t, e) {
735
737
  const a = this.propertySet.getProperty(t);
736
738
  if (a) {
737
- a.type === M.Object ? this.valueSets[t].setValues(e) : (this.values[t] = e, St(e, a.defaultValue) || this.displayProperty(a));
739
+ a.type === N.Object ? this.valueSets[t].setValues(e) : (this.values[t] = e, wt(e, a.defaultValue) || this.displayProperty(a));
738
740
  const l = a.rootAttribute;
739
741
  l != null && this.setRootElementValue(l, e);
740
742
  }
@@ -747,7 +749,7 @@ class yt {
747
749
  setValues(t) {
748
750
  this.resetValues();
749
751
  for (const e in t)
750
- this.propertySet.getProperty(e).type === M.Object ? this.valueSets[e].setValues(
752
+ this.propertySet.getProperty(e).type === N.Object ? this.valueSets[e].setValues(
751
753
  t[e]
752
754
  ) : this.setValue(e, t[e]);
753
755
  }
@@ -759,7 +761,7 @@ class yt {
759
761
  setTimestamps(t) {
760
762
  this.ownTimestamps = {};
761
763
  for (const e in t)
762
- this.propertySet.getProperty(e).type === M.Object ? this.valueSets[e].setTimestamps(
764
+ this.propertySet.getProperty(e).type === N.Object ? this.valueSets[e].setTimestamps(
763
765
  t[e]
764
766
  ) : this.ownTimestamps[e] = t[e];
765
767
  }
@@ -770,7 +772,7 @@ class yt {
770
772
  */
771
773
  overwriteValues(t) {
772
774
  for (const e in t)
773
- this.propertySet.getProperty(e).type === M.Object ? this.valueSets[e].overwriteValues(
775
+ this.propertySet.getProperty(e).type === N.Object ? this.valueSets[e].overwriteValues(
774
776
  t[e]
775
777
  ) : this.setValue(e, t[e]);
776
778
  }
@@ -781,7 +783,7 @@ class yt {
781
783
  */
782
784
  overwriteValuesLww(t, e) {
783
785
  for (const a in t)
784
- this.propertySet.getProperty(a).type === M.Object ? this.valueSets[a].overwriteValuesLww(
786
+ this.propertySet.getProperty(a).type === N.Object ? this.valueSets[a].overwriteValuesLww(
785
787
  t[a],
786
788
  e
787
789
  ) : kt(e, this.ownTimestamps[a]) && (this.setValue(a, t[a]), this.ownTimestamps[a] = e);
@@ -795,7 +797,7 @@ class yt {
795
797
  this.displayedProperties = [], this.hiddenProperties = [], this.ownTimestamps = {};
796
798
  for (const t in this.propertySet.propertyMap) {
797
799
  const e = this.propertySet.getProperty(t), a = e.rootAttribute;
798
- e.type === M.Object ? this.valueSets[t] = this.constructSubValueSet(t) : this.values[t] = Nt(e.defaultValue), a != null && e.defaultValue !== void 0 && !St(
800
+ e.type === N.Object ? this.valueSets[t] = this.constructSubValueSet(t) : this.values[t] = Ct(e.defaultValue), a != null && e.defaultValue !== void 0 && !wt(
799
801
  this.getRootElementValue(a),
800
802
  e.defaultValue
801
803
  ) && this.setRootElementValue(a, this.values[t]), e.basic !== !1 ? this.displayedProperties.push(e) : this.hiddenProperties.push(e);
@@ -810,7 +812,7 @@ class yt {
810
812
  constructSubValueSet(t) {
811
813
  const e = this.propertySet.getProperty(t), a = new oe(e.properties), l = new yt(a, this.rootElement);
812
814
  return l.overwriteValues(
813
- Nt(e.defaultValue)
815
+ Ct(e.defaultValue)
814
816
  ), l;
815
817
  }
816
818
  /**
@@ -839,7 +841,7 @@ class yt {
839
841
  this.hiddenProperties.includes(t) || (this.hiddenProperties.push(t), B(this.displayedProperties, t));
840
842
  }
841
843
  }
842
- const et = {
844
+ const ot = {
843
845
  name: "",
844
846
  label: null,
845
847
  look: {
@@ -847,7 +849,7 @@ const et = {
847
849
  color: "#000000",
848
850
  thickness: 1,
849
851
  shape: De.Straight,
850
- style: Se.Solid,
852
+ style: Ce.Solid,
851
853
  selected: {
852
854
  color: "#AA00AA"
853
855
  },
@@ -864,20 +866,20 @@ const et = {
864
866
  class Xe {
865
867
  constructor(t) {
866
868
  const e = {
867
- ...et,
869
+ ...ot,
868
870
  ...t
869
871
  };
870
872
  this.id = e.id, this.name = e.name, this.label = e.label;
871
- const a = st(e.look);
873
+ const a = nt(e.look);
872
874
  if (this.defaultLook = a.defaultLook, this.selectedLook = a.selectedLook, this.highlightedLook = a.highlightedLook, this.selectedAndHighlightedLook = a.selectedAndHighlightedLook, e.startMarkerLook !== void 0) {
873
- const l = st(
875
+ const l = nt(
874
876
  e.startMarkerLook
875
877
  );
876
878
  this.defaultStartMarkerLook = l.defaultLook, this.selectedStartMarkerLook = l.selectedLook, this.highlightedStartMarkerLook = l.highlightedLook, this.selectedAndHighlightedStartMarkerLook = l.selectedAndHighlightedLook;
877
879
  } else
878
880
  this.defaultStartMarkerLook = null, this.selectedStartMarkerLook = null, this.highlightedStartMarkerLook = null, this.selectedAndHighlightedStartMarkerLook = null;
879
881
  if (e.endMarkerLook !== void 0) {
880
- const l = st(
882
+ const l = nt(
881
883
  e.endMarkerLook
882
884
  );
883
885
  this.defaultEndMarkerLook = l.defaultLook, this.selectedEndMarkerLook = l.selectedLook, this.highlightedEndMarkerLook = l.highlightedLook, this.selectedAndHighlightedEndMarkerLook = l.selectedAndHighlightedLook;
@@ -953,7 +955,7 @@ class dt extends At {
953
955
  */
954
956
  set lookConfig(t) {
955
957
  if (this._lookConfig = t, t) {
956
- const e = st(t);
958
+ const e = nt(t);
957
959
  this._defaultLook = {
958
960
  ...this._defaultLook,
959
961
  ...e.defaultLook
@@ -998,7 +1000,7 @@ class dt extends At {
998
1000
  */
999
1001
  set startMarkerLookConfig(t) {
1000
1002
  if (this._startMarkerLookConfig = t, t) {
1001
- const e = st(
1003
+ const e = nt(
1002
1004
  t
1003
1005
  );
1004
1006
  this._defaultStartMarkerLook = {
@@ -1045,7 +1047,7 @@ class dt extends At {
1045
1047
  */
1046
1048
  set endMarkerLookConfig(t) {
1047
1049
  if (this._endMarkerLookConfig = t, t) {
1048
- const e = st(t);
1050
+ const e = nt(t);
1049
1051
  this._defaultEndMarkerLook = {
1050
1052
  ...this._defaultEndMarkerLook,
1051
1053
  ...e.defaultLook
@@ -1069,7 +1071,7 @@ class dt extends At {
1069
1071
  this.model.canvas?.updateConnectionsInView(this.id);
1070
1072
  }
1071
1073
  raise() {
1072
- this.select()?.raise();
1074
+ this.select()?.raise(), this.start?.raise(!1), this.end?.raise(!1);
1073
1075
  }
1074
1076
  /**
1075
1077
  * Set the start of this connection to the given port or reset this connection's starting port if `undefined`.
@@ -1095,70 +1097,70 @@ class dt extends At {
1095
1097
  * @public
1096
1098
  */
1097
1099
  tighten() {
1098
- const t = this.model.canvas?.allowConnectionLoops || !1, e = this.model.canvas?.allowSharingPorts !== !1, a = this.model.canvas?.allowSharingBothPorts || !1;
1100
+ const t = this.model.canvas?.allowConnectionLoops || !1, e = this.model.canvas?.allowSharingPorts !== !1, a = this.model.canvas?.allowSharingBothPorts || !1, l = this.model.canvas?.tightenConnectionsAcrossPortTypes || !1;
1099
1101
  if (this.start?.rootElement && this.end) {
1100
- const l = this.start.rootElement.ports.map((r) => [
1101
- r,
1102
- r.distanceTo(this.end.coords)
1103
- ]).sort((r, i) => r[1] - i[1]).map((r) => r[0]);
1104
- t: for (const r of l) {
1105
- if (!t && r === this.end || !r.allowsOutgoing || !e && (r.incomingConnections.filter(
1106
- (i) => !i.removed && i !== this
1107
- ).length > 0 || r.outgoingConnections.filter(
1108
- (i) => !i.removed && i !== this
1102
+ const r = this.start.rootElement.ports.map((i) => [
1103
+ i,
1104
+ i.distanceTo(this.end.coords)
1105
+ ]).sort((i, n) => i[1] - n[1]).map((i) => i[0]);
1106
+ t: for (const i of r) {
1107
+ if (!t && i === this.end || !i.allowsOutgoing || !l && i.type !== this.start.type || !e && (i.incomingConnections.filter(
1108
+ (n) => !n.removed && n !== this
1109
+ ).length > 0 || i.outgoingConnections.filter(
1110
+ (n) => !n.removed && n !== this
1109
1111
  ).length > 0))
1110
1112
  continue t;
1111
1113
  if (!a) {
1112
- for (const i of r.outgoingConnections.filter(
1113
- (n) => !n.removed
1114
+ for (const n of i.outgoingConnections.filter(
1115
+ (o) => !o.removed
1114
1116
  ))
1115
- if (i !== this && i.end === this.end)
1117
+ if (n !== this && n.end === this.end)
1116
1118
  continue t;
1117
- for (const i of r.incomingConnections.filter(
1118
- (n) => !n.removed
1119
+ for (const n of i.incomingConnections.filter(
1120
+ (o) => !o.removed
1119
1121
  ))
1120
- if (i !== this && i.start === this.end)
1122
+ if (n !== this && n.start === this.end)
1121
1123
  continue t;
1122
1124
  }
1123
- if (r === this.start)
1125
+ if (i === this.start)
1124
1126
  break t;
1125
- this.setStart(r);
1127
+ this.setStart(i);
1126
1128
  break t;
1127
1129
  }
1128
1130
  }
1129
1131
  if (this.end?.rootElement && this.start) {
1130
- const l = this.end.rootElement.ports.map((r) => [
1131
- r,
1132
- r.distanceTo(this.start.coords)
1133
- ]).sort((r, i) => r[1] - i[1]).map((r) => r[0]);
1134
- t: for (const r of l) {
1135
- if (!t && r === this.start || !r.allowsIncoming || !e && (r.incomingConnections.filter(
1136
- (i) => !i.removed && i !== this
1137
- ).length > 0 || r.outgoingConnections.filter(
1138
- (i) => !i.removed && i !== this
1132
+ const r = this.end.rootElement.ports.map((i) => [
1133
+ i,
1134
+ i.distanceTo(this.start.coords)
1135
+ ]).sort((i, n) => i[1] - n[1]).map((i) => i[0]);
1136
+ t: for (const i of r) {
1137
+ if (!t && i === this.start || !i.allowsIncoming || !l && i.type !== this.end.type || !e && (i.incomingConnections.filter(
1138
+ (n) => !n.removed && n !== this
1139
+ ).length > 0 || i.outgoingConnections.filter(
1140
+ (n) => !n.removed && n !== this
1139
1141
  ).length > 0))
1140
1142
  continue t;
1141
1143
  if (!a) {
1142
- for (const i of r.incomingConnections.filter(
1143
- (n) => !n.removed
1144
+ for (const n of i.incomingConnections.filter(
1145
+ (o) => !o.removed
1144
1146
  ))
1145
- if (i !== this && i.start === this.start)
1147
+ if (n !== this && n.start === this.start)
1146
1148
  continue t;
1147
- for (const i of r.outgoingConnections.filter(
1148
- (n) => !n.removed
1149
+ for (const n of i.outgoingConnections.filter(
1150
+ (o) => !o.removed
1149
1151
  ))
1150
- if (i !== this && i.end === this.start)
1152
+ if (n !== this && n.end === this.start)
1151
1153
  continue t;
1152
1154
  }
1153
- if (r === this.end)
1155
+ if (i === this.end)
1154
1156
  break t;
1155
- this.setEnd(r);
1157
+ this.setEnd(i);
1156
1158
  break t;
1157
1159
  }
1158
1160
  }
1159
1161
  }
1160
1162
  getPriority() {
1161
- return this.start ? this.end ? Math.min(this.start.getPriority(), this.end.getPriority()) : this.start.getPriority() : this.end ? this.end.getPriority() : Pt;
1163
+ return this.start ? this.end ? Math.min(this.start.getPriority(), this.end.getPriority()) : this.start.getPriority() : this.end ? this.end.getPriority() : Nt;
1162
1164
  }
1163
1165
  }
1164
1166
  class Ro extends ft {
@@ -1197,7 +1199,7 @@ class Ro extends ft {
1197
1199
  a,
1198
1200
  l
1199
1201
  );
1200
- return super.add(i), i.updateInView(), i.valueSet.resetValues(), i;
1202
+ return super.add(i), i.updateInView(), i.valueSet.resetValues(), i.start?.raise(!1), i.end?.raise(!1), i;
1201
1203
  }
1202
1204
  remove(t) {
1203
1205
  const e = this.get(t, !0);
@@ -1221,10 +1223,10 @@ const V = {
1221
1223
  };
1222
1224
  class ht extends At {
1223
1225
  constructor(t, e, a, l, r, i, n, o, d, c, h, f, b, m, p, u) {
1224
- const y = `${e?.id}_field`;
1225
- if (t.fields.get(y) !== void 0)
1226
+ const v = `${e?.id}_field`;
1227
+ if (t.fields.get(v) !== void 0)
1226
1228
  throw new Error("DiagramField for rootElement already exists");
1227
- if (super(t, y), this.textTimestamp = null, this.rootElement = e, this.coords = a, this.width = l, this.height = r, this.fontSize = i, this.fontFamily = n, this.color = o, this.selectedColor = d, this.horizontalAlign = c, this.verticalAlign = h, !isNaN(Number(f)))
1229
+ if (super(t, v), this.textTimestamp = null, this.rootElement = e, this.coords = a, this.width = l, this.height = r, this.fontSize = i, this.fontFamily = n, this.color = o, this.selectedColor = d, this.horizontalAlign = c, this.verticalAlign = h, !isNaN(Number(f)))
1228
1230
  this.orientation = Number(f);
1229
1231
  else
1230
1232
  switch (f) {
@@ -1273,7 +1275,7 @@ class ht extends At {
1273
1275
  this.coords = t, this.updateInView();
1274
1276
  }
1275
1277
  getPriority() {
1276
- return this.rootElement?.getPriority() || Pt;
1278
+ return this.rootElement?.getPriority() || Nt;
1277
1279
  }
1278
1280
  }
1279
1281
  class Vo extends ft {
@@ -1314,7 +1316,7 @@ class Vo extends ft {
1314
1316
  e && (e.rootElement?.label !== void 0 && e.rootElement.label === e && (e.rootElement.label = void 0), super.remove(t), e.updateInView());
1315
1317
  }
1316
1318
  }
1317
- const K = (s) => s?.margin === null || s?.margin === void 0 ? V.margin : typeof s.margin == "number" ? s.margin : s.margin.length === 0 ? V.margin : s.margin.length === 1 || s.margin.length === 2 ? s.margin[0] : (s.margin.length === 3, s.margin[2]), Y = (s) => s?.margin === null || s?.margin === void 0 ? V.margin : typeof s.margin == "number" ? s.margin : s.margin.length === 0 ? V.margin : s.margin.length === 1 ? s.margin[0] : s.margin.length === 2 || s.margin.length === 3 ? s.margin[1] : s.margin[3], ot = (s) => s?.margin === null || s?.margin === void 0 ? V.margin : typeof s.margin == "number" ? s.margin : s.margin.length === 0 ? V.margin : s.margin.length === 1 ? s.margin[0] : (s.margin.length === 2 || s.margin.length === 3, s.margin[1]), U = (s) => s?.margin === null || s?.margin === void 0 ? V.margin : typeof s.margin == "number" ? s.margin : s.margin.length === 0 ? V.margin : (s.margin.length === 1 || s.margin.length === 2 || s.margin.length === 3, s.margin[0]), Vt = (s) => s?.padding === null || s?.padding === void 0 ? V.padding : typeof s.padding == "number" ? s.padding : s.padding.length === 0 ? V.padding : s.padding.length === 1 || s.padding.length === 2 ? s.padding[0] : (s.padding.length === 3, s.padding[2]), Ot = (s) => s?.padding === null || s?.padding === void 0 ? V.padding : typeof s.padding == "number" ? s.padding : s.padding.length === 0 ? V.padding : s.padding.length === 1 ? s.padding[0] : s.padding.length === 2 || s.padding.length === 3 ? s.padding[1] : s.padding[3], Ht = (s) => s?.padding === null || s?.padding === void 0 ? V.padding : typeof s.padding == "number" ? s.padding : s.padding.length === 0 ? V.padding : s.padding.length === 1 ? s.padding[0] : (s.padding.length === 2 || s.padding.length === 3, s.padding[1]), _t = (s) => s?.padding === null || s?.padding === void 0 ? V.padding : typeof s.padding == "number" ? s.padding : s.padding.length === 0 ? V.padding : (s.padding.length === 1 || s.padding.length === 2 || s.padding.length === 3, s.padding[0]);
1319
+ const q = (s) => s?.margin === null || s?.margin === void 0 ? V.margin : typeof s.margin == "number" ? s.margin : s.margin.length === 0 ? V.margin : s.margin.length === 1 || s.margin.length === 2 ? s.margin[0] : (s.margin.length === 3, s.margin[2]), Y = (s) => s?.margin === null || s?.margin === void 0 ? V.margin : typeof s.margin == "number" ? s.margin : s.margin.length === 0 ? V.margin : s.margin.length === 1 ? s.margin[0] : s.margin.length === 2 || s.margin.length === 3 ? s.margin[1] : s.margin[3], it = (s) => s?.margin === null || s?.margin === void 0 ? V.margin : typeof s.margin == "number" ? s.margin : s.margin.length === 0 ? V.margin : s.margin.length === 1 ? s.margin[0] : (s.margin.length === 2 || s.margin.length === 3, s.margin[1]), U = (s) => s?.margin === null || s?.margin === void 0 ? V.margin : typeof s.margin == "number" ? s.margin : s.margin.length === 0 ? V.margin : (s.margin.length === 1 || s.margin.length === 2 || s.margin.length === 3, s.margin[0]), Vt = (s) => s?.padding === null || s?.padding === void 0 ? V.padding : typeof s.padding == "number" ? s.padding : s.padding.length === 0 ? V.padding : s.padding.length === 1 || s.padding.length === 2 ? s.padding[0] : (s.padding.length === 3, s.padding[2]), Ot = (s) => s?.padding === null || s?.padding === void 0 ? V.padding : typeof s.padding == "number" ? s.padding : s.padding.length === 0 ? V.padding : s.padding.length === 1 ? s.padding[0] : s.padding.length === 2 || s.padding.length === 3 ? s.padding[1] : s.padding[3], Ht = (s) => s?.padding === null || s?.padding === void 0 ? V.padding : typeof s.padding == "number" ? s.padding : s.padding.length === 0 ? V.padding : s.padding.length === 1 ? s.padding[0] : (s.padding.length === 2 || s.padding.length === 3, s.padding[1]), _t = (s) => s?.padding === null || s?.padding === void 0 ? V.padding : typeof s.padding == "number" ? s.padding : s.padding.length === 0 ? V.padding : (s.padding.length === 1 || s.padding.length === 2 || s.padding.length === 3, s.padding[0]);
1318
1320
  var Gt = /* @__PURE__ */ ((s) => (s[s.OnlyWhenSelected = 0] = "OnlyWhenSelected", s))(Gt || {});
1319
1321
  const Pe = 1, ze = 1, Oo = 1, Ho = 1;
1320
1322
  class _o {
@@ -1330,8 +1332,8 @@ class _o {
1330
1332
  }
1331
1333
  class Go {
1332
1334
  constructor(t) {
1333
- this.label = t.label || null, this.ports = t.ports || [], this.priority = t.priority || Pt, this.resizableX = t.resizableX, this.resizableY = t.resizableY;
1334
- const e = st(t.look || je);
1335
+ this.label = t.label || null, this.ports = t.ports || [], this.priority = t.priority || Nt, this.resizableX = t.resizableX, this.resizableY = t.resizableY;
1336
+ const e = nt(t.look || We);
1335
1337
  this.defaultLook = e.defaultLook, this.selectedLook = e.selectedLook, this.highlightedLook = e.highlightedLook, this.selectedAndHighlightedLook = e.selectedAndHighlightedLook;
1336
1338
  }
1337
1339
  }
@@ -1381,7 +1383,7 @@ class F extends At {
1381
1383
  */
1382
1384
  set lookConfig(t) {
1383
1385
  if (this._lookConfig = t, t) {
1384
- const e = st(t);
1386
+ const e = nt(t);
1385
1387
  this._defaultLook = {
1386
1388
  ...this._defaultLook,
1387
1389
  ...e.defaultLook
@@ -1421,7 +1423,7 @@ class F extends At {
1421
1423
  return this.node?.type?.sectionGrid?.minHeights?.[this.indexYInNode] || Ho;
1422
1424
  }
1423
1425
  getPriority() {
1424
- return this.node?.type?.sectionGrid?.sections?.[this.indexYInNode]?.[this.indexXInNode]?.priority || Pt;
1426
+ return this.node?.type?.sectionGrid?.sections?.[this.indexYInNode]?.[this.indexXInNode]?.priority || Nt;
1425
1427
  }
1426
1428
  /**
1427
1429
  * Returns whether this section can be resized horizontally.
@@ -1575,7 +1577,7 @@ class F extends At {
1575
1577
  this.label && (this.label.coords = [
1576
1578
  this.coords[0] + Y(i?.label),
1577
1579
  this.coords[1] + U(i?.label)
1578
- ], this.label.width = this.width - Y(i?.label) - ot(i?.label), this.label.height = this.height - U(i?.label) - K(i?.label), this.label.updateInView());
1580
+ ], this.label.width = this.width - Y(i?.label) - it(i?.label), this.label.height = this.height - U(i?.label) - q(i?.label), this.label.updateInView());
1579
1581
  for (const n of this.decorators)
1580
1582
  n.move(
1581
1583
  Qt(
@@ -1639,28 +1641,28 @@ class Fo extends ft {
1639
1641
  ...V,
1640
1642
  ...b.type?.label
1641
1643
  }, p = 6 * m.fontSize + Ot(m) + Ht(m), u = m.fontSize + _t(m) + Vt(m);
1642
- let y;
1644
+ let v;
1643
1645
  switch (b.direction) {
1644
1646
  case g.Bottom:
1645
1647
  case g.Left:
1646
1648
  case g.Right:
1647
- y = [
1649
+ v = [
1648
1650
  b.coords[0] - p / 2,
1649
- b.coords[1] - u - K(m)
1651
+ b.coords[1] - u - q(m)
1650
1652
  ];
1651
1653
  break;
1652
1654
  case g.Top:
1653
- y = [
1655
+ v = [
1654
1656
  b.coords[0] - p / 2,
1655
1657
  b.coords[1] + U(m)
1656
1658
  ];
1657
1659
  break;
1658
1660
  default:
1659
- y = b.coords;
1661
+ v = b.coords;
1660
1662
  }
1661
1663
  this.model.fields.new(
1662
1664
  b,
1663
- y,
1665
+ v,
1664
1666
  m.fontSize,
1665
1667
  m.fontFamily,
1666
1668
  m.color,
@@ -1693,8 +1695,8 @@ class Fo extends ft {
1693
1695
  h.fontFamily,
1694
1696
  h.color,
1695
1697
  h.selectedColor,
1696
- o.width - Y(h) - ot(h),
1697
- o.height - U(h) - K(h),
1698
+ o.width - Y(h) - it(h),
1699
+ o.height - U(h) - q(h),
1698
1700
  h.horizontalAlign,
1699
1701
  h.verticalAlign,
1700
1702
  h.orientation,
@@ -1715,7 +1717,7 @@ class Fo extends ft {
1715
1717
  }
1716
1718
  }
1717
1719
  }
1718
- const je = {
1720
+ const We = {
1719
1721
  lookType: "shaped-look",
1720
1722
  shape: Mt.Rectangle,
1721
1723
  fillColor: "#FFFFFF",
@@ -1742,21 +1744,21 @@ const je = {
1742
1744
  ports: [],
1743
1745
  decorators: [],
1744
1746
  sectionGrid: null,
1745
- look: je,
1747
+ look: We,
1746
1748
  isUnique: !1,
1747
1749
  canBeParentless: !0,
1748
1750
  childrenTypes: [],
1749
- priority: Pt,
1751
+ priority: Nt,
1750
1752
  properties: []
1751
1753
  };
1752
- class We {
1754
+ class je {
1753
1755
  constructor(t) {
1754
1756
  const e = {
1755
1757
  ...gt,
1756
1758
  ...t
1757
1759
  };
1758
1760
  this.id = e.id, this.name = e.name, this.defaultWidth = e.defaultWidth, this.defaultHeight = e.defaultHeight, this.minWidth = e.minWidth, this.minHeight = e.minHeight, this.resizableX = e.resizableX, this.resizableY = e.resizableY, this.snapToGridOffset = e.snapToGridOffset, this.bottomPadding = Do(e), this.leftPadding = Yo(e), this.rightPadding = Bo(e), this.topPadding = Xo(e), this.label = e.label, this.ports = e.ports, this.decorators = e.decorators, this.sectionGrid = e.sectionGrid ? new _o(e.sectionGrid) : null;
1759
- const a = st(e.look);
1761
+ const a = nt(e.look);
1760
1762
  this.defaultLook = a.defaultLook, this.selectedLook = a.selectedLook, this.highlightedLook = a.highlightedLook, this.selectedAndHighlightedLook = a.selectedAndHighlightedLook, this.isUnique = e.isUnique, this.canBeParentless = e.canBeParentless, this.childrenTypes = e.childrenTypes, this.priority = e.priority, this.propertySet = new oe(t?.properties || []);
1761
1763
  }
1762
1764
  }
@@ -1821,7 +1823,7 @@ class z extends At {
1821
1823
  */
1822
1824
  set lookConfig(t) {
1823
1825
  if (this._lookConfig = t, t) {
1824
- const e = st(t);
1826
+ const e = nt(t);
1825
1827
  this._defaultLook = {
1826
1828
  ...this._defaultLook,
1827
1829
  ...e.defaultLook
@@ -2212,7 +2214,7 @@ class z extends At {
2212
2214
  this.label && (this.label.coords = [
2213
2215
  this.coords[0] + Y(this.type.label),
2214
2216
  this.coords[1] + U(this.type.label)
2215
- ], this.label.width = this.width - Y(this.type.label) - ot(this.type.label), this.label.height = this.height - U(this.type.label) - K(this.type.label), this.label.updateInView());
2217
+ ], this.label.width = this.width - Y(this.type.label) - it(this.type.label), this.label.height = this.height - U(this.type.label) - q(this.type.label), this.label.updateInView());
2216
2218
  for (const i of this.decorators)
2217
2219
  i.move(
2218
2220
  Qt(
@@ -2348,7 +2350,7 @@ class Uo extends ft {
2348
2350
  */
2349
2351
  new(t, e, a) {
2350
2352
  let l;
2351
- if (t instanceof We)
2353
+ if (t instanceof je)
2352
2354
  l = t;
2353
2355
  else {
2354
2356
  const i = this.types.get(t);
@@ -2404,7 +2406,7 @@ class Uo extends ft {
2404
2406
  case g.Right:
2405
2407
  b = [
2406
2408
  d.coords[0] - h / 2,
2407
- d.coords[1] - f - K(c)
2409
+ d.coords[1] - f - q(c)
2408
2410
  ];
2409
2411
  break;
2410
2412
  case g.Top:
@@ -2450,8 +2452,8 @@ class Uo extends ft {
2450
2452
  i.fontFamily,
2451
2453
  i.color,
2452
2454
  i.selectedColor,
2453
- r.width - Y(i) - ot(i),
2454
- r.height - U(i) - K(i),
2455
+ r.width - Y(i) - it(i),
2456
+ r.height - U(i) - q(i),
2455
2457
  i.horizontalAlign,
2456
2458
  i.verticalAlign,
2457
2459
  i.orientation,
@@ -2526,7 +2528,7 @@ const Ze = (s) => {
2526
2528
  highlighted: {
2527
2529
  fillColor: "rgba(0, 255, 255, 0.5)"
2528
2530
  }
2529
- }, Zt = st(Ke), qe = {
2531
+ }, Zt = nt(Ke), qe = {
2530
2532
  name: "",
2531
2533
  label: null,
2532
2534
  allowsOutgoing: !0,
@@ -2534,14 +2536,14 @@ const Ze = (s) => {
2534
2536
  width: 24,
2535
2537
  look: Ke
2536
2538
  };
2537
- class jo {
2539
+ class Wo {
2538
2540
  constructor(t) {
2539
2541
  const e = {
2540
2542
  ...qe,
2541
2543
  ...t
2542
2544
  };
2543
2545
  this.id = e.id, this.name = e.name, this.label = e.label, this.allowsOutgoing = e.allowsOutgoing, this.allowsIncoming = e.allowsIncoming, this.width = e.width;
2544
- const a = st(e.look);
2546
+ const a = nt(e.look);
2545
2547
  this.defaultLook = a.defaultLook, this.selectedLook = a.selectedLook, this.highlightedLook = a.highlightedLook, this.selectedAndHighlightedLook = a.selectedAndHighlightedLook;
2546
2548
  }
2547
2549
  }
@@ -2621,7 +2623,7 @@ class bt extends At {
2621
2623
  */
2622
2624
  set lookConfig(t) {
2623
2625
  if (this._lookConfig = t, t) {
2624
- const e = st(
2626
+ const e = nt(
2625
2627
  t
2626
2628
  );
2627
2629
  this._defaultLook = {
@@ -2660,12 +2662,13 @@ class bt extends At {
2660
2662
  updateInView() {
2661
2663
  this.model.canvas?.updatePortsInView(this.id);
2662
2664
  }
2663
- raise() {
2664
- this.select()?.raise(), this.label && this.label.raise();
2665
- for (const t of this.incomingConnections)
2666
- t.raise();
2667
- for (const t of this.outgoingConnections)
2668
- t.raise();
2665
+ raise(t = !0) {
2666
+ if (this.select()?.raise(), this.label && this.label.raise(), t) {
2667
+ for (const e of this.incomingConnections)
2668
+ e.raise();
2669
+ for (const e of this.outgoingConnections)
2670
+ e.raise();
2671
+ }
2669
2672
  }
2670
2673
  /**
2671
2674
  * Add a connection to this port's list of outgoing connections.
@@ -2695,7 +2698,7 @@ class bt extends At {
2695
2698
  return this.rootElement.node;
2696
2699
  }
2697
2700
  getPriority() {
2698
- return this.rootElement?.getPriority() || Pt;
2701
+ return this.rootElement?.getPriority() || Nt;
2699
2702
  }
2700
2703
  /**
2701
2704
  * Change the coordinates of this port to the given coordinates and move its labels correspondingly.
@@ -2721,7 +2724,7 @@ class bt extends At {
2721
2724
  return Ue(this.coords, t);
2722
2725
  }
2723
2726
  }
2724
- class Wo extends ft {
2727
+ class jo extends ft {
2725
2728
  /**
2726
2729
  * Instance a set of ports for the given model. This method is used internally.
2727
2730
  * @private
@@ -2771,50 +2774,48 @@ class Je {
2771
2774
  const a = t.nodes.types.get(e.type);
2772
2775
  if (a) {
2773
2776
  const l = new z(t, a, e.coords, e.id);
2774
- if (t.nodes.add(l), l.width = e.width, l.height = e.height, e.label) {
2775
- if (a.decorators)
2776
- for (let i = 0; i < a.decorators.length; ++i) {
2777
- const n = a.decorators[i];
2778
- t.decorators.new(
2779
- l,
2780
- [
2781
- l.coords[0] + n.coords[0],
2782
- l.coords[1] + n.coords[1]
2783
- ],
2784
- n.width,
2785
- n.height,
2786
- l.getPriority(),
2787
- n.html,
2788
- `${l.id}_decorator_${i}`
2789
- );
2790
- }
2791
- if (a.label) {
2792
- const i = {
2793
- ...V,
2794
- ...a.label
2795
- }, n = new ht(
2796
- t,
2777
+ if (t.nodes.add(l), l.width = e.width, l.height = e.height, a.decorators)
2778
+ for (let i = 0; i < a.decorators.length; ++i) {
2779
+ const n = a.decorators[i];
2780
+ t.decorators.new(
2797
2781
  l,
2798
2782
  [
2799
- l.coords[0] + Y(i),
2800
- l.coords[1] + U(i)
2783
+ l.coords[0] + n.coords[0],
2784
+ l.coords[1] + n.coords[1]
2801
2785
  ],
2802
- l.width - Y(i) - ot(i),
2803
- l.height - U(i) - K(i),
2804
- i.fontSize,
2805
- i.fontFamily,
2806
- i.color,
2807
- i.selectedColor,
2808
- i.horizontalAlign,
2809
- i.verticalAlign,
2810
- i.orientation,
2811
- "",
2812
- i.editable,
2813
- i.fit,
2814
- i.shrink
2786
+ n.width,
2787
+ n.height,
2788
+ l.getPriority(),
2789
+ n.html,
2790
+ `${l.id}_decorator_${i}`
2815
2791
  );
2816
- n.text = e.label, l.label = n, t.fields.add(n), n.updateInView();
2817
2792
  }
2793
+ if (a.label) {
2794
+ const i = {
2795
+ ...V,
2796
+ ...a.label
2797
+ }, n = new ht(
2798
+ t,
2799
+ l,
2800
+ [
2801
+ l.coords[0] + Y(i),
2802
+ l.coords[1] + U(i)
2803
+ ],
2804
+ l.width - Y(i) - it(i),
2805
+ l.height - U(i) - q(i),
2806
+ i.fontSize,
2807
+ i.fontFamily,
2808
+ i.color,
2809
+ i.selectedColor,
2810
+ i.horizontalAlign,
2811
+ i.verticalAlign,
2812
+ i.orientation,
2813
+ "",
2814
+ i.editable,
2815
+ i.fit,
2816
+ i.shrink
2817
+ );
2818
+ n.text = e.label, l.label = n, t.fields.add(n), n.updateInView();
2818
2819
  }
2819
2820
  for (const i of e.children || []) {
2820
2821
  const n = this.importNode(t, i);
@@ -2831,7 +2832,7 @@ class Je {
2831
2832
  i.height,
2832
2833
  i.id
2833
2834
  );
2834
- if (l.sections?.push(n), t.sections.add(n), i.label && a.sectionGrid?.sections?.[i.indexYInNode]?.[i.indexXInNode]?.label) {
2835
+ if (l.sections?.push(n), t.sections.add(n), a.sectionGrid?.sections?.[i.indexYInNode]?.[i.indexXInNode]?.label) {
2835
2836
  const d = {
2836
2837
  ...V,
2837
2838
  ...a.sectionGrid?.sections?.[i.indexYInNode]?.[i.indexXInNode]?.label
@@ -2842,8 +2843,8 @@ class Je {
2842
2843
  n.coords[0] + Y(d),
2843
2844
  n.coords[1] + U(d)
2844
2845
  ],
2845
- n.width - Y(d) - ot(d),
2846
- n.height - U(d) - K(d),
2846
+ n.width - Y(d) - it(d),
2847
+ n.height - U(d) - q(d),
2847
2848
  d.fontSize,
2848
2849
  d.fontFamily,
2849
2850
  d.color,
@@ -3022,7 +3023,7 @@ class ie {
3022
3023
  do() {
3023
3024
  const t = this.canvas.model.nodes.new(this.typeId, this.coords, this.id);
3024
3025
  this.parentId !== void 0 && this.canvas.model.nodes.get(this.parentId)?.addChild(t), t.label && (t.label.text = this.label || ""), this.values !== void 0 ? t.valueSet.setValues(
3025
- Nt({
3026
+ Ct({
3026
3027
  ...t.valueSet.getValues(),
3027
3028
  ...this.values
3028
3029
  })
@@ -3051,7 +3052,7 @@ class ie {
3051
3052
  );
3052
3053
  }
3053
3054
  }
3054
- class Ce {
3055
+ class $e {
3055
3056
  constructor(t, e, a, l, r, i, n) {
3056
3057
  this.canvas = t, this.nodeId = e, this.copyColumnIndex = a, this.copyRowIndex = l, this.removeColumnIndex = r, this.removeRowIndex = i, this.timestamp = n;
3057
3058
  }
@@ -3071,7 +3072,7 @@ class Ce {
3071
3072
  };
3072
3073
  }
3073
3074
  static deserialize(t, e) {
3074
- return new Ce(
3075
+ return new $e(
3075
3076
  t,
3076
3077
  e.nodeId,
3077
3078
  e.copyColumnIndex,
@@ -3082,7 +3083,7 @@ class Ce {
3082
3083
  );
3083
3084
  }
3084
3085
  }
3085
- class $e {
3086
+ class Ae {
3086
3087
  constructor(t, e, a) {
3087
3088
  this.canvas = t, this.to = e, this.timestamp = a;
3088
3089
  }
@@ -3103,7 +3104,7 @@ class $e {
3103
3104
  };
3104
3105
  }
3105
3106
  static deserialize(t, e) {
3106
- return new $e(
3107
+ return new Ae(
3107
3108
  t,
3108
3109
  e.to,
3109
3110
  e.timestamp
@@ -3140,7 +3141,7 @@ class Ft {
3140
3141
  );
3141
3142
  }
3142
3143
  }
3143
- class it {
3144
+ class st {
3144
3145
  constructor(t, e, a, l) {
3145
3146
  this.canvas = t, this.nodeId = e, this.to = a, this.timestamp = l;
3146
3147
  }
@@ -3165,7 +3166,7 @@ class it {
3165
3166
  };
3166
3167
  }
3167
3168
  static deserialize(t, e) {
3168
- return new it(
3169
+ return new st(
3169
3170
  t,
3170
3171
  e.nodeId,
3171
3172
  e.to,
@@ -3399,11 +3400,11 @@ class Zo {
3399
3400
  break;
3400
3401
  }
3401
3402
  case "addSection": {
3402
- Ce.deserialize(this.canvas, t).do();
3403
+ $e.deserialize(this.canvas, t).do();
3403
3404
  break;
3404
3405
  }
3405
3406
  case "applyLayout": {
3406
- $e.deserialize(
3407
+ Ae.deserialize(
3407
3408
  this.canvas,
3408
3409
  t
3409
3410
  ).do();
@@ -3414,7 +3415,7 @@ class Zo {
3414
3415
  break;
3415
3416
  }
3416
3417
  case "setGeometry": {
3417
- it.deserialize(
3418
+ st.deserialize(
3418
3419
  this.canvas,
3419
3420
  t
3420
3421
  ).do();
@@ -3513,7 +3514,7 @@ class Ko {
3513
3514
  });
3514
3515
  }
3515
3516
  }
3516
- var w = /* @__PURE__ */ ((s) => (s.AddConnection = "add-connection", s.AddNode = "add-node", s.AddSectionAction = "add-section", s.ApplyLayout = "apply-layout", s.Clipboard = "clipboard", s.ContextMenu = "context-menu", s.EditField = "edit-field", s.MoveNode = "move-node", s.Paste = "paste", s.Remove = "remove", s.StretchNode = "stretch-node", s.StretchSection = "stretch-section", s.UpdateValues = "update-values", s.Zoom = "zoom", s))(w || {});
3517
+ var k = /* @__PURE__ */ ((s) => (s.AddConnection = "add-connection", s.AddNode = "add-node", s.AddSectionAction = "add-section", s.ApplyLayout = "apply-layout", s.Clipboard = "clipboard", s.ContextMenu = "context-menu", s.EditField = "edit-field", s.MoveNode = "move-node", s.Paste = "paste", s.Remove = "remove", s.StretchNode = "stretch-node", s.StretchSection = "stretch-section", s.UpdateValues = "update-values", s.Zoom = "zoom", s))(k || {});
3517
3518
  class qo {
3518
3519
  constructor(t, e, a, l, r, i, n, o, d) {
3519
3520
  this.canvas = t, this.type = e, this.coords = a, this.parentId = l, this.ancestorId = r, this.fromAncestorGeometry = i, this.toAncestorGeometry = n, this.label = o, this.values = d, this.id = this.canvas.collabEngine.freshId();
@@ -3529,7 +3530,7 @@ class qo {
3529
3530
  this.values
3530
3531
  );
3531
3532
  if (this.canvas.collabEngine.doCollaboratively(t), this.ancestorId !== void 0 && this.toAncestorGeometry !== void 0) {
3532
- const e = new it(
3533
+ const e = new st(
3533
3534
  this.canvas,
3534
3535
  this.ancestorId,
3535
3536
  this.toAncestorGeometry,
@@ -3551,7 +3552,7 @@ class qo {
3551
3552
  this.canvas.collabEngine.freshTimestamp()
3552
3553
  );
3553
3554
  if (this.canvas.collabEngine.doCollaboratively(e), this.ancestorId !== void 0 && this.fromAncestorGeometry !== void 0) {
3554
- const a = new it(
3555
+ const a = new st(
3555
3556
  this.canvas,
3556
3557
  this.ancestorId,
3557
3558
  this.fromAncestorGeometry,
@@ -3573,7 +3574,7 @@ class qo {
3573
3574
  this.canvas.collabEngine.freshTimestamp()
3574
3575
  );
3575
3576
  if (this.canvas.collabEngine.doCollaboratively(e), this.ancestorId !== void 0 && this.toAncestorGeometry !== void 0) {
3576
- const a = new it(
3577
+ const a = new st(
3577
3578
  this.canvas,
3578
3579
  this.ancestorId,
3579
3580
  this.toAncestorGeometry,
@@ -3584,7 +3585,7 @@ class qo {
3584
3585
  return t === void 0;
3585
3586
  }
3586
3587
  }
3587
- class le {
3588
+ class de {
3588
3589
  constructor(t, e, a) {
3589
3590
  this.canvas = t, this.nodeIds = e, this.delta = a;
3590
3591
  }
@@ -3617,14 +3618,14 @@ class X {
3617
3618
  do() {
3618
3619
  const t = this.canvas.model.nodes.get(this.nodeId);
3619
3620
  if (t) {
3620
- const e = new it(
3621
+ const e = new st(
3621
3622
  this.canvas,
3622
3623
  this.nodeId,
3623
3624
  this.to,
3624
3625
  this.canvas.collabEngine.freshTimestamp()
3625
3626
  );
3626
3627
  if (this.canvas.collabEngine.doCollaboratively(e), this.ancestorId !== void 0 && this.toAncestorGeometry !== void 0) {
3627
- const a = new it(
3628
+ const a = new st(
3628
3629
  this.canvas,
3629
3630
  this.ancestorId,
3630
3631
  this.toAncestorGeometry,
@@ -3639,14 +3640,14 @@ class X {
3639
3640
  const t = this.canvas.model.nodes.get(this.nodeId);
3640
3641
  if (t) {
3641
3642
  this.to = t.getGeometry();
3642
- const e = new it(
3643
+ const e = new st(
3643
3644
  this.canvas,
3644
3645
  this.nodeId,
3645
3646
  this.from,
3646
3647
  this.canvas.collabEngine.freshTimestamp()
3647
3648
  );
3648
3649
  if (this.canvas.collabEngine.doCollaboratively(e), this.ancestorId !== void 0 && this.fromAncestorGeometry !== void 0) {
3649
- const a = new it(
3650
+ const a = new st(
3650
3651
  this.canvas,
3651
3652
  this.ancestorId,
3652
3653
  this.fromAncestorGeometry,
@@ -3661,7 +3662,7 @@ class X {
3661
3662
  const t = this.canvas.model.nodes.get(this.nodeId);
3662
3663
  if (t) {
3663
3664
  this.from = t.getGeometry();
3664
- const e = new it(
3665
+ const e = new st(
3665
3666
  this.canvas,
3666
3667
  this.nodeId,
3667
3668
  this.to,
@@ -3685,7 +3686,7 @@ class Jo {
3685
3686
  this.canvas.collabEngine.freshTimestamp()
3686
3687
  );
3687
3688
  if (this.canvas.collabEngine.doCollaboratively(e), this.ancestorId !== void 0 && this.toAncestorGeometry !== void 0) {
3688
- const a = new it(
3689
+ const a = new st(
3689
3690
  this.canvas,
3690
3691
  this.ancestorId,
3691
3692
  this.toAncestorGeometry,
@@ -3704,7 +3705,7 @@ class Jo {
3704
3705
  this.canvas.collabEngine.freshTimestamp()
3705
3706
  );
3706
3707
  if (this.canvas.collabEngine.doCollaboratively(e), this.ancestorId !== void 0 && this.fromAncestorGeometry !== void 0) {
3707
- const a = new it(
3708
+ const a = new st(
3708
3709
  this.canvas,
3709
3710
  this.ancestorId,
3710
3711
  this.fromAncestorGeometry,
@@ -3718,7 +3719,7 @@ class Jo {
3718
3719
  return this.do();
3719
3720
  }
3720
3721
  }
3721
- class de {
3722
+ class ce {
3722
3723
  constructor(t, e, a, l) {
3723
3724
  this.canvas = t, this.type = e, this.startId = a, this.endId = l, this.id = this.canvas.collabEngine.freshId();
3724
3725
  }
@@ -4040,7 +4041,7 @@ class G extends Yt {
4040
4041
  ), this.targets = t, this.selected = e;
4041
4042
  }
4042
4043
  }
4043
- class Q extends Yt {
4044
+ class tt extends Yt {
4044
4045
  /**
4045
4046
  * Create a diagram highlight event.
4046
4047
  *
@@ -4188,7 +4189,7 @@ class ni extends ft {
4188
4189
  }
4189
4190
  class eo {
4190
4191
  constructor(t, e, a, l, r, i = []) {
4191
- this.nodes = new Uo(this), this.sections = new Fo(this), this.ports = new Wo(this), this.connections = new Ro(this), this.fields = new Vo(this), this.objects = new ni(this), this.decorators = new ii(this), this.canvas = t, this.id = e, this.name = a, this.description = l, this.type = r, this.createdAt = /* @__PURE__ */ new Date(), this.updatedAt = /* @__PURE__ */ new Date(), this.logicalClock = 0, this.valueSet = new yt(new oe(i), this);
4192
+ this.nodes = new Uo(this), this.sections = new Fo(this), this.ports = new jo(this), this.connections = new Ro(this), this.fields = new Vo(this), this.objects = new ni(this), this.decorators = new ii(this), this.canvas = t, this.id = e, this.name = a, this.description = l, this.type = r, this.createdAt = /* @__PURE__ */ new Date(), this.updatedAt = /* @__PURE__ */ new Date(), this.logicalClock = 0, this.valueSet = new yt(new oe(i), this);
4192
4193
  }
4193
4194
  /**
4194
4195
  * Deletes everything in this diagram.
@@ -4198,50 +4199,50 @@ class eo {
4198
4199
  this.canvas?.cancelAllUserActions(), this.id = void 0, this.name = "", this.description = void 0, this.createdAt = /* @__PURE__ */ new Date(), this.updatedAt = /* @__PURE__ */ new Date(), this.logicalClock = 0, this.nodes.clear(), this.sections.clear(), this.ports.clear(), this.connections.clear(), this.fields.clear(), this.objects.clear(), this.decorators.clear(), this.valueSet.resetValues(), this.canvas?.updateModelInView();
4199
4200
  }
4200
4201
  }
4201
- const vt = (s) => !!s.button, ce = (s, t, e, a, l, r, i, n) => yo(
4202
+ const vt = (s) => !!s.button, he = (s, t, e, a, l, r, i, n, o) => yo(
4202
4203
  s,
4203
- [t, e],
4204
+ [t, ...r, e],
4204
4205
  a,
4205
4206
  l,
4206
4207
  Math.max(
4207
4208
  // reasonable value for the minimumDistanceBeforeTurn relative to the line width
4208
4209
  10,
4209
- i || 0,
4210
- n || 0
4211
- ) * r
4210
+ n || 0,
4211
+ o || 0
4212
+ ) * i
4212
4213
  ), S = (s) => {
4213
- s ? x.select("body").style("cursor", s) : x.select("body").style("cursor", L.Auto);
4214
- }, ct = (s) => s instanceof z ? s : s instanceof F ? s.node || s : s.rootElement instanceof z || s.rootElement instanceof F || s.rootElement instanceof bt ? ct(s.rootElement) : s, ye = (s) => {
4214
+ s ? L.select("body").style("cursor", s) : L.select("body").style("cursor", E.Auto);
4215
+ }, ct = (s) => s instanceof z ? s : s instanceof F ? s.node || s : s.rootElement instanceof z || s.rootElement instanceof F || s.rootElement instanceof bt ? ct(s.rootElement) : s, be = (s) => {
4215
4216
  if (s instanceof z)
4216
4217
  return s.type.resizableX !== !1;
4217
4218
  if (s instanceof F) {
4218
4219
  if (s.type !== void 0)
4219
4220
  return s.type.resizableX !== !1;
4220
4221
  if (s.node !== void 0)
4221
- return ye(s.node);
4222
+ return be(s.node);
4222
4223
  }
4223
4224
  return !1;
4224
- }, be = (s) => {
4225
+ }, ke = (s) => {
4225
4226
  if (s instanceof z)
4226
4227
  return s.type.resizableY !== !1;
4227
4228
  if (s instanceof F) {
4228
4229
  if (s.type !== void 0)
4229
4230
  return s.type.resizableY !== !1;
4230
4231
  if (s.node !== void 0)
4231
- return be(s.node);
4232
+ return ke(s.node);
4232
4233
  }
4233
4234
  return !1;
4234
- }, he = (s) => {
4235
+ }, ge = (s) => {
4235
4236
  s.filter(".shaped-look").append("path"), s.filter(".image-look").append("image").attr("preserveAspectRatio", "none"), s.filter(".stretchable-image-look").append("image").attr("class", "top-left-image").attr("preserveAspectRatio", "none"), s.filter(".stretchable-image-look").append("image").attr("class", "top-image").attr("preserveAspectRatio", "none"), s.filter(".stretchable-image-look").append("image").attr("class", "top-right-image").attr("preserveAspectRatio", "none"), s.filter(".stretchable-image-look").append("image").attr("class", "left-image").attr("preserveAspectRatio", "none"), s.filter(".stretchable-image-look").append("image").attr("class", "center-image").attr("preserveAspectRatio", "none"), s.filter(".stretchable-image-look").append("image").attr("class", "right-image").attr("preserveAspectRatio", "none"), s.filter(".stretchable-image-look").append("image").attr("class", "bottom-left-image").attr("preserveAspectRatio", "none"), s.filter(".stretchable-image-look").append("image").attr("class", "bottom-image").attr("preserveAspectRatio", "none"), s.filter(".stretchable-image-look").append("image").attr("class", "bottom-right-image").attr("preserveAspectRatio", "none");
4236
4237
  }, zt = {
4237
4238
  fillColor: "#FFFFFF",
4238
4239
  borderColor: "#000000",
4239
4240
  borderThickness: 1,
4240
- borderStyle: Se.Solid
4241
- }, ge = (s) => {
4241
+ borderStyle: Ce.Solid
4242
+ }, fe = (s) => {
4242
4243
  s.filter(".shaped-look").select("path").attr(
4243
4244
  "d",
4244
- (t) => ve(
4245
+ (t) => ye(
4245
4246
  t.look.shape || Mt.Rectangle,
4246
4247
  0,
4247
4248
  0,
@@ -4259,7 +4260,7 @@ const vt = (s) => !!s.button, ce = (s, t, e, a, l, r, i, n) => yo(
4259
4260
  (t) => `${t.look.borderThickness || zt.borderThickness}px`
4260
4261
  ).attr(
4261
4262
  "stroke-dasharray",
4262
- (t) => me(
4263
+ (t) => ve(
4263
4264
  t.look.borderStyle || zt.borderStyle,
4264
4265
  t.type?.defaultLook?.borderThickness || t.look?.borderThickness || zt.borderThickness
4265
4266
  )
@@ -4326,7 +4327,7 @@ const vt = (s) => !!s.button, ce = (s, t, e, a, l, r, i, n) => yo(
4326
4327
  }
4327
4328
  t.select("rect").attr("fill", `url(#${e})`);
4328
4329
  }
4329
- }, ke = 96, j = 32, xt = ke + j, ai = Math.PI / 4, li = 100, Ve = {
4330
+ }, we = 96, W = 32, xt = we + W, ai = Math.PI / 4, li = 100, Ve = {
4330
4331
  customButtons: []
4331
4332
  };
4332
4333
  class di {
@@ -4346,25 +4347,25 @@ class di {
4346
4347
  open(t) {
4347
4348
  this.close();
4348
4349
  const e = this.canvas.getPointerLocationRelativeToRoot(t), a = this.canvas.getPointerLocationRelativeToCanvas(t), l = this.canvas.selectSVGElement().append("foreignObject").attr("class", "daga-context-menu").attr("x", `${e[0] - xt}px`).attr("y", `${e[1] - xt}px`).attr("width", `${2 * xt}px`).attr("height", `${2 * xt}px`).style("pointer-events", "none").on($.ContextMenu, (i) => {
4349
- this.canvas.canUserPerformAction(w.ContextMenu) && (t.preventDefault(), this.open(i));
4350
+ this.canvas.canUserPerformAction(k.ContextMenu) && (t.preventDefault(), this.open(i));
4350
4351
  }).on($.Click, (i) => {
4351
4352
  i.preventDefault(), this.close();
4352
4353
  });
4353
4354
  this.contextMenuContainer = l;
4354
4355
  const r = [];
4355
- this.canvas.userSelection.length !== 0 && this.canvas.canUserPerformAction(w.Clipboard) && this.canvas.canUserPerformAction(w.Remove) && r.push({
4356
+ this.canvas.userSelection.length !== 0 && this.canvas.canUserPerformAction(k.Clipboard) && this.canvas.canUserPerformAction(k.Remove) && r.push({
4356
4357
  name: "CUT",
4357
4358
  imageClass: "daga-cut",
4358
4359
  onPress: (i) => {
4359
4360
  i.userSelection.cutToClipboard(), i.cancelAllUserActions();
4360
4361
  }
4361
- }), this.canvas.userSelection.length !== 0 && this.canvas.canUserPerformAction(w.Clipboard) && r.push({
4362
+ }), this.canvas.userSelection.length !== 0 && this.canvas.canUserPerformAction(k.Clipboard) && r.push({
4362
4363
  name: "COPY",
4363
4364
  imageClass: "daga-copy",
4364
4365
  onPress: (i) => {
4365
4366
  i.userSelection.copyToClipboard(), i.cancelAllUserActions();
4366
4367
  }
4367
- }), this.canvas.canUserPerformAction(w.Paste) && r.push({
4368
+ }), this.canvas.canUserPerformAction(k.Paste) && r.push({
4368
4369
  name: "PASTE",
4369
4370
  imageClass: "daga-paste",
4370
4371
  onPress: (i) => {
@@ -4372,7 +4373,7 @@ class di {
4372
4373
  i.getClosestGridPoint(a)
4373
4374
  ), i.cancelAllUserActions();
4374
4375
  }
4375
- }), this.canvas.userSelection.length !== 0 && this.canvas.canUserPerformAction(w.Remove) && r.push({
4376
+ }), this.canvas.userSelection.length !== 0 && this.canvas.canUserPerformAction(k.Remove) && r.push({
4376
4377
  name: "DELETE",
4377
4378
  imageClass: "daga-delete",
4378
4379
  onPress: (i) => {
@@ -4390,19 +4391,19 @@ class di {
4390
4391
  const n = r[i], o = n.onPress, d = (i + 0.5 - r.length / 2) * ai, c = l.append("xhtml:div").attr(
4391
4392
  "class",
4392
4393
  `daga-context-menu-button ${n.onPress !== void 0 ? " daga-clickable" : ""}`
4393
- ).attr("tabindex", 0).style("position", "absolute").style("box-sizing", "border-box").style("width", `${2 * j}px`).style("height", `${2 * j}px`).style("border-radius", `${j}px`).style("pointer-events", "auto").on($.Click, (h) => {
4394
+ ).attr("tabindex", 0).style("position", "absolute").style("box-sizing", "border-box").style("width", `${2 * W}px`).style("height", `${2 * W}px`).style("border-radius", `${W}px`).style("pointer-events", "auto").on($.Click, (h) => {
4394
4395
  o && (h.preventDefault(), o(this.canvas));
4395
4396
  }).on($.KeyDown, (h) => {
4396
- o && h.key === Z.Enter && (h.preventDefault(), o(this.canvas));
4397
+ o && h.key === K.Enter && (h.preventDefault(), o(this.canvas));
4397
4398
  });
4398
- n.imageClass !== void 0 ? c.append("xhtml:div").style("position", "absolute").style("left", `${0.75 * j}px`).style("top", `${0.5 * j}px`).style("width", `${0.5 * j}px`).style("height", `${0.5 * j}px`).style("background-size", "contain").style("background-repeat", "no-repeat").attr("class", n.imageClass) : n.image !== void 0 && c.append("xhtml:img").style("position", "absolute").style("left", `${0.75 * j}px`).style("top", `${0.5 * j}px`).style("width", `${0.5 * j}px`).style("height", `${0.5 * j}px`).attr("src", n.image), c.append("xhtml:span").style("position", "absolute").style("left", `${0.2 * j}px`).style("top", `${1.1 * j}px`).style("text-align", "center").style("width", `${1.6 * j}px`).style("height", `${0.35 * j}px`).style("margin", "0").style("font-size", `${0.35 * j}px`).style("font-weight", "700").style("user-select", "none").text(n.name), c.transition().ease(x.easeLinear).duration(li).tween("progress", () => (h) => {
4399
+ n.imageClass !== void 0 ? c.append("xhtml:div").style("position", "absolute").style("left", `${0.75 * W}px`).style("top", `${0.5 * W}px`).style("width", `${0.5 * W}px`).style("height", `${0.5 * W}px`).style("background-size", "contain").style("background-repeat", "no-repeat").attr("class", n.imageClass) : n.image !== void 0 && c.append("xhtml:img").style("position", "absolute").style("left", `${0.75 * W}px`).style("top", `${0.5 * W}px`).style("width", `${0.5 * W}px`).style("height", `${0.5 * W}px`).attr("src", n.image), c.append("xhtml:span").style("position", "absolute").style("left", `${0.2 * W}px`).style("top", `${1.1 * W}px`).style("text-align", "center").style("width", `${1.6 * W}px`).style("height", `${0.35 * W}px`).style("margin", "0").style("font-size", `${0.35 * W}px`).style("font-weight", "700").style("user-select", "none").text(n.name), c.transition().ease(L.easeLinear).duration(li).tween("progress", () => (h) => {
4399
4400
  const f = d * h;
4400
4401
  return c.style(
4401
4402
  "left",
4402
- `${Math.sin(f) * ke - j + xt}px`
4403
+ `${Math.sin(f) * we - W + xt}px`
4403
4404
  ).style(
4404
4405
  "top",
4405
- `${-Math.cos(f) * ke - j + xt}px`
4406
+ `${-Math.cos(f) * we - W + xt}px`
4406
4407
  );
4407
4408
  });
4408
4409
  }
@@ -4738,18 +4739,18 @@ class fi extends ft {
4738
4739
  if (a === void 0)
4739
4740
  return;
4740
4741
  const l = t?.valueSet;
4741
- l ? (this.propertyEditorSelection = t, e && (this.propertyEditorValues = Nt(l.getValues())), a && (t instanceof z || t instanceof dt ? (t instanceof z ? t.name ? a.title = `${t.type.name}: ${t.name}` : a.title = t.type.name : t instanceof dt && (a.title = t.type.name), a.valueSet = void 0, a.valueSet = l) : (a.title = this.diagramPropertiesText, a.valueSet = void 0, a.valueSet = l))) : (this.propertyEditorSelection = void 0, this.propertyEditorValues = void 0, a && (a.title = "", a.valueSet = void 0));
4742
+ l ? (this.propertyEditorSelection = t, e && (this.propertyEditorValues = Ct(l.getValues())), a && (t instanceof z || t instanceof dt ? (t instanceof z ? t.name ? a.title = `${t.type.name}: ${t.name}` : a.title = t.type.name : t instanceof dt && (a.title = t.type.name), a.valueSet = void 0, a.valueSet = l) : (a.title = this.diagramPropertiesText, a.valueSet = void 0, a.valueSet = l))) : (this.propertyEditorSelection = void 0, this.propertyEditorValues = void 0, a && (a.title = "", a.valueSet = void 0));
4742
4743
  }
4743
4744
  makeUpdateValuesAction() {
4744
4745
  if (this.propertyEditorSelection === void 0 || this.propertyEditorValues === void 0)
4745
4746
  return;
4746
4747
  const t = this.propertyEditorSelection instanceof eo ? void 0 : this.propertyEditorSelection.id;
4747
- if (St(
4748
+ if (wt(
4748
4749
  this.propertyEditorValues,
4749
4750
  this.propertyEditorSelection?.valueSet.getValues()
4750
4751
  ))
4751
4752
  return;
4752
- const e = this.propertyEditorValues, a = Nt(this.propertyEditorSelection?.valueSet.getValues()), [l, r] = Be(
4753
+ const e = this.propertyEditorValues, a = Ct(this.propertyEditorSelection?.valueSet.getValues()), [l, r] = Be(
4753
4754
  e,
4754
4755
  a,
4755
4756
  this.propertyEditorSelection?.valueSet
@@ -4765,7 +4766,7 @@ class fi extends ft {
4765
4766
  const ui = (s) => s * Math.PI / 180, Oe = (s, t, e) => {
4766
4767
  const a = ui(e), l = Math.sin(a), r = Math.cos(a), i = (Math.abs(s * r) - Math.abs(t * l)) / (r * r - l * l), n = (Math.abs(s * l) - Math.abs(t * r)) / (l * l - r * r);
4767
4768
  return [i, n];
4768
- }, pi = (s) => /^((?!chrome|android).)*safari/i.test(s), He = pi(navigator.userAgent), mi = 12, H = 6, vi = 25, fe = "diagram-connection-unfinished", te = class te {
4769
+ }, pi = (s) => /^((?!chrome|android).)*safari/i.test(s), He = pi(navigator.userAgent), mi = 12, H = 6, vi = 25, ue = "diagram-connection-unfinished", te = class te {
4769
4770
  /**
4770
4771
  * Constructs a canvas object.
4771
4772
  * @public
@@ -4773,7 +4774,7 @@ const ui = (s) => s * Math.PI / 180, Oe = (s, t, e) => {
4773
4774
  * @param config The configuration object used to set the parameters of this canvas.
4774
4775
  */
4775
4776
  constructor(t, e) {
4776
- if (this.backgroundPatternId = `daga-background-pattern-id-${te.canvasCount++}`, this.zoomTransform = x.zoomIdentity, this.draggingFrom = [0, 0], this.dragging = !1, this.secondaryButton = !1, this.validatorChange$ = new Wt(), this.diagramChange$ = new Wt(), this.diagramEvent$ = new Wt(), this.propertyEditorChanges$ = new Wt(), this.parentComponent = t, this.model = new eo(
4777
+ if (this.backgroundPatternId = `daga-background-pattern-id-${te.canvasCount++}`, this.zoomTransform = L.zoomIdentity, this.draggingFrom = [0, 0], this.dragging = !1, this.secondaryButton = !1, this.validatorChange$ = new jt(), this.diagramChange$ = new jt(), this.diagramEvent$ = new jt(), this.propertyEditorChanges$ = new jt(), this.parentComponent = t, this.model = new eo(
4777
4778
  this,
4778
4779
  void 0,
4779
4780
  e.name || "unnamed",
@@ -4788,9 +4789,9 @@ const ui = (s) => s * Math.PI / 180, Oe = (s, t, e) => {
4788
4789
  e.canvas?.highlightSections !== !1
4789
4790
  ), this.contextMenu = new di(this, e.canvas?.contextMenu), this.backgroundColor = e.canvas?.backgroundColor || "#FFFFFF", this.gridStyle = e.canvas?.grid?.style ?? Rt.style, this.gridSize = e.canvas?.grid?.enabled === !1 || e.canvas?.grid === void 0 ? 0 : Math.abs(e.canvas?.grid?.spacing || Rt.spacing), this.gridThickness = Math.abs(
4790
4791
  e.canvas?.grid?.thickness || Rt.thickness
4791
- ), this.gridColor = e.canvas?.grid?.color || Rt.color, this.snapToGrid = e.canvas?.grid?.enabled === !1 || e.canvas?.grid === void 0 ? !1 : e.canvas?.grid?.snap || Rt.snap, this.zoomFactor = e.canvas?.zoomFactor || 2, this.panRate = e.canvas?.panRate || 100, this.inferConnectionType = e.connectionSettings?.inferConnectionType || !1, this.autoTightenConnections = e.connectionSettings?.autoTighten !== !1, this.allowConnectionLoops = e.connectionSettings?.allowLoops || !1, this.allowSharingPorts = e.connectionSettings?.sharePorts !== !1, this.allowSharingBothPorts = e.connectionSettings?.shareBothPorts || !1, this.portHighlightRadius = e.connectionSettings?.portHighlightRadius || 100, this.multipleSelectionOn = !1, this.priorityThresholds = e.canvas?.priorityThresholds || [], this.priorityThreshold = this.priorityThresholds ? this.priorityThresholds[0] : void 0, this.layoutFormat = e.layoutFormat, this.userActions = e.userActions || {}, this.validators = [], this.actionStack = new Ko(this, vi), this.collabEngine = new Zo(this), e.nodeTypes)
4792
+ ), this.gridColor = e.canvas?.grid?.color || Rt.color, this.snapToGrid = e.canvas?.grid?.enabled === !1 || e.canvas?.grid === void 0 ? !1 : e.canvas?.grid?.snap || Rt.snap, this.zoomFactor = e.canvas?.zoomFactor || 2, this.panRate = e.canvas?.panRate || 100, this.inferConnectionType = e.connectionSettings?.inferConnectionType || !1, this.autoTightenConnections = e.connectionSettings?.autoTighten !== !1, this.tightenConnectionsAcrossPortTypes = e.connectionSettings?.tightenAcrossPortTypes || !1, this.allowConnectionLoops = e.connectionSettings?.allowLoops || !1, this.allowSharingPorts = e.connectionSettings?.sharePorts !== !1, this.allowSharingBothPorts = e.connectionSettings?.shareBothPorts || !1, this.portHighlightRadius = e.connectionSettings?.portHighlightRadius || 100, this.multipleSelectionOn = !1, this.priorityThresholds = e.canvas?.priorityThresholds || [], this.priorityThreshold = this.priorityThresholds ? this.priorityThresholds[0] : void 0, this.layoutFormat = e.layoutFormat, this.userActions = e.userActions || {}, this.validators = [], this.actionStack = new Ko(this, vi), this.collabEngine = new Zo(this), e.nodeTypes)
4792
4793
  for (const a of e.nodeTypes) {
4793
- const l = new We({
4794
+ const l = new je({
4794
4795
  ...e.nodeTypeDefaults,
4795
4796
  ...a
4796
4797
  });
@@ -4798,7 +4799,7 @@ const ui = (s) => s * Math.PI / 180, Oe = (s, t, e) => {
4798
4799
  }
4799
4800
  if (e.portTypes)
4800
4801
  for (const a of e.portTypes) {
4801
- const l = new jo({
4802
+ const l = new Wo({
4802
4803
  ...e.portTypeDefaults,
4803
4804
  ...a
4804
4805
  });
@@ -4843,21 +4844,21 @@ const ui = (s) => s * Math.PI / 180, Oe = (s, t, e) => {
4843
4844
  }
4844
4845
  // View methods
4845
4846
  initView(t) {
4846
- const e = x.select(t);
4847
- e.html(""), this.diagramRoot = e.append("div").node(), x.select(this.diagramRoot).attr("tabindex", 0).style("width", "100%").style("height", "100%").append("svg").style("width", "100%").style("height", "100%"), x.select(this.diagramRoot).on($.Click, () => {
4848
- x.select(this.diagramRoot).node()?.focus();
4847
+ const e = L.select(t);
4848
+ e.html(""), this.diagramRoot = e.append("div").node(), L.select(this.diagramRoot).attr("tabindex", 0).style("width", "100%").style("height", "100%").append("svg").style("width", "100%").style("height", "100%"), L.select(this.diagramRoot).on($.Click, () => {
4849
+ L.select(this.diagramRoot).node()?.focus();
4849
4850
  }).on($.ContextMenu, (l) => {
4850
4851
  if (this.dragging) {
4851
4852
  l.preventDefault(), l.stopPropagation(), this.dragging = !1;
4852
4853
  return;
4853
4854
  }
4854
4855
  const r = new mt(l, null);
4855
- this.diagramEvent$.next(r), !r.defaultPrevented && this.canUserPerformAction(w.ContextMenu) && (l.preventDefault(), this.contextMenu.open(l));
4856
+ this.diagramEvent$.next(r), !r.defaultPrevented && this.canUserPerformAction(k.ContextMenu) && (l.preventDefault(), this.contextMenu.open(l));
4856
4857
  }).on($.DoubleClick, (l) => {
4857
4858
  const r = new pt(l, null);
4858
4859
  this.diagramEvent$.next(r);
4859
4860
  }).on($.KeyDown, (l) => {
4860
- if (!l.ctrlKey && (l.key === Z.Delete || l.key === Z.Backspace) && this.canUserPerformAction(w.Remove) && (this.userSelection.removeFromModel(), this.cancelAllUserActions()), l.ctrlKey && l.key === "a") {
4861
+ if (!l.ctrlKey && (l.key === K.Delete || l.key === K.Backspace) && this.canUserPerformAction(k.Remove) && (this.userSelection.removeFromModel(), this.cancelAllUserActions()), l.ctrlKey && l.key === "a") {
4861
4862
  l.preventDefault();
4862
4863
  for (const r of this.model.nodes)
4863
4864
  this.userSelection.add(r);
@@ -4880,7 +4881,7 @@ const ui = (s) => s * Math.PI / 180, Oe = (s, t, e) => {
4880
4881
  new G(i, !1)
4881
4882
  );
4882
4883
  }
4883
- if (l.ctrlKey && l.key === "c" && this.canUserPerformAction(w.Clipboard) && (l.preventDefault(), this.userSelection.copyToClipboard(), this.cancelAllUserActions()), l.ctrlKey && l.key === "x" && this.canUserPerformAction(w.Clipboard) && this.canUserPerformAction(w.Remove) && (l.preventDefault(), this.userSelection.cutToClipboard(), this.cancelAllUserActions()), l.ctrlKey && l.key === "v" && this.canUserPerformAction(w.Paste)) {
4884
+ if (l.ctrlKey && l.key === "c" && this.canUserPerformAction(k.Clipboard) && (l.preventDefault(), this.userSelection.copyToClipboard(), this.cancelAllUserActions()), l.ctrlKey && l.key === "x" && this.canUserPerformAction(k.Clipboard) && this.canUserPerformAction(k.Remove) && (l.preventDefault(), this.userSelection.cutToClipboard(), this.cancelAllUserActions()), l.ctrlKey && l.key === "v" && this.canUserPerformAction(k.Paste)) {
4884
4885
  l.preventDefault();
4885
4886
  const r = this.getCoordinatesOnScreen();
4886
4887
  this.userSelection.pasteFromClipboard(
@@ -4890,21 +4891,21 @@ const ui = (s) => s * Math.PI / 180, Oe = (s, t, e) => {
4890
4891
  ])
4891
4892
  ), this.cancelAllUserActions();
4892
4893
  }
4893
- l.ctrlKey && l.key === "y" && (l.preventDefault(), this.actionStack.redo()), l.ctrlKey && l.key === "z" && (l.preventDefault(), this.actionStack.undo()), l.key === "+" && this.canUserPerformAction(w.Zoom) && (l.preventDefault(), this.zoomBy(this.zoomFactor)), l.key === "-" && this.canUserPerformAction(w.Zoom) && (l.preventDefault(), this.zoomBy(1 / this.zoomFactor)), l.key === Z.ArrowLeft && this.canUserPerformAction(w.Zoom) && (l.preventDefault(), this.translateBy(this.panRate / this.zoomTransform.k, 0)), l.key === Z.ArrowRight && this.canUserPerformAction(w.Zoom) && (l.preventDefault(), this.translateBy(-this.panRate / this.zoomTransform.k, 0)), l.key === Z.ArrowDown && this.canUserPerformAction(w.Zoom) && (l.preventDefault(), this.translateBy(0, -this.panRate / this.zoomTransform.k)), l.key === Z.ArrowUp && this.canUserPerformAction(w.Zoom) && (l.preventDefault(), this.translateBy(0, this.panRate / this.zoomTransform.k));
4894
+ l.ctrlKey && l.key === "y" && (l.preventDefault(), this.actionStack.redo()), l.ctrlKey && l.key === "z" && (l.preventDefault(), this.actionStack.undo()), l.key === "+" && this.canUserPerformAction(k.Zoom) && (l.preventDefault(), this.zoomBy(this.zoomFactor)), l.key === "-" && this.canUserPerformAction(k.Zoom) && (l.preventDefault(), this.zoomBy(1 / this.zoomFactor)), l.key === K.ArrowLeft && this.canUserPerformAction(k.Zoom) && (l.preventDefault(), this.translateBy(this.panRate / this.zoomTransform.k, 0)), l.key === K.ArrowRight && this.canUserPerformAction(k.Zoom) && (l.preventDefault(), this.translateBy(-this.panRate / this.zoomTransform.k, 0)), l.key === K.ArrowDown && this.canUserPerformAction(k.Zoom) && (l.preventDefault(), this.translateBy(0, -this.panRate / this.zoomTransform.k)), l.key === K.ArrowUp && this.canUserPerformAction(k.Zoom) && (l.preventDefault(), this.translateBy(0, this.panRate / this.zoomTransform.k));
4894
4895
  });
4895
4896
  const a = this.selectSVGElement().append("g").attr("class", "daga-canvas-view").attr("width", "100%").attr("height", "100%");
4896
4897
  a.call(
4897
- this.zoomBehavior = x.zoom().filter((l) => l.type !== $.DoubleClick).on(ue.Zoom, (l) => {
4898
+ this.zoomBehavior = L.zoom().filter((l) => l.type !== $.DoubleClick).on(pe.Zoom, (l) => {
4898
4899
  if (l.sourceEvent) {
4899
- if (!this.canUserPerformAction(w.Zoom)) {
4900
- S(L.NotAllowed);
4900
+ if (!this.canUserPerformAction(k.Zoom)) {
4901
+ S(E.NotAllowed);
4901
4902
  return;
4902
4903
  }
4903
- l.sourceEvent.type === $.Wheel && l.sourceEvent.wheelDelta !== void 0 ? (l.sourceEvent.wheelDelta > 0 && S(L.ZoomIn), l.sourceEvent.wheelDelta < 0 && S(L.ZoomOut)) : l.sourceEvent.type === $.MouseMove && S(L.AllScroll);
4904
+ l.sourceEvent.type === $.Wheel && l.sourceEvent.wheelDelta !== void 0 ? (l.sourceEvent.wheelDelta > 0 && S(E.ZoomIn), l.sourceEvent.wheelDelta < 0 && S(E.ZoomOut)) : l.sourceEvent.type === $.MouseMove && S(E.AllScroll);
4904
4905
  }
4905
4906
  this.zoomTransform = l.transform;
4906
4907
  const r = l.transform.toString();
4907
- this.selectCanvasElements().attr("transform", r), x.select(`#${this.backgroundPatternId}`).attr(
4908
+ this.selectCanvasElements().attr("transform", r), L.select(`#${this.backgroundPatternId}`).attr(
4908
4909
  "patternTransform",
4909
4910
  r
4910
4911
  ), He && this.updateFieldsInView(), this.contextMenu.close(), this.diagramEvent$.next(
@@ -4913,7 +4914,7 @@ const ui = (s) => s * Math.PI / 180, Oe = (s, t, e) => {
4913
4914
  this.zoomTransform.k
4914
4915
  )
4915
4916
  );
4916
- }).on(ue.End, () => {
4917
+ }).on(pe.End, () => {
4917
4918
  S();
4918
4919
  })
4919
4920
  ), a.append("rect").attr("x", 0).attr("y", 0).attr("width", "100%").attr("height", "100%").attr("fill", this.backgroundColor).attr("stroke-width", "0").on($.MouseMove, (l) => {
@@ -4922,9 +4923,9 @@ const ui = (s) => s * Math.PI / 180, Oe = (s, t, e) => {
4922
4923
  this.unfinishedConnection.endCoords = r;
4923
4924
  }
4924
4925
  }).on($.MouseOver, () => {
4925
- this.userHighlight.size() > 0 && (this.userHighlight.clear(), this.diagramEvent$.next(new Q(null)));
4926
+ this.userHighlight.size() > 0 && (this.userHighlight.clear(), this.diagramEvent$.next(new tt(null)));
4926
4927
  }).on($.Click, () => {
4927
- if (this.userHighlight.size() > 0 && (this.userHighlight.clear(), this.diagramEvent$.next(new Q(null))), this.contextMenu.close(), this.userSelection.size() > 0) {
4928
+ if (this.userHighlight.size() > 0 && (this.userHighlight.clear(), this.diagramEvent$.next(new tt(null))), this.contextMenu.close(), this.userSelection.size() > 0) {
4928
4929
  const l = this.userSelection.all();
4929
4930
  this.userSelection.clear(), this.diagramEvent$.next(
4930
4931
  new G(l, !1)
@@ -4932,7 +4933,7 @@ const ui = (s) => s * Math.PI / 180, Oe = (s, t, e) => {
4932
4933
  }
4933
4934
  this.userSelection.openInPropertyEditor(this.model);
4934
4935
  }).call(
4935
- x.drag().filter((l) => this.multipleSelectionOn || vt(l)).on(A.Start, (l) => {
4936
+ L.drag().filter((l) => this.multipleSelectionOn || vt(l)).on(A.Start, (l) => {
4936
4937
  this.startMultipleSelection(l);
4937
4938
  }).on(A.Drag, (l) => {
4938
4939
  this.continueMultipleSelection(l);
@@ -4968,23 +4969,32 @@ const ui = (s) => s * Math.PI / 180, Oe = (s, t, e) => {
4968
4969
  this.zoomBehavior.scaleTo(this.selectCanvasView(), a), this.zoomBehavior.translateTo(this.selectCanvasView(), t, e);
4969
4970
  return;
4970
4971
  }
4971
- this.zoomBehavior.interpolate(x.interpolate);
4972
+ this.zoomBehavior.interpolate(L.interpolate);
4972
4973
  const [r, i] = this.getViewCoordinates(), n = this.getZoomLevel(), o = t, d = e, c = a;
4973
- this.selectCanvasElements().transition().duration(l).ease(x.easeCubicInOut).tween("progress", () => (h) => {
4974
- const f = h * (o - r) + r, b = h * (d - i) + i, m = h * (c - n) + n;
4975
- this.zoomBehavior.scaleTo(this.selectCanvasView(), m), this.zoomBehavior.translateTo(
4976
- this.selectCanvasView(),
4977
- f,
4978
- b
4979
- );
4974
+ this.selectCanvasElements().transition().duration(l).ease(L.easeCubicInOut).tween("progress", () => {
4975
+ let h = !1;
4976
+ return (f) => {
4977
+ try {
4978
+ if (!h) {
4979
+ const b = f * (o - r) + r, m = f * (d - i) + i, p = f * (c - n) + n;
4980
+ this.zoomBehavior.scaleTo(this.selectCanvasView(), p), this.zoomBehavior.translateTo(
4981
+ this.selectCanvasView(),
4982
+ b,
4983
+ m
4984
+ );
4985
+ }
4986
+ } catch {
4987
+ console.warn("Animation has been interrupted"), h = !0;
4988
+ }
4989
+ };
4980
4990
  });
4981
4991
  }
4982
4992
  center(t, e, a) {
4983
4993
  if (this.model.nodes.length > 0) {
4984
- const l = this.selectCanvasView().select("rect").node()?.getBBox(), r = t?.map((y) => this.model.nodes.get(y)).filter((y) => !!y) || this.model.nodes.all(), i = Math.min(...r.map((y) => y.coords[0])), n = Math.max(
4985
- ...r.map((y) => y.coords[0] + y.width)
4986
- ), o = (i + n) / 2, d = n - i, c = l.width, h = Math.min(...r.map((y) => y.coords[1])), f = Math.max(
4987
- ...r.map((y) => y.coords[1] + y.height)
4994
+ const l = this.selectCanvasView().select("rect").node()?.getBBox(), r = t?.map((v) => this.model.nodes.get(v)).filter((v) => !!v) || this.model.nodes.all(), i = Math.min(...r.map((v) => v.coords[0])), n = Math.max(
4995
+ ...r.map((v) => v.coords[0] + v.width)
4996
+ ), o = (i + n) / 2, d = n - i, c = l.width, h = Math.min(...r.map((v) => v.coords[1])), f = Math.max(
4997
+ ...r.map((v) => v.coords[1] + v.height)
4988
4998
  ), b = (h + f) / 2, m = f - h, p = l.height, u = Math.min(
4989
4999
  c / d,
4990
5000
  p / m,
@@ -5029,21 +5039,21 @@ const ui = (s) => s * Math.PI / 180, Oe = (s, t, e) => {
5029
5039
  return t;
5030
5040
  }
5031
5041
  getPointerLocationRelativeToCanvas(t) {
5032
- return x.pointer(
5042
+ return L.pointer(
5033
5043
  this.getEventHoldingCoordinates(t),
5034
5044
  this.selectCanvasElements().node()
5035
5045
  );
5036
5046
  }
5037
5047
  getPointerLocationRelativeToRoot(t) {
5038
- return x.pointer(
5048
+ return L.pointer(
5039
5049
  this.getEventHoldingCoordinates(t),
5040
5050
  this.selectSVGElement().node()
5041
5051
  );
5042
5052
  }
5043
5053
  getPointerLocationRelativeToBody(t) {
5044
- return x.pointer(
5054
+ return L.pointer(
5045
5055
  this.getEventHoldingCoordinates(t),
5046
- x.select("body").node()
5056
+ L.select("body").node()
5047
5057
  );
5048
5058
  }
5049
5059
  getPointerLocationRelativeToScreen(t) {
@@ -5065,12 +5075,12 @@ const ui = (s) => s * Math.PI / 180, Oe = (s, t, e) => {
5065
5075
  );
5066
5076
  const a = e.exit(), l = e.enter().append("g").attr("id", (i) => i.id).attr(
5067
5077
  "class",
5068
- (i) => `diagram-node${ye(i) ? " resizable-x" : ""}${be(i) ? " resizable-y" : ""} ${i.type.defaultLook.lookType}`
5078
+ (i) => `diagram-node${be(i) ? " resizable-x" : ""}${ke(i) ? " resizable-y" : ""} ${i.type.defaultLook.lookType}`
5069
5079
  );
5070
5080
  t && t.length > 0 && (e = e.filter((i) => t.includes(i.id)));
5071
5081
  const r = l.merge(e);
5072
5082
  a.remove(), l.on($.MouseOver, (i, n) => {
5073
- this.dragging || (this.userHighlight.focusOn(n), this.diagramEvent$.next(new Q(n)));
5083
+ this.dragging || (this.userHighlight.focusOn(n), this.diagramEvent$.next(new tt(n)));
5074
5084
  }).on($.Click, (i, n) => {
5075
5085
  if (!i.ctrlKey && !i.shiftKey) {
5076
5086
  const o = this.userSelection.all();
@@ -5085,40 +5095,40 @@ const ui = (s) => s * Math.PI / 180, Oe = (s, t, e) => {
5085
5095
  return;
5086
5096
  }
5087
5097
  const o = new mt(i, n);
5088
- this.diagramEvent$.next(o), !o.defaultPrevented && this.canUserPerformAction(w.ContextMenu) && (i.preventDefault(), this.userHighlight.focusOn(n), this.diagramEvent$.next(new Q(n)), this.userSelection.add(n), this.diagramEvent$.next(new G([n], !0)), this.contextMenu.open(i));
5098
+ this.diagramEvent$.next(o), !o.defaultPrevented && this.canUserPerformAction(k.ContextMenu) && (i.preventDefault(), this.userHighlight.focusOn(n), this.diagramEvent$.next(new tt(n)), this.userSelection.add(n), this.diagramEvent$.next(new G([n], !0)), this.contextMenu.open(i));
5089
5099
  }).on($.DoubleClick, (i, n) => {
5090
5100
  const o = new pt(i, n);
5091
5101
  this.diagramEvent$.next(o);
5092
5102
  }).call(
5093
- x.drag().filter((i) => (this.secondaryButton = vt(i), !0)).on(A.Start, (i, n) => {
5103
+ L.drag().filter((i) => (this.secondaryButton = vt(i), !0)).on(A.Start, (i, n) => {
5094
5104
  this.multipleSelectionOn || this.secondaryButton ? this.startMultipleSelection(i) : this.startMovingNode(i, n);
5095
5105
  }).on(A.Drag, (i, n) => {
5096
5106
  this.multipleSelectionOn || this.secondaryButton ? this.continueMultipleSelection(i) : this.continueMovingNode(i, n);
5097
5107
  }).on(A.End, (i, n) => {
5098
5108
  this.multipleSelectionOn || this.secondaryButton ? this.finishMultipleSelection(i) : this.finishMovingNode(i, n), this.secondaryButton = !1;
5099
5109
  })
5100
- ), he(
5110
+ ), ge(
5101
5111
  l
5102
5112
  ), l.filter(".resizable-x").append("line").attr("class", "left-resizer").attr("stroke", "transparent").attr("stroke-width", `${H}px`).on($.MouseOver, (i, n) => {
5103
- this.canUserPerformAction(w.StretchNode) && n.getResizableX() && !n.removed && S(L.EWResize);
5113
+ this.canUserPerformAction(k.StretchNode) && n.getResizableX() && !n.removed && S(E.EWResize);
5104
5114
  }).on($.MouseOut, (i, n) => {
5105
- this.canUserPerformAction(w.StretchNode) && n.getResizableX() && !n.removed && S();
5115
+ this.canUserPerformAction(k.StretchNode) && n.getResizableX() && !n.removed && S();
5106
5116
  }).call(
5107
- x.drag().on(A.Start, (i, n) => {
5108
- this.canUserPerformAction(w.StretchNode) && n.getResizableX() && !n.removed ? (S(L.EWResize), this.currentAction = new X(
5117
+ L.drag().on(A.Start, (i, n) => {
5118
+ this.canUserPerformAction(k.StretchNode) && n.getResizableX() && !n.removed ? (S(E.EWResize), this.currentAction = new X(
5109
5119
  this,
5110
- w.StretchNode,
5120
+ k.StretchNode,
5111
5121
  n.id,
5112
5122
  n.getGeometry(),
5113
5123
  n.getGeometry()
5114
- )) : S(L.NotAllowed);
5124
+ )) : S(E.NotAllowed);
5115
5125
  }).on(A.Drag, (i, n) => {
5116
- if (this.canUserPerformAction(w.StretchNode) && n.getResizableX() && !n.removed) {
5126
+ if (this.canUserPerformAction(k.StretchNode) && n.getResizableX() && !n.removed) {
5117
5127
  const o = this.getPointerLocationRelativeToCanvas(i);
5118
5128
  n.stretch(g.Left, n.coords[0] - o[0]);
5119
5129
  }
5120
5130
  }).on(A.End, (i, n) => {
5121
- if (this.canUserPerformAction(w.StretchNode) && n.getResizableX() && !n.removed && this.currentAction instanceof X && this.currentAction.intent === w.StretchNode) {
5131
+ if (this.canUserPerformAction(k.StretchNode) && n.getResizableX() && !n.removed && this.currentAction instanceof X && this.currentAction.intent === k.StretchNode) {
5122
5132
  let o = this.getPointerLocationRelativeToCanvas(i);
5123
5133
  this.snapToGrid && (o = this.getClosestGridPoint([
5124
5134
  o[0] - n.type.snapToGridOffset[0],
@@ -5128,25 +5138,25 @@ const ui = (s) => s * Math.PI / 180, Oe = (s, t, e) => {
5128
5138
  S();
5129
5139
  })
5130
5140
  ), l.filter(".resizable-y").append("line").attr("class", "top-resizer").attr("stroke", "transparent").attr("stroke-width", `${H}px`).on($.MouseOver, (i, n) => {
5131
- this.canUserPerformAction(w.StretchNode) && n.getResizableY() && !n.removed && S(L.NSResize);
5141
+ this.canUserPerformAction(k.StretchNode) && n.getResizableY() && !n.removed && S(E.NSResize);
5132
5142
  }).on($.MouseOut, (i, n) => {
5133
- this.canUserPerformAction(w.StretchNode) && n.getResizableY() && !n.removed && S();
5143
+ this.canUserPerformAction(k.StretchNode) && n.getResizableY() && !n.removed && S();
5134
5144
  }).call(
5135
- x.drag().on(A.Start, (i, n) => {
5136
- this.canUserPerformAction(w.StretchNode) && n.getResizableY() && !n.removed ? (S(L.NSResize), this.currentAction = new X(
5145
+ L.drag().on(A.Start, (i, n) => {
5146
+ this.canUserPerformAction(k.StretchNode) && n.getResizableY() && !n.removed ? (S(E.NSResize), this.currentAction = new X(
5137
5147
  this,
5138
- w.StretchNode,
5148
+ k.StretchNode,
5139
5149
  n.id,
5140
5150
  n.getGeometry(),
5141
5151
  n.getGeometry()
5142
- )) : S(L.NotAllowed);
5152
+ )) : S(E.NotAllowed);
5143
5153
  }).on(A.Drag, (i, n) => {
5144
- if (this.canUserPerformAction(w.StretchNode) && n.getResizableY() && !n.removed) {
5154
+ if (this.canUserPerformAction(k.StretchNode) && n.getResizableY() && !n.removed) {
5145
5155
  const o = this.getPointerLocationRelativeToCanvas(i);
5146
5156
  n.stretch(g.Top, n.coords[1] - o[1]);
5147
5157
  }
5148
5158
  }).on(A.End, (i, n) => {
5149
- if (this.canUserPerformAction(w.StretchNode) && n.getResizableY() && !n.removed && this.currentAction instanceof X && this.currentAction.intent === w.StretchNode) {
5159
+ if (this.canUserPerformAction(k.StretchNode) && n.getResizableY() && !n.removed && this.currentAction instanceof X && this.currentAction.intent === k.StretchNode) {
5150
5160
  let o = this.getPointerLocationRelativeToCanvas(i);
5151
5161
  this.snapToGrid && (o = this.getClosestGridPoint([
5152
5162
  o[0] - n.type.snapToGridOffset[0],
@@ -5156,25 +5166,25 @@ const ui = (s) => s * Math.PI / 180, Oe = (s, t, e) => {
5156
5166
  S();
5157
5167
  })
5158
5168
  ), l.filter(".resizable-x").append("line").attr("class", "right-resizer").attr("stroke", "transparent").attr("stroke-width", `${H}px`).on($.MouseOver, (i, n) => {
5159
- this.canUserPerformAction(w.StretchNode) && n.getResizableX() && !n.removed && S(L.EWResize);
5169
+ this.canUserPerformAction(k.StretchNode) && n.getResizableX() && !n.removed && S(E.EWResize);
5160
5170
  }).on($.MouseOut, (i, n) => {
5161
- this.canUserPerformAction(w.StretchNode) && n.getResizableX() && !n.removed && S();
5171
+ this.canUserPerformAction(k.StretchNode) && n.getResizableX() && !n.removed && S();
5162
5172
  }).call(
5163
- x.drag().on(A.Start, (i, n) => {
5164
- this.canUserPerformAction(w.StretchNode) && n.getResizableX() && !n.removed ? (S(L.EWResize), this.currentAction = new X(
5173
+ L.drag().on(A.Start, (i, n) => {
5174
+ this.canUserPerformAction(k.StretchNode) && n.getResizableX() && !n.removed ? (S(E.EWResize), this.currentAction = new X(
5165
5175
  this,
5166
- w.StretchNode,
5176
+ k.StretchNode,
5167
5177
  n.id,
5168
5178
  n.getGeometry(),
5169
5179
  n.getGeometry()
5170
- )) : S(L.NotAllowed);
5180
+ )) : S(E.NotAllowed);
5171
5181
  }).on(A.Drag, (i, n) => {
5172
- if (this.canUserPerformAction(w.StretchNode) && n.getResizableX() && !n.removed) {
5182
+ if (this.canUserPerformAction(k.StretchNode) && n.getResizableX() && !n.removed) {
5173
5183
  const o = this.getPointerLocationRelativeToCanvas(i);
5174
5184
  n.stretch(g.Right, o[0] - (n.coords[0] + n.width));
5175
5185
  }
5176
5186
  }).on(A.End, (i, n) => {
5177
- if (this.canUserPerformAction(w.StretchNode) && n.getResizableX() && !n.removed && this.currentAction instanceof X && this.currentAction.intent === w.StretchNode) {
5187
+ if (this.canUserPerformAction(k.StretchNode) && n.getResizableX() && !n.removed && this.currentAction instanceof X && this.currentAction.intent === k.StretchNode) {
5178
5188
  let o = this.getPointerLocationRelativeToCanvas(i);
5179
5189
  this.snapToGrid && (o = this.getClosestGridPoint([
5180
5190
  o[0] - n.type.snapToGridOffset[2],
@@ -5184,20 +5194,20 @@ const ui = (s) => s * Math.PI / 180, Oe = (s, t, e) => {
5184
5194
  S();
5185
5195
  })
5186
5196
  ), l.filter(".resizable-y").append("line").attr("class", "bottom-resizer").attr("stroke", "transparent").attr("stroke-width", `${H}px`).on($.MouseOver, (i, n) => {
5187
- this.canUserPerformAction(w.StretchNode) && n.getResizableY() && !n.removed && S(L.NSResize);
5197
+ this.canUserPerformAction(k.StretchNode) && n.getResizableY() && !n.removed && S(E.NSResize);
5188
5198
  }).on($.MouseOut, (i, n) => {
5189
- this.canUserPerformAction(w.StretchNode) && n.getResizableY() && !n.removed && S();
5199
+ this.canUserPerformAction(k.StretchNode) && n.getResizableY() && !n.removed && S();
5190
5200
  }).call(
5191
- x.drag().on(A.Start, (i, n) => {
5192
- this.canUserPerformAction(w.StretchNode) && n.getResizableY() && !n.removed ? (S(L.NSResize), this.currentAction = new X(
5201
+ L.drag().on(A.Start, (i, n) => {
5202
+ this.canUserPerformAction(k.StretchNode) && n.getResizableY() && !n.removed ? (S(E.NSResize), this.currentAction = new X(
5193
5203
  this,
5194
- w.StretchNode,
5204
+ k.StretchNode,
5195
5205
  n.id,
5196
5206
  n.getGeometry(),
5197
5207
  n.getGeometry()
5198
- )) : S(L.NotAllowed);
5208
+ )) : S(E.NotAllowed);
5199
5209
  }).on(A.Drag, (i, n) => {
5200
- if (this.canUserPerformAction(w.StretchNode) && n.getResizableY() && !n.removed) {
5210
+ if (this.canUserPerformAction(k.StretchNode) && n.getResizableY() && !n.removed) {
5201
5211
  const o = this.getPointerLocationRelativeToCanvas(i);
5202
5212
  n.stretch(
5203
5213
  g.Bottom,
@@ -5205,7 +5215,7 @@ const ui = (s) => s * Math.PI / 180, Oe = (s, t, e) => {
5205
5215
  );
5206
5216
  }
5207
5217
  }).on(A.End, (i, n) => {
5208
- if (this.canUserPerformAction(w.StretchNode) && n.getResizableY() && !n.removed && this.currentAction instanceof X && this.currentAction.intent === w.StretchNode) {
5218
+ if (this.canUserPerformAction(k.StretchNode) && n.getResizableY() && !n.removed && this.currentAction instanceof X && this.currentAction.intent === k.StretchNode) {
5209
5219
  let o = this.getPointerLocationRelativeToCanvas(i);
5210
5220
  this.snapToGrid && this.snapToGrid && (o = this.getClosestGridPoint([
5211
5221
  o[0] - n.type.snapToGridOffset[2],
@@ -5217,7 +5227,7 @@ const ui = (s) => s * Math.PI / 180, Oe = (s, t, e) => {
5217
5227
  }
5218
5228
  S();
5219
5229
  })
5220
- ), r.attr("transform", (i) => `translate(${i.coords[0]},${i.coords[1]})`).attr("opacity", (i) => i.removed ? 0.5 : 1), ge(
5230
+ ), r.attr("transform", (i) => `translate(${i.coords[0]},${i.coords[1]})`).attr("opacity", (i) => i.removed ? 0.5 : 1), fe(
5221
5231
  r
5222
5232
  ), r.filter(".resizable-x").select("line.left-resizer").style("pointer-events", (i) => i.getResizableX() ? "initial" : "none").attr("x1", H / 2).attr("x2", H / 2).attr("y1", 0).attr("y2", (i) => i.height), r.filter(".resizable-y").select("line.top-resizer").style("pointer-events", (i) => i.getResizableY() ? "initial" : "none").attr("x1", 0).attr("x2", (i) => i.width).attr("y1", H / 2).attr("y2", H / 2), r.filter(".resizable-x").select("line.right-resizer").style("pointer-events", (i) => i.getResizableX() ? "initial" : "none").attr("x1", (i) => i.width - H / 2).attr("x2", (i) => i.width - H / 2).attr("y1", 0).attr("y2", (i) => i.height), r.filter(".resizable-y").select("line.bottom-resizer").style("pointer-events", (i) => i.getResizableY() ? "initial" : "none").attr("x1", 0).attr("x2", (i) => i.width).attr("y1", (i) => i.height - H / 2).attr("y2", (i) => i.height - H / 2);
5223
5233
  }
@@ -5230,12 +5240,12 @@ const ui = (s) => s * Math.PI / 180, Oe = (s, t, e) => {
5230
5240
  );
5231
5241
  const a = e.exit(), l = e.enter().append("g").attr("id", (i) => i.id).attr(
5232
5242
  "class",
5233
- (i) => `diagram-section${ye(i) ? " resizable-x" : ""}${be(i) ? " resizable-y" : ""} ${i.look?.lookType}`
5243
+ (i) => `diagram-section${be(i) ? " resizable-x" : ""}${ke(i) ? " resizable-y" : ""} ${i.look?.lookType}`
5234
5244
  );
5235
5245
  t && t.length > 0 && (e = e.filter((i) => t.includes(i.id)));
5236
5246
  const r = l.merge(e);
5237
5247
  a.remove(), l.on($.MouseOver, (i, n) => {
5238
- this.dragging || (this.userHighlight.focusOn(n), this.diagramEvent$.next(new Q(n)));
5248
+ this.dragging || (this.userHighlight.focusOn(n), this.diagramEvent$.next(new tt(n)));
5239
5249
  }).on($.Click, (i, n) => {
5240
5250
  if (!i.ctrlKey && !i.shiftKey) {
5241
5251
  const d = this.userSelection.all();
@@ -5256,10 +5266,10 @@ const ui = (s) => s * Math.PI / 180, Oe = (s, t, e) => {
5256
5266
  return;
5257
5267
  }
5258
5268
  const o = new mt(i, n);
5259
- if (this.diagramEvent$.next(o), !o.defaultPrevented && this.canUserPerformAction(w.ContextMenu)) {
5269
+ if (this.diagramEvent$.next(o), !o.defaultPrevented && this.canUserPerformAction(k.ContextMenu)) {
5260
5270
  i.preventDefault();
5261
5271
  const d = ct(n);
5262
- this.userHighlight.focusOn(d), this.diagramEvent$.next(new Q(d)), this.userSelection.add(d), this.diagramEvent$.next(
5272
+ this.userHighlight.focusOn(d), this.diagramEvent$.next(new tt(d)), this.userSelection.add(d), this.diagramEvent$.next(
5263
5273
  new G([d], !0)
5264
5274
  ), this.contextMenu.open(i);
5265
5275
  }
@@ -5267,19 +5277,19 @@ const ui = (s) => s * Math.PI / 180, Oe = (s, t, e) => {
5267
5277
  const o = new pt(i, n);
5268
5278
  this.diagramEvent$.next(o);
5269
5279
  }).call(
5270
- x.drag().filter((i) => (this.secondaryButton = vt(i), !0)).on(A.Start, (i, n) => {
5280
+ L.drag().filter((i) => (this.secondaryButton = vt(i), !0)).on(A.Start, (i, n) => {
5271
5281
  if (this.multipleSelectionOn || this.secondaryButton)
5272
5282
  this.startMultipleSelection(i);
5273
5283
  else {
5274
5284
  const o = n?.node;
5275
- o ? this.startMovingNode(i, o) : S(L.NotAllowed);
5285
+ o ? this.startMovingNode(i, o) : S(E.NotAllowed);
5276
5286
  }
5277
5287
  }).on(A.Drag, (i, n) => {
5278
5288
  if (this.multipleSelectionOn || this.secondaryButton)
5279
5289
  this.continueMultipleSelection(i);
5280
5290
  else {
5281
5291
  const o = n?.node;
5282
- o ? this.continueMovingNode(i, o) : S(L.NotAllowed);
5292
+ o ? this.continueMovingNode(i, o) : S(E.NotAllowed);
5283
5293
  }
5284
5294
  }).on(A.End, (i, n) => {
5285
5295
  if (this.multipleSelectionOn || this.secondaryButton)
@@ -5290,23 +5300,23 @@ const ui = (s) => s * Math.PI / 180, Oe = (s, t, e) => {
5290
5300
  }
5291
5301
  this.secondaryButton = !1;
5292
5302
  })
5293
- ), he(
5303
+ ), ge(
5294
5304
  l
5295
5305
  ), l.filter(".resizable-x").append("line").attr("class", "left-resizer").attr("stroke", "transparent").attr("stroke-width", `${H}px`).on($.MouseOver, (i, n) => {
5296
- this.canUserPerformAction(w.StretchSection) && n.getResizableX() && !n.removed && S(L.EWResize);
5306
+ this.canUserPerformAction(k.StretchSection) && n.getResizableX() && !n.removed && S(E.EWResize);
5297
5307
  }).on($.MouseOut, (i, n) => {
5298
- this.canUserPerformAction(w.StretchSection) && n.getResizableX() && !n.removed && S();
5308
+ this.canUserPerformAction(k.StretchSection) && n.getResizableX() && !n.removed && S();
5299
5309
  }).call(
5300
- x.drag().on(A.Start, (i, n) => {
5301
- this.canUserPerformAction(w.StretchSection) && n.getResizableX() && !n.removed && n.node ? (S(L.EWResize), this.currentAction = new X(
5310
+ L.drag().on(A.Start, (i, n) => {
5311
+ this.canUserPerformAction(k.StretchSection) && n.getResizableX() && !n.removed && n.node ? (S(E.EWResize), this.currentAction = new X(
5302
5312
  this,
5303
- w.StretchSection,
5313
+ k.StretchSection,
5304
5314
  n.node.id,
5305
5315
  n.node.getGeometry(),
5306
5316
  n.node.getGeometry()
5307
- )) : S(L.NotAllowed);
5317
+ )) : S(E.NotAllowed);
5308
5318
  }).on(A.Drag, (i, n) => {
5309
- if (this.canUserPerformAction(w.StretchSection) && n.getResizableX() && !n.removed && n.node) {
5319
+ if (this.canUserPerformAction(k.StretchSection) && n.getResizableX() && !n.removed && n.node) {
5310
5320
  const o = this.getPointerLocationRelativeToCanvas(i);
5311
5321
  n.node.stretchSections(
5312
5322
  g.Left,
@@ -5316,7 +5326,7 @@ const ui = (s) => s * Math.PI / 180, Oe = (s, t, e) => {
5316
5326
  );
5317
5327
  }
5318
5328
  }).on(A.End, (i, n) => {
5319
- if (this.canUserPerformAction(w.StretchSection) && n.getResizableX() && !n.removed && this.currentAction instanceof X && this.currentAction.intent === w.StretchSection && n.node) {
5329
+ if (this.canUserPerformAction(k.StretchSection) && n.getResizableX() && !n.removed && this.currentAction instanceof X && this.currentAction.intent === k.StretchSection && n.node) {
5320
5330
  let o = this.getPointerLocationRelativeToCanvas(i);
5321
5331
  this.snapToGrid && (o = this.getClosestGridPoint(o)), n.node.stretchSections(
5322
5332
  g.Left,
@@ -5328,20 +5338,20 @@ const ui = (s) => s * Math.PI / 180, Oe = (s, t, e) => {
5328
5338
  S();
5329
5339
  })
5330
5340
  ), l.filter(".resizable-y").append("line").attr("class", "top-resizer").attr("stroke", "transparent").attr("stroke-width", `${H}px`).on($.MouseOver, (i, n) => {
5331
- this.canUserPerformAction(w.StretchSection) && n.getResizableY() && !n.removed && S(L.NSResize);
5341
+ this.canUserPerformAction(k.StretchSection) && n.getResizableY() && !n.removed && S(E.NSResize);
5332
5342
  }).on($.MouseOut, (i, n) => {
5333
- this.canUserPerformAction(w.StretchSection) && n.getResizableY() && !n.removed && S();
5343
+ this.canUserPerformAction(k.StretchSection) && n.getResizableY() && !n.removed && S();
5334
5344
  }).call(
5335
- x.drag().on(A.Start, (i, n) => {
5336
- this.canUserPerformAction(w.StretchSection) && n.getResizableY() && !n.removed && n.node ? (S(L.NSResize), this.currentAction = new X(
5345
+ L.drag().on(A.Start, (i, n) => {
5346
+ this.canUserPerformAction(k.StretchSection) && n.getResizableY() && !n.removed && n.node ? (S(E.NSResize), this.currentAction = new X(
5337
5347
  this,
5338
- w.StretchSection,
5348
+ k.StretchSection,
5339
5349
  n.node.id,
5340
5350
  n.node.getGeometry(),
5341
5351
  n.node.getGeometry()
5342
- )) : S(L.NotAllowed);
5352
+ )) : S(E.NotAllowed);
5343
5353
  }).on(A.Drag, (i, n) => {
5344
- if (this.canUserPerformAction(w.StretchSection) && n.getResizableY() && !n.removed && n.node) {
5354
+ if (this.canUserPerformAction(k.StretchSection) && n.getResizableY() && !n.removed && n.node) {
5345
5355
  const o = this.getPointerLocationRelativeToCanvas(i);
5346
5356
  n.node.stretchSections(
5347
5357
  g.Top,
@@ -5351,7 +5361,7 @@ const ui = (s) => s * Math.PI / 180, Oe = (s, t, e) => {
5351
5361
  );
5352
5362
  }
5353
5363
  }).on(A.End, (i, n) => {
5354
- if (this.canUserPerformAction(w.StretchSection) && n.getResizableY() && !n.removed && this.currentAction instanceof X && this.currentAction.intent === w.StretchSection && n.node) {
5364
+ if (this.canUserPerformAction(k.StretchSection) && n.getResizableY() && !n.removed && this.currentAction instanceof X && this.currentAction.intent === k.StretchSection && n.node) {
5355
5365
  let o = this.getPointerLocationRelativeToCanvas(i);
5356
5366
  this.snapToGrid && (o = this.getClosestGridPoint(o)), n.node.stretchSections(
5357
5367
  g.Top,
@@ -5363,20 +5373,20 @@ const ui = (s) => s * Math.PI / 180, Oe = (s, t, e) => {
5363
5373
  S();
5364
5374
  })
5365
5375
  ), l.filter(".resizable-x").append("line").attr("class", "right-resizer").attr("stroke", "transparent").attr("stroke-width", `${H}px`).on($.MouseOver, (i, n) => {
5366
- this.canUserPerformAction(w.StretchSection) && n.getResizableX() && !n.removed && S(L.EWResize);
5376
+ this.canUserPerformAction(k.StretchSection) && n.getResizableX() && !n.removed && S(E.EWResize);
5367
5377
  }).on($.MouseOut, (i, n) => {
5368
- this.canUserPerformAction(w.StretchSection) && n.getResizableX() && !n.removed && S();
5378
+ this.canUserPerformAction(k.StretchSection) && n.getResizableX() && !n.removed && S();
5369
5379
  }).call(
5370
- x.drag().on(A.Start, (i, n) => {
5371
- this.canUserPerformAction(w.StretchSection) && n.getResizableX() && !n.removed && n.node ? (S(L.EWResize), this.currentAction = new X(
5380
+ L.drag().on(A.Start, (i, n) => {
5381
+ this.canUserPerformAction(k.StretchSection) && n.getResizableX() && !n.removed && n.node ? (S(E.EWResize), this.currentAction = new X(
5372
5382
  this,
5373
- w.StretchSection,
5383
+ k.StretchSection,
5374
5384
  n.node.id,
5375
5385
  n.node.getGeometry(),
5376
5386
  n.node.getGeometry()
5377
- )) : S(L.NotAllowed);
5387
+ )) : S(E.NotAllowed);
5378
5388
  }).on(A.Drag, (i, n) => {
5379
- if (this.canUserPerformAction(w.StretchSection) && n.getResizableX() && !n.removed && n.node) {
5389
+ if (this.canUserPerformAction(k.StretchSection) && n.getResizableX() && !n.removed && n.node) {
5380
5390
  const o = this.getPointerLocationRelativeToCanvas(i);
5381
5391
  n.node.stretchSections(
5382
5392
  g.Right,
@@ -5386,7 +5396,7 @@ const ui = (s) => s * Math.PI / 180, Oe = (s, t, e) => {
5386
5396
  );
5387
5397
  }
5388
5398
  }).on(A.End, (i, n) => {
5389
- if (this.canUserPerformAction(w.StretchSection) && n.getResizableX() && !n.removed && this.currentAction instanceof X && this.currentAction.intent === w.StretchSection && n.node) {
5399
+ if (this.canUserPerformAction(k.StretchSection) && n.getResizableX() && !n.removed && this.currentAction instanceof X && this.currentAction.intent === k.StretchSection && n.node) {
5390
5400
  let o = this.getPointerLocationRelativeToCanvas(i);
5391
5401
  this.snapToGrid && (o = this.getClosestGridPoint(o)), n.node.stretchSections(
5392
5402
  g.Right,
@@ -5398,20 +5408,20 @@ const ui = (s) => s * Math.PI / 180, Oe = (s, t, e) => {
5398
5408
  S();
5399
5409
  })
5400
5410
  ), l.filter(".resizable-y").append("line").attr("class", "bottom-resizer").attr("stroke", "transparent").attr("stroke-width", `${H}px`).on($.MouseOver, (i, n) => {
5401
- this.canUserPerformAction(w.StretchSection) && n.getResizableY() && !n.removed && S(L.NSResize);
5411
+ this.canUserPerformAction(k.StretchSection) && n.getResizableY() && !n.removed && S(E.NSResize);
5402
5412
  }).on($.MouseOut, (i, n) => {
5403
- this.canUserPerformAction(w.StretchSection) && n.getResizableY() && !n.removed && S();
5413
+ this.canUserPerformAction(k.StretchSection) && n.getResizableY() && !n.removed && S();
5404
5414
  }).call(
5405
- x.drag().on(A.Start, (i, n) => {
5406
- this.canUserPerformAction(w.StretchSection) && n.getResizableY() && !n.removed && n.node ? (S(L.NSResize), this.currentAction = new X(
5415
+ L.drag().on(A.Start, (i, n) => {
5416
+ this.canUserPerformAction(k.StretchSection) && n.getResizableY() && !n.removed && n.node ? (S(E.NSResize), this.currentAction = new X(
5407
5417
  this,
5408
- w.StretchSection,
5418
+ k.StretchSection,
5409
5419
  n.node.id,
5410
5420
  n.node.getGeometry(),
5411
5421
  n.node.getGeometry()
5412
- )) : S(L.NotAllowed);
5422
+ )) : S(E.NotAllowed);
5413
5423
  }).on(A.Drag, (i, n) => {
5414
- if (this.canUserPerformAction(w.StretchSection) && n.getResizableY() && !n.removed && n.node) {
5424
+ if (this.canUserPerformAction(k.StretchSection) && n.getResizableY() && !n.removed && n.node) {
5415
5425
  const o = this.getPointerLocationRelativeToCanvas(i);
5416
5426
  n.node.stretchSections(
5417
5427
  g.Bottom,
@@ -5421,7 +5431,7 @@ const ui = (s) => s * Math.PI / 180, Oe = (s, t, e) => {
5421
5431
  );
5422
5432
  }
5423
5433
  }).on(A.End, (i, n) => {
5424
- if (this.canUserPerformAction(w.StretchSection) && n.getResizableY() && !n.removed && this.currentAction instanceof X && this.currentAction.intent === w.StretchSection && n.node) {
5434
+ if (this.canUserPerformAction(k.StretchSection) && n.getResizableY() && !n.removed && this.currentAction instanceof X && this.currentAction.intent === k.StretchSection && n.node) {
5425
5435
  let o = this.getPointerLocationRelativeToCanvas(i);
5426
5436
  this.snapToGrid && (o = this.getClosestGridPoint(o)), n.node.stretchSections(
5427
5437
  g.Bottom,
@@ -5432,7 +5442,7 @@ const ui = (s) => s * Math.PI / 180, Oe = (s, t, e) => {
5432
5442
  }
5433
5443
  S();
5434
5444
  })
5435
- ), r.attr("transform", (i) => `translate(${i.coords[0]},${i.coords[1]})`).attr("opacity", (i) => i.removed ? 0.5 : 1), ge(
5445
+ ), r.attr("transform", (i) => `translate(${i.coords[0]},${i.coords[1]})`).attr("opacity", (i) => i.removed ? 0.5 : 1), fe(
5436
5446
  r
5437
5447
  ), r.filter(".resizable-x").select("line.left-resizer").style("pointer-events", (i) => i.getResizableX() ? "initial" : "none").attr("x1", H / 2).attr("x2", H / 2).attr("y1", 0).attr("y2", (i) => i.height), r.filter(".resizable-y").select("line.top-resizer").style("pointer-events", (i) => i.getResizableY() ? "initial" : "none").attr("x1", 0).attr("x2", (i) => i.width).attr("y1", H / 2).attr("y2", H / 2), r.filter(".resizable-x").select("line.right-resizer").style("pointer-events", (i) => i.getResizableX() ? "initial" : "none").attr("x1", (i) => i.width - H / 2).attr("x2", (i) => i.width - H / 2).attr("y1", 0).attr("y2", (i) => i.height), r.filter(".resizable-y").select("line.bottom-resizer").style("pointer-events", (i) => i.getResizableY() ? "initial" : "none").attr("x1", 0).attr("x2", (i) => i.width).attr("y1", (i) => i.height - H / 2).attr("y2", (i) => i.height - H / 2);
5438
5448
  }
@@ -5447,7 +5457,7 @@ const ui = (s) => s * Math.PI / 180, Oe = (s, t, e) => {
5447
5457
  t && t.length > 0 && (e = e.filter((i) => t.includes(i.id)));
5448
5458
  const r = l.merge(e);
5449
5459
  a.remove(), l.on($.MouseOver, (i, n) => {
5450
- !this.unfinishedConnection && !this.dragging && (this.userHighlight.focusOn(n), this.diagramEvent$.next(new Q(n))), this.unfinishedConnection && (// can start at the starting port
5460
+ !this.unfinishedConnection && !this.dragging && (this.userHighlight.focusOn(n), this.diagramEvent$.next(new tt(n))), this.unfinishedConnection && (// can start at the starting port
5451
5461
  this.unfinishedConnection.type.canStartFromType(
5452
5462
  this.unfinishedConnection.start?.getNode()?.type?.id || ""
5453
5463
  ) && this.unfinishedConnection.start?.allowsOutgoing && // can end at the ending port
@@ -5459,9 +5469,9 @@ const ui = (s) => s * Math.PI / 180, Oe = (s, t, e) => {
5459
5469
  ) && n.allowsOutgoing && // can end at the starting port
5460
5470
  this.unfinishedConnection.type.canFinishOnType(
5461
5471
  this.unfinishedConnection.start?.getNode()?.type?.id || ""
5462
- ) && this.unfinishedConnection.start?.allowsIncoming || S(L.NoDrop));
5472
+ ) && this.unfinishedConnection.start?.allowsIncoming || S(E.NoDrop));
5463
5473
  }).on($.MouseOut, () => {
5464
- this.unfinishedConnection && S(L.Grabbing);
5474
+ this.unfinishedConnection && S(E.Grabbing);
5465
5475
  }).on($.Click, (i, n) => {
5466
5476
  if (!i.ctrlKey && !i.shiftKey) {
5467
5477
  const d = this.userSelection.all();
@@ -5482,10 +5492,10 @@ const ui = (s) => s * Math.PI / 180, Oe = (s, t, e) => {
5482
5492
  return;
5483
5493
  }
5484
5494
  const o = new mt(i, n);
5485
- if (this.diagramEvent$.next(o), !o.defaultPrevented && this.canUserPerformAction(w.ContextMenu)) {
5495
+ if (this.diagramEvent$.next(o), !o.defaultPrevented && this.canUserPerformAction(k.ContextMenu)) {
5486
5496
  i.preventDefault();
5487
5497
  const d = ct(n);
5488
- this.userHighlight.focusOn(d), this.diagramEvent$.next(new Q(d)), this.userSelection.add(d), this.diagramEvent$.next(
5498
+ this.userHighlight.focusOn(d), this.diagramEvent$.next(new tt(d)), this.userSelection.add(d), this.diagramEvent$.next(
5489
5499
  new G([d], !0)
5490
5500
  ), this.contextMenu.open(i);
5491
5501
  }
@@ -5493,22 +5503,23 @@ const ui = (s) => s * Math.PI / 180, Oe = (s, t, e) => {
5493
5503
  const o = new pt(i, n);
5494
5504
  this.diagramEvent$.next(o);
5495
5505
  }).call(
5496
- x.drag().filter((i) => (this.secondaryButton = vt(i), !0)).on(A.Start, (i, n) => {
5497
- this.multipleSelectionOn || this.secondaryButton ? this.startMultipleSelection(i) : this.canUserPerformAction(w.AddConnection) && (this.allowSharingPorts || n.incomingConnections.filter((o) => !o.removed).length === 0 && n.outgoingConnections.filter((o) => !o.removed).length === 0) && !n.removed ? (S(L.Grabbing), this.startConnection(n), this.unfinishedConnection && (this.unfinishedConnectionTracer = this.selectCanvasElements().append("path").attr("stroke", "none").attr("fill", "none"))) : S(L.NotAllowed);
5506
+ L.drag().filter((i) => (this.secondaryButton = vt(i), !0)).on(A.Start, (i, n) => {
5507
+ this.multipleSelectionOn || this.secondaryButton ? this.startMultipleSelection(i) : this.canUserPerformAction(k.AddConnection) && (this.allowSharingPorts || n.incomingConnections.filter((o) => !o.removed).length === 0 && n.outgoingConnections.filter((o) => !o.removed).length === 0) && !n.removed ? (S(E.Grabbing), this.startConnection(n), this.unfinishedConnection && (this.unfinishedConnectionTracer = this.selectCanvasElements().append("path").attr("stroke", "none").attr("fill", "none"))) : S(E.NotAllowed);
5498
5508
  }).on(A.Drag, (i, n) => {
5499
5509
  if (this.multipleSelectionOn || this.secondaryButton)
5500
5510
  this.continueMultipleSelection(i);
5501
- else if (this.canUserPerformAction(w.AddConnection) && !n.removed && this.unfinishedConnection !== void 0) {
5511
+ else if (this.canUserPerformAction(k.AddConnection) && !n.removed && this.unfinishedConnection !== void 0) {
5502
5512
  const o = [i.x, i.y];
5503
5513
  this.unfinishedConnectionTracer?.attr(
5504
5514
  "d",
5505
- ce(
5506
- this.unfinishedConnection.look.shape || et.look.shape,
5515
+ he(
5516
+ this.unfinishedConnection.look.shape || ot.look.shape,
5507
5517
  this.unfinishedConnection.startCoords,
5508
5518
  o,
5509
5519
  this.unfinishedConnection.startDirection,
5510
5520
  this.unfinishedConnection.endDirection,
5511
- this.unfinishedConnection.type.defaultLook.thickness || et.look.thickness,
5521
+ this.unfinishedConnection.points,
5522
+ this.unfinishedConnection.type.defaultLook.thickness || ot.look.thickness,
5512
5523
  this.unfinishedConnection.type.defaultStartMarkerLook?.width,
5513
5524
  this.unfinishedConnection.type.defaultEndMarkerLook?.width
5514
5525
  )
@@ -5527,7 +5538,7 @@ const ui = (s) => s * Math.PI / 180, Oe = (s, t, e) => {
5527
5538
  ];
5528
5539
  } else
5529
5540
  this.unfinishedConnection.endCoords = o;
5530
- if (this.updateConnectionsInView(fe), this.model.ports.length > 0) {
5541
+ if (this.updateConnectionsInView(ue), this.unfinishedConnectionPort?.raise(!1), this.model.ports.length > 0) {
5531
5542
  const c = this.getPointerLocationRelativeToCanvas(i);
5532
5543
  let h = Number.POSITIVE_INFINITY, f;
5533
5544
  for (const b of this.model.ports) {
@@ -5541,7 +5552,7 @@ const ui = (s) => s * Math.PI / 180, Oe = (s, t, e) => {
5541
5552
  if (this.multipleSelectionOn || this.secondaryButton)
5542
5553
  this.finishMultipleSelection(i);
5543
5554
  else {
5544
- if (this.canUserPerformAction(w.AddConnection) && !n.removed) {
5555
+ if (this.canUserPerformAction(k.AddConnection) && !n.removed) {
5545
5556
  this.unfinishedConnectionTracer?.remove();
5546
5557
  const o = this.userHighlight.getFocus();
5547
5558
  if (o instanceof bt)
@@ -5570,12 +5581,12 @@ const ui = (s) => s * Math.PI / 180, Oe = (s, t, e) => {
5570
5581
  }
5571
5582
  this.secondaryButton = !1;
5572
5583
  })
5573
- ), l.filter(".image-look").append("image"), he(
5584
+ ), l.filter(".image-look").append("image"), ge(
5574
5585
  l
5575
5586
  ), r.attr(
5576
5587
  "transform",
5577
5588
  (i) => `translate(${i.coords[0] - i.width / 2},${i.coords[1] - i.width / 2})`
5578
- ).attr("opacity", (i) => i.removed ? 0.5 : 1), ge(
5589
+ ).attr("opacity", (i) => i.removed ? 0.5 : 1), fe(
5579
5590
  r
5580
5591
  );
5581
5592
  }
@@ -5589,7 +5600,7 @@ const ui = (s) => s * Math.PI / 180, Oe = (s, t, e) => {
5589
5600
  t && t.length > 0 && (a = a.filter((n) => t.includes(n.id)));
5590
5601
  const i = r.merge(a);
5591
5602
  l.remove(), r.on($.MouseOver, (n, o) => {
5592
- o.end !== void 0 && !this.dragging && (this.userHighlight.focusOn(o), this.diagramEvent$.next(new Q(o)));
5603
+ o.end !== void 0 && !this.dragging && (this.userHighlight.focusOn(o), this.diagramEvent$.next(new tt(o)));
5593
5604
  }).on($.Click, (n, o) => {
5594
5605
  if (!n.ctrlKey && !n.shiftKey) {
5595
5606
  const d = this.userSelection.all();
@@ -5604,12 +5615,12 @@ const ui = (s) => s * Math.PI / 180, Oe = (s, t, e) => {
5604
5615
  return;
5605
5616
  }
5606
5617
  const d = new mt(n, o);
5607
- this.diagramEvent$.next(d), !d.defaultPrevented && this.canUserPerformAction(w.ContextMenu) && (n.preventDefault(), this.userHighlight.focusOn(o), this.diagramEvent$.next(new Q(o)), this.userSelection.add(o), this.diagramEvent$.next(new G([o], !0)), this.contextMenu.open(n));
5618
+ this.diagramEvent$.next(d), !d.defaultPrevented && this.canUserPerformAction(k.ContextMenu) && (n.preventDefault(), this.userHighlight.focusOn(o), this.diagramEvent$.next(new tt(o)), this.userSelection.add(o), this.diagramEvent$.next(new G([o], !0)), this.contextMenu.open(n));
5608
5619
  }).on($.DoubleClick, (n, o) => {
5609
5620
  const d = new pt(n, o);
5610
5621
  this.diagramEvent$.next(d);
5611
5622
  }).call(
5612
- x.drag().filter((n) => (this.secondaryButton = vt(n), !0)).on(A.Start, (n) => {
5623
+ L.drag().filter((n) => (this.secondaryButton = vt(n), !0)).on(A.Start, (n) => {
5613
5624
  this.startMultipleSelection(n);
5614
5625
  }).on(A.Drag, (n) => {
5615
5626
  this.continueMultipleSelection(n);
@@ -5618,45 +5629,47 @@ const ui = (s) => s * Math.PI / 180, Oe = (s, t, e) => {
5618
5629
  })
5619
5630
  ), r.append("path").attr("class", "diagram-connection-path"), r.append("path").attr("class", "diagram-connection-path-box"), r.append("marker").attr("id", (n) => `${n.id}-start-marker`).attr("class", "diagram-connection-start-marker").append("image").attr("preserveAspectRatio", "none"), r.append("marker").attr("id", (n) => `${n.id}-end-marker`).attr("class", "diagram-connection-end-marker").append("image").attr("preserveAspectRatio", "none"), r.append("g").attr("class", "diagram-connection-start-label"), r.select("g.diagram-connection-start-label").append("path"), r.select("g.diagram-connection-start-label").append("text").style("user-select", "none"), r.append("g").attr("class", "diagram-connection-middle-label"), r.select("g.diagram-connection-middle-label").append("path"), r.select("g.diagram-connection-middle-label").append("text").style("user-select", "none"), r.append("g").attr("class", "diagram-connection-end-label"), r.select("g.diagram-connection-end-label").append("path"), r.select("g.diagram-connection-end-label").append("text").style("user-select", "none"), i.attr("opacity", (n) => n.removed ? 0.5 : 1).select("path.diagram-connection-path").attr(
5620
5631
  "d",
5621
- (n) => ce(
5622
- n.look.shape || et.look.shape,
5632
+ (n) => he(
5633
+ n.look.shape || ot.look.shape,
5623
5634
  n.startCoords,
5624
5635
  n.endCoords,
5625
5636
  n.startDirection,
5626
5637
  n.endDirection,
5627
- n.type.defaultLook.thickness || et.look.thickness,
5638
+ n.points,
5639
+ n.type.defaultLook.thickness || ot.look.thickness,
5628
5640
  n.type.defaultStartMarkerLook?.width,
5629
5641
  n.type.defaultEndMarkerLook?.width
5630
5642
  )
5631
5643
  ).attr("marker-start", (n) => `url(#${n.id}-start-marker)`).attr("marker-end", (n) => `url(#${n.id}-end-marker)`).attr(
5632
5644
  "stroke",
5633
- (n) => n.look.color || et.look.color
5645
+ (n) => n.look.color || ot.look.color
5634
5646
  ).attr("stroke-width", (n) => `${n.look.thickness}px`).attr(
5635
5647
  "stroke-dasharray",
5636
- (n) => me(
5637
- n.look.style || et.look.style,
5638
- n.type.defaultLook.thickness || et.look.thickness
5648
+ (n) => ve(
5649
+ n.look.style || ot.look.style,
5650
+ n.type.defaultLook.thickness || ot.look.thickness
5639
5651
  )
5640
5652
  ).attr("fill", "none"), i.select("path.diagram-connection-path-box").attr(
5641
5653
  "d",
5642
- (n) => ce(
5643
- n.look.shape || et.look.shape,
5654
+ (n) => he(
5655
+ n.look.shape || ot.look.shape,
5644
5656
  n.startCoords,
5645
5657
  n.endCoords,
5646
5658
  n.startDirection,
5647
5659
  n.endDirection,
5648
- n.type.defaultLook.thickness || et.look.thickness,
5660
+ n.points,
5661
+ n.type.defaultLook.thickness || ot.look.thickness,
5649
5662
  n.type.defaultStartMarkerLook?.width,
5650
5663
  n.type.defaultEndMarkerLook?.width
5651
5664
  )
5652
5665
  ).attr("stroke", "transparent").attr("pointer-events", "stroke").attr(
5653
5666
  "stroke-width",
5654
- (n) => `${(n.look.thickness || et.look.thickness) + mi}px`
5667
+ (n) => `${(n.look.thickness || ot.look.thickness) + mi}px`
5655
5668
  ).attr(
5656
5669
  "stroke-dasharray",
5657
- (n) => me(
5658
- n.look.style || et.look.style,
5659
- n.type.defaultLook.thickness || et.look.thickness
5670
+ (n) => ve(
5671
+ n.look.style || ot.look.style,
5672
+ n.type.defaultLook.thickness || ot.look.thickness
5660
5673
  )
5661
5674
  ).attr("fill", "none"), i.data().forEach((n) => {
5662
5675
  this.updateConnectionLabelsInView(n), this.updateConnectionMarkersInView(n);
@@ -5675,7 +5688,7 @@ const ui = (s) => s * Math.PI / 180, Oe = (s, t, e) => {
5675
5688
  t && t.length > 0 && (e = e.filter((i) => t.includes(i.id)));
5676
5689
  const r = l.merge(e);
5677
5690
  if (a.remove(), l.style("box-sizing", "border-box").on($.MouseOver, (i, n) => {
5678
- this.dragging || (this.userHighlight.focusOn(n), this.diagramEvent$.next(new Q(n)));
5691
+ this.dragging || (this.userHighlight.focusOn(n), this.diagramEvent$.next(new tt(n)));
5679
5692
  }).on($.Click, (i, n) => {
5680
5693
  if (!i.ctrlKey && !i.shiftKey) {
5681
5694
  const d = this.userSelection.all();
@@ -5696,43 +5709,30 @@ const ui = (s) => s * Math.PI / 180, Oe = (s, t, e) => {
5696
5709
  return;
5697
5710
  }
5698
5711
  const o = new mt(i, n);
5699
- if (this.diagramEvent$.next(o), !o.defaultPrevented && this.canUserPerformAction(w.ContextMenu)) {
5712
+ if (this.diagramEvent$.next(o), !o.defaultPrevented && this.canUserPerformAction(k.ContextMenu)) {
5700
5713
  i.preventDefault();
5701
5714
  const d = ct(n);
5702
- this.userHighlight.focusOn(d), this.diagramEvent$.next(new Q(d)), this.userSelection.add(d), this.diagramEvent$.next(
5715
+ this.userHighlight.focusOn(d), this.diagramEvent$.next(new tt(d)), this.userSelection.add(d), this.diagramEvent$.next(
5703
5716
  new G([d], !0)
5704
5717
  ), this.contextMenu.open(i);
5705
5718
  }
5706
5719
  }).on($.DoubleClick, (i, n) => {
5707
5720
  const o = new pt(i, n);
5708
- this.diagramEvent$.next(o), !o.defaultPrevented && this.canUserPerformAction(w.EditField) && n.editable && !n.removed && (this.currentAction = new Re(this, n.id, n.text, ""), this.createInputField(
5709
- n.text,
5710
- n.coords,
5711
- n.width,
5712
- n.height,
5713
- n.fontSize,
5714
- n.fontFamily || V.fontFamily,
5715
- n.orientation,
5716
- (d) => {
5717
- },
5718
- (d) => {
5719
- n.text = d, this.currentAction instanceof Re && (this.currentAction.to = d, this.currentAction.do(), this.actionStack.add(this.currentAction), this.currentAction = void 0);
5720
- }
5721
- ));
5721
+ this.diagramEvent$.next(o), !o.defaultPrevented && this.canUserPerformAction(k.EditField) && n.editable && !n.removed && (this.currentAction = new Re(this, n.id, n.text, ""), this.openTextInput(n.id));
5722
5722
  }).call(
5723
- x.drag().filter((i) => (this.secondaryButton = vt(i), !0)).on(A.Start, (i, n) => {
5723
+ L.drag().filter((i) => (this.secondaryButton = vt(i), !0)).on(A.Start, (i, n) => {
5724
5724
  if (this.multipleSelectionOn || this.secondaryButton)
5725
5725
  this.startMultipleSelection(i);
5726
5726
  else {
5727
5727
  let o;
5728
- n.rootElement instanceof z ? o = n.rootElement : n.rootElement instanceof F && (o = n.rootElement.node), o ? this.startMovingNode(i, o) : S(L.NotAllowed);
5728
+ n.rootElement instanceof z ? o = n.rootElement : n.rootElement instanceof F && (o = n.rootElement.node), o ? this.startMovingNode(i, o) : S(E.NotAllowed);
5729
5729
  }
5730
5730
  }).on(A.Drag, (i, n) => {
5731
5731
  if (this.multipleSelectionOn || this.secondaryButton)
5732
5732
  this.continueMultipleSelection(i);
5733
5733
  else {
5734
5734
  let o;
5735
- n.rootElement instanceof z ? o = n.rootElement : n.rootElement instanceof F && (o = n.rootElement.node), o ? this.continueMovingNode(i, o) : S(L.NotAllowed);
5735
+ n.rootElement instanceof z ? o = n.rootElement : n.rootElement instanceof F && (o = n.rootElement.node), o ? this.continueMovingNode(i, o) : S(E.NotAllowed);
5736
5736
  }
5737
5737
  }).on(A.End, (i, n) => {
5738
5738
  if (this.multipleSelectionOn || this.secondaryButton)
@@ -5791,12 +5791,12 @@ const ui = (s) => s * Math.PI / 180, Oe = (s, t, e) => {
5791
5791
  return;
5792
5792
  }
5793
5793
  const o = new mt(i, n);
5794
- this.diagramEvent$.next(o), !o.defaultPrevented && this.canUserPerformAction(w.ContextMenu) && (i.preventDefault(), this.contextMenu.open(i));
5794
+ this.diagramEvent$.next(o), !o.defaultPrevented && this.canUserPerformAction(k.ContextMenu) && (i.preventDefault(), this.contextMenu.open(i));
5795
5795
  }).on($.DoubleClick, (i, n) => {
5796
5796
  const o = new pt(i, n);
5797
5797
  this.diagramEvent$.next(o);
5798
5798
  }).call(
5799
- x.drag().filter((i) => (this.secondaryButton = vt(i), !0)).on(A.Start, (i) => {
5799
+ L.drag().filter((i) => (this.secondaryButton = vt(i), !0)).on(A.Start, (i) => {
5800
5800
  (this.multipleSelectionOn || this.secondaryButton) && this.startMultipleSelection(i);
5801
5801
  }).on(A.Drag, (i) => {
5802
5802
  (this.multipleSelectionOn || this.secondaryButton) && this.continueMultipleSelection(i);
@@ -5814,7 +5814,7 @@ const ui = (s) => s * Math.PI / 180, Oe = (s, t, e) => {
5814
5814
  );
5815
5815
  const a = e.exit(), l = e.enter().append("g").attr("id", (i) => i.id).attr("class", "diagram-decorator");
5816
5816
  t && t.length > 0 && (e = e.filter((i) => t.includes(i.id))), l.merge(e).attr("width", (i) => `${i.width}px`).attr("height", (i) => `${i.height}px`).attr("transform", (i) => `translate(${i.coords[0]},${i.coords[1]})`).html((i) => i.html), a.remove(), l.on($.MouseOver, (i, n) => {
5817
- this.dragging || (this.userHighlight.focusOn(n), this.diagramEvent$.next(new Q(n)));
5817
+ this.dragging || (this.userHighlight.focusOn(n), this.diagramEvent$.next(new tt(n)));
5818
5818
  }).on($.Click, (i, n) => {
5819
5819
  if (!i.ctrlKey && !i.shiftKey) {
5820
5820
  const o = this.userSelection.all();
@@ -5837,11 +5837,11 @@ const ui = (s) => s * Math.PI / 180, Oe = (s, t, e) => {
5837
5837
  return;
5838
5838
  }
5839
5839
  const o = new mt(i, n);
5840
- if (this.diagramEvent$.next(o), !o.defaultPrevented && this.canUserPerformAction(w.ContextMenu) && n.rootElement) {
5840
+ if (this.diagramEvent$.next(o), !o.defaultPrevented && this.canUserPerformAction(k.ContextMenu) && n.rootElement) {
5841
5841
  i.preventDefault();
5842
5842
  const d = ct(n.rootElement);
5843
5843
  this.userHighlight.focusOn(d), this.diagramEvent$.next(
5844
- new Q(d)
5844
+ new tt(d)
5845
5845
  ), this.userSelection.add(d), this.diagramEvent$.next(
5846
5846
  new G([d], !0)
5847
5847
  ), this.contextMenu.open(i);
@@ -5850,19 +5850,19 @@ const ui = (s) => s * Math.PI / 180, Oe = (s, t, e) => {
5850
5850
  const o = new pt(i, n);
5851
5851
  this.diagramEvent$.next(o);
5852
5852
  }).call(
5853
- x.drag().filter((i) => (this.secondaryButton = vt(i), !0)).on(A.Start, (i, n) => {
5853
+ L.drag().filter((i) => (this.secondaryButton = vt(i), !0)).on(A.Start, (i, n) => {
5854
5854
  if (this.multipleSelectionOn || this.secondaryButton)
5855
5855
  this.startMultipleSelection(i);
5856
5856
  else {
5857
5857
  let o;
5858
- n.rootElement instanceof z ? o = n.rootElement : n.rootElement instanceof F && (o = n.rootElement.node), o ? this.startMovingNode(i, o) : S(L.NotAllowed);
5858
+ n.rootElement instanceof z ? o = n.rootElement : n.rootElement instanceof F && (o = n.rootElement.node), o ? this.startMovingNode(i, o) : S(E.NotAllowed);
5859
5859
  }
5860
5860
  }).on(A.Drag, (i, n) => {
5861
5861
  if (this.multipleSelectionOn || this.secondaryButton)
5862
5862
  this.continueMultipleSelection(i);
5863
5863
  else {
5864
5864
  let o;
5865
- n.rootElement instanceof z ? o = n.rootElement : n.rootElement instanceof F && (o = n.rootElement.node), o ? this.continueMovingNode(i, o) : S(L.NotAllowed);
5865
+ n.rootElement instanceof z ? o = n.rootElement : n.rootElement instanceof F && (o = n.rootElement.node), o ? this.continueMovingNode(i, o) : S(E.NotAllowed);
5866
5866
  }
5867
5867
  }).on(A.End, (i, n) => {
5868
5868
  if (this.multipleSelectionOn || this.secondaryButton)
@@ -5877,7 +5877,7 @@ const ui = (s) => s * Math.PI / 180, Oe = (s, t, e) => {
5877
5877
  }
5878
5878
  updateConnectionLabelsInView(t) {
5879
5879
  const e = this.selectCanvasView().select(
5880
- `[id='${pe(t.id)}']`
5880
+ `[id='${me(t.id)}']`
5881
5881
  ), l = e.select("path").node(), r = {
5882
5882
  ...V,
5883
5883
  ...t.type.label
@@ -5886,7 +5886,7 @@ const ui = (s) => s * Math.PI / 180, Oe = (s, t, e) => {
5886
5886
  const i = l.getTotalLength();
5887
5887
  let n = 0, o = 0, d = 0, c = 0, h = 0, f = 0;
5888
5888
  if (r.backgroundColor === "#00000000") {
5889
- const u = t.endCoords[0] - t.startCoords[0], y = t.endCoords[1] - t.startCoords[1];
5889
+ const u = t.endCoords[0] - t.startCoords[0], v = t.endCoords[1] - t.startCoords[1];
5890
5890
  switch (t.startDirection) {
5891
5891
  case g.Top:
5892
5892
  n = u >= 0 ? -0.5 : 0.5, h = n;
@@ -5895,10 +5895,10 @@ const ui = (s) => s * Math.PI / 180, Oe = (s, t, e) => {
5895
5895
  n = u >= 0 ? -0.5 : 0.5, h = n;
5896
5896
  break;
5897
5897
  case g.Left:
5898
- o = y > 0 ? -0.5 : 0.5, f = o;
5898
+ o = v > 0 ? -0.5 : 0.5, f = o;
5899
5899
  break;
5900
5900
  case g.Right:
5901
- o = y > 0 ? -0.5 : 0.5, f = o;
5901
+ o = v > 0 ? -0.5 : 0.5, f = o;
5902
5902
  break;
5903
5903
  default:
5904
5904
  n = 0.5, h = n, o = -0.5, f = o;
@@ -5911,15 +5911,15 @@ const ui = (s) => s * Math.PI / 180, Oe = (s, t, e) => {
5911
5911
  h = u >= 0 ? 0.5 : -0.5;
5912
5912
  break;
5913
5913
  case g.Left:
5914
- f = y > 0 ? 0.5 : -0.5;
5914
+ f = v > 0 ? 0.5 : -0.5;
5915
5915
  break;
5916
5916
  case g.Right:
5917
- f = y > 0 ? 0.5 : -0.5;
5917
+ f = v > 0 ? 0.5 : -0.5;
5918
5918
  break;
5919
5919
  default:
5920
5920
  h = 0.5, f = -0.5;
5921
5921
  }
5922
- Math.abs(u) >= Math.abs(y) ? (d = u > 0 ? -0.5 : 0.5, c = y > 0 ? 0.5 : -0.5) : (d = u > 0 ? 0.5 : -0.5, c = y > 0 ? -0.5 : 0.5);
5922
+ Math.abs(u) >= Math.abs(v) ? (d = u > 0 ? -0.5 : 0.5, c = v > 0 ? 0.5 : -0.5) : (d = u > 0 ? 0.5 : -0.5, c = v > 0 ? -0.5 : 0.5);
5923
5923
  }
5924
5924
  e.select("g.diagram-connection-start-label text").attr("x", 0).attr("y", r.fontSize / 3).attr("text-anchor", "middle").attr("font-family", r.fontFamily).attr("font-size", r.fontSize).attr(
5925
5925
  "fill",
@@ -5927,36 +5927,36 @@ const ui = (s) => s * Math.PI / 180, Oe = (s, t, e) => {
5927
5927
  ).style("font-kerning", "none").text(t.startLabel);
5928
5928
  const b = e.select("g.diagram-connection-start-label text").node()?.getBoundingClientRect();
5929
5929
  if (b) {
5930
- const u = t.startLabel ? b.width / this.zoomTransform.k + Ot(r) + Ht(r) : 0, y = t.startLabel ? b.height / this.zoomTransform.k + _t(r) + Vt(r) : 0;
5931
- let k;
5930
+ const u = t.startLabel ? b.width / this.zoomTransform.k + Ot(r) + Ht(r) : 0, v = t.startLabel ? b.height / this.zoomTransform.k + _t(r) + Vt(r) : 0;
5931
+ let w;
5932
5932
  switch (t.startDirection) {
5933
5933
  case g.Left:
5934
- k = l.getPointAtLength(
5935
- ot(r) + u / 2
5934
+ w = l.getPointAtLength(
5935
+ it(r) + u / 2
5936
5936
  );
5937
5937
  break;
5938
5938
  case g.Right:
5939
- k = l.getPointAtLength(
5939
+ w = l.getPointAtLength(
5940
5940
  Y(r) + u / 2
5941
5941
  );
5942
5942
  break;
5943
5943
  case g.Top:
5944
- k = l.getPointAtLength(
5945
- K(r) + u / 2
5944
+ w = l.getPointAtLength(
5945
+ q(r) + u / 2
5946
5946
  );
5947
5947
  break;
5948
5948
  case g.Bottom:
5949
- k = l.getPointAtLength(
5949
+ w = l.getPointAtLength(
5950
5950
  U(r) + u / 2
5951
5951
  );
5952
5952
  break;
5953
5953
  default:
5954
- k = l.getPointAtLength(
5954
+ w = l.getPointAtLength(
5955
5955
  Math.max(
5956
5956
  Y(r) + u / 2,
5957
- ot(r) + u / 2,
5958
- U(r) + y / 2,
5959
- K(r) + y / 2
5957
+ it(r) + u / 2,
5958
+ U(r) + v / 2,
5959
+ q(r) + v / 2
5960
5960
  )
5961
5961
  );
5962
5962
  }
@@ -5964,13 +5964,13 @@ const ui = (s) => s * Math.PI / 180, Oe = (s, t, e) => {
5964
5964
  "d",
5965
5965
  qt(
5966
5966
  -u / 2,
5967
- -y / 2,
5967
+ -v / 2,
5968
5968
  u,
5969
- y
5969
+ v
5970
5970
  )
5971
5971
  ).attr("fill", r.backgroundColor).attr("stroke", "none"), e.select("g.diagram-connection-start-label").attr(
5972
5972
  "transform",
5973
- `translate(${k.x + n * u},${k.y + o * y})`
5973
+ `translate(${w.x + n * u},${w.y + o * v})`
5974
5974
  );
5975
5975
  }
5976
5976
  e.select("g.diagram-connection-middle-label text").attr("x", 0).attr("y", r.fontSize / 3).attr("text-anchor", "middle").attr("font-family", r.fontFamily).attr("font-size", r.fontSize).attr(
@@ -5979,18 +5979,18 @@ const ui = (s) => s * Math.PI / 180, Oe = (s, t, e) => {
5979
5979
  ).style("font-kerning", "none").text(t.middleLabel);
5980
5980
  const m = e.select("g.diagram-connection-middle-label text").node()?.getBoundingClientRect();
5981
5981
  if (m) {
5982
- const u = t.middleLabel ? m.width / this.zoomTransform.k + Ot(r) + Ht(r) : 0, y = t.middleLabel ? m.height / this.zoomTransform.k + _t(r) + Vt(r) : 0, k = l.getPointAtLength(i / 2);
5982
+ const u = t.middleLabel ? m.width / this.zoomTransform.k + Ot(r) + Ht(r) : 0, v = t.middleLabel ? m.height / this.zoomTransform.k + _t(r) + Vt(r) : 0, w = l.getPointAtLength(i / 2);
5983
5983
  e.select("g.diagram-connection-middle-label path").attr(
5984
5984
  "d",
5985
5985
  qt(
5986
5986
  -u / 2,
5987
- -y / 2,
5987
+ -v / 2,
5988
5988
  u,
5989
- y
5989
+ v
5990
5990
  )
5991
5991
  ).attr("fill", r.backgroundColor).attr("stroke", "none"), e.select("g.diagram-connection-middle-label").attr(
5992
5992
  "transform",
5993
- `translate(${k.x + d * u},${k.y + c * y})`
5993
+ `translate(${w.x + d * u},${w.y + c * v})`
5994
5994
  );
5995
5995
  }
5996
5996
  e.select("g.diagram-connection-end-label text").attr("x", 0).attr("y", r.fontSize / 3).attr("text-anchor", "middle").attr("font-family", r.fontFamily).attr("font-size", r.fontSize).attr(
@@ -5999,36 +5999,36 @@ const ui = (s) => s * Math.PI / 180, Oe = (s, t, e) => {
5999
5999
  ).style("font-kerning", "none").text(t.endLabel);
6000
6000
  const p = e.select("g.diagram-connection-end-label text").node()?.getBoundingClientRect();
6001
6001
  if (p) {
6002
- const u = t.endLabel ? p.width / this.zoomTransform.k + Ot(r) + Ht(r) : 0, y = t.endLabel ? p.height / this.zoomTransform.k + _t(r) + Vt(r) : 0;
6003
- let k;
6002
+ const u = t.endLabel ? p.width / this.zoomTransform.k + Ot(r) + Ht(r) : 0, v = t.endLabel ? p.height / this.zoomTransform.k + _t(r) + Vt(r) : 0;
6003
+ let w;
6004
6004
  switch (t.endDirection) {
6005
6005
  case g.Left:
6006
- k = l.getPointAtLength(
6007
- i - (ot(r) + u / 2)
6006
+ w = l.getPointAtLength(
6007
+ i - (it(r) + u / 2)
6008
6008
  );
6009
6009
  break;
6010
6010
  case g.Right:
6011
- k = l.getPointAtLength(
6011
+ w = l.getPointAtLength(
6012
6012
  i - (Y(r) + u / 2)
6013
6013
  );
6014
6014
  break;
6015
6015
  case g.Top:
6016
- k = l.getPointAtLength(
6017
- i - (K(r) + u / 2)
6016
+ w = l.getPointAtLength(
6017
+ i - (q(r) + u / 2)
6018
6018
  );
6019
6019
  break;
6020
6020
  case g.Bottom:
6021
- k = l.getPointAtLength(
6021
+ w = l.getPointAtLength(
6022
6022
  i - (U(r) + u / 2)
6023
6023
  );
6024
6024
  break;
6025
6025
  default:
6026
- k = l.getPointAtLength(
6026
+ w = l.getPointAtLength(
6027
6027
  i - Math.max(
6028
6028
  Y(r) + u / 2,
6029
- ot(r) + u / 2,
6030
- U(r) + y / 2,
6031
- K(r) + y / 2
6029
+ it(r) + u / 2,
6030
+ U(r) + v / 2,
6031
+ q(r) + v / 2
6032
6032
  )
6033
6033
  );
6034
6034
  }
@@ -6036,20 +6036,20 @@ const ui = (s) => s * Math.PI / 180, Oe = (s, t, e) => {
6036
6036
  "d",
6037
6037
  qt(
6038
6038
  -u / 2,
6039
- -y / 2,
6039
+ -v / 2,
6040
6040
  u,
6041
- y
6041
+ v
6042
6042
  )
6043
6043
  ).attr("fill", r.backgroundColor).attr("stroke", "none"), e.select("g.diagram-connection-end-label").attr(
6044
6044
  "transform",
6045
- `translate(${k.x + h * u},${k.y + f * y})`
6045
+ `translate(${w.x + h * u},${w.y + f * v})`
6046
6046
  );
6047
6047
  }
6048
6048
  }
6049
6049
  }
6050
6050
  updateConnectionMarkersInView(t) {
6051
6051
  const e = this.selectCanvasView().select(
6052
- `[id='${pe(t.id)}']`
6052
+ `[id='${me(t.id)}']`
6053
6053
  ), a = e.select("marker.diagram-connection-start-marker"), l = e.select("marker.diagram-connection-end-marker");
6054
6054
  t.startMarkerLook !== null ? a.attr("orient", "auto-start-reverse").attr("markerWidth", t.startMarkerLook.width).attr("markerHeight", t.startMarkerLook.height).attr("refX", t.startMarkerLook.refX).attr("refY", t.startMarkerLook.refY).select("image").attr("href", t.startMarkerLook.image).attr("width", t.startMarkerLook.width).attr("height", t.startMarkerLook.height) : a.attr("orient", "auto-start-reverse").attr("markerWidth", 0).attr("markerHeight", 0), t.endMarkerLook !== null ? l.attr("orient", "auto-start-reverse").attr("markerWidth", t.endMarkerLook.width).attr("markerHeight", t.endMarkerLook.height).attr("refX", t.endMarkerLook.refX).attr("refY", t.endMarkerLook.refY).select("image").attr("href", t.endMarkerLook.image).attr("width", t.endMarkerLook.width).attr("height", t.endMarkerLook.height) : l.attr("orient", "auto-start-reverse").attr("markerWidth", 0).attr("markerHeight", 0);
6055
6055
  }
@@ -6058,7 +6058,7 @@ const ui = (s) => s * Math.PI / 180, Oe = (s, t, e) => {
6058
6058
  if (!e)
6059
6059
  return !1;
6060
6060
  if (e.rootElement instanceof z || e.rootElement instanceof F) {
6061
- const a = this.minimumSizeOfField(e), l = a[0] + Y(e.rootElement.type?.label) + ot(e.rootElement.type?.label) - e.rootElement.width, r = a[1] + U(e.rootElement.type?.label) + K(e.rootElement.type?.label) - e.rootElement.height;
6061
+ const a = this.minimumSizeOfField(e), l = a[0] + Y(e.rootElement.type?.label) + it(e.rootElement.type?.label) - e.rootElement.width, r = a[1] + U(e.rootElement.type?.label) + q(e.rootElement.type?.label) - e.rootElement.height;
6062
6062
  return l <= 0 && r <= 0;
6063
6063
  }
6064
6064
  return !0;
@@ -6068,7 +6068,7 @@ const ui = (s) => s * Math.PI / 180, Oe = (s, t, e) => {
6068
6068
  if (a) {
6069
6069
  if (a.rootElement instanceof z) {
6070
6070
  const l = this.minimumSizeOfField(a);
6071
- let r = l[0] + Y(a.rootElement.type.label) + ot(a.rootElement.type.label) - a.rootElement.width, i = l[1] + U(a.rootElement.type.label) + K(a.rootElement.type.label) - a.rootElement.height;
6071
+ let r = l[0] + Y(a.rootElement.type.label) + it(a.rootElement.type.label) - a.rootElement.width, i = l[1] + U(a.rootElement.type.label) + q(a.rootElement.type.label) - a.rootElement.height;
6072
6072
  this.snapToGrid && (r = Math.ceil(r / this.gridSize) * this.gridSize, i = Math.ceil(i / this.gridSize) * this.gridSize), a.rootElement.width + r < a.rootElement.type.minWidth && (r = a.rootElement.type.minWidth - a.rootElement.width), a.rootElement.height + i < a.rootElement.type.minHeight && (i = a.rootElement.type.minHeight - a.rootElement.height), (e !== !1 || r > 0) && a.rootElement.stretch(g.Right, r), (e !== !1 || i > 0) && a.rootElement.stretch(g.Bottom, i);
6073
6073
  }
6074
6074
  if (a.rootElement instanceof F) {
@@ -6084,7 +6084,7 @@ const ui = (s) => s * Math.PI / 180, Oe = (s, t, e) => {
6084
6084
  )));
6085
6085
  l[0] < r && (l[0] = r), l[1] < i && (l[1] = i);
6086
6086
  const n = a.rootElement.type;
6087
- let o = l[0] + Y(n?.label) + ot(n?.label) - a.rootElement.width, d = l[1] + U(n?.label) + K(n?.label) - a.rootElement.height;
6087
+ let o = l[0] + Y(n?.label) + it(n?.label) - a.rootElement.width, d = l[1] + U(n?.label) + q(n?.label) - a.rootElement.height;
6088
6088
  this.snapToGrid && (o = Math.ceil(o / this.gridSize) * this.gridSize, d = Math.ceil(d / this.gridSize) * this.gridSize), a.rootElement.width + o < (a.rootElement.getMinWidth() || 0) && (o = (a.rootElement.getMinWidth() || 0) - a.rootElement.width), a.rootElement.height + d < (a.rootElement.getMinHeight() || 0) && (d = (a.rootElement.getMinHeight() || 0) - a.rootElement.height), (e || o > 0) && a.rootElement.node?.stretchSections(
6089
6089
  g.Right,
6090
6090
  o,
@@ -6118,10 +6118,10 @@ const ui = (s) => s * Math.PI / 180, Oe = (s, t, e) => {
6118
6118
  }
6119
6119
  }
6120
6120
  selectRoot() {
6121
- return x.select(this.diagramRoot);
6121
+ return L.select(this.diagramRoot);
6122
6122
  }
6123
6123
  selectSVGElement() {
6124
- return x.select(this.diagramRoot).select("svg");
6124
+ return L.select(this.diagramRoot).select("svg");
6125
6125
  }
6126
6126
  selectCanvasView() {
6127
6127
  return this.selectSVGElement().select(".daga-canvas-view");
@@ -6142,8 +6142,8 @@ const ui = (s) => s * Math.PI / 180, Oe = (s, t, e) => {
6142
6142
  this.connectionType,
6143
6143
  t,
6144
6144
  void 0,
6145
- fe
6146
- );
6145
+ ue
6146
+ ), this.unfinishedConnectionPort = t;
6147
6147
  else if (this.inferConnectionType) {
6148
6148
  let e = this.model.connections.types.all().find(
6149
6149
  (a) => t.allowsOutgoing && a.canStartFromType(t.getNode()?.type?.id || "")
@@ -6155,8 +6155,8 @@ const ui = (s) => s * Math.PI / 180, Oe = (s, t, e) => {
6155
6155
  e,
6156
6156
  t,
6157
6157
  void 0,
6158
- fe
6159
- ));
6158
+ ue
6159
+ ), this.unfinishedConnectionPort = t);
6160
6160
  }
6161
6161
  }
6162
6162
  }
@@ -6181,7 +6181,7 @@ const ui = (s) => s * Math.PI / 180, Oe = (s, t, e) => {
6181
6181
  ) && this.unfinishedConnection?.start?.allowsOutgoing && this.unfinishedConnection.type.canFinishOnType(
6182
6182
  t.getNode()?.type?.id || ""
6183
6183
  ) && t.allowsIncoming) {
6184
- const e = new de(
6184
+ const e = new ce(
6185
6185
  this,
6186
6186
  this.unfinishedConnection.type,
6187
6187
  this.unfinishedConnection.start?.id,
@@ -6193,7 +6193,7 @@ const ui = (s) => s * Math.PI / 180, Oe = (s, t, e) => {
6193
6193
  ) && this.unfinishedConnection?.start?.allowsIncoming && this.unfinishedConnection.type.canStartFromType(
6194
6194
  t.getNode()?.type?.id || ""
6195
6195
  ) && t.allowsOutgoing) {
6196
- const e = new de(
6196
+ const e = new ce(
6197
6197
  this,
6198
6198
  this.unfinishedConnection.type,
6199
6199
  t.id,
@@ -6211,7 +6211,7 @@ const ui = (s) => s * Math.PI / 180, Oe = (s, t, e) => {
6211
6211
  this.unfinishedConnection?.start?.getNode()?.type?.id || ""
6212
6212
  ) && this.unfinishedConnection?.start?.allowsIncoming && l.canStartFromType(t.getNode()?.type?.id || "") && t.allowsOutgoing
6213
6213
  ), a = !0), e !== void 0) {
6214
- const l = new de(
6214
+ const l = new ce(
6215
6215
  this,
6216
6216
  e,
6217
6217
  a ? t.id : this.unfinishedConnection.start?.id,
@@ -6225,7 +6225,7 @@ const ui = (s) => s * Math.PI / 180, Oe = (s, t, e) => {
6225
6225
  }
6226
6226
  }
6227
6227
  dropConnection() {
6228
- this.unfinishedConnection?.setStart(void 0), this.unfinishedConnection?.setEnd(void 0), this.unfinishedConnection?.select()?.remove(), this.unfinishedConnection = void 0;
6228
+ this.unfinishedConnection?.setStart(void 0), this.unfinishedConnection?.setEnd(void 0), this.unfinishedConnection?.select()?.remove(), this.unfinishedConnection = void 0, this.unfinishedConnectionPort = void 0;
6229
6229
  }
6230
6230
  cancelAllUserActions() {
6231
6231
  this.currentAction = void 0, this.dropConnection(), this.removeInputField(), this.contextMenu.close(), this.userSelection.clear();
@@ -6233,6 +6233,23 @@ const ui = (s) => s * Math.PI / 180, Oe = (s, t, e) => {
6233
6233
  canUserPerformAction(t) {
6234
6234
  return this.userActions[t] !== !1;
6235
6235
  }
6236
+ openTextInput(t) {
6237
+ const e = this.model.fields.get(t);
6238
+ e && this.createInputField(
6239
+ e.text,
6240
+ e.coords,
6241
+ e.width,
6242
+ e.height,
6243
+ e.fontSize,
6244
+ e.fontFamily || V.fontFamily,
6245
+ e.orientation,
6246
+ () => {
6247
+ },
6248
+ (a) => {
6249
+ e.text = a, this.currentAction instanceof Re && (this.currentAction.to = a, this.currentAction.do(), this.actionStack.add(this.currentAction), this.currentAction = void 0);
6250
+ }
6251
+ );
6252
+ }
6236
6253
  createInputField(t, e, a, l, r, i, n, o, d) {
6237
6254
  this.removeInputField();
6238
6255
  const c = this.selectCanvasElements().append("foreignObject").attr("x", `${e[0]}px`).attr("y", `${e[1]}px`).attr("width", `${a}px`).attr("height", `${l}px`).style("box-sizing", "border-box").style("border", "1px solid");
@@ -6242,15 +6259,15 @@ const ui = (s) => s * Math.PI / 180, Oe = (s, t, e) => {
6242
6259
  h.text(t).style("box-sizing", "border-box").style("width", `${a}px`).style("height", `${l}px`).style("font-size", `${r}px`).style("font-family", i).style("resize", "none").style("outline", 0).style("border", 0).style("margin", 0).style("padding", 0).on($.KeyDown, (p) => {
6243
6260
  p.stopPropagation();
6244
6261
  }).on($.KeyUp, (p) => {
6245
- if (p.stopPropagation(), p.key === Z.Escape) {
6262
+ if (p.stopPropagation(), p.key === K.Escape) {
6246
6263
  const u = h.property("value");
6247
6264
  this.removeInputField(), d && d(u);
6248
6265
  }
6249
6266
  }).on($.Input, () => {
6250
6267
  const p = h.property("value");
6251
6268
  h.attr("cols", Io(p) + 1), h.attr("rows", xo(p) + 1), h.style("width", ""), h.style("height", ""), f = h.property("scrollWidth") + 1, b = h.property("scrollHeight") + 1;
6252
- const u = Math.max(f, a), y = Math.max(b, l);
6253
- c?.attr("width", `${u}px`), h.style("width", `${u}px`), c?.attr("height", `${y}px`), h.style("height", `${y}px`), o && o(p);
6269
+ const u = Math.max(f, a), v = Math.max(b, l);
6270
+ c?.attr("width", `${u}px`), h.style("width", `${u}px`), c?.attr("height", `${v}px`), h.style("height", `${v}px`), o && o(p);
6254
6271
  }).on($.Click, (p) => {
6255
6272
  p.stopPropagation();
6256
6273
  }).on($.FocusOut, () => {
@@ -6277,9 +6294,9 @@ const ui = (s) => s * Math.PI / 180, Oe = (s, t, e) => {
6277
6294
  * Method to call to start the moving of a node triggered by a user drag event.
6278
6295
  */
6279
6296
  startMovingNode(t, e) {
6280
- if (this.canUserPerformAction(w.MoveNode) && !e.removed)
6281
- if (S(L.Grabbing), this.draggingFrom = [t.x, t.y], e.selected && this.userSelection.count((a) => a instanceof z) > 1)
6282
- this.currentAction = new le(
6297
+ if (this.canUserPerformAction(k.MoveNode) && !e.removed)
6298
+ if (S(E.Grabbing), this.draggingFrom = [t.x, t.y], e.selected && this.userSelection.count((a) => a instanceof z) > 1)
6299
+ this.currentAction = new de(
6283
6300
  this,
6284
6301
  this.userSelection.filter((a) => a instanceof z).map((a) => a.id),
6285
6302
  e.coords
@@ -6288,7 +6305,7 @@ const ui = (s) => s * Math.PI / 180, Oe = (s, t, e) => {
6288
6305
  const a = e.getLastAncestor();
6289
6306
  this.currentAction = new X(
6290
6307
  this,
6291
- w.MoveNode,
6308
+ k.MoveNode,
6292
6309
  e.id,
6293
6310
  e.getGeometry(),
6294
6311
  e.getGeometry(),
@@ -6298,13 +6315,13 @@ const ui = (s) => s * Math.PI / 180, Oe = (s, t, e) => {
6298
6315
  );
6299
6316
  }
6300
6317
  else
6301
- S(L.NotAllowed);
6318
+ S(E.NotAllowed);
6302
6319
  }
6303
6320
  /**
6304
6321
  * Method to call to continue the moving of a node triggered by a user drag event.
6305
6322
  */
6306
6323
  continueMovingNode(t, e) {
6307
- if (this.canUserPerformAction(w.MoveNode) && (this.currentAction instanceof le || this.currentAction instanceof X) && !e.removed) {
6324
+ if (this.canUserPerformAction(k.MoveNode) && (this.currentAction instanceof de || this.currentAction instanceof X) && !e.removed) {
6308
6325
  const a = [
6309
6326
  t.x - e.width / 2,
6310
6327
  t.y - e.height / 2
@@ -6319,7 +6336,7 @@ const ui = (s) => s * Math.PI / 180, Oe = (s, t, e) => {
6319
6336
  * Method to call to finish the moving of a node triggered by a user drag event.
6320
6337
  */
6321
6338
  finishMovingNode(t, e) {
6322
- if (this.canUserPerformAction(w.MoveNode) && !e.removed && (this.draggingFrom[0] !== t.x || this.draggingFrom[1] !== t.y)) {
6339
+ if (this.canUserPerformAction(k.MoveNode) && !e.removed && (this.draggingFrom[0] !== t.x || this.draggingFrom[1] !== t.y)) {
6323
6340
  let a = [
6324
6341
  t.x - e.width / 2,
6325
6342
  t.y - e.height / 2
@@ -6327,7 +6344,7 @@ const ui = (s) => s * Math.PI / 180, Oe = (s, t, e) => {
6327
6344
  if (this.snapToGrid && (a = this.getClosestGridPoint([
6328
6345
  a[0] - e.type.snapToGridOffset[0],
6329
6346
  a[1] - e.type.snapToGridOffset[1]
6330
- ]), a[0] += e.type.snapToGridOffset[0], a[1] += e.type.snapToGridOffset[1]), this.currentAction instanceof le) {
6347
+ ]), a[0] += e.type.snapToGridOffset[0], a[1] += e.type.snapToGridOffset[1]), this.currentAction instanceof de) {
6331
6348
  const l = this.currentAction.delta;
6332
6349
  this.currentAction.delta = [
6333
6350
  a[0] - l[0],
@@ -6372,7 +6389,7 @@ const ui = (s) => s * Math.PI / 180, Oe = (s, t, e) => {
6372
6389
  }
6373
6390
  continueMultipleSelection(t) {
6374
6391
  const e = this.getPointerLocationRelativeToCanvas(t);
6375
- (this.draggingFrom[0] !== e[0] || this.draggingFrom[1] !== e[1]) && (S(L.Crosshair), this.multipleSelectionContainer?.attr(
6392
+ (this.draggingFrom[0] !== e[0] || this.draggingFrom[1] !== e[1]) && (S(E.Crosshair), this.multipleSelectionContainer?.attr(
6376
6393
  "x",
6377
6394
  Math.min(this.draggingFrom[0], e[0]) * this.zoomTransform.k + this.zoomTransform.x
6378
6395
  )?.attr(
@@ -6403,7 +6420,7 @@ const ui = (s) => s * Math.PI / 180, Oe = (s, t, e) => {
6403
6420
  }
6404
6421
  };
6405
6422
  te.canvasCount = 0;
6406
- let we = te;
6423
+ let Se = te;
6407
6424
  class io {
6408
6425
  constructor() {
6409
6426
  this.grid = [[void 0]], this.offsetX = 0, this.offsetY = 0;
@@ -6656,16 +6673,16 @@ class ki {
6656
6673
  ], u = [
6657
6674
  m.coords[0] + m.width / 2,
6658
6675
  m.coords[1] + m.height / 2
6659
- ], y = Ue(
6676
+ ], v = Ue(
6660
6677
  f.coords,
6661
6678
  m.coords
6662
- ), k = [m.coords[0], m.coords[1]];
6663
- if (b.includes(m) && y > 0 && (y > e + (Math.max(f.width, f.height) + Math.max(m.width, m.height)) / 2 ? (k[0] = k[0] - (u[0] - p[0]) * r, k[1] = k[1] - (u[1] - p[1]) * r) : (k[0] = k[0] + (u[0] - p[0]) * n, k[1] = k[1] + (u[1] - p[1]) * n)), y > 0) {
6664
- const N = i / (y * y);
6665
- k[0] = k[0] + N * (u[0] - p[0]) / y, k[1] = k[1] + N * (u[1] - p[1]) / y;
6679
+ ), w = [m.coords[0], m.coords[1]];
6680
+ if (b.includes(m) && v > 0 && (v > e + (Math.max(f.width, f.height) + Math.max(m.width, m.height)) / 2 ? (w[0] = w[0] - (u[0] - p[0]) * r, w[1] = w[1] - (u[1] - p[1]) * r) : (w[0] = w[0] + (u[0] - p[0]) * n, w[1] = w[1] + (u[1] - p[1]) * n)), v > 0) {
6681
+ const I = i / (v * v);
6682
+ w[0] = w[0] + I * (u[0] - p[0]) / v, w[1] = w[1] + I * (u[1] - p[1]) / v;
6666
6683
  } else
6667
- k[0] = k[0] + o * (Math.random() * 2 - 1), k[1] = k[1] + o * (Math.random() * 2 - 1);
6668
- k[0] = k[0] - (u[0] - h[0]) * d, k[1] = k[1] - (u[1] - h[1]) * d, k[0] - m.coords[0] > c ? k[0] = m.coords[0] + c : k[0] - m.coords[0] < -c && (k[0] = m.coords[0] - c), k[1] - m.coords[1] > c ? k[1] = m.coords[1] + c : k[1] - m.coords[1] < -c && (k[1] = m.coords[1] - c), m.move(k);
6684
+ w[0] = w[0] + o * (Math.random() * 2 - 1), w[1] = w[1] + o * (Math.random() * 2 - 1);
6685
+ w[0] = w[0] - (u[0] - h[0]) * d, w[1] = w[1] - (u[1] - h[1]) * d, w[0] - m.coords[0] > c ? w[0] = m.coords[0] + c : w[0] - m.coords[0] < -c && (w[0] = m.coords[0] - c), w[1] - m.coords[1] > c ? w[1] = m.coords[1] + c : w[1] - m.coords[1] < -c && (w[1] = m.coords[1] - c), m.move(w);
6669
6686
  }
6670
6687
  }
6671
6688
  }
@@ -6743,8 +6760,8 @@ class Si {
6743
6760
  break;
6744
6761
  } else {
6745
6762
  const u = m.getAdjacentNodes();
6746
- for (const y of u)
6747
- f.includes(y) || (h.push(y), f.push(y));
6763
+ for (const v of u)
6764
+ f.includes(v) || (h.push(v), f.push(v));
6748
6765
  }
6749
6766
  }
6750
6767
  b || i[i.length - 1].push(c);
@@ -6782,7 +6799,7 @@ class Ci {
6782
6799
  for (; r.length > 0; ) {
6783
6800
  const c = r[0];
6784
6801
  r.splice(0, 1);
6785
- const h = new Ae(void 0, c);
6802
+ const h = new Ie(void 0, c);
6786
6803
  no(h, r), i.push(h);
6787
6804
  }
6788
6805
  const n = [];
@@ -6823,12 +6840,12 @@ const no = (s, t) => {
6823
6840
  t[e].push(a), ro(a, t, e + 1);
6824
6841
  }
6825
6842
  };
6826
- class Ae {
6843
+ class Ie {
6827
6844
  constructor(t, e) {
6828
6845
  this.parent = t, this.branches = [], this.depth = 0, this.node = e;
6829
6846
  }
6830
6847
  addBranch(t) {
6831
- const e = new Ae(this, t);
6848
+ const e = new Ie(this, t);
6832
6849
  return e.depth = this.depth + 1, this.branches.push(e), e;
6833
6850
  }
6834
6851
  countBranchHeight() {
@@ -6886,7 +6903,7 @@ class Ii {
6886
6903
  highlightProperty(...t) {
6887
6904
  }
6888
6905
  }
6889
- const Ie = ({
6906
+ const xe = ({
6890
6907
  direction: s,
6891
6908
  collapsableSelector: t,
6892
6909
  collapsableAdditionalSelector: e,
@@ -6903,11 +6920,11 @@ const Ie = ({
6903
6920
  c(b), o?.(b);
6904
6921
  let m;
6905
6922
  if (typeof t == "string")
6906
- m = x.select(t), e && (m = m.select(e));
6923
+ m = L.select(t), e && (m = m.select(e));
6907
6924
  else {
6908
6925
  const p = t;
6909
6926
  if (!p) throw new Error("collapsableSelector is not a valid ref");
6910
- m = x.select(p.current), e && (m = m.select(e));
6927
+ m = L.select(p.current), e && (m = m.select(e));
6911
6928
  }
6912
6929
  m.style(r, b ? i : n);
6913
6930
  }
@@ -6923,12 +6940,12 @@ const Ie = ({
6923
6940
  return l ? "daga-vertical-none" : d ? "daga-vertical-up" : "daga-vertical-down";
6924
6941
  }
6925
6942
  };
6926
- return /* @__PURE__ */ v("daga-collapse-button", { children: /* @__PURE__ */ v(
6943
+ return /* @__PURE__ */ y("daga-collapse-button", { children: /* @__PURE__ */ y(
6927
6944
  "button",
6928
6945
  {
6929
6946
  className: `daga-collapse-button daga-${s}`,
6930
6947
  onClick: h,
6931
- children: /* @__PURE__ */ v("div", { className: f() })
6948
+ children: /* @__PURE__ */ y("div", { className: f() })
6932
6949
  }
6933
6950
  ) });
6934
6951
  }, xi = () => {
@@ -6958,15 +6975,15 @@ const Ie = ({
6958
6975
  ...i.propertyNames
6959
6976
  ));
6960
6977
  };
6961
- return /* @__PURE__ */ v("daga-errors", { children: /* @__PURE__ */ T("div", { ref: t, className: "daga-errors", children: [
6962
- e.length === 0 && /* @__PURE__ */ v("div", { className: "daga-errors-summary daga-no-errors daga-prevent-user-select", children: /* @__PURE__ */ v("span", { children: "No errors found" }) }),
6963
- e.length > 0 && /* @__PURE__ */ T("div", { className: "daga-errors-summary daga-with-errors daga-prevent-user-select", children: [
6964
- /* @__PURE__ */ T("span", { children: [
6978
+ return /* @__PURE__ */ y("daga-errors", { children: /* @__PURE__ */ M("div", { ref: t, className: "daga-errors", children: [
6979
+ e.length === 0 && /* @__PURE__ */ y("div", { className: "daga-errors-summary daga-no-errors daga-prevent-user-select", children: /* @__PURE__ */ y("span", { children: "No errors found" }) }),
6980
+ e.length > 0 && /* @__PURE__ */ M("div", { className: "daga-errors-summary daga-with-errors daga-prevent-user-select", children: [
6981
+ /* @__PURE__ */ M("span", { children: [
6965
6982
  e.length,
6966
6983
  " errors found"
6967
6984
  ] }),
6968
- /* @__PURE__ */ v("div", { className: "daga-collapse-button-container", children: /* @__PURE__ */ v(
6969
- Ie,
6985
+ /* @__PURE__ */ y("div", { className: "daga-collapse-button-container", children: /* @__PURE__ */ y(
6986
+ xe,
6970
6987
  {
6971
6988
  collapsableSelector: t,
6972
6989
  collapsableAdditionalSelector: ".daga-error-panel",
@@ -6979,7 +6996,7 @@ const Ie = ({
6979
6996
  }
6980
6997
  ) })
6981
6998
  ] }),
6982
- e.length > 0 && /* @__PURE__ */ v("div", { className: "daga-error-panel", children: /* @__PURE__ */ v("ol", { children: e.map((i, n) => /* @__PURE__ */ v(
6999
+ e.length > 0 && /* @__PURE__ */ y("div", { className: "daga-error-panel", children: /* @__PURE__ */ y("ol", { children: e.map((i, n) => /* @__PURE__ */ y(
6983
7000
  "li",
6984
7001
  {
6985
7002
  onClick: () => r(i),
@@ -6996,113 +7013,113 @@ const Ie = ({
6996
7013
  }) => {
6997
7014
  const l = rt(null), [r, i] = D("");
6998
7015
  let n;
6999
- const [o, d] = D([]), [c, h] = D([]), [f, b] = D([]), [m, p] = D([]), [u, y] = D(!1);
7000
- Ct(() => {
7001
- i(t.find((I) => St(I.key, e))?.label || "");
7016
+ const [o, d] = D([]), [c, h] = D([]), [f, b] = D([]), [m, p] = D([]), [u, v] = D(!1);
7017
+ St(() => {
7018
+ i(t.find((x) => wt(x.key, e))?.label || "");
7002
7019
  }, [e, t]);
7003
- const k = (I) => {
7020
+ const w = (x) => {
7004
7021
  if (!s)
7005
- switch (I.key) {
7006
- case Z.PageDown:
7007
- n === void 0 ? (P(0), E(0)) : (P(n + 5), E(n)), I.preventDefault();
7022
+ switch (x.key) {
7023
+ case K.PageDown:
7024
+ n === void 0 ? (P(0), T(0)) : (P(n + 5), T(n)), x.preventDefault();
7008
7025
  break;
7009
- case Z.ArrowDown:
7010
- n === void 0 ? (P(0), E(0)) : (P(n + 1), E(n)), I.preventDefault();
7026
+ case K.ArrowDown:
7027
+ n === void 0 ? (P(0), T(0)) : (P(n + 1), T(n)), x.preventDefault();
7011
7028
  break;
7012
- case Z.PageUp:
7013
- n === void 0 ? (P(t.length - 1), E(t.length - 1)) : (P(n - 5), E(n)), I.preventDefault();
7029
+ case K.PageUp:
7030
+ n === void 0 ? (P(t.length - 1), T(t.length - 1)) : (P(n - 5), T(n)), x.preventDefault();
7014
7031
  break;
7015
- case Z.ArrowUp:
7016
- n === void 0 ? (P(t.length - 1), E(t.length - 1)) : (P(n - 1), E(n)), I.preventDefault();
7032
+ case K.ArrowUp:
7033
+ n === void 0 ? (P(t.length - 1), T(t.length - 1)) : (P(n - 1), T(n)), x.preventDefault();
7017
7034
  break;
7018
- case Z.Escape:
7019
- R(), I.preventDefault();
7035
+ case K.Escape:
7036
+ R(), x.preventDefault();
7020
7037
  break;
7021
- case Z.Enter:
7022
- O(t[n || 0]), I.preventDefault();
7038
+ case K.Enter:
7039
+ O(t[n || 0]), x.preventDefault();
7023
7040
  break;
7024
7041
  default:
7025
- N();
7042
+ I();
7026
7043
  }
7027
- }, N = () => {
7044
+ }, I = () => {
7028
7045
  if (!s) {
7029
- const I = Ge(r.trim());
7046
+ const x = Ge(r.trim());
7030
7047
  d([]), h([]), b([]), p([]);
7031
7048
  for (const _ of t) {
7032
- const q = Ge(_.label).indexOf(I);
7033
- if (q >= 0) {
7034
- const Bt = _.label.substring(0, q), J = _.label.substring(
7035
- q,
7036
- q + I.length
7037
- ), wt = _.label.substring(
7038
- q + I.length
7049
+ const J = Ge(_.label).indexOf(x);
7050
+ if (J >= 0) {
7051
+ const Bt = _.label.substring(0, J), Pt = _.label.substring(
7052
+ J,
7053
+ J + x.length
7054
+ ), Z = _.label.substring(
7055
+ J + x.length
7039
7056
  );
7040
- d((nt) => [...nt, _]), h((nt) => [
7041
- ...nt,
7057
+ d((Q) => [...Q, _]), h((Q) => [
7058
+ ...Q,
7042
7059
  Bt
7043
- ]), b((nt) => [
7044
- ...nt,
7045
- J
7046
- ]), p((nt) => [
7047
- ...nt,
7048
- wt
7060
+ ]), b((Q) => [
7061
+ ...Q,
7062
+ Pt
7063
+ ]), p((Q) => [
7064
+ ...Q,
7065
+ Z
7049
7066
  ]);
7050
7067
  }
7051
7068
  }
7052
- y(!0);
7069
+ v(!0);
7053
7070
  }
7054
7071
  }, R = () => {
7055
- y(!1);
7056
- }, P = (I) => {
7072
+ v(!1);
7073
+ }, P = (x) => {
7057
7074
  if (!s) {
7058
- if (n = I, I === void 0)
7075
+ if (n = x, x === void 0)
7059
7076
  return;
7060
- I < 0 && (n = 0), I >= t.length && (n = t.length - 1);
7077
+ x < 0 && (n = 0), x >= t.length && (n = t.length - 1);
7061
7078
  }
7062
- }, tt = () => {
7079
+ }, et = () => {
7063
7080
  setTimeout(() => {
7064
7081
  R();
7065
7082
  }, Li);
7066
- }, E = (I) => {
7067
- const _ = l.current?.querySelectorAll("li")[I];
7083
+ }, T = (x) => {
7084
+ const _ = l.current?.querySelectorAll("li")[x];
7068
7085
  _ && _.scrollIntoView({ block: "center" });
7069
7086
  }, C = () => {
7070
- s || (i(""), y(!1), n = void 0);
7071
- }, O = (I) => {
7072
- s || (i(I.label), y(!1), n = void 0, a(I.key));
7087
+ s || (i(""), v(!1), n = void 0);
7088
+ }, O = (x) => {
7089
+ s || (i(x.label), v(!1), n = void 0, a(x.key));
7073
7090
  };
7074
- return /* @__PURE__ */ T(
7091
+ return /* @__PURE__ */ M(
7075
7092
  "div",
7076
7093
  {
7077
7094
  ref: l,
7078
7095
  className: `daga-autocomplete ${u ? "daga-showing-options" : ""}`,
7079
7096
  children: [
7080
- /* @__PURE__ */ T("div", { className: "daga-autocomplete-input", children: [
7081
- /* @__PURE__ */ v(
7097
+ /* @__PURE__ */ M("div", { className: "daga-autocomplete-input", children: [
7098
+ /* @__PURE__ */ y(
7082
7099
  "input",
7083
7100
  {
7084
7101
  value: r,
7085
7102
  disabled: s,
7086
- onKeyUp: k,
7087
- onFocus: N,
7088
- onBlur: tt,
7089
- onChange: (I) => i(I.target.value)
7103
+ onKeyUp: w,
7104
+ onFocus: I,
7105
+ onBlur: et,
7106
+ onChange: (x) => i(x.target.value)
7090
7107
  }
7091
7108
  ),
7092
- r !== "" && /* @__PURE__ */ v("button", { className: "daga-clear", onClick: C })
7109
+ r !== "" && /* @__PURE__ */ y("button", { className: "daga-clear", onClick: C })
7093
7110
  ] }),
7094
- /* @__PURE__ */ v("div", { className: "daga-autocomplete-options", children: /* @__PURE__ */ T("ul", { className: "daga-autocomplete-option-list", children: [
7095
- o.length === 0 && /* @__PURE__ */ v("li", { className: "daga-autocomplete-option no-options", children: "(No options)" }),
7096
- o.map((I, _) => /* @__PURE__ */ T(
7111
+ /* @__PURE__ */ y("div", { className: "daga-autocomplete-options", children: /* @__PURE__ */ M("ul", { className: "daga-autocomplete-option-list", children: [
7112
+ o.length === 0 && /* @__PURE__ */ y("li", { className: "daga-autocomplete-option no-options", children: "(No options)" }),
7113
+ o.map((x, _) => /* @__PURE__ */ M(
7097
7114
  "li",
7098
7115
  {
7099
7116
  className: `daga-autocomplete-option ${_ === n ? "daga-focused" : ""}`,
7100
7117
  onMouseMove: () => P(_),
7101
- onClick: () => O(I),
7118
+ onClick: () => O(x),
7102
7119
  children: [
7103
- /* @__PURE__ */ v("span", { children: c[_] }),
7104
- /* @__PURE__ */ v("span", { className: "daga-match", children: f[_] }),
7105
- /* @__PURE__ */ v("span", { children: m[_] })
7120
+ /* @__PURE__ */ y("span", { children: c[_] }),
7121
+ /* @__PURE__ */ y("span", { className: "daga-match", children: f[_] }),
7122
+ /* @__PURE__ */ y("span", { children: m[_] })
7106
7123
  ]
7107
7124
  },
7108
7125
  _
@@ -7119,17 +7136,17 @@ const Ie = ({
7119
7136
  onChange: l
7120
7137
  }) => {
7121
7138
  const [r, i] = D(), [n, o] = D([]), [d, c] = D([]);
7122
- Ct(() => {
7123
- const u = a.length === 0, y = a.map((k) => Ei(e, k));
7124
- o(y), u && l(a), p();
7139
+ St(() => {
7140
+ const u = a.length === 0, v = a.map((w) => Ei(e, w));
7141
+ o(v), u && l(a), p();
7125
7142
  }, [a, e]);
7126
7143
  const h = (u) => {
7127
- for (const y of a)
7128
- if (y === u)
7144
+ for (const v of a)
7145
+ if (v === u)
7129
7146
  return !0;
7130
7147
  return !1;
7131
7148
  }, f = (u) => {
7132
- a.length > u && (a.splice(u, 1), o(n.filter((y, k) => k !== u)), l(a), p());
7149
+ a.length > u && (a.splice(u, 1), o(n.filter((v, w) => w !== u)), l(a), p());
7133
7150
  }, b = () => {
7134
7151
  r !== void 0 && (t || !h(r)) && (l(a.concat(r)), m());
7135
7152
  }, m = () => {
@@ -7137,25 +7154,25 @@ const Ie = ({
7137
7154
  }, p = () => {
7138
7155
  if (!t) {
7139
7156
  const u = [];
7140
- for (const y of e)
7141
- h(y.key) || u.push(y);
7157
+ for (const v of e)
7158
+ h(v.key) || u.push(v);
7142
7159
  c(u);
7143
7160
  }
7144
7161
  };
7145
- return /* @__PURE__ */ T("div", { children: [
7146
- a.map((u, y) => /* @__PURE__ */ T("div", { className: "daga-value-item-element", children: [
7147
- /* @__PURE__ */ v("span", { className: "daga-input", children: n[y] }),
7148
- !s && /* @__PURE__ */ v(
7162
+ return /* @__PURE__ */ M("div", { children: [
7163
+ a.map((u, v) => /* @__PURE__ */ M("div", { className: "daga-value-item-element", children: [
7164
+ /* @__PURE__ */ y("span", { className: "daga-input", children: n[v] }),
7165
+ !s && /* @__PURE__ */ y(
7149
7166
  "button",
7150
7167
  {
7151
7168
  className: "daga-property-button",
7152
- onClick: () => f(y),
7153
- children: /* @__PURE__ */ v("div", { className: "daga-icon daga-close-icon" })
7169
+ onClick: () => f(v),
7170
+ children: /* @__PURE__ */ y("div", { className: "daga-icon daga-close-icon" })
7154
7171
  }
7155
7172
  )
7156
- ] }, y)),
7157
- !s && /* @__PURE__ */ T("div", { className: "daga-value-item-input", children: [
7158
- /* @__PURE__ */ v("div", { className: "daga-input daga-relatively-positioned", children: /* @__PURE__ */ v(
7173
+ ] }, v)),
7174
+ !s && /* @__PURE__ */ M("div", { className: "daga-value-item-input", children: [
7175
+ /* @__PURE__ */ y("div", { className: "daga-input daga-relatively-positioned", children: /* @__PURE__ */ y(
7159
7176
  ao,
7160
7177
  {
7161
7178
  disabled: s,
@@ -7164,7 +7181,7 @@ const Ie = ({
7164
7181
  onChange: i
7165
7182
  }
7166
7183
  ) }),
7167
- /* @__PURE__ */ v("button", { className: "daga-property-button", onClick: b, children: /* @__PURE__ */ v("div", { className: "daga-icon daga-add-icon" }) })
7184
+ /* @__PURE__ */ y("button", { className: "daga-property-button", onClick: b, children: /* @__PURE__ */ y("div", { className: "daga-icon daga-add-icon" }) })
7168
7185
  ] })
7169
7186
  ] });
7170
7187
  }, Mi = ({
@@ -7182,7 +7199,7 @@ const Ie = ({
7182
7199
  e.length > f && a(e.filter((b, m) => m !== f));
7183
7200
  }, o = (f, b, m) => {
7184
7201
  const p = e.map(
7185
- (u, y) => y === b ? m === "blur" ? f.trim() : f : u
7202
+ (u, v) => v === b ? m === "blur" ? f.trim() : f : u
7186
7203
  );
7187
7204
  a(p);
7188
7205
  }, d = () => {
@@ -7193,9 +7210,9 @@ const Ie = ({
7193
7210
  }, h = (f) => {
7194
7211
  f.key === "Enter" && d();
7195
7212
  };
7196
- return /* @__PURE__ */ T(ho, { children: [
7197
- e.map((f, b) => /* @__PURE__ */ T("div", { className: "daga-value-item-element", children: [
7198
- /* @__PURE__ */ v(
7213
+ return /* @__PURE__ */ M(ho, { children: [
7214
+ e.map((f, b) => /* @__PURE__ */ M("div", { className: "daga-value-item-element", children: [
7215
+ /* @__PURE__ */ y(
7199
7216
  "input",
7200
7217
  {
7201
7218
  className: "daga-input",
@@ -7205,18 +7222,18 @@ const Ie = ({
7205
7222
  onBlur: (m) => o(m.target.value, b, "blur")
7206
7223
  }
7207
7224
  ),
7208
- /* @__PURE__ */ v(
7225
+ /* @__PURE__ */ y(
7209
7226
  "button",
7210
7227
  {
7211
7228
  className: "daga-property-button",
7212
7229
  onClick: () => n(b),
7213
- children: /* @__PURE__ */ v("div", { className: "daga-icon daga-close-icon" })
7230
+ children: /* @__PURE__ */ y("div", { className: "daga-icon daga-close-icon" })
7214
7231
  }
7215
7232
  )
7216
7233
  ] }, b)),
7217
- !s && /* @__PURE__ */ T("div", { className: "daga-value-item-input", children: [
7218
- /* @__PURE__ */ T("div", { className: "daga-input daga-relatively-positioned", children: [
7219
- /* @__PURE__ */ v(
7234
+ !s && /* @__PURE__ */ M("div", { className: "daga-value-item-input", children: [
7235
+ /* @__PURE__ */ M("div", { className: "daga-input daga-relatively-positioned", children: [
7236
+ /* @__PURE__ */ y(
7220
7237
  "input",
7221
7238
  {
7222
7239
  type: "text",
@@ -7225,9 +7242,9 @@ const Ie = ({
7225
7242
  onChange: (f) => r(f.target.value)
7226
7243
  }
7227
7244
  ),
7228
- /* @__PURE__ */ v("button", { className: "daga-clear", onClick: c })
7245
+ /* @__PURE__ */ y("button", { className: "daga-clear", onClick: c })
7229
7246
  ] }),
7230
- /* @__PURE__ */ v("button", { className: "daga-property-button", onClick: d, children: /* @__PURE__ */ v("div", { className: "daga-icon daga-add-icon" }) })
7247
+ /* @__PURE__ */ y("button", { className: "daga-property-button", onClick: d, children: /* @__PURE__ */ y("div", { className: "daga-icon daga-add-icon" }) })
7231
7248
  ] })
7232
7249
  ] });
7233
7250
  }, Ni = ({
@@ -7236,42 +7253,42 @@ const Ie = ({
7236
7253
  onChange: e
7237
7254
  }) => {
7238
7255
  const [a, l] = D(""), [r, i] = D(""), [n, o] = D({}), d = (u) => {
7239
- const y = {};
7240
- Object.keys(t).forEach((k) => {
7241
- k !== u && (y[k] = t[k]);
7242
- }), e(y);
7243
- }, c = (u, y, k) => {
7244
- const N = k === "blur" ? y.trim() : y;
7245
- if (k === "blur") {
7246
- if (u !== N) {
7256
+ const v = {};
7257
+ Object.keys(t).forEach((w) => {
7258
+ w !== u && (v[w] = t[w]);
7259
+ }), e(v);
7260
+ }, c = (u, v, w) => {
7261
+ const I = w === "blur" ? v.trim() : v;
7262
+ if (w === "blur") {
7263
+ if (u !== I) {
7247
7264
  const R = {};
7248
7265
  Object.keys(t).forEach((P) => {
7249
- P === u ? R[N] = t[P] : R[P] = t[P];
7266
+ P === u ? R[I] = t[P] : R[P] = t[P];
7250
7267
  }), e(R), o((P) => {
7251
- const tt = { ...P };
7252
- return delete tt[u], tt;
7268
+ const et = { ...P };
7269
+ return delete et[u], et;
7253
7270
  });
7254
7271
  }
7255
7272
  } else
7256
7273
  o((R) => ({
7257
7274
  ...R,
7258
- [u]: y
7275
+ [u]: v
7259
7276
  }));
7260
- }, h = (u, y, k) => {
7261
- const N = k === "blur" ? y.trim() : y;
7262
- if (N !== "") {
7277
+ }, h = (u, v, w) => {
7278
+ const I = w === "blur" ? v.trim() : v;
7279
+ if (I !== "") {
7263
7280
  const R = {};
7264
7281
  Object.keys(t).forEach((P) => {
7265
- P === u ? R[P] = N : R[P] = t[P];
7282
+ P === u ? R[P] = I : R[P] = t[P];
7266
7283
  }), e(R);
7267
7284
  }
7268
7285
  }, f = () => {
7269
- const u = a.trim(), y = r.trim();
7270
- if (u !== "" && y !== "") {
7271
- const k = {};
7272
- Object.keys(t).forEach((N) => {
7273
- k[N] = t[N];
7274
- }), k[u] = y, e(k), l(""), i("");
7286
+ const u = a.trim(), v = r.trim();
7287
+ if (u !== "" && v !== "") {
7288
+ const w = {};
7289
+ Object.keys(t).forEach((I) => {
7290
+ w[I] = t[I];
7291
+ }), w[u] = v, e(w), l(""), i("");
7275
7292
  }
7276
7293
  }, b = () => {
7277
7294
  l("");
@@ -7280,44 +7297,44 @@ const Ie = ({
7280
7297
  }, p = (u) => {
7281
7298
  u.key === "Enter" && f();
7282
7299
  };
7283
- return /* @__PURE__ */ T("div", { children: [
7284
- Object.entries(t).map(([u, y], k) => /* @__PURE__ */ T("div", { className: "daga-value-item-element", children: [
7285
- /* @__PURE__ */ v(
7300
+ return /* @__PURE__ */ M("div", { children: [
7301
+ Object.entries(t).map(([u, v], w) => /* @__PURE__ */ M("div", { className: "daga-value-item-element", children: [
7302
+ /* @__PURE__ */ y(
7286
7303
  "input",
7287
7304
  {
7288
- id: `key-${k}`,
7305
+ id: `key-${w}`,
7289
7306
  className: "daga-input",
7290
7307
  type: "text",
7291
7308
  disabled: s,
7292
7309
  value: n[u] ?? u,
7293
- onChange: (N) => c(u, N.target.value, "change"),
7294
- onBlur: (N) => c(u, N.target.value, "blur")
7310
+ onChange: (I) => c(u, I.target.value, "change"),
7311
+ onBlur: (I) => c(u, I.target.value, "blur")
7295
7312
  }
7296
7313
  ),
7297
- /* @__PURE__ */ v(
7314
+ /* @__PURE__ */ y(
7298
7315
  "input",
7299
7316
  {
7300
- id: `value-${k}`,
7317
+ id: `value-${w}`,
7301
7318
  className: "daga-input",
7302
7319
  type: "text",
7303
7320
  disabled: s,
7304
- value: y,
7305
- onChange: (N) => h(u, N.target.value, "change"),
7306
- onBlur: (N) => h(u, N.target.value, "blur")
7321
+ value: v,
7322
+ onChange: (I) => h(u, I.target.value, "change"),
7323
+ onBlur: (I) => h(u, I.target.value, "blur")
7307
7324
  }
7308
7325
  ),
7309
- /* @__PURE__ */ v(
7326
+ /* @__PURE__ */ y(
7310
7327
  "button",
7311
7328
  {
7312
7329
  className: "daga-property-button",
7313
7330
  onClick: () => d(u),
7314
- children: /* @__PURE__ */ v("div", { className: "daga-icon daga-close-icon" })
7331
+ children: /* @__PURE__ */ y("div", { className: "daga-icon daga-close-icon" })
7315
7332
  }
7316
7333
  )
7317
7334
  ] }, u)),
7318
- !s && /* @__PURE__ */ T("div", { className: "daga-value-item-input", children: [
7319
- /* @__PURE__ */ T("div", { className: "daga-input daga-relatively-positioned", children: [
7320
- /* @__PURE__ */ v(
7335
+ !s && /* @__PURE__ */ M("div", { className: "daga-value-item-input", children: [
7336
+ /* @__PURE__ */ M("div", { className: "daga-input daga-relatively-positioned", children: [
7337
+ /* @__PURE__ */ y(
7321
7338
  "input",
7322
7339
  {
7323
7340
  type: "text",
@@ -7327,10 +7344,10 @@ const Ie = ({
7327
7344
  onBlur: (u) => c(a, u.target.value, "blur")
7328
7345
  }
7329
7346
  ),
7330
- /* @__PURE__ */ v("button", { className: "daga-clear", onClick: b })
7347
+ /* @__PURE__ */ y("button", { className: "daga-clear", onClick: b })
7331
7348
  ] }),
7332
- /* @__PURE__ */ T("div", { className: "daga-input daga-relatively-positioned", children: [
7333
- /* @__PURE__ */ v(
7349
+ /* @__PURE__ */ M("div", { className: "daga-input daga-relatively-positioned", children: [
7350
+ /* @__PURE__ */ y(
7334
7351
  "input",
7335
7352
  {
7336
7353
  type: "text",
@@ -7340,9 +7357,9 @@ const Ie = ({
7340
7357
  onBlur: (u) => h(a, u.target.value, "blur")
7341
7358
  }
7342
7359
  ),
7343
- /* @__PURE__ */ v("button", { className: "daga-clear", onClick: m })
7360
+ /* @__PURE__ */ y("button", { className: "daga-clear", onClick: m })
7344
7361
  ] }),
7345
- /* @__PURE__ */ v("button", { className: "daga-property-button", onClick: f, children: /* @__PURE__ */ v("div", { className: "daga-icon daga-add-icon" }) })
7362
+ /* @__PURE__ */ y("button", { className: "daga-property-button", onClick: f, children: /* @__PURE__ */ y("div", { className: "daga-icon daga-add-icon" }) })
7346
7363
  ] })
7347
7364
  ] });
7348
7365
  }, lo = ({
@@ -7350,7 +7367,7 @@ const Ie = ({
7350
7367
  onValueChange: t,
7351
7368
  depth: e
7352
7369
  }) => {
7353
- const l = Dt($t).canUserPerformAction(w.UpdateValues) && s?.rootElement?.removed !== !0, r = (o) => "daga-property-name-" + o.replace(/\s/g, ""), i = (o) => {
7370
+ const l = Dt($t).canUserPerformAction(k.UpdateValues) && s?.rootElement?.removed !== !0, r = (o) => "daga-property-name-" + o.replace(/\s/g, ""), i = (o) => {
7354
7371
  if (typeof o == "string")
7355
7372
  return o;
7356
7373
  if (o == null || isNaN(o.valueOf()))
@@ -7358,13 +7375,13 @@ const Ie = ({
7358
7375
  const d = new Date(o), c = d.getTimezoneOffset();
7359
7376
  return d.setMinutes(d.getMinutes() - c), d.toISOString().substring(0, 19);
7360
7377
  }, n = (o) => new Date(o);
7361
- return /* @__PURE__ */ v("daga-object-editor", { children: s.displayedProperties.map((o) => /* @__PURE__ */ T(
7378
+ return /* @__PURE__ */ y("daga-object-editor", { children: s.displayedProperties.map((o) => /* @__PURE__ */ M(
7362
7379
  "div",
7363
7380
  {
7364
7381
  className: `daga-property ${r(o.name)}`,
7365
7382
  children: [
7366
- /* @__PURE__ */ v("p", { className: "daga-property-name", children: o.label || o.name }),
7367
- o.type === M.Text && /* @__PURE__ */ v(
7383
+ /* @__PURE__ */ y("p", { className: "daga-property-name", children: o.label || o.name }),
7384
+ o.type === N.Text && /* @__PURE__ */ y(
7368
7385
  "input",
7369
7386
  {
7370
7387
  type: "daga-text",
@@ -7373,7 +7390,7 @@ const Ie = ({
7373
7390
  onChange: (d) => t(s, o, d.target.value)
7374
7391
  }
7375
7392
  ),
7376
- o.type === M.TextArea && /* @__PURE__ */ v(
7393
+ o.type === N.TextArea && /* @__PURE__ */ y(
7377
7394
  "textarea",
7378
7395
  {
7379
7396
  disabled: o.editable === !1 || !l,
@@ -7381,7 +7398,7 @@ const Ie = ({
7381
7398
  onChange: (d) => t(s, o, d.target.value)
7382
7399
  }
7383
7400
  ),
7384
- o.type === M.Number && /* @__PURE__ */ v(
7401
+ o.type === N.Number && /* @__PURE__ */ y(
7385
7402
  "input",
7386
7403
  {
7387
7404
  type: "number",
@@ -7390,7 +7407,7 @@ const Ie = ({
7390
7407
  onChange: (d) => t(s, o, d.target.value)
7391
7408
  }
7392
7409
  ),
7393
- o.type === M.Color && /* @__PURE__ */ v(
7410
+ o.type === N.Color && /* @__PURE__ */ y(
7394
7411
  "input",
7395
7412
  {
7396
7413
  type: "text",
@@ -7400,7 +7417,7 @@ const Ie = ({
7400
7417
  onChange: (d) => t(s, o, d.target.value)
7401
7418
  }
7402
7419
  ),
7403
- o.type === M.Datetime && /* @__PURE__ */ v(
7420
+ o.type === N.Datetime && /* @__PURE__ */ y(
7404
7421
  "input",
7405
7422
  {
7406
7423
  type: "datetime-local",
@@ -7415,7 +7432,7 @@ const Ie = ({
7415
7432
  )
7416
7433
  }
7417
7434
  ),
7418
- o.type === M.Date && /* @__PURE__ */ v(
7435
+ o.type === N.Date && /* @__PURE__ */ y(
7419
7436
  "input",
7420
7437
  {
7421
7438
  type: "date",
@@ -7424,7 +7441,7 @@ const Ie = ({
7424
7441
  onChange: (d) => t(s, o, d.target.value)
7425
7442
  }
7426
7443
  ),
7427
- o.type === M.Time && /* @__PURE__ */ v(
7444
+ o.type === N.Time && /* @__PURE__ */ y(
7428
7445
  "input",
7429
7446
  {
7430
7447
  type: "time",
@@ -7433,7 +7450,7 @@ const Ie = ({
7433
7450
  onChange: (d) => t(s, o, d.target.value)
7434
7451
  }
7435
7452
  ),
7436
- o.type === M.Url && /* @__PURE__ */ v(
7453
+ o.type === N.Url && /* @__PURE__ */ y(
7437
7454
  "input",
7438
7455
  {
7439
7456
  type: "url",
@@ -7442,13 +7459,13 @@ const Ie = ({
7442
7459
  onChange: (d) => t(s, o, d.target.value)
7443
7460
  }
7444
7461
  ),
7445
- o.type === M.Boolean && /* @__PURE__ */ T("div", { className: "daga-radio", children: [
7446
- /* @__PURE__ */ T(
7462
+ o.type === N.Boolean && /* @__PURE__ */ M("div", { className: "daga-radio", children: [
7463
+ /* @__PURE__ */ M(
7447
7464
  "label",
7448
7465
  {
7449
7466
  className: "daga-radio-item daga-radio-start" + (s?.getValue(o.name) === !1 ? " daga-checked" : ""),
7450
7467
  children: [
7451
- /* @__PURE__ */ v(
7468
+ /* @__PURE__ */ y(
7452
7469
  "input",
7453
7470
  {
7454
7471
  type: "radio",
@@ -7463,12 +7480,12 @@ const Ie = ({
7463
7480
  ]
7464
7481
  }
7465
7482
  ),
7466
- /* @__PURE__ */ T(
7483
+ /* @__PURE__ */ M(
7467
7484
  "label",
7468
7485
  {
7469
7486
  className: "daga-radio-item daga-radio-end" + (s?.getValue(o.name) === !0 ? " daga-checked" : ""),
7470
7487
  children: [
7471
- /* @__PURE__ */ v(
7488
+ /* @__PURE__ */ y(
7472
7489
  "input",
7473
7490
  {
7474
7491
  type: "radio",
@@ -7484,7 +7501,7 @@ const Ie = ({
7484
7501
  }
7485
7502
  )
7486
7503
  ] }),
7487
- o.type === M.Option && /* @__PURE__ */ v("div", { className: "daga-relatively-positioned", children: /* @__PURE__ */ v(
7504
+ o.type === N.Option && /* @__PURE__ */ y("div", { className: "daga-relatively-positioned", children: /* @__PURE__ */ y(
7488
7505
  ao,
7489
7506
  {
7490
7507
  disabled: o.editable === !1 || !l,
@@ -7493,26 +7510,26 @@ const Ie = ({
7493
7510
  onChange: (d) => t(s, o, d)
7494
7511
  }
7495
7512
  ) }),
7496
- (o.type === M.OptionList || o.type === M.OptionSet) && /* @__PURE__ */ v(
7513
+ (o.type === N.OptionList || o.type === N.OptionSet) && /* @__PURE__ */ y(
7497
7514
  Ti,
7498
7515
  {
7499
7516
  disabled: o.editable === !1 || !l,
7500
- allowRepeats: o.type === M.OptionList,
7517
+ allowRepeats: o.type === N.OptionList,
7501
7518
  options: o.options || [],
7502
7519
  value: s?.getValue(o.name),
7503
7520
  onChange: (d) => t(s, o, d)
7504
7521
  }
7505
7522
  ),
7506
- (o.type === M.TextList || o.type === M.TextSet) && /* @__PURE__ */ v(
7523
+ (o.type === N.TextList || o.type === N.TextSet) && /* @__PURE__ */ y(
7507
7524
  Mi,
7508
7525
  {
7509
7526
  disabled: o.editable === !1 || !l,
7510
- allowRepeats: o.type === M.TextList,
7527
+ allowRepeats: o.type === N.TextList,
7511
7528
  value: s?.getValue(o.name),
7512
7529
  onChange: (d) => t(s, o, d)
7513
7530
  }
7514
7531
  ),
7515
- o.type === M.TextMap && /* @__PURE__ */ v(
7532
+ o.type === N.TextMap && /* @__PURE__ */ y(
7516
7533
  Ni,
7517
7534
  {
7518
7535
  disabled: o.editable === !1 || !l,
@@ -7520,7 +7537,7 @@ const Ie = ({
7520
7537
  onChange: (d) => t(s, o, d)
7521
7538
  }
7522
7539
  ),
7523
- o.type === M.Object && /* @__PURE__ */ v("div", { className: "daga-left-bar", children: /* @__PURE__ */ v(
7540
+ o.type === N.Object && /* @__PURE__ */ y("div", { className: "daga-left-bar", children: /* @__PURE__ */ y(
7524
7541
  lo,
7525
7542
  {
7526
7543
  valueSet: s.getSubValueSet(o.name),
@@ -7536,27 +7553,27 @@ const Ie = ({
7536
7553
  const e = Dt($t), a = rt(null), l = (o) => "daga-property-name-" + o.replace(/\s/g, ""), r = () => {
7537
7554
  for (const o of s?.displayedProperties || []) {
7538
7555
  let d = 0, c = 0, h = 0;
7539
- const f = x.select(a.current).select(
7556
+ const f = L.select(a.current).select(
7540
7557
  `.daga-property.${l(o.name)}.daga-depth-${t}`
7541
7558
  );
7542
7559
  f.select("button.daga-move-button").call(
7543
- x.drag().on(A.Start, (b) => {
7544
- S(L.Grabbing);
7560
+ L.drag().on(A.Start, (b) => {
7561
+ S(E.Grabbing);
7545
7562
  const m = e.getPointerLocationRelativeToScreen(b);
7546
7563
  if (m.length < 2 || isNaN(m[0]) || isNaN(m[1]))
7547
7564
  return;
7548
7565
  const p = f.node()?.getBoundingClientRect();
7549
7566
  d = p?.width || 0, c = p?.height || 0, f.style("position", "fixed").style("left", `${m[0] - d / 2}px`).style("top", `${m[1] - c / 2}px`).style("width", `${d}px`).style("height", `${c}px`).style("z-index", 1);
7550
7567
  }).on(A.Drag, (b) => {
7551
- S(L.Grabbing);
7568
+ S(E.Grabbing);
7552
7569
  const m = e.getPointerLocationRelativeToScreen(b);
7553
- m.length < 2 || isNaN(m[0]) || isNaN(m[1]) || (f.style("position", "fixed").style("left", `${m[0] - d / 2}px`).style("top", `${m[1] - c / 2}px`).style("width", `${d}px`).style("height", `${c}px`).style("z-index", 1), x.select(a.current).select(
7570
+ m.length < 2 || isNaN(m[0]) || isNaN(m[1]) || (f.style("position", "fixed").style("left", `${m[0] - d / 2}px`).style("top", `${m[1] - c / 2}px`).style("width", `${d}px`).style("height", `${c}px`).style("z-index", 1), L.select(a.current).select(
7554
7571
  `.daga-dropbar.daga-index-${h}.daga-depth-${t}`
7555
- ).style("visibility", "hidden").style("height", 0), h = i(m), x.select(a.current).select(
7572
+ ).style("visibility", "hidden").style("height", 0), h = i(m), L.select(a.current).select(
7556
7573
  `.daga-dropbar.daga-index-${h}.daga-depth-${t}`
7557
7574
  ).style("visibility", "visible").style("height", "0.25rem"));
7558
7575
  }).on(A.End, (b) => {
7559
- S(L.Auto), f.style("position", "relative").style("left", 0).style("top", 0).style("z-index", 0).style("width", "unset").style("height", "unset"), x.select(a.current).select(
7576
+ S(E.Auto), f.style("position", "relative").style("left", 0).style("top", 0).style("z-index", 0).style("width", "unset").style("height", "unset"), L.select(a.current).select(
7560
7577
  `.daga-dropbar.daga-index-${h}.daga-depth-${t}`
7561
7578
  ).style("visibility", "hidden").style("height", 0);
7562
7579
  const m = e.getPointerLocationRelativeToScreen(b);
@@ -7574,7 +7591,7 @@ const Ie = ({
7574
7591
  }, i = (o) => {
7575
7592
  const d = s?.propertySet.propertyList || [], c = [];
7576
7593
  for (let h = 0; h <= d.length; ++h) {
7577
- const f = x.select(a.current).select(
7594
+ const f = L.select(a.current).select(
7578
7595
  `.daga-dropbar.daga-index-${h}.daga-depth-${t}`
7579
7596
  ).node()?.getBoundingClientRect();
7580
7597
  f && c.push([
@@ -7599,34 +7616,34 @@ const Ie = ({
7599
7616
  o.target?.value || ""
7600
7617
  ) : d = s?.propertySet.getProperty(o || ""), d && s?.hideProperty(d), r();
7601
7618
  };
7602
- return /* @__PURE__ */ T("daga-property-settings", { ref: a, children: [
7603
- /* @__PURE__ */ v("div", { className: `daga-dropbar daga-index-0 daga-depth-${t}` }),
7604
- s?.displayedProperties.map((o, d) => /* @__PURE__ */ T(
7619
+ return /* @__PURE__ */ M("daga-property-settings", { ref: a, children: [
7620
+ /* @__PURE__ */ y("div", { className: `daga-dropbar daga-index-0 daga-depth-${t}` }),
7621
+ s?.displayedProperties.map((o, d) => /* @__PURE__ */ M(
7605
7622
  "div",
7606
7623
  {
7607
7624
  className: `daga-property-and-dropbar ${l(o.name)} daga-depth-${t}`,
7608
7625
  children: [
7609
- /* @__PURE__ */ T(
7626
+ /* @__PURE__ */ M(
7610
7627
  "div",
7611
7628
  {
7612
7629
  className: `daga-property ${l(o.name)} daga-depth-${t}`,
7613
7630
  children: [
7614
- /* @__PURE__ */ T("div", { className: "daga-property-name", children: [
7615
- /* @__PURE__ */ v("span", { children: o.label || o.name }),
7616
- /* @__PURE__ */ T("div", { className: "daga-buttons", children: [
7617
- /* @__PURE__ */ v("button", { className: "daga-property-button daga-move-button", children: /* @__PURE__ */ v("div", { className: "daga-icon daga-move-icon" }) }),
7618
- /* @__PURE__ */ v(
7631
+ /* @__PURE__ */ M("div", { className: "daga-property-name", children: [
7632
+ /* @__PURE__ */ y("span", { children: o.label || o.name }),
7633
+ /* @__PURE__ */ M("div", { className: "daga-buttons", children: [
7634
+ /* @__PURE__ */ y("button", { className: "daga-property-button daga-move-button", children: /* @__PURE__ */ y("div", { className: "daga-icon daga-move-icon" }) }),
7635
+ /* @__PURE__ */ y(
7619
7636
  "button",
7620
7637
  {
7621
7638
  className: "daga-property-button daga-hide-button",
7622
7639
  onClick: () => n(o.name),
7623
- children: /* @__PURE__ */ v("div", { className: "daga-icon daga-hide-icon" })
7640
+ children: /* @__PURE__ */ y("div", { className: "daga-icon daga-hide-icon" })
7624
7641
  }
7625
7642
  )
7626
7643
  ] })
7627
7644
  ] }),
7628
- o.type !== M.Object && /* @__PURE__ */ v("div", { className: "daga-property-value", children: Pi(s?.getValue(o.name)) }),
7629
- o.type === M.Object && /* @__PURE__ */ v(
7645
+ o.type !== N.Object && /* @__PURE__ */ y("div", { className: "daga-property-value", children: Pi(s?.getValue(o.name)) }),
7646
+ o.type === N.Object && /* @__PURE__ */ y(
7630
7647
  co,
7631
7648
  {
7632
7649
  valueSet: s?.getSubValueSet(o.name),
@@ -7636,7 +7653,7 @@ const Ie = ({
7636
7653
  ]
7637
7654
  }
7638
7655
  ),
7639
- /* @__PURE__ */ v(
7656
+ /* @__PURE__ */ y(
7640
7657
  "div",
7641
7658
  {
7642
7659
  className: `daga-dropbar daga-index-${d + 1} daga-depth-${t}`
@@ -7648,8 +7665,8 @@ const Ie = ({
7648
7665
  ))
7649
7666
  ] });
7650
7667
  }, Pi = (s) => Array.isArray(s) ? s.join(", ") : zo(s) ? Object.entries(s).map((t) => t.map((e) => JSON.stringify(e)).join(": ")).join(", ") : s instanceof Date ? s.toLocaleString() : s == null ? "" : "" + s, zi = ({ location: s, direction: t, width: e, height: a, title: l, valueSet: r, onValueChange: i }) => {
7651
- const n = rt(null), [o, d] = D(!1), [c, h] = D(!1), f = () => x.select(n.current);
7652
- return Ct(() => {
7668
+ const n = rt(null), [o, d] = D(!1), [c, h] = D(!1), f = () => L.select(n.current);
7669
+ return St(() => {
7653
7670
  if (n.current)
7654
7671
  switch (t) {
7655
7672
  case g.Bottom:
@@ -7661,14 +7678,14 @@ const Ie = ({
7661
7678
  f().style("height", e), a && f().select(".daga-panel-content").style("width", a);
7662
7679
  break;
7663
7680
  }
7664
- }, [e, t]), /* @__PURE__ */ v("daga-property-editor", { children: /* @__PURE__ */ T(
7681
+ }, [e, t]), /* @__PURE__ */ y("daga-property-editor", { children: /* @__PURE__ */ M(
7665
7682
  "div",
7666
7683
  {
7667
7684
  ref: n,
7668
7685
  className: `daga-panel daga-bottom daga-${s} daga-${t}`,
7669
7686
  children: [
7670
- /* @__PURE__ */ v(
7671
- Ie,
7687
+ /* @__PURE__ */ y(
7688
+ xe,
7672
7689
  {
7673
7690
  disabled: !r || !r.propertySet || !r.propertySet.hasProperties(),
7674
7691
  collapsed: o,
@@ -7681,15 +7698,15 @@ const Ie = ({
7681
7698
  onCollapse: d
7682
7699
  }
7683
7700
  ),
7684
- /* @__PURE__ */ v("div", { className: "daga-panel-content", children: r && r.propertySet && r.propertySet.hasProperties() && !o && /* @__PURE__ */ T("div", { children: [
7685
- l && /* @__PURE__ */ T("p", { className: "daga-title", children: [
7701
+ /* @__PURE__ */ y("div", { className: "daga-panel-content", children: r && r.propertySet && r.propertySet.hasProperties() && !o && /* @__PURE__ */ M("div", { children: [
7702
+ l && /* @__PURE__ */ M("p", { className: "daga-title", children: [
7686
7703
  l,
7687
- /* @__PURE__ */ v(
7704
+ /* @__PURE__ */ y(
7688
7705
  "button",
7689
7706
  {
7690
7707
  className: "daga-property-button",
7691
7708
  onClick: () => h(!c),
7692
- children: /* @__PURE__ */ v(
7709
+ children: /* @__PURE__ */ y(
7693
7710
  "div",
7694
7711
  {
7695
7712
  className: `daga-icon daga-settings-icon ${c ? "daga-unrotate" : "daga-rotate"}`
@@ -7698,7 +7715,7 @@ const Ie = ({
7698
7715
  }
7699
7716
  )
7700
7717
  ] }),
7701
- !c && /* @__PURE__ */ v(
7718
+ !c && /* @__PURE__ */ y(
7702
7719
  lo,
7703
7720
  {
7704
7721
  valueSet: r,
@@ -7706,7 +7723,7 @@ const Ie = ({
7706
7723
  depth: 0
7707
7724
  }
7708
7725
  ),
7709
- c && /* @__PURE__ */ v(co, { valueSet: r, depth: 0 })
7726
+ c && /* @__PURE__ */ y(co, { valueSet: r, depth: 0 })
7710
7727
  ] }) })
7711
7728
  ]
7712
7729
  }
@@ -7720,109 +7737,109 @@ const Ie = ({
7720
7737
  if (a(p), c().selectAll("*").remove(), r(t.getPriorityThreshold() || 0), p.categories && h(p.categories), p.templates)
7721
7738
  for (const u of p.templates)
7722
7739
  f(u);
7723
- }, c = () => x.select(o.current).select(".daga-palette-view"), h = (p) => {
7740
+ }, c = () => L.select(o.current).select(".daga-palette-view"), h = (p) => {
7724
7741
  const u = c().append("select").style("width", "100%").style("height", "2rem").style("padding", "0.5rem").style("border-radius", "0.25rem").style("background-color", "#f7f8fc").style("border", "1px solid #e6e6e6");
7725
7742
  u.append("option").attr("value", "").text("(None selected)");
7726
- for (const y in p)
7727
- u.append("option").attr("value", y).text(y);
7743
+ for (const v in p)
7744
+ u.append("option").attr("value", v).text(v);
7728
7745
  u.on($.Change, () => {
7729
7746
  i && c().selectAll(".daga-template-container.daga-in-category").remove();
7730
- const y = u.property("value");
7731
- n(y);
7732
- const k = p[y] || [];
7733
- for (const N of k)
7734
- f(N, "daga-in-category");
7747
+ const v = u.property("value");
7748
+ n(v);
7749
+ const w = p[v] || [];
7750
+ for (const I of w)
7751
+ f(I, "daga-in-category");
7735
7752
  }), i && (u.property("value", i), u.dispatch($.Change));
7736
7753
  }, f = (p, u) => {
7737
7754
  if (p.templateType === "node") {
7738
- const y = t.model.nodes.types.get(p.type);
7739
- y ? b(y, p, u) : console.error(`Could not find a node type called '${p.type}'`);
7755
+ const v = t.model.nodes.types.get(p.type);
7756
+ v ? b(v, p, u) : console.error(`Could not find a node type called '${p.type}'`);
7740
7757
  } else if (p.templateType === "connection") {
7741
- const y = t.model.connections.types.get(p.type);
7742
- y ? m(y, p, u) : console.error(
7758
+ const v = t.model.connections.types.get(p.type);
7759
+ v ? m(v, p, u) : console.error(
7743
7760
  `Could not find a connection type called '${p.type}'`
7744
7761
  );
7745
7762
  }
7746
- }, b = (p, u, y) => {
7763
+ }, b = (p, u, v) => {
7747
7764
  if (l !== void 0 && p.priority < l)
7748
7765
  return;
7749
- const k = p.defaultLook.lookType === "shaped-look" ? p.defaultLook.borderThickness || 1 : 0, N = p.defaultHeight + k, R = p.defaultWidth + k, P = u.height || N, tt = u.width || R, E = c().append("div").attr(
7766
+ const w = p.defaultLook.lookType === "shaped-look" ? p.defaultLook.borderThickness || 1 : 0, I = p.defaultHeight + w, R = p.defaultWidth + w, P = u.height || I, et = u.width || R, T = c().append("div").attr(
7750
7767
  "class",
7751
- `daga-template-container ${y !== void 0 ? y : ""}`
7752
- ).style("width", `${tt}px`).style("height", `${P}px`).call(
7753
- x.drag().on(A.Drag, (O) => {
7754
- if (t.canUserPerformAction(w.AddNode)) {
7755
- const I = t.getPointerLocationRelativeToScreen(O);
7756
- if (I.length < 2 || isNaN(I[0]) || isNaN(I[1]))
7768
+ `daga-template-container ${v !== void 0 ? v : ""}`
7769
+ ).style("width", `${et}px`).style("height", `${P}px`).call(
7770
+ L.drag().on(A.Drag, (O) => {
7771
+ if (t.canUserPerformAction(k.AddNode)) {
7772
+ const x = t.getPointerLocationRelativeToScreen(O);
7773
+ if (x.length < 2 || isNaN(x[0]) || isNaN(x[1]))
7757
7774
  return;
7758
- E.style("position", "fixed").style("left", `${I[0] - tt / 2}px`).style("top", `${I[1] - P / 2}px`).style("z-index", 1);
7775
+ T.style("position", "fixed").style("left", `${x[0] - et / 2}px`).style("top", `${x[1] - P / 2}px`).style("z-index", 1);
7759
7776
  }
7760
7777
  }).on(A.Start, (O) => {
7761
- if (t.canUserPerformAction(w.AddNode)) {
7762
- S(L.Grabbing);
7763
- const I = t.getPointerLocationRelativeToScreen(O);
7764
- if (I.length < 2 || isNaN(I[0]) || isNaN(I[1]))
7778
+ if (t.canUserPerformAction(k.AddNode)) {
7779
+ S(E.Grabbing);
7780
+ const x = t.getPointerLocationRelativeToScreen(O);
7781
+ if (x.length < 2 || isNaN(x[0]) || isNaN(x[1]))
7765
7782
  return;
7766
- E.style("position", "fixed").style("left", `${I[0] - tt / 2}px`).style("top", `${I[1] - P / 2}px`).style("z-index", 1), p.isUnique && t.model.nodes.find(
7783
+ T.style("position", "fixed").style("left", `${x[0] - et / 2}px`).style("top", `${x[1] - P / 2}px`).style("z-index", 1), p.isUnique && t.model.nodes.find(
7767
7784
  (_) => !_.removed && _.type.id === p.id
7768
- ) !== void 0 && S(L.NotAllowed);
7785
+ ) !== void 0 && S(E.NotAllowed);
7769
7786
  }
7770
7787
  }).on(A.End, (O) => {
7771
- if (t.canUserPerformAction(w.AddNode)) {
7772
- if (S(L.Auto), E.style("position", "relative").style("left", 0).style("top", 0).style("z-index", "auto"), p.isUnique && t.model.nodes.find(
7773
- (jt) => !jt.removed && jt.type.id === p.id
7788
+ if (t.canUserPerformAction(k.AddNode)) {
7789
+ if (S(E.Auto), T.style("position", "relative").style("left", 0).style("top", 0).style("z-index", "auto"), p.isUnique && t.model.nodes.find(
7790
+ (Wt) => !Wt.removed && Wt.type.id === p.id
7774
7791
  ) !== void 0)
7775
7792
  return;
7776
- const I = t.getPointerLocationRelativeToScreen(O);
7777
- if (I.length < 2 || isNaN(I[0]) || isNaN(I[1]))
7793
+ const x = t.getPointerLocationRelativeToScreen(O);
7794
+ if (x.length < 2 || isNaN(x[0]) || isNaN(x[1]))
7778
7795
  return;
7779
7796
  const _ = document.elementFromPoint(
7780
- I[0],
7781
- I[1]
7797
+ x[0],
7798
+ x[1]
7782
7799
  );
7783
7800
  if (_ && !t.selectCanvasView().node()?.contains(_))
7784
7801
  return;
7785
7802
  const lt = t.getPointerLocationRelativeToCanvas(O);
7786
7803
  if (lt.length < 2 || isNaN(lt[0]) || isNaN(lt[1]))
7787
7804
  return;
7788
- let q = [
7805
+ let J = [
7789
7806
  lt[0] - p.defaultWidth / 2,
7790
7807
  lt[1] - p.defaultHeight / 2
7791
7808
  ];
7792
- t.snapToGrid && (q = t.getClosestGridPoint([
7793
- q[0] - p.snapToGridOffset[0],
7794
- q[1] - p.snapToGridOffset[1]
7795
- ]), q[0] += p.snapToGridOffset[0], q[1] += p.snapToGridOffset[1]);
7796
- const J = t.model.nodes.getAtCoordinates(
7809
+ t.snapToGrid && (J = t.getClosestGridPoint([
7810
+ J[0] - p.snapToGridOffset[0],
7811
+ J[1] - p.snapToGridOffset[1]
7812
+ ]), J[0] += p.snapToGridOffset[0], J[1] += p.snapToGridOffset[1]);
7813
+ const Pt = t.model.nodes.getAtCoordinates(
7797
7814
  lt[0],
7798
7815
  lt[1]
7799
7816
  ).filter(
7800
- (jt) => jt.type.childrenTypes.includes(p.id)
7801
- ), wt = Ze(
7802
- J
7803
- ), nt = wt[wt.length - 1];
7804
- if (!p.canBeParentless && nt === void 0)
7817
+ (Wt) => Wt.type.childrenTypes.includes(p.id)
7818
+ ), Z = Ze(
7819
+ Pt
7820
+ ), Q = Z[Z.length - 1];
7821
+ if (!p.canBeParentless && Q === void 0)
7805
7822
  return;
7806
- const Xt = nt?.getLastAncestor(), xe = new qo(
7823
+ const ae = Q?.getLastAncestor(), Xt = new qo(
7807
7824
  t,
7808
7825
  p,
7809
- q,
7810
- nt?.id,
7811
- Xt?.id,
7812
- Xt?.getGeometry(),
7826
+ J,
7827
+ Q?.id,
7828
+ ae?.id,
7829
+ ae?.getGeometry(),
7813
7830
  void 0,
7814
7831
  u.label,
7815
7832
  u.values
7816
7833
  );
7817
- xe.do(), t?.actionStack.add(xe), S();
7834
+ Xt.do(), t?.actionStack.add(Xt), S();
7818
7835
  }
7819
7836
  })
7820
- ).append("svg").attr("class", `palette-node ${p.id}`).attr("viewBox", `0 0 ${R} ${N}`).attr("preserveAspectRatio", "none").style("position", "relative").style("left", 0).style("top", 0).style("width", `${tt}px`).style("height", `${P}px`), C = u.look || p.defaultLook;
7837
+ ).append("svg").attr("class", `palette-node ${p.id}`).attr("viewBox", `0 0 ${R} ${I}`).attr("preserveAspectRatio", "none").style("position", "relative").style("left", 0).style("top", 0).style("width", `${et}px`).style("height", `${P}px`), C = u.look || p.defaultLook;
7821
7838
  switch (C.lookType) {
7822
7839
  case "shaped-look":
7823
- E.append("path").attr(
7840
+ T.append("path").attr(
7824
7841
  "d",
7825
- ve(
7842
+ ye(
7826
7843
  C.shape || Mt.Rectangle,
7827
7844
  (C.borderThickness || 1) / 2,
7828
7845
  (C.borderThickness || 1) / 2,
@@ -7832,33 +7849,33 @@ const Ie = ({
7832
7849
  ).attr("fill", C.fillColor || "#FFFFFF").attr("stroke", C.borderColor || "#000000").attr("stroke-width", `${C.borderThickness}px`);
7833
7850
  break;
7834
7851
  case "image-look":
7835
- E.append("image").attr("x", 0).attr("y", 0).attr("width", p.defaultWidth).attr("height", p.defaultHeight).attr("href", C.backgroundImage).attr("preserveAspectRatio", "none");
7852
+ T.append("image").attr("x", 0).attr("y", 0).attr("width", p.defaultWidth).attr("height", p.defaultHeight).attr("href", C.backgroundImage).attr("preserveAspectRatio", "none");
7836
7853
  break;
7837
7854
  case "stretchable-image-look":
7838
- E.append("image").attr("x", 0).attr("y", 0).attr("width", C.leftMargin).attr("height", C.topMargin).attr("href", C.backgroundImageTopLeft).attr("preserveAspectRatio", "none"), E.append("image").attr("x", C.leftMargin).attr("y", 0).attr(
7855
+ T.append("image").attr("x", 0).attr("y", 0).attr("width", C.leftMargin).attr("height", C.topMargin).attr("href", C.backgroundImageTopLeft).attr("preserveAspectRatio", "none"), T.append("image").attr("x", C.leftMargin).attr("y", 0).attr(
7839
7856
  "width",
7840
7857
  p.defaultWidth - C.rightMargin - C.leftMargin
7841
- ).attr("height", C.topMargin).attr("href", C.backgroundImageTop).attr("preserveAspectRatio", "none"), E.append("image").attr("x", p.defaultWidth - C.rightMargin).attr("y", 0).attr("width", C.rightMargin).attr("height", C.topMargin).attr("href", C.backgroundImageTopRight).attr("preserveAspectRatio", "none"), E.append("image").attr("x", 0).attr("y", C.topMargin).attr("width", C.leftMargin).attr(
7858
+ ).attr("height", C.topMargin).attr("href", C.backgroundImageTop).attr("preserveAspectRatio", "none"), T.append("image").attr("x", p.defaultWidth - C.rightMargin).attr("y", 0).attr("width", C.rightMargin).attr("height", C.topMargin).attr("href", C.backgroundImageTopRight).attr("preserveAspectRatio", "none"), T.append("image").attr("x", 0).attr("y", C.topMargin).attr("width", C.leftMargin).attr(
7842
7859
  "height",
7843
7860
  p.defaultHeight - C.bottomMargin - C.topMargin
7844
- ).attr("href", C.backgroundImageLeft).attr("preserveAspectRatio", "none"), E.append("image").attr("x", C.leftMargin).attr("y", C.topMargin).attr(
7861
+ ).attr("href", C.backgroundImageLeft).attr("preserveAspectRatio", "none"), T.append("image").attr("x", C.leftMargin).attr("y", C.topMargin).attr(
7845
7862
  "width",
7846
7863
  p.defaultWidth - C.rightMargin - C.leftMargin
7847
7864
  ).attr(
7848
7865
  "height",
7849
7866
  p.defaultHeight - C.bottomMargin - C.topMargin
7850
- ).attr("href", C.backgroundImageCenter).attr("preserveAspectRatio", "none"), E.append("image").attr("x", p.defaultWidth - C.rightMargin).attr("y", C.topMargin).attr("width", C.rightMargin).attr(
7867
+ ).attr("href", C.backgroundImageCenter).attr("preserveAspectRatio", "none"), T.append("image").attr("x", p.defaultWidth - C.rightMargin).attr("y", C.topMargin).attr("width", C.rightMargin).attr(
7851
7868
  "height",
7852
7869
  p.defaultHeight - C.bottomMargin - C.topMargin
7853
- ).attr("href", C.backgroundImageRight).attr("preserveAspectRatio", "none"), E.append("image").attr("x", 0).attr("y", p.defaultHeight - C.bottomMargin).attr("width", C.leftMargin).attr("height", C.bottomMargin).attr("href", C.backgroundImageBottomLeft).attr("preserveAspectRatio", "none"), E.append("image").attr("x", C.leftMargin).attr("y", p.defaultHeight - C.bottomMargin).attr(
7870
+ ).attr("href", C.backgroundImageRight).attr("preserveAspectRatio", "none"), T.append("image").attr("x", 0).attr("y", p.defaultHeight - C.bottomMargin).attr("width", C.leftMargin).attr("height", C.bottomMargin).attr("href", C.backgroundImageBottomLeft).attr("preserveAspectRatio", "none"), T.append("image").attr("x", C.leftMargin).attr("y", p.defaultHeight - C.bottomMargin).attr(
7854
7871
  "width",
7855
7872
  p.defaultWidth - C.rightMargin - C.leftMargin
7856
- ).attr("height", C.bottomMargin).attr("href", C.backgroundImageBottom).attr("preserveAspectRatio", "none"), E.append("image").attr("x", p.defaultWidth - C.rightMargin).attr("y", p.defaultHeight - C.bottomMargin).attr("width", C.rightMargin).attr("height", C.bottomMargin).attr("href", C.backgroundImageBottomRight).attr("preserveAspectRatio", "none");
7873
+ ).attr("height", C.bottomMargin).attr("href", C.backgroundImageBottom).attr("preserveAspectRatio", "none"), T.append("image").attr("x", p.defaultWidth - C.rightMargin).attr("y", p.defaultHeight - C.bottomMargin).attr("width", C.rightMargin).attr("height", C.bottomMargin).attr("href", C.backgroundImageBottomRight).attr("preserveAspectRatio", "none");
7857
7874
  }
7858
7875
  if (u.look === void 0) {
7859
7876
  if (p.decorators)
7860
7877
  for (const O of p.decorators)
7861
- E.append("foreignObject").attr("width", `${O.width}px`).attr("height", `${O.height}px`).attr(
7878
+ T.append("foreignObject").attr("width", `${O.width}px`).attr("height", `${O.height}px`).attr(
7862
7879
  "transform",
7863
7880
  `translate(${O.coords[0]},${O.coords[1]})`
7864
7881
  ).html(O.html);
@@ -7868,34 +7885,34 @@ const Ie = ({
7868
7885
  ...p.label,
7869
7886
  ...u.labelLook
7870
7887
  };
7871
- E.append("text").attr(
7888
+ T.append("text").attr(
7872
7889
  "transform",
7873
7890
  `translate(${(Y(O) + p.defaultWidth) / 2},${(U(O) + p.defaultHeight) / 2})`
7874
7891
  ).attr("x", 0).attr("y", 0).attr("font-size", `${O.fontSize}px`).attr("text-anchor", "middle").attr("font-family", O.fontFamily).attr("font-weight", 400).attr("fill", O.color).attr("stroke", "none").style("font-kerning", "none").style("user-select", "none").text(u.label);
7875
7892
  }
7876
7893
  }
7877
- }, m = (p, u, y) => {
7878
- const k = c().append("div").attr(
7894
+ }, m = (p, u, v) => {
7895
+ const w = c().append("div").attr(
7879
7896
  "class",
7880
- `daga-template-container ${y !== void 0 ? y : ""}`
7897
+ `daga-template-container ${v !== void 0 ? v : ""}`
7881
7898
  ).style("width", `${u.width}px`).style("height", `${u.height}px`).append("svg").attr("class", `palette-button ${p.id}`).style("position", "relative").style("left", 0).style("top", 0).style("width", "100%").style("height", "100%").on("click", () => {
7882
7899
  t.connectionType = p;
7883
7900
  });
7884
- k.append("path").attr(
7901
+ w.append("path").attr(
7885
7902
  "d",
7886
- ve(
7903
+ ye(
7887
7904
  Mt.Rectangle,
7888
7905
  0,
7889
7906
  0,
7890
7907
  u.width,
7891
7908
  u.height
7892
7909
  )
7893
- ).attr("fill", u.backgroundColor).attr("stroke", "black").attr("stroke-width", "1px"), u.icon !== "" && k.append("image").attr("x", 0).attr("y", 0).attr("width", u.width).attr("height", u.height).attr("href", u.icon), u.label !== "" && k.append("text").attr(
7910
+ ).attr("fill", u.backgroundColor).attr("stroke", "black").attr("stroke-width", "1px"), u.icon !== "" && w.append("image").attr("x", 0).attr("y", 0).attr("width", u.width).attr("height", u.height).attr("href", u.icon), u.label !== "" && w.append("text").attr(
7894
7911
  "transform",
7895
7912
  `translate(${u.width / 2},${u.height / 2 + Ri})`
7896
7913
  ).attr("x", 0).attr("y", 0).attr("font-size", "20px").attr("text-anchor", "middle").attr("font-family", "'Wonder Unit Sans', sans-serif").attr("font-weight", 400).attr("fill", "#000000").attr("stroke", "none").style("font-kerning", "none").style("user-select", "none").text(u.label);
7897
7914
  };
7898
- return Ct(() => {
7915
+ return St(() => {
7899
7916
  if (d(s.palettes[0]), o.current)
7900
7917
  switch (s.direction) {
7901
7918
  case g.Bottom:
@@ -7907,14 +7924,14 @@ const Ie = ({
7907
7924
  o.current.style.height = s.width, s.height && (o.current.style.width = s.height);
7908
7925
  break;
7909
7926
  }
7910
- }, [e, s.palettes]), /* @__PURE__ */ v("daga-palette", { children: /* @__PURE__ */ T(
7927
+ }, [e, s.palettes]), /* @__PURE__ */ y("daga-palette", { children: /* @__PURE__ */ M(
7911
7928
  "div",
7912
7929
  {
7913
7930
  ref: o,
7914
7931
  className: `daga-panel daga-${s.location} daga-${s.direction}`,
7915
7932
  children: [
7916
- /* @__PURE__ */ v(
7917
- Ie,
7933
+ /* @__PURE__ */ y(
7934
+ xe,
7918
7935
  {
7919
7936
  direction: s.direction,
7920
7937
  collapsableSelector: o,
@@ -7926,8 +7943,8 @@ const Ie = ({
7926
7943
  disabled: !1
7927
7944
  }
7928
7945
  ),
7929
- /* @__PURE__ */ T("div", { className: "daga-panel-content", children: [
7930
- s.palettes.length > 1 && /* @__PURE__ */ v("div", { className: "daga-panel-tabs", children: s.palettes.map((p) => /* @__PURE__ */ v(
7946
+ /* @__PURE__ */ M("div", { className: "daga-panel-content", children: [
7947
+ s.palettes.length > 1 && /* @__PURE__ */ y("div", { className: "daga-panel-tabs", children: s.palettes.map((p) => /* @__PURE__ */ y(
7931
7948
  "div",
7932
7949
  {
7933
7950
  className: `daga-panel-tab ${p === e ? "daga-current-tab" : ""}`,
@@ -7935,7 +7952,7 @@ const Ie = ({
7935
7952
  children: p.name
7936
7953
  }
7937
7954
  )) }),
7938
- /* @__PURE__ */ v("div", { className: "daga-palette-view" })
7955
+ /* @__PURE__ */ y("div", { className: "daga-palette-view" })
7939
7956
  ] })
7940
7957
  ]
7941
7958
  }
@@ -7943,106 +7960,107 @@ const Ie = ({
7943
7960
  }, Oi = ({
7944
7961
  location: s,
7945
7962
  direction: t,
7946
- enableAction: e,
7947
- enableFilter: a,
7948
- enableLayout: l,
7949
- enableSelection: r,
7950
- enableZoom: i
7963
+ centerAnimationDuration: e,
7964
+ enableAction: a,
7965
+ enableFilter: l,
7966
+ enableLayout: r,
7967
+ enableSelection: i,
7968
+ enableZoom: n
7951
7969
  }) => {
7952
- let n = !1, o = !0, d = !1, c, h, f, b;
7970
+ let o = !1, d = !0, c = !1, h, f, b, m;
7953
7971
  switch (t) {
7954
7972
  case g.Bottom:
7955
- c = "height", h = "scaleY", f = "top", b = "bottom";
7973
+ h = "height", f = "scaleY", b = "top", m = "bottom";
7956
7974
  break;
7957
7975
  case g.Top:
7958
- c = "height", h = "scaleY", f = "bottom", b = "top";
7976
+ h = "height", f = "scaleY", b = "bottom", m = "top";
7959
7977
  break;
7960
7978
  case g.Left:
7961
- c = "width", h = "scaleX", f = "right", b = "left";
7979
+ h = "width", f = "scaleX", b = "right", m = "left";
7962
7980
  break;
7963
7981
  case g.Right:
7964
- c = "width", h = "scaleX", f = "left", b = "right";
7982
+ h = "width", f = "scaleX", b = "left", m = "right";
7965
7983
  break;
7966
7984
  }
7967
- const m = rt(null), p = rt(null), u = rt(null);
7968
- Ct(() => {
7969
- x.select(
7970
- m.current
7971
- ).style(`margin-${b}`, "-1rem").style(c, "0rem").style("transform", `${h}(0)`).style("transform-origin", f);
7985
+ const p = rt(null), u = rt(null), v = rt(null);
7986
+ St(() => {
7987
+ L.select(
7988
+ p.current
7989
+ ).style(`margin-${m}`, "-1rem").style(h, "0rem").style("transform", `${f}(0)`).style("transform-origin", b);
7972
7990
  });
7973
- const y = async () => {
7974
- const J = x.select(
7975
- m.current
7991
+ const w = async () => {
7992
+ const Z = L.select(
7993
+ p.current
7976
7994
  );
7977
- if (!d)
7978
- if (o) {
7979
- o = !1;
7980
- const Xt = `${4 * J.selectChildren().size()}rem`;
7981
- J.transition().duration(500).ease(x.easeLinear).style(c, Xt).style("transform", `${h}(1)`), setTimeout(() => {
7982
- d = !1;
7995
+ if (!c)
7996
+ if (d) {
7997
+ d = !1;
7998
+ const Xt = `${4 * Z.selectChildren().size()}rem`;
7999
+ Z.transition().duration(500).ease(L.easeLinear).style(h, Xt).style("transform", `${f}(1)`), setTimeout(() => {
8000
+ c = !1;
7983
8001
  }, 500);
7984
8002
  } else
7985
- o = !0, J.transition().duration(500).ease(x.easeLinear).style(c, "0rem").style("transform", `${h}(0)`), setTimeout(() => {
7986
- d = !1;
8003
+ d = !0, Z.transition().duration(500).ease(L.easeLinear).style(h, "0rem").style("transform", `${f}(0)`), setTimeout(() => {
8004
+ c = !1;
7987
8005
  }, 500);
7988
- }, k = Dt($t), N = () => {
7989
- k.zoomBy(k.zoomFactor);
7990
- }, R = () => {
7991
- k.zoomBy(1 / k.zoomFactor);
8006
+ }, I = Dt($t), R = () => {
8007
+ I.zoomBy(I.zoomFactor);
7992
8008
  }, P = () => {
7993
- k.center();
7994
- }, tt = () => {
7995
- k.layoutFormat && k.layoutFormat in _e && _e[k.layoutFormat].apply(k.model);
7996
- }, E = () => {
7997
- n = !n, x.select(
7998
- u.current
7999
- ).classed("daga-on", n).classed("daga-off", !n);
8000
- const J = k.getPriorityThresholdOptions();
8001
- J && J.length >= 2 && k.setPriorityThreshold(
8002
- J[n ? 1 : 0]
8003
- );
8009
+ I.zoomBy(1 / I.zoomFactor);
8010
+ }, et = () => {
8011
+ I.center(void 0, 1, e);
8012
+ }, T = () => {
8013
+ I.layoutFormat && I.layoutFormat in _e && _e[I.layoutFormat].apply(I.model);
8004
8014
  }, C = () => {
8005
- k.actionStack.undo();
8015
+ o = !o, L.select(
8016
+ v.current
8017
+ ).classed("daga-on", o).classed("daga-off", !o);
8018
+ const Z = I.getPriorityThresholdOptions();
8019
+ Z && Z.length >= 2 && I.setPriorityThreshold(
8020
+ Z[o ? 1 : 0]
8021
+ );
8006
8022
  }, O = () => {
8007
- k.actionStack.redo();
8008
- }, I = () => {
8009
- k.userSelection.copyToClipboard();
8023
+ I.actionStack.undo();
8024
+ }, x = () => {
8025
+ I.actionStack.redo();
8010
8026
  }, _ = () => {
8011
- k.userSelection.cutToClipboard();
8027
+ I.userSelection.copyToClipboard();
8012
8028
  }, lt = () => {
8013
- k.userSelection.pasteFromClipboard();
8014
- }, q = () => {
8015
- k.userSelection.removeFromModel();
8029
+ I.userSelection.cutToClipboard();
8030
+ }, J = () => {
8031
+ I.userSelection.pasteFromClipboard();
8016
8032
  }, Bt = () => {
8017
- k.multipleSelectionOn = !0, x.select(
8018
- p.current
8033
+ I.userSelection.removeFromModel();
8034
+ }, Pt = () => {
8035
+ I.multipleSelectionOn = !0, L.select(
8036
+ u.current
8019
8037
  ).classed("daga-on", !0).classed("daga-off", !1);
8020
- const J = k.diagramEvent$.subscribe((wt) => {
8021
- wt.type === Qe.Selection && (x.select(
8022
- p.current
8023
- ).classed("daga-on", !1).classed("daga-off", !0), J.unsubscribe());
8038
+ const Z = I.diagramEvent$.subscribe((Q) => {
8039
+ Q.type === Qe.Selection && (L.select(
8040
+ u.current
8041
+ ).classed("daga-on", !1).classed("daga-off", !0), Z.unsubscribe());
8024
8042
  });
8025
8043
  };
8026
- return /* @__PURE__ */ v("daga-diagram-buttons", { children: /* @__PURE__ */ T(
8044
+ return /* @__PURE__ */ y("daga-diagram-buttons", { children: /* @__PURE__ */ M(
8027
8045
  "div",
8028
8046
  {
8029
8047
  className: `daga-diagram-buttons daga-${s} daga-${t}`,
8030
8048
  children: [
8031
- i && k.canUserPerformAction(w.Zoom) && /* @__PURE__ */ v("button", { className: "daga-zoom-in", onClick: N, children: /* @__PURE__ */ v("span", { className: "daga-tooltip", children: "Zoom in" }) }),
8032
- i && k.canUserPerformAction(w.Zoom) && /* @__PURE__ */ v("button", { className: "daga-zoom-out", onClick: R, children: /* @__PURE__ */ v("span", { className: "daga-tooltip", children: "Zoom out" }) }),
8033
- /* @__PURE__ */ T("div", { className: "daga-collapsable-buttons daga-collapsed", ref: m, children: [
8034
- i && k.canUserPerformAction(w.Zoom) && /* @__PURE__ */ v("button", { className: "daga-center", onClick: P, children: /* @__PURE__ */ v("span", { className: "daga-tooltip", children: "Fit diagram to screen" }) }),
8035
- e && /* @__PURE__ */ v("button", { className: "daga-undo", onClick: C, children: /* @__PURE__ */ v("span", { className: "daga-tooltip", children: "Undo" }) }),
8036
- e && /* @__PURE__ */ v("button", { className: "daga-redo", onClick: O, children: /* @__PURE__ */ v("span", { className: "daga-tooltip", children: "Redo" }) }),
8037
- r && /* @__PURE__ */ v("button", { className: "daga-copy", onClick: I, children: /* @__PURE__ */ v("span", { className: "daga-tooltip", children: "Copy" }) }),
8038
- r && /* @__PURE__ */ v("button", { className: "daga-cut", onClick: _, children: /* @__PURE__ */ v("span", { className: "daga-tooltip", children: "Cut" }) }),
8039
- r && /* @__PURE__ */ v("button", { className: `daga-multiple-selection ${n ? "daga-on" : "daga-off"}`, onClick: Bt, ref: p, children: /* @__PURE__ */ v("span", { className: "daga-tooltip", children: "Multiple selection" }) }),
8040
- r && /* @__PURE__ */ v("button", { className: "daga-paste", onClick: lt, children: /* @__PURE__ */ v("span", { className: "daga-tooltip", children: "Paste" }) }),
8041
- r && /* @__PURE__ */ v("button", { className: "daga-delete", onClick: q, children: /* @__PURE__ */ v("span", { className: "daga-tooltip", children: "Delete" }) }),
8042
- l && k.layoutFormat && /* @__PURE__ */ v("button", { className: "daga-layout", onClick: tt, children: /* @__PURE__ */ v("span", { className: "daga-tooltip", children: "Apply layout" }) }),
8043
- a && /* @__PURE__ */ v("button", { className: `daga-filter ${n ? "daga-on" : "daga-off"}`, onClick: E, ref: u, children: /* @__PURE__ */ v("span", { className: "daga-tooltip", children: "Apply filter" }) })
8049
+ n && I.canUserPerformAction(k.Zoom) && /* @__PURE__ */ y("button", { className: "daga-zoom-in", onClick: R, children: /* @__PURE__ */ y("span", { className: "daga-tooltip", children: "Zoom in" }) }),
8050
+ n && I.canUserPerformAction(k.Zoom) && /* @__PURE__ */ y("button", { className: "daga-zoom-out", onClick: P, children: /* @__PURE__ */ y("span", { className: "daga-tooltip", children: "Zoom out" }) }),
8051
+ /* @__PURE__ */ M("div", { className: "daga-collapsable-buttons daga-collapsed", ref: p, children: [
8052
+ n && I.canUserPerformAction(k.Zoom) && /* @__PURE__ */ y("button", { className: "daga-center", onClick: et, children: /* @__PURE__ */ y("span", { className: "daga-tooltip", children: "Fit diagram to screen" }) }),
8053
+ a && /* @__PURE__ */ y("button", { className: "daga-undo", onClick: O, children: /* @__PURE__ */ y("span", { className: "daga-tooltip", children: "Undo" }) }),
8054
+ a && /* @__PURE__ */ y("button", { className: "daga-redo", onClick: x, children: /* @__PURE__ */ y("span", { className: "daga-tooltip", children: "Redo" }) }),
8055
+ i && /* @__PURE__ */ y("button", { className: "daga-copy", onClick: _, children: /* @__PURE__ */ y("span", { className: "daga-tooltip", children: "Copy" }) }),
8056
+ i && /* @__PURE__ */ y("button", { className: "daga-cut", onClick: lt, children: /* @__PURE__ */ y("span", { className: "daga-tooltip", children: "Cut" }) }),
8057
+ i && /* @__PURE__ */ y("button", { className: `daga-multiple-selection ${o ? "daga-on" : "daga-off"}`, onClick: Pt, ref: u, children: /* @__PURE__ */ y("span", { className: "daga-tooltip", children: "Multiple selection" }) }),
8058
+ i && /* @__PURE__ */ y("button", { className: "daga-paste", onClick: J, children: /* @__PURE__ */ y("span", { className: "daga-tooltip", children: "Paste" }) }),
8059
+ i && /* @__PURE__ */ y("button", { className: "daga-delete", onClick: Bt, children: /* @__PURE__ */ y("span", { className: "daga-tooltip", children: "Delete" }) }),
8060
+ r && I.layoutFormat && /* @__PURE__ */ y("button", { className: "daga-layout", onClick: T, children: /* @__PURE__ */ y("span", { className: "daga-tooltip", children: "Apply layout" }) }),
8061
+ l && /* @__PURE__ */ y("button", { className: `daga-filter ${o ? "daga-on" : "daga-off"}`, onClick: C, ref: v, children: /* @__PURE__ */ y("span", { className: "daga-tooltip", children: "Apply filter" }) })
8044
8062
  ] }),
8045
- /* @__PURE__ */ v("button", { className: "daga-more-options", onClick: y, children: o ? /* @__PURE__ */ v("span", { className: "daga-tooltip", children: "More options" }) : /* @__PURE__ */ v("span", { className: "daga-tooltip", children: "Less options" }) })
8063
+ /* @__PURE__ */ y("button", { className: "daga-more-options", onClick: w, children: d ? /* @__PURE__ */ y("span", { className: "daga-tooltip", children: "More options" }) : /* @__PURE__ */ y("span", { className: "daga-tooltip", children: "Less options" }) })
8046
8064
  ]
8047
8065
  }
8048
8066
  ) });
@@ -8071,15 +8089,15 @@ const Ie = ({
8071
8089
  }, u = {
8072
8090
  refreshPalette: () => {
8073
8091
  }
8074
- }, y = new Ii(
8075
- (E) => f(E),
8076
- (E) => m(E)
8077
- ), k = {
8092
+ }, v = new Ii(
8093
+ (T) => f(T),
8094
+ (T) => m(T)
8095
+ ), w = {
8078
8096
  diagramButtons: p,
8079
8097
  palette: u,
8080
- propertyEditor: y
8081
- }, N = (E = !1) => ((!o.current || E) && (c.forEach((C) => C.unsubscribe()), o.current = new we(k, s)), o.current), R = N(), P = (E) => {
8082
- R.initView(E), c.push(
8098
+ propertyEditor: v
8099
+ }, I = (T = !1) => ((!o.current || T) && (c.forEach((C) => C.unsubscribe()), o.current = new Se(w, s)), o.current), R = I(), P = (T) => {
8100
+ R.initView(T), c.push(
8083
8101
  R.diagramEvent$.subscribe((C) => {
8084
8102
  a?.(C);
8085
8103
  })
@@ -8090,31 +8108,32 @@ const Ie = ({
8090
8108
  })
8091
8109
  );
8092
8110
  };
8093
- Ct(() => {
8111
+ St(() => {
8094
8112
  n.current && (d.current || (P(n.current), d.current = !0, e?.(R)));
8095
8113
  }, [n.current]), po(() => {
8096
- n.current && (N(!0), P(n.current), e?.(R));
8097
- }, [s]), Ct(() => {
8114
+ n.current && (I(!0), P(n.current), e?.(R));
8115
+ }, [s]), St(() => {
8098
8116
  t && r.import(R.model, t);
8099
8117
  }, [t]);
8100
- const tt = (E, C, O) => {
8101
- if (b !== void 0 && C.editable !== !1 && !St(E.getValue(C.name), O)) {
8102
- E.setValue(C.name, O);
8103
- const I = new yt(
8118
+ const et = (T, C, O) => {
8119
+ if (b !== void 0 && C.editable !== !1 && !wt(T.getValue(C.name), O)) {
8120
+ T.setValue(C.name, O);
8121
+ const x = new yt(
8104
8122
  b.propertySet,
8105
8123
  void 0
8106
8124
  );
8107
- I.setValues(b.getValues()), I.rootElement = b.rootElement, y.valueSet = I, b.rootElement.valueSet = I, R.propertyEditorChanges$?.next();
8125
+ x.setValues(b.getValues()), x.rootElement = b.rootElement, v.valueSet = x, b.rootElement.valueSet = x, R.propertyEditorChanges$?.next();
8108
8126
  }
8109
8127
  };
8110
- return /* @__PURE__ */ v("daga-diagram", { children: /* @__PURE__ */ v(Ai.Provider, { value: s, children: /* @__PURE__ */ v($t.Provider, { value: R, children: /* @__PURE__ */ T("daga-diagram-editor", { children: [
8111
- /* @__PURE__ */ v("div", { className: "daga-append-to", ref: n }),
8112
- /* @__PURE__ */ T($t.Provider, { value: R, children: [
8113
- s.components?.buttons !== void 0 && s.components?.buttons?.enabled !== !1 && /* @__PURE__ */ v(
8128
+ return /* @__PURE__ */ y("daga-diagram", { children: /* @__PURE__ */ y(Ai.Provider, { value: s, children: /* @__PURE__ */ y($t.Provider, { value: R, children: /* @__PURE__ */ M("daga-diagram-editor", { children: [
8129
+ /* @__PURE__ */ y("div", { className: "daga-append-to", ref: n }),
8130
+ /* @__PURE__ */ M($t.Provider, { value: R, children: [
8131
+ s.components?.buttons !== void 0 && s.components?.buttons?.enabled !== !1 && /* @__PURE__ */ y(
8114
8132
  Oi,
8115
8133
  {
8116
8134
  location: s.components?.buttons?.location || Kt.BottomRight,
8117
8135
  direction: s.components?.buttons?.direction || g.Top,
8136
+ centerAnimationDuration: s.components?.buttons?.centerAnimationDuration,
8118
8137
  enableAction: s.components?.buttons?.enableAction !== !1,
8119
8138
  enableFilter: s.components?.buttons?.enableFilter === !0,
8120
8139
  enableLayout: s.components?.buttons?.enableLayout === !0,
@@ -8122,7 +8141,7 @@ const Ie = ({
8122
8141
  enableZoom: s.components?.buttons?.enableZoom !== !1
8123
8142
  }
8124
8143
  ),
8125
- s.components?.palette !== void 0 && s.components?.palette?.enabled !== !1 && s.components?.palette?.sections && (s.components?.palette?.sections?.length || 0) > 0 && /* @__PURE__ */ v(
8144
+ s.components?.palette !== void 0 && s.components?.palette?.enabled !== !1 && s.components?.palette?.sections && (s.components?.palette?.sections?.length || 0) > 0 && /* @__PURE__ */ y(
8126
8145
  Vi,
8127
8146
  {
8128
8147
  location: s.components?.palette?.location || Kt.TopLeft,
@@ -8132,7 +8151,7 @@ const Ie = ({
8132
8151
  palettes: s.components?.palette?.sections || []
8133
8152
  }
8134
8153
  ),
8135
- s.components?.propertyEditor !== void 0 && s.components?.propertyEditor?.enabled !== !1 && /* @__PURE__ */ v(
8154
+ s.components?.propertyEditor !== void 0 && s.components?.propertyEditor?.enabled !== !1 && /* @__PURE__ */ y(
8136
8155
  zi,
8137
8156
  {
8138
8157
  location: s.components?.propertyEditor?.location || Kt.TopRight,
@@ -8141,10 +8160,10 @@ const Ie = ({
8141
8160
  height: s.components?.propertyEditor?.height,
8142
8161
  title: h,
8143
8162
  valueSet: b,
8144
- onValueChange: tt
8163
+ onValueChange: et
8145
8164
  }
8146
8165
  ),
8147
- s.components?.errors !== void 0 && s.components?.errors?.enabled !== !1 && /* @__PURE__ */ v(xi, {})
8166
+ s.components?.errors !== void 0 && s.components?.errors?.enabled !== !1 && /* @__PURE__ */ y(xi, {})
8148
8167
  ] })
8149
8168
  ] }) }) }) });
8150
8169
  };