@miragon/event-storming-renderer 0.4.0 → 0.5.0

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
@@ -1,65 +1,65 @@
1
1
  import e from "diagram-js/lib/Diagram";
2
- import { parseDSLWithDiagnostics as t, serializeDSL as n } from "@miragon/event-storming-dsl";
3
- import { ATTACHABLE_STICKY_KINDS as r, CURRENT_SCHEMA_VERSION as i, DEFAULT_BOARD_LEVEL as a, DEFAULT_BOARD_SIZE as o, HOST_STICKY_KINDS as s, LEVEL_STICKY_KINDS as c, validateBoard as l } from "@miragon/event-storming-schema-model";
4
- import u from "diagram-js/lib/features/change-support";
2
+ import { ATTACHABLE_STICKY_KINDS as t, CURRENT_SCHEMA_VERSION as n, DEFAULT_BOARD_LEVEL as r, DEFAULT_BOARD_SIZE as i, HOST_STICKY_KINDS as a, LEVEL_STICKY_KINDS as o, assertDrawable as s, validateBoard as c } from "@miragon/event-storming-schema-model";
3
+ import { parseDSLWithDiagnostics as l, serializeDSL as u } from "@miragon/event-storming-dsl";
5
4
  import d from "diagram-js/lib/draw/BaseRenderer";
6
5
  import { append as f, attr as p, create as m, remove as h } from "tiny-svg";
7
- import g from "diagram-js/lib/features/selection";
8
- import _ from "diagram-js/lib/navigation/zoomscroll";
9
- import v from "diagram-js/lib/navigation/movecanvas";
10
- import ee from "diagram-js/lib/features/keyboard";
11
- import te from "diagram-js/lib/features/modeling";
12
- import ne from "diagram-js/lib/features/move";
13
- import re from "diagram-js/lib/features/create";
14
- import ie from "diagram-js/lib/features/connect";
15
- import ae from "diagram-js/lib/features/context-pad";
16
- import oe from "diagram-js/lib/features/palette";
17
- import se from "diagram-js/lib/features/rules";
18
- import ce from "diagram-js/lib/features/outline";
19
- import le from "diagram-js/lib/features/popup-menu";
20
- import ue from "diagram-js/lib/features/attach-support";
21
- import de from "diagram-js/lib/command/CommandInterceptor";
22
- import fe from "diagram-js/lib/features/mouse";
23
- import pe from "diagram-js/lib/features/lasso-tool";
24
- import me from "diagram-js/lib/features/rules/RuleProvider";
25
- import he from "diagram-js/lib/features/palette/PaletteTooltipComponent";
26
- import { html as ge } from "diagram-js/lib/ui";
27
- import _e from "diagram-js/lib/features/connection-preview";
28
- import ve from "diagram-js/lib/features/ordering/OrderingProvider";
29
- import ye from "diagram-js/lib/features/resize";
30
- import { MODELER_API_VERSION as be } from "@miragon/modeler-api";
6
+ import g from "diagram-js/lib/features/change-support";
7
+ import _ from "diagram-js/lib/features/selection";
8
+ import v from "diagram-js/lib/navigation/zoomscroll";
9
+ import ee from "diagram-js/lib/navigation/movecanvas";
10
+ import te from "diagram-js/lib/features/keyboard";
11
+ import ne from "diagram-js/lib/features/modeling";
12
+ import re from "diagram-js/lib/features/move";
13
+ import ie from "diagram-js/lib/features/create";
14
+ import ae from "diagram-js/lib/features/connect";
15
+ import oe from "diagram-js/lib/features/context-pad";
16
+ import se from "diagram-js/lib/features/palette";
17
+ import ce from "diagram-js/lib/features/rules";
18
+ import le from "diagram-js/lib/features/outline";
19
+ import ue from "diagram-js/lib/features/popup-menu";
20
+ import de from "diagram-js/lib/features/attach-support";
21
+ import fe from "diagram-js/lib/command/CommandInterceptor";
22
+ import pe from "diagram-js/lib/features/mouse";
23
+ import me from "diagram-js/lib/features/lasso-tool";
24
+ import he from "diagram-js/lib/features/rules/RuleProvider";
25
+ import ge from "diagram-js/lib/features/palette/PaletteTooltipComponent";
26
+ import { html as _e } from "diagram-js/lib/ui";
27
+ import ve from "diagram-js/lib/features/connection-preview";
28
+ import ye from "diagram-js/lib/features/ordering/OrderingProvider";
29
+ import be from "diagram-js/lib/features/resize";
30
+ import { MODELER_API_VERSION as xe } from "@miragon/modeler-api";
31
31
  //#region src/io/saveSvg.ts
32
- var xe = [
32
+ var Se = [
33
33
  "tabindex",
34
34
  "role",
35
35
  "aria-label",
36
36
  "aria-labelledby"
37
37
  ];
38
- function Se(e, t) {
38
+ function Ce(e, t) {
39
39
  let n = e.getContainer().querySelector(":scope > svg");
40
40
  if (!n) throw Error("No SVG found in the canvas container.");
41
41
  let r = n.cloneNode(!0);
42
- for (let e of xe) r.removeAttribute(e);
43
- let i = t ?? {
42
+ for (let e of Se) r.removeAttribute(e);
43
+ let a = t ?? {
44
44
  x: 0,
45
45
  y: 0,
46
- ...o
46
+ ...i
47
47
  };
48
- r.setAttribute("xmlns", "http://www.w3.org/2000/svg"), r.setAttribute("viewBox", `${i.x} ${i.y} ${i.width} ${i.height}`), r.setAttribute("width", String(i.width)), r.setAttribute("height", String(i.height));
49
- let a = r.querySelector(".viewport");
50
- return a && a.removeAttribute("transform"), { svg: "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n" + new XMLSerializer().serializeToString(r) };
48
+ r.setAttribute("xmlns", "http://www.w3.org/2000/svg"), r.setAttribute("viewBox", `${a.x} ${a.y} ${a.width} ${a.height}`), r.setAttribute("width", String(a.width)), r.setAttribute("height", String(a.height));
49
+ let o = r.querySelector(".viewport");
50
+ return o && o.removeAttribute("transform"), { svg: "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n" + new XMLSerializer().serializeToString(r) };
51
51
  }
52
52
  //#endregion
53
53
  //#region src/model/di-types.ts
54
54
  var y = "event-storming-root";
55
- function Ce(e) {
55
+ function we(e) {
56
56
  return typeof e == "object" && !!e;
57
57
  }
58
58
  function b(e) {
59
- return Ce(e) && typeof e.eventStormingType == "string" && !("waypoints" in e);
59
+ return we(e) && typeof e.eventStormingType == "string" && !("waypoints" in e);
60
60
  }
61
61
  function x(e) {
62
- return Ce(e) && typeof e.eventStormingType == "string" && "waypoints" in e;
62
+ return we(e) && typeof e.eventStormingType == "string" && "waypoints" in e;
63
63
  }
64
64
  var S = [
65
65
  "event",
@@ -77,27 +77,27 @@ function C(e) {
77
77
  function w(e) {
78
78
  return b(e) && C(e.eventStormingType);
79
79
  }
80
- function we(e) {
81
- return r.includes(e);
80
+ function T(e) {
81
+ return t.includes(e);
82
82
  }
83
- function Te(e) {
84
- return s.includes(e);
83
+ function E(e) {
84
+ return a.includes(e);
85
85
  }
86
- function Ee(e) {
87
- return b(e) && we(e.eventStormingType);
86
+ function Te(e) {
87
+ return b(e) && T(e.eventStormingType);
88
88
  }
89
- function De(e) {
90
- return b(e) && Te(e.eventStormingType);
89
+ function D(e) {
90
+ return b(e) && E(e.eventStormingType);
91
91
  }
92
- function T(e) {
92
+ function O(e) {
93
93
  return b(e) && e.eventStormingType === "drawing";
94
94
  }
95
- function Oe(e) {
95
+ function Ee(e) {
96
96
  return b(e) && e.eventStormingType === "note";
97
97
  }
98
98
  //#endregion
99
99
  //#region src/theme/palette.ts
100
- var E = {
100
+ var k = {
101
101
  blau: "#335DE5",
102
102
  blauLink: "#2B50D4",
103
103
  blauHell: "#6B8AFF",
@@ -112,7 +112,7 @@ var E = {
112
112
  info: "#335DE5",
113
113
  navy: "#080A20",
114
114
  gradientBrand: "linear-gradient(120deg, #335DE5 30%, #00E676)"
115
- }, ke = [
115
+ }, De = [
116
116
  {
117
117
  marker: "***",
118
118
  bold: !0,
@@ -129,28 +129,28 @@ var E = {
129
129
  italic: !0
130
130
  }
131
131
  ];
132
- function D(e) {
132
+ function A(e) {
133
133
  return e.split("\n").map((e) => {
134
134
  let t = e.startsWith("- ");
135
135
  return {
136
136
  bullet: t,
137
- runs: Me(t ? e.slice(2) : e)
137
+ runs: Ae(t ? e.slice(2) : e)
138
138
  };
139
139
  });
140
140
  }
141
- function Ae(e) {
141
+ function Oe(e) {
142
142
  return e.map((e) => {
143
- let t = Pe(e.runs).map((e) => {
143
+ let t = Me(e.runs).map((e) => {
144
144
  let t = e.bold && e.italic ? "***" : e.bold ? "**" : e.italic ? "*" : "";
145
145
  return t + e.text + t;
146
146
  }).join("");
147
147
  return (e.bullet ? "- " : "") + t;
148
148
  }).join("\n");
149
149
  }
150
- function je(e) {
151
- return D(e).map((e) => (e.bullet ? "• " : "") + e.runs.map((e) => e.text).join("")).join("\n");
150
+ function ke(e) {
151
+ return A(e).map((e) => (e.bullet ? "• " : "") + e.runs.map((e) => e.text).join("")).join("\n");
152
152
  }
153
- function Me(e) {
153
+ function Ae(e) {
154
154
  let t = [], n = "", r = () => {
155
155
  n && t.push({
156
156
  text: n,
@@ -159,17 +159,17 @@ function Me(e) {
159
159
  }), n = "";
160
160
  }, i = 0;
161
161
  for (; i < e.length;) {
162
- let a = e[i] === "*" ? Ne(e, i) : void 0;
162
+ let a = e[i] === "*" ? je(e, i) : void 0;
163
163
  a ? (r(), t.push({
164
164
  text: a.content,
165
165
  bold: a.bold,
166
166
  italic: a.italic
167
167
  }), i = a.end) : (n += e[i], i++);
168
168
  }
169
- return r(), Pe(t);
169
+ return r(), Me(t);
170
170
  }
171
- function Ne(e, t) {
172
- for (let { marker: n, bold: r, italic: i } of ke) {
171
+ function je(e, t) {
172
+ for (let { marker: n, bold: r, italic: i } of De) {
173
173
  if (!e.startsWith(n, t)) continue;
174
174
  let a = e.indexOf(n, t + n.length);
175
175
  if (!(a <= t + n.length)) return {
@@ -180,7 +180,7 @@ function Ne(e, t) {
180
180
  };
181
181
  }
182
182
  }
183
- function Pe(e) {
183
+ function Me(e) {
184
184
  let t = [];
185
185
  for (let n of e) {
186
186
  if (!n.text) continue;
@@ -195,7 +195,7 @@ function Pe(e) {
195
195
  }
196
196
  //#endregion
197
197
  //#region src/draw/styles.ts
198
- var O = {
198
+ var j = {
199
199
  event: {
200
200
  label: "Domain Event",
201
201
  width: 130,
@@ -252,128 +252,224 @@ var O = {
252
252
  fill: "#E85D75",
253
253
  stroke: "#C43B55"
254
254
  }
255
- }, k = {
255
+ }, M = {
256
256
  label: "Note",
257
257
  fill: "#ECECEC",
258
258
  stroke: "#C4C4C4"
259
- }, A = {
259
+ }, N = {
260
260
  width: 60,
261
261
  height: 40
262
- }, j = 7.5, Fe = {
263
- width: O.aggregate.width,
264
- height: O.aggregate.height
262
+ }, P = 7.5, Ne = {
263
+ width: j.aggregate.width,
264
+ height: j.aggregate.height
265
265
  };
266
- function M(e) {
267
- let t = je(e), n = (t && t.length ? t : "note").split("\n"), r = Math.max(1, ...n.map((e) => e.length));
266
+ function F(e) {
267
+ let t = ke(e), n = (t && t.length ? t : "note").split("\n"), r = Math.max(1, ...n.map((e) => e.length));
268
268
  return {
269
269
  lines: n,
270
- width: Math.max(Fe.width, Math.round(r * j) + 16),
271
- height: Math.max(Fe.height, n.length * 17 + 16)
270
+ width: Math.max(Ne.width, Math.round(r * P) + 16),
271
+ height: Math.max(Ne.height, n.length * 17 + 16)
272
272
  };
273
273
  }
274
- function N(e, t) {
275
- let n = M(e);
274
+ function I(e, t) {
275
+ let n = F(e);
276
276
  return t.width !== n.width || t.height !== n.height;
277
277
  }
278
- var P = {
279
- paper: E.grau,
280
- ink: E.schwarz,
278
+ var L = {
279
+ paper: k.grau,
280
+ ink: k.schwarz,
281
281
  inkSoft: "#5B5B5B",
282
- surface: E.weiss,
283
- stroke: E.schwarz,
282
+ surface: k.weiss,
283
+ stroke: k.schwarz,
284
284
  arrow: "#9E9E9E",
285
- accent: E.blau,
285
+ accent: k.blau,
286
286
  accentSoft: "rgba(51,93,229,0.12)",
287
- stickyText: E.schwarz
288
- }, F = E.schwarz, I = {
287
+ stickyText: k.schwarz
288
+ }, R = k.schwarz, z = {
289
289
  family: "'Geist Variable', 'Geist', ui-sans-serif, system-ui, -apple-system, 'Segoe UI', sans-serif",
290
290
  label: 13
291
- }, Ie = (e) => `<svg width="24" height="24" viewBox="0 0 24 24" class="event-storming-palette-svg">${e}</svg>`, Le = (e, t, n = 0) => Ie(`<rect x="4" y="5" width="16" height="14" fill="${e}" stroke="${t}" stroke-width="1.5"${n ? ` transform="rotate(${n} 12 12)"` : ""}/>`), Re = (e) => `<svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true" focusable="false" class="event-storming-palette-svg">${e}</svg>`, L = {
292
- draw: Re("<circle cx=\"19\" cy=\"5\" r=\"2\"/><circle cx=\"5\" cy=\"19\" r=\"2\"/><path d=\"M6.5 17.5 17.5 6.5\"/>"),
293
- lasso: Re("<path d=\"M12.034 12.681a.498.498 0 0 1 .647-.647l9 3.5a.5.5 0 0 1-.033.943l-3.444 1.068a1 1 0 0 0-.66.66l-1.067 3.443a.5.5 0 0 1-.943.033z\"/><path d=\"M5 3a2 2 0 0 0-2 2\"/><path d=\"M19 3a2 2 0 0 1 2 2\"/><path d=\"M5 21a2 2 0 0 1-2-2\"/><path d=\"M9 3h1\"/><path d=\"M9 21h2\"/><path d=\"M14 3h1\"/><path d=\"M3 9v1\"/><path d=\"M21 9v2\"/><path d=\"M3 14v1\"/>"),
294
- note: Le(k.fill, k.stroke)
291
+ }, Pe = "geometricPrecision", B = `italic 11px ${z.family}`;
292
+ function V(e) {
293
+ return {
294
+ x: e.x + e.width / 2,
295
+ y: e.y + e.height / 2
296
+ };
297
+ }
298
+ function Fe(e, t) {
299
+ let n = V(e), r = t.x - n.x, i = t.y - n.y;
300
+ if (r === 0 && i === 0) return n;
301
+ let a = e.width / 2 + 2, o = e.height / 2 + 2, s = Math.min(r === 0 ? Infinity : a / Math.abs(r), i === 0 ? Infinity : o / Math.abs(i));
302
+ return {
303
+ x: n.x + r * s,
304
+ y: n.y + i * s
305
+ };
306
+ }
307
+ function Ie(e) {
308
+ let t = e.source, n = e.target, r = e.waypoints;
309
+ if (!t || !n) {
310
+ let e = r[0] ?? {
311
+ x: 0,
312
+ y: 0
313
+ };
314
+ return [e, r[r.length - 1] ?? e];
315
+ }
316
+ let i = V(t), a = V(n), o = Fe(t, a), s = Fe(n, i);
317
+ return (a.x - i.x) * (s.x - o.x) + (a.y - i.y) * (s.y - o.y) <= 0 ? [i, a] : [o, s];
318
+ }
319
+ function Le(e) {
320
+ let [t, n] = Ie(e);
321
+ return {
322
+ x: (t.x + n.x) / 2,
323
+ y: (t.y + n.y) / 2 - 5
324
+ };
325
+ }
326
+ function Re(e) {
327
+ if (e.eventStormingType !== "hotspot") return {
328
+ x: e.x,
329
+ y: e.y,
330
+ width: e.width,
331
+ height: e.height
332
+ };
333
+ let t = Math.abs(-3 * Math.PI / 180), n = e.width * Math.cos(t) + e.height * Math.sin(t), r = e.width * Math.sin(t) + e.height * Math.cos(t), i = V(e);
334
+ return {
335
+ x: i.x - n / 2,
336
+ y: i.y - r / 2,
337
+ width: n,
338
+ height: r
339
+ };
340
+ }
341
+ function ze(e) {
342
+ if (!e.linkLabel) return;
343
+ let t = Le(e), { advance: n, left: r, right: i, ascent: a, descent: o } = We(e.linkLabel);
344
+ return {
345
+ x: t.x - n / 2 + r,
346
+ y: t.y - a,
347
+ width: i - r,
348
+ height: a + o
349
+ };
350
+ }
351
+ var Be;
352
+ function Ve() {
353
+ return Be ??= typeof document < "u" && typeof CanvasRenderingContext2D < "u" ? document.createElement("canvas").getContext("2d") : null, Be;
354
+ }
355
+ function He(e) {
356
+ if (e.length === 0 || typeof document > "u" || !("fonts" in document)) return;
357
+ let t = e.join(" ");
358
+ if (!document.fonts.check(B, t)) return document.fonts.load(B, t).then(() => void 0, () => void 0);
359
+ }
360
+ function Ue(e) {
361
+ return e.replace(/[ \t\n\r]+/g, " ").replace(/^ | $/g, "");
362
+ }
363
+ function We(e) {
364
+ let t = Ue(e), n = Ve();
365
+ if (!n) {
366
+ let e = t.length * 11 * (P / z.label);
367
+ return {
368
+ advance: e,
369
+ left: 0,
370
+ right: e,
371
+ ascent: 11,
372
+ descent: 11 / 4
373
+ };
374
+ }
375
+ n.font = B, n.textRendering = Pe;
376
+ let r = n.measureText(t);
377
+ return {
378
+ advance: r.width,
379
+ left: Math.min(0, -r.actualBoundingBoxLeft),
380
+ right: Math.max(r.width, r.actualBoundingBoxRight),
381
+ ascent: r.fontBoundingBoxAscent,
382
+ descent: r.fontBoundingBoxDescent
383
+ };
384
+ }
385
+ //#endregion
386
+ //#region src/draw/palette-icons.ts
387
+ var Ge = (e) => `<svg width="24" height="24" viewBox="0 0 24 24" class="event-storming-palette-svg">${e}</svg>`, Ke = (e, t, n = 0) => Ge(`<rect x="4" y="5" width="16" height="14" fill="${e}" stroke="${t}" stroke-width="1.5"${n ? ` transform="rotate(${n} 12 12)"` : ""}/>`), qe = (e) => `<svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true" focusable="false" class="event-storming-palette-svg">${e}</svg>`, H = {
388
+ draw: qe("<circle cx=\"19\" cy=\"5\" r=\"2\"/><circle cx=\"5\" cy=\"19\" r=\"2\"/><path d=\"M6.5 17.5 17.5 6.5\"/>"),
389
+ lasso: qe("<path d=\"M12.034 12.681a.498.498 0 0 1 .647-.647l9 3.5a.5.5 0 0 1-.033.943l-3.444 1.068a1 1 0 0 0-.66.66l-1.067 3.443a.5.5 0 0 1-.943.033z\"/><path d=\"M5 3a2 2 0 0 0-2 2\"/><path d=\"M19 3a2 2 0 0 1 2 2\"/><path d=\"M5 21a2 2 0 0 1-2-2\"/><path d=\"M9 3h1\"/><path d=\"M9 21h2\"/><path d=\"M14 3h1\"/><path d=\"M3 9v1\"/><path d=\"M21 9v2\"/><path d=\"M3 14v1\"/>"),
390
+ note: Ke(M.fill, M.stroke)
295
391
  };
296
392
  for (let e of S) {
297
- let t = O[e];
298
- L[e] = Le(t.fill, t.stroke, e === "hotspot" ? -6 : 0);
393
+ let t = j[e];
394
+ H[e] = Ke(t.fill, t.stroke, e === "hotspot" ? -6 : 0);
299
395
  }
300
- function ze(e, t) {
396
+ function Je(e, t) {
301
397
  return `<svg width="14" height="14" viewBox="0 0 14 14" class="event-storming-palette-svg"><rect x="1" y="1" width="12" height="12" fill="${e}" stroke="${t}" stroke-width="1"/></svg>`;
302
398
  }
303
399
  //#endregion
304
400
  //#region src/palette/EventStormingPaletteProvider.ts
305
- function R(e) {
401
+ function Ye(e) {
306
402
  if (e.freeArea) return e.freeArea;
307
403
  let t = e.freeRectInsets;
308
404
  return t ? { insets: t } : void 0;
309
405
  }
310
- var Be = 24, z = "stickies-1", B = "stickies-2", Ve = "stickies-3", He = [
406
+ var Xe = 24, U = "stickies-1", Ze = "stickies-2", Qe = "stickies-3", $e = [
311
407
  {
312
408
  key: "event",
313
409
  type: "event",
314
- label: O.event.label,
410
+ label: j.event.label,
315
411
  title: "Domain event",
316
412
  shortcut: "E",
317
- group: z
413
+ group: U
318
414
  },
319
415
  {
320
416
  key: "command",
321
417
  type: "command",
322
- label: O.command.label,
418
+ label: j.command.label,
323
419
  title: "Command",
324
420
  shortcut: "C",
325
- group: z
421
+ group: U
326
422
  },
327
423
  {
328
424
  key: "actor",
329
425
  type: "actor",
330
- label: O.actor.label,
426
+ label: j.actor.label,
331
427
  title: "Actor",
332
- group: z
428
+ group: U
333
429
  },
334
430
  {
335
431
  key: "aggregate",
336
432
  type: "aggregate",
337
- label: O.aggregate.label,
433
+ label: j.aggregate.label,
338
434
  title: "Aggregate",
339
- group: z
435
+ group: U
340
436
  },
341
437
  {
342
438
  key: "policy",
343
439
  type: "policy",
344
- label: O.policy.label,
440
+ label: j.policy.label,
345
441
  title: "Policy",
346
- group: B
442
+ group: Ze
347
443
  },
348
444
  {
349
445
  key: "readmodel",
350
446
  type: "readmodel",
351
- label: O.readmodel.label,
447
+ label: j.readmodel.label,
352
448
  title: "Read model",
353
- group: B
449
+ group: Ze
354
450
  },
355
451
  {
356
452
  key: "external",
357
453
  type: "external",
358
- label: O.external.label,
454
+ label: j.external.label,
359
455
  title: "External system",
360
- group: B
456
+ group: Ze
361
457
  },
362
458
  {
363
459
  key: "hotspot",
364
460
  type: "hotspot",
365
- label: O.hotspot.label,
461
+ label: j.hotspot.label,
366
462
  title: "Hotspot",
367
- group: Ve
463
+ group: Qe
368
464
  },
369
465
  {
370
466
  key: "note",
371
467
  type: "note",
372
- label: k.label,
468
+ label: M.label,
373
469
  title: "Note",
374
- group: Ve
470
+ group: Qe
375
471
  }
376
- ], Ue = class {
472
+ ], et = class {
377
473
  create;
378
474
  factory;
379
475
  lassoTool;
@@ -413,26 +509,26 @@ var Be = 24, z = "stickies-1", B = "stickies-2", Ve = "stickies-3", He = [
413
509
  group: "tools",
414
510
  title: "Lasso",
415
511
  shortcut: "L",
416
- html: `<div class="entry event-storming-palette-entry">${L.lasso}</div>`,
512
+ html: `<div class="entry event-storming-palette-entry">${H.lasso}</div>`,
417
513
  action: { click: (e) => this.lassoTool.activateSelection(e) }
418
514
  }, e["draw-tool"] = {
419
515
  group: "tools",
420
516
  title: "Draw",
421
- html: `<div class="entry event-storming-palette-entry">${L.draw}</div>`,
517
+ html: `<div class="entry event-storming-palette-entry">${H.draw}</div>`,
422
518
  action: { click: () => this.drawTool.toggle() }
423
519
  };
424
- let t = c[this.eventStormingModeling.getLevel()];
425
- for (let n of He) {
520
+ let t = o[this.eventStormingModeling.getLevel()];
521
+ for (let n of $e) {
426
522
  if (n.type !== "note" && !t.includes(n.type)) continue;
427
523
  let r = (e) => {
428
524
  let t = this.factory.createNew(n.type, n.label);
429
- We(e) && this.placeInFreeRect(t) || this.create.start(e, t);
525
+ tt(e) && this.placeInFreeRect(t) || this.create.start(e, t);
430
526
  };
431
527
  e[`create.${n.key}`] = {
432
528
  group: n.group,
433
529
  title: n.title,
434
530
  ...n.shortcut ? { shortcut: n.shortcut } : {},
435
- html: `<div class="entry event-storming-palette-entry" draggable="true">${L[n.key]}</div>`,
531
+ html: `<div class="entry event-storming-palette-entry" draggable="true">${H[n.key]}</div>`,
436
532
  action: {
437
533
  dragstart: r,
438
534
  click: r
@@ -445,12 +541,12 @@ var Be = 24, z = "stickies-1", B = "stickies-2", Ve = "stickies-3", He = [
445
541
  let { canvas: t, modeling: n, selection: r, elementRegistry: i } = this;
446
542
  if (!t || !n || !r || !i) return !1;
447
543
  let a = this.freeAreaCentre(t), o = (e) => i.filter(b).some((t) => Math.abs(t.x + t.width / 2 - e.x) < 1 && Math.abs(t.y + t.height / 2 - e.y) < 1);
448
- for (; o(a);) a.x += Be, a.y += Be;
544
+ for (; o(a);) a.x += Xe, a.y += Xe;
449
545
  let s = n.createShape(e, a, t.getRootElement());
450
546
  return r.select(s), t.focus(), this.labelEditing?.activate(s), !0;
451
547
  }
452
548
  freeAreaCentre(e) {
453
- let t = this.config && R(this.config), n = t?.center?.();
549
+ let t = this.config && Ye(this.config), n = t?.center?.();
454
550
  if (n) return {
455
551
  x: n.x,
456
552
  y: n.y
@@ -467,27 +563,31 @@ var Be = 24, z = "stickies-1", B = "stickies-2", Ve = "stickies-3", He = [
467
563
  };
468
564
  }
469
565
  };
470
- function We(e) {
566
+ function tt(e) {
471
567
  return e.type === "click" && e.detail === 0;
472
568
  }
473
569
  //#endregion
474
570
  //#region src/EventStormingBaseViewer.ts
475
- function Ge(e) {
571
+ function nt(e) {
476
572
  for (let { id: t } of [...e.elements, ...e.edges]) if (t === "event-storming-root" || t.startsWith("__implicitroot")) throw Error(`Element id "${t}" is reserved for the board itself.`);
477
573
  }
478
- function Ke(e) {
574
+ function rt(e) {
575
+ return e.edges.flatMap((e) => e.label ? [e.label] : []);
576
+ }
577
+ function it(e) {
479
578
  return typeof e == "number" ? `${e}px` : e;
480
579
  }
481
- var qe = class {
580
+ var at = class {
482
581
  _diagram;
483
582
  _container;
484
583
  _options;
584
+ _waitingImport;
485
585
  constructor(e = {}) {
486
586
  this._options = e, this._container = this._createContainer(e);
487
587
  }
488
588
  _createContainer(e) {
489
589
  let t = e.container ?? document.createElement("div");
490
- return t.classList.add("event-storming-container"), t.style.width = Ke(e.width ?? "100%"), t.style.height = Ke(e.height ?? (e.container ? "100%" : "600px")), t;
590
+ return t.classList.add("event-storming-container"), t.style.width = it(e.width ?? "100%"), t.style.height = it(e.height ?? (e.container ? "100%" : "600px")), t;
491
591
  }
492
592
  _ensureDiagram() {
493
593
  if (!this._diagram) {
@@ -496,7 +596,7 @@ var qe = class {
496
596
  canvas: { container: this._container },
497
597
  modules: t,
498
598
  eventStormingKeyboard: { undoRedoKeys: this._options.undoRedoKeys ?? !0 },
499
- eventStormingPalette: { freeArea: R(this._options) },
599
+ eventStormingPalette: { freeArea: Ye(this._options) },
500
600
  eventStormingImporter: { fitOnImport: this._options.fitOnImport ?? !0 }
501
601
  });
502
602
  }
@@ -513,35 +613,48 @@ var qe = class {
513
613
  }
514
614
  async importMap(e) {
515
615
  let t = this._ensureDiagram(), n = t.get("eventBus"), r = t.get("eventStormingImporter");
516
- Ge(e);
517
- let i = t.get("eventStormingLabelEditing", !1);
518
- i?.suspend(), t.get("popupMenu", !1)?.close(), r.clear();
519
- let a = r.import(e);
520
- return t.get("commandStack", !1)?.clear(!1), n.fire("import.done", { warnings: a }), i?.resumeAfterImport(), { warnings: a };
616
+ nt(e), s(e);
617
+ let i = this._importTurn(e);
618
+ if (i && (await i, this._waitingImport === i && (this._waitingImport = void 0), this._diagram !== t)) throw Error("The viewer was destroyed during the import.");
619
+ let a = t.get("eventStormingLabelEditing", !1);
620
+ a?.suspend(), t.get("popupMenu", !1)?.close(), r.clear();
621
+ let o = r.import(e);
622
+ return t.get("commandStack", !1)?.clear(!1), n.fire("import.done", { warnings: o }), a?.resumeAfterImport(), { warnings: o };
623
+ }
624
+ _importTurn(e) {
625
+ let t = [this._waitingImport, He(rt(e))].filter((e) => e !== void 0);
626
+ if (t.length === 0) return;
627
+ let n = Promise.all(t);
628
+ return this._waitingImport = n, n;
521
629
  }
522
630
  async importDSL(e) {
523
- let n = this._ensureDiagram().get("eventBus");
524
- n.fire("import.parse.start", { text: e });
525
- let { board: r, diagnostics: i } = t(e);
526
- n.fire("import.parse.done", {
527
- board: r,
528
- diagnostics: i
631
+ let t = this._ensureDiagram().get("eventBus");
632
+ t.fire("import.parse.start", { text: e });
633
+ let { board: n, diagnostics: r } = l(e);
634
+ t.fire("import.parse.done", {
635
+ board: n,
636
+ diagnostics: r
529
637
  });
530
- let { warnings: a } = await this.importMap(r);
531
- return { warnings: [...i.map((e) => ({
638
+ let { warnings: i } = await this.importMap(n);
639
+ return { warnings: [...r.map((e) => ({
532
640
  message: `Line ${e.line}: ${e.message}`,
533
641
  line: e.line,
534
642
  source: e.text
535
- })), ...a] };
643
+ })), ...i] };
536
644
  }
537
645
  exportMap() {
538
646
  return this.get("eventStormingExporter").export();
539
647
  }
540
648
  exportDSL() {
541
- return n(this.exportMap());
649
+ return u(this.exportMap());
650
+ }
651
+ contentBounds() {
652
+ if (!this._diagram) return;
653
+ let e = this._diagram.get("boardBounds");
654
+ return e.isEmpty() ? void 0 : e.contentBounds(0);
542
655
  }
543
656
  async saveSVG() {
544
- return Se(this.get("canvas"), this.get("boardBounds").contentBounds());
657
+ return Ce(this.get("canvas"), this.get("boardBounds").contentBounds());
545
658
  }
546
659
  attachTo(e) {
547
660
  e.appendChild(this._container), this.get("canvas").resized();
@@ -558,15 +671,15 @@ var qe = class {
558
671
  get container() {
559
672
  return this._container;
560
673
  }
561
- }, Je = "0123456789abcdefghijklmnopqrstuvwxyz", Ye = 252;
562
- function Xe() {
674
+ }, ot = "0123456789abcdefghijklmnopqrstuvwxyz", st = 252;
675
+ function ct() {
563
676
  let e = "";
564
- for (; e.length < 8;) for (let t of globalThis.crypto.getRandomValues(/* @__PURE__ */ new Uint8Array(8))) t >= Ye || e.length === 8 || (e += Je[t % 36]);
677
+ for (; e.length < 8;) for (let t of globalThis.crypto.getRandomValues(/* @__PURE__ */ new Uint8Array(8))) t >= st || e.length === 8 || (e += ot[t % 36]);
565
678
  return e;
566
679
  }
567
680
  //#endregion
568
681
  //#region src/model/EventStormingElementFactory.ts
569
- var Ze = {
682
+ var lt = {
570
683
  event: "event",
571
684
  command: "cmd",
572
685
  actor: "actor",
@@ -577,7 +690,7 @@ var Ze = {
577
690
  hotspot: "hot",
578
691
  note: "note",
579
692
  drawing: "draw"
580
- }, Qe = class {
693
+ }, ut = class {
581
694
  elementFactory;
582
695
  elementRegistry;
583
696
  static $inject = ["elementFactory", "elementRegistry"];
@@ -596,15 +709,15 @@ var Ze = {
596
709
  return `${e} ${n}`;
597
710
  }
598
711
  allocateId(e, t) {
599
- let n = Ze[e];
712
+ let n = lt[e];
600
713
  for (;;) {
601
- let e = `${n}_${Xe()}`;
714
+ let e = `${n}_${ct()}`;
602
715
  if (!this.elementRegistry.get(e) && !t?.has(e)) return e;
603
716
  }
604
717
  }
605
718
  createSticky(e) {
606
719
  if (!C(e.elementType)) throw Error(`not a sticky kind: ${e.elementType}`);
607
- let { width: t, height: n } = O[e.elementType];
720
+ let { width: t, height: n } = j[e.elementType];
608
721
  return this.elementFactory.createShape({
609
722
  id: e.id,
610
723
  x: e.position.x - t / 2,
@@ -618,7 +731,7 @@ var Ze = {
618
731
  });
619
732
  }
620
733
  createNote(e) {
621
- let { width: t, height: n } = e.size ?? M(e.label), r = e.align?.horizontal, i = e.align?.vertical;
734
+ let { width: t, height: n } = e.size ?? F(e.label), r = e.align?.horizontal, i = e.align?.vertical;
622
735
  return this.elementFactory.createShape({
623
736
  id: e.id,
624
737
  x: e.position.x - t / 2,
@@ -663,7 +776,7 @@ var Ze = {
663
776
  });
664
777
  }
665
778
  createNew(e, t) {
666
- let n = this.uniqueLabel(t), { width: r, height: i } = C(e) ? O[e] : M(n);
779
+ let n = this.uniqueLabel(t), { width: r, height: i } = C(e) ? j[e] : F(n);
667
780
  return this.elementFactory.createShape({
668
781
  id: this.allocateId(e),
669
782
  width: r,
@@ -673,7 +786,7 @@ var Ze = {
673
786
  });
674
787
  }
675
788
  createProvisional() {
676
- let { width: e, height: t } = O.event;
789
+ let { width: e, height: t } = j.event;
677
790
  return this.elementFactory.createShape({
678
791
  id: this.allocateId("event"),
679
792
  width: e,
@@ -688,14 +801,14 @@ var Ze = {
688
801
  id: e.id,
689
802
  source: t,
690
803
  target: n,
691
- waypoints: [$e(t), $e(n)],
804
+ waypoints: [dt(t), dt(n)],
692
805
  eventStormingType: "arrow",
693
806
  ...e.label ? { linkLabel: e.label } : {},
694
807
  businessObject: e
695
808
  });
696
809
  }
697
810
  };
698
- function $e(e) {
811
+ function dt(e) {
699
812
  return {
700
813
  x: e.x + e.width / 2,
701
814
  y: e.y + e.height / 2
@@ -703,61 +816,8 @@ function $e(e) {
703
816
  }
704
817
  //#endregion
705
818
  //#region src/model/index.ts
706
- var et = { eventStormingElementFactory: ["type", Qe] };
707
- //#endregion
708
- //#region src/board-bounds/BoardBounds.ts
709
- function tt(e) {
710
- return e.id !== "event-storming-root" && !e.waypoints && typeof e.x == "number" && typeof e.y == "number" && typeof e.width == "number" && typeof e.height == "number";
711
- }
712
- var nt = class {
713
- elementRegistry;
714
- static $inject = ["elementRegistry"];
715
- constructor(e) {
716
- this.elementRegistry = e;
717
- }
718
- contentBounds(e = 120) {
719
- let t = this.positionedShapes();
720
- if (!t.length) return {
721
- x: 0,
722
- y: 0,
723
- ...o
724
- };
725
- let n = Math.min(...t.map((e) => e.x)), r = Math.min(...t.map((e) => e.y)), i = Math.max(...t.map((e) => e.x + e.width)), a = Math.max(...t.map((e) => e.y + e.height));
726
- return {
727
- x: n - e,
728
- y: r - e,
729
- width: i - n + 2 * e,
730
- height: a - r + 2 * e
731
- };
732
- }
733
- isEmpty() {
734
- return this.positionedShapes().length === 0;
735
- }
736
- positionedShapes() {
737
- return this.elementRegistry.getAll().filter(tt);
738
- }
739
- }, rt = { boardBounds: ["type", nt] }, it = "eventStorming.viewOptions.changed", at = class {
740
- eventBus;
741
- elementRegistry;
742
- static $inject = ["eventBus", "elementRegistry"];
743
- _typeCaptionsVisible = !0;
744
- constructor(e, t) {
745
- this.eventBus = e, this.elementRegistry = t;
746
- }
747
- typeCaptionsVisible() {
748
- return this._typeCaptionsVisible;
749
- }
750
- setTypeCaptionsVisible(e) {
751
- if (e === this._typeCaptionsVisible) return;
752
- this._typeCaptionsVisible = e, this.eventBus.fire(it, { typeCaptionsVisible: e });
753
- let t = this.elementRegistry.filter(w);
754
- t.length && this.eventBus.fire("elements.changed", { elements: t });
755
- }
756
- }, V = {
757
- __depends__: [u],
758
- eventStormingViewOptions: ["type", at]
759
- }, ot = 1500, st = -3, ct = "event-storming-kind-caption", lt = 9, ut = 300, dt = P.stickyText, ft = 7, pt = "#FBFBFB", mt = "#B9B9B9", ht = "6 4", gt = "event-storming-sticky-shadow";
760
- function _t(e) {
819
+ var ft = { eventStormingElementFactory: ["type", ut] }, pt = 1500, mt = "event-storming-kind-caption", ht = 9, gt = 300, _t = L.stickyText, vt = 7, yt = "#FBFBFB", bt = "#B9B9B9", xt = "6 4", St = "event-storming-sticky-shadow";
820
+ function Ct(e) {
761
821
  let t = e.closest("svg");
762
822
  if (!t) return !1;
763
823
  if (t.querySelector("#event-storming-sticky-shadow")) return !0;
@@ -768,7 +828,7 @@ function _t(e) {
768
828
  "flood-color": "#000000",
769
829
  "flood-opacity": .2
770
830
  }), r = p(m("filter"), {
771
- id: gt,
831
+ id: St,
772
832
  x: "-40%",
773
833
  y: "-40%",
774
834
  width: "180%",
@@ -778,11 +838,11 @@ function _t(e) {
778
838
  let i = m("defs");
779
839
  return f(i, r), t.insertBefore(i, t.firstChild), !0;
780
840
  }
781
- var vt = class extends d {
841
+ var wt = class extends d {
782
842
  viewOptions;
783
843
  static $inject = ["eventBus", "eventStormingViewOptions"];
784
844
  constructor(e, t) {
785
- super(e, ot), this.viewOptions = t;
845
+ super(e, pt), this.viewOptions = t;
786
846
  }
787
847
  canRender(e) {
788
848
  return b(e) || x(e);
@@ -795,7 +855,7 @@ var vt = class extends d {
795
855
  let n = t.drawingPoints ?? [], r = t.strokeStyle === "dashed" ? "8 5" : t.strokeStyle === "dotted" ? "2 4" : void 0, i = p(m(t.closed ? "polygon" : "polyline"), {
796
856
  points: n.map((e) => `${e.x},${e.y}`).join(" "),
797
857
  fill: "none",
798
- stroke: t.color ?? F,
858
+ stroke: t.color ?? R,
799
859
  "stroke-width": 2,
800
860
  "stroke-linecap": "round",
801
861
  "stroke-linejoin": "round",
@@ -804,9 +864,9 @@ var vt = class extends d {
804
864
  return f(e, i), i;
805
865
  }
806
866
  drawSticky(e, t) {
807
- let n = t.eventStormingType, r = C(n) ? O[n] : k, i = t.provisional === !0, a = e;
867
+ let n = t.eventStormingType, r = C(n) ? j[n] : M, i = t.provisional === !0, a = e;
808
868
  if (n === "hotspot") {
809
- let n = p(m("g"), { transform: `rotate(${st} ${t.width / 2} ${t.height / 2})` });
869
+ let n = p(m("g"), { transform: `rotate(-3 ${t.width / 2} ${t.height / 2})` });
810
870
  f(e, n), a = n;
811
871
  }
812
872
  let o = p(m("rect"), {
@@ -815,37 +875,38 @@ var vt = class extends d {
815
875
  width: Math.max(t.width, 1),
816
876
  height: Math.max(t.height, 1),
817
877
  rx: 0,
818
- fill: i ? pt : t.color ?? r.fill,
819
- stroke: i ? mt : r.stroke,
878
+ fill: i ? yt : t.color ?? r.fill,
879
+ stroke: i ? bt : r.stroke,
820
880
  "stroke-width": 1.5,
821
- ...i ? { "stroke-dasharray": ht } : {}
881
+ ...i ? { "stroke-dasharray": xt } : {}
822
882
  });
823
- if (_t(e) && o.setAttribute("filter", `url(#${gt})`), f(a, o), i) return o;
824
- if (n === "note" ? Ct(a, t) : bt(a, t), C(n) && this.viewOptions.typeCaptionsVisible()) {
825
- let e = H(O[n].label, t.width / 2, t.height - ft, {
883
+ if (Ct(e) && o.setAttribute("filter", `url(#${St})`), f(a, o), i) return o;
884
+ if (n === "note" ? kt(a, t) : Et(a, t), C(n) && this.viewOptions.typeCaptionsVisible()) {
885
+ let e = Pt(j[n].label, t.width / 2, t.height - vt, {
826
886
  "text-anchor": "middle",
827
- "font-size": lt,
828
- fill: dt
887
+ "font-size": ht,
888
+ fill: _t
829
889
  });
830
- e.setAttribute("class", ct), e.setAttribute("font-weight", String(ut)), f(a, e);
890
+ e.setAttribute("class", mt), e.setAttribute("font-weight", String(gt)), f(a, e);
831
891
  }
832
892
  return o;
833
893
  }
834
894
  drawConnection(e, t) {
835
- let n = t, [r, i] = At(n), a = p(m("polyline"), {
895
+ let n = t, [r, i] = Ie(n), a = p(m("polyline"), {
836
896
  points: `${r.x},${r.y} ${i.x},${i.y}`,
837
897
  fill: "none",
838
- stroke: P.arrow,
898
+ stroke: L.arrow,
839
899
  "stroke-width": 1.5,
840
900
  "stroke-linecap": "round"
841
901
  });
842
- if (f(e, a), f(e, Ot(r, i, P.arrow, 11, 5)), n.linkLabel) {
843
- let t = (r.x + i.x) / 2, a = (r.y + i.y) / 2;
844
- f(e, H(n.linkLabel, t, a - 5, {
902
+ if (f(e, a), f(e, Ft(r, i, L.arrow, 11, 5)), n.linkLabel) {
903
+ let t = Le(n);
904
+ f(e, Pt(n.linkLabel, t.x, t.y, {
845
905
  "text-anchor": "middle",
846
906
  "font-size": 11,
847
907
  "font-style": "italic",
848
- fill: P.inkSoft
908
+ "text-rendering": Pe,
909
+ fill: L.inkSoft
849
910
  }));
850
911
  }
851
912
  return a;
@@ -859,7 +920,7 @@ var vt = class extends d {
859
920
  return t ? `M${t.x},${t.y}` + n.map((e) => `L${e.x},${e.y}`).join("") : "";
860
921
  }
861
922
  };
862
- function yt(e, t) {
923
+ function Tt(e, t) {
863
924
  let n = e.split(/\s+/).filter((e) => e.length);
864
925
  if (!n.length) return [""];
865
926
  let r = [], i = "";
@@ -876,25 +937,25 @@ function yt(e, t) {
876
937
  }
877
938
  return r.push(i), r;
878
939
  }
879
- function bt(e, t) {
880
- let n = t.width - 16, r = Math.max(1, Math.floor(n / j)), i = Math.max(1, Math.floor((t.height - 16) / 17)), a = (t.eventStormingLabel ?? "").split("\n").flatMap((e) => yt(e, r)).slice(0, i), o = t.width / 2, s = t.height / 2 - (a.length - 1) * 17 / 2 + 4;
940
+ function Et(e, t) {
941
+ let n = t.width - 16, r = Math.max(1, Math.floor(n / P)), i = Math.max(1, Math.floor((t.height - 16) / 17)), a = (t.eventStormingLabel ?? "").split("\n").flatMap((e) => Tt(e, r)).slice(0, i), o = t.width / 2, s = t.height / 2 - (a.length - 1) * 17 / 2 + 4;
881
942
  a.forEach((t, n) => {
882
- f(e, H(t, o, s + n * 17, {
943
+ f(e, Pt(t, o, s + n * 17, {
883
944
  "text-anchor": "middle",
884
- fill: P.stickyText
945
+ fill: L.stickyText
885
946
  }));
886
947
  });
887
948
  }
888
- var xt = 2, St = 12.5;
889
- function Ct(e, t) {
890
- let n = t.width - 16, r = Math.max(1, Math.floor(n / j)), i = Math.max(1, Math.floor((t.height - 16) / 17)), a = D(t.eventStormingLabel ?? "").flatMap((e) => wt(e, r)).slice(0, i), o = t.alignHorizontal ?? "left", s = t.alignVertical ?? "top", c = o === "left" ? "start" : o === "center" ? "middle" : "end", l = a.length * 17, u = s === "top" ? 8 : s === "middle" ? (t.height - l) / 2 : t.height - 8 - l;
949
+ var Dt = 2, Ot = 12.5;
950
+ function kt(e, t) {
951
+ let n = t.width - 16, r = Math.max(1, Math.floor(n / P)), i = Math.max(1, Math.floor((t.height - 16) / 17)), a = A(t.eventStormingLabel ?? "").flatMap((e) => At(e, r)).slice(0, i), o = t.alignHorizontal ?? "left", s = t.alignVertical ?? "top", c = o === "left" ? "start" : o === "center" ? "middle" : "end", l = a.length * 17, u = s === "top" ? 8 : s === "middle" ? (t.height - l) / 2 : t.height - 8 - l;
891
952
  a.forEach((n, r) => {
892
953
  let i = o === "left" ? 8 + (n.indent ? 12 : 0) : o === "center" ? t.width / 2 : t.width - 8, a = p(m("text"), {
893
954
  x: i,
894
- y: u + r * 17 + St,
895
- "font-family": I.family,
896
- "font-size": I.label,
897
- fill: P.stickyText,
955
+ y: u + r * 17 + Ot,
956
+ "font-family": z.family,
957
+ "font-size": z.label,
958
+ fill: L.stickyText,
898
959
  "text-anchor": c
899
960
  }), s = n.marker ? [{
900
961
  text: "• ",
@@ -908,19 +969,19 @@ function Ct(e, t) {
908
969
  f(e, a);
909
970
  });
910
971
  }
911
- function wt(e, t) {
912
- let n = Math.max(1, t - (e.bullet ? xt : 0));
913
- return Tt(e.runs, n).map((t, n) => ({
972
+ function At(e, t) {
973
+ let n = Math.max(1, t - (e.bullet ? Dt : 0));
974
+ return jt(e.runs, n).map((t, n) => ({
914
975
  runs: t,
915
976
  marker: e.bullet && n === 0,
916
977
  indent: e.bullet && n > 0
917
978
  }));
918
979
  }
919
- function Tt(e, t) {
980
+ function jt(e, t) {
920
981
  let n = e.map((e) => e.text).join("");
921
- return n.length <= t ? [e] : Et(n, t).map(([t, n]) => Dt(e, t, n));
982
+ return n.length <= t ? [e] : Mt(n, t).map(([t, n]) => Nt(e, t, n));
922
983
  }
923
- function Et(e, t) {
984
+ function Mt(e, t) {
924
985
  let n = [...e.matchAll(/\S+/g)];
925
986
  if (!n.length) return [[0, 0]];
926
987
  let r = [], i = -1, a = -1, o = () => {
@@ -935,7 +996,7 @@ function Et(e, t) {
935
996
  }
936
997
  return o(), r;
937
998
  }
938
- function Dt(e, t, n) {
999
+ function Nt(e, t, n) {
939
1000
  let r = [], i = 0;
940
1001
  for (let a of e) {
941
1002
  let e = i;
@@ -949,58 +1010,93 @@ function Dt(e, t, n) {
949
1010
  }
950
1011
  return r;
951
1012
  }
952
- function H(e, t, n, r = {}) {
1013
+ function Pt(e, t, n, r = {}) {
953
1014
  let i = p(m("text"), {
954
1015
  x: t,
955
1016
  y: n,
956
- "font-family": I.family,
957
- "font-size": I.label,
958
- fill: P.ink,
1017
+ "font-family": z.family,
1018
+ "font-size": z.label,
1019
+ fill: L.ink,
959
1020
  ...r
960
1021
  });
961
1022
  return i.textContent = e, i;
962
1023
  }
963
- function Ot(e, t, n, r = 10, i = 5) {
1024
+ function Ft(e, t, n, r = 10, i = 5) {
964
1025
  let a = Math.atan2(t.y - e.y, t.x - e.x), o = t.x - r * Math.cos(a), s = t.y - r * Math.sin(a), c = `${t.x},${t.y} ${o - i * Math.sin(a)},${s + i * Math.cos(a)} ${o + i * Math.sin(a)},${s - i * Math.cos(a)}`;
965
1026
  return p(m("polygon"), {
966
1027
  points: c,
967
1028
  fill: n
968
1029
  });
969
1030
  }
970
- function U(e) {
971
- return {
972
- x: e.x + e.width / 2,
973
- y: e.y + e.height / 2
974
- };
975
- }
976
- function kt(e, t) {
977
- let n = U(e), r = t.x - n.x, i = t.y - n.y;
978
- if (r === 0 && i === 0) return n;
979
- let a = e.width / 2 + 2, o = e.height / 2 + 2, s = Math.min(r === 0 ? Infinity : a / Math.abs(r), i === 0 ? Infinity : o / Math.abs(i));
980
- return {
981
- x: n.x + r * s,
982
- y: n.y + i * s
983
- };
1031
+ //#endregion
1032
+ //#region src/view-options/EventStormingViewOptions.ts
1033
+ var It = "eventStorming.viewOptions.changed", Lt = class {
1034
+ eventBus;
1035
+ elementRegistry;
1036
+ static $inject = ["eventBus", "elementRegistry"];
1037
+ _typeCaptionsVisible = !0;
1038
+ constructor(e, t) {
1039
+ this.eventBus = e, this.elementRegistry = t;
1040
+ }
1041
+ typeCaptionsVisible() {
1042
+ return this._typeCaptionsVisible;
1043
+ }
1044
+ setTypeCaptionsVisible(e) {
1045
+ if (e === this._typeCaptionsVisible) return;
1046
+ this._typeCaptionsVisible = e, this.eventBus.fire(It, { typeCaptionsVisible: e });
1047
+ let t = this.elementRegistry.filter(w);
1048
+ t.length && this.eventBus.fire("elements.changed", { elements: t });
1049
+ }
1050
+ }, Rt = {
1051
+ __depends__: [g],
1052
+ eventStormingViewOptions: ["type", Lt]
1053
+ }, zt = {
1054
+ __depends__: [Rt],
1055
+ __init__: ["eventStormingRenderer"],
1056
+ eventStormingRenderer: ["type", wt]
1057
+ };
1058
+ //#endregion
1059
+ //#region src/board-bounds/BoardBounds.ts
1060
+ function Bt(e) {
1061
+ return e.id !== "event-storming-root" && !e.waypoints && typeof e.x == "number" && typeof e.y == "number" && typeof e.width == "number" && typeof e.height == "number";
984
1062
  }
985
- function At(e) {
986
- let t = e.source, n = e.target, r = e.waypoints;
987
- if (!t || !n) {
988
- let e = r[0] ?? {
1063
+ var Vt = class {
1064
+ elementRegistry;
1065
+ static $inject = ["elementRegistry"];
1066
+ constructor(e) {
1067
+ this.elementRegistry = e;
1068
+ }
1069
+ contentBounds(e = 120) {
1070
+ let t = this.drawnBoxes();
1071
+ if (!t.length) return {
989
1072
  x: 0,
990
- y: 0
1073
+ y: 0,
1074
+ ...i
1075
+ };
1076
+ let n = Math.min(...t.map((e) => e.x)), r = Math.min(...t.map((e) => e.y)), a = Math.max(...t.map((e) => e.x + e.width)), o = Math.max(...t.map((e) => e.y + e.height));
1077
+ return {
1078
+ x: n - e,
1079
+ y: r - e,
1080
+ width: a - n + 2 * e,
1081
+ height: o - r + 2 * e
991
1082
  };
992
- return [e, r[r.length - 1] ?? e];
993
1083
  }
994
- let i = U(t), a = U(n), o = kt(t, a), s = kt(n, i);
995
- return (a.x - i.x) * (s.x - o.x) + (a.y - i.y) * (s.y - o.y) <= 0 ? [i, a] : [o, s];
996
- }
997
- //#endregion
998
- //#region src/draw/index.ts
999
- var jt = {
1000
- __depends__: [V],
1001
- __init__: ["eventStormingRenderer"],
1002
- eventStormingRenderer: ["type", vt]
1003
- }, Mt = { drawing: 0 }, Nt = .001, Pt = class {
1084
+ isEmpty() {
1085
+ return this.positionedShapes().length === 0;
1086
+ }
1087
+ drawnBoxes() {
1088
+ let e = this.positionedShapes().map(Re);
1089
+ for (let t of this.elementRegistry.getAll()) {
1090
+ if (!x(t)) continue;
1091
+ let n = ze(t);
1092
+ n && e.push(n);
1093
+ }
1094
+ return e;
1095
+ }
1096
+ positionedShapes() {
1097
+ return this.elementRegistry.getAll().filter(Bt);
1098
+ }
1099
+ }, Ht = { boardBounds: ["type", Vt] }, Ut = { drawing: 0 }, Wt = .001, Gt = class {
1004
1100
  canvas;
1005
1101
  elementFactory;
1006
1102
  factory;
@@ -1028,7 +1124,7 @@ var jt = {
1028
1124
  ...e.rawPassthrough ? { rawPassthrough: e.rawPassthrough } : {}
1029
1125
  }, r = this.boardRoot();
1030
1126
  r.businessObject = n;
1031
- let i = /* @__PURE__ */ new Map(), a = [...e.elements].sort((e, t) => (Mt[e.elementType] ?? 9) - (Mt[t.elementType] ?? 9)), o = a.filter((e) => e.elementType === "drawing"), s = a.filter((e) => e.elementType !== "drawing");
1127
+ let i = /* @__PURE__ */ new Map(), a = [...e.elements].sort((e, t) => (Ut[e.elementType] ?? 9) - (Ut[t.elementType] ?? 9)), o = a.filter((e) => e.elementType === "drawing"), s = a.filter((e) => e.elementType !== "drawing");
1032
1128
  for (let e of o) {
1033
1129
  let t = this.createShape(e);
1034
1130
  this.canvas.addShape(t, r), i.set(e.id, t);
@@ -1041,7 +1137,7 @@ var jt = {
1041
1137
  let n = "attachedTo" in e ? e.attachedTo : void 0;
1042
1138
  if (!n) continue;
1043
1139
  let r = i.get(n);
1044
- !r || !De(r) ? t.push({
1140
+ !r || !D(r) ? t.push({
1045
1141
  message: `“${e.id}” is pinned to “${n}”, which isn't on the board or can't hold a pin. It stays unpinned.`,
1046
1142
  elementId: e.id
1047
1143
  }) : i.get(e.id).host = r;
@@ -1072,7 +1168,7 @@ var jt = {
1072
1168
  this.canvas.viewbox(e);
1073
1169
  return;
1074
1170
  }
1075
- let r = this.boardBounds.isEmpty() ? 1 : Math.max(Math.min(t / e.width, n / e.height, 1), Nt);
1171
+ let r = this.boardBounds.isEmpty() ? 1 : Math.max(Math.min(t / e.width, n / e.height, 1), Wt);
1076
1172
  this.canvas.viewbox({
1077
1173
  x: e.x + e.width / 2 - t / 2 / r,
1078
1174
  y: e.y + e.height / 2 - n / 2 / r,
@@ -1097,16 +1193,16 @@ var jt = {
1097
1193
  } catch {}
1098
1194
  }
1099
1195
  }
1100
- }, Ft = class {
1196
+ }, Kt = class {
1101
1197
  elementRegistry;
1102
1198
  static $inject = ["elementRegistry"];
1103
1199
  constructor(e) {
1104
1200
  this.elementRegistry = e;
1105
1201
  }
1106
1202
  export() {
1107
- let e = this.elementRegistry.get(y)?.businessObject, t = e?.config ?? { title: "Untitled Board" }, n = [], r = [];
1203
+ let e = this.elementRegistry.get(y)?.businessObject, t = e?.config ?? { title: "Untitled Board" }, r = [], i = [];
1108
1204
  for (let e of this.elementRegistry.getAll()) if (e.id !== "event-storming-root") {
1109
- if (x(e)) r.push({
1205
+ if (x(e)) i.push({
1110
1206
  id: e.id,
1111
1207
  edgeType: "arrow",
1112
1208
  from: e.source?.id ?? "",
@@ -1115,17 +1211,17 @@ var jt = {
1115
1211
  });
1116
1212
  else if (b(e)) {
1117
1213
  let t = this.buildElement(e);
1118
- t && n.push(t);
1214
+ t && r.push(t);
1119
1215
  }
1120
1216
  }
1121
1217
  let a = {
1122
- schemaVersion: i,
1218
+ schemaVersion: n,
1123
1219
  config: t,
1124
- elements: n,
1125
- edges: r,
1220
+ elements: r,
1221
+ edges: i,
1126
1222
  ...e?.rawPassthrough ? { rawPassthrough: e.rawPassthrough } : {}
1127
1223
  };
1128
- return l(a);
1224
+ return c(a);
1129
1225
  }
1130
1226
  buildElement(e) {
1131
1227
  if (e.eventStormingType === "drawing") {
@@ -1144,10 +1240,10 @@ var jt = {
1144
1240
  ...e.color ? { color: e.color } : {}
1145
1241
  };
1146
1242
  }
1147
- let t = e.eventStormingType === "note" && N(e.eventStormingLabel, e) ? {
1243
+ let t = e.eventStormingType === "note" && I(e.eventStormingLabel, e) ? {
1148
1244
  width: e.width,
1149
1245
  height: e.height
1150
- } : void 0, n = e.eventStormingType === "note" ? It(e) : void 0;
1246
+ } : void 0, n = e.eventStormingType === "note" ? qt(e) : void 0;
1151
1247
  return {
1152
1248
  id: e.id,
1153
1249
  elementType: e.eventStormingType,
@@ -1163,7 +1259,7 @@ var jt = {
1163
1259
  };
1164
1260
  }
1165
1261
  };
1166
- function It(e) {
1262
+ function qt(e) {
1167
1263
  let t = e.alignHorizontal && e.alignHorizontal !== "left" ? e.alignHorizontal : void 0, n = e.alignVertical && e.alignVertical !== "top" ? e.alignVertical : void 0;
1168
1264
  if (t || n) return {
1169
1265
  ...t ? { horizontal: t } : {},
@@ -1172,62 +1268,62 @@ function It(e) {
1172
1268
  }
1173
1269
  //#endregion
1174
1270
  //#region src/io/warnings.ts
1175
- function Lt(e) {
1271
+ function Jt(e) {
1176
1272
  return e.source === void 0 ? e.message : `${e.message} (“${e.source}”)`;
1177
1273
  }
1178
1274
  //#endregion
1179
1275
  //#region src/io/index.ts
1180
- var Rt = {
1181
- eventStormingImporter: ["type", Pt],
1182
- eventStormingExporter: ["type", Ft]
1183
- }, zt = class extends qe {
1276
+ var Yt = {
1277
+ eventStormingImporter: ["type", Gt],
1278
+ eventStormingExporter: ["type", Kt]
1279
+ }, Xt = class extends at {
1184
1280
  _getModules() {
1185
1281
  return [
1186
- et,
1187
- rt,
1188
- V,
1189
- jt,
1190
- Rt
1282
+ ft,
1283
+ Ht,
1284
+ Rt,
1285
+ zt,
1286
+ Yt
1191
1287
  ];
1192
1288
  }
1193
- }, W = class extends zt {
1289
+ }, Zt = class extends Xt {
1194
1290
  _getModules() {
1195
1291
  return [
1196
1292
  ...super._getModules(),
1197
- g,
1198
1293
  _,
1199
1294
  v,
1200
- ee
1295
+ ee,
1296
+ te
1201
1297
  ];
1202
1298
  }
1203
- }, Bt = class extends de {
1299
+ }, Qt = class extends fe {
1204
1300
  static $inject = ["eventBus", "modeling"];
1205
1301
  constructor(e, t) {
1206
1302
  super(e), this.preExecute("element.updateProperties", (e) => {
1207
1303
  let { element: n, properties: r } = e.context, i = r.eventStormingType;
1208
1304
  if (typeof i != "string") return;
1209
1305
  let a = n;
1210
- if (a.host && !we(i) && t.updateAttachment(a, void 0), a.attachers?.length && !Te(i)) for (let e of [...a.attachers]) t.updateAttachment(e, void 0);
1306
+ if (a.host && !T(i) && t.updateAttachment(a, void 0), a.attachers?.length && !E(i)) for (let e of [...a.attachers]) t.updateAttachment(e, void 0);
1211
1307
  });
1212
1308
  }
1213
- }, Vt = {
1214
- __depends__: [ue],
1309
+ }, $t = {
1310
+ __depends__: [de],
1215
1311
  __init__: ["eventStormingAttachBehavior"],
1216
- eventStormingAttachBehavior: ["type", Bt]
1312
+ eventStormingAttachBehavior: ["type", Qt]
1217
1313
  };
1218
1314
  //#endregion
1219
1315
  //#region src/modeling/cmd/UpdatePropertiesHandler.ts
1220
- function Ht(e, t, n) {
1316
+ function en(e, t, n) {
1221
1317
  n === void 0 ? delete e[t] : e[t] = n;
1222
1318
  }
1223
- var Ut = [
1319
+ var tn = [
1224
1320
  "x",
1225
1321
  "y",
1226
1322
  "width",
1227
1323
  "height"
1228
1324
  ];
1229
- function Wt(e, t) {
1230
- if (!t.some((e) => Ut.includes(e))) return [e];
1325
+ function nn(e, t) {
1326
+ if (!t.some((e) => tn.includes(e))) return [e];
1231
1327
  let n = e;
1232
1328
  return [
1233
1329
  e,
@@ -1235,18 +1331,18 @@ function Wt(e, t) {
1235
1331
  ...n.outgoing ?? []
1236
1332
  ];
1237
1333
  }
1238
- var Gt = class {
1334
+ var rn = class {
1239
1335
  execute(e) {
1240
1336
  let { element: t, properties: n } = e, r = t, i = {};
1241
- for (let e of Object.keys(n)) i[e] = r[e], Ht(r, e, n[e]);
1242
- return e.oldProperties = i, Wt(t, Object.keys(n));
1337
+ for (let e of Object.keys(n)) i[e] = r[e], en(r, e, n[e]);
1338
+ return e.oldProperties = i, nn(t, Object.keys(n));
1243
1339
  }
1244
1340
  revert(e) {
1245
1341
  let { element: t, oldProperties: n } = e, r = t;
1246
- if (n) for (let e of Object.keys(n)) Ht(r, e, n[e]);
1247
- return Wt(t, Object.keys(n ?? {}));
1342
+ if (n) for (let e of Object.keys(n)) en(r, e, n[e]);
1343
+ return nn(t, Object.keys(n ?? {}));
1248
1344
  }
1249
- }, Kt = "element.updateProperties", qt = class {
1345
+ }, an = "element.updateProperties", on = class {
1250
1346
  commandStack;
1251
1347
  canvas;
1252
1348
  elementRegistry;
@@ -1256,17 +1352,17 @@ var Gt = class {
1256
1352
  "elementRegistry"
1257
1353
  ];
1258
1354
  constructor(e, t, n) {
1259
- this.commandStack = e, this.canvas = t, this.elementRegistry = n, e.registerHandler(Kt, Gt);
1355
+ this.commandStack = e, this.canvas = t, this.elementRegistry = n, e.registerHandler(an, rn);
1260
1356
  }
1261
1357
  updateProperties(e, t) {
1262
- this.commandStack.execute(Kt, {
1358
+ this.commandStack.execute(an, {
1263
1359
  element: e,
1264
1360
  properties: t
1265
1361
  });
1266
1362
  }
1267
1363
  updateLabel(e, t) {
1268
- if (e.eventStormingType === "note" && !N(e.eventStormingLabel, e)) {
1269
- let { width: n, height: r } = M(t), i = e.x + e.width / 2, a = e.y + e.height / 2;
1364
+ if (e.eventStormingType === "note" && !I(e.eventStormingLabel, e)) {
1365
+ let { width: n, height: r } = F(t), i = e.x + e.width / 2, a = e.y + e.height / 2;
1270
1366
  this.updateProperties(e, {
1271
1367
  eventStormingLabel: t,
1272
1368
  width: n,
@@ -1279,7 +1375,7 @@ var Gt = class {
1279
1375
  setStickyKind(e, t) {
1280
1376
  if (!C(e.eventStormingType) || !C(t)) throw Error("setStickyKind: only sticky kinds can be retyped");
1281
1377
  if (e.eventStormingType === t && !e.provisional) return;
1282
- let { width: n, height: r } = O[t], i = e.x + e.width / 2, a = e.y + e.height / 2;
1378
+ let { width: n, height: r } = j[t], i = e.x + e.width / 2, a = e.y + e.height / 2;
1283
1379
  this.updateProperties(e, {
1284
1380
  eventStormingType: t,
1285
1381
  ...e.provisional ? { provisional: void 0 } : {},
@@ -1296,12 +1392,12 @@ var Gt = class {
1296
1392
  this.updateProperties(e, { strokeStyle: t });
1297
1393
  }
1298
1394
  getLevel() {
1299
- return this.elementRegistry.get("event-storming-root")?.businessObject?.config.level ?? a;
1395
+ return this.elementRegistry.get("event-storming-root")?.businessObject?.config.level ?? r;
1300
1396
  }
1301
1397
  setLevel(e) {
1302
1398
  if (this.getLevel() === e) return;
1303
1399
  let t = this.root(), n = t.businessObject ?? { config: { title: "Untitled Board" } };
1304
- this.commandStack.execute(Kt, {
1400
+ this.commandStack.execute(an, {
1305
1401
  element: t,
1306
1402
  properties: { businessObject: {
1307
1403
  ...n,
@@ -1315,7 +1411,7 @@ var Gt = class {
1315
1411
  root() {
1316
1412
  return this.elementRegistry.get("event-storming-root") ?? this.canvas.getRootElement();
1317
1413
  }
1318
- }, Jt = 24, Yt = [
1414
+ }, sn = 24, cn = [
1319
1415
  "eventStormingType",
1320
1416
  "color",
1321
1417
  "drawingPoints",
@@ -1323,8 +1419,8 @@ var Gt = class {
1323
1419
  "strokeStyle",
1324
1420
  "alignHorizontal",
1325
1421
  "alignVertical"
1326
- ], Xt = ["eventStormingType", "linkLabel"];
1327
- function Zt(e, t) {
1422
+ ], ln = ["eventStormingType", "linkLabel"];
1423
+ function un(e, t) {
1328
1424
  let n = {};
1329
1425
  for (let r of t) {
1330
1426
  let t = e[r];
@@ -1332,7 +1428,7 @@ function Zt(e, t) {
1332
1428
  }
1333
1429
  return n;
1334
1430
  }
1335
- var Qt = class {
1431
+ var dn = class {
1336
1432
  selection;
1337
1433
  modeling;
1338
1434
  elementFactory;
@@ -1364,14 +1460,14 @@ var Qt = class {
1364
1460
  i !== void 0 && a !== void 0 && (r.add(e), n.push({
1365
1461
  sourceIdx: i,
1366
1462
  targetIdx: a,
1367
- props: Zt(e, Xt)
1463
+ props: un(e, ln)
1368
1464
  }));
1369
1465
  }
1370
1466
  return this.clipboard = {
1371
1467
  shapes: e.map((e) => {
1372
1468
  let n = e.host ? t.get(e.host) : void 0;
1373
1469
  return {
1374
- props: Zt(e, Yt),
1470
+ props: un(e, cn),
1375
1471
  x: e.x,
1376
1472
  y: e.y,
1377
1473
  width: e.width,
@@ -1412,26 +1508,26 @@ var Qt = class {
1412
1508
  ...structuredClone(e.props),
1413
1509
  source: n[e.sourceIdx],
1414
1510
  target: n[e.targetIdx],
1415
- waypoints: [$t(n[e.sourceIdx]), $t(n[e.targetIdx])]
1511
+ waypoints: [fn(n[e.sourceIdx]), fn(n[e.targetIdx])]
1416
1512
  }))
1417
1513
  };
1418
1514
  }
1419
1515
  insertWithOffset(e) {
1420
1516
  this.pasteCount++;
1421
- let t = Jt * this.pasteCount, n = en(e.shapes), r = this.modeling.createElements([...e.shapes, ...e.connections], {
1517
+ let t = sn * this.pasteCount, n = pn(e.shapes), r = this.modeling.createElements([...e.shapes, ...e.connections], {
1422
1518
  x: n.cx + t,
1423
1519
  y: n.cy + t
1424
1520
  }, this.canvas.getRootElement());
1425
1521
  return this.selection.select(r), !0;
1426
1522
  }
1427
1523
  };
1428
- function $t(e) {
1524
+ function fn(e) {
1429
1525
  return {
1430
1526
  x: e.x + e.width / 2,
1431
1527
  y: e.y + e.height / 2
1432
1528
  };
1433
1529
  }
1434
- function en(e) {
1530
+ function pn(e) {
1435
1531
  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));
1436
1532
  return {
1437
1533
  cx: (t + r) / 2,
@@ -1440,13 +1536,13 @@ function en(e) {
1440
1536
  }
1441
1537
  //#endregion
1442
1538
  //#region src/modeling/index.ts
1443
- var tn = {
1444
- __depends__: [fe, re],
1539
+ var mn = {
1540
+ __depends__: [pe, ie],
1445
1541
  __init__: ["eventStormingModeling"],
1446
- eventStormingModeling: ["type", qt],
1447
- eventStormingCopyPaste: ["type", Qt]
1448
- }, nn = {
1449
- __depends__: [pe],
1542
+ eventStormingModeling: ["type", on],
1543
+ eventStormingCopyPaste: ["type", dn]
1544
+ }, hn = {
1545
+ __depends__: [me],
1450
1546
  __init__: ["eventStormingLassoBehavior"],
1451
1547
  eventStormingLassoBehavior: ["type", class {
1452
1548
  static $inject = [
@@ -1471,13 +1567,13 @@ var tn = {
1471
1567
  };
1472
1568
  //#endregion
1473
1569
  //#region src/rules/EventStormingRules.ts
1474
- function rn(e, t) {
1570
+ function gn(e, t) {
1475
1571
  return (e.outgoing ?? []).some((e) => e.target === t);
1476
1572
  }
1477
- function an(e, t) {
1478
- return e.length !== 1 || !Ee(e[0]) || !De(t) ? !1 : "attach";
1573
+ function _n(e, t) {
1574
+ return e.length !== 1 || !Te(e[0]) || !D(t) ? !1 : "attach";
1479
1575
  }
1480
- var on = class extends me {
1576
+ var vn = class extends he {
1481
1577
  static $inject = ["eventBus"];
1482
1578
  constructor(e) {
1483
1579
  super(e);
@@ -1485,17 +1581,17 @@ var on = class extends me {
1485
1581
  init() {
1486
1582
  this.addRule("connection.start", (e) => w(e.source)), this.addRule("connection.create", (e) => {
1487
1583
  let { source: t, target: n } = e;
1488
- return !w(t) || !w(n) || t === n || rn(t, n) ? !1 : { eventStormingType: "arrow" };
1489
- }), this.addRule(["shape.move", "elements.move"], (e) => an(e.shapes ?? (e.shape ? [e.shape] : []), e.target) || !0), this.addRule("shape.create", () => !0), this.addRule("elements.create", () => !0), this.addRule("shape.resize", (e) => {
1490
- if (!Oe(e.shape)) return !1;
1584
+ return !w(t) || !w(n) || t === n || gn(t, n) ? !1 : { eventStormingType: "arrow" };
1585
+ }), this.addRule(["shape.move", "elements.move"], (e) => _n(e.shapes ?? (e.shape ? [e.shape] : []), e.target) || !0), this.addRule("shape.create", () => !0), this.addRule("elements.create", () => !0), this.addRule("shape.resize", (e) => {
1586
+ if (!Ee(e.shape)) return !1;
1491
1587
  let { newBounds: t } = e;
1492
- return !t || t.width >= A.width && t.height >= A.height;
1588
+ return !t || t.width >= N.width && t.height >= N.height;
1493
1589
  });
1494
1590
  }
1495
- }, sn = {
1591
+ }, yn = {
1496
1592
  __init__: ["eventStormingRules"],
1497
- eventStormingRules: ["type", on]
1498
- }, cn = 8, ln = {
1593
+ eventStormingRules: ["type", vn]
1594
+ }, bn = 8, xn = {
1499
1595
  __init__: ["elementSnapping"],
1500
1596
  elementSnapping: ["type", class {
1501
1597
  static $inject = ["eventBus", "elementRegistry"];
@@ -1507,7 +1603,7 @@ var on = class extends me {
1507
1603
  let n, r = 9;
1508
1604
  for (let i of t) {
1509
1605
  let t = Math.abs(i - e);
1510
- t <= cn && t < r && (n = i, r = t);
1606
+ t <= bn && t < r && (n = i, r = t);
1511
1607
  }
1512
1608
  return n;
1513
1609
  };
@@ -1539,7 +1635,7 @@ var on = class extends me {
1539
1635
  });
1540
1636
  }
1541
1637
  }]
1542
- }, un = ".djs-palette-entries .entry", dn = "bottom", fn = class {
1638
+ }, Sn = ".djs-palette-entries .entry", Cn = "bottom", wn = class {
1543
1639
  palette;
1544
1640
  hoverTooltip;
1545
1641
  static $inject = [
@@ -1554,9 +1650,9 @@ var on = class extends me {
1554
1650
  attachTo(e) {
1555
1651
  this.refreshEntries(), this.hoverTooltip.add({
1556
1652
  container: e,
1557
- selector: un,
1653
+ selector: Sn,
1558
1654
  getContent: (e) => this.contentFor(e),
1559
- getPosition: (e) => pn(e)
1655
+ getPosition: (e) => Tn(e)
1560
1656
  });
1561
1657
  }
1562
1658
  refreshEntries() {
@@ -1564,58 +1660,58 @@ var on = class extends me {
1564
1660
  }
1565
1661
  contentFor(e) {
1566
1662
  let t = this.entries[e.getAttribute("data-action") ?? ""];
1567
- return t?.title ? ge`<${he} title=${t.title} shortcut=${t.shortcut} />` : null;
1663
+ return t?.title ? _e`<${ge} title=${t.title} shortcut=${t.shortcut} />` : null;
1568
1664
  }
1569
1665
  };
1570
- function pn(e) {
1666
+ function Tn(e) {
1571
1667
  let t = e.getBoundingClientRect();
1572
1668
  return {
1573
1669
  x: t.left + t.width / 2,
1574
1670
  y: t.bottom + 8,
1575
- placement: dn
1671
+ placement: Cn
1576
1672
  };
1577
1673
  }
1578
1674
  //#endregion
1579
1675
  //#region src/palette/index.ts
1580
- var mn = {
1676
+ var En = {
1581
1677
  __init__: ["eventStormingPaletteProvider", "paletteTooltip"],
1582
- eventStormingPaletteProvider: ["type", Ue],
1583
- paletteTooltip: ["type", fn]
1584
- }, G = "event-storming-element-settings", hn = {
1678
+ eventStormingPaletteProvider: ["type", et],
1679
+ paletteTooltip: ["type", wn]
1680
+ }, W = "event-storming-element-settings", Dn = {
1585
1681
  id: "kind",
1586
1682
  name: "Change type"
1587
1683
  };
1588
- function gn(e, t) {
1684
+ function On(e, t) {
1589
1685
  return e ? `✓ ${t}` : t;
1590
1686
  }
1591
- var _n = class {
1687
+ var kn = class {
1592
1688
  modeling;
1593
1689
  static $inject = ["popupMenu", "eventStormingModeling"];
1594
1690
  constructor(e, t) {
1595
- this.modeling = t, e.registerProvider(G, this);
1691
+ this.modeling = t, e.registerProvider(W, this);
1596
1692
  }
1597
1693
  getPopupMenuEntries(e) {
1598
1694
  let t = Array.isArray(e) ? e[0] : e;
1599
1695
  return w(t) ? this.kindEntries(t) : {};
1600
1696
  }
1601
1697
  kindEntries(e) {
1602
- let t = {}, n = e.provisional === !0, r = c[this.modeling.getLevel()];
1698
+ let t = {}, n = e.provisional === !0, r = o[this.modeling.getLevel()];
1603
1699
  for (let i of S) {
1604
1700
  if (!r.includes(i) && (n || i !== e.eventStormingType)) continue;
1605
- let a = O[i];
1701
+ let a = j[i];
1606
1702
  t[`kind-${i}`] = {
1607
- label: n ? a.label : gn(e.eventStormingType === i, a.label),
1608
- imageHtml: ze(a.fill, a.stroke),
1609
- group: hn,
1703
+ label: n ? a.label : On(e.eventStormingType === i, a.label),
1704
+ imageHtml: Je(a.fill, a.stroke),
1705
+ group: Dn,
1610
1706
  action: () => this.modeling.setStickyKind(e, i)
1611
1707
  };
1612
1708
  }
1613
1709
  return t;
1614
1710
  }
1615
- }, vn = {
1711
+ }, An = {
1616
1712
  __init__: ["eventStormingElementSettings"],
1617
- eventStormingElementSettings: ["type", _n]
1618
- }, K = "eventStorming.readOnly.changed", yn = 5e3, bn = [
1713
+ eventStormingElementSettings: ["type", kn]
1714
+ }, G = "eventStorming.readOnly.changed", jn = 5e3, Mn = [
1619
1715
  "elements.move",
1620
1716
  "shape.move",
1621
1717
  "shape.resize",
@@ -1628,7 +1724,7 @@ var _n = class {
1628
1724
  "connection.reconnect",
1629
1725
  "connection.updateWaypoints",
1630
1726
  "elements.delete"
1631
- ], xn = class extends me {
1727
+ ], Nn = class extends he {
1632
1728
  bus;
1633
1729
  static $inject = ["eventBus"];
1634
1730
  readOnly = !1;
@@ -1636,19 +1732,19 @@ var _n = class {
1636
1732
  super(e), this.bus = e;
1637
1733
  }
1638
1734
  init() {
1639
- this.addRule(bn, yn, () => !this.readOnly && void 0);
1735
+ this.addRule(Mn, jn, () => !this.readOnly && void 0);
1640
1736
  }
1641
1737
  isReadOnly() {
1642
1738
  return this.readOnly;
1643
1739
  }
1644
1740
  setReadOnly(e) {
1645
- this.readOnly !== e && (this.readOnly = e, this.bus.fire(K, { readOnly: e }));
1741
+ this.readOnly !== e && (this.readOnly = e, this.bus.fire(G, { readOnly: e }));
1646
1742
  }
1647
- }, Sn = {
1648
- __depends__: [se],
1743
+ }, Pn = {
1744
+ __depends__: [ce],
1649
1745
  __init__: ["eventStormingReadOnly"],
1650
- eventStormingReadOnly: ["type", xn]
1651
- }, Cn = {
1746
+ eventStormingReadOnly: ["type", Nn]
1747
+ }, Fn = {
1652
1748
  plus: "<path d=\"M5 12h14\"/><path d=\"M12 5v14\"/>",
1653
1749
  "arrow-right": "<path d=\"M5 12h14\"/><path d=\"m12 5 7 7-7 7\"/>",
1654
1750
  pencil: "<path d=\"M21.174 6.812a1 1 0 0 0-3.986-3.987L3.842 16.174a2 2 0 0 0-.5.83l-1.321 4.352a.5.5 0 0 0 .623.622l4.353-1.32a2 2 0 0 0 .83-.497z\"/><path d=\"m15 5 4 4\"/>",
@@ -1667,18 +1763,18 @@ var _n = class {
1667
1763
  "align-vertical-justify-end": "<rect width=\"14\" height=\"6\" x=\"5\" y=\"12\" rx=\"2\"/><rect width=\"10\" height=\"6\" x=\"7\" y=\"2\" rx=\"2\"/><path d=\"M2 22h20\"/>",
1668
1764
  x: "<path d=\"M18 6 6 18\"/><path d=\"m6 6 12 12\"/>"
1669
1765
  };
1670
- function q(e) {
1671
- return `<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2.5" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true" focusable="false">${Cn[e]}</svg>`;
1766
+ function K(e) {
1767
+ return `<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2.5" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true" focusable="false">${Fn[e]}</svg>`;
1672
1768
  }
1673
1769
  //#endregion
1674
1770
  //#region src/context-pad/EventStormingContextPadProvider.ts
1675
- var wn = "Append sticky (auto-connect, choose the type after placing)";
1676
- function J(e, t, n = !1) {
1677
- return `<div class="entry event-storming-cp-entry"${n ? " draggable=\"true\"" : ""} title="${t}">${q(e)}</div>`;
1771
+ var In = "Append sticky (auto-connect, choose the type after placing)";
1772
+ function q(e, t, n = !1) {
1773
+ return `<div class="entry event-storming-cp-entry"${n ? " draggable=\"true\"" : ""} title="${t}">${K(e)}</div>`;
1678
1774
  }
1679
1775
  //#endregion
1680
1776
  //#region src/context-pad/index.ts
1681
- var Tn = {
1777
+ var Ln = {
1682
1778
  __init__: ["eventStormingContextPadProvider"],
1683
1779
  eventStormingContextPadProvider: ["type", class {
1684
1780
  modeling;
@@ -1704,7 +1800,7 @@ var Tn = {
1704
1800
  "eventStormingReadOnly"
1705
1801
  ];
1706
1802
  constructor(e, t, n, r, i, a, o, s, c, l, u) {
1707
- this.modeling = t, this.connect = n, this.create = r, this.popupMenu = i, this.eventStormingModeling = a, this.labelEditing = o, this.factory = s, this.colorPicker = c, this.readOnly = u, e.registerProvider(this), l?.on(K, (t) => {
1803
+ this.modeling = t, this.connect = n, this.create = r, this.popupMenu = i, this.eventStormingModeling = a, this.labelEditing = o, this.factory = s, this.colorPicker = c, this.readOnly = u, e.registerProvider(this), l?.on(G, (t) => {
1708
1804
  t.readOnly && e.close();
1709
1805
  });
1710
1806
  }
@@ -1716,13 +1812,13 @@ var Tn = {
1716
1812
  "edit-label": {
1717
1813
  group: "edit",
1718
1814
  title: "Edit arrow label",
1719
- html: J("pencil", "Edit arrow label"),
1815
+ html: q("pencil", "Edit arrow label"),
1720
1816
  action: { click: () => this.labelEditing.activateConnection(t) }
1721
1817
  },
1722
1818
  delete: {
1723
1819
  group: "delete",
1724
1820
  title: "Delete connection",
1725
- html: J("trash", "Delete connection"),
1821
+ html: q("trash", "Delete connection"),
1726
1822
  action: { click: () => this.modeling.removeElements([e]) }
1727
1823
  }
1728
1824
  };
@@ -1736,8 +1832,8 @@ var Tn = {
1736
1832
  };
1737
1833
  n.append = {
1738
1834
  group: "append",
1739
- title: wn,
1740
- html: J("plus", wn, !0),
1835
+ title: In,
1836
+ html: q("plus", In, !0),
1741
1837
  action: {
1742
1838
  click: e,
1743
1839
  dragstart: e
@@ -1749,7 +1845,7 @@ var Tn = {
1749
1845
  n.connect = {
1750
1846
  group: "edit",
1751
1847
  title: "Connect to existing sticky",
1752
- html: J("arrow-right", "Connect to existing sticky", !0),
1848
+ html: q("arrow-right", "Connect to existing sticky", !0),
1753
1849
  action: {
1754
1850
  click: r,
1755
1851
  dragstart: r
@@ -1757,10 +1853,10 @@ var Tn = {
1757
1853
  }, n["change-kind"] = {
1758
1854
  group: "edit",
1759
1855
  title: "Change type",
1760
- html: J("replace", "Change type"),
1856
+ html: q("replace", "Change type"),
1761
1857
  action: { click: (e) => {
1762
1858
  let n = e;
1763
- this.popupMenu.open(t, G, {
1859
+ this.popupMenu.open(t, W, {
1764
1860
  x: n.clientX,
1765
1861
  y: n.clientY
1766
1862
  });
@@ -1772,14 +1868,14 @@ var Tn = {
1772
1868
  n["stroke-style"] = {
1773
1869
  group: "edit",
1774
1870
  title: r,
1775
- html: J("line-style", r),
1871
+ html: q("line-style", r),
1776
1872
  action: { click: () => this.eventStormingModeling.setStrokeStyle(t, e) }
1777
1873
  };
1778
1874
  }
1779
1875
  return r === "drawing" && (n.color = {
1780
1876
  group: "edit",
1781
1877
  title: "Color",
1782
- html: J("palette", "Color"),
1878
+ html: q("palette", "Color"),
1783
1879
  action: { click: (e) => {
1784
1880
  let n = e;
1785
1881
  this.colorPicker.open(t, n.clientX, n.clientY);
@@ -1787,46 +1883,46 @@ var Tn = {
1787
1883
  }), r !== "drawing" && (n["edit-label"] = {
1788
1884
  group: "edit",
1789
1885
  title: "Edit label",
1790
- html: J("pencil", "Edit label"),
1886
+ html: q("pencil", "Edit label"),
1791
1887
  action: { click: () => this.labelEditing.activate(t) }
1792
1888
  }), n.delete = {
1793
1889
  group: "delete",
1794
1890
  title: "Delete",
1795
- html: J("trash", "Delete"),
1891
+ html: q("trash", "Delete"),
1796
1892
  action: { click: () => this.modeling.removeElements([t]) }
1797
1893
  }, n;
1798
1894
  }
1799
1895
  }]
1800
- }, En = "bullet", Dn = [
1896
+ }, Rn = "bullet", zn = [
1801
1897
  "left",
1802
1898
  "center",
1803
1899
  "right"
1804
- ], On = [
1900
+ ], Bn = [
1805
1901
  "top",
1806
1902
  "middle",
1807
1903
  "bottom"
1808
1904
  ];
1809
- function kn(e, t) {
1905
+ function Vn(e, t) {
1810
1906
  return e[(e.indexOf(t) + 1) % e.length];
1811
1907
  }
1812
- function An(e, t) {
1908
+ function Hn(e, t) {
1813
1909
  let n = e.ownerDocument;
1814
1910
  e.textContent = "";
1815
- for (let r of D(t)) {
1911
+ for (let r of A(t)) {
1816
1912
  let t = n.createElement("div");
1817
- r.bullet && (t.className = En);
1913
+ r.bullet && (t.className = Rn);
1818
1914
  for (let e of r.runs) {
1819
1915
  let r = n.createTextNode(e.text);
1820
- e.italic && (r = jn(n, "i", r)), e.bold && (r = jn(n, "b", r)), t.appendChild(r);
1916
+ e.italic && (r = Un(n, "i", r)), e.bold && (r = Un(n, "b", r)), t.appendChild(r);
1821
1917
  }
1822
1918
  r.runs.length === 0 && t.appendChild(n.createElement("br")), e.appendChild(t);
1823
1919
  }
1824
1920
  }
1825
- function jn(e, t, n) {
1921
+ function Un(e, t, n) {
1826
1922
  let r = e.createElement(t);
1827
1923
  return r.appendChild(n), r;
1828
1924
  }
1829
- function Mn(e) {
1925
+ function Wn(e) {
1830
1926
  let t = [], n = null, r = (e) => (n = {
1831
1927
  bullet: e,
1832
1928
  runs: []
@@ -1847,11 +1943,11 @@ function Mn(e) {
1847
1943
  s.nextSibling && r(!1);
1848
1944
  return;
1849
1945
  }
1850
- if (Nn(s.tagName)) {
1946
+ if (Gn(s.tagName)) {
1851
1947
  a(s);
1852
1948
  return;
1853
1949
  }
1854
- let c = Pn(s, t, o);
1950
+ let c = Kn(s, t, o);
1855
1951
  for (let e of s.childNodes) i(e, c.bold, c.italic);
1856
1952
  }, a = (e) => {
1857
1953
  r(e.classList.contains("bullet") || e.tagName === "LI");
@@ -1859,12 +1955,12 @@ function Mn(e) {
1859
1955
  n = null;
1860
1956
  };
1861
1957
  for (let t of e.childNodes) i(t, !1, !1);
1862
- return Ae(t);
1958
+ return Oe(t);
1863
1959
  }
1864
- function Nn(e) {
1960
+ function Gn(e) {
1865
1961
  return e === "DIV" || e === "P" || e === "LI";
1866
1962
  }
1867
- function Pn(e, t, n) {
1963
+ function Kn(e, t, n) {
1868
1964
  let r = e.tagName;
1869
1965
  (r === "B" || r === "STRONG") && (t = !0), (r === "I" || r === "EM") && (n = !0);
1870
1966
  let i = e.style.fontWeight;
@@ -1875,13 +1971,13 @@ function Pn(e, t, n) {
1875
1971
  italic: n
1876
1972
  };
1877
1973
  }
1878
- function Fn(e) {
1974
+ function qn(e) {
1879
1975
  let t = e.ownerDocument, n = t.getSelection();
1880
1976
  if (!n) return;
1881
1977
  let r = t.createRange();
1882
1978
  r.selectNodeContents(e), n.removeAllRanges(), n.addRange(r);
1883
1979
  }
1884
- function In(e, t) {
1980
+ function Jn(e, t) {
1885
1981
  let n = e.ownerDocument;
1886
1982
  if (typeof n.execCommand == "function" && n.execCommand("insertText", !1, t)) return;
1887
1983
  let r = n.getSelection();
@@ -1892,24 +1988,24 @@ function In(e, t) {
1892
1988
  let a = n.createTextNode(t);
1893
1989
  i.insertNode(a), i.setStartAfter(a), i.collapse(!0), r.removeAllRanges(), r.addRange(i);
1894
1990
  }
1895
- function Ln(e) {
1991
+ function Yn(e) {
1896
1992
  let t = e.ownerDocument.getSelection();
1897
1993
  if (!t || t.rangeCount === 0) return [];
1898
1994
  let n = t.getRangeAt(0);
1899
1995
  return e.contains(n.commonAncestorContainer) ? Array.from(e.children).filter((e) => n.intersectsNode(e)) : [];
1900
1996
  }
1901
- function Rn(e) {
1902
- zn(e);
1903
- let t = Ln(e);
1997
+ function Xn(e) {
1998
+ Zn(e);
1999
+ let t = Yn(e);
1904
2000
  if (t.length === 0) return;
1905
- let n = t.every((e) => e.classList.contains(En));
1906
- for (let e of t) e.classList.toggle(En, !n);
2001
+ let n = t.every((e) => e.classList.contains(Rn));
2002
+ for (let e of t) e.classList.toggle(Rn, !n);
1907
2003
  }
1908
- function zn(e) {
2004
+ function Zn(e) {
1909
2005
  let t = e.ownerDocument, n = null;
1910
- for (let r of Array.from(e.childNodes)) r.nodeType === Node.ELEMENT_NODE && Nn(r.tagName) ? n = null : (n || (n = t.createElement("div"), e.insertBefore(n, r)), n.appendChild(r));
2006
+ for (let r of Array.from(e.childNodes)) r.nodeType === Node.ELEMENT_NODE && Gn(r.tagName) ? n = null : (n || (n = t.createElement("div"), e.insertBefore(n, r)), n.appendChild(r));
1911
2007
  }
1912
- var Bn = {
2008
+ var Qn = {
1913
2009
  horizontal: {
1914
2010
  left: "text-align-start",
1915
2011
  center: "text-align-center",
@@ -1921,30 +2017,30 @@ var Bn = {
1921
2017
  bottom: "align-vertical-justify-end"
1922
2018
  }
1923
2019
  };
1924
- function Vn(e, t) {
2020
+ function $n(e, t) {
1925
2021
  let n = e.createElement("div");
1926
2022
  n.className = "event-storming-note-toolbar";
1927
2023
  let r = (r, i, a) => {
1928
2024
  let o = e.createElement("button");
1929
2025
  o.type = "button", o.setAttribute("data-action", r), o.title = i, o.innerHTML = a, o.addEventListener("mousedown", (e) => e.preventDefault()), o.addEventListener("click", () => t(r)), n.appendChild(o);
1930
2026
  };
1931
- r("note-bold", "Bold (Cmd/Ctrl+B)", q("bold")), r("note-italic", "Italic (Cmd/Ctrl+I)", q("italic")), r("note-bullet", "Bullet list", q("list"));
2027
+ r("note-bold", "Bold (Cmd/Ctrl+B)", K("bold")), r("note-italic", "Italic (Cmd/Ctrl+I)", K("italic")), r("note-bullet", "Bullet list", K("list"));
1932
2028
  let i = e.createElement("span");
1933
2029
  return i.className = "event-storming-note-toolbar-separator", n.appendChild(i), r("note-align-horizontal", "Horizontal alignment (click to cycle)", ""), r("note-align-vertical", "Vertical alignment (click to cycle)", ""), n;
1934
2030
  }
1935
- function Hn(e, t, n) {
1936
- let r = Bn[t][n];
1937
- e.innerHTML = r ? q(r) : "", e.title = t === "horizontal" ? `Horizontal alignment: ${n} (click to cycle)` : `Vertical alignment: ${n} (click to cycle)`;
2031
+ function er(e, t, n) {
2032
+ let r = Qn[t][n];
2033
+ e.innerHTML = r ? K(r) : "", e.title = t === "horizontal" ? `Horizontal alignment: ${n} (click to cycle)` : `Vertical alignment: ${n} (click to cycle)`;
1938
2034
  }
1939
- function Un(e, t) {
2035
+ function tr(e, t) {
1940
2036
  e.style.textAlign = t.horizontal, e.style.justifyContent = t.vertical === "top" ? "flex-start" : t.vertical === "middle" ? "center" : "flex-end";
1941
2037
  }
1942
2038
  //#endregion
1943
2039
  //#region src/label-editing/EventStormingLabelEditing.ts
1944
- function Wn(e) {
2040
+ function nr(e) {
1945
2041
  return e.replace(/(?<!:)\/\//g, "∕∕").replace(/\/\*/g, "∕*").replace(/->/g, "→").replace(/;/g, ",").replace(/\[/g, "(").replace(/\]/g, ")").trim();
1946
2042
  }
1947
- var Gn = class {
2043
+ var rr = class {
1948
2044
  canvas;
1949
2045
  modeling;
1950
2046
  elementRegistry;
@@ -1960,7 +2056,7 @@ var Gn = class {
1960
2056
  suspended = null;
1961
2057
  resumeTimer;
1962
2058
  constructor(e, t, n, r, i) {
1963
- this.canvas = t, this.modeling = n, this.elementRegistry = r, this.readOnly = i, e.on(K, (e) => {
2059
+ this.canvas = t, this.modeling = n, this.elementRegistry = r, this.readOnly = i, e.on(G, (e) => {
1964
2060
  e.readOnly && this.cancel();
1965
2061
  }), e.on("diagram.destroy", () => {
1966
2062
  clearTimeout(this.resumeTimer), this.suspended = null, this.cancel();
@@ -1987,7 +2083,7 @@ var Gn = class {
1987
2083
  this.activate(t);
1988
2084
  }
1989
2085
  let n = this.active?.field;
1990
- n && (n instanceof HTMLTextAreaElement || n instanceof HTMLInputElement ? (n.value = e.value, n instanceof HTMLTextAreaElement && (n.rows = Math.max(2, e.value.split("\n").length)), n.setSelectionRange(e.selectionStart ?? e.value.length, e.selectionEnd ?? e.value.length)) : (An(n, e.value), e.align && this.restoreNoteAlign?.(e.align), qn(n)));
2086
+ n && (n instanceof HTMLTextAreaElement || n instanceof HTMLInputElement ? (n.value = e.value, n instanceof HTMLTextAreaElement && (n.rows = Math.max(2, e.value.split("\n").length)), n.setSelectionRange(e.selectionStart ?? e.value.length, e.selectionEnd ?? e.value.length)) : (Hn(n, e.value), e.align && this.restoreNoteAlign?.(e.align), ar(n)));
1991
2087
  }
1992
2088
  restoreNoteAlign;
1993
2089
  activate(e) {
@@ -2007,7 +2103,7 @@ var Gn = class {
2007
2103
  i || (i = !0, n.removeEventListener("keydown", s), n.removeEventListener("blur", c), n.remove(), this.active = null, this.canvas.restoreFocus?.());
2008
2104
  }, o = () => {
2009
2105
  if (i) return;
2010
- let t = Wn(n.value), r = t && t !== e.eventStormingLabel;
2106
+ let t = nr(n.value), r = t && t !== e.eventStormingLabel;
2011
2107
  a(), r && this.modeling.updateLabel(e, t);
2012
2108
  }, s = (e) => {
2013
2109
  if (e.key === "Escape") e.preventDefault(), a();
@@ -2034,43 +2130,43 @@ var Gn = class {
2034
2130
  }
2035
2131
  activateNote(e) {
2036
2132
  let t = this.canvas.getContainer(), n = document.createElement("div");
2037
- n.className = "event-storming-label-input event-storming-note-editor", n.contentEditable = "true", n.style.position = "absolute", n.style.transform = "translate(-50%, -50%)", An(n, e.eventStormingLabel ?? "");
2133
+ n.className = "event-storming-label-input event-storming-note-editor", n.contentEditable = "true", n.style.position = "absolute", n.style.transform = "translate(-50%, -50%)", Hn(n, e.eventStormingLabel ?? "");
2038
2134
  let r = {
2039
2135
  horizontal: e.alignHorizontal ?? "left",
2040
2136
  vertical: e.alignVertical ?? "top"
2041
2137
  };
2042
- Un(n, r);
2043
- let i = Vn(document, (e) => d(e));
2138
+ tr(n, r);
2139
+ let i = $n(document, (e) => d(e));
2044
2140
  i.style.transform = "translate(-50%, -100%)";
2045
2141
  let a = () => {
2046
2142
  let t = this.canvas.zoom(), r = this.canvas.viewbox(), a = (e.x + e.width / 2 - r.x) * t;
2047
2143
  n.style.left = `${a}px`, n.style.top = `${(e.y + e.height / 2 - r.y) * t}px`, n.style.minWidth = `${e.width * t}px`, n.style.minHeight = `${e.height * t}px`, i.style.left = `${a}px`, i.style.top = `${(e.y - r.y) * t - 8}px`;
2048
2144
  };
2049
- a(), t.appendChild(n), t.appendChild(i), n.focus(), Fn(n);
2145
+ a(), t.appendChild(n), t.appendChild(i), n.focus(), qn(n);
2050
2146
  let o = (e) => i.querySelector(`[data-action="${e}"]`), s = (e, t) => {
2051
2147
  let n = o(e);
2052
2148
  n?.classList.toggle("active", t), n?.setAttribute("aria-pressed", String(t));
2053
2149
  }, c = () => {
2054
- s("note-bold", Jn("bold")), s("note-italic", Jn("italic"));
2055
- let e = Ln(n);
2150
+ s("note-bold", or("bold")), s("note-italic", or("italic"));
2151
+ let e = Yn(n);
2056
2152
  s("note-bullet", e.length > 0 && e.every((e) => e.classList.contains("bullet")));
2057
2153
  let t = o("note-align-horizontal");
2058
- t && Hn(t, "horizontal", r.horizontal);
2154
+ t && er(t, "horizontal", r.horizontal);
2059
2155
  let i = o("note-align-vertical");
2060
- i && Hn(i, "vertical", r.vertical);
2156
+ i && er(i, "vertical", r.vertical);
2061
2157
  }, l = (e) => {
2062
2158
  typeof document.execCommand == "function" && document.execCommand(e, !1), c();
2063
2159
  }, u = (e) => {
2064
- e === "horizontal" ? r.horizontal = kn(Dn, r.horizontal) : r.vertical = kn(On, r.vertical), Un(n, r), c();
2160
+ e === "horizontal" ? r.horizontal = Vn(zn, r.horizontal) : r.vertical = Vn(Bn, r.vertical), tr(n, r), c();
2065
2161
  }, d = (e) => {
2066
- e === "note-bold" ? l("bold") : e === "note-italic" ? l("italic") : e === "note-bullet" ? (Rn(n), c()) : u(e === "note-align-horizontal" ? "horizontal" : "vertical");
2162
+ e === "note-bold" ? l("bold") : e === "note-italic" ? l("italic") : e === "note-bullet" ? (Xn(n), c()) : u(e === "note-align-horizontal" ? "horizontal" : "vertical");
2067
2163
  }, f = () => c();
2068
2164
  document.addEventListener("selectionchange", f);
2069
2165
  let p = !1, m = () => {
2070
2166
  p || (p = !0, document.removeEventListener("selectionchange", f), n.removeEventListener("keydown", g), n.removeEventListener("blur", _), n.removeEventListener("paste", v), n.remove(), i.remove(), this.active = null, this.restoreNoteAlign = void 0, this.canvas.restoreFocus?.());
2071
2167
  }, h = () => {
2072
2168
  if (p) return;
2073
- let t = Kn(e, Wn(Mn(n)), r);
2169
+ let t = ir(e, nr(Wn(n)), r);
2074
2170
  m(), t && this.modeling.updateProperties(e, t);
2075
2171
  }, g = (e) => {
2076
2172
  if (e.key === "Escape") {
@@ -2089,15 +2185,15 @@ var Gn = class {
2089
2185
  }, v = (e) => {
2090
2186
  e.preventDefault();
2091
2187
  let t = e.clipboardData?.getData("text/plain") ?? "";
2092
- t && In(n, t);
2188
+ t && Jn(n, t);
2093
2189
  };
2094
2190
  n.addEventListener("keydown", g), n.addEventListener("blur", _), n.addEventListener("paste", v), c(), this.restoreNoteAlign = (e) => {
2095
- r.horizontal = e.horizontal, r.vertical = e.vertical, Un(n, r), c();
2191
+ r.horizontal = e.horizontal, r.vertical = e.vertical, tr(n, r), c();
2096
2192
  };
2097
2193
  let ee = () => ({
2098
2194
  elementId: e.id,
2099
2195
  connection: !1,
2100
- value: Mn(n),
2196
+ value: Wn(n),
2101
2197
  align: { ...r }
2102
2198
  });
2103
2199
  this.active = {
@@ -2123,7 +2219,7 @@ var Gn = class {
2123
2219
  o || (o = !0, i.removeEventListener("keydown", l), i.removeEventListener("blur", u), i.remove(), this.active = null, this.canvas.restoreFocus?.());
2124
2220
  }, c = () => {
2125
2221
  if (o) return;
2126
- let t = Wn(i.value), n = e.linkLabel ?? "";
2222
+ let t = nr(i.value), n = e.linkLabel ?? "";
2127
2223
  s(), t !== n && this.modeling.updateProperties(e, { linkLabel: t || void 0 });
2128
2224
  }, l = (e) => {
2129
2225
  e.key === "Escape" ? (e.preventDefault(), s()) : e.key === "Enter" && (e.preventDefault(), c());
@@ -2156,23 +2252,23 @@ var Gn = class {
2156
2252
  };
2157
2253
  }
2158
2254
  };
2159
- function Kn(e, t, n) {
2255
+ function ir(e, t, n) {
2160
2256
  let r = !!t && t !== e.eventStormingLabel, i = n.horizontal !== (e.alignHorizontal ?? "left") || n.vertical !== (e.alignVertical ?? "top");
2161
2257
  if (!r && !i) return null;
2162
2258
  let a = {};
2163
- if (r && (a.eventStormingLabel = t, !N(e.eventStormingLabel, e))) {
2164
- let { width: n, height: r } = M(t);
2259
+ if (r && (a.eventStormingLabel = t, !I(e.eventStormingLabel, e))) {
2260
+ let { width: n, height: r } = F(t);
2165
2261
  a.width = n, a.height = r, a.x = e.x + e.width / 2 - n / 2, a.y = e.y + e.height / 2 - r / 2;
2166
2262
  }
2167
2263
  return i && (a.alignHorizontal = n.horizontal === "left" ? void 0 : n.horizontal, a.alignVertical = n.vertical === "top" ? void 0 : n.vertical), a;
2168
2264
  }
2169
- function qn(e) {
2265
+ function ar(e) {
2170
2266
  let t = document.createRange();
2171
2267
  t.selectNodeContents(e), t.collapse(!1);
2172
2268
  let n = window.getSelection();
2173
2269
  n?.removeAllRanges(), n?.addRange(t);
2174
2270
  }
2175
- function Jn(e) {
2271
+ function or(e) {
2176
2272
  if (typeof document.queryCommandState != "function") return !1;
2177
2273
  try {
2178
2274
  return document.queryCommandState(e);
@@ -2182,10 +2278,10 @@ function Jn(e) {
2182
2278
  }
2183
2279
  //#endregion
2184
2280
  //#region src/label-editing/index.ts
2185
- var Yn = {
2281
+ var sr = {
2186
2282
  __init__: ["eventStormingLabelEditing"],
2187
- eventStormingLabelEditing: ["type", Gn]
2188
- }, Xn = 2, Zn = 10, Qn = {
2283
+ eventStormingLabelEditing: ["type", rr]
2284
+ }, cr = 2, lr = 10, ur = {
2189
2285
  arrowleft: {
2190
2286
  x: -1,
2191
2287
  y: 0
@@ -2202,7 +2298,7 @@ var Yn = {
2202
2298
  x: 0,
2203
2299
  y: 1
2204
2300
  }
2205
- }, $n = class {
2301
+ }, dr = class {
2206
2302
  static $inject = [
2207
2303
  "config.eventStormingKeyboard",
2208
2304
  "canvas",
@@ -2220,7 +2316,7 @@ var Yn = {
2220
2316
  ];
2221
2317
  constructor(e, t, n, r, i, a, o, s, c, l, u, d, f) {
2222
2318
  let p = t.getContainer(), m = e?.undoRedoKeys ?? !0, h = (e) => {
2223
- e.defaultPrevented || er(e.target, p) && (tr(e.target) || g(e) || f?.isReadOnly() || _(e));
2319
+ e.defaultPrevented || fr(e.target, p) && (pr(e.target) || g(e) || f?.isReadOnly() || _(e));
2224
2320
  }, g = (e) => {
2225
2321
  let t = e.ctrlKey || e.metaKey, n = e.key.toLowerCase();
2226
2322
  if (t && n === "a" && !e.shiftKey && !e.altKey) {
@@ -2248,14 +2344,14 @@ var Yn = {
2248
2344
  let t = c.getLastMoveEvent();
2249
2345
  if (t) {
2250
2346
  e.preventDefault();
2251
- let n = l === "e" ? o.createNew("event", O.event.label) : o.createNew("command", O.command.label);
2347
+ let n = l === "e" ? o.createNew("event", j.event.label) : o.createNew("command", j.command.label);
2252
2348
  s.start(t, n);
2253
2349
  }
2254
- } else if (l in Qn && !t) {
2350
+ } else if (l in ur && !t) {
2255
2351
  let t = r.get();
2256
2352
  if (t.length) {
2257
2353
  e.preventDefault();
2258
- let n = e.shiftKey ? Zn : Xn, r = Qn[l];
2354
+ let n = e.shiftKey ? lr : cr, r = ur[l];
2259
2355
  i.moveElements(t, {
2260
2356
  x: r.x * n,
2261
2357
  y: r.y * n
@@ -2266,20 +2362,20 @@ var Yn = {
2266
2362
  document.addEventListener("keydown", h), u.on("diagram.destroy", () => document.removeEventListener("keydown", h));
2267
2363
  }
2268
2364
  };
2269
- function er(e, t) {
2365
+ function fr(e, t) {
2270
2366
  return e instanceof Node ? t.contains(e) || e === document.body || e === document.documentElement : !1;
2271
2367
  }
2272
- function tr(e) {
2368
+ function pr(e) {
2273
2369
  if (!(e instanceof HTMLElement)) return !1;
2274
2370
  let t = e.tagName;
2275
2371
  return t === "INPUT" || t === "TEXTAREA" || e.isContentEditable;
2276
2372
  }
2277
2373
  //#endregion
2278
2374
  //#region src/keyboard/index.ts
2279
- var nr = {
2375
+ var mr = {
2280
2376
  __init__: ["eventStormingKeyboard"],
2281
- eventStormingKeyboard: ["type", $n]
2282
- }, rr = 500, ir = 6, ar = class {
2377
+ eventStormingKeyboard: ["type", dr]
2378
+ }, hr = 500, gr = 6, _r = class {
2283
2379
  static $inject = ["injector", "eventBus"];
2284
2380
  constructor(e, t) {
2285
2381
  let n = e.get("connectionPreview", !1), r = e.get("eventStormingLabelEditing", !1), i = e.get("popupMenu", !1), a = e.get("modeling", !1), o = e.get("canvas", !1), s = !1;
@@ -2310,16 +2406,16 @@ var nr = {
2310
2406
  let c = (e) => {
2311
2407
  if (s || !e.parent || !i || !a || !o) return;
2312
2408
  let n = o.getAbsoluteBBox(e), c = o.getContainer().getBoundingClientRect();
2313
- i.open(e, G, {
2409
+ i.open(e, W, {
2314
2410
  x: c.left + n.x,
2315
- y: c.top + n.y + n.height + ir
2411
+ y: c.top + n.y + n.height + gr
2316
2412
  }), i.isOpen() ? t.once("popupMenu.close", () => {
2317
2413
  setTimeout(() => {
2318
2414
  s || (e.provisional ? e.parent && a.removeElements([e]) : r?.activate(e));
2319
2415
  }, 0);
2320
2416
  }) : a.removeElements([e]);
2321
2417
  };
2322
- t.on("create.end", rr, (e) => {
2418
+ t.on("create.end", hr, (e) => {
2323
2419
  let { context: t } = e;
2324
2420
  if (!t.source || !t.canExecute || !t.shape) return;
2325
2421
  let n = t.shape;
@@ -2336,14 +2432,14 @@ var nr = {
2336
2432
  } else r && setTimeout(() => r.activate(n), 0);
2337
2433
  });
2338
2434
  }
2339
- }, or = {
2340
- __depends__: [_e],
2435
+ }, vr = {
2436
+ __depends__: [ve],
2341
2437
  __init__: ["eventStormingAppendBehavior"],
2342
- eventStormingAppendBehavior: ["type", ar]
2343
- }, sr = S.map((e) => ({
2344
- value: O[e].fill,
2345
- title: O[e].label
2346
- })), cr = class {
2438
+ eventStormingAppendBehavior: ["type", _r]
2439
+ }, yr = S.map((e) => ({
2440
+ value: j[e].fill,
2441
+ title: j[e].label
2442
+ })), br = class {
2347
2443
  canvas;
2348
2444
  modeling;
2349
2445
  static $inject = [
@@ -2373,7 +2469,7 @@ var nr = {
2373
2469
  value: void 0,
2374
2470
  title: "No color",
2375
2471
  cls: "event-storming-cp-none"
2376
- }, ...sr.map((e) => ({
2472
+ }, ...yr.map((e) => ({
2377
2473
  value: e.value,
2378
2474
  title: e.title,
2379
2475
  cls: ""
@@ -2393,12 +2489,12 @@ var nr = {
2393
2489
  close() {
2394
2490
  this.popover && (this.popover.remove(), this.popover = void 0, document.removeEventListener("click", this.onDocPointer, !0), document.removeEventListener("keydown", this.onKey, !0));
2395
2491
  }
2396
- }, lr = {
2492
+ }, xr = {
2397
2493
  __init__: ["eventStormingColorPicker"],
2398
- eventStormingColorPicker: ["type", cr]
2399
- }, ur = {
2494
+ eventStormingColorPicker: ["type", br]
2495
+ }, Sr = {
2400
2496
  __init__: ["eventStormingOrderingProvider"],
2401
- eventStormingOrderingProvider: ["type", class extends ve {
2497
+ eventStormingOrderingProvider: ["type", class extends ye {
2402
2498
  static $inject = ["eventBus"];
2403
2499
  constructor(e) {
2404
2500
  super(e);
@@ -2407,14 +2503,14 @@ var nr = {
2407
2503
  for (; t.parent;) t = t.parent;
2408
2504
  let n = t.children ?? [];
2409
2505
  if (x(e)) {
2410
- let r = n.filter((t) => t !== e && (T(t) || x(t))).length;
2506
+ let r = n.filter((t) => t !== e && (O(t) || x(t))).length;
2411
2507
  return {
2412
2508
  parent: t,
2413
2509
  index: r
2414
2510
  };
2415
2511
  }
2416
- if (T(e)) {
2417
- let r = n.filter((t) => t !== e && T(t)).length;
2512
+ if (O(e)) {
2513
+ let r = n.filter((t) => t !== e && O(t)).length;
2418
2514
  return {
2419
2515
  parent: t,
2420
2516
  index: r
@@ -2423,7 +2519,7 @@ var nr = {
2423
2519
  return { parent: t };
2424
2520
  }
2425
2521
  }]
2426
- }, dr = 12, fr = class {
2522
+ }, Cr = 12, wr = class {
2427
2523
  canvas;
2428
2524
  eventBus;
2429
2525
  modeling;
@@ -2441,7 +2537,7 @@ var nr = {
2441
2537
  cursor = null;
2442
2538
  layer = null;
2443
2539
  constructor(e, t, n, r, i) {
2444
- this.canvas = e, this.eventBus = t, this.modeling = n, this.selection = r, this.factory = i, t.on("diagram.destroy", () => this.cancel()), t.on(K, (e) => {
2540
+ this.canvas = e, this.eventBus = t, this.modeling = n, this.selection = r, this.factory = i, t.on("diagram.destroy", () => this.cancel()), t.on(G, (e) => {
2445
2541
  e.readOnly && this.cancel();
2446
2542
  });
2447
2543
  }
@@ -2502,12 +2598,12 @@ var nr = {
2502
2598
  if (e.button !== 0 || this.isChromeTarget(e)) return;
2503
2599
  e.preventDefault(), e.stopPropagation();
2504
2600
  let t = this.toCanvasPoint(e), n = this.points[0];
2505
- if (n && this.points.length >= 3 && pr(t, n) <= dr) {
2601
+ if (n && this.points.length >= 3 && Tr(t, n) <= Cr) {
2506
2602
  this.finishClosed();
2507
2603
  return;
2508
2604
  }
2509
2605
  let r = this.points[this.points.length - 1];
2510
- r && pr(t, r) <= dr ? this.points.length >= 2 && this.finish() : (this.points.push(t), this.renderPreview());
2606
+ r && Tr(t, r) <= Cr ? this.points.length >= 2 && this.finish() : (this.points.push(t), this.renderPreview());
2511
2607
  };
2512
2608
  onDblClick = (e) => {
2513
2609
  this.isChromeTarget(e) || (e.preventDefault(), e.stopPropagation(), this.finish());
@@ -2524,7 +2620,7 @@ var nr = {
2524
2620
  f(t, p(m("polyline"), {
2525
2621
  points: n.map((e) => `${e.x},${e.y}`).join(" "),
2526
2622
  fill: "none",
2527
- stroke: F,
2623
+ stroke: R,
2528
2624
  "stroke-width": 2,
2529
2625
  "stroke-linecap": "round",
2530
2626
  "stroke-linejoin": "round",
@@ -2535,8 +2631,8 @@ var nr = {
2535
2631
  cx: r.x,
2536
2632
  cy: r.y,
2537
2633
  r: this.points.length >= 3 ? 5 : 3,
2538
- fill: P.paper,
2539
- stroke: F,
2634
+ fill: L.paper,
2635
+ stroke: R,
2540
2636
  "stroke-width": 1.5
2541
2637
  })), this.points.length >= 2) {
2542
2638
  let e = this.points[this.points.length - 1];
@@ -2544,8 +2640,8 @@ var nr = {
2544
2640
  cx: e.x,
2545
2641
  cy: e.y,
2546
2642
  r: 5,
2547
- fill: P.paper,
2548
- stroke: F,
2643
+ fill: L.paper,
2644
+ stroke: R,
2549
2645
  "stroke-width": 1.5
2550
2646
  }));
2551
2647
  }
@@ -2555,12 +2651,12 @@ var nr = {
2555
2651
  this.layer &&= (h(this.layer), null);
2556
2652
  }
2557
2653
  };
2558
- function pr(e, t) {
2654
+ function Tr(e, t) {
2559
2655
  return Math.hypot(e.x - t.x, e.y - t.y);
2560
2656
  }
2561
2657
  //#endregion
2562
2658
  //#region src/draw-tool/EventStormingDrawingHandles.ts
2563
- var mr = class {
2659
+ var Er = class {
2564
2660
  eventBus;
2565
2661
  canvas;
2566
2662
  modeling;
@@ -2575,9 +2671,9 @@ var mr = class {
2575
2671
  group = null;
2576
2672
  dragPreview = null;
2577
2673
  constructor(e, t, n, r) {
2578
- this.eventBus = e, this.canvas = t, this.modeling = n, this.readOnly = r, e.on(K, () => this.render()), e.on("selection.changed", (e) => {
2674
+ this.eventBus = e, this.canvas = t, this.modeling = n, this.readOnly = r, e.on(G, () => this.render()), e.on("selection.changed", (e) => {
2579
2675
  let t = e.newSelection ?? [], n = t.length === 1 ? t[0] : null;
2580
- this.attach(T(n) ? n : null);
2676
+ this.attach(O(n) ? n : null);
2581
2677
  }), e.on("element.changed", (e) => {
2582
2678
  this.shape && e.element === this.shape && this.render();
2583
2679
  }), e.on(["diagram.clear", "diagram.destroy"], () => this.attach(null));
@@ -2600,8 +2696,8 @@ var mr = class {
2600
2696
  cx: e.x,
2601
2697
  cy: e.y,
2602
2698
  r: 5,
2603
- fill: P.paper,
2604
- stroke: P.ink,
2699
+ fill: L.paper,
2700
+ stroke: L.ink,
2605
2701
  "stroke-width": 1.5,
2606
2702
  class: "event-storming-drawing-handle"
2607
2703
  });
@@ -2636,7 +2732,7 @@ var mr = class {
2636
2732
  let n = this.canvas.getLayer("event-storming-drawing-handles", 1100), r = p(m(t ? "polygon" : "polyline"), {
2637
2733
  points: e.map((e) => `${e.x},${e.y}`).join(" "),
2638
2734
  fill: "none",
2639
- stroke: P.ink,
2735
+ stroke: L.ink,
2640
2736
  "stroke-width": 1.5,
2641
2737
  "stroke-dasharray": "5 4",
2642
2738
  "pointer-events": "none"
@@ -2656,17 +2752,17 @@ var mr = class {
2656
2752
  y: (e.clientY - t.top) / r + n.y
2657
2753
  };
2658
2754
  }
2659
- }, hr = class {
2755
+ }, Dr = class {
2660
2756
  static $inject = ["eventBus", "interactionEvents"];
2661
2757
  constructor(e, t) {
2662
2758
  e.on("interactionEvents.createHit", (e) => {
2663
- if (T(e.element) && e.gfx) return gr(e.element, e.gfx), !1;
2759
+ if (O(e.element) && e.gfx) return Or(e.element, e.gfx), !1;
2664
2760
  }), e.on("interactionEvents.updateHit", (e) => {
2665
- if (T(e.element) && e.gfx) return t.removeHits(e.gfx), gr(e.element, e.gfx), !1;
2761
+ if (O(e.element) && e.gfx) return t.removeHits(e.gfx), Or(e.element, e.gfx), !1;
2666
2762
  });
2667
2763
  }
2668
2764
  };
2669
- function gr(e, t) {
2765
+ function Or(e, t) {
2670
2766
  let n = e.drawingPoints ?? [], r = m(e.closed ? "polygon" : "polyline");
2671
2767
  p(r, {
2672
2768
  points: n.map((e) => `${e.x},${e.y}`).join(" "),
@@ -2679,56 +2775,56 @@ function gr(e, t) {
2679
2775
  }
2680
2776
  //#endregion
2681
2777
  //#region src/draw-tool/index.ts
2682
- var _r = {
2778
+ var kr = {
2683
2779
  __init__: [
2684
2780
  "eventStormingDrawTool",
2685
2781
  "eventStormingDrawingHandles",
2686
2782
  "eventStormingDrawingHitProvider"
2687
2783
  ],
2688
- eventStormingDrawTool: ["type", fr],
2689
- eventStormingDrawingHandles: ["type", mr],
2690
- eventStormingDrawingHitProvider: ["type", hr]
2691
- }, vr = class {
2784
+ eventStormingDrawTool: ["type", wr],
2785
+ eventStormingDrawingHandles: ["type", Er],
2786
+ eventStormingDrawingHitProvider: ["type", Dr]
2787
+ }, Ar = class {
2692
2788
  static $inject = ["eventBus"];
2693
2789
  constructor(e) {
2694
2790
  e.on("resize.start", 1500, (e) => {
2695
2791
  let t = e.context;
2696
- Oe(t.shape) && (t.minDimensions = A);
2792
+ Ee(t.shape) && (t.minDimensions = N);
2697
2793
  });
2698
2794
  }
2699
- }, yr = {
2700
- __depends__: [ye],
2795
+ }, jr = {
2796
+ __depends__: [be],
2701
2797
  __init__: ["eventStormingResizeBehavior"],
2702
- eventStormingResizeBehavior: ["type", vr]
2703
- }, br = class extends W {
2798
+ eventStormingResizeBehavior: ["type", Ar]
2799
+ }, Mr = class extends Zt {
2704
2800
  _getModules() {
2705
2801
  return [
2706
2802
  ...super._getModules(),
2707
- te,
2708
- se,
2709
2803
  ne,
2804
+ ce,
2710
2805
  re,
2711
2806
  ie,
2712
2807
  ae,
2713
2808
  oe,
2714
- ce,
2809
+ se,
2715
2810
  le,
2716
- Sn,
2717
- tn,
2718
- Vt,
2719
- sn,
2720
- ln,
2811
+ ue,
2812
+ Pn,
2721
2813
  mn,
2722
- Tn,
2723
- Yn,
2724
- nr,
2725
- vn,
2726
- or,
2727
- lr,
2728
- nn,
2729
- ur,
2730
- _r,
2731
- yr
2814
+ $t,
2815
+ yn,
2816
+ xn,
2817
+ En,
2818
+ Ln,
2819
+ sr,
2820
+ mr,
2821
+ An,
2822
+ vr,
2823
+ xr,
2824
+ hn,
2825
+ Sr,
2826
+ kr,
2827
+ jr
2732
2828
  ];
2733
2829
  }
2734
2830
  undo() {
@@ -2743,18 +2839,18 @@ var _r = {
2743
2839
  canRedo() {
2744
2840
  return this.get("commandStack").canRedo();
2745
2841
  }
2746
- }, xr = "event-storming";
2747
- function Sr(e = {}) {
2748
- return Tr(new br({
2749
- ...wr(e),
2842
+ }, Nr = "event-storming";
2843
+ function Pr(e = {}) {
2844
+ return Lr(new Mr({
2845
+ ...Ir(e),
2750
2846
  undoRedoKeys: e.undoRedoKeys ?? !0,
2751
- freeArea: R(e)
2847
+ freeArea: Ye(e)
2752
2848
  }), !0);
2753
2849
  }
2754
- function Cr(e = {}) {
2755
- return Tr(new W(wr(e)), !1);
2850
+ function Fr(e = {}) {
2851
+ return Lr(new Zt(Ir(e)), !1);
2756
2852
  }
2757
- function wr(e) {
2853
+ function Ir(e) {
2758
2854
  return {
2759
2855
  width: "100%",
2760
2856
  height: "100%",
@@ -2762,10 +2858,10 @@ function wr(e) {
2762
2858
  fitOnImport: e.fitOnImport ?? !0
2763
2859
  };
2764
2860
  }
2765
- function Tr(e, t) {
2861
+ function Lr(e, t) {
2766
2862
  let n = e.get("eventBus"), r = e.get("canvas"), i = e.get("elementRegistry"), a = e.get("selection"), o = /* @__PURE__ */ new Set(), s = 0, c = !1, l = "", u = {
2767
- notation: xr,
2768
- apiVersion: be,
2863
+ notation: Nr,
2864
+ apiVersion: xe,
2769
2865
  editable: t
2770
2866
  };
2771
2867
  return t && n.on("commandStack.changed", () => {
@@ -2773,21 +2869,21 @@ function Tr(e, t) {
2773
2869
  }), {
2774
2870
  meta: u,
2775
2871
  elements: {
2776
- list: () => c ? [] : i.getAll().filter(Y).map((e) => Or(e)),
2872
+ list: () => c ? [] : i.getAll().filter(J).map((e) => Br(e)),
2777
2873
  reveal(e) {
2778
2874
  if (c) return !1;
2779
2875
  let t = i.get(e);
2780
- return Y(t) ? (a.select(t), r.scrollToElement(t), !0) : !1;
2876
+ return J(t) ? (a.select(t), r.scrollToElement(t), !0) : !1;
2781
2877
  },
2782
- selection: () => c ? [] : Er(a.get()),
2878
+ selection: () => c ? [] : Rr(a.get()),
2783
2879
  onSelection(e) {
2784
- let t = (t) => e(Er(t.newSelection ?? []));
2880
+ let t = (t) => e(Rr(t.newSelection ?? []));
2785
2881
  return n.on("selection.changed", t), () => n.off("selection.changed", t);
2786
2882
  },
2787
2883
  bounds(e) {
2788
2884
  if (c) return;
2789
2885
  let t = i.get(e);
2790
- return Y(t) ? Dr(t) : void 0;
2886
+ return J(t) ? zr(t) : void 0;
2791
2887
  }
2792
2888
  },
2793
2889
  diagram: e,
@@ -2799,7 +2895,7 @@ function Tr(e, t) {
2799
2895
  s += 1;
2800
2896
  try {
2801
2897
  let { warnings: n } = await e.importDSL(t);
2802
- return { warnings: n.map(Lt) };
2898
+ return { warnings: n.map(Jt) };
2803
2899
  } finally {
2804
2900
  --s;
2805
2901
  }
@@ -2818,19 +2914,22 @@ function Tr(e, t) {
2818
2914
  width: n,
2819
2915
  height: i
2820
2916
  };
2821
- return kr(a) ? a : void 0;
2917
+ return Vr(a) ? a : void 0;
2822
2918
  } catch {
2823
2919
  return;
2824
2920
  }
2825
2921
  },
2826
2922
  setViewState(e) {
2827
- !c && kr(e) && r.viewbox({
2923
+ !c && Vr(e) && r.viewbox({
2828
2924
  x: e.x,
2829
2925
  y: e.y,
2830
2926
  width: e.width,
2831
2927
  height: e.height
2832
2928
  });
2833
2929
  },
2930
+ contentBounds() {
2931
+ return e.contentBounds();
2932
+ },
2834
2933
  destroy() {
2835
2934
  if (!c) {
2836
2935
  try {
@@ -2843,13 +2942,13 @@ function Tr(e, t) {
2843
2942
  }
2844
2943
  };
2845
2944
  }
2846
- function Y(e) {
2945
+ function J(e) {
2847
2946
  return w(e);
2848
2947
  }
2849
- function Er(e) {
2850
- return e.filter(Y).map((e) => e.id);
2948
+ function Rr(e) {
2949
+ return e.filter(J).map((e) => e.id);
2851
2950
  }
2852
- function Dr(e) {
2951
+ function zr(e) {
2853
2952
  return {
2854
2953
  x: e.x,
2855
2954
  y: e.y,
@@ -2857,24 +2956,24 @@ function Dr(e) {
2857
2956
  height: e.height
2858
2957
  };
2859
2958
  }
2860
- function Or(e) {
2959
+ function Br(e) {
2861
2960
  let t = e.eventStormingLabel;
2862
2961
  return t ? {
2863
2962
  id: e.id,
2864
2963
  name: t
2865
2964
  } : { id: e.id };
2866
2965
  }
2867
- function kr(e) {
2966
+ function Vr(e) {
2868
2967
  if (typeof e != "object" || !e) return !1;
2869
2968
  let { x: t, y: n, width: r, height: i } = e;
2870
- return X(t) && X(n) && X(r) && X(i) && r > 0 && i > 0;
2969
+ return Y(t) && Y(n) && Y(r) && Y(i) && r > 0 && i > 0;
2871
2970
  }
2872
- function X(e) {
2971
+ function Y(e) {
2873
2972
  return typeof e == "number" && Number.isFinite(e);
2874
2973
  }
2875
2974
  //#endregion
2876
2975
  //#region src/board-menu/menu.ts
2877
- var Ar = "Export as .storm", jr = [
2976
+ var Hr = "Export as .storm", Ur = [
2878
2977
  {
2879
2978
  value: "big-picture",
2880
2979
  label: "Big picture"
@@ -2888,10 +2987,10 @@ var Ar = "Export as .storm", jr = [
2888
2987
  label: "Software design"
2889
2988
  }
2890
2989
  ];
2891
- function Mr(e) {
2892
- return jr.some((t) => t.value === e);
2990
+ function Wr(e) {
2991
+ return Ur.some((t) => t.value === e);
2893
2992
  }
2894
- function Z(e, t, n, r) {
2993
+ function X(e, t, n, r) {
2895
2994
  return {
2896
2995
  kind: "action",
2897
2996
  id: e,
@@ -2901,20 +3000,20 @@ function Z(e, t, n, r) {
2901
3000
  onSelect: () => n.onSelect()
2902
3001
  };
2903
3002
  }
2904
- function Nr(e) {
2905
- let t = [Z("export-png", "Export as PNG", e.png, "file-image"), Z("export-svg", "Export as SVG", e.svg, "file-code-corner")];
2906
- return e.transparentPng && t.push(Z("export-png-transparent", "Export as PNG (4×, transparent)", e.transparentPng)), e.json && t.push(Z("export-json", "Export as JSON", e.json)), e.storm && t.push(Z("export-storm", Ar, e.storm)), t;
3003
+ function Gr(e) {
3004
+ let t = [X("export-png", "Export as PNG", e.png, "file-image"), X("export-svg", "Export as SVG", e.svg, "file-code-corner")];
3005
+ return e.transparentPng && t.push(X("export-png-transparent", "Export as PNG (4×, transparent)", e.transparentPng)), e.json && t.push(X("export-json", "Export as JSON", e.json)), e.storm && t.push(X("export-storm", Hr, e.storm)), t;
2907
3006
  }
2908
- function Pr(e) {
3007
+ function Kr(e) {
2909
3008
  return {
2910
3009
  model: [{
2911
3010
  kind: "radio",
2912
3011
  id: "level",
2913
3012
  label: "Level",
2914
- options: jr,
3013
+ options: Ur,
2915
3014
  value: () => e.levels.getLevel(),
2916
3015
  onSelect: (t) => {
2917
- Mr(t) && e.levels.setLevel(t);
3016
+ Wr(t) && e.levels.setLevel(t);
2918
3017
  }
2919
3018
  }, {
2920
3019
  kind: "checkbox",
@@ -2926,7 +3025,7 @@ function Pr(e) {
2926
3025
  e.typeCaptions.setTypeCaptionsVisible(t), e.onTypeCaptionsToggled?.(t);
2927
3026
  }
2928
3027
  }],
2929
- export: Nr(e.exports),
3028
+ export: Gr(e.exports),
2930
3029
  help: [{
2931
3030
  kind: "dialog",
2932
3031
  id: "keyboard-shortcuts",
@@ -2938,23 +3037,23 @@ function Pr(e) {
2938
3037
  }
2939
3038
  //#endregion
2940
3039
  //#region src/board-menu/shortcuts.ts
2941
- var Fr = [
3040
+ var qr = [
2942
3041
  "←",
2943
3042
  "↑",
2944
3043
  "→",
2945
3044
  "↓"
2946
3045
  ];
2947
- function Ir(e, t, n) {
3046
+ function Jr(e, t, n) {
2948
3047
  return t === "mac" ? `⌘${e}` : `${n.ctrl}+${e}`;
2949
3048
  }
2950
- function Lr(e) {
3049
+ function Yr(e) {
2951
3050
  try {
2952
3051
  return new Intl.NumberFormat(e, { style: "percent" }).format(1);
2953
3052
  } catch {
2954
3053
  return new Intl.NumberFormat("en", { style: "percent" }).format(1);
2955
3054
  }
2956
3055
  }
2957
- function Rr(e, t) {
3056
+ function Xr(e, t) {
2958
3057
  if (e === "mac") return {
2959
3058
  zoomIn: "⌘+",
2960
3059
  zoomOut: "⌘−",
@@ -2969,7 +3068,7 @@ function Rr(e, t) {
2969
3068
  fit: `${r}+1`
2970
3069
  };
2971
3070
  }
2972
- function zr(e, t) {
3071
+ function Zr(e, t) {
2973
3072
  if (e === "mac") return {
2974
3073
  undo: ["⌘Z"],
2975
3074
  redo: ["⌘⇧Z"],
@@ -2978,7 +3077,7 @@ function zr(e, t) {
2978
3077
  paste: ["⌘V"],
2979
3078
  duplicate: ["⌘D"],
2980
3079
  remove: ["⌫"],
2981
- coarseMove: Fr.map((e) => `⇧${e}`),
3080
+ coarseMove: qr.map((e) => `⇧${e}`),
2982
3081
  lassoDrag: ["⇧ Drag"]
2983
3082
  };
2984
3083
  let { ctrl: n, shift: r } = t;
@@ -2990,27 +3089,27 @@ function zr(e, t) {
2990
3089
  paste: [`${n}+V`],
2991
3090
  duplicate: [`${n}+D`],
2992
3091
  remove: ["Del", "Backspace"],
2993
- coarseMove: Fr.map((e) => `${r}+${e}`),
3092
+ coarseMove: qr.map((e) => `${r}+${e}`),
2994
3093
  lassoDrag: [`${r}+Drag`]
2995
3094
  };
2996
3095
  }
2997
- function Br(e) {
3096
+ function Qr(e) {
2998
3097
  let { platform: t, messages: n } = e;
2999
3098
  return {
3000
3099
  title: "File",
3001
3100
  rows: [{
3002
3101
  action: n.openFile ?? "Open…",
3003
- keys: [Ir("O", t, n.keyNames)]
3102
+ keys: [Jr("O", t, n.keyNames)]
3004
3103
  }, {
3005
- action: Ar,
3006
- keys: [Ir("S", t, n.keyNames)]
3104
+ action: Hr,
3105
+ keys: [Jr("S", t, n.keyNames)]
3007
3106
  }]
3008
3107
  };
3009
3108
  }
3010
- function Vr(e, t = {}) {
3011
- let { platform: n, messages: r } = e, i = Rr(n, r.keyNames), a = zr(n, r.keyNames);
3109
+ function $r(e, t = {}) {
3110
+ let { platform: n, messages: r } = e, i = Xr(n, r.keyNames), a = Zr(n, r.keyNames);
3012
3111
  return [
3013
- ...t.fileKeys ? [Br(e)] : [],
3112
+ ...t.fileKeys ? [Qr(e)] : [],
3014
3113
  {
3015
3114
  title: "View",
3016
3115
  rows: [
@@ -3023,7 +3122,7 @@ function Vr(e, t = {}) {
3023
3122
  keys: [i.zoomOut]
3024
3123
  },
3025
3124
  {
3026
- action: r.zoomToActual(Lr(e.lang)),
3125
+ action: r.zoomToActual(Yr(e.lang)),
3027
3126
  keys: [i.zoomToActual]
3028
3127
  },
3029
3128
  {
@@ -3065,7 +3164,7 @@ function Vr(e, t = {}) {
3065
3164
  },
3066
3165
  {
3067
3166
  action: "Move selection",
3068
- keys: Fr
3167
+ keys: qr
3069
3168
  },
3070
3169
  {
3071
3170
  action: "Move selection in large steps",
@@ -3106,39 +3205,39 @@ function Vr(e, t = {}) {
3106
3205
  }
3107
3206
  //#endregion
3108
3207
  //#region src/board-menu/ShortcutsDialog.ts
3109
- var Q = "event-storming-shortcuts", Hr = "event-storming-shortcuts-title";
3208
+ var Z = "event-storming-shortcuts", Q = "event-storming-shortcuts-title";
3110
3209
  function $(e, t, n) {
3111
3210
  let r = document.createElement(e);
3112
3211
  return r.className = t, n !== void 0 && (r.textContent = n), r;
3113
3212
  }
3114
- function Ur(e, t) {
3115
- let n = $("section", `${Q}-group`), r = `${Hr}-group-${t}`, i = $("h4", `${Q}-group-title`, e.title);
3213
+ function ei(e, t) {
3214
+ let n = $("section", `${Z}-group`), r = `${Q}-group-${t}`, i = $("h4", `${Z}-group-title`, e.title);
3116
3215
  i.id = r;
3117
- let a = $("table", `${Q}-table`);
3216
+ let a = $("table", `${Z}-table`);
3118
3217
  a.setAttribute("aria-labelledby", r);
3119
3218
  let o = a.createTBody();
3120
3219
  for (let t of e.rows) {
3121
- let e = o.insertRow(), n = $("th", `${Q}-action`, t.action);
3220
+ let e = o.insertRow(), n = $("th", `${Z}-action`, t.action);
3122
3221
  n.scope = "row";
3123
- let r = $("td", `${Q}-keys`);
3124
- for (let e of t.keys) r.append($("kbd", `${Q}-key`, e));
3222
+ let r = $("td", `${Z}-keys`);
3223
+ for (let e of t.keys) r.append($("kbd", `${Z}-key`, e));
3125
3224
  e.append(n, r);
3126
3225
  }
3127
3226
  return n.append(i, a), n;
3128
3227
  }
3129
- function Wr(e, t, n) {
3130
- let r = $("div", `${Q}-panel`), i = $("header", `${Q}-header`), a = $("h3", `${Q}-title`, "Keyboard shortcuts");
3131
- a.id = Hr;
3132
- let o = $("button", `${Q}-close`);
3133
- o.type = "button", o.setAttribute("aria-label", e.messages.close), o.innerHTML = q("x"), o.addEventListener("click", n), i.append(a, o);
3134
- let s = $("div", `${Q}-body`);
3135
- return s.append(...Vr(e, t).map(Ur)), r.append(i, s), r;
3228
+ function ti(e, t, n) {
3229
+ let r = $("div", `${Z}-panel`), i = $("header", `${Z}-header`), a = $("h3", `${Z}-title`, "Keyboard shortcuts");
3230
+ a.id = Q;
3231
+ let o = $("button", `${Z}-close`);
3232
+ o.type = "button", o.setAttribute("aria-label", e.messages.close), o.innerHTML = K("x"), o.addEventListener("click", n), i.append(a, o);
3233
+ let s = $("div", `${Z}-body`);
3234
+ return s.append(...$r(e, t).map(ei)), r.append(i, s), r;
3136
3235
  }
3137
- function Gr(e, t = {}) {
3236
+ function ni(e, t = {}) {
3138
3237
  let n;
3139
3238
  function r() {
3140
- let n = $("dialog", Q);
3141
- return n.setAttribute("aria-labelledby", Hr), n.append(Wr(e, t, () => n.close())), n.addEventListener("click", (e) => {
3239
+ let n = $("dialog", Z);
3240
+ return n.setAttribute("aria-labelledby", Q), n.append(ti(e, t, () => n.close())), n.addEventListener("click", (e) => {
3142
3241
  e.target === n && n.close();
3143
3242
  }), n.addEventListener("close", () => {
3144
3243
  e.menu.trigger.hidden || e.menu.trigger.focus({ preventScroll: !0 });
@@ -3159,11 +3258,11 @@ function Gr(e, t = {}) {
3159
3258
  }
3160
3259
  //#endregion
3161
3260
  //#region src/draw/icons.ts
3162
- var Kr = "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", qr = "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", Jr = "M6 19c0 1.1.9 2 2 2h8c1.1 0 2-.9 2-2V7H6v12zM19 4h-3.5l-1-1h-5l-1 1H5v2h14V4z", Yr = "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", Xr = "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", Zr = "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", Qr = "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", $r = "M19 9h-4V3H9v6H5l7 7 7-7zM5 18v2h14v-2H5z", ei = "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", ti = "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", ni = "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", ri = "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", ii = "M3 18h18v-2H3v2zm0-5h18v-2H3v2zm0-7v2h18V6H3z", ai = "M19 13h-6v6h-2v-6H5v-2h6V5h2v6h6v2z", oi = "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", si = "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";
3163
- function ci(e, t = 18) {
3261
+ var ri = "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", ii = "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", ai = "M6 19c0 1.1.9 2 2 2h8c1.1 0 2-.9 2-2V7H6v12zM19 4h-3.5l-1-1h-5l-1 1H5v2h14V4z", oi = "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", si = "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", ci = "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", li = "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", ui = "M19 9h-4V3H9v6H5l7 7 7-7zM5 18v2h14v-2H5z", di = "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", fi = "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", pi = "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", mi = "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", hi = "M3 18h18v-2H3v2zm0-5h18v-2H3v2zm0-7v2h18V6H3z", gi = "M19 13h-6v6h-2v-6H5v-2h6V5h2v6h6v2z", _i = "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", vi = "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";
3262
+ function yi(e, t = 18) {
3164
3263
  return `<svg viewBox="0 0 24 24" width="${t}" height="${t}" fill="currentColor" aria-hidden="true"><path d="${e}"/></svg>`;
3165
3264
  }
3166
3265
  //#endregion
3167
- export { jr as BOARD_LEVELS, nt as BoardBounds, P as COLORS, xr as EVENT_STORMING_NOTATION, ar as EventStormingAppendBehavior, Bt as EventStormingAttachBehavior, qe as EventStormingBaseViewer, cr as EventStormingColorPicker, Qe as EventStormingElementFactory, _n as EventStormingElementSettingsProvider, Ft as EventStormingExporter, Pt as EventStormingImporter, Gn as EventStormingLabelEditing, qt as EventStormingModeling, xn as EventStormingReadOnly, vt as EventStormingRenderer, vr as EventStormingResizeBehavior, on as EventStormingRules, at as EventStormingViewOptions, ai as ICON_ADD, Qr as ICON_CODE, Zr as ICON_DATA_OBJECT, Jr as ICON_DELETE, $r as ICON_DOWNLOAD, qr as ICON_EDIT, si as ICON_EYE, oi as ICON_FIT, ti as ICON_FOLDER_OPEN, ni as ICON_IMAGE, ii as ICON_MENU, ri as ICON_NEW, Kr as ICON_PERSON, Xr as ICON_REDO, ei as ICON_SHARE, Yr as ICON_UNDO, E as MIRAGON, br as Modeler, k as NOTE_STYLE, W as NavigatedViewer, G as POPUP_PROVIDER_ID, K as READ_ONLY_CHANGED_EVENT, y as ROOT_ID, S as STICKY_KINDS, O as STICKY_STYLES, Ar as STORM_EXPORT_LABEL, it as VIEW_OPTIONS_CHANGED_EVENT, zt as Viewer, rt as boardBoundsModule, Pr as boardMenu, Vr as boardShortcuts, Ir as commandKeyLabel, Sr as createCollaborativeModeler, Cr as createCollaborativeViewer, Gr as createShortcutsDialog, ln as elementSnappingModule, or as eventStormingAppendModule, Vt as eventStormingAttachModule, lr as eventStormingColorPickerModule, Tn as eventStormingContextPadModule, jt as eventStormingDrawModule, nr as eventStormingKeyboardModule, et as eventStormingModelModule, tn as eventStormingModelingModule, mn as eventStormingPaletteModule, vn as eventStormingPopupModule, Sn as eventStormingReadOnlyModule, yr as eventStormingResizeModule, sn as eventStormingRulesModule, V as eventStormingViewOptionsModule, ci as iconMarkup, Lt as importWarningText, Rt as ioModule, we as isAttachableKind, Ee as isAttachableSticky, x as isEventStormingConnection, b as isEventStormingShape, Te as isHostKind, De as isHostSticky, w as isSticky, C as isStickyKind, Yn as labelEditingModule, D as parseNoteMarkdown, je as plainNoteText, Se as saveSVG, Ae as serializeNoteMarkdown };
3266
+ export { Ur as BOARD_LEVELS, Vt as BoardBounds, L as COLORS, Nr as EVENT_STORMING_NOTATION, _r as EventStormingAppendBehavior, Qt as EventStormingAttachBehavior, at as EventStormingBaseViewer, br as EventStormingColorPicker, ut as EventStormingElementFactory, kn as EventStormingElementSettingsProvider, Kt as EventStormingExporter, Gt as EventStormingImporter, rr as EventStormingLabelEditing, on as EventStormingModeling, Nn as EventStormingReadOnly, wt as EventStormingRenderer, Ar as EventStormingResizeBehavior, vn as EventStormingRules, Lt as EventStormingViewOptions, gi as ICON_ADD, li as ICON_CODE, ci as ICON_DATA_OBJECT, ai as ICON_DELETE, ui as ICON_DOWNLOAD, ii as ICON_EDIT, vi as ICON_EYE, _i as ICON_FIT, fi as ICON_FOLDER_OPEN, pi as ICON_IMAGE, hi as ICON_MENU, mi as ICON_NEW, ri as ICON_PERSON, si as ICON_REDO, di as ICON_SHARE, oi as ICON_UNDO, k as MIRAGON, Mr as Modeler, M as NOTE_STYLE, Zt as NavigatedViewer, W as POPUP_PROVIDER_ID, G as READ_ONLY_CHANGED_EVENT, y as ROOT_ID, S as STICKY_KINDS, j as STICKY_STYLES, Hr as STORM_EXPORT_LABEL, It as VIEW_OPTIONS_CHANGED_EVENT, Xt as Viewer, Ht as boardBoundsModule, Kr as boardMenu, $r as boardShortcuts, Jr as commandKeyLabel, Pr as createCollaborativeModeler, Fr as createCollaborativeViewer, ni as createShortcutsDialog, xn as elementSnappingModule, vr as eventStormingAppendModule, $t as eventStormingAttachModule, xr as eventStormingColorPickerModule, Ln as eventStormingContextPadModule, zt as eventStormingDrawModule, mr as eventStormingKeyboardModule, ft as eventStormingModelModule, mn as eventStormingModelingModule, En as eventStormingPaletteModule, An as eventStormingPopupModule, Pn as eventStormingReadOnlyModule, jr as eventStormingResizeModule, yn as eventStormingRulesModule, Rt as eventStormingViewOptionsModule, yi as iconMarkup, Jt as importWarningText, Yt as ioModule, T as isAttachableKind, Te as isAttachableSticky, x as isEventStormingConnection, b as isEventStormingShape, E as isHostKind, D as isHostSticky, w as isSticky, C as isStickyKind, sr as labelEditingModule, A as parseNoteMarkdown, ke as plainNoteText, Ce as saveSVG, Oe as serializeNoteMarkdown };
3168
3267
 
3169
3268
  //# sourceMappingURL=index.js.map