@metadev/daga-react 4.2.11 → 4.2.13

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/index.mjs CHANGED
@@ -1,7 +1,7 @@
1
- import { jsx as v, jsxs as M, Fragment as ro } from "react/jsx-runtime";
1
+ import { jsx as v, jsxs as M, Fragment as ao } from "react/jsx-runtime";
2
2
  import * as x from "d3";
3
- import { debounceTime as ao, Subject as jt, merge as lo, map as co } from "rxjs";
4
- import { createContext as Oe, useState as U, useContext as Ut, useRef as rt, useEffect as Ct, useMemo as ho } from "react";
3
+ import { debounceTime as lo, Subject as jt, merge as co, map as ho } from "rxjs";
4
+ import { createContext as He, useState as U, useContext as Ut, useRef as rt, useEffect as Ct, useMemo as go } from "react";
5
5
  var g = /* @__PURE__ */ ((s) => (s.Bottom = "bottom", s.Left = "left", s.Right = "right", s.Top = "top", s))(g || {}), Zt = /* @__PURE__ */ ((s) => (s.BottomLeft = "bottom-left", s.BottomRight = "bottom-right", s.TopLeft = "top-left", s.TopRight = "top-right", s))(Zt || {}), Lt = /* @__PURE__ */ ((s) => (s.Left = "left", s.Center = "center", s.Right = "right", s))(Lt || {}), qt = /* @__PURE__ */ ((s) => (s.Top = "top", s.Center = "center", s.Bottom = "bottom", s))(qt || {});
6
6
  const At = (s) => [Math.round(s[0]), Math.round(s[1])], ut = (s, t, e) => t < e ? t <= s && s <= e : e <= s && s <= t, Ie = (s, t, e) => (s - t[0]) / (t[1] - t[0]) * (e[1] - e[0]) + e[0], Jt = (s, t, e, a, l, r, i) => {
7
7
  const n = (() => {
@@ -14,7 +14,6 @@ const At = (s) => [Math.round(s[0]), Math.round(s[1])], ut = (s, t, e) => t < e
14
14
  const d = (t[0] + t[1]) / 2, c = (a[0] + a[1]) / 2, h = t[1] - t[0], f = a[1] - a[0], y = (s[0] - d) / h;
15
15
  return c + y * f;
16
16
  }
17
- case "floating":
18
17
  default:
19
18
  return Ie(s[0], t, a);
20
19
  }
@@ -28,13 +27,12 @@ const At = (s) => [Math.round(s[0]), Math.round(s[1])], ut = (s, t, e) => t < e
28
27
  const d = (e[0] + e[1]) / 2, c = (l[0] + l[1]) / 2, h = e[1] - e[0], f = l[1] - l[0], y = (s[1] - d) / h;
29
28
  return c + y * f;
30
29
  }
31
- case "floating":
32
30
  default:
33
31
  return Ie(s[1], e, l);
34
32
  }
35
33
  })();
36
34
  return [n, o];
37
- }, He = (s, t) => ((s[0] - t[0]) ** 2 + (s[1] - t[1]) ** 2) ** 0.5, go = (s, t) => (ut(
35
+ }, _e = (s, t) => ((s[0] - t[0]) ** 2 + (s[1] - t[1]) ** 2) ** 0.5, fo = (s, t) => (ut(
38
36
  s[0][0],
39
37
  t[0][0],
40
38
  t[1][0]
@@ -69,8 +67,8 @@ const At = (s) => [Math.round(s[0]), Math.round(s[1])], ut = (s, t, e) => t < e
69
67
  ));
70
68
  var $ = /* @__PURE__ */ ((s) => (s.Blur = "blur", s.Change = "change", s.Click = "click", s.ContextMenu = "contextmenu", s.DoubleClick = "dblclick", s.Focus = "focus", s.FocusIn = "focusin", s.FocusOut = "focusout", s.Input = "input", s.KeyDown = "keydown", s.KeyUp = "keyup", s.MouseDown = "mousedown", s.MouseEnter = "mouseenter", s.MouseLeave = "mouseleave", s.MouseMove = "mousemove", s.MouseOut = "mouseout", s.MouseOver = "mouseover", s.MouseUp = "mouseup", s.TouchStart = "touchstart", s.TouchEnd = "touchend", s.Wheel = "wheel", s))($ || {}), Z = /* @__PURE__ */ ((s) => (s.Alt = "Alt", s.AltGraph = "AltGraph", s.ArrowDown = "ArrowDown", s.ArrowLeft = "ArrowLeft", s.ArrowRight = "ArrowRight", s.ArrowUp = "ArrowUp", s.Backspace = "Backspace", s.Control = "Control", s.Delete = "Delete", s.End = "End", s.Enter = "Enter", s.Escape = "Escape", s.Home = "Home", s.OS = "OS", s.PageDown = "PageDown", s.PageUp = "PageUp", s.Shift = "Shift", s.Tab = "Tab", s))(Z || {}), I = /* @__PURE__ */ ((s) => (s.Drag = "drag", s.Start = "start", s.End = "end", s))(I || {}), fe = /* @__PURE__ */ ((s) => (s.Zoom = "zoom", s.Start = "start", s.End = "end", s))(fe || {});
71
69
  const ue = (s) => s.replace(/([!"#$%&'()*+,\-./:;<=>?@[\\\]^`{|}])/g, "\\$1");
72
- var _e = /* @__PURE__ */ ((s) => (s.Straight = "straight", s.Bezier = "bezier", s.Square = "square", s))(_e || {}), be = /* @__PURE__ */ ((s) => (s.Solid = "solid", s.Dashed = "dashed", s.GappedDashes = "gapped-dashes", s.Dotted = "dotted", s))(be || {});
73
- const fo = 20, uo = (s, t, e, a, l) => {
70
+ var Ge = /* @__PURE__ */ ((s) => (s.Straight = "straight", s.Bezier = "bezier", s.Square = "square", s))(Ge || {}), be = /* @__PURE__ */ ((s) => (s.Solid = "solid", s.Dashed = "dashed", s.GappedDashes = "gapped-dashes", s.Dotted = "dotted", s))(be || {});
71
+ const uo = 20, po = (s, t, e, a, l) => {
74
72
  if (typeof s == "function")
75
73
  return s(
76
74
  t,
@@ -83,7 +81,7 @@ const fo = 20, uo = (s, t, e, a, l) => {
83
81
  if (t.length === 1)
84
82
  return `M ${t[0][0]} ${t[0][1]}`;
85
83
  {
86
- l = l || fo;
84
+ l = l || uo;
87
85
  let r = "", i, n;
88
86
  switch (s) {
89
87
  case "straight":
@@ -280,7 +278,6 @@ const fo = 20, uo = (s, t, e, a, l) => {
280
278
  return `${4 * t} ${t}`;
281
279
  case "gapped-dashes":
282
280
  return `${4 * t} ${4 * t}`;
283
- case "solid":
284
281
  default:
285
282
  return "none";
286
283
  }
@@ -294,57 +291,57 @@ const me = (s, t, e, a, l) => {
294
291
  return s(t, e, a, l);
295
292
  switch (s) {
296
293
  case "ellipse":
297
- return Ge(t, e, a, l);
294
+ return Fe(t, e, a, l);
298
295
  case "empty":
299
- return po();
296
+ return mo();
300
297
  case "folder":
301
- return mo(t, e, a, l);
302
- case "hexagon":
303
298
  return vo(t, e, a, l);
304
- case "octagon":
299
+ case "hexagon":
305
300
  return yo(t, e, a, l);
301
+ case "octagon":
302
+ return bo(t, e, a, l);
306
303
  case "pill":
307
304
  return Kt(t, e, a, l);
308
305
  case "rectangle":
309
306
  return Ae(t, e, a, l);
310
307
  case "rhombus":
311
- return bo(t, e, a, l);
312
- case "rounded-rectangle":
313
308
  return ko(t, e, a, l);
314
- case "sticky-note":
309
+ case "rounded-rectangle":
315
310
  return wo(t, e, a, l);
311
+ case "sticky-note":
312
+ return So(t, e, a, l);
316
313
  default:
317
314
  return Ae(t, e, a, l);
318
315
  }
319
- }, Ge = (s, t, e, a) => `M ${s + e / 2} ${t} A ${e / 2} ${a / 2} 0 0 0 ${s + e / 2} ${t + a} A ${e / 2} ${a / 2} 0 1 0 ${s + e / 2} ${t} Z`, po = () => "Z", mo = (s, t, e, a) => `M ${s} ${t} L ${s + e / 3} ${t} L ${s + e / 2} ${t + a / 6} L ${s + e} ${t + a / 6} L ${s + e} ${t + a} L ${s} ${t + a} Z`, vo = (s, t, e, a) => `M ${s + e / 4} ${t} L ${s + 3 * e / 4} ${t} L ${s + e} ${t + a / 2} L ${s + 3 * e / 4} ${t + a} L ${s + e / 4} ${t + a} L ${s} ${t + a / 2} Z`, yo = (s, t, e, a) => `M ${s + e / 4} ${t} L ${s + 3 * e / 4} ${t} L ${s + e} ${t + a / 4} L ${s + e} ${t + 3 * a / 4} L ${s + 3 * e / 4} ${t + a} L ${s + e / 4} ${t + a} L ${s} ${t + 3 * a / 4} L ${s} ${t + a / 4} L ${s + e / 4} ${t} Z`, Kt = (s, t, e, a) => a < e ? `M ${s + a / 2} ${t} L ${s + e - a / 2} ${t} A ${a / 2} ${a / 2} 0 0 1 ${s + e} ${t + a / 2} A ${a / 2} ${a / 2} 0 0 1 ${s + e - a / 2} ${t + a} L ${s + a / 2} ${t + a} A ${a / 2} ${a / 2} 0 0 1 ${s} ${t + a / 2} A ${a / 2} ${a / 2} 0 0 1 ${s + a / 2} ${t} Z` : a > e ? `M ${s} ${t + e / 2} L ${s} ${t + a - e / 2} A ${e / 2} ${e / 2} 0 0 0 ${s + e / 2} ${t + a} A ${e / 2} ${e / 2} 0 0 0 ${s + e} ${t + a - e / 2} L ${s + e} ${t + e / 2} A ${e / 2} ${e / 2} 0 0 0 ${s + e / 2} ${t} A ${e / 2} ${e / 2} 0 0 0 ${s} ${t + e / 2} Z` : Ge(s, t, e, a), Ae = (s, t, e, a) => `M ${s} ${t} L ${s + e} ${t} L ${s + e} ${t + a} L ${s} ${t + a} Z`, bo = (s, t, e, a) => `M ${s + e / 2} ${t} L ${s + e} ${t + a / 2} L ${s + e / 2} ${t + a} L ${s} ${t + a / 2} Z`, ko = (s, t, e, a) => `M ${s + e / 4} ${t} L ${s + 3 * e / 4} ${t} A ${e / 4} ${a / 4} 0 0 1 ${s + e} ${t + a / 4} L ${s + e} ${t + 3 * a / 4} A ${e / 4} ${a / 4} 0 0 1 ${s + 3 * e / 4} ${t + a} L ${s + e / 4} ${t + a} A ${e / 4} ${a / 4} 0 0 1 ${s} ${t + 3 * a / 4} L ${s} ${t + a / 4} A ${e / 4} ${a / 4} 0 0 1 ${s + e / 4} ${t} Z`, wo = (s, t, e, a) => `M ${s} ${t} L ${s + 3 * e / 4} ${t} L ${s + 3 * e / 4} ${t + a / 4} L ${s + 3 * e / 4} ${t} L ${s + e} ${t + a / 4} L ${s + 3 * e / 4} ${t + a / 4} L ${s + e} ${t + a / 4} L ${s + e} ${t + a} L ${s} ${t + a} Z`;
316
+ }, Fe = (s, t, e, a) => `M ${s + e / 2} ${t} A ${e / 2} ${a / 2} 0 0 0 ${s + e / 2} ${t + a} A ${e / 2} ${a / 2} 0 1 0 ${s + e / 2} ${t} Z`, mo = () => "Z", vo = (s, t, e, a) => `M ${s} ${t} L ${s + e / 3} ${t} L ${s + e / 2} ${t + a / 6} L ${s + e} ${t + a / 6} L ${s + e} ${t + a} L ${s} ${t + a} Z`, yo = (s, t, e, a) => `M ${s + e / 4} ${t} L ${s + 3 * e / 4} ${t} L ${s + e} ${t + a / 2} L ${s + 3 * e / 4} ${t + a} L ${s + e / 4} ${t + a} L ${s} ${t + a / 2} Z`, bo = (s, t, e, a) => `M ${s + e / 4} ${t} L ${s + 3 * e / 4} ${t} L ${s + e} ${t + a / 4} L ${s + e} ${t + 3 * a / 4} L ${s + 3 * e / 4} ${t + a} L ${s + e / 4} ${t + a} L ${s} ${t + 3 * a / 4} L ${s} ${t + a / 4} L ${s + e / 4} ${t} Z`, Kt = (s, t, e, a) => a < e ? `M ${s + a / 2} ${t} L ${s + e - a / 2} ${t} A ${a / 2} ${a / 2} 0 0 1 ${s + e} ${t + a / 2} A ${a / 2} ${a / 2} 0 0 1 ${s + e - a / 2} ${t + a} L ${s + a / 2} ${t + a} A ${a / 2} ${a / 2} 0 0 1 ${s} ${t + a / 2} A ${a / 2} ${a / 2} 0 0 1 ${s + a / 2} ${t} Z` : a > e ? `M ${s} ${t + e / 2} L ${s} ${t + a - e / 2} A ${e / 2} ${e / 2} 0 0 0 ${s + e / 2} ${t + a} A ${e / 2} ${e / 2} 0 0 0 ${s + e} ${t + a - e / 2} L ${s + e} ${t + e / 2} A ${e / 2} ${e / 2} 0 0 0 ${s + e / 2} ${t} A ${e / 2} ${e / 2} 0 0 0 ${s} ${t + e / 2} Z` : Fe(s, t, e, a), Ae = (s, t, e, a) => `M ${s} ${t} L ${s + e} ${t} L ${s + e} ${t + a} L ${s} ${t + a} Z`, ko = (s, t, e, a) => `M ${s + e / 2} ${t} L ${s + e} ${t + a / 2} L ${s + e / 2} ${t + a} L ${s} ${t + a / 2} Z`, wo = (s, t, e, a) => `M ${s + e / 4} ${t} L ${s + 3 * e / 4} ${t} A ${e / 4} ${a / 4} 0 0 1 ${s + e} ${t + a / 4} L ${s + e} ${t + 3 * a / 4} A ${e / 4} ${a / 4} 0 0 1 ${s + 3 * e / 4} ${t + a} L ${s + e / 4} ${t + a} A ${e / 4} ${a / 4} 0 0 1 ${s} ${t + 3 * a / 4} L ${s} ${t + a / 4} A ${e / 4} ${a / 4} 0 0 1 ${s + e / 4} ${t} Z`, So = (s, t, e, a) => `M ${s} ${t} L ${s + 3 * e / 4} ${t} L ${s + 3 * e / 4} ${t + a / 4} L ${s + 3 * e / 4} ${t} L ${s + e} ${t + a / 4} L ${s + 3 * e / 4} ${t + a / 4} L ${s + e} ${t + a / 4} L ${s + e} ${t + a} L ${s} ${t + a} Z`;
320
317
  var L = /* @__PURE__ */ ((s) => (s.AllScroll = "all-scroll", s.Auto = "auto", s.Crosshair = "crosshair", s.EWResize = "ew-resize", s.Grab = "grab", s.Grabbing = "grabbing", s.Move = "move", s.NoDrop = "no-drop", s.NSResize = "ns-resize", s.NotAllowed = "not-allowed", s.ZoomIn = "zoom-in", s.ZoomOut = "zoom-out", s))(L || {});
321
- const So = (s) => Math.max(...s.split(`
322
- `).map((t) => t.length)), Co = (s) => s.match(/\n/g)?.length || 0, W = [];
318
+ const Co = (s) => Math.max(...s.split(`
319
+ `).map((t) => t.length)), $o = (s) => s.match(/\n/g)?.length || 0, W = [];
323
320
  for (let s = 0; s < 256; ++s)
324
321
  W.push((s + 256).toString(16).slice(1));
325
- function $o(s, t = 0) {
322
+ function Io(s, t = 0) {
326
323
  return (W[s[t + 0]] + W[s[t + 1]] + W[s[t + 2]] + W[s[t + 3]] + "-" + W[s[t + 4]] + W[s[t + 5]] + "-" + W[s[t + 6]] + W[s[t + 7]] + "-" + W[s[t + 8]] + W[s[t + 9]] + "-" + W[s[t + 10]] + W[s[t + 11]] + W[s[t + 12]] + W[s[t + 13]] + W[s[t + 14]] + W[s[t + 15]]).toLowerCase();
327
324
  }
328
325
  let re;
329
- const Io = new Uint8Array(16);
330
- function Ao() {
326
+ const Ao = new Uint8Array(16);
327
+ function xo() {
331
328
  if (!re) {
332
329
  if (typeof crypto > "u" || !crypto.getRandomValues)
333
330
  throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");
334
331
  re = crypto.getRandomValues.bind(crypto);
335
332
  }
336
- return re(Io);
333
+ return re(Ao);
337
334
  }
338
- const xo = typeof crypto < "u" && crypto.randomUUID && crypto.randomUUID.bind(crypto), xe = { randomUUID: xo };
339
- function Lo(s, t, e) {
335
+ const Lo = typeof crypto < "u" && crypto.randomUUID && crypto.randomUUID.bind(crypto), xe = { randomUUID: Lo };
336
+ function Eo(s, t, e) {
340
337
  s = s || {};
341
- const a = s.random ?? s.rng?.() ?? Ao();
338
+ const a = s.random ?? s.rng?.() ?? xo();
342
339
  if (a.length < 16)
343
340
  throw new Error("Random bytes length must be >= 16");
344
- return a[6] = a[6] & 15 | 64, a[8] = a[8] & 63 | 128, $o(a);
341
+ return a[6] = a[6] & 15 | 64, a[8] = a[8] & 63 | 128, Io(a);
345
342
  }
346
343
  function Le(s, t, e) {
347
- return xe.randomUUID && !s ? xe.randomUUID() : Lo(s);
344
+ return xe.randomUUID && !s ? xe.randomUUID() : Eo(s);
348
345
  }
349
346
  const Nt = (s) => {
350
347
  if (typeof s != "object")
@@ -555,7 +552,7 @@ class ft extends te {
555
552
  yield e;
556
553
  }
557
554
  }
558
- class Eo {
555
+ class Mo {
559
556
  constructor(t, e, a, l, r, i, n) {
560
557
  this.name = t, this.label = e, this.type = a, this.defaultValue = l, this.basic = r, this.editable = i, this.rootAttribute = n, this.options = void 0, this.properties = void 0;
561
558
  }
@@ -580,11 +577,11 @@ class ee {
580
577
  function kt(s, t) {
581
578
  return !t || s[0] > t[0] ? !0 : s[0] === t[0] ? s[1] >= t[1] : !1;
582
579
  }
583
- const Ee = (s) => s == null || s === "" || s instanceof Array && s.length === 0 || s instanceof Object && Object.keys(s).length === 0, St = (s, t) => s === t || JSON.stringify(s) === JSON.stringify(t), Fe = (s, t, e) => {
580
+ const Ee = (s) => s == null || s === "" || s instanceof Array && s.length === 0 || s instanceof Object && Object.keys(s).length === 0, St = (s, t) => s === t || JSON.stringify(s) === JSON.stringify(t), Ue = (s, t, e) => {
584
581
  const a = {}, l = {};
585
582
  for (const r in e.propertySet.propertyMap)
586
583
  if (e.propertySet.propertyMap[r].type === T.Object) {
587
- const i = Fe(
584
+ const i = Ue(
588
585
  s[r],
589
586
  t[r],
590
587
  e.getSubValueSet(r)
@@ -593,7 +590,7 @@ const Ee = (s) => s == null || s === "" || s instanceof Array && s.length === 0
593
590
  } else
594
591
  St(s[r], t[r]) || (a[r] = s[r], l[r] = t[r]);
595
592
  return [a, l];
596
- }, Mo = (s) => s != null && s.constructor === Object;
593
+ }, To = (s) => s != null && s.constructor === Object;
597
594
  class yt {
598
595
  constructor(t, e) {
599
596
  this.displayedProperties = [], this.hiddenProperties = [], this.values = {}, this.valueSets = {}, this.ownTimestamps = {}, this.propertySet = t, this.rootElement = e, this.resetValues();
@@ -849,7 +846,7 @@ const et = {
849
846
  lookType: "connection-look",
850
847
  color: "#000000",
851
848
  thickness: 1,
852
- shape: _e.Straight,
849
+ shape: Ge.Straight,
853
850
  style: be.Solid,
854
851
  selected: {
855
852
  color: "#AA00AA"
@@ -864,7 +861,7 @@ const et = {
864
861
  endTypes: [],
865
862
  properties: []
866
863
  };
867
- class Ue {
864
+ class De {
868
865
  constructor(t) {
869
866
  const e = {
870
867
  ...et,
@@ -1164,7 +1161,7 @@ class dt extends It {
1164
1161
  return this.start ? this.end ? Math.min(this.start.getPriority(), this.end.getPriority()) : this.start.getPriority() : this.end ? this.end.getPriority() : Pt;
1165
1162
  }
1166
1163
  }
1167
- class To extends ft {
1164
+ class No extends ft {
1168
1165
  /**
1169
1166
  * Instance a set of connections for the given model. This method is used internally.
1170
1167
  * @private
@@ -1183,7 +1180,7 @@ class To extends ft {
1183
1180
  */
1184
1181
  new(t, e, a, l) {
1185
1182
  let r;
1186
- if (t instanceof Ue)
1183
+ if (t instanceof De)
1187
1184
  r = t;
1188
1185
  else {
1189
1186
  const n = this.types.get(t);
@@ -1207,7 +1204,7 @@ class To extends ft {
1207
1204
  e && (Y(e.start?.outgoingConnections || [], e), Y(e.end?.incomingConnections || [], e), super.remove(t), e.updateInView());
1208
1205
  }
1209
1206
  }
1210
- const V = {
1207
+ const R = {
1211
1208
  editable: !0,
1212
1209
  fontSize: 0,
1213
1210
  margin: 0,
@@ -1279,7 +1276,7 @@ class ht extends It {
1279
1276
  return this.rootElement?.getPriority() || Pt;
1280
1277
  }
1281
1278
  }
1282
- class No extends ft {
1279
+ class Po extends ft {
1283
1280
  /**
1284
1281
  * Instance a set of fields for the given model. This method is used internally.
1285
1282
  * @private
@@ -1317,7 +1314,7 @@ class No extends ft {
1317
1314
  e && (e.rootElement?.label !== void 0 && e.rootElement.label === e && (e.rootElement.label = void 0), super.remove(t), e.updateInView());
1318
1315
  }
1319
1316
  }
1320
- const K = (s) => s?.margin === null || s?.margin === void 0 ? V.margin : typeof s.margin == "number" ? s.margin : s.margin.length === 0 ? V.margin : s.margin.length === 1 || s.margin.length === 2 ? s.margin[0] : (s.margin.length === 3, s.margin[2]), B = (s) => s?.margin === null || s?.margin === void 0 ? V.margin : typeof s.margin == "number" ? s.margin : s.margin.length === 0 ? V.margin : s.margin.length === 1 ? s.margin[0] : s.margin.length === 2 || s.margin.length === 3 ? s.margin[1] : s.margin[3], ot = (s) => s?.margin === null || s?.margin === void 0 ? V.margin : typeof s.margin == "number" ? s.margin : s.margin.length === 0 ? V.margin : s.margin.length === 1 ? s.margin[0] : (s.margin.length === 2 || s.margin.length === 3, s.margin[1]), F = (s) => s?.margin === null || s?.margin === void 0 ? V.margin : typeof s.margin == "number" ? s.margin : s.margin.length === 0 ? V.margin : (s.margin.length === 1 || s.margin.length === 2 || s.margin.length === 3, s.margin[0]), Vt = (s) => s?.padding === null || s?.padding === void 0 ? V.padding : typeof s.padding == "number" ? s.padding : s.padding.length === 0 ? V.padding : s.padding.length === 1 || s.padding.length === 2 ? s.padding[0] : (s.padding.length === 3, s.padding[2]), Ot = (s) => s?.padding === null || s?.padding === void 0 ? V.padding : typeof s.padding == "number" ? s.padding : s.padding.length === 0 ? V.padding : s.padding.length === 1 ? s.padding[0] : s.padding.length === 2 || s.padding.length === 3 ? s.padding[1] : s.padding[3], Ht = (s) => s?.padding === null || s?.padding === void 0 ? V.padding : typeof s.padding == "number" ? s.padding : s.padding.length === 0 ? V.padding : s.padding.length === 1 ? s.padding[0] : (s.padding.length === 2 || s.padding.length === 3, s.padding[1]), _t = (s) => s?.padding === null || s?.padding === void 0 ? V.padding : typeof s.padding == "number" ? s.padding : s.padding.length === 0 ? V.padding : (s.padding.length === 1 || s.padding.length === 2 || s.padding.length === 3, s.padding[0]), Me = 1, Te = 1, Po = 1, zo = 1;
1317
+ const K = (s) => s?.margin === null || s?.margin === void 0 ? R.margin : typeof s.margin == "number" ? s.margin : s.margin.length === 0 ? R.margin : s.margin.length === 1 || s.margin.length === 2 ? s.margin[0] : (s.margin.length === 3, s.margin[2]), B = (s) => s?.margin === null || s?.margin === void 0 ? R.margin : typeof s.margin == "number" ? s.margin : s.margin.length === 0 ? R.margin : s.margin.length === 1 ? s.margin[0] : s.margin.length === 2 || s.margin.length === 3 ? s.margin[1] : s.margin[3], ot = (s) => s?.margin === null || s?.margin === void 0 ? R.margin : typeof s.margin == "number" ? s.margin : s.margin.length === 0 ? R.margin : s.margin.length === 1 ? s.margin[0] : (s.margin.length === 2 || s.margin.length === 3, s.margin[1]), F = (s) => s?.margin === null || s?.margin === void 0 ? R.margin : typeof s.margin == "number" ? s.margin : s.margin.length === 0 ? R.margin : (s.margin.length === 1 || s.margin.length === 2 || s.margin.length === 3, s.margin[0]), Rt = (s) => s?.padding === null || s?.padding === void 0 ? R.padding : typeof s.padding == "number" ? s.padding : s.padding.length === 0 ? R.padding : s.padding.length === 1 || s.padding.length === 2 ? s.padding[0] : (s.padding.length === 3, s.padding[2]), Ot = (s) => s?.padding === null || s?.padding === void 0 ? R.padding : typeof s.padding == "number" ? s.padding : s.padding.length === 0 ? R.padding : s.padding.length === 1 ? s.padding[0] : s.padding.length === 2 || s.padding.length === 3 ? s.padding[1] : s.padding[3], Ht = (s) => s?.padding === null || s?.padding === void 0 ? R.padding : typeof s.padding == "number" ? s.padding : s.padding.length === 0 ? R.padding : s.padding.length === 1 ? s.padding[0] : (s.padding.length === 2 || s.padding.length === 3, s.padding[1]), _t = (s) => s?.padding === null || s?.padding === void 0 ? R.padding : typeof s.padding == "number" ? s.padding : s.padding.length === 0 ? R.padding : (s.padding.length === 1 || s.padding.length === 2 || s.padding.length === 3, s.padding[0]), Me = 1, Te = 1, zo = 1, Vo = 1;
1321
1318
  class Ro {
1322
1319
  constructor(t) {
1323
1320
  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 = [];
@@ -1325,14 +1322,14 @@ class Ro {
1325
1322
  const a = [];
1326
1323
  this.sections.push(a);
1327
1324
  for (const l of e)
1328
- a.push(new Vo(l));
1325
+ a.push(new Oo(l));
1329
1326
  }
1330
1327
  }
1331
1328
  }
1332
- class Vo {
1329
+ class Oo {
1333
1330
  constructor(t) {
1334
1331
  this.label = t.label || null, this.ports = t.ports || [], this.priority = t.priority || Pt, this.resizableX = t.resizableX, this.resizableY = t.resizableY;
1335
- const e = st(t.look || De);
1332
+ const e = st(t.look || Be);
1336
1333
  this.defaultLook = e.defaultLook, this.selectedLook = e.selectedLook, this.highlightedLook = e.highlightedLook, this.selectedAndHighlightedLook = e.selectedAndHighlightedLook;
1337
1334
  }
1338
1335
  }
@@ -1416,10 +1413,10 @@ class D extends It {
1416
1413
  return this.node?.type?.sectionGrid?.sections?.[this.indexYInNode]?.[this.indexXInNode];
1417
1414
  }
1418
1415
  getMinWidth() {
1419
- return this.node?.type?.sectionGrid?.minWidths?.[this.indexXInNode] || Po;
1416
+ return this.node?.type?.sectionGrid?.minWidths?.[this.indexXInNode] || zo;
1420
1417
  }
1421
1418
  getMinHeight() {
1422
- return this.node?.type?.sectionGrid?.minHeights?.[this.indexYInNode] || zo;
1419
+ return this.node?.type?.sectionGrid?.minHeights?.[this.indexYInNode] || Vo;
1423
1420
  }
1424
1421
  getPriority() {
1425
1422
  return this.node?.type?.sectionGrid?.sections?.[this.indexYInNode]?.[this.indexXInNode]?.priority || Pt;
@@ -1592,7 +1589,7 @@ class D extends It {
1592
1589
  this.model.canvas?.autoTightenConnections !== !1 && this.getConnections().forEach((n) => n.tighten()), this.updateInView();
1593
1590
  }
1594
1591
  }
1595
- class Oo extends ft {
1592
+ class Ho extends ft {
1596
1593
  /**
1597
1594
  * Instance a set of sections for the given model. This method is used internally.
1598
1595
  * @private
@@ -1637,9 +1634,9 @@ class Oo extends ft {
1637
1634
  );
1638
1635
  if (y.type?.label) {
1639
1636
  const m = {
1640
- ...V,
1637
+ ...R,
1641
1638
  ...y.type?.label
1642
- }, p = 6 * m.fontSize + Ot(m) + Ht(m), u = m.fontSize + _t(m) + Vt(m);
1639
+ }, p = 6 * m.fontSize + Ot(m) + Ht(m), u = m.fontSize + _t(m) + Rt(m);
1643
1640
  let k;
1644
1641
  switch (y.direction) {
1645
1642
  case g.Bottom:
@@ -1681,7 +1678,7 @@ class Oo extends ft {
1681
1678
  const c = t.type.sectionGrid?.sections?.[a]?.[e]?.label;
1682
1679
  if (c) {
1683
1680
  const h = {
1684
- ...V,
1681
+ ...R,
1685
1682
  ...c
1686
1683
  };
1687
1684
  this.model.fields.new(
@@ -1716,7 +1713,7 @@ class Oo extends ft {
1716
1713
  }
1717
1714
  }
1718
1715
  }
1719
- const De = {
1716
+ const Be = {
1720
1717
  lookType: "shaped-look",
1721
1718
  shape: Tt.Rectangle,
1722
1719
  fillColor: "#FFFFFF",
@@ -1743,20 +1740,20 @@ const De = {
1743
1740
  ports: [],
1744
1741
  decorators: [],
1745
1742
  sectionGrid: null,
1746
- look: De,
1743
+ look: Be,
1747
1744
  isUnique: !1,
1748
1745
  canBeParentless: !0,
1749
1746
  childrenTypes: [],
1750
1747
  priority: Pt,
1751
1748
  properties: []
1752
1749
  };
1753
- class Be {
1750
+ class Ye {
1754
1751
  constructor(t) {
1755
1752
  const e = {
1756
1753
  ...gt,
1757
1754
  ...t
1758
1755
  };
1759
- this.id = e.id, this.name = e.name, this.defaultWidth = e.defaultWidth, this.defaultHeight = e.defaultHeight, this.minWidth = e.minWidth, this.minHeight = e.minHeight, this.resizableX = e.resizableX, this.resizableY = e.resizableY, this.snapToGridOffset = e.snapToGridOffset, this.bottomPadding = _o(e), this.leftPadding = Go(e), this.rightPadding = Fo(e), this.topPadding = Uo(e), this.label = e.label, this.ports = e.ports, this.decorators = e.decorators, this.sectionGrid = e.sectionGrid ? new Ro(e.sectionGrid) : null;
1756
+ this.id = e.id, this.name = e.name, this.defaultWidth = e.defaultWidth, this.defaultHeight = e.defaultHeight, this.minWidth = e.minWidth, this.minHeight = e.minHeight, this.resizableX = e.resizableX, this.resizableY = e.resizableY, this.snapToGridOffset = e.snapToGridOffset, this.bottomPadding = Go(e), this.leftPadding = Fo(e), this.rightPadding = Uo(e), this.topPadding = Do(e), this.label = e.label, this.ports = e.ports, this.decorators = e.decorators, this.sectionGrid = e.sectionGrid ? new Ro(e.sectionGrid) : null;
1760
1757
  const a = st(e.look);
1761
1758
  this.defaultLook = a.defaultLook, this.selectedLook = a.selectedLook, this.highlightedLook = a.highlightedLook, this.selectedAndHighlightedLook = a.selectedAndHighlightedLook, this.isUnique = e.isUnique, this.canBeParentless = e.canBeParentless, this.childrenTypes = e.childrenTypes, this.priority = e.priority, this.propertySet = new ee(t?.properties || []);
1762
1759
  }
@@ -2315,7 +2312,7 @@ class z extends It {
2315
2312
  this.stretch(g.Bottom, e + a);
2316
2313
  }
2317
2314
  }
2318
- class Ho extends ft {
2315
+ class _o extends ft {
2319
2316
  /**
2320
2317
  * Instance a set of nodes for the given model. This method is used internally.
2321
2318
  * @private
@@ -2333,7 +2330,7 @@ class Ho extends ft {
2333
2330
  */
2334
2331
  new(t, e, a) {
2335
2332
  let l;
2336
- if (t instanceof Be)
2333
+ if (t instanceof Ye)
2337
2334
  l = t;
2338
2335
  else {
2339
2336
  const i = this.types.get(t);
@@ -2379,9 +2376,9 @@ class Ho extends ft {
2379
2376
  );
2380
2377
  if (d.type?.label) {
2381
2378
  const c = {
2382
- ...V,
2379
+ ...R,
2383
2380
  ...d.type?.label
2384
- }, h = 6 * c.fontSize + Ot(c) + Ht(c), f = c.fontSize + _t(c) + Vt(c);
2381
+ }, h = 6 * c.fontSize + Ot(c) + Ht(c), f = c.fontSize + _t(c) + Rt(c);
2385
2382
  let y;
2386
2383
  switch (d.direction) {
2387
2384
  case g.Bottom:
@@ -2422,7 +2419,7 @@ class Ho extends ft {
2422
2419
  }
2423
2420
  if (l.label) {
2424
2421
  const i = {
2425
- ...V,
2422
+ ...R,
2426
2423
  ...l.label
2427
2424
  };
2428
2425
  this.model.fields.new(
@@ -2494,12 +2491,12 @@ class Ho extends ft {
2494
2491
  return a;
2495
2492
  }
2496
2493
  }
2497
- const Ye = (s) => {
2494
+ const Xe = (s) => {
2498
2495
  for (let t = 0; t < s.length; ++t)
2499
2496
  for (let e = 0; e < s.length; ++e)
2500
2497
  e !== t && s[e].isAncestorOf(s[t]) && (s.splice(e, 1), --e, t > e && --t);
2501
2498
  return s;
2502
- }, _o = (s) => s?.padding === null || s?.padding === void 0 ? gt.padding : typeof s.padding == "number" ? s.padding : s.padding.length === 0 ? gt.padding : s.padding.length === 1 || s.padding.length === 2 ? s.padding[0] : (s.padding.length === 3, s.padding[2]), Go = (s) => s?.padding === null || s?.padding === void 0 ? gt.padding : typeof s.padding == "number" ? s.padding : s.padding.length === 0 ? gt.padding : s.padding.length === 1 ? s.padding[0] : s.padding.length === 2 || s.padding.length === 3 ? s.padding[1] : s.padding[3], Fo = (s) => s?.padding === null || s?.padding === void 0 ? gt.padding : typeof s.padding == "number" ? s.padding : s.padding.length === 0 ? gt.padding : s.padding.length === 1 ? s.padding[0] : (s.padding.length === 2 || s.padding.length === 3, s.padding[1]), Uo = (s) => s?.padding === null || s?.padding === void 0 ? gt.padding : typeof s.padding == "number" ? s.padding : s.padding.length === 0 ? gt.padding : (s.padding.length === 1 || s.padding.length === 2 || s.padding.length === 3, s.padding[0]), Xe = {
2499
+ }, Go = (s) => s?.padding === null || s?.padding === void 0 ? gt.padding : typeof s.padding == "number" ? s.padding : s.padding.length === 0 ? gt.padding : s.padding.length === 1 || s.padding.length === 2 ? s.padding[0] : (s.padding.length === 3, s.padding[2]), Fo = (s) => s?.padding === null || s?.padding === void 0 ? gt.padding : typeof s.padding == "number" ? s.padding : s.padding.length === 0 ? gt.padding : s.padding.length === 1 ? s.padding[0] : s.padding.length === 2 || s.padding.length === 3 ? s.padding[1] : s.padding[3], Uo = (s) => s?.padding === null || s?.padding === void 0 ? gt.padding : typeof s.padding == "number" ? s.padding : s.padding.length === 0 ? gt.padding : s.padding.length === 1 ? s.padding[0] : (s.padding.length === 2 || s.padding.length === 3, s.padding[1]), Do = (s) => s?.padding === null || s?.padding === void 0 ? gt.padding : typeof s.padding == "number" ? s.padding : s.padding.length === 0 ? gt.padding : (s.padding.length === 1 || s.padding.length === 2 || s.padding.length === 3, s.padding[0]), je = {
2503
2500
  lookType: "shaped-look",
2504
2501
  shape: Tt.Ellipse,
2505
2502
  fillColor: "transparent",
@@ -2511,18 +2508,18 @@ const Ye = (s) => {
2511
2508
  highlighted: {
2512
2509
  fillColor: "rgba(0, 255, 255, 0.5)"
2513
2510
  }
2514
- }, Wt = st(Xe), je = {
2511
+ }, Wt = st(je), We = {
2515
2512
  name: "",
2516
2513
  label: null,
2517
2514
  allowsOutgoing: !0,
2518
2515
  allowsIncoming: !0,
2519
2516
  width: 24,
2520
- look: Xe
2517
+ look: je
2521
2518
  };
2522
- class Do {
2519
+ class Bo {
2523
2520
  constructor(t) {
2524
2521
  const e = {
2525
- ...je,
2522
+ ...We,
2526
2523
  ...t
2527
2524
  };
2528
2525
  this.id = e.id, this.name = e.name, this.label = e.label, this.allowsOutgoing = e.allowsOutgoing, this.allowsIncoming = e.allowsIncoming, this.width = e.width;
@@ -2630,7 +2627,7 @@ class bt extends It {
2630
2627
  * @private
2631
2628
  */
2632
2629
  get width() {
2633
- return this.type?.width || je.width;
2630
+ return this.type?.width || We.width;
2634
2631
  }
2635
2632
  /**
2636
2633
  * Current height of this port. Same as the width.
@@ -2703,10 +2700,10 @@ class bt extends It {
2703
2700
  ]), this.updateInView();
2704
2701
  }
2705
2702
  distanceTo(t) {
2706
- return He(this.coords, t);
2703
+ return _e(this.coords, t);
2707
2704
  }
2708
2705
  }
2709
- class Bo extends ft {
2706
+ class Yo extends ft {
2710
2707
  /**
2711
2708
  * Instance a set of ports for the given model. This method is used internally.
2712
2709
  * @private
@@ -2743,7 +2740,7 @@ class Bo extends ft {
2743
2740
  }
2744
2741
  }
2745
2742
  }
2746
- class We {
2743
+ class Ze {
2747
2744
  import(t, e) {
2748
2745
  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);
2749
2746
  for (const a of e.nodes || [])
@@ -2775,7 +2772,7 @@ class We {
2775
2772
  }
2776
2773
  if (a.label) {
2777
2774
  const i = {
2778
- ...V,
2775
+ ...R,
2779
2776
  ...a.label
2780
2777
  }, n = new ht(
2781
2778
  t,
@@ -2818,7 +2815,7 @@ class We {
2818
2815
  );
2819
2816
  if (l.sections?.push(n), t.sections.add(n), i.label && a.sectionGrid?.sections?.[i.indexYInNode]?.[i.indexXInNode]?.label) {
2820
2817
  const d = {
2821
- ...V,
2818
+ ...R,
2822
2819
  ...a.sectionGrid?.sections?.[i.indexYInNode]?.[i.indexXInNode]?.label
2823
2820
  }, c = new ht(
2824
2821
  t,
@@ -2857,7 +2854,7 @@ class We {
2857
2854
  if (n.ports.push(h), t.ports.add(h), d.label) {
2858
2855
  if (a.ports.length > o && c?.label) {
2859
2856
  const f = {
2860
- ...V,
2857
+ ...R,
2861
2858
  ...c?.label
2862
2859
  };
2863
2860
  let y;
@@ -2927,7 +2924,7 @@ class We {
2927
2924
  if (l.ports.push(o), t.ports.add(o), i.label) {
2928
2925
  if (a.ports.length > r && n?.label) {
2929
2926
  const d = {
2930
- ...V,
2927
+ ...R,
2931
2928
  ...n?.label
2932
2929
  };
2933
2930
  let c;
@@ -3314,7 +3311,7 @@ class se {
3314
3311
  this.canvas = t, this.nodes = e, this.connections = a;
3315
3312
  }
3316
3313
  do() {
3317
- const t = new We();
3314
+ const t = new Ze();
3318
3315
  this.canvas.userSelection.clear();
3319
3316
  for (const e of this.nodes) {
3320
3317
  const a = t.importNode(this.canvas.model, e);
@@ -3343,7 +3340,7 @@ class se {
3343
3340
  );
3344
3341
  }
3345
3342
  }
3346
- class Yo {
3343
+ class Xo {
3347
3344
  constructor(t) {
3348
3345
  this.isInRoom = !1, this.canvas = t, this.replicaId = Le();
3349
3346
  }
@@ -3446,7 +3443,7 @@ class Yo {
3446
3443
  }
3447
3444
  }
3448
3445
  }
3449
- class Xo {
3446
+ class jo {
3450
3447
  constructor(t, e) {
3451
3448
  this.canvas = t, this.maximum = e, this.history = [], this.index = 0;
3452
3449
  }
@@ -3499,7 +3496,7 @@ class Xo {
3499
3496
  }
3500
3497
  }
3501
3498
  var w = /* @__PURE__ */ ((s) => (s.AddConnection = "add-connection", s.AddNode = "add-node", s.AddSectionAction = "add-section", s.ApplyLayout = "apply-layout", s.Clipboard = "clipboard", s.ContextMenu = "context-menu", s.EditField = "edit-field", s.MoveNode = "move-node", s.Paste = "paste", s.Remove = "remove", s.StretchNode = "stretch-node", s.StretchSection = "stretch-section", s.UpdateValues = "update-values", s.Zoom = "zoom", s))(w || {});
3502
- class jo {
3499
+ class Wo {
3503
3500
  constructor(t, e, a, l, r, i, n, o, d) {
3504
3501
  this.canvas = t, this.type = e, this.coords = a, this.parentId = l, this.ancestorId = r, this.fromAncestorGeometry = i, this.toAncestorGeometry = n, this.label = o, this.values = d, this.id = this.canvas.collabEngine.freshId();
3505
3502
  }
@@ -3657,7 +3654,7 @@ class X {
3657
3654
  return t !== void 0;
3658
3655
  }
3659
3656
  }
3660
- class Wo {
3657
+ class Zo {
3661
3658
  constructor(t, e, a, l, r, i, n, o, d) {
3662
3659
  this.canvas = t, this.childId = e, this.fromParentId = a, this.toParentId = l, this.fromChildGeometry = r, this.toChildGeometry = i, this.ancestorId = n, this.fromAncestorGeometry = o, this.toAncestorGeometry = d;
3663
3660
  }
@@ -3786,7 +3783,7 @@ class Ne {
3786
3783
  return t !== void 0;
3787
3784
  }
3788
3785
  }
3789
- class Zo {
3786
+ class Ko {
3790
3787
  constructor(t, e, a, l) {
3791
3788
  this.canvas = t, this.id = e, this.from = a, this.to = l;
3792
3789
  }
@@ -3826,7 +3823,7 @@ class Zo {
3826
3823
  return !e.rootElement.removed;
3827
3824
  }
3828
3825
  }
3829
- class Ko {
3826
+ class qo {
3830
3827
  constructor(t, e, a, l, r, i) {
3831
3828
  this.canvas = t, this.nodeIds = e, this.sectionIds = a, this.portIds = l, this.connectionIds = r, this.fieldIds = i;
3832
3829
  }
@@ -3868,7 +3865,7 @@ class Ko {
3868
3865
  return this.do();
3869
3866
  }
3870
3867
  }
3871
- class qo {
3868
+ class Jo {
3872
3869
  constructor(t, e, a, l) {
3873
3870
  this.canvas = t, this.nodes = e, this.connections = a, this.coords = l;
3874
3871
  }
@@ -3967,8 +3964,8 @@ class Dt {
3967
3964
  this.defaultPrevented = !0;
3968
3965
  }
3969
3966
  }
3970
- var Ze = /* @__PURE__ */ ((s) => (s[s.Zoom = 0] = "Zoom", s[s.DoubleClick = 1] = "DoubleClick", s[s.SecondaryClick = 2] = "SecondaryClick", s[s.Selection = 3] = "Selection", s[s.Highlight = 4] = "Highlight", s))(Ze || {});
3971
- class Jo extends Dt {
3967
+ var Ke = /* @__PURE__ */ ((s) => (s[s.Zoom = 0] = "Zoom", s[s.DoubleClick = 1] = "DoubleClick", s[s.SecondaryClick = 2] = "SecondaryClick", s[s.Selection = 3] = "Selection", s[s.Highlight = 4] = "Highlight", s))(Ke || {});
3968
+ class Qo extends Dt {
3972
3969
  /**
3973
3970
  * Create a diagram zoom event.
3974
3971
  *
@@ -4038,7 +4035,7 @@ class Q extends Dt {
4038
4035
  ), this.target = t;
4039
4036
  }
4040
4037
  }
4041
- class Ke extends It {
4038
+ class qe extends It {
4042
4039
  constructor(t, e, a, l, r, i, n, o, d = "floating", c = "floating") {
4043
4040
  if (t.objects.get(o) !== void 0)
4044
4041
  throw new Error(`DiagramDecorator with id "${o}" already exists`);
@@ -4067,7 +4064,7 @@ class Ke extends It {
4067
4064
  return this.priority;
4068
4065
  }
4069
4066
  }
4070
- class Qo extends ft {
4067
+ class ti extends ft {
4071
4068
  /**
4072
4069
  * Instance a set of decorators for the given model. This method is used internally.
4073
4070
  * @private
@@ -4087,7 +4084,7 @@ class Qo extends ft {
4087
4084
  * @returns The instanced decorator.
4088
4085
  */
4089
4086
  new(t, e, a, l, r, i, n, o = "floating", d = "floating") {
4090
- const c = new Ke(
4087
+ const c = new qe(
4091
4088
  this.model,
4092
4089
  t,
4093
4090
  e,
@@ -4106,7 +4103,7 @@ class Qo extends ft {
4106
4103
  e && ((e.rootElement instanceof z || e.rootElement instanceof D) && Y(e.rootElement.decorators, e), super.remove(t), e.updateInView());
4107
4104
  }
4108
4105
  }
4109
- class ti extends It {
4106
+ class ei extends It {
4110
4107
  constructor(t, e, a, l, r, i, n) {
4111
4108
  if (t.objects.get(n) !== void 0)
4112
4109
  throw new Error(`DiagramObject with id "${n}" already exists`);
@@ -4135,7 +4132,7 @@ class ti extends It {
4135
4132
  return this.priority;
4136
4133
  }
4137
4134
  }
4138
- class ei extends ft {
4135
+ class oi extends ft {
4139
4136
  /**
4140
4137
  * Instance a set of objects for the given model. This method is used internally.
4141
4138
  * @private
@@ -4155,7 +4152,7 @@ class ei extends ft {
4155
4152
  * @returns The instanced object.
4156
4153
  */
4157
4154
  new(t, e, a, l, r, i) {
4158
- const n = new ti(
4155
+ const n = new ei(
4159
4156
  this.model,
4160
4157
  t,
4161
4158
  e,
@@ -4171,9 +4168,9 @@ class ei extends ft {
4171
4168
  e && (super.remove(t), e.updateInView());
4172
4169
  }
4173
4170
  }
4174
- class qe {
4171
+ class Je {
4175
4172
  constructor(t, e, a, l, r, i = []) {
4176
- this.nodes = new Ho(this), this.sections = new Oo(this), this.ports = new Bo(this), this.connections = new To(this), this.fields = new No(this), this.objects = new ei(this), this.decorators = new Qo(this), this.canvas = t, this.id = e, this.name = a, this.description = l, this.type = r, this.createdAt = /* @__PURE__ */ new Date(), this.updatedAt = /* @__PURE__ */ new Date(), this.logicalClock = 0, this.valueSet = new yt(new ee(i), this);
4173
+ this.nodes = new _o(this), this.sections = new Ho(this), this.ports = new Yo(this), this.connections = new No(this), this.fields = new Po(this), this.objects = new oi(this), this.decorators = new ti(this), this.canvas = t, this.id = e, this.name = a, this.description = l, this.type = r, this.createdAt = /* @__PURE__ */ new Date(), this.updatedAt = /* @__PURE__ */ new Date(), this.logicalClock = 0, this.valueSet = new yt(new ee(i), this);
4177
4174
  }
4178
4175
  /**
4179
4176
  * Deletes everything in this diagram.
@@ -4183,7 +4180,7 @@ class qe {
4183
4180
  this.canvas?.cancelAllUserActions(), this.id = void 0, this.name = "", this.description = void 0, this.createdAt = /* @__PURE__ */ new Date(), this.updatedAt = /* @__PURE__ */ new Date(), this.logicalClock = 0, this.nodes.clear(), this.sections.clear(), this.ports.clear(), this.connections.clear(), this.fields.clear(), this.objects.clear(), this.decorators.clear(), this.valueSet.resetValues(), this.canvas?.updateModelInView();
4184
4181
  }
4185
4182
  }
4186
- const vt = (s) => !!s.button, de = (s, t, e, a, l, r, i, n) => uo(
4183
+ const vt = (s) => !!s.button, de = (s, t, e, a, l, r, i, n) => po(
4187
4184
  s,
4188
4185
  [t, e],
4189
4186
  a,
@@ -4265,13 +4262,13 @@ const vt = (s) => !!s.button, de = (s, t, e, a, l, r, i, n) => uo(
4265
4262
  "href",
4266
4263
  (t) => t.look.backgroundImageBottomRight
4267
4264
  );
4268
- }, Rt = {
4265
+ }, Vt = {
4269
4266
  style: "dots",
4270
4267
  color: "rgba(0, 0, 0, 0.1)",
4271
4268
  snap: !1,
4272
4269
  spacing: 10,
4273
4270
  thickness: 0.05
4274
- }, oi = (s, t, e) => {
4271
+ }, ii = (s, t, e) => {
4275
4272
  const a = t.append("defs");
4276
4273
  if (s.gridSize > 0 && isFinite(s.gridSize)) {
4277
4274
  const l = a.append("pattern").attr("id", e).attr("x", -s.gridSize / 2).attr("y", -s.gridSize / 2).attr("width", s.gridSize).attr("height", s.gridSize).attr("patternUnits", "userSpaceOnUse");
@@ -4291,10 +4288,10 @@ const vt = (s) => !!s.button, de = (s, t, e, a, l, r, i, n) => uo(
4291
4288
  }
4292
4289
  t.select("rect").attr("fill", `url(#${e})`);
4293
4290
  }
4294
- }, ve = 96, j = 32, xt = ve + j, ii = Math.PI / 4, si = 100, Pe = {
4291
+ }, ve = 96, j = 32, xt = ve + j, si = Math.PI / 4, ni = 100, Pe = {
4295
4292
  customButtons: []
4296
4293
  };
4297
- class ni {
4294
+ class ri {
4298
4295
  /**
4299
4296
  * Constructs a context menu object.
4300
4297
  * @public
@@ -4352,7 +4349,7 @@ class ni {
4352
4349
  onPress: void 0
4353
4350
  });
4354
4351
  for (let i = 0; i < r.length; ++i) {
4355
- const n = r[i], o = n.onPress, d = (i + 0.5 - r.length / 2) * ii, c = l.append("xhtml:div").attr(
4352
+ const n = r[i], o = n.onPress, d = (i + 0.5 - r.length / 2) * si, c = l.append("xhtml:div").attr(
4356
4353
  "class",
4357
4354
  `daga-context-menu-button ${n.onPress !== void 0 ? " daga-clickable" : ""}`
4358
4355
  ).attr("tabindex", 0).style("position", "absolute").style("box-sizing", "border-box").style("width", `${2 * j}px`).style("height", `${2 * j}px`).style("border-radius", `${j}px`).style("pointer-events", "auto").on($.Click, (h) => {
@@ -4360,7 +4357,7 @@ class ni {
4360
4357
  }).on($.KeyDown, (h) => {
4361
4358
  o && h.key === Z.Enter && (h.preventDefault(), o(this.canvas));
4362
4359
  });
4363
- n.imageClass !== void 0 ? c.append("xhtml:div").style("position", "absolute").style("left", `${0.75 * j}px`).style("top", `${0.5 * j}px`).style("width", `${0.5 * j}px`).style("height", `${0.5 * j}px`).style("background-size", "contain").style("background-repeat", "no-repeat").attr("class", n.imageClass) : n.image !== void 0 && c.append("xhtml:img").style("position", "absolute").style("left", `${0.75 * j}px`).style("top", `${0.5 * j}px`).style("width", `${0.5 * j}px`).style("height", `${0.5 * j}px`).attr("src", n.image), c.append("xhtml:span").style("position", "absolute").style("left", `${0.2 * j}px`).style("top", `${1.1 * j}px`).style("text-align", "center").style("width", `${1.6 * j}px`).style("height", `${0.35 * j}px`).style("margin", "0").style("font-size", `${0.35 * j}px`).style("font-weight", "700").style("user-select", "none").text(n.name), c.transition().ease(x.easeLinear).duration(si).tween("progress", () => (h) => {
4360
+ n.imageClass !== void 0 ? c.append("xhtml:div").style("position", "absolute").style("left", `${0.75 * j}px`).style("top", `${0.5 * j}px`).style("width", `${0.5 * j}px`).style("height", `${0.5 * j}px`).style("background-size", "contain").style("background-repeat", "no-repeat").attr("class", n.imageClass) : n.image !== void 0 && c.append("xhtml:img").style("position", "absolute").style("left", `${0.75 * j}px`).style("top", `${0.5 * j}px`).style("width", `${0.5 * j}px`).style("height", `${0.5 * j}px`).attr("src", n.image), c.append("xhtml:span").style("position", "absolute").style("left", `${0.2 * j}px`).style("top", `${1.1 * j}px`).style("text-align", "center").style("width", `${1.6 * j}px`).style("height", `${0.35 * j}px`).style("margin", "0").style("font-size", `${0.35 * j}px`).style("font-weight", "700").style("user-select", "none").text(n.name), c.transition().ease(x.easeLinear).duration(ni).tween("progress", () => (h) => {
4364
4361
  const f = d * h;
4365
4362
  return c.style(
4366
4363
  "left",
@@ -4380,7 +4377,7 @@ class ni {
4380
4377
  this.contextMenuContainer?.remove(), this.contextMenuContainer = void 0;
4381
4378
  }
4382
4379
  }
4383
- class ri extends ft {
4380
+ class ai extends ft {
4384
4381
  /**
4385
4382
  * Constructs a user highlight object.
4386
4383
  * @public
@@ -4402,7 +4399,7 @@ class ri extends ft {
4402
4399
  * @param element
4403
4400
  */
4404
4401
  focusOn(t) {
4405
- this.clear(), this.focus = t, (t instanceof ht || t instanceof Ke) && t.rootElement ? this.focusOn(t.rootElement) : this.add(t);
4402
+ this.clear(), this.focus = t, (t instanceof ht || t instanceof qe) && t.rootElement ? this.focusOn(t.rootElement) : this.add(t);
4406
4403
  }
4407
4404
  add(t) {
4408
4405
  if (super.add(t), t instanceof z) {
@@ -4434,13 +4431,13 @@ class ri extends ft {
4434
4431
  this.focus = void 0;
4435
4432
  }
4436
4433
  }
4437
- const ai = 1;
4438
- class Je {
4434
+ const li = 1;
4435
+ class Qe {
4439
4436
  export(t, e = !1) {
4440
4437
  const a = {
4441
4438
  name: t.name,
4442
4439
  type: t.type,
4443
- typeVersion: ai,
4440
+ typeVersion: li,
4444
4441
  createdAt: t.createdAt,
4445
4442
  updatedAt: t.updatedAt,
4446
4443
  nodes: [],
@@ -4578,17 +4575,17 @@ class Je {
4578
4575
  } : {};
4579
4576
  }
4580
4577
  }
4581
- const li = "Diagram properties";
4582
- class di extends ft {
4578
+ const di = "Diagram properties";
4579
+ class ci extends ft {
4583
4580
  /**
4584
4581
  * Constructs a user selection object.
4585
4582
  * @public
4586
4583
  * @param canvas A canvas.
4587
4584
  */
4588
4585
  constructor(t, e) {
4589
- super(), this.canvas = t, this.canvas.propertyEditorChanges$.pipe(ao(2e3)).subscribe(() => {
4586
+ super(), this.canvas = t, this.canvas.propertyEditorChanges$.pipe(lo(2e3)).subscribe(() => {
4590
4587
  this.makeUpdateValuesAction();
4591
- }), console.log(e), this.diagramPropertiesText = e !== void 0 ? e : li;
4588
+ }), this.diagramPropertiesText = e !== void 0 ? e : di;
4592
4589
  }
4593
4590
  add(t) {
4594
4591
  if (!this.contains(t.id) && (this.length === 0 ? this.propertyEditorSelection === void 0 && (t instanceof z || t instanceof dt) ? this.openInPropertyEditor(t) : this.propertyEditorSelection === void 0 && t instanceof D ? this.openInPropertyEditor(t.node) : this.openInPropertyEditor(void 0) : this.openInPropertyEditor(void 0), super.add(t), t.updateInView(), t instanceof z && t.sections))
@@ -4637,7 +4634,7 @@ class di extends ft {
4637
4634
  const t = [], e = [], a = [], l = [], r = [];
4638
4635
  for (const n of this.all())
4639
4636
  n instanceof z ? t.push(n.id) : n instanceof D ? e.push(n.id) : n instanceof bt ? a.push(n.id) : n instanceof dt ? l.push(n.id) : n instanceof ht && r.push(n.id);
4640
- const i = new Ko(
4637
+ const i = new qo(
4641
4638
  this.canvas,
4642
4639
  t,
4643
4640
  e,
@@ -4653,7 +4650,7 @@ class di extends ft {
4653
4650
  * @public
4654
4651
  */
4655
4652
  copyToClipboard() {
4656
- const t = { type: "daga-user-selection", nodes: [], connections: [] }, e = new Je();
4653
+ const t = { type: "daga-user-selection", nodes: [], connections: [] }, e = new Qe();
4657
4654
  for (const a of this.all())
4658
4655
  a instanceof z && t.nodes.push(e.exportNode(a, !1)), a instanceof dt && t.connections.push(
4659
4656
  e.exportConnection(a, !1)
@@ -4677,7 +4674,7 @@ class di extends ft {
4677
4674
  const a = JSON.parse(e);
4678
4675
  if (a.type !== "daga-user-selection")
4679
4676
  return;
4680
- const l = new qo(
4677
+ const l = new Jo(
4681
4678
  this.canvas,
4682
4679
  a.nodes,
4683
4680
  a.connections,
@@ -4708,17 +4705,17 @@ class di extends ft {
4708
4705
  makeUpdateValuesAction() {
4709
4706
  if (this.propertyEditorSelection === void 0 || this.propertyEditorValues === void 0)
4710
4707
  return;
4711
- const t = this.propertyEditorSelection instanceof qe ? void 0 : this.propertyEditorSelection.id;
4708
+ const t = this.propertyEditorSelection instanceof Je ? void 0 : this.propertyEditorSelection.id;
4712
4709
  if (St(
4713
4710
  this.propertyEditorValues,
4714
4711
  this.propertyEditorSelection?.valueSet.getValues()
4715
4712
  ))
4716
4713
  return;
4717
- const e = this.propertyEditorValues, a = Nt(this.propertyEditorSelection?.valueSet.getValues()), [l, r] = Fe(
4714
+ const e = this.propertyEditorValues, a = Nt(this.propertyEditorSelection?.valueSet.getValues()), [l, r] = Ue(
4718
4715
  e,
4719
4716
  a,
4720
4717
  this.propertyEditorSelection?.valueSet
4721
- ), i = new Zo(
4718
+ ), i = new Ko(
4722
4719
  this.canvas,
4723
4720
  t,
4724
4721
  l,
@@ -4727,10 +4724,10 @@ class di extends ft {
4727
4724
  i.do(), this.canvas.actionStack.add(i), this.propertyEditorValues = a;
4728
4725
  }
4729
4726
  }
4730
- const ci = (s) => s * Math.PI / 180, ze = (s, t, e) => {
4731
- const a = ci(e), l = Math.sin(a), r = Math.cos(a), i = (Math.abs(s * r) - Math.abs(t * l)) / (r * r - l * l), n = (Math.abs(s * l) - Math.abs(t * r)) / (l * l - r * r);
4727
+ const hi = (s) => s * Math.PI / 180, ze = (s, t, e) => {
4728
+ const a = hi(e), l = Math.sin(a), r = Math.cos(a), i = (Math.abs(s * r) - Math.abs(t * l)) / (r * r - l * l), n = (Math.abs(s * l) - Math.abs(t * r)) / (l * l - r * r);
4732
4729
  return [i, n];
4733
- }, hi = 12, H = 6, gi = 25, ge = "diagram-connection-unfinished", Qt = class Qt {
4730
+ }, gi = (s) => /^((?!chrome|android).)*safari/i.test(s), Ve = gi(navigator.userAgent), fi = 12, H = 6, ui = 25, ge = "diagram-connection-unfinished", Qt = class Qt {
4734
4731
  /**
4735
4732
  * Constructs a canvas object.
4736
4733
  * @public
@@ -4738,24 +4735,24 @@ const ci = (s) => s * Math.PI / 180, ze = (s, t, e) => {
4738
4735
  * @param config The configuration object used to set the parameters of this canvas.
4739
4736
  */
4740
4737
  constructor(t, e) {
4741
- if (this.backgroundPatternId = `daga-background-pattern-id-${Qt.canvasCount++}`, this.zoomTransform = x.zoomIdentity, this.draggingFrom = [0, 0], this.dragging = !1, this.secondaryButton = !1, this.validatorChange$ = new jt(), this.diagramChange$ = new jt(), this.diagramEvent$ = new jt(), this.propertyEditorChanges$ = new jt(), this.parentComponent = t, this.model = new qe(
4738
+ if (this.backgroundPatternId = `daga-background-pattern-id-${Qt.canvasCount++}`, this.zoomTransform = x.zoomIdentity, this.draggingFrom = [0, 0], this.dragging = !1, this.secondaryButton = !1, this.validatorChange$ = new jt(), this.diagramChange$ = new jt(), this.diagramEvent$ = new jt(), this.propertyEditorChanges$ = new jt(), this.parentComponent = t, this.model = new Je(
4742
4739
  this,
4743
4740
  void 0,
4744
4741
  e.name || "unnamed",
4745
4742
  "",
4746
4743
  e.type || "",
4747
4744
  e.properties || []
4748
- ), this.userSelection = new di(
4745
+ ), this.userSelection = new ci(
4749
4746
  this,
4750
4747
  e.components?.propertyEditor?.title
4751
- ), this.userHighlight = new ri(
4748
+ ), this.userHighlight = new ai(
4752
4749
  this,
4753
4750
  e.canvas?.highlightSections !== !1
4754
- ), this.contextMenu = new ni(this, e.canvas?.contextMenu), this.backgroundColor = e.canvas?.backgroundColor || "#FFFFFF", this.gridStyle = e.canvas?.grid?.style ?? Rt.style, this.gridSize = e.canvas?.grid?.enabled === !1 || e.canvas?.grid === void 0 ? 0 : Math.abs(e.canvas?.grid?.spacing || Rt.spacing), this.gridThickness = Math.abs(
4755
- e.canvas?.grid?.thickness || Rt.thickness
4756
- ), this.gridColor = e.canvas?.grid?.color || Rt.color, this.snapToGrid = e.canvas?.grid?.enabled === !1 || e.canvas?.grid === void 0 ? !1 : e.canvas?.grid?.snap || Rt.snap, this.zoomFactor = e.canvas?.zoomFactor || 2, this.panRate = e.canvas?.panRate || 100, this.inferConnectionType = e.connectionSettings?.inferConnectionType || !1, this.autoTightenConnections = e.connectionSettings?.autoTighten !== !1, this.allowConnectionLoops = e.connectionSettings?.allowLoops || !1, this.allowSharingPorts = e.connectionSettings?.sharePorts !== !1, this.allowSharingBothPorts = e.connectionSettings?.shareBothPorts || !1, this.portHighlightRadius = e.connectionSettings?.portHighlightRadius || 100, this.multipleSelectionOn = !1, this.priorityThresholds = e.canvas?.priorityThresholds || [], this.priorityThreshold = this.priorityThresholds ? this.priorityThresholds[0] : void 0, this.layoutFormat = e.layoutFormat, this.userActions = e.userActions || {}, this.validators = [], this.actionStack = new Xo(this, gi), this.collabEngine = new Yo(this), e.nodeTypes)
4751
+ ), this.contextMenu = new ri(this, e.canvas?.contextMenu), this.backgroundColor = e.canvas?.backgroundColor || "#FFFFFF", this.gridStyle = e.canvas?.grid?.style ?? Vt.style, this.gridSize = e.canvas?.grid?.enabled === !1 || e.canvas?.grid === void 0 ? 0 : Math.abs(e.canvas?.grid?.spacing || Vt.spacing), this.gridThickness = Math.abs(
4752
+ e.canvas?.grid?.thickness || Vt.thickness
4753
+ ), this.gridColor = e.canvas?.grid?.color || Vt.color, this.snapToGrid = e.canvas?.grid?.enabled === !1 || e.canvas?.grid === void 0 ? !1 : e.canvas?.grid?.snap || Vt.snap, this.zoomFactor = e.canvas?.zoomFactor || 2, this.panRate = e.canvas?.panRate || 100, this.inferConnectionType = e.connectionSettings?.inferConnectionType || !1, this.autoTightenConnections = e.connectionSettings?.autoTighten !== !1, this.allowConnectionLoops = e.connectionSettings?.allowLoops || !1, this.allowSharingPorts = e.connectionSettings?.sharePorts !== !1, this.allowSharingBothPorts = e.connectionSettings?.shareBothPorts || !1, this.portHighlightRadius = e.connectionSettings?.portHighlightRadius || 100, this.multipleSelectionOn = !1, this.priorityThresholds = e.canvas?.priorityThresholds || [], this.priorityThreshold = this.priorityThresholds ? this.priorityThresholds[0] : void 0, this.layoutFormat = e.layoutFormat, this.userActions = e.userActions || {}, this.validators = [], this.actionStack = new jo(this, ui), this.collabEngine = new Xo(this), e.nodeTypes)
4757
4754
  for (const a of e.nodeTypes) {
4758
- const l = new Be({
4755
+ const l = new Ye({
4759
4756
  ...e.nodeTypeDefaults,
4760
4757
  ...a
4761
4758
  });
@@ -4763,7 +4760,7 @@ const ci = (s) => s * Math.PI / 180, ze = (s, t, e) => {
4763
4760
  }
4764
4761
  if (e.portTypes)
4765
4762
  for (const a of e.portTypes) {
4766
- const l = new Do({
4763
+ const l = new Bo({
4767
4764
  ...e.portTypeDefaults,
4768
4765
  ...a
4769
4766
  });
@@ -4771,7 +4768,7 @@ const ci = (s) => s * Math.PI / 180, ze = (s, t, e) => {
4771
4768
  }
4772
4769
  if (e.connectionTypes) {
4773
4770
  for (const a of e.connectionTypes) {
4774
- const l = new Ue({
4771
+ const l = new De({
4775
4772
  ...e.connectionTypeDefaults,
4776
4773
  ...a
4777
4774
  });
@@ -4872,8 +4869,8 @@ const ci = (s) => s * Math.PI / 180, ze = (s, t, e) => {
4872
4869
  this.selectCanvasElements().attr("transform", r), x.select(`#${this.backgroundPatternId}`).attr(
4873
4870
  "patternTransform",
4874
4871
  r
4875
- ), this.contextMenu.close(), this.diagramEvent$.next(
4876
- new Jo(
4872
+ ), Ve && this.updateFieldsInView(), this.contextMenu.close(), this.diagramEvent$.next(
4873
+ new Qo(
4877
4874
  [this.zoomTransform.x, this.zoomTransform.y],
4878
4875
  this.zoomTransform.k
4879
4876
  )
@@ -4904,7 +4901,7 @@ const ci = (s) => s * Math.PI / 180, ze = (s, t, e) => {
4904
4901
  }).on(I.End, (l) => {
4905
4902
  this.finishMultipleSelection(l);
4906
4903
  })
4907
- ), oi(this, a, this.backgroundPatternId), a.append("g").attr("class", "daga-canvas-elements");
4904
+ ), ii(this, a, this.backgroundPatternId), a.append("g").attr("class", "daga-canvas-elements");
4908
4905
  }
4909
4906
  getZoomLevel() {
4910
4907
  return this.zoomTransform.k;
@@ -5592,7 +5589,7 @@ const ci = (s) => s * Math.PI / 180, ze = (s, t, e) => {
5592
5589
  )
5593
5590
  ).attr("stroke", "transparent").attr("pointer-events", "stroke").attr(
5594
5591
  "stroke-width",
5595
- (n) => `${(n.look.thickness || et.look.thickness) + hi}px`
5592
+ (n) => `${(n.look.thickness || et.look.thickness) + fi}px`
5596
5593
  ).attr(
5597
5594
  "stroke-dasharray",
5598
5595
  (n) => pe(
@@ -5615,7 +5612,7 @@ const ci = (s) => s * Math.PI / 180, ze = (s, t, e) => {
5615
5612
  const a = e.exit(), l = e.enter().append("foreignObject").attr("id", (i) => i.id).attr("class", "diagram-field");
5616
5613
  t && t.length > 0 && (e = e.filter((i) => t.includes(i.id)));
5617
5614
  const r = l.merge(e);
5618
- a.remove(), l.style("box-sizing", "border-box").on($.MouseOver, (i, n) => {
5615
+ if (a.remove(), l.style("box-sizing", "border-box").on($.MouseOver, (i, n) => {
5619
5616
  this.dragging || (this.userHighlight.focusOn(n), this.diagramEvent$.next(new Q(n)));
5620
5617
  }).on($.Click, (i, n) => {
5621
5618
  if (!i.ctrlKey && !i.shiftKey) {
@@ -5652,7 +5649,7 @@ const ci = (s) => s * Math.PI / 180, ze = (s, t, e) => {
5652
5649
  n.width,
5653
5650
  n.height,
5654
5651
  n.fontSize,
5655
- n.fontFamily || V.fontFamily,
5652
+ n.fontFamily || R.fontFamily,
5656
5653
  n.orientation,
5657
5654
  (d) => {
5658
5655
  },
@@ -5707,18 +5704,25 @@ const ci = (s) => s * Math.PI / 180, ze = (s, t, e) => {
5707
5704
  (i) => i.selected ? i.selectedColor || "#000000" : i.color || "#000000"
5708
5705
  ).html(
5709
5706
  (i) => i.text.replace(/</g, "&lt;").replace(/>/g, "&gt;").replace(/\n/g, "<br/>")
5710
- );
5707
+ ), Ve) {
5708
+ const i = this.zoomTransform.k;
5709
+ r.attr("width", (n) => `${n.width * i}px`).attr("height", (n) => `${n.height * i}px`).select("div").style("position", "absolute").style(
5710
+ "left",
5711
+ (n) => `${n.coords[0] * i + this.zoomTransform.x}px`
5712
+ ).style(
5713
+ "top",
5714
+ (n) => `${n.coords[1] * i + this.zoomTransform.y}px`
5715
+ ).select("p").style("font-size", (n) => `${n.fontSize * i}px`);
5716
+ }
5711
5717
  }
5712
5718
  updateObjectsInView(...t) {
5713
- let e = this.selectCanvasElements().selectAll(
5714
- "foreignObject.diagram-object"
5715
- ).data(
5719
+ let e = this.selectCanvasElements().selectAll("g.diagram-object").data(
5716
5720
  this.model.objects.filter(
5717
5721
  (i) => this.priorityThreshold !== void 0 ? i.getPriority() >= this.priorityThreshold : !0
5718
5722
  ),
5719
5723
  (i) => i.id
5720
5724
  );
5721
- const a = e.exit(), l = e.enter().append("foreignObject").attr("id", (i) => i.id).attr("class", "diagram-object");
5725
+ const a = e.exit(), l = e.enter().append("g").attr("id", (i) => i.id).attr("class", "diagram-object");
5722
5726
  t && t.length > 0 && (e = e.filter((i) => t.includes(i.id))), l.merge(e).attr("width", (i) => `${i.width}px`).attr("height", (i) => `${i.height}px`).attr("transform", (i) => `translate(${i.coords[0]},${i.coords[1]})`).html((i) => i.html), a.remove(), l.on($.ContextMenu, (i, n) => {
5723
5727
  if (this.dragging) {
5724
5728
  i.preventDefault(), i.stopPropagation(), this.dragging = !1;
@@ -5740,15 +5744,13 @@ const ci = (s) => s * Math.PI / 180, ze = (s, t, e) => {
5740
5744
  );
5741
5745
  }
5742
5746
  updateDecoratorsInView(...t) {
5743
- let e = this.selectCanvasElements().selectAll(
5744
- "foreignObject.diagram-decorator"
5745
- ).data(
5747
+ let e = this.selectCanvasElements().selectAll("g.diagram-decorator").data(
5746
5748
  this.model.decorators.filter(
5747
5749
  (i) => this.priorityThreshold !== void 0 ? i.getPriority() >= this.priorityThreshold : !0
5748
5750
  ),
5749
5751
  (i) => i.id
5750
5752
  );
5751
- const a = e.exit(), l = e.enter().append("foreignObject").attr("id", (i) => i.id).attr("class", "diagram-decorator");
5753
+ const a = e.exit(), l = e.enter().append("g").attr("id", (i) => i.id).attr("class", "diagram-decorator");
5752
5754
  t && t.length > 0 && (e = e.filter((i) => t.includes(i.id))), l.merge(e).attr("width", (i) => `${i.width}px`).attr("height", (i) => `${i.height}px`).attr("transform", (i) => `translate(${i.coords[0]},${i.coords[1]})`).html((i) => i.html), a.remove(), l.on($.MouseOver, (i, n) => {
5753
5755
  this.dragging || (this.userHighlight.focusOn(n), this.diagramEvent$.next(new Q(n)));
5754
5756
  }).on($.Click, (i, n) => {
@@ -5815,7 +5817,7 @@ const ci = (s) => s * Math.PI / 180, ze = (s, t, e) => {
5815
5817
  const e = this.selectCanvasView().select(
5816
5818
  `[id='${ue(t.id)}']`
5817
5819
  ), l = e.select("path").node(), r = {
5818
- ...V,
5820
+ ...R,
5819
5821
  ...t.type.label
5820
5822
  };
5821
5823
  if (l) {
@@ -5863,7 +5865,7 @@ const ci = (s) => s * Math.PI / 180, ze = (s, t, e) => {
5863
5865
  ).style("font-kerning", "none").text(t.startLabel);
5864
5866
  const y = e.select("g.diagram-connection-start-label text").node()?.getBoundingClientRect();
5865
5867
  if (y) {
5866
- const u = t.startLabel ? y.width / this.zoomTransform.k + Ot(r) + Ht(r) : 0, k = t.startLabel ? y.height / this.zoomTransform.k + _t(r) + Vt(r) : 0;
5868
+ const u = t.startLabel ? y.width / this.zoomTransform.k + Ot(r) + Ht(r) : 0, k = t.startLabel ? y.height / this.zoomTransform.k + _t(r) + Rt(r) : 0;
5867
5869
  let b;
5868
5870
  switch (t.startDirection) {
5869
5871
  case g.Left:
@@ -5915,7 +5917,7 @@ const ci = (s) => s * Math.PI / 180, ze = (s, t, e) => {
5915
5917
  ).style("font-kerning", "none").text(t.middleLabel);
5916
5918
  const m = e.select("g.diagram-connection-middle-label text").node()?.getBoundingClientRect();
5917
5919
  if (m) {
5918
- const u = t.middleLabel ? m.width / this.zoomTransform.k + Ot(r) + Ht(r) : 0, k = t.middleLabel ? m.height / this.zoomTransform.k + _t(r) + Vt(r) : 0, b = l.getPointAtLength(i / 2);
5920
+ const u = t.middleLabel ? m.width / this.zoomTransform.k + Ot(r) + Ht(r) : 0, k = t.middleLabel ? m.height / this.zoomTransform.k + _t(r) + Rt(r) : 0, b = l.getPointAtLength(i / 2);
5919
5921
  e.select("g.diagram-connection-middle-label path").attr(
5920
5922
  "d",
5921
5923
  Kt(
@@ -5935,7 +5937,7 @@ const ci = (s) => s * Math.PI / 180, ze = (s, t, e) => {
5935
5937
  ).style("font-kerning", "none").text(t.endLabel);
5936
5938
  const p = e.select("g.diagram-connection-end-label text").node()?.getBoundingClientRect();
5937
5939
  if (p) {
5938
- const u = t.endLabel ? p.width / this.zoomTransform.k + Ot(r) + Ht(r) : 0, k = t.endLabel ? p.height / this.zoomTransform.k + _t(r) + Vt(r) : 0;
5940
+ const u = t.endLabel ? p.width / this.zoomTransform.k + Ot(r) + Ht(r) : 0, k = t.endLabel ? p.height / this.zoomTransform.k + _t(r) + Rt(r) : 0;
5939
5941
  let b;
5940
5942
  switch (t.endDirection) {
5941
5943
  case g.Left:
@@ -6184,7 +6186,7 @@ const ci = (s) => s * Math.PI / 180, ze = (s, t, e) => {
6184
6186
  }
6185
6187
  }).on($.Input, () => {
6186
6188
  const p = h.property("value");
6187
- h.attr("cols", So(p) + 1), h.attr("rows", Co(p) + 1), h.style("width", ""), h.style("height", ""), f = h.property("scrollWidth") + 1, y = h.property("scrollHeight") + 1;
6189
+ h.attr("cols", Co(p) + 1), h.attr("rows", $o(p) + 1), h.style("width", ""), h.style("height", ""), f = h.property("scrollWidth") + 1, y = h.property("scrollHeight") + 1;
6188
6190
  const u = Math.max(f, a), k = Math.max(y, l);
6189
6191
  c?.attr("width", `${u}px`), h.style("width", `${u}px`), c?.attr("height", `${k}px`), h.style("height", `${k}px`), o && o(p);
6190
6192
  }).on($.Click, (p) => {
@@ -6276,11 +6278,11 @@ const ci = (s) => s * Math.PI / 180, ze = (s, t, e) => {
6276
6278
  e.move(a);
6277
6279
  const r = this.model.nodes.getAtCoordinates(t.x, t.y).filter((o) => o.id !== e.id && !o.isDescendantOf(e)).filter(
6278
6280
  (o) => o.type.childrenTypes.includes(e.type.id)
6279
- ), i = Ye(
6281
+ ), i = Xe(
6280
6282
  r
6281
6283
  ), n = i[i.length - 1];
6282
6284
  if (n !== e.parent && (e.type.canBeParentless || n !== void 0)) {
6283
- const o = n?.getLastAncestor(), d = this.currentAction.from, c = new Wo(
6285
+ const o = n?.getLastAncestor(), d = this.currentAction.from, c = new Zo(
6284
6286
  this,
6285
6287
  e.id,
6286
6288
  e.parent?.id,
@@ -6326,7 +6328,7 @@ const ci = (s) => s * Math.PI / 180, ze = (s, t, e) => {
6326
6328
  const e = this.getPointerLocationRelativeToCanvas(t);
6327
6329
  this.multipleSelectionContainer?.remove(), this.multipleSelectionContainer = void 0, this.userSelection.clear();
6328
6330
  for (const a of this.model.nodes)
6329
- go(
6331
+ fo(
6330
6332
  [
6331
6333
  a.coords,
6332
6334
  [a.coords[0] + a.width, a.coords[1] + a.height]
@@ -6340,7 +6342,7 @@ const ci = (s) => s * Math.PI / 180, ze = (s, t, e) => {
6340
6342
  };
6341
6343
  Qt.canvasCount = 0;
6342
6344
  let ye = Qt;
6343
- class Qe {
6345
+ class to {
6344
6346
  constructor() {
6345
6347
  this.grid = [[void 0]], this.offsetX = 0, this.offsetY = 0;
6346
6348
  }
@@ -6452,16 +6454,16 @@ class Qe {
6452
6454
  }
6453
6455
  }
6454
6456
  }
6455
- class fi {
6457
+ class pi {
6456
6458
  constructor(t) {
6457
6459
  this.gapSize = t;
6458
6460
  }
6459
6461
  apply(t) {
6460
6462
  if (t.nodes.length === 0)
6461
6463
  return t;
6462
- const e = new Qe(), a = t.nodes.filter((n) => !n.parent);
6464
+ const e = new to(), a = t.nodes.filter((n) => !n.parent);
6463
6465
  for (; a.length > 0; )
6464
- to(
6466
+ eo(
6465
6467
  a[0],
6466
6468
  e,
6467
6469
  [0, 0],
@@ -6479,25 +6481,25 @@ class fi {
6479
6481
  return t;
6480
6482
  }
6481
6483
  }
6482
- const to = (s, t, e, a) => {
6484
+ const eo = (s, t, e, a) => {
6483
6485
  const l = t.getClosestEmptyCoordinate(e);
6484
6486
  t.set(l, s), Y(a, s);
6485
6487
  for (const r of s.getAdjacentNodes())
6486
- a.includes(r) && to(
6488
+ a.includes(r) && eo(
6487
6489
  r,
6488
6490
  t,
6489
6491
  l,
6490
6492
  a
6491
6493
  );
6492
6494
  };
6493
- class ui {
6495
+ class mi {
6494
6496
  constructor(t) {
6495
6497
  this.gapSize = t;
6496
6498
  }
6497
6499
  apply(t) {
6498
6500
  if (t.nodes.length === 0)
6499
6501
  return t;
6500
- const e = new Qe(), a = t.nodes.filter((c) => !c.parent), l = {}, r = a[0];
6502
+ const e = new to(), a = t.nodes.filter((c) => !c.parent), l = {}, r = a[0];
6501
6503
  let i = [r];
6502
6504
  for (l[r.id] = [0, 0]; a.length > 0; ) {
6503
6505
  const c = [];
@@ -6565,7 +6567,7 @@ class ne {
6565
6567
  return t;
6566
6568
  }
6567
6569
  }
6568
- class pi {
6570
+ class vi {
6569
6571
  constructor(t) {
6570
6572
  this.gapSize = t;
6571
6573
  }
@@ -6592,7 +6594,7 @@ class pi {
6592
6594
  ], u = [
6593
6595
  m.coords[0] + m.width / 2,
6594
6596
  m.coords[1] + m.height / 2
6595
- ], k = He(
6597
+ ], k = _e(
6596
6598
  f.coords,
6597
6599
  m.coords
6598
6600
  ), b = [m.coords[0], m.coords[1]];
@@ -6618,7 +6620,7 @@ class pi {
6618
6620
  return t;
6619
6621
  }
6620
6622
  }
6621
- class mi {
6623
+ class yi {
6622
6624
  constructor(t) {
6623
6625
  this.gapSize = t;
6624
6626
  }
@@ -6633,7 +6635,7 @@ class mi {
6633
6635
  return t;
6634
6636
  }
6635
6637
  }
6636
- class vi {
6638
+ class bi {
6637
6639
  constructor(t) {
6638
6640
  this.gapSize = t;
6639
6641
  }
@@ -6700,7 +6702,7 @@ class vi {
6700
6702
  return t;
6701
6703
  }
6702
6704
  }
6703
- class yi {
6705
+ class ki {
6704
6706
  constructor(t) {
6705
6707
  this.gapSize = t;
6706
6708
  }
@@ -6719,11 +6721,11 @@ class yi {
6719
6721
  const c = r[0];
6720
6722
  r.splice(0, 1);
6721
6723
  const h = new Se(void 0, c);
6722
- eo(h, r), i.push(h);
6724
+ oo(h, r), i.push(h);
6723
6725
  }
6724
6726
  const n = [];
6725
6727
  for (const c of i)
6726
- n.push([c]), oo(c, n, n.length);
6728
+ n.push([c]), io(c, n, n.length);
6727
6729
  const o = Math.max(...t.nodes.map((c) => c.height));
6728
6730
  let d = 0;
6729
6731
  for (let c = 0; c < n.length; ++c) {
@@ -6742,21 +6744,21 @@ class yi {
6742
6744
  return t;
6743
6745
  }
6744
6746
  }
6745
- const eo = (s, t) => {
6747
+ const oo = (s, t) => {
6746
6748
  for (const e of s.node.getAdjacentNodes().sort((a, l) => l.getPriority() - a.getPriority())) {
6747
6749
  const a = t.indexOf(e);
6748
6750
  if (a >= 0) {
6749
6751
  t.splice(a, 1);
6750
6752
  const l = s.addBranch(e);
6751
- eo(l, t);
6753
+ oo(l, t);
6752
6754
  }
6753
6755
  }
6754
- }, oo = (s, t, e) => {
6756
+ }, io = (s, t, e) => {
6755
6757
  if (s.branches.length > 0) {
6756
6758
  for (; e >= t.length; )
6757
6759
  t.push([]);
6758
6760
  for (const a of s.branches)
6759
- t[e].push(a), oo(a, t, e + 1);
6761
+ t[e].push(a), io(a, t, e + 1);
6760
6762
  }
6761
6763
  };
6762
6764
  class Se {
@@ -6778,7 +6780,7 @@ class Se {
6778
6780
  }
6779
6781
  }
6780
6782
  }
6781
- class bi {
6783
+ class wi {
6782
6784
  constructor(t) {
6783
6785
  this.gapSize = t;
6784
6786
  }
@@ -6794,16 +6796,16 @@ class bi {
6794
6796
  }
6795
6797
  }
6796
6798
  const Re = {
6797
- adjacency: new fi(),
6799
+ adjacency: new pi(),
6798
6800
  breadth: new ne(),
6799
- "breadth-adjacency": new ui(),
6800
- force: new pi(),
6801
- horizontal: new mi(),
6802
- priority: new vi(),
6803
- tree: new yi(),
6804
- vertical: new bi()
6805
- }, ki = Oe({}), $t = Oe({});
6806
- class wi {
6801
+ "breadth-adjacency": new mi(),
6802
+ force: new vi(),
6803
+ horizontal: new yi(),
6804
+ priority: new bi(),
6805
+ tree: new ki(),
6806
+ vertical: new wi()
6807
+ }, Si = He({}), $t = He({});
6808
+ class Ci {
6807
6809
  constructor(t, e) {
6808
6810
  this.onTitleChange = t, this.onValueSetChange = e;
6809
6811
  }
@@ -6867,10 +6869,10 @@ const Ce = ({
6867
6869
  children: /* @__PURE__ */ v("div", { className: f() })
6868
6870
  }
6869
6871
  ) });
6870
- }, Si = () => {
6872
+ }, $i = () => {
6871
6873
  const s = Ut($t), t = rt(null), [e, a] = U([]);
6872
- lo(s.validatorChange$, s.diagramChange$).pipe(
6873
- co(() => l())
6874
+ co(s.validatorChange$, s.diagramChange$).pipe(
6875
+ ho(() => l())
6874
6876
  ).subscribe();
6875
6877
  const l = () => {
6876
6878
  a([]);
@@ -6924,7 +6926,7 @@ const Ce = ({
6924
6926
  n
6925
6927
  )) }) })
6926
6928
  ] }) });
6927
- }, Ci = 200, Ve = (s) => (s || "").toLowerCase().normalize("NFD").replace(/[\u0300-\u036f]/g, ""), io = ({
6929
+ }, Ii = 200, Oe = (s) => (s || "").toLowerCase().normalize("NFD").replace(/[\u0300-\u036f]/g, ""), so = ({
6928
6930
  disabled: s,
6929
6931
  options: t,
6930
6932
  value: e,
@@ -6952,7 +6954,7 @@ const Ce = ({
6952
6954
  n === void 0 ? (P(t.length - 1), E(t.length - 1)) : (P(n - 1), E(n)), A.preventDefault();
6953
6955
  break;
6954
6956
  case Z.Escape:
6955
- R(), A.preventDefault();
6957
+ V(), A.preventDefault();
6956
6958
  break;
6957
6959
  case Z.Enter:
6958
6960
  O(t[n || 0]), A.preventDefault();
@@ -6962,10 +6964,10 @@ const Ce = ({
6962
6964
  }
6963
6965
  }, N = () => {
6964
6966
  if (!s) {
6965
- const A = Ve(r.trim());
6967
+ const A = Oe(r.trim());
6966
6968
  d([]), h([]), y([]), p([]);
6967
6969
  for (const _ of t) {
6968
- const q = Ve(_.label).indexOf(A);
6970
+ const q = Oe(_.label).indexOf(A);
6969
6971
  if (q >= 0) {
6970
6972
  const Bt = _.label.substring(0, q), J = _.label.substring(
6971
6973
  q,
@@ -6987,7 +6989,7 @@ const Ce = ({
6987
6989
  }
6988
6990
  k(!0);
6989
6991
  }
6990
- }, R = () => {
6992
+ }, V = () => {
6991
6993
  k(!1);
6992
6994
  }, P = (A) => {
6993
6995
  if (!s) {
@@ -6997,8 +6999,8 @@ const Ce = ({
6997
6999
  }
6998
7000
  }, tt = () => {
6999
7001
  setTimeout(() => {
7000
- R();
7001
- }, Ci);
7002
+ V();
7003
+ }, Ii);
7002
7004
  }, E = (A) => {
7003
7005
  const _ = l.current?.querySelectorAll("li")[A];
7004
7006
  _ && _.scrollIntoView({ block: "center" });
@@ -7047,7 +7049,7 @@ const Ce = ({
7047
7049
  ]
7048
7050
  }
7049
7051
  );
7050
- }, $i = (s, t) => s.find((e) => e.key === t)?.label || `${t}`, Ii = ({
7052
+ }, Ai = (s, t) => s.find((e) => e.key === t)?.label || `${t}`, xi = ({
7051
7053
  disabled: s,
7052
7054
  allowRepeats: t,
7053
7055
  options: e,
@@ -7056,7 +7058,7 @@ const Ce = ({
7056
7058
  }) => {
7057
7059
  const [r, i] = U(), [n, o] = U([]), [d, c] = U([]);
7058
7060
  Ct(() => {
7059
- const u = a.length === 0, k = a.map((b) => $i(e, b));
7061
+ const u = a.length === 0, k = a.map((b) => Ai(e, b));
7060
7062
  o(k), u && l(a), p();
7061
7063
  }, [a, e]);
7062
7064
  const h = (u) => {
@@ -7092,7 +7094,7 @@ const Ce = ({
7092
7094
  ] }, k)),
7093
7095
  !s && /* @__PURE__ */ M("div", { className: "daga-value-item-input", children: [
7094
7096
  /* @__PURE__ */ v("div", { className: "daga-input daga-relatively-positioned", children: /* @__PURE__ */ v(
7095
- io,
7097
+ so,
7096
7098
  {
7097
7099
  disabled: s,
7098
7100
  options: t ? e || [] : d || [],
@@ -7103,7 +7105,7 @@ const Ce = ({
7103
7105
  /* @__PURE__ */ v("button", { className: "daga-property-button", onClick: y, children: /* @__PURE__ */ v("div", { className: "daga-icon daga-add-icon" }) })
7104
7106
  ] })
7105
7107
  ] });
7106
- }, Ai = ({
7108
+ }, Li = ({
7107
7109
  disabled: s,
7108
7110
  allowRepeats: t,
7109
7111
  value: e,
@@ -7129,7 +7131,7 @@ const Ce = ({
7129
7131
  }, h = (f) => {
7130
7132
  f.key === "Enter" && d();
7131
7133
  };
7132
- return /* @__PURE__ */ M(ro, { children: [
7134
+ return /* @__PURE__ */ M(ao, { children: [
7133
7135
  e.map((f, y) => /* @__PURE__ */ M("div", { className: "daga-value-item-element", children: [
7134
7136
  /* @__PURE__ */ v(
7135
7137
  "input",
@@ -7166,7 +7168,7 @@ const Ce = ({
7166
7168
  /* @__PURE__ */ v("button", { className: "daga-property-button", onClick: d, children: /* @__PURE__ */ v("div", { className: "daga-icon daga-add-icon" }) })
7167
7169
  ] })
7168
7170
  ] });
7169
- }, xi = ({
7171
+ }, Ei = ({
7170
7172
  disabled: s,
7171
7173
  value: t,
7172
7174
  onChange: e
@@ -7180,26 +7182,26 @@ const Ce = ({
7180
7182
  const N = b === "blur" ? k.trim() : k;
7181
7183
  if (b === "blur") {
7182
7184
  if (u !== N) {
7183
- const R = {};
7185
+ const V = {};
7184
7186
  Object.keys(t).forEach((P) => {
7185
- P === u ? R[N] = t[P] : R[P] = t[P];
7186
- }), e(R), o((P) => {
7187
+ P === u ? V[N] = t[P] : V[P] = t[P];
7188
+ }), e(V), o((P) => {
7187
7189
  const tt = { ...P };
7188
7190
  return delete tt[u], tt;
7189
7191
  });
7190
7192
  }
7191
7193
  } else
7192
- o((R) => ({
7193
- ...R,
7194
+ o((V) => ({
7195
+ ...V,
7194
7196
  [u]: k
7195
7197
  }));
7196
7198
  }, h = (u, k, b) => {
7197
7199
  const N = b === "blur" ? k.trim() : k;
7198
7200
  if (N !== "") {
7199
- const R = {};
7201
+ const V = {};
7200
7202
  Object.keys(t).forEach((P) => {
7201
- P === u ? R[P] = N : R[P] = t[P];
7202
- }), e(R);
7203
+ P === u ? V[P] = N : V[P] = t[P];
7204
+ }), e(V);
7203
7205
  }
7204
7206
  }, f = () => {
7205
7207
  const u = a.trim(), k = r.trim();
@@ -7281,7 +7283,7 @@ const Ce = ({
7281
7283
  /* @__PURE__ */ v("button", { className: "daga-property-button", onClick: f, children: /* @__PURE__ */ v("div", { className: "daga-icon daga-add-icon" }) })
7282
7284
  ] })
7283
7285
  ] });
7284
- }, so = ({
7286
+ }, no = ({
7285
7287
  valueSet: s,
7286
7288
  onValueChange: t,
7287
7289
  depth: e
@@ -7421,7 +7423,7 @@ const Ce = ({
7421
7423
  )
7422
7424
  ] }),
7423
7425
  o.type === T.Option && /* @__PURE__ */ v("div", { className: "daga-relatively-positioned", children: /* @__PURE__ */ v(
7424
- io,
7426
+ so,
7425
7427
  {
7426
7428
  disabled: o.editable === !1 || !l,
7427
7429
  options: o.options || [],
@@ -7430,7 +7432,7 @@ const Ce = ({
7430
7432
  }
7431
7433
  ) }),
7432
7434
  (o.type === T.OptionList || o.type === T.OptionSet) && /* @__PURE__ */ v(
7433
- Ii,
7435
+ xi,
7434
7436
  {
7435
7437
  disabled: o.editable === !1 || !l,
7436
7438
  allowRepeats: o.type === T.OptionList,
@@ -7440,7 +7442,7 @@ const Ce = ({
7440
7442
  }
7441
7443
  ),
7442
7444
  (o.type === T.TextList || o.type === T.TextSet) && /* @__PURE__ */ v(
7443
- Ai,
7445
+ Li,
7444
7446
  {
7445
7447
  disabled: o.editable === !1 || !l,
7446
7448
  allowRepeats: o.type === T.TextList,
@@ -7449,7 +7451,7 @@ const Ce = ({
7449
7451
  }
7450
7452
  ),
7451
7453
  o.type === T.TextMap && /* @__PURE__ */ v(
7452
- xi,
7454
+ Ei,
7453
7455
  {
7454
7456
  disabled: o.editable === !1 || !l,
7455
7457
  value: s?.getValue(o.name),
@@ -7457,7 +7459,7 @@ const Ce = ({
7457
7459
  }
7458
7460
  ),
7459
7461
  o.type === T.Object && /* @__PURE__ */ v("div", { className: "daga-left-bar", children: /* @__PURE__ */ v(
7460
- so,
7462
+ no,
7461
7463
  {
7462
7464
  valueSet: s.getSubValueSet(o.name),
7463
7465
  onValueChange: t,
@@ -7468,7 +7470,7 @@ const Ce = ({
7468
7470
  },
7469
7471
  o.name
7470
7472
  )) });
7471
- }, no = ({ valueSet: s, depth: t }) => {
7473
+ }, ro = ({ valueSet: s, depth: t }) => {
7472
7474
  const e = Ut($t), a = rt(null), l = (o) => "daga-property-name-" + o.replace(/\s/g, ""), r = () => {
7473
7475
  for (const o of s?.displayedProperties || []) {
7474
7476
  let d = 0, c = 0, h = 0;
@@ -7531,7 +7533,7 @@ const Ce = ({
7531
7533
  if (s === void 0)
7532
7534
  return;
7533
7535
  let d;
7534
- o instanceof Eo ? d = o : o instanceof Event ? d = s?.propertySet.getProperty(
7536
+ o instanceof Mo ? d = o : o instanceof Event ? d = s?.propertySet.getProperty(
7535
7537
  o.target?.value || ""
7536
7538
  ) : d = s?.propertySet.getProperty(o || ""), d && s?.hideProperty(d), r();
7537
7539
  };
@@ -7561,9 +7563,9 @@ const Ce = ({
7561
7563
  )
7562
7564
  ] })
7563
7565
  ] }),
7564
- o.type !== T.Object && /* @__PURE__ */ v("div", { className: "daga-property-value", children: Li(s?.getValue(o.name)) }),
7566
+ o.type !== T.Object && /* @__PURE__ */ v("div", { className: "daga-property-value", children: Mi(s?.getValue(o.name)) }),
7565
7567
  o.type === T.Object && /* @__PURE__ */ v(
7566
- no,
7568
+ ro,
7567
7569
  {
7568
7570
  valueSet: s?.getSubValueSet(o.name),
7569
7571
  depth: t + 1
@@ -7583,7 +7585,7 @@ const Ce = ({
7583
7585
  o.name
7584
7586
  ))
7585
7587
  ] });
7586
- }, Li = (s) => Array.isArray(s) ? s.join(", ") : Mo(s) ? Object.entries(s).map((t) => t.map((e) => JSON.stringify(e)).join(": ")).join(", ") : s instanceof Date ? s.toLocaleString() : s == null ? "" : "" + s, Ei = ({ location: s, direction: t, width: e, height: a, title: l, valueSet: r, onValueChange: i }) => {
7588
+ }, Mi = (s) => Array.isArray(s) ? s.join(", ") : To(s) ? Object.entries(s).map((t) => t.map((e) => JSON.stringify(e)).join(": ")).join(", ") : s instanceof Date ? s.toLocaleString() : s == null ? "" : "" + s, Ti = ({ location: s, direction: t, width: e, height: a, title: l, valueSet: r, onValueChange: i }) => {
7587
7589
  const n = rt(null), [o, d] = U(!1), [c, h] = U(!1), f = () => x.select(n.current);
7588
7590
  return Ct(() => {
7589
7591
  if (n.current)
@@ -7635,19 +7637,19 @@ const Ce = ({
7635
7637
  )
7636
7638
  ] }),
7637
7639
  !c && /* @__PURE__ */ v(
7638
- so,
7640
+ no,
7639
7641
  {
7640
7642
  valueSet: r,
7641
7643
  onValueChange: i,
7642
7644
  depth: 0
7643
7645
  }
7644
7646
  ),
7645
- c && /* @__PURE__ */ v(no, { valueSet: r, depth: 0 })
7647
+ c && /* @__PURE__ */ v(ro, { valueSet: r, depth: 0 })
7646
7648
  ] }) })
7647
7649
  ]
7648
7650
  }
7649
7651
  ) });
7650
- }, Mi = 6, Ti = (s) => {
7652
+ }, Ni = 6, Pi = (s) => {
7651
7653
  const t = Ut($t), [e, a] = U(
7652
7654
  s.currentPalette || s.palettes[0]
7653
7655
  ), [l, r] = U(0), [i, n] = U(
@@ -7682,7 +7684,7 @@ const Ce = ({
7682
7684
  }, y = (p, u, k) => {
7683
7685
  if (l !== void 0 && p.priority < l)
7684
7686
  return;
7685
- const b = p.defaultLook.lookType === "shaped-look" ? p.defaultLook.borderThickness || 1 : 0, N = p.defaultHeight + b, R = p.defaultWidth + b, P = u.height || N, tt = u.width || R, E = c().append("div").attr(
7687
+ const b = p.defaultLook.lookType === "shaped-look" ? p.defaultLook.borderThickness || 1 : 0, N = p.defaultHeight + b, V = p.defaultWidth + b, P = u.height || N, tt = u.width || V, E = c().append("div").attr(
7686
7688
  "class",
7687
7689
  `daga-template-container ${k !== void 0 ? k : ""}`
7688
7690
  ).style("width", `${tt}px`).style("height", `${P}px`).call(
@@ -7734,12 +7736,12 @@ const Ce = ({
7734
7736
  lt[1]
7735
7737
  ).filter(
7736
7738
  (Xt) => Xt.type.childrenTypes.includes(p.id)
7737
- ), wt = Ye(
7739
+ ), wt = Xe(
7738
7740
  J
7739
7741
  ), nt = wt[wt.length - 1];
7740
7742
  if (!p.canBeParentless && nt === void 0)
7741
7743
  return;
7742
- const Yt = nt?.getLastAncestor(), $e = new jo(
7744
+ const Yt = nt?.getLastAncestor(), $e = new Wo(
7743
7745
  t,
7744
7746
  p,
7745
7747
  q,
@@ -7753,7 +7755,7 @@ const Ce = ({
7753
7755
  $e.do(), t?.actionStack.add($e), S();
7754
7756
  }
7755
7757
  })
7756
- ).append("svg").attr("class", `palette-node ${p.id}`).attr("viewBox", `0 0 ${R} ${N}`).attr("preserveAspectRatio", "none").style("position", "relative").style("left", 0).style("top", 0).style("width", `${tt}px`).style("height", `${P}px`), C = u.look || p.defaultLook;
7758
+ ).append("svg").attr("class", `palette-node ${p.id}`).attr("viewBox", `0 0 ${V} ${N}`).attr("preserveAspectRatio", "none").style("position", "relative").style("left", 0).style("top", 0).style("width", `${tt}px`).style("height", `${P}px`), C = u.look || p.defaultLook;
7757
7759
  switch (C.lookType) {
7758
7760
  case "shaped-look":
7759
7761
  E.append("path").attr(
@@ -7800,7 +7802,7 @@ const Ce = ({
7800
7802
  ).html(O.html);
7801
7803
  if (u.label) {
7802
7804
  const O = {
7803
- ...V,
7805
+ ...R,
7804
7806
  ...p.label,
7805
7807
  ...u.labelLook
7806
7808
  };
@@ -7828,7 +7830,7 @@ const Ce = ({
7828
7830
  )
7829
7831
  ).attr("fill", u.backgroundColor).attr("stroke", "black").attr("stroke-width", "1px"), u.icon !== "" && b.append("image").attr("x", 0).attr("y", 0).attr("width", u.width).attr("height", u.height).attr("href", u.icon), u.label !== "" && b.append("text").attr(
7830
7832
  "transform",
7831
- `translate(${u.width / 2},${u.height / 2 + Mi})`
7833
+ `translate(${u.width / 2},${u.height / 2 + Ni})`
7832
7834
  ).attr("x", 0).attr("y", 0).attr("font-size", "20px").attr("text-anchor", "middle").attr("font-family", "'Wonder Unit Sans', sans-serif").attr("font-weight", 400).attr("fill", "#000000").attr("stroke", "none").style("font-kerning", "none").style("user-select", "none").text(u.label);
7833
7835
  };
7834
7836
  return Ct(() => {
@@ -7876,7 +7878,7 @@ const Ce = ({
7876
7878
  ]
7877
7879
  }
7878
7880
  ) });
7879
- }, Ni = ({
7881
+ }, zi = ({
7880
7882
  location: s,
7881
7883
  direction: t,
7882
7884
  enableAction: e,
@@ -7923,7 +7925,7 @@ const Ce = ({
7923
7925
  }, 500);
7924
7926
  }, b = Ut($t), N = () => {
7925
7927
  b.zoomBy(b.zoomFactor);
7926
- }, R = () => {
7928
+ }, V = () => {
7927
7929
  b.zoomBy(1 / b.zoomFactor);
7928
7930
  }, P = () => {
7929
7931
  b.center();
@@ -7954,7 +7956,7 @@ const Ce = ({
7954
7956
  p.current
7955
7957
  ).classed("daga-on", !0).classed("daga-off", !1);
7956
7958
  const J = b.diagramEvent$.subscribe((wt) => {
7957
- wt.type === Ze.Selection && (x.select(
7959
+ wt.type === Ke.Selection && (x.select(
7958
7960
  p.current
7959
7961
  ).classed("daga-on", !1).classed("daga-off", !0), J.unsubscribe());
7960
7962
  });
@@ -7965,7 +7967,7 @@ const Ce = ({
7965
7967
  className: `daga-diagram-buttons daga-${s} daga-${t}`,
7966
7968
  children: [
7967
7969
  i && b.canUserPerformAction(w.Zoom) && /* @__PURE__ */ v("button", { className: "daga-zoom-in", onClick: N, children: /* @__PURE__ */ v("span", { className: "daga-tooltip", children: "Zoom in" }) }),
7968
- i && b.canUserPerformAction(w.Zoom) && /* @__PURE__ */ v("button", { className: "daga-zoom-out", onClick: R, children: /* @__PURE__ */ v("span", { className: "daga-tooltip", children: "Zoom out" }) }),
7970
+ i && b.canUserPerformAction(w.Zoom) && /* @__PURE__ */ v("button", { className: "daga-zoom-out", onClick: V, children: /* @__PURE__ */ v("span", { className: "daga-tooltip", children: "Zoom out" }) }),
7969
7971
  /* @__PURE__ */ M("div", { className: "daga-collapsable-buttons daga-collapsed", ref: m, children: [
7970
7972
  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" }) }),
7971
7973
  e && /* @__PURE__ */ v("button", { className: "daga-undo", onClick: C, children: /* @__PURE__ */ v("span", { className: "daga-tooltip", children: "Undo" }) }),
@@ -7982,14 +7984,14 @@ const Ce = ({
7982
7984
  ]
7983
7985
  }
7984
7986
  ) });
7985
- }, Vi = ({
7987
+ }, Hi = ({
7986
7988
  config: s,
7987
7989
  model: t,
7988
7990
  onCanvasCreated: e,
7989
7991
  onDiagramEvent: a,
7990
7992
  onModelChange: l
7991
7993
  }) => {
7992
- const r = new We(), i = new Je(), n = rt(null), o = rt(void 0), d = rt(!1), c = [], [h, f] = U(void 0), [y, m] = U(void 0), p = {
7994
+ const r = new Ze(), i = new Qe(), n = rt(null), o = rt(void 0), d = rt(!1), c = [], [h, f] = U(void 0), [y, m] = U(void 0), p = {
7993
7995
  zoomIn: () => {
7994
7996
  },
7995
7997
  zoomOut: () => {
@@ -8007,31 +8009,31 @@ const Ce = ({
8007
8009
  }, u = {
8008
8010
  refreshPalette: () => {
8009
8011
  }
8010
- }, k = new wi(
8012
+ }, k = new Ci(
8011
8013
  (E) => f(E),
8012
8014
  (E) => m(E)
8013
8015
  ), b = {
8014
8016
  diagramButtons: p,
8015
8017
  palette: u,
8016
8018
  propertyEditor: k
8017
- }, N = (E = !1) => ((!o.current || E) && (c.forEach((C) => C.unsubscribe()), o.current = new ye(b, s)), o.current), R = N(), P = (E) => {
8018
- R.initView(E), c.push(
8019
- R.diagramEvent$.subscribe((C) => {
8019
+ }, N = (E = !1) => ((!o.current || E) && (c.forEach((C) => C.unsubscribe()), o.current = new ye(b, s)), o.current), V = N(), P = (E) => {
8020
+ V.initView(E), c.push(
8021
+ V.diagramEvent$.subscribe((C) => {
8020
8022
  a?.(C);
8021
8023
  })
8022
8024
  ), c.push(
8023
- R.diagramChange$.subscribe(() => {
8024
- const C = i.export(R.model);
8025
+ V.diagramChange$.subscribe(() => {
8026
+ const C = i.export(V.model);
8025
8027
  l?.(C);
8026
8028
  })
8027
8029
  );
8028
8030
  };
8029
8031
  Ct(() => {
8030
- n.current && (d.current || (P(n.current), d.current = !0, e?.(R)));
8031
- }, [n.current]), ho(() => {
8032
- n.current && (N(!0), P(n.current), e?.(R));
8032
+ n.current && (d.current || (P(n.current), d.current = !0, e?.(V)));
8033
+ }, [n.current]), go(() => {
8034
+ n.current && (N(!0), P(n.current), e?.(V));
8033
8035
  }, [s]), Ct(() => {
8034
- t && r.import(R.model, t);
8036
+ t && r.import(V.model, t);
8035
8037
  }, [t]);
8036
8038
  const tt = (E, C, O) => {
8037
8039
  if (y !== void 0 && C.editable !== !1 && !St(E.getValue(C.name), O)) {
@@ -8040,14 +8042,14 @@ const Ce = ({
8040
8042
  y.propertySet,
8041
8043
  void 0
8042
8044
  );
8043
- A.setValues(y.getValues()), A.rootElement = y.rootElement, k.valueSet = A, y.rootElement.valueSet = A, R.propertyEditorChanges$?.next();
8045
+ A.setValues(y.getValues()), A.rootElement = y.rootElement, k.valueSet = A, y.rootElement.valueSet = A, V.propertyEditorChanges$?.next();
8044
8046
  }
8045
8047
  };
8046
- return /* @__PURE__ */ v("daga-diagram", { children: /* @__PURE__ */ v(ki.Provider, { value: s, children: /* @__PURE__ */ v($t.Provider, { value: R, children: /* @__PURE__ */ M("daga-diagram-editor", { children: [
8048
+ return /* @__PURE__ */ v("daga-diagram", { children: /* @__PURE__ */ v(Si.Provider, { value: s, children: /* @__PURE__ */ v($t.Provider, { value: V, children: /* @__PURE__ */ M("daga-diagram-editor", { children: [
8047
8049
  /* @__PURE__ */ v("div", { className: "daga-append-to", ref: n }),
8048
- /* @__PURE__ */ M($t.Provider, { value: R, children: [
8050
+ /* @__PURE__ */ M($t.Provider, { value: V, children: [
8049
8051
  s.components?.buttons !== void 0 && s.components?.buttons?.enabled !== !1 && /* @__PURE__ */ v(
8050
- Ni,
8052
+ zi,
8051
8053
  {
8052
8054
  location: s.components?.buttons?.location || Zt.BottomRight,
8053
8055
  direction: s.components?.buttons?.direction || g.Top,
@@ -8059,7 +8061,7 @@ const Ce = ({
8059
8061
  }
8060
8062
  ),
8061
8063
  s.components?.palette !== void 0 && s.components?.palette?.enabled !== !1 && s.components?.palette?.sections && (s.components?.palette?.sections?.length || 0) > 0 && /* @__PURE__ */ v(
8062
- Ti,
8064
+ Pi,
8063
8065
  {
8064
8066
  location: s.components?.palette?.location || Zt.TopLeft,
8065
8067
  direction: s.components?.palette?.direction || g.Bottom,
@@ -8069,7 +8071,7 @@ const Ce = ({
8069
8071
  }
8070
8072
  ),
8071
8073
  s.components?.propertyEditor !== void 0 && s.components?.propertyEditor?.enabled !== !1 && /* @__PURE__ */ v(
8072
- Ei,
8074
+ Ti,
8073
8075
  {
8074
8076
  location: s.components?.propertyEditor?.location || Zt.TopRight,
8075
8077
  direction: s.components?.propertyEditor?.direction || g.Bottom,
@@ -8080,10 +8082,10 @@ const Ce = ({
8080
8082
  onValueChange: tt
8081
8083
  }
8082
8084
  ),
8083
- s.components?.errors !== void 0 && s.components?.errors?.enabled !== !1 && /* @__PURE__ */ v(Si, {})
8085
+ s.components?.errors !== void 0 && s.components?.errors?.enabled !== !1 && /* @__PURE__ */ v($i, {})
8084
8086
  ] })
8085
8087
  ] }) }) }) });
8086
8088
  };
8087
8089
  export {
8088
- Vi as DagaDiagram
8090
+ Hi as DagaDiagram
8089
8091
  };