@metadev/daga-react 4.2.4 → 4.2.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/index.mjs CHANGED
@@ -1,9 +1,9 @@
1
- import { jsx as k, jsxs as V, Fragment as Hi } from "react/jsx-runtime";
1
+ import { jsx as k, jsxs as V, Fragment as Yi } from "react/jsx-runtime";
2
2
  import * as N from "d3";
3
- import { debounceTime as Gi, Subject as Zt, merge as Bi, map as Ui } from "rxjs";
4
- import { createContext as yi, useState as U, useContext as Wt, useRef as dt, useEffect as Tt, useMemo as Yi } from "react";
3
+ import { debounceTime as Xi, Subject as Zt, merge as ji, map as Wi } from "rxjs";
4
+ import { createContext as Ci, useState as U, useContext as Wt, useRef as dt, useEffect as Tt, useMemo as Zi } from "react";
5
5
  var b = /* @__PURE__ */ ((i) => (i.Bottom = "bottom", i.Left = "left", i.Right = "right", i.Top = "top", i))(b || {}), qt = /* @__PURE__ */ ((i) => (i.BottomLeft = "bottom-left", i.BottomRight = "bottom-right", i.TopLeft = "top-left", i.TopRight = "top-right", i))(qt || {}), zt = /* @__PURE__ */ ((i) => (i.Left = "left", i.Center = "center", i.Right = "right", i))(zt || {}), Qt = /* @__PURE__ */ ((i) => (i.Top = "top", i.Center = "center", i.Bottom = "bottom", i))(Qt || {});
6
- const Nt = (i) => [Math.round(i[0]), Math.round(i[1])], kt = (i, t, e) => t < e ? t <= i && i <= e : e <= i && i <= t, ri = (i, t, e) => (i - t[0]) / (t[1] - t[0]) * (e[1] - e[0]) + e[0], te = (i, t, e, o, a, l, s) => {
6
+ const Nt = (i) => [Math.round(i[0]), Math.round(i[1])], kt = (i, t, e) => t < e ? t <= i && i <= e : e <= i && i <= t, di = (i, t, e) => (i - t[0]) / (t[1] - t[0]) * (e[1] - e[0]) + e[0], te = (i, t, e, o, a, l, s) => {
7
7
  const n = (() => {
8
8
  switch (l) {
9
9
  case "start":
@@ -16,7 +16,7 @@ const Nt = (i) => [Math.round(i[0]), Math.round(i[1])], kt = (i, t, e) => t < e
16
16
  }
17
17
  case "floating":
18
18
  default:
19
- return ri(i[0], t, o);
19
+ return di(i[0], t, o);
20
20
  }
21
21
  })(), r = (() => {
22
22
  switch (s) {
@@ -30,11 +30,11 @@ const Nt = (i) => [Math.round(i[0]), Math.round(i[1])], kt = (i, t, e) => t < e
30
30
  }
31
31
  case "floating":
32
32
  default:
33
- return ri(i[1], e, a);
33
+ return di(i[1], e, a);
34
34
  }
35
35
  })();
36
36
  return [n, r];
