iris-gantt 1.6.0 → 1.6.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,5 +1,5 @@
1
- import A, { useState as G, memo as Ir, forwardRef as wr, useCallback as Je, useEffect as ut, useRef as ft } from "react";
2
- import { Typography as br, Select as ke, InputNumber as at, Button as Pe, Popover as zr, Tooltip as nt, Input as pt, Space as er, Segmented as Br, Divider as tr, Form as je, Modal as At, DatePicker as Sr, ColorPicker as vr, Alert as Hr, Card as dr, List as Jt, Tag as Wr, Menu as Vr } from "antd";
1
+ import A, { useState as J, memo as Ir, forwardRef as wr, useCallback as Je, useEffect as ut, useRef as ft } from "react";
2
+ import { Typography as br, Select as Oe, InputNumber as at, Button as Pe, Popover as zr, Tooltip as nt, Input as pt, Space as er, Segmented as Br, Divider as tr, Form as je, Modal as At, DatePicker as Sr, ColorPicker as vr, Alert as Hr, Card as dr, List as Jt, Tag as Wr, Menu as Vr } from "antd";
3
3
  import { FontAwesomeIcon as Ee } from "@fortawesome/react-fontawesome";
4
4
  import { faChevronDown as cr, faPlus as ar, faGripVertical as Xr, faChevronRight as Ur, faTimesCircle as qr, faSearchMinus as Gr, faSearchPlus as Jr, faRotateLeft as jr, faFileCsv as Kr, faFileExcel as Zr, faFileCode as Qr, faFilePdf as en, faExclamationTriangle as tn, faLink as Tr, faTrash as Dr, faInfoCircle as rn, faEdit as nn, faCopy as an, faFlag as on, faTasks as sn, faFolder as ln } from "@fortawesome/free-solid-svg-icons";
5
5
  import Mr from "dayjs";
@@ -9,12 +9,12 @@ function dn() {
9
9
  if (ur) return Ft;
10
10
  ur = 1;
11
11
  var e = A, a = /* @__PURE__ */ Symbol.for("react.element"), n = /* @__PURE__ */ Symbol.for("react.fragment"), s = Object.prototype.hasOwnProperty, r = e.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner, c = { key: !0, ref: !0, __self: !0, __source: !0 };
12
- function b(u, d, p) {
13
- var h, v = {}, y = null, m = null;
14
- p !== void 0 && (y = "" + p), d.key !== void 0 && (y = "" + d.key), d.ref !== void 0 && (m = d.ref);
15
- for (h in d) s.call(d, h) && !c.hasOwnProperty(h) && (v[h] = d[h]);
16
- if (u && u.defaultProps) for (h in d = u.defaultProps, d) v[h] === void 0 && (v[h] = d[h]);
17
- return { $$typeof: a, type: u, key: y, ref: m, props: v, _owner: r.current };
12
+ function b(u, d, h) {
13
+ var p, S = {}, y = null, m = null;
14
+ h !== void 0 && (y = "" + h), d.key !== void 0 && (y = "" + d.key), d.ref !== void 0 && (m = d.ref);
15
+ for (p in d) s.call(d, p) && !c.hasOwnProperty(p) && (S[p] = d[p]);
16
+ if (u && u.defaultProps) for (p in d = u.defaultProps, d) S[p] === void 0 && (S[p] = d[p]);
17
+ return { $$typeof: a, type: u, key: y, ref: m, props: S, _owner: r.current };
18
18
  }
19
19
  return Ft.Fragment = n, Ft.jsx = b, Ft.jsxs = b, Ft;
20
20
  }
@@ -22,7 +22,7 @@ var Rt = {};
22
22
  var pr;
23
23
  function cn() {
24
24
  return pr || (pr = 1, process.env.NODE_ENV !== "production" && (function() {
25
- var e = A, a = /* @__PURE__ */ Symbol.for("react.element"), n = /* @__PURE__ */ Symbol.for("react.portal"), s = /* @__PURE__ */ Symbol.for("react.fragment"), r = /* @__PURE__ */ Symbol.for("react.strict_mode"), c = /* @__PURE__ */ Symbol.for("react.profiler"), b = /* @__PURE__ */ Symbol.for("react.provider"), u = /* @__PURE__ */ Symbol.for("react.context"), d = /* @__PURE__ */ Symbol.for("react.forward_ref"), p = /* @__PURE__ */ Symbol.for("react.suspense"), h = /* @__PURE__ */ Symbol.for("react.suspense_list"), v = /* @__PURE__ */ Symbol.for("react.memo"), y = /* @__PURE__ */ Symbol.for("react.lazy"), m = /* @__PURE__ */ Symbol.for("react.offscreen"), E = Symbol.iterator, F = "@@iterator";
25
+ var e = A, a = /* @__PURE__ */ Symbol.for("react.element"), n = /* @__PURE__ */ Symbol.for("react.portal"), s = /* @__PURE__ */ Symbol.for("react.fragment"), r = /* @__PURE__ */ Symbol.for("react.strict_mode"), c = /* @__PURE__ */ Symbol.for("react.profiler"), b = /* @__PURE__ */ Symbol.for("react.provider"), u = /* @__PURE__ */ Symbol.for("react.context"), d = /* @__PURE__ */ Symbol.for("react.forward_ref"), h = /* @__PURE__ */ Symbol.for("react.suspense"), p = /* @__PURE__ */ Symbol.for("react.suspense_list"), S = /* @__PURE__ */ Symbol.for("react.memo"), y = /* @__PURE__ */ Symbol.for("react.lazy"), m = /* @__PURE__ */ Symbol.for("react.offscreen"), E = Symbol.iterator, F = "@@iterator";
26
26
  function N(o) {
27
27
  if (o === null || typeof o != "object")
28
28
  return null;
@@ -30,7 +30,7 @@ function cn() {
30
30
  return typeof x == "function" ? x : null;
31
31
  }
32
32
  var M = e.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;
33
- function S(o) {
33
+ function v(o) {
34
34
  {
35
35
  for (var x = arguments.length, L = new Array(x > 1 ? x - 1 : 0), _ = 1; _ < x; _++)
36
36
  L[_ - 1] = arguments[_];
@@ -50,7 +50,7 @@ function cn() {
50
50
  var C = !1, Z = !1, W = !1, re = !1, le = !1, j;
51
51
  j = /* @__PURE__ */ Symbol.for("react.module.reference");
52
52
  function X(o) {
53
- return !!(typeof o == "string" || typeof o == "function" || o === s || o === c || le || o === r || o === p || o === h || re || o === m || C || Z || W || typeof o == "object" && o !== null && (o.$$typeof === y || o.$$typeof === v || o.$$typeof === b || o.$$typeof === u || o.$$typeof === d || // This needs to include all possible module reference object
53
+ return !!(typeof o == "string" || typeof o == "function" || o === s || o === c || le || o === r || o === h || o === p || re || o === m || C || Z || W || typeof o == "object" && o !== null && (o.$$typeof === y || o.$$typeof === S || o.$$typeof === b || o.$$typeof === u || o.$$typeof === d || // This needs to include all possible module reference object
54
54
  // types supported by any Flight configuration anywhere since
55
55
  // we don't know which Flight build this will end up being used
56
56
  // with.
@@ -63,13 +63,13 @@ function cn() {
63
63
  var te = x.displayName || x.name || "";
64
64
  return te !== "" ? L + "(" + te + ")" : L;
65
65
  }
66
- function O(o) {
66
+ function k(o) {
67
67
  return o.displayName || "Context";
68
68
  }
69
69
  function B(o) {
70
70
  if (o == null)
71
71
  return null;
72
- if (typeof o.tag == "number" && S("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."), typeof o == "function")
72
+ if (typeof o.tag == "number" && v("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."), typeof o == "function")
73
73
  return o.displayName || o.name || null;
74
74
  if (typeof o == "string")
75
75
  return o;
@@ -82,22 +82,22 @@ function cn() {
82
82
  return "Profiler";
83
83
  case r:
84
84
  return "StrictMode";
85
- case p:
86
- return "Suspense";
87
85
  case h:
86
+ return "Suspense";
87
+ case p:
88
88
  return "SuspenseList";
89
89
  }
90
90
  if (typeof o == "object")
91
91
  switch (o.$$typeof) {
92
92
  case u:
93
93
  var x = o;
94
- return O(x) + ".Consumer";
94
+ return k(x) + ".Consumer";
95
95
  case b:
96
96
  var L = o;
97
- return O(L._context) + ".Provider";
97
+ return k(L._context) + ".Provider";
98
98
  case d:
99
99
  return R(o, o.render, "ForwardRef");
100
- case v:
100
+ case S:
101
101
  var _ = o.displayName || null;
102
102
  return _ !== null ? _ : B(o.type) || "Memo";
103
103
  case y: {
@@ -111,13 +111,13 @@ function cn() {
111
111
  }
112
112
  return null;
113
113
  }
114
- var Y = Object.assign, k = 0, De, Se, V, I, ne, de, se;
114
+ var Y = Object.assign, O = 0, De, Se, V, I, ne, de, se;
115
115
  function ue() {
116
116
  }
117
117
  ue.__reactDisabledLog = !0;
118
118
  function z() {
119
119
  {
120
- if (k === 0) {
120
+ if (O === 0) {
121
121
  De = console.log, Se = console.info, V = console.warn, I = console.error, ne = console.group, de = console.groupCollapsed, se = console.groupEnd;
122
122
  var o = {
123
123
  configurable: !0,
@@ -135,12 +135,12 @@ function cn() {
135
135
  groupEnd: o
136
136
  });
137
137
  }
138
- k++;
138
+ O++;
139
139
  }
140
140
  }
141
141
  function ye() {
142
142
  {
143
- if (k--, k === 0) {
143
+ if (O--, O === 0) {
144
144
  var o = {
145
145
  configurable: !0,
146
146
  enumerable: !0,
@@ -170,7 +170,7 @@ function cn() {
170
170
  })
171
171
  });
172
172
  }
173
- k < 0 && S("disabledDepth fell below zero. This is a bug in React. Please file an issue.");
173
+ O < 0 && v("disabledDepth fell below zero. This is a bug in React. Please file an issue.");
174
174
  }
175
175
  }
176
176
  var Le = M.ReactCurrentDispatcher, Ie;
@@ -187,16 +187,16 @@ function cn() {
187
187
  ` + Ie + o;
188
188
  }
189
189
  }
190
- var $ = !1, J;
190
+ var $ = !1, q;
191
191
  {
192
192
  var xe = typeof WeakMap == "function" ? WeakMap : Map;
193
- J = new xe();
193
+ q = new xe();
194
194
  }
195
195
  function Qe(o, x) {
196
196
  if (!o || $)
197
197
  return "";
198
198
  {
199
- var L = J.get(o);
199
+ var L = q.get(o);
200
200
  if (L !== void 0)
201
201
  return L;
202
202
  }
@@ -251,7 +251,7 @@ function cn() {
251
251
  if (we--, be--, be < 0 || K[we] !== Re[be]) {
252
252
  var Be = `
253
253
  ` + K[we].replace(" at new ", " at ");
254
- return o.displayName && Be.includes("<anonymous>") && (Be = Be.replace("<anonymous>", o.displayName)), typeof o == "function" && J.set(o, Be), Be;
254
+ return o.displayName && Be.includes("<anonymous>") && (Be = Be.replace("<anonymous>", o.displayName)), typeof o == "function" && q.set(o, Be), Be;
255
255
  }
256
256
  while (we >= 1 && be >= 0);
257
257
  break;
@@ -261,7 +261,7 @@ function cn() {
261
261
  $ = !1, Le.current = oe, ye(), Error.prepareStackTrace = te;
262
262
  }
263
263
  var Ge = o ? o.displayName || o.name : "", Ze = Ge ? Ye(Ge) : "";
264
- return typeof o == "function" && J.set(o, Ze), Ze;
264
+ return typeof o == "function" && q.set(o, Ze), Ze;
265
265
  }
266
266
  function ce(o, x, L) {
267
267
  return Qe(o, !1);
@@ -278,16 +278,16 @@ function cn() {
278
278
  if (typeof o == "string")
279
279
  return Ye(o);
280
280
  switch (o) {
281
- case p:
282
- return Ye("Suspense");
283
281
  case h:
282
+ return Ye("Suspense");
283
+ case p:
284
284
  return Ye("SuspenseList");
285
285
  }
286
286
  if (typeof o == "object")
287
287
  switch (o.$$typeof) {
288
288
  case d:
289
289
  return ce(o.render);
290
- case v:
290
+ case S:
291
291
  return Fe(o.type, x, L);
292
292
  case y: {
293
293
  var _ = o, te = _._payload, oe = _._init;
@@ -322,12 +322,12 @@ function cn() {
322
322
  } catch (we) {
323
323
  K = we;
324
324
  }
325
- K && !(K instanceof Error) && (Xe(te), S("%s: type specification of %s `%s` is invalid; the type checker function must return `null` or an `Error` but returned a %s. You may have forgotten to pass an argument to the type checker creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and shape all require an argument).", _ || "React class", L, Q, typeof K), Xe(null)), K instanceof Error && !(K.message in et) && (et[K.message] = !0, Xe(te), S("Failed %s type: %s", L, K.message), Xe(null));
325
+ K && !(K instanceof Error) && (Xe(te), v("%s: type specification of %s `%s` is invalid; the type checker function must return `null` or an `Error` but returned a %s. You may have forgotten to pass an argument to the type checker creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and shape all require an argument).", _ || "React class", L, Q, typeof K), Xe(null)), K instanceof Error && !(K.message in et) && (et[K.message] = !0, Xe(te), v("Failed %s type: %s", L, K.message), Xe(null));
326
326
  }
327
327
  }
328
328
  }
329
329
  var ot = Array.isArray;
330
- function l(o) {
330
+ function i(o) {
331
331
  return ot(o);
332
332
  }
333
333
  function g(o) {
@@ -348,9 +348,9 @@ function cn() {
348
348
  }
349
349
  function U(o) {
350
350
  if (D(o))
351
- return S("The provided key is an unsupported type %s. This value must be coerced to a string before before using it here.", g(o)), f(o);
351
+ return v("The provided key is an unsupported type %s. This value must be coerced to a string before before using it here.", g(o)), f(o);
352
352
  }
353
- var q = M.ReactCurrentOwner, ee = {
353
+ var G = M.ReactCurrentOwner, ee = {
354
354
  key: !0,
355
355
  ref: !0,
356
356
  __self: !0,
@@ -373,12 +373,12 @@ function cn() {
373
373
  return o.key !== void 0;
374
374
  }
375
375
  function tt(o, x) {
376
- typeof o.ref == "string" && q.current;
376
+ typeof o.ref == "string" && G.current;
377
377
  }
378
378
  function Ke(o, x) {
379
379
  {
380
380
  var L = function() {
381
- ie || (ie = !0, S("%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://reactjs.org/link/special-props)", x));
381
+ ie || (ie = !0, v("%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://reactjs.org/link/special-props)", x));
382
382
  };
383
383
  L.isReactWarning = !0, Object.defineProperty(o, "key", {
384
384
  get: L,
@@ -389,7 +389,7 @@ function cn() {
389
389
  function st(o, x) {
390
390
  {
391
391
  var L = function() {
392
- $e || ($e = !0, S("%s: `ref` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://reactjs.org/link/special-props)", x));
392
+ $e || ($e = !0, v("%s: `ref` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://reactjs.org/link/special-props)", x));
393
393
  };
394
394
  L.isReactWarning = !0, Object.defineProperty(o, "ref", {
395
395
  get: L,
@@ -441,16 +441,16 @@ function cn() {
441
441
  var be = typeof o == "function" ? o.displayName || o.name || "Unknown" : o;
442
442
  K && Ke(Q, be), Re && st(Q, be);
443
443
  }
444
- return Ce(o, K, Re, te, _, q.current, Q);
444
+ return Ce(o, K, Re, te, _, G.current, Q);
445
445
  }
446
446
  }
447
- var xt = M.ReactCurrentOwner, Ot = M.ReactDebugCurrentFrame;
447
+ var xt = M.ReactCurrentOwner, kt = M.ReactDebugCurrentFrame;
448
448
  function qe(o) {
449
449
  if (o) {
450
450
  var x = o._owner, L = Fe(o.type, o._source, x ? x.type : null);
451
- Ot.setExtraStackFrame(L);
451
+ kt.setExtraStackFrame(L);
452
452
  } else
453
- Ot.setExtraStackFrame(null);
453
+ kt.setExtraStackFrame(null);
454
454
  }
455
455
  var it;
456
456
  it = !1;
@@ -485,7 +485,7 @@ Check the top-level render call using <` + L + ">.");
485
485
  return x;
486
486
  }
487
487
  }
488
- function kt(o, x) {
488
+ function Ot(o, x) {
489
489
  {
490
490
  if (!o._store || o._store.validated || o.key != null)
491
491
  return;
@@ -495,17 +495,17 @@ Check the top-level render call using <` + L + ">.");
495
495
  return;
496
496
  Dt[L] = !0;
497
497
  var _ = "";
498
- o && o._owner && o._owner !== xt.current && (_ = " It was passed a child from " + B(o._owner.type) + "."), qe(o), S('Each child in a list should have a unique "key" prop.%s%s See https://reactjs.org/link/warning-keys for more information.', L, _), qe(null);
498
+ o && o._owner && o._owner !== xt.current && (_ = " It was passed a child from " + B(o._owner.type) + "."), qe(o), v('Each child in a list should have a unique "key" prop.%s%s See https://reactjs.org/link/warning-keys for more information.', L, _), qe(null);
499
499
  }
500
500
  }
501
501
  function Et(o, x) {
502
502
  {
503
503
  if (typeof o != "object")
504
504
  return;
505
- if (l(o))
505
+ if (i(o))
506
506
  for (var L = 0; L < o.length; L++) {
507
507
  var _ = o[L];
508
- wt(_) && kt(_, x);
508
+ wt(_) && Ot(_, x);
509
509
  }
510
510
  else if (wt(o))
511
511
  o._store && (o._store.validated = !0);
@@ -513,7 +513,7 @@ Check the top-level render call using <` + L + ">.");
513
513
  var te = N(o);
514
514
  if (typeof te == "function" && te !== o.entries)
515
515
  for (var oe = te.call(o), Q; !(Q = oe.next()).done; )
516
- wt(Q.value) && kt(Q.value, x);
516
+ wt(Q.value) && Ot(Q.value, x);
517
517
  }
518
518
  }
519
519
  }
@@ -527,7 +527,7 @@ Check the top-level render call using <` + L + ">.");
527
527
  L = x.propTypes;
528
528
  else if (typeof x == "object" && (x.$$typeof === d || // Note: Memo only checks outer props here.
529
529
  // Inner props are checked in the reconciler.
530
- x.$$typeof === v))
530
+ x.$$typeof === S))
531
531
  L = x.propTypes;
532
532
  else
533
533
  return;
@@ -537,9 +537,9 @@ Check the top-level render call using <` + L + ">.");
537
537
  } else if (x.PropTypes !== void 0 && !it) {
538
538
  it = !0;
539
539
  var te = B(x);
540
- S("Component %s declared `PropTypes` instead of `propTypes`. Did you misspell the property assignment?", te || "Unknown");
540
+ v("Component %s declared `PropTypes` instead of `propTypes`. Did you misspell the property assignment?", te || "Unknown");
541
541
  }
542
- typeof x.getDefaultProps == "function" && !x.getDefaultProps.isReactClassApproved && S("getDefaultProps is only used on classic React.createClass definitions. Use a static property named `defaultProps` instead.");
542
+ typeof x.getDefaultProps == "function" && !x.getDefaultProps.isReactClassApproved && v("getDefaultProps is only used on classic React.createClass definitions. Use a static property named `defaultProps` instead.");
543
543
  }
544
544
  }
545
545
  function $t(o) {
@@ -547,11 +547,11 @@ Check the top-level render call using <` + L + ">.");
547
547
  for (var x = Object.keys(o.props), L = 0; L < x.length; L++) {
548
548
  var _ = x[L];
549
549
  if (_ !== "children" && _ !== "key") {
550
- qe(o), S("Invalid prop `%s` supplied to `React.Fragment`. React.Fragment can only have `key` and `children` props.", _), qe(null);
550
+ qe(o), v("Invalid prop `%s` supplied to `React.Fragment`. React.Fragment can only have `key` and `children` props.", _), qe(null);
551
551
  break;
552
552
  }
553
553
  }
554
- o.ref !== null && (qe(o), S("Invalid attribute `ref` supplied to `React.Fragment`."), qe(null));
554
+ o.ref !== null && (qe(o), v("Invalid attribute `ref` supplied to `React.Fragment`."), qe(null));
555
555
  }
556
556
  }
557
557
  var Bt = {};
@@ -564,7 +564,7 @@ Check the top-level render call using <` + L + ">.");
564
564
  var Re = zt();
565
565
  Re ? K += Re : K += Tt();
566
566
  var we;
567
- o === null ? we = "null" : l(o) ? we = "array" : o !== void 0 && o.$$typeof === a ? (we = "<" + (B(o.type) || "Unknown") + " />", K = " Did you accidentally export a JSX literal instead of a component?") : we = typeof o, S("React.jsx: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: %s.%s", we, K);
567
+ o === null ? we = "null" : i(o) ? we = "array" : o !== void 0 && o.$$typeof === a ? (we = "<" + (B(o.type) || "Unknown") + " />", K = " Did you accidentally export a JSX literal instead of a component?") : we = typeof o, v("React.jsx: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: %s.%s", we, K);
568
568
  }
569
569
  var be = ht(o, x, L, te, oe);
570
570
  if (be == null)
@@ -573,12 +573,12 @@ Check the top-level render call using <` + L + ">.");
573
573
  var Be = x.children;
574
574
  if (Be !== void 0)
575
575
  if (_)
576
- if (l(Be)) {
576
+ if (i(Be)) {
577
577
  for (var Ge = 0; Ge < Be.length; Ge++)
578
578
  Et(Be[Ge], o);
579
579
  Object.freeze && Object.freeze(Be);
580
580
  } else
581
- S("React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead.");
581
+ v("React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead.");
582
582
  else
583
583
  Et(Be, o);
584
584
  }
@@ -588,7 +588,7 @@ Check the top-level render call using <` + L + ">.");
588
588
  }), bt = Ne.length > 0 ? "{key: someKey, " + Ne.join(": ..., ") + ": ...}" : "{key: someKey}";
589
589
  if (!Bt[Ze + bt]) {
590
590
  var Xt = Ne.length > 0 ? "{" + Ne.join(": ..., ") + ": ...}" : "{}";
591
- S(`A props object containing a "key" prop is being spread into JSX:
591
+ v(`A props object containing a "key" prop is being spread into JSX:
592
592
  let props = %s;
593
593
  <%s {...props} />
594
594
  React keys must be passed directly to JSX without using spread:
@@ -643,7 +643,7 @@ const Te = (e, a, n) => {
643
643
  }, pn = (e, a) => {
644
644
  const n = a.getTime() - e.getTime();
645
645
  return Math.ceil(n / (1e3 * 60 * 60));
646
- }, Oe = (e, a) => {
646
+ }, ke = (e, a) => {
647
647
  const n = ["Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec"], s = ["January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December"], r = ["Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat"], c = {
648
648
  YYYY: e.getFullYear().toString(),
649
649
  YY: e.getFullYear().toString().slice(-2),
@@ -658,8 +658,8 @@ const Te = (e, a, n) => {
658
658
  H: String(e.getHours()),
659
659
  mm: String(e.getMinutes()).padStart(2, "0"),
660
660
  m: String(e.getMinutes())
661
- };
662
- return a.replace(/YYYY|YY|MMMM|MMM|MM|M|DD|D|dddd|HH|H|mm|m/g, (b) => c[b]);
661
+ }, b = /YYYY|YY|MMMM|MMM|MM|M|DD|D|dddd|HH|H|mm|m/g, u = [];
662
+ return a.replace(/\[([^\]]*)\]/g, (p, S) => (u.push(S), `${u.length - 1}`)).replace(b, (p) => c[p]).replace(/\uE000(\d+)\uE001/g, (p, S) => u[Number(S)]);
663
663
  }, Kt = (e) => {
664
664
  const a = e.getDay();
665
665
  return a === 0 || a === 6;
@@ -837,7 +837,7 @@ const jt = (e) => e ? {
837
837
  lineHeight: e.lineHeight || 1.5714285714285714,
838
838
  color: e.fontColor || "rgba(0, 0, 0, 0.88)"
839
839
  }
840
- } : {}, { Text: We, Paragraph: gn } = br, { Option: dt } = ke, yn = ({
840
+ } : {}, { Text: We, Paragraph: gn } = br, { Option: dt } = Oe, yn = ({
841
841
  task: e,
842
842
  allTasks: a,
843
843
  links: n,
@@ -847,8 +847,8 @@ const jt = (e) => e ? {
847
847
  children: b,
848
848
  styleConfig: u
849
849
  }) => {
850
- const d = jt(u), [p, h] = G(!1), [v, y] = G(null), [m, E] = G("e2s"), [F, N] = G("lag"), [M, S] = G(0), [w, C] = G(e.duration), [Z, W] = G(!0), re = "day", le = n.find((V) => V.target === e.id), j = !!le, X = A.useMemo(() => a.length === 0 ? /* @__PURE__ */ new Date() : new Date(Math.min(...a.map((V) => V.start.getTime()))), [a]), R = () => {
851
- if (v) {
850
+ const d = jt(u), [h, p] = J(!1), [S, y] = J(null), [m, E] = J("e2s"), [F, N] = J("lag"), [M, v] = J(0), [w, C] = J(e.duration), [Z, W] = J(!0), re = "day", le = n.find((V) => V.target === e.id), j = !!le, X = A.useMemo(() => a.length === 0 ? /* @__PURE__ */ new Date() : new Date(Math.min(...a.map((V) => V.start.getTime()))), [a]), R = () => {
851
+ if (S) {
852
852
  const V = F === "lag" ? M : -M, I = rr(V, re);
853
853
  if (w !== e.duration && c) {
854
854
  const ne = Te(new Date(e.start), w, "day");
@@ -858,28 +858,28 @@ const jt = (e) => e ? {
858
858
  end: ne
859
859
  });
860
860
  }
861
- s(v, e.id, m, I), h(!1), O();
861
+ s(S, e.id, m, I), p(!1), k();
862
862
  }
863
- }, O = () => {
864
- y(null), E("e2s"), N("lag"), S(0), C(e.duration);
863
+ }, k = () => {
864
+ y(null), E("e2s"), N("lag"), v(0), C(e.duration);
865
865
  }, B = () => {
866
- le && r && (r(le.id), h(!1), O());
866
+ le && r && (r(le.id), p(!1), k());
867
867
  }, Y = (V) => {
868
- if (h(V), V) {
868
+ if (p(V), V) {
869
869
  if (W(!0), le) {
870
870
  y(le.source), E(le.type);
871
871
  const I = le.lag || 0;
872
- I >= 0 ? (N("lag"), S(I)) : (N("lead"), S(Math.abs(I)));
872
+ I >= 0 ? (N("lag"), v(I)) : (N("lead"), v(Math.abs(I)));
873
873
  } else
874
- O();
874
+ k();
875
875
  C(e.duration);
876
876
  }
877
- }, k = () => {
877
+ }, O = () => {
878
878
  if (!Z) return null;
879
879
  const V = m === "e2s", I = m === "s2s", ne = m === "e2e", de = m === "s2e";
880
880
  let se = 0, ue = 0, z = "", ye = 0, Le = -1;
881
881
  V ? (se = 50, ue = 350, ye = 250, Le = 350, z = "M 250 60 L 300 60 L 300 140 L 348 140") : ne ? (se = 100, ue = 100, ye = 300, Le = -1, z = "M 300 60 L 350 60 L 350 140 L 302 140") : I ? (se = 250, ue = 250, ye = 250, Le = -1, z = "M 250 60 L 200 60 L 200 140 L 248 140") : de && (se = 350, ue = 50, ye = 350, Le = 250, z = "M 350 60 L 300 60 L 300 140 L 252 140");
882
- const Ie = v === "gantt-start-date", Ye = a.find(($) => $.id === v);
882
+ const Ie = S === "gantt-start-date", Ye = a.find(($) => $.id === S);
883
883
  return /* @__PURE__ */ t.jsx("div", { style: {
884
884
  width: "100%",
885
885
  height: 90,
@@ -904,8 +904,8 @@ const jt = (e) => e ? {
904
904
  /* @__PURE__ */ t.jsx("path", { d: z, fill: "none", stroke: "#8c8c8c", strokeWidth: "2.5", markerEnd: "url(#arrowhead)" })
905
905
  ] }) });
906
906
  }, De = () => {
907
- const V = v === "gantt-start-date", I = a.find((ue) => ue.id === v);
908
- if (!v) return "Select a checklist from the list to see how it will relate to the current stage.";
907
+ const V = S === "gantt-start-date", I = a.find((ue) => ue.id === S);
908
+ if (!S) return "Select a checklist from the list to see how it will relate to the current stage.";
909
909
  const ne = a.indexOf(e) + 1, de = V ? "Start Date" : `Stage ${a.indexOf(I) + 1}`;
910
910
  let se = "";
911
911
  switch (m) {
@@ -938,11 +938,11 @@ const jt = (e) => e ? {
938
938
  /* @__PURE__ */ t.jsx(We, { strong: !0, style: { fontSize: "16px", display: "block", marginBottom: 16, color: d.font?.color }, children: "Add Dependency" }),
939
939
  /* @__PURE__ */ t.jsxs("div", { style: { display: "flex", gap: 12, marginBottom: 14 }, children: [
940
940
  /* @__PURE__ */ t.jsx("div", { style: { flex: 1 }, children: /* @__PURE__ */ t.jsxs(
941
- ke,
941
+ Oe,
942
942
  {
943
943
  showSearch: !0,
944
944
  placeholder: "Select checklist",
945
- value: v,
945
+ value: S,
946
946
  onChange: y,
947
947
  style: { width: "100%" },
948
948
  filterOption: (V, I) => {
@@ -963,18 +963,18 @@ const jt = (e) => e ? {
963
963
  ] }),
964
964
  /* @__PURE__ */ t.jsxs(We, { type: "secondary", style: { fontSize: "11px" }, children: [
965
965
  "Start: ",
966
- Oe(V.start, "MMM D, YYYY")
966
+ ke(V.start, "MMM D, YYYY")
967
967
  ] })
968
968
  ] }) }, V.id)),
969
969
  /* @__PURE__ */ t.jsx(dt, { value: "gantt-start-date", label: "Start Date", children: /* @__PURE__ */ t.jsxs("div", { style: { display: "flex", flexDirection: "column", padding: "4px 0", borderTop: "1px solid #f0f0f0", marginTop: "4px", paddingTop: "8px" }, children: [
970
970
  /* @__PURE__ */ t.jsx(We, { style: { fontSize: "13px", fontWeight: 600 }, children: "Start Date" }),
971
- /* @__PURE__ */ t.jsx(We, { type: "secondary", style: { fontSize: "11px" }, children: Oe(X, "MMM D, YYYY") })
971
+ /* @__PURE__ */ t.jsx(We, { type: "secondary", style: { fontSize: "11px" }, children: ke(X, "MMM D, YYYY") })
972
972
  ] }) }, "gantt-start-date")
973
973
  ]
974
974
  }
975
975
  ) }),
976
976
  /* @__PURE__ */ t.jsx("div", { style: { width: 100 }, children: /* @__PURE__ */ t.jsxs(
977
- ke,
977
+ Oe,
978
978
  {
979
979
  value: m,
980
980
  onChange: E,
@@ -992,7 +992,7 @@ const jt = (e) => e ? {
992
992
  /* @__PURE__ */ t.jsxs("div", { style: { flex: 1 }, children: [
993
993
  /* @__PURE__ */ t.jsx(We, { style: { fontSize: "12px", display: "block", marginBottom: 6, color: d.font?.color }, children: "Delay type" }),
994
994
  /* @__PURE__ */ t.jsxs(
995
- ke,
995
+ Oe,
996
996
  {
997
997
  value: F,
998
998
  onChange: N,
@@ -1011,7 +1011,7 @@ const jt = (e) => e ? {
1011
1011
  {
1012
1012
  min: 0,
1013
1013
  value: M,
1014
- onChange: (V) => S(V || 0),
1014
+ onChange: (V) => v(V || 0),
1015
1015
  style: { width: "100%" },
1016
1016
  placeholder: "0"
1017
1017
  }
@@ -1059,7 +1059,7 @@ const jt = (e) => e ? {
1059
1059
  )
1060
1060
  ] }),
1061
1061
  Z && /* @__PURE__ */ t.jsxs(t.Fragment, { children: [
1062
- k(),
1062
+ O(),
1063
1063
  /* @__PURE__ */ t.jsx(gn, { style: {
1064
1064
  fontSize: "12px",
1065
1065
  color: d.font?.color || "#262626",
@@ -1084,7 +1084,7 @@ const jt = (e) => e ? {
1084
1084
  {
1085
1085
  type: "primary",
1086
1086
  onClick: R,
1087
- disabled: !v,
1087
+ disabled: !S,
1088
1088
  style: {
1089
1089
  ...d.buttonPrimary,
1090
1090
  minWidth: 100
@@ -1099,7 +1099,7 @@ const jt = (e) => e ? {
1099
1099
  {
1100
1100
  content: Se,
1101
1101
  trigger: "click",
1102
- open: p,
1102
+ open: h,
1103
1103
  onOpenChange: Y,
1104
1104
  placement: "bottomLeft",
1105
1105
  overlayClassName: "dependency-popover",
@@ -1108,12 +1108,12 @@ const jt = (e) => e ? {
1108
1108
  }
1109
1109
  );
1110
1110
  }, Er = Ir(wr(
1111
- ({ tasks: e, allTasks: a = [], columns: n, selectedTask: s, onTaskClick: r, onTaskContextMenu: c, onTaskUpdate: b, onTaskDragStart: u, onAddTask: d, onAddDependency: p, onRemoveDependency: h, links: v = [], dropIndicator: y, reorderTask: m, styleConfig: E, headerHeight: F }, N) => {
1111
+ ({ tasks: e, allTasks: a = [], columns: n, selectedTask: s, onTaskClick: r, onTaskContextMenu: c, onTaskUpdate: b, onTaskDragStart: u, onAddTask: d, onAddDependency: h, onRemoveDependency: p, links: S = [], dropIndicator: y, reorderTask: m, styleConfig: E, headerHeight: F }, N) => {
1112
1112
  const M = A.useRef(null);
1113
1113
  A.useImperativeHandle(N, () => M.current);
1114
- const [S, w] = A.useState(null), [C, Z] = A.useState(0), W = (j, X = 0) => {
1114
+ const [v, w] = A.useState(null), [C, Z] = A.useState(0), W = (j, X = 0) => {
1115
1115
  if (!j.parent) return X;
1116
- const R = e.find((O) => O.id === j.parent);
1116
+ const R = e.find((k) => k.id === j.parent);
1117
1117
  return R ? W(R, X + 1) : X;
1118
1118
  }, re = (j, X) => {
1119
1119
  if (X === j.duration) return;
@@ -1134,30 +1134,30 @@ const jt = (e) => e ? {
1134
1134
  "div",
1135
1135
  {
1136
1136
  className: "gantt-row-drag-handle",
1137
- onMouseDown: (O) => {
1138
- O.preventDefault(), u?.(j.id, O.clientX, O.clientY, "reorder");
1137
+ onMouseDown: (k) => {
1138
+ k.preventDefault(), u?.(j.id, k.clientX, k.clientY, "reorder");
1139
1139
  },
1140
1140
  children: /* @__PURE__ */ t.jsx(Ee, { icon: Xr })
1141
1141
  }
1142
1142
  ),
1143
- j.type === "project" ? /* @__PURE__ */ t.jsx("span", { className: "gantt-tree-icon", onClick: (O) => {
1144
- O.stopPropagation(), b?.({ ...j, open: !j.open });
1143
+ j.type === "project" ? /* @__PURE__ */ t.jsx("span", { className: "gantt-tree-icon", onClick: (k) => {
1144
+ k.stopPropagation(), b?.({ ...j, open: !j.open });
1145
1145
  }, children: /* @__PURE__ */ t.jsx(Ee, { icon: j.open ? cr : Ur }) }) : /* @__PURE__ */ t.jsx("span", { style: { width: 16, display: "inline-block" } }),
1146
1146
  /* @__PURE__ */ t.jsx("span", { className: "gantt-task-name-text", children: j.text })
1147
1147
  ] });
1148
1148
  }
1149
1149
  case "start":
1150
- return Oe(j.start, "DD-MM-YYYY");
1150
+ return ke(j.start, "DD-MM-YYYY");
1151
1151
  case "end":
1152
- return Oe(j.end, "DD-MM-YYYY");
1152
+ return ke(j.end, "DD-MM-YYYY");
1153
1153
  case "duration":
1154
- return S === j.id ? /* @__PURE__ */ t.jsx(
1154
+ return v === j.id ? /* @__PURE__ */ t.jsx(
1155
1155
  at,
1156
1156
  {
1157
1157
  size: "small",
1158
1158
  min: 1,
1159
1159
  value: C,
1160
- onChange: (O) => Z(O || 1),
1160
+ onChange: (k) => Z(k || 1),
1161
1161
  onBlur: () => {
1162
1162
  re(j, C), w(null);
1163
1163
  },
@@ -1170,8 +1170,8 @@ const jt = (e) => e ? {
1170
1170
  ) : /* @__PURE__ */ t.jsxs(
1171
1171
  "div",
1172
1172
  {
1173
- onClick: (O) => {
1174
- O.stopPropagation(), w(j.id), Z(j.duration);
1173
+ onClick: (k) => {
1174
+ k.stopPropagation(), w(j.id), Z(j.duration);
1175
1175
  },
1176
1176
  style: {
1177
1177
  backgroundColor: "#fff7e6",
@@ -1192,15 +1192,15 @@ const jt = (e) => e ? {
1192
1192
  }
1193
1193
  );
1194
1194
  case "predecessors": {
1195
- const O = v.filter((B) => B.target === j.id)[0];
1195
+ const k = S.filter((B) => B.target === j.id)[0];
1196
1196
  return /* @__PURE__ */ t.jsx(
1197
1197
  yn,
1198
1198
  {
1199
1199
  task: j,
1200
1200
  allTasks: a,
1201
- links: v,
1202
- onAddDependency: (B, Y, k, De) => p?.(B, Y, k, De),
1203
- onRemoveDependency: (B) => h?.(B),
1201
+ links: S,
1202
+ onAddDependency: (B, Y, O, De) => h?.(B, Y, O, De),
1203
+ onRemoveDependency: (B) => p?.(B),
1204
1204
  onTaskUpdate: b,
1205
1205
  styleConfig: E,
1206
1206
  children: /* @__PURE__ */ t.jsx(
@@ -1214,8 +1214,8 @@ const jt = (e) => e ? {
1214
1214
  alignItems: "center",
1215
1215
  gap: "4px"
1216
1216
  },
1217
- children: O ? (() => {
1218
- const B = a.find((k) => k.id === O.source), Y = B ? a.indexOf(B) + 1 : 0;
1217
+ children: k ? (() => {
1218
+ const B = a.find((O) => O.id === k.source), Y = B ? a.indexOf(B) + 1 : 0;
1219
1219
  return /* @__PURE__ */ t.jsx(
1220
1220
  "span",
1221
1221
  {
@@ -1228,7 +1228,7 @@ const jt = (e) => e ? {
1228
1228
  borderRadius: "4px",
1229
1229
  whiteSpace: "nowrap"
1230
1230
  },
1231
- children: mn(O, Y)
1231
+ children: mn(k, Y)
1232
1232
  }
1233
1233
  );
1234
1234
  })() : /* @__PURE__ */ t.jsx(
@@ -1318,35 +1318,35 @@ const jt = (e) => e ? {
1318
1318
  {
1319
1319
  className: `gantt-grid-row ${s === j.id ? "selected" : ""} ${X ? "dragging-row" : ""} ${R ? "descendant-dragging-row" : ""} ${y?.taskId === j.id ? `drop-target-${y.position}` : ""}`,
1320
1320
  onClick: () => r(j.id),
1321
- onContextMenu: (O) => c?.(O, j.id),
1321
+ onContextMenu: (k) => c?.(k, j.id),
1322
1322
  style: {
1323
1323
  display: "flex",
1324
1324
  minWidth: "100%"
1325
1325
  /* Ensure row spans all columns */
1326
1326
  },
1327
1327
  children: [
1328
- n.map((O) => {
1329
- const B = O.name === "add";
1328
+ n.map((k) => {
1329
+ const B = k.name === "add";
1330
1330
  return /* @__PURE__ */ t.jsx(
1331
1331
  "div",
1332
1332
  {
1333
1333
  className: "gantt-grid-cell",
1334
1334
  style: {
1335
- width: O.width,
1336
- minWidth: O.width,
1335
+ width: k.width,
1336
+ minWidth: k.width,
1337
1337
  /* Ensure column maintains width */
1338
- textAlign: O.align || "left",
1338
+ textAlign: k.align || "left",
1339
1339
  display: "flex",
1340
1340
  alignItems: "center",
1341
- justifyContent: B ? "center" : O.name === "text" ? "flex-start" : O.align === "center" ? "center" : O.align === "right" ? "flex-end" : "flex-start",
1341
+ justifyContent: B ? "center" : k.name === "text" ? "flex-start" : k.align === "center" ? "center" : k.align === "right" ? "flex-end" : "flex-start",
1342
1342
  visibility: "visible",
1343
1343
  /* Ensure column is visible */
1344
1344
  opacity: 1
1345
1345
  /* Ensure column is not transparent */
1346
1346
  },
1347
- children: le(j, O)
1347
+ children: le(j, k)
1348
1348
  },
1349
- `${j.id}-${O.name}`
1349
+ `${j.id}-${k.name}`
1350
1350
  );
1351
1351
  }),
1352
1352
  y?.taskId === j.id && /* @__PURE__ */ t.jsx("div", { className: `gantt-drop-indicator ${y.position}` })
@@ -1369,26 +1369,26 @@ const xn = ({
1369
1369
  dragDeltaX: b = 0,
1370
1370
  dragType: u = null,
1371
1371
  readonly: d = !1,
1372
- baseline: p,
1373
- dependencyRuleDescriptions: h = [],
1374
- tooltipConfig: v
1372
+ baseline: h,
1373
+ dependencyRuleDescriptions: p = [],
1374
+ tooltipConfig: S
1375
1375
  }) => {
1376
- const y = e.ShowHandle !== void 0 ? e.ShowHandle : !0, m = ($, J) => {
1377
- d || ($.preventDefault(), $.stopPropagation(), c($.clientX, $.clientY, J));
1376
+ const y = e.ShowHandle !== void 0 ? e.ShowHandle : !0, m = ($, q) => {
1377
+ d || ($.preventDefault(), $.stopPropagation(), c($.clientX, $.clientY, q));
1378
1378
  }, E = () => {
1379
1379
  const $ = ["gantt-task-bar"];
1380
1380
  if (e.type === "milestone" && $.push("milestone"), e.type === "project" && $.push("project"), n && $.push("selected"), s && $.push("dragging"), e.status) {
1381
- const J = String(e.status).trim().toLowerCase().replace(/\s+/g, "-").replace(/[^a-z0-9-]/g, "");
1382
- J && $.push(`status-${J}`);
1381
+ const q = String(e.status).trim().toLowerCase().replace(/\s+/g, "-").replace(/[^a-z0-9-]/g, "");
1382
+ q && $.push(`status-${q}`);
1383
1383
  }
1384
1384
  return $.join(" ");
1385
1385
  }, F = () => {
1386
- let $ = a.left, J = a.width;
1387
- s && u && (u === "move" ? $ += b : u === "resize-left" ? ($ += b, J -= b) : u === "resize-right" && (J += b));
1386
+ let $ = a.left, q = a.width;
1387
+ s && u && (u === "move" ? $ += b : u === "resize-left" ? ($ += b, q -= b) : u === "resize-right" && (q += b));
1388
1388
  const xe = 20;
1389
- return e.type === "milestone" && J < xe && ($ -= (xe - J) / 2, J = xe), {
1389
+ return e.type === "milestone" && q < xe && ($ -= (xe - q) / 2, q = xe), {
1390
1390
  left: `${$}px`,
1391
- width: `${Math.max(J, 0)}px`,
1391
+ width: `${Math.max(q, 0)}px`,
1392
1392
  // Color handled by CSS classes (.project, .milestone) or task.color override
1393
1393
  backgroundColor: e.color || void 0
1394
1394
  };
@@ -1397,7 +1397,7 @@ const xn = ({
1397
1397
  "div",
1398
1398
  {
1399
1399
  className: "gantt-task-resize-handle gantt-task-resize-left",
1400
- onMouseDown: (J) => m(J, "resize-left")
1400
+ onMouseDown: (q) => m(q, "resize-left")
1401
1401
  }
1402
1402
  ),
1403
1403
  !$ && e.type !== "milestone" && /* @__PURE__ */ t.jsx(
@@ -1416,39 +1416,39 @@ const xn = ({
1416
1416
  "div",
1417
1417
  {
1418
1418
  className: "gantt-task-resize-handle gantt-task-resize-right",
1419
- onMouseDown: (J) => m(J, "resize-right")
1419
+ onMouseDown: (q) => m(q, "resize-right")
1420
1420
  }
1421
1421
  )
1422
- ] }), M = ($, J) => {
1422
+ ] }), M = ($, q) => {
1423
1423
  if ($ instanceof Date)
1424
- return Number.isNaN($.getTime()) ? J : $;
1424
+ return Number.isNaN($.getTime()) ? q : $;
1425
1425
  if (typeof $ == "string" || typeof $ == "number") {
1426
1426
  const xe = new Date($);
1427
- return Number.isNaN(xe.getTime()) ? J : xe;
1427
+ return Number.isNaN(xe.getTime()) ? q : xe;
1428
1428
  }
1429
- return J;
1430
- }, S = ($) => {
1429
+ return q;
1430
+ }, v = ($) => {
1431
1431
  if (Array.isArray($)) {
1432
- const J = $.map((xe) => String(xe).trim()).filter(Boolean);
1433
- return J.length > 0 ? J : void 0;
1432
+ const q = $.map((xe) => String(xe).trim()).filter(Boolean);
1433
+ return q.length > 0 ? q : void 0;
1434
1434
  }
1435
1435
  if (typeof $ == "string") {
1436
- const J = $.split(/\r?\n|\|/).map((xe) => xe.trim()).filter(Boolean);
1437
- return J.length > 0 ? J : void 0;
1436
+ const q = $.split(/\r?\n|\|/).map((xe) => xe.trim()).filter(Boolean);
1437
+ return q.length > 0 ? q : void 0;
1438
1438
  }
1439
- }, w = e.tooltipConfig ? { ...v, ...e.tooltipConfig } : v, C = w?.dateFormat || "MMM D, YYYY", Z = w?.taskNameAccessor?.(e) ?? e.text, W = String(Z ?? "").trim() || `Task ${e.id}`, re = w?.taskNameFormatter ? w.taskNameFormatter(W, e) : W, le = M(
1440
- w?.plannedStartAccessor?.(e) ?? e.plannedStart ?? p?.start ?? e.start,
1439
+ }, w = e.tooltipConfig ? { ...S, ...e.tooltipConfig } : S, C = w?.dateFormat || "MMM D, YYYY", Z = w?.taskNameAccessor?.(e) ?? e.text, W = String(Z ?? "").trim() || `Task ${e.id}`, re = w?.taskNameFormatter ? w.taskNameFormatter(W, e) : W, le = M(
1440
+ w?.plannedStartAccessor?.(e) ?? e.plannedStart ?? h?.start ?? e.start,
1441
1441
  e.start
1442
1442
  ), j = M(
1443
- w?.plannedEndAccessor?.(e) ?? e.plannedEnd ?? p?.end ?? e.end,
1443
+ w?.plannedEndAccessor?.(e) ?? e.plannedEnd ?? h?.end ?? e.end,
1444
1444
  e.end
1445
- ), X = w?.plannedDatesFormatter ? w.plannedDatesFormatter(le, j, e) : `${Oe(le, C)} - ${Oe(j, C)}`, R = M(
1445
+ ), X = w?.plannedDatesFormatter ? w.plannedDatesFormatter(le, j, e) : `${ke(le, C)} - ${ke(j, C)}`, R = M(
1446
1446
  w?.actualStartAccessor?.(e) ?? e.actualStart ?? e.start,
1447
1447
  e.start
1448
- ), O = M(
1448
+ ), k = M(
1449
1449
  w?.actualEndAccessor?.(e) ?? e.actualEnd ?? e.end,
1450
1450
  e.end
1451
- ), B = w?.actualDatesFormatter ? w.actualDatesFormatter(R, O, e) : `${Oe(R, C)} - ${Oe(O, C)}`, Y = w?.statusAccessor?.(e) ?? e.status, k = Y != null ? String(Y) : "", De = w?.statusFormatter ? w.statusFormatter(k, e) : k ? k.replace(/-/g, " ") : w?.emptyStatusText || "Not set", Se = w?.ownerAccessor?.(e) ?? e.owner, V = Se != null ? String(Se).trim() : "", I = V ? w?.ownerFormatter ? w.ownerFormatter(V, e) : V : w?.emptyOwnerText || "", ne = h.length > 0 ? h : e.dependencyRule || [], se = S(
1451
+ ), B = w?.actualDatesFormatter ? w.actualDatesFormatter(R, k, e) : `${ke(R, C)} - ${ke(k, C)}`, Y = w?.statusAccessor?.(e) ?? e.status, O = Y != null ? String(Y) : "", De = w?.statusFormatter ? w.statusFormatter(O, e) : O ? O.replace(/-/g, " ") : w?.emptyStatusText || "Not set", Se = w?.ownerAccessor?.(e) ?? e.owner, V = Se != null ? String(Se).trim() : "", I = V ? w?.ownerFormatter ? w.ownerFormatter(V, e) : V : w?.emptyOwnerText || "", ne = p.length > 0 ? p : e.dependencyRule || [], se = v(
1452
1452
  w?.dependencyRuleAccessor?.(e, ne)
1453
1453
  ) || ne, ue = se.length > 0 ? se.map(($) => w?.dependencyRuleFormatter ? w.dependencyRuleFormatter($, e) : $).join(w?.dependencySeparator || " | ") : w?.emptyDependencyRuleText || "No dependency rule", z = w?.progressAccessor?.(e) ?? e.progress, ye = typeof z == "number" ? z : Number(z), Le = Number.isFinite(ye) ? ye : e.progress, Ie = w?.progressFormatter ? w.progressFormatter(Le, e) : `${Le}%`, Ye = /* @__PURE__ */ t.jsxs("div", { className: "gantt-tooltip", children: [
1454
1454
  w?.showTaskName !== !1 && /* @__PURE__ */ t.jsx("div", { className: "gantt-tooltip-title", children: re }),
@@ -1485,7 +1485,7 @@ const xn = ({
1485
1485
  ] });
1486
1486
  if (e.segments && e.segments.length > 0 || e.onHoldPeriods && e.onHoldPeriods.length > 0) {
1487
1487
  console.log("[TaskBar] " + e.text + " onHold:", e.onHoldPeriods);
1488
- const $ = e.end.getTime() - e.start.getTime(), J = (e.onHoldPeriods || []).map((ce) => ({
1488
+ const $ = e.end.getTime() - e.start.getTime(), q = (e.onHoldPeriods || []).map((ce) => ({
1489
1489
  startMs: Math.max(ce.start.getTime(), e.start.getTime()),
1490
1490
  endMs: Math.min(ce.end.getTime(), e.end.getTime())
1491
1491
  })).filter((ce) => ce.endMs > ce.startMs).sort((ce, me) => ce.startMs - me.startMs).reduce((ce, me) => {
@@ -1507,7 +1507,7 @@ const xn = ({
1507
1507
  children: N(me > 0)
1508
1508
  }
1509
1509
  ) }, `seg-${me}`)),
1510
- J.map((ce, me) => {
1510
+ q.map((ce, me) => {
1511
1511
  const Fe = $ > 0 ? $ : 864e5, pe = ce.endMs - ce.startMs;
1512
1512
  if (pe <= 0) return null;
1513
1513
  const et = a.left + (ce.startMs - e.start.getTime()) / Fe * a.width, _e = pe / Fe * a.width;
@@ -1542,45 +1542,45 @@ const xn = ({
1542
1542
  ) });
1543
1543
  }, wn = ({ links: e, tasks: a, getTaskPosition: n }) => {
1544
1544
  const s = A.useMemo(() => {
1545
- const p = /* @__PURE__ */ new Map();
1546
- return a.forEach((h) => p.set(h.id, h)), p;
1547
- }, [a]), r = (p) => s.get(p), c = A.useMemo(() => {
1548
- const p = /* @__PURE__ */ new Map(), h = /* @__PURE__ */ new Map(), v = /* @__PURE__ */ new Map(), y = /* @__PURE__ */ new Map();
1545
+ const h = /* @__PURE__ */ new Map();
1546
+ return a.forEach((p) => h.set(p.id, p)), h;
1547
+ }, [a]), r = (h) => s.get(h), c = A.useMemo(() => {
1548
+ const h = /* @__PURE__ */ new Map(), p = /* @__PURE__ */ new Map(), S = /* @__PURE__ */ new Map(), y = /* @__PURE__ */ new Map();
1549
1549
  e.forEach((F) => {
1550
- p.set(F.source, (p.get(F.source) || 0) + 1), h.set(F.target, (h.get(F.target) || 0) + 1);
1550
+ h.set(F.source, (h.get(F.source) || 0) + 1), p.set(F.target, (p.get(F.target) || 0) + 1);
1551
1551
  });
1552
1552
  const m = /* @__PURE__ */ new Map(), E = /* @__PURE__ */ new Map();
1553
1553
  return e.forEach((F) => {
1554
1554
  const N = m.get(F.source) || 0;
1555
- v.set(F.id, N), m.set(F.source, N + 1);
1555
+ S.set(F.id, N), m.set(F.source, N + 1);
1556
1556
  const M = E.get(F.target) || 0;
1557
1557
  y.set(F.id, M), E.set(F.target, M + 1);
1558
1558
  }), {
1559
- outgoingCountByTaskId: p,
1560
- incomingCountByTaskId: h,
1561
- outgoingIndexByLinkId: v,
1559
+ outgoingCountByTaskId: h,
1560
+ incomingCountByTaskId: p,
1561
+ outgoingIndexByLinkId: S,
1562
1562
  incomingIndexByLinkId: y
1563
1563
  };
1564
1564
  }, [e]), b = A.useMemo(() => {
1565
- let p = 0, h = 0;
1566
- return a.forEach((v) => {
1565
+ let h = 0, p = 0;
1566
+ return a.forEach((S) => {
1567
1567
  try {
1568
- const y = n(v);
1569
- y && typeof y.left == "number" && typeof y.width == "number" && (p = Math.max(p, y.left + y.width)), y && typeof y.top == "number" && typeof y.height == "number" && (h = Math.max(h, y.top + y.height));
1568
+ const y = n(S);
1569
+ y && typeof y.left == "number" && typeof y.width == "number" && (h = Math.max(h, y.left + y.width)), y && typeof y.top == "number" && typeof y.height == "number" && (p = Math.max(p, y.top + y.height));
1570
1570
  } catch (y) {
1571
- console.warn("Failed to position task for link rendering:", v.id, y);
1571
+ console.warn("Failed to position task for link rendering:", S.id, y);
1572
1572
  }
1573
1573
  }), {
1574
- width: Math.max(p, 1e3),
1575
- height: Math.max(h, 100)
1574
+ width: Math.max(h, 1e3),
1575
+ height: Math.max(p, 100)
1576
1576
  };
1577
- }, [a, n]), u = (p, h) => {
1578
- const v = Math.max(3, Math.round(h / 7)), y = Math.max(2, h / 2 - 2);
1579
- return Math.min((p + 1) * v, y);
1580
- }, d = (p) => {
1581
- const h = r(p.source), v = r(p.target);
1582
- if (!h || !v) return { path: "", arrow: "" };
1583
- const y = n(h), m = n(v), E = (c.outgoingCountByTaskId.get(h.id) || 0) > 0 && (c.incomingCountByTaskId.get(h.id) || 0) > 0, F = (c.outgoingCountByTaskId.get(v.id) || 0) > 0 && (c.incomingCountByTaskId.get(v.id) || 0) > 0, N = y.top + y.height / 2 + (E ? u(c.outgoingIndexByLinkId.get(p.id) || 0, y.height) : 0), M = m.top + m.height / 2 - (F ? u(c.incomingIndexByLinkId.get(p.id) || 0, m.height) : 0), S = {
1577
+ }, [a, n]), u = (h, p) => {
1578
+ const S = Math.max(3, Math.round(p / 7)), y = Math.max(2, p / 2 - 2);
1579
+ return Math.min((h + 1) * S, y);
1580
+ }, d = (h) => {
1581
+ const p = r(h.source), S = r(h.target);
1582
+ if (!p || !S) return { path: "", arrow: "" };
1583
+ const y = n(p), m = n(S), E = (c.outgoingCountByTaskId.get(p.id) || 0) > 0 && (c.incomingCountByTaskId.get(p.id) || 0) > 0, F = (c.outgoingCountByTaskId.get(S.id) || 0) > 0 && (c.incomingCountByTaskId.get(S.id) || 0) > 0, N = y.top + y.height / 2 + (E ? u(c.outgoingIndexByLinkId.get(h.id) || 0, y.height) : 0), M = m.top + m.height / 2 - (F ? u(c.incomingIndexByLinkId.get(h.id) || 0, m.height) : 0), v = {
1584
1584
  sourceStub: 14,
1585
1585
  targetStub: 8,
1586
1586
  detourPadding: 24,
@@ -1592,7 +1592,7 @@ const xn = ({
1592
1592
  chevronNotchDepth: 5
1593
1593
  };
1594
1594
  let w = 0, C = 0, Z = 1, W = 1;
1595
- switch (p.type) {
1595
+ switch (h.type) {
1596
1596
  case "e2s":
1597
1597
  w = y.left + y.width, C = m.left, Z = 1, W = 1;
1598
1598
  break;
@@ -1606,7 +1606,7 @@ const xn = ({
1606
1606
  w = y.left, C = m.left + m.width, Z = -1, W = -1;
1607
1607
  break;
1608
1608
  }
1609
- const re = w + Z * S.sourceStub, le = C - W * S.arrowGap, j = le - W * S.arrowLength, X = j + W * S.chevronNotchDepth, R = X - W * S.targetStub, O = X + W * S.arrowStemOverlap, B = Math.abs(M - N) > 1;
1609
+ const re = w + Z * v.sourceStub, le = C - W * v.arrowGap, j = le - W * v.arrowLength, X = j + W * v.chevronNotchDepth, R = X - W * v.targetStub, k = X + W * v.arrowStemOverlap, B = Math.abs(M - N) > 1;
1610
1610
  let Y;
1611
1611
  if (B) {
1612
1612
  const ne = M > N;
@@ -1617,24 +1617,24 @@ const xn = ({
1617
1617
  { x: re, y: de },
1618
1618
  { x: R, y: de },
1619
1619
  { x: R, y: M },
1620
- { x: O, y: M }
1620
+ { x: k, y: M }
1621
1621
  ];
1622
1622
  } else {
1623
1623
  let I;
1624
- Z === W && (Z === 1 ? R - re >= S.minHorizontalSpan : re - R >= S.minHorizontalSpan) ? I = (re + R) / 2 : I = Z === 1 ? Math.max(w, C) + S.detourPadding : Math.min(w, C) - S.detourPadding, Y = [
1624
+ Z === W && (Z === 1 ? R - re >= v.minHorizontalSpan : re - R >= v.minHorizontalSpan) ? I = (re + R) / 2 : I = Z === 1 ? Math.max(w, C) + v.detourPadding : Math.min(w, C) - v.detourPadding, Y = [
1625
1625
  { x: w, y: N },
1626
1626
  { x: re, y: N },
1627
1627
  { x: I, y: N },
1628
1628
  { x: I, y: M },
1629
1629
  { x: R, y: M },
1630
- { x: O, y: M }
1630
+ { x: k, y: M }
1631
1631
  ];
1632
1632
  }
1633
- const k = Y.filter((I, ne) => {
1633
+ const O = Y.filter((I, ne) => {
1634
1634
  if (ne === 0) return !0;
1635
1635
  const de = Y[ne - 1];
1636
1636
  return Math.abs(I.x - de.x) > 0.5 || Math.abs(I.y - de.y) > 0.5;
1637
- }), De = k.length > 0 ? k.map((I, ne) => `${ne === 0 ? "M" : "L"} ${I.x},${I.y}`).join(" ") : "", Se = S.arrowWidth / 2, V = `M ${j},${M - Se} L ${le},${M} L ${j},${M + Se} L ${X},${M} Z`;
1637
+ }), De = O.length > 0 ? O.map((I, ne) => `${ne === 0 ? "M" : "L"} ${I.x},${I.y}`).join(" ") : "", Se = v.arrowWidth / 2, V = `M ${j},${M - Se} L ${le},${M} L ${j},${M + Se} L ${X},${M} Z`;
1638
1638
  return { path: De, arrow: V };
1639
1639
  };
1640
1640
  return e.length === 0 ? null : /* @__PURE__ */ t.jsx(
@@ -1650,10 +1650,10 @@ const xn = ({
1650
1650
  left: 0,
1651
1651
  pointerEvents: "none"
1652
1652
  },
1653
- children: e.map((p) => {
1654
- const h = r(p.source), v = r(p.target);
1655
- if (!h || !v) return null;
1656
- const y = d(p), m = y.path, E = y.arrow;
1653
+ children: e.map((h) => {
1654
+ const p = r(h.source), S = r(h.target);
1655
+ if (!p || !S) return null;
1656
+ const y = d(h), m = y.path, E = y.arrow;
1657
1657
  return !m || !E ? null : /* @__PURE__ */ t.jsxs("g", { className: "gantt-link", children: [
1658
1658
  /* @__PURE__ */ t.jsx(
1659
1659
  "path",
@@ -1671,12 +1671,12 @@ const xn = ({
1671
1671
  className: "gantt-link-arrow"
1672
1672
  }
1673
1673
  )
1674
- ] }, p.id);
1674
+ ] }, h.id);
1675
1675
  })
1676
1676
  }
1677
1677
  );
1678
1678
  }, bn = (e, a, n = 60, s = "day", r = 1) => {
1679
- const [c, b] = G({
1679
+ const [c, b] = J({
1680
1680
  taskId: null,
1681
1681
  initialX: 0,
1682
1682
  initialY: 0,
@@ -1685,11 +1685,11 @@ const xn = ({
1685
1685
  type: null,
1686
1686
  dragDeltaX: 0,
1687
1687
  dragDeltaY: 0
1688
- }), u = Je((h, v, y, m) => {
1689
- const E = e.find((F) => F.id === h);
1688
+ }), u = Je((p, S, y, m) => {
1689
+ const E = e.find((F) => F.id === p);
1690
1690
  E && b({
1691
- taskId: h,
1692
- initialX: v,
1691
+ taskId: p,
1692
+ initialX: S,
1693
1693
  initialY: y,
1694
1694
  initialStart: new Date(E.start),
1695
1695
  initialEnd: new Date(E.end),
@@ -1697,9 +1697,9 @@ const xn = ({
1697
1697
  dragDeltaX: 0,
1698
1698
  dragDeltaY: 0
1699
1699
  });
1700
- }, [e]), d = Je((h, v) => {
1700
+ }, [e]), d = Je((p, S) => {
1701
1701
  if (!c.taskId || !c.type) return null;
1702
- const y = h - c.initialX, m = v - c.initialY;
1702
+ const y = p - c.initialX, m = S - c.initialY;
1703
1703
  if (b((C) => ({
1704
1704
  ...C,
1705
1705
  dragDeltaX: y,
@@ -1709,28 +1709,28 @@ const xn = ({
1709
1709
  if (!E) return null;
1710
1710
  let F = 0, N = s;
1711
1711
  s === "week" ? (F = Math.round(y / n * 7), N = "day") : s === "month" ? (F = Math.round(y / n * 30), N = "day") : (F = Math.round(y / n) * r, N = s);
1712
- let M = new Date(c.initialStart), S = new Date(c.initialEnd);
1712
+ let M = new Date(c.initialStart), v = new Date(c.initialEnd);
1713
1713
  switch (c.type) {
1714
1714
  case "move":
1715
- M = Te(c.initialStart, F, N), S = Te(c.initialEnd, F, N);
1715
+ M = Te(c.initialStart, F, N), v = Te(c.initialEnd, F, N);
1716
1716
  break;
1717
1717
  case "resize-left":
1718
- M = Te(c.initialStart, F, N), M >= S && (M = Te(S, N === "day" ? -1 : -r, N));
1718
+ M = Te(c.initialStart, F, N), M >= v && (M = Te(v, N === "day" ? -1 : -r, N));
1719
1719
  break;
1720
1720
  case "resize-right":
1721
- S = Te(c.initialEnd, F, N), S <= M && (S = Te(M, N === "day" ? 1 : r, N));
1721
+ v = Te(c.initialEnd, F, N), v <= M && (v = Te(M, N === "day" ? 1 : r, N));
1722
1722
  break;
1723
1723
  }
1724
- const w = Nt(M, S);
1724
+ const w = Nt(M, v);
1725
1725
  return {
1726
1726
  ...E,
1727
1727
  start: M,
1728
- end: S,
1728
+ end: v,
1729
1729
  duration: w
1730
1730
  };
1731
- }, [c, e, n, r, s]), p = Je((h) => {
1732
- if (h && a) {
1733
- const { id: v, ...y } = h, m = c.type;
1731
+ }, [c, e, n, r, s]), h = Je((p) => {
1732
+ if (p && a) {
1733
+ const { id: S, ...y } = p, m = c.type;
1734
1734
  if (m && m !== "reorder") {
1735
1735
  const E = {
1736
1736
  dragType: m,
@@ -1738,9 +1738,9 @@ const xn = ({
1738
1738
  previousEnd: new Date(c.initialEnd),
1739
1739
  previousDuration: Nt(c.initialStart, c.initialEnd)
1740
1740
  };
1741
- a(v, y, E);
1741
+ a(S, y, E);
1742
1742
  } else
1743
- a(v, y);
1743
+ a(S, y);
1744
1744
  }
1745
1745
  b({
1746
1746
  taskId: null,
@@ -1757,12 +1757,12 @@ const xn = ({
1757
1757
  dragState: c,
1758
1758
  handleDragStart: u,
1759
1759
  handleDrag: d,
1760
- handleDragEnd: p
1760
+ handleDragEnd: h
1761
1761
  };
1762
1762
  }, mr = (e) => {
1763
1763
  const a = new Date(e.getFullYear(), e.getMonth(), 1);
1764
1764
  return Math.ceil((e.getDate() + a.getDay()) / 7);
1765
- }, fr = (e) => Math.floor(e.getMonth() / 3) + 1, Qt = (e, a, n) => a.unit === "week" ? a.format?.includes("W") ? a.format.replace(/\bW\b/g, String(mr(e))) : `Week ${mr(e)}` : a.unit === "quarter" ? a.format?.includes("Q") ? a.format.replace(/\bQ\b/g, String(fr(e))) : `Q${fr(e)}` : Oe(e, a.format || n), Sn = (e, a) => {
1765
+ }, fr = (e) => Math.floor(e.getMonth() / 3) + 1, Qt = (e, a, n) => a.unit === "week" ? a.format?.includes("W") ? a.format.replace(/\bW\b/g, String(mr(e))) : `Week ${mr(e)}` : a.unit === "quarter" ? a.format?.includes("Q") ? a.format.replace(/\bQ\b/g, String(fr(e))) : `Q${fr(e)}` : ke(e, a.format || n), Sn = (e, a) => {
1766
1766
  const n = new Date(e);
1767
1767
  switch (n.setMinutes(0, 0, 0), a.unit) {
1768
1768
  case "hour": {
@@ -1792,35 +1792,35 @@ const xn = ({
1792
1792
  }
1793
1793
  }, Lr = A.memo(
1794
1794
  A.forwardRef(
1795
- ({ tasks: e, links: a, range: n, scales: s, config: r, selectedTask: c, onTaskClick: b, onTaskDragStart: u, onTaskDragEnd: d, onTaskUpdate: p, zoomLevel: h, baselines: v, allowBaselineOnlyMode: y, taskTooltipConfig: m, headerHeight: E }, F) => {
1796
- const N = A.useRef(null), M = A.useCallback((l) => {
1797
- N.current = l, typeof F == "function" ? F(l) : F && (F.current = l);
1798
- }, [F]), [S, w] = G(e), [C, Z] = G(a), [W, re] = G(0), le = A.useMemo(
1799
- () => Math.max((r.columnWidth || 60) * h, r.minColumnWidth || 0),
1800
- [r.columnWidth, r.minColumnWidth, h]
1801
- ), j = r.baselines && v && v.size > 0, X = A.useMemo(() => {
1802
- const l = /* @__PURE__ */ new Map();
1803
- return S.forEach((g) => l.set(g.id, g)), l;
1804
- }, [S]), R = A.useMemo(() => {
1805
- const l = /* @__PURE__ */ new Map(), g = {
1795
+ ({ tasks: e, links: a, range: n, scales: s, config: r, selectedTask: c, onTaskClick: b, onTaskDragStart: u, onTaskDragEnd: d, onTaskUpdate: h, zoomLevel: p, baselines: S, allowBaselineOnlyMode: y, taskTooltipConfig: m, headerHeight: E }, F) => {
1796
+ const N = A.useRef(null), M = A.useCallback((i) => {
1797
+ N.current = i, typeof F == "function" ? F(i) : F && (F.current = i);
1798
+ }, [F]), [v, w] = J(e), [C, Z] = J(a), [W, re] = J(0), le = A.useMemo(
1799
+ () => Math.max((r.columnWidth || 60) * p, r.minColumnWidth || 0),
1800
+ [r.columnWidth, r.minColumnWidth, p]
1801
+ ), j = r.baselines && S && S.size > 0, X = A.useMemo(() => {
1802
+ const i = /* @__PURE__ */ new Map();
1803
+ return v.forEach((g) => i.set(g.id, g)), i;
1804
+ }, [v]), R = A.useMemo(() => {
1805
+ const i = /* @__PURE__ */ new Map(), g = {
1806
1806
  e2s: "Finish-to-Start",
1807
1807
  s2s: "Start-to-Start",
1808
1808
  e2e: "Finish-to-Finish",
1809
1809
  s2e: "Start-to-Finish"
1810
1810
  }, D = (f, U) => {
1811
- const ee = [...l.get(f) || [], ...U.map((ie) => ie.trim()).filter(Boolean)];
1812
- ee.length > 0 && l.set(f, Array.from(new Set(ee)));
1811
+ const ee = [...i.get(f) || [], ...U.map((ie) => ie.trim()).filter(Boolean)];
1812
+ ee.length > 0 && i.set(f, Array.from(new Set(ee)));
1813
1813
  };
1814
- return S.forEach((f) => {
1814
+ return v.forEach((f) => {
1815
1815
  f.dependencyRule && f.dependencyRule.length > 0 && D(f.id, f.dependencyRule);
1816
1816
  }), C.forEach((f) => {
1817
- const U = X.get(f.source), q = X.get(f.target), ee = U?.text || `Task ${f.source}`, ie = q?.text || `Task ${f.target}`, $e = g[f.type], ze = typeof f.lag == "number" && f.lag !== 0 ? ` (${f.lag > 0 ? "+" : ""}${f.lag} ${f.lagUnit || "day"})` : "", ge = `${ie} depends on ${ee} [${$e}]${ze}`;
1817
+ const U = X.get(f.source), G = X.get(f.target), ee = U?.text || `Task ${f.source}`, ie = G?.text || `Task ${f.target}`, $e = g[f.type], ze = typeof f.lag == "number" && f.lag !== 0 ? ` (${f.lag > 0 ? "+" : ""}${f.lag} ${f.lagUnit || "day"})` : "", ge = `${ie} depends on ${ee} [${$e}]${ze}`;
1818
1818
  D(f.target, [ge]);
1819
- }), l;
1820
- }, [C, S, X]);
1819
+ }), i;
1820
+ }, [C, v, X]);
1821
1821
  A.useEffect(() => {
1822
- (e.length !== S.length || e.some((g, D) => {
1823
- const f = S[D];
1822
+ (e.length !== v.length || e.some((g, D) => {
1823
+ const f = v[D];
1824
1824
  return !f || g.id !== f.id || g.start.getTime() !== f.start.getTime() || g.end.getTime() !== f.end.getTime() || g.duration !== f.duration;
1825
1825
  })) && w(e);
1826
1826
  }, [e]), A.useEffect(() => {
@@ -1829,15 +1829,15 @@ const xn = ({
1829
1829
  return !f || g.id !== f.id || g.source !== f.source || g.target !== f.target || g.type !== f.type;
1830
1830
  })) && Z(a);
1831
1831
  }, [a]), A.useEffect(() => {
1832
- const l = N.current?.parentElement;
1833
- if (!l) return;
1832
+ const i = N.current?.parentElement;
1833
+ if (!i) return;
1834
1834
  const g = () => {
1835
- let U = l.clientWidth;
1836
- const q = l.closest(".gantt-layout"), ee = q?.querySelector(".gantt-grid");
1837
- q && ee && (U = Math.max(0, q.clientWidth - ee.offsetWidth)), re((ie) => ie === U ? ie : U);
1835
+ let U = i.clientWidth;
1836
+ const G = i.closest(".gantt-layout"), ee = G?.querySelector(".gantt-grid");
1837
+ G && ee && (U = Math.max(0, G.clientWidth - ee.offsetWidth)), re((ie) => ie === U ? ie : U);
1838
1838
  };
1839
1839
  g();
1840
- const D = l.closest(".gantt-layout") || l;
1840
+ const D = i.closest(".gantt-layout") || i;
1841
1841
  if (typeof ResizeObserver > "u")
1842
1842
  return window.addEventListener("resize", g), () => window.removeEventListener("resize", g);
1843
1843
  const f = new ResizeObserver(() => {
@@ -1845,84 +1845,84 @@ const xn = ({
1845
1845
  });
1846
1846
  return f.observe(D), () => f.disconnect();
1847
1847
  }, []);
1848
- const O = A.useCallback((l) => {
1848
+ const k = A.useCallback((i) => {
1849
1849
  const g = [];
1850
1850
  let D = new Date(n.start);
1851
1851
  for (; D <= n.end; ) {
1852
1852
  let f = Qt(
1853
1853
  D,
1854
- l,
1855
- l.unit === "year" ? "YYYY" : l.unit === "month" ? "MMM" : l.unit === "hour" ? "HH" : "D"
1854
+ i,
1855
+ i.unit === "year" ? "YYYY" : i.unit === "month" ? "MMM" : i.unit === "hour" ? "HH" : "D"
1856
1856
  );
1857
- if (r.relativeDayNumbering && l.unit === "day") {
1858
- const U = D.getTime() - n.start.getTime(), q = Math.floor(U / (1e3 * 60 * 60 * 24)) + 1;
1859
- f = String(q);
1857
+ if (r.relativeDayNumbering && i.unit === "day") {
1858
+ const U = D.getTime() - n.start.getTime(), G = Math.floor(U / (1e3 * 60 * 60 * 24)) + 1;
1859
+ f = String(G);
1860
1860
  }
1861
1861
  g.push({
1862
1862
  date: new Date(D),
1863
1863
  label: f
1864
- }), D = Te(D, l.step, l.unit);
1864
+ }), D = Te(D, i.step, i.unit);
1865
1865
  }
1866
1866
  if (W > 0) {
1867
1867
  const f = Math.floor(W / le);
1868
1868
  for (; g.length < f; ) {
1869
1869
  let U = Qt(
1870
1870
  D,
1871
- l,
1872
- l.unit === "year" ? "YYYY" : l.unit === "month" ? "MMM" : l.unit === "hour" ? "HH" : "D"
1871
+ i,
1872
+ i.unit === "year" ? "YYYY" : i.unit === "month" ? "MMM" : i.unit === "hour" ? "HH" : "D"
1873
1873
  );
1874
- if (r.relativeDayNumbering && l.unit === "day") {
1875
- const q = D.getTime() - n.start.getTime(), ee = Math.floor(q / (1e3 * 60 * 60 * 24)) + 1;
1874
+ if (r.relativeDayNumbering && i.unit === "day") {
1875
+ const G = D.getTime() - n.start.getTime(), ee = Math.floor(G / (1e3 * 60 * 60 * 24)) + 1;
1876
1876
  U = String(ee);
1877
1877
  }
1878
1878
  g.push({
1879
1879
  date: new Date(D),
1880
1880
  label: U
1881
- }), D = Te(D, l.step, l.unit);
1881
+ }), D = Te(D, i.step, i.unit);
1882
1882
  }
1883
1883
  }
1884
1884
  return g;
1885
- }, [n.start, n.end, W, le]), B = s[s.length - 1] || s[0], Y = A.useMemo(() => O(B), [O, B]), k = A.useMemo(() => Y.length === 0 || W <= 0 ? le : Math.max(le, W / Y.length), [le, Y.length, W]), De = y && S.length === 0 && j, Se = !!r.timelineView || !!r.timelineViews?.length, V = A.useMemo(() => {
1885
+ }, [n.start, n.end, W, le]), B = s[s.length - 1] || s[0], Y = A.useMemo(() => k(B), [k, B]), O = A.useMemo(() => Y.length === 0 || W <= 0 ? le : Math.max(le, W / Y.length), [le, Y.length, W]), De = y && v.length === 0 && j, Se = !!r.timelineView || !!r.timelineViews?.length, V = A.useMemo(() => {
1886
1886
  if (r.showTimelineHeader === !1) return 0;
1887
- let l = Se ? Math.max(s.length - 1, 0) : 2;
1888
- if (r.showMonthHeading === !1 && (l = Math.max(0, l - 1)), r.showRangeHeading === !1) {
1887
+ let i = Se ? Math.max(s.length - 1, 0) : 2;
1888
+ if (r.showMonthHeading === !1 && (i = Math.max(0, i - 1)), r.showRangeHeading === !1) {
1889
1889
  const g = Se ? Math.max(0, s.length - 2) : 1;
1890
- l = Math.max(0, l - g);
1890
+ i = Math.max(0, i - g);
1891
1891
  }
1892
- return l;
1892
+ return i;
1893
1893
  }, [r.showTimelineHeader, r.showMonthHeading, r.showRangeHeading, Se, s.length]), { dragState: I, handleDragStart: ne, handleDrag: de, handleDragEnd: se } = bn(
1894
- S,
1895
- p,
1896
- k,
1894
+ v,
1895
+ h,
1896
+ O,
1897
1897
  B.unit,
1898
1898
  B.step
1899
- ), ue = A.useCallback((l) => {
1899
+ ), ue = A.useCallback((i) => {
1900
1900
  if (Y.length === 0) return 0;
1901
- const g = l.getTime(), D = Y.length - 1;
1901
+ const g = i.getTime(), D = Y.length - 1;
1902
1902
  for (let f = 0; f <= D; f++) {
1903
- const U = Y[f], q = U.date.getTime(), ie = (f < D ? Y[f + 1].date : Te(U.date, B.step, B.unit)).getTime(), $e = Math.max(ie - q, 1);
1904
- if (g < q)
1905
- return f * k;
1903
+ const U = Y[f], G = U.date.getTime(), ie = (f < D ? Y[f + 1].date : Te(U.date, B.step, B.unit)).getTime(), $e = Math.max(ie - G, 1);
1904
+ if (g < G)
1905
+ return f * O;
1906
1906
  if (g <= ie) {
1907
- const ze = Math.max(0, Math.min((g - q) / $e, 1));
1908
- return (f + ze) * k;
1907
+ const ze = Math.max(0, Math.min((g - G) / $e, 1));
1908
+ return (f + ze) * O;
1909
1909
  }
1910
1910
  }
1911
- return Y.length * k;
1912
- }, [Y, B, k]), z = (l) => {
1913
- const g = ue(l.start), D = ue(l.end);
1911
+ return Y.length * O;
1912
+ }, [Y, B, O]), z = (i) => {
1913
+ const g = ue(i.start), D = ue(i.end);
1914
1914
  return {
1915
1915
  left: g,
1916
1916
  width: Math.max(D - g, 0)
1917
1917
  };
1918
- }, ye = (l) => {
1919
- const g = ue(l.start), D = ue(l.end);
1918
+ }, ye = (i) => {
1919
+ const g = ue(i.start), D = ue(i.end);
1920
1920
  return {
1921
1921
  left: g,
1922
1922
  width: Math.max(D - g, 0)
1923
1923
  };
1924
- }, Le = A.useCallback((l) => {
1925
- const g = z(l), D = S.findIndex((ee) => ee.id === l.id);
1924
+ }, Le = A.useCallback((i) => {
1925
+ const g = z(i), D = v.findIndex((ee) => ee.id === i.id);
1926
1926
  let f = r.rowHeight || 48;
1927
1927
  if (N.current) {
1928
1928
  const ee = getComputedStyle(N.current).getPropertyValue("--gantt-row-height");
@@ -1931,80 +1931,84 @@ const xn = ({
1931
1931
  !isNaN(ie) && ie > 0 && (f = ie);
1932
1932
  }
1933
1933
  }
1934
- const U = r.taskHeight || 28, q = (f - U) / 2;
1934
+ const U = r.taskHeight || 28, G = (f - U) / 2;
1935
1935
  return {
1936
1936
  left: g.left,
1937
1937
  width: g.width,
1938
- top: D * f + q,
1938
+ top: D * f + G,
1939
1939
  height: U
1940
1940
  };
1941
- }, [z, S, r.rowHeight, r.taskHeight]), Ie = A.useRef(null), Ye = Je((l) => {
1941
+ }, [z, v, r.rowHeight, r.taskHeight]), Ie = A.useRef(null), Ye = Je((i) => {
1942
1942
  I.taskId && I.type && (Ie.current && cancelAnimationFrame(Ie.current), Ie.current = requestAnimationFrame(() => {
1943
- const g = de(l.clientX, l.clientY);
1943
+ const g = de(i.clientX, i.clientY);
1944
1944
  g && w(
1945
1945
  (D) => D.map((f) => f.id === g.id ? g : f)
1946
1946
  );
1947
1947
  }));
1948
1948
  }, [I, de]), $ = Je(() => {
1949
1949
  if (I.taskId) {
1950
- const l = S.find((g) => g.id === I.taskId);
1951
- se(l || null), d();
1950
+ const i = v.find((g) => g.id === I.taskId);
1951
+ se(i || null), d();
1952
1952
  }
1953
- }, [I, S, se, d]), J = A.useCallback((l) => {
1953
+ }, [I, v, se, d]), q = A.useCallback((i) => {
1954
1954
  const g = [];
1955
1955
  let D = "", f = "", U = 0;
1956
- return Y.forEach((q) => {
1957
- const ee = Sn(q.date, l), ie = ee.toISOString(), $e = l.unit === "year" ? "YYYY" : l.unit === "month" ? "MMM YYYY" : l.unit === "day" ? "MMM D" : "D", ze = Qt(ee, l, $e);
1958
- ie !== D ? (D && g.push({ key: D, label: f, width: U }), D = ie, f = ze, U = k) : U += k;
1956
+ return Y.forEach((G) => {
1957
+ const ee = Sn(G.date, i), ie = ee.toISOString(), $e = i.unit === "year" ? "YYYY" : i.unit === "month" ? "MMM YYYY" : i.unit === "day" ? "MMM D" : "D", ze = Qt(ee, i, $e);
1958
+ ie !== D ? (D && g.push({ key: D, label: f, width: U }), D = ie, f = ze, U = O) : U += O;
1959
1959
  }), D && g.push({ key: D, label: f, width: U }), g;
1960
- }, [Y, k]), xe = A.useMemo(() => {
1960
+ }, [Y, O]), xe = A.useMemo(() => {
1961
1961
  if (!Se) return [];
1962
- const l = [];
1963
- return s.slice(0, -1).forEach((D) => {
1964
- const f = J(D);
1965
- f.length > 0 && l.push(f);
1966
- }), l.push(
1962
+ const i = [];
1963
+ if (s.slice(0, -1).forEach((D) => {
1964
+ const f = q(D);
1965
+ f.length > 0 && i.push(f);
1966
+ }), r.timelineView === "day" && i.length === 0) {
1967
+ const D = q({ unit: "month", step: 1, format: "MMM YYYY" });
1968
+ D.length > 0 && i.push(D);
1969
+ }
1970
+ return i.push(
1967
1971
  Y.map((D, f) => ({
1968
1972
  key: `secondary-${f}`,
1969
1973
  label: D.label,
1970
- width: k,
1974
+ width: O,
1971
1975
  date: D.date
1972
1976
  }))
1973
- ), l;
1974
- }, [J, k, Se, s, Y]), Qe = A.useCallback(() => {
1975
- const l = [];
1977
+ ), i;
1978
+ }, [q, O, Se, s, Y]), Qe = A.useCallback(() => {
1979
+ const i = [];
1976
1980
  let g = -1, D = -1, f = 0, U = "";
1977
- return Y.forEach((q) => {
1978
- const ee = q.date.getMonth(), ie = q.date.getFullYear(), $e = Oe(q.date, "MMM YYYY");
1979
- ee !== g || ie !== D ? (g !== -1 && l.push({ label: U, width: f }), g = ee, D = ie, f = k, U = $e) : f += k;
1980
- }), g !== -1 && l.push({ label: U, width: f }), l;
1981
- }, [Y, k]), ce = A.useCallback(() => {
1982
- const l = [];
1983
- let g = -1, D = 0, f = -1, U = -1, q = "";
1981
+ return Y.forEach((G) => {
1982
+ const ee = G.date.getMonth(), ie = G.date.getFullYear(), $e = ke(G.date, "MMM YYYY");
1983
+ ee !== g || ie !== D ? (g !== -1 && i.push({ label: U, width: f }), g = ee, D = ie, f = O, U = $e) : f += O;
1984
+ }), g !== -1 && i.push({ label: U, width: f }), i;
1985
+ }, [Y, O]), ce = A.useCallback(() => {
1986
+ const i = [];
1987
+ let g = -1, D = 0, f = -1, U = -1, G = "";
1984
1988
  return Y.forEach((ee) => {
1985
- const $e = ee.date.getDate() <= 15 ? 0 : 1, ze = ee.date.getMonth(), ge = ee.date.getFullYear(), tt = Oe(ee.date, "MMM"), Ke = new Date(ge, ze + 1, 0).getDate(), st = $e === 0 ? `${tt} 1 - 15` : `${tt} 16 - ${Ke}`;
1986
- $e !== g || ze !== f || ge !== U ? (g !== -1 && l.push({ label: q, width: D }), g = $e, f = ze, U = ge, D = k, q = st) : D += k;
1987
- }), g !== -1 && l.push({ label: q, width: D }), l;
1988
- }, [Y, k]), me = A.useMemo(() => Qe(), [Qe]), Fe = A.useMemo(() => ce(), [ce]), pe = A.useMemo(() => Y.length * k, [Y.length, k]), et = A.useMemo(() => {
1989
- const l = /* @__PURE__ */ new Date();
1990
- return l.setHours(0, 0, 0, 0), l;
1989
+ const $e = ee.date.getDate() <= 15 ? 0 : 1, ze = ee.date.getMonth(), ge = ee.date.getFullYear(), tt = ke(ee.date, "MMM"), Ke = new Date(ge, ze + 1, 0).getDate(), st = $e === 0 ? `${tt} 1 - 15` : `${tt} 16 - ${Ke}`;
1990
+ $e !== g || ze !== f || ge !== U ? (g !== -1 && i.push({ label: G, width: D }), g = $e, f = ze, U = ge, D = O, G = st) : D += O;
1991
+ }), g !== -1 && i.push({ label: G, width: D }), i;
1992
+ }, [Y, O]), me = A.useMemo(() => Qe(), [Qe]), Fe = A.useMemo(() => ce(), [ce]), pe = A.useMemo(() => Y.length * O, [Y.length, O]), et = A.useMemo(() => {
1993
+ const i = /* @__PURE__ */ new Date();
1994
+ return i.setHours(0, 0, 0, 0), i;
1991
1995
  }, []), _e = A.useMemo(() => {
1992
1996
  if (!r.showTodayLine) return null;
1993
- const l = ue(et);
1994
- return l >= -k && l <= pe + k ? Math.max(0, Math.min(l, pe)) : null;
1995
- }, [r.showTodayLine, et, pe, k, ue]), Xe = A.useMemo(() => {
1997
+ const i = ue(et);
1998
+ return i >= -O && i <= pe + O ? Math.max(0, Math.min(i, pe)) : null;
1999
+ }, [r.showTodayLine, et, pe, O, ue]), Xe = A.useMemo(() => {
1996
2000
  if (r.projectStartDate)
1997
2001
  return yt(r.projectStartDate);
1998
- if (S.length > 0) {
1999
- const l = S.map((g) => g.start.getTime());
2000
- return yt(new Date(Math.min(...l)));
2002
+ if (v.length > 0) {
2003
+ const i = v.map((g) => g.start.getTime());
2004
+ return yt(new Date(Math.min(...i)));
2001
2005
  }
2002
2006
  return null;
2003
- }, [r.projectStartDate, S]), Ue = A.useMemo(() => {
2007
+ }, [r.projectStartDate, v]), Ue = A.useMemo(() => {
2004
2008
  if (!r.showProjectStartLine || !Xe) return null;
2005
- const l = ue(Xe);
2006
- return l >= -k && l <= pe + k ? Math.max(0, Math.min(l, pe)) : null;
2007
- }, [r.showProjectStartLine, Xe, pe, k, ue]), ot = `calc(var(--gantt-scale-height, 24px) * ${V})`;
2009
+ const i = ue(Xe);
2010
+ return i >= -O && i <= pe + O ? Math.max(0, Math.min(i, pe)) : null;
2011
+ }, [r.showProjectStartLine, Xe, pe, O, ue]), ot = `calc(var(--gantt-scale-height, 24px) * ${V})`;
2008
2012
  return /* @__PURE__ */ t.jsxs(
2009
2013
  "div",
2010
2014
  {
@@ -2067,15 +2071,15 @@ const xn = ({
2067
2071
  children: r.projectStartLineLabel
2068
2072
  }
2069
2073
  ),
2070
- r.showTimelineHeader !== !1 && (Se ? xe.map((l, g) => {
2074
+ r.showTimelineHeader !== !1 && (Se ? xe.map((i, g) => {
2071
2075
  const D = g === 0 ? "gantt-timeline-scale-month" : g === xe.length - 1 ? "gantt-timeline-scale-day" : "gantt-timeline-scale-range";
2072
2076
  return /* @__PURE__ */ t.jsx(
2073
2077
  "div",
2074
2078
  {
2075
2079
  className: `gantt-timeline-scale ${D}`,
2076
2080
  style: { width: pe, display: g === 0 && r.showMonthHeading === !1 || g !== 0 && g !== xe.length - 1 && r.showRangeHeading === !1 ? "none" : "flex" },
2077
- children: l.map((f, U) => {
2078
- const q = g === xe.length - 1, ee = q && f.date ? r.weekends && Kt(f.date) : !1, ie = q && f.date ? r.holidays && Zt(f.date, r.holidays) : !1;
2081
+ children: i.map((f, U) => {
2082
+ const G = g === xe.length - 1, ee = G && f.date ? r.weekends && Kt(f.date) : !1, ie = G && f.date ? r.holidays && Zt(f.date, r.holidays) : !1;
2079
2083
  return /* @__PURE__ */ t.jsx(
2080
2084
  "div",
2081
2085
  {
@@ -2084,7 +2088,7 @@ const xn = ({
2084
2088
  width: f.width,
2085
2089
  minWidth: f.width,
2086
2090
  maxWidth: f.width,
2087
- borderRight: U === l.length - 1 ? "none" : "var(--wx-gantt-border)"
2091
+ borderRight: U === i.length - 1 ? "none" : "var(--wx-gantt-border)"
2088
2092
  },
2089
2093
  children: f.label
2090
2094
  },
@@ -2095,47 +2099,47 @@ const xn = ({
2095
2099
  `dynamic-row-${g}`
2096
2100
  );
2097
2101
  }) : /* @__PURE__ */ t.jsxs(t.Fragment, { children: [
2098
- r.showMonthHeading !== !1 && /* @__PURE__ */ t.jsx("div", { className: "gantt-timeline-scale gantt-timeline-scale-month", style: { width: pe }, children: me.map((l, g) => /* @__PURE__ */ t.jsx(
2102
+ r.showMonthHeading !== !1 && /* @__PURE__ */ t.jsx("div", { className: "gantt-timeline-scale gantt-timeline-scale-month", style: { width: pe }, children: me.map((i, g) => /* @__PURE__ */ t.jsx(
2099
2103
  "div",
2100
2104
  {
2101
2105
  className: "gantt-timeline-cell",
2102
2106
  style: {
2103
- width: l.width,
2104
- minWidth: l.width,
2105
- maxWidth: l.width,
2107
+ width: i.width,
2108
+ minWidth: i.width,
2109
+ maxWidth: i.width,
2106
2110
  borderRight: g === me.length - 1 ? "none" : "var(--wx-gantt-border)"
2107
2111
  },
2108
- children: l.label
2112
+ children: i.label
2109
2113
  },
2110
2114
  `top-${g}`
2111
2115
  )) }),
2112
- r.showRangeHeading !== !1 && /* @__PURE__ */ t.jsx("div", { className: "gantt-timeline-scale gantt-timeline-scale-range", style: { width: pe }, children: Fe.map((l, g) => /* @__PURE__ */ t.jsx(
2116
+ r.showRangeHeading !== !1 && /* @__PURE__ */ t.jsx("div", { className: "gantt-timeline-scale gantt-timeline-scale-range", style: { width: pe }, children: Fe.map((i, g) => /* @__PURE__ */ t.jsx(
2113
2117
  "div",
2114
2118
  {
2115
2119
  className: "gantt-timeline-cell",
2116
2120
  style: {
2117
- width: l.width,
2118
- minWidth: l.width,
2119
- maxWidth: l.width,
2121
+ width: i.width,
2122
+ minWidth: i.width,
2123
+ maxWidth: i.width,
2120
2124
  borderRight: g === Fe.length - 1 ? "none" : "var(--wx-gantt-border)"
2121
2125
  },
2122
- children: l.label
2126
+ children: i.label
2123
2127
  },
2124
2128
  `mid-${g}`
2125
2129
  )) }),
2126
- /* @__PURE__ */ t.jsx("div", { className: "gantt-timeline-scale gantt-timeline-scale-day", style: { width: pe }, children: Y.map((l, g) => {
2127
- const D = r.weekends && Kt(l.date), f = r.holidays && Zt(l.date, r.holidays);
2130
+ /* @__PURE__ */ t.jsx("div", { className: "gantt-timeline-scale gantt-timeline-scale-day", style: { width: pe }, children: Y.map((i, g) => {
2131
+ const D = r.weekends && Kt(i.date), f = r.holidays && Zt(i.date, r.holidays);
2128
2132
  return /* @__PURE__ */ t.jsx(
2129
2133
  "div",
2130
2134
  {
2131
2135
  className: `gantt-timeline-cell ${D ? "weekend" : ""} ${f ? "holiday" : ""}`,
2132
2136
  style: {
2133
- width: k,
2134
- minWidth: k,
2135
- maxWidth: k,
2137
+ width: O,
2138
+ minWidth: O,
2139
+ maxWidth: O,
2136
2140
  borderRight: g === Y.length - 1 ? "none" : "var(--wx-gantt-border)"
2137
2141
  },
2138
- children: l.label
2142
+ children: i.label
2139
2143
  },
2140
2144
  `day-${g}`
2141
2145
  );
@@ -2145,7 +2149,7 @@ const xn = ({
2145
2149
  /* @__PURE__ */ t.jsxs("div", { className: "gantt-timeline-body", style: { width: pe, position: "relative" }, children: [
2146
2150
  _e !== null && /* @__PURE__ */ t.jsxs(t.Fragment, { children: [
2147
2151
  r.showTodayLineMarker !== !1 && (() => {
2148
- const l = r.todayLineMarkerSize || 8, g = r.todayLineColor || "#ff4d4f", D = r.todayLineMarkerStyle || "triangle", f = r.todayLineOpacity !== void 0 ? r.todayLineOpacity : 1;
2152
+ const i = r.todayLineMarkerSize || 8, g = r.todayLineColor || "#ff4d4f", D = r.todayLineMarkerStyle || "triangle", f = r.todayLineOpacity !== void 0 ? r.todayLineOpacity : 1;
2149
2153
  return D === "triangle" ? /* @__PURE__ */ t.jsx(
2150
2154
  "div",
2151
2155
  {
@@ -2157,9 +2161,9 @@ const xn = ({
2157
2161
  transform: "translateX(-50%)",
2158
2162
  width: 0,
2159
2163
  height: 0,
2160
- borderLeft: `${l}px solid transparent`,
2161
- borderRight: `${l}px solid transparent`,
2162
- borderBottom: `${l}px solid ${g}`,
2164
+ borderLeft: `${i}px solid transparent`,
2165
+ borderRight: `${i}px solid transparent`,
2166
+ borderBottom: `${i}px solid ${g}`,
2163
2167
  zIndex: 7,
2164
2168
  pointerEvents: "none",
2165
2169
  opacity: f
@@ -2176,9 +2180,9 @@ const xn = ({
2176
2180
  transform: "translateX(-50%)",
2177
2181
  width: 0,
2178
2182
  height: 0,
2179
- borderLeft: `${l}px solid transparent`,
2180
- borderRight: `${l}px solid transparent`,
2181
- borderBottom: `${l * 0.7}px solid ${g}`,
2183
+ borderLeft: `${i}px solid transparent`,
2184
+ borderRight: `${i}px solid transparent`,
2185
+ borderBottom: `${i * 0.7}px solid ${g}`,
2182
2186
  zIndex: 7,
2183
2187
  pointerEvents: "none",
2184
2188
  opacity: f
@@ -2191,10 +2195,10 @@ const xn = ({
2191
2195
  style: {
2192
2196
  position: "absolute",
2193
2197
  left: `${_e}px`,
2194
- top: `-${l / 2}px`,
2198
+ top: `-${i / 2}px`,
2195
2199
  transform: "translateX(-50%)",
2196
- width: `${l}px`,
2197
- height: `${l}px`,
2200
+ width: `${i}px`,
2201
+ height: `${i}px`,
2198
2202
  borderRadius: "50%",
2199
2203
  backgroundColor: g,
2200
2204
  zIndex: 7,
@@ -2227,7 +2231,7 @@ const xn = ({
2227
2231
  ] }),
2228
2232
  Ue !== null && /* @__PURE__ */ t.jsxs(t.Fragment, { children: [
2229
2233
  r.showProjectStartLineMarker !== !1 && (() => {
2230
- const l = r.projectStartLineMarkerSize || 8, g = r.projectStartLineColor || "#40a9ff", D = r.projectStartLineMarkerStyle || "triangle", f = r.projectStartLineOpacity !== void 0 ? r.projectStartLineOpacity : 1;
2234
+ const i = r.projectStartLineMarkerSize || 8, g = r.projectStartLineColor || "#40a9ff", D = r.projectStartLineMarkerStyle || "triangle", f = r.projectStartLineOpacity !== void 0 ? r.projectStartLineOpacity : 1;
2231
2235
  return D === "triangle" ? /* @__PURE__ */ t.jsx(
2232
2236
  "div",
2233
2237
  {
@@ -2239,9 +2243,9 @@ const xn = ({
2239
2243
  transform: "translateX(-50%)",
2240
2244
  width: 0,
2241
2245
  height: 0,
2242
- borderLeft: `${l}px solid transparent`,
2243
- borderRight: `${l}px solid transparent`,
2244
- borderBottom: `${l}px solid ${g}`,
2246
+ borderLeft: `${i}px solid transparent`,
2247
+ borderRight: `${i}px solid transparent`,
2248
+ borderBottom: `${i}px solid ${g}`,
2245
2249
  zIndex: 7,
2246
2250
  pointerEvents: "none",
2247
2251
  opacity: f
@@ -2258,9 +2262,9 @@ const xn = ({
2258
2262
  transform: "translateX(-50%)",
2259
2263
  width: 0,
2260
2264
  height: 0,
2261
- borderLeft: `${l}px solid transparent`,
2262
- borderRight: `${l}px solid transparent`,
2263
- borderBottom: `${l * 0.7}px solid ${g}`,
2265
+ borderLeft: `${i}px solid transparent`,
2266
+ borderRight: `${i}px solid transparent`,
2267
+ borderBottom: `${i * 0.7}px solid ${g}`,
2264
2268
  zIndex: 7,
2265
2269
  pointerEvents: "none",
2266
2270
  opacity: f
@@ -2273,10 +2277,10 @@ const xn = ({
2273
2277
  style: {
2274
2278
  position: "absolute",
2275
2279
  left: `${Ue}px`,
2276
- top: `-${l / 2}px`,
2280
+ top: `-${i / 2}px`,
2277
2281
  transform: "translateX(-50%)",
2278
- width: `${l}px`,
2279
- height: `${l}px`,
2282
+ width: `${i}px`,
2283
+ height: `${i}px`,
2280
2284
  borderRadius: "50%",
2281
2285
  backgroundColor: g,
2282
2286
  zIndex: 7,
@@ -2307,13 +2311,13 @@ const xn = ({
2307
2311
  }
2308
2312
  )
2309
2313
  ] }),
2310
- /* @__PURE__ */ t.jsx("div", { className: "gantt-timeline-grid", children: Y.map((l, g) => {
2311
- const D = r.weekends && Kt(l.date), f = r.holidays && Zt(l.date, r.holidays);
2314
+ /* @__PURE__ */ t.jsx("div", { className: "gantt-timeline-grid", children: Y.map((i, g) => {
2315
+ const D = r.weekends && Kt(i.date), f = r.holidays && Zt(i.date, r.holidays);
2312
2316
  return /* @__PURE__ */ t.jsx(
2313
2317
  "div",
2314
2318
  {
2315
2319
  className: `gantt-timeline-grid-column ${D ? "weekend" : ""} ${f ? "holiday" : ""}`,
2316
- style: { width: k, minWidth: k }
2320
+ style: { width: O, minWidth: O }
2317
2321
  },
2318
2322
  g
2319
2323
  );
@@ -2322,12 +2326,12 @@ const xn = ({
2322
2326
  wn,
2323
2327
  {
2324
2328
  links: C,
2325
- tasks: S,
2329
+ tasks: v,
2326
2330
  getTaskPosition: Le
2327
2331
  }
2328
2332
  ),
2329
- /* @__PURE__ */ t.jsx("div", { className: "gantt-timeline-tasks", style: { width: pe }, children: De ? Array.from(v?.values() || []).map((l) => {
2330
- const g = ye(l);
2333
+ /* @__PURE__ */ t.jsx("div", { className: "gantt-timeline-tasks", style: { width: pe }, children: De ? Array.from(S?.values() || []).map((i) => {
2334
+ const g = ye(i);
2331
2335
  return /* @__PURE__ */ t.jsx(
2332
2336
  "div",
2333
2337
  {
@@ -2340,14 +2344,14 @@ const xn = ({
2340
2344
  left: `${g.left}px`,
2341
2345
  width: `${g.width}px`
2342
2346
  },
2343
- title: `Baseline: ${l.start.toLocaleDateString()} - ${l.end.toLocaleDateString()}`
2347
+ title: `Baseline: ${i.start.toLocaleDateString()} - ${i.end.toLocaleDateString()}`
2344
2348
  }
2345
2349
  )
2346
2350
  },
2347
- `baseline-only-${l.taskId}`
2351
+ `baseline-only-${i.taskId}`
2348
2352
  );
2349
- }) : S.map((l) => {
2350
- const g = z(l), D = j ? v?.get(l.id) : void 0, f = D ? ye(D) : void 0;
2353
+ }) : v.map((i) => {
2354
+ const g = z(i), D = j ? S?.get(i.id) : void 0, f = D ? ye(D) : void 0;
2351
2355
  return /* @__PURE__ */ t.jsxs(
2352
2356
  "div",
2353
2357
  {
@@ -2356,7 +2360,7 @@ const xn = ({
2356
2360
  D && f && /* @__PURE__ */ t.jsx(
2357
2361
  "div",
2358
2362
  {
2359
- className: `gantt-baseline-bar ${l.type === "milestone" ? "milestone" : ""}`,
2363
+ className: `gantt-baseline-bar ${i.type === "milestone" ? "milestone" : ""}`,
2360
2364
  style: {
2361
2365
  left: `${f.left}px`,
2362
2366
  width: `${f.width}px`
@@ -2364,28 +2368,28 @@ const xn = ({
2364
2368
  title: `Baseline: ${D.start.toLocaleDateString()} - ${D.end.toLocaleDateString()}`
2365
2369
  }
2366
2370
  ),
2367
- !l.hideBar && /* @__PURE__ */ t.jsx(
2371
+ !i.hideBar && /* @__PURE__ */ t.jsx(
2368
2372
  xn,
2369
2373
  {
2370
- task: l,
2374
+ task: i,
2371
2375
  baseline: D,
2372
- dependencyRuleDescriptions: R.get(l.id) || [],
2376
+ dependencyRuleDescriptions: R.get(i.id) || [],
2373
2377
  tooltipConfig: m,
2374
2378
  position: g,
2375
- selected: c === l.id,
2376
- dragging: I.taskId === l.id,
2379
+ selected: c === i.id,
2380
+ dragging: I.taskId === i.id,
2377
2381
  dragDeltaX: I.dragDeltaX,
2378
2382
  dragType: I.type,
2379
- onClick: () => b(l.id),
2380
- onDragStart: (U, q, ee) => {
2381
- ne(l.id, U, q, ee), u(l.id, U, q);
2383
+ onClick: () => b(i.id),
2384
+ onDragStart: (U, G, ee) => {
2385
+ ne(i.id, U, G, ee), u(i.id, U, G);
2382
2386
  },
2383
2387
  readonly: r.readonly
2384
2388
  }
2385
2389
  )
2386
2390
  ]
2387
2391
  },
2388
- l.id
2392
+ i.id
2389
2393
  );
2390
2394
  }) })
2391
2395
  ] })
@@ -2399,14 +2403,14 @@ Lr.displayName = "Timeline";
2399
2403
  const Fr = wr((e, a) => /* @__PURE__ */ t.jsx("div", { className: "gantt-chart-wrapper", style: { flex: 1, minWidth: 0 }, children: /* @__PURE__ */ t.jsx(Lr, { ...e, ref: a }) }));
2400
2404
  Fr.displayName = "Chart";
2401
2405
  const { Search: vn } = pt, jn = ({ onFilterChange: e, owners: a = [], uiConfig: n = {} }) => {
2402
- const [s, r] = G({
2406
+ const [s, r] = J({
2403
2407
  searchText: "",
2404
2408
  status: "all",
2405
2409
  priority: "all",
2406
2410
  owner: ""
2407
2411
  }), c = (d) => {
2408
- const p = { ...s, ...d };
2409
- r(p), e(p);
2412
+ const h = { ...s, ...d };
2413
+ r(h), e(h);
2410
2414
  }, b = () => {
2411
2415
  const d = {
2412
2416
  searchText: "",
@@ -2430,7 +2434,7 @@ const { Search: vn } = pt, jn = ({ onFilterChange: e, owners: a = [], uiConfig:
2430
2434
  ) }),
2431
2435
  /* @__PURE__ */ t.jsxs("div", { className: "gantt-filter-right", children: [
2432
2436
  /* @__PURE__ */ t.jsx(
2433
- ke,
2437
+ Oe,
2434
2438
  {
2435
2439
  value: s.status,
2436
2440
  onChange: (d) => c({ status: d }),
@@ -2445,7 +2449,7 @@ const { Search: vn } = pt, jn = ({ onFilterChange: e, owners: a = [], uiConfig:
2445
2449
  }
2446
2450
  ),
2447
2451
  /* @__PURE__ */ t.jsx(
2448
- ke,
2452
+ Oe,
2449
2453
  {
2450
2454
  value: s.priority,
2451
2455
  onChange: (d) => c({ priority: d }),
@@ -2460,7 +2464,7 @@ const { Search: vn } = pt, jn = ({ onFilterChange: e, owners: a = [], uiConfig:
2460
2464
  }
2461
2465
  ),
2462
2466
  /* @__PURE__ */ t.jsx(
2463
- ke,
2467
+ Oe,
2464
2468
  {
2465
2469
  value: s.owner || void 0,
2466
2470
  onChange: (d) => c({ owner: d || "" }),
@@ -2497,21 +2501,21 @@ const { Search: vn } = pt, jn = ({ onFilterChange: e, owners: a = [], uiConfig:
2497
2501
  onFilterChange: b,
2498
2502
  owners: u,
2499
2503
  onAddTask: d,
2500
- uiConfig: p,
2501
- iconConfig: h = {},
2502
- styleConfig: v
2504
+ uiConfig: h,
2505
+ iconConfig: p = {},
2506
+ styleConfig: S
2503
2507
  }) => {
2504
- const y = jt(v), m = p.showZoomButtons !== !1, E = p.showExportButtons !== !1, F = s.length > 1 && r, N = m && E;
2508
+ const y = jt(S), m = h.showZoomButtons !== !1, E = h.showExportButtons !== !1, F = s.length > 1 && r, N = m && E;
2505
2509
  return /* @__PURE__ */ t.jsxs("div", { className: "gantt-toolbar-wrapper", children: [
2506
2510
  /* @__PURE__ */ t.jsxs("div", { className: "gantt-toolbar", children: [
2507
- /* @__PURE__ */ t.jsx("div", { className: "gantt-toolbar-left", children: /* @__PURE__ */ t.jsx(er, { size: 8, children: p.showAddTaskButton !== !1 && /* @__PURE__ */ t.jsx(
2511
+ /* @__PURE__ */ t.jsx("div", { className: "gantt-toolbar-left", children: /* @__PURE__ */ t.jsx(er, { size: 8, children: h.showAddTaskButton !== !1 && /* @__PURE__ */ t.jsx(
2508
2512
  Pe,
2509
2513
  {
2510
2514
  type: "primary",
2511
- icon: ct(h.addTask, ar),
2515
+ icon: ct(p.addTask, ar),
2512
2516
  onClick: () => d?.(),
2513
2517
  style: y.buttonPrimary,
2514
- children: p.addTaskButtonText || "New Stage"
2518
+ children: h.addTaskButtonText || "New Stage"
2515
2519
  }
2516
2520
  ) }) }),
2517
2521
  /* @__PURE__ */ t.jsx("div", { className: "gantt-toolbar-right", children: /* @__PURE__ */ t.jsxs(er, { size: 4, children: [
@@ -2528,26 +2532,26 @@ const { Search: vn } = pt, jn = ({ onFilterChange: e, owners: a = [], uiConfig:
2528
2532
  (m || E) && /* @__PURE__ */ t.jsx(tr, { type: "vertical", style: { height: 24, margin: "0 4px" } })
2529
2533
  ] }),
2530
2534
  m && /* @__PURE__ */ t.jsxs(t.Fragment, { children: [
2531
- /* @__PURE__ */ t.jsx(nt, { title: p.zoomOutTooltip || "Zoom Out", children: /* @__PURE__ */ t.jsx(
2535
+ /* @__PURE__ */ t.jsx(nt, { title: h.zoomOutTooltip || "Zoom Out", children: /* @__PURE__ */ t.jsx(
2532
2536
  Pe,
2533
2537
  {
2534
- icon: ct(h.zoomOut, Gr),
2538
+ icon: ct(p.zoomOut, Gr),
2535
2539
  onClick: () => a(Math.max(0.5, e - 0.25)),
2536
2540
  style: y.buttonSecondary
2537
2541
  }
2538
2542
  ) }),
2539
- /* @__PURE__ */ t.jsx(nt, { title: p.zoomInTooltip || "Zoom In", children: /* @__PURE__ */ t.jsx(
2543
+ /* @__PURE__ */ t.jsx(nt, { title: h.zoomInTooltip || "Zoom In", children: /* @__PURE__ */ t.jsx(
2540
2544
  Pe,
2541
2545
  {
2542
- icon: ct(h.zoomIn, Jr),
2546
+ icon: ct(p.zoomIn, Jr),
2543
2547
  onClick: () => a(Math.min(2, e + 0.25)),
2544
2548
  style: y.buttonSecondary
2545
2549
  }
2546
2550
  ) }),
2547
- /* @__PURE__ */ t.jsx(nt, { title: p.resetZoomTooltip || "Reset Zoom", children: /* @__PURE__ */ t.jsx(
2551
+ /* @__PURE__ */ t.jsx(nt, { title: h.resetZoomTooltip || "Reset Zoom", children: /* @__PURE__ */ t.jsx(
2548
2552
  Pe,
2549
2553
  {
2550
- icon: ct(h.resetZoom, jr),
2554
+ icon: ct(p.resetZoom, jr),
2551
2555
  onClick: () => a(1),
2552
2556
  style: y.buttonSecondary
2553
2557
  }
@@ -2555,34 +2559,34 @@ const { Search: vn } = pt, jn = ({ onFilterChange: e, owners: a = [], uiConfig:
2555
2559
  ] }),
2556
2560
  N && /* @__PURE__ */ t.jsx(tr, { type: "vertical", style: { height: 24, margin: "0 4px" } }),
2557
2561
  E && /* @__PURE__ */ t.jsxs(t.Fragment, { children: [
2558
- /* @__PURE__ */ t.jsx(nt, { title: p.exportCSVTooltip || "Export to CSV", children: /* @__PURE__ */ t.jsx(
2562
+ /* @__PURE__ */ t.jsx(nt, { title: h.exportCSVTooltip || "Export to CSV", children: /* @__PURE__ */ t.jsx(
2559
2563
  Pe,
2560
2564
  {
2561
- icon: ct(h.exportCSV, Kr),
2565
+ icon: ct(p.exportCSV, Kr),
2562
2566
  onClick: () => c("csv"),
2563
2567
  style: y.buttonSecondary
2564
2568
  }
2565
2569
  ) }),
2566
- /* @__PURE__ */ t.jsx(nt, { title: p.exportExcelTooltip || "Export to Excel", children: /* @__PURE__ */ t.jsx(
2570
+ /* @__PURE__ */ t.jsx(nt, { title: h.exportExcelTooltip || "Export to Excel", children: /* @__PURE__ */ t.jsx(
2567
2571
  Pe,
2568
2572
  {
2569
- icon: ct(h.exportExcel, Zr),
2573
+ icon: ct(p.exportExcel, Zr),
2570
2574
  onClick: () => c("excel"),
2571
2575
  style: y.buttonSecondary
2572
2576
  }
2573
2577
  ) }),
2574
- /* @__PURE__ */ t.jsx(nt, { title: p.exportJSONTooltip || "Export to JSON", children: /* @__PURE__ */ t.jsx(
2578
+ /* @__PURE__ */ t.jsx(nt, { title: h.exportJSONTooltip || "Export to JSON", children: /* @__PURE__ */ t.jsx(
2575
2579
  Pe,
2576
2580
  {
2577
- icon: ct(h.exportJSON, Qr),
2581
+ icon: ct(p.exportJSON, Qr),
2578
2582
  onClick: () => c("json"),
2579
2583
  style: y.buttonSecondary
2580
2584
  }
2581
2585
  ) }),
2582
- /* @__PURE__ */ t.jsx(nt, { title: p.exportPDFTooltip || "Export to PDF", children: /* @__PURE__ */ t.jsx(
2586
+ /* @__PURE__ */ t.jsx(nt, { title: h.exportPDFTooltip || "Export to PDF", children: /* @__PURE__ */ t.jsx(
2583
2587
  Pe,
2584
2588
  {
2585
- icon: ct(h.exportPDF, en),
2589
+ icon: ct(p.exportPDF, en),
2586
2590
  onClick: () => c("pdf"),
2587
2591
  style: y.buttonSecondary
2588
2592
  }
@@ -2590,29 +2594,29 @@ const { Search: vn } = pt, jn = ({ onFilterChange: e, owners: a = [], uiConfig:
2590
2594
  ] })
2591
2595
  ] }) })
2592
2596
  ] }),
2593
- p.showFilterSearch !== !1 && /* @__PURE__ */ t.jsx(
2597
+ h.showFilterSearch !== !1 && /* @__PURE__ */ t.jsx(
2594
2598
  jn,
2595
2599
  {
2596
2600
  onFilterChange: b,
2597
2601
  owners: u,
2598
- uiConfig: p
2602
+ uiConfig: h
2599
2603
  }
2600
2604
  )
2601
2605
  ] });
2602
- }, { Option: St } = ke, { TextArea: Dn } = pt, Mn = ({ onCreateTask: e, onClose: a, uiConfig: n = {}, parentId: s, parentTaskName: r, styleConfig: c }) => {
2603
- const [b] = je.useForm(), u = jt(c), d = (p) => {
2604
- const h = p.start.toDate(), v = new Date(h);
2605
- v.setDate(v.getDate() + (p.duration || 1)), e({
2606
- text: p.text,
2607
- start: h,
2608
- end: v,
2609
- duration: p.duration || 1,
2610
- progress: p.progress || 0,
2611
- type: p.type,
2612
- color: typeof p.color == "string" ? p.color : p.color?.toHexString?.() || "#4A90E2",
2613
- owner: p.owner || "",
2614
- priority: p.priority || "medium",
2615
- details: p.details || "",
2606
+ }, { Option: St } = Oe, { TextArea: Dn } = pt, Mn = ({ onCreateTask: e, onClose: a, uiConfig: n = {}, parentId: s, parentTaskName: r, styleConfig: c }) => {
2607
+ const [b] = je.useForm(), u = jt(c), d = (h) => {
2608
+ const p = h.start.toDate(), S = new Date(p);
2609
+ S.setDate(S.getDate() + (h.duration || 1)), e({
2610
+ text: h.text,
2611
+ start: p,
2612
+ end: S,
2613
+ duration: h.duration || 1,
2614
+ progress: h.progress || 0,
2615
+ type: h.type,
2616
+ color: typeof h.color == "string" ? h.color : h.color?.toHexString?.() || "#4A90E2",
2617
+ owner: h.owner || "",
2618
+ priority: h.priority || "medium",
2619
+ details: h.details || "",
2616
2620
  parent: s
2617
2621
  // Set parent for subtasks
2618
2622
  }, s), a();
@@ -2659,12 +2663,12 @@ const { Search: vn } = pt, jn = ({ onFilterChange: e, owners: a = [], uiConfig:
2659
2663
  }
2660
2664
  ),
2661
2665
  /* @__PURE__ */ t.jsxs("div", { style: { display: "flex", gap: 16 }, children: [
2662
- /* @__PURE__ */ t.jsx(je.Item, { name: "type", label: n.typeLabel || "Type", style: { flex: 1 }, children: /* @__PURE__ */ t.jsxs(ke, { style: u.input, children: [
2666
+ /* @__PURE__ */ t.jsx(je.Item, { name: "type", label: n.typeLabel || "Type", style: { flex: 1 }, children: /* @__PURE__ */ t.jsxs(Oe, { style: u.input, children: [
2663
2667
  /* @__PURE__ */ t.jsx(St, { value: "task", children: n.taskTypeOptions?.task || "Stage" }),
2664
2668
  /* @__PURE__ */ t.jsx(St, { value: "milestone", children: n.taskTypeOptions?.milestone || "Milestone" }),
2665
2669
  /* @__PURE__ */ t.jsx(St, { value: "project", children: n.taskTypeOptions?.project || "Project" })
2666
2670
  ] }) }),
2667
- /* @__PURE__ */ t.jsx(je.Item, { name: "priority", label: n.priorityLabel || "Priority", style: { flex: 1 }, children: /* @__PURE__ */ t.jsxs(ke, { style: u.input, children: [
2671
+ /* @__PURE__ */ t.jsx(je.Item, { name: "priority", label: n.priorityLabel || "Priority", style: { flex: 1 }, children: /* @__PURE__ */ t.jsxs(Oe, { style: u.input, children: [
2668
2672
  /* @__PURE__ */ t.jsx(St, { value: "low", children: n.priorityOptions?.low || "Low" }),
2669
2673
  /* @__PURE__ */ t.jsx(St, { value: "medium", children: n.priorityOptions?.medium || "Medium" }),
2670
2674
  /* @__PURE__ */ t.jsx(St, { value: "high", children: n.priorityOptions?.high || "High" })
@@ -2685,23 +2689,23 @@ const { Search: vn } = pt, jn = ({ onFilterChange: e, owners: a = [], uiConfig:
2685
2689
  )
2686
2690
  }
2687
2691
  );
2688
- }, { Option: vt } = ke, { TextArea: En } = pt, { confirm: Ln } = At, Fn = ({ task: e, onUpdate: a, onDelete: n, onClose: s, uiConfig: r = {}, styleConfig: c }) => {
2689
- const [b] = je.useForm(), u = jt(c), d = (h) => {
2690
- const v = h.start.toDate(), y = new Date(v);
2691
- y.setDate(y.getDate() + (h.duration || 1)), a({
2692
+ }, { Option: vt } = Oe, { TextArea: En } = pt, { confirm: Ln } = At, Fn = ({ task: e, onUpdate: a, onDelete: n, onClose: s, uiConfig: r = {}, styleConfig: c }) => {
2693
+ const [b] = je.useForm(), u = jt(c), d = (p) => {
2694
+ const S = p.start.toDate(), y = new Date(S);
2695
+ y.setDate(y.getDate() + (p.duration || 1)), a({
2692
2696
  ...e,
2693
- text: h.text,
2694
- start: v,
2697
+ text: p.text,
2698
+ start: S,
2695
2699
  end: y,
2696
- duration: h.duration || 1,
2697
- progress: h.progress || 0,
2698
- type: h.type,
2699
- color: typeof h.color == "string" ? h.color : h.color?.toHexString?.() || "#4A90E2",
2700
- owner: h.owner || "",
2701
- priority: h.priority || "medium",
2702
- details: h.details || ""
2700
+ duration: p.duration || 1,
2701
+ progress: p.progress || 0,
2702
+ type: p.type,
2703
+ color: typeof p.color == "string" ? p.color : p.color?.toHexString?.() || "#4A90E2",
2704
+ owner: p.owner || "",
2705
+ priority: p.priority || "medium",
2706
+ details: p.details || ""
2703
2707
  }), s();
2704
- }, p = () => {
2708
+ }, h = () => {
2705
2709
  Ln({
2706
2710
  title: r.deleteConfirmTitle ? `${r.deleteConfirmTitle}: "${e.text}"?` : `Are you sure you want to delete "${e.text}"?`,
2707
2711
  icon: /* @__PURE__ */ t.jsx(Ee, { icon: tn, style: { color: "#faad14", marginRight: 8 } }),
@@ -2721,7 +2725,7 @@ const { Search: vn } = pt, jn = ({ onFilterChange: e, owners: a = [], uiConfig:
2721
2725
  open: !0,
2722
2726
  onCancel: s,
2723
2727
  footer: [
2724
- /* @__PURE__ */ t.jsx(Pe, { danger: !0, onClick: p, style: { float: "left", ...u.buttonDanger }, children: r.taskEditorDeleteText || "Delete" }, "delete"),
2728
+ /* @__PURE__ */ t.jsx(Pe, { danger: !0, onClick: h, style: { float: "left", ...u.buttonDanger }, children: r.taskEditorDeleteText || "Delete" }, "delete"),
2725
2729
  /* @__PURE__ */ t.jsx(Pe, { onClick: s, style: u.buttonSecondary, children: r.taskEditorCancelText || "Cancel" }, "cancel"),
2726
2730
  /* @__PURE__ */ t.jsx(Pe, { type: "primary", onClick: () => b.submit(), style: u.buttonPrimary, children: r.taskEditorSaveText || "Save Changes" }, "submit")
2727
2731
  ],
@@ -2759,12 +2763,12 @@ const { Search: vn } = pt, jn = ({ onFilterChange: e, owners: a = [], uiConfig:
2759
2763
  }
2760
2764
  ),
2761
2765
  /* @__PURE__ */ t.jsxs("div", { style: { display: "flex", gap: 16 }, children: [
2762
- /* @__PURE__ */ t.jsx(je.Item, { name: "type", label: r.typeLabel || "Type", style: { flex: 1 }, children: /* @__PURE__ */ t.jsxs(ke, { style: u.input, children: [
2766
+ /* @__PURE__ */ t.jsx(je.Item, { name: "type", label: r.typeLabel || "Type", style: { flex: 1 }, children: /* @__PURE__ */ t.jsxs(Oe, { style: u.input, children: [
2763
2767
  /* @__PURE__ */ t.jsx(vt, { value: "task", children: r.taskTypeOptions?.task || "Stage" }),
2764
2768
  /* @__PURE__ */ t.jsx(vt, { value: "milestone", children: r.taskTypeOptions?.milestone || "Milestone" }),
2765
2769
  /* @__PURE__ */ t.jsx(vt, { value: "project", children: r.taskTypeOptions?.project || "Project" })
2766
2770
  ] }) }),
2767
- /* @__PURE__ */ t.jsx(je.Item, { name: "priority", label: r.priorityLabel || "Priority", style: { flex: 1 }, children: /* @__PURE__ */ t.jsxs(ke, { style: u.input, children: [
2771
+ /* @__PURE__ */ t.jsx(je.Item, { name: "priority", label: r.priorityLabel || "Priority", style: { flex: 1 }, children: /* @__PURE__ */ t.jsxs(Oe, { style: u.input, children: [
2768
2772
  /* @__PURE__ */ t.jsx(vt, { value: "low", children: r.priorityOptions?.low || "Low" }),
2769
2773
  /* @__PURE__ */ t.jsx(vt, { value: "medium", children: r.priorityOptions?.medium || "Medium" }),
2770
2774
  /* @__PURE__ */ t.jsx(vt, { value: "high", children: r.priorityOptions?.high || "High" })
@@ -2785,7 +2789,7 @@ const { Search: vn } = pt, jn = ({ onFilterChange: e, owners: a = [], uiConfig:
2785
2789
  )
2786
2790
  }
2787
2791
  );
2788
- }, { Title: Pt, Text: gt, Paragraph: Rn } = br, { Option: rt } = ke, Pn = ({
2792
+ }, { Title: Pt, Text: gt, Paragraph: Rn } = br, { Option: rt } = Oe, Pn = ({
2789
2793
  task: e,
2790
2794
  allTasks: a,
2791
2795
  links: n,
@@ -2795,18 +2799,18 @@ const { Search: vn } = pt, jn = ({ onFilterChange: e, owners: a = [], uiConfig:
2795
2799
  onClose: b,
2796
2800
  styleConfig: u
2797
2801
  }) => {
2798
- const d = jt(u), [p, h] = G(""), [v, y] = G("e2s"), [m, E] = G(0), [F, N] = G("day"), [M, S] = G(e.duration), [w, C] = G(""), Z = n.filter((R) => R.target === e.id), W = a.filter((R) => R.id !== e.id && R.id !== e.parent), re = () => {
2799
- if (p) {
2802
+ const d = jt(u), [h, p] = J(""), [S, y] = J("e2s"), [m, E] = J(0), [F, N] = J("day"), [M, v] = J(e.duration), [w, C] = J(""), Z = n.filter((R) => R.target === e.id), W = a.filter((R) => R.id !== e.id && R.id !== e.parent), re = () => {
2803
+ if (h) {
2800
2804
  const R = rr(m, F);
2801
2805
  if (M !== e.duration && c) {
2802
- const O = Te(new Date(e.start), M, "day");
2806
+ const k = Te(new Date(e.start), M, "day");
2803
2807
  c({
2804
2808
  ...e,
2805
2809
  duration: M,
2806
- end: O
2810
+ end: k
2807
2811
  });
2808
2812
  }
2809
- s(p, e.id, v, R), h(""), E(0), N("day");
2813
+ s(h, e.id, S, R), p(""), E(0), N("day");
2810
2814
  }
2811
2815
  }, le = () => {
2812
2816
  if (!w.trim()) return;
@@ -2816,13 +2820,13 @@ const { Search: vn } = pt, jn = ({ onFilterChange: e, owners: a = [], uiConfig:
2816
2820
  Example: 3FS+10d`);
2817
2821
  return;
2818
2822
  }
2819
- const O = R.taskNumber - 1, B = a[O];
2823
+ const k = R.taskNumber - 1, B = a[k];
2820
2824
  if (!B) {
2821
2825
  alert(`Task ${R.taskNumber} not found`);
2822
2826
  return;
2823
2827
  }
2824
- const Y = fn(R.type), k = rr(R.lag, R.lagUnit);
2825
- s(B.id, e.id, Y, k), C("");
2828
+ const Y = fn(R.type), O = rr(R.lag, R.lagUnit);
2829
+ s(B.id, e.id, Y, O), C("");
2826
2830
  }, j = (R) => {
2827
2831
  switch (R) {
2828
2832
  case "e2s":
@@ -2880,14 +2884,14 @@ Example: 3FS+10d`);
2880
2884
  /* @__PURE__ */ t.jsxs("div", { children: [
2881
2885
  /* @__PURE__ */ t.jsx(gt, { style: { display: "block", marginBottom: 8, fontSize: 13, color: d.font?.color }, children: "Predecessor" }),
2882
2886
  /* @__PURE__ */ t.jsx(
2883
- ke,
2887
+ Oe,
2884
2888
  {
2885
2889
  showSearch: !0,
2886
2890
  placeholder: "Select a task",
2887
2891
  optionFilterProp: "children",
2888
2892
  style: { width: "100%", ...d.input },
2889
- value: p,
2890
- onChange: h,
2893
+ value: h,
2894
+ onChange: p,
2891
2895
  children: W.map((R) => /* @__PURE__ */ t.jsxs(rt, { value: R.id, children: [
2892
2896
  "[",
2893
2897
  a.indexOf(R) + 1,
@@ -2900,10 +2904,10 @@ Example: 3FS+10d`);
2900
2904
  /* @__PURE__ */ t.jsxs("div", { children: [
2901
2905
  /* @__PURE__ */ t.jsx(gt, { style: { display: "block", marginBottom: 8, fontSize: 13, color: d.font?.color }, children: "Type" }),
2902
2906
  /* @__PURE__ */ t.jsxs(
2903
- ke,
2907
+ Oe,
2904
2908
  {
2905
2909
  style: { width: "100%", ...d.input },
2906
- value: v,
2910
+ value: S,
2907
2911
  onChange: y,
2908
2912
  children: [
2909
2913
  /* @__PURE__ */ t.jsx(rt, { value: "e2s", children: "Finish-to-Start (FS)" }),
@@ -2929,7 +2933,7 @@ Example: 3FS+10d`);
2929
2933
  /* @__PURE__ */ t.jsxs("div", { style: { flex: 1 }, children: [
2930
2934
  /* @__PURE__ */ t.jsx(gt, { style: { display: "block", marginBottom: 8, fontSize: 13, color: d.font?.color }, children: "Units" }),
2931
2935
  /* @__PURE__ */ t.jsxs(
2932
- ke,
2936
+ Oe,
2933
2937
  {
2934
2938
  style: { width: "100%", ...d.input },
2935
2939
  value: F,
@@ -2952,7 +2956,7 @@ Example: 3FS+10d`);
2952
2956
  style: { width: "100%", ...d.input },
2953
2957
  min: 1,
2954
2958
  value: M,
2955
- onChange: (R) => S(R || 1)
2959
+ onChange: (R) => v(R || 1)
2956
2960
  }
2957
2961
  )
2958
2962
  ] }),
@@ -2963,7 +2967,7 @@ Example: 3FS+10d`);
2963
2967
  icon: /* @__PURE__ */ t.jsx(Ee, { icon: ar, style: { marginRight: 8 } }),
2964
2968
  block: !0,
2965
2969
  onClick: re,
2966
- disabled: !p,
2970
+ disabled: !h,
2967
2971
  style: {
2968
2972
  height: 40,
2969
2973
  marginTop: 8,
@@ -3027,7 +3031,7 @@ Example: 3FS+10d`);
3027
3031
  dataSource: Z,
3028
3032
  locale: { emptyText: /* @__PURE__ */ t.jsx(gt, { type: "secondary", style: { color: d.font?.color, opacity: 0.5 }, children: "No dependencies added yet." }) },
3029
3033
  renderItem: (R) => {
3030
- const O = a.find((B) => B.id === R.source);
3034
+ const k = a.find((B) => B.id === R.source);
3031
3035
  return /* @__PURE__ */ t.jsx(
3032
3036
  Jt.Item,
3033
3037
  {
@@ -3064,9 +3068,9 @@ Example: 3FS+10d`);
3064
3068
  color: "#fff",
3065
3069
  fontSize: 12,
3066
3070
  fontWeight: "bold"
3067
- }, children: O ? a.indexOf(O) + 1 : "?" }),
3071
+ }, children: k ? a.indexOf(k) + 1 : "?" }),
3068
3072
  title: /* @__PURE__ */ t.jsxs("div", { style: { display: "flex", alignItems: "center", gap: 12 }, children: [
3069
- /* @__PURE__ */ t.jsx("span", { style: { fontWeight: 600, color: d.font?.color }, children: O?.text || "Unknown Task" }),
3073
+ /* @__PURE__ */ t.jsx("span", { style: { fontWeight: 600, color: d.font?.color }, children: k?.text || "Unknown Task" }),
3070
3074
  /* @__PURE__ */ t.jsx(Wr, { color: X(R.type), style: { margin: 0 }, children: j(R.type) })
3071
3075
  ] }),
3072
3076
  description: /* @__PURE__ */ t.jsx("div", { style: { display: "flex", alignItems: "center", gap: 16, marginTop: 4 }, children: /* @__PURE__ */ t.jsxs("span", { style: { fontSize: 12, color: d.font?.color, opacity: 0.7 }, children: [
@@ -3103,9 +3107,9 @@ Example: 3FS+10d`);
3103
3107
  onDependencies: b,
3104
3108
  onConvertToMilestone: u,
3105
3109
  onConvertToTask: d,
3106
- onConvertToProject: p,
3107
- onAutoSchedule: h,
3108
- onClose: v,
3110
+ onConvertToProject: h,
3111
+ onAutoSchedule: p,
3112
+ onClose: S,
3109
3113
  styleConfig: y
3110
3114
  }) => {
3111
3115
  const m = jt(y);
@@ -3116,7 +3120,7 @@ Example: 3FS+10d`);
3116
3120
  label: "Edit",
3117
3121
  icon: /* @__PURE__ */ t.jsx(Ee, { icon: nn }),
3118
3122
  onClick: () => {
3119
- s(), v();
3123
+ s(), S();
3120
3124
  }
3121
3125
  },
3122
3126
  {
@@ -3124,7 +3128,7 @@ Example: 3FS+10d`);
3124
3128
  label: "Copy",
3125
3129
  icon: /* @__PURE__ */ t.jsx(Ee, { icon: an }),
3126
3130
  onClick: () => {
3127
- c(), v();
3131
+ c(), S();
3128
3132
  }
3129
3133
  },
3130
3134
  {
@@ -3132,7 +3136,7 @@ Example: 3FS+10d`);
3132
3136
  label: "Dependencies",
3133
3137
  icon: /* @__PURE__ */ t.jsx(Ee, { icon: Tr }),
3134
3138
  onClick: () => {
3135
- b(), v();
3139
+ b(), S();
3136
3140
  }
3137
3141
  },
3138
3142
  {
@@ -3149,7 +3153,7 @@ Example: 3FS+10d`);
3149
3153
  icon: /* @__PURE__ */ t.jsx(Ee, { icon: on }),
3150
3154
  disabled: n.type === "milestone",
3151
3155
  onClick: () => {
3152
- u(), v();
3156
+ u(), S();
3153
3157
  }
3154
3158
  },
3155
3159
  {
@@ -3158,7 +3162,7 @@ Example: 3FS+10d`);
3158
3162
  icon: /* @__PURE__ */ t.jsx(Ee, { icon: sn }),
3159
3163
  disabled: n.type === "task",
3160
3164
  onClick: () => {
3161
- d(), v();
3165
+ d(), S();
3162
3166
  }
3163
3167
  },
3164
3168
  {
@@ -3167,7 +3171,7 @@ Example: 3FS+10d`);
3167
3171
  icon: /* @__PURE__ */ t.jsx(Ee, { icon: ln }),
3168
3172
  disabled: n.type === "project",
3169
3173
  onClick: () => {
3170
- p(), v();
3174
+ h(), S();
3171
3175
  }
3172
3176
  }
3173
3177
  ]
@@ -3177,7 +3181,7 @@ Example: 3FS+10d`);
3177
3181
  label: "Auto Schedule",
3178
3182
  icon: /* @__PURE__ */ t.jsx(Ee, { icon: jr }),
3179
3183
  onClick: () => {
3180
- h?.(), v();
3184
+ p?.(), S();
3181
3185
  }
3182
3186
  },
3183
3187
  {
@@ -3189,7 +3193,7 @@ Example: 3FS+10d`);
3189
3193
  icon: /* @__PURE__ */ t.jsx(Ee, { icon: Dr }),
3190
3194
  danger: !0,
3191
3195
  onClick: () => {
3192
- r(), v();
3196
+ r(), S();
3193
3197
  }
3194
3198
  }
3195
3199
  ];
@@ -3220,52 +3224,52 @@ Example: 3FS+10d`);
3220
3224
  )
3221
3225
  }
3222
3226
  );
3223
- }, On = (e, a = []) => {
3224
- const [n, s] = G([]), [r, c] = G(-1), [b, u] = G(e), [d, p] = G(a);
3227
+ }, kn = (e, a = []) => {
3228
+ const [n, s] = J([]), [r, c] = J(-1), [b, u] = J(e), [d, h] = J(a);
3225
3229
  ut(() => {
3226
3230
  u(e);
3227
3231
  }, [e]), ut(() => {
3228
- p(a);
3232
+ h(a);
3229
3233
  }, [a]);
3230
- const h = Je((S, w, C) => {
3234
+ const p = Je((v, w, C) => {
3231
3235
  const Z = {
3232
- type: S,
3236
+ type: v,
3233
3237
  before: w,
3234
3238
  after: C,
3235
3239
  timestamp: Date.now()
3236
3240
  }, W = n.slice(0, r + 1);
3237
3241
  W.push(Z), W.length > 50 ? W.shift() : c(r + 1), s(W);
3238
- }, [n, r]), v = Je(() => {
3242
+ }, [n, r]), S = Je(() => {
3239
3243
  if (r < 0) return;
3240
- const S = n[r];
3241
- u(S.before.tasks), p(S.before.links), c(r - 1);
3244
+ const v = n[r];
3245
+ u(v.before.tasks), h(v.before.links), c(r - 1);
3242
3246
  }, [n, r]), y = Je(() => {
3243
3247
  if (r >= n.length - 1) return;
3244
- const S = n[r + 1];
3245
- u(S.after.tasks), p(S.after.links), c(r + 1);
3246
- }, [n, r]), m = r >= 0, E = r < n.length - 1, F = Je((S) => {
3247
- const w = { tasks: b, links: d }, C = b.map((W) => W.id === S.id ? S : W);
3248
- h("task_update", w, { tasks: C, links: d }), u(C);
3249
- }, [b, d, h]), N = Je((S) => {
3250
- const w = { tasks: b, links: d }, C = [...b, S];
3251
- h("task_create", w, { tasks: C, links: d }), u(C);
3252
- }, [b, d, h]), M = Je((S) => {
3253
- const w = { tasks: b, links: d }, C = b.filter((re) => re.id !== S), Z = d.filter((re) => re.source !== S && re.target !== S);
3254
- h("task_delete", w, { tasks: C, links: Z }), u(C), p(Z);
3255
- }, [b, d, h]);
3248
+ const v = n[r + 1];
3249
+ u(v.after.tasks), h(v.after.links), c(r + 1);
3250
+ }, [n, r]), m = r >= 0, E = r < n.length - 1, F = Je((v) => {
3251
+ const w = { tasks: b, links: d }, C = b.map((W) => W.id === v.id ? v : W);
3252
+ p("task_update", w, { tasks: C, links: d }), u(C);
3253
+ }, [b, d, p]), N = Je((v) => {
3254
+ const w = { tasks: b, links: d }, C = [...b, v];
3255
+ p("task_create", w, { tasks: C, links: d }), u(C);
3256
+ }, [b, d, p]), M = Je((v) => {
3257
+ const w = { tasks: b, links: d }, C = b.filter((re) => re.id !== v), Z = d.filter((re) => re.source !== v && re.target !== v);
3258
+ p("task_delete", w, { tasks: C, links: Z }), u(C), h(Z);
3259
+ }, [b, d, p]);
3256
3260
  return {
3257
3261
  tasks: b,
3258
3262
  links: d,
3259
3263
  setTasks: u,
3260
- setLinks: p,
3261
- undo: v,
3264
+ setLinks: h,
3265
+ undo: S,
3262
3266
  redo: y,
3263
3267
  canUndo: m,
3264
3268
  canRedo: E,
3265
3269
  updateTask: F,
3266
3270
  createTask: N,
3267
3271
  deleteTask: M,
3268
- saveState: h,
3272
+ saveState: p,
3269
3273
  history: n
3270
3274
  };
3271
3275
  }, Rr = (e, a, n = { mode: "forward" }) => {
@@ -3274,22 +3278,22 @@ Example: 3FS+10d`);
3274
3278
  s.set(c.id, []), r.set(c.id, []);
3275
3279
  }), a.forEach((c) => {
3276
3280
  c.type === "e2s" && (s.get(c.target)?.push(c.source), r.get(c.source)?.push(c.target));
3277
- }), n.mode === "forward" ? kn(e, s, n) : $n(e, r, n);
3278
- }, kn = (e, a, n) => {
3281
+ }), n.mode === "forward" ? On(e, s, n) : $n(e, r, n);
3282
+ }, On = (e, a, n) => {
3279
3283
  const s = /* @__PURE__ */ new Map(), r = /* @__PURE__ */ new Set(), c = n.projectStart || /* @__PURE__ */ new Date(), b = (u) => {
3280
3284
  if (r.has(u)) return;
3281
3285
  const d = e.find((E) => E.id === u);
3282
3286
  if (!d) return;
3283
- const p = a.get(u) || [];
3284
- p.forEach((E) => b(E));
3285
- let h = c;
3286
- p.forEach((E) => {
3287
+ const h = a.get(u) || [];
3288
+ h.forEach((E) => b(E));
3289
+ let p = c;
3290
+ h.forEach((E) => {
3287
3291
  const F = s.get(E);
3288
- F && F.end > h && (h = new Date(F.end));
3292
+ F && F.end > p && (p = new Date(F.end));
3289
3293
  });
3290
- const v = new Date(h), y = Te(v, d.duration, "day"), m = {
3294
+ const S = new Date(p), y = Te(S, d.duration, "day"), m = {
3291
3295
  ...d,
3292
- start: v,
3296
+ start: S,
3293
3297
  end: y
3294
3298
  };
3295
3299
  s.set(u, m), r.add(u);
@@ -3302,17 +3306,17 @@ Example: 3FS+10d`);
3302
3306
  if (r.has(u)) return;
3303
3307
  const d = e.find((E) => E.id === u);
3304
3308
  if (!d) return;
3305
- const p = a.get(u) || [];
3306
- p.forEach((E) => b(E));
3307
- let h = c;
3308
- p.forEach((E) => {
3309
+ const h = a.get(u) || [];
3310
+ h.forEach((E) => b(E));
3311
+ let p = c;
3312
+ h.forEach((E) => {
3309
3313
  const F = s.get(E);
3310
- F && F.start < h && (h = new Date(F.start));
3314
+ F && F.start < p && (p = new Date(F.start));
3311
3315
  });
3312
- const v = new Date(h), y = Te(v, -d.duration, "day"), m = {
3316
+ const S = new Date(p), y = Te(S, -d.duration, "day"), m = {
3313
3317
  ...d,
3314
3318
  start: y,
3315
- end: v
3319
+ end: S
3316
3320
  };
3317
3321
  s.set(u, m), r.add(u);
3318
3322
  };
@@ -3328,13 +3332,13 @@ Example: 3FS+10d`);
3328
3332
  for (let c = 1; c < r.length; c++) {
3329
3333
  const b = r[c], u = r[c - 1];
3330
3334
  if (b.start < u.end) {
3331
- const d = n.findIndex((p) => p.id === b.id);
3335
+ const d = n.findIndex((h) => h.id === b.id);
3332
3336
  if (d >= 0) {
3333
- const p = new Date(u.end), h = Te(p, b.duration, "day");
3337
+ const h = new Date(u.end), p = Te(h, b.duration, "day");
3334
3338
  n[d] = {
3335
3339
  ...b,
3336
- start: p,
3337
- end: h
3340
+ start: h,
3341
+ end: p
3338
3342
  };
3339
3343
  }
3340
3344
  }
@@ -3357,8 +3361,8 @@ Example: 3FS+10d`);
3357
3361
  const a = ["ID", "Task Name", "Start Date", "End Date", "Duration", "Progress", "Type", "Owner", "Priority"], n = e.map((r) => [
3358
3362
  r.id,
3359
3363
  r.text,
3360
- Oe(r.start, "YYYY-MM-DD"),
3361
- Oe(r.end, "YYYY-MM-DD"),
3364
+ ke(r.start, "YYYY-MM-DD"),
3365
+ ke(r.end, "YYYY-MM-DD"),
3362
3366
  r.duration.toString(),
3363
3367
  `${r.progress}%`,
3364
3368
  r.type || "task",
@@ -3374,8 +3378,8 @@ Example: 3FS+10d`);
3374
3378
  const a = ["ID", "Task Name", "Start Date", "End Date", "Duration", "Progress", "Type", "Owner", "Priority", "Details"], n = e.map((r) => [
3375
3379
  r.id,
3376
3380
  r.text,
3377
- Oe(r.start, "MM/DD/YYYY"),
3378
- Oe(r.end, "MM/DD/YYYY"),
3381
+ ke(r.start, "MM/DD/YYYY"),
3382
+ ke(r.end, "MM/DD/YYYY"),
3379
3383
  r.duration.toString(),
3380
3384
  r.progress.toString(),
3381
3385
  r.type || "task",
@@ -3389,7 +3393,7 @@ Example: 3FS+10d`);
3389
3393
  ].join(`
3390
3394
  `);
3391
3395
  It(s, "gantt-tasks.xls", "application/vnd.ms-excel");
3392
- }, Or = (e, a) => {
3396
+ }, kr = (e, a) => {
3393
3397
  const n = {
3394
3398
  tasks: e,
3395
3399
  links: a,
@@ -3397,7 +3401,7 @@ Example: 3FS+10d`);
3397
3401
  version: "1.0"
3398
3402
  }, s = JSON.stringify(n, null, 2);
3399
3403
  It(s, "gantt-project.json", "application/json");
3400
- }, kr = (e) => {
3404
+ }, Or = (e) => {
3401
3405
  const a = `
3402
3406
  GANTT CHART PROJECT
3403
3407
  Generated: ${(/* @__PURE__ */ new Date()).toLocaleString()}
@@ -3405,8 +3409,8 @@ Generated: ${(/* @__PURE__ */ new Date()).toLocaleString()}
3405
3409
  Tasks:
3406
3410
  ${e.map((n, s) => `
3407
3411
  ${s + 1}. ${n.text}
3408
- Start: ${Oe(n.start, "MM/DD/YYYY")}
3409
- End: ${Oe(n.end, "MM/DD/YYYY")}
3412
+ Start: ${ke(n.start, "MM/DD/YYYY")}
3413
+ End: ${ke(n.end, "MM/DD/YYYY")}
3410
3414
  Duration: ${n.duration} days
3411
3415
  Progress: ${n.progress}%
3412
3416
  ${n.owner ? `Owner: ${n.owner}` : ""}
@@ -3449,8 +3453,8 @@ ${s + 1}. ${n.text}
3449
3453
  exportToCSV: Pr,
3450
3454
  exportToExcel: Nr,
3451
3455
  exportToImage: _n,
3452
- exportToJSON: Or,
3453
- exportToPDF: kr,
3456
+ exportToJSON: kr,
3457
+ exportToPDF: Or,
3454
3458
  importFromJSON: In
3455
3459
  }, Symbol.toStringTag, { value: "Module" })), zn = (e, a) => e.filter((n) => {
3456
3460
  if (a.searchText) {
@@ -3511,10 +3515,10 @@ ${s + 1}. ${n.text}
3511
3515
  if (s.length === 0) return;
3512
3516
  const r = a.getTime(), c = n.getTime();
3513
3517
  return s.map((b) => {
3514
- const u = Ve(b?.start, a), d = Ve(b?.end, n), p = Math.max(u.getTime(), r), h = Math.min(d.getTime(), c);
3518
+ const u = Ve(b?.start, a), d = Ve(b?.end, n), h = Math.max(u.getTime(), r), p = Math.min(d.getTime(), c);
3515
3519
  return {
3516
- start: new Date(p),
3517
- end: new Date(h)
3520
+ start: new Date(h),
3521
+ end: new Date(p)
3518
3522
  };
3519
3523
  }).filter((b) => b.end.getTime() > b.start.getTime());
3520
3524
  }, Vn = (e, a, n) => {
@@ -3534,7 +3538,7 @@ ${s + 1}. ${n.text}
3534
3538
  ), s = Ve(
3535
3539
  e.end ?? e.endDate ?? e.end_date ?? e.plannedEndDate,
3536
3540
  n
3537
- ), r = s.getTime() < n.getTime() ? n : s, c = Ve(e.plannedStart ?? e.planned_start ?? e.planned_start_date, n), b = Ve(e.plannedEnd ?? e.planned_end ?? e.planned_end_date, r), u = b.getTime() < c.getTime() ? c : b, d = Ve(e.actualStart ?? e.actual_start ?? e.actual_start_date, n), p = Ve(e.actualEnd ?? e.actual_end ?? e.actual_end_date, r), h = p.getTime() < d.getTime() ? d : p, v = Math.max(Math.ceil((r.getTime() - n.getTime()) / $r), 0), y = Bn(e.dependencies ?? e.dependsOn ?? e.depends_on), m = Hn(
3541
+ ), r = s.getTime() < n.getTime() ? n : s, c = Ve(e.plannedStart ?? e.planned_start ?? e.planned_start_date, n), b = Ve(e.plannedEnd ?? e.planned_end ?? e.planned_end_date, r), u = b.getTime() < c.getTime() ? c : b, d = Ve(e.actualStart ?? e.actual_start ?? e.actual_start_date, n), h = Ve(e.actualEnd ?? e.actual_end ?? e.actual_end_date, r), p = h.getTime() < d.getTime() ? d : h, S = Math.max(Math.ceil((r.getTime() - n.getTime()) / $r), 0), y = Bn(e.dependencies ?? e.dependsOn ?? e.depends_on), m = Hn(
3538
3542
  e.dependencyRule ?? e.dependency_rule ?? e.dependencyRuleDescription ?? e.dependency_rule_description
3539
3543
  ), E = Wn(
3540
3544
  Yr(
@@ -3558,8 +3562,8 @@ ${s + 1}. ${n.text}
3558
3562
  plannedStart: c,
3559
3563
  plannedEnd: u,
3560
3564
  actualStart: d,
3561
- actualEnd: h,
3562
- duration: nr(e.duration, v),
3565
+ actualEnd: p,
3566
+ duration: nr(e.duration, S),
3563
3567
  progress: Math.max(0, Math.min(100, nr(e.progress ?? e.progressPercentage ?? e.progress_percentage, 0))),
3564
3568
  type: e.type,
3565
3569
  parent: e.parent !== void 0 && e.parent !== null && String(e.parent).length > 0 ? String(e.parent) : void 0,
@@ -3756,16 +3760,16 @@ ${s + 1}. ${n.text}
3756
3760
  taskTooltipConfig: b = {},
3757
3761
  onHoldPeriods: u,
3758
3762
  on_hold_periods: d,
3759
- onHold: p,
3760
- on_hold: h,
3761
- onhold: v,
3763
+ onHold: h,
3764
+ on_hold: p,
3765
+ onhold: S,
3762
3766
  onTaskUpdate: y,
3763
3767
  onTaskDragUpdate: m,
3764
3768
  onTaskCreate: E,
3765
3769
  onTaskDelete: F,
3766
3770
  onLinkCreate: N,
3767
3771
  onLinkDelete: M,
3768
- onTimelineViewChange: S,
3772
+ onTimelineViewChange: v,
3769
3773
  baselines: w,
3770
3774
  showMonthHeading: C,
3771
3775
  showRangeHeading: Z,
@@ -3773,47 +3777,47 @@ ${s + 1}. ${n.text}
3773
3777
  }) => {
3774
3778
  const re = { ...Qn, ...s }, le = { ...Zn, ...b }, j = !!(n.timelineView || Array.isArray(n.timelineViews) && n.timelineViews.length > 0 || n.timelineViewScales), X = A.useMemo(() => {
3775
3779
  if (!j) return [];
3776
- const i = Array.isArray(n.timelineViews) && n.timelineViews.length > 0 ? n.timelineViews : xr;
3777
- return Array.from(new Set(i.filter((T) => xr.includes(T))));
3780
+ const l = Array.isArray(n.timelineViews) && n.timelineViews.length > 0 ? n.timelineViews : xr;
3781
+ return Array.from(new Set(l.filter((T) => xr.includes(T))));
3778
3782
  }, [n.timelineViews, j]), R = A.useMemo(
3779
3783
  () => ({
3780
3784
  ...yr,
3781
3785
  ...n.timelineViewScales
3782
3786
  }),
3783
3787
  [n.timelineViewScales]
3784
- ), O = A.useMemo(() => j && n.timelineView && X.includes(n.timelineView) ? n.timelineView : j && X.length > 0 ? X[0] : "day", [n.timelineView, j, X]), [B, Y] = G(O), k = j && X.includes(B) ? B : O, De = j ? R[k] || yr[k] : n.scales || Kn, Se = j && re.showTimelineViewSwitcher !== !1 && X.length > 1, V = Se ? X.map((i) => ({
3785
- value: i,
3786
- label: re.timelineViewLabels?.[i] || `${i.charAt(0).toUpperCase()}${i.slice(1)}s`
3788
+ ), k = A.useMemo(() => j && n.timelineView && X.includes(n.timelineView) ? n.timelineView : j && X.length > 0 ? X[0] : "day", [n.timelineView, j, X]), [B, Y] = J(k), O = j && X.includes(B) ? B : k, De = j ? R[O] || yr[O] : n.scales || Kn, Se = j && re.showTimelineViewSwitcher !== !1 && X.length > 1, V = Se ? X.map((l) => ({
3789
+ value: l,
3790
+ label: re.timelineViewLabels?.[l] || `${l.charAt(0).toUpperCase()}${l.slice(1)}s`
3787
3791
  })) : [], I = A.useMemo(() => {
3788
3792
  if (n.showTimelineHeader === !1) return 0;
3789
- let i = j ? Math.max(De.length - 1, 0) : 2;
3790
- if ((C === !1 || n.showMonthHeading === !1) && (i = Math.max(0, i - 1)), Z === !1 || n.showRangeHeading === !1) {
3793
+ let l = j ? Math.max(De.length - 1, 0) : 2;
3794
+ if ((C === !1 || n.showMonthHeading === !1) && (l = Math.max(0, l - 1)), Z === !1 || n.showRangeHeading === !1) {
3791
3795
  const T = j ? Math.max(0, De.length - 2) : 1;
3792
- i = Math.max(0, i - T);
3796
+ l = Math.max(0, l - T);
3793
3797
  }
3794
- return i + 1;
3798
+ return l + 1;
3795
3799
  }, [n.showTimelineHeader, n.showMonthHeading, C, n.showRangeHeading, Z, j, De.length]), ne = A.useMemo(() => {
3796
- const i = {};
3797
- return r.primary && (i["--wx-gantt-primary"] = r.primary), r.primarySelected && (i["--wx-gantt-primary-selected"] = r.primarySelected), r.success && (i["--wx-gantt-success"] = r.success), r.warning && (i["--wx-gantt-warning"] = r.warning), r.danger && (i["--wx-gantt-danger"] = r.danger), r.background && (i["--wx-gantt-background"] = r.background), r.backgroundAlt && (i["--wx-gantt-background-alt"] = r.backgroundAlt), r.backgroundHover && (i["--wx-gantt-background-hover"] = r.backgroundHover), r.selectColor && (i["--wx-gantt-select-color"] = r.selectColor), r.taskColor && (i["--wx-gantt-task-color"] = r.taskColor), r.taskFillColor && (i["--wx-gantt-task-fill-color"] = r.taskFillColor), r.projectColor && (i["--wx-gantt-project-color"] = r.projectColor), r.milestoneColor && (i["--wx-gantt-milestone-color"] = r.milestoneColor), r.fontColor && (i["--wx-gantt-font-color"] = r.fontColor), r.fontColorAlt && (i["--wx-gantt-font-color-alt"] = r.fontColorAlt), r.iconColor && (i["--wx-gantt-icon-color"] = r.iconColor), r.borderColor && (i["--wx-gantt-border-color"] = r.borderColor), r.fontFamily && (i["--wx-gantt-font-family"] = r.fontFamily), r.fontMono && (i["--wx-gantt-font-mono"] = r.fontMono), r.fontSize && (i["--wx-gantt-font-size"] = r.fontSize), r.fontWeight && (i["--wx-gantt-font-weight"] = String(r.fontWeight)), r.lineHeight && (i["--wx-gantt-line-height"] = String(r.lineHeight)), r.spacingXS && (i["--gantt-spacing-xs"] = r.spacingXS), r.spacingSM && (i["--gantt-spacing-sm"] = r.spacingSM), r.spacingMD && (i["--gantt-spacing-md"] = r.spacingMD), r.spacingLG && (i["--gantt-spacing-lg"] = r.spacingLG), r.customCSSVariables && Object.entries(r.customCSSVariables).forEach(([T, P]) => {
3798
- i[T.startsWith("--") ? T : `--${T}`] = P;
3799
- }), i["--gantt-header-rows"] = String(I), i;
3800
+ const l = {};
3801
+ return r.primary && (l["--wx-gantt-primary"] = r.primary), r.primarySelected && (l["--wx-gantt-primary-selected"] = r.primarySelected), r.success && (l["--wx-gantt-success"] = r.success), r.warning && (l["--wx-gantt-warning"] = r.warning), r.danger && (l["--wx-gantt-danger"] = r.danger), r.background && (l["--wx-gantt-background"] = r.background), r.backgroundAlt && (l["--wx-gantt-background-alt"] = r.backgroundAlt), r.backgroundHover && (l["--wx-gantt-background-hover"] = r.backgroundHover), r.selectColor && (l["--wx-gantt-select-color"] = r.selectColor), r.taskColor && (l["--wx-gantt-task-color"] = r.taskColor), r.taskFillColor && (l["--wx-gantt-task-fill-color"] = r.taskFillColor), r.projectColor && (l["--wx-gantt-project-color"] = r.projectColor), r.milestoneColor && (l["--wx-gantt-milestone-color"] = r.milestoneColor), r.fontColor && (l["--wx-gantt-font-color"] = r.fontColor), r.fontColorAlt && (l["--wx-gantt-font-color-alt"] = r.fontColorAlt), r.iconColor && (l["--wx-gantt-icon-color"] = r.iconColor), r.borderColor && (l["--wx-gantt-border-color"] = r.borderColor), r.fontFamily && (l["--wx-gantt-font-family"] = r.fontFamily), r.fontMono && (l["--wx-gantt-font-mono"] = r.fontMono), r.fontSize && (l["--wx-gantt-font-size"] = r.fontSize), r.fontWeight && (l["--wx-gantt-font-weight"] = String(r.fontWeight)), r.lineHeight && (l["--wx-gantt-line-height"] = String(r.lineHeight)), r.spacingXS && (l["--gantt-spacing-xs"] = r.spacingXS), r.spacingSM && (l["--gantt-spacing-sm"] = r.spacingSM), r.spacingMD && (l["--gantt-spacing-md"] = r.spacingMD), r.spacingLG && (l["--gantt-spacing-lg"] = r.spacingLG), r.customCSSVariables && Object.entries(r.customCSSVariables).forEach(([T, P]) => {
3802
+ l[T.startsWith("--") ? T : `--${T}`] = P;
3803
+ }), l["--gantt-header-rows"] = String(I), l;
3800
3804
  }, [r, I]), de = A.useMemo(() => {
3801
- const i = Yr(
3805
+ const l = Yr(
3802
3806
  u,
3803
3807
  d,
3804
- p,
3805
3808
  h,
3806
- v
3809
+ p,
3810
+ S
3807
3811
  );
3808
- if (i.length === 0) return [];
3812
+ if (l.length === 0) return [];
3809
3813
  const T = /* @__PURE__ */ new Date();
3810
- return i.map((P) => ({
3814
+ return l.map((P) => ({
3811
3815
  start: Ve(P.start, T),
3812
3816
  end: Ve(P.end, T)
3813
3817
  })).filter((P) => P.end.getTime() > P.start.getTime());
3814
- }, [u, d, p, h, v]), se = A.useMemo(() => {
3815
- const i = Un(e);
3816
- return Gn(i, de);
3818
+ }, [u, d, h, p, S]), se = A.useMemo(() => {
3819
+ const l = Un(e);
3820
+ return Gn(l, de);
3817
3821
  }, [e, de]), ue = Array.isArray(a) ? a : [], {
3818
3822
  tasks: z,
3819
3823
  links: ye,
@@ -3821,22 +3825,22 @@ ${s + 1}. ${n.text}
3821
3825
  setLinks: Ie,
3822
3826
  undo: Ye,
3823
3827
  redo: $,
3824
- updateTask: J,
3828
+ updateTask: q,
3825
3829
  createTask: xe,
3826
3830
  deleteTask: Qe,
3827
3831
  saveState: ce
3828
- } = On(se, ue), [me, Fe] = G(z), [pe, et] = G(null), [_e, Xe] = G(null), [Ue, ot] = G(!1), [l, g] = G(void 0), [D, f] = G(void 0), [U, q] = G(!1), [ee, ie] = G(null), [$e, ze] = G(null), [ge, tt] = G(null), [Ke, st] = G(null), [Ce, ht] = G(null), [xt, Ot] = G(1), [qe, it] = G(() => w && w.size > 0 ? w : se.length > 0 ? Yn(se) : /* @__PURE__ */ new Map());
3832
+ } = kn(se, ue), [me, Fe] = J(z), [pe, et] = J(null), [_e, Xe] = J(null), [Ue, ot] = J(!1), [i, g] = J(void 0), [D, f] = J(void 0), [U, G] = J(!1), [ee, ie] = J(null), [$e, ze] = J(null), [ge, tt] = J(null), [Ke, st] = J(null), [Ce, ht] = J(null), [xt, kt] = J(1), [qe, it] = J(() => w && w.size > 0 ? w : se.length > 0 ? Yn(se) : /* @__PURE__ */ new Map());
3829
3833
  ut(() => {
3830
3834
  w && w.size > 0 && it(w);
3831
3835
  }, [w]), ut(() => {
3832
- j && Y(O);
3833
- }, [j, O]);
3834
- const [wt] = G(n.theme || "light"), [Tt, zt] = G({
3836
+ j && Y(k);
3837
+ }, [j, k]);
3838
+ const [wt] = J(n.theme || "light"), [Tt, zt] = J({
3835
3839
  searchText: "",
3836
3840
  status: "all",
3837
3841
  priority: "all",
3838
3842
  owner: ""
3839
- }), Dt = ft(null), Mt = ft(null), kt = ft(null), Et = ft(null), lt = ft(null), $t = ft(null), Ae = {
3843
+ }), Dt = ft(null), Mt = ft(null), Ot = ft(null), Et = ft(null), lt = ft(null), $t = ft(null), Ae = {
3840
3844
  ...{
3841
3845
  columns: n.columns || Jn(s),
3842
3846
  readonly: !1,
@@ -3898,7 +3902,7 @@ ${s + 1}. ${n.text}
3898
3902
  },
3899
3903
  ...n,
3900
3904
  scales: De,
3901
- timelineView: j ? k : n.timelineView,
3905
+ timelineView: j ? O : n.timelineView,
3902
3906
  timelineViews: j ? X : n.timelineViews,
3903
3907
  timelineViewScales: j ? R : n.timelineViewScales,
3904
3908
  // IMPORTANT: Re-apply baselines after spread so undefined from config doesn't override the default.
@@ -3909,7 +3913,7 @@ ${s + 1}. ${n.text}
3909
3913
  relativeDayNumbering: W !== void 0 ? W : n.relativeDayNumbering
3910
3914
  };
3911
3915
  ut(() => {
3912
- const i = zn(z, Tt);
3916
+ const l = zn(z, Tt);
3913
3917
  Fe(((P) => {
3914
3918
  const H = [], ae = (fe) => {
3915
3919
  if (!fe) return !1;
@@ -3919,71 +3923,71 @@ ${s + 1}. ${n.text}
3919
3923
  return P.forEach((fe) => {
3920
3924
  ae(fe.parent) || H.push(fe);
3921
3925
  }), H;
3922
- })(i));
3926
+ })(l));
3923
3927
  }, [z, Tt]);
3924
3928
  const Ht = A.useMemo(() => {
3925
3929
  if (!z || !Array.isArray(z)) return [];
3926
3930
  try {
3927
- return Array.from(new Set(z.map((i) => i?.owner).filter(Boolean)));
3928
- } catch (i) {
3929
- return console.warn("Error extracting owners:", i), [];
3931
+ return Array.from(new Set(z.map((l) => l?.owner).filter(Boolean)));
3932
+ } catch (l) {
3933
+ return console.warn("Error extracting owners:", l), [];
3930
3934
  }
3931
3935
  }, [z]), Wt = (() => {
3932
- const i = De[De.length - 1] || De[0], T = me.length > 0 ? me : z;
3936
+ const l = De[De.length - 1] || De[0], T = me.length > 0 ? me : z;
3933
3937
  if (T.length === 0) {
3934
3938
  const ve = /* @__PURE__ */ new Date();
3935
3939
  return {
3936
- start: _t(Te(ve, -30, "day"), i, "start"),
3937
- end: _t(Te(ve, 60, "day"), i, "end")
3940
+ start: _t(Te(ve, -30, "day"), l, "start"),
3941
+ end: _t(Te(ve, 60, "day"), l, "end")
3938
3942
  };
3939
3943
  }
3940
3944
  const P = T.map((ve) => ve.start.getTime()), H = T.map((ve) => ve.end.getTime()), ae = new Date(Math.min(...P)), fe = new Date(Math.max(...H));
3941
3945
  return {
3942
- start: _t(Te(ae, -7, "day"), i, "start"),
3943
- end: _t(fe, i, "end")
3946
+ start: _t(Te(ae, -7, "day"), l, "start"),
3947
+ end: _t(fe, l, "end")
3944
3948
  };
3945
- })(), Vt = (i) => {
3946
- !X.includes(i) || i === k || (Y(i), S?.(i));
3947
- }, o = (i) => {
3948
- et(i);
3949
- }, x = (i, T) => {
3949
+ })(), Vt = (l) => {
3950
+ !X.includes(l) || l === O || (Y(l), v?.(l));
3951
+ }, o = (l) => {
3952
+ et(l);
3953
+ }, x = (l, T) => {
3950
3954
  if (Ae.readonly) return;
3951
- i.preventDefault();
3955
+ l.preventDefault();
3952
3956
  const P = z.find((H) => H.id === T);
3953
- P && ht({ x: i.clientX, y: i.clientY, task: P });
3957
+ P && ht({ x: l.clientX, y: l.clientY, task: P });
3954
3958
  }, L = () => {
3955
3959
  if (!Ce?.task) return;
3956
- const i = Ce.task, T = {
3957
- ...i,
3960
+ const l = Ce.task, T = {
3961
+ ...l,
3958
3962
  id: `task-${Date.now()}`,
3959
- text: `${i.text} (Copy)`,
3960
- start: Te(i.start, 7, "day"),
3961
- end: Te(i.end, 7, "day")
3963
+ text: `${l.text} (Copy)`,
3964
+ start: Te(l.start, 7, "day"),
3965
+ end: Te(l.end, 7, "day")
3962
3966
  };
3963
3967
  xe(T), E && E(T);
3964
- }, _ = (i) => {
3968
+ }, _ = (l) => {
3965
3969
  if (!Ce?.task) return;
3966
- const T = { ...Ce.task, type: i };
3967
- J(T), y && y(T);
3968
- }, te = A.useCallback((i, T) => {
3970
+ const T = { ...Ce.task, type: l };
3971
+ q(T), y && y(T);
3972
+ }, te = A.useCallback((l, T) => {
3969
3973
  let P = [];
3970
- return T.filter((ae) => ae.parent === i).forEach((ae) => {
3974
+ return T.filter((ae) => ae.parent === l).forEach((ae) => {
3971
3975
  P.push(ae.id), P = [...P, ...te(ae.id, T)];
3972
3976
  }), P;
3973
- }, []), oe = (i, T) => (i ?? null) === (T ?? null), Q = (i, T, P, H) => {
3977
+ }, []), oe = (l, T) => (l ?? null) === (T ?? null), Q = (l, T, P, H) => {
3974
3978
  if (!Ae.readonly)
3975
3979
  if (H === "reorder") {
3976
- const ae = me.findIndex((ve) => ve.id === i), fe = te(i, z);
3977
- tt({ id: i, initialIndex: ae, currentX: T, currentY: P, descendantIds: fe }), document.body.classList.add("gantt-dragging");
3980
+ const ae = me.findIndex((ve) => ve.id === l), fe = te(l, z);
3981
+ tt({ id: l, initialIndex: ae, currentX: T, currentY: P, descendantIds: fe }), document.body.classList.add("gantt-dragging");
3978
3982
  } else
3979
- ze(i);
3983
+ ze(l);
3980
3984
  }, K = () => {
3981
3985
  if (ge && Ke) {
3982
- const i = z.find((P) => P.id === ge.id), T = z.find((P) => P.id === Ke.taskId);
3983
- if (i && T && i.id !== T.id) {
3984
- const P = [i.id, ...ge.descendantIds];
3986
+ const l = z.find((P) => P.id === ge.id), T = z.find((P) => P.id === Ke.taskId);
3987
+ if (l && T && l.id !== T.id) {
3988
+ const P = [l.id, ...ge.descendantIds];
3985
3989
  if (!P.includes(T.id)) {
3986
- const H = [...z], ae = (Ke.position === "inside" ? T.id : T.parent) ?? void 0, fe = H.findIndex((he) => he.id === i.id);
3990
+ const H = [...z], ae = (Ke.position === "inside" ? T.id : T.parent) ?? void 0, fe = H.findIndex((he) => he.id === l.id);
3987
3991
  fe !== -1 && (H[fe] = { ...H[fe], parent: ae });
3988
3992
  const ve = H.filter((he) => P.includes(he.id)), Me = H.filter((he) => !P.includes(he.id));
3989
3993
  let He = Me.findIndex((he) => he.id === T.id);
@@ -3997,11 +4001,11 @@ ${s + 1}. ${n.text}
3997
4001
  He < 0 && (He = Me.length);
3998
4002
  const Lt = { tasks: [...z], links: [...ye] };
3999
4003
  Me.splice(He, 0, ...ve), Le(Me), ce("task_update", Lt, { tasks: Me, links: ye });
4000
- const mt = z.filter((he) => oe(he.parent, i.parent)).findIndex((he) => he.id === i.id) + 1, sr = Me.filter((he) => oe(he.parent, ae)).findIndex((he) => he.id === i.id) + 1, ir = {
4004
+ const mt = z.filter((he) => oe(he.parent, l.parent)).findIndex((he) => he.id === l.id) + 1, sr = Me.filter((he) => oe(he.parent, ae)).findIndex((he) => he.id === l.id) + 1, ir = {
4001
4005
  currentSequenceId: mt,
4002
4006
  targetSequenceId: sr,
4003
4007
  targetStageId: ae ?? null
4004
- }, lr = Me.find((he) => he.id === i.id);
4008
+ }, lr = Me.find((he) => he.id === l.id);
4005
4009
  if (lr) {
4006
4010
  const he = {
4007
4011
  ...lr,
@@ -4010,7 +4014,7 @@ ${s + 1}. ${n.text}
4010
4014
  };
4011
4015
  y && y(he, ir), m && m({
4012
4016
  task: he,
4013
- previousTask: i,
4017
+ previousTask: l,
4014
4018
  dragType: "reorder",
4015
4019
  reorderMeta: ir
4016
4020
  });
@@ -4019,9 +4023,9 @@ ${s + 1}. ${n.text}
4019
4023
  }
4020
4024
  }
4021
4025
  ze(null), tt(null), st(null), document.body.classList.remove("gantt-dragging");
4022
- }, Re = ft(null), we = A.useCallback((i) => {
4026
+ }, Re = ft(null), we = A.useCallback((l) => {
4023
4027
  if (ge) {
4024
- const { clientX: T, clientY: P } = i;
4028
+ const { clientX: T, clientY: P } = l;
4025
4029
  Re.current && cancelAnimationFrame(Re.current), Re.current = requestAnimationFrame(() => {
4026
4030
  const H = Ae.rowHeight || 48, ae = Mt.current?.querySelector(".gantt-grid-body");
4027
4031
  if (!ae || me.length === 0) {
@@ -4046,9 +4050,9 @@ ${s + 1}. ${n.text}
4046
4050
  }
4047
4051
  }, [ge, me, Ae.rowHeight]), be = () => {
4048
4052
  ge && K();
4049
- }, Be = (i, T) => {
4053
+ }, Be = (l, T) => {
4050
4054
  const P = {
4051
- ...i,
4055
+ ...l,
4052
4056
  id: `task-${Date.now()}`,
4053
4057
  parent: T
4054
4058
  // Set parent if provided (for subtasks)
@@ -4065,27 +4069,27 @@ ${s + 1}. ${n.text}
4065
4069
  const fe = new Map(ae);
4066
4070
  return fe.set(P.id, H), fe;
4067
4071
  }), E && E(P);
4068
- }, Ge = (i) => {
4069
- J(i), y && y(i);
4070
- }, Ze = (i) => {
4071
- Qe(i), it((T) => {
4072
+ }, Ge = (l) => {
4073
+ q(l), y && y(l);
4074
+ }, Ze = (l) => {
4075
+ Qe(l), it((T) => {
4072
4076
  const P = new Map(T);
4073
- return P.delete(i), P;
4074
- }), F && F(i);
4075
- }, Ne = (i, T, P, H) => {
4076
- const ae = { id: `link-${Date.now()}`, source: i, target: T, type: P, lag: H };
4077
+ return P.delete(l), P;
4078
+ }), F && F(l);
4079
+ }, Ne = (l, T, P, H) => {
4080
+ const ae = { id: `link-${Date.now()}`, source: l, target: T, type: P, lag: H };
4077
4081
  Ie([...ye, ae]), N && N(ae);
4078
- }, bt = (i) => {
4079
- const T = ye.filter((P) => P.id !== i);
4080
- Ie(T), M && M(i);
4082
+ }, bt = (l) => {
4083
+ const T = ye.filter((P) => P.id !== l);
4084
+ Ie(T), M && M(l);
4081
4085
  };
4082
4086
  ut(() => {
4083
4087
  if (w && w.size > 0)
4084
4088
  return;
4085
- const i = new Map(qe);
4089
+ const l = new Map(qe);
4086
4090
  let T = !1;
4087
4091
  z.forEach((H) => {
4088
- qe.has(H.id) || (i.set(H.id, {
4092
+ qe.has(H.id) || (l.set(H.id, {
4089
4093
  taskId: H.id,
4090
4094
  start: new Date(H.plannedStart ?? H.start),
4091
4095
  // Use planned dates if available
@@ -4095,27 +4099,27 @@ ${s + 1}. ${n.text}
4095
4099
  });
4096
4100
  const P = new Set(z.map((H) => H.id));
4097
4101
  qe.forEach((H, ae) => {
4098
- P.has(ae) || (i.delete(ae), T = !0);
4099
- }), T && it(i);
4102
+ P.has(ae) || (l.delete(ae), T = !0);
4103
+ }), T && it(l);
4100
4104
  }, [z, w]), ut(() => {
4101
- const i = (T) => {
4105
+ const l = (T) => {
4102
4106
  (T.ctrlKey || T.metaKey) && (T.key === "z" && !T.shiftKey ? (T.preventDefault(), Ye()) : (T.key === "y" || T.key === "z" && T.shiftKey) && (T.preventDefault(), $()));
4103
4107
  };
4104
- return window.addEventListener("keydown", i), () => window.removeEventListener("keydown", i);
4108
+ return window.addEventListener("keydown", l), () => window.removeEventListener("keydown", l);
4105
4109
  }, [Ye, $]), ut(() => {
4106
- const i = Mt.current?.querySelector(".gantt-grid-body"), T = Dt.current?.querySelector(".gantt-timeline-body");
4107
- if (!i || !T) return;
4110
+ const l = Mt.current?.querySelector(".gantt-grid-body"), T = Dt.current?.querySelector(".gantt-timeline-body");
4111
+ if (!l || !T) return;
4108
4112
  const P = () => {
4109
- lt.current !== "timeline" && (lt.current = "grid", T.scrollTop = i.scrollTop, requestAnimationFrame(() => {
4113
+ lt.current !== "timeline" && (lt.current = "grid", T.scrollTop = l.scrollTop, requestAnimationFrame(() => {
4110
4114
  lt.current = null;
4111
4115
  }));
4112
4116
  }, H = () => {
4113
- lt.current !== "grid" && (lt.current = "timeline", i.scrollTop = T.scrollTop, requestAnimationFrame(() => {
4117
+ lt.current !== "grid" && (lt.current = "timeline", l.scrollTop = T.scrollTop, requestAnimationFrame(() => {
4114
4118
  lt.current = null;
4115
4119
  }));
4116
4120
  };
4117
- return i.addEventListener("scroll", P, { passive: !0 }), T.addEventListener("scroll", H, { passive: !0 }), () => {
4118
- i.removeEventListener("scroll", P), T.removeEventListener("scroll", H), $t.current && clearTimeout($t.current);
4121
+ return l.addEventListener("scroll", P, { passive: !0 }), T.addEventListener("scroll", H, { passive: !0 }), () => {
4122
+ l.removeEventListener("scroll", P), T.removeEventListener("scroll", H), $t.current && clearTimeout($t.current);
4119
4123
  };
4120
4124
  }, [me]);
4121
4125
  const Xt = {
@@ -4143,19 +4147,19 @@ ${s + 1}. ${n.text}
4143
4147
  Tn,
4144
4148
  {
4145
4149
  zoomLevel: xt,
4146
- setZoomLevel: Ot,
4147
- timelineView: Se ? k : void 0,
4150
+ setZoomLevel: kt,
4151
+ timelineView: Se ? O : void 0,
4148
4152
  timelineViewOptions: V,
4149
4153
  onTimelineViewChange: Se ? Vt : void 0,
4150
- onExport: (i) => {
4151
- i === "csv" && Pr(z), i === "excel" && Nr(z), i === "json" && Or(z, ye), i === "pdf" && kr(z);
4154
+ onExport: (l) => {
4155
+ l === "csv" && Pr(z), l === "excel" && Nr(z), l === "json" && kr(z, ye), l === "pdf" && Or(z);
4152
4156
  },
4153
- onFilterChange: (i) => zt(i),
4157
+ onFilterChange: (l) => zt(l),
4154
4158
  owners: Ht || [],
4155
- onAddTask: (i) => {
4156
- if (i) {
4157
- const T = z.find((P) => P.id === i);
4158
- g(i), f(T?.text);
4159
+ onAddTask: (l) => {
4160
+ if (l) {
4161
+ const T = z.find((P) => P.id === l);
4162
+ g(l), f(T?.text);
4159
4163
  } else
4160
4164
  g(void 0), f(void 0);
4161
4165
  ot(!0);
@@ -4165,7 +4169,7 @@ ${s + 1}. ${n.text}
4165
4169
  styleConfig: r
4166
4170
  }
4167
4171
  ),
4168
- /* @__PURE__ */ t.jsxs("div", { className: "gantt-layout", ref: kt, onMouseMove: we, onMouseUp: be, onMouseLeave: be, children: [
4172
+ /* @__PURE__ */ t.jsxs("div", { className: "gantt-layout", ref: Ot, onMouseMove: we, onMouseUp: be, onMouseLeave: be, children: [
4169
4173
  /* @__PURE__ */ t.jsx(
4170
4174
  Er,
4171
4175
  {
@@ -4177,19 +4181,19 @@ ${s + 1}. ${n.text}
4177
4181
  onTaskContextMenu: x,
4178
4182
  onTaskUpdate: Ge,
4179
4183
  onTaskDragStart: Q,
4180
- onAddTask: (i) => {
4181
- if (i) {
4182
- const T = z.find((P) => P.id === i);
4183
- g(i), f(T?.text);
4184
+ onAddTask: (l) => {
4185
+ if (l) {
4186
+ const T = z.find((P) => P.id === l);
4187
+ g(l), f(T?.text);
4184
4188
  } else
4185
4189
  g(void 0), f(void 0);
4186
4190
  ot(!0);
4187
4191
  },
4188
4192
  onAddDependency: Ne,
4189
4193
  onRemoveDependency: bt,
4190
- onDependencyClick: (i) => {
4191
- const T = z.find((P) => P.id === i);
4192
- T && (ie(T), q(!0));
4194
+ onDependencyClick: (l) => {
4195
+ const T = z.find((P) => P.id === l);
4196
+ T && (ie(T), G(!0));
4193
4197
  },
4194
4198
  links: ye,
4195
4199
  allTasks: z,
@@ -4217,8 +4221,8 @@ ${s + 1}. ${n.text}
4217
4221
  },
4218
4222
  onTaskDragEnd: () => {
4219
4223
  },
4220
- onTaskUpdate: (i, T, P) => {
4221
- const H = z.find((ve) => ve.id === i);
4224
+ onTaskUpdate: (l, T, P) => {
4225
+ const H = z.find((ve) => ve.id === l);
4222
4226
  if (!H) return;
4223
4227
  const ae = { ...H }, fe = { ...H, ...T };
4224
4228
  Ge(fe), P && m && m({
@@ -4242,7 +4246,7 @@ ${s + 1}. ${n.text}
4242
4246
  ot(!1), g(void 0), f(void 0);
4243
4247
  },
4244
4248
  uiConfig: re,
4245
- parentId: l,
4249
+ parentId: i,
4246
4250
  parentTaskName: D,
4247
4251
  styleConfig: r
4248
4252
  }
@@ -4258,14 +4262,14 @@ ${s + 1}. ${n.text}
4258
4262
  onRemoveDependency: bt,
4259
4263
  onTaskUpdate: Ge,
4260
4264
  onClose: () => {
4261
- q(!1), ie(null);
4265
+ G(!1), ie(null);
4262
4266
  },
4263
4267
  styleConfig: r
4264
4268
  }
4265
4269
  ),
4266
4270
  Ce && /* @__PURE__ */ t.jsxs(t.Fragment, { children: [
4267
- /* @__PURE__ */ t.jsx("div", { className: "gantt-context-menu-overlay", onClick: () => ht(null), onContextMenu: (i) => {
4268
- i.preventDefault(), ht(null);
4271
+ /* @__PURE__ */ t.jsx("div", { className: "gantt-context-menu-overlay", onClick: () => ht(null), onContextMenu: (l) => {
4272
+ l.preventDefault(), ht(null);
4269
4273
  } }),
4270
4274
  /* @__PURE__ */ t.jsx(
4271
4275
  Nn,
@@ -4281,15 +4285,15 @@ ${s + 1}. ${n.text}
4281
4285
  },
4282
4286
  onCopy: L,
4283
4287
  onDependencies: () => {
4284
- Ce.task && (ie(Ce.task), q(!0));
4288
+ Ce.task && (ie(Ce.task), G(!0));
4285
4289
  },
4286
4290
  onConvertToMilestone: () => _("milestone"),
4287
4291
  onConvertToTask: () => _("task"),
4288
4292
  onConvertToProject: () => _("project"),
4289
4293
  onClose: () => ht(null),
4290
4294
  onAutoSchedule: () => {
4291
- const i = Rr(z, ye, { mode: "forward" });
4292
- Le(i), ht(null);
4295
+ const l = Rr(z, ye, { mode: "forward" });
4296
+ Le(l), ht(null);
4293
4297
  },
4294
4298
  iconConfig: c,
4295
4299
  styleConfig: r
@@ -4297,8 +4301,8 @@ ${s + 1}. ${n.text}
4297
4301
  )
4298
4302
  ] }),
4299
4303
  ge && (() => {
4300
- const i = z.find((He) => He.id === ge.id);
4301
- if (!i) return null;
4304
+ const l = z.find((He) => He.id === ge.id);
4305
+ if (!l) return null;
4302
4306
  const T = Number.isFinite(ge.currentX) ? ge.currentX : 0, P = Number.isFinite(ge.currentY) ? ge.currentY : 0, H = Ae.rowHeight || 48, fe = Et.current?.getBoundingClientRect(), ve = fe ? T - fe.left + 12 : T + 12, Me = fe ? P - fe.top + 12 : P + 12;
4303
4307
  return /* @__PURE__ */ t.jsxs(
4304
4308
  "div",
@@ -4314,7 +4318,7 @@ ${s + 1}. ${n.text}
4314
4318
  maxWidth: "420px"
4315
4319
  },
4316
4320
  children: [
4317
- /* @__PURE__ */ t.jsx("span", { className: "gantt-drag-preview-name", title: i.text, children: i.text }),
4321
+ /* @__PURE__ */ t.jsx("span", { className: "gantt-drag-preview-name", title: l.text, children: l.text }),
4318
4322
  ge.descendantIds.length > 0 && /* @__PURE__ */ t.jsxs("span", { className: "gantt-drag-preview-count", children: [
4319
4323
  "+",
4320
4324
  ge.descendantIds.length
@@ -4346,38 +4350,38 @@ ${s + 1}. ${n.text}
4346
4350
  b.set(m, 0), u.set(m, F.duration);
4347
4351
  else {
4348
4352
  let M = 0;
4349
- N.forEach((S) => {
4350
- d(S, E);
4351
- const w = u.get(S) || 0;
4353
+ N.forEach((v) => {
4354
+ d(v, E);
4355
+ const w = u.get(v) || 0;
4352
4356
  M = Math.max(M, w);
4353
4357
  }), b.set(m, M), u.set(m, M + F.duration);
4354
4358
  }
4355
4359
  };
4356
4360
  e.forEach((m) => d(m.id));
4357
- const p = /* @__PURE__ */ new Map(), h = /* @__PURE__ */ new Map(), v = Math.max(...Array.from(u.values())), y = (m, E = /* @__PURE__ */ new Set()) => {
4361
+ const h = /* @__PURE__ */ new Map(), p = /* @__PURE__ */ new Map(), S = Math.max(...Array.from(u.values())), y = (m, E = /* @__PURE__ */ new Set()) => {
4358
4362
  if (E.has(m)) return;
4359
4363
  E.add(m);
4360
4364
  const F = e.find((M) => M.id === m);
4361
4365
  if (!F) return;
4362
4366
  const N = r.get(m) || [];
4363
4367
  if (N.length === 0)
4364
- h.set(m, v), p.set(m, v - F.duration);
4368
+ p.set(m, S), h.set(m, S - F.duration);
4365
4369
  else {
4366
4370
  let M = 1 / 0;
4367
- N.forEach((S) => {
4368
- y(S, E);
4369
- const w = p.get(S) || 0;
4371
+ N.forEach((v) => {
4372
+ y(v, E);
4373
+ const w = h.get(v) || 0;
4370
4374
  M = Math.min(M, w);
4371
- }), h.set(m, M), p.set(m, M - F.duration);
4375
+ }), p.set(m, M), h.set(m, M - F.duration);
4372
4376
  }
4373
4377
  };
4374
4378
  return e.forEach((m) => y(m.id)), e.forEach((m) => {
4375
- const E = b.get(m.id) || 0, N = (p.get(m.id) || 0) - E;
4379
+ const E = b.get(m.id) || 0, N = (h.get(m.id) || 0) - E;
4376
4380
  s.set(m.id, N), Math.abs(N) < 0.01 && n.add(m.id);
4377
4381
  }), {
4378
4382
  criticalTasks: n,
4379
4383
  taskFloats: s,
4380
- projectDuration: v
4384
+ projectDuration: S
4381
4385
  };
4382
4386
  }, ta = (e, a) => a.criticalTasks.has(e), ra = (e, a) => a.taskFloats.get(e) || 0, ha = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
4383
4387
  __proto__: null,
@@ -4403,12 +4407,12 @@ export {
4403
4407
  zn as applyFilters,
4404
4408
  da as calculateDuration,
4405
4409
  Yn as createBaseline,
4406
- Oe as formatDate,
4410
+ ke as formatDate,
4407
4411
  Nt as getDaysBetween,
4408
4412
  la as getEndOfDay,
4409
4413
  pn as getHoursBetween,
4410
4414
  yt as getStartOfDay,
4411
4415
  Zt as isHoliday,
4412
4416
  Kt as isWeekend,
4413
- On as useUndoRedo
4417
+ kn as useUndoRedo
4414
4418
  };