@cardenelabs/dragon 0.45.3 → 0.46.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (69) hide show
  1. package/dist/cli.cjs +97 -104
  2. package/dist/cli.cjs.map +1 -1
  3. package/dist/cli.js +97 -104
  4. package/dist/cli.js.map +1 -1
  5. package/dist/export.cjs +91 -104
  6. package/dist/export.cjs.map +1 -1
  7. package/dist/export.js +91 -104
  8. package/dist/export.js.map +1 -1
  9. package/dist/index.cjs +55 -62
  10. package/dist/index.cjs.map +1 -1
  11. package/dist/index.js +55 -62
  12. package/dist/index.js.map +1 -1
  13. package/dist/light/chunk-CLS6JVKK.cjs.map +1 -1
  14. package/dist/light/{chunk-EHTQUCW4.js → chunk-DVGDEPCV.js} +6 -2
  15. package/dist/light/chunk-DVGDEPCV.js.map +1 -0
  16. package/dist/light/{chunk-5OQV42W3.cjs → chunk-SUL4AJLI.cjs} +6 -2
  17. package/dist/light/chunk-SUL4AJLI.cjs.map +1 -0
  18. package/dist/light/{chunk-JCEKXALJ.cjs → chunk-V34DCH34.cjs} +90 -87
  19. package/dist/light/chunk-V34DCH34.cjs.map +1 -0
  20. package/dist/light/{chunk-YEQSLVIN.js → chunk-YO3UBEC3.js} +12 -9
  21. package/dist/light/chunk-YO3UBEC3.js.map +1 -0
  22. package/dist/light/{git-K3KAAAWW.cjs → git-WBGFDRBD.cjs} +59 -59
  23. package/dist/light/git-WBGFDRBD.cjs.map +1 -0
  24. package/dist/light/{git-GESUYKGR.js → git-WEJL6VAY.js} +3 -3
  25. package/dist/light/index.cjs +358 -372
  26. package/dist/light/index.cjs.map +1 -1
  27. package/dist/light/index.js +43 -57
  28. package/dist/light/index.js.map +1 -1
  29. package/dist/light/{lineup-2V2U7HZH.js → lineup-6LN6Z5T2.js} +3 -3
  30. package/dist/light/{lineup-623J25LU.cjs → lineup-WLGNGTFX.cjs} +40 -40
  31. package/dist/light/lineup-WLGNGTFX.cjs.map +1 -0
  32. package/dist/light/{state-T4OTVING.js → state-DFYTMQI7.js} +2 -2
  33. package/dist/light/{state-OZVCHX7H.cjs → state-JVAH4TSM.cjs} +41 -41
  34. package/dist/light/state-JVAH4TSM.cjs.map +1 -0
  35. package/dist/light/{time-PQCPVQOE.cjs → time-EXRPI34B.cjs} +90 -88
  36. package/dist/light/time-EXRPI34B.cjs.map +1 -0
  37. package/dist/light/{time-6WEMD4FQ.js → time-M3EGEFDU.js} +10 -8
  38. package/dist/light/{time-6WEMD4FQ.js.map → time-M3EGEFDU.js.map} +1 -1
  39. package/dist/light/{tree-6D7KI57H.cjs → tree-DECHTXFU.cjs} +62 -62
  40. package/dist/light/tree-DECHTXFU.cjs.map +1 -0
  41. package/dist/light/{tree-ZJZQI5QT.js → tree-MFU54QKY.js} +3 -3
  42. package/dist/node.cjs +27 -48
  43. package/dist/node.cjs.map +1 -1
  44. package/dist/node.js +27 -48
  45. package/dist/node.js.map +1 -1
  46. package/dist/player.global.js +3 -3
  47. package/package.json +1 -1
  48. package/src/look/values.ts +5 -1
  49. package/src/messages.ts +4 -1
  50. package/src/parser.ts +4 -2
  51. package/src/render/draw.ts +2 -1
  52. package/src/render/parts.ts +28 -7
  53. package/src/render/time.ts +13 -6
  54. package/src/schema.ts +6 -0
  55. package/src/schemas/diagram.schema.json +3 -2
  56. package/src/schemas/validate-diagram.js +1 -1
  57. package/dist/light/chunk-5OQV42W3.cjs.map +0 -1
  58. package/dist/light/chunk-EHTQUCW4.js.map +0 -1
  59. package/dist/light/chunk-JCEKXALJ.cjs.map +0 -1
  60. package/dist/light/chunk-YEQSLVIN.js.map +0 -1
  61. package/dist/light/git-K3KAAAWW.cjs.map +0 -1
  62. package/dist/light/lineup-623J25LU.cjs.map +0 -1
  63. package/dist/light/state-OZVCHX7H.cjs.map +0 -1
  64. package/dist/light/time-PQCPVQOE.cjs.map +0 -1
  65. package/dist/light/tree-6D7KI57H.cjs.map +0 -1
  66. /package/dist/light/{git-GESUYKGR.js.map → git-WEJL6VAY.js.map} +0 -0
  67. /package/dist/light/{lineup-2V2U7HZH.js.map → lineup-6LN6Z5T2.js.map} +0 -0
  68. /package/dist/light/{state-T4OTVING.js.map → state-DFYTMQI7.js.map} +0 -0
  69. /package/dist/light/{tree-ZJZQI5QT.js.map → tree-MFU54QKY.js.map} +0 -0
@@ -8,7 +8,7 @@
8
8
 
9
9
 
10
10
 
11
- var _chunkJCEKXALJcjs = require('./chunk-JCEKXALJ.cjs');
11
+ var _chunkV34DCH34cjs = require('./chunk-V34DCH34.cjs');
12
12
 
13
13
 
14
14
 
@@ -32,7 +32,7 @@ var _chunkJCEKXALJcjs = require('./chunk-JCEKXALJ.cjs');
32
32
 
33
33
 
34
34
 
35
- var _chunk5OQV42W3cjs = require('./chunk-5OQV42W3.cjs');
35
+ var _chunkSUL4AJLIcjs = require('./chunk-SUL4AJLI.cjs');
36
36
 
37
37
  // src/layout/time.ts
38
38
  var SECONDS = { d: 86400, h: 3600, min: 60, s: 1, ms: 1e-3 };
@@ -44,13 +44,13 @@ function durationOf(text) {
44
44
  return { seconds: Number(m[1]) * SECONDS[unit], unit };
45
45
  }
46
46
  var unitFor = (max, fallback) => _nullishCoalesce(UNITS.find((u) => max / SECONDS[u] >= 2 - 1e-9), () => ( fallback));
47
- var timeText = (seconds, unit, lang) => `${Number((seconds / SECONDS[unit]).toFixed(2))} ${_chunk5OQV42W3cjs.FIGURE_TEXT[lang].timeUnits[unit]}`;
47
+ var timeText = (seconds, unit, lang) => `${Number((seconds / SECONDS[unit]).toFixed(2))} ${_chunkSUL4AJLIcjs.FIGURE_TEXT[lang].timeUnits[unit]}`;
48
48
  function majorTicks(count, period, unitPx) {
49
49
  let step = 1;
50
50
  if (period) step = period * Math.max(1, Math.ceil(count / period / 8));
51
51
  else {
52
52
  for (let k = 1; ; k *= 10) {
53
- const found = [k, k * 2, k * 5].find((n) => count / n <= _chunk5OQV42W3cjs.LOOK.time.ticks);
53
+ const found = [k, k * 2, k * 5].find((n) => count / n <= _chunkSUL4AJLIcjs.LOOK.time.ticks);
54
54
  if (found !== void 0) {
55
55
  step = found;
56
56
  break;
@@ -60,11 +60,11 @@ function majorTicks(count, period, unitPx) {
60
60
  const at = [];
61
61
  for (let u = 0; u <= count; u += step) at.push(u);
62
62
  const last = at[at.length - 1];
63
- if (last !== count && (count - last) * unitPx >= _chunk5OQV42W3cjs.LOOK.time.minorPx) at.push(count);
63
+ if (last !== count && (count - last) * unitPx >= _chunkSUL4AJLIcjs.LOOK.time.minorPx) at.push(count);
64
64
  return { at, step };
65
65
  }
66
66
  function minorTicks(count, step, unitPx, majors) {
67
- const by = Array.from({ length: step - 1 }, (_, k) => k + 1).find((d) => step % d === 0 && d * unitPx >= _chunk5OQV42W3cjs.LOOK.time.minorPx);
67
+ const by = Array.from({ length: step - 1 }, (_, k) => k + 1).find((d) => step % d === 0 && d * unitPx >= _chunkSUL4AJLIcjs.LOOK.time.minorPx);
68
68
  if (by === void 0) return [];
69
69
  const out = [];
70
70
  for (let u = by; u < count; u += by) if (!majors.includes(u)) out.push(u);
@@ -79,21 +79,21 @@ function needleSteps(diagram) {
79
79
  });
80
80
  }
81
81
  function layoutTime(diagram, lang = "ja") {
82
- const T = _chunk5OQV42W3cjs.LOOK.time;
83
- const { margin, gap } = _chunk5OQV42W3cjs.LOOK;
84
- const R = _chunk5OQV42W3cjs.LOOK.region;
85
- const text = _chunk5OQV42W3cjs.FIGURE_TEXT[lang];
82
+ const T = _chunkSUL4AJLIcjs.LOOK.time;
83
+ const { margin, gap } = _chunkSUL4AJLIcjs.LOOK;
84
+ const R = _chunkSUL4AJLIcjs.LOOK.region;
85
+ const text = _chunkSUL4AJLIcjs.FIGURE_TEXT[lang];
86
86
  const spec = _nullishCoalesce(diagram.time, () => ( { scale: { unit: "", length: "1s", count: 1 }, rows: [] }));
87
87
  const { scale } = spec;
88
88
  const count = Math.max(1, scale.count);
89
89
  const length = durationOf(scale.length);
90
- const width = Math.max(T.width, _chunk5OQV42W3cjs.stripNeed.call(void 0, diagram) + margin * 2);
91
- const nameRight = Math.max(0, ...spec.rows.map((r) => _chunk5OQV42W3cjs.textWidth.call(void 0, r.name, _chunk5OQV42W3cjs.TYPE.timeRow)));
90
+ const width = Math.max(T.width, _chunkSUL4AJLIcjs.stripNeed.call(void 0, diagram) + margin * 2);
91
+ const nameRight = Math.max(0, ...spec.rows.map((r) => _chunkSUL4AJLIcjs.textWidth.call(void 0, r.name, _chunkSUL4AJLIcjs.TYPE.timeRow)));
92
92
  const axisX = Math.max(T.axisX, margin + R.inset + nameRight + T.gutterGap);
93
93
  const axisW = width - T.right - axisX;
94
94
  const unit = axisW / count;
95
- const colors = _chunk5OQV42W3cjs.boxColors.call(void 0, diagram);
96
- const rooms = _chunk5OQV42W3cjs.slotRooms.call(void 0, diagram);
95
+ const colors = _chunkSUL4AJLIcjs.boxColors.call(void 0, diagram);
96
+ const rooms = _chunkSUL4AJLIcjs.slotRooms.call(void 0, diagram);
97
97
  const regions = [];
98
98
  const boxes = [];
99
99
  const edges = [];
@@ -113,8 +113,8 @@ function layoutTime(diagram, lang = "ja") {
113
113
  const x = axisX + k * colW;
114
114
  const placed = diagram.boxes.map((b, j) => {
115
115
  const room = rooms.get(b.id);
116
- const w = Math.max(_chunk5OQV42W3cjs.boxWidth.call(void 0, diagram, b.id, false), _chunk5OQV42W3cjs.slotBoxWidth.call(void 0, room, b.icon !== void 0, _chunk5OQV42W3cjs.LOOK.box.padX));
117
- const y2 = top + T.boxTop + j * (_chunk5OQV42W3cjs.LOOK.box.h + T.boxGap);
116
+ const w = Math.max(_chunkSUL4AJLIcjs.boxWidth.call(void 0, diagram, b.id, false), _chunkSUL4AJLIcjs.slotBoxWidth.call(void 0, room, b.icon !== void 0, _chunkSUL4AJLIcjs.LOOK.box.padX));
117
+ const y2 = top + T.boxTop + j * (_chunkSUL4AJLIcjs.LOOK.box.h + T.boxGap);
118
118
  const row = rowIds.get(b.id);
119
119
  const box = {
120
120
  id: b.id,
@@ -125,13 +125,13 @@ function layoutTime(diagram, lang = "ja") {
125
125
  x: x + colW / 2 - w / 2,
126
126
  y: y2,
127
127
  w,
128
- h: _chunk5OQV42W3cjs.LOOK.box.h,
128
+ h: _chunkSUL4AJLIcjs.LOOK.box.h,
129
129
  cx: x + colW / 2,
130
- cy: y2 + _chunk5OQV42W3cjs.LOOK.box.h / 2,
130
+ cy: y2 + _chunkSUL4AJLIcjs.LOOK.box.h / 2,
131
131
  ...row ? { row: row.id } : {},
132
132
  ..._optionalChain([row, 'optionalAccess', _2 => _2.empty, 'optionalAccess', _3 => _3.includes, 'call', _4 => _4(u)]) ? { empty: true } : {}
133
133
  };
134
- _chunk5OQV42W3cjs.placeSlot.call(void 0, box, room);
134
+ _chunkSUL4AJLIcjs.placeSlot.call(void 0, box, room);
135
135
  return box;
136
136
  });
137
137
  boxes.push(...placed);
@@ -151,7 +151,7 @@ function layoutTime(diagram, lang = "ja") {
151
151
  y: top,
152
152
  w: width - margin * 2,
153
153
  h: bottom2 - top,
154
- header: { x: margin + R.inset, y: top + R.inset, w: Math.max(R.icon, _chunk5OQV42W3cjs.textWidth.call(void 0, text.zoom, _chunk5OQV42W3cjs.TYPE.regionName)), h: R.nameY - R.inset + R.line }
154
+ header: { x: margin + R.inset, y: top + R.inset, w: Math.max(R.icon, _chunkSUL4AJLIcjs.textWidth.call(void 0, text.zoom, _chunkSUL4AJLIcjs.TYPE.regionName)), h: R.nameY - R.inset + R.line }
155
155
  });
156
156
  zoom = { from, to, frame: { x: 0, y: 0, w: 0, h: 0 }, guides: [], columns, empty: text.empty, headY: top + T.head };
157
157
  axisTop = bottom2 + T.zoomGap;
@@ -161,7 +161,7 @@ function layoutTime(diagram, lang = "ja") {
161
161
  id: r.id,
162
162
  name: r.name,
163
163
  // 色を書かない列は、同じ名札の箱の色にそろえる。印と拡大の帯の箱が同じ物だと見て分かるため
164
- color: _nullishCoalesce(_nullishCoalesce(r.color, () => ( colors.get(r.id))), () => ( _chunk5OQV42W3cjs.COLOR_ORDER[k % _chunk5OQV42W3cjs.COLOR_ORDER.length])),
164
+ color: _nullishCoalesce(_nullishCoalesce(r.color, () => ( colors.get(r.id))), () => ( _chunkSUL4AJLIcjs.COLOR_ORDER[k % _chunkSUL4AJLIcjs.COLOR_ORDER.length])),
165
165
  x: axisX,
166
166
  y: rowsTop + k * (T.row + T.rowGap),
167
167
  w: axisW,
@@ -213,9 +213,9 @@ function layoutTime(diagram, lang = "ja") {
213
213
  );
214
214
  const cx = axisX + (p.at + 0.5) * unit;
215
215
  const tx = cx + T.point.text;
216
- const w = Math.max(_chunk5OQV42W3cjs.textWidth.call(void 0, p.id, _chunk5OQV42W3cjs.TYPE.pointName), ...changes.map((c) => _chunk5OQV42W3cjs.textWidth.call(void 0, c.text, _chunk5OQV42W3cjs.TYPE.pointState)));
217
- const top = pointCy + T.point.nameY - _chunk5OQV42W3cjs.TYPE.pointName.size * 0.8;
218
- const bottom2 = pointCy + T.point.stateY + _chunk5OQV42W3cjs.TYPE.pointState.size * 0.2;
216
+ const w = Math.max(_chunkSUL4AJLIcjs.textWidth.call(void 0, p.id, _chunkSUL4AJLIcjs.TYPE.pointName), ...changes.map((c) => _chunkSUL4AJLIcjs.textWidth.call(void 0, c.text, _chunkSUL4AJLIcjs.TYPE.pointState)));
217
+ const top = pointCy + T.point.nameY - _chunkSUL4AJLIcjs.TYPE.pointName.size * 0.8;
218
+ const bottom2 = pointCy + T.point.stateY + _chunkSUL4AJLIcjs.TYPE.pointState.size * 0.2;
219
219
  return { id: p.id, unit: p.at, cx, cy: pointCy, r: T.point.r, text: { x: tx, y: top, w, h: bottom2 - top }, changes };
220
220
  });
221
221
  const pointOf = new Map(points.map((p) => [p.id, p]));
@@ -234,13 +234,13 @@ function layoutTime(diagram, lang = "ja") {
234
234
  const x0 = right ? Math.max(a.cx + a.r, a.text.x + a.text.w + T.point.link) : a.cx - a.r - T.point.end;
235
235
  const x1 = right ? b.cx - b.r - T.point.end : Math.min(b.cx - b.r, b.text.x + b.text.w + T.point.link);
236
236
  const edge2 = { step: s, event: e, from: event.from, to: event.to, points: [[x0, a.cy], [x1, b.cy]], color: event.carry.kind === "coin" ? "coin" : _nullishCoalesce(colorAt(event.to, s), () => ( "slate")), carry: event.carry };
237
- if (event.carry.kind !== "none") edge2.settle = [x1 - (right ? 1 : -1) * (_chunk5OQV42W3cjs.LOOK.carrier.coinR + _chunk5OQV42W3cjs.LOOK.edge.arrow), b.cy];
237
+ if (event.carry.kind !== "none") edge2.settle = [x1 - (right ? 1 : -1) * (_chunkSUL4AJLIcjs.LOOK.carrier.coinR + _chunkSUL4AJLIcjs.LOOK.edge.arrow), b.cy];
238
238
  edges.push(edge2);
239
239
  return;
240
240
  }
241
241
  const wired = wire(event, zoom);
242
242
  if (!wired) return;
243
- const edge = { step: s, event: e, from: event.from, to: event.to, points: wired.points, color: _chunk5OQV42W3cjs.edgeColor.call(void 0, event, colors), carry: event.carry };
243
+ const edge = { step: s, event: e, from: event.from, to: event.to, points: wired.points, color: _chunkSUL4AJLIcjs.edgeColor.call(void 0, event, colors), carry: event.carry };
244
244
  seat(edge, wired.from, wired.to, rooms);
245
245
  edges.push(edge);
246
246
  wires.push({ step: s, event: e, from: wired.from, to: wired.to, column: event.at, into: _nullishCoalesce(event.into, () => ( event.at)) });
@@ -273,7 +273,7 @@ function layoutTime(diagram, lang = "ja") {
273
273
  };
274
274
  const marksBottom = rowsBottom;
275
275
  const named = diagram.steps.some((step) => step.events.some((e) => e.type === "edge" && e.at === void 0 && e.label !== void 0));
276
- const { r: badgeR, inset } = _chunk5OQV42W3cjs.LOOK.badge;
276
+ const { r: badgeR, inset } = _chunkSUL4AJLIcjs.LOOK.badge;
277
277
  let y = points.length > 0 ? pointCy + T.point.r + (named ? T.point.room : T.point.plain) : marksBottom + (badgeR + inset) * 2;
278
278
  const spans = [];
279
279
  const events = diagram.steps.flatMap((step, s) => step.events.flatMap((event, e) => event.type === "span" ? [{ s, e, event }] : []));
@@ -287,18 +287,18 @@ function layoutTime(diagram, lang = "ja") {
287
287
  if (kind === "box") {
288
288
  const B = T.box;
289
289
  const rect = { x: x0 - B.pad, y: rowsTop - B.pad, w: x1 - x0 + B.pad * 2, h: rowsBottom - rowsTop + B.pad * 2 };
290
- const w = _chunk5OQV42W3cjs.textWidth.call(void 0, event.text, _chunk5OQV42W3cjs.TYPE.tag) + B.tagPadX * 2;
290
+ const w = _chunkSUL4AJLIcjs.textWidth.call(void 0, event.text, _chunkSUL4AJLIcjs.TYPE.tag) + B.tagPadX * 2;
291
291
  const textRect = { x: rect.x + B.tagX, y: rect.y - B.tagH / 2, w, h: B.tagH };
292
- spans.push({ ...base, ...rect, textRect, textY: rect.y + _chunk5OQV42W3cjs.LOOK.baseline.tag });
292
+ spans.push({ ...base, ...rect, textRect, textY: rect.y + _chunkSUL4AJLIcjs.LOOK.baseline.tag });
293
293
  } else spans.push({ ...base, x: x0, y: 0, w: x1 - x0, h: T.bracket.tick, textRect: { x: 0, y: 0, w: 0, h: 0 }, textY: 0 });
294
294
  }
295
295
  layout.spans = spans;
296
296
  layout.badges = badgesOf(diagram, layout, needleSteps(diagram));
297
297
  layout.labels = labelsOf(diagram, layout);
298
- y = Math.max(y, ...layout.labels.map((l) => l.y + l.h + _chunk5OQV42W3cjs.LOOK.label.soft));
298
+ y = Math.max(y, ...layout.labels.map((l) => l.y + l.h + _chunkSUL4AJLIcjs.LOOK.label.soft));
299
299
  const lanes = [];
300
300
  for (const span of spans.filter((x) => x.kind === "bracket")) {
301
- const w = _chunk5OQV42W3cjs.textWidth.call(void 0, span.text, _chunk5OQV42W3cjs.TYPE.spanText);
301
+ const w = _chunkSUL4AJLIcjs.textWidth.call(void 0, span.text, _chunkSUL4AJLIcjs.TYPE.spanText);
302
302
  const cx = Math.min(axisX + axisW - w / 2, Math.max(axisX + w / 2, span.x + span.w / 2));
303
303
  const reach = { x: Math.min(span.x, cx - w / 2), w: Math.max(span.x + span.w, cx + w / 2) - Math.min(span.x, cx - w / 2) };
304
304
  const clash = (other) => {
@@ -315,7 +315,7 @@ function layoutTime(diagram, lang = "ja") {
315
315
  lanes[lane].push(span);
316
316
  span.y = y + T.bracket.gap + lane * T.bracket.lane;
317
317
  span.textY = span.y + T.bracket.tick + T.bracket.text;
318
- span.textRect = _chunk5OQV42W3cjs.textBox.call(void 0, span.text, cx, span.textY, _chunk5OQV42W3cjs.TYPE.spanText, "middle");
318
+ span.textRect = _chunkSUL4AJLIcjs.textBox.call(void 0, span.text, cx, span.textY, _chunkSUL4AJLIcjs.TYPE.spanText, "middle");
319
319
  }
320
320
  if (lanes.length > 0) y = Math.max(...spans.filter((x) => x.kind === "bracket").map((x) => x.textRect.y + x.textRect.h));
321
321
  const axisLine = y + T.axisGap;
@@ -325,13 +325,13 @@ function layoutTime(diagram, lang = "ja") {
325
325
  const tickUnit = unitFor(count * length.seconds, length.unit);
326
326
  layout.ticks = majors.at.map((at) => {
327
327
  const label = timeText(at * length.seconds, tickUnit, lang);
328
- const w = _chunk5OQV42W3cjs.textWidth.call(void 0, label, _chunk5OQV42W3cjs.TYPE.timeTick);
328
+ const w = _chunkSUL4AJLIcjs.textWidth.call(void 0, label, _chunkSUL4AJLIcjs.TYPE.timeTick);
329
329
  const x = axisX + at * unit;
330
330
  const left = at === 0 ? x : at === count ? x - w : Math.min(axisX + axisW - w, Math.max(axisX, x - w / 2));
331
331
  return { at, x, text: label, left, y: tickY };
332
332
  });
333
333
  layout.minor = minorTicks(count, majors.step, unit, majors.at);
334
- let bottom = tickY + _chunk5OQV42W3cjs.TYPE.timeTick.size * 0.2;
334
+ let bottom = tickY + _chunkSUL4AJLIcjs.TYPE.timeTick.size * 0.2;
335
335
  if (spec.period) {
336
336
  const P = spec.period;
337
337
  const list = [];
@@ -342,9 +342,9 @@ function layoutTime(diagram, lang = "ja") {
342
342
  const range = `${scale.unit} ${text.range(String(first), String((_nullishCoalesce(scale.from, () => ( 0))) + to))}`;
343
343
  list.push({ index, from, to, name, range, x: axisX + from * unit, y: axisLine, w: (to - from + 1) * unit, h: 0, nameY: tickY, rangeY: tickY + T.rangeY });
344
344
  }
345
- const tickRects = layout.ticks.map((t) => _chunk5OQV42W3cjs.textBox.call(void 0, t.text, t.left, t.y, _chunk5OQV42W3cjs.TYPE.timeTick));
345
+ const tickRects = layout.ticks.map((t) => _chunkSUL4AJLIcjs.textBox.call(void 0, t.text, t.left, t.y, _chunkSUL4AJLIcjs.TYPE.timeTick));
346
346
  const clash = list.some((p) => {
347
- const r = _chunk5OQV42W3cjs.textBox.call(void 0, p.name, p.x + p.w / 2, p.nameY, _chunk5OQV42W3cjs.TYPE.timePeriod, "middle");
347
+ const r = _chunkSUL4AJLIcjs.textBox.call(void 0, p.name, p.x + p.w / 2, p.nameY, _chunkSUL4AJLIcjs.TYPE.timePeriod, "middle");
348
348
  return tickRects.some((t) => r.x < t.x + t.w + T.nameGap && t.x < r.x + r.w + T.nameGap);
349
349
  });
350
350
  for (const p of list) {
@@ -352,14 +352,14 @@ function layoutTime(diagram, lang = "ja") {
352
352
  p.nameY = tickY + T.rangeY + 2;
353
353
  p.rangeY = p.nameY + T.rangeY;
354
354
  }
355
- p.h = p.rangeY + _chunk5OQV42W3cjs.TYPE.timeRange.size * 0.2 - axisLine;
355
+ p.h = p.rangeY + _chunkSUL4AJLIcjs.TYPE.timeRange.size * 0.2 - axisLine;
356
356
  }
357
357
  layout.periods = list;
358
- bottom = Math.max(bottom, ...list.map((p) => p.rangeY + _chunk5OQV42W3cjs.TYPE.timeRange.size * 0.2));
358
+ bottom = Math.max(bottom, ...list.map((p) => p.rangeY + _chunkSUL4AJLIcjs.TYPE.timeRange.size * 0.2));
359
359
  }
360
360
  const axisBottom = bottom + T.bottom;
361
361
  regions.push({ id: "axis", lines: [], color: "slate", x: margin, y: axisTop, w: width - margin * 2, h: axisBottom - axisTop, header: { x: margin + R.inset, y: axisTop + R.inset, w: 0, h: 0 } });
362
- const strip = _chunk5OQV42W3cjs.layoutStrip.call(void 0, diagram, margin, axisBottom + gap, width - margin * 2);
362
+ const strip = _chunkSUL4AJLIcjs.layoutStrip.call(void 0, diagram, margin, axisBottom + gap, width - margin * 2);
363
363
  if (strip) layout.strip = strip;
364
364
  layout.height = (strip ? strip.y + strip.h : axisBottom) + margin;
365
365
  layout.badges = badgesOf(diagram, layout, needleSteps(diagram));
@@ -378,7 +378,7 @@ function wire(event, zoom) {
378
378
  const down = jt > jf;
379
379
  if (fromColumn === toColumn) {
380
380
  if (Math.abs(jt - jf) === 1) return { from, to, points: [[from.cx, down ? from.y + from.h + 1 : from.y - 1], [to.cx, down ? to.y - 1 : to.y + to.h + 1]] };
381
- const lane = Math.min(fromColumn.x + fromColumn.w - _chunk5OQV42W3cjs.LOOK.gap, Math.max(from.x + from.w, to.x + to.w) + _chunk5OQV42W3cjs.LOOK.gap);
381
+ const lane = Math.min(fromColumn.x + fromColumn.w - _chunkSUL4AJLIcjs.LOOK.gap, Math.max(from.x + from.w, to.x + to.w) + _chunkSUL4AJLIcjs.LOOK.gap);
382
382
  return {
383
383
  from,
384
384
  to,
@@ -398,18 +398,18 @@ function wire(event, zoom) {
398
398
  }
399
399
  function seat(edge, from, to, rooms) {
400
400
  const arrive = { ...edge };
401
- _chunk5OQV42W3cjs.seatCarriers.call(void 0, [arrive], /* @__PURE__ */ new Map([[edge.to, to]]), rooms);
401
+ _chunkSUL4AJLIcjs.seatCarriers.call(void 0, [arrive], /* @__PURE__ */ new Map([[edge.to, to]]), rooms);
402
402
  const leave = { ...edge };
403
- _chunk5OQV42W3cjs.seatCarriers.call(void 0, [leave], /* @__PURE__ */ new Map([[edge.from, from]]), rooms);
403
+ _chunkSUL4AJLIcjs.seatCarriers.call(void 0, [leave], /* @__PURE__ */ new Map([[edge.from, from]]), rooms);
404
404
  if (arrive.settle) edge.settle = arrive.settle;
405
405
  if (leave.wait) edge.wait = leave.wait;
406
406
  }
407
407
  function badgesOf(diagram, layout, needle) {
408
- const { r, inset } = _chunk5OQV42W3cjs.LOOK.badge;
408
+ const { r, inset } = _chunkSUL4AJLIcjs.LOOK.badge;
409
409
  const { axis } = layout;
410
410
  const taken = [];
411
411
  const out = [];
412
- const top = Math.min(...layout.rows.map((row) => row.y), layout.needle.y1 + _chunk5OQV42W3cjs.LOOK.time.needle.over);
412
+ const top = Math.min(...layout.rows.map((row) => row.y), layout.needle.y1 + _chunkSUL4AJLIcjs.LOOK.time.needle.over);
413
413
  const bottom = Math.max(...layout.rows.map((row) => row.y + row.h), top);
414
414
  const between = layout.points[0] ? (bottom + layout.points[0].cy - layout.points[0].r) / 2 : bottom + r + inset;
415
415
  diagram.steps.forEach((step, s) => {
@@ -421,7 +421,7 @@ function badgesOf(diagram, layout, needle) {
421
421
  if (edge) {
422
422
  const waits = edge.carry.kind !== "none" && !edge.wait ? [edge.points[0]] : [];
423
423
  const others = layout.edges.filter((e) => e !== edge).map((e) => e.points);
424
- push(_chunk5OQV42W3cjs.badgeOnPath.call(void 0, edge.points, [...taken, ...waits], others), edge.color);
424
+ push(_chunkSUL4AJLIcjs.badgeOnPath.call(void 0, edge.points, [...taken, ...waits], others), edge.color);
425
425
  return;
426
426
  }
427
427
  const [from, to] = _nullishCoalesce(needle[s], () => ( [0, 0]));
@@ -446,10 +446,10 @@ function badgesOf(diagram, layout, needle) {
446
446
  const before = out[out.length - 1];
447
447
  out.push(before ? { ...before, step: s } : { step: s, x: axis.x - r - inset, y: top, color: "slate" });
448
448
  });
449
- return _chunk5OQV42W3cjs.replaceSameSpot.call(void 0, out);
449
+ return _chunkSUL4AJLIcjs.replaceSameSpot.call(void 0, out);
450
450
  }
451
451
  function spotOf(event, step, layout) {
452
- const { r, inset } = _chunk5OQV42W3cjs.LOOK.badge;
452
+ const { r, inset } = _chunkSUL4AJLIcjs.LOOK.badge;
453
453
  if (event.type === "span") {
454
454
  const span = layout.spans.find((x) => x.step === step && x.from === event.from && x.to === event.to && x.text === event.text);
455
455
  if (!span) return void 0;
@@ -471,14 +471,14 @@ function labelsOf(diagram, layout) {
471
471
  const labels = [];
472
472
  const circles = layout.points.map((p) => ({ x: p.cx - p.r, y: p.cy - p.r, w: p.r * 2, h: p.r * 2 }));
473
473
  const texts = layout.points.map((p) => p.text);
474
- const heads = (_nullishCoalesce(_optionalChain([layout, 'access', _24 => _24.zoom, 'optionalAccess', _25 => _25.columns]), () => ( []))).map((c) => _chunk5OQV42W3cjs.textBox.call(void 0, c.head, c.x + c.w / 2, _nullishCoalesce(_optionalChain([layout, 'access', _26 => _26.zoom, 'optionalAccess', _27 => _27.headY]), () => ( 0)), _chunk5OQV42W3cjs.TYPE.timeHead, "middle"));
474
+ const heads = (_nullishCoalesce(_optionalChain([layout, 'access', _24 => _24.zoom, 'optionalAccess', _25 => _25.columns]), () => ( []))).map((c) => _chunkSUL4AJLIcjs.textBox.call(void 0, c.head, c.x + c.w / 2, _nullishCoalesce(_optionalChain([layout, 'access', _26 => _26.zoom, 'optionalAccess', _27 => _27.headY]), () => ( 0)), _chunkSUL4AJLIcjs.TYPE.timeHead, "middle"));
475
475
  for (const edge of layout.edges) {
476
476
  const source = _optionalChain([diagram, 'access', _28 => _28.steps, 'access', _29 => _29[edge.step], 'optionalAccess', _30 => _30.events, 'access', _31 => _31[edge.event]]);
477
477
  if (_optionalChain([source, 'optionalAccess', _32 => _32.type]) !== "edge" || source.label === void 0) continue;
478
- const seen = layout.badges.filter((b) => b.step <= edge.step).map((b) => _chunk5OQV42W3cjs.badgeRect.call(void 0, [b.x, b.y]));
478
+ const seen = layout.badges.filter((b) => b.step <= edge.step).map((b) => _chunkSUL4AJLIcjs.badgeRect.call(void 0, [b.x, b.y]));
479
479
  const side = _nullishCoalesce(source.labelSide, () => ( (source.at === void 0 ? "below" : void 0)));
480
480
  labels.push(
481
- _chunk5OQV42W3cjs.placeLabel.call(void 0,
481
+ _chunkSUL4AJLIcjs.placeLabel.call(void 0,
482
482
  { step: edge.step, event: edge.event, text: source.label, points: edge.points, color: edge.color, ...side ? { side } : {}, flip: source.at !== void 0 },
483
483
  { hard: [...circles, ...layout.boxes], soft: [...texts, ...heads, ...labels.filter((l) => l.step === edge.step)], touch: seen }
484
484
  )
@@ -489,7 +489,7 @@ function labelsOf(diagram, layout) {
489
489
 
490
490
  // src/render/time.ts
491
491
  var r1 = (v) => Math.round(v * 100) / 100;
492
- var ja = (cls, text) => _chunk5OQV42W3cjs.hasWide.call(void 0, text) ? `${cls} ${cls}j` : cls;
492
+ var ja = (cls, text) => _chunkSUL4AJLIcjs.hasWide.call(void 0, text) ? `${cls} ${cls}j` : cls;
493
493
  function simplify(keys) {
494
494
  const out = [];
495
495
  for (const key of keys) {
@@ -517,7 +517,7 @@ function valueAt(keys, t) {
517
517
  }
518
518
  function drawTime(layout, diagram, timeline, ctx, subs) {
519
519
  const { m, ink } = ctx;
520
- const T = _chunk5OQV42W3cjs.LOOK.time;
520
+ const T = _chunkSUL4AJLIcjs.LOOK.time;
521
521
  const { axis } = layout;
522
522
  const passed = new Map((_nullishCoalesce(timeline.units, () => ( []))).map((u) => [u.unit, u.passed]));
523
523
  const at = (step, event) => _optionalChain([timeline, 'access', _33 => _33.events, 'access', _34 => _34.find, 'call', _35 => _35((t) => t.step === step && t.event === event), 'optionalAccess', _36 => _36.at]);
@@ -543,20 +543,20 @@ function drawTime(layout, diagram, timeline, ctx, subs) {
543
543
  const z = layout.zoom;
544
544
  z.columns.forEach((c, k) => {
545
545
  if (k > 0) base.push(`<line class="dg-tm-sep" x1="${r1(c.x)}" y1="${r1(c.y + T.sep)}" x2="${r1(c.x)}" y2="${r1(c.y + c.h - T.sep)}"/>`);
546
- base.push(_chunkJCEKXALJcjs.write.call(void 0, ink, ja("dg-tm-hd", c.head), c.x + c.w / 2, z.headY, c.head, _chunk5OQV42W3cjs.TYPE.timeHead, _chunkJCEKXALJcjs.ALWAYS, "middle"));
546
+ base.push(_chunkV34DCH34cjs.write.call(void 0, ink, ja("dg-tm-hd", c.head), c.x + c.w / 2, z.headY, c.head, _chunkSUL4AJLIcjs.TYPE.timeHead, _chunkV34DCH34cjs.ALWAYS, "middle"));
547
547
  for (const box of c.boxes) node.push(columnBox(box, c.unit));
548
548
  });
549
549
  }
550
550
  function columnBox(box, unit) {
551
551
  const on = [...new Set(layout.wires.filter((w) => w.from === box || w.to === box).map((w) => w.step))].sort((a, b) => a - b);
552
- const frame = (cls) => `<rect class="${cls}" x="${r1(box.x)}" y="${r1(box.y)}" width="${r1(box.w)}" height="${box.h}" rx="${_chunk5OQV42W3cjs.LOOK.box.radius}"/>`;
552
+ const frame = (cls) => `<rect class="${cls}" x="${r1(box.x)}" y="${r1(box.y)}" width="${r1(box.w)}" height="${box.h}" rx="${_chunkSUL4AJLIcjs.LOOK.box.radius}"/>`;
553
553
  if (box.empty) {
554
554
  const shown2 = passed.get(unit);
555
555
  const word = _nullishCoalesce(_optionalChain([layout, 'access', _48 => _48.zoom, 'optionalAccess', _49 => _49.empty]), () => ( ""));
556
- const mark = shown2 === void 0 ? "" : `<g class="dg-a" style="${m.vis(shown2)}">${frame("dg-tm-ex")}${_chunkJCEKXALJcjs.write.call(void 0, ink, "dg-tm-ext", box.cx, box.cy + _chunk5OQV42W3cjs.LOOK.baseline.mark, word, _chunk5OQV42W3cjs.TYPE.emptyText, [[shown2, Number.POSITIVE_INFINITY]], "middle")}</g>`;
557
- return `<g data-empty="${_chunkJCEKXALJcjs.esc.call(void 0, box.id)}">${frame("dg-tm-ph")}${mark}</g>`;
556
+ const mark = shown2 === void 0 ? "" : `<g class="dg-a" style="${m.vis(shown2)}">${frame("dg-tm-ex")}${_chunkV34DCH34cjs.write.call(void 0, ink, "dg-tm-ext", box.cx, box.cy + _chunkSUL4AJLIcjs.LOOK.baseline.mark, word, _chunkSUL4AJLIcjs.TYPE.emptyText, [[shown2, Number.POSITIVE_INFINITY]], "middle")}</g>`;
557
+ return `<g data-empty="${_chunkV34DCH34cjs.esc.call(void 0, box.id)}">${frame("dg-tm-ph")}${mark}</g>`;
558
558
  }
559
- const drawn = _chunkJCEKXALJcjs.linkTo.call(void 0, _optionalChain([diagram, 'access', _50 => _50.boxes, 'access', _51 => _51.find, 'call', _52 => _52((b) => b.id === box.id), 'optionalAccess', _53 => _53.link]), _chunkJCEKXALJcjs.card.call(void 0, box, ctx, on, _nullishCoalesce(subs.get(box.id), () => ( []))));
559
+ const drawn = _chunkV34DCH34cjs.linkTo.call(void 0, _optionalChain([diagram, 'access', _50 => _50.boxes, 'access', _51 => _51.find, 'call', _52 => _52((b) => b.id === box.id), 'optionalAccess', _53 => _53.link]), _chunkV34DCH34cjs.card.call(void 0, box, ctx, on, _nullishCoalesce(subs.get(box.id), () => ( []))));
560
560
  if (!box.row) return drawn;
561
561
  const shown = filled(box.row, unit);
562
562
  if (shown === void 0) return frame("dg-tm-ph");
@@ -579,16 +579,16 @@ function drawTime(layout, diagram, timeline, ctx, subs) {
579
579
  if (t === void 0) return;
580
580
  const next = mark.colors[k + 1];
581
581
  const until = next ? at(next.step, next.event) : void 0;
582
- parts.push(`<g style="${_chunkJCEKXALJcjs.cs.call(void 0, c.color)}">${rect("dg-tm-m dg-a", ` style="${m.vis(t, _nullishCoalesce(until, () => ( m.last)), { f: 0.35 })}"`)}</g>`);
582
+ parts.push(`<g style="${_chunkV34DCH34cjs.cs.call(void 0, c.color)}">${rect("dg-tm-m dg-a", ` style="${m.vis(t, _nullishCoalesce(until, () => ( m.last)), { f: 0.35 })}"`)}</g>`);
583
583
  });
584
584
  }
585
- base.push(`<g data-row="${_chunkJCEKXALJcjs.esc.call(void 0, row.id)}" style="${_chunkJCEKXALJcjs.cs.call(void 0, row.color)}">${parts.join("")}</g>`);
586
- base.push(_chunkJCEKXALJcjs.write.call(void 0, ink, "dg-tm-rn", _chunk5OQV42W3cjs.LOOK.margin + _chunk5OQV42W3cjs.LOOK.region.inset, row.y + row.h / 2 + _chunk5OQV42W3cjs.LOOK.baseline.mark, row.name, _chunk5OQV42W3cjs.TYPE.timeRow));
585
+ base.push(`<g data-row="${_chunkV34DCH34cjs.esc.call(void 0, row.id)}" style="${_chunkV34DCH34cjs.cs.call(void 0, row.color)}">${parts.join("")}</g>`);
586
+ base.push(_chunkV34DCH34cjs.write.call(void 0, ink, "dg-tm-rn", _chunkSUL4AJLIcjs.LOOK.margin + _chunkSUL4AJLIcjs.LOOK.region.inset, row.y + row.h / 2 + _chunkSUL4AJLIcjs.LOOK.baseline.mark, row.name, _chunkSUL4AJLIcjs.TYPE.timeRow));
587
587
  }
588
588
  if (layout.zoom) {
589
589
  const z = layout.zoom;
590
590
  const hide = layout.spans.filter((s) => s.kind === "box" && s.from <= z.to && z.from <= s.to).map((s) => at(s.step, s.event)).filter((t) => t !== void 0).sort((a, b) => a - b)[0];
591
- const guides = z.guides.map((g) => `<path class="dg-tm-gd" d="${_chunkJCEKXALJcjs.pathOf.call(void 0, g)}"/>`).join("");
591
+ const guides = z.guides.map((g) => `<path class="dg-tm-gd" d="${_chunkV34DCH34cjs.pathOf.call(void 0, g)}"/>`).join("");
592
592
  const lens = `<rect class="dg-tm-fr" x="${r1(z.frame.x)}" y="${r1(z.frame.y)}" width="${r1(z.frame.w)}" height="${r1(z.frame.h)}" rx="4"/>${guides}`;
593
593
  base.push(hide === void 0 ? lens : `<g class="dg-a" style="${m.until(hide)}">${lens}</g>`);
594
594
  }
@@ -596,10 +596,10 @@ function drawTime(layout, diagram, timeline, ctx, subs) {
596
596
  const majors = layout.ticks.map((t) => `M ${x(t.at)} ${r1(axis.line - T.major / 2)} V ${r1(axis.line + T.major / 2)}`);
597
597
  const minors = layout.minor.map((u) => `M ${x(u)} ${r1(axis.line - T.minor / 2)} V ${r1(axis.line + T.minor / 2)}`);
598
598
  base.push(`<path class="dg-tm-ax" d="M ${x(0)} ${r1(axis.line)} H ${x(axis.count)} ${[...majors, ...minors].join(" ")}"/>`);
599
- for (const t of layout.ticks) base.push(_chunkJCEKXALJcjs.write.call(void 0, ink, ja("dg-tm-tk", t.text), t.left, t.y, t.text, _chunk5OQV42W3cjs.TYPE.timeTick));
599
+ for (const t of layout.ticks) base.push(_chunkV34DCH34cjs.write.call(void 0, ink, ja("dg-tm-tk", t.text), t.left, t.y, t.text, _chunkSUL4AJLIcjs.TYPE.timeTick));
600
600
  for (const p of layout.periods) {
601
- base.push(_chunkJCEKXALJcjs.write.call(void 0, ink, ja("dg-tm-en", p.name), p.x + p.w / 2, p.nameY, p.name, _chunk5OQV42W3cjs.TYPE.timePeriod, _chunkJCEKXALJcjs.ALWAYS, "middle"));
602
- base.push(_chunkJCEKXALJcjs.write.call(void 0, ink, ja("dg-tm-er", p.range), p.x + p.w / 2, p.rangeY, p.range, _chunk5OQV42W3cjs.TYPE.timeRange, _chunkJCEKXALJcjs.ALWAYS, "middle"));
601
+ base.push(_chunkV34DCH34cjs.write.call(void 0, ink, ja("dg-tm-en", p.name), p.x + p.w / 2, p.nameY, p.name, _chunkSUL4AJLIcjs.TYPE.timePeriod, _chunkV34DCH34cjs.ALWAYS, "middle"));
602
+ base.push(_chunkV34DCH34cjs.write.call(void 0, ink, ja("dg-tm-er", p.range), p.x + p.w / 2, p.rangeY, p.range, _chunkSUL4AJLIcjs.TYPE.timeRange, _chunkV34DCH34cjs.ALWAYS, "middle"));
603
603
  }
604
604
  for (const span of layout.spans) {
605
605
  const a = at(span.step, span.event);
@@ -609,15 +609,15 @@ function drawTime(layout, diagram, timeline, ctx, subs) {
609
609
  const vis = until === void 0 ? m.vis(a) : m.vis(a, until, { within: true });
610
610
  if (span.kind === "bracket") {
611
611
  const [x0, x1, y0, y12] = [r1(span.x + 1), r1(span.x + span.w - 1), r1(span.y), r1(span.y + span.h)];
612
- const words = _chunkJCEKXALJcjs.write.call(void 0, ink, ja("dg-tm-bt", span.text), span.textRect.x + span.textRect.w / 2, span.textY, span.text, _chunk5OQV42W3cjs.TYPE.spanText, shown, "middle");
613
- base.push(`<g class="dg-a" data-span="${span.step}" style="${_chunkJCEKXALJcjs.cs.call(void 0, span.color)};${vis}"><path class="dg-tm-br" d="M ${x0} ${y0} L ${x0} ${y12} L ${x1} ${y12} L ${x1} ${y0}"/>${words}</g>`);
612
+ const words = _chunkV34DCH34cjs.write.call(void 0, ink, ja("dg-tm-bt", span.text), span.textRect.x + span.textRect.w / 2, span.textY, span.text, _chunkSUL4AJLIcjs.TYPE.spanText, shown, "middle");
613
+ base.push(`<g class="dg-a" data-span="${span.step}" style="${_chunkV34DCH34cjs.cs.call(void 0, span.color)};${vis}"><path class="dg-tm-br" d="M ${x0} ${y0} L ${x0} ${y12} L ${x1} ${y12} L ${x1} ${y0}"/>${words}</g>`);
614
614
  continue;
615
615
  }
616
- base.push(`<g class="dg-a" data-span="${span.step}" style="${_chunkJCEKXALJcjs.cs.call(void 0, span.color)};${vis}"><rect class="dg-tm-bx" x="${r1(span.x)}" y="${r1(span.y)}" width="${r1(span.w)}" height="${r1(span.h)}" rx="6"/></g>`);
616
+ base.push(`<g class="dg-a" data-span="${span.step}" style="${_chunkV34DCH34cjs.cs.call(void 0, span.color)};${vis}"><rect class="dg-tm-bx" x="${r1(span.x)}" y="${r1(span.y)}" width="${r1(span.w)}" height="${r1(span.h)}" rx="6"/></g>`);
617
617
  const tag = span.textRect;
618
618
  ink.push({ text: span.text, rect: tag, shown, boxed: true });
619
619
  top.push(
620
- `<g class="dg-tg dg-popc dg-a" style="${_chunkJCEKXALJcjs.cs.call(void 0, span.color)};${until === void 0 ? m.pop(a) : m.pop(a, until)}"><rect x="${r1(tag.x)}" y="${r1(tag.y)}" width="${r1(tag.w)}" height="${tag.h}" rx="${tag.h / 2}"/><text x="${r1(tag.x + tag.w / 2)}" y="${r1(span.textY)}" text-anchor="middle">${_chunkJCEKXALJcjs.esc.call(void 0, span.text)}</text></g>`
620
+ `<g class="dg-tg dg-popc dg-a" style="${_chunkV34DCH34cjs.cs.call(void 0, span.color)};${until === void 0 ? m.pop(a) : m.pop(a, until)}"><rect x="${r1(tag.x)}" y="${r1(tag.y)}" width="${r1(tag.w)}" height="${tag.h}" rx="${tag.h / 2}"/><text x="${r1(tag.x + tag.w / 2)}" y="${r1(span.textY)}" text-anchor="middle">${_chunkV34DCH34cjs.esc.call(void 0, span.text)}</text></g>`
621
621
  );
622
622
  }
623
623
  const P = T.point;
@@ -627,23 +627,23 @@ function drawTime(layout, diagram, timeline, ctx, subs) {
627
627
  const first = times[0];
628
628
  base.push(`<path class="dg-tm-con" d="M ${r1(cx)} ${r1(rowsBottom + 3)} L ${r1(cx)} ${r1(cy - r - 2)}"/>`);
629
629
  const tx = point.text.x;
630
- const name = _chunkJCEKXALJcjs.write.call(void 0, ink, ja("dg-tm-pn", point.id), tx, cy + P.nameY, point.id, _chunk5OQV42W3cjs.TYPE.pointName);
630
+ const name = _chunkV34DCH34cjs.write.call(void 0, ink, ja("dg-tm-pn", point.id), tx, cy + P.nameY, point.id, _chunkSUL4AJLIcjs.TYPE.pointName);
631
631
  const grey = name.replace(/class="([^"]*)"/u, 'class="$1 dg-tm-pn-g"');
632
632
  const label = first === void 0 || !Number.isFinite(first) ? grey : `<g class="dg-a" style="${m.until(first)}">${grey}</g><g class="dg-a" style="${m.vis(first)}">${name}</g>`;
633
633
  const states = point.changes.map((c, k) => {
634
634
  const t = times[k];
635
635
  if (!Number.isFinite(t)) return "";
636
636
  const next = times[k + 1];
637
- const end2 = next !== void 0 && Number.isFinite(next) ? next - _chunk5OQV42W3cjs.MOTION.untilFade : void 0;
638
- const words = _chunkJCEKXALJcjs.write.call(void 0, ink, ja("dg-tm-ps", c.text), tx, cy + P.stateY, c.text, _chunk5OQV42W3cjs.TYPE.pointState, [[t, _nullishCoalesce(end2, () => ( Number.POSITIVE_INFINITY))]]);
639
- return `<g class="dg-a" style="${_chunkJCEKXALJcjs.cs.call(void 0, _nullishCoalesce(c.color, () => ( "slate")))};${end2 === void 0 ? m.rise(t) : m.rise(t, end2)}">${words}</g>`;
637
+ const end2 = next !== void 0 && Number.isFinite(next) ? next - _chunkSUL4AJLIcjs.MOTION.untilFade : void 0;
638
+ const words = _chunkV34DCH34cjs.write.call(void 0, ink, ja("dg-tm-ps", c.text), tx, cy + P.stateY, c.text, _chunkSUL4AJLIcjs.TYPE.pointState, [[t, _nullishCoalesce(end2, () => ( Number.POSITIVE_INFINITY))]]);
639
+ return `<g class="dg-a" style="${_chunkV34DCH34cjs.cs.call(void 0, _nullishCoalesce(c.color, () => ( "slate")))};${end2 === void 0 ? m.rise(t) : m.rise(t, end2)}">${words}</g>`;
640
640
  }).join("");
641
641
  const rings = point.changes.map((c, k) => {
642
642
  const t = times[k];
643
643
  if (!c.color || !Number.isFinite(t)) return "";
644
- return `<g class="dg-popc dg-a" style="${_chunkJCEKXALJcjs.cs.call(void 0, c.color)};${m.pop(t)}"><circle class="dg-tm-pc" cx="${r1(cx)}" cy="${r1(cy)}" r="${r + 0.5}"/>${_chunkJCEKXALJcjs.glyph.call(void 0, "flag", cx, cy, P.glyph, "dg-tm-pcg")}</g>`;
644
+ return `<g class="dg-popc dg-a" style="${_chunkV34DCH34cjs.cs.call(void 0, c.color)};${m.pop(t)}"><circle class="dg-tm-pc" cx="${r1(cx)}" cy="${r1(cy)}" r="${r + 0.5}"/>${_chunkV34DCH34cjs.glyph.call(void 0, "flag", cx, cy, P.glyph, "dg-tm-pcg")}</g>`;
645
645
  }).join("");
646
- node.push(`<g data-point="${_chunkJCEKXALJcjs.esc.call(void 0, point.id)}"><circle class="dg-tm-pg" cx="${r1(cx)}" cy="${r1(cy)}" r="${r}"/>${_chunkJCEKXALJcjs.glyph.call(void 0, "flag", cx, cy, P.glyph, "dg-tm-pgl")}${rings}${label}${states}</g>`);
646
+ node.push(`<g data-point="${_chunkV34DCH34cjs.esc.call(void 0, point.id)}"><circle class="dg-tm-pg" cx="${r1(cx)}" cy="${r1(cy)}" r="${r}"/>${_chunkV34DCH34cjs.glyph.call(void 0, "flag", cx, cy, P.glyph, "dg-tm-pgl")}${rings}${label}${states}</g>`);
647
647
  }
648
648
  const wired = new Set(layout.wires.map((w) => `${w.step}/${w.event}`));
649
649
  for (const e of layout.edges) {
@@ -653,20 +653,20 @@ function drawTime(layout, diagram, timeline, ctx, subs) {
653
653
  ctx.traces.push({ from: e.from, to: e.to, points: e.points, shown: [[time.start, Number.POSITIVE_INFINITY]] });
654
654
  const kf = m.kf([
655
655
  [0, { opacity: 0, "stroke-dashoffset": 1 }],
656
- [time.start, { opacity: 0, "stroke-dashoffset": 1 }, _chunk5OQV42W3cjs.EASE.inOut],
656
+ [time.start, { opacity: 0, "stroke-dashoffset": 1 }, _chunkSUL4AJLIcjs.EASE.inOut],
657
657
  [time.start + 0.05, { opacity: 1 }],
658
658
  [time.drawn, { "stroke-dashoffset": 0 }],
659
- [m.last, { opacity: 1, "stroke-dashoffset": 0 }, _chunk5OQV42W3cjs.EASE.inOut],
659
+ [m.last, { opacity: 1, "stroke-dashoffset": 0 }, _chunkSUL4AJLIcjs.EASE.inOut],
660
660
  [m.total, { opacity: 0, "stroke-dashoffset": 0 }]
661
661
  ]);
662
662
  const head = m.kf([
663
663
  [0, { opacity: 0 }],
664
664
  [time.drawn - 0.05, { opacity: 0 }],
665
665
  [time.drawn, { opacity: 1 }],
666
- [m.last, { opacity: 1 }, _chunk5OQV42W3cjs.EASE.inOut],
666
+ [m.last, { opacity: 1 }, _chunkSUL4AJLIcjs.EASE.inOut],
667
667
  [m.total, { opacity: 0 }]
668
668
  ]);
669
- lit.push(`<g data-link="${_chunkJCEKXALJcjs.esc.call(void 0, `${e.from}->${e.to}`)}" style="${_chunkJCEKXALJcjs.cs.call(void 0, e.color)}"><path class="dg-tm-ln dg-a" pathLength="1" d="${_chunkJCEKXALJcjs.pathOf.call(void 0, e.points)}" style="${kf}"/><path class="dg-eh-on dg-a" d="${_chunkJCEKXALJcjs.arrowHead.call(void 0, e.points)}" style="${head}"/></g>`);
669
+ lit.push(`<g data-link="${_chunkV34DCH34cjs.esc.call(void 0, `${e.from}->${e.to}`)}" style="${_chunkV34DCH34cjs.cs.call(void 0, e.color)}"><path class="dg-tm-ln dg-a" pathLength="1" d="${_chunkV34DCH34cjs.pathOf.call(void 0, e.points)}" style="${kf}"/><path class="dg-eh-on dg-a" d="${_chunkV34DCH34cjs.arrowHead.call(void 0, e.points)}" style="${head}"/></g>`);
670
670
  }
671
671
  const keys = _nullishCoalesce(timeline.needle, () => ( []));
672
672
  const moved = simplify(keys.filter(([t]) => t < m.total));
@@ -681,27 +681,29 @@ function drawTime(layout, diagram, timeline, ctx, subs) {
681
681
  }
682
682
  function meterField(field, keys, ctx) {
683
683
  const { m } = ctx;
684
- const M = _chunk5OQV42W3cjs.LOOK.time.meter;
684
+ const M = _chunkSUL4AJLIcjs.LOOK.time.meter;
685
685
  const { x, w, line, text } = field.meter;
686
686
  const y = field.y + M.y;
687
687
  const kf = m.kf([
688
688
  ...simplify(keys).map(([t, v]) => [t, { transform: `scaleX(${r1(v * 1e3) / 1e3})` }]),
689
- [m.last, { transform: `scaleX(${r1(valueAt(keys, m.last) * 1e3) / 1e3})` }, _chunk5OQV42W3cjs.EASE.inOut],
689
+ [m.last, { transform: `scaleX(${r1(valueAt(keys, m.last) * 1e3) / 1e3})` }, _chunkSUL4AJLIcjs.EASE.inOut],
690
690
  [m.total, { transform: "scaleX(0)" }]
691
691
  ]);
692
692
  const lx = x + w * line;
693
- return `<rect class="dg-tm-mt" x="${r1(x)}" y="${r1(y)}" width="${r1(w)}" height="${M.h}" rx="${M.h / 2}"/><rect class="dg-tm-mf dg-a" x="${r1(x)}" y="${r1(y)}" width="${r1(w)}" height="${M.h}" rx="${M.h / 2}" style="${_chunkJCEKXALJcjs.cs.call(void 0, M.color)};${kf}"/><line class="dg-tm-mk" x1="${r1(lx)}" y1="${r1(y - M.mark)}" x2="${r1(lx)}" y2="${r1(y + M.h + M.mark)}"/>` + _chunkJCEKXALJcjs.write.call(void 0, ctx.ink, "dg-tm-ml", lx, field.y + M.textY, text, _chunk5OQV42W3cjs.TYPE.meterLine, _chunkJCEKXALJcjs.ALWAYS, "middle");
693
+ return `<rect class="dg-tm-mt" x="${r1(x)}" y="${r1(y)}" width="${r1(w)}" height="${M.h}" rx="${M.h / 2}"/><rect class="dg-tm-mf dg-a" x="${r1(x)}" y="${r1(y)}" width="${r1(w)}" height="${M.h}" rx="${M.h / 2}" style="${_chunkV34DCH34cjs.cs.call(void 0, M.color)};${kf}"/><line class="dg-tm-mk" x1="${r1(lx)}" y1="${r1(y - M.mark)}" x2="${r1(lx)}" y2="${r1(y + M.h + M.mark)}"/>` + _chunkV34DCH34cjs.write.call(void 0, ctx.ink, "dg-tm-ml", lx, field.y + M.textY, text, _chunkSUL4AJLIcjs.TYPE.meterLine, _chunkV34DCH34cjs.ALWAYS, "middle");
694
694
  }
695
695
  function timeFocus(layout, timeline, step, parts, vw, vh) {
696
696
  const span = timeline.steps[step];
697
- const position = valueAt(_nullishCoalesce(timeline.needle, () => ( [])), span.end - _chunk5OQV42W3cjs.MOTION.still);
698
- const nx = layout.axis.x + position * layout.axis.unit;
697
+ const position = valueAt(_nullishCoalesce(timeline.needle, () => ( [])), span.end - _chunkSUL4AJLIcjs.MOTION.still);
698
+ const badge = layout.badges.find((b) => b.step === step);
699
+ const anchored = badge && valueAt(_nullishCoalesce(timeline.needle, () => ( [])), span.start) === position && !(layout.strip && badge.y >= layout.strip.y);
700
+ const ax = anchored ? badge.x : layout.axis.x + position * layout.axis.unit;
699
701
  const top = Math.min(...layout.rows.map((r) => r.y));
700
702
  const bottom = Math.max(...layout.rows.map((r) => r.y + r.h));
701
- let held = { x: nx - 1, y: top, w: 2, h: bottom - top };
702
- const badge = layout.badges.find((b) => b.step === step);
703
- const near = (p) => Math.hypot(Math.max(0, p.x - nx, nx - p.x - p.w), Math.max(0, p.y - top, top - p.y - p.h));
704
- const extra = [...badge ? [{ x: badge.x - _chunk5OQV42W3cjs.LOOK.badge.r, y: badge.y - _chunk5OQV42W3cjs.LOOK.badge.r, w: _chunk5OQV42W3cjs.LOOK.badge.r * 2, h: _chunk5OQV42W3cjs.LOOK.badge.r * 2 }] : [], ...[...parts].sort((a, b) => near(a) - near(b))];
703
+ let held = { x: ax - 1, y: top, w: 2, h: bottom - top };
704
+ const near = (p) => Math.hypot(Math.max(0, p.x - ax, ax - p.x - p.w), Math.max(0, p.y - top, top - p.y - p.h));
705
+ const changed = layout.points.filter((point) => point.changes.some((change) => change.step === step)).map((point) => ({ x: point.cx - point.r, y: point.cy - point.r, w: point.text.x + point.text.w - point.cx + point.r, h: point.r * 2 }));
706
+ const extra = [...badge ? [{ x: badge.x - _chunkSUL4AJLIcjs.LOOK.badge.r, y: badge.y - _chunkSUL4AJLIcjs.LOOK.badge.r, w: _chunkSUL4AJLIcjs.LOOK.badge.r * 2, h: _chunkSUL4AJLIcjs.LOOK.badge.r * 2 }] : [], ...[...parts, ...changed].sort((a, b) => near(a) - near(b))];
705
707
  for (const p of extra) {
706
708
  const x = Math.min(held.x, p.x);
707
709
  const y = Math.min(held.y, p.y);
@@ -716,4 +718,4 @@ function timeFocus(layout, timeline, step, parts, vw, vh) {
716
718
 
717
719
 
718
720
  exports.drawTime = drawTime; exports.layoutTime = layoutTime; exports.meterField = meterField; exports.timeFocus = timeFocus;
719
- //# sourceMappingURL=time-PQCPVQOE.cjs.map
721
+ //# sourceMappingURL=time-EXRPI34B.cjs.map