@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.
- package/dist/cesium-timeline-react.js +794 -778
- package/dist/cesium-timeline-react.umd.cjs +4 -4
- package/dist/index.d.ts +4 -0
- package/package.json +6 -3
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import
|
|
2
|
-
import * as
|
|
3
|
-
import { DEFAULT_LABELS as
|
|
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
|
|
6
|
-
var
|
|
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
|
|
17
|
-
function
|
|
18
|
-
if (
|
|
19
|
-
|
|
20
|
-
var
|
|
21
|
-
function
|
|
22
|
-
var
|
|
23
|
-
if (
|
|
24
|
-
|
|
25
|
-
for (var
|
|
26
|
-
|
|
27
|
-
} else
|
|
28
|
-
return
|
|
29
|
-
$$typeof:
|
|
30
|
-
type:
|
|
31
|
-
key:
|
|
32
|
-
ref:
|
|
33
|
-
props:
|
|
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
|
|
36
|
+
return je.Fragment = I, je.jsx = U, je.jsxs = U, je;
|
|
37
37
|
}
|
|
38
|
-
var
|
|
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
|
|
49
|
-
function
|
|
50
|
-
return
|
|
51
|
-
function
|
|
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 ===
|
|
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
|
|
57
|
+
case Z:
|
|
58
58
|
return "Fragment";
|
|
59
|
-
case
|
|
59
|
+
case T:
|
|
60
60
|
return "Profiler";
|
|
61
|
-
case
|
|
61
|
+
case ce:
|
|
62
62
|
return "StrictMode";
|
|
63
|
-
case
|
|
63
|
+
case X:
|
|
64
64
|
return "Suspense";
|
|
65
|
-
case
|
|
65
|
+
case Q:
|
|
66
66
|
return "SuspenseList";
|
|
67
|
-
case
|
|
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
|
|
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
|
|
81
|
-
var
|
|
82
|
-
return t = t.displayName, t || (t =
|
|
83
|
-
case
|
|
84
|
-
return
|
|
85
|
-
case
|
|
86
|
-
|
|
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
|
|
88
|
+
return j(t(u));
|
|
89
89
|
} catch {
|
|
90
90
|
}
|
|
91
91
|
}
|
|
92
92
|
return null;
|
|
93
93
|
}
|
|
94
|
-
function
|
|
94
|
+
function I(t) {
|
|
95
95
|
return "" + t;
|
|
96
96
|
}
|
|
97
|
-
function
|
|
97
|
+
function U(t) {
|
|
98
98
|
try {
|
|
99
|
-
|
|
100
|
-
var
|
|
99
|
+
I(t);
|
|
100
|
+
var u = !1;
|
|
101
101
|
} catch {
|
|
102
|
-
|
|
102
|
+
u = !0;
|
|
103
103
|
}
|
|
104
|
-
if (
|
|
105
|
-
|
|
106
|
-
var
|
|
107
|
-
return
|
|
108
|
-
|
|
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
|
-
),
|
|
111
|
+
), I(t);
|
|
112
112
|
}
|
|
113
113
|
}
|
|
114
|
-
function
|
|
115
|
-
if (t ===
|
|
116
|
-
if (typeof t == "object" && t !== null && t.$$typeof ===
|
|
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
|
|
120
|
-
return
|
|
119
|
+
var u = j(t);
|
|
120
|
+
return u ? "<" + u + ">" : "<...>";
|
|
121
121
|
} catch {
|
|
122
122
|
return "<...>";
|
|
123
123
|
}
|
|
124
124
|
}
|
|
125
|
-
function
|
|
126
|
-
var t =
|
|
125
|
+
function C() {
|
|
126
|
+
var t = R.A;
|
|
127
127
|
return t === null ? null : t.getOwner();
|
|
128
128
|
}
|
|
129
|
-
function
|
|
129
|
+
function A() {
|
|
130
130
|
return Error("react-stack-top-frame");
|
|
131
131
|
}
|
|
132
|
-
function
|
|
133
|
-
if (
|
|
134
|
-
var
|
|
135
|
-
if (
|
|
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
|
|
140
|
-
function
|
|
141
|
-
|
|
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
|
-
|
|
143
|
+
u
|
|
144
144
|
));
|
|
145
145
|
}
|
|
146
|
-
|
|
147
|
-
get:
|
|
146
|
+
v.isReactWarning = !0, Object.defineProperty(t, "key", {
|
|
147
|
+
get: v,
|
|
148
148
|
configurable: !0
|
|
149
149
|
});
|
|
150
150
|
}
|
|
151
|
-
function
|
|
152
|
-
var t =
|
|
153
|
-
return
|
|
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
|
|
158
|
-
var
|
|
157
|
+
function J(t, u, v, E, de, be) {
|
|
158
|
+
var b = v.ref;
|
|
159
159
|
return t = {
|
|
160
|
-
$$typeof:
|
|
160
|
+
$$typeof: oe,
|
|
161
161
|
type: t,
|
|
162
|
-
key:
|
|
163
|
-
props:
|
|
162
|
+
key: u,
|
|
163
|
+
props: v,
|
|
164
164
|
_owner: E
|
|
165
|
-
}, (
|
|
165
|
+
}, (b !== void 0 ? b : null) !== null ? Object.defineProperty(t, "ref", {
|
|
166
166
|
enumerable: !1,
|
|
167
|
-
get:
|
|
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:
|
|
182
|
+
value: de
|
|
183
183
|
}), Object.defineProperty(t, "_debugTask", {
|
|
184
184
|
configurable: !1,
|
|
185
185
|
enumerable: !1,
|
|
186
186
|
writable: !0,
|
|
187
|
-
value:
|
|
187
|
+
value: be
|
|
188
188
|
}), Object.freeze && (Object.freeze(t.props), Object.freeze(t)), t;
|
|
189
189
|
}
|
|
190
|
-
function
|
|
191
|
-
var
|
|
192
|
-
if (
|
|
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 (
|
|
195
|
-
for (E = 0; E <
|
|
196
|
-
|
|
197
|
-
Object.freeze && Object.freeze(
|
|
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
|
|
203
|
-
if (
|
|
204
|
-
|
|
205
|
-
var
|
|
206
|
-
return
|
|
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 <
|
|
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
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
),
|
|
216
|
+
b,
|
|
217
|
+
re,
|
|
218
|
+
b
|
|
219
|
+
), ie[b + E] = !0);
|
|
220
220
|
}
|
|
221
|
-
if (
|
|
222
|
-
|
|
223
|
-
for (var
|
|
224
|
-
|
|
225
|
-
} else
|
|
226
|
-
return
|
|
227
|
-
|
|
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
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
231
|
+
b,
|
|
232
|
+
v,
|
|
233
|
+
C(),
|
|
234
|
+
de,
|
|
235
|
+
be
|
|
236
236
|
);
|
|
237
237
|
}
|
|
238
|
-
function
|
|
239
|
-
|
|
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
|
|
242
|
-
return typeof t == "object" && t !== null && t.$$typeof ===
|
|
241
|
+
function G(t) {
|
|
242
|
+
return typeof t == "object" && t !== null && t.$$typeof === oe;
|
|
243
243
|
}
|
|
244
|
-
var
|
|
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
|
-
|
|
247
|
+
Y = {
|
|
248
248
|
react_stack_bottom_frame: function(t) {
|
|
249
249
|
return t();
|
|
250
250
|
}
|
|
251
251
|
};
|
|
252
|
-
var
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
)(),
|
|
256
|
-
|
|
257
|
-
var E = 1e4 >
|
|
258
|
-
return
|
|
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
|
-
|
|
261
|
-
|
|
260
|
+
u,
|
|
261
|
+
v,
|
|
262
262
|
!1,
|
|
263
|
-
E ? Error("react-stack-top-frame") :
|
|
264
|
-
E ?
|
|
263
|
+
E ? Error("react-stack-top-frame") : c,
|
|
264
|
+
E ? W(l(t)) : w
|
|
265
265
|
);
|
|
266
|
-
},
|
|
267
|
-
var E = 1e4 >
|
|
268
|
-
return
|
|
266
|
+
}, Se.jsxs = function(t, u, v) {
|
|
267
|
+
var E = 1e4 > R.recentlyCreatedOwnerStacks++;
|
|
268
|
+
return q(
|
|
269
269
|
t,
|
|
270
|
-
|
|
271
|
-
|
|
270
|
+
u,
|
|
271
|
+
v,
|
|
272
272
|
!0,
|
|
273
|
-
E ? Error("react-stack-top-frame") :
|
|
274
|
-
E ?
|
|
273
|
+
E ? Error("react-stack-top-frame") : c,
|
|
274
|
+
E ? W(l(t)) : w
|
|
275
275
|
);
|
|
276
276
|
};
|
|
277
|
-
})()),
|
|
277
|
+
})()), Se;
|
|
278
278
|
}
|
|
279
|
-
var
|
|
280
|
-
function
|
|
281
|
-
return
|
|
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
|
|
284
|
-
const
|
|
285
|
-
/* @__PURE__ */
|
|
286
|
-
/* @__PURE__ */
|
|
287
|
-
] }),
|
|
288
|
-
currentTime:
|
|
289
|
-
isPlaying:
|
|
290
|
-
multiplier:
|
|
291
|
-
dateTimeFormat:
|
|
292
|
-
timezone:
|
|
293
|
-
isLive:
|
|
294
|
-
hasStartTime:
|
|
295
|
-
hasEndTime:
|
|
296
|
-
showJumpToStart:
|
|
297
|
-
showJumpToEnd:
|
|
298
|
-
onPlayPause:
|
|
299
|
-
onJumpToStart:
|
|
300
|
-
onRewind:
|
|
301
|
-
onFastForward:
|
|
302
|
-
onJumpToEnd:
|
|
303
|
-
onJumpToLive:
|
|
304
|
-
onResetSpeed:
|
|
305
|
-
onDateTimeClick:
|
|
306
|
-
theme:
|
|
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:
|
|
308
|
+
onToggleSwimLanes: M,
|
|
309
|
+
labels: ne
|
|
310
310
|
}) => {
|
|
311
|
-
const
|
|
312
|
-
() => ({ ...
|
|
313
|
-
[
|
|
314
|
-
),
|
|
315
|
-
|
|
316
|
-
const
|
|
317
|
-
if (!
|
|
318
|
-
const
|
|
319
|
-
|
|
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
|
|
321
|
+
return w.observe(c), () => w.disconnect();
|
|
322
322
|
}, []);
|
|
323
|
-
const
|
|
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
|
-
},
|
|
341
|
-
...
|
|
342
|
-
color:
|
|
343
|
-
borderColor:
|
|
344
|
-
}),
|
|
345
|
-
|
|
346
|
-
},
|
|
347
|
-
|
|
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__ */
|
|
349
|
+
return /* @__PURE__ */ i.jsxs(
|
|
350
350
|
"div",
|
|
351
351
|
{
|
|
352
|
-
ref:
|
|
352
|
+
ref: y,
|
|
353
353
|
style: {
|
|
354
|
-
display:
|
|
355
|
-
gridTemplateColumns:
|
|
354
|
+
display: R ? "flex" : "grid",
|
|
355
|
+
gridTemplateColumns: R ? void 0 : "1fr auto 1fr",
|
|
356
356
|
alignItems: "center",
|
|
357
357
|
padding: "6px 16px",
|
|
358
|
-
backgroundColor:
|
|
359
|
-
borderBottom: `1px solid ${
|
|
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__ */
|
|
364
|
-
/* @__PURE__ */
|
|
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:
|
|
368
|
-
title:
|
|
367
|
+
onClick: ce,
|
|
368
|
+
title: ce ? s.dateTimeClickTooltip : void 0,
|
|
369
369
|
style: {
|
|
370
|
-
color:
|
|
370
|
+
color: T.labelColor,
|
|
371
371
|
fontFamily: "monospace",
|
|
372
372
|
lineHeight: 1.15,
|
|
373
|
-
cursor:
|
|
373
|
+
cursor: ce ? "pointer" : "default",
|
|
374
374
|
borderRadius: "4px",
|
|
375
375
|
padding: "2px 4px",
|
|
376
376
|
transition: "background 0.15s"
|
|
377
377
|
},
|
|
378
|
-
onMouseEnter: (
|
|
379
|
-
|
|
378
|
+
onMouseEnter: (c) => {
|
|
379
|
+
ce && (c.currentTarget.style.background = T.buttonHoverColor + "44");
|
|
380
380
|
},
|
|
381
|
-
onMouseLeave: (
|
|
381
|
+
onMouseLeave: (c) => c.currentTarget.style.background = "transparent",
|
|
382
382
|
children: (() => {
|
|
383
|
-
const { timeFormat:
|
|
384
|
-
return /* @__PURE__ */
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
/* @__PURE__ */
|
|
388
|
-
|
|
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:
|
|
390
|
+
color: T.labelColor,
|
|
391
391
|
opacity: 0.7,
|
|
392
392
|
fontWeight: "bold",
|
|
393
393
|
letterSpacing: "0.04em"
|
|
394
|
-
}, children:
|
|
394
|
+
}, children: ie })
|
|
395
395
|
] })
|
|
396
396
|
] });
|
|
397
397
|
})()
|
|
398
398
|
}
|
|
399
399
|
),
|
|
400
|
-
/* @__PURE__ */
|
|
401
|
-
/* @__PURE__ */
|
|
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:
|
|
404
|
+
onClick: se,
|
|
405
405
|
style: {
|
|
406
|
-
...
|
|
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:
|
|
415
|
-
backgroundColor:
|
|
416
|
-
borderColor:
|
|
417
|
-
opacity:
|
|
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: (
|
|
420
|
-
|
|
419
|
+
onMouseEnter: (c) => {
|
|
420
|
+
c.currentTarget.style.opacity = "1";
|
|
421
421
|
},
|
|
422
|
-
onMouseLeave: (
|
|
423
|
-
|
|
422
|
+
onMouseLeave: (c) => {
|
|
423
|
+
c.currentTarget.style.opacity = A ? "1" : "0.55";
|
|
424
424
|
},
|
|
425
|
-
title:
|
|
426
|
-
children:
|
|
425
|
+
title: A ? s.liveActiveTooltip : s.liveTooltip,
|
|
426
|
+
children: A ? s.liveActiveLabel : s.liveLabel
|
|
427
427
|
}
|
|
428
428
|
),
|
|
429
|
-
/* @__PURE__ */
|
|
429
|
+
/* @__PURE__ */ i.jsx("div", { style: { height: "20px", display: "flex", alignItems: "center" }, children: !he && /* @__PURE__ */ i.jsx(
|
|
430
430
|
"button",
|
|
431
431
|
{
|
|
432
|
-
onClick: () =>
|
|
432
|
+
onClick: () => Z(),
|
|
433
433
|
style: {
|
|
434
|
-
...
|
|
434
|
+
...z,
|
|
435
435
|
fontSize: "11px",
|
|
436
|
-
color:
|
|
437
|
-
borderColor: `${
|
|
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: (
|
|
443
|
-
onMouseLeave:
|
|
444
|
-
title:
|
|
445
|
-
children:
|
|
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__ */
|
|
451
|
-
|
|
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:
|
|
455
|
-
disabled: !
|
|
456
|
-
style: { ...
|
|
457
|
-
onMouseEnter:
|
|
458
|
-
onMouseLeave:
|
|
459
|
-
title:
|
|
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__ */
|
|
463
|
+
/* @__PURE__ */ i.jsx(
|
|
464
464
|
"button",
|
|
465
465
|
{
|
|
466
|
-
onClick:
|
|
467
|
-
style: { ...
|
|
468
|
-
onMouseEnter: (
|
|
469
|
-
onMouseLeave:
|
|
470
|
-
title:
|
|
471
|
-
children:
|
|
472
|
-
/* @__PURE__ */
|
|
473
|
-
|
|
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__ */
|
|
480
|
+
/* @__PURE__ */ i.jsx(
|
|
481
481
|
"button",
|
|
482
482
|
{
|
|
483
|
-
onClick: () =>
|
|
483
|
+
onClick: () => q(!I),
|
|
484
484
|
style: {
|
|
485
|
-
...
|
|
486
|
-
color:
|
|
485
|
+
...z,
|
|
486
|
+
color: T.buttonActiveColor,
|
|
487
487
|
fontSize: "18px",
|
|
488
488
|
width: "40px",
|
|
489
489
|
minWidth: "40px",
|
|
490
490
|
height: "40px",
|
|
491
|
-
borderColor: `${
|
|
491
|
+
borderColor: `${T.buttonActiveColor}55`,
|
|
492
492
|
borderRadius: "50%",
|
|
493
|
-
paddingLeft:
|
|
493
|
+
paddingLeft: I ? "0" : "2px"
|
|
494
494
|
},
|
|
495
|
-
onMouseEnter: (
|
|
496
|
-
onMouseLeave:
|
|
497
|
-
title:
|
|
498
|
-
children:
|
|
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__ */
|
|
501
|
+
/* @__PURE__ */ i.jsx(
|
|
502
502
|
"button",
|
|
503
503
|
{
|
|
504
|
-
onClick:
|
|
505
|
-
style: { ...
|
|
506
|
-
onMouseEnter: (
|
|
507
|
-
onMouseLeave:
|
|
508
|
-
title:
|
|
509
|
-
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__ */
|
|
512
|
-
|
|
511
|
+
/* @__PURE__ */ i.jsxs("span", { style: { fontSize: "11px", fontWeight: "bold" }, children: [
|
|
512
|
+
ee,
|
|
513
513
|
"×"
|
|
514
514
|
] })
|
|
515
515
|
] }) : "▶▶"
|
|
516
516
|
}
|
|
517
517
|
),
|
|
518
|
-
|
|
518
|
+
J && /* @__PURE__ */ i.jsx(
|
|
519
519
|
"button",
|
|
520
520
|
{
|
|
521
|
-
onClick:
|
|
522
|
-
disabled: !
|
|
523
|
-
style: { ...
|
|
524
|
-
onMouseEnter:
|
|
525
|
-
onMouseLeave:
|
|
526
|
-
title:
|
|
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
|
-
!
|
|
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
|
-
...
|
|
537
|
-
color:
|
|
538
|
-
borderColor: `${
|
|
536
|
+
...z,
|
|
537
|
+
color: T.buttonActiveColor,
|
|
538
|
+
borderColor: `${T.buttonActiveColor}33`
|
|
539
539
|
},
|
|
540
|
-
onMouseEnter: (
|
|
541
|
-
onMouseLeave:
|
|
542
|
-
title: g ?
|
|
543
|
-
children: g ? /* @__PURE__ */
|
|
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
|
-
|
|
546
|
+
R && M != null && g != null && /* @__PURE__ */ i.jsx(
|
|
547
547
|
"button",
|
|
548
548
|
{
|
|
549
|
-
onClick:
|
|
549
|
+
onClick: M,
|
|
550
550
|
style: {
|
|
551
|
-
...
|
|
552
|
-
color:
|
|
553
|
-
borderColor: `${
|
|
551
|
+
...z,
|
|
552
|
+
color: T.buttonActiveColor,
|
|
553
|
+
borderColor: `${T.buttonActiveColor}33`,
|
|
554
554
|
marginLeft: "4px"
|
|
555
555
|
},
|
|
556
|
-
onMouseEnter: (
|
|
557
|
-
onMouseLeave:
|
|
558
|
-
title: g ?
|
|
559
|
-
children: g ? /* @__PURE__ */
|
|
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
|
-
},
|
|
566
|
-
(
|
|
565
|
+
}, Ze = tt(
|
|
566
|
+
(j, I) => {
|
|
567
567
|
const {
|
|
568
|
-
currentTime:
|
|
569
|
-
defaultStartMs:
|
|
570
|
-
defaultEndMs:
|
|
571
|
-
theme:
|
|
572
|
-
maxTicks:
|
|
573
|
-
timezone:
|
|
574
|
-
|
|
575
|
-
|
|
576
|
-
|
|
577
|
-
|
|
578
|
-
|
|
579
|
-
|
|
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:
|
|
582
|
-
onSwimLaneItemContextMenu:
|
|
583
|
-
onSwimLaneReorder:
|
|
584
|
-
} =
|
|
585
|
-
|
|
586
|
-
|
|
587
|
-
}, [
|
|
588
|
-
|
|
589
|
-
}, [
|
|
590
|
-
|
|
591
|
-
}, [
|
|
592
|
-
|
|
593
|
-
|
|
594
|
-
|
|
595
|
-
}, [
|
|
596
|
-
|
|
597
|
-
|
|
598
|
-
|
|
599
|
-
}, [
|
|
600
|
-
|
|
601
|
-
}, [
|
|
602
|
-
|
|
603
|
-
}, [
|
|
604
|
-
|
|
605
|
-
}, [
|
|
606
|
-
|
|
607
|
-
}, [
|
|
608
|
-
|
|
609
|
-
|
|
610
|
-
|
|
611
|
-
|
|
612
|
-
|
|
613
|
-
|
|
614
|
-
|
|
615
|
-
|
|
616
|
-
|
|
617
|
-
|
|
618
|
-
|
|
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
|
-
|
|
621
|
-
zoomTo(e, n,
|
|
622
|
-
const
|
|
623
|
-
|
|
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:
|
|
634
|
+
return { startMs: s.current, endMs: y.current };
|
|
627
635
|
},
|
|
628
636
|
startFollow(e) {
|
|
629
|
-
if (
|
|
630
|
-
|
|
637
|
+
if (be.current = e, E.current !== null) return;
|
|
638
|
+
de.current = !0;
|
|
631
639
|
let n = performance.now();
|
|
632
|
-
const
|
|
633
|
-
const
|
|
634
|
-
n =
|
|
635
|
-
const
|
|
636
|
-
|
|
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
|
-
|
|
646
|
+
E.current = requestAnimationFrame(o);
|
|
639
647
|
},
|
|
640
648
|
stopFollow() {
|
|
641
|
-
|
|
649
|
+
de.current = !1, E.current !== null && (cancelAnimationFrame(E.current), E.current = null);
|
|
642
650
|
},
|
|
643
651
|
correctFollow(e) {
|
|
644
|
-
if (!
|
|
645
|
-
const n = e -
|
|
646
|
-
|
|
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
|
-
|
|
658
|
+
k.current = [...k.current, e], m();
|
|
651
659
|
},
|
|
652
660
|
updateSwimLane(e, n) {
|
|
653
|
-
|
|
654
|
-
(
|
|
655
|
-
),
|
|
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
|
-
|
|
666
|
+
k.current = k.current.filter((n) => n.id !== e), m();
|
|
659
667
|
},
|
|
660
668
|
reorderSwimLanes(e) {
|
|
661
|
-
const n = new Map(
|
|
662
|
-
for (const
|
|
663
|
-
const
|
|
664
|
-
|
|
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
|
-
|
|
674
|
+
k.current = o, m();
|
|
667
675
|
}
|
|
668
676
|
}));
|
|
669
|
-
const
|
|
670
|
-
const e =
|
|
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
|
|
675
|
-
if (
|
|
676
|
-
const
|
|
677
|
-
(e.width !==
|
|
678
|
-
const
|
|
679
|
-
|
|
680
|
-
}, [
|
|
681
|
-
|
|
682
|
-
|
|
683
|
-
const e =
|
|
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(() =>
|
|
693
|
+
const n = new ResizeObserver(() => m());
|
|
686
694
|
return n.observe(e), () => n.disconnect();
|
|
687
|
-
}, [
|
|
688
|
-
if (
|
|
689
|
-
const e =
|
|
690
|
-
|
|
691
|
-
}, [
|
|
692
|
-
const
|
|
693
|
-
if (
|
|
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
|
|
696
|
-
if (
|
|
697
|
-
const
|
|
698
|
-
|
|
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
|
-
|
|
708
|
+
m(), v.current = requestAnimationFrame(n);
|
|
701
709
|
};
|
|
702
|
-
|
|
703
|
-
}, [
|
|
704
|
-
|
|
705
|
-
}, []),
|
|
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(),
|
|
708
|
-
if (e.button === 0 &&
|
|
709
|
-
const
|
|
710
|
-
if (
|
|
711
|
-
const
|
|
712
|
-
|
|
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:
|
|
722
|
+
dragLaneId: r.id,
|
|
715
723
|
dragStartY: e.clientY,
|
|
716
724
|
currentY: e.clientY,
|
|
717
|
-
insertIndex:
|
|
725
|
+
insertIndex: h
|
|
718
726
|
}, e.currentTarget.style.cursor = "grabbing";
|
|
719
727
|
return;
|
|
720
728
|
}
|
|
721
729
|
}
|
|
722
|
-
if (e.button === 0 &&
|
|
723
|
-
const
|
|
724
|
-
if (!(Math.abs(
|
|
725
|
-
|
|
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
|
-
|
|
731
|
-
const
|
|
732
|
-
|
|
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
|
-
|
|
742
|
+
b.current = "slide", re.current = e.clientX;
|
|
735
743
|
else if (e.button === 2) {
|
|
736
|
-
if (
|
|
744
|
+
if (t.current && Me(f, n.height))
|
|
737
745
|
return;
|
|
738
|
-
|
|
746
|
+
b.current = "zoom", re.current = e.clientX;
|
|
739
747
|
}
|
|
740
|
-
}, [
|
|
741
|
-
|
|
742
|
-
const e = (
|
|
743
|
-
const
|
|
744
|
-
if (
|
|
745
|
-
|
|
746
|
-
const
|
|
747
|
-
if (
|
|
748
|
-
const
|
|
749
|
-
let
|
|
750
|
-
const
|
|
751
|
-
let
|
|
752
|
-
for (let
|
|
753
|
-
const
|
|
754
|
-
if (
|
|
755
|
-
|
|
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
|
-
|
|
766
|
+
Le += Ne + We;
|
|
759
767
|
}
|
|
760
|
-
|
|
768
|
+
f.insertIndex = Pe;
|
|
761
769
|
}
|
|
762
|
-
|
|
770
|
+
m();
|
|
763
771
|
return;
|
|
764
772
|
}
|
|
765
|
-
if (
|
|
766
|
-
const
|
|
767
|
-
if (!
|
|
768
|
-
const
|
|
769
|
-
if (
|
|
770
|
-
|
|
771
|
-
const
|
|
772
|
-
|
|
773
|
-
const
|
|
774
|
-
|
|
775
|
-
} else if (
|
|
776
|
-
const
|
|
777
|
-
if (
|
|
778
|
-
const
|
|
779
|
-
|
|
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 (
|
|
782
|
-
const
|
|
783
|
-
|
|
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
|
|
787
|
-
const
|
|
788
|
-
if (
|
|
789
|
-
const
|
|
790
|
-
if (
|
|
791
|
-
const
|
|
792
|
-
|
|
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
|
-
|
|
802
|
+
L.current = null, M.current && (M.current.style.cursor = "default"), m();
|
|
795
803
|
return;
|
|
796
804
|
}
|
|
797
|
-
|
|
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
|
-
}, [
|
|
803
|
-
const
|
|
804
|
-
const n =
|
|
805
|
-
|
|
806
|
-
}, [
|
|
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 =
|
|
816
|
+
const n = M.current;
|
|
809
817
|
if (!n) return;
|
|
810
|
-
const
|
|
811
|
-
if (
|
|
812
|
-
const
|
|
813
|
-
if (
|
|
814
|
-
let
|
|
815
|
-
for (const
|
|
816
|
-
const
|
|
817
|
-
if (
|
|
818
|
-
|
|
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
|
-
|
|
824
|
-
}, [
|
|
825
|
-
|
|
826
|
-
const e =
|
|
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",
|
|
829
|
-
}, [
|
|
830
|
-
const e =
|
|
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 = (
|
|
833
|
-
|
|
834
|
-
const
|
|
835
|
-
if (
|
|
836
|
-
const
|
|
837
|
-
|
|
838
|
-
} else
|
|
839
|
-
},
|
|
840
|
-
|
|
841
|
-
const
|
|
842
|
-
if (
|
|
843
|
-
const
|
|
844
|
-
if (
|
|
845
|
-
else if (
|
|
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
|
-
|
|
848
|
-
const
|
|
849
|
-
|
|
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 (
|
|
852
|
-
const
|
|
853
|
-
if (
|
|
854
|
-
const
|
|
855
|
-
|
|
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 (
|
|
858
|
-
const
|
|
859
|
-
|
|
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
|
-
},
|
|
862
|
-
|
|
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",
|
|
865
|
-
e.removeEventListener("touchstart", n), e.removeEventListener("touchmove",
|
|
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
|
-
}, [
|
|
868
|
-
const
|
|
869
|
-
var
|
|
870
|
-
if (
|
|
871
|
-
const n = e.currentTarget.getBoundingClientRect(),
|
|
872
|
-
if (
|
|
873
|
-
const
|
|
874
|
-
if (
|
|
875
|
-
e.currentTarget.style.cursor =
|
|
876
|
-
else if (
|
|
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
|
|
880
|
-
e.currentTarget.style.cursor =
|
|
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
|
-
|
|
885
|
-
}, [
|
|
886
|
-
var
|
|
887
|
-
if (performance.now() -
|
|
888
|
-
const
|
|
889
|
-
|
|
890
|
-
}, [
|
|
891
|
-
var
|
|
892
|
-
const n = e.currentTarget.getBoundingClientRect(),
|
|
893
|
-
|
|
894
|
-
}, [
|
|
895
|
-
const n = e.currentTarget.getBoundingClientRect(),
|
|
896
|
-
|
|
897
|
-
}, [
|
|
898
|
-
return
|
|
899
|
-
|
|
900
|
-
}, []), /* @__PURE__ */
|
|
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:
|
|
915
|
+
ref: M,
|
|
904
916
|
style: { width: "100%", flex: 1, minHeight: 0, display: "block", cursor: "default" },
|
|
905
|
-
onMouseDown:
|
|
906
|
-
onMouseMove:
|
|
907
|
-
onClick:
|
|
908
|
-
onDoubleClick:
|
|
917
|
+
onMouseDown: Ie,
|
|
918
|
+
onMouseMove: $,
|
|
919
|
+
onClick: ue,
|
|
920
|
+
onDoubleClick: H,
|
|
909
921
|
onMouseLeave: () => {
|
|
910
922
|
var e;
|
|
911
|
-
|
|
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:
|
|
925
|
+
onContextMenu: te
|
|
914
926
|
}
|
|
915
927
|
);
|
|
916
928
|
}
|
|
917
929
|
);
|
|
918
|
-
|
|
919
|
-
const
|
|
920
|
-
startTime:
|
|
921
|
-
endTime:
|
|
922
|
-
currentTime:
|
|
923
|
-
clock:
|
|
924
|
-
onTimeChange:
|
|
925
|
-
onPlayPause:
|
|
926
|
-
onMultiplierChange:
|
|
927
|
-
height:
|
|
928
|
-
showControls:
|
|
929
|
-
showJumpToStart:
|
|
930
|
-
showJumpToEnd:
|
|
931
|
-
enableDrag:
|
|
932
|
-
dateTimeFormat:
|
|
933
|
-
onDateTimeClick:
|
|
934
|
-
jumpToTime:
|
|
935
|
-
maxTicks:
|
|
936
|
-
ffSpeeds:
|
|
937
|
-
rwSpeeds:
|
|
938
|
-
theme:
|
|
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:
|
|
942
|
-
showSwimLanes:
|
|
943
|
-
onShowSwimLanesChange:
|
|
944
|
-
swimLaneTransition:
|
|
945
|
-
onSwimLaneItemClick:
|
|
946
|
-
onSwimLaneItemHover:
|
|
947
|
-
onSwimLaneItemDoubleClick:
|
|
948
|
-
onSwimLaneItemContextMenu:
|
|
949
|
-
onSwimLaneReorder:
|
|
950
|
-
labels:
|
|
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
|
|
953
|
-
() =>
|
|
954
|
-
), [
|
|
955
|
-
|
|
956
|
-
|
|
957
|
-
}, [
|
|
958
|
-
const
|
|
959
|
-
const
|
|
960
|
-
|
|
961
|
-
},
|
|
962
|
-
|
|
963
|
-
const
|
|
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
|
|
972
|
-
|
|
973
|
-
|
|
974
|
-
|
|
975
|
-
|
|
976
|
-
|
|
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
|
|
981
|
-
|
|
992
|
+
return l.onTick.addEventListener(a), () => {
|
|
993
|
+
l.onTick.removeEventListener(a);
|
|
982
994
|
};
|
|
983
|
-
}, [
|
|
984
|
-
if (
|
|
985
|
-
const
|
|
986
|
-
if (
|
|
987
|
-
const
|
|
988
|
-
if (
|
|
989
|
-
const { startMs:
|
|
990
|
-
|
|
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(
|
|
994
|
-
}, [
|
|
995
|
-
if (!
|
|
996
|
-
const
|
|
997
|
-
if (me(
|
|
998
|
-
const { startMs:
|
|
999
|
-
|
|
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
|
-
}, [
|
|
1002
|
-
const
|
|
1003
|
-
|
|
1004
|
-
}, me = (
|
|
1005
|
-
|
|
1006
|
-
},
|
|
1007
|
-
|
|
1008
|
-
},
|
|
1009
|
-
const
|
|
1010
|
-
ue
|
|
1011
|
-
},
|
|
1012
|
-
const
|
|
1013
|
-
ue
|
|
1014
|
-
},
|
|
1015
|
-
var
|
|
1016
|
-
const
|
|
1017
|
-
|
|
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
|
|
1020
|
-
const
|
|
1021
|
-
|
|
1022
|
-
},
|
|
1023
|
-
|
|
1024
|
-
|
|
1025
|
-
|
|
1026
|
-
|
|
1027
|
-
|
|
1028
|
-
|
|
1029
|
-
|
|
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:
|
|
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:
|
|
1054
|
+
transition: he === "animated" ? "height 0.2s ease" : void 0
|
|
1041
1055
|
},
|
|
1042
1056
|
children: [
|
|
1043
|
-
|
|
1044
|
-
|
|
1057
|
+
ae && /* @__PURE__ */ i.jsx("div", { ref: re, children: /* @__PURE__ */ i.jsx(
|
|
1058
|
+
Rt,
|
|
1045
1059
|
{
|
|
1046
|
-
currentTime:
|
|
1047
|
-
isPlaying:
|
|
1048
|
-
multiplier:
|
|
1049
|
-
isLive:
|
|
1050
|
-
hasStartTime:
|
|
1051
|
-
hasEndTime:
|
|
1052
|
-
showJumpToStart:
|
|
1053
|
-
showJumpToEnd:
|
|
1054
|
-
onPlayPause:
|
|
1055
|
-
onJumpToStart:
|
|
1056
|
-
onRewind:
|
|
1057
|
-
onFastForward:
|
|
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:
|
|
1060
|
-
onResetSpeed: () =>
|
|
1061
|
-
onDateTimeClick:
|
|
1062
|
-
dateTimeFormat:
|
|
1063
|
-
timezone:
|
|
1064
|
-
theme:
|
|
1065
|
-
swimLanesVisible:
|
|
1066
|
-
onToggleSwimLanes:
|
|
1067
|
-
labels:
|
|
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
|
-
|
|
1071
|
-
|
|
1084
|
+
K !== !1 && /* @__PURE__ */ i.jsx(
|
|
1085
|
+
Ze,
|
|
1072
1086
|
{
|
|
1073
|
-
ref:
|
|
1074
|
-
currentTime:
|
|
1075
|
-
defaultStartMs:
|
|
1076
|
-
defaultEndMs:
|
|
1077
|
-
theme:
|
|
1078
|
-
maxTicks:
|
|
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
|
-
|
|
1098
|
+
ve.current = !0;
|
|
1083
1099
|
},
|
|
1084
1100
|
onDragEnd: () => {
|
|
1085
|
-
|
|
1101
|
+
ve.current = !1;
|
|
1086
1102
|
},
|
|
1087
|
-
swimLanes:
|
|
1103
|
+
swimLanes: ne,
|
|
1088
1104
|
showSwimLanes: E,
|
|
1089
|
-
onSwimLaneItemClick:
|
|
1090
|
-
onSwimLaneItemHover:
|
|
1091
|
-
onSwimLaneItemDoubleClick:
|
|
1092
|
-
onSwimLaneItemContextMenu:
|
|
1093
|
-
onSwimLaneReorder:
|
|
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
|
-
},
|
|
1100
|
-
startTime:
|
|
1101
|
-
endTime:
|
|
1102
|
-
currentTime:
|
|
1103
|
-
width:
|
|
1104
|
-
height:
|
|
1105
|
-
tickInterval:
|
|
1106
|
-
showLabels:
|
|
1107
|
-
snapToTicks:
|
|
1108
|
-
enableDrag:
|
|
1109
|
-
theme:
|
|
1110
|
-
onTimeChange:
|
|
1111
|
-
onVisibleRangeChange:
|
|
1112
|
-
onDragStart:
|
|
1113
|
-
onDragEnd:
|
|
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
|
|
1116
|
-
() =>
|
|
1117
|
-
[
|
|
1118
|
-
),
|
|
1119
|
-
() =>
|
|
1120
|
-
[
|
|
1121
|
-
),
|
|
1122
|
-
if (!
|
|
1123
|
-
const
|
|
1124
|
-
if (!(Math.abs(
|
|
1125
|
-
let
|
|
1126
|
-
|
|
1127
|
-
const
|
|
1128
|
-
|
|
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
|
-
|
|
1132
|
-
const
|
|
1133
|
-
let
|
|
1134
|
-
const
|
|
1135
|
-
|
|
1136
|
-
if (
|
|
1137
|
-
const
|
|
1138
|
-
|
|
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
|
-
|
|
1156
|
+
Z.current = null;
|
|
1141
1157
|
}));
|
|
1142
|
-
},
|
|
1143
|
-
document.removeEventListener("mousemove",
|
|
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",
|
|
1146
|
-
},
|
|
1161
|
+
document.addEventListener("mousemove", W), document.addEventListener("mouseup", S);
|
|
1162
|
+
}, T = (g) => {
|
|
1147
1163
|
g.preventDefault();
|
|
1148
|
-
const
|
|
1149
|
-
if (Math.abs(
|
|
1150
|
-
const
|
|
1151
|
-
|
|
1152
|
-
|
|
1153
|
-
|
|
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__ */
|
|
1172
|
+
return /* @__PURE__ */ i.jsxs(
|
|
1157
1173
|
"svg",
|
|
1158
1174
|
{
|
|
1159
1175
|
width: "100%",
|
|
1160
|
-
height:
|
|
1161
|
-
style: { backgroundColor:
|
|
1162
|
-
onMouseDown:
|
|
1163
|
-
onWheel:
|
|
1176
|
+
height: C,
|
|
1177
|
+
style: { backgroundColor: J.backgroundColor, display: "block", cursor: "default" },
|
|
1178
|
+
onMouseDown: ce,
|
|
1179
|
+
onWheel: T,
|
|
1164
1180
|
children: [
|
|
1165
|
-
/* @__PURE__ */
|
|
1166
|
-
|
|
1167
|
-
/* @__PURE__ */
|
|
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:
|
|
1187
|
+
y1: C - (g.isMajor ? J.majorTickHeight : J.minorTickHeight),
|
|
1172
1188
|
x2: g.position,
|
|
1173
|
-
y2:
|
|
1174
|
-
stroke: g.isMajor ?
|
|
1189
|
+
y2: C,
|
|
1190
|
+
stroke: g.isMajor ? J.majorTickColor : J.tickColor,
|
|
1175
1191
|
strokeWidth: "1"
|
|
1176
1192
|
}
|
|
1177
1193
|
),
|
|
1178
|
-
|
|
1194
|
+
O && g.isMajor && g.label && /* @__PURE__ */ i.jsx(
|
|
1179
1195
|
"text",
|
|
1180
1196
|
{
|
|
1181
1197
|
x: g.position,
|
|
1182
|
-
y:
|
|
1198
|
+
y: C - J.majorTickHeight - 5,
|
|
1183
1199
|
textAnchor: "middle",
|
|
1184
|
-
fill:
|
|
1185
|
-
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__ */
|
|
1206
|
+
] }, M)),
|
|
1207
|
+
/* @__PURE__ */ i.jsx(
|
|
1192
1208
|
"line",
|
|
1193
1209
|
{
|
|
1194
|
-
x1:
|
|
1210
|
+
x1: se,
|
|
1195
1211
|
y1: 0,
|
|
1196
|
-
x2:
|
|
1197
|
-
y2:
|
|
1198
|
-
stroke:
|
|
1199
|
-
strokeWidth:
|
|
1212
|
+
x2: se,
|
|
1213
|
+
y2: C,
|
|
1214
|
+
stroke: J.indicatorColor,
|
|
1215
|
+
strokeWidth: J.indicatorLineWidth,
|
|
1200
1216
|
pointerEvents: "none"
|
|
1201
1217
|
}
|
|
1202
1218
|
),
|
|
1203
|
-
|
|
1219
|
+
ae && /* @__PURE__ */ i.jsx(
|
|
1204
1220
|
"rect",
|
|
1205
1221
|
{
|
|
1206
|
-
x: Math.max(0,
|
|
1222
|
+
x: Math.max(0, se - 10),
|
|
1207
1223
|
y: 0,
|
|
1208
1224
|
width: 20,
|
|
1209
|
-
height:
|
|
1225
|
+
height: C,
|
|
1210
1226
|
fill: "transparent",
|
|
1211
1227
|
style: { cursor: "ew-resize" },
|
|
1212
1228
|
pointerEvents: "visiblePainted"
|
|
1213
1229
|
}
|
|
1214
1230
|
),
|
|
1215
|
-
/* @__PURE__ */
|
|
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
|
-
|
|
1222
|
-
|
|
1223
|
-
|
|
1224
|
-
|
|
1225
|
-
|
|
1237
|
+
kt as TICK_AREA_HEIGHT,
|
|
1238
|
+
At as Timeline,
|
|
1239
|
+
Ze as TimelineCanvas,
|
|
1240
|
+
Rt as TimelineControls,
|
|
1241
|
+
_t as TimelineSVG
|
|
1226
1242
|
};
|