@overdoser/react-toolkit 0.9.0 → 0.11.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,28 +1,28 @@
1
- import { jsx as l, jsxs as d, Fragment as ne } from "react/jsx-runtime";
2
- import { forwardRef as rt, useRef as L, useState as S, useCallback as Y, useEffect as st, useMemo as ke, useLayoutEffect as ct } from "react";
3
- import p from "clsx";
1
+ import { jsx as l, jsxs as u, Fragment as ne } from "react/jsx-runtime";
2
+ import { forwardRef as st, useRef as L, useState as S, useCallback as q, useEffect as ct, useMemo as xe, useLayoutEffect as dt } from "react";
3
+ import f from "clsx";
4
4
  import r from "./Timeline.module.scss.js";
5
- import o from "./HistoryTimeline.module.scss.js";
6
- import { TIMELINE_PALETTE_VARS as u, fmtDateTime as R, eventMatches as dt, fmtDur as D, tint as ut, fmtDate as mt, fmtClock as ht, ticks as pt, DAY as E } from "./timelineCore.js";
5
+ import i from "./HistoryTimeline.module.scss.js";
6
+ import { TIMELINE_PALETTE_VARS as m, fmtDateTime as F, eventMatches as ut, fmtDur as D, tint as mt, fmtDate as ht, fmtClock as ke, ticks as pt, DAY as E } from "./timelineCore.js";
7
7
  import { computeHistoryLayout as ft } from "./historyLayout.js";
8
8
  import { TimelineSummary as gt, TimelineSegmented as He, TimelineZoomControls as vt, TimelineLegend as wt, HighlightText as Me, TimelineTooltip as yt } from "./TimelineShared.js";
9
- import { useNowTicker as Nt, useContainerWidth as St, useTimelinePan as bt, useWheelZoom as Tt, animateScrollTo as xt } from "./useTimeline.js";
9
+ import { useNowTicker as Nt, useContainerWidth as bt, useTimelinePan as St, useWheelZoom as Tt, animateScrollTo as xt } from "./useTimeline.js";
10
10
  const kt = {
11
- created: u[0],
12
- done: u[0],
13
- live: u[0],
14
- payment: u[1],
15
- people: u[1],
16
- review: u[2],
17
- action: u[2],
18
- offer: u[2],
19
- fulfilment: u[3],
20
- analysis: u[3],
21
- shipping: u[4],
22
- interview: u[4],
11
+ created: m[0],
12
+ done: m[0],
13
+ live: m[0],
14
+ payment: m[1],
15
+ people: m[1],
16
+ review: m[2],
17
+ action: m[2],
18
+ offer: m[2],
19
+ fulfilment: m[3],
20
+ analysis: m[3],
21
+ shipping: m[4],
22
+ interview: m[4],
23
23
  exception: "var(--crk-timeline-danger, #b3372f)",
24
24
  alert: "var(--crk-timeline-danger, #b3372f)"
25
- }, Ft = rt(
25
+ }, Ft = st(
26
26
  function(Ce, Le) {
27
27
  const {
28
28
  events: le,
@@ -33,67 +33,67 @@ const kt = {
33
33
  spacing: ae,
34
34
  defaultSpacing: Pe = "equal",
35
35
  onSpacingChange: Oe,
36
- highlight: j,
37
- defaultHighlight: Re,
38
- onHighlightChange: We,
36
+ highlight: X,
37
+ defaultHighlight: We,
38
+ onHighlightChange: Re,
39
39
  showSearch: Fe = !0,
40
40
  renderSearch: re,
41
41
  tagColors: se,
42
42
  showControls: ce = !0,
43
43
  showLegend: Ae = !0,
44
- showSummary: W = !1,
45
- summaryPlacement: H = "left",
44
+ showSummary: A = !1,
45
+ summaryPlacement: T = "left",
46
46
  summaryDefaultPosition: Ve,
47
47
  maxHeight: de,
48
- selectedEventId: q,
48
+ selectedEventId: Z,
49
49
  defaultSelectedEventId: ze = null,
50
50
  onEventSelect: Ie,
51
51
  renderCard: ue,
52
- renderTooltip: F,
53
- renderDetails: X,
54
- classes: m,
52
+ renderTooltip: V,
53
+ renderDetails: K,
54
+ classes: h,
55
55
  className: Ye,
56
56
  style: je
57
- } = Ce, g = L(null), [qe, Xe] = S(
57
+ } = Ce, w = L(null), [qe, Xe] = S(
58
58
  () => De ?? (typeof window < "u" && window.innerWidth < 700 ? "vertical" : "horizontal")
59
- ), A = ie ?? qe, w = A === "horizontal", [Ze, Ke] = S(Pe), Z = ae ?? Ze, [Ue, me] = S(1), [he, pe] = S(!0), [y, K] = S(null), [_e, Ge] = S(ze), P = q !== void 0 ? q : _e, [v, Be] = S({ l: 0, t: 0, w: 0, h: 0 }), fe = L(W);
60
- fe.current = W;
61
- const U = L(null), _ = Y(() => {
62
- const e = g.current;
59
+ ), z = ie ?? qe, y = z === "horizontal", [Ze, Ke] = S(Pe), U = ae ?? Ze, [Ue, me] = S(1), [he, pe] = S(!0), [b, _] = S(null), [_e, Ge] = S(ze), P = Z !== void 0 ? Z : _e, [N, Be] = S({ l: 0, t: 0, w: 0, h: 0 }), fe = L(A);
60
+ fe.current = A;
61
+ const G = L(null), B = q(() => {
62
+ const e = w.current;
63
63
  e && Be(
64
64
  (n) => n.l === e.scrollLeft && n.t === e.scrollTop && n.w === e.clientWidth && n.h === e.clientHeight ? n : { l: e.scrollLeft, t: e.scrollTop, w: e.clientWidth, h: e.clientHeight }
65
65
  );
66
- }, []), Je = Y(() => {
67
- !fe.current || U.current != null || (U.current = requestAnimationFrame(() => {
68
- U.current = null, _();
66
+ }, []), Je = q(() => {
67
+ !fe.current || G.current != null || (G.current = requestAnimationFrame(() => {
68
+ G.current = null, B();
69
69
  }));
70
- }, [_]);
71
- st(() => {
72
- W && _();
70
+ }, [B]);
71
+ ct(() => {
72
+ A && B();
73
73
  });
74
- const [$e, Qe] = S(Re ?? ""), G = j !== void 0 ? j : $e, b = G.trim(), ge = (e) => {
75
- j === void 0 && Qe(e), We?.(e);
76
- }, ve = re ? re({ value: G, setValue: ge }) : Fe ? /* @__PURE__ */ l(
74
+ const [$e, Qe] = S(We ?? ""), J = X !== void 0 ? X : $e, x = J.trim(), ge = (e) => {
75
+ X === void 0 && Qe(e), Re?.(e);
76
+ }, ve = re ? re({ value: J, setValue: ge }) : Fe ? /* @__PURE__ */ l(
77
77
  "input",
78
78
  {
79
- className: p(r.searchInput, m?.search),
79
+ className: f(r.searchInput, h?.search),
80
80
  placeholder: "Highlight keyword in events…",
81
81
  "aria-label": "Highlight keyword",
82
- value: G,
82
+ value: J,
83
83
  onChange: (e) => ge(e.target.value)
84
84
  }
85
- ) : null, c = ke(
85
+ ) : null, c = xe(
86
86
  () => le.map((e) => ({
87
87
  ...e,
88
88
  end: e.end !== void 0 ? e.end : e.ongoing ? null : e.start
89
89
  })).sort((e, n) => e.start - n.start),
90
90
  [le]
91
- ), et = c.some((e) => e.end == null), T = Nt(et, 500), tt = St(g), O = bt(g), M = Y(
91
+ ), et = c.some((e) => e.end == null), k = Nt(et, 500), tt = bt(w), O = St(w), M = q(
92
92
  (e) => {
93
93
  const n = e || "event", t = { ...kt, ...se };
94
94
  if (t[n]) return t[n];
95
- const i = String(n).charCodeAt(0) || 0;
96
- return u[(String(n).length + i) % u.length];
95
+ const o = String(n).charCodeAt(0) || 0;
96
+ return m[(String(n).length + o) % m.length];
97
97
  },
98
98
  [se]
99
99
  ), s = ft(
@@ -105,112 +105,112 @@ const kt = {
105
105
  end: e.end ?? null
106
106
  })),
107
107
  {
108
- orientation: A,
109
- spacing: Z,
108
+ orientation: z,
109
+ spacing: U,
110
110
  containerWidth: tt,
111
111
  viewportHeight: typeof window < "u" && window.innerHeight || 800,
112
- now: T,
112
+ now: k,
113
113
  k: he ? "fit" : Ue
114
114
  }
115
- ), V = new Map(s.items.map((e) => [e.id, e])), we = L(s.kFit), ye = L(s.kEff);
115
+ ), I = new Map(s.items.map((e) => [e.id, e])), we = L(s.kFit), ye = L(s.kEff);
116
116
  we.current = s.kFit, ye.current = s.kEff;
117
- const x = L(null);
118
- ct(() => {
119
- const e = g.current;
120
- x.current && e && (x.current.left != null && (e.scrollLeft = x.current.left), x.current.top != null && (e.scrollTop = x.current.top), x.current = null);
117
+ const H = L(null);
118
+ dt(() => {
119
+ const e = w.current;
120
+ H.current && e && (H.current.left != null && (e.scrollLeft = H.current.left), H.current.top != null && (e.scrollTop = H.current.top), H.current = null);
121
121
  });
122
- const B = Y(
122
+ const $ = q(
123
123
  (e, n) => {
124
- const t = g.current;
124
+ const t = w.current;
125
125
  if (!t) return;
126
- const i = we.current || 1, k = ye.current || 1, h = Math.max(i * 0.3, Math.min(Math.max(i, 1) * 40, k * e)), N = w ? t.scrollLeft : t.scrollTop, f = h / k;
127
- x.current = w ? { left: (N + n) * f - n } : { top: (N + n) * f - n }, pe(!1), me(h);
126
+ const o = we.current || 1, p = ye.current || 1, d = Math.max(o * 0.3, Math.min(Math.max(o, 1) * 40, p * e)), g = y ? t.scrollLeft : t.scrollTop, v = d / p;
127
+ H.current = y ? { left: (g + n) * v - n } : { top: (g + n) * v - n }, pe(!1), me(d);
128
128
  },
129
- [w]
129
+ [y]
130
130
  );
131
131
  Tt(
132
- g,
132
+ w,
133
133
  (e) => {
134
134
  e.preventDefault();
135
- const n = g.current;
135
+ const n = w.current;
136
136
  if (!n) return;
137
- const t = n.getBoundingClientRect(), i = w ? e.clientX - t.left : e.clientY - t.top;
138
- B(Math.exp(-(e.deltaY || e.deltaX) * 22e-4), i);
137
+ const t = n.getBoundingClientRect(), o = y ? e.clientX - t.left : e.clientY - t.top;
138
+ $(Math.exp(-(e.deltaY || e.deltaX) * 22e-4), o);
139
139
  },
140
- A
140
+ z
141
141
  );
142
142
  const Ne = () => {
143
- const e = g.current;
144
- return e ? w ? e.clientWidth / 2 : e.clientHeight / 2 : 300;
145
- }, J = (e) => {
146
- q === void 0 && Ge(e ? e.id : null), Ie?.(e);
143
+ const e = w.current;
144
+ return e ? y ? e.clientWidth / 2 : e.clientHeight / 2 : 300;
145
+ }, Q = (e) => {
146
+ Z === void 0 && Ge(e ? e.id : null), Ie?.(e);
147
147
  }, nt = (e) => {
148
148
  ie === void 0 && Xe(e), Ee?.(e);
149
149
  }, lt = (e) => {
150
150
  ae === void 0 && Ke(e), Oe?.(e);
151
151
  }, ot = (e) => {
152
- const n = window.innerWidth || 1200, t = window.innerHeight || 800, i = e.clientX < n * 0.55 ? Math.max(12, n - 340) : 16, k = Math.max(130, Math.min(e.clientY, t - 130));
153
- return { x: i, y: k };
154
- }, $ = c.length ? c[0].start : T, Se = c.length ? Math.max($ + 1, ...c.map((e) => e.end == null ? T : Math.max(e.end, e.start))) : T + 1, Q = Math.max(1, Se - $), be = (e, n) => {
152
+ const n = window.innerWidth || 1200, t = window.innerHeight || 800, o = e.clientX < n * 0.55 ? Math.max(12, n - 340) : 16, p = Math.max(130, Math.min(e.clientY, t - 130));
153
+ return { x: o, y: p };
154
+ }, W = c.length ? c[0].start : k, it = c.length ? Math.max(W + 1, ...c.map((e) => e.end == null ? k : Math.max(e.end, e.start))) : k + 1, Y = Math.max(1, it - W), be = (e, n) => {
155
155
  const t = new Date(e);
156
- return n === "y" ? String(t.getFullYear()) : n === "my" ? t.toLocaleString("en", { month: "short" }) + " " + t.getFullYear() : n === "d" ? mt(e) : ht(e);
156
+ return n === "y" ? String(t.getFullYear()) : n === "my" ? t.toLocaleString("en", { month: "short" }) + " " + t.getFullYear() : n === "d" ? ht(e) : n === "cms" ? ke(e, !0) : ke(e);
157
157
  };
158
158
  let ee = [];
159
- if (Z === "proportional" && s.mapT) {
160
- const e = pt($, Se, Math.max(200, s.innerSpan), 90), n = e.step >= 360 * E ? "y" : e.step >= 28 * E ? "my" : e.step >= E ? "d" : "c";
161
- ee = e.list.map((t) => ({
162
- pos: Math.round(s.mapT(t.t)),
163
- label: be(t.t, n)
159
+ if (U === "proportional" && s.mapT) {
160
+ const e = s.mapT, n = e(W), t = y ? s.innerW : s.innerH, o = W + (t - n) / Math.max(1, s.innerSpan) * Y, p = pt(W, o, Math.max(200, t - n), 90), d = p.step >= 360 * E ? "y" : p.step >= 28 * E ? "my" : p.step >= E ? "d" : p.step < 1e3 ? "cms" : "c";
161
+ ee = p.list.map((g) => ({
162
+ pos: Math.round(e(g.t)),
163
+ label: be(g.t, d)
164
164
  }));
165
165
  } else {
166
- const e = Q > 550 * E ? "y" : Q > 60 * E ? "my" : Q > 2 * E ? "d" : "c", n = w ? 72 : 18;
167
- let t = null, i = -1e9;
168
- c.forEach((k, h) => {
169
- const N = be(k.start, e), f = Math.round(s.posArr[h]);
170
- N !== t && f - i >= n && (ee.push({ pos: f, label: N }), t = N, i = f);
166
+ const e = Y > 550 * E ? "y" : Y > 60 * E ? "my" : Y > 2 * E ? "d" : "c", n = y ? 72 : 18;
167
+ let t = null, o = -1e9;
168
+ c.forEach((p, d) => {
169
+ const g = be(p.start, e), v = Math.round(s.posArr[d]);
170
+ g !== t && v - o >= n && (ee.push({ pos: v, label: g }), t = g, o = v);
171
171
  });
172
172
  }
173
- const it = ke(() => {
173
+ const at = xe(() => {
174
174
  const e = [];
175
175
  return c.forEach((n) => {
176
176
  const t = n.tag || "event";
177
177
  e.includes(t) || e.push(t);
178
178
  }), e;
179
- }, [c]), a = P != null && c.find((e) => e.id === P) || null, Te = a ? a.end == null : !1, z = W ? /* @__PURE__ */ l(
179
+ }, [c]), a = P != null && c.find((e) => e.id === P) || null, Se = a ? a.end == null : !1, R = A ? /* @__PURE__ */ l(
180
180
  gt,
181
181
  {
182
- className: m?.summary,
183
- placement: H,
182
+ className: h?.summary,
183
+ placement: T,
184
184
  floatingDefaultPosition: Ve,
185
185
  items: c.map((e, n) => {
186
- const t = V.get(e.id), i = !t || !v.w && !v.h ? !0 : (!v.w || t.cardLeft < v.l + v.w && t.cardLeft + t.cardW > v.l) && (!v.h || t.cardTop < v.t + v.h && t.cardTop + t.cardH > v.t);
186
+ const t = I.get(e.id), o = !t || !N.w && !N.h ? !0 : (!N.w || t.cardLeft < N.l + N.w && t.cardLeft + t.cardW > N.l) && (!N.h || t.cardTop < N.t + N.h && t.cardTop + t.cardH > N.t);
187
187
  return {
188
188
  id: e.id,
189
189
  number: String(n + 1).padStart(2, "0"),
190
190
  label: e.title,
191
191
  color: M(e.tag),
192
- time: R(e.start),
193
- inView: i,
192
+ time: F(e.start),
193
+ inView: o,
194
194
  selected: P === e.id
195
195
  };
196
196
  }),
197
197
  onPick: (e) => {
198
- const n = V.get(e), t = g.current;
198
+ const n = I.get(e), t = w.current;
199
199
  if (!n || !t) return;
200
- const i = {};
201
- (t.clientWidth || !t.clientHeight) && (i.left = Math.max(0, n.dotX - t.clientWidth / 2)), t.clientHeight && (i.top = Math.max(0, n.dotY - t.clientHeight / 2)), xt(t, i);
200
+ const o = {};
201
+ (t.clientWidth || !t.clientHeight) && (o.left = Math.max(0, n.dotX - t.clientWidth / 2)), t.clientHeight && (o.top = Math.max(0, n.dotY - t.clientHeight / 2)), xt(t, o);
202
202
  }
203
203
  }
204
204
  ) : null;
205
- return /* @__PURE__ */ d("div", { ref: Le, className: p(r.root, m?.root, Ye), style: je, children: [
206
- (ce || ve) && /* @__PURE__ */ d("div", { className: p(r.toolbar, m?.toolbar), children: [
205
+ return /* @__PURE__ */ u("div", { ref: Le, className: f(r.root, h?.root, Ye), style: je, children: [
206
+ (ce || ve) && /* @__PURE__ */ u("div", { className: f(r.toolbar, h?.toolbar), children: [
207
207
  /* @__PURE__ */ l("div", { className: r.toolbarText }),
208
208
  ve,
209
- ce && /* @__PURE__ */ d(ne, { children: [
209
+ ce && /* @__PURE__ */ u(ne, { children: [
210
210
  /* @__PURE__ */ l(
211
211
  He,
212
212
  {
213
- value: A,
213
+ value: z,
214
214
  options: [
215
215
  { value: "horizontal", label: "Horizontal" },
216
216
  { value: "vertical", label: "Vertical" }
@@ -221,7 +221,7 @@ const kt = {
221
221
  /* @__PURE__ */ l(
222
222
  He,
223
223
  {
224
- value: Z,
224
+ value: U,
225
225
  options: [
226
226
  { value: "equal", label: "Equal" },
227
227
  {
@@ -239,8 +239,8 @@ const kt = {
239
239
  {
240
240
  zoomPct: `${Math.round(s.kEff / s.kFit * 100)}%`,
241
241
  fitActive: he,
242
- onZoomIn: () => B(1.5, Ne()),
243
- onZoomOut: () => B(1 / 1.5, Ne()),
242
+ onZoomIn: () => $(1.5, Ne()),
243
+ onZoomOut: () => $(1 / 1.5, Ne()),
244
244
  onFit: () => {
245
245
  pe(!0), me(1);
246
246
  }
@@ -251,22 +251,22 @@ const kt = {
251
251
  Ae && /* @__PURE__ */ l(
252
252
  wt,
253
253
  {
254
- className: m?.legend,
255
- items: it.map((e) => ({ name: e, color: M(e) }))
254
+ className: h?.legend,
255
+ items: at.map((e) => ({ name: e, color: M(e) }))
256
256
  }
257
257
  ),
258
- H === "top" && z,
259
- /* @__PURE__ */ d("div", { className: r.layout, children: [
260
- H === "left" && z,
261
- /* @__PURE__ */ d("div", { className: r.main, children: [
262
- /* @__PURE__ */ l("div", { className: p(r.card, m?.card), children: /* @__PURE__ */ l(
258
+ T === "top" && R,
259
+ /* @__PURE__ */ u("div", { className: r.layout, children: [
260
+ T === "left" && R,
261
+ /* @__PURE__ */ u("div", { className: r.main, children: [
262
+ /* @__PURE__ */ l("div", { className: f(r.card, h?.card), children: /* @__PURE__ */ l(
263
263
  "div",
264
264
  {
265
- ref: g,
266
- className: p(
265
+ ref: w,
266
+ className: f(
267
267
  r.scroller,
268
- w ? o.scrollerH : o.scrollerV,
269
- m?.scroller
268
+ y ? i.scrollerH : i.scrollerV,
269
+ h?.scroller
270
270
  ),
271
271
  style: de != null ? { maxHeight: de } : void 0,
272
272
  onPointerDown: O.onPointerDown,
@@ -274,44 +274,44 @@ const kt = {
274
274
  onPointerUp: O.onPointerUp,
275
275
  onPointerLeave: O.onPointerUp,
276
276
  onScroll: Je,
277
- children: /* @__PURE__ */ d(
277
+ children: /* @__PURE__ */ u(
278
278
  "div",
279
279
  {
280
- className: o.inner,
280
+ className: i.inner,
281
281
  style: { width: s.innerW, height: s.innerH },
282
282
  children: [
283
283
  ee.map(
284
- (e, n) => w ? /* @__PURE__ */ d("span", { children: [
285
- /* @__PURE__ */ l("span", { className: o.gridlineH, style: { left: e.pos } }),
286
- /* @__PURE__ */ l("span", { className: o.tickLabelH, style: { left: e.pos }, children: e.label })
287
- ] }, n) : /* @__PURE__ */ d("span", { children: [
288
- /* @__PURE__ */ l("span", { className: o.gridlineV, style: { top: e.pos } }),
289
- /* @__PURE__ */ l("span", { className: o.tickLabelV, style: { top: e.pos }, children: e.label })
284
+ (e, n) => y ? /* @__PURE__ */ u("span", { children: [
285
+ /* @__PURE__ */ l("span", { className: i.gridlineH, style: { left: e.pos } }),
286
+ /* @__PURE__ */ l("span", { className: i.tickLabelH, style: { left: e.pos }, children: e.label })
287
+ ] }, n) : /* @__PURE__ */ u("span", { children: [
288
+ /* @__PURE__ */ l("span", { className: i.gridlineV, style: { top: e.pos } }),
289
+ /* @__PURE__ */ l("span", { className: i.tickLabelV, style: { top: e.pos }, children: e.label })
290
290
  ] }, n)
291
291
  ),
292
- w ? /* @__PURE__ */ l("div", { className: o.axisH, style: { top: s.axisY } }) : /* @__PURE__ */ l("div", { className: o.axisV, style: { left: s.axisX } }),
292
+ y ? /* @__PURE__ */ l("div", { className: i.axisH, style: { top: s.axisY } }) : /* @__PURE__ */ l("div", { className: i.axisV, style: { left: s.axisX } }),
293
293
  c.map((e, n) => {
294
- const t = V.get(e.id);
294
+ const t = I.get(e.id);
295
295
  if (!t) return null;
296
- const i = e.end == null, h = (i ? T : e.end) - e.start, N = i || h > 0, f = dt(e, b), I = M(e.tag), xe = {
296
+ const o = e.end == null, d = (o ? k : e.end) - e.start, g = o || d > 0, v = ut(e, x), j = M(e.tag), Te = {
297
297
  index: n,
298
298
  number: String(n + 1).padStart(2, "0"),
299
- color: I,
300
- ongoing: i,
299
+ color: j,
300
+ ongoing: o,
301
301
  condensed: t.condensed,
302
- durationMs: h
302
+ durationMs: d
303
303
  };
304
- return /* @__PURE__ */ d("span", { children: [
304
+ return /* @__PURE__ */ u("span", { children: [
305
305
  t.segs.map((C, te) => /* @__PURE__ */ l(
306
306
  "span",
307
307
  {
308
- className: o.seg,
308
+ className: i.seg,
309
309
  style: {
310
310
  left: C.l,
311
311
  top: C.t,
312
312
  width: C.w,
313
313
  height: C.h,
314
- background: I
314
+ background: j
315
315
  }
316
316
  },
317
317
  te
@@ -319,53 +319,53 @@ const kt = {
319
319
  /* @__PURE__ */ l(
320
320
  "span",
321
321
  {
322
- className: p(o.dot, m?.dot),
323
- style: { left: t.dotX, top: t.dotY, borderColor: I }
322
+ className: f(i.dot, h?.dot),
323
+ style: { left: t.dotX, top: t.dotY, borderColor: j }
324
324
  }
325
325
  ),
326
326
  /* @__PURE__ */ l(
327
327
  "div",
328
328
  {
329
- className: p(o.eventCard, m?.eventCard),
329
+ className: f(i.eventCard, h?.eventCard),
330
330
  style: {
331
331
  left: t.cardLeft,
332
332
  top: t.cardTop,
333
333
  width: t.cardW,
334
334
  height: t.cardH,
335
- opacity: b && !f ? 0.3 : 1,
336
- background: b && f ? "var(--crk-timeline-hl-wash-soft, #fff9e8)" : void 0,
337
- borderColor: b && f ? "var(--crk-timeline-hl-border, #e8b931)" : void 0,
338
- boxShadow: b && f ? "0 0 0 3px #f9e9b8" : "0 1px 3px rgba(35,32,28,.06)"
335
+ opacity: x && !v ? 0.3 : 1,
336
+ background: x && v ? "var(--crk-timeline-hl-wash-soft, #fff9e8)" : void 0,
337
+ borderColor: x && v ? "var(--crk-timeline-hl-border, #e8b931)" : void 0,
338
+ boxShadow: x && v ? "0 0 0 3px #f9e9b8" : "0 1px 3px rgba(35,32,28,.06)"
339
339
  },
340
340
  onClick: () => {
341
- O.wasDragSuppressed() || (K(null), J(P === e.id ? null : e));
341
+ O.wasDragSuppressed() || (_(null), Q(P === e.id ? null : e));
342
342
  },
343
343
  onMouseEnter: (C) => {
344
344
  if (P === e.id) return;
345
345
  const te = (e.detail || "").length > 80;
346
- if (!F && !te && !i) return;
347
- const at = ot(C);
348
- K({
349
- ...at,
346
+ if (!V && !te && !o) return;
347
+ const rt = ot(C);
348
+ _({
349
+ ...rt,
350
350
  id: e.id,
351
351
  title: e.title,
352
- time: R(e.start),
353
- durLine: i ? "ongoing · " + D(h) + " so far" : h > 0 ? "duration " + D(h) : "instant event",
352
+ time: F(e.start),
353
+ durLine: o ? "ongoing · " + D(d) + " so far" : d > 0 ? "duration " + D(d) : "instant event",
354
354
  detail: e.detail || ""
355
355
  });
356
356
  },
357
- onMouseLeave: () => K(null),
358
- children: ue ? ue(e, xe) : /* @__PURE__ */ d(ne, { children: [
359
- /* @__PURE__ */ d("div", { className: o.cardTitle, children: [
360
- /* @__PURE__ */ l("span", { className: o.cardNum, children: xe.number }),
357
+ onMouseLeave: () => _(null),
358
+ children: ue ? ue(e, Te) : /* @__PURE__ */ u(ne, { children: [
359
+ /* @__PURE__ */ u("div", { className: i.cardTitle, children: [
360
+ /* @__PURE__ */ l("span", { className: i.cardNum, children: Te.number }),
361
361
  " ",
362
- /* @__PURE__ */ l("span", { className: o.cardTagDot, style: { background: I } }),
363
- /* @__PURE__ */ l(Me, { text: e.title, query: b }),
364
- i && /* @__PURE__ */ l("span", { className: p(r.pulseDot, o.cardOngoingDot) })
362
+ /* @__PURE__ */ l("span", { className: i.cardTagDot, style: { background: j } }),
363
+ /* @__PURE__ */ l(Me, { text: e.title, query: x }),
364
+ o && /* @__PURE__ */ l("span", { className: f(r.pulseDot, i.cardOngoingDot) })
365
365
  ] }),
366
- /* @__PURE__ */ l("div", { className: o.cardTime, children: R(e.start) }),
367
- !t.condensed && !!e.detail && /* @__PURE__ */ l("div", { className: o.cardDetail, children: /* @__PURE__ */ l(Me, { text: e.detail, query: b }) }),
368
- N && /* @__PURE__ */ l("div", { className: o.cardDur, children: i ? "ongoing · " + D(h) : "took " + D(h) })
366
+ /* @__PURE__ */ l("div", { className: i.cardTime, children: F(e.start) }),
367
+ !t.condensed && !!e.detail && /* @__PURE__ */ l("div", { className: i.cardDetail, children: /* @__PURE__ */ l(Me, { text: e.detail, query: x }) }),
368
+ g && /* @__PURE__ */ l("div", { className: i.cardDur, children: o ? "ongoing · " + D(d) : "took " + D(d) })
369
369
  ] })
370
370
  }
371
371
  )
@@ -376,65 +376,66 @@ const kt = {
376
376
  )
377
377
  }
378
378
  ) }),
379
- /* @__PURE__ */ l("div", { className: p(r.footnote, m?.footnote), children: "Click a card to open details in the side panel · scroll zooms · drag pans · overlapping events stack around the axis with Z-shaped leads" })
379
+ /* @__PURE__ */ l("div", { className: f(r.footnote, h?.footnote), children: "Click a card to open details in the side panel · scroll zooms · drag pans · overlapping events stack around the axis with Z-shaped leads" }),
380
+ T === "bubble" && R
380
381
  ] }),
381
- a && X && /* @__PURE__ */ l("aside", { className: p(r.aside, o.drawer, m?.drawer), children: X(a, { close: () => J(null), ongoing: Te }) }),
382
- a && !X && /* @__PURE__ */ d("aside", { className: p(r.aside, o.drawer, m?.drawer), children: [
383
- /* @__PURE__ */ d("div", { className: o.drawerHead, children: [
382
+ a && K && /* @__PURE__ */ l("aside", { className: f(r.aside, i.drawer, h?.drawer), children: K(a, { close: () => Q(null), ongoing: Se }) }),
383
+ a && !K && /* @__PURE__ */ u("aside", { className: f(r.aside, i.drawer, h?.drawer), children: [
384
+ /* @__PURE__ */ u("div", { className: i.drawerHead, children: [
384
385
  /* @__PURE__ */ l(
385
386
  "span",
386
387
  {
387
- className: o.drawerTag,
388
+ className: i.drawerTag,
388
389
  style: {
389
- background: ut(M(a.tag), 12),
390
+ background: mt(M(a.tag), 12),
390
391
  color: M(a.tag)
391
392
  },
392
393
  children: a.tag || "event"
393
394
  }
394
395
  ),
395
- (oe ?? a.subject) != null && /* @__PURE__ */ l("span", { className: o.drawerSubject, children: oe ?? a.subject }),
396
- /* @__PURE__ */ l("div", { className: o.drawerSpacer }),
396
+ (oe ?? a.subject) != null && /* @__PURE__ */ l("span", { className: i.drawerSubject, children: oe ?? a.subject }),
397
+ /* @__PURE__ */ l("div", { className: i.drawerSpacer }),
397
398
  /* @__PURE__ */ l(
398
399
  "button",
399
400
  {
400
401
  type: "button",
401
402
  className: r.asideClose,
402
403
  "aria-label": "Close details",
403
- onClick: () => J(null),
404
+ onClick: () => Q(null),
404
405
  children: "✕"
405
406
  }
406
407
  )
407
408
  ] }),
408
- /* @__PURE__ */ l("div", { className: o.drawerTitle, children: a.title }),
409
- /* @__PURE__ */ l("div", { className: o.drawerTiming, children: R(a.start) + (Te ? " · ongoing, " + D(T - a.start) + " so far" : a.end > a.start ? " → " + R(a.end) + " · " + D(a.end - a.start) : "") }),
410
- /* @__PURE__ */ l("div", { className: o.drawerDetail, children: a.detail || "—" }),
409
+ /* @__PURE__ */ l("div", { className: i.drawerTitle, children: a.title }),
410
+ /* @__PURE__ */ l("div", { className: i.drawerTiming, children: F(a.start) + (Se ? " · ongoing, " + D(k - a.start) + " so far" : a.end > a.start ? " → " + F(a.end) + " · " + D(a.end - a.start) : "") }),
411
+ /* @__PURE__ */ l("div", { className: i.drawerDetail, children: a.detail || "—" }),
411
412
  /* @__PURE__ */ l("div", { className: r.asideSection, children: "Raw event" }),
412
413
  /* @__PURE__ */ l("pre", { className: r.asideRaw, children: JSON.stringify(a, null, 2) })
413
414
  ] }),
414
- (H === "right" || H === "floating") && z
415
+ (T === "right" || T === "floating") && R
415
416
  ] }),
416
- H === "bottom" && z,
417
- y && (() => {
418
- const e = c.find((i) => i.id === y.id), n = e ? c.indexOf(e) : -1, t = e && F ? F(e, {
417
+ T === "bottom" && R,
418
+ b && (() => {
419
+ const e = c.find((o) => o.id === b.id), n = e ? c.indexOf(e) : -1, t = e && V ? V(e, {
419
420
  index: n,
420
421
  number: String(n + 1).padStart(2, "0"),
421
422
  color: M(e.tag),
422
423
  ongoing: e.end == null,
423
- condensed: V.get(e.id)?.condensed ?? !1,
424
- durationMs: (e.end == null ? T : e.end) - e.start
424
+ condensed: I.get(e.id)?.condensed ?? !1,
425
+ durationMs: (e.end == null ? k : e.end) - e.start
425
426
  }) : void 0;
426
- return F && t == null ? null : /* @__PURE__ */ l(yt, { x: y.x, y: y.y, className: m?.tooltip, children: t !== void 0 ? t : /* @__PURE__ */ d(ne, { children: [
427
- /* @__PURE__ */ l("div", { className: r.tooltipTitle, children: y.title }),
427
+ return V && t == null ? null : /* @__PURE__ */ l(yt, { x: b.x, y: b.y, className: h?.tooltip, children: t !== void 0 ? t : /* @__PURE__ */ u(ne, { children: [
428
+ /* @__PURE__ */ l("div", { className: r.tooltipTitle, children: b.title }),
428
429
  /* @__PURE__ */ l(
429
430
  "div",
430
431
  {
431
- className: p(r.tooltipLine, r.tooltipMono),
432
+ className: f(r.tooltipLine, r.tooltipMono),
432
433
  style: { marginTop: 4 },
433
- children: y.time
434
+ children: b.time
434
435
  }
435
436
  ),
436
- /* @__PURE__ */ l("div", { className: r.tooltipLine, children: y.durLine }),
437
- y.detail && /* @__PURE__ */ l("div", { className: r.tooltipDim, style: { marginTop: 5 }, children: y.detail })
437
+ /* @__PURE__ */ l("div", { className: r.tooltipLine, children: b.durLine }),
438
+ b.detail && /* @__PURE__ */ l("div", { className: r.tooltipDim, style: { marginTop: 5 }, children: b.detail })
438
439
  ] }) });
439
440
  })()
440
441
  ] });