37
- }, bi = (i, t) => ((i[0] - t[0]) ** 2 + (i[1] - t[1]) ** 2) ** 0.5, Xi = (i, t) => (kt(
37
+ }, Si = (i, t) => ((i[0] - t[0]) ** 2 + (i[1] - t[1]) ** 2) ** 0.5, Ki = (i, t) => (kt(
38
38
  i[0][0],
39
39
  t[0][0],
40
40
  t[1][0]
@@ -69,8 +69,8 @@ const Nt = (i) => [Math.round(i[0]), Math.round(i[1])], kt = (i, t, e) => t < e
69
69
  ));
70
70
  var L = /* @__PURE__ */ ((i) => (i.Blur = "blur", i.Change = "change", i.Click = "click", i.ContextMenu = "contextmenu", i.DoubleClick = "dblclick", i.Focus = "focus", i.FocusIn = "focusin", i.FocusOut = "focusout", i.Input = "input", i.KeyDown = "keydown", i.KeyUp = "keyup", i.MouseDown = "mousedown", i.MouseEnter = "mouseenter", i.MouseLeave = "mouseleave", i.MouseMove = "mousemove", i.MouseOut = "mouseout", i.MouseOver = "mouseover", i.MouseUp = "mouseup", i.TouchStart = "touchstart", i.TouchEnd = "touchend", i.Wheel = "wheel", i))(L || {}), it = /* @__PURE__ */ ((i) => (i.Alt = "Alt", i.AltGraph = "AltGraph", i.ArrowDown = "ArrowDown", i.ArrowLeft = "ArrowLeft", i.ArrowRight = "ArrowRight", i.ArrowUp = "ArrowUp", i.Backspace = "Backspace", i.Control = "Control", i.Delete = "Delete", i.End = "End", i.Enter = "Enter", i.Escape = "Escape", i.Home = "Home", i.OS = "OS", i.PageDown = "PageDown", i.PageUp = "PageUp", i.Shift = "Shift", i.Tab = "Tab", i))(it || {}), M = /* @__PURE__ */ ((i) => (i.Drag = "drag", i.Start = "start", i.End = "end", i))(M || {}), ve = /* @__PURE__ */ ((i) => (i.Zoom = "zoom", i.Start = "start", i.End = "end", i))(ve || {});
71
71
  const ye = (i) => i.replace(/([!"#$%&'()*+,\-./:;<=>?@[\\\]^`{|}])/g, "\\$1");
72
- var ki = /* @__PURE__ */ ((i) => (i.Straight = "straight", i.Bezier = "bezier", i.Square = "square", i))(ki || {}), Se = /* @__PURE__ */ ((i) => (i.Solid = "solid", i.Dashed = "dashed", i.GappedDashes = "gapped-dashes", i.Dotted = "dotted", i))(Se || {});
73
- const ji = 20, Wi = (i, t, e, o, a) => {
72
+ var Ii = /* @__PURE__ */ ((i) => (i.Straight = "straight", i.Bezier = "bezier", i.Square = "square", i))(Ii || {}), Se = /* @__PURE__ */ ((i) => (i.Solid = "solid", i.Dashed = "dashed", i.GappedDashes = "gapped-dashes", i.Dotted = "dotted", i))(Se || {});
73
+ const qi = 20, Ji = (i, t, e, o, a) => {
74
74
  if (typeof i == "function")
75
75
  return i(
76
76
  t,
@@ -83,7 +83,7 @@ const ji = 20, Wi = (i, t, e, o, a) => {
83
83
  if (t.length === 1)
84
84
  return `M ${t[0][0]} ${t[0][1]}`;
85
85
  {
86
- a = a || ji;
86
+ a = a || qi;
87
87
  let l = "", s, n;
88
88
  switch (i) {
89
89
  case "straight":
@@ -251,60 +251,60 @@ const ke = (i, t, e, o, a) => {
251
251
  return i(t, e, o, a);
252
252
  switch (i) {
253
253
  case "ellipse":
254
- return wi(t, e, o, a);
254
+ return Ai(t, e, o, a);
255
255
  case "empty":
256
- return Zi();
256
+ return Qi();
257
257
  case "folder":
258
- return Ki(t, e, o, a);
258
+ return to(t, e, o, a);
259
259
  case "hexagon":
260
- return qi(t, e, o, a);
260
+ return eo(t, e, o, a);
261
261
  case "octagon":
262
- return Ji(t, e, o, a);
262
+ return io(t, e, o, a);
263
263
  case "pill":
264
264
  return Jt(t, e, o, a);
265
265
  case "rectangle":
266
- return ai(t, e, o, a);
266
+ return hi(t, e, o, a);
267
267
  case "rhombus":
268
- return Qi(t, e, o, a);
268
+ return oo(t, e, o, a);
269
269
  case "rounded-rectangle":
270
- return to(t, e, o, a);
270
+ return so(t, e, o, a);
271
271
  case "sticky-note":
272
- return eo(t, e, o, a);
272
+ return no(t, e, o, a);
273
273
  default:
274
- return ai(t, e, o, a);
274
+ return hi(t, e, o, a);
275
275
  }
276
- }, wi = (i, t, e, o) => `M ${i + e / 2} ${t} A ${e / 2} ${o / 2} 0 0 0 ${i + e / 2} ${t + o} A ${e / 2} ${o / 2} 0 1 0 ${i + e / 2} ${t} Z`, Zi = () => "Z", Ki = (i, t, e, o) => `M ${i} ${t} L ${i + e / 3} ${t} L ${i + e / 2} ${t + o / 6} L ${i + e} ${t + o / 6} L ${i + e} ${t + o} L ${i} ${t + o} Z`, qi = (i, t, e, o) => `M ${i + e / 4} ${t} L ${i + 3 * e / 4} ${t} L ${i + e} ${t + o / 2} L ${i + 3 * e / 4} ${t + o} L ${i + e / 4} ${t + o} L ${i} ${t + o / 2} Z`, Ji = (i, t, e, o) => `M ${i + e / 4} ${t} L ${i + 3 * e / 4} ${t} L ${i + e} ${t + o / 4} L ${i + e} ${t + 3 * o / 4} L ${i + 3 * e / 4} ${t + o} L ${i + e / 4} ${t + o} L ${i} ${t + 3 * o / 4} L ${i} ${t + o / 4} L ${i + e / 4} ${t} Z`, Jt = (i, t, e, o) => o < e ? `M ${i + o / 2} ${t} L ${i + e - o / 2} ${t} A ${o / 2} ${o / 2} 0 0 1 ${i + e} ${t + o / 2} A ${o / 2} ${o / 2} 0 0 1 ${i + e - o / 2} ${t + o} L ${i + o / 2} ${t + o} A ${o / 2} ${o / 2} 0 0 1 ${i} ${t + o / 2} A ${o / 2} ${o / 2} 0 0 1 ${i + o / 2} ${t} Z` : o > e ? `M ${i} ${t + e / 2} L ${i} ${t + o - e / 2} A ${e / 2} ${e / 2} 0 0 0 ${i + e / 2} ${t + o} A ${e / 2} ${e / 2} 0 0 0 ${i + e} ${t + o - e / 2} L ${i + e} ${t + e / 2} A ${e / 2} ${e / 2} 0 0 0 ${i + e / 2} ${t} A ${e / 2} ${e / 2} 0 0 0 ${i} ${t + e / 2} Z` : wi(i, t, e, o), ai = (i, t, e, o) => `M ${i} ${t} L ${i + e} ${t} L ${i + e} ${t + o} L ${i} ${t + o} Z`, Qi = (i, t, e, o) => `M ${i + e / 2} ${t} L ${i + e} ${t + o / 2} L ${i + e / 2} ${t + o} L ${i} ${t + o / 2} Z`, to = (i, t, e, o) => `M ${i + e / 4} ${t} L ${i + 3 * e / 4} ${t} A ${e / 4} ${o / 4} 0 0 1 ${i + e} ${t + o / 4} L ${i + e} ${t + 3 * o / 4} A ${e / 4} ${o / 4} 0 0 1 ${i + 3 * e / 4} ${t + o} L ${i + e / 4} ${t + o} A ${e / 4} ${o / 4} 0 0 1 ${i} ${t + 3 * o / 4} L ${i} ${t + o / 4} A ${e / 4} ${o / 4} 0 0 1 ${i + e / 4} ${t} Z`, eo = (i, t, e, o) => `M ${i} ${t} L ${i + 3 * e / 4} ${t} L ${i + 3 * e / 4} ${t + o / 4} L ${i + 3 * e / 4} ${t} L ${i + e} ${t + o / 4} L ${i + 3 * e / 4} ${t + o / 4} L ${i + e} ${t + o / 4} L ${i + e} ${t + o} L ${i} ${t + o} Z`;
276
+ }, Ai = (i, t, e, o) => `M ${i + e / 2} ${t} A ${e / 2} ${o / 2} 0 0 0 ${i + e / 2} ${t + o} A ${e / 2} ${o / 2} 0 1 0 ${i + e / 2} ${t} Z`, Qi = () => "Z", to = (i, t, e, o) => `M ${i} ${t} L ${i + e / 3} ${t} L ${i + e / 2} ${t + o / 6} L ${i + e} ${t + o / 6} L ${i + e} ${t + o} L ${i} ${t + o} Z`, eo = (i, t, e, o) => `M ${i + e / 4} ${t} L ${i + 3 * e / 4} ${t} L ${i + e} ${t + o / 2} L ${i + 3 * e / 4} ${t + o} L ${i + e / 4} ${t + o} L ${i} ${t + o / 2} Z`, io = (i, t, e, o) => `M ${i + e / 4} ${t} L ${i + 3 * e / 4} ${t} L ${i + e} ${t + o / 4} L ${i + e} ${t + 3 * o / 4} L ${i + 3 * e / 4} ${t + o} L ${i + e / 4} ${t + o} L ${i} ${t + 3 * o / 4} L ${i} ${t + o / 4} L ${i + e / 4} ${t} Z`, Jt = (i, t, e, o) => o < e ? `M ${i + o / 2} ${t} L ${i + e - o / 2} ${t} A ${o / 2} ${o / 2} 0 0 1 ${i + e} ${t + o / 2} A ${o / 2} ${o / 2} 0 0 1 ${i + e - o / 2} ${t + o} L ${i + o / 2} ${t + o} A ${o / 2} ${o / 2} 0 0 1 ${i} ${t + o / 2} A ${o / 2} ${o / 2} 0 0 1 ${i + o / 2} ${t} Z` : o > e ? `M ${i} ${t + e / 2} L ${i} ${t + o - e / 2} A ${e / 2} ${e / 2} 0 0 0 ${i + e / 2} ${t + o} A ${e / 2} ${e / 2} 0 0 0 ${i + e} ${t + o - e / 2} L ${i + e} ${t + e / 2} A ${e / 2} ${e / 2} 0 0 0 ${i + e / 2} ${t} A ${e / 2} ${e / 2} 0 0 0 ${i} ${t + e / 2} Z` : Ai(i, t, e, o), hi = (i, t, e, o) => `M ${i} ${t} L ${i + e} ${t} L ${i + e} ${t + o} L ${i} ${t + o} Z`, oo = (i, t, e, o) => `M ${i + e / 2} ${t} L ${i + e} ${t + o / 2} L ${i + e / 2} ${t + o} L ${i} ${t + o / 2} Z`, so = (i, t, e, o) => `M ${i + e / 4} ${t} L ${i + 3 * e / 4} ${t} A ${e / 4} ${o / 4} 0 0 1 ${i + e} ${t + o / 4} L ${i + e} ${t + 3 * o / 4} A ${e / 4} ${o / 4} 0 0 1 ${i + 3 * e / 4} ${t + o} L ${i + e / 4} ${t + o} A ${e / 4} ${o / 4} 0 0 1 ${i} ${t + 3 * o / 4} L ${i} ${t + o / 4} A ${e / 4} ${o / 4} 0 0 1 ${i + e / 4} ${t} Z`, no = (i, t, e, o) => `M ${i} ${t} L ${i + 3 * e / 4} ${t} L ${i + 3 * e / 4} ${t + o / 4} L ${i + 3 * e / 4} ${t} L ${i + e} ${t + o / 4} L ${i + 3 * e / 4} ${t + o / 4} L ${i + e} ${t + o / 4} L ${i + e} ${t + o} L ${i} ${t + o} Z`;
277
277
  var P = /* @__PURE__ */ ((i) => (i.AllScroll = "all-scroll", i.Auto = "auto", i.Crosshair = "crosshair", i.EWResize = "ew-resize", i.Grab = "grab", i.Grabbing = "grabbing", i.Move = "move", i.NoDrop = "no-drop", i.NSResize = "ns-resize", i.NotAllowed = "not-allowed", i.ZoomIn = "zoom-in", i.ZoomOut = "zoom-out", i))(P || {});
278
- const io = (i) => Math.max(...i.split(`
279
- `).map((t) => t.length)), oo = (i) => {
278
+ const ro = (i) => Math.max(...i.split(`
279
+ `).map((t) => t.length)), ao = (i) => {
280
280
  var t;
281
281
  return ((t = i.match(/\n/g)) == null ? void 0 : t.length) || 0;
282
282
  }, et = [];
283
283
  for (let i = 0; i < 256; ++i)
284
284
  et.push((i + 256).toString(16).slice(1));
285
- function so(i, t = 0) {
285
+ function lo(i, t = 0) {
286
286
  return (et[i[t + 0]] + et[i[t + 1]] + et[i[t + 2]] + et[i[t + 3]] + "-" + et[i[t + 4]] + et[i[t + 5]] + "-" + et[i[t + 6]] + et[i[t + 7]] + "-" + et[i[t + 8]] + et[i[t + 9]] + "-" + et[i[t + 10]] + et[i[t + 11]] + et[i[t + 12]] + et[i[t + 13]] + et[i[t + 14]] + et[i[t + 15]]).toLowerCase();
287
287
  }
288
288
  let de;
289
- const no = new Uint8Array(16);
290
- function ro() {
289
+ const co = new Uint8Array(16);
290
+ function ho() {
291
291
  if (!de) {
292
292
  if (typeof crypto > "u" || !crypto.getRandomValues)
293
293
  throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");
294
294
  de = crypto.getRandomValues.bind(crypto);
295
295
  }
296
- return de(no);
296
+ return de(co);
297
297
  }
298
- const ao = typeof crypto < "u" && crypto.randomUUID && crypto.randomUUID.bind(crypto), li = { randomUUID: ao };
299
- function ci(i, t, e) {
298
+ const go = typeof crypto < "u" && crypto.randomUUID && crypto.randomUUID.bind(crypto), gi = { randomUUID: go };
299
+ function ui(i, t, e) {
300
300
  var a;
301
- if (li.randomUUID && !i)
302
- return li.randomUUID();
301
+ if (gi.randomUUID && !i)
302
+ return gi.randomUUID();
303
303
  i = i || {};
304
- const o = i.random ?? ((a = i.rng) == null ? void 0 : a.call(i)) ?? ro();
304
+ const o = i.random ?? ((a = i.rng) == null ? void 0 : a.call(i)) ?? ho();
305
305
  if (o.length < 16)
306
306
  throw new Error("Random bytes length must be >= 16");
307
- return o[6] = o[6] & 15 | 64, o[8] = o[8] & 63 | 128, so(o);
307
+ return o[6] = o[6] & 15 | 64, o[8] = o[8] & 63 | 128, lo(o);
308
308
  }
309
309
  const at = (i) => {
310
310
  const { selected: t, highlighted: e, ...o } = i, a = o, l = {
@@ -510,7 +510,7 @@ class bt extends ie {
510
510
  yield e;
511
511
  }
512
512
  }
513
- class lo {
513
+ class uo {
514
514
  constructor(t, e, o, a, l, s, n) {
515
515
  this.name = t, this.label = e, this.type = o, this.defaultValue = a, this.basic = l, this.editable = s, this.rootAttribute = n, this.options = void 0, this.properties = void 0;
516
516
  }
@@ -535,11 +535,11 @@ class oe {
535
535
  function xt(i, t) {
536
536
  return !t || i[0] > t[0] ? !0 : i[0] === t[0] ? i[1] >= t[1] : !1;
537
537
  }
538
- const di = (i) => i == null || i === "" || i instanceof Array && i.length === 0 || i instanceof Object && Object.keys(i).length === 0, Et = (i, t) => i === t || JSON.stringify(i) === JSON.stringify(t), Ci = (i, t, e) => {
538
+ const mi = (i) => i == null || i === "" || i instanceof Array && i.length === 0 || i instanceof Object && Object.keys(i).length === 0, Et = (i, t) => i === t || JSON.stringify(i) === JSON.stringify(t), xi = (i, t, e) => {
539
539
  const o = {}, a = {};
540
540
  for (const l in e.propertySet.propertyMap)
541
541
  if (e.propertySet.propertyMap[l].type === _.Object) {
542
- const s = Ci(
542
+ const s = xi(
543
543
  i[l],
544
544
  t[l],
545
545
  e.getSubValueSet(l)
@@ -548,7 +548,7 @@ const di = (i) => i == null || i === "" || i instanceof Array && i.length === 0
548
548
  } else
549
549
  Et(i[l], t[l]) || (o[l] = i[l], a[l] = t[l]);
550
550
  return [o, a];
551
- }, co = (i) => i != null && i.constructor === Object;
551
+ }, mo = (i) => i != null && i.constructor === Object;
552
552
  class It {
553
553
  constructor(t, e) {
554
554
  this.displayedProperties = [], this.hiddenProperties = [], this.values = {}, this.valueSets = {}, this.ownTimestamps = {}, this.propertySet = t, this.rootElement = e, this.resetValues();
@@ -657,7 +657,7 @@ class It {
657
657
  */
658
658
  hasValue(t) {
659
659
  const e = this.getValue(t);
660
- return !di(e);
660
+ return !mi(e);
661
661
  }
662
662
  /**
663
663
  * Checks if the value under the key is not empty or the default value.
@@ -667,7 +667,7 @@ class It {
667
667
  */
668
668
  hasSetValue(t) {
669
669
  const e = this.getValue(t), o = this.propertySet.getProperty(t);
670
- return o && o.type === _.Object ? this.getSubValueSet(t).hasAnySetValue() : !di(e) && !Et(e, o == null ? void 0 : o.defaultValue);
670
+ return o && o.type === _.Object ? this.getSubValueSet(t).hasAnySetValue() : !mi(e) && !Et(e, o == null ? void 0 : o.defaultValue);
671
671
  }
672
672
  /**
673
673
  * Checks if any of the values in the set are not empty or the default value.
@@ -801,7 +801,7 @@ const st = {
801
801
  lookType: "connection-look",
802
802
  color: "#000000",
803
803
  thickness: 1,
804
- shape: ki.Straight,
804
+ shape: Ii.Straight,
805
805
  style: Se.Solid,
806
806
  selected: {
807
807
  color: "#AA00AA"
@@ -816,7 +816,7 @@ const st = {
816
816
  endTypes: [],
817
817
  properties: []
818
818
  };
819
- class Si {
819
+ class Li {
820
820
  constructor(t) {
821
821
  const e = {
822
822
  ...st,
@@ -1060,7 +1060,7 @@ class ut extends Mt {
1060
1060
  return this.start ? this.end ? Math.min(this.start.getPriority(), this.end.getPriority()) : this.start.getPriority() : this.end ? this.end.getPriority() : Ot;
1061
1061
  }
1062
1062
  }
1063
- class ho extends bt {
1063
+ class fo extends bt {
1064
1064
  /**
1065
1065
  * Instance a set of connections for the given model. This method is used internally.
1066
1066
  * @private
@@ -1079,7 +1079,7 @@ class ho extends bt {
1079
1079
  */
1080
1080
  new(t, e, o, a) {
1081
1081
  let l;
1082
- if (t instanceof Si)
1082
+ if (t instanceof Li)
1083
1083
  l = t;
1084
1084
  else {
1085
1085
  const n = this.types.get(t);
@@ -1180,7 +1180,7 @@ class vt extends Mt {
1180
1180
  return ((t = this.rootElement) == null ? void 0 : t.getPriority()) || Ot;
1181
1181
  }
1182
1182
  }
1183
- class go extends bt {
1183
+ class po extends bt {
1184
1184
  /**
1185
1185
  * Instance a set of fields for the given model. This method is used internally.
1186
1186
  * @private
@@ -1219,22 +1219,22 @@ class go extends bt {
1219
1219
  e && (((o = e.rootElement) == null ? void 0 : o.label) !== void 0 && e.rootElement.label === e && (e.rootElement.label = void 0), super.remove(t), e.updateInView());
1220
1220
  }
1221
1221
  }
1222
- const nt = (i) => (i == null ? void 0 : i.margin) === null || (i == null ? void 0 : i.margin) === void 0 ? F.margin : typeof i.margin == "number" ? i.margin : i.margin.length === 0 ? F.margin : i.margin.length === 1 || i.margin.length === 2 ? i.margin[0] : (i.margin.length === 3, i.margin[2]), tt = (i) => (i == null ? void 0 : i.margin) === null || (i == null ? void 0 : i.margin) === void 0 ? F.margin : typeof i.margin == "number" ? i.margin : i.margin.length === 0 ? F.margin : i.margin.length === 1 ? i.margin[0] : i.margin.length === 2 || i.margin.length === 3 ? i.margin[1] : i.margin[3], ct = (i) => (i == null ? void 0 : i.margin) === null || (i == null ? void 0 : i.margin) === void 0 ? F.margin : typeof i.margin == "number" ? i.margin : i.margin.length === 0 ? F.margin : i.margin.length === 1 ? i.margin[0] : (i.margin.length === 2 || i.margin.length === 3, i.margin[1]), Z = (i) => (i == null ? void 0 : i.margin) === null || (i == null ? void 0 : i.margin) === void 0 ? F.margin : typeof i.margin == "number" ? i.margin : i.margin.length === 0 ? F.margin : (i.margin.length === 1 || i.margin.length === 2 || i.margin.length === 3, i.margin[0]), Gt = (i) => (i == null ? void 0 : i.padding) === null || (i == null ? void 0 : i.padding) === void 0 ? F.padding : typeof i.padding == "number" ? i.padding : i.padding.length === 0 ? F.padding : i.padding.length === 1 || i.padding.length === 2 ? i.padding[0] : (i.padding.length === 3, i.padding[2]), Bt = (i) => (i == null ? void 0 : i.padding) === null || (i == null ? void 0 : i.padding) === void 0 ? F.padding : typeof i.padding == "number" ? i.padding : i.padding.length === 0 ? F.padding : i.padding.length === 1 ? i.padding[0] : i.padding.length === 2 || i.padding.length === 3 ? i.padding[1] : i.padding[3], Ut = (i) => (i == null ? void 0 : i.padding) === null || (i == null ? void 0 : i.padding) === void 0 ? F.padding : typeof i.padding == "number" ? i.padding : i.padding.length === 0 ? F.padding : i.padding.length === 1 ? i.padding[0] : (i.padding.length === 2 || i.padding.length === 3, i.padding[1]), Yt = (i) => (i == null ? void 0 : i.padding) === null || (i == null ? void 0 : i.padding) === void 0 ? F.padding : typeof i.padding == "number" ? i.padding : i.padding.length === 0 ? F.padding : (i.padding.length === 1 || i.padding.length === 2 || i.padding.length === 3, i.padding[0]), hi = 1, gi = 1, uo = 1, mo = 1;
1223
- class fo {
1222
+ const nt = (i) => (i == null ? void 0 : i.margin) === null || (i == null ? void 0 : i.margin) === void 0 ? F.margin : typeof i.margin == "number" ? i.margin : i.margin.length === 0 ? F.margin : i.margin.length === 1 || i.margin.length === 2 ? i.margin[0] : (i.margin.length === 3, i.margin[2]), tt = (i) => (i == null ? void 0 : i.margin) === null || (i == null ? void 0 : i.margin) === void 0 ? F.margin : typeof i.margin == "number" ? i.margin : i.margin.length === 0 ? F.margin : i.margin.length === 1 ? i.margin[0] : i.margin.length === 2 || i.margin.length === 3 ? i.margin[1] : i.margin[3], ct = (i) => (i == null ? void 0 : i.margin) === null || (i == null ? void 0 : i.margin) === void 0 ? F.margin : typeof i.margin == "number" ? i.margin : i.margin.length === 0 ? F.margin : i.margin.length === 1 ? i.margin[0] : (i.margin.length === 2 || i.margin.length === 3, i.margin[1]), Z = (i) => (i == null ? void 0 : i.margin) === null || (i == null ? void 0 : i.margin) === void 0 ? F.margin : typeof i.margin == "number" ? i.margin : i.margin.length === 0 ? F.margin : (i.margin.length === 1 || i.margin.length === 2 || i.margin.length === 3, i.margin[0]), Gt = (i) => (i == null ? void 0 : i.padding) === null || (i == null ? void 0 : i.padding) === void 0 ? F.padding : typeof i.padding == "number" ? i.padding : i.padding.length === 0 ? F.padding : i.padding.length === 1 || i.padding.length === 2 ? i.padding[0] : (i.padding.length === 3, i.padding[2]), Bt = (i) => (i == null ? void 0 : i.padding) === null || (i == null ? void 0 : i.padding) === void 0 ? F.padding : typeof i.padding == "number" ? i.padding : i.padding.length === 0 ? F.padding : i.padding.length === 1 ? i.padding[0] : i.padding.length === 2 || i.padding.length === 3 ? i.padding[1] : i.padding[3], Ut = (i) => (i == null ? void 0 : i.padding) === null || (i == null ? void 0 : i.padding) === void 0 ? F.padding : typeof i.padding == "number" ? i.padding : i.padding.length === 0 ? F.padding : i.padding.length === 1 ? i.padding[0] : (i.padding.length === 2 || i.padding.length === 3, i.padding[1]), Yt = (i) => (i == null ? void 0 : i.padding) === null || (i == null ? void 0 : i.padding) === void 0 ? F.padding : typeof i.padding == "number" ? i.padding : i.padding.length === 0 ? F.padding : (i.padding.length === 1 || i.padding.length === 2 || i.padding.length === 3, i.padding[0]), fi = 1, pi = 1, vo = 1, yo = 1;
1223
+ class bo {
1224
1224
  constructor(t) {
1225
1225
  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 = [];
1226
1226
  for (const e of t.sections) {
1227
1227
  const o = [];
1228
1228
  this.sections.push(o);
1229
1229
  for (const a of e)
1230
- o.push(new po(a));
1230
+ o.push(new ko(a));
1231
1231
  }
1232
1232
  }
1233
1233
  }
1234
- class po {
1234
+ class ko {
1235
1235
  constructor(t) {
1236
1236
  this.label = t.label || null, this.ports = t.ports || [], this.priority = t.priority || Ot, this.resizableX = t.resizableX, this.resizableY = t.resizableY;
1237
- const e = at(t.look || Ii);
1237
+ const e = at(t.look || Ei);
1238
1238
  this.defaultLook = e.defaultLook, this.selectedLook = e.selectedLook, this.highlightedLook = e.highlightedLook, this.selectedAndHighlightedLook = e.selectedAndHighlightedLook;
1239
1239
  }
1240
1240
  }
@@ -1310,11 +1310,11 @@ class X extends Mt {
1310
1310
  }
1311
1311
  getMinWidth() {
1312
1312
  var t, e, o, a;
1313
- return ((a = (o = (e = (t = this.node) == null ? void 0 : t.type) == null ? void 0 : e.sectionGrid) == null ? void 0 : o.minWidths) == null ? void 0 : a[this.indexXInNode]) || uo;
1313
+ return ((a = (o = (e = (t = this.node) == null ? void 0 : t.type) == null ? void 0 : e.sectionGrid) == null ? void 0 : o.minWidths) == null ? void 0 : a[this.indexXInNode]) || vo;
1314
1314
  }
1315
1315
  getMinHeight() {
1316
1316
  var t, e, o, a;
1317
- return ((a = (o = (e = (t = this.node) == null ? void 0 : t.type) == null ? void 0 : e.sectionGrid) == null ? void 0 : o.minHeights) == null ? void 0 : a[this.indexYInNode]) || mo;
1317
+ return ((a = (o = (e = (t = this.node) == null ? void 0 : t.type) == null ? void 0 : e.sectionGrid) == null ? void 0 : o.minHeights) == null ? void 0 : a[this.indexYInNode]) || yo;
1318
1318
  }
1319
1319
  getPriority() {
1320
1320
  var t, e, o, a, l, s;
@@ -1491,7 +1491,7 @@ class X extends Mt {
1491
1491
  ((n = this.model.canvas) == null ? void 0 : n.autoTightenConnections) !== !1 && this.getConnections().forEach((r) => r.tighten()), this.updateInView();
1492
1492
  }
1493
1493
  }
1494
- class vo extends bt {
1494
+ class wo extends bt {
1495
1495
  /**
1496
1496
  * Instance a set of sections for the given model. This method is used internally.
1497
1497
  * @private
@@ -1616,7 +1616,7 @@ class vo extends bt {
1616
1616
  }
1617
1617
  }
1618
1618
  }
1619
- const Ii = {
1619
+ const Ei = {
1620
1620
  lookType: "shaped-look",
1621
1621
  shape: _t.Rectangle,
1622
1622
  fillColor: "#FFFFFF",
@@ -1642,20 +1642,20 @@ const Ii = {
1642
1642
  ports: [],
1643
1643
  decorators: [],
1644
1644
  sectionGrid: null,
1645
- look: Ii,
1645
+ look: Ei,
1646
1646
  isUnique: !1,
1647
1647
  canBeParentless: !0,
1648
1648
  childrenTypes: [],
1649
1649
  priority: Ot,
1650
1650
  properties: []
1651
1651
  };
1652
- class Ai {
1652
+ class Ti {
1653
1653
  constructor(t) {
1654
1654
  const e = {
1655
1655
  ...yt,
1656
1656
  ...t
1657
1657
  };
1658
- 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 = bo(e), this.leftPadding = ko(e), this.rightPadding = wo(e), this.topPadding = Co(e), this.label = e.label, this.ports = e.ports, this.decorators = e.decorators, this.sectionGrid = e.sectionGrid ? new fo(e.sectionGrid) : null;
1658
+ 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 = So(e), this.leftPadding = Io(e), this.rightPadding = Ao(e), this.topPadding = xo(e), this.label = e.label, this.ports = e.ports, this.decorators = e.decorators, this.sectionGrid = e.sectionGrid ? new bo(e.sectionGrid) : null;
1659
1659
  const o = at(e.look);
1660
1660
  this.defaultLook = o.defaultLook, this.selectedLook = o.selectedLook, this.highlightedLook = o.highlightedLook, this.selectedAndHighlightedLook = o.selectedAndHighlightedLook, this.isUnique = e.isUnique, this.canBeParentless = e.canBeParentless, this.childrenTypes = e.childrenTypes, this.priority = e.priority, this.propertySet = new oe((t == null ? void 0 : t.properties) || []);
1661
1661
  }
@@ -2210,7 +2210,7 @@ class O extends Mt {
2210
2210
  this.stretch(b.Bottom, e + o);
2211
2211
  }
2212
2212
  }
2213
- class yo extends bt {
2213
+ class Co extends bt {
2214
2214
  /**
2215
2215
  * Instance a set of nodes for the given model. This method is used internally.
2216
2216
  * @private
@@ -2229,7 +2229,7 @@ class yo extends bt {
2229
2229
  new(t, e, o) {
2230
2230
  var s, n, r, c, d, h, u;
2231
2231
  let a;
2232
- if (t instanceof Ai)
2232
+ if (t instanceof Ti)
2233
2233
  a = t;
2234
2234
  else {
2235
2235
  const p = this.types.get(t);
@@ -2248,11 +2248,11 @@ class yo extends bt {
2248
2248
  g,
2249
2249
  f,
2250
2250
  [m, p],
2251
- ((s = a.sectionGrid.defaultWidths) == null ? void 0 : s[g]) || hi,
2252
- ((n = a.sectionGrid.defaultHeights) == null ? void 0 : n[f]) || gi,
2251
+ ((s = a.sectionGrid.defaultWidths) == null ? void 0 : s[g]) || fi,
2252
+ ((n = a.sectionGrid.defaultHeights) == null ? void 0 : n[f]) || pi,
2253
2253
  `${l.id}_${f}_${g}`
2254
- ), m += (((r = a.sectionGrid.defaultWidths) == null ? void 0 : r[g]) || hi) + (a.sectionGrid.margin || 0);
2255
- p += (((c = a.sectionGrid.defaultHeights) == null ? void 0 : c[f]) || gi) + (a.sectionGrid.margin || 0);
2254
+ ), m += (((r = a.sectionGrid.defaultWidths) == null ? void 0 : r[g]) || fi) + (a.sectionGrid.margin || 0);
2255
+ p += (((c = a.sectionGrid.defaultHeights) == null ? void 0 : c[f]) || pi) + (a.sectionGrid.margin || 0);
2256
2256
  }
2257
2257
  }
2258
2258
  if (a.ports.length > 0)
@@ -2390,12 +2390,12 @@ class yo extends bt {
2390
2390
  return o;
2391
2391
  }
2392
2392
  }
2393
- const xi = (i) => {
2393
+ const $i = (i) => {
2394
2394
  for (let t = 0; t < i.length; ++t)
2395
2395
  for (let e = 0; e < i.length; ++e)
2396
2396
  e !== t && i[e].isAncestorOf(i[t]) && (i.splice(e, 1), --e, t > e && --t);
2397
2397
  return i;
2398
- }, bo = (i) => (i == null ? void 0 : i.padding) === null || (i == null ? void 0 : i.padding) === void 0 ? yt.padding : typeof i.padding == "number" ? i.padding : i.padding.length === 0 ? yt.padding : i.padding.length === 1 || i.padding.length === 2 ? i.padding[0] : (i.padding.length === 3, i.padding[2]), ko = (i) => (i == null ? void 0 : i.padding) === null || (i == null ? void 0 : i.padding) === void 0 ? yt.padding : typeof i.padding == "number" ? i.padding : i.padding.length === 0 ? yt.padding : i.padding.length === 1 ? i.padding[0] : i.padding.length === 2 || i.padding.length === 3 ? i.padding[1] : i.padding[3], wo = (i) => (i == null ? void 0 : i.padding) === null || (i == null ? void 0 : i.padding) === void 0 ? yt.padding : typeof i.padding == "number" ? i.padding : i.padding.length === 0 ? yt.padding : i.padding.length === 1 ? i.padding[0] : (i.padding.length === 2 || i.padding.length === 3, i.padding[1]), Co = (i) => (i == null ? void 0 : i.padding) === null || (i == null ? void 0 : i.padding) === void 0 ? yt.padding : typeof i.padding == "number" ? i.padding : i.padding.length === 0 ? yt.padding : (i.padding.length === 1 || i.padding.length === 2 || i.padding.length === 3, i.padding[0]), Li = {
2398
+ }, So = (i) => (i == null ? void 0 : i.padding) === null || (i == null ? void 0 : i.padding) === void 0 ? yt.padding : typeof i.padding == "number" ? i.padding : i.padding.length === 0 ? yt.padding : i.padding.length === 1 || i.padding.length === 2 ? i.padding[0] : (i.padding.length === 3, i.padding[2]), Io = (i) => (i == null ? void 0 : i.padding) === null || (i == null ? void 0 : i.padding) === void 0 ? yt.padding : typeof i.padding == "number" ? i.padding : i.padding.length === 0 ? yt.padding : i.padding.length === 1 ? i.padding[0] : i.padding.length === 2 || i.padding.length === 3 ? i.padding[1] : i.padding[3], Ao = (i) => (i == null ? void 0 : i.padding) === null || (i == null ? void 0 : i.padding) === void 0 ? yt.padding : typeof i.padding == "number" ? i.padding : i.padding.length === 0 ? yt.padding : i.padding.length === 1 ? i.padding[0] : (i.padding.length === 2 || i.padding.length === 3, i.padding[1]), xo = (i) => (i == null ? void 0 : i.padding) === null || (i == null ? void 0 : i.padding) === void 0 ? yt.padding : typeof i.padding == "number" ? i.padding : i.padding.length === 0 ? yt.padding : (i.padding.length === 1 || i.padding.length === 2 || i.padding.length === 3, i.padding[0]), Mi = {
2399
2399
  lookType: "shaped-look",
2400
2400
  shape: _t.Ellipse,
2401
2401
  fillColor: "transparent",
@@ -2407,18 +2407,18 @@ const xi = (i) => {
2407
2407
  highlighted: {
2408
2408
  fillColor: "rgba(0, 255, 255, 0.5)"
2409
2409
  }
2410
- }, Kt = at(Li), Ei = {
2410
+ }, Kt = at(Mi), Ni = {
2411
2411
  name: "",
2412
2412
  label: null,
2413
2413
  allowsOutgoing: !0,
2414
2414
  allowsIncoming: !0,
2415
2415
  width: 24,
2416
- look: Li
2416
+ look: Mi
2417
2417
  };
2418
- class So {
2418
+ class Lo {
2419
2419
  constructor(t) {
2420
2420
  const e = {
2421
- ...Ei,
2421
+ ...Ni,
2422
2422
  ...t
2423
2423
  };
2424
2424
  this.id = e.id, this.name = e.name, this.label = e.label, this.allowsOutgoing = e.allowsOutgoing, this.allowsIncoming = e.allowsIncoming, this.width = e.width;
@@ -2519,7 +2519,7 @@ class At extends Mt {
2519
2519
  */
2520
2520
  get width() {
2521
2521
  var t;
2522
- return ((t = this.type) == null ? void 0 : t.width) || Ei.width;
2522
+ return ((t = this.type) == null ? void 0 : t.width) || Ni.width;
2523
2523
  }
2524
2524
  /**
2525
2525
  * Current height of this port. Same as the width.
@@ -2595,10 +2595,10 @@ class At extends Mt {
2595
2595
  ]), this.updateInView();
2596
2596
  }
2597
2597
  distanceTo(t) {
2598
- return bi(this.coords, t);
2598
+ return Si(this.coords, t);
2599
2599
  }
2600
2600
  }
2601
- class Io extends bt {
2601
+ class Eo extends bt {
2602
2602
  /**
2603
2603
  * Instance a set of ports for the given model. This method is used internally.
2604
2604
  * @private
@@ -2635,7 +2635,7 @@ class Io extends bt {
2635
2635
  }
2636
2636
  }
2637
2637
  }
2638
- class Ti {
2638
+ class Pi {
2639
2639
  import(t, e) {
2640
2640
  t.clear(), e.id && (t.id = e.id), t.name = e.name, t.description = e.description, t.type = e.type, t.createdAt = new Date(e.createdAt), t.updatedAt = new Date(e.updatedAt);
2641
2641
  for (const o of e.nodes || [])
@@ -2743,7 +2743,7 @@ class Ti {
2743
2743
  A,
2744
2744
  v,
2745
2745
  y.coords,
2746
- y.connectionPoint,
2746
+ y.connectionPoint || y.coords,
2747
2747
  y.direction,
2748
2748
  y.id
2749
2749
  );
@@ -2813,7 +2813,7 @@ class Ti {
2813
2813
  v,
2814
2814
  f,
2815
2815
  g.coords,
2816
- g.connectionPoint,
2816
+ g.connectionPoint || g.coords,
2817
2817
  g.direction,
2818
2818
  g.id
2819
2819
  );
@@ -3213,7 +3213,7 @@ class re {
3213
3213
  this.canvas = t, this.nodes = e, this.connections = o;
3214
3214
  }
3215
3215
  do() {
3216
- const t = new Ti();
3216
+ const t = new Pi();
3217
3217
  this.canvas.userSelection.clear();
3218
3218
  for (const e of this.nodes) {
3219
3219
  const o = t.importNode(this.canvas.model, e);
@@ -3242,9 +3242,9 @@ class re {
3242
3242
  );
3243
3243
  }
3244
3244
  }
3245
- class Ao {
3245
+ class To {
3246
3246
  constructor(t) {
3247
- this.isInRoom = !1, this.canvas = t, this.replicaId = ci();
3247
+ this.isInRoom = !1, this.canvas = t, this.replicaId = ui();
3248
3248
  }
3249
3249
  /**
3250
3250
  * Returns a fresh timestamp, suitable for use by new CollabActions.
@@ -3256,7 +3256,7 @@ class Ao {
3256
3256
  * Returns a fresh unique ID, suitable for use by new CollabActions.
3257
3257
  */
3258
3258
  freshId() {
3259
- return "id" + ci();
3259
+ return "id" + ui();
3260
3260
  }
3261
3261
  /**
3262
3262
  * Performs the action - immediately locally, and eventually for remote collaborators.
@@ -3345,7 +3345,7 @@ class Ao {
3345
3345
  }
3346
3346
  }
3347
3347
  }
3348
- class xo {
3348
+ class $o {
3349
3349
  constructor(t, e) {
3350
3350
  this.canvas = t, this.maximum = e, this.history = [], this.index = 0;
3351
3351
  }
@@ -3398,7 +3398,7 @@ class xo {
3398
3398
  }
3399
3399
  }
3400
3400
  var S = /* @__PURE__ */ ((i) => (i.AddConnection = "add-connection", i.AddNode = "add-node", i.AddSectionAction = "add-section", i.ApplyLayout = "apply-layout", i.Clipboard = "clipboard", i.ContextMenu = "context-menu", i.EditField = "edit-field", i.MoveNode = "move-node", i.Paste = "paste", i.Remove = "remove", i.StretchNode = "stretch-node", i.StretchSection = "stretch-section", i.UpdateValues = "update-values", i.Zoom = "zoom", i))(S || {});
3401
- class Lo {
3401
+ class Mo {
3402
3402
  constructor(t, e, o, a, l, s, n, r, c) {
3403
3403
  this.canvas = t, this.type = e, this.coords = o, this.parentId = a, this.ancestorId = l, this.fromAncestorGeometry = s, this.toAncestorGeometry = n, this.label = r, this.values = c, this.id = this.canvas.collabEngine.freshId();
3404
3404
  }
@@ -3556,7 +3556,7 @@ class J {
3556
3556
  return t !== void 0;
3557
3557
  }
3558
3558
  }
3559
- class Eo {
3559
+ class No {
3560
3560
  constructor(t, e, o, a, l, s, n, r, c) {
3561
3561
  this.canvas = t, this.childId = e, this.fromParentId = o, this.toParentId = a, this.fromChildGeometry = l, this.toChildGeometry = s, this.ancestorId = n, this.fromAncestorGeometry = r, this.toAncestorGeometry = c;
3562
3562
  }
@@ -3643,7 +3643,7 @@ class ge {
3643
3643
  return this.canvas.collabEngine.doCollaboratively(e), t === void 0;
3644
3644
  }
3645
3645
  }
3646
- class ui {
3646
+ class vi {
3647
3647
  constructor(t, e, o, a) {
3648
3648
  this.canvas = t, this.fieldId = e, this.from = o, this.to = a;
3649
3649
  }
@@ -3685,7 +3685,7 @@ class ui {
3685
3685
  return t !== void 0;
3686
3686
  }
3687
3687
  }
3688
- class To {
3688
+ class Po {
3689
3689
  constructor(t, e, o, a) {
3690
3690
  this.canvas = t, this.id = e, this.from = o, this.to = a;
3691
3691
  }
@@ -3725,7 +3725,7 @@ class To {
3725
3725
  return !e.rootElement.removed;
3726
3726
  }
3727
3727
  }
3728
- class $o {
3728
+ class zo {
3729
3729
  constructor(t, e, o, a, l, s) {
3730
3730
  this.canvas = t, this.nodeIds = e, this.sectionIds = o, this.portIds = a, this.connectionIds = l, this.fieldIds = s;
3731
3731
  }
@@ -3767,7 +3767,7 @@ class $o {
3767
3767
  return this.do();
3768
3768
  }
3769
3769
  }
3770
- class Mo {
3770
+ class Ro {
3771
3771
  constructor(t, e, o, a) {
3772
3772
  this.canvas = t, this.nodes = e, this.connections = o, this.coords = a;
3773
3773
  }
@@ -3793,7 +3793,10 @@ class Mo {
3793
3793
  d.id.includes(l.id) ? d.id = d.id.replace(l.id, n) : d.id = this.canvas.collabEngine.freshId(), o[h] = d.id, e && (d.coords = [
3794
3794
  d.coords[0] + e[0],
3795
3795
  d.coords[1] + e[1]
3796
- ]);
3796
+ ], d.connectionPoint && (d.connectionPoint = [
3797
+ d.connectionPoint[0] + e[0],
3798
+ d.connectionPoint[1] + e[1]
3799
+ ]));
3797
3800
  }
3798
3801
  }
3799
3802
  if (l.ports)
@@ -3802,7 +3805,10 @@ class Mo {
3802
3805
  r.id.includes(l.id) ? r.id = r.id.replace(l.id, n) : r.id = this.canvas.collabEngine.freshId(), o[c] = r.id, e && (r.coords = [
3803
3806
  r.coords[0] + e[0],
3804
3807
  r.coords[1] + e[1]
3805
- ]);
3808
+ ], r.connectionPoint && (r.connectionPoint = [
3809
+ r.connectionPoint[0] + e[0],
3810
+ r.connectionPoint[1] + e[1]
3811
+ ]));
3806
3812
  }
3807
3813
  }
3808
3814
  for (const l of this.connections) {
@@ -3860,7 +3866,7 @@ class ae {
3860
3866
  this.defaultPrevented = !0;
3861
3867
  }
3862
3868
  }
3863
- var $i = /* @__PURE__ */ ((i) => (i[i.DoubleClick = 0] = "DoubleClick", i[i.SecondaryClick = 1] = "SecondaryClick", i[i.Selection = 2] = "Selection", i[i.Highlight = 3] = "Highlight", i))($i || {});
3869
+ var zi = /* @__PURE__ */ ((i) => (i[i.DoubleClick = 0] = "DoubleClick", i[i.SecondaryClick = 1] = "SecondaryClick", i[i.Selection = 2] = "Selection", i[i.Highlight = 3] = "Highlight", i))(zi || {});
3864
3870
  class wt extends ae {
3865
3871
  /**
3866
3872
  * Create a diagram double click event.
@@ -3918,7 +3924,7 @@ class ot extends ae {
3918
3924
  ), this.target = t;
3919
3925
  }
3920
3926
  }
3921
- class Mi extends Mt {
3927
+ class Ri extends Mt {
3922
3928
  constructor(t, e, o, a, l, s, n, r, c = "floating", d = "floating") {
3923
3929
  if (t.objects.get(r) !== void 0)
3924
3930
  throw new Error(`DiagramDecorator with id "${r}" already exists`);
@@ -3949,7 +3955,7 @@ class Mi extends Mt {
3949
3955
  return this.priority;
3950
3956
  }
3951
3957
  }
3952
- class No extends bt {
3958
+ class Vo extends bt {
3953
3959
  /**
3954
3960
  * Instance a set of decorators for the given model. This method is used internally.
3955
3961
  * @private
@@ -3969,7 +3975,7 @@ class No extends bt {
3969
3975
  * @returns The instanced decorator.
3970
3976
  */
3971
3977
  new(t, e, o, a, l, s, n, r = "floating", c = "floating") {
3972
- const d = new Mi(
3978
+ const d = new Ri(
3973
3979
  this.model,
3974
3980
  t,
3975
3981
  e,
@@ -3988,7 +3994,7 @@ class No extends bt {
3988
3994
  e && ((e.rootElement instanceof O || e.rootElement instanceof X) && K(e.rootElement.decorators, e), super.remove(t), e.updateInView());
3989
3995
  }
3990
3996
  }
3991
- class Po extends Mt {
3997
+ class _o extends Mt {
3992
3998
  constructor(t, e, o, a, l, s, n) {
3993
3999
  if (t.objects.get(n) !== void 0)
3994
4000
  throw new Error(`DiagramObject with id "${n}" already exists`);
@@ -4019,7 +4025,7 @@ class Po extends Mt {
4019
4025
  return this.priority;
4020
4026
  }
4021
4027
  }
4022
- class zo extends bt {
4028
+ class Oo extends bt {
4023
4029
  /**
4024
4030
  * Instance a set of objects for the given model. This method is used internally.
4025
4031
  * @private
@@ -4039,7 +4045,7 @@ class zo extends bt {
4039
4045
  * @returns The instanced object.
4040
4046
  */
4041
4047
  new(t, e, o, a, l, s) {
4042
- const n = new Po(
4048
+ const n = new _o(
4043
4049
  this.model,
4044
4050
  t,
4045
4051
  e,
@@ -4055,9 +4061,9 @@ class zo extends bt {
4055
4061
  e && (super.remove(t), e.updateInView());
4056
4062
  }
4057
4063
  }
4058
- class Ni {
4064
+ class Vi {
4059
4065
  constructor(t, e, o, a, l, s = []) {
4060
- this.nodes = new yo(this), this.sections = new vo(this), this.ports = new Io(this), this.connections = new ho(this), this.fields = new go(this), this.objects = new zo(this), this.decorators = new No(this), this.canvas = t, this.id = e, this.name = o, this.description = a, this.type = l, this.createdAt = /* @__PURE__ */ new Date(), this.updatedAt = /* @__PURE__ */ new Date(), this.logicalClock = 0, this.valueSet = new It(new oe(s), this);
4066
+ this.nodes = new Co(this), this.sections = new wo(this), this.ports = new Eo(this), this.connections = new fo(this), this.fields = new po(this), this.objects = new Oo(this), this.decorators = new Vo(this), this.canvas = t, this.id = e, this.name = o, this.description = a, this.type = l, this.createdAt = /* @__PURE__ */ new Date(), this.updatedAt = /* @__PURE__ */ new Date(), this.logicalClock = 0, this.valueSet = new It(new oe(s), this);
4061
4067
  }
4062
4068
  /**
4063
4069
  * Deletes everything in this diagram.
@@ -4068,7 +4074,7 @@ class Ni {
4068
4074
  (t = this.canvas) == null || t.cancelAllUserActions(), this.id = void 0, this.name = "", this.description = void 0, this.createdAt = /* @__PURE__ */ new Date(), this.updatedAt = /* @__PURE__ */ new Date(), this.logicalClock = 0, this.nodes.clear(), this.sections.clear(), this.ports.clear(), this.connections.clear(), this.fields.clear(), this.objects.clear(), this.decorators.clear(), this.valueSet.resetValues(), (e = this.canvas) == null || e.updateModelInView();
4069
4075
  }
4070
4076
  }
4071
- const St = (i) => !!i.button, ue = (i, t, e, o, a, l, s, n) => Wi(
4077
+ const St = (i) => !!i.button, ue = (i, t, e, o, a, l, s, n) => Ji(
4072
4078
  i,
4073
4079
  [t, e],
4074
4080
  o,
@@ -4156,7 +4162,7 @@ const St = (i) => !!i.button, ue = (i, t, e, o, a, l, s, n) => Wi(
4156
4162
  snap: !1,
4157
4163
  spacing: 10,
4158
4164
  thickness: 0.05
4159
- }, Ro = (i, t, e) => {
4165
+ }, Do = (i, t, e) => {
4160
4166
  const o = t.append("defs");
4161
4167
  if (i.gridSize > 0 && isFinite(i.gridSize)) {
4162
4168
  const a = o.append("pattern").attr("id", e).attr("x", -i.gridSize / 2).attr("y", -i.gridSize / 2).attr("width", i.gridSize).attr("height", i.gridSize).attr("patternUnits", "userSpaceOnUse");
@@ -4176,17 +4182,17 @@ const St = (i) => !!i.button, ue = (i, t, e, o, a, l, s, n) => Wi(
4176
4182
  }
4177
4183
  t.select("rect").attr("fill", `url(#${e})`);
4178
4184
  }
4179
- }, we = 96, Q = 32, Pt = we + Q, Vo = Math.PI / 4, _o = 100, mi = {
4185
+ }, we = 96, Q = 32, Pt = we + Q, Fo = Math.PI / 4, Ho = 100, yi = {
4180
4186
  customButtons: []
4181
4187
  };
4182
- class Oo {
4188
+ class Go {
4183
4189
  /**
4184
4190
  * Constructs a context menu object.
4185
4191
  * @public
4186
4192
  * @param canvas A canvas.
4187
4193
  */
4188
4194
  constructor(t, e) {
4189
- this.canvas = t, this.config = e || mi;
4195
+ this.canvas = t, this.config = e || yi;
4190
4196
  }
4191
4197
  /**
4192
4198
  * Opens the context menu at the location determined by the given mouse event.
@@ -4229,7 +4235,7 @@ class Oo {
4229
4235
  s.userSelection.removeFromModel(), s.cancelAllUserActions();
4230
4236
  }
4231
4237
  });
4232
- for (const s of this.config.customButtons || mi.customButtons)
4238
+ for (const s of this.config.customButtons || yi.customButtons)
4233
4239
  (s.condition === void 0 || s.condition(this.canvas)) && l.push(s);
4234
4240
  l.length === 0 && l.push({
4235
4241
  name: "NONE",
@@ -4237,7 +4243,7 @@ class Oo {
4237
4243
  onPress: void 0
4238
4244
  });
4239
4245
  for (let s = 0; s < l.length; ++s) {
4240
- const n = l[s], r = n.onPress, c = (s + 0.5 - l.length / 2) * Vo, d = a.append("xhtml:div").attr(
4246
+ const n = l[s], r = n.onPress, c = (s + 0.5 - l.length / 2) * Fo, d = a.append("xhtml:div").attr(
4241
4247
  "class",
4242
4248
  `daga-context-menu-button ${n.onPress !== void 0 ? " daga-clickable" : ""}`
4243
4249
  ).attr("tabindex", 0).style("position", "absolute").style("box-sizing", "border-box").style("width", `${2 * Q}px`).style("height", `${2 * Q}px`).style("border-radius", `${Q}px`).style("pointer-events", "auto").on(L.Click, (h) => {
@@ -4245,7 +4251,7 @@ class Oo {
4245
4251
  }).on(L.KeyDown, (h) => {
4246
4252
  r && h.key === it.Enter && (h.preventDefault(), r(this.canvas));
4247
4253
  });
4248
- n.imageClass !== void 0 ? d.append("xhtml:div").style("position", "absolute").style("left", `${0.75 * Q}px`).style("top", `${0.5 * Q}px`).style("width", `${0.5 * Q}px`).style("height", `${0.5 * Q}px`).style("background-size", "contain").style("background-repeat", "no-repeat").attr("class", n.imageClass) : n.image !== void 0 && d.append("xhtml:img").style("position", "absolute").style("left", `${0.75 * Q}px`).style("top", `${0.5 * Q}px`).style("width", `${0.5 * Q}px`).style("height", `${0.5 * Q}px`).attr("src", n.image), d.append("xhtml:span").style("position", "absolute").style("left", `${0.2 * Q}px`).style("top", `${1.1 * Q}px`).style("text-align", "center").style("width", `${1.6 * Q}px`).style("height", `${0.35 * Q}px`).style("margin", "0").style("font-size", `${0.35 * Q}px`).style("font-weight", "700").style("user-select", "none").text(n.name), d.transition().ease(N.easeLinear).duration(_o).tween("progress", () => (h) => {
4254
+ n.imageClass !== void 0 ? d.append("xhtml:div").style("position", "absolute").style("left", `${0.75 * Q}px`).style("top", `${0.5 * Q}px`).style("width", `${0.5 * Q}px`).style("height", `${0.5 * Q}px`).style("background-size", "contain").style("background-repeat", "no-repeat").attr("class", n.imageClass) : n.image !== void 0 && d.append("xhtml:img").style("position", "absolute").style("left", `${0.75 * Q}px`).style("top", `${0.5 * Q}px`).style("width", `${0.5 * Q}px`).style("height", `${0.5 * Q}px`).attr("src", n.image), d.append("xhtml:span").style("position", "absolute").style("left", `${0.2 * Q}px`).style("top", `${1.1 * Q}px`).style("text-align", "center").style("width", `${1.6 * Q}px`).style("height", `${0.35 * Q}px`).style("margin", "0").style("font-size", `${0.35 * Q}px`).style("font-weight", "700").style("user-select", "none").text(n.name), d.transition().ease(N.easeLinear).duration(Ho).tween("progress", () => (h) => {
4249
4255
  const u = c * h;
4250
4256
  return d.style(
4251
4257
  "left",
@@ -4266,7 +4272,7 @@ class Oo {
4266
4272
  (t = this.contextMenuContainer) == null || t.remove(), this.contextMenuContainer = void 0;
4267
4273
  }
4268
4274
  }
4269
- class Do extends bt {
4275
+ class Bo extends bt {
4270
4276
  /**
4271
4277
  * Constructs a user highlight object.
4272
4278
  * @public
@@ -4288,7 +4294,7 @@ class Do extends bt {
4288
4294
  * @param element
4289
4295
  */
4290
4296
  focusOn(t) {
4291
- this.clear(), this.focus = t, (t instanceof vt || t instanceof Mi) && t.rootElement ? this.focusOn(t.rootElement) : this.add(t);
4297
+ this.clear(), this.focus = t, (t instanceof vt || t instanceof Ri) && t.rootElement ? this.focusOn(t.rootElement) : this.add(t);
4292
4298
  }
4293
4299
  add(t) {
4294
4300
  if (super.add(t), t instanceof O) {
@@ -4320,13 +4326,13 @@ class Do extends bt {
4320
4326
  this.focus = void 0;
4321
4327
  }
4322
4328
  }
4323
- const Fo = 1;
4324
- class Pi {
4329
+ const Uo = 1;
4330
+ class _i {
4325
4331
  export(t, e = !1) {
4326
4332
  const o = {
4327
4333
  name: t.name,
4328
4334
  type: t.type,
4329
- typeVersion: Fo,
4335
+ typeVersion: Uo,
4330
4336
  createdAt: t.createdAt,
4331
4337
  updatedAt: t.updatedAt,
4332
4338
  nodes: [],
@@ -4361,7 +4367,7 @@ class Pi {
4361
4367
  id: f.id,
4362
4368
  type: (s = f.type) == null ? void 0 : s.id,
4363
4369
  coords: Nt(f.coords),
4364
- connectionPoint: Nt(f.connectionPoint),
4370
+ connectionPoint: Nt(f.connectionPoint || f.coords),
4365
4371
  direction: f.direction,
4366
4372
  label: ((n = f.label) == null ? void 0 : n.text) || "",
4367
4373
  ...e ? {
@@ -4398,7 +4404,7 @@ class Pi {
4398
4404
  id: u.id,
4399
4405
  type: (c = u.type) == null ? void 0 : c.id,
4400
4406
  coords: Nt(u.coords),
4401
- connectionPoint: Nt(u.connectionPoint),
4407
+ connectionPoint: Nt(u.connectionPoint || u.coords),
4402
4408
  direction: u.direction,
4403
4409
  label: ((d = u.label) == null ? void 0 : d.text) || "",
4404
4410
  ...e ? {
@@ -4466,15 +4472,15 @@ class Pi {
4466
4472
  } : {};
4467
4473
  }
4468
4474
  }
4469
- const Ho = "Diagram properties";
4470
- class Go extends bt {
4475
+ const Yo = "Diagram properties";
4476
+ class Xo extends bt {
4471
4477
  /**
4472
4478
  * Constructs a user selection object.
4473
4479
  * @public
4474
4480
  * @param canvas A canvas.
4475
4481
  */
4476
4482
  constructor(t) {
4477
- super(), this.canvas = t, this.canvas.propertyEditorChanges$.pipe(Gi(2e3)).subscribe(() => {
4483
+ super(), this.canvas = t, this.canvas.propertyEditorChanges$.pipe(Xi(2e3)).subscribe(() => {
4478
4484
  this.makeUpdateValuesAction();
4479
4485
  });
4480
4486
  }
@@ -4525,7 +4531,7 @@ class Go extends bt {
4525
4531
  const t = [], e = [], o = [], a = [], l = [];
4526
4532
  for (const n of this.all())
4527
4533
  n instanceof O ? t.push(n.id) : n instanceof X ? e.push(n.id) : n instanceof At ? o.push(n.id) : n instanceof ut ? a.push(n.id) : n instanceof vt && l.push(n.id);
4528
- const s = new $o(
4534
+ const s = new zo(
4529
4535
  this.canvas,
4530
4536
  t,
4531
4537
  e,
@@ -4541,7 +4547,7 @@ class Go extends bt {
4541
4547
  * @public
4542
4548
  */
4543
4549
  copyToClipboard() {
4544
- const t = { type: "daga-user-selection", nodes: [], connections: [] }, e = new Pi();
4550
+ const t = { type: "daga-user-selection", nodes: [], connections: [] }, e = new _i();
4545
4551
  for (const o of this.all())
4546
4552
  o instanceof O && t.nodes.push(e.exportNode(o, !1)), o instanceof ut && t.connections.push(
4547
4553
  e.exportConnection(o, !1)
@@ -4565,7 +4571,7 @@ class Go extends bt {
4565
4571
  const o = JSON.parse(e);
4566
4572
  if (o.type !== "daga-user-selection")
4567
4573
  return;
4568
- const a = new Mo(
4574
+ const a = new Ro(
4569
4575
  this.canvas,
4570
4576
  o.nodes,
4571
4577
  o.connections,
@@ -4594,13 +4600,13 @@ class Go extends bt {
4594
4600
  const a = t == null ? void 0 : t.valueSet;
4595
4601
  a ? (this.propertyEditorSelection = t, e && (this.propertyEditorValues = structuredClone(
4596
4602
  a.getValues()
4597
- )), o && (t instanceof O || t instanceof ut ? (t instanceof O ? t.name ? o.title = `${t.type.name}: ${t.name}` : o.title = t.type.name : t instanceof ut && (o.title = t.type.name), o.valueSet = void 0, o.valueSet = a) : (o.title = Ho, o.valueSet = void 0, o.valueSet = a))) : (this.propertyEditorSelection = void 0, this.propertyEditorValues = void 0, o && (o.title = "", o.valueSet = void 0));
4603
+ )), o && (t instanceof O || t instanceof ut ? (t instanceof O ? t.name ? o.title = `${t.type.name}: ${t.name}` : o.title = t.type.name : t instanceof ut && (o.title = t.type.name), o.valueSet = void 0, o.valueSet = a) : (o.title = Yo, o.valueSet = void 0, o.valueSet = a))) : (this.propertyEditorSelection = void 0, this.propertyEditorValues = void 0, o && (o.title = "", o.valueSet = void 0));
4598
4604
  }
4599
4605
  makeUpdateValuesAction() {
4600
4606
  var n, r, c;
4601
4607
  if (this.propertyEditorSelection === void 0 || this.propertyEditorValues === void 0)
4602
4608
  return;
4603
- const t = this.propertyEditorSelection instanceof Ni ? void 0 : this.propertyEditorSelection.id;
4609
+ const t = this.propertyEditorSelection instanceof Vi ? void 0 : this.propertyEditorSelection.id;
4604
4610
  if (Et(
4605
4611
  this.propertyEditorValues,
4606
4612
  (n = this.propertyEditorSelection) == null ? void 0 : n.valueSet.getValues()
@@ -4608,11 +4614,11 @@ class Go extends bt {
4608
4614
  return;
4609
4615
  const e = this.propertyEditorValues, o = structuredClone(
4610
4616
  (r = this.propertyEditorSelection) == null ? void 0 : r.valueSet.getValues()
4611
- ), [a, l] = Ci(
4617
+ ), [a, l] = xi(
4612
4618
  e,
4613
4619
  o,
4614
4620
  (c = this.propertyEditorSelection) == null ? void 0 : c.valueSet
4615
- ), s = new To(
4621
+ ), s = new Po(
4616
4622
  this.canvas,
4617
4623
  t,
4618
4624
  a,
@@ -4621,10 +4627,10 @@ class Go extends bt {
4621
4627
  s.do(), this.canvas.actionStack.add(s), this.propertyEditorValues = o;
4622
4628
  }
4623
4629
  }
4624
- const Bo = (i) => i * Math.PI / 180, fi = (i, t, e) => {
4625
- const o = Bo(e), a = Math.sin(o), l = Math.cos(o), s = (Math.abs(i * l) - Math.abs(t * a)) / (l * l - a * a), n = (Math.abs(i * a) - Math.abs(t * l)) / (a * a - l * l);
4630
+ const jo = (i) => i * Math.PI / 180, bi = (i, t, e) => {
4631
+ const o = jo(e), a = Math.sin(o), l = Math.cos(o), s = (Math.abs(i * l) - Math.abs(t * a)) / (l * l - a * a), n = (Math.abs(i * a) - Math.abs(t * l)) / (a * a - l * l);
4626
4632
  return [s, n];
4627
- }, Uo = 12, G = 6, Yo = 25, pe = "diagram-connection-unfinished", ee = class ee {
4633
+ }, Wo = 12, G = 6, Zo = 25, pe = "diagram-connection-unfinished", ee = class ee {
4628
4634
  /**
4629
4635
  * Constructs a canvas object.
4630
4636
  * @public
@@ -4633,21 +4639,21 @@ const Bo = (i) => i * Math.PI / 180, fi = (i, t, e) => {
4633
4639
  */
4634
4640
  constructor(t, e) {
4635
4641
  var o, a, l, s, n, r, c, d, h, u, p, f, m, g, v, w, y, A, I, E, $, C, R, T, z, j, D, q, H;
4636
- if (this.backgroundPatternId = `daga-background-pattern-id-${ee.canvasCount++}`, this.zoomTransform = N.zoomIdentity, this.draggingFrom = [0, 0], this.dragging = !1, this.secondaryButton = !1, this.validatorChange$ = new Zt(), this.diagramChange$ = new Zt(), this.diagramEvent$ = new Zt(), this.propertyEditorChanges$ = new Zt(), this.parentComponent = t, this.model = new Ni(
4642
+ if (this.backgroundPatternId = `daga-background-pattern-id-${ee.canvasCount++}`, this.zoomTransform = N.zoomIdentity, this.draggingFrom = [0, 0], this.dragging = !1, this.secondaryButton = !1, this.validatorChange$ = new Zt(), this.diagramChange$ = new Zt(), this.diagramEvent$ = new Zt(), this.propertyEditorChanges$ = new Zt(), this.parentComponent = t, this.model = new Vi(
4637
4643
  this,
4638
4644
  void 0,
4639
4645
  e.name || "unnamed",
4640
4646
  "",
4641
4647
  e.type || "",
4642
4648
  e.properties || []
4643
- ), this.userSelection = new Go(this), this.userHighlight = new Do(
4649
+ ), this.userSelection = new Xo(this), this.userHighlight = new Bo(
4644
4650
  this,
4645
4651
  ((o = e.canvas) == null ? void 0 : o.highlightSections) !== !1
4646
- ), this.contextMenu = new Oo(this, (a = e.canvas) == null ? void 0 : a.contextMenu), this.backgroundColor = ((l = e.canvas) == null ? void 0 : l.backgroundColor) || "#FFFFFF", this.gridStyle = ((n = (s = e.canvas) == null ? void 0 : s.grid) == null ? void 0 : n.style) ?? Ht.style, this.gridSize = ((c = (r = e.canvas) == null ? void 0 : r.grid) == null ? void 0 : c.enabled) === !1 || ((d = e.canvas) == null ? void 0 : d.grid) === void 0 ? 0 : Math.abs(((u = (h = e.canvas) == null ? void 0 : h.grid) == null ? void 0 : u.spacing) || Ht.spacing), this.gridThickness = Math.abs(
4652
+ ), this.contextMenu = new Go(this, (a = e.canvas) == null ? void 0 : a.contextMenu), this.backgroundColor = ((l = e.canvas) == null ? void 0 : l.backgroundColor) || "#FFFFFF", this.gridStyle = ((n = (s = e.canvas) == null ? void 0 : s.grid) == null ? void 0 : n.style) ?? Ht.style, this.gridSize = ((c = (r = e.canvas) == null ? void 0 : r.grid) == null ? void 0 : c.enabled) === !1 || ((d = e.canvas) == null ? void 0 : d.grid) === void 0 ? 0 : Math.abs(((u = (h = e.canvas) == null ? void 0 : h.grid) == null ? void 0 : u.spacing) || Ht.spacing), this.gridThickness = Math.abs(
4647
4653
  ((f = (p = e.canvas) == null ? void 0 : p.grid) == null ? void 0 : f.thickness) || Ht.thickness
4648
- ), this.gridColor = ((g = (m = e.canvas) == null ? void 0 : m.grid) == null ? void 0 : g.color) || Ht.color, this.snapToGrid = ((w = (v = e.canvas) == null ? void 0 : v.grid) == null ? void 0 : w.enabled) === !1 || ((y = e.canvas) == null ? void 0 : y.grid) === void 0 ? !1 : ((I = (A = e.canvas) == null ? void 0 : A.grid) == null ? void 0 : I.snap) || Ht.snap, this.zoomFactor = ((E = e.canvas) == null ? void 0 : E.zoomFactor) || 2, this.panRate = (($ = e.canvas) == null ? void 0 : $.panRate) || 100, this.inferConnectionType = ((C = e.connectionSettings) == null ? void 0 : C.inferConnectionType) || !1, this.autoTightenConnections = ((R = e.connectionSettings) == null ? void 0 : R.autoTighten) !== !1, this.allowConnectionLoops = ((T = e.connectionSettings) == null ? void 0 : T.allowLoops) || !1, this.allowSharingPorts = ((z = e.connectionSettings) == null ? void 0 : z.sharePorts) !== !1, this.allowSharingBothPorts = ((j = e.connectionSettings) == null ? void 0 : j.shareBothPorts) || !1, this.portHighlightRadius = ((D = e.connectionSettings) == null ? void 0 : D.portHighlightRadius) || 100, this.multipleSelectionOn = !1, this.priorityThresholds = ((q = e.canvas) == null ? void 0 : q.priorityThresholds) || [], this.priorityThreshold = this.priorityThresholds ? this.priorityThresholds[0] : void 0, this.layoutFormat = e.layoutFormat, this.userActions = e.userActions || {}, this.validators = [], this.actionStack = new xo(this, Yo), this.collabEngine = new Ao(this), e.nodeTypes)
4654
+ ), this.gridColor = ((g = (m = e.canvas) == null ? void 0 : m.grid) == null ? void 0 : g.color) || Ht.color, this.snapToGrid = ((w = (v = e.canvas) == null ? void 0 : v.grid) == null ? void 0 : w.enabled) === !1 || ((y = e.canvas) == null ? void 0 : y.grid) === void 0 ? !1 : ((I = (A = e.canvas) == null ? void 0 : A.grid) == null ? void 0 : I.snap) || Ht.snap, this.zoomFactor = ((E = e.canvas) == null ? void 0 : E.zoomFactor) || 2, this.panRate = (($ = e.canvas) == null ? void 0 : $.panRate) || 100, this.inferConnectionType = ((C = e.connectionSettings) == null ? void 0 : C.inferConnectionType) || !1, this.autoTightenConnections = ((R = e.connectionSettings) == null ? void 0 : R.autoTighten) !== !1, this.allowConnectionLoops = ((T = e.connectionSettings) == null ? void 0 : T.allowLoops) || !1, this.allowSharingPorts = ((z = e.connectionSettings) == null ? void 0 : z.sharePorts) !== !1, this.allowSharingBothPorts = ((j = e.connectionSettings) == null ? void 0 : j.shareBothPorts) || !1, this.portHighlightRadius = ((D = e.connectionSettings) == null ? void 0 : D.portHighlightRadius) || 100, this.multipleSelectionOn = !1, this.priorityThresholds = ((q = e.canvas) == null ? void 0 : q.priorityThresholds) || [], this.priorityThreshold = this.priorityThresholds ? this.priorityThresholds[0] : void 0, this.layoutFormat = e.layoutFormat, this.userActions = e.userActions || {}, this.validators = [], this.actionStack = new $o(this, Zo), this.collabEngine = new To(this), e.nodeTypes)
4649
4655
  for (const Y of e.nodeTypes) {
4650
- const W = new Ai({
4656
+ const W = new Ti({
4651
4657
  ...e.nodeTypeDefaults,
4652
4658
  ...Y
4653
4659
  });
@@ -4655,7 +4661,7 @@ const Bo = (i) => i * Math.PI / 180, fi = (i, t, e) => {
4655
4661
  }
4656
4662
  if (e.portTypes)
4657
4663
  for (const Y of e.portTypes) {
4658
- const W = new So({
4664
+ const W = new Lo({
4659
4665
  ...e.portTypeDefaults,
4660
4666
  ...Y
4661
4667
  });
@@ -4663,7 +4669,7 @@ const Bo = (i) => i * Math.PI / 180, fi = (i, t, e) => {
4663
4669
  }
4664
4670
  if (e.connectionTypes) {
4665
4671
  for (const Y of e.connectionTypes) {
4666
- const W = new Si({
4672
+ const W = new Li({
4667
4673
  ...e.connectionTypeDefaults,
4668
4674
  ...Y
4669
4675
  });
@@ -4793,7 +4799,10 @@ const Bo = (i) => i * Math.PI / 180, fi = (i, t, e) => {
4793
4799
  }).on(M.End, (a) => {
4794
4800
  this.finishMultipleSelection(a);
4795
4801
  })
4796
- ), Ro(this, o, this.backgroundPatternId), o.append("g").attr("class", "daga-canvas-elements");
4802
+ ), Do(this, o, this.backgroundPatternId), o.append("g").attr("class", "daga-canvas-elements");
4803
+ }
4804
+ getZoomLevel() {
4805
+ return this.zoomTransform.k;
4797
4806
  }
4798
4807
  zoomBy(t) {
4799
4808
  isNaN(t) || this.zoomBehavior.scaleBy(this.selectCanvasView(), t);
@@ -4801,6 +4810,9 @@ const Bo = (i) => i * Math.PI / 180, fi = (i, t, e) => {
4801
4810
  zoomTo(t) {
4802
4811
  isNaN(t) || this.zoomBehavior.scaleTo(this.selectCanvasView(), t);
4803
4812
  }
4813
+ getViewCoordinates() {
4814
+ return [this.zoomTransform.x, this.zoomTransform.y];
4815
+ }
4804
4816
  translateBy(t, e) {
4805
4817
  !isNaN(t) && !isNaN(e) && this.zoomBehavior.translateBy(this.selectCanvasView(), t, e);
4806
4818
  }
@@ -5477,7 +5489,7 @@ const Bo = (i) => i * Math.PI / 180, fi = (i, t, e) => {
5477
5489
  }
5478
5490
  ).attr("stroke", "transparent").attr("pointer-events", "stroke").attr(
5479
5491
  "stroke-width",
5480
- (n) => `${(n.look.thickness || st.look.thickness) + Uo}px`
5492
+ (n) => `${(n.look.thickness || st.look.thickness) + Wo}px`
5481
5493
  ).attr(
5482
5494
  "stroke-dasharray",
5483
5495
  (n) => be(
@@ -5531,7 +5543,7 @@ const Bo = (i) => i * Math.PI / 180, fi = (i, t, e) => {
5531
5543
  }
5532
5544
  }).on(L.DoubleClick, (s, n) => {
5533
5545
  const r = new wt(s, n);
5534
- this.diagramEvent$.next(r), !r.defaultPrevented && this.canUserPerformAction(S.EditField) && n.editable && !n.removed && (this.currentAction = new ui(this, n.id, n.text, ""), this.createInputField(
5546
+ this.diagramEvent$.next(r), !r.defaultPrevented && this.canUserPerformAction(S.EditField) && n.editable && !n.removed && (this.currentAction = new vi(this, n.id, n.text, ""), this.createInputField(
5535
5547
  n.text,
5536
5548
  n.coords,
5537
5549
  n.width,
@@ -5542,7 +5554,7 @@ const Bo = (i) => i * Math.PI / 180, fi = (i, t, e) => {
5542
5554
  (c) => {
5543
5555
  },
5544
5556
  (c) => {
5545
- n.text = c, this.currentAction instanceof ui && (this.currentAction.to = c, this.currentAction.do(), this.actionStack.add(this.currentAction), this.currentAction = void 0);
5557
+ n.text = c, this.currentAction instanceof vi && (this.currentAction.to = c, this.currentAction.do(), this.actionStack.add(this.currentAction), this.currentAction = void 0);
5546
5558
  }
5547
5559
  ));
5548
5560
  }).call(
@@ -5577,10 +5589,10 @@ const Bo = (i) => i * Math.PI / 180, fi = (i, t, e) => {
5577
5589
  (s) => s.verticalAlign === Qt.Center ? "center" : s.verticalAlign === Qt.Bottom ? "end" : "start"
5578
5590
  ).select("p").style(
5579
5591
  "max-width",
5580
- (s) => s.fit ? "default" : `${fi(s.width, s.height, s.orientation)[0]}px`
5592
+ (s) => s.fit ? "default" : `${bi(s.width, s.height, s.orientation)[0]}px`
5581
5593
  ).style(
5582
5594
  "max-height",
5583
- (s) => s.fit ? "default" : `${fi(s.width, s.height, s.orientation)[1]}px`
5595
+ (s) => s.fit ? "default" : `${bi(s.width, s.height, s.orientation)[1]}px`
5584
5596
  ).style("overflow", (s) => s.fit ? "default" : "clip").style("text-overflow", (s) => s.fit ? "default" : "ellipsis").style(
5585
5597
  "text-align",
5586
5598
  (s) => s.horizontalAlign === zt.Center ? "center" : s.horizontalAlign === zt.Right ? "end" : "start"
@@ -6040,7 +6052,7 @@ const Bo = (i) => i * Math.PI / 180, fi = (i, t, e) => {
6040
6052
  }
6041
6053
  }).on(L.Input, () => {
6042
6054
  const m = h.property("value");
6043
- h.attr("cols", io(m) + 1), h.attr("rows", oo(m) + 1), h.style("width", ""), h.style("height", ""), u = h.property("scrollWidth") + 1, p = h.property("scrollHeight") + 1;
6055
+ h.attr("cols", ro(m) + 1), h.attr("rows", ao(m) + 1), h.style("width", ""), h.style("height", ""), u = h.property("scrollWidth") + 1, p = h.property("scrollHeight") + 1;
6044
6056
  const g = Math.max(u, o), v = Math.max(p, a);
6045
6057
  d == null || d.attr("width", `${g}px`), h.style("width", `${g}px`), d == null || d.attr("height", `${v}px`), h.style("height", `${v}px`), r && r(m);
6046
6058
  }).on(L.Click, (m) => {
@@ -6132,11 +6144,11 @@ const Bo = (i) => i * Math.PI / 180, fi = (i, t, e) => {
6132
6144
  e.move(s);
6133
6145
  const r = this.model.nodes.getAtCoordinates(t.x, t.y).filter((h) => h.id !== e.id && !h.isDescendantOf(e)).filter(
6134
6146
  (h) => h.type.childrenTypes.includes(e.type.id)
6135
- ), c = xi(
6147
+ ), c = $i(
6136
6148
  r
6137
6149
  ), d = c[c.length - 1];
6138
6150
  if (d !== e.parent && (e.type.canBeParentless || d !== void 0)) {
6139
- const h = d == null ? void 0 : d.getLastAncestor(), u = this.currentAction.from, p = new Eo(
6151
+ const h = d == null ? void 0 : d.getLastAncestor(), u = this.currentAction.from, p = new No(
6140
6152
  this,
6141
6153
  e.id,
6142
6154
  (o = e.parent) == null ? void 0 : o.id,
@@ -6184,7 +6196,7 @@ const Bo = (i) => i * Math.PI / 180, fi = (i, t, e) => {
6184
6196
  const e = this.getPointerLocationRelativeToCanvas(t);
6185
6197
  (o = this.multipleSelectionContainer) == null || o.remove(), this.multipleSelectionContainer = void 0, this.userSelection.clear();
6186
6198
  for (const a of this.model.nodes)
6187
- Xi(
6199
+ Ki(
6188
6200
  [
6189
6201
  a.coords,
6190
6202
  [a.coords[0] + a.width, a.coords[1] + a.height]
@@ -6198,7 +6210,7 @@ const Bo = (i) => i * Math.PI / 180, fi = (i, t, e) => {
6198
6210
  };
6199
6211
  ee.canvasCount = 0;
6200
6212
  let Ce = ee;
6201
- class zi {
6213
+ class Oi {
6202
6214
  constructor() {
6203
6215
  this.grid = [[void 0]], this.offsetX = 0, this.offsetY = 0;
6204
6216
  }
@@ -6310,7 +6322,7 @@ class zi {
6310
6322
  }
6311
6323
  }
6312
6324
  }
6313
- class Xo {
6325
+ class Ko {
6314
6326
  constructor(t) {
6315
6327
  this.gapSize = t;
6316
6328
  }
@@ -6318,9 +6330,9 @@ class Xo {
6318
6330
  var n;
6319
6331
  if (t.nodes.length === 0)
6320
6332
  return t;
6321
- const e = new zi(), o = t.nodes.filter((r) => !r.parent);
6333
+ const e = new Oi(), o = t.nodes.filter((r) => !r.parent);
6322
6334
  for (; o.length > 0; )
6323
- Ri(
6335
+ Di(
6324
6336
  o[0],
6325
6337
  e,
6326
6338
  [0, 0],
@@ -6338,18 +6350,18 @@ class Xo {
6338
6350
  return t;
6339
6351
  }
6340
6352
  }
6341
- const Ri = (i, t, e, o) => {
6353
+ const Di = (i, t, e, o) => {
6342
6354
  const a = t.getClosestEmptyCoordinate(e);
6343
6355
  t.set(a, i), K(o, i);
6344
6356
  for (const l of i.getAdjacentNodes())
6345
- o.includes(l) && Ri(
6357
+ o.includes(l) && Di(
6346
6358
  l,
6347
6359
  t,
6348
6360
  a,
6349
6361
  o
6350
6362
  );
6351
6363
  };
6352
- class jo {
6364
+ class qo {
6353
6365
  constructor(t) {
6354
6366
  this.gapSize = t;
6355
6367
  }
@@ -6357,7 +6369,7 @@ class jo {
6357
6369
  var d;
6358
6370
  if (t.nodes.length === 0)
6359
6371
  return t;
6360
- const e = new zi(), o = t.nodes.filter((h) => !h.parent), a = {}, l = o[0];
6372
+ const e = new Oi(), o = t.nodes.filter((h) => !h.parent), a = {}, l = o[0];
6361
6373
  let s = [l];
6362
6374
  for (a[l.id] = [0, 0]; o.length > 0; ) {
6363
6375
  const h = [];
@@ -6426,7 +6438,7 @@ class le {
6426
6438
  return t;
6427
6439
  }
6428
6440
  }
6429
- class Wo {
6441
+ class Jo {
6430
6442
  constructor(t) {
6431
6443
  this.gapSize = t;
6432
6444
  }
@@ -6454,7 +6466,7 @@ class Wo {
6454
6466
  ], v = [
6455
6467
  m.coords[0] + m.width / 2,
6456
6468
  m.coords[1] + m.height / 2
6457
- ], w = bi(
6469
+ ], w = Si(
6458
6470
  p.coords,
6459
6471
  m.coords
6460
6472
  ), y = [m.coords[0], m.coords[1]];
@@ -6477,7 +6489,7 @@ class Wo {
6477
6489
  return t;
6478
6490
  }
6479
6491
  }
6480
- class Zo {
6492
+ class Qo {
6481
6493
  constructor(t) {
6482
6494
  this.gapSize = t;
6483
6495
  }
@@ -6493,7 +6505,7 @@ class Zo {
6493
6505
  return t;
6494
6506
  }
6495
6507
  }
6496
- class Ko {
6508
+ class ts {
6497
6509
  constructor(t) {
6498
6510
  this.gapSize = t;
6499
6511
  }
@@ -6561,7 +6573,7 @@ class Ko {
6561
6573
  return t;
6562
6574
  }
6563
6575
  }
6564
- class qo {
6576
+ class es {
6565
6577
  constructor(t) {
6566
6578
  this.gapSize = t;
6567
6579
  }
@@ -6581,11 +6593,11 @@ class qo {
6581
6593
  const h = l[0];
6582
6594
  l.splice(0, 1);
6583
6595
  const u = new xe(void 0, h);
6584
- Vi(u, l), s.push(u);
6596
+ Fi(u, l), s.push(u);
6585
6597
  }
6586
6598
  const n = [];
6587
6599
  for (const h of s)
6588
- n.push([h]), _i(h, n, n.length);
6600
+ n.push([h]), Hi(h, n, n.length);
6589
6601
  const r = Math.max(...t.nodes.map((h) => h.height));
6590
6602
  let c = 0;
6591
6603
  for (let h = 0; h < n.length; ++h) {
@@ -6604,21 +6616,21 @@ class qo {
6604
6616
  return t;
6605
6617
  }
6606
6618
  }
6607
- const Vi = (i, t) => {
6619
+ const Fi = (i, t) => {
6608
6620
  for (const e of i.node.getAdjacentNodes().sort((o, a) => a.getPriority() - o.getPriority())) {
6609
6621
  const o = t.indexOf(e);
6610
6622
  if (o >= 0) {
6611
6623
  t.splice(o, 1);
6612
6624
  const a = i.addBranch(e);
6613
- Vi(a, t);
6625
+ Fi(a, t);
6614
6626
  }
6615
6627
  }
6616
- }, _i = (i, t, e) => {
6628
+ }, Hi = (i, t, e) => {
6617
6629
  if (i.branches.length > 0) {
6618
6630
  for (; e >= t.length; )
6619
6631
  t.push([]);
6620
6632
  for (const o of i.branches)
6621
- t[e].push(o), _i(o, t, e + 1);
6633
+ t[e].push(o), Hi(o, t, e + 1);
6622
6634
  }
6623
6635
  };
6624
6636
  class xe {
@@ -6640,7 +6652,7 @@ class xe {
6640
6652
  }
6641
6653
  }
6642
6654
  }
6643
- class Jo {
6655
+ class is {
6644
6656
  constructor(t) {
6645
6657
  this.gapSize = t;
6646
6658
  }
@@ -6656,17 +6668,17 @@ class Jo {
6656
6668
  return t;
6657
6669
  }
6658
6670
  }
6659
- const pi = {
6660
- adjacency: new Xo(),
6671
+ const ki = {
6672
+ adjacency: new Ko(),
6661
6673
  breadth: new le(),
6662
- "breadth-adjacency": new jo(),
6663
- force: new Wo(),
6664
- horizontal: new Zo(),
6665
- priority: new Ko(),
6666
- tree: new qo(),
6667
- vertical: new Jo()
6668
- }, Qo = yi({}), $t = yi({});
6669
- class ts {
6674
+ "breadth-adjacency": new qo(),
6675
+ force: new Jo(),
6676
+ horizontal: new Qo(),
6677
+ priority: new ts(),
6678
+ tree: new es(),
6679
+ vertical: new is()
6680
+ }, os = Ci({}), $t = Ci({});
6681
+ class ss {
6670
6682
  constructor(t, e) {
6671
6683
  this.onTitleChange = t, this.onValueSetChange = e;
6672
6684
  }
@@ -6730,10 +6742,10 @@ const Le = ({
6730
6742
  children: /* @__PURE__ */ k("div", { className: u() })
6731
6743
  }
6732
6744
  ) });
6733
- }, es = () => {
6745
+ }, ns = () => {
6734
6746
  const i = Wt($t), t = dt(null), [e, o] = U([]);
6735
- Bi(i.validatorChange$, i.diagramChange$).pipe(
6736
- Ui(() => a())
6747
+ ji(i.validatorChange$, i.diagramChange$).pipe(
6748
+ Wi(() => a())
6737
6749
  ).subscribe();
6738
6750
  const a = () => {
6739
6751
  o([]);
@@ -6788,7 +6800,7 @@ const Le = ({
6788
6800
  n
6789
6801
  )) }) })
6790
6802
  ] }) });
6791
- }, is = 200, vi = (i) => (i || "").toLowerCase().normalize("NFD").replace(/[\u0300-\u036f]/g, ""), Oi = ({
6803
+ }, rs = 200, wi = (i) => (i || "").toLowerCase().normalize("NFD").replace(/[\u0300-\u036f]/g, ""), Gi = ({
6792
6804
  disabled: i,
6793
6805
  options: t,
6794
6806
  value: e,
@@ -6827,10 +6839,10 @@ const Le = ({
6827
6839
  }
6828
6840
  }, y = () => {
6829
6841
  if (!i) {
6830
- const T = vi(l.trim());
6842
+ const T = wi(l.trim());
6831
6843
  c([]), h([]), p([]), m([]);
6832
6844
  for (const z of t) {
6833
- const D = vi(z.label).indexOf(T);
6845
+ const D = wi(z.label).indexOf(T);
6834
6846
  if (D >= 0) {
6835
6847
  const q = z.label.substring(0, D), H = z.label.substring(
6836
6848
  D,
@@ -6863,7 +6875,7 @@ const Le = ({
6863
6875
  }, E = () => {
6864
6876
  setTimeout(() => {
6865
6877
  A();
6866
- }, is);
6878
+ }, rs);
6867
6879
  }, $ = (T) => {
6868
6880
  var j;
6869
6881
  const z = (j = a.current) == null ? void 0 : j.querySelectorAll("li")[T];
@@ -6913,10 +6925,10 @@ const Le = ({
6913
6925
  ]
6914
6926
  }
6915
6927
  );
6916
- }, os = (i, t) => {
6928
+ }, as = (i, t) => {
6917
6929
  var e;
6918
6930
  return ((e = i.find((o) => o.key === t)) == null ? void 0 : e.label) || `${t}`;
6919
- }, ss = ({
6931
+ }, ls = ({
6920
6932
  disabled: i,
6921
6933
  allowRepeats: t,
6922
6934
  options: e,
@@ -6925,7 +6937,7 @@ const Le = ({
6925
6937
  }) => {
6926
6938
  const [l, s] = U(), [n, r] = U([]), [c, d] = U([]);
6927
6939
  Tt(() => {
6928
- const g = o.length === 0, v = o.map((w) => os(e, w));
6940
+ const g = o.length === 0, v = o.map((w) => as(e, w));
6929
6941
  r(v), g && a(o), m();
6930
6942
  }, [o, e]);
6931
6943
  const h = (g) => {
@@ -6961,7 +6973,7 @@ const Le = ({
6961
6973
  ] }, v)),
6962
6974
  !i && /* @__PURE__ */ V("div", { className: "daga-value-item-input", children: [
6963
6975
  /* @__PURE__ */ k("div", { className: "daga-input daga-relatively-positioned", children: /* @__PURE__ */ k(
6964
- Oi,
6976
+ Gi,
6965
6977
  {
6966
6978
  disabled: i,
6967
6979
  options: t ? e || [] : c || [],
@@ -6972,7 +6984,7 @@ const Le = ({
6972
6984
  /* @__PURE__ */ k("button", { className: "daga-property-button", onClick: p, children: /* @__PURE__ */ k("div", { className: "daga-icon daga-add-icon" }) })
6973
6985
  ] })
6974
6986
  ] });
6975
- }, ns = ({
6987
+ }, cs = ({
6976
6988
  disabled: i,
6977
6989
  allowRepeats: t,
6978
6990
  value: e,
@@ -6998,7 +7010,7 @@ const Le = ({
6998
7010
  }, h = (u) => {
6999
7011
  u.key === "Enter" && c();
7000
7012
  };
7001
- return /* @__PURE__ */ V(Hi, { children: [
7013
+ return /* @__PURE__ */ V(Yi, { children: [
7002
7014
  e.map((u, p) => /* @__PURE__ */ V("div", { className: "daga-value-item-element", children: [
7003
7015
  /* @__PURE__ */ k(
7004
7016
  "input",
@@ -7035,7 +7047,7 @@ const Le = ({
7035
7047
  /* @__PURE__ */ k("button", { className: "daga-property-button", onClick: c, children: /* @__PURE__ */ k("div", { className: "daga-icon daga-add-icon" }) })
7036
7048
  ] })
7037
7049
  ] });
7038
- }, rs = ({
7050
+ }, ds = ({
7039
7051
  disabled: i,
7040
7052
  value: t,
7041
7053
  onChange: e
@@ -7150,7 +7162,7 @@ const Le = ({
7150
7162
  /* @__PURE__ */ k("button", { className: "daga-property-button", onClick: u, children: /* @__PURE__ */ k("div", { className: "daga-icon daga-add-icon" }) })
7151
7163
  ] })
7152
7164
  ] });
7153
- }, Di = ({
7165
+ }, Bi = ({
7154
7166
  valueSet: i,
7155
7167
  onValueChange: t,
7156
7168
  depth: e
@@ -7291,7 +7303,7 @@ const Le = ({
7291
7303
  )
7292
7304
  ] }),
7293
7305
  c.type === _.Option && /* @__PURE__ */ k("div", { className: "daga-relatively-positioned", children: /* @__PURE__ */ k(
7294
- Oi,
7306
+ Gi,
7295
7307
  {
7296
7308
  disabled: c.editable === !1 || !a,
7297
7309
  options: c.options || [],
@@ -7300,7 +7312,7 @@ const Le = ({
7300
7312
  }
7301
7313
  ) }),
7302
7314
  (c.type === _.OptionList || c.type === _.OptionSet) && /* @__PURE__ */ k(
7303
- ss,
7315
+ ls,
7304
7316
  {
7305
7317
  disabled: c.editable === !1 || !a,
7306
7318
  allowRepeats: c.type === _.OptionList,
@@ -7310,7 +7322,7 @@ const Le = ({
7310
7322
  }
7311
7323
  ),
7312
7324
  (c.type === _.TextList || c.type === _.TextSet) && /* @__PURE__ */ k(
7313
- ns,
7325
+ cs,
7314
7326
  {
7315
7327
  disabled: c.editable === !1 || !a,
7316
7328
  allowRepeats: c.type === _.TextList,
@@ -7319,7 +7331,7 @@ const Le = ({
7319
7331
  }
7320
7332
  ),
7321
7333
  c.type === _.TextMap && /* @__PURE__ */ k(
7322
- rs,
7334
+ ds,
7323
7335
  {
7324
7336
  disabled: c.editable === !1 || !a,
7325
7337
  value: i == null ? void 0 : i.getValue(c.name),
@@ -7327,7 +7339,7 @@ const Le = ({
7327
7339
  }
7328
7340
  ),
7329
7341
  c.type === _.Object && /* @__PURE__ */ k("div", { className: "daga-left-bar", children: /* @__PURE__ */ k(
7330
- Di,
7342
+ Bi,
7331
7343
  {
7332
7344
  valueSet: i.getSubValueSet(c.name),
7333
7345
  onValueChange: t,
@@ -7338,7 +7350,7 @@ const Le = ({
7338
7350
  },
7339
7351
  c.name
7340
7352
  )) });
7341
- }, Fi = ({ valueSet: i, depth: t }) => {
7353
+ }, Ui = ({ valueSet: i, depth: t }) => {
7342
7354
  const e = Wt($t), o = dt(null), a = (r) => "daga-property-name-" + r.replace(/\s/g, ""), l = () => {
7343
7355
  for (const r of (i == null ? void 0 : i.displayedProperties) || []) {
7344
7356
  let c = 0, d = 0, h = 0;
@@ -7405,7 +7417,7 @@ const Le = ({
7405
7417
  if (i === void 0)
7406
7418
  return;
7407
7419
  let c;
7408
- r instanceof lo ? c = r : r instanceof Event ? c = i == null ? void 0 : i.propertySet.getProperty(
7420
+ r instanceof uo ? c = r : r instanceof Event ? c = i == null ? void 0 : i.propertySet.getProperty(
7409
7421
  ((d = r.target) == null ? void 0 : d.value) || ""
7410
7422
  ) : c = i == null ? void 0 : i.propertySet.getProperty(r || ""), c && (i == null || i.hideProperty(c)), l();
7411
7423
  };
@@ -7435,9 +7447,9 @@ const Le = ({
7435
7447
  )
7436
7448
  ] })
7437
7449
  ] }),
7438
- r.type !== _.Object && /* @__PURE__ */ k("div", { className: "daga-property-value", children: as(i == null ? void 0 : i.getValue(r.name)) }),
7450
+ r.type !== _.Object && /* @__PURE__ */ k("div", { className: "daga-property-value", children: hs(i == null ? void 0 : i.getValue(r.name)) }),
7439
7451
  r.type === _.Object && /* @__PURE__ */ k(
7440
- Fi,
7452
+ Ui,
7441
7453
  {
7442
7454
  valueSet: i == null ? void 0 : i.getSubValueSet(r.name),
7443
7455
  depth: t + 1
@@ -7457,71 +7469,71 @@ const Le = ({
7457
7469
  r.name
7458
7470
  ))
7459
7471
  ] });
7460
- }, as = (i) => Array.isArray(i) ? i.join(", ") : co(i) ? Object.entries(i).map((t) => t.map((e) => JSON.stringify(e)).join(": ")).join(", ") : i instanceof Date ? i.toLocaleString() : i == null ? "" : "" + i, ls = ({ location: i, direction: t, width: e, title: o, valueSet: a, onValueChange: l }) => {
7461
- const s = dt(null), [n, r] = U(!1), [c, d] = U(!1), h = () => N.select(s.current);
7472
+ }, hs = (i) => Array.isArray(i) ? i.join(", ") : mo(i) ? Object.entries(i).map((t) => t.map((e) => JSON.stringify(e)).join(": ")).join(", ") : i instanceof Date ? i.toLocaleString() : i == null ? "" : "" + i, gs = ({ location: i, direction: t, width: e, height: o, title: a, valueSet: l, onValueChange: s }) => {
7473
+ const n = dt(null), [r, c] = U(!1), [d, h] = U(!1), u = () => N.select(n.current);
7462
7474
  return Tt(() => {
7463
- if (s.current)
7475
+ if (n.current)
7464
7476
  switch (t) {
7465
7477
  case b.Bottom:
7466
7478
  case b.Top:
7467
- h().style("width", e);
7479
+ u().style("width", e), o && u().select(".daga-panel-content").style("height", o);
7468
7480
  break;
7469
7481
  case b.Left:
7470
7482
  case b.Right:
7471
- h().style("height", e);
7483
+ u().style("height", e), o && u().select(".daga-panel-content").style("width", o);
7472
7484
  break;
7473
7485
  }
7474
7486
  }, [e, t]), /* @__PURE__ */ k("daga-property-editor", { children: /* @__PURE__ */ V(
7475
7487
  "div",
7476
7488
  {
7477
- ref: s,
7489
+ ref: n,
7478
7490
  className: `daga-panel daga-bottom daga-${i} daga-${t}`,
7479
7491
  children: [
7480
7492
  /* @__PURE__ */ k(
7481
7493
  Le,
7482
7494
  {
7483
- disabled: !a || !a.propertySet || !a.propertySet.hasProperties(),
7484
- collapsed: n,
7495
+ disabled: !l || !l.propertySet || !l.propertySet.hasProperties(),
7496
+ collapsed: r,
7485
7497
  direction: t,
7486
- collapsableSelector: s,
7498
+ collapsableSelector: n,
7487
7499
  collapsableAdditionalSelector: ".daga-panel-content",
7488
7500
  rule: "display",
7489
7501
  collapsedValue: "none",
7490
7502
  visibleValue: "block",
7491
- onCollapse: r
7503
+ onCollapse: c
7492
7504
  }
7493
7505
  ),
7494
- a && a.propertySet && a.propertySet.hasProperties() && !n && /* @__PURE__ */ V("div", { className: "daga-panel-content", children: [
7495
- o && /* @__PURE__ */ V("p", { className: "daga-title", children: [
7496
- o,
7506
+ /* @__PURE__ */ k("div", { className: "daga-panel-content", children: l && l.propertySet && l.propertySet.hasProperties() && !r && /* @__PURE__ */ V("div", { children: [
7507
+ a && /* @__PURE__ */ V("p", { className: "daga-title", children: [
7508
+ a,
7497
7509
  /* @__PURE__ */ k(
7498
7510
  "button",
7499
7511
  {
7500
7512
  className: "daga-property-button",
7501
- onClick: () => d(!c),
7513
+ onClick: () => h(!d),
7502
7514
  children: /* @__PURE__ */ k(
7503
7515
  "div",
7504
7516
  {
7505
- className: `daga-icon daga-settings-icon ${c ? "daga-unrotate" : "daga-rotate"}`
7517
+ className: `daga-icon daga-settings-icon ${d ? "daga-unrotate" : "daga-rotate"}`
7506
7518
  }
7507
7519
  )
7508
7520
  }
7509
7521
  )
7510
7522
  ] }),
7511
- !c && /* @__PURE__ */ k(
7512
- Di,
7523
+ !d && /* @__PURE__ */ k(
7524
+ Bi,
7513
7525
  {
7514
- valueSet: a,
7515
- onValueChange: l,
7526
+ valueSet: l,
7527
+ onValueChange: s,
7516
7528
  depth: 0
7517
7529
  }
7518
7530
  ),
7519
- c && /* @__PURE__ */ k(Fi, { valueSet: a, depth: 0 })
7520
- ] })
7531
+ d && /* @__PURE__ */ k(Ui, { valueSet: l, depth: 0 })
7532
+ ] }) })
7521
7533
  ]
7522
7534
  }
7523
7535
  ) });
7524
- }, cs = 6, ds = (i) => {
7536
+ }, us = 6, ms = (i) => {
7525
7537
  const t = Wt($t), [e, o] = U(
7526
7538
  i.currentPalette || i.palettes[0]
7527
7539
  ), [a, l] = U(0), [s, n] = U(
@@ -7606,12 +7618,12 @@ const Le = ({
7606
7618
  D[1]
7607
7619
  ).filter(
7608
7620
  (Lt) => Lt.type.childrenTypes.includes(m.id)
7609
- ), W = xi(
7621
+ ), W = $i(
7610
7622
  Y
7611
7623
  ), lt = W[W.length - 1];
7612
7624
  if (!m.canBeParentless && lt === void 0)
7613
7625
  return;
7614
- const mt = lt == null ? void 0 : lt.getLastAncestor(), Dt = new Lo(
7626
+ const mt = lt == null ? void 0 : lt.getLastAncestor(), Dt = new Mo(
7615
7627
  t,
7616
7628
  m,
7617
7629
  q,
@@ -7700,7 +7712,7 @@ const Le = ({
7700
7712
  )
7701
7713
  ).attr("fill", g.backgroundColor).attr("stroke", "black").attr("stroke-width", "1px"), g.icon !== "" && w.append("image").attr("x", 0).attr("y", 0).attr("width", g.width).attr("height", g.height).attr("href", g.icon), g.label !== "" && w.append("text").attr(
7702
7714
  "transform",
7703
- `translate(${g.width / 2},${g.height / 2 + cs})`
7715
+ `translate(${g.width / 2},${g.height / 2 + us})`
7704
7716
  ).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(g.label);
7705
7717
  };
7706
7718
  return Tt(() => {
@@ -7708,11 +7720,11 @@ const Le = ({
7708
7720
  switch (i.direction) {
7709
7721
  case b.Bottom:
7710
7722
  case b.Top:
7711
- r.current.style.width = i.width;
7723
+ r.current.style.width = i.width, i.height && (r.current.style.height = i.height);
7712
7724
  break;
7713
7725
  case b.Left:
7714
7726
  case b.Right:
7715
- r.current.style.height = i.width;
7727
+ r.current.style.height = i.width, i.height && (r.current.style.width = i.height);
7716
7728
  break;
7717
7729
  }
7718
7730
  }, [e, i.palettes]), /* @__PURE__ */ k("daga-palette", { children: /* @__PURE__ */ V(
@@ -7748,7 +7760,7 @@ const Le = ({
7748
7760
  ]
7749
7761
  }
7750
7762
  ) });
7751
- }, hs = ({
7763
+ }, fs = ({
7752
7764
  location: i,
7753
7765
  direction: t,
7754
7766
  enableAction: e,
@@ -7800,7 +7812,7 @@ const Le = ({
7800
7812
  }, I = () => {
7801
7813
  w.center();
7802
7814
  }, E = () => {
7803
- w.layoutFormat && w.layoutFormat in pi && pi[w.layoutFormat].apply(w.model);
7815
+ w.layoutFormat && w.layoutFormat in ki && ki[w.layoutFormat].apply(w.model);
7804
7816
  }, $ = () => {
7805
7817
  n = !n, N.select(
7806
7818
  g.current
@@ -7826,7 +7838,7 @@ const Le = ({
7826
7838
  m.current
7827
7839
  ).classed("daga-on", !0).classed("daga-off", !1);
7828
7840
  const H = w.diagramEvent$.subscribe((Y) => {
7829
- Y.type === $i.Selection && (N.select(
7841
+ Y.type === zi.Selection && (N.select(
7830
7842
  m.current
7831
7843
  ).classed("daga-on", !1).classed("daga-off", !0), H.unsubscribe());
7832
7844
  });
@@ -7854,15 +7866,15 @@ const Le = ({
7854
7866
  ]
7855
7867
  }
7856
7868
  ) });
7857
- }, fs = ({
7869
+ }, bs = ({
7858
7870
  config: i,
7859
7871
  model: t,
7860
7872
  onCanvasCreated: e,
7861
7873
  onDiagramEvent: o,
7862
7874
  onModelChange: a
7863
7875
  }) => {
7864
- var $, C, R, T, z, j, D, q, H, Y, W, lt, mt, Dt, Lt, Ee, Te, $e, Me, Ne, Pe, ze, Re, Ve, _e, Oe, De, Fe, He, Ge, Be, Ue, Ye, Xe, je, We, Ze, Ke, qe, Je, Qe, ti, ei, ii, oi;
7865
- const l = new Ti(), s = new Pi(), n = dt(null), r = dt(void 0), c = dt(!1), d = [], [h, u] = U(void 0), [p, f] = U(void 0), m = {
7876
+ var $, C, R, T, z, j, D, q, H, Y, W, lt, mt, Dt, Lt, Ee, Te, $e, Me, Ne, Pe, ze, Re, Ve, _e, Oe, De, Fe, He, Ge, Be, Ue, Ye, Xe, je, We, Ze, Ke, qe, Je, Qe, ti, ei, ii, oi, si, ni, ri, ai;
7877
+ const l = new Pi(), s = new _i(), n = dt(null), r = dt(void 0), c = dt(!1), d = [], [h, u] = U(void 0), [p, f] = U(void 0), m = {
7866
7878
  zoomIn: () => {
7867
7879
  },
7868
7880
  zoomOut: () => {
@@ -7880,7 +7892,7 @@ const Le = ({
7880
7892
  }, g = {
7881
7893
  refreshPalette: () => {
7882
7894
  }
7883
- }, v = new ts(
7895
+ }, v = new ss(
7884
7896
  (gt) => u(gt),
7885
7897
  (gt) => f(gt)
7886
7898
  ), w = {
@@ -7901,27 +7913,27 @@ const Le = ({
7901
7913
  };
7902
7914
  Tt(() => {
7903
7915
  n.current && (c.current || (I(n.current), c.current = !0, e == null || e(A)));
7904
- }, [n.current]), Yi(() => {
7916
+ }, [n.current]), Zi(() => {
7905
7917
  n.current && (y(!0), I(n.current), e == null || e(A));
7906
7918
  }, [i]), Tt(() => {
7907
7919
  t && l.import(A.model, t);
7908
7920
  }, [t]);
7909
- const E = (gt, ft, si) => {
7910
- var ni;
7911
- if (p !== void 0 && ft.editable !== !1 && !Et(gt.getValue(ft.name), si)) {
7912
- gt.setValue(ft.name, si);
7921
+ const E = (gt, ft, li) => {
7922
+ var ci;
7923
+ if (p !== void 0 && ft.editable !== !1 && !Et(gt.getValue(ft.name), li)) {
7924
+ gt.setValue(ft.name, li);
7913
7925
  const ce = new It(
7914
7926
  p.propertySet,
7915
7927
  p.rootElement
7916
7928
  );
7917
- ce.setValues(p.getValues()), v.valueSet = ce, p.rootElement.valueSet = ce, (ni = A.propertyEditorChanges$) == null || ni.next();
7929
+ ce.setValues(p.getValues()), v.valueSet = ce, p.rootElement.valueSet = ce, (ci = A.propertyEditorChanges$) == null || ci.next();
7918
7930
  }
7919
7931
  };
7920
- return /* @__PURE__ */ k("daga-diagram", { children: /* @__PURE__ */ k(Qo.Provider, { value: i, children: /* @__PURE__ */ k($t.Provider, { value: A, children: /* @__PURE__ */ V("daga-diagram-editor", { children: [
7932
+ return /* @__PURE__ */ k("daga-diagram", { children: /* @__PURE__ */ k(os.Provider, { value: i, children: /* @__PURE__ */ k($t.Provider, { value: A, children: /* @__PURE__ */ V("daga-diagram-editor", { children: [
7921
7933
  /* @__PURE__ */ k("div", { className: "daga-append-to", ref: n }),
7922
7934
  /* @__PURE__ */ V($t.Provider, { value: A, children: [
7923
7935
  (($ = i.components) == null ? void 0 : $.buttons) !== void 0 && ((R = (C = i.components) == null ? void 0 : C.buttons) == null ? void 0 : R.enabled) !== !1 && /* @__PURE__ */ k(
7924
- hs,
7936
+ fs,
7925
7937
  {
7926
7938
  location: ((z = (T = i.components) == null ? void 0 : T.buttons) == null ? void 0 : z.location) || qt.BottomRight,
7927
7939
  direction: ((D = (j = i.components) == null ? void 0 : j.buttons) == null ? void 0 : D.direction) || b.Top,
@@ -7933,29 +7945,31 @@ const Le = ({
7933
7945
  }
7934
7946
  ),
7935
7947
  (($e = i.components) == null ? void 0 : $e.palette) !== void 0 && ((Ne = (Me = i.components) == null ? void 0 : Me.palette) == null ? void 0 : Ne.enabled) !== !1 && ((ze = (Pe = i.components) == null ? void 0 : Pe.palette) == null ? void 0 : ze.sections) && (((_e = (Ve = (Re = i.components) == null ? void 0 : Re.palette) == null ? void 0 : Ve.sections) == null ? void 0 : _e.length) || 0) > 0 && /* @__PURE__ */ k(
7936
- ds,
7948
+ ms,
7937
7949
  {
7938
7950
  location: ((De = (Oe = i.components) == null ? void 0 : Oe.palette) == null ? void 0 : De.location) || qt.TopLeft,
7939
7951
  direction: ((He = (Fe = i.components) == null ? void 0 : Fe.palette) == null ? void 0 : He.direction) || b.Bottom,
7940
7952
  width: ((Be = (Ge = i.components) == null ? void 0 : Ge.palette) == null ? void 0 : Be.width) || "12rem",
7941
- palettes: ((Ye = (Ue = i.components) == null ? void 0 : Ue.palette) == null ? void 0 : Ye.sections) || []
7953
+ height: (Ye = (Ue = i.components) == null ? void 0 : Ue.palette) == null ? void 0 : Ye.height,
7954
+ palettes: ((je = (Xe = i.components) == null ? void 0 : Xe.palette) == null ? void 0 : je.sections) || []
7942
7955
  }
7943
7956
  ),
7944
- ((Xe = i.components) == null ? void 0 : Xe.propertyEditor) !== void 0 && ((We = (je = i.components) == null ? void 0 : je.propertyEditor) == null ? void 0 : We.enabled) !== !1 && /* @__PURE__ */ k(
7945
- ls,
7957
+ ((We = i.components) == null ? void 0 : We.propertyEditor) !== void 0 && ((Ke = (Ze = i.components) == null ? void 0 : Ze.propertyEditor) == null ? void 0 : Ke.enabled) !== !1 && /* @__PURE__ */ k(
7958
+ gs,
7946
7959
  {
7947
- location: ((Ke = (Ze = i.components) == null ? void 0 : Ze.propertyEditor) == null ? void 0 : Ke.location) || qt.TopRight,
7948
- direction: ((Je = (qe = i.components) == null ? void 0 : qe.propertyEditor) == null ? void 0 : Je.direction) || b.Bottom,
7949
- width: ((ti = (Qe = i.components) == null ? void 0 : Qe.propertyEditor) == null ? void 0 : ti.width) || "24rem",
7960
+ location: ((Je = (qe = i.components) == null ? void 0 : qe.propertyEditor) == null ? void 0 : Je.location) || qt.TopRight,
7961
+ direction: ((ti = (Qe = i.components) == null ? void 0 : Qe.propertyEditor) == null ? void 0 : ti.direction) || b.Bottom,
7962
+ width: ((ii = (ei = i.components) == null ? void 0 : ei.propertyEditor) == null ? void 0 : ii.width) || "24rem",
7963
+ height: (si = (oi = i.components) == null ? void 0 : oi.propertyEditor) == null ? void 0 : si.height,
7950
7964
  title: h,
7951
7965
  valueSet: p,
7952
7966
  onValueChange: E
7953
7967
  }
7954
7968
  ),
7955
- ((ei = i.components) == null ? void 0 : ei.errors) !== void 0 && ((oi = (ii = i.components) == null ? void 0 : ii.errors) == null ? void 0 : oi.enabled) !== !1 && /* @__PURE__ */ k(es, {})
7969
+ ((ni = i.components) == null ? void 0 : ni.errors) !== void 0 && ((ai = (ri = i.components) == null ? void 0 : ri.errors) == null ? void 0 : ai.enabled) !== !1 && /* @__PURE__ */ k(ns, {})
7956
7970
  ] })
7957
7971
  ] }) }) }) });
7958
7972
  };
7959
7973
  export {
7960
- fs as DagaDiagram
7974
+ bs as DagaDiagram
7961
7975
  };