@umriss-ui/schedule 0.53.0 → 0.54.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/schedule.js CHANGED
@@ -1,179 +1,179 @@
1
1
  "use client";
2
2
  import "./schedule.css";
3
- import { localOffset as Ze, toWorkingTimeClamped as z, calendarFrom as St, toWallClock as Zt, MINUTE as Z, DAY as Q, timeStep as Os, workingTimeTicks as $s, inDoubledHour as Fs, HOUR as Jt, LinearScale as Es, resolveColours as Bs, removedIntervals as xs, subscribeTheme as Ns } from "@umriss-ui/charts";
4
- import { useContext as Qt, useEffect as Y, createContext as Je, useRef as U, useId as Qe, useState as ct, useLayoutEffect as bt, useImperativeHandle as Ps, useSyncExternalStore as te, useMemo as X, createElement as Rs } from "react";
3
+ import { localOffset as ht, toWorkingTimeClamped as z, calendarFrom as It, toWallClock as Jt, MINUTE as J, DAY as Q, timeStep as Os, workingTimeTicks as $s, inDoubledHour as Fs, HOUR as Qt, LinearScale as Es, resolveColours as Bs, removedIntervals as xs, subscribeTheme as Ns } from "@umriss-ui/charts";
4
+ import { useContext as te, useEffect as Y, createContext as Je, useRef as U, useId as Qe, useState as ut, useLayoutEffect as Mt, useImperativeHandle as Ps, useSyncExternalStore as ee, useMemo as X, createElement as Rs } from "react";
5
5
  import { jsxs as E, Fragment as ot, jsx as m } from "react/jsx-runtime";
6
- import { zoneFields as ts, zoneInstant as Yt, useWording as rt, useFormats as pt, useTimeZoneLabel as Gs, Skeleton as Hs, AngleGlyph as Ks, VisuallyHidden as Ce, warnOnce as Ys, createLongPress as Vs, zoneDayStart as zs } from "@umriss-ui/core";
7
- function tt(n) {
8
- return { from: n.from - (n.leadIn ?? 0), to: n.to + (n.leadOut ?? 0) };
6
+ import { zoneFields as ts, zoneInstant as Vt, useWording as rt, formatDuration as Gs, useFormats as gt, useTimeZoneLabel as Hs, Skeleton as Ks, AngleGlyph as Ys, VisuallyHidden as De, warnOnce as Vs, createLongPress as zs, zoneDayStart as Ws } from "@umriss-ui/core";
7
+ function tt(s) {
8
+ return { from: s.from - (s.leadIn ?? 0), to: s.to + (s.leadOut ?? 0) };
9
9
  }
10
- function ee(n, t) {
11
- return (n.leaves ?? "leadOut") === "main" ? t.to : t.to + (t.leadOut ?? 0);
10
+ function se(s, t) {
11
+ return (s.leaves ?? "leadOut") === "main" ? t.to : t.to + (t.leadOut ?? 0);
12
12
  }
13
- function se(n, t) {
14
- return (n.arrives ?? "leadIn") === "main" ? t.from : t.from - (t.leadIn ?? 0);
13
+ function ne(s, t) {
14
+ return (s.arrives ?? "leadIn") === "main" ? t.from : t.from - (t.leadIn ?? 0);
15
15
  }
16
- function De(n, t) {
17
- if (t.kind === "place" || t.subtask !== n.id) return n;
16
+ function _e(s, t) {
17
+ if (t.kind === "place" || t.subtask !== s.id) return s;
18
18
  switch (t.kind) {
19
19
  case "move":
20
20
  case "stretch":
21
- return { ...n, from: t.from, to: t.to };
21
+ return { ...s, from: t.from, to: t.to };
22
22
  case "leadIn":
23
- return { ...n, leadIn: t.leadIn };
23
+ return { ...s, leadIn: t.leadIn };
24
24
  case "leadOut":
25
- return { ...n, leadOut: t.leadOut };
25
+ return { ...s, leadOut: t.leadOut };
26
26
  case "lane":
27
- return { ...n, lane: t.lane };
27
+ return { ...s, lane: t.lane };
28
28
  }
29
29
  }
30
- function eo(n, t) {
30
+ function so(s, t) {
31
31
  return {
32
32
  id: t,
33
- task: n.task,
34
- lane: n.lane,
35
- from: n.from,
36
- to: n.to,
37
- ...n.leadIn === void 0 ? {} : { leadIn: n.leadIn },
38
- ...n.leadOut === void 0 ? {} : { leadOut: n.leadOut }
33
+ task: s.task,
34
+ lane: s.lane,
35
+ from: s.from,
36
+ to: s.to,
37
+ ...s.leadIn === void 0 ? {} : { leadIn: s.leadIn },
38
+ ...s.leadOut === void 0 ? {} : { leadOut: s.leadOut }
39
39
  };
40
40
  }
41
- function ne(n) {
41
+ function ie(s) {
42
42
  const t = [], e = /* @__PURE__ */ new Map();
43
- n.forEach((s, i) => {
44
- const { from: o, to: a } = tt(s);
43
+ s.forEach((n, i) => {
44
+ const { from: o, to: a } = tt(n);
45
45
  if (!(o < a)) return;
46
- const r = e.get(s.lane) ?? [];
47
- r.push({ subtask: s, index: i, from: o, to: a }), e.set(s.lane, r);
46
+ const r = e.get(n.lane) ?? [];
47
+ r.push({ subtask: n, index: i, from: o, to: a }), e.set(n.lane, r);
48
48
  });
49
- for (const [s, i] of e) {
49
+ for (const [n, i] of e) {
50
50
  i.sort((o, a) => o.from - a.from || o.index - a.index);
51
51
  for (let o = 0; o < i.length; o++) {
52
52
  const a = i[o];
53
53
  for (let r = o + 1; r < i.length; r++) {
54
54
  const l = i[r];
55
55
  if (l.from >= a.to) break;
56
- t.push({ lane: s, first: a.subtask.id, second: l.subtask.id, from: l.from, to: Math.min(a.to, l.to) });
56
+ t.push({ lane: n, first: a.subtask.id, second: l.subtask.id, from: l.from, to: Math.min(a.to, l.to) });
57
57
  }
58
58
  }
59
59
  }
60
60
  return t;
61
61
  }
62
- function Ws(n) {
62
+ function Us(s) {
63
63
  const t = /* @__PURE__ */ new Map(), e = /* @__PURE__ */ new Map();
64
- for (const s of n) {
65
- const i = tt(s), o = e.get(s.lane) ?? [];
64
+ for (const n of s) {
65
+ const i = tt(n), o = e.get(n.lane) ?? [];
66
66
  let a = 0;
67
67
  if (i.from < i.to) {
68
68
  for (const r of o) i.from < r.to && r.from < i.to && a++;
69
69
  o.push(i);
70
70
  }
71
- e.set(s.lane, o), t.set(s.id, a);
71
+ e.set(n.lane, o), t.set(n.id, a);
72
72
  }
73
73
  return t;
74
74
  }
75
- function ie(n, t) {
76
- const e = new Map(n.map((i) => [i.id, i])), s = [];
75
+ function oe(s, t) {
76
+ const e = new Map(s.map((i) => [i.id, i])), n = [];
77
77
  for (const i of t) {
78
78
  const o = e.get(i.from), a = e.get(i.to);
79
79
  if (o === void 0 || a === void 0) continue;
80
- const r = ee(i, o), l = se(i, a), d = r + i.lag - l;
81
- d > 0 && s.push({ dependency: i.id, departure: r, arrival: l, shortBy: d });
80
+ const r = se(i, o), l = ne(i, a), d = r + i.lag - l;
81
+ d > 0 && n.push({ dependency: i.id, departure: r, arrival: l, shortBy: d });
82
82
  }
83
- return s;
83
+ return n;
84
84
  }
85
- function es(n, t) {
85
+ function es(s, t) {
86
86
  const e = [];
87
- for (const s of n) {
88
- const i = tt(s);
87
+ for (const n of s) {
88
+ const i = tt(n);
89
89
  for (const o of t)
90
- o.lane !== s.lane || !(i.from < o.to && o.from < i.to) || e.push({ subtask: s.id, blocked: o.id, lane: o.lane, from: Math.max(i.from, o.from), to: Math.min(i.to, o.to) });
90
+ o.lane !== n.lane || !(i.from < o.to && o.from < i.to) || e.push({ subtask: n.id, blocked: o.id, lane: o.lane, from: Math.max(i.from, o.from), to: Math.min(i.to, o.to) });
91
91
  }
92
92
  return e;
93
93
  }
94
- function so(n, t, e = []) {
94
+ function no(s, t, e = []) {
95
95
  return {
96
- overlaps: ne(n),
97
- violatedDependencies: ie(n, t),
98
- inBlockedTime: es(n, e)
96
+ overlaps: ie(s),
97
+ violatedDependencies: oe(s, t),
98
+ inBlockedTime: es(s, e)
99
99
  };
100
100
  }
101
- function no(n, t, e) {
101
+ function io(s, t, e) {
102
102
  if (e.kind === "place") return [];
103
- const s = new Map(n.map((l) => [l.id, De(l, e)])), i = /* @__PURE__ */ new Map();
103
+ const n = new Map(s.map((l) => [l.id, _e(l, e)])), i = /* @__PURE__ */ new Map();
104
104
  for (const l of t) {
105
105
  const d = i.get(l.from) ?? [];
106
106
  d.push(l), i.set(l.from, d);
107
107
  }
108
108
  const o = /* @__PURE__ */ new Map(), a = [e.subtask];
109
- let r = (n.length + 1) * (t.length + 1);
109
+ let r = (s.length + 1) * (t.length + 1);
110
110
  for (; a.length > 0 && r-- > 0; ) {
111
- const l = a.shift(), d = s.get(l);
111
+ const l = a.shift(), d = n.get(l);
112
112
  if (d !== void 0)
113
113
  for (const c of i.get(l) ?? []) {
114
114
  if (c.to === e.subtask) continue;
115
- const h = s.get(c.to);
115
+ const h = n.get(c.to);
116
116
  if (h === void 0) continue;
117
- const p = ee(c, d) + c.lag - se(c, h);
117
+ const p = se(c, d) + c.lag - ne(c, h);
118
118
  if (!(p > 0)) continue;
119
119
  const g = { kind: "move", subtask: h.id, from: h.from + p, to: h.to + p };
120
- s.set(h.id, De(h, g)), o.set(h.id, g), a.push(h.id);
120
+ n.set(h.id, _e(h, g)), o.set(h.id, g), a.push(h.id);
121
121
  }
122
122
  }
123
123
  return [...o.values()];
124
124
  }
125
- function Us(n, t, e) {
126
- const { step: s, offset: i } = typeof t == "number" ? { step: t, offset: 0 } : t;
127
- if (!(s > 0) || !Number.isFinite(n)) return n;
128
- const o = Ze(n, e) + i;
129
- return o + Math.round((n - o) / s) * s;
125
+ function Xs(s, t, e) {
126
+ const { step: n, offset: i } = typeof t == "number" ? { step: t, offset: 0 } : t;
127
+ if (!(n > 0) || !Number.isFinite(s)) return s;
128
+ const o = s - ht(s, e), a = i + Math.round((o - i) / n) * n, r = a + ht(s, e), l = a + ht(r, e);
129
+ return l - ht(l, e) === a ? l : r;
130
130
  }
131
- function io(n, t, e) {
132
- return e === 0 || !Number.isFinite(e) ? [] : n.filter((s) => s.task === t).map((s) => ({ kind: "move", subtask: s.id, from: s.from + e, to: s.to + e }));
131
+ function oo(s, t, e) {
132
+ return e === 0 || !Number.isFinite(e) ? [] : s.filter((n) => n.task === t).map((n) => ({ kind: "move", subtask: n.id, from: n.from + e, to: n.to + e }));
133
133
  }
134
- function It(n) {
135
- let t = !1, e = !1, s = !1, i = !1;
136
- for (const o of n ?? [])
137
- o === "provisional" ? (t = !0, e = !1) : o === "fixed" ? (e = !0, t = !1) : o === "muted" ? s = !0 : o === "open" && (i = !0);
138
- return { dashed: t, hatched: e, muted: s, open: i };
134
+ function Lt(s) {
135
+ let t = !1, e = !1, n = !1, i = !1;
136
+ for (const o of s ?? [])
137
+ o === "provisional" ? (t = !0, e = !1) : o === "fixed" ? (e = !0, t = !1) : o === "muted" ? n = !0 : o === "open" && (i = !0);
138
+ return { dashed: t, hatched: e, muted: n, open: i };
139
139
  }
140
- const oe = /* @__PURE__ */ Je(null), ss = /* @__PURE__ */ Je(null);
140
+ const ae = /* @__PURE__ */ Je(null), ss = /* @__PURE__ */ Je(null);
141
141
  function ns() {
142
- return Qt(ss);
142
+ return te(ss);
143
143
  }
144
- function Xs(n) {
145
- const t = Qt(oe);
144
+ function qs(s) {
145
+ const t = te(ae);
146
146
  if (t === null)
147
- throw new Error(`@umriss-ui/schedule: <${n}> must be used inside a <Schedule>.`);
147
+ throw new Error(`@umriss-ui/schedule: <${s}> must be used inside a <Schedule>.`);
148
148
  return t;
149
149
  }
150
- function ae(n, t, e, s, i) {
151
- const o = Xs(n), a = U(null);
150
+ function re(s, t, e, n, i) {
151
+ const o = qs(s), a = U(null);
152
152
  Y(() => (a.current = e(o, t), () => {
153
153
  a.current !== null && i(o, a.current), a.current = null;
154
154
  }), [o]), Y(() => {
155
- a.current !== null && s(o, a.current, t);
155
+ a.current !== null && n(o, a.current, t);
156
156
  });
157
157
  }
158
- function qs(n) {
159
- ae("Lane", n, (t, e) => t.registerLane(e), (t, e, s) => t.updateLane(e, s), (t, e) => t.unregisterLane(e));
158
+ function js(s) {
159
+ re("Lane", s, (t, e) => t.registerLane(e), (t, e, n) => t.updateLane(e, n), (t, e) => t.unregisterLane(e));
160
160
  }
161
- function js(n) {
162
- ae("LaneGroup", n, (t, e) => t.registerGroup(e), (t, e, s) => t.updateGroup(e, s), (t, e) => t.unregisterGroup(e));
161
+ function Zs(s) {
162
+ re("LaneGroup", s, (t, e) => t.registerGroup(e), (t, e, n) => t.updateGroup(e, n), (t, e) => t.unregisterGroup(e));
163
163
  }
164
- function Zs(n) {
165
- const t = Qt(oe);
164
+ function Js(s) {
165
+ const t = te(ae);
166
166
  return Y(() => {
167
167
  if (t !== null)
168
- return t.registerDataTable(n), () => t.unregisterDataTable();
169
- }, [t, n]), t;
168
+ return t.registerDataTable(s), () => t.unregisterDataTable();
169
+ }, [t, s]), t;
170
170
  }
171
- function Lt(n, t) {
172
- ae(n, t, (e, s) => e.registerLayer(s), (e, s, i) => e.updateLayer(s, i), (e, s) => e.unregisterLayer(s));
171
+ function At(s, t) {
172
+ re(s, t, (e, n) => e.registerLayer(n), (e, n, i) => e.updateLayer(n, i), (e, n) => e.unregisterLayer(n));
173
173
  }
174
- const is = 24, Js = 4, Qs = 3, Pt = 4;
175
- function _e(n) {
176
- const { lanes: t, groups: e, collapsed: s, laneHeight: i, headHeight: o = is } = n, a = new Map(e.map((b) => [b.id, b])), r = (b) => b !== void 0 && a.has(b) ? b : void 0, l = /* @__PURE__ */ new Map(), d = (b) => {
174
+ const is = 24, Qs = 4, tn = 3, Rt = 4;
175
+ function Oe(s) {
176
+ const { lanes: t, groups: e, collapsed: n, laneHeight: i, headHeight: o = is } = s, a = new Map(e.map((b) => [b.id, b])), r = (b) => b !== void 0 && a.has(b) ? b : void 0, l = /* @__PURE__ */ new Map(), d = (b) => {
177
177
  const S = [];
178
178
  let I = r(b.parent);
179
179
  const $ = /* @__PURE__ */ new Set();
@@ -191,18 +191,18 @@ function _e(n) {
191
191
  }
192
192
  const h = [], p = /* @__PURE__ */ new Map();
193
193
  let g = [], f = null, y = 0;
194
- const A = (b) => (h.push({ ...b, top: y }), y += b.height, h.length - 1), C = (b) => b.find((S) => s.has(S)), M = () => {
194
+ const A = (b) => (h.push({ ...b, top: y }), y += b.height, h.length - 1), C = (b) => b.find((S) => n.has(S)), M = () => {
195
195
  if (f === null) return;
196
- const { row: b, lanes: S } = f, I = h[b], $ = Math.max(I.height, S.length * Js + 2 * Pt);
196
+ const { row: b, lanes: S } = f, I = h[b], $ = Math.max(I.height, S.length * Qs + 2 * Rt);
197
197
  h[b] = { ...I, height: $ }, y += $ - I.height;
198
- const O = $ - 2 * Pt, R = Math.max(Qs, Math.floor(O / S.length));
199
- S.forEach((J, kt) => {
200
- const vt = c.get(J) ?? [];
201
- p.set(J, {
202
- top: I.top + Pt + kt * R,
198
+ const O = $ - 2 * Rt, R = Math.max(tn, Math.floor(O / S.length));
199
+ S.forEach((Z, vt) => {
200
+ const yt = c.get(Z) ?? [];
201
+ p.set(Z, {
202
+ top: I.top + Rt + vt * R,
203
203
  height: R,
204
204
  miniature: !0,
205
- group: vt[vt.length - 1]
205
+ group: yt[yt.length - 1]
206
206
  });
207
207
  }), f = null;
208
208
  };
@@ -249,100 +249,100 @@ function _e(n) {
249
249
  }
250
250
  return M(), { rows: h, slots: p, height: y };
251
251
  }
252
- function tn(n, t) {
253
- if (t.size === 0) return n;
252
+ function en(s, t) {
253
+ if (t.size === 0) return s;
254
254
  const e = /* @__PURE__ */ new Set();
255
- for (const s of n) t.has(s) || e.add(s);
255
+ for (const n of s) t.has(n) || e.add(n);
256
256
  return e;
257
257
  }
258
- function at(n, t) {
259
- if (t < 0 || t >= n.height) return null;
260
- let e = 0, s = n.rows.length - 1;
261
- for (; e <= s; ) {
262
- const i = e + s >> 1, o = n.rows[i];
263
- if (t < o.top) s = i - 1;
258
+ function at(s, t) {
259
+ if (t < 0 || t >= s.height) return null;
260
+ let e = 0, n = s.rows.length - 1;
261
+ for (; e <= n; ) {
262
+ const i = e + n >> 1, o = s.rows[i];
263
+ if (t < o.top) n = i - 1;
264
264
  else if (t >= o.top + o.height) e = i + 1;
265
265
  else return o;
266
266
  }
267
267
  return null;
268
268
  }
269
- function re(n, t) {
270
- return n.slots.get(t) ?? null;
269
+ function le(s, t) {
270
+ return s.slots.get(t) ?? null;
271
271
  }
272
- function en(n, t) {
273
- const e = at(n, t);
272
+ function sn(s, t) {
273
+ const e = at(s, t);
274
274
  if (e === null) return null;
275
275
  if (e.kind === "lane") return e.lane ?? null;
276
276
  if (e.kind === "groupHead") return null;
277
- for (const [s, i] of n.slots)
278
- if (i.miniature && t >= i.top && t < i.top + i.height) return s;
277
+ for (const [n, i] of s.slots)
278
+ if (i.miniature && t >= i.top && t < i.top + i.height) return n;
279
279
  return null;
280
280
  }
281
- const sn = 6, os = 3, ht = 2, Oe = 3, $e = 3;
282
- function x(n, t) {
283
- return Math.round(n.scale.toPx(z(t, n.calendar)));
281
+ const nn = 6, os = 3, ct = 2, $e = 3, Fe = 3;
282
+ function x(s, t) {
283
+ return Math.round(s.scale.toPx(z(t, s.calendar)));
284
284
  }
285
- function et(n, t) {
286
- const e = re(n.rows, t);
287
- return e === null ? null : { ...e, top: e.top - n.scrollY };
285
+ function et(s, t) {
286
+ const e = le(s.rows, t);
287
+ return e === null ? null : { ...e, top: e.top - s.scrollY };
288
288
  }
289
- function le(n, t) {
290
- const e = et(n, t.lane);
291
- return e === null ? null : { x: x(n, t.at), y: e.top + e.height / 2, half: Math.max(2, Math.min(7, e.height * 0.3)) };
289
+ function de(s, t) {
290
+ const e = et(s, t.lane);
291
+ return e === null ? null : { x: x(s, t.at), y: e.top + e.height / 2, half: Math.max(2, Math.min(7, e.height * 0.3)) };
292
292
  }
293
- function Fe(n, t) {
294
- return en(n.rows, t + n.scrollY);
293
+ function Ee(s, t) {
294
+ return sn(s.rows, t + s.scrollY);
295
295
  }
296
- function as(n, t, e, s) {
297
- const i = e.miniature ? 0 : sn, o = e.miniature ? 0 : $e * Oe, a = Math.max(e.miniature ? 1 : 4, e.height - 2 * i - o), r = e.top - n.scrollY + Math.floor((e.height - a) / 2), l = tt(t);
296
+ function as(s, t, e, n) {
297
+ const i = e.miniature ? 0 : nn, o = e.miniature ? 0 : Fe * $e, a = Math.max(e.miniature ? 1 : 4, e.height - 2 * i - o), r = e.top - s.scrollY + Math.floor((e.height - a) / 2), l = tt(t);
298
298
  return {
299
299
  subtask: t,
300
300
  miniature: e.miniature,
301
- depth: s,
302
- y: r + (e.miniature ? 0 : Math.min(s, $e) * Oe),
301
+ depth: n,
302
+ y: r + (e.miniature ? 0 : Math.min(n, Fe) * $e),
303
303
  height: a,
304
- outerFrom: x(n, l.from),
305
- mainFrom: x(n, t.from),
306
- mainTo: x(n, t.to),
307
- outerTo: x(n, l.to)
304
+ outerFrom: x(s, l.from),
305
+ mainFrom: x(s, t.from),
306
+ mainTo: x(s, t.to),
307
+ outerTo: x(s, l.to)
308
308
  };
309
309
  }
310
- function rs(n, t, e) {
311
- if (e < n.y || e > n.y + n.height) return null;
312
- const s = Math.max(0, (6 - (n.outerTo - n.outerFrom)) / 2);
313
- return t < n.outerFrom - s || t > n.outerTo + s ? null : t < n.mainFrom ? "leadIn" : t > n.mainTo ? "leadOut" : "main";
310
+ function rs(s, t, e) {
311
+ if (e < s.y || e > s.y + s.height) return null;
312
+ const n = Math.max(0, (6 - (s.outerTo - s.outerFrom)) / 2);
313
+ return t < s.outerFrom - n || t > s.outerTo + n ? null : t < s.mainFrom ? "leadIn" : t > s.mainTo ? "leadOut" : "main";
314
314
  }
315
- function nn(n, t, e, s = 5) {
316
- if (e < n.y || e > n.y + n.height) return null;
317
- const i = Math.abs(t - n.mainFrom), o = Math.abs(t - n.mainTo);
318
- return Math.min(i, o) > s ? null : i <= o ? "from" : "to";
315
+ function on(s, t, e, n = 5) {
316
+ if (e < s.y || e > s.y + s.height) return null;
317
+ const i = Math.abs(t - s.mainFrom), o = Math.abs(t - s.mainTo);
318
+ return Math.min(i, o) > n ? null : i <= o ? "from" : "to";
319
319
  }
320
- function Vt(n, t, e) {
321
- return n.outerTo >= 0 && n.outerFrom <= t && n.y + n.height >= 0 && n.y <= e;
320
+ function zt(s, t, e) {
321
+ return s.outerTo >= 0 && s.outerFrom <= t && s.y + s.height >= 0 && s.y <= e;
322
322
  }
323
- function on(n, t, e) {
324
- let i = Math.min(n.x1, n.x2, n.c1x, n.c2x), o = Math.max(n.x1, n.x2, n.c1x, n.c2x), a = Math.min(n.y1, n.y2), r = Math.max(n.y1, n.y2);
325
- for (let l = 0; l + 1 < n.points.length; l += 2)
326
- i = Math.min(i, n.points[l]), o = Math.max(o, n.points[l]), a = Math.min(a, n.points[l + 1]), r = Math.max(r, n.points[l + 1]);
323
+ function an(s, t, e) {
324
+ let i = Math.min(s.x1, s.x2, s.c1x, s.c2x), o = Math.max(s.x1, s.x2, s.c1x, s.c2x), a = Math.min(s.y1, s.y2), r = Math.max(s.y1, s.y2);
325
+ for (let l = 0; l + 1 < s.points.length; l += 2)
326
+ i = Math.min(i, s.points[l]), o = Math.max(o, s.points[l]), a = Math.min(a, s.points[l + 1]), r = Math.max(r, s.points[l + 1]);
327
327
  return o >= -8 && i <= t + 8 && r >= -8 && a <= e + 8;
328
328
  }
329
- const an = 64;
330
- function rn(n, t) {
331
- if (n.miniature) return null;
332
- const e = It(n.subtask.appearance).hatched ? ht + os + 1 : 0, s = Math.max(n.mainFrom + e, 0), i = Math.min(n.mainTo - e, t) - s;
333
- return i < an ? null : { x: s, width: i, y: n.y, height: n.height };
329
+ const rn = 64;
330
+ function ln(s, t) {
331
+ if (s.miniature) return null;
332
+ const e = Lt(s.subtask.appearance).hatched ? ct + os + 1 : 0, n = Math.max(s.mainFrom + e, 0), i = Math.min(s.mainTo - e, t) - n;
333
+ return i < rn ? null : { x: n, width: i, y: s.y, height: s.height };
334
334
  }
335
- const ln = 10;
336
- function Ee(n, t, e) {
337
- const s = Math.round(t.y + t.height / 2);
338
- return n === "centre" || e.y === t.y ? s : Math.round(e.y > t.y ? t.y + t.height - 1 : t.y + 1);
335
+ const dn = 10;
336
+ function Be(s, t, e) {
337
+ const n = Math.round(t.y + t.height / 2);
338
+ return s === "centre" || e.y === t.y ? n : Math.round(e.y > t.y ? t.y + t.height - 1 : t.y + 1);
339
339
  }
340
- function zt(n, t, e, s, i) {
341
- const o = t.route ?? i.route, a = t.attach ?? i.attach, r = t.ends ?? i.ends, l = x(n, ee(t, e.subtask)), d = x(n, se(t, s.subtask)), c = Ee(a, e, s), h = Ee(a, s, e);
340
+ function Wt(s, t, e, n, i) {
341
+ const o = t.route ?? i.route, a = t.attach ?? i.attach, r = t.ends ?? i.ends, l = x(s, se(t, e.subtask)), d = x(s, ne(t, n.subtask)), c = Be(a, e, n), h = Be(a, n, e);
342
342
  if (o === "straight")
343
343
  return { dependency: t, kind: o, ends: r, x1: l, y1: c, x2: d, y2: h, c1x: l, c2x: d, points: [l, c, d, h] };
344
344
  if (o === "orthogonal") {
345
- const A = l + ln, C = c === h ? A : Math.round((A + d) / 2);
345
+ const A = l + dn, C = c === h ? A : Math.round((A + d) / 2);
346
346
  return { dependency: t, kind: o, ends: r, x1: l, y1: c, x2: d, y2: h, c1x: l, c2x: d, points: c === h ? [l, c, d, h] : [l, c, C, c, C, h, d, h] };
347
347
  }
348
348
  const p = Math.max(14, Math.abs(d - l) / 2), g = l + p, f = d - p, y = [];
@@ -355,35 +355,35 @@ function zt(n, t, e, s, i) {
355
355
  }
356
356
  return { dependency: t, kind: "curve", ends: r, x1: l, y1: c, x2: d, y2: h, c1x: g, c2x: f, points: y };
357
357
  }
358
- function dn(n, t, e) {
359
- let s = 1 / 0;
360
- const i = n.points;
358
+ function hn(s, t, e) {
359
+ let n = 1 / 0;
360
+ const i = s.points;
361
361
  for (let o = 0; o + 3 < i.length; o += 2) {
362
362
  const a = i[o], r = i[o + 1], l = i[o + 2], d = i[o + 3], c = l - a, h = d - r, p = c * c + h * h, g = p === 0 ? 0 : Math.max(0, Math.min(1, ((t - a) * c + (e - r) * h) / p));
363
- s = Math.min(s, Math.hypot(t - (a + g * c), e - (r + g * h)));
363
+ n = Math.min(n, Math.hypot(t - (a + g * c), e - (r + g * h)));
364
364
  }
365
- return s;
365
+ return n;
366
366
  }
367
367
  const ls = [], ds = 56;
368
- function hn(n) {
369
- return n > 16 ? n / 16 : 1;
368
+ function cn(s) {
369
+ return s > 16 ? s / 16 : 1;
370
370
  }
371
- function cn(n, t = ds) {
372
- return n > 0 ? Math.min(Q, Math.max(15 * Z, Os(n * t, 1))) : 15 * Z;
371
+ function un(s, t = ds) {
372
+ return s > 0 ? Math.min(Q, Math.max(15 * J, Os(s * t, 1))) : 15 * J;
373
373
  }
374
- const un = () => new Intl.DateTimeFormat().resolvedOptions().timeZone;
375
- function fn(n, t, e = ls, s) {
376
- const [i, o] = hs(n, e);
377
- return $s(e, i, o, t, 0, s ?? un()).filter(
378
- (a) => a.workingTime >= n[0] && a.workingTime <= n[1]
374
+ const fn = () => new Intl.DateTimeFormat().resolvedOptions().timeZone;
375
+ function mn(s, t, e = ls, n) {
376
+ const [i, o] = hs(s, e);
377
+ return $s(e, i, o, t, 0, n ?? fn()).filter(
378
+ (a) => a.workingTime >= s[0] && a.workingTime <= s[1]
379
379
  );
380
380
  }
381
- function mn(n, t = ls, e) {
382
- const [s, i] = hs(n, t), o = [], { year: a, month: r, day: l } = ts(s, e);
383
- let d = l, c = Yt({ year: a, month: r, day: d }, e).getTime();
381
+ function pn(s, t = ls, e) {
382
+ const [n, i] = hs(s, t), o = [], { year: a, month: r, day: l } = ts(n, e);
383
+ let d = l, c = Vt({ year: a, month: r, day: d }, e).getTime();
384
384
  for (; c < i && o.length < 400; ) {
385
385
  const h = c;
386
- c = Yt({ year: a, month: r, day: ++d }, e).getTime(), o.push({
386
+ c = Vt({ year: a, month: r, day: ++d }, e).getTime(), o.push({
387
387
  start: h,
388
388
  from: z(h, t),
389
389
  to: z(c, t)
@@ -391,42 +391,42 @@ function mn(n, t = ls, e) {
391
391
  }
392
392
  return o;
393
393
  }
394
- const Rt = [1, 2, 7, 14, 28];
395
- function pn(n, t) {
396
- return Rt.find((e) => e * n >= t) ?? Rt[Rt.length - 1];
394
+ const Gt = [1, 2, 7, 14, 28];
395
+ function gn(s, t) {
396
+ return Gt.find((e) => e * s >= t) ?? Gt[Gt.length - 1];
397
397
  }
398
- function Gt(n, t, e, s = 1) {
399
- return ((Math.round((n - Ze(n, e)) / Q) - 3 - s) % t + t) % t === 0;
398
+ function Ht(s, t, e, n = 1) {
399
+ return ((Math.round((s - ht(s, e)) / Q) - 3 - n) % t + t) % t === 0;
400
400
  }
401
- function V(n, t) {
402
- const e = n.time(new Date(t), !1);
403
- return Fs(t, n.timeZone) ? `${e} ${n.offset(new Date(t))}` : e;
401
+ function V(s, t) {
402
+ const e = s.time(new Date(t), !1);
403
+ return Fs(t, s.timeZone) ? `${e} ${s.offset(new Date(t))}` : e;
404
404
  }
405
- function gn(n, t, e, s) {
406
- const i = n[1] - n[0];
407
- if (!(i > 0)) return [n[0], n[1]];
408
- const o = Math.min(s.max, Math.max(s.min, i * e)), a = (t - n[0]) / i, r = t - a * o;
405
+ function kn(s, t, e, n) {
406
+ const i = s[1] - s[0];
407
+ if (!(i > 0)) return [s[0], s[1]];
408
+ const o = Math.min(n.max, Math.max(n.min, i * e)), a = (t - s[0]) / i, r = t - a * o;
409
409
  return [r, r + o];
410
410
  }
411
- function kn(n, t) {
412
- return [n[0] + t, n[1] + t];
411
+ function vn(s, t) {
412
+ return [s[0] + t, s[1] + t];
413
413
  }
414
- function ft(n, t) {
415
- const e = St(t);
416
- return e.intervals.length === 0 ? n : Zt(Math.max(0, Math.min(e.total, n)), e);
414
+ function mt(s, t) {
415
+ const e = It(t);
416
+ return e.intervals.length === 0 ? s : Jt(Math.max(0, Math.min(e.total, s)), e);
417
417
  }
418
- function hs(n, t) {
419
- return [ft(n[0], t), ft(n[1], t)];
418
+ function hs(s, t) {
419
+ return [mt(s[0], t), mt(s[1], t)];
420
420
  }
421
- const Wt = 44;
422
- class vn {
421
+ const Ut = 44;
422
+ class yn {
423
423
  constructor(t) {
424
424
  this.data = t;
425
425
  }
426
426
  options = {
427
- laneHeight: Wt,
427
+ laneHeight: Ut,
428
428
  calendar: [],
429
- zoomLimits: { min: Jt, max: 28 * Q },
429
+ zoomLimits: { min: Qt, max: 28 * Q },
430
430
  snap: "ticks",
431
431
  intents: [],
432
432
  now: null,
@@ -443,7 +443,7 @@ class vn {
443
443
  /* What is laid out from top to bottom (`rows.ts`). It is derived here and
444
444
  not in the data, because a row's height comes from a view option; every y
445
445
  in the package reads it. */
446
- rows = _e({ lanes: [], groups: [], collapsed: /* @__PURE__ */ new Set(), laneHeight: Wt });
446
+ rows = Oe({ lanes: [], groups: [], collapsed: /* @__PURE__ */ new Set(), laneHeight: Ut });
447
447
  /** The folded groups, as the scene holds them. */
448
448
  collapsed = /* @__PURE__ */ new Set();
449
449
  /** The groups a gesture in flight holds open. Dropped when it ends; the
@@ -477,11 +477,11 @@ class vn {
477
477
  }
478
478
  /** Takes new options; a new calendar keeps the wall-clock span in view. */
479
479
  setOptions(t) {
480
- const e = t.calendar !== this.options.calendar, s = this.options.calendar;
480
+ const e = t.calendar !== this.options.calendar, n = this.options.calendar;
481
481
  if (this.options = t, e) {
482
- const i = St(s), o = (a) => {
482
+ const i = It(n), o = (a) => {
483
483
  const r = i.intervals.length === 0 ? a : Math.max(0, Math.min(i.total, a));
484
- return z(Zt(r, i), t.calendar) + (a - r);
484
+ return z(Jt(r, i), t.calendar) + (a - r);
485
485
  };
486
486
  this.domain = [o(this.domain[0]), o(this.domain[1])];
487
487
  }
@@ -508,42 +508,42 @@ class vn {
508
508
  /** The fine band's step at the current zoom. */
509
509
  step() {
510
510
  const t = this.domain[1] - this.domain[0];
511
- return cn(this.width > 0 ? t / this.width : t, ds * this.fontScale);
511
+ return un(this.width > 0 ? t / this.width : t, ds * this.fontScale);
512
512
  }
513
513
  /** Lays the rows out, clamps the scroll, and lays the data out anew. */
514
514
  layout() {
515
- this.moved = !1, this.rows = _e({
515
+ this.moved = !1, this.rows = Oe({
516
516
  lanes: this.data.lanes,
517
517
  groups: this.data.groups,
518
- collapsed: tn(this.collapsed, this.openForGesture),
518
+ collapsed: en(this.collapsed, this.openForGesture),
519
519
  laneHeight: Math.round(this.options.laneHeight * this.fontScale),
520
520
  headHeight: Math.round(is * this.fontScale)
521
521
  }), this.scrollY = Math.max(0, Math.min(this.maxScroll(), this.scrollY));
522
522
  const t = this.viewport();
523
523
  this.laidBoxes = [], this.laidBoxById = /* @__PURE__ */ new Map();
524
524
  for (const e of this.data.subtasks) {
525
- const s = re(this.rows, e.lane);
526
- if (s === null) continue;
527
- const i = as(t, e, s, this.data.depth.get(e.id) ?? 0);
525
+ const n = le(this.rows, e.lane);
526
+ if (n === null) continue;
527
+ const i = as(t, e, n, this.data.depth.get(e.id) ?? 0);
528
528
  this.laidBoxes.push(i), this.laidBoxById.set(e.id, i);
529
529
  }
530
530
  this.laidPaths = [];
531
531
  for (const e of this.data.dependencies) {
532
- const s = this.boxById.get(e.from), i = this.boxById.get(e.to);
533
- s === void 0 || i === void 0 || this.laidPaths.push(zt(t, e, s, i, this.options));
532
+ const n = this.boxById.get(e.from), i = this.boxById.get(e.to);
533
+ n === void 0 || i === void 0 || this.laidPaths.push(Wt(t, e, n, i, this.options));
534
534
  }
535
535
  }
536
536
  /** The days of the coarse band and the ticks of the fine band, in pixels. */
537
537
  bands() {
538
538
  const t = this.step();
539
539
  if (this.width <= 0) return { days: [], ticks: [], step: t };
540
- const e = this.viewport().scale, s = this.options.calendar;
540
+ const e = this.viewport().scale, n = this.options.calendar;
541
541
  return {
542
- days: mn(this.domain, s, this.options.timeZone).map((i) => {
542
+ days: pn(this.domain, n, this.options.timeZone).map((i) => {
543
543
  const o = Math.round(e.toPx(i.from));
544
544
  return { start: i.start, x: o, width: Math.round(e.toPx(i.to)) - o };
545
545
  }),
546
- ticks: fn(this.domain, t, s, this.options.timeZone).map((i) => ({ wallClock: i.wallClock, x: Math.round(e.toPx(i.workingTime)) })),
546
+ ticks: mn(this.domain, t, n, this.options.timeZone).map((i) => ({ wallClock: i.wallClock, x: Math.round(e.toPx(i.workingTime)) })),
547
547
  step: t
548
548
  };
549
549
  }
@@ -555,9 +555,9 @@ class vn {
555
555
  return e >= 0 && e <= this.width ? e : null;
556
556
  }
557
557
  hitAt(t, e) {
558
- const s = this.viewport();
558
+ const n = this.viewport();
559
559
  for (let r = this.data.milestones.length - 1; r >= 0; r--) {
560
- const l = this.data.milestones[r], d = le(s, l);
560
+ const l = this.data.milestones[r], d = de(n, l);
561
561
  if (d !== null && Math.abs(t - d.x) + Math.abs(e - d.y) <= d.half + 2) return { kind: "milestone", milestone: l };
562
562
  }
563
563
  for (let r = this.boxes.length - 1; r >= 0; r--) {
@@ -566,17 +566,17 @@ class vn {
566
566
  }
567
567
  let i = null, o = 4;
568
568
  for (const r of this.paths) {
569
- const l = dn(r, t, e);
569
+ const l = hn(r, t, e);
570
570
  l <= o && (o = l, i = r);
571
571
  }
572
572
  if (i !== null) return { kind: "dependency", dependency: i.dependency };
573
- const a = Fe(this.viewport(), e);
573
+ const a = Ee(this.viewport(), e);
574
574
  return a !== null ? { kind: "lane", lane: a } : { kind: "nothing" };
575
575
  }
576
576
  /** The wall-clock time at a plot x; within the calendar's extent. */
577
577
  timeAt(t) {
578
578
  const e = this.viewport().scale.fromPx(t);
579
- return ft(e, this.options.calendar);
579
+ return mt(e, this.options.calendar);
580
580
  }
581
581
  /** The lane at a y, strips included: what the pointer is ON.
582
582
 
@@ -585,7 +585,7 @@ class vn {
585
585
  `foldedGroupAt` - and a caller that reached through `viewport()` for it
586
586
  would be depending on the layout rather than asking the view. */
587
587
  laneIdAt(t) {
588
- return Fe(this.viewport(), t);
588
+ return Ee(this.viewport(), t);
589
589
  }
590
590
  /** The lane a DROP at this y would land on.
591
591
 
@@ -606,103 +606,100 @@ class vn {
606
606
  /** Pans by pixels. Says what moved: the span through time, the lanes, or
607
607
  neither - a scroll through the lanes is no news about the time. */
608
608
  pan(t, e) {
609
- const s = this.domain[0], i = this.scrollY, o = this.domain[1] - s;
610
- this.width > 0 && t !== 0 && (this.domain = kn(this.domain, t / this.width * o)), this.scrollY = Math.max(0, Math.min(this.maxScroll(), this.scrollY + e));
611
- const a = this.domain[0] !== s;
609
+ const n = this.domain[0], i = this.scrollY, o = this.domain[1] - n;
610
+ this.width > 0 && t !== 0 && (this.domain = vn(this.domain, t / this.width * o)), this.scrollY = Math.max(0, Math.min(this.maxScroll(), this.scrollY + e));
611
+ const a = this.domain[0] !== n;
612
612
  return { moved: a || this.scrollY !== i, time: a };
613
613
  }
614
614
  /** Zooms around a plot x; says whether the span changed. */
615
615
  zoomAt(t, e) {
616
616
  if (this.width <= 0 || !Number.isFinite(e)) return !1;
617
- const s = this.domain, i = this.viewport().scale.fromPx(t);
618
- return this.domain = gn(this.domain, i, e, this.options.zoomLimits), s[0] !== this.domain[0] || s[1] !== this.domain[1];
619
- }
620
- }
621
- const yn = "_root_1ep59_4 _text_1j10m_22", wn = "_corner_1ep59_19", bn = "_zoneLabel_1ep59_24", Mn = "_dayBand_1ep59_43", Tn = "_headers_1ep59_48", Sn = "_plot_1ep59_53", In = "_cornerBottom_1ep59_58", Ln = "_tickBand_1ep59_63", An = "_dataKey_1ep59_69", Cn = "_dataPanel_1ep59_100", Dn = "_dataTable_1ep59_119", _n = "_day_1ep59_43", On = "_dayLabel_1ep59_179", $n = "_tick_1ep59_63", Fn = "_tickLabel_1ep59_200", En = "_header_1ep59_48", Bn = "_headerLabel_1ep59_229", xn = "_headerCount_1ep59_265", Nn = "_chevron_1ep59_274", Pn = "_focusRing_1ep59_372", Rn = "_layer_1ep59_390", Gn = "_grip_1ep59_417", Hn = "_ghostLabel_1ep59_427", Kn = "_finding_1ep59_440", Yn = "_refusal_1ep59_448", Vn = "_tooltip_1ep59_452", zn = "_tooltipHead_1ep59_471", Wn = "_tooltipTimes_1ep59_476", Un = "_now_1ep59_485", Xn = "_barLabel_1ep59_499", qn = "_barLabelText_1ep59_512", k = {
622
- root: yn,
623
- corner: wn,
624
- zoneLabel: bn,
625
- dayBand: Mn,
626
- headers: Tn,
627
- plot: Sn,
628
- cornerBottom: In,
629
- tickBand: Ln,
630
- dataKey: An,
631
- dataPanel: Cn,
632
- dataTable: Dn,
633
- day: _n,
634
- dayLabel: On,
635
- tick: $n,
636
- tickLabel: Fn,
637
- header: En,
638
- headerLabel: Bn,
639
- headerCount: xn,
640
- chevron: Nn,
641
- focusRing: Pn,
642
- layer: Rn,
643
- grip: Gn,
644
- ghostLabel: Hn,
645
- finding: Kn,
646
- refusal: Yn,
647
- tooltip: Vn,
648
- tooltipHead: zn,
649
- tooltipTimes: Wn,
650
- now: Un,
651
- barLabel: Xn,
652
- barLabelText: qn
617
+ const n = this.domain, i = this.viewport().scale.fromPx(t);
618
+ return this.domain = kn(this.domain, i, e, this.options.zoomLimits), n[0] !== this.domain[0] || n[1] !== this.domain[1];
619
+ }
620
+ }
621
+ const wn = "_root_1ep59_4 _text_1j10m_22", bn = "_corner_1ep59_19", Mn = "_zoneLabel_1ep59_24", Tn = "_dayBand_1ep59_43", Sn = "_headers_1ep59_48", In = "_plot_1ep59_53", Ln = "_cornerBottom_1ep59_58", An = "_tickBand_1ep59_63", Cn = "_dataKey_1ep59_69", Dn = "_dataPanel_1ep59_100", _n = "_dataTable_1ep59_119", On = "_day_1ep59_43", $n = "_dayLabel_1ep59_179", Fn = "_tick_1ep59_63", En = "_tickLabel_1ep59_200", Bn = "_header_1ep59_48", xn = "_headerLabel_1ep59_229", Nn = "_headerCount_1ep59_265", Pn = "_chevron_1ep59_274", Rn = "_focusRing_1ep59_372", Gn = "_layer_1ep59_390", Hn = "_grip_1ep59_417", Kn = "_ghostLabel_1ep59_427", Yn = "_finding_1ep59_440", Vn = "_refusal_1ep59_448", zn = "_tooltip_1ep59_452", Wn = "_tooltipHead_1ep59_471", Un = "_tooltipTimes_1ep59_476", Xn = "_now_1ep59_485", qn = "_barLabel_1ep59_499", jn = "_barLabelText_1ep59_512", k = {
622
+ root: wn,
623
+ corner: bn,
624
+ zoneLabel: Mn,
625
+ dayBand: Tn,
626
+ headers: Sn,
627
+ plot: In,
628
+ cornerBottom: Ln,
629
+ tickBand: An,
630
+ dataKey: Cn,
631
+ dataPanel: Dn,
632
+ dataTable: _n,
633
+ day: On,
634
+ dayLabel: $n,
635
+ tick: Fn,
636
+ tickLabel: En,
637
+ header: Bn,
638
+ headerLabel: xn,
639
+ headerCount: Nn,
640
+ chevron: Pn,
641
+ focusRing: Rn,
642
+ layer: Gn,
643
+ grip: Hn,
644
+ ghostLabel: Kn,
645
+ finding: Yn,
646
+ refusal: Vn,
647
+ tooltip: zn,
648
+ tooltipHead: Wn,
649
+ tooltipTimes: Un,
650
+ now: Xn,
651
+ barLabel: qn,
652
+ barLabelText: jn
653
653
  };
654
- function de() {
655
- const n = rt();
656
- return (t) => {
657
- const e = Math.round(t / Z), s = Math.floor(e / 60), i = e % 60;
658
- return [s > 0 ? n.hoursShort(s) : "", i > 0 || s === 0 ? n.minutesShort(i) : ""].filter(Boolean).join(" ");
654
+ function he() {
655
+ const s = rt();
656
+ return (t) => Gs(t, s);
657
+ }
658
+ function Zn() {
659
+ const s = gt(), t = rt();
660
+ return (e, n) => {
661
+ const [i, o] = [new Date(e), new Date(n)], a = s.date(i);
662
+ return a === s.date(o) ? `${a} ${t.scheduleGhostTimes(V(s, e), V(s, n))}` : t.scheduleGhostTimes(`${a} ${V(s, e)}`, `${s.date(o)} ${V(s, n)}`);
659
663
  };
660
664
  }
661
- function jn() {
662
- const n = pt(), t = rt();
663
- return (e, s) => {
664
- const [i, o] = [new Date(e), new Date(s)], a = n.date(i);
665
- return a === n.date(o) ? `${a} ${t.scheduleGhostTimes(V(n, e), V(n, s))}` : t.scheduleGhostTimes(`${a} ${V(n, e)}`, `${n.date(o)} ${V(n, s)}`);
666
- };
667
- }
668
- function cs(n, t, e) {
669
- return Math.round(e / Z) === 0 ? n.scheduleDependency : `${n.scheduleDependency} ${t(e)}`;
665
+ function cs(s, t, e) {
666
+ return Math.round(e / J) === 0 ? s.scheduleDependency : `${s.scheduleDependency} ${t(e)}`;
670
667
  }
671
- function Zn({ target: n, lane: t }) {
672
- const e = pt(), s = rt(), i = de(), o = (h) => V(e, h);
673
- if (n.kind === "subtask") {
674
- const { subtask: h, task: p } = n, g = [
668
+ function Jn({ target: s, lane: t }) {
669
+ const e = gt(), n = rt(), i = he(), o = (h) => V(e, h);
670
+ if (s.kind === "subtask") {
671
+ const { subtask: h, task: p } = s, g = [
675
672
  p?.name ?? h.task,
676
673
  h.name ?? h.id,
677
- `${e.dateShort(new Date(h.from))} ${s.scheduleGhostTimes(o(h.from), o(h.to))}`,
678
- ...n.overlapping.map((f) => s.scheduleOverlapWith(f.name ?? f.id)),
679
- ...n.violatedDependencies.map((f) => s.scheduleViolatedBy(i(f.shortBy))),
680
- ...n.blocked.map((f) => s.scheduleInBlockedTime(f.label))
674
+ `${e.dateShort(new Date(h.from))} ${n.scheduleGhostTimes(o(h.from), o(h.to))}`,
675
+ ...s.overlapping.map((f) => n.scheduleOverlapWith(f.name ?? f.id)),
676
+ ...s.violatedDependencies.map((f) => n.scheduleViolatedBy(i(f.shortBy))),
677
+ ...s.blocked.map((f) => n.scheduleInBlockedTime(f.label))
681
678
  ];
682
679
  return /* @__PURE__ */ E(ot, { children: [
683
680
  t,
684
681
  `, ${g.join(", ")}`
685
682
  ] });
686
683
  }
687
- if (n.kind === "milestone") {
688
- const { milestone: h } = n;
684
+ if (s.kind === "milestone") {
685
+ const { milestone: h } = s;
689
686
  return /* @__PURE__ */ E(ot, { children: [
690
687
  t,
691
- `, ${s.scheduleMilestone(h.label ?? h.id)}, ${e.dateShort(new Date(h.at))} ${o(h.at)}`
688
+ `, ${n.scheduleMilestone(h.label ?? h.id)}, ${e.dateShort(new Date(h.at))} ${o(h.at)}`
692
689
  ] });
693
690
  }
694
- const { dependency: a, task: r, from: l, to: d, violated: c } = n;
691
+ const { dependency: a, task: r, from: l, to: d, violated: c } = s;
695
692
  return [
696
693
  r?.name ?? r?.id ?? a.id,
697
- cs(s, i, a.lag),
698
- s.scheduleRoute(l?.name ?? a.from, d?.name ?? a.to),
699
- ...c === void 0 ? [] : [s.scheduleViolatedBy(i(c.shortBy))]
694
+ cs(n, i, a.lag),
695
+ n.scheduleRoute(l?.name ?? a.from, d?.name ?? a.to),
696
+ ...c === void 0 ? [] : [n.scheduleViolatedBy(i(c.shortBy))]
700
697
  ].join(", ");
701
698
  }
702
- function Jn({ target: n }) {
703
- const t = pt(), e = rt(), s = (h) => V(t, h), i = de(), o = jn();
704
- if (n.kind === "subtask") {
705
- const { subtask: h, task: p } = n;
699
+ function Qn({ target: s }) {
700
+ const t = gt(), e = rt(), n = (h) => V(t, h), i = he(), o = Zn();
701
+ if (s.kind === "subtask") {
702
+ const { subtask: h, task: p } = s;
706
703
  return /* @__PURE__ */ E(ot, { children: [
707
704
  /* @__PURE__ */ m("span", { className: k.tooltipHead, children: p?.name ?? h.task }),
708
705
  /* @__PURE__ */ m("span", { children: h.name ?? h.id }),
@@ -710,19 +707,19 @@ function Jn({ target: n }) {
710
707
  /* @__PURE__ */ m("span", { children: i(h.to - h.from) }),
711
708
  (h.leadIn ?? 0) > 0 && /* @__PURE__ */ m("span", { children: `${e.scheduleLeadIn} ${i(h.leadIn)}` }),
712
709
  (h.leadOut ?? 0) > 0 && /* @__PURE__ */ m("span", { children: `${e.scheduleLeadOut} ${i(h.leadOut)}` }),
713
- n.overlapping.map((g) => /* @__PURE__ */ m("span", { className: k.finding, children: e.scheduleOverlapWith(g.name ?? g.id) }, g.id)),
714
- n.violatedDependencies.map((g) => /* @__PURE__ */ m("span", { className: k.finding, children: e.scheduleViolatedBy(i(g.shortBy)) }, g.dependency)),
715
- n.blocked.map((g) => /* @__PURE__ */ m("span", { className: k.finding, children: e.scheduleInBlockedTime(g.label) }, g.id))
710
+ s.overlapping.map((g) => /* @__PURE__ */ m("span", { className: k.finding, children: e.scheduleOverlapWith(g.name ?? g.id) }, g.id)),
711
+ s.violatedDependencies.map((g) => /* @__PURE__ */ m("span", { className: k.finding, children: e.scheduleViolatedBy(i(g.shortBy)) }, g.dependency)),
712
+ s.blocked.map((g) => /* @__PURE__ */ m("span", { className: k.finding, children: e.scheduleInBlockedTime(g.label) }, g.id))
716
713
  ] });
717
714
  }
718
- if (n.kind === "milestone") {
719
- const { milestone: h } = n;
715
+ if (s.kind === "milestone") {
716
+ const { milestone: h } = s;
720
717
  return /* @__PURE__ */ E(ot, { children: [
721
718
  /* @__PURE__ */ m("span", { className: k.tooltipHead, children: e.scheduleMilestone(h.label ?? h.id) }),
722
- /* @__PURE__ */ m("span", { className: k.tooltipTimes, children: `${t.dateShort(new Date(h.at))} ${s(h.at)}` })
719
+ /* @__PURE__ */ m("span", { className: k.tooltipTimes, children: `${t.dateShort(new Date(h.at))} ${n(h.at)}` })
723
720
  ] });
724
721
  }
725
- const { dependency: a, task: r, from: l, to: d, violated: c } = n;
722
+ const { dependency: a, task: r, from: l, to: d, violated: c } = s;
726
723
  return /* @__PURE__ */ E(ot, { children: [
727
724
  /* @__PURE__ */ m("span", { className: k.tooltipHead, children: r?.name ?? r?.id ?? a.id }),
728
725
  /* @__PURE__ */ m("span", { children: e.scheduleRoute(l?.name ?? a.from, d?.name ?? a.to) }),
@@ -730,21 +727,21 @@ function Jn({ target: n }) {
730
727
  c !== void 0 && /* @__PURE__ */ m("span", { className: k.finding, children: e.scheduleViolatedBy(i(c.shortBy)) })
731
728
  ] });
732
729
  }
733
- const Qn = [], Be = { min: Jt, max: 28 * Q }, ti = [], xe = 20, ei = 44, si = 84, ni = 200;
734
- function ii(n) {
730
+ const ti = [], xe = { min: Qt, max: 28 * Q }, ei = [], Ne = 20, si = 44, ni = 84, ii = 200;
731
+ function oi(s) {
735
732
  const {
736
733
  ref: t,
737
734
  scene: e,
738
- "aria-label": s,
735
+ "aria-label": n,
739
736
  "aria-labelledby": i,
740
737
  "aria-describedby": o,
741
738
  height: a,
742
- laneHeight: r = Wt,
739
+ laneHeight: r = Ut,
743
740
  headerWidth: l = 160,
744
- calendar: d = ti,
741
+ calendar: d = ei,
745
742
  zoomLimits: c,
746
743
  snap: h = "ticks",
747
- intents: p = Qn,
744
+ intents: p = ti,
748
745
  onIntent: g,
749
746
  canMoveTo: f,
750
747
  onInteraction: y,
@@ -757,71 +754,71 @@ function ii(n) {
757
754
  label: $,
758
755
  tooltip: O,
759
756
  now: R,
760
- loading: J = !1,
761
- className: kt,
762
- style: vt,
757
+ loading: Z = !1,
758
+ className: vt,
759
+ style: yt,
763
760
  children: ys,
764
761
  ...ws
765
- } = n, ce = { "aria-label": s, "aria-labelledby": i }, At = Qe(), Ct = `${At}-summary`, Dt = U(null), ue = U(null), fe = U(null), me = U(null), N = pt(), B = rt(), lt = N.timeZone, yt = Gs(), pe = c?.min ?? Be.min, ge = c?.max ?? Be.max, ke = typeof h == "object" ? h.step : null, ve = typeof h == "object" ? h.offset : null, ye = typeof h == "object" ? null : h, [bs, Ms] = ct(() => Date.now());
762
+ } = s, ue = { "aria-label": n, "aria-labelledby": i }, Ct = Qe(), Dt = `${Ct}-summary`, _t = U(null), fe = U(null), me = U(null), pe = U(null), N = gt(), B = rt(), lt = N.timeZone, wt = Hs(), ge = c?.min ?? xe.min, ke = c?.max ?? xe.max, ve = typeof h == "object" ? h.step : null, ye = typeof h == "object" ? h.offset : null, we = typeof h == "object" ? null : h, [bs, Ms] = ut(() => Date.now());
766
763
  Y(() => {
767
764
  if (R !== !0) return;
768
- const u = setInterval(() => Ms(Date.now()), Z);
765
+ const u = setInterval(() => Ms(Date.now()), J);
769
766
  return () => clearInterval(u);
770
767
  }, [R]);
771
- const we = R === !0 ? bs : typeof R == "number" ? R : null;
772
- bt(() => {
773
- const u = ye ?? { step: ke ?? 0, offset: ve ?? 0 };
774
- e.setOptions({ laneHeight: r, calendar: d, zoomLimits: { min: pe, max: ge }, snap: u, intents: p, now: we, timeZone: lt, route: b, attach: S, ends: I });
775
- }, [e, r, d, pe, ge, ye, ke, ve, p, we, lt, b, S, I]), Y(() => {
768
+ const be = R === !0 ? bs : typeof R == "number" ? R : null;
769
+ Mt(() => {
770
+ const u = we ?? { step: ve ?? 0, offset: ye ?? 0 };
771
+ e.setOptions({ laneHeight: r, calendar: d, zoomLimits: { min: ge, max: ke }, snap: u, intents: p, now: be, timeZone: lt, route: b, attach: S, ends: I });
772
+ }, [e, r, d, ge, ke, we, ve, ye, p, be, lt, b, S, I]), Y(() => {
776
773
  e.setHandlers({ onIntent: g, canMoveTo: f, onInteraction: y, onSelectedTaskChange: C });
777
- }, [e, g, f, y, C]), Ps(t, () => Dt.current, []), Y(() => {
774
+ }, [e, g, f, y, C]), Ps(t, () => _t.current, []), Y(() => {
778
775
  e.data.warnOfMalformedData();
779
776
  }), Y(() => {
780
- e.setLoading(J);
781
- }, [e, J]), Y(() => {
777
+ e.setLoading(Z);
778
+ }, [e, Z]), Y(() => {
782
779
  e.setControlledTask(A);
783
780
  }, [e, A]), Y(() => {
784
781
  e.setPlacing(M ?? null);
785
782
  }, [e, M]), Y(() => {
786
- const u = Dt.current, w = ue.current, L = fe.current, F = me.current;
783
+ const u = _t.current, w = fe.current, L = me.current, F = pe.current;
787
784
  if (!u || !w || !L || !F) return;
788
785
  e.bind(u, w, L, F);
789
786
  const D = w.getBoundingClientRect();
790
787
  e.resize(D.width, D.height);
791
788
  const _ = new ResizeObserver((W) => {
792
- const Nt = W[W.length - 1]?.contentRect;
793
- Nt !== void 0 && e.resize(Nt.width, Nt.height);
789
+ const Pt = W[W.length - 1]?.contentRect;
790
+ Pt !== void 0 && e.resize(Pt.width, Pt.height);
794
791
  });
795
792
  _.observe(w);
796
793
  const P = document.createElement("div");
797
794
  P.setAttribute("aria-hidden", "true"), P.style.cssText = "position:absolute;visibility:hidden;pointer-events:none;width:1rem;height:0", u.appendChild(P);
798
- const H = () => e.setFontScale(hn(parseFloat(getComputedStyle(P).width)));
795
+ const H = () => e.setFontScale(cn(parseFloat(getComputedStyle(P).width)));
799
796
  H();
800
797
  const K = new ResizeObserver(H);
801
798
  K.observe(P);
802
799
  const nt = (W) => e.wheel(W);
803
800
  u.addEventListener("wheel", nt, { passive: !1 });
804
- const Le = (W) => e.touchMove(W);
805
- u.addEventListener("touchmove", Le, { passive: !1 });
806
- const Ae = (W) => {
801
+ const Ae = (W) => e.touchMove(W);
802
+ u.addEventListener("touchmove", Ae, { passive: !1 });
803
+ const Ce = (W) => {
807
804
  W.key === "Escape" && e.cancelEdit() && W.preventDefault();
808
805
  };
809
- return window.addEventListener("keydown", Ae), () => {
810
- window.removeEventListener("keydown", Ae), u.removeEventListener("wheel", nt), u.removeEventListener("touchmove", Le), _.disconnect(), K.disconnect(), P.remove(), e.unbind();
806
+ return window.addEventListener("keydown", Ce), () => {
807
+ window.removeEventListener("keydown", Ce), u.removeEventListener("wheel", nt), u.removeEventListener("touchmove", Ae), _.disconnect(), K.disconnect(), P.remove(), e.unbind();
811
808
  };
812
809
  }, [e]);
813
- const v = te(e.subscribe, e.getSnapshot, e.getServerSnapshot), { fontScale: dt } = v, _t = ei * dt, Ts = si * dt, Ss = ni * dt, Is = (u, w) => {
810
+ const v = ee(e.subscribe, e.getSnapshot, e.getServerSnapshot), { fontScale: dt } = v, Ot = si * dt, Ts = ni * dt, Ss = ii * dt, Is = (u, w) => {
814
811
  const L = new Date(u);
815
- return w >= Ss ? N.dateLong(L) : w >= Ts ? N.date(L) : w >= _t ? N.dateShort(L) : "";
816
- }, Ls = v.days.reduce((u, w) => Math.max(u, w.width), 0), st = pn(Ls, _t), be = v.step >= Q ? st : 1, Me = v.dataTable?.open === !0, T = v.ghost, G = v.spoken, Ot = v.summary, wt = (u) => `${N.dateShort(new Date(u))} ${V(N, u)}`, $t = (u) => `${At}-row-${encodeURIComponent(u.key)}`, As = X(() => {
812
+ return w >= Ss ? N.dateLong(L) : w >= Ts ? N.date(L) : w >= Ot ? N.dateShort(L) : "";
813
+ }, Ls = v.days.reduce((u, w) => Math.max(u, w.width), 0), st = gn(Ls, Ot), Me = v.step >= Q ? st : 1, Te = v.dataTable?.open === !0, T = v.ghost, G = v.spoken, $t = v.summary, bt = (u) => `${N.dateShort(new Date(u))} ${V(N, u)}`, Ft = (u) => `${Ct}-row-${encodeURIComponent(u.key)}`, As = X(() => {
817
814
  const u = /* @__PURE__ */ new Map();
818
815
  for (const w of v.headers)
819
816
  for (const L of w.within)
820
- w.kind === "groupHead" && L === w.group || u.set(L, [...u.get(L) ?? [], $t(w)]);
817
+ w.kind === "groupHead" && L === w.group || u.set(L, [...u.get(L) ?? [], Ft(w)]);
821
818
  return u;
822
- }, [v.headers, At]), Te = U(null);
823
- bt(() => {
824
- const u = Te.current;
819
+ }, [v.headers, Ct]), Se = U(null);
820
+ Mt(() => {
821
+ const u = Se.current;
825
822
  if (u === null) return;
826
823
  let w = !0;
827
824
  const L = () => {
@@ -844,20 +841,20 @@ function ii(n) {
844
841
  w = !1, F.disconnect(), D.disconnect();
845
842
  };
846
843
  }, []);
847
- const Cs = X(() => new Set(T?.refusedLanes ?? []), [T?.refusedLanes]), Se = U(null), [Ft, Ds] = ct({ x: 0, y: 0, at: "" }), Et = T === null ? "" : `${T.x}:${T.y}:${T.from}:${T.to}:${T.overlap}:${T.violated}:${T.refused}:${T.blocked}`;
848
- bt(() => {
849
- const u = Se.current;
844
+ const Cs = X(() => new Set(T?.refusedLanes ?? []), [T?.refusedLanes]), Ie = U(null), [Et, Ds] = ut({ x: 0, y: 0, at: "" }), Bt = T === null ? "" : `${T.x}:${T.y}:${T.from}:${T.to}:${T.overlap}:${T.violated}:${T.refused}:${T.blocked}`;
845
+ Mt(() => {
846
+ const u = Ie.current;
850
847
  if (T === null || u === null) return;
851
848
  const w = 4, L = T.y - u.offsetHeight - w, F = T.y + T.height + w, D = {
852
849
  x: Math.max(2, Math.min(T.x, v.width - u.offsetWidth - 2)),
853
850
  y: L >= 2 ? L : Math.min(F, v.height - u.offsetHeight - 2),
854
- at: Et
851
+ at: Bt
855
852
  };
856
853
  Ds((_) => _.x === D.x && _.y === D.y && _.at === D.at ? _ : D);
857
- }, [T, Et, v.width, v.height]);
858
- const Ie = U(null), [Bt, _s] = ct({ x: 0, y: 0, at: "" }), q = v.tooltip, xt = q === null ? "" : `${q.x}:${q.y}:${q.target.kind}`;
859
- return bt(() => {
860
- const u = Ie.current;
854
+ }, [T, Bt, v.width, v.height]);
855
+ const Le = U(null), [xt, _s] = ut({ x: 0, y: 0, at: "" }), q = v.tooltip, Nt = q === null ? "" : `${q.x}:${q.y}:${q.target.kind}`;
856
+ return Mt(() => {
857
+ const u = Le.current;
861
858
  if (q === null || u === null) return;
862
859
  const w = 12, L = (D, _, P) => {
863
860
  const H = D + w, K = D - w - _, nt = H + _ <= P - 4 || K < 4 ? H : K;
@@ -865,31 +862,31 @@ function ii(n) {
865
862
  }, F = {
866
863
  x: L(q.x, u.offsetWidth, v.width),
867
864
  y: L(q.y, u.offsetHeight, v.height),
868
- at: xt
865
+ at: Nt
869
866
  };
870
867
  _s((D) => D.x === F.x && D.y === F.y && D.at === F.at ? D : F);
871
- }, [q, xt, v.width, v.height]), /* @__PURE__ */ m(oe, { value: e, children: /* @__PURE__ */ E(
868
+ }, [q, Nt, v.width, v.height]), /* @__PURE__ */ m(ae, { value: e, children: /* @__PURE__ */ E(
872
869
  "div",
873
870
  {
874
871
  ...ws,
875
- ref: Dt,
872
+ ref: _t,
876
873
  role: "figure",
877
874
  "data-schedule-clip": "schedule",
878
- ...ce,
879
- className: kt ? `${k.root} ${kt}` : k.root,
880
- style: { ...a === void 0 ? { height: "100%", minHeight: 400 } : { height: `${a}px` }, gridTemplateColumns: `min(${l}px, max(120px, 28%)) minmax(0, 1fr)`, ...vt },
875
+ ...ue,
876
+ className: vt ? `${k.root} ${vt}` : k.root,
877
+ style: { ...a === void 0 ? { height: "100%", minHeight: 400 } : { height: `${a}px` }, gridTemplateColumns: `min(${l}px, max(120px, 28%)) minmax(0, 1fr)`, ...yt },
881
878
  children: [
882
- /* @__PURE__ */ m("div", { className: k.corner, children: yt !== null && /* @__PURE__ */ m("span", { className: k.zoneLabel, "data-schedule-overlay": "zone label", children: yt }) }),
879
+ /* @__PURE__ */ m("div", { className: k.corner, children: wt !== null && /* @__PURE__ */ m("span", { className: k.zoneLabel, "data-schedule-overlay": "zone label", children: wt }) }),
883
880
  /* @__PURE__ */ m("div", { className: k.dayBand, "aria-hidden": "true", "data-schedule-days": "", "data-schedule-clip": "day band", children: v.days.map((u, w) => {
884
- const L = st === 1 || w === 0 || Gt(u.start, st, lt, N.weekStart), F = st === 1 ? u.x + u.width : v.days.slice(w + 1).find((P) => Gt(P.start, st, lt, N.weekStart))?.x ?? v.width, D = Math.max(0, -u.x), _ = Math.min(F, v.width) - Math.max(u.x, 0);
885
- return /* @__PURE__ */ m("span", { className: k.day, style: { left: `${u.x}px`, width: `${L ? F - u.x : u.width}px` }, children: /* @__PURE__ */ m("span", { className: k.dayLabel, "data-schedule-overlay": "day label", style: { marginLeft: `${D}px` }, children: L ? Is(u.start, st === 1 ? _ : Math.min(_, _t)) : "" }) }, u.start);
881
+ const L = st === 1 || w === 0 || Ht(u.start, st, lt, N.weekStart), F = st === 1 ? u.x + u.width : v.days.slice(w + 1).find((P) => Ht(P.start, st, lt, N.weekStart))?.x ?? v.width, D = Math.max(0, -u.x), _ = Math.min(F, v.width) - Math.max(u.x, 0);
882
+ return /* @__PURE__ */ m("span", { className: k.day, style: { left: `${u.x}px`, width: `${L ? F - u.x : u.width}px` }, children: /* @__PURE__ */ m("span", { className: k.dayLabel, "data-schedule-overlay": "day label", style: { marginLeft: `${D}px` }, children: L ? Is(u.start, st === 1 ? _ : Math.min(_, Ot)) : "" }) }, u.start);
886
883
  }) }),
887
- /* @__PURE__ */ m("div", { ref: Te, className: k.headers, "data-schedule-headers": "", inert: Me || void 0, children: /* @__PURE__ */ E("div", { className: k.headerRun, style: { transform: `translateY(${-v.scrollY}px)` }, children: [
888
- J && v.headers.length === 0 && Array.from({ length: Math.floor(v.height / Math.round(r * dt)) }, (u, w) => /* @__PURE__ */ m("div", { className: k.header, style: { height: `${Math.round(r * dt)}px` }, children: /* @__PURE__ */ m(Hs, { width: "60%" }) }, w)),
884
+ /* @__PURE__ */ m("div", { ref: Se, className: k.headers, "data-schedule-headers": "", inert: Te || void 0, children: /* @__PURE__ */ E("div", { className: k.headerRun, style: { transform: `translateY(${-v.scrollY}px)` }, children: [
885
+ Z && v.headers.length === 0 && Array.from({ length: Math.floor(v.height / Math.round(r * dt)) }, (u, w) => /* @__PURE__ */ m("div", { className: k.header, style: { height: `${Math.round(r * dt)}px` }, children: /* @__PURE__ */ m(Ks, { width: "60%" }) }, w)),
889
886
  v.headers.map((u) => /* @__PURE__ */ E(
890
887
  "div",
891
888
  {
892
- id: $t(u),
889
+ id: Ft(u),
893
890
  className: k.header,
894
891
  style: { height: `${u.height}px`, paddingLeft: `calc(var(--u-space-3) + ${u.depth} * var(--u-space-3))` },
895
892
  "data-lane": u.lane,
@@ -905,10 +902,10 @@ function ii(n) {
905
902
  className: k.chevron,
906
903
  "data-schedule-overlay": "fold control",
907
904
  "aria-expanded": u.collapsed === !1,
908
- "aria-controls": (As.get(u.group) ?? [$t(u)]).join(" "),
905
+ "aria-controls": (As.get(u.group) ?? [Ft(u)]).join(" "),
909
906
  "aria-label": `${u.collapsed === !0 ? B.scheduleUnfoldGroup : B.scheduleFoldGroup}: ${typeof u.label == "string" ? u.label : u.group}`,
910
907
  onClick: () => e.toggleGroup(u.group),
911
- children: /* @__PURE__ */ m(Ks, { size: 9, "data-open": u.collapsed === !1 ? "" : void 0 })
908
+ children: /* @__PURE__ */ m(Ys, { size: 9, "data-open": u.collapsed === !1 ? "" : void 0 })
912
909
  }
913
910
  ),
914
911
  /* @__PURE__ */ m("span", { className: k.headerLabel, "data-schedule-overlay": "header label", title: typeof u.label == "string" ? u.label : void 0, children: u.label }),
@@ -921,24 +918,24 @@ function ii(n) {
921
918
  /* @__PURE__ */ E(
922
919
  "div",
923
920
  {
924
- ref: ue,
921
+ ref: fe,
925
922
  className: k.plot,
926
923
  "data-schedule-plot": "",
927
924
  "data-schedule-clip": "plot",
928
925
  style: { cursor: v.cursor },
929
- "aria-busy": J || void 0,
930
- inert: Me || void 0,
926
+ "aria-busy": Z || void 0,
927
+ inert: Te || void 0,
931
928
  "data-stale": v.loading && v.headers.length > 0 || void 0,
932
929
  tabIndex: 0,
933
930
  role: "application",
934
931
  "aria-roledescription": B.scheduleRoleDescription,
935
- ...ce,
936
- "aria-label": s === void 0 ? void 0 : B.schedulePlotName(s),
937
- "aria-describedby": o ? `${Ct} ${o}` : Ct,
932
+ ...ue,
933
+ "aria-label": n === void 0 ? void 0 : B.schedulePlotName(n),
934
+ "aria-describedby": o ? `${Dt} ${o}` : Dt,
938
935
  onKeyDown: (u) => {
939
936
  e.key(u.nativeEvent) && u.preventDefault();
940
937
  },
941
- onFocus: (u) => e.focus(oi(u.currentTarget)),
938
+ onFocus: (u) => e.focus(ai(u.currentTarget)),
942
939
  onBlur: () => e.blur(),
943
940
  onPointerDown: (u) => e.pointerDown(u.nativeEvent),
944
941
  onPointerMove: (u) => e.pointerMove(u.nativeEvent),
@@ -953,8 +950,8 @@ function ii(n) {
953
950
  (!(w instanceof Node) || !u.currentTarget.contains(w)) && e.dragLeave();
954
951
  },
955
952
  children: [
956
- /* @__PURE__ */ m("canvas", { ref: fe, className: k.layer, "aria-hidden": "true" }),
957
953
  /* @__PURE__ */ m("canvas", { ref: me, className: k.layer, "aria-hidden": "true" }),
954
+ /* @__PURE__ */ m("canvas", { ref: pe, className: k.layer, "aria-hidden": "true" }),
958
955
  v.grips.map((u) => /* @__PURE__ */ m(
959
956
  "span",
960
957
  {
@@ -982,23 +979,23 @@ function ii(n) {
982
979
  O !== !1 && v.tooltip !== null && /* @__PURE__ */ m(
983
980
  "span",
984
981
  {
985
- ref: Ie,
982
+ ref: Le,
986
983
  role: "tooltip",
987
984
  className: k.tooltip,
988
985
  "data-schedule-tooltip": "",
989
986
  "data-schedule-overlay": "tooltip",
990
987
  style: {
991
- left: `${Bt.x}px`,
992
- top: `${Bt.y}px`,
993
- visibility: Bt.at === xt ? void 0 : "hidden"
988
+ left: `${xt.x}px`,
989
+ top: `${xt.y}px`,
990
+ visibility: xt.at === Nt ? void 0 : "hidden"
994
991
  },
995
- children: typeof O == "function" ? O(v.tooltip.target) : /* @__PURE__ */ m(Jn, { target: v.tooltip.target })
992
+ children: typeof O == "function" ? O(v.tooltip.target) : /* @__PURE__ */ m(Qn, { target: v.tooltip.target })
996
993
  }
997
994
  ),
998
995
  T !== null && /* @__PURE__ */ E(
999
996
  "span",
1000
997
  {
1001
- ref: Se,
998
+ ref: Ie,
1002
999
  className: k.ghostLabel,
1003
1000
  "data-ghost": "",
1004
1001
  "data-schedule-overlay": "ghost label",
@@ -1006,9 +1003,9 @@ function ii(n) {
1006
1003
  "data-refused": T.refused ? "" : void 0,
1007
1004
  "data-blocked": T.blocked ? "" : void 0,
1008
1005
  style: {
1009
- left: `${Ft.x}px`,
1010
- top: `${Ft.y}px`,
1011
- visibility: Ft.at === Et ? void 0 : "hidden"
1006
+ left: `${Et.x}px`,
1007
+ top: `${Et.y}px`,
1008
+ visibility: Et.at === Bt ? void 0 : "hidden"
1012
1009
  },
1013
1010
  children: [
1014
1011
  B.scheduleGhostTimes(V(N, T.from), V(N, T.to)),
@@ -1026,12 +1023,12 @@ function ii(n) {
1026
1023
  /* @__PURE__ */ m("div", { className: `${k.corner} ${k.cornerBottom}` }),
1027
1024
  /* @__PURE__ */ E("div", { className: k.tickBand, "aria-hidden": "true", "data-schedule-ticks": "", "data-schedule-clip": "time band", children: [
1028
1025
  v.now !== null && /* @__PURE__ */ m("span", { className: k.now, "data-now": "", "data-schedule-overlay": "now mark", style: { left: `${v.now}px` } }),
1029
- v.ticks.map((u) => /* @__PURE__ */ m("span", { className: k.tick, style: { left: `${u.x}px` }, children: u.x >= xe && u.x <= v.width - xe && (be === 1 || Gt(u.wallClock, be, lt, N.weekStart)) && /* @__PURE__ */ m("span", { className: k.tickLabel, "data-schedule-overlay": "time label", children: v.step >= Q ? N.dateShort(new Date(u.wallClock)) : V(N, u.wallClock) }) }, u.wallClock))
1026
+ v.ticks.map((u) => /* @__PURE__ */ m("span", { className: k.tick, style: { left: `${u.x}px` }, children: u.x >= Ne && u.x <= v.width - Ne && (Me === 1 || Ht(u.wallClock, Me, lt, N.weekStart)) && /* @__PURE__ */ m("span", { className: k.tickLabel, "data-schedule-overlay": "time label", children: v.step >= Q ? N.dateShort(new Date(u.wallClock)) : V(N, u.wallClock) }) }, u.wallClock))
1030
1027
  ] }),
1031
- /* @__PURE__ */ E(Ce, { "aria-live": "polite", children: [
1032
- G?.span !== void 0 && /* @__PURE__ */ m("span", { children: B.scheduleVisibleRange(wt(G.span[0]), wt(G.span[1])) }, G.count),
1028
+ /* @__PURE__ */ E(De, { "aria-live": "polite", children: [
1029
+ G?.span !== void 0 && /* @__PURE__ */ m("span", { children: B.scheduleVisibleRange(bt(G.span[0]), bt(G.span[1])) }, G.count),
1033
1030
  G !== null && G.target !== null && /* @__PURE__ */ m(
1034
- Zn,
1031
+ Jn,
1035
1032
  {
1036
1033
  target: G.target,
1037
1034
  lane: G.lane === null ? null : e.data.lanes.find((u) => u.id === G.lane)?.label ?? G.lane
@@ -1039,22 +1036,22 @@ function ii(n) {
1039
1036
  G.count
1040
1037
  )
1041
1038
  ] }),
1042
- /* @__PURE__ */ m(Ce, { id: Ct, children: v === e.getServerSnapshot() ? B.scheduleKeyHelp : `${B.scheduleSummary({ ...Ot, from: wt(Ot.from), to: wt(Ot.to) })}${yt === null ? "" : ` ${yt}.`} ${B.scheduleKeyHelp}` }),
1039
+ /* @__PURE__ */ m(De, { id: Dt, children: v === e.getServerSnapshot() ? B.scheduleKeyHelp : `${B.scheduleSummary({ ...$t, from: bt($t.from), to: bt($t.to) })}${wt === null ? "" : ` ${wt}.`} ${B.scheduleKeyHelp}` }),
1043
1040
  ys
1044
1041
  ]
1045
1042
  }
1046
1043
  ) });
1047
1044
  }
1048
- function oi(n) {
1045
+ function ai(s) {
1049
1046
  try {
1050
- return n.matches(":focus-visible");
1047
+ return s.matches(":focus-visible");
1051
1048
  } catch {
1052
1049
  return !0;
1053
1050
  }
1054
1051
  }
1055
- function ai() {
1056
- const n = Qe(), t = Zs(n), e = pt(), s = rt(), i = de(), o = te(
1057
- t?.subscribe ?? ri,
1052
+ function ri() {
1053
+ const s = Qe(), t = Js(s), e = gt(), n = rt(), i = he(), o = ee(
1054
+ t?.subscribe ?? li,
1058
1055
  t?.getSnapshot ?? (() => null),
1059
1056
  t?.getServerSnapshot ?? (() => null)
1060
1057
  );
@@ -1067,25 +1064,25 @@ function ai() {
1067
1064
  return p.has(f.lane) && y.to >= l && y.from <= d;
1068
1065
  }).sort((f, y) => p.get(f.lane) - p.get(y.lane) || f.from - y.from);
1069
1066
  r = /* @__PURE__ */ E("table", { className: k.dataTable, children: [
1070
- /* @__PURE__ */ m("caption", { children: s.scheduleTableCaption(h(l), h(d)) }),
1067
+ /* @__PURE__ */ m("caption", { children: n.scheduleTableCaption(h(l), h(d)) }),
1071
1068
  /* @__PURE__ */ m("thead", { children: /* @__PURE__ */ m("tr", { children: [
1072
- s.scheduleColumnLane,
1073
- s.scheduleColumnTask,
1074
- s.scheduleColumnSubtask,
1075
- s.scheduleColumnFrom,
1076
- s.scheduleColumnTo,
1077
- s.scheduleColumnDuration,
1078
- s.scheduleColumnFindings
1069
+ n.scheduleColumnLane,
1070
+ n.scheduleColumnTask,
1071
+ n.scheduleColumnSubtask,
1072
+ n.scheduleColumnFrom,
1073
+ n.scheduleColumnTo,
1074
+ n.scheduleColumnDuration,
1075
+ n.scheduleColumnFindings
1079
1076
  ].map((f) => /* @__PURE__ */ m("th", { scope: "col", children: f }, f)) }) }),
1080
1077
  /* @__PURE__ */ m("tbody", { children: g.map((f) => {
1081
1078
  const y = c.tooltipTargetFor({ kind: "subtask", subtask: f, part: "main" }), A = y?.kind !== "subtask" ? [] : [
1082
- ...y.overlapping.map((M) => s.scheduleOverlapWith(M.name ?? M.id)),
1083
- ...y.violatedDependencies.map((M) => s.scheduleViolatedBy(i(M.shortBy))),
1084
- ...y.blocked.map((M) => s.scheduleInBlockedTime(M.label))
1079
+ ...y.overlapping.map((M) => n.scheduleOverlapWith(M.name ?? M.id)),
1080
+ ...y.violatedDependencies.map((M) => n.scheduleViolatedBy(i(M.shortBy))),
1081
+ ...y.blocked.map((M) => n.scheduleInBlockedTime(M.label))
1085
1082
  ], C = [
1086
1083
  i(f.to - f.from),
1087
- ...(f.leadIn ?? 0) > 0 ? [`${s.scheduleLeadIn} ${i(f.leadIn)}`] : [],
1088
- ...(f.leadOut ?? 0) > 0 ? [`${s.scheduleLeadOut} ${i(f.leadOut)}`] : []
1084
+ ...(f.leadIn ?? 0) > 0 ? [`${n.scheduleLeadIn} ${i(f.leadIn)}`] : [],
1085
+ ...(f.leadOut ?? 0) > 0 ? [`${n.scheduleLeadOut} ${i(f.leadOut)}`] : []
1089
1086
  ].join(", ");
1090
1087
  return /* @__PURE__ */ E("tr", { children: [
1091
1088
  /* @__PURE__ */ m("td", { children: c.lanes.find((M) => M.id === f.lane)?.label }),
@@ -1107,51 +1104,51 @@ function ai() {
1107
1104
  className: k.dataKey,
1108
1105
  "data-schedule-overlay": "data key",
1109
1106
  "aria-expanded": a,
1110
- "aria-controls": a ? n : void 0,
1107
+ "aria-controls": a ? s : void 0,
1111
1108
  onClick: () => t.toggleDataTable(),
1112
- children: a ? s.scheduleHideData : s.scheduleShowData
1109
+ children: a ? n.scheduleHideData : n.scheduleShowData
1113
1110
  }
1114
1111
  ),
1115
1112
  a && // A tab stop of its own: the panel scrolls, and a keyboard has to be
1116
1113
  // able to scroll it.
1117
- /* @__PURE__ */ m("div", { id: n, className: k.dataPanel, tabIndex: 0, children: r })
1114
+ /* @__PURE__ */ m("div", { id: s, className: k.dataPanel, tabIndex: 0, children: r })
1118
1115
  ] });
1119
1116
  }
1120
- const ri = () => () => {
1117
+ const li = () => () => {
1121
1118
  };
1122
- function li({ id: n, label: t }) {
1123
- const e = ns(), s = X(() => ({ id: n, label: t ?? n, ...e === null ? {} : { parent: e } }), [n, t, e]);
1124
- return qs(s), null;
1119
+ function di({ id: s, label: t }) {
1120
+ const e = ns(), n = X(() => ({ id: s, label: t ?? s, ...e === null ? {} : { parent: e } }), [s, t, e]);
1121
+ return js(n), null;
1125
1122
  }
1126
- function di({ id: n, label: t, children: e }) {
1127
- const s = ns(), i = X(() => ({ id: n, label: t ?? n, ...s === null ? {} : { parent: s } }), [n, t, s]);
1128
- return js(i), /* @__PURE__ */ m(ss, { value: n, children: e });
1123
+ function hi({ id: s, label: t, children: e }) {
1124
+ const n = ns(), i = X(() => ({ id: s, label: t ?? s, ...n === null ? {} : { parent: n } }), [s, t, n]);
1125
+ return Zs(i), /* @__PURE__ */ m(ss, { value: s, children: e });
1129
1126
  }
1130
- function hi({ data: n, tasks: t }) {
1131
- const e = X(() => ({ kind: "subtasks", data: n, tasks: t }), [n, t]);
1132
- return Lt("Subtasks", e), null;
1127
+ function ci({ data: s, tasks: t }) {
1128
+ const e = X(() => ({ kind: "subtasks", data: s, tasks: t }), [s, t]);
1129
+ return At("Subtasks", e), null;
1133
1130
  }
1134
- function ci({ data: n }) {
1135
- const t = X(() => ({ kind: "dependencies", data: n }), [n]);
1136
- return Lt("Dependencies", t), null;
1131
+ function ui({ data: s }) {
1132
+ const t = X(() => ({ kind: "dependencies", data: s }), [s]);
1133
+ return At("Dependencies", t), null;
1137
1134
  }
1138
- function ui({ data: n }) {
1139
- const t = X(() => ({ kind: "blocked", data: n }), [n]);
1140
- return Lt("BlockedTimes", t), null;
1135
+ function fi({ data: s }) {
1136
+ const t = X(() => ({ kind: "blocked", data: s }), [s]);
1137
+ return At("BlockedTimes", t), null;
1141
1138
  }
1142
- function fi({ data: n }) {
1143
- const t = X(() => ({ kind: "milestones", data: n }), [n]);
1144
- return Lt("Milestones", t), null;
1139
+ function mi({ data: s }) {
1140
+ const t = X(() => ({ kind: "milestones", data: s }), [s]);
1141
+ return At("Milestones", t), null;
1145
1142
  }
1146
- function mi() {
1143
+ function pi() {
1147
1144
  try {
1148
1145
  return process.env.NODE_ENV !== "production";
1149
1146
  } catch {
1150
1147
  return !1;
1151
1148
  }
1152
1149
  }
1153
- const Ut = mi(), pi = "@umriss-ui/schedule", j = (n, t) => Ys(pi, n, t);
1154
- class gi {
1150
+ const Xt = pi(), gi = "@umriss-ui/schedule", j = (s, t) => Vs(gi, s, t);
1151
+ class ki {
1155
1152
  /** `changed` is called after every registration change. */
1156
1153
  constructor(t) {
1157
1154
  this.changed = t;
@@ -1217,21 +1214,21 @@ class gi {
1217
1214
  rebuild() {
1218
1215
  if (!this.dirty) return !1;
1219
1216
  this.dirty = !1;
1220
- const t = (s) => [...s.keys()].sort((i, o) => i - o).map((i) => s.get(i));
1217
+ const t = (n) => [...n.keys()].sort((i, o) => i - o).map((i) => n.get(i));
1221
1218
  this.lanes = t(this.laneEntries), this.groups = t(this.groupEntries);
1222
- const e = (s) => {
1223
- if (!(!Array.isArray(s.data) || s.kind === "subtasks" && !Array.isArray(s.tasks))) return s;
1224
- Ut && j(`array:${s.kind}`, `the ${s.kind} layer's data${s.kind === "subtasks" ? " and tasks" : ""} must be arrays, not ${typeof s.data}; what is not an array is not drawn.`);
1225
- const o = Array.isArray(s.data) ? s.data : [];
1226
- return s.kind === "subtasks" ? { ...s, data: o, tasks: Array.isArray(s.tasks) ? s.tasks : [] } : { ...s, data: o };
1219
+ const e = (n) => {
1220
+ if (!(!Array.isArray(n.data) || n.kind === "subtasks" && !Array.isArray(n.tasks))) return n;
1221
+ Xt && j(`array:${n.kind}`, `the ${n.kind} layer's data${n.kind === "subtasks" ? " and tasks" : ""} must be arrays, not ${typeof n.data}; what is not an array is not drawn.`);
1222
+ const o = Array.isArray(n.data) ? n.data : [];
1223
+ return n.kind === "subtasks" ? { ...n, data: o, tasks: Array.isArray(n.tasks) ? n.tasks : [] } : { ...n, data: o };
1227
1224
  };
1228
1225
  this.layers = t(this.layerEntries).map(e), this.subtasks = [], this.dependencies = [], this.blocked = [], this.milestones = [], this.tasks = /* @__PURE__ */ new Map();
1229
- for (const s of this.layers)
1230
- if (s.kind === "subtasks") {
1231
- this.subtasks.push(...s.data);
1232
- for (const i of s.tasks) this.tasks.set(i.id, i);
1233
- } else s.kind === "dependencies" ? this.dependencies.push(...s.data) : s.kind === "milestones" ? this.milestones.push(...s.data) : this.blocked.push(...s.data);
1234
- return this.subtaskById = new Map(this.subtasks.map((s) => [s.id, s])), this.overlaps = ne(this.subtasks), this.violatedById = new Map(ie(this.subtasks, this.dependencies).map((s) => [s.dependency, s])), this.depth = Ws(this.subtasks), this.inBlocked = es(this.subtasks, this.blocked), this.unchecked = !0, !0;
1226
+ for (const n of this.layers)
1227
+ if (n.kind === "subtasks") {
1228
+ this.subtasks.push(...n.data);
1229
+ for (const i of n.tasks) this.tasks.set(i.id, i);
1230
+ } else n.kind === "dependencies" ? this.dependencies.push(...n.data) : n.kind === "milestones" ? this.milestones.push(...n.data) : this.blocked.push(...n.data);
1231
+ return this.subtaskById = new Map(this.subtasks.map((n) => [n.id, n])), this.overlaps = ie(this.subtasks), this.violatedById = new Map(oe(this.subtasks, this.dependencies).map((n) => [n.dependency, n])), this.depth = Us(this.subtasks), this.inBlocked = es(this.subtasks, this.blocked), this.unchecked = !0, !0;
1235
1232
  }
1236
1233
  /** Says in development what the data gets wrong and is drawn, dropped or
1237
1234
  counted regardless. The Schedule calls it from an effect of its own,
@@ -1240,7 +1237,7 @@ class gi {
1240
1237
  missing. With no lane declared the lanes are still on their way, and an
1241
1238
  empty `tasks` is a plan drawn muted on purpose. */
1242
1239
  warnOfMalformedData() {
1243
- if (!this.unchecked || (this.unchecked = !1, !Ut)) return;
1240
+ if (!this.unchecked || (this.unchecked = !1, !Xt)) return;
1244
1241
  const t = (i, o) => {
1245
1242
  const a = /* @__PURE__ */ new Set();
1246
1243
  for (const r of o)
@@ -1261,11 +1258,11 @@ class gi {
1261
1258
  for (const o of [i.from, i.to])
1262
1259
  this.subtaskById.has(o) || j(`end:${i.id}:${o}`, `dependency "${i.id}" names the subtask "${o}", and no subtask has that id; the dependency is left out.`);
1263
1260
  if (this.lanes.length === 0) return;
1264
- const e = new Set(this.lanes.map((i) => i.id)), s = (i, o) => {
1261
+ const e = new Set(this.lanes.map((i) => i.id)), n = (i, o) => {
1265
1262
  for (const { id: a, lane: r } of o)
1266
1263
  e.has(r) || j(`lane:${i}:${a}`, `${i} "${a}" is on the lane "${r}", which no Lane declares; it is left out. Declare <Lane id="${r}" />.`);
1267
1264
  };
1268
- s("subtask", this.subtasks), s("milestone", this.milestones), s("blocked time", this.blocked);
1265
+ n("subtask", this.subtasks), n("milestone", this.milestones), n("blocked time", this.blocked);
1269
1266
  }
1270
1267
  /** The task a dependency belongs to: its departing subtask's. */
1271
1268
  taskOfDependency(t) {
@@ -1280,71 +1277,71 @@ class gi {
1280
1277
  }
1281
1278
  if (t.kind === "milestone") return { kind: "milestone", milestone: t.milestone };
1282
1279
  if (t.kind !== "dependency") return null;
1283
- const e = t.dependency, s = this.taskOfDependency(e);
1280
+ const e = t.dependency, n = this.taskOfDependency(e);
1284
1281
  return {
1285
1282
  kind: "dependency",
1286
1283
  dependency: e,
1287
- task: s !== null ? this.tasks.get(s) : void 0,
1284
+ task: n !== null ? this.tasks.get(n) : void 0,
1288
1285
  from: this.subtaskById.get(e.from),
1289
1286
  to: this.subtaskById.get(e.to),
1290
1287
  violated: this.violatedById.get(e.id)
1291
1288
  };
1292
1289
  }
1293
1290
  }
1294
- const ki = 6;
1295
- function us(n, t, e, s, i, o) {
1296
- n.save(), n.beginPath(), n.rect(t, e, s, i), n.clip(), n.globalAlpha = 0.35, n.strokeStyle = o, n.lineWidth = 1, n.beginPath();
1297
- for (let a = t - i; a < t + s + i; a += ki)
1298
- n.moveTo(a, e + i), n.lineTo(a + i, e);
1299
- n.stroke(), n.restore();
1291
+ const vi = 6;
1292
+ function us(s, t, e, n, i, o) {
1293
+ s.save(), s.beginPath(), s.rect(t, e, n, i), s.clip(), s.globalAlpha = 0.35, s.strokeStyle = o, s.lineWidth = 1, s.beginPath();
1294
+ for (let a = t - i; a < t + n + i; a += vi)
1295
+ s.moveTo(a, e + i), s.lineTo(a + i, e);
1296
+ s.stroke(), s.restore();
1300
1297
  }
1301
- function vi(n, t, e, s) {
1302
- if (s.size === 0) return;
1298
+ function yi(s, t, e, n) {
1299
+ if (n.size === 0) return;
1303
1300
  const { width: i, height: o } = t.view;
1304
- for (const a of s) {
1301
+ for (const a of n) {
1305
1302
  const r = et(e, a);
1306
1303
  if (r === null) continue;
1307
1304
  const { top: l, height: d } = r;
1308
- l + d < 0 || l > o || (n.globalAlpha = 0.6, n.fillStyle = t.colours.surface, n.fillRect(0, l, i, d), n.globalAlpha = 1, us(n, 0, l, i, d, t.colours.muted));
1305
+ l + d < 0 || l > o || (s.globalAlpha = 0.6, s.fillStyle = t.colours.surface, s.fillRect(0, l, i, d), s.globalAlpha = 1, us(s, 0, l, i, d, t.colours.muted));
1309
1306
  }
1310
1307
  }
1311
- function yi(n, t, e) {
1312
- const { data: s } = t;
1313
- if (s.violatedById.size !== 0)
1314
- for (const i of s.violatedById.values()) {
1315
- const o = s.dependencies.find((h) => h.id === i.dependency), a = o === void 0 ? void 0 : s.subtaskById.get(o.to);
1308
+ function wi(s, t, e) {
1309
+ const { data: n } = t;
1310
+ if (n.violatedById.size !== 0)
1311
+ for (const i of n.violatedById.values()) {
1312
+ const o = n.dependencies.find((h) => h.id === i.dependency), a = o === void 0 ? void 0 : n.subtaskById.get(o.to);
1316
1313
  if (a === void 0) continue;
1317
1314
  const r = et(e, a.lane);
1318
1315
  if (r === null || !r.miniature) continue;
1319
1316
  const l = at(e.rows, r.top + e.scrollY);
1320
1317
  if (l === null) continue;
1321
1318
  const d = x(e, i.arrival), c = Math.max(d + 2, x(e, i.arrival + i.shortBy));
1322
- Xt(n, t, d, c, l.top - e.scrollY + 1, 3);
1319
+ qt(s, t, d, c, l.top - e.scrollY + 1, 3);
1323
1320
  }
1324
1321
  }
1325
- function Xt(n, t, e, s, i, o) {
1322
+ function qt(s, t, e, n, i, o) {
1326
1323
  if (!t.colours.forced) {
1327
- n.fillStyle = t.colours.alarm, n.fillRect(e, i, s - e, o);
1324
+ s.fillStyle = t.colours.alarm, s.fillRect(e, i, n - e, o);
1328
1325
  return;
1329
1326
  }
1330
- n.strokeStyle = t.colours.alarm, n.lineWidth = o, n.setLineDash([4, 3]), n.beginPath(), n.moveTo(e, i + o / 2), n.lineTo(s, i + o / 2), n.stroke(), n.setLineDash([]);
1327
+ s.strokeStyle = t.colours.alarm, s.lineWidth = o, s.setLineDash([4, 3]), s.beginPath(), s.moveTo(e, i + o / 2), s.lineTo(n, i + o / 2), s.stroke(), s.setLineDash([]);
1331
1328
  }
1332
- function wi(n, t, e, s) {
1333
- const i = et(e, s.lane);
1329
+ function bi(s, t, e, n) {
1330
+ const i = et(e, n.lane);
1334
1331
  if (i === null || i.top + i.height < 0 || i.top > t.view.height) return;
1335
- const o = Math.max(0, x(e, s.from)), a = Math.min(t.view.width, x(e, s.to));
1336
- a <= o || (n.globalAlpha = 0.1, n.fillStyle = t.colours.muted, n.fillRect(o, i.top, a - o, i.height), n.globalAlpha = 1, us(n, o, i.top, a - o, i.height, t.colours.muted));
1332
+ const o = Math.max(0, x(e, n.from)), a = Math.min(t.view.width, x(e, n.to));
1333
+ a <= o || (s.globalAlpha = 0.1, s.fillStyle = t.colours.muted, s.fillRect(o, i.top, a - o, i.height), s.globalAlpha = 1, us(s, o, i.top, a - o, i.height, t.colours.muted));
1337
1334
  }
1338
- function qt(n, t, e, s) {
1339
- const i = et(e, s.lane);
1335
+ function jt(s, t, e, n) {
1336
+ const i = et(e, n.lane);
1340
1337
  if (i === null) return;
1341
- const o = x(e, s.from), a = Math.max(o + 2, x(e, s.to));
1342
- if (n.fillStyle = t.colours.alarm, n.globalAlpha = 0.14, n.fillRect(o, i.top + 1, a - o, Math.max(1, i.height - 2)), n.globalAlpha = 1, Xt(n, t, o, a, i.top + 1, Math.min(3, Math.max(1, i.height - 1))), i.miniature) {
1338
+ const o = x(e, n.from), a = Math.max(o + 2, x(e, n.to));
1339
+ if (s.fillStyle = t.colours.alarm, s.globalAlpha = 0.14, s.fillRect(o, i.top + 1, a - o, Math.max(1, i.height - 2)), s.globalAlpha = 1, qt(s, t, o, a, i.top + 1, Math.min(3, Math.max(1, i.height - 1))), i.miniature) {
1343
1340
  const r = at(e.rows, i.top + e.scrollY);
1344
- r !== null && Xt(n, t, o, a, r.top - e.scrollY + 1, 3);
1341
+ r !== null && qt(s, t, o, a, r.top - e.scrollY + 1, 3);
1345
1342
  }
1346
1343
  }
1347
- const bi = {
1344
+ const Mi = {
1348
1345
  line: "var(--u-hairline)",
1349
1346
  lineStrong: "var(--u-hairline-strong)",
1350
1347
  text: "var(--u-color-text)",
@@ -1368,11 +1365,11 @@ const bi = {
1368
1365
  active: "Highlight",
1369
1366
  now: "GrayText",
1370
1367
  onAccent: "Canvas"
1371
- }, Mi = (n) => n ? fs : bi, Ti = () => typeof window < "u" && typeof window.matchMedia == "function" && window.matchMedia("(forced-colors: active)").matches;
1372
- function Si(n, t) {
1373
- const e = Ti(), s = {};
1374
- for (const a of t.tasks.values()) s[`task:${a.id}`] = e ? fs.text : a.color;
1375
- const i = Bs(n, { ...Mi(e), ...s }), o = /* @__PURE__ */ new Map();
1368
+ }, Ti = (s) => s ? fs : Mi, Si = () => typeof window < "u" && typeof window.matchMedia == "function" && window.matchMedia("(forced-colors: active)").matches;
1369
+ function Ii(s, t) {
1370
+ const e = Si(), n = {};
1371
+ for (const a of t.tasks.values()) n[`task:${a.id}`] = e ? fs.text : a.color;
1372
+ const i = Bs(s, { ...Ti(e), ...n }), o = /* @__PURE__ */ new Map();
1376
1373
  for (const a of t.tasks.values()) o.set(a.id, i[`task:${a.id}`] ?? a.color);
1377
1374
  return {
1378
1375
  line: i.line,
@@ -1388,277 +1385,277 @@ function Si(n, t) {
1388
1385
  forced: e
1389
1386
  };
1390
1387
  }
1391
- function mt(n) {
1392
- const t = n.match(/[\d.]+/g);
1388
+ function pt(s) {
1389
+ const t = s.match(/[\d.]+/g);
1393
1390
  return t === null || t.length < 3 ? null : [Number(t[0]), Number(t[1]), Number(t[2])];
1394
1391
  }
1395
- function Ne(n) {
1396
- const t = mt(n);
1392
+ function Pe(s) {
1393
+ const t = pt(s);
1397
1394
  return t === null ? 0 : ps(ms(t));
1398
1395
  }
1399
- function ms(n) {
1400
- return n.map((t) => {
1396
+ function ms(s) {
1397
+ return s.map((t) => {
1401
1398
  const e = t / 255;
1402
1399
  return e <= 0.04045 ? e / 12.92 : ((e + 0.055) / 1.055) ** 2.4;
1403
1400
  });
1404
1401
  }
1405
- function ps([n, t, e]) {
1406
- return 0.2126 * n + 0.7152 * t + 0.0722 * e;
1407
- }
1408
- function Pe(n, t) {
1409
- const e = Ne(n), s = Ne(t);
1410
- return (Math.max(e, s) + 0.05) / (Math.min(e, s) + 0.05);
1411
- }
1412
- function Re(n, t, e) {
1413
- if (n === null) return null;
1414
- const s = typeof window > "u" ? 1 : window.devicePixelRatio || 1, i = Math.round(t * s), o = Math.round(e * s);
1415
- n.width !== i && (n.width = i), n.height !== o && (n.height = o);
1416
- const a = n.getContext("2d");
1417
- return a === null ? null : (a.setTransform(s, 0, 0, s, 0, 0), a.clearRect(0, 0, t, e), a);
1418
- }
1419
- function Ii(n, t) {
1420
- const { data: e, view: s } = t, i = s.viewport();
1421
- Ci(n, t, i);
1422
- for (const o of e.blocked) wi(n, t, i, o);
1423
- Di(n, t);
1402
+ function ps([s, t, e]) {
1403
+ return 0.2126 * s + 0.7152 * t + 0.0722 * e;
1404
+ }
1405
+ function Re(s, t) {
1406
+ const e = Pe(s), n = Pe(t);
1407
+ return (Math.max(e, n) + 0.05) / (Math.min(e, n) + 0.05);
1408
+ }
1409
+ function Ge(s, t, e) {
1410
+ if (s === null) return null;
1411
+ const n = typeof window > "u" ? 1 : window.devicePixelRatio || 1, i = Math.round(t * n), o = Math.round(e * n);
1412
+ s.width !== i && (s.width = i), s.height !== o && (s.height = o);
1413
+ const a = s.getContext("2d");
1414
+ return a === null ? null : (a.setTransform(n, 0, 0, n, 0, 0), a.clearRect(0, 0, t, e), a);
1415
+ }
1416
+ function Li(s, t) {
1417
+ const { data: e, view: n } = t, i = n.viewport();
1418
+ Di(s, t, i);
1419
+ for (const o of e.blocked) bi(s, t, i, o);
1420
+ _i(s, t);
1424
1421
  for (const o of e.layers) {
1425
1422
  if (o.kind === "blocked" || o.kind === "milestones") continue;
1426
1423
  const a = new Set(o.data);
1427
1424
  if (o.kind === "dependencies")
1428
- for (const r of s.paths) a.has(r.dependency) && on(r, s.width, s.height) && jt(n, t, r, !1);
1425
+ for (const r of n.paths) a.has(r.dependency) && an(r, n.width, n.height) && Zt(s, t, r, !1);
1429
1426
  else
1430
- for (const r of s.boxes) a.has(r.subtask) && ks(n, t, r, 1);
1427
+ for (const r of n.boxes) a.has(r.subtask) && ks(s, t, r, 1);
1431
1428
  }
1432
- for (const o of e.overlaps) qt(n, t, i, o);
1433
- for (const o of e.inBlocked) qt(n, t, i, o);
1434
- yi(n, t, i);
1435
- for (const o of e.milestones) vs(n, t, i, o, !1);
1436
- Ni(n, t);
1429
+ for (const o of e.overlaps) jt(s, t, i, o);
1430
+ for (const o of e.inBlocked) jt(s, t, i, o);
1431
+ wi(s, t, i);
1432
+ for (const o of e.milestones) vs(s, t, i, o, !1);
1433
+ Pi(s, t);
1437
1434
  }
1438
- function Li(n, t) {
1439
- const { view: e, hover: s } = t, i = e.viewport();
1435
+ function Ai(s, t) {
1436
+ const { view: e, hover: n } = t, i = e.viewport();
1440
1437
  if (t.ghost === null) {
1441
- if (s.kind === "subtask") {
1442
- const h = e.boxById.get(s.subtask.id);
1443
- h !== void 0 && Bi(n, t, h);
1444
- } else if (s.kind === "dependency") {
1445
- const h = e.paths.find((p) => p.dependency === s.dependency);
1446
- h !== void 0 && jt(n, t, h, !0);
1447
- } else s.kind === "milestone" && vs(n, t, i, s.milestone, !0);
1438
+ if (n.kind === "subtask") {
1439
+ const h = e.boxById.get(n.subtask.id);
1440
+ h !== void 0 && xi(s, t, h);
1441
+ } else if (n.kind === "dependency") {
1442
+ const h = e.paths.find((p) => p.dependency === n.dependency);
1443
+ h !== void 0 && Zt(s, t, h, !0);
1444
+ } else n.kind === "milestone" && vs(s, t, i, n.milestone, !0);
1448
1445
  return;
1449
1446
  }
1450
1447
  const o = t.ghost, { ghost: a, overlaps: r, violated: l } = o;
1451
- vi(n, t, i, o.refusedLanes);
1448
+ yi(s, t, i, o.refusedLanes);
1452
1449
  const d = gs(i, a);
1453
1450
  if (d === null) return;
1454
- for (const h of r) qt(n, t, i, h);
1451
+ for (const h of r) jt(s, t, i, h);
1455
1452
  const c = new Set(l.map((h) => h.dependency));
1456
1453
  for (const h of t.data.dependencies) {
1457
1454
  if (h.from !== a.id && h.to !== a.id) continue;
1458
1455
  const p = e.boxById.get(h.from === a.id ? h.to : h.from);
1459
1456
  if (p === void 0) continue;
1460
- const g = h.from === a.id ? zt(i, h, d, p, e.options) : zt(i, h, p, d, e.options);
1461
- jt(n, t, g, !0, c.has(h.id));
1457
+ const g = h.from === a.id ? Wt(i, h, d, p, e.options) : Wt(i, h, p, d, e.options);
1458
+ Zt(s, t, g, !0, c.has(h.id));
1462
1459
  }
1463
- ks(n, { ...t, selectedTask: null }, d, 0.55), n.strokeStyle = t.colours.text, n.lineWidth = 1, n.setLineDash([3, 2]), n.strokeRect(d.outerFrom + 0.5, d.y + 0.5, Math.max(1, d.outerTo - d.outerFrom - 1), d.height - 1), n.setLineDash([]), o.tether !== null && Ai(n, t, d, o.tether);
1460
+ ks(s, { ...t, selectedTask: null }, d, 0.55), s.strokeStyle = t.colours.text, s.lineWidth = 1, s.setLineDash([3, 2]), s.strokeRect(d.outerFrom + 0.5, d.y + 0.5, Math.max(1, d.outerTo - d.outerFrom - 1), d.height - 1), s.setLineDash([]), o.tether !== null && Ci(s, t, d, o.tether);
1464
1461
  }
1465
- function Ai(n, t, e, s) {
1466
- const i = Math.max(e.outerFrom, Math.min(e.outerTo, s.x)), o = Math.max(e.y, Math.min(e.y + e.height, s.y));
1467
- Math.hypot(s.x - i, s.y - o) < 2 || (n.strokeStyle = t.colours.text, n.lineWidth = 1, n.setLineDash([2, 3]), n.beginPath(), n.moveTo(i + 0.5, o + 0.5), n.lineTo(s.x + 0.5, s.y + 0.5), n.stroke(), n.setLineDash([]));
1462
+ function Ci(s, t, e, n) {
1463
+ const i = Math.max(e.outerFrom, Math.min(e.outerTo, n.x)), o = Math.max(e.y, Math.min(e.y + e.height, n.y));
1464
+ Math.hypot(n.x - i, n.y - o) < 2 || (s.strokeStyle = t.colours.text, s.lineWidth = 1, s.setLineDash([2, 3]), s.beginPath(), s.moveTo(i + 0.5, o + 0.5), s.lineTo(n.x + 0.5, n.y + 0.5), s.stroke(), s.setLineDash([]));
1468
1465
  }
1469
- function gs(n, t) {
1470
- const e = re(n.rows, t.lane);
1471
- return e === null ? null : as(n, t, e, 0);
1466
+ function gs(s, t) {
1467
+ const e = le(s.rows, t.lane);
1468
+ return e === null ? null : as(s, t, e, 0);
1472
1469
  }
1473
- function Ci(n, t, e) {
1474
- const { view: s, colours: i, bands: o } = t, { width: a, height: r } = s;
1475
- n.lineWidth = 1, n.strokeStyle = i.line, n.beginPath();
1470
+ function Di(s, t, e) {
1471
+ const { view: n, colours: i, bands: o } = t, { width: a, height: r } = n;
1472
+ s.lineWidth = 1, s.strokeStyle = i.line, s.beginPath();
1476
1473
  for (const c of o.ticks)
1477
- n.moveTo(c.x + 0.5, 0), n.lineTo(c.x + 0.5, r);
1474
+ s.moveTo(c.x + 0.5, 0), s.lineTo(c.x + 0.5, r);
1478
1475
  for (const c of e.rows.rows) {
1479
1476
  const h = c.top + c.height - e.scrollY - 0.5;
1480
- h < 0 || h > r || (n.moveTo(0, h), n.lineTo(a, h));
1477
+ h < 0 || h > r || (s.moveTo(0, h), s.lineTo(a, h));
1481
1478
  }
1482
1479
  const l = [...e.rows.slots.values()].filter((c) => c.miniature).sort((c, h) => c.top - h.top);
1483
1480
  l.forEach((c, h) => {
1484
1481
  const p = l[h + 1];
1485
1482
  if (p === void 0 || p.top !== c.top + c.height || p.group === c.group) return;
1486
1483
  const g = c.top + c.height - e.scrollY - 0.5;
1487
- g < 0 || g > r || (n.moveTo(0, g), n.lineTo(a, g));
1488
- }), n.stroke(), n.strokeStyle = i.lineStrong, n.beginPath();
1484
+ g < 0 || g > r || (s.moveTo(0, g), s.lineTo(a, g));
1485
+ }), s.stroke(), s.strokeStyle = i.lineStrong, s.beginPath();
1489
1486
  for (const c of o.days)
1490
- n.moveTo(c.x + 0.5, 0), n.lineTo(c.x + 0.5, r);
1491
- n.stroke();
1492
- const d = xs(s.options.calendar);
1487
+ s.moveTo(c.x + 0.5, 0), s.lineTo(c.x + 0.5, r);
1488
+ s.stroke();
1489
+ const d = xs(n.options.calendar);
1493
1490
  if (d.length > 0) {
1494
- n.strokeStyle = i.muted, n.setLineDash([2, 3]), n.beginPath();
1491
+ s.strokeStyle = i.muted, s.setLineDash([2, 3]), s.beginPath();
1495
1492
  for (const c of d) {
1496
1493
  const h = Math.round(e.scale.toPx(c.workingTime)) + 0.5;
1497
- h < 0 || h > a || (n.moveTo(h, 0), n.lineTo(h, r));
1494
+ h < 0 || h > a || (s.moveTo(h, 0), s.lineTo(h, r));
1498
1495
  }
1499
- n.stroke(), n.setLineDash([]);
1496
+ s.stroke(), s.setLineDash([]);
1500
1497
  }
1501
1498
  }
1502
- function Di(n, t) {
1499
+ function _i(s, t) {
1503
1500
  const e = t.view.nowX();
1504
- e !== null && (n.fillStyle = t.colours.now, n.fillRect(e, 0, 2, t.view.height));
1501
+ e !== null && (s.fillStyle = t.colours.now, s.fillRect(e, 0, 2, t.view.height));
1505
1502
  }
1506
- function _i(n, t, e, s) {
1507
- const i = gt(t.colours, t, e.subtask.task, e.subtask.id);
1508
- n.fillStyle = i;
1503
+ function Oi(s, t, e, n) {
1504
+ const i = kt(t.colours, t, e.subtask.task, e.subtask.id);
1505
+ s.fillStyle = i;
1509
1506
  for (const [o, a] of [
1510
1507
  [e.outerFrom, e.mainFrom],
1511
1508
  [e.mainTo, e.outerTo]
1512
1509
  ])
1513
- a <= o || (n.globalAlpha = 0.28 * s, n.fillRect(o, e.y, a - o, e.height));
1514
- n.globalAlpha = s, n.fillRect(e.mainFrom, e.y, Math.max(1, e.mainTo - e.mainFrom), e.height), n.globalAlpha = 1;
1515
- }
1516
- function he(n, t, e) {
1517
- if (n.dashed) return { fill: null, onDark: !1 };
1518
- const s = n.muted ? Oi(t, e.surface, 0.5) : t;
1519
- return { fill: s, onDark: Pe(s, e.onAccent) > Pe(s, e.text) };
1520
- }
1521
- function Oi(n, t, e) {
1522
- const s = mt(n), i = mt(t);
1523
- if (s === null || i === null) return n;
1524
- const o = (a) => Math.round(s[a] + (i[a] - s[a]) * e);
1510
+ a <= o || (s.globalAlpha = 0.28 * n, s.fillRect(o, e.y, a - o, e.height));
1511
+ s.globalAlpha = n, s.fillRect(e.mainFrom, e.y, Math.max(1, e.mainTo - e.mainFrom), e.height), s.globalAlpha = 1;
1512
+ }
1513
+ function ce(s, t, e) {
1514
+ if (s.dashed) return { fill: null, onDark: !1 };
1515
+ const n = s.muted ? $i(t, e.surface, 0.5) : t;
1516
+ return { fill: n, onDark: Re(n, e.onAccent) > Re(n, e.text) };
1517
+ }
1518
+ function $i(s, t, e) {
1519
+ const n = pt(s), i = pt(t);
1520
+ if (n === null || i === null) return s;
1521
+ const o = (a) => Math.round(n[a] + (i[a] - n[a]) * e);
1525
1522
  return `rgb(${o(0)}, ${o(1)}, ${o(2)})`;
1526
1523
  }
1527
- function Ge(n, t) {
1528
- const e = mt(n);
1529
- if (e === null || t === 0) return n;
1530
- const s = ms(e), i = ps(s), [o, a, r] = s.map((l) => {
1524
+ function He(s, t) {
1525
+ const e = pt(s);
1526
+ if (e === null || t === 0) return s;
1527
+ const n = ms(e), i = ps(n), [o, a, r] = n.map((l) => {
1531
1528
  const d = l + (i - l) * t, c = d <= 31308e-7 ? d * 12.92 : 1.055 * d ** (1 / 2.4) - 0.055;
1532
1529
  return Math.round(Math.min(1, Math.max(0, c)) * 255);
1533
1530
  });
1534
1531
  return `rgb(${o}, ${a}, ${r})`;
1535
1532
  }
1536
- function gt(n, t, e, s) {
1537
- const i = (e === null ? void 0 : n.tasks.get(e)) ?? n.muted;
1538
- return t.selectedTask === null ? i : e !== t.selectedTask ? n.forced ? n.muted : Ge(i, 1) : n.forced || t.selectedSubtask === null || s === null || s === t.selectedSubtask ? i : Ge(i, 0.5);
1533
+ function kt(s, t, e, n) {
1534
+ const i = (e === null ? void 0 : s.tasks.get(e)) ?? s.muted;
1535
+ return t.selectedTask === null ? i : e !== t.selectedTask ? s.forced ? s.muted : He(i, 1) : s.forced || t.selectedSubtask === null || n === null || n === t.selectedSubtask ? i : He(i, 0.5);
1539
1536
  }
1540
- const $i = 2;
1541
- function ks(n, t, e, s) {
1537
+ const Fi = 2;
1538
+ function ks(s, t, e, n) {
1542
1539
  const { view: i, colours: o } = t;
1543
- if (!Vt(e, i.width, i.height)) return;
1540
+ if (!zt(e, i.width, i.height)) return;
1544
1541
  if (e.miniature) {
1545
- _i(n, t, e, s);
1542
+ Oi(s, t, e, n);
1546
1543
  return;
1547
1544
  }
1548
- const a = It(e.subtask.appearance), r = gt(o, t, e.subtask.task, e.subtask.id), l = he(a, r, o), d = e.y, c = e.height, h = Math.max(1, e.mainTo - e.mainFrom), p = l.onDark ? o.onAccent : o.text;
1549
- n.lineWidth = 1, n.fillStyle = r, n.strokeStyle = r;
1545
+ const a = Lt(e.subtask.appearance), r = kt(o, t, e.subtask.task, e.subtask.id), l = ce(a, r, o), d = e.y, c = e.height, h = Math.max(1, e.mainTo - e.mainFrom), p = l.onDark ? o.onAccent : o.text;
1546
+ s.lineWidth = 1, s.fillStyle = r, s.strokeStyle = r;
1550
1547
  for (const [f, y] of [
1551
1548
  [e.outerFrom, e.mainFrom],
1552
1549
  [e.mainTo, e.outerTo]
1553
1550
  ])
1554
- y <= f || (n.globalAlpha = 0.28 * s, n.fillRect(f, d, y - f, c), n.globalAlpha = s, n.strokeRect(f + 0.5, d + 0.5, y - f - 1, c - 1));
1555
- l.fill !== null && (n.globalAlpha = s, n.fillStyle = l.fill, n.fillRect(e.mainFrom, d, h, c));
1551
+ y <= f || (s.globalAlpha = 0.28 * n, s.fillRect(f, d, y - f, c), s.globalAlpha = n, s.strokeRect(f + 0.5, d + 0.5, y - f - 1, c - 1));
1552
+ l.fill !== null && (s.globalAlpha = n, s.fillStyle = l.fill, s.fillRect(e.mainFrom, d, h, c));
1556
1553
  const g = e.subtask.progress;
1557
1554
  if (g !== void 0) {
1558
- const f = Math.min(4, Math.max(2, Math.round(c / 6))), y = d + c - f - $i, A = Math.round(h * Math.max(0, Math.min(1, g)));
1559
- n.fillStyle = l.fill === null ? r : p, n.globalAlpha = 0.3 * s, n.fillRect(e.mainFrom, y, h, f), n.globalAlpha = s, A > 0 && n.fillRect(e.mainFrom, y, A, f);
1555
+ const f = Math.min(4, Math.max(2, Math.round(c / 6))), y = d + c - f - Fi, A = Math.round(h * Math.max(0, Math.min(1, g)));
1556
+ s.fillStyle = l.fill === null ? r : p, s.globalAlpha = 0.3 * n, s.fillRect(e.mainFrom, y, h, f), s.globalAlpha = n, A > 0 && s.fillRect(e.mainFrom, y, A, f);
1560
1557
  }
1561
1558
  if (a.hatched) {
1562
- const f = Math.max(1, Math.min(os, Math.floor((h - 2 * ht) / 3))), y = h >= 4 * f ? ht : 0, A = c >= 4 * ht ? ht : 0;
1563
- n.globalAlpha = s, n.fillStyle = p, n.fillRect(e.mainFrom + y, d + A, f, c - 2 * A), n.fillRect(e.mainTo - y - f, d + A, f, c - 2 * A);
1559
+ const f = Math.max(1, Math.min(os, Math.floor((h - 2 * ct) / 3))), y = h >= 4 * f ? ct : 0, A = c >= 4 * ct ? ct : 0;
1560
+ s.globalAlpha = n, s.fillStyle = p, s.fillRect(e.mainFrom + y, d + A, f, c - 2 * A), s.fillRect(e.mainTo - y - f, d + A, f, c - 2 * A);
1564
1561
  }
1565
- a.open && Ei(n, e, d, c, o.surface, i.width), a.dashed && (n.globalAlpha = s, n.strokeStyle = r, n.setLineDash([4, 3]), n.strokeRect(e.mainFrom + 0.5, d + 0.5, h - 1, c - 1), n.setLineDash([])), n.globalAlpha = 1, e.depth > 0 && s === 1 && (n.strokeStyle = o.surface, n.strokeRect(e.outerFrom - 0.5, d - 0.5, e.outerTo - e.outerFrom + 1, c + 1));
1562
+ a.open && Bi(s, e, d, c, o.surface, i.width), a.dashed && (s.globalAlpha = n, s.strokeStyle = r, s.setLineDash([4, 3]), s.strokeRect(e.mainFrom + 0.5, d + 0.5, h - 1, c - 1), s.setLineDash([])), s.globalAlpha = 1, e.depth > 0 && n === 1 && (s.strokeStyle = o.surface, s.strokeRect(e.outerFrom - 0.5, d - 0.5, e.outerTo - e.outerFrom + 1, c + 1));
1566
1563
  }
1567
- const Fi = 16;
1568
- function Ei(n, t, e, s, i, o) {
1569
- const a = t.mainFrom < 0, r = t.mainTo > o, l = Math.max(1, Math.min(t.mainTo, o) - Math.max(t.mainFrom, 0)), d = Math.min(Fi, l);
1570
- a && He(n, 0, d, e, s, i), r && He(n, o, -d, e, s, i);
1564
+ const Ei = 16;
1565
+ function Bi(s, t, e, n, i, o) {
1566
+ const a = t.mainFrom < 0, r = t.mainTo > o, l = Math.max(1, Math.min(t.mainTo, o) - Math.max(t.mainFrom, 0)), d = Math.min(Ei, l);
1567
+ a && Ke(s, 0, d, e, n, i), r && Ke(s, o, -d, e, n, i);
1571
1568
  }
1572
- function He(n, t, e, s, i, o) {
1573
- const a = n.createLinearGradient(t, 0, t + e, 0);
1574
- a.addColorStop(0, Ke(o, 1)), a.addColorStop(1, Ke(o, 0)), n.globalAlpha = 1, n.fillStyle = a, n.fillRect(Math.min(t, t + e), s, Math.abs(e), i);
1569
+ function Ke(s, t, e, n, i, o) {
1570
+ const a = s.createLinearGradient(t, 0, t + e, 0);
1571
+ a.addColorStop(0, Ye(o, 1)), a.addColorStop(1, Ye(o, 0)), s.globalAlpha = 1, s.fillStyle = a, s.fillRect(Math.min(t, t + e), n, Math.abs(e), i);
1575
1572
  }
1576
- function Ke(n, t) {
1577
- const e = mt(n);
1578
- return e === null ? n : `rgba(${e[0]}, ${e[1]}, ${e[2]}, ${t})`;
1573
+ function Ye(s, t) {
1574
+ const e = pt(s);
1575
+ return e === null ? s : `rgba(${e[0]}, ${e[1]}, ${e[2]}, ${t})`;
1579
1576
  }
1580
- function jt(n, t, e, s, i) {
1581
- const { data: o, colours: a } = t, r = o.taskOfDependency(e.dependency), l = i ?? o.violatedById.has(e.dependency.id), d = r !== null && r === t.selectedTask, c = l ? a.alarm : gt(a, t, r, null);
1582
- if (n.strokeStyle = c, n.fillStyle = c, n.lineWidth = s || d ? 2 : 1.25, n.setLineDash(l ? [4, 3] : []), n.beginPath(), n.moveTo(e.x1, e.y1), e.kind === "curve")
1583
- n.bezierCurveTo(e.c1x, e.y1, e.c2x, e.y2, e.x2, e.y2);
1577
+ function Zt(s, t, e, n, i) {
1578
+ const { data: o, colours: a } = t, r = o.taskOfDependency(e.dependency), l = i ?? o.violatedById.has(e.dependency.id), d = r !== null && r === t.selectedTask, c = l ? a.alarm : kt(a, t, r, null);
1579
+ if (s.strokeStyle = c, s.fillStyle = c, s.lineWidth = n || d ? 2 : 1.25, s.setLineDash(l ? [4, 3] : []), s.beginPath(), s.moveTo(e.x1, e.y1), e.kind === "curve")
1580
+ s.bezierCurveTo(e.c1x, e.y1, e.c2x, e.y2, e.x2, e.y2);
1584
1581
  else
1585
- for (let h = 2; h + 1 < e.points.length; h += 2) n.lineTo(e.points[h], e.points[h + 1]);
1586
- if (n.stroke(), n.setLineDash([]), e.ends === "dot")
1582
+ for (let h = 2; h + 1 < e.points.length; h += 2) s.lineTo(e.points[h], e.points[h + 1]);
1583
+ if (s.stroke(), s.setLineDash([]), e.ends === "dot")
1587
1584
  for (const [h, p] of [
1588
1585
  [e.x1, e.y1],
1589
1586
  [e.x2, e.y2]
1590
1587
  ])
1591
- n.beginPath(), n.arc(h, p, l ? 3 : 2.5, 0, Math.PI * 2), n.fill();
1588
+ s.beginPath(), s.arc(h, p, l ? 3 : 2.5, 0, Math.PI * 2), s.fill();
1592
1589
  }
1593
- function vs(n, t, e, s, i) {
1594
- const o = le(e, s);
1590
+ function vs(s, t, e, n, i) {
1591
+ const o = de(e, n);
1595
1592
  if (o === null || o.x < -o.half || o.x > t.view.width + o.half) return;
1596
1593
  const a = (r) => {
1597
- n.beginPath(), n.moveTo(o.x, o.y - r), n.lineTo(o.x + r, o.y), n.lineTo(o.x, o.y + r), n.lineTo(o.x - r, o.y), n.closePath();
1594
+ s.beginPath(), s.moveTo(o.x, o.y - r), s.lineTo(o.x + r, o.y), s.lineTo(o.x, o.y + r), s.lineTo(o.x - r, o.y), s.closePath();
1598
1595
  };
1599
- i && (a(o.half + 3), n.fillStyle = t.colours.active, n.fill()), a(o.half + 1), n.fillStyle = t.colours.surface, n.fill(), a(o.half), n.fillStyle = t.colours.text, n.fill();
1596
+ i && (a(o.half + 3), s.fillStyle = t.colours.active, s.fill()), a(o.half + 1), s.fillStyle = t.colours.surface, s.fill(), a(o.half), s.fillStyle = t.colours.text, s.fill();
1600
1597
  }
1601
- function Bi(n, t, e) {
1602
- const { colours: s } = t, i = It(e.subtask.appearance), o = he(i, gt(s, t, e.subtask.task, e.subtask.id), s);
1603
- if (s.forced) {
1604
- n.strokeStyle = s.active, n.lineWidth = 2, n.strokeRect(e.outerFrom - 2, e.y - 2, Math.max(1, e.outerTo - e.outerFrom) + 4, e.height + 4);
1598
+ function xi(s, t, e) {
1599
+ const { colours: n } = t, i = Lt(e.subtask.appearance), o = ce(i, kt(n, t, e.subtask.task, e.subtask.id), n);
1600
+ if (n.forced) {
1601
+ s.strokeStyle = n.active, s.lineWidth = 2, s.strokeRect(e.outerFrom - 2, e.y - 2, Math.max(1, e.outerTo - e.outerFrom) + 4, e.height + 4);
1605
1602
  return;
1606
1603
  }
1607
- n.globalAlpha = xi, n.fillStyle = o.onDark ? s.onAccent : s.text, n.fillRect(e.outerFrom, e.y, Math.max(1, e.outerTo - e.outerFrom), e.height), n.globalAlpha = 1;
1604
+ s.globalAlpha = Ni, s.fillStyle = o.onDark ? n.onAccent : n.text, s.fillRect(e.outerFrom, e.y, Math.max(1, e.outerTo - e.outerFrom), e.height), s.globalAlpha = 1;
1608
1605
  }
1609
- const xi = 0.2;
1610
- function Ni(n, t) {
1606
+ const Ni = 0.2;
1607
+ function Pi(s, t) {
1611
1608
  const e = t.selectedTask;
1612
1609
  if (e !== null) {
1613
- n.strokeStyle = t.colours.text;
1614
- for (const s of t.view.boxes) {
1615
- if (s.subtask.task !== e) continue;
1616
- const i = s.subtask.id === t.selectedSubtask;
1617
- n.lineWidth = i ? 2 : 1;
1610
+ s.strokeStyle = t.colours.text;
1611
+ for (const n of t.view.boxes) {
1612
+ if (n.subtask.task !== e) continue;
1613
+ const i = n.subtask.id === t.selectedSubtask;
1614
+ s.lineWidth = i ? 2 : 1;
1618
1615
  const o = i ? 1 : 0.5;
1619
- n.strokeRect(s.outerFrom - o, s.y - o, s.outerTo - s.outerFrom + 2 * o, s.height + 2 * o);
1616
+ s.strokeRect(n.outerFrom - o, n.y - o, n.outerTo - n.outerFrom + 2 * o, n.height + 2 * o);
1620
1617
  }
1621
1618
  }
1622
1619
  }
1623
- const Mt = 32, Pi = 18;
1624
- function Ye(n, t) {
1625
- if (!(t > 2 * Mt)) return 0;
1626
- const e = Mt - n, s = n - (t - Mt), i = Math.max(e, s);
1620
+ const Tt = 32, Ri = 18;
1621
+ function Ve(s, t) {
1622
+ if (!(t > 2 * Tt)) return 0;
1623
+ const e = Tt - s, n = s - (t - Tt), i = Math.max(e, n);
1627
1624
  if (i <= 0) return 0;
1628
- const o = Math.min(1, i / Mt), a = Pi * o * o;
1625
+ const o = Math.min(1, i / Tt), a = Ri * o * o;
1629
1626
  return e > 0 ? -a : a;
1630
1627
  }
1631
- function ut(n, t, e) {
1632
- const s = (i, o) => {
1628
+ function ft(s, t, e) {
1629
+ const n = (i, o) => {
1633
1630
  const a = tt(i);
1634
1631
  return i.lane === o.lane && a.from < o.to && o.from < a.to;
1635
1632
  };
1636
- return e.some((i) => s(n, i) && !(t !== null && s(t, i)));
1633
+ return e.some((i) => n(s, i) && !(t !== null && n(t, i)));
1637
1634
  }
1638
- function Ri(n, t, e, s) {
1635
+ function Gi(s, t, e, n) {
1639
1636
  const i = /* @__PURE__ */ new Set();
1640
- if (s === void 0) return i;
1641
- for (const o of n)
1642
- o !== e && (s(t, o) || i.add(o));
1637
+ if (n === void 0) return i;
1638
+ for (const o of s)
1639
+ o !== e && (n(t, o) || i.add(o));
1643
1640
  return i;
1644
1641
  }
1645
- const Ve = "\0placing", ze = /* @__PURE__ */ new Set();
1646
- function Ht(n) {
1647
- switch (n.kind) {
1642
+ const ze = "\0placing", We = /* @__PURE__ */ new Set();
1643
+ function Kt(s) {
1644
+ switch (s.kind) {
1648
1645
  case "subtask":
1649
- return `subtask:${n.subtask.id}:${n.part}`;
1646
+ return `subtask:${s.subtask.id}:${s.part}`;
1650
1647
  case "dependency":
1651
- return `dependency:${n.dependency.id}`;
1648
+ return `dependency:${s.dependency.id}`;
1652
1649
  case "milestone":
1653
- return `milestone:${n.milestone.id}`;
1650
+ return `milestone:${s.milestone.id}`;
1654
1651
  case "lane":
1655
- return `lane:${n.lane}`;
1652
+ return `lane:${s.lane}`;
1656
1653
  default:
1657
1654
  return "nothing";
1658
1655
  }
1659
1656
  }
1660
- const We = 3, Gi = 10, Hi = 600;
1661
- class Ki {
1657
+ const Ue = 3, Hi = 10, Ki = 600;
1658
+ class Yi {
1662
1659
  constructor(t) {
1663
1660
  this.host = t;
1664
1661
  }
@@ -1685,7 +1682,7 @@ class Ki {
1685
1682
  /** The finger's long press, armed by a touch on a bar that may be moved.
1686
1683
  `armed` is whether the press may still turn into a grab - and, once it
1687
1684
  has, whether the `contextmenu` Android fires for it is the grab's. */
1688
- press = Vs((t) => this.grab(t));
1685
+ press = zs((t) => this.grab(t));
1689
1686
  armed = !1;
1690
1687
  hover = { kind: "nothing" };
1691
1688
  /** Where the pointer rests on the plot while nothing is being dragged - or,
@@ -1726,7 +1723,7 @@ class Ki {
1726
1723
  if (t.kind !== "edit" && t.kind !== "place") return null;
1727
1724
  const e = gs(this.host.view.viewport(), t.ghost);
1728
1725
  if (e === null) return null;
1729
- const s = this.ghostFindings(t.ghost, this.ghostHome(t)), i = t.kind === "edit" && (t.mode === "leadIn" || t.mode === "leadOut"), o = i ? tt(t.ghost) : t.ghost;
1726
+ const n = this.ghostFindings(t.ghost, this.ghostHome(t)), i = t.kind === "edit" && (t.mode === "leadIn" || t.mode === "leadOut"), o = i ? tt(t.ghost) : t.ghost;
1730
1727
  return {
1731
1728
  refused: this.refused,
1732
1729
  refusedLanes: [...t.refused],
@@ -1736,34 +1733,34 @@ class Ki {
1736
1733
  height: e.height,
1737
1734
  from: o.from,
1738
1735
  to: o.to,
1739
- overlap: s.overlaps.length > 0,
1740
- violated: s.violated.length > 0
1736
+ overlap: n.overlaps.length > 0,
1737
+ violated: n.violated.length > 0
1741
1738
  };
1742
1739
  }
1743
1740
  /* ---------------------------------------------------------------- */
1744
1741
  /* Pointer */
1745
1742
  /* ---------------------------------------------------------------- */
1746
1743
  local(t, e) {
1747
- const s = this.host.plotElement()?.getBoundingClientRect();
1748
- return { x: t - (s?.left ?? 0), y: e - (s?.top ?? 0) };
1744
+ const n = this.host.plotElement()?.getBoundingClientRect();
1745
+ return { x: t - (n?.left ?? 0), y: e - (n?.top ?? 0) };
1749
1746
  }
1750
- report(t, e, s, i, o, a) {
1747
+ report(t, e, n, i, o, a) {
1751
1748
  const r = this.host.view;
1752
- this.host.handlers().onInteraction?.({ type: t, hit: e, clientX: s, clientY: i, time: r.timeAt(o), lane: r.laneIdAt(a) });
1749
+ this.host.handlers().onInteraction?.({ type: t, hit: e, clientX: n, clientY: i, time: r.timeAt(o), lane: r.laneIdAt(a) });
1753
1750
  }
1754
1751
  /** The plan is on its way: no drag, no hover, no placing begins. One under
1755
1752
  way finishes and reports as usual. */
1756
1753
  loading = !1;
1757
1754
  pointerDown(t) {
1758
1755
  if (this.loading) return;
1759
- const { x: e, y: s } = this.local(t.clientX, t.clientY);
1760
- if (t.pointerType === "touch" && (this.touches.set(t.pointerId, { x: e, y: s }), this.touches.size >= 2)) {
1756
+ const { x: e, y: n } = this.local(t.clientX, t.clientY);
1757
+ if (t.pointerType === "touch" && (this.touches.set(t.pointerId, { x: e, y: n }), this.touches.size >= 2)) {
1761
1758
  this.press.dispose(), this.armed = !1, this.gesture.kind !== "pinch" && (this.cancelEdit(), this.gesture = { kind: "pinch", distance: this.touchDistance() });
1762
1759
  return;
1763
1760
  }
1764
1761
  if (t.button !== 0) return;
1765
1762
  const i = t.target?.closest?.("[data-grip]")?.getAttribute("data-grip"), o = this.host.selectedSubtask(), a = o !== null ? this.host.data.subtaskById.get(o) ?? null : null;
1766
- t.pointerType === "touch" ? (this.gesture = { kind: "pending", pointerId: t.pointerId, x0: e, y0: s, mode: "pan", subtask: null }, this.armed = this.modeAt(e, s).mode === "move", this.press.pointerDown(t)) : (i === "leadIn" || i === "leadOut") && a !== null ? this.gesture = { kind: "pending", pointerId: t.pointerId, x0: e, y0: s, mode: i, subtask: a } : this.gesture = { kind: "pending", pointerId: t.pointerId, x0: e, y0: s, ...this.modeAt(e, s) }, this.host.plotElement()?.setPointerCapture?.(t.pointerId);
1763
+ t.pointerType === "touch" ? (this.gesture = { kind: "pending", pointerId: t.pointerId, x0: e, y0: n, mode: "pan", subtask: null }, this.armed = this.modeAt(e, n).mode === "move", this.press.pointerDown(t)) : (i === "leadIn" || i === "leadOut") && a !== null ? this.gesture = { kind: "pending", pointerId: t.pointerId, x0: e, y0: n, mode: i, subtask: a } : this.gesture = { kind: "pending", pointerId: t.pointerId, x0: e, y0: n, ...this.modeAt(e, n) }, this.host.plotElement()?.setPointerCapture?.(t.pointerId);
1767
1764
  }
1768
1765
  /** A drag over a folded group: resting on one opens it for the GESTURE.
1769
1766
 
@@ -1773,12 +1770,12 @@ class Ki {
1773
1770
  never written to and no change is reported, because the application did
1774
1771
  not fold anything (ADR-0025). */
1775
1772
  restOver(t) {
1776
- const e = this.host.view, s = e.foldedGroupAt(t);
1777
- s !== this.resting?.group && (this.stopResting(), s !== null && (this.resting = {
1778
- group: s,
1773
+ const e = this.host.view, n = e.foldedGroupAt(t);
1774
+ n !== this.resting?.group && (this.stopResting(), n !== null && (this.resting = {
1775
+ group: n,
1779
1776
  timer: setTimeout(() => {
1780
- this.resting = null, e.openForGesture = /* @__PURE__ */ new Set([...e.openForGesture, s]), this.host.viewChanged();
1781
- }, Hi)
1777
+ this.resting = null, e.openForGesture = /* @__PURE__ */ new Set([...e.openForGesture, n]), this.host.viewChanged();
1778
+ }, Ki)
1782
1779
  }));
1783
1780
  }
1784
1781
  stopResting() {
@@ -1806,18 +1803,18 @@ class Ki {
1806
1803
  gesture that cannot change a lane at all asks nothing: the intents the
1807
1804
  caller handles decide whether the question exists. */
1808
1805
  askRefused(t, e) {
1809
- if (!this.host.view.options.intents.includes(e === null ? "place" : "lane")) return ze;
1810
- const s = this.host.data.lanes.map((i) => i.id);
1811
- return Ri(s, t, e, this.host.handlers().canMoveTo);
1806
+ if (!this.host.view.options.intents.includes(e === null ? "place" : "lane")) return We;
1807
+ const n = this.host.data.lanes.map((i) => i.id);
1808
+ return Gi(n, t, e, this.host.handlers().canMoveTo);
1812
1809
  }
1813
1810
  /** What a press at a point would start, given the intents the caller handles. */
1814
1811
  modeAt(t, e) {
1815
- const s = this.host.view, i = s.options.intents;
1816
- if (s.hitAt(t, e).kind === "milestone") return { mode: "pan", subtask: null };
1817
- for (let o = s.boxes.length - 1; o >= 0; o--) {
1818
- const a = s.boxes[o];
1812
+ const n = this.host.view, i = n.options.intents;
1813
+ if (n.hitAt(t, e).kind === "milestone") return { mode: "pan", subtask: null };
1814
+ for (let o = n.boxes.length - 1; o >= 0; o--) {
1815
+ const a = n.boxes[o];
1819
1816
  if (i.includes("stretch")) {
1820
- const r = nn(a, t, e);
1817
+ const r = on(a, t, e);
1821
1818
  if (r !== null) return { mode: r === "from" ? "stretch-from" : "stretch-to", subtask: a.subtask };
1822
1819
  }
1823
1820
  if (rs(a, t, e) !== null)
@@ -1826,44 +1823,44 @@ class Ki {
1826
1823
  return { mode: "pan", subtask: null };
1827
1824
  }
1828
1825
  pointerMove(t) {
1829
- const { x: e, y: s } = this.local(t.clientX, t.clientY);
1830
- if (t.pointerType === "touch" && this.touches.has(t.pointerId) && (this.touches.set(t.pointerId, { x: e, y: s }), this.press.pointerMove(t), this.gesture.kind === "pinch")) {
1826
+ const { x: e, y: n } = this.local(t.clientX, t.clientY);
1827
+ if (t.pointerType === "touch" && this.touches.has(t.pointerId) && (this.touches.set(t.pointerId, { x: e, y: n }), this.press.pointerMove(t), this.gesture.kind === "pinch")) {
1831
1828
  const a = this.touchDistance();
1832
1829
  a > 0 && this.gesture.distance > 0 && this.host.view.zoomAt(this.touchCentre(), this.gesture.distance / a) && this.host.viewMoved(!0), this.gesture = { kind: "pinch", distance: a };
1833
1830
  return;
1834
1831
  }
1835
1832
  const i = this.gesture;
1836
1833
  if (i.kind === "pending" && i.pointerId === t.pointerId) {
1837
- if (Math.hypot(e - i.x0, s - i.y0) < (t.pointerType === "touch" ? Gi : We)) return;
1834
+ if (Math.hypot(e - i.x0, n - i.y0) < (t.pointerType === "touch" ? Hi : Ue)) return;
1838
1835
  i.mode === "pan" || i.subtask === null ? (this.gesture = { kind: "pan", pointerId: i.pointerId, lastX: i.x0, lastY: i.y0 }, this.setCursor("grabbing")) : this.startEdit(i, i.mode, i.subtask);
1839
1836
  }
1840
1837
  const o = this.gesture;
1841
1838
  if (o.kind === "pan" && o.pointerId === t.pointerId) {
1842
- const a = this.host.view.pan(o.lastX - e, o.lastY - s);
1843
- a.moved && this.host.viewMoved(a.time), this.gesture = { ...o, lastX: e, lastY: s };
1839
+ const a = this.host.view.pan(o.lastX - e, o.lastY - n);
1840
+ a.moved && this.host.viewMoved(a.time), this.gesture = { ...o, lastX: e, lastY: n };
1844
1841
  return;
1845
1842
  }
1846
1843
  if (o.kind === "edit" && o.pointerId === t.pointerId) {
1847
- this.lastClient = { x: t.clientX, y: t.clientY }, this.dragPoint = { x: e, y: s }, this.restOver(s), this.gesture = { ...o, ghost: this.heldGhost(o, e, s) }, this.setCursor(this.refused || this.blocked ? "not-allowed" : o.mode === "move" ? "grabbing" : "ew-resize"), this.host.interactionChanged(), this.autoPan();
1844
+ this.lastClient = { x: t.clientX, y: t.clientY }, this.dragPoint = { x: e, y: n }, this.restOver(n), this.gesture = { ...o, ghost: this.heldGhost(o, e, n) }, this.setCursor(this.refused || this.blocked ? "not-allowed" : o.mode === "move" ? "grabbing" : "ew-resize"), this.host.interactionChanged(), this.autoPan();
1848
1845
  return;
1849
1846
  }
1850
- o.kind === "none" && !this.loading && (this.byKeyboard = !1, this.hoverAt(t.clientX, t.clientY, e, s));
1847
+ o.kind === "none" && !this.loading && (this.byKeyboard = !1, this.hoverAt(t.clientX, t.clientY, e, n));
1851
1848
  }
1852
1849
  /** The drag of `subtask` in `mode`, taking hold where the pending press
1853
1850
  stands. */
1854
- startEdit(t, e, s) {
1851
+ startEdit(t, e, n) {
1855
1852
  this.gesture = {
1856
1853
  kind: "edit",
1857
1854
  pointerId: t.pointerId,
1858
1855
  mode: e,
1859
- subtask: s,
1856
+ subtask: n,
1860
1857
  /* The working time the drag took hold at - not a pixel, because
1861
1858
  auto-pan moves the scale under a drag in flight. */
1862
1859
  t0: this.host.view.viewport().scale.fromPx(t.x0),
1863
- ghost: s,
1860
+ ghost: n,
1864
1861
  /* Asked here, once, and drawn from the first frame of the drag: the
1865
1862
  lanes that are closed are marked before the pointer reaches one. */
1866
- refused: e === "move" ? this.askRefused(s, s.lane) : ze
1863
+ refused: e === "move" ? this.askRefused(n, n.lane) : We
1867
1864
  }, this.setCursor(e === "move" ? "grabbing" : "ew-resize");
1868
1865
  }
1869
1866
  /** The finger has been held on a bar: the bar is grabbed, unless the finger
@@ -1871,8 +1868,8 @@ class Ki {
1871
1868
  grab(t) {
1872
1869
  const e = this.gesture;
1873
1870
  if (!this.armed || this.loading || e.kind !== "pending") return;
1874
- const { x: s, y: i } = this.local(t.x, t.y), { mode: o, subtask: a } = this.modeAt(e.x0, e.y0);
1875
- o !== "move" || a === null || (this.lastClient = { x: t.x, y: t.y }, this.dragPoint = { x: s, y: i }, this.startEdit(e, o, a), this.host.interactionChanged());
1871
+ const { x: n, y: i } = this.local(t.x, t.y), { mode: o, subtask: a } = this.modeAt(e.x0, e.y0);
1872
+ o !== "move" || a === null || (this.lastClient = { x: t.x, y: t.y }, this.dragPoint = { x: n, y: i }, this.startEdit(e, o, a), this.host.interactionChanged());
1876
1873
  }
1877
1874
  /** The page's own scroll, while a bar is grabbed. Registered as not passive
1878
1875
  by the component: a passive listener cannot cancel it. Before the grab and
@@ -1886,13 +1883,13 @@ class Ki {
1886
1883
  this.touches.size === 1 && o !== void 0 ? this.gesture = { kind: "pan", pointerId: o[0], lastX: o[1].x, lastY: o[1].y } : this.touches.size === 0 && (this.gesture = { kind: "none" });
1887
1884
  return;
1888
1885
  }
1889
- const e = this.gesture, { x: s, y: i } = this.local(t.clientX, t.clientY);
1886
+ const e = this.gesture, { x: n, y: i } = this.local(t.clientX, t.clientY);
1890
1887
  if (e.kind === "pending" && e.pointerId === t.pointerId)
1891
- this.gesture = { kind: "none" }, this.click(t.clientX, t.clientY, s, i);
1888
+ this.gesture = { kind: "none" }, this.click(t.clientX, t.clientY, n, i);
1892
1889
  else if (e.kind === "pan" && e.pointerId === t.pointerId)
1893
- this.gesture = { kind: "none" }, this.setCursor("default"), this.hoverAt(t.clientX, t.clientY, s, i);
1890
+ this.gesture = { kind: "none" }, this.setCursor("default"), this.hoverAt(t.clientX, t.clientY, n, i);
1894
1891
  else if (e.kind === "edit" && e.pointerId === t.pointerId) {
1895
- if (t.pointerType === "touch" && (s < 0 || i < 0 || s > this.host.view.width || i > this.host.view.height)) {
1892
+ if (t.pointerType === "touch" && (n < 0 || i < 0 || n > this.host.view.width || i > this.host.view.height)) {
1896
1893
  this.cancelEdit();
1897
1894
  return;
1898
1895
  }
@@ -1913,9 +1910,9 @@ class Ki {
1913
1910
  this.panFrame = 0;
1914
1911
  const e = this.gesture;
1915
1912
  if (e.kind !== "edit" && e.kind !== "place") return;
1916
- const s = this.host.view, { x: i, y: o } = this.local(this.lastClient.x, this.lastClient.y), a = Ye(i, s.width), r = Ye(o, s.height);
1913
+ const n = this.host.view, { x: i, y: o } = this.local(this.lastClient.x, this.lastClient.y), a = Ve(i, n.width), r = Ve(o, n.height);
1917
1914
  if (a === 0 && r === 0) return;
1918
- const l = s.pan(a, r);
1915
+ const l = n.pan(a, r);
1919
1916
  if (l.moved) {
1920
1917
  if (this.dragPoint = { x: i, y: o }, e.kind === "edit")
1921
1918
  this.gesture = { ...e, ghost: this.heldGhost(e, i, o) };
@@ -1940,8 +1937,8 @@ class Ki {
1940
1937
  times would be a lie. Nothing is reported: no interaction happened. */
1941
1938
  refreshHover() {
1942
1939
  if (!this.idle || this.hoverKey === "nothing" || this.byKeyboard) return;
1943
- const { x: t, y: e } = this.hoverPoint, s = this.host.view.hitAt(t, e);
1944
- this.hover = s, this.hoverKey = Ht(s);
1940
+ const { x: t, y: e } = this.hoverPoint, n = this.host.view.hitAt(t, e);
1941
+ this.hover = n, this.hoverKey = Kt(n);
1945
1942
  }
1946
1943
  pointerLeave() {
1947
1944
  this.gesture.kind !== "none" || this.byKeyboard || this.setHover({ kind: "nothing" }, "nothing");
@@ -1953,19 +1950,19 @@ class Ki {
1953
1950
  }
1954
1951
  contextMenu(t) {
1955
1952
  if (this.host.handlers().onInteraction === void 0 || (t.preventDefault(), this.armed || this.editing || this.loading)) return;
1956
- const { x: e, y: s } = this.local(t.clientX, t.clientY);
1957
- this.report("contextmenu", this.host.view.hitAt(e, s), t.clientX, t.clientY, e, s);
1953
+ const { x: e, y: n } = this.local(t.clientX, t.clientY);
1954
+ this.report("contextmenu", this.host.view.hitAt(e, n), t.clientX, t.clientY, e, n);
1958
1955
  }
1959
1956
  /** The wheel, as every scrolling area has it:
1960
1957
  vertical scrolls the lanes, and lets the page scroll on once they are at
1961
1958
  their end; Ctrl or ⌘ zooms - a trackpad pinch arrives as a wheel with
1962
1959
  Ctrl -; horizontal or Shift pans through time. */
1963
1960
  wheel(t) {
1964
- const e = this.host.view, s = Math.max(0, Math.min(e.width, this.local(t.clientX, t.clientY).x)), i = t.deltaMode === 1 ? 16 : t.deltaMode === 2 ? e.height : 1, o = t.deltaX * i, a = t.deltaY * i;
1961
+ const e = this.host.view, n = Math.max(0, Math.min(e.width, this.local(t.clientX, t.clientY).x)), i = t.deltaMode === 1 ? 16 : t.deltaMode === 2 ? e.height : 1, o = t.deltaX * i, a = t.deltaY * i;
1965
1962
  if (t.ctrlKey || t.metaKey) {
1966
1963
  t.preventDefault();
1967
1964
  const d = Math.abs(a) < 50 ? 0.01 : 15e-4;
1968
- e.zoomAt(s, Math.exp(a * d)) && this.host.viewMoved(!0);
1965
+ e.zoomAt(n, Math.exp(a * d)) && this.host.viewMoved(!0);
1969
1966
  return;
1970
1967
  }
1971
1968
  if (Math.abs(o) > Math.abs(a) || t.shiftKey) {
@@ -1980,23 +1977,23 @@ class Ki {
1980
1977
  const l = e.pan(0, a);
1981
1978
  l.moved && this.host.viewMoved(l.time);
1982
1979
  }
1983
- click(t, e, s, i) {
1984
- const o = this.host.view.hitAt(s, i), a = o.kind === "subtask" ? o.subtask.task : o.kind === "dependency" ? this.host.data.taskOfDependency(o.dependency) : null;
1985
- this.host.select(a, o.kind === "subtask" ? o.subtask.id : null), this.report("click", o, t, e, s, i);
1980
+ click(t, e, n, i) {
1981
+ const o = this.host.view.hitAt(n, i), a = o.kind === "subtask" ? o.subtask.task : o.kind === "dependency" ? this.host.data.taskOfDependency(o.dependency) : null;
1982
+ this.host.select(a, o.kind === "subtask" ? o.subtask.id : null), this.report("click", o, t, e, n, i);
1986
1983
  }
1987
- hoverAt(t, e, s, i) {
1988
- const o = this.host.view.hitAt(s, i), a = Ht(o), { mode: r } = this.modeAt(s, i);
1989
- if (this.setCursor(r === "move" ? "grab" : r === "stretch-from" || r === "stretch-to" ? "ew-resize" : "default"), this.hoverPoint = { x: s, y: i }, a === this.hoverKey) {
1984
+ hoverAt(t, e, n, i) {
1985
+ const o = this.host.view.hitAt(n, i), a = Kt(o), { mode: r } = this.modeAt(n, i);
1986
+ if (this.setCursor(r === "move" ? "grab" : r === "stretch-from" || r === "stretch-to" ? "ew-resize" : "default"), this.hoverPoint = { x: n, y: i }, a === this.hoverKey) {
1990
1987
  (o.kind === "subtask" || o.kind === "dependency" || o.kind === "milestone") && this.host.hoverChanged();
1991
1988
  return;
1992
1989
  }
1993
- this.setHover(o, a), this.report("hover", o, t, e, s, i);
1990
+ this.setHover(o, a), this.report("hover", o, t, e, n, i);
1994
1991
  }
1995
1992
  /** The keyboard sets the hover: drawn, and its tooltip shown, as the
1996
1993
  pointer's would be - and reported to nobody, since `onInteraction`
1997
1994
  speaks of pointer positions. `nothing` hands the hover back. */
1998
1995
  setKeyboardHover(t, e) {
1999
- this.byKeyboard = t.kind !== "nothing", this.hoverPoint = e, this.hover = t, this.hoverKey = Ht(t), this.host.interactionChanged();
1996
+ this.byKeyboard = t.kind !== "nothing", this.hoverPoint = e, this.hover = t, this.hoverKey = Kt(t), this.host.interactionChanged();
2000
1997
  }
2001
1998
  setHover(t, e) {
2002
1999
  e !== this.hoverKey && (this.hoverKey = e, this.hover = t, this.host.hoverChanged());
@@ -2019,10 +2016,10 @@ class Ki {
2019
2016
  dragging and handles the place intent, the drop is accepted and a ghost
2020
2017
  shows where the work would land. */
2021
2018
  dragOver(t, e) {
2022
- const s = this.host.view;
2023
- if (this.loading || e === null || !s.options.intents.includes("place")) return;
2019
+ const n = this.host.view;
2020
+ if (this.loading || e === null || !n.options.intents.includes("place")) return;
2024
2021
  const { x: i, y: o } = this.local(t.clientX, t.clientY);
2025
- if (s.laneIdAt(o) === null && s.foldedGroupAt(o) === null) {
2022
+ if (n.laneIdAt(o) === null && n.foldedGroupAt(o) === null) {
2026
2023
  this.clearPlacing();
2027
2024
  return;
2028
2025
  }
@@ -2042,18 +2039,18 @@ class Ki {
2042
2039
  lanes, none where the caller refuses that lane and none where it would
2043
2040
  cover blocked time - which the answer says apart, because they mean
2044
2041
  different things to the drag. */
2045
- placeGhost(t, e, s, i) {
2046
- const o = this.onLane(s);
2042
+ placeGhost(t, e, n, i) {
2043
+ const o = this.onLane(n);
2047
2044
  if (o === null) return { ghost: null, refused: !1, blocked: !1 };
2048
2045
  if (i.has(o)) return { ghost: null, refused: !0, blocked: !1 };
2049
- const a = { ...this.askedFor(t, o, e), id: Ve };
2050
- return ut(a, null, this.host.data.blocked) ? { ghost: null, refused: !1, blocked: !0 } : { ghost: a, refused: !1, blocked: !1 };
2046
+ const a = { ...this.askedFor(t, o, e), id: ze };
2047
+ return ft(a, null, this.host.data.blocked) ? { ghost: null, refused: !1, blocked: !0 } : { ghost: a, refused: !1, blocked: !1 };
2051
2048
  }
2052
2049
  /** The dragged item as a subtask, under the caller's key for it - not the
2053
2050
  internal sentinel: the rule is asked about the thing the application says
2054
2051
  it is dragging, and the ghost only afterwards takes the sentinel. */
2055
- askedFor(t, e, s) {
2056
- const i = this.snapInside(this.host.view.timeAt(s), this.snapStep());
2052
+ askedFor(t, e, n) {
2053
+ const i = this.snapInside(this.host.view.timeAt(n), this.snapStep());
2057
2054
  return {
2058
2055
  id: t.item,
2059
2056
  task: t.task,
@@ -2070,17 +2067,17 @@ class Ki {
2070
2067
  const e = this.gesture;
2071
2068
  if (e.kind !== "place") return;
2072
2069
  t.preventDefault();
2073
- const { ghost: s, item: i } = e;
2074
- if (this.stopAutoPan(), this.closeGestureFolds(), this.gesture = { kind: "none" }, this.refused = !1, this.blocked = !1, this.cursor = "default", this.host.interactionChanged(), !this.allowed({ ...s, id: i.item }, s.lane)) return;
2070
+ const { ghost: n, item: i } = e;
2071
+ if (this.stopAutoPan(), this.closeGestureFolds(), this.gesture = { kind: "none" }, this.refused = !1, this.blocked = !1, this.cursor = "default", this.host.interactionChanged(), !this.allowed({ ...n, id: i.item }, n.lane)) return;
2075
2072
  const o = {
2076
2073
  kind: "place",
2077
2074
  item: i.item,
2078
- task: s.task,
2079
- lane: s.lane,
2080
- from: s.from,
2081
- to: s.to,
2082
- ...s.leadIn === void 0 ? {} : { leadIn: s.leadIn },
2083
- ...s.leadOut === void 0 ? {} : { leadOut: s.leadOut }
2075
+ task: n.task,
2076
+ lane: n.lane,
2077
+ from: n.from,
2078
+ to: n.to,
2079
+ ...n.leadIn === void 0 ? {} : { leadIn: n.leadIn },
2080
+ ...n.leadOut === void 0 ? {} : { leadOut: n.leadOut }
2084
2081
  };
2085
2082
  this.host.handlers().onIntent?.(o);
2086
2083
  }
@@ -2102,29 +2099,29 @@ class Ki {
2102
2099
  put the work into blocked time it did not already cover, the ghost where
2103
2100
  it last stood. It is held, not clamped: a pointer carried on past the
2104
2101
  blocked time takes the ghost along again. */
2105
- heldGhost(t, e, s) {
2106
- const i = this.ghostFor(t, e, s);
2107
- return this.blocked = ut(i, t.subtask, this.host.data.blocked), this.blocked ? t.ghost : i;
2102
+ heldGhost(t, e, n) {
2103
+ const i = this.ghostFor(t, e, n);
2104
+ return this.blocked = ft(i, t.subtask, this.host.data.blocked), this.blocked ? t.ghost : i;
2108
2105
  }
2109
- ghostFor(t, e, s) {
2106
+ ghostFor(t, e, n) {
2110
2107
  const i = this.host.view, o = t.subtask, a = this.snapStep(), r = i.options.intents, l = this.snapInside(i.timeAt(e), a);
2111
2108
  switch (t.mode) {
2112
2109
  case "move": {
2113
2110
  let d = o.from;
2114
2111
  const c = i.viewport().scale, h = c.fromPx(e) - t.t0;
2115
- r.includes("move") && Math.abs(h * c.m) >= We && (d = this.shifted(o.from, h, a));
2112
+ r.includes("move") && Math.abs(h * c.m) >= Ue && (d = this.shifted(o.from, h, a));
2116
2113
  let p = t.ghost.lane;
2117
2114
  if (r.includes("lane")) {
2118
- const g = this.onLane(s) ?? p;
2115
+ const g = this.onLane(n) ?? p;
2119
2116
  this.refused = t.refused.has(g), this.refused || (p = g);
2120
2117
  } else
2121
2118
  this.refused = !1;
2122
2119
  return { ...o, from: d, to: d + (o.to - o.from), lane: p };
2123
2120
  }
2124
2121
  case "stretch-from":
2125
- return { ...o, from: Math.min(l, o.to - Math.max(a.step, Z)) };
2122
+ return { ...o, from: Math.min(l, o.to - Math.max(a.step, J)) };
2126
2123
  case "stretch-to":
2127
- return { ...o, to: Math.max(l, o.from + Math.max(a.step, Z)) };
2124
+ return { ...o, to: Math.max(l, o.from + Math.max(a.step, J)) };
2128
2125
  case "leadIn":
2129
2126
  return { ...o, leadIn: Math.max(0, o.from - l) };
2130
2127
  case "leadOut":
@@ -2134,16 +2131,16 @@ class Ki {
2134
2131
  /** A time moved by an amount of WORKING time and snapped: a drag moves
2135
2132
  a start this way, and a key by one step of the raster - one arithmetic,
2136
2133
  so a key proposes exactly what a drag of that length would. */
2137
- shifted(t, e, s) {
2138
- const i = St(this.host.view.options.calendar), o = z(t, i) + e, a = ft(o, i);
2139
- return this.snapInside(a, s);
2134
+ shifted(t, e, n) {
2135
+ const i = It(this.host.view.options.calendar), o = z(t, i) + e, a = mt(o, i);
2136
+ return this.snapInside(a, n);
2140
2137
  }
2141
2138
  /** Snapped - and, where the raster lands in time the calendar removes, moved
2142
2139
  on to the seam, where time counts again. An intent never asks for a time
2143
2140
  nobody works. */
2144
2141
  snapInside(t, e) {
2145
- const s = Us(t, e, this.host.view.options.timeZone), i = St(this.host.view.options.calendar);
2146
- return i.intervals.length === 0 ? s : Zt(z(s, i), i);
2142
+ const n = Xs(t, e, this.host.view.options.timeZone), i = It(this.host.view.options.calendar);
2143
+ return i.intervals.length === 0 ? n : Jt(z(n, i), i);
2147
2144
  }
2148
2145
  /** The id to report: a host may have reminted its ids since the drag began,
2149
2146
  so where the old id is gone the subtask is found again by what it is -
@@ -2152,9 +2149,9 @@ class Ki {
2152
2149
  const e = this.host.data;
2153
2150
  return e.subtaskById.has(t.id) ? t.id : e.subtasks.find((i) => i.task === t.task && i.lane === t.lane && i.from === t.from && i.to === t.to)?.id ?? t.id;
2154
2151
  }
2155
- intentsOf(t, e, s) {
2152
+ intentsOf(t, e, n) {
2156
2153
  const i = [], o = this.host.view.options.intents, a = this.currentId(t);
2157
- return s === "move" ? (e.from !== t.from && o.includes("move") && i.push({ kind: "move", subtask: a, from: e.from, to: e.to }), e.lane !== t.lane && o.includes("lane") && i.push({ kind: "lane", subtask: a, lane: e.lane })) : s === "stretch-from" || s === "stretch-to" ? (e.from !== t.from || e.to !== t.to) && i.push({ kind: "stretch", subtask: a, from: e.from, to: e.to }) : s === "leadIn" ? (e.leadIn ?? 0) !== (t.leadIn ?? 0) && i.push({ kind: "leadIn", subtask: a, leadIn: e.leadIn ?? 0 }) : (e.leadOut ?? 0) !== (t.leadOut ?? 0) && i.push({ kind: "leadOut", subtask: a, leadOut: e.leadOut ?? 0 }), i;
2154
+ return n === "move" ? (e.from !== t.from && o.includes("move") && i.push({ kind: "move", subtask: a, from: e.from, to: e.to }), e.lane !== t.lane && o.includes("lane") && i.push({ kind: "lane", subtask: a, lane: e.lane })) : n === "stretch-from" || n === "stretch-to" ? (e.from !== t.from || e.to !== t.to) && i.push({ kind: "stretch", subtask: a, from: e.from, to: e.to }) : n === "leadIn" ? (e.leadIn ?? 0) !== (t.leadIn ?? 0) && i.push({ kind: "leadIn", subtask: a, leadIn: e.leadIn ?? 0 }) : (e.leadOut ?? 0) !== (t.leadOut ?? 0) && i.push({ kind: "leadOut", subtask: a, leadOut: e.leadOut ?? 0 }), i;
2158
2155
  }
2159
2156
  /** The lane the ghost came from - the only other lane a drag can touch. */
2160
2157
  ghostHome(t) {
@@ -2170,33 +2167,35 @@ class Ki {
2170
2167
  keeps a plan of hundreds of tasks fluid while a drag runs, since this is
2171
2168
  computed on every pointer movement. */
2172
2169
  ghostFindings(t, e) {
2173
- const s = this.host.data, i = (c) => c.lane === t.lane || c.lane === e, a = [...s.subtasks.filter((c) => c.id !== t.id && i(c)), t], r = (c) => c.first === t.id || c.second === t.id, l = s.dependencies.filter((c) => c.from === t.id || c.to === t.id), d = t.id === Ve ? s.subtasks : s.subtasks.map((c) => c.id === t.id ? t : c);
2174
- return { overlaps: ne(a).filter(r), violated: ie(d, l) };
2170
+ const n = this.host.data, i = (c) => c.lane === t.lane || c.lane === e, a = [...n.subtasks.filter((c) => c.id !== t.id && i(c)), t], r = (c) => c.first === t.id || c.second === t.id, l = n.dependencies.filter((c) => c.from === t.id || c.to === t.id), d = t.id === ze ? n.subtasks : n.subtasks.map((c) => c.id === t.id ? t : c);
2171
+ return { overlaps: ie(a).filter(r), violated: oe(d, l) };
2175
2172
  }
2176
2173
  }
2177
- function Yi(n, t) {
2174
+ function Vi(s, t) {
2178
2175
  const e = /* @__PURE__ */ new Map();
2179
- for (const s of t) {
2180
- const i = n.slots.get(s.lane), o = i === void 0 ? null : at(n, i.top);
2181
- if (o === null) continue;
2182
- const a = n.rows.indexOf(o);
2183
- e.set(a, [...e.get(a) ?? [], s]);
2176
+ s.rows.forEach((i, o) => e.set(i, o));
2177
+ const n = /* @__PURE__ */ new Map();
2178
+ for (const i of t) {
2179
+ const o = s.slots.get(i.lane), a = o === void 0 ? null : at(s, o.top);
2180
+ if (a === null) continue;
2181
+ const r = e.get(a), l = n.get(r);
2182
+ l === void 0 ? n.set(r, [i]) : l.push(i);
2184
2183
  }
2185
- return [...e.entries()].sort(([s], [i]) => s - i).map(([, s]) => s.sort((i, o) => i.from - o.from || i.to - o.to));
2184
+ return [...n.entries()].sort(([i], [o]) => i - o).map(([, i]) => i.sort((o, a) => o.from - a.from || o.to - a.to));
2186
2185
  }
2187
- const Ue = (n, t) => t < n.from ? n.from - t : t > n.to ? t - n.to : 0;
2188
- function Vi(n, t, e, s) {
2186
+ const Xe = (s, t) => t < s.from ? s.from - t : t > s.to ? t - s.to : 0;
2187
+ function zi(s, t, e, n) {
2189
2188
  let i = -1, o = -1;
2190
- for (let d = 0; d < n.length && t !== null && i < 0; d++)
2191
- o = n[d].findIndex((c) => c.id === t), o >= 0 && (i = d);
2189
+ for (let d = 0; d < s.length && t !== null && i < 0; d++)
2190
+ o = s[d].findIndex((c) => c.id === t), o >= 0 && (i = d);
2192
2191
  if (i < 0) {
2193
- for (const d of n) {
2194
- const c = d.find((h) => h.to > s[0] && h.from < s[1]);
2192
+ for (const d of s) {
2193
+ const c = d.find((h) => h.to > n[0] && h.from < n[1]);
2195
2194
  if (c !== void 0) return c;
2196
2195
  }
2197
- return n[0]?.[0] ?? null;
2196
+ return s[0]?.[0] ?? null;
2198
2197
  }
2199
- const a = n[i], r = a[o], l = (s[1] - s[0]) / 10;
2198
+ const a = s[i], r = a[o], l = (n[1] - n[0]) / 10;
2200
2199
  switch (e) {
2201
2200
  case "next":
2202
2201
  return a[o + 1] ?? r;
@@ -2213,25 +2212,25 @@ function Vi(n, t, e, s) {
2213
2212
  return a[0];
2214
2213
  case "up":
2215
2214
  case "down": {
2216
- const d = n[e === "up" ? i - 1 : i + 1];
2215
+ const d = s[e === "up" ? i - 1 : i + 1];
2217
2216
  if (d === void 0) return r;
2218
2217
  const c = (r.from + r.to) / 2;
2219
- return d.reduce((h, p) => Ue(p, c) < Ue(h, c) ? p : h);
2218
+ return d.reduce((h, p) => Xe(p, c) < Xe(h, c) ? p : h);
2220
2219
  }
2221
2220
  }
2222
2221
  }
2223
- function zi(n, t, e, s) {
2222
+ function Wi(s, t, e, n) {
2224
2223
  if (e.kind === "milestone") return e;
2225
2224
  if (e.kind === "dependency") {
2226
- const o = n.find((r) => r.id === e.id), a = o === void 0 ? void 0 : s === "out" ? o.to : o.from;
2225
+ const o = s.find((r) => r.id === e.id), a = o === void 0 ? void 0 : n === "out" ? o.to : o.from;
2227
2226
  return a !== void 0 && t.has(a) ? { kind: "subtask", id: a } : e;
2228
2227
  }
2229
- const i = n.find(
2230
- (o) => (s === "out" ? o.from : o.to) === e.id && t.has(s === "out" ? o.to : o.from)
2228
+ const i = s.find(
2229
+ (o) => (n === "out" ? o.from : o.to) === e.id && t.has(n === "out" ? o.to : o.from)
2231
2230
  );
2232
2231
  return i === void 0 ? e : { kind: "dependency", id: i.id };
2233
2232
  }
2234
- const Tt = "\0milestone:", Xe = 150, qe = 1.25, Wi = {
2233
+ const St = "\0milestone:", qe = 150, je = 1.25, Ui = {
2235
2234
  ArrowRight: "next",
2236
2235
  ArrowLeft: "previous",
2237
2236
  ArrowUp: "up",
@@ -2241,7 +2240,7 @@ const Tt = "\0milestone:", Xe = 150, qe = 1.25, Wi = {
2241
2240
  PageDown: "pageNext",
2242
2241
  PageUp: "pagePrevious"
2243
2242
  };
2244
- class Ui {
2243
+ class Xi {
2245
2244
  constructor(t) {
2246
2245
  this.host = t;
2247
2246
  }
@@ -2266,12 +2265,12 @@ class Ui {
2266
2265
  key(t) {
2267
2266
  const e = this.host.gestures;
2268
2267
  if (t.metaKey || !e.idle) return !1;
2269
- const s = t.key.toLowerCase() === "t" && !t.ctrlKey && !t.altKey;
2270
- if (t.key === "]" || t.key === "[" || s) {
2268
+ const n = t.key.toLowerCase() === "t" && !t.ctrlKey && !t.altKey;
2269
+ if (t.key === "]" || t.key === "[" || n) {
2271
2270
  const o = this.active();
2272
2271
  if (o === null) return !1;
2273
- const a = this.host.data, r = s ? !t.shiftKey : t.key === "]";
2274
- return this.show(zi(a.dependencies, a.subtaskById, o, r ? "out" : "back")), !0;
2272
+ const a = this.host.data, r = n ? !t.shiftKey : t.key === "]";
2273
+ return this.show(Wi(a.dependencies, a.subtaskById, o, r ? "out" : "back")), !0;
2275
2274
  }
2276
2275
  if (t.ctrlKey) return !1;
2277
2276
  if (!t.altKey && this.zoom(t)) return !0;
@@ -2279,33 +2278,33 @@ class Ui {
2279
2278
  if (t.key === "Escape")
2280
2279
  return e.byKeyboard ? (this.blur(), !0) : !1;
2281
2280
  if (t.key === "Enter" || t.key === " ") return this.select();
2282
- const i = t.shiftKey ? void 0 : Wi[t.key];
2281
+ const i = t.shiftKey ? void 0 : Ui[t.key];
2283
2282
  return i === void 0 ? !1 : (this.walk(i), !0);
2284
2283
  }
2285
2284
  /** + and = zoom in, - and _ zoom out, 0 fits the work: by the character, so
2286
2285
  that every layout reaches them (Shift is how a US keyboard types +). The
2287
2286
  anchor is the middle of the active subtask's main time, else of the plot. */
2288
2287
  zoom(t) {
2289
- const e = t.key === "+" || t.key === "=" ? 1 / qe : t.key === "-" || t.key === "_" ? qe : 1;
2288
+ const e = t.key === "+" || t.key === "=" ? 1 / je : t.key === "-" || t.key === "_" ? je : 1;
2290
2289
  if (e === 1 && t.key !== "0") return !1;
2291
2290
  if (e !== 1) {
2292
- const s = this.active(), i = s?.kind === "subtask" ? this.host.view.boxById.get(s.id) : void 0, o = this.host.view.width;
2291
+ const n = this.active(), i = n?.kind === "subtask" ? this.host.view.boxById.get(n.id) : void 0, o = this.host.view.width;
2293
2292
  this.host.zoomBy(i === void 0 ? o / 2 : Math.max(0, Math.min(o, (i.mainFrom + i.mainTo) / 2)), e);
2294
2293
  } else this.host.fitWork();
2295
2294
  return this.scheduleSpan(), !0;
2296
2295
  }
2297
2296
  walk(t) {
2298
- const { data: e, view: s } = this.host, i = this.active(), o = i === null ? null : i.kind === "subtask" ? i.id : i.kind === "milestone" ? Tt + i.id : e.dependencies.find((d) => d.id === i.id)?.from ?? null, a = [...e.subtasks, ...e.milestones.map((d) => ({ id: Tt + d.id, lane: d.lane, from: d.at, to: d.at }))];
2299
- let r = Yi(s.rows, a);
2297
+ const { data: e, view: n } = this.host, i = this.active(), o = i === null ? null : i.kind === "subtask" ? i.id : i.kind === "milestone" ? St + i.id : e.dependencies.find((d) => d.id === i.id)?.from ?? null, a = [...e.subtasks, ...e.milestones.map((d) => ({ id: St + d.id, lane: d.lane, from: d.at, to: d.at }))];
2298
+ let r = Vi(n.rows, a);
2300
2299
  if (o === null) {
2301
2300
  const d = r.filter((c) => {
2302
- const h = et(s.viewport(), c[0].lane);
2303
- return h !== null && h.top + h.height > 0 && h.top < s.height;
2301
+ const h = et(n.viewport(), c[0].lane);
2302
+ return h !== null && h.top + h.height > 0 && h.top < n.height;
2304
2303
  });
2305
2304
  d.length > 0 && (r = d);
2306
2305
  }
2307
- const l = Vi(r, o, t, this.host.visibleDomain());
2308
- l !== null && this.show(l.id.startsWith(Tt) ? { kind: "milestone", id: l.id.slice(Tt.length) } : { kind: "subtask", id: l.id });
2306
+ const l = zi(r, o, t, this.host.visibleDomain());
2307
+ l !== null && this.show(l.id.startsWith(St) ? { kind: "milestone", id: l.id.slice(St.length) } : { kind: "subtask", id: l.id });
2309
2308
  }
2310
2309
  /** Space and Enter select as a click does: the whole task, and the subtask. */
2311
2310
  select() {
@@ -2320,8 +2319,8 @@ class Ui {
2320
2319
  reports (ADR-0023), and only where the caller handles them. Nothing is
2321
2320
  applied here. */
2322
2321
  edit(t) {
2323
- const e = this.host.gestures.hover, s = t.key === "ArrowRight" ? 1 : t.key === "ArrowLeft" ? -1 : 0, i = t.key === "ArrowDown" ? 1 : t.key === "ArrowUp" ? -1 : 0;
2324
- if (s === 0 && i === 0) return !1;
2322
+ const e = this.host.gestures.hover, n = t.key === "ArrowRight" ? 1 : t.key === "ArrowLeft" ? -1 : 0, i = t.key === "ArrowDown" ? 1 : t.key === "ArrowUp" ? -1 : 0;
2323
+ if (n === 0 && i === 0) return !1;
2325
2324
  if (this.host.gestures.loading || e.kind !== "subtask") return !0;
2326
2325
  const o = e.subtask, a = this.host.gestures, r = this.host.view.options.intents;
2327
2326
  if (i !== 0) {
@@ -2334,31 +2333,31 @@ class Ui {
2334
2333
  const p = (f) => ({ ...o, from: f, to: f + (o.to - o.from) });
2335
2334
  let g = o.from;
2336
2335
  for (let f = 0; f < 1e3; f++) {
2337
- const y = a.shifted(g, s * d.step, d);
2338
- if (y === g || (g = y, !ut(p(g), o, c))) break;
2336
+ const y = a.shifted(g, n * d.step, d);
2337
+ if (y === g || (g = y, !ft(p(g), o, c))) break;
2339
2338
  }
2340
- g !== o.from && !ut(p(g), o, c) && (h = { kind: "move", subtask: o.id, from: g, to: p(g).to });
2339
+ g !== o.from && !ft(p(g), o, c) && (h = { kind: "move", subtask: o.id, from: g, to: p(g).to });
2341
2340
  } else if (t.shiftKey && r.includes("stretch")) {
2342
- const p = Math.max(a.shifted(o.to, s * d.step, d), o.from + Math.max(d.step, Z));
2343
- p !== o.to && !ut({ ...o, to: p }, o, c) && (h = { kind: "stretch", subtask: o.id, from: o.from, to: p });
2341
+ const p = Math.max(a.shifted(o.to, n * d.step, d), o.from + Math.max(d.step, J));
2342
+ p !== o.to && !ft({ ...o, to: p }, o, c) && (h = { kind: "stretch", subtask: o.id, from: o.from, to: p });
2344
2343
  }
2345
2344
  return a.byKeyboard = !0, h !== null && this.host.handlers().onIntent?.(h), this.scheduleReadout(), !0;
2346
2345
  }
2347
2346
  /** The lane drawn one row above (-1) or below (1) a lane - group heads and
2348
2347
  folded groups are passed over; null at the first or last lane. */
2349
2348
  laneBeside(t, e) {
2350
- const s = this.host.view.rows.rows.flatMap((o) => o.kind === "lane" && o.lane !== void 0 ? [o.lane] : []), i = s.indexOf(t);
2351
- return i < 0 ? null : s[i + e] ?? null;
2349
+ const n = this.host.view.rows.rows.flatMap((o) => o.kind === "lane" && o.lane !== void 0 ? [o.lane] : []), i = n.indexOf(t);
2350
+ return i < 0 ? null : n[i + e] ?? null;
2352
2351
  }
2353
2352
  /** The keys stand on this target: brought into view, drawn as the hover. */
2354
2353
  show(t, e = !0) {
2355
- const s = this.hitOf(t);
2356
- if (s === null) return;
2354
+ const n = this.hitOf(t);
2355
+ if (n === null) return;
2357
2356
  e && this.reveal(t);
2358
2357
  const i = this.bounds(t);
2359
2358
  if (i === null) return;
2360
2359
  const { view: o } = this.host, a = (r, l) => Math.max(0, Math.min(l, r));
2361
- this.host.gestures.setKeyboardHover(s, {
2360
+ this.host.gestures.setKeyboardHover(n, {
2362
2361
  x: (a(i.x0, o.width) + a(i.x1, o.width)) / 2,
2363
2362
  y: (a(i.y0, o.height) + a(i.y1, o.height)) / 2
2364
2363
  }), e && this.scheduleReadout();
@@ -2373,22 +2372,22 @@ class Ui {
2373
2372
  const i = e.milestones.find((o) => o.id === t.id);
2374
2373
  return i === void 0 ? null : { kind: "milestone", milestone: i };
2375
2374
  }
2376
- const s = e.dependencies.find((i) => i.id === t.id);
2377
- return s === void 0 ? null : { kind: "dependency", dependency: s };
2375
+ const n = e.dependencies.find((i) => i.id === t.id);
2376
+ return n === void 0 ? null : { kind: "dependency", dependency: n };
2378
2377
  }
2379
2378
  /** Where a target lies on the plot: a subtask's bar, or the span between
2380
2379
  the two bars a dependency joins. */
2381
2380
  bounds(t) {
2382
- const e = this.host.view, s = (r) => e.boxById.get(r);
2381
+ const e = this.host.view, n = (r) => e.boxById.get(r);
2383
2382
  if (t.kind === "subtask") {
2384
- const r = s(t.id);
2383
+ const r = n(t.id);
2385
2384
  return r === void 0 ? null : { x0: r.outerFrom, x1: r.outerTo, y0: r.y, y1: r.y + r.height };
2386
2385
  }
2387
2386
  if (t.kind === "milestone") {
2388
- const r = this.host.data.milestones.find((d) => d.id === t.id), l = r === void 0 ? null : le(e.viewport(), r);
2387
+ const r = this.host.data.milestones.find((d) => d.id === t.id), l = r === void 0 ? null : de(e.viewport(), r);
2389
2388
  return l === null ? null : { x0: l.x - l.half, x1: l.x + l.half, y0: l.y - l.half, y1: l.y + l.half };
2390
2389
  }
2391
- const i = this.host.data.dependencies.find((r) => r.id === t.id), o = i === void 0 ? void 0 : s(i.from), a = i === void 0 ? void 0 : s(i.to);
2390
+ const i = this.host.data.dependencies.find((r) => r.id === t.id), o = i === void 0 ? void 0 : n(i.from), a = i === void 0 ? void 0 : n(i.to);
2392
2391
  return o === void 0 || a === void 0 ? null : {
2393
2392
  x0: Math.min(o.mainTo, a.mainFrom),
2394
2393
  x1: Math.max(o.mainTo, a.mainFrom),
@@ -2400,11 +2399,11 @@ class Ui {
2400
2399
  at the side it came in from; a target wider than the view shows its
2401
2400
  start. As a drag at the edge pans along, the keys do. */
2402
2401
  reveal(t) {
2403
- const e = this.bounds(t), s = this.host.view;
2404
- if (e === null || s.width <= 0) return;
2405
- const i = Math.min(24, s.width / 10), o = e.x0 < 0 ? e.x0 - i : e.x1 > s.width ? Math.max(0, Math.min(e.x1 - s.width + i, e.x0 - i)) : 0, a = e.y0 < 0 ? e.y0 : e.y1 > s.height ? Math.min(e.y1 - s.height, e.y0) : 0;
2402
+ const e = this.bounds(t), n = this.host.view;
2403
+ if (e === null || n.width <= 0) return;
2404
+ const i = Math.min(24, n.width / 10), o = e.x0 < 0 ? e.x0 - i : e.x1 > n.width ? Math.max(0, Math.min(e.x1 - n.width + i, e.x0 - i)) : 0, a = e.y0 < 0 ? e.y0 : e.y1 > n.height ? Math.min(e.y1 - n.height, e.y0) : 0;
2406
2405
  if (o === 0 && a === 0) return;
2407
- const r = s.pan(o, a);
2406
+ const r = n.pan(o, a);
2408
2407
  r.moved && this.host.viewMoved(r.time);
2409
2408
  }
2410
2409
  /** After the data or the view changed: the keys' target is read anew by its
@@ -2422,49 +2421,49 @@ class Ui {
2422
2421
  if (!this.host.gestures.byKeyboard) return;
2423
2422
  const e = this.host.data.tooltipTargetFor(t);
2424
2423
  e !== null && (this.spoken = { target: e, lane: t.kind === "subtask" ? t.subtask.lane : t.kind === "milestone" ? t.milestone.lane : null, count: (this.spoken?.count ?? 0) + 1 }, this.host.spokenChanged());
2425
- }, Xe);
2424
+ }, qe);
2426
2425
  }
2427
2426
  /** The span in view, said once the keys rest - also after a key that changed nothing. */
2428
2427
  scheduleSpan() {
2429
2428
  this.timer !== null && clearTimeout(this.timer), this.timer = setTimeout(() => {
2430
2429
  this.timer = null, this.spoken = { target: null, lane: null, span: this.host.visibleDomain(), count: (this.spoken?.count ?? 0) + 1 }, this.host.spokenChanged();
2431
- }, Xe);
2430
+ }, qe);
2432
2431
  }
2433
2432
  /** Unmount: no readout after it. */
2434
2433
  stop() {
2435
2434
  this.timer !== null && clearTimeout(this.timer), this.timer = null;
2436
2435
  }
2437
2436
  }
2438
- const it = (n) => JSON.stringify([n.domain ?? null, [...n.folded ?? []].sort()]);
2439
- function Xi(n, t) {
2440
- if (t.size === 0 || n.folded === void 0) return n;
2441
- const e = n.folded.filter((s) => t.has(s));
2442
- return e.length === n.folded.length ? n : { ...n.domain ? { domain: n.domain } : {}, ...e.length ? { folded: e } : {} };
2437
+ const it = (s) => JSON.stringify([s.domain ?? null, [...s.folded ?? []].sort()]);
2438
+ function qi(s, t) {
2439
+ if (t.size === 0 || s.folded === void 0) return s;
2440
+ const e = s.folded.filter((n) => t.has(n));
2441
+ return e.length === s.folded.length ? s : { ...s.domain ? { domain: s.domain } : {}, ...e.length ? { folded: e } : {} };
2443
2442
  }
2444
- function Kt(n) {
2445
- if (n == null) return null;
2446
- const [t, e] = Array.isArray(n) ? n : [];
2447
- return Array.isArray(n) && n.length === 2 && Number.isFinite(t) && Number.isFinite(e) && typeof t == "number" && typeof e == "number" && t < e ? [t, e] : (Ut && j("domain", `the view's domain must be [from, to], two numbers in milliseconds since 1970 with from before to (as Date.getTime() gives), not ${JSON.stringify(n)}; the schedule shows its subtasks instead.`), null);
2443
+ function Yt(s) {
2444
+ if (s == null) return null;
2445
+ const [t, e] = Array.isArray(s) ? s : [];
2446
+ return Array.isArray(s) && s.length === 2 && Number.isFinite(t) && Number.isFinite(e) && typeof t == "number" && typeof e == "number" && t < e ? [t, e] : (Xt && j("domain", `the view's domain must be [from, to], two numbers in milliseconds since 1970 with from before to (as Date.getTime() gives), not ${JSON.stringify(s)}; the schedule shows its subtasks instead.`), null);
2448
2447
  }
2449
- function qi(n, t, e = (i) => i, s = "middle") {
2450
- if (n.length === 0) return null;
2448
+ function ji(s, t, e = (i) => i, n = "middle") {
2451
2449
  let i = 1 / 0, o = -1 / 0;
2452
- for (const l of n)
2453
- i = Math.min(i, l.from - (l.leadIn ?? 0)), o = Math.max(o, l.to + (l.leadOut ?? 0));
2450
+ for (const l of s)
2451
+ !Number.isFinite(l.from) || !Number.isFinite(l.to) || (i = Math.min(i, l.from - (l.leadIn ?? 0)), o = Math.max(o, l.to + (l.leadOut ?? 0)));
2452
+ if (i === 1 / 0) return null;
2454
2453
  i = e(i), o = e(o);
2455
2454
  const a = Math.min(t.max, Math.max(t.min, o - i));
2456
- if (s === "start" && o - i > a) return [i, i + a];
2455
+ if (n === "start" && o - i > a) return [i, i + a];
2457
2456
  const r = (i + o) / 2;
2458
2457
  return [r - a / 2, r + a / 2];
2459
2458
  }
2460
- const je = {
2459
+ const Ze = {
2461
2460
  width: 0,
2462
2461
  height: 0,
2463
2462
  scrollY: 0,
2464
2463
  headers: [],
2465
2464
  days: [],
2466
2465
  ticks: [],
2467
- step: Jt,
2466
+ step: Qt,
2468
2467
  fontScale: 1,
2469
2468
  ghost: null,
2470
2469
  grips: [],
@@ -2477,9 +2476,9 @@ const je = {
2477
2476
  spoken: null,
2478
2477
  summary: { lanes: 0, subtasks: 0, from: 0, to: 0, overlaps: 0, violated: 0, blocked: 0, milestones: 0 }
2479
2478
  };
2480
- class ji {
2481
- data = new gi(() => this.viewChanged());
2482
- view = new vn(this.data);
2479
+ class Zi {
2480
+ data = new ki(() => this.viewChanged());
2481
+ view = new yn(this.data);
2483
2482
  gestures;
2484
2483
  keys;
2485
2484
  handlersNow = {};
@@ -2520,31 +2519,31 @@ class ji {
2520
2519
  movePending = !1;
2521
2520
  domainFrame = 0;
2522
2521
  unsubscribeTheme = null;
2523
- snapshot = je;
2522
+ snapshot = Ze;
2524
2523
  dataTable = null;
2525
2524
  listeners = /* @__PURE__ */ new Set();
2526
2525
  constructor(t = {}) {
2527
- this.folded = t.folded ?? [], this.domainInView = Kt(t.domain), this.domainInView !== null && this.view.showWall(this.domainInView), this.viewNow = this.currentView(), this.gestures = new Ki({
2526
+ this.folded = t.folded ?? [], this.domainInView = Yt(t.domain), this.domainInView !== null && this.view.showWall(this.domainInView), this.viewNow = this.currentView(), this.gestures = new Yi({
2528
2527
  data: this.data,
2529
2528
  view: this.view,
2530
2529
  plotElement: () => this.plot,
2531
2530
  handlers: () => this.handlersNow,
2532
2531
  selectedSubtask: () => this.selected,
2533
- select: (e, s) => this.select(e, s),
2532
+ select: (e, n) => this.select(e, n),
2534
2533
  viewChanged: () => this.viewChanged(),
2535
2534
  viewMoved: (e) => this.viewMoved(e),
2536
2535
  interactionChanged: () => this.interactionChanged(),
2537
2536
  hoverChanged: () => this.hoverChanged()
2538
- }), this.keys = new Ui({
2537
+ }), this.keys = new Xi({
2539
2538
  data: this.data,
2540
2539
  view: this.view,
2541
2540
  gestures: this.gestures,
2542
2541
  handlers: () => this.handlersNow,
2543
2542
  visibleDomain: () => this.visibleDomain(),
2544
- select: (e, s) => this.select(e, s),
2543
+ select: (e, n) => this.select(e, n),
2545
2544
  viewMoved: (e) => this.viewMoved(e),
2546
- zoomBy: (e, s) => {
2547
- this.view.zoomAt(e, s) && this.viewMoved(!0);
2545
+ zoomBy: (e, n) => {
2546
+ this.view.zoomAt(e, n) && this.viewMoved(!0);
2548
2547
  },
2549
2548
  fitWork: () => this.setDomain(null),
2550
2549
  spokenChanged: () => this.publish()
@@ -2600,18 +2599,18 @@ class ji {
2600
2599
  getView = () => this.viewNow;
2601
2600
  /** Goes to a whole view (`setView`); what it leaves out goes back to its default. */
2602
2601
  applyView(t) {
2603
- it(t) !== it(this.viewNow) && (this.actedOn = !0, this.folded = t.folded ?? [], this.setDomain(t.domain === void 0 ? null : Kt(t.domain)));
2602
+ it(t) !== it(this.viewNow) && (this.actedOn = !0, this.folded = t.folded ?? [], this.setDomain(t.domain === void 0 ? null : Yt(t.domain)));
2604
2603
  }
2605
2604
  /** Puts a span of two wall-clock instants in view; null shows the
2606
2605
  subtasks' extent. */
2607
2606
  setDomain = (t) => {
2608
- const e = Kt(t);
2607
+ const e = Yt(t);
2609
2608
  this.domainFrame !== 0 && cancelAnimationFrame(this.domainFrame), this.domainFrame = 0, this.actedOn = !0, this.domainInView = e === null ? null : [e[0], e[1]], e === null ? this.fitted = !1 : this.view.showWall(e), this.viewChanged();
2610
2609
  };
2611
2610
  /** Folds or unfolds one group. */
2612
2611
  toggleGroup = (t) => {
2613
2612
  const e = this.viewNow.folded ?? [];
2614
- this.actedOn = !0, this.folded = e.includes(t) ? e.filter((s) => s !== t) : [...e, t], this.viewChanged();
2613
+ this.actedOn = !0, this.folded = e.includes(t) ? e.filter((n) => n !== t) : [...e, t], this.viewChanged();
2615
2614
  };
2616
2615
  foldAll = () => {
2617
2616
  this.actedOn = !0, this.folded = this.data.groups.map((t) => t.id), this.viewChanged();
@@ -2620,7 +2619,7 @@ class ji {
2620
2619
  this.actedOn = !0, this.folded = [], this.viewChanged();
2621
2620
  };
2622
2621
  currentView() {
2623
- return Xi(
2622
+ return qi(
2624
2623
  { ...this.domainInView === null ? {} : { domain: this.domainInView }, ...this.folded.length > 0 ? { folded: this.folded } : {} },
2625
2624
  new Set(this.data.groups.map((t) => t.id))
2626
2625
  );
@@ -2635,13 +2634,13 @@ class ji {
2635
2634
  /** The subtasks' extent within the zoom limits, while the view names no
2636
2635
  span - and the local day of today while there is no work to show. */
2637
2636
  fit() {
2638
- const t = this.view.options.calendar, e = qi(this.data.subtasks, this.view.options.zoomLimits, (l) => z(l, t), "start");
2637
+ const t = this.view.options.calendar, e = ji(this.data.subtasks, this.view.options.zoomLimits, (l) => z(l, t), "start");
2639
2638
  if (e !== null) {
2640
2639
  this.view.domain = e, this.fitted = !0;
2641
2640
  return;
2642
2641
  }
2643
- const s = this.view.options.timeZone, i = zs(Date.now(), s), { year: o, month: a, day: r } = ts(i, s);
2644
- this.view.showWall([i.getTime(), Yt({ year: o, month: a, day: r + 1 }, s).getTime()]);
2642
+ const n = this.view.options.timeZone, i = Ws(Date.now(), n), { year: o, month: a, day: r } = ts(i, n);
2643
+ this.view.showWall([i.getTime(), Vt({ year: o, month: a, day: r + 1 }, n).getTime()]);
2645
2644
  }
2646
2645
  /** `undefined`: the scene keeps the selection itself. */
2647
2646
  setControlledTask(t) {
@@ -2658,14 +2657,14 @@ class ji {
2658
2657
  return t !== void 0 && t.task === this.selectedTask ? t.id : null;
2659
2658
  }
2660
2659
  select(t, e) {
2661
- const s = t !== this.selectedTask || e !== this.selected;
2662
- this.selected = e, t !== this.selectedTask && this.controlledTask === void 0 && (this.ownTask = t), s && this.handlersNow.onSelectedTaskChange?.(t, e), this.interactionChanged();
2660
+ const n = t !== this.selectedTask || e !== this.selected;
2661
+ this.selected = e, t !== this.selectedTask && this.controlledTask === void 0 && (this.ownTask = t), n && this.handlersNow.onSelectedTaskChange?.(t, e), this.interactionChanged();
2663
2662
  }
2664
2663
  /* ---------------------------------------------------------------- */
2665
2664
  /* DOM binding */
2666
2665
  /* ---------------------------------------------------------------- */
2667
- bind(t, e, s, i) {
2668
- this.root = t, this.plot = e, this.dataCanvas = s, this.overlayCanvas = i, this.unsubscribeTheme = Ns(() => {
2666
+ bind(t, e, n, i) {
2667
+ this.root = t, this.plot = e, this.dataCanvas = n, this.overlayCanvas = i, this.unsubscribeTheme = Ns(() => {
2669
2668
  this.colours = null, this.dataStale = !0, this.requestDraw();
2670
2669
  }), this.viewChanged();
2671
2670
  }
@@ -2673,14 +2672,14 @@ class ji {
2673
2672
  this.gestures.cancelEdit(), this.keys.stop(), this.unsubscribeTheme?.(), this.unsubscribeTheme = null, this.frame !== 0 && cancelAnimationFrame(this.frame), this.domainFrame !== 0 && cancelAnimationFrame(this.domainFrame), this.frame = this.domainFrame = 0, this.movePending = !1, this.root = this.plot = this.dataCanvas = this.overlayCanvas = null;
2674
2673
  }
2675
2674
  resize(t, e) {
2676
- const s = Math.max(0, Math.round(t)), i = Math.max(0, Math.round(e));
2677
- s === this.view.width && i === this.view.height || (this.view.width = s, this.view.height = i, this.viewChanged());
2675
+ const n = Math.max(0, Math.round(t)), i = Math.max(0, Math.round(e));
2676
+ n === this.view.width && i === this.view.height || (this.view.width = n, this.view.height = i, this.viewChanged());
2678
2677
  }
2679
2678
  subscribe = (t) => (this.listeners.add(t), () => {
2680
2679
  this.listeners.delete(t);
2681
2680
  });
2682
2681
  getSnapshot = () => this.snapshot;
2683
- getServerSnapshot = () => je;
2682
+ getServerSnapshot = () => Ze;
2684
2683
  /* ---------------------------------------------------------------- */
2685
2684
  /* Changes */
2686
2685
  /* ---------------------------------------------------------------- */
@@ -2711,8 +2710,8 @@ class ji {
2711
2710
  this.requestDraw();
2712
2711
  }
2713
2712
  publish() {
2714
- const t = this.view, e = this.selected !== null ? t.boxById.get(this.selected) : void 0, s = [];
2715
- e !== void 0 && !e.miniature && !this.gestures.editing && e.subtask.task === this.selectedTask && (t.options.intents.includes("leadIn") && s.push({ kind: "leadIn", x: e.outerFrom, y: e.y, height: e.height }), t.options.intents.includes("leadOut") && s.push({ kind: "leadOut", x: e.outerTo, y: e.y, height: e.height })), this.snapshot = {
2713
+ const t = this.view, e = this.selected !== null ? t.boxById.get(this.selected) : void 0, n = [];
2714
+ e !== void 0 && !e.miniature && !this.gestures.editing && e.subtask.task === this.selectedTask && (t.options.intents.includes("leadIn") && n.push({ kind: "leadIn", x: e.outerFrom, y: e.y, height: e.height }), t.options.intents.includes("leadOut") && n.push({ kind: "leadOut", x: e.outerTo, y: e.y, height: e.height })), this.snapshot = {
2716
2715
  width: t.width,
2717
2716
  height: t.height,
2718
2717
  scrollY: t.scrollY,
@@ -2720,7 +2719,7 @@ class ji {
2720
2719
  ...t.bands(),
2721
2720
  fontScale: t.fontScale,
2722
2721
  ghost: this.gestures.ghostSummary(),
2723
- grips: s,
2722
+ grips: n,
2724
2723
  cursor: this.gestures.cursor,
2725
2724
  tooltip: this.tooltip(),
2726
2725
  loading: this.gestures.loading,
@@ -2736,7 +2735,7 @@ class ji {
2736
2735
  not taken off here: the header column is moved as a whole, as it always
2737
2736
  was, so that a header and its row cannot drift apart by a rounding. */
2738
2737
  headers() {
2739
- const t = new Map(this.data.lanes.map((i) => [i.id, i.label])), e = new Map(this.data.groups.map((i) => [i.id, i.label])), s = new Set(this.folded);
2738
+ const t = new Map(this.data.lanes.map((i) => [i.id, i.label])), e = new Map(this.data.groups.map((i) => [i.id, i.label])), n = new Set(this.folded);
2740
2739
  return this.view.rows.rows.map((i) => ({
2741
2740
  key: i.lane ?? i.group ?? "",
2742
2741
  kind: i.kind,
@@ -2746,7 +2745,7 @@ class ji {
2746
2745
  depth: i.depth,
2747
2746
  within: i.within,
2748
2747
  lanes: i.lanes,
2749
- collapsed: i.group === void 0 ? void 0 : s.has(i.group),
2748
+ collapsed: i.group === void 0 ? void 0 : n.has(i.group),
2750
2749
  top: i.top,
2751
2750
  height: i.height
2752
2751
  }));
@@ -2758,27 +2757,27 @@ class ji {
2758
2757
  const t = this.view;
2759
2758
  if (t.width <= 0) return [];
2760
2759
  const e = this.colours;
2761
- return t.boxes.flatMap((s) => {
2762
- if (!Vt(s, t.width, t.height)) return [];
2763
- const i = rn(s, t.width);
2760
+ return t.boxes.flatMap((n) => {
2761
+ if (!zt(n, t.width, t.height)) return [];
2762
+ const i = ln(n, t.width);
2764
2763
  if (i === null) return [];
2765
- const o = e === null ? !0 : he(
2766
- It(s.subtask.appearance),
2767
- gt(e, { selectedTask: this.selectedTask, selectedSubtask: this.selectedSubtask }, s.subtask.task, s.subtask.id),
2764
+ const o = e === null ? !0 : ce(
2765
+ Lt(n.subtask.appearance),
2766
+ kt(e, { selectedTask: this.selectedTask, selectedSubtask: this.selectedSubtask }, n.subtask.task, n.subtask.id),
2768
2767
  e
2769
2768
  ).onDark;
2770
- return [{ subtask: s.subtask, ...i, dark: o }];
2769
+ return [{ subtask: n.subtask, ...i, dark: o }];
2771
2770
  });
2772
2771
  }
2773
2772
  /** The findings count the whole plan - an overlap out of view is still one
2774
2773
  to know of -, the subtasks only what is in view. */
2775
2774
  summary() {
2776
- const t = this.view, [e, s] = this.visibleDomain();
2775
+ const t = this.view, [e, n] = this.visibleDomain();
2777
2776
  return {
2778
2777
  lanes: this.data.lanes.length,
2779
- subtasks: t.boxes.filter((i) => Vt(i, t.width, t.height)).length,
2778
+ subtasks: t.boxes.filter((i) => zt(i, t.width, t.height)).length,
2780
2779
  from: e,
2781
- to: s,
2780
+ to: n,
2782
2781
  overlaps: this.data.overlaps.length,
2783
2782
  violated: this.data.violatedById.size,
2784
2783
  blocked: this.data.inBlocked.length,
@@ -2790,12 +2789,12 @@ class ji {
2790
2789
  if (!this.gestures.idle) return null;
2791
2790
  const e = this.data.tooltipTargetFor(t);
2792
2791
  if (e === null) return null;
2793
- const { x: s, y: i } = this.gestures.hoverPoint;
2794
- return { target: e, x: s, y: i };
2792
+ const { x: n, y: i } = this.gestures.hoverPoint;
2793
+ return { target: e, x: n, y: i };
2795
2794
  }
2796
2795
  /** The visible span, as two wall-clock instants. */
2797
2796
  visibleDomain() {
2798
- const t = (e) => ft(e, this.view.options.calendar);
2797
+ const t = (e) => mt(e, this.view.options.calendar);
2799
2798
  return [t(this.view.domain[0]), t(this.view.domain[1])];
2800
2799
  }
2801
2800
  /** A pan or zoom of the planner's goes into the view once per frame,
@@ -2809,18 +2808,18 @@ class ji {
2809
2808
  }
2810
2809
  /** The time and the lane at a client point, or null outside the plot. */
2811
2810
  positionAt(t, e) {
2812
- const s = this.plot?.getBoundingClientRect();
2813
- if (s === void 0) return null;
2814
- const i = t - s.left, o = e - s.top;
2815
- return i < 0 || o < 0 || i > s.width || o > s.height ? null : { time: this.view.timeAt(i), lane: this.view.laneIdAt(o) };
2811
+ const n = this.plot?.getBoundingClientRect();
2812
+ if (n === void 0) return null;
2813
+ const i = t - n.left, o = e - n.top;
2814
+ return i < 0 || o < 0 || i > n.width || o > n.height ? null : { time: this.view.timeAt(i), lane: this.view.laneIdAt(o) };
2816
2815
  }
2817
2816
  /** The client point of a time, on a lane's middle where one is named, or
2818
2817
  null while the schedule is not on screen. */
2819
2818
  clientPointOf(t, e) {
2820
- const s = this.plot?.getBoundingClientRect();
2821
- if (s === void 0) return null;
2819
+ const n = this.plot?.getBoundingClientRect();
2820
+ if (n === void 0) return null;
2822
2821
  const i = this.view.viewport(), o = e === void 0 ? null : et(i, e), a = o === null ? 0 : o.top + o.height / 2;
2823
- return { x: s.left + x(i, t), y: s.top + a };
2822
+ return { x: n.left + x(i, t), y: n.top + a };
2824
2823
  }
2825
2824
  /** Whether a lane has a row of its own on a mounted plot: not unknown, not
2826
2825
  in a folded group, whose lanes are strips and no rows. */
@@ -2832,7 +2831,7 @@ class ji {
2832
2831
  moved, for a lane without a row. */
2833
2832
  scrollToLane(t) {
2834
2833
  if (!this.hasRow(t)) return !1;
2835
- const e = this.view.rows.slots.get(t), s = e.top - this.view.scrollY, i = s < 0 ? s : s + e.height > this.view.height ? Math.min(s + e.height - this.view.height, s) : 0;
2834
+ const e = this.view.rows.slots.get(t), n = e.top - this.view.scrollY, i = n < 0 ? n : n + e.height > this.view.height ? Math.min(n + e.height - this.view.height, n) : 0;
2836
2835
  return this.view.pan(0, i).moved && this.viewMoved(!1), !0;
2837
2836
  }
2838
2837
  /** Brings a subtask's lane and time into view, the span keeping its width;
@@ -2852,9 +2851,9 @@ class ji {
2852
2851
  }
2853
2852
  draw() {
2854
2853
  if (this.root === null) return;
2855
- this.colours === null && (this.colours = Si(this.root, this.data), this.publish());
2856
- const { width: t, height: e } = this.view, s = this.dataStale ? Re(this.dataCanvas, t, e) : null, i = Re(this.overlayCanvas, t, e);
2857
- if (i === null || t === 0 || this.dataStale && s === null) return;
2854
+ this.colours === null && (this.colours = Ii(this.root, this.data), this.publish());
2855
+ const { width: t, height: e } = this.view, n = this.dataStale ? Ge(this.dataCanvas, t, e) : null, i = Ge(this.overlayCanvas, t, e);
2856
+ if (i === null || t === 0 || this.dataStale && n === null) return;
2858
2857
  this.dataStale = !1;
2859
2858
  const o = {
2860
2859
  data: this.data,
@@ -2866,7 +2865,7 @@ class ji {
2866
2865
  hover: this.gestures.hover,
2867
2866
  ghost: this.gestures.ghostDrawing()
2868
2867
  };
2869
- s !== null && Ii(s, o), Li(i, o);
2868
+ n !== null && Li(n, o), Ai(i, o);
2870
2869
  }
2871
2870
  /* ---------------------------------------------------------------- */
2872
2871
  /* Gestures, as the component hands them in */
@@ -2887,50 +2886,50 @@ class ji {
2887
2886
  focus = (t) => this.keys.focus(t);
2888
2887
  blur = () => this.keys.blur();
2889
2888
  }
2890
- function oo(n = {}) {
2891
- const { initialView: t, onViewChange: e } = n, [s] = ct(() => new ji(t)), i = U(""), [o] = ct(() => {
2892
- const l = (d) => Rs(ii, { ...d, scene: s });
2889
+ function ao(s = {}) {
2890
+ const { initialView: t, onViewChange: e } = s, [n] = ut(() => new Zi(t)), i = U(""), [o] = ut(() => {
2891
+ const l = (d) => Rs(oi, { ...d, scene: n });
2893
2892
  return l.displayName = "Schedule", {
2894
2893
  Schedule: l,
2895
- Lane: li,
2896
- LaneGroup: di,
2897
- Subtasks: hi,
2898
- Dependencies: ci,
2899
- BlockedTimes: ui,
2900
- Milestones: fi,
2901
- DataTable: ai,
2894
+ Lane: di,
2895
+ LaneGroup: hi,
2896
+ Subtasks: ci,
2897
+ Dependencies: ui,
2898
+ BlockedTimes: fi,
2899
+ Milestones: mi,
2900
+ DataTable: ri,
2902
2901
  setView: (d) => {
2903
- s.applyView(d), i.current = it(s.getView());
2902
+ n.applyView(d), i.current = it(n.getView());
2904
2903
  },
2905
- setDomain: s.setDomain,
2906
- positionAt: (d, c) => s.positionAt(d, c),
2907
- clientPointOf: (d, c) => s.clientPointOf(d, c),
2908
- visibleDomain: () => s.visibleDomain(),
2909
- scrollToLane: (d) => s.scrollToLane(d),
2910
- scrollToSubtask: (d) => s.scrollToSubtask(d),
2911
- focusSubtask: (d) => s.focusSubtask(d),
2912
- toggleGroup: s.toggleGroup,
2913
- foldAll: s.foldAll,
2914
- unfoldAll: s.unfoldAll
2904
+ setDomain: n.setDomain,
2905
+ positionAt: (d, c) => n.positionAt(d, c),
2906
+ clientPointOf: (d, c) => n.clientPointOf(d, c),
2907
+ visibleDomain: () => n.visibleDomain(),
2908
+ scrollToLane: (d) => n.scrollToLane(d),
2909
+ scrollToSubtask: (d) => n.scrollToSubtask(d),
2910
+ focusSubtask: (d) => n.focusSubtask(d),
2911
+ toggleGroup: n.toggleGroup,
2912
+ foldAll: n.foldAll,
2913
+ unfoldAll: n.unfoldAll
2915
2914
  };
2916
- }), a = te(s.subscribeView, s.getView, s.getView), r = it(a);
2915
+ }), a = ee(n.subscribeView, n.getView, n.getView), r = it(a);
2917
2916
  return Y(() => {
2918
- i.current !== r && (i.current = r, s.acted && e?.(a));
2917
+ i.current !== r && (i.current = r, n.acted && e?.(a));
2919
2918
  }, [r]), X(() => ({ ...o, view: a }), [o, a]);
2920
2919
  }
2921
2920
  export {
2922
- De as applyIntent,
2923
- se as arrival,
2924
- ee as departure,
2925
- so as findings,
2921
+ _e as applyIntent,
2922
+ ne as arrival,
2923
+ se as departure,
2924
+ no as findings,
2926
2925
  es as inBlockedTime,
2927
2926
  tt as occupied,
2928
- ne as overlaps,
2929
- It as resolveAppearance,
2930
- no as ripple,
2931
- io as shiftTask,
2932
- Us as snapTime,
2933
- eo as subtaskFromPlace,
2934
- oo as useSchedule,
2935
- ie as violatedDependencies
2927
+ ie as overlaps,
2928
+ Lt as resolveAppearance,
2929
+ io as ripple,
2930
+ oo as shiftTask,
2931
+ Xs as snapTime,
2932
+ so as subtaskFromPlace,
2933
+ ao as useSchedule,
2934
+ oe as violatedDependencies
2936
2935
  };