@metadev/daga-react 5.1.0 → 5.1.1

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.
Files changed (4) hide show
  1. package/Changelog.md +440 -431
  2. package/index.js +3 -3
  3. package/index.mjs +854 -633
  4. package/package.json +50 -50
package/index.mjs CHANGED
@@ -43,12 +43,12 @@ var p = /* @__PURE__ */ function(e) {
43
43
  return e.Straight = "straight", e.Bezier = "bezier", e.Square = "square", e;
44
44
  }({}), te = /* @__PURE__ */ function(e) {
45
45
  return e.Solid = "solid", e.Dashed = "dashed", e.GappedDashes = "gapped-dashes", e.Dotted = "dotted", e;
46
- }({}), O = 20, ne = (e, t, n, r, i) => {
46
+ }({}), ne = 20, re = (e, t, n, r, i) => {
47
47
  if (typeof e == "function") return e(t, n, r, i);
48
48
  if (t.length === 0) return "";
49
49
  if (t.length === 1) return `M ${t[0][0]} ${t[0][1]}`;
50
50
  {
51
- i ||= O;
51
+ i ||= ne;
52
52
  let a = "", o, s;
53
53
  switch (e) {
54
54
  case "straight":
@@ -228,71 +228,71 @@ var p = /* @__PURE__ */ function(e) {
228
228
  }
229
229
  return a;
230
230
  }
231
- }, re = (e, t) => {
231
+ }, ie = (e, t) => {
232
232
  switch (e) {
233
233
  case "dotted": return `${t}`;
234
234
  case "dashed": return `${4 * t} ${t}`;
235
235
  case "gapped-dashes": return `${4 * t} ${4 * t}`;
236
236
  default: return "none";
237
237
  }
238
- }, k = (e, t) => {
238
+ }, O = (e, t) => {
239
239
  let n = e.indexOf(t);
240
240
  return n >= 0 && e.splice(n, 1), e;
241
- }, ie = /* @__PURE__ */ function(e) {
241
+ }, ae = /* @__PURE__ */ function(e) {
242
242
  return e.Ellipse = "ellipse", e.Empty = "empty", e.Folder = "folder", e.Hexagon = "hexagon", e.Octagon = "octagon", e.Pill = "pill", e.Rectangle = "rectangle", e.Rhombus = "rhombus", e.RoundedRectangle = "rounded-rectangle", e.StickyNote = "sticky-note", e;
243
- }({}), ae = (e, t, n, r, i) => {
243
+ }({}), oe = (e, t, n, r, i) => {
244
244
  if (typeof e == "function") return e(t, n, r, i);
245
245
  switch (e) {
246
- case "ellipse": return oe(t, n, r, i);
247
- case "empty": return se();
248
- case "folder": return ce(t, n, r, i);
249
- case "hexagon": return le(t, n, r, i);
250
- case "octagon": return ue(t, n, r, i);
251
- case "pill": return de(t, n, r, i);
252
- case "rectangle": return fe(t, n, r, i);
253
- case "rhombus": return pe(t, n, r, i);
254
- case "rounded-rectangle": return me(t, n, r, i);
255
- case "sticky-note": return he(t, n, r, i);
256
- default: return fe(t, n, r, i);
257
- }
258
- }, oe = (e, t, n, r) => `M ${e + n / 2} ${t} A ${n / 2} ${r / 2} 0 0 0 ${e + n / 2} ${t + r} A ${n / 2} ${r / 2} 0 1 0 ${e + n / 2} ${t} Z`, se = () => "Z", ce = (e, t, n, r) => `M ${e} ${t} L ${e + n / 3} ${t} L ${e + n / 2} ${t + r / 6} L ${e + n} ${t + r / 6} L ${e + n} ${t + r} L ${e} ${t + r} Z`, le = (e, t, n, r) => `M ${e + n / 4} ${t} L ${e + 3 * n / 4} ${t} L ${e + n} ${t + r / 2} L ${e + 3 * n / 4} ${t + r} L ${e + n / 4} ${t + r} L ${e} ${t + r / 2} Z`, ue = (e, t, n, r) => `M ${e + n / 4} ${t} L ${e + 3 * n / 4} ${t} L ${e + n} ${t + r / 4} L ${e + n} ${t + 3 * r / 4} L ${e + 3 * n / 4} ${t + r} L ${e + n / 4} ${t + r} L ${e} ${t + 3 * r / 4} L ${e} ${t + r / 4} L ${e + n / 4} ${t} Z`, de = (e, t, n, r) => r < n ? `M ${e + r / 2} ${t} L ${e + n - r / 2} ${t} A ${r / 2} ${r / 2} 0 0 1 ${e + n} ${t + r / 2} A ${r / 2} ${r / 2} 0 0 1 ${e + n - r / 2} ${t + r} L ${e + r / 2} ${t + r} A ${r / 2} ${r / 2} 0 0 1 ${e} ${t + r / 2} A ${r / 2} ${r / 2} 0 0 1 ${e + r / 2} ${t} Z` : r > n ? `M ${e} ${t + n / 2} L ${e} ${t + r - n / 2} A ${n / 2} ${n / 2} 0 0 0 ${e + n / 2} ${t + r} A ${n / 2} ${n / 2} 0 0 0 ${e + n} ${t + r - n / 2} L ${e + n} ${t + n / 2} A ${n / 2} ${n / 2} 0 0 0 ${e + n / 2} ${t} A ${n / 2} ${n / 2} 0 0 0 ${e} ${t + n / 2} Z` : oe(e, t, n, r), fe = (e, t, n, r) => `M ${e} ${t} L ${e + n} ${t} L ${e + n} ${t + r} L ${e} ${t + r} Z`, pe = (e, t, n, r) => `M ${e + n / 2} ${t} L ${e + n} ${t + r / 2} L ${e + n / 2} ${t + r} L ${e} ${t + r / 2} Z`, me = (e, t, n, r) => `M ${e + n / 4} ${t} L ${e + 3 * n / 4} ${t} A ${n / 4} ${r / 4} 0 0 1 ${e + n} ${t + r / 4} L ${e + n} ${t + 3 * r / 4} A ${n / 4} ${r / 4} 0 0 1 ${e + 3 * n / 4} ${t + r} L ${e + n / 4} ${t + r} A ${n / 4} ${r / 4} 0 0 1 ${e} ${t + 3 * r / 4} L ${e} ${t + r / 4} A ${n / 4} ${r / 4} 0 0 1 ${e + n / 4} ${t} Z`, he = (e, t, n, r) => `M ${e} ${t} L ${e + 3 * n / 4} ${t} L ${e + 3 * n / 4} ${t + r / 4} L ${e + 3 * n / 4} ${t} L ${e + n} ${t + r / 4} L ${e + 3 * n / 4} ${t + r / 4} L ${e + n} ${t + r / 4} L ${e + n} ${t + r} L ${e} ${t + r} Z`, A = /* @__PURE__ */ function(e) {
259
- return e.AllScroll = "all-scroll", e.Auto = "auto", e.Crosshair = "crosshair", e.EWResize = "ew-resize", e.Grab = "grab", e.Grabbing = "grabbing", e.Move = "move", e.NoDrop = "no-drop", e.NSResize = "ns-resize", e.NotAllowed = "not-allowed", e.ZoomIn = "zoom-in", e.ZoomOut = "zoom-out", e;
260
- }({}), ge = (e) => Math.max(...e.split("\n").map((e) => e.length)), _e = (e) => e.match(/\n/g)?.length || 0, j = [];
261
- for (let e = 0; e < 256; ++e) j.push((e + 256).toString(16).slice(1));
262
- function ve(e, t = 0) {
263
- return (j[e[t + 0]] + j[e[t + 1]] + j[e[t + 2]] + j[e[t + 3]] + "-" + j[e[t + 4]] + j[e[t + 5]] + "-" + j[e[t + 6]] + j[e[t + 7]] + "-" + j[e[t + 8]] + j[e[t + 9]] + "-" + j[e[t + 10]] + j[e[t + 11]] + j[e[t + 12]] + j[e[t + 13]] + j[e[t + 14]] + j[e[t + 15]]).toLowerCase();
246
+ case "ellipse": return se(t, n, r, i);
247
+ case "empty": return ce();
248
+ case "folder": return le(t, n, r, i);
249
+ case "hexagon": return ue(t, n, r, i);
250
+ case "octagon": return de(t, n, r, i);
251
+ case "pill": return fe(t, n, r, i);
252
+ case "rectangle": return pe(t, n, r, i);
253
+ case "rhombus": return me(t, n, r, i);
254
+ case "rounded-rectangle": return he(t, n, r, i);
255
+ case "sticky-note": return ge(t, n, r, i);
256
+ default: return pe(t, n, r, i);
257
+ }
258
+ }, se = (e, t, n, r) => `M ${e + n / 2} ${t} A ${n / 2} ${r / 2} 0 0 0 ${e + n / 2} ${t + r} A ${n / 2} ${r / 2} 0 1 0 ${e + n / 2} ${t} Z`, ce = () => "Z", le = (e, t, n, r) => `M ${e} ${t} L ${e + n / 3} ${t} L ${e + n / 2} ${t + r / 6} L ${e + n} ${t + r / 6} L ${e + n} ${t + r} L ${e} ${t + r} Z`, ue = (e, t, n, r) => `M ${e + n / 4} ${t} L ${e + 3 * n / 4} ${t} L ${e + n} ${t + r / 2} L ${e + 3 * n / 4} ${t + r} L ${e + n / 4} ${t + r} L ${e} ${t + r / 2} Z`, de = (e, t, n, r) => `M ${e + n / 4} ${t} L ${e + 3 * n / 4} ${t} L ${e + n} ${t + r / 4} L ${e + n} ${t + 3 * r / 4} L ${e + 3 * n / 4} ${t + r} L ${e + n / 4} ${t + r} L ${e} ${t + 3 * r / 4} L ${e} ${t + r / 4} L ${e + n / 4} ${t} Z`, fe = (e, t, n, r) => r < n ? `M ${e + r / 2} ${t} L ${e + n - r / 2} ${t} A ${r / 2} ${r / 2} 0 0 1 ${e + n} ${t + r / 2} A ${r / 2} ${r / 2} 0 0 1 ${e + n - r / 2} ${t + r} L ${e + r / 2} ${t + r} A ${r / 2} ${r / 2} 0 0 1 ${e} ${t + r / 2} A ${r / 2} ${r / 2} 0 0 1 ${e + r / 2} ${t} Z` : r > n ? `M ${e} ${t + n / 2} L ${e} ${t + r - n / 2} A ${n / 2} ${n / 2} 0 0 0 ${e + n / 2} ${t + r} A ${n / 2} ${n / 2} 0 0 0 ${e + n} ${t + r - n / 2} L ${e + n} ${t + n / 2} A ${n / 2} ${n / 2} 0 0 0 ${e + n / 2} ${t} A ${n / 2} ${n / 2} 0 0 0 ${e} ${t + n / 2} Z` : se(e, t, n, r), pe = (e, t, n, r) => `M ${e} ${t} L ${e + n} ${t} L ${e + n} ${t + r} L ${e} ${t + r} Z`, me = (e, t, n, r) => `M ${e + n / 2} ${t} L ${e + n} ${t + r / 2} L ${e + n / 2} ${t + r} L ${e} ${t + r / 2} Z`, he = (e, t, n, r) => `M ${e + n / 4} ${t} L ${e + 3 * n / 4} ${t} A ${n / 4} ${r / 4} 0 0 1 ${e + n} ${t + r / 4} L ${e + n} ${t + 3 * r / 4} A ${n / 4} ${r / 4} 0 0 1 ${e + 3 * n / 4} ${t + r} L ${e + n / 4} ${t + r} A ${n / 4} ${r / 4} 0 0 1 ${e} ${t + 3 * r / 4} L ${e} ${t + r / 4} A ${n / 4} ${r / 4} 0 0 1 ${e + n / 4} ${t} Z`, ge = (e, t, n, r) => `M ${e} ${t} L ${e + 3 * n / 4} ${t} L ${e + 3 * n / 4} ${t + r / 4} L ${e + 3 * n / 4} ${t} L ${e + n} ${t + r / 4} L ${e + 3 * n / 4} ${t + r / 4} L ${e + n} ${t + r / 4} L ${e + n} ${t + r} L ${e} ${t + r} Z`, k = /* @__PURE__ */ function(e) {
259
+ return e.AllScroll = "all-scroll", e.Auto = "auto", e.Crosshair = "crosshair", e.EWResize = "ew-resize", e.Grab = "grab", e.Grabbing = "grabbing", e.Move = "move", e.NoDrop = "no-drop", e.NESWResize = "nesw-resize", e.NSResize = "ns-resize", e.NWSEResize = "nwse-resize", e.NotAllowed = "not-allowed", e.ZoomIn = "zoom-in", e.ZoomOut = "zoom-out", e;
260
+ }({}), _e = (e) => Math.max(...e.split("\n").map((e) => e.length)), ve = (e) => e.match(/\n/g)?.length || 0, A = [];
261
+ for (let e = 0; e < 256; ++e) A.push((e + 256).toString(16).slice(1));
262
+ function ye(e, t = 0) {
263
+ return (A[e[t + 0]] + A[e[t + 1]] + A[e[t + 2]] + A[e[t + 3]] + "-" + A[e[t + 4]] + A[e[t + 5]] + "-" + A[e[t + 6]] + A[e[t + 7]] + "-" + A[e[t + 8]] + A[e[t + 9]] + "-" + A[e[t + 10]] + A[e[t + 11]] + A[e[t + 12]] + A[e[t + 13]] + A[e[t + 14]] + A[e[t + 15]]).toLowerCase();
264
264
  }
265
265
  //#endregion
266
266
  //#region node_modules/uuid/dist/rng.js
267
- var ye = new Uint8Array(16);
268
- function be() {
269
- return crypto.getRandomValues(ye);
267
+ var be = new Uint8Array(16);
268
+ function xe() {
269
+ return crypto.getRandomValues(be);
270
270
  }
271
271
  //#endregion
272
272
  //#region node_modules/uuid/dist/v4.js
273
- function xe(e, t, n) {
274
- return !t && !e && crypto.randomUUID ? crypto.randomUUID() : Se(e, t, n);
275
- }
276
273
  function Se(e, t, n) {
274
+ return !t && !e && crypto.randomUUID ? crypto.randomUUID() : Ce(e, t, n);
275
+ }
276
+ function Ce(e, t, n) {
277
277
  e ||= {};
278
- let r = e.random ?? e.rng?.() ?? be();
278
+ let r = e.random ?? e.rng?.() ?? xe();
279
279
  if (r.length < 16) throw Error("Random bytes length must be >= 16");
280
280
  if (r[6] = r[6] & 15 | 64, r[8] = r[8] & 63 | 128, t) {
281
281
  if (n ||= 0, n < 0 || n + 16 > t.length) throw RangeError(`UUID byte range ${n}:${n + 15} is out of buffer bounds`);
282
282
  for (let e = 0; e < 16; ++e) t[n + e] = r[e];
283
283
  return t;
284
284
  }
285
- return ve(r);
285
+ return ye(r);
286
286
  }
287
287
  //#endregion
288
288
  //#region libs/daga/src/lib/util/object-util.ts
289
- var Ce = (e) => {
289
+ var we = (e) => {
290
290
  if (typeof e != "object" || !e) return e;
291
- if (Array.isArray(e)) return e.map(Ce);
291
+ if (Array.isArray(e)) return e.map(we);
292
292
  let t = {};
293
- for (let n of Object.entries(e)) t[n[0]] = Ce(n[1]);
293
+ for (let n of Object.entries(e)) t[n[0]] = we(n[1]);
294
294
  return t;
295
- }, M = (e) => {
295
+ }, j = (e) => {
296
296
  let { selected: t, highlighted: n, selectedAndHighlighted: r, ...i } = e, a = i;
297
297
  return {
298
298
  defaultLook: a,
@@ -311,106 +311,13 @@ var Ce = (e) => {
311
311
  ...r
312
312
  }
313
313
  };
314
- }, we = class {
315
- constructor() {
316
- this.entities = [], this.entityMap = {};
317
- }
318
- get length() {
319
- return this.size();
320
- }
321
- all() {
322
- return [...this.entities];
323
- }
324
- add(e) {
325
- this.entityMap[e.id] === void 0 && (this.entityMap[e.id] = e, this.entities.push(e));
326
- }
327
- clear() {
328
- for (; this.entities.length > 0;) this.remove(this.entities[0].id);
329
- }
330
- contains(e) {
331
- return this.entityMap[e] !== void 0;
332
- }
333
- count(e) {
334
- return this.entities.filter(e).length;
335
- }
336
- filter(e) {
337
- return this.entities.filter(e);
338
- }
339
- find(e) {
340
- return this.entities.find(e);
341
- }
342
- get(e) {
343
- return this.entityMap[e];
344
- }
345
- map(e) {
346
- return this.entities.map(e);
347
- }
348
- remove(e) {
349
- let t = this.get(e);
350
- t !== void 0 && (delete this.entityMap[e], k(this.entities, t));
351
- }
352
- size() {
353
- return this.entities.length;
354
- }
355
- *[Symbol.iterator]() {
356
- for (let e of this.entities) yield e;
357
- }
358
314
  }, Te = class {
359
- get id() {
360
- return this._id;
361
- }
362
- get highlighted() {
363
- return this.model.canvas?.userHighlight?.contains(this.id) || !1;
364
- }
365
- get selected() {
366
- return this.model.canvas?.userSelection?.contains(this.id) || !1;
367
- }
368
- constructor(e, t) {
369
- this.selfRemoved = !1, this.selfRemovedTimestamp = null, this.model = e, this._id = t;
370
- }
371
- select() {
372
- return this.model.canvas?.selectCanvasView()?.select(`[id='${E(this.id)}']`);
373
- }
374
- }, N = class extends we {
375
- all(e = !1) {
376
- return e ? super.all() : super.filter((e) => !e.removed);
377
- }
378
- contains(e, t = !1) {
379
- return t ? super.contains(e) : super.contains(e) && !this.entityMap[e].removed;
380
- }
381
- count(e, t = !1) {
382
- return t ? super.count(e) : super.count((t, n, r) => e(t, n, r) && !t.removed);
383
- }
384
- filter(e, t = !1) {
385
- return t ? super.filter(e) : super.filter((t, n, r) => e(t, n, r) && !t.removed);
386
- }
387
- find(e, t = !1) {
388
- return t ? super.find(e) : super.find((t, n, r) => e(t, n, r) && !t.removed);
389
- }
390
- get(e, t = !1) {
391
- return t || this.contains(e) ? super.get(e) : void 0;
392
- }
393
- map(e, t = !1) {
394
- return t ? super.map(e) : super.filter((e) => !e.removed).map(e);
395
- }
396
- remove(e) {
397
- let t = this.get(e, !0);
398
- t !== void 0 && (delete this.entityMap[e], k(this.entities, t));
399
- }
400
- size(e = !1) {
401
- return e ? super.size() : super.filter((e) => !e.removed).length;
402
- }
403
- *[Symbol.iterator](e = !1) {
404
- if (e) for (let e of this.entities) yield e;
405
- else for (let e of this.entities.filter((e) => !e.removed)) yield e;
406
- }
407
- }, Ee = class {
408
315
  constructor(e, t, n, r, i, a, o) {
409
316
  this.name = e, this.label = t, this.type = n, this.defaultValue = r, this.basic = i, this.editable = a, this.rootAttribute = o, this.options = void 0, this.properties = void 0;
410
317
  }
411
- }, P = /* @__PURE__ */ function(e) {
318
+ }, M = /* @__PURE__ */ function(e) {
412
319
  return e.Boolean = "boolean", e.Color = "color", e.Date = "date", e.Datetime = "datetime", e.Number = "number", e.Object = "object", e.Option = "option", e.OptionList = "option-list", e.OptionSet = "option-set", e.Text = "text", e.TextArea = "text-area", e.TextList = "text-list", e.TextSet = "text-set", e.TextMap = "text-map", e.Time = "time", e.Url = "url", e;
413
- }({}), De = class {
320
+ }({}), Ee = class {
414
321
  constructor(e = []) {
415
322
  this.propertyList = e, this.propertyMap = {};
416
323
  for (let e of this.propertyList) this.propertyMap[e.name] = e;
@@ -427,19 +334,19 @@ var Ce = (e) => {
427
334
  };
428
335
  //#endregion
429
336
  //#region libs/daga/src/lib/diagram/collab/primitives.ts
430
- function Oe(e, t) {
337
+ function De(e, t) {
431
338
  return !t || e[0] > t[0] ? !0 : e[0] === t[0] ? e[1] >= t[1] : !1;
432
339
  }
433
340
  //#endregion
434
341
  //#region libs/daga/src/lib/diagram/property/property-util.ts
435
- var ke = (e) => e == null || e === "" || e instanceof Array && e.length === 0 || e instanceof Object && Object.keys(e).length === 0, Ae = (e, t) => e === t || JSON.stringify(e) === JSON.stringify(t), je = (e, t, n) => {
342
+ var Oe = (e) => e == null || e === "" || e instanceof Array && e.length === 0 || e instanceof Object && Object.keys(e).length === 0, ke = (e, t) => e === t || JSON.stringify(e) === JSON.stringify(t), Ae = (e, t, n) => {
436
343
  let r = {}, i = {};
437
- for (let a in n.propertySet.propertyMap) if (n.propertySet.propertyMap[a].type === P.Object) {
438
- let o = je(e[a], t[a], n.getSubValueSet(a));
344
+ for (let a in n.propertySet.propertyMap) if (n.propertySet.propertyMap[a].type === M.Object) {
345
+ let o = Ae(e[a], t[a], n.getSubValueSet(a));
439
346
  Object.keys(o[0]).length > 0 && Object.keys(o[1]).length > 0 && (r[a] = o[0], i[a] = o[1]);
440
- } else Ae(e[a], t[a]) || (r[a] = e[a], i[a] = t[a]);
347
+ } else ke(e[a], t[a]) || (r[a] = e[a], i[a] = t[a]);
441
348
  return [r, i];
442
- }, Me = (e) => e != null && e.constructor === Object, Ne = class e {
349
+ }, je = (e) => e != null && e.constructor === Object, Me = class e {
443
350
  constructor(e, t) {
444
351
  this.displayedProperties = [], this.hiddenProperties = [], this.values = {}, this.valueSets = {}, this.ownTimestamps = {}, this.propertySet = e, this.rootElement = t, this.resetValues();
445
352
  }
@@ -473,21 +380,21 @@ var ke = (e) => e == null || e === "" || e instanceof Array && e.length === 0 ||
473
380
  }
474
381
  getValue(e) {
475
382
  let t = this.propertySet.getProperty(e)?.rootAttribute;
476
- return t != null && (this.values[e] = this.getRootElementValue(t)), this.propertySet.getProperty(e).type === P.Object ? this.valueSets[e].getValues() : this.values[e];
383
+ return t != null && (this.values[e] = this.getRootElementValue(t)), this.propertySet.getProperty(e).type === M.Object ? this.valueSets[e].getValues() : this.values[e];
477
384
  }
478
385
  getValues() {
479
386
  let e = {};
480
- for (let t in this.propertySet.propertyMap) this.propertySet.getProperty(t).type === P.Object ? e[t] = this.valueSets[t].getValues() : e[t] = this.getValue(t);
387
+ for (let t in this.propertySet.propertyMap) this.propertySet.getProperty(t).type === M.Object ? e[t] = this.valueSets[t].getValues() : e[t] = this.getValue(t);
481
388
  return e;
482
389
  }
483
390
  getValuesForKeys(e) {
484
391
  let t = {};
485
- for (let n in e) this.propertySet.getProperty(n).type === P.Object ? t[n] = this.valueSets[n].getValuesForKeys(e[n]) : t[n] = this.getValue(n);
392
+ for (let n in e) this.propertySet.getProperty(n).type === M.Object ? t[n] = this.valueSets[n].getValuesForKeys(e[n]) : t[n] = this.getValue(n);
486
393
  return t;
487
394
  }
488
395
  getTimestamps() {
489
396
  let e = {};
490
- for (let t in this.propertySet.propertyMap) if (this.propertySet.getProperty(t).type === P.Object) e[t] = this.valueSets[t].getTimestamps();
397
+ for (let t in this.propertySet.propertyMap) if (this.propertySet.getProperty(t).type === M.Object) e[t] = this.valueSets[t].getTimestamps();
491
398
  else {
492
399
  let n = this.ownTimestamps[t];
493
400
  n && (e[t] = n);
@@ -495,11 +402,11 @@ var ke = (e) => e == null || e === "" || e instanceof Array && e.length === 0 ||
495
402
  return e;
496
403
  }
497
404
  hasValue(e) {
498
- return !ke(this.getValue(e));
405
+ return !Oe(this.getValue(e));
499
406
  }
500
407
  hasSetValue(e) {
501
408
  let t = this.getValue(e), n = this.propertySet.getProperty(e);
502
- return n && n.type === P.Object ? this.getSubValueSet(e).hasAnySetValue() : !ke(t) && !Ae(t, n?.defaultValue);
409
+ return n && n.type === M.Object ? this.getSubValueSet(e).hasAnySetValue() : !Oe(t) && !ke(t, n?.defaultValue);
503
410
  }
504
411
  hasAnySetValue() {
505
412
  for (let e of this.propertySet.propertyList) if (this.hasSetValue(e.name)) return !0;
@@ -508,50 +415,142 @@ var ke = (e) => e == null || e === "" || e instanceof Array && e.length === 0 ||
508
415
  setValue(e, t) {
509
416
  let n = this.propertySet.getProperty(e);
510
417
  if (n) {
511
- n.type === P.Object ? this.valueSets[e].setValues(t) : (this.values[e] = t, Ae(t, n.defaultValue) || this.displayProperty(n));
418
+ n.type === M.Object ? this.valueSets[e].setValues(t) : (this.values[e] = t, ke(t, n.defaultValue) || this.displayProperty(n));
512
419
  let r = n.rootAttribute;
513
420
  r != null && this.setRootElementValue(r, t);
514
421
  }
515
422
  }
516
423
  setValues(e) {
517
424
  this.resetValues();
518
- for (let t in e) this.propertySet.getProperty(t).type === P.Object ? this.valueSets[t].setValues(e[t]) : this.setValue(t, e[t]);
425
+ for (let t in e) this.propertySet.getProperty(t).type === M.Object ? this.valueSets[t].setValues(e[t]) : this.setValue(t, e[t]);
519
426
  }
520
427
  setTimestamps(e) {
521
428
  this.ownTimestamps = {};
522
- for (let t in e) this.propertySet.getProperty(t).type === P.Object ? this.valueSets[t].setTimestamps(e[t]) : this.ownTimestamps[t] = e[t];
429
+ for (let t in e) this.propertySet.getProperty(t).type === M.Object ? this.valueSets[t].setTimestamps(e[t]) : this.ownTimestamps[t] = e[t];
523
430
  }
524
431
  overwriteValues(e) {
525
- for (let t in e) this.propertySet.getProperty(t).type === P.Object ? this.valueSets[t].overwriteValues(e[t]) : this.setValue(t, e[t]);
432
+ for (let t in e) this.propertySet.getProperty(t).type === M.Object ? this.valueSets[t].overwriteValues(e[t]) : this.setValue(t, e[t]);
526
433
  }
527
434
  overwriteValuesLww(e, t) {
528
- for (let n in e) this.propertySet.getProperty(n).type === P.Object ? this.valueSets[n].overwriteValuesLww(e[n], t) : Oe(t, this.ownTimestamps[n]) && (this.setValue(n, e[n]), this.ownTimestamps[n] = t);
435
+ for (let n in e) this.propertySet.getProperty(n).type === M.Object ? this.valueSets[n].overwriteValuesLww(e[n], t) : De(t, this.ownTimestamps[n]) && (this.setValue(n, e[n]), this.ownTimestamps[n] = t);
529
436
  }
530
437
  resetValues() {
531
438
  this.displayedProperties = [], this.hiddenProperties = [], this.ownTimestamps = {};
532
439
  for (let e in this.propertySet.propertyMap) {
533
440
  let t = this.propertySet.getProperty(e), n = t.rootAttribute;
534
- t.type === P.Object ? this.valueSets[e] = this.constructSubValueSet(e) : this.values[e] = Ce(t.defaultValue), n != null && t.defaultValue !== void 0 && !Ae(this.getRootElementValue(n), t.defaultValue) && this.setRootElementValue(n, this.values[e]), t.basic === !1 ? this.hiddenProperties.push(t) : this.displayedProperties.push(t);
441
+ t.type === M.Object ? this.valueSets[e] = this.constructSubValueSet(e) : this.values[e] = we(t.defaultValue), n != null && t.defaultValue !== void 0 && !ke(this.getRootElementValue(n), t.defaultValue) && this.setRootElementValue(n, this.values[e]), t.basic === !1 ? this.hiddenProperties.push(t) : this.displayedProperties.push(t);
535
442
  }
536
443
  }
537
444
  constructSubValueSet(t) {
538
- let n = this.propertySet.getProperty(t), r = new e(new De(n.properties), this.rootElement);
539
- return r.overwriteValues(Ce(n.defaultValue)), r;
445
+ let n = this.propertySet.getProperty(t), r = new e(new Ee(n.properties), this.rootElement);
446
+ return r.overwriteValues(we(n.defaultValue)), r;
540
447
  }
541
448
  getSubValueSet(e) {
542
449
  return this.valueSets[e];
543
450
  }
544
451
  displayProperty(e) {
545
- this.displayedProperties.includes(e) || (this.displayedProperties.push(e), k(this.hiddenProperties, e));
452
+ this.displayedProperties.includes(e) || (this.displayedProperties.push(e), O(this.hiddenProperties, e));
546
453
  }
547
454
  hideProperty(e) {
548
- this.hiddenProperties.includes(e) || (this.hiddenProperties.push(e), k(this.displayedProperties, e));
455
+ this.hiddenProperties.includes(e) || (this.hiddenProperties.push(e), O(this.displayedProperties, e));
456
+ }
457
+ }, Ne = class {
458
+ constructor() {
459
+ this.entities = [], this.entityMap = {};
460
+ }
461
+ get length() {
462
+ return this.size();
463
+ }
464
+ all() {
465
+ return [...this.entities];
466
+ }
467
+ add(e) {
468
+ this.entityMap[e.id] === void 0 && (this.entityMap[e.id] = e, this.entities.push(e));
469
+ }
470
+ clear() {
471
+ for (; this.entities.length > 0;) this.remove(this.entities[0].id);
472
+ }
473
+ contains(e) {
474
+ return this.entityMap[e] !== void 0;
475
+ }
476
+ count(e) {
477
+ return this.entities.filter(e).length;
478
+ }
479
+ filter(e) {
480
+ return this.entities.filter(e);
481
+ }
482
+ find(e) {
483
+ return this.entities.find(e);
484
+ }
485
+ get(e) {
486
+ return this.entityMap[e];
487
+ }
488
+ map(e) {
489
+ return this.entities.map(e);
490
+ }
491
+ remove(e) {
492
+ let t = this.get(e);
493
+ t !== void 0 && (delete this.entityMap[e], O(this.entities, t));
494
+ }
495
+ size() {
496
+ return this.entities.length;
497
+ }
498
+ *[Symbol.iterator]() {
499
+ for (let e of this.entities) yield e;
500
+ }
501
+ }, Pe = class {
502
+ get id() {
503
+ return this._id;
504
+ }
505
+ get highlighted() {
506
+ return this.model.canvas?.userHighlight?.contains(this.id) || !1;
507
+ }
508
+ get selected() {
509
+ return this.model.canvas?.userSelection?.contains(this.id) || !1;
510
+ }
511
+ constructor(e, t) {
512
+ this.selfRemoved = !1, this.selfRemovedTimestamp = null, this.model = e, this._id = t;
513
+ }
514
+ select() {
515
+ return this.model.canvas?.selectCanvasView()?.select(`[id='${E(this.id)}']`);
516
+ }
517
+ }, N = class extends Ne {
518
+ all(e = !1) {
519
+ return e ? super.all() : super.filter((e) => !e.removed);
520
+ }
521
+ contains(e, t = !1) {
522
+ return t ? super.contains(e) : super.contains(e) && !this.entityMap[e].removed;
523
+ }
524
+ count(e, t = !1) {
525
+ return t ? super.count(e) : super.count((t, n, r) => e(t, n, r) && !t.removed);
526
+ }
527
+ filter(e, t = !1) {
528
+ return t ? super.filter(e) : super.filter((t, n, r) => e(t, n, r) && !t.removed);
529
+ }
530
+ find(e, t = !1) {
531
+ return t ? super.find(e) : super.find((t, n, r) => e(t, n, r) && !t.removed);
549
532
  }
550
- }, F = {
533
+ get(e, t = !1) {
534
+ return t || this.contains(e) ? super.get(e) : void 0;
535
+ }
536
+ map(e, t = !1) {
537
+ return t ? super.map(e) : super.filter((e) => !e.removed).map(e);
538
+ }
539
+ remove(e) {
540
+ let t = this.get(e, !0);
541
+ t !== void 0 && (delete this.entityMap[e], O(this.entities, t));
542
+ }
543
+ size(e = !1) {
544
+ return e ? super.size() : super.filter((e) => !e.removed).length;
545
+ }
546
+ *[Symbol.iterator](e = !1) {
547
+ if (e) for (let e of this.entities) yield e;
548
+ else for (let e of this.entities.filter((e) => !e.removed)) yield e;
549
+ }
550
+ }, P = {
551
551
  name: "",
552
552
  label: null,
553
553
  look: {
554
- lookType: "connection-look",
555
554
  color: "#000000",
556
555
  thickness: 1,
557
556
  shape: D.Straight,
@@ -564,23 +563,23 @@ var ke = (e) => e == null || e === "" || e instanceof Array && e.length === 0 ||
564
563
  startTypes: [],
565
564
  endTypes: [],
566
565
  properties: []
567
- }, Pe = class {
566
+ }, Fe = class {
568
567
  constructor(e) {
569
568
  let t = {
570
- ...F,
569
+ ...P,
571
570
  ...e
572
571
  };
573
572
  this.id = t.id, this.name = t.name, this.label = t.label;
574
- let n = M(t.look);
573
+ let n = j(t.look);
575
574
  if (this.defaultLook = n.defaultLook, this.selectedLook = n.selectedLook, this.highlightedLook = n.highlightedLook, this.selectedAndHighlightedLook = n.selectedAndHighlightedLook, t.startMarkerLook !== void 0) {
576
- let e = M(t.startMarkerLook);
575
+ let e = j(t.startMarkerLook);
577
576
  this.defaultStartMarkerLook = e.defaultLook, this.selectedStartMarkerLook = e.selectedLook, this.highlightedStartMarkerLook = e.highlightedLook, this.selectedAndHighlightedStartMarkerLook = e.selectedAndHighlightedLook;
578
577
  } else this.defaultStartMarkerLook = null, this.selectedStartMarkerLook = null, this.highlightedStartMarkerLook = null, this.selectedAndHighlightedStartMarkerLook = null;
579
578
  if (t.endMarkerLook !== void 0) {
580
- let e = M(t.endMarkerLook);
579
+ let e = j(t.endMarkerLook);
581
580
  this.defaultEndMarkerLook = e.defaultLook, this.selectedEndMarkerLook = e.selectedLook, this.highlightedEndMarkerLook = e.highlightedLook, this.selectedAndHighlightedEndMarkerLook = e.selectedAndHighlightedLook;
582
581
  } else this.defaultEndMarkerLook = null, this.selectedEndMarkerLook = null, this.highlightedEndMarkerLook = null, this.selectedAndHighlightedEndMarkerLook = null;
583
- this.startTypes = t.startTypes, this.endTypes = t.endTypes, this.propertySet = new De(t.properties);
582
+ this.startTypes = t.startTypes, this.endTypes = t.endTypes, this.propertySet = new Ee(t.properties);
584
583
  }
585
584
  canStartFromType(e) {
586
585
  return this.startTypes.indexOf(e) >= 0;
@@ -588,12 +587,12 @@ var ke = (e) => e == null || e === "" || e instanceof Array && e.length === 0 ||
588
587
  canFinishOnType(e) {
589
588
  return this.endTypes.indexOf(e) >= 0;
590
589
  }
591
- }, I = class extends Te {
590
+ }, F = class extends Pe {
592
591
  get type() {
593
592
  return this._type;
594
593
  }
595
594
  set type(e) {
596
- e !== this._type && (this._type = e, this.valueSet &&= new Ne(e.propertySet, this), this.model.canvas?.userSelection?.openInPropertyEditor(this, !1), this.updateInView());
595
+ e !== this._type && (this._type = e, this.valueSet &&= new Me(e.propertySet, this), this.model.canvas?.userSelection?.openInPropertyEditor(this, !1), this.updateInView());
597
596
  }
598
597
  get typeString() {
599
598
  return this.type.id;
@@ -621,7 +620,7 @@ var ke = (e) => e == null || e === "" || e instanceof Array && e.length === 0 ||
621
620
  }
622
621
  set lookConfig(e) {
623
622
  if (this._lookConfig = e, e) {
624
- let t = M(e);
623
+ let t = j(e);
625
624
  this._defaultLook = {
626
625
  ...this._defaultLook,
627
626
  ...t.defaultLook
@@ -648,7 +647,7 @@ var ke = (e) => e == null || e === "" || e instanceof Array && e.length === 0 ||
648
647
  }
649
648
  set startMarkerLookConfig(e) {
650
649
  if (this._startMarkerLookConfig = e, e) {
651
- let t = M(e);
650
+ let t = j(e);
652
651
  this._defaultStartMarkerLook = {
653
652
  ...this._defaultStartMarkerLook,
654
653
  ...t.defaultLook
@@ -675,7 +674,7 @@ var ke = (e) => e == null || e === "" || e instanceof Array && e.length === 0 ||
675
674
  }
676
675
  set endMarkerLookConfig(e) {
677
676
  if (this._endMarkerLookConfig = e, e) {
678
- let t = M(e);
677
+ let t = j(e);
679
678
  this._defaultEndMarkerLook = {
680
679
  ...this._defaultEndMarkerLook,
681
680
  ...t.defaultLook
@@ -694,7 +693,7 @@ var ke = (e) => e == null || e === "" || e instanceof Array && e.length === 0 ||
694
693
  constructor(e, t, n, r, i) {
695
694
  if (e.connections.get(i) !== void 0) throw Error(`DiagramConnection with id "${i}" already exists`);
696
695
  if (!i) throw Error("DiagramConnection cannot have an empty or null id");
697
- super(e, i), this.startCoords = [0, 0], this.endCoords = [0, 0], this.startLabel = "", this.middleLabel = "", this.endLabel = "", this.points = [], this._type = t, this.valueSet = new Ne(t.propertySet, this), this.originalData = {}, this.setStart(n), this.setEnd(r);
696
+ super(e, i), this.startCoords = [0, 0], this.endCoords = [0, 0], this.startLabel = "", this.middleLabel = "", this.endLabel = "", this.points = [], this._type = t, this.valueSet = new Me(t.propertySet, this), this.originalData = {}, this.setStart(n), this.setEnd(r);
698
697
  }
699
698
  get removed() {
700
699
  return this.selfRemoved || this.start !== void 0 && this.start.removed || this.end !== void 0 && this.end.removed;
@@ -706,10 +705,10 @@ var ke = (e) => e == null || e === "" || e instanceof Array && e.length === 0 ||
706
705
  this.select()?.raise(), this.start?.raise(!1), this.end?.raise(!1);
707
706
  }
708
707
  setStart(e) {
709
- this.start === e ? (this.startDirection = e?.direction, this.startCoords = e?.connectionPoint || [0, 0]) : (this.start !== void 0 && k(this.start.outgoingConnections, this), this.start = e, e !== void 0 && (e.outgoingConnections.push(this), this.startDirection = e?.direction, this.startCoords = e?.connectionPoint || [0, 0])), this.updateInView();
708
+ this.start === e ? (this.startDirection = e?.direction, this.startCoords = e?.connectionPoint || [0, 0]) : (this.start !== void 0 && O(this.start.outgoingConnections, this), this.start = e, e !== void 0 && (e.outgoingConnections.push(this), this.startDirection = e?.direction, this.startCoords = e?.connectionPoint || [0, 0])), this.updateInView();
710
709
  }
711
710
  setEnd(e) {
712
- this.end === e ? (this.endDirection = e?.direction, this.endCoords = e?.connectionPoint || [0, 0]) : (this.end !== void 0 && k(this.end.incomingConnections, this), this.end = e, e !== void 0 && (e.incomingConnections.push(this), this.endDirection = e?.direction, this.endCoords = e?.connectionPoint || [0, 0])), this.updateInView();
711
+ this.end === e ? (this.endDirection = e?.direction, this.endCoords = e?.connectionPoint || [0, 0]) : (this.end !== void 0 && O(this.end.incomingConnections, this), this.end = e, e !== void 0 && (e.incomingConnections.push(this), this.endDirection = e?.direction, this.endCoords = e?.connectionPoint || [0, 0])), this.updateInView();
713
712
  }
714
713
  tighten() {
715
714
  let e = this.model.canvas?.allowConnectionLoops || !1, t = this.model.canvas?.allowSharingPorts !== !1, n = this.model.canvas?.allowSharingBothPorts || !1, r = this.model.canvas?.tightenConnectionsAcrossPortTypes || !1;
@@ -743,27 +742,27 @@ var ke = (e) => e == null || e === "" || e instanceof Array && e.length === 0 ||
743
742
  getPriority() {
744
743
  return this.start ? this.end ? Math.min(this.start.getPriority(), this.end.getPriority()) : this.start.getPriority() : this.end ? this.end.getPriority() : 0;
745
744
  }
746
- }, Fe = class extends N {
745
+ }, Ie = class extends N {
747
746
  constructor(e) {
748
- super(), this.types = new we(), this.model = e;
747
+ super(), this.types = new Ne(), this.model = e;
749
748
  }
750
749
  new(e, t, n, r) {
751
750
  let i;
752
- if (e instanceof Pe) i = e;
751
+ if (e instanceof Fe) i = e;
753
752
  else {
754
753
  let t = this.types.get(e);
755
754
  if (t === void 0) throw TypeError(`Connection type with id '${e}' could not be found.`);
756
755
  i = t;
757
756
  }
758
- let a = new I(this.model, i, t, n, r);
757
+ let a = new F(this.model, i, t, n, r);
759
758
  return super.add(a), a.updateInView(), a.valueSet.resetValues(), a.start?.raise(!1), a.end?.raise(!1), a;
760
759
  }
761
760
  remove(e) {
762
761
  let t = this.get(e, !0);
763
- t && (k(t.start?.outgoingConnections || [], t), k(t.end?.incomingConnections || [], t), super.remove(e), t.updateInView());
762
+ t && (O(t.start?.outgoingConnections || [], t), O(t.end?.incomingConnections || [], t), super.remove(e), t.updateInView());
764
763
  }
765
- }, Ie = /* @__PURE__ */ function(e) {
766
- return e[e.OnlyWhenSelected = 0] = "OnlyWhenSelected", e;
764
+ }, I = /* @__PURE__ */ function(e) {
765
+ return e[e.Always = 0] = "Always", e[e.OnlyWhenSelected = 1] = "OnlyWhenSelected", e[e.Never = 2] = "Never", e;
767
766
  }({}), L = {
768
767
  editable: !0,
769
768
  margin: 0,
@@ -775,14 +774,13 @@ var ke = (e) => e == null || e === "" || e instanceof Array && e.length === 0 ||
775
774
  fit: !1,
776
775
  shrink: !0,
777
776
  look: {
778
- lookType: "field-look",
779
777
  fillColor: "transparent",
780
778
  fontColor: "#000000",
781
779
  fontFamily: "'Wonder Unit Sans', sans-serif",
782
780
  fontSize: 10,
783
781
  fontWeight: 400
784
782
  }
785
- }, Le = class extends Te {
783
+ }, Le = class extends Pe {
786
784
  get text() {
787
785
  return this._text;
788
786
  }
@@ -811,7 +809,7 @@ var ke = (e) => e == null || e === "" || e instanceof Array && e.length === 0 ||
811
809
  break;
812
810
  default: this.orientation = 0;
813
811
  }
814
- let g = M(l);
812
+ let g = j(l);
815
813
  this.defaultLook = g.defaultLook, this.selectedLook = g.selectedLook, this.highlightedLook = g.highlightedLook, this.selectedAndHighlightedLook = g.selectedAndHighlightedLook, this.defaultText = u, this._text = u, this.editable = d, this.fit = f, this.shrink = m;
816
814
  }
817
815
  get removed() {
@@ -841,22 +839,44 @@ var ke = (e) => e == null || e === "" || e instanceof Array && e.length === 0 ||
841
839
  let t = this.get(e, !0);
842
840
  t && (t.rootElement?.label !== void 0 && t.rootElement.label === t && (t.rootElement.label = void 0), super.remove(e), t.updateInView());
843
841
  }
844
- }, R = (e) => e?.margin === null || e?.margin === void 0 ? L.margin : typeof e.margin == "number" ? e.margin : e.margin.length === 0 ? L.margin : e.margin.length === 1 || e.margin.length === 2 ? e.margin[0] : (e.margin.length, e.margin[2]), z = (e) => e?.margin === null || e?.margin === void 0 ? L.margin : typeof e.margin == "number" ? e.margin : e.margin.length === 0 ? L.margin : e.margin.length === 1 ? e.margin[0] : e.margin.length === 2 || e.margin.length === 3 ? e.margin[1] : e.margin[3], B = (e) => e?.margin === null || e?.margin === void 0 ? L.margin : typeof e.margin == "number" ? e.margin : e.margin.length === 0 ? L.margin : e.margin.length === 1 ? e.margin[0] : (e.margin.length === 2 || e.margin.length, e.margin[1]), V = (e) => e?.margin === null || e?.margin === void 0 ? L.margin : typeof e.margin == "number" ? e.margin : e.margin.length === 0 ? L.margin : (e.margin.length === 1 || e.margin.length === 2 || e.margin.length, e.margin[0]), ze = (e) => e?.padding === null || e?.padding === void 0 ? L.padding : typeof e.padding == "number" ? e.padding : e.padding.length === 0 ? L.padding : e.padding.length === 1 || e.padding.length === 2 ? e.padding[0] : (e.padding.length, e.padding[2]), Be = (e) => e?.padding === null || e?.padding === void 0 ? L.padding : typeof e.padding == "number" ? e.padding : e.padding.length === 0 ? L.padding : e.padding.length === 1 ? e.padding[0] : e.padding.length === 2 || e.padding.length === 3 ? e.padding[1] : e.padding[3], Ve = (e) => e?.padding === null || e?.padding === void 0 ? L.padding : typeof e.padding == "number" ? e.padding : e.padding.length === 0 ? L.padding : e.padding.length === 1 ? e.padding[0] : (e.padding.length === 2 || e.padding.length, e.padding[1]), He = (e) => e?.padding === null || e?.padding === void 0 ? L.padding : typeof e.padding == "number" ? e.padding : e.padding.length === 0 ? L.padding : (e.padding.length === 1 || e.padding.length === 2 || e.padding.length, e.padding[0]), Ue = class {
842
+ }, R = (e) => e?.margin === null || e?.margin === void 0 ? L.margin : typeof e.margin == "number" ? e.margin : e.margin.length === 1 || e.margin.length === 2 ? e.margin[0] : (e.margin.length, e.margin[2]), z = (e) => e?.margin === null || e?.margin === void 0 ? L.margin : typeof e.margin == "number" ? e.margin : e.margin.length === 1 ? e.margin[0] : e.margin.length === 2 || e.margin.length === 3 ? e.margin[1] : e.margin[3], B = (e) => e?.margin === null || e?.margin === void 0 ? L.margin : typeof e.margin == "number" ? e.margin : e.margin.length === 1 ? e.margin[0] : (e.margin.length === 2 || e.margin.length, e.margin[1]), V = (e) => e?.margin === null || e?.margin === void 0 ? L.margin : typeof e.margin == "number" ? e.margin : (e.margin.length === 1 || e.margin.length === 2 || e.margin.length, e.margin[0]), ze = (e) => e?.padding === null || e?.padding === void 0 ? L.padding : typeof e.padding == "number" ? e.padding : e.padding.length === 1 || e.padding.length === 2 ? e.padding[0] : (e.padding.length, e.padding[2]), Be = (e) => e?.padding === null || e?.padding === void 0 ? L.padding : typeof e.padding == "number" ? e.padding : e.padding.length === 1 ? e.padding[0] : e.padding.length === 2 || e.padding.length === 3 ? e.padding[1] : e.padding[3], Ve = (e) => e?.padding === null || e?.padding === void 0 ? L.padding : typeof e.padding == "number" ? e.padding : e.padding.length === 1 ? e.padding[0] : (e.padding.length === 2 || e.padding.length, e.padding[1]), He = (e) => e?.padding === null || e?.padding === void 0 ? L.padding : typeof e.padding == "number" ? e.padding : (e.padding.length === 1 || e.padding.length === 2 || e.padding.length, e.padding[0]), Ue = {
843
+ mode: I.Never,
844
+ thickness: 10,
845
+ outerMargin: 0,
846
+ look: {
847
+ fillColor: "transparent",
848
+ borderColor: "transparent",
849
+ borderThickness: 0
850
+ }
851
+ }, H = class {
852
+ constructor(e) {
853
+ let t;
854
+ t = typeof e == "boolean" ? { mode: e ? I.Always : I.Never } : typeof e == "string" || typeof e == "number" ? { mode: e } : e, t = {
855
+ ...Ue,
856
+ ...t
857
+ }, this.mode = t.mode, this.thickness = t.thickness, this.outerMargin = t.outerMargin;
858
+ let n = j(t.look ?? Ue.look);
859
+ this.defaultLook = n.defaultLook, this.selectedLook = n.selectedLook, this.highlightedLook = n.highlightedLook, this.selectedAndHighlightedLook = n.selectedAndHighlightedLook;
860
+ }
861
+ getLook(e) {
862
+ return e ? e.selected ? e.highlighted ? this.selectedAndHighlightedLook : this.selectedLook : e.highlighted ? this.highlightedLook : this.defaultLook : this.defaultLook;
863
+ }
864
+ }, We = new H(Ue), Ge = class {
845
865
  constructor(e) {
846
866
  this.margin = e.margin || 0, this.defaultWidths = e.defaultWidths || null, this.defaultHeights = e.defaultHeights || null, this.minWidths = e.minWidths || null, this.minHeights = e.minHeights || null, this.sections = [];
847
867
  for (let t of e.sections) {
848
868
  let e = [];
849
869
  this.sections.push(e);
850
- for (let n of t) e.push(new We(n));
870
+ for (let n of t) e.push(new Ke(n));
851
871
  }
852
872
  }
853
- }, We = class {
873
+ }, Ke = class {
854
874
  constructor(e) {
855
- this.label = e.label || null, this.ports = e.ports || [], this.priority = e.priority || 0, this.resizableX = e.resizableX, this.resizableY = e.resizableY;
856
- let t = M(e.look || Ke);
875
+ this.label = e.label || null, this.ports = e.ports || [], this.priority = e.priority || 0, e.resizableX === void 0 ? this.resizerX = void 0 : this.resizerX = new H(e.resizableX), e.resizableY === void 0 ? this.resizerY = void 0 : this.resizerY = new H(e.resizableY), e.resizableXY === void 0 ? this.resizerXY = void 0 : this.resizerXY = new H(e.resizableXY);
876
+ let t = j(e.look || Je);
857
877
  this.defaultLook = t.defaultLook, this.selectedLook = t.selectedLook, this.highlightedLook = t.highlightedLook, this.selectedAndHighlightedLook = t.selectedAndHighlightedLook;
858
878
  }
859
- }, H = class extends Te {
879
+ }, U = class extends Pe {
860
880
  get name() {
861
881
  return this.label?.text || "";
862
882
  }
@@ -874,7 +894,7 @@ var ke = (e) => e == null || e === "" || e instanceof Array && e.length === 0 ||
874
894
  }
875
895
  set lookConfig(e) {
876
896
  if (this._lookConfig = e, e) {
877
- let t = M(e);
897
+ let t = j(e);
878
898
  this._defaultLook = {
879
899
  ...this._defaultLook,
880
900
  ...t.defaultLook
@@ -918,13 +938,44 @@ var ke = (e) => e == null || e === "" || e instanceof Array && e.length === 0 ||
918
938
  getPriority() {
919
939
  return this.node?.type?.sectionGrid?.sections?.[this.indexYInNode]?.[this.indexXInNode]?.priority || 0;
920
940
  }
941
+ getResizerX() {
942
+ return this.type?.resizerX ?? this.node?.getResizerX() ?? We;
943
+ }
944
+ getResizerY() {
945
+ return this.type?.resizerY ?? this.node?.getResizerY() ?? We;
946
+ }
947
+ getResizerXY() {
948
+ return this.type?.resizerXY ?? this.node?.getResizerXY() ?? We;
949
+ }
921
950
  getResizableX() {
922
951
  let e = this.type;
923
- return e?.resizableX === void 0 ? this.node?.getResizableX() || !1 : e.resizableX === Ie.OnlyWhenSelected ? this.selected : e.resizableX;
952
+ if (e?.resizerX !== void 0) switch (e.resizerX.mode) {
953
+ case I.OnlyWhenSelected: return this.selected;
954
+ case I.Always: return !0;
955
+ case I.Never:
956
+ default: return !1;
957
+ }
958
+ return this.node?.getResizableX() || !1;
924
959
  }
925
960
  getResizableY() {
926
961
  let e = this.type;
927
- return e?.resizableY === void 0 ? this.node?.getResizableY() || !1 : e.resizableY === Ie.OnlyWhenSelected ? this.selected : e.resizableY;
962
+ if (e?.resizerY !== void 0) switch (e.resizerY.mode) {
963
+ case I.OnlyWhenSelected: return this.selected;
964
+ case I.Always: return !0;
965
+ case I.Never:
966
+ default: return !1;
967
+ }
968
+ return this.node?.getResizableY() || !1;
969
+ }
970
+ getResizableXY() {
971
+ let e = this.type;
972
+ if (e?.resizerXY !== void 0) switch (e.resizerXY.mode) {
973
+ case I.OnlyWhenSelected: return this.selected;
974
+ case I.Always: return !0;
975
+ case I.Never:
976
+ default: return !1;
977
+ }
978
+ return this.node?.getResizableXY() || !1;
928
979
  }
929
980
  getClosestPortToPoint(e) {
930
981
  if (this.ports.length !== 0) {
@@ -999,12 +1050,12 @@ var ke = (e) => e == null || e === "" || e instanceof Array && e.length === 0 ||
999
1050
  for (let e of this.decorators) e.move(b(e.coords, t, n, r, i, e.anchorPointX, e.anchorPointY));
1000
1051
  this.model.canvas?.autoTightenConnections !== !1 && this.getConnections().forEach((e) => e.tighten()), this.updateInView();
1001
1052
  }
1002
- }, Ge = class extends N {
1053
+ }, qe = class extends N {
1003
1054
  constructor(e) {
1004
1055
  super(), this.model = e;
1005
1056
  }
1006
1057
  new(e, t, n, r, i, a, o) {
1007
- let s = new H(this.model, e, t, n, r, i, a, o);
1058
+ let s = new U(this.model, e, t, n, r, i, a, o);
1008
1059
  super.add(s), s.updateInView(), e.sections.push(s), e.updateInView();
1009
1060
  let c = e.type.sectionGrid?.sections?.[n]?.[t]?.ports;
1010
1061
  if (c && c.length > 0) for (let e = 0; e < c.length; ++e) {
@@ -1050,12 +1101,12 @@ var ke = (e) => e == null || e === "" || e instanceof Array && e.length === 0 ||
1050
1101
  let t = this.get(e, !0);
1051
1102
  if (t) {
1052
1103
  for (; t.ports.length > 0;) this.model.ports.remove(t.ports[0].id);
1053
- t.label && this.model.fields.remove(t.label.id), t.node && k(t.node.sections, t), super.remove(e), t.updateInView();
1104
+ t.label && this.model.fields.remove(t.label.id), t.node && O(t.node.sections, t), super.remove(e), t.updateInView();
1054
1105
  }
1055
1106
  }
1056
- }, Ke = {
1107
+ }, Je = {
1057
1108
  lookType: "shaped-look",
1058
- shape: ie.Rectangle,
1109
+ shape: ae.Rectangle,
1059
1110
  fillColor: "#FFFFFF",
1060
1111
  borderColor: "#000000",
1061
1112
  borderThickness: 1,
@@ -1064,7 +1115,7 @@ var ke = (e) => e == null || e === "" || e instanceof Array && e.length === 0 ||
1064
1115
  borderColor: "#AA00AA"
1065
1116
  },
1066
1117
  highlighted: { borderThickness: 3 }
1067
- }, U = {
1118
+ }, Ye = {
1068
1119
  name: "",
1069
1120
  defaultWidth: 1,
1070
1121
  defaultHeight: 1,
@@ -1083,28 +1134,28 @@ var ke = (e) => e == null || e === "" || e instanceof Array && e.length === 0 ||
1083
1134
  ports: [],
1084
1135
  decorators: [],
1085
1136
  sectionGrid: null,
1086
- look: Ke,
1137
+ look: Je,
1087
1138
  isUnique: !1,
1088
1139
  canBeParentless: !0,
1089
1140
  childrenTypes: [],
1090
1141
  priority: 0,
1091
1142
  properties: []
1092
- }, qe = class {
1143
+ }, Xe = class {
1093
1144
  constructor(e) {
1094
1145
  let t = {
1095
- ...U,
1146
+ ...Ye,
1096
1147
  ...e
1097
1148
  };
1098
- this.id = t.id, this.name = t.name, this.defaultWidth = t.defaultWidth, this.defaultHeight = t.defaultHeight, this.minWidth = t.minWidth, this.minHeight = t.minHeight, this.resizableX = t.resizableX, this.resizableY = t.resizableY, this.snapToGridOffset = t.snapToGridOffset, this.bottomPadding = Xe(t), this.leftPadding = Ze(t), this.rightPadding = Qe(t), this.topPadding = $e(t), this.label = t.label, this.ports = t.ports, this.decorators = t.decorators, this.sectionGrid = t.sectionGrid ? new Ue(t.sectionGrid) : null;
1099
- let n = M(t.look);
1100
- this.defaultLook = n.defaultLook, this.selectedLook = n.selectedLook, this.highlightedLook = n.highlightedLook, this.selectedAndHighlightedLook = n.selectedAndHighlightedLook, this.isUnique = t.isUnique, this.canBeParentless = t.canBeParentless, this.childrenTypes = t.childrenTypes, this.priority = t.priority, this.propertySet = new De(e?.properties || []);
1149
+ this.id = t.id, this.name = t.name, this.defaultWidth = t.defaultWidth, this.defaultHeight = t.defaultHeight, this.minWidth = t.minWidth, this.minHeight = t.minHeight, e.resizableX === void 0 ? this.resizerX = new H({ mode: I.Never }) : this.resizerX = new H(e.resizableX), e.resizableY === void 0 ? this.resizerY = new H({ mode: I.Never }) : this.resizerY = new H(e.resizableY), e.resizableXY === void 0 ? this.resizerXY = new H({ mode: I.Never }) : this.resizerXY = new H(e.resizableXY), this.snapToGridOffset = t.snapToGridOffset, this.bottomPadding = $e(t), this.leftPadding = et(t), this.rightPadding = tt(t), this.topPadding = nt(t), this.label = t.label, this.ports = t.ports, this.decorators = t.decorators, this.sectionGrid = t.sectionGrid ? new Ge(t.sectionGrid) : null;
1150
+ let n = j(t.look);
1151
+ this.defaultLook = n.defaultLook, this.selectedLook = n.selectedLook, this.highlightedLook = n.highlightedLook, this.selectedAndHighlightedLook = n.selectedAndHighlightedLook, this.isUnique = t.isUnique, this.canBeParentless = t.canBeParentless, this.childrenTypes = t.childrenTypes, this.priority = t.priority, this.propertySet = new Ee(e?.properties || []);
1101
1152
  }
1102
- }, W = class extends Te {
1153
+ }, W = class extends Pe {
1103
1154
  get type() {
1104
1155
  return this._type;
1105
1156
  }
1106
1157
  set type(e) {
1107
- e !== this._type && (this._type = e, this.valueSet &&= new Ne(e.propertySet, this), this.model.canvas?.userSelection?.openInPropertyEditor(this, !1), this.updateInView());
1158
+ e !== this._type && (this._type = e, this.valueSet &&= new Me(e.propertySet, this), this.model.canvas?.userSelection?.openInPropertyEditor(this, !1), this.updateInView());
1108
1159
  }
1109
1160
  get typeString() {
1110
1161
  return this.type.id;
@@ -1132,7 +1183,7 @@ var ke = (e) => e == null || e === "" || e instanceof Array && e.length === 0 ||
1132
1183
  }
1133
1184
  set lookConfig(e) {
1134
1185
  if (this._lookConfig = e, e) {
1135
- let t = M(e);
1186
+ let t = j(e);
1136
1187
  this._defaultLook = {
1137
1188
  ...this._defaultLook,
1138
1189
  ...t.defaultLook
@@ -1151,7 +1202,7 @@ var ke = (e) => e == null || e === "" || e instanceof Array && e.length === 0 ||
1151
1202
  constructor(e, t, n = [0, 0], r) {
1152
1203
  if (e.nodes.get(r) !== void 0) throw Error(`DiagramNode with id "${r}" already exists`);
1153
1204
  if (!r) throw Error("DiagramNode cannot have an empty or null id");
1154
- super(e, r), this.children = [], this.sections = [], this.ports = [], this.decorators = [], this.geometryTimestamp = null, this._type = t, this.valueSet = new Ne(t.propertySet, this), this.originalData = {}, this.coords = n, this.width = t.defaultWidth, this.height = t.defaultHeight;
1205
+ super(e, r), this.children = [], this.sections = [], this.ports = [], this.decorators = [], this.geometryTimestamp = null, this._type = t, this.valueSet = new Me(t.propertySet, this), this.originalData = {}, this.coords = n, this.width = t.defaultWidth, this.height = t.defaultHeight;
1155
1206
  }
1156
1207
  get removed() {
1157
1208
  return this.selfRemoved;
@@ -1170,13 +1221,38 @@ var ke = (e) => e == null || e === "" || e instanceof Array && e.length === 0 ||
1170
1221
  getPriority() {
1171
1222
  return this.type.priority;
1172
1223
  }
1224
+ getResizerX() {
1225
+ return this.type.resizerX;
1226
+ }
1227
+ getResizerY() {
1228
+ return this.type.resizerY;
1229
+ }
1230
+ getResizerXY() {
1231
+ return this.type.resizerXY;
1232
+ }
1173
1233
  getResizableX() {
1174
- let e = this.type.resizableX;
1175
- return e === Ie.OnlyWhenSelected ? this.selected : e;
1234
+ switch (this.type.resizerX.mode) {
1235
+ case I.OnlyWhenSelected: return this.selected;
1236
+ case I.Always: return !0;
1237
+ case I.Never:
1238
+ default: return !1;
1239
+ }
1176
1240
  }
1177
1241
  getResizableY() {
1178
- let e = this.type.resizableY;
1179
- return e === Ie.OnlyWhenSelected ? this.selected : e;
1242
+ switch (this.type.resizerY.mode) {
1243
+ case I.OnlyWhenSelected: return this.selected;
1244
+ case I.Always: return !0;
1245
+ case I.Never:
1246
+ default: return !1;
1247
+ }
1248
+ }
1249
+ getResizableXY() {
1250
+ switch (this.type.resizerXY.mode) {
1251
+ case I.OnlyWhenSelected: return this.selected;
1252
+ case I.Always: return !0;
1253
+ case I.Never:
1254
+ default: return !1;
1255
+ }
1180
1256
  }
1181
1257
  getClosestPortToPoint(e) {
1182
1258
  if (this.ports.length !== 0) {
@@ -1256,7 +1332,7 @@ var ke = (e) => e == null || e === "" || e instanceof Array && e.length === 0 ||
1256
1332
  n || this.children.indexOf(e) >= 0 || (this.fitToChild(e), this.children.push(e), e.parent = this, e.raise());
1257
1333
  }
1258
1334
  removeChild(e) {
1259
- k(this.children, e), e.parent = void 0;
1335
+ O(this.children, e), e.parent = void 0;
1260
1336
  }
1261
1337
  fitToChild(e) {
1262
1338
  let t = Math.max(...this.sections.map((e) => e.indexXInNode)), n = Math.max(...this.sections.map((e) => e.indexYInNode)), r = this.coords[0] - e.coords[0] + this.type.leftPadding;
@@ -1395,13 +1471,13 @@ var ke = (e) => e == null || e === "" || e instanceof Array && e.length === 0 ||
1395
1471
  for (let i of r) i.indexYInNode > e && (++i.indexYInNode, i.move([i.coords[0], i.coords[1] + n + t]));
1396
1472
  this.stretch(p.Bottom, t + n);
1397
1473
  }
1398
- }, Je = class extends N {
1474
+ }, Ze = class extends N {
1399
1475
  constructor(e) {
1400
- super(), this.types = new we(), this.model = e;
1476
+ super(), this.types = new Ne(), this.model = e;
1401
1477
  }
1402
1478
  new(e, t, n) {
1403
1479
  let r;
1404
- if (e instanceof qe) r = e;
1480
+ if (e instanceof Xe) r = e;
1405
1481
  else {
1406
1482
  let t = this.types.get(e);
1407
1483
  if (t === void 0) throw TypeError(`Node type with id '${e}' could not be found.`);
@@ -1461,7 +1537,7 @@ var ke = (e) => e == null || e === "" || e instanceof Array && e.length === 0 ||
1461
1537
  remove(e) {
1462
1538
  let t = this.get(e, !0);
1463
1539
  if (t) {
1464
- for (t.parent && k(t.parent.children, t); t.children.length > 0;) this.model.nodes.remove(t.children[0].id);
1540
+ for (t.parent && O(t.parent.children, t); t.children.length > 0;) this.model.nodes.remove(t.children[0].id);
1465
1541
  for (; t.sections.length > 0;) this.model.sections.remove(t.sections[0].id);
1466
1542
  for (; t.ports.length > 0;) this.model.ports.remove(t.ports[0].id);
1467
1543
  for (; t.decorators.length > 0;) this.model.decorators.remove(t.decorators[0].id);
@@ -1473,10 +1549,10 @@ var ke = (e) => e == null || e === "" || e instanceof Array && e.length === 0 ||
1473
1549
  for (let r of this) r.coords[0] < e && e < r.coords[0] + r.width && r.coords[1] < t && t < r.coords[1] + r.height && n.push(r);
1474
1550
  return n;
1475
1551
  }
1476
- }, Ye = (e) => {
1552
+ }, Qe = (e) => {
1477
1553
  for (let t = 0; t < e.length; ++t) for (let n = 0; n < e.length; ++n) n !== t && e[n].isAncestorOf(e[t]) && (e.splice(n, 1), --n, t > n && --t);
1478
1554
  return e;
1479
- }, Xe = (e) => e?.padding === null || e?.padding === void 0 ? U.padding : typeof e.padding == "number" ? e.padding : e.padding.length === 0 ? U.padding : e.padding.length === 1 || e.padding.length === 2 ? e.padding[0] : (e.padding.length, e.padding[2]), Ze = (e) => e?.padding === null || e?.padding === void 0 ? U.padding : typeof e.padding == "number" ? e.padding : e.padding.length === 0 ? U.padding : e.padding.length === 1 ? e.padding[0] : e.padding.length === 2 || e.padding.length === 3 ? e.padding[1] : e.padding[3], Qe = (e) => e?.padding === null || e?.padding === void 0 ? U.padding : typeof e.padding == "number" ? e.padding : e.padding.length === 0 ? U.padding : e.padding.length === 1 ? e.padding[0] : (e.padding.length === 2 || e.padding.length, e.padding[1]), $e = (e) => e?.padding === null || e?.padding === void 0 ? U.padding : typeof e.padding == "number" ? e.padding : e.padding.length === 0 ? U.padding : (e.padding.length === 1 || e.padding.length === 2 || e.padding.length, e.padding[0]), et = class extends Te {
1555
+ }, $e = (e) => e?.padding === null || e?.padding === void 0 ? Ye.padding : typeof e.padding == "number" ? e.padding : e.padding.length === 1 || e.padding.length === 2 ? e.padding[0] : (e.padding.length, e.padding[2]), et = (e) => e?.padding === null || e?.padding === void 0 ? Ye.padding : typeof e.padding == "number" ? e.padding : e.padding.length === 1 ? e.padding[0] : e.padding.length === 2 || e.padding.length === 3 ? e.padding[1] : e.padding[3], tt = (e) => e?.padding === null || e?.padding === void 0 ? Ye.padding : typeof e.padding == "number" ? e.padding : e.padding.length === 1 ? e.padding[0] : (e.padding.length === 2 || e.padding.length, e.padding[1]), nt = (e) => e?.padding === null || e?.padding === void 0 ? Ye.padding : typeof e.padding == "number" ? e.padding : (e.padding.length === 1 || e.padding.length === 2 || e.padding.length, e.padding[0]), rt = class extends Pe {
1480
1556
  constructor(e, t, n, r, i, a, o, s, c = "floating", l = "floating") {
1481
1557
  if (e.objects.get(s) !== void 0) throw Error(`DiagramDecorator with id "${s}" already exists`);
1482
1558
  if (!s) throw Error("DiagramDecorator cannot have an empty or null id");
@@ -1497,19 +1573,19 @@ var ke = (e) => e == null || e === "" || e instanceof Array && e.length === 0 ||
1497
1573
  getPriority() {
1498
1574
  return this.priority;
1499
1575
  }
1500
- }, tt = class extends N {
1576
+ }, it = class extends N {
1501
1577
  constructor(e) {
1502
1578
  super(), this.model = e;
1503
1579
  }
1504
1580
  new(e, t, n, r, i, a, o, s = "floating", c = "floating") {
1505
- let l = new et(this.model, e, t, n, r, i, a, o, s, c);
1581
+ let l = new rt(this.model, e, t, n, r, i, a, o, s, c);
1506
1582
  return super.add(l), l.updateInView(), e !== void 0 && e.decorators.push(l), l;
1507
1583
  }
1508
1584
  remove(e) {
1509
1585
  let t = this.get(e, !0);
1510
- t && ((t.rootElement instanceof W || t.rootElement instanceof H) && k(t.rootElement.decorators, t), super.remove(e), t.updateInView());
1586
+ t && ((t.rootElement instanceof W || t.rootElement instanceof U) && O(t.rootElement.decorators, t), super.remove(e), t.updateInView());
1511
1587
  }
1512
- }, nt = class extends Te {
1588
+ }, at = class extends Pe {
1513
1589
  constructor(e, t, n, r, i, a, o) {
1514
1590
  if (e.objects.get(o) !== void 0) throw Error(`DiagramObject with id "${o}" already exists`);
1515
1591
  if (!o) throw Error("DiagramObject cannot have an empty or null id");
@@ -1530,44 +1606,44 @@ var ke = (e) => e == null || e === "" || e instanceof Array && e.length === 0 ||
1530
1606
  getPriority() {
1531
1607
  return this.priority;
1532
1608
  }
1533
- }, rt = class extends N {
1609
+ }, ot = class extends N {
1534
1610
  constructor(e) {
1535
1611
  super(), this.model = e;
1536
1612
  }
1537
1613
  new(e, t, n, r, i, a) {
1538
- let o = new nt(this.model, e, t, n, r, i, a);
1614
+ let o = new at(this.model, e, t, n, r, i, a);
1539
1615
  return super.add(o), o.updateInView(), o;
1540
1616
  }
1541
1617
  remove(e) {
1542
1618
  let t = this.get(e, !0);
1543
1619
  t && (super.remove(e), t.updateInView());
1544
1620
  }
1545
- }, it = {
1621
+ }, st = {
1546
1622
  lookType: "shaped-look",
1547
- shape: ie.Ellipse,
1623
+ shape: ae.Ellipse,
1548
1624
  fillColor: "transparent",
1549
1625
  borderColor: "transparent",
1550
1626
  borderThickness: 0,
1551
1627
  selected: { fillColor: "rgba(255, 0, 255, 0.5)" },
1552
1628
  highlighted: { fillColor: "rgba(0, 255, 255, 0.5)" }
1553
- }, at = M(it), ot = {
1629
+ }, ct = j(st), lt = {
1554
1630
  name: "",
1555
1631
  label: null,
1556
1632
  allowsOutgoing: !0,
1557
1633
  allowsIncoming: !0,
1558
1634
  width: 24,
1559
- look: it
1560
- }, st = class {
1635
+ look: st
1636
+ }, ut = class {
1561
1637
  constructor(e) {
1562
1638
  let t = {
1563
- ...ot,
1639
+ ...lt,
1564
1640
  ...e
1565
1641
  };
1566
1642
  this.id = t.id, this.name = t.name, this.label = t.label, this.allowsOutgoing = t.allowsOutgoing, this.allowsIncoming = t.allowsIncoming, this.width = t.width;
1567
- let n = M(t.look);
1643
+ let n = j(t.look);
1568
1644
  this.defaultLook = n.defaultLook, this.selectedLook = n.selectedLook, this.highlightedLook = n.highlightedLook, this.selectedAndHighlightedLook = n.selectedAndHighlightedLook;
1569
1645
  }
1570
- }, ct = class extends Te {
1646
+ }, dt = class extends Pe {
1571
1647
  get type() {
1572
1648
  return this._type;
1573
1649
  }
@@ -1597,7 +1673,7 @@ var ke = (e) => e == null || e === "" || e instanceof Array && e.length === 0 ||
1597
1673
  this.label && (this.label.text = e);
1598
1674
  }
1599
1675
  get look() {
1600
- return this.selected ? this.highlighted ? this._selectedAndHighlightedLook === void 0 ? (this.type || at)?.selectedAndHighlightedLook : this._selectedAndHighlightedLook : this._selectedLook === void 0 ? (this.type || at)?.selectedLook : this._selectedLook : this.highlighted ? this._highlightedLook === void 0 ? (this.type || at)?.highlightedLook : this._highlightedLook : this._defaultLook === void 0 ? (this.type || at)?.defaultLook : this._defaultLook;
1676
+ return this.selected ? this.highlighted ? this._selectedAndHighlightedLook === void 0 ? (this.type || ct)?.selectedAndHighlightedLook : this._selectedAndHighlightedLook : this._selectedLook === void 0 ? (this.type || ct)?.selectedLook : this._selectedLook : this.highlighted ? this._highlightedLook === void 0 ? (this.type || ct)?.highlightedLook : this._highlightedLook : this._defaultLook === void 0 ? (this.type || ct)?.defaultLook : this._defaultLook;
1601
1677
  }
1602
1678
  set look(e) {
1603
1679
  this.lookConfig = e;
@@ -1607,7 +1683,7 @@ var ke = (e) => e == null || e === "" || e instanceof Array && e.length === 0 ||
1607
1683
  }
1608
1684
  set lookConfig(e) {
1609
1685
  if (this._lookConfig = e, e) {
1610
- let t = M(e);
1686
+ let t = j(e);
1611
1687
  this._defaultLook = {
1612
1688
  ...this._defaultLook,
1613
1689
  ...t.defaultLook
@@ -1624,7 +1700,7 @@ var ke = (e) => e == null || e === "" || e instanceof Array && e.length === 0 ||
1624
1700
  } else this._defaultLook = e, this._selectedLook = e, this._highlightedLook = e, this._selectedAndHighlightedLook = e;
1625
1701
  }
1626
1702
  get width() {
1627
- return this.type?.width || ot.width;
1703
+ return this.type?.width || lt.width;
1628
1704
  }
1629
1705
  get height() {
1630
1706
  return this.width;
@@ -1654,7 +1730,7 @@ var ke = (e) => e == null || e === "" || e instanceof Array && e.length === 0 ||
1654
1730
  }
1655
1731
  getNode() {
1656
1732
  if (this.rootElement instanceof W) return this.rootElement;
1657
- if (this.rootElement instanceof H) return this.rootElement.node;
1733
+ if (this.rootElement instanceof U) return this.rootElement.node;
1658
1734
  }
1659
1735
  getPriority() {
1660
1736
  return this.rootElement?.getPriority() || 0;
@@ -1669,12 +1745,12 @@ var ke = (e) => e == null || e === "" || e instanceof Array && e.length === 0 ||
1669
1745
  distanceTo(e) {
1670
1746
  return x(this.coords, e);
1671
1747
  }
1672
- }, lt = class extends N {
1748
+ }, ft = class extends N {
1673
1749
  constructor(e) {
1674
- super(), this.types = new we(), this.model = e;
1750
+ super(), this.types = new Ne(), this.model = e;
1675
1751
  }
1676
1752
  new(e, t, n, r, i, a, o = "floating", s = "floating") {
1677
- let c = new ct(this.model, e, t, n, r, i, a, o, s);
1753
+ let c = new dt(this.model, e, t, n, r, i, a, o, s);
1678
1754
  return super.add(c), c.updateInView(), t !== void 0 && t.ports.push(c), c;
1679
1755
  }
1680
1756
  remove(e) {
@@ -1682,16 +1758,16 @@ var ke = (e) => e == null || e === "" || e instanceof Array && e.length === 0 ||
1682
1758
  if (t) {
1683
1759
  for (; t.outgoingConnections.length > 0;) this.model.connections.remove(t.outgoingConnections[0].id);
1684
1760
  for (; t.incomingConnections.length > 0;) this.model.connections.remove(t.incomingConnections[0].id);
1685
- t.label && this.model.fields.remove(t.label.id), (t.rootElement instanceof W || t.rootElement instanceof H) && k(t.rootElement.ports, t), super.remove(e), t.updateInView();
1761
+ t.label && this.model.fields.remove(t.label.id), (t.rootElement instanceof W || t.rootElement instanceof U) && O(t.rootElement.ports, t), super.remove(e), t.updateInView();
1686
1762
  }
1687
1763
  }
1688
- }, ut = class {
1764
+ }, pt = class {
1689
1765
  import(e, t) {
1690
1766
  e.clear(), t.id && (e.id = t.id), e.name = t.name, e.description = t.description, e.type = t.type, e.createdAt = new Date(t.createdAt), e.updatedAt = new Date(t.updatedAt);
1691
1767
  for (let n of t.nodes || []) this.importNode(e, n);
1692
1768
  for (let n of t.connections || []) this.importConnection(e, n);
1693
1769
  for (let n of t.objects || []) {
1694
- let t = new nt(e, n.coords, n.width, n.height, n.priority, n.svg, n.id);
1770
+ let t = new at(e, n.coords, n.width, n.height, n.priority, n.svg, n.id);
1695
1771
  n.collabMeta && (t.selfRemoved = n.collabMeta.selfRemoved), e.objects.add(t), t.updateInView();
1696
1772
  }
1697
1773
  return t.data && e.valueSet.setValues(t.data), t.collabMeta && (e.logicalClock = t.collabMeta.logicalClock, e.valueSet.setTimestamps(t.collabMeta.dataTimestamps)), e;
@@ -1717,7 +1793,7 @@ var ke = (e) => e == null || e === "" || e instanceof Array && e.length === 0 ||
1717
1793
  t !== void 0 && (r.children?.push(t), t.parent = r);
1718
1794
  }
1719
1795
  for (let i of t.sections || []) {
1720
- let t = new H(e, r, i.indexXInNode, i.indexYInNode, i.coords, i.width, i.height, i.id);
1796
+ let t = new U(e, r, i.indexXInNode, i.indexYInNode, i.coords, i.width, i.height, i.id);
1721
1797
  if (r.sections?.push(t), e.sections.add(t), n.sectionGrid?.sections?.[i.indexYInNode]?.[i.indexXInNode]?.label) {
1722
1798
  let r = {
1723
1799
  ...L,
@@ -1732,7 +1808,7 @@ var ke = (e) => e == null || e === "" || e instanceof Array && e.length === 0 ||
1732
1808
  }
1733
1809
  let a = 0;
1734
1810
  for (let r of i.ports || []) {
1735
- let i = r.type === void 0 ? void 0 : e.ports.types.get(r.type), o = new ct(e, i, t, r.coords, r.connectionPoint || r.coords, r.direction, r.id);
1811
+ let i = r.type === void 0 ? void 0 : e.ports.types.get(r.type), o = new dt(e, i, t, r.coords, r.connectionPoint || r.coords, r.direction, r.id);
1736
1812
  if (t.ports.push(o), e.ports.add(o), r.label) {
1737
1813
  if (n.ports.length > a && i?.label) {
1738
1814
  let t = {
@@ -1765,14 +1841,14 @@ var ke = (e) => e == null || e === "" || e instanceof Array && e.length === 0 ||
1765
1841
  r.collabMeta && (o.selfRemoved = r.collabMeta.selfRemoved, o.selfRemovedTimestamp = r.collabMeta.selfRemovedTimestamp, this.importLabelCollabMeta(o.label, r.collabMeta.label)), o.updateInView();
1766
1842
  }
1767
1843
  for (let n of i.decorators || []) {
1768
- let i = new et(e, t, n.coords, n.width, n.height, n.priority, n.svg, n.id, n.anchorPoints[0], n.anchorPoints[1]);
1844
+ let i = new rt(e, t, n.coords, n.width, n.height, n.priority, n.svg, n.id, n.anchorPoints[0], n.anchorPoints[1]);
1769
1845
  n.collabMeta && (i.selfRemoved = n.collabMeta.selfRemoved), r.decorators.push(i), e.decorators.add(i), i.updateInView();
1770
1846
  }
1771
1847
  i.collabMeta && (t.selfRemoved = i.collabMeta.selfRemoved, t.selfRemovedTimestamp = i.collabMeta.selfRemovedTimestamp, this.importLabelCollabMeta(t.label, i.collabMeta.label)), t.updateInView();
1772
1848
  }
1773
1849
  let i = 0;
1774
1850
  for (let a of t.ports || []) {
1775
- let t = a.type === void 0 ? void 0 : e.ports.types.get(a.type), o = new ct(e, t, r, a.coords, a.connectionPoint || a.coords, a.direction, a.id);
1851
+ let t = a.type === void 0 ? void 0 : e.ports.types.get(a.type), o = new dt(e, t, r, a.coords, a.connectionPoint || a.coords, a.direction, a.id);
1776
1852
  if (r.ports.push(o), e.ports.add(o), a.label) {
1777
1853
  if (n.ports.length > i && t?.label) {
1778
1854
  let n = {
@@ -1805,7 +1881,7 @@ var ke = (e) => e == null || e === "" || e instanceof Array && e.length === 0 ||
1805
1881
  a.collabMeta && (o.selfRemoved = a.collabMeta.selfRemoved, o.selfRemovedTimestamp = a.collabMeta.selfRemovedTimestamp, this.importLabelCollabMeta(o.label, a.collabMeta.label)), o.updateInView();
1806
1882
  }
1807
1883
  for (let n of t.decorators || []) {
1808
- let t = new et(e, r, n.coords, n.width, n.height, n.priority, n.svg, n.id, n.anchorPoints[0], n.anchorPoints[1]);
1884
+ let t = new rt(e, r, n.coords, n.width, n.height, n.priority, n.svg, n.id, n.anchorPoints[0], n.anchorPoints[1]);
1809
1885
  n.collabMeta && (t.selfRemoved = n.collabMeta.selfRemoved), r.decorators.push(t), e.decorators.add(t), t.updateInView();
1810
1886
  }
1811
1887
  return t.data && r.valueSet.setValues(t.data), t.collabMeta && (r.selfRemoved = t.collabMeta.selfRemoved, r.selfRemovedTimestamp = t.collabMeta.selfRemovedTimestamp, r.geometryTimestamp = t.collabMeta.geometryTimestamp, this.importLabelCollabMeta(r.label, t.collabMeta.label), r.valueSet.setTimestamps(t.collabMeta.dataTimestamps)), r.updateInView(), r.raise(), r;
@@ -1814,20 +1890,20 @@ var ke = (e) => e == null || e === "" || e instanceof Array && e.length === 0 ||
1814
1890
  importConnection(e, t) {
1815
1891
  let n = e.connections.types.get(t.type);
1816
1892
  if (n) {
1817
- let r = new I(e, n, t.start ? e.ports.get(t.start) : void 0, t.end ? e.ports.get(t.end) : void 0, t.id);
1893
+ let r = new F(e, n, t.start ? e.ports.get(t.start) : void 0, t.end ? e.ports.get(t.end) : void 0, t.id);
1818
1894
  return e.connections.add(r), r.startLabel = t.startLabel, r.middleLabel = t.middleLabel, r.endLabel = t.endLabel, r.points = t.points, t.data && r.valueSet.setValues(t.data), t.collabMeta && (r.selfRemoved = t.collabMeta.selfRemoved, r.selfRemovedTimestamp = t.collabMeta.selfRemovedTimestamp, r.valueSet.setTimestamps(t.collabMeta.dataTimestamps)), r.updateInView(), r.raise(), r;
1819
1895
  }
1820
1896
  }
1821
1897
  importLabelCollabMeta(e, t) {
1822
1898
  e && t && (e.selfRemoved = t.selfRemoved, e.selfRemovedTimestamp = t.selfRemovedTimestamp, e.textTimestamp = t.textTimestamp);
1823
1899
  }
1824
- }, dt = class e {
1900
+ }, mt = class e {
1825
1901
  constructor(e, t, n, r, i, a, o) {
1826
1902
  this.canvas = e, this.id = t, this.typeId = n, this.coords = r, this.parentId = i, this.label = a, this.values = o;
1827
1903
  }
1828
1904
  do() {
1829
1905
  let e = this.canvas.model.nodes.new(this.typeId, this.coords, this.id);
1830
- this.parentId !== void 0 && this.canvas.model.nodes.get(this.parentId)?.addChild(e), e.label && (e.label.text = this.label || ""), this.values === void 0 ? e.valueSet.resetValues() : e.valueSet.setValues(Ce({
1906
+ this.parentId !== void 0 && this.canvas.model.nodes.get(this.parentId)?.addChild(e), e.label && (e.label.text = this.label || ""), this.values === void 0 ? e.valueSet.resetValues() : e.valueSet.setValues(we({
1831
1907
  ...e.valueSet.getValues(),
1832
1908
  ...this.values
1833
1909
  }));
@@ -1846,13 +1922,13 @@ var ke = (e) => e == null || e === "" || e instanceof Array && e.length === 0 ||
1846
1922
  static deserialize(t, n) {
1847
1923
  return new e(t, n.id, n.typeId, n.coords, n.parentId, n.label, n.values);
1848
1924
  }
1849
- }, ft = class e {
1925
+ }, ht = class e {
1850
1926
  constructor(e, t, n, r, i, a, o) {
1851
1927
  this.canvas = e, this.nodeId = t, this.copyColumnIndex = n, this.copyRowIndex = r, this.removeColumnIndex = i, this.removeRowIndex = a, this.timestamp = o;
1852
1928
  }
1853
1929
  do() {
1854
1930
  let e = this.canvas.model.nodes.get(this.nodeId);
1855
- e && Oe(this.timestamp, e.geometryTimestamp) && (this.copyColumnIndex !== void 0 && e.copySectionColumn(this.copyColumnIndex), this.copyRowIndex !== void 0 && e.copySectionRow(this.copyRowIndex), this.removeColumnIndex !== void 0 && e.removeSectionColumn(this.removeColumnIndex), this.removeRowIndex !== void 0 && e.removeSectionRow(this.removeRowIndex), e.geometryTimestamp = this.timestamp);
1931
+ e && De(this.timestamp, e.geometryTimestamp) && (this.copyColumnIndex !== void 0 && e.copySectionColumn(this.copyColumnIndex), this.copyRowIndex !== void 0 && e.copySectionRow(this.copyRowIndex), this.removeColumnIndex !== void 0 && e.removeSectionColumn(this.removeColumnIndex), this.removeRowIndex !== void 0 && e.removeSectionRow(this.removeRowIndex), e.geometryTimestamp = this.timestamp);
1856
1932
  }
1857
1933
  serialize() {
1858
1934
  return {
@@ -1868,14 +1944,14 @@ var ke = (e) => e == null || e === "" || e instanceof Array && e.length === 0 ||
1868
1944
  static deserialize(t, n) {
1869
1945
  return new e(t, n.nodeId, n.copyColumnIndex, n.copyRowIndex, n.removeColumnIndex, n.removeRowIndex, n.timestamp);
1870
1946
  }
1871
- }, pt = class e {
1947
+ }, gt = class e {
1872
1948
  constructor(e, t, n) {
1873
1949
  this.canvas = e, this.to = t, this.timestamp = n;
1874
1950
  }
1875
1951
  do() {
1876
1952
  for (let e in this.to) {
1877
1953
  let t = this.canvas.model.nodes.get(e, !0);
1878
- if (t && Oe(this.timestamp, t.geometryTimestamp)) {
1954
+ if (t && De(this.timestamp, t.geometryTimestamp)) {
1879
1955
  let n = this.to[e];
1880
1956
  t.move([n[0], n[1]]), t.geometryTimestamp = this.timestamp;
1881
1957
  }
@@ -1891,14 +1967,14 @@ var ke = (e) => e == null || e === "" || e instanceof Array && e.length === 0 ||
1891
1967
  static deserialize(t, n) {
1892
1968
  return new e(t, n.to, n.timestamp);
1893
1969
  }
1894
- }, mt = class e {
1970
+ }, _t = class e {
1895
1971
  constructor(e, t, n, r) {
1896
1972
  this.canvas = e, this.nodeIds = t, this.delta = n, this.timestamp = r;
1897
1973
  }
1898
1974
  do() {
1899
1975
  for (let e of this.nodeIds) {
1900
1976
  let t = this.canvas.model.nodes.get(e, !0);
1901
- t && Oe(this.timestamp, t.geometryTimestamp) && (t.move([t.coords[0] + this.delta[0], t.coords[1] + this.delta[1]]), t.parent?.fitToChild(t), t.geometryTimestamp = this.timestamp);
1977
+ t && De(this.timestamp, t.geometryTimestamp) && (t.move([t.coords[0] + this.delta[0], t.coords[1] + this.delta[1]]), t.parent?.fitToChild(t), t.geometryTimestamp = this.timestamp);
1902
1978
  }
1903
1979
  }
1904
1980
  serialize() {
@@ -1918,7 +1994,7 @@ var ke = (e) => e == null || e === "" || e instanceof Array && e.length === 0 ||
1918
1994
  }
1919
1995
  do() {
1920
1996
  let e = this.canvas.model.nodes.get(this.nodeId, !0);
1921
- if (e && Oe(this.timestamp, e.geometryTimestamp)) {
1997
+ if (e && De(this.timestamp, e.geometryTimestamp)) {
1922
1998
  e.setGeometry(this.to), e.label?.fit && this.canvas.fitFieldRootInView(e.label.id, e.label.shrink);
1923
1999
  for (let t of e.sections) t.label?.fit && this.canvas.fitFieldRootInView(t.label.id, t.label.shrink);
1924
2000
  e.parent?.fitToChild(e), e.geometryTimestamp = this.timestamp;
@@ -1935,13 +2011,13 @@ var ke = (e) => e == null || e === "" || e instanceof Array && e.length === 0 ||
1935
2011
  static deserialize(t, n) {
1936
2012
  return new e(t, n.nodeId, n.to, n.timestamp);
1937
2013
  }
1938
- }, ht = class e {
2014
+ }, vt = class e {
1939
2015
  constructor(e, t, n, r, i) {
1940
2016
  this.canvas = e, this.childId = t, this.parentId = n, this.childGeometry = r, this.timestamp = i;
1941
2017
  }
1942
2018
  do() {
1943
2019
  let e = this.canvas.model.nodes.get(this.childId, !0), t = this.parentId === void 0 ? void 0 : this.canvas.model.nodes.get(this.parentId, !0);
1944
- e && (this.parentId === void 0 || t) && Oe(this.timestamp, e.geometryTimestamp) && (e.parent?.removeChild(e), e.setGeometry(this.childGeometry), t?.addChild(e));
2020
+ e && (this.parentId === void 0 || t) && De(this.timestamp, e.geometryTimestamp) && (e.parent?.removeChild(e), e.setGeometry(this.childGeometry), t?.addChild(e));
1945
2021
  }
1946
2022
  serialize() {
1947
2023
  return {
@@ -1955,7 +2031,7 @@ var ke = (e) => e == null || e === "" || e instanceof Array && e.length === 0 ||
1955
2031
  static deserialize(t, n) {
1956
2032
  return new e(t, n.childId, n.parentId, n.childGeometry, n.timestamp);
1957
2033
  }
1958
- }, gt = class e {
2034
+ }, yt = class e {
1959
2035
  constructor(e, t, n, r, i) {
1960
2036
  this.canvas = e, this.id = t, this.typeId = n, this.startId = r, this.endId = i;
1961
2037
  }
@@ -1975,13 +2051,13 @@ var ke = (e) => e == null || e === "" || e instanceof Array && e.length === 0 ||
1975
2051
  static deserialize(t, n) {
1976
2052
  return new e(t, n.id, n.typeId, n.startId, n.endId);
1977
2053
  }
1978
- }, _t = class e {
2054
+ }, bt = class e {
1979
2055
  constructor(e, t, n, r) {
1980
2056
  this.canvas = e, this.fieldId = t, this.to = n, this.timestamp = r;
1981
2057
  }
1982
2058
  do() {
1983
2059
  let e = this.canvas.model.fields.get(this.fieldId, !0);
1984
- e && Oe(this.timestamp, e.textTimestamp) && (e.text = this.to, e.textTimestamp = this.timestamp);
2060
+ e && De(this.timestamp, e.textTimestamp) && (e.text = this.to, e.textTimestamp = this.timestamp);
1985
2061
  }
1986
2062
  serialize() {
1987
2063
  return {
@@ -1994,7 +2070,7 @@ var ke = (e) => e == null || e === "" || e instanceof Array && e.length === 0 ||
1994
2070
  static deserialize(t, n) {
1995
2071
  return new e(t, n.fieldId, n.to, n.timestamp);
1996
2072
  }
1997
- }, vt = class e {
2073
+ }, xt = class e {
1998
2074
  constructor(e, t, n, r) {
1999
2075
  this.canvas = e, this.id = t, this.to = n, this.timestamp = r;
2000
2076
  }
@@ -2015,12 +2091,12 @@ var ke = (e) => e == null || e === "" || e instanceof Array && e.length === 0 ||
2015
2091
  static deserialize(t, n) {
2016
2092
  return new e(t, n.id, n.to, n.timestamp);
2017
2093
  }
2018
- }, yt = class e {
2094
+ }, St = class e {
2019
2095
  constructor(e, t, n, r, i, a, o, s) {
2020
2096
  this.canvas = e, this.nodeIds = t, this.sectionIds = n, this.portIds = r, this.connectionIds = i, this.fieldIds = a, this.selfRemoved = o, this.timestamp = s;
2021
2097
  }
2022
2098
  doOne(e) {
2023
- e && Oe(this.timestamp, e.selfRemovedTimestamp) && (e.selfRemoved = this.selfRemoved, e.selfRemovedTimestamp = this.timestamp);
2099
+ e && De(this.timestamp, e.selfRemovedTimestamp) && (e.selfRemoved = this.selfRemoved, e.selfRemovedTimestamp = this.timestamp);
2024
2100
  }
2025
2101
  do() {
2026
2102
  for (let e of this.nodeIds) this.doOne(this.canvas.model.nodes.get(e, !0));
@@ -2045,12 +2121,12 @@ var ke = (e) => e == null || e === "" || e instanceof Array && e.length === 0 ||
2045
2121
  static deserialize(t, n) {
2046
2122
  return new e(t, n.nodeIds, n.sectionIds, n.portIds, n.connectionIds, n.fieldIds, n.removed, n.timestamp);
2047
2123
  }
2048
- }, bt = class e {
2124
+ }, Ct = class e {
2049
2125
  constructor(e, t, n) {
2050
2126
  this.canvas = e, this.nodes = t, this.connections = n;
2051
2127
  }
2052
2128
  do() {
2053
- let e = new ut();
2129
+ let e = new pt();
2054
2130
  this.canvas.userSelection.clear();
2055
2131
  for (let t of this.nodes) {
2056
2132
  let n = e.importNode(this.canvas.model, t);
@@ -2071,15 +2147,15 @@ var ke = (e) => e == null || e === "" || e instanceof Array && e.length === 0 ||
2071
2147
  static deserialize(t, n) {
2072
2148
  return new e(t, n.nodes, n.connections);
2073
2149
  }
2074
- }, xt = class {
2150
+ }, wt = class {
2075
2151
  constructor(e) {
2076
- this.isInRoom = !1, this.canvas = e, this.replicaId = xe();
2152
+ this.isInRoom = !1, this.canvas = e, this.replicaId = Se();
2077
2153
  }
2078
2154
  freshTimestamp() {
2079
2155
  return this.canvas.model.logicalClock++, [this.canvas.model.logicalClock, this.replicaId];
2080
2156
  }
2081
2157
  freshId() {
2082
- return "id" + xe();
2158
+ return "id" + Se();
2083
2159
  }
2084
2160
  doCollaboratively(e) {
2085
2161
  if (e.do(), this.onSend) {
@@ -2090,42 +2166,42 @@ var ke = (e) => e == null || e === "" || e instanceof Array && e.length === 0 ||
2090
2166
  receive(e) {
2091
2167
  switch ("timestamp" in e && (this.canvas.model.logicalClock = Math.max(this.canvas.model.logicalClock, e.timestamp[0])), e.type) {
2092
2168
  case "addNode":
2093
- dt.deserialize(this.canvas, e).do();
2169
+ mt.deserialize(this.canvas, e).do();
2094
2170
  break;
2095
2171
  case "addSection":
2096
- ft.deserialize(this.canvas, e).do();
2172
+ ht.deserialize(this.canvas, e).do();
2097
2173
  break;
2098
2174
  case "applyLayout":
2099
- pt.deserialize(this.canvas, e).do();
2175
+ gt.deserialize(this.canvas, e).do();
2100
2176
  break;
2101
2177
  case "move":
2102
- mt.deserialize(this.canvas, e).do();
2178
+ _t.deserialize(this.canvas, e).do();
2103
2179
  break;
2104
2180
  case "setGeometry":
2105
2181
  G.deserialize(this.canvas, e).do();
2106
2182
  break;
2107
2183
  case "setParent":
2108
- ht.deserialize(this.canvas, e).do();
2184
+ vt.deserialize(this.canvas, e).do();
2109
2185
  break;
2110
2186
  case "addConnection":
2111
- gt.deserialize(this.canvas, e).do();
2187
+ yt.deserialize(this.canvas, e).do();
2112
2188
  break;
2113
2189
  case "editField":
2114
- _t.deserialize(this.canvas, e).do();
2190
+ bt.deserialize(this.canvas, e).do();
2115
2191
  break;
2116
2192
  case "updateValues":
2117
- vt.deserialize(this.canvas, e).do();
2193
+ xt.deserialize(this.canvas, e).do();
2118
2194
  break;
2119
2195
  case "setSelfRemoved":
2120
- yt.deserialize(this.canvas, e).do();
2196
+ St.deserialize(this.canvas, e).do();
2121
2197
  break;
2122
2198
  case "paste":
2123
- bt.deserialize(this.canvas, e).do();
2199
+ Ct.deserialize(this.canvas, e).do();
2124
2200
  break;
2125
2201
  default: console.error("Unknown CollabAction type, skipping:", e);
2126
2202
  }
2127
2203
  }
2128
- }, St = class {
2204
+ }, Tt = class {
2129
2205
  constructor(e, t) {
2130
2206
  this.canvas = e, this.maximum = t, this.history = [], this.index = 0;
2131
2207
  }
@@ -2163,12 +2239,12 @@ var ke = (e) => e == null || e === "" || e instanceof Array && e.length === 0 ||
2163
2239
  }
2164
2240
  }, K = /* @__PURE__ */ function(e) {
2165
2241
  return e.AddConnection = "add-connection", e.AddNode = "add-node", e.AddSectionAction = "add-section", e.ApplyLayout = "apply-layout", e.Clipboard = "clipboard", e.ContextMenu = "context-menu", e.EditField = "edit-field", e.MoveNode = "move-node", e.Paste = "paste", e.Remove = "remove", e.StretchNode = "stretch-node", e.StretchSection = "stretch-section", e.UpdateValues = "update-values", e.Zoom = "zoom", e;
2166
- }({}), Ct = class {
2242
+ }({}), Et = class {
2167
2243
  constructor(e, t, n, r, i, a, o, s, c) {
2168
2244
  this.canvas = e, this.type = t, this.coords = n, this.parentId = r, this.ancestorId = i, this.fromAncestorGeometry = a, this.toAncestorGeometry = o, this.label = s, this.values = c, this.id = this.canvas.collabEngine.freshId();
2169
2245
  }
2170
2246
  do() {
2171
- let e = new dt(this.canvas, this.id, this.type.id, this.coords, this.parentId, this.label, this.values);
2247
+ let e = new mt(this.canvas, this.id, this.type.id, this.coords, this.parentId, this.label, this.values);
2172
2248
  if (this.canvas.collabEngine.doCollaboratively(e), this.ancestorId !== void 0 && this.toAncestorGeometry !== void 0) {
2173
2249
  let e = new G(this.canvas, this.ancestorId, this.toAncestorGeometry, this.canvas.collabEngine.freshTimestamp());
2174
2250
  this.canvas.collabEngine.doCollaboratively(e);
@@ -2176,7 +2252,7 @@ var ke = (e) => e == null || e === "" || e instanceof Array && e.length === 0 ||
2176
2252
  return !0;
2177
2253
  }
2178
2254
  undo() {
2179
- let e = this.canvas.model.nodes.get(this.id), t = new yt(this.canvas, [this.id], [], [], [], [], !0, this.canvas.collabEngine.freshTimestamp());
2255
+ let e = this.canvas.model.nodes.get(this.id), t = new St(this.canvas, [this.id], [], [], [], [], !0, this.canvas.collabEngine.freshTimestamp());
2180
2256
  if (this.canvas.collabEngine.doCollaboratively(t), this.ancestorId !== void 0 && this.fromAncestorGeometry !== void 0) {
2181
2257
  let e = new G(this.canvas, this.ancestorId, this.fromAncestorGeometry, this.canvas.collabEngine.freshTimestamp());
2182
2258
  this.canvas.collabEngine.doCollaboratively(e);
@@ -2184,23 +2260,23 @@ var ke = (e) => e == null || e === "" || e instanceof Array && e.length === 0 ||
2184
2260
  return e !== void 0;
2185
2261
  }
2186
2262
  redo() {
2187
- let e = this.canvas.model.nodes.get(this.id), t = new yt(this.canvas, [this.id], [], [], [], [], !1, this.canvas.collabEngine.freshTimestamp());
2263
+ let e = this.canvas.model.nodes.get(this.id), t = new St(this.canvas, [this.id], [], [], [], [], !1, this.canvas.collabEngine.freshTimestamp());
2188
2264
  if (this.canvas.collabEngine.doCollaboratively(t), this.ancestorId !== void 0 && this.toAncestorGeometry !== void 0) {
2189
2265
  let e = new G(this.canvas, this.ancestorId, this.toAncestorGeometry, this.canvas.collabEngine.freshTimestamp());
2190
2266
  this.canvas.collabEngine.doCollaboratively(e);
2191
2267
  }
2192
2268
  return e === void 0;
2193
2269
  }
2194
- }, wt = class {
2270
+ }, Dt = class {
2195
2271
  constructor(e, t, n) {
2196
2272
  this.canvas = e, this.nodeIds = t, this.delta = n;
2197
2273
  }
2198
2274
  do() {
2199
- let e = new mt(this.canvas, this.nodeIds, this.delta, this.canvas.collabEngine.freshTimestamp());
2275
+ let e = new _t(this.canvas, this.nodeIds, this.delta, this.canvas.collabEngine.freshTimestamp());
2200
2276
  return this.canvas.collabEngine.doCollaboratively(e), this.nodeIds.map((e) => this.canvas.model.nodes.get(e) !== void 0).includes(!0) && (this.delta[0] !== 0 || this.delta[1] !== 0);
2201
2277
  }
2202
2278
  undo() {
2203
- let e = new mt(this.canvas, this.nodeIds, [-this.delta[0], -this.delta[1]], this.canvas.collabEngine.freshTimestamp());
2279
+ let e = new _t(this.canvas, this.nodeIds, [-this.delta[0], -this.delta[1]], this.canvas.collabEngine.freshTimestamp());
2204
2280
  return this.canvas.collabEngine.doCollaboratively(e), this.nodeIds.map((e) => this.canvas.model.nodes.get(e) !== void 0).includes(!0) && (this.delta[0] !== 0 || this.delta[1] !== 0);
2205
2281
  }
2206
2282
  redo() {
@@ -2242,12 +2318,12 @@ var ke = (e) => e == null || e === "" || e instanceof Array && e.length === 0 ||
2242
2318
  }
2243
2319
  return e !== void 0;
2244
2320
  }
2245
- }, Tt = class {
2321
+ }, Ot = class {
2246
2322
  constructor(e, t, n, r, i, a, o, s, c) {
2247
2323
  this.canvas = e, this.childId = t, this.fromParentId = n, this.toParentId = r, this.fromChildGeometry = i, this.toChildGeometry = a, this.ancestorId = o, this.fromAncestorGeometry = s, this.toAncestorGeometry = c;
2248
2324
  }
2249
2325
  do() {
2250
- let e = this.canvas.model.nodes.get(this.childId), t = new ht(this.canvas, this.childId, this.toParentId, this.toChildGeometry, this.canvas.collabEngine.freshTimestamp());
2326
+ let e = this.canvas.model.nodes.get(this.childId), t = new vt(this.canvas, this.childId, this.toParentId, this.toChildGeometry, this.canvas.collabEngine.freshTimestamp());
2251
2327
  if (this.canvas.collabEngine.doCollaboratively(t), this.ancestorId !== void 0 && this.toAncestorGeometry !== void 0) {
2252
2328
  let e = new G(this.canvas, this.ancestorId, this.toAncestorGeometry, this.canvas.collabEngine.freshTimestamp());
2253
2329
  this.canvas.collabEngine.doCollaboratively(e);
@@ -2255,7 +2331,7 @@ var ke = (e) => e == null || e === "" || e instanceof Array && e.length === 0 ||
2255
2331
  return e !== void 0;
2256
2332
  }
2257
2333
  undo() {
2258
- let e = this.canvas.model.nodes.get(this.childId), t = new ht(this.canvas, this.childId, this.fromParentId, this.fromChildGeometry, this.canvas.collabEngine.freshTimestamp());
2334
+ let e = this.canvas.model.nodes.get(this.childId), t = new vt(this.canvas, this.childId, this.fromParentId, this.fromChildGeometry, this.canvas.collabEngine.freshTimestamp());
2259
2335
  if (this.canvas.collabEngine.doCollaboratively(t), this.ancestorId !== void 0 && this.fromAncestorGeometry !== void 0) {
2260
2336
  let e = new G(this.canvas, this.ancestorId, this.fromAncestorGeometry, this.canvas.collabEngine.freshTimestamp());
2261
2337
  this.canvas.collabEngine.doCollaboratively(e);
@@ -2265,35 +2341,35 @@ var ke = (e) => e == null || e === "" || e instanceof Array && e.length === 0 ||
2265
2341
  redo() {
2266
2342
  return this.do();
2267
2343
  }
2268
- }, Et = class {
2344
+ }, kt = class {
2269
2345
  constructor(e, t, n, r) {
2270
2346
  this.canvas = e, this.type = t, this.startId = n, this.endId = r, this.id = this.canvas.collabEngine.freshId();
2271
2347
  }
2272
2348
  do() {
2273
- let e = new gt(this.canvas, this.id, this.type.id, this.startId, this.endId);
2349
+ let e = new yt(this.canvas, this.id, this.type.id, this.startId, this.endId);
2274
2350
  return this.canvas.collabEngine.doCollaboratively(e), !0;
2275
2351
  }
2276
2352
  undo() {
2277
- let e = this.canvas.model.connections.get(this.id), t = new yt(this.canvas, [], [], [], [this.id], [], !0, this.canvas.collabEngine.freshTimestamp());
2353
+ let e = this.canvas.model.connections.get(this.id), t = new St(this.canvas, [], [], [], [this.id], [], !0, this.canvas.collabEngine.freshTimestamp());
2278
2354
  return this.canvas.collabEngine.doCollaboratively(t), e !== void 0;
2279
2355
  }
2280
2356
  redo() {
2281
- let e = this.canvas.model.connections.get(this.id), t = new yt(this.canvas, [], [], [], [this.id], [], !1, this.canvas.collabEngine.freshTimestamp());
2357
+ let e = this.canvas.model.connections.get(this.id), t = new St(this.canvas, [], [], [], [this.id], [], !1, this.canvas.collabEngine.freshTimestamp());
2282
2358
  return this.canvas.collabEngine.doCollaboratively(t), e === void 0;
2283
2359
  }
2284
- }, Dt = class {
2360
+ }, At = class {
2285
2361
  constructor(e, t, n, r) {
2286
2362
  this.canvas = e, this.fieldId = t, this.from = n, this.to = r;
2287
2363
  }
2288
2364
  do() {
2289
- let e = this.canvas.model.fields.get(this.fieldId), t = new _t(this.canvas, this.fieldId, this.to, this.canvas.collabEngine.freshTimestamp());
2365
+ let e = this.canvas.model.fields.get(this.fieldId), t = new bt(this.canvas, this.fieldId, this.to, this.canvas.collabEngine.freshTimestamp());
2290
2366
  return this.canvas.collabEngine.doCollaboratively(t), e !== void 0;
2291
2367
  }
2292
2368
  undo() {
2293
2369
  let e = this.canvas.model.fields.get(this.fieldId);
2294
2370
  if (e) {
2295
2371
  this.to = e.text;
2296
- let t = new _t(this.canvas, this.fieldId, this.from, this.canvas.collabEngine.freshTimestamp());
2372
+ let t = new bt(this.canvas, this.fieldId, this.from, this.canvas.collabEngine.freshTimestamp());
2297
2373
  this.canvas.collabEngine.doCollaboratively(t);
2298
2374
  }
2299
2375
  return e !== void 0;
@@ -2302,47 +2378,47 @@ var ke = (e) => e == null || e === "" || e instanceof Array && e.length === 0 ||
2302
2378
  let e = this.canvas.model.fields.get(this.fieldId);
2303
2379
  if (e) {
2304
2380
  this.from = e.text;
2305
- let t = new _t(this.canvas, this.fieldId, this.to, this.canvas.collabEngine.freshTimestamp());
2381
+ let t = new bt(this.canvas, this.fieldId, this.to, this.canvas.collabEngine.freshTimestamp());
2306
2382
  this.canvas.collabEngine.doCollaboratively(t);
2307
2383
  }
2308
2384
  return e !== void 0;
2309
2385
  }
2310
- }, Ot = class {
2386
+ }, jt = class {
2311
2387
  constructor(e, t, n, r) {
2312
2388
  this.canvas = e, this.id = t, this.from = n, this.to = r;
2313
2389
  }
2314
2390
  do() {
2315
- let e = new vt(this.canvas, this.id, this.to, this.canvas.collabEngine.freshTimestamp());
2391
+ let e = new xt(this.canvas, this.id, this.to, this.canvas.collabEngine.freshTimestamp());
2316
2392
  return this.canvas.collabEngine.doCollaboratively(e), !0;
2317
2393
  }
2318
2394
  undo() {
2319
- let e = new vt(this.canvas, this.id, this.from, this.canvas.collabEngine.freshTimestamp()), t = e.getValueSet();
2395
+ let e = new xt(this.canvas, this.id, this.from, this.canvas.collabEngine.freshTimestamp()), t = e.getValueSet();
2320
2396
  if (t) this.to = t.getValuesForKeys(this.to), this.canvas.collabEngine.doCollaboratively(e);
2321
2397
  else return !1;
2322
2398
  return !t.rootElement.removed;
2323
2399
  }
2324
2400
  redo() {
2325
- let e = new vt(this.canvas, this.id, this.to, this.canvas.collabEngine.freshTimestamp()), t = e.getValueSet();
2401
+ let e = new xt(this.canvas, this.id, this.to, this.canvas.collabEngine.freshTimestamp()), t = e.getValueSet();
2326
2402
  if (t) this.from = t.getValuesForKeys(this.from), this.canvas.collabEngine.doCollaboratively(e);
2327
2403
  else return !1;
2328
2404
  return !t.rootElement.removed;
2329
2405
  }
2330
- }, kt = class {
2406
+ }, Mt = class {
2331
2407
  constructor(e, t, n, r, i, a) {
2332
2408
  this.canvas = e, this.nodeIds = t, this.sectionIds = n, this.portIds = r, this.connectionIds = i, this.fieldIds = a;
2333
2409
  }
2334
2410
  do() {
2335
- let e = this.nodeIds.map((e) => this.canvas.model.nodes.get(e) !== void 0).includes(!0) || this.sectionIds.map((e) => this.canvas.model.sections.get(e) !== void 0).includes(!0) || this.portIds.map((e) => this.canvas.model.ports.get(e) !== void 0).includes(!0) || this.connectionIds.map((e) => this.canvas.model.connections.get(e) !== void 0).includes(!0) || this.fieldIds.map((e) => this.canvas.model.fields.get(e) !== void 0).includes(!0), t = new yt(this.canvas, this.nodeIds, this.sectionIds, this.portIds, this.connectionIds, this.fieldIds, !0, this.canvas.collabEngine.freshTimestamp());
2411
+ let e = this.nodeIds.map((e) => this.canvas.model.nodes.get(e) !== void 0).includes(!0) || this.sectionIds.map((e) => this.canvas.model.sections.get(e) !== void 0).includes(!0) || this.portIds.map((e) => this.canvas.model.ports.get(e) !== void 0).includes(!0) || this.connectionIds.map((e) => this.canvas.model.connections.get(e) !== void 0).includes(!0) || this.fieldIds.map((e) => this.canvas.model.fields.get(e) !== void 0).includes(!0), t = new St(this.canvas, this.nodeIds, this.sectionIds, this.portIds, this.connectionIds, this.fieldIds, !0, this.canvas.collabEngine.freshTimestamp());
2336
2412
  return this.canvas.collabEngine.doCollaboratively(t), e;
2337
2413
  }
2338
2414
  undo() {
2339
- let e = this.nodeIds.map((e) => this.canvas.model.nodes.get(e) === void 0).includes(!0) || this.sectionIds.map((e) => this.canvas.model.sections.get(e) === void 0).includes(!0) || this.portIds.map((e) => this.canvas.model.ports.get(e) === void 0).includes(!0) || this.connectionIds.map((e) => this.canvas.model.connections.get(e) === void 0).includes(!0) || this.fieldIds.map((e) => this.canvas.model.fields.get(e) === void 0).includes(!0), t = new yt(this.canvas, this.nodeIds, this.sectionIds, this.portIds, this.connectionIds, this.fieldIds, !1, this.canvas.collabEngine.freshTimestamp());
2415
+ let e = this.nodeIds.map((e) => this.canvas.model.nodes.get(e) === void 0).includes(!0) || this.sectionIds.map((e) => this.canvas.model.sections.get(e) === void 0).includes(!0) || this.portIds.map((e) => this.canvas.model.ports.get(e) === void 0).includes(!0) || this.connectionIds.map((e) => this.canvas.model.connections.get(e) === void 0).includes(!0) || this.fieldIds.map((e) => this.canvas.model.fields.get(e) === void 0).includes(!0), t = new St(this.canvas, this.nodeIds, this.sectionIds, this.portIds, this.connectionIds, this.fieldIds, !1, this.canvas.collabEngine.freshTimestamp());
2340
2416
  return this.canvas.collabEngine.doCollaboratively(t), e;
2341
2417
  }
2342
2418
  redo() {
2343
2419
  return this.do();
2344
2420
  }
2345
- }, At = class {
2421
+ }, Nt = class {
2346
2422
  constructor(e, t, n, r) {
2347
2423
  this.canvas = e, this.nodes = t, this.connections = n, this.coords = r;
2348
2424
  }
@@ -2368,120 +2444,127 @@ var ke = (e) => e == null || e === "" || e instanceof Array && e.length === 0 ||
2368
2444
  let r = this.canvas.collabEngine.freshId();
2369
2445
  if (n[e.id] = r, e.id = r, e.start = n[e.start] || e.start, e.end = n[e.end] || e.end, t) for (let n = 0; n < e.points.length; ++n) e.points[n] = [e.points[n][0] + t[0], e.points[n][1] + t[1]];
2370
2446
  }
2371
- let r = new bt(this.canvas, this.nodes, this.connections);
2447
+ let r = new Ct(this.canvas, this.nodes, this.connections);
2372
2448
  return this.canvas.collabEngine.doCollaboratively(r), !0;
2373
2449
  }
2374
2450
  undo() {
2375
- let e = this.nodes.map((e) => this.canvas.model.nodes.get(e.id) !== void 0).includes(!0) || this.connections.map((e) => this.canvas.model.connections.get(e.id) !== void 0).includes(!0), t = new yt(this.canvas, this.nodes.map((e) => e.id), [], [], this.connections.map((e) => e.id), [], !0, this.canvas.collabEngine.freshTimestamp());
2451
+ let e = this.nodes.map((e) => this.canvas.model.nodes.get(e.id) !== void 0).includes(!0) || this.connections.map((e) => this.canvas.model.connections.get(e.id) !== void 0).includes(!0), t = new St(this.canvas, this.nodes.map((e) => e.id), [], [], this.connections.map((e) => e.id), [], !0, this.canvas.collabEngine.freshTimestamp());
2376
2452
  return this.canvas.collabEngine.doCollaboratively(t), e;
2377
2453
  }
2378
2454
  redo() {
2379
- let e = this.nodes.map((e) => this.canvas.model.nodes.get(e.id) === void 0).includes(!0) || this.connections.map((e) => this.canvas.model.connections.get(e.id) === void 0).includes(!0), t = new yt(this.canvas, this.nodes.map((e) => e.id), [], [], this.connections.map((e) => e.id), [], !1, this.canvas.collabEngine.freshTimestamp());
2455
+ let e = this.nodes.map((e) => this.canvas.model.nodes.get(e.id) === void 0).includes(!0) || this.connections.map((e) => this.canvas.model.connections.get(e.id) === void 0).includes(!0), t = new St(this.canvas, this.nodes.map((e) => e.id), [], [], this.connections.map((e) => e.id), [], !1, this.canvas.collabEngine.freshTimestamp());
2380
2456
  return this.canvas.collabEngine.doCollaboratively(t), e;
2381
2457
  }
2382
- }, jt = class {
2458
+ }, Pt = class {
2383
2459
  constructor(e) {
2384
2460
  this.type = e, this.defaultPrevented = !1;
2385
2461
  }
2386
2462
  preventDefault() {
2387
2463
  this.defaultPrevented = !0;
2388
2464
  }
2389
- }, Mt = /* @__PURE__ */ function(e) {
2465
+ }, Ft = /* @__PURE__ */ function(e) {
2390
2466
  return e[e.Zoom = 0] = "Zoom", e[e.DoubleClick = 1] = "DoubleClick", e[e.SecondaryClick = 2] = "SecondaryClick", e[e.Selection = 3] = "Selection", e[e.Highlight = 4] = "Highlight", e[e.DraggingNode = 5] = "DraggingNode", e;
2391
- }({}), Nt = class extends jt {
2467
+ }({}), It = class extends Pt {
2392
2468
  constructor(e, t) {
2393
2469
  super(0), this.coords = e, this.zoom = t;
2394
2470
  }
2395
- }, Pt = class extends jt {
2471
+ }, Lt = class extends Pt {
2396
2472
  constructor(e, t, n) {
2397
2473
  super(1), this.cause = e, this.target = t, this.coords = n;
2398
2474
  }
2399
- }, Ft = class extends jt {
2475
+ }, Rt = class extends Pt {
2400
2476
  constructor(e, t, n) {
2401
2477
  super(2), this.cause = e, this.target = t, this.coords = n;
2402
2478
  }
2403
- }, J = class extends jt {
2479
+ }, J = class extends Pt {
2404
2480
  constructor(e, t) {
2405
2481
  super(3), this.targets = e, this.selected = t;
2406
2482
  }
2407
- }, Y = class extends jt {
2483
+ }, Y = class extends Pt {
2408
2484
  constructor(e) {
2409
2485
  super(4), this.target = e;
2410
2486
  }
2411
- }, It = class extends jt {
2487
+ }, zt = class extends Pt {
2412
2488
  constructor(e) {
2413
2489
  super(5), this.target = e;
2414
2490
  }
2415
- }, Lt = class {
2491
+ }, Bt = class {
2416
2492
  constructor(e, t, n, r, i, a = []) {
2417
- this.nodes = new Je(this), this.sections = new Ge(this), this.ports = new lt(this), this.connections = new Fe(this), this.fields = new Re(this), this.objects = new rt(this), this.decorators = new tt(this), this.canvas = e, this.id = t, this.name = n, this.description = r, this.type = i, this.createdAt = /* @__PURE__ */ new Date(), this.updatedAt = /* @__PURE__ */ new Date(), this.logicalClock = 0, this.valueSet = new Ne(new De(a), this);
2493
+ this.nodes = new Ze(this), this.sections = new qe(this), this.ports = new ft(this), this.connections = new Ie(this), this.fields = new Re(this), this.objects = new ot(this), this.decorators = new it(this), this.canvas = e, this.id = t, this.name = n, this.description = r, this.type = i, this.createdAt = /* @__PURE__ */ new Date(), this.updatedAt = /* @__PURE__ */ new Date(), this.logicalClock = 0, this.valueSet = new Me(new Ee(a), this);
2418
2494
  }
2419
2495
  clear() {
2420
2496
  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();
2421
2497
  }
2422
- }, Rt = (e) => !!e.button, zt = (e, t, n, r, i, a, o, s, c) => ne(e, [
2498
+ }, Vt = (e) => !!e.button, Ht = (e, t, n, r, i, a, o, s, c) => re(e, [
2423
2499
  t,
2424
2500
  ...a,
2425
2501
  n
2426
2502
  ], r, i, Math.max(10, s ?? 0, c ?? 0) * o), X = (t) => {
2427
- t ? e.select("body").style("cursor", t) : e.select("body").style("cursor", A.Auto);
2428
- }, Bt = (e) => e instanceof W ? e : e instanceof H ? e.node ?? e : e.rootElement instanceof W || e.rootElement instanceof H || e.rootElement instanceof ct ? Bt(e.rootElement) : e, Vt = (e) => {
2429
- if (e instanceof W) return e.type.resizableX !== !1;
2430
- if (e instanceof H) {
2431
- if (e.type !== void 0) return e.type.resizableX !== !1;
2432
- if (e.node !== void 0) return Vt(e.node);
2503
+ t ? e.select("body").style("cursor", t) : e.select("body").style("cursor", k.Auto);
2504
+ }, Ut = (e) => e instanceof W ? e : e instanceof U ? e.node ?? e : e.rootElement instanceof W || e.rootElement instanceof U || e.rootElement instanceof dt ? Ut(e.rootElement) : e, Wt = (e) => {
2505
+ if (e instanceof W) return e.type.resizerX.mode !== I.Never;
2506
+ if (e instanceof U) {
2507
+ if (e.type?.resizerX !== void 0) return e.type.resizerX.mode !== I.Never;
2508
+ if (e.node !== void 0) return Wt(e.node);
2433
2509
  }
2434
2510
  return !1;
2435
- }, Ht = (e) => {
2436
- if (e instanceof W) return e.type.resizableY !== !1;
2437
- if (e instanceof H) {
2438
- if (e.type !== void 0) return e.type.resizableY !== !1;
2439
- if (e.node !== void 0) return Ht(e.node);
2511
+ }, Gt = (e) => {
2512
+ if (e instanceof W) return e.type.resizerY.mode !== I.Never;
2513
+ if (e instanceof U) {
2514
+ if (e.type?.resizerY !== void 0) return e.type.resizerY.mode !== I.Never;
2515
+ if (e.node !== void 0) return Gt(e.node);
2516
+ }
2517
+ return !1;
2518
+ }, Kt = (e) => {
2519
+ if (e instanceof W) return e.type.resizerXY.mode !== I.Never;
2520
+ if (e instanceof U) {
2521
+ if (e.type?.resizerXY !== void 0) return e.type.resizerXY.mode !== I.Never;
2522
+ if (e.node !== void 0) return Kt(e.node);
2440
2523
  }
2441
2524
  return !1;
2442
- }, Ut = (e) => {
2525
+ }, qt = (e) => {
2443
2526
  e.filter(".shaped-look").append("path"), e.filter(".image-look").append("image").attr("preserveAspectRatio", "none"), e.filter(".stretchable-image-look").append("image").attr("class", "top-left-image").attr("preserveAspectRatio", "none"), e.filter(".stretchable-image-look").append("image").attr("class", "top-image").attr("preserveAspectRatio", "none"), e.filter(".stretchable-image-look").append("image").attr("class", "top-right-image").attr("preserveAspectRatio", "none"), e.filter(".stretchable-image-look").append("image").attr("class", "left-image").attr("preserveAspectRatio", "none"), e.filter(".stretchable-image-look").append("image").attr("class", "center-image").attr("preserveAspectRatio", "none"), e.filter(".stretchable-image-look").append("image").attr("class", "right-image").attr("preserveAspectRatio", "none"), e.filter(".stretchable-image-look").append("image").attr("class", "bottom-left-image").attr("preserveAspectRatio", "none"), e.filter(".stretchable-image-look").append("image").attr("class", "bottom-image").attr("preserveAspectRatio", "none"), e.filter(".stretchable-image-look").append("image").attr("class", "bottom-right-image").attr("preserveAspectRatio", "none");
2444
- }, Wt = {
2527
+ }, Jt = {
2445
2528
  fillColor: "#FFFFFF",
2446
2529
  borderColor: "#000000",
2447
2530
  borderThickness: 1,
2448
2531
  borderStyle: te.Solid
2449
- }, Gt = (e) => {
2450
- e.filter(".shaped-look").select("path").attr("d", (e) => ae(e.look.shape ?? ie.Rectangle, 0, 0, e.width, e.height)).attr("fill", (e) => e.look.fillColor ?? Wt.fillColor).attr("stroke", (e) => e.look.borderColor ?? Wt.borderColor).attr("stroke-width", (e) => `${e.look.borderThickness ?? Wt.borderThickness}px`).attr("stroke-dasharray", (e) => re(e.look.borderStyle ?? Wt.borderStyle, e.type?.defaultLook?.borderThickness ?? e.look?.borderThickness ?? Wt.borderThickness)), e.filter(".image-look").select("image").attr("x", 0).attr("y", 0).attr("width", (e) => e.width).attr("height", (e) => e.height).attr("href", (e) => e.look.backgroundImage), e.filter(".stretchable-image-look").select("image.top-left-image").attr("x", 0).attr("y", 0).attr("width", (e) => e.look.leftMargin).attr("height", (e) => e.look.topMargin).attr("href", (e) => e.look.backgroundImageTopLeft), e.filter(".stretchable-image-look").select("image.top-image").attr("x", (e) => e.look.leftMargin).attr("y", 0).attr("width", (e) => e.width - e.look.rightMargin - e.look.leftMargin).attr("height", (e) => e.look.topMargin).attr("href", (e) => e.look.backgroundImageTop), e.filter(".stretchable-image-look").select("image.top-right-image").attr("x", (e) => e.width - e.look.rightMargin).attr("y", 0).attr("width", (e) => e.look.rightMargin).attr("height", (e) => e.look.topMargin).attr("href", (e) => e.look.backgroundImageTopRight), e.filter(".stretchable-image-look").select("image.left-image").attr("x", 0).attr("y", (e) => e.look.topMargin).attr("width", (e) => e.look.leftMargin).attr("height", (e) => e.height - e.look.bottomMargin - e.look.topMargin).attr("href", (e) => e.look.backgroundImageLeft), e.filter(".stretchable-image-look").select("image.center-image").attr("x", (e) => e.look.leftMargin).attr("y", (e) => e.look.topMargin).attr("width", (e) => e.width - e.look.rightMargin - e.look.leftMargin).attr("height", (e) => e.height - e.look.bottomMargin - e.look.topMargin).attr("href", (e) => e.look.backgroundImageCenter), e.filter(".stretchable-image-look").select("image.right-image").attr("x", (e) => e.width - e.look.rightMargin).attr("y", (e) => e.look.topMargin).attr("width", (e) => e.look.rightMargin).attr("height", (e) => e.height - e.look.bottomMargin - e.look.topMargin).attr("href", (e) => e.look.backgroundImageRight), e.filter(".stretchable-image-look").select("image.bottom-left-image").attr("x", 0).attr("y", (e) => e.height - e.look.bottomMargin).attr("width", (e) => e.look.leftMargin).attr("height", (e) => e.look.bottomMargin).attr("href", (e) => e.look.backgroundImageBottomLeft), e.filter(".stretchable-image-look").select("image.bottom-image").attr("x", (e) => e.look.leftMargin).attr("y", (e) => e.height - e.look.bottomMargin).attr("width", (e) => e.width - e.look.rightMargin - e.look.leftMargin).attr("height", (e) => e.look.bottomMargin).attr("href", (e) => e.look.backgroundImageBottom), e.filter(".stretchable-image-look").select("image.bottom-right-image").attr("x", (e) => e.width - e.look.rightMargin).attr("y", (e) => e.height - e.look.bottomMargin).attr("width", (e) => e.look.rightMargin).attr("height", (e) => e.look.bottomMargin).attr("href", (e) => e.look.backgroundImageBottomRight);
2451
- }, Kt = {
2532
+ }, Yt = (e) => {
2533
+ e.filter(".shaped-look").select("path").attr("d", (e) => oe(e.look.shape ?? ae.Rectangle, 0, 0, e.width, e.height)).attr("fill", (e) => e.look.fillColor ?? Jt.fillColor).attr("stroke", (e) => e.look.borderColor ?? Jt.borderColor).attr("stroke-width", (e) => `${e.look.borderThickness ?? Jt.borderThickness}px`).attr("stroke-dasharray", (e) => ie(e.look.borderStyle ?? Jt.borderStyle, e.type?.defaultLook?.borderThickness ?? e.look?.borderThickness ?? Jt.borderThickness)), e.filter(".image-look").select("image").attr("x", 0).attr("y", 0).attr("width", (e) => e.width).attr("height", (e) => e.height).attr("href", (e) => e.look.backgroundImage), e.filter(".stretchable-image-look").select("image.top-left-image").attr("x", 0).attr("y", 0).attr("width", (e) => e.look.leftMargin).attr("height", (e) => e.look.topMargin).attr("href", (e) => e.look.backgroundImageTopLeft), e.filter(".stretchable-image-look").select("image.top-image").attr("x", (e) => e.look.leftMargin).attr("y", 0).attr("width", (e) => e.width - e.look.rightMargin - e.look.leftMargin).attr("height", (e) => e.look.topMargin).attr("href", (e) => e.look.backgroundImageTop), e.filter(".stretchable-image-look").select("image.top-right-image").attr("x", (e) => e.width - e.look.rightMargin).attr("y", 0).attr("width", (e) => e.look.rightMargin).attr("height", (e) => e.look.topMargin).attr("href", (e) => e.look.backgroundImageTopRight), e.filter(".stretchable-image-look").select("image.left-image").attr("x", 0).attr("y", (e) => e.look.topMargin).attr("width", (e) => e.look.leftMargin).attr("height", (e) => e.height - e.look.bottomMargin - e.look.topMargin).attr("href", (e) => e.look.backgroundImageLeft), e.filter(".stretchable-image-look").select("image.center-image").attr("x", (e) => e.look.leftMargin).attr("y", (e) => e.look.topMargin).attr("width", (e) => e.width - e.look.rightMargin - e.look.leftMargin).attr("height", (e) => e.height - e.look.bottomMargin - e.look.topMargin).attr("href", (e) => e.look.backgroundImageCenter), e.filter(".stretchable-image-look").select("image.right-image").attr("x", (e) => e.width - e.look.rightMargin).attr("y", (e) => e.look.topMargin).attr("width", (e) => e.look.rightMargin).attr("height", (e) => e.height - e.look.bottomMargin - e.look.topMargin).attr("href", (e) => e.look.backgroundImageRight), e.filter(".stretchable-image-look").select("image.bottom-left-image").attr("x", 0).attr("y", (e) => e.height - e.look.bottomMargin).attr("width", (e) => e.look.leftMargin).attr("height", (e) => e.look.bottomMargin).attr("href", (e) => e.look.backgroundImageBottomLeft), e.filter(".stretchable-image-look").select("image.bottom-image").attr("x", (e) => e.look.leftMargin).attr("y", (e) => e.height - e.look.bottomMargin).attr("width", (e) => e.width - e.look.rightMargin - e.look.leftMargin).attr("height", (e) => e.look.bottomMargin).attr("href", (e) => e.look.backgroundImageBottom), e.filter(".stretchable-image-look").select("image.bottom-right-image").attr("x", (e) => e.width - e.look.rightMargin).attr("y", (e) => e.height - e.look.bottomMargin).attr("width", (e) => e.look.rightMargin).attr("height", (e) => e.look.bottomMargin).attr("href", (e) => e.look.backgroundImageBottomRight);
2534
+ }, Xt = {
2452
2535
  style: "solid",
2453
2536
  color: "#FFFFFF"
2454
- }, qt = {
2537
+ }, Zt = {
2455
2538
  enabled: !0,
2456
2539
  style: "none",
2457
2540
  snap: !1,
2458
2541
  spacing: 1
2459
- }, Jt = {
2460
- ...qt,
2542
+ }, Qt = {
2543
+ ...Zt,
2461
2544
  style: "dots",
2462
2545
  snap: !1,
2463
2546
  spacing: 10,
2464
2547
  thickness: .05,
2465
2548
  color: "rgba(0, 0, 0, 0.1)"
2466
- }, Yt = (e, t, n) => {
2467
- switch (n?.style ?? "") {
2468
- case "image": return t.append("image").attr("x", 0).attr("y", 0).attr("width", "100%").attr("height", "100%").attr("href", n.image).attr("preserveAspectRatio", "none");
2469
- default: return t.append("rect").attr("x", 0).attr("y", 0).attr("width", "100%").attr("height", "100%").attr("fill", n.color ?? "#FFFFFF").attr("stroke-width", "0");
2549
+ }, $t = (e, t) => {
2550
+ switch (t?.style ?? "") {
2551
+ case "image": return e.append("image").attr("x", 0).attr("y", 0).attr("width", "100%").attr("height", "100%").attr("href", t.image).attr("preserveAspectRatio", "none");
2552
+ default: return e.append("rect").attr("x", 0).attr("y", 0).attr("width", "100%").attr("height", "100%").attr("fill", t.color ?? "#FFFFFF").attr("stroke-width", "0");
2470
2553
  }
2471
- }, Xt = (e) => {
2472
- if (!e) return Jt;
2554
+ }, en = (e) => {
2555
+ if (!e) return Qt;
2473
2556
  switch (e.style) {
2474
2557
  case "dots":
2475
2558
  case "lines": return {
2476
- ...Jt,
2559
+ ...Qt,
2477
2560
  ...e
2478
2561
  };
2479
2562
  default: return {
2480
- ...qt,
2563
+ ...Zt,
2481
2564
  ...e
2482
2565
  };
2483
2566
  }
2484
- }, Zt = (e, t, n, r, i) => {
2567
+ }, tn = (e, t, n, r, i) => {
2485
2568
  if (Z(i) !== 0 && Q(i) !== 0) {
2486
2569
  let e = n.append("pattern").attr("id", r).attr("x", -Z(i) / 2).attr("y", -Q(i) / 2).attr("width", Z(i)).attr("height", Q(i)).attr("patternUnits", "userSpaceOnUse");
2487
2570
  switch (e.append("rect").attr("x", 0).attr("y", 0).attr("width", Z(i)).attr("height", Q(i)).attr("fill", "transparent"), i.style) {
@@ -2503,13 +2586,13 @@ var ke = (e) => e == null || e === "" || e instanceof Array && e.length === 0 ||
2503
2586
  }, Q = (e) => {
2504
2587
  let t = 0;
2505
2588
  return typeof e.spacing == "number" ? t = e.spacing : Array.isArray(e.spacing) && typeof e.spacing[1] == "number" && (t = e.spacing[1]), isFinite(t) ? t : 0;
2506
- }, Qt = 96, $ = 32, $t = 128, en = Math.PI / 4, tn = 100, nn = { customButtons: [] }, rn = class {
2589
+ }, nn = 96, $ = 32, rn = 128, an = Math.PI / 4, on = 100, sn = { customButtons: [] }, cn = class {
2507
2590
  constructor(e, t) {
2508
- this.canvas = e, this.config = t || nn;
2591
+ this.canvas = e, this.config = t || sn;
2509
2592
  }
2510
2593
  open(t) {
2511
2594
  this.close();
2512
- let n = this.canvas.getPointerLocationRelativeToRoot(t), r = this.canvas.getPointerLocationRelativeToCanvas(t), i = this.canvas.selectSVGElement().append("foreignObject").attr("class", "daga-context-menu").attr("x", `${n[0] - $t}px`).attr("y", `${n[1] - $t}px`).attr("width", `${2 * $t}px`).attr("height", `${2 * $t}px`).style("pointer-events", "none").on(S.ContextMenu, (e) => {
2595
+ let n = this.canvas.getPointerLocationRelativeToRoot(t), r = this.canvas.getPointerLocationRelativeToCanvas(t), i = this.canvas.selectSVGElement().append("foreignObject").attr("class", "daga-context-menu").attr("x", `${n[0] - rn}px`).attr("y", `${n[1] - rn}px`).attr("width", `${2 * rn}px`).attr("height", `${2 * rn}px`).style("pointer-events", "none").on(S.ContextMenu, (e) => {
2513
2596
  this.canvas.canUserPerformAction(K.ContextMenu) && (t.preventDefault(), this.open(e));
2514
2597
  }).on(S.Click, (e) => {
2515
2598
  e.preventDefault(), this.close();
@@ -2541,28 +2624,28 @@ var ke = (e) => e == null || e === "" || e instanceof Array && e.length === 0 ||
2541
2624
  e.userSelection.removeFromModel(), e.cancelAllUserActions();
2542
2625
  }
2543
2626
  });
2544
- for (let e of this.config.customButtons || nn.customButtons) (e.condition === void 0 || e.condition(this.canvas)) && a.push(e);
2627
+ for (let e of this.config.customButtons || sn.customButtons) (e.condition === void 0 || e.condition(this.canvas)) && a.push(e);
2545
2628
  a.length === 0 && a.push({
2546
2629
  name: "NONE",
2547
2630
  imageClass: "daga-cross",
2548
2631
  onPress: void 0
2549
2632
  });
2550
2633
  for (let t = 0; t < a.length; ++t) {
2551
- let n = a[t], r = n.onPress, o = (t + .5 - a.length / 2) * en, s = i.append("xhtml:div").attr("class", `daga-context-menu-button ${n.onPress === void 0 ? "" : " daga-clickable"}`).attr("tabindex", 0).style("position", "absolute").style("box-sizing", "border-box").style("width", `${2 * $}px`).style("height", `${2 * $}px`).style("border-radius", `${$}px`).style("pointer-events", "auto").on(S.Click, (e) => {
2634
+ let n = a[t], r = n.onPress, o = (t + .5 - a.length / 2) * an, s = i.append("xhtml:div").attr("class", `daga-context-menu-button ${n.onPress === void 0 ? "" : " daga-clickable"}`).attr("tabindex", 0).style("position", "absolute").style("box-sizing", "border-box").style("width", `${2 * $}px`).style("height", `${2 * $}px`).style("border-radius", `${$}px`).style("pointer-events", "auto").on(S.Click, (e) => {
2552
2635
  r && (e.preventDefault(), r(this.canvas));
2553
2636
  }).on(S.KeyDown, (e) => {
2554
2637
  r && e.key === C.Enter && (e.preventDefault(), r(this.canvas));
2555
2638
  });
2556
- n.imageClass === void 0 ? n.image !== void 0 && s.append("xhtml:img").style("position", "absolute").style("left", `${.75 * $}px`).style("top", `${.5 * $}px`).style("width", `${.5 * $}px`).style("height", `${.5 * $}px`).attr("src", n.image) : s.append("xhtml:div").style("position", "absolute").style("left", `${.75 * $}px`).style("top", `${.5 * $}px`).style("width", `${.5 * $}px`).style("height", `${.5 * $}px`).style("background-size", "contain").style("background-repeat", "no-repeat").attr("class", n.imageClass), s.append("xhtml:span").style("position", "absolute").style("left", `${.2 * $}px`).style("top", `${1.1 * $}px`).style("text-align", "center").style("width", `${1.6 * $}px`).style("height", `${.35 * $}px`).style("margin", "0").style("font-size", `${.35 * $}px`).style("font-weight", "700").style("user-select", "none").text(n.name), s.transition().ease(e.easeLinear).duration(tn).tween("progress", () => (e) => {
2639
+ n.imageClass === void 0 ? n.image !== void 0 && s.append("xhtml:img").style("position", "absolute").style("left", `${.75 * $}px`).style("top", `${.5 * $}px`).style("width", `${.5 * $}px`).style("height", `${.5 * $}px`).attr("src", n.image) : s.append("xhtml:div").style("position", "absolute").style("left", `${.75 * $}px`).style("top", `${.5 * $}px`).style("width", `${.5 * $}px`).style("height", `${.5 * $}px`).style("background-size", "contain").style("background-repeat", "no-repeat").attr("class", n.imageClass), s.append("xhtml:span").style("position", "absolute").style("left", `${.2 * $}px`).style("top", `${1.1 * $}px`).style("text-align", "center").style("width", `${1.6 * $}px`).style("height", `${.35 * $}px`).style("margin", "0").style("font-size", `${.35 * $}px`).style("font-weight", "700").style("user-select", "none").text(n.name), s.transition().ease(e.easeLinear).duration(on).tween("progress", () => (e) => {
2557
2640
  let t = o * e;
2558
- return s.style("left", `${Math.sin(t) * Qt - $ + $t}px`).style("top", `${-Math.cos(t) * Qt - $ + $t}px`);
2641
+ return s.style("left", `${Math.sin(t) * nn - $ + rn}px`).style("top", `${-Math.cos(t) * nn - $ + rn}px`);
2559
2642
  });
2560
2643
  }
2561
2644
  }
2562
2645
  close() {
2563
2646
  this.contextMenuContainer?.remove(), this.contextMenuContainer = void 0;
2564
2647
  }
2565
- }, an = class extends N {
2648
+ }, ln = class extends N {
2566
2649
  constructor(e, t = !0) {
2567
2650
  super(), this.focus = void 0, this.canvas = e, this.highlightSections = t;
2568
2651
  }
@@ -2570,7 +2653,7 @@ var ke = (e) => e == null || e === "" || e instanceof Array && e.length === 0 ||
2570
2653
  return this.focus;
2571
2654
  }
2572
2655
  focusOn(e) {
2573
- this.clear(), this.focus = e, (e instanceof Le || e instanceof et) && e.rootElement ? this.focusOn(e.rootElement) : this.add(e);
2656
+ this.clear(), this.focus = e, (e instanceof Le || e instanceof rt) && e.rootElement ? this.focusOn(e.rootElement) : this.add(e);
2574
2657
  }
2575
2658
  add(e) {
2576
2659
  if (super.add(e), e instanceof W) {
@@ -2581,12 +2664,12 @@ var ke = (e) => e == null || e === "" || e instanceof Array && e.length === 0 ||
2581
2664
  }
2582
2665
  for (let t of e.ports) super.add(t), this.canvas.updatePortsInView(t.id);
2583
2666
  e.label && (super.add(e.label), this.canvas.updateFieldsInView(e.label.id)), this.canvas.updateNodesInView(e.id);
2584
- } else if (e instanceof H) if (!this.highlightSections && e.node) this.add(e.node);
2667
+ } else if (e instanceof U) if (!this.highlightSections && e.node) this.add(e.node);
2585
2668
  else {
2586
2669
  for (let t of e.ports) super.add(t), this.canvas.updatePortsInView(t.id);
2587
2670
  e.label && (super.add(e.label), this.canvas.updateFieldsInView(e.label.id)), this.canvas.updateSectionsInView(e.id);
2588
2671
  }
2589
- else e instanceof ct ? (e.label && (super.add(e.label), this.canvas.updateFieldsInView(e.label.id)), this.canvas.updatePortsInView(e.id)) : e instanceof I && this.canvas.updateConnectionsInView(e.id);
2672
+ else e instanceof dt ? (e.label && (super.add(e.label), this.canvas.updateFieldsInView(e.label.id)), this.canvas.updatePortsInView(e.id)) : e instanceof F && this.canvas.updateConnectionsInView(e.id);
2590
2673
  }
2591
2674
  clear() {
2592
2675
  for (; this.entities.length > 0;) {
@@ -2595,7 +2678,7 @@ var ke = (e) => e == null || e === "" || e instanceof Array && e.length === 0 ||
2595
2678
  }
2596
2679
  this.focus = void 0;
2597
2680
  }
2598
- }, on = class {
2681
+ }, un = class {
2599
2682
  export(e, t = !1) {
2600
2683
  let n = {
2601
2684
  name: e.name,
@@ -2759,14 +2842,14 @@ var ke = (e) => e == null || e === "" || e instanceof Array && e.length === 0 ||
2759
2842
  textTimestamp: e.textTimestamp
2760
2843
  } } : {};
2761
2844
  }
2762
- }, sn = "Diagram properties", cn = class extends N {
2845
+ }, dn = "Diagram properties", fn = class extends N {
2763
2846
  constructor(e, t) {
2764
2847
  super(), this.canvas = e, this.canvas.propertyEditorChanges$.pipe(n(2e3)).subscribe(() => {
2765
2848
  this.makeUpdateValuesAction();
2766
- }), this.diagramPropertiesText = t === void 0 ? sn : t;
2849
+ }), this.diagramPropertiesText = t === void 0 ? dn : t;
2767
2850
  }
2768
2851
  add(e) {
2769
- if (!this.contains(e.id) && (this.length === 0 ? this.propertyEditorSelection === void 0 && (e instanceof W || e instanceof I) ? this.openInPropertyEditor(e) : this.propertyEditorSelection === void 0 && e instanceof H ? this.openInPropertyEditor(e.node) : this.openInPropertyEditor(void 0) : this.openInPropertyEditor(void 0), super.add(e), e.updateInView(), e instanceof W && e.sections)) for (let t of e.sections) super.add(t), t.updateInView();
2852
+ if (!this.contains(e.id) && (this.length === 0 ? this.propertyEditorSelection === void 0 && (e instanceof W || e instanceof F) ? this.openInPropertyEditor(e) : this.propertyEditorSelection === void 0 && e instanceof U ? this.openInPropertyEditor(e.node) : this.openInPropertyEditor(void 0) : this.openInPropertyEditor(void 0), super.add(e), e.updateInView(), e instanceof W && e.sections)) for (let t of e.sections) super.add(t), t.updateInView();
2770
2853
  }
2771
2854
  remove(e) {
2772
2855
  let t = this.get(e);
@@ -2787,8 +2870,8 @@ var ke = (e) => e == null || e === "" || e instanceof Array && e.length === 0 ||
2787
2870
  removeFromModel() {
2788
2871
  if (this.length > 0) {
2789
2872
  let e = [], t = [], n = [], r = [], i = [];
2790
- for (let a of this.all()) a instanceof W ? e.push(a.id) : a instanceof H ? t.push(a.id) : a instanceof ct ? n.push(a.id) : a instanceof I ? r.push(a.id) : a instanceof Le && i.push(a.id);
2791
- let a = new kt(this.canvas, e, t, n, r, i);
2873
+ for (let a of this.all()) a instanceof W ? e.push(a.id) : a instanceof U ? t.push(a.id) : a instanceof dt ? n.push(a.id) : a instanceof F ? r.push(a.id) : a instanceof Le && i.push(a.id);
2874
+ let a = new Mt(this.canvas, e, t, n, r, i);
2792
2875
  a.do(), this.canvas.actionStack.add(a);
2793
2876
  }
2794
2877
  }
@@ -2797,8 +2880,8 @@ var ke = (e) => e == null || e === "" || e instanceof Array && e.length === 0 ||
2797
2880
  type: "daga-user-selection",
2798
2881
  nodes: [],
2799
2882
  connections: []
2800
- }, t = new on();
2801
- for (let n of this.all()) n instanceof W && e.nodes.push(t.exportNode(n, !1)), n instanceof I && e.connections.push(t.exportConnection(n, !1));
2883
+ }, t = new un();
2884
+ for (let n of this.all()) n instanceof W && e.nodes.push(t.exportNode(n, !1)), n instanceof F && e.connections.push(t.exportConnection(n, !1));
2802
2885
  navigator.clipboard.writeText(JSON.stringify(e));
2803
2886
  }
2804
2887
  cutToClipboard() {
@@ -2809,7 +2892,7 @@ var ke = (e) => e == null || e === "" || e instanceof Array && e.length === 0 ||
2809
2892
  try {
2810
2893
  let n = JSON.parse(t);
2811
2894
  if (n.type !== "daga-user-selection") return;
2812
- let r = new At(this.canvas, n.nodes, n.connections, e);
2895
+ let r = new Nt(this.canvas, n.nodes, n.connections, e);
2813
2896
  this.canvas.actionStack.add(r), r.do();
2814
2897
  } catch {
2815
2898
  return;
@@ -2821,16 +2904,16 @@ var ke = (e) => e == null || e === "" || e instanceof Array && e.length === 0 ||
2821
2904
  let n = this.canvas.parentComponent?.propertyEditor;
2822
2905
  if (n === void 0) return;
2823
2906
  let r = e?.valueSet;
2824
- r ? (this.propertyEditorSelection = e, t && (this.propertyEditorValues = Ce(r.getValues())), n && (e instanceof W || e instanceof I ? (e instanceof W ? e.name ? n.title = `${e.type.name}: ${e.name}` : n.title = e.type.name : e instanceof I && (n.title = e.type.name), n.valueSet = void 0, n.valueSet = r) : (n.title = this.diagramPropertiesText, n.valueSet = void 0, n.valueSet = r))) : (this.propertyEditorSelection = void 0, this.propertyEditorValues = void 0, n && (n.title = "", n.valueSet = void 0));
2907
+ r ? (this.propertyEditorSelection = e, t && (this.propertyEditorValues = we(r.getValues())), n && (e instanceof W || e instanceof F ? (e instanceof W ? e.name ? n.title = `${e.type.name}: ${e.name}` : n.title = e.type.name : e instanceof F && (n.title = e.type.name), n.valueSet = void 0, n.valueSet = r) : (n.title = this.diagramPropertiesText, n.valueSet = void 0, n.valueSet = r))) : (this.propertyEditorSelection = void 0, this.propertyEditorValues = void 0, n && (n.title = "", n.valueSet = void 0));
2825
2908
  }
2826
2909
  makeUpdateValuesAction() {
2827
2910
  if (this.propertyEditorSelection === void 0 || this.propertyEditorValues === void 0) return;
2828
- let e = this.propertyEditorSelection instanceof Lt ? void 0 : this.propertyEditorSelection.id;
2829
- if (Ae(this.propertyEditorValues, this.propertyEditorSelection?.valueSet.getValues())) return;
2830
- let t = this.propertyEditorValues, n = Ce(this.propertyEditorSelection?.valueSet.getValues()), [r, i] = je(t, n, this.propertyEditorSelection?.valueSet), a = new Ot(this.canvas, e, r, i);
2911
+ let e = this.propertyEditorSelection instanceof Bt ? void 0 : this.propertyEditorSelection.id;
2912
+ if (ke(this.propertyEditorValues, this.propertyEditorSelection?.valueSet.getValues())) return;
2913
+ let t = this.propertyEditorValues, n = we(this.propertyEditorSelection?.valueSet.getValues()), [r, i] = Ae(t, n, this.propertyEditorSelection?.valueSet), a = new jt(this.canvas, e, r, i);
2831
2914
  a.do(), this.canvas.actionStack.add(a), this.propertyEditorValues = n;
2832
2915
  }
2833
- }, ln = "diagram-connection-unfinished", un = class n {
2916
+ }, pn = "diagram-connection-unfinished", mn = class n {
2834
2917
  static {
2835
2918
  this.canvasCount = 0;
2836
2919
  }
@@ -2841,17 +2924,17 @@ var ke = (e) => e == null || e === "" || e instanceof Array && e.length === 0 ||
2841
2924
  this._connectionType = e, this.parentComponent?.palette?.refreshPalette();
2842
2925
  }
2843
2926
  constructor(r, i) {
2844
- this.gridPatternId = `daga-grid-pattern-id-${++n.canvasCount}`, this.ancillaryGridPatternIds = [], this.zoomTransform = e.zoomIdentity, this.draggingFrom = [0, 0], this.dragging = !1, this.secondaryButton = !1, this.validatorChange$ = new t(), this.diagramChange$ = new t(), this.diagramEvent$ = new t(), this.propertyEditorChanges$ = new t(), this.parentComponent = r, this.model = new Lt(this, void 0, i.name || "unnamed", "", i.type || "", i.properties || []), this.userSelection = new cn(this, i.components?.propertyEditor?.title), this.userHighlight = new an(this, i.canvas?.highlightSections !== !1), this.contextMenu = new rn(this, i.canvas?.contextMenu), this.backgroundConfig = i.canvas?.background ?? Kt, this.gridConfig = Xt(i.canvas?.grid), this.ancillaryGridsConfig = [];
2845
- for (let e = 0; e < (i.canvas?.ancillaryGrids?.length || 0); ++e) this.ancillaryGridsConfig.push(Xt(i.canvas?.ancillaryGrids?.[e])), this.ancillaryGridPatternIds.push(`${this.gridPatternId}-ancillary-${e}`);
2846
- if (this.zoomFactor = i.canvas?.zoomFactor || 2, this.panRate = i.canvas?.panRate || 100, this.inferConnectionType = i.connectionSettings?.inferConnectionType || !1, this.autoTightenConnections = i.connectionSettings?.autoTighten !== !1, this.tightenConnectionsAcrossPortTypes = i.connectionSettings?.tightenAcrossPortTypes || !1, this.allowConnectionLoops = i.connectionSettings?.allowLoops || !1, this.allowSharingPorts = i.connectionSettings?.sharePorts !== !1, this.allowSharingBothPorts = i.connectionSettings?.shareBothPorts || !1, this.portHighlightRadius = i.connectionSettings?.portHighlightRadius || 100, this.multipleSelectionOn = !1, this.priorityThresholds = i.canvas?.priorityThresholds || [], this.priorityThreshold = this.priorityThresholds ? this.priorityThresholds[0] : void 0, this.layoutFormat = i.layoutFormat, this.userActions = i.userActions || {}, this.validators = [], this.actionStack = new St(this, 25), this.collabEngine = new xt(this), i.nodeTypes) for (let e of i.nodeTypes) {
2847
- let t = new qe({
2927
+ this.gridPatternId = `daga-grid-pattern-id-${++n.canvasCount}`, this.ancillaryGridPatternIds = [], this.zoomTransform = e.zoomIdentity, this.draggingFrom = [0, 0], this.dragging = !1, this.secondaryButton = !1, this.validatorChange$ = new t(), this.diagramChange$ = new t(), this.diagramEvent$ = new t(), this.propertyEditorChanges$ = new t(), this.parentComponent = r, this.model = new Bt(this, void 0, i.name || "unnamed", "", i.type || "", i.properties || []), this.userSelection = new fn(this, i.components?.propertyEditor?.title), this.userHighlight = new ln(this, i.canvas?.highlightSections !== !1), this.contextMenu = new cn(this, i.canvas?.contextMenu), this.backgroundConfig = i.canvas?.background ?? Xt, this.gridConfig = en(i.canvas?.grid), this.ancillaryGridsConfig = [];
2928
+ for (let e = 0; e < (i.canvas?.ancillaryGrids?.length || 0); ++e) this.ancillaryGridsConfig.push(en(i.canvas?.ancillaryGrids?.[e])), this.ancillaryGridPatternIds.push(`${this.gridPatternId}-ancillary-${e}`);
2929
+ if (this.zoomFactor = i.canvas?.zoomFactor || 2, this.panRate = i.canvas?.panRate || 100, this.inferConnectionType = i.connectionSettings?.inferConnectionType || !1, this.autoTightenConnections = i.connectionSettings?.autoTighten !== !1, this.tightenConnectionsAcrossPortTypes = i.connectionSettings?.tightenAcrossPortTypes || !1, this.allowConnectionLoops = i.connectionSettings?.allowLoops || !1, this.allowSharingPorts = i.connectionSettings?.sharePorts !== !1, this.allowSharingBothPorts = i.connectionSettings?.shareBothPorts || !1, this.portHighlightRadius = i.connectionSettings?.portHighlightRadius || 100, this.multipleSelectionOn = !1, this.priorityThresholds = i.canvas?.priorityThresholds || [], this.priorityThreshold = this.priorityThresholds ? this.priorityThresholds[0] : void 0, this.layoutFormat = i.layoutFormat, this.userActions = i.userActions || {}, this.validators = [], this.actionStack = new Tt(this, 25), this.collabEngine = new wt(this), i.nodeTypes) for (let e of i.nodeTypes) {
2930
+ let t = new Xe({
2848
2931
  ...i.nodeTypeDefaults,
2849
2932
  ...e
2850
2933
  });
2851
2934
  this.model.nodes.types.add(t);
2852
2935
  }
2853
2936
  if (i.portTypes) for (let e of i.portTypes) {
2854
- let t = new st({
2937
+ let t = new ut({
2855
2938
  ...i.portTypeDefaults,
2856
2939
  ...e
2857
2940
  });
@@ -2859,7 +2942,7 @@ var ke = (e) => e == null || e === "" || e instanceof Array && e.length === 0 ||
2859
2942
  }
2860
2943
  if (i.connectionTypes) {
2861
2944
  for (let e of i.connectionTypes) {
2862
- let t = new Pe({
2945
+ let t = new Fe({
2863
2946
  ...i.connectionTypeDefaults,
2864
2947
  ...e
2865
2948
  });
@@ -2872,7 +2955,7 @@ var ke = (e) => e == null || e === "" || e instanceof Array && e.length === 0 ||
2872
2955
  this.validators.push(e), this.validatorChange$.next();
2873
2956
  }
2874
2957
  removeValidator(e) {
2875
- k(this.validators, e), this.validatorChange$.next();
2958
+ O(this.validators, e), this.validatorChange$.next();
2876
2959
  }
2877
2960
  getPriorityThresholdOptions() {
2878
2961
  return this.priorityThresholds;
@@ -2894,10 +2977,10 @@ var ke = (e) => e == null || e === "" || e instanceof Array && e.length === 0 ||
2894
2977
  e.preventDefault(), e.stopPropagation(), this.dragging = !1;
2895
2978
  return;
2896
2979
  }
2897
- let t = new Ft(e, null);
2980
+ let t = new Rt(e, null);
2898
2981
  this.diagramEvent$.next(t), !t.defaultPrevented && this.canUserPerformAction(K.ContextMenu) && (e.preventDefault(), this.contextMenu.open(e));
2899
2982
  }).on(S.DoubleClick, (e) => {
2900
- let t = new Pt(e, null);
2983
+ let t = new Lt(e, null);
2901
2984
  this.diagramEvent$.next(t);
2902
2985
  }).on(S.KeyDown, (e) => {
2903
2986
  if (!e.ctrlKey && (e.key === C.Delete || e.key === C.Backspace) && this.canUserPerformAction(K.Remove) && (this.userSelection.removeFromModel(), this.cancelAllUserActions()), e.ctrlKey && e.key === "a") {
@@ -2924,23 +3007,23 @@ var ke = (e) => e == null || e === "" || e instanceof Array && e.length === 0 ||
2924
3007
  r.call(this.zoomBehavior = e.zoom().filter((e) => e.type !== S.DoubleClick).on(T.Zoom, (e) => {
2925
3008
  if (e.sourceEvent) {
2926
3009
  if (!this.canUserPerformAction(K.Zoom)) {
2927
- X(A.NotAllowed);
3010
+ X(k.NotAllowed);
2928
3011
  return;
2929
3012
  }
2930
- e.sourceEvent.type === S.Wheel && e.sourceEvent.wheelDelta !== void 0 ? (e.sourceEvent.wheelDelta > 0 && X(A.ZoomIn), e.sourceEvent.wheelDelta < 0 && X(A.ZoomOut)) : e.sourceEvent.type === S.MouseMove && X(A.AllScroll);
3013
+ e.sourceEvent.type === S.Wheel && e.sourceEvent.wheelDelta !== void 0 ? (e.sourceEvent.wheelDelta > 0 && X(k.ZoomIn), e.sourceEvent.wheelDelta < 0 && X(k.ZoomOut)) : e.sourceEvent.type === S.MouseMove && X(k.AllScroll);
2931
3014
  }
2932
3015
  this.zoomTransform = e.transform;
2933
3016
  let t = e.transform.toString();
2934
3017
  this.selectCanvasElements().attr("transform", t);
2935
3018
  for (let e of [this.gridPatternId, ...this.ancillaryGridPatternIds]) this.selectCanvasView().select(`#${e}`).attr("patternTransform", t);
2936
- this.contextMenu.close(), this.diagramEvent$.next(new Nt([this.zoomTransform.x, this.zoomTransform.y], this.zoomTransform.k));
3019
+ this.contextMenu.close(), this.diagramEvent$.next(new It([this.zoomTransform.x, this.zoomTransform.y], this.zoomTransform.k));
2937
3020
  }).on(T.End, () => {
2938
3021
  X();
2939
3022
  }));
2940
3023
  let i = r.append("defs"), a = [];
2941
- a.push(Yt(this, r, this.backgroundConfig));
2942
- for (let e = 0; e < this.ancillaryGridsConfig.length; ++e) a.push(Zt(this, r, i, this.ancillaryGridPatternIds[e], this.ancillaryGridsConfig[e]));
2943
- a.push(Zt(this, r, i, this.gridPatternId, this.gridConfig));
3024
+ a.push($t(r, this.backgroundConfig).attr("class", "daga-background"));
3025
+ for (let e = 0; e < this.ancillaryGridsConfig.length; ++e) a.push(tn(this, r, i, this.ancillaryGridPatternIds[e], this.ancillaryGridsConfig[e]));
3026
+ a.push(tn(this, r, i, this.gridPatternId, this.gridConfig));
2944
3027
  for (let t of a) t.on(S.MouseMove, (e) => {
2945
3028
  if (this.unfinishedConnection !== void 0) {
2946
3029
  let t = this.getPointerLocationRelativeToCanvas(e);
@@ -2954,7 +3037,7 @@ var ke = (e) => e == null || e === "" || e instanceof Array && e.length === 0 ||
2954
3037
  this.userSelection.clear(), this.diagramEvent$.next(new J(e, !1));
2955
3038
  }
2956
3039
  this.userSelection.openInPropertyEditor(this.model);
2957
- }), t.call(e.drag().filter((e) => this.multipleSelectionOn || Rt(e)).on(w.Start, (e) => {
3040
+ }), t.call(e.drag().filter((e) => this.multipleSelectionOn || Vt(e)).on(w.Start, (e) => {
2958
3041
  this.startMultipleSelection(e);
2959
3042
  }).on(w.Drag, (e) => {
2960
3043
  this.continueMultipleSelection(e);
@@ -2973,7 +3056,7 @@ var ke = (e) => e == null || e === "" || e instanceof Array && e.length === 0 ||
2973
3056
  isNaN(e) || this.zoomBehavior.scaleTo(this.selectCanvasView(), e);
2974
3057
  }
2975
3058
  getViewCoordinates() {
2976
- let e = this.selectCanvasView()?.select("rect")?.node()?.getBBox();
3059
+ let e = this.selectCanvasView()?.select(".daga-background")?.node()?.getBBox();
2977
3060
  return [((e.width + e.x) / 2 - this.zoomTransform.x) / this.zoomTransform.k, ((e.height + e.y) / 2 - this.zoomTransform.y) / this.zoomTransform.k];
2978
3061
  }
2979
3062
  translateBy(e, t) {
@@ -3005,7 +3088,9 @@ var ke = (e) => e == null || e === "" || e instanceof Array && e.length === 0 ||
3005
3088
  }
3006
3089
  center(e, t, n) {
3007
3090
  if (this.model.nodes.length > 0) {
3008
- let r = this.selectCanvasView().select("rect").node()?.getBBox(), i = e?.map((e) => this.model.nodes.get(e)).filter((e) => !!e) || this.model.nodes.all(), a = Math.min(...i.map((e) => e.coords[0])), o = Math.max(...i.map((e) => e.coords[0] + e.width)), s = (a + o) / 2, c = o - a, l = r.width, u = Math.min(...i.map((e) => e.coords[1])), d = Math.max(...i.map((e) => e.coords[1] + e.height)), f = (u + d) / 2, p = d - u, m = r.height, h = Math.min(l / c, m / p, t === void 0 ? 1 : t);
3091
+ let r = this.selectCanvasView().select(".daga-background").node()?.getBBox();
3092
+ if (!r.width || !r.height) return;
3093
+ let i = e?.map((e) => this.model.nodes.get(e)).filter((e) => !!e) || this.model.nodes.all(), a = Math.min(...i.map((e) => e.coords[0])), o = Math.max(...i.map((e) => e.coords[0] + e.width)), s = (a + o) / 2, c = o - a, l = r.width, u = Math.min(...i.map((e) => e.coords[1])), d = Math.max(...i.map((e) => e.coords[1] + e.height)), f = (u + d) / 2, p = d - u, m = r.height, h = Math.min(l / c, m / p, t === void 0 ? 1 : t);
3009
3094
  this.zoomAndPanTo(s, f, h, n);
3010
3095
  }
3011
3096
  }
@@ -3043,7 +3128,7 @@ var ke = (e) => e == null || e === "" || e instanceof Array && e.length === 0 ||
3043
3128
  this.updateNodesInView(), this.updateSectionsInView(), this.updatePortsInView(), this.updateConnectionsInView(), this.updateFieldsInView(), this.updateObjectsInView(), this.updateDecoratorsInView();
3044
3129
  }
3045
3130
  updateNodesInView(...t) {
3046
- let n = this.selectCanvasElements().selectAll("g.diagram-node").data(this.model.nodes.filter((e) => this.priorityThreshold === void 0 ? !0 : e.getPriority() >= this.priorityThreshold), (e) => e.id), r = n.exit(), i = n.enter().append("g").attr("id", (e) => e.id).attr("class", (e) => `diagram-node${Vt(e) ? " resizable-x" : ""}${Ht(e) ? " resizable-y" : ""} ${e.type.defaultLook.lookType}`);
3131
+ let n = this.selectCanvasElements().selectAll("g.diagram-node").data(this.model.nodes.filter((e) => this.priorityThreshold === void 0 ? !0 : e.getPriority() >= this.priorityThreshold), (e) => e.id), r = n.exit(), i = n.enter().append("g").attr("id", (e) => e.id).attr("class", (e) => `diagram-node${Wt(e) ? " resizable-x" : ""}${Gt(e) ? " resizable-y" : ""}${Kt(e) ? " resizable-xy" : ""} ${e.type.defaultLook.lookType}`);
3047
3132
  t && t.length > 0 && (n = n.filter((e) => t.includes(e.id)));
3048
3133
  let a = i.merge(n);
3049
3134
  r.remove(), i.on(S.MouseOver, (e, t) => {
@@ -3059,23 +3144,23 @@ var ke = (e) => e == null || e === "" || e instanceof Array && e.length === 0 ||
3059
3144
  e.preventDefault(), e.stopPropagation(), this.dragging = !1;
3060
3145
  return;
3061
3146
  }
3062
- let n = new Ft(e, t);
3147
+ let n = new Rt(e, t);
3063
3148
  this.diagramEvent$.next(n), !n.defaultPrevented && this.canUserPerformAction(K.ContextMenu) && (e.preventDefault(), this.userHighlight.focusOn(t), this.diagramEvent$.next(new Y(t)), this.userSelection.add(t), this.diagramEvent$.next(new J([t], !0)), this.contextMenu.open(e));
3064
3149
  }).on(S.DoubleClick, (e, t) => {
3065
- let n = new Pt(e, t);
3150
+ let n = new Lt(e, t);
3066
3151
  this.diagramEvent$.next(n);
3067
- }).call(e.drag().filter((e) => (this.secondaryButton = Rt(e), !0)).on(w.Start, (e, t) => {
3152
+ }).call(e.drag().filter((e) => (this.secondaryButton = Vt(e), !0)).on(w.Start, (e, t) => {
3068
3153
  this.multipleSelectionOn || this.secondaryButton ? this.startMultipleSelection(e) : this.startMovingNode(e, t);
3069
3154
  }).on(w.Drag, (e, t) => {
3070
3155
  this.multipleSelectionOn || this.secondaryButton ? this.continueMultipleSelection(e) : this.continueMovingNode(e, t);
3071
3156
  }).on(w.End, (e, t) => {
3072
3157
  this.multipleSelectionOn || this.secondaryButton ? this.finishMultipleSelection(e) : this.finishMovingNode(e, t), this.secondaryButton = !1;
3073
- })), Ut(i), i.filter(".resizable-x").append("line").attr("class", "left-resizer").attr("stroke", "transparent").attr("stroke-width", 6).on(S.MouseOver, (e, t) => {
3074
- this.canUserPerformAction(K.StretchNode) && t.getResizableX() && !t.removed && X(A.EWResize);
3158
+ })), qt(i), i.filter(".resizable-x").append("rect").attr("class", "left-resizer").on(S.MouseOver, (e, t) => {
3159
+ this.canUserPerformAction(K.StretchNode) && t.getResizableX() && !t.removed && X(k.EWResize);
3075
3160
  }).on(S.MouseOut, (e, t) => {
3076
3161
  this.canUserPerformAction(K.StretchNode) && t.getResizableX() && !t.removed && X();
3077
3162
  }).call(e.drag().on(w.Start, (e, t) => {
3078
- this.canUserPerformAction(K.StretchNode) && t.getResizableX() && !t.removed ? (X(A.EWResize), this.currentAction = new q(this, K.StretchNode, t.id, t.getGeometry(), t.getGeometry())) : X(A.NotAllowed);
3163
+ this.canUserPerformAction(K.StretchNode) && t.getResizableX() && !t.removed ? (X(k.EWResize), this.currentAction = new q(this, K.StretchNode, t.id, t.getGeometry(), t.getGeometry())) : X(k.NotAllowed);
3079
3164
  }).on(w.Drag, (e, t) => {
3080
3165
  if (this.canUserPerformAction(K.StretchNode) && t.getResizableX() && !t.removed) {
3081
3166
  let n = this.getPointerLocationRelativeToCanvas(e);
@@ -3087,46 +3172,46 @@ var ke = (e) => e == null || e === "" || e instanceof Array && e.length === 0 ||
3087
3172
  this.gridConfig.snap && (n = this.getClosestGridPoint([n[0] - t.type.snapToGridOffset[0], n[1] - t.type.snapToGridOffset[1]]), n[0] += t.type.snapToGridOffset[0], n[1] += t.type.snapToGridOffset[1]), t.stretch(p.Left, t.coords[0] - n[0]), this.currentAction.to = t.getGeometry(), this.currentAction.do(), this.actionStack.add(this.currentAction), this.currentAction = void 0;
3088
3173
  }
3089
3174
  X();
3090
- })), i.filter(".resizable-y").append("line").attr("class", "top-resizer").attr("stroke", "transparent").attr("stroke-width", 6).on(S.MouseOver, (e, t) => {
3091
- this.canUserPerformAction(K.StretchNode) && t.getResizableY() && !t.removed && X(A.NSResize);
3175
+ })), i.filter(".resizable-x").append("rect").attr("class", "right-resizer").on(S.MouseOver, (e, t) => {
3176
+ this.canUserPerformAction(K.StretchNode) && t.getResizableX() && !t.removed && X(k.EWResize);
3092
3177
  }).on(S.MouseOut, (e, t) => {
3093
- this.canUserPerformAction(K.StretchNode) && t.getResizableY() && !t.removed && X();
3178
+ this.canUserPerformAction(K.StretchNode) && t.getResizableX() && !t.removed && X();
3094
3179
  }).call(e.drag().on(w.Start, (e, t) => {
3095
- this.canUserPerformAction(K.StretchNode) && t.getResizableY() && !t.removed ? (X(A.NSResize), this.currentAction = new q(this, K.StretchNode, t.id, t.getGeometry(), t.getGeometry())) : X(A.NotAllowed);
3180
+ this.canUserPerformAction(K.StretchNode) && t.getResizableX() && !t.removed ? (X(k.EWResize), this.currentAction = new q(this, K.StretchNode, t.id, t.getGeometry(), t.getGeometry())) : X(k.NotAllowed);
3096
3181
  }).on(w.Drag, (e, t) => {
3097
- if (this.canUserPerformAction(K.StretchNode) && t.getResizableY() && !t.removed) {
3182
+ if (this.canUserPerformAction(K.StretchNode) && t.getResizableX() && !t.removed) {
3098
3183
  let n = this.getPointerLocationRelativeToCanvas(e);
3099
- t.stretch(p.Top, t.coords[1] - n[1]);
3184
+ t.stretch(p.Right, n[0] - (t.coords[0] + t.width));
3100
3185
  }
3101
3186
  }).on(w.End, (e, t) => {
3102
- if (this.canUserPerformAction(K.StretchNode) && t.getResizableY() && !t.removed && this.currentAction instanceof q && this.currentAction.intent === K.StretchNode) {
3187
+ if (this.canUserPerformAction(K.StretchNode) && t.getResizableX() && !t.removed && this.currentAction instanceof q && this.currentAction.intent === K.StretchNode) {
3103
3188
  let n = this.getPointerLocationRelativeToCanvas(e);
3104
- this.gridConfig.snap && (n = this.getClosestGridPoint([n[0] - t.type.snapToGridOffset[0], n[1] - t.type.snapToGridOffset[1]]), n[0] += t.type.snapToGridOffset[0], n[1] += t.type.snapToGridOffset[1]), t.stretch(p.Top, t.coords[1] - n[1]), this.currentAction.to = t.getGeometry(), this.currentAction.do(), this.actionStack.add(this.currentAction), this.currentAction = void 0;
3189
+ this.gridConfig.snap && (n = this.getClosestGridPoint([n[0] - t.type.snapToGridOffset[2], n[1] - t.type.snapToGridOffset[3]]), n[0] += t.type.snapToGridOffset[2], n[1] += t.type.snapToGridOffset[3]), t.stretch(p.Right, n[0] - (t.coords[0] + t.width)), this.currentAction.to = t.getGeometry(), this.currentAction.do(), this.actionStack.add(this.currentAction), this.currentAction = void 0;
3105
3190
  }
3106
3191
  X();
3107
- })), i.filter(".resizable-x").append("line").attr("class", "right-resizer").attr("stroke", "transparent").attr("stroke-width", 6).on(S.MouseOver, (e, t) => {
3108
- this.canUserPerformAction(K.StretchNode) && t.getResizableX() && !t.removed && X(A.EWResize);
3192
+ })), i.filter(".resizable-y").append("rect").attr("class", "top-resizer").on(S.MouseOver, (e, t) => {
3193
+ this.canUserPerformAction(K.StretchNode) && t.getResizableY() && !t.removed && X(k.NSResize);
3109
3194
  }).on(S.MouseOut, (e, t) => {
3110
- this.canUserPerformAction(K.StretchNode) && t.getResizableX() && !t.removed && X();
3195
+ this.canUserPerformAction(K.StretchNode) && t.getResizableY() && !t.removed && X();
3111
3196
  }).call(e.drag().on(w.Start, (e, t) => {
3112
- this.canUserPerformAction(K.StretchNode) && t.getResizableX() && !t.removed ? (X(A.EWResize), this.currentAction = new q(this, K.StretchNode, t.id, t.getGeometry(), t.getGeometry())) : X(A.NotAllowed);
3197
+ this.canUserPerformAction(K.StretchNode) && t.getResizableY() && !t.removed ? (X(k.NSResize), this.currentAction = new q(this, K.StretchNode, t.id, t.getGeometry(), t.getGeometry())) : X(k.NotAllowed);
3113
3198
  }).on(w.Drag, (e, t) => {
3114
- if (this.canUserPerformAction(K.StretchNode) && t.getResizableX() && !t.removed) {
3199
+ if (this.canUserPerformAction(K.StretchNode) && t.getResizableY() && !t.removed) {
3115
3200
  let n = this.getPointerLocationRelativeToCanvas(e);
3116
- t.stretch(p.Right, n[0] - (t.coords[0] + t.width));
3201
+ t.stretch(p.Top, t.coords[1] - n[1]);
3117
3202
  }
3118
3203
  }).on(w.End, (e, t) => {
3119
- if (this.canUserPerformAction(K.StretchNode) && t.getResizableX() && !t.removed && this.currentAction instanceof q && this.currentAction.intent === K.StretchNode) {
3204
+ if (this.canUserPerformAction(K.StretchNode) && t.getResizableY() && !t.removed && this.currentAction instanceof q && this.currentAction.intent === K.StretchNode) {
3120
3205
  let n = this.getPointerLocationRelativeToCanvas(e);
3121
- this.gridConfig.snap && (n = this.getClosestGridPoint([n[0] - t.type.snapToGridOffset[2], n[1] - t.type.snapToGridOffset[3]]), n[0] += t.type.snapToGridOffset[2], n[1] += t.type.snapToGridOffset[3]), t.stretch(p.Right, n[0] - (t.coords[0] + t.width)), this.currentAction.to = t.getGeometry(), this.currentAction.do(), this.actionStack.add(this.currentAction), this.currentAction = void 0;
3206
+ this.gridConfig.snap && (n = this.getClosestGridPoint([n[0] - t.type.snapToGridOffset[0], n[1] - t.type.snapToGridOffset[1]]), n[0] += t.type.snapToGridOffset[0], n[1] += t.type.snapToGridOffset[1]), t.stretch(p.Top, t.coords[1] - n[1]), this.currentAction.to = t.getGeometry(), this.currentAction.do(), this.actionStack.add(this.currentAction), this.currentAction = void 0;
3122
3207
  }
3123
3208
  X();
3124
- })), i.filter(".resizable-y").append("line").attr("class", "bottom-resizer").attr("stroke", "transparent").attr("stroke-width", 6).on(S.MouseOver, (e, t) => {
3125
- this.canUserPerformAction(K.StretchNode) && t.getResizableY() && !t.removed && X(A.NSResize);
3209
+ })), i.filter(".resizable-y").append("rect").attr("class", "bottom-resizer").on(S.MouseOver, (e, t) => {
3210
+ this.canUserPerformAction(K.StretchNode) && t.getResizableY() && !t.removed && X(k.NSResize);
3126
3211
  }).on(S.MouseOut, (e, t) => {
3127
3212
  this.canUserPerformAction(K.StretchNode) && t.getResizableY() && !t.removed && X();
3128
3213
  }).call(e.drag().on(w.Start, (e, t) => {
3129
- this.canUserPerformAction(K.StretchNode) && t.getResizableY() && !t.removed ? (X(A.NSResize), this.currentAction = new q(this, K.StretchNode, t.id, t.getGeometry(), t.getGeometry())) : X(A.NotAllowed);
3214
+ this.canUserPerformAction(K.StretchNode) && t.getResizableY() && !t.removed ? (X(k.NSResize), this.currentAction = new q(this, K.StretchNode, t.id, t.getGeometry(), t.getGeometry())) : X(k.NotAllowed);
3130
3215
  }).on(w.Drag, (e, t) => {
3131
3216
  if (this.canUserPerformAction(K.StretchNode) && t.getResizableY() && !t.removed) {
3132
3217
  let n = this.getPointerLocationRelativeToCanvas(e);
@@ -3138,10 +3223,78 @@ var ke = (e) => e == null || e === "" || e instanceof Array && e.length === 0 ||
3138
3223
  this.gridConfig.snap && (n = this.getClosestGridPoint([n[0] - t.type.snapToGridOffset[2], n[1] - t.type.snapToGridOffset[3]]), n[0] += t.type.snapToGridOffset[2], n[1] += t.type.snapToGridOffset[3]), t.stretch(p.Bottom, n[1] - (t.coords[1] + t.height)), this.currentAction.to = t.getGeometry(), this.currentAction.do(), this.actionStack.add(this.currentAction), this.currentAction = void 0;
3139
3224
  }
3140
3225
  X();
3141
- })), a.attr("transform", (e) => `translate(${e.coords[0]},${e.coords[1]})`).attr("opacity", (e) => e.removed ? .5 : 1), Gt(a), a.filter(".resizable-x").select("line.left-resizer").style("pointer-events", (e) => e.getResizableX() ? "initial" : "none").attr("x1", 6 / 2).attr("x2", 6 / 2).attr("y1", 0).attr("y2", (e) => e.height), a.filter(".resizable-y").select("line.top-resizer").style("pointer-events", (e) => e.getResizableY() ? "initial" : "none").attr("x1", 0).attr("x2", (e) => e.width).attr("y1", 6 / 2).attr("y2", 6 / 2), a.filter(".resizable-x").select("line.right-resizer").style("pointer-events", (e) => e.getResizableX() ? "initial" : "none").attr("x1", (e) => e.width - 6 / 2).attr("x2", (e) => e.width - 6 / 2).attr("y1", 0).attr("y2", (e) => e.height), a.filter(".resizable-y").select("line.bottom-resizer").style("pointer-events", (e) => e.getResizableY() ? "initial" : "none").attr("x1", 0).attr("x2", (e) => e.width).attr("y1", (e) => e.height - 6 / 2).attr("y2", (e) => e.height - 6 / 2);
3226
+ })), i.filter(".resizable-xy").append("rect").attr("class", "top-left-resizer").on(S.MouseOver, (e, t) => {
3227
+ this.canUserPerformAction(K.StretchNode) && t.getResizableXY() && !t.removed && X(k.NWSEResize);
3228
+ }).on(S.MouseOut, (e, t) => {
3229
+ this.canUserPerformAction(K.StretchNode) && t.getResizableXY() && !t.removed && X();
3230
+ }).call(e.drag().on(w.Start, (e, t) => {
3231
+ this.canUserPerformAction(K.StretchNode) && t.getResizableXY() && !t.removed ? (X(k.NWSEResize), this.currentAction = new q(this, K.StretchNode, t.id, t.getGeometry(), t.getGeometry())) : X(k.NotAllowed);
3232
+ }).on(w.Drag, (e, t) => {
3233
+ if (this.canUserPerformAction(K.StretchNode) && t.getResizableXY() && !t.removed) {
3234
+ let n = this.getPointerLocationRelativeToCanvas(e);
3235
+ t.stretch(p.Left, t.coords[0] - n[0]), t.stretch(p.Top, t.coords[1] - n[1]);
3236
+ }
3237
+ }).on(w.End, (e, t) => {
3238
+ if (this.canUserPerformAction(K.StretchNode) && t.getResizableXY() && !t.removed && this.currentAction instanceof q && this.currentAction.intent === K.StretchNode) {
3239
+ let n = this.getPointerLocationRelativeToCanvas(e);
3240
+ this.gridConfig.snap && (n = this.getClosestGridPoint([n[0] - t.type.snapToGridOffset[0], n[1] - t.type.snapToGridOffset[1]]), n[0] += t.type.snapToGridOffset[0], n[1] += t.type.snapToGridOffset[1]), t.stretch(p.Left, t.coords[0] - n[0]), t.stretch(p.Top, t.coords[1] - n[1]), this.currentAction.to = t.getGeometry(), this.currentAction.do(), this.actionStack.add(this.currentAction), this.currentAction = void 0;
3241
+ }
3242
+ X();
3243
+ })), i.filter(".resizable-xy").append("rect").attr("class", "top-right-resizer").on(S.MouseOver, (e, t) => {
3244
+ this.canUserPerformAction(K.StretchNode) && t.getResizableXY() && !t.removed && X(k.NESWResize);
3245
+ }).on(S.MouseOut, (e, t) => {
3246
+ this.canUserPerformAction(K.StretchNode) && t.getResizableXY() && !t.removed && X();
3247
+ }).call(e.drag().on(w.Start, (e, t) => {
3248
+ this.canUserPerformAction(K.StretchNode) && t.getResizableXY() && !t.removed ? (X(k.NESWResize), this.currentAction = new q(this, K.StretchNode, t.id, t.getGeometry(), t.getGeometry())) : X(k.NotAllowed);
3249
+ }).on(w.Drag, (e, t) => {
3250
+ if (this.canUserPerformAction(K.StretchNode) && t.getResizableXY() && !t.removed) {
3251
+ let n = this.getPointerLocationRelativeToCanvas(e);
3252
+ t.stretch(p.Right, n[0] - (t.coords[0] + t.width)), t.stretch(p.Top, t.coords[1] - n[1]);
3253
+ }
3254
+ }).on(w.End, (e, t) => {
3255
+ if (this.canUserPerformAction(K.StretchNode) && t.getResizableXY() && !t.removed && this.currentAction instanceof q && this.currentAction.intent === K.StretchNode) {
3256
+ let n = this.getPointerLocationRelativeToCanvas(e);
3257
+ this.gridConfig.snap && (n = this.getClosestGridPoint([n[0] - t.type.snapToGridOffset[0], n[1] - t.type.snapToGridOffset[1]]), n[0] += t.type.snapToGridOffset[0], n[1] += t.type.snapToGridOffset[1]), t.stretch(p.Right, n[0] - (t.coords[0] + t.width)), t.stretch(p.Top, t.coords[1] - n[1]), this.currentAction.to = t.getGeometry(), this.currentAction.do(), this.actionStack.add(this.currentAction), this.currentAction = void 0;
3258
+ }
3259
+ X();
3260
+ })), i.filter(".resizable-xy").append("rect").attr("class", "bottom-left-resizer").on(S.MouseOver, (e, t) => {
3261
+ this.canUserPerformAction(K.StretchNode) && t.getResizableXY() && !t.removed && X(k.NESWResize);
3262
+ }).on(S.MouseOut, (e, t) => {
3263
+ this.canUserPerformAction(K.StretchNode) && t.getResizableXY() && !t.removed && X();
3264
+ }).call(e.drag().on(w.Start, (e, t) => {
3265
+ this.canUserPerformAction(K.StretchNode) && t.getResizableXY() && !t.removed ? (X(k.NESWResize), this.currentAction = new q(this, K.StretchNode, t.id, t.getGeometry(), t.getGeometry())) : X(k.NotAllowed);
3266
+ }).on(w.Drag, (e, t) => {
3267
+ if (this.canUserPerformAction(K.StretchNode) && t.getResizableXY() && !t.removed) {
3268
+ let n = this.getPointerLocationRelativeToCanvas(e);
3269
+ t.stretch(p.Left, t.coords[0] - n[0]), t.stretch(p.Bottom, n[1] - (t.coords[1] + t.height));
3270
+ }
3271
+ }).on(w.End, (e, t) => {
3272
+ if (this.canUserPerformAction(K.StretchNode) && t.getResizableXY() && !t.removed && this.currentAction instanceof q && this.currentAction.intent === K.StretchNode) {
3273
+ let n = this.getPointerLocationRelativeToCanvas(e);
3274
+ this.gridConfig.snap && (n = this.getClosestGridPoint([n[0] - t.type.snapToGridOffset[0], n[1] - t.type.snapToGridOffset[1]]), n[0] += t.type.snapToGridOffset[0], n[1] += t.type.snapToGridOffset[1]), t.stretch(p.Left, t.coords[0] - n[0]), t.stretch(p.Bottom, n[1] - (t.coords[1] + t.height)), this.currentAction.to = t.getGeometry(), this.currentAction.do(), this.actionStack.add(this.currentAction), this.currentAction = void 0;
3275
+ }
3276
+ X();
3277
+ })), i.filter(".resizable-xy").append("rect").attr("class", "bottom-right-resizer").on(S.MouseOver, (e, t) => {
3278
+ this.canUserPerformAction(K.StretchNode) && t.getResizableXY() && !t.removed && X(k.NWSEResize);
3279
+ }).on(S.MouseOut, (e, t) => {
3280
+ this.canUserPerformAction(K.StretchNode) && t.getResizableXY() && !t.removed && X();
3281
+ }).call(e.drag().on(w.Start, (e, t) => {
3282
+ this.canUserPerformAction(K.StretchNode) && t.getResizableXY() && !t.removed ? (X(k.NWSEResize), this.currentAction = new q(this, K.StretchNode, t.id, t.getGeometry(), t.getGeometry())) : X(k.NotAllowed);
3283
+ }).on(w.Drag, (e, t) => {
3284
+ if (this.canUserPerformAction(K.StretchNode) && t.getResizableXY() && !t.removed) {
3285
+ let n = this.getPointerLocationRelativeToCanvas(e);
3286
+ t.stretch(p.Right, n[0] - (t.coords[0] + t.width)), t.stretch(p.Bottom, n[1] - (t.coords[1] + t.height));
3287
+ }
3288
+ }).on(w.End, (e, t) => {
3289
+ if (this.canUserPerformAction(K.StretchNode) && t.getResizableXY() && !t.removed && this.currentAction instanceof q && this.currentAction.intent === K.StretchNode) {
3290
+ let n = this.getPointerLocationRelativeToCanvas(e);
3291
+ this.gridConfig.snap && (n = this.getClosestGridPoint([n[0] - t.type.snapToGridOffset[0], n[1] - t.type.snapToGridOffset[1]]), n[0] += t.type.snapToGridOffset[0], n[1] += t.type.snapToGridOffset[1]), t.stretch(p.Right, n[0] - (t.coords[0] + t.width)), t.stretch(p.Bottom, n[1] - (t.coords[1] + t.height)), this.currentAction.to = t.getGeometry(), this.currentAction.do(), this.actionStack.add(this.currentAction), this.currentAction = void 0;
3292
+ }
3293
+ X();
3294
+ })), a.attr("transform", (e) => `translate(${e.coords[0]},${e.coords[1]})`).attr("opacity", (e) => e.removed ? .5 : 1), Yt(a), a.filter(".resizable-x").select("rect.left-resizer").style("pointer-events", (e) => e.getResizableX() ? "initial" : "none").attr("x", (e) => -e.getResizerX().outerMargin).attr("y", (e) => e.getResizerXY().thickness - e.getResizerXY().outerMargin).attr("width", (e) => e.getResizerX().thickness).attr("height", (e) => e.height - e.getResizerXY().thickness * 2 + e.getResizerXY().outerMargin * 2).attr("fill", (e) => e.getResizerX().getLook(e).fillColor || "transparent").attr("stroke", (e) => e.getResizerX().getLook(e).borderColor || "transparent").attr("stroke-width", (e) => e.getResizerX().getLook(e).borderThickness || 0), a.filter(".resizable-x").select("rect.right-resizer").style("pointer-events", (e) => e.getResizableX() ? "initial" : "none").attr("x", (e) => e.width - e.getResizerX().thickness + e.getResizerX().outerMargin).attr("y", (e) => e.getResizerXY().thickness - e.getResizerXY().outerMargin).attr("width", (e) => e.getResizerX().thickness).attr("height", (e) => e.height - e.getResizerXY().thickness * 2 + e.getResizerXY().outerMargin * 2).attr("fill", (e) => e.getResizerX().getLook(e).fillColor || "transparent").attr("stroke", (e) => e.getResizerX().getLook(e).borderColor || "transparent").attr("stroke-width", (e) => e.getResizerX().getLook(e).borderThickness || 0), a.filter(".resizable-y").select("rect.top-resizer").style("pointer-events", (e) => e.getResizableY() ? "initial" : "none").attr("x", (e) => e.getResizerXY().thickness - e.getResizerXY().outerMargin).attr("y", (e) => -e.getResizerY().outerMargin).attr("width", (e) => e.width - e.getResizerXY().thickness * 2 + e.getResizerXY().outerMargin * 2).attr("height", (e) => e.getResizerY().thickness).attr("fill", (e) => e.getResizerY().getLook(e).fillColor || "transparent").attr("stroke", (e) => e.getResizerY().getLook(e).borderColor || "transparent").attr("stroke-width", (e) => e.getResizerY().getLook(e).borderThickness || 0), a.filter(".resizable-y").select("rect.bottom-resizer").style("pointer-events", (e) => e.getResizableY() ? "initial" : "none").attr("x", (e) => e.getResizerXY().thickness - e.getResizerXY().outerMargin).attr("y", (e) => e.height - e.getResizerY().thickness + e.getResizerY().outerMargin).attr("width", (e) => e.width - e.getResizerXY().thickness * 2 + e.getResizerXY().outerMargin * 2).attr("height", (e) => e.getResizerY().thickness).attr("fill", (e) => e.getResizerY().getLook(e).fillColor || "transparent").attr("stroke", (e) => e.getResizerY().getLook(e).borderColor || "transparent").attr("stroke-width", (e) => e.getResizerY().getLook(e).borderThickness || 0), a.filter(".resizable-xy").select("rect.top-left-resizer").style("pointer-events", (e) => e.getResizableXY() ? "initial" : "none").attr("x", (e) => -e.getResizerXY().outerMargin).attr("y", (e) => -e.getResizerXY().outerMargin).attr("width", (e) => e.getResizerXY().thickness).attr("height", (e) => e.getResizerXY().thickness).attr("fill", (e) => e.getResizerXY().getLook(e).fillColor || "transparent").attr("stroke", (e) => e.getResizerXY().getLook(e).borderColor || "transparent").attr("stroke-width", (e) => e.getResizerXY().getLook(e).borderThickness || 0), a.filter(".resizable-xy").select("rect.top-right-resizer").style("pointer-events", (e) => e.getResizableXY() ? "initial" : "none").attr("x", (e) => e.width - e.getResizerXY().thickness + e.getResizerXY().outerMargin).attr("y", (e) => -e.getResizerXY().outerMargin).attr("width", (e) => e.getResizerXY().thickness).attr("height", (e) => e.getResizerXY().thickness).attr("fill", (e) => e.getResizerXY().getLook(e).fillColor || "transparent").attr("stroke", (e) => e.getResizerXY().getLook(e).borderColor || "transparent").attr("stroke-width", (e) => e.getResizerXY().getLook(e).borderThickness || 0), a.filter(".resizable-xy").select("rect.bottom-left-resizer").style("pointer-events", (e) => e.getResizableXY() ? "initial" : "none").attr("x", (e) => -e.getResizerXY().outerMargin).attr("y", (e) => e.height - e.getResizerXY().thickness + e.getResizerXY().outerMargin).attr("width", (e) => e.getResizerXY().thickness).attr("height", (e) => e.getResizerXY().thickness).attr("fill", (e) => e.getResizerXY().getLook(e).fillColor || "transparent").attr("stroke", (e) => e.getResizerXY().getLook(e).borderColor || "transparent").attr("stroke-width", (e) => e.getResizerXY().getLook(e).borderThickness || 0), a.filter(".resizable-xy").select("rect.bottom-right-resizer").style("pointer-events", (e) => e.getResizableXY() ? "initial" : "none").attr("x", (e) => e.width - e.getResizerXY().thickness + e.getResizerXY().outerMargin).attr("y", (e) => e.height - e.getResizerXY().thickness + e.getResizerXY().outerMargin).attr("width", (e) => e.getResizerXY().thickness).attr("height", (e) => e.getResizerXY().thickness).attr("fill", (e) => e.getResizerXY().getLook(e).fillColor || "transparent").attr("stroke", (e) => e.getResizerXY().getLook(e).borderColor || "transparent").attr("stroke-width", (e) => e.getResizerXY().getLook(e).borderThickness || 0);
3142
3295
  }
3143
3296
  updateSectionsInView(...t) {
3144
- let n = this.selectCanvasElements().selectAll("g.diagram-section").data(this.model.sections.filter((e) => this.priorityThreshold === void 0 ? !0 : e.getPriority() >= this.priorityThreshold), (e) => e.id), r = n.exit(), i = n.enter().append("g").attr("id", (e) => e.id).attr("class", (e) => `diagram-section${Vt(e) ? " resizable-x" : ""}${Ht(e) ? " resizable-y" : ""} ${e.look?.lookType}`);
3297
+ let n = this.selectCanvasElements().selectAll("g.diagram-section").data(this.model.sections.filter((e) => this.priorityThreshold === void 0 ? !0 : e.getPriority() >= this.priorityThreshold), (e) => e.id), r = n.exit(), i = n.enter().append("g").attr("id", (e) => e.id).attr("class", (e) => `diagram-section${Wt(e) ? " resizable-x" : ""}${Gt(e) ? " resizable-y" : ""}${Kt(e) ? " resizable-xy" : ""} ${e.look?.lookType}`);
3145
3298
  t && t.length > 0 && (n = n.filter((e) => t.includes(e.id)));
3146
3299
  let a = i.merge(n);
3147
3300
  r.remove(), i.on(S.MouseOver, (e, t) => {
@@ -3151,33 +3304,33 @@ var ke = (e) => e == null || e === "" || e instanceof Array && e.length === 0 ||
3151
3304
  let e = this.userSelection.all();
3152
3305
  this.userSelection.clear(), this.diagramEvent$.next(new J(e, !1));
3153
3306
  }
3154
- let n = Bt(t);
3307
+ let n = Ut(t);
3155
3308
  this.userSelection.toggle(n), this.diagramEvent$.next(new J([n], n.selected));
3156
3309
  }).on(S.ContextMenu, (e, t) => {
3157
3310
  if (this.dragging) {
3158
3311
  e.preventDefault(), e.stopPropagation(), this.dragging = !1;
3159
3312
  return;
3160
3313
  }
3161
- let n = new Ft(e, t);
3314
+ let n = new Rt(e, t);
3162
3315
  if (this.diagramEvent$.next(n), !n.defaultPrevented && this.canUserPerformAction(K.ContextMenu)) {
3163
3316
  e.preventDefault();
3164
- let n = Bt(t);
3317
+ let n = Ut(t);
3165
3318
  this.userHighlight.focusOn(n), this.diagramEvent$.next(new Y(n)), this.userSelection.add(n), this.diagramEvent$.next(new J([n], !0)), this.contextMenu.open(e);
3166
3319
  }
3167
3320
  }).on(S.DoubleClick, (e, t) => {
3168
- let n = new Pt(e, t);
3321
+ let n = new Lt(e, t);
3169
3322
  this.diagramEvent$.next(n);
3170
- }).call(e.drag().filter((e) => (this.secondaryButton = Rt(e), !0)).on(w.Start, (e, t) => {
3323
+ }).call(e.drag().filter((e) => (this.secondaryButton = Vt(e), !0)).on(w.Start, (e, t) => {
3171
3324
  if (this.multipleSelectionOn || this.secondaryButton) this.startMultipleSelection(e);
3172
3325
  else {
3173
3326
  let n = t?.node;
3174
- n ? this.startMovingNode(e, n) : X(A.NotAllowed);
3327
+ n ? this.startMovingNode(e, n) : X(k.NotAllowed);
3175
3328
  }
3176
3329
  }).on(w.Drag, (e, t) => {
3177
3330
  if (this.multipleSelectionOn || this.secondaryButton) this.continueMultipleSelection(e);
3178
3331
  else {
3179
3332
  let n = t?.node;
3180
- n ? this.continueMovingNode(e, n) : X(A.NotAllowed);
3333
+ n ? this.continueMovingNode(e, n) : X(k.NotAllowed);
3181
3334
  }
3182
3335
  }).on(w.End, (e, t) => {
3183
3336
  if (this.multipleSelectionOn || this.secondaryButton) this.finishMultipleSelection(e);
@@ -3186,12 +3339,12 @@ var ke = (e) => e == null || e === "" || e instanceof Array && e.length === 0 ||
3186
3339
  n ? this.finishMovingNode(e, n) : X();
3187
3340
  }
3188
3341
  this.secondaryButton = !1;
3189
- })), Ut(i), i.filter(".resizable-x").append("line").attr("class", "left-resizer").attr("stroke", "transparent").attr("stroke-width", 6).on(S.MouseOver, (e, t) => {
3190
- this.canUserPerformAction(K.StretchSection) && t.getResizableX() && !t.removed && X(A.EWResize);
3342
+ })), qt(i), i.filter(".resizable-x").append("rect").attr("class", "left-resizer").on(S.MouseOver, (e, t) => {
3343
+ this.canUserPerformAction(K.StretchSection) && t.getResizableX() && !t.removed && X(k.EWResize);
3191
3344
  }).on(S.MouseOut, (e, t) => {
3192
3345
  this.canUserPerformAction(K.StretchSection) && t.getResizableX() && !t.removed && X();
3193
3346
  }).call(e.drag().on(w.Start, (e, t) => {
3194
- this.canUserPerformAction(K.StretchSection) && t.getResizableX() && !t.removed && t.node ? (X(A.EWResize), this.currentAction = new q(this, K.StretchSection, t.node.id, t.node.getGeometry(), t.node.getGeometry())) : X(A.NotAllowed);
3347
+ this.canUserPerformAction(K.StretchSection) && t.getResizableX() && !t.removed && t.node ? (X(k.EWResize), this.currentAction = new q(this, K.StretchSection, t.node.id, t.node.getGeometry(), t.node.getGeometry())) : X(k.NotAllowed);
3195
3348
  }).on(w.Drag, (e, t) => {
3196
3349
  if (this.canUserPerformAction(K.StretchSection) && t.getResizableX() && !t.removed && t.node) {
3197
3350
  let n = this.getPointerLocationRelativeToCanvas(e);
@@ -3203,46 +3356,46 @@ var ke = (e) => e == null || e === "" || e instanceof Array && e.length === 0 ||
3203
3356
  this.gridConfig.snap && (n = this.getClosestGridPoint(n)), t.node.stretchSections(p.Left, t.coords[0] - n[0], t.indexXInNode, t.indexYInNode), this.currentAction.to = t.node.getGeometry(), this.currentAction.do(), this.actionStack.add(this.currentAction), this.currentAction = void 0;
3204
3357
  }
3205
3358
  X();
3206
- })), i.filter(".resizable-y").append("line").attr("class", "top-resizer").attr("stroke", "transparent").attr("stroke-width", 6).on(S.MouseOver, (e, t) => {
3207
- this.canUserPerformAction(K.StretchSection) && t.getResizableY() && !t.removed && X(A.NSResize);
3359
+ })), i.filter(".resizable-x").append("rect").attr("class", "right-resizer").on(S.MouseOver, (e, t) => {
3360
+ this.canUserPerformAction(K.StretchSection) && t.getResizableX() && !t.removed && X(k.EWResize);
3208
3361
  }).on(S.MouseOut, (e, t) => {
3209
- this.canUserPerformAction(K.StretchSection) && t.getResizableY() && !t.removed && X();
3362
+ this.canUserPerformAction(K.StretchSection) && t.getResizableX() && !t.removed && X();
3210
3363
  }).call(e.drag().on(w.Start, (e, t) => {
3211
- this.canUserPerformAction(K.StretchSection) && t.getResizableY() && !t.removed && t.node ? (X(A.NSResize), this.currentAction = new q(this, K.StretchSection, t.node.id, t.node.getGeometry(), t.node.getGeometry())) : X(A.NotAllowed);
3364
+ this.canUserPerformAction(K.StretchSection) && t.getResizableX() && !t.removed && t.node ? (X(k.EWResize), this.currentAction = new q(this, K.StretchSection, t.node.id, t.node.getGeometry(), t.node.getGeometry())) : X(k.NotAllowed);
3212
3365
  }).on(w.Drag, (e, t) => {
3213
- if (this.canUserPerformAction(K.StretchSection) && t.getResizableY() && !t.removed && t.node) {
3366
+ if (this.canUserPerformAction(K.StretchSection) && t.getResizableX() && !t.removed && t.node) {
3214
3367
  let n = this.getPointerLocationRelativeToCanvas(e);
3215
- t.node.stretchSections(p.Top, t.coords[1] - n[1], t.indexXInNode, t.indexYInNode);
3368
+ t.node.stretchSections(p.Right, n[0] - (t.coords[0] + t.width), t.indexXInNode, t.indexYInNode);
3216
3369
  }
3217
3370
  }).on(w.End, (e, t) => {
3218
- if (this.canUserPerformAction(K.StretchSection) && t.getResizableY() && !t.removed && this.currentAction instanceof q && this.currentAction.intent === K.StretchSection && t.node) {
3371
+ if (this.canUserPerformAction(K.StretchSection) && t.getResizableX() && !t.removed && this.currentAction instanceof q && this.currentAction.intent === K.StretchSection && t.node) {
3219
3372
  let n = this.getPointerLocationRelativeToCanvas(e);
3220
- this.gridConfig.snap && (n = this.getClosestGridPoint(n)), t.node.stretchSections(p.Top, t.coords[1] - n[1], t.indexXInNode, t.indexYInNode), this.currentAction.to = t.node.getGeometry(), this.currentAction.do(), this.actionStack.add(this.currentAction), this.currentAction = void 0;
3373
+ this.gridConfig.snap && (n = this.getClosestGridPoint(n)), t.node.stretchSections(p.Right, n[0] - (t.coords[0] + t.width), t.indexXInNode, t.indexYInNode), this.currentAction.to = t.node.getGeometry(), this.currentAction.do(), this.actionStack.add(this.currentAction), this.currentAction = void 0;
3221
3374
  }
3222
3375
  X();
3223
- })), i.filter(".resizable-x").append("line").attr("class", "right-resizer").attr("stroke", "transparent").attr("stroke-width", 6).on(S.MouseOver, (e, t) => {
3224
- this.canUserPerformAction(K.StretchSection) && t.getResizableX() && !t.removed && X(A.EWResize);
3376
+ })), i.filter(".resizable-y").append("rect").attr("class", "top-resizer").on(S.MouseOver, (e, t) => {
3377
+ this.canUserPerformAction(K.StretchSection) && t.getResizableY() && !t.removed && X(k.NSResize);
3225
3378
  }).on(S.MouseOut, (e, t) => {
3226
- this.canUserPerformAction(K.StretchSection) && t.getResizableX() && !t.removed && X();
3379
+ this.canUserPerformAction(K.StretchSection) && t.getResizableY() && !t.removed && X();
3227
3380
  }).call(e.drag().on(w.Start, (e, t) => {
3228
- this.canUserPerformAction(K.StretchSection) && t.getResizableX() && !t.removed && t.node ? (X(A.EWResize), this.currentAction = new q(this, K.StretchSection, t.node.id, t.node.getGeometry(), t.node.getGeometry())) : X(A.NotAllowed);
3381
+ this.canUserPerformAction(K.StretchSection) && t.getResizableY() && !t.removed && t.node ? (X(k.NSResize), this.currentAction = new q(this, K.StretchSection, t.node.id, t.node.getGeometry(), t.node.getGeometry())) : X(k.NotAllowed);
3229
3382
  }).on(w.Drag, (e, t) => {
3230
- if (this.canUserPerformAction(K.StretchSection) && t.getResizableX() && !t.removed && t.node) {
3383
+ if (this.canUserPerformAction(K.StretchSection) && t.getResizableY() && !t.removed && t.node) {
3231
3384
  let n = this.getPointerLocationRelativeToCanvas(e);
3232
- t.node.stretchSections(p.Right, n[0] - (t.coords[0] + t.width), t.indexXInNode, t.indexYInNode);
3385
+ t.node.stretchSections(p.Top, t.coords[1] - n[1], t.indexXInNode, t.indexYInNode);
3233
3386
  }
3234
3387
  }).on(w.End, (e, t) => {
3235
- if (this.canUserPerformAction(K.StretchSection) && t.getResizableX() && !t.removed && this.currentAction instanceof q && this.currentAction.intent === K.StretchSection && t.node) {
3388
+ if (this.canUserPerformAction(K.StretchSection) && t.getResizableY() && !t.removed && this.currentAction instanceof q && this.currentAction.intent === K.StretchSection && t.node) {
3236
3389
  let n = this.getPointerLocationRelativeToCanvas(e);
3237
- this.gridConfig.snap && (n = this.getClosestGridPoint(n)), t.node.stretchSections(p.Right, n[0] - (t.coords[0] + t.width), t.indexXInNode, t.indexYInNode), this.currentAction.to = t.node.getGeometry(), this.currentAction.do(), this.actionStack.add(this.currentAction), this.currentAction = void 0;
3390
+ this.gridConfig.snap && (n = this.getClosestGridPoint(n)), t.node.stretchSections(p.Top, t.coords[1] - n[1], t.indexXInNode, t.indexYInNode), this.currentAction.to = t.node.getGeometry(), this.currentAction.do(), this.actionStack.add(this.currentAction), this.currentAction = void 0;
3238
3391
  }
3239
3392
  X();
3240
- })), i.filter(".resizable-y").append("line").attr("class", "bottom-resizer").attr("stroke", "transparent").attr("stroke-width", 6).on(S.MouseOver, (e, t) => {
3241
- this.canUserPerformAction(K.StretchSection) && t.getResizableY() && !t.removed && X(A.NSResize);
3393
+ })), i.filter(".resizable-y").append("rect").attr("class", "bottom-resizer").on(S.MouseOver, (e, t) => {
3394
+ this.canUserPerformAction(K.StretchSection) && t.getResizableY() && !t.removed && X(k.NSResize);
3242
3395
  }).on(S.MouseOut, (e, t) => {
3243
3396
  this.canUserPerformAction(K.StretchSection) && t.getResizableY() && !t.removed && X();
3244
3397
  }).call(e.drag().on(w.Start, (e, t) => {
3245
- this.canUserPerformAction(K.StretchSection) && t.getResizableY() && !t.removed && t.node ? (X(A.NSResize), this.currentAction = new q(this, K.StretchSection, t.node.id, t.node.getGeometry(), t.node.getGeometry())) : X(A.NotAllowed);
3398
+ this.canUserPerformAction(K.StretchSection) && t.getResizableY() && !t.removed && t.node ? (X(k.NSResize), this.currentAction = new q(this, K.StretchSection, t.node.id, t.node.getGeometry(), t.node.getGeometry())) : X(k.NotAllowed);
3246
3399
  }).on(w.Drag, (e, t) => {
3247
3400
  if (this.canUserPerformAction(K.StretchSection) && t.getResizableY() && !t.removed && t.node) {
3248
3401
  let n = this.getPointerLocationRelativeToCanvas(e);
@@ -3254,44 +3407,112 @@ var ke = (e) => e == null || e === "" || e instanceof Array && e.length === 0 ||
3254
3407
  this.gridConfig.snap && (n = this.getClosestGridPoint(n)), t.node.stretchSections(p.Bottom, n[1] - (t.coords[1] + t.height), t.indexXInNode, t.indexYInNode), this.currentAction.to = t.node.getGeometry(), this.currentAction.do(), this.actionStack.add(this.currentAction), this.currentAction = void 0;
3255
3408
  }
3256
3409
  X();
3257
- })), a.attr("transform", (e) => `translate(${e.coords[0]},${e.coords[1]})`).attr("opacity", (e) => e.removed ? .5 : 1), Gt(a), a.filter(".resizable-x").select("line.left-resizer").style("pointer-events", (e) => e.getResizableX() ? "initial" : "none").attr("x1", 6 / 2).attr("x2", 6 / 2).attr("y1", 0).attr("y2", (e) => e.height), a.filter(".resizable-y").select("line.top-resizer").style("pointer-events", (e) => e.getResizableY() ? "initial" : "none").attr("x1", 0).attr("x2", (e) => e.width).attr("y1", 6 / 2).attr("y2", 6 / 2), a.filter(".resizable-x").select("line.right-resizer").style("pointer-events", (e) => e.getResizableX() ? "initial" : "none").attr("x1", (e) => e.width - 6 / 2).attr("x2", (e) => e.width - 6 / 2).attr("y1", 0).attr("y2", (e) => e.height), a.filter(".resizable-y").select("line.bottom-resizer").style("pointer-events", (e) => e.getResizableY() ? "initial" : "none").attr("x1", 0).attr("x2", (e) => e.width).attr("y1", (e) => e.height - 6 / 2).attr("y2", (e) => e.height - 6 / 2);
3410
+ })), i.filter(".resizable-xy").append("rect").attr("class", "top-left-resizer").on(S.MouseOver, (e, t) => {
3411
+ this.canUserPerformAction(K.StretchSection) && t.getResizableXY() && !t.removed && X(k.NWSEResize);
3412
+ }).on(S.MouseOut, (e, t) => {
3413
+ this.canUserPerformAction(K.StretchSection) && t.getResizableXY() && !t.removed && X();
3414
+ }).call(e.drag().on(w.Start, (e, t) => {
3415
+ this.canUserPerformAction(K.StretchSection) && t.getResizableXY() && !t.removed && t.node ? (X(k.NWSEResize), this.currentAction = new q(this, K.StretchSection, t.node.id, t.node.getGeometry(), t.node.getGeometry())) : X(k.NotAllowed);
3416
+ }).on(w.Drag, (e, t) => {
3417
+ if (this.canUserPerformAction(K.StretchSection) && t.getResizableXY() && !t.removed && t.node) {
3418
+ let n = this.getPointerLocationRelativeToCanvas(e);
3419
+ t.node.stretchSections(p.Left, t.coords[0] - n[0], t.indexXInNode, t.indexYInNode), t.node.stretchSections(p.Top, t.coords[1] - n[1], t.indexXInNode, t.indexYInNode);
3420
+ }
3421
+ }).on(w.End, (e, t) => {
3422
+ if (this.canUserPerformAction(K.StretchSection) && t.getResizableXY() && !t.removed && this.currentAction instanceof q && this.currentAction.intent === K.StretchSection && t.node) {
3423
+ let n = this.getPointerLocationRelativeToCanvas(e);
3424
+ this.gridConfig.snap && (n = this.getClosestGridPoint(n)), t.node.stretchSections(p.Left, t.coords[0] - n[0], t.indexXInNode, t.indexYInNode), t.node.stretchSections(p.Top, t.coords[1] - n[1], t.indexXInNode, t.indexYInNode), this.currentAction.to = t.node.getGeometry(), this.currentAction.do(), this.actionStack.add(this.currentAction), this.currentAction = void 0;
3425
+ }
3426
+ X();
3427
+ })), i.filter(".resizable-xy").append("rect").attr("class", "top-right-resizer").on(S.MouseOver, (e, t) => {
3428
+ this.canUserPerformAction(K.StretchSection) && t.getResizableXY() && !t.removed && X(k.NESWResize);
3429
+ }).on(S.MouseOut, (e, t) => {
3430
+ this.canUserPerformAction(K.StretchSection) && t.getResizableXY() && !t.removed && X();
3431
+ }).call(e.drag().on(w.Start, (e, t) => {
3432
+ this.canUserPerformAction(K.StretchSection) && t.getResizableXY() && !t.removed && t.node ? (X(k.NESWResize), this.currentAction = new q(this, K.StretchSection, t.node.id, t.node.getGeometry(), t.node.getGeometry())) : X(k.NotAllowed);
3433
+ }).on(w.Drag, (e, t) => {
3434
+ if (this.canUserPerformAction(K.StretchSection) && t.getResizableXY() && !t.removed && t.node) {
3435
+ let n = this.getPointerLocationRelativeToCanvas(e);
3436
+ t.node.stretchSections(p.Right, n[0] - (t.coords[0] + t.width), t.indexXInNode, t.indexYInNode), t.node.stretchSections(p.Top, t.coords[1] - n[1], t.indexXInNode, t.indexYInNode);
3437
+ }
3438
+ }).on(w.End, (e, t) => {
3439
+ if (this.canUserPerformAction(K.StretchSection) && t.getResizableXY() && !t.removed && this.currentAction instanceof q && this.currentAction.intent === K.StretchSection && t.node) {
3440
+ let n = this.getPointerLocationRelativeToCanvas(e);
3441
+ this.gridConfig.snap && (n = this.getClosestGridPoint(n)), t.node.stretchSections(p.Right, n[0] - (t.coords[0] + t.width), t.indexXInNode, t.indexYInNode), t.node.stretchSections(p.Top, t.coords[1] - n[1], t.indexXInNode, t.indexYInNode), this.currentAction.to = t.node.getGeometry(), this.currentAction.do(), this.actionStack.add(this.currentAction), this.currentAction = void 0;
3442
+ }
3443
+ X();
3444
+ })), i.filter(".resizable-xy").append("rect").attr("class", "bottom-left-resizer").on(S.MouseOver, (e, t) => {
3445
+ this.canUserPerformAction(K.StretchSection) && t.getResizableXY() && !t.removed && X(k.NESWResize);
3446
+ }).on(S.MouseOut, (e, t) => {
3447
+ this.canUserPerformAction(K.StretchSection) && t.getResizableXY() && !t.removed && X();
3448
+ }).call(e.drag().on(w.Start, (e, t) => {
3449
+ this.canUserPerformAction(K.StretchSection) && t.getResizableXY() && !t.removed && t.node ? (X(k.NESWResize), this.currentAction = new q(this, K.StretchSection, t.node.id, t.node.getGeometry(), t.node.getGeometry())) : X(k.NotAllowed);
3450
+ }).on(w.Drag, (e, t) => {
3451
+ if (this.canUserPerformAction(K.StretchSection) && t.getResizableXY() && !t.removed && t.node) {
3452
+ let n = this.getPointerLocationRelativeToCanvas(e);
3453
+ t.node.stretchSections(p.Left, t.coords[0] - n[0], t.indexXInNode, t.indexYInNode), t.node.stretchSections(p.Bottom, n[1] - (t.coords[1] + t.height), t.indexXInNode, t.indexYInNode);
3454
+ }
3455
+ }).on(w.End, (e, t) => {
3456
+ if (this.canUserPerformAction(K.StretchSection) && t.getResizableXY() && !t.removed && this.currentAction instanceof q && this.currentAction.intent === K.StretchSection && t.node) {
3457
+ let n = this.getPointerLocationRelativeToCanvas(e);
3458
+ this.gridConfig.snap && (n = this.getClosestGridPoint(n)), t.node.stretchSections(p.Left, t.coords[0] - n[0], t.indexXInNode, t.indexYInNode), t.node.stretchSections(p.Bottom, n[1] - (t.coords[1] + t.height), t.indexXInNode, t.indexYInNode), this.currentAction.to = t.node.getGeometry(), this.currentAction.do(), this.actionStack.add(this.currentAction), this.currentAction = void 0;
3459
+ }
3460
+ X();
3461
+ })), i.filter(".resizable-xy").append("rect").attr("class", "bottom-right-resizer").on(S.MouseOver, (e, t) => {
3462
+ this.canUserPerformAction(K.StretchSection) && t.getResizableXY() && !t.removed && X(k.NWSEResize);
3463
+ }).on(S.MouseOut, (e, t) => {
3464
+ this.canUserPerformAction(K.StretchSection) && t.getResizableXY() && !t.removed && X();
3465
+ }).call(e.drag().on(w.Start, (e, t) => {
3466
+ this.canUserPerformAction(K.StretchSection) && t.getResizableXY() && !t.removed && t.node ? (X(k.NWSEResize), this.currentAction = new q(this, K.StretchSection, t.node.id, t.node.getGeometry(), t.node.getGeometry())) : X(k.NotAllowed);
3467
+ }).on(w.Drag, (e, t) => {
3468
+ if (this.canUserPerformAction(K.StretchSection) && t.getResizableXY() && !t.removed && t.node) {
3469
+ let n = this.getPointerLocationRelativeToCanvas(e);
3470
+ t.node.stretchSections(p.Right, n[0] - (t.coords[0] + t.width), t.indexXInNode, t.indexYInNode), t.node.stretchSections(p.Bottom, n[1] - (t.coords[1] + t.height), t.indexXInNode, t.indexYInNode);
3471
+ }
3472
+ }).on(w.End, (e, t) => {
3473
+ if (this.canUserPerformAction(K.StretchSection) && t.getResizableXY() && !t.removed && this.currentAction instanceof q && this.currentAction.intent === K.StretchSection && t.node) {
3474
+ let n = this.getPointerLocationRelativeToCanvas(e);
3475
+ this.gridConfig.snap && (n = this.getClosestGridPoint(n)), t.node.stretchSections(p.Right, n[0] - (t.coords[0] + t.width), t.indexXInNode, t.indexYInNode), t.node.stretchSections(p.Bottom, n[1] - (t.coords[1] + t.height), t.indexXInNode, t.indexYInNode), this.currentAction.to = t.node.getGeometry(), this.currentAction.do(), this.actionStack.add(this.currentAction), this.currentAction = void 0;
3476
+ }
3477
+ X();
3478
+ })), a.attr("transform", (e) => `translate(${e.coords[0]},${e.coords[1]})`).attr("opacity", (e) => e.removed ? .5 : 1), Yt(a), a.filter(".resizable-x").select("rect.left-resizer").style("pointer-events", (e) => e.getResizableX() ? "initial" : "none").attr("x", (e) => -e.getResizerX().outerMargin).attr("y", (e) => e.getResizerXY().thickness - e.getResizerXY().outerMargin).attr("width", (e) => e.getResizerX().thickness).attr("height", (e) => e.height - e.getResizerXY().thickness * 2 + e.getResizerXY().outerMargin * 2).attr("fill", (e) => e.getResizerX().getLook(e).fillColor || "transparent").attr("stroke", (e) => e.getResizerX().getLook(e).borderColor || "transparent").attr("stroke-width", (e) => e.getResizerX().getLook(e).borderThickness || 0), a.filter(".resizable-x").select("rect.right-resizer").style("pointer-events", (e) => e.getResizableX() ? "initial" : "none").attr("x", (e) => e.width - e.getResizerX().thickness + e.getResizerX().outerMargin).attr("y", (e) => e.getResizerXY().thickness - e.getResizerXY().outerMargin).attr("width", (e) => e.getResizerX().thickness).attr("height", (e) => e.height - e.getResizerXY().thickness * 2 + e.getResizerXY().outerMargin * 2).attr("fill", (e) => e.getResizerX().getLook(e).fillColor || "transparent").attr("stroke", (e) => e.getResizerX().getLook(e).borderColor || "transparent").attr("stroke-width", (e) => e.getResizerX().getLook(e).borderThickness || 0), a.filter(".resizable-y").select("rect.top-resizer").style("pointer-events", (e) => e.getResizableY() ? "initial" : "none").attr("x", (e) => e.getResizerXY().thickness - e.getResizerXY().outerMargin).attr("y", (e) => -e.getResizerY().outerMargin).attr("width", (e) => e.width - e.getResizerXY().thickness * 2 + e.getResizerXY().outerMargin * 2).attr("height", (e) => e.getResizerY().thickness).attr("fill", (e) => e.getResizerY().getLook(e).fillColor || "transparent").attr("stroke", (e) => e.getResizerY().getLook(e).borderColor || "transparent").attr("stroke-width", (e) => e.getResizerY().getLook(e).borderThickness || 0), a.filter(".resizable-y").select("rect.bottom-resizer").style("pointer-events", (e) => e.getResizableY() ? "initial" : "none").attr("x", (e) => e.getResizerXY().thickness - e.getResizerXY().outerMargin).attr("y", (e) => e.height - e.getResizerY().thickness + e.getResizerY().outerMargin).attr("width", (e) => e.width - e.getResizerXY().thickness * 2 + e.getResizerXY().outerMargin * 2).attr("height", (e) => e.getResizerY().thickness).attr("fill", (e) => e.getResizerY().getLook(e).fillColor || "transparent").attr("stroke", (e) => e.getResizerY().getLook(e).borderColor || "transparent").attr("stroke-width", (e) => e.getResizerY().getLook(e).borderThickness || 0), a.filter(".resizable-xy").select("rect.top-left-resizer").style("pointer-events", (e) => e.getResizableXY() ? "initial" : "none").attr("x", (e) => -e.getResizerXY().outerMargin).attr("y", (e) => -e.getResizerXY().outerMargin).attr("width", (e) => e.getResizerXY().thickness).attr("height", (e) => e.getResizerXY().thickness).attr("fill", (e) => e.getResizerXY().getLook(e).fillColor || "transparent").attr("stroke", (e) => e.getResizerXY().getLook(e).borderColor || "transparent").attr("stroke-width", (e) => e.getResizerXY().getLook(e).borderThickness || 0), a.filter(".resizable-xy").select("rect.top-right-resizer").style("pointer-events", (e) => e.getResizableXY() ? "initial" : "none").attr("x", (e) => e.width - e.getResizerXY().thickness + e.getResizerXY().outerMargin).attr("y", (e) => -e.getResizerXY().outerMargin).attr("width", (e) => e.getResizerXY().thickness).attr("height", (e) => e.getResizerXY().thickness).attr("fill", (e) => e.getResizerXY().getLook(e).fillColor || "transparent").attr("stroke", (e) => e.getResizerXY().getLook(e).borderColor || "transparent").attr("stroke-width", (e) => e.getResizerXY().getLook(e).borderThickness || 0), a.filter(".resizable-xy").select("rect.bottom-left-resizer").style("pointer-events", (e) => e.getResizableXY() ? "initial" : "none").attr("x", (e) => -e.getResizerXY().outerMargin).attr("y", (e) => e.height - e.getResizerXY().thickness + e.getResizerXY().outerMargin).attr("width", (e) => e.getResizerXY().thickness).attr("height", (e) => e.getResizerXY().thickness).attr("fill", (e) => e.getResizerXY().getLook(e).fillColor || "transparent").attr("stroke", (e) => e.getResizerXY().getLook(e).borderColor || "transparent").attr("stroke-width", (e) => e.getResizerXY().getLook(e).borderThickness || 0), a.filter(".resizable-xy").select("rect.bottom-right-resizer").style("pointer-events", (e) => e.getResizableXY() ? "initial" : "none").attr("x", (e) => e.width - e.getResizerXY().thickness + e.getResizerXY().outerMargin).attr("y", (e) => e.height - e.getResizerXY().thickness + e.getResizerXY().outerMargin).attr("width", (e) => e.getResizerXY().thickness).attr("height", (e) => e.getResizerXY().thickness).attr("fill", (e) => e.getResizerXY().getLook(e).fillColor || "transparent").attr("stroke", (e) => e.getResizerXY().getLook(e).borderColor || "transparent").attr("stroke-width", (e) => e.getResizerXY().getLook(e).borderThickness || 0);
3258
3479
  }
3259
3480
  updatePortsInView(...t) {
3260
3481
  let n = this.selectCanvasElements().selectAll("g.diagram-port").data(this.model.ports.filter((e) => this.priorityThreshold === void 0 ? !0 : e.getPriority() >= this.priorityThreshold), (e) => e.id), r = n.exit(), i = n.enter().append("g").attr("id", (e) => e.id).attr("class", (e) => `diagram-port ${e.look.lookType}`);
3261
3482
  t && t.length > 0 && (n = n.filter((e) => t.includes(e.id)));
3262
3483
  let a = i.merge(n);
3263
3484
  r.remove(), i.on(S.MouseOver, (e, t) => {
3264
- !this.unfinishedConnection && !this.dragging && (this.userHighlight.focusOn(t), this.diagramEvent$.next(new Y(t))), this.unfinishedConnection && (this.unfinishedConnection.type.canStartFromType(this.unfinishedConnection.start?.getNode()?.type?.id || "") && this.unfinishedConnection.start?.allowsOutgoing && this.unfinishedConnection.type.canFinishOnType(t.getNode()?.type?.id || "") && t.allowsIncoming || this.unfinishedConnection.type.canStartFromType(t.getNode()?.type?.id || "") && t.allowsOutgoing && this.unfinishedConnection.type.canFinishOnType(this.unfinishedConnection.start?.getNode()?.type?.id || "") && this.unfinishedConnection.start?.allowsIncoming || X(A.NoDrop));
3485
+ !this.unfinishedConnection && !this.dragging && (this.userHighlight.focusOn(t), this.diagramEvent$.next(new Y(t))), this.unfinishedConnection && (this.unfinishedConnection.type.canStartFromType(this.unfinishedConnection.start?.getNode()?.type?.id || "") && this.unfinishedConnection.start?.allowsOutgoing && this.unfinishedConnection.type.canFinishOnType(t.getNode()?.type?.id || "") && t.allowsIncoming || this.unfinishedConnection.type.canStartFromType(t.getNode()?.type?.id || "") && t.allowsOutgoing && this.unfinishedConnection.type.canFinishOnType(this.unfinishedConnection.start?.getNode()?.type?.id || "") && this.unfinishedConnection.start?.allowsIncoming || X(k.NoDrop));
3265
3486
  }).on(S.MouseOut, () => {
3266
- this.unfinishedConnection && X(A.Grabbing);
3487
+ this.unfinishedConnection && X(k.Grabbing);
3267
3488
  }).on(S.Click, (e, t) => {
3268
3489
  if (!e.ctrlKey && !e.shiftKey) {
3269
3490
  let e = this.userSelection.all();
3270
3491
  this.userSelection.clear(), this.diagramEvent$.next(new J(e, !1));
3271
3492
  }
3272
- let n = Bt(t);
3493
+ let n = Ut(t);
3273
3494
  this.userSelection.toggle(n), this.diagramEvent$.next(new J([n], n.selected));
3274
3495
  }).on(S.ContextMenu, (e, t) => {
3275
3496
  if (this.dragging) {
3276
3497
  e.preventDefault(), e.stopPropagation(), this.dragging = !1;
3277
3498
  return;
3278
3499
  }
3279
- let n = new Ft(e, t);
3500
+ let n = new Rt(e, t);
3280
3501
  if (this.diagramEvent$.next(n), !n.defaultPrevented && this.canUserPerformAction(K.ContextMenu)) {
3281
3502
  e.preventDefault();
3282
- let n = Bt(t);
3503
+ let n = Ut(t);
3283
3504
  this.userHighlight.focusOn(n), this.diagramEvent$.next(new Y(n)), this.userSelection.add(n), this.diagramEvent$.next(new J([n], !0)), this.contextMenu.open(e);
3284
3505
  }
3285
3506
  }).on(S.DoubleClick, (e, t) => {
3286
- let n = new Pt(e, t);
3507
+ let n = new Lt(e, t);
3287
3508
  this.diagramEvent$.next(n);
3288
- }).call(e.drag().filter((e) => (this.secondaryButton = Rt(e), !0)).on(w.Start, (e, t) => {
3289
- this.multipleSelectionOn || this.secondaryButton ? this.startMultipleSelection(e) : this.canUserPerformAction(K.AddConnection) && (this.allowSharingPorts || t.incomingConnections.filter((e) => !e.removed).length === 0 && t.outgoingConnections.filter((e) => !e.removed).length === 0) && !t.removed ? (X(A.Grabbing), this.startConnection(t), this.unfinishedConnection && (this.unfinishedConnectionTracer = this.selectCanvasElements().append("path").attr("stroke", "none").attr("fill", "none"))) : X(A.NotAllowed);
3509
+ }).call(e.drag().filter((e) => (this.secondaryButton = Vt(e), !0)).on(w.Start, (e, t) => {
3510
+ this.multipleSelectionOn || this.secondaryButton ? this.startMultipleSelection(e) : this.canUserPerformAction(K.AddConnection) && (this.allowSharingPorts || t.incomingConnections.filter((e) => !e.removed).length === 0 && t.outgoingConnections.filter((e) => !e.removed).length === 0) && !t.removed ? (X(k.Grabbing), this.startConnection(t), this.unfinishedConnection && (this.unfinishedConnectionTracer = this.selectCanvasElements().append("path").attr("stroke", "none").attr("fill", "none"))) : X(k.NotAllowed);
3290
3511
  }).on(w.Drag, (e, t) => {
3291
3512
  if (this.multipleSelectionOn || this.secondaryButton) this.continueMultipleSelection(e);
3292
3513
  else if (this.canUserPerformAction(K.AddConnection) && !t.removed && this.unfinishedConnection !== void 0) {
3293
3514
  let t = [e.x, e.y];
3294
- this.unfinishedConnectionTracer?.attr("d", zt(this.unfinishedConnection.look.shape || F.look.shape, this.unfinishedConnection.startCoords, t, this.unfinishedConnection.startDirection, this.unfinishedConnection.endDirection, this.unfinishedConnection.points, this.unfinishedConnection.type.defaultLook.thickness || F.look.thickness, this.unfinishedConnection.type.defaultStartMarkerLook?.width, this.unfinishedConnection.type.defaultEndMarkerLook?.width));
3515
+ this.unfinishedConnectionTracer?.attr("d", Ht(this.unfinishedConnection.look.shape || P.look.shape, this.unfinishedConnection.startCoords, t, this.unfinishedConnection.startDirection, this.unfinishedConnection.endDirection, this.unfinishedConnection.points, this.unfinishedConnection.type.defaultLook.thickness || P.look.thickness, this.unfinishedConnection.type.defaultStartMarkerLook?.width, this.unfinishedConnection.type.defaultEndMarkerLook?.width));
3295
3516
  let n = this.unfinishedConnectionTracer?.node();
3296
3517
  if (n) {
3297
3518
  let e = 2, t = n.getTotalLength();
@@ -3299,7 +3520,7 @@ var ke = (e) => e == null || e === "" || e instanceof Array && e.length === 0 ||
3299
3520
  let r = n.getPointAtLength(t - e);
3300
3521
  this.unfinishedConnection.endCoords = [r.x, r.y];
3301
3522
  } else this.unfinishedConnection.endCoords = t;
3302
- if (this.updateConnectionsInView(ln), this.unfinishedConnectionPort?.raise(!1), this.model.ports.length > 0) {
3523
+ if (this.updateConnectionsInView(pn), this.unfinishedConnectionPort?.raise(!1), this.model.ports.length > 0) {
3303
3524
  let t = this.getPointerLocationRelativeToCanvas(e), n = Infinity, r;
3304
3525
  for (let e of this.model.ports) {
3305
3526
  let i = e.distanceTo(t);
@@ -3314,12 +3535,12 @@ var ke = (e) => e == null || e === "" || e instanceof Array && e.length === 0 ||
3314
3535
  if (this.canUserPerformAction(K.AddConnection) && !t.removed) {
3315
3536
  this.unfinishedConnectionTracer?.remove();
3316
3537
  let t = this.userHighlight.getFocus();
3317
- if (t instanceof ct) this.finishConnection(t);
3318
- else if (t instanceof Le && t.rootElement instanceof ct) this.finishConnection(t.rootElement);
3319
- else if (t instanceof W || t instanceof H || t instanceof Le) {
3538
+ if (t instanceof dt) this.finishConnection(t);
3539
+ else if (t instanceof Le && t.rootElement instanceof dt) this.finishConnection(t.rootElement);
3540
+ else if (t instanceof W || t instanceof U || t instanceof Le) {
3320
3541
  let n;
3321
- if (t instanceof W || t instanceof H) n = t;
3322
- else if (t.rootElement instanceof W || t.rootElement instanceof H) n = t.rootElement;
3542
+ if (t instanceof W || t instanceof U) n = t;
3543
+ else if (t.rootElement instanceof W || t.rootElement instanceof U) n = t.rootElement;
3323
3544
  else {
3324
3545
  this.dropConnection();
3325
3546
  return;
@@ -3331,7 +3552,7 @@ var ke = (e) => e == null || e === "" || e instanceof Array && e.length === 0 ||
3331
3552
  X();
3332
3553
  }
3333
3554
  this.secondaryButton = !1;
3334
- })), i.filter(".image-look").append("image"), Ut(i), a.attr("transform", (e) => `translate(${e.coords[0] - e.width / 2},${e.coords[1] - e.width / 2})`).attr("opacity", (e) => e.removed ? .5 : 1), Gt(a);
3555
+ })), i.filter(".image-look").append("image"), qt(i), a.attr("transform", (e) => `translate(${e.coords[0] - e.width / 2},${e.coords[1] - e.width / 2})`).attr("opacity", (e) => e.removed ? .5 : 1), Yt(a);
3335
3556
  }
3336
3557
  updateConnectionsInView(...t) {
3337
3558
  let n = this.model.connections.filter((e) => this.priorityThreshold === void 0 ? !0 : e.getPriority() >= this.priorityThreshold);
@@ -3352,18 +3573,18 @@ var ke = (e) => e == null || e === "" || e instanceof Array && e.length === 0 ||
3352
3573
  e.preventDefault(), e.stopPropagation(), this.dragging = !1;
3353
3574
  return;
3354
3575
  }
3355
- let n = new Ft(e, t);
3576
+ let n = new Rt(e, t);
3356
3577
  this.diagramEvent$.next(n), !n.defaultPrevented && this.canUserPerformAction(K.ContextMenu) && (e.preventDefault(), this.userHighlight.focusOn(t), this.diagramEvent$.next(new Y(t)), this.userSelection.add(t), this.diagramEvent$.next(new J([t], !0)), this.contextMenu.open(e));
3357
3578
  }).on(S.DoubleClick, (e, t) => {
3358
- let n = new Pt(e, t);
3579
+ let n = new Lt(e, t);
3359
3580
  this.diagramEvent$.next(n);
3360
- }).call(e.drag().filter((e) => (this.secondaryButton = Rt(e), !0)).on(w.Start, (e) => {
3581
+ }).call(e.drag().filter((e) => (this.secondaryButton = Vt(e), !0)).on(w.Start, (e) => {
3361
3582
  this.startMultipleSelection(e);
3362
3583
  }).on(w.Drag, (e) => {
3363
3584
  this.continueMultipleSelection(e);
3364
3585
  }).on(w.End, (e) => {
3365
3586
  this.finishMultipleSelection(e);
3366
- })), a.append("path").attr("class", "diagram-connection-path"), a.append("path").attr("class", "diagram-connection-path-box"), a.append("marker").attr("id", (e) => `${e.id}-start-marker`).attr("class", "diagram-connection-start-marker").append("image").attr("preserveAspectRatio", "none"), a.append("marker").attr("id", (e) => `${e.id}-end-marker`).attr("class", "diagram-connection-end-marker").append("image").attr("preserveAspectRatio", "none"), a.append("g").attr("class", "diagram-connection-start-label"), a.select("g.diagram-connection-start-label").append("path"), a.select("g.diagram-connection-start-label").append("text").style("user-select", "none"), a.append("g").attr("class", "diagram-connection-middle-label"), a.select("g.diagram-connection-middle-label").append("path"), a.select("g.diagram-connection-middle-label").append("text").style("user-select", "none"), a.append("g").attr("class", "diagram-connection-end-label"), a.select("g.diagram-connection-end-label").append("path"), a.select("g.diagram-connection-end-label").append("text").style("user-select", "none"), o.attr("opacity", (e) => e.removed ? .5 : 1).select("path.diagram-connection-path").attr("d", (e) => zt(e.look.shape || F.look.shape, e.startCoords, e.endCoords, e.startDirection, e.endDirection, e.points, e.type.defaultLook.thickness || F.look.thickness, e.type.defaultStartMarkerLook?.width, e.type.defaultEndMarkerLook?.width)).attr("marker-start", (e) => `url(#${e.id}-start-marker)`).attr("marker-end", (e) => `url(#${e.id}-end-marker)`).attr("stroke", (e) => e.look.color || F.look.color).attr("stroke-width", (e) => e.look.thickness || F.look.thickness).attr("stroke-dasharray", (e) => re(e.look.style || F.look.style, e.type.defaultLook.thickness || F.look.thickness)).attr("fill", "none"), o.select("path.diagram-connection-path-box").attr("d", (e) => zt(e.look.shape || F.look.shape, e.startCoords, e.endCoords, e.startDirection, e.endDirection, e.points, e.type.defaultLook.thickness || F.look.thickness, e.type.defaultStartMarkerLook?.width, e.type.defaultEndMarkerLook?.width)).attr("stroke", "transparent").attr("pointer-events", "stroke").attr("stroke-width", (e) => (e.look.thickness || F.look.thickness) + 12).attr("stroke-dasharray", (e) => re(e.look.style || F.look.style, e.type.defaultLook.thickness || F.look.thickness)).attr("fill", "none"), o.data().forEach((e) => {
3587
+ })), a.append("path").attr("class", "diagram-connection-path"), a.append("path").attr("class", "diagram-connection-path-box"), a.append("marker").attr("id", (e) => `${e.id}-start-marker`).attr("class", "diagram-connection-start-marker").append("image").attr("preserveAspectRatio", "none"), a.append("marker").attr("id", (e) => `${e.id}-end-marker`).attr("class", "diagram-connection-end-marker").append("image").attr("preserveAspectRatio", "none"), a.append("g").attr("class", "diagram-connection-start-label"), a.select("g.diagram-connection-start-label").append("path"), a.select("g.diagram-connection-start-label").append("text").style("user-select", "none"), a.append("g").attr("class", "diagram-connection-middle-label"), a.select("g.diagram-connection-middle-label").append("path"), a.select("g.diagram-connection-middle-label").append("text").style("user-select", "none"), a.append("g").attr("class", "diagram-connection-end-label"), a.select("g.diagram-connection-end-label").append("path"), a.select("g.diagram-connection-end-label").append("text").style("user-select", "none"), o.attr("opacity", (e) => e.removed ? .5 : 1).select("path.diagram-connection-path").attr("d", (e) => Ht(e.look.shape || P.look.shape, e.startCoords, e.endCoords, e.startDirection, e.endDirection, e.points, e.type.defaultLook.thickness || P.look.thickness, e.type.defaultStartMarkerLook?.width, e.type.defaultEndMarkerLook?.width)).attr("marker-start", (e) => `url(#${e.id}-start-marker)`).attr("marker-end", (e) => `url(#${e.id}-end-marker)`).attr("stroke", (e) => e.look.color || P.look.color).attr("stroke-width", (e) => e.look.thickness || P.look.thickness).attr("stroke-dasharray", (e) => ie(e.look.style || P.look.style, e.type.defaultLook.thickness || P.look.thickness)).attr("fill", "none"), o.select("path.diagram-connection-path-box").attr("d", (e) => Ht(e.look.shape || P.look.shape, e.startCoords, e.endCoords, e.startDirection, e.endDirection, e.points, e.type.defaultLook.thickness || P.look.thickness, e.type.defaultStartMarkerLook?.width, e.type.defaultEndMarkerLook?.width)).attr("stroke", "transparent").attr("pointer-events", "stroke").attr("stroke-width", (e) => (e.look.thickness || P.look.thickness) + 12).attr("stroke-dasharray", (e) => ie(e.look.style || P.look.style, e.type.defaultLook.thickness || P.look.thickness)).attr("fill", "none"), o.data().forEach((e) => {
3367
3588
  this.updateConnectionLabelsInView(e), this.updateConnectionMarkersInView(e);
3368
3589
  });
3369
3590
  }
@@ -3378,39 +3599,39 @@ var ke = (e) => e == null || e === "" || e instanceof Array && e.length === 0 ||
3378
3599
  let e = this.userSelection.all();
3379
3600
  this.userSelection.clear(), this.diagramEvent$.next(new J(e, !1));
3380
3601
  }
3381
- let n = Bt(t);
3602
+ let n = Ut(t);
3382
3603
  this.userSelection.toggle(n), this.diagramEvent$.next(new J([n], n.selected));
3383
3604
  }).on(S.ContextMenu, (e, t) => {
3384
3605
  if (this.dragging) {
3385
3606
  e.preventDefault(), e.stopPropagation(), this.dragging = !1;
3386
3607
  return;
3387
3608
  }
3388
- let n = new Ft(e, t);
3609
+ let n = new Rt(e, t);
3389
3610
  if (this.diagramEvent$.next(n), !n.defaultPrevented && this.canUserPerformAction(K.ContextMenu)) {
3390
3611
  e.preventDefault();
3391
- let n = Bt(t);
3612
+ let n = Ut(t);
3392
3613
  this.userHighlight.focusOn(n), this.diagramEvent$.next(new Y(n)), this.userSelection.add(n), this.diagramEvent$.next(new J([n], !0)), this.contextMenu.open(e);
3393
3614
  }
3394
3615
  }).on(S.DoubleClick, (e, t) => {
3395
- let n = new Pt(e, t);
3396
- this.diagramEvent$.next(n), !n.defaultPrevented && this.canUserPerformAction(K.EditField) && t.editable && !t.removed && (this.currentAction = new Dt(this, t.id, t.text, ""), this.openTextInput(t.id));
3397
- }).call(e.drag().filter((e) => (this.secondaryButton = Rt(e), !0)).on(w.Start, (e, t) => {
3616
+ let n = new Lt(e, t);
3617
+ this.diagramEvent$.next(n), !n.defaultPrevented && this.canUserPerformAction(K.EditField) && t.editable && !t.removed && (this.currentAction = new At(this, t.id, t.text, ""), this.openTextInput(t.id));
3618
+ }).call(e.drag().filter((e) => (this.secondaryButton = Vt(e), !0)).on(w.Start, (e, t) => {
3398
3619
  if (this.multipleSelectionOn || this.secondaryButton) this.startMultipleSelection(e);
3399
3620
  else {
3400
3621
  let n;
3401
- t.rootElement instanceof W ? n = t.rootElement : t.rootElement instanceof H && (n = t.rootElement.node), n ? this.startMovingNode(e, n) : X(A.NotAllowed);
3622
+ t.rootElement instanceof W ? n = t.rootElement : t.rootElement instanceof U && (n = t.rootElement.node), n ? this.startMovingNode(e, n) : X(k.NotAllowed);
3402
3623
  }
3403
3624
  }).on(w.Drag, (e, t) => {
3404
3625
  if (this.multipleSelectionOn || this.secondaryButton) this.continueMultipleSelection(e);
3405
3626
  else {
3406
3627
  let n;
3407
- t.rootElement instanceof W ? n = t.rootElement : t.rootElement instanceof H && (n = t.rootElement.node), n ? this.continueMovingNode(e, n) : X(A.NotAllowed);
3628
+ t.rootElement instanceof W ? n = t.rootElement : t.rootElement instanceof U && (n = t.rootElement.node), n ? this.continueMovingNode(e, n) : X(k.NotAllowed);
3408
3629
  }
3409
3630
  }).on(w.End, (e, t) => {
3410
3631
  if (this.multipleSelectionOn || this.secondaryButton) this.finishMultipleSelection(e);
3411
3632
  else {
3412
3633
  let n;
3413
- t.rootElement instanceof W ? n = t.rootElement : t.rootElement instanceof H && (n = t.rootElement.node), n ? this.finishMovingNode(e, n) : X();
3634
+ t.rootElement instanceof W ? n = t.rootElement : t.rootElement instanceof U && (n = t.rootElement.node), n ? this.finishMovingNode(e, n) : X();
3414
3635
  }
3415
3636
  this.secondaryButton = !1;
3416
3637
  })), i.append("text").style("user-select", "none").style("font-kerning", "none").style("white-space", "nowrap"), i.append("rect"), a.attr("x", 0).attr("y", 0).attr("width", (e) => e.width).attr("height", (e) => e.height).attr("transform", (e) => `translate(${e.coords[0]},${e.coords[1]}) rotate(${e.orientation} ${e.width / 2} ${e.height / 2})`).attr("opacity", (e) => e.removed ? .5 : 1).select("text").attr("x", (e) => e.horizontalAlign === h.Center ? e.width / 2 : e.horizontalAlign === h.Right ? e.width : 0).attr("text-anchor", (e) => e.horizontalAlign === h.Center ? "middle" : e.horizontalAlign === h.Right ? "end" : "start").attr("y", (e) => e.verticalAlign === g.Center ? e.height / 2 : e.verticalAlign === g.Bottom ? e.height : 0).attr("dominant-baseline", (e) => e.verticalAlign === g.Center ? "middle" : e.verticalAlign === g.Bottom ? "auto" : "hanging").attr("font-size", (e) => e.look.fontSize || L.look.fontSize).attr("font-family", (e) => e.look.fontFamily || "'Wonder Unit Sans', sans-serif").attr("font-weight", (e) => e.look.fontWeight || L.look.fontWeight).attr("fill", (e) => e.look.fontColor || L.look.fontColor).style("font-kerning", "none").each((e) => {
@@ -3424,12 +3645,12 @@ var ke = (e) => e == null || e === "" || e instanceof Array && e.length === 0 ||
3424
3645
  e.preventDefault(), e.stopPropagation(), this.dragging = !1;
3425
3646
  return;
3426
3647
  }
3427
- let n = new Ft(e, t);
3648
+ let n = new Rt(e, t);
3428
3649
  this.diagramEvent$.next(n), !n.defaultPrevented && this.canUserPerformAction(K.ContextMenu) && (e.preventDefault(), this.contextMenu.open(e));
3429
3650
  }).on(S.DoubleClick, (e, t) => {
3430
- let n = new Pt(e, t);
3651
+ let n = new Lt(e, t);
3431
3652
  this.diagramEvent$.next(n);
3432
- }).call(e.drag().filter((e) => (this.secondaryButton = Rt(e), !0)).on(w.Start, (e) => {
3653
+ }).call(e.drag().filter((e) => (this.secondaryButton = Vt(e), !0)).on(w.Start, (e) => {
3433
3654
  (this.multipleSelectionOn || this.secondaryButton) && this.startMultipleSelection(e);
3434
3655
  }).on(w.Drag, (e) => {
3435
3656
  (this.multipleSelectionOn || this.secondaryButton) && this.continueMultipleSelection(e);
@@ -3447,7 +3668,7 @@ var ke = (e) => e == null || e === "" || e instanceof Array && e.length === 0 ||
3447
3668
  this.userSelection.clear(), this.diagramEvent$.next(new J(e, !1));
3448
3669
  }
3449
3670
  if (t.rootElement) {
3450
- let e = Bt(t.rootElement);
3671
+ let e = Ut(t.rootElement);
3451
3672
  this.userSelection.toggle(e), this.diagramEvent$.next(new J([e], e.selected));
3452
3673
  }
3453
3674
  }).on(S.ContextMenu, (e, t) => {
@@ -3455,32 +3676,32 @@ var ke = (e) => e == null || e === "" || e instanceof Array && e.length === 0 ||
3455
3676
  e.preventDefault(), e.stopPropagation(), this.dragging = !1;
3456
3677
  return;
3457
3678
  }
3458
- let n = new Ft(e, t);
3679
+ let n = new Rt(e, t);
3459
3680
  if (this.diagramEvent$.next(n), !n.defaultPrevented && this.canUserPerformAction(K.ContextMenu) && t.rootElement) {
3460
3681
  e.preventDefault();
3461
- let n = Bt(t.rootElement);
3682
+ let n = Ut(t.rootElement);
3462
3683
  this.userHighlight.focusOn(n), this.diagramEvent$.next(new Y(n)), this.userSelection.add(n), this.diagramEvent$.next(new J([n], !0)), this.contextMenu.open(e);
3463
3684
  }
3464
3685
  }).on(S.DoubleClick, (e, t) => {
3465
- let n = new Pt(e, t);
3686
+ let n = new Lt(e, t);
3466
3687
  this.diagramEvent$.next(n);
3467
- }).call(e.drag().filter((e) => (this.secondaryButton = Rt(e), !0)).on(w.Start, (e, t) => {
3688
+ }).call(e.drag().filter((e) => (this.secondaryButton = Vt(e), !0)).on(w.Start, (e, t) => {
3468
3689
  if (this.multipleSelectionOn || this.secondaryButton) this.startMultipleSelection(e);
3469
3690
  else {
3470
3691
  let n;
3471
- t.rootElement instanceof W ? n = t.rootElement : t.rootElement instanceof H && (n = t.rootElement.node), n ? this.startMovingNode(e, n) : X(A.NotAllowed);
3692
+ t.rootElement instanceof W ? n = t.rootElement : t.rootElement instanceof U && (n = t.rootElement.node), n ? this.startMovingNode(e, n) : X(k.NotAllowed);
3472
3693
  }
3473
3694
  }).on(w.Drag, (e, t) => {
3474
3695
  if (this.multipleSelectionOn || this.secondaryButton) this.continueMultipleSelection(e);
3475
3696
  else {
3476
3697
  let n;
3477
- t.rootElement instanceof W ? n = t.rootElement : t.rootElement instanceof H && (n = t.rootElement.node), n ? this.continueMovingNode(e, n) : X(A.NotAllowed);
3698
+ t.rootElement instanceof W ? n = t.rootElement : t.rootElement instanceof U && (n = t.rootElement.node), n ? this.continueMovingNode(e, n) : X(k.NotAllowed);
3478
3699
  }
3479
3700
  }).on(w.End, (e, t) => {
3480
3701
  if (this.multipleSelectionOn || this.secondaryButton) this.finishMultipleSelection(e);
3481
3702
  else {
3482
3703
  let n;
3483
- t.rootElement instanceof W ? n = t.rootElement : t.rootElement instanceof H && (n = t.rootElement.node), n ? this.finishMovingNode(e, n) : X();
3704
+ t.rootElement instanceof W ? n = t.rootElement : t.rootElement instanceof U && (n = t.rootElement.node), n ? this.finishMovingNode(e, n) : X();
3484
3705
  }
3485
3706
  this.secondaryButton = !1;
3486
3707
  }));
@@ -3548,13 +3769,13 @@ var ke = (e) => e == null || e === "" || e instanceof Array && e.length === 0 ||
3548
3769
  break;
3549
3770
  default: c = n.getPointAtLength(Math.max(z(r) + i / 2, B(r) + i / 2, V(r) + s / 2, R(r) + s / 2));
3550
3771
  }
3551
- t.select("g.diagram-connection-start-label path").attr("d", de(-i / 2, -s / 2, i, s)).attr("fill", r.look.fillColor || L.look.fillColor).attr("stroke", "none"), t.select("g.diagram-connection-start-label").attr("transform", `translate(${c.x + a * i},${c.y + o * s})`);
3772
+ t.select("g.diagram-connection-start-label path").attr("d", fe(-i / 2, -s / 2, i, s)).attr("fill", r.look.fillColor || L.look.fillColor).attr("stroke", "none"), t.select("g.diagram-connection-start-label").attr("transform", `translate(${c.x + a * i},${c.y + o * s})`);
3552
3773
  }
3553
3774
  t.select("g.diagram-connection-middle-label text").attr("x", 0).attr("y", (r.look.fontSize || L.look.fontSize) / 3).attr("text-anchor", "middle").attr("font-family", r.look.fontFamily || L.look.fontFamily).attr("font-size", r.look.fontSize || L.look.fontSize).attr("fill", r.look.fontColor || L.look.fillColor).style("font-kerning", "none").text(e.middleLabel);
3554
3775
  let f = t.select("g.diagram-connection-middle-label text").node()?.getBoundingClientRect();
3555
3776
  if (f) {
3556
3777
  let a = e.middleLabel ? f.width / this.zoomTransform.k + Be(r) + Ve(r) : 0, o = e.middleLabel ? f.height / this.zoomTransform.k + He(r) + ze(r) : 0, l = n.getPointAtLength(i / 2);
3557
- t.select("g.diagram-connection-middle-label path").attr("d", de(-a / 2, -o / 2, a, o)).attr("fill", r.look.fillColor || L.look.fillColor).attr("stroke", "none"), t.select("g.diagram-connection-middle-label").attr("transform", `translate(${l.x + s * a},${l.y + c * o})`);
3778
+ t.select("g.diagram-connection-middle-label path").attr("d", fe(-a / 2, -o / 2, a, o)).attr("fill", r.look.fillColor || L.look.fillColor).attr("stroke", "none"), t.select("g.diagram-connection-middle-label").attr("transform", `translate(${l.x + s * a},${l.y + c * o})`);
3558
3779
  }
3559
3780
  t.select("g.diagram-connection-end-label text").attr("x", 0).attr("y", (r.look.fontSize || L.look.fontSize) / 3).attr("text-anchor", "middle").attr("font-family", r.look.fontFamily || L.look.fontFamily).attr("font-size", r.look.fontSize || L.look.fontSize).attr("fill", r.look.fontColor || L.look.fontColor).style("font-kerning", "none").text(e.endLabel);
3560
3781
  let m = t.select("g.diagram-connection-end-label text").node()?.getBoundingClientRect();
@@ -3575,7 +3796,7 @@ var ke = (e) => e == null || e === "" || e instanceof Array && e.length === 0 ||
3575
3796
  break;
3576
3797
  default: s = n.getPointAtLength(i - Math.max(z(r) + a / 2, B(r) + a / 2, V(r) + o / 2, R(r) + o / 2));
3577
3798
  }
3578
- t.select("g.diagram-connection-end-label path").attr("d", de(-a / 2, -o / 2, a, o)).attr("fill", r.look.fillColor || L.look.fillColor).attr("stroke", "none"), t.select("g.diagram-connection-end-label").attr("transform", `translate(${s.x + l * a},${s.y + u * o})`);
3799
+ t.select("g.diagram-connection-end-label path").attr("d", fe(-a / 2, -o / 2, a, o)).attr("fill", r.look.fillColor || L.look.fillColor).attr("stroke", "none"), t.select("g.diagram-connection-end-label").attr("transform", `translate(${s.x + l * a},${s.y + u * o})`);
3579
3800
  }
3580
3801
  }
3581
3802
  }
@@ -3586,7 +3807,7 @@ var ke = (e) => e == null || e === "" || e instanceof Array && e.length === 0 ||
3586
3807
  fieldRootFitsInView(e) {
3587
3808
  let t = this.model.fields.get(e);
3588
3809
  if (!t) return !1;
3589
- if (t.rootElement instanceof W || t.rootElement instanceof H) {
3810
+ if (t.rootElement instanceof W || t.rootElement instanceof U) {
3590
3811
  let e = this.minimumSizeOfField(t), n = e[0] + z(t.rootElement.type?.label) + B(t.rootElement.type?.label) - t.rootElement.width, r = e[1] + V(t.rootElement.type?.label) + R(t.rootElement.type?.label) - t.rootElement.height;
3591
3812
  return n <= 0 && r <= 0;
3592
3813
  }
@@ -3599,7 +3820,7 @@ var ke = (e) => e == null || e === "" || e instanceof Array && e.length === 0 ||
3599
3820
  let e = this.minimumSizeOfField(n), r = e[0] + z(n.rootElement.type.label) + B(n.rootElement.type.label) - n.rootElement.width, i = e[1] + V(n.rootElement.type.label) + R(n.rootElement.type.label) - n.rootElement.height, a = Z(this.gridConfig), o = Q(this.gridConfig);
3600
3821
  this.gridConfig.snap && a !== 0 && (r = Math.ceil(r / a) * a), this.gridConfig.snap && o !== 0 && (i = Math.ceil(i / o) * o), n.rootElement.width + r < n.rootElement.type.minWidth && (r = n.rootElement.type.minWidth - n.rootElement.width), n.rootElement.height + i < n.rootElement.type.minHeight && (i = n.rootElement.type.minHeight - n.rootElement.height), (t !== !1 || r > 0) && n.rootElement.stretch(p.Right, r), (t !== !1 || i > 0) && n.rootElement.stretch(p.Bottom, i);
3601
3822
  }
3602
- if (n.rootElement instanceof H) {
3823
+ if (n.rootElement instanceof U) {
3603
3824
  let e = this.minimumSizeOfField(n), r = e[0], i = e[1];
3604
3825
  for (let e of n.rootElement.node?.sections || []) e.label && (e.indexXInNode === n.rootElement.indexXInNode && e.indexYInNode !== n.rootElement.indexYInNode ? r = Math.max(r, this.minimumSizeOfField(e.label)[0]) : e.indexXInNode !== n.rootElement.indexXInNode && e.indexYInNode === n.rootElement.indexYInNode && (i = Math.max(i, this.minimumSizeOfField(e.label)[1])));
3605
3826
  e[0] < r && (e[0] = r), e[1] < i && (e[1] = i);
@@ -3633,10 +3854,10 @@ var ke = (e) => e == null || e === "" || e instanceof Array && e.length === 0 ||
3633
3854
  }
3634
3855
  startConnection(e) {
3635
3856
  if (e.allowsOutgoing || e.allowsIncoming) {
3636
- if (this.connectionType && (this.connectionType.canStartFromType(e.getNode()?.type?.id || "") && e.allowsOutgoing || this.connectionType.canFinishOnType(e.getNode()?.type?.id || "") && e.allowsIncoming)) this.unfinishedConnection = new I(this.model, this.connectionType, e, void 0, ln), this.unfinishedConnectionPort = e;
3857
+ if (this.connectionType && (this.connectionType.canStartFromType(e.getNode()?.type?.id || "") && e.allowsOutgoing || this.connectionType.canFinishOnType(e.getNode()?.type?.id || "") && e.allowsIncoming)) this.unfinishedConnection = new F(this.model, this.connectionType, e, void 0, pn), this.unfinishedConnectionPort = e;
3637
3858
  else if (this.inferConnectionType) {
3638
3859
  let t = this.model.connections.types.all().find((t) => e.allowsOutgoing && t.canStartFromType(e.getNode()?.type?.id || ""));
3639
- t === void 0 && (t = this.model.connections.types.all().find((t) => e.allowsIncoming && t.canFinishOnType(e.getNode()?.type?.id || ""))), t !== void 0 && (this.unfinishedConnection = new I(this.model, t, e, void 0, ln), this.unfinishedConnectionPort = e);
3860
+ t === void 0 && (t = this.model.connections.types.all().find((t) => e.allowsIncoming && t.canFinishOnType(e.getNode()?.type?.id || ""))), t !== void 0 && (this.unfinishedConnection = new F(this.model, t, e, void 0, pn), this.unfinishedConnectionPort = e);
3640
3861
  }
3641
3862
  }
3642
3863
  }
@@ -3655,15 +3876,15 @@ var ke = (e) => e == null || e === "" || e instanceof Array && e.length === 0 ||
3655
3876
  return;
3656
3877
  }
3657
3878
  if (this.unfinishedConnection.type.canStartFromType(this.unfinishedConnection?.start?.getNode()?.type?.id || "") && this.unfinishedConnection?.start?.allowsOutgoing && this.unfinishedConnection.type.canFinishOnType(e.getNode()?.type?.id || "") && e.allowsIncoming) {
3658
- let t = new Et(this, this.unfinishedConnection.type, this.unfinishedConnection.start?.id, e.id);
3879
+ let t = new kt(this, this.unfinishedConnection.type, this.unfinishedConnection.start?.id, e.id);
3659
3880
  this.dropConnection(), t.do(), this.actionStack.add(t);
3660
3881
  } else if (this.unfinishedConnection.type.canFinishOnType(this.unfinishedConnection?.start?.getNode()?.type?.id || "") && this.unfinishedConnection?.start?.allowsIncoming && this.unfinishedConnection.type.canStartFromType(e.getNode()?.type?.id || "") && e.allowsOutgoing) {
3661
- let t = new Et(this, this.unfinishedConnection.type, e.id, this.unfinishedConnection.start?.id);
3882
+ let t = new kt(this, this.unfinishedConnection.type, e.id, this.unfinishedConnection.start?.id);
3662
3883
  this.dropConnection(), t.do(), this.actionStack.add(t);
3663
3884
  } else if (this.inferConnectionType) {
3664
3885
  let t = this.model.connections.types.all().find((t) => t.canStartFromType(this.unfinishedConnection?.start?.getNode()?.type?.id || "") && this.unfinishedConnection?.start?.allowsOutgoing && t.canFinishOnType(e.getNode()?.type?.id || "") && e.allowsIncoming), n = !1;
3665
3886
  if (t === void 0 && (t = this.model.connections.types.all().find((t) => t.canFinishOnType(this.unfinishedConnection?.start?.getNode()?.type?.id || "") && this.unfinishedConnection?.start?.allowsIncoming && t.canStartFromType(e.getNode()?.type?.id || "") && e.allowsOutgoing), n = !0), t !== void 0) {
3666
- let r = new Et(this, t, n ? e.id : this.unfinishedConnection.start?.id, n ? this.unfinishedConnection.start?.id : e.id);
3887
+ let r = new kt(this, t, n ? e.id : this.unfinishedConnection.start?.id, n ? this.unfinishedConnection.start?.id : e.id);
3667
3888
  this.dropConnection(), r.do(), this.actionStack.add(r);
3668
3889
  } else this.dropConnection();
3669
3890
  } else this.dropConnection();
@@ -3681,7 +3902,7 @@ var ke = (e) => e == null || e === "" || e instanceof Array && e.length === 0 ||
3681
3902
  openTextInput(e) {
3682
3903
  let t = this.model.fields.get(e);
3683
3904
  t && this.createInputField(t.text, t.coords, t.width, t.height, t.look.fontSize || L.look.fontSize, t.look.fontFamily || L.look.fontFamily, t.orientation, t.multiline, () => {}, (e) => {
3684
- t.text = e, this.currentAction instanceof Dt && (this.currentAction.to = e, this.currentAction.do(), this.actionStack.add(this.currentAction), this.currentAction = void 0);
3905
+ t.text = e, this.currentAction instanceof At && (this.currentAction.to = e, this.currentAction.do(), this.actionStack.add(this.currentAction), this.currentAction = void 0);
3685
3906
  });
3686
3907
  }
3687
3908
  createInputField(e, t, n, r, i, a, o, s, c, l) {
@@ -3698,7 +3919,7 @@ var ke = (e) => e == null || e === "" || e instanceof Array && e.length === 0 ||
3698
3919
  e.stopPropagation();
3699
3920
  }).on(S.Input, () => {
3700
3921
  let e = d.property("value");
3701
- d.attr("cols", ge(e) + 1), d.attr("rows", _e(e) + 1), d.style("width", ""), d.style("height", ""), f = d.property("scrollWidth") + 1, p = d.property("scrollHeight") + 1;
3922
+ d.attr("cols", _e(e) + 1), d.attr("rows", ve(e) + 1), d.style("width", ""), d.style("height", ""), f = d.property("scrollWidth") + 1, p = d.property("scrollHeight") + 1;
3702
3923
  let t = Math.max(f, n), i = Math.max(p, r);
3703
3924
  u?.attr("width", `${t}px`), d.style("width", `${t}px`), u?.attr("height", `${i}px`), d.style("height", `${i}px`), c && c(e);
3704
3925
  }).on(S.Click, (e) => {
@@ -3737,30 +3958,30 @@ var ke = (e) => e == null || e === "" || e instanceof Array && e.length === 0 ||
3737
3958
  for (let n = 0; n < r.length; ++n) t.append("tspan").attr("x", e.horizontalAlign === h.Center ? e.width / 2 : e.horizontalAlign === h.Right ? e.width : 0).attr("y", e.verticalAlign === g.Center ? (n + .5 - r.length / 2) * (e.look.fontSize || L.look.fontSize) + e.height / 2 : e.verticalAlign === g.Bottom ? e.height - (r.length - n - 1) * (e.look.fontSize || L.look.fontSize) : n * (e.look.fontSize || L.look.fontSize)).text(r[n]);
3738
3959
  }
3739
3960
  startMovingNode(e, t) {
3740
- if (this.canUserPerformAction(K.MoveNode) && !t.removed) if (X(A.Grabbing), this.draggingFrom = [e.x, e.y], t.selected && this.userSelection.count((e) => e instanceof W) > 1) this.currentAction = new wt(this, this.userSelection.filter((e) => e instanceof W).map((e) => e.id), t.coords);
3961
+ if (this.canUserPerformAction(K.MoveNode) && !t.removed) if (X(k.Grabbing), this.draggingFrom = [e.x, e.y], t.selected && this.userSelection.count((e) => e instanceof W) > 1) this.currentAction = new Dt(this, this.userSelection.filter((e) => e instanceof W).map((e) => e.id), t.coords);
3741
3962
  else {
3742
3963
  let e = t.getLastAncestor();
3743
3964
  this.currentAction = new q(this, K.MoveNode, t.id, t.getGeometry(), t.getGeometry(), e?.id, e?.getGeometry(t.id), e?.getGeometry(t.id));
3744
3965
  }
3745
- else X(A.NotAllowed);
3966
+ else X(k.NotAllowed);
3746
3967
  }
3747
3968
  continueMovingNode(e, t) {
3748
- if (this.canUserPerformAction(K.MoveNode) && (this.currentAction instanceof wt || this.currentAction instanceof q) && !t.removed) {
3969
+ if (this.canUserPerformAction(K.MoveNode) && (this.currentAction instanceof Dt || this.currentAction instanceof q) && !t.removed) {
3749
3970
  let n = [e.x - t.width / 2, e.y - t.height / 2];
3750
- t.selected ? this.userSelection.move([n[0] - t.coords[0], n[1] - t.coords[1]]) : t.move(n), this.userHighlight.clear(), this.dragging = !0, this.diagramEvent$.next(new It(t));
3971
+ t.selected ? this.userSelection.move([n[0] - t.coords[0], n[1] - t.coords[1]]) : t.move(n), this.userHighlight.clear(), this.dragging = !0, this.diagramEvent$.next(new zt(t));
3751
3972
  }
3752
3973
  }
3753
3974
  finishMovingNode(e, t) {
3754
3975
  if (this.canUserPerformAction(K.MoveNode) && !t.removed && (this.draggingFrom[0] !== e.x || this.draggingFrom[1] !== e.y)) {
3755
3976
  let n = [e.x - t.width / 2, e.y - t.height / 2];
3756
- if (this.gridConfig?.snap && (n = this.getClosestGridPoint([n[0] - t.type.snapToGridOffset[0], n[1] - t.type.snapToGridOffset[1]]), n[0] += t.type.snapToGridOffset[0], n[1] += t.type.snapToGridOffset[1]), this.currentAction instanceof wt) {
3977
+ if (this.gridConfig?.snap && (n = this.getClosestGridPoint([n[0] - t.type.snapToGridOffset[0], n[1] - t.type.snapToGridOffset[1]]), n[0] += t.type.snapToGridOffset[0], n[1] += t.type.snapToGridOffset[1]), this.currentAction instanceof Dt) {
3757
3978
  let e = this.currentAction.delta;
3758
3979
  this.currentAction.delta = [n[0] - e[0], n[1] - e[1]], t.selected ? this.userSelection.move([e[0] - t.coords[0], e[1] - t.coords[1]]) : t.move(e);
3759
3980
  } else if (this.currentAction instanceof q) {
3760
3981
  t.move(n);
3761
- let r = Ye(this.model.nodes.getAtCoordinates(e.x, e.y).filter((e) => e.id !== t.id && !e.isDescendantOf(t)).filter((e) => e.type.childrenTypes.includes(t.type.id))), i = r[r.length - 1];
3982
+ let r = Qe(this.model.nodes.getAtCoordinates(e.x, e.y).filter((e) => e.id !== t.id && !e.isDescendantOf(t)).filter((e) => e.type.childrenTypes.includes(t.type.id))), i = r[r.length - 1];
3762
3983
  if (i !== t.parent && (t.type.canBeParentless || i !== void 0)) {
3763
- let e = i?.getLastAncestor(), n = this.currentAction.from, r = new Tt(this, t.id, t.parent?.id, i?.id, n, t.getGeometry(), e?.id, e?.getGeometry(t.id), e?.getGeometry(t.id));
3984
+ let e = i?.getLastAncestor(), n = this.currentAction.from, r = new Ot(this, t.id, t.parent?.id, i?.id, n, t.getGeometry(), e?.id, e?.getGeometry(t.id), e?.getGeometry(t.id));
3764
3985
  t.parent?.removeChild(t), i !== void 0 && i.addChild(t), r.toChildGeometry = t.getGeometry(t.id), r.toAncestorGeometry = e?.getGeometry(t.id), this.currentAction = r;
3765
3986
  } else {
3766
3987
  let e = t?.getLastAncestor();
@@ -3776,7 +3997,7 @@ var ke = (e) => e == null || e === "" || e instanceof Array && e.length === 0 ||
3776
3997
  }
3777
3998
  continueMultipleSelection(e) {
3778
3999
  let t = this.getPointerLocationRelativeToCanvas(e);
3779
- (this.draggingFrom[0] !== t[0] || this.draggingFrom[1] !== t[1]) && (X(A.Crosshair), this.multipleSelectionContainer?.attr("x", Math.min(this.draggingFrom[0], t[0]) * this.zoomTransform.k + this.zoomTransform.x)?.attr("y", Math.min(this.draggingFrom[1], t[1]) * this.zoomTransform.k + this.zoomTransform.y)?.attr("width", Math.abs(this.draggingFrom[0] - t[0]) * this.zoomTransform.k)?.attr("height", Math.abs(this.draggingFrom[1] - t[1]) * this.zoomTransform.k), this.dragging = !0);
4000
+ (this.draggingFrom[0] !== t[0] || this.draggingFrom[1] !== t[1]) && (X(k.Crosshair), this.multipleSelectionContainer?.attr("x", Math.min(this.draggingFrom[0], t[0]) * this.zoomTransform.k + this.zoomTransform.x)?.attr("y", Math.min(this.draggingFrom[1], t[1]) * this.zoomTransform.k + this.zoomTransform.y)?.attr("width", Math.abs(this.draggingFrom[0] - t[0]) * this.zoomTransform.k)?.attr("height", Math.abs(this.draggingFrom[1] - t[1]) * this.zoomTransform.k), this.dragging = !0);
3780
4001
  }
3781
4002
  finishMultipleSelection(e) {
3782
4003
  let t = this.getPointerLocationRelativeToCanvas(e);
@@ -3784,7 +4005,7 @@ var ke = (e) => e == null || e === "" || e instanceof Array && e.length === 0 ||
3784
4005
  for (let e of this.model.nodes) ee([e.coords, [e.coords[0] + e.width, e.coords[1] + e.height]], [this.draggingFrom, t]) && this.userSelection.add(e);
3785
4006
  this.multipleSelectionOn = !1, this.diagramEvent$.next(new J(this.userSelection.all(), !0)), X();
3786
4007
  }
3787
- }, dn = class {
4008
+ }, hn = class {
3788
4009
  constructor() {
3789
4010
  this.grid = [[void 0]], this.offsetX = 0, this.offsetY = 0;
3790
4011
  }
@@ -3842,14 +4063,14 @@ var ke = (e) => e == null || e === "" || e instanceof Array && e.length === 0 ||
3842
4063
  for (let e = t[1]; e !== i[1] + r; e += r) if (t[1] = e, this.get(t) === void 0) return t;
3843
4064
  }
3844
4065
  }
3845
- }, fn = class {
4066
+ }, gn = class {
3846
4067
  constructor(e) {
3847
4068
  this.gapSize = e;
3848
4069
  }
3849
4070
  apply(e) {
3850
4071
  if (e.nodes.length === 0) return e;
3851
- let t = new dn(), n = e.nodes.filter((e) => !e.parent);
3852
- for (; n.length > 0;) pn(n[0], t, [0, 0], n);
4072
+ let t = new hn(), n = e.nodes.filter((e) => !e.parent);
4073
+ for (; n.length > 0;) _n(n[0], t, [0, 0], n);
3853
4074
  let r = Math.max(...e.nodes.map((e) => e.width)), i = Math.max(...e.nodes.map((e) => e.height)), a = this.gapSize === void 0 ? e.canvas?.gridConfig ? Z(e.canvas?.gridConfig) * 2 : 0 : this.gapSize, o = this.gapSize === void 0 ? e.canvas?.gridConfig ? Q(e.canvas?.gridConfig) * 2 : 0 : this.gapSize;
3854
4075
  for (let e = t.minY(); e <= t.maxY(); ++e) for (let n = t.minX(); n <= t.maxX(); ++n) {
3855
4076
  let s = t.get([n, e]);
@@ -3857,21 +4078,21 @@ var ke = (e) => e == null || e === "" || e instanceof Array && e.length === 0 ||
3857
4078
  }
3858
4079
  return e;
3859
4080
  }
3860
- }, pn = (e, t, n, r) => {
4081
+ }, _n = (e, t, n, r) => {
3861
4082
  let i = t.getClosestEmptyCoordinate(n);
3862
- t.set(i, e), k(r, e);
3863
- for (let n of e.getAdjacentNodes()) r.includes(n) && pn(n, t, i, r);
3864
- }, mn = class {
4083
+ t.set(i, e), O(r, e);
4084
+ for (let n of e.getAdjacentNodes()) r.includes(n) && _n(n, t, i, r);
4085
+ }, vn = class {
3865
4086
  constructor(e) {
3866
4087
  this.gapSize = e;
3867
4088
  }
3868
4089
  apply(e) {
3869
4090
  if (e.nodes.length === 0) return e;
3870
- let t = new dn(), n = e.nodes.filter((e) => !e.parent), r = {}, i = n[0], a = [i];
4091
+ let t = new hn(), n = e.nodes.filter((e) => !e.parent), r = {}, i = n[0], a = [i];
3871
4092
  for (r[i.id] = [0, 0]; n.length > 0;) {
3872
4093
  let e = [];
3873
4094
  for (let i of a) {
3874
- t.set(t.getClosestEmptyCoordinate(r[i.id]), i), k(n, i);
4095
+ t.set(t.getClosestEmptyCoordinate(r[i.id]), i), O(n, i);
3875
4096
  let a = i.getAdjacentNodes();
3876
4097
  for (let t of a) n.includes(t) && (e.push(t), r[t.id] = r[i.id]);
3877
4098
  }
@@ -3888,20 +4109,20 @@ var ke = (e) => e == null || e === "" || e instanceof Array && e.length === 0 ||
3888
4109
  }
3889
4110
  return e;
3890
4111
  }
3891
- }, hn = class {
4112
+ }, yn = class {
3892
4113
  constructor(e) {
3893
4114
  this.gapSize = e;
3894
4115
  }
3895
4116
  apply(e) {
3896
4117
  if (e.nodes.length === 0) return e;
3897
4118
  let t = this.gapSize === void 0 ? e.canvas?.gridConfig ? Z(e.canvas?.gridConfig) * 2 : 0 : this.gapSize, n = this.gapSize === void 0 ? e.canvas?.gridConfig ? Q(e.canvas?.gridConfig) * 2 : 0 : this.gapSize, r = e.nodes.filter((e) => !e.parent), i = r[0];
3898
- k(r, i);
4119
+ O(r, i);
3899
4120
  let a = [[i]];
3900
4121
  for (; r.length > 0;) {
3901
4122
  let e = a[a.length - 1], t = [];
3902
4123
  for (let n of e) {
3903
4124
  let e = n.getAdjacentNodes();
3904
- for (let n of e) r.includes(n) && (k(r, n), t.push(n));
4125
+ for (let n of e) r.includes(n) && (O(r, n), t.push(n));
3905
4126
  }
3906
4127
  t.length > 0 ? a.push(t) : (a.push(r), r = []);
3907
4128
  }
@@ -3915,13 +4136,13 @@ var ke = (e) => e == null || e === "" || e instanceof Array && e.length === 0 ||
3915
4136
  for (let t of e.connections) t.tighten();
3916
4137
  return e;
3917
4138
  }
3918
- }, gn = class {
4139
+ }, bn = class {
3919
4140
  constructor(e) {
3920
4141
  this.gapSize = e;
3921
4142
  }
3922
4143
  apply(e) {
3923
4144
  if (e.nodes.length === 0) return e;
3924
- new hn(this.gapSize).apply(e);
4145
+ new yn(this.gapSize).apply(e);
3925
4146
  let t = this.gapSize === void 0 ? e.canvas?.gridConfig ? Z(e.canvas?.gridConfig) * 2 : 0 : this.gapSize, n = this.gapSize === void 0 ? e.canvas?.gridConfig ? Q(e.canvas?.gridConfig) * 2 : 0 : this.gapSize, r = Math.max(t, n), i = .1, a = .5, o = .002, s = 100;
3926
4147
  for (; s > 1;) {
3927
4148
  s *= .99;
@@ -3947,7 +4168,7 @@ var ke = (e) => e == null || e === "" || e instanceof Array && e.length === 0 ||
3947
4168
  for (let t of e.connections) t.tighten();
3948
4169
  return e;
3949
4170
  }
3950
- }, _n = class {
4171
+ }, xn = class {
3951
4172
  constructor(e) {
3952
4173
  this.gapSize = e;
3953
4174
  }
@@ -3959,14 +4180,14 @@ var ke = (e) => e == null || e === "" || e instanceof Array && e.length === 0 ||
3959
4180
  for (let e of n) e.move([r, 0]), r += e.width + t;
3960
4181
  return e;
3961
4182
  }
3962
- }, vn = class {
4183
+ }, Sn = class {
3963
4184
  constructor(e) {
3964
4185
  this.gapSize = e;
3965
4186
  }
3966
4187
  apply(e) {
3967
4188
  if (e.nodes.length === 0) return e;
3968
4189
  let t = Math.max(...e.nodes.map((e) => e.getPriority()));
3969
- if (t === Math.min(...e.nodes.map((e) => e.getPriority()))) return new hn(this.gapSize).apply(e), e;
4190
+ if (t === Math.min(...e.nodes.map((e) => e.getPriority()))) return new yn(this.gapSize).apply(e), e;
3970
4191
  let n = this.gapSize === void 0 ? e.canvas?.gridConfig ? Z(e.canvas?.gridConfig) * 2 : 0 : this.gapSize, r = this.gapSize === void 0 ? e.canvas?.gridConfig ? Q(e.canvas?.gridConfig) * 2 : 0 : this.gapSize, i = e.nodes.filter((e) => !e.parent), a = [], o = e.nodes.filter((e) => !e.parent).filter((e) => e.getPriority() >= t), s = [];
3971
4192
  if (o.length > 1) {
3972
4193
  let e = o[0];
@@ -3974,13 +4195,13 @@ var ke = (e) => e == null || e === "" || e instanceof Array && e.length === 0 ||
3974
4195
  let t = [e], n = [e];
3975
4196
  for (; t.length > 0;) {
3976
4197
  let e = t[0];
3977
- t.splice(0, 1), o.includes(e) && (s.push(e), k(o, e));
4198
+ t.splice(0, 1), o.includes(e) && (s.push(e), O(o, e));
3978
4199
  let r = e.getAdjacentNodes();
3979
4200
  for (let e of r) n.includes(e) || (t.push(e), n.push(e));
3980
4201
  }
3981
4202
  for (let e of o) s.push(e);
3982
4203
  } else s.push(o[0]);
3983
- for (let e of s) k(i, e), a.push([e]);
4204
+ for (let e of s) O(i, e), a.push([e]);
3984
4205
  for (a.push([]), i.sort((e, t) => t.type.priority - e.type.priority); i.length > 0;) {
3985
4206
  let e = i[0];
3986
4207
  i.splice(0, 1);
@@ -4012,22 +4233,22 @@ var ke = (e) => e == null || e === "" || e instanceof Array && e.length === 0 ||
4012
4233
  for (let t of e.connections) t.tighten();
4013
4234
  return e;
4014
4235
  }
4015
- }, yn = class {
4236
+ }, Cn = class {
4016
4237
  constructor(e) {
4017
4238
  this.gapSize = e;
4018
4239
  }
4019
4240
  apply(e) {
4020
4241
  if (e.nodes.length === 0) return e;
4021
- if (Math.max(...e.nodes.map((e) => e.getPriority())) === Math.min(...e.nodes.map((e) => e.getPriority()))) return new hn(this.gapSize).apply(e), e;
4242
+ if (Math.max(...e.nodes.map((e) => e.getPriority())) === Math.min(...e.nodes.map((e) => e.getPriority()))) return new yn(this.gapSize).apply(e), e;
4022
4243
  let t = this.gapSize === void 0 ? e.canvas?.gridConfig ? Z(e.canvas?.gridConfig) * 2 : 0 : this.gapSize, n = this.gapSize === void 0 ? e.canvas?.gridConfig ? Q(e.canvas?.gridConfig) * 2 : 0 : this.gapSize, r = e.nodes.filter((e) => !e.parent).sort((e, t) => t.getPriority() - e.getPriority()), i = [];
4023
4244
  for (; r.length > 0;) {
4024
4245
  let e = r[0];
4025
4246
  r.splice(0, 1);
4026
- let t = new Sn(void 0, e);
4027
- bn(t, r), i.push(t);
4247
+ let t = new En(void 0, e);
4248
+ wn(t, r), i.push(t);
4028
4249
  }
4029
4250
  let a = [];
4030
- for (let e of i) a.push([e]), xn(e, a, a.length);
4251
+ for (let e of i) a.push([e]), Tn(e, a, a.length);
4031
4252
  let o = Math.max(...e.nodes.map((e) => e.height)), s = 0;
4032
4253
  for (let e = 0; e < a.length; ++e) {
4033
4254
  let r = 0;
@@ -4041,17 +4262,17 @@ var ke = (e) => e == null || e === "" || e instanceof Array && e.length === 0 ||
4041
4262
  for (let t of e.connections) t.tighten();
4042
4263
  return e;
4043
4264
  }
4044
- }, bn = (e, t) => {
4265
+ }, wn = (e, t) => {
4045
4266
  for (let n of e.node.getAdjacentNodes().sort((e, t) => t.getPriority() - e.getPriority())) {
4046
4267
  let r = t.indexOf(n);
4047
- r >= 0 && (t.splice(r, 1), bn(e.addBranch(n), t));
4268
+ r >= 0 && (t.splice(r, 1), wn(e.addBranch(n), t));
4048
4269
  }
4049
- }, xn = (e, t, n) => {
4270
+ }, Tn = (e, t, n) => {
4050
4271
  if (e.branches.length > 0) {
4051
4272
  for (; n >= t.length;) t.push([]);
4052
- for (let r of e.branches) t[n].push(r), xn(r, t, n + 1);
4273
+ for (let r of e.branches) t[n].push(r), Tn(r, t, n + 1);
4053
4274
  }
4054
- }, Sn = class e {
4275
+ }, En = class e {
4055
4276
  constructor(e, t) {
4056
4277
  this.parent = e, this.branches = [], this.depth = 0, this.node = t;
4057
4278
  }
@@ -4067,7 +4288,7 @@ var ke = (e) => e == null || e === "" || e instanceof Array && e.length === 0 ||
4067
4288
  return e;
4068
4289
  }
4069
4290
  }
4070
- }, Cn = class {
4291
+ }, Dn = class {
4071
4292
  constructor(e) {
4072
4293
  this.gapSize = e;
4073
4294
  }
@@ -4079,16 +4300,16 @@ var ke = (e) => e == null || e === "" || e instanceof Array && e.length === 0 ||
4079
4300
  for (let e of n) e.move([0, r]), r += e.height + t;
4080
4301
  return e;
4081
4302
  }
4082
- }, wn = {
4083
- adjacency: new fn(),
4084
- breadth: new hn(),
4085
- "breadth-adjacency": new mn(),
4086
- force: new gn(),
4087
- horizontal: new _n(),
4088
- priority: new vn(),
4089
- tree: new yn(),
4090
- vertical: new Cn()
4091
- }, Tn = a({}), En = a({}), Dn = class {
4303
+ }, On = {
4304
+ adjacency: new gn(),
4305
+ breadth: new yn(),
4306
+ "breadth-adjacency": new vn(),
4307
+ force: new bn(),
4308
+ horizontal: new xn(),
4309
+ priority: new Sn(),
4310
+ tree: new Cn(),
4311
+ vertical: new Dn()
4312
+ }, kn = a({}), An = a({}), jn = class {
4092
4313
  constructor(e, t) {
4093
4314
  this.onTitleChange = e, this.onValueSetChange = t;
4094
4315
  }
@@ -4105,7 +4326,7 @@ var ke = (e) => e == null || e === "" || e instanceof Array && e.length === 0 ||
4105
4326
  this._valueSet = e, this.onValueSetChange(e);
4106
4327
  }
4107
4328
  highlightProperty(...e) {}
4108
- }, On = ({ direction: t, collapsableSelector: n, collapsableAdditionalSelector: r, collapsed: i, disabled: a, rule: o, collapsedValue: c, visibleValue: u, onCollapse: f }) => {
4329
+ }, Mn = ({ direction: t, collapsableSelector: n, collapsableAdditionalSelector: r, collapsed: i, disabled: a, rule: o, collapsedValue: c, visibleValue: u, onCollapse: f }) => {
4109
4330
  let [m, h] = l(i), g = (t) => {
4110
4331
  let i;
4111
4332
  if (typeof n == "string") i = e.select(n), r && (i = i.select(r));
@@ -4135,8 +4356,8 @@ var ke = (e) => e == null || e === "" || e instanceof Array && e.length === 0 ||
4135
4356
  }
4136
4357
  })() })
4137
4358
  }) });
4138
- }, kn = () => {
4139
- let e = o(En), t = c(null), [n, a] = l([]);
4359
+ }, Nn = () => {
4360
+ let e = o(An), t = c(null), [n, a] = l([]);
4140
4361
  i(e.validatorChange$, e.diagramChange$).pipe(r(() => s())).subscribe();
4141
4362
  let s = () => {
4142
4363
  a([]);
@@ -4163,7 +4384,7 @@ var ke = (e) => e == null || e === "" || e instanceof Array && e.length === 0 ||
4163
4384
  className: "daga-errors-summary daga-with-errors daga-prevent-user-select",
4164
4385
  children: [/* @__PURE__ */ f("span", { children: [n.length, " errors found"] }), /* @__PURE__ */ d("div", {
4165
4386
  className: "daga-collapse-button-container",
4166
- children: /* @__PURE__ */ d(On, {
4387
+ children: /* @__PURE__ */ d(Mn, {
4167
4388
  collapsableSelector: t,
4168
4389
  collapsableAdditionalSelector: ".daga-error-panel",
4169
4390
  direction: p.Top,
@@ -4184,39 +4405,39 @@ var ke = (e) => e == null || e === "" || e instanceof Array && e.length === 0 ||
4184
4405
  })
4185
4406
  ]
4186
4407
  }) });
4187
- }, An = 200, jn = (e) => (e || "").toLowerCase().normalize("NFD").replace(/[\u0300-\u036f]/g, ""), Mn = ({ disabled: e, options: t, value: n, onChange: r }) => {
4408
+ }, Pn = 200, Fn = (e) => (e || "").toLowerCase().normalize("NFD").replace(/[\u0300-\u036f]/g, ""), In = ({ disabled: e, options: t, value: n, onChange: r }) => {
4188
4409
  let i = c(null), [a, o] = l(""), [u, p] = l(void 0), [m, h] = l([]), [g, _] = l([]), [v, y] = l([]), [b, x] = l([]), [ee, S] = l(!1);
4189
4410
  s(() => {
4190
- o(t.find((e) => Ae(e.key, n))?.label || "");
4411
+ o(t.find((e) => ke(e.key, n))?.label || "");
4191
4412
  }, [n, t]);
4192
4413
  let w = (n) => {
4193
4414
  if (!e) switch (n.key) {
4194
4415
  case C.PageDown:
4195
- u === void 0 ? (D(0), O(0)) : (D(u + 5), O(u)), n.preventDefault();
4416
+ u === void 0 ? (D(0), ne(0)) : (D(u + 5), ne(u)), n.preventDefault();
4196
4417
  break;
4197
4418
  case C.ArrowDown:
4198
- u === void 0 ? (D(0), O(0)) : (D(u + 1), O(u)), n.preventDefault();
4419
+ u === void 0 ? (D(0), ne(0)) : (D(u + 1), ne(u)), n.preventDefault();
4199
4420
  break;
4200
4421
  case C.PageUp:
4201
- u === void 0 ? (D(t.length - 1), O(t.length - 1)) : (D(u - 5), O(u)), n.preventDefault();
4422
+ u === void 0 ? (D(t.length - 1), ne(t.length - 1)) : (D(u - 5), ne(u)), n.preventDefault();
4202
4423
  break;
4203
4424
  case C.ArrowUp:
4204
- u === void 0 ? (D(t.length - 1), O(t.length - 1)) : (D(u - 1), O(u)), n.preventDefault();
4425
+ u === void 0 ? (D(t.length - 1), ne(t.length - 1)) : (D(u - 1), ne(u)), n.preventDefault();
4205
4426
  break;
4206
4427
  case C.Escape:
4207
4428
  E(), n.preventDefault();
4208
4429
  break;
4209
4430
  case C.Enter:
4210
- re(t[u || 0]), n.preventDefault();
4431
+ ie(t[u || 0]), n.preventDefault();
4211
4432
  break;
4212
4433
  default: T();
4213
4434
  }
4214
4435
  }, T = () => {
4215
4436
  if (!e) {
4216
- let e = jn(a.trim());
4437
+ let e = Fn(a.trim());
4217
4438
  h([]), _([]), y([]), x([]);
4218
4439
  for (let n of t) {
4219
- let t = jn(n.label).indexOf(e);
4440
+ let t = Fn(n.label).indexOf(e);
4220
4441
  if (t >= 0) {
4221
4442
  let r = n.label.substring(0, t), i = n.label.substring(t, t + e.length), a = n.label.substring(t + e.length);
4222
4443
  h((e) => [...e, n]), _((e) => [...e, r]), y((e) => [...e, i]), x((e) => [...e, a]);
@@ -4238,13 +4459,13 @@ var ke = (e) => e == null || e === "" || e instanceof Array && e.length === 0 ||
4238
4459
  }, te = () => {
4239
4460
  setTimeout(() => {
4240
4461
  E();
4241
- }, An);
4242
- }, O = (e) => {
4462
+ }, Pn);
4463
+ }, ne = (e) => {
4243
4464
  let t = i.current?.querySelectorAll("li")[e];
4244
4465
  t && t.scrollIntoView({ block: "center" });
4245
- }, ne = () => {
4466
+ }, re = () => {
4246
4467
  e || (o(""), S(!1), p(void 0));
4247
- }, re = (t) => {
4468
+ }, ie = (t) => {
4248
4469
  e || (o(t.label), S(!1), p(void 0), r(t.key));
4249
4470
  };
4250
4471
  return /* @__PURE__ */ f("div", {
@@ -4261,7 +4482,7 @@ var ke = (e) => e == null || e === "" || e instanceof Array && e.length === 0 ||
4261
4482
  onChange: (e) => o(e.target.value)
4262
4483
  }), a !== "" && /* @__PURE__ */ d("button", {
4263
4484
  className: "daga-clear",
4264
- onClick: ne
4485
+ onClick: re
4265
4486
  })]
4266
4487
  }), /* @__PURE__ */ d("div", {
4267
4488
  className: "daga-autocomplete-options",
@@ -4273,7 +4494,7 @@ var ke = (e) => e == null || e === "" || e instanceof Array && e.length === 0 ||
4273
4494
  }), m.map((e, t) => /* @__PURE__ */ f("li", {
4274
4495
  className: `daga-autocomplete-option ${t === u ? "daga-focused" : ""}`,
4275
4496
  onMouseMove: () => D(t),
4276
- onClick: () => re(e),
4497
+ onClick: () => ie(e),
4277
4498
  children: [
4278
4499
  /* @__PURE__ */ d("span", { children: g[t] }),
4279
4500
  /* @__PURE__ */ d("span", {
@@ -4286,7 +4507,7 @@ var ke = (e) => e == null || e === "" || e instanceof Array && e.length === 0 ||
4286
4507
  })
4287
4508
  })]
4288
4509
  });
4289
- }, Nn = (e, t) => e.find((e) => e.key === t)?.label || `${t}`, Pn = ({ disabled: e, allowRepeats: t, options: n, value: r, onChange: i }) => {
4510
+ }, Ln = (e, t) => e.find((e) => e.key === t)?.label || `${t}`, Rn = ({ disabled: e, allowRepeats: t, options: n, value: r, onChange: i }) => {
4290
4511
  let [a, o] = l(), [c, u] = l([]), [p, m] = l([]), h = (e) => {
4291
4512
  for (let t of r) if (t === e) return !0;
4292
4513
  return !1;
@@ -4299,7 +4520,7 @@ var ke = (e) => e == null || e === "" || e instanceof Array && e.length === 0 ||
4299
4520
  };
4300
4521
  s(() => {
4301
4522
  let e = r.length === 0;
4302
- u(r.map((e) => Nn(n, e))), e && i(r), g();
4523
+ u(r.map((e) => Ln(n, e))), e && i(r), g();
4303
4524
  }, [r, n]);
4304
4525
  let _ = (e) => {
4305
4526
  r.length > e && (r.splice(e, 1), u(c.filter((t, n) => n !== e)), i(r), g());
@@ -4322,7 +4543,7 @@ var ke = (e) => e == null || e === "" || e instanceof Array && e.length === 0 ||
4322
4543
  className: "daga-value-item-input",
4323
4544
  children: [/* @__PURE__ */ d("div", {
4324
4545
  className: "daga-input daga-relatively-positioned",
4325
- children: /* @__PURE__ */ d(Mn, {
4546
+ children: /* @__PURE__ */ d(In, {
4326
4547
  disabled: e,
4327
4548
  options: t ? n || [] : p || [],
4328
4549
  value: a,
@@ -4334,7 +4555,7 @@ var ke = (e) => e == null || e === "" || e instanceof Array && e.length === 0 ||
4334
4555
  children: /* @__PURE__ */ d("div", { className: "daga-icon daga-add-icon" })
4335
4556
  })]
4336
4557
  })] });
4337
- }, Fn = ({ disabled: e, allowRepeats: t, value: n, onChange: r }) => {
4558
+ }, zn = ({ disabled: e, allowRepeats: t, value: n, onChange: r }) => {
4338
4559
  let [i, a] = l(""), o = (e) => {
4339
4560
  for (let t of e || []) if (t === e) return !0;
4340
4561
  return !1;
@@ -4382,7 +4603,7 @@ var ke = (e) => e == null || e === "" || e instanceof Array && e.length === 0 ||
4382
4603
  children: /* @__PURE__ */ d("div", { className: "daga-icon daga-add-icon" })
4383
4604
  })]
4384
4605
  })] });
4385
- }, In = ({ disabled: e, value: t, onChange: n }) => {
4606
+ }, Bn = ({ disabled: e, value: t, onChange: n }) => {
4386
4607
  let [r, i] = l(""), [a, o] = l(""), [s, c] = l({}), u = (e) => {
4387
4608
  let r = {};
4388
4609
  Object.keys(t).forEach((n) => {
@@ -4490,8 +4711,8 @@ var ke = (e) => e == null || e === "" || e instanceof Array && e.length === 0 ||
4490
4711
  })
4491
4712
  ]
4492
4713
  })] });
4493
- }, Ln = ({ valueSet: e, onValueChange: t, depth: n }) => {
4494
- let r = o(En).canUserPerformAction(K.UpdateValues) && e?.rootElement?.removed !== !0, i = (e) => "daga-property-name-" + e.replace(/\s/g, ""), a = (e) => {
4714
+ }, Vn = ({ valueSet: e, onValueChange: t, depth: n }) => {
4715
+ let r = o(An).canUserPerformAction(K.UpdateValues) && e?.rootElement?.removed !== !0, i = (e) => "daga-property-name-" + e.replace(/\s/g, ""), a = (e) => {
4495
4716
  if (typeof e == "string") return e;
4496
4717
  if (e == null || isNaN(e.valueOf())) return "";
4497
4718
  let t = new Date(e), n = t.getTimezoneOffset();
@@ -4504,55 +4725,55 @@ var ke = (e) => e == null || e === "" || e instanceof Array && e.length === 0 ||
4504
4725
  className: "daga-property-name",
4505
4726
  children: o.label || o.name
4506
4727
  }),
4507
- o.type === P.Text && /* @__PURE__ */ d("input", {
4728
+ o.type === M.Text && /* @__PURE__ */ d("input", {
4508
4729
  type: "daga-text",
4509
4730
  disabled: o.editable === !1 || !r,
4510
4731
  value: e?.getValue(o.name),
4511
4732
  onChange: (n) => t(e, o, n.target.value)
4512
4733
  }),
4513
- o.type === P.TextArea && /* @__PURE__ */ d("textarea", {
4734
+ o.type === M.TextArea && /* @__PURE__ */ d("textarea", {
4514
4735
  disabled: o.editable === !1 || !r,
4515
4736
  value: e?.getValue(o.name),
4516
4737
  onChange: (n) => t(e, o, n.target.value)
4517
4738
  }),
4518
- o.type === P.Number && /* @__PURE__ */ d("input", {
4739
+ o.type === M.Number && /* @__PURE__ */ d("input", {
4519
4740
  type: "number",
4520
4741
  disabled: o.editable === !1 || !r,
4521
4742
  value: e?.getValue(o.name),
4522
4743
  onChange: (n) => t(e, o, n.target.value)
4523
4744
  }),
4524
- o.type === P.Color && /* @__PURE__ */ d("input", {
4745
+ o.type === M.Color && /* @__PURE__ */ d("input", {
4525
4746
  type: "text",
4526
4747
  pattern: "#[0-9a-fA-F]{6}",
4527
4748
  disabled: o.editable === !1 || !r,
4528
4749
  value: e?.getValue(o.name),
4529
4750
  onChange: (n) => t(e, o, n.target.value)
4530
4751
  }),
4531
- o.type === P.Datetime && /* @__PURE__ */ d("input", {
4752
+ o.type === M.Datetime && /* @__PURE__ */ d("input", {
4532
4753
  type: "datetime-local",
4533
4754
  disabled: o.editable === !1 || !r,
4534
4755
  value: a(e?.getValue(o.name)),
4535
4756
  onChange: (n) => t(e, o, s(n.target.value))
4536
4757
  }),
4537
- o.type === P.Date && /* @__PURE__ */ d("input", {
4758
+ o.type === M.Date && /* @__PURE__ */ d("input", {
4538
4759
  type: "date",
4539
4760
  disabled: o.editable === !1 || !r,
4540
4761
  value: e?.getValue(o.name),
4541
4762
  onChange: (n) => t(e, o, n.target.value)
4542
4763
  }),
4543
- o.type === P.Time && /* @__PURE__ */ d("input", {
4764
+ o.type === M.Time && /* @__PURE__ */ d("input", {
4544
4765
  type: "time",
4545
4766
  disabled: o.editable === !1 || !r,
4546
4767
  value: e?.getValue(o.name),
4547
4768
  onChange: (n) => t(e, o, n.target.value)
4548
4769
  }),
4549
- o.type === P.Url && /* @__PURE__ */ d("input", {
4770
+ o.type === M.Url && /* @__PURE__ */ d("input", {
4550
4771
  type: "url",
4551
4772
  disabled: o.editable === !1 || !r,
4552
4773
  value: e?.getValue(o.name),
4553
4774
  onChange: (n) => t(e, o, n.target.value)
4554
4775
  }),
4555
- o.type === P.Boolean && /* @__PURE__ */ f("div", {
4776
+ o.type === M.Boolean && /* @__PURE__ */ f("div", {
4556
4777
  className: "daga-radio",
4557
4778
  children: [/* @__PURE__ */ f("label", {
4558
4779
  className: "daga-radio-item daga-radio-start" + (e?.getValue(o.name) === !1 ? " daga-checked" : ""),
@@ -4576,36 +4797,36 @@ var ke = (e) => e == null || e === "" || e instanceof Array && e.length === 0 ||
4576
4797
  }), "Yes"]
4577
4798
  })]
4578
4799
  }),
4579
- o.type === P.Option && /* @__PURE__ */ d("div", {
4800
+ o.type === M.Option && /* @__PURE__ */ d("div", {
4580
4801
  className: "daga-relatively-positioned",
4581
- children: /* @__PURE__ */ d(Mn, {
4802
+ children: /* @__PURE__ */ d(In, {
4582
4803
  disabled: o.editable === !1 || !r,
4583
4804
  options: o.options || [],
4584
4805
  value: e?.getValue(o.name),
4585
4806
  onChange: (n) => t(e, o, n)
4586
4807
  })
4587
4808
  }),
4588
- (o.type === P.OptionList || o.type === P.OptionSet) && /* @__PURE__ */ d(Pn, {
4809
+ (o.type === M.OptionList || o.type === M.OptionSet) && /* @__PURE__ */ d(Rn, {
4589
4810
  disabled: o.editable === !1 || !r,
4590
- allowRepeats: o.type === P.OptionList,
4811
+ allowRepeats: o.type === M.OptionList,
4591
4812
  options: o.options || [],
4592
4813
  value: e?.getValue(o.name),
4593
4814
  onChange: (n) => t(e, o, n)
4594
4815
  }),
4595
- (o.type === P.TextList || o.type === P.TextSet) && /* @__PURE__ */ d(Fn, {
4816
+ (o.type === M.TextList || o.type === M.TextSet) && /* @__PURE__ */ d(zn, {
4596
4817
  disabled: o.editable === !1 || !r,
4597
- allowRepeats: o.type === P.TextList,
4818
+ allowRepeats: o.type === M.TextList,
4598
4819
  value: e?.getValue(o.name),
4599
4820
  onChange: (n) => t(e, o, n)
4600
4821
  }),
4601
- o.type === P.TextMap && /* @__PURE__ */ d(In, {
4822
+ o.type === M.TextMap && /* @__PURE__ */ d(Bn, {
4602
4823
  disabled: o.editable === !1 || !r,
4603
4824
  value: e?.getValue(o.name),
4604
4825
  onChange: (n) => t(e, o, n)
4605
4826
  }),
4606
- o.type === P.Object && /* @__PURE__ */ d("div", {
4827
+ o.type === M.Object && /* @__PURE__ */ d("div", {
4607
4828
  className: "daga-left-bar",
4608
- children: /* @__PURE__ */ d(Ln, {
4829
+ children: /* @__PURE__ */ d(Vn, {
4609
4830
  valueSet: e.getSubValueSet(o.name),
4610
4831
  onValueChange: t,
4611
4832
  depth: n + 1
@@ -4613,22 +4834,22 @@ var ke = (e) => e == null || e === "" || e instanceof Array && e.length === 0 ||
4613
4834
  })
4614
4835
  ]
4615
4836
  }, o.name)) });
4616
- }, Rn = ({ valueSet: t, depth: n }) => {
4617
- let r = o(En), i = c(null), a = (e) => "daga-property-name-" + e.replace(/\s/g, ""), s = () => {
4837
+ }, Hn = ({ valueSet: t, depth: n }) => {
4838
+ let r = o(An), i = c(null), a = (e) => "daga-property-name-" + e.replace(/\s/g, ""), s = () => {
4618
4839
  for (let o of t?.displayedProperties || []) {
4619
4840
  let s = 0, c = 0, u = 0, d = e.select(i.current).select(`.daga-property.${a(o.name)}.daga-depth-${n}`);
4620
4841
  d.select("button.daga-move-button").call(e.drag().on(w.Start, (e) => {
4621
- X(A.Grabbing);
4842
+ X(k.Grabbing);
4622
4843
  let t = r.getPointerLocationRelativeToScreen(e);
4623
4844
  if (t.length < 2 || isNaN(t[0]) || isNaN(t[1])) return;
4624
4845
  let n = d.node()?.getBoundingClientRect();
4625
4846
  s = n?.width || 0, c = n?.height || 0, d.style("position", "fixed").style("left", `${t[0] - s / 2}px`).style("top", `${t[1] - c / 2}px`).style("width", `${s}px`).style("height", `${c}px`).style("z-index", 1);
4626
4847
  }).on(w.Drag, (t) => {
4627
- X(A.Grabbing);
4848
+ X(k.Grabbing);
4628
4849
  let a = r.getPointerLocationRelativeToScreen(t);
4629
4850
  a.length < 2 || isNaN(a[0]) || isNaN(a[1]) || (d.style("position", "fixed").style("left", `${a[0] - s / 2}px`).style("top", `${a[1] - c / 2}px`).style("width", `${s}px`).style("height", `${c}px`).style("z-index", 1), e.select(i.current).select(`.daga-dropbar.daga-index-${u}.daga-depth-${n}`).style("visibility", "hidden").style("height", 0), u = l(a), e.select(i.current).select(`.daga-dropbar.daga-index-${u}.daga-depth-${n}`).style("visibility", "visible").style("height", "0.25rem"));
4630
4851
  }).on(w.End, (a) => {
4631
- X(A.Auto), d.style("position", "relative").style("left", 0).style("top", 0).style("z-index", 0).style("width", "unset").style("height", "unset"), e.select(i.current).select(`.daga-dropbar.daga-index-${u}.daga-depth-${n}`).style("visibility", "hidden").style("height", 0);
4852
+ X(k.Auto), d.style("position", "relative").style("left", 0).style("top", 0).style("z-index", 0).style("width", "unset").style("height", "unset"), e.select(i.current).select(`.daga-dropbar.daga-index-${u}.daga-depth-${n}`).style("visibility", "hidden").style("height", 0);
4632
4853
  let s = r.getPointerLocationRelativeToScreen(a);
4633
4854
  s.length < 2 || isNaN(s[0]) || isNaN(s[1]) || (u = l(s), t?.displayedProperties?.splice(t.displayedProperties.indexOf(o), 1), t?.displayedProperties?.splice(u, 0, o));
4634
4855
  }));
@@ -4647,7 +4868,7 @@ var ke = (e) => e == null || e === "" || e instanceof Array && e.length === 0 ||
4647
4868
  }, u = (e) => {
4648
4869
  if (t === void 0) return;
4649
4870
  let n;
4650
- n = e instanceof Ee ? e : e instanceof Event ? t?.propertySet.getProperty(e.target?.value || "") : t?.propertySet.getProperty(e || ""), n && t?.hideProperty(n), s();
4871
+ n = e instanceof Te ? e : e instanceof Event ? t?.propertySet.getProperty(e.target?.value || "") : t?.propertySet.getProperty(e || ""), n && t?.hideProperty(n), s();
4651
4872
  };
4652
4873
  return /* @__PURE__ */ f("daga-property-settings", {
4653
4874
  ref: i,
@@ -4670,11 +4891,11 @@ var ke = (e) => e == null || e === "" || e instanceof Array && e.length === 0 ||
4670
4891
  })]
4671
4892
  })]
4672
4893
  }),
4673
- e.type !== P.Object && /* @__PURE__ */ d("div", {
4894
+ e.type !== M.Object && /* @__PURE__ */ d("div", {
4674
4895
  className: "daga-property-value",
4675
- children: zn(t?.getValue(e.name))
4896
+ children: Un(t?.getValue(e.name))
4676
4897
  }),
4677
- e.type === P.Object && /* @__PURE__ */ d(Rn, {
4898
+ e.type === M.Object && /* @__PURE__ */ d(Hn, {
4678
4899
  valueSet: t?.getSubValueSet(e.name),
4679
4900
  depth: n + 1
4680
4901
  })
@@ -4682,7 +4903,7 @@ var ke = (e) => e == null || e === "" || e instanceof Array && e.length === 0 ||
4682
4903
  }), /* @__PURE__ */ d("div", { className: `daga-dropbar daga-index-${r + 1} daga-depth-${n}` })]
4683
4904
  }, e.name))]
4684
4905
  });
4685
- }, zn = (e) => Array.isArray(e) ? e.join(", ") : Me(e) ? Object.entries(e).map((e) => e.map((e) => JSON.stringify(e)).join(": ")).join(", ") : e instanceof Date ? e.toLocaleString() : e == null ? "" : "" + e, Bn = ({ collapsed: t, location: n, direction: r, width: i, length: a, title: o, valueSet: u, onValueChange: m }) => {
4906
+ }, Un = (e) => Array.isArray(e) ? e.join(", ") : je(e) ? Object.entries(e).map((e) => e.map((e) => JSON.stringify(e)).join(": ")).join(", ") : e instanceof Date ? e.toLocaleString() : e == null ? "" : "" + e, Wn = ({ collapsed: t, location: n, direction: r, width: i, length: a, title: o, valueSet: u, onValueChange: m }) => {
4686
4907
  let h = c(null), [g, _] = l(t), [v, y] = l(!1), b = () => e.select(h.current);
4687
4908
  return s(() => {
4688
4909
  if (h.current) switch (r) {
@@ -4702,7 +4923,7 @@ var ke = (e) => e == null || e === "" || e instanceof Array && e.length === 0 ||
4702
4923
  ]), /* @__PURE__ */ d("daga-property-editor", { children: /* @__PURE__ */ f("div", {
4703
4924
  ref: h,
4704
4925
  className: `daga-panel daga-bottom daga-${n} daga-${r}`,
4705
- children: [/* @__PURE__ */ d(On, {
4926
+ children: [/* @__PURE__ */ d(Mn, {
4706
4927
  disabled: !u || !u.propertySet || !u.propertySet.hasProperties(),
4707
4928
  collapsed: g,
4708
4929
  direction: r,
@@ -4723,20 +4944,20 @@ var ke = (e) => e == null || e === "" || e instanceof Array && e.length === 0 ||
4723
4944
  children: /* @__PURE__ */ d("div", { className: `daga-icon daga-settings-icon ${v ? "daga-unrotate" : "daga-rotate"}` })
4724
4945
  })]
4725
4946
  }),
4726
- !v && /* @__PURE__ */ d(Ln, {
4947
+ !v && /* @__PURE__ */ d(Vn, {
4727
4948
  valueSet: u,
4728
4949
  onValueChange: m,
4729
4950
  depth: 0
4730
4951
  }),
4731
- v && /* @__PURE__ */ d(Rn, {
4952
+ v && /* @__PURE__ */ d(Hn, {
4732
4953
  valueSet: u,
4733
4954
  depth: 0
4734
4955
  })
4735
4956
  ] })
4736
4957
  })]
4737
4958
  }) });
4738
- }, Vn = 6, Hn = (t) => {
4739
- let n = o(En), [r, i] = l(t.currentPalette || t.palettes[0]), [a, u] = l(0), [m, h] = l(void 0), g = c(null), _ = c(!1), v = (e) => {
4959
+ }, Gn = 6, Kn = (t) => {
4960
+ let n = o(An), [r, i] = l(t.currentPalette || t.palettes[0]), [a, u] = l(0), [m, h] = l(void 0), g = c(null), _ = c(!1), v = (e) => {
4740
4961
  if (i(e), y().selectAll("*").remove(), u(n.getPriorityThreshold() || 0), e.categories && b(e.categories), e.templates) for (let t of e.templates) x(t);
4741
4962
  }, y = () => e.select(g.current).select(".daga-palette-view"), b = (e) => {
4742
4963
  let t = y().append("select").style("width", "100%").style("height", "2rem").style("padding", "0.5rem").style("border-radius", "0.25rem").style("background-color", "#f7f8fc").style("border", "1px solid #e6e6e6");
@@ -4767,14 +4988,14 @@ var ke = (e) => e == null || e === "" || e instanceof Array && e.length === 0 ||
4767
4988
  }
4768
4989
  }).on(w.Start, (e) => {
4769
4990
  if (n.canUserPerformAction(K.AddNode)) {
4770
- X(A.Grabbing);
4991
+ X(k.Grabbing);
4771
4992
  let r = n.getPointerLocationRelativeToScreen(e);
4772
4993
  if (r.length < 2 || isNaN(r[0]) || isNaN(r[1])) return;
4773
- d.style("position", "fixed").style("left", `${r[0] - u / 2}px`).style("top", `${r[1] - l / 2}px`).style("z-index", 1), t.isUnique && n.model.nodes.find((e) => !e.removed && e.type.id === t.id) !== void 0 && X(A.NotAllowed);
4994
+ d.style("position", "fixed").style("left", `${r[0] - u / 2}px`).style("top", `${r[1] - l / 2}px`).style("z-index", 1), t.isUnique && n.model.nodes.find((e) => !e.removed && e.type.id === t.id) !== void 0 && X(k.NotAllowed);
4774
4995
  }
4775
4996
  }).on(w.End, (e) => {
4776
4997
  if (n.canUserPerformAction(K.AddNode)) {
4777
- if (X(A.Auto), d.style("position", "relative").style("left", 0).style("top", 0).style("z-index", "auto"), t.isUnique && n.model.nodes.find((e) => !e.removed && e.type.id === t.id) !== void 0) return;
4998
+ if (X(k.Auto), d.style("position", "relative").style("left", 0).style("top", 0).style("z-index", "auto"), t.isUnique && n.model.nodes.find((e) => !e.removed && e.type.id === t.id) !== void 0) return;
4778
4999
  let i = n.getPointerLocationRelativeToScreen(e);
4779
5000
  if (i.length < 2 || isNaN(i[0]) || isNaN(i[1])) return;
4780
5001
  let a = document.elementFromPoint(i[0], i[1]);
@@ -4783,15 +5004,15 @@ var ke = (e) => e == null || e === "" || e instanceof Array && e.length === 0 ||
4783
5004
  if (o.length < 2 || isNaN(o[0]) || isNaN(o[1])) return;
4784
5005
  let s = [o[0] - t.defaultWidth / 2, o[1] - t.defaultHeight / 2];
4785
5006
  n.gridConfig.snap && (s = n.getClosestGridPoint([s[0] - t.snapToGridOffset[0], s[1] - t.snapToGridOffset[1]]), s[0] += t.snapToGridOffset[0], s[1] += t.snapToGridOffset[1]);
4786
- let c = Ye(n.model.nodes.getAtCoordinates(o[0], o[1]).filter((e) => e.type.childrenTypes.includes(t.id))), l = c[c.length - 1];
5007
+ let c = Qe(n.model.nodes.getAtCoordinates(o[0], o[1]).filter((e) => e.type.childrenTypes.includes(t.id))), l = c[c.length - 1];
4787
5008
  if (!t.canBeParentless && l === void 0) return;
4788
- let u = l?.getLastAncestor(), f = new Ct(n, t, s, l?.id, u?.id, u?.getGeometry(), void 0, r.label, r.values);
5009
+ let u = l?.getLastAncestor(), f = new Et(n, t, s, l?.id, u?.id, u?.getGeometry(), void 0, r.label, r.values);
4789
5010
  f.do(), n?.actionStack.add(f), X();
4790
5011
  }
4791
5012
  })).append("svg").attr("class", `palette-node ${t.id}`).attr("viewBox", `0 0 ${c} ${s}`).attr("preserveAspectRatio", "none").style("position", "relative").style("left", 0).style("top", 0).style("width", `${u}px`).style("height", `${l}px`), f = r.look || t.defaultLook;
4792
5013
  switch (f.lookType) {
4793
5014
  case "shaped-look":
4794
- d.append("path").attr("d", ae(f.shape || ie.Rectangle, (f.borderThickness || 1) / 2, (f.borderThickness || 1) / 2, t.defaultWidth, t.defaultHeight)).attr("fill", f.fillColor || "#FFFFFF").attr("stroke", f.borderColor || "#000000").attr("stroke-width", `${f.borderThickness}px`);
5015
+ d.append("path").attr("d", oe(f.shape || ae.Rectangle, (f.borderThickness || 1) / 2, (f.borderThickness || 1) / 2, t.defaultWidth, t.defaultHeight)).attr("fill", f.fillColor || "#FFFFFF").attr("stroke", f.borderColor || "#000000").attr("stroke-width", `${f.borderThickness}px`);
4795
5016
  break;
4796
5017
  case "image-look":
4797
5018
  d.append("image").attr("x", 0).attr("y", 0).attr("width", t.defaultWidth).attr("height", t.defaultHeight).attr("href", f.backgroundImage).attr("preserveAspectRatio", "none");
@@ -4816,7 +5037,7 @@ var ke = (e) => e == null || e === "" || e instanceof Array && e.length === 0 ||
4816
5037
  let i = y().append("div").attr("class", `daga-template-container ${r === void 0 ? "" : r}`).style("width", `${t.width}px`).style("height", `${t.height}px`).append("svg").attr("class", `palette-button ${e.id}`).style("position", "relative").style("left", 0).style("top", 0).style("width", "100%").style("height", "100%").on("click", () => {
4817
5038
  n.connectionType = e;
4818
5039
  });
4819
- i.append("path").attr("d", ae(ie.Rectangle, 0, 0, t.width, t.height)).attr("fill", t.backgroundColor).attr("stroke", "black").attr("stroke-width", "1px"), t.icon !== "" && i.append("image").attr("x", 0).attr("y", 0).attr("width", t.width).attr("height", t.height).attr("href", t.icon), t.label !== "" && i.append("text").attr("transform", `translate(${t.width / 2},${t.height / 2 + Vn})`).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(t.label);
5040
+ i.append("path").attr("d", oe(ae.Rectangle, 0, 0, t.width, t.height)).attr("fill", t.backgroundColor).attr("stroke", "black").attr("stroke-width", "1px"), t.icon !== "" && i.append("image").attr("x", 0).attr("y", 0).attr("width", t.width).attr("height", t.height).attr("href", t.icon), t.label !== "" && i.append("text").attr("transform", `translate(${t.width / 2},${t.height / 2 + Gn})`).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(t.label);
4820
5041
  };
4821
5042
  return s(() => {
4822
5043
  t.palettes.length > 0 && !_.current && (_.current = !0, v(t.palettes[0]));
@@ -4838,7 +5059,7 @@ var ke = (e) => e == null || e === "" || e instanceof Array && e.length === 0 ||
4838
5059
  ]), /* @__PURE__ */ d("daga-palette", { children: /* @__PURE__ */ f("div", {
4839
5060
  ref: g,
4840
5061
  className: `daga-panel daga-${t.location} daga-${t.direction}`,
4841
- children: [/* @__PURE__ */ d(On, {
5062
+ children: [/* @__PURE__ */ d(Mn, {
4842
5063
  direction: t.direction,
4843
5064
  collapsableSelector: g,
4844
5065
  collapsableAdditionalSelector: ".daga-panel-content",
@@ -4859,7 +5080,7 @@ var ke = (e) => e == null || e === "" || e instanceof Array && e.length === 0 ||
4859
5080
  }), /* @__PURE__ */ d("div", { className: "daga-palette-view" })]
4860
5081
  })]
4861
5082
  }) });
4862
- }, Un = ({ location: t, direction: n, centerAnimationDuration: r, enableAction: i, enableFilter: a, enableLayout: l, enableSelection: u, enableZoom: m }) => {
5083
+ }, qn = ({ location: t, direction: n, centerAnimationDuration: r, enableAction: i, enableFilter: a, enableLayout: l, enableSelection: u, enableZoom: m }) => {
4863
5084
  let h = !1, g = !0, _ = !1, v, y, b, x;
4864
5085
  switch (n) {
4865
5086
  case p.Bottom:
@@ -4890,7 +5111,7 @@ var ke = (e) => e == null || e === "" || e instanceof Array && e.length === 0 ||
4890
5111
  } else g = !0, t.transition().duration(500).ease(e.easeLinear).style(v, "0rem").style("transform", `${y}(0)`), setTimeout(() => {
4891
5112
  _ = !1;
4892
5113
  }, 500);
4893
- }, T = o(En);
5114
+ }, T = o(An);
4894
5115
  return /* @__PURE__ */ d("daga-diagram-buttons", { children: /* @__PURE__ */ f("div", {
4895
5116
  className: `daga-diagram-buttons daga-${t} daga-${n}`,
4896
5117
  children: [
@@ -4973,7 +5194,7 @@ var ke = (e) => e == null || e === "" || e instanceof Array && e.length === 0 ||
4973
5194
  onClick: () => {
4974
5195
  T.multipleSelectionOn = !0, e.select(S.current).classed("daga-on", !0).classed("daga-off", !1);
4975
5196
  let t = T.diagramEvent$.subscribe((n) => {
4976
- n.type === Mt.Selection && (e.select(S.current).classed("daga-on", !1).classed("daga-off", !0), t.unsubscribe());
5197
+ n.type === Ft.Selection && (e.select(S.current).classed("daga-on", !1).classed("daga-off", !0), t.unsubscribe());
4977
5198
  });
4978
5199
  },
4979
5200
  ref: S,
@@ -5005,7 +5226,7 @@ var ke = (e) => e == null || e === "" || e instanceof Array && e.length === 0 ||
5005
5226
  l && T.layoutFormat && /* @__PURE__ */ d("button", {
5006
5227
  className: "daga-layout",
5007
5228
  onClick: () => {
5008
- T.layoutFormat && T.layoutFormat in wn && wn[T.layoutFormat].apply(T.model);
5229
+ T.layoutFormat && T.layoutFormat in On && On[T.layoutFormat].apply(T.model);
5009
5230
  },
5010
5231
  children: /* @__PURE__ */ d("span", {
5011
5232
  className: "daga-tooltip",
@@ -5040,8 +5261,8 @@ var ke = (e) => e == null || e === "" || e instanceof Array && e.length === 0 ||
5040
5261
  })
5041
5262
  ]
5042
5263
  }) });
5043
- }, Wn = ({ config: e, model: t, onCanvasCreated: n, onDiagramEvent: r, onModelChange: i }) => {
5044
- let a = new ut(), o = new on(), u = c(null), h = c(void 0), g = c(!1), _ = [], [v, y] = l(void 0), [b, x] = l(void 0), ee = {
5264
+ }, Jn = ({ config: e, model: t, onCanvasCreated: n, onDiagramEvent: r, onModelChange: i }) => {
5265
+ let a = new pt(), o = new un(), u = c(null), h = c(void 0), g = c(!1), _ = [], [v, y] = l(void 0), [b, x] = l(void 0), ee = {
5045
5266
  zoomIn: () => {},
5046
5267
  zoomOut: () => {},
5047
5268
  center: () => {},
@@ -5049,12 +5270,12 @@ var ke = (e) => e == null || e === "" || e instanceof Array && e.length === 0 ||
5049
5270
  filter: () => {},
5050
5271
  undo: () => {},
5051
5272
  redo: () => {}
5052
- }, S = { refreshPalette: () => {} }, C = new Dn((e) => y(e), (e) => x(e)), w = {
5273
+ }, S = { refreshPalette: () => {} }, C = new jn((e) => y(e), (e) => x(e)), w = {
5053
5274
  diagramButtons: ee,
5054
5275
  palette: S,
5055
5276
  propertyEditor: C
5056
5277
  }, T = (t = !1) => {
5057
- if ((!h.current || t) && (_.forEach((e) => e.unsubscribe()), h.current = new un(w, e)), !h.current) throw Error("Canvas could not be created");
5278
+ if ((!h.current || t) && (_.forEach((e) => e.unsubscribe()), h.current = new mn(w, e)), !h.current) throw Error("Canvas could not be created");
5058
5279
  return h.current;
5059
5280
  }, E = T(), D = (e) => {
5060
5281
  E.initView(e), _.push(E.diagramEvent$.subscribe((e) => {
@@ -5070,17 +5291,17 @@ var ke = (e) => e == null || e === "" || e instanceof Array && e.length === 0 ||
5070
5291
  u.current && (T(!0), D(u.current), n?.(E));
5071
5292
  }, [e]), s(() => {
5072
5293
  t && a.import(E.model, t);
5073
- }, [t]), /* @__PURE__ */ d("daga-diagram", { children: /* @__PURE__ */ d(Tn.Provider, {
5294
+ }, [t]), /* @__PURE__ */ d("daga-diagram", { children: /* @__PURE__ */ d(kn.Provider, {
5074
5295
  value: e,
5075
- children: /* @__PURE__ */ d(En.Provider, {
5296
+ children: /* @__PURE__ */ d(An.Provider, {
5076
5297
  value: E,
5077
5298
  children: /* @__PURE__ */ f("daga-diagram-editor", { children: [/* @__PURE__ */ d("div", {
5078
5299
  className: "daga-append-to",
5079
5300
  ref: u
5080
- }), /* @__PURE__ */ f(En.Provider, {
5301
+ }), /* @__PURE__ */ f(An.Provider, {
5081
5302
  value: E,
5082
5303
  children: [
5083
- e.components?.buttons !== void 0 && e.components?.buttons?.enabled !== !1 && /* @__PURE__ */ d(Un, {
5304
+ e.components?.buttons !== void 0 && e.components?.buttons?.enabled !== !1 && /* @__PURE__ */ d(qn, {
5084
5305
  location: e.components?.buttons?.location || m.BottomRight,
5085
5306
  direction: e.components?.buttons?.direction || p.Top,
5086
5307
  centerAnimationDuration: e.components?.buttons?.centerAnimationDuration,
@@ -5090,7 +5311,7 @@ var ke = (e) => e == null || e === "" || e instanceof Array && e.length === 0 ||
5090
5311
  enableSelection: e.components?.buttons?.enableSelection !== !1,
5091
5312
  enableZoom: e.components?.buttons?.enableZoom !== !1
5092
5313
  }),
5093
- e.components?.palette !== void 0 && e.components?.palette?.enabled !== !1 && e.components?.palette?.sections && (e.components?.palette?.sections?.length || 0) > 0 && /* @__PURE__ */ d(Hn, {
5314
+ e.components?.palette !== void 0 && e.components?.palette?.enabled !== !1 && e.components?.palette?.sections && (e.components?.palette?.sections?.length || 0) > 0 && /* @__PURE__ */ d(Kn, {
5094
5315
  collapsed: e.components?.palette?.open === !1,
5095
5316
  location: e.components?.palette?.location || m.TopLeft,
5096
5317
  direction: e.components?.palette?.direction || p.Bottom,
@@ -5100,7 +5321,7 @@ var ke = (e) => e == null || e === "" || e instanceof Array && e.length === 0 ||
5100
5321
  justifyContent: e.components?.palette?.justifyContent || "center",
5101
5322
  palettes: e.components?.palette?.sections || []
5102
5323
  }),
5103
- e.components?.propertyEditor !== void 0 && e.components?.propertyEditor?.enabled !== !1 && /* @__PURE__ */ d(Bn, {
5324
+ e.components?.propertyEditor !== void 0 && e.components?.propertyEditor?.enabled !== !1 && /* @__PURE__ */ d(Wn, {
5104
5325
  collapsed: e.components?.propertyEditor?.open === !1,
5105
5326
  location: e.components?.propertyEditor?.location || m.TopRight,
5106
5327
  direction: e.components?.propertyEditor?.direction || p.Bottom,
@@ -5109,18 +5330,18 @@ var ke = (e) => e == null || e === "" || e instanceof Array && e.length === 0 ||
5109
5330
  title: v,
5110
5331
  valueSet: b,
5111
5332
  onValueChange: (e, t, n) => {
5112
- if (b !== void 0 && t.editable !== !1 && !Ae(e.getValue(t.name), n)) {
5333
+ if (b !== void 0 && t.editable !== !1 && !ke(e.getValue(t.name), n)) {
5113
5334
  e.setValue(t.name, n);
5114
- let r = new Ne(b.propertySet, void 0);
5335
+ let r = new Me(b.propertySet, void 0);
5115
5336
  r.setValues(b.getValues()), r.rootElement = b.rootElement, C.valueSet = r, b.rootElement.valueSet = r, E.propertyEditorChanges$?.next();
5116
5337
  }
5117
5338
  }
5118
5339
  }),
5119
- e.components?.errors !== void 0 && e.components?.errors?.enabled !== !1 && /* @__PURE__ */ d(kn, {})
5340
+ e.components?.errors !== void 0 && e.components?.errors?.enabled !== !1 && /* @__PURE__ */ d(Nn, {})
5120
5341
  ]
5121
5342
  })] })
5122
5343
  })
5123
5344
  }) });
5124
5345
  };
5125
5346
  //#endregion
5126
- export { Wn as DagaDiagram };
5347
+ export { Jn as DagaDiagram };