@xpyjs/gantt-core 0.0.1-beta.2 → 0.0.1-beta.4

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/x-gantt.js CHANGED
@@ -1,11 +1,11 @@
1
1
  var Pt = Object.defineProperty;
2
2
  var Yt = (f, t, e) => t in f ? Pt(f, t, { enumerable: !0, configurable: !0, writable: !0, value: e }) : f[t] = e;
3
3
  var a = (f, t, e) => Yt(f, typeof t != "symbol" ? t + "" : t, e);
4
- import I from "dayjs";
4
+ import G from "dayjs";
5
5
  import { default as ai } from "dayjs";
6
- import { merge as rt, isArray as X, isString as V, isFunction as j, cloneDeep as J, isObject as Ct, isNumber as Ut, omit as yt, throttle as wt, isBoolean as ht, debounce as Xt } from "lodash-es";
6
+ import { merge as rt, isArray as X, isString as V, isFunction as j, cloneDeep as Z, isObject as Ct, isNumber as Ut, omit as yt, throttle as wt, isBoolean as ht, debounce as Xt } from "lodash-es";
7
7
  import S from "konva";
8
- const Lt = "0.0.1-beta.2";
8
+ const Lt = "0.0.1-beta.4";
9
9
  function Vt() {
10
10
  const f = "#eca710", t = "#ffffff", e = "#e7209e", i = "#ffffff", s = "#1c42e8";
11
11
  [
@@ -114,7 +114,7 @@ const N = class N {
114
114
  */
115
115
  static formatArgs(...t) {
116
116
  const e = [N.Prefix];
117
- return N.options.showTimestamp && e.unshift(`[${I().format("YYYY-MM-DD HH:mm:ss.SSS")}]`), [e.join(""), ...t];
117
+ return N.options.showTimestamp && e.unshift(`[${G().format("YYYY-MM-DD HH:mm:ss.SSS")}]`), [e.join(""), ...t];
118
118
  }
119
119
  };
120
120
  a(N, "Prefix", "[XGantt]"), a(N, "options", {
@@ -329,7 +329,7 @@ class Kt {
329
329
  const s = [];
330
330
  t.holiday.holidays.forEach((n) => {
331
331
  if (X(n.date)) {
332
- const o = n.date.map((r) => I(r)).sort((r, h) => r.diff(h));
332
+ const o = n.date.map((r) => G(r)).sort((r, h) => r.diff(h));
333
333
  for (let r = 1; r < o.length; r++)
334
334
  if (o[r].diff(o[r - 1], "day") > 1) {
335
335
  s.push({
@@ -401,8 +401,8 @@ class jt {
401
401
  this.events.clear();
402
402
  }
403
403
  }
404
- var C = /* @__PURE__ */ ((f) => (f.LOADED = "loaded", f.COLUMN_WIDTH_CHANGE = "column-width-change", f.MOVE_GUIDELINE = "move-guideline", f.SHOW_GUIDELINE = "show-guideline", f.HIDE_GUIDELINE = "hide-guideline", f.TOGGLE_COLLAPSE = "toggle-collapse", f.SCROLL = "scroll", f.CHART_OFFSET_CHANGE = "chart_offset_change", f.DATA_UPDATE = "data-update", f.VIEW_UPDATE = "view-update", f.UPDATE_TABLE_HEADER = "update_table_header", f.UPDATE_TABLE_BODY = "update_table_body", f.UPDATE_CHART_HEADER = "update_chart_header", f.UPDATE_TASK = "update_task", f.UPDATE_LINK = "update_link", f.CREATE_LINK = "create_link", f.TASK_SELECTED = "task_selected", f.TASK_UNSELECTED = "task_unselected", f.SELECT_LINK = "select_link", f.CHECK_TASK = "check_task", f.CONTEXT_LINK = "context_link", f.ROW_CLICK = "row-click", f.ROW_DBL_CLICK = "row-dbl-click", f.ROW_CONTEXTMENU = "row-contextmenu", f.SLIDER_CLICK = "slider-click", f.SLIDER_DBL_CLICK = "slider-dbl-click", f.SLIDER_CONTEXTMENU = "slider-contextmenu", f.SLIDER_MOVING = "slider-moving", f.SLIDER_HOVER = "slider-hover", f.SLIDER_LEAVE = "slider-leave", f.SLIDER_BLINK = "slider-blink", f.LINK_BLINK = "link-blink", f.ROW_HIGHLIGHT = "row-highlight", f.ROW_UNHIGHLIGHT = "row-unhighlight", f.TASK_DRAG_START = "task-drag-start", f.TASK_DRAG_MOVE = "task-drag-move", f.TASK_DRAG_END = "task-drag-end", f.BASELINE_CLICK = "baseline-click", f.BASELINE_CONTEXTMENU = "baseline-contextmenu", f.BASELINE_MOUSEOVER = "baseline-mouseover", f.BASELINE_MOUSEOUT = "baseline-mouseout", f.ERROR = "error", f))(C || {}), Y = /* @__PURE__ */ ((f) => (f.INVALID_TYPE = "INVALID_TYPE", f.TASK_NOT_FOUND = "TASK_NOT_FOUND", f.LINK_NOT_ALLOWED = "LINK_NOT_ALLOWED", f.LINK_SAME = "LINK_SAME", f.LINK_EXIST = "LINK_EXIST", f.LINK_INVALID_ARG = "LINK_INVALID_ARG", f.LINK_CYCLE = "LINK_CYCLE", f))(Y || {});
405
- function Z() {
404
+ var L = /* @__PURE__ */ ((f) => (f.LOADED = "loaded", f.COLUMN_WIDTH_CHANGE = "column-width-change", f.MOVE_GUIDELINE = "move-guideline", f.SHOW_GUIDELINE = "show-guideline", f.HIDE_GUIDELINE = "hide-guideline", f.TOGGLE_COLLAPSE = "toggle-collapse", f.SCROLL = "scroll", f.CHART_OFFSET_CHANGE = "chart_offset_change", f.DATA_UPDATE = "data-update", f.VIEW_UPDATE = "view-update", f.UPDATE_TABLE_HEADER = "update_table_header", f.UPDATE_TABLE_BODY = "update_table_body", f.UPDATE_CHART_HEADER = "update_chart_header", f.UPDATE_TASK = "update_task", f.UPDATE_LINK = "update_link", f.CREATE_LINK = "create_link", f.TASK_SELECTED = "task_selected", f.TASK_UNSELECTED = "task_unselected", f.SELECT_LINK = "select_link", f.CHECK_TASK = "check_task", f.CONTEXT_LINK = "context_link", f.ROW_CLICK = "row-click", f.ROW_DBL_CLICK = "row-dbl-click", f.ROW_CONTEXTMENU = "row-contextmenu", f.SLIDER_CLICK = "slider-click", f.SLIDER_DBL_CLICK = "slider-dbl-click", f.SLIDER_CONTEXTMENU = "slider-contextmenu", f.SLIDER_MOVING = "slider-moving", f.SLIDER_HOVER = "slider-hover", f.SLIDER_LEAVE = "slider-leave", f.SLIDER_BLINK = "slider-blink", f.LINK_BLINK = "link-blink", f.ROW_HIGHLIGHT = "row-highlight", f.ROW_UNHIGHLIGHT = "row-unhighlight", f.TASK_DRAG_START = "task-drag-start", f.TASK_DRAG_MOVE = "task-drag-move", f.TASK_DRAG_END = "task-drag-end", f.BASELINE_CLICK = "baseline-click", f.BASELINE_CONTEXTMENU = "baseline-contextmenu", f.BASELINE_MOUSEOVER = "baseline-mouseover", f.BASELINE_MOUSEOUT = "baseline-mouseout", f.ERROR = "error", f))(L || {}), Y = /* @__PURE__ */ ((f) => (f.INVALID_TYPE = "INVALID_TYPE", f.TASK_NOT_FOUND = "TASK_NOT_FOUND", f.LINK_NOT_ALLOWED = "LINK_NOT_ALLOWED", f.LINK_SAME = "LINK_SAME", f.LINK_EXIST = "LINK_EXIST", f.LINK_INVALID_ARG = "LINK_INVALID_ARG", f.LINK_CYCLE = "LINK_CYCLE", f))(Y || {});
405
+ function Q() {
406
406
  return Math.random().toString(36).substring(2, 15);
407
407
  }
408
408
  function $(f, t, e) {
@@ -448,10 +448,10 @@ function bt(f, t = 16, e = 16) {
448
448
  const s = new Promise((n, o) => {
449
449
  let r = f;
450
450
  if (!/viewBox\s*=\s*["'][^"']*["']/.test(r)) {
451
- const l = r.match(/width\s*=\s*["']([^"']*)["']/), p = r.match(/height\s*=\s*["']([^"']*)["']/), m = l ? parseFloat(l[1]) : t, u = p ? parseFloat(p[1]) : e;
451
+ const l = r.match(/width\s*=\s*["']([^"']*)["']/), m = r.match(/height\s*=\s*["']([^"']*)["']/), p = l ? parseFloat(l[1]) : t, u = m ? parseFloat(m[1]) : e;
452
452
  r = r.replace(
453
453
  /<svg([^>]*)>/,
454
- `<svg$1 viewBox="0 0 ${m} ${u}">`
454
+ `<svg$1 viewBox="0 0 ${p} ${u}">`
455
455
  );
456
456
  }
457
457
  r = r.replace(/width\s*=\s*["'][^"']*["']/, `width="${t}"`), r = r.replace(/height\s*=\s*["'][^"']*["']/, `height="${e}"`), /width\s*=/.test(r) || (r = r.replace(/<svg/, `<svg width="${t}"`)), /height\s*=/.test(r) || (r = r.replace(/<svg/, `<svg height="${e}"`)), /preserveAspectRatio\s*=/.test(r) || (r = r.replace(
@@ -471,7 +471,7 @@ function bt(f, t = 16, e = 16) {
471
471
  }
472
472
  class mt {
473
473
  constructor(t, e, i, s, n) {
474
- a(this, "__key__", Z());
474
+ a(this, "__key__", Q());
475
475
  /**
476
476
  * 任务ID
477
477
  * 如果没有提供,则会自动生成一个唯一ID
@@ -529,7 +529,7 @@ class mt {
529
529
  */
530
530
  a(this, "data");
531
531
  a(this, "fields");
532
- this.store = t, this.event = e, this.fields = this.store.getOptionManager().getOptions().fields, this.id = n || i[this.fields.id] || Z(), this.data = i, this.name = i[this.fields.name] || "", this.type = i[this.fields.type] || "task", this.updateMode(), this.progress = i[this.fields.progress], this.expanded = this.store.getOptionManager().getOptions().expand.show ? this.store.getOptionManager().getOptions().expand.enabled : !0, this.children = [], this.level = s && s.level !== void 0 ? s.level + 1 : 0, this.parent = s, this.flatIndex = 0, this.store.updateTime(this.startTime, this.endTime);
532
+ this.store = t, this.event = e, this.fields = this.store.getOptionManager().getOptions().fields, this.id = n || i[this.fields.id] || Q(), this.data = i, this.name = i[this.fields.name] || "", this.type = i[this.fields.type] || "task", this.updateMode(), this.progress = i[this.fields.progress], this.expanded = this.store.getOptionManager().getOptions().expand.show ? this.store.getOptionManager().getOptions().expand.enabled : !0, this.children = [], this.level = s && s.level !== void 0 ? s.level + 1 : 0, this.parent = s, this.flatIndex = 0, this.store.updateTime(this.startTime, this.endTime);
533
533
  }
534
534
  getField(t) {
535
535
  if (!t || V(t) && t.trim() === "")
@@ -544,29 +544,29 @@ class mt {
544
544
  return;
545
545
  i = i[n];
546
546
  }
547
- return Ct(i) ? J(i) : i;
547
+ return Ct(i) ? Z(i) : i;
548
548
  }
549
549
  /** 切换展示模式时,需要调整时间 */
550
550
  updateMode() {
551
551
  let t = !1;
552
- return this.data[this.fields.startTime] && (!this.startTime || !this.startTime.isSame(I(this.data[this.fields.startTime]))) && (this.startTime = I(this.data[this.fields.startTime]), t = !0), this.data[this.fields.endTime] && (!this.endTime || !this.endTime.isSame(I(this.data[this.fields.endTime]))) && (this.endTime = I(this.data[this.fields.endTime]), t = !0), this.startTime && this.endTime && this.duration === 0 && (this.duration = this.endTime.diff(this.startTime)), this.isMilestone() && (!this.endTime || !this.endTime.isSame(this.startTime)) && (this.endTime = this.startTime, t = !0), t;
552
+ return this.data[this.fields.startTime] && (!this.startTime || !this.startTime.isSame(G(this.data[this.fields.startTime]))) && (this.startTime = G(this.data[this.fields.startTime]), t = !0), this.data[this.fields.endTime] && (!this.endTime || !this.endTime.isSame(G(this.data[this.fields.endTime]))) && (this.endTime = G(this.data[this.fields.endTime]), t = !0), this.startTime && this.endTime && this.duration === 0 && (this.duration = this.endTime.diff(this.startTime)), this.isMilestone() && (!this.endTime || !this.endTime.isSame(this.startTime)) && (this.endTime = this.startTime, t = !0), t;
553
553
  }
554
554
  updateData(t) {
555
555
  this.data = t;
556
556
  let e = !1;
557
- t[this.fields.name] && this.name !== t[this.fields.name] && (this.name = t[this.fields.name], e = !0), t[this.fields.type] && this.type !== t[this.fields.type] && (this.type = t[this.fields.type], e = !0), e = this.updateMode(), t[this.fields.progress] !== void 0 && (this.progress !== t[this.fields.progress] && (e = !0), this.progress = $(t[this.fields.progress], 0, 100)), e && this.event.emit(C.UPDATE_TASK, this);
557
+ t[this.fields.name] && this.name !== t[this.fields.name] && (this.name = t[this.fields.name], e = !0), t[this.fields.type] && this.type !== t[this.fields.type] && (this.type = t[this.fields.type], e = !0), e = this.updateMode(), t[this.fields.progress] !== void 0 && (this.progress !== t[this.fields.progress] && (e = !0), this.progress = $(t[this.fields.progress], 0, 100)), e && this.event.emit(L.UPDATE_TASK, this);
558
558
  }
559
559
  updateTime(t, e) {
560
560
  var s, n;
561
561
  this.startTime = t, this.endTime = this.isMilestone() ? t : e;
562
562
  const i = (n = (s = this.store) == null ? void 0 : s.getOptionManager().getOptions()) == null ? void 0 : n.dateFormat;
563
- this.data[this.fields.startTime || "startTime"] = this.startTime.format(i), this.isMilestone() ? this.data[this.fields.endTime || "endTime"] = this.startTime.add(this.duration).format(i) : this.data[this.fields.endTime || "endTime"] = this.endTime.format(i), this.event.emit(C.UPDATE_TASK, this);
563
+ this.data[this.fields.startTime || "startTime"] = this.startTime.format(i), this.isMilestone() ? this.data[this.fields.endTime || "endTime"] = this.startTime.add(this.duration).format(i) : this.data[this.fields.endTime || "endTime"] = this.endTime.format(i), this.event.emit(L.UPDATE_TASK, this);
564
564
  }
565
565
  clone() {
566
566
  return new mt(
567
567
  this.store,
568
568
  this.event,
569
- J(this.data),
569
+ Z(this.data),
570
570
  this.parent,
571
571
  this.id
572
572
  );
@@ -613,11 +613,11 @@ class Qt {
613
613
  a(this, "target", !1);
614
614
  this.store = t, this.event = e;
615
615
  const s = this.store.getOptionManager().getOptions().fields, n = this.store.getOptionManager().getOptions().baselines.fields;
616
- this.taskId = i[t.getOptionManager().getOptions().baselines.taskKey], this.id = i[s.id] || i[n.id] || Z(), this.name = i[s.name] || i[n.name] || "", this.highlight = i[n.highlight] !== !1, this.target = i[n.target] === !0;
616
+ this.taskId = i[t.getOptionManager().getOptions().baselines.taskKey], this.id = i[s.id] || i[n.id] || Q(), this.name = i[s.name] || i[n.name] || "", this.highlight = i[n.highlight] !== !1, this.target = i[n.target] === !0;
617
617
  const o = i[s.startTime] || i[n.startTime];
618
- o && (this.startTime = I(o));
618
+ o && (this.startTime = G(o));
619
619
  const r = i[s.endTime] || i[n.endTime];
620
- r && (this.endTime = I(r)), this.data = i;
620
+ r && (this.endTime = G(r)), this.data = i;
621
621
  }
622
622
  getField(t) {
623
623
  return this.data[t];
@@ -680,7 +680,7 @@ class Jt {
680
680
  * 设置源数据并初始化任务
681
681
  */
682
682
  setData(t, e = !1) {
683
- this.rawData = t, this.initTasks(e), this.invalidateCache(), this.event.emit(C.DATA_UPDATE);
683
+ this.rawData = t, this.initTasks(e), this.invalidateCache(), this.event.emit(L.DATA_UPDATE);
684
684
  }
685
685
  /**
686
686
  * 初始化任务
@@ -800,7 +800,7 @@ class Jt {
800
800
  const i = this.getTaskById(t);
801
801
  return i ? (i.expanded = !i.expanded, i.expanded ? this.collapsedTaskIds.delete(i.id) : this.collapsedTaskIds.add(i.id), e && i.children && i.children.length > 0 && i.children.forEach((s) => {
802
802
  this.expandTask(s.id, e);
803
- }), this.invalidateCache(), this.event.emit(C.VIEW_UPDATE), !0) : !1;
803
+ }), this.invalidateCache(), this.event.emit(L.VIEW_UPDATE), !0) : !1;
804
804
  }
805
805
  /**
806
806
  * 按条件筛选任务
@@ -854,7 +854,7 @@ class Jt {
854
854
  * 清空所有数据
855
855
  */
856
856
  clear() {
857
- this.rawData = [], this.tasks = [], this.taskMap.clear(), this.visibleTasksCache = [], this.isDirty = !0, this.collapsedTaskIds.clear(), this.event.emit(C.DATA_UPDATE);
857
+ this.rawData = [], this.tasks = [], this.taskMap.clear(), this.visibleTasksCache = [], this.isDirty = !0, this.collapsedTaskIds.clear(), this.event.emit(L.DATA_UPDATE);
858
858
  }
859
859
  /**
860
860
  * 更新子任务的层级
@@ -882,7 +882,7 @@ class Jt {
882
882
  */
883
883
  selectTask(t) {
884
884
  const e = this.getTaskById(t);
885
- return e ? (this.selectedTaskId === t || (this.unselectTask(), this.selectedTaskId = t, this.event.emit(C.TASK_SELECTED, e)), !0) : !1;
885
+ return e ? (this.selectedTaskId === t || (this.unselectTask(), this.selectedTaskId = t, this.event.emit(L.TASK_SELECTED, e)), !0) : !1;
886
886
  }
887
887
  /**
888
888
  * 取消任务选择
@@ -890,7 +890,7 @@ class Jt {
890
890
  unselectTask() {
891
891
  if (this.selectedTaskId) {
892
892
  const t = this.selectedTaskId;
893
- this.selectedTaskId = null, this.event.emit(C.TASK_UNSELECTED, t);
893
+ this.selectedTaskId = null, this.event.emit(L.TASK_UNSELECTED, t);
894
894
  }
895
895
  }
896
896
  /**
@@ -927,20 +927,20 @@ class Jt {
927
927
  let d = t.parent;
928
928
  for (; c !== "none" && d; ) {
929
929
  if (c === "expand") {
930
- let p = d.startTime || o, m = d.endTime || r;
931
- (!d.startTime || o.isBefore(d.startTime)) && (p = o), (!d.endTime || r.isAfter(d.endTime)) && (m = r), (d.startTime === void 0 || d.endTime === void 0 || !p.isSame(d.startTime) || !m.isSame(d.endTime)) && (n.findIndex((u) => u.id === d.id) === -1 && n.push(d.clone()), d.updateTime(p, m));
930
+ let m = d.startTime || o, p = d.endTime || r;
931
+ (!d.startTime || o.isBefore(d.startTime)) && (m = o), (!d.endTime || r.isAfter(d.endTime)) && (p = r), (d.startTime === void 0 || d.endTime === void 0 || !m.isSame(d.startTime) || !p.isSame(d.endTime)) && (n.findIndex((u) => u.id === d.id) === -1 && n.push(d.clone()), d.updateTime(m, p));
932
932
  } else c === "strict" && (d.startTime && o.isBefore(d.startTime) && (o = d.startTime, r.isSameOrBefore(o) && (r = o.add(1, g))), d.endTime && r.isAfter(d.endTime) && (r = d.endTime, o.isAfter(r) && (o = r.subtract(1, g))));
933
933
  d = d.parent;
934
934
  }
935
935
  let l = t.children || [];
936
936
  for (; h !== "none" && l.length > 0; ) {
937
- const p = [];
938
- l.forEach((m) => {
939
- let u = m.startTime || o, x = m.endTime || r, w = o.diff(t.startTime), T = r.diff(t.endTime);
940
- h === "scale" ? s === "both" ? (n.findIndex((b) => b.id === m.id) === -1 && n.push(m.clone()), m.updateTime(u.add(w), x.add(T))) : s === "left" ? (u = u.add(w), u.isSameOrAfter(x.subtract(1, g)) && (x.isBefore(t.endTime) ? x = u.add(1, g) : u = x.subtract(1, g), u.isSameOrBefore(o) && (o = u)), n.findIndex((b) => b.id === m.id) === -1 && n.push(m.clone()), m.updateTime(u, x)) : s === "right" && (x = x.add(T), x.isSameOrBefore(u.add(1, g)) && (u.isAfter(t.startTime) ? u = x.subtract(1, g) : x = u.add(1, g)), x.isSameOrAfter(r) && (r = x), n.findIndex((b) => b.id === m.id) === -1 && n.push(m.clone()), m.updateTime(u, x)) : h === "fixed" && (s === "both" ? (n.findIndex((b) => b.id === m.id) === -1 && n.push(m.clone()), m.updateTime(u.add(w), x.add(T))) : s === "left" ? u.isSameOrBefore(o) && (u = o, u.isSameOrAfter(x.subtract(1, g)) && (x.isBefore(t.endTime) ? x = u.add(1, g) : u = x.subtract(1, g), u.isSameOrBefore(o) && (o = u)), n.findIndex((b) => b.id === m.id) === -1 && n.push(m.clone()), m.updateTime(u, x)) : s === "right" && x.isSameOrAfter(r) && (x = r, x.isSameOrBefore(u.add(1, g)) && (u.isAfter(t.startTime) ? u = x.subtract(1, g) : x = u.add(1, g)), x.isSameOrAfter(r) && (r = x), n.findIndex((b) => b.id === m.id) === -1 && n.push(m.clone()), m.updateTime(u, x))), m.children && m.children.length > 0 && p.push(...m.children);
941
- }), l = p;
937
+ const m = [];
938
+ l.forEach((p) => {
939
+ let u = p.startTime || o, y = p.endTime || r, x = o.diff(t.startTime), T = r.diff(t.endTime);
940
+ h === "scale" ? s === "both" ? (n.findIndex((b) => b.id === p.id) === -1 && n.push(p.clone()), p.updateTime(u.add(x), y.add(T))) : s === "left" ? (u = u.add(x), u.isSameOrAfter(y.subtract(1, g)) && (y.isBefore(t.endTime) ? y = u.add(1, g) : u = y.subtract(1, g), u.isSameOrBefore(o) && (o = u)), n.findIndex((b) => b.id === p.id) === -1 && n.push(p.clone()), p.updateTime(u, y)) : s === "right" && (y = y.add(T), y.isSameOrBefore(u.add(1, g)) && (u.isAfter(t.startTime) ? u = y.subtract(1, g) : y = u.add(1, g)), y.isSameOrAfter(r) && (r = y), n.findIndex((b) => b.id === p.id) === -1 && n.push(p.clone()), p.updateTime(u, y)) : h === "fixed" && (s === "both" ? (n.findIndex((b) => b.id === p.id) === -1 && n.push(p.clone()), p.updateTime(u.add(x), y.add(T))) : s === "left" ? u.isSameOrBefore(o) && (u = o, u.isSameOrAfter(y.subtract(1, g)) && (y.isBefore(t.endTime) ? y = u.add(1, g) : u = y.subtract(1, g), u.isSameOrBefore(o) && (o = u)), n.findIndex((b) => b.id === p.id) === -1 && n.push(p.clone()), p.updateTime(u, y)) : s === "right" && y.isSameOrAfter(r) && (y = r, y.isSameOrBefore(u.add(1, g)) && (u.isAfter(t.startTime) ? u = y.subtract(1, g) : y = u.add(1, g)), y.isSameOrAfter(r) && (r = y), n.findIndex((b) => b.id === p.id) === -1 && n.push(p.clone()), p.updateTime(u, y))), p.children && p.children.length > 0 && m.push(...p.children);
941
+ }), l = m;
942
942
  }
943
- n.findIndex((p) => p.id === t.id) === -1 && n.push(t.clone()), t.updateTime(o, r);
943
+ n.findIndex((m) => m.id === t.id) === -1 && n.push(t.clone()), t.updateTime(o, r);
944
944
  }
945
945
  //** 基线数据操作 */
946
946
  setBaselines(t) {
@@ -1009,8 +1009,8 @@ function Zt(f) {
1009
1009
  }
1010
1010
  function te(f, t, e, i, s = !1, n = !1) {
1011
1011
  const o = (l) => {
1012
- const p = Math.round($(l, 0, 255)).toString(16);
1013
- return p.length === 1 ? "0" + p : p;
1012
+ const m = Math.round($(l, 0, 255)).toString(16);
1013
+ return m.length === 1 ? "0" + m : m;
1014
1014
  }, r = o(f), h = o(t), c = o(e), g = o(i * 255);
1015
1015
  if (s && r[0] === r[1] && h[0] === h[1] && c[0] === c[1] && i === 1 && // Alpha 必须为 1 才能缩写
1016
1016
  !n)
@@ -1261,14 +1261,14 @@ class Et {
1261
1261
  )) : (this.context.store.getDataManager().updateCheckedList(!0, this.task), this.setState(
1262
1262
  1
1263
1263
  /* CHECKED */
1264
- )), this.context.event.emit(C.CHECK_TASK, [this.task], !e);
1264
+ )), this.context.event.emit(L.CHECK_TASK, [this.task], !e);
1265
1265
  } else {
1266
1266
  const e = this.context.store.getDataManager().getCheckedList().length === this.context.store.getDataManager().getVisibleSize();
1267
1267
  this.setState(
1268
1268
  e ? 1 : 0
1269
1269
  /* UNCHECKED */
1270
1270
  ), this.context.store.getDataManager().toggleAllChecked(!e), this.context.event.emit(
1271
- C.CHECK_TASK,
1271
+ L.CHECK_TASK,
1272
1272
  this.context.store.getDataManager().getVisibleTasks(),
1273
1273
  !e
1274
1274
  );
@@ -1291,14 +1291,14 @@ class Et {
1291
1291
  }), this.setState(
1292
1292
  1
1293
1293
  /* CHECKED */
1294
- )), this.context.event.emit(C.CHECK_TASK, e, !i);
1294
+ )), this.context.event.emit(L.CHECK_TASK, e, !i);
1295
1295
  } else {
1296
1296
  const e = this.context.store.getDataManager().getCheckedList().length === this.context.store.getDataManager().getVisibleSize();
1297
1297
  this.setState(
1298
1298
  e ? 1 : 0
1299
1299
  /* UNCHECKED */
1300
1300
  ), this.context.store.getDataManager().toggleAllChecked(!e), this.context.event.emit(
1301
- C.CHECK_TASK,
1301
+ L.CHECK_TASK,
1302
1302
  this.context.store.getDataManager().getVisibleTasks(),
1303
1303
  !e
1304
1304
  );
@@ -1306,7 +1306,7 @@ class Et {
1306
1306
  });
1307
1307
  }
1308
1308
  registerEvents() {
1309
- this.context.event.on(C.CHECK_TASK, this.updateState.bind(this));
1309
+ this.context.event.on(L.CHECK_TASK, this.updateState.bind(this));
1310
1310
  }
1311
1311
  /** 获取元素 */
1312
1312
  getElement() {
@@ -1377,13 +1377,13 @@ class ee {
1377
1377
  */
1378
1378
  processColumns(t, e = [], i, s = 1) {
1379
1379
  t.forEach((n, o) => {
1380
- var m;
1380
+ var p;
1381
1381
  const r = "children" in n && Array.isArray(n.children) && n.children.length > 0, h = !r;
1382
1382
  let c = "";
1383
1383
  r ? c = `group-${o}` : c = `field-${n.field}`;
1384
1384
  const g = [...(i == null ? void 0 : i.path) || [], c];
1385
1385
  c = "column-" + o + "-" + g.join("-");
1386
- const d = n.label || (h ? n.field : ""), l = h ? ((m = this.temporaryLeafColumns.find((u) => u.key === c)) == null ? void 0 : m.width) || n.width || 100 : "auto", p = {
1386
+ const d = n.label || (h ? n.field : ""), l = h ? ((p = this.temporaryLeafColumns.find((u) => u.key === c)) == null ? void 0 : p.width) || n.width || 100 : "auto", m = {
1387
1387
  label: d,
1388
1388
  level: s,
1389
1389
  maxLevel: s,
@@ -1394,21 +1394,21 @@ class ee {
1394
1394
  isLeaf: h,
1395
1395
  width: l
1396
1396
  };
1397
- if (e.push(p), h)
1398
- this.leafColumns.push(p);
1397
+ if (e.push(m), h)
1398
+ this.leafColumns.push(m);
1399
1399
  else if (r) {
1400
1400
  const u = n.children;
1401
1401
  this.processColumns(
1402
1402
  u,
1403
- p.children,
1404
- p,
1403
+ m.children,
1404
+ m,
1405
1405
  s + 1
1406
- ), p.maxLevel = Math.max(
1407
- p.maxLevel,
1408
- p.children.reduce((x, w) => Math.max(x, w.maxLevel), 0)
1406
+ ), m.maxLevel = Math.max(
1407
+ m.maxLevel,
1408
+ m.children.reduce((y, x) => Math.max(y, x.maxLevel), 0)
1409
1409
  );
1410
1410
  }
1411
- }), this.temporaryLeafColumns = J(this.leafColumns);
1411
+ }), this.temporaryLeafColumns = Z(this.leafColumns);
1412
1412
  }
1413
1413
  /**
1414
1414
  * 根据 key 查找列
@@ -1438,7 +1438,7 @@ class ee {
1438
1438
  }
1439
1439
  setColumnWidth(t, e) {
1440
1440
  const i = this.leafColumns.find((s) => s.key === t);
1441
- i && (i.width = e), this.context.event.emit(C.COLUMN_WIDTH_CHANGE, t, e);
1441
+ i && (i.width = e), this.context.event.emit(L.COLUMN_WIDTH_CHANGE, t, e);
1442
1442
  }
1443
1443
  isLastColumn(t) {
1444
1444
  return this.leafColumns.findIndex((i) => i.key === t) === this.leafColumns.length - 1;
@@ -1481,7 +1481,7 @@ class ee {
1481
1481
  return this.columns.some((t) => t.maxLevel > 1);
1482
1482
  }
1483
1483
  collapse() {
1484
- this.collapseTable = !this.collapseTable, this.context.event.emit(C.TOGGLE_COLLAPSE);
1484
+ this.collapseTable = !this.collapseTable, this.context.event.emit(L.TOGGLE_COLLAPSE);
1485
1485
  }
1486
1486
  isCollapsed() {
1487
1487
  return this.collapseTable;
@@ -1551,7 +1551,7 @@ const tt = class tt {
1551
1551
  }
1552
1552
  /** 更新各种缓存配置 */
1553
1553
  update() {
1554
- this.setLinks(this.links);
1554
+ this.setLinks(this.links, !0);
1555
1555
  }
1556
1556
  /** 检查连线是否存在 */
1557
1557
  isLinkExist(t, e, i) {
@@ -1596,12 +1596,18 @@ const tt = class tt {
1596
1596
  /** 校验新增连线是否会产生环 */
1597
1597
  validateChain(t, e, i) {
1598
1598
  const s = { from: t, to: e, type: i }, n = this.validateLink(s);
1599
- return n.ok ? this.enableCycleDetection && this.willCreateCycle(t, e) ? {
1600
- ok: !1,
1601
- reason: Y.LINK_CYCLE,
1602
- message: O.getMessage("Adding this link would create a cycle"),
1603
- cycleInfo: this.buildSimpleCycleInfo(t, e)
1604
- } : { ok: !0 } : n;
1599
+ if (!n.ok) return n;
1600
+ if (this.enableCycleDetection) {
1601
+ const o = this.willCreateCycle(t, e);
1602
+ if (o)
1603
+ return {
1604
+ ok: !1,
1605
+ reason: Y.LINK_CYCLE,
1606
+ message: O.getMessage("Adding this link would create a cycle"),
1607
+ cycleInfo: o
1608
+ };
1609
+ }
1610
+ return { ok: !0 };
1605
1611
  }
1606
1612
  /** 批量校验连线 */
1607
1613
  validateLinks(t) {
@@ -1684,81 +1690,81 @@ const tt = class tt {
1684
1690
  };
1685
1691
  const i = this.forwardMemo.get(t), s = this.backwardMemo.get(t);
1686
1692
  this.recordCacheAccess(t, !!(i && s));
1687
- const n = (w) => (this.fromLinksMap.get(w) || []).map((b) => this.getTask(b.to)).filter((b) => !!b), o = (w) => (this.toLinksMap.get(w) || []).map((b) => this.getTask(b.from)).filter((b) => !!b), r = (w, T, b = /* @__PURE__ */ new Set()) => {
1688
- const y = w.id;
1689
- if (this.forwardMemo.has(y))
1690
- return this.recordCacheAccess(y, !0), this.forwardMemo.get(y);
1691
- if (T.has(w.id) || b.has(w.id))
1693
+ const n = (x) => (this.fromLinksMap.get(x) || []).map((b) => this.getTask(b.to)).filter((b) => !!b), o = (x) => (this.toLinksMap.get(x) || []).map((b) => this.getTask(b.from)).filter((b) => !!b), r = (x, T, b = /* @__PURE__ */ new Set()) => {
1694
+ const w = x.id;
1695
+ if (this.forwardMemo.has(w))
1696
+ return this.recordCacheAccess(w, !0), this.forwardMemo.get(w);
1697
+ if (T.has(x.id) || b.has(x.id))
1692
1698
  return [];
1693
- T.add(w.id), b.add(w.id);
1694
- const k = n(w.id);
1699
+ T.add(x.id), b.add(x.id);
1700
+ const C = n(x.id);
1695
1701
  let E = [];
1696
- if (k.length === 0)
1697
- E = [[w]];
1702
+ if (C.length === 0)
1703
+ E = [[x]];
1698
1704
  else {
1699
- for (const L of k) {
1700
- const v = r(L, T, b);
1705
+ for (const k of C) {
1706
+ const v = r(k, T, b);
1701
1707
  for (const M of v)
1702
- E.push([w, ...M]);
1708
+ E.push([x, ...M]);
1703
1709
  }
1704
- E.length === 0 && (E = [[w]]);
1710
+ E.length === 0 && (E = [[x]]);
1705
1711
  }
1706
- return T.delete(w.id), E.length < 100 && (this.forwardMemo.set(y, E), this.recordCacheAccess(y, !1)), E;
1707
- }, h = (w, T, b = /* @__PURE__ */ new Set()) => {
1708
- const y = w.id;
1709
- if (this.backwardMemo.has(y))
1710
- return this.recordCacheAccess(y, !0), this.backwardMemo.get(y);
1711
- if (T.has(w.id) || b.has(w.id))
1712
+ return T.delete(x.id), E.length < 100 && (this.forwardMemo.set(w, E), this.recordCacheAccess(w, !1)), E;
1713
+ }, h = (x, T, b = /* @__PURE__ */ new Set()) => {
1714
+ const w = x.id;
1715
+ if (this.backwardMemo.has(w))
1716
+ return this.recordCacheAccess(w, !0), this.backwardMemo.get(w);
1717
+ if (T.has(x.id) || b.has(x.id))
1712
1718
  return [];
1713
- T.add(w.id), b.add(w.id);
1714
- const k = o(w.id);
1719
+ T.add(x.id), b.add(x.id);
1720
+ const C = o(x.id);
1715
1721
  let E = [];
1716
- if (k.length === 0)
1717
- E = [[w]];
1722
+ if (C.length === 0)
1723
+ E = [[x]];
1718
1724
  else {
1719
- for (const L of k) {
1720
- const v = h(L, T, b);
1725
+ for (const k of C) {
1726
+ const v = h(k, T, b);
1721
1727
  for (const M of v)
1722
- E.push([...M, w]);
1728
+ E.push([...M, x]);
1723
1729
  }
1724
- E.length === 0 && (E = [[w]]);
1730
+ E.length === 0 && (E = [[x]]);
1725
1731
  }
1726
- return T.delete(w.id), E.length < 100 && (this.backwardMemo.set(y, E), this.recordCacheAccess(y, !1)), E;
1732
+ return T.delete(x.id), E.length < 100 && (this.backwardMemo.set(w, E), this.recordCacheAccess(w, !1)), E;
1727
1733
  }, c = h(e, /* @__PURE__ */ new Set()), g = r(e, /* @__PURE__ */ new Set());
1728
- this.getDirectlyConnectedTasks(t).forEach((w) => {
1729
- this.establishCacheDependency(t, w.id), this.establishCacheDependency(w.id, t);
1734
+ this.getDirectlyConnectedTasks(t).forEach((x) => {
1735
+ this.establishCacheDependency(t, x.id), this.establishCacheDependency(x.id, t);
1730
1736
  });
1731
- const l = /* @__PURE__ */ new Map(), p = /* @__PURE__ */ new Map(), m = (w, T) => {
1737
+ const l = /* @__PURE__ */ new Map(), m = /* @__PURE__ */ new Map(), p = (x, T) => {
1732
1738
  const b = [];
1733
- for (const y of w) {
1734
- y.forEach((k) => l.set(k.id, k));
1735
- for (let k = 0; k < y.length - 1; k++) {
1736
- const E = y[k].id, L = y[k + 1].id, v = this.findLinkFast(E, L);
1739
+ for (const w of x) {
1740
+ w.forEach((C) => l.set(C.id, C));
1741
+ for (let C = 0; C < w.length - 1; C++) {
1742
+ const E = w[C].id, k = w[C + 1].id, v = this.findLinkFast(E, k);
1737
1743
  if (v) {
1738
1744
  const M = `${v.from}-${v.to}-${v.type || "default"}`;
1739
- p.has(M) || (b.push(v), p.set(M, v));
1745
+ m.has(M) || (b.push(v), m.set(M, v));
1740
1746
  }
1741
1747
  }
1742
1748
  }
1743
1749
  return b;
1744
- }, u = m(c), x = m(g);
1750
+ }, u = p(c), y = p(g);
1745
1751
  return {
1746
1752
  prev: {
1747
- chain: c.map((w) => w.map((T) => T.getEmitData().data)),
1753
+ chain: c.map((x) => x.map((T) => T.getEmitData().data)),
1748
1754
  nodes: c.flat().filter(
1749
- (w, T, b) => b.findIndex((y) => y.id === w.id) === T
1750
- ).map((w) => w.getEmitData().data),
1755
+ (x, T, b) => b.findIndex((w) => w.id === x.id) === T
1756
+ ).map((x) => x.getEmitData().data),
1751
1757
  links: u
1752
1758
  },
1753
1759
  next: {
1754
- chain: g.map((w) => w.map((T) => T.getEmitData().data)),
1760
+ chain: g.map((x) => x.map((T) => T.getEmitData().data)),
1755
1761
  nodes: g.flat().filter(
1756
- (w, T, b) => b.findIndex((y) => y.id === w.id) === T
1757
- ).map((w) => w.getEmitData().data),
1758
- links: x
1762
+ (x, T, b) => b.findIndex((w) => w.id === x.id) === T
1763
+ ).map((x) => x.getEmitData().data),
1764
+ links: y
1759
1765
  },
1760
- allNodes: Array.from(l.values()).map((w) => w.getEmitData().data),
1761
- allLinks: Array.from(p.values()),
1766
+ allNodes: Array.from(l.values()).map((x) => x.getEmitData().data),
1767
+ allLinks: Array.from(m.values()),
1762
1768
  current: e.getEmitData().data
1763
1769
  };
1764
1770
  }
@@ -1773,16 +1779,16 @@ const tt = class tt {
1773
1779
  let o = 0;
1774
1780
  const r = [], h = (l) => {
1775
1781
  e.set(l, o), i.set(l, o), o++, n.push(l), s.add(l);
1776
- const p = this.fromLinksMap.get(l) || [];
1777
- for (const m of p)
1778
- e.has(m.to) ? s.has(m.to) && i.set(l, Math.min(i.get(l), e.get(m.to))) : (h(m.to), i.set(l, Math.min(i.get(l), i.get(m.to))));
1782
+ const m = this.fromLinksMap.get(l) || [];
1783
+ for (const p of m)
1784
+ e.has(p.to) ? s.has(p.to) && i.set(l, Math.min(i.get(l), e.get(p.to))) : (h(p.to), i.set(l, Math.min(i.get(l), i.get(p.to))));
1779
1785
  if (i.get(l) === e.get(l)) {
1780
- const m = [];
1786
+ const p = [];
1781
1787
  for (; ; ) {
1782
1788
  const u = n.pop();
1783
- if (s.delete(u), m.push(u), u === l) break;
1789
+ if (s.delete(u), p.push(u), u === l) break;
1784
1790
  }
1785
- r.push(m);
1791
+ r.push(p);
1786
1792
  }
1787
1793
  };
1788
1794
  this.store.getDataManager().getTasks(!1).forEach((l) => {
@@ -1845,19 +1851,34 @@ const tt = class tt {
1845
1851
  /** 增量环检测(基于拓扑序 + DFS) */
1846
1852
  willCreateCycle(t, e) {
1847
1853
  if (this.computeTopo()) {
1848
- const o = this.topoIndex.get(t), r = this.topoIndex.get(e);
1849
- if (o != null && r != null && o < r) return !1;
1854
+ const r = this.topoIndex.get(t), h = this.topoIndex.get(e);
1855
+ if (r != null && h != null && r < h) return null;
1850
1856
  }
1851
- const s = [e], n = /* @__PURE__ */ new Set();
1857
+ const s = [e], n = /* @__PURE__ */ new Set(), o = /* @__PURE__ */ new Map();
1852
1858
  for (; s.length; ) {
1853
- const o = s.pop();
1854
- if (o === t) return !0;
1855
- if (n.has(o)) continue;
1856
- n.add(o);
1857
- const r = this.fromLinksMap.get(o) || [];
1858
- for (const h of r) s.push(h.to);
1859
+ const r = s.pop();
1860
+ if (n.has(r)) continue;
1861
+ n.add(r);
1862
+ const h = this.fromLinksMap.get(r) || [];
1863
+ for (const c of h) {
1864
+ const g = c.to;
1865
+ if (!n.has(g) && !o.has(g) && o.set(g, r), g === t) {
1866
+ o.has(g) || o.set(g, r);
1867
+ const d = [];
1868
+ let l = t;
1869
+ for (; l !== void 0; )
1870
+ d.push(l), l = o.get(l);
1871
+ const m = d.slice().reverse(), p = [t, ...m];
1872
+ return {
1873
+ cycles: [p],
1874
+ nodes: Array.from(new Set(p)),
1875
+ sccs: []
1876
+ };
1877
+ }
1878
+ s.push(g);
1879
+ }
1859
1880
  }
1860
- return !1;
1881
+ return null;
1861
1882
  }
1862
1883
  /** 构建/重建邻接表 */
1863
1884
  rebuildAdjacency() {
@@ -1897,7 +1918,6 @@ const tt = class tt {
1897
1918
  sccs: []
1898
1919
  };
1899
1920
  }
1900
- // 优化后的缓存失效策略
1901
1921
  /**
1902
1922
  * 精细化缓存失效策略
1903
1923
  * 根据操作类型和影响范围进行精确的缓存失效
@@ -2091,24 +2111,24 @@ var Mt = { exports: {} };
2091
2111
  (function(e, i) {
2092
2112
  f.exports = i();
2093
2113
  })(P, function() {
2094
- var e, i, s = 1e3, n = 6e4, o = 36e5, r = 864e5, h = /\[([^\]]+)]|Y{1,4}|M{1,4}|D{1,2}|d{1,4}|H{1,2}|h{1,2}|a|A|m{1,2}|s{1,2}|Z{1,2}|SSS/g, c = 31536e6, g = 2628e6, d = /^(-|\+)?P(?:([-+]?[0-9,.]*)Y)?(?:([-+]?[0-9,.]*)M)?(?:([-+]?[0-9,.]*)W)?(?:([-+]?[0-9,.]*)D)?(?:T(?:([-+]?[0-9,.]*)H)?(?:([-+]?[0-9,.]*)M)?(?:([-+]?[0-9,.]*)S)?)?$/, l = { years: c, months: g, days: r, hours: o, minutes: n, seconds: s, milliseconds: 1, weeks: 6048e5 }, p = function(E) {
2095
- return E instanceof y;
2096
- }, m = function(E, L, v) {
2097
- return new y(E, v, L.$l);
2114
+ var e, i, s = 1e3, n = 6e4, o = 36e5, r = 864e5, h = /\[([^\]]+)]|Y{1,4}|M{1,4}|D{1,2}|d{1,4}|H{1,2}|h{1,2}|a|A|m{1,2}|s{1,2}|Z{1,2}|SSS/g, c = 31536e6, g = 2628e6, d = /^(-|\+)?P(?:([-+]?[0-9,.]*)Y)?(?:([-+]?[0-9,.]*)M)?(?:([-+]?[0-9,.]*)W)?(?:([-+]?[0-9,.]*)D)?(?:T(?:([-+]?[0-9,.]*)H)?(?:([-+]?[0-9,.]*)M)?(?:([-+]?[0-9,.]*)S)?)?$/, l = { years: c, months: g, days: r, hours: o, minutes: n, seconds: s, milliseconds: 1, weeks: 6048e5 }, m = function(E) {
2115
+ return E instanceof w;
2116
+ }, p = function(E, k, v) {
2117
+ return new w(E, v, k.$l);
2098
2118
  }, u = function(E) {
2099
2119
  return i.p(E) + "s";
2100
- }, x = function(E) {
2120
+ }, y = function(E) {
2101
2121
  return E < 0;
2102
- }, w = function(E) {
2103
- return x(E) ? Math.ceil(E) : Math.floor(E);
2122
+ }, x = function(E) {
2123
+ return y(E) ? Math.ceil(E) : Math.floor(E);
2104
2124
  }, T = function(E) {
2105
2125
  return Math.abs(E);
2106
- }, b = function(E, L) {
2107
- return E ? x(E) ? { negative: !0, format: "" + T(E) + L } : { negative: !1, format: "" + E + L } : { negative: !1, format: "" };
2108
- }, y = function() {
2126
+ }, b = function(E, k) {
2127
+ return E ? y(E) ? { negative: !0, format: "" + T(E) + k } : { negative: !1, format: "" + E + k } : { negative: !1, format: "" };
2128
+ }, w = function() {
2109
2129
  function E(v, M, A) {
2110
2130
  var _ = this;
2111
- if (this.$d = {}, this.$l = A, v === void 0 && (this.$ms = 0, this.parseFromMilliseconds()), M) return m(v * l[u(M)], this);
2131
+ if (this.$d = {}, this.$l = A, v === void 0 && (this.$ms = 0, this.parseFromMilliseconds()), M) return p(v * l[u(M)], this);
2112
2132
  if (typeof v == "number") return this.$ms = v, this.parseFromMilliseconds(), this;
2113
2133
  if (typeof v == "object") return Object.keys(v).forEach(function(W) {
2114
2134
  _.$d[u(W)] = v[W];
@@ -2116,102 +2136,102 @@ var Mt = { exports: {} };
2116
2136
  if (typeof v == "string") {
2117
2137
  var D = v.match(d);
2118
2138
  if (D) {
2119
- var H = D.slice(2).map(function(W) {
2139
+ var I = D.slice(2).map(function(W) {
2120
2140
  return W != null ? Number(W) : 0;
2121
2141
  });
2122
- return this.$d.years = H[0], this.$d.months = H[1], this.$d.weeks = H[2], this.$d.days = H[3], this.$d.hours = H[4], this.$d.minutes = H[5], this.$d.seconds = H[6], this.calMilliseconds(), this;
2142
+ return this.$d.years = I[0], this.$d.months = I[1], this.$d.weeks = I[2], this.$d.days = I[3], this.$d.hours = I[4], this.$d.minutes = I[5], this.$d.seconds = I[6], this.calMilliseconds(), this;
2123
2143
  }
2124
2144
  }
2125
2145
  return this;
2126
2146
  }
2127
- var L = E.prototype;
2128
- return L.calMilliseconds = function() {
2147
+ var k = E.prototype;
2148
+ return k.calMilliseconds = function() {
2129
2149
  var v = this;
2130
2150
  this.$ms = Object.keys(this.$d).reduce(function(M, A) {
2131
2151
  return M + (v.$d[A] || 0) * l[A];
2132
2152
  }, 0);
2133
- }, L.parseFromMilliseconds = function() {
2153
+ }, k.parseFromMilliseconds = function() {
2134
2154
  var v = this.$ms;
2135
- this.$d.years = w(v / c), v %= c, this.$d.months = w(v / g), v %= g, this.$d.days = w(v / r), v %= r, this.$d.hours = w(v / o), v %= o, this.$d.minutes = w(v / n), v %= n, this.$d.seconds = w(v / s), v %= s, this.$d.milliseconds = v;
2136
- }, L.toISOString = function() {
2155
+ this.$d.years = x(v / c), v %= c, this.$d.months = x(v / g), v %= g, this.$d.days = x(v / r), v %= r, this.$d.hours = x(v / o), v %= o, this.$d.minutes = x(v / n), v %= n, this.$d.seconds = x(v / s), v %= s, this.$d.milliseconds = v;
2156
+ }, k.toISOString = function() {
2137
2157
  var v = b(this.$d.years, "Y"), M = b(this.$d.months, "M"), A = +this.$d.days || 0;
2138
2158
  this.$d.weeks && (A += 7 * this.$d.weeks);
2139
- var _ = b(A, "D"), D = b(this.$d.hours, "H"), H = b(this.$d.minutes, "M"), W = this.$d.seconds || 0;
2159
+ var _ = b(A, "D"), D = b(this.$d.hours, "H"), I = b(this.$d.minutes, "M"), W = this.$d.seconds || 0;
2140
2160
  this.$d.milliseconds && (W += this.$d.milliseconds / 1e3, W = Math.round(1e3 * W) / 1e3);
2141
- var G = b(W, "S"), R = v.negative || M.negative || _.negative || D.negative || H.negative || G.negative, F = D.format || H.format || G.format ? "T" : "", z = (R ? "-" : "") + "P" + v.format + M.format + _.format + F + D.format + H.format + G.format;
2161
+ var H = b(W, "S"), R = v.negative || M.negative || _.negative || D.negative || I.negative || H.negative, F = D.format || I.format || H.format ? "T" : "", z = (R ? "-" : "") + "P" + v.format + M.format + _.format + F + D.format + I.format + H.format;
2142
2162
  return z === "P" || z === "-P" ? "P0D" : z;
2143
- }, L.toJSON = function() {
2163
+ }, k.toJSON = function() {
2144
2164
  return this.toISOString();
2145
- }, L.format = function(v) {
2165
+ }, k.format = function(v) {
2146
2166
  var M = v || "YYYY-MM-DDTHH:mm:ss", A = { Y: this.$d.years, YY: i.s(this.$d.years, 2, "0"), YYYY: i.s(this.$d.years, 4, "0"), M: this.$d.months, MM: i.s(this.$d.months, 2, "0"), D: this.$d.days, DD: i.s(this.$d.days, 2, "0"), H: this.$d.hours, HH: i.s(this.$d.hours, 2, "0"), m: this.$d.minutes, mm: i.s(this.$d.minutes, 2, "0"), s: this.$d.seconds, ss: i.s(this.$d.seconds, 2, "0"), SSS: i.s(this.$d.milliseconds, 3, "0") };
2147
2167
  return M.replace(h, function(_, D) {
2148
2168
  return D || String(A[_]);
2149
2169
  });
2150
- }, L.as = function(v) {
2170
+ }, k.as = function(v) {
2151
2171
  return this.$ms / l[u(v)];
2152
- }, L.get = function(v) {
2172
+ }, k.get = function(v) {
2153
2173
  var M = this.$ms, A = u(v);
2154
- return A === "milliseconds" ? M %= 1e3 : M = A === "weeks" ? w(M / l[A]) : this.$d[A], M || 0;
2155
- }, L.add = function(v, M, A) {
2174
+ return A === "milliseconds" ? M %= 1e3 : M = A === "weeks" ? x(M / l[A]) : this.$d[A], M || 0;
2175
+ }, k.add = function(v, M, A) {
2156
2176
  var _;
2157
- return _ = M ? v * l[u(M)] : p(v) ? v.$ms : m(v, this).$ms, m(this.$ms + _ * (A ? -1 : 1), this);
2158
- }, L.subtract = function(v, M) {
2177
+ return _ = M ? v * l[u(M)] : m(v) ? v.$ms : p(v, this).$ms, p(this.$ms + _ * (A ? -1 : 1), this);
2178
+ }, k.subtract = function(v, M) {
2159
2179
  return this.add(v, M, !0);
2160
- }, L.locale = function(v) {
2180
+ }, k.locale = function(v) {
2161
2181
  var M = this.clone();
2162
2182
  return M.$l = v, M;
2163
- }, L.clone = function() {
2164
- return m(this.$ms, this);
2165
- }, L.humanize = function(v) {
2183
+ }, k.clone = function() {
2184
+ return p(this.$ms, this);
2185
+ }, k.humanize = function(v) {
2166
2186
  return e().add(this.$ms, "ms").locale(this.$l).fromNow(!v);
2167
- }, L.valueOf = function() {
2187
+ }, k.valueOf = function() {
2168
2188
  return this.asMilliseconds();
2169
- }, L.milliseconds = function() {
2189
+ }, k.milliseconds = function() {
2170
2190
  return this.get("milliseconds");
2171
- }, L.asMilliseconds = function() {
2191
+ }, k.asMilliseconds = function() {
2172
2192
  return this.as("milliseconds");
2173
- }, L.seconds = function() {
2193
+ }, k.seconds = function() {
2174
2194
  return this.get("seconds");
2175
- }, L.asSeconds = function() {
2195
+ }, k.asSeconds = function() {
2176
2196
  return this.as("seconds");
2177
- }, L.minutes = function() {
2197
+ }, k.minutes = function() {
2178
2198
  return this.get("minutes");
2179
- }, L.asMinutes = function() {
2199
+ }, k.asMinutes = function() {
2180
2200
  return this.as("minutes");
2181
- }, L.hours = function() {
2201
+ }, k.hours = function() {
2182
2202
  return this.get("hours");
2183
- }, L.asHours = function() {
2203
+ }, k.asHours = function() {
2184
2204
  return this.as("hours");
2185
- }, L.days = function() {
2205
+ }, k.days = function() {
2186
2206
  return this.get("days");
2187
- }, L.asDays = function() {
2207
+ }, k.asDays = function() {
2188
2208
  return this.as("days");
2189
- }, L.weeks = function() {
2209
+ }, k.weeks = function() {
2190
2210
  return this.get("weeks");
2191
- }, L.asWeeks = function() {
2211
+ }, k.asWeeks = function() {
2192
2212
  return this.as("weeks");
2193
- }, L.months = function() {
2213
+ }, k.months = function() {
2194
2214
  return this.get("months");
2195
- }, L.asMonths = function() {
2215
+ }, k.asMonths = function() {
2196
2216
  return this.as("months");
2197
- }, L.years = function() {
2217
+ }, k.years = function() {
2198
2218
  return this.get("years");
2199
- }, L.asYears = function() {
2219
+ }, k.asYears = function() {
2200
2220
  return this.as("years");
2201
2221
  }, E;
2202
- }(), k = function(E, L, v) {
2203
- return E.add(L.years() * v, "y").add(L.months() * v, "M").add(L.days() * v, "d").add(L.hours() * v, "h").add(L.minutes() * v, "m").add(L.seconds() * v, "s").add(L.milliseconds() * v, "ms");
2222
+ }(), C = function(E, k, v) {
2223
+ return E.add(k.years() * v, "y").add(k.months() * v, "M").add(k.days() * v, "d").add(k.hours() * v, "h").add(k.minutes() * v, "m").add(k.seconds() * v, "s").add(k.milliseconds() * v, "ms");
2204
2224
  };
2205
- return function(E, L, v) {
2225
+ return function(E, k, v) {
2206
2226
  e = v, i = v().$utils(), v.duration = function(_, D) {
2207
- var H = v.locale();
2208
- return m(_, { $l: H }, D);
2209
- }, v.isDuration = p;
2210
- var M = L.prototype.add, A = L.prototype.subtract;
2211
- L.prototype.add = function(_, D) {
2212
- return p(_) ? k(this, _, 1) : M.bind(this)(_, D);
2213
- }, L.prototype.subtract = function(_, D) {
2214
- return p(_) ? k(this, _, -1) : A.bind(this)(_, D);
2227
+ var I = v.locale();
2228
+ return p(_, { $l: I }, D);
2229
+ }, v.isDuration = m;
2230
+ var M = k.prototype.add, A = k.prototype.subtract;
2231
+ k.prototype.add = function(_, D) {
2232
+ return m(_) ? C(this, _, 1) : M.bind(this)(_, D);
2233
+ }, k.prototype.subtract = function(_, D) {
2234
+ return m(_) ? C(this, _, -1) : A.bind(this)(_, D);
2215
2235
  };
2216
2236
  };
2217
2237
  });
@@ -2269,21 +2289,21 @@ var At = { exports: {} };
2269
2289
  return function(e, i, s) {
2270
2290
  var n = i.prototype, o = function(d) {
2271
2291
  return d && (d.indexOf ? d : d.s);
2272
- }, r = function(d, l, p, m, u) {
2273
- var x = d.name ? d : d.$locale(), w = o(x[l]), T = o(x[p]), b = w || T.map(function(k) {
2274
- return k.slice(0, m);
2292
+ }, r = function(d, l, m, p, u) {
2293
+ var y = d.name ? d : d.$locale(), x = o(y[l]), T = o(y[m]), b = x || T.map(function(C) {
2294
+ return C.slice(0, p);
2275
2295
  });
2276
2296
  if (!u) return b;
2277
- var y = x.weekStart;
2278
- return b.map(function(k, E) {
2279
- return b[(E + (y || 0)) % 7];
2297
+ var w = y.weekStart;
2298
+ return b.map(function(C, E) {
2299
+ return b[(E + (w || 0)) % 7];
2280
2300
  });
2281
2301
  }, h = function() {
2282
2302
  return s.Ls[s.locale()];
2283
2303
  }, c = function(d, l) {
2284
- return d.formats[l] || function(p) {
2285
- return p.replace(/(\[[^\]]+])|(MMMM|MM|DD|dddd)/g, function(m, u, x) {
2286
- return u || x.slice(1);
2304
+ return d.formats[l] || function(m) {
2305
+ return m.replace(/(\[[^\]]+])|(MMMM|MM|DD|dddd)/g, function(p, u, y) {
2306
+ return u || y.slice(1);
2287
2307
  });
2288
2308
  }(d.formats[l.toUpperCase()]);
2289
2309
  }, g = function() {
@@ -2354,8 +2374,8 @@ var Ht = { exports: {} };
2354
2374
  var g = o(this).startOf(i).add(1, i).date(c), d = o(this).endOf(e);
2355
2375
  if (g.isBefore(d)) return 1;
2356
2376
  }
2357
- var l = o(this).startOf(i).date(c).startOf(e).subtract(1, "millisecond"), p = this.diff(l, e, !0);
2358
- return p < 0 ? o(this).startOf("week").week() : Math.ceil(p);
2377
+ var l = o(this).startOf(i).date(c).startOf(e).subtract(1, "millisecond"), m = this.diff(l, e, !0);
2378
+ return m < 0 ? o(this).startOf("week").week() : Math.ceil(m);
2359
2379
  }, r.weeks = function(h) {
2360
2380
  return h === void 0 && (h = null), this.week(h);
2361
2381
  };
@@ -2460,8 +2480,8 @@ var Wt = { exports: {} };
2460
2480
  return o(this).year();
2461
2481
  }, r.isoWeek = function(c) {
2462
2482
  if (!this.$utils().u(c)) return this.add(7 * (c - this.isoWeek()), e);
2463
- var g, d, l, p, m = o(this), u = (g = this.isoWeekYear(), d = this.$u, l = (d ? n.utc : n)().year(g).startOf("year"), p = 4 - l.isoWeekday(), l.isoWeekday() > 4 && (p += 7), l.add(p, e));
2464
- return m.diff(u, "week") + 1;
2483
+ var g, d, l, m, p = o(this), u = (g = this.isoWeekYear(), d = this.$u, l = (d ? n.utc : n)().year(g).startOf("year"), m = 4 - l.isoWeekday(), l.isoWeekday() > 4 && (m += 7), l.add(m, e));
2484
+ return p.diff(u, "week") + 1;
2465
2485
  }, r.isoWeekday = function(c) {
2466
2486
  return this.$utils().u(c) ? this.day() || 7 : this.day(this.day() % 7 ? c : c - 7);
2467
2487
  };
@@ -2482,52 +2502,52 @@ var $t = { exports: {} };
2482
2502
  })(P, function() {
2483
2503
  var e = { year: 0, month: 1, day: 2, hour: 3, minute: 4, second: 5 }, i = {};
2484
2504
  return function(s, n, o) {
2485
- var r, h = function(l, p, m) {
2486
- m === void 0 && (m = {});
2487
- var u = new Date(l), x = function(w, T) {
2505
+ var r, h = function(l, m, p) {
2506
+ p === void 0 && (p = {});
2507
+ var u = new Date(l), y = function(x, T) {
2488
2508
  T === void 0 && (T = {});
2489
- var b = T.timeZoneName || "short", y = w + "|" + b, k = i[y];
2490
- return k || (k = new Intl.DateTimeFormat("en-US", { hour12: !1, timeZone: w, year: "numeric", month: "2-digit", day: "2-digit", hour: "2-digit", minute: "2-digit", second: "2-digit", timeZoneName: b }), i[y] = k), k;
2491
- }(p, m);
2492
- return x.formatToParts(u);
2493
- }, c = function(l, p) {
2494
- for (var m = h(l, p), u = [], x = 0; x < m.length; x += 1) {
2495
- var w = m[x], T = w.type, b = w.value, y = e[T];
2496
- y >= 0 && (u[y] = parseInt(b, 10));
2509
+ var b = T.timeZoneName || "short", w = x + "|" + b, C = i[w];
2510
+ return C || (C = new Intl.DateTimeFormat("en-US", { hour12: !1, timeZone: x, year: "numeric", month: "2-digit", day: "2-digit", hour: "2-digit", minute: "2-digit", second: "2-digit", timeZoneName: b }), i[w] = C), C;
2511
+ }(m, p);
2512
+ return y.formatToParts(u);
2513
+ }, c = function(l, m) {
2514
+ for (var p = h(l, m), u = [], y = 0; y < p.length; y += 1) {
2515
+ var x = p[y], T = x.type, b = x.value, w = e[T];
2516
+ w >= 0 && (u[w] = parseInt(b, 10));
2497
2517
  }
2498
- var k = u[3], E = k === 24 ? 0 : k, L = u[0] + "-" + u[1] + "-" + u[2] + " " + E + ":" + u[4] + ":" + u[5] + ":000", v = +l;
2499
- return (o.utc(L).valueOf() - (v -= v % 1e3)) / 6e4;
2518
+ var C = u[3], E = C === 24 ? 0 : C, k = u[0] + "-" + u[1] + "-" + u[2] + " " + E + ":" + u[4] + ":" + u[5] + ":000", v = +l;
2519
+ return (o.utc(k).valueOf() - (v -= v % 1e3)) / 6e4;
2500
2520
  }, g = n.prototype;
2501
- g.tz = function(l, p) {
2521
+ g.tz = function(l, m) {
2502
2522
  l === void 0 && (l = r);
2503
- var m, u = this.utcOffset(), x = this.toDate(), w = x.toLocaleString("en-US", { timeZone: l }), T = Math.round((x - new Date(w)) / 1e3 / 60), b = 15 * -Math.round(x.getTimezoneOffset() / 15) - T;
2504
- if (!Number(b)) m = this.utcOffset(0, p);
2505
- else if (m = o(w, { locale: this.$L }).$set("millisecond", this.$ms).utcOffset(b, !0), p) {
2506
- var y = m.utcOffset();
2507
- m = m.add(u - y, "minute");
2523
+ var p, u = this.utcOffset(), y = this.toDate(), x = y.toLocaleString("en-US", { timeZone: l }), T = Math.round((y - new Date(x)) / 1e3 / 60), b = 15 * -Math.round(y.getTimezoneOffset() / 15) - T;
2524
+ if (!Number(b)) p = this.utcOffset(0, m);
2525
+ else if (p = o(x, { locale: this.$L }).$set("millisecond", this.$ms).utcOffset(b, !0), m) {
2526
+ var w = p.utcOffset();
2527
+ p = p.add(u - w, "minute");
2508
2528
  }
2509
- return m.$x.$timezone = l, m;
2529
+ return p.$x.$timezone = l, p;
2510
2530
  }, g.offsetName = function(l) {
2511
- var p = this.$x.$timezone || o.tz.guess(), m = h(this.valueOf(), p, { timeZoneName: l }).find(function(u) {
2531
+ var m = this.$x.$timezone || o.tz.guess(), p = h(this.valueOf(), m, { timeZoneName: l }).find(function(u) {
2512
2532
  return u.type.toLowerCase() === "timezonename";
2513
2533
  });
2514
- return m && m.value;
2534
+ return p && p.value;
2515
2535
  };
2516
2536
  var d = g.startOf;
2517
- g.startOf = function(l, p) {
2518
- if (!this.$x || !this.$x.$timezone) return d.call(this, l, p);
2519
- var m = o(this.format("YYYY-MM-DD HH:mm:ss:SSS"), { locale: this.$L });
2520
- return d.call(m, l, p).tz(this.$x.$timezone, !0);
2521
- }, o.tz = function(l, p, m) {
2522
- var u = m && p, x = m || p || r, w = c(+o(), x);
2523
- if (typeof l != "string") return o(l).tz(x);
2524
- var T = function(E, L, v) {
2525
- var M = E - 60 * L * 1e3, A = c(M, v);
2526
- if (L === A) return [M, L];
2527
- var _ = c(M -= 60 * (A - L) * 1e3, v);
2537
+ g.startOf = function(l, m) {
2538
+ if (!this.$x || !this.$x.$timezone) return d.call(this, l, m);
2539
+ var p = o(this.format("YYYY-MM-DD HH:mm:ss:SSS"), { locale: this.$L });
2540
+ return d.call(p, l, m).tz(this.$x.$timezone, !0);
2541
+ }, o.tz = function(l, m, p) {
2542
+ var u = p && m, y = p || m || r, x = c(+o(), y);
2543
+ if (typeof l != "string") return o(l).tz(y);
2544
+ var T = function(E, k, v) {
2545
+ var M = E - 60 * k * 1e3, A = c(M, v);
2546
+ if (k === A) return [M, k];
2547
+ var _ = c(M -= 60 * (A - k) * 1e3, v);
2528
2548
  return A === _ ? [M, A] : [E - 60 * Math.min(A, _) * 1e3, Math.max(A, _)];
2529
- }(o.utc(l, u).valueOf(), w, x), b = T[0], y = T[1], k = o(b).utcOffset(y);
2530
- return k.$x.$timezone = x, k;
2549
+ }(o.utc(l, u).valueOf(), x, y), b = T[0], w = T[1], C = o(b).utcOffset(w);
2550
+ return C.$x.$timezone = y, C;
2531
2551
  }, o.tz.guess = function() {
2532
2552
  return Intl.DateTimeFormat().resolvedOptions().timeZone;
2533
2553
  }, o.tz.setDefault = function(l) {
@@ -2547,11 +2567,11 @@ var Ft = { exports: {} };
2547
2567
  return function(n, o, r) {
2548
2568
  var h = o.prototype;
2549
2569
  r.utc = function(u) {
2550
- var x = { date: u, utc: !0, args: arguments };
2551
- return new o(x);
2570
+ var y = { date: u, utc: !0, args: arguments };
2571
+ return new o(y);
2552
2572
  }, h.utc = function(u) {
2553
- var x = r(this.toDate(), { locale: this.$L, utc: !0 });
2554
- return u ? x.add(this.utcOffset(), e) : x;
2573
+ var y = r(this.toDate(), { locale: this.$L, utc: !0 });
2574
+ return u ? y.add(this.utcOffset(), e) : y;
2555
2575
  }, h.local = function() {
2556
2576
  return r(this.toDate(), { locale: this.$L, utc: !1 });
2557
2577
  };
@@ -2567,28 +2587,28 @@ var Ft = { exports: {} };
2567
2587
  } else g.call(this);
2568
2588
  };
2569
2589
  var d = h.utcOffset;
2570
- h.utcOffset = function(u, x) {
2571
- var w = this.$utils().u;
2572
- if (w(u)) return this.$u ? 0 : w(this.$offset) ? d.call(this) : this.$offset;
2573
- if (typeof u == "string" && (u = function(k) {
2574
- k === void 0 && (k = "");
2575
- var E = k.match(i);
2590
+ h.utcOffset = function(u, y) {
2591
+ var x = this.$utils().u;
2592
+ if (x(u)) return this.$u ? 0 : x(this.$offset) ? d.call(this) : this.$offset;
2593
+ if (typeof u == "string" && (u = function(C) {
2594
+ C === void 0 && (C = "");
2595
+ var E = C.match(i);
2576
2596
  if (!E) return null;
2577
- var L = ("" + E[0]).match(s) || ["-", 0, 0], v = L[0], M = 60 * +L[1] + +L[2];
2597
+ var k = ("" + E[0]).match(s) || ["-", 0, 0], v = k[0], M = 60 * +k[1] + +k[2];
2578
2598
  return M === 0 ? 0 : v === "+" ? M : -M;
2579
2599
  }(u), u === null)) return this;
2580
2600
  var T = Math.abs(u) <= 16 ? 60 * u : u, b = this;
2581
- if (x) return b.$offset = T, b.$u = u === 0, b;
2601
+ if (y) return b.$offset = T, b.$u = u === 0, b;
2582
2602
  if (u !== 0) {
2583
- var y = this.$u ? this.toDate().getTimezoneOffset() : -1 * this.utcOffset();
2584
- (b = this.local().add(T + y, e)).$offset = T, b.$x.$localOffset = y;
2603
+ var w = this.$u ? this.toDate().getTimezoneOffset() : -1 * this.utcOffset();
2604
+ (b = this.local().add(T + w, e)).$offset = T, b.$x.$localOffset = w;
2585
2605
  } else b = this.utc();
2586
2606
  return b;
2587
2607
  };
2588
2608
  var l = h.format;
2589
2609
  h.format = function(u) {
2590
- var x = u || (this.$u ? "YYYY-MM-DDTHH:mm:ss[Z]" : "");
2591
- return l.call(this, x);
2610
+ var y = u || (this.$u ? "YYYY-MM-DDTHH:mm:ss[Z]" : "");
2611
+ return l.call(this, y);
2592
2612
  }, h.valueOf = function() {
2593
2613
  var u = this.$utils().u(this.$offset) ? 0 : this.$offset + (this.$x.$localOffset || this.$d.getTimezoneOffset());
2594
2614
  return this.$d.valueOf() - 6e4 * u;
@@ -2599,15 +2619,15 @@ var Ft = { exports: {} };
2599
2619
  }, h.toString = function() {
2600
2620
  return this.toDate().toUTCString();
2601
2621
  };
2602
- var p = h.toDate;
2622
+ var m = h.toDate;
2603
2623
  h.toDate = function(u) {
2604
- return u === "s" && this.$offset ? r(this.format("YYYY-MM-DD HH:mm:ss:SSS")).toDate() : p.call(this);
2624
+ return u === "s" && this.$offset ? r(this.format("YYYY-MM-DD HH:mm:ss:SSS")).toDate() : m.call(this);
2605
2625
  };
2606
- var m = h.diff;
2607
- h.diff = function(u, x, w) {
2608
- if (u && this.$u === u.$u) return m.call(this, u, x, w);
2626
+ var p = h.diff;
2627
+ h.diff = function(u, y, x) {
2628
+ if (u && this.$u === u.$u) return p.call(this, u, y, x);
2609
2629
  var T = this.local(), b = r(u).local();
2610
- return m.call(T, b, x, w);
2630
+ return p.call(T, b, y, x);
2611
2631
  };
2612
2632
  };
2613
2633
  });
@@ -2628,7 +2648,7 @@ var Le = { exports: {} };
2628
2648
  var Ee = { exports: {} };
2629
2649
  (function(f, t) {
2630
2650
  (function(e, i) {
2631
- f.exports = i(I);
2651
+ f.exports = i(G);
2632
2652
  })(P, function(e) {
2633
2653
  function i(o) {
2634
2654
  return o && typeof o == "object" && "default" in o ? o : { default: o };
@@ -2645,33 +2665,33 @@ var Ee = { exports: {} };
2645
2665
  const Me = (f, t) => {
2646
2666
  const e = t.prototype;
2647
2667
  e.setLocale = function(s) {
2648
- return this.$locale = s || I().locale(), this.$L = this.$locale, this;
2668
+ return this.$locale = s || G().locale(), this.$L = this.$locale, this;
2649
2669
  };
2650
2670
  const i = e.format;
2651
2671
  e.format = function(s) {
2652
- return this.$L = I().locale(), i.bind(this)(s);
2672
+ return this.$L = G().locale(), i.bind(this)(s);
2653
2673
  };
2654
2674
  };
2655
- I.extend(se);
2656
- I.extend(oe);
2657
- I.extend(ae);
2658
- I.extend(le);
2659
- I.extend(ge);
2660
- I.extend(de);
2661
- I.extend(pe);
2662
- I.extend(xe);
2663
- I.extend(we);
2664
- I.extend(Te);
2665
- I.extend(Se);
2666
- I.extend(Ce);
2667
- I.extend(Me);
2675
+ G.extend(se);
2676
+ G.extend(oe);
2677
+ G.extend(ae);
2678
+ G.extend(le);
2679
+ G.extend(ge);
2680
+ G.extend(de);
2681
+ G.extend(pe);
2682
+ G.extend(xe);
2683
+ G.extend(we);
2684
+ G.extend(Te);
2685
+ G.extend(Se);
2686
+ G.extend(Ce);
2687
+ G.extend(Me);
2668
2688
  function vt(f) {
2669
2689
  try {
2670
- if (I.locale() === f) return;
2671
- if (I.locale(f) !== f) throw Error();
2690
+ if (G.locale() === f) return;
2691
+ if (G.locale(f) !== f) throw Error();
2672
2692
  O.info(`Locale set to ${f}`);
2673
2693
  } catch {
2674
- O.warn(`Failed to set locale ${f}, fallback to en`), I.locale("en");
2694
+ O.warn(`Failed to set locale ${f}, fallback to en`), G.locale("en");
2675
2695
  }
2676
2696
  }
2677
2697
  const ut = () => ({
@@ -2699,10 +2719,10 @@ const ut = () => ({
2699
2719
  });
2700
2720
  class Oe {
2701
2721
  constructor() {
2702
- a(this, "startTime", I().startOf("day"));
2703
- a(this, "endTime", I().endOf("day"));
2722
+ a(this, "startTime", G().startOf("day"));
2723
+ a(this, "endTime", G().endOf("day"));
2704
2724
  /** 结束的标准时间。切换单位会影响结尾的扩展,需要单独记录一个标准时间 */
2705
- a(this, "targetEnd", I().endOf("day"));
2725
+ a(this, "targetEnd", G().endOf("day"));
2706
2726
  /** 固定起始日期 */
2707
2727
  a(this, "strictStart", !1);
2708
2728
  /** 固定截止日期 */
@@ -2723,7 +2743,7 @@ class Oe {
2723
2743
  a(this, "cellWidth");
2724
2744
  /** 用户设定的单位 */
2725
2745
  a(this, "unit", "day");
2726
- this.cellWidth = J(ut().normal);
2746
+ this.cellWidth = Z(ut().normal);
2727
2747
  }
2728
2748
  getStartTime() {
2729
2749
  return this.startTime;
@@ -2781,13 +2801,13 @@ class Oe {
2781
2801
  month: "month",
2782
2802
  quarter: "quarter"
2783
2803
  }[i];
2784
- n || O.warn(`Unknown unit: [${i}]. Falling back to "day".`), this.unit = n || "day", s.startTime && (this.startTime = I(s.startTime).startOf(this.getFinelyUnit()), this.strictStart = !0), s.endTime && (this.endTime = I(s.endTime).endOf(this.getFinelyUnit()), this.strictEnd = !0), s.cellWidth && (Ut(s.cellWidth) ? this.cellWidth = {
2804
+ n || O.warn(`Unknown unit: [${i}]. Falling back to "day".`), this.unit = n || "day", s.startTime && (this.startTime = G(s.startTime).startOf(this.getFinelyUnit()), this.strictStart = !0), s.endTime && (this.endTime = G(s.endTime).endOf(this.getFinelyUnit()), this.strictEnd = !0), s.cellWidth && (Ut(s.cellWidth) ? this.cellWidth = {
2785
2805
  hour: s.cellWidth,
2786
2806
  day: s.cellWidth,
2787
2807
  week: s.cellWidth,
2788
2808
  month: s.cellWidth,
2789
2809
  quarter: s.cellWidth
2790
- } : V(s.cellWidth) ? this.cellWidth = J(
2810
+ } : V(s.cellWidth) ? this.cellWidth = Z(
2791
2811
  ut()[s.cellWidth] || ut().normal
2792
2812
  ) : Ct(s.cellWidth) && (this.cellWidth = Object.assign(this.cellWidth, s.cellWidth))), this.headerCellFormat = s.headerCellFormat, this.headerGroupFormat = s.headerGroupFormat;
2793
2813
  }
@@ -2958,7 +2978,7 @@ class De {
2958
2978
  const i = yt(t, ["data"]), s = t == null ? void 0 : t.data;
2959
2979
  this.optionManager.setOptions(i, e), ((n = i.milestone) == null ? void 0 : n.show) !== void 0 && this.dataManager.getVisibleTasks().forEach((c) => {
2960
2980
  c.updateMode();
2961
- }), X(s) && this.dataManager.setData(s, !1), X((o = t.baselines) == null ? void 0 : o.data) && this.dataManager.setBaselines(t.baselines.data), X((r = t.links) == null ? void 0 : r.data) && this.linkManager.setLinks(t.links.data), this.linkManager.setCycleDetection(((h = t.links) == null ? void 0 : h.enableCycleDetection) ?? !0), i.locale && vt(i.locale), i.table && i.table.columns && this.columnManager.update(i.table.columns), this.timeAxis.update(this.optionManager.getOptions());
2981
+ }), X(s) && this.dataManager.setData(s, !1), X((o = t.baselines) == null ? void 0 : o.data) && this.dataManager.setBaselines(t.baselines.data), X((r = t.links) == null ? void 0 : r.data) && this.linkManager.setLinks(t.links.data, !0), this.linkManager.setCycleDetection(((h = t.links) == null ? void 0 : h.enableCycleDetection) ?? !0), i.locale && vt(i.locale), i.table && i.table.columns && this.columnManager.update(i.table.columns), this.timeAxis.update(this.optionManager.getOptions());
2962
2982
  }
2963
2983
  updateTime(t, e) {
2964
2984
  this.timeAxis.setDate(t, e);
@@ -3171,7 +3191,7 @@ class _e {
3171
3191
  }
3172
3192
  // --- 事件处理 ---
3173
3193
  emit(t, e, i) {
3174
- this.scrollLeft = $(e, 0, this.contentWidth - this.viewportWidth), this.scrollTop = $(i, 0, this.contentHeight - this.viewportHeight), this.updateThumbStyles(), this.root.event.emit(C.SCROLL, {
3194
+ this.scrollLeft = $(e, 0, this.contentWidth - this.viewportWidth), this.scrollTop = $(i, 0, this.contentHeight - this.viewportHeight), this.updateThumbStyles(), this.root.event.emit(L.SCROLL, {
3175
3195
  x: this.scrollLeft,
3176
3196
  y: this.scrollTop,
3177
3197
  source: t
@@ -3225,8 +3245,8 @@ class _e {
3225
3245
  this.isAnimating = !0, this.animationStartTime = performance.now(), this.animationStartScrollLeft = this.scrollLeft, this.animationStartScrollTop = this.scrollTop, this.animationTargetScrollLeft = i.x, this.animationTargetScrollTop = i.y, this.animationSource = "wheel";
3226
3246
  const s = 150, n = (o) => {
3227
3247
  if (!this.isAnimating) return;
3228
- const r = o - this.animationStartTime, h = Math.min(1, r / s), c = h * (2 - h), g = this.animationStartScrollLeft + (this.animationTargetScrollLeft - this.animationStartScrollLeft) * c, d = this.animationStartScrollTop + (this.animationTargetScrollTop - this.animationStartScrollTop) * c, l = this.scrollLeft !== g, p = this.scrollTop !== d;
3229
- (l || p) && this.emit("wheel", g, d), h < 1 ? this.animationFrameId = requestAnimationFrame(n) : (this.isAnimating = !1, this.animationFrameId = null, (this.scrollLeft !== this.animationTargetScrollLeft || this.scrollTop !== this.animationTargetScrollTop) && this.emit("wheel", this.animationTargetScrollLeft, this.animationTargetScrollTop), this.scheduleHide());
3248
+ const r = o - this.animationStartTime, h = Math.min(1, r / s), c = h * (2 - h), g = this.animationStartScrollLeft + (this.animationTargetScrollLeft - this.animationStartScrollLeft) * c, d = this.animationStartScrollTop + (this.animationTargetScrollTop - this.animationStartScrollTop) * c, l = this.scrollLeft !== g, m = this.scrollTop !== d;
3249
+ (l || m) && this.emit("wheel", g, d), h < 1 ? this.animationFrameId = requestAnimationFrame(n) : (this.isAnimating = !1, this.animationFrameId = null, (this.scrollLeft !== this.animationTargetScrollLeft || this.scrollTop !== this.animationTargetScrollTop) && this.emit("wheel", this.animationTargetScrollLeft, this.animationTargetScrollTop), this.scheduleHide());
3230
3250
  };
3231
3251
  this.animationFrameId = requestAnimationFrame(n);
3232
3252
  }
@@ -3373,7 +3393,7 @@ class _e {
3373
3393
  this.unbindEvents(), this.clearTimeouts(), this.cancelAnimation(), this.scrollbarContainer.parentNode && this.scrollbarContainer.parentNode.removeChild(this.scrollbarContainer), this.rootElement = null, this.eventManager = null, this.hScrollbar = null, this.vScrollbar = null, this.hScrollThumb = null, this.vScrollThumb = null, this.scrollbarContainer = null, O.debug("Scrollbar destroyed");
3374
3394
  }
3375
3395
  }
3376
- function Q(f, t = "") {
3396
+ function J(f, t = "") {
3377
3397
  const e = ["px", "%", "vh", "vw", "rem", "em"];
3378
3398
  if (f == null)
3379
3399
  return t;
@@ -3424,7 +3444,7 @@ class st {
3424
3444
  }
3425
3445
  setContent() {
3426
3446
  const t = document.createElement("div");
3427
- if (t.className = "x-gantt-table-cell__content", t.style.overflow = "hidden", (this.column.column.ellipsis ?? this.context.getOptions().table.ellipsis ?? !0) && (t.style.textOverflow = "ellipsis"), t.style.whiteSpace = "nowrap", t.style.flex = "1", t.style.height = "100%", t.style.alignContent = "center", this.colIndex === 0 && (t.style.paddingLeft = Q(
3447
+ if (t.className = "x-gantt-table-cell__content", t.style.overflow = "hidden", (this.column.column.ellipsis ?? this.context.getOptions().table.ellipsis ?? !0) && (t.style.textOverflow = "ellipsis"), t.style.whiteSpace = "nowrap", t.style.flex = "1", t.style.height = "100%", t.style.alignContent = "center", this.colIndex === 0 && (t.style.paddingLeft = J(
3428
3448
  this.task.level * this.context.getOptions().row.indent,
3429
3449
  "16px"
3430
3450
  )), typeof this.column.column.render == "function")
@@ -3466,20 +3486,20 @@ class st {
3466
3486
  */
3467
3487
  updateWidth() {
3468
3488
  if (this.isHandler) {
3469
- this.element.style.width = Q(
3489
+ this.element.style.width = J(
3470
3490
  this.context.store.getColumnManager().getHandlerColumn().width
3471
3491
  );
3472
3492
  return;
3473
3493
  }
3474
3494
  const t = this.context.store.getColumnManager().getLeafColumns().slice(this.colIndex, this.colIndex + Math.max(1, this.colspan)).reduce((e, i) => e + i.width, 0);
3475
- this.element.style.width = Q(t);
3495
+ this.element.style.width = J(t);
3476
3496
  }
3477
3497
  /**
3478
3498
  * 更新高度
3479
3499
  */
3480
3500
  updateHeight() {
3481
3501
  const t = this.context.getOptions().row.height;
3482
- this.element.style.height = Q(t * Math.max(1, this.rowspan));
3502
+ this.element.style.height = J(t * Math.max(1, this.rowspan));
3483
3503
  }
3484
3504
  }
3485
3505
  class St {
@@ -3501,28 +3521,28 @@ class St {
3501
3521
  */
3502
3522
  bindEvents() {
3503
3523
  this.element.addEventListener("mouseenter", () => {
3504
- this.context.event.emit(C.ROW_HIGHLIGHT, this.task.id);
3524
+ this.context.event.emit(L.ROW_HIGHLIGHT, this.task.id);
3505
3525
  }), this.element.addEventListener("mouseleave", () => {
3506
- this.context.event.emit(C.ROW_UNHIGHLIGHT, this.task.id);
3526
+ this.context.event.emit(L.ROW_UNHIGHLIGHT, this.task.id);
3507
3527
  }), this.element.addEventListener("click", (t) => {
3508
- this.context.store.getDataManager().isTaskSelected(this.task.id) || (this.context.store.getDataManager().selectTask(this.task.id), this.context.event.emit(C.ROW_CLICK, t, this.task));
3528
+ this.context.store.getDataManager().isTaskSelected(this.task.id) || (this.context.store.getDataManager().selectTask(this.task.id), this.context.event.emit(L.ROW_CLICK, t, this.task));
3509
3529
  }), this.element.addEventListener("dblclick", (t) => {
3510
- this.context.event.emit(C.ROW_DBL_CLICK, t, this.task);
3530
+ this.context.event.emit(L.ROW_DBL_CLICK, t, this.task);
3511
3531
  }), this.element.addEventListener("contextmenu", (t) => {
3512
- t.preventDefault(), this.context.store.getDataManager().selectTask(this.task.id), this.context.event.emit(C.ROW_CONTEXTMENU, t, this.task.id);
3532
+ t.preventDefault(), this.context.store.getDataManager().selectTask(this.task.id), this.context.event.emit(L.ROW_CONTEXTMENU, t, this.task);
3513
3533
  });
3514
3534
  }
3515
3535
  /**
3516
3536
  * 注册全局接收事件
3517
3537
  */
3518
3538
  registerEvents() {
3519
- this.context.event.on(C.ROW_HIGHLIGHT, (t) => {
3539
+ this.context.event.on(L.ROW_HIGHLIGHT, (t) => {
3520
3540
  this.task.id === t ? this.element.classList.add("hover") : this.element.classList.remove("hover");
3521
- }), this.context.event.on(C.ROW_UNHIGHLIGHT, (t) => {
3541
+ }), this.context.event.on(L.ROW_UNHIGHLIGHT, (t) => {
3522
3542
  this.task.id === t && this.element.classList.remove("hover");
3523
- }), this.context.event.on(C.TASK_SELECTED, (t) => {
3543
+ }), this.context.event.on(L.TASK_SELECTED, (t) => {
3524
3544
  this.task.id === t.id && this.element.classList.add("selected");
3525
- }), this.context.event.on(C.TASK_UNSELECTED, (t) => {
3545
+ }), this.context.event.on(L.TASK_UNSELECTED, (t) => {
3526
3546
  this.task.id === t && this.element.classList.remove("selected");
3527
3547
  });
3528
3548
  }
@@ -3608,10 +3628,10 @@ class St {
3608
3628
  );
3609
3629
  if (g && (typeof g.col != "number" ? O.error("colspan function must returned a number") : h = g.col, typeof g.row != "number" ? O.error("rowspan function must returned a number") : c = g.row), h > 1 || c > 1) {
3610
3630
  if (c > 1)
3611
- for (let m = 1; m < c; m++) {
3612
- const u = this.context.store.getDataManager().getVisibleTasks()[this.task.flatIndex + m];
3631
+ for (let p = 1; p < c; p++) {
3632
+ const u = this.context.store.getDataManager().getVisibleTasks()[this.task.flatIndex + p];
3613
3633
  if (u && this.task.level !== u.level) {
3614
- c = m;
3634
+ c = p;
3615
3635
  break;
3616
3636
  }
3617
3637
  }
@@ -3621,15 +3641,15 @@ class St {
3621
3641
  colspan: h,
3622
3642
  rowspan: c
3623
3643
  };
3624
- let p = this.task;
3625
- for (let m = c; m > 0; m--)
3626
- if (p) {
3644
+ let m = this.task;
3645
+ for (let p = c; p > 0; p--)
3646
+ if (m) {
3627
3647
  for (let u = 0; u < h; u++)
3628
- this.context.store.getColumnManager().addMergeInfo(p.id, u + n, l);
3629
- p = this.context.store.getDataManager().getVisibleTasks().at(p.flatIndex + 1);
3648
+ this.context.store.getColumnManager().addMergeInfo(m.id, u + n, l);
3649
+ m = this.context.store.getDataManager().getVisibleTasks().at(m.flatIndex + 1);
3630
3650
  }
3631
- for (let m = 0; m < h; m++)
3632
- this.context.store.getColumnManager().addMergeInfo(this.task.id, m + n, l);
3651
+ for (let p = 0; p < h; p++)
3652
+ this.context.store.getColumnManager().addMergeInfo(this.task.id, p + n, l);
3633
3653
  }
3634
3654
  const d = new st(
3635
3655
  this.context,
@@ -3762,7 +3782,7 @@ class pt {
3762
3782
  "important"
3763
3783
  );
3764
3784
  const n = document.createElement("div");
3765
- if (n.className = "x-gantt-table-header-cell__content", n.style.flex = "1", n.style.textAlign = i, n.style.overflow = "hidden", n.style.whiteSpace = "nowrap", s && (n.style.textOverflow = "ellipsis"), n.style.position = "relative", n.style.fontWeight = `${this.context.getOptions().header.fontWeight}`, n.style.fontSize = Q(
3785
+ if (n.className = "x-gantt-table-header-cell__content", n.style.flex = "1", n.style.textAlign = i, n.style.overflow = "hidden", n.style.whiteSpace = "nowrap", s && (n.style.textOverflow = "ellipsis"), n.style.position = "relative", n.style.fontWeight = `${this.context.getOptions().header.fontWeight}`, n.style.fontSize = J(
3766
3786
  this.context.getOptions().header.fontSize
3767
3787
  ), n.style.setProperty(
3768
3788
  "color",
@@ -3793,16 +3813,16 @@ class pt {
3793
3813
  const o = (c) => {
3794
3814
  c.preventDefault(), c.stopPropagation(), e = c.clientX, i = this.columnElement.offsetWidth, s = this.root.getBoundingClientRect();
3795
3815
  const g = (l) => r(l), d = (l) => h(l, g, d);
3796
- document.addEventListener("mousemove", g), document.addEventListener("mouseup", d), n = e - s.left, this.context.event.emit(C.SHOW_GUIDELINE, n);
3816
+ document.addEventListener("mousemove", g), document.addEventListener("mouseup", d), n = e - s.left, this.context.event.emit(L.SHOW_GUIDELINE, n);
3797
3817
  }, r = (c) => {
3798
3818
  if (c.preventDefault(), !s) return;
3799
- const g = c.clientX - e, d = i + g, l = Math.max(50, d), p = e - s.left - i, u = this.root.clientWidth - 20;
3800
- let x = p + l;
3801
- x = Math.min(u, x), this.context.event.emit(C.MOVE_GUIDELINE, x);
3819
+ const g = c.clientX - e, d = i + g, l = Math.max(50, d), m = e - s.left - i, u = this.root.clientWidth - 20;
3820
+ let y = m + l;
3821
+ y = Math.min(u, y), this.context.event.emit(L.MOVE_GUIDELINE, y);
3802
3822
  }, h = (c, g, d) => {
3803
- document.removeEventListener("mousemove", g), document.removeEventListener("mouseup", d), this.context.event.emit(C.HIDE_GUIDELINE);
3804
- const l = c.clientX - e, p = Math.max(50, i + l);
3805
- this.setWidth(p);
3823
+ document.removeEventListener("mousemove", g), document.removeEventListener("mouseup", d), this.context.event.emit(L.HIDE_GUIDELINE);
3824
+ const l = c.clientX - e, m = Math.max(50, i + l);
3825
+ this.setWidth(m);
3806
3826
  };
3807
3827
  t.addEventListener("mousedown", o);
3808
3828
  }
@@ -3821,7 +3841,7 @@ class xt {
3821
3841
  "border-color",
3822
3842
  this.context.getOptions().border.color,
3823
3843
  "important"
3824
- ), this.titleContainer.style.fontWeight = `${this.context.getOptions().header.fontWeight}`, this.titleContainer.style.fontSize = Q(
3844
+ ), this.titleContainer.style.fontWeight = `${this.context.getOptions().header.fontWeight}`, this.titleContainer.style.fontSize = J(
3825
3845
  this.context.getOptions().header.fontSize
3826
3846
  ), this.titleContainer.style.fontFamily = this.context.getOptions().header.fontFamily, this.titleContainer.style.setProperty(
3827
3847
  "color",
@@ -3931,9 +3951,9 @@ class Ie {
3931
3951
  this.tableBody.updateTask(t);
3932
3952
  }
3933
3953
  listenEvents() {
3934
- this.context.event.on(C.UPDATE_TABLE_HEADER, () => {
3954
+ this.context.event.on(L.UPDATE_TABLE_HEADER, () => {
3935
3955
  this.tableHeader.render();
3936
- }), this.context.event.on(C.UPDATE_TABLE_BODY, () => {
3956
+ }), this.context.event.on(L.UPDATE_TABLE_BODY, () => {
3937
3957
  this.tableBody.update();
3938
3958
  });
3939
3959
  }
@@ -3973,11 +3993,11 @@ class Ge {
3973
3993
  * 注册事件监听
3974
3994
  */
3975
3995
  registerEvents() {
3976
- this.context.event.on(C.ROW_HIGHLIGHT, (t) => {
3996
+ this.context.event.on(L.ROW_HIGHLIGHT, (t) => {
3977
3997
  this.highlightDate(t);
3978
- }), this.context.event.on(C.ROW_UNHIGHLIGHT, (t) => {
3998
+ }), this.context.event.on(L.ROW_UNHIGHLIGHT, (t) => {
3979
3999
  this.unhighlightDate(t);
3980
- }), this.context.event.on(C.UPDATE_TASK, (t) => {
4000
+ }), this.context.event.on(L.UPDATE_TASK, (t) => {
3981
4001
  this.highlightDate(t.id);
3982
4002
  });
3983
4003
  }
@@ -4017,7 +4037,7 @@ class Ge {
4017
4037
  }
4018
4038
  if (h > s)
4019
4039
  break;
4020
- const m = this.createCell(
4040
+ const p = this.createCell(
4021
4041
  `group-${d.date.format("YYYY-MM-DD")}`,
4022
4042
  h,
4023
4043
  0,
@@ -4026,16 +4046,16 @@ class Ge {
4026
4046
  o,
4027
4047
  d.label
4028
4048
  );
4029
- if (this.groupHeader.add(m), X(d.children) && d.children.length > 0) {
4049
+ if (this.groupHeader.add(p), X(d.children) && d.children.length > 0) {
4030
4050
  let u = h;
4031
- for (let x = 0; x < d.children.length; ) {
4032
- const w = d.children[x];
4051
+ for (let y = 0; y < d.children.length; ) {
4052
+ const x = d.children[y];
4033
4053
  let T = 1;
4034
- for (; d.children[x + T] && w.label === d.children[x + T].label; )
4054
+ for (; d.children[y + T] && x.label === d.children[y + T].label; )
4035
4055
  T++;
4036
- if (x += T, x >= d.children.length && r[g + 1] && r[g + 1].children) {
4056
+ if (y += T, y >= d.children.length && r[g + 1] && r[g + 1].children) {
4037
4057
  let E = 0;
4038
- for (; r[g + 1].children[E] && w.label === r[g + 1].children[E].label; )
4058
+ for (; r[g + 1].children[E] && x.label === r[g + 1].children[E].label; )
4039
4059
  r[g + 1].children[E].hide = !0, E++;
4040
4060
  E > 0 && (T += E);
4041
4061
  }
@@ -4046,16 +4066,16 @@ class Ge {
4046
4066
  }
4047
4067
  if (u > s)
4048
4068
  break;
4049
- const k = this.createCell(
4050
- `cell-${w.date.format("YYYY-MM-DD")}`,
4069
+ const C = this.createCell(
4070
+ `cell-${x.date.format("YYYY-MM-DD")}`,
4051
4071
  u,
4052
4072
  n,
4053
4073
  b,
4054
4074
  n,
4055
- w.hide ? "transparent" : o,
4056
- w.hide ? "" : w.label
4075
+ x.hide ? "transparent" : o,
4076
+ x.hide ? "" : x.label
4057
4077
  );
4058
- this.cellHeader.add(k), w.hide && k.visible(!1), u += b;
4078
+ this.cellHeader.add(C), x.hide && C.visible(!1), u += b;
4059
4079
  }
4060
4080
  }
4061
4081
  h += l;
@@ -4210,22 +4230,22 @@ class Re {
4210
4230
  );
4211
4231
  if (this.context.getOptions().border.show && ["day", "hour"].includes(this.context.getOptions().unit))
4212
4232
  for (let d = r; d <= h; d++) {
4213
- const l = d * i, p = new S.Line({
4233
+ const l = d * i, m = new S.Line({
4214
4234
  points: [l, t, l, o + t],
4215
4235
  stroke: this.context.getOptions().border.color,
4216
4236
  strokeWidth: 0.5,
4217
4237
  name: "vertical-grid-line"
4218
4238
  });
4219
- this.verticalLines.add(p);
4239
+ this.verticalLines.add(m);
4220
4240
  }
4221
4241
  for (let d = c; d <= g; d++) {
4222
- const l = d * s + t, p = new S.Line({
4242
+ const l = d * s + t, m = new S.Line({
4223
4243
  points: [0, l, Math.max(this.width, e), l],
4224
4244
  stroke: this.context.getOptions().border.color,
4225
4245
  strokeWidth: 0.5,
4226
4246
  name: "horizontal-grid-line"
4227
4247
  });
4228
- this.horizontalLines.add(p);
4248
+ this.horizontalLines.add(m);
4229
4249
  }
4230
4250
  }
4231
4251
  /**
@@ -4283,12 +4303,12 @@ class We {
4283
4303
  return this.context.store.getOptionManager().unpackFunc(t, this.task);
4284
4304
  }
4285
4305
  registerEvents() {
4286
- this.context.event.on(C.SLIDER_BLINK, (t) => {
4306
+ this.context.event.on(L.SLIDER_BLINK, (t) => {
4287
4307
  t === this.task.id && this.handleBarBlink();
4288
4308
  });
4289
4309
  }
4290
4310
  render() {
4291
- var m, u, x, w, T, b, y, k, E, L, v, M, A;
4311
+ var p, u, y, x, T, b, w, C, E, k, v, M, A;
4292
4312
  if (!this.task.startTime || !this.task.endTime) return;
4293
4313
  if (this.task.endTime.isBefore(this.task.startTime)) {
4294
4314
  O.error("The endTime of the current task is earlier than the startTime.", this.task);
@@ -4303,8 +4323,8 @@ class We {
4303
4323
  this.slider || (this.slider = new S.Group({
4304
4324
  dragBoundFunc: (_) => {
4305
4325
  let D = Math.min(0, -(-this.offsetX - this.slider.x()));
4306
- const H = this.context.store.getTimeAxis().getTimeLeft(this.task.endTime);
4307
- let W = this.rowWidth - this.slider.width() + Math.abs(H - (-this.offsetX + this.rowWidth));
4326
+ const I = this.context.store.getTimeAxis().getTimeLeft(this.task.endTime);
4327
+ let W = this.sliderGroup.getStage().width() - this.slider.width() + Math.abs(I - (-this.offsetX + this.sliderGroup.getStage().width()));
4308
4328
  if (this.context.getOptions().bar.move.link.parent === "strict" && this.task.parent) {
4309
4329
  if (this.task.parent.startTime) {
4310
4330
  const R = this.task.parent.startTime;
@@ -4321,24 +4341,24 @@ class We {
4321
4341
  };
4322
4342
  }
4323
4343
  })), this.slider.position({ x: s, y: i }), this.slider.size({ width: o, height: e });
4324
- const p = !!this.unpackFunc(this.context.getOptions().bar.move.enabled) && (this.task.isSummary() ? this.context.getOptions().summary.move.enabled : !0);
4325
- if (this.slider.draggable(p), this.slider.on("mouseover", (_) => {
4326
- p && !this.isDragging && (_.target.getStage().container().style.cursor = "grab"), this.handleBarHighlight({
4344
+ const m = !!this.unpackFunc(this.context.getOptions().bar.move.enabled) && (this.task.isSummary() ? this.context.getOptions().summary.move.enabled : !0);
4345
+ if (this.slider.draggable(m), this.slider.on("mouseover", (_) => {
4346
+ m && !this.isDragging && (_.target.getStage().container().style.cursor = "grab"), this.handleBarHighlight({
4327
4347
  shadowColor: B(c).alpha(B(c).alpha() + 0.1).toHex(),
4328
4348
  shadowBlur: Math.max((g || 1) * 2, 4),
4329
4349
  shadowOffsetX: Math.max(d || 1, 2),
4330
4350
  shadowOffsetY: Math.max((l || 1) * 1.5, 4)
4331
- }), this.context.event.emit(C.SLIDER_HOVER, _.evt, this.task);
4351
+ }), this.context.event.emit(L.SLIDER_HOVER, _.evt, this.task);
4332
4352
  }), this.slider.on("mouseout", (_) => {
4333
- p && !this.isDragging && (_.target.getStage().container().style.cursor = "default"), this.isDragging || this.handleBarHighlight({
4353
+ m && !this.isDragging && (_.target.getStage().container().style.cursor = "default"), this.isDragging || this.handleBarHighlight({
4334
4354
  shadowColor: c,
4335
4355
  shadowBlur: g,
4336
4356
  shadowOffsetX: d,
4337
4357
  shadowOffsetY: l
4338
- }), this.context.event.emit(C.SLIDER_LEAVE, _.evt, this.task);
4358
+ }), this.context.event.emit(L.SLIDER_LEAVE, _.evt, this.task);
4339
4359
  }), this.task.isMilestone()) {
4340
4360
  this.sliderBar && !this.sliderType.startsWith("milestone") && (this.slider.destroyChildren(), this.sliderBar = null, this.progressGroup = null, this.leftHandleGroup = null, this.rightHandleGroup = null);
4341
- const _ = this.unpackFunc(this.context.getOptions().milestone.size), D = Math.min(_ || e, t / 2), H = this.unpackFunc(this.context.getOptions().milestone.color) || r, W = this.unpackFunc(this.context.getOptions().milestone.border.color), G = this.unpackFunc(this.context.getOptions().milestone.border.width), R = this.unpackFunc(this.context.getOptions().milestone.shape);
4361
+ const _ = this.unpackFunc(this.context.getOptions().milestone.size), D = Math.min(_ || e, t / 2), I = this.unpackFunc(this.context.getOptions().milestone.color) || r, W = this.unpackFunc(this.context.getOptions().milestone.border.color), H = this.unpackFunc(this.context.getOptions().milestone.border.width), R = this.unpackFunc(this.context.getOptions().milestone.shape);
4342
4362
  if (!this.sliderBar) {
4343
4363
  switch (R) {
4344
4364
  case "triangle":
@@ -4346,9 +4366,9 @@ class We {
4346
4366
  sides: 3,
4347
4367
  radius: D,
4348
4368
  rotation: 0,
4349
- fill: H,
4369
+ fill: I,
4350
4370
  stroke: W,
4351
- strokeWidth: G,
4371
+ strokeWidth: H,
4352
4372
  y: D / 3 * 2
4353
4373
  // 居中
4354
4374
  });
@@ -4356,9 +4376,9 @@ class We {
4356
4376
  case "circle":
4357
4377
  this.sliderBar = new S.Circle({
4358
4378
  radius: D,
4359
- fill: H,
4379
+ fill: I,
4360
4380
  stroke: W,
4361
- strokeWidth: G,
4381
+ strokeWidth: H,
4362
4382
  y: D / 2
4363
4383
  // 居中
4364
4384
  });
@@ -4368,9 +4388,9 @@ class We {
4368
4388
  numPoints: 5,
4369
4389
  innerRadius: D / 2,
4370
4390
  outerRadius: D,
4371
- fill: H,
4391
+ fill: I,
4372
4392
  stroke: W,
4373
- strokeWidth: G,
4393
+ strokeWidth: H,
4374
4394
  y: D / 2
4375
4395
  // 居中
4376
4396
  });
@@ -4381,9 +4401,9 @@ class We {
4381
4401
  sides: 4,
4382
4402
  radius: D,
4383
4403
  rotation: 0,
4384
- fill: H,
4404
+ fill: I,
4385
4405
  stroke: W,
4386
- strokeWidth: G,
4406
+ strokeWidth: H,
4387
4407
  y: D / 2
4388
4408
  // 居中
4389
4409
  });
@@ -4392,7 +4412,7 @@ class We {
4392
4412
  const F = this.unpackFunc(this.context.getOptions().milestone.label.text), z = this.unpackFunc(this.context.getOptions().milestone.label.position), q = this.unpackFunc(this.context.getOptions().milestone.label.fontSize), zt = this.unpackFunc(this.context.getOptions().milestone.label.fontFamily), Nt = this.unpackFunc(this.context.getOptions().milestone.label.color), it = new S.Text({
4393
4413
  height: e,
4394
4414
  text: F,
4395
- fill: Nt || H,
4415
+ fill: Nt || I,
4396
4416
  fontSize: q,
4397
4417
  fontFamily: zt
4398
4418
  }), at = it.measureSize(F);
@@ -4419,18 +4439,18 @@ class We {
4419
4439
  this.sliderType = "milestone";
4420
4440
  } else if (this.task.isSummary() && (this.context.getOptions().summary.mode === "always" || this.task.expanded)) {
4421
4441
  this.sliderBar && this.sliderType !== "summary" && (this.slider.destroyChildren(), this.sliderBar = null, this.progressGroup = null, this.leftHandleGroup = null, this.rightHandleGroup = null);
4422
- const _ = this.unpackFunc(this.context.getOptions().summary.color) || r, D = t * 0.2, H = t * 0.3, W = (G) => new S.Shape({
4442
+ const _ = this.unpackFunc(this.context.getOptions().summary.color) || r, D = t * 0.2, I = t * 0.3, W = (H) => new S.Shape({
4423
4443
  sceneFunc: (R, F) => {
4424
- const z = H * 0.5;
4425
- R.beginPath(), R.moveTo(0, (t - D) / 2), R.lineTo(z, (t - D) / 2), R.lineTo(z, (t - D) / 2 + D), R.lineTo(0, (t - D) / 2 + D + H), R.lineTo(0, (t - D) / 2), R.rect(z, (t - D) / 2, G - 2 * z, D), R.moveTo(G - z, (t - D) / 2), R.lineTo(G, (t - D) / 2), R.lineTo(G, (t - D) / 2 + D + H), R.lineTo(G - z, (t - D) / 2 + D), R.lineTo(G - z, (t - D) / 2), R.fillStrokeShape(F);
4444
+ const z = I * 0.5;
4445
+ R.beginPath(), R.moveTo(0, (t - D) / 2), R.lineTo(z, (t - D) / 2), R.lineTo(z, (t - D) / 2 + D), R.lineTo(0, (t - D) / 2 + D + I), R.lineTo(0, (t - D) / 2), R.rect(z, (t - D) / 2, H - 2 * z, D), R.moveTo(H - z, (t - D) / 2), R.lineTo(H, (t - D) / 2), R.lineTo(H, (t - D) / 2 + D + I), R.lineTo(H - z, (t - D) / 2 + D), R.lineTo(H - z, (t - D) / 2), R.fillStrokeShape(F);
4426
4446
  },
4427
- width: G,
4447
+ width: H,
4428
4448
  fill: _,
4429
4449
  shadowColor: c,
4430
4450
  shadowBlur: g,
4431
4451
  shadowOffsetX: d,
4432
4452
  shadowOffsetY: l,
4433
- y: -(H + D) / 2 - i / 2
4453
+ y: -(I + D) / 2 - i / 2
4434
4454
  });
4435
4455
  !this.sliderBar || this.sliderBar.width() !== o ? (this.sliderBar && this.sliderBar.destroy(), this.sliderBar = W(o), this.slider.add(this.sliderBar)) : this.sliderBar.setAttrs({
4436
4456
  fill: _,
@@ -4449,7 +4469,7 @@ class We {
4449
4469
  fill: r,
4450
4470
  cornerRadius: h
4451
4471
  }), this.renderProgress(o, e);
4452
- const _ = (m = this.context.getOptions().bar.move.single) == null ? void 0 : m.icon, D = (u = this.context.getOptions().bar.move.single) == null ? void 0 : u.backgroundColor, H = D ? B(D).alpha(((x = this.context.getOptions().bar.move.single) == null ? void 0 : x.opacity) ?? 1).toHex() : B(r).brighten(30 * (this.unpackFunc((w = this.context.getOptions().bar.progress) == null ? void 0 : w.show) ? -1 : 1)).alpha(((T = this.context.getOptions().bar.move.single) == null ? void 0 : T.opacity) ?? 1).toHex();
4472
+ const _ = (p = this.context.getOptions().bar.move.single) == null ? void 0 : p.icon, D = (u = this.context.getOptions().bar.move.single) == null ? void 0 : u.backgroundColor, I = D ? B(D).alpha(((y = this.context.getOptions().bar.move.single) == null ? void 0 : y.opacity) ?? 1).toHex() : B(r).brighten(30 * (this.unpackFunc((x = this.context.getOptions().bar.progress) == null ? void 0 : x.show) ? -1 : 1)).alpha(((T = this.context.getOptions().bar.move.single) == null ? void 0 : T.opacity) ?? 1).toHex();
4453
4473
  if (!!this.unpackFunc((b = this.context.getOptions().bar.move.single) == null ? void 0 : b.left)) {
4454
4474
  if (!this.leftHandleGroup) {
4455
4475
  this.leftHandleGroup = new S.Group({
@@ -4481,12 +4501,12 @@ class We {
4481
4501
  (q = this.leftHandleGroup) == null || q.add(z);
4482
4502
  });
4483
4503
  }
4484
- (y = this.leftHandleGroup.findOne("Rect")) == null || y.setAttrs({
4504
+ (w = this.leftHandleGroup.findOne("Rect")) == null || w.setAttrs({
4485
4505
  width: this.handlerWidth,
4486
4506
  height: e,
4487
- fill: H,
4507
+ fill: I,
4488
4508
  cornerRadius: [h[0], 0, 0, h[3]]
4489
- }), (k = this.leftHandleGroup.findOne("Image")) == null || k.setAttrs({
4509
+ }), (C = this.leftHandleGroup.findOne("Image")) == null || C.setAttrs({
4490
4510
  x: 0,
4491
4511
  y: (e - this.handlerWidth) / 2,
4492
4512
  width: this.handlerWidth,
@@ -4524,11 +4544,11 @@ class We {
4524
4544
  (q = this.rightHandleGroup) == null || q.add(z);
4525
4545
  });
4526
4546
  }
4527
- (L = this.rightHandleGroup.findOne("Rect")) == null || L.setAttrs({
4547
+ (k = this.rightHandleGroup.findOne("Rect")) == null || k.setAttrs({
4528
4548
  x: o - this.handlerWidth,
4529
4549
  width: this.handlerWidth,
4530
4550
  height: e,
4531
- fill: H,
4551
+ fill: I,
4532
4552
  cornerRadius: [0, h[1], h[2], 0]
4533
4553
  }), (v = this.rightHandleGroup.findOne("Image")) == null || v.setAttrs({
4534
4554
  x: o - this.handlerWidth,
@@ -4578,7 +4598,7 @@ class We {
4578
4598
  }
4579
4599
  }
4580
4600
  renderProgress(t, e) {
4581
- var i, s, n, o, r, h, c, g, d, l, p, m;
4601
+ var i, s, n, o, r, h, c, g, d, l, m, p;
4582
4602
  if (!this.unpackFunc((i = this.context.getOptions().bar.progress) == null ? void 0 : i.show)) {
4583
4603
  this.progressGroup && (this.progressGroup.destroy(), this.progressGroup = null);
4584
4604
  return;
@@ -4589,9 +4609,9 @@ class We {
4589
4609
  ((s = this.context.getOptions().bar.progress) == null ? void 0 : s.targetVal) ?? 100
4590
4610
  );
4591
4611
  if (u === 0) return;
4592
- const x = this.unpackFunc(
4612
+ const y = this.unpackFunc(
4593
4613
  this.context.getOptions().bar.backgroundColor
4594
- ) || this.context.getOptions().primaryColor, w = this.unpackFunc((n = this.context.getOptions().bar.progress) == null ? void 0 : n.backgroundColor) || B(x).brighten(((o = this.context.getOptions().bar.progress) == null ? void 0 : o.amount) || 30).toHex(), T = ot(
4614
+ ) || this.context.getOptions().primaryColor, x = this.unpackFunc((n = this.context.getOptions().bar.progress) == null ? void 0 : n.backgroundColor) || B(y).brighten(((o = this.context.getOptions().bar.progress) == null ? void 0 : o.amount) || 30).toHex(), T = ot(
4595
4615
  this.unpackFunc(this.context.getOptions().bar.radius)
4596
4616
  ), b = ot(
4597
4617
  this.unpackFunc((r = this.context.getOptions().bar.progress) == null ? void 0 : r.radius),
@@ -4599,41 +4619,41 @@ class We {
4599
4619
  // 默认 2
4600
4620
  );
4601
4621
  b[0] = T[0], b[3] = T[3], u === 1 && (b[1] = T[1], b[2] = T[2]);
4602
- const y = t * u;
4603
- this.progressGroup ? (this.progressGroup.width(y), this.progressGroup.destroyChildren()) : (this.progressGroup = new S.Group({
4622
+ const w = t * u;
4623
+ this.progressGroup ? (this.progressGroup.width(w), this.progressGroup.destroyChildren()) : (this.progressGroup = new S.Group({
4604
4624
  x: 0,
4605
4625
  y: 0,
4606
- width: y,
4626
+ width: w,
4607
4627
  height: e,
4608
4628
  listening: !1
4609
4629
  }), this.slider.add(this.progressGroup));
4610
- const k = new S.Rect({
4630
+ const C = new S.Rect({
4611
4631
  x: 0,
4612
4632
  y: 0,
4613
- width: y,
4633
+ width: w,
4614
4634
  height: e,
4615
- fill: w,
4635
+ fill: x,
4616
4636
  cornerRadius: b,
4617
4637
  opacity: this.unpackFunc((h = this.context.getOptions().bar.progress) == null ? void 0 : h.opacity)
4618
4638
  });
4619
- this.progressGroup.add(k);
4639
+ this.progressGroup.add(C);
4620
4640
  const E = `${gt(
4621
4641
  u * 100,
4622
4642
  (c = this.context.getOptions().bar.progress) == null ? void 0 : c.decimal
4623
- )}%`, L = new S.Text().measureSize(E).width, v = this.unpackFunc((g = this.context.getOptions().bar.progress) == null ? void 0 : g.textAlign), M = new S.Text({
4643
+ )}%`, k = new S.Text().measureSize(E).width, v = this.unpackFunc((g = this.context.getOptions().bar.progress) == null ? void 0 : g.textAlign), M = new S.Text({
4624
4644
  x: 0,
4625
4645
  y: v === "top" ? -e : 0,
4626
- width: v === "right" ? y + L : Math.max(y, L),
4646
+ width: v === "right" ? w + k : Math.max(w, k),
4627
4647
  height: e,
4628
- fill: this.unpackFunc((d = this.context.getOptions().bar.progress) == null ? void 0 : d.color) || B("#000000").mix(w, 50).alpha(0.7).toHex(),
4648
+ fill: this.unpackFunc((d = this.context.getOptions().bar.progress) == null ? void 0 : d.color) || B("#000000").mix(x, 50).alpha(0.7).toHex(),
4629
4649
  text: E,
4630
4650
  fontSize: this.unpackFunc((l = this.context.getOptions().bar.progress) == null ? void 0 : l.fontSize) || 10,
4631
- fontStyle: this.unpackFunc((p = this.context.getOptions().bar.progress) == null ? void 0 : p.fontStyle) || "italic",
4651
+ fontStyle: this.unpackFunc((m = this.context.getOptions().bar.progress) == null ? void 0 : m.fontStyle) || "italic",
4632
4652
  fontFamily: "Arial",
4633
4653
  verticalAlign: v === "top" ? "bottom" : "middle",
4634
4654
  align: "right"
4635
4655
  });
4636
- (m = this.progressGroup) == null || m.add(M);
4656
+ (p = this.progressGroup) == null || p.add(M);
4637
4657
  }
4638
4658
  }
4639
4659
  // 绑定事件,包括拖拽和边缘检测
@@ -4647,11 +4667,11 @@ class We {
4647
4667
  const e = t.target.getStage();
4648
4668
  e && this.slider.draggable() && (e.container().style.cursor = "grab");
4649
4669
  }), this.slider.on("click", (t) => {
4650
- t.evt.button === 0 && (t.cancelBubble = !0, this.isDragging = !1, this.context.event.emit(C.SLIDER_CLICK, t.evt, this.task));
4670
+ t.evt.button === 0 && (t.cancelBubble = !0, this.isDragging = !1, this.context.event.emit(L.SLIDER_CLICK, t.evt, this.task));
4651
4671
  }), this.slider.on("contextmenu", (t) => {
4652
- t.cancelBubble = !0, t.evt.stopPropagation(), t.evt.preventDefault(), this.context.event.emit(C.SLIDER_CONTEXTMENU, t.evt, this.task);
4672
+ t.cancelBubble = !0, t.evt.stopPropagation(), t.evt.preventDefault(), this.context.event.emit(L.SLIDER_CONTEXTMENU, t.evt, this.task);
4653
4673
  }), this.slider.on("dblclick", (t) => {
4654
- t.evt.button === 0 && (t.cancelBubble = !0, this.context.event.emit(C.SLIDER_DBL_CLICK, t.evt, this.task));
4674
+ t.evt.button === 0 && (t.cancelBubble = !0, this.context.event.emit(L.SLIDER_DBL_CLICK, t.evt, this.task));
4655
4675
  }));
4656
4676
  }
4657
4677
  /**
@@ -4664,7 +4684,7 @@ class We {
4664
4684
  handleDragStart(t) {
4665
4685
  const e = t.target.getStage();
4666
4686
  if (!e) return;
4667
- this.isDragging = !0, this.oldTasks = [], this.context.event.emit(C.SLIDER_MOVING, !0), e.container().style.cursor = "grabbing";
4687
+ this.isDragging = !0, this.oldTasks = [], this.context.event.emit(L.SLIDER_MOVING, !0), e.container().style.cursor = "grabbing";
4668
4688
  const i = t.target.x(), s = this.context.store.getTimeAxis().getCellWidth(), n = ct(i, s);
4669
4689
  this.dragDiffX = n - i, this.handleMove(t, e);
4670
4690
  }
@@ -4677,7 +4697,7 @@ class We {
4677
4697
  }
4678
4698
  handleDragEnd(t) {
4679
4699
  this.stopAutoMove(), this.stopAutoScroll(), this.stopAutoExpand(), this.isDragging = !1, this.dragDiffX = 0, this.draggingDirection = "none", this.oldTasks.length > 0 && (this.context.event.emit(
4680
- C.TASK_DRAG_END,
4700
+ L.TASK_DRAG_END,
4681
4701
  this.task,
4682
4702
  this.oldTasks
4683
4703
  ), this.oldTasks = []);
@@ -4697,34 +4717,34 @@ class We {
4697
4717
  }
4698
4718
  }
4699
4719
  }
4700
- this.context.event.emit(C.SLIDER_MOVING, !1);
4720
+ this.context.event.emit(L.SLIDER_MOVING, !1);
4701
4721
  }
4702
4722
  handleMove(t, e) {
4703
4723
  const i = e.width(), s = !!this.context.getOptions().bar.move.lock, n = !!this.context.getOptions().bar.move.byUnit, o = this.context.store.getTimeAxis().getCellWidth(), r = t.target.width(), h = t.target.x(), c = h + r, g = Math.max(0, -this.offsetX - h), d = Math.max(0, c - (-this.offsetX + i));
4704
4724
  this.autoMoveTimer = window.setInterval(() => {
4705
- const l = t.target.width(), p = t.target.x(), m = p + l, u = -this.offsetX, x = u + i, w = this.context.store.getTimeAxis().getTotalWidth(), T = p <= u + this.EDGE_THRESHOLD, b = m >= x - this.EDGE_THRESHOLD;
4725
+ const l = t.target.width(), m = t.target.x(), p = m + l, u = -this.offsetX, y = u + i, x = this.context.store.getTimeAxis().getTotalWidth(), T = m <= u + this.EDGE_THRESHOLD, b = p >= y - this.EDGE_THRESHOLD;
4706
4726
  if (T)
4707
4727
  if (u <= 0)
4708
4728
  this.draggingDirection === "left" && t.target.x(-g), this.stopAutoScroll(), s || (this.draggingDirection === "left" ? this.startAutoExpand("left", -g) : this.stopAutoExpand());
4709
4729
  else if (this.draggingDirection === "left") {
4710
- const y = n ? -o : -this.SCROLL_STEP;
4730
+ const w = n ? -o : -this.SCROLL_STEP;
4711
4731
  this.startAutoScroll(
4712
- y,
4732
+ w,
4713
4733
  n,
4714
4734
  () => {
4715
- t.target.x(t.target.x() + y);
4735
+ t.target.x(t.target.x() + w);
4716
4736
  },
4717
4737
  () => t.target.x(t.target.x() - g)
4718
4738
  );
4719
4739
  } else
4720
4740
  this.stopAutoScroll();
4721
4741
  else if (b)
4722
- if (x >= w)
4723
- this.draggingDirection === "right" && t.target.x(w - l + d), this.stopAutoScroll(), s || (this.draggingDirection === "right" ? this.startAutoExpand("right", 0, d) : this.stopAutoExpand());
4742
+ if (y >= x)
4743
+ this.draggingDirection === "right" && t.target.x(x - l + d), this.stopAutoScroll(), s || (this.draggingDirection === "right" ? this.startAutoExpand("right", 0, d) : this.stopAutoExpand());
4724
4744
  else if (this.draggingDirection === "right") {
4725
- const y = n ? o : this.SCROLL_STEP;
4726
- this.startAutoScroll(y, n, () => {
4727
- t.target.x(t.target.x() + y);
4745
+ const w = n ? o : this.SCROLL_STEP;
4746
+ this.startAutoScroll(w, n, () => {
4747
+ t.target.x(t.target.x() + w);
4728
4748
  });
4729
4749
  } else
4730
4750
  this.stopAutoScroll();
@@ -4735,18 +4755,18 @@ class We {
4735
4755
  }
4736
4756
  // 左右操作拖拽
4737
4757
  resizeMove(t, e) {
4738
- var x;
4758
+ var y;
4739
4759
  t.cancelBubble = !0;
4740
4760
  const i = t.target.getStage();
4741
4761
  if (!i) return;
4742
- this.isDragging = !0, this.context.event.emit(C.SLIDER_MOVING, !0);
4743
- let s = ((x = i.getPointerPosition()) == null ? void 0 : x.x) || 0;
4762
+ this.isDragging = !0, this.context.event.emit(L.SLIDER_MOVING, !0);
4763
+ let s = ((y = i.getPointerPosition()) == null ? void 0 : y.x) || 0;
4744
4764
  const n = !!this.context.getOptions().bar.move.byUnit, o = this.context.store.getTimeAxis().getCellWidth(), r = !!this.context.getOptions().bar.move.lock, h = i.width();
4745
4765
  let c = 0, g = 0;
4746
4766
  this.autoMoveTimer = window.setInterval(() => {
4747
- const w = this.slider.width(), T = this.slider.x(), b = T + w, y = -this.offsetX, k = y + h, E = T <= y + this.EDGE_THRESHOLD, L = b >= k - this.EDGE_THRESHOLD;
4767
+ const x = this.slider.width(), T = this.slider.x(), b = T + x, w = -this.offsetX, C = w + h, E = T <= w + this.EDGE_THRESHOLD, k = b >= C - this.EDGE_THRESHOLD;
4748
4768
  if (E && e === "left") {
4749
- if (y <= 0)
4769
+ if (w <= 0)
4750
4770
  this.slider.x(0), this.stopAutoScroll(), r || (this.draggingDirection === "left" ? this.startAutoExpand("left") : this.stopAutoExpand());
4751
4771
  else if (this.draggingDirection === "left") {
4752
4772
  const v = n ? -o : -this.SCROLL_STEP;
@@ -4756,8 +4776,8 @@ class We {
4756
4776
  } else
4757
4777
  this.stopAutoScroll();
4758
4778
  this.emitUpdate("left");
4759
- } else if (L && e === "right") {
4760
- if (k >= this.context.store.getTimeAxis().getTotalWidth())
4779
+ } else if (k && e === "right") {
4780
+ if (C >= this.context.store.getTimeAxis().getTotalWidth())
4761
4781
  this.slider.width(
4762
4782
  this.context.store.getTimeAxis().getTotalWidth() - this.slider.x()
4763
4783
  ), this.stopAutoScroll(), r || (this.draggingDirection === "right" ? this.startAutoExpand("right") : this.stopAutoExpand());
@@ -4769,12 +4789,12 @@ class We {
4769
4789
  } else
4770
4790
  this.stopAutoScroll();
4771
4791
  this.emitUpdate("right");
4772
- } else if (e === "right" && T <= y && b <= y + this.EDGE_THRESHOLD + o) {
4792
+ } else if (e === "right" && T <= w && b <= w + this.EDGE_THRESHOLD + o) {
4773
4793
  const v = n ? -o : -this.SCROLL_STEP;
4774
4794
  this.startAutoScroll(v, n, () => {
4775
4795
  g += v, this.slider.width(Math.max(this.slider.width(), o)), this.slider.width() > o && this.slider.x(this.slider.x() + v), this.emitUpdate("right");
4776
4796
  });
4777
- } else if (e === "left" && b >= k && T >= k - this.EDGE_THRESHOLD - o) {
4797
+ } else if (e === "left" && b >= C && T >= C - this.EDGE_THRESHOLD - o) {
4778
4798
  const v = n ? o : this.SCROLL_STEP;
4779
4799
  this.startAutoScroll(v, n, () => {
4780
4800
  c += v, this.slider.width(Math.max(this.slider.width(), o)), this.slider.width() > o && this.slider.x(this.slider.x() + v), this.emitUpdate("left");
@@ -4783,23 +4803,23 @@ class We {
4783
4803
  this.stopAutoExpand(), this.stopAutoScroll();
4784
4804
  }, this.MOVE_INTERVAL);
4785
4805
  let d;
4786
- const l = this.slider.x(), p = this.slider.width(), m = (w) => {
4787
- var y;
4788
- w.movementX > 0 ? this.draggingDirection = "right" : w.movementX < 0 && (this.draggingDirection = "left");
4789
- const T = Math.max(((y = i.getPointerPosition()) == null ? void 0 : y.x) || 0, 0);
4806
+ const l = this.slider.x(), m = this.slider.width(), p = (x) => {
4807
+ var w;
4808
+ x.movementX > 0 ? this.draggingDirection = "right" : x.movementX < 0 && (this.draggingDirection = "left");
4809
+ const T = Math.max(((w = i.getPointerPosition()) == null ? void 0 : w.x) || 0, 0);
4790
4810
  let b = T - s;
4791
- n && (b = ct(b, o)), (d === void 0 || d !== b) && (e === "left" ? p - b - c >= o && T < h - this.EDGE_THRESHOLD && (this.slider.width(p - b - c), this.slider.x(l + b + c), this.emitUpdate("left")) : p + b + g >= o && T > this.EDGE_THRESHOLD && (this.slider.width(p + b + g), this.emitUpdate("right")), d = b);
4811
+ n && (b = ct(b, o)), (d === void 0 || d !== b) && (e === "left" ? m - b - c >= o && T < h - this.EDGE_THRESHOLD && (this.slider.width(m - b - c), this.slider.x(l + b + c), this.emitUpdate("left")) : m + b + g >= o && T > this.EDGE_THRESHOLD && (this.slider.width(m + b + g), this.emitUpdate("right")), d = b);
4792
4812
  }, u = () => {
4793
- this.handleDragEnd(t), document.removeEventListener("mousemove", m), document.removeEventListener("mouseup", u);
4813
+ this.handleDragEnd(t), document.removeEventListener("mousemove", p), document.removeEventListener("mouseup", u);
4794
4814
  };
4795
- document.addEventListener("mousemove", m), document.addEventListener("mouseup", u);
4815
+ document.addEventListener("mousemove", p), document.addEventListener("mouseup", u);
4796
4816
  }
4797
4817
  // 开始自动扩展
4798
4818
  startAutoExpand(t, e = 0, i = 0) {
4799
4819
  if (this.autoExpandTimer) return;
4800
4820
  const s = this.context.store.getTimeAxis();
4801
4821
  this.autoExpandTimer = window.setInterval(() => {
4802
- s.expand(t, 1), this.context.event.emit(C.CHART_OFFSET_CHANGE), t === "left" && this.slider.x(e);
4822
+ s.expand(t, 1), this.context.event.emit(L.CHART_OFFSET_CHANGE), t === "left" && this.slider.x(e);
4803
4823
  }, this.AUTO_EXPAND_INTERVAL);
4804
4824
  }
4805
4825
  // 开始自动滚动
@@ -4856,18 +4876,18 @@ class We {
4856
4876
  }
4857
4877
  /** 闪烁 */
4858
4878
  handleBarBlink() {
4859
- if (!this.sliderBar) return;
4860
- const t = this.sliderBar.opacity(), e = 400, s = e * 2, n = new S.Animation((o) => {
4861
- if (!this.sliderBar || !o) return;
4879
+ if (!this.sliderGroup) return;
4880
+ const t = this.sliderGroup.opacity(), e = 500, s = e * 2, n = new S.Animation((o) => {
4881
+ if (!this.sliderGroup || !o) return;
4862
4882
  const r = o.time;
4863
4883
  if (r >= s) {
4864
- this.sliderBar.opacity(t), n.stop();
4884
+ this.sliderGroup.opacity(t), n.stop();
4865
4885
  return;
4866
4886
  }
4867
4887
  const h = r % e / e;
4868
4888
  let c;
4869
- h < 0.5 ? c = t * (1 - h * 2) : c = t * ((h - 0.5) * 2), this.sliderBar.opacity(Math.max(0, Math.min(t, c)));
4870
- }, this.sliderBar.getLayer());
4889
+ h < 0.5 ? c = t * (1 - h * 2) : c = t * ((h - 0.5) * 2), this.sliderGroup.opacity(Math.max(0, Math.min(t, c)));
4890
+ }, this.sliderGroup.getLayer());
4871
4891
  n.start();
4872
4892
  }
4873
4893
  }
@@ -4938,7 +4958,7 @@ class Fe {
4938
4958
  */
4939
4959
  render(t) {
4940
4960
  this.tasks = t;
4941
- const e = this.context.getOptions().row.height, i = Z();
4961
+ const e = this.context.getOptions().row.height, i = Q();
4942
4962
  this.rowBgGroup.destroyChildren(), this.tasks.forEach((s, n) => {
4943
4963
  const o = `chart-row-${s.id}`;
4944
4964
  let r = this.rowsCache.get(o);
@@ -4987,13 +5007,13 @@ class Fe {
4987
5007
  * 注册事件监听
4988
5008
  */
4989
5009
  registerEvents() {
4990
- this.context.event.on(C.ROW_HIGHLIGHT, (t) => {
5010
+ this.context.event.on(L.ROW_HIGHLIGHT, (t) => {
4991
5011
  this.highlightRow(t);
4992
- }), this.context.event.on(C.ROW_UNHIGHLIGHT, (t) => {
5012
+ }), this.context.event.on(L.ROW_UNHIGHLIGHT, (t) => {
4993
5013
  this.unhighlightRow(t);
4994
- }), this.context.event.on(C.TASK_SELECTED, (t) => {
5014
+ }), this.context.event.on(L.TASK_SELECTED, (t) => {
4995
5015
  this.selectRow(t.id);
4996
- }), this.context.event.on(C.TASK_UNSELECTED, (t) => {
5016
+ }), this.context.event.on(L.TASK_UNSELECTED, (t) => {
4997
5017
  this.unselectRow(t);
4998
5018
  });
4999
5019
  }
@@ -5005,9 +5025,9 @@ class Fe {
5005
5025
  if (!e) return;
5006
5026
  const i = this.getTaskByPosition(e);
5007
5027
  this.highlightedRowId && i && i.id !== this.highlightedRowId && this.context.event.emit(
5008
- C.ROW_UNHIGHLIGHT,
5028
+ L.ROW_UNHIGHLIGHT,
5009
5029
  this.highlightedRowId
5010
- ), i && this.context.event.emit(C.ROW_HIGHLIGHT, i.id);
5030
+ ), i && this.context.event.emit(L.ROW_HIGHLIGHT, i.id);
5011
5031
  }
5012
5032
  /**
5013
5033
  * 处理鼠标离开
@@ -5025,7 +5045,7 @@ class Fe {
5025
5045
  const i = this.getTaskByPosition(e);
5026
5046
  if (i) {
5027
5047
  if (this.context.store.getDataManager().isTaskSelected(i.id)) return;
5028
- this.context.store.getDataManager().selectTask(i.id), this.context.event.emit(C.ROW_CLICK, t.evt, i);
5048
+ this.context.store.getDataManager().selectTask(i.id), this.context.event.emit(L.ROW_CLICK, t.evt, i);
5029
5049
  }
5030
5050
  }
5031
5051
  /**
@@ -5036,7 +5056,7 @@ class Fe {
5036
5056
  const e = this.stage.getPointerPosition();
5037
5057
  if (!e) return;
5038
5058
  const i = this.getTaskByPosition(e);
5039
- i && this.context.event.emit(C.ROW_DBL_CLICK, t.evt, i);
5059
+ i && this.context.event.emit(L.ROW_DBL_CLICK, t.evt, i);
5040
5060
  }
5041
5061
  /**
5042
5062
  * 处理右键菜单
@@ -5047,7 +5067,7 @@ class Fe {
5047
5067
  const e = this.stage.getPointerPosition();
5048
5068
  if (!e) return;
5049
5069
  const i = this.getTaskByPosition(e);
5050
- i && this.context.event.emit(C.ROW_CONTEXTMENU, t.evt, i);
5070
+ i && this.context.event.emit(L.ROW_CONTEXTMENU, t.evt, i);
5051
5071
  }
5052
5072
  /**
5053
5073
  * 按照位置获取任务
@@ -5199,17 +5219,17 @@ class Bt {
5199
5219
  g.add(d);
5200
5220
  const l = new S.Group();
5201
5221
  if (o === 0 || o === 90) {
5202
- const m = new S.Line({
5222
+ const p = new S.Line({
5203
5223
  points: [0, 0, o === 0 ? h : 0, o === 0 ? 0 : c],
5204
5224
  stroke: e,
5205
5225
  strokeWidth: i,
5206
5226
  perfectDrawEnabled: !0
5207
5227
  });
5208
- l.add(m);
5228
+ l.add(p);
5209
5229
  } else
5210
- for (let m = -h; m < h * 2; m += h) {
5211
- const u = m + i / 2, x = 0, w = m + i / 2 + (Math.cos(r) < 0 ? -h : h), T = c, b = new S.Line({
5212
- points: [Math.ceil(u), Math.ceil(x), Math.ceil(w), Math.ceil(T)],
5230
+ for (let p = -h; p < h * 2; p += h) {
5231
+ const u = p + i / 2, y = 0, x = p + i / 2 + (Math.cos(r) < 0 ? -h : h), T = c, b = new S.Line({
5232
+ points: [Math.ceil(u), Math.ceil(y), Math.ceil(x), Math.ceil(T)],
5213
5233
  stroke: e,
5214
5234
  strokeWidth: i,
5215
5235
  perfectDrawEnabled: !0,
@@ -5219,8 +5239,8 @@ class Bt {
5219
5239
  l.add(b);
5220
5240
  }
5221
5241
  d.add(l), d.draw();
5222
- const p = new Image();
5223
- return p.src = g.toDataURL(), g.destroy(), p;
5242
+ const m = new Image();
5243
+ return m.src = g.toDataURL(), g.destroy(), m;
5224
5244
  }
5225
5245
  /**
5226
5246
  * 创建圆点图案
@@ -5250,13 +5270,13 @@ class Bt {
5250
5270
  y: o - s / 2 - i / 2
5251
5271
  }
5252
5272
  ].forEach((l) => {
5253
- const p = new S.Circle({
5273
+ const m = new S.Circle({
5254
5274
  x: l.x,
5255
5275
  y: l.y,
5256
5276
  radius: i / 2,
5257
5277
  fill: r.toString()
5258
5278
  });
5259
- c.add(p);
5279
+ c.add(m);
5260
5280
  }), c.draw();
5261
5281
  const d = new Image();
5262
5282
  return d.src = h.toDataURL(), h.destroy(), d;
@@ -5349,20 +5369,20 @@ class Be {
5349
5369
  for (let d = t; d <= e; ) {
5350
5370
  let l = s;
5351
5371
  if (l = s * 2 * (i === "day" ? 1 : 24), this.isWeekend(d)) {
5352
- const p = this.context.store.getTimeAxis().getTimeLeft(d), m = n, u = h;
5353
- if (p + l < c) {
5372
+ const m = this.context.store.getTimeAxis().getTimeLeft(d), p = n, u = h;
5373
+ if (m + l < c) {
5354
5374
  d = d.add(2, "day");
5355
5375
  continue;
5356
5376
  }
5357
- if (p > g)
5377
+ if (m > g)
5358
5378
  break;
5359
5379
  !this.patternImage && this.context.getOptions().weekend.pattern && (this.patternImage = await Bt.createPattern(
5360
5380
  this.context.getOptions().weekend
5361
5381
  ));
5362
- const w = new S.Rect({
5382
+ const x = new S.Rect({
5363
5383
  name: "weekend-rect",
5364
- x: p,
5365
- y: m,
5384
+ x: m,
5385
+ y: p,
5366
5386
  width: l,
5367
5387
  height: u,
5368
5388
  // 根据模式设置填充
@@ -5376,7 +5396,7 @@ class Be {
5376
5396
  },
5377
5397
  opacity: this.context.getOptions().weekend.opacity
5378
5398
  });
5379
- this.weekendGroup.add(w), d = d.add(2, "day");
5399
+ this.weekendGroup.add(x), d = d.add(2, "day");
5380
5400
  } else
5381
5401
  d = d.add(1, "day");
5382
5402
  }
@@ -5412,7 +5432,7 @@ class ze {
5412
5432
  * 渲染今日线
5413
5433
  */
5414
5434
  render() {
5415
- var d, l, p, m, u, x, w;
5435
+ var d, l, m, p, u, y, x;
5416
5436
  const t = Object.assign(
5417
5437
  {
5418
5438
  show: !0,
@@ -5424,7 +5444,7 @@ class ze {
5424
5444
  this.context.getOptions().today || {}
5425
5445
  );
5426
5446
  if (!t.show) return;
5427
- let e = I();
5447
+ let e = G();
5428
5448
  const i = this.context.store.getTimeAxis().getCellUnit();
5429
5449
  t.type === "block" && (e = e.startOf(i));
5430
5450
  const s = this.context.store.getTimeAxis().getTimeLeft(e), n = this.context.store.getTimeAxis().getCellWidth(), o = this.context.getOptions().header.height, r = B(t.backgroundColor).alpha(t.opacity).toHex(), h = (t.type === "block" ? s + n / 2 : s) + this.offsetX, c = [h, o, h, this.height], g = t.type === "line" ? t.width : n;
@@ -5433,24 +5453,24 @@ class ze {
5433
5453
  stroke: r,
5434
5454
  strokeWidth: g
5435
5455
  }), this.bgLayer.add(this.todayLine)), (d = this.context.getOptions().today.text) != null && d.show) {
5436
- const T = ((l = this.context.getOptions().today.text) == null ? void 0 : l.fontSize) || 10, b = ((p = this.context.getOptions().today.text) == null ? void 0 : p.fontFamily) || "Arial", y = ((m = this.context.getOptions().today.text) == null ? void 0 : m.content) || "今天", k = new S.Text({ fontSize: T, fontFamily: b }).measureSize(y), E = ((u = this.context.getOptions().today.text) == null ? void 0 : u.color) || "white", L = ((x = this.context.getOptions().today.text) == null ? void 0 : x.backgroundColor) || r;
5456
+ const T = ((l = this.context.getOptions().today.text) == null ? void 0 : l.fontSize) || 10, b = ((m = this.context.getOptions().today.text) == null ? void 0 : m.fontFamily) || "Arial", w = ((p = this.context.getOptions().today.text) == null ? void 0 : p.content) || "今天", C = new S.Text({ fontSize: T, fontFamily: b }).measureSize(w), E = ((u = this.context.getOptions().today.text) == null ? void 0 : u.color) || "white", k = ((y = this.context.getOptions().today.text) == null ? void 0 : y.backgroundColor) || r;
5437
5457
  if (!this.todayTextGroup)
5438
5458
  this.todayTextGroup = new S.Group({
5439
5459
  x: s + this.offsetX + g,
5440
5460
  y: o,
5441
- opacity: (w = this.context.getOptions().today.text) == null ? void 0 : w.opacity
5461
+ opacity: (x = this.context.getOptions().today.text) == null ? void 0 : x.opacity
5442
5462
  }), this.todayTextGroup.add(new S.Rect({
5443
5463
  x: 0,
5444
5464
  y: 0,
5445
- width: k.width + 12,
5446
- height: k.height + 8,
5447
- fill: L,
5465
+ width: C.width + 12,
5466
+ height: C.height + 8,
5467
+ fill: k,
5448
5468
  cornerRadius: 0,
5449
5469
  name: "today-text-bg"
5450
5470
  })), this.todayTextGroup.add(new S.Text({
5451
5471
  x: 0,
5452
5472
  y: 0,
5453
- text: y,
5473
+ text: w,
5454
5474
  fontSize: T,
5455
5475
  fontFamily: b,
5456
5476
  padding: 5,
@@ -5463,7 +5483,7 @@ class ze {
5463
5483
  this.todayTextGroup.x(s + this.offsetX + g);
5464
5484
  const v = this.todayTextGroup.findOne(".today-text");
5465
5485
  v == null || v.setAttrs({
5466
- text: y,
5486
+ text: w,
5467
5487
  fill: E,
5468
5488
  fontSize: T,
5469
5489
  fontFamily: b,
@@ -5471,9 +5491,9 @@ class ze {
5471
5491
  });
5472
5492
  const M = this.todayTextGroup.findOne(".today-text-bg");
5473
5493
  M == null || M.setAttrs({
5474
- width: k.width + 12,
5475
- height: k.height + 8,
5476
- fill: L
5494
+ width: C.width + 12,
5495
+ height: C.height + 8,
5496
+ fill: k
5477
5497
  });
5478
5498
  }
5479
5499
  } else this.todayTextGroup && (this.todayTextGroup.destroy(), this.todayTextGroup = void 0);
@@ -5486,9 +5506,9 @@ class ze {
5486
5506
  rotation: 180,
5487
5507
  name: "today-triangle"
5488
5508
  }), this.arrowAnimation = new S.Animation((T) => {
5489
- var y;
5509
+ var w;
5490
5510
  const b = Math.sin(T.time * 4 * Math.PI / 2e3) + o - 8;
5491
- (y = this.triangle) == null || y.y(b);
5511
+ (w = this.triangle) == null || w.y(b);
5492
5512
  }, this.headerLayer), this.headerLayer.add(this.triangle), this.triangle.moveToTop(), this.arrowAnimation.start())), this.bgLayer.batchDraw();
5493
5513
  }
5494
5514
  /**
@@ -5542,7 +5562,7 @@ class Ne {
5542
5562
  * 计算假期
5543
5563
  */
5544
5564
  async calculateHoliday() {
5545
- var d, l, p, m, u, x, w, T;
5565
+ var d, l, m, p, u, y, x, T;
5546
5566
  if (this.clearHoliday(), !this.context.getOptions().holiday.show) return;
5547
5567
  const t = this.context.getOptions().holiday.holidays;
5548
5568
  if (!t || t.length === 0) return;
@@ -5550,53 +5570,53 @@ class Ne {
5550
5570
  this.context.store.getTimeAxis().getCellUnit();
5551
5571
  const o = this.context.store.getTimeAxis().getCellWidth(), r = this.context.getOptions().header.height, h = this.context.getOptions().row.height, g = this.context.store.getDataManager().getVisibleSize() * h;
5552
5572
  for (let b = s; b <= n; b = b.add(1, "day")) {
5553
- const y = t.find((k) => {
5554
- if (X(k.date)) {
5555
- if (k.date.some((E) => I(E).isSame(b, "day")))
5556
- return k;
5557
- } else if (I(k.date).isSame(b, "day"))
5558
- return k;
5573
+ const w = t.find((C) => {
5574
+ if (X(C.date)) {
5575
+ if (C.date.some((E) => G(E).isSame(b, "day")))
5576
+ return C;
5577
+ } else if (G(C.date).isSame(b, "day"))
5578
+ return C;
5559
5579
  });
5560
- if (y) {
5561
- const k = this.context.store.getTimeAxis().getTimeLeft(b), E = r, L = g;
5562
- if (k + o < e)
5580
+ if (w) {
5581
+ const C = this.context.store.getTimeAxis().getTimeLeft(b), E = r, k = g;
5582
+ if (C + o < e)
5563
5583
  continue;
5564
- if (k > i)
5584
+ if (C > i)
5565
5585
  break;
5566
- !this.patternImage.has(y) && (y.pattern || this.context.getOptions().holiday.pattern) && this.patternImage.set(
5567
- y,
5586
+ !this.patternImage.has(w) && (w.pattern || this.context.getOptions().holiday.pattern) && this.patternImage.set(
5587
+ w,
5568
5588
  await Bt.createPattern({
5569
5589
  backgroundColor: this.context.getOptions().primaryColor,
5570
- ...y,
5590
+ ...w,
5571
5591
  ...this.context.getOptions().holiday
5572
5592
  })
5573
5593
  );
5574
5594
  const M = new S.Rect({
5575
5595
  name: "holiday-rect",
5576
- x: k,
5596
+ x: C,
5577
5597
  y: E,
5578
5598
  width: o,
5579
- height: L,
5599
+ height: k,
5580
5600
  // 根据模式设置填充
5581
- ...this.patternImage.get(y) ? {
5582
- fillPatternImage: this.patternImage.get(y) ?? void 0,
5601
+ ...this.patternImage.get(w) ? {
5602
+ fillPatternImage: this.patternImage.get(w) ?? void 0,
5583
5603
  fillPatternRepeat: "repeat",
5584
5604
  fillPatternOffset: { x: 0, y: 0 },
5585
5605
  fillPatternScale: { x: 1, y: 1 },
5586
- opacity: y.opacity || this.context.getOptions().holiday.opacity
5606
+ opacity: w.opacity || this.context.getOptions().holiday.opacity
5587
5607
  } : {
5588
- fill: y.backgroundColor || this.context.getOptions().holiday.backgroundColor || this.context.getOptions().primaryColor,
5589
- opacity: y.opacity || this.context.getOptions().holiday.opacity
5608
+ fill: w.backgroundColor || this.context.getOptions().holiday.backgroundColor || this.context.getOptions().primaryColor,
5609
+ opacity: w.opacity || this.context.getOptions().holiday.opacity
5590
5610
  }
5591
5611
  });
5592
- if (this.holidayGroup.add(M), (d = y.text) != null && d.show) {
5593
- if (X(y.date) && !I(y.date[0]).isSame(b, "day"))
5612
+ if (this.holidayGroup.add(M), (d = w.text) != null && d.show) {
5613
+ if (X(w.date) && !G(w.date[0]).isSame(b, "day"))
5594
5614
  continue;
5595
- const A = ((l = y.text) == null ? void 0 : l.fontSize) || 10, _ = ((p = y.text) == null ? void 0 : p.fontFamily) || "Arial", D = ((m = y.text) == null ? void 0 : m.content) || "", H = new S.Text({ fontSize: A, fontFamily: _ }).measureSize(D), W = ((u = y.text) == null ? void 0 : u.color) || "white", G = ((x = y.text) == null ? void 0 : x.backgroundColor) || y.backgroundColor || ((w = this.context.getOptions().holiday) == null ? void 0 : w.backgroundColor) || this.context.getOptions().primaryColor, R = new S.Group({
5615
+ const A = ((l = w.text) == null ? void 0 : l.fontSize) || 10, _ = ((m = w.text) == null ? void 0 : m.fontFamily) || "Arial", D = ((p = w.text) == null ? void 0 : p.content) || "", I = new S.Text({ fontSize: A, fontFamily: _ }).measureSize(D), W = ((u = w.text) == null ? void 0 : u.color) || "white", H = ((y = w.text) == null ? void 0 : y.backgroundColor) || w.backgroundColor || ((x = this.context.getOptions().holiday) == null ? void 0 : x.backgroundColor) || this.context.getOptions().primaryColor, R = new S.Group({
5596
5616
  name: "holiday-text-group",
5597
- x: k,
5617
+ x: C,
5598
5618
  y: E,
5599
- opacity: (T = y.text) == null ? void 0 : T.opacity
5619
+ opacity: (T = w.text) == null ? void 0 : T.opacity
5600
5620
  }), F = new S.Text({
5601
5621
  text: D,
5602
5622
  fill: W,
@@ -5606,9 +5626,9 @@ class Ne {
5606
5626
  }), z = new S.Rect({
5607
5627
  x: 0,
5608
5628
  y: 0,
5609
- width: H.width + 12,
5610
- height: H.height + 8,
5611
- fill: G
5629
+ width: I.width + 12,
5630
+ height: I.height + 8,
5631
+ fill: H
5612
5632
  });
5613
5633
  R.add(z), R.add(F), this.holidayGroup.add(R);
5614
5634
  }
@@ -5659,17 +5679,17 @@ class Pe {
5659
5679
  * 计算标志日期
5660
5680
  */
5661
5681
  async calculateFlag() {
5662
- var d, l, p, m, u, x, w;
5682
+ var d, l, m, p, u, y, x;
5663
5683
  if (this.clearFlag(), !((d = this.context.getOptions().flag) != null && d.show)) return;
5664
5684
  const t = (l = this.context.getOptions().flag) == null ? void 0 : l.data;
5665
5685
  if (!t || t.length === 0) return;
5666
- const e = ((p = this.context.getOptions().flag) == null ? void 0 : p.backgroundColor) || this.context.getOptions().primaryColor, i = ((m = this.context.getOptions().flag) == null ? void 0 : m.opacity) || 1, s = ((u = this.context.getOptions().flag) == null ? void 0 : u.color) || (B(e).isDark() ? "white" : "black"), n = ((x = this.context.getOptions().flag) == null ? void 0 : x.fontFamily) || "Arial", o = ((w = this.context.getOptions().flag) == null ? void 0 : w.fontSize) || 10, r = Math.max(0, -this.offsetX), h = r + this.width, c = this.context.store.getTimeAxis().getCellWidth(), g = this.context.getOptions().header.height;
5686
+ const e = ((m = this.context.getOptions().flag) == null ? void 0 : m.backgroundColor) || this.context.getOptions().primaryColor, i = ((p = this.context.getOptions().flag) == null ? void 0 : p.opacity) || 1, s = ((u = this.context.getOptions().flag) == null ? void 0 : u.color) || (B(e).isDark() ? "white" : "black"), n = ((y = this.context.getOptions().flag) == null ? void 0 : y.fontFamily) || "Arial", o = ((x = this.context.getOptions().flag) == null ? void 0 : x.fontSize) || 10, r = Math.max(0, -this.offsetX), h = r + this.width, c = this.context.store.getTimeAxis().getCellWidth(), g = this.context.getOptions().header.height;
5667
5687
  this.context.getOptions().row.height, this.context.store.getDataManager().getVisibleSize(), t.forEach((T) => {
5668
- const b = I(T.date), y = this.context.store.getTimeAxis().getTimeLeft(b), k = g;
5669
- if (y + c < r || y > h)
5688
+ const b = G(T.date), w = this.context.store.getTimeAxis().getTimeLeft(b), C = g;
5689
+ if (w + c < r || w > h)
5670
5690
  return;
5671
- const L = [y, g, y, this.height], v = new S.Line({
5672
- points: L,
5691
+ const k = [w, g, w, this.height], v = new S.Line({
5692
+ points: k,
5673
5693
  stroke: T.backgroundColor || e,
5674
5694
  opacity: T.opacity || i,
5675
5695
  strokeWidth: 1
@@ -5679,9 +5699,9 @@ class Pe {
5679
5699
  if (M) {
5680
5700
  const A = new S.Text({
5681
5701
  text: M,
5682
- x: y + 5,
5702
+ x: w + 5,
5683
5703
  // 添加一些内边距
5684
- y: k + 5,
5704
+ y: C + 5,
5685
5705
  // 添加一些内边距
5686
5706
  fontSize: o,
5687
5707
  fontFamily: n,
@@ -5689,8 +5709,8 @@ class Pe {
5689
5709
  verticalAlign: "middle",
5690
5710
  align: "left"
5691
5711
  }), _ = new S.Rect({
5692
- x: y,
5693
- y: k,
5712
+ x: w,
5713
+ y: C,
5694
5714
  width: A.measureSize(M).width + 12,
5695
5715
  height: A.measureSize(M).height + 8,
5696
5716
  fill: T.backgroundColor || e
@@ -5700,8 +5720,8 @@ class Pe {
5700
5720
  switch (T.flag) {
5701
5721
  case "banner":
5702
5722
  this.flagGroup.add(new S.Rect({
5703
- x: y,
5704
- y: k,
5723
+ x: w,
5724
+ y: C,
5705
5725
  width: 20,
5706
5726
  height: 10,
5707
5727
  fill: T.backgroundColor || e,
@@ -5710,7 +5730,7 @@ class Pe {
5710
5730
  break;
5711
5731
  case "pennant":
5712
5732
  this.flagGroup.add(new S.Line({
5713
- points: [y, k, y + 20, k + 5, y, k + 10],
5733
+ points: [w, C, w + 20, C + 5, w, C + 10],
5714
5734
  fill: T.backgroundColor || e,
5715
5735
  opacity: T.opacity || i,
5716
5736
  closed: !0
@@ -5718,7 +5738,7 @@ class Pe {
5718
5738
  break;
5719
5739
  case "tag":
5720
5740
  this.flagGroup.add(new S.Line({
5721
- points: [y, k, y + 20, k, y + 15, k + 5, y + 20, k + 10, y, k + 10],
5741
+ points: [w, C, w + 20, C, w + 15, C + 5, w + 20, C + 10, w, C + 10],
5722
5742
  fill: T.backgroundColor || e,
5723
5743
  opacity: T.opacity || i,
5724
5744
  closed: !0
@@ -5726,7 +5746,7 @@ class Pe {
5726
5746
  break;
5727
5747
  case "wedge":
5728
5748
  this.flagGroup.add(new S.Line({
5729
- points: [y, k, y + 20, k, y + 25, k + 5, y + 20, k + 10, y, k + 10],
5749
+ points: [w, C, w + 20, C, w + 25, C + 5, w + 20, C + 10, w, C + 10],
5730
5750
  fill: T.backgroundColor || e,
5731
5751
  opacity: T.opacity || i,
5732
5752
  closed: !0
@@ -5734,7 +5754,7 @@ class Pe {
5734
5754
  break;
5735
5755
  case "ribbon":
5736
5756
  this.flagGroup.add(new S.Line({
5737
- points: [y, k, y + 15, k + 2, y + 20, k, y + 20, k + 10, y + 15, k + 12, y, k + 10],
5757
+ points: [w, C, w + 15, C + 2, w + 20, C, w + 20, C + 10, w + 15, C + 12, w, C + 10],
5738
5758
  fill: T.backgroundColor || e,
5739
5759
  opacity: T.opacity || i,
5740
5760
  closed: !0,
@@ -5784,11 +5804,11 @@ class Ye {
5784
5804
  * 注册事件
5785
5805
  */
5786
5806
  registerEvents() {
5787
- this.context.event.on(C.ROW_HIGHLIGHT, (t) => {
5807
+ this.context.event.on(L.ROW_HIGHLIGHT, (t) => {
5788
5808
  this.highlightPoint(t);
5789
- }), this.context.event.on(C.ROW_UNHIGHLIGHT, (t) => {
5809
+ }), this.context.event.on(L.ROW_UNHIGHLIGHT, (t) => {
5790
5810
  this.unhighlightPoint(t);
5791
- }), this.context.event.on(C.SLIDER_MOVING, (t) => {
5811
+ }), this.context.event.on(L.SLIDER_MOVING, (t) => {
5792
5812
  this.isSliderMoving = t;
5793
5813
  });
5794
5814
  }
@@ -5808,7 +5828,7 @@ class Ye {
5808
5828
  * 更新某一条数据
5809
5829
  */
5810
5830
  updateTask(t) {
5811
- this.calculateLinks(t), this.calculatePoints(t);
5831
+ this.calculateLinks([t]), this.calculatePoints(t);
5812
5832
  }
5813
5833
  /**
5814
5834
  * 渲染关联线
@@ -5835,44 +5855,44 @@ class Ye {
5835
5855
  const e = this.context.getOptions().header.height, i = this.context.getOptions().row.height, s = i / 2 + e, n = this.context.getOptions().links.create.radius, o = this.context.getOptions().links.create.mode === "always" ? 0.5 : 0, r = this.context.getOptions().links.create.color || this.context.getOptions().primaryColor, h = B(r).alpha(this.context.getOptions().links.create.opacity ?? 1).toHex(), c = this.context.getOptions().links.create.width;
5836
5856
  this.tasks.forEach((l) => {
5837
5857
  if (!(t && l.id !== t.id) && this.context.store.getOptionManager().unpackFunc(this.context.getOptions().bar.show, l) && l.startTime && l.endTime) {
5838
- const p = this.context.store.getTimeAxis().getTimeLeft(l.startTime), m = this.context.store.getTimeAxis().getTimeLeft(l.endTime);
5858
+ const m = this.context.store.getTimeAxis().getTimeLeft(l.startTime), p = this.context.store.getTimeAxis().getTimeLeft(l.endTime);
5839
5859
  let u = this.context.getOptions().links.gap;
5840
5860
  l.isMilestone() && (u += i / 2);
5841
- const x = s + i * l.flatIndex;
5842
- let w = !0, T = !0, b = this.context.store.getOptionManager().unpackFunc(this.context.getOptions().links.create.from, l);
5843
- if (ht(b) ? w = T = b : V(b) && (w = b === "S", T = b === "F"), w) {
5844
- const y = new S.Circle({
5861
+ const y = s + i * l.flatIndex;
5862
+ let x = !0, T = !0, b = this.context.store.getOptionManager().unpackFunc(this.context.getOptions().links.create.from, l);
5863
+ if (ht(b) ? x = T = b : V(b) && (x = b === "S", T = b === "F"), x) {
5864
+ const w = new S.Circle({
5845
5865
  id: `point-${l.id}-left`,
5846
- x: p - u,
5847
- y: x,
5866
+ x: m - u,
5867
+ y,
5848
5868
  radius: n,
5849
5869
  opacity: o,
5850
5870
  stroke: h,
5851
5871
  strokeWidth: c
5852
5872
  });
5853
- this.pointGroup.add(y), y.on("mousedown", (k) => {
5854
- this.isDragging = !0, this.createLink(k, "S", r, [p - u, x], l.id);
5855
- }), y.on("mouseover", (k) => {
5873
+ this.pointGroup.add(w), w.on("mousedown", (C) => {
5874
+ this.isDragging = !0, this.createLink(C, "S", r, [m - u, y], l.id);
5875
+ }), w.on("mouseover", (C) => {
5856
5876
  this.isSliderMoving || (this.stage.container().style.cursor = "pointer");
5857
- }), y.on("mouseout", (k) => {
5877
+ }), w.on("mouseout", (C) => {
5858
5878
  this.isDragging || this.isSliderMoving || (this.stage.container().style.cursor = "default");
5859
5879
  });
5860
5880
  }
5861
5881
  if (T) {
5862
- const y = new S.Circle({
5882
+ const w = new S.Circle({
5863
5883
  id: `point-${l.id}-right`,
5864
- x: m + u,
5865
- y: x,
5884
+ x: p + u,
5885
+ y,
5866
5886
  radius: n,
5867
5887
  opacity: o,
5868
5888
  stroke: h,
5869
5889
  strokeWidth: c
5870
5890
  });
5871
- this.pointGroup.add(y), y.on("mousedown", (k) => {
5872
- this.isDragging = !0, this.createLink(k, "F", r, [m + u, x], l.id);
5873
- }), y.on("mouseover", (k) => {
5891
+ this.pointGroup.add(w), w.on("mousedown", (C) => {
5892
+ this.isDragging = !0, this.createLink(C, "F", r, [p + u, y], l.id);
5893
+ }), w.on("mouseover", (C) => {
5874
5894
  this.isSliderMoving || (this.stage.container().style.cursor = "pointer");
5875
- }), y.on("mouseout", (k) => {
5895
+ }), w.on("mouseout", (C) => {
5876
5896
  this.isDragging || this.isSliderMoving || (this.stage.container().style.cursor = "default");
5877
5897
  });
5878
5898
  }
@@ -5891,19 +5911,15 @@ class Ye {
5891
5911
  this.destroy();
5892
5912
  return;
5893
5913
  }
5894
- const e = t ? this.context.store.getLinkManager().getLinksByTaskId(t.id) : this.context.store.getLinkManager().getLinks();
5895
- t && e.forEach((s) => {
5896
- const n = this.createId(s);
5897
- this.linkCache.delete(n);
5898
- const o = this.linksGroup.findOne(`#${n}`);
5899
- o && o.destroy();
5914
+ const e = t != null && t.length ? t.reduce((s, n) => (s.push(...this.context.store.getLinkManager().getLinksByTaskId(n.id)), s), []) : this.context.store.getLinkManager().getLinks();
5915
+ t != null && t.length && e.forEach((s) => {
5916
+ const n = this.createId(s), o = this.linkCache.get(n);
5917
+ o == null || o.destroy(), this.linkCache.delete(n);
5900
5918
  });
5901
- const i = [];
5919
+ const i = Q();
5902
5920
  e.forEach((s) => {
5903
- var g, d, l, p, m, u, x, w;
5904
- const n = this.createId(s);
5905
- this.selectedMap.has(n) && i.push(n);
5906
- const o = this.context.store.getDataManager().getTaskById(s.from), r = this.context.store.getDataManager().getTaskById(s.to);
5921
+ var g, d, l, m, p, u, y, x;
5922
+ const n = this.createId(s), o = this.context.store.getDataManager().getTaskById(s.from), r = this.context.store.getDataManager().getTaskById(s.to);
5907
5923
  if (!o) {
5908
5924
  O.warn(
5909
5925
  `No corresponding FROM task [${s.from}] was found for the link. Info:`,
@@ -5921,35 +5937,35 @@ class Ye {
5921
5937
  if (o.flatIndex < this.tasks[0].flatIndex && r.flatIndex < this.tasks[0].flatIndex || o.flatIndex > this.tasks[this.tasks.length - 1].flatIndex && r.flatIndex > this.tasks[this.tasks.length - 1].flatIndex)
5922
5938
  return;
5923
5939
  const h = Math.max(0, -this.offsetX), c = h + this.width;
5924
- if (!(this.context.store.getTimeAxis().getTimeLeft(((g = s.type) == null ? void 0 : g[0]) === "S" ? o.startTime : o.endTime) < h && this.context.store.getTimeAxis().getTimeLeft(((d = s.type) == null ? void 0 : d[1]) === "F" ? r.endTime : r.startTime) < h) && !(this.context.store.getTimeAxis().getTimeLeft(((l = s.type) == null ? void 0 : l[0]) === "S" ? o.startTime : o.endTime) > c && this.context.store.getTimeAxis().getTimeLeft(((p = s.type) == null ? void 0 : p[1]) === "F" ? r.endTime : r.startTime) > c) && this.context.store.getOptionManager().unpackFunc(this.context.getOptions().bar.show, o) && this.context.store.getOptionManager().unpackFunc(this.context.getOptions().bar.show, r)) {
5940
+ if (!(this.context.store.getTimeAxis().getTimeLeft(((g = s.type) == null ? void 0 : g[0]) === "S" ? o.startTime : o.endTime) < h && this.context.store.getTimeAxis().getTimeLeft(((d = s.type) == null ? void 0 : d[1]) === "F" ? r.endTime : r.startTime) < h) && !(this.context.store.getTimeAxis().getTimeLeft(((l = s.type) == null ? void 0 : l[0]) === "S" ? o.startTime : o.endTime) > c && this.context.store.getTimeAxis().getTimeLeft(((m = s.type) == null ? void 0 : m[1]) === "F" ? r.endTime : r.startTime) > c) && this.context.store.getOptionManager().unpackFunc(this.context.getOptions().bar.show, o) && this.context.store.getOptionManager().unpackFunc(this.context.getOptions().bar.show, r)) {
5925
5941
  const T = this.getPoints(o, r, s);
5926
5942
  if (T.length <= 2)
5927
5943
  O.warn("The link position has some error.", s);
5928
5944
  else {
5929
- const b = s.radius ?? this.context.getOptions().links.radius, y = ((m = s.arrow) == null ? void 0 : m.width) ?? this.context.getOptions().links.arrow.width, k = ((u = s.arrow) == null ? void 0 : u.height) ?? this.context.getOptions().links.arrow.height, E = s.width ?? this.context.getOptions().links.width;
5930
- let L = this.linkCache.get(n);
5931
- L === void 0 && (L = new S.Group({ id: n }));
5932
- const v = L.findOne("Circle");
5945
+ const b = s.radius ?? this.context.getOptions().links.radius, w = ((p = s.arrow) == null ? void 0 : p.width) ?? this.context.getOptions().links.arrow.width, C = ((u = s.arrow) == null ? void 0 : u.height) ?? this.context.getOptions().links.arrow.height, E = s.width ?? this.context.getOptions().links.width;
5946
+ let k = this.linkCache.get(n);
5947
+ k === void 0 && (k = new S.Group({ id: n })), t != null && t.length || (k._ = i);
5948
+ const v = k.findOne("Circle");
5933
5949
  if (v)
5934
5950
  v.radius(b), v.fill(
5935
5951
  s.color || this.context.getOptions().links.color || this.context.getOptions().primaryColor
5936
5952
  ), v.x(T[0]), v.y(T[1]);
5937
5953
  else {
5938
- const G = new S.Circle({
5954
+ const H = new S.Circle({
5939
5955
  radius: b,
5940
5956
  fill: s.color || this.context.getOptions().links.color || this.context.getOptions().primaryColor,
5941
5957
  x: T[0],
5942
5958
  y: T[1]
5943
5959
  });
5944
- L.add(G);
5960
+ k.add(H);
5945
5961
  }
5946
- const M = Math.floor(T.length / 2), A = M % 2 === 0 ? M : M - 1, _ = T.slice(0, A + 2), D = T.slice(A), H = L.findOne("Line");
5947
- if (H)
5948
- H.points(_), H.stroke(
5962
+ const M = Math.floor(T.length / 2), A = M % 2 === 0 ? M : M - 1, _ = T.slice(0, A + 2), D = T.slice(A), I = k.findOne("Line");
5963
+ if (I)
5964
+ I.points(_), I.stroke(
5949
5965
  s.color || this.context.getOptions().links.color || this.context.getOptions().primaryColor
5950
- ), H.strokeWidth(E), H.dash(s.dash || this.context.getOptions().links.dash);
5966
+ ), I.strokeWidth(E + (this.selectedMap.has(n) ? 2 : 0)), I.dash(s.dash || this.context.getOptions().links.dash);
5951
5967
  else {
5952
- const G = new S.Line({
5968
+ const H = new S.Line({
5953
5969
  points: _,
5954
5970
  stroke: s.color || this.context.getOptions().links.color || this.context.getOptions().primaryColor,
5955
5971
  strokeWidth: E,
@@ -5961,7 +5977,7 @@ class Ye {
5961
5977
  draggable: !0,
5962
5978
  dragBoundFunc: (R) => ({ x: 0, y: 0 })
5963
5979
  });
5964
- L.add(G), G.on("dragstart", (R) => {
5980
+ k.add(H), H.on("dragstart", (R) => {
5965
5981
  this.handleDrag(
5966
5982
  R,
5967
5983
  s,
@@ -5971,21 +5987,21 @@ class Ye {
5971
5987
  );
5972
5988
  });
5973
5989
  }
5974
- const W = L.findOne("Arrow");
5990
+ const W = k.findOne("Arrow");
5975
5991
  if (W)
5976
5992
  W.points(D), W.stroke(
5977
5993
  s.color || this.context.getOptions().links.color || this.context.getOptions().primaryColor
5978
- ), W.strokeWidth(E), W.pointerLength(k), W.pointerWidth(y), W.fill(
5979
- ((x = s.arrow) == null ? void 0 : x.color) || this.context.getOptions().links.arrow.color || s.color || this.context.getOptions().links.color || this.context.getOptions().primaryColor
5994
+ ), W.strokeWidth(E + (this.selectedMap.has(n) ? 2 : 0)), W.pointerLength(C), W.pointerWidth(w), W.fill(
5995
+ ((y = s.arrow) == null ? void 0 : y.color) || this.context.getOptions().links.arrow.color || s.color || this.context.getOptions().links.color || this.context.getOptions().primaryColor
5980
5996
  ), W.lineJoin("round"), W.dash(s.dash || this.context.getOptions().links.dash);
5981
5997
  else {
5982
- const G = new S.Arrow({
5998
+ const H = new S.Arrow({
5983
5999
  points: D,
5984
6000
  stroke: s.color || this.context.getOptions().links.color || this.context.getOptions().primaryColor,
5985
6001
  strokeWidth: E,
5986
- pointerLength: k,
5987
- pointerWidth: y,
5988
- fill: ((w = s.arrow) == null ? void 0 : w.color) || this.context.getOptions().links.arrow.color || s.color || this.context.getOptions().links.color || this.context.getOptions().primaryColor,
6002
+ pointerLength: C,
6003
+ pointerWidth: w,
6004
+ fill: ((x = s.arrow) == null ? void 0 : x.color) || this.context.getOptions().links.arrow.color || s.color || this.context.getOptions().links.color || this.context.getOptions().primaryColor,
5989
6005
  // 箭头填充色
5990
6006
  lineJoin: "round",
5991
6007
  dash: s.dash || this.context.getOptions().links.dash,
@@ -5994,55 +6010,57 @@ class Ye {
5994
6010
  draggable: !0,
5995
6011
  dragBoundFunc: (R) => ({ x: 0, y: 0 })
5996
6012
  });
5997
- L.add(G), G.on("dragstart", (R) => {
6013
+ k.add(H), H.on("dragstart", (R) => {
5998
6014
  this.handleDrag(R, s, "F", [T[0], T[1]], n);
5999
6015
  });
6000
6016
  }
6001
- this.linkCache.has(n) || (this.linksGroup.add(L), L.on("mouseover", (G) => {
6002
- G.target.moveToTop(), this.context.getOptions().links.move.enabled === !0 && (this.stage.container().style.cursor = "pointer"), this.selectedMap.has(n) || this.handleHighlight(
6003
- L,
6004
- b,
6005
- y,
6017
+ this.linkCache.has(n) || (this.linksGroup.add(k), k.on("mouseover", (H) => {
6018
+ H.target.moveToTop(), this.context.getOptions().links.move.enabled === !0 && (this.stage.container().style.cursor = "pointer"), this.selectedMap.has(n) || this.handleHighlight(
6006
6019
  k,
6020
+ b,
6021
+ w,
6022
+ C,
6007
6023
  E,
6008
6024
  2
6009
6025
  );
6010
- }), L.on("mouseout", (G) => {
6026
+ }), k.on("mouseout", (H) => {
6011
6027
  this.selectedMap.has(n) || this.handleHighlight(
6012
- L,
6013
- b,
6014
- y,
6015
6028
  k,
6029
+ b,
6030
+ w,
6031
+ C,
6016
6032
  E,
6017
6033
  0
6018
6034
  ), !this.isDragging && (this.stage.container().style.cursor = "default");
6019
- }), L.on("mousedown", (G) => {
6035
+ }), k.on("mousedown", (H) => {
6020
6036
  this.isDragging = !0;
6021
- }), L.on("click", (G) => {
6022
- G.cancelBubble = !0, this.isDragging = !1, L.moveToTop(), G.evt.button === 0 ? this.selectedMap.has(n) ? (this.selectedMap.delete(n), this.context.event.emit(
6023
- C.SELECT_LINK,
6037
+ }), k.on("click", (H) => {
6038
+ H.cancelBubble = !0, this.isDragging = !1, k.moveToTop(), H.evt.button === 0 && (this.selectedMap.has(n) ? (this.selectedMap.delete(n), this.context.event.emit(
6039
+ L.SELECT_LINK,
6024
6040
  null,
6025
6041
  s,
6026
6042
  this.selectedMap.values().toArray()
6027
6043
  )) : (this.selectedMap.set(n, s), this.context.event.emit(
6028
- C.SELECT_LINK,
6044
+ L.SELECT_LINK,
6029
6045
  s,
6030
6046
  null,
6031
6047
  this.selectedMap.values().toArray()
6032
- )) : G.evt.button === 2 && this.context.event.emit(C.CONTEXT_LINK, G.evt, s);
6033
- }), this.linkCache.set(n, L)), this.selectedMap.has(n) && this.handleHighlight(
6034
- L,
6035
- b,
6036
- y,
6048
+ )));
6049
+ }), k.on("contextmenu", (H) => {
6050
+ H.evt.preventDefault(), H.cancelBubble = !0, this.context.event.emit(L.CONTEXT_LINK, H.evt, s);
6051
+ }), this.linkCache.set(n, k)), this.selectedMap.has(n) && this.handleHighlight(
6037
6052
  k,
6053
+ b,
6054
+ w,
6055
+ C,
6038
6056
  E,
6039
6057
  2,
6040
6058
  !0
6041
6059
  );
6042
6060
  }
6043
6061
  }
6044
- }), this.selectedMap.forEach((s, n) => {
6045
- i.includes(n) || this.selectedMap.delete(n);
6062
+ }), t != null && t.length || this.linkCache.forEach((s, n) => {
6063
+ s._ !== i && (s.destroy(), this.linkCache.delete(n));
6046
6064
  }), this.layer.batchDraw();
6047
6065
  }
6048
6066
  createId(t) {
@@ -6077,17 +6095,17 @@ class Ye {
6077
6095
  0.05 + g + c * e.flatIndex
6078
6096
  ];
6079
6097
  {
6080
- const p = t.distance ? parseInt(t.distance) : this.context.getOptions().links.distance;
6081
- if (isNaN(p))
6098
+ const m = t.distance ? parseInt(t.distance) : this.context.getOptions().links.distance;
6099
+ if (isNaN(m))
6082
6100
  O.error("Link's distance must be a Numeric");
6083
6101
  else {
6084
- const m = n + d + p, u = o - d - p, x = [
6085
- Math.max(m, u),
6102
+ const p = n + d + m, u = o - d - m, y = [
6103
+ Math.max(p, u),
6086
6104
  g + c * e.flatIndex
6087
6105
  ];
6088
- l.push(...x);
6089
- const w = c * e.flatIndex + h + (e.flatIndex <= i.flatIndex ? c : 0);
6090
- l.push(x[0], w), l.push(u, w), l.push(u, g + c * i.flatIndex);
6106
+ l.push(...y);
6107
+ const x = c * e.flatIndex + h + (e.flatIndex <= i.flatIndex ? c : 0);
6108
+ l.push(y[0], x), l.push(u, x), l.push(u, g + c * i.flatIndex);
6091
6109
  }
6092
6110
  }
6093
6111
  return l.push(o - d, g + c * i.flatIndex), l;
@@ -6099,16 +6117,16 @@ class Ye {
6099
6117
  0.05 + g + c * e.flatIndex
6100
6118
  ];
6101
6119
  {
6102
- const p = t.distance ? parseInt(t.distance) : this.context.getOptions().links.distance;
6103
- if (isNaN(p))
6120
+ const m = t.distance ? parseInt(t.distance) : this.context.getOptions().links.distance;
6121
+ if (isNaN(m))
6104
6122
  O.error("Link's distance must be a Numeric");
6105
6123
  else {
6106
- const m = n + d + p, u = r + d + p, x = [
6107
- m <= u ? u : m,
6124
+ const p = n + d + m, u = r + d + m, y = [
6125
+ p <= u ? u : p,
6108
6126
  g + c * e.flatIndex
6109
6127
  ];
6110
- l.push(...x), l.push(
6111
- Math.max(u, m),
6128
+ l.push(...y), l.push(
6129
+ Math.max(u, p),
6112
6130
  g + c * i.flatIndex
6113
6131
  );
6114
6132
  }
@@ -6122,16 +6140,16 @@ class Ye {
6122
6140
  0.05 + g + c * e.flatIndex
6123
6141
  ];
6124
6142
  {
6125
- const p = t.distance ? parseInt(t.distance) : this.context.getOptions().links.distance;
6126
- if (isNaN(p))
6143
+ const m = t.distance ? parseInt(t.distance) : this.context.getOptions().links.distance;
6144
+ if (isNaN(m))
6127
6145
  O.error("Link's distance must be a Numeric");
6128
6146
  else {
6129
- const m = s - d - p, u = o - d - p;
6147
+ const p = s - d - m, u = o - d - m;
6130
6148
  l.push(
6131
- Math.min(u, m),
6149
+ Math.min(u, p),
6132
6150
  g + c * e.flatIndex
6133
6151
  ), l.push(
6134
- Math.min(u, m),
6152
+ Math.min(u, p),
6135
6153
  g + c * i.flatIndex
6136
6154
  );
6137
6155
  }
@@ -6145,17 +6163,17 @@ class Ye {
6145
6163
  0.05 + g + c * e.flatIndex
6146
6164
  ];
6147
6165
  {
6148
- const p = t.distance ? parseInt(t.distance) : this.context.getOptions().links.distance;
6149
- if (isNaN(p))
6166
+ const m = t.distance ? parseInt(t.distance) : this.context.getOptions().links.distance;
6167
+ if (isNaN(m))
6150
6168
  O.error("Link's distance must be a Numeric");
6151
6169
  else {
6152
- const m = s - d - p, u = r + d + p, x = [
6153
- Math.min(m, u),
6170
+ const p = s - d - m, u = r + d + m, y = [
6171
+ Math.min(p, u),
6154
6172
  g + c * e.flatIndex
6155
6173
  ];
6156
- l.push(...x);
6157
- const w = c * e.flatIndex + h + (e.flatIndex <= i.flatIndex ? c : 0);
6158
- l.push(x[0], w), l.push(u, w), l.push(u, g + c * i.flatIndex);
6174
+ l.push(...y);
6175
+ const x = c * e.flatIndex + h + (e.flatIndex <= i.flatIndex ? c : 0);
6176
+ l.push(y[0], x), l.push(u, x), l.push(u, g + c * i.flatIndex);
6159
6177
  }
6160
6178
  }
6161
6179
  return l.push(r + d, g + c * i.flatIndex), l;
@@ -6164,16 +6182,16 @@ class Ye {
6164
6182
  * 处理连线被点击后的移动
6165
6183
  */
6166
6184
  handleDrag(t, e, i, s, n) {
6167
- var x, w, T;
6185
+ var y, x, T;
6168
6186
  if (!this.isDragging || this.context.getOptions().links.move.enabled !== !0) return;
6169
6187
  this.stage.container().style.cursor = "pointer";
6170
6188
  const o = this.linksGroup.findOne(`#${n}`);
6171
6189
  this.templateArrow.setAttrs({
6172
6190
  stroke: e.color || this.context.getOptions().links.color || this.context.getOptions().primaryColor,
6173
6191
  strokeWidth: e.width ?? this.context.getOptions().links.width,
6174
- pointerLength: ((x = e.arrow) == null ? void 0 : x.height) ?? this.context.getOptions().links.arrow.height,
6192
+ pointerLength: ((y = e.arrow) == null ? void 0 : y.height) ?? this.context.getOptions().links.arrow.height,
6175
6193
  // 箭头长度
6176
- pointerWidth: ((w = e.arrow) == null ? void 0 : w.width) ?? this.context.getOptions().links.arrow.width,
6194
+ pointerWidth: ((x = e.arrow) == null ? void 0 : x.width) ?? this.context.getOptions().links.arrow.width,
6177
6195
  // 箭头宽度
6178
6196
  fill: ((T = e.arrow) == null ? void 0 : T.color) || this.context.getOptions().links.arrow.color || e.color || this.context.getOptions().links.color || this.context.getOptions().primaryColor,
6179
6197
  // 箭头填充色
@@ -6183,17 +6201,17 @@ class Ye {
6183
6201
  let r = null;
6184
6202
  const h = this.context.getOptions().header.height, c = this.context.getOptions().row.height, g = c / 2 + h, d = e.gap || this.context.getOptions().links.gap;
6185
6203
  let l = null;
6186
- const p = () => {
6204
+ const m = () => {
6187
6205
  const b = this.stage.getPointerPosition();
6188
6206
  if (b && (l = this.getTaskByPosition(b), !!l && (this.templateArrow.visible(!0), o == null || o.visible(!1), l != null && l.startTime && (l != null && l.endTime)))) {
6189
- const y = this.context.store.getTimeAxis().getTimeLeft(l.startTime), k = this.context.store.getTimeAxis().getTimeLeft(l.endTime), E = (k + y) / 2 + this.offsetX;
6190
- let L = y - d;
6191
- b.x <= E ? r = "S" : (r = "F", L = k + d);
6207
+ const w = this.context.store.getTimeAxis().getTimeLeft(l.startTime), C = this.context.store.getTimeAxis().getTimeLeft(l.endTime), E = (C + w) / 2 + this.offsetX;
6208
+ let k = w - d;
6209
+ b.x <= E ? r = "S" : (r = "F", k = C + d);
6192
6210
  let v;
6193
6211
  if (i === "S" ? v = `${r}${(e.type || "FS")[1]}` : v = `${(e.type || "FS")[0]}${r}`, i === "S") {
6194
6212
  const { allowLeft: M, allowRight: A } = this.isAllowStartDrop(l, e.to, v);
6195
6213
  this.templateArrow.points([
6196
- L,
6214
+ k,
6197
6215
  g + c * l.flatIndex,
6198
6216
  ...s
6199
6217
  ]), A ? this.stage.container().style.cursor = "pointer" : this.stage.container().style.cursor = "not-allowed";
@@ -6201,26 +6219,26 @@ class Ye {
6201
6219
  const { allowLeft: M, allowRight: A } = this.isAllowEndDrop(l, e.from, v);
6202
6220
  this.templateArrow.points([
6203
6221
  ...s,
6204
- L,
6222
+ k,
6205
6223
  g + c * l.flatIndex
6206
6224
  ]), M ? this.stage.container().style.cursor = "pointer" : this.stage.container().style.cursor = "not-allowed";
6207
6225
  }
6208
6226
  }
6209
- }, m = () => {
6210
- var k, E;
6227
+ }, p = () => {
6228
+ var C, E;
6211
6229
  let b;
6212
- const y = J(e);
6213
- if (r && l && (i === "S" ? (b = `${r}${(e.type || "FS")[1]}`, y.from = l.id) : i === "F" && (b = `${(e.type || "FS")[0]}${r}`, y.to = l.id)), b && l) {
6214
- y.type = b;
6215
- let L = !1, v = !1;
6216
- i === "S" ? { allowLeft: L, allowRight: v } = this.isAllowStartDrop(l, y.to, y.type, !0) : i === "F" && ({ allowLeft: L, allowRight: v } = this.isAllowEndDrop(l, y.from, y.type, !0)), ((k = y.type) == null ? void 0 : k.slice(1)) === "S" && L || ((E = y.type) == null ? void 0 : E.slice(1)) === "F" && v ? (this.context.event.emit(C.UPDATE_LINK, y), this.context.store.getLinkManager().update()) : this.context.event.emit(C.ERROR, Y.LINK_NOT_ALLOWED);
6230
+ const w = Z(e);
6231
+ if (r && l && (i === "S" ? (b = `${r}${(e.type || "FS")[1]}`, w.from = l.id) : i === "F" && (b = `${(e.type || "FS")[0]}${r}`, w.to = l.id)), b && l) {
6232
+ w.type = b;
6233
+ let k = !1, v = !1, M;
6234
+ i === "S" ? { allowLeft: k, allowRight: v, reason: M } = this.isAllowStartDrop(l, w.to, w.type, !0) : i === "F" && ({ allowLeft: k, allowRight: v, reason: M } = this.isAllowEndDrop(l, w.from, w.type, !0)), ((C = w.type) == null ? void 0 : C.slice(1)) === "S" && k || ((E = w.type) == null ? void 0 : E.slice(1)) === "F" && v ? (this.context.event.emit(L.UPDATE_LINK, w), this.context.store.getLinkManager().update(), this.calculateLinks()) : this.context.event.emit(L.ERROR, M || Y.LINK_NOT_ALLOWED);
6217
6235
  } else
6218
- this.context.event.emit(C.ERROR, Y.TASK_NOT_FOUND);
6219
- this.cleanupTempLink(), this.calculateLinks(l || void 0), document.removeEventListener("mousemove", p), document.removeEventListener("mouseup", m);
6236
+ this.context.event.emit(L.ERROR, Y.TASK_NOT_FOUND);
6237
+ this.cleanupTempLink(), this.calculateLinks([l, this.context.store.getDataManager().getTaskById(e.from), this.context.store.getDataManager().getTaskById(e.to)].filter((k) => !!k)), document.removeEventListener("mousemove", m), document.removeEventListener("mouseup", p);
6220
6238
  }, u = (b) => {
6221
- b.key === "Escape" && (this.cleanupTempLink(), o == null || o.visible(!0), document.removeEventListener("mousemove", p), document.removeEventListener("mouseup", m), document.removeEventListener("keydown", u));
6239
+ b.key === "Escape" && (this.cleanupTempLink(), o == null || o.visible(!0), document.removeEventListener("mousemove", m), document.removeEventListener("mouseup", p), document.removeEventListener("keydown", u));
6222
6240
  };
6223
- document.addEventListener("mousemove", p), document.addEventListener("mouseup", m), document.addEventListener("keydown", u);
6241
+ document.addEventListener("mousemove", m), document.addEventListener("mouseup", p), document.addEventListener("keydown", u);
6224
6242
  }
6225
6243
  /**
6226
6244
  * 处理连线被点击后的移动
@@ -6241,43 +6259,40 @@ class Ye {
6241
6259
  let r = null;
6242
6260
  const h = this.context.getOptions().header.height, c = this.context.getOptions().row.height, g = c / 2 + h, d = this.context.getOptions().links.gap;
6243
6261
  let l = null;
6244
- const p = () => {
6245
- const x = this.stage.getPointerPosition();
6246
- if (x && (l = this.getTaskByPosition(x), !!l && (this.templateArrow.visible(!0), l.startTime && l.endTime))) {
6247
- const w = this.context.store.getTimeAxis().getTimeLeft(l.startTime), T = this.context.store.getTimeAxis().getTimeLeft(l.endTime), b = (T + w) / 2 + this.offsetX;
6248
- let y = w - d;
6249
- x.x <= b ? r = "S" : (r = "F", y = T + d), this.templateArrow.points([
6262
+ const m = () => {
6263
+ const y = this.stage.getPointerPosition();
6264
+ if (y && (l = this.getTaskByPosition(y), !!l && (this.templateArrow.visible(!0), l.startTime && l.endTime))) {
6265
+ const x = this.context.store.getTimeAxis().getTimeLeft(l.startTime), T = this.context.store.getTimeAxis().getTimeLeft(l.endTime), b = (T + x) / 2 + this.offsetX;
6266
+ let w = x - d;
6267
+ y.x <= b ? r = "S" : (r = "F", w = T + d), this.templateArrow.points([
6250
6268
  ...s,
6251
- y,
6269
+ w,
6252
6270
  g + c * l.flatIndex
6253
6271
  ]);
6254
- const { allowLeft: k, allowRight: E } = this.isAllowEndDrop(l, n, o.convertPointsToLinkType(e, r));
6255
- r === "S" && !k ? this.stage.container().style.cursor = "not-allowed" : r === "F" && !E ? this.stage.container().style.cursor = "not-allowed" : this.stage.container().style.cursor = "pointer";
6272
+ const { allowLeft: C, allowRight: E } = this.isAllowEndDrop(l, n, o.convertPointsToLinkType(e, r));
6273
+ r === "S" && !C ? this.stage.container().style.cursor = "not-allowed" : r === "F" && !E ? this.stage.container().style.cursor = "not-allowed" : this.stage.container().style.cursor = "pointer";
6256
6274
  }
6257
- }, m = () => {
6258
- let x;
6259
- if (r && (x = o.convertPointsToLinkType(e, r)), x && l)
6260
- if (o.isLinkExist(n, l.id, x))
6261
- this.context.event.emit(C.ERROR, Y.LINK_EXIST);
6275
+ }, p = () => {
6276
+ let y;
6277
+ if (r && (y = o.convertPointsToLinkType(e, r)), y && l)
6278
+ if (o.isLinkExist(n, l.id, y))
6279
+ this.context.event.emit(L.ERROR, Y.LINK_EXIST);
6262
6280
  else if (n === l.id && e === r)
6263
- this.context.event.emit(C.ERROR, Y.LINK_SAME);
6281
+ this.context.event.emit(L.ERROR, Y.LINK_SAME);
6264
6282
  else {
6265
- const { allowLeft: w, allowRight: T } = this.isAllowEndDrop(l, n, x, !0);
6266
- r === "S" && w || r === "F" && T ? (this.context.event.emit(C.CREATE_LINK, {
6283
+ const { allowLeft: x, allowRight: T, reason: b } = this.isAllowEndDrop(l, n, y, !0);
6284
+ r === "S" && x || r === "F" && T ? (this.context.event.emit(L.CREATE_LINK, {
6267
6285
  from: n,
6268
6286
  to: l.id,
6269
- type: x,
6287
+ type: y,
6270
6288
  color: i
6271
- }), this.context.store.getLinkManager().update()) : this.context.event.emit(
6272
- C.ERROR,
6273
- Y.LINK_NOT_ALLOWED
6274
- );
6289
+ }), this.context.store.getLinkManager().update()) : this.context.event.emit(L.ERROR, b || Y.LINK_NOT_ALLOWED);
6275
6290
  }
6276
- this.cleanupTempLink(), this.calculateLinks(l || void 0), document.removeEventListener("mousemove", p), document.removeEventListener("mouseup", m);
6277
- }, u = (x) => {
6278
- x.key === "Escape" && (this.cleanupTempLink(), document.removeEventListener("mousemove", p), document.removeEventListener("mouseup", m), document.removeEventListener("keydown", u));
6291
+ this.cleanupTempLink(), this.calculateLinks([l].filter((x) => !!x)), document.removeEventListener("mousemove", m), document.removeEventListener("mouseup", p);
6292
+ }, u = (y) => {
6293
+ y.key === "Escape" && (this.cleanupTempLink(), document.removeEventListener("mousemove", m), document.removeEventListener("mouseup", p), document.removeEventListener("keydown", u));
6279
6294
  };
6280
- document.addEventListener("mousemove", p), document.addEventListener("mouseup", m), document.addEventListener("keydown", u);
6295
+ document.addEventListener("mousemove", m), document.addEventListener("mouseup", p), document.addEventListener("keydown", u);
6281
6296
  }
6282
6297
  /**
6283
6298
  * 清理临时连线状态
@@ -6307,8 +6322,9 @@ class Ye {
6307
6322
  )), ht(r) ? n = o = r : V(r) && (n = r === "S", o = r === "F");
6308
6323
  const h = this.validateChain(t.id, e, i, s);
6309
6324
  return {
6310
- allowLeft: n && h,
6311
- allowRight: o && h
6325
+ allowLeft: n && h.ok,
6326
+ allowRight: o && h.ok,
6327
+ reason: h.reason
6312
6328
  };
6313
6329
  }
6314
6330
  /**
@@ -6322,16 +6338,17 @@ class Ye {
6322
6338
  )), ht(r) ? n = o = r : V(r) && (n = r === "S", o = r === "F");
6323
6339
  const h = this.validateChain(e, t.id, i, s);
6324
6340
  return {
6325
- allowLeft: n && h,
6326
- allowRight: o && h
6341
+ allowLeft: n && h.ok,
6342
+ allowRight: o && h.ok,
6343
+ reason: h.reason
6327
6344
  };
6328
6345
  }
6329
6346
  /**
6330
6347
  * 校验连线创建是否合法
6331
6348
  */
6332
6349
  validateChain(t, e, i, s = !1) {
6333
- const o = this.context.store.getLinkManager().validateLink({ from: t, to: e, type: i });
6334
- return o.ok ? !0 : (s && o.reason === Y.LINK_CYCLE && o.cycleInfo && this.highlightCycleNodes(o.cycleInfo.nodes), this.context.event.emit(C.ERROR, o.reason), !1);
6350
+ const o = this.context.store.getLinkManager().validateChain(t, e, i);
6351
+ return o.ok ? { ok: !0 } : (s && o.reason === Y.LINK_CYCLE && o.cycleInfo && this.highlightCycleNodes(o.cycleInfo.nodes), { ok: !1, reason: o.reason });
6335
6352
  }
6336
6353
  /**
6337
6354
  * 操作高亮关联线
@@ -6381,7 +6398,7 @@ class Ye {
6381
6398
  */
6382
6399
  highlightCycleNodes(t) {
6383
6400
  t.forEach((e) => {
6384
- this.context.event.emit(C.SLIDER_BLINK, e);
6401
+ this.context.event.emit(L.SLIDER_BLINK, e);
6385
6402
  });
6386
6403
  }
6387
6404
  }
@@ -6449,61 +6466,61 @@ class Ue {
6449
6466
  ), g = this.context.getOptions().baselines.offset ?? 0;
6450
6467
  h.forEach((d, l) => {
6451
6468
  if (!d.validate()) return;
6452
- const p = this.context.store.getTimeAxis().getTimeLeft(d.startTime), m = this.context.store.getTimeAxis().getTimeLeft(d.endTime), u = new S.Group({ id: `baseline-group-${d.id}` });
6453
- this.renderBaselineBar(u, r, d, p, m, i, e, c, t, o, n, s, g);
6454
- const x = this.context.getOptions().baselines.compare, w = d.getTimeDiff();
6455
- if (!x.enabled || !w) return;
6456
- const T = x.mode;
6457
- d.highlight && (T === "highlight" || T === "both") && this.renderCompareHighlight(u, r, d, w), l === 0 && (T === "indicator" || T === "both") && this.renderCompareIndicator(r, d, w), this.bindEvents(u, r, d), this.baselineGroup.add(u);
6469
+ const m = this.context.store.getTimeAxis().getTimeLeft(d.startTime), p = this.context.store.getTimeAxis().getTimeLeft(d.endTime), u = new S.Group({ id: `baseline-group-${d.id}` });
6470
+ this.renderBaselineBar(u, r, d, m, p, i, e, c, t, o, n, s, g), this.baselineGroup.add(u);
6471
+ const y = this.context.getOptions().baselines.compare, x = d.getTimeDiff();
6472
+ if (!y.enabled || !x) return;
6473
+ const T = y.mode;
6474
+ d.highlight && (T === "highlight" || T === "both") && this.renderCompareHighlight(u, r, d, x), l === 0 && (T === "indicator" || T === "both") && this.renderCompareIndicator(r, d, x), this.bindEvents(u, r, d);
6458
6475
  });
6459
6476
  }
6460
6477
  });
6461
6478
  }
6462
- renderBaselineBar(t, e, i, s, n, o, r, h, c, g, d, l, p) {
6479
+ renderBaselineBar(t, e, i, s, n, o, r, h, c, g, d, l, m) {
6463
6480
  if (this.context.getOptions().baselines.mode === "shadow") {
6464
- const m = o + r * e.flatIndex - h / 2 + p, u = new S.Rect({
6481
+ const p = o + r * e.flatIndex - h / 2 + m, u = new S.Rect({
6465
6482
  id: `baseline-item-${i.id}`,
6466
6483
  x: s,
6467
- y: m,
6484
+ y: p,
6468
6485
  width: n - s,
6469
6486
  height: h,
6470
6487
  cornerRadius: l,
6471
6488
  fill: g,
6472
6489
  opacity: d
6473
6490
  });
6474
- t.add(u), this.renderText(t, e, i, s, n, m, h);
6491
+ t.add(u), this.renderText(t, e, i, s, n, p, h);
6475
6492
  } else if (this.context.getOptions().baselines.mode === "line") {
6476
- const m = nt(this.context.getOptions().baselines.height ?? 5, r);
6477
- let u = c + r * e.flatIndex + p;
6478
- const x = this.context.getOptions().baselines.position;
6479
- let w = "";
6480
- x === "top" ? (u += +m / 2, w = "line_top") : x === "center" ? (u += r / 2, w = "line_center") : (u += r - m / 2, w = "line_bottom");
6493
+ const p = nt(this.context.getOptions().baselines.height ?? 5, r);
6494
+ let u = c + r * e.flatIndex + m;
6495
+ const y = this.context.getOptions().baselines.position;
6496
+ let x = "";
6497
+ y === "top" ? (u += +p / 2, x = "line_top") : y === "center" ? (u += r / 2, x = "line_center") : (u += r - p / 2, x = "line_bottom");
6481
6498
  const T = new S.Line({
6482
6499
  id: `baseline-item-${i.id}`,
6483
6500
  points: [s, u, n, u],
6484
6501
  stroke: g,
6485
6502
  opacity: d,
6486
- strokeWidth: m,
6503
+ strokeWidth: p,
6487
6504
  lineCap: "butt",
6488
6505
  lineJoin: "round"
6489
6506
  });
6490
- t.add(T), this.renderText(t, e, i, s, n, u, m, w);
6507
+ t.add(T), this.renderText(t, e, i, s, n, u, p, x);
6491
6508
  }
6492
6509
  }
6493
6510
  renderText(t, e, i, s, n, o, r, h) {
6494
6511
  const c = `chart-baseline-text-${i.id}`;
6495
6512
  if ((() => {
6496
- this.baselineGroup.find(`#${c}`) && this.baselineGroup.find(`#${c}`).forEach((w) => w.remove());
6513
+ this.baselineGroup.find(`#${c}`) && this.baselineGroup.find(`#${c}`).forEach((x) => x.remove());
6497
6514
  })(), !this.context.getOptions().baselines.label.show) return;
6498
6515
  const d = this.context.getOptions().baselines.label.field, l = d ? i.getField(d) : i.name;
6499
6516
  if (!l || l === "") return;
6500
- const p = n - s - 10, m = Math.max(this.context.getOptions().baselines.label.fontSize, r), u = new S.Text({
6517
+ const m = n - s - 10, p = Math.max(this.context.getOptions().baselines.label.fontSize, r), u = new S.Text({
6501
6518
  text: l,
6502
6519
  id: c,
6503
6520
  x: s + 5,
6504
6521
  y: o,
6505
- width: p,
6506
- height: m,
6522
+ width: m,
6523
+ height: p,
6507
6524
  fill: this.context.getOptions().baselines.label.color,
6508
6525
  fontSize: this.context.getOptions().baselines.label.fontSize,
6509
6526
  fontFamily: this.context.getOptions().baselines.label.fontFamily || "Arial",
@@ -6511,19 +6528,19 @@ class Ue {
6511
6528
  verticalAlign: "bottom"
6512
6529
  });
6513
6530
  h === "line_bottom" ? u.setAttrs({
6514
- y: o - m / 2,
6531
+ y: o - p / 2,
6515
6532
  verticalAlign: "top"
6516
6533
  }) : h === "line_center" ? u.setAttrs({
6517
- y: o - m / 2,
6534
+ y: o - p / 2,
6518
6535
  verticalAlign: "middle"
6519
6536
  }) : h === "line_top" && u.setAttrs({
6520
6537
  y: o - r / 2,
6521
6538
  verticalAlign: "bottom"
6522
- }), r >= m && u.setAttrs({
6539
+ }), r >= p && u.setAttrs({
6523
6540
  verticalAlign: "middle"
6524
6541
  });
6525
- const x = u.measureSize(l);
6526
- (this.context.getOptions().baselines.label.forceDisplay || p > x.width) && t.add(u);
6542
+ const y = u.measureSize(l);
6543
+ (this.context.getOptions().baselines.label.forceDisplay || m > y.width) && t.add(u);
6527
6544
  }
6528
6545
  renderCompareHighlight(t, e, i, s) {
6529
6546
  const n = s[`${this.context.getOptions().baselines.compare.target}Status`];
@@ -6550,44 +6567,44 @@ class Ue {
6550
6567
  const g = this.context.store.getTimeAxis().getTimeLeft(t.startTime), d = this.context.store.getTimeAxis().getTimeLeft(t.endTime);
6551
6568
  let l = (r - h) / 2 + r * t.flatIndex + o;
6552
6569
  if (n.position === "bottom" && (l += h), n.show === "start" || n.show === "both" || n.show === !0) {
6553
- const p = i.startStatus;
6554
- if (p && s.compare.indicator[p].show) {
6555
- c = B(s.compare.indicator[p].color).alpha(s.compare.indicator[p].opacity).toHex();
6556
- const m = new S.Circle({
6570
+ const m = i.startStatus;
6571
+ if (m && s.compare.indicator[m].show) {
6572
+ c = B(s.compare.indicator[m].color).alpha(s.compare.indicator[m].opacity).toHex();
6573
+ const p = new S.Circle({
6557
6574
  x: g - n.size,
6558
6575
  y: l,
6559
6576
  fill: c,
6560
6577
  radius: n.size / 2
6561
6578
  });
6562
- this.indicatorGroup.add(m);
6563
- let u = `${gt(i.startDiff)}${i.unit} ${p}`;
6564
- const x = s.compare.indicator[p].text;
6565
- j(x) ? u = x(i.startDiff, { ...t.getEmitData(), baseline: e }) : V(x) && (u = x);
6566
- const w = new S.Text({
6579
+ this.indicatorGroup.add(p);
6580
+ let u = `${gt(i.startDiff)}${i.unit} ${m}`;
6581
+ const y = s.compare.indicator[m].text;
6582
+ j(y) ? u = y(i.startDiff, { ...t.getEmitData(), baseline: e }) : V(y) && (u = y);
6583
+ const x = new S.Text({
6567
6584
  y: l - n.fontSize / 2,
6568
6585
  text: u,
6569
6586
  fill: c,
6570
6587
  fontSize: n.fontSize,
6571
6588
  fontFamily: n.fontFamily || "Arial"
6572
- }), T = w.measureSize(u);
6573
- w.x(g - n.size - T.width - 5), this.indicatorGroup.add(w);
6589
+ }), T = x.measureSize(u);
6590
+ x.x(g - n.size - T.width - 5), this.indicatorGroup.add(x);
6574
6591
  }
6575
6592
  }
6576
6593
  if (n.show === "end" || n.show === "both" || n.show === !0) {
6577
- const p = i.endStatus;
6578
- if (p && s.compare.indicator[p].show) {
6579
- c = B(s.compare.indicator[p].color).alpha(s.compare.indicator[p].opacity).toHex();
6580
- const m = new S.Circle({
6594
+ const m = i.endStatus;
6595
+ if (m && s.compare.indicator[m].show) {
6596
+ c = B(s.compare.indicator[m].color).alpha(s.compare.indicator[m].opacity).toHex();
6597
+ const p = new S.Circle({
6581
6598
  x: d + n.size,
6582
6599
  y: l,
6583
6600
  fill: c,
6584
6601
  radius: n.size / 2
6585
6602
  });
6586
- this.indicatorGroup.add(m);
6587
- let u = `${gt(i.endDiff)}${i.unit} ${p}`;
6588
- const x = s.compare.indicator[p].text;
6589
- j(x) ? u = x(i.endDiff, { ...t.getEmitData(), baseline: e }) : V(x) && (u = x);
6590
- const w = new S.Text({
6603
+ this.indicatorGroup.add(p);
6604
+ let u = `${gt(i.endDiff)}${i.unit} ${m}`;
6605
+ const y = s.compare.indicator[m].text;
6606
+ j(y) ? u = y(i.endDiff, { ...t.getEmitData(), baseline: e }) : V(y) && (u = y);
6607
+ const x = new S.Text({
6591
6608
  x: d + n.size + 5,
6592
6609
  y: l - n.fontSize / 2,
6593
6610
  text: u,
@@ -6595,17 +6612,17 @@ class Ue {
6595
6612
  fontSize: n.fontSize,
6596
6613
  fontFamily: n.fontFamily || "Arial"
6597
6614
  });
6598
- this.indicatorGroup.add(w);
6615
+ this.indicatorGroup.add(x);
6599
6616
  }
6600
6617
  }
6601
6618
  }
6602
6619
  bindEvents(t, e, i) {
6603
6620
  t.on("mouseover", (s) => {
6604
- this.context.event.emit(C.BASELINE_MOUSEOVER, s.evt, e, i);
6621
+ this.context.event.emit(L.BASELINE_MOUSEOVER, s.evt, e, i);
6605
6622
  }), t.on("mouseout", (s) => {
6606
- this.context.event.emit(C.BASELINE_MOUSEOUT, s.evt, e, i);
6623
+ this.context.event.emit(L.BASELINE_MOUSEOUT, s.evt, e, i);
6607
6624
  }), t.on("click", (s) => {
6608
- s.cancelBubble = !0, s.evt.button === 0 ? this.context.event.emit(C.BASELINE_CLICK, s.evt, e, i) : s.evt.button === 2 && this.context.event.emit(C.BASELINE_CONTEXTMENU, s.evt, e, i);
6625
+ s.cancelBubble = !0, s.evt.button === 0 ? this.context.event.emit(L.BASELINE_CLICK, s.evt, e, i) : s.evt.button === 2 && this.context.event.emit(L.BASELINE_CONTEXTMENU, s.evt, e, i);
6609
6626
  });
6610
6627
  }
6611
6628
  }
@@ -6686,19 +6703,19 @@ class Ke {
6686
6703
  const c = s[s.length - 1].key;
6687
6704
  this.initialWidth = i.getColumnWidth(c);
6688
6705
  const g = this.initialX;
6689
- this.root.event.emit(C.SHOW_GUIDELINE, g);
6690
- const d = (p) => o(p), l = (p) => r(p, d, l);
6706
+ this.root.event.emit(L.SHOW_GUIDELINE, g);
6707
+ const d = (m) => o(m), l = (m) => r(m, d, l);
6691
6708
  document.addEventListener("mousemove", d), document.addEventListener("mouseup", l);
6692
6709
  }, o = (h) => {
6693
6710
  if (h.preventDefault(), !e) return;
6694
6711
  const c = h.clientX - t;
6695
6712
  s[s.length - 1].key;
6696
- const g = 50 - this.initialWidth, l = e.width - 20 - this.initialX, p = Math.max(g, Math.min(l, c)), m = this.initialX + p;
6697
- this.root.event.emit(C.MOVE_GUIDELINE, m);
6713
+ const g = 50 - this.initialWidth, l = e.width - 20 - this.initialX, m = Math.max(g, Math.min(l, c)), p = this.initialX + m;
6714
+ this.root.event.emit(L.MOVE_GUIDELINE, p);
6698
6715
  }, r = (h, c, g) => {
6699
- document.removeEventListener("mousemove", c), document.removeEventListener("mouseup", g), this.root.event.emit(C.HIDE_GUIDELINE);
6700
- const d = h.clientX - t, l = s[s.length - 1].key, p = Math.max(50, this.initialWidth + d);
6701
- i.setColumnWidth(l, p), this.root.event.emit(C.UPDATE_TABLE_HEADER);
6716
+ document.removeEventListener("mousemove", c), document.removeEventListener("mouseup", g), this.root.event.emit(L.HIDE_GUIDELINE);
6717
+ const d = h.clientX - t, l = s[s.length - 1].key, m = Math.max(50, this.initialWidth + d);
6718
+ i.setColumnWidth(l, m), this.root.event.emit(L.UPDATE_TABLE_HEADER);
6702
6719
  };
6703
6720
  this.line.addEventListener("mousedown", n);
6704
6721
  }
@@ -6729,11 +6746,11 @@ class je {
6729
6746
  * 初始化事件监听
6730
6747
  */
6731
6748
  initEvents() {
6732
- this.context.event.on(C.SHOW_GUIDELINE, (t) => {
6749
+ this.context.event.on(L.SHOW_GUIDELINE, (t) => {
6733
6750
  this.show(t);
6734
- }), this.context.event.on(C.HIDE_GUIDELINE, () => {
6751
+ }), this.context.event.on(L.HIDE_GUIDELINE, () => {
6735
6752
  this.hide();
6736
- }), this.context.event.on(C.MOVE_GUIDELINE, (t) => {
6753
+ }), this.context.event.on(L.MOVE_GUIDELINE, (t) => {
6737
6754
  this.setLeft(t);
6738
6755
  });
6739
6756
  }
@@ -6933,7 +6950,7 @@ class Qe {
6933
6950
  a(this, "middleLine");
6934
6951
  a(this, "renderScheduler");
6935
6952
  // 渲染调度器
6936
- a(this, "_id", Z());
6953
+ a(this, "_id", Q());
6937
6954
  // 尺寸和状态
6938
6955
  a(this, "width", 0);
6939
6956
  a(this, "height", 0);
@@ -7030,21 +7047,21 @@ class Qe {
7030
7047
  * 设置事件监听器
7031
7048
  */
7032
7049
  setupEventListeners() {
7033
- this.context.event.on(C.DATA_UPDATE, () => {
7050
+ this.context.event.on(L.DATA_UPDATE, () => {
7034
7051
  this.renderScheduler.scheduleTask("DATA_UPDATE", [!0]);
7035
- }), this.context.event.on(C.SCROLL, () => {
7052
+ }), this.context.event.on(L.SCROLL, () => {
7036
7053
  this.renderScheduler.scheduleTask("SCROLL", [!0], { immediate: !0 });
7037
- }), this.context.event.on(C.COLUMN_WIDTH_CHANGE, () => {
7054
+ }), this.context.event.on(L.COLUMN_WIDTH_CHANGE, () => {
7038
7055
  this.renderScheduler.scheduleTask("COLUMN_WIDTH_CHANGE");
7039
- }), this.context.event.on(C.VIEW_UPDATE, () => {
7056
+ }), this.context.event.on(L.VIEW_UPDATE, () => {
7040
7057
  this.renderScheduler.scheduleTask("VIEW_UPDATE", [!0]);
7041
- }), this.context.event.on(C.UPDATE_TASK, (t) => {
7058
+ }), this.context.event.on(L.UPDATE_TASK, (t) => {
7042
7059
  this.renderScheduler.scheduleTask("UPDATE_TASK", [t], {
7043
7060
  immediate: !0
7044
7061
  });
7045
- }), this.context.event.on(C.CHART_OFFSET_CHANGE, () => {
7062
+ }), this.context.event.on(L.CHART_OFFSET_CHANGE, () => {
7046
7063
  this.renderScheduler.scheduleTask("CHART_OFFSET_CHANGE", [!1]);
7047
- }), this.context.event.on(C.TOGGLE_COLLAPSE, () => {
7064
+ }), this.context.event.on(L.TOGGLE_COLLAPSE, () => {
7048
7065
  this.renderScheduler.scheduleTask("CHART_OFFSET_CHANGE", [!1], { immediate: !0 });
7049
7066
  });
7050
7067
  }
@@ -7055,7 +7072,7 @@ class Qe {
7055
7072
  performRender(t = !1, e = !1) {
7056
7073
  this.setStyleValue();
7057
7074
  const { x: i, y: s } = this.scrollbar.getScrollPosition(), n = this.context.store.getOptionManager().getOptions().row.height, o = this.context.store.getOptionManager().getOptions().header.height, r = Math.floor(s / n), h = Math.ceil((this.height - o) / n), c = 2, g = Math.max(0, r), d = h + c, l = this.context.store.getDataManager().getVisibleTasks().slice(g, g + d);
7058
- this.updateSize(), e ? (this.table.refresh(s, l), this.chart.refresh(i, s, l, !0)) : t ? (this.table.refresh(s, l), this.chart.refresh(i, s, l)) : (this.table.render(s, l), this.chart.render(i, s, l)), this.isInitialized && (this.context.event.emit(C.LOADED), this.isInitialized = !1), O.debug("execute render");
7075
+ this.updateSize(), e ? (this.table.refresh(s, l), this.chart.refresh(i, s, l, !0)) : t ? (this.table.refresh(s, l), this.chart.refresh(i, s, l)) : (this.table.render(s, l), this.chart.render(i, s, l)), this.isInitialized && (this.context.event.emit(L.LOADED), this.isInitialized = !1), O.debug("execute render");
7059
7076
  }
7060
7077
  /**
7061
7078
  * 公共渲染方法,向后兼容
@@ -7081,7 +7098,7 @@ class Qe {
7081
7098
  }
7082
7099
  class Je {
7083
7100
  constructor(t, e, i) {
7084
- a(this, "_id", Z());
7101
+ a(this, "_id", Q());
7085
7102
  a(this, "store");
7086
7103
  a(this, "event", new jt());
7087
7104
  a(this, "renderer");
@@ -7117,7 +7134,7 @@ class Je {
7117
7134
  * @return {boolean} 是否成功跳转
7118
7135
  */
7119
7136
  jumpTo(t) {
7120
- const e = I(t);
7137
+ const e = G(t);
7121
7138
  if (!this.store.getTimeAxis().isInTimeAxis(e)) return !1;
7122
7139
  const i = this.store.getTimeAxis().getTimeLeft(e) - 100;
7123
7140
  return this.renderer.getScrollbar().scrollTo({ x: Math.max(i, 0) }), !0;
@@ -7140,11 +7157,11 @@ class Je {
7140
7157
  }
7141
7158
  // 注册对外事件
7142
7159
  registerEvents() {
7143
- this.event.on(C.ERROR, (t, e) => {
7160
+ this.event.on(L.ERROR, (t, e) => {
7144
7161
  this._emit("error", t, e);
7145
- }), this.event.on(C.LOADED, () => {
7162
+ }), this.event.on(L.LOADED, () => {
7146
7163
  this._emit("loaded");
7147
- }), this.event.on(C.TASK_DRAG_END, (t, e) => {
7164
+ }), this.event.on(L.TASK_DRAG_END, (t, e) => {
7148
7165
  this._emit(
7149
7166
  "move",
7150
7167
  e.map((i) => {
@@ -7155,47 +7172,47 @@ class Je {
7155
7172
  };
7156
7173
  })
7157
7174
  );
7158
- }), this.event.on(C.CHECK_TASK, (t, e) => {
7175
+ }), this.event.on(L.CHECK_TASK, (t, e) => {
7159
7176
  this._emit(
7160
7177
  "select",
7161
7178
  t.map((i) => i.data),
7162
7179
  e,
7163
7180
  this.store.getDataManager().getCheckedList().map((i) => i.data)
7164
7181
  );
7165
- }), this.event.on(C.UPDATE_LINK, (t) => {
7182
+ }), this.event.on(L.UPDATE_LINK, (t) => {
7166
7183
  this._emit("update:link", t);
7167
- }), this.event.on(C.CREATE_LINK, (t) => {
7184
+ }), this.event.on(L.CREATE_LINK, (t) => {
7168
7185
  this._emit("create:link", t);
7169
7186
  }), this.event.on(
7170
- C.SELECT_LINK,
7187
+ L.SELECT_LINK,
7171
7188
  (t, e, i) => {
7172
7189
  this._emit("select:link", t, e, i);
7173
7190
  }
7174
- ), this.event.on(C.CONTEXT_LINK, (t, e) => {
7191
+ ), this.event.on(L.CONTEXT_LINK, (t, e) => {
7175
7192
  this._emit("contextmenu:link", t, e);
7176
- }), this.event.on(C.ROW_CLICK, (t, e) => {
7193
+ }), this.event.on(L.ROW_CLICK, (t, e) => {
7177
7194
  this._emit("click:row", t, e.data);
7178
- }), this.event.on(C.ROW_DBL_CLICK, (t, e) => {
7195
+ }), this.event.on(L.ROW_DBL_CLICK, (t, e) => {
7179
7196
  this._emit("dblclick:row", t, e.data);
7180
- }), this.event.on(C.ROW_CONTEXTMENU, (t, e) => {
7197
+ }), this.event.on(L.ROW_CONTEXTMENU, (t, e) => {
7181
7198
  this._emit("contextmenu:row", t, e.data);
7182
- }), this.event.on(C.SLIDER_CLICK, (t, e) => {
7199
+ }), this.event.on(L.SLIDER_CLICK, (t, e) => {
7183
7200
  this._emit("click:slider", t, e.data);
7184
- }), this.event.on(C.SLIDER_DBL_CLICK, (t, e) => {
7201
+ }), this.event.on(L.SLIDER_DBL_CLICK, (t, e) => {
7185
7202
  this._emit("dblclick:slider", t, e.data);
7186
- }), this.event.on(C.SLIDER_CONTEXTMENU, (t, e) => {
7203
+ }), this.event.on(L.SLIDER_CONTEXTMENU, (t, e) => {
7187
7204
  this._emit("contextmenu:slider", t, e.data);
7188
- }), this.event.on(C.SLIDER_HOVER, (t, e) => {
7205
+ }), this.event.on(L.SLIDER_HOVER, (t, e) => {
7189
7206
  this._emit("hover:slider", t, e.data);
7190
- }), this.event.on(C.SLIDER_LEAVE, (t, e) => {
7207
+ }), this.event.on(L.SLIDER_LEAVE, (t, e) => {
7191
7208
  this._emit("leave:slider", t, e.data);
7192
- }), this.event.on(C.BASELINE_CLICK, (t, e, i) => {
7209
+ }), this.event.on(L.BASELINE_CLICK, (t, e, i) => {
7193
7210
  this._emit("click:baseline", t, e.data, i.data);
7194
- }), this.event.on(C.BASELINE_CONTEXTMENU, (t, e, i) => {
7211
+ }), this.event.on(L.BASELINE_CONTEXTMENU, (t, e, i) => {
7195
7212
  this._emit("contextmenu:baseline", t, e.data, i.data);
7196
- }), this.event.on(C.BASELINE_MOUSEOVER, (t, e, i) => {
7213
+ }), this.event.on(L.BASELINE_MOUSEOVER, (t, e, i) => {
7197
7214
  this._emit("hover:baseline", t, e.data, i.data);
7198
- }), this.event.on(C.BASELINE_MOUSEOUT, (t, e, i) => {
7215
+ }), this.event.on(L.BASELINE_MOUSEOUT, (t, e, i) => {
7199
7216
  this._emit("leave:baseline", t, e.data, i.data);
7200
7217
  });
7201
7218
  }
@@ -7483,6 +7500,6 @@ export {
7483
7500
  si as XGantt,
7484
7501
  B as colorjs,
7485
7502
  ai as dayjs,
7486
- Z as generateId,
7503
+ Q as generateId,
7487
7504
  ni as version
7488
7505
  };