@miragon/event-storming-renderer 0.4.1 → 0.5.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (44) hide show
  1. package/README.md +52 -19
  2. package/dist/EventStormingBaseViewer.d.ts +23 -3
  3. package/dist/EventStormingBaseViewer.d.ts.map +1 -1
  4. package/dist/board-bounds/BoardBounds.d.ts +6 -5
  5. package/dist/board-bounds/BoardBounds.d.ts.map +1 -1
  6. package/dist/board-menu/ShortcutsDialog.d.ts +1 -1
  7. package/dist/board-menu/menu.d.ts +5 -5
  8. package/dist/board-menu/shortcuts.d.ts +2 -2
  9. package/dist/collaborative/CollaborativeEventStorming.d.ts +9 -4
  10. package/dist/collaborative/CollaborativeEventStorming.d.ts.map +1 -1
  11. package/dist/color-picker/EventStormingColorPicker.d.ts.map +1 -1
  12. package/dist/context-pad/EventStormingContextPadProvider.d.ts +9 -1
  13. package/dist/context-pad/EventStormingContextPadProvider.d.ts.map +1 -1
  14. package/dist/draw/EventStormingRenderer.d.ts +4 -3
  15. package/dist/draw/EventStormingRenderer.d.ts.map +1 -1
  16. package/dist/draw/contrast.d.ts +8 -0
  17. package/dist/draw/contrast.d.ts.map +1 -0
  18. package/dist/draw/extent.d.ts +47 -0
  19. package/dist/draw/extent.d.ts.map +1 -0
  20. package/dist/draw/index.d.ts +1 -0
  21. package/dist/draw/index.d.ts.map +1 -1
  22. package/dist/draw/lucide.d.ts +8 -8
  23. package/dist/draw/styles.d.ts +27 -6
  24. package/dist/draw/styles.d.ts.map +1 -1
  25. package/dist/draw-tool/EventStormingDrawTool.d.ts +6 -0
  26. package/dist/draw-tool/EventStormingDrawTool.d.ts.map +1 -1
  27. package/dist/index.js +880 -688
  28. package/dist/index.js.map +1 -1
  29. package/dist/keyboard/EventStormingKeyboard.d.ts +4 -3
  30. package/dist/keyboard/EventStormingKeyboard.d.ts.map +1 -1
  31. package/dist/keyboard/canvas-focus.d.ts +11 -0
  32. package/dist/keyboard/canvas-focus.d.ts.map +1 -0
  33. package/dist/keyboard/index.d.ts +2 -0
  34. package/dist/keyboard/index.d.ts.map +1 -1
  35. package/dist/keyboard/key-scope.d.ts +16 -0
  36. package/dist/keyboard/key-scope.d.ts.map +1 -0
  37. package/dist/label-editing/note-editor-dom.d.ts +2 -2
  38. package/dist/model/EventStormingElementFactory.d.ts +1 -1
  39. package/dist/model/di-types.d.ts +2 -2
  40. package/dist/palette/EventStormingPaletteProvider.d.ts +7 -1
  41. package/dist/palette/EventStormingPaletteProvider.d.ts.map +1 -1
  42. package/dist/theme/palette.d.ts +10 -1
  43. package/dist/theme/palette.d.ts.map +1 -1
  44. package/package.json +8 -8
package/dist/index.js CHANGED
@@ -1,11 +1,11 @@
1
1
  import e from "diagram-js/lib/Diagram";
2
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
3
  import { parseDSLWithDiagnostics as l, serializeDSL as u } from "@miragon/event-storming-dsl";
4
- import d from "diagram-js/lib/features/change-support";
5
- import f from "diagram-js/lib/draw/BaseRenderer";
6
- import { append as p, attr as m, create as h, remove as g } from "tiny-svg";
7
- import _ from "diagram-js/lib/features/selection";
8
- import ee from "diagram-js/lib/navigation/zoomscroll";
4
+ import d from "diagram-js/lib/draw/BaseRenderer";
5
+ import { append as f, attr as p, create as m, remove as h } from "tiny-svg";
6
+ import g from "diagram-js/lib/features/change-support";
7
+ import ee from "diagram-js/lib/features/selection";
8
+ import _ from "diagram-js/lib/navigation/zoomscroll";
9
9
  import te from "diagram-js/lib/navigation/movecanvas";
10
10
  import ne from "diagram-js/lib/features/keyboard";
11
11
  import re from "diagram-js/lib/features/modeling";
@@ -28,7 +28,7 @@ import ye from "diagram-js/lib/features/connection-preview";
28
28
  import be from "diagram-js/lib/features/ordering/OrderingProvider";
29
29
  import xe from "diagram-js/lib/features/resize";
30
30
  import { MODELER_API_VERSION as Se } from "@miragon/modeler-api";
31
- //#region src/io/saveSvg.ts
31
+ // src/io/saveSvg.ts
32
32
  var Ce = [
33
33
  "tabindex",
34
34
  "role",
@@ -49,8 +49,7 @@ function we(e, t) {
49
49
  let o = r.querySelector(".viewport");
50
50
  return o && o.removeAttribute("transform"), { svg: "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n" + new XMLSerializer().serializeToString(r) };
51
51
  }
52
- //#endregion
53
- //#region src/model/di-types.ts
52
+ // src/model/di-types.ts
54
53
  var v = "event-storming-root";
55
54
  function Te(e) {
56
55
  return typeof e == "object" && !!e;
@@ -77,27 +76,26 @@ function S(e) {
77
76
  function C(e) {
78
77
  return y(e) && S(e.eventStormingType);
79
78
  }
80
- function w(e) {
79
+ function Ee(e) {
81
80
  return t.includes(e);
82
81
  }
83
- function T(e) {
82
+ function De(e) {
84
83
  return a.includes(e);
85
84
  }
86
- function Ee(e) {
87
- return y(e) && w(e.eventStormingType);
85
+ function Oe(e) {
86
+ return y(e) && Ee(e.eventStormingType);
88
87
  }
89
- function E(e) {
90
- return y(e) && T(e.eventStormingType);
88
+ function ke(e) {
89
+ return y(e) && De(e.eventStormingType);
91
90
  }
92
- function D(e) {
91
+ function w(e) {
93
92
  return y(e) && e.eventStormingType === "drawing";
94
93
  }
95
- function De(e) {
94
+ function Ae(e) {
96
95
  return y(e) && e.eventStormingType === "note";
97
96
  }
98
- //#endregion
99
- //#region src/theme/palette.ts
100
- var O = {
97
+ // src/theme/palette.ts
98
+ var T = {
101
99
  blau: "#335DE5",
102
100
  blauLink: "#2B50D4",
103
101
  blauHell: "#6B8AFF",
@@ -106,13 +104,15 @@ var O = {
106
104
  schwarz: "#1D1D1D",
107
105
  weiss: "#FFFFFF",
108
106
  linie: "#E6E2E2",
107
+ kontur: "#8F8A8A",
108
+ textLeise: "#6B6666",
109
109
  success: "#00E676",
110
110
  warning: "#FFB000",
111
111
  danger: "#CD1839",
112
112
  info: "#335DE5",
113
113
  navy: "#080A20",
114
114
  gradientBrand: "linear-gradient(120deg, #335DE5 30%, #00E676)"
115
- }, Oe = [
115
+ }, je = [
116
116
  {
117
117
  marker: "***",
118
118
  bold: !0,
@@ -129,28 +129,28 @@ var O = {
129
129
  italic: !0
130
130
  }
131
131
  ];
132
- function k(e) {
132
+ function E(e) {
133
133
  return e.split("\n").map((e) => {
134
134
  let t = e.startsWith("- ");
135
135
  return {
136
136
  bullet: t,
137
- runs: je(t ? e.slice(2) : e)
137
+ runs: Pe(t ? e.slice(2) : e)
138
138
  };
139
139
  });
140
140
  }
141
- function ke(e) {
141
+ function Me(e) {
142
142
  return e.map((e) => {
143
- let t = Ne(e.runs).map((e) => {
143
+ let t = Ie(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 Ae(e) {
151
- return k(e).map((e) => (e.bullet ? "• " : "") + e.runs.map((e) => e.text).join("")).join("\n");
150
+ function Ne(e) {
151
+ return E(e).map((e) => (e.bullet ? "• " : "") + e.runs.map((e) => e.text).join("")).join("\n");
152
152
  }
153
- function je(e) {
153
+ function Pe(e) {
154
154
  let t = [], n = "", r = () => {
155
155
  n && t.push({
156
156
  text: n,
@@ -159,17 +159,17 @@ function je(e) {
159
159
  }), n = "";
160
160
  }, i = 0;
161
161
  for (; i < e.length;) {
162
- let a = e[i] === "*" ? Me(e, i) : void 0;
162
+ let a = e[i] === "*" ? Fe(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(), Ne(t);
169
+ return r(), Ie(t);
170
170
  }
171
- function Me(e, t) {
172
- for (let { marker: n, bold: r, italic: i } of Oe) {
171
+ function Fe(e, t) {
172
+ for (let { marker: n, bold: r, italic: i } of je) {
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 Me(e, t) {
180
180
  };
181
181
  }
182
182
  }
183
- function Ne(e) {
183
+ function Ie(e) {
184
184
  let t = [];
185
185
  for (let n of e) {
186
186
  if (!n.text) continue;
@@ -193,36 +193,35 @@ function Ne(e) {
193
193
  }
194
194
  return t;
195
195
  }
196
- //#endregion
197
- //#region src/draw/styles.ts
198
- var A = {
196
+ // src/draw/styles.ts
197
+ var D = {
199
198
  event: {
200
199
  label: "Domain Event",
201
200
  width: 130,
202
201
  height: 90,
203
202
  fill: "#FFB84D",
204
- stroke: "#E89A2E"
203
+ stroke: "#CA7E16"
205
204
  },
206
205
  command: {
207
206
  label: "Command",
208
207
  width: 130,
209
208
  height: 90,
210
209
  fill: "#7EC8F0",
211
- stroke: "#4FA8D8"
210
+ stroke: "#2F98D1"
212
211
  },
213
212
  actor: {
214
213
  label: "Actor",
215
214
  width: 100,
216
215
  height: 65,
217
216
  fill: "#FFF9B1",
218
- stroke: "#E6DB7A"
217
+ stroke: "#9E911E"
219
218
  },
220
219
  aggregate: {
221
220
  label: "Aggregate",
222
221
  width: 180,
223
222
  height: 110,
224
223
  fill: "#FFE066",
225
- stroke: "#E0BE3F"
224
+ stroke: "#AB8C1C"
226
225
  },
227
226
  policy: {
228
227
  label: "Policy",
@@ -236,14 +235,14 @@ var A = {
236
235
  width: 130,
237
236
  height: 90,
238
237
  fill: "#A8D08D",
239
- stroke: "#7FB35D"
238
+ stroke: "#6A9D4A"
240
239
  },
241
240
  external: {
242
241
  label: "External System",
243
242
  width: 180,
244
243
  height: 110,
245
244
  fill: "#F4A6C0",
246
- stroke: "#DE7EA2"
245
+ stroke: "#D96C95"
247
246
  },
248
247
  hotspot: {
249
248
  label: "Hotspot",
@@ -252,23 +251,32 @@ var A = {
252
251
  fill: "#E85D75",
253
252
  stroke: "#C43B55"
254
253
  }
255
- }, j = {
254
+ }, O = {
256
255
  label: "Note",
257
256
  fill: "#ECECEC",
258
- stroke: "#C4C4C4"
259
- }, Pe = {
257
+ stroke: T.kontur
258
+ }, k = {
259
+ fill: T.weiss,
260
+ stroke: T.kontur,
261
+ dash: "6 4"
262
+ }, A = {
263
+ color: T.schwarz,
264
+ opacity: .2,
265
+ dy: 5,
266
+ blur: 5
267
+ }, j = {
260
268
  width: 60,
261
269
  height: 40
262
- }, M = 7.5, Fe = {
263
- width: A.aggregate.width,
264
- height: A.aggregate.height
270
+ }, M = 7.5, Le = {
271
+ width: D.aggregate.width,
272
+ height: D.aggregate.height
265
273
  };
266
274
  function N(e) {
267
- let t = Ae(e), n = (t && t.length ? t : "note").split("\n"), r = Math.max(1, ...n.map((e) => e.length));
275
+ let t = Ne(e), n = (t && t.length ? t : "note").split("\n"), r = Math.max(1, ...n.map((e) => e.length));
268
276
  return {
269
277
  lines: n,
270
- width: Math.max(Fe.width, Math.round(r * M) + 16),
271
- height: Math.max(Fe.height, n.length * 17 + 16)
278
+ width: Math.max(Le.width, Math.round(r * M) + 16),
279
+ height: Math.max(Le.height, n.length * 17 + 16)
272
280
  };
273
281
  }
274
282
  function P(e, t) {
@@ -276,104 +284,306 @@ function P(e, t) {
276
284
  return t.width !== n.width || t.height !== n.height;
277
285
  }
278
286
  var F = {
279
- paper: O.grau,
280
- ink: O.schwarz,
281
- inkSoft: "#5B5B5B",
282
- surface: O.weiss,
283
- stroke: O.schwarz,
284
- arrow: "#9E9E9E",
285
- accent: O.blau,
287
+ paper: T.grau,
288
+ ink: T.schwarz,
289
+ inkSoft: T.textLeise,
290
+ surface: T.weiss,
291
+ stroke: T.schwarz,
292
+ arrow: T.kontur,
293
+ accent: T.blau,
286
294
  accentSoft: "rgba(51,93,229,0.12)",
287
- stickyText: O.schwarz
288
- }, I = O.schwarz, L = {
295
+ stickyText: T.schwarz
296
+ }, I = T.schwarz, L = {
289
297
  family: "'Geist Variable', 'Geist', ui-sans-serif, system-ui, -apple-system, 'Segoe UI', sans-serif",
290
298
  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>`, R = {
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(j.fill, j.stroke)
299
+ }, Re = "geometricPrecision", ze = `italic 11px ${L.family}`;
300
+ function R(e) {
301
+ return {
302
+ x: e.x + e.width / 2,
303
+ y: e.y + e.height / 2
304
+ };
305
+ }
306
+ function Be(e, t) {
307
+ let n = R(e), r = t.x - n.x, i = t.y - n.y;
308
+ if (r === 0 && i === 0) return n;
309
+ 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));
310
+ return {
311
+ x: n.x + r * s,
312
+ y: n.y + i * s
313
+ };
314
+ }
315
+ function Ve(e) {
316
+ let t = e.source, n = e.target, r = e.waypoints;
317
+ if (!t || !n) {
318
+ let e = r[0] ?? {
319
+ x: 0,
320
+ y: 0
321
+ };
322
+ return [e, r[r.length - 1] ?? e];
323
+ }
324
+ let i = R(t), a = R(n), o = Be(t, a), s = Be(n, i);
325
+ return (a.x - i.x) * (s.x - o.x) + (a.y - i.y) * (s.y - o.y) <= 0 ? [i, a] : [o, s];
326
+ }
327
+ function He(e) {
328
+ let [t, n] = Ve(e);
329
+ return {
330
+ x: (t.x + n.x) / 2,
331
+ y: (t.y + n.y) / 2 - 5
332
+ };
333
+ }
334
+ function Ue(e) {
335
+ if (e.eventStormingType !== "hotspot") return {
336
+ x: e.x,
337
+ y: e.y,
338
+ width: e.width,
339
+ height: e.height
340
+ };
341
+ 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 = R(e);
342
+ return {
343
+ x: i.x - n / 2,
344
+ y: i.y - r / 2,
345
+ width: n,
346
+ height: r
347
+ };
348
+ }
349
+ function We(e) {
350
+ if (!e.linkLabel) return;
351
+ let t = He(e), { advance: n, left: r, right: i, ascent: a, descent: o } = Ye(e.linkLabel);
352
+ return {
353
+ x: t.x - n / 2 + r,
354
+ y: t.y - a,
355
+ width: i - r,
356
+ height: a + o
357
+ };
358
+ }
359
+ var Ge;
360
+ function Ke() {
361
+ return Ge ??= typeof document < "u" && typeof CanvasRenderingContext2D < "u" ? document.createElement("canvas").getContext("2d") : null, Ge;
362
+ }
363
+ function qe(e) {
364
+ if (e.length === 0 || typeof document > "u" || !("fonts" in document)) return;
365
+ let t = e.join(" ");
366
+ if (!document.fonts.check(ze, t)) return document.fonts.load(ze, t).then(() => void 0, () => void 0);
367
+ }
368
+ function Je(e) {
369
+ return e.replace(/[ \t\n\r]+/g, " ").replace(/^ | $/g, "");
370
+ }
371
+ function Ye(e) {
372
+ let t = Je(e), n = Ke();
373
+ if (!n) {
374
+ let e = t.length * 11 * (M / L.label);
375
+ return {
376
+ advance: e,
377
+ left: 0,
378
+ right: e,
379
+ ascent: 11,
380
+ descent: 11 / 4
381
+ };
382
+ }
383
+ n.font = ze, n.textRendering = Re;
384
+ let r = n.measureText(t);
385
+ return {
386
+ advance: r.width,
387
+ left: Math.min(0, -r.actualBoundingBoxLeft),
388
+ right: Math.max(r.width, r.actualBoundingBoxRight),
389
+ ascent: r.fontBoundingBoxAscent,
390
+ descent: r.fontBoundingBoxDescent
391
+ };
392
+ }
393
+ // src/draw/palette-icons.ts
394
+ var Xe = (e) => `<svg width="24" height="24" viewBox="0 0 24 24" class="event-storming-palette-svg">${e}</svg>`, Ze = (e, t, n = 0) => Xe(`<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>`, z = {
395
+ 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\"/>"),
396
+ 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\"/>"),
397
+ note: Ze(O.fill, O.stroke)
295
398
  };
296
399
  for (let e of x) {
297
- let t = A[e];
298
- R[e] = Le(t.fill, t.stroke, e === "hotspot" ? -6 : 0);
400
+ let t = D[e];
401
+ z[e] = Ze(t.fill, t.stroke, e === "hotspot" ? -6 : 0);
299
402
  }
300
- function ze(e, t) {
403
+ function $e(e, t) {
301
404
  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
405
  }
303
- //#endregion
304
- //#region src/palette/EventStormingPaletteProvider.ts
305
- function z(e) {
406
+ // src/keyboard/canvas-focus.ts
407
+ function et(e) {
408
+ return e.getContainer().querySelector(":scope > svg");
409
+ }
410
+ function B(e) {
411
+ let t = et(e);
412
+ t ? t.focus({
413
+ preventScroll: !0,
414
+ focusVisible: !1
415
+ }) : e.focus();
416
+ }
417
+ // src/keyboard/key-scope.ts
418
+ var tt = "input, textarea, select, [contenteditable]:not([contenteditable='false'])";
419
+ function nt(e) {
420
+ return typeof e.key == "string" && !e.defaultPrevented && !e.isComposing;
421
+ }
422
+ function rt(e, t) {
423
+ let n = et(t);
424
+ return n !== null && e.target instanceof Node && n.contains(e.target);
425
+ }
426
+ function it(e) {
427
+ return e instanceof Element ? e.isContentEditable || e.editContext ? !0 : e.closest(tt) !== null : !1;
428
+ }
429
+ // src/keyboard/EventStormingKeyboard.ts
430
+ var at = 2, ot = 10, st = {
431
+ arrowleft: {
432
+ x: -1,
433
+ y: 0
434
+ },
435
+ arrowright: {
436
+ x: 1,
437
+ y: 0
438
+ },
439
+ arrowup: {
440
+ x: 0,
441
+ y: -1
442
+ },
443
+ arrowdown: {
444
+ x: 0,
445
+ y: 1
446
+ }
447
+ }, ct = {
448
+ __init__: ["eventStormingKeyboard"],
449
+ eventStormingKeyboard: ["type", class {
450
+ static $inject = [
451
+ "config.eventStormingKeyboard",
452
+ "canvas",
453
+ "commandStack",
454
+ "selection",
455
+ "modeling",
456
+ "eventStormingCopyPaste",
457
+ "eventStormingElementFactory",
458
+ "create",
459
+ "mouse",
460
+ "lassoTool",
461
+ "eventBus",
462
+ "elementRegistry",
463
+ "eventStormingReadOnly"
464
+ ];
465
+ constructor(e, t, n, r, i, a, o, s, c, l, u, d, f) {
466
+ let p = e?.undoRedoKeys ?? !0, m = (e) => {
467
+ nt(e) && rt(e, t) && (h(e) || f?.isReadOnly() || g(e));
468
+ }, h = (e) => {
469
+ let t = e.ctrlKey || e.metaKey, n = e.key.toLowerCase();
470
+ if (t && n === "a" && !e.shiftKey && !e.altKey) {
471
+ e.preventDefault();
472
+ let t = (d?.getAll() ?? []).filter((e) => y(e) || b(e));
473
+ r.select(t);
474
+ } else if (t && n === "c") a.copy() && e.preventDefault();
475
+ else if (!t && !e.altKey && n === "l") {
476
+ e.preventDefault();
477
+ let t = c.getLastMoveEvent();
478
+ l.activateSelection(t ?? e, !!t);
479
+ } else return !1;
480
+ return !0;
481
+ }, g = (e) => {
482
+ let t = e.ctrlKey || e.metaKey, l = e.key.toLowerCase(), u = t && l === "z" && !e.shiftKey, d = t && l === "z" && e.shiftKey || t && l === "y";
483
+ if (u || d) {
484
+ if (!p) return;
485
+ e.preventDefault(), u ? n.undo() : n.redo();
486
+ } else if (t && l === "v") a.paste() && e.preventDefault();
487
+ else if (t && l === "d") e.preventDefault(), a.duplicate();
488
+ else if (l === "delete" || l === "backspace") {
489
+ let t = r.get();
490
+ t.length && (e.preventDefault(), i.removeElements(t));
491
+ } else if (!t && !e.altKey && (l === "e" || l === "c")) {
492
+ let t = c.getLastMoveEvent();
493
+ if (t) {
494
+ e.preventDefault();
495
+ let n = l === "e" ? o.createNew("event", D.event.label) : o.createNew("command", D.command.label);
496
+ s.start(t, n);
497
+ }
498
+ } else if (l in st && !t) {
499
+ let t = r.get();
500
+ if (t.length) {
501
+ e.preventDefault();
502
+ let n = e.shiftKey ? ot : at, r = st[l];
503
+ i.moveElements(t, {
504
+ x: r.x * n,
505
+ y: r.y * n
506
+ });
507
+ }
508
+ }
509
+ };
510
+ document.addEventListener("keydown", m), u.on("diagram.destroy", () => document.removeEventListener("keydown", m));
511
+ }
512
+ }]
513
+ };
514
+ // src/palette/EventStormingPaletteProvider.ts
515
+ function V(e) {
306
516
  if (e.freeArea) return e.freeArea;
307
517
  let t = e.freeRectInsets;
308
518
  return t ? { insets: t } : void 0;
309
519
  }
310
- var Be = 24, B = "stickies-1", V = "stickies-2", Ve = "stickies-3", He = [
520
+ var lt = 24, H = "stickies-1", U = "stickies-2", ut = "stickies-3", dt = [
311
521
  {
312
522
  key: "event",
313
523
  type: "event",
314
- label: A.event.label,
524
+ label: D.event.label,
315
525
  title: "Domain event",
316
526
  shortcut: "E",
317
- group: B
527
+ group: H
318
528
  },
319
529
  {
320
530
  key: "command",
321
531
  type: "command",
322
- label: A.command.label,
532
+ label: D.command.label,
323
533
  title: "Command",
324
534
  shortcut: "C",
325
- group: B
535
+ group: H
326
536
  },
327
537
  {
328
538
  key: "actor",
329
539
  type: "actor",
330
- label: A.actor.label,
540
+ label: D.actor.label,
331
541
  title: "Actor",
332
- group: B
542
+ group: H
333
543
  },
334
544
  {
335
545
  key: "aggregate",
336
546
  type: "aggregate",
337
- label: A.aggregate.label,
547
+ label: D.aggregate.label,
338
548
  title: "Aggregate",
339
- group: B
549
+ group: H
340
550
  },
341
551
  {
342
552
  key: "policy",
343
553
  type: "policy",
344
- label: A.policy.label,
554
+ label: D.policy.label,
345
555
  title: "Policy",
346
- group: V
556
+ group: U
347
557
  },
348
558
  {
349
559
  key: "readmodel",
350
560
  type: "readmodel",
351
- label: A.readmodel.label,
561
+ label: D.readmodel.label,
352
562
  title: "Read model",
353
- group: V
563
+ group: U
354
564
  },
355
565
  {
356
566
  key: "external",
357
567
  type: "external",
358
- label: A.external.label,
568
+ label: D.external.label,
359
569
  title: "External system",
360
- group: V
570
+ group: U
361
571
  },
362
572
  {
363
573
  key: "hotspot",
364
574
  type: "hotspot",
365
- label: A.hotspot.label,
575
+ label: D.hotspot.label,
366
576
  title: "Hotspot",
367
- group: Ve
577
+ group: ut
368
578
  },
369
579
  {
370
580
  key: "note",
371
581
  type: "note",
372
- label: j.label,
582
+ label: O.label,
373
583
  title: "Note",
374
- group: Ve
584
+ group: ut
375
585
  }
376
- ], Ue = class {
586
+ ], ft = class {
377
587
  create;
378
588
  factory;
379
589
  lassoTool;
@@ -413,26 +623,26 @@ var Be = 24, B = "stickies-1", V = "stickies-2", Ve = "stickies-3", He = [
413
623
  group: "tools",
414
624
  title: "Lasso",
415
625
  shortcut: "L",
416
- html: `<div class="entry event-storming-palette-entry">${R.lasso}</div>`,
417
- action: { click: (e) => this.lassoTool.activateSelection(e) }
626
+ html: `<div class="entry event-storming-palette-entry">${z.lasso}</div>`,
627
+ action: { click: this.focusingCanvas((e) => this.lassoTool.activateSelection(e)) }
418
628
  }, e["draw-tool"] = {
419
629
  group: "tools",
420
630
  title: "Draw",
421
- html: `<div class="entry event-storming-palette-entry">${R.draw}</div>`,
422
- action: { click: () => this.drawTool.toggle() }
631
+ html: `<div class="entry event-storming-palette-entry">${z.draw}</div>`,
632
+ action: { click: this.focusingCanvas(() => this.drawTool.toggle()) }
423
633
  };
424
634
  let t = o[this.eventStormingModeling.getLevel()];
425
- for (let n of He) {
635
+ for (let n of dt) {
426
636
  if (n.type !== "note" && !t.includes(n.type)) continue;
427
- let r = (e) => {
637
+ let r = this.focusingCanvas((e) => {
428
638
  let t = this.factory.createNew(n.type, n.label);
429
- We(e) && this.placeInFreeRect(t) || this.create.start(e, t);
430
- };
639
+ pt(e) && this.placeInFreeRect(t) || this.create.start(e, t);
640
+ });
431
641
  e[`create.${n.key}`] = {
432
642
  group: n.group,
433
643
  title: n.title,
434
644
  ...n.shortcut ? { shortcut: n.shortcut } : {},
435
- html: `<div class="entry event-storming-palette-entry" draggable="true">${R[n.key]}</div>`,
645
+ html: `<div class="entry event-storming-palette-entry" draggable="true">${z[n.key]}</div>`,
436
646
  action: {
437
647
  dragstart: r,
438
648
  click: r
@@ -441,16 +651,21 @@ var Be = 24, B = "stickies-1", V = "stickies-2", Ve = "stickies-3", He = [
441
651
  }
442
652
  return e;
443
653
  }
654
+ focusingCanvas(e) {
655
+ return (t) => {
656
+ e(t), this.canvas && !pt(t) && B(this.canvas);
657
+ };
658
+ }
444
659
  placeInFreeRect(e) {
445
660
  let { canvas: t, modeling: n, selection: r, elementRegistry: i } = this;
446
661
  if (!t || !n || !r || !i) return !1;
447
662
  let a = this.freeAreaCentre(t), o = (e) => i.filter(y).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;
663
+ for (; o(a);) a.x += lt, a.y += lt;
449
664
  let s = n.createShape(e, a, t.getRootElement());
450
665
  return r.select(s), t.focus(), this.labelEditing?.activate(s), !0;
451
666
  }
452
667
  freeAreaCentre(e) {
453
- let t = this.config && z(this.config), n = t?.center?.();
668
+ let t = this.config && V(this.config), n = t?.center?.();
454
669
  if (n) return {
455
670
  x: n.x,
456
671
  y: n.y
@@ -467,27 +682,30 @@ var Be = 24, B = "stickies-1", V = "stickies-2", Ve = "stickies-3", He = [
467
682
  };
468
683
  }
469
684
  };
470
- function We(e) {
685
+ function pt(e) {
471
686
  return e.type === "click" && e.detail === 0;
472
687
  }
473
- //#endregion
474
- //#region src/EventStormingBaseViewer.ts
475
- function Ge(e) {
688
+ // src/EventStormingBaseViewer.ts
689
+ function mt(e) {
476
690
  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
691
  }
478
- function Ke(e) {
692
+ function ht(e) {
693
+ return e.edges.flatMap((e) => e.label ? [e.label] : []);
694
+ }
695
+ function gt(e) {
479
696
  return typeof e == "number" ? `${e}px` : e;
480
697
  }
481
- var qe = class {
698
+ var _t = class {
482
699
  _diagram;
483
700
  _container;
484
701
  _options;
702
+ _waitingImport;
485
703
  constructor(e = {}) {
486
704
  this._options = e, this._container = this._createContainer(e);
487
705
  }
488
706
  _createContainer(e) {
489
707
  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;
708
+ return t.classList.add("event-storming-container"), t.style.width = gt(e.width ?? "100%"), t.style.height = gt(e.height ?? (e.container ? "100%" : "600px")), t;
491
709
  }
492
710
  _ensureDiagram() {
493
711
  if (!this._diagram) {
@@ -496,7 +714,7 @@ var qe = class {
496
714
  canvas: { container: this._container },
497
715
  modules: t,
498
716
  eventStormingKeyboard: { undoRedoKeys: this._options.undoRedoKeys ?? !0 },
499
- eventStormingPalette: { freeArea: z(this._options) },
717
+ eventStormingPalette: { freeArea: V(this._options) },
500
718
  eventStormingImporter: { fitOnImport: this._options.fitOnImport ?? !0 }
501
719
  });
502
720
  }
@@ -513,11 +731,19 @@ var qe = class {
513
731
  }
514
732
  async importMap(e) {
515
733
  let t = this._ensureDiagram(), n = t.get("eventBus"), r = t.get("eventStormingImporter");
516
- Ge(e), s(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 };
734
+ mt(e), s(e);
735
+ let i = this._importTurn(e);
736
+ if (i && (await i, this._waitingImport === i && (this._waitingImport = void 0), this._diagram !== t)) throw Error("The viewer was destroyed during the import.");
737
+ let a = t.get("eventStormingLabelEditing", !1);
738
+ a?.suspend(), t.get("popupMenu", !1)?.close(), r.clear();
739
+ let o = r.import(e);
740
+ return t.get("commandStack", !1)?.clear(!1), n.fire("import.done", { warnings: o }), a?.resumeAfterImport(), { warnings: o };
741
+ }
742
+ _importTurn(e) {
743
+ let t = [this._waitingImport, qe(ht(e))].filter((e) => e !== void 0);
744
+ if (t.length === 0) return;
745
+ let n = Promise.all(t);
746
+ return this._waitingImport = n, n;
521
747
  }
522
748
  async importDSL(e) {
523
749
  let t = this._ensureDiagram().get("eventBus");
@@ -540,6 +766,11 @@ var qe = class {
540
766
  exportDSL() {
541
767
  return u(this.exportMap());
542
768
  }
769
+ contentBounds() {
770
+ if (!this._diagram) return;
771
+ let e = this._diagram.get("boardBounds");
772
+ return e.isEmpty() ? void 0 : e.contentBounds(0);
773
+ }
543
774
  async saveSVG() {
544
775
  return we(this.get("canvas"), this.get("boardBounds").contentBounds());
545
776
  }
@@ -558,15 +789,14 @@ var qe = class {
558
789
  get container() {
559
790
  return this._container;
560
791
  }
561
- }, Je = "0123456789abcdefghijklmnopqrstuvwxyz", Ye = 252;
562
- function Xe() {
792
+ }, vt = "0123456789abcdefghijklmnopqrstuvwxyz", yt = 252;
793
+ function bt() {
563
794
  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]);
795
+ for (; e.length < 8;) for (let t of globalThis.crypto.getRandomValues(/* @__PURE__ */ new Uint8Array(8))) t >= yt || e.length === 8 || (e += vt[t % 36]);
565
796
  return e;
566
797
  }
567
- //#endregion
568
- //#region src/model/EventStormingElementFactory.ts
569
- var Ze = {
798
+ // src/model/EventStormingElementFactory.ts
799
+ var xt = {
570
800
  event: "event",
571
801
  command: "cmd",
572
802
  actor: "actor",
@@ -577,7 +807,7 @@ var Ze = {
577
807
  hotspot: "hot",
578
808
  note: "note",
579
809
  drawing: "draw"
580
- }, Qe = class {
810
+ }, St = class {
581
811
  elementFactory;
582
812
  elementRegistry;
583
813
  static $inject = ["elementFactory", "elementRegistry"];
@@ -596,15 +826,15 @@ var Ze = {
596
826
  return `${e} ${n}`;
597
827
  }
598
828
  allocateId(e, t) {
599
- let n = Ze[e];
829
+ let n = xt[e];
600
830
  for (;;) {
601
- let e = `${n}_${Xe()}`;
831
+ let e = `${n}_${bt()}`;
602
832
  if (!this.elementRegistry.get(e) && !t?.has(e)) return e;
603
833
  }
604
834
  }
605
835
  createSticky(e) {
606
836
  if (!S(e.elementType)) throw Error(`not a sticky kind: ${e.elementType}`);
607
- let { width: t, height: n } = A[e.elementType];
837
+ let { width: t, height: n } = D[e.elementType];
608
838
  return this.elementFactory.createShape({
609
839
  id: e.id,
610
840
  x: e.position.x - t / 2,
@@ -663,7 +893,7 @@ var Ze = {
663
893
  });
664
894
  }
665
895
  createNew(e, t) {
666
- let n = this.uniqueLabel(t), { width: r, height: i } = S(e) ? A[e] : N(n);
896
+ let n = this.uniqueLabel(t), { width: r, height: i } = S(e) ? D[e] : N(n);
667
897
  return this.elementFactory.createShape({
668
898
  id: this.allocateId(e),
669
899
  width: r,
@@ -673,7 +903,7 @@ var Ze = {
673
903
  });
674
904
  }
675
905
  createProvisional() {
676
- let { width: e, height: t } = A.event;
906
+ let { width: e, height: t } = D.event;
677
907
  return this.elementFactory.createShape({
678
908
  id: this.allocateId("event"),
679
909
  width: e,
@@ -688,101 +918,125 @@ var Ze = {
688
918
  id: e.id,
689
919
  source: t,
690
920
  target: n,
691
- waypoints: [$e(t), $e(n)],
921
+ waypoints: [Ct(t), Ct(n)],
692
922
  eventStormingType: "arrow",
693
923
  ...e.label ? { linkLabel: e.label } : {},
694
924
  businessObject: e
695
925
  });
696
926
  }
697
927
  };
698
- function $e(e) {
928
+ function Ct(e) {
699
929
  return {
700
930
  x: e.x + e.width / 2,
701
931
  y: e.y + e.height / 2
702
932
  };
703
933
  }
704
- //#endregion
705
- //#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";
934
+ // src/model/index.ts
935
+ var wt = { eventStormingElementFactory: ["type", St] }, Tt = /^#(?:[0-9a-f]{3,4}|[0-9a-f]{6}|[0-9a-f]{8})$/i, Et = /^rgba?\(\s*(\d+),\s*(\d+),\s*(\d+)(?:,\s*([\d.]+))?\s*\)$/;
936
+ function W(e) {
937
+ if (!Tt.test(e)) return;
938
+ let t = e.length <= 5 ? [...e.slice(1)].map((e) => e + e).join("") : e.slice(1), n = (e) => parseInt(t.slice(e * 2, e * 2 + 2), 16);
939
+ return [
940
+ n(0),
941
+ n(1),
942
+ n(2),
943
+ t.length === 8 ? n(3) / 255 : 1
944
+ ];
711
945
  }
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
- ...i
724
- };
725
- 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));
726
- return {
727
- x: n - e,
728
- y: r - e,
729
- width: a - n + 2 * e,
730
- height: o - 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(C);
754
- t.length && this.eventBus.fire("elements.changed", { elements: t });
946
+ var Dt;
947
+ function Ot() {
948
+ return Dt ??= typeof document < "u" && typeof CanvasRenderingContext2D < "u" ? Object.assign(document.createElement("canvas"), {
949
+ width: 1,
950
+ height: 1
951
+ }).getContext("2d", { willReadFrequently: !0 }) : null, Dt;
952
+ }
953
+ function kt(e, t) {
954
+ e.fillStyle = T.grau, e.fillRect(0, 0, 1, 1), e.fillStyle = t, e.fillRect(0, 0, 1, 1);
955
+ let { data: n } = e.getImageData(0, 0, 1, 1);
956
+ return [
957
+ n[0],
958
+ n[1],
959
+ n[2],
960
+ 1
961
+ ];
962
+ }
963
+ function At(e) {
964
+ let t = Ot();
965
+ if (!t) return;
966
+ t.fillStyle = T.schwarz, t.fillStyle = e;
967
+ let n = String(t.fillStyle);
968
+ if (t.fillStyle = T.weiss, t.fillStyle = e, String(t.fillStyle) !== n) return;
969
+ let r = Et.exec(n);
970
+ if (r) {
971
+ let [, e, t, n, i] = r;
972
+ return [
973
+ Number(e),
974
+ Number(t),
975
+ Number(n),
976
+ i === void 0 ? 1 : Number(i)
977
+ ];
755
978
  }
756
- }, H = {
757
- __depends__: [d],
758
- eventStormingViewOptions: ["type", at]
759
- }, ot = 1500, st = -3, ct = "event-storming-kind-caption", lt = 9, ut = 300, dt = F.stickyText, ft = 7, pt = "#FBFBFB", mt = "#B9B9B9", ht = "6 4", gt = "event-storming-sticky-shadow";
760
- function _t(e) {
979
+ return W(n) ?? kt(t, e);
980
+ }
981
+ function jt(e) {
982
+ let t = e.trim();
983
+ return W(t) ?? At(t);
984
+ }
985
+ function Mt([e, t, n, r], i) {
986
+ let a = (e, t) => e * r + t * (1 - r);
987
+ return [
988
+ a(e, i[0]),
989
+ a(t, i[1]),
990
+ a(n, i[2]),
991
+ 1
992
+ ];
993
+ }
994
+ function Nt([e, t, n]) {
995
+ let r = (e) => {
996
+ let t = e / 255;
997
+ return t <= .04045 ? t / 12.92 : ((t + .055) / 1.055) ** 2.4;
998
+ };
999
+ return .2126 * r(e) + .7152 * r(t) + .0722 * r(n);
1000
+ }
1001
+ function Pt(e, t) {
1002
+ let [n, r] = [Nt(e), Nt(t)].sort((e, t) => t - e);
1003
+ return (n + .05) / (r + .05);
1004
+ }
1005
+ var Ft = W(T.grau), It = W(T.schwarz), Lt = W(T.weiss);
1006
+ function Rt(e) {
1007
+ let t = jt(e);
1008
+ if (!t) return T.schwarz;
1009
+ let n = Mt(t, Ft);
1010
+ return Pt(n, Lt) > Pt(n, It) ? T.weiss : T.schwarz;
1011
+ }
1012
+ // src/draw/EventStormingRenderer.ts
1013
+ var zt = 1500, Bt = "event-storming-kind-caption", Vt = 9, Ht = 300, Ut = 7, Wt = "event-storming-sticky-shadow";
1014
+ function Gt(e) {
761
1015
  let t = e.closest("svg");
762
1016
  if (!t) return !1;
763
1017
  if (t.querySelector("#event-storming-sticky-shadow")) return !0;
764
- let n = m(h("feDropShadow"), {
1018
+ let n = p(m("feDropShadow"), {
765
1019
  dx: 0,
766
- dy: 5,
767
- stdDeviation: 5,
768
- "flood-color": "#000000",
769
- "flood-opacity": .2
770
- }), r = m(h("filter"), {
771
- id: gt,
1020
+ dy: A.dy,
1021
+ stdDeviation: A.blur,
1022
+ "flood-color": A.color,
1023
+ "flood-opacity": A.opacity
1024
+ }), r = p(m("filter"), {
1025
+ id: Wt,
772
1026
  x: "-40%",
773
1027
  y: "-40%",
774
1028
  width: "180%",
775
1029
  height: "180%"
776
1030
  });
777
- p(r, n);
778
- let i = h("defs");
779
- return p(i, r), t.insertBefore(i, t.firstChild), !0;
1031
+ f(r, n);
1032
+ let i = m("defs");
1033
+ return f(i, r), t.insertBefore(i, t.firstChild), !0;
780
1034
  }
781
- var vt = class extends f {
1035
+ var Kt = class extends d {
782
1036
  viewOptions;
783
1037
  static $inject = ["eventBus", "eventStormingViewOptions"];
784
1038
  constructor(e, t) {
785
- super(e, ot), this.viewOptions = t;
1039
+ super(e, zt), this.viewOptions = t;
786
1040
  }
787
1041
  canRender(e) {
788
1042
  return y(e) || b(e);
@@ -792,7 +1046,7 @@ var vt = class extends f {
792
1046
  return n.eventStormingType === "drawing" ? this.drawDrawing(e, n) : this.drawSticky(e, n);
793
1047
  }
794
1048
  drawDrawing(e, t) {
795
- let n = t.drawingPoints ?? [], r = t.strokeStyle === "dashed" ? "8 5" : t.strokeStyle === "dotted" ? "2 4" : void 0, i = m(h(t.closed ? "polygon" : "polyline"), {
1049
+ 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
1050
  points: n.map((e) => `${e.x},${e.y}`).join(" "),
797
1051
  fill: "none",
798
1052
  stroke: t.color ?? I,
@@ -801,50 +1055,52 @@ var vt = class extends f {
801
1055
  "stroke-linejoin": "round",
802
1056
  ...r ? { "stroke-dasharray": r } : {}
803
1057
  });
804
- return p(e, i), i;
1058
+ return f(e, i), i;
805
1059
  }
806
1060
  drawSticky(e, t) {
807
- let n = t.eventStormingType, r = S(n) ? A[n] : j, i = t.provisional === !0, a = e;
1061
+ let n = t.eventStormingType, r = S(n) ? D[n] : O, i = t.provisional === !0, a = e;
808
1062
  if (n === "hotspot") {
809
- let n = m(h("g"), { transform: `rotate(${st} ${t.width / 2} ${t.height / 2})` });
810
- p(e, n), a = n;
1063
+ let n = p(m("g"), { transform: `rotate(-3 ${t.width / 2} ${t.height / 2})` });
1064
+ f(e, n), a = n;
811
1065
  }
812
- let o = m(h("rect"), {
1066
+ let o = t.color ?? r.fill, s = p(m("rect"), {
813
1067
  x: 0,
814
1068
  y: 0,
815
1069
  width: Math.max(t.width, 1),
816
1070
  height: Math.max(t.height, 1),
817
1071
  rx: 0,
818
- fill: i ? pt : t.color ?? r.fill,
819
- stroke: i ? mt : r.stroke,
1072
+ fill: i ? k.fill : o,
1073
+ stroke: i ? k.stroke : r.stroke,
820
1074
  "stroke-width": 1.5,
821
- ...i ? { "stroke-dasharray": ht } : {}
1075
+ ...i ? { "stroke-dasharray": k.dash } : {}
822
1076
  });
823
- if (_t(e) && o.setAttribute("filter", `url(#${gt})`), p(a, o), i) return o;
824
- if (n === "note" ? Ct(a, t) : bt(a, t), S(n) && this.viewOptions.typeCaptionsVisible()) {
825
- let e = U(A[n].label, t.width / 2, t.height - ft, {
1077
+ if (Gt(e) && s.setAttribute("filter", `url(#${Wt})`), f(a, s), i) return s;
1078
+ let c = Rt(o);
1079
+ if (n === "note" ? Zt(a, t, c) : Jt(a, t, c), S(n) && this.viewOptions.typeCaptionsVisible()) {
1080
+ let e = nn(D[n].label, t.width / 2, t.height - Ut, {
826
1081
  "text-anchor": "middle",
827
- "font-size": lt,
828
- fill: dt
1082
+ "font-size": Vt,
1083
+ fill: c
829
1084
  });
830
- e.setAttribute("class", ct), e.setAttribute("font-weight", String(ut)), p(a, e);
1085
+ e.setAttribute("class", Bt), e.setAttribute("font-weight", String(Ht)), f(a, e);
831
1086
  }
832
- return o;
1087
+ return s;
833
1088
  }
834
1089
  drawConnection(e, t) {
835
- let n = t, [r, i] = At(n), a = m(h("polyline"), {
1090
+ let n = t, [r, i] = Ve(n), a = p(m("polyline"), {
836
1091
  points: `${r.x},${r.y} ${i.x},${i.y}`,
837
1092
  fill: "none",
838
1093
  stroke: F.arrow,
839
1094
  "stroke-width": 1.5,
840
1095
  "stroke-linecap": "round"
841
1096
  });
842
- if (p(e, a), p(e, Ot(r, i, F.arrow, 11, 5)), n.linkLabel) {
843
- let t = (r.x + i.x) / 2, a = (r.y + i.y) / 2;
844
- p(e, U(n.linkLabel, t, a - 5, {
1097
+ if (f(e, a), f(e, rn(r, i, F.arrow, 11, 5)), n.linkLabel) {
1098
+ let t = He(n);
1099
+ f(e, nn(n.linkLabel, t.x, t.y, {
845
1100
  "text-anchor": "middle",
846
1101
  "font-size": 11,
847
1102
  "font-style": "italic",
1103
+ "text-rendering": Re,
848
1104
  fill: F.inkSoft
849
1105
  }));
850
1106
  }
@@ -859,7 +1115,7 @@ var vt = class extends f {
859
1115
  return t ? `M${t.x},${t.y}` + n.map((e) => `L${e.x},${e.y}`).join("") : "";
860
1116
  }
861
1117
  };
862
- function yt(e, t) {
1118
+ function qt(e, t) {
863
1119
  let n = e.split(/\s+/).filter((e) => e.length);
864
1120
  if (!n.length) return [""];
865
1121
  let r = [], i = "";
@@ -876,51 +1132,51 @@ function yt(e, t) {
876
1132
  }
877
1133
  return r.push(i), r;
878
1134
  }
879
- function bt(e, t) {
880
- let n = t.width - 16, r = Math.max(1, Math.floor(n / M)), 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;
881
- a.forEach((t, n) => {
882
- p(e, U(t, o, s + n * 17, {
1135
+ function Jt(e, t, n) {
1136
+ let r = t.width - 16, i = Math.max(1, Math.floor(r / M)), a = Math.max(1, Math.floor((t.height - 16) / 17)), o = (t.eventStormingLabel ?? "").split("\n").flatMap((e) => qt(e, i)).slice(0, a), s = t.width / 2, c = t.height / 2 - (o.length - 1) * 17 / 2 + 4;
1137
+ o.forEach((t, r) => {
1138
+ f(e, nn(t, s, c + r * 17, {
883
1139
  "text-anchor": "middle",
884
- fill: F.stickyText
1140
+ fill: n
885
1141
  }));
886
1142
  });
887
1143
  }
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 / M)), i = Math.max(1, Math.floor((t.height - 16) / 17)), a = k(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;
891
- a.forEach((n, r) => {
892
- let i = o === "left" ? 8 + (n.indent ? 12 : 0) : o === "center" ? t.width / 2 : t.width - 8, a = m(h("text"), {
893
- x: i,
894
- y: u + r * 17 + St,
1144
+ var Yt = 2, Xt = 12.5;
1145
+ function Zt(e, t, n) {
1146
+ let r = t.width - 16, i = Math.max(1, Math.floor(r / M)), a = Math.max(1, Math.floor((t.height - 16) / 17)), o = E(t.eventStormingLabel ?? "").flatMap((e) => Qt(e, i)).slice(0, a), s = t.alignHorizontal ?? "left", c = t.alignVertical ?? "top", l = s === "left" ? "start" : s === "center" ? "middle" : "end", u = o.length * 17, d = c === "top" ? 8 : c === "middle" ? (t.height - u) / 2 : t.height - 8 - u;
1147
+ o.forEach((r, i) => {
1148
+ let a = s === "left" ? 8 + (r.indent ? 12 : 0) : s === "center" ? t.width / 2 : t.width - 8, o = p(m("text"), {
1149
+ x: a,
1150
+ y: d + i * 17 + Xt,
895
1151
  "font-family": L.family,
896
1152
  "font-size": L.label,
897
- fill: F.stickyText,
898
- "text-anchor": c
899
- }), s = n.marker ? [{
1153
+ fill: n,
1154
+ "text-anchor": l
1155
+ }), c = r.marker ? [{
900
1156
  text: "• ",
901
1157
  bold: !1,
902
1158
  italic: !1
903
- }, ...n.runs] : n.runs;
904
- for (let e of s) {
905
- let t = h("tspan");
906
- t.textContent = e.text, e.bold && t.setAttribute("font-weight", "600"), e.italic && t.setAttribute("font-style", "italic"), p(a, t);
1159
+ }, ...r.runs] : r.runs;
1160
+ for (let e of c) {
1161
+ let t = m("tspan");
1162
+ t.textContent = e.text, e.bold && t.setAttribute("font-weight", "600"), e.italic && t.setAttribute("font-style", "italic"), f(o, t);
907
1163
  }
908
- p(e, a);
1164
+ f(e, o);
909
1165
  });
910
1166
  }
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) => ({
1167
+ function Qt(e, t) {
1168
+ let n = Math.max(1, t - (e.bullet ? Yt : 0));
1169
+ return $t(e.runs, n).map((t, n) => ({
914
1170
  runs: t,
915
1171
  marker: e.bullet && n === 0,
916
1172
  indent: e.bullet && n > 0
917
1173
  }));
918
1174
  }
919
- function Tt(e, t) {
1175
+ function $t(e, t) {
920
1176
  let n = e.map((e) => e.text).join("");
921
- return n.length <= t ? [e] : Et(n, t).map(([t, n]) => Dt(e, t, n));
1177
+ return n.length <= t ? [e] : en(n, t).map(([t, n]) => tn(e, t, n));
922
1178
  }
923
- function Et(e, t) {
1179
+ function en(e, t) {
924
1180
  let n = [...e.matchAll(/\S+/g)];
925
1181
  if (!n.length) return [[0, 0]];
926
1182
  let r = [], i = -1, a = -1, o = () => {
@@ -935,7 +1191,7 @@ function Et(e, t) {
935
1191
  }
936
1192
  return o(), r;
937
1193
  }
938
- function Dt(e, t, n) {
1194
+ function tn(e, t, n) {
939
1195
  let r = [], i = 0;
940
1196
  for (let a of e) {
941
1197
  let e = i;
@@ -949,8 +1205,8 @@ function Dt(e, t, n) {
949
1205
  }
950
1206
  return r;
951
1207
  }
952
- function U(e, t, n, r = {}) {
953
- let i = m(h("text"), {
1208
+ function nn(e, t, n, r = {}) {
1209
+ let i = p(m("text"), {
954
1210
  x: t,
955
1211
  y: n,
956
1212
  "font-family": L.family,
@@ -960,47 +1216,80 @@ function U(e, t, n, r = {}) {
960
1216
  });
961
1217
  return i.textContent = e, i;
962
1218
  }
963
- function Ot(e, t, n, r = 10, i = 5) {
1219
+ function rn(e, t, n, r = 10, i = 5) {
964
1220
  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
- return m(h("polygon"), {
1221
+ return p(m("polygon"), {
966
1222
  points: c,
967
1223
  fill: n
968
1224
  });
969
1225
  }
970
- function W(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 = W(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
- };
1226
+ // src/view-options/EventStormingViewOptions.ts
1227
+ var an = "eventStorming.viewOptions.changed", on = class {
1228
+ eventBus;
1229
+ elementRegistry;
1230
+ static $inject = ["eventBus", "elementRegistry"];
1231
+ _typeCaptionsVisible = !0;
1232
+ constructor(e, t) {
1233
+ this.eventBus = e, this.elementRegistry = t;
1234
+ }
1235
+ typeCaptionsVisible() {
1236
+ return this._typeCaptionsVisible;
1237
+ }
1238
+ setTypeCaptionsVisible(e) {
1239
+ if (e === this._typeCaptionsVisible) return;
1240
+ this._typeCaptionsVisible = e, this.eventBus.fire(an, { typeCaptionsVisible: e });
1241
+ let t = this.elementRegistry.filter(C);
1242
+ t.length && this.eventBus.fire("elements.changed", { elements: t });
1243
+ }
1244
+ }, sn = {
1245
+ __depends__: [g],
1246
+ eventStormingViewOptions: ["type", on]
1247
+ }, cn = {
1248
+ __depends__: [sn],
1249
+ __init__: ["eventStormingRenderer"],
1250
+ eventStormingRenderer: ["type", Kt]
1251
+ };
1252
+ // src/board-bounds/BoardBounds.ts
1253
+ function ln(e) {
1254
+ 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
1255
  }
985
- function At(e) {
986
- let t = e.source, n = e.target, r = e.waypoints;
987
- if (!t || !n) {
988
- let e = r[0] ?? {
1256
+ var un = class {
1257
+ elementRegistry;
1258
+ static $inject = ["elementRegistry"];
1259
+ constructor(e) {
1260
+ this.elementRegistry = e;
1261
+ }
1262
+ contentBounds(e = 120) {
1263
+ let t = this.drawnBoxes();
1264
+ if (!t.length) return {
989
1265
  x: 0,
990
- y: 0
1266
+ y: 0,
1267
+ ...i
1268
+ };
1269
+ 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));
1270
+ return {
1271
+ x: n - e,
1272
+ y: r - e,
1273
+ width: a - n + 2 * e,
1274
+ height: o - r + 2 * e
991
1275
  };
992
- return [e, r[r.length - 1] ?? e];
993
1276
  }
994
- let i = W(t), a = W(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__: [H],
1001
- __init__: ["eventStormingRenderer"],
1002
- eventStormingRenderer: ["type", vt]
1003
- }, Mt = { drawing: 0 }, Nt = .001, Pt = class {
1277
+ isEmpty() {
1278
+ return this.positionedShapes().length === 0;
1279
+ }
1280
+ drawnBoxes() {
1281
+ let e = this.positionedShapes().map(Ue);
1282
+ for (let t of this.elementRegistry.getAll()) {
1283
+ if (!b(t)) continue;
1284
+ let n = We(t);
1285
+ n && e.push(n);
1286
+ }
1287
+ return e;
1288
+ }
1289
+ positionedShapes() {
1290
+ return this.elementRegistry.getAll().filter(ln);
1291
+ }
1292
+ }, dn = { boardBounds: ["type", un] }, fn = { drawing: 0 }, pn = .001, mn = class {
1004
1293
  canvas;
1005
1294
  elementFactory;
1006
1295
  factory;
@@ -1028,7 +1317,7 @@ var jt = {
1028
1317
  ...e.rawPassthrough ? { rawPassthrough: e.rawPassthrough } : {}
1029
1318
  }, r = this.boardRoot();
1030
1319
  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");
1320
+ let i = /* @__PURE__ */ new Map(), a = [...e.elements].sort((e, t) => (fn[e.elementType] ?? 9) - (fn[t.elementType] ?? 9)), o = a.filter((e) => e.elementType === "drawing"), s = a.filter((e) => e.elementType !== "drawing");
1032
1321
  for (let e of o) {
1033
1322
  let t = this.createShape(e);
1034
1323
  this.canvas.addShape(t, r), i.set(e.id, t);
@@ -1041,7 +1330,7 @@ var jt = {
1041
1330
  let n = "attachedTo" in e ? e.attachedTo : void 0;
1042
1331
  if (!n) continue;
1043
1332
  let r = i.get(n);
1044
- !r || !E(r) ? t.push({
1333
+ !r || !ke(r) ? t.push({
1045
1334
  message: `“${e.id}” is pinned to “${n}”, which isn't on the board or can't hold a pin. It stays unpinned.`,
1046
1335
  elementId: e.id
1047
1336
  }) : i.get(e.id).host = r;
@@ -1072,7 +1361,7 @@ var jt = {
1072
1361
  this.canvas.viewbox(e);
1073
1362
  return;
1074
1363
  }
1075
- let r = this.boardBounds.isEmpty() ? 1 : Math.max(Math.min(t / e.width, n / e.height, 1), Nt);
1364
+ let r = this.boardBounds.isEmpty() ? 1 : Math.max(Math.min(t / e.width, n / e.height, 1), pn);
1076
1365
  this.canvas.viewbox({
1077
1366
  x: e.x + e.width / 2 - t / 2 / r,
1078
1367
  y: e.y + e.height / 2 - n / 2 / r,
@@ -1097,7 +1386,7 @@ var jt = {
1097
1386
  } catch {}
1098
1387
  }
1099
1388
  }
1100
- }, Ft = class {
1389
+ }, hn = class {
1101
1390
  elementRegistry;
1102
1391
  static $inject = ["elementRegistry"];
1103
1392
  constructor(e) {
@@ -1147,7 +1436,7 @@ var jt = {
1147
1436
  let t = e.eventStormingType === "note" && P(e.eventStormingLabel, e) ? {
1148
1437
  width: e.width,
1149
1438
  height: e.height
1150
- } : void 0, n = e.eventStormingType === "note" ? It(e) : void 0;
1439
+ } : void 0, n = e.eventStormingType === "note" ? gn(e) : void 0;
1151
1440
  return {
1152
1441
  id: e.id,
1153
1442
  elementType: e.eventStormingType,
@@ -1163,71 +1452,68 @@ var jt = {
1163
1452
  };
1164
1453
  }
1165
1454
  };
1166
- function It(e) {
1455
+ function gn(e) {
1167
1456
  let t = e.alignHorizontal && e.alignHorizontal !== "left" ? e.alignHorizontal : void 0, n = e.alignVertical && e.alignVertical !== "top" ? e.alignVertical : void 0;
1168
1457
  if (t || n) return {
1169
1458
  ...t ? { horizontal: t } : {},
1170
1459
  ...n ? { vertical: n } : {}
1171
1460
  };
1172
1461
  }
1173
- //#endregion
1174
- //#region src/io/warnings.ts
1175
- function Lt(e) {
1462
+ // src/io/warnings.ts
1463
+ function _n(e) {
1176
1464
  return e.source === void 0 ? e.message : `${e.message} (“${e.source}”)`;
1177
1465
  }
1178
- //#endregion
1179
- //#region src/io/index.ts
1180
- var Rt = {
1181
- eventStormingImporter: ["type", Pt],
1182
- eventStormingExporter: ["type", Ft]
1183
- }, zt = class extends qe {
1466
+ // src/io/index.ts
1467
+ var vn = {
1468
+ eventStormingImporter: ["type", mn],
1469
+ eventStormingExporter: ["type", hn]
1470
+ }, yn = class extends _t {
1184
1471
  _getModules() {
1185
1472
  return [
1186
- et,
1187
- rt,
1188
- H,
1189
- jt,
1190
- Rt
1473
+ wt,
1474
+ dn,
1475
+ sn,
1476
+ cn,
1477
+ vn
1191
1478
  ];
1192
1479
  }
1193
- }, Bt = class extends zt {
1480
+ }, bn = class extends yn {
1194
1481
  _getModules() {
1195
1482
  return [
1196
1483
  ...super._getModules(),
1197
- _,
1198
1484
  ee,
1485
+ _,
1199
1486
  te,
1200
1487
  ne
1201
1488
  ];
1202
1489
  }
1203
- }, Vt = class extends pe {
1490
+ }, xn = class extends pe {
1204
1491
  static $inject = ["eventBus", "modeling"];
1205
1492
  constructor(e, t) {
1206
1493
  super(e), this.preExecute("element.updateProperties", (e) => {
1207
1494
  let { element: n, properties: r } = e.context, i = r.eventStormingType;
1208
1495
  if (typeof i != "string") return;
1209
1496
  let a = n;
1210
- if (a.host && !w(i) && t.updateAttachment(a, void 0), a.attachers?.length && !T(i)) for (let e of [...a.attachers]) t.updateAttachment(e, void 0);
1497
+ if (a.host && !Ee(i) && t.updateAttachment(a, void 0), a.attachers?.length && !De(i)) for (let e of [...a.attachers]) t.updateAttachment(e, void 0);
1211
1498
  });
1212
1499
  }
1213
- }, Ht = {
1500
+ }, Sn = {
1214
1501
  __depends__: [fe],
1215
1502
  __init__: ["eventStormingAttachBehavior"],
1216
- eventStormingAttachBehavior: ["type", Vt]
1503
+ eventStormingAttachBehavior: ["type", xn]
1217
1504
  };
1218
- //#endregion
1219
- //#region src/modeling/cmd/UpdatePropertiesHandler.ts
1220
- function Ut(e, t, n) {
1505
+ // src/modeling/cmd/UpdatePropertiesHandler.ts
1506
+ function Cn(e, t, n) {
1221
1507
  n === void 0 ? delete e[t] : e[t] = n;
1222
1508
  }
1223
- var Wt = [
1509
+ var wn = [
1224
1510
  "x",
1225
1511
  "y",
1226
1512
  "width",
1227
1513
  "height"
1228
1514
  ];
1229
- function Gt(e, t) {
1230
- if (!t.some((e) => Wt.includes(e))) return [e];
1515
+ function Tn(e, t) {
1516
+ if (!t.some((e) => wn.includes(e))) return [e];
1231
1517
  let n = e;
1232
1518
  return [
1233
1519
  e,
@@ -1235,18 +1521,18 @@ function Gt(e, t) {
1235
1521
  ...n.outgoing ?? []
1236
1522
  ];
1237
1523
  }
1238
- var Kt = class {
1524
+ var En = class {
1239
1525
  execute(e) {
1240
1526
  let { element: t, properties: n } = e, r = t, i = {};
1241
- for (let e of Object.keys(n)) i[e] = r[e], Ut(r, e, n[e]);
1242
- return e.oldProperties = i, Gt(t, Object.keys(n));
1527
+ for (let e of Object.keys(n)) i[e] = r[e], Cn(r, e, n[e]);
1528
+ return e.oldProperties = i, Tn(t, Object.keys(n));
1243
1529
  }
1244
1530
  revert(e) {
1245
1531
  let { element: t, oldProperties: n } = e, r = t;
1246
- if (n) for (let e of Object.keys(n)) Ut(r, e, n[e]);
1247
- return Gt(t, Object.keys(n ?? {}));
1532
+ if (n) for (let e of Object.keys(n)) Cn(r, e, n[e]);
1533
+ return Tn(t, Object.keys(n ?? {}));
1248
1534
  }
1249
- }, qt = "element.updateProperties", Jt = class {
1535
+ }, Dn = "element.updateProperties", On = class {
1250
1536
  commandStack;
1251
1537
  canvas;
1252
1538
  elementRegistry;
@@ -1256,10 +1542,10 @@ var Kt = class {
1256
1542
  "elementRegistry"
1257
1543
  ];
1258
1544
  constructor(e, t, n) {
1259
- this.commandStack = e, this.canvas = t, this.elementRegistry = n, e.registerHandler(qt, Kt);
1545
+ this.commandStack = e, this.canvas = t, this.elementRegistry = n, e.registerHandler(Dn, En);
1260
1546
  }
1261
1547
  updateProperties(e, t) {
1262
- this.commandStack.execute(qt, {
1548
+ this.commandStack.execute(Dn, {
1263
1549
  element: e,
1264
1550
  properties: t
1265
1551
  });
@@ -1279,7 +1565,7 @@ var Kt = class {
1279
1565
  setStickyKind(e, t) {
1280
1566
  if (!S(e.eventStormingType) || !S(t)) throw Error("setStickyKind: only sticky kinds can be retyped");
1281
1567
  if (e.eventStormingType === t && !e.provisional) return;
1282
- let { width: n, height: r } = A[t], i = e.x + e.width / 2, a = e.y + e.height / 2;
1568
+ let { width: n, height: r } = D[t], i = e.x + e.width / 2, a = e.y + e.height / 2;
1283
1569
  this.updateProperties(e, {
1284
1570
  eventStormingType: t,
1285
1571
  ...e.provisional ? { provisional: void 0 } : {},
@@ -1301,7 +1587,7 @@ var Kt = class {
1301
1587
  setLevel(e) {
1302
1588
  if (this.getLevel() === e) return;
1303
1589
  let t = this.root(), n = t.businessObject ?? { config: { title: "Untitled Board" } };
1304
- this.commandStack.execute(qt, {
1590
+ this.commandStack.execute(Dn, {
1305
1591
  element: t,
1306
1592
  properties: { businessObject: {
1307
1593
  ...n,
@@ -1315,7 +1601,7 @@ var Kt = class {
1315
1601
  root() {
1316
1602
  return this.elementRegistry.get("event-storming-root") ?? this.canvas.getRootElement();
1317
1603
  }
1318
- }, Yt = 24, Xt = [
1604
+ }, kn = 24, An = [
1319
1605
  "eventStormingType",
1320
1606
  "color",
1321
1607
  "drawingPoints",
@@ -1323,8 +1609,8 @@ var Kt = class {
1323
1609
  "strokeStyle",
1324
1610
  "alignHorizontal",
1325
1611
  "alignVertical"
1326
- ], Zt = ["eventStormingType", "linkLabel"];
1327
- function Qt(e, t) {
1612
+ ], jn = ["eventStormingType", "linkLabel"];
1613
+ function Mn(e, t) {
1328
1614
  let n = {};
1329
1615
  for (let r of t) {
1330
1616
  let t = e[r];
@@ -1332,7 +1618,7 @@ function Qt(e, t) {
1332
1618
  }
1333
1619
  return n;
1334
1620
  }
1335
- var $t = class {
1621
+ var Nn = class {
1336
1622
  selection;
1337
1623
  modeling;
1338
1624
  elementFactory;
@@ -1364,14 +1650,14 @@ var $t = class {
1364
1650
  i !== void 0 && a !== void 0 && (r.add(e), n.push({
1365
1651
  sourceIdx: i,
1366
1652
  targetIdx: a,
1367
- props: Qt(e, Zt)
1653
+ props: Mn(e, jn)
1368
1654
  }));
1369
1655
  }
1370
1656
  return this.clipboard = {
1371
1657
  shapes: e.map((e) => {
1372
1658
  let n = e.host ? t.get(e.host) : void 0;
1373
1659
  return {
1374
- props: Qt(e, Xt),
1660
+ props: Mn(e, An),
1375
1661
  x: e.x,
1376
1662
  y: e.y,
1377
1663
  width: e.width,
@@ -1412,40 +1698,39 @@ var $t = class {
1412
1698
  ...structuredClone(e.props),
1413
1699
  source: n[e.sourceIdx],
1414
1700
  target: n[e.targetIdx],
1415
- waypoints: [en(n[e.sourceIdx]), en(n[e.targetIdx])]
1701
+ waypoints: [Pn(n[e.sourceIdx]), Pn(n[e.targetIdx])]
1416
1702
  }))
1417
1703
  };
1418
1704
  }
1419
1705
  insertWithOffset(e) {
1420
1706
  this.pasteCount++;
1421
- let t = Yt * this.pasteCount, n = tn(e.shapes), r = this.modeling.createElements([...e.shapes, ...e.connections], {
1707
+ let t = kn * this.pasteCount, n = Fn(e.shapes), r = this.modeling.createElements([...e.shapes, ...e.connections], {
1422
1708
  x: n.cx + t,
1423
1709
  y: n.cy + t
1424
1710
  }, this.canvas.getRootElement());
1425
1711
  return this.selection.select(r), !0;
1426
1712
  }
1427
1713
  };
1428
- function en(e) {
1714
+ function Pn(e) {
1429
1715
  return {
1430
1716
  x: e.x + e.width / 2,
1431
1717
  y: e.y + e.height / 2
1432
1718
  };
1433
1719
  }
1434
- function tn(e) {
1720
+ function Fn(e) {
1435
1721
  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
1722
  return {
1437
1723
  cx: (t + r) / 2,
1438
1724
  cy: (n + i) / 2
1439
1725
  };
1440
1726
  }
1441
- //#endregion
1442
- //#region src/modeling/index.ts
1443
- var nn = {
1727
+ // src/modeling/index.ts
1728
+ var In = {
1444
1729
  __depends__: [me, ae],
1445
1730
  __init__: ["eventStormingModeling"],
1446
- eventStormingModeling: ["type", Jt],
1447
- eventStormingCopyPaste: ["type", $t]
1448
- }, rn = {
1731
+ eventStormingModeling: ["type", On],
1732
+ eventStormingCopyPaste: ["type", Nn]
1733
+ }, Ln = {
1449
1734
  __depends__: [he],
1450
1735
  __init__: ["eventStormingLassoBehavior"],
1451
1736
  eventStormingLassoBehavior: ["type", class {
@@ -1469,15 +1754,14 @@ var nn = {
1469
1754
  }
1470
1755
  }]
1471
1756
  };
1472
- //#endregion
1473
- //#region src/rules/EventStormingRules.ts
1474
- function an(e, t) {
1757
+ // src/rules/EventStormingRules.ts
1758
+ function Rn(e, t) {
1475
1759
  return (e.outgoing ?? []).some((e) => e.target === t);
1476
1760
  }
1477
- function on(e, t) {
1478
- return e.length !== 1 || !Ee(e[0]) || !E(t) ? !1 : "attach";
1761
+ function zn(e, t) {
1762
+ return e.length !== 1 || !Oe(e[0]) || !ke(t) ? !1 : "attach";
1479
1763
  }
1480
- var sn = class extends ge {
1764
+ var Bn = class extends ge {
1481
1765
  static $inject = ["eventBus"];
1482
1766
  constructor(e) {
1483
1767
  super(e);
@@ -1485,17 +1769,17 @@ var sn = class extends ge {
1485
1769
  init() {
1486
1770
  this.addRule("connection.start", (e) => C(e.source)), this.addRule("connection.create", (e) => {
1487
1771
  let { source: t, target: n } = e;
1488
- return !C(t) || !C(n) || t === n || an(t, n) ? !1 : { eventStormingType: "arrow" };
1489
- }), this.addRule(["shape.move", "elements.move"], (e) => on(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 (!De(e.shape)) return !1;
1772
+ return !C(t) || !C(n) || t === n || Rn(t, n) ? !1 : { eventStormingType: "arrow" };
1773
+ }), this.addRule(["shape.move", "elements.move"], (e) => zn(e.shapes ?? (e.shape ? [e.shape] : []), e.target) || !0), this.addRule("shape.create", () => !0), this.addRule("elements.create", () => !0), this.addRule("shape.resize", (e) => {
1774
+ if (!Ae(e.shape)) return !1;
1491
1775
  let { newBounds: t } = e;
1492
- return !t || t.width >= Pe.width && t.height >= Pe.height;
1776
+ return !t || t.width >= j.width && t.height >= j.height;
1493
1777
  });
1494
1778
  }
1495
- }, cn = {
1779
+ }, Vn = {
1496
1780
  __init__: ["eventStormingRules"],
1497
- eventStormingRules: ["type", sn]
1498
- }, ln = 8, un = {
1781
+ eventStormingRules: ["type", Bn]
1782
+ }, Hn = 8, Un = {
1499
1783
  __init__: ["elementSnapping"],
1500
1784
  elementSnapping: ["type", class {
1501
1785
  static $inject = ["eventBus", "elementRegistry"];
@@ -1507,7 +1791,7 @@ var sn = class extends ge {
1507
1791
  let n, r = 9;
1508
1792
  for (let i of t) {
1509
1793
  let t = Math.abs(i - e);
1510
- t <= ln && t < r && (n = i, r = t);
1794
+ t <= Hn && t < r && (n = i, r = t);
1511
1795
  }
1512
1796
  return n;
1513
1797
  };
@@ -1539,7 +1823,7 @@ var sn = class extends ge {
1539
1823
  });
1540
1824
  }
1541
1825
  }]
1542
- }, dn = ".djs-palette-entries .entry", fn = "bottom", pn = class {
1826
+ }, Wn = ".djs-palette-entries .entry", Gn = "bottom", Kn = class {
1543
1827
  palette;
1544
1828
  hoverTooltip;
1545
1829
  static $inject = [
@@ -1554,9 +1838,9 @@ var sn = class extends ge {
1554
1838
  attachTo(e) {
1555
1839
  this.refreshEntries(), this.hoverTooltip.add({
1556
1840
  container: e,
1557
- selector: dn,
1841
+ selector: Wn,
1558
1842
  getContent: (e) => this.contentFor(e),
1559
- getPosition: (e) => mn(e)
1843
+ getPosition: (e) => qn(e)
1560
1844
  });
1561
1845
  }
1562
1846
  refreshEntries() {
@@ -1567,28 +1851,27 @@ var sn = class extends ge {
1567
1851
  return t?.title ? ve`<${_e} title=${t.title} shortcut=${t.shortcut} />` : null;
1568
1852
  }
1569
1853
  };
1570
- function mn(e) {
1854
+ function qn(e) {
1571
1855
  let t = e.getBoundingClientRect();
1572
1856
  return {
1573
1857
  x: t.left + t.width / 2,
1574
1858
  y: t.bottom + 8,
1575
- placement: fn
1859
+ placement: Gn
1576
1860
  };
1577
1861
  }
1578
- //#endregion
1579
- //#region src/palette/index.ts
1580
- var hn = {
1862
+ // src/palette/index.ts
1863
+ var Jn = {
1581
1864
  __init__: ["eventStormingPaletteProvider", "paletteTooltip"],
1582
- eventStormingPaletteProvider: ["type", Ue],
1583
- paletteTooltip: ["type", pn]
1584
- }, G = "event-storming-element-settings", gn = {
1865
+ eventStormingPaletteProvider: ["type", ft],
1866
+ paletteTooltip: ["type", Kn]
1867
+ }, G = "event-storming-element-settings", Yn = {
1585
1868
  id: "kind",
1586
1869
  name: "Change type"
1587
1870
  };
1588
- function _n(e, t) {
1871
+ function Xn(e, t) {
1589
1872
  return e ? `✓ ${t}` : t;
1590
1873
  }
1591
- var vn = class {
1874
+ var Zn = class {
1592
1875
  modeling;
1593
1876
  static $inject = ["popupMenu", "eventStormingModeling"];
1594
1877
  constructor(e, t) {
@@ -1602,20 +1885,20 @@ var vn = class {
1602
1885
  let t = {}, n = e.provisional === !0, r = o[this.modeling.getLevel()];
1603
1886
  for (let i of x) {
1604
1887
  if (!r.includes(i) && (n || i !== e.eventStormingType)) continue;
1605
- let a = A[i];
1888
+ let a = D[i];
1606
1889
  t[`kind-${i}`] = {
1607
- label: n ? a.label : _n(e.eventStormingType === i, a.label),
1608
- imageHtml: ze(a.fill, a.stroke),
1609
- group: gn,
1890
+ label: n ? a.label : Xn(e.eventStormingType === i, a.label),
1891
+ imageHtml: $e(a.fill, a.stroke),
1892
+ group: Yn,
1610
1893
  action: () => this.modeling.setStickyKind(e, i)
1611
1894
  };
1612
1895
  }
1613
1896
  return t;
1614
1897
  }
1615
- }, yn = {
1898
+ }, Qn = {
1616
1899
  __init__: ["eventStormingElementSettings"],
1617
- eventStormingElementSettings: ["type", vn]
1618
- }, K = "eventStorming.readOnly.changed", bn = 5e3, xn = [
1900
+ eventStormingElementSettings: ["type", Zn]
1901
+ }, K = "eventStorming.readOnly.changed", $n = 5e3, er = [
1619
1902
  "elements.move",
1620
1903
  "shape.move",
1621
1904
  "shape.resize",
@@ -1628,7 +1911,7 @@ var vn = class {
1628
1911
  "connection.reconnect",
1629
1912
  "connection.updateWaypoints",
1630
1913
  "elements.delete"
1631
- ], Sn = class extends ge {
1914
+ ], tr = class extends ge {
1632
1915
  bus;
1633
1916
  static $inject = ["eventBus"];
1634
1917
  readOnly = !1;
@@ -1636,7 +1919,7 @@ var vn = class {
1636
1919
  super(e), this.bus = e;
1637
1920
  }
1638
1921
  init() {
1639
- this.addRule(xn, bn, () => !this.readOnly && void 0);
1922
+ this.addRule(er, $n, () => !this.readOnly && void 0);
1640
1923
  }
1641
1924
  isReadOnly() {
1642
1925
  return this.readOnly;
@@ -1644,11 +1927,11 @@ var vn = class {
1644
1927
  setReadOnly(e) {
1645
1928
  this.readOnly !== e && (this.readOnly = e, this.bus.fire(K, { readOnly: e }));
1646
1929
  }
1647
- }, Cn = {
1930
+ }, nr = {
1648
1931
  __depends__: [le],
1649
1932
  __init__: ["eventStormingReadOnly"],
1650
- eventStormingReadOnly: ["type", Sn]
1651
- }, wn = {
1933
+ eventStormingReadOnly: ["type", tr]
1934
+ }, rr = {
1652
1935
  plus: "<path d=\"M5 12h14\"/><path d=\"M12 5v14\"/>",
1653
1936
  "arrow-right": "<path d=\"M5 12h14\"/><path d=\"m12 5 7 7-7 7\"/>",
1654
1937
  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\"/>",
@@ -1668,17 +1951,15 @@ var vn = class {
1668
1951
  x: "<path d=\"M18 6 6 18\"/><path d=\"m6 6 12 12\"/>"
1669
1952
  };
1670
1953
  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">${wn[e]}</svg>`;
1954
+ 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">${rr[e]}</svg>`;
1672
1955
  }
1673
- //#endregion
1674
- //#region src/context-pad/EventStormingContextPadProvider.ts
1675
- var Tn = "Append sticky (auto-connect, choose the type after placing)";
1956
+ // src/context-pad/EventStormingContextPadProvider.ts
1957
+ var ir = "Append sticky (auto-connect, choose the type after placing)";
1676
1958
  function J(e, t, n = !1) {
1677
1959
  return `<div class="entry event-storming-cp-entry"${n ? " draggable=\"true\"" : ""} title="${t}">${q(e)}</div>`;
1678
1960
  }
1679
- //#endregion
1680
- //#region src/context-pad/index.ts
1681
- var En = {
1961
+ // src/context-pad/index.ts
1962
+ var ar = {
1682
1963
  __init__: ["eventStormingContextPadProvider"],
1683
1964
  eventStormingContextPadProvider: ["type", class {
1684
1965
  modeling;
@@ -1690,6 +1971,7 @@ var En = {
1690
1971
  factory;
1691
1972
  colorPicker;
1692
1973
  readOnly;
1974
+ canvas;
1693
1975
  static $inject = [
1694
1976
  "contextPad",
1695
1977
  "modeling",
@@ -1701,10 +1983,11 @@ var En = {
1701
1983
  "eventStormingElementFactory",
1702
1984
  "eventStormingColorPicker",
1703
1985
  "eventBus",
1704
- "eventStormingReadOnly"
1986
+ "eventStormingReadOnly",
1987
+ "canvas"
1705
1988
  ];
1706
- 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) => {
1989
+ constructor(e, t, n, r, i, a, o, s, c, l, u, d) {
1990
+ 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, this.canvas = d, e.registerProvider(this), l?.on(K, (t) => {
1708
1991
  t.readOnly && e.close();
1709
1992
  });
1710
1993
  }
@@ -1723,29 +2006,29 @@ var En = {
1723
2006
  group: "delete",
1724
2007
  title: "Delete connection",
1725
2008
  html: J("trash", "Delete connection"),
1726
- action: { click: () => this.modeling.removeElements([e]) }
2009
+ action: { click: this.focusingCanvas(() => this.modeling.removeElements([e])) }
1727
2010
  }
1728
2011
  };
1729
2012
  }
1730
2013
  if (!y(e)) return {};
1731
2014
  let t = e, n = {}, r = t.eventStormingType;
1732
2015
  if (S(r)) {
1733
- let e = (e) => {
2016
+ let e = this.focusingCanvas((e) => {
1734
2017
  let n = this.factory.createProvisional();
1735
2018
  this.create.start(e, n, { source: t });
1736
- };
2019
+ });
1737
2020
  n.append = {
1738
2021
  group: "append",
1739
- title: Tn,
1740
- html: J("plus", Tn, !0),
2022
+ title: ir,
2023
+ html: J("plus", ir, !0),
1741
2024
  action: {
1742
2025
  click: e,
1743
2026
  dragstart: e
1744
2027
  }
1745
2028
  };
1746
- let r = (e) => {
2029
+ let r = this.focusingCanvas((e) => {
1747
2030
  this.connect.start(e, t);
1748
- };
2031
+ });
1749
2032
  n.connect = {
1750
2033
  group: "edit",
1751
2034
  title: "Connect to existing sticky",
@@ -1773,7 +2056,7 @@ var En = {
1773
2056
  group: "edit",
1774
2057
  title: r,
1775
2058
  html: J("line-style", r),
1776
- action: { click: () => this.eventStormingModeling.setStrokeStyle(t, e) }
2059
+ action: { click: this.focusingCanvas(() => this.eventStormingModeling.setStrokeStyle(t, e)) }
1777
2060
  };
1778
2061
  }
1779
2062
  return r === "drawing" && (n.color = {
@@ -1793,40 +2076,45 @@ var En = {
1793
2076
  group: "delete",
1794
2077
  title: "Delete",
1795
2078
  html: J("trash", "Delete"),
1796
- action: { click: () => this.modeling.removeElements([t]) }
2079
+ action: { click: this.focusingCanvas(() => this.modeling.removeElements([t])) }
1797
2080
  }, n;
1798
2081
  }
2082
+ focusingCanvas(e) {
2083
+ return (t) => {
2084
+ e(t), this.canvas && B(this.canvas);
2085
+ };
2086
+ }
1799
2087
  }]
1800
- }, Dn = "bullet", On = [
2088
+ }, or = "bullet", sr = [
1801
2089
  "left",
1802
2090
  "center",
1803
2091
  "right"
1804
- ], kn = [
2092
+ ], cr = [
1805
2093
  "top",
1806
2094
  "middle",
1807
2095
  "bottom"
1808
2096
  ];
1809
- function An(e, t) {
2097
+ function lr(e, t) {
1810
2098
  return e[(e.indexOf(t) + 1) % e.length];
1811
2099
  }
1812
- function jn(e, t) {
2100
+ function ur(e, t) {
1813
2101
  let n = e.ownerDocument;
1814
2102
  e.textContent = "";
1815
- for (let r of k(t)) {
2103
+ for (let r of E(t)) {
1816
2104
  let t = n.createElement("div");
1817
- r.bullet && (t.className = Dn);
2105
+ r.bullet && (t.className = or);
1818
2106
  for (let e of r.runs) {
1819
2107
  let r = n.createTextNode(e.text);
1820
- e.italic && (r = Mn(n, "i", r)), e.bold && (r = Mn(n, "b", r)), t.appendChild(r);
2108
+ e.italic && (r = dr(n, "i", r)), e.bold && (r = dr(n, "b", r)), t.appendChild(r);
1821
2109
  }
1822
2110
  r.runs.length === 0 && t.appendChild(n.createElement("br")), e.appendChild(t);
1823
2111
  }
1824
2112
  }
1825
- function Mn(e, t, n) {
2113
+ function dr(e, t, n) {
1826
2114
  let r = e.createElement(t);
1827
2115
  return r.appendChild(n), r;
1828
2116
  }
1829
- function Nn(e) {
2117
+ function fr(e) {
1830
2118
  let t = [], n = null, r = (e) => (n = {
1831
2119
  bullet: e,
1832
2120
  runs: []
@@ -1847,11 +2135,11 @@ function Nn(e) {
1847
2135
  s.nextSibling && r(!1);
1848
2136
  return;
1849
2137
  }
1850
- if (Pn(s.tagName)) {
2138
+ if (pr(s.tagName)) {
1851
2139
  a(s);
1852
2140
  return;
1853
2141
  }
1854
- let c = Fn(s, t, o);
2142
+ let c = mr(s, t, o);
1855
2143
  for (let e of s.childNodes) i(e, c.bold, c.italic);
1856
2144
  }, a = (e) => {
1857
2145
  r(e.classList.contains("bullet") || e.tagName === "LI");
@@ -1859,12 +2147,12 @@ function Nn(e) {
1859
2147
  n = null;
1860
2148
  };
1861
2149
  for (let t of e.childNodes) i(t, !1, !1);
1862
- return ke(t);
2150
+ return Me(t);
1863
2151
  }
1864
- function Pn(e) {
2152
+ function pr(e) {
1865
2153
  return e === "DIV" || e === "P" || e === "LI";
1866
2154
  }
1867
- function Fn(e, t, n) {
2155
+ function mr(e, t, n) {
1868
2156
  let r = e.tagName;
1869
2157
  (r === "B" || r === "STRONG") && (t = !0), (r === "I" || r === "EM") && (n = !0);
1870
2158
  let i = e.style.fontWeight;
@@ -1875,13 +2163,13 @@ function Fn(e, t, n) {
1875
2163
  italic: n
1876
2164
  };
1877
2165
  }
1878
- function In(e) {
2166
+ function hr(e) {
1879
2167
  let t = e.ownerDocument, n = t.getSelection();
1880
2168
  if (!n) return;
1881
2169
  let r = t.createRange();
1882
2170
  r.selectNodeContents(e), n.removeAllRanges(), n.addRange(r);
1883
2171
  }
1884
- function Ln(e, t) {
2172
+ function gr(e, t) {
1885
2173
  let n = e.ownerDocument;
1886
2174
  if (typeof n.execCommand == "function" && n.execCommand("insertText", !1, t)) return;
1887
2175
  let r = n.getSelection();
@@ -1892,24 +2180,24 @@ function Ln(e, t) {
1892
2180
  let a = n.createTextNode(t);
1893
2181
  i.insertNode(a), i.setStartAfter(a), i.collapse(!0), r.removeAllRanges(), r.addRange(i);
1894
2182
  }
1895
- function Rn(e) {
2183
+ function _r(e) {
1896
2184
  let t = e.ownerDocument.getSelection();
1897
2185
  if (!t || t.rangeCount === 0) return [];
1898
2186
  let n = t.getRangeAt(0);
1899
2187
  return e.contains(n.commonAncestorContainer) ? Array.from(e.children).filter((e) => n.intersectsNode(e)) : [];
1900
2188
  }
1901
- function zn(e) {
1902
- Bn(e);
1903
- let t = Rn(e);
2189
+ function vr(e) {
2190
+ yr(e);
2191
+ let t = _r(e);
1904
2192
  if (t.length === 0) return;
1905
- let n = t.every((e) => e.classList.contains(Dn));
1906
- for (let e of t) e.classList.toggle(Dn, !n);
2193
+ let n = t.every((e) => e.classList.contains(or));
2194
+ for (let e of t) e.classList.toggle(or, !n);
1907
2195
  }
1908
- function Bn(e) {
2196
+ function yr(e) {
1909
2197
  let t = e.ownerDocument, n = null;
1910
- for (let r of Array.from(e.childNodes)) r.nodeType === Node.ELEMENT_NODE && Pn(r.tagName) ? n = null : (n || (n = t.createElement("div"), e.insertBefore(n, r)), n.appendChild(r));
2198
+ for (let r of Array.from(e.childNodes)) r.nodeType === Node.ELEMENT_NODE && pr(r.tagName) ? n = null : (n || (n = t.createElement("div"), e.insertBefore(n, r)), n.appendChild(r));
1911
2199
  }
1912
- var Vn = {
2200
+ var br = {
1913
2201
  horizontal: {
1914
2202
  left: "text-align-start",
1915
2203
  center: "text-align-center",
@@ -1921,7 +2209,7 @@ var Vn = {
1921
2209
  bottom: "align-vertical-justify-end"
1922
2210
  }
1923
2211
  };
1924
- function Hn(e, t) {
2212
+ function xr(e, t) {
1925
2213
  let n = e.createElement("div");
1926
2214
  n.className = "event-storming-note-toolbar";
1927
2215
  let r = (r, i, a) => {
@@ -1932,19 +2220,18 @@ function Hn(e, t) {
1932
2220
  let i = e.createElement("span");
1933
2221
  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
2222
  }
1935
- function Un(e, t, n) {
1936
- let r = Vn[t][n];
2223
+ function Sr(e, t, n) {
2224
+ let r = br[t][n];
1937
2225
  e.innerHTML = r ? q(r) : "", e.title = t === "horizontal" ? `Horizontal alignment: ${n} (click to cycle)` : `Vertical alignment: ${n} (click to cycle)`;
1938
2226
  }
1939
- function Wn(e, t) {
2227
+ function Cr(e, t) {
1940
2228
  e.style.textAlign = t.horizontal, e.style.justifyContent = t.vertical === "top" ? "flex-start" : t.vertical === "middle" ? "center" : "flex-end";
1941
2229
  }
1942
- //#endregion
1943
- //#region src/label-editing/EventStormingLabelEditing.ts
1944
- function Gn(e) {
2230
+ // src/label-editing/EventStormingLabelEditing.ts
2231
+ function wr(e) {
1945
2232
  return e.replace(/(?<!:)\/\//g, "∕∕").replace(/\/\*/g, "∕*").replace(/->/g, "→").replace(/;/g, ",").replace(/\[/g, "(").replace(/\]/g, ")").trim();
1946
2233
  }
1947
- var Kn = class {
2234
+ var Tr = class {
1948
2235
  canvas;
1949
2236
  modeling;
1950
2237
  elementRegistry;
@@ -1987,7 +2274,7 @@ var Kn = class {
1987
2274
  this.activate(t);
1988
2275
  }
1989
2276
  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)) : (jn(n, e.value), e.align && this.restoreNoteAlign?.(e.align), Jn(n)));
2277
+ 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)) : (ur(n, e.value), e.align && this.restoreNoteAlign?.(e.align), Dr(n)));
1991
2278
  }
1992
2279
  restoreNoteAlign;
1993
2280
  activate(e) {
@@ -2007,7 +2294,7 @@ var Kn = class {
2007
2294
  i || (i = !0, n.removeEventListener("keydown", s), n.removeEventListener("blur", c), n.remove(), this.active = null, this.canvas.restoreFocus?.());
2008
2295
  }, o = () => {
2009
2296
  if (i) return;
2010
- let t = Gn(n.value), r = t && t !== e.eventStormingLabel;
2297
+ let t = wr(n.value), r = t && t !== e.eventStormingLabel;
2011
2298
  a(), r && this.modeling.updateLabel(e, t);
2012
2299
  }, s = (e) => {
2013
2300
  if (e.key === "Escape") e.preventDefault(), a();
@@ -2034,43 +2321,43 @@ var Kn = class {
2034
2321
  }
2035
2322
  activateNote(e) {
2036
2323
  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%)", jn(n, e.eventStormingLabel ?? "");
2324
+ n.className = "event-storming-label-input event-storming-note-editor", n.contentEditable = "true", n.style.position = "absolute", n.style.transform = "translate(-50%, -50%)", ur(n, e.eventStormingLabel ?? "");
2038
2325
  let r = {
2039
2326
  horizontal: e.alignHorizontal ?? "left",
2040
2327
  vertical: e.alignVertical ?? "top"
2041
2328
  };
2042
- Wn(n, r);
2043
- let i = Hn(document, (e) => d(e));
2329
+ Cr(n, r);
2330
+ let i = xr(document, (e) => d(e));
2044
2331
  i.style.transform = "translate(-50%, -100%)";
2045
2332
  let a = () => {
2046
2333
  let t = this.canvas.zoom(), r = this.canvas.viewbox(), a = (e.x + e.width / 2 - r.x) * t;
2047
2334
  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
2335
  };
2049
- a(), t.appendChild(n), t.appendChild(i), n.focus(), In(n);
2336
+ a(), t.appendChild(n), t.appendChild(i), n.focus(), hr(n);
2050
2337
  let o = (e) => i.querySelector(`[data-action="${e}"]`), s = (e, t) => {
2051
2338
  let n = o(e);
2052
2339
  n?.classList.toggle("active", t), n?.setAttribute("aria-pressed", String(t));
2053
2340
  }, c = () => {
2054
- s("note-bold", Yn("bold")), s("note-italic", Yn("italic"));
2055
- let e = Rn(n);
2341
+ s("note-bold", Or("bold")), s("note-italic", Or("italic"));
2342
+ let e = _r(n);
2056
2343
  s("note-bullet", e.length > 0 && e.every((e) => e.classList.contains("bullet")));
2057
2344
  let t = o("note-align-horizontal");
2058
- t && Un(t, "horizontal", r.horizontal);
2345
+ t && Sr(t, "horizontal", r.horizontal);
2059
2346
  let i = o("note-align-vertical");
2060
- i && Un(i, "vertical", r.vertical);
2347
+ i && Sr(i, "vertical", r.vertical);
2061
2348
  }, l = (e) => {
2062
2349
  typeof document.execCommand == "function" && document.execCommand(e, !1), c();
2063
2350
  }, u = (e) => {
2064
- e === "horizontal" ? r.horizontal = An(On, r.horizontal) : r.vertical = An(kn, r.vertical), Wn(n, r), c();
2351
+ e === "horizontal" ? r.horizontal = lr(sr, r.horizontal) : r.vertical = lr(cr, r.vertical), Cr(n, r), c();
2065
2352
  }, d = (e) => {
2066
- e === "note-bold" ? l("bold") : e === "note-italic" ? l("italic") : e === "note-bullet" ? (zn(n), c()) : u(e === "note-align-horizontal" ? "horizontal" : "vertical");
2353
+ e === "note-bold" ? l("bold") : e === "note-italic" ? l("italic") : e === "note-bullet" ? (vr(n), c()) : u(e === "note-align-horizontal" ? "horizontal" : "vertical");
2067
2354
  }, f = () => c();
2068
2355
  document.addEventListener("selectionchange", f);
2069
2356
  let p = !1, m = () => {
2070
- p || (p = !0, document.removeEventListener("selectionchange", f), n.removeEventListener("keydown", g), n.removeEventListener("blur", _), n.removeEventListener("paste", ee), n.remove(), i.remove(), this.active = null, this.restoreNoteAlign = void 0, this.canvas.restoreFocus?.());
2357
+ p || (p = !0, document.removeEventListener("selectionchange", f), n.removeEventListener("keydown", g), n.removeEventListener("blur", ee), n.removeEventListener("paste", _), n.remove(), i.remove(), this.active = null, this.restoreNoteAlign = void 0, this.canvas.restoreFocus?.());
2071
2358
  }, h = () => {
2072
2359
  if (p) return;
2073
- let t = qn(e, Gn(Nn(n)), r);
2360
+ let t = Er(e, wr(fr(n)), r);
2074
2361
  m(), t && this.modeling.updateProperties(e, t);
2075
2362
  }, g = (e) => {
2076
2363
  if (e.key === "Escape") {
@@ -2084,20 +2371,20 @@ var Kn = class {
2084
2371
  }
2085
2372
  let t = e.key.toLowerCase();
2086
2373
  (e.metaKey || e.ctrlKey) && (t === "b" || t === "i") && (e.preventDefault(), l(t === "b" ? "bold" : "italic"));
2087
- }, _ = (e) => {
2088
- e.relatedTarget instanceof Node && i.contains(e.relatedTarget) || h();
2089
2374
  }, ee = (e) => {
2375
+ e.relatedTarget instanceof Node && i.contains(e.relatedTarget) || h();
2376
+ }, _ = (e) => {
2090
2377
  e.preventDefault();
2091
2378
  let t = e.clipboardData?.getData("text/plain") ?? "";
2092
- t && Ln(n, t);
2379
+ t && gr(n, t);
2093
2380
  };
2094
- n.addEventListener("keydown", g), n.addEventListener("blur", _), n.addEventListener("paste", ee), c(), this.restoreNoteAlign = (e) => {
2095
- r.horizontal = e.horizontal, r.vertical = e.vertical, Wn(n, r), c();
2381
+ n.addEventListener("keydown", g), n.addEventListener("blur", ee), n.addEventListener("paste", _), c(), this.restoreNoteAlign = (e) => {
2382
+ r.horizontal = e.horizontal, r.vertical = e.vertical, Cr(n, r), c();
2096
2383
  };
2097
2384
  let te = () => ({
2098
2385
  elementId: e.id,
2099
2386
  connection: !1,
2100
- value: Nn(n),
2387
+ value: fr(n),
2101
2388
  align: { ...r }
2102
2389
  });
2103
2390
  this.active = {
@@ -2123,7 +2410,7 @@ var Kn = class {
2123
2410
  o || (o = !0, i.removeEventListener("keydown", l), i.removeEventListener("blur", u), i.remove(), this.active = null, this.canvas.restoreFocus?.());
2124
2411
  }, c = () => {
2125
2412
  if (o) return;
2126
- let t = Gn(i.value), n = e.linkLabel ?? "";
2413
+ let t = wr(i.value), n = e.linkLabel ?? "";
2127
2414
  s(), t !== n && this.modeling.updateProperties(e, { linkLabel: t || void 0 });
2128
2415
  }, l = (e) => {
2129
2416
  e.key === "Escape" ? (e.preventDefault(), s()) : e.key === "Enter" && (e.preventDefault(), c());
@@ -2156,7 +2443,7 @@ var Kn = class {
2156
2443
  };
2157
2444
  }
2158
2445
  };
2159
- function qn(e, t, n) {
2446
+ function Er(e, t, n) {
2160
2447
  let r = !!t && t !== e.eventStormingLabel, i = n.horizontal !== (e.alignHorizontal ?? "left") || n.vertical !== (e.alignVertical ?? "top");
2161
2448
  if (!r && !i) return null;
2162
2449
  let a = {};
@@ -2166,13 +2453,13 @@ function qn(e, t, n) {
2166
2453
  }
2167
2454
  return i && (a.alignHorizontal = n.horizontal === "left" ? void 0 : n.horizontal, a.alignVertical = n.vertical === "top" ? void 0 : n.vertical), a;
2168
2455
  }
2169
- function Jn(e) {
2456
+ function Dr(e) {
2170
2457
  let t = document.createRange();
2171
2458
  t.selectNodeContents(e), t.collapse(!1);
2172
2459
  let n = window.getSelection();
2173
2460
  n?.removeAllRanges(), n?.addRange(t);
2174
2461
  }
2175
- function Yn(e) {
2462
+ function Or(e) {
2176
2463
  if (typeof document.queryCommandState != "function") return !1;
2177
2464
  try {
2178
2465
  return document.queryCommandState(e);
@@ -2180,106 +2467,11 @@ function Yn(e) {
2180
2467
  return !1;
2181
2468
  }
2182
2469
  }
2183
- //#endregion
2184
- //#region src/label-editing/index.ts
2185
- var Xn = {
2470
+ // src/label-editing/index.ts
2471
+ var kr = {
2186
2472
  __init__: ["eventStormingLabelEditing"],
2187
- eventStormingLabelEditing: ["type", Kn]
2188
- }, Zn = 2, Qn = 10, $n = {
2189
- arrowleft: {
2190
- x: -1,
2191
- y: 0
2192
- },
2193
- arrowright: {
2194
- x: 1,
2195
- y: 0
2196
- },
2197
- arrowup: {
2198
- x: 0,
2199
- y: -1
2200
- },
2201
- arrowdown: {
2202
- x: 0,
2203
- y: 1
2204
- }
2205
- }, er = class {
2206
- static $inject = [
2207
- "config.eventStormingKeyboard",
2208
- "canvas",
2209
- "commandStack",
2210
- "selection",
2211
- "modeling",
2212
- "eventStormingCopyPaste",
2213
- "eventStormingElementFactory",
2214
- "create",
2215
- "mouse",
2216
- "lassoTool",
2217
- "eventBus",
2218
- "elementRegistry",
2219
- "eventStormingReadOnly"
2220
- ];
2221
- constructor(e, t, n, r, i, a, o, s, c, l, u, d, f) {
2222
- let p = t.getContainer(), m = e?.undoRedoKeys ?? !0, h = (e) => {
2223
- e.defaultPrevented || tr(e.target, p) && (nr(e.target) || g(e) || f?.isReadOnly() || _(e));
2224
- }, g = (e) => {
2225
- let t = e.ctrlKey || e.metaKey, n = e.key.toLowerCase();
2226
- if (t && n === "a" && !e.shiftKey && !e.altKey) {
2227
- e.preventDefault();
2228
- let t = (d?.getAll() ?? []).filter((e) => y(e) || b(e));
2229
- r.select(t);
2230
- } else if (t && n === "c") a.copy() && e.preventDefault();
2231
- else if (!t && !e.altKey && n === "l") {
2232
- e.preventDefault();
2233
- let t = c.getLastMoveEvent();
2234
- l.activateSelection(t ?? e, !!t);
2235
- } else return !1;
2236
- return !0;
2237
- }, _ = (e) => {
2238
- let t = e.ctrlKey || e.metaKey, l = e.key.toLowerCase(), u = t && l === "z" && !e.shiftKey, d = t && l === "z" && e.shiftKey || t && l === "y";
2239
- if (u || d) {
2240
- if (!m) return;
2241
- e.preventDefault(), u ? n.undo() : n.redo();
2242
- } else if (t && l === "v") a.paste() && e.preventDefault();
2243
- else if (t && l === "d") e.preventDefault(), a.duplicate();
2244
- else if (l === "delete" || l === "backspace") {
2245
- let t = r.get();
2246
- t.length && (e.preventDefault(), i.removeElements(t));
2247
- } else if (!t && !e.altKey && (l === "e" || l === "c")) {
2248
- let t = c.getLastMoveEvent();
2249
- if (t) {
2250
- e.preventDefault();
2251
- let n = l === "e" ? o.createNew("event", A.event.label) : o.createNew("command", A.command.label);
2252
- s.start(t, n);
2253
- }
2254
- } else if (l in $n && !t) {
2255
- let t = r.get();
2256
- if (t.length) {
2257
- e.preventDefault();
2258
- let n = e.shiftKey ? Qn : Zn, r = $n[l];
2259
- i.moveElements(t, {
2260
- x: r.x * n,
2261
- y: r.y * n
2262
- });
2263
- }
2264
- }
2265
- };
2266
- document.addEventListener("keydown", h), u.on("diagram.destroy", () => document.removeEventListener("keydown", h));
2267
- }
2268
- };
2269
- function tr(e, t) {
2270
- return e instanceof Node ? t.contains(e) || e === document.body || e === document.documentElement : !1;
2271
- }
2272
- function nr(e) {
2273
- if (!(e instanceof HTMLElement)) return !1;
2274
- let t = e.tagName;
2275
- return t === "INPUT" || t === "TEXTAREA" || e.isContentEditable;
2276
- }
2277
- //#endregion
2278
- //#region src/keyboard/index.ts
2279
- var rr = {
2280
- __init__: ["eventStormingKeyboard"],
2281
- eventStormingKeyboard: ["type", er]
2282
- }, ir = 500, ar = 6, or = class {
2473
+ eventStormingLabelEditing: ["type", Tr]
2474
+ }, Ar = 500, jr = 6, Mr = class {
2283
2475
  static $inject = ["injector", "eventBus"];
2284
2476
  constructor(e, t) {
2285
2477
  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;
@@ -2312,14 +2504,14 @@ var rr = {
2312
2504
  let n = o.getAbsoluteBBox(e), c = o.getContainer().getBoundingClientRect();
2313
2505
  i.open(e, G, {
2314
2506
  x: c.left + n.x,
2315
- y: c.top + n.y + n.height + ar
2507
+ y: c.top + n.y + n.height + jr
2316
2508
  }), i.isOpen() ? t.once("popupMenu.close", () => {
2317
2509
  setTimeout(() => {
2318
2510
  s || (e.provisional ? e.parent && a.removeElements([e]) : r?.activate(e));
2319
2511
  }, 0);
2320
2512
  }) : a.removeElements([e]);
2321
2513
  };
2322
- t.on("create.end", ir, (e) => {
2514
+ t.on("create.end", Ar, (e) => {
2323
2515
  let { context: t } = e;
2324
2516
  if (!t.source || !t.canExecute || !t.shape) return;
2325
2517
  let n = t.shape;
@@ -2336,14 +2528,14 @@ var rr = {
2336
2528
  } else r && setTimeout(() => r.activate(n), 0);
2337
2529
  });
2338
2530
  }
2339
- }, sr = {
2531
+ }, Nr = {
2340
2532
  __depends__: [ye],
2341
2533
  __init__: ["eventStormingAppendBehavior"],
2342
- eventStormingAppendBehavior: ["type", or]
2343
- }, cr = x.map((e) => ({
2344
- value: A[e].fill,
2345
- title: A[e].label
2346
- })), lr = class {
2534
+ eventStormingAppendBehavior: ["type", Mr]
2535
+ }, Pr = x.map((e) => ({
2536
+ value: D[e].fill,
2537
+ title: D[e].label
2538
+ })), Fr = class {
2347
2539
  canvas;
2348
2540
  modeling;
2349
2541
  static $inject = [
@@ -2373,7 +2565,7 @@ var rr = {
2373
2565
  value: void 0,
2374
2566
  title: "No color",
2375
2567
  cls: "event-storming-cp-none"
2376
- }, ...cr.map((e) => ({
2568
+ }, ...Pr.map((e) => ({
2377
2569
  value: e.value,
2378
2570
  title: e.title,
2379
2571
  cls: ""
@@ -2391,12 +2583,12 @@ var rr = {
2391
2583
  }, 0);
2392
2584
  }
2393
2585
  close() {
2394
- this.popover && (this.popover.remove(), this.popover = void 0, document.removeEventListener("click", this.onDocPointer, !0), document.removeEventListener("keydown", this.onKey, !0));
2586
+ this.popover && (this.popover.remove(), this.popover = void 0, document.removeEventListener("click", this.onDocPointer, !0), document.removeEventListener("keydown", this.onKey, !0), this.canvas.restoreFocus());
2395
2587
  }
2396
- }, ur = {
2588
+ }, Ir = {
2397
2589
  __init__: ["eventStormingColorPicker"],
2398
- eventStormingColorPicker: ["type", lr]
2399
- }, dr = {
2590
+ eventStormingColorPicker: ["type", Fr]
2591
+ }, Lr = {
2400
2592
  __init__: ["eventStormingOrderingProvider"],
2401
2593
  eventStormingOrderingProvider: ["type", class extends be {
2402
2594
  static $inject = ["eventBus"];
@@ -2407,14 +2599,14 @@ var rr = {
2407
2599
  for (; t.parent;) t = t.parent;
2408
2600
  let n = t.children ?? [];
2409
2601
  if (b(e)) {
2410
- let r = n.filter((t) => t !== e && (D(t) || b(t))).length;
2602
+ let r = n.filter((t) => t !== e && (w(t) || b(t))).length;
2411
2603
  return {
2412
2604
  parent: t,
2413
2605
  index: r
2414
2606
  };
2415
2607
  }
2416
- if (D(e)) {
2417
- let r = n.filter((t) => t !== e && D(t)).length;
2608
+ if (w(e)) {
2609
+ let r = n.filter((t) => t !== e && w(t)).length;
2418
2610
  return {
2419
2611
  parent: t,
2420
2612
  index: r
@@ -2423,7 +2615,7 @@ var rr = {
2423
2615
  return { parent: t };
2424
2616
  }
2425
2617
  }]
2426
- }, fr = 12, pr = class {
2618
+ }, Rr = 12, zr = class {
2427
2619
  canvas;
2428
2620
  eventBus;
2429
2621
  modeling;
@@ -2498,16 +2690,20 @@ var rr = {
2498
2690
  isChromeTarget(e) {
2499
2691
  return !!e.target?.closest(".djs-palette, .djs-context-pad, .event-storming-color-picker");
2500
2692
  }
2693
+ ownsKey(e) {
2694
+ let t = e.target;
2695
+ return nt(e) && t instanceof Node && this.outerContainer().contains(t) && !it(t);
2696
+ }
2501
2697
  onMouseDown = (e) => {
2502
2698
  if (e.button !== 0 || this.isChromeTarget(e)) return;
2503
- e.preventDefault(), e.stopPropagation();
2699
+ e.preventDefault(), e.stopPropagation(), B(this.canvas);
2504
2700
  let t = this.toCanvasPoint(e), n = this.points[0];
2505
- if (n && this.points.length >= 3 && mr(t, n) <= fr) {
2701
+ if (n && this.points.length >= 3 && Br(t, n) <= Rr) {
2506
2702
  this.finishClosed();
2507
2703
  return;
2508
2704
  }
2509
2705
  let r = this.points[this.points.length - 1];
2510
- r && mr(t, r) <= fr ? this.points.length >= 2 && this.finish() : (this.points.push(t), this.renderPreview());
2706
+ r && Br(t, r) <= Rr ? this.points.length >= 2 && this.finish() : (this.points.push(t), this.renderPreview());
2511
2707
  };
2512
2708
  onDblClick = (e) => {
2513
2709
  this.isChromeTarget(e) || (e.preventDefault(), e.stopPropagation(), this.finish());
@@ -2516,12 +2712,12 @@ var rr = {
2516
2712
  this.points.length && (this.cursor = this.toCanvasPoint(e), this.renderPreview());
2517
2713
  };
2518
2714
  onKeyDown = (e) => {
2519
- e.key === "Escape" ? (e.preventDefault(), e.stopPropagation(), this.points.length >= 2 ? this.finish() : this.cancel()) : e.key === "Enter" && (e.preventDefault(), e.stopPropagation(), this.finish());
2715
+ this.ownsKey(e) && (e.key === "Escape" ? (e.preventDefault(), e.stopPropagation(), this.points.length >= 2 ? this.finish() : this.cancel()) : e.key === "Enter" && (e.preventDefault(), e.stopPropagation(), this.finish()));
2520
2716
  };
2521
2717
  renderPreview() {
2522
2718
  if (this.clearPreview(), !this.points.length) return;
2523
- let e = this.canvas.getLayer("event-storming-draw-preview", 1e3), t = h("g"), n = this.cursor ? [...this.points, this.cursor] : this.points;
2524
- p(t, m(h("polyline"), {
2719
+ let e = this.canvas.getLayer("event-storming-draw-preview", 1e3), t = m("g"), n = this.cursor ? [...this.points, this.cursor] : this.points;
2720
+ f(t, p(m("polyline"), {
2525
2721
  points: n.map((e) => `${e.x},${e.y}`).join(" "),
2526
2722
  fill: "none",
2527
2723
  stroke: I,
@@ -2531,7 +2727,7 @@ var rr = {
2531
2727
  "stroke-dasharray": "5 4"
2532
2728
  }));
2533
2729
  let r = this.points[0];
2534
- if (p(t, m(h("circle"), {
2730
+ if (f(t, p(m("circle"), {
2535
2731
  cx: r.x,
2536
2732
  cy: r.y,
2537
2733
  r: this.points.length >= 3 ? 5 : 3,
@@ -2540,7 +2736,7 @@ var rr = {
2540
2736
  "stroke-width": 1.5
2541
2737
  })), this.points.length >= 2) {
2542
2738
  let e = this.points[this.points.length - 1];
2543
- p(t, m(h("circle"), {
2739
+ f(t, p(m("circle"), {
2544
2740
  cx: e.x,
2545
2741
  cy: e.y,
2546
2742
  r: 5,
@@ -2549,18 +2745,17 @@ var rr = {
2549
2745
  "stroke-width": 1.5
2550
2746
  }));
2551
2747
  }
2552
- p(e, t), this.layer = t;
2748
+ f(e, t), this.layer = t;
2553
2749
  }
2554
2750
  clearPreview() {
2555
- this.layer &&= (g(this.layer), null);
2751
+ this.layer &&= (h(this.layer), null);
2556
2752
  }
2557
2753
  };
2558
- function mr(e, t) {
2754
+ function Br(e, t) {
2559
2755
  return Math.hypot(e.x - t.x, e.y - t.y);
2560
2756
  }
2561
- //#endregion
2562
- //#region src/draw-tool/EventStormingDrawingHandles.ts
2563
- var hr = class {
2757
+ // src/draw-tool/EventStormingDrawingHandles.ts
2758
+ var Vr = class {
2564
2759
  eventBus;
2565
2760
  canvas;
2566
2761
  modeling;
@@ -2577,7 +2772,7 @@ var hr = class {
2577
2772
  constructor(e, t, n, r) {
2578
2773
  this.eventBus = e, this.canvas = t, this.modeling = n, this.readOnly = r, e.on(K, () => this.render()), e.on("selection.changed", (e) => {
2579
2774
  let t = e.newSelection ?? [], n = t.length === 1 ? t[0] : null;
2580
- this.attach(D(n) ? n : null);
2775
+ this.attach(w(n) ? n : null);
2581
2776
  }), e.on("element.changed", (e) => {
2582
2777
  this.shape && e.element === this.shape && this.render();
2583
2778
  }), e.on(["diagram.clear", "diagram.destroy"], () => this.attach(null));
@@ -2594,9 +2789,9 @@ var hr = class {
2594
2789
  }
2595
2790
  render() {
2596
2791
  if (this.clear(), !this.shape || this.readOnly?.isReadOnly()) return;
2597
- let e = this.canvas.getLayer("event-storming-drawing-handles", 1100), t = h("g");
2792
+ let e = this.canvas.getLayer("event-storming-drawing-handles", 1100), t = m("g");
2598
2793
  this.absolutePoints().forEach((e, n) => {
2599
- let r = m(h("circle"), {
2794
+ let r = p(m("circle"), {
2600
2795
  cx: e.x,
2601
2796
  cy: e.y,
2602
2797
  r: 5,
@@ -2605,8 +2800,8 @@ var hr = class {
2605
2800
  "stroke-width": 1.5,
2606
2801
  class: "event-storming-drawing-handle"
2607
2802
  });
2608
- r.addEventListener("mousedown", (e) => this.startDrag(e, n)), p(t, r);
2609
- }), p(e, t), this.group = t;
2803
+ r.addEventListener("mousedown", (e) => this.startDrag(e, n)), f(t, r);
2804
+ }), f(e, t), this.group = t;
2610
2805
  }
2611
2806
  startDrag(e, t) {
2612
2807
  if (e.button !== 0 || !this.shape) return;
@@ -2633,7 +2828,7 @@ var hr = class {
2633
2828
  }
2634
2829
  renderDragPreview(e, t) {
2635
2830
  this.clearDragPreview();
2636
- let n = this.canvas.getLayer("event-storming-drawing-handles", 1100), r = m(h(t ? "polygon" : "polyline"), {
2831
+ let n = this.canvas.getLayer("event-storming-drawing-handles", 1100), r = p(m(t ? "polygon" : "polyline"), {
2637
2832
  points: e.map((e) => `${e.x},${e.y}`).join(" "),
2638
2833
  fill: "none",
2639
2834
  stroke: F.ink,
@@ -2641,13 +2836,13 @@ var hr = class {
2641
2836
  "stroke-dasharray": "5 4",
2642
2837
  "pointer-events": "none"
2643
2838
  });
2644
- p(n, r), this.dragPreview = r;
2839
+ f(n, r), this.dragPreview = r;
2645
2840
  }
2646
2841
  clearDragPreview() {
2647
- this.dragPreview &&= (g(this.dragPreview), null);
2842
+ this.dragPreview &&= (h(this.dragPreview), null);
2648
2843
  }
2649
2844
  clear() {
2650
- this.clearDragPreview(), this.group &&= (g(this.group), null);
2845
+ this.clearDragPreview(), this.group &&= (h(this.group), null);
2651
2846
  }
2652
2847
  toCanvasPoint(e) {
2653
2848
  let t = this.canvas.getContainer().getBoundingClientRect(), n = this.canvas.viewbox(), r = this.canvas.zoom();
@@ -2656,51 +2851,50 @@ var hr = class {
2656
2851
  y: (e.clientY - t.top) / r + n.y
2657
2852
  };
2658
2853
  }
2659
- }, gr = class {
2854
+ }, Hr = class {
2660
2855
  static $inject = ["eventBus", "interactionEvents"];
2661
2856
  constructor(e, t) {
2662
2857
  e.on("interactionEvents.createHit", (e) => {
2663
- if (D(e.element) && e.gfx) return _r(e.element, e.gfx), !1;
2858
+ if (w(e.element) && e.gfx) return Ur(e.element, e.gfx), !1;
2664
2859
  }), e.on("interactionEvents.updateHit", (e) => {
2665
- if (D(e.element) && e.gfx) return t.removeHits(e.gfx), _r(e.element, e.gfx), !1;
2860
+ if (w(e.element) && e.gfx) return t.removeHits(e.gfx), Ur(e.element, e.gfx), !1;
2666
2861
  });
2667
2862
  }
2668
2863
  };
2669
- function _r(e, t) {
2670
- let n = e.drawingPoints ?? [], r = h(e.closed ? "polygon" : "polyline");
2671
- m(r, {
2864
+ function Ur(e, t) {
2865
+ let n = e.drawingPoints ?? [], r = m(e.closed ? "polygon" : "polyline");
2866
+ p(r, {
2672
2867
  points: n.map((e) => `${e.x},${e.y}`).join(" "),
2673
2868
  class: "djs-hit djs-hit-stroke",
2674
2869
  fill: "none",
2675
2870
  stroke: "white",
2676
2871
  "stroke-width": 15,
2677
2872
  "stroke-opacity": 0
2678
- }), p(t, r);
2873
+ }), f(t, r);
2679
2874
  }
2680
- //#endregion
2681
- //#region src/draw-tool/index.ts
2682
- var vr = {
2875
+ // src/draw-tool/index.ts
2876
+ var Wr = {
2683
2877
  __init__: [
2684
2878
  "eventStormingDrawTool",
2685
2879
  "eventStormingDrawingHandles",
2686
2880
  "eventStormingDrawingHitProvider"
2687
2881
  ],
2688
- eventStormingDrawTool: ["type", pr],
2689
- eventStormingDrawingHandles: ["type", hr],
2690
- eventStormingDrawingHitProvider: ["type", gr]
2691
- }, yr = class {
2882
+ eventStormingDrawTool: ["type", zr],
2883
+ eventStormingDrawingHandles: ["type", Vr],
2884
+ eventStormingDrawingHitProvider: ["type", Hr]
2885
+ }, Gr = class {
2692
2886
  static $inject = ["eventBus"];
2693
2887
  constructor(e) {
2694
2888
  e.on("resize.start", 1500, (e) => {
2695
2889
  let t = e.context;
2696
- De(t.shape) && (t.minDimensions = Pe);
2890
+ Ae(t.shape) && (t.minDimensions = j);
2697
2891
  });
2698
2892
  }
2699
- }, br = {
2893
+ }, Kr = {
2700
2894
  __depends__: [xe],
2701
2895
  __init__: ["eventStormingResizeBehavior"],
2702
- eventStormingResizeBehavior: ["type", yr]
2703
- }, xr = class extends Bt {
2896
+ eventStormingResizeBehavior: ["type", Gr]
2897
+ }, qr = class extends bn {
2704
2898
  _getModules() {
2705
2899
  return [
2706
2900
  ...super._getModules(),
@@ -2713,22 +2907,22 @@ var vr = {
2713
2907
  ce,
2714
2908
  ue,
2715
2909
  de,
2716
- Cn,
2717
- nn,
2718
- Ht,
2719
- cn,
2720
- un,
2721
- hn,
2722
- En,
2723
- Xn,
2724
- rr,
2725
- yn,
2726
- sr,
2727
- ur,
2728
- rn,
2729
- dr,
2730
- vr,
2731
- br
2910
+ nr,
2911
+ In,
2912
+ Sn,
2913
+ Vn,
2914
+ Un,
2915
+ Jn,
2916
+ ar,
2917
+ kr,
2918
+ ct,
2919
+ Qn,
2920
+ Nr,
2921
+ Ir,
2922
+ Ln,
2923
+ Lr,
2924
+ Wr,
2925
+ Kr
2732
2926
  ];
2733
2927
  }
2734
2928
  undo() {
@@ -2743,18 +2937,18 @@ var vr = {
2743
2937
  canRedo() {
2744
2938
  return this.get("commandStack").canRedo();
2745
2939
  }
2746
- }, Sr = "event-storming";
2747
- function Cr(e = {}) {
2748
- return Er(new xr({
2749
- ...Tr(e),
2940
+ }, Jr = "event-storming";
2941
+ function Yr(e = {}) {
2942
+ return Qr(new qr({
2943
+ ...Zr(e),
2750
2944
  undoRedoKeys: e.undoRedoKeys ?? !0,
2751
- freeArea: z(e)
2945
+ freeArea: V(e)
2752
2946
  }), !0);
2753
2947
  }
2754
- function wr(e = {}) {
2755
- return Er(new Bt(Tr(e)), !1);
2948
+ function Xr(e = {}) {
2949
+ return Qr(new bn(Zr(e)), !1);
2756
2950
  }
2757
- function Tr(e) {
2951
+ function Zr(e) {
2758
2952
  return {
2759
2953
  width: "100%",
2760
2954
  height: "100%",
@@ -2762,9 +2956,9 @@ function Tr(e) {
2762
2956
  fitOnImport: e.fitOnImport ?? !0
2763
2957
  };
2764
2958
  }
2765
- function Er(e, t) {
2959
+ function Qr(e, t) {
2766
2960
  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: Sr,
2961
+ notation: Jr,
2768
2962
  apiVersion: Se,
2769
2963
  editable: t
2770
2964
  };
@@ -2773,21 +2967,21 @@ function Er(e, t) {
2773
2967
  }), {
2774
2968
  meta: u,
2775
2969
  elements: {
2776
- list: () => c ? [] : i.getAll().filter(Y).map((e) => kr(e)),
2970
+ list: () => c ? [] : i.getAll().filter(Y).map((e) => ti(e)),
2777
2971
  reveal(e) {
2778
2972
  if (c) return !1;
2779
2973
  let t = i.get(e);
2780
2974
  return Y(t) ? (a.select(t), r.scrollToElement(t), !0) : !1;
2781
2975
  },
2782
- selection: () => c ? [] : Dr(a.get()),
2976
+ selection: () => c ? [] : $r(a.get()),
2783
2977
  onSelection(e) {
2784
- let t = (t) => e(Dr(t.newSelection ?? []));
2978
+ let t = (t) => e($r(t.newSelection ?? []));
2785
2979
  return n.on("selection.changed", t), () => n.off("selection.changed", t);
2786
2980
  },
2787
2981
  bounds(e) {
2788
2982
  if (c) return;
2789
2983
  let t = i.get(e);
2790
- return Y(t) ? Or(t) : void 0;
2984
+ return Y(t) ? ei(t) : void 0;
2791
2985
  }
2792
2986
  },
2793
2987
  diagram: e,
@@ -2799,7 +2993,7 @@ function Er(e, t) {
2799
2993
  s += 1;
2800
2994
  try {
2801
2995
  let { warnings: n } = await e.importDSL(t);
2802
- return { warnings: n.map(Lt) };
2996
+ return { warnings: n.map(_n) };
2803
2997
  } finally {
2804
2998
  --s;
2805
2999
  }
@@ -2818,19 +3012,22 @@ function Er(e, t) {
2818
3012
  width: n,
2819
3013
  height: i
2820
3014
  };
2821
- return Ar(a) ? a : void 0;
3015
+ return ni(a) ? a : void 0;
2822
3016
  } catch {
2823
3017
  return;
2824
3018
  }
2825
3019
  },
2826
3020
  setViewState(e) {
2827
- !c && Ar(e) && r.viewbox({
3021
+ !c && ni(e) && r.viewbox({
2828
3022
  x: e.x,
2829
3023
  y: e.y,
2830
3024
  width: e.width,
2831
3025
  height: e.height
2832
3026
  });
2833
3027
  },
3028
+ contentBounds() {
3029
+ return e.contentBounds();
3030
+ },
2834
3031
  destroy() {
2835
3032
  if (!c) {
2836
3033
  try {
@@ -2846,10 +3043,10 @@ function Er(e, t) {
2846
3043
  function Y(e) {
2847
3044
  return C(e);
2848
3045
  }
2849
- function Dr(e) {
3046
+ function $r(e) {
2850
3047
  return e.filter(Y).map((e) => e.id);
2851
3048
  }
2852
- function Or(e) {
3049
+ function ei(e) {
2853
3050
  return {
2854
3051
  x: e.x,
2855
3052
  y: e.y,
@@ -2857,14 +3054,14 @@ function Or(e) {
2857
3054
  height: e.height
2858
3055
  };
2859
3056
  }
2860
- function kr(e) {
3057
+ function ti(e) {
2861
3058
  let t = e.eventStormingLabel;
2862
3059
  return t ? {
2863
3060
  id: e.id,
2864
3061
  name: t
2865
3062
  } : { id: e.id };
2866
3063
  }
2867
- function Ar(e) {
3064
+ function ni(e) {
2868
3065
  if (typeof e != "object" || !e) return !1;
2869
3066
  let { x: t, y: n, width: r, height: i } = e;
2870
3067
  return X(t) && X(n) && X(r) && X(i) && r > 0 && i > 0;
@@ -2872,9 +3069,8 @@ function Ar(e) {
2872
3069
  function X(e) {
2873
3070
  return typeof e == "number" && Number.isFinite(e);
2874
3071
  }
2875
- //#endregion
2876
- //#region src/board-menu/menu.ts
2877
- var jr = "Export as .storm", Mr = [
3072
+ // src/board-menu/menu.ts
3073
+ var ri = "Export as .storm", ii = [
2878
3074
  {
2879
3075
  value: "big-picture",
2880
3076
  label: "Big picture"
@@ -2888,8 +3084,8 @@ var jr = "Export as .storm", Mr = [
2888
3084
  label: "Software design"
2889
3085
  }
2890
3086
  ];
2891
- function Nr(e) {
2892
- return Mr.some((t) => t.value === e);
3087
+ function ai(e) {
3088
+ return ii.some((t) => t.value === e);
2893
3089
  }
2894
3090
  function Z(e, t, n, r) {
2895
3091
  return {
@@ -2901,20 +3097,20 @@ function Z(e, t, n, r) {
2901
3097
  onSelect: () => n.onSelect()
2902
3098
  };
2903
3099
  }
2904
- function Pr(e) {
3100
+ function oi(e) {
2905
3101
  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", jr, e.storm)), t;
3102
+ 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", ri, e.storm)), t;
2907
3103
  }
2908
- function Fr(e) {
3104
+ function si(e) {
2909
3105
  return {
2910
3106
  model: [{
2911
3107
  kind: "radio",
2912
3108
  id: "level",
2913
3109
  label: "Level",
2914
- options: Mr,
3110
+ options: ii,
2915
3111
  value: () => e.levels.getLevel(),
2916
3112
  onSelect: (t) => {
2917
- Nr(t) && e.levels.setLevel(t);
3113
+ ai(t) && e.levels.setLevel(t);
2918
3114
  }
2919
3115
  }, {
2920
3116
  kind: "checkbox",
@@ -2926,7 +3122,7 @@ function Fr(e) {
2926
3122
  e.typeCaptions.setTypeCaptionsVisible(t), e.onTypeCaptionsToggled?.(t);
2927
3123
  }
2928
3124
  }],
2929
- export: Pr(e.exports),
3125
+ export: oi(e.exports),
2930
3126
  help: [{
2931
3127
  kind: "dialog",
2932
3128
  id: "keyboard-shortcuts",
@@ -2936,25 +3132,24 @@ function Fr(e) {
2936
3132
  }]
2937
3133
  };
2938
3134
  }
2939
- //#endregion
2940
- //#region src/board-menu/shortcuts.ts
2941
- var Ir = [
3135
+ // src/board-menu/shortcuts.ts
3136
+ var ci = [
2942
3137
  "←",
2943
3138
  "↑",
2944
3139
  "→",
2945
3140
  "↓"
2946
3141
  ];
2947
- function Lr(e, t, n) {
3142
+ function li(e, t, n) {
2948
3143
  return t === "mac" ? `⌘${e}` : `${n.ctrl}+${e}`;
2949
3144
  }
2950
- function Rr(e) {
3145
+ function ui(e) {
2951
3146
  try {
2952
3147
  return new Intl.NumberFormat(e, { style: "percent" }).format(1);
2953
3148
  } catch {
2954
3149
  return new Intl.NumberFormat("en", { style: "percent" }).format(1);
2955
3150
  }
2956
3151
  }
2957
- function zr(e, t) {
3152
+ function di(e, t) {
2958
3153
  if (e === "mac") return {
2959
3154
  zoomIn: "⌘+",
2960
3155
  zoomOut: "⌘−",
@@ -2969,7 +3164,7 @@ function zr(e, t) {
2969
3164
  fit: `${r}+1`
2970
3165
  };
2971
3166
  }
2972
- function Br(e, t) {
3167
+ function fi(e, t) {
2973
3168
  if (e === "mac") return {
2974
3169
  undo: ["⌘Z"],
2975
3170
  redo: ["⌘⇧Z"],
@@ -2978,7 +3173,7 @@ function Br(e, t) {
2978
3173
  paste: ["⌘V"],
2979
3174
  duplicate: ["⌘D"],
2980
3175
  remove: ["⌫"],
2981
- coarseMove: Ir.map((e) => `⇧${e}`),
3176
+ coarseMove: ci.map((e) => `⇧${e}`),
2982
3177
  lassoDrag: ["⇧ Drag"]
2983
3178
  };
2984
3179
  let { ctrl: n, shift: r } = t;
@@ -2990,27 +3185,27 @@ function Br(e, t) {
2990
3185
  paste: [`${n}+V`],
2991
3186
  duplicate: [`${n}+D`],
2992
3187
  remove: ["Del", "Backspace"],
2993
- coarseMove: Ir.map((e) => `${r}+${e}`),
3188
+ coarseMove: ci.map((e) => `${r}+${e}`),
2994
3189
  lassoDrag: [`${r}+Drag`]
2995
3190
  };
2996
3191
  }
2997
- function Vr(e) {
3192
+ function pi(e) {
2998
3193
  let { platform: t, messages: n } = e;
2999
3194
  return {
3000
3195
  title: "File",
3001
3196
  rows: [{
3002
3197
  action: n.openFile ?? "Open…",
3003
- keys: [Lr("O", t, n.keyNames)]
3198
+ keys: [li("O", t, n.keyNames)]
3004
3199
  }, {
3005
- action: jr,
3006
- keys: [Lr("S", t, n.keyNames)]
3200
+ action: ri,
3201
+ keys: [li("S", t, n.keyNames)]
3007
3202
  }]
3008
3203
  };
3009
3204
  }
3010
- function Hr(e, t = {}) {
3011
- let { platform: n, messages: r } = e, i = zr(n, r.keyNames), a = Br(n, r.keyNames);
3205
+ function mi(e, t = {}) {
3206
+ let { platform: n, messages: r } = e, i = di(n, r.keyNames), a = fi(n, r.keyNames);
3012
3207
  return [
3013
- ...t.fileKeys ? [Vr(e)] : [],
3208
+ ...t.fileKeys ? [pi(e)] : [],
3014
3209
  {
3015
3210
  title: "View",
3016
3211
  rows: [
@@ -3023,7 +3218,7 @@ function Hr(e, t = {}) {
3023
3218
  keys: [i.zoomOut]
3024
3219
  },
3025
3220
  {
3026
- action: r.zoomToActual(Rr(e.lang)),
3221
+ action: r.zoomToActual(ui(e.lang)),
3027
3222
  keys: [i.zoomToActual]
3028
3223
  },
3029
3224
  {
@@ -3065,7 +3260,7 @@ function Hr(e, t = {}) {
3065
3260
  },
3066
3261
  {
3067
3262
  action: "Move selection",
3068
- keys: Ir
3263
+ keys: ci
3069
3264
  },
3070
3265
  {
3071
3266
  action: "Move selection in large steps",
@@ -3104,15 +3299,14 @@ function Hr(e, t = {}) {
3104
3299
  }
3105
3300
  ];
3106
3301
  }
3107
- //#endregion
3108
- //#region src/board-menu/ShortcutsDialog.ts
3109
- var Q = "event-storming-shortcuts", Ur = "event-storming-shortcuts-title";
3302
+ // src/board-menu/ShortcutsDialog.ts
3303
+ var Q = "event-storming-shortcuts", hi = "event-storming-shortcuts-title";
3110
3304
  function $(e, t, n) {
3111
3305
  let r = document.createElement(e);
3112
3306
  return r.className = t, n !== void 0 && (r.textContent = n), r;
3113
3307
  }
3114
- function Wr(e, t) {
3115
- let n = $("section", `${Q}-group`), r = `${Ur}-group-${t}`, i = $("h4", `${Q}-group-title`, e.title);
3308
+ function gi(e, t) {
3309
+ let n = $("section", `${Q}-group`), r = `${hi}-group-${t}`, i = $("h4", `${Q}-group-title`, e.title);
3116
3310
  i.id = r;
3117
3311
  let a = $("table", `${Q}-table`);
3118
3312
  a.setAttribute("aria-labelledby", r);
@@ -3126,19 +3320,19 @@ function Wr(e, t) {
3126
3320
  }
3127
3321
  return n.append(i, a), n;
3128
3322
  }
3129
- function Gr(e, t, n) {
3323
+ function _i(e, t, n) {
3130
3324
  let r = $("div", `${Q}-panel`), i = $("header", `${Q}-header`), a = $("h3", `${Q}-title`, "Keyboard shortcuts");
3131
- a.id = Ur;
3325
+ a.id = hi;
3132
3326
  let o = $("button", `${Q}-close`);
3133
3327
  o.type = "button", o.setAttribute("aria-label", e.messages.close), o.innerHTML = q("x"), o.addEventListener("click", n), i.append(a, o);
3134
3328
  let s = $("div", `${Q}-body`);
3135
- return s.append(...Hr(e, t).map(Wr)), r.append(i, s), r;
3329
+ return s.append(...mi(e, t).map(gi)), r.append(i, s), r;
3136
3330
  }
3137
- function Kr(e, t = {}) {
3331
+ function vi(e, t = {}) {
3138
3332
  let n;
3139
3333
  function r() {
3140
3334
  let n = $("dialog", Q);
3141
- return n.setAttribute("aria-labelledby", Ur), n.append(Gr(e, t, () => n.close())), n.addEventListener("click", (e) => {
3335
+ return n.setAttribute("aria-labelledby", hi), n.append(_i(e, t, () => n.close())), n.addEventListener("click", (e) => {
3142
3336
  e.target === n && n.close();
3143
3337
  }), n.addEventListener("close", () => {
3144
3338
  e.menu.trigger.hidden || e.menu.trigger.focus({ preventScroll: !0 });
@@ -3157,13 +3351,11 @@ function Kr(e, t = {}) {
3157
3351
  }
3158
3352
  };
3159
3353
  }
3160
- //#endregion
3161
- //#region src/draw/icons.ts
3162
- var qr = "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", Jr = "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", Yr = "M6 19c0 1.1.9 2 2 2h8c1.1 0 2-.9 2-2V7H6v12zM19 4h-3.5l-1-1h-5l-1 1H5v2h14V4z", Xr = "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", Zr = "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", Qr = "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", $r = "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", ei = "M19 9h-4V3H9v6H5l7 7 7-7zM5 18v2h14v-2H5z", ti = "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", ni = "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", ri = "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", ii = "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", ai = "M3 18h18v-2H3v2zm0-5h18v-2H3v2zm0-7v2h18V6H3z", oi = "M19 13h-6v6h-2v-6H5v-2h6V5h2v6h6v2z", si = "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", ci = "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 li(e, t = 18) {
3354
+ // src/draw/icons.ts
3355
+ var yi = "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", bi = "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", xi = "M6 19c0 1.1.9 2 2 2h8c1.1 0 2-.9 2-2V7H6v12zM19 4h-3.5l-1-1h-5l-1 1H5v2h14V4z", Si = "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", Ci = "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", wi = "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", Ti = "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", Ei = "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", Oi = "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", ki = "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", Ai = "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", ji = "M3 18h18v-2H3v2zm0-5h18v-2H3v2zm0-7v2h18V6H3z", Mi = "M19 13h-6v6h-2v-6H5v-2h6V5h2v6h6v2z", Ni = "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", Pi = "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";
3356
+ function Fi(e, t = 18) {
3164
3357
  return `<svg viewBox="0 0 24 24" width="${t}" height="${t}" fill="currentColor" aria-hidden="true"><path d="${e}"/></svg>`;
3165
3358
  }
3166
- //#endregion
3167
- export { Mr as BOARD_LEVELS, nt as BoardBounds, F as COLORS, Sr as EVENT_STORMING_NOTATION, or as EventStormingAppendBehavior, Vt as EventStormingAttachBehavior, qe as EventStormingBaseViewer, lr as EventStormingColorPicker, Qe as EventStormingElementFactory, vn as EventStormingElementSettingsProvider, Ft as EventStormingExporter, Pt as EventStormingImporter, Kn as EventStormingLabelEditing, Jt as EventStormingModeling, Sn as EventStormingReadOnly, vt as EventStormingRenderer, yr as EventStormingResizeBehavior, sn as EventStormingRules, at as EventStormingViewOptions, oi as ICON_ADD, $r as ICON_CODE, Qr as ICON_DATA_OBJECT, Yr as ICON_DELETE, ei as ICON_DOWNLOAD, Jr as ICON_EDIT, ci as ICON_EYE, si as ICON_FIT, ni as ICON_FOLDER_OPEN, ri as ICON_IMAGE, ai as ICON_MENU, ii as ICON_NEW, qr as ICON_PERSON, Zr as ICON_REDO, ti as ICON_SHARE, Xr as ICON_UNDO, O as MIRAGON, xr as Modeler, j as NOTE_STYLE, Bt as NavigatedViewer, G as POPUP_PROVIDER_ID, K as READ_ONLY_CHANGED_EVENT, v as ROOT_ID, x as STICKY_KINDS, A as STICKY_STYLES, jr as STORM_EXPORT_LABEL, it as VIEW_OPTIONS_CHANGED_EVENT, zt as Viewer, rt as boardBoundsModule, Fr as boardMenu, Hr as boardShortcuts, Lr as commandKeyLabel, Cr as createCollaborativeModeler, wr as createCollaborativeViewer, Kr as createShortcutsDialog, un as elementSnappingModule, sr as eventStormingAppendModule, Ht as eventStormingAttachModule, ur as eventStormingColorPickerModule, En as eventStormingContextPadModule, jt as eventStormingDrawModule, rr as eventStormingKeyboardModule, et as eventStormingModelModule, nn as eventStormingModelingModule, hn as eventStormingPaletteModule, yn as eventStormingPopupModule, Cn as eventStormingReadOnlyModule, br as eventStormingResizeModule, cn as eventStormingRulesModule, H as eventStormingViewOptionsModule, li as iconMarkup, Lt as importWarningText, Rt as ioModule, w as isAttachableKind, Ee as isAttachableSticky, b as isEventStormingConnection, y as isEventStormingShape, T as isHostKind, E as isHostSticky, C as isSticky, S as isStickyKind, Xn as labelEditingModule, k as parseNoteMarkdown, Ae as plainNoteText, we as saveSVG, ke as serializeNoteMarkdown };
3359
+ export { ii as BOARD_LEVELS, un as BoardBounds, F as COLORS, Jr as EVENT_STORMING_NOTATION, Mr as EventStormingAppendBehavior, xn as EventStormingAttachBehavior, _t as EventStormingBaseViewer, Fr as EventStormingColorPicker, St as EventStormingElementFactory, Zn as EventStormingElementSettingsProvider, hn as EventStormingExporter, mn as EventStormingImporter, Tr as EventStormingLabelEditing, On as EventStormingModeling, tr as EventStormingReadOnly, Kt as EventStormingRenderer, Gr as EventStormingResizeBehavior, Bn as EventStormingRules, on as EventStormingViewOptions, Mi as ICON_ADD, Ti as ICON_CODE, wi as ICON_DATA_OBJECT, xi as ICON_DELETE, Ei as ICON_DOWNLOAD, bi as ICON_EDIT, Pi as ICON_EYE, Ni as ICON_FIT, Oi as ICON_FOLDER_OPEN, ki as ICON_IMAGE, ji as ICON_MENU, Ai as ICON_NEW, yi as ICON_PERSON, Ci as ICON_REDO, Di as ICON_SHARE, Si as ICON_UNDO, T as MIRAGON, qr as Modeler, O as NOTE_STYLE, bn as NavigatedViewer, G as POPUP_PROVIDER_ID, K as READ_ONLY_CHANGED_EVENT, v as ROOT_ID, x as STICKY_KINDS, D as STICKY_STYLES, ri as STORM_EXPORT_LABEL, an as VIEW_OPTIONS_CHANGED_EVENT, yn as Viewer, dn as boardBoundsModule, si as boardMenu, mi as boardShortcuts, li as commandKeyLabel, Yr as createCollaborativeModeler, Xr as createCollaborativeViewer, vi as createShortcutsDialog, Un as elementSnappingModule, Nr as eventStormingAppendModule, Sn as eventStormingAttachModule, Ir as eventStormingColorPickerModule, ar as eventStormingContextPadModule, cn as eventStormingDrawModule, ct as eventStormingKeyboardModule, wt as eventStormingModelModule, In as eventStormingModelingModule, Jn as eventStormingPaletteModule, Qn as eventStormingPopupModule, nr as eventStormingReadOnlyModule, Kr as eventStormingResizeModule, Vn as eventStormingRulesModule, sn as eventStormingViewOptionsModule, Fi as iconMarkup, _n as importWarningText, vn as ioModule, Ee as isAttachableKind, Oe as isAttachableSticky, b as isEventStormingConnection, y as isEventStormingShape, De as isHostKind, ke as isHostSticky, C as isSticky, S as isStickyKind, kr as labelEditingModule, E as parseNoteMarkdown, Ne as plainNoteText, we as saveSVG, Me as serializeNoteMarkdown };
3168
3360
 
3169
3361
  //# sourceMappingURL=index.js.map