@kteneyck/cesium-timeline-core 0.10.0 → 0.11.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -81,7 +81,7 @@ function Ie(e) {
81
81
  function Te(e, t) {
82
82
  return N(t) - N(e);
83
83
  }
84
- const Se = ["Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec"], be = ["January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December"], ue = {
84
+ const Se = ["Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec"], ye = ["January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December"], ue = {
85
85
  /** e.g. "Feb 24 2026 14:04:07" — default */
86
86
  DEFAULT: "MMM DD YYYY HH:mm:ss",
87
87
  /** e.g. "Feb 24 2026 02:04:07 PM" */
@@ -104,8 +104,8 @@ const Se = ["Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct"
104
104
  };
105
105
  function ne(e, t) {
106
106
  if (!t || t === "local") {
107
- const p = e.getFullYear(), f = e.getMonth(), y = e.getDate(), b = e.getHours(), d = b % 12 || 12, u = e.getMinutes(), T = e.getSeconds(), $ = e.getMilliseconds();
108
- return { yr: p, mo: f, day: y, hr24: b, hr12: d, min: u, sec: T, ms: $, ampm: b < 12 ? "AM" : "PM" };
107
+ const p = e.getFullYear(), u = e.getMonth(), L = e.getDate(), T = e.getHours(), M = T % 12 || 12, f = e.getMinutes(), d = e.getSeconds(), $ = e.getMilliseconds();
108
+ return { yr: p, mo: u, day: L, hr24: T, hr12: M, min: f, sec: d, ms: $, ampm: T < 12 ? "AM" : "PM" };
109
109
  }
110
110
  const o = new Intl.DateTimeFormat("en-US", {
111
111
  timeZone: t,
@@ -119,102 +119,101 @@ function ne(e, t) {
119
119
  }), s = {};
120
120
  for (const p of o.formatToParts(e))
121
121
  p.type !== "literal" && (s[p.type] = p.value);
122
- const n = parseInt(s.year), l = parseInt(s.month) - 1, a = parseInt(s.day);
122
+ const r = parseInt(s.year), l = parseInt(s.month) - 1, a = parseInt(s.day);
123
123
  let i = parseInt(s.hour);
124
124
  i === 24 && (i = 0);
125
- const m = i % 12 || 12, c = parseInt(s.minute), M = parseInt(s.second), h = e.getMilliseconds();
126
- return { yr: n, mo: l, day: a, hr24: i, hr12: m, min: c, sec: M, ms: h, ampm: i < 12 ? "AM" : "PM" };
125
+ const m = i % 12 || 12, c = parseInt(s.minute), S = parseInt(s.second), h = e.getMilliseconds();
126
+ return { yr: r, mo: l, day: a, hr24: i, hr12: m, min: c, sec: S, ms: h, ampm: i < 12 ? "AM" : "PM" };
127
127
  }
128
128
  function Re(e, t) {
129
- var n;
130
129
  if (!t || t === "local") return null;
131
130
  const o = oe(e);
132
- return ((n = new Intl.DateTimeFormat("en-US", {
131
+ return new Intl.DateTimeFormat("en-US", {
133
132
  timeZone: t,
134
133
  timeZoneName: "short"
135
- }).formatToParts(o).find((l) => l.type === "timeZoneName")) == null ? void 0 : n.value) ?? null;
134
+ }).formatToParts(o).find((r) => r.type === "timeZoneName")?.value ?? null;
136
135
  }
137
- function ye(e, t = ue.DEFAULT, o) {
138
- const s = oe(e), { yr: n, mo: l, day: a, hr24: i, hr12: m, min: c, sec: M, ms: h, ampm: p } = ne(s, o), f = (d) => String(d).padStart(2, "0"), y = (d) => String(d).padStart(3, "0"), b = {
139
- YYYY: String(n),
140
- YY: String(n).slice(-2),
141
- MMMM: be[l],
136
+ function be(e, t = ue.DEFAULT, o) {
137
+ const s = oe(e), { yr: r, mo: l, day: a, hr24: i, hr12: m, min: c, sec: S, ms: h, ampm: p } = ne(s, o), u = (M) => String(M).padStart(2, "0"), L = (M) => String(M).padStart(3, "0"), T = {
138
+ YYYY: String(r),
139
+ YY: String(r).slice(-2),
140
+ MMMM: ye[l],
142
141
  MMM: Se[l],
143
- MM: f(l + 1),
142
+ MM: u(l + 1),
144
143
  M: String(l + 1),
145
- DD: f(a),
144
+ DD: u(a),
146
145
  D: String(a),
147
- HH: f(i),
146
+ HH: u(i),
148
147
  H: String(i),
149
- hh: f(m),
148
+ hh: u(m),
150
149
  h: String(m),
151
- mm: f(c),
152
- ss: f(M),
153
- SSS: y(h),
150
+ mm: u(c),
151
+ ss: u(S),
152
+ SSS: L(h),
154
153
  A: p,
155
154
  a: p.toLowerCase()
156
155
  };
157
156
  return t.replace(
158
157
  /YYYY|YY|MMMM|MMM|MM|M|DD|D|HH|H|hh|h|mm|ss|SSS|A|a/g,
159
- (d) => b[d] ?? d
158
+ (M) => T[M] ?? M
160
159
  );
161
160
  }
162
161
  function Je(e = ue.DEFAULT) {
163
162
  const t = ["YYYY", "YY", "MMMM", "MMM", "MM", "M", "DD", "D"], o = ["HH", "H", "hh", "h", "mm", "ss", "SSS", "A", "a"], s = (a) => a.replace(/\s{2,}/g, " ").trim().replace(/^[\s\W]+|[\s\W]+$/g, "").trim();
164
- let n = e;
165
- for (const a of t) n = n.replace(a, "");
163
+ let r = e;
164
+ for (const a of t) r = r.replace(a, "");
166
165
  let l = e;
167
166
  for (const a of o) l = l.replace(a, "");
168
- return { timeFormat: s(n), dateFormat: s(l) };
167
+ return { timeFormat: s(r), dateFormat: s(l) };
169
168
  }
170
169
  function Fe(e, t = !1) {
171
- return ye(e, t ? "HH:mm:ss" : "HH:mm");
170
+ return be(e, t ? "HH:mm:ss" : "HH:mm");
172
171
  }
173
172
  function De(e, t, o, s) {
174
- const n = N(e), l = N(t), a = N(o);
173
+ const r = N(e), l = N(t), a = N(o);
175
174
  if (a === l) return 0;
176
- const i = (n - l) / (a - l);
175
+ const i = (r - l) / (a - l);
177
176
  return Math.max(0, Math.min(1, i)) * s;
178
177
  }
179
178
  function Ne(e, t, o, s) {
180
- const n = Math.max(0, Math.min(1, e / s)), l = N(t), a = N(o), i = l + n * (a - l);
179
+ const r = Math.max(0, Math.min(1, e / s)), l = N(t), a = N(o), i = l + r * (a - l);
181
180
  return A.JulianDate.fromDate(new Date(i));
182
181
  }
183
182
  function _e(e, t, o, s) {
184
- const n = [], l = Te(e, t), a = N(e);
183
+ const r = [], l = Te(e, t), a = N(e);
185
184
  let i;
186
185
  typeof o == "number" && o in fe || typeof o == "number" ? i = o * 60 * 1e3 : i = 3600 * 1e3;
187
186
  const m = i * 4;
188
- let c = a, M = 0;
187
+ let c = a, S = 0;
189
188
  for (; c <= a + l; ) {
190
- const h = M * i % m === 0, p = De(
189
+ const h = S * i % m === 0, p = De(
191
190
  new Date(c),
192
191
  e,
193
192
  t,
194
193
  s
195
194
  );
196
- let f;
195
+ let u;
197
196
  if (h) {
198
- const y = new Date(c), b = y.getHours().toString().padStart(2, "0"), d = y.getMinutes().toString().padStart(2, "0");
199
- f = `${b}:${d}`;
197
+ const L = new Date(c), T = L.getHours().toString().padStart(2, "0"), M = L.getMinutes().toString().padStart(2, "0");
198
+ u = `${T}:${M}`;
200
199
  }
201
- n.push({
200
+ r.push({
202
201
  position: p,
203
202
  isMajor: h,
204
- label: f
205
- }), c += i, M++;
203
+ label: u
204
+ }), c += i, S++;
206
205
  }
207
- return n;
206
+ return r;
208
207
  }
209
208
  function We(e, t, o = 10) {
210
- let s = t[0], n = Math.abs(s.position - e);
209
+ let s = t[0], r = Math.abs(s.position - e);
211
210
  for (const l of t) {
212
211
  const a = Math.abs(l.position - e);
213
- a < n && (n = a, s = l);
212
+ a < r && (r = a, s = l);
214
213
  }
215
- return n <= o ? s.position : e;
214
+ return r <= o ? s.position : e;
216
215
  }
217
- const ke = 1e3, Le = 31536e9, L = [
216
+ const ke = 1e3, Le = 31536e9, k = [
218
217
  1e-3,
219
218
  2e-3,
220
219
  5e-3,
@@ -267,52 +266,51 @@ const ke = 1e3, Le = 31536e9, L = [
267
266
  function E(e) {
268
267
  return e < 10 ? `0${e}` : `${e}`;
269
268
  }
270
- function ce(e, t, o, s, n) {
271
- const l = new Date(e), { yr: a, mo: i, day: m, hr24: c, hr12: M, min: h, sec: p, ms: f, ampm: y } = ne(l, o), b = s ? M : c, d = s ? ` ${y}` : "", u = n ?? Ae;
269
+ function ce(e, t, o, s, r) {
270
+ const l = new Date(e), { yr: a, mo: i, day: m, hr24: c, hr12: S, min: h, sec: p, ms: u, ampm: L } = ne(l, o), T = s ? S : c, M = s ? ` ${L}` : "", f = r ?? Ae;
272
271
  if (t > 31536e4) return `${a}`;
273
- if (t > 31536e3) return `${u[i]} ${a}`;
274
- if (t > 604800) return `${u[i]} ${m}`;
275
- if (t > 86400) return `${u[i]} ${m} ${E(b)}:${E(h)}${d}`;
276
- if (t > 3600) return `${E(b)}:${E(h)}${d}`;
277
- if (t > 60) return `${E(b)}:${E(h)}:${E(p)}${d}`;
278
- const T = f > 0 ? `.${String(f).padStart(3, "0")}` : "";
279
- return `${E(b)}:${E(h)}:${E(p)}${T}${d}`;
272
+ if (t > 31536e3) return `${f[i]} ${a}`;
273
+ if (t > 604800) return `${f[i]} ${m}`;
274
+ if (t > 86400) return `${f[i]} ${m} ${E(T)}:${E(h)}${M}`;
275
+ if (t > 3600) return `${E(T)}:${E(h)}${M}`;
276
+ if (t > 60) return `${E(T)}:${E(h)}:${E(p)}${M}`;
277
+ const d = u > 0 ? `.${String(u).padStart(3, "0")}` : "";
278
+ return `${E(T)}:${E(h)}:${E(p)}${d}${M}`;
280
279
  }
281
280
  function Ce(e, t, o) {
282
281
  const s = new Date(e);
283
282
  if (!o || o === "local") {
284
- const m = s.getFullYear(), c = s.getMonth(), M = s.getDate();
285
- return t > 31536e4 ? new Date(Math.floor(m / 100) * 100, 0).getTime() : t > 31536e3 ? new Date(Math.floor(m / 10) * 10, 0).getTime() : t > 86400 ? new Date(m, 0).getTime() : new Date(m, c, M).getTime();
283
+ const m = s.getFullYear(), c = s.getMonth(), S = s.getDate();
284
+ return t > 31536e4 ? new Date(Math.floor(m / 100) * 100, 0).getTime() : t > 31536e3 ? new Date(Math.floor(m / 10) * 10, 0).getTime() : t > 86400 ? new Date(m, 0).getTime() : new Date(m, c, S).getTime();
286
285
  }
287
- const { yr: n, hr24: l, min: a, sec: i } = ne(s, o);
288
- return t > 31536e4 ? Date.UTC(Math.floor(n / 100) * 100, 0, 1) : t > 31536e3 ? Date.UTC(Math.floor(n / 10) * 10, 0, 1) : t > 86400 ? Date.UTC(n, 0, 1) : e - (l * 3600 + a * 60 + i) * 1e3;
286
+ const { yr: r, hr24: l, min: a, sec: i } = ne(s, o);
287
+ return t > 31536e4 ? Date.UTC(Math.floor(r / 100) * 100, 0, 1) : t > 31536e3 ? Date.UTC(Math.floor(r / 10) * 10, 0, 1) : t > 86400 ? Date.UTC(r, 0, 1) : e - (l * 3600 + a * 60 + i) * 1e3;
289
288
  }
290
289
  function te(e, t) {
291
290
  return Math.ceil(e / t + 0.5) * t;
292
291
  }
293
292
  function he(e, t, o) {
294
- var s, n, l, a, i, m, c, M, h, p, f, y;
295
293
  return {
296
- color: ((s = t.style) == null ? void 0 : s.color) ?? ((n = e.style) == null ? void 0 : n.color) ?? J.color,
297
- borderColor: ((l = t.style) == null ? void 0 : l.borderColor) ?? ((a = e.style) == null ? void 0 : a.borderColor) ?? (o == null ? void 0 : o.swimLaneItemBorderColor) ?? J.borderColor,
298
- borderWidth: ((i = t.style) == null ? void 0 : i.borderWidth) ?? ((m = e.style) == null ? void 0 : m.borderWidth) ?? (o == null ? void 0 : o.swimLaneItemBorderWidth) ?? J.borderWidth,
299
- opacity: ((c = t.style) == null ? void 0 : c.opacity) ?? ((M = e.style) == null ? void 0 : M.opacity) ?? J.opacity,
300
- markerShape: ((h = t.style) == null ? void 0 : h.markerShape) ?? ((p = e.style) == null ? void 0 : p.markerShape) ?? J.markerShape,
301
- markerSize: ((f = t.style) == null ? void 0 : f.markerSize) ?? ((y = e.style) == null ? void 0 : y.markerSize) ?? J.markerSize
294
+ color: t.style?.color ?? e.style?.color ?? J.color,
295
+ borderColor: t.style?.borderColor ?? e.style?.borderColor ?? o?.swimLaneItemBorderColor ?? J.borderColor,
296
+ borderWidth: t.style?.borderWidth ?? e.style?.borderWidth ?? o?.swimLaneItemBorderWidth ?? J.borderWidth,
297
+ opacity: t.style?.opacity ?? e.style?.opacity ?? J.opacity,
298
+ markerShape: t.style?.markerShape ?? e.style?.markerShape ?? J.markerShape,
299
+ markerSize: t.style?.markerSize ?? e.style?.markerSize ?? J.markerSize
302
300
  };
303
301
  }
304
302
  function pe(e) {
305
303
  return Math.max(ke, Math.min(Le, e));
306
304
  }
307
305
  function Ue(e, t, o) {
308
- const s = t - e, n = (e + t) / 2, l = pe(s * o);
306
+ const s = t - e, r = (e + t) / 2, l = pe(s * o);
309
307
  return {
310
- startMs: n - l / 2,
311
- endMs: n + l / 2
308
+ startMs: r - l / 2,
309
+ endMs: r + l / 2
312
310
  };
313
311
  }
314
312
  function ve(e, t, o, s) {
315
- const n = t - e, l = pe(n * o), a = n > 0 ? (s - e) / n : 0.5;
313
+ const r = t - e, l = pe(r * o), a = r > 0 ? (s - e) / r : 0.5;
316
314
  return {
317
315
  startMs: s - a * l,
318
316
  endMs: s + (1 - a) * l
@@ -323,25 +321,25 @@ function Be(e) {
323
321
  for (const o of e) t += (o.height ?? F) + O;
324
322
  return t;
325
323
  }
326
- function ze(e, t, o, s, n) {
327
- const { swimLanes: l, showSwimLanes: a, scrollTop: i, startMs: m, endMs: c, theme: M } = n;
324
+ function ze(e, t, o, s, r) {
325
+ const { swimLanes: l, showSwimLanes: a, scrollTop: i, startMs: m, endMs: c, theme: S } = r;
328
326
  if (!a || l.length === 0) return null;
329
327
  const h = Math.max(0, s - G);
330
328
  if (t < 0 || t >= h) return null;
331
329
  let p = -i;
332
- for (const f of l) {
333
- const y = f.height ?? F, b = p, d = p + y;
334
- if (p += y + O, !(t < b || t >= d)) {
335
- for (const u of f.items) {
336
- if (u.interval) {
337
- const T = A.JulianDate.toDate(u.interval.start).getTime(), $ = A.JulianDate.toDate(u.interval.stop).getTime(), j = (T - m) / (c - m) * o, C = ($ - m) / (c - m) * o;
330
+ for (const u of l) {
331
+ const L = u.height ?? F, T = p, M = p + L;
332
+ if (p += L + O, !(t < T || t >= M)) {
333
+ for (const f of u.items) {
334
+ if (f.interval) {
335
+ const d = A.JulianDate.toDate(f.interval.start).getTime(), $ = A.JulianDate.toDate(f.interval.stop).getTime(), j = (d - m) / (c - m) * o, C = ($ - m) / (c - m) * o;
338
336
  if (e >= Math.max(0, j) && e <= Math.min(o, C))
339
- return { lane: f, item: u };
337
+ return { lane: u, item: f };
340
338
  }
341
- if (u.instant) {
342
- const $ = (A.JulianDate.toDate(u.instant).getTime() - m) / (c - m) * o, j = he(f, u, M);
339
+ if (f.instant) {
340
+ const $ = (A.JulianDate.toDate(f.instant).getTime() - m) / (c - m) * o, j = he(u, f, S);
343
341
  if (Math.abs(e - $) <= j.markerSize / 2 + 2)
344
- return { lane: f, item: u };
342
+ return { lane: u, item: f };
345
343
  }
346
344
  }
347
345
  return null;
@@ -350,15 +348,15 @@ function ze(e, t, o, s, n) {
350
348
  return null;
351
349
  }
352
350
  function je(e, t, o, s) {
353
- const { swimLanes: n, showSwimLanes: l, scrollTop: a } = s;
354
- if (!l || n.length === 0 || e > 80) return null;
351
+ const { swimLanes: r, showSwimLanes: l, scrollTop: a } = s;
352
+ if (!l || r.length === 0 || e > 80) return null;
355
353
  const i = Math.max(0, o - G);
356
354
  if (t < 0 || t >= i) return null;
357
355
  let m = -a;
358
- for (const c of n) {
359
- const M = c.height ?? F;
360
- if (t >= m && t < m + M) return c;
361
- m += M + O;
356
+ for (const c of r) {
357
+ const S = c.height ?? F;
358
+ if (t >= m && t < m + S) return c;
359
+ m += S + O;
362
360
  }
363
361
  return null;
364
362
  }
@@ -369,141 +367,141 @@ function Xe(e, t, o) {
369
367
  }
370
368
  function Ge(e, t, o, s) {
371
369
  const {
372
- startMs: n,
370
+ startMs: r,
373
371
  endMs: l,
374
372
  currentMs: a,
375
373
  theme: i,
376
374
  maxTicks: m,
377
375
  swimLanes: c,
378
- showSwimLanes: M,
376
+ showSwimLanes: S,
379
377
  reorderState: h,
380
378
  timezone: p,
381
- use12h: f,
382
- months: y,
383
- rangeSelection: b,
384
- hoverMs: d
379
+ use12h: u,
380
+ months: L,
381
+ rangeSelection: T,
382
+ hoverMs: M
385
383
  } = s;
386
- let { scrollTop: u } = s;
387
- const T = (l - n) / 1e3;
388
- if (T <= 0) return u;
384
+ let { scrollTop: f } = s;
385
+ const d = (l - r) / 1e3;
386
+ if (d <= 0) return f;
389
387
  e.fillStyle = i.backgroundColor, e.fillRect(0, 0, t, o);
390
- const $ = M && c.length > 0, C = $ ? Math.max(0, o - G) : 0;
388
+ const $ = S && c.length > 0, C = $ ? Math.max(0, o - G) : 0;
391
389
  let X = 0;
392
390
  if ($)
393
- for (const r of c) X += (r.height ?? F) + O;
391
+ for (const n of c) X += (n.height ?? F) + O;
394
392
  const Z = Math.max(0, X - C);
395
- if (u > Z && (u = Z), u < 0 && (u = 0), $ && C > 0) {
393
+ if (f > Z && (f = Z), f < 0 && (f = 0), $ && C > 0) {
396
394
  e.save(), e.beginPath(), e.rect(0, 0, t, C), e.clip();
397
- let r = -u;
398
- const D = (k) => (k - n) / (l - n) * t;
399
- for (const k of c) {
400
- const S = k.height ?? F, Y = r + S;
401
- if (Y > 0 && r < C) {
402
- const g = k.style, U = (g == null ? void 0 : g.backgroundColor) ?? J.backgroundColor;
403
- U && U !== "transparent" && (e.fillStyle = U, e.fillRect(0, r, t, S)), e.strokeStyle = i.tickColor + "44", e.lineWidth = 0.5, e.beginPath(), e.moveTo(0, Y), e.lineTo(t, Y), e.stroke();
404
- for (const I of k.items) {
405
- const H = he(k, I, i);
395
+ let n = -f;
396
+ const y = (b) => (b - r) / (l - r) * t;
397
+ for (const b of c) {
398
+ const g = b.height ?? F, Y = n + g;
399
+ if (Y > 0 && n < C) {
400
+ const D = b.style, U = D?.backgroundColor ?? J.backgroundColor;
401
+ U && U !== "transparent" && (e.fillStyle = U, e.fillRect(0, n, t, g)), e.strokeStyle = i.tickColor + "44", e.lineWidth = 0.5, e.beginPath(), e.moveTo(0, Y), e.lineTo(t, Y), e.stroke();
402
+ for (const I of b.items) {
403
+ const H = he(b, I, i);
406
404
  if (I.interval) {
407
- const q = A.JulianDate.toDate(I.interval.start).getTime(), w = A.JulianDate.toDate(I.interval.stop).getTime(), _ = D(q), W = D(w), Q = Math.max(0, _), x = Math.min(t, W) - Q;
405
+ const q = A.JulianDate.toDate(I.interval.start).getTime(), w = A.JulianDate.toDate(I.interval.stop).getTime(), _ = y(q), W = y(w), Q = Math.max(0, _), x = Math.min(t, W) - Q;
408
406
  if (x > 0) {
409
407
  e.globalAlpha = H.opacity, e.fillStyle = H.color;
410
- const le = 3, ae = r + le, me = S - le * 2;
408
+ const le = 3, ae = n + le, me = g - le * 2;
411
409
  e.fillRect(Q, ae, x, me), H.borderWidth > 0 && (e.strokeStyle = H.borderColor, e.lineWidth = H.borderWidth, e.strokeRect(Q, ae, x, me)), e.globalAlpha = 1;
412
410
  }
413
411
  }
414
412
  if (I.instant) {
415
- const q = A.JulianDate.toDate(I.instant).getTime(), w = D(q);
413
+ const q = A.JulianDate.toDate(I.instant).getTime(), w = y(q);
416
414
  if (w >= -H.markerSize && w <= t + H.markerSize) {
417
- const _ = r + S / 2, W = H.markerSize;
418
- e.globalAlpha = H.opacity, e.fillStyle = H.color, H.markerShape === "diamond" ? (e.beginPath(), e.moveTo(w, _ - W / 2), e.lineTo(w + W / 2, _), e.lineTo(w, _ + W / 2), e.lineTo(w - W / 2, _), e.closePath(), e.fill()) : H.markerShape === "circle" ? (e.beginPath(), e.arc(w, _, W / 2, 0, Math.PI * 2), e.fill()) : (e.strokeStyle = H.color, e.lineWidth = 2, e.beginPath(), e.moveTo(w, r + 2), e.lineTo(w, r + S - 2), e.stroke()), e.globalAlpha = 1;
415
+ const _ = n + g / 2, W = H.markerSize;
416
+ e.globalAlpha = H.opacity, e.fillStyle = H.color, H.markerShape === "diamond" ? (e.beginPath(), e.moveTo(w, _ - W / 2), e.lineTo(w + W / 2, _), e.lineTo(w, _ + W / 2), e.lineTo(w - W / 2, _), e.closePath(), e.fill()) : H.markerShape === "circle" ? (e.beginPath(), e.arc(w, _, W / 2, 0, Math.PI * 2), e.fill()) : (e.strokeStyle = H.color, e.lineWidth = 2, e.beginPath(), e.moveTo(w, n + 2), e.lineTo(w, n + g - 2), e.stroke()), e.globalAlpha = 1;
419
417
  }
420
418
  }
421
419
  }
422
- e.font = `${Math.min(11, S - 4)}px system-ui, sans-serif`, e.textAlign = "left", e.textBaseline = "middle", e.fillStyle = (g == null ? void 0 : g.labelColor) ?? J.labelColor, e.fillText(k.label, He, r + S / 2);
420
+ e.font = `${Math.min(11, g - 4)}px system-ui, sans-serif`, e.textAlign = "left", e.textBaseline = "middle", e.fillStyle = D?.labelColor ?? J.labelColor, e.fillText(b.label, He, n + g / 2);
423
421
  }
424
- if (r += S + O, r >= C) break;
422
+ if (n += g + O, n >= C) break;
425
423
  }
426
424
  if (h && h.dragging) {
427
- const k = h.currentY - h.dragStartY;
428
- let S = -u;
429
- for (let g = 0; g < c.length && g < h.insertIndex; g++)
430
- S += (c[g].height ?? F) + O;
431
- e.strokeStyle = i.indicatorColor, e.lineWidth = 2, e.beginPath(), e.moveTo(0, S), e.lineTo(t, S), e.stroke();
432
- const Y = c.find((g) => g.id === h.dragLaneId);
425
+ const b = h.currentY - h.dragStartY;
426
+ let g = -f;
427
+ for (let D = 0; D < c.length && D < h.insertIndex; D++)
428
+ g += (c[D].height ?? F) + O;
429
+ e.strokeStyle = i.indicatorColor, e.lineWidth = 2, e.beginPath(), e.moveTo(0, g), e.lineTo(t, g), e.stroke();
430
+ const Y = c.find((D) => D.id === h.dragLaneId);
433
431
  if (Y) {
434
- const g = Y.height ?? F;
435
- let U = -u;
432
+ const D = Y.height ?? F;
433
+ let U = -f;
436
434
  for (const I of c) {
437
435
  if (I.id === h.dragLaneId) break;
438
436
  U += (I.height ?? F) + O;
439
437
  }
440
- e.globalAlpha = 0.4, e.fillStyle = i.indicatorColor, e.fillRect(0, U + k, t, g), e.globalAlpha = 1;
438
+ e.globalAlpha = 0.4, e.fillStyle = i.indicatorColor, e.fillRect(0, U + b, t, D), e.globalAlpha = 1;
441
439
  }
442
440
  }
443
441
  if (X > C) {
444
- const k = t - ee - 2, S = C / X, Y = Math.max(20, C * S), g = u / Z * (C - Y);
445
- e.fillStyle = i.tickColor + "22", e.fillRect(k, 0, ee, C), e.fillStyle = i.tickColor + "88", e.fillRect(k, g, ee, Y);
442
+ const b = t - ee - 2, g = C / X, Y = Math.max(20, C * g), D = f / Z * (C - Y);
443
+ e.fillStyle = i.tickColor + "22", e.fillRect(b, 0, ee, C), e.fillStyle = i.tickColor + "88", e.fillRect(b, D, ee, Y);
446
444
  }
447
445
  e.restore();
448
446
  }
449
447
  e.font = `${i.fontSize}px monospace`;
450
- const Me = ce(n + T * 500, T, p, f, y), de = e.measureText(Me).width + 24, ge = Math.max(de / t * T, T / 1e3);
451
- let P = L[L.length - 1], v = L.length - 1;
452
- for (let r = 0; r < L.length; r++)
453
- if (L[r] > ge) {
454
- P = L[r], v = r;
448
+ const Me = ce(r + d * 500, d, p, u, L), de = e.measureText(Me).width + 24, ge = Math.max(de / t * d, d / 1e3);
449
+ let P = k[k.length - 1], v = k.length - 1;
450
+ for (let n = 0; n < k.length; n++)
451
+ if (k[n] > ge) {
452
+ P = k[n], v = n;
455
453
  break;
456
454
  }
457
455
  if (m != null && m > 0)
458
- for (; v < L.length - 1 && T / P > m; )
459
- v++, P = L[v];
456
+ for (; v < k.length - 1 && d / P > m; )
457
+ v++, P = k[v];
460
458
  let R = 0;
461
- for (let r = v - 1; r >= 0; r--)
462
- if (P % L[r] < 1e-4) {
463
- t * (L[r] / T) >= 3 && (R = L[r]);
459
+ for (let n = v - 1; n >= 0; n--)
460
+ if (P % k[n] < 1e-4) {
461
+ t * (k[n] / d) >= 3 && (R = k[n]);
464
462
  break;
465
463
  }
466
464
  let B = 0;
467
465
  if (R > 0) {
468
- for (let r = 0; r < L.length && L[r] < R; r++)
469
- if (R % L[r] < 1e-4 && t * (L[r] / T) >= 3) {
470
- B = L[r];
466
+ for (let n = 0; n < k.length && k[n] < R; n++)
467
+ if (R % k[n] < 1e-4 && t * (k[n] / d) >= 3) {
468
+ B = k[n];
471
469
  break;
472
470
  }
473
471
  }
474
- const re = Ce(n, T, p), z = (n - re) / 1e3, K = z + T, V = (r) => t * ((r - z) / T);
472
+ const re = Ce(r, d, p), z = (r - re) / 1e3, K = z + d, V = (n) => t * ((n - z) / d);
475
473
  if (B > 0) {
476
474
  e.strokeStyle = i.tickColor, e.lineWidth = 1;
477
- for (let r = Math.floor(z / B) * B; r <= K; r = te(r, B)) {
478
- const D = V(r);
479
- e.beginPath(), e.moveTo(D, o - i.minorTickHeight), e.lineTo(D, o), e.stroke();
475
+ for (let n = Math.floor(z / B) * B; n <= K; n = te(n, B)) {
476
+ const y = V(n);
477
+ e.beginPath(), e.moveTo(y, o - i.minorTickHeight), e.lineTo(y, o), e.stroke();
480
478
  }
481
479
  }
482
480
  if (R > 0) {
483
481
  e.strokeStyle = i.tickColor, e.lineWidth = 1;
484
- for (let r = Math.floor(z / R) * R; r <= K; r = te(r, R)) {
485
- const D = V(r);
486
- e.beginPath(), e.moveTo(D, o - i.minorTickHeight), e.lineTo(D, o), e.stroke();
482
+ for (let n = Math.floor(z / R) * R; n <= K; n = te(n, R)) {
483
+ const y = V(n);
484
+ e.beginPath(), e.moveTo(y, o - i.minorTickHeight), e.lineTo(y, o), e.stroke();
487
485
  }
488
486
  }
489
487
  e.textAlign = "center", e.textBaseline = "bottom";
490
488
  let ie = -1 / 0;
491
- for (let r = Math.floor(z / P) * P; r <= K + P; r = te(r, P)) {
492
- const D = V(r), k = re + r * 1e3;
493
- e.strokeStyle = i.majorTickColor, e.lineWidth = 1, e.beginPath(), e.moveTo(D, o - i.majorTickHeight), e.lineTo(D, o), e.stroke();
494
- const S = ce(k, T, p, f, y), Y = e.measureText(S).width, g = D - Y / 2;
495
- g > ie && (e.fillStyle = i.labelColor, e.fillText(S, D, o - i.majorTickHeight - 4), ie = g + Y + 5);
489
+ for (let n = Math.floor(z / P) * P; n <= K + P; n = te(n, P)) {
490
+ const y = V(n), b = re + n * 1e3;
491
+ e.strokeStyle = i.majorTickColor, e.lineWidth = 1, e.beginPath(), e.moveTo(y, o - i.majorTickHeight), e.lineTo(y, o), e.stroke();
492
+ const g = ce(b, d, p, u, L), Y = e.measureText(g).width, D = y - Y / 2;
493
+ D > ie && (e.fillStyle = i.labelColor, e.fillText(g, y, o - i.majorTickHeight - 4), ie = D + Y + 5);
496
494
  }
497
- if (b) {
498
- const r = (b.startMs - n) / (l - n) * t, D = (b.endMs - n) / (l - n) * t, k = Math.min(r, D), S = Math.abs(D - r);
499
- e.globalAlpha = 0.2, e.fillStyle = i.indicatorColor, e.fillRect(k, 0, S, o), e.globalAlpha = 1;
495
+ if (T) {
496
+ const n = (T.startMs - r) / (l - r) * t, y = (T.endMs - r) / (l - r) * t, b = Math.min(n, y), g = Math.abs(y - n);
497
+ e.globalAlpha = 0.2, e.fillStyle = i.indicatorColor, e.fillRect(b, 0, g, o), e.globalAlpha = 1;
500
498
  }
501
- const se = (a - n) / (l - n) * t;
502
- if (e.strokeStyle = i.indicatorColor, e.lineWidth = i.indicatorLineWidth, e.beginPath(), e.moveTo(se, 0), e.lineTo(se, o), e.stroke(), d != null) {
503
- const r = (d - n) / (l - n) * t;
504
- e.globalAlpha = 0.15, e.strokeStyle = i.indicatorColor, e.lineWidth = i.indicatorLineWidth, e.beginPath(), e.moveTo(r, 0), e.lineTo(r, o), e.stroke(), e.globalAlpha = 1;
499
+ const se = (a - r) / (l - r) * t;
500
+ if (e.strokeStyle = i.indicatorColor, e.lineWidth = i.indicatorLineWidth, e.beginPath(), e.moveTo(se, 0), e.lineTo(se, o), e.stroke(), M != null) {
501
+ const n = (M - r) / (l - r) * t;
502
+ e.globalAlpha = 0.15, e.strokeStyle = i.indicatorColor, e.lineWidth = i.indicatorLineWidth, e.beginPath(), e.moveTo(n, 0), e.lineTo(n, o), e.stroke(), e.globalAlpha = 1;
505
503
  }
506
- return u;
504
+ return f;
507
505
  }
508
506
  export {
509
507
  we as DEFAULT_LABELS,
@@ -517,7 +515,7 @@ export {
517
515
  ee as SCROLLBAR_WIDTH,
518
516
  Oe as SWIM_LANE_SCROLL_SPEED,
519
517
  G as TICK_AREA_HEIGHT,
520
- L as TIC_SCALES,
518
+ k as TIC_SCALES,
521
519
  fe as TickInterval,
522
520
  Pe as Timezones,
523
521
  Ce as calcEpochMs,
@@ -525,7 +523,7 @@ export {
525
523
  J as defaultSwimLaneStyle,
526
524
  Ee as defaultTheme,
527
525
  Ge as drawTimeline,
528
- ye as formatDateTime,
526
+ be as formatDateTime,
529
527
  Fe as formatTime,
530
528
  Ie as fromMilliseconds,
531
529
  _e as generateTicks,
@@ -1 +1 @@
1
- (function(a,B){typeof exports=="object"&&typeof module<"u"?B(exports,require("cesium")):typeof define=="function"&&define.amd?define(["exports","cesium"],B):(a=typeof globalThis<"u"?globalThis:a||self,B(a.CesiumTimelineCore={},a.Cesium))})(this,(function(a,B){"use strict";function ke(e){const t=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const o in e)if(o!=="default"){const l=Object.getOwnPropertyDescriptor(e,o);Object.defineProperty(t,o,l.get?l:{enumerable:!0,get:()=>e[o]})}}return t.default=e,Object.freeze(t)}const H=ke(B);function He(e,t){return typeof e=="function"?e(t):e}const Ce={dateTimeClickTooltip:"Click to jump to a date/time",liveLabel:"LIVE",liveActiveLabel:"LIVE",liveTooltip:"Jump to live (now)",liveActiveTooltip:"Currently live",resetSpeedTooltip:"Reset to 1× speed",jumpToStartTooltip:"Jump to start",noStartTimeTooltip:"No start time set",jumpToEndTooltip:"Jump to end",noEndTimeTooltip:"No end time set",rewindTooltip:"Rewind",rewindActiveTooltip:e=>`Reverse ${e}× — click to speed up, press play to stop`,playTooltip:"Play",playFromRewindTooltip:"Play (reset to 1×)",pauseTooltip:"Pause",fastForwardTooltip:"Fast forward",fastForwardActiveTooltip:e=>`${e}× speed — click to increase, click again at max to reset`,collapseSwimLanesTooltip:"Collapse swim lanes",expandSwimLanesTooltip:"Expand swim lanes",months:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"]},Ee={backgroundColor:"#1a1a1a",tickColor:"#666666",majorTickColor:"#999999",labelColor:"#cccccc",indicatorColor:"#d69826",indicatorLineWidth:5,majorTickHeight:10,minorTickHeight:5,fontSize:12,controlBarBackground:"#242424",controlBarBorder:"#333333",buttonColor:"#666666",buttonHoverColor:"#888888",buttonActiveColor:"#d69826",swimLaneItemBorderColor:"#666666",swimLaneItemBorderWidth:0,liveDotColor:"#e53e3e"};var ee=(e=>(e[e.FIFTEEN_MIN=15]="FIFTEEN_MIN",e[e.THIRTY_MIN=30]="THIRTY_MIN",e[e.HOURLY=60]="HOURLY",e[e.CUSTOM=-1]="CUSTOM",e))(ee||{});const I={color:"#4da6ff",borderColor:"#2980b9",borderWidth:1,opacity:.8,markerShape:"diamond",markerSize:10,labelColor:"#cccccc",backgroundColor:"transparent"},P=24;function _e(e){return e instanceof H.JulianDate?H.JulianDate.clone(e):H.JulianDate.fromDate(e)}function K(e){return e instanceof H.JulianDate?H.JulianDate.toDate(e):e}function N(e){return K(e).getTime()}function we(e){return H.JulianDate.fromDate(new Date(e))}function fe(e,t){return N(t)-N(e)}const Ye=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],Ie=["January","February","March","April","May","June","July","August","September","October","November","December"],te={DEFAULT:"MMM DD YYYY HH:mm:ss",TWELVE_HR:"MMM DD YYYY hh:mm:ss A",ISO:"YYYY-MM-DD HH:mm:ss",US:"MM/DD/YYYY HH:mm",EU:"DD/MM/YYYY HH:mm",TIME_ONLY:"HH:mm:ss",TIME_12:"hh:mm:ss A"},Pe={LOCAL:"local",UTC:"UTC"};function Z(e,t){if(!t||t==="local"){const T=e.getFullYear(),u=e.getMonth(),L=e.getDate(),y=e.getHours(),g=y%12||12,h=e.getMinutes(),p=e.getSeconds(),R=e.getMilliseconds();return{yr:T,mo:u,day:L,hr24:y,hr12:g,min:h,sec:p,ms:R,ampm:y<12?"AM":"PM"}}const o=new Intl.DateTimeFormat("en-US",{timeZone:t,year:"numeric",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit",second:"2-digit",hour12:!1}),l={};for(const T of o.formatToParts(e))T.type!=="literal"&&(l[T.type]=T.value);const n=parseInt(l.year),s=parseInt(l.month)-1,m=parseInt(l.day);let r=parseInt(l.hour);r===24&&(r=0);const c=r%12||12,f=parseInt(l.minute),M=parseInt(l.second),d=e.getMilliseconds();return{yr:n,mo:s,day:m,hr24:r,hr12:c,min:f,sec:M,ms:d,ampm:r<12?"AM":"PM"}}function Ne(e,t){var n;if(!t||t==="local")return null;const o=K(e);return((n=new Intl.DateTimeFormat("en-US",{timeZone:t,timeZoneName:"short"}).formatToParts(o).find(s=>s.type==="timeZoneName"))==null?void 0:n.value)??null}function ue(e,t=te.DEFAULT,o){const l=K(e),{yr:n,mo:s,day:m,hr24:r,hr12:c,min:f,sec:M,ms:d,ampm:T}=Z(l,o),u=g=>String(g).padStart(2,"0"),L=g=>String(g).padStart(3,"0"),y={YYYY:String(n),YY:String(n).slice(-2),MMMM:Ie[s],MMM:Ye[s],MM:u(s+1),M:String(s+1),DD:u(m),D:String(m),HH:u(r),H:String(r),hh:u(c),h:String(c),mm:u(f),ss:u(M),SSS:L(d),A:T,a:T.toLowerCase()};return t.replace(/YYYY|YY|MMMM|MMM|MM|M|DD|D|HH|H|hh|h|mm|ss|SSS|A|a/g,g=>y[g]??g)}function Re(e=te.DEFAULT){const t=["YYYY","YY","MMMM","MMM","MM","M","DD","D"],o=["HH","H","hh","h","mm","ss","SSS","A","a"],l=m=>m.replace(/\s{2,}/g," ").trim().replace(/^[\s\W]+|[\s\W]+$/g,"").trim();let n=e;for(const m of t)n=n.replace(m,"");let s=e;for(const m of o)s=s.replace(m,"");return{timeFormat:l(n),dateFormat:l(s)}}function Fe(e,t=!1){return ue(e,t?"HH:mm:ss":"HH:mm")}function he(e,t,o,l){const n=N(e),s=N(t),m=N(o);if(m===s)return 0;const r=(n-s)/(m-s);return Math.max(0,Math.min(1,r))*l}function $e(e,t,o,l){const n=Math.max(0,Math.min(1,e/l)),s=N(t),m=N(o),r=s+n*(m-s);return H.JulianDate.fromDate(new Date(r))}function Oe(e,t,o,l){const n=[],s=fe(e,t),m=N(e);let r;typeof o=="number"&&o in ee||typeof o=="number"?r=o*60*1e3:r=3600*1e3;const c=r*4;let f=m,M=0;for(;f<=m+s;){const d=M*r%c===0,T=he(new Date(f),e,t,l);let u;if(d){const L=new Date(f),y=L.getHours().toString().padStart(2,"0"),g=L.getMinutes().toString().padStart(2,"0");u=`${y}:${g}`}n.push({position:T,isMajor:d,label:u}),f+=r,M++}return n}function Je(e,t,o=10){let l=t[0],n=Math.abs(l.position-e);for(const s of t){const m=Math.abs(s.position-e);m<n&&(n=m,l=s)}return n<=o?l.position:e}const de=1e3,Te=31536e9,D=[.001,.002,.005,.01,.02,.05,.1,.25,.5,1,2,5,10,15,30,60,120,300,600,900,1800,3600,7200,14400,21600,43200,86400,172800,345600,604800,1296e3,2592e3,5184e3,7776e3,15552e3,31536e3,63072e3,126144e3,15768e4,31536e4,63072e4,126144e4,15768e5,31536e5,63072e5,126144e5,15768e6,31536e6],j=36,$=1,Me=6,V=6,We=.3,ge=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];function w(e){return e<10?`0${e}`:`${e}`}function oe(e,t,o,l,n){const s=new Date(e),{yr:m,mo:r,day:c,hr24:f,hr12:M,min:d,sec:T,ms:u,ampm:L}=Z(s,o),y=l?M:f,g=l?` ${L}`:"",h=n??ge;if(t>31536e4)return`${m}`;if(t>31536e3)return`${h[r]} ${m}`;if(t>604800)return`${h[r]} ${c}`;if(t>86400)return`${h[r]} ${c} ${w(y)}:${w(d)}${g}`;if(t>3600)return`${w(y)}:${w(d)}${g}`;if(t>60)return`${w(y)}:${w(d)}:${w(T)}${g}`;const p=u>0?`.${String(u).padStart(3,"0")}`:"";return`${w(y)}:${w(d)}:${w(T)}${p}${g}`}function Se(e,t,o){const l=new Date(e);if(!o||o==="local"){const c=l.getFullYear(),f=l.getMonth(),M=l.getDate();return t>31536e4?new Date(Math.floor(c/100)*100,0).getTime():t>31536e3?new Date(Math.floor(c/10)*10,0).getTime():t>86400?new Date(c,0).getTime():new Date(c,f,M).getTime()}const{yr:n,hr24:s,min:m,sec:r}=Z(l,o);return t>31536e4?Date.UTC(Math.floor(n/100)*100,0,1):t>31536e3?Date.UTC(Math.floor(n/10)*10,0,1):t>86400?Date.UTC(n,0,1):e-(s*3600+m*60+r)*1e3}function q(e,t){return Math.ceil(e/t+.5)*t}function ne(e,t,o){var l,n,s,m,r,c,f,M,d,T,u,L;return{color:((l=t.style)==null?void 0:l.color)??((n=e.style)==null?void 0:n.color)??I.color,borderColor:((s=t.style)==null?void 0:s.borderColor)??((m=e.style)==null?void 0:m.borderColor)??(o==null?void 0:o.swimLaneItemBorderColor)??I.borderColor,borderWidth:((r=t.style)==null?void 0:r.borderWidth)??((c=e.style)==null?void 0:c.borderWidth)??(o==null?void 0:o.swimLaneItemBorderWidth)??I.borderWidth,opacity:((f=t.style)==null?void 0:f.opacity)??((M=e.style)==null?void 0:M.opacity)??I.opacity,markerShape:((d=t.style)==null?void 0:d.markerShape)??((T=e.style)==null?void 0:T.markerShape)??I.markerShape,markerSize:((u=t.style)==null?void 0:u.markerSize)??((L=e.style)==null?void 0:L.markerSize)??I.markerSize}}function ie(e){return Math.max(de,Math.min(Te,e))}function ve(e,t,o){const l=t-e,n=(e+t)/2,s=ie(l*o);return{startMs:n-s/2,endMs:n+s/2}}function Ue(e,t,o,l){const n=t-e,s=ie(n*o),m=n>0?(l-e)/n:.5;return{startMs:l-m*s,endMs:l+(1-m)*s}}function Be(e){let t=0;for(const o of e)t+=(o.height??P)+$;return t}function je(e,t,o,l,n){const{swimLanes:s,showSwimLanes:m,scrollTop:r,startMs:c,endMs:f,theme:M}=n;if(!m||s.length===0)return null;const d=Math.max(0,l-j);if(t<0||t>=d)return null;let T=-r;for(const u of s){const L=u.height??P,y=T,g=T+L;if(T+=L+$,!(t<y||t>=g)){for(const h of u.items){if(h.interval){const p=H.JulianDate.toDate(h.interval.start).getTime(),R=H.JulianDate.toDate(h.interval.stop).getTime(),Q=(p-c)/(f-c)*o,E=(R-c)/(f-c)*o;if(e>=Math.max(0,Q)&&e<=Math.min(o,E))return{lane:u,item:h}}if(h.instant){const R=(H.JulianDate.toDate(h.instant).getTime()-c)/(f-c)*o,Q=ne(u,h,M);if(Math.abs(e-R)<=Q.markerSize/2+2)return{lane:u,item:h}}}return null}}return null}function ze(e,t,o,l){const{swimLanes:n,showSwimLanes:s,scrollTop:m}=l;if(!s||n.length===0||e>80)return null;const r=Math.max(0,o-j);if(t<0||t>=r)return null;let c=-m;for(const f of n){const M=f.height??P;if(t>=c&&t<c+M)return f;c+=M+$}return null}function Xe(e,t,o){if(!o.showSwimLanes||o.swimLanes.length===0)return!1;const l=Math.max(0,t-j);return e>=0&&e<l}function Ge(e,t,o,l){const{startMs:n,endMs:s,currentMs:m,theme:r,maxTicks:c,swimLanes:f,showSwimLanes:M,reorderState:d,timezone:T,use12h:u,months:L,rangeSelection:y,hoverMs:g}=l;let{scrollTop:h}=l;const p=(s-n)/1e3;if(p<=0)return h;e.fillStyle=r.backgroundColor,e.fillRect(0,0,t,o);const R=M&&f.length>0,E=R?Math.max(0,o-j):0;let x=0;if(R)for(const i of f)x+=(i.height??P)+$;const re=Math.max(0,x-E);if(h>re&&(h=re),h<0&&(h=0),R&&E>0){e.save(),e.beginPath(),e.rect(0,0,t,E),e.clip();let i=-h;const A=k=>(k-n)/(s-n)*t;for(const k of f){const b=k.height??P,_=i+b;if(_>0&&i<E){const S=k.style,U=(S==null?void 0:S.backgroundColor)??I.backgroundColor;U&&U!=="transparent"&&(e.fillStyle=U,e.fillRect(0,i,t,b)),e.strokeStyle=r.tickColor+"44",e.lineWidth=.5,e.beginPath(),e.moveTo(0,_),e.lineTo(t,_),e.stroke();for(const F of k.items){const C=ne(k,F,r);if(F.interval){const se=H.JulianDate.toDate(F.interval.start).getTime(),Y=H.JulianDate.toDate(F.interval.stop).getTime(),W=A(se),v=A(Y),me=Math.max(0,W),ce=Math.min(t,v)-me;if(ce>0){e.globalAlpha=C.opacity,e.fillStyle=C.color;const De=3,Le=i+De,Ae=b-De*2;e.fillRect(me,Le,ce,Ae),C.borderWidth>0&&(e.strokeStyle=C.borderColor,e.lineWidth=C.borderWidth,e.strokeRect(me,Le,ce,Ae)),e.globalAlpha=1}}if(F.instant){const se=H.JulianDate.toDate(F.instant).getTime(),Y=A(se);if(Y>=-C.markerSize&&Y<=t+C.markerSize){const W=i+b/2,v=C.markerSize;e.globalAlpha=C.opacity,e.fillStyle=C.color,C.markerShape==="diamond"?(e.beginPath(),e.moveTo(Y,W-v/2),e.lineTo(Y+v/2,W),e.lineTo(Y,W+v/2),e.lineTo(Y-v/2,W),e.closePath(),e.fill()):C.markerShape==="circle"?(e.beginPath(),e.arc(Y,W,v/2,0,Math.PI*2),e.fill()):(e.strokeStyle=C.color,e.lineWidth=2,e.beginPath(),e.moveTo(Y,i+2),e.lineTo(Y,i+b-2),e.stroke()),e.globalAlpha=1}}}e.font=`${Math.min(11,b-4)}px system-ui, sans-serif`,e.textAlign="left",e.textBaseline="middle",e.fillStyle=(S==null?void 0:S.labelColor)??I.labelColor,e.fillText(k.label,Me,i+b/2)}if(i+=b+$,i>=E)break}if(d&&d.dragging){const k=d.currentY-d.dragStartY;let b=-h;for(let S=0;S<f.length&&S<d.insertIndex;S++)b+=(f[S].height??P)+$;e.strokeStyle=r.indicatorColor,e.lineWidth=2,e.beginPath(),e.moveTo(0,b),e.lineTo(t,b),e.stroke();const _=f.find(S=>S.id===d.dragLaneId);if(_){const S=_.height??P;let U=-h;for(const F of f){if(F.id===d.dragLaneId)break;U+=(F.height??P)+$}e.globalAlpha=.4,e.fillStyle=r.indicatorColor,e.fillRect(0,U+k,t,S),e.globalAlpha=1}}if(x>E){const k=t-V-2,b=E/x,_=Math.max(20,E*b),S=h/re*(E-_);e.fillStyle=r.tickColor+"22",e.fillRect(k,0,V,E),e.fillStyle=r.tickColor+"88",e.fillRect(k,S,V,_)}e.restore()}e.font=`${r.fontSize}px monospace`;const Ke=oe(n+p*500,p,T,u,L),Ze=e.measureText(Ke).width+24,Ve=Math.max(Ze/t*p,p/1e3);let O=D[D.length-1],z=D.length-1;for(let i=0;i<D.length;i++)if(D[i]>Ve){O=D[i],z=i;break}if(c!=null&&c>0)for(;z<D.length-1&&p/O>c;)z++,O=D[z];let J=0;for(let i=z-1;i>=0;i--)if(O%D[i]<1e-4){t*(D[i]/p)>=3&&(J=D[i]);break}let X=0;if(J>0){for(let i=0;i<D.length&&D[i]<J;i++)if(J%D[i]<1e-4&&t*(D[i]/p)>=3){X=D[i];break}}const pe=Se(n,p,T),G=(n-pe)/1e3,le=G+p,ae=i=>t*((i-G)/p);if(X>0){e.strokeStyle=r.tickColor,e.lineWidth=1;for(let i=Math.floor(G/X)*X;i<=le;i=q(i,X)){const A=ae(i);e.beginPath(),e.moveTo(A,o-r.minorTickHeight),e.lineTo(A,o),e.stroke()}}if(J>0){e.strokeStyle=r.tickColor,e.lineWidth=1;for(let i=Math.floor(G/J)*J;i<=le;i=q(i,J)){const A=ae(i);e.beginPath(),e.moveTo(A,o-r.minorTickHeight),e.lineTo(A,o),e.stroke()}}e.textAlign="center",e.textBaseline="bottom";let be=-1/0;for(let i=Math.floor(G/O)*O;i<=le+O;i=q(i,O)){const A=ae(i),k=pe+i*1e3;e.strokeStyle=r.majorTickColor,e.lineWidth=1,e.beginPath(),e.moveTo(A,o-r.majorTickHeight),e.lineTo(A,o),e.stroke();const b=oe(k,p,T,u,L),_=e.measureText(b).width,S=A-_/2;S>be&&(e.fillStyle=r.labelColor,e.fillText(b,A,o-r.majorTickHeight-4),be=S+_+5)}if(y){const i=(y.startMs-n)/(s-n)*t,A=(y.endMs-n)/(s-n)*t,k=Math.min(i,A),b=Math.abs(A-i);e.globalAlpha=.2,e.fillStyle=r.indicatorColor,e.fillRect(k,0,b,o),e.globalAlpha=1}const ye=(m-n)/(s-n)*t;if(e.strokeStyle=r.indicatorColor,e.lineWidth=r.indicatorLineWidth,e.beginPath(),e.moveTo(ye,0),e.lineTo(ye,o),e.stroke(),g!=null){const i=(g-n)/(s-n)*t;e.globalAlpha=.15,e.strokeStyle=r.indicatorColor,e.lineWidth=r.indicatorLineWidth,e.beginPath(),e.moveTo(i,0),e.lineTo(i,o),e.stroke(),e.globalAlpha=1}return h}a.DEFAULT_LABELS=Ce,a.DEFAULT_LANE_HEIGHT=P,a.DateTimeFormats=te,a.LABEL_PAD_LEFT=Me,a.LANE_GAP=$,a.MAX_SPAN_MS=Te,a.MIN_SPAN_MS=de,a.MONTHS=ge,a.SCROLLBAR_WIDTH=V,a.SWIM_LANE_SCROLL_SPEED=We,a.TICK_AREA_HEIGHT=j,a.TIC_SCALES=D,a.TickInterval=ee,a.Timezones=Pe,a.calcEpochMs=Se,a.clampSpan=ie,a.defaultSwimLaneStyle=I,a.defaultTheme=Ee,a.drawTimeline=Ge,a.formatDateTime=ue,a.formatTime=Fe,a.fromMilliseconds=we,a.generateTicks=Oe,a.getDateParts=Z,a.getDurationMs=fe,a.getTimezoneAbbr=Ne,a.hitTestLaneLabel=ze,a.hitTestSwimLane=je,a.isInSwimLaneRegion=Xe,a.makeLabel=oe,a.nextTic=q,a.positionToTime=$e,a.resolveItemStyle=ne,a.resolveLabel=He,a.snapToTick=Je,a.splitForDisplay=Re,a.timeToPosition=he,a.toDate=K,a.toJulianDate=_e,a.toMilliseconds=N,a.totalSwimLaneHeight=Be,a.twoD=w,a.zoomAroundMs=Ue,a.zoomRange=ve,Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})}));
1
+ (function(l,B){typeof exports=="object"&&typeof module<"u"?B(exports,require("cesium")):typeof define=="function"&&define.amd?define(["exports","cesium"],B):(l=typeof globalThis<"u"?globalThis:l||self,B(l.CesiumTimelineCore={},l.Cesium))})(this,(function(l,B){"use strict";function ke(e){const t=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const o in e)if(o!=="default"){const a=Object.getOwnPropertyDescriptor(e,o);Object.defineProperty(t,o,a.get?a:{enumerable:!0,get:()=>e[o]})}}return t.default=e,Object.freeze(t)}const H=ke(B);function He(e,t){return typeof e=="function"?e(t):e}const Ce={dateTimeClickTooltip:"Click to jump to a date/time",liveLabel:"LIVE",liveActiveLabel:"LIVE",liveTooltip:"Jump to live (now)",liveActiveTooltip:"Currently live",resetSpeedTooltip:"Reset to 1× speed",jumpToStartTooltip:"Jump to start",noStartTimeTooltip:"No start time set",jumpToEndTooltip:"Jump to end",noEndTimeTooltip:"No end time set",rewindTooltip:"Rewind",rewindActiveTooltip:e=>`Reverse ${e}× — click to speed up, press play to stop`,playTooltip:"Play",playFromRewindTooltip:"Play (reset to 1×)",pauseTooltip:"Pause",fastForwardTooltip:"Fast forward",fastForwardActiveTooltip:e=>`${e}× speed — click to increase, click again at max to reset`,collapseSwimLanesTooltip:"Collapse swim lanes",expandSwimLanesTooltip:"Expand swim lanes",months:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"]},Ee={backgroundColor:"#1a1a1a",tickColor:"#666666",majorTickColor:"#999999",labelColor:"#cccccc",indicatorColor:"#d69826",indicatorLineWidth:5,majorTickHeight:10,minorTickHeight:5,fontSize:12,controlBarBackground:"#242424",controlBarBorder:"#333333",buttonColor:"#666666",buttonHoverColor:"#888888",buttonActiveColor:"#d69826",swimLaneItemBorderColor:"#666666",swimLaneItemBorderWidth:0,liveDotColor:"#e53e3e"};var ee=(e=>(e[e.FIFTEEN_MIN=15]="FIFTEEN_MIN",e[e.THIRTY_MIN=30]="THIRTY_MIN",e[e.HOURLY=60]="HOURLY",e[e.CUSTOM=-1]="CUSTOM",e))(ee||{});const I={color:"#4da6ff",borderColor:"#2980b9",borderWidth:1,opacity:.8,markerShape:"diamond",markerSize:10,labelColor:"#cccccc",backgroundColor:"transparent"},P=24;function _e(e){return e instanceof H.JulianDate?H.JulianDate.clone(e):H.JulianDate.fromDate(e)}function K(e){return e instanceof H.JulianDate?H.JulianDate.toDate(e):e}function N(e){return K(e).getTime()}function we(e){return H.JulianDate.fromDate(new Date(e))}function fe(e,t){return N(t)-N(e)}const Ye=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],Ie=["January","February","March","April","May","June","July","August","September","October","November","December"],te={DEFAULT:"MMM DD YYYY HH:mm:ss",TWELVE_HR:"MMM DD YYYY hh:mm:ss A",ISO:"YYYY-MM-DD HH:mm:ss",US:"MM/DD/YYYY HH:mm",EU:"DD/MM/YYYY HH:mm",TIME_ONLY:"HH:mm:ss",TIME_12:"hh:mm:ss A"},Pe={LOCAL:"local",UTC:"UTC"};function Z(e,t){if(!t||t==="local"){const T=e.getFullYear(),h=e.getMonth(),k=e.getDate(),p=e.getHours(),M=p%12||12,u=e.getMinutes(),g=e.getSeconds(),R=e.getMilliseconds();return{yr:T,mo:h,day:k,hr24:p,hr12:M,min:u,sec:g,ms:R,ampm:p<12?"AM":"PM"}}const o=new Intl.DateTimeFormat("en-US",{timeZone:t,year:"numeric",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit",second:"2-digit",hour12:!1}),a={};for(const T of o.formatToParts(e))T.type!=="literal"&&(a[T.type]=T.value);const i=parseInt(a.year),s=parseInt(a.month)-1,m=parseInt(a.day);let r=parseInt(a.hour);r===24&&(r=0);const c=r%12||12,f=parseInt(a.minute),y=parseInt(a.second),d=e.getMilliseconds();return{yr:i,mo:s,day:m,hr24:r,hr12:c,min:f,sec:y,ms:d,ampm:r<12?"AM":"PM"}}function Ne(e,t){if(!t||t==="local")return null;const o=K(e);return new Intl.DateTimeFormat("en-US",{timeZone:t,timeZoneName:"short"}).formatToParts(o).find(i=>i.type==="timeZoneName")?.value??null}function ue(e,t=te.DEFAULT,o){const a=K(e),{yr:i,mo:s,day:m,hr24:r,hr12:c,min:f,sec:y,ms:d,ampm:T}=Z(a,o),h=M=>String(M).padStart(2,"0"),k=M=>String(M).padStart(3,"0"),p={YYYY:String(i),YY:String(i).slice(-2),MMMM:Ie[s],MMM:Ye[s],MM:h(s+1),M:String(s+1),DD:h(m),D:String(m),HH:h(r),H:String(r),hh:h(c),h:String(c),mm:h(f),ss:h(y),SSS:k(d),A:T,a:T.toLowerCase()};return t.replace(/YYYY|YY|MMMM|MMM|MM|M|DD|D|HH|H|hh|h|mm|ss|SSS|A|a/g,M=>p[M]??M)}function Re(e=te.DEFAULT){const t=["YYYY","YY","MMMM","MMM","MM","M","DD","D"],o=["HH","H","hh","h","mm","ss","SSS","A","a"],a=m=>m.replace(/\s{2,}/g," ").trim().replace(/^[\s\W]+|[\s\W]+$/g,"").trim();let i=e;for(const m of t)i=i.replace(m,"");let s=e;for(const m of o)s=s.replace(m,"");return{timeFormat:a(i),dateFormat:a(s)}}function Fe(e,t=!1){return ue(e,t?"HH:mm:ss":"HH:mm")}function he(e,t,o,a){const i=N(e),s=N(t),m=N(o);if(m===s)return 0;const r=(i-s)/(m-s);return Math.max(0,Math.min(1,r))*a}function $e(e,t,o,a){const i=Math.max(0,Math.min(1,e/a)),s=N(t),m=N(o),r=s+i*(m-s);return H.JulianDate.fromDate(new Date(r))}function Oe(e,t,o,a){const i=[],s=fe(e,t),m=N(e);let r;typeof o=="number"&&o in ee||typeof o=="number"?r=o*60*1e3:r=3600*1e3;const c=r*4;let f=m,y=0;for(;f<=m+s;){const d=y*r%c===0,T=he(new Date(f),e,t,a);let h;if(d){const k=new Date(f),p=k.getHours().toString().padStart(2,"0"),M=k.getMinutes().toString().padStart(2,"0");h=`${p}:${M}`}i.push({position:T,isMajor:d,label:h}),f+=r,y++}return i}function Je(e,t,o=10){let a=t[0],i=Math.abs(a.position-e);for(const s of t){const m=Math.abs(s.position-e);m<i&&(i=m,a=s)}return i<=o?a.position:e}const de=1e3,Te=31536e9,b=[.001,.002,.005,.01,.02,.05,.1,.25,.5,1,2,5,10,15,30,60,120,300,600,900,1800,3600,7200,14400,21600,43200,86400,172800,345600,604800,1296e3,2592e3,5184e3,7776e3,15552e3,31536e3,63072e3,126144e3,15768e4,31536e4,63072e4,126144e4,15768e5,31536e5,63072e5,126144e5,15768e6,31536e6],j=36,$=1,Me=6,V=6,We=.3,ge=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];function w(e){return e<10?`0${e}`:`${e}`}function oe(e,t,o,a,i){const s=new Date(e),{yr:m,mo:r,day:c,hr24:f,hr12:y,min:d,sec:T,ms:h,ampm:k}=Z(s,o),p=a?y:f,M=a?` ${k}`:"",u=i??ge;if(t>31536e4)return`${m}`;if(t>31536e3)return`${u[r]} ${m}`;if(t>604800)return`${u[r]} ${c}`;if(t>86400)return`${u[r]} ${c} ${w(p)}:${w(d)}${M}`;if(t>3600)return`${w(p)}:${w(d)}${M}`;if(t>60)return`${w(p)}:${w(d)}:${w(T)}${M}`;const g=h>0?`.${String(h).padStart(3,"0")}`:"";return`${w(p)}:${w(d)}:${w(T)}${g}${M}`}function Se(e,t,o){const a=new Date(e);if(!o||o==="local"){const c=a.getFullYear(),f=a.getMonth(),y=a.getDate();return t>31536e4?new Date(Math.floor(c/100)*100,0).getTime():t>31536e3?new Date(Math.floor(c/10)*10,0).getTime():t>86400?new Date(c,0).getTime():new Date(c,f,y).getTime()}const{yr:i,hr24:s,min:m,sec:r}=Z(a,o);return t>31536e4?Date.UTC(Math.floor(i/100)*100,0,1):t>31536e3?Date.UTC(Math.floor(i/10)*10,0,1):t>86400?Date.UTC(i,0,1):e-(s*3600+m*60+r)*1e3}function q(e,t){return Math.ceil(e/t+.5)*t}function ne(e,t,o){return{color:t.style?.color??e.style?.color??I.color,borderColor:t.style?.borderColor??e.style?.borderColor??o?.swimLaneItemBorderColor??I.borderColor,borderWidth:t.style?.borderWidth??e.style?.borderWidth??o?.swimLaneItemBorderWidth??I.borderWidth,opacity:t.style?.opacity??e.style?.opacity??I.opacity,markerShape:t.style?.markerShape??e.style?.markerShape??I.markerShape,markerSize:t.style?.markerSize??e.style?.markerSize??I.markerSize}}function ie(e){return Math.max(de,Math.min(Te,e))}function ve(e,t,o){const a=t-e,i=(e+t)/2,s=ie(a*o);return{startMs:i-s/2,endMs:i+s/2}}function Ue(e,t,o,a){const i=t-e,s=ie(i*o),m=i>0?(a-e)/i:.5;return{startMs:a-m*s,endMs:a+(1-m)*s}}function Be(e){let t=0;for(const o of e)t+=(o.height??P)+$;return t}function je(e,t,o,a,i){const{swimLanes:s,showSwimLanes:m,scrollTop:r,startMs:c,endMs:f,theme:y}=i;if(!m||s.length===0)return null;const d=Math.max(0,a-j);if(t<0||t>=d)return null;let T=-r;for(const h of s){const k=h.height??P,p=T,M=T+k;if(T+=k+$,!(t<p||t>=M)){for(const u of h.items){if(u.interval){const g=H.JulianDate.toDate(u.interval.start).getTime(),R=H.JulianDate.toDate(u.interval.stop).getTime(),Q=(g-c)/(f-c)*o,E=(R-c)/(f-c)*o;if(e>=Math.max(0,Q)&&e<=Math.min(o,E))return{lane:h,item:u}}if(u.instant){const R=(H.JulianDate.toDate(u.instant).getTime()-c)/(f-c)*o,Q=ne(h,u,y);if(Math.abs(e-R)<=Q.markerSize/2+2)return{lane:h,item:u}}}return null}}return null}function ze(e,t,o,a){const{swimLanes:i,showSwimLanes:s,scrollTop:m}=a;if(!s||i.length===0||e>80)return null;const r=Math.max(0,o-j);if(t<0||t>=r)return null;let c=-m;for(const f of i){const y=f.height??P;if(t>=c&&t<c+y)return f;c+=y+$}return null}function Xe(e,t,o){if(!o.showSwimLanes||o.swimLanes.length===0)return!1;const a=Math.max(0,t-j);return e>=0&&e<a}function Ge(e,t,o,a){const{startMs:i,endMs:s,currentMs:m,theme:r,maxTicks:c,swimLanes:f,showSwimLanes:y,reorderState:d,timezone:T,use12h:h,months:k,rangeSelection:p,hoverMs:M}=a;let{scrollTop:u}=a;const g=(s-i)/1e3;if(g<=0)return u;e.fillStyle=r.backgroundColor,e.fillRect(0,0,t,o);const R=y&&f.length>0,E=R?Math.max(0,o-j):0;let x=0;if(R)for(const n of f)x+=(n.height??P)+$;const re=Math.max(0,x-E);if(u>re&&(u=re),u<0&&(u=0),R&&E>0){e.save(),e.beginPath(),e.rect(0,0,t,E),e.clip();let n=-u;const D=L=>(L-i)/(s-i)*t;for(const L of f){const S=L.height??P,_=n+S;if(_>0&&n<E){const A=L.style,U=A?.backgroundColor??I.backgroundColor;U&&U!=="transparent"&&(e.fillStyle=U,e.fillRect(0,n,t,S)),e.strokeStyle=r.tickColor+"44",e.lineWidth=.5,e.beginPath(),e.moveTo(0,_),e.lineTo(t,_),e.stroke();for(const F of L.items){const C=ne(L,F,r);if(F.interval){const se=H.JulianDate.toDate(F.interval.start).getTime(),Y=H.JulianDate.toDate(F.interval.stop).getTime(),W=D(se),v=D(Y),me=Math.max(0,W),ce=Math.min(t,v)-me;if(ce>0){e.globalAlpha=C.opacity,e.fillStyle=C.color;const De=3,Le=n+De,Ae=S-De*2;e.fillRect(me,Le,ce,Ae),C.borderWidth>0&&(e.strokeStyle=C.borderColor,e.lineWidth=C.borderWidth,e.strokeRect(me,Le,ce,Ae)),e.globalAlpha=1}}if(F.instant){const se=H.JulianDate.toDate(F.instant).getTime(),Y=D(se);if(Y>=-C.markerSize&&Y<=t+C.markerSize){const W=n+S/2,v=C.markerSize;e.globalAlpha=C.opacity,e.fillStyle=C.color,C.markerShape==="diamond"?(e.beginPath(),e.moveTo(Y,W-v/2),e.lineTo(Y+v/2,W),e.lineTo(Y,W+v/2),e.lineTo(Y-v/2,W),e.closePath(),e.fill()):C.markerShape==="circle"?(e.beginPath(),e.arc(Y,W,v/2,0,Math.PI*2),e.fill()):(e.strokeStyle=C.color,e.lineWidth=2,e.beginPath(),e.moveTo(Y,n+2),e.lineTo(Y,n+S-2),e.stroke()),e.globalAlpha=1}}}e.font=`${Math.min(11,S-4)}px system-ui, sans-serif`,e.textAlign="left",e.textBaseline="middle",e.fillStyle=A?.labelColor??I.labelColor,e.fillText(L.label,Me,n+S/2)}if(n+=S+$,n>=E)break}if(d&&d.dragging){const L=d.currentY-d.dragStartY;let S=-u;for(let A=0;A<f.length&&A<d.insertIndex;A++)S+=(f[A].height??P)+$;e.strokeStyle=r.indicatorColor,e.lineWidth=2,e.beginPath(),e.moveTo(0,S),e.lineTo(t,S),e.stroke();const _=f.find(A=>A.id===d.dragLaneId);if(_){const A=_.height??P;let U=-u;for(const F of f){if(F.id===d.dragLaneId)break;U+=(F.height??P)+$}e.globalAlpha=.4,e.fillStyle=r.indicatorColor,e.fillRect(0,U+L,t,A),e.globalAlpha=1}}if(x>E){const L=t-V-2,S=E/x,_=Math.max(20,E*S),A=u/re*(E-_);e.fillStyle=r.tickColor+"22",e.fillRect(L,0,V,E),e.fillStyle=r.tickColor+"88",e.fillRect(L,A,V,_)}e.restore()}e.font=`${r.fontSize}px monospace`;const Ke=oe(i+g*500,g,T,h,k),Ze=e.measureText(Ke).width+24,Ve=Math.max(Ze/t*g,g/1e3);let O=b[b.length-1],z=b.length-1;for(let n=0;n<b.length;n++)if(b[n]>Ve){O=b[n],z=n;break}if(c!=null&&c>0)for(;z<b.length-1&&g/O>c;)z++,O=b[z];let J=0;for(let n=z-1;n>=0;n--)if(O%b[n]<1e-4){t*(b[n]/g)>=3&&(J=b[n]);break}let X=0;if(J>0){for(let n=0;n<b.length&&b[n]<J;n++)if(J%b[n]<1e-4&&t*(b[n]/g)>=3){X=b[n];break}}const pe=Se(i,g,T),G=(i-pe)/1e3,le=G+g,ae=n=>t*((n-G)/g);if(X>0){e.strokeStyle=r.tickColor,e.lineWidth=1;for(let n=Math.floor(G/X)*X;n<=le;n=q(n,X)){const D=ae(n);e.beginPath(),e.moveTo(D,o-r.minorTickHeight),e.lineTo(D,o),e.stroke()}}if(J>0){e.strokeStyle=r.tickColor,e.lineWidth=1;for(let n=Math.floor(G/J)*J;n<=le;n=q(n,J)){const D=ae(n);e.beginPath(),e.moveTo(D,o-r.minorTickHeight),e.lineTo(D,o),e.stroke()}}e.textAlign="center",e.textBaseline="bottom";let be=-1/0;for(let n=Math.floor(G/O)*O;n<=le+O;n=q(n,O)){const D=ae(n),L=pe+n*1e3;e.strokeStyle=r.majorTickColor,e.lineWidth=1,e.beginPath(),e.moveTo(D,o-r.majorTickHeight),e.lineTo(D,o),e.stroke();const S=oe(L,g,T,h,k),_=e.measureText(S).width,A=D-_/2;A>be&&(e.fillStyle=r.labelColor,e.fillText(S,D,o-r.majorTickHeight-4),be=A+_+5)}if(p){const n=(p.startMs-i)/(s-i)*t,D=(p.endMs-i)/(s-i)*t,L=Math.min(n,D),S=Math.abs(D-n);e.globalAlpha=.2,e.fillStyle=r.indicatorColor,e.fillRect(L,0,S,o),e.globalAlpha=1}const ye=(m-i)/(s-i)*t;if(e.strokeStyle=r.indicatorColor,e.lineWidth=r.indicatorLineWidth,e.beginPath(),e.moveTo(ye,0),e.lineTo(ye,o),e.stroke(),M!=null){const n=(M-i)/(s-i)*t;e.globalAlpha=.15,e.strokeStyle=r.indicatorColor,e.lineWidth=r.indicatorLineWidth,e.beginPath(),e.moveTo(n,0),e.lineTo(n,o),e.stroke(),e.globalAlpha=1}return u}l.DEFAULT_LABELS=Ce,l.DEFAULT_LANE_HEIGHT=P,l.DateTimeFormats=te,l.LABEL_PAD_LEFT=Me,l.LANE_GAP=$,l.MAX_SPAN_MS=Te,l.MIN_SPAN_MS=de,l.MONTHS=ge,l.SCROLLBAR_WIDTH=V,l.SWIM_LANE_SCROLL_SPEED=We,l.TICK_AREA_HEIGHT=j,l.TIC_SCALES=b,l.TickInterval=ee,l.Timezones=Pe,l.calcEpochMs=Se,l.clampSpan=ie,l.defaultSwimLaneStyle=I,l.defaultTheme=Ee,l.drawTimeline=Ge,l.formatDateTime=ue,l.formatTime=Fe,l.fromMilliseconds=we,l.generateTicks=Oe,l.getDateParts=Z,l.getDurationMs=fe,l.getTimezoneAbbr=Ne,l.hitTestLaneLabel=ze,l.hitTestSwimLane=je,l.isInSwimLaneRegion=Xe,l.makeLabel=oe,l.nextTic=q,l.positionToTime=$e,l.resolveItemStyle=ne,l.resolveLabel=He,l.snapToTick=Je,l.splitForDisplay=Re,l.timeToPosition=he,l.toDate=K,l.toJulianDate=_e,l.toMilliseconds=N,l.totalSwimLaneHeight=Be,l.twoD=w,l.zoomAroundMs=Ue,l.zoomRange=ve,Object.defineProperty(l,Symbol.toStringTag,{value:"Module"})}));
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@kteneyck/cesium-timeline-core",
3
- "version": "0.10.0",
3
+ "version": "0.11.0",
4
4
  "description": "Framework-agnostic core logic for the Cesium timeline component",
5
5
  "license": "MIT",
6
6
  "author": "kteneyck",
@@ -31,9 +31,9 @@
31
31
  "types": "./dist/index.d.ts",
32
32
  "exports": {
33
33
  ".": {
34
+ "types": "./dist/index.d.ts",
34
35
  "import": "./dist/cesium-timeline-core.js",
35
- "require": "./dist/cesium-timeline-core.umd.cjs",
36
- "types": "./dist/index.d.ts"
36
+ "require": "./dist/cesium-timeline-core.umd.cjs"
37
37
  }
38
38
  },
39
39
  "files": [