@metadev/daga-react 4.2.6 → 4.2.7

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,8 +1,8 @@
1
1
  import { jsx as v, jsxs as $, Fragment as ni } from "react/jsx-runtime";
2
- import * as E from "d3";
2
+ import * as L from "d3";
3
3
  import { debounceTime as ri, Subject as Yt, merge as ai, map as li } from "rxjs";
4
- import { createContext as Ve, useState as H, useContext as Ht, useRef as rt, useEffect as Ct, useMemo as ci } from "react";
5
- var u = /* @__PURE__ */ ((o) => (o.Bottom = "bottom", o.Left = "left", o.Right = "right", o.Top = "top", o))(u || {}), jt = /* @__PURE__ */ ((o) => (o.BottomLeft = "bottom-left", o.BottomRight = "bottom-right", o.TopLeft = "top-left", o.TopRight = "top-right", o))(jt || {}), Tt = /* @__PURE__ */ ((o) => (o.Left = "left", o.Center = "center", o.Right = "right", o))(Tt || {}), Zt = /* @__PURE__ */ ((o) => (o.Top = "top", o.Center = "center", o.Bottom = "bottom", o))(Zt || {});
4
+ import { createContext as Ve, useState as B, useContext as Ht, useRef as rt, useEffect as Ct, useMemo as ci } from "react";
5
+ var u = /* @__PURE__ */ ((o) => (o.Bottom = "bottom", o.Left = "left", o.Right = "right", o.Top = "top", o))(u || {}), jt = /* @__PURE__ */ ((o) => (o.BottomLeft = "bottom-left", o.BottomRight = "bottom-right", o.TopLeft = "top-left", o.TopRight = "top-right", o))(jt || {}), Et = /* @__PURE__ */ ((o) => (o.Left = "left", o.Center = "center", o.Right = "right", o))(Et || {}), Zt = /* @__PURE__ */ ((o) => (o.Top = "top", o.Center = "center", o.Bottom = "bottom", o))(Zt || {});
6
6
  const xt = (o) => [Math.round(o[0]), Math.round(o[1])], ft = (o, t, e) => t < e ? t <= o && o <= e : e <= o && o <= t, Ie = (o, t, e) => (o - t[0]) / (t[1] - t[0]) * (e[1] - e[0]) + e[0], Kt = (o, t, e, n, l, a, i) => {
7
7
  const s = (() => {
8
8
  switch (a) {
@@ -241,7 +241,7 @@ const hi = 20, gi = (o, t, e, n, l) => {
241
241
  default:
242
242
  return "none";
243
243
  }
244
- }, U = (o, t) => {
244
+ }, Y = (o, t) => {
245
245
  const e = o.indexOf(t);
246
246
  return e >= 0 && o.splice(e, 1), o;
247
247
  };
@@ -274,7 +274,7 @@ const me = (o, t, e, n, l) => {
274
274
  return Ae(t, e, n, l);
275
275
  }
276
276
  }, De = (o, t, e, n) => `M ${o + e / 2} ${t} A ${e / 2} ${n / 2} 0 0 0 ${o + e / 2} ${t + n} A ${e / 2} ${n / 2} 0 1 0 ${o + e / 2} ${t} Z`, ui = () => "Z", fi = (o, t, e, n) => `M ${o} ${t} L ${o + e / 3} ${t} L ${o + e / 2} ${t + n / 6} L ${o + e} ${t + n / 6} L ${o + e} ${t + n} L ${o} ${t + n} Z`, mi = (o, t, e, n) => `M ${o + e / 4} ${t} L ${o + 3 * e / 4} ${t} L ${o + e} ${t + n / 2} L ${o + 3 * e / 4} ${t + n} L ${o + e / 4} ${t + n} L ${o} ${t + n / 2} Z`, pi = (o, t, e, n) => `M ${o + e / 4} ${t} L ${o + 3 * e / 4} ${t} L ${o + e} ${t + n / 4} L ${o + e} ${t + 3 * n / 4} L ${o + 3 * e / 4} ${t + n} L ${o + e / 4} ${t + n} L ${o} ${t + 3 * n / 4} L ${o} ${t + n / 4} L ${o + e / 4} ${t} Z`, Wt = (o, t, e, n) => n < e ? `M ${o + n / 2} ${t} L ${o + e - n / 2} ${t} A ${n / 2} ${n / 2} 0 0 1 ${o + e} ${t + n / 2} A ${n / 2} ${n / 2} 0 0 1 ${o + e - n / 2} ${t + n} L ${o + n / 2} ${t + n} A ${n / 2} ${n / 2} 0 0 1 ${o} ${t + n / 2} A ${n / 2} ${n / 2} 0 0 1 ${o + n / 2} ${t} Z` : n > e ? `M ${o} ${t + e / 2} L ${o} ${t + n - e / 2} A ${e / 2} ${e / 2} 0 0 0 ${o + e / 2} ${t + n} A ${e / 2} ${e / 2} 0 0 0 ${o + e} ${t + n - e / 2} L ${o + e} ${t + e / 2} A ${e / 2} ${e / 2} 0 0 0 ${o + e / 2} ${t} A ${e / 2} ${e / 2} 0 0 0 ${o} ${t + e / 2} Z` : De(o, t, e, n), Ae = (o, t, e, n) => `M ${o} ${t} L ${o + e} ${t} L ${o + e} ${t + n} L ${o} ${t + n} Z`, vi = (o, t, e, n) => `M ${o + e / 2} ${t} L ${o + e} ${t + n / 2} L ${o + e / 2} ${t + n} L ${o} ${t + n / 2} Z`, yi = (o, t, e, n) => `M ${o + e / 4} ${t} L ${o + 3 * e / 4} ${t} A ${e / 4} ${n / 4} 0 0 1 ${o + e} ${t + n / 4} L ${o + e} ${t + 3 * n / 4} A ${e / 4} ${n / 4} 0 0 1 ${o + 3 * e / 4} ${t + n} L ${o + e / 4} ${t + n} A ${e / 4} ${n / 4} 0 0 1 ${o} ${t + 3 * n / 4} L ${o} ${t + n / 4} A ${e / 4} ${n / 4} 0 0 1 ${o + e / 4} ${t} Z`, bi = (o, t, e, n) => `M ${o} ${t} L ${o + 3 * e / 4} ${t} L ${o + 3 * e / 4} ${t + n / 4} L ${o + 3 * e / 4} ${t} L ${o + e} ${t + n / 4} L ${o + 3 * e / 4} ${t + n / 4} L ${o + e} ${t + n / 4} L ${o + e} ${t + n} L ${o} ${t + n} Z`;
277
- var T = /* @__PURE__ */ ((o) => (o.AllScroll = "all-scroll", o.Auto = "auto", o.Crosshair = "crosshair", o.EWResize = "ew-resize", o.Grab = "grab", o.Grabbing = "grabbing", o.Move = "move", o.NoDrop = "no-drop", o.NSResize = "ns-resize", o.NotAllowed = "not-allowed", o.ZoomIn = "zoom-in", o.ZoomOut = "zoom-out", o))(T || {});
277
+ var E = /* @__PURE__ */ ((o) => (o.AllScroll = "all-scroll", o.Auto = "auto", o.Crosshair = "crosshair", o.EWResize = "ew-resize", o.Grab = "grab", o.Grabbing = "grabbing", o.Move = "move", o.NoDrop = "no-drop", o.NSResize = "ns-resize", o.NotAllowed = "not-allowed", o.ZoomIn = "zoom-in", o.ZoomOut = "zoom-out", o))(E || {});
278
278
  const ki = (o) => Math.max(...o.split(`
279
279
  `).map((t) => t.length)), wi = (o) => o.match(/\n/g)?.length || 0, W = [];
280
280
  for (let o = 0; o < 256; ++o)
@@ -293,7 +293,7 @@ function Ii() {
293
293
  return ne(Ci);
294
294
  }
295
295
  const Ai = typeof crypto < "u" && crypto.randomUUID && crypto.randomUUID.bind(crypto), xe = { randomUUID: Ai };
296
- function Ee(o, t, e) {
296
+ function Le(o, t, e) {
297
297
  if (xe.randomUUID && !o)
298
298
  return xe.randomUUID();
299
299
  o = o || {};
@@ -302,7 +302,7 @@ function Ee(o, t, e) {
302
302
  throw new Error("Random bytes length must be >= 16");
303
303
  return n[6] = n[6] & 15 | 64, n[8] = n[8] & 63 | 128, Si(n);
304
304
  }
305
- const it = (o) => {
305
+ const ot = (o) => {
306
306
  const { selected: t, highlighted: e, ...n } = o, l = n, a = {
307
307
  ...l,
308
308
  ...t
@@ -414,7 +414,7 @@ class Jt {
414
414
  */
415
415
  remove(t) {
416
416
  const e = this.get(t);
417
- e !== void 0 && (delete this.entityMap[t], U(this.entities, e));
417
+ e !== void 0 && (delete this.entityMap[t], Y(this.entities, e));
418
418
  }
419
419
  /**
420
420
  * Gets the number of entities in this set.
@@ -489,7 +489,7 @@ class ut extends Jt {
489
489
  }
490
490
  remove(t) {
491
491
  const e = this.get(t, !0);
492
- e !== void 0 && (delete this.entityMap[t], U(this.entities, e));
492
+ e !== void 0 && (delete this.entityMap[t], Y(this.entities, e));
493
493
  }
494
494
  size(t = !1) {
495
495
  return t ? super.size() : super.filter((e) => !e.removed).length;
@@ -528,7 +528,7 @@ class Qt {
528
528
  function kt(o, t) {
529
529
  return !t || o[0] > t[0] ? !0 : o[0] === t[0] ? o[1] >= t[1] : !1;
530
530
  }
531
- const Te = (o) => o == null || o === "" || o instanceof Array && o.length === 0 || o instanceof Object && Object.keys(o).length === 0, St = (o, t) => o === t || JSON.stringify(o) === JSON.stringify(t), Fe = (o, t, e) => {
531
+ const Ee = (o) => o == null || o === "" || o instanceof Array && o.length === 0 || o instanceof Object && Object.keys(o).length === 0, St = (o, t) => o === t || JSON.stringify(o) === JSON.stringify(t), Fe = (o, t, e) => {
532
532
  const n = {}, l = {};
533
533
  for (const a in e.propertySet.propertyMap)
534
534
  if (e.propertySet.propertyMap[a].type === N.Object) {
@@ -541,7 +541,7 @@ const Te = (o) => o == null || o === "" || o instanceof Array && o.length === 0
541
541
  } else
542
542
  St(o[a], t[a]) || (n[a] = o[a], l[a] = t[a]);
543
543
  return [n, l];
544
- }, Ei = (o) => o != null && o.constructor === Object;
544
+ }, Li = (o) => o != null && o.constructor === Object;
545
545
  class yt {
546
546
  constructor(t, e) {
547
547
  this.displayedProperties = [], this.hiddenProperties = [], this.values = {}, this.valueSets = {}, this.ownTimestamps = {}, this.propertySet = t, this.rootElement = e, this.resetValues();
@@ -653,7 +653,7 @@ class yt {
653
653
  */
654
654
  hasValue(t) {
655
655
  const e = this.getValue(t);
656
- return !Te(e);
656
+ return !Ee(e);
657
657
  }
658
658
  /**
659
659
  * Checks if the value under the key is not empty or the default value.
@@ -663,7 +663,7 @@ class yt {
663
663
  */
664
664
  hasSetValue(t) {
665
665
  const e = this.getValue(t), n = this.propertySet.getProperty(t);
666
- return n && n.type === N.Object ? this.getSubValueSet(t).hasAnySetValue() : !Te(e) && !St(e, n?.defaultValue);
666
+ return n && n.type === N.Object ? this.getSubValueSet(t).hasAnySetValue() : !Ee(e) && !St(e, n?.defaultValue);
667
667
  }
668
668
  /**
669
669
  * Checks if any of the values in the set are not empty or the default value.
@@ -779,7 +779,7 @@ class yt {
779
779
  * @param property A property.
780
780
  */
781
781
  displayProperty(t) {
782
- this.displayedProperties.includes(t) || (this.displayedProperties.push(t), U(this.hiddenProperties, t));
782
+ this.displayedProperties.includes(t) || (this.displayedProperties.push(t), Y(this.hiddenProperties, t));
783
783
  }
784
784
  /**
785
785
  * Moves the given property to the list of hidden properties.
@@ -787,10 +787,10 @@ class yt {
787
787
  * @param property A property.
788
788
  */
789
789
  hideProperty(t) {
790
- this.hiddenProperties.includes(t) || (this.hiddenProperties.push(t), U(this.displayedProperties, t));
790
+ this.hiddenProperties.includes(t) || (this.hiddenProperties.push(t), Y(this.displayedProperties, t));
791
791
  }
792
792
  }
793
- const Q = {
793
+ const tt = {
794
794
  name: "",
795
795
  label: null,
796
796
  look: {
@@ -815,20 +815,20 @@ const Q = {
815
815
  class He {
816
816
  constructor(t) {
817
817
  const e = {
818
- ...Q,
818
+ ...tt,
819
819
  ...t
820
820
  };
821
821
  this.id = e.id, this.name = e.name, this.label = e.label;
822
- const n = it(e.look);
822
+ const n = ot(e.look);
823
823
  if (this.defaultLook = n.defaultLook, this.selectedLook = n.selectedLook, this.highlightedLook = n.highlightedLook, this.selectedAndHighlightedLook = n.selectedAndHighlightedLook, e.startMarkerLook !== void 0) {
824
- const l = it(
824
+ const l = ot(
825
825
  e.startMarkerLook
826
826
  );
827
827
  this.defaultStartMarkerLook = l.defaultLook, this.selectedStartMarkerLook = l.selectedLook, this.highlightedStartMarkerLook = l.highlightedLook, this.selectedAndHighlightedStartMarkerLook = l.selectedAndHighlightedLook;
828
828
  } else
829
829
  this.defaultStartMarkerLook = null, this.selectedStartMarkerLook = null, this.highlightedStartMarkerLook = null, this.selectedAndHighlightedStartMarkerLook = null;
830
830
  if (e.endMarkerLook !== void 0) {
831
- const l = it(
831
+ const l = ot(
832
832
  e.endMarkerLook
833
833
  );
834
834
  this.defaultEndMarkerLook = l.defaultLook, this.selectedEndMarkerLook = l.selectedLook, this.highlightedEndMarkerLook = l.highlightedLook, this.selectedAndHighlightedEndMarkerLook = l.selectedAndHighlightedLook;
@@ -890,7 +890,7 @@ class ct extends At {
890
890
  */
891
891
  set look(t) {
892
892
  if (t) {
893
- const e = it(t);
893
+ const e = ot(t);
894
894
  this._defaultLook = {
895
895
  ...this._defaultLook,
896
896
  ...e.defaultLook
@@ -921,7 +921,7 @@ class ct extends At {
921
921
  */
922
922
  set startMarkerLook(t) {
923
923
  if (t) {
924
- const e = it(t);
924
+ const e = ot(t);
925
925
  this._defaultStartMarkerLook = {
926
926
  ...this._defaultStartMarkerLook,
927
927
  ...e.defaultLook
@@ -952,7 +952,7 @@ class ct extends At {
952
952
  */
953
953
  set endMarkerLook(t) {
954
954
  if (t) {
955
- const e = it(t);
955
+ const e = ot(t);
956
956
  this._defaultEndMarkerLook = {
957
957
  ...this._defaultEndMarkerLook,
958
958
  ...e.defaultLook
@@ -985,7 +985,7 @@ class ct extends At {
985
985
  * @param start A port.
986
986
  */
987
987
  setStart(t) {
988
- this.start !== t ? (this.start !== void 0 && U(this.start.outgoingConnections, this), this.start = t, t !== void 0 && (t.outgoingConnections.push(this), this.startDirection = t?.direction, this.startCoords = t?.connectionPoint || [0, 0])) : (this.startDirection = t?.direction, this.startCoords = t?.connectionPoint || [0, 0]), this.updateInView();
988
+ this.start !== t ? (this.start !== void 0 && Y(this.start.outgoingConnections, this), this.start = t, t !== void 0 && (t.outgoingConnections.push(this), this.startDirection = t?.direction, this.startCoords = t?.connectionPoint || [0, 0])) : (this.startDirection = t?.direction, this.startCoords = t?.connectionPoint || [0, 0]), this.updateInView();
989
989
  }
990
990
  /**
991
991
  * Set the end of this connection to the given port or reset this connection's ending port if `undefined`.
@@ -994,7 +994,7 @@ class ct extends At {
994
994
  * @param end A port.
995
995
  */
996
996
  setEnd(t) {
997
- this.end !== t ? (this.end !== void 0 && U(this.end.incomingConnections, this), this.end = t, t !== void 0 && (t.incomingConnections.push(this), this.endDirection = t?.direction, this.endCoords = t?.connectionPoint || [0, 0])) : (this.endDirection = t?.direction, this.endCoords = t?.connectionPoint || [0, 0]), this.updateInView();
997
+ this.end !== t ? (this.end !== void 0 && Y(this.end.incomingConnections, this), this.end = t, t !== void 0 && (t.incomingConnections.push(this), this.endDirection = t?.direction, this.endCoords = t?.connectionPoint || [0, 0])) : (this.endDirection = t?.direction, this.endCoords = t?.connectionPoint || [0, 0]), this.updateInView();
998
998
  }
999
999
  /**
1000
1000
  * Reassign the start and end ports of this connection to ports with less distance between them that have the same root element.
@@ -1052,7 +1052,7 @@ class ct extends At {
1052
1052
  return this.start ? this.end ? Math.min(this.start.getPriority(), this.end.getPriority()) : this.start.getPriority() : this.end ? this.end.getPriority() : Mt;
1053
1053
  }
1054
1054
  }
1055
- class Ti extends ut {
1055
+ class Ei extends ut {
1056
1056
  /**
1057
1057
  * Instance a set of connections for the given model. This method is used internally.
1058
1058
  * @private
@@ -1092,7 +1092,7 @@ class Ti extends ut {
1092
1092
  }
1093
1093
  remove(t) {
1094
1094
  const e = this.get(t, !0);
1095
- e && (U(e.start?.outgoingConnections || [], e), U(e.end?.incomingConnections || [], e), super.remove(t), e.updateInView());
1095
+ e && (Y(e.start?.outgoingConnections || [], e), Y(e.end?.incomingConnections || [], e), super.remove(t), e.updateInView());
1096
1096
  }
1097
1097
  }
1098
1098
  const V = {
@@ -1104,7 +1104,7 @@ const V = {
1104
1104
  color: "#000000",
1105
1105
  selectedColor: "#000000",
1106
1106
  backgroundColor: "#00000000",
1107
- horizontalAlign: Tt.Center,
1107
+ horizontalAlign: Et.Center,
1108
1108
  verticalAlign: Zt.Center,
1109
1109
  orientation: u.Top,
1110
1110
  fit: !1,
@@ -1112,10 +1112,10 @@ const V = {
1112
1112
  };
1113
1113
  class ht extends At {
1114
1114
  constructor(t, e, n, l, a, i, s, r, c, d, h, g, y, m, p, f) {
1115
- const b = `${e?.id}_field`;
1116
- if (t.fields.get(b) !== void 0)
1115
+ const k = `${e?.id}_field`;
1116
+ if (t.fields.get(k) !== void 0)
1117
1117
  throw new Error("DiagramField for rootElement already exists");
1118
- if (super(t, b), this.textTimestamp = null, this.rootElement = e, this.coords = n, this.width = l, this.height = a, this.fontSize = i, this.fontFamily = s, this.color = r, this.selectedColor = c, this.horizontalAlign = d, this.verticalAlign = h, !isNaN(Number(g)))
1118
+ if (super(t, k), this.textTimestamp = null, this.rootElement = e, this.coords = n, this.width = l, this.height = a, this.fontSize = i, this.fontFamily = s, this.color = r, this.selectedColor = c, this.horizontalAlign = d, this.verticalAlign = h, !isNaN(Number(g)))
1119
1119
  this.orientation = Number(g);
1120
1120
  else
1121
1121
  switch (g) {
@@ -1167,7 +1167,7 @@ class ht extends At {
1167
1167
  return this.rootElement?.getPriority() || Mt;
1168
1168
  }
1169
1169
  }
1170
- class Li extends ut {
1170
+ class Ti extends ut {
1171
1171
  /**
1172
1172
  * Instance a set of fields for the given model. This method is used internally.
1173
1173
  * @private
@@ -1205,7 +1205,7 @@ class Li extends ut {
1205
1205
  e && (e.rootElement?.label !== void 0 && e.rootElement.label === e && (e.rootElement.label = void 0), super.remove(t), e.updateInView());
1206
1206
  }
1207
1207
  }
1208
- const tt = (o) => o?.margin === null || o?.margin === void 0 ? V.margin : typeof o.margin == "number" ? o.margin : o.margin.length === 0 ? V.margin : o.margin.length === 1 || o.margin.length === 2 ? o.margin[0] : (o.margin.length === 3, o.margin[2]), j = (o) => o?.margin === null || o?.margin === void 0 ? V.margin : typeof o.margin == "number" ? o.margin : o.margin.length === 0 ? V.margin : o.margin.length === 1 ? o.margin[0] : o.margin.length === 2 || o.margin.length === 3 ? o.margin[1] : o.margin[3], nt = (o) => o?.margin === null || o?.margin === void 0 ? V.margin : typeof o.margin == "number" ? o.margin : o.margin.length === 0 ? V.margin : o.margin.length === 1 ? o.margin[0] : (o.margin.length === 2 || o.margin.length === 3, o.margin[1]), G = (o) => o?.margin === null || o?.margin === void 0 ? V.margin : typeof o.margin == "number" ? o.margin : o.margin.length === 0 ? V.margin : (o.margin.length === 1 || o.margin.length === 2 || o.margin.length === 3, o.margin[0]), Rt = (o) => o?.padding === null || o?.padding === void 0 ? V.padding : typeof o.padding == "number" ? o.padding : o.padding.length === 0 ? V.padding : o.padding.length === 1 || o.padding.length === 2 ? o.padding[0] : (o.padding.length === 3, o.padding[2]), Vt = (o) => o?.padding === null || o?.padding === void 0 ? V.padding : typeof o.padding == "number" ? o.padding : o.padding.length === 0 ? V.padding : o.padding.length === 1 ? o.padding[0] : o.padding.length === 2 || o.padding.length === 3 ? o.padding[1] : o.padding[3], Ot = (o) => o?.padding === null || o?.padding === void 0 ? V.padding : typeof o.padding == "number" ? o.padding : o.padding.length === 0 ? V.padding : o.padding.length === 1 ? o.padding[0] : (o.padding.length === 2 || o.padding.length === 3, o.padding[1]), _t = (o) => o?.padding === null || o?.padding === void 0 ? V.padding : typeof o.padding == "number" ? o.padding : o.padding.length === 0 ? V.padding : (o.padding.length === 1 || o.padding.length === 2 || o.padding.length === 3, o.padding[0]), Le = 1, $e = 1, $i = 1, Ni = 1;
1208
+ const K = (o) => o?.margin === null || o?.margin === void 0 ? V.margin : typeof o.margin == "number" ? o.margin : o.margin.length === 0 ? V.margin : o.margin.length === 1 || o.margin.length === 2 ? o.margin[0] : (o.margin.length === 3, o.margin[2]), U = (o) => o?.margin === null || o?.margin === void 0 ? V.margin : typeof o.margin == "number" ? o.margin : o.margin.length === 0 ? V.margin : o.margin.length === 1 ? o.margin[0] : o.margin.length === 2 || o.margin.length === 3 ? o.margin[1] : o.margin[3], et = (o) => o?.margin === null || o?.margin === void 0 ? V.margin : typeof o.margin == "number" ? o.margin : o.margin.length === 0 ? V.margin : o.margin.length === 1 ? o.margin[0] : (o.margin.length === 2 || o.margin.length === 3, o.margin[1]), H = (o) => o?.margin === null || o?.margin === void 0 ? V.margin : typeof o.margin == "number" ? o.margin : o.margin.length === 0 ? V.margin : (o.margin.length === 1 || o.margin.length === 2 || o.margin.length === 3, o.margin[0]), Rt = (o) => o?.padding === null || o?.padding === void 0 ? V.padding : typeof o.padding == "number" ? o.padding : o.padding.length === 0 ? V.padding : o.padding.length === 1 || o.padding.length === 2 ? o.padding[0] : (o.padding.length === 3, o.padding[2]), Vt = (o) => o?.padding === null || o?.padding === void 0 ? V.padding : typeof o.padding == "number" ? o.padding : o.padding.length === 0 ? V.padding : o.padding.length === 1 ? o.padding[0] : o.padding.length === 2 || o.padding.length === 3 ? o.padding[1] : o.padding[3], Ot = (o) => o?.padding === null || o?.padding === void 0 ? V.padding : typeof o.padding == "number" ? o.padding : o.padding.length === 0 ? V.padding : o.padding.length === 1 ? o.padding[0] : (o.padding.length === 2 || o.padding.length === 3, o.padding[1]), _t = (o) => o?.padding === null || o?.padding === void 0 ? V.padding : typeof o.padding == "number" ? o.padding : o.padding.length === 0 ? V.padding : (o.padding.length === 1 || o.padding.length === 2 || o.padding.length === 3, o.padding[0]), Te = 1, $e = 1, $i = 1, Ni = 1;
1209
1209
  class Mi {
1210
1210
  constructor(t) {
1211
1211
  this.margin = t.margin || 0, this.defaultWidths = t.defaultWidths || null, this.defaultHeights = t.defaultHeights || null, this.minWidths = t.minWidths || null, this.minHeights = t.minHeights || null, this.sections = [];
@@ -1220,11 +1220,11 @@ class Mi {
1220
1220
  class Pi {
1221
1221
  constructor(t) {
1222
1222
  this.label = t.label || null, this.ports = t.ports || [], this.priority = t.priority || Mt, this.resizableX = t.resizableX, this.resizableY = t.resizableY;
1223
- const e = it(t.look || Be);
1223
+ const e = ot(t.look || Be);
1224
1224
  this.defaultLook = e.defaultLook, this.selectedLook = e.selectedLook, this.highlightedLook = e.highlightedLook, this.selectedAndHighlightedLook = e.selectedAndHighlightedLook;
1225
1225
  }
1226
1226
  }
1227
- class B extends At {
1227
+ class G extends At {
1228
1228
  constructor(t, e, n, l, a, i, s, r) {
1229
1229
  if (t.sections.get(r) !== void 0)
1230
1230
  throw new Error(`DiagramSection with id "${r}" already exists`);
@@ -1256,7 +1256,7 @@ class B extends At {
1256
1256
  */
1257
1257
  set look(t) {
1258
1258
  if (t) {
1259
- const e = it(t);
1259
+ const e = ot(t);
1260
1260
  this._defaultLook = {
1261
1261
  ...this._defaultLook,
1262
1262
  ...e.defaultLook
@@ -1448,9 +1448,9 @@ class B extends At {
1448
1448
  );
1449
1449
  const i = this.type;
1450
1450
  this.label && (this.label.coords = [
1451
- this.coords[0] + j(i?.label),
1452
- this.coords[1] + G(i?.label)
1453
- ], this.label.width = this.width - j(i?.label) - nt(i?.label), this.label.height = this.height - G(i?.label) - tt(i?.label), this.label.updateInView());
1451
+ this.coords[0] + U(i?.label),
1452
+ this.coords[1] + H(i?.label)
1453
+ ], this.label.width = this.width - U(i?.label) - et(i?.label), this.label.height = this.height - H(i?.label) - K(i?.label), this.label.updateInView());
1454
1454
  for (const s of this.decorators)
1455
1455
  s.move(
1456
1456
  Kt(
@@ -1479,7 +1479,7 @@ class zi extends ut {
1479
1479
  * @private
1480
1480
  */
1481
1481
  new(t, e, n, l, a, i, s) {
1482
- const r = new B(
1482
+ const r = new G(
1483
1483
  this.model,
1484
1484
  t,
1485
1485
  e,
@@ -1514,28 +1514,28 @@ class zi extends ut {
1514
1514
  ...V,
1515
1515
  ...y.type?.label
1516
1516
  }, p = 6 * m.fontSize + Vt(m) + Ot(m), f = m.fontSize + _t(m) + Rt(m);
1517
- let b;
1517
+ let k;
1518
1518
  switch (y.direction) {
1519
1519
  case u.Bottom:
1520
1520
  case u.Left:
1521
1521
  case u.Right:
1522
- b = [
1522
+ k = [
1523
1523
  y.coords[0] - p / 2,
1524
- y.coords[1] - f - tt(m)
1524
+ y.coords[1] - f - K(m)
1525
1525
  ];
1526
1526
  break;
1527
1527
  case u.Top:
1528
- b = [
1528
+ k = [
1529
1529
  y.coords[0] - p / 2,
1530
- y.coords[1] + G(m)
1530
+ y.coords[1] + H(m)
1531
1531
  ];
1532
1532
  break;
1533
1533
  default:
1534
- b = y.coords;
1534
+ k = y.coords;
1535
1535
  }
1536
1536
  this.model.fields.new(
1537
1537
  y,
1538
- b,
1538
+ k,
1539
1539
  m.fontSize,
1540
1540
  m.fontFamily,
1541
1541
  m.color,
@@ -1561,15 +1561,15 @@ class zi extends ut {
1561
1561
  this.model.fields.new(
1562
1562
  r,
1563
1563
  [
1564
- r.coords[0] + j(h),
1565
- r.coords[1] + G(h)
1564
+ r.coords[0] + U(h),
1565
+ r.coords[1] + H(h)
1566
1566
  ],
1567
1567
  h.fontSize,
1568
1568
  h.fontFamily,
1569
1569
  h.color,
1570
1570
  h.selectedColor,
1571
- r.width - j(h) - nt(h),
1572
- r.height - G(h) - tt(h),
1571
+ r.width - U(h) - et(h),
1572
+ r.height - H(h) - K(h),
1573
1573
  h.horizontalAlign,
1574
1574
  h.verticalAlign,
1575
1575
  h.orientation,
@@ -1586,7 +1586,7 @@ class zi extends ut {
1586
1586
  if (e) {
1587
1587
  for (; e.ports.length > 0; )
1588
1588
  this.model.ports.remove(e.ports[0].id);
1589
- e.label && this.model.fields.remove(e.label.id), e.node && U(e.node.sections, e), super.remove(t), e.updateInView();
1589
+ e.label && this.model.fields.remove(e.label.id), e.node && Y(e.node.sections, e), super.remove(t), e.updateInView();
1590
1590
  }
1591
1591
  }
1592
1592
  }
@@ -1630,7 +1630,7 @@ class Ge {
1630
1630
  ...t
1631
1631
  };
1632
1632
  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.bottomPadding = Vi(e), this.leftPadding = Oi(e), this.rightPadding = _i(e), this.topPadding = Di(e), this.label = e.label, this.ports = e.ports, this.decorators = e.decorators, this.sectionGrid = e.sectionGrid ? new Mi(e.sectionGrid) : null;
1633
- const n = it(e.look);
1633
+ const n = ot(e.look);
1634
1634
  this.defaultLook = n.defaultLook, this.selectedLook = n.selectedLook, this.highlightedLook = n.highlightedLook, this.selectedAndHighlightedLook = n.selectedAndHighlightedLook, this.isUnique = e.isUnique, this.canBeParentless = e.canBeParentless, this.childrenTypes = e.childrenTypes, this.priority = e.priority, this.propertySet = new Qt(t?.properties || []);
1635
1635
  }
1636
1636
  }
@@ -1681,7 +1681,7 @@ class z extends At {
1681
1681
  */
1682
1682
  set look(t) {
1683
1683
  if (t) {
1684
- const e = it(t);
1684
+ const e = ot(t);
1685
1685
  this._defaultLook = {
1686
1686
  ...this._defaultLook,
1687
1687
  ...e.defaultLook
@@ -1852,7 +1852,7 @@ class z extends At {
1852
1852
  n || this.children.indexOf(t) >= 0 || (this.fitToChild(t), this.children.push(t), t.parent = this, t.raise());
1853
1853
  }
1854
1854
  removeChild(t) {
1855
- U(this.children, t), t.parent = void 0;
1855
+ Y(this.children, t), t.parent = void 0;
1856
1856
  }
1857
1857
  fitToChild(t) {
1858
1858
  const e = Math.max(
@@ -2054,9 +2054,9 @@ class z extends At {
2054
2054
  )
2055
2055
  );
2056
2056
  this.label && (this.label.coords = [
2057
- this.coords[0] + j(this.type.label),
2058
- this.coords[1] + G(this.type.label)
2059
- ], this.label.width = this.width - j(this.type.label) - nt(this.type.label), this.label.height = this.height - G(this.type.label) - tt(this.type.label), this.label.updateInView());
2057
+ this.coords[0] + U(this.type.label),
2058
+ this.coords[1] + H(this.type.label)
2059
+ ], this.label.width = this.width - U(this.type.label) - et(this.type.label), this.label.height = this.height - H(this.type.label) - K(this.type.label), this.label.updateInView());
2060
2060
  for (const i of this.decorators)
2061
2061
  i.move(
2062
2062
  Kt(
@@ -2211,10 +2211,10 @@ class Ri extends ut {
2211
2211
  c,
2212
2212
  s,
2213
2213
  [r, i],
2214
- l.sectionGrid.defaultWidths?.[c] || Le,
2214
+ l.sectionGrid.defaultWidths?.[c] || Te,
2215
2215
  l.sectionGrid.defaultHeights?.[s] || $e,
2216
2216
  `${a.id}_${s}_${c}`
2217
- ), r += (l.sectionGrid.defaultWidths?.[c] || Le) + (l.sectionGrid.margin || 0);
2217
+ ), r += (l.sectionGrid.defaultWidths?.[c] || Te) + (l.sectionGrid.margin || 0);
2218
2218
  i += (l.sectionGrid.defaultHeights?.[s] || $e) + (l.sectionGrid.margin || 0);
2219
2219
  }
2220
2220
  }
@@ -2248,13 +2248,13 @@ class Ri extends ut {
2248
2248
  case u.Right:
2249
2249
  y = [
2250
2250
  c.coords[0] - h / 2,
2251
- c.coords[1] - g - tt(d)
2251
+ c.coords[1] - g - K(d)
2252
2252
  ];
2253
2253
  break;
2254
2254
  case u.Top:
2255
2255
  y = [
2256
2256
  c.coords[0] - h / 2,
2257
- c.coords[1] + G(d)
2257
+ c.coords[1] + H(d)
2258
2258
  ];
2259
2259
  break;
2260
2260
  default:
@@ -2287,15 +2287,15 @@ class Ri extends ut {
2287
2287
  this.model.fields.new(
2288
2288
  a,
2289
2289
  [
2290
- a.coords[0] + j(i),
2291
- a.coords[1] + G(i)
2290
+ a.coords[0] + U(i),
2291
+ a.coords[1] + H(i)
2292
2292
  ],
2293
2293
  i.fontSize,
2294
2294
  i.fontFamily,
2295
2295
  i.color,
2296
2296
  i.selectedColor,
2297
- a.width - j(i) - nt(i),
2298
- a.height - G(i) - tt(i),
2297
+ a.width - U(i) - et(i),
2298
+ a.height - H(i) - K(i),
2299
2299
  i.horizontalAlign,
2300
2300
  i.verticalAlign,
2301
2301
  i.orientation,
@@ -2328,7 +2328,7 @@ class Ri extends ut {
2328
2328
  remove(t) {
2329
2329
  const e = this.get(t, !0);
2330
2330
  if (e) {
2331
- for (e.parent && U(e.parent.children, e); e.children.length > 0; )
2331
+ for (e.parent && Y(e.parent.children, e); e.children.length > 0; )
2332
2332
  this.model.nodes.remove(e.children[0].id);
2333
2333
  for (; e.sections.length > 0; )
2334
2334
  this.model.sections.remove(e.sections[0].id);
@@ -2370,7 +2370,7 @@ const Ue = (o) => {
2370
2370
  highlighted: {
2371
2371
  fillColor: "rgba(0, 255, 255, 0.5)"
2372
2372
  }
2373
- }, Xt = it(Ye), Xe = {
2373
+ }, Xt = ot(Ye), Xe = {
2374
2374
  name: "",
2375
2375
  label: null,
2376
2376
  allowsOutgoing: !0,
@@ -2385,7 +2385,7 @@ class Fi {
2385
2385
  ...t
2386
2386
  };
2387
2387
  this.id = e.id, this.name = e.name, this.label = e.label, this.allowsOutgoing = e.allowsOutgoing, this.allowsIncoming = e.allowsIncoming, this.width = e.width;
2388
- const n = it(e.look);
2388
+ const n = ot(e.look);
2389
2389
  this.defaultLook = n.defaultLook, this.selectedLook = n.selectedLook, this.highlightedLook = n.highlightedLook, this.selectedAndHighlightedLook = n.selectedAndHighlightedLook;
2390
2390
  }
2391
2391
  }
@@ -2451,7 +2451,7 @@ class bt extends At {
2451
2451
  */
2452
2452
  set look(t) {
2453
2453
  if (t) {
2454
- const e = it(
2454
+ const e = ot(
2455
2455
  t
2456
2456
  );
2457
2457
  this._defaultLook = {
@@ -2521,7 +2521,7 @@ class bt extends At {
2521
2521
  getNode() {
2522
2522
  if (this.rootElement instanceof z)
2523
2523
  return this.rootElement;
2524
- if (this.rootElement instanceof B)
2524
+ if (this.rootElement instanceof G)
2525
2525
  return this.rootElement.node;
2526
2526
  }
2527
2527
  getPriority() {
@@ -2584,7 +2584,7 @@ class Hi extends ut {
2584
2584
  this.model.connections.remove(e.outgoingConnections[0].id);
2585
2585
  for (; e.incomingConnections.length > 0; )
2586
2586
  this.model.connections.remove(e.incomingConnections[0].id);
2587
- e.label && this.model.fields.remove(e.label.id), (e.rootElement instanceof z || e.rootElement instanceof B) && U(e.rootElement.ports, e), super.remove(t), e.updateInView();
2587
+ e.label && this.model.fields.remove(e.label.id), (e.rootElement instanceof z || e.rootElement instanceof G) && Y(e.rootElement.ports, e), super.remove(t), e.updateInView();
2588
2588
  }
2589
2589
  }
2590
2590
  }
@@ -2626,11 +2626,11 @@ class je {
2626
2626
  t,
2627
2627
  l,
2628
2628
  [
2629
- l.coords[0] + j(i),
2630
- l.coords[1] + G(i)
2629
+ l.coords[0] + U(i),
2630
+ l.coords[1] + H(i)
2631
2631
  ],
2632
- l.width - j(i) - nt(i),
2633
- l.height - G(i) - tt(i),
2632
+ l.width - U(i) - et(i),
2633
+ l.height - H(i) - K(i),
2634
2634
  i.fontSize,
2635
2635
  i.fontFamily,
2636
2636
  i.color,
@@ -2651,7 +2651,7 @@ class je {
2651
2651
  s !== void 0 && (l.children?.push(s), s.parent = l);
2652
2652
  }
2653
2653
  for (const i of e.sections || []) {
2654
- const s = new B(
2654
+ const s = new G(
2655
2655
  t,
2656
2656
  l,
2657
2657
  i.indexXInNode,
@@ -2669,11 +2669,11 @@ class je {
2669
2669
  t,
2670
2670
  s,
2671
2671
  [
2672
- s.coords[0] + j(c),
2673
- s.coords[1] + G(c)
2672
+ s.coords[0] + U(c),
2673
+ s.coords[1] + H(c)
2674
2674
  ],
2675
- s.width - j(c) - nt(c),
2676
- s.height - G(c) - tt(c),
2675
+ s.width - U(c) - et(c),
2676
+ s.height - H(c) - K(c),
2677
2677
  c.fontSize,
2678
2678
  c.fontFamily,
2679
2679
  c.color,
@@ -2970,7 +2970,7 @@ class Dt {
2970
2970
  );
2971
2971
  }
2972
2972
  }
2973
- class et {
2973
+ class it {
2974
2974
  constructor(t, e, n, l) {
2975
2975
  this.canvas = t, this.nodeId = e, this.to = n, this.timestamp = l;
2976
2976
  }
@@ -2995,7 +2995,7 @@ class et {
2995
2995
  };
2996
2996
  }
2997
2997
  static deserialize(t, e) {
2998
- return new et(
2998
+ return new it(
2999
2999
  t,
3000
3000
  e.nodeId,
3001
3001
  e.to,
@@ -3057,7 +3057,7 @@ class ee {
3057
3057
  );
3058
3058
  }
3059
3059
  }
3060
- class Lt {
3060
+ class Tt {
3061
3061
  constructor(t, e, n, l) {
3062
3062
  this.canvas = t, this.fieldId = e, this.to = n, this.timestamp = l;
3063
3063
  }
@@ -3074,7 +3074,7 @@ class Lt {
3074
3074
  };
3075
3075
  }
3076
3076
  static deserialize(t, e) {
3077
- return new Lt(
3077
+ return new Tt(
3078
3078
  t,
3079
3079
  e.fieldId,
3080
3080
  e.to,
@@ -3190,7 +3190,7 @@ class ie {
3190
3190
  }
3191
3191
  class Bi {
3192
3192
  constructor(t) {
3193
- this.isInRoom = !1, this.canvas = t, this.replicaId = Ee();
3193
+ this.isInRoom = !1, this.canvas = t, this.replicaId = Le();
3194
3194
  }
3195
3195
  /**
3196
3196
  * Returns a fresh timestamp, suitable for use by new CollabActions.
@@ -3202,7 +3202,7 @@ class Bi {
3202
3202
  * Returns a fresh unique ID, suitable for use by new CollabActions.
3203
3203
  */
3204
3204
  freshId() {
3205
- return "id" + Ee();
3205
+ return "id" + Le();
3206
3206
  }
3207
3207
  /**
3208
3208
  * Performs the action - immediately locally, and eventually for remote collaborators.
@@ -3244,7 +3244,7 @@ class Bi {
3244
3244
  break;
3245
3245
  }
3246
3246
  case "setGeometry": {
3247
- et.deserialize(
3247
+ it.deserialize(
3248
3248
  this.canvas,
3249
3249
  t
3250
3250
  ).do();
@@ -3262,7 +3262,7 @@ class Bi {
3262
3262
  break;
3263
3263
  }
3264
3264
  case "editField": {
3265
- Lt.deserialize(this.canvas, t).do();
3265
+ Tt.deserialize(this.canvas, t).do();
3266
3266
  break;
3267
3267
  }
3268
3268
  case "updateValues": {
@@ -3343,7 +3343,7 @@ class Gi {
3343
3343
  });
3344
3344
  }
3345
3345
  }
3346
- var k = /* @__PURE__ */ ((o) => (o.AddConnection = "add-connection", o.AddNode = "add-node", o.AddSectionAction = "add-section", o.ApplyLayout = "apply-layout", o.Clipboard = "clipboard", o.ContextMenu = "context-menu", o.EditField = "edit-field", o.MoveNode = "move-node", o.Paste = "paste", o.Remove = "remove", o.StretchNode = "stretch-node", o.StretchSection = "stretch-section", o.UpdateValues = "update-values", o.Zoom = "zoom", o))(k || {});
3346
+ var w = /* @__PURE__ */ ((o) => (o.AddConnection = "add-connection", o.AddNode = "add-node", o.AddSectionAction = "add-section", o.ApplyLayout = "apply-layout", o.Clipboard = "clipboard", o.ContextMenu = "context-menu", o.EditField = "edit-field", o.MoveNode = "move-node", o.Paste = "paste", o.Remove = "remove", o.StretchNode = "stretch-node", o.StretchSection = "stretch-section", o.UpdateValues = "update-values", o.Zoom = "zoom", o))(w || {});
3347
3347
  class Ui {
3348
3348
  constructor(t, e, n, l, a, i, s, r, c) {
3349
3349
  this.canvas = t, this.type = e, this.coords = n, this.parentId = l, this.ancestorId = a, this.fromAncestorGeometry = i, this.toAncestorGeometry = s, this.label = r, this.values = c, this.id = this.canvas.collabEngine.freshId();
@@ -3359,7 +3359,7 @@ class Ui {
3359
3359
  this.values
3360
3360
  );
3361
3361
  if (this.canvas.collabEngine.doCollaboratively(t), this.ancestorId !== void 0 && this.toAncestorGeometry !== void 0) {
3362
- const e = new et(
3362
+ const e = new it(
3363
3363
  this.canvas,
3364
3364
  this.ancestorId,
3365
3365
  this.toAncestorGeometry,
@@ -3381,7 +3381,7 @@ class Ui {
3381
3381
  this.canvas.collabEngine.freshTimestamp()
3382
3382
  );
3383
3383
  if (this.canvas.collabEngine.doCollaboratively(e), this.ancestorId !== void 0 && this.fromAncestorGeometry !== void 0) {
3384
- const n = new et(
3384
+ const n = new it(
3385
3385
  this.canvas,
3386
3386
  this.ancestorId,
3387
3387
  this.fromAncestorGeometry,
@@ -3403,7 +3403,7 @@ class Ui {
3403
3403
  this.canvas.collabEngine.freshTimestamp()
3404
3404
  );
3405
3405
  if (this.canvas.collabEngine.doCollaboratively(e), this.ancestorId !== void 0 && this.toAncestorGeometry !== void 0) {
3406
- const n = new et(
3406
+ const n = new it(
3407
3407
  this.canvas,
3408
3408
  this.ancestorId,
3409
3409
  this.toAncestorGeometry,
@@ -3440,21 +3440,21 @@ class re {
3440
3440
  return this.do();
3441
3441
  }
3442
3442
  }
3443
- class Y {
3443
+ class X {
3444
3444
  constructor(t, e, n, l, a, i, s, r) {
3445
3445
  this.canvas = t, this.intent = e, this.nodeId = n, this.from = l, this.to = a, this.ancestorId = i, this.fromAncestorGeometry = s, this.toAncestorGeometry = r;
3446
3446
  }
3447
3447
  do() {
3448
3448
  const t = this.canvas.model.nodes.get(this.nodeId);
3449
3449
  if (t) {
3450
- const e = new et(
3450
+ const e = new it(
3451
3451
  this.canvas,
3452
3452
  this.nodeId,
3453
3453
  this.to,
3454
3454
  this.canvas.collabEngine.freshTimestamp()
3455
3455
  );
3456
3456
  if (this.canvas.collabEngine.doCollaboratively(e), this.ancestorId !== void 0 && this.toAncestorGeometry !== void 0) {
3457
- const n = new et(
3457
+ const n = new it(
3458
3458
  this.canvas,
3459
3459
  this.ancestorId,
3460
3460
  this.toAncestorGeometry,
@@ -3469,14 +3469,14 @@ class Y {
3469
3469
  const t = this.canvas.model.nodes.get(this.nodeId);
3470
3470
  if (t) {
3471
3471
  this.to = t.getGeometry();
3472
- const e = new et(
3472
+ const e = new it(
3473
3473
  this.canvas,
3474
3474
  this.nodeId,
3475
3475
  this.from,
3476
3476
  this.canvas.collabEngine.freshTimestamp()
3477
3477
  );
3478
3478
  if (this.canvas.collabEngine.doCollaboratively(e), this.ancestorId !== void 0 && this.fromAncestorGeometry !== void 0) {
3479
- const n = new et(
3479
+ const n = new it(
3480
3480
  this.canvas,
3481
3481
  this.ancestorId,
3482
3482
  this.fromAncestorGeometry,
@@ -3491,7 +3491,7 @@ class Y {
3491
3491
  const t = this.canvas.model.nodes.get(this.nodeId);
3492
3492
  if (t) {
3493
3493
  this.from = t.getGeometry();
3494
- const e = new et(
3494
+ const e = new it(
3495
3495
  this.canvas,
3496
3496
  this.nodeId,
3497
3497
  this.to,
@@ -3515,7 +3515,7 @@ class Yi {
3515
3515
  this.canvas.collabEngine.freshTimestamp()
3516
3516
  );
3517
3517
  if (this.canvas.collabEngine.doCollaboratively(e), this.ancestorId !== void 0 && this.toAncestorGeometry !== void 0) {
3518
- const n = new et(
3518
+ const n = new it(
3519
3519
  this.canvas,
3520
3520
  this.ancestorId,
3521
3521
  this.toAncestorGeometry,
@@ -3534,7 +3534,7 @@ class Yi {
3534
3534
  this.canvas.collabEngine.freshTimestamp()
3535
3535
  );
3536
3536
  if (this.canvas.collabEngine.doCollaboratively(e), this.ancestorId !== void 0 && this.fromAncestorGeometry !== void 0) {
3537
- const n = new et(
3537
+ const n = new it(
3538
3538
  this.canvas,
3539
3539
  this.ancestorId,
3540
3540
  this.fromAncestorGeometry,
@@ -3594,7 +3594,7 @@ class Ne {
3594
3594
  this.canvas = t, this.fieldId = e, this.from = n, this.to = l;
3595
3595
  }
3596
3596
  do() {
3597
- const t = this.canvas.model.fields.get(this.fieldId), e = new Lt(
3597
+ const t = this.canvas.model.fields.get(this.fieldId), e = new Tt(
3598
3598
  this.canvas,
3599
3599
  this.fieldId,
3600
3600
  this.to,
@@ -3606,7 +3606,7 @@ class Ne {
3606
3606
  const t = this.canvas.model.fields.get(this.fieldId);
3607
3607
  if (t) {
3608
3608
  this.to = t.text;
3609
- const e = new Lt(
3609
+ const e = new Tt(
3610
3610
  this.canvas,
3611
3611
  this.fieldId,
3612
3612
  this.from,
@@ -3620,7 +3620,7 @@ class Ne {
3620
3620
  const t = this.canvas.model.fields.get(this.fieldId);
3621
3621
  if (t) {
3622
3622
  this.from = t.text;
3623
- const e = new Lt(
3623
+ const e = new Tt(
3624
3624
  this.canvas,
3625
3625
  this.fieldId,
3626
3626
  this.to,
@@ -3857,7 +3857,7 @@ class F extends oe {
3857
3857
  ), this.targets = t, this.selected = e;
3858
3858
  }
3859
3859
  }
3860
- class q extends oe {
3860
+ class J extends oe {
3861
3861
  /**
3862
3862
  * Create a diagram highlight event.
3863
3863
  *
@@ -3935,7 +3935,7 @@ class Zi extends ut {
3935
3935
  }
3936
3936
  remove(t) {
3937
3937
  const e = this.get(t, !0);
3938
- e && ((e.rootElement instanceof z || e.rootElement instanceof B) && U(e.rootElement.decorators, e), super.remove(t), e.updateInView());
3938
+ e && ((e.rootElement instanceof z || e.rootElement instanceof G) && Y(e.rootElement.decorators, e), super.remove(t), e.updateInView());
3939
3939
  }
3940
3940
  }
3941
3941
  class Ki extends At {
@@ -4005,7 +4005,7 @@ class qi extends ut {
4005
4005
  }
4006
4006
  class Ke {
4007
4007
  constructor(t, e, n, l, a, i = []) {
4008
- this.nodes = new Ri(this), this.sections = new zi(this), this.ports = new Hi(this), this.connections = new Ti(this), this.fields = new Li(this), this.objects = new qi(this), this.decorators = new Zi(this), this.canvas = t, this.id = e, this.name = n, this.description = l, this.type = a, this.createdAt = /* @__PURE__ */ new Date(), this.updatedAt = /* @__PURE__ */ new Date(), this.logicalClock = 0, this.valueSet = new yt(new Qt(i), this);
4008
+ this.nodes = new Ri(this), this.sections = new zi(this), this.ports = new Hi(this), this.connections = new Ei(this), this.fields = new Ti(this), this.objects = new qi(this), this.decorators = new Zi(this), this.canvas = t, this.id = e, this.name = n, this.description = l, this.type = a, this.createdAt = /* @__PURE__ */ new Date(), this.updatedAt = /* @__PURE__ */ new Date(), this.logicalClock = 0, this.valueSet = new yt(new Qt(i), this);
4009
4009
  }
4010
4010
  /**
4011
4011
  * Deletes everything in this diagram.
@@ -4027,8 +4027,8 @@ const vt = (o) => !!o.button, le = (o, t, e, n, l, a, i, s) => gi(
4027
4027
  s || 0
4028
4028
  ) * a
4029
4029
  ), S = (o) => {
4030
- o ? E.select("body").style("cursor", o) : E.select("body").style("cursor", T.Auto);
4031
- }, dt = (o) => o instanceof z ? o : o instanceof B ? o.node || o : o.rootElement instanceof z || o.rootElement instanceof B || o.rootElement instanceof bt ? dt(o.rootElement) : o, ce = (o) => {
4030
+ o ? L.select("body").style("cursor", o) : L.select("body").style("cursor", E.Auto);
4031
+ }, dt = (o) => o instanceof z ? o : o instanceof G ? o.node || o : o.rootElement instanceof z || o.rootElement instanceof G || o.rootElement instanceof bt ? dt(o.rootElement) : o, ce = (o) => {
4032
4032
  o.filter(".shaped-look").append("path"), o.filter(".image-look").append("image").attr("preserveAspectRatio", "none"), o.filter(".stretchable-image-look").append("image").attr("class", "top-left-image").attr("preserveAspectRatio", "none"), o.filter(".stretchable-image-look").append("image").attr("class", "top-image").attr("preserveAspectRatio", "none"), o.filter(".stretchable-image-look").append("image").attr("class", "top-right-image").attr("preserveAspectRatio", "none"), o.filter(".stretchable-image-look").append("image").attr("class", "left-image").attr("preserveAspectRatio", "none"), o.filter(".stretchable-image-look").append("image").attr("class", "center-image").attr("preserveAspectRatio", "none"), o.filter(".stretchable-image-look").append("image").attr("class", "right-image").attr("preserveAspectRatio", "none"), o.filter(".stretchable-image-look").append("image").attr("class", "bottom-left-image").attr("preserveAspectRatio", "none"), o.filter(".stretchable-image-look").append("image").attr("class", "bottom-image").attr("preserveAspectRatio", "none"), o.filter(".stretchable-image-look").append("image").attr("class", "bottom-right-image").attr("preserveAspectRatio", "none");
4033
4033
  }, Pt = {
4034
4034
  fillColor: "#FFFFFF",
@@ -4058,7 +4058,7 @@ const vt = (o) => !!o.button, le = (o, t, e, n, l, a, i, s) => gi(
4058
4058
  "stroke-dasharray",
4059
4059
  (t) => fe(
4060
4060
  t.look.borderStyle || Pt.borderStyle,
4061
- t.look.borderThickness || Pt.borderThickness
4061
+ t.type?.defaultLook?.borderThickness || t.look?.borderThickness || Pt.borderThickness
4062
4062
  )
4063
4063
  ), o.filter(".image-look").select("image").attr("x", 0).attr("y", 0).attr("width", (t) => t.width).attr("height", (t) => t.height).attr("href", (t) => t.look.backgroundImage), o.filter(".stretchable-image-look").select("image.top-left-image").attr("x", 0).attr("y", 0).attr("width", (t) => t.look.leftMargin).attr("height", (t) => t.look.topMargin).attr(
4064
4064
  "href",
@@ -4123,7 +4123,7 @@ const vt = (o) => !!o.button, le = (o, t, e, n, l, a, i, s) => gi(
4123
4123
  }
4124
4124
  t.select("rect").attr("fill", `url(#${e})`);
4125
4125
  }
4126
- }, pe = 96, X = 32, Et = pe + X, Qi = Math.PI / 4, to = 100, Me = {
4126
+ }, pe = 96, j = 32, Lt = pe + j, Qi = Math.PI / 4, to = 100, Me = {
4127
4127
  customButtons: []
4128
4128
  };
4129
4129
  class eo {
@@ -4142,26 +4142,26 @@ class eo {
4142
4142
  */
4143
4143
  open(t) {
4144
4144
  this.close();
4145
- const e = this.canvas.getPointerLocationRelativeToRoot(t), n = this.canvas.getPointerLocationRelativeToCanvas(t), l = this.canvas.selectSVGElement().append("foreignObject").attr("class", "daga-context-menu").attr("x", `${e[0] - Et}px`).attr("y", `${e[1] - Et}px`).attr("width", `${2 * Et}px`).attr("height", `${2 * Et}px`).style("pointer-events", "none").on(I.ContextMenu, (i) => {
4146
- this.canvas.canUserPerformAction(k.ContextMenu) && (t.preventDefault(), this.open(i));
4145
+ const e = this.canvas.getPointerLocationRelativeToRoot(t), n = this.canvas.getPointerLocationRelativeToCanvas(t), l = this.canvas.selectSVGElement().append("foreignObject").attr("class", "daga-context-menu").attr("x", `${e[0] - Lt}px`).attr("y", `${e[1] - Lt}px`).attr("width", `${2 * Lt}px`).attr("height", `${2 * Lt}px`).style("pointer-events", "none").on(I.ContextMenu, (i) => {
4146
+ this.canvas.canUserPerformAction(w.ContextMenu) && (t.preventDefault(), this.open(i));
4147
4147
  }).on(I.Click, (i) => {
4148
4148
  i.preventDefault(), this.close();
4149
4149
  });
4150
4150
  this.contextMenuContainer = l;
4151
4151
  const a = [];
4152
- this.canvas.userSelection.length !== 0 && this.canvas.canUserPerformAction(k.Clipboard) && this.canvas.canUserPerformAction(k.Remove) && a.push({
4152
+ this.canvas.userSelection.length !== 0 && this.canvas.canUserPerformAction(w.Clipboard) && this.canvas.canUserPerformAction(w.Remove) && a.push({
4153
4153
  name: "CUT",
4154
4154
  imageClass: "daga-cut",
4155
4155
  onPress: (i) => {
4156
4156
  i.userSelection.cutToClipboard(), i.cancelAllUserActions();
4157
4157
  }
4158
- }), this.canvas.userSelection.length !== 0 && this.canvas.canUserPerformAction(k.Clipboard) && a.push({
4158
+ }), this.canvas.userSelection.length !== 0 && this.canvas.canUserPerformAction(w.Clipboard) && a.push({
4159
4159
  name: "COPY",
4160
4160
  imageClass: "daga-copy",
4161
4161
  onPress: (i) => {
4162
4162
  i.userSelection.copyToClipboard(), i.cancelAllUserActions();
4163
4163
  }
4164
- }), this.canvas.canUserPerformAction(k.Paste) && a.push({
4164
+ }), this.canvas.canUserPerformAction(w.Paste) && a.push({
4165
4165
  name: "PASTE",
4166
4166
  imageClass: "daga-paste",
4167
4167
  onPress: (i) => {
@@ -4169,7 +4169,7 @@ class eo {
4169
4169
  i.getClosestGridPoint(n)
4170
4170
  ), i.cancelAllUserActions();
4171
4171
  }
4172
- }), this.canvas.userSelection.length !== 0 && this.canvas.canUserPerformAction(k.Remove) && a.push({
4172
+ }), this.canvas.userSelection.length !== 0 && this.canvas.canUserPerformAction(w.Remove) && a.push({
4173
4173
  name: "DELETE",
4174
4174
  imageClass: "daga-delete",
4175
4175
  onPress: (i) => {
@@ -4187,19 +4187,19 @@ class eo {
4187
4187
  const s = a[i], r = s.onPress, c = (i + 0.5 - a.length / 2) * Qi, d = l.append("xhtml:div").attr(
4188
4188
  "class",
4189
4189
  `daga-context-menu-button ${s.onPress !== void 0 ? " daga-clickable" : ""}`
4190
- ).attr("tabindex", 0).style("position", "absolute").style("box-sizing", "border-box").style("width", `${2 * X}px`).style("height", `${2 * X}px`).style("border-radius", `${X}px`).style("pointer-events", "auto").on(I.Click, (h) => {
4190
+ ).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(I.Click, (h) => {
4191
4191
  r && (h.preventDefault(), r(this.canvas));
4192
4192
  }).on(I.KeyDown, (h) => {
4193
4193
  r && h.key === Z.Enter && (h.preventDefault(), r(this.canvas));
4194
4194
  });
4195
- s.imageClass !== void 0 ? d.append("xhtml:div").style("position", "absolute").style("left", `${0.75 * X}px`).style("top", `${0.5 * X}px`).style("width", `${0.5 * X}px`).style("height", `${0.5 * X}px`).style("background-size", "contain").style("background-repeat", "no-repeat").attr("class", s.imageClass) : s.image !== void 0 && d.append("xhtml:img").style("position", "absolute").style("left", `${0.75 * X}px`).style("top", `${0.5 * X}px`).style("width", `${0.5 * X}px`).style("height", `${0.5 * X}px`).attr("src", s.image), d.append("xhtml:span").style("position", "absolute").style("left", `${0.2 * X}px`).style("top", `${1.1 * X}px`).style("text-align", "center").style("width", `${1.6 * X}px`).style("height", `${0.35 * X}px`).style("margin", "0").style("font-size", `${0.35 * X}px`).style("font-weight", "700").style("user-select", "none").text(s.name), d.transition().ease(E.easeLinear).duration(to).tween("progress", () => (h) => {
4195
+ s.imageClass !== void 0 ? d.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", s.imageClass) : s.image !== void 0 && d.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", s.image), d.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(s.name), d.transition().ease(L.easeLinear).duration(to).tween("progress", () => (h) => {
4196
4196
  const g = c * h;
4197
4197
  return d.style(
4198
4198
  "left",
4199
- `${Math.sin(g) * pe - X + Et}px`
4199
+ `${Math.sin(g) * pe - j + Lt}px`
4200
4200
  ).style(
4201
4201
  "top",
4202
- `${-Math.cos(g) * pe - X + Et}px`
4202
+ `${-Math.cos(g) * pe - j + Lt}px`
4203
4203
  );
4204
4204
  });
4205
4205
  }
@@ -4248,7 +4248,7 @@ class io extends ut {
4248
4248
  for (const e of t.ports)
4249
4249
  super.add(e), this.canvas.updatePortsInView(e.id);
4250
4250
  t.label && (super.add(t.label), this.canvas.updateFieldsInView(t.label.id)), this.canvas.updateNodesInView(t.id);
4251
- } else if (t instanceof B)
4251
+ } else if (t instanceof G)
4252
4252
  if (!this.highlightSections && t.node)
4253
4253
  this.add(t.node);
4254
4254
  else {
@@ -4423,7 +4423,7 @@ class no extends ut {
4423
4423
  });
4424
4424
  }
4425
4425
  add(t) {
4426
- if (!this.contains(t.id) && (this.length === 0 ? this.propertyEditorSelection === void 0 && (t instanceof z || t instanceof ct) ? this.openInPropertyEditor(t) : this.propertyEditorSelection === void 0 && t instanceof B ? this.openInPropertyEditor(t.node) : this.openInPropertyEditor(void 0) : this.openInPropertyEditor(void 0), super.add(t), t.updateInView(), t instanceof z && t.sections))
4426
+ if (!this.contains(t.id) && (this.length === 0 ? this.propertyEditorSelection === void 0 && (t instanceof z || t instanceof ct) ? this.openInPropertyEditor(t) : this.propertyEditorSelection === void 0 && t instanceof G ? this.openInPropertyEditor(t.node) : this.openInPropertyEditor(void 0) : this.openInPropertyEditor(void 0), super.add(t), t.updateInView(), t instanceof z && t.sections))
4427
4427
  for (const e of t.sections)
4428
4428
  super.add(e), e.updateInView();
4429
4429
  }
@@ -4468,7 +4468,7 @@ class no extends ut {
4468
4468
  if (this.length > 0) {
4469
4469
  const t = [], e = [], n = [], l = [], a = [];
4470
4470
  for (const s of this.all())
4471
- s instanceof z ? t.push(s.id) : s instanceof B ? e.push(s.id) : s instanceof bt ? n.push(s.id) : s instanceof ct ? l.push(s.id) : s instanceof ht && a.push(s.id);
4471
+ s instanceof z ? t.push(s.id) : s instanceof G ? e.push(s.id) : s instanceof bt ? n.push(s.id) : s instanceof ct ? l.push(s.id) : s instanceof ht && a.push(s.id);
4472
4472
  const i = new ji(
4473
4473
  this.canvas,
4474
4474
  t,
@@ -4574,7 +4574,7 @@ const ro = (o) => o * Math.PI / 180, Pe = (o, t, e) => {
4574
4574
  * @param config The configuration object used to set the parameters of this canvas.
4575
4575
  */
4576
4576
  constructor(t, e) {
4577
- if (this.backgroundPatternId = `daga-background-pattern-id-${qt.canvasCount++}`, this.zoomTransform = E.zoomIdentity, this.draggingFrom = [0, 0], this.dragging = !1, this.secondaryButton = !1, this.validatorChange$ = new Yt(), this.diagramChange$ = new Yt(), this.diagramEvent$ = new Yt(), this.propertyEditorChanges$ = new Yt(), this.parentComponent = t, this.model = new Ke(
4577
+ if (this.backgroundPatternId = `daga-background-pattern-id-${qt.canvasCount++}`, this.zoomTransform = L.zoomIdentity, this.draggingFrom = [0, 0], this.dragging = !1, this.secondaryButton = !1, this.validatorChange$ = new Yt(), this.diagramChange$ = new Yt(), this.diagramEvent$ = new Yt(), this.propertyEditorChanges$ = new Yt(), this.parentComponent = t, this.model = new Ke(
4578
4578
  this,
4579
4579
  void 0,
4580
4580
  e.name || "unnamed",
@@ -4625,7 +4625,7 @@ const ro = (o) => o * Math.PI / 180, Pe = (o, t, e) => {
4625
4625
  this.validators.push(t), this.validatorChange$.next();
4626
4626
  }
4627
4627
  removeValidator(t) {
4628
- U(this.validators, t), this.validatorChange$.next();
4628
+ Y(this.validators, t), this.validatorChange$.next();
4629
4629
  }
4630
4630
  getPriorityThresholdOptions() {
4631
4631
  return this.priorityThresholds;
@@ -4641,21 +4641,21 @@ const ro = (o) => o * Math.PI / 180, Pe = (o, t, e) => {
4641
4641
  }
4642
4642
  // View methods
4643
4643
  initView(t) {
4644
- const e = E.select(t);
4645
- e.html(""), this.diagramRoot = e.append("div").node(), E.select(this.diagramRoot).attr("tabindex", 0).style("width", "100%").style("height", "100%").append("svg").style("width", "100%").style("height", "100%"), E.select(this.diagramRoot).on(I.Click, () => {
4646
- E.select(this.diagramRoot).node()?.focus();
4644
+ const e = L.select(t);
4645
+ 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(I.Click, () => {
4646
+ L.select(this.diagramRoot).node()?.focus();
4647
4647
  }).on(I.ContextMenu, (l) => {
4648
4648
  if (this.dragging) {
4649
4649
  l.preventDefault(), l.stopPropagation(), this.dragging = !1;
4650
4650
  return;
4651
4651
  }
4652
4652
  const a = new pt(l, null);
4653
- this.diagramEvent$.next(a), !a.defaultPrevented && this.canUserPerformAction(k.ContextMenu) && (l.preventDefault(), this.contextMenu.open(l));
4653
+ this.diagramEvent$.next(a), !a.defaultPrevented && this.canUserPerformAction(w.ContextMenu) && (l.preventDefault(), this.contextMenu.open(l));
4654
4654
  }).on(I.DoubleClick, (l) => {
4655
4655
  const a = new mt(l, null);
4656
4656
  this.diagramEvent$.next(a);
4657
4657
  }).on(I.KeyDown, (l) => {
4658
- if (!l.ctrlKey && (l.key === Z.Delete || l.key === Z.Backspace) && this.canUserPerformAction(k.Remove) && (this.userSelection.removeFromModel(), this.cancelAllUserActions()), l.ctrlKey && l.key === "a") {
4658
+ 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") {
4659
4659
  l.preventDefault();
4660
4660
  for (const a of this.model.nodes)
4661
4661
  this.userSelection.add(a);
@@ -4678,7 +4678,7 @@ const ro = (o) => o * Math.PI / 180, Pe = (o, t, e) => {
4678
4678
  new F(i, !1)
4679
4679
  );
4680
4680
  }
4681
- 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)) {
4681
+ 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)) {
4682
4682
  l.preventDefault();
4683
4683
  const a = this.getCoordinatesOnScreen();
4684
4684
  this.userSelection.pasteFromClipboard(
@@ -4688,21 +4688,21 @@ const ro = (o) => o * Math.PI / 180, Pe = (o, t, e) => {
4688
4688
  ])
4689
4689
  ), this.cancelAllUserActions();
4690
4690
  }
4691
- 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 === Z.ArrowLeft && this.canUserPerformAction(k.Zoom) && (l.preventDefault(), this.translateBy(this.panRate / this.zoomTransform.k, 0)), l.key === Z.ArrowRight && this.canUserPerformAction(k.Zoom) && (l.preventDefault(), this.translateBy(-this.panRate / this.zoomTransform.k, 0)), l.key === Z.ArrowDown && this.canUserPerformAction(k.Zoom) && (l.preventDefault(), this.translateBy(0, -this.panRate / this.zoomTransform.k)), l.key === Z.ArrowUp && this.canUserPerformAction(k.Zoom) && (l.preventDefault(), this.translateBy(0, this.panRate / this.zoomTransform.k));
4691
+ 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));
4692
4692
  });
4693
4693
  const n = this.selectSVGElement().append("g").attr("class", "daga-canvas-view").attr("width", "100%").attr("height", "100%");
4694
4694
  n.call(
4695
- this.zoomBehavior = E.zoom().filter((l) => l.type !== I.DoubleClick).on(ge.Zoom, (l) => {
4695
+ this.zoomBehavior = L.zoom().filter((l) => l.type !== I.DoubleClick).on(ge.Zoom, (l) => {
4696
4696
  if (l.sourceEvent) {
4697
- if (!this.canUserPerformAction(k.Zoom)) {
4698
- S(T.NotAllowed);
4697
+ if (!this.canUserPerformAction(w.Zoom)) {
4698
+ S(E.NotAllowed);
4699
4699
  return;
4700
4700
  }
4701
- l.sourceEvent.type === I.Wheel && l.sourceEvent.wheelDelta !== void 0 ? (l.sourceEvent.wheelDelta > 0 && S(T.ZoomIn), l.sourceEvent.wheelDelta < 0 && S(T.ZoomOut)) : l.sourceEvent.type === I.MouseMove && S(T.AllScroll);
4701
+ l.sourceEvent.type === I.Wheel && l.sourceEvent.wheelDelta !== void 0 ? (l.sourceEvent.wheelDelta > 0 && S(E.ZoomIn), l.sourceEvent.wheelDelta < 0 && S(E.ZoomOut)) : l.sourceEvent.type === I.MouseMove && S(E.AllScroll);
4702
4702
  }
4703
4703
  this.zoomTransform = l.transform;
4704
4704
  const a = l.transform.toString();
4705
- this.selectCanvasElements().attr("transform", a), E.select(`#${this.backgroundPatternId}`).attr(
4705
+ this.selectCanvasElements().attr("transform", a), L.select(`#${this.backgroundPatternId}`).attr(
4706
4706
  "patternTransform",
4707
4707
  a
4708
4708
  ), this.contextMenu.close();
@@ -4715,16 +4715,16 @@ const ro = (o) => o * Math.PI / 180, Pe = (o, t, e) => {
4715
4715
  this.unfinishedConnection.endCoords = a;
4716
4716
  }
4717
4717
  }).on(I.MouseOver, () => {
4718
- this.userHighlight.size() > 0 && (this.userHighlight.clear(), this.diagramEvent$.next(new q(null)));
4718
+ this.userHighlight.size() > 0 && (this.userHighlight.clear(), this.diagramEvent$.next(new J(null)));
4719
4719
  }).on(I.Click, () => {
4720
- if (this.userHighlight.size() > 0 && (this.userHighlight.clear(), this.diagramEvent$.next(new q(null))), this.contextMenu.close(), this.userSelection.size() > 0) {
4720
+ if (this.userHighlight.size() > 0 && (this.userHighlight.clear(), this.diagramEvent$.next(new J(null))), this.contextMenu.close(), this.userSelection.size() > 0) {
4721
4721
  const l = this.userSelection.all();
4722
4722
  this.userSelection.clear(), this.diagramEvent$.next(
4723
4723
  new F(l, !1)
4724
4724
  ), this.userSelection.openInPropertyEditor(this.model);
4725
4725
  }
4726
4726
  }).call(
4727
- E.drag().filter((l) => this.multipleSelectionOn || vt(l)).on(A.Start, (l) => {
4727
+ L.drag().filter((l) => this.multipleSelectionOn || vt(l)).on(A.Start, (l) => {
4728
4728
  this.startMultipleSelection(l);
4729
4729
  }).on(A.Drag, (l) => {
4730
4730
  this.continueMultipleSelection(l);
@@ -4797,21 +4797,21 @@ const ro = (o) => o * Math.PI / 180, Pe = (o, t, e) => {
4797
4797
  return t;
4798
4798
  }
4799
4799
  getPointerLocationRelativeToCanvas(t) {
4800
- return E.pointer(
4800
+ return L.pointer(
4801
4801
  this.getEventHoldingCoordinates(t),
4802
4802
  this.selectCanvasElements().node()
4803
4803
  );
4804
4804
  }
4805
4805
  getPointerLocationRelativeToRoot(t) {
4806
- return E.pointer(
4806
+ return L.pointer(
4807
4807
  this.getEventHoldingCoordinates(t),
4808
4808
  this.selectSVGElement().node()
4809
4809
  );
4810
4810
  }
4811
4811
  getPointerLocationRelativeToBody(t) {
4812
- return E.pointer(
4812
+ return L.pointer(
4813
4813
  this.getEventHoldingCoordinates(t),
4814
- E.select("body").node()
4814
+ L.select("body").node()
4815
4815
  );
4816
4816
  }
4817
4817
  getPointerLocationRelativeToScreen(t) {
@@ -4838,7 +4838,7 @@ const ro = (o) => o * Math.PI / 180, Pe = (o, t, e) => {
4838
4838
  t && t.length > 0 && (e = e.filter((i) => t.includes(i.id)));
4839
4839
  const a = l.merge(e);
4840
4840
  n.remove(), l.on(I.MouseOver, (i, s) => {
4841
- this.dragging || (this.userHighlight.focusOn(s), this.diagramEvent$.next(new q(s)));
4841
+ this.dragging || (this.userHighlight.focusOn(s), this.diagramEvent$.next(new J(s)));
4842
4842
  }).on(I.Click, (i, s) => {
4843
4843
  if (!i.ctrlKey && !i.shiftKey) {
4844
4844
  const r = this.userSelection.all();
@@ -4853,12 +4853,12 @@ const ro = (o) => o * Math.PI / 180, Pe = (o, t, e) => {
4853
4853
  return;
4854
4854
  }
4855
4855
  const r = new pt(i, s);
4856
- this.diagramEvent$.next(r), !r.defaultPrevented && this.canUserPerformAction(k.ContextMenu) && (i.preventDefault(), this.userHighlight.focusOn(s), this.diagramEvent$.next(new q(s)), this.userSelection.add(s), this.diagramEvent$.next(new F([s], !0)), this.contextMenu.open(i));
4856
+ this.diagramEvent$.next(r), !r.defaultPrevented && this.canUserPerformAction(w.ContextMenu) && (i.preventDefault(), this.userHighlight.focusOn(s), this.diagramEvent$.next(new J(s)), this.userSelection.add(s), this.diagramEvent$.next(new F([s], !0)), this.contextMenu.open(i));
4857
4857
  }).on(I.DoubleClick, (i, s) => {
4858
4858
  const r = new mt(i, s);
4859
4859
  this.diagramEvent$.next(r);
4860
4860
  }).call(
4861
- E.drag().filter((i) => (this.secondaryButton = vt(i), !0)).on(A.Start, (i, s) => {
4861
+ L.drag().filter((i) => (this.secondaryButton = vt(i), !0)).on(A.Start, (i, s) => {
4862
4862
  this.multipleSelectionOn || this.secondaryButton ? this.startMultipleSelection(i) : this.startMovingNode(i, s);
4863
4863
  }).on(A.Drag, (i, s) => {
4864
4864
  this.multipleSelectionOn || this.secondaryButton ? this.continueMultipleSelection(i) : this.continueMovingNode(i, s);
@@ -4868,95 +4868,95 @@ const ro = (o) => o * Math.PI / 180, Pe = (o, t, e) => {
4868
4868
  ), ce(
4869
4869
  l
4870
4870
  ), l.filter(".resizable-x").append("line").attr("class", "left-resizer").attr("stroke", "transparent").attr("stroke-width", `${_}px`).on(I.MouseOver, (i, s) => {
4871
- this.canUserPerformAction(k.StretchNode) && s.type.resizableX && !s.removed && S(T.EWResize);
4871
+ this.canUserPerformAction(w.StretchNode) && s.type.resizableX && !s.removed && S(E.EWResize);
4872
4872
  }).on(I.MouseOut, (i, s) => {
4873
- this.canUserPerformAction(k.StretchNode) && s.type.resizableX && !s.removed && S();
4873
+ this.canUserPerformAction(w.StretchNode) && s.type.resizableX && !s.removed && S();
4874
4874
  }).call(
4875
- E.drag().on(A.Start, (i, s) => {
4876
- this.canUserPerformAction(k.StretchNode) && s.type.resizableX && !s.removed ? (S(T.EWResize), this.currentAction = new Y(
4875
+ L.drag().on(A.Start, (i, s) => {
4876
+ this.canUserPerformAction(w.StretchNode) && s.type.resizableX && !s.removed ? (S(E.EWResize), this.currentAction = new X(
4877
4877
  this,
4878
- k.StretchNode,
4878
+ w.StretchNode,
4879
4879
  s.id,
4880
4880
  s.getGeometry(),
4881
4881
  s.getGeometry()
4882
- )) : S(T.NotAllowed);
4882
+ )) : S(E.NotAllowed);
4883
4883
  }).on(A.Drag, (i, s) => {
4884
- if (this.canUserPerformAction(k.StretchNode) && s.type.resizableX && !s.removed) {
4884
+ if (this.canUserPerformAction(w.StretchNode) && s.type.resizableX && !s.removed) {
4885
4885
  const r = this.getPointerLocationRelativeToCanvas(i);
4886
4886
  s.stretch(u.Left, s.coords[0] - r[0]);
4887
4887
  }
4888
4888
  }).on(A.End, (i, s) => {
4889
- if (this.canUserPerformAction(k.StretchNode) && s.type.resizableX && !s.removed && this.currentAction instanceof Y && this.currentAction.intent === k.StretchNode) {
4889
+ if (this.canUserPerformAction(w.StretchNode) && s.type.resizableX && !s.removed && this.currentAction instanceof X && this.currentAction.intent === w.StretchNode) {
4890
4890
  let r = this.getPointerLocationRelativeToCanvas(i);
4891
4891
  this.snapToGrid && (r = this.getClosestGridPoint(r)), s.stretch(u.Left, s.coords[0] - r[0]), this.currentAction.to = s.getGeometry(), this.currentAction.do(), this.actionStack.add(this.currentAction), this.currentAction = void 0;
4892
4892
  }
4893
4893
  S();
4894
4894
  })
4895
4895
  ), l.filter(".resizable-y").append("line").attr("class", "top-resizer").attr("stroke", "transparent").attr("stroke-width", `${_}px`).on(I.MouseOver, (i, s) => {
4896
- this.canUserPerformAction(k.StretchNode) && s.type.resizableY && !s.removed && S(T.NSResize);
4896
+ this.canUserPerformAction(w.StretchNode) && s.type.resizableY && !s.removed && S(E.NSResize);
4897
4897
  }).on(I.MouseOut, (i, s) => {
4898
- this.canUserPerformAction(k.StretchNode) && s.type.resizableY && !s.removed && S();
4898
+ this.canUserPerformAction(w.StretchNode) && s.type.resizableY && !s.removed && S();
4899
4899
  }).call(
4900
- E.drag().on(A.Start, (i, s) => {
4901
- this.canUserPerformAction(k.StretchNode) && s.type.resizableY && !s.removed ? (S(T.NSResize), this.currentAction = new Y(
4900
+ L.drag().on(A.Start, (i, s) => {
4901
+ this.canUserPerformAction(w.StretchNode) && s.type.resizableY && !s.removed ? (S(E.NSResize), this.currentAction = new X(
4902
4902
  this,
4903
- k.StretchNode,
4903
+ w.StretchNode,
4904
4904
  s.id,
4905
4905
  s.getGeometry(),
4906
4906
  s.getGeometry()
4907
- )) : S(T.NotAllowed);
4907
+ )) : S(E.NotAllowed);
4908
4908
  }).on(A.Drag, (i, s) => {
4909
- if (this.canUserPerformAction(k.StretchNode) && s.type.resizableY && !s.removed) {
4909
+ if (this.canUserPerformAction(w.StretchNode) && s.type.resizableY && !s.removed) {
4910
4910
  const r = this.getPointerLocationRelativeToCanvas(i);
4911
4911
  s.stretch(u.Top, s.coords[1] - r[1]);
4912
4912
  }
4913
4913
  }).on(A.End, (i, s) => {
4914
- if (this.canUserPerformAction(k.StretchNode) && s.type.resizableY && !s.removed && this.currentAction instanceof Y && this.currentAction.intent === k.StretchNode) {
4914
+ if (this.canUserPerformAction(w.StretchNode) && s.type.resizableY && !s.removed && this.currentAction instanceof X && this.currentAction.intent === w.StretchNode) {
4915
4915
  let r = this.getPointerLocationRelativeToCanvas(i);
4916
4916
  this.snapToGrid && (r = this.getClosestGridPoint(r)), s.stretch(u.Top, s.coords[1] - r[1]), this.currentAction.to = s.getGeometry(), this.currentAction.do(), this.actionStack.add(this.currentAction), this.currentAction = void 0;
4917
4917
  }
4918
4918
  S();
4919
4919
  })
4920
4920
  ), l.filter(".resizable-x").append("line").attr("class", "right-resizer").attr("stroke", "transparent").attr("stroke-width", `${_}px`).on(I.MouseOver, (i, s) => {
4921
- this.canUserPerformAction(k.StretchNode) && s.type.resizableX && !s.removed && S(T.EWResize);
4921
+ this.canUserPerformAction(w.StretchNode) && s.type.resizableX && !s.removed && S(E.EWResize);
4922
4922
  }).on(I.MouseOut, (i, s) => {
4923
- this.canUserPerformAction(k.StretchNode) && s.type.resizableX && !s.removed && S();
4923
+ this.canUserPerformAction(w.StretchNode) && s.type.resizableX && !s.removed && S();
4924
4924
  }).call(
4925
- E.drag().on(A.Start, (i, s) => {
4926
- this.canUserPerformAction(k.StretchNode) && s.type.resizableX && !s.removed ? (S(T.EWResize), this.currentAction = new Y(
4925
+ L.drag().on(A.Start, (i, s) => {
4926
+ this.canUserPerformAction(w.StretchNode) && s.type.resizableX && !s.removed ? (S(E.EWResize), this.currentAction = new X(
4927
4927
  this,
4928
- k.StretchNode,
4928
+ w.StretchNode,
4929
4929
  s.id,
4930
4930
  s.getGeometry(),
4931
4931
  s.getGeometry()
4932
- )) : S(T.NotAllowed);
4932
+ )) : S(E.NotAllowed);
4933
4933
  }).on(A.Drag, (i, s) => {
4934
- if (this.canUserPerformAction(k.StretchNode) && s.type.resizableX && !s.removed) {
4934
+ if (this.canUserPerformAction(w.StretchNode) && s.type.resizableX && !s.removed) {
4935
4935
  const r = this.getPointerLocationRelativeToCanvas(i);
4936
4936
  s.stretch(u.Right, r[0] - (s.coords[0] + s.width));
4937
4937
  }
4938
4938
  }).on(A.End, (i, s) => {
4939
- if (this.canUserPerformAction(k.StretchNode) && s.type.resizableX && !s.removed && this.currentAction instanceof Y && this.currentAction.intent === k.StretchNode) {
4939
+ if (this.canUserPerformAction(w.StretchNode) && s.type.resizableX && !s.removed && this.currentAction instanceof X && this.currentAction.intent === w.StretchNode) {
4940
4940
  let r = this.getPointerLocationRelativeToCanvas(i);
4941
4941
  this.snapToGrid && (r = this.getClosestGridPoint(r)), s.stretch(u.Right, r[0] - (s.coords[0] + s.width)), this.currentAction.to = s.getGeometry(), this.currentAction.do(), this.actionStack.add(this.currentAction), this.currentAction = void 0;
4942
4942
  }
4943
4943
  S();
4944
4944
  })
4945
4945
  ), l.filter(".resizable-y").append("line").attr("class", "bottom-resizer").attr("stroke", "transparent").attr("stroke-width", `${_}px`).on(I.MouseOver, (i, s) => {
4946
- this.canUserPerformAction(k.StretchNode) && s.type.resizableY && !s.removed && S(T.NSResize);
4946
+ this.canUserPerformAction(w.StretchNode) && s.type.resizableY && !s.removed && S(E.NSResize);
4947
4947
  }).on(I.MouseOut, (i, s) => {
4948
- this.canUserPerformAction(k.StretchNode) && s.type.resizableY && !s.removed && S();
4948
+ this.canUserPerformAction(w.StretchNode) && s.type.resizableY && !s.removed && S();
4949
4949
  }).call(
4950
- E.drag().on(A.Start, (i, s) => {
4951
- this.canUserPerformAction(k.StretchNode) && s.type.resizableY && !s.removed ? (S(T.NSResize), this.currentAction = new Y(
4950
+ L.drag().on(A.Start, (i, s) => {
4951
+ this.canUserPerformAction(w.StretchNode) && s.type.resizableY && !s.removed ? (S(E.NSResize), this.currentAction = new X(
4952
4952
  this,
4953
- k.StretchNode,
4953
+ w.StretchNode,
4954
4954
  s.id,
4955
4955
  s.getGeometry(),
4956
4956
  s.getGeometry()
4957
- )) : S(T.NotAllowed);
4957
+ )) : S(E.NotAllowed);
4958
4958
  }).on(A.Drag, (i, s) => {
4959
- if (this.canUserPerformAction(k.StretchNode) && s.type.resizableY && !s.removed) {
4959
+ if (this.canUserPerformAction(w.StretchNode) && s.type.resizableY && !s.removed) {
4960
4960
  const r = this.getPointerLocationRelativeToCanvas(i);
4961
4961
  s.stretch(
4962
4962
  u.Bottom,
@@ -4964,7 +4964,7 @@ const ro = (o) => o * Math.PI / 180, Pe = (o, t, e) => {
4964
4964
  );
4965
4965
  }
4966
4966
  }).on(A.End, (i, s) => {
4967
- if (this.canUserPerformAction(k.StretchNode) && s.type.resizableY && !s.removed && this.currentAction instanceof Y && this.currentAction.intent === k.StretchNode) {
4967
+ if (this.canUserPerformAction(w.StretchNode) && s.type.resizableY && !s.removed && this.currentAction instanceof X && this.currentAction.intent === w.StretchNode) {
4968
4968
  let r = this.getPointerLocationRelativeToCanvas(i);
4969
4969
  this.snapToGrid && (r = this.getClosestGridPoint(r)), s.stretch(
4970
4970
  u.Bottom,
@@ -4991,7 +4991,7 @@ const ro = (o) => o * Math.PI / 180, Pe = (o, t, e) => {
4991
4991
  t && t.length > 0 && (e = e.filter((i) => t.includes(i.id)));
4992
4992
  const a = l.merge(e);
4993
4993
  n.remove(), l.on(I.MouseOver, (i, s) => {
4994
- this.dragging || (this.userHighlight.focusOn(s), this.diagramEvent$.next(new q(s)));
4994
+ this.dragging || (this.userHighlight.focusOn(s), this.diagramEvent$.next(new J(s)));
4995
4995
  }).on(I.Click, (i, s) => {
4996
4996
  if (!i.ctrlKey && !i.shiftKey) {
4997
4997
  const c = this.userSelection.all();
@@ -5012,10 +5012,10 @@ const ro = (o) => o * Math.PI / 180, Pe = (o, t, e) => {
5012
5012
  return;
5013
5013
  }
5014
5014
  const r = new pt(i, s);
5015
- if (this.diagramEvent$.next(r), !r.defaultPrevented && this.canUserPerformAction(k.ContextMenu)) {
5015
+ if (this.diagramEvent$.next(r), !r.defaultPrevented && this.canUserPerformAction(w.ContextMenu)) {
5016
5016
  i.preventDefault();
5017
5017
  const c = dt(s);
5018
- this.userHighlight.focusOn(c), this.diagramEvent$.next(new q(c)), this.userSelection.add(c), this.diagramEvent$.next(
5018
+ this.userHighlight.focusOn(c), this.diagramEvent$.next(new J(c)), this.userSelection.add(c), this.diagramEvent$.next(
5019
5019
  new F([c], !0)
5020
5020
  ), this.contextMenu.open(i);
5021
5021
  }
@@ -5023,19 +5023,19 @@ const ro = (o) => o * Math.PI / 180, Pe = (o, t, e) => {
5023
5023
  const r = new mt(i, s);
5024
5024
  this.diagramEvent$.next(r);
5025
5025
  }).call(
5026
- E.drag().filter((i) => (this.secondaryButton = vt(i), !0)).on(A.Start, (i, s) => {
5026
+ L.drag().filter((i) => (this.secondaryButton = vt(i), !0)).on(A.Start, (i, s) => {
5027
5027
  if (this.multipleSelectionOn || this.secondaryButton)
5028
5028
  this.startMultipleSelection(i);
5029
5029
  else {
5030
5030
  const r = s?.node;
5031
- r ? this.startMovingNode(i, r) : S(T.NotAllowed);
5031
+ r ? this.startMovingNode(i, r) : S(E.NotAllowed);
5032
5032
  }
5033
5033
  }).on(A.Drag, (i, s) => {
5034
5034
  if (this.multipleSelectionOn || this.secondaryButton)
5035
5035
  this.continueMultipleSelection(i);
5036
5036
  else {
5037
5037
  const r = s?.node;
5038
- r ? this.continueMovingNode(i, r) : S(T.NotAllowed);
5038
+ r ? this.continueMovingNode(i, r) : S(E.NotAllowed);
5039
5039
  }
5040
5040
  }).on(A.End, (i, s) => {
5041
5041
  if (this.multipleSelectionOn || this.secondaryButton)
@@ -5049,20 +5049,20 @@ const ro = (o) => o * Math.PI / 180, Pe = (o, t, e) => {
5049
5049
  ), ce(
5050
5050
  l
5051
5051
  ), l.filter(".resizable-x").append("line").attr("class", "left-resizer").attr("stroke", "transparent").attr("stroke-width", `${_}px`).on(I.MouseOver, (i, s) => {
5052
- this.canUserPerformAction(k.StretchSection) && s.getResizableX() && !s.removed && S(T.EWResize);
5052
+ this.canUserPerformAction(w.StretchSection) && s.getResizableX() && !s.removed && S(E.EWResize);
5053
5053
  }).on(I.MouseOut, (i, s) => {
5054
- this.canUserPerformAction(k.StretchSection) && s.getResizableX() && !s.removed && S();
5054
+ this.canUserPerformAction(w.StretchSection) && s.getResizableX() && !s.removed && S();
5055
5055
  }).call(
5056
- E.drag().on(A.Start, (i, s) => {
5057
- this.canUserPerformAction(k.StretchSection) && s.getResizableX() && !s.removed && s.node ? (S(T.EWResize), this.currentAction = new Y(
5056
+ L.drag().on(A.Start, (i, s) => {
5057
+ this.canUserPerformAction(w.StretchSection) && s.getResizableX() && !s.removed && s.node ? (S(E.EWResize), this.currentAction = new X(
5058
5058
  this,
5059
- k.StretchSection,
5059
+ w.StretchSection,
5060
5060
  s.node.id,
5061
5061
  s.node.getGeometry(),
5062
5062
  s.node.getGeometry()
5063
- )) : S(T.NotAllowed);
5063
+ )) : S(E.NotAllowed);
5064
5064
  }).on(A.Drag, (i, s) => {
5065
- if (this.canUserPerformAction(k.StretchSection) && s.getResizableX() && !s.removed && s.node) {
5065
+ if (this.canUserPerformAction(w.StretchSection) && s.getResizableX() && !s.removed && s.node) {
5066
5066
  const r = this.getPointerLocationRelativeToCanvas(i);
5067
5067
  s.node.stretchSections(
5068
5068
  u.Left,
@@ -5072,7 +5072,7 @@ const ro = (o) => o * Math.PI / 180, Pe = (o, t, e) => {
5072
5072
  );
5073
5073
  }
5074
5074
  }).on(A.End, (i, s) => {
5075
- if (this.canUserPerformAction(k.StretchSection) && s.getResizableX() && !s.removed && this.currentAction instanceof Y && this.currentAction.intent === k.StretchSection && s.node) {
5075
+ if (this.canUserPerformAction(w.StretchSection) && s.getResizableX() && !s.removed && this.currentAction instanceof X && this.currentAction.intent === w.StretchSection && s.node) {
5076
5076
  let r = this.getPointerLocationRelativeToCanvas(i);
5077
5077
  this.snapToGrid && (r = this.getClosestGridPoint(r)), s.node.stretchSections(
5078
5078
  u.Left,
@@ -5084,20 +5084,20 @@ const ro = (o) => o * Math.PI / 180, Pe = (o, t, e) => {
5084
5084
  S();
5085
5085
  })
5086
5086
  ), l.filter(".resizable-y").append("line").attr("class", "top-resizer").attr("stroke", "transparent").attr("stroke-width", `${_}px`).on(I.MouseOver, (i, s) => {
5087
- this.canUserPerformAction(k.StretchSection) && s.getResizableY() && !s.removed && S(T.NSResize);
5087
+ this.canUserPerformAction(w.StretchSection) && s.getResizableY() && !s.removed && S(E.NSResize);
5088
5088
  }).on(I.MouseOut, (i, s) => {
5089
- this.canUserPerformAction(k.StretchSection) && s.getResizableY() && !s.removed && S();
5089
+ this.canUserPerformAction(w.StretchSection) && s.getResizableY() && !s.removed && S();
5090
5090
  }).call(
5091
- E.drag().on(A.Start, (i, s) => {
5092
- this.canUserPerformAction(k.StretchSection) && s.getResizableY() && !s.removed && s.node ? (S(T.NSResize), this.currentAction = new Y(
5091
+ L.drag().on(A.Start, (i, s) => {
5092
+ this.canUserPerformAction(w.StretchSection) && s.getResizableY() && !s.removed && s.node ? (S(E.NSResize), this.currentAction = new X(
5093
5093
  this,
5094
- k.StretchSection,
5094
+ w.StretchSection,
5095
5095
  s.node.id,
5096
5096
  s.node.getGeometry(),
5097
5097
  s.node.getGeometry()
5098
- )) : S(T.NotAllowed);
5098
+ )) : S(E.NotAllowed);
5099
5099
  }).on(A.Drag, (i, s) => {
5100
- if (this.canUserPerformAction(k.StretchSection) && s.getResizableY() && !s.removed && s.node) {
5100
+ if (this.canUserPerformAction(w.StretchSection) && s.getResizableY() && !s.removed && s.node) {
5101
5101
  const r = this.getPointerLocationRelativeToCanvas(i);
5102
5102
  s.node.stretchSections(
5103
5103
  u.Top,
@@ -5107,7 +5107,7 @@ const ro = (o) => o * Math.PI / 180, Pe = (o, t, e) => {
5107
5107
  );
5108
5108
  }
5109
5109
  }).on(A.End, (i, s) => {
5110
- if (this.canUserPerformAction(k.StretchSection) && s.getResizableY() && !s.removed && this.currentAction instanceof Y && this.currentAction.intent === k.StretchSection && s.node) {
5110
+ if (this.canUserPerformAction(w.StretchSection) && s.getResizableY() && !s.removed && this.currentAction instanceof X && this.currentAction.intent === w.StretchSection && s.node) {
5111
5111
  let r = this.getPointerLocationRelativeToCanvas(i);
5112
5112
  this.snapToGrid && (r = this.getClosestGridPoint(r)), s.node.stretchSections(
5113
5113
  u.Top,
@@ -5119,20 +5119,20 @@ const ro = (o) => o * Math.PI / 180, Pe = (o, t, e) => {
5119
5119
  S();
5120
5120
  })
5121
5121
  ), l.filter(".resizable-x").append("line").attr("class", "right-resizer").attr("stroke", "transparent").attr("stroke-width", `${_}px`).on(I.MouseOver, (i, s) => {
5122
- this.canUserPerformAction(k.StretchSection) && s.getResizableX() && !s.removed && S(T.EWResize);
5122
+ this.canUserPerformAction(w.StretchSection) && s.getResizableX() && !s.removed && S(E.EWResize);
5123
5123
  }).on(I.MouseOut, (i, s) => {
5124
- this.canUserPerformAction(k.StretchSection) && s.getResizableX() && !s.removed && S();
5124
+ this.canUserPerformAction(w.StretchSection) && s.getResizableX() && !s.removed && S();
5125
5125
  }).call(
5126
- E.drag().on(A.Start, (i, s) => {
5127
- this.canUserPerformAction(k.StretchSection) && s.getResizableX() && !s.removed && s.node ? (S(T.EWResize), this.currentAction = new Y(
5126
+ L.drag().on(A.Start, (i, s) => {
5127
+ this.canUserPerformAction(w.StretchSection) && s.getResizableX() && !s.removed && s.node ? (S(E.EWResize), this.currentAction = new X(
5128
5128
  this,
5129
- k.StretchSection,
5129
+ w.StretchSection,
5130
5130
  s.node.id,
5131
5131
  s.node.getGeometry(),
5132
5132
  s.node.getGeometry()
5133
- )) : S(T.NotAllowed);
5133
+ )) : S(E.NotAllowed);
5134
5134
  }).on(A.Drag, (i, s) => {
5135
- if (this.canUserPerformAction(k.StretchSection) && s.getResizableX() && !s.removed && s.node) {
5135
+ if (this.canUserPerformAction(w.StretchSection) && s.getResizableX() && !s.removed && s.node) {
5136
5136
  const r = this.getPointerLocationRelativeToCanvas(i);
5137
5137
  s.node.stretchSections(
5138
5138
  u.Right,
@@ -5142,7 +5142,7 @@ const ro = (o) => o * Math.PI / 180, Pe = (o, t, e) => {
5142
5142
  );
5143
5143
  }
5144
5144
  }).on(A.End, (i, s) => {
5145
- if (this.canUserPerformAction(k.StretchSection) && s.getResizableX() && !s.removed && this.currentAction instanceof Y && this.currentAction.intent === k.StretchSection && s.node) {
5145
+ if (this.canUserPerformAction(w.StretchSection) && s.getResizableX() && !s.removed && this.currentAction instanceof X && this.currentAction.intent === w.StretchSection && s.node) {
5146
5146
  let r = this.getPointerLocationRelativeToCanvas(i);
5147
5147
  this.snapToGrid && (r = this.getClosestGridPoint(r)), s.node.stretchSections(
5148
5148
  u.Right,
@@ -5154,20 +5154,20 @@ const ro = (o) => o * Math.PI / 180, Pe = (o, t, e) => {
5154
5154
  S();
5155
5155
  })
5156
5156
  ), l.filter(".resizable-y").append("line").attr("class", "bottom-resizer").attr("stroke", "transparent").attr("stroke-width", `${_}px`).on(I.MouseOver, (i, s) => {
5157
- this.canUserPerformAction(k.StretchSection) && s.getResizableY() && !s.removed && S(T.NSResize);
5157
+ this.canUserPerformAction(w.StretchSection) && s.getResizableY() && !s.removed && S(E.NSResize);
5158
5158
  }).on(I.MouseOut, (i, s) => {
5159
- this.canUserPerformAction(k.StretchSection) && s.getResizableY() && !s.removed && S();
5159
+ this.canUserPerformAction(w.StretchSection) && s.getResizableY() && !s.removed && S();
5160
5160
  }).call(
5161
- E.drag().on(A.Start, (i, s) => {
5162
- this.canUserPerformAction(k.StretchSection) && s.getResizableY() && !s.removed && s.node ? (S(T.NSResize), this.currentAction = new Y(
5161
+ L.drag().on(A.Start, (i, s) => {
5162
+ this.canUserPerformAction(w.StretchSection) && s.getResizableY() && !s.removed && s.node ? (S(E.NSResize), this.currentAction = new X(
5163
5163
  this,
5164
- k.StretchSection,
5164
+ w.StretchSection,
5165
5165
  s.node.id,
5166
5166
  s.node.getGeometry(),
5167
5167
  s.node.getGeometry()
5168
- )) : S(T.NotAllowed);
5168
+ )) : S(E.NotAllowed);
5169
5169
  }).on(A.Drag, (i, s) => {
5170
- if (this.canUserPerformAction(k.StretchSection) && s.getResizableY() && !s.removed && s.node) {
5170
+ if (this.canUserPerformAction(w.StretchSection) && s.getResizableY() && !s.removed && s.node) {
5171
5171
  const r = this.getPointerLocationRelativeToCanvas(i);
5172
5172
  s.node.stretchSections(
5173
5173
  u.Bottom,
@@ -5177,7 +5177,7 @@ const ro = (o) => o * Math.PI / 180, Pe = (o, t, e) => {
5177
5177
  );
5178
5178
  }
5179
5179
  }).on(A.End, (i, s) => {
5180
- if (this.canUserPerformAction(k.StretchSection) && s.getResizableY() && !s.removed && this.currentAction instanceof Y && this.currentAction.intent === k.StretchSection && s.node) {
5180
+ if (this.canUserPerformAction(w.StretchSection) && s.getResizableY() && !s.removed && this.currentAction instanceof X && this.currentAction.intent === w.StretchSection && s.node) {
5181
5181
  let r = this.getPointerLocationRelativeToCanvas(i);
5182
5182
  this.snapToGrid && (r = this.getClosestGridPoint(r)), s.node.stretchSections(
5183
5183
  u.Bottom,
@@ -5203,7 +5203,7 @@ const ro = (o) => o * Math.PI / 180, Pe = (o, t, e) => {
5203
5203
  t && t.length > 0 && (e = e.filter((i) => t.includes(i.id)));
5204
5204
  const a = l.merge(e);
5205
5205
  n.remove(), l.on(I.MouseOver, (i, s) => {
5206
- !this.unfinishedConnection && !this.dragging && (this.userHighlight.focusOn(s), this.diagramEvent$.next(new q(s))), this.unfinishedConnection && (// can start at the starting port
5206
+ !this.unfinishedConnection && !this.dragging && (this.userHighlight.focusOn(s), this.diagramEvent$.next(new J(s))), this.unfinishedConnection && (// can start at the starting port
5207
5207
  this.unfinishedConnection.type.canStartFromType(
5208
5208
  this.unfinishedConnection.start?.getNode()?.type?.id || ""
5209
5209
  ) && this.unfinishedConnection.start?.allowsOutgoing && // can end at the ending port
@@ -5215,9 +5215,9 @@ const ro = (o) => o * Math.PI / 180, Pe = (o, t, e) => {
5215
5215
  ) && s.allowsOutgoing && // can end at the starting port
5216
5216
  this.unfinishedConnection.type.canFinishOnType(
5217
5217
  this.unfinishedConnection.start?.getNode()?.type?.id || ""
5218
- ) && this.unfinishedConnection.start?.allowsIncoming || S(T.NoDrop));
5218
+ ) && this.unfinishedConnection.start?.allowsIncoming || S(E.NoDrop));
5219
5219
  }).on(I.MouseOut, () => {
5220
- this.unfinishedConnection && S(T.Grabbing);
5220
+ this.unfinishedConnection && S(E.Grabbing);
5221
5221
  }).on(I.Click, (i, s) => {
5222
5222
  if (!i.ctrlKey && !i.shiftKey) {
5223
5223
  const c = this.userSelection.all();
@@ -5238,10 +5238,10 @@ const ro = (o) => o * Math.PI / 180, Pe = (o, t, e) => {
5238
5238
  return;
5239
5239
  }
5240
5240
  const r = new pt(i, s);
5241
- if (this.diagramEvent$.next(r), !r.defaultPrevented && this.canUserPerformAction(k.ContextMenu)) {
5241
+ if (this.diagramEvent$.next(r), !r.defaultPrevented && this.canUserPerformAction(w.ContextMenu)) {
5242
5242
  i.preventDefault();
5243
5243
  const c = dt(s);
5244
- this.userHighlight.focusOn(c), this.diagramEvent$.next(new q(c)), this.userSelection.add(c), this.diagramEvent$.next(
5244
+ this.userHighlight.focusOn(c), this.diagramEvent$.next(new J(c)), this.userSelection.add(c), this.diagramEvent$.next(
5245
5245
  new F([c], !0)
5246
5246
  ), this.contextMenu.open(i);
5247
5247
  }
@@ -5249,24 +5249,24 @@ const ro = (o) => o * Math.PI / 180, Pe = (o, t, e) => {
5249
5249
  const r = new mt(i, s);
5250
5250
  this.diagramEvent$.next(r);
5251
5251
  }).call(
5252
- E.drag().filter((i) => (this.secondaryButton = vt(i), !0)).on(A.Start, (i, s) => {
5253
- this.multipleSelectionOn || this.secondaryButton ? this.startMultipleSelection(i) : this.canUserPerformAction(k.AddConnection) && (this.allowSharingPorts || s.incomingConnections.length === 0 && s.outgoingConnections.length === 0) && !s.removed ? (S(T.Grabbing), this.startConnection(s), this.unfinishedConnection && (this.unfinishedConnectionTracer = this.selectCanvasElements().append("path").attr("stroke", "none").attr("fill", "none"))) : S(T.NotAllowed);
5252
+ L.drag().filter((i) => (this.secondaryButton = vt(i), !0)).on(A.Start, (i, s) => {
5253
+ this.multipleSelectionOn || this.secondaryButton ? this.startMultipleSelection(i) : this.canUserPerformAction(w.AddConnection) && (this.allowSharingPorts || s.incomingConnections.length === 0 && s.outgoingConnections.length === 0) && !s.removed ? (S(E.Grabbing), this.startConnection(s), this.unfinishedConnection && (this.unfinishedConnectionTracer = this.selectCanvasElements().append("path").attr("stroke", "none").attr("fill", "none"))) : S(E.NotAllowed);
5254
5254
  }).on(A.Drag, (i, s) => {
5255
5255
  if (this.multipleSelectionOn || this.secondaryButton)
5256
5256
  this.continueMultipleSelection(i);
5257
- else if (this.canUserPerformAction(k.AddConnection) && !s.removed && this.unfinishedConnection !== void 0) {
5257
+ else if (this.canUserPerformAction(w.AddConnection) && !s.removed && this.unfinishedConnection !== void 0) {
5258
5258
  const r = [i.x, i.y];
5259
5259
  this.unfinishedConnectionTracer?.attr(
5260
5260
  "d",
5261
5261
  le(
5262
- this.unfinishedConnection.look.shape || Q.look.shape,
5262
+ this.unfinishedConnection.look.shape || tt.look.shape,
5263
5263
  this.unfinishedConnection.startCoords,
5264
5264
  r,
5265
5265
  this.unfinishedConnection.startDirection,
5266
5266
  this.unfinishedConnection.endDirection,
5267
- this.unfinishedConnection.look.thickness || Q.look.thickness,
5268
- this.unfinishedConnection.startMarkerLook?.width,
5269
- this.unfinishedConnection.endMarkerLook?.width
5267
+ this.unfinishedConnection.type.defaultLook.thickness || tt.look.thickness,
5268
+ this.unfinishedConnection.type.defaultStartMarkerLook?.width,
5269
+ this.unfinishedConnection.type.defaultEndMarkerLook?.width
5270
5270
  )
5271
5271
  );
5272
5272
  const c = this.unfinishedConnectionTracer?.node();
@@ -5297,18 +5297,18 @@ const ro = (o) => o * Math.PI / 180, Pe = (o, t, e) => {
5297
5297
  if (this.multipleSelectionOn || this.secondaryButton)
5298
5298
  this.finishMultipleSelection(i);
5299
5299
  else {
5300
- if (this.canUserPerformAction(k.AddConnection) && !s.removed) {
5300
+ if (this.canUserPerformAction(w.AddConnection) && !s.removed) {
5301
5301
  this.unfinishedConnectionTracer?.remove();
5302
5302
  const r = this.userHighlight.getFocus();
5303
5303
  if (r instanceof bt)
5304
5304
  this.finishConnection(r);
5305
5305
  else if (r instanceof ht && r.rootElement instanceof bt)
5306
5306
  this.finishConnection(r.rootElement);
5307
- else if (r instanceof z || r instanceof B || r instanceof ht) {
5307
+ else if (r instanceof z || r instanceof G || r instanceof ht) {
5308
5308
  let c;
5309
- if (r instanceof z || r instanceof B)
5309
+ if (r instanceof z || r instanceof G)
5310
5310
  c = r;
5311
- else if (r.rootElement instanceof z || r.rootElement instanceof B)
5311
+ else if (r.rootElement instanceof z || r.rootElement instanceof G)
5312
5312
  c = r.rootElement;
5313
5313
  else {
5314
5314
  this.dropConnection();
@@ -5345,7 +5345,7 @@ const ro = (o) => o * Math.PI / 180, Pe = (o, t, e) => {
5345
5345
  t && t.length > 0 && (n = n.filter((s) => t.includes(s.id)));
5346
5346
  const i = a.merge(n);
5347
5347
  l.remove(), a.on(I.MouseOver, (s, r) => {
5348
- r.end !== void 0 && !this.dragging && (this.userHighlight.focusOn(r), this.diagramEvent$.next(new q(r)));
5348
+ r.end !== void 0 && !this.dragging && (this.userHighlight.focusOn(r), this.diagramEvent$.next(new J(r)));
5349
5349
  }).on(I.Click, (s, r) => {
5350
5350
  if (!s.ctrlKey && !s.shiftKey) {
5351
5351
  const c = this.userSelection.all();
@@ -5360,12 +5360,12 @@ const ro = (o) => o * Math.PI / 180, Pe = (o, t, e) => {
5360
5360
  return;
5361
5361
  }
5362
5362
  const c = new pt(s, r);
5363
- this.diagramEvent$.next(c), !c.defaultPrevented && this.canUserPerformAction(k.ContextMenu) && (s.preventDefault(), this.userHighlight.focusOn(r), this.diagramEvent$.next(new q(r)), this.userSelection.add(r), this.diagramEvent$.next(new F([r], !0)), this.contextMenu.open(s));
5363
+ this.diagramEvent$.next(c), !c.defaultPrevented && this.canUserPerformAction(w.ContextMenu) && (s.preventDefault(), this.userHighlight.focusOn(r), this.diagramEvent$.next(new J(r)), this.userSelection.add(r), this.diagramEvent$.next(new F([r], !0)), this.contextMenu.open(s));
5364
5364
  }).on(I.DoubleClick, (s, r) => {
5365
5365
  const c = new mt(s, r);
5366
5366
  this.diagramEvent$.next(c);
5367
5367
  }).call(
5368
- E.drag().filter((s) => (this.secondaryButton = vt(s), !0)).on(A.Start, (s) => {
5368
+ L.drag().filter((s) => (this.secondaryButton = vt(s), !0)).on(A.Start, (s) => {
5369
5369
  this.startMultipleSelection(s);
5370
5370
  }).on(A.Drag, (s) => {
5371
5371
  this.continueMultipleSelection(s);
@@ -5375,44 +5375,44 @@ const ro = (o) => o * Math.PI / 180, Pe = (o, t, e) => {
5375
5375
  ), a.append("path").attr("class", "diagram-connection-path"), a.append("path").attr("class", "diagram-connection-path-box"), a.append("marker").attr("id", (s) => `${s.id}-start-marker`).attr("class", "diagram-connection-start-marker").append("image").attr("preserveAspectRatio", "none"), a.append("marker").attr("id", (s) => `${s.id}-end-marker`).attr("class", "diagram-connection-end-marker").append("image").attr("preserveAspectRatio", "none"), a.append("g").attr("class", "diagram-connection-start-label"), a.select("g.diagram-connection-start-label").append("path"), a.select("g.diagram-connection-start-label").append("text").style("user-select", "none"), a.append("g").attr("class", "diagram-connection-middle-label"), a.select("g.diagram-connection-middle-label").append("path"), a.select("g.diagram-connection-middle-label").append("text").style("user-select", "none"), a.append("g").attr("class", "diagram-connection-end-label"), a.select("g.diagram-connection-end-label").append("path"), a.select("g.diagram-connection-end-label").append("text").style("user-select", "none"), i.attr("opacity", (s) => s.removed ? 0.5 : 1).select("path.diagram-connection-path").attr(
5376
5376
  "d",
5377
5377
  (s) => le(
5378
- s.look.shape || Q.look.shape,
5378
+ s.look.shape || tt.look.shape,
5379
5379
  s.startCoords,
5380
5380
  s.endCoords,
5381
5381
  s.startDirection,
5382
5382
  s.endDirection,
5383
- s.look.thickness || Q.look.thickness,
5384
- s.startMarkerLook?.width,
5385
- s.endMarkerLook?.width
5383
+ s.type.defaultLook.thickness || tt.look.thickness,
5384
+ s.type.defaultStartMarkerLook?.width,
5385
+ s.type.defaultEndMarkerLook?.width
5386
5386
  )
5387
5387
  ).attr("marker-start", (s) => `url(#${s.id}-start-marker)`).attr("marker-end", (s) => `url(#${s.id}-end-marker)`).attr(
5388
5388
  "stroke",
5389
- (s) => s.look.color || Q.look.color
5389
+ (s) => s.look.color || tt.look.color
5390
5390
  ).attr("stroke-width", (s) => `${s.look.thickness}px`).attr(
5391
5391
  "stroke-dasharray",
5392
5392
  (s) => fe(
5393
- s.look.style || Q.look.style,
5394
- s.look.thickness || Q.look.thickness
5393
+ s.look.style || tt.look.style,
5394
+ s.type.defaultLook.thickness || tt.look.thickness
5395
5395
  )
5396
5396
  ).attr("fill", "none"), i.select("path.diagram-connection-path-box").attr(
5397
5397
  "d",
5398
5398
  (s) => le(
5399
- s.look.shape || Q.look.shape,
5399
+ s.look.shape || tt.look.shape,
5400
5400
  s.startCoords,
5401
5401
  s.endCoords,
5402
5402
  s.startDirection,
5403
5403
  s.endDirection,
5404
- s.look.thickness || Q.look.thickness,
5405
- s.startMarkerLook?.width,
5406
- s.endMarkerLook?.width
5404
+ s.type.defaultLook.thickness || tt.look.thickness,
5405
+ s.type.defaultStartMarkerLook?.width,
5406
+ s.type.defaultEndMarkerLook?.width
5407
5407
  )
5408
5408
  ).attr("stroke", "transparent").attr("pointer-events", "stroke").attr(
5409
5409
  "stroke-width",
5410
- (s) => `${(s.look.thickness || Q.look.thickness) + ao}px`
5410
+ (s) => `${(s.look.thickness || tt.look.thickness) + ao}px`
5411
5411
  ).attr(
5412
5412
  "stroke-dasharray",
5413
5413
  (s) => fe(
5414
- s.look.style || Q.look.style,
5415
- s.look.thickness || Q.look.thickness
5414
+ s.look.style || tt.look.style,
5415
+ s.type.defaultLook.thickness || tt.look.thickness
5416
5416
  )
5417
5417
  ).attr("fill", "none"), i.data().forEach((s) => {
5418
5418
  this.updateConnectionLabelsInView(s), this.updateConnectionMarkersInView(s);
@@ -5431,7 +5431,7 @@ const ro = (o) => o * Math.PI / 180, Pe = (o, t, e) => {
5431
5431
  t && t.length > 0 && (e = e.filter((i) => t.includes(i.id)));
5432
5432
  const a = l.merge(e);
5433
5433
  n.remove(), l.style("box-sizing", "border-box").on(I.MouseOver, (i, s) => {
5434
- this.dragging || (this.userHighlight.focusOn(s), this.diagramEvent$.next(new q(s)));
5434
+ this.dragging || (this.userHighlight.focusOn(s), this.diagramEvent$.next(new J(s)));
5435
5435
  }).on(I.Click, (i, s) => {
5436
5436
  if (!i.ctrlKey && !i.shiftKey) {
5437
5437
  const c = this.userSelection.all();
@@ -5452,16 +5452,16 @@ const ro = (o) => o * Math.PI / 180, Pe = (o, t, e) => {
5452
5452
  return;
5453
5453
  }
5454
5454
  const r = new pt(i, s);
5455
- if (this.diagramEvent$.next(r), !r.defaultPrevented && this.canUserPerformAction(k.ContextMenu)) {
5455
+ if (this.diagramEvent$.next(r), !r.defaultPrevented && this.canUserPerformAction(w.ContextMenu)) {
5456
5456
  i.preventDefault();
5457
5457
  const c = dt(s);
5458
- this.userHighlight.focusOn(c), this.diagramEvent$.next(new q(c)), this.userSelection.add(c), this.diagramEvent$.next(
5458
+ this.userHighlight.focusOn(c), this.diagramEvent$.next(new J(c)), this.userSelection.add(c), this.diagramEvent$.next(
5459
5459
  new F([c], !0)
5460
5460
  ), this.contextMenu.open(i);
5461
5461
  }
5462
5462
  }).on(I.DoubleClick, (i, s) => {
5463
5463
  const r = new mt(i, s);
5464
- this.diagramEvent$.next(r), !r.defaultPrevented && this.canUserPerformAction(k.EditField) && s.editable && !s.removed && (this.currentAction = new Ne(this, s.id, s.text, ""), this.createInputField(
5464
+ this.diagramEvent$.next(r), !r.defaultPrevented && this.canUserPerformAction(w.EditField) && s.editable && !s.removed && (this.currentAction = new Ne(this, s.id, s.text, ""), this.createInputField(
5465
5465
  s.text,
5466
5466
  s.coords,
5467
5467
  s.width,
@@ -5476,32 +5476,32 @@ const ro = (o) => o * Math.PI / 180, Pe = (o, t, e) => {
5476
5476
  }
5477
5477
  ));
5478
5478
  }).call(
5479
- E.drag().filter((i) => (this.secondaryButton = vt(i), !0)).on(A.Start, (i, s) => {
5479
+ L.drag().filter((i) => (this.secondaryButton = vt(i), !0)).on(A.Start, (i, s) => {
5480
5480
  if (this.multipleSelectionOn || this.secondaryButton)
5481
5481
  this.startMultipleSelection(i);
5482
5482
  else {
5483
5483
  let r;
5484
- s.rootElement instanceof z ? r = s.rootElement : s.rootElement instanceof B && (r = s.rootElement.node), r ? this.startMovingNode(i, r) : S(T.NotAllowed);
5484
+ s.rootElement instanceof z ? r = s.rootElement : s.rootElement instanceof G && (r = s.rootElement.node), r ? this.startMovingNode(i, r) : S(E.NotAllowed);
5485
5485
  }
5486
5486
  }).on(A.Drag, (i, s) => {
5487
5487
  if (this.multipleSelectionOn || this.secondaryButton)
5488
5488
  this.continueMultipleSelection(i);
5489
5489
  else {
5490
5490
  let r;
5491
- s.rootElement instanceof z ? r = s.rootElement : s.rootElement instanceof B && (r = s.rootElement.node), r ? this.continueMovingNode(i, r) : S(T.NotAllowed);
5491
+ s.rootElement instanceof z ? r = s.rootElement : s.rootElement instanceof G && (r = s.rootElement.node), r ? this.continueMovingNode(i, r) : S(E.NotAllowed);
5492
5492
  }
5493
5493
  }).on(A.End, (i, s) => {
5494
5494
  if (this.multipleSelectionOn || this.secondaryButton)
5495
5495
  this.finishMultipleSelection(i);
5496
5496
  else {
5497
5497
  let r;
5498
- s.rootElement instanceof z ? r = s.rootElement : s.rootElement instanceof B && (r = s.rootElement.node), r ? this.finishMovingNode(i, r) : S();
5498
+ s.rootElement instanceof z ? r = s.rootElement : s.rootElement instanceof G && (r = s.rootElement.node), r ? this.finishMovingNode(i, r) : S();
5499
5499
  }
5500
5500
  this.secondaryButton = !1;
5501
5501
  })
5502
5502
  ).append("xhtml:div").style("width", "100%").style("height", "100%").style("display", "flex").append("xhtml:p").style("box-sizing", "border-box").style("outline", 0).style("margin", 0).style("border", 0).style("padding", 0).style("user-select", "none").style("font-kerning", "none").style("white-space", "nowrap"), a.attr("x", 0).attr("y", 0).attr("width", (i) => `${i.width}px`).attr("height", (i) => `${i.height}px`).attr("transform", (i) => `translate(${i.coords[0]},${i.coords[1]})`).attr("opacity", (i) => i.removed ? 0.5 : 1).select("div").style(
5503
5503
  "justify-content",
5504
- (i) => i.horizontalAlign === Tt.Center ? "center" : i.horizontalAlign === Tt.Right ? "flex-end" : "flex-start"
5504
+ (i) => i.horizontalAlign === Et.Center ? "center" : i.horizontalAlign === Et.Right ? "flex-end" : "flex-start"
5505
5505
  ).style(
5506
5506
  "align-items",
5507
5507
  (i) => i.verticalAlign === Zt.Center ? "center" : i.verticalAlign === Zt.Bottom ? "end" : "start"
@@ -5513,7 +5513,7 @@ const ro = (o) => o * Math.PI / 180, Pe = (o, t, e) => {
5513
5513
  (i) => i.fit ? "default" : `${Pe(i.width, i.height, i.orientation)[1]}px`
5514
5514
  ).style("overflow", (i) => i.fit ? "default" : "clip").style("text-overflow", (i) => i.fit ? "default" : "ellipsis").style(
5515
5515
  "text-align",
5516
- (i) => i.horizontalAlign === Tt.Center ? "center" : i.horizontalAlign === Tt.Right ? "end" : "start"
5516
+ (i) => i.horizontalAlign === Et.Center ? "center" : i.horizontalAlign === Et.Right ? "end" : "start"
5517
5517
  ).style("transform", (i) => `rotate(${i.orientation}deg)`).style("font-size", (i) => `${i.fontSize}px`).style(
5518
5518
  "font-family",
5519
5519
  (i) => i.fontFamily || "'Wonder Unit Sans', sans-serif"
@@ -5540,12 +5540,12 @@ const ro = (o) => o * Math.PI / 180, Pe = (o, t, e) => {
5540
5540
  return;
5541
5541
  }
5542
5542
  const r = new pt(i, s);
5543
- this.diagramEvent$.next(r), !r.defaultPrevented && this.canUserPerformAction(k.ContextMenu) && (i.preventDefault(), this.contextMenu.open(i));
5543
+ this.diagramEvent$.next(r), !r.defaultPrevented && this.canUserPerformAction(w.ContextMenu) && (i.preventDefault(), this.contextMenu.open(i));
5544
5544
  }).on(I.DoubleClick, (i, s) => {
5545
5545
  const r = new mt(i, s);
5546
5546
  this.diagramEvent$.next(r);
5547
5547
  }).call(
5548
- E.drag().filter((i) => (this.secondaryButton = vt(i), !0)).on(A.Start, (i) => {
5548
+ L.drag().filter((i) => (this.secondaryButton = vt(i), !0)).on(A.Start, (i) => {
5549
5549
  (this.multipleSelectionOn || this.secondaryButton) && this.startMultipleSelection(i);
5550
5550
  }).on(A.Drag, (i) => {
5551
5551
  (this.multipleSelectionOn || this.secondaryButton) && this.continueMultipleSelection(i);
@@ -5565,7 +5565,7 @@ const ro = (o) => o * Math.PI / 180, Pe = (o, t, e) => {
5565
5565
  );
5566
5566
  const n = e.exit(), l = e.enter().append("foreignObject").attr("id", (i) => i.id).attr("class", "diagram-decorator");
5567
5567
  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), n.remove(), l.on(I.MouseOver, (i, s) => {
5568
- this.dragging || (this.userHighlight.focusOn(s), this.diagramEvent$.next(new q(s)));
5568
+ this.dragging || (this.userHighlight.focusOn(s), this.diagramEvent$.next(new J(s)));
5569
5569
  }).on(I.Click, (i, s) => {
5570
5570
  if (!i.ctrlKey && !i.shiftKey) {
5571
5571
  const r = this.userSelection.all();
@@ -5588,11 +5588,11 @@ const ro = (o) => o * Math.PI / 180, Pe = (o, t, e) => {
5588
5588
  return;
5589
5589
  }
5590
5590
  const r = new pt(i, s);
5591
- if (this.diagramEvent$.next(r), !r.defaultPrevented && this.canUserPerformAction(k.ContextMenu) && s.rootElement) {
5591
+ if (this.diagramEvent$.next(r), !r.defaultPrevented && this.canUserPerformAction(w.ContextMenu) && s.rootElement) {
5592
5592
  i.preventDefault();
5593
5593
  const c = dt(s.rootElement);
5594
5594
  this.userHighlight.focusOn(c), this.diagramEvent$.next(
5595
- new q(c)
5595
+ new J(c)
5596
5596
  ), this.userSelection.add(c), this.diagramEvent$.next(
5597
5597
  new F([c], !0)
5598
5598
  ), this.contextMenu.open(i);
@@ -5601,26 +5601,26 @@ const ro = (o) => o * Math.PI / 180, Pe = (o, t, e) => {
5601
5601
  const r = new mt(i, s);
5602
5602
  this.diagramEvent$.next(r);
5603
5603
  }).call(
5604
- E.drag().filter((i) => (this.secondaryButton = vt(i), !0)).on(A.Start, (i, s) => {
5604
+ L.drag().filter((i) => (this.secondaryButton = vt(i), !0)).on(A.Start, (i, s) => {
5605
5605
  if (this.multipleSelectionOn || this.secondaryButton)
5606
5606
  this.startMultipleSelection(i);
5607
5607
  else {
5608
5608
  let r;
5609
- s.rootElement instanceof z ? r = s.rootElement : s.rootElement instanceof B && (r = s.rootElement.node), r ? this.startMovingNode(i, r) : S(T.NotAllowed);
5609
+ s.rootElement instanceof z ? r = s.rootElement : s.rootElement instanceof G && (r = s.rootElement.node), r ? this.startMovingNode(i, r) : S(E.NotAllowed);
5610
5610
  }
5611
5611
  }).on(A.Drag, (i, s) => {
5612
5612
  if (this.multipleSelectionOn || this.secondaryButton)
5613
5613
  this.continueMultipleSelection(i);
5614
5614
  else {
5615
5615
  let r;
5616
- s.rootElement instanceof z ? r = s.rootElement : s.rootElement instanceof B && (r = s.rootElement.node), r ? this.continueMovingNode(i, r) : S(T.NotAllowed);
5616
+ s.rootElement instanceof z ? r = s.rootElement : s.rootElement instanceof G && (r = s.rootElement.node), r ? this.continueMovingNode(i, r) : S(E.NotAllowed);
5617
5617
  }
5618
5618
  }).on(A.End, (i, s) => {
5619
5619
  if (this.multipleSelectionOn || this.secondaryButton)
5620
5620
  this.finishMultipleSelection(i);
5621
5621
  else {
5622
5622
  let r;
5623
- s.rootElement instanceof z ? r = s.rootElement : s.rootElement instanceof B && (r = s.rootElement.node), r ? this.finishMovingNode(i, r) : S();
5623
+ s.rootElement instanceof z ? r = s.rootElement : s.rootElement instanceof G && (r = s.rootElement.node), r ? this.finishMovingNode(i, r) : S();
5624
5624
  }
5625
5625
  this.secondaryButton = !1;
5626
5626
  })
@@ -5637,40 +5637,40 @@ const ro = (o) => o * Math.PI / 180, Pe = (o, t, e) => {
5637
5637
  const i = l.getTotalLength();
5638
5638
  let s = 0, r = 0, c = 0, d = 0, h = 0, g = 0;
5639
5639
  if (a.backgroundColor === "#00000000") {
5640
- const f = t.endCoords[0] - t.startCoords[0], b = t.endCoords[1] - t.startCoords[1];
5640
+ const f = t.endCoords[0] - t.startCoords[0], k = t.endCoords[1] - t.startCoords[1];
5641
5641
  switch (t.startDirection) {
5642
5642
  case u.Top:
5643
- s = f >= 0 ? -0.5 : 0.5, h = s, r = -0.5;
5643
+ s = f >= 0 ? -0.5 : 0.5, h = s;
5644
5644
  break;
5645
5645
  case u.Bottom:
5646
- s = f >= 0 ? -0.5 : 0.5, h = s, r = 0.5;
5646
+ s = f >= 0 ? -0.5 : 0.5, h = s;
5647
5647
  break;
5648
5648
  case u.Left:
5649
- s = -0.5, r = b > 0 ? -0.5 : 0.5, g = r;
5649
+ r = k > 0 ? -0.5 : 0.5, g = r;
5650
5650
  break;
5651
5651
  case u.Right:
5652
- s = 0.5, r = b > 0 ? -0.5 : 0.5, g = r;
5652
+ r = k > 0 ? -0.5 : 0.5, g = r;
5653
5653
  break;
5654
5654
  default:
5655
5655
  s = 0.5, h = s, r = -0.5, g = r;
5656
5656
  }
5657
5657
  switch (t.endDirection) {
5658
5658
  case u.Top:
5659
- h = f >= 0 ? 0.5 : -0.5, g = 0.5;
5659
+ h = f >= 0 ? 0.5 : -0.5;
5660
5660
  break;
5661
5661
  case u.Bottom:
5662
- h = f >= 0 ? 0.5 : -0.5, g = -0.5;
5662
+ h = f >= 0 ? 0.5 : -0.5;
5663
5663
  break;
5664
5664
  case u.Left:
5665
- h = -0.5, g = b > 0 ? 0.5 : -0.5;
5665
+ g = k > 0 ? 0.5 : -0.5;
5666
5666
  break;
5667
5667
  case u.Right:
5668
- h = 0.5, g = b > 0 ? 0.5 : -0.5;
5668
+ g = k > 0 ? 0.5 : -0.5;
5669
5669
  break;
5670
5670
  default:
5671
5671
  h = 0.5, g = -0.5;
5672
5672
  }
5673
- Math.abs(f) >= Math.abs(b) ? (c = f > 0 ? -0.5 : 0.5, d = b > 0 ? 0.5 : -0.5) : (c = f > 0 ? 0.5 : -0.5, d = b > 0 ? -0.5 : 0.5);
5673
+ Math.abs(f) >= Math.abs(k) ? (c = f > 0 ? -0.5 : 0.5, d = k > 0 ? 0.5 : -0.5) : (c = f > 0 ? 0.5 : -0.5, d = k > 0 ? -0.5 : 0.5);
5674
5674
  }
5675
5675
  e.select("g.diagram-connection-start-label text").attr("x", 0).attr("y", a.fontSize / 3).attr("text-anchor", "middle").attr("font-family", a.fontFamily).attr("font-size", a.fontSize).attr(
5676
5676
  "fill",
@@ -5678,25 +5678,50 @@ const ro = (o) => o * Math.PI / 180, Pe = (o, t, e) => {
5678
5678
  ).style("font-kerning", "none").text(t.startLabel);
5679
5679
  const y = e.select("g.diagram-connection-start-label text").node()?.getBoundingClientRect();
5680
5680
  if (y) {
5681
- const f = t.startLabel ? y.width / this.zoomTransform.k + Vt(a) + Ot(a) : 0, b = t.startLabel ? y.height / this.zoomTransform.k + _t(a) + Rt(a) : 0, w = l.getPointAtLength(
5682
- Math.max(
5683
- j(a) + f / 2,
5684
- nt(a) + f / 2,
5685
- G(a) + b / 2,
5686
- tt(a) + b / 2
5687
- )
5688
- );
5681
+ const f = t.startLabel ? y.width / this.zoomTransform.k + Vt(a) + Ot(a) : 0, k = t.startLabel ? y.height / this.zoomTransform.k + _t(a) + Rt(a) : 0;
5682
+ let b;
5683
+ switch (t.startDirection) {
5684
+ case u.Left:
5685
+ b = l.getPointAtLength(
5686
+ et(a) + f / 2
5687
+ );
5688
+ break;
5689
+ case u.Right:
5690
+ b = l.getPointAtLength(
5691
+ U(a) + f / 2
5692
+ );
5693
+ break;
5694
+ case u.Top:
5695
+ b = l.getPointAtLength(
5696
+ K(a) + f / 2
5697
+ );
5698
+ break;
5699
+ case u.Bottom:
5700
+ b = l.getPointAtLength(
5701
+ H(a) + f / 2
5702
+ );
5703
+ break;
5704
+ default:
5705
+ b = l.getPointAtLength(
5706
+ Math.max(
5707
+ U(a) + f / 2,
5708
+ et(a) + f / 2,
5709
+ H(a) + k / 2,
5710
+ K(a) + k / 2
5711
+ )
5712
+ );
5713
+ }
5689
5714
  e.select("g.diagram-connection-start-label path").attr(
5690
5715
  "d",
5691
5716
  Wt(
5692
5717
  -f / 2,
5693
- -b / 2,
5718
+ -k / 2,
5694
5719
  f,
5695
- b
5720
+ k
5696
5721
  )
5697
5722
  ).attr("fill", a.backgroundColor).attr("stroke", "none"), e.select("g.diagram-connection-start-label").attr(
5698
5723
  "transform",
5699
- `translate(${w.x + s * f},${w.y + r * b})`
5724
+ `translate(${b.x + s * f},${b.y + r * k})`
5700
5725
  );
5701
5726
  }
5702
5727
  e.select("g.diagram-connection-middle-label text").attr("x", 0).attr("y", a.fontSize / 3).attr("text-anchor", "middle").attr("font-family", a.fontFamily).attr("font-size", a.fontSize).attr(
@@ -5705,18 +5730,18 @@ const ro = (o) => o * Math.PI / 180, Pe = (o, t, e) => {
5705
5730
  ).style("font-kerning", "none").text(t.middleLabel);
5706
5731
  const m = e.select("g.diagram-connection-middle-label text").node()?.getBoundingClientRect();
5707
5732
  if (m) {
5708
- const f = t.middleLabel ? m.width / this.zoomTransform.k + Vt(a) + Ot(a) : 0, b = t.middleLabel ? m.height / this.zoomTransform.k + _t(a) + Rt(a) : 0, w = l.getPointAtLength(i / 2);
5733
+ const f = t.middleLabel ? m.width / this.zoomTransform.k + Vt(a) + Ot(a) : 0, k = t.middleLabel ? m.height / this.zoomTransform.k + _t(a) + Rt(a) : 0, b = l.getPointAtLength(i / 2);
5709
5734
  e.select("g.diagram-connection-middle-label path").attr(
5710
5735
  "d",
5711
5736
  Wt(
5712
5737
  -f / 2,
5713
- -b / 2,
5738
+ -k / 2,
5714
5739
  f,
5715
- b
5740
+ k
5716
5741
  )
5717
5742
  ).attr("fill", a.backgroundColor).attr("stroke", "none"), e.select("g.diagram-connection-middle-label").attr(
5718
5743
  "transform",
5719
- `translate(${w.x + c * f},${w.y + d * b})`
5744
+ `translate(${b.x + c * f},${b.y + d * k})`
5720
5745
  );
5721
5746
  }
5722
5747
  e.select("g.diagram-connection-end-label text").attr("x", 0).attr("y", a.fontSize / 3).attr("text-anchor", "middle").attr("font-family", a.fontFamily).attr("font-size", a.fontSize).attr(
@@ -5725,25 +5750,50 @@ const ro = (o) => o * Math.PI / 180, Pe = (o, t, e) => {
5725
5750
  ).style("font-kerning", "none").text(t.endLabel);
5726
5751
  const p = e.select("g.diagram-connection-end-label text").node()?.getBoundingClientRect();
5727
5752
  if (p) {
5728
- const f = t.endLabel ? p.width / this.zoomTransform.k + Vt(a) + Ot(a) : 0, b = t.endLabel ? p.height / this.zoomTransform.k + _t(a) + Rt(a) : 0, w = l.getPointAtLength(
5729
- i - Math.max(
5730
- j(a) + f / 2,
5731
- nt(a) + f / 2,
5732
- G(a) + b / 2,
5733
- tt(a) + b / 2
5734
- )
5735
- );
5753
+ const f = t.endLabel ? p.width / this.zoomTransform.k + Vt(a) + Ot(a) : 0, k = t.endLabel ? p.height / this.zoomTransform.k + _t(a) + Rt(a) : 0;
5754
+ let b;
5755
+ switch (t.endDirection) {
5756
+ case u.Left:
5757
+ b = l.getPointAtLength(
5758
+ i - (et(a) + f / 2)
5759
+ );
5760
+ break;
5761
+ case u.Right:
5762
+ b = l.getPointAtLength(
5763
+ i - (U(a) + f / 2)
5764
+ );
5765
+ break;
5766
+ case u.Top:
5767
+ b = l.getPointAtLength(
5768
+ i - (K(a) + f / 2)
5769
+ );
5770
+ break;
5771
+ case u.Bottom:
5772
+ b = l.getPointAtLength(
5773
+ i - (H(a) + f / 2)
5774
+ );
5775
+ break;
5776
+ default:
5777
+ b = l.getPointAtLength(
5778
+ i - Math.max(
5779
+ U(a) + f / 2,
5780
+ et(a) + f / 2,
5781
+ H(a) + k / 2,
5782
+ K(a) + k / 2
5783
+ )
5784
+ );
5785
+ }
5736
5786
  e.select("g.diagram-connection-end-label path").attr(
5737
5787
  "d",
5738
5788
  Wt(
5739
5789
  -f / 2,
5740
- -b / 2,
5790
+ -k / 2,
5741
5791
  f,
5742
- b
5792
+ k
5743
5793
  )
5744
5794
  ).attr("fill", a.backgroundColor).attr("stroke", "none"), e.select("g.diagram-connection-end-label").attr(
5745
5795
  "transform",
5746
- `translate(${w.x + h * f},${w.y + g * b})`
5796
+ `translate(${b.x + h * f},${b.y + g * k})`
5747
5797
  );
5748
5798
  }
5749
5799
  }
@@ -5758,8 +5808,8 @@ const ro = (o) => o * Math.PI / 180, Pe = (o, t, e) => {
5758
5808
  const e = this.model.fields.get(t);
5759
5809
  if (!e)
5760
5810
  return !1;
5761
- if (e.rootElement instanceof z || e.rootElement instanceof B) {
5762
- const n = this.minimumSizeOfField(e), l = n[0] + j(e.rootElement.type?.label) + nt(e.rootElement.type?.label) - e.rootElement.width, a = n[1] + G(e.rootElement.type?.label) + tt(e.rootElement.type?.label) - e.rootElement.height;
5811
+ if (e.rootElement instanceof z || e.rootElement instanceof G) {
5812
+ const n = this.minimumSizeOfField(e), l = n[0] + U(e.rootElement.type?.label) + et(e.rootElement.type?.label) - e.rootElement.width, a = n[1] + H(e.rootElement.type?.label) + K(e.rootElement.type?.label) - e.rootElement.height;
5763
5813
  return l <= 0 && a <= 0;
5764
5814
  }
5765
5815
  return !0;
@@ -5769,10 +5819,10 @@ const ro = (o) => o * Math.PI / 180, Pe = (o, t, e) => {
5769
5819
  if (n) {
5770
5820
  if (n.rootElement instanceof z) {
5771
5821
  const l = this.minimumSizeOfField(n);
5772
- let a = l[0] + j(n.rootElement.type.label) + nt(n.rootElement.type.label) - n.rootElement.width, i = l[1] + G(n.rootElement.type.label) + tt(n.rootElement.type.label) - n.rootElement.height;
5822
+ let a = l[0] + U(n.rootElement.type.label) + et(n.rootElement.type.label) - n.rootElement.width, i = l[1] + H(n.rootElement.type.label) + K(n.rootElement.type.label) - n.rootElement.height;
5773
5823
  this.snapToGrid && (a = Math.ceil(a / this.gridSize) * this.gridSize, i = Math.ceil(i / this.gridSize) * this.gridSize), n.rootElement.width + a < n.rootElement.type.minWidth && (a = n.rootElement.type.minWidth - n.rootElement.width), n.rootElement.height + i < n.rootElement.type.minHeight && (i = n.rootElement.type.minHeight - n.rootElement.height), (e !== !1 || a > 0) && n.rootElement.stretch(u.Right, a), (e !== !1 || i > 0) && n.rootElement.stretch(u.Bottom, i);
5774
5824
  }
5775
- if (n.rootElement instanceof B) {
5825
+ if (n.rootElement instanceof G) {
5776
5826
  const l = this.minimumSizeOfField(n);
5777
5827
  let a = l[0], i = l[1];
5778
5828
  for (const d of n.rootElement.node?.sections || [])
@@ -5785,7 +5835,7 @@ const ro = (o) => o * Math.PI / 180, Pe = (o, t, e) => {
5785
5835
  )));
5786
5836
  l[0] < a && (l[0] = a), l[1] < i && (l[1] = i);
5787
5837
  const s = n.rootElement.type;
5788
- let r = l[0] + j(s?.label) + nt(s?.label) - n.rootElement.width, c = l[1] + G(s?.label) + tt(s?.label) - n.rootElement.height;
5838
+ let r = l[0] + U(s?.label) + et(s?.label) - n.rootElement.width, c = l[1] + H(s?.label) + K(s?.label) - n.rootElement.height;
5789
5839
  this.snapToGrid && (r = Math.ceil(r / this.gridSize) * this.gridSize, c = Math.ceil(c / this.gridSize) * this.gridSize), n.rootElement.width + r < (n.rootElement.getMinWidth() || 0) && (r = (n.rootElement.getMinWidth() || 0) - n.rootElement.width), n.rootElement.height + c < (n.rootElement.getMinHeight() || 0) && (c = (n.rootElement.getMinHeight() || 0) - n.rootElement.height), (e || r > 0) && n.rootElement.node?.stretchSections(
5790
5840
  u.Right,
5791
5841
  r,
@@ -5819,10 +5869,10 @@ const ro = (o) => o * Math.PI / 180, Pe = (o, t, e) => {
5819
5869
  }
5820
5870
  }
5821
5871
  selectRoot() {
5822
- return E.select(this.diagramRoot);
5872
+ return L.select(this.diagramRoot);
5823
5873
  }
5824
5874
  selectSVGElement() {
5825
- return E.select(this.diagramRoot).select("svg");
5875
+ return L.select(this.diagramRoot).select("svg");
5826
5876
  }
5827
5877
  selectCanvasView() {
5828
5878
  return this.selectSVGElement().select(".daga-canvas-view");
@@ -5950,8 +6000,8 @@ const ro = (o) => o * Math.PI / 180, Pe = (o, t, e) => {
5950
6000
  }).on(I.Input, () => {
5951
6001
  const p = h.property("value");
5952
6002
  h.attr("cols", ki(p) + 1), h.attr("rows", wi(p) + 1), h.style("width", ""), h.style("height", ""), g = h.property("scrollWidth") + 1, y = h.property("scrollHeight") + 1;
5953
- const f = Math.max(g, n), b = Math.max(y, l);
5954
- d?.attr("width", `${f}px`), h.style("width", `${f}px`), d?.attr("height", `${b}px`), h.style("height", `${b}px`), r && r(p);
6003
+ const f = Math.max(g, n), k = Math.max(y, l);
6004
+ d?.attr("width", `${f}px`), h.style("width", `${f}px`), d?.attr("height", `${k}px`), h.style("height", `${k}px`), r && r(p);
5955
6005
  }).on(I.Click, (p) => {
5956
6006
  p.stopPropagation();
5957
6007
  }).on(I.FocusOut, () => {
@@ -5978,8 +6028,8 @@ const ro = (o) => o * Math.PI / 180, Pe = (o, t, e) => {
5978
6028
  * Method to call to start the moving of a node triggered by a user drag event.
5979
6029
  */
5980
6030
  startMovingNode(t, e) {
5981
- if (this.canUserPerformAction(k.MoveNode) && !e.removed)
5982
- if (S(T.Grabbing), this.draggingFrom = [t.x, t.y], e.selected && this.userSelection.count((n) => n instanceof z) > 1)
6031
+ if (this.canUserPerformAction(w.MoveNode) && !e.removed)
6032
+ if (S(E.Grabbing), this.draggingFrom = [t.x, t.y], e.selected && this.userSelection.count((n) => n instanceof z) > 1)
5983
6033
  this.currentAction = new re(
5984
6034
  this,
5985
6035
  this.userSelection.filter((n) => n instanceof z).map((n) => n.id),
@@ -5987,9 +6037,9 @@ const ro = (o) => o * Math.PI / 180, Pe = (o, t, e) => {
5987
6037
  );
5988
6038
  else {
5989
6039
  const n = e.getLastAncestor();
5990
- this.currentAction = new Y(
6040
+ this.currentAction = new X(
5991
6041
  this,
5992
- k.MoveNode,
6042
+ w.MoveNode,
5993
6043
  e.id,
5994
6044
  e.getGeometry(),
5995
6045
  e.getGeometry(),
@@ -5999,13 +6049,13 @@ const ro = (o) => o * Math.PI / 180, Pe = (o, t, e) => {
5999
6049
  );
6000
6050
  }
6001
6051
  else
6002
- S(T.NotAllowed);
6052
+ S(E.NotAllowed);
6003
6053
  }
6004
6054
  /**
6005
6055
  * Method to call to continue the moving of a node triggered by a user drag event.
6006
6056
  */
6007
6057
  continueMovingNode(t, e) {
6008
- if (this.canUserPerformAction(k.MoveNode) && (this.currentAction instanceof re || this.currentAction instanceof Y) && !e.removed) {
6058
+ if (this.canUserPerformAction(w.MoveNode) && (this.currentAction instanceof re || this.currentAction instanceof X) && !e.removed) {
6009
6059
  const n = [
6010
6060
  t.x - e.width / 2,
6011
6061
  t.y - e.height / 2
@@ -6020,7 +6070,7 @@ const ro = (o) => o * Math.PI / 180, Pe = (o, t, e) => {
6020
6070
  * Method to call to finish the moving of a node triggered by a user drag event.
6021
6071
  */
6022
6072
  finishMovingNode(t, e) {
6023
- if (this.canUserPerformAction(k.MoveNode) && !e.removed && (this.draggingFrom[0] !== t.x || this.draggingFrom[1] !== t.y)) {
6073
+ if (this.canUserPerformAction(w.MoveNode) && !e.removed && (this.draggingFrom[0] !== t.x || this.draggingFrom[1] !== t.y)) {
6024
6074
  let n = [
6025
6075
  t.x - e.width / 2,
6026
6076
  t.y - e.height / 2
@@ -6034,7 +6084,7 @@ const ro = (o) => o * Math.PI / 180, Pe = (o, t, e) => {
6034
6084
  l[0] - e.coords[0],
6035
6085
  l[1] - e.coords[1]
6036
6086
  ]) : e.move(l);
6037
- } else if (this.currentAction instanceof Y) {
6087
+ } else if (this.currentAction instanceof X) {
6038
6088
  e.move(n);
6039
6089
  const a = this.model.nodes.getAtCoordinates(t.x, t.y).filter((r) => r.id !== e.id && !r.isDescendantOf(e)).filter(
6040
6090
  (r) => r.type.childrenTypes.includes(e.type.id)
@@ -6070,7 +6120,7 @@ const ro = (o) => o * Math.PI / 180, Pe = (o, t, e) => {
6070
6120
  }
6071
6121
  continueMultipleSelection(t) {
6072
6122
  const e = this.getPointerLocationRelativeToCanvas(t);
6073
- (this.draggingFrom[0] !== e[0] || this.draggingFrom[1] !== e[1]) && (S(T.Crosshair), this.multipleSelectionContainer?.attr(
6123
+ (this.draggingFrom[0] !== e[0] || this.draggingFrom[1] !== e[1]) && (S(E.Crosshair), this.multipleSelectionContainer?.attr(
6074
6124
  "x",
6075
6125
  Math.min(this.draggingFrom[0], e[0]) * this.zoomTransform.k + this.zoomTransform.x
6076
6126
  )?.attr(
@@ -6243,7 +6293,7 @@ class co {
6243
6293
  }
6244
6294
  const Qe = (o, t, e, n) => {
6245
6295
  const l = t.getClosestEmptyCoordinate(e);
6246
- t.set(l, o), U(n, o);
6296
+ t.set(l, o), Y(n, o);
6247
6297
  for (const a of o.getAdjacentNodes())
6248
6298
  n.includes(a) && Qe(
6249
6299
  a,
@@ -6269,7 +6319,7 @@ class ho {
6269
6319
  l[h.id]
6270
6320
  ),
6271
6321
  h
6272
- ), U(n, h);
6322
+ ), Y(n, h);
6273
6323
  const g = h.getAdjacentNodes();
6274
6324
  for (const y of g)
6275
6325
  n.includes(y) && (d.push(y), l[y.id] = l[h.id]);
@@ -6303,14 +6353,14 @@ class se {
6303
6353
  const e = this.gapSize !== void 0 ? this.gapSize : (t.canvas?.gridSize || 0) * 2;
6304
6354
  let n = t.nodes.filter((s) => !s.parent);
6305
6355
  const l = n[0];
6306
- U(n, l);
6356
+ Y(n, l);
6307
6357
  const a = [[l]];
6308
6358
  for (; n.length > 0; ) {
6309
6359
  const s = a[a.length - 1], r = [];
6310
6360
  for (const c of s) {
6311
6361
  const d = c.getAdjacentNodes();
6312
6362
  for (const h of d)
6313
- n.includes(h) && (U(n, h), r.push(h));
6363
+ n.includes(h) && (Y(n, h), r.push(h));
6314
6364
  }
6315
6365
  r.length > 0 ? a.push(r) : (a.push(n), n = []);
6316
6366
  }
@@ -6354,16 +6404,16 @@ class go {
6354
6404
  ], f = [
6355
6405
  m.coords[0] + m.width / 2,
6356
6406
  m.coords[1] + m.height / 2
6357
- ], b = Oe(
6407
+ ], k = Oe(
6358
6408
  g.coords,
6359
6409
  m.coords
6360
- ), w = [m.coords[0], m.coords[1]];
6361
- if (y.includes(m) && b > 0 && (b > e + (Math.max(g.width, g.height) + Math.max(m.width, m.height)) / 2 ? (w[0] = w[0] - (f[0] - p[0]) * a, w[1] = w[1] - (f[1] - p[1]) * a) : (w[0] = w[0] + (f[0] - p[0]) * s, w[1] = w[1] + (f[1] - p[1]) * s)), b > 0) {
6362
- const M = i / (b * b);
6363
- w[0] = w[0] + M * (f[0] - p[0]) / b, w[1] = w[1] + M * (f[1] - p[1]) / b;
6410
+ ), b = [m.coords[0], m.coords[1]];
6411
+ if (y.includes(m) && k > 0 && (k > e + (Math.max(g.width, g.height) + Math.max(m.width, m.height)) / 2 ? (b[0] = b[0] - (f[0] - p[0]) * a, b[1] = b[1] - (f[1] - p[1]) * a) : (b[0] = b[0] + (f[0] - p[0]) * s, b[1] = b[1] + (f[1] - p[1]) * s)), k > 0) {
6412
+ const M = i / (k * k);
6413
+ b[0] = b[0] + M * (f[0] - p[0]) / k, b[1] = b[1] + M * (f[1] - p[1]) / k;
6364
6414
  } else
6365
- w[0] = w[0] + r * (Math.random() * 2 - 1), w[1] = w[1] + r * (Math.random() * 2 - 1);
6366
- w[0] = w[0] - (f[0] - h[0]) * c, w[1] = w[1] - (f[1] - h[1]) * c, w[0] - m.coords[0] > d ? w[0] = m.coords[0] + d : w[0] - m.coords[0] < -d && (w[0] = m.coords[0] - d), w[1] - m.coords[1] > d ? w[1] = m.coords[1] + d : w[1] - m.coords[1] < -d && (w[1] = m.coords[1] - d), m.move(w);
6415
+ b[0] = b[0] + r * (Math.random() * 2 - 1), b[1] = b[1] + r * (Math.random() * 2 - 1);
6416
+ b[0] = b[0] - (f[0] - h[0]) * c, b[1] = b[1] - (f[1] - h[1]) * c, b[0] - m.coords[0] > d ? b[0] = m.coords[0] + d : b[0] - m.coords[0] < -d && (b[0] = m.coords[0] - d), b[1] - m.coords[1] > d ? b[1] = m.coords[1] + d : b[1] - m.coords[1] < -d && (b[1] = m.coords[1] - d), m.move(b);
6367
6417
  }
6368
6418
  }
6369
6419
  }
@@ -6413,7 +6463,7 @@ class fo {
6413
6463
  const h = [d], g = [d];
6414
6464
  for (; h.length > 0; ) {
6415
6465
  const y = h[0];
6416
- h.splice(0, 1), s.includes(y) && (r.push(y), U(s, y));
6466
+ h.splice(0, 1), s.includes(y) && (r.push(y), Y(s, y));
6417
6467
  const m = y.getAdjacentNodes();
6418
6468
  for (const p of m)
6419
6469
  g.includes(p) || (h.push(p), g.push(p));
@@ -6423,7 +6473,7 @@ class fo {
6423
6473
  } else
6424
6474
  r.push(s[0]);
6425
6475
  for (const d of r)
6426
- U(a, d), i.push([d]);
6476
+ Y(a, d), i.push([d]);
6427
6477
  for (i.push([]), a.sort((d, h) => h.type.priority - d.type.priority); a.length > 0; ) {
6428
6478
  const d = a[0];
6429
6479
  a.splice(0, 1);
@@ -6438,8 +6488,8 @@ class fo {
6438
6488
  break;
6439
6489
  } else {
6440
6490
  const f = m.getAdjacentNodes();
6441
- for (const b of f)
6442
- g.includes(b) || (h.push(b), g.push(b));
6491
+ for (const k of f)
6492
+ g.includes(k) || (h.push(k), g.push(k));
6443
6493
  }
6444
6494
  }
6445
6495
  y || i[i.length - 1].push(d);
@@ -6592,17 +6642,17 @@ const Se = ({
6592
6642
  visibleValue: s,
6593
6643
  onCollapse: r
6594
6644
  }) => {
6595
- const [c, d] = H(n), h = () => {
6645
+ const [c, d] = B(n), h = () => {
6596
6646
  if (!l) {
6597
6647
  const y = !c;
6598
6648
  d(y), r?.(y);
6599
6649
  let m;
6600
6650
  if (typeof t == "string")
6601
- m = E.select(t), e && (m = m.select(e));
6651
+ m = L.select(t), e && (m = m.select(e));
6602
6652
  else {
6603
6653
  const p = t;
6604
6654
  if (!p) throw new Error("collapsableSelector is not a valid ref");
6605
- m = E.select(p.current), e && (m = m.select(e));
6655
+ m = L.select(p.current), e && (m = m.select(e));
6606
6656
  }
6607
6657
  m.style(a, y ? i : s);
6608
6658
  }
@@ -6627,7 +6677,7 @@ const Se = ({
6627
6677
  }
6628
6678
  ) });
6629
6679
  }, bo = () => {
6630
- const o = Ht(It), t = rt(null), [e, n] = H([]);
6680
+ const o = Ht(It), t = rt(null), [e, n] = B([]);
6631
6681
  ai(o.validatorChange$, o.diagramChange$).pipe(
6632
6682
  li(() => l())
6633
6683
  ).subscribe();
@@ -6689,26 +6739,26 @@ const Se = ({
6689
6739
  value: e,
6690
6740
  onChange: n
6691
6741
  }) => {
6692
- const l = rt(null), [a, i] = H("");
6742
+ const l = rt(null), [a, i] = B("");
6693
6743
  let s;
6694
- const [r, c] = H([]), [d, h] = H([]), [g, y] = H([]), [m, p] = H([]), [f, b] = H(!1);
6744
+ const [r, c] = B([]), [d, h] = B([]), [g, y] = B([]), [m, p] = B([]), [f, k] = B(!1);
6695
6745
  Ct(() => {
6696
6746
  i(t.find((x) => St(x.key, e))?.label || "");
6697
6747
  }, [e, t]);
6698
- const w = (x) => {
6748
+ const b = (x) => {
6699
6749
  if (!o)
6700
6750
  switch (x.key) {
6701
6751
  case Z.PageDown:
6702
- s === void 0 ? (P(0), L(0)) : (P(s + 5), L(s)), x.preventDefault();
6752
+ s === void 0 ? (P(0), T(0)) : (P(s + 5), T(s)), x.preventDefault();
6703
6753
  break;
6704
6754
  case Z.ArrowDown:
6705
- s === void 0 ? (P(0), L(0)) : (P(s + 1), L(s)), x.preventDefault();
6755
+ s === void 0 ? (P(0), T(0)) : (P(s + 1), T(s)), x.preventDefault();
6706
6756
  break;
6707
6757
  case Z.PageUp:
6708
- s === void 0 ? (P(t.length - 1), L(t.length - 1)) : (P(s - 5), L(s)), x.preventDefault();
6758
+ s === void 0 ? (P(t.length - 1), T(t.length - 1)) : (P(s - 5), T(s)), x.preventDefault();
6709
6759
  break;
6710
6760
  case Z.ArrowUp:
6711
- s === void 0 ? (P(t.length - 1), L(t.length - 1)) : (P(s - 1), L(s)), x.preventDefault();
6761
+ s === void 0 ? (P(t.length - 1), T(t.length - 1)) : (P(s - 1), T(s)), x.preventDefault();
6712
6762
  break;
6713
6763
  case Z.Escape:
6714
6764
  R(), x.preventDefault();
@@ -6724,47 +6774,47 @@ const Se = ({
6724
6774
  const x = Re(a.trim());
6725
6775
  c([]), h([]), y([]), p([]);
6726
6776
  for (const D of t) {
6727
- const st = Re(D.label).indexOf(x);
6728
- if (st >= 0) {
6729
- const Bt = D.label.substring(0, st), K = D.label.substring(
6730
- st,
6731
- st + x.length
6777
+ const nt = Re(D.label).indexOf(x);
6778
+ if (nt >= 0) {
6779
+ const Bt = D.label.substring(0, nt), q = D.label.substring(
6780
+ nt,
6781
+ nt + x.length
6732
6782
  ), wt = D.label.substring(
6733
- st + x.length
6783
+ nt + x.length
6734
6784
  );
6735
- c((ot) => [...ot, D]), h((ot) => [
6736
- ...ot,
6785
+ c((st) => [...st, D]), h((st) => [
6786
+ ...st,
6737
6787
  Bt
6738
- ]), y((ot) => [
6739
- ...ot,
6740
- K
6741
- ]), p((ot) => [
6742
- ...ot,
6788
+ ]), y((st) => [
6789
+ ...st,
6790
+ q
6791
+ ]), p((st) => [
6792
+ ...st,
6743
6793
  wt
6744
6794
  ]);
6745
6795
  }
6746
6796
  }
6747
- b(!0);
6797
+ k(!0);
6748
6798
  }
6749
6799
  }, R = () => {
6750
- b(!1);
6800
+ k(!1);
6751
6801
  }, P = (x) => {
6752
6802
  if (!o) {
6753
6803
  if (s = x, x === void 0)
6754
6804
  return;
6755
6805
  x < 0 && (s = 0), x >= t.length && (s = t.length - 1);
6756
6806
  }
6757
- }, J = () => {
6807
+ }, Q = () => {
6758
6808
  setTimeout(() => {
6759
6809
  R();
6760
6810
  }, ko);
6761
- }, L = (x) => {
6811
+ }, T = (x) => {
6762
6812
  const D = l.current?.querySelectorAll("li")[x];
6763
6813
  D && D.scrollIntoView({ block: "center" });
6764
6814
  }, C = () => {
6765
- o || (i(""), b(!1), s = void 0);
6815
+ o || (i(""), k(!1), s = void 0);
6766
6816
  }, O = (x) => {
6767
- o || (i(x.label), b(!1), s = void 0, n(x.key));
6817
+ o || (i(x.label), k(!1), s = void 0, n(x.key));
6768
6818
  };
6769
6819
  return /* @__PURE__ */ $(
6770
6820
  "div",
@@ -6778,9 +6828,9 @@ const Se = ({
6778
6828
  {
6779
6829
  value: a,
6780
6830
  disabled: o,
6781
- onKeyUp: w,
6831
+ onKeyUp: b,
6782
6832
  onFocus: M,
6783
- onBlur: J,
6833
+ onBlur: Q,
6784
6834
  onChange: (x) => i(x.target.value)
6785
6835
  }
6786
6836
  ),
@@ -6813,18 +6863,18 @@ const Se = ({
6813
6863
  value: n,
6814
6864
  onChange: l
6815
6865
  }) => {
6816
- const [a, i] = H(), [s, r] = H([]), [c, d] = H([]);
6866
+ const [a, i] = B(), [s, r] = B([]), [c, d] = B([]);
6817
6867
  Ct(() => {
6818
- const f = n.length === 0, b = n.map((w) => wo(e, w));
6819
- r(b), f && l(n), p();
6868
+ const f = n.length === 0, k = n.map((b) => wo(e, b));
6869
+ r(k), f && l(n), p();
6820
6870
  }, [n, e]);
6821
6871
  const h = (f) => {
6822
- for (const b of n)
6823
- if (b === f)
6872
+ for (const k of n)
6873
+ if (k === f)
6824
6874
  return !0;
6825
6875
  return !1;
6826
6876
  }, g = (f) => {
6827
- n.length > f && (n.splice(f, 1), r(s.filter((b, w) => w !== f)), l(n), p());
6877
+ n.length > f && (n.splice(f, 1), r(s.filter((k, b) => b !== f)), l(n), p());
6828
6878
  }, y = () => {
6829
6879
  a !== void 0 && (t || !h(a)) && (l(n.concat(a)), m());
6830
6880
  }, m = () => {
@@ -6832,23 +6882,23 @@ const Se = ({
6832
6882
  }, p = () => {
6833
6883
  if (!t) {
6834
6884
  const f = [];
6835
- for (const b of e)
6836
- h(b.key) || f.push(b);
6885
+ for (const k of e)
6886
+ h(k.key) || f.push(k);
6837
6887
  d(f);
6838
6888
  }
6839
6889
  };
6840
6890
  return /* @__PURE__ */ $("div", { children: [
6841
- n.map((f, b) => /* @__PURE__ */ $("div", { className: "daga-value-item-element", children: [
6842
- /* @__PURE__ */ v("span", { className: "daga-input", children: s[b] }),
6891
+ n.map((f, k) => /* @__PURE__ */ $("div", { className: "daga-value-item-element", children: [
6892
+ /* @__PURE__ */ v("span", { className: "daga-input", children: s[k] }),
6843
6893
  !o && /* @__PURE__ */ v(
6844
6894
  "button",
6845
6895
  {
6846
6896
  className: "daga-property-button",
6847
- onClick: () => g(b),
6897
+ onClick: () => g(k),
6848
6898
  children: /* @__PURE__ */ v("div", { className: "daga-icon daga-close-icon" })
6849
6899
  }
6850
6900
  )
6851
- ] }, b)),
6901
+ ] }, k)),
6852
6902
  !o && /* @__PURE__ */ $("div", { className: "daga-value-item-input", children: [
6853
6903
  /* @__PURE__ */ v("div", { className: "daga-input daga-relatively-positioned", children: /* @__PURE__ */ v(
6854
6904
  ii,
@@ -6868,7 +6918,7 @@ const Se = ({
6868
6918
  value: e,
6869
6919
  onChange: n
6870
6920
  }) => {
6871
- const [l, a] = H(""), i = (g) => {
6921
+ const [l, a] = B(""), i = (g) => {
6872
6922
  for (const y of g || [])
6873
6923
  if (y === g)
6874
6924
  return !0;
@@ -6877,7 +6927,7 @@ const Se = ({
6877
6927
  e.length > g && n(e.filter((y, m) => m !== g));
6878
6928
  }, r = (g, y, m) => {
6879
6929
  const p = e.map(
6880
- (f, b) => b === y ? m === "blur" ? g.trim() : g : f
6930
+ (f, k) => k === y ? m === "blur" ? g.trim() : g : f
6881
6931
  );
6882
6932
  n(p);
6883
6933
  }, c = () => {
@@ -6930,30 +6980,30 @@ const Se = ({
6930
6980
  value: t,
6931
6981
  onChange: e
6932
6982
  }) => {
6933
- const [n, l] = H(""), [a, i] = H(""), [s, r] = H({}), c = (f) => {
6934
- const b = {};
6935
- Object.keys(t).forEach((w) => {
6936
- w !== f && (b[w] = t[w]);
6937
- }), e(b);
6938
- }, d = (f, b, w) => {
6939
- const M = w === "blur" ? b.trim() : b;
6940
- if (w === "blur") {
6983
+ const [n, l] = B(""), [a, i] = B(""), [s, r] = B({}), c = (f) => {
6984
+ const k = {};
6985
+ Object.keys(t).forEach((b) => {
6986
+ b !== f && (k[b] = t[b]);
6987
+ }), e(k);
6988
+ }, d = (f, k, b) => {
6989
+ const M = b === "blur" ? k.trim() : k;
6990
+ if (b === "blur") {
6941
6991
  if (f !== M) {
6942
6992
  const R = {};
6943
6993
  Object.keys(t).forEach((P) => {
6944
6994
  P === f ? R[M] = t[P] : R[P] = t[P];
6945
6995
  }), e(R), r((P) => {
6946
- const J = { ...P };
6947
- return delete J[f], J;
6996
+ const Q = { ...P };
6997
+ return delete Q[f], Q;
6948
6998
  });
6949
6999
  }
6950
7000
  } else
6951
7001
  r((R) => ({
6952
7002
  ...R,
6953
- [f]: b
7003
+ [f]: k
6954
7004
  }));
6955
- }, h = (f, b, w) => {
6956
- const M = w === "blur" ? b.trim() : b;
7005
+ }, h = (f, k, b) => {
7006
+ const M = b === "blur" ? k.trim() : k;
6957
7007
  if (M !== "") {
6958
7008
  const R = {};
6959
7009
  Object.keys(t).forEach((P) => {
@@ -6961,12 +7011,12 @@ const Se = ({
6961
7011
  }), e(R);
6962
7012
  }
6963
7013
  }, g = () => {
6964
- const f = n.trim(), b = a.trim();
6965
- if (f !== "" && b !== "") {
6966
- const w = {};
7014
+ const f = n.trim(), k = a.trim();
7015
+ if (f !== "" && k !== "") {
7016
+ const b = {};
6967
7017
  Object.keys(t).forEach((M) => {
6968
- w[M] = t[M];
6969
- }), w[f] = b, e(w), l(""), i("");
7018
+ b[M] = t[M];
7019
+ }), b[f] = k, e(b), l(""), i("");
6970
7020
  }
6971
7021
  }, y = () => {
6972
7022
  l("");
@@ -6976,11 +7026,11 @@ const Se = ({
6976
7026
  f.key === "Enter" && g();
6977
7027
  };
6978
7028
  return /* @__PURE__ */ $("div", { children: [
6979
- Object.entries(t).map(([f, b], w) => /* @__PURE__ */ $("div", { className: "daga-value-item-element", children: [
7029
+ Object.entries(t).map(([f, k], b) => /* @__PURE__ */ $("div", { className: "daga-value-item-element", children: [
6980
7030
  /* @__PURE__ */ v(
6981
7031
  "input",
6982
7032
  {
6983
- id: `key-${w}`,
7033
+ id: `key-${b}`,
6984
7034
  className: "daga-input",
6985
7035
  type: "text",
6986
7036
  disabled: o,
@@ -6992,11 +7042,11 @@ const Se = ({
6992
7042
  /* @__PURE__ */ v(
6993
7043
  "input",
6994
7044
  {
6995
- id: `value-${w}`,
7045
+ id: `value-${b}`,
6996
7046
  className: "daga-input",
6997
7047
  type: "text",
6998
7048
  disabled: o,
6999
- value: b,
7049
+ value: k,
7000
7050
  onChange: (M) => h(f, M.target.value, "change"),
7001
7051
  onBlur: (M) => h(f, M.target.value, "blur")
7002
7052
  }
@@ -7045,7 +7095,7 @@ const Se = ({
7045
7095
  onValueChange: t,
7046
7096
  depth: e
7047
7097
  }) => {
7048
- const l = Ht(It).canUserPerformAction(k.UpdateValues) && o?.rootElement?.removed !== !0, a = (r) => "daga-property-name-" + r.replace(/\s/g, ""), i = (r) => {
7098
+ const l = Ht(It).canUserPerformAction(w.UpdateValues) && o?.rootElement?.removed !== !0, a = (r) => "daga-property-name-" + r.replace(/\s/g, ""), i = (r) => {
7049
7099
  if (typeof r == "string")
7050
7100
  return r;
7051
7101
  if (r == null || isNaN(r.valueOf()))
@@ -7231,27 +7281,27 @@ const Se = ({
7231
7281
  const e = Ht(It), n = rt(null), l = (r) => "daga-property-name-" + r.replace(/\s/g, ""), a = () => {
7232
7282
  for (const r of o?.displayedProperties || []) {
7233
7283
  let c = 0, d = 0, h = 0;
7234
- const g = E.select(n.current).select(
7284
+ const g = L.select(n.current).select(
7235
7285
  `.daga-property.${l(r.name)}.daga-depth-${t}`
7236
7286
  );
7237
7287
  g.select("button.daga-move-button").call(
7238
- E.drag().on(A.Start, (y) => {
7239
- S(T.Grabbing);
7288
+ L.drag().on(A.Start, (y) => {
7289
+ S(E.Grabbing);
7240
7290
  const m = e.getPointerLocationRelativeToScreen(y);
7241
7291
  if (m.length < 2 || isNaN(m[0]) || isNaN(m[1]))
7242
7292
  return;
7243
7293
  const p = g.node()?.getBoundingClientRect();
7244
7294
  c = p?.width || 0, d = p?.height || 0, g.style("position", "fixed").style("left", `${m[0] - c / 2}px`).style("top", `${m[1] - d / 2}px`).style("width", `${c}px`).style("height", `${d}px`).style("z-index", 1);
7245
7295
  }).on(A.Drag, (y) => {
7246
- S(T.Grabbing);
7296
+ S(E.Grabbing);
7247
7297
  const m = e.getPointerLocationRelativeToScreen(y);
7248
- m.length < 2 || isNaN(m[0]) || isNaN(m[1]) || (g.style("position", "fixed").style("left", `${m[0] - c / 2}px`).style("top", `${m[1] - d / 2}px`).style("width", `${c}px`).style("height", `${d}px`).style("z-index", 1), E.select(n.current).select(
7298
+ m.length < 2 || isNaN(m[0]) || isNaN(m[1]) || (g.style("position", "fixed").style("left", `${m[0] - c / 2}px`).style("top", `${m[1] - d / 2}px`).style("width", `${c}px`).style("height", `${d}px`).style("z-index", 1), L.select(n.current).select(
7249
7299
  `.daga-dropbar.daga-index-${h}.daga-depth-${t}`
7250
- ).style("visibility", "hidden").style("height", 0), h = i(m), E.select(n.current).select(
7300
+ ).style("visibility", "hidden").style("height", 0), h = i(m), L.select(n.current).select(
7251
7301
  `.daga-dropbar.daga-index-${h}.daga-depth-${t}`
7252
7302
  ).style("visibility", "visible").style("height", "0.25rem"));
7253
7303
  }).on(A.End, (y) => {
7254
- S(T.Auto), g.style("position", "relative").style("left", 0).style("top", 0).style("z-index", 0).style("width", "unset").style("height", "unset"), E.select(n.current).select(
7304
+ S(E.Auto), g.style("position", "relative").style("left", 0).style("top", 0).style("z-index", 0).style("width", "unset").style("height", "unset"), L.select(n.current).select(
7255
7305
  `.daga-dropbar.daga-index-${h}.daga-depth-${t}`
7256
7306
  ).style("visibility", "hidden").style("height", 0);
7257
7307
  const m = e.getPointerLocationRelativeToScreen(y);
@@ -7269,7 +7319,7 @@ const Se = ({
7269
7319
  }, i = (r) => {
7270
7320
  const c = o?.propertySet.propertyList || [], d = [];
7271
7321
  for (let h = 0; h <= c.length; ++h) {
7272
- const g = E.select(n.current).select(
7322
+ const g = L.select(n.current).select(
7273
7323
  `.daga-dropbar.daga-index-${h}.daga-depth-${t}`
7274
7324
  ).node()?.getBoundingClientRect();
7275
7325
  g && d.push([
@@ -7342,8 +7392,8 @@ const Se = ({
7342
7392
  r.name
7343
7393
  ))
7344
7394
  ] });
7345
- }, Ao = (o) => Array.isArray(o) ? o.join(", ") : Ei(o) ? Object.entries(o).map((t) => t.map((e) => JSON.stringify(e)).join(": ")).join(", ") : o instanceof Date ? o.toLocaleString() : o == null ? "" : "" + o, xo = ({ location: o, direction: t, width: e, height: n, title: l, valueSet: a, onValueChange: i }) => {
7346
- const s = rt(null), [r, c] = H(!1), [d, h] = H(!1), g = () => E.select(s.current);
7395
+ }, Ao = (o) => Array.isArray(o) ? o.join(", ") : Li(o) ? Object.entries(o).map((t) => t.map((e) => JSON.stringify(e)).join(": ")).join(", ") : o instanceof Date ? o.toLocaleString() : o == null ? "" : "" + o, xo = ({ location: o, direction: t, width: e, height: n, title: l, valueSet: a, onValueChange: i }) => {
7396
+ const s = rt(null), [r, c] = B(!1), [d, h] = B(!1), g = () => L.select(s.current);
7347
7397
  return Ct(() => {
7348
7398
  if (s.current)
7349
7399
  switch (t) {
@@ -7406,65 +7456,65 @@ const Se = ({
7406
7456
  ]
7407
7457
  }
7408
7458
  ) });
7409
- }, Eo = 6, To = (o) => {
7410
- const t = Ht(It), [e, n] = H(
7459
+ }, Lo = 6, Eo = (o) => {
7460
+ const t = Ht(It), [e, n] = B(
7411
7461
  o.currentPalette || o.palettes[0]
7412
- ), [l, a] = H(0), [i, s] = H(
7462
+ ), [l, a] = B(0), [i, s] = B(
7413
7463
  void 0
7414
7464
  ), r = rt(null), c = (p) => {
7415
7465
  if (n(p), d().selectAll("*").remove(), a(t.getPriorityThreshold() || 0), p.categories && h(p.categories), p.templates)
7416
7466
  for (const f of p.templates)
7417
7467
  g(f);
7418
- }, d = () => E.select(r.current).select(".daga-palette-view"), h = (p) => {
7468
+ }, d = () => L.select(r.current).select(".daga-palette-view"), h = (p) => {
7419
7469
  const f = d().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");
7420
7470
  f.append("option").attr("value", "").text("(None selected)");
7421
- for (const b in p)
7422
- f.append("option").attr("value", b).text(b);
7471
+ for (const k in p)
7472
+ f.append("option").attr("value", k).text(k);
7423
7473
  f.on(I.Change, () => {
7424
7474
  i && d().selectAll(".daga-template-container.daga-in-category").remove();
7425
- const b = f.property("value");
7426
- s(b);
7427
- const w = p[b] || [];
7428
- for (const M of w)
7475
+ const k = f.property("value");
7476
+ s(k);
7477
+ const b = p[k] || [];
7478
+ for (const M of b)
7429
7479
  g(M, "daga-in-category");
7430
7480
  }), i && (f.property("value", i), f.dispatch(I.Change));
7431
7481
  }, g = (p, f) => {
7432
7482
  if (p.templateType === "node") {
7433
- const b = t.model.nodes.types.get(p.type);
7434
- b ? y(b, p, f) : console.error(`Could not find a node type called '${p.type}'`);
7483
+ const k = t.model.nodes.types.get(p.type);
7484
+ k ? y(k, p, f) : console.error(`Could not find a node type called '${p.type}'`);
7435
7485
  } else if (p.templateType === "connection") {
7436
- const b = t.model.connections.types.get(p.type);
7437
- b ? m(b, p, f) : console.error(
7486
+ const k = t.model.connections.types.get(p.type);
7487
+ k ? m(k, p, f) : console.error(
7438
7488
  `Could not find a connection type called '${p.type}'`
7439
7489
  );
7440
7490
  }
7441
- }, y = (p, f, b) => {
7491
+ }, y = (p, f, k) => {
7442
7492
  if (l !== void 0 && p.priority < l)
7443
7493
  return;
7444
- const w = p.defaultLook.lookType === "shaped-look" ? p.defaultLook.borderThickness || 1 : 0, M = p.defaultHeight + w, R = p.defaultWidth + w, P = f.height || M, J = f.width || R, L = d().append("div").attr(
7494
+ const b = p.defaultLook.lookType === "shaped-look" ? p.defaultLook.borderThickness || 1 : 0, M = p.defaultHeight + b, R = p.defaultWidth + b, P = f.height || M, Q = f.width || R, T = d().append("div").attr(
7445
7495
  "class",
7446
- `daga-template-container ${b !== void 0 ? b : ""}`
7447
- ).style("width", `${J}px`).style("height", `${P}px`).call(
7448
- E.drag().on(A.Drag, (O) => {
7449
- if (t.canUserPerformAction(k.AddNode)) {
7496
+ `daga-template-container ${k !== void 0 ? k : ""}`
7497
+ ).style("width", `${Q}px`).style("height", `${P}px`).call(
7498
+ L.drag().on(A.Drag, (O) => {
7499
+ if (t.canUserPerformAction(w.AddNode)) {
7450
7500
  const x = t.getPointerLocationRelativeToScreen(O);
7451
7501
  if (x.length < 2 || isNaN(x[0]) || isNaN(x[1]))
7452
7502
  return;
7453
- L.style("position", "fixed").style("left", `${x[0] - J / 2}px`).style("top", `${x[1] - P / 2}px`).style("z-index", 1);
7503
+ T.style("position", "fixed").style("left", `${x[0] - Q / 2}px`).style("top", `${x[1] - P / 2}px`).style("z-index", 1);
7454
7504
  }
7455
7505
  }).on(A.Start, (O) => {
7456
- if (t.canUserPerformAction(k.AddNode)) {
7457
- S(T.Grabbing);
7506
+ if (t.canUserPerformAction(w.AddNode)) {
7507
+ S(E.Grabbing);
7458
7508
  const x = t.getPointerLocationRelativeToScreen(O);
7459
7509
  if (x.length < 2 || isNaN(x[0]) || isNaN(x[1]))
7460
7510
  return;
7461
- L.style("position", "fixed").style("left", `${x[0] - J / 2}px`).style("top", `${x[1] - P / 2}px`).style("z-index", 1), p.isUnique && t.model.nodes.find(
7511
+ T.style("position", "fixed").style("left", `${x[0] - Q / 2}px`).style("top", `${x[1] - P / 2}px`).style("z-index", 1), p.isUnique && t.model.nodes.find(
7462
7512
  (D) => !D.removed && D.type.id === p.id
7463
- ) !== void 0 && S(T.NotAllowed);
7513
+ ) !== void 0 && S(E.NotAllowed);
7464
7514
  }
7465
7515
  }).on(A.End, (O) => {
7466
- if (t.canUserPerformAction(k.AddNode)) {
7467
- if (S(T.Auto), L.style("position", "relative").style("left", 0).style("top", 0).style("z-index", "auto"), p.isUnique && t.model.nodes.find(
7516
+ if (t.canUserPerformAction(w.AddNode)) {
7517
+ if (S(E.Auto), T.style("position", "relative").style("left", 0).style("top", 0).style("z-index", "auto"), p.isUnique && t.model.nodes.find(
7468
7518
  (Ut) => !Ut.removed && Ut.type.id === p.id
7469
7519
  ) !== void 0)
7470
7520
  return;
@@ -7480,26 +7530,26 @@ const Se = ({
7480
7530
  const lt = t.getPointerLocationRelativeToCanvas(O);
7481
7531
  if (lt.length < 2 || isNaN(lt[0]) || isNaN(lt[1]))
7482
7532
  return;
7483
- let st = [
7533
+ let nt = [
7484
7534
  lt[0] - p.defaultWidth / 2,
7485
7535
  lt[1] - p.defaultHeight / 2
7486
7536
  ];
7487
- t.snapToGrid && (st = t.getClosestGridPoint(st));
7488
- const K = t.model.nodes.getAtCoordinates(
7537
+ t.snapToGrid && (nt = t.getClosestGridPoint(nt));
7538
+ const q = t.model.nodes.getAtCoordinates(
7489
7539
  lt[0],
7490
7540
  lt[1]
7491
7541
  ).filter(
7492
7542
  (Ut) => Ut.type.childrenTypes.includes(p.id)
7493
7543
  ), wt = Ue(
7494
- K
7495
- ), ot = wt[wt.length - 1];
7496
- if (!p.canBeParentless && ot === void 0)
7544
+ q
7545
+ ), st = wt[wt.length - 1];
7546
+ if (!p.canBeParentless && st === void 0)
7497
7547
  return;
7498
- const Gt = ot?.getLastAncestor(), Ce = new Ui(
7548
+ const Gt = st?.getLastAncestor(), Ce = new Ui(
7499
7549
  t,
7500
7550
  p,
7501
- st,
7502
- ot?.id,
7551
+ nt,
7552
+ st?.id,
7503
7553
  Gt?.id,
7504
7554
  Gt?.getGeometry(),
7505
7555
  void 0,
@@ -7509,10 +7559,10 @@ const Se = ({
7509
7559
  Ce.do(), t?.actionStack.add(Ce), S();
7510
7560
  }
7511
7561
  })
7512
- ).append("svg").attr("class", `palette-node ${p.id}`).attr("viewBox", `0 0 ${R} ${M}`).attr("preserveAspectRatio", "none").style("position", "relative").style("left", 0).style("top", 0).style("width", `${J}px`).style("height", `${P}px`), C = f.look || p.defaultLook;
7562
+ ).append("svg").attr("class", `palette-node ${p.id}`).attr("viewBox", `0 0 ${R} ${M}`).attr("preserveAspectRatio", "none").style("position", "relative").style("left", 0).style("top", 0).style("width", `${Q}px`).style("height", `${P}px`), C = f.look || p.defaultLook;
7513
7563
  switch (C.lookType) {
7514
7564
  case "shaped-look":
7515
- L.append("path").attr(
7565
+ T.append("path").attr(
7516
7566
  "d",
7517
7567
  me(
7518
7568
  C.shape || Nt.Rectangle,
@@ -7524,33 +7574,33 @@ const Se = ({
7524
7574
  ).attr("fill", C.fillColor || "#FFFFFF").attr("stroke", C.borderColor || "#000000").attr("stroke-width", `${C.borderThickness}px`);
7525
7575
  break;
7526
7576
  case "image-look":
7527
- L.append("image").attr("x", 0).attr("y", 0).attr("width", p.defaultWidth).attr("height", p.defaultHeight).attr("href", C.backgroundImage).attr("preserveAspectRatio", "none");
7577
+ T.append("image").attr("x", 0).attr("y", 0).attr("width", p.defaultWidth).attr("height", p.defaultHeight).attr("href", C.backgroundImage).attr("preserveAspectRatio", "none");
7528
7578
  break;
7529
7579
  case "stretchable-image-look":
7530
- L.append("image").attr("x", 0).attr("y", 0).attr("width", C.leftMargin).attr("height", C.topMargin).attr("href", C.backgroundImageTopLeft).attr("preserveAspectRatio", "none"), L.append("image").attr("x", C.leftMargin).attr("y", 0).attr(
7580
+ 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(
7531
7581
  "width",
7532
7582
  p.defaultWidth - C.rightMargin - C.leftMargin
7533
- ).attr("height", C.topMargin).attr("href", C.backgroundImageTop).attr("preserveAspectRatio", "none"), L.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"), L.append("image").attr("x", 0).attr("y", C.topMargin).attr("width", C.leftMargin).attr(
7583
+ ).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(
7534
7584
  "height",
7535
7585
  p.defaultHeight - C.bottomMargin - C.topMargin
7536
- ).attr("href", C.backgroundImageLeft).attr("preserveAspectRatio", "none"), L.append("image").attr("x", C.leftMargin).attr("y", C.topMargin).attr(
7586
+ ).attr("href", C.backgroundImageLeft).attr("preserveAspectRatio", "none"), T.append("image").attr("x", C.leftMargin).attr("y", C.topMargin).attr(
7537
7587
  "width",
7538
7588
  p.defaultWidth - C.rightMargin - C.leftMargin
7539
7589
  ).attr(
7540
7590
  "height",
7541
7591
  p.defaultHeight - C.bottomMargin - C.topMargin
7542
- ).attr("href", C.backgroundImageCenter).attr("preserveAspectRatio", "none"), L.append("image").attr("x", p.defaultWidth - C.rightMargin).attr("y", C.topMargin).attr("width", C.rightMargin).attr(
7592
+ ).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(
7543
7593
  "height",
7544
7594
  p.defaultHeight - C.bottomMargin - C.topMargin
7545
- ).attr("href", C.backgroundImageRight).attr("preserveAspectRatio", "none"), L.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"), L.append("image").attr("x", C.leftMargin).attr("y", p.defaultHeight - C.bottomMargin).attr(
7595
+ ).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(
7546
7596
  "width",
7547
7597
  p.defaultWidth - C.rightMargin - C.leftMargin
7548
- ).attr("height", C.bottomMargin).attr("href", C.backgroundImageBottom).attr("preserveAspectRatio", "none"), L.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");
7598
+ ).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");
7549
7599
  }
7550
7600
  if (f.look === void 0) {
7551
7601
  if (p.decorators)
7552
7602
  for (const O of p.decorators)
7553
- L.append("foreignObject").attr("width", `${O.width}px`).attr("height", `${O.height}px`).attr(
7603
+ T.append("foreignObject").attr("width", `${O.width}px`).attr("height", `${O.height}px`).attr(
7554
7604
  "transform",
7555
7605
  `translate(${O.coords[0]},${O.coords[1]})`
7556
7606
  ).html(O.html);
@@ -7560,20 +7610,20 @@ const Se = ({
7560
7610
  ...p.label,
7561
7611
  ...f.labelLook
7562
7612
  };
7563
- L.append("text").attr(
7613
+ T.append("text").attr(
7564
7614
  "transform",
7565
- `translate(${(j(O) + p.defaultWidth) / 2},${(G(O) + p.defaultHeight) / 2})`
7615
+ `translate(${(U(O) + p.defaultWidth) / 2},${(H(O) + p.defaultHeight) / 2})`
7566
7616
  ).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(f.label);
7567
7617
  }
7568
7618
  }
7569
- }, m = (p, f, b) => {
7570
- const w = d().append("div").attr(
7619
+ }, m = (p, f, k) => {
7620
+ const b = d().append("div").attr(
7571
7621
  "class",
7572
- `daga-template-container ${b !== void 0 ? b : ""}`
7622
+ `daga-template-container ${k !== void 0 ? k : ""}`
7573
7623
  ).style("width", `${f.width}px`).style("height", `${f.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", () => {
7574
7624
  t.connectionType = p;
7575
7625
  });
7576
- w.append("path").attr(
7626
+ b.append("path").attr(
7577
7627
  "d",
7578
7628
  me(
7579
7629
  Nt.Rectangle,
@@ -7582,9 +7632,9 @@ const Se = ({
7582
7632
  f.width,
7583
7633
  f.height
7584
7634
  )
7585
- ).attr("fill", f.backgroundColor).attr("stroke", "black").attr("stroke-width", "1px"), f.icon !== "" && w.append("image").attr("x", 0).attr("y", 0).attr("width", f.width).attr("height", f.height).attr("href", f.icon), f.label !== "" && w.append("text").attr(
7635
+ ).attr("fill", f.backgroundColor).attr("stroke", "black").attr("stroke-width", "1px"), f.icon !== "" && b.append("image").attr("x", 0).attr("y", 0).attr("width", f.width).attr("height", f.height).attr("href", f.icon), f.label !== "" && b.append("text").attr(
7586
7636
  "transform",
7587
- `translate(${f.width / 2},${f.height / 2 + Eo})`
7637
+ `translate(${f.width / 2},${f.height / 2 + Lo})`
7588
7638
  ).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(f.label);
7589
7639
  };
7590
7640
  return Ct(() => {
@@ -7632,7 +7682,7 @@ const Se = ({
7632
7682
  ]
7633
7683
  }
7634
7684
  ) });
7635
- }, Lo = ({
7685
+ }, To = ({
7636
7686
  location: o,
7637
7687
  direction: t,
7638
7688
  enableAction: e,
@@ -7658,61 +7708,61 @@ const Se = ({
7658
7708
  }
7659
7709
  const m = rt(null), p = rt(null), f = rt(null);
7660
7710
  Ct(() => {
7661
- E.select(
7711
+ L.select(
7662
7712
  m.current
7663
7713
  ).style(`margin-${y}`, "-1rem").style(d, "0rem").style("transform", `${h}(0)`).style("transform-origin", g);
7664
7714
  });
7665
- const b = async () => {
7666
- const K = E.select(
7715
+ const k = async () => {
7716
+ const q = L.select(
7667
7717
  m.current
7668
7718
  );
7669
7719
  if (!c)
7670
7720
  if (r) {
7671
7721
  r = !1;
7672
- const Gt = `${4 * K.selectChildren().size()}rem`;
7673
- K.transition().duration(500).ease(E.easeLinear).style(d, Gt).style("transform", `${h}(1)`), setTimeout(() => {
7722
+ const Gt = `${4 * q.selectChildren().size()}rem`;
7723
+ q.transition().duration(500).ease(L.easeLinear).style(d, Gt).style("transform", `${h}(1)`), setTimeout(() => {
7674
7724
  c = !1;
7675
7725
  }, 500);
7676
7726
  } else
7677
- r = !0, K.transition().duration(500).ease(E.easeLinear).style(d, "0rem").style("transform", `${h}(0)`), setTimeout(() => {
7727
+ r = !0, q.transition().duration(500).ease(L.easeLinear).style(d, "0rem").style("transform", `${h}(0)`), setTimeout(() => {
7678
7728
  c = !1;
7679
7729
  }, 500);
7680
- }, w = Ht(It), M = () => {
7681
- w.zoomBy(w.zoomFactor);
7730
+ }, b = Ht(It), M = () => {
7731
+ b.zoomBy(b.zoomFactor);
7682
7732
  }, R = () => {
7683
- w.zoomBy(1 / w.zoomFactor);
7733
+ b.zoomBy(1 / b.zoomFactor);
7684
7734
  }, P = () => {
7685
- w.center();
7686
- }, J = () => {
7687
- w.layoutFormat && w.layoutFormat in ze && ze[w.layoutFormat].apply(w.model);
7688
- }, L = () => {
7689
- s = !s, E.select(
7735
+ b.center();
7736
+ }, Q = () => {
7737
+ b.layoutFormat && b.layoutFormat in ze && ze[b.layoutFormat].apply(b.model);
7738
+ }, T = () => {
7739
+ s = !s, L.select(
7690
7740
  f.current
7691
7741
  ).classed("daga-on", s).classed("daga-off", !s);
7692
- const K = w.getPriorityThresholdOptions();
7693
- K && K.length >= 2 && w.setPriorityThreshold(
7694
- K[s ? 1 : 0]
7742
+ const q = b.getPriorityThresholdOptions();
7743
+ q && q.length >= 2 && b.setPriorityThreshold(
7744
+ q[s ? 1 : 0]
7695
7745
  );
7696
7746
  }, C = () => {
7697
- w.actionStack.undo();
7747
+ b.actionStack.undo();
7698
7748
  }, O = () => {
7699
- w.actionStack.redo();
7749
+ b.actionStack.redo();
7700
7750
  }, x = () => {
7701
- w.userSelection.copyToClipboard();
7751
+ b.userSelection.copyToClipboard();
7702
7752
  }, D = () => {
7703
- w.userSelection.cutToClipboard();
7753
+ b.userSelection.cutToClipboard();
7704
7754
  }, lt = () => {
7705
- w.userSelection.pasteFromClipboard();
7706
- }, st = () => {
7707
- w.userSelection.removeFromModel();
7755
+ b.userSelection.pasteFromClipboard();
7756
+ }, nt = () => {
7757
+ b.userSelection.removeFromModel();
7708
7758
  }, Bt = () => {
7709
- w.multipleSelectionOn = !0, E.select(
7759
+ b.multipleSelectionOn = !0, L.select(
7710
7760
  p.current
7711
7761
  ).classed("daga-on", !0).classed("daga-off", !1);
7712
- const K = w.diagramEvent$.subscribe((wt) => {
7713
- wt.type === We.Selection && (E.select(
7762
+ const q = b.diagramEvent$.subscribe((wt) => {
7763
+ wt.type === We.Selection && (L.select(
7714
7764
  p.current
7715
- ).classed("daga-on", !1).classed("daga-off", !0), K.unsubscribe());
7765
+ ).classed("daga-on", !1).classed("daga-off", !0), q.unsubscribe());
7716
7766
  });
7717
7767
  };
7718
7768
  return /* @__PURE__ */ v("daga-diagram-buttons", { children: /* @__PURE__ */ $(
@@ -7720,21 +7770,21 @@ const Se = ({
7720
7770
  {
7721
7771
  className: `daga-diagram-buttons daga-${o} daga-${t}`,
7722
7772
  children: [
7723
- i && w.canUserPerformAction(k.Zoom) && /* @__PURE__ */ v("button", { className: "daga-zoom-in", onClick: M, children: /* @__PURE__ */ v("span", { className: "daga-tooltip", children: "Zoom in" }) }),
7724
- i && w.canUserPerformAction(k.Zoom) && /* @__PURE__ */ v("button", { className: "daga-zoom-out", onClick: R, children: /* @__PURE__ */ v("span", { className: "daga-tooltip", children: "Zoom out" }) }),
7773
+ i && b.canUserPerformAction(w.Zoom) && /* @__PURE__ */ v("button", { className: "daga-zoom-in", onClick: M, children: /* @__PURE__ */ v("span", { className: "daga-tooltip", children: "Zoom in" }) }),
7774
+ i && b.canUserPerformAction(w.Zoom) && /* @__PURE__ */ v("button", { className: "daga-zoom-out", onClick: R, children: /* @__PURE__ */ v("span", { className: "daga-tooltip", children: "Zoom out" }) }),
7725
7775
  /* @__PURE__ */ $("div", { className: "daga-collapsable-buttons daga-collapsed", ref: m, children: [
7726
- i && w.canUserPerformAction(k.Zoom) && /* @__PURE__ */ v("button", { className: "daga-center", onClick: P, children: /* @__PURE__ */ v("span", { className: "daga-tooltip", children: "Fit diagram to screen" }) }),
7776
+ i && b.canUserPerformAction(w.Zoom) && /* @__PURE__ */ v("button", { className: "daga-center", onClick: P, children: /* @__PURE__ */ v("span", { className: "daga-tooltip", children: "Fit diagram to screen" }) }),
7727
7777
  e && /* @__PURE__ */ v("button", { className: "daga-undo", onClick: C, children: /* @__PURE__ */ v("span", { className: "daga-tooltip", children: "Undo" }) }),
7728
7778
  e && /* @__PURE__ */ v("button", { className: "daga-redo", onClick: O, children: /* @__PURE__ */ v("span", { className: "daga-tooltip", children: "Redo" }) }),
7729
7779
  a && /* @__PURE__ */ v("button", { className: "daga-copy", onClick: x, children: /* @__PURE__ */ v("span", { className: "daga-tooltip", children: "Copy" }) }),
7730
7780
  a && /* @__PURE__ */ v("button", { className: "daga-cut", onClick: D, children: /* @__PURE__ */ v("span", { className: "daga-tooltip", children: "Cut" }) }),
7731
7781
  a && /* @__PURE__ */ v("button", { className: `daga-multiple-selection ${s ? "daga-on" : "daga-off"}`, onClick: Bt, ref: p, children: /* @__PURE__ */ v("span", { className: "daga-tooltip", children: "Multiple selection" }) }),
7732
7782
  a && /* @__PURE__ */ v("button", { className: "daga-paste", onClick: lt, children: /* @__PURE__ */ v("span", { className: "daga-tooltip", children: "Paste" }) }),
7733
- a && /* @__PURE__ */ v("button", { className: "daga-delete", onClick: st, children: /* @__PURE__ */ v("span", { className: "daga-tooltip", children: "Delete" }) }),
7734
- l && w.layoutFormat && /* @__PURE__ */ v("button", { className: "daga-layout", onClick: J, children: /* @__PURE__ */ v("span", { className: "daga-tooltip", children: "Apply layout" }) }),
7735
- n && /* @__PURE__ */ v("button", { className: `daga-filter ${s ? "daga-on" : "daga-off"}`, onClick: L, ref: f, children: /* @__PURE__ */ v("span", { className: "daga-tooltip", children: "Apply filter" }) })
7783
+ a && /* @__PURE__ */ v("button", { className: "daga-delete", onClick: nt, children: /* @__PURE__ */ v("span", { className: "daga-tooltip", children: "Delete" }) }),
7784
+ l && b.layoutFormat && /* @__PURE__ */ v("button", { className: "daga-layout", onClick: Q, children: /* @__PURE__ */ v("span", { className: "daga-tooltip", children: "Apply layout" }) }),
7785
+ n && /* @__PURE__ */ v("button", { className: `daga-filter ${s ? "daga-on" : "daga-off"}`, onClick: T, ref: f, children: /* @__PURE__ */ v("span", { className: "daga-tooltip", children: "Apply filter" }) })
7736
7786
  ] }),
7737
- /* @__PURE__ */ v("button", { className: "daga-more-options", onClick: b, children: r ? /* @__PURE__ */ v("span", { className: "daga-tooltip", children: "More options" }) : /* @__PURE__ */ v("span", { className: "daga-tooltip", children: "Less options" }) })
7787
+ /* @__PURE__ */ v("button", { className: "daga-more-options", onClick: k, children: r ? /* @__PURE__ */ v("span", { className: "daga-tooltip", children: "More options" }) : /* @__PURE__ */ v("span", { className: "daga-tooltip", children: "Less options" }) })
7738
7788
  ]
7739
7789
  }
7740
7790
  ) });
@@ -7745,7 +7795,7 @@ const Se = ({
7745
7795
  onDiagramEvent: n,
7746
7796
  onModelChange: l
7747
7797
  }) => {
7748
- const a = new je(), i = new qe(), s = rt(null), r = rt(void 0), c = rt(!1), d = [], [h, g] = H(void 0), [y, m] = H(void 0), p = {
7798
+ const a = new je(), i = new qe(), s = rt(null), r = rt(void 0), c = rt(!1), d = [], [h, g] = B(void 0), [y, m] = B(void 0), p = {
7749
7799
  zoomIn: () => {
7750
7800
  },
7751
7801
  zoomOut: () => {
@@ -7763,15 +7813,15 @@ const Se = ({
7763
7813
  }, f = {
7764
7814
  refreshPalette: () => {
7765
7815
  }
7766
- }, b = new yo(
7767
- (L) => g(L),
7768
- (L) => m(L)
7769
- ), w = {
7816
+ }, k = new yo(
7817
+ (T) => g(T),
7818
+ (T) => m(T)
7819
+ ), b = {
7770
7820
  diagramButtons: p,
7771
7821
  palette: f,
7772
- propertyEditor: b
7773
- }, M = (L = !1) => ((!r.current || L) && (d.forEach((C) => C.unsubscribe()), r.current = new ve(w, o)), r.current), R = M(), P = (L) => {
7774
- R.initView(L), d.push(
7822
+ propertyEditor: k
7823
+ }, M = (T = !1) => ((!r.current || T) && (d.forEach((C) => C.unsubscribe()), r.current = new ve(b, o)), r.current), R = M(), P = (T) => {
7824
+ R.initView(T), d.push(
7775
7825
  R.diagramEvent$.subscribe((C) => {
7776
7826
  n?.(C);
7777
7827
  })
@@ -7789,21 +7839,21 @@ const Se = ({
7789
7839
  }, [o]), Ct(() => {
7790
7840
  t && a.import(R.model, t);
7791
7841
  }, [t]);
7792
- const J = (L, C, O) => {
7793
- if (y !== void 0 && C.editable !== !1 && !St(L.getValue(C.name), O)) {
7794
- L.setValue(C.name, O);
7842
+ const Q = (T, C, O) => {
7843
+ if (y !== void 0 && C.editable !== !1 && !St(T.getValue(C.name), O)) {
7844
+ T.setValue(C.name, O);
7795
7845
  const x = new yt(
7796
7846
  y.propertySet,
7797
7847
  void 0
7798
7848
  );
7799
- x.setValues(y.getValues()), x.rootElement = y.rootElement, b.valueSet = x, y.rootElement.valueSet = x, R.propertyEditorChanges$?.next();
7849
+ x.setValues(y.getValues()), x.rootElement = y.rootElement, k.valueSet = x, y.rootElement.valueSet = x, R.propertyEditorChanges$?.next();
7800
7850
  }
7801
7851
  };
7802
7852
  return /* @__PURE__ */ v("daga-diagram", { children: /* @__PURE__ */ v(vo.Provider, { value: o, children: /* @__PURE__ */ v(It.Provider, { value: R, children: /* @__PURE__ */ $("daga-diagram-editor", { children: [
7803
7853
  /* @__PURE__ */ v("div", { className: "daga-append-to", ref: s }),
7804
7854
  /* @__PURE__ */ $(It.Provider, { value: R, children: [
7805
7855
  o.components?.buttons !== void 0 && o.components?.buttons?.enabled !== !1 && /* @__PURE__ */ v(
7806
- Lo,
7856
+ To,
7807
7857
  {
7808
7858
  location: o.components?.buttons?.location || jt.BottomRight,
7809
7859
  direction: o.components?.buttons?.direction || u.Top,
@@ -7815,7 +7865,7 @@ const Se = ({
7815
7865
  }
7816
7866
  ),
7817
7867
  o.components?.palette !== void 0 && o.components?.palette?.enabled !== !1 && o.components?.palette?.sections && (o.components?.palette?.sections?.length || 0) > 0 && /* @__PURE__ */ v(
7818
- To,
7868
+ Eo,
7819
7869
  {
7820
7870
  location: o.components?.palette?.location || jt.TopLeft,
7821
7871
  direction: o.components?.palette?.direction || u.Bottom,
@@ -7833,7 +7883,7 @@ const Se = ({
7833
7883
  height: o.components?.propertyEditor?.height,
7834
7884
  title: h,
7835
7885
  valueSet: y,
7836
- onValueChange: J
7886
+ onValueChange: Q
7837
7887
  }
7838
7888
  ),
7839
7889
  o.components?.errors !== void 0 && o.components?.errors?.enabled !== !1 && /* @__PURE__ */ v(bo, {})