@umriss-ui/schedule 0.3.6 → 0.3.7

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,111 +1,111 @@
1
1
  import "./schedule.css";
2
- var is = Object.defineProperty;
3
- var rs = (o, t, e) => t in o ? is(o, t, { enumerable: !0, configurable: !0, writable: !0, value: e }) : o[t] = e;
4
- var f = (o, t, e) => rs(o, typeof t != "symbol" ? t + "" : t, e);
5
- import { jsxs as Y, Fragment as At, jsx as k } from "react/jsx-runtime";
6
- import { useContext as _e, createContext as De, useRef as x, useEffect as H, forwardRef as as, useState as ut, useId as ls, useLayoutEffect as Ct, useImperativeHandle as ds, useSyncExternalStore as hs, useMemo as X } from "react";
7
- import { toWorkingTimeClamped as K, resolveColours as us, removedIntervals as cs, localOffset as Fe, MINUTE as W, calendarFrom as j, toWallClock as z, DAY as rt, timeStep as fs, workingTimeTicks as ps, HOUR as Rt, LinearScale as ms, subscribeTheme as gs } from "@umriss-ui/charts";
8
- import { useFormats as Bt, useWording as pt, AngleGlyph as ks, VisuallyHidden as le } from "@umriss-ui/core";
9
- const Oe = De(null), Ee = De(null);
10
- function Re() {
11
- return _e(Ee);
12
- }
13
- function ys(o) {
14
- const t = _e(Oe);
2
+ var fs = Object.defineProperty;
3
+ var ps = (o, t, e) => t in o ? fs(o, t, { enumerable: !0, configurable: !0, writable: !0, value: e }) : o[t] = e;
4
+ var f = (o, t, e) => ps(o, typeof t != "symbol" ? t + "" : t, e);
5
+ import { jsxs as z, Fragment as Ot, jsx as k } from "react/jsx-runtime";
6
+ import { useContext as Be, createContext as Ne, useRef as G, useEffect as K, forwardRef as ms, useState as ut, useId as gs, useLayoutEffect as ft, useImperativeHandle as ks, useSyncExternalStore as ys, useMemo as X } from "react";
7
+ import { toWorkingTimeClamped as U, resolveColours as vs, removedIntervals as ws, localOffset as $t, MINUTE as V, calendarFrom as tt, toWallClock as q, DAY as j, timeStep as bs, workingTimeTicks as Ms, HOUR as xt, LinearScale as Ts, subscribeTheme as Is } from "@umriss-ui/charts";
8
+ import { useFormats as Gt, useWording as gt, AngleGlyph as Cs, VisuallyHidden as me } from "@umriss-ui/core";
9
+ const $e = Ne(null), xe = Ne(null);
10
+ function Ge() {
11
+ return Be(xe);
12
+ }
13
+ function Ss(o) {
14
+ const t = Be($e);
15
15
  if (t === null)
16
16
  throw new Error(`@umriss-ui/schedule: <${o}> must be used inside a <Schedule>.`);
17
17
  return t;
18
18
  }
19
- function Pt(o, t, e, n, s) {
20
- const i = ys(o), r = x(null);
21
- H(() => (r.current = e(i, t), () => {
19
+ function Ht(o, t, e, n, s) {
20
+ const i = Ss(o), r = G(null);
21
+ K(() => (r.current = e(i, t), () => {
22
22
  r.current !== null && s(i, r.current), r.current = null;
23
- }), [i]), H(() => {
23
+ }), [i]), K(() => {
24
24
  r.current !== null && n(i, r.current, t);
25
25
  });
26
26
  }
27
- function vs(o) {
28
- Pt("Lane", o, (t, e) => t.registerLane(e), (t, e, n) => t.updateLane(e, n), (t, e) => t.unregisterLane(e));
27
+ function Ls(o) {
28
+ Ht("Lane", o, (t, e) => t.registerLane(e), (t, e, n) => t.updateLane(e, n), (t, e) => t.unregisterLane(e));
29
29
  }
30
- function ws(o) {
31
- Pt("LaneGroup", o, (t, e) => t.registerGroup(e), (t, e, n) => t.updateGroup(e, n), (t, e) => t.unregisterGroup(e));
30
+ function As(o) {
31
+ Ht("LaneGroup", o, (t, e) => t.registerGroup(e), (t, e, n) => t.updateGroup(e, n), (t, e) => t.unregisterGroup(e));
32
32
  }
33
- function Nt(o, t) {
34
- Pt(o, t, (e, n) => e.registerLayer(n), (e, n, s) => e.updateLayer(n, s), (e, n) => e.unregisterLayer(n));
33
+ function Yt(o, t) {
34
+ Ht(o, t, (e, n) => e.registerLayer(n), (e, n, s) => e.updateLayer(n, s), (e, n) => e.unregisterLayer(n));
35
35
  }
36
- function mt(o) {
36
+ function kt(o) {
37
37
  let t = !1, e = !1, n = !1, s = !1;
38
38
  for (const i of o ?? [])
39
39
  i === "provisional" ? (t = !0, e = !1) : i === "fixed" ? (e = !0, t = !1) : i === "muted" ? n = !0 : i === "open" && (s = !0);
40
40
  return { dashed: t, hatched: e, muted: n, open: s };
41
41
  }
42
- const bs = 24, Ms = 4, Ts = 3, St = 4;
43
- function de(o) {
42
+ const Ds = 24, _s = 4, Fs = 3, Lt = 4;
43
+ function ge(o) {
44
44
  const { lanes: t, groups: e, collapsed: n, laneHeight: s } = o, i = new Map(e.map((g) => [g.id, g])), r = (g) => g !== void 0 && i.has(g) ? g : void 0, a = /* @__PURE__ */ new Map(), l = (g) => {
45
45
  const I = [];
46
46
  let S = r(g.parent);
47
- const F = /* @__PURE__ */ new Set();
48
- for (; S !== void 0 && !F.has(S); )
49
- F.add(S), I.unshift(S), S = r(i.get(S).parent);
47
+ const R = /* @__PURE__ */ new Set();
48
+ for (; S !== void 0 && !R.has(S); )
49
+ R.add(S), I.unshift(S), S = r(i.get(S).parent);
50
50
  return I;
51
51
  }, h = /* @__PURE__ */ new Map();
52
52
  for (const g of t) {
53
53
  const I = l(g);
54
54
  h.set(g.id, I);
55
55
  for (const S of I) {
56
- const F = a.get(S) ?? [];
57
- F.push(g.id), a.set(S, F);
56
+ const R = a.get(S) ?? [];
57
+ R.push(g.id), a.set(S, R);
58
58
  }
59
59
  }
60
60
  const d = [], u = /* @__PURE__ */ new Map();
61
61
  let p = [], m = null, y = 0;
62
- const C = (g) => (d.push({ ...g, top: y }), y += g.height, d.length - 1), L = (g) => g.find((I) => n.has(I)), A = () => {
62
+ const C = (g) => (d.push({ ...g, top: y }), y += g.height, d.length - 1), A = (g) => g.find((I) => n.has(I)), D = () => {
63
63
  if (m === null) return;
64
- const { row: g, lanes: I } = m, S = d[g], F = Math.max(S.height, I.length * Ms + 2 * St);
65
- d[g] = { ...S, height: F }, y += F - S.height;
66
- const D = F - 2 * St, N = Math.max(Ts, Math.floor(D / I.length));
67
- I.forEach((Q, ht) => {
68
- const V = h.get(Q) ?? [];
69
- u.set(Q, {
70
- top: S.top + St + ht * N,
71
- height: N,
64
+ const { row: g, lanes: I } = m, S = d[g], R = Math.max(S.height, I.length * _s + 2 * Lt);
65
+ d[g] = { ...S, height: R }, y += R - S.height;
66
+ const O = R - 2 * Lt, H = Math.max(Fs, Math.floor(O / I.length));
67
+ I.forEach((nt, ct) => {
68
+ const Z = h.get(nt) ?? [];
69
+ u.set(nt, {
70
+ top: S.top + Lt + ct * H,
71
+ height: H,
72
72
  miniature: !0,
73
- group: V[V.length - 1]
73
+ group: Z[Z.length - 1]
74
74
  });
75
75
  }), m = null;
76
76
  };
77
77
  for (const g of t) {
78
- const I = (h.get(g.id) ?? []).filter((D) => (a.get(D) ?? []).length > 0), S = L(I);
78
+ const I = (h.get(g.id) ?? []).filter((O) => (a.get(O) ?? []).length > 0), S = A(I);
79
79
  if (m !== null && S === m.group) {
80
80
  m.lanes.push(g.id);
81
81
  continue;
82
82
  }
83
- A();
84
- const F = I.filter((D, N) => p[N] === D).length;
85
- p = p.slice(0, F);
86
- for (const D of I.slice(F)) {
87
- if (p.push(D), D === S) break;
83
+ D();
84
+ const R = I.filter((O, H) => p[H] === O).length;
85
+ p = p.slice(0, R);
86
+ for (const O of I.slice(R)) {
87
+ if (p.push(O), O === S) break;
88
88
  C({
89
89
  kind: "groupHead",
90
90
  lane: void 0,
91
- group: D,
91
+ group: O,
92
92
  depth: p.length - 1,
93
93
  within: [...p],
94
- lanes: (a.get(D) ?? []).length,
95
- height: bs
94
+ lanes: (a.get(O) ?? []).length,
95
+ height: Ds
96
96
  });
97
97
  }
98
98
  if (S !== void 0) {
99
- const D = I.indexOf(S), N = C({
99
+ const O = I.indexOf(S), H = C({
100
100
  kind: "miniature",
101
101
  lane: void 0,
102
102
  group: S,
103
- depth: D,
104
- within: I.slice(0, D + 1),
103
+ depth: O,
104
+ within: I.slice(0, O + 1),
105
105
  lanes: (a.get(S) ?? []).length,
106
106
  height: s
107
107
  });
108
- m = { group: S, row: N, lanes: [g.id] };
108
+ m = { group: S, row: H, lanes: [g.id] };
109
109
  continue;
110
110
  }
111
111
  C({ kind: "lane", lane: g.id, group: I[I.length - 1], depth: I.length, within: I, lanes: 1, height: s }), u.set(g.id, {
@@ -115,15 +115,15 @@ function de(o) {
115
115
  group: I[I.length - 1]
116
116
  });
117
117
  }
118
- return A(), { rows: d, slots: u, height: y };
118
+ return D(), { rows: d, slots: u, height: y };
119
119
  }
120
- function Is(o, t) {
120
+ function Os(o, t) {
121
121
  if (t.size === 0) return o;
122
122
  const e = /* @__PURE__ */ new Set();
123
123
  for (const n of o) t.has(n) || e.add(n);
124
124
  return e;
125
125
  }
126
- function Z(o, t) {
126
+ function et(o, t) {
127
127
  if (t < 0 || t >= o.height) return null;
128
128
  let e = 0, n = o.rows.length - 1;
129
129
  for (; e <= n; ) {
@@ -134,11 +134,11 @@ function Z(o, t) {
134
134
  }
135
135
  return null;
136
136
  }
137
- function $t(o, t) {
137
+ function Kt(o, t) {
138
138
  return o.slots.get(t) ?? null;
139
139
  }
140
- function Cs(o, t) {
141
- const e = Z(o, t);
140
+ function Es(o, t) {
141
+ const e = et(o, t);
142
142
  if (e === null) return null;
143
143
  if (e.kind === "lane") return e.lane ?? null;
144
144
  if (e.kind === "groupHead") return null;
@@ -146,16 +146,16 @@ function Cs(o, t) {
146
146
  if (s.miniature && t >= s.top && t < s.top + s.height) return n;
147
147
  return null;
148
148
  }
149
- function J(o) {
149
+ function st(o) {
150
150
  return { from: o.from - (o.leadIn ?? 0), to: o.to + (o.leadOut ?? 0) };
151
151
  }
152
- function Gt(o, t) {
152
+ function zt(o, t) {
153
153
  return (o.leaves ?? "leadOut") === "main" ? t.to : t.to + (t.leadOut ?? 0);
154
154
  }
155
- function xt(o, t) {
155
+ function Ut(o, t) {
156
156
  return (o.arrives ?? "leadIn") === "main" ? t.from : t.from - (t.leadIn ?? 0);
157
157
  }
158
- function he(o, t) {
158
+ function ke(o, t) {
159
159
  if (t.kind === "place" || t.subtask !== o.id) return o;
160
160
  switch (t.kind) {
161
161
  case "move":
@@ -169,7 +169,7 @@ function he(o, t) {
169
169
  return { ...o, lane: t.lane };
170
170
  }
171
171
  }
172
- function no(o, t) {
172
+ function fo(o, t) {
173
173
  return {
174
174
  id: t,
175
175
  task: o.task,
@@ -180,75 +180,75 @@ function no(o, t) {
180
180
  ...o.leadOut === void 0 ? {} : { leadOut: o.leadOut }
181
181
  };
182
182
  }
183
- const Ss = 6, Be = 3, ot = 2, ue = 3, ce = 3;
184
- function E(o, t) {
185
- return Math.round(o.scale.toPx(K(t, o.calendar)));
183
+ const Rs = 6, He = 3, rt = 2, ye = 3, ve = 3;
184
+ function N(o, t) {
185
+ return Math.round(o.scale.toPx(U(t, o.calendar)));
186
186
  }
187
- function lt(o, t) {
188
- const e = $t(o.rows, t);
187
+ function dt(o, t) {
188
+ const e = Kt(o.rows, t);
189
189
  return e === null ? null : { ...e, top: e.top - o.scrollY };
190
190
  }
191
- function fe(o, t) {
192
- return Cs(o.rows, t + o.scrollY);
191
+ function we(o, t) {
192
+ return Es(o.rows, t + o.scrollY);
193
193
  }
194
- function Pe(o, t, e, n, s) {
195
- const i = n.miniature ? 0 : Ss, r = n.miniature ? 0 : ce * ue, a = Math.max(n.miniature ? 1 : 4, n.height - 2 * i - r), l = n.top - o.scrollY + Math.floor((n.height - a) / 2), h = J(t);
194
+ function Ye(o, t, e, n, s) {
195
+ const i = n.miniature ? 0 : Rs, r = n.miniature ? 0 : ve * ye, a = Math.max(n.miniature ? 1 : 4, n.height - 2 * i - r), l = n.top - o.scrollY + Math.floor((n.height - a) / 2), h = st(t);
196
196
  return {
197
197
  subtask: t,
198
198
  lane: e,
199
199
  miniature: n.miniature,
200
200
  depth: s,
201
- y: l + (n.miniature ? 0 : Math.min(s, ce) * ue),
201
+ y: l + (n.miniature ? 0 : Math.min(s, ve) * ye),
202
202
  height: a,
203
- outerFrom: E(o, h.from),
204
- mainFrom: E(o, t.from),
205
- mainTo: E(o, t.to),
206
- outerTo: E(o, h.to)
203
+ outerFrom: N(o, h.from),
204
+ mainFrom: N(o, t.from),
205
+ mainTo: N(o, t.to),
206
+ outerTo: N(o, h.to)
207
207
  };
208
208
  }
209
- function Ne(o, t, e) {
209
+ function Ke(o, t, e) {
210
210
  if (e < o.y || e > o.y + o.height) return null;
211
211
  const n = Math.max(0, (6 - (o.outerTo - o.outerFrom)) / 2);
212
212
  return t < o.outerFrom - n || t > o.outerTo + n ? null : t < o.mainFrom ? "leadIn" : t > o.mainTo ? "leadOut" : "main";
213
213
  }
214
- function Ls(o, t, e, n = 5) {
214
+ function Ps(o, t, e, n = 5) {
215
215
  if (e < o.y || e > o.y + o.height) return null;
216
216
  const s = Math.abs(t - o.mainFrom), i = Math.abs(t - o.mainTo);
217
217
  return Math.min(s, i) > n ? null : s <= i ? "from" : "to";
218
218
  }
219
- function _t(o, t, e) {
219
+ function Et(o, t, e) {
220
220
  return o.outerTo >= 0 && o.outerFrom <= t && o.y + o.height >= 0 && o.y <= e;
221
221
  }
222
- const As = 64;
223
- function _s(o, t) {
222
+ const Bs = 64;
223
+ function Ns(o, t) {
224
224
  if (o.miniature) return null;
225
- const e = mt(o.subtask.appearance).hatched ? ot + Be + 1 : 0, n = Math.max(o.mainFrom + e, 0), s = Math.min(o.mainTo - e, t) - n;
226
- return s < As ? null : { x: n, width: s, y: o.y, height: o.height };
225
+ const e = kt(o.subtask.appearance).hatched ? rt + He + 1 : 0, n = Math.max(o.mainFrom + e, 0), s = Math.min(o.mainTo - e, t) - n;
226
+ return s < Bs ? null : { x: n, width: s, y: o.y, height: o.height };
227
227
  }
228
- const Ds = 10;
229
- function pe(o, t, e) {
228
+ const $s = 10;
229
+ function be(o, t, e) {
230
230
  const n = Math.round(t.y + t.height / 2);
231
231
  return o === "centre" || e.y === t.y ? n : Math.round(e.y > t.y ? t.y + t.height - 1 : t.y + 1);
232
232
  }
233
- function Dt(o, t, e, n, s) {
234
- const i = t.route ?? s.route, r = t.attach ?? s.attach, a = t.ends ?? s.ends, l = E(o, Gt(t, e.subtask)), h = E(o, xt(t, n.subtask)), d = pe(r, e, n), u = pe(r, n, e);
233
+ function Rt(o, t, e, n, s) {
234
+ const i = t.route ?? s.route, r = t.attach ?? s.attach, a = t.ends ?? s.ends, l = N(o, zt(t, e.subtask)), h = N(o, Ut(t, n.subtask)), d = be(r, e, n), u = be(r, n, e);
235
235
  if (i === "straight")
236
236
  return { dependency: t, kind: i, ends: a, x1: l, y1: d, x2: h, y2: u, c1x: l, c2x: h, points: [l, d, h, u] };
237
237
  if (i === "orthogonal") {
238
- const L = l + Ds, A = d === u ? L : Math.round((L + h) / 2);
239
- return { dependency: t, kind: i, ends: a, x1: l, y1: d, x2: h, y2: u, c1x: l, c2x: h, points: d === u ? [l, d, h, u] : [l, d, A, d, A, u, h, u] };
238
+ const A = l + $s, D = d === u ? A : Math.round((A + h) / 2);
239
+ return { dependency: t, kind: i, ends: a, x1: l, y1: d, x2: h, y2: u, c1x: l, c2x: h, points: d === u ? [l, d, h, u] : [l, d, D, d, D, u, h, u] };
240
240
  }
241
241
  const p = Math.max(14, Math.abs(h - l) / 2), m = l + p, y = h - p, C = [];
242
- for (let L = 0; L <= 16; L++) {
243
- const A = L / 16, g = 1 - A;
242
+ for (let A = 0; A <= 16; A++) {
243
+ const D = A / 16, g = 1 - D;
244
244
  C.push(
245
- g * g * g * l + 3 * g * g * A * m + 3 * g * A * A * y + A * A * A * h,
246
- g * g * g * d + 3 * g * g * A * d + 3 * g * A * A * u + A * A * A * u
245
+ g * g * g * l + 3 * g * g * D * m + 3 * g * D * D * y + D * D * D * h,
246
+ g * g * g * d + 3 * g * g * D * d + 3 * g * D * D * u + D * D * D * u
247
247
  );
248
248
  }
249
249
  return { dependency: t, kind: "curve", ends: a, x1: l, y1: d, x2: h, y2: u, c1x: m, c2x: y, points: C };
250
250
  }
251
- function Fs(o, t, e) {
251
+ function xs(o, t, e) {
252
252
  let n = 1 / 0;
253
253
  const s = o.points;
254
254
  for (let i = 0; i + 3 < s.length; i += 2) {
@@ -257,10 +257,10 @@ function Fs(o, t, e) {
257
257
  }
258
258
  return n;
259
259
  }
260
- function Ht(o) {
260
+ function Wt(o) {
261
261
  const t = [], e = /* @__PURE__ */ new Map();
262
262
  o.forEach((n, s) => {
263
- const { from: i, to: r } = J(n);
263
+ const { from: i, to: r } = st(n);
264
264
  if (!(i < r)) return;
265
265
  const a = e.get(n.lane) ?? [];
266
266
  a.push({ subtask: n, index: s, from: i, to: r }), e.set(n.lane, a);
@@ -278,10 +278,10 @@ function Ht(o) {
278
278
  }
279
279
  return t;
280
280
  }
281
- function Os(o) {
281
+ function Gs(o) {
282
282
  const t = /* @__PURE__ */ new Map(), e = /* @__PURE__ */ new Map();
283
283
  for (const n of o) {
284
- const s = J(n), i = e.get(n.lane) ?? [];
284
+ const s = st(n), i = e.get(n.lane) ?? [];
285
285
  let r = 0;
286
286
  if (s.from < s.to) {
287
287
  for (const a of i) s.from < a.to && a.from < s.to && r++;
@@ -291,33 +291,33 @@ function Os(o) {
291
291
  }
292
292
  return t;
293
293
  }
294
- function Yt(o, t) {
294
+ function Xt(o, t) {
295
295
  const e = new Map(o.map((s) => [s.id, s])), n = [];
296
296
  for (const s of t) {
297
297
  const i = e.get(s.from), r = e.get(s.to);
298
298
  if (i === void 0 || r === void 0) continue;
299
- const a = Gt(s, i), l = xt(s, r), h = a + s.lag - l;
299
+ const a = zt(s, i), l = Ut(s, r), h = a + s.lag - l;
300
300
  h > 0 && n.push({ dependency: s.id, departure: a, arrival: l, shortBy: h });
301
301
  }
302
302
  return n;
303
303
  }
304
- function $e(o, t) {
304
+ function ze(o, t) {
305
305
  const e = [];
306
306
  for (const n of o) {
307
- const s = J(n);
307
+ const s = st(n);
308
308
  for (const i of t)
309
309
  i.lane !== n.lane || !(s.from < i.to && i.from < s.to) || e.push({ subtask: n.id, blocked: i.id, lane: i.lane, from: Math.max(s.from, i.from), to: Math.min(s.to, i.to) });
310
310
  }
311
311
  return e;
312
312
  }
313
- function oo(o, t, e = []) {
313
+ function po(o, t, e = []) {
314
314
  return {
315
- overlaps: Ht(o),
316
- violatedDependencies: Yt(o, t),
317
- inBlockedTime: $e(o, e)
315
+ overlaps: Wt(o),
316
+ violatedDependencies: Xt(o, t),
317
+ inBlockedTime: ze(o, e)
318
318
  };
319
319
  }
320
- class Es {
320
+ class Hs {
321
321
  /** `changed` is called after every registration change. */
322
322
  constructor(t) {
323
323
  f(this, "nextId", 1);
@@ -388,7 +388,7 @@ class Es {
388
388
  this.subtasks.push(...e.data);
389
389
  for (const n of e.tasks) this.tasks.set(n.id, n);
390
390
  } else e.kind === "dependencies" ? this.dependencies.push(...e.data) : this.blocked.push(...e.data);
391
- return this.subtaskById = new Map(this.subtasks.map((e) => [e.id, e])), this.overlaps = Ht(this.subtasks), this.violatedById = new Map(Yt(this.subtasks, this.dependencies).map((e) => [e.dependency, e])), this.depth = Os(this.subtasks), this.inBlocked = $e(this.subtasks, this.blocked), !0;
391
+ return this.subtaskById = new Map(this.subtasks.map((e) => [e.id, e])), this.overlaps = Wt(this.subtasks), this.violatedById = new Map(Xt(this.subtasks, this.dependencies).map((e) => [e.dependency, e])), this.depth = Gs(this.subtasks), this.inBlocked = ze(this.subtasks, this.blocked), !0;
392
392
  }
393
393
  /** The task a dependency belongs to: its departing subtask's. */
394
394
  taskOfDependency(t) {
@@ -414,7 +414,7 @@ class Es {
414
414
  };
415
415
  }
416
416
  }
417
- const Rs = {
417
+ const Ys = {
418
418
  line: "var(--u-hairline)",
419
419
  lineStrong: "var(--u-hairline-strong)",
420
420
  text: "var(--u-color-text)",
@@ -428,7 +428,7 @@ const Rs = {
428
428
  /* What text and marks take ON a filled bar - the same token the bar labels
429
429
  use in CSS, so a cap and the label beside it are one colour. */
430
430
  onAccent: "var(--u-color-on-accent)"
431
- }, Ge = {
431
+ }, Ue = {
432
432
  line: "GrayText",
433
433
  lineStrong: "CanvasText",
434
434
  text: "CanvasText",
@@ -438,11 +438,11 @@ const Rs = {
438
438
  active: "Highlight",
439
439
  now: "GrayText",
440
440
  onAccent: "Canvas"
441
- }, Bs = (o) => o ? Ge : Rs, Ps = () => typeof window < "u" && typeof window.matchMedia == "function" && window.matchMedia("(forced-colors: active)").matches;
442
- function Ns(o, t) {
443
- const e = Ps(), n = {};
444
- for (const r of t.tasks.values()) n[`task:${r.id}`] = e ? Ge.text : r.color;
445
- const s = us(o, { ...Bs(e), ...n }), i = /* @__PURE__ */ new Map();
441
+ }, Ks = (o) => o ? Ue : Ys, zs = () => typeof window < "u" && typeof window.matchMedia == "function" && window.matchMedia("(forced-colors: active)").matches;
442
+ function Us(o, t) {
443
+ const e = zs(), n = {};
444
+ for (const r of t.tasks.values()) n[`task:${r.id}`] = e ? Ue.text : r.color;
445
+ const s = vs(o, { ...Ks(e), ...n }), i = /* @__PURE__ */ new Map();
446
446
  for (const r of t.tasks.values()) i.set(r.id, s[`task:${r.id}`] ?? r.color);
447
447
  return {
448
448
  line: s.line,
@@ -458,97 +458,97 @@ function Ns(o, t) {
458
458
  forced: e
459
459
  };
460
460
  }
461
- function at(o) {
461
+ function lt(o) {
462
462
  const t = o.match(/[\d.]+/g);
463
463
  return t === null || t.length < 3 ? null : [Number(t[0]), Number(t[1]), Number(t[2])];
464
464
  }
465
- function me(o) {
466
- const t = at(o);
467
- return t === null ? 0 : He(xe(t));
465
+ function Me(o) {
466
+ const t = lt(o);
467
+ return t === null ? 0 : Xe(We(t));
468
468
  }
469
- function xe(o) {
469
+ function We(o) {
470
470
  return o.map((t) => {
471
471
  const e = t / 255;
472
472
  return e <= 0.04045 ? e / 12.92 : ((e + 0.055) / 1.055) ** 2.4;
473
473
  });
474
474
  }
475
- function He([o, t, e]) {
475
+ function Xe([o, t, e]) {
476
476
  return 0.2126 * o + 0.7152 * t + 0.0722 * e;
477
477
  }
478
- function ge(o, t) {
479
- const e = me(o), n = me(t);
478
+ function Te(o, t) {
479
+ const e = Me(o), n = Me(t);
480
480
  return (Math.max(e, n) + 0.05) / (Math.min(e, n) + 0.05);
481
481
  }
482
- function ke(o, t, e) {
482
+ function Ie(o, t, e) {
483
483
  if (o === null) return null;
484
484
  const n = typeof window > "u" ? 1 : window.devicePixelRatio || 1, s = Math.round(t * n), i = Math.round(e * n);
485
485
  o.width !== s && (o.width = s), o.height !== i && (o.height = i);
486
486
  const r = o.getContext("2d");
487
487
  return r === null ? null : (r.setTransform(n, 0, 0, n, 0, 0), r.clearRect(0, 0, t, e), r);
488
488
  }
489
- function $s(o, t) {
489
+ function Ws(o, t) {
490
490
  const { data: e, view: n } = t, s = n.viewport();
491
- Ys(o, t, s);
492
- for (const i of e.blocked) js(o, t, s, i);
493
- Ks(o, t);
491
+ js(o, t, s);
492
+ for (const i of e.blocked) on(o, t, s, i);
493
+ Zs(o, t);
494
494
  for (const i of e.layers) {
495
495
  if (i.kind === "blocked") continue;
496
496
  const r = new Set(i.data);
497
497
  if (i.kind === "dependencies")
498
- for (const a of n.paths) r.has(a.dependency) && Ft(o, t, a, !1);
498
+ for (const a of n.paths) r.has(a.dependency) && Pt(o, t, a, !1);
499
499
  else
500
- for (const a of n.boxes) r.has(a.subtask) && Ke(o, t, a, 1);
500
+ for (const a of n.boxes) r.has(a.subtask) && qe(o, t, a, 1);
501
501
  }
502
- for (const i of e.overlaps) Et(o, t, s, i);
503
- for (const i of e.inBlocked) Et(o, t, s, i);
504
- qs(o, t, s), Qs(o, t);
502
+ for (const i of e.overlaps) Nt(o, t, s, i);
503
+ for (const i of e.inBlocked) Nt(o, t, s, i);
504
+ nn(o, t, s), ln(o, t);
505
505
  }
506
- function Gs(o, t) {
506
+ function Xs(o, t) {
507
507
  const { view: e, hover: n } = t, s = e.viewport();
508
508
  if (t.ghost === null) {
509
509
  if (n.kind === "subtask") {
510
510
  const u = e.boxById.get(n.subtask.id);
511
- u !== void 0 && Zs(o, t, u);
511
+ u !== void 0 && rn(o, t, u);
512
512
  } else if (n.kind === "dependency") {
513
513
  const u = e.paths.find((p) => p.dependency === n.dependency);
514
- u !== void 0 && Ft(o, t, u, !0);
514
+ u !== void 0 && Pt(o, t, u, !0);
515
515
  }
516
516
  return;
517
517
  }
518
518
  const i = t.ghost, { ghost: r, overlaps: a, violated: l } = i;
519
- xs(o, t, s, i.refusedLanes);
520
- const h = Ye(s, r);
519
+ Vs(o, t, s, i.refusedLanes);
520
+ const h = Ve(s, r);
521
521
  if (h === null) return;
522
- for (const u of a) Et(o, t, s, u);
522
+ for (const u of a) Nt(o, t, s, u);
523
523
  const d = new Set(l.map((u) => u.dependency));
524
524
  for (const u of t.data.dependencies) {
525
525
  if (u.from !== r.id && u.to !== r.id) continue;
526
526
  const p = e.boxById.get(u.from === r.id ? u.to : u.from);
527
527
  if (p === void 0) continue;
528
- const m = u.from === r.id ? Dt(s, u, h, p, e.options) : Dt(s, u, p, h, e.options);
529
- Ft(o, t, m, !0, d.has(u.id));
528
+ const m = u.from === r.id ? Rt(s, u, h, p, e.options) : Rt(s, u, p, h, e.options);
529
+ Pt(o, t, m, !0, d.has(u.id));
530
530
  }
531
- Ke(o, { ...t, selectedTask: null }, h, 0.55), o.strokeStyle = t.colours.text, o.lineWidth = 1, o.setLineDash([3, 2]), o.strokeRect(h.outerFrom + 0.5, h.y + 0.5, Math.max(1, h.outerTo - h.outerFrom - 1), h.height - 1), o.setLineDash([]), i.tether !== null && Hs(o, t, h, i.tether);
531
+ qe(o, { ...t, selectedTask: null }, h, 0.55), o.strokeStyle = t.colours.text, o.lineWidth = 1, o.setLineDash([3, 2]), o.strokeRect(h.outerFrom + 0.5, h.y + 0.5, Math.max(1, h.outerTo - h.outerFrom - 1), h.height - 1), o.setLineDash([]), i.tether !== null && qs(o, t, h, i.tether);
532
532
  }
533
- function xs(o, t, e, n) {
533
+ function Vs(o, t, e, n) {
534
534
  if (n.size === 0) return;
535
535
  const { width: s, height: i } = t.view;
536
536
  for (const r of n) {
537
- const a = lt(e, r);
537
+ const a = dt(e, r);
538
538
  if (a === null) continue;
539
539
  const { top: l, height: h } = a;
540
- l + h < 0 || l > i || (o.globalAlpha = 0.6, o.fillStyle = t.colours.surface, o.fillRect(0, l, s, h), o.globalAlpha = 1, Xe(o, 0, l, s, h, t.colours.muted, 0.7, Ue, 1));
540
+ l + h < 0 || l > i || (o.globalAlpha = 0.6, o.fillStyle = t.colours.surface, o.fillRect(0, l, s, h), o.globalAlpha = 1, Ze(o, 0, l, s, h, t.colours.muted, 0.7, je, 1));
541
541
  }
542
542
  }
543
- function Hs(o, t, e, n) {
543
+ function qs(o, t, e, n) {
544
544
  const s = Math.max(e.outerFrom, Math.min(e.outerTo, n.x)), i = Math.max(e.y, Math.min(e.y + e.height, n.y));
545
545
  Math.hypot(n.x - s, n.y - i) < 2 || (o.strokeStyle = t.colours.text, o.lineWidth = 1, o.setLineDash([2, 3]), o.beginPath(), o.moveTo(s + 0.5, i + 0.5), o.lineTo(n.x + 0.5, n.y + 0.5), o.stroke(), o.setLineDash([]));
546
546
  }
547
- function Ye(o, t) {
548
- const e = $t(o.rows, t.lane);
549
- return e === null ? null : Pe(o, t, t.lane, e, 0);
547
+ function Ve(o, t) {
548
+ const e = Kt(o.rows, t.lane);
549
+ return e === null ? null : Ye(o, t, t.lane, e, 0);
550
550
  }
551
- function Ys(o, t, e) {
551
+ function js(o, t, e) {
552
552
  const { view: n, colours: s, bands: i } = t, { width: r, height: a } = n;
553
553
  o.lineWidth = 1, o.strokeStyle = s.line, o.beginPath();
554
554
  for (const d of i.ticks)
@@ -567,7 +567,7 @@ function Ys(o, t, e) {
567
567
  for (const d of i.days)
568
568
  o.moveTo(d.x + 0.5, 0), o.lineTo(d.x + 0.5, a);
569
569
  o.stroke();
570
- const h = cs(n.options.calendar);
570
+ const h = ws(n.options.calendar);
571
571
  if (h.length > 0) {
572
572
  o.strokeStyle = s.muted, o.setLineDash([2, 3]), o.beginPath();
573
573
  for (const d of h) {
@@ -577,12 +577,12 @@ function Ys(o, t, e) {
577
577
  o.stroke(), o.setLineDash([]);
578
578
  }
579
579
  }
580
- function Ks(o, t) {
580
+ function Zs(o, t) {
581
581
  const e = t.view.nowX();
582
582
  e !== null && (o.fillStyle = t.colours.now, o.fillRect(e, 0, 2, t.view.height));
583
583
  }
584
- function Us(o, t, e, n) {
585
- const s = dt(t.colours, t, e.subtask.task, e.subtask.id);
584
+ function Js(o, t, e, n) {
585
+ const s = ht(t.colours, t, e.subtask.task, e.subtask.id);
586
586
  o.fillStyle = s;
587
587
  for (const [i, r] of [
588
588
  [e.outerFrom, e.mainFrom],
@@ -591,39 +591,39 @@ function Us(o, t, e, n) {
591
591
  r <= i || (o.globalAlpha = 0.28 * n, o.fillRect(i, e.y, r - i, e.height));
592
592
  o.globalAlpha = n, o.fillRect(e.mainFrom, e.y, Math.max(1, e.mainTo - e.mainFrom), e.height), o.globalAlpha = 1;
593
593
  }
594
- function Kt(o, t, e) {
594
+ function Vt(o, t, e) {
595
595
  if (o.dashed) return { fill: null, onDark: !1 };
596
- const n = o.muted ? Xs(t, e.surface, 0.5) : t;
597
- return { fill: n, onDark: ge(n, e.onAccent) > ge(n, e.text) };
596
+ const n = o.muted ? Qs(t, e.surface, 0.5) : t;
597
+ return { fill: n, onDark: Te(n, e.onAccent) > Te(n, e.text) };
598
598
  }
599
- function Xs(o, t, e) {
600
- const n = at(o), s = at(t);
599
+ function Qs(o, t, e) {
600
+ const n = lt(o), s = lt(t);
601
601
  if (n === null || s === null) return o;
602
602
  const i = (r) => Math.round(n[r] + (s[r] - n[r]) * e);
603
603
  return `rgb(${i(0)}, ${i(1)}, ${i(2)})`;
604
604
  }
605
- function ye(o, t) {
606
- const e = at(o);
605
+ function Ce(o, t) {
606
+ const e = lt(o);
607
607
  if (e === null || t === 0) return o;
608
- const n = xe(e), s = He(n), [i, r, a] = n.map((l) => {
608
+ const n = We(e), s = Xe(n), [i, r, a] = n.map((l) => {
609
609
  const h = l + (s - l) * t, d = h <= 31308e-7 ? h * 12.92 : 1.055 * h ** (1 / 2.4) - 0.055;
610
610
  return Math.round(Math.min(1, Math.max(0, d)) * 255);
611
611
  });
612
612
  return `rgb(${i}, ${r}, ${a})`;
613
613
  }
614
- function dt(o, t, e, n) {
614
+ function ht(o, t, e, n) {
615
615
  const s = (e === null ? void 0 : o.tasks.get(e)) ?? o.muted;
616
- return t.selectedTask === null ? s : e !== t.selectedTask ? o.forced ? o.muted : ye(s, 1) : o.forced || t.selectedSubtask === null || n === null || n === t.selectedSubtask ? s : ye(s, 0.5);
616
+ return t.selectedTask === null ? s : e !== t.selectedTask ? o.forced ? o.muted : Ce(s, 1) : o.forced || t.selectedSubtask === null || n === null || n === t.selectedSubtask ? s : Ce(s, 0.5);
617
617
  }
618
- const Ws = 2;
619
- function Ke(o, t, e, n) {
618
+ const tn = 2;
619
+ function qe(o, t, e, n) {
620
620
  const { view: s, colours: i } = t;
621
- if (!_t(e, s.width, s.height)) return;
621
+ if (!Et(e, s.width, s.height)) return;
622
622
  if (e.miniature) {
623
- Us(o, t, e, n);
623
+ Js(o, t, e, n);
624
624
  return;
625
625
  }
626
- const r = mt(e.subtask.appearance), a = dt(i, t, e.subtask.task, e.subtask.id), l = Kt(r, a, i), h = e.y, d = e.height, u = Math.max(1, e.mainTo - e.mainFrom), p = l.onDark ? i.onAccent : i.text;
626
+ const r = kt(e.subtask.appearance), a = ht(i, t, e.subtask.task, e.subtask.id), l = Vt(r, a, i), h = e.y, d = e.height, u = Math.max(1, e.mainTo - e.mainFrom), p = l.onDark ? i.onAccent : i.text;
627
627
  o.lineWidth = 1, o.fillStyle = a, o.strokeStyle = a;
628
628
  for (const [y, C] of [
629
629
  [e.outerFrom, e.mainFrom],
@@ -633,36 +633,36 @@ function Ke(o, t, e, n) {
633
633
  l.fill !== null && (o.globalAlpha = n, o.fillStyle = l.fill, o.fillRect(e.mainFrom, h, u, d));
634
634
  const m = e.subtask.progress;
635
635
  if (m !== void 0) {
636
- const y = Math.min(4, Math.max(2, Math.round(d / 6))), C = h + d - y - Ws, L = Math.round(u * Math.max(0, Math.min(1, m)));
637
- o.fillStyle = l.fill === null ? a : p, o.globalAlpha = 0.3 * n, o.fillRect(e.mainFrom, C, u, y), o.globalAlpha = n, L > 0 && o.fillRect(e.mainFrom, C, L, y);
636
+ const y = Math.min(4, Math.max(2, Math.round(d / 6))), C = h + d - y - tn, A = Math.round(u * Math.max(0, Math.min(1, m)));
637
+ o.fillStyle = l.fill === null ? a : p, o.globalAlpha = 0.3 * n, o.fillRect(e.mainFrom, C, u, y), o.globalAlpha = n, A > 0 && o.fillRect(e.mainFrom, C, A, y);
638
638
  }
639
639
  if (r.hatched) {
640
- const y = Math.max(1, Math.min(Be, Math.floor((u - 2 * ot) / 3))), C = u >= 4 * y ? ot : 0, L = d >= 4 * ot ? ot : 0;
641
- o.globalAlpha = n, o.fillStyle = p, o.fillRect(e.mainFrom + C, h + L, y, d - 2 * L), o.fillRect(e.mainTo - C - y, h + L, y, d - 2 * L);
640
+ const y = Math.max(1, Math.min(He, Math.floor((u - 2 * rt) / 3))), C = u >= 4 * y ? rt : 0, A = d >= 4 * rt ? rt : 0;
641
+ o.globalAlpha = n, o.fillStyle = p, o.fillRect(e.mainFrom + C, h + A, y, d - 2 * A), o.fillRect(e.mainTo - C - y, h + A, y, d - 2 * A);
642
642
  }
643
- r.open && Vs(o, e, h, d, i.surface, s.width), r.dashed && (o.globalAlpha = n, o.strokeStyle = a, o.setLineDash([4, 3]), o.strokeRect(e.mainFrom + 0.5, h + 0.5, u - 1, d - 1), o.setLineDash([])), o.globalAlpha = 1, e.depth > 0 && n === 1 && (o.strokeStyle = i.surface, o.strokeRect(e.outerFrom - 0.5, h - 0.5, e.outerTo - e.outerFrom + 1, d + 1));
643
+ r.open && sn(o, e, h, d, i.surface, s.width), r.dashed && (o.globalAlpha = n, o.strokeStyle = a, o.setLineDash([4, 3]), o.strokeRect(e.mainFrom + 0.5, h + 0.5, u - 1, d - 1), o.setLineDash([])), o.globalAlpha = 1, e.depth > 0 && n === 1 && (o.strokeStyle = i.surface, o.strokeRect(e.outerFrom - 0.5, h - 0.5, e.outerTo - e.outerFrom + 1, d + 1));
644
644
  }
645
- const Ue = 6, zs = 16;
646
- function Xe(o, t, e, n, s, i, r, a, l) {
645
+ const je = 6, en = 16;
646
+ function Ze(o, t, e, n, s, i, r, a, l) {
647
647
  o.save(), o.beginPath(), o.rect(t, e, n, s), o.clip(), o.globalAlpha = 0.5 * r, o.strokeStyle = i, o.lineWidth = l, o.beginPath();
648
648
  for (let h = t - s; h < t + n + s; h += a)
649
649
  o.moveTo(h, e + s), o.lineTo(h + s, e);
650
650
  o.stroke(), o.restore();
651
651
  }
652
- function Vs(o, t, e, n, s, i) {
653
- const r = t.mainFrom < 0, a = t.mainTo > i, l = Math.max(1, Math.min(t.mainTo, i) - Math.max(t.mainFrom, 0)), h = Math.min(zs, l);
654
- r && ve(o, 0, h, e, n, s, 1), a && ve(o, i, -h, e, n, s, 1);
652
+ function sn(o, t, e, n, s, i) {
653
+ const r = t.mainFrom < 0, a = t.mainTo > i, l = Math.max(1, Math.min(t.mainTo, i) - Math.max(t.mainFrom, 0)), h = Math.min(en, l);
654
+ r && Se(o, 0, h, e, n, s, 1), a && Se(o, i, -h, e, n, s, 1);
655
655
  }
656
- function ve(o, t, e, n, s, i, r) {
656
+ function Se(o, t, e, n, s, i, r) {
657
657
  const a = o.createLinearGradient(t, 0, t + e, 0);
658
- a.addColorStop(0, we(i, r)), a.addColorStop(1, we(i, 0)), o.globalAlpha = 1, o.fillStyle = a, o.fillRect(Math.min(t, t + e), n, Math.abs(e), s);
658
+ a.addColorStop(0, Le(i, r)), a.addColorStop(1, Le(i, 0)), o.globalAlpha = 1, o.fillStyle = a, o.fillRect(Math.min(t, t + e), n, Math.abs(e), s);
659
659
  }
660
- function we(o, t) {
661
- const e = at(o);
660
+ function Le(o, t) {
661
+ const e = lt(o);
662
662
  return e === null ? o : `rgba(${e[0]}, ${e[1]}, ${e[2]}, ${t})`;
663
663
  }
664
- function Ft(o, t, e, n, s) {
665
- const { data: i, colours: r } = t, a = i.taskOfDependency(e.dependency), l = s ?? i.violatedById.has(e.dependency.id), h = a !== null && a === t.selectedTask, d = l ? r.alarm : dt(r, t, a, null);
664
+ function Pt(o, t, e, n, s) {
665
+ const { data: i, colours: r } = t, a = i.taskOfDependency(e.dependency), l = s ?? i.violatedById.has(e.dependency.id), h = a !== null && a === t.selectedTask, d = l ? r.alarm : ht(r, t, a, null);
666
666
  if (o.strokeStyle = d, o.fillStyle = d, o.lineWidth = n || h ? 2 : 1.25, o.setLineDash(l ? [4, 3] : []), o.beginPath(), o.moveTo(e.x1, e.y1), e.kind === "curve")
667
667
  o.bezierCurveTo(e.c1x, e.y1, e.c2x, e.y2, e.x2, e.y2);
668
668
  else
@@ -674,52 +674,52 @@ function Ft(o, t, e, n, s) {
674
674
  ])
675
675
  o.beginPath(), o.arc(u, p, l ? 3 : 2.5, 0, Math.PI * 2), o.fill();
676
676
  }
677
- function qs(o, t, e) {
677
+ function nn(o, t, e) {
678
678
  const { data: n } = t;
679
679
  if (n.violatedById.size !== 0)
680
680
  for (const s of n.violatedById.values()) {
681
681
  const i = n.dependencies.find((u) => u.id === s.dependency), r = i === void 0 ? void 0 : n.subtaskById.get(i.to);
682
682
  if (r === void 0) continue;
683
- const a = lt(e, r.lane);
683
+ const a = dt(e, r.lane);
684
684
  if (a === null || !a.miniature) continue;
685
- const l = Z(e.rows, a.top + e.scrollY);
685
+ const l = et(e.rows, a.top + e.scrollY);
686
686
  if (l === null) continue;
687
- const h = E(e, s.arrival), d = Math.max(h + 2, E(e, s.arrival + s.shortBy));
688
- Ot(o, t, h, d, l.top - e.scrollY + 1, 3);
687
+ const h = N(e, s.arrival), d = Math.max(h + 2, N(e, s.arrival + s.shortBy));
688
+ Bt(o, t, h, d, l.top - e.scrollY + 1, 3);
689
689
  }
690
690
  }
691
- function Ot(o, t, e, n, s, i) {
691
+ function Bt(o, t, e, n, s, i) {
692
692
  if (!t.colours.forced) {
693
693
  o.fillStyle = t.colours.alarm, o.fillRect(e, s, n - e, i);
694
694
  return;
695
695
  }
696
696
  o.strokeStyle = t.colours.alarm, o.lineWidth = i, o.setLineDash([4, 3]), o.beginPath(), o.moveTo(e, s + i / 2), o.lineTo(n, s + i / 2), o.stroke(), o.setLineDash([]);
697
697
  }
698
- function js(o, t, e, n) {
699
- const s = lt(e, n.lane);
698
+ function on(o, t, e, n) {
699
+ const s = dt(e, n.lane);
700
700
  if (s === null || s.top + s.height < 0 || s.top > t.view.height) return;
701
- const i = Math.max(0, E(e, n.from)), r = Math.min(t.view.width, E(e, n.to));
702
- r <= i || (o.globalAlpha = 0.1, o.fillStyle = t.colours.muted, o.fillRect(i, s.top, r - i, s.height), o.globalAlpha = 1, Xe(o, i, s.top, r - i, s.height, t.colours.muted, 0.7, Ue, 1));
701
+ const i = Math.max(0, N(e, n.from)), r = Math.min(t.view.width, N(e, n.to));
702
+ r <= i || (o.globalAlpha = 0.1, o.fillStyle = t.colours.muted, o.fillRect(i, s.top, r - i, s.height), o.globalAlpha = 1, Ze(o, i, s.top, r - i, s.height, t.colours.muted, 0.7, je, 1));
703
703
  }
704
- function Et(o, t, e, n) {
705
- const s = lt(e, n.lane);
704
+ function Nt(o, t, e, n) {
705
+ const s = dt(e, n.lane);
706
706
  if (s === null) return;
707
- const i = E(e, n.from), r = Math.max(i + 2, E(e, n.to));
708
- if (o.fillStyle = t.colours.alarm, o.globalAlpha = 0.14, o.fillRect(i, s.top + 1, r - i, Math.max(1, s.height - 2)), o.globalAlpha = 1, Ot(o, t, i, r, s.top + 1, Math.min(3, Math.max(1, s.height - 1))), s.miniature) {
709
- const a = Z(e.rows, s.top + e.scrollY);
710
- a !== null && Ot(o, t, i, r, a.top - e.scrollY + 1, 3);
707
+ const i = N(e, n.from), r = Math.max(i + 2, N(e, n.to));
708
+ if (o.fillStyle = t.colours.alarm, o.globalAlpha = 0.14, o.fillRect(i, s.top + 1, r - i, Math.max(1, s.height - 2)), o.globalAlpha = 1, Bt(o, t, i, r, s.top + 1, Math.min(3, Math.max(1, s.height - 1))), s.miniature) {
709
+ const a = et(e.rows, s.top + e.scrollY);
710
+ a !== null && Bt(o, t, i, r, a.top - e.scrollY + 1, 3);
711
711
  }
712
712
  }
713
- function Zs(o, t, e) {
714
- const { colours: n } = t, s = mt(e.subtask.appearance), i = Kt(s, dt(n, t, e.subtask.task, e.subtask.id), n);
713
+ function rn(o, t, e) {
714
+ const { colours: n } = t, s = kt(e.subtask.appearance), i = Vt(s, ht(n, t, e.subtask.task, e.subtask.id), n);
715
715
  if (n.forced) {
716
716
  o.strokeStyle = n.active, o.lineWidth = 2, o.strokeRect(e.outerFrom - 2, e.y - 2, Math.max(1, e.outerTo - e.outerFrom) + 4, e.height + 4);
717
717
  return;
718
718
  }
719
- o.globalAlpha = Js, o.fillStyle = i.onDark ? n.onAccent : n.text, o.fillRect(e.outerFrom, e.y, Math.max(1, e.outerTo - e.outerFrom), e.height), o.globalAlpha = 1;
719
+ o.globalAlpha = an, o.fillStyle = i.onDark ? n.onAccent : n.text, o.fillRect(e.outerFrom, e.y, Math.max(1, e.outerTo - e.outerFrom), e.height), o.globalAlpha = 1;
720
720
  }
721
- const Js = 0.2;
722
- function Qs(o, t) {
721
+ const an = 0.2;
722
+ function ln(o, t) {
723
723
  const e = t.selectedTask;
724
724
  if (e !== null) {
725
725
  o.strokeStyle = t.colours.text;
@@ -732,36 +732,36 @@ function Qs(o, t) {
732
732
  }
733
733
  }
734
734
  }
735
- const ct = 32, tn = 18;
736
- function be(o, t) {
737
- if (!(t > 2 * ct)) return 0;
738
- const e = ct - o, n = o - (t - ct), s = Math.max(e, n);
735
+ const pt = 32, dn = 18;
736
+ function Ae(o, t) {
737
+ if (!(t > 2 * pt)) return 0;
738
+ const e = pt - o, n = o - (t - pt), s = Math.max(e, n);
739
739
  if (s <= 0) return 0;
740
- const i = Math.min(1, s / ct), r = tn * i * i;
740
+ const i = Math.min(1, s / pt), r = dn * i * i;
741
741
  return e > 0 ? -r : r;
742
742
  }
743
- function it(o, t, e) {
743
+ function at(o, t, e) {
744
744
  const n = (s, i) => {
745
- const r = J(s);
745
+ const r = st(s);
746
746
  return s.lane === i.lane && r.from < i.to && i.from < r.to;
747
747
  };
748
748
  return e.some((s) => n(o, s) && !(t !== null && n(t, s)));
749
749
  }
750
- function en(o, t, e, n) {
750
+ function hn(o, t, e, n) {
751
751
  const s = /* @__PURE__ */ new Set();
752
752
  if (n === void 0) return s;
753
753
  for (const i of o)
754
754
  i !== e && (n(t, i) || s.add(i));
755
755
  return s;
756
756
  }
757
- function sn(o, t) {
757
+ function cn(o, t) {
758
758
  const { step: e, offset: n } = typeof t == "number" ? { step: t, offset: 0 } : t;
759
759
  if (!(e > 0) || !Number.isFinite(o)) return o;
760
- const s = Fe(o) + n;
760
+ const s = $t(o) + n;
761
761
  return s + Math.round((o - s) / e) * e;
762
762
  }
763
- const Me = "\0placing", Te = /* @__PURE__ */ new Set();
764
- function Lt(o) {
763
+ const De = "\0placing", _e = /* @__PURE__ */ new Set();
764
+ function At(o) {
765
765
  switch (o.kind) {
766
766
  case "subtask":
767
767
  return `subtask:${o.subtask.id}:${o.part}`;
@@ -773,8 +773,8 @@ function Lt(o) {
773
773
  return "nothing";
774
774
  }
775
775
  }
776
- const Ie = 3, nn = 10, on = 600;
777
- class rn {
776
+ const Fe = 3, un = 10, fn = 600;
777
+ class pn {
778
778
  constructor(t) {
779
779
  f(this, "gesture", { kind: "none" });
780
780
  f(this, "touches", /* @__PURE__ */ new Map());
@@ -835,9 +835,9 @@ class rn {
835
835
  ghostSummary() {
836
836
  const t = this.gesture;
837
837
  if (t.kind !== "edit" && t.kind !== "place") return null;
838
- const e = Ye(this.host.view.viewport(), t.ghost);
838
+ const e = Ve(this.host.view.viewport(), t.ghost);
839
839
  if (e === null) return null;
840
- const n = this.ghostFindings(t.ghost, this.ghostHome(t)), s = t.kind === "edit" && (t.mode === "leadIn" || t.mode === "leadOut"), i = s ? J(t.ghost) : t.ghost;
840
+ const n = this.ghostFindings(t.ghost, this.ghostHome(t)), s = t.kind === "edit" && (t.mode === "leadIn" || t.mode === "leadOut"), i = s ? st(t.ghost) : t.ghost;
841
841
  return {
842
842
  refused: this.refused,
843
843
  refusedLanes: [...t.refused],
@@ -889,7 +889,7 @@ class rn {
889
889
  group: n,
890
890
  timer: setTimeout(() => {
891
891
  this.resting = null, e.openForGesture = /* @__PURE__ */ new Set([...e.openForGesture, n]), this.host.viewChanged();
892
- }, on)
892
+ }, fn)
893
893
  }));
894
894
  }
895
895
  stopResting() {
@@ -918,9 +918,9 @@ class rn {
918
918
  gesture that cannot change a lane at all asks nothing: the intents the
919
919
  caller handles decide whether the question exists. */
920
920
  askRefused(t, e) {
921
- if (!this.host.view.options.intents.includes(e === null ? "place" : "lane")) return Te;
921
+ if (!this.host.view.options.intents.includes(e === null ? "place" : "lane")) return _e;
922
922
  const n = this.host.data.lanes.map((s) => s.id);
923
- return en(n, t, e, this.host.handlers().canMoveTo);
923
+ return hn(n, t, e, this.host.handlers().canMoveTo);
924
924
  }
925
925
  /** What a press at a point would start, given the intents the caller handles. */
926
926
  modeAt(t, e) {
@@ -928,10 +928,10 @@ class rn {
928
928
  for (let i = n.boxes.length - 1; i >= 0; i--) {
929
929
  const r = n.boxes[i];
930
930
  if (s.includes("stretch")) {
931
- const a = Ls(r, t, e);
931
+ const a = Ps(r, t, e);
932
932
  if (a !== null) return { mode: a === "from" ? "stretch-from" : "stretch-to", subtask: r.subtask };
933
933
  }
934
- if (Ne(r, t, e) !== null)
934
+ if (Ke(r, t, e) !== null)
935
935
  return s.includes("move") || s.includes("lane") ? { mode: "move", subtask: r.subtask } : { mode: "pan", subtask: r.subtask };
936
936
  }
937
937
  return { mode: "pan", subtask: null };
@@ -945,7 +945,7 @@ class rn {
945
945
  }
946
946
  const s = this.gesture;
947
947
  if (s.kind === "pending" && s.pointerId === t.pointerId) {
948
- if (Math.hypot(e - s.x0, n - s.y0) < (t.pointerType === "touch" ? nn : Ie)) return;
948
+ if (Math.hypot(e - s.x0, n - s.y0) < (t.pointerType === "touch" ? un : Fe)) return;
949
949
  if (s.mode === "pan" || s.subtask === null)
950
950
  this.gesture = { kind: "pan", pointerId: s.pointerId, lastX: s.x0, lastY: s.y0 }, this.setCursor("grabbing");
951
951
  else {
@@ -959,7 +959,7 @@ class rn {
959
959
  ghost: s.subtask,
960
960
  /* Asked here, once, and drawn from the first frame of the drag: the
961
961
  lanes that are closed are marked before the pointer reaches one. */
962
- refused: s.mode === "move" ? this.askRefused(s.subtask, s.subtask.lane) : Te
962
+ refused: s.mode === "move" ? this.askRefused(s.subtask, s.subtask.lane) : _e
963
963
  }, this.setCursor(s.mode === "move" ? "grabbing" : "ew-resize");
964
964
  }
965
965
  }
@@ -1005,7 +1005,7 @@ class rn {
1005
1005
  this.panFrame = 0;
1006
1006
  const e = this.gesture;
1007
1007
  if (e.kind !== "edit" && e.kind !== "place") return;
1008
- const n = this.host.view, { x: s, y: i } = this.local(this.lastClient.x, this.lastClient.y), r = be(s, n.width), a = be(i, n.height);
1008
+ const n = this.host.view, { x: s, y: i } = this.local(this.lastClient.x, this.lastClient.y), r = Ae(s, n.width), a = Ae(i, n.height);
1009
1009
  if (r === 0 && a === 0) return;
1010
1010
  const l = n.pan(r, a);
1011
1011
  if (l.moved) {
@@ -1033,7 +1033,7 @@ class rn {
1033
1033
  refreshHover() {
1034
1034
  if (!this.idle || this.hoverKey === "nothing" || this.byKeyboard) return;
1035
1035
  const { x: t, y: e } = this.hoverPoint, n = this.host.view.hitAt(t, e);
1036
- this.hover = n, this.hoverKey = Lt(n);
1036
+ this.hover = n, this.hoverKey = At(n);
1037
1037
  }
1038
1038
  pointerLeave() {
1039
1039
  this.gesture.kind !== "none" || this.byKeyboard || this.setHover({ kind: "nothing" }, "nothing");
@@ -1078,7 +1078,7 @@ class rn {
1078
1078
  this.host.select(r, i.kind === "subtask" ? i.subtask.id : null), this.report("click", i, t, e, n, s);
1079
1079
  }
1080
1080
  hoverAt(t, e, n, s) {
1081
- const i = this.host.view.hitAt(n, s), r = Lt(i), { mode: a } = this.modeAt(n, s);
1081
+ const i = this.host.view.hitAt(n, s), r = At(i), { mode: a } = this.modeAt(n, s);
1082
1082
  if (this.setCursor(a === "move" ? "grab" : a === "stretch-from" || a === "stretch-to" ? "ew-resize" : "default"), this.hoverPoint = { x: n, y: s }, r === this.hoverKey) {
1083
1083
  (i.kind === "subtask" || i.kind === "dependency") && this.host.interactionChanged();
1084
1084
  return;
@@ -1089,7 +1089,7 @@ class rn {
1089
1089
  pointer's would be - and reported to nobody, since `onInteraction`
1090
1090
  speaks of pointer positions. `nothing` hands the hover back. */
1091
1091
  setKeyboardHover(t, e) {
1092
- this.byKeyboard = t.kind !== "nothing", this.hoverPoint = e, this.hover = t, this.hoverKey = Lt(t), this.host.interactionChanged();
1092
+ this.byKeyboard = t.kind !== "nothing", this.hoverPoint = e, this.hover = t, this.hoverKey = At(t), this.host.interactionChanged();
1093
1093
  }
1094
1094
  setHover(t, e) {
1095
1095
  e !== this.hoverKey && (this.hoverKey = e, this.hover = t, this.host.interactionChanged());
@@ -1139,8 +1139,8 @@ class rn {
1139
1139
  const i = this.onLane(n);
1140
1140
  if (i === null) return { ghost: null, refused: !1, blocked: !1 };
1141
1141
  if (s.has(i)) return { ghost: null, refused: !0, blocked: !1 };
1142
- const r = { ...this.askedFor(t, i, e), id: Me };
1143
- return it(r, null, this.host.data.blocked) ? { ghost: null, refused: !1, blocked: !0 } : { ghost: r, refused: !1, blocked: !1 };
1142
+ const r = { ...this.askedFor(t, i, e), id: De };
1143
+ return at(r, null, this.host.data.blocked) ? { ghost: null, refused: !1, blocked: !0 } : { ghost: r, refused: !1, blocked: !1 };
1144
1144
  }
1145
1145
  /** The dragged item as a subtask, under the caller's key for it - not the
1146
1146
  internal sentinel: the rule is asked about the thing the application says
@@ -1198,7 +1198,7 @@ class rn {
1198
1198
  blocked time takes the ghost along again. */
1199
1199
  heldGhost(t, e, n) {
1200
1200
  const s = this.ghostFor(t, e, n);
1201
- return this.blocked = it(s, t.subtask, this.host.data.blocked), this.blocked ? t.ghost : s;
1201
+ return this.blocked = at(s, t.subtask, this.host.data.blocked), this.blocked ? t.ghost : s;
1202
1202
  }
1203
1203
  ghostFor(t, e, n) {
1204
1204
  const s = this.host.view, i = t.subtask, r = this.snapStep(), a = s.options.intents, l = this.snapInside(s.timeAt(e), r);
@@ -1206,7 +1206,7 @@ class rn {
1206
1206
  case "move": {
1207
1207
  let h = i.from;
1208
1208
  const d = s.viewport().scale, u = d.fromPx(e) - t.t0;
1209
- a.includes("move") && Math.abs(u * d.m) >= Ie && (h = this.shifted(i.from, u, r));
1209
+ a.includes("move") && Math.abs(u * d.m) >= Fe && (h = this.shifted(i.from, u, r));
1210
1210
  let p = t.ghost.lane;
1211
1211
  if (a.includes("lane")) {
1212
1212
  const m = this.onLane(n) ?? p;
@@ -1216,9 +1216,9 @@ class rn {
1216
1216
  return { ...i, from: h, to: h + (i.to - i.from), lane: p };
1217
1217
  }
1218
1218
  case "stretch-from":
1219
- return { ...i, from: Math.min(l, i.to - Math.max(r.step, W)) };
1219
+ return { ...i, from: Math.min(l, i.to - Math.max(r.step, V)) };
1220
1220
  case "stretch-to":
1221
- return { ...i, to: Math.max(l, i.from + Math.max(r.step, W)) };
1221
+ return { ...i, to: Math.max(l, i.from + Math.max(r.step, V)) };
1222
1222
  case "leadIn":
1223
1223
  return { ...i, leadIn: Math.max(0, i.from - l) };
1224
1224
  case "leadOut":
@@ -1229,15 +1229,15 @@ class rn {
1229
1229
  a start this way, and a key by one step of the raster - one arithmetic,
1230
1230
  so a key proposes exactly what a drag of that length would. */
1231
1231
  shifted(t, e, n) {
1232
- const s = j(this.host.view.options.calendar), i = K(t, s) + e, r = s.intervals.length === 0 ? i : z(Math.max(0, Math.min(s.total, i)), s);
1232
+ const s = tt(this.host.view.options.calendar), i = U(t, s) + e, r = s.intervals.length === 0 ? i : q(Math.max(0, Math.min(s.total, i)), s);
1233
1233
  return this.snapInside(r, n);
1234
1234
  }
1235
1235
  /** Snapped - and, where the raster lands in time the calendar removes, moved
1236
1236
  on to the seam, where time counts again. An intent never asks for a time
1237
1237
  nobody works. */
1238
1238
  snapInside(t, e) {
1239
- const n = sn(t, e), s = j(this.host.view.options.calendar);
1240
- return s.intervals.length === 0 ? n : z(K(n, s), s);
1239
+ const n = cn(t, e), s = tt(this.host.view.options.calendar);
1240
+ return s.intervals.length === 0 ? n : q(U(n, s), s);
1241
1241
  }
1242
1242
  intentsOf(t, e, n) {
1243
1243
  const s = [], i = this.host.view.options.intents, r = t.id;
@@ -1257,22 +1257,22 @@ class rn {
1257
1257
  keeps a plan of hundreds of tasks fluid while a drag runs, since this is
1258
1258
  computed on every pointer movement. */
1259
1259
  ghostFindings(t, e) {
1260
- const n = this.host.data, s = (d) => d.lane === t.lane || d.lane === e, r = [...n.subtasks.filter((d) => d.id !== t.id && s(d)), t], a = (d) => d.first === t.id || d.second === t.id, l = n.dependencies.filter((d) => d.from === t.id || d.to === t.id), h = t.id === Me ? n.subtasks : n.subtasks.map((d) => d.id === t.id ? t : d);
1261
- return { overlaps: Ht(r).filter(a), violated: Yt(h, l) };
1260
+ const n = this.host.data, s = (d) => d.lane === t.lane || d.lane === e, r = [...n.subtasks.filter((d) => d.id !== t.id && s(d)), t], a = (d) => d.first === t.id || d.second === t.id, l = n.dependencies.filter((d) => d.from === t.id || d.to === t.id), h = t.id === De ? n.subtasks : n.subtasks.map((d) => d.id === t.id ? t : d);
1261
+ return { overlaps: Wt(r).filter(a), violated: Xt(h, l) };
1262
1262
  }
1263
1263
  }
1264
- function an(o, t) {
1264
+ function mn(o, t) {
1265
1265
  const e = /* @__PURE__ */ new Map();
1266
1266
  for (const n of t) {
1267
- const s = o.slots.get(n.lane), i = s === void 0 ? null : Z(o, s.top);
1267
+ const s = o.slots.get(n.lane), i = s === void 0 ? null : et(o, s.top);
1268
1268
  if (i === null) continue;
1269
1269
  const r = o.rows.indexOf(i);
1270
1270
  e.set(r, [...e.get(r) ?? [], n]);
1271
1271
  }
1272
1272
  return [...e.entries()].sort(([n], [s]) => n - s).map(([, n]) => n.sort((s, i) => s.from - i.from || s.to - i.to));
1273
1273
  }
1274
- const Ce = (o, t) => t < o.from ? o.from - t : t > o.to ? t - o.to : 0;
1275
- function ln(o, t, e, n) {
1274
+ const Oe = (o, t) => t < o.from ? o.from - t : t > o.to ? t - o.to : 0;
1275
+ function gn(o, t, e, n) {
1276
1276
  var h;
1277
1277
  let s = -1, i = -1;
1278
1278
  for (let d = 0; d < o.length && t !== null && s < 0; d++)
@@ -1304,11 +1304,11 @@ function ln(o, t, e, n) {
1304
1304
  const d = o[e === "up" ? s - 1 : s + 1];
1305
1305
  if (d === void 0) return a;
1306
1306
  const u = (a.from + a.to) / 2;
1307
- return d.reduce((p, m) => Ce(m, u) < Ce(p, u) ? m : p);
1307
+ return d.reduce((p, m) => Oe(m, u) < Oe(p, u) ? m : p);
1308
1308
  }
1309
1309
  }
1310
1310
  }
1311
- function dn(o, t, e, n) {
1311
+ function kn(o, t, e, n) {
1312
1312
  if (e.kind === "dependency") {
1313
1313
  const i = o.find((a) => a.id === e.id), r = i === void 0 ? void 0 : n === "out" ? i.to : i.from;
1314
1314
  return r !== void 0 && t.has(r) ? { kind: "subtask", id: r } : e;
@@ -1318,7 +1318,7 @@ function dn(o, t, e, n) {
1318
1318
  );
1319
1319
  return s === void 0 ? e : { kind: "dependency", id: s.id };
1320
1320
  }
1321
- const hn = 150, un = {
1321
+ const yn = 150, vn = {
1322
1322
  ArrowRight: "next",
1323
1323
  ArrowLeft: "previous",
1324
1324
  ArrowUp: "up",
@@ -1328,7 +1328,7 @@ const hn = 150, un = {
1328
1328
  PageDown: "pageNext",
1329
1329
  PageUp: "pagePrevious"
1330
1330
  };
1331
- class cn {
1331
+ class wn {
1332
1332
  constructor(t) {
1333
1333
  f(this, "spoken", null);
1334
1334
  f(this, "timer", null);
@@ -1358,20 +1358,20 @@ class cn {
1358
1358
  const i = this.active();
1359
1359
  if (i === null) return !1;
1360
1360
  const r = this.host.data, a = n ? !t.shiftKey : t.key === "]";
1361
- return this.show(dn(r.dependencies, r.subtaskById, i, a ? "out" : "back")), !0;
1361
+ return this.show(kn(r.dependencies, r.subtaskById, i, a ? "out" : "back")), !0;
1362
1362
  }
1363
1363
  if (t.ctrlKey) return !1;
1364
1364
  if (t.altKey) return this.edit(t);
1365
1365
  if (t.key === "Escape")
1366
1366
  return e.byKeyboard ? (this.blur(), !0) : !1;
1367
1367
  if (t.key === "Enter" || t.key === " ") return this.select();
1368
- const s = t.shiftKey ? void 0 : un[t.key];
1368
+ const s = t.shiftKey ? void 0 : vn[t.key];
1369
1369
  return s === void 0 ? !1 : (this.walk(s), !0);
1370
1370
  }
1371
1371
  walk(t) {
1372
1372
  var l;
1373
1373
  const { data: e, view: n } = this.host, s = this.active(), i = s === null ? null : s.kind === "subtask" ? s.id : ((l = e.dependencies.find((h) => h.id === s.id)) == null ? void 0 : l.from) ?? null;
1374
- let r = an(n.rows, e.subtasks);
1374
+ let r = mn(n.rows, e.subtasks);
1375
1375
  if (i === null) {
1376
1376
  const h = r.filter((d) => {
1377
1377
  const u = n.boxById.get(d[0].id);
@@ -1379,7 +1379,7 @@ class cn {
1379
1379
  });
1380
1380
  h.length > 0 && (r = h);
1381
1381
  }
1382
- const a = ln(r, i, t, this.host.visibleDomain());
1382
+ const a = gn(r, i, t, this.host.visibleDomain());
1383
1383
  a !== null && this.show({ kind: "subtask", id: a.id });
1384
1384
  }
1385
1385
  /** Space and Enter select as a click does: the whole task, and the subtask. */
@@ -1404,13 +1404,13 @@ class cn {
1404
1404
  const m = (C) => ({ ...s, from: C, to: C + (s.to - s.from) });
1405
1405
  let y = s.from;
1406
1406
  for (let C = 0; C < 1e3; C++) {
1407
- const L = i.shifted(y, n * l.step, l);
1408
- if (L === y || (y = L, !it(m(y), s, h))) break;
1407
+ const A = i.shifted(y, n * l.step, l);
1408
+ if (A === y || (y = A, !at(m(y), s, h))) break;
1409
1409
  }
1410
- y !== s.from && !it(m(y), s, h) && (d = { kind: "move", subtask: s.id, from: y, to: m(y).to });
1410
+ y !== s.from && !at(m(y), s, h) && (d = { kind: "move", subtask: s.id, from: y, to: m(y).to });
1411
1411
  } else if (t.shiftKey && r.includes("stretch")) {
1412
- const m = Math.max(i.shifted(s.to, n * l.step, l), s.from + Math.max(l.step, W));
1413
- m !== s.to && !it({ ...s, to: m }, s, h) && (d = { kind: "stretch", subtask: s.id, from: s.from, to: m });
1412
+ const m = Math.max(i.shifted(s.to, n * l.step, l), s.from + Math.max(l.step, V));
1413
+ m !== s.to && !at({ ...s, to: m }, s, h) && (d = { kind: "stretch", subtask: s.id, from: s.from, to: m });
1414
1414
  }
1415
1415
  return i.byKeyboard = !0, d !== null && ((p = (u = this.host.handlers()).onIntent) == null || p.call(u, d)), this.scheduleReadout(), !0;
1416
1416
  }
@@ -1479,25 +1479,25 @@ class cn {
1479
1479
  if (!this.host.gestures.byKeyboard) return;
1480
1480
  const e = this.host.data.tooltipTargetFor(t);
1481
1481
  e !== null && (this.spoken = { target: e, lane: t.kind === "subtask" ? t.subtask.lane : null, count: (((n = this.spoken) == null ? void 0 : n.count) ?? 0) + 1 }, this.host.spokenChanged());
1482
- }, hn);
1482
+ }, yn);
1483
1483
  }
1484
1484
  /** Unmount: no readout after it. */
1485
1485
  stop() {
1486
1486
  this.timer !== null && clearTimeout(this.timer), this.timer = null;
1487
1487
  }
1488
1488
  }
1489
- const We = [], fn = 56;
1490
- function pn(o, t = fn) {
1491
- return o > 0 ? Math.min(rt, Math.max(15 * W, fs(o * t, 1))) : 15 * W;
1489
+ const Je = [], bn = 56;
1490
+ function Mn(o, t = bn) {
1491
+ return o > 0 ? Math.min(j, Math.max(15 * V, bs(o * t, 1))) : 15 * V;
1492
1492
  }
1493
- function mn(o, t, e = We) {
1494
- const [n, s] = ze(o, e);
1495
- return ps(e, n, s, t, Fe(n)).filter(
1493
+ function Tn(o, t, e = Je) {
1494
+ const [n, s] = Qe(o, e);
1495
+ return Ms(e, n, s, t, $t(n)).filter(
1496
1496
  (i) => i.workingTime >= o[0] && i.workingTime <= o[1]
1497
1497
  );
1498
1498
  }
1499
- function gn(o, t = We) {
1500
- const [e, n] = ze(o, t), s = [], i = new Date(e);
1499
+ function In(o, t = Je) {
1500
+ const [e, n] = Qe(o, t), s = [], i = new Date(e);
1501
1501
  for (i.setHours(0, 0, 0, 0); i.getTime() < n && s.length < 400; ) {
1502
1502
  const r = i.getTime();
1503
1503
  i.setDate(i.getDate() + 1);
@@ -1505,34 +1505,41 @@ function gn(o, t = We) {
1505
1505
  s.push({
1506
1506
  start: r,
1507
1507
  end: a,
1508
- from: K(r, t),
1509
- to: K(a, t)
1508
+ from: U(r, t),
1509
+ to: U(a, t)
1510
1510
  });
1511
1511
  }
1512
1512
  return s;
1513
1513
  }
1514
- function kn(o, t, e, n) {
1514
+ const Dt = [1, 2, 7, 14, 28];
1515
+ function Cn(o, t) {
1516
+ return Dt.find((e) => e * o >= t) ?? Dt[Dt.length - 1];
1517
+ }
1518
+ function _t(o, t) {
1519
+ return ((Math.round((o - $t(o)) / j) - 4) % t + t) % t === 0;
1520
+ }
1521
+ function Sn(o, t, e, n) {
1515
1522
  const s = o[1] - o[0];
1516
1523
  if (!(s > 0)) return [o[0], o[1]];
1517
1524
  const i = Math.min(n.max, Math.max(n.min, s * e)), r = (t - o[0]) / s, a = t - r * i;
1518
1525
  return [a, a + i];
1519
1526
  }
1520
- function yn(o, t) {
1527
+ function Ln(o, t) {
1521
1528
  return [o[0] + t, o[1] + t];
1522
1529
  }
1523
- function ze(o, t) {
1524
- const e = j(t);
1530
+ function Qe(o, t) {
1531
+ const e = tt(t);
1525
1532
  if (e.intervals.length === 0) return [o[0], o[1]];
1526
1533
  const n = (s) => Math.max(0, Math.min(e.total, s));
1527
- return [z(n(o[0]), e), z(n(o[1]), e)];
1534
+ return [q(n(o[0]), e), q(n(o[1]), e)];
1528
1535
  }
1529
- const ft = 44;
1530
- class vn {
1536
+ const mt = 44;
1537
+ class An {
1531
1538
  constructor(t) {
1532
1539
  f(this, "options", {
1533
- laneHeight: ft,
1540
+ laneHeight: mt,
1534
1541
  calendar: [],
1535
- zoomLimits: { min: Rt, max: 28 * rt },
1542
+ zoomLimits: { min: xt, max: 28 * j },
1536
1543
  snap: "ticks",
1537
1544
  intents: [],
1538
1545
  now: null,
@@ -1540,14 +1547,14 @@ class vn {
1540
1547
  attach: "centre",
1541
1548
  ends: "dot"
1542
1549
  });
1543
- f(this, "domain", [0, rt]);
1550
+ f(this, "domain", [0, j]);
1544
1551
  f(this, "scrollY", 0);
1545
1552
  f(this, "width", 0);
1546
1553
  f(this, "height", 0);
1547
1554
  /* What is laid out from top to bottom (`rows.ts`). It is derived here and
1548
1555
  not in the data, because a row's height comes from a view option; every y
1549
1556
  in the package reads it. */
1550
- f(this, "rows", de({ lanes: [], groups: [], collapsed: /* @__PURE__ */ new Set(), laneHeight: ft }));
1557
+ f(this, "rows", ge({ lanes: [], groups: [], collapsed: /* @__PURE__ */ new Set(), laneHeight: mt }));
1551
1558
  /** The folded groups, as the scene holds them. */
1552
1559
  f(this, "collapsed", /* @__PURE__ */ new Set());
1553
1560
  /** The groups a gesture in flight holds open. Dropped when it ends; the
@@ -1563,18 +1570,18 @@ class vn {
1563
1570
  setOptions(t, e) {
1564
1571
  const n = t.calendar !== this.options.calendar, s = this.options.calendar;
1565
1572
  if (this.options = t, e !== null)
1566
- this.domain = [K(e[0], t.calendar), K(e[1], t.calendar)];
1573
+ this.domain = [U(e[0], t.calendar), U(e[1], t.calendar)];
1567
1574
  else if (n) {
1568
- const i = j(s), r = (a) => {
1575
+ const i = tt(s), r = (a) => {
1569
1576
  const l = i.intervals.length === 0 ? a : Math.max(0, Math.min(i.total, a));
1570
- return K(z(l, i), t.calendar) + (a - l);
1577
+ return U(q(l, i), t.calendar) + (a - l);
1571
1578
  };
1572
1579
  this.domain = [r(this.domain[0]), r(this.domain[1])];
1573
1580
  }
1574
1581
  }
1575
1582
  viewport() {
1576
1583
  return {
1577
- scale: new ms(this.domain, [0, this.width]),
1584
+ scale: new Ts(this.domain, [0, this.width]),
1578
1585
  calendar: this.options.calendar,
1579
1586
  laneHeight: this.options.laneHeight,
1580
1587
  scrollY: this.scrollY,
@@ -1591,28 +1598,28 @@ class vn {
1591
1598
  /** The fine band's step at the current zoom. */
1592
1599
  step() {
1593
1600
  const t = this.domain[1] - this.domain[0];
1594
- return pn(this.width > 0 ? t / this.width : t);
1601
+ return Mn(this.width > 0 ? t / this.width : t);
1595
1602
  }
1596
1603
  /** Lays the rows out, clamps the scroll, and lays the data out anew. */
1597
1604
  layout() {
1598
- this.rows = de({
1605
+ this.rows = ge({
1599
1606
  lanes: this.data.lanes,
1600
1607
  groups: this.data.groups,
1601
- collapsed: Is(this.collapsed, this.openForGesture),
1608
+ collapsed: Os(this.collapsed, this.openForGesture),
1602
1609
  laneHeight: this.options.laneHeight
1603
1610
  }), this.scrollY = Math.max(0, Math.min(this.maxScroll(), this.scrollY));
1604
1611
  const t = this.viewport();
1605
1612
  this.boxes = [], this.boxById = /* @__PURE__ */ new Map();
1606
1613
  for (const e of this.data.subtasks) {
1607
- const n = $t(this.rows, e.lane);
1614
+ const n = Kt(this.rows, e.lane);
1608
1615
  if (n === null) continue;
1609
- const s = Pe(t, e, e.lane, n, this.data.depth.get(e.id) ?? 0);
1616
+ const s = Ye(t, e, e.lane, n, this.data.depth.get(e.id) ?? 0);
1610
1617
  this.boxes.push(s), this.boxById.set(e.id, s);
1611
1618
  }
1612
1619
  this.paths = [];
1613
1620
  for (const e of this.data.dependencies) {
1614
1621
  const n = this.boxById.get(e.from), s = this.boxById.get(e.to);
1615
- n === void 0 || s === void 0 || this.paths.push(Dt(t, e, n, s, this.options));
1622
+ n === void 0 || s === void 0 || this.paths.push(Rt(t, e, n, s, this.options));
1616
1623
  }
1617
1624
  }
1618
1625
  /** The days of the coarse band and the ticks of the fine band, in pixels. */
@@ -1621,11 +1628,11 @@ class vn {
1621
1628
  if (this.width <= 0) return { days: [], ticks: [], step: t };
1622
1629
  const e = this.viewport().scale, n = this.options.calendar;
1623
1630
  return {
1624
- days: gn(this.domain, n).map((s) => {
1631
+ days: In(this.domain, n).map((s) => {
1625
1632
  const i = Math.round(e.toPx(s.from));
1626
1633
  return { start: s.start, x: i, width: Math.round(e.toPx(s.to)) - i };
1627
1634
  }),
1628
- ticks: mn(this.domain, t, n).map((s) => ({ wallClock: s.wallClock, x: Math.round(e.toPx(s.workingTime)) })),
1635
+ ticks: Tn(this.domain, t, n).map((s) => ({ wallClock: s.wallClock, x: Math.round(e.toPx(s.workingTime)) })),
1629
1636
  step: t
1630
1637
  };
1631
1638
  }
@@ -1633,27 +1640,27 @@ class vn {
1633
1640
  nowX() {
1634
1641
  const t = this.options.now;
1635
1642
  if (t === null || this.width <= 0) return null;
1636
- const e = Math.round(this.viewport().scale.toPx(K(t, this.options.calendar)));
1643
+ const e = Math.round(this.viewport().scale.toPx(U(t, this.options.calendar)));
1637
1644
  return e >= 0 && e <= this.width ? e : null;
1638
1645
  }
1639
1646
  hitAt(t, e) {
1640
1647
  for (let r = this.boxes.length - 1; r >= 0; r--) {
1641
- const a = this.boxes[r], l = Ne(a, t, e);
1648
+ const a = this.boxes[r], l = Ke(a, t, e);
1642
1649
  if (l !== null) return { kind: "subtask", subtask: a.subtask, part: l };
1643
1650
  }
1644
1651
  let n = null, s = 4;
1645
1652
  for (const r of this.paths) {
1646
- const a = Fs(r, t, e);
1653
+ const a = xs(r, t, e);
1647
1654
  a <= s && (s = a, n = r);
1648
1655
  }
1649
1656
  if (n !== null) return { kind: "dependency", dependency: n.dependency };
1650
- const i = fe(this.viewport(), e);
1657
+ const i = we(this.viewport(), e);
1651
1658
  return i !== null ? { kind: "lane", lane: i } : { kind: "nothing" };
1652
1659
  }
1653
1660
  /** The wall-clock time at a plot x; within the calendar's extent. */
1654
1661
  timeAt(t) {
1655
- const e = this.viewport().scale.fromPx(t), n = j(this.options.calendar);
1656
- return n.intervals.length === 0 ? e : z(Math.max(0, Math.min(n.total, e)), n);
1662
+ const e = this.viewport().scale.fromPx(t), n = tt(this.options.calendar);
1663
+ return n.intervals.length === 0 ? e : q(Math.max(0, Math.min(n.total, e)), n);
1657
1664
  }
1658
1665
  /** The lane at a y, strips included: what the pointer is ON.
1659
1666
 
@@ -1662,7 +1669,7 @@ class vn {
1662
1669
  `foldedGroupAt` - and a caller that reached through `viewport()` for it
1663
1670
  would be depending on the layout rather than asking the view. */
1664
1671
  laneIdAt(t) {
1665
- return fe(this.viewport(), t);
1672
+ return we(this.viewport(), t);
1666
1673
  }
1667
1674
  /** The lane a DROP at this y would land on.
1668
1675
 
@@ -1672,19 +1679,19 @@ class vn {
1672
1679
  aim at. Hover, the tooltip and selection do read a strip - they cost
1673
1680
  nothing if they are a pixel out. */
1674
1681
  dropLaneIdAt(t) {
1675
- const e = Z(this.rows, t + this.scrollY);
1682
+ const e = et(this.rows, t + this.scrollY);
1676
1683
  return e === null || e.kind !== "lane" ? null : e.lane ?? null;
1677
1684
  }
1678
1685
  /** The folded group a y lies over, or null. */
1679
1686
  foldedGroupAt(t) {
1680
- const e = Z(this.rows, t + this.scrollY);
1687
+ const e = et(this.rows, t + this.scrollY);
1681
1688
  return e !== null && e.kind === "miniature" ? e.group ?? null : null;
1682
1689
  }
1683
1690
  /** Pans by pixels. Says what moved: the span through time, the lanes, or
1684
1691
  neither - a scroll through the lanes is no news about the time. */
1685
1692
  pan(t, e) {
1686
1693
  const n = this.domain[0], s = this.scrollY, i = this.domain[1] - n;
1687
- this.width > 0 && t !== 0 && (this.domain = yn(this.domain, t / this.width * i)), this.scrollY = Math.max(0, Math.min(this.maxScroll(), this.scrollY + e));
1694
+ this.width > 0 && t !== 0 && (this.domain = Ln(this.domain, t / this.width * i)), this.scrollY = Math.max(0, Math.min(this.maxScroll(), this.scrollY + e));
1688
1695
  const r = this.domain[0] !== n;
1689
1696
  return { moved: r || this.scrollY !== s, time: r };
1690
1697
  }
@@ -1692,18 +1699,18 @@ class vn {
1692
1699
  zoomAt(t, e) {
1693
1700
  if (this.width <= 0 || !Number.isFinite(e)) return !1;
1694
1701
  const n = this.domain, s = this.viewport().scale.fromPx(t);
1695
- return this.domain = kn(this.domain, s, e, this.options.zoomLimits), n[0] !== this.domain[0] || n[1] !== this.domain[1];
1702
+ return this.domain = Sn(this.domain, s, e, this.options.zoomLimits), n[0] !== this.domain[0] || n[1] !== this.domain[1];
1696
1703
  }
1697
1704
  }
1698
- const Se = {
1705
+ const Ee = {
1699
1706
  width: 0,
1700
1707
  height: 0,
1701
- laneHeight: ft,
1708
+ laneHeight: mt,
1702
1709
  scrollY: 0,
1703
1710
  headers: [],
1704
1711
  days: [],
1705
1712
  ticks: [],
1706
- step: Rt,
1713
+ step: xt,
1707
1714
  ghost: null,
1708
1715
  grips: [],
1709
1716
  cursor: "default",
@@ -1713,10 +1720,10 @@ const Se = {
1713
1720
  spoken: null,
1714
1721
  summary: { lanes: 0, subtasks: 0, from: 0, to: 0, overlaps: 0, violated: 0, blocked: 0 }
1715
1722
  };
1716
- class wn {
1723
+ class Dn {
1717
1724
  constructor() {
1718
- f(this, "data", new Es(() => this.viewChanged()));
1719
- f(this, "view", new vn(this.data));
1725
+ f(this, "data", new Hs(() => this.viewChanged()));
1726
+ f(this, "view", new An(this.data));
1720
1727
  f(this, "gestures");
1721
1728
  f(this, "keys");
1722
1729
  f(this, "handlersNow", {});
@@ -1737,7 +1744,7 @@ class wn {
1737
1744
  f(this, "frame", 0);
1738
1745
  f(this, "domainFrame", 0);
1739
1746
  f(this, "unsubscribeTheme", null);
1740
- f(this, "snapshot", Se);
1747
+ f(this, "snapshot", Ee);
1741
1748
  f(this, "listeners", /* @__PURE__ */ new Set());
1742
1749
  /* ---------------------------------------------------------------- */
1743
1750
  /* Registration and options */
@@ -1755,7 +1762,7 @@ class wn {
1755
1762
  this.listeners.delete(t);
1756
1763
  }));
1757
1764
  f(this, "getSnapshot", () => this.snapshot);
1758
- f(this, "getServerSnapshot", () => Se);
1765
+ f(this, "getServerSnapshot", () => Ee);
1759
1766
  /* ---------------------------------------------------------------- */
1760
1767
  /* Gestures, as the component hands them in */
1761
1768
  /* ---------------------------------------------------------------- */
@@ -1773,7 +1780,7 @@ class wn {
1773
1780
  f(this, "key", (t) => this.keys.key(t));
1774
1781
  f(this, "focus", (t) => this.keys.focus(t));
1775
1782
  f(this, "blur", () => this.keys.blur());
1776
- this.gestures = new rn({
1783
+ this.gestures = new pn({
1777
1784
  data: this.data,
1778
1785
  view: this.view,
1779
1786
  plotElement: () => this.plot,
@@ -1785,7 +1792,7 @@ class wn {
1785
1792
  this.viewChanged(), t && this.reportDomain();
1786
1793
  },
1787
1794
  interactionChanged: () => this.interactionChanged()
1788
- }), this.keys = new cn({
1795
+ }), this.keys = new wn({
1789
1796
  data: this.data,
1790
1797
  view: this.view,
1791
1798
  gestures: this.gestures,
@@ -1849,7 +1856,7 @@ class wn {
1849
1856
  /* DOM binding */
1850
1857
  /* ---------------------------------------------------------------- */
1851
1858
  bind(t, e, n, s) {
1852
- this.root = t, this.plot = e, this.dataCanvas = n, this.overlayCanvas = s, this.unsubscribeTheme = gs(() => {
1859
+ this.root = t, this.plot = e, this.dataCanvas = n, this.overlayCanvas = s, this.unsubscribeTheme = Is(() => {
1853
1860
  this.colours = null, this.requestDraw();
1854
1861
  }), this.viewChanged();
1855
1862
  }
@@ -1917,12 +1924,12 @@ class wn {
1917
1924
  if (t.width <= 0) return [];
1918
1925
  const e = this.colours;
1919
1926
  return t.boxes.flatMap((n) => {
1920
- if (!_t(n, t.width, t.height)) return [];
1921
- const s = _s(n, t.width);
1927
+ if (!Et(n, t.width, t.height)) return [];
1928
+ const s = Ns(n, t.width);
1922
1929
  if (s === null) return [];
1923
- const i = e === null ? !0 : Kt(
1924
- mt(n.subtask.appearance),
1925
- dt(e, { selectedTask: this.selectedTask, selectedSubtask: this.selectedSubtask }, n.subtask.task, n.subtask.id),
1930
+ const i = e === null ? !0 : Vt(
1931
+ kt(n.subtask.appearance),
1932
+ ht(e, { selectedTask: this.selectedTask, selectedSubtask: this.selectedSubtask }, n.subtask.task, n.subtask.id),
1926
1933
  e
1927
1934
  ).onDark;
1928
1935
  return [{ subtask: n.subtask, ...s, dark: i }];
@@ -1934,7 +1941,7 @@ class wn {
1934
1941
  const t = this.view, [e, n] = this.visibleDomain();
1935
1942
  return {
1936
1943
  lanes: this.data.lanes.length,
1937
- subtasks: t.boxes.filter((s) => _t(s, t.width, t.height)).length,
1944
+ subtasks: t.boxes.filter((s) => Et(s, t.width, t.height)).length,
1938
1945
  from: e,
1939
1946
  to: n,
1940
1947
  overlaps: this.data.overlaps.length,
@@ -1952,7 +1959,7 @@ class wn {
1952
1959
  }
1953
1960
  /** The visible span, as two wall-clock instants. */
1954
1961
  visibleDomain() {
1955
- const t = j(this.view.options.calendar), e = (n) => t.intervals.length === 0 ? n : z(Math.max(0, Math.min(t.total, n)), t);
1962
+ const t = tt(this.view.options.calendar), e = (n) => t.intervals.length === 0 ? n : q(Math.max(0, Math.min(t.total, n)), t);
1956
1963
  return [e(this.view.domain[0]), e(this.view.domain[1])];
1957
1964
  }
1958
1965
  /** Reported once per frame, however many wheel steps a planner turns - and
@@ -1984,8 +1991,8 @@ class wn {
1984
1991
  var a;
1985
1992
  const n = (a = this.plot) == null ? void 0 : a.getBoundingClientRect();
1986
1993
  if (n === void 0) return null;
1987
- const s = this.view.viewport(), i = e === void 0 ? null : lt(s, e), r = i === null ? 0 : i.top + i.height / 2;
1988
- return { x: n.left + E(s, t), y: n.top + r };
1994
+ const s = this.view.viewport(), i = e === void 0 ? null : dt(s, e), r = i === null ? 0 : i.top + i.height / 2;
1995
+ return { x: n.left + N(s, t), y: n.top + r };
1989
1996
  }
1990
1997
  requestDraw() {
1991
1998
  this.frame !== 0 || this.dataCanvas === null || typeof requestAnimationFrame != "function" || (this.frame = requestAnimationFrame(() => {
@@ -1994,8 +2001,8 @@ class wn {
1994
2001
  }
1995
2002
  draw() {
1996
2003
  if (this.root === null) return;
1997
- this.colours === null && (this.colours = Ns(this.root, this.data), this.publish());
1998
- const { width: t, height: e } = this.view, n = ke(this.dataCanvas, t, e), s = ke(this.overlayCanvas, t, e);
2004
+ this.colours === null && (this.colours = Us(this.root, this.data), this.publish());
2005
+ const { width: t, height: e } = this.view, n = Ie(this.dataCanvas, t, e), s = Ie(this.overlayCanvas, t, e);
1999
2006
  if (n === null || s === null || t === 0) return;
2000
2007
  const i = {
2001
2008
  data: this.data,
@@ -2007,46 +2014,46 @@ class wn {
2007
2014
  hover: this.gestures.hover,
2008
2015
  ghost: this.gestures.ghostDrawing()
2009
2016
  };
2010
- $s(n, i), Gs(s, i);
2011
- }
2012
- }
2013
- const bn = "_root_19uyg_4 _text_ocaqi_23", Mn = "_corner_19uyg_19", Tn = "_dayBand_19uyg_23", In = "_tickBand_19uyg_24", Cn = "_day_19uyg_23", Sn = "_dayLabel_19uyg_47", Ln = "_tick_19uyg_24", An = "_tickLabel_19uyg_65", _n = "_headers_19uyg_73", Dn = "_header_19uyg_73", Fn = "_headerLabel_19uyg_91", On = "_headerCount_19uyg_104", En = "_chevron_19uyg_113", Rn = "_plot_19uyg_171", Bn = "_focusRing_19uyg_178", Pn = "_layer_19uyg_196", Nn = "_grip_19uyg_205", $n = "_ghostLabel_19uyg_215", Gn = "_finding_19uyg_228", xn = "_refusal_19uyg_236", Hn = "_tooltip_19uyg_240", Yn = "_tooltipHead_19uyg_259", Kn = "_tooltipTimes_19uyg_264", Un = "_now_19uyg_273", Xn = "_barLabel_19uyg_287", Wn = "_barLabelText_19uyg_300", w = {
2014
- root: bn,
2015
- corner: Mn,
2016
- dayBand: Tn,
2017
- tickBand: In,
2018
- day: Cn,
2019
- dayLabel: Sn,
2020
- tick: Ln,
2021
- tickLabel: An,
2022
- headers: _n,
2023
- header: Dn,
2024
- headerLabel: Fn,
2025
- headerCount: On,
2026
- chevron: En,
2027
- plot: Rn,
2028
- focusRing: Bn,
2029
- layer: Pn,
2030
- grip: Nn,
2031
- ghostLabel: $n,
2032
- finding: Gn,
2033
- refusal: xn,
2034
- tooltip: Hn,
2035
- tooltipHead: Yn,
2036
- tooltipTimes: Kn,
2037
- now: Un,
2038
- barLabel: Xn,
2039
- barLabelText: Wn
2017
+ Ws(n, i), Xs(s, i);
2018
+ }
2019
+ }
2020
+ const _n = "_root_1892z_4 _text_ocaqi_23", Fn = "_corner_1892z_19", On = "_dayBand_1892z_23", En = "_tickBand_1892z_24", Rn = "_day_1892z_23", Pn = "_dayLabel_1892z_50", Bn = "_tick_1892z_24", Nn = "_tickLabel_1892z_71", $n = "_headers_1892z_79", xn = "_header_1892z_79", Gn = "_headerLabel_1892z_97", Hn = "_headerCount_1892z_134", Yn = "_chevron_1892z_143", Kn = "_plot_1892z_201", zn = "_focusRing_1892z_208", Un = "_layer_1892z_226", Wn = "_grip_1892z_235", Xn = "_ghostLabel_1892z_245", Vn = "_finding_1892z_258", qn = "_refusal_1892z_266", jn = "_tooltip_1892z_270", Zn = "_tooltipHead_1892z_289", Jn = "_tooltipTimes_1892z_294", Qn = "_now_1892z_303", to = "_barLabel_1892z_317", eo = "_barLabelText_1892z_330", w = {
2021
+ root: _n,
2022
+ corner: Fn,
2023
+ dayBand: On,
2024
+ tickBand: En,
2025
+ day: Rn,
2026
+ dayLabel: Pn,
2027
+ tick: Bn,
2028
+ tickLabel: Nn,
2029
+ headers: $n,
2030
+ header: xn,
2031
+ headerLabel: Gn,
2032
+ headerCount: Hn,
2033
+ chevron: Yn,
2034
+ plot: Kn,
2035
+ focusRing: zn,
2036
+ layer: Un,
2037
+ grip: Wn,
2038
+ ghostLabel: Xn,
2039
+ finding: Vn,
2040
+ refusal: qn,
2041
+ tooltip: jn,
2042
+ tooltipHead: Zn,
2043
+ tooltipTimes: Jn,
2044
+ now: Qn,
2045
+ barLabel: to,
2046
+ barLabelText: eo
2040
2047
  };
2041
- function Ve() {
2042
- const o = pt();
2048
+ function ts() {
2049
+ const o = gt();
2043
2050
  return (t) => {
2044
- const e = Math.round(t / W), n = Math.floor(e / 60), s = e % 60;
2051
+ const e = Math.round(t / V), n = Math.floor(e / 60), s = e % 60;
2045
2052
  return [n > 0 ? o.hoursShort(n) : "", s > 0 || n === 0 ? o.minutesShort(s) : ""].filter(Boolean).join(" ");
2046
2053
  };
2047
2054
  }
2048
- function zn({ target: o, lane: t }) {
2049
- const e = Bt(), n = pt(), s = Ve(), i = (u) => e.time(new Date(u), !1);
2055
+ function so({ target: o, lane: t }) {
2056
+ const e = Gt(), n = gt(), s = ts(), i = (u) => e.time(new Date(u), !1);
2050
2057
  if (o.kind === "subtask") {
2051
2058
  const { subtask: u, task: p } = o, m = [
2052
2059
  (p == null ? void 0 : p.name) ?? u.task,
@@ -2056,7 +2063,7 @@ function zn({ target: o, lane: t }) {
2056
2063
  ...o.violatedDependencies.map((y) => n.scheduleViolatedBy(s(y.shortBy))),
2057
2064
  ...o.blocked.map((y) => n.scheduleInBlockedTime(y.label))
2058
2065
  ];
2059
- return /* @__PURE__ */ Y(At, { children: [
2066
+ return /* @__PURE__ */ z(Ot, { children: [
2060
2067
  t,
2061
2068
  `, ${m.join(", ")}`
2062
2069
  ] });
@@ -2069,11 +2076,11 @@ function zn({ target: o, lane: t }) {
2069
2076
  ...d === void 0 ? [] : [n.scheduleViolatedBy(s(d.shortBy))]
2070
2077
  ].join(", ");
2071
2078
  }
2072
- function Vn({ target: o }) {
2073
- const t = Bt(), e = pt(), n = (d) => t.time(new Date(d), !1), s = Ve();
2079
+ function no({ target: o }) {
2080
+ const t = Gt(), e = gt(), n = (d) => t.time(new Date(d), !1), s = ts();
2074
2081
  if (o.kind === "subtask") {
2075
2082
  const { subtask: d, task: u } = o;
2076
- return /* @__PURE__ */ Y(At, { children: [
2083
+ return /* @__PURE__ */ z(Ot, { children: [
2077
2084
  /* @__PURE__ */ k("span", { className: w.tooltipHead, children: (u == null ? void 0 : u.name) ?? d.task }),
2078
2085
  /* @__PURE__ */ k("span", { children: d.name ?? d.id }),
2079
2086
  /* @__PURE__ */ k("span", { className: w.tooltipTimes, children: e.scheduleGhostTimes(n(d.from), n(d.to)) }),
@@ -2085,160 +2092,182 @@ function Vn({ target: o }) {
2085
2092
  ] });
2086
2093
  }
2087
2094
  const { dependency: i, task: r, from: a, to: l, violated: h } = o;
2088
- return /* @__PURE__ */ Y(At, { children: [
2095
+ return /* @__PURE__ */ z(Ot, { children: [
2089
2096
  /* @__PURE__ */ k("span", { className: w.tooltipHead, children: (r == null ? void 0 : r.name) ?? (r == null ? void 0 : r.id) ?? i.id }),
2090
2097
  /* @__PURE__ */ k("span", { children: e.scheduleRoute((a == null ? void 0 : a.name) ?? i.from, (l == null ? void 0 : l.name) ?? i.to) }),
2091
2098
  /* @__PURE__ */ k("span", { children: `${e.scheduleDependency} ${s(i.lag)}` }),
2092
2099
  h !== void 0 && /* @__PURE__ */ k("span", { className: w.finding, children: e.scheduleViolatedBy(s(h.shortBy)) })
2093
2100
  ] });
2094
2101
  }
2095
- const qn = [], Le = { min: Rt, max: 28 * rt }, jn = [], Ae = 20, io = as(function(t, e) {
2096
- var re;
2102
+ const oo = [], Re = { min: xt, max: 28 * j }, io = [], Pe = 20, Ft = 44, mo = ms(function(t, e) {
2103
+ var fe;
2097
2104
  const {
2098
2105
  ariaLabel: n,
2099
2106
  initialDomain: s,
2100
2107
  height: i = 400,
2101
- laneHeight: r = ft,
2108
+ laneHeight: r = mt,
2102
2109
  headerWidth: a = 160,
2103
- calendar: l = jn,
2110
+ calendar: l = io,
2104
2111
  zoomLimits: h,
2105
2112
  snap: d = "ticks",
2106
- intents: u = qn,
2113
+ intents: u = oo,
2107
2114
  onIntent: p,
2108
2115
  canMoveTo: m,
2109
2116
  onInteraction: y,
2110
2117
  selectedTask: C,
2111
- onSelectedTaskChange: L,
2112
- collapsedGroups: A,
2118
+ onSelectedTaskChange: A,
2119
+ collapsedGroups: D,
2113
2120
  defaultCollapsedGroups: g,
2114
2121
  onCollapsedGroupsChange: I,
2115
2122
  onDomainChange: S,
2116
- placing: F,
2117
- route: D = "curve",
2118
- attach: N = "centre",
2119
- ends: Q = "dot",
2120
- label: ht,
2121
- tooltip: V,
2122
- now: tt,
2123
- className: Ut,
2124
- style: qe,
2125
- children: je
2126
- } = t, [v] = ut(() => new wn()), gt = ls(), Xt = `${gt}-summary`, Wt = x(null), zt = x(null), Vt = x(null), qt = x(null), $ = Bt(), R = pt(), [kt, yt] = s, jt = (h == null ? void 0 : h.min) ?? Le.min, Zt = (h == null ? void 0 : h.max) ?? Le.max, Jt = x(null), Qt = typeof d == "object" ? d.step : null, te = typeof d == "object" ? d.offset : null, ee = typeof d == "object" ? null : d, [Ze, Je] = ut(() => Date.now());
2127
- H(() => {
2128
- if (tt !== !0) return;
2129
- const c = setInterval(() => Je(Date.now()), W);
2123
+ placing: R,
2124
+ route: O = "curve",
2125
+ attach: H = "centre",
2126
+ ends: nt = "dot",
2127
+ label: ct,
2128
+ tooltip: Z,
2129
+ now: ot,
2130
+ className: qt,
2131
+ style: es,
2132
+ children: ss
2133
+ } = t, [v] = ut(() => new Dn()), yt = gs(), jt = `${yt}-summary`, Zt = G(null), Jt = G(null), Qt = G(null), te = G(null), Y = Gt(), x = gt(), [vt, wt] = s, ee = (h == null ? void 0 : h.min) ?? Re.min, se = (h == null ? void 0 : h.max) ?? Re.max, ne = G(null), oe = typeof d == "object" ? d.step : null, ie = typeof d == "object" ? d.offset : null, re = typeof d == "object" ? null : d, [ns, os] = ut(() => Date.now());
2134
+ K(() => {
2135
+ if (ot !== !0) return;
2136
+ const c = setInterval(() => os(Date.now()), V);
2130
2137
  return () => clearInterval(c);
2131
- }, [tt]);
2132
- const se = tt === !0 ? Ze : typeof tt == "number" ? tt : null;
2133
- Ct(() => {
2134
- const c = `${kt}|${yt}`, M = Jt.current !== c;
2135
- Jt.current = c;
2136
- const _ = ee ?? { step: Qt ?? 0, offset: te ?? 0 };
2138
+ }, [ot]);
2139
+ const ae = ot === !0 ? ns : typeof ot == "number" ? ot : null;
2140
+ ft(() => {
2141
+ const c = `${vt}|${wt}`, b = ne.current !== c;
2142
+ ne.current = c;
2143
+ const L = re ?? { step: oe ?? 0, offset: ie ?? 0 };
2137
2144
  v.setOptions(
2138
- { laneHeight: r, calendar: l, zoomLimits: { min: jt, max: Zt }, snap: _, intents: u, now: se, route: D, attach: N, ends: Q },
2139
- M ? [kt, yt] : null
2145
+ { laneHeight: r, calendar: l, zoomLimits: { min: ee, max: se }, snap: L, intents: u, now: ae, route: O, attach: H, ends: nt },
2146
+ b ? [vt, wt] : null
2140
2147
  );
2141
- }, [v, kt, yt, r, l, jt, Zt, ee, Qt, te, u, se, D, N, Q]), H(() => {
2142
- v.setHandlers({ onIntent: p, canMoveTo: m, onInteraction: y, onSelectedTaskChange: L, onCollapsedGroupsChange: I, onDomainChange: S });
2143
- }, [v, p, m, y, L, I, S]);
2144
- const Qe = x(g);
2145
- H(() => {
2146
- const c = Qe.current;
2148
+ }, [v, vt, wt, r, l, ee, se, re, oe, ie, u, ae, O, H, nt]), K(() => {
2149
+ v.setHandlers({ onIntent: p, canMoveTo: m, onInteraction: y, onSelectedTaskChange: A, onCollapsedGroupsChange: I, onDomainChange: S });
2150
+ }, [v, p, m, y, A, I, S]);
2151
+ const is = G(g);
2152
+ K(() => {
2153
+ const c = is.current;
2147
2154
  c !== void 0 && v.setDefaultCollapsedGroups(c);
2148
- }, [v]), H(() => {
2149
- v.setCollapsedGroups(A);
2150
- }, [v, A]), ds(
2155
+ }, [v]), K(() => {
2156
+ v.setCollapsedGroups(D);
2157
+ }, [v, D]), ks(
2151
2158
  e,
2152
2159
  () => ({
2153
- positionAt: (c, M) => v.positionAt(c, M),
2154
- clientPointOf: (c, M) => v.clientPointOf(c, M),
2160
+ positionAt: (c, b) => v.positionAt(c, b),
2161
+ clientPointOf: (c, b) => v.clientPointOf(c, b),
2155
2162
  visibleDomain: () => v.visibleDomain()
2156
2163
  }),
2157
2164
  [v]
2158
- ), H(() => {
2165
+ ), K(() => {
2159
2166
  v.setControlledTask(C);
2160
- }, [v, C]), H(() => {
2161
- v.setPlacing(F ?? null);
2162
- }, [v, F]), H(() => {
2163
- const c = Wt.current, M = zt.current, _ = Vt.current, G = qt.current;
2164
- if (!c || !M || !_ || !G) return;
2165
- v.bind(c, M, _, G);
2166
- const O = M.getBoundingClientRect();
2167
- v.resize(O.width, O.height);
2168
- const B = new ResizeObserver((P) => {
2169
- var ae;
2170
- const nt = (ae = P[P.length - 1]) == null ? void 0 : ae.contentRect;
2171
- nt !== void 0 && v.resize(nt.width, nt.height);
2167
+ }, [v, C]), K(() => {
2168
+ v.setPlacing(R ?? null);
2169
+ }, [v, R]), K(() => {
2170
+ const c = Zt.current, b = Jt.current, L = Qt.current, E = te.current;
2171
+ if (!c || !b || !L || !E) return;
2172
+ v.bind(c, b, L, E);
2173
+ const _ = b.getBoundingClientRect();
2174
+ v.resize(_.width, _.height);
2175
+ const F = new ResizeObserver(($) => {
2176
+ var pe;
2177
+ const it = (pe = $[$.length - 1]) == null ? void 0 : pe.contentRect;
2178
+ it !== void 0 && v.resize(it.width, it.height);
2172
2179
  });
2173
- B.observe(M);
2174
- const et = (P) => v.wheel(P);
2175
- c.addEventListener("wheel", et, { passive: !1 });
2176
- const st = (P) => {
2177
- P.key === "Escape" && v.cancelEdit() && P.preventDefault();
2180
+ F.observe(b);
2181
+ const P = ($) => v.wheel($);
2182
+ c.addEventListener("wheel", P, { passive: !1 });
2183
+ const B = ($) => {
2184
+ $.key === "Escape" && v.cancelEdit() && $.preventDefault();
2178
2185
  };
2179
- return window.addEventListener("keydown", st), () => {
2180
- window.removeEventListener("keydown", st), c.removeEventListener("wheel", et), B.disconnect(), v.unbind();
2186
+ return window.addEventListener("keydown", B), () => {
2187
+ window.removeEventListener("keydown", B), c.removeEventListener("wheel", P), F.disconnect(), v.unbind();
2181
2188
  };
2182
2189
  }, [v]);
2183
- const T = hs(v.subscribe, v.getSnapshot, v.getServerSnapshot), ts = (c, M) => {
2184
- const _ = new Date(c);
2185
- return M >= 200 ? $.dateLong(_) : M >= 84 ? $.date(_) : M >= 44 ? $.dateShort(_) : "";
2186
- }, b = T.ghost, q = T.spoken, vt = T.summary, ne = (c) => `${$.dateShort(new Date(c))} ${$.time(new Date(c), !1)}`, wt = (c) => `${gt}-row-${encodeURIComponent(c.key)}`, es = X(() => {
2190
+ const M = ys(v.subscribe, v.getSnapshot, v.getServerSnapshot), rs = (c, b) => {
2191
+ const L = new Date(c);
2192
+ return b >= 200 ? Y.dateLong(L) : b >= 84 ? Y.date(L) : b >= Ft ? Y.dateShort(L) : "";
2193
+ }, as = M.days.reduce((c, b) => Math.max(c, b.width), 0), J = Cn(as, Ft), le = M.step >= j ? J : 1, T = M.ghost, Q = M.spoken, bt = M.summary, de = (c) => `${Y.dateShort(new Date(c))} ${Y.time(new Date(c), !1)}`, Mt = (c) => `${yt}-row-${encodeURIComponent(c.key)}`, ls = X(() => {
2187
2194
  const c = /* @__PURE__ */ new Map();
2188
- for (const M of T.headers)
2189
- for (const _ of M.within)
2190
- M.kind === "groupHead" && _ === M.group || c.set(_, [...c.get(_) ?? [], wt(M)]);
2195
+ for (const b of M.headers)
2196
+ for (const L of b.within)
2197
+ b.kind === "groupHead" && L === b.group || c.set(L, [...c.get(L) ?? [], Mt(b)]);
2191
2198
  return c;
2192
- }, [T.headers, gt]), ss = X(() => new Set((b == null ? void 0 : b.refusedLanes) ?? []), [b == null ? void 0 : b.refusedLanes]), oe = x(null), [bt, ns] = ut({ x: 0, y: 0, at: "" }), Mt = b === null ? "" : `${b.x}:${b.y}:${b.from}:${b.to}:${b.overlap}:${b.violated}:${b.refused}:${b.blocked}`;
2193
- Ct(() => {
2194
- const c = oe.current;
2195
- if (b === null || c === null) return;
2196
- const M = 4, _ = b.y - c.offsetHeight - M, G = b.y + b.height + M, O = {
2197
- x: Math.max(2, Math.min(b.x, T.width - c.offsetWidth - 2)),
2198
- y: _ >= 2 ? _ : Math.min(G, T.height - c.offsetHeight - 2),
2199
- at: Mt
2199
+ }, [M.headers, yt]), he = G(null), ds = `${M.width}|${M.headers.map((c) => `${c.key}:${c.kind}:${typeof c.label == "string" ? c.label : ""}`).join("|")}`;
2200
+ ft(() => {
2201
+ var L;
2202
+ let c = !0;
2203
+ const b = () => {
2204
+ var F;
2205
+ if (!c) return;
2206
+ const E = [...((F = he.current) == null ? void 0 : F.querySelectorAll("[data-lane-count]")) ?? []];
2207
+ for (const P of E) P.hidden = !1;
2208
+ const _ = E.some((P) => {
2209
+ const B = P.previousElementSibling;
2210
+ if (!(B instanceof HTMLElement)) return !1;
2211
+ const $ = parseFloat(getComputedStyle(B).lineHeight);
2212
+ return B.scrollWidth > B.clientWidth || B.clientHeight > $ * 1.5;
2213
+ });
2214
+ for (const P of E) P.hidden = _;
2215
+ };
2216
+ return b(), (L = document.fonts) == null || L.ready.then(b), () => {
2217
+ c = !1;
2200
2218
  };
2201
- ns((B) => B.x === O.x && B.y === O.y && B.at === O.at ? B : O);
2202
- }, [b, Mt, T.width, T.height]);
2203
- const ie = x(null), [Tt, os] = ut({ x: 0, y: 0, at: "" }), U = T.tooltip, It = U === null ? "" : `${U.x}:${U.y}:${U.target.kind}`;
2204
- return Ct(() => {
2205
- const c = ie.current;
2206
- if (U === null || c === null) return;
2207
- const M = 12, _ = (O, B, et) => {
2208
- const st = O + M, P = O - M - B, nt = st + B <= et - 4 || P < 4 ? st : P;
2209
- return Math.max(4, Math.min(nt, et - B - 4));
2210
- }, G = {
2211
- x: _(U.x, c.offsetWidth, T.width),
2212
- y: _(U.y, c.offsetHeight, T.height),
2219
+ }, [ds]);
2220
+ const hs = X(() => new Set((T == null ? void 0 : T.refusedLanes) ?? []), [T == null ? void 0 : T.refusedLanes]), ce = G(null), [Tt, cs] = ut({ x: 0, y: 0, at: "" }), It = T === null ? "" : `${T.x}:${T.y}:${T.from}:${T.to}:${T.overlap}:${T.violated}:${T.refused}:${T.blocked}`;
2221
+ ft(() => {
2222
+ const c = ce.current;
2223
+ if (T === null || c === null) return;
2224
+ const b = 4, L = T.y - c.offsetHeight - b, E = T.y + T.height + b, _ = {
2225
+ x: Math.max(2, Math.min(T.x, M.width - c.offsetWidth - 2)),
2226
+ y: L >= 2 ? L : Math.min(E, M.height - c.offsetHeight - 2),
2213
2227
  at: It
2214
2228
  };
2215
- os((O) => O.x === G.x && O.y === G.y && O.at === G.at ? O : G);
2216
- }, [U, It, T.width, T.height]), /* @__PURE__ */ Y(Oe.Provider, { value: v, children: [
2217
- /* @__PURE__ */ Y(
2229
+ cs((F) => F.x === _.x && F.y === _.y && F.at === _.at ? F : _);
2230
+ }, [T, It, M.width, M.height]);
2231
+ const ue = G(null), [Ct, us] = ut({ x: 0, y: 0, at: "" }), W = M.tooltip, St = W === null ? "" : `${W.x}:${W.y}:${W.target.kind}`;
2232
+ return ft(() => {
2233
+ const c = ue.current;
2234
+ if (W === null || c === null) return;
2235
+ const b = 12, L = (_, F, P) => {
2236
+ const B = _ + b, $ = _ - b - F, it = B + F <= P - 4 || $ < 4 ? B : $;
2237
+ return Math.max(4, Math.min(it, P - F - 4));
2238
+ }, E = {
2239
+ x: L(W.x, c.offsetWidth, M.width),
2240
+ y: L(W.y, c.offsetHeight, M.height),
2241
+ at: St
2242
+ };
2243
+ us((_) => _.x === E.x && _.y === E.y && _.at === E.at ? _ : E);
2244
+ }, [W, St, M.width, M.height]), /* @__PURE__ */ z($e.Provider, { value: v, children: [
2245
+ /* @__PURE__ */ z(
2218
2246
  "div",
2219
2247
  {
2220
- ref: Wt,
2248
+ ref: Zt,
2221
2249
  role: "figure",
2222
2250
  "aria-label": n,
2223
- className: Ut ? `${w.root} ${Ut}` : w.root,
2224
- style: { height: `${i}px`, gridTemplateColumns: `min(${a}px, 40%) minmax(0, 1fr)`, ...qe },
2251
+ className: qt ? `${w.root} ${qt}` : w.root,
2252
+ style: { height: `${i}px`, gridTemplateColumns: `min(${a}px, 40%) minmax(0, 1fr)`, ...es },
2225
2253
  children: [
2226
2254
  /* @__PURE__ */ k("div", { className: w.corner }),
2227
- /* @__PURE__ */ k("div", { className: w.dayBand, "aria-hidden": "true", "data-schedule-days": "", "data-schedule-clip": "day band", children: T.days.map((c) => {
2228
- const M = Math.max(0, -c.x), _ = Math.min(c.x + c.width, T.width) - Math.max(c.x, 0);
2229
- return /* @__PURE__ */ k("span", { className: w.day, style: { left: `${c.x}px`, width: `${c.width}px` }, children: /* @__PURE__ */ k("span", { className: w.dayLabel, "data-schedule-overlay": "day label", style: { marginLeft: `${M}px` }, children: ts(c.start, _) }) }, c.start);
2255
+ /* @__PURE__ */ k("div", { className: w.dayBand, "aria-hidden": "true", "data-schedule-days": "", "data-schedule-clip": "day band", children: M.days.map((c, b) => {
2256
+ var P;
2257
+ const L = J === 1 || b === 0 || _t(c.start, J), E = J === 1 ? c.x + c.width : ((P = M.days.slice(b + 1).find((B) => _t(B.start, J))) == null ? void 0 : P.x) ?? M.width, _ = Math.max(0, -c.x), F = Math.min(E, M.width) - Math.max(c.x, 0);
2258
+ return /* @__PURE__ */ k("span", { className: w.day, style: { left: `${c.x}px`, width: `${L ? E - c.x : c.width}px` }, children: /* @__PURE__ */ k("span", { className: w.dayLabel, "data-schedule-overlay": "day label", style: { marginLeft: `${_}px` }, children: L ? rs(c.start, J === 1 ? F : Math.min(F, Ft)) : "" }) }, c.start);
2230
2259
  }) }),
2231
- /* @__PURE__ */ k("div", { className: w.headers, "data-schedule-headers": "", children: /* @__PURE__ */ k("div", { className: w.headerRun, style: { transform: `translateY(${-T.scrollY}px)` }, children: T.headers.map((c) => /* @__PURE__ */ Y(
2260
+ /* @__PURE__ */ k("div", { ref: he, className: w.headers, "data-schedule-headers": "", children: /* @__PURE__ */ k("div", { className: w.headerRun, style: { transform: `translateY(${-M.scrollY}px)` }, children: M.headers.map((c) => /* @__PURE__ */ z(
2232
2261
  "div",
2233
2262
  {
2234
- id: wt(c),
2263
+ id: Mt(c),
2235
2264
  className: w.header,
2236
2265
  style: { height: `${c.height}px`, paddingLeft: `calc(var(--u-space-3) + ${c.depth} * var(--u-space-3))` },
2237
2266
  "data-lane": c.lane,
2238
2267
  "data-group": c.group,
2239
2268
  "data-row": c.kind,
2240
2269
  "data-schedule-clip": `header ${c.kind}`,
2241
- "data-refused": c.lane !== void 0 && ss.has(c.lane) ? "" : void 0,
2270
+ "data-refused": c.lane !== void 0 && hs.has(c.lane) ? "" : void 0,
2242
2271
  children: [
2243
2272
  c.kind !== "lane" && c.group !== void 0 && /* @__PURE__ */ k(
2244
2273
  "button",
@@ -2247,35 +2276,35 @@ const qn = [], Le = { min: Rt, max: 28 * rt }, jn = [], Ae = 20, io = as(functio
2247
2276
  className: w.chevron,
2248
2277
  "data-schedule-overlay": "fold control",
2249
2278
  "aria-expanded": c.collapsed === !1,
2250
- "aria-controls": (es.get(c.group) ?? [wt(c)]).join(" "),
2251
- "aria-label": `${c.collapsed === !0 ? R.scheduleUnfoldGroup : R.scheduleFoldGroup}: ${typeof c.label == "string" ? c.label : c.group}`,
2279
+ "aria-controls": (ls.get(c.group) ?? [Mt(c)]).join(" "),
2280
+ "aria-label": `${c.collapsed === !0 ? x.scheduleUnfoldGroup : x.scheduleFoldGroup}: ${typeof c.label == "string" ? c.label : c.group}`,
2252
2281
  onClick: () => v.toggleGroup(c.group),
2253
- children: /* @__PURE__ */ k(ks, { size: 9, "data-open": c.collapsed === !1 ? "" : void 0 })
2282
+ children: /* @__PURE__ */ k(Cs, { size: 9, "data-open": c.collapsed === !1 ? "" : void 0 })
2254
2283
  }
2255
2284
  ),
2256
2285
  /* @__PURE__ */ k("span", { className: w.headerLabel, "data-schedule-overlay": "header label", children: c.label }),
2257
- c.kind !== "lane" && /* @__PURE__ */ k("span", { className: w.headerCount, "data-schedule-overlay": "lane count", "data-lane-count": c.lanes, children: R.scheduleLaneCount(c.lanes) })
2286
+ c.kind !== "lane" && /* @__PURE__ */ k("span", { className: w.headerCount, "data-schedule-overlay": "lane count", "data-lane-count": c.lanes, children: x.scheduleLaneCount(c.lanes) })
2258
2287
  ]
2259
2288
  },
2260
2289
  c.key
2261
2290
  )) }) }),
2262
- /* @__PURE__ */ Y(
2291
+ /* @__PURE__ */ z(
2263
2292
  "div",
2264
2293
  {
2265
- ref: zt,
2294
+ ref: Jt,
2266
2295
  className: w.plot,
2267
2296
  "data-schedule-plot": "",
2268
2297
  "data-schedule-clip": "plot",
2269
- style: { cursor: T.cursor },
2298
+ style: { cursor: M.cursor },
2270
2299
  tabIndex: 0,
2271
2300
  role: "application",
2272
- "aria-roledescription": R.scheduleRoleDescription,
2301
+ "aria-roledescription": x.scheduleRoleDescription,
2273
2302
  "aria-label": n,
2274
- "aria-describedby": Xt,
2303
+ "aria-describedby": jt,
2275
2304
  onKeyDown: (c) => {
2276
2305
  v.key(c.nativeEvent) && c.preventDefault();
2277
2306
  },
2278
- onFocus: (c) => v.focus(Zn(c.currentTarget)),
2307
+ onFocus: (c) => v.focus(ro(c.currentTarget)),
2279
2308
  onBlur: () => v.blur(),
2280
2309
  onPointerDown: (c) => v.pointerDown(c.nativeEvent),
2281
2310
  onPointerMove: (c) => v.pointerMove(c.nativeEvent),
@@ -2286,13 +2315,13 @@ const qn = [], Le = { min: Rt, max: 28 * rt }, jn = [], Ae = 20, io = as(functio
2286
2315
  onDragOver: (c) => v.dragOver(c.nativeEvent),
2287
2316
  onDrop: (c) => v.drop(c.nativeEvent),
2288
2317
  onDragLeave: (c) => {
2289
- const M = c.nativeEvent.relatedTarget;
2290
- (!(M instanceof Node) || !c.currentTarget.contains(M)) && v.dragLeave();
2318
+ const b = c.nativeEvent.relatedTarget;
2319
+ (!(b instanceof Node) || !c.currentTarget.contains(b)) && v.dragLeave();
2291
2320
  },
2292
2321
  children: [
2293
- /* @__PURE__ */ k("canvas", { ref: Vt, className: w.layer, "aria-hidden": "true" }),
2294
- /* @__PURE__ */ k("canvas", { ref: qt, className: w.layer, "aria-hidden": "true" }),
2295
- T.grips.map((c) => /* @__PURE__ */ k(
2322
+ /* @__PURE__ */ k("canvas", { ref: Qt, className: w.layer, "aria-hidden": "true" }),
2323
+ /* @__PURE__ */ k("canvas", { ref: te, className: w.layer, "aria-hidden": "true" }),
2324
+ M.grips.map((c) => /* @__PURE__ */ k(
2296
2325
  "span",
2297
2326
  {
2298
2327
  "data-grip": c.kind,
@@ -2303,7 +2332,7 @@ const qn = [], Le = { min: Rt, max: 28 * rt }, jn = [], Ae = 20, io = as(functio
2303
2332
  },
2304
2333
  c.kind
2305
2334
  )),
2306
- ht !== void 0 && T.bars.map((c) => /* @__PURE__ */ k(
2335
+ ct !== void 0 && M.bars.map((c) => /* @__PURE__ */ k(
2307
2336
  "span",
2308
2337
  {
2309
2338
  className: w.barLabel,
@@ -2312,47 +2341,47 @@ const qn = [], Le = { min: Rt, max: 28 * rt }, jn = [], Ae = 20, io = as(functio
2312
2341
  "data-schedule-may-cover": "",
2313
2342
  "data-on": c.dark ? "dark" : "light",
2314
2343
  style: { left: `${c.x}px`, top: `${c.y}px`, width: `${c.width}px`, height: `${c.height}px` },
2315
- children: /* @__PURE__ */ k("span", { className: w.barLabelText, children: ht(c.subtask) })
2344
+ children: /* @__PURE__ */ k("span", { className: w.barLabelText, children: ct(c.subtask) })
2316
2345
  },
2317
2346
  c.subtask.id
2318
2347
  )),
2319
- V !== !1 && T.tooltip !== null && /* @__PURE__ */ k(
2348
+ Z !== !1 && M.tooltip !== null && /* @__PURE__ */ k(
2320
2349
  "span",
2321
2350
  {
2322
- ref: ie,
2351
+ ref: ue,
2323
2352
  role: "tooltip",
2324
2353
  className: w.tooltip,
2325
2354
  "data-schedule-tooltip": "",
2326
2355
  "data-schedule-overlay": "tooltip",
2327
2356
  style: {
2328
- left: `${Tt.x}px`,
2329
- top: `${Tt.y}px`,
2330
- visibility: Tt.at === It ? void 0 : "hidden"
2357
+ left: `${Ct.x}px`,
2358
+ top: `${Ct.y}px`,
2359
+ visibility: Ct.at === St ? void 0 : "hidden"
2331
2360
  },
2332
- children: typeof V == "function" ? V(T.tooltip.target) : /* @__PURE__ */ k(Vn, { target: T.tooltip.target })
2361
+ children: typeof Z == "function" ? Z(M.tooltip.target) : /* @__PURE__ */ k(no, { target: M.tooltip.target })
2333
2362
  }
2334
2363
  ),
2335
- b !== null && /* @__PURE__ */ Y(
2364
+ T !== null && /* @__PURE__ */ z(
2336
2365
  "span",
2337
2366
  {
2338
- ref: oe,
2367
+ ref: ce,
2339
2368
  className: w.ghostLabel,
2340
2369
  "data-ghost": "",
2341
2370
  "data-schedule-overlay": "ghost label",
2342
- "data-findings": [b.overlap ? "overlap" : "", b.violated ? "violated-dependency" : ""].filter(Boolean).join(" "),
2343
- "data-refused": b.refused ? "" : void 0,
2344
- "data-blocked": b.blocked ? "" : void 0,
2371
+ "data-findings": [T.overlap ? "overlap" : "", T.violated ? "violated-dependency" : ""].filter(Boolean).join(" "),
2372
+ "data-refused": T.refused ? "" : void 0,
2373
+ "data-blocked": T.blocked ? "" : void 0,
2345
2374
  style: {
2346
- left: `${bt.x}px`,
2347
- top: `${bt.y}px`,
2348
- visibility: bt.at === Mt ? void 0 : "hidden"
2375
+ left: `${Tt.x}px`,
2376
+ top: `${Tt.y}px`,
2377
+ visibility: Tt.at === It ? void 0 : "hidden"
2349
2378
  },
2350
2379
  children: [
2351
- R.scheduleGhostTimes($.time(new Date(b.from), !1), $.time(new Date(b.to), !1)),
2352
- b.refused && /* @__PURE__ */ k("span", { className: w.refusal, children: R.scheduleLaneRefused }),
2353
- b.blocked && /* @__PURE__ */ k("span", { className: w.refusal, children: R.scheduleBlockedTime }),
2354
- b.overlap && /* @__PURE__ */ k("span", { className: w.finding, children: R.scheduleOverlap }),
2355
- b.violated && /* @__PURE__ */ k("span", { className: w.finding, children: R.scheduleViolatedDependency })
2380
+ x.scheduleGhostTimes(Y.time(new Date(T.from), !1), Y.time(new Date(T.to), !1)),
2381
+ T.refused && /* @__PURE__ */ k("span", { className: w.refusal, children: x.scheduleLaneRefused }),
2382
+ T.blocked && /* @__PURE__ */ k("span", { className: w.refusal, children: x.scheduleBlockedTime }),
2383
+ T.overlap && /* @__PURE__ */ k("span", { className: w.finding, children: x.scheduleOverlap }),
2384
+ T.violated && /* @__PURE__ */ k("span", { className: w.finding, children: x.scheduleViolatedDependency })
2356
2385
  ]
2357
2386
  }
2358
2387
  ),
@@ -2361,55 +2390,55 @@ const qn = [], Le = { min: Rt, max: 28 * rt }, jn = [], Ae = 20, io = as(functio
2361
2390
  }
2362
2391
  ),
2363
2392
  /* @__PURE__ */ k("div", { className: w.corner }),
2364
- /* @__PURE__ */ Y("div", { className: w.tickBand, "aria-hidden": "true", "data-schedule-ticks": "", "data-schedule-clip": "time band", children: [
2365
- T.now !== null && /* @__PURE__ */ k("span", { className: w.now, "data-now": "", "data-schedule-overlay": "now mark", style: { left: `${T.now}px` } }),
2366
- T.ticks.map((c) => /* @__PURE__ */ k("span", { className: w.tick, style: { left: `${c.x}px` }, children: c.x >= Ae && c.x <= T.width - Ae && /* @__PURE__ */ k("span", { className: w.tickLabel, "data-schedule-overlay": "time label", children: T.step >= rt ? $.dateShort(new Date(c.wallClock)) : $.time(new Date(c.wallClock), !1) }) }, c.wallClock))
2393
+ /* @__PURE__ */ z("div", { className: w.tickBand, "aria-hidden": "true", "data-schedule-ticks": "", "data-schedule-clip": "time band", children: [
2394
+ M.now !== null && /* @__PURE__ */ k("span", { className: w.now, "data-now": "", "data-schedule-overlay": "now mark", style: { left: `${M.now}px` } }),
2395
+ M.ticks.map((c) => /* @__PURE__ */ k("span", { className: w.tick, style: { left: `${c.x}px` }, children: c.x >= Pe && c.x <= M.width - Pe && (le === 1 || _t(c.wallClock, le)) && /* @__PURE__ */ k("span", { className: w.tickLabel, "data-schedule-overlay": "time label", children: M.step >= j ? Y.dateShort(new Date(c.wallClock)) : Y.time(new Date(c.wallClock), !1) }) }, c.wallClock))
2367
2396
  ] }),
2368
- /* @__PURE__ */ k(le, { "aria-live": "polite", children: q !== null && /* @__PURE__ */ k(
2369
- zn,
2397
+ /* @__PURE__ */ k(me, { "aria-live": "polite", children: Q !== null && /* @__PURE__ */ k(
2398
+ so,
2370
2399
  {
2371
- target: q.target,
2372
- lane: q.lane === null ? null : ((re = v.data.lanes.find((c) => c.id === q.lane)) == null ? void 0 : re.label) ?? q.lane
2400
+ target: Q.target,
2401
+ lane: Q.lane === null ? null : ((fe = v.data.lanes.find((c) => c.id === Q.lane)) == null ? void 0 : fe.label) ?? Q.lane
2373
2402
  },
2374
- q.count
2403
+ Q.count
2375
2404
  ) }),
2376
- /* @__PURE__ */ k(le, { id: Xt, children: `${R.scheduleSummary({ ...vt, from: ne(vt.from), to: ne(vt.to) })} ${R.scheduleKeyHelp}` })
2405
+ /* @__PURE__ */ k(me, { id: jt, children: `${x.scheduleSummary({ ...bt, from: de(bt.from), to: de(bt.to) })} ${x.scheduleKeyHelp}` })
2377
2406
  ]
2378
2407
  }
2379
2408
  ),
2380
- je
2409
+ ss
2381
2410
  ] });
2382
2411
  });
2383
- function Zn(o) {
2412
+ function ro(o) {
2384
2413
  try {
2385
2414
  return o.matches(":focus-visible");
2386
2415
  } catch {
2387
2416
  return !0;
2388
2417
  }
2389
2418
  }
2390
- function ro({ id: o, label: t }) {
2391
- const e = Re(), n = X(() => ({ id: o, label: t ?? o, ...e === null ? {} : { parent: e } }), [o, t, e]);
2392
- return vs(n), null;
2419
+ function go({ id: o, label: t }) {
2420
+ const e = Ge(), n = X(() => ({ id: o, label: t ?? o, ...e === null ? {} : { parent: e } }), [o, t, e]);
2421
+ return Ls(n), null;
2393
2422
  }
2394
- function ao({ id: o, label: t, children: e }) {
2395
- const n = Re(), s = X(() => ({ id: o, label: t ?? o, ...n === null ? {} : { parent: n } }), [o, t, n]);
2396
- return ws(s), /* @__PURE__ */ k(Ee.Provider, { value: o, children: e });
2423
+ function ko({ id: o, label: t, children: e }) {
2424
+ const n = Ge(), s = X(() => ({ id: o, label: t ?? o, ...n === null ? {} : { parent: n } }), [o, t, n]);
2425
+ return As(s), /* @__PURE__ */ k(xe.Provider, { value: o, children: e });
2397
2426
  }
2398
- function lo({ data: o, tasks: t }) {
2427
+ function yo({ data: o, tasks: t }) {
2399
2428
  const e = X(() => ({ kind: "subtasks", data: o, tasks: t }), [o, t]);
2400
- return Nt("Subtasks", e), null;
2429
+ return Yt("Subtasks", e), null;
2401
2430
  }
2402
- function ho({ data: o }) {
2431
+ function vo({ data: o }) {
2403
2432
  const t = X(() => ({ kind: "dependencies", data: o }), [o]);
2404
- return Nt("Dependencies", t), null;
2433
+ return Yt("Dependencies", t), null;
2405
2434
  }
2406
- function uo({ data: o }) {
2435
+ function wo({ data: o }) {
2407
2436
  const t = X(() => ({ kind: "blocked", data: o }), [o]);
2408
- return Nt("BlockedTimes", t), null;
2437
+ return Yt("BlockedTimes", t), null;
2409
2438
  }
2410
- function co(o, t, e) {
2439
+ function bo(o, t, e) {
2411
2440
  if (e.kind === "place") return [];
2412
- const n = new Map(o.map((l) => [l.id, he(l, e)])), s = /* @__PURE__ */ new Map();
2441
+ const n = new Map(o.map((l) => [l.id, ke(l, e)])), s = /* @__PURE__ */ new Map();
2413
2442
  for (const l of t) {
2414
2443
  const h = s.get(l.from) ?? [];
2415
2444
  h.push(l), s.set(l.from, h);
@@ -2423,35 +2452,35 @@ function co(o, t, e) {
2423
2452
  if (d.to === e.subtask) continue;
2424
2453
  const u = n.get(d.to);
2425
2454
  if (u === void 0) continue;
2426
- const p = Gt(d, h) + d.lag - xt(d, u);
2455
+ const p = zt(d, h) + d.lag - Ut(d, u);
2427
2456
  if (!(p > 0)) continue;
2428
2457
  const m = { kind: "move", subtask: u.id, from: u.from + p, to: u.to + p };
2429
- n.set(u.id, he(u, m)), i.set(u.id, m), r.push(u.id);
2458
+ n.set(u.id, ke(u, m)), i.set(u.id, m), r.push(u.id);
2430
2459
  }
2431
2460
  }
2432
2461
  return [...i.values()];
2433
2462
  }
2434
- function fo(o, t, e) {
2463
+ function Mo(o, t, e) {
2435
2464
  return e === 0 || !Number.isFinite(e) ? [] : o.filter((n) => n.task === t).map((n) => ({ kind: "move", subtask: n.id, from: n.from + e, to: n.to + e }));
2436
2465
  }
2437
2466
  export {
2438
- uo as BlockedTimes,
2439
- ho as Dependencies,
2440
- ro as Lane,
2441
- ao as LaneGroup,
2442
- io as Schedule,
2443
- lo as Subtasks,
2444
- he as applyIntent,
2445
- xt as arrival,
2446
- Gt as departure,
2447
- oo as findings,
2448
- $e as inBlockedTime,
2449
- J as occupied,
2450
- Ht as overlaps,
2451
- mt as resolveAppearance,
2452
- co as ripple,
2453
- fo as shiftTask,
2454
- sn as snapTime,
2455
- no as subtaskFromPlace,
2456
- Yt as violatedDependencies
2467
+ wo as BlockedTimes,
2468
+ vo as Dependencies,
2469
+ go as Lane,
2470
+ ko as LaneGroup,
2471
+ mo as Schedule,
2472
+ yo as Subtasks,
2473
+ ke as applyIntent,
2474
+ Ut as arrival,
2475
+ zt as departure,
2476
+ po as findings,
2477
+ ze as inBlockedTime,
2478
+ st as occupied,
2479
+ Wt as overlaps,
2480
+ kt as resolveAppearance,
2481
+ bo as ripple,
2482
+ Mo as shiftTask,
2483
+ cn as snapTime,
2484
+ fo as subtaskFromPlace,
2485
+ Xt as violatedDependencies
2457
2486
  };