@kteneyck/cesium-timeline-react 0.7.0 → 0.8.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,9 +1,9 @@
1
- import qe, { useMemo as Se, useRef as b, useState as ve, useEffect as J, forwardRef as Ge, useCallback as se, useImperativeHandle as Ve, useLayoutEffect as Ke } from "react";
2
- import * as j from "cesium";
3
- import { DEFAULT_LABELS as Ze, splitForDisplay as Qe, getTimezoneAbbr as et, formatDateTime as Fe, resolveLabel as Ie, drawTimeline as tt, hitTestSwimLane as nt, hitTestLaneLabel as rt, isInSwimLaneRegion as ot, zoomRange as st, TICK_AREA_HEIGHT as $e, DEFAULT_LANE_HEIGHT as Oe, LANE_GAP as Pe, SWIM_LANE_SCROLL_SPEED as ct, MIN_SPAN_MS as it, MAX_SPAN_MS as lt, toJulianDate as ge, defaultTheme as at, generateTicks as ut, timeToPosition as dt, snapToTick as ft } from "@kteneyck/cesium-timeline-core";
1
+ import et, { useMemo as Xe, useRef as x, useState as _e, useEffect as P, forwardRef as tt, useCallback as le, useImperativeHandle as nt, useLayoutEffect as rt } from "react";
2
+ import * as _ from "cesium";
3
+ import { DEFAULT_LABELS as ot, splitForDisplay as st, getTimezoneAbbr as ct, formatDateTime as Je, resolveLabel as Ye, drawTimeline as it, hitTestSwimLane as ut, hitTestLaneLabel as lt, isInSwimLaneRegion as at, zoomRange as dt, TICK_AREA_HEIGHT as Ke, DEFAULT_LANE_HEIGHT as ze, LANE_GAP as We, SWIM_LANE_SCROLL_SPEED as ft, MIN_SPAN_MS as pt, MAX_SPAN_MS as mt, zoomAroundMs as ht, toJulianDate as Ae, defaultTheme as xt, generateTicks as gt, timeToPosition as vt, snapToTick as bt } from "@kteneyck/cesium-timeline-core";
4
4
  export * from "@kteneyck/cesium-timeline-core";
5
- import { TICK_AREA_HEIGHT as Dt } from "@kteneyck/cesium-timeline-core";
6
- var Me = { exports: {} }, Te = {};
5
+ import { TICK_AREA_HEIGHT as kt } from "@kteneyck/cesium-timeline-core";
6
+ var Fe = { exports: {} }, je = {};
7
7
  /**
8
8
  * @license React
9
9
  * react-jsx-runtime.production.js
@@ -13,29 +13,29 @@ var Me = { exports: {} }, Te = {};
13
13
  * This source code is licensed under the MIT license found in the
14
14
  * LICENSE file in the root directory of this source tree.
15
15
  */
16
- var Ne;
17
- function pt() {
18
- if (Ne) return Te;
19
- Ne = 1;
20
- var A = Symbol.for("react.transitional.element"), L = Symbol.for("react.fragment");
21
- function Y(a, M, R) {
22
- var F = null;
23
- if (R !== void 0 && (F = "" + R), M.key !== void 0 && (F = "" + M.key), "key" in M) {
24
- R = {};
25
- for (var O in M)
26
- O !== "key" && (R[O] = M[O]);
27
- } else R = M;
28
- return M = R.ref, {
29
- $$typeof: A,
30
- type: a,
31
- key: F,
32
- ref: M !== void 0 ? M : null,
33
- props: R
16
+ var Be;
17
+ function Tt() {
18
+ if (Be) return je;
19
+ Be = 1;
20
+ var j = Symbol.for("react.transitional.element"), I = Symbol.for("react.fragment");
21
+ function U(l, C, A) {
22
+ var O = null;
23
+ if (A !== void 0 && (O = "" + A), C.key !== void 0 && (O = "" + C.key), "key" in C) {
24
+ A = {};
25
+ for (var N in C)
26
+ N !== "key" && (A[N] = C[N]);
27
+ } else A = C;
28
+ return C = A.ref, {
29
+ $$typeof: j,
30
+ type: l,
31
+ key: O,
32
+ ref: C !== void 0 ? C : null,
33
+ props: A
34
34
  };
35
35
  }
36
- return Te.Fragment = L, Te.jsx = Y, Te.jsxs = Y, Te;
36
+ return je.Fragment = I, je.jsx = U, je.jsxs = U, je;
37
37
  }
38
- var we = {};
38
+ var Se = {};
39
39
  /**
40
40
  * @license React
41
41
  * react-jsx-runtime.development.js
@@ -45,126 +45,126 @@ var we = {};
45
45
  * This source code is licensed under the MIT license found in the
46
46
  * LICENSE file in the root directory of this source tree.
47
47
  */
48
- var Xe;
49
- function mt() {
50
- return Xe || (Xe = 1, process.env.NODE_ENV !== "production" && (function() {
51
- function A(t) {
48
+ var $e;
49
+ function wt() {
50
+ return $e || ($e = 1, process.env.NODE_ENV !== "production" && (function() {
51
+ function j(t) {
52
52
  if (t == null) return null;
53
53
  if (typeof t == "function")
54
- return t.$$typeof === re ? null : t.displayName || t.name || null;
54
+ return t.$$typeof === y ? null : t.displayName || t.name || null;
55
55
  if (typeof t == "string") return t;
56
56
  switch (t) {
57
- case B:
57
+ case Z:
58
58
  return "Fragment";
59
- case p:
59
+ case T:
60
60
  return "Profiler";
61
- case ee:
61
+ case ce:
62
62
  return "StrictMode";
63
- case u:
63
+ case X:
64
64
  return "Suspense";
65
- case v:
65
+ case Q:
66
66
  return "SuspenseList";
67
- case w:
67
+ case s:
68
68
  return "Activity";
69
69
  }
70
70
  if (typeof t == "object")
71
71
  switch (typeof t.tag == "number" && console.error(
72
72
  "Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."
73
73
  ), t.$$typeof) {
74
- case Q:
74
+ case se:
75
75
  return "Portal";
76
- case $:
76
+ case M:
77
77
  return t.displayName || "Context";
78
78
  case g:
79
79
  return (t._context.displayName || "Context") + ".Consumer";
80
- case K:
81
- var d = t.render;
82
- return t = t.displayName, t || (t = d.displayName || d.name || "", t = t !== "" ? "ForwardRef(" + t + ")" : "ForwardRef"), t;
83
- case P:
84
- return d = t.displayName || null, d !== null ? d : A(t.type) || "Memo";
85
- case y:
86
- d = t._payload, t = t._init;
80
+ case ne:
81
+ var u = t.render;
82
+ return t = t.displayName, t || (t = u.displayName || u.name || "", t = t !== "" ? "ForwardRef(" + t + ")" : "ForwardRef"), t;
83
+ case he:
84
+ return u = t.displayName || null, u !== null ? u : j(t.type) || "Memo";
85
+ case ee:
86
+ u = t._payload, t = t._init;
87
87
  try {
88
- return A(t(d));
88
+ return j(t(u));
89
89
  } catch {
90
90
  }
91
91
  }
92
92
  return null;
93
93
  }
94
- function L(t) {
94
+ function I(t) {
95
95
  return "" + t;
96
96
  }
97
- function Y(t) {
97
+ function U(t) {
98
98
  try {
99
- L(t);
100
- var d = !1;
99
+ I(t);
100
+ var u = !1;
101
101
  } catch {
102
- d = !0;
102
+ u = !0;
103
103
  }
104
- if (d) {
105
- d = console;
106
- var x = d.error, E = typeof Symbol == "function" && Symbol.toStringTag && t[Symbol.toStringTag] || t.constructor.name || "Object";
107
- return x.call(
108
- d,
104
+ if (u) {
105
+ u = console;
106
+ var v = u.error, E = typeof Symbol == "function" && Symbol.toStringTag && t[Symbol.toStringTag] || t.constructor.name || "Object";
107
+ return v.call(
108
+ u,
109
109
  "The provided key is an unsupported type %s. This value must be coerced to a string before using it here.",
110
110
  E
111
- ), L(t);
111
+ ), I(t);
112
112
  }
113
113
  }
114
- function a(t) {
115
- if (t === B) return "<>";
116
- if (typeof t == "object" && t !== null && t.$$typeof === y)
114
+ function l(t) {
115
+ if (t === Z) return "<>";
116
+ if (typeof t == "object" && t !== null && t.$$typeof === ee)
117
117
  return "<...>";
118
118
  try {
119
- var d = A(t);
120
- return d ? "<" + d + ">" : "<...>";
119
+ var u = j(t);
120
+ return u ? "<" + u + ">" : "<...>";
121
121
  } catch {
122
122
  return "<...>";
123
123
  }
124
124
  }
125
- function M() {
126
- var t = X.A;
125
+ function C() {
126
+ var t = R.A;
127
127
  return t === null ? null : t.getOwner();
128
128
  }
129
- function R() {
129
+ function A() {
130
130
  return Error("react-stack-top-frame");
131
131
  }
132
- function F(t) {
133
- if (te.call(t, "key")) {
134
- var d = Object.getOwnPropertyDescriptor(t, "key").get;
135
- if (d && d.isReactWarning) return !1;
132
+ function O(t) {
133
+ if (k.call(t, "key")) {
134
+ var u = Object.getOwnPropertyDescriptor(t, "key").get;
135
+ if (u && u.isReactWarning) return !1;
136
136
  }
137
137
  return t.key !== void 0;
138
138
  }
139
- function O(t, d) {
140
- function x() {
141
- k || (k = !0, console.error(
139
+ function N(t, u) {
140
+ function v() {
141
+ S || (S = !0, console.error(
142
142
  "%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://react.dev/link/special-props)",
143
- d
143
+ u
144
144
  ));
145
145
  }
146
- x.isReactWarning = !0, Object.defineProperty(t, "key", {
147
- get: x,
146
+ v.isReactWarning = !0, Object.defineProperty(t, "key", {
147
+ get: v,
148
148
  configurable: !0
149
149
  });
150
150
  }
151
- function z() {
152
- var t = A(this.type);
153
- return S[t] || (S[t] = !0, console.error(
151
+ function ae() {
152
+ var t = j(this.type);
153
+ return L[t] || (L[t] = !0, console.error(
154
154
  "Accessing element.ref was removed in React 19. ref is now a regular prop. It will be removed from the JSX Element type in a future release."
155
155
  )), t = this.props.ref, t !== void 0 ? t : null;
156
156
  }
157
- function _(t, d, x, E, ce, pe) {
158
- var T = x.ref;
157
+ function J(t, u, v, E, de, be) {
158
+ var b = v.ref;
159
159
  return t = {
160
- $$typeof: Z,
160
+ $$typeof: oe,
161
161
  type: t,
162
- key: d,
163
- props: x,
162
+ key: u,
163
+ props: v,
164
164
  _owner: E
165
- }, (T !== void 0 ? T : null) !== null ? Object.defineProperty(t, "ref", {
165
+ }, (b !== void 0 ? b : null) !== null ? Object.defineProperty(t, "ref", {
166
166
  enumerable: !1,
167
- get: z
167
+ get: ae
168
168
  }) : Object.defineProperty(t, "ref", { enumerable: !1, value: null }), t._store = {}, Object.defineProperty(t._store, "validated", {
169
169
  configurable: !1,
170
170
  enumerable: !1,
@@ -179,33 +179,33 @@ function mt() {
179
179
  configurable: !1,
180
180
  enumerable: !1,
181
181
  writable: !0,
182
- value: ce
182
+ value: de
183
183
  }), Object.defineProperty(t, "_debugTask", {
184
184
  configurable: !1,
185
185
  enumerable: !1,
186
186
  writable: !0,
187
- value: pe
187
+ value: be
188
188
  }), Object.freeze && (Object.freeze(t.props), Object.freeze(t)), t;
189
189
  }
190
- function U(t, d, x, E, ce, pe) {
191
- var T = d.children;
192
- if (T !== void 0)
190
+ function q(t, u, v, E, de, be) {
191
+ var b = u.children;
192
+ if (b !== void 0)
193
193
  if (E)
194
- if (H(T)) {
195
- for (E = 0; E < T.length; E++)
196
- W(T[E]);
197
- Object.freeze && Object.freeze(T);
194
+ if (z(b)) {
195
+ for (E = 0; E < b.length; E++)
196
+ K(b[E]);
197
+ Object.freeze && Object.freeze(b);
198
198
  } else
199
199
  console.error(
200
200
  "React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead."
201
201
  );
202
- else W(T);
203
- if (te.call(d, "key")) {
204
- T = A(t);
205
- var oe = Object.keys(d).filter(function(xe) {
206
- return xe !== "key";
202
+ else K(b);
203
+ if (k.call(u, "key")) {
204
+ b = j(t);
205
+ var re = Object.keys(u).filter(function(ye) {
206
+ return ye !== "key";
207
207
  });
208
- E = 0 < oe.length ? "{key: someKey, " + oe.join(": ..., ") + ": ...}" : "{key: someKey}", q[T + E] || (oe = 0 < oe.length ? "{" + oe.join(": ..., ") + ": ...}" : "{}", console.error(
208
+ E = 0 < re.length ? "{key: someKey, " + re.join(": ..., ") + ": ...}" : "{key: someKey}", ie[b + E] || (re = 0 < re.length ? "{" + re.join(": ..., ") + ": ...}" : "{}", console.error(
209
209
  `A props object containing a "key" prop is being spread into JSX:
210
210
  let props = %s;
211
211
  <%s {...props} />
@@ -213,114 +213,114 @@ React keys must be passed directly to JSX without using spread:
213
213
  let props = %s;
214
214
  <%s key={someKey} {...props} />`,
215
215
  E,
216
- T,
217
- oe,
218
- T
219
- ), q[T + E] = !0);
216
+ b,
217
+ re,
218
+ b
219
+ ), ie[b + E] = !0);
220
220
  }
221
- if (T = null, x !== void 0 && (Y(x), T = "" + x), F(d) && (Y(d.key), T = "" + d.key), "key" in d) {
222
- x = {};
223
- for (var ae in d)
224
- ae !== "key" && (x[ae] = d[ae]);
225
- } else x = d;
226
- return T && O(
227
- x,
221
+ if (b = null, v !== void 0 && (U(v), b = "" + v), O(u) && (U(u.key), b = "" + u.key), "key" in u) {
222
+ v = {};
223
+ for (var pe in u)
224
+ pe !== "key" && (v[pe] = u[pe]);
225
+ } else v = u;
226
+ return b && N(
227
+ v,
228
228
  typeof t == "function" ? t.displayName || t.name || "Unknown" : t
229
- ), _(
229
+ ), J(
230
230
  t,
231
- T,
232
- x,
233
- M(),
234
- ce,
235
- pe
231
+ b,
232
+ v,
233
+ C(),
234
+ de,
235
+ be
236
236
  );
237
237
  }
238
- function W(t) {
239
- ne(t) ? t._store && (t._store.validated = 1) : typeof t == "object" && t !== null && t.$$typeof === y && (t._payload.status === "fulfilled" ? ne(t._payload.value) && t._payload.value._store && (t._payload.value._store.validated = 1) : t._store && (t._store.validated = 1));
238
+ function K(t) {
239
+ G(t) ? t._store && (t._store.validated = 1) : typeof t == "object" && t !== null && t.$$typeof === ee && (t._payload.status === "fulfilled" ? G(t._payload.value) && t._payload.value._store && (t._payload.value._store.validated = 1) : t._store && (t._store.validated = 1));
240
240
  }
241
- function ne(t) {
242
- return typeof t == "object" && t !== null && t.$$typeof === Z;
241
+ function G(t) {
242
+ return typeof t == "object" && t !== null && t.$$typeof === oe;
243
243
  }
244
- var V = qe, Z = Symbol.for("react.transitional.element"), Q = Symbol.for("react.portal"), B = Symbol.for("react.fragment"), ee = Symbol.for("react.strict_mode"), p = Symbol.for("react.profiler"), g = Symbol.for("react.consumer"), $ = Symbol.for("react.context"), K = Symbol.for("react.forward_ref"), u = Symbol.for("react.suspense"), v = Symbol.for("react.suspense_list"), P = Symbol.for("react.memo"), y = Symbol.for("react.lazy"), w = Symbol.for("react.activity"), re = Symbol.for("react.client.reference"), X = V.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE, te = Object.prototype.hasOwnProperty, H = Array.isArray, D = console.createTask ? console.createTask : function() {
244
+ var Y = et, oe = Symbol.for("react.transitional.element"), se = Symbol.for("react.portal"), Z = Symbol.for("react.fragment"), ce = Symbol.for("react.strict_mode"), T = Symbol.for("react.profiler"), g = Symbol.for("react.consumer"), M = Symbol.for("react.context"), ne = Symbol.for("react.forward_ref"), X = Symbol.for("react.suspense"), Q = Symbol.for("react.suspense_list"), he = Symbol.for("react.memo"), ee = Symbol.for("react.lazy"), s = Symbol.for("react.activity"), y = Symbol.for("react.client.reference"), R = Y.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE, k = Object.prototype.hasOwnProperty, z = Array.isArray, W = console.createTask ? console.createTask : function() {
245
245
  return null;
246
246
  };
247
- V = {
247
+ Y = {
248
248
  react_stack_bottom_frame: function(t) {
249
249
  return t();
250
250
  }
251
251
  };
252
- var k, S = {}, i = V.react_stack_bottom_frame.bind(
253
- V,
254
- R
255
- )(), C = D(a(R)), q = {};
256
- we.Fragment = B, we.jsx = function(t, d, x) {
257
- var E = 1e4 > X.recentlyCreatedOwnerStacks++;
258
- return U(
252
+ var S, L = {}, c = Y.react_stack_bottom_frame.bind(
253
+ Y,
254
+ A
255
+ )(), w = W(l(A)), ie = {};
256
+ Se.Fragment = Z, Se.jsx = function(t, u, v) {
257
+ var E = 1e4 > R.recentlyCreatedOwnerStacks++;
258
+ return q(
259
259
  t,
260
- d,
261
- x,
260
+ u,
261
+ v,
262
262
  !1,
263
- E ? Error("react-stack-top-frame") : i,
264
- E ? D(a(t)) : C
263
+ E ? Error("react-stack-top-frame") : c,
264
+ E ? W(l(t)) : w
265
265
  );
266
- }, we.jsxs = function(t, d, x) {
267
- var E = 1e4 > X.recentlyCreatedOwnerStacks++;
268
- return U(
266
+ }, Se.jsxs = function(t, u, v) {
267
+ var E = 1e4 > R.recentlyCreatedOwnerStacks++;
268
+ return q(
269
269
  t,
270
- d,
271
- x,
270
+ u,
271
+ v,
272
272
  !0,
273
- E ? Error("react-stack-top-frame") : i,
274
- E ? D(a(t)) : C
273
+ E ? Error("react-stack-top-frame") : c,
274
+ E ? W(l(t)) : w
275
275
  );
276
276
  };
277
- })()), we;
277
+ })()), Se;
278
278
  }
279
- var Je;
280
- function ht() {
281
- return Je || (Je = 1, process.env.NODE_ENV === "production" ? Me.exports = pt() : Me.exports = mt()), Me.exports;
279
+ var He;
280
+ function Et() {
281
+ return He || (He = 1, process.env.NODE_ENV === "production" ? Fe.exports = Tt() : Fe.exports = wt()), Fe.exports;
282
282
  }
283
- var l = ht();
284
- const xt = 520, gt = () => /* @__PURE__ */ l.jsxs("svg", { width: "14", height: "16", viewBox: "0 0 14 16", fill: "currentColor", "aria-hidden": "true", children: [
285
- /* @__PURE__ */ l.jsx("rect", { x: "1", y: "0", width: "4", height: "16", rx: "1" }),
286
- /* @__PURE__ */ l.jsx("rect", { x: "9", y: "0", width: "4", height: "16", rx: "1" })
287
- ] }), Ye = () => /* @__PURE__ */ l.jsx("svg", { width: "14", height: "14", viewBox: "0 0 14 14", fill: "none", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round", "aria-hidden": "true", children: /* @__PURE__ */ l.jsx("polyline", { points: "3,5 7,9 11,5" }) }), ze = () => /* @__PURE__ */ l.jsx("svg", { width: "14", height: "14", viewBox: "0 0 14 14", fill: "none", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round", "aria-hidden": "true", children: /* @__PURE__ */ l.jsx("polyline", { points: "3,9 7,5 11,9" }) }), vt = ({
288
- currentTime: A,
289
- isPlaying: L,
290
- multiplier: Y,
291
- dateTimeFormat: a,
292
- timezone: M,
293
- isLive: R,
294
- hasStartTime: F,
295
- hasEndTime: O,
296
- showJumpToStart: z = !0,
297
- showJumpToEnd: _ = !0,
298
- onPlayPause: U,
299
- onJumpToStart: W,
300
- onRewind: ne,
301
- onFastForward: V,
302
- onJumpToEnd: Z,
303
- onJumpToLive: Q,
304
- onResetSpeed: B,
305
- onDateTimeClick: ee,
306
- theme: p,
283
+ var i = Et();
284
+ const Mt = 520, yt = () => /* @__PURE__ */ i.jsxs("svg", { width: "14", height: "16", viewBox: "0 0 14 16", fill: "currentColor", "aria-hidden": "true", children: [
285
+ /* @__PURE__ */ i.jsx("rect", { x: "1", y: "0", width: "4", height: "16", rx: "1" }),
286
+ /* @__PURE__ */ i.jsx("rect", { x: "9", y: "0", width: "4", height: "16", rx: "1" })
287
+ ] }), Ue = () => /* @__PURE__ */ i.jsx("svg", { width: "14", height: "14", viewBox: "0 0 14 14", fill: "none", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round", "aria-hidden": "true", children: /* @__PURE__ */ i.jsx("polyline", { points: "3,5 7,9 11,5" }) }), qe = () => /* @__PURE__ */ i.jsx("svg", { width: "14", height: "14", viewBox: "0 0 14 14", fill: "none", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round", "aria-hidden": "true", children: /* @__PURE__ */ i.jsx("polyline", { points: "3,9 7,5 11,9" }) }), Rt = ({
288
+ currentTime: j,
289
+ isPlaying: I,
290
+ multiplier: U,
291
+ dateTimeFormat: l,
292
+ timezone: C,
293
+ isLive: A,
294
+ hasStartTime: O,
295
+ hasEndTime: N,
296
+ showJumpToStart: ae = !0,
297
+ showJumpToEnd: J = !0,
298
+ onPlayPause: q,
299
+ onJumpToStart: K,
300
+ onRewind: G,
301
+ onFastForward: Y,
302
+ onJumpToEnd: oe,
303
+ onJumpToLive: se,
304
+ onResetSpeed: Z,
305
+ onDateTimeClick: ce,
306
+ theme: T,
307
307
  swimLanesVisible: g,
308
- onToggleSwimLanes: $,
309
- labels: K
308
+ onToggleSwimLanes: M,
309
+ labels: ne
310
310
  }) => {
311
- const u = Y < 0, v = Y > 1, P = Y === 1, y = Math.abs(Y), w = Se(
312
- () => ({ ...Ze, ...K }),
313
- [K]
314
- ), re = b(null), [X, te] = ve(!1);
315
- J(() => {
316
- const i = re.current;
317
- if (!i) return;
318
- const C = new ResizeObserver(([q]) => {
319
- te(q.contentRect.width < xt);
311
+ const X = U < 0, Q = U > 1, he = U === 1, ee = Math.abs(U), s = Xe(
312
+ () => ({ ...ot, ...ne }),
313
+ [ne]
314
+ ), y = x(null), [R, k] = _e(!1);
315
+ P(() => {
316
+ const c = y.current;
317
+ if (!c) return;
318
+ const w = new ResizeObserver(([ie]) => {
319
+ k(ie.contentRect.width < Mt);
320
320
  });
321
- return C.observe(i), () => C.disconnect();
321
+ return w.observe(c), () => w.disconnect();
322
322
  }, []);
323
- const H = {
323
+ const z = {
324
324
  background: "none",
325
325
  border: "1px solid transparent",
326
326
  cursor: "pointer",
@@ -337,73 +337,73 @@ const xt = 520, gt = () => /* @__PURE__ */ l.jsxs("svg", { width: "14", height:
337
337
  fontFamily: "system-ui, -apple-system, sans-serif",
338
338
  flexShrink: 0,
339
339
  lineHeight: 1
340
- }, D = (i) => ({
341
- ...H,
342
- color: i ? p.buttonActiveColor : p.buttonColor,
343
- borderColor: i ? `${p.buttonActiveColor}33` : "transparent"
344
- }), k = (i, C) => {
345
- i.currentTarget.style.backgroundColor = C ? `${p.buttonActiveColor}22` : p.buttonHoverColor + "44";
346
- }, S = (i) => {
347
- i.currentTarget.style.backgroundColor = "transparent";
340
+ }, W = (c) => ({
341
+ ...z,
342
+ color: c ? T.buttonActiveColor : T.buttonColor,
343
+ borderColor: c ? `${T.buttonActiveColor}33` : "transparent"
344
+ }), S = (c, w) => {
345
+ c.currentTarget.style.backgroundColor = w ? `${T.buttonActiveColor}22` : T.buttonHoverColor + "44";
346
+ }, L = (c) => {
347
+ c.currentTarget.style.backgroundColor = "transparent";
348
348
  };
349
- return /* @__PURE__ */ l.jsxs(
349
+ return /* @__PURE__ */ i.jsxs(
350
350
  "div",
351
351
  {
352
- ref: re,
352
+ ref: y,
353
353
  style: {
354
- display: X ? "flex" : "grid",
355
- gridTemplateColumns: X ? void 0 : "1fr auto 1fr",
354
+ display: R ? "flex" : "grid",
355
+ gridTemplateColumns: R ? void 0 : "1fr auto 1fr",
356
356
  alignItems: "center",
357
357
  padding: "6px 16px",
358
- backgroundColor: p.controlBarBackground,
359
- borderBottom: `1px solid ${p.controlBarBorder}`,
358
+ backgroundColor: T.controlBarBackground,
359
+ borderBottom: `1px solid ${T.controlBarBorder}`,
360
360
  fontFamily: "system-ui, -apple-system, sans-serif"
361
361
  },
362
362
  children: [
363
- /* @__PURE__ */ l.jsxs("div", { style: { display: "flex", alignItems: "center", gap: "8px", flexShrink: 0 }, children: [
364
- /* @__PURE__ */ l.jsx(
363
+ /* @__PURE__ */ i.jsxs("div", { style: { display: "flex", alignItems: "center", gap: "8px", flexShrink: 0 }, children: [
364
+ /* @__PURE__ */ i.jsx(
365
365
  "div",
366
366
  {
367
- onClick: ee,
368
- title: ee ? w.dateTimeClickTooltip : void 0,
367
+ onClick: ce,
368
+ title: ce ? s.dateTimeClickTooltip : void 0,
369
369
  style: {
370
- color: p.labelColor,
370
+ color: T.labelColor,
371
371
  fontFamily: "monospace",
372
372
  lineHeight: 1.15,
373
- cursor: ee ? "pointer" : "default",
373
+ cursor: ce ? "pointer" : "default",
374
374
  borderRadius: "4px",
375
375
  padding: "2px 4px",
376
376
  transition: "background 0.15s"
377
377
  },
378
- onMouseEnter: (i) => {
379
- ee && (i.currentTarget.style.background = p.buttonHoverColor + "44");
378
+ onMouseEnter: (c) => {
379
+ ce && (c.currentTarget.style.background = T.buttonHoverColor + "44");
380
380
  },
381
- onMouseLeave: (i) => i.currentTarget.style.background = "transparent",
381
+ onMouseLeave: (c) => c.currentTarget.style.background = "transparent",
382
382
  children: (() => {
383
- const { timeFormat: i, dateFormat: C } = Qe(a), q = et(A, M);
384
- return /* @__PURE__ */ l.jsxs(l.Fragment, { children: [
385
- i && /* @__PURE__ */ l.jsx("div", { style: { fontSize: "2em", fontWeight: "bold", letterSpacing: "0.02em" }, children: Fe(A, i, M) }),
386
- C && /* @__PURE__ */ l.jsxs("div", { style: { display: "flex", alignItems: "center", gap: "6px" }, children: [
387
- /* @__PURE__ */ l.jsx("span", { style: { fontSize: "1.15em", letterSpacing: "0.03em", color: p.buttonActiveColor }, children: Fe(A, C, M) }),
388
- q && /* @__PURE__ */ l.jsx("span", { style: {
383
+ const { timeFormat: c, dateFormat: w } = st(l), ie = ct(j, C);
384
+ return /* @__PURE__ */ i.jsxs(i.Fragment, { children: [
385
+ c && /* @__PURE__ */ i.jsx("div", { style: { fontSize: "2em", fontWeight: "bold", letterSpacing: "0.02em" }, children: Je(j, c, C) }),
386
+ w && /* @__PURE__ */ i.jsxs("div", { style: { display: "flex", alignItems: "center", gap: "6px" }, children: [
387
+ /* @__PURE__ */ i.jsx("span", { style: { fontSize: "1.15em", letterSpacing: "0.03em", color: T.buttonActiveColor }, children: Je(j, w, C) }),
388
+ ie && /* @__PURE__ */ i.jsx("span", { style: {
389
389
  fontSize: "0.9em",
390
- color: p.labelColor,
390
+ color: T.labelColor,
391
391
  opacity: 0.7,
392
392
  fontWeight: "bold",
393
393
  letterSpacing: "0.04em"
394
- }, children: q })
394
+ }, children: ie })
395
395
  ] })
396
396
  ] });
397
397
  })()
398
398
  }
399
399
  ),
400
- /* @__PURE__ */ l.jsxs("div", { style: { display: "flex", flexDirection: "column", gap: "2px", justifyContent: "center" }, children: [
401
- /* @__PURE__ */ l.jsx(
400
+ /* @__PURE__ */ i.jsxs("div", { style: { display: "flex", flexDirection: "column", gap: "2px", justifyContent: "center" }, children: [
401
+ /* @__PURE__ */ i.jsx(
402
402
  "button",
403
403
  {
404
- onClick: Q,
404
+ onClick: se,
405
405
  style: {
406
- ...H,
406
+ ...z,
407
407
  fontSize: "11px",
408
408
  fontWeight: "bold",
409
409
  letterSpacing: "0.05em",
@@ -411,816 +411,832 @@ const xt = 520, gt = () => /* @__PURE__ */ l.jsxs("svg", { width: "14", height:
411
411
  minWidth: "52px",
412
412
  height: "20px",
413
413
  borderRadius: "3px",
414
- color: R ? p.controlBarBackground : p.buttonActiveColor,
415
- backgroundColor: R ? p.buttonActiveColor : "transparent",
416
- borderColor: p.buttonActiveColor,
417
- opacity: R ? 1 : 0.55
414
+ color: A ? T.controlBarBackground : T.buttonActiveColor,
415
+ backgroundColor: A ? T.buttonActiveColor : "transparent",
416
+ borderColor: T.buttonActiveColor,
417
+ opacity: A ? 1 : 0.55
418
418
  },
419
- onMouseEnter: (i) => {
420
- i.currentTarget.style.opacity = "1";
419
+ onMouseEnter: (c) => {
420
+ c.currentTarget.style.opacity = "1";
421
421
  },
422
- onMouseLeave: (i) => {
423
- i.currentTarget.style.opacity = R ? "1" : "0.55";
422
+ onMouseLeave: (c) => {
423
+ c.currentTarget.style.opacity = A ? "1" : "0.55";
424
424
  },
425
- title: R ? w.liveActiveTooltip : w.liveTooltip,
426
- children: R ? w.liveActiveLabel : w.liveLabel
425
+ title: A ? s.liveActiveTooltip : s.liveTooltip,
426
+ children: A ? s.liveActiveLabel : s.liveLabel
427
427
  }
428
428
  ),
429
- /* @__PURE__ */ l.jsx("div", { style: { height: "20px", display: "flex", alignItems: "center" }, children: !P && /* @__PURE__ */ l.jsx(
429
+ /* @__PURE__ */ i.jsx("div", { style: { height: "20px", display: "flex", alignItems: "center" }, children: !he && /* @__PURE__ */ i.jsx(
430
430
  "button",
431
431
  {
432
- onClick: () => B(),
432
+ onClick: () => Z(),
433
433
  style: {
434
- ...H,
434
+ ...z,
435
435
  fontSize: "11px",
436
- color: p.buttonActiveColor,
437
- borderColor: `${p.buttonActiveColor}44`,
436
+ color: T.buttonActiveColor,
437
+ borderColor: `${T.buttonActiveColor}44`,
438
438
  width: "52px",
439
439
  minWidth: "52px",
440
440
  height: "20px"
441
441
  },
442
- onMouseEnter: (i) => k(i, !0),
443
- onMouseLeave: S,
444
- title: w.resetSpeedTooltip,
445
- children: u ? `◀ ${y}×` : `${y}× ▶`
442
+ onMouseEnter: (c) => S(c, !0),
443
+ onMouseLeave: L,
444
+ title: s.resetSpeedTooltip,
445
+ children: X ? `◀ ${ee}×` : `${ee}× ▶`
446
446
  }
447
447
  ) })
448
448
  ] })
449
449
  ] }),
450
- /* @__PURE__ */ l.jsxs("div", { style: { display: "flex", alignItems: "center", gap: "2px", ...X ? { flex: 1, justifyContent: "center" } : {} }, children: [
451
- z && /* @__PURE__ */ l.jsx(
450
+ /* @__PURE__ */ i.jsxs("div", { style: { display: "flex", alignItems: "center", gap: "2px", ...R ? { flex: 1, justifyContent: "center" } : {} }, children: [
451
+ ae && /* @__PURE__ */ i.jsx(
452
452
  "button",
453
453
  {
454
- onClick: F ? W : void 0,
455
- disabled: !F,
456
- style: { ...D(!1), opacity: F ? 1 : 0.3, cursor: F ? "pointer" : "default" },
457
- onMouseEnter: F ? (i) => k(i, !1) : void 0,
458
- onMouseLeave: F ? S : void 0,
459
- title: F ? w.jumpToStartTooltip : w.noStartTimeTooltip,
454
+ onClick: O ? K : void 0,
455
+ disabled: !O,
456
+ style: { ...W(!1), opacity: O ? 1 : 0.3, cursor: O ? "pointer" : "default" },
457
+ onMouseEnter: O ? (c) => S(c, !1) : void 0,
458
+ onMouseLeave: O ? L : void 0,
459
+ title: O ? s.jumpToStartTooltip : s.noStartTimeTooltip,
460
460
  children: "⏮"
461
461
  }
462
462
  ),
463
- /* @__PURE__ */ l.jsx(
463
+ /* @__PURE__ */ i.jsx(
464
464
  "button",
465
465
  {
466
- onClick: ne,
467
- style: { ...D(u), width: "64px", minWidth: "64px", gap: "3px" },
468
- onMouseEnter: (i) => k(i, u),
469
- onMouseLeave: S,
470
- title: u ? Ie(w.rewindActiveTooltip, y) : w.rewindTooltip,
471
- children: u ? /* @__PURE__ */ l.jsxs(l.Fragment, { children: [
472
- /* @__PURE__ */ l.jsxs("span", { style: { fontSize: "11px", fontWeight: "bold" }, children: [
473
- y,
466
+ onClick: G,
467
+ style: { ...W(X), width: "64px", minWidth: "64px", gap: "3px" },
468
+ onMouseEnter: (c) => S(c, X),
469
+ onMouseLeave: L,
470
+ title: X ? Ye(s.rewindActiveTooltip, ee) : s.rewindTooltip,
471
+ children: X ? /* @__PURE__ */ i.jsxs(i.Fragment, { children: [
472
+ /* @__PURE__ */ i.jsxs("span", { style: { fontSize: "11px", fontWeight: "bold" }, children: [
473
+ ee,
474
474
  "×"
475
475
  ] }),
476
476
  "◀◀"
477
477
  ] }) : "◀◀"
478
478
  }
479
479
  ),
480
- /* @__PURE__ */ l.jsx(
480
+ /* @__PURE__ */ i.jsx(
481
481
  "button",
482
482
  {
483
- onClick: () => U(!L),
483
+ onClick: () => q(!I),
484
484
  style: {
485
- ...H,
486
- color: p.buttonActiveColor,
485
+ ...z,
486
+ color: T.buttonActiveColor,
487
487
  fontSize: "18px",
488
488
  width: "40px",
489
489
  minWidth: "40px",
490
490
  height: "40px",
491
- borderColor: `${p.buttonActiveColor}55`,
491
+ borderColor: `${T.buttonActiveColor}55`,
492
492
  borderRadius: "50%",
493
- paddingLeft: L ? "0" : "2px"
493
+ paddingLeft: I ? "0" : "2px"
494
494
  },
495
- onMouseEnter: (i) => k(i, !0),
496
- onMouseLeave: S,
497
- title: L ? w.pauseTooltip : u ? w.playFromRewindTooltip : w.playTooltip,
498
- children: L ? /* @__PURE__ */ l.jsx(gt, {}) : "▶"
495
+ onMouseEnter: (c) => S(c, !0),
496
+ onMouseLeave: L,
497
+ title: I ? s.pauseTooltip : X ? s.playFromRewindTooltip : s.playTooltip,
498
+ children: I ? /* @__PURE__ */ i.jsx(yt, {}) : "▶"
499
499
  }
500
500
  ),
501
- /* @__PURE__ */ l.jsx(
501
+ /* @__PURE__ */ i.jsx(
502
502
  "button",
503
503
  {
504
- onClick: V,
505
- style: { ...D(v), width: "64px", minWidth: "64px", gap: "3px" },
506
- onMouseEnter: (i) => k(i, v),
507
- onMouseLeave: S,
508
- title: v ? Ie(w.fastForwardActiveTooltip, y) : w.fastForwardTooltip,
509
- children: v ? /* @__PURE__ */ l.jsxs(l.Fragment, { children: [
504
+ onClick: Y,
505
+ style: { ...W(Q), width: "64px", minWidth: "64px", gap: "3px" },
506
+ onMouseEnter: (c) => S(c, Q),
507
+ onMouseLeave: L,
508
+ title: Q ? Ye(s.fastForwardActiveTooltip, ee) : s.fastForwardTooltip,
509
+ children: Q ? /* @__PURE__ */ i.jsxs(i.Fragment, { children: [
510
510
  "▶▶",
511
- /* @__PURE__ */ l.jsxs("span", { style: { fontSize: "11px", fontWeight: "bold" }, children: [
512
- y,
511
+ /* @__PURE__ */ i.jsxs("span", { style: { fontSize: "11px", fontWeight: "bold" }, children: [
512
+ ee,
513
513
  "×"
514
514
  ] })
515
515
  ] }) : "▶▶"
516
516
  }
517
517
  ),
518
- _ && /* @__PURE__ */ l.jsx(
518
+ J && /* @__PURE__ */ i.jsx(
519
519
  "button",
520
520
  {
521
- onClick: O ? Z : void 0,
522
- disabled: !O,
523
- style: { ...D(!1), opacity: O ? 1 : 0.3, cursor: O ? "pointer" : "default" },
524
- onMouseEnter: O ? (i) => k(i, !1) : void 0,
525
- onMouseLeave: O ? S : void 0,
526
- title: O ? w.jumpToEndTooltip : w.noEndTimeTooltip,
521
+ onClick: N ? oe : void 0,
522
+ disabled: !N,
523
+ style: { ...W(!1), opacity: N ? 1 : 0.3, cursor: N ? "pointer" : "default" },
524
+ onMouseEnter: N ? (c) => S(c, !1) : void 0,
525
+ onMouseLeave: N ? L : void 0,
526
+ title: N ? s.jumpToEndTooltip : s.noEndTimeTooltip,
527
527
  children: "⏭"
528
528
  }
529
529
  )
530
530
  ] }),
531
- !X && /* @__PURE__ */ l.jsx("div", { style: { display: "flex", justifyContent: "flex-end", alignItems: "center" }, children: $ != null && g != null && /* @__PURE__ */ l.jsx(
531
+ !R && /* @__PURE__ */ i.jsx("div", { style: { display: "flex", justifyContent: "flex-end", alignItems: "center" }, children: M != null && g != null && /* @__PURE__ */ i.jsx(
532
532
  "button",
533
533
  {
534
- onClick: $,
534
+ onClick: M,
535
535
  style: {
536
- ...H,
537
- color: p.buttonActiveColor,
538
- borderColor: `${p.buttonActiveColor}33`
536
+ ...z,
537
+ color: T.buttonActiveColor,
538
+ borderColor: `${T.buttonActiveColor}33`
539
539
  },
540
- onMouseEnter: (i) => k(i, g),
541
- onMouseLeave: S,
542
- title: g ? w.collapseSwimLanesTooltip : w.expandSwimLanesTooltip,
543
- children: g ? /* @__PURE__ */ l.jsx(Ye, {}) : /* @__PURE__ */ l.jsx(ze, {})
540
+ onMouseEnter: (c) => S(c, g),
541
+ onMouseLeave: L,
542
+ title: g ? s.collapseSwimLanesTooltip : s.expandSwimLanesTooltip,
543
+ children: g ? /* @__PURE__ */ i.jsx(Ue, {}) : /* @__PURE__ */ i.jsx(qe, {})
544
544
  }
545
545
  ) }),
546
- X && $ != null && g != null && /* @__PURE__ */ l.jsx(
546
+ R && M != null && g != null && /* @__PURE__ */ i.jsx(
547
547
  "button",
548
548
  {
549
- onClick: $,
549
+ onClick: M,
550
550
  style: {
551
- ...H,
552
- color: p.buttonActiveColor,
553
- borderColor: `${p.buttonActiveColor}33`,
551
+ ...z,
552
+ color: T.buttonActiveColor,
553
+ borderColor: `${T.buttonActiveColor}33`,
554
554
  marginLeft: "4px"
555
555
  },
556
- onMouseEnter: (i) => k(i, g),
557
- onMouseLeave: S,
558
- title: g ? w.collapseSwimLanesTooltip : w.expandSwimLanesTooltip,
559
- children: g ? /* @__PURE__ */ l.jsx(Ye, {}) : /* @__PURE__ */ l.jsx(ze, {})
556
+ onMouseEnter: (c) => S(c, g),
557
+ onMouseLeave: L,
558
+ title: g ? s.collapseSwimLanesTooltip : s.expandSwimLanesTooltip,
559
+ children: g ? /* @__PURE__ */ i.jsx(Ue, {}) : /* @__PURE__ */ i.jsx(qe, {})
560
560
  }
561
561
  )
562
562
  ]
563
563
  }
564
564
  );
565
- }, He = Ge(
566
- (A, L) => {
565
+ }, Ze = tt(
566
+ (j, I) => {
567
567
  const {
568
- currentTime: Y,
569
- defaultStartMs: a,
570
- defaultEndMs: M,
571
- theme: R,
572
- maxTicks: F,
573
- timezone: O,
574
- onTimeChange: z,
575
- onDragStart: _,
576
- onDragEnd: U,
577
- swimLanes: W,
578
- showSwimLanes: ne,
579
- onSwimLaneItemClick: V,
568
+ currentTime: U,
569
+ defaultStartMs: l,
570
+ defaultEndMs: C,
571
+ theme: A,
572
+ maxTicks: O,
573
+ timezone: N,
574
+ dateTimeFormat: ae,
575
+ months: J,
576
+ onTimeChange: q,
577
+ onDragStart: K,
578
+ onDragEnd: G,
579
+ swimLanes: Y,
580
+ showSwimLanes: oe,
581
+ onSwimLaneItemClick: se,
580
582
  onSwimLaneItemHover: Z,
581
- onSwimLaneItemDoubleClick: Q,
582
- onSwimLaneItemContextMenu: B,
583
- onSwimLaneReorder: ee
584
- } = A, p = b(null), g = b(R), $ = b(F), K = b(O), u = b(a), v = b(M), P = b(j.JulianDate.toDate(Y).getTime());
585
- J(() => {
586
- g.current = R;
587
- }, [R]), J(() => {
588
- $.current = F;
589
- }, [F]), J(() => {
590
- K.current = O, h();
591
- }, [O]);
592
- const y = b(W ?? []), w = b(ne ?? (W != null && W.length > 0)), re = b(0), X = b(null), te = b(null), H = b(V), D = b(Z), k = b(Q), S = b(B), i = b(ee);
593
- J(() => {
594
- H.current = V;
595
- }, [V]), J(() => {
596
- D.current = Z;
597
- }, [Z]), J(() => {
598
- k.current = Q;
599
- }, [Q]), J(() => {
600
- S.current = B;
601
- }, [B]), J(() => {
602
- i.current = ee;
603
- }, [ee]), J(() => {
604
- y.current = W ?? [], h();
605
- }, [W]), J(() => {
606
- w.current = ne ?? (W != null && W.length > 0), h();
607
- }, [ne, W]);
608
- const C = b(null), q = b(null), t = b(!1), d = b(0), x = b("none"), E = b(0), ce = b(0), pe = b(0), T = b("none"), oe = b(0), ae = b(0), xe = (e, n) => Math.hypot(n.clientX - e.clientX, n.clientY - e.clientY), fe = se(() => ({
609
- startMs: u.current,
610
- endMs: v.current,
611
- currentMs: P.current,
612
- theme: g.current,
613
- maxTicks: $.current,
614
- timezone: K.current,
615
- swimLanes: y.current,
616
- showSwimLanes: w.current,
617
- scrollTop: re.current,
618
- reorderState: te.current
583
+ onSwimLaneItemDoubleClick: ce,
584
+ onSwimLaneItemContextMenu: T,
585
+ onSwimLaneReorder: g
586
+ } = j, M = x(null), ne = x(A), X = x(O), Q = x(N), he = x(ae), ee = x(J), s = x(l), y = x(C), R = x(_.JulianDate.toDate(U).getTime());
587
+ P(() => {
588
+ ne.current = A;
589
+ }, [A]), P(() => {
590
+ X.current = O;
591
+ }, [O]), P(() => {
592
+ Q.current = N, m();
593
+ }, [N]), P(() => {
594
+ he.current = ae, m();
595
+ }, [ae]), P(() => {
596
+ ee.current = J, m();
597
+ }, [J]);
598
+ const k = x(Y ?? []), z = x(oe ?? (Y != null && Y.length > 0)), W = x(0), S = x(null), L = x(null), c = x(se), w = x(Z), ie = x(ce), t = x(T), u = x(g);
599
+ P(() => {
600
+ c.current = se;
601
+ }, [se]), P(() => {
602
+ w.current = Z;
603
+ }, [Z]), P(() => {
604
+ ie.current = ce;
605
+ }, [ce]), P(() => {
606
+ t.current = T;
607
+ }, [T]), P(() => {
608
+ u.current = g;
609
+ }, [g]), P(() => {
610
+ k.current = Y ?? [], m();
611
+ }, [Y]), P(() => {
612
+ z.current = oe ?? (Y != null && Y.length > 0), m();
613
+ }, [oe, Y]);
614
+ const v = x(null), E = x(null), de = x(!1), be = x(0), b = x("none"), re = x(0), pe = x(0), ye = x(0), xe = x("none"), Re = x(0), ve = x(0), B = x(0), De = x(0), Te = (e, n) => Math.hypot(n.clientX - e.clientX, n.clientY - e.clientY), me = le(() => ({
615
+ startMs: s.current,
616
+ endMs: y.current,
617
+ currentMs: R.current,
618
+ theme: ne.current,
619
+ maxTicks: X.current,
620
+ timezone: Q.current,
621
+ use12h: /h/.test(he.current ?? ""),
622
+ months: ee.current,
623
+ swimLanes: k.current,
624
+ showSwimLanes: z.current,
625
+ scrollTop: W.current,
626
+ reorderState: L.current
619
627
  }), []);
620
- Ve(L, () => ({
621
- zoomTo(e, n, r) {
622
- const c = Math.max(it, Math.min(lt, n - e)), o = (e + n) / 2;
623
- u.current = o - c / 2, v.current = o + c / 2, r !== void 0 && (P.current = r), h();
628
+ nt(I, () => ({
629
+ zoomTo(e, n, o) {
630
+ const f = Math.max(pt, Math.min(mt, n - e)), r = (e + n) / 2;
631
+ s.current = r - f / 2, y.current = r + f / 2, o !== void 0 && (R.current = o), m();
624
632
  },
625
633
  getVisibleRange() {
626
- return { startMs: u.current, endMs: v.current };
634
+ return { startMs: s.current, endMs: y.current };
627
635
  },
628
636
  startFollow(e) {
629
- if (d.current = e, q.current !== null) return;
630
- t.current = !0;
637
+ if (be.current = e, E.current !== null) return;
638
+ de.current = !0;
631
639
  let n = performance.now();
632
- const r = () => {
633
- const c = performance.now(), o = c - n;
634
- n = c;
635
- const s = o * d.current;
636
- u.current += s, v.current += s, P.current += s, h(), q.current = requestAnimationFrame(r);
640
+ const o = () => {
641
+ const f = performance.now(), r = f - n;
642
+ n = f;
643
+ const d = r * be.current;
644
+ s.current += d, y.current += d, R.current += d, m(), E.current = requestAnimationFrame(o);
637
645
  };
638
- q.current = requestAnimationFrame(r);
646
+ E.current = requestAnimationFrame(o);
639
647
  },
640
648
  stopFollow() {
641
- t.current = !1, q.current !== null && (cancelAnimationFrame(q.current), q.current = null);
649
+ de.current = !1, E.current !== null && (cancelAnimationFrame(E.current), E.current = null);
642
650
  },
643
651
  correctFollow(e) {
644
- if (!t.current) return;
645
- const n = e - P.current;
646
- P.current = e, u.current += n, v.current += n;
652
+ if (!de.current) return;
653
+ const n = e - R.current;
654
+ R.current = e, s.current += n, y.current += n;
647
655
  },
648
656
  // ── Swim lane CRUD ──────────────────────────────────────────────
649
657
  appendSwimLane(e) {
650
- y.current = [...y.current, e], h();
658
+ k.current = [...k.current, e], m();
651
659
  },
652
660
  updateSwimLane(e, n) {
653
- y.current = y.current.map(
654
- (r) => r.id === e ? { ...r, ...n, id: r.id } : r
655
- ), h();
661
+ k.current = k.current.map(
662
+ (o) => o.id === e ? { ...o, ...n, id: o.id } : o
663
+ ), m();
656
664
  },
657
665
  removeSwimLane(e) {
658
- y.current = y.current.filter((n) => n.id !== e), h();
666
+ k.current = k.current.filter((n) => n.id !== e), m();
659
667
  },
660
668
  reorderSwimLanes(e) {
661
- const n = new Map(y.current.map((c) => [c.id, c])), r = [];
662
- for (const c of e) {
663
- const o = n.get(c);
664
- o && r.push(o);
669
+ const n = new Map(k.current.map((f) => [f.id, f])), o = [];
670
+ for (const f of e) {
671
+ const r = n.get(f);
672
+ r && o.push(r);
665
673
  }
666
- y.current = r, h();
674
+ k.current = o, m();
667
675
  }
668
676
  }));
669
- const h = se(() => {
670
- const e = p.current;
677
+ const m = le(() => {
678
+ const e = M.current;
671
679
  if (!e) return;
672
680
  const n = e.getContext("2d");
673
681
  if (!n) return;
674
- const r = e.getBoundingClientRect(), c = r.width, o = r.height;
675
- if (c === 0 || o === 0) return;
676
- const s = window.devicePixelRatio || 1, f = Math.round(c * s), m = Math.round(o * s);
677
- (e.width !== f || e.height !== m) && (e.width = f, e.height = m), n.save(), n.scale(s, s);
678
- const I = tt(n, c, o, fe());
679
- I !== re.current && (re.current = I), n.restore();
680
- }, [fe]);
681
- Ke(() => {
682
- h();
683
- const e = p.current;
682
+ const o = e.getBoundingClientRect(), f = o.width, r = o.height;
683
+ if (f === 0 || r === 0) return;
684
+ const d = window.devicePixelRatio || 1, h = Math.round(f * d), p = Math.round(r * d);
685
+ (e.width !== h || e.height !== p) && (e.width = h, e.height = p), n.save(), n.scale(d, d);
686
+ const F = it(n, f, r, me());
687
+ F !== W.current && (W.current = F), n.restore();
688
+ }, [me]);
689
+ rt(() => {
690
+ m();
691
+ const e = M.current;
684
692
  if (!e) return;
685
- const n = new ResizeObserver(() => h());
693
+ const n = new ResizeObserver(() => m());
686
694
  return n.observe(e), () => n.disconnect();
687
- }, [h]), J(() => {
688
- if (t.current) return;
689
- const e = j.JulianDate.toDate(Y).getTime();
690
- P.current !== e && (P.current = e, h());
691
- }, [Y, h]);
692
- const le = se((e) => {
693
- if (C.current !== null) return;
695
+ }, [m]), P(() => {
696
+ if (de.current) return;
697
+ const e = _.JulianDate.toDate(U).getTime();
698
+ R.current !== e && (R.current = e, m());
699
+ }, [U, m]);
700
+ const we = le((e) => {
701
+ if (v.current !== null) return;
694
702
  const n = () => {
695
- const r = p.current, c = v.current - u.current, o = e * c * 0.01;
696
- if (u.current += o, v.current += o, r) {
697
- const s = r.getBoundingClientRect(), f = Math.max(0, Math.min(s.width, ce.current - s.left)), m = u.current + f / s.width * (v.current - u.current);
698
- P.current = m, z(j.JulianDate.fromDate(new Date(m)));
703
+ const o = M.current, f = y.current - s.current, r = e * f * 0.01;
704
+ if (s.current += r, y.current += r, o) {
705
+ const d = o.getBoundingClientRect(), h = Math.max(0, Math.min(d.width, pe.current - d.left)), p = s.current + h / d.width * (y.current - s.current);
706
+ R.current = p, q(_.JulianDate.fromDate(new Date(p)));
699
707
  }
700
- h(), C.current = requestAnimationFrame(n);
708
+ m(), v.current = requestAnimationFrame(n);
701
709
  };
702
- C.current = requestAnimationFrame(n);
703
- }, [h, z]), N = se(() => {
704
- C.current !== null && (cancelAnimationFrame(C.current), C.current = null);
705
- }, []), ie = se((e, n, r, c) => nt(e, n, r, c, fe()), [fe]), ue = se((e, n, r) => rt(e, n, r, fe()), [fe]), me = se((e, n) => ot(e, n, fe()), [fe]), Re = se((e) => {
710
+ v.current = requestAnimationFrame(n);
711
+ }, [m, q]), Ee = le(() => {
712
+ v.current !== null && (cancelAnimationFrame(v.current), v.current = null);
713
+ }, []), fe = le((e, n, o, f) => ut(e, n, o, f, me()), [me]), Ce = le((e, n, o) => lt(e, n, o, me()), [me]), Me = le((e, n) => at(e, n, me()), [me]), Ie = le((e) => {
706
714
  e.preventDefault();
707
- const n = e.currentTarget.getBoundingClientRect(), r = e.clientX - n.left, c = e.clientY - n.top;
708
- if (e.button === 0 && i.current) {
709
- const o = ue(r, c, n.height);
710
- if (o) {
711
- const f = y.current.findIndex((m) => m.id === o.id);
712
- te.current = {
715
+ const n = e.currentTarget.getBoundingClientRect(), o = e.clientX - n.left, f = e.clientY - n.top;
716
+ if (e.button === 0 && u.current) {
717
+ const r = Ce(o, f, n.height);
718
+ if (r) {
719
+ const h = k.current.findIndex((p) => p.id === r.id);
720
+ L.current = {
713
721
  dragging: !0,
714
- dragLaneId: o.id,
722
+ dragLaneId: r.id,
715
723
  dragStartY: e.clientY,
716
724
  currentY: e.clientY,
717
- insertIndex: f
725
+ insertIndex: h
718
726
  }, e.currentTarget.style.cursor = "grabbing";
719
727
  return;
720
728
  }
721
729
  }
722
- if (e.button === 0 && me(c, n.height)) {
723
- const o = (P.current - u.current) / (v.current - u.current) * n.width;
724
- if (!(Math.abs(r - o) <= 10) && ie(r, c, n.width, n.height)) {
725
- pe.current = performance.now();
730
+ if (e.button === 0 && Me(f, n.height)) {
731
+ const r = (R.current - s.current) / (y.current - s.current) * n.width;
732
+ if (!(Math.abs(o - r) <= 10) && fe(o, f, n.width, n.height)) {
733
+ ye.current = performance.now();
726
734
  return;
727
735
  }
728
736
  }
729
737
  if (e.button === 0) {
730
- x.current = "scrub", ce.current = e.clientX, e.currentTarget.style.cursor = "grabbing", _ == null || _();
731
- const o = u.current + r / n.width * (v.current - u.current);
732
- P.current = o, h(), z(j.JulianDate.fromDate(new Date(o)));
738
+ b.current = "scrub", pe.current = e.clientX, e.currentTarget.style.cursor = "grabbing", K == null || K();
739
+ const r = s.current + o / n.width * (y.current - s.current);
740
+ R.current = r, m(), q(_.JulianDate.fromDate(new Date(r)));
733
741
  } else if (e.button === 1)
734
- x.current = "slide", E.current = e.clientX;
742
+ b.current = "slide", re.current = e.clientX;
735
743
  else if (e.button === 2) {
736
- if (S.current && me(c, n.height))
744
+ if (t.current && Me(f, n.height))
737
745
  return;
738
- x.current = "zoom", E.current = e.clientX;
746
+ b.current = "zoom", re.current = e.clientX;
739
747
  }
740
- }, [h, z, _, ue, me, ie]);
741
- J(() => {
742
- const e = (r) => {
743
- const c = te.current;
744
- if (c && c.dragging) {
745
- c.currentY = r.clientY;
746
- const m = p.current;
747
- if (m) {
748
- const I = m.getBoundingClientRect(), G = r.clientY - I.top;
749
- let Ee = -re.current;
750
- const je = y.current;
751
- let Le = je.length;
752
- for (let ye = 0; ye < je.length; ye++) {
753
- const ke = je[ye].height ?? Oe, Ue = Ee + ke / 2;
754
- if (G < Ue) {
755
- Le = ye;
748
+ }, [m, q, K, Ce, Me, fe]);
749
+ P(() => {
750
+ const e = (o) => {
751
+ const f = L.current;
752
+ if (f && f.dragging) {
753
+ f.currentY = o.clientY;
754
+ const p = M.current;
755
+ if (p) {
756
+ const F = p.getBoundingClientRect(), V = o.clientY - F.top;
757
+ let Le = -W.current;
758
+ const Oe = k.current;
759
+ let Pe = Oe.length;
760
+ for (let ke = 0; ke < Oe.length; ke++) {
761
+ const Ne = Oe[ke].height ?? ze, Qe = Le + Ne / 2;
762
+ if (V < Qe) {
763
+ Pe = ke;
756
764
  break;
757
765
  }
758
- Ee += ke + Pe;
766
+ Le += Ne + We;
759
767
  }
760
- c.insertIndex = Le;
768
+ f.insertIndex = Pe;
761
769
  }
762
- h();
770
+ m();
763
771
  return;
764
772
  }
765
- if (x.current === "none") return;
766
- const o = p.current;
767
- if (!o) return;
768
- const s = o.getBoundingClientRect(), f = s.width;
769
- if (x.current === "scrub") {
770
- ce.current = r.clientX;
771
- const m = r.clientX - s.left, I = f * 0.08;
772
- m < I ? le(-1) : m > f - I ? le(1) : N();
773
- const G = Math.max(0, Math.min(f, m)), de = u.current + G / f * (v.current - u.current);
774
- P.current = de, h(), z(j.JulianDate.fromDate(new Date(de)));
775
- } else if (x.current === "slide") {
776
- const m = E.current - r.clientX;
777
- if (E.current = r.clientX, m !== 0) {
778
- const I = m / f * (v.current - u.current);
779
- u.current += I, v.current += I, h();
773
+ if (b.current === "none") return;
774
+ const r = M.current;
775
+ if (!r) return;
776
+ const d = r.getBoundingClientRect(), h = d.width;
777
+ if (b.current === "scrub") {
778
+ pe.current = o.clientX;
779
+ const p = o.clientX - d.left, F = h * 0.08;
780
+ p < F ? we(-1) : p > h - F ? we(1) : Ee();
781
+ const V = Math.max(0, Math.min(h, p)), ge = s.current + V / h * (y.current - s.current);
782
+ R.current = ge, m(), q(_.JulianDate.fromDate(new Date(ge)));
783
+ } else if (b.current === "slide") {
784
+ const p = re.current - o.clientX;
785
+ if (re.current = o.clientX, p !== 0) {
786
+ const F = p / h * (y.current - s.current);
787
+ s.current += F, y.current += F, m();
780
788
  }
781
- } else if (x.current === "zoom") {
782
- const m = E.current - r.clientX;
783
- E.current = r.clientX, m !== 0 && he(Math.pow(1.01, m));
789
+ } else if (b.current === "zoom") {
790
+ const p = re.current - o.clientX;
791
+ re.current = o.clientX, p !== 0 && a(Math.pow(1.01, p));
784
792
  }
785
793
  }, n = () => {
786
- var c;
787
- const r = te.current;
788
- if (r && r.dragging) {
789
- const o = Math.abs(r.currentY - r.dragStartY), s = y.current, f = s.findIndex((m) => m.id === r.dragLaneId);
790
- if (o > 5 && f >= 0 && r.insertIndex !== f && r.insertIndex !== f + 1) {
791
- const m = [...s], [I] = m.splice(f, 1), G = r.insertIndex > f ? r.insertIndex - 1 : r.insertIndex;
792
- m.splice(G, 0, I), y.current = m, (c = i.current) == null || c.call(i, m.map((de) => de.id));
794
+ var f;
795
+ const o = L.current;
796
+ if (o && o.dragging) {
797
+ const r = Math.abs(o.currentY - o.dragStartY), d = k.current, h = d.findIndex((p) => p.id === o.dragLaneId);
798
+ if (r > 5 && h >= 0 && o.insertIndex !== h && o.insertIndex !== h + 1) {
799
+ const p = [...d], [F] = p.splice(h, 1), V = o.insertIndex > h ? o.insertIndex - 1 : o.insertIndex;
800
+ p.splice(V, 0, F), k.current = p, (f = u.current) == null || f.call(u, p.map((ge) => ge.id));
793
801
  }
794
- te.current = null, p.current && (p.current.style.cursor = "default"), h();
802
+ L.current = null, M.current && (M.current.style.cursor = "default"), m();
795
803
  return;
796
804
  }
797
- N(), x.current = "none", p.current && (p.current.style.cursor = "default"), U == null || U();
805
+ Ee(), b.current = "none", M.current && (M.current.style.cursor = "default"), G == null || G();
798
806
  };
799
807
  return document.addEventListener("mousemove", e), document.addEventListener("mouseup", n), () => {
800
808
  document.removeEventListener("mousemove", e), document.removeEventListener("mouseup", n);
801
809
  };
802
- }, [h, z, U, le, N]);
803
- const he = se((e) => {
804
- const n = st(u.current, v.current, e);
805
- u.current = n.startMs, v.current = n.endMs, h();
806
- }, [h]), be = se((e) => {
810
+ }, [m, q, G, we, Ee]);
811
+ const a = le((e) => {
812
+ const n = dt(s.current, y.current, e);
813
+ s.current = n.startMs, y.current = n.endMs, m();
814
+ }, [m]), D = le((e) => {
807
815
  e.preventDefault();
808
- const n = p.current;
816
+ const n = M.current;
809
817
  if (!n) return;
810
- const r = n.getBoundingClientRect(), c = e.clientY - r.top, o = w.current, s = y.current;
811
- if (o && s.length > 0) {
812
- const f = Math.max(0, r.height - $e);
813
- if (c >= 0 && c < f) {
814
- let m = 0;
815
- for (const G of s) m += (G.height ?? Oe) + Pe;
816
- const I = Math.max(0, m - f);
817
- if (I > 0) {
818
- re.current = Math.max(0, Math.min(I, re.current + e.deltaY * ct)), h();
818
+ const o = n.getBoundingClientRect(), f = e.clientY - o.top, r = z.current, d = k.current;
819
+ if (r && d.length > 0) {
820
+ const h = Math.max(0, o.height - Ke);
821
+ if (f >= 0 && f < h) {
822
+ let p = 0;
823
+ for (const V of d) p += (V.height ?? ze) + We;
824
+ const F = Math.max(0, p - h);
825
+ if (F > 0) {
826
+ W.current = Math.max(0, Math.min(F, W.current + e.deltaY * ft)), m();
819
827
  return;
820
828
  }
821
829
  }
822
830
  }
823
- he(Math.pow(1.05, e.deltaY > 0 ? -1 : 1));
824
- }, [he, h]);
825
- J(() => {
826
- const e = p.current;
831
+ a(Math.pow(1.05, e.deltaY > 0 ? -1 : 1));
832
+ }, [a, m]);
833
+ P(() => {
834
+ const e = M.current;
827
835
  if (e)
828
- return e.addEventListener("wheel", be, { passive: !1 }), () => e.removeEventListener("wheel", be);
829
- }, [be]), J(() => {
830
- const e = p.current;
836
+ return e.addEventListener("wheel", D, { passive: !1 }), () => e.removeEventListener("wheel", D);
837
+ }, [D]), P(() => {
838
+ const e = M.current;
831
839
  if (!e) return;
832
- const n = (o) => {
833
- o.preventDefault();
834
- const s = e.getBoundingClientRect();
835
- if (o.touches.length === 1) {
836
- const f = o.touches[0].clientX - s.left, m = Math.max(0, Math.min(s.width, f)), I = u.current + m / s.width * (v.current - u.current);
837
- T.current = "scrub", oe.current = o.touches[0].clientX, ce.current = o.touches[0].clientX, P.current = I, h(), _ == null || _(), z(j.JulianDate.fromDate(new Date(I)));
838
- } else o.touches.length >= 2 && (T.current = "pinch", ae.current = xe(o.touches[0], o.touches[1]));
839
- }, r = (o) => {
840
- o.preventDefault();
841
- const s = e.getBoundingClientRect();
842
- if (T.current === "scrub" && o.touches.length >= 1) {
843
- const f = o.touches[0].clientX - s.left, m = s.width * 0.08;
844
- if (ce.current = o.touches[0].clientX, f < m) le(-1);
845
- else if (f > s.width - m) le(1);
840
+ const n = (r) => {
841
+ r.preventDefault();
842
+ const d = e.getBoundingClientRect();
843
+ if (r.touches.length === 1) {
844
+ const h = r.touches[0].clientX - d.left, p = Math.max(0, Math.min(d.width, h)), F = s.current + p / d.width * (y.current - s.current);
845
+ De.current = R.current, xe.current = "scrub", Re.current = r.touches[0].clientX, pe.current = r.touches[0].clientX, R.current = F, m(), K == null || K(), q(_.JulianDate.fromDate(new Date(F)));
846
+ } else r.touches.length >= 2 && (xe.current === "scrub" && (R.current = De.current, m(), q(_.JulianDate.fromDate(new Date(De.current)))), xe.current = "pinch", ve.current = Te(r.touches[0], r.touches[1]), B.current = (r.touches[0].clientX + r.touches[1].clientX) / 2 - d.left);
847
+ }, o = (r) => {
848
+ r.preventDefault();
849
+ const d = e.getBoundingClientRect();
850
+ if (xe.current === "scrub" && r.touches.length >= 1) {
851
+ const h = r.touches[0].clientX - d.left, p = d.width * 0.08;
852
+ if (pe.current = r.touches[0].clientX, h < p) we(-1);
853
+ else if (h > d.width - p) we(1);
846
854
  else {
847
- N();
848
- const I = Math.max(0, Math.min(s.width, f)), G = u.current + I / s.width * (v.current - u.current);
849
- P.current = G, h(), z(j.JulianDate.fromDate(new Date(G)));
855
+ Ee();
856
+ const F = Math.max(0, Math.min(d.width, h)), V = s.current + F / d.width * (y.current - s.current);
857
+ R.current = V, m(), q(_.JulianDate.fromDate(new Date(V)));
850
858
  }
851
- } else if (T.current === "slide" && o.touches.length >= 1) {
852
- const f = oe.current - o.touches[0].clientX;
853
- if (oe.current = o.touches[0].clientX, f !== 0) {
854
- const m = f / s.width * (v.current - u.current);
855
- u.current += m, v.current += m, h();
859
+ } else if (xe.current === "slide" && r.touches.length >= 1) {
860
+ const h = Re.current - r.touches[0].clientX;
861
+ if (Re.current = r.touches[0].clientX, h !== 0) {
862
+ const p = h / d.width * (y.current - s.current);
863
+ s.current += p, y.current += p, m();
856
864
  }
857
- } else if (T.current === "pinch" && o.touches.length >= 2) {
858
- const f = xe(o.touches[0], o.touches[1]);
859
- f > 0 && ae.current > 0 && he(ae.current / f), ae.current = f;
865
+ } else if (xe.current === "pinch" && r.touches.length >= 2) {
866
+ const h = Te(r.touches[0], r.touches[1]), p = (r.touches[0].clientX + r.touches[1].clientX) / 2 - d.left;
867
+ if (h > 0 && ve.current > 0) {
868
+ const F = s.current + B.current / d.width * (y.current - s.current), V = ht(s.current, y.current, ve.current / h, F);
869
+ s.current = V.startMs, y.current = V.endMs, m();
870
+ }
871
+ ve.current = h, B.current = p;
860
872
  }
861
- }, c = (o) => {
862
- N(), T.current === "scrub" && (U == null || U()), o.touches.length === 0 ? T.current = "none" : o.touches.length === 1 && (T.current = "slide", oe.current = o.touches[0].clientX);
873
+ }, f = (r) => {
874
+ Ee(), xe.current === "scrub" && (G == null || G()), r.touches.length === 0 ? xe.current = "none" : r.touches.length === 1 && (xe.current = "slide", Re.current = r.touches[0].clientX);
863
875
  };
864
- return e.addEventListener("touchstart", n, { passive: !1 }), e.addEventListener("touchmove", r, { passive: !1 }), e.addEventListener("touchend", c, { passive: !1 }), () => {
865
- e.removeEventListener("touchstart", n), e.removeEventListener("touchmove", r), e.removeEventListener("touchend", c);
876
+ return e.addEventListener("touchstart", n, { passive: !1 }), e.addEventListener("touchmove", o, { passive: !1 }), e.addEventListener("touchend", f, { passive: !1 }), () => {
877
+ e.removeEventListener("touchstart", n), e.removeEventListener("touchmove", o), e.removeEventListener("touchend", f);
866
878
  };
867
- }, [h, _, U, z, he, le, N]);
868
- const De = se((e) => {
869
- var f, m, I;
870
- if (x.current !== "none") return;
871
- const n = e.currentTarget.getBoundingClientRect(), r = e.clientX - n.left, c = e.clientY - n.top, o = (P.current - u.current) / (v.current - u.current) * n.width, s = Math.abs(r - o) <= 10;
872
- if (me(c, n.height)) {
873
- const G = ie(r, c, n.width, n.height), de = X.current;
874
- if (G)
875
- e.currentTarget.style.cursor = s ? "grab" : "pointer", (!de || de.item.id !== G.item.id || de.lane.id !== G.lane.id) && (X.current = G, (f = D.current) == null || f.call(D, { laneId: G.lane.id, item: G.item, originalEvent: e.nativeEvent }), h());
876
- else if (de && (X.current = null, (m = D.current) == null || m.call(D, null), h()), s)
879
+ }, [m, K, G, q, a, we, Ee]);
880
+ const $ = le((e) => {
881
+ var h, p, F;
882
+ if (b.current !== "none") return;
883
+ const n = e.currentTarget.getBoundingClientRect(), o = e.clientX - n.left, f = e.clientY - n.top, r = (R.current - s.current) / (y.current - s.current) * n.width, d = Math.abs(o - r) <= 10;
884
+ if (Me(f, n.height)) {
885
+ const V = fe(o, f, n.width, n.height), ge = S.current;
886
+ if (V)
887
+ e.currentTarget.style.cursor = d ? "grab" : "pointer", (!ge || ge.item.id !== V.item.id || ge.lane.id !== V.lane.id) && (S.current = V, (h = w.current) == null || h.call(w, { laneId: V.lane.id, item: V.item, originalEvent: e.nativeEvent }), m());
888
+ else if (ge && (S.current = null, (p = w.current) == null || p.call(w, null), m()), d)
877
889
  e.currentTarget.style.cursor = "grab";
878
890
  else {
879
- const Ee = ue(r, c, n.height);
880
- e.currentTarget.style.cursor = Ee && i.current ? "grab" : "default";
891
+ const Le = Ce(o, f, n.height);
892
+ e.currentTarget.style.cursor = Le && u.current ? "grab" : "default";
881
893
  }
882
894
  return;
883
895
  }
884
- X.current && (X.current = null, (I = D.current) == null || I.call(D, null), h()), e.currentTarget.style.cursor = s ? "grab" : "default";
885
- }, [h, ie, me, ue]), Ce = se((e) => {
886
- var f;
887
- if (performance.now() - pe.current > 300) return;
888
- const r = e.currentTarget.getBoundingClientRect(), c = e.clientX - r.left, o = e.clientY - r.top, s = ie(c, o, r.width, r.height);
889
- s && ((f = H.current) == null || f.call(H, { laneId: s.lane.id, item: s.item, originalEvent: e.nativeEvent }));
890
- }, [ie]), Ae = se((e) => {
891
- var s;
892
- const n = e.currentTarget.getBoundingClientRect(), r = e.clientX - n.left, c = e.clientY - n.top, o = ie(r, c, n.width, n.height);
893
- o && ((s = k.current) == null || s.call(k, { laneId: o.lane.id, item: o.item, originalEvent: e.nativeEvent }));
894
- }, [ie]), _e = se((e) => {
895
- const n = e.currentTarget.getBoundingClientRect(), r = e.clientX - n.left, c = e.clientY - n.top, o = ie(r, c, n.width, n.height);
896
- o && S.current ? (e.preventDefault(), S.current({ laneId: o.lane.id, item: o.item, originalEvent: e.nativeEvent })) : e.preventDefault();
897
- }, [ie]);
898
- return J(() => () => {
899
- C.current !== null && cancelAnimationFrame(C.current), q.current !== null && cancelAnimationFrame(q.current);
900
- }, []), /* @__PURE__ */ l.jsx(
896
+ S.current && (S.current = null, (F = w.current) == null || F.call(w, null), m()), e.currentTarget.style.cursor = d ? "grab" : "default";
897
+ }, [m, fe, Me, Ce]), ue = le((e) => {
898
+ var h;
899
+ if (performance.now() - ye.current > 300) return;
900
+ const o = e.currentTarget.getBoundingClientRect(), f = e.clientX - o.left, r = e.clientY - o.top, d = fe(f, r, o.width, o.height);
901
+ d && ((h = c.current) == null || h.call(c, { laneId: d.lane.id, item: d.item, originalEvent: e.nativeEvent }));
902
+ }, [fe]), H = le((e) => {
903
+ var d;
904
+ const n = e.currentTarget.getBoundingClientRect(), o = e.clientX - n.left, f = e.clientY - n.top, r = fe(o, f, n.width, n.height);
905
+ r && ((d = ie.current) == null || d.call(ie, { laneId: r.lane.id, item: r.item, originalEvent: e.nativeEvent }));
906
+ }, [fe]), te = le((e) => {
907
+ const n = e.currentTarget.getBoundingClientRect(), o = e.clientX - n.left, f = e.clientY - n.top, r = fe(o, f, n.width, n.height);
908
+ r && t.current ? (e.preventDefault(), t.current({ laneId: r.lane.id, item: r.item, originalEvent: e.nativeEvent })) : e.preventDefault();
909
+ }, [fe]);
910
+ return P(() => () => {
911
+ v.current !== null && cancelAnimationFrame(v.current), E.current !== null && cancelAnimationFrame(E.current);
912
+ }, []), /* @__PURE__ */ i.jsx(
901
913
  "canvas",
902
914
  {
903
- ref: p,
915
+ ref: M,
904
916
  style: { width: "100%", flex: 1, minHeight: 0, display: "block", cursor: "default" },
905
- onMouseDown: Re,
906
- onMouseMove: De,
907
- onClick: Ce,
908
- onDoubleClick: Ae,
917
+ onMouseDown: Ie,
918
+ onMouseMove: $,
919
+ onClick: ue,
920
+ onDoubleClick: H,
909
921
  onMouseLeave: () => {
910
922
  var e;
911
- X.current && (X.current = null, (e = D.current) == null || e.call(D, null), h()), x.current === "none" && p.current && (p.current.style.cursor = "default");
923
+ S.current && (S.current = null, (e = w.current) == null || e.call(w, null), m()), b.current === "none" && M.current && (M.current.style.cursor = "default");
912
924
  },
913
- onContextMenu: _e
925
+ onContextMenu: te
914
926
  }
915
927
  );
916
928
  }
917
929
  );
918
- He.displayName = "TimelineCanvas";
919
- const We = [2, 4, 8, 16, 32, 100, 1], Be = [1, 2, 4, 8, 16, 32, 100], wt = ({
920
- startTime: A,
921
- endTime: L,
922
- currentTime: Y,
923
- clock: a,
924
- onTimeChange: M,
925
- onPlayPause: R,
926
- onMultiplierChange: F,
927
- height: O,
928
- showControls: z = !0,
929
- showJumpToStart: _,
930
- showJumpToEnd: U,
931
- enableDrag: W = !0,
932
- dateTimeFormat: ne,
933
- onDateTimeClick: V,
934
- jumpToTime: Z,
935
- maxTicks: Q,
936
- ffSpeeds: B = We,
937
- rwSpeeds: ee = Be,
938
- theme: p,
930
+ Ze.displayName = "TimelineCanvas";
931
+ const Ge = [2, 4, 8, 16, 32, 100, 1], Ve = [1, 2, 4, 8, 16, 32, 100], At = ({
932
+ startTime: j,
933
+ endTime: I,
934
+ currentTime: U,
935
+ clock: l,
936
+ onTimeChange: C,
937
+ onPlayPause: A,
938
+ onMultiplierChange: O,
939
+ height: N,
940
+ showControls: ae = !0,
941
+ showJumpToStart: J,
942
+ showJumpToEnd: q,
943
+ enableDrag: K = !0,
944
+ dateTimeFormat: G,
945
+ onDateTimeClick: Y,
946
+ jumpToTime: oe,
947
+ maxTicks: se,
948
+ ffSpeeds: Z = Ge,
949
+ rwSpeeds: ce = Ve,
950
+ theme: T,
939
951
  className: g,
940
- timezone: $,
941
- swimLanes: K,
942
- showSwimLanes: u,
943
- onShowSwimLanesChange: v,
944
- swimLaneTransition: P = "animated",
945
- onSwimLaneItemClick: y,
946
- onSwimLaneItemHover: w,
947
- onSwimLaneItemDoubleClick: re,
948
- onSwimLaneItemContextMenu: X,
949
- onSwimLaneReorder: te,
950
- labels: H
952
+ timezone: M,
953
+ swimLanes: ne,
954
+ showSwimLanes: X,
955
+ onShowSwimLanesChange: Q,
956
+ swimLaneTransition: he = "animated",
957
+ onSwimLaneItemClick: ee,
958
+ onSwimLaneItemHover: s,
959
+ onSwimLaneItemDoubleClick: y,
960
+ onSwimLaneItemContextMenu: R,
961
+ onSwimLaneReorder: k,
962
+ labels: z
951
963
  }) => {
952
- const D = () => Date.now(), k = A ? j.JulianDate.toDate(ge(A)).getTime() : D() - 432e5, S = L ? j.JulianDate.toDate(ge(L)).getTime() : D() + 12 * 3600 * 1e3, [i, C] = ve(
953
- () => ge(Y ?? A ?? j.JulianDate.fromDate(/* @__PURE__ */ new Date()))
954
- ), [q, t] = ve((a == null ? void 0 : a.shouldAnimate) ?? !1), [d, x] = ve((a == null ? void 0 : a.multiplier) ?? 1), [E, ce] = ve(u ?? !0);
955
- J(() => {
956
- u != null && ce(u);
957
- }, [u]);
958
- const pe = () => {
959
- const e = !E;
960
- ce(e), v == null || v(e);
961
- }, T = K != null && K.length > 0, oe = b(null), [ae, xe] = ve(0);
962
- J(() => {
963
- const e = oe.current;
964
- if (!e) return;
965
- const n = new ResizeObserver(([r]) => xe(r.borderBoxSize[0].blockSize));
966
- return n.observe(e), () => n.disconnect();
967
- }, [z]);
968
- const h = T && !E ? `${ae + $e}px` : O != null ? `${O}px` : "100%", le = b(!1), N = b(null), ie = { ...at, ...p };
969
- J(() => {
964
+ const W = () => Date.now(), S = j ? _.JulianDate.toDate(Ae(j)).getTime() : W() - 432e5, L = I ? _.JulianDate.toDate(Ae(I)).getTime() : W() + 12 * 3600 * 1e3, [c, w] = _e(
965
+ () => Ae(U ?? j ?? _.JulianDate.fromDate(/* @__PURE__ */ new Date()))
966
+ ), [ie, t] = _e((l == null ? void 0 : l.shouldAnimate) ?? !1), [u, v] = _e((l == null ? void 0 : l.multiplier) ?? 1), [E, de] = _e(X ?? !0);
967
+ P(() => {
968
+ X != null && de(X);
969
+ }, [X]);
970
+ const be = () => {
971
+ const a = !E;
972
+ de(a), Q == null || Q(a);
973
+ }, b = ne != null && ne.length > 0, re = x(null), [pe, ye] = _e(0);
974
+ P(() => {
975
+ const a = re.current;
970
976
  if (!a) return;
971
- const e = () => {
972
- if (!le.current) {
973
- const n = j.JulianDate.clone(a.currentTime);
974
- if (C(n), t(a.shouldAnimate), x(a.multiplier), N.current) {
975
- const { startMs: r, endMs: c } = N.current.getVisibleRange(), o = c - r, s = j.JulianDate.toDate(n).getTime(), f = s - r;
976
- f <= o * 0.1 ? N.current.zoomTo(s - o * 0.1, s + o * 0.9, s) : f >= o * 0.9 && N.current.zoomTo(s - o * 0.9, s + o * 0.1, s);
977
+ const D = new ResizeObserver(([$]) => ye($.borderBoxSize[0].blockSize));
978
+ return D.observe(a), () => D.disconnect();
979
+ }, [ae]);
980
+ const Re = b && !E ? `${pe + Ke}px` : N != null ? `${N}px` : "100%", ve = x(!1), B = x(null), De = { ...xt, ...T };
981
+ P(() => {
982
+ if (!l) return;
983
+ const a = () => {
984
+ if (!ve.current) {
985
+ const D = _.JulianDate.clone(l.currentTime);
986
+ if (w(D), t(l.shouldAnimate), v(l.multiplier), B.current) {
987
+ const { startMs: $, endMs: ue } = B.current.getVisibleRange(), H = ue - $, te = _.JulianDate.toDate(D).getTime(), e = te - $;
988
+ e <= H * 0.1 ? B.current.zoomTo(te - H * 0.1, te + H * 0.9, te) : e >= H * 0.9 && B.current.zoomTo(te - H * 0.9, te + H * 0.1, te);
977
989
  }
978
990
  }
979
991
  };
980
- return a.onTick.addEventListener(e), () => {
981
- a.onTick.removeEventListener(e);
992
+ return l.onTick.addEventListener(a), () => {
993
+ l.onTick.removeEventListener(a);
982
994
  };
983
- }, [a]), J(() => {
984
- if (a) return;
985
- const e = setInterval(() => {
986
- if (le.current) return;
987
- const n = j.JulianDate.fromDate(/* @__PURE__ */ new Date());
988
- if (C(n), N.current) {
989
- const { startMs: r, endMs: c } = N.current.getVisibleRange(), o = c - r, s = j.JulianDate.toDate(n).getTime(), f = s - r;
990
- f <= o * 0.1 ? N.current.zoomTo(s - o * 0.1, s + o * 0.9, s) : f >= o * 0.9 && N.current.zoomTo(s - o * 0.9, s + o * 0.1, s);
995
+ }, [l]), P(() => {
996
+ if (l) return;
997
+ const a = setInterval(() => {
998
+ if (ve.current) return;
999
+ const D = _.JulianDate.fromDate(/* @__PURE__ */ new Date());
1000
+ if (w(D), B.current) {
1001
+ const { startMs: $, endMs: ue } = B.current.getVisibleRange(), H = ue - $, te = _.JulianDate.toDate(D).getTime(), e = te - $;
1002
+ e <= H * 0.1 ? B.current.zoomTo(te - H * 0.1, te + H * 0.9, te) : e >= H * 0.9 && B.current.zoomTo(te - H * 0.9, te + H * 0.1, te);
991
1003
  }
992
1004
  }, 1e3);
993
- return () => clearInterval(e);
994
- }, [a]), J(() => {
995
- if (!Z) return;
996
- const e = ge(Z);
997
- if (me(e), N.current) {
998
- const { startMs: n, endMs: r } = N.current.getVisibleRange(), c = r - n, o = j.JulianDate.toDate(e).getTime();
999
- N.current.zoomTo(o - c / 2, o + c / 2);
1005
+ return () => clearInterval(a);
1006
+ }, [l]), P(() => {
1007
+ if (!oe) return;
1008
+ const a = Ae(oe);
1009
+ if (me(a), B.current) {
1010
+ const { startMs: D, endMs: $ } = B.current.getVisibleRange(), ue = $ - D, H = _.JulianDate.toDate(a).getTime();
1011
+ B.current.zoomTo(H - ue / 2, H + ue / 2);
1000
1012
  }
1001
- }, [Z]);
1002
- const ue = (e, n = !0) => {
1003
- a && (a.multiplier = e, n && (a.shouldAnimate = !0)), x(e), n && t(!0), F == null || F(e);
1004
- }, me = (e) => {
1005
- C(e), a && (a.currentTime = j.JulianDate.clone(e)), M == null || M(e);
1006
- }, Re = (e) => {
1007
- e && d < 0 && ue(1, !1), a && (a.shouldAnimate = e), t(e), R == null || R(e);
1008
- }, he = () => {
1009
- const e = B.length > 0 ? B : We, n = d > 1 ? d : 1, r = e.indexOf(n), c = e[r < 0 || r === e.length - 1 ? 0 : r + 1];
1010
- ue(c);
1011
- }, be = () => {
1012
- const e = ee.length > 0 ? ee : Be, n = d < 0 ? Math.abs(d) : 0, r = e.indexOf(n), c = -e[r < 0 || r === e.length - 1 ? 0 : r + 1];
1013
- ue(c);
1014
- }, De = () => {
1015
- var n;
1016
- const e = ge(A ?? j.JulianDate.fromDate(new Date(k)));
1017
- a && (a.currentTime = j.JulianDate.clone(e)), C(e), (n = N.current) == null || n.zoomTo(k, S);
1013
+ }, [oe]);
1014
+ const Te = (a, D = !0) => {
1015
+ l && (l.multiplier = a, D && (l.shouldAnimate = !0)), v(a), D && t(!0), O == null || O(a);
1016
+ }, me = (a) => {
1017
+ w(a), l && (l.currentTime = _.JulianDate.clone(a)), C == null || C(a);
1018
+ }, m = (a) => {
1019
+ a && u < 0 && Te(1, !1), l && (l.shouldAnimate = a), t(a), A == null || A(a);
1020
+ }, we = () => {
1021
+ const a = Z.length > 0 ? Z : Ge, D = u > 1 ? u : 1, $ = a.indexOf(D), ue = a[$ < 0 || $ === a.length - 1 ? 0 : $ + 1];
1022
+ Te(ue);
1023
+ }, Ee = () => {
1024
+ const a = ce.length > 0 ? ce : Ve, D = u < 0 ? Math.abs(u) : 0, $ = a.indexOf(D), ue = -a[$ < 0 || $ === a.length - 1 ? 0 : $ + 1];
1025
+ Te(ue);
1026
+ }, fe = () => {
1027
+ var D;
1028
+ const a = Ae(j ?? _.JulianDate.fromDate(new Date(S)));
1029
+ l && (l.currentTime = _.JulianDate.clone(a)), w(a), (D = B.current) == null || D.zoomTo(S, L);
1018
1030
  }, Ce = () => {
1019
- var n;
1020
- const e = ge(L ?? j.JulianDate.fromDate(new Date(S)));
1021
- a && (a.currentTime = j.JulianDate.clone(e)), C(e), (n = N.current) == null || n.zoomTo(k, S);
1022
- }, Ae = () => {
1023
- var r;
1024
- const e = j.JulianDate.fromDate(/* @__PURE__ */ new Date());
1025
- a && (a.currentTime = j.JulianDate.clone(e)), C(e), ue(1);
1026
- const n = Date.now();
1027
- (r = N.current) == null || r.zoomTo(n - 12 * 3600 * 1e3, n + 12 * 3600 * 1e3);
1028
- }, _e = Math.abs(j.JulianDate.toDate(i).getTime() - Date.now()) < 1e4;
1029
- return /* @__PURE__ */ l.jsxs(
1031
+ var D;
1032
+ const a = Ae(I ?? _.JulianDate.fromDate(new Date(L)));
1033
+ l && (l.currentTime = _.JulianDate.clone(a)), w(a), (D = B.current) == null || D.zoomTo(S, L);
1034
+ }, Me = () => {
1035
+ const a = _.JulianDate.fromDate(/* @__PURE__ */ new Date());
1036
+ l && (l.currentTime = _.JulianDate.clone(a)), w(a), Te(1);
1037
+ const D = Date.now();
1038
+ if (B.current) {
1039
+ const { startMs: $, endMs: ue } = B.current.getVisibleRange(), H = ue - $;
1040
+ B.current.zoomTo(D - H / 2, D + H / 2);
1041
+ }
1042
+ }, Ie = Math.abs(_.JulianDate.toDate(c).getTime() - Date.now()) < 1e4;
1043
+ return /* @__PURE__ */ i.jsxs(
1030
1044
  "div",
1031
1045
  {
1032
1046
  className: g,
1033
1047
  style: {
1034
1048
  width: "100%",
1035
- height: h,
1049
+ height: Re,
1036
1050
  overflow: "hidden",
1037
1051
  display: "flex",
1038
1052
  flexDirection: "column",
1039
1053
  fontFamily: "system-ui, -apple-system, sans-serif",
1040
- transition: P === "animated" ? "height 0.2s ease" : void 0
1054
+ transition: he === "animated" ? "height 0.2s ease" : void 0
1041
1055
  },
1042
1056
  children: [
1043
- z && /* @__PURE__ */ l.jsx("div", { ref: oe, children: /* @__PURE__ */ l.jsx(
1044
- vt,
1057
+ ae && /* @__PURE__ */ i.jsx("div", { ref: re, children: /* @__PURE__ */ i.jsx(
1058
+ Rt,
1045
1059
  {
1046
- currentTime: i,
1047
- isPlaying: q,
1048
- multiplier: d,
1049
- isLive: _e,
1050
- hasStartTime: A != null,
1051
- hasEndTime: L != null,
1052
- showJumpToStart: _,
1053
- showJumpToEnd: U,
1054
- onPlayPause: Re,
1055
- onJumpToStart: De,
1056
- onRewind: be,
1057
- onFastForward: he,
1060
+ currentTime: c,
1061
+ isPlaying: ie,
1062
+ multiplier: u,
1063
+ isLive: Ie,
1064
+ hasStartTime: j != null,
1065
+ hasEndTime: I != null,
1066
+ showJumpToStart: J,
1067
+ showJumpToEnd: q,
1068
+ onPlayPause: m,
1069
+ onJumpToStart: fe,
1070
+ onRewind: Ee,
1071
+ onFastForward: we,
1058
1072
  onJumpToEnd: Ce,
1059
- onJumpToLive: Ae,
1060
- onResetSpeed: () => ue(1),
1061
- onDateTimeClick: V,
1062
- dateTimeFormat: ne,
1063
- timezone: $,
1064
- theme: ie,
1065
- swimLanesVisible: T ? E : void 0,
1066
- onToggleSwimLanes: T ? pe : void 0,
1067
- labels: H
1073
+ onJumpToLive: Me,
1074
+ onResetSpeed: () => Te(1),
1075
+ onDateTimeClick: Y,
1076
+ dateTimeFormat: G,
1077
+ timezone: M,
1078
+ theme: De,
1079
+ swimLanesVisible: b ? E : void 0,
1080
+ onToggleSwimLanes: b ? be : void 0,
1081
+ labels: z
1068
1082
  }
1069
1083
  ) }),
1070
- W !== !1 && /* @__PURE__ */ l.jsx(
1071
- He,
1084
+ K !== !1 && /* @__PURE__ */ i.jsx(
1085
+ Ze,
1072
1086
  {
1073
- ref: N,
1074
- currentTime: i,
1075
- defaultStartMs: k,
1076
- defaultEndMs: S,
1077
- theme: ie,
1078
- maxTicks: Q,
1079
- timezone: $,
1087
+ ref: B,
1088
+ currentTime: c,
1089
+ defaultStartMs: S,
1090
+ defaultEndMs: L,
1091
+ theme: De,
1092
+ maxTicks: se,
1093
+ timezone: M,
1094
+ dateTimeFormat: G,
1095
+ months: z == null ? void 0 : z.months,
1080
1096
  onTimeChange: me,
1081
1097
  onDragStart: () => {
1082
- le.current = !0;
1098
+ ve.current = !0;
1083
1099
  },
1084
1100
  onDragEnd: () => {
1085
- le.current = !1;
1101
+ ve.current = !1;
1086
1102
  },
1087
- swimLanes: K,
1103
+ swimLanes: ne,
1088
1104
  showSwimLanes: E,
1089
- onSwimLaneItemClick: y,
1090
- onSwimLaneItemHover: w,
1091
- onSwimLaneItemDoubleClick: re,
1092
- onSwimLaneItemContextMenu: X,
1093
- onSwimLaneReorder: te
1105
+ onSwimLaneItemClick: ee,
1106
+ onSwimLaneItemHover: s,
1107
+ onSwimLaneItemDoubleClick: y,
1108
+ onSwimLaneItemContextMenu: R,
1109
+ onSwimLaneReorder: k
1094
1110
  }
1095
1111
  )
1096
1112
  ]
1097
1113
  }
1098
1114
  );
1099
- }, Et = ({
1100
- startTime: A,
1101
- endTime: L,
1102
- currentTime: Y,
1103
- width: a,
1104
- height: M,
1105
- tickInterval: R,
1106
- showLabels: F,
1107
- snapToTicks: O,
1108
- enableDrag: z,
1109
- theme: _,
1110
- onTimeChange: U,
1111
- onVisibleRangeChange: W,
1112
- onDragStart: ne,
1113
- onDragEnd: V
1115
+ }, _t = ({
1116
+ startTime: j,
1117
+ endTime: I,
1118
+ currentTime: U,
1119
+ width: l,
1120
+ height: C,
1121
+ tickInterval: A,
1122
+ showLabels: O,
1123
+ snapToTicks: N,
1124
+ enableDrag: ae,
1125
+ theme: J,
1126
+ onTimeChange: q,
1127
+ onVisibleRangeChange: K,
1128
+ onDragStart: G,
1129
+ onDragEnd: Y
1114
1130
  }) => {
1115
- const Z = Se(
1116
- () => ut(A, L, R, a),
1117
- [A, L, R, a]
1118
- ), Q = Se(
1119
- () => dt(Y, A, L, a),
1120
- [Y, A, L, a]
1121
- ), B = b(null), ee = (g) => {
1122
- if (!z) return;
1123
- const $ = g.currentTarget.getBoundingClientRect(), K = g.clientX - $.left, u = Math.max(0, Math.min(a, K));
1124
- if (!(Math.abs(u - Q) <= 10)) {
1125
- let S = u;
1126
- O && (S = ft(u, Z, 10));
1127
- const i = new Date(A).getTime(), C = new Date(L).getTime();
1128
- U(j.JulianDate.fromDate(new Date(i + S / a * (C - i))));
1131
+ const oe = Xe(
1132
+ () => gt(j, I, A, l),
1133
+ [j, I, A, l]
1134
+ ), se = Xe(
1135
+ () => vt(U, j, I, l),
1136
+ [U, j, I, l]
1137
+ ), Z = x(null), ce = (g) => {
1138
+ if (!ae) return;
1139
+ const M = g.currentTarget.getBoundingClientRect(), ne = g.clientX - M.left, X = Math.max(0, Math.min(l, ne));
1140
+ if (!(Math.abs(X - se) <= 10)) {
1141
+ let L = X;
1142
+ N && (L = bt(X, oe, 10));
1143
+ const c = new Date(j).getTime(), w = new Date(I).getTime();
1144
+ q(_.JulianDate.fromDate(new Date(c + L / l * (w - c))));
1129
1145
  return;
1130
1146
  }
1131
- ne == null || ne();
1132
- const P = g.clientX, y = new Date(Y).getTime(), w = new Date(A).getTime(), X = (new Date(L).getTime() - w) / a;
1133
- let te = 0, H = !1;
1134
- const D = (S) => {
1135
- te = S.clientX - P, H = !0, B.current || (B.current = requestAnimationFrame(() => {
1136
- if (H) {
1137
- const i = y + te * X;
1138
- U(j.JulianDate.fromDate(new Date(i))), H = !1;
1147
+ G == null || G();
1148
+ const he = g.clientX, ee = new Date(U).getTime(), s = new Date(j).getTime(), R = (new Date(I).getTime() - s) / l;
1149
+ let k = 0, z = !1;
1150
+ const W = (L) => {
1151
+ k = L.clientX - he, z = !0, Z.current || (Z.current = requestAnimationFrame(() => {
1152
+ if (z) {
1153
+ const c = ee + k * R;
1154
+ q(_.JulianDate.fromDate(new Date(c))), z = !1;
1139
1155
  }
1140
- B.current = null;
1156
+ Z.current = null;
1141
1157
  }));
1142
- }, k = () => {
1143
- document.removeEventListener("mousemove", D), document.removeEventListener("mouseup", k), B.current !== null && (cancelAnimationFrame(B.current), B.current = null), V == null || V();
1158
+ }, S = () => {
1159
+ document.removeEventListener("mousemove", W), document.removeEventListener("mouseup", S), Z.current !== null && (cancelAnimationFrame(Z.current), Z.current = null), Y == null || Y();
1144
1160
  };
1145
- document.addEventListener("mousemove", D), document.addEventListener("mouseup", k);
1146
- }, p = (g) => {
1161
+ document.addEventListener("mousemove", W), document.addEventListener("mouseup", S);
1162
+ }, T = (g) => {
1147
1163
  g.preventDefault();
1148
- const $ = g.shiftKey ? g.deltaY : g.deltaX !== 0 ? g.deltaX : g.deltaY;
1149
- if (Math.abs($) < 1) return;
1150
- const K = new Date(A).getTime(), u = new Date(L).getTime(), v = $ / a * (u - K) * 0.5;
1151
- W == null || W(
1152
- j.JulianDate.fromDate(new Date(K + v)),
1153
- j.JulianDate.fromDate(new Date(u + v))
1164
+ const M = g.shiftKey ? g.deltaY : g.deltaX !== 0 ? g.deltaX : g.deltaY;
1165
+ if (Math.abs(M) < 1) return;
1166
+ const ne = new Date(j).getTime(), X = new Date(I).getTime(), Q = M / l * (X - ne) * 0.5;
1167
+ K == null || K(
1168
+ _.JulianDate.fromDate(new Date(ne + Q)),
1169
+ _.JulianDate.fromDate(new Date(X + Q))
1154
1170
  );
1155
1171
  };
1156
- return /* @__PURE__ */ l.jsxs(
1172
+ return /* @__PURE__ */ i.jsxs(
1157
1173
  "svg",
1158
1174
  {
1159
1175
  width: "100%",
1160
- height: M,
1161
- style: { backgroundColor: _.backgroundColor, display: "block", cursor: "default" },
1162
- onMouseDown: ee,
1163
- onWheel: p,
1176
+ height: C,
1177
+ style: { backgroundColor: J.backgroundColor, display: "block", cursor: "default" },
1178
+ onMouseDown: ce,
1179
+ onWheel: T,
1164
1180
  children: [
1165
- /* @__PURE__ */ l.jsx("rect", { width: a, height: M, fill: _.backgroundColor }),
1166
- Z.map((g, $) => /* @__PURE__ */ l.jsxs("g", { children: [
1167
- /* @__PURE__ */ l.jsx(
1181
+ /* @__PURE__ */ i.jsx("rect", { width: l, height: C, fill: J.backgroundColor }),
1182
+ oe.map((g, M) => /* @__PURE__ */ i.jsxs("g", { children: [
1183
+ /* @__PURE__ */ i.jsx(
1168
1184
  "line",
1169
1185
  {
1170
1186
  x1: g.position,
1171
- y1: M - (g.isMajor ? _.majorTickHeight : _.minorTickHeight),
1187
+ y1: C - (g.isMajor ? J.majorTickHeight : J.minorTickHeight),
1172
1188
  x2: g.position,
1173
- y2: M,
1174
- stroke: g.isMajor ? _.majorTickColor : _.tickColor,
1189
+ y2: C,
1190
+ stroke: g.isMajor ? J.majorTickColor : J.tickColor,
1175
1191
  strokeWidth: "1"
1176
1192
  }
1177
1193
  ),
1178
- F && g.isMajor && g.label && /* @__PURE__ */ l.jsx(
1194
+ O && g.isMajor && g.label && /* @__PURE__ */ i.jsx(
1179
1195
  "text",
1180
1196
  {
1181
1197
  x: g.position,
1182
- y: M - _.majorTickHeight - 5,
1198
+ y: C - J.majorTickHeight - 5,
1183
1199
  textAnchor: "middle",
1184
- fill: _.labelColor,
1185
- fontSize: _.fontSize,
1200
+ fill: J.labelColor,
1201
+ fontSize: J.fontSize,
1186
1202
  fontFamily: "monospace",
1187
1203
  children: g.label
1188
1204
  }
1189
1205
  )
1190
- ] }, $)),
1191
- /* @__PURE__ */ l.jsx(
1206
+ ] }, M)),
1207
+ /* @__PURE__ */ i.jsx(
1192
1208
  "line",
1193
1209
  {
1194
- x1: Q,
1210
+ x1: se,
1195
1211
  y1: 0,
1196
- x2: Q,
1197
- y2: M,
1198
- stroke: _.indicatorColor,
1199
- strokeWidth: _.indicatorLineWidth,
1212
+ x2: se,
1213
+ y2: C,
1214
+ stroke: J.indicatorColor,
1215
+ strokeWidth: J.indicatorLineWidth,
1200
1216
  pointerEvents: "none"
1201
1217
  }
1202
1218
  ),
1203
- z && /* @__PURE__ */ l.jsx(
1219
+ ae && /* @__PURE__ */ i.jsx(
1204
1220
  "rect",
1205
1221
  {
1206
- x: Math.max(0, Q - 10),
1222
+ x: Math.max(0, se - 10),
1207
1223
  y: 0,
1208
1224
  width: 20,
1209
- height: M,
1225
+ height: C,
1210
1226
  fill: "transparent",
1211
1227
  style: { cursor: "ew-resize" },
1212
1228
  pointerEvents: "visiblePainted"
1213
1229
  }
1214
1230
  ),
1215
- /* @__PURE__ */ l.jsx("circle", { cx: Q, cy: 5, r: 4, fill: _.indicatorColor, pointerEvents: "none" })
1231
+ /* @__PURE__ */ i.jsx("circle", { cx: se, cy: 5, r: 4, fill: J.indicatorColor, pointerEvents: "none" })
1216
1232
  ]
1217
1233
  }
1218
1234
  );
1219
1235
  };
1220
1236
  export {
1221
- Dt as TICK_AREA_HEIGHT,
1222
- wt as Timeline,
1223
- He as TimelineCanvas,
1224
- vt as TimelineControls,
1225
- Et as TimelineSVG
1237
+ kt as TICK_AREA_HEIGHT,
1238
+ At as Timeline,
1239
+ Ze as TimelineCanvas,
1240
+ Rt as TimelineControls,
1241
+ _t as TimelineSVG
1226
1242
  };