@miragon/wardley-renderer 0.5.0 → 0.6.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.
package/dist/index.js CHANGED
@@ -164,10 +164,10 @@ function Ee(e, t) {
164
164
  var De = "wardley-root";
165
165
  //#endregion
166
166
  //#region src/WardleyBaseViewer.ts
167
- function b(e) {
167
+ function Oe(e) {
168
168
  return typeof e == "number" ? `${e}px` : e;
169
169
  }
170
- var x = class {
170
+ var ke = class {
171
171
  _diagram;
172
172
  _container;
173
173
  _options;
@@ -176,7 +176,7 @@ var x = class {
176
176
  }
177
177
  _createContainer(e) {
178
178
  let t = e.container ?? document.createElement("div");
179
- return t.classList.add("wardley-container"), t.style.width = b(e.width ?? "100%"), t.style.height = b(e.height ?? (e.container ? "100%" : "600px")), t;
179
+ return t.classList.add("wardley-container"), t.style.width = Oe(e.width ?? "100%"), t.style.height = Oe(e.height ?? (e.container ? "100%" : "600px")), t;
180
180
  }
181
181
  _ensureDiagram() {
182
182
  if (!this._diagram) {
@@ -280,7 +280,7 @@ var x = class {
280
280
  get container() {
281
281
  return this._container;
282
282
  }
283
- }, S = class {
283
+ }, Ae = class {
284
284
  elementFactory;
285
285
  grid;
286
286
  elementRegistry;
@@ -506,7 +506,7 @@ var x = class {
506
506
  id: t.id,
507
507
  source: n,
508
508
  target: r,
509
- waypoints: [C(n), C(r)],
509
+ waypoints: [je(n), je(r)],
510
510
  wardleyType: e,
511
511
  bidirectional: i,
512
512
  ...a ? { flowValue: a } : {},
@@ -515,7 +515,7 @@ var x = class {
515
515
  });
516
516
  }
517
517
  };
518
- function C(e) {
518
+ function je(e) {
519
519
  return e.wardleyType === "pipeline" ? {
520
520
  x: e.x + e.width / 2,
521
521
  y: e.y
@@ -526,31 +526,31 @@ function C(e) {
526
526
  }
527
527
  //#endregion
528
528
  //#region src/model/di-types.ts
529
- function w(e) {
529
+ function b(e) {
530
530
  return typeof e == "object" && !!e;
531
531
  }
532
- function T(e) {
533
- return w(e) && typeof e.wardleyType == "string" && "evolution" in e;
532
+ function x(e) {
533
+ return b(e) && typeof e.wardleyType == "string" && "evolution" in e;
534
534
  }
535
- function E(e) {
536
- return w(e) && typeof e.wardleyType == "string" && "waypoints" in e;
535
+ function S(e) {
536
+ return b(e) && typeof e.wardleyType == "string" && "waypoints" in e;
537
537
  }
538
- function D(e) {
539
- return T(e) && e.wardleyType === "component";
538
+ function Me(e) {
539
+ return x(e) && e.wardleyType === "component";
540
540
  }
541
- function O(e) {
542
- return T(e) && e.wardleyType === "pipeline";
541
+ function C(e) {
542
+ return x(e) && e.wardleyType === "pipeline";
543
543
  }
544
- function Oe(e) {
545
- return T(e) && e.wardleyType === "attitude";
544
+ function Ne(e) {
545
+ return x(e) && e.wardleyType === "attitude";
546
546
  }
547
547
  //#endregion
548
548
  //#region src/model/index.ts
549
- var ke = { wardleyElementFactory: ["type", S] }, Ae = "wardley-axes";
550
- function je(e) {
549
+ var Pe = { wardleyElementFactory: ["type", Ae] }, Fe = "wardley-axes";
550
+ function Ie(e) {
551
551
  return e < 0 ? 0 : e > 1 ? 1 : e;
552
552
  }
553
- var Me = class {
553
+ var Le = class {
554
554
  canvas;
555
555
  static $inject = ["canvas"];
556
556
  boundaries = o;
@@ -573,8 +573,8 @@ var Me = class {
573
573
  }
574
574
  fromCanvas(e) {
575
575
  return {
576
- evolution: je((e.x - h.marginLeft) / this.plotWidth),
577
- visibility: je(1 - (e.y - h.marginTop) / this.plotHeight)
576
+ evolution: Ie((e.x - h.marginLeft) / this.plotWidth),
577
+ visibility: Ie(1 - (e.y - h.marginTop) / this.plotHeight)
578
578
  };
579
579
  }
580
580
  stageOf(e) {
@@ -598,10 +598,10 @@ var Me = class {
598
598
  };
599
599
  }
600
600
  render() {
601
- let e = this.canvas.getLayer(Ae, -1);
601
+ let e = this.canvas.getLayer(Fe, -1);
602
602
  d(e);
603
603
  let t = h.marginLeft, n = h.marginTop, r = t + this.plotWidth, i = n + this.plotHeight;
604
- l(e, Ne(t, n, this.plotWidth, this.plotHeight, {
604
+ l(e, Re(t, n, this.plotWidth, this.plotHeight, {
605
605
  fill: _.plotBackground,
606
606
  stroke: _.grid
607
607
  }));
@@ -612,45 +612,45 @@ var Me = class {
612
612
  ];
613
613
  for (let r = 0; r < 4; r++) {
614
614
  let o = t + a[r] * this.plotWidth, s = t + a[r + 1] * this.plotWidth;
615
- r % 2 == 1 && l(e, Ne(o, n, s - o, this.plotHeight, {
615
+ r % 2 == 1 && l(e, Re(o, n, s - o, this.plotHeight, {
616
616
  fill: _.band,
617
617
  stroke: "none"
618
- })), r > 0 && l(e, k(o, n, o, i, {
618
+ })), r > 0 && l(e, w(o, n, o, i, {
619
619
  stroke: _.grid,
620
620
  "stroke-dasharray": "3 5"
621
621
  }));
622
622
  let c = (o + s) / 2;
623
- l(e, A(this.labels[r].toUpperCase(), c, i + 18, {
623
+ l(e, T(this.labels[r].toUpperCase(), c, i + 18, {
624
624
  "text-anchor": "middle",
625
625
  "font-size": y.stage,
626
626
  "letter-spacing": "0.08em",
627
627
  fill: _.axisText
628
628
  }));
629
629
  }
630
- l(e, k(t, i, r + 10, i, { stroke: _.axis })), l(e, Pe(r + 10, i, "right")), l(e, A("Evolution", r + 6, i + 38, {
630
+ l(e, w(t, i, r + 10, i, { stroke: _.axis })), l(e, ze(r + 10, i, "right")), l(e, T("Evolution", r + 6, i + 38, {
631
631
  "text-anchor": "end",
632
632
  "font-size": y.axis,
633
633
  fill: _.axisText,
634
634
  "font-style": "italic"
635
- })), l(e, k(t, i, t, n - 10, { stroke: _.axis })), l(e, Pe(t, n - 10, "up"));
636
- let o = A(this.yAxisLabel, 0, 0, {
635
+ })), l(e, w(t, i, t, n - 10, { stroke: _.axis })), l(e, ze(t, n - 10, "up"));
636
+ let o = T(this.yAxisLabel, 0, 0, {
637
637
  "text-anchor": "middle",
638
638
  "font-size": y.axis,
639
639
  fill: _.axisText,
640
640
  "font-style": "italic"
641
641
  });
642
- u(o, { transform: `translate(${t - 46}, ${(n + i) / 2}) rotate(-90)` }), l(e, o), l(e, A(this.yAxisEndLabels[1], t - 10, n + 11, {
642
+ u(o, { transform: `translate(${t - 46}, ${(n + i) / 2}) rotate(-90)` }), l(e, o), l(e, T(this.yAxisEndLabels[1], t - 10, n + 11, {
643
643
  "text-anchor": "end",
644
644
  "font-size": y.stage,
645
645
  fill: _.axisText
646
- })), l(e, A(this.yAxisEndLabels[0], t - 10, i - 2, {
646
+ })), l(e, T(this.yAxisEndLabels[0], t - 10, i - 2, {
647
647
  "text-anchor": "end",
648
648
  "font-size": y.stage,
649
649
  fill: _.axisText
650
650
  }));
651
651
  }
652
652
  };
653
- function Ne(e, t, n, r, i) {
653
+ function Re(e, t, n, r, i) {
654
654
  return u(f("rect"), {
655
655
  x: e,
656
656
  y: t,
@@ -660,7 +660,7 @@ function Ne(e, t, n, r, i) {
660
660
  ...i
661
661
  });
662
662
  }
663
- function k(e, t, n, r, i) {
663
+ function w(e, t, n, r, i) {
664
664
  return u(f("line"), {
665
665
  x1: e,
666
666
  y1: t,
@@ -670,7 +670,7 @@ function k(e, t, n, r, i) {
670
670
  ...i
671
671
  });
672
672
  }
673
- function A(e, t, n, r) {
673
+ function T(e, t, n, r) {
674
674
  let i = u(f("text"), {
675
675
  x: t,
676
676
  y: n,
@@ -679,7 +679,7 @@ function A(e, t, n, r) {
679
679
  });
680
680
  return i.textContent = e, i;
681
681
  }
682
- function Pe(e, t, n) {
682
+ function ze(e, t, n) {
683
683
  let r = n === "right" ? `${e - 5},${t - 5} ${e + 2},${t} ${e - 5},${t + 5}` : `${e - 5},${t + 5} ${e},${t - 2} ${e + 5},${t + 5}`;
684
684
  return u(f("polygon"), {
685
685
  points: r,
@@ -688,13 +688,13 @@ function Pe(e, t, n) {
688
688
  }
689
689
  //#endregion
690
690
  //#region src/evolution-grid/EvolutionConstraintBehavior.ts
691
- var Fe = [
691
+ var Be = [
692
692
  "shape.move",
693
693
  "shape.create",
694
694
  "shape.resize",
695
695
  "elements.move",
696
696
  "elements.create"
697
- ], Ie = class extends ee {
697
+ ], Ve = class extends ee {
698
698
  eventBus;
699
699
  grid;
700
700
  elementRegistry;
@@ -706,13 +706,13 @@ var Fe = [
706
706
  constructor(e, t, n) {
707
707
  super(e), this.eventBus = e, this.grid = t, this.elementRegistry = n;
708
708
  let r = (e) => this.syncAll(e.context);
709
- this.postExecuted(Fe, r), this.reverted(Fe, r);
709
+ this.postExecuted(Be, r), this.reverted(Be, r);
710
710
  let i = (e) => {
711
711
  if ([
712
712
  e.context?.shape,
713
713
  e.context?.element,
714
714
  ...e.context?.elements ?? []
715
- ].some((e) => T(e) && e.wardleyType === "component")) for (let e of this.elementRegistry.filter((e) => O(e))) this.eventBus.fire("element.changed", { element: e });
715
+ ].some((e) => x(e) && e.wardleyType === "component")) for (let e of this.elementRegistry.filter((e) => C(e))) this.eventBus.fire("element.changed", { element: e });
716
716
  };
717
717
  this.postExecuted([
718
718
  "shape.create",
@@ -731,7 +731,7 @@ var Fe = [
731
731
  ...e.shapes ?? [],
732
732
  ...e.elements ?? []
733
733
  ];
734
- for (let e of t) T(e) && this.syncFromGeometry(e);
734
+ for (let e of t) x(e) && this.syncFromGeometry(e);
735
735
  }
736
736
  syncFromGeometry(e) {
737
737
  let t = e.y + e.height / 2;
@@ -742,8 +742,8 @@ var Fe = [
742
742
  }), r = this.grid.fromCanvas({
743
743
  x: e.x + e.width,
744
744
  y: t
745
- }), [i, a] = ze(n.evolution, r.evolution);
746
- e.evolutionStart = i, e.evolutionEnd = a, e.evolution = Re((i + a) / 2), e.visibility = n.visibility;
745
+ }), [i, a] = We(n.evolution, r.evolution);
746
+ e.evolutionStart = i, e.evolutionEnd = a, e.evolution = Ue((i + a) / 2), e.visibility = n.visibility;
747
747
  let o = this.grid.toCanvas({
748
748
  visibility: e.visibility,
749
749
  evolution: i
@@ -779,14 +779,14 @@ var Fe = [
779
779
  (Math.abs(t - e.x) > .5 || Math.abs(n - e.y) > .5 || r !== void 0 && Math.abs(r - e.width) > .5 || i !== void 0 && Math.abs(i - e.height) > .5) && (e.x = t, e.y = n, r !== void 0 && (e.width = r), i !== void 0 && (e.height = i), this.fireChanged(e));
780
780
  }
781
781
  updateMembership(e) {
782
- let t = e.x + e.width / 2, n = e.y + e.height / 2, r = this.elementRegistry.filter((e) => O(e)).find((r) => r.wardleyLabel !== e.wardleyLabel && t >= r.x && t <= r.x + r.width && n >= r.y && n <= r.y + r.height);
782
+ let t = e.x + e.width / 2, n = e.y + e.height / 2, r = this.elementRegistry.filter((e) => C(e)).find((r) => r.wardleyLabel !== e.wardleyLabel && t >= r.x && t <= r.x + r.width && n >= r.y && n <= r.y + r.height);
783
783
  r ? (e.pipelineId = r.id, this.glueToPipeline(e, r)) : e.pipelineId && delete e.pipelineId;
784
784
  }
785
785
  glueToPipeline(e, t) {
786
786
  e.y = t.y + t.height / 2 - e.height / 2, e.visibility = t.visibility, this.fireChanged(e);
787
787
  }
788
788
  reconcileMembership(e) {
789
- let t = this.elementRegistry.filter((e) => T(e) && e.wardleyType === "component");
789
+ let t = this.elementRegistry.filter((e) => x(e) && e.wardleyType === "component");
790
790
  for (let n of t) {
791
791
  if (n.wardleyLabel === e.wardleyLabel) continue;
792
792
  let t = n.x + n.width / 2, r = n.y + n.height / 2, i = t >= e.x && t <= e.x + e.width && r >= e.y && r <= e.y + e.height;
@@ -805,22 +805,22 @@ var Fe = [
805
805
  this.eventBus.fire("element.changed", { element: e });
806
806
  for (let t of [...e.incoming ?? [], ...e.outgoing ?? []]) this.eventBus.fire("element.changed", { element: t });
807
807
  }
808
- }, Le = .001;
809
- function Re(e) {
808
+ }, He = .001;
809
+ function Ue(e) {
810
810
  return e < 0 ? 0 : e > 1 ? 1 : e;
811
811
  }
812
- function ze(e, t) {
813
- let n = Re(Math.max(t, e + Le));
814
- return [Math.max(0, Math.min(e, n - Le)), n];
812
+ function We(e, t) {
813
+ let n = Ue(Math.max(t, e + He));
814
+ return [Math.max(0, Math.min(e, n - He)), n];
815
815
  }
816
816
  //#endregion
817
817
  //#region src/evolution-grid/index.ts
818
- var j = { evolutionGrid: ["type", Me] }, Be = {
818
+ var E = { evolutionGrid: ["type", Le] }, Ge = {
819
819
  __init__: ["evolutionConstraintBehavior"],
820
- __depends__: [j],
821
- evolutionConstraintBehavior: ["type", Ie]
822
- }, M = "M12 12c2.21 0 4-1.79 4-4s-1.79-4-4-4-4 1.79-4 4 1.79 4 4 4zm0 2c-2.67 0-8 1.34-8 4v2h16v-2c0-2.66-5.33-4-8-4z", Ve = "M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm0 18c-4.42 0-8-3.58-8-8s3.58-8 8-8 8 3.58 8 8-3.58 8-8 8z", He = "M12 4l-1.41 1.41L16.17 11H4v2h12.17l-5.58 5.59L12 20l8-8z", Ue = "M15.5 5H11l5 7-5 7h4.5l5-7zM8.5 5H4l5 7-5 7h4.5l5-7z", N = "M3 17.25V21h3.75L17.81 9.94l-3.75-3.75L3 17.25zM20.71 7.04c.39-.39.39-1.02 0-1.41l-2.34-2.34c-.39-.39-1.02-.39-1.41 0l-1.83 1.83 3.75 3.75 1.83-1.83z", P = "M6 19c0 1.1.9 2 2 2h8c1.1 0 2-.9 2-2V7H6v12zM19 4h-3.5l-1-1h-5l-1 1H5v2h14V4z", We = "M19 6.41L17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12z", Ge = "M12.5 8c-2.65 0-5.05.99-6.9 2.6L2 7v9h9l-3.62-3.62c1.39-1.16 3.16-1.88 5.12-1.88 3.54 0 6.55 2.31 7.6 5.5l2.37-.78C21.08 11.03 17.15 8 12.5 8z", Ke = "M18.4 10.6C16.55 8.99 14.15 8 11.5 8c-4.65 0-8.58 3.03-9.96 7.22L3.9 16c1.05-3.19 4.05-5.5 7.6-5.5 1.95 0 3.73.72 5.12 1.88L13 16h9V7l-3.6 3.6z", qe = "M4 7v2c0 .55-.45 1-1 1H2v2h1c.55 0 1 .45 1 1v2c0 1.65 1.35 3 3 3h1v-2H7c-.55 0-1-.45-1-1v-2c0-.84-.35-1.61-.92-2.18L4.85 12l.23-.82C5.65 10.61 6 9.84 6 9V7c0-.55.45-1 1-1h1V4H7C5.35 4 4 5.35 4 7zm16 3c-.55 0-1-.45-1-1V7c0-1.65-1.35-3-3-3h-1v2h1c.55 0 1 .45 1 1v2c0 .84.35 1.61.92 2.18l.23.82-.23.82c-.57.57-.92 1.34-.92 2.18v2c0 .55-.45 1-1 1h-1v2h1c1.65 0 3-1.35 3-3v-2c0-.55.45-1 1-1h1v-2h-1z", Je = "M9.4 16.6L4.8 12l4.6-4.6L8 6l-6 6 6 6 1.4-1.4zm5.2 0l4.6-4.6-4.6-4.6L16 6l6 6-6 6-1.4-1.4z", Ye = "M19 9h-4V3H9v6H5l7 7 7-7zM5 18v2h14v-2H5z", Xe = "M18 16.08c-.76 0-1.44.3-1.96.77L8.91 12.7c.05-.23.09-.46.09-.7s-.04-.47-.09-.7l7.05-4.11c.54.5 1.25.81 2.04.81 1.66 0 3-1.34 3-3s-1.34-3-3-3-3 1.34-3 3c0 .24.04.47.09.7L8.04 9.81C7.5 9.31 6.79 9 6 9c-1.66 0-3 1.34-3 3s1.34 3 3 3c.79 0 1.5-.31 2.04-.81l7.12 4.16c-.05.21-.08.43-.08.65 0 1.61 1.31 2.92 2.92 2.92s2.92-1.31 2.92-2.92-1.31-2.92-2.92-2.92z", Ze = "M20 6h-8l-2-2H4c-1.1 0-1.99.9-1.99 2L2 18c0 1.1.9 2 2 2h16c1.1 0 2-.9 2-2V8c0-1.1-.9-2-2-2zm0 12H4V8h16v10z", Qe = "M21 19V5c0-1.1-.9-2-2-2H5c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2zM8.5 13.5l2.5 3.01L14.5 12l4.5 6H5l3.5-4.5z", $e = "M14 2H6c-1.1 0-1.99.9-1.99 2L4 20c0 1.1.89 2 1.99 2H18c1.1 0 2-.9 2-2V8l-6-6zm2 14h-3v3h-2v-3H8v-2h3v-3h2v3h3v2zm-3-7V3.5L18.5 9H13z", et = "M19.14 12.94c.04-.3.06-.61.06-.94 0-.32-.02-.64-.07-.94l2.03-1.58c.18-.14.23-.41.12-.61l-1.92-3.32c-.12-.22-.37-.29-.59-.22l-2.39.96c-.5-.38-1.03-.7-1.62-.94l-.36-2.54c-.04-.24-.24-.41-.48-.41h-3.84c-.24 0-.43.17-.47.41l-.36 2.54c-.59.24-1.13.57-1.62.94l-2.39-.96c-.22-.08-.47 0-.59.22L2.74 8.87c-.12.21-.08.47.12.61l2.03 1.58c-.05.3-.09.63-.09.94s.02.64.07.94l-2.03 1.58c-.18.14-.23.41-.12.61l1.92 3.32c.12.22.37.29.59.22l2.39-.96c.5.38 1.03.7 1.62.94l.36 2.54c.05.24.24.41.48.41h3.84c.24 0 .44-.17.47-.41l.36-2.54c.59-.24 1.13-.56 1.62-.94l2.39.96c.22.08.47 0 .59-.22l1.92-3.32c.12-.22.07-.47-.12-.61l-2.01-1.58zM12 15.6c-1.98 0-3.6-1.62-3.6-3.6s1.62-3.6 3.6-3.6 3.6 1.62 3.6 3.6-1.62 3.6-3.6 3.6z", tt = "M12 2C6.49 2 2 6.49 2 12s4.49 10 10 10c1.38 0 2.5-1.12 2.5-2.5 0-.61-.23-1.2-.64-1.67-.08-.1-.13-.21-.13-.33 0-.28.22-.5.5-.5H16c3.31 0 6-2.69 6-6 0-4.96-4.49-9-10-9zm-5.5 9c-.83 0-1.5-.67-1.5-1.5S5.67 8 6.5 8 8 8.67 8 9.5 7.33 11 6.5 11zm3-4C8.67 7 8 6.33 8 5.5S8.67 4 9.5 4s1.5.67 1.5 1.5S10.33 7 9.5 7zm5 0c-.83 0-1.5-.67-1.5-1.5S13.67 4 14.5 4s1.5.67 1.5 1.5S15.33 7 14.5 7zm3 4c-.83 0-1.5-.67-1.5-1.5S16.67 8 17.5 8s1.5.67 1.5 1.5-.67 1.5-1.5 1.5z", nt = "M4 18l8.5-6L4 6v12zm9-12v12l8.5-6L13 6z", rt = "M11 18V6l-8.5 6 8.5 6zm.5-6l8.5 6V6l-8.5 6z", it = "M6.99 11L3 15l3.99 4v-3H14v-2H6.99v-3zM21 9l-3.99-4v3H10v2h7.01v3L21 9z", at = "M19 12h-2v3h-3v2h5v-5zM7 9h3V7H5v5h2V9zm14-6H3c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h18c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2zm0 16.01H3V4.99h18v14.02z", ot = "M3 18h18v-2H3v2zm0-5h18v-2H3v2zm0-7v2h18V6H3z", st = "M19 13h-6v6h-2v-6H5v-2h6V5h2v6h6v2z", ct = "M12 4.5C7 4.5 2.73 7.61 1 12c1.73 4.39 6 7.5 11 7.5s9.27-3.11 11-7.5c-1.73-4.39-6-7.5-11-7.5zM12 17c-2.76 0-5-2.24-5-5s2.24-5 5-5 5 2.24 5 5-2.24 5-5 5zm0-8c-1.66 0-3 1.34-3 3s1.34 3 3 3 3-1.34 3-3-1.34-3-3-3z";
823
- function lt(e, t, n, r, i) {
820
+ __depends__: [E],
821
+ evolutionConstraintBehavior: ["type", Ve]
822
+ }, D = "M12 12c2.21 0 4-1.79 4-4s-1.79-4-4-4-4 1.79-4 4 1.79 4 4 4zm0 2c-2.67 0-8 1.34-8 4v2h16v-2c0-2.66-5.33-4-8-4z", Ke = "M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm0 18c-4.42 0-8-3.58-8-8s3.58-8 8-8 8 3.58 8 8-3.58 8-8 8z", qe = "M12 4l-1.41 1.41L16.17 11H4v2h12.17l-5.58 5.59L12 20l8-8z", Je = "M15.5 5H11l5 7-5 7h4.5l5-7zM8.5 5H4l5 7-5 7h4.5l5-7z", O = "M3 17.25V21h3.75L17.81 9.94l-3.75-3.75L3 17.25zM20.71 7.04c.39-.39.39-1.02 0-1.41l-2.34-2.34c-.39-.39-1.02-.39-1.41 0l-1.83 1.83 3.75 3.75 1.83-1.83z", k = "M6 19c0 1.1.9 2 2 2h8c1.1 0 2-.9 2-2V7H6v12zM19 4h-3.5l-1-1h-5l-1 1H5v2h14V4z", Ye = "M19 6.41L17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12z", Xe = "M12.5 8c-2.65 0-5.05.99-6.9 2.6L2 7v9h9l-3.62-3.62c1.39-1.16 3.16-1.88 5.12-1.88 3.54 0 6.55 2.31 7.6 5.5l2.37-.78C21.08 11.03 17.15 8 12.5 8z", Ze = "M18.4 10.6C16.55 8.99 14.15 8 11.5 8c-4.65 0-8.58 3.03-9.96 7.22L3.9 16c1.05-3.19 4.05-5.5 7.6-5.5 1.95 0 3.73.72 5.12 1.88L13 16h9V7l-3.6 3.6z", Qe = "M4 7v2c0 .55-.45 1-1 1H2v2h1c.55 0 1 .45 1 1v2c0 1.65 1.35 3 3 3h1v-2H7c-.55 0-1-.45-1-1v-2c0-.84-.35-1.61-.92-2.18L4.85 12l.23-.82C5.65 10.61 6 9.84 6 9V7c0-.55.45-1 1-1h1V4H7C5.35 4 4 5.35 4 7zm16 3c-.55 0-1-.45-1-1V7c0-1.65-1.35-3-3-3h-1v2h1c.55 0 1 .45 1 1v2c0 .84.35 1.61.92 2.18l.23.82-.23.82c-.57.57-.92 1.34-.92 2.18v2c0 .55-.45 1-1 1h-1v2h1c1.65 0 3-1.35 3-3v-2c0-.55.45-1 1-1h1v-2h-1z", $e = "M9.4 16.6L4.8 12l4.6-4.6L8 6l-6 6 6 6 1.4-1.4zm5.2 0l4.6-4.6-4.6-4.6L16 6l6 6-6 6-1.4-1.4z", et = "M19 9h-4V3H9v6H5l7 7 7-7zM5 18v2h14v-2H5z", tt = "M18 16.08c-.76 0-1.44.3-1.96.77L8.91 12.7c.05-.23.09-.46.09-.7s-.04-.47-.09-.7l7.05-4.11c.54.5 1.25.81 2.04.81 1.66 0 3-1.34 3-3s-1.34-3-3-3-3 1.34-3 3c0 .24.04.47.09.7L8.04 9.81C7.5 9.31 6.79 9 6 9c-1.66 0-3 1.34-3 3s1.34 3 3 3c.79 0 1.5-.31 2.04-.81l7.12 4.16c-.05.21-.08.43-.08.65 0 1.61 1.31 2.92 2.92 2.92s2.92-1.31 2.92-2.92-1.31-2.92-2.92-2.92z", nt = "M20 6h-8l-2-2H4c-1.1 0-1.99.9-1.99 2L2 18c0 1.1.9 2 2 2h16c1.1 0 2-.9 2-2V8c0-1.1-.9-2-2-2zm0 12H4V8h16v10z", rt = "M21 19V5c0-1.1-.9-2-2-2H5c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2zM8.5 13.5l2.5 3.01L14.5 12l4.5 6H5l3.5-4.5z", it = "M14 2H6c-1.1 0-1.99.9-1.99 2L4 20c0 1.1.89 2 1.99 2H18c1.1 0 2-.9 2-2V8l-6-6zm2 14h-3v3h-2v-3H8v-2h3v-3h2v3h3v2zm-3-7V3.5L18.5 9H13z", at = "M19.14 12.94c.04-.3.06-.61.06-.94 0-.32-.02-.64-.07-.94l2.03-1.58c.18-.14.23-.41.12-.61l-1.92-3.32c-.12-.22-.37-.29-.59-.22l-2.39.96c-.5-.38-1.03-.7-1.62-.94l-.36-2.54c-.04-.24-.24-.41-.48-.41h-3.84c-.24 0-.43.17-.47.41l-.36 2.54c-.59.24-1.13.57-1.62.94l-2.39-.96c-.22-.08-.47 0-.59.22L2.74 8.87c-.12.21-.08.47.12.61l2.03 1.58c-.05.3-.09.63-.09.94s.02.64.07.94l-2.03 1.58c-.18.14-.23.41-.12.61l1.92 3.32c.12.22.37.29.59.22l2.39-.96c.5.38 1.03.7 1.62.94l.36 2.54c.05.24.24.41.48.41h3.84c.24 0 .44-.17.47-.41l.36-2.54c.59-.24 1.13-.56 1.62-.94l2.39.96c.22.08.47 0 .59-.22l1.92-3.32c.12-.22.07-.47-.12-.61l-2.01-1.58zM12 15.6c-1.98 0-3.6-1.62-3.6-3.6s1.62-3.6 3.6-3.6 3.6 1.62 3.6 3.6-1.62 3.6-3.6 3.6z", ot = "M12 2C6.49 2 2 6.49 2 12s4.49 10 10 10c1.38 0 2.5-1.12 2.5-2.5 0-.61-.23-1.2-.64-1.67-.08-.1-.13-.21-.13-.33 0-.28.22-.5.5-.5H16c3.31 0 6-2.69 6-6 0-4.96-4.49-9-10-9zm-5.5 9c-.83 0-1.5-.67-1.5-1.5S5.67 8 6.5 8 8 8.67 8 9.5 7.33 11 6.5 11zm3-4C8.67 7 8 6.33 8 5.5S8.67 4 9.5 4s1.5.67 1.5 1.5S10.33 7 9.5 7zm5 0c-.83 0-1.5-.67-1.5-1.5S13.67 4 14.5 4s1.5.67 1.5 1.5S15.33 7 14.5 7zm3 4c-.83 0-1.5-.67-1.5-1.5S16.67 8 17.5 8s1.5.67 1.5 1.5-.67 1.5-1.5 1.5z", A = "M4 18l8.5-6L4 6v12zm9-12v12l8.5-6L13 6z", j = "M11 18V6l-8.5 6 8.5 6zm.5-6l8.5 6V6l-8.5 6z", st = "M6.99 11L3 15l3.99 4v-3H14v-2H6.99v-3zM21 9l-3.99-4v3H10v2h7.01v3L21 9z", ct = "M19 12h-2v3h-3v2h5v-5zM7 9h3V7H5v5h2V9zm14-6H3c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h18c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2zm0 16.01H3V4.99h18v14.02z", lt = "M3 18h18v-2H3v2zm0-5h18v-2H3v2zm0-7v2h18V6H3z", ut = "M19 13h-6v6h-2v-6H5v-2h6V5h2v6h6v2z", dt = "M12 4.5C7 4.5 2.73 7.61 1 12c1.73 4.39 6 7.5 11 7.5s9.27-3.11 11-7.5c-1.73-4.39-6-7.5-11-7.5zM12 17c-2.76 0-5-2.24-5-5s2.24-5 5-5 5 2.24 5 5-2.24 5-5 5zm0-8c-1.66 0-3 1.34-3 3s1.34 3 3 3 3-1.34 3-3-1.34-3-3-3z";
823
+ function M(e, t, n, r, i) {
824
824
  let a = f("g"), o = r / 24;
825
825
  return u(a, {
826
826
  transform: `translate(${t - r / 2}, ${n - r / 2}) scale(${o})`,
@@ -828,12 +828,12 @@ function lt(e, t, n, r, i) {
828
828
  stroke: "none"
829
829
  }), l(a, u(f("path"), { d: e })), a;
830
830
  }
831
- function ut(e, t = 18) {
831
+ function N(e, t = 18) {
832
832
  return `<svg viewBox="0 0 24 24" width="${t}" height="${t}" fill="currentColor" aria-hidden="true"><path d="${e}"/></svg>`;
833
833
  }
834
834
  //#endregion
835
835
  //#region src/draw/WardleyRenderer.ts
836
- var dt = 1500, ft = class extends te {
836
+ var ft = 1500, P = class extends te {
837
837
  grid;
838
838
  elementRegistry;
839
839
  static $inject = [
@@ -842,10 +842,10 @@ var dt = 1500, ft = class extends te {
842
842
  "elementRegistry"
843
843
  ];
844
844
  constructor(e, t, n) {
845
- super(e, dt), this.grid = t, this.elementRegistry = n;
845
+ super(e, ft), this.grid = t, this.elementRegistry = n;
846
846
  }
847
847
  canRender(e) {
848
- return T(e) || E(e);
848
+ return x(e) || S(e);
849
849
  }
850
850
  drawShape(e, t) {
851
851
  let n = t;
@@ -874,7 +874,7 @@ var dt = 1500, ft = class extends te {
874
874
  return l(e, i), i;
875
875
  }
876
876
  drawConnection(e, t) {
877
- let n = t, r = n.wardleyType === "flow", i = r ? _.flow : _.dependency, [a, o] = gt(n), s = u(f("polyline"), {
877
+ let n = t, r = n.wardleyType === "flow", i = r ? _.flow : _.dependency, [a, o] = yt(n), s = u(f("polyline"), {
878
878
  points: `${a.x},${a.y} ${o.x},${o.y}`,
879
879
  fill: "none",
880
880
  stroke: i,
@@ -903,77 +903,54 @@ var dt = 1500, ft = class extends te {
903
903
  return t ? `M${t.x},${t.y}` + n.map((e) => `L${e.x},${e.y}`).join("") : "";
904
904
  }
905
905
  drawComponent(e, t) {
906
- let n = t.width / 2, r = t.height / 2, i = !!t.movement, a = t.decorators;
907
- if (t.movement) {
908
- let i = t.movement, a = this.grid.toCanvas({
909
- visibility: t.visibility,
910
- evolution: t.evolution
911
- }), o = this.grid.toCanvas({
912
- visibility: t.visibility,
913
- evolution: i.targetEvolution
914
- }).x - a.x, s = n + o, c = s - (Math.sign(o) || 1) * 17;
915
- l(e, pt(n, r, c, r, {
916
- stroke: _.movement,
917
- "stroke-width": 1.5,
918
- "stroke-dasharray": "6 4"
919
- })), l(e, L({
920
- x: n,
921
- y: r
922
- }, {
923
- x: c,
924
- y: r
925
- }, _.movement)), l(e, F(s, r, 15, {
926
- fill: _.paper,
927
- stroke: _.movement,
928
- "stroke-width": 2,
929
- class: "wardley-evolve-handle"
930
- })), l(e, I(i.newLabel ?? t.wardleyLabel, s + 15 + 7, r - 4, {
931
- "font-weight": "500",
932
- fill: _.movement
933
- })), i.method && l(e, I(i.method, s + 15 + 7, r + 11, {
934
- "font-size": 10.5,
935
- fill: _.movement
936
- }));
937
- }
938
- if (a?.inertia) {
939
- let t = n + 15 + 3;
940
- l(e, pt(t, r - 13, t, r + 13, {
941
- stroke: _.inertia,
942
- "stroke-width": 3,
943
- "stroke-linecap": "round"
944
- }));
945
- }
946
- let o = t.color ?? _.stroke, s = F(n, r, 15, {
906
+ let n = t.width / 2, r = t.height / 2, i = t.decorators;
907
+ t.movement && this.drawMovement(e, t, n, r), i?.inertia && pt(e, n, r);
908
+ let a = t.color ?? _.stroke, o = F(n, r, 15, {
947
909
  fill: _.componentFill,
948
- stroke: o,
910
+ stroke: a,
949
911
  "stroke-width": 2
950
912
  });
951
- if (l(e, s), i && l(e, F(n, r, 12, {
913
+ return l(e, o), t.movement && l(e, F(n, r, 12, {
952
914
  fill: "none",
953
- stroke: o,
915
+ stroke: a,
954
916
  "stroke-width": 1.5
955
- })), a?.ecosystem && l(e, F(n, r, 18.5, {
956
- fill: "none",
957
- stroke: o,
958
- "stroke-width": 1.25,
959
- "stroke-dasharray": "1.5 3",
960
- "stroke-linecap": "round"
961
- })), a?.market) for (let [t, i] of [
962
- [0, -3.8],
963
- [-3.4, 2.4],
964
- [3.4, 2.4]
965
- ]) l(e, F(n + t, r + i, 1.7, { fill: o }));
966
- let c = n + 15 + 7 + (t.labelOffset?.dx ?? 0), u = r - 4 + (t.labelOffset?.dy ?? 0);
967
- return l(e, I(t.wardleyLabel, c, u, {
917
+ })), mt(e, n, r, a, i), ht(e, t, n, r), o;
918
+ }
919
+ drawMovement(e, t, n, r) {
920
+ let i = t.movement;
921
+ if (!i) return;
922
+ let a = this.grid.toCanvas({
923
+ visibility: t.visibility,
924
+ evolution: t.evolution
925
+ }), o = this.grid.toCanvas({
926
+ visibility: t.visibility,
927
+ evolution: i.targetEvolution
928
+ }).x - a.x, s = n + o, c = s - (Math.sign(o) || 1) * 17;
929
+ l(e, gt(n, r, c, r, {
930
+ stroke: _.movement,
931
+ "stroke-width": 1.5,
932
+ "stroke-dasharray": "6 4"
933
+ })), l(e, L({
934
+ x: n,
935
+ y: r
936
+ }, {
937
+ x: c,
938
+ y: r
939
+ }, _.movement)), l(e, F(s, r, 15, {
940
+ fill: _.paper,
941
+ stroke: _.movement,
942
+ "stroke-width": 2,
943
+ class: "wardley-evolve-handle"
944
+ })), l(e, I(i.newLabel ?? t.wardleyLabel, s + 15 + 7, r - 4, {
968
945
  "font-weight": "500",
969
- ...t.color ? { fill: t.color } : {}
970
- })), a?.method && l(e, I(a.method, c, u + 15, {
946
+ fill: _.movement
947
+ })), i.method && l(e, I(i.method, s + 15 + 7, r + 11, {
971
948
  "font-size": 10.5,
972
- fill: _.axisText
973
- })), s;
949
+ fill: _.movement
950
+ }));
974
951
  }
975
952
  drawAnchor(e, t) {
976
- let n = t.width / 2, r = t.height / 2, i = lt(M, n, r, 26, t.color ?? _.ink);
953
+ let n = t.width / 2, r = t.height / 2, i = M(D, n, r, 26, t.color ?? _.ink);
977
954
  return l(e, i), l(e, I(t.wardleyLabel, n + (t.labelOffset?.dx ?? 0), r - 26 / 2 - 4 + (t.labelOffset?.dy ?? 0), {
978
955
  "text-anchor": "middle",
979
956
  "font-weight": "700",
@@ -992,7 +969,7 @@ var dt = 1500, ft = class extends te {
992
969
  "stroke-width": 1.25,
993
970
  "stroke-dasharray": "6 3"
994
971
  });
995
- return l(e, i), !this.elementRegistry.filter((e) => T(e) && e.wardleyType === "component").some((e) => e.wardleyLabel === t.wardleyLabel) && (l(e, u(f("rect"), {
972
+ return l(e, i), !this.elementRegistry.filter((e) => x(e) && e.wardleyType === "component").some((e) => e.wardleyLabel === t.wardleyLabel) && (l(e, u(f("rect"), {
996
973
  x: n / 2 - 8,
997
974
  y: -8,
998
975
  width: 16,
@@ -1029,7 +1006,7 @@ var dt = 1500, ft = class extends te {
1029
1006
  "stroke-width": 1.25,
1030
1007
  "stroke-dasharray": "5 4"
1031
1008
  });
1032
- return l(e, i), l(e, I(t.wardleyLabel && t.wardleyLabel !== t.attitudeKind ? t.wardleyLabel : _t(t.attitudeKind ?? "pioneers"), 10, 18, {
1009
+ return l(e, i), l(e, I(t.wardleyLabel && t.wardleyLabel !== t.attitudeKind ? t.wardleyLabel : bt(t.attitudeKind ?? "pioneers"), 10, 18, {
1033
1010
  fill: r,
1034
1011
  "font-weight": "700",
1035
1012
  "letter-spacing": "0.04em"
@@ -1051,7 +1028,7 @@ var dt = 1500, ft = class extends te {
1051
1028
  })), i;
1052
1029
  }
1053
1030
  drawAccelerator(e, t) {
1054
- let n = t.width / 2, r = t.height / 2, i = t.acceleratorDirection !== "deaccelerate", a = lt(i ? nt : rt, n, r, 24, t.color ?? (i ? _.accelerator : _.deaccelerator));
1031
+ let n = t.width / 2, r = t.height / 2, i = t.acceleratorDirection !== "deaccelerate", a = M(i ? A : j, n, r, 24, t.color ?? (i ? _.accelerator : _.deaccelerator));
1055
1032
  return l(e, a), t.wardleyLabel && l(e, I(t.wardleyLabel, n + 15, r + 5, { "font-size": 12 })), a;
1056
1033
  }
1057
1034
  drawSubmap(e, t) {
@@ -1080,6 +1057,37 @@ var dt = 1500, ft = class extends te {
1080
1057
  })), a;
1081
1058
  }
1082
1059
  };
1060
+ function pt(e, t, n) {
1061
+ let r = t + 15 + 3;
1062
+ l(e, gt(r, n - 13, r, n + 13, {
1063
+ stroke: _.inertia,
1064
+ "stroke-width": 3,
1065
+ "stroke-linecap": "round"
1066
+ }));
1067
+ }
1068
+ function mt(e, t, n, r, i) {
1069
+ if (i?.ecosystem && l(e, F(t, n, 18.5, {
1070
+ fill: "none",
1071
+ stroke: r,
1072
+ "stroke-width": 1.25,
1073
+ "stroke-dasharray": "1.5 3",
1074
+ "stroke-linecap": "round"
1075
+ })), i?.market) for (let [i, a] of [
1076
+ [0, -3.8],
1077
+ [-3.4, 2.4],
1078
+ [3.4, 2.4]
1079
+ ]) l(e, F(t + i, n + a, 1.7, { fill: r }));
1080
+ }
1081
+ function ht(e, t, n, r) {
1082
+ let i = t.decorators, a = n + 15 + 7 + (t.labelOffset?.dx ?? 0), o = r - 4 + (t.labelOffset?.dy ?? 0);
1083
+ l(e, I(t.wardleyLabel, a, o, {
1084
+ "font-weight": "500",
1085
+ ...t.color ? { fill: t.color } : {}
1086
+ })), i?.method && l(e, I(i.method, a, o + 15, {
1087
+ "font-size": 10.5,
1088
+ fill: _.axisText
1089
+ }));
1090
+ }
1083
1091
  function F(e, t, n, r) {
1084
1092
  return u(f("circle"), {
1085
1093
  cx: e,
@@ -1089,7 +1097,7 @@ function F(e, t, n, r) {
1089
1097
  ...r
1090
1098
  });
1091
1099
  }
1092
- function pt(e, t, n, r, i) {
1100
+ function gt(e, t, n, r, i) {
1093
1101
  return u(f("line"), {
1094
1102
  x1: e,
1095
1103
  y1: t,
@@ -1122,10 +1130,10 @@ function L(e, t, n, r = 10, i = 5) {
1122
1130
  fill: n
1123
1131
  });
1124
1132
  }
1125
- function mt(e) {
1133
+ function _t(e) {
1126
1134
  return e.wardleyType === "component" ? 17 : e.wardleyType === "anchor" ? 14 : e.wardleyType === "pipeline" ? 10 : Math.min(e.width, e.height) / 2;
1127
1135
  }
1128
- function ht(e) {
1136
+ function vt(e) {
1129
1137
  return e.wardleyType === "pipeline" ? {
1130
1138
  x: e.x + e.width / 2,
1131
1139
  y: e.y
@@ -1134,7 +1142,7 @@ function ht(e) {
1134
1142
  y: e.y + e.height / 2
1135
1143
  };
1136
1144
  }
1137
- function gt(e) {
1145
+ function yt(e) {
1138
1146
  let t = e.source, n = e.target, r = e.waypoints;
1139
1147
  if (!t || !n) {
1140
1148
  let e = r[0] ?? {
@@ -1143,7 +1151,7 @@ function gt(e) {
1143
1151
  };
1144
1152
  return [e, r[r.length - 1] ?? e];
1145
1153
  }
1146
- let i = ht(t), a = ht(n), o = a.x - i.x, s = a.y - i.y, c = Math.hypot(o, s) || 1, l = o / c, u = s / c, d = mt(t), f = mt(n);
1154
+ let i = vt(t), a = vt(n), o = a.x - i.x, s = a.y - i.y, c = Math.hypot(o, s) || 1, l = o / c, u = s / c, d = _t(t), f = _t(n);
1147
1155
  return c <= d + f + 2 ? [i, a] : [{
1148
1156
  x: i.x + l * d,
1149
1157
  y: i.y + u * d
@@ -1152,15 +1160,15 @@ function gt(e) {
1152
1160
  y: a.y - u * f
1153
1161
  }];
1154
1162
  }
1155
- function _t(e) {
1163
+ function bt(e) {
1156
1164
  return e && e.charAt(0).toUpperCase() + e.slice(1);
1157
1165
  }
1158
1166
  //#endregion
1159
1167
  //#region src/draw/index.ts
1160
- var vt = {
1168
+ var xt = {
1161
1169
  __init__: ["wardleyRenderer"],
1162
- wardleyRenderer: ["type", ft]
1163
- }, yt = /* @__PURE__ */ new Set(["attitude", "pipeline"]), bt = {
1170
+ wardleyRenderer: ["type", P]
1171
+ }, St = /* @__PURE__ */ new Set(["attitude", "pipeline"]), Ct = {
1164
1172
  attitude: 0,
1165
1173
  pipeline: 1,
1166
1174
  note: 2,
@@ -1169,7 +1177,7 @@ var vt = {
1169
1177
  annotation: 5,
1170
1178
  submap: 3,
1171
1179
  accelerator: 3
1172
- }, xt = class {
1180
+ }, wt = class {
1173
1181
  canvas;
1174
1182
  elementFactory;
1175
1183
  factory;
@@ -1201,7 +1209,7 @@ var vt = {
1201
1209
  }
1202
1210
  let i;
1203
1211
  r && r.id === "wardley-root" ? i = r : (i = this.elementFactory.createRoot({ id: De }), this.canvas.setRootElement(i)), i.businessObject = n, this.grid.render();
1204
- let a = /* @__PURE__ */ new Map(), o = [...e.elements].sort((e, t) => (bt[e.elementType] ?? 9) - (bt[t.elementType] ?? 9)), s = o.filter((e) => yt.has(e.elementType)), c = o.filter((e) => !yt.has(e.elementType)), l = 0;
1212
+ let a = /* @__PURE__ */ new Map(), o = [...e.elements].sort((e, t) => (Ct[e.elementType] ?? 9) - (Ct[t.elementType] ?? 9)), s = o.filter((e) => St.has(e.elementType)), c = o.filter((e) => !St.has(e.elementType)), l = 0;
1205
1213
  for (let e of s) {
1206
1214
  let t = this.createShape(e);
1207
1215
  t && (this.canvas.addShape(t, i), a.set(e.id, t), l++);
@@ -1258,7 +1266,7 @@ function R(e) {
1258
1266
  for (let [n, r] of Object.entries(e)) r !== void 0 && (t[n] = r);
1259
1267
  return t;
1260
1268
  }
1261
- var St = class {
1269
+ var Tt = class {
1262
1270
  elementRegistry;
1263
1271
  canvas;
1264
1272
  grid;
@@ -1273,7 +1281,7 @@ var St = class {
1273
1281
  export() {
1274
1282
  let e = this.canvas.getRootElement().businessObject, t = e?.config ?? { title: "Untitled Map" }, n = [], i = [];
1275
1283
  for (let e of this.elementRegistry.getAll()) if (e.id !== "wardley-root") {
1276
- if (E(e)) if (e.businessObject) i.push(e.businessObject);
1284
+ if (S(e)) if (e.businessObject) i.push(e.businessObject);
1277
1285
  else {
1278
1286
  let t = {
1279
1287
  id: e.id,
@@ -1289,7 +1297,7 @@ var St = class {
1289
1297
  edgeType: "dependency"
1290
1298
  });
1291
1299
  }
1292
- else if (T(e)) {
1300
+ else if (x(e)) {
1293
1301
  let t = this.buildElement(e);
1294
1302
  t && n.push(t);
1295
1303
  }
@@ -1423,23 +1431,23 @@ var St = class {
1423
1431
  } : void 0;
1424
1432
  }
1425
1433
  }
1426
- }, Ct = {
1427
- wardleyImporter: ["type", xt],
1428
- wardleyExporter: ["type", St]
1429
- }, wt = class extends x {
1434
+ }, Et = {
1435
+ wardleyImporter: ["type", wt],
1436
+ wardleyExporter: ["type", Tt]
1437
+ }, Dt = class extends ke {
1430
1438
  _getModules() {
1431
1439
  return [
1432
- ke,
1433
- j,
1434
- vt,
1435
- Ct
1440
+ Pe,
1441
+ E,
1442
+ xt,
1443
+ Et
1436
1444
  ];
1437
1445
  }
1438
- }, Tt = 180, Et = 80, Dt = 120, Ot = .5, kt = (e, t, n) => e < t ? t : e > n ? n : e;
1439
- function At(e, t, n, r) {
1440
- return t <= r ? kt(e, n, n + r - t) : n + r / 2 - t / 2;
1446
+ }, Ot = 180, kt = 80, At = 120, jt = .5, Mt = (e, t, n) => e < t ? t : e > n ? n : e;
1447
+ function Nt(e, t, n, r) {
1448
+ return t <= r ? Mt(e, n, n + r - t) : n + r / 2 - t / 2;
1441
1449
  }
1442
- var jt = class {
1450
+ var Pt = class {
1443
1451
  canvas;
1444
1452
  grid;
1445
1453
  static $inject = [
@@ -1456,8 +1464,8 @@ var jt = class {
1456
1464
  constrain(e) {
1457
1465
  let t = e ?? this.canvas.viewbox(), n = this.grid.outerBounds();
1458
1466
  if (!(n.width > 0) || !(n.height > 0) || !(t.width > 0) || !(t.height > 0)) return;
1459
- let r = At(t.x, t.width, n.x - Dt, n.width + 2 * Dt), i = At(t.y, t.height, n.y - Tt, n.height + Tt + Et);
1460
- if (!(Math.abs(r - t.x) < Ot && Math.abs(i - t.y) < Ot)) {
1467
+ let r = Nt(t.x, t.width, n.x - At, n.width + 2 * At), i = Nt(t.y, t.height, n.y - Ot, n.height + Ot + kt);
1468
+ if (!(Math.abs(r - t.x) < jt && Math.abs(i - t.y) < jt)) {
1461
1469
  this.applying = !0;
1462
1470
  try {
1463
1471
  this.canvas.viewbox({
@@ -1471,10 +1479,10 @@ var jt = class {
1471
1479
  }
1472
1480
  }
1473
1481
  }
1474
- }, Mt = {
1482
+ }, Ft = {
1475
1483
  __init__: ["panConstraint"],
1476
- panConstraint: ["type", jt]
1477
- }, Nt = class extends wt {
1484
+ panConstraint: ["type", Pt]
1485
+ }, It = class extends Dt {
1478
1486
  _getModules() {
1479
1487
  return [
1480
1488
  ...super._getModules(),
@@ -1482,40 +1490,40 @@ var jt = class {
1482
1490
  re,
1483
1491
  ie,
1484
1492
  ae,
1485
- Mt
1493
+ Ft
1486
1494
  ];
1487
1495
  }
1488
1496
  };
1489
1497
  //#endregion
1490
1498
  //#region src/modeling/cmd/UpdatePropertiesHandler.ts
1491
- function Pt(e, t, n) {
1499
+ function Lt(e, t, n) {
1492
1500
  n === void 0 ? delete e[t] : e[t] = n;
1493
1501
  }
1494
- var Ft = class {
1502
+ var Rt = class {
1495
1503
  execute(e) {
1496
1504
  let { element: t, properties: n } = e, r = t, i = {};
1497
- for (let e of Object.keys(n)) i[e] = r[e], Pt(r, e, n[e]);
1505
+ for (let e of Object.keys(n)) i[e] = r[e], Lt(r, e, n[e]);
1498
1506
  return e.oldProperties = i, [t];
1499
1507
  }
1500
1508
  revert(e) {
1501
1509
  let { element: t, oldProperties: n } = e, r = t;
1502
- if (n) for (let e of Object.keys(n)) Pt(r, e, n[e]);
1510
+ if (n) for (let e of Object.keys(n)) Lt(r, e, n[e]);
1503
1511
  return [t];
1504
1512
  }
1505
- }, It = "element.updateProperties";
1506
- function Lt(e) {
1513
+ }, zt = "element.updateProperties";
1514
+ function Bt(e) {
1507
1515
  let t = {};
1508
1516
  for (let [n, r] of Object.entries(e)) r !== void 0 && (t[n] = r);
1509
1517
  return t;
1510
1518
  }
1511
- var Rt = class {
1519
+ var Vt = class {
1512
1520
  commandStack;
1513
1521
  static $inject = ["commandStack"];
1514
1522
  constructor(e) {
1515
- this.commandStack = e, e.registerHandler(It, Ft);
1523
+ this.commandStack = e, e.registerHandler(zt, Rt);
1516
1524
  }
1517
1525
  updateProperties(e, t) {
1518
- this.commandStack.execute(It, {
1526
+ this.commandStack.execute(zt, {
1519
1527
  element: e,
1520
1528
  properties: t
1521
1529
  });
@@ -1535,8 +1543,8 @@ var Rt = class {
1535
1543
  this.updateProperties(e, { wardleyLabel: t });
1536
1544
  }
1537
1545
  evolveComponent(e, t, n = {}) {
1538
- let r = zt(t);
1539
- r <= e.evolution || this.updateProperties(e, { movement: Lt({
1546
+ let r = Ht(t);
1547
+ r <= e.evolution || this.updateProperties(e, { movement: Bt({
1540
1548
  targetEvolution: r,
1541
1549
  newLabel: n.newLabel,
1542
1550
  method: n.method
@@ -1561,12 +1569,12 @@ var Rt = class {
1561
1569
  this.updateProperties(e, { color: t });
1562
1570
  }
1563
1571
  };
1564
- function zt(e) {
1572
+ function Ht(e) {
1565
1573
  return e < 0 ? 0 : e > 1 ? 1 : e;
1566
1574
  }
1567
1575
  //#endregion
1568
1576
  //#region src/modeling/WardleyCopyPaste.ts
1569
- var Bt = 24, Vt = [
1577
+ var Ut = 24, Wt = [
1570
1578
  "wardleyType",
1571
1579
  "evolution",
1572
1580
  "visibility",
@@ -1583,13 +1591,13 @@ var Bt = 24, Vt = [
1583
1591
  "drawingPoints",
1584
1592
  "closed",
1585
1593
  "strokeStyle"
1586
- ], Ht = [
1594
+ ], Gt = [
1587
1595
  "wardleyType",
1588
1596
  "bidirectional",
1589
1597
  "flowValue",
1590
1598
  "linkLabel"
1591
1599
  ];
1592
- function Ut(e, t) {
1600
+ function Kt(e, t) {
1593
1601
  let n = {};
1594
1602
  for (let r of t) {
1595
1603
  let t = e[r];
@@ -1597,7 +1605,7 @@ function Ut(e, t) {
1597
1605
  }
1598
1606
  return n;
1599
1607
  }
1600
- var Wt = class {
1608
+ var qt = class {
1601
1609
  selection;
1602
1610
  modeling;
1603
1611
  elementFactory;
@@ -1620,21 +1628,21 @@ var Wt = class {
1620
1628
  this.selection = e, this.modeling = t, this.elementFactory = n, this.elementRegistry = r, this.canvas = i, this.create = a, this.mouse = o;
1621
1629
  }
1622
1630
  copy() {
1623
- let e = this.selection.get().filter((e) => T(e));
1631
+ let e = this.selection.get().filter((e) => x(e));
1624
1632
  if (!e.length) return !1;
1625
1633
  let t = new Map(e.map((e, t) => [e, t])), n = [], r = /* @__PURE__ */ new Set();
1626
1634
  for (let i of e) for (let e of [...i.incoming ?? [], ...i.outgoing ?? []]) {
1627
- if (!E(e) || r.has(e)) continue;
1635
+ if (!S(e) || r.has(e)) continue;
1628
1636
  let i = t.get(e.source), a = t.get(e.target);
1629
1637
  i === void 0 || a === void 0 || (r.add(e), n.push({
1630
1638
  sourceIdx: i,
1631
1639
  targetIdx: a,
1632
- props: Ut(e, Ht)
1640
+ props: Kt(e, Gt)
1633
1641
  }));
1634
1642
  }
1635
1643
  return this.clipboard = {
1636
1644
  shapes: e.map((e) => ({
1637
- props: Ut(e, Vt),
1645
+ props: Kt(e, Wt),
1638
1646
  x: e.x,
1639
1647
  y: e.y,
1640
1648
  width: e.width,
@@ -1668,13 +1676,13 @@ var Wt = class {
1668
1676
  ...structuredClone(e.props),
1669
1677
  source: n[e.sourceIdx],
1670
1678
  target: n[e.targetIdx],
1671
- waypoints: [Gt(n[e.sourceIdx]), Gt(n[e.targetIdx])]
1679
+ waypoints: [Jt(n[e.sourceIdx]), Jt(n[e.targetIdx])]
1672
1680
  }))
1673
1681
  };
1674
1682
  }
1675
1683
  insertWithOffset(e) {
1676
1684
  this.pasteCount++;
1677
- let t = Bt * this.pasteCount, n = Kt(e.shapes), r = this.modeling.createElements([...e.shapes, ...e.connections], {
1685
+ let t = Ut * this.pasteCount, n = Yt(e.shapes), r = this.modeling.createElements([...e.shapes, ...e.connections], {
1678
1686
  x: n.cx + t,
1679
1687
  y: n.cy + t
1680
1688
  }, this.canvas.getRootElement());
@@ -1693,13 +1701,13 @@ var Wt = class {
1693
1701
  });
1694
1702
  }
1695
1703
  };
1696
- function Gt(e) {
1704
+ function Jt(e) {
1697
1705
  return {
1698
1706
  x: e.x + e.width / 2,
1699
1707
  y: e.y + e.height / 2
1700
1708
  };
1701
1709
  }
1702
- function Kt(e) {
1710
+ function Yt(e) {
1703
1711
  let t = Math.min(...e.map((e) => e.x)), n = Math.min(...e.map((e) => e.y)), r = Math.max(...e.map((e) => e.x + e.width)), i = Math.max(...e.map((e) => e.y + e.height));
1704
1712
  return {
1705
1713
  cx: (t + r) / 2,
@@ -1708,12 +1716,12 @@ function Kt(e) {
1708
1716
  }
1709
1717
  //#endregion
1710
1718
  //#region src/modeling/index.ts
1711
- var qt = {
1719
+ var Xt = {
1712
1720
  __depends__: [ge, ce],
1713
1721
  __init__: ["wardleyModeling"],
1714
- wardleyModeling: ["type", Rt],
1715
- wardleyCopyPaste: ["type", Wt]
1716
- }, Jt = {
1722
+ wardleyModeling: ["type", Vt],
1723
+ wardleyCopyPaste: ["type", qt]
1724
+ }, Zt = {
1717
1725
  __depends__: [_e],
1718
1726
  __init__: ["wardleyLassoBehavior"],
1719
1727
  wardleyLassoBehavior: ["type", class {
@@ -1736,19 +1744,19 @@ var qt = {
1736
1744
  });
1737
1745
  }
1738
1746
  }]
1739
- }, Yt = /* @__PURE__ */ new Set([
1747
+ }, Qt = /* @__PURE__ */ new Set([
1740
1748
  "component",
1741
1749
  "anchor",
1742
1750
  "submap",
1743
1751
  "pipeline"
1744
1752
  ]);
1745
1753
  function z(e) {
1746
- return T(e) && Yt.has(e.wardleyType);
1754
+ return x(e) && Qt.has(e.wardleyType);
1747
1755
  }
1748
- function Xt(e, t) {
1756
+ function $t(e, t) {
1749
1757
  return (e.outgoing ?? []).some((e) => e.target === t) || (e.incoming ?? []).some((e) => e.source === t);
1750
1758
  }
1751
- var Zt = class extends ve {
1759
+ var en = class extends ve {
1752
1760
  static $inject = ["eventBus"];
1753
1761
  constructor(e) {
1754
1762
  super(e);
@@ -1756,13 +1764,13 @@ var Zt = class extends ve {
1756
1764
  init() {
1757
1765
  this.addRule("connection.start", (e) => z(e.source)), this.addRule("connection.create", (e) => {
1758
1766
  let { source: t, target: n } = e;
1759
- return !z(t) || !z(n) || t === n || Xt(t, n) ? !1 : { wardleyType: "dependency" };
1760
- }), this.addRule(["shape.move", "elements.move"], () => !0), this.addRule("shape.create", () => !0), this.addRule("elements.create", () => !0), this.addRule("shape.resize", (e) => O(e.shape) || Oe(e.shape));
1767
+ return !z(t) || !z(n) || t === n || $t(t, n) ? !1 : { wardleyType: "dependency" };
1768
+ }), this.addRule(["shape.move", "elements.move"], () => !0), this.addRule("shape.create", () => !0), this.addRule("elements.create", () => !0), this.addRule("shape.resize", (e) => C(e.shape) || Ne(e.shape));
1761
1769
  }
1762
- }, Qt = {
1770
+ }, tn = {
1763
1771
  __init__: ["wardleyRules"],
1764
- wardleyRules: ["type", Zt]
1765
- }, $t = 8, en = {
1772
+ wardleyRules: ["type", en]
1773
+ }, nn = 8, rn = {
1766
1774
  __init__: ["stageSnapping"],
1767
1775
  stageSnapping: ["type", class {
1768
1776
  static $inject = ["eventBus", "evolutionGrid"];
@@ -1778,7 +1786,7 @@ var Zt = class extends ve {
1778
1786
  let t = e.context?.shape;
1779
1787
  if (!t) return;
1780
1788
  let r = t.x + t.width / 2 + e.dx;
1781
- for (let t of n()) if (Math.abs(r - t) <= $t) {
1789
+ for (let t of n()) if (Math.abs(r - t) <= nn) {
1782
1790
  let n = t - r;
1783
1791
  e.dx += n, e.x += n;
1784
1792
  break;
@@ -1790,7 +1798,7 @@ var Zt = class extends ve {
1790
1798
  "resize.end"
1791
1799
  ], 1500, (e) => {
1792
1800
  if (!e.originalEvent?.shiftKey && typeof e.x == "number") {
1793
- for (let t of n()) if (Math.abs(e.x - t) <= $t) {
1801
+ for (let t of n()) if (Math.abs(e.x - t) <= nn) {
1794
1802
  r(e, t);
1795
1803
  break;
1796
1804
  }
@@ -1804,12 +1812,12 @@ var Zt = class extends ve {
1804
1812
  component: B(V()),
1805
1813
  market: B(V(`<circle cx="12" cy="10" r="1.4" fill="${_.stroke}"/><circle cx="10.2" cy="13.4" r="1.4" fill="${_.stroke}"/><circle cx="13.8" cy="13.4" r="1.4" fill="${_.stroke}"/>`)),
1806
1814
  ecosystem: B(V(`<circle cx="12" cy="12" r="10" fill="none" stroke="${_.stroke}" stroke-width="1.25" stroke-dasharray="1.5 3" stroke-linecap="round"/>`)),
1807
- anchor: B(`<path d="${M}" fill="${_.ink}"/>`),
1815
+ anchor: B(`<path d="${D}" fill="${_.ink}"/>`),
1808
1816
  pipeline: B(`<rect x="9.5" y="2.5" width="5.5" height="5.5" fill="${_.componentFill}" stroke="${_.stroke}" stroke-width="1.5"/><rect x="2" y="10" width="20" height="9" rx="2" fill="none" stroke="${_.pipeline}" stroke-width="1.25" stroke-dasharray="3 2"/><circle cx="7" cy="14.5" r="2.2" fill="${_.componentFill}" stroke="${_.stroke}" stroke-width="1.2"/><circle cx="17" cy="14.5" r="2.2" fill="${_.componentFill}" stroke="${_.stroke}" stroke-width="1.2"/>`),
1809
1817
  note: B(`<g stroke="${_.noteText}" stroke-width="1.5" stroke-linecap="round"><line x1="5" y1="8" x2="19" y2="8"/><line x1="5" y1="12" x2="19" y2="12"/><line x1="5" y1="16" x2="13" y2="16"/></g>`),
1810
1818
  annotation: B(`<circle cx="12" cy="12" r="8" fill="${_.annotationFill}" stroke="${_.stroke}" stroke-width="1.25"/>` + ((e, t) => `<text x="12" text-anchor="middle" font-family="${y.family}" ${t}>${e}</text>`)("1", `y="16" font-size="11" font-weight="700" fill="${_.stroke}"`)),
1811
- accelerator: B(`<path d="${nt}" fill="${_.accelerator}"/>`),
1812
- deaccelerator: B(`<path d="${rt}" fill="${_.deaccelerator}"/>`),
1819
+ accelerator: B(`<path d="${A}" fill="${_.accelerator}"/>`),
1820
+ deaccelerator: B(`<path d="${j}" fill="${_.deaccelerator}"/>`),
1813
1821
  submap: B(`<rect x="4" y="4" width="16" height="16" rx="3" fill="${_.componentFill}" stroke="${_.stroke}" stroke-width="2"/><rect x="7.5" y="7.5" width="9" height="9" rx="1.5" fill="none" stroke="${_.stroke}" stroke-width="1"/>`)
1814
1822
  };
1815
1823
  function U(e) {
@@ -1821,7 +1829,7 @@ function U(e) {
1821
1829
  }
1822
1830
  //#endregion
1823
1831
  //#region src/palette/WardleyPaletteProvider.ts
1824
- var W = "wardley-1-blocks", G = "wardley-2-strategy", tn = [
1832
+ var W = "wardley-1-blocks", G = "wardley-2-strategy", an = [
1825
1833
  {
1826
1834
  key: "component",
1827
1835
  type: "component",
@@ -1925,7 +1933,7 @@ var W = "wardley-1-blocks", G = "wardley-2-strategy", tn = [
1925
1933
  icon: H.note,
1926
1934
  group: "wardley-3-notes"
1927
1935
  }
1928
- ], nn = {
1936
+ ], on = {
1929
1937
  __init__: ["wardleyPaletteProvider"],
1930
1938
  wardleyPaletteProvider: ["type", class {
1931
1939
  create;
@@ -1955,7 +1963,7 @@ var W = "wardley-1-blocks", G = "wardley-2-strategy", tn = [
1955
1963
  html: `<div class="entry wardley-palette-entry" title="Draw — click point by point, double-click/Enter finishes, click the start point to close">${H.draw}</div>`,
1956
1964
  action: { click: () => this.drawTool.toggle() }
1957
1965
  };
1958
- for (let t of tn) {
1966
+ for (let t of an) {
1959
1967
  let n = (e) => {
1960
1968
  let n = this.factory.createNew(t.type, t.label, t.extra ?? {});
1961
1969
  this.create.start(e, n);
@@ -1979,14 +1987,14 @@ var W = "wardley-1-blocks", G = "wardley-2-strategy", tn = [
1979
1987
  }, J = {
1980
1988
  id: "method",
1981
1989
  name: "Sourcing"
1982
- }, rn = {
1990
+ }, sn = {
1983
1991
  id: "props",
1984
1992
  name: "Properties"
1985
1993
  };
1986
1994
  function Y(e, t) {
1987
1995
  return e ? `✓ ${t}` : t;
1988
1996
  }
1989
- var an = class {
1997
+ var cn = class {
1990
1998
  modeling;
1991
1999
  static $inject = ["popupMenu", "wardleyModeling"];
1992
2000
  constructor(e, t) {
@@ -1994,7 +2002,7 @@ var an = class {
1994
2002
  }
1995
2003
  getPopupMenuEntries(e) {
1996
2004
  let t = Array.isArray(e) ? e[0] : e;
1997
- return D(t) ? this.componentEntries(t) : {};
2005
+ return Me(t) ? this.componentEntries(t) : {};
1998
2006
  }
1999
2007
  componentEntries(e) {
2000
2008
  let t = e.decorators ?? {}, n = t.ecosystem ? "ecosystem" : t.market ? "market" : "normal", r = t.method;
@@ -2036,23 +2044,23 @@ var an = class {
2036
2044
  },
2037
2045
  "prop-inertia": {
2038
2046
  label: Y(!!t.inertia, "Inertia"),
2039
- group: rn,
2047
+ group: sn,
2040
2048
  action: () => this.modeling.toggleInertia(e)
2041
2049
  }
2042
2050
  };
2043
2051
  }
2044
- }, on = {
2052
+ }, ln = {
2045
2053
  __init__: ["wardleyElementSettings"],
2046
- wardleyElementSettings: ["type", an]
2054
+ wardleyElementSettings: ["type", cn]
2047
2055
  };
2048
2056
  //#endregion
2049
2057
  //#region src/context-pad/WardleyContextPadProvider.ts
2050
2058
  function X(e, t, n = !1) {
2051
- return `<div class="entry wardley-cp-entry"${n ? " draggable=\"true\"" : ""} title="${t}">${ut(e)}</div>`;
2059
+ return `<div class="entry wardley-cp-entry"${n ? " draggable=\"true\"" : ""} title="${t}">${N(e)}</div>`;
2052
2060
  }
2053
2061
  //#endregion
2054
2062
  //#region src/context-pad/index.ts
2055
- var sn = {
2063
+ var un = {
2056
2064
  __init__: ["wardleyContextPadProvider"],
2057
2065
  wardleyContextPadProvider: ["type", class {
2058
2066
  modeling;
@@ -2080,24 +2088,24 @@ var sn = {
2080
2088
  this.modeling = t, this.connect = n, this.create = r, this.popupMenu = i, this.wardleyModeling = a, this.labelEditing = o, this.evolveDragging = s, this.factory = c, this.colorPicker = l, e.registerProvider(this);
2081
2089
  }
2082
2090
  getContextPadEntries(e) {
2083
- if (E(e)) {
2091
+ if (S(e)) {
2084
2092
  let t = e, n = t.wardleyType === "flow";
2085
2093
  return {
2086
2094
  "edit-value": {
2087
2095
  group: "edit",
2088
2096
  title: n ? "Edit flow value" : "Edit link annotation",
2089
- html: X(N, n ? "Edit flow value" : "Edit link annotation"),
2097
+ html: X(O, n ? "Edit flow value" : "Edit link annotation"),
2090
2098
  action: { click: () => this.labelEditing.activateConnection(t) }
2091
2099
  },
2092
2100
  delete: {
2093
2101
  group: "edit",
2094
2102
  title: "Delete connection",
2095
- html: X(P, "Delete connection"),
2103
+ html: X(k, "Delete connection"),
2096
2104
  action: { click: () => this.modeling.removeElements([e]) }
2097
2105
  }
2098
2106
  };
2099
2107
  }
2100
- if (!T(e)) return {};
2108
+ if (!x(e)) return {};
2101
2109
  let t = e, n = {};
2102
2110
  if (t.wardleyType === "component" || t.wardleyType === "anchor" || t.wardleyType === "submap" || t.wardleyType === "pipeline") {
2103
2111
  let e = (e) => {
@@ -2107,7 +2115,7 @@ var sn = {
2107
2115
  n.append = {
2108
2116
  group: "edit",
2109
2117
  title: "Append component (auto-connect)",
2110
- html: X(Ve, "Append component", !0),
2118
+ html: X(Ke, "Append component", !0),
2111
2119
  action: {
2112
2120
  click: e,
2113
2121
  dragstart: e
@@ -2119,7 +2127,7 @@ var sn = {
2119
2127
  n.connect = {
2120
2128
  group: "edit",
2121
2129
  title: "Connect to existing element",
2122
- html: X(He, "Connect to existing element", !0),
2130
+ html: X(qe, "Connect to existing element", !0),
2123
2131
  action: {
2124
2132
  click: r,
2125
2133
  dragstart: r
@@ -2130,7 +2138,7 @@ var sn = {
2130
2138
  if (t.movement) n["evolve-clear"] = {
2131
2139
  group: "wardley",
2132
2140
  title: "Remove evolve",
2133
- html: X(We, "Remove evolve"),
2141
+ html: X(Ye, "Remove evolve"),
2134
2142
  action: { click: () => this.wardleyModeling.clearMovement(t) }
2135
2143
  };
2136
2144
  else if (t.evolution < .999) {
@@ -2138,7 +2146,7 @@ var sn = {
2138
2146
  n.evolve = {
2139
2147
  group: "wardley",
2140
2148
  title: "Evolve: drag to set the target maturity",
2141
- html: X(Ue, "Evolve: drag to set the target maturity", !0),
2149
+ html: X(Je, "Evolve: drag to set the target maturity", !0),
2142
2150
  action: {
2143
2151
  click: e,
2144
2152
  dragstart: e
@@ -2148,7 +2156,7 @@ var sn = {
2148
2156
  n.settings = {
2149
2157
  group: "wardley",
2150
2158
  title: "Settings (type, sourcing, inertia)",
2151
- html: X(et, "Settings"),
2159
+ html: X(at, "Settings"),
2152
2160
  action: { click: (e) => {
2153
2161
  let n = e;
2154
2162
  this.popupMenu.open(t, K, {
@@ -2163,14 +2171,14 @@ var sn = {
2163
2171
  n["stroke-style"] = {
2164
2172
  group: "wardley",
2165
2173
  title: r,
2166
- html: X(it, r),
2174
+ html: X(st, r),
2167
2175
  action: { click: () => this.wardleyModeling.updateProperties(t, { strokeStyle: e }) }
2168
2176
  };
2169
2177
  }
2170
2178
  n.color = {
2171
2179
  group: "wardley",
2172
2180
  title: "Color",
2173
- html: X(tt, "Color"),
2181
+ html: X(ot, "Color"),
2174
2182
  action: { click: (e) => {
2175
2183
  let n = e;
2176
2184
  this.colorPicker.open(t, n.clientX, n.clientY);
@@ -2180,17 +2188,17 @@ var sn = {
2180
2188
  return i && (n["open-link"] = {
2181
2189
  group: "wardley",
2182
2190
  title: `Open link (${i})`,
2183
- html: X(He, "Open link"),
2191
+ html: X(qe, "Open link"),
2184
2192
  action: { click: () => window.open(i, "_blank", "noopener") }
2185
2193
  }), t.wardleyType !== "drawing" && (n["edit-label"] = {
2186
2194
  group: "edit",
2187
2195
  title: "Edit label",
2188
- html: X(N, "Edit label"),
2196
+ html: X(O, "Edit label"),
2189
2197
  action: { click: () => this.labelEditing.activate(t) }
2190
2198
  }), n.delete = {
2191
2199
  group: "edit",
2192
2200
  title: "Delete",
2193
- html: X(P, "Delete"),
2201
+ html: X(k, "Delete"),
2194
2202
  action: { click: () => this.modeling.removeElements([t]) }
2195
2203
  }, n;
2196
2204
  }
@@ -2198,10 +2206,10 @@ var sn = {
2198
2206
  };
2199
2207
  //#endregion
2200
2208
  //#region src/label-editing/WardleyLabelEditing.ts
2201
- function cn(e) {
2209
+ function dn(e) {
2202
2210
  return e.replace(/->/g, "→").replace(/;/g, ",").replace(/\[/g, "(").replace(/\]/g, ")").trim();
2203
2211
  }
2204
- var ln = class {
2212
+ var fn = class {
2205
2213
  canvas;
2206
2214
  modeling;
2207
2215
  factory;
@@ -2214,7 +2222,7 @@ var ln = class {
2214
2222
  active = null;
2215
2223
  constructor(e, t, n, r) {
2216
2224
  this.canvas = t, this.modeling = n, this.factory = r, e.on("element.dblclick", (e) => {
2217
- T(e.element) ? this.activate(e.element) : E(e.element) && this.activateConnection(e.element);
2225
+ x(e.element) ? this.activate(e.element) : S(e.element) && this.activateConnection(e.element);
2218
2226
  }), e.on([
2219
2227
  "element.mousedown",
2220
2228
  "drag.init",
@@ -2233,7 +2241,7 @@ var ln = class {
2233
2241
  c || (c = !0, s.removeEventListener("keydown", d), s.removeEventListener("blur", f), s.remove(), this.active = null);
2234
2242
  }, u = () => {
2235
2243
  if (c) return;
2236
- let t = cn(s.value), n = t && t !== e.wardleyLabel;
2244
+ let t = dn(s.value), n = t && t !== e.wardleyLabel;
2237
2245
  if (l(), !n) return;
2238
2246
  let r = i ? t : this.factory.uniqueLabel(t, e.id);
2239
2247
  this.modeling.updateLabel(e, r);
@@ -2288,10 +2296,10 @@ var ln = class {
2288
2296
  cancel() {
2289
2297
  this.active?.cleanup();
2290
2298
  }
2291
- }, Z = {
2299
+ }, pn = {
2292
2300
  __init__: ["wardleyLabelEditing"],
2293
- wardleyLabelEditing: ["type", ln]
2294
- }, un = 2, dn = 10, fn = {
2301
+ wardleyLabelEditing: ["type", fn]
2302
+ }, mn = 2, hn = 10, gn = {
2295
2303
  arrowleft: {
2296
2304
  x: -1,
2297
2305
  y: 0
@@ -2308,7 +2316,7 @@ var ln = class {
2308
2316
  x: 0,
2309
2317
  y: 1
2310
2318
  }
2311
- }, pn = class {
2319
+ }, _n = class {
2312
2320
  static $inject = [
2313
2321
  "canvas",
2314
2322
  "commandStack",
@@ -2325,7 +2333,7 @@ var ln = class {
2325
2333
  let u = e.getContainer();
2326
2334
  u.hasAttribute("tabindex") || u.setAttribute("tabindex", "0");
2327
2335
  let d = (e) => {
2328
- if (mn(e.target)) return;
2336
+ if (vn(e.target)) return;
2329
2337
  let l = e.ctrlKey || e.metaKey, u = e.key.toLowerCase();
2330
2338
  if (l && u === "z" && !e.shiftKey) e.preventDefault(), t.undo();
2331
2339
  else if (l && u === "z" && e.shiftKey || l && u === "y") e.preventDefault(), t.redo();
@@ -2346,11 +2354,11 @@ var ln = class {
2346
2354
  e.preventDefault();
2347
2355
  let t = s.getLastMoveEvent();
2348
2356
  c.activateSelection(t ?? e, !!t);
2349
- } else if (u in fn && !l) {
2357
+ } else if (u in gn && !l) {
2350
2358
  let t = n.get();
2351
2359
  if (t.length) {
2352
2360
  e.preventDefault();
2353
- let n = e.shiftKey ? dn : un, i = fn[u];
2361
+ let n = e.shiftKey ? hn : mn, i = gn[u];
2354
2362
  r.moveElements(t, {
2355
2363
  x: i.x * n,
2356
2364
  y: i.y * n
@@ -2361,21 +2369,21 @@ var ln = class {
2361
2369
  document.addEventListener("keydown", d), l.on("diagram.destroy", () => document.removeEventListener("keydown", d));
2362
2370
  }
2363
2371
  };
2364
- function mn(e) {
2372
+ function vn(e) {
2365
2373
  if (!(e instanceof HTMLElement)) return !1;
2366
2374
  let t = e.tagName;
2367
2375
  return t === "INPUT" || t === "TEXTAREA" || e.isContentEditable;
2368
2376
  }
2369
2377
  //#endregion
2370
2378
  //#region src/keyboard/index.ts
2371
- var hn = {
2379
+ var yn = {
2372
2380
  __init__: ["wardleyKeyboard"],
2373
- wardleyKeyboard: ["type", pn]
2374
- }, Q = "wardley.evolve", gn = .005, _n = "wardley-evolve-handle";
2375
- function vn(e) {
2381
+ wardleyKeyboard: ["type", _n]
2382
+ }, Z = "wardley.evolve", bn = .005, xn = "wardley-evolve-handle";
2383
+ function Sn(e) {
2376
2384
  return e < 0 ? 0 : e > 1 ? 1 : e;
2377
2385
  }
2378
- var yn = class {
2386
+ var Cn = class {
2379
2387
  dragging;
2380
2388
  static $inject = [
2381
2389
  "eventBus",
@@ -2391,33 +2399,33 @@ var yn = class {
2391
2399
  n === void 0 ? delete t.movement : t.movement = n, e.fire("element.changed", { element: t });
2392
2400
  }, s = (e, t) => {
2393
2401
  let r = i.getContainer().getBoundingClientRect(), a = i.viewbox(), o = a.x + (e - r.left) * (a.width / r.width);
2394
- return vn(n.fromCanvas({
2402
+ return Sn(n.fromCanvas({
2395
2403
  x: o,
2396
2404
  y: t
2397
2405
  }).evolution);
2398
2406
  };
2399
2407
  i.getContainer().addEventListener("mousedown", (e) => {
2400
2408
  let t = e.target;
2401
- if (!t?.closest(`.${_n}`)) return;
2409
+ if (!t?.closest(`.${xn}`)) return;
2402
2410
  let n = t.closest("[data-element-id]")?.getAttribute("data-element-id"), i = n ? a.get(n) : void 0;
2403
2411
  if (!i || i.wardleyType !== "component") return;
2404
2412
  e.stopPropagation(), e.preventDefault();
2405
2413
  let c = i.movement, l = i.y + i.height / 2, u, d = (e) => {
2406
2414
  u = s(e.clientX, l), o(i, { targetEvolution: u });
2407
2415
  }, f = () => {
2408
- document.removeEventListener("mousemove", d), document.removeEventListener("mouseup", f), o(i, c), u !== void 0 && Math.abs(u - i.evolution) > gn && r.evolveComponent(i, u);
2416
+ document.removeEventListener("mousemove", d), document.removeEventListener("mouseup", f), o(i, c), u !== void 0 && Math.abs(u - i.evolution) > bn && r.evolveComponent(i, u);
2409
2417
  };
2410
2418
  document.addEventListener("mousemove", d), document.addEventListener("mouseup", f);
2411
- }, !0), e.on(`${Q}.move`, (e) => {
2412
- let { shape: t } = e.context, r = t.y + t.height / 2, i = vn(n.fromCanvas({
2419
+ }, !0), e.on(`${Z}.move`, (e) => {
2420
+ let { shape: t } = e.context, r = t.y + t.height / 2, i = Sn(n.fromCanvas({
2413
2421
  x: e.x,
2414
2422
  y: r
2415
2423
  }).evolution);
2416
2424
  e.context.target = i, o(t, { targetEvolution: i });
2417
- }), e.on(`${Q}.end`, (e) => {
2425
+ }), e.on(`${Z}.end`, (e) => {
2418
2426
  let t = e.context, { shape: n, target: i } = t;
2419
- o(n, t.originalMovement), i !== void 0 && Math.abs(i - n.evolution) > gn && r.evolveComponent(n, i), t.committed = !0;
2420
- }), e.on(`${Q}.cleanup`, (e) => {
2427
+ o(n, t.originalMovement), i !== void 0 && Math.abs(i - n.evolution) > bn && r.evolveComponent(n, i), t.committed = !0;
2428
+ }), e.on(`${Z}.cleanup`, (e) => {
2421
2429
  let t = e.context;
2422
2430
  t && !t.committed && o(t.shape, t.originalMovement);
2423
2431
  });
@@ -2427,15 +2435,15 @@ var yn = class {
2427
2435
  shape: t,
2428
2436
  ...t.movement ? { originalMovement: t.movement } : {}
2429
2437
  };
2430
- this.dragging.init(e, Q, {
2438
+ this.dragging.init(e, Z, {
2431
2439
  cursor: "ew-resize",
2432
2440
  data: { context: n }
2433
2441
  });
2434
2442
  }
2435
- }, bn = {
2443
+ }, wn = {
2436
2444
  __init__: ["wardleyEvolveDragging"],
2437
- wardleyEvolveDragging: ["type", yn]
2438
- }, xn = 500, Sn = class {
2445
+ wardleyEvolveDragging: ["type", Cn]
2446
+ }, Tn = 500, En = class {
2439
2447
  static $inject = ["injector", "eventBus"];
2440
2448
  constructor(e, t) {
2441
2449
  let n = e.get("connectionPreview", !1), r = e.get("wardleyLabelEditing", !1);
@@ -2460,18 +2468,18 @@ var yn = class {
2460
2468
  "create.cleanup"
2461
2469
  ], (e) => {
2462
2470
  n.cleanUp(e.context);
2463
- })), r && t.on("create.end", xn, (e) => {
2471
+ })), r && t.on("create.end", Tn, (e) => {
2464
2472
  let { context: t } = e;
2465
2473
  if (!t.source || !t.canExecute || !t.shape) return;
2466
2474
  let n = t.shape;
2467
2475
  setTimeout(() => r.activate(n), 0);
2468
2476
  });
2469
2477
  }
2470
- }, Cn = {
2478
+ }, Dn = {
2471
2479
  __depends__: [ye],
2472
2480
  __init__: ["wardleyAppendBehavior"],
2473
- wardleyAppendBehavior: ["type", Sn]
2474
- }, wn = class {
2481
+ wardleyAppendBehavior: ["type", En]
2482
+ }, Q = class {
2475
2483
  canvas;
2476
2484
  modeling;
2477
2485
  static $inject = [
@@ -2521,18 +2529,18 @@ var yn = class {
2521
2529
  close() {
2522
2530
  this.popover && (this.popover.remove(), this.popover = void 0, document.removeEventListener("click", this.onDocPointer, !0), document.removeEventListener("keydown", this.onKey, !0));
2523
2531
  }
2524
- }, Tn = {
2532
+ }, On = {
2525
2533
  __init__: ["wardleyColorPicker"],
2526
- wardleyColorPicker: ["type", wn]
2534
+ wardleyColorPicker: ["type", Q]
2527
2535
  };
2528
2536
  //#endregion
2529
2537
  //#region src/ordering/WardleyOrderingProvider.ts
2530
2538
  function $(e) {
2531
- return T(e) && (e.wardleyType === "attitude" || e.wardleyType === "pipeline");
2539
+ return x(e) && (e.wardleyType === "attitude" || e.wardleyType === "pipeline");
2532
2540
  }
2533
2541
  //#endregion
2534
2542
  //#region src/ordering/index.ts
2535
- var En = {
2543
+ var kn = {
2536
2544
  __init__: ["wardleyOrderingProvider"],
2537
2545
  wardleyOrderingProvider: ["type", class extends be {
2538
2546
  static $inject = ["eventBus"];
@@ -2541,16 +2549,16 @@ var En = {
2541
2549
  }
2542
2550
  getOrdering(e, t) {
2543
2551
  let n = t.children ?? [];
2544
- return E(e) ? {
2552
+ return S(e) ? {
2545
2553
  parent: t,
2546
- index: n.filter((t) => t !== e && ($(t) || E(t))).length
2554
+ index: n.filter((t) => t !== e && ($(t) || S(t))).length
2547
2555
  } : $(e) ? {
2548
2556
  parent: t,
2549
2557
  index: n.filter((t) => t !== e && $(t)).length
2550
2558
  } : { parent: t };
2551
2559
  }
2552
2560
  }]
2553
- }, Dn = 12, On = class {
2561
+ }, An = 12, jn = class {
2554
2562
  canvas;
2555
2563
  eventBus;
2556
2564
  modeling;
@@ -2627,12 +2635,12 @@ var En = {
2627
2635
  if (e.button !== 0 || this.isChromeTarget(e)) return;
2628
2636
  e.preventDefault(), e.stopPropagation();
2629
2637
  let t = this.toCanvasPoint(e), n = this.points[0];
2630
- if (n && this.points.length >= 3 && kn(t, n) <= Dn) {
2638
+ if (n && this.points.length >= 3 && Mn(t, n) <= An) {
2631
2639
  this.finishClosed();
2632
2640
  return;
2633
2641
  }
2634
2642
  let r = this.points[this.points.length - 1];
2635
- if (r && kn(t, r) <= Dn) {
2643
+ if (r && Mn(t, r) <= An) {
2636
2644
  this.points.length >= 2 && this.finish();
2637
2645
  return;
2638
2646
  }
@@ -2684,12 +2692,12 @@ var En = {
2684
2692
  this.layer &&= (p(this.layer), null);
2685
2693
  }
2686
2694
  };
2687
- function kn(e, t) {
2695
+ function Mn(e, t) {
2688
2696
  return Math.hypot(e.x - t.x, e.y - t.y);
2689
2697
  }
2690
2698
  //#endregion
2691
2699
  //#region src/draw-tool/WardleyDrawingHandles.ts
2692
- var An = class {
2700
+ var Nn = class {
2693
2701
  eventBus;
2694
2702
  canvas;
2695
2703
  modeling;
@@ -2706,7 +2714,7 @@ var An = class {
2706
2714
  constructor(e, t, n, r) {
2707
2715
  this.eventBus = e, this.canvas = t, this.modeling = n, this.grid = r, e.on("selection.changed", (e) => {
2708
2716
  let t = e.newSelection ?? [], n = t.length === 1 ? t[0] : null;
2709
- this.attach(T(n) && n.wardleyType === "drawing" ? n : null);
2717
+ this.attach(x(n) && n.wardleyType === "drawing" ? n : null);
2710
2718
  }), e.on("element.changed", (e) => {
2711
2719
  this.shape && e.element === this.shape && this.render();
2712
2720
  }), e.on(["diagram.clear", "diagram.destroy"], () => this.attach(null));
@@ -2790,20 +2798,20 @@ var An = class {
2790
2798
  };
2791
2799
  //#endregion
2792
2800
  //#region src/draw-tool/WardleyDrawingHitProvider.ts
2793
- function jn(e) {
2794
- return T(e) && e.wardleyType === "drawing";
2801
+ function Pn(e) {
2802
+ return x(e) && e.wardleyType === "drawing";
2795
2803
  }
2796
- var Mn = class {
2804
+ var Fn = class {
2797
2805
  static $inject = ["eventBus", "interactionEvents"];
2798
2806
  constructor(e, t) {
2799
2807
  e.on("interactionEvents.createHit", (e) => {
2800
- if (!(!jn(e.element) || !e.gfx)) return Nn(e.element, e.gfx), !1;
2808
+ if (!(!Pn(e.element) || !e.gfx)) return In(e.element, e.gfx), !1;
2801
2809
  }), e.on("interactionEvents.updateHit", (e) => {
2802
- if (!(!jn(e.element) || !e.gfx)) return t.removeHits(e.gfx), Nn(e.element, e.gfx), !1;
2810
+ if (!(!Pn(e.element) || !e.gfx)) return t.removeHits(e.gfx), In(e.element, e.gfx), !1;
2803
2811
  });
2804
2812
  }
2805
2813
  };
2806
- function Nn(e, t) {
2814
+ function In(e, t) {
2807
2815
  let n = e.drawingPoints ?? [], r = f(e.closed ? "polygon" : "polyline");
2808
2816
  u(r, {
2809
2817
  points: n.map((e) => `${e.x},${e.y}`).join(" "),
@@ -2816,16 +2824,16 @@ function Nn(e, t) {
2816
2824
  }
2817
2825
  //#endregion
2818
2826
  //#region src/draw-tool/index.ts
2819
- var Pn = {
2827
+ var Ln = {
2820
2828
  __init__: [
2821
2829
  "wardleyDrawTool",
2822
2830
  "wardleyDrawingHandles",
2823
2831
  "wardleyDrawingHitProvider"
2824
2832
  ],
2825
- wardleyDrawTool: ["type", On],
2826
- wardleyDrawingHandles: ["type", An],
2827
- wardleyDrawingHitProvider: ["type", Mn]
2828
- }, Fn = class extends Nt {
2833
+ wardleyDrawTool: ["type", jn],
2834
+ wardleyDrawingHandles: ["type", Nn],
2835
+ wardleyDrawingHitProvider: ["type", Fn]
2836
+ }, Rn = class extends It {
2829
2837
  _getModules() {
2830
2838
  return [
2831
2839
  ...super._getModules(),
@@ -2839,21 +2847,21 @@ var Pn = {
2839
2847
  pe,
2840
2848
  me,
2841
2849
  he,
2842
- qt,
2843
- Qt,
2844
- Be,
2845
- en,
2846
- nn,
2847
- sn,
2848
- Z,
2849
- hn,
2850
- bn,
2850
+ Xt,
2851
+ tn,
2852
+ Ge,
2853
+ rn,
2851
2854
  on,
2852
- Cn,
2853
- Tn,
2854
- Jt,
2855
- En,
2856
- Pn
2855
+ un,
2856
+ pn,
2857
+ yn,
2858
+ wn,
2859
+ ln,
2860
+ Dn,
2861
+ On,
2862
+ Zt,
2863
+ kn,
2864
+ Ln
2857
2865
  ];
2858
2866
  }
2859
2867
  undo() {
@@ -2870,6 +2878,6 @@ var Pn = {
2870
2878
  }
2871
2879
  };
2872
2880
  //#endregion
2873
- export { _ as COLORS, Me as EvolutionGrid, st as ICON_ADD, at as ICON_ASPECT_RATIO, Je as ICON_CODE, qe as ICON_DATA_OBJECT, P as ICON_DELETE, Ye as ICON_DOWNLOAD, N as ICON_EDIT, Ze as ICON_FOLDER_OPEN, Qe as ICON_IMAGE, ot as ICON_MENU, $e as ICON_NEW, M as ICON_PERSON, Ke as ICON_REDO, Xe as ICON_SHARE, Ge as ICON_UNDO, ct as ICON_VISIBILITY, m as MIRAGON, Fn as Modeler, Te as NOTE_COLORS, Nt as NavigatedViewer, h as PLOT, K as POPUP_PROVIDER_ID, jt as PanConstraint, Mt as PanConstraintModule, De as ROOT_ID, wt as Viewer, Sn as WardleyAppendBehavior, x as WardleyBaseViewer, wn as WardleyColorPicker, S as WardleyElementFactory, an as WardleyElementSettingsProvider, yn as WardleyEvolveDragging, St as WardleyExporter, xt as WardleyImporter, ln as WardleyLabelEditing, Rt as WardleyModeling, ft as WardleyRenderer, Zt as WardleyRules, Be as evolutionConstraintModule, j as evolutionGridModule, ut as iconMarkup, Ct as ioModule, D as isComponent, O as isPipeline, E as isWardleyConnection, T as isWardleyShape, Z as labelEditingModule, Ee as saveSVG, en as stageSnappingModule, Cn as wardleyAppendModule, Tn as wardleyColorPickerModule, sn as wardleyContextPadModule, vt as wardleyDrawModule, bn as wardleyEvolveModule, hn as wardleyKeyboardModule, ke as wardleyModelModule, qt as wardleyModelingModule, nn as wardleyPaletteModule, on as wardleyPopupModule, Qt as wardleyRulesModule };
2881
+ export { _ as COLORS, Le as EvolutionGrid, ut as ICON_ADD, ct as ICON_ASPECT_RATIO, $e as ICON_CODE, Qe as ICON_DATA_OBJECT, k as ICON_DELETE, et as ICON_DOWNLOAD, O as ICON_EDIT, nt as ICON_FOLDER_OPEN, rt as ICON_IMAGE, lt as ICON_MENU, it as ICON_NEW, D as ICON_PERSON, Ze as ICON_REDO, tt as ICON_SHARE, Xe as ICON_UNDO, dt as ICON_VISIBILITY, m as MIRAGON, Rn as Modeler, Te as NOTE_COLORS, It as NavigatedViewer, h as PLOT, K as POPUP_PROVIDER_ID, Pt as PanConstraint, Ft as PanConstraintModule, De as ROOT_ID, Dt as Viewer, En as WardleyAppendBehavior, ke as WardleyBaseViewer, Q as WardleyColorPicker, Ae as WardleyElementFactory, cn as WardleyElementSettingsProvider, Cn as WardleyEvolveDragging, Tt as WardleyExporter, wt as WardleyImporter, fn as WardleyLabelEditing, Vt as WardleyModeling, P as WardleyRenderer, en as WardleyRules, Ge as evolutionConstraintModule, E as evolutionGridModule, N as iconMarkup, Et as ioModule, Me as isComponent, C as isPipeline, S as isWardleyConnection, x as isWardleyShape, pn as labelEditingModule, Ee as saveSVG, rn as stageSnappingModule, Dn as wardleyAppendModule, On as wardleyColorPickerModule, un as wardleyContextPadModule, xt as wardleyDrawModule, wn as wardleyEvolveModule, yn as wardleyKeyboardModule, Pe as wardleyModelModule, Xt as wardleyModelingModule, on as wardleyPaletteModule, ln as wardleyPopupModule, tn as wardleyRulesModule };
2874
2882
 
2875
2883
  //# sourceMappingURL=index.js.